@e-llm-studio/instant-learning 1.3.0-alpha.16 → 1.3.0-alpha.161
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +718 -10
- package/dist/ComponentRegistry.js +2 -0
- package/dist/ComponentRegistry.js.map +1 -0
- package/dist/ContinueWithTemplateModal.js +2 -0
- package/dist/ContinueWithTemplateModal.js.map +1 -0
- package/dist/ContinueWithTemplateModal.module.css.js +2 -0
- package/dist/ContinueWithTemplateModal.module.css.js.map +1 -0
- package/dist/ILMarketplaceWrapper.js +2 -0
- package/dist/ILMarketplaceWrapper.js.map +1 -0
- package/dist/ILMarketplaceWrapper.module.css.js +2 -0
- package/dist/ILMarketplaceWrapper.module.css.js.map +1 -0
- package/dist/api/transport.js +2 -0
- package/dist/api/transport.js.map +1 -0
- package/dist/cjs/ComponentRegistry.js +2 -0
- package/dist/cjs/ComponentRegistry.js.map +1 -0
- package/dist/cjs/ContinueWithTemplateModal.js +2 -0
- package/dist/cjs/ContinueWithTemplateModal.js.map +1 -0
- package/dist/cjs/ContinueWithTemplateModal.module.css.js +2 -0
- package/dist/cjs/ContinueWithTemplateModal.module.css.js.map +1 -0
- package/dist/cjs/ILMarketplaceWrapper.js +2 -0
- package/dist/cjs/ILMarketplaceWrapper.js.map +1 -0
- package/dist/cjs/ILMarketplaceWrapper.module.css.js +2 -0
- package/dist/cjs/ILMarketplaceWrapper.module.css.js.map +1 -0
- package/dist/cjs/api/transport.js +2 -0
- package/dist/cjs/api/transport.js.map +1 -0
- package/dist/cjs/features/DocumentLearning/DocumentLearning.js +1 -1
- package/dist/cjs/features/DocumentLearning/_components/BookLearningForm.js +1 -1
- package/dist/cjs/features/DocumentLearning/_components/ChatComponent.js +1 -1
- package/dist/cjs/features/IL-OTJ/ILOTJ.js +1 -1
- package/dist/cjs/features/IL-OTJ/ILOTJTest.js +1 -1
- package/dist/cjs/features/IL-OTJ/ValueTypeWrappers/TeachMePlugin.js +1 -1
- package/dist/cjs/features/IL-OTJ/ValueTypeWrappers/TeachMeWrapper.js +1 -1
- package/dist/cjs/features/IL-OTJ/_components/ChatComponents/ChatComponent.js +1 -1
- package/dist/cjs/features/IL-OTJ/_components/ChatComponents/NormalChat.js +1 -1
- package/dist/cjs/features/IL-OTJ/_components/CitationLink.js +1 -1
- package/dist/cjs/features/IL-OTJ/_components/ConflictingReasoningCard.js +1 -1
- package/dist/cjs/features/IL-OTJ/_components/CriticalGaps.js +1 -1
- package/dist/cjs/features/IL-OTJ/_components/ILPopup.js +1 -1
- package/dist/cjs/features/IL-OTJ/_components/InputDataReasoningCard.js +1 -1
- package/dist/cjs/features/IL-OTJ/_components/MarkdownComponents/MarkdownElements.js +1 -1
- package/dist/cjs/features/IL-OTJ/_components/MarkdownComponents/MarkdownSelect.js +1 -1
- package/dist/cjs/features/IL-OTJ/_components/MarkdownRenderer.js +2 -0
- package/dist/cjs/features/IL-OTJ/_components/MarkdownRenderer.js.map +1 -0
- package/dist/cjs/features/IL-OTJ/_components/MarkdownRenderer.module.css.js +2 -0
- package/dist/cjs/features/IL-OTJ/_components/MarkdownRenderer.module.css.js.map +1 -0
- package/dist/cjs/features/IL-OTJ/_components/MessageRendering/ClickableChatComponents.js +1 -1
- package/dist/cjs/features/IL-OTJ/_components/MessageRendering/RuleValidationCard.js +1 -1
- package/dist/cjs/features/IL-OTJ/_components/ViewFormUpdateCard.js +1 -1
- package/dist/cjs/features/IL-OTJ/_components/ViewIdentifiedFieldsCard.js +1 -1
- package/dist/cjs/features/IL-OTJ/_components/organisms/DropdownSection/DropdownSection.js +2 -0
- package/dist/cjs/features/IL-OTJ/_components/organisms/DropdownSection/DropdownSection.js.map +1 -0
- package/dist/cjs/features/IL-OTJ/_components/templates/RuleComparison/AgentComposerRuleComparison.js +1 -1
- package/dist/cjs/features/IL-OTJ/_components/templates/RuleComparison/RuleComparison.js +1 -1
- package/dist/cjs/features/IL-OTJ/_components/templates/RuleComparison/RuleComparisonNew.js +1 -1
- package/dist/cjs/features/IL-OTJ/_components/templates/SchemaDriven/SchemaDrivenCreateRule.js +2 -0
- package/dist/cjs/features/IL-OTJ/_components/templates/SchemaDriven/SchemaDrivenCreateRule.js.map +1 -0
- package/dist/cjs/features/IL-OTJ/_components/templates/TemplatesMap/templatesMap.js +1 -1
- package/dist/cjs/features/IL-OTJ/_components/templates/TrafficManager/CreateRule.js +1 -1
- package/dist/cjs/features/IL-OTJ/helpers/message-rendering-utils.js +1 -1
- package/dist/cjs/features/IL-marketplace/components/GuidelineCardMenu.js +2 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineCardMenu.js.map +1 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineCardMenu.module.css.js +2 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineCardMenu.module.css.js.map +1 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineCart.js +2 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineCart.js.map +1 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineCart.module.css.js +2 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineCart.module.css.js.map +1 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineCartHeader.js +2 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineCartHeader.js.map +1 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineCartHeader.module.css.js +2 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineCartHeader.module.css.js.map +1 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineCartItem.js +2 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineCartItem.js.map +1 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineCartItem.module.css.js +2 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineCartItem.module.css.js.map +1 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineConfirmDialog.js +2 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineConfirmDialog.js.map +1 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineConfirmDialog.module.css.js +2 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineConfirmDialog.module.css.js.map +1 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineEmptyState.js +2 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineEmptyState.js.map +1 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineEmptyState.module.css.js +2 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineEmptyState.module.css.js.map +1 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineFilterPanel.js +2 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineFilterPanel.js.map +1 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineFilterPanel.module.css.js +2 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineFilterPanel.module.css.js.map +1 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineHeader.js +2 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineHeader.js.map +1 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineHeader.module.css.js +2 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineHeader.module.css.js.map +1 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineIconButton.js +2 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineIconButton.js.map +1 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineIconButton.module.css.js +2 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineIconButton.module.css.js.map +1 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineLandingPage.js +2 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineLandingPage.js.map +1 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineLandingPage.module.css.js +2 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineLandingPage.module.css.js.map +1 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineLibrary.js +2 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineLibrary.js.map +1 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineLibrary.module.css.js +2 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineLibrary.module.css.js.map +1 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineLibraryCard.js +2 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineLibraryCard.js.map +1 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineLibraryCard.module.css.js +2 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineLibraryCard.module.css.js.map +1 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineProceedButton.js +2 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineProceedButton.js.map +1 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineProceedButton.module.css.js +2 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineProceedButton.module.css.js.map +1 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineSelectButton.js +2 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineSelectButton.js.map +1 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineSelectButton.module.css.js +2 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineSelectButton.module.css.js.map +1 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineStatusChip.js +2 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineStatusChip.js.map +1 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineStatusChip.module.css.js +2 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineStatusChip.module.css.js.map +1 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineTooltip.js +2 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineTooltip.js.map +1 -0
- package/dist/cjs/features/IL-marketplace/components/LearningManagementWrapper.js +2 -0
- package/dist/cjs/features/IL-marketplace/components/LearningManagementWrapper.js.map +1 -0
- package/dist/cjs/features/IL-marketplace/constants.js +2 -0
- package/dist/cjs/features/IL-marketplace/constants.js.map +1 -0
- package/dist/cjs/features/IL-marketplace/hooks/useControllableState.js +2 -0
- package/dist/cjs/features/IL-marketplace/hooks/useControllableState.js.map +1 -0
- package/dist/cjs/features/IL-marketplace/hooks/useGuidelineSelection.js +2 -0
- package/dist/cjs/features/IL-marketplace/hooks/useGuidelineSelection.js.map +1 -0
- package/dist/cjs/features/IL-marketplace/icons/GuidelineSpinner.js +2 -0
- package/dist/cjs/features/IL-marketplace/icons/GuidelineSpinner.js.map +1 -0
- package/dist/cjs/features/IL-marketplace/queryClient.js +2 -0
- package/dist/cjs/features/IL-marketplace/queryClient.js.map +1 -0
- package/dist/cjs/features/IL-marketplace/services/IL-marketplace.api.js +2 -0
- package/dist/cjs/features/IL-marketplace/services/IL-marketplace.api.js.map +1 -0
- package/dist/cjs/features/IL-marketplace/services/guideline.cart.api.js +2 -0
- package/dist/cjs/features/IL-marketplace/services/guideline.cart.api.js.map +1 -0
- package/dist/cjs/features/IL-marketplace/services/guideline.core.api.js +2 -0
- package/dist/cjs/features/IL-marketplace/services/guideline.core.api.js.map +1 -0
- package/dist/cjs/features/IL-marketplace/services/guideline.runtime.config.js +2 -0
- package/dist/cjs/features/IL-marketplace/services/guideline.runtime.config.js.map +1 -0
- package/dist/cjs/features/IL-marketplace/services/guideline.session.js +2 -0
- package/dist/cjs/features/IL-marketplace/services/guideline.session.js.map +1 -0
- package/dist/cjs/features/IL-marketplace/services/instant-learning.api.js +2 -0
- package/dist/cjs/features/IL-marketplace/services/instant-learning.api.js.map +1 -0
- package/dist/cjs/features/IL-marketplace/utils/guidelineFiles.js +2 -0
- package/dist/cjs/features/IL-marketplace/utils/guidelineFiles.js.map +1 -0
- package/dist/cjs/features/IL-marketplace/utils/guidelineOverlay.js +2 -0
- package/dist/cjs/features/IL-marketplace/utils/guidelineOverlay.js.map +1 -0
- package/dist/cjs/features/IL-marketplace/utils/microfrontend.js +2 -0
- package/dist/cjs/features/IL-marketplace/utils/microfrontend.js.map +1 -0
- package/dist/cjs/features/IL-marketplace/utils/session.js +2 -0
- package/dist/cjs/features/IL-marketplace/utils/session.js.map +1 -0
- package/dist/cjs/features/IL-marketplace/utils.js +2 -0
- package/dist/cjs/features/IL-marketplace/utils.js.map +1 -0
- package/dist/cjs/features/IL-marketplace/workspace/useGuidelineWorkspace.js +2 -0
- package/dist/cjs/features/IL-marketplace/workspace/useGuidelineWorkspace.js.map +1 -0
- package/dist/cjs/features/IL-marketplace/workspace/workspace.context.js +2 -0
- package/dist/cjs/features/IL-marketplace/workspace/workspace.context.js.map +1 -0
- package/dist/cjs/features/IL-marketplace/workspace/workspace.runtime.js +2 -0
- package/dist/cjs/features/IL-marketplace/workspace/workspace.runtime.js.map +1 -0
- package/dist/cjs/features/InstantLearning/_components/ChatComponent.js +1 -1
- package/dist/cjs/features/InstantLearning/_components/ContextualChatComponent.js +1 -1
- package/dist/cjs/features/InstantLearning/_components/ContextualLearningForm.js +1 -1
- package/dist/cjs/features/InstantLearning/_components/LearningDetailsForm.js +1 -1
- package/dist/cjs/features/LSCGuidelinesCart/Cart/Cart.js +2 -0
- package/dist/cjs/features/LSCGuidelinesCart/Cart/Cart.js.map +1 -0
- package/dist/cjs/features/LSCGuidelinesCart/Cart/Cart.styles.js +2 -0
- package/dist/cjs/features/LSCGuidelinesCart/Cart/Cart.styles.js.map +1 -0
- package/dist/cjs/features/LSCGuidelinesCart/GuidelineCard.js +2 -0
- package/dist/cjs/features/LSCGuidelinesCart/GuidelineCard.js.map +1 -0
- package/dist/cjs/features/LSCGuidelinesCart/GuidelineCard.styles.js +2 -0
- package/dist/cjs/features/LSCGuidelinesCart/GuidelineCard.styles.js.map +1 -0
- package/dist/cjs/features/LSCGuidelinesCart/GuidelinesLandingPage.js +2 -0
- package/dist/cjs/features/LSCGuidelinesCart/GuidelinesLandingPage.js.map +1 -0
- package/dist/cjs/features/LSCGuidelinesCart/GuidelinesLandingPage.styles.js +2 -0
- package/dist/cjs/features/LSCGuidelinesCart/GuidelinesLandingPage.styles.js.map +1 -0
- package/dist/cjs/features/LSCGuidelinesCart/LearningManagementWrapper.js +2 -0
- package/dist/cjs/features/LSCGuidelinesCart/LearningManagementWrapper.js.map +1 -0
- package/dist/cjs/features/LSCGuidelinesCart/api.js +2 -0
- package/dist/cjs/features/LSCGuidelinesCart/api.js.map +1 -0
- package/dist/cjs/features/LSCGuidelinesCart/endpoints.js +2 -0
- package/dist/cjs/features/LSCGuidelinesCart/endpoints.js.map +1 -0
- package/dist/cjs/features/LearningManagement/AuditLog/AuditLog.js +1 -1
- package/dist/cjs/features/LearningManagement/LearningManagement.js +1 -1
- package/dist/cjs/features/LearningManagement/LearningManagementTest.js +2 -0
- package/dist/cjs/features/LearningManagement/LearningManagementTest.js.map +1 -0
- package/dist/cjs/features/LearningManagement/LearningTemplateLayout.js +1 -1
- package/dist/cjs/features/LearningManagement/RBAC/AccessManagementPanel.js +1 -1
- package/dist/cjs/features/LearningManagement/RBAC/AccessPanel.js +1 -1
- package/dist/cjs/features/LearningManagement/RuleContent/AddScopeApprovalSearchComponent.js +1 -1
- package/dist/cjs/features/LearningManagement/RuleContent/AddScopeModal.js +1 -1
- package/dist/cjs/features/LearningManagement/RuleContent/ApprovalLearningDialog.js +1 -1
- package/dist/cjs/features/LearningManagement/RuleContent/ContentLogic.js +1 -1
- package/dist/cjs/features/LearningManagement/RuleContent/InstructionPromptBlock.js +2 -0
- package/dist/cjs/features/LearningManagement/RuleContent/InstructionPromptBlock.js.map +1 -0
- package/dist/cjs/features/LearningManagement/RuleContent/RuleAccordionHeader.js +1 -1
- package/dist/cjs/features/LearningManagement/RuleContent/RuleContent.js +1 -1
- package/dist/cjs/features/LearningManagement/RuleContent/RuleHeader.js +1 -1
- package/dist/cjs/features/LearningManagement/RuleContent/RuleTierList.js +1 -1
- package/dist/cjs/features/LearningManagement/RuleContent/TierCard.js +1 -1
- package/dist/cjs/features/LearningManagement/RuleContent/VariantCard.js +1 -1
- package/dist/cjs/features/LearningManagement/Sidebar.js +1 -1
- package/dist/cjs/features/LearningManagement/StationsContent/StationsContent.js +1 -1
- package/dist/cjs/features/LearningManagement/apis/apiConfig.js +1 -1
- package/dist/cjs/features/LearningManagement/apis/scopeApis.js +1 -1
- package/dist/cjs/features/LearningManagement/assets/Search-result(add new).svg.js +2 -0
- package/dist/cjs/features/LearningManagement/assets/Search-result(add new).svg.js.map +1 -0
- package/dist/cjs/features/LearningManagement/components/ConfirmationModal.js +1 -1
- package/dist/cjs/features/LearningManagement/components/CreateRuleSetLegacyModal.js +1 -1
- package/dist/cjs/features/LearningManagement/components/EmptyLearningState.js +1 -1
- package/dist/cjs/features/LearningManagement/components/InstantLearningModal.js +1 -1
- package/dist/cjs/features/LearningManagement/components/InstantLearningModalDynamic.js +2 -0
- package/dist/cjs/features/LearningManagement/components/InstantLearningModalDynamic.js.map +1 -0
- package/dist/cjs/features/LearningManagement/components/PromptTextEditor.js +2 -0
- package/dist/cjs/features/LearningManagement/components/PromptTextEditor.js.map +1 -0
- package/dist/cjs/features/LearningManagement/components/ScopeTree/TreeMenu.js +1 -1
- package/dist/cjs/features/LearningManagement/components/ScopeTree/TreeNode.js +1 -1
- package/dist/cjs/features/LearningManagement/components/ScopeTree/TreeNodeHeader.js +1 -1
- package/dist/cjs/features/LearningManagement/components/ScopeTree/TreeSidebar.js +1 -1
- package/dist/cjs/features/LearningManagement/components/StationOnboarding/BackwardStationOnboardModal.js +2 -0
- package/dist/cjs/features/LearningManagement/components/StationOnboarding/BackwardStationOnboardModal.js.map +1 -0
- package/dist/cjs/features/LearningManagement/components/StationOnboarding/DayToggleSelector.js +2 -0
- package/dist/cjs/features/LearningManagement/components/StationOnboarding/DayToggleSelector.js.map +1 -0
- package/dist/cjs/features/LearningManagement/components/StationOnboarding/StationOnboardModal.js +1 -1
- package/dist/cjs/features/LearningManagement/config.js +1 -1
- package/dist/cjs/features/LearningManagement/constants.js +2 -0
- package/dist/cjs/features/LearningManagement/constants.js.map +1 -0
- package/dist/cjs/features/LearningManagement/hooks/useLearningTemplateQueryParams.js +1 -1
- package/dist/cjs/features/LearningManagement/queries/useLMSConfigQuery.js +2 -0
- package/dist/cjs/features/LearningManagement/queries/useLMSConfigQuery.js.map +1 -0
- package/dist/cjs/features/LearningManagement/store/useEnvStore.js +1 -1
- package/dist/cjs/features/LearningManagement/store/useExternalWorkflowStore.js +2 -0
- package/dist/cjs/features/LearningManagement/store/useExternalWorkflowStore.js.map +1 -0
- package/dist/cjs/features/LearningManagement/store/useLMSConfigStore.js +2 -0
- package/dist/cjs/features/LearningManagement/store/useLMSConfigStore.js.map +1 -0
- package/dist/cjs/features/LearningManagement/store/useLearningTemplateStore.js +1 -1
- package/dist/cjs/features/LearningManagement/store/usePermissionsStore.js +1 -1
- package/dist/cjs/features/LearningManagement/styles/PromptTextEditor.module.css.js +2 -0
- package/dist/cjs/features/LearningManagement/styles/PromptTextEditor.module.css.js.map +1 -0
- package/dist/cjs/features/LearningManagement/styles/RuleAccordion.module.css.js +1 -1
- package/dist/cjs/features/LearningManagement/styles/ScopeTree.module.css.js +1 -1
- package/dist/cjs/features/LearningManagement/styles/Sidebar.module.css.js +1 -1
- package/dist/cjs/features/LearningManagement/styles/TierCard.module.css.js +1 -1
- package/dist/cjs/features/LearningManagement/utils/learningMetadataUtils.js +2 -0
- package/dist/cjs/features/LearningManagement/utils/learningMetadataUtils.js.map +1 -0
- package/dist/cjs/features/LearningManagement/utils/resizeObserverErrorGuard.js +2 -0
- package/dist/cjs/features/LearningManagement/utils/resizeObserverErrorGuard.js.map +1 -0
- package/dist/cjs/features/LearningManagement/utils/treeUtils.js +1 -1
- package/dist/cjs/hooks/useAgentFix.js +1 -1
- package/dist/cjs/hooks/useAgentSuggestions.js +1 -1
- package/dist/cjs/hooks/useAgentValidation.js +1 -1
- package/dist/cjs/hooks/useExistingAgentCheck.js +1 -1
- package/dist/cjs/hooks/useExistingPromptCheck.js +1 -1
- package/dist/cjs/hooks/usePromptFix.js +1 -1
- package/dist/cjs/hooks/usePromptSuggestions.js +1 -1
- package/dist/cjs/hooks/usePromptValidation.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/node_modules/@e-llm-studio/audit-log/dist/styles.css.js +2 -0
- package/dist/cjs/node_modules/@e-llm-studio/audit-log/dist/styles.css.js.map +1 -0
- package/dist/cjs/plugins/ValueTypes/Default/DefaultTeachMeRenderer.js +1 -1
- package/dist/cjs/plugins/ValueTypes/Guidelines/GuidelinesTeachMeRenderer.js +1 -1
- package/dist/cjs/plugins/ValueTypes/RadioTrafficLearning/RadioTrafficLearningRenderer.js +1 -1
- package/dist/cjs/schema-driven/BPARenderer.js +2 -0
- package/dist/cjs/schema-driven/BPARenderer.js.map +1 -0
- package/dist/cjs/schema-driven/FallbackField.js +2 -0
- package/dist/cjs/schema-driven/FallbackField.js.map +1 -0
- package/dist/cjs/schema-driven/SchemaRenderer.js +2 -0
- package/dist/cjs/schema-driven/SchemaRenderer.js.map +1 -0
- package/dist/cjs/schema-driven/adapters/ConditionSectionAdapter.js +2 -0
- package/dist/cjs/schema-driven/adapters/ConditionSectionAdapter.js.map +1 -0
- package/dist/cjs/schema-driven/adapters/ConfigSectionAdapter.js +2 -0
- package/dist/cjs/schema-driven/adapters/ConfigSectionAdapter.js.map +1 -0
- package/dist/cjs/schema-driven/adapters/GlobalSetupAccordionAdapter.js +2 -0
- package/dist/cjs/schema-driven/adapters/GlobalSetupAccordionAdapter.js.map +1 -0
- package/dist/cjs/schema-driven/adapters/PromptTextEditorAdapter.js +2 -0
- package/dist/cjs/schema-driven/adapters/PromptTextEditorAdapter.js.map +1 -0
- package/dist/cjs/schema-driven/adapters/ScopeSectionAdapter.js +2 -0
- package/dist/cjs/schema-driven/adapters/ScopeSectionAdapter.js.map +1 -0
- package/dist/cjs/schema-driven/adapters/TextInputAdapter.js +2 -0
- package/dist/cjs/schema-driven/adapters/TextInputAdapter.js.map +1 -0
- package/dist/cjs/schema-driven/adapters/VariantListWrapperAdapter.js +2 -0
- package/dist/cjs/schema-driven/adapters/VariantListWrapperAdapter.js.map +1 -0
- package/dist/cjs/schema-driven/components/ConditionSectionField.js +2 -0
- package/dist/cjs/schema-driven/components/ConditionSectionField.js.map +1 -0
- package/dist/cjs/schema-driven/components/ConfigSectionField.js +2 -0
- package/dist/cjs/schema-driven/components/ConfigSectionField.js.map +1 -0
- package/dist/cjs/schema-driven/components/DropdownSectionField.js +2 -0
- package/dist/cjs/schema-driven/components/DropdownSectionField.js.map +1 -0
- package/dist/cjs/schema-driven/components/GlobalSetupAccordionField.js +2 -0
- package/dist/cjs/schema-driven/components/GlobalSetupAccordionField.js.map +1 -0
- package/dist/cjs/schema-driven/components/GroupEditRow.js +2 -0
- package/dist/cjs/schema-driven/components/GroupEditRow.js.map +1 -0
- package/dist/cjs/schema-driven/components/PromptTextEditorField.js +2 -0
- package/dist/cjs/schema-driven/components/PromptTextEditorField.js.map +1 -0
- package/dist/cjs/schema-driven/components/ScopeSectionField.js +2 -0
- package/dist/cjs/schema-driven/components/ScopeSectionField.js.map +1 -0
- package/dist/cjs/schema-driven/components/TextInputField.js +2 -0
- package/dist/cjs/schema-driven/components/TextInputField.js.map +1 -0
- package/dist/cjs/schema-driven/components/VariantListField.js +2 -0
- package/dist/cjs/schema-driven/components/VariantListField.js.map +1 -0
- package/dist/cjs/schema-driven/demoSchema.js +2 -0
- package/dist/cjs/schema-driven/demoSchema.js.map +1 -0
- package/dist/cjs/schema-driven/primitives/Accordion.js +2 -0
- package/dist/cjs/schema-driven/primitives/Accordion.js.map +1 -0
- package/dist/cjs/schema-driven/store/useDynamicFormStore.js +2 -0
- package/dist/cjs/schema-driven/store/useDynamicFormStore.js.map +1 -0
- package/dist/cjs/schema-driven/types.js +2 -0
- package/dist/cjs/schema-driven/types.js.map +1 -0
- package/dist/cjs/schema-driven/utils/PayloadUtils.js +2 -0
- package/dist/cjs/schema-driven/utils/PayloadUtils.js.map +1 -0
- package/dist/cjs/schema-driven/utils/aiReasoning.js +2 -0
- package/dist/cjs/schema-driven/utils/aiReasoning.js.map +1 -0
- package/dist/cjs/service/InstantLearningService.js +1 -1
- package/dist/cjs/utils/agentGenieAPI.js +1 -1
- package/dist/cjs/utils/bookGenieAPI.js +1 -1
- package/dist/cjs/utils/instantLearningAPI.js +1 -1
- package/dist/features/DocumentLearning/DocumentLearning.js +1 -1
- package/dist/features/DocumentLearning/_components/BookLearningForm.js +1 -1
- package/dist/features/DocumentLearning/_components/ChatComponent.js +1 -1
- package/dist/features/IL-OTJ/ILOTJ.js +1 -1
- package/dist/features/IL-OTJ/ILOTJTest.js +1 -1
- package/dist/features/IL-OTJ/ValueTypeWrappers/TeachMePlugin.js +1 -1
- package/dist/features/IL-OTJ/ValueTypeWrappers/TeachMeWrapper.js +1 -1
- package/dist/features/IL-OTJ/_components/ChatComponents/ChatComponent.js +1 -1
- package/dist/features/IL-OTJ/_components/ChatComponents/NormalChat.js +1 -1
- package/dist/features/IL-OTJ/_components/CitationLink.js +1 -1
- package/dist/features/IL-OTJ/_components/ConflictingReasoningCard.js +1 -1
- package/dist/features/IL-OTJ/_components/CriticalGaps.js +1 -1
- package/dist/features/IL-OTJ/_components/ILPopup.js +1 -1
- package/dist/features/IL-OTJ/_components/InputDataReasoningCard.js +1 -1
- package/dist/features/IL-OTJ/_components/MarkdownComponents/MarkdownElements.js +1 -1
- package/dist/features/IL-OTJ/_components/MarkdownComponents/MarkdownSelect.js +1 -1
- package/dist/features/IL-OTJ/_components/MarkdownRenderer.js +2 -0
- package/dist/features/IL-OTJ/_components/MarkdownRenderer.js.map +1 -0
- package/dist/features/IL-OTJ/_components/MarkdownRenderer.module.css.js +2 -0
- package/dist/features/IL-OTJ/_components/MarkdownRenderer.module.css.js.map +1 -0
- package/dist/features/IL-OTJ/_components/MessageRendering/ClickableChatComponents.js +1 -1
- package/dist/features/IL-OTJ/_components/MessageRendering/RuleValidationCard.js +1 -1
- package/dist/features/IL-OTJ/_components/ViewFormUpdateCard.js +1 -1
- package/dist/features/IL-OTJ/_components/ViewIdentifiedFieldsCard.js +1 -1
- package/dist/features/IL-OTJ/_components/organisms/DropdownSection/DropdownSection.js +2 -0
- package/dist/features/IL-OTJ/_components/organisms/DropdownSection/DropdownSection.js.map +1 -0
- package/dist/features/IL-OTJ/_components/templates/RuleComparison/AgentComposerRuleComparison.js +1 -1
- package/dist/features/IL-OTJ/_components/templates/RuleComparison/RuleComparison.js +1 -1
- package/dist/features/IL-OTJ/_components/templates/RuleComparison/RuleComparisonNew.js +1 -1
- package/dist/features/IL-OTJ/_components/templates/SchemaDriven/SchemaDrivenCreateRule.js +2 -0
- package/dist/features/IL-OTJ/_components/templates/SchemaDriven/SchemaDrivenCreateRule.js.map +1 -0
- package/dist/features/IL-OTJ/_components/templates/TemplatesMap/templatesMap.js +1 -1
- package/dist/features/IL-OTJ/_components/templates/TrafficManager/CreateRule.js +1 -1
- package/dist/features/IL-OTJ/helpers/message-rendering-utils.js +1 -1
- package/dist/features/IL-marketplace/components/GuidelineCardMenu.js +2 -0
- package/dist/features/IL-marketplace/components/GuidelineCardMenu.js.map +1 -0
- package/dist/features/IL-marketplace/components/GuidelineCardMenu.module.css.js +2 -0
- package/dist/features/IL-marketplace/components/GuidelineCardMenu.module.css.js.map +1 -0
- package/dist/features/IL-marketplace/components/GuidelineCart.js +2 -0
- package/dist/features/IL-marketplace/components/GuidelineCart.js.map +1 -0
- package/dist/features/IL-marketplace/components/GuidelineCart.module.css.js +2 -0
- package/dist/features/IL-marketplace/components/GuidelineCart.module.css.js.map +1 -0
- package/dist/features/IL-marketplace/components/GuidelineCartHeader.js +2 -0
- package/dist/features/IL-marketplace/components/GuidelineCartHeader.js.map +1 -0
- package/dist/features/IL-marketplace/components/GuidelineCartHeader.module.css.js +2 -0
- package/dist/features/IL-marketplace/components/GuidelineCartHeader.module.css.js.map +1 -0
- package/dist/features/IL-marketplace/components/GuidelineCartItem.js +2 -0
- package/dist/features/IL-marketplace/components/GuidelineCartItem.js.map +1 -0
- package/dist/features/IL-marketplace/components/GuidelineCartItem.module.css.js +2 -0
- package/dist/features/IL-marketplace/components/GuidelineCartItem.module.css.js.map +1 -0
- package/dist/features/IL-marketplace/components/GuidelineConfirmDialog.js +2 -0
- package/dist/features/IL-marketplace/components/GuidelineConfirmDialog.js.map +1 -0
- package/dist/features/IL-marketplace/components/GuidelineConfirmDialog.module.css.js +2 -0
- package/dist/features/IL-marketplace/components/GuidelineConfirmDialog.module.css.js.map +1 -0
- package/dist/features/IL-marketplace/components/GuidelineEmptyState.js +2 -0
- package/dist/features/IL-marketplace/components/GuidelineEmptyState.js.map +1 -0
- package/dist/features/IL-marketplace/components/GuidelineEmptyState.module.css.js +2 -0
- package/dist/features/IL-marketplace/components/GuidelineEmptyState.module.css.js.map +1 -0
- package/dist/features/IL-marketplace/components/GuidelineFilterPanel.js +2 -0
- package/dist/features/IL-marketplace/components/GuidelineFilterPanel.js.map +1 -0
- package/dist/features/IL-marketplace/components/GuidelineFilterPanel.module.css.js +2 -0
- package/dist/features/IL-marketplace/components/GuidelineFilterPanel.module.css.js.map +1 -0
- package/dist/features/IL-marketplace/components/GuidelineHeader.js +2 -0
- package/dist/features/IL-marketplace/components/GuidelineHeader.js.map +1 -0
- package/dist/features/IL-marketplace/components/GuidelineHeader.module.css.js +2 -0
- package/dist/features/IL-marketplace/components/GuidelineHeader.module.css.js.map +1 -0
- package/dist/features/IL-marketplace/components/GuidelineIconButton.js +2 -0
- package/dist/features/IL-marketplace/components/GuidelineIconButton.js.map +1 -0
- package/dist/features/IL-marketplace/components/GuidelineIconButton.module.css.js +2 -0
- package/dist/features/IL-marketplace/components/GuidelineIconButton.module.css.js.map +1 -0
- package/dist/features/IL-marketplace/components/GuidelineLandingPage.js +2 -0
- package/dist/features/IL-marketplace/components/GuidelineLandingPage.js.map +1 -0
- package/dist/features/IL-marketplace/components/GuidelineLandingPage.module.css.js +2 -0
- package/dist/features/IL-marketplace/components/GuidelineLandingPage.module.css.js.map +1 -0
- package/dist/features/IL-marketplace/components/GuidelineLibrary.js +2 -0
- package/dist/features/IL-marketplace/components/GuidelineLibrary.js.map +1 -0
- package/dist/features/IL-marketplace/components/GuidelineLibrary.module.css.js +2 -0
- package/dist/features/IL-marketplace/components/GuidelineLibrary.module.css.js.map +1 -0
- package/dist/features/IL-marketplace/components/GuidelineLibraryCard.js +2 -0
- package/dist/features/IL-marketplace/components/GuidelineLibraryCard.js.map +1 -0
- package/dist/features/IL-marketplace/components/GuidelineLibraryCard.module.css.js +2 -0
- package/dist/features/IL-marketplace/components/GuidelineLibraryCard.module.css.js.map +1 -0
- package/dist/features/IL-marketplace/components/GuidelineProceedButton.js +2 -0
- package/dist/features/IL-marketplace/components/GuidelineProceedButton.js.map +1 -0
- package/dist/features/IL-marketplace/components/GuidelineProceedButton.module.css.js +2 -0
- package/dist/features/IL-marketplace/components/GuidelineProceedButton.module.css.js.map +1 -0
- package/dist/features/IL-marketplace/components/GuidelineSelectButton.js +2 -0
- package/dist/features/IL-marketplace/components/GuidelineSelectButton.js.map +1 -0
- package/dist/features/IL-marketplace/components/GuidelineSelectButton.module.css.js +2 -0
- package/dist/features/IL-marketplace/components/GuidelineSelectButton.module.css.js.map +1 -0
- package/dist/features/IL-marketplace/components/GuidelineStatusChip.js +2 -0
- package/dist/features/IL-marketplace/components/GuidelineStatusChip.js.map +1 -0
- package/dist/features/IL-marketplace/components/GuidelineStatusChip.module.css.js +2 -0
- package/dist/features/IL-marketplace/components/GuidelineStatusChip.module.css.js.map +1 -0
- package/dist/features/IL-marketplace/components/GuidelineTooltip.js +2 -0
- package/dist/features/IL-marketplace/components/GuidelineTooltip.js.map +1 -0
- package/dist/features/IL-marketplace/components/LearningManagementWrapper.js +2 -0
- package/dist/features/IL-marketplace/components/LearningManagementWrapper.js.map +1 -0
- package/dist/features/IL-marketplace/constants.js +2 -0
- package/dist/features/IL-marketplace/constants.js.map +1 -0
- package/dist/features/IL-marketplace/hooks/useControllableState.js +2 -0
- package/dist/features/IL-marketplace/hooks/useControllableState.js.map +1 -0
- package/dist/features/IL-marketplace/hooks/useGuidelineSelection.js +2 -0
- package/dist/features/IL-marketplace/hooks/useGuidelineSelection.js.map +1 -0
- package/dist/features/IL-marketplace/icons/GuidelineSpinner.js +2 -0
- package/dist/features/IL-marketplace/icons/GuidelineSpinner.js.map +1 -0
- package/dist/features/IL-marketplace/queryClient.js +2 -0
- package/dist/features/IL-marketplace/queryClient.js.map +1 -0
- package/dist/features/IL-marketplace/services/IL-marketplace.api.js +2 -0
- package/dist/features/IL-marketplace/services/IL-marketplace.api.js.map +1 -0
- package/dist/features/IL-marketplace/services/guideline.cart.api.js +2 -0
- package/dist/features/IL-marketplace/services/guideline.cart.api.js.map +1 -0
- package/dist/features/IL-marketplace/services/guideline.core.api.js +2 -0
- package/dist/features/IL-marketplace/services/guideline.core.api.js.map +1 -0
- package/dist/features/IL-marketplace/services/guideline.runtime.config.js +2 -0
- package/dist/features/IL-marketplace/services/guideline.runtime.config.js.map +1 -0
- package/dist/features/IL-marketplace/services/guideline.session.js +2 -0
- package/dist/features/IL-marketplace/services/guideline.session.js.map +1 -0
- package/dist/features/IL-marketplace/services/instant-learning.api.js +2 -0
- package/dist/features/IL-marketplace/services/instant-learning.api.js.map +1 -0
- package/dist/features/IL-marketplace/utils/guidelineFiles.js +2 -0
- package/dist/features/IL-marketplace/utils/guidelineFiles.js.map +1 -0
- package/dist/features/IL-marketplace/utils/guidelineOverlay.js +2 -0
- package/dist/features/IL-marketplace/utils/guidelineOverlay.js.map +1 -0
- package/dist/features/IL-marketplace/utils/microfrontend.js +2 -0
- package/dist/features/IL-marketplace/utils/microfrontend.js.map +1 -0
- package/dist/features/IL-marketplace/utils/session.js +2 -0
- package/dist/features/IL-marketplace/utils/session.js.map +1 -0
- package/dist/features/IL-marketplace/utils.js +2 -0
- package/dist/features/IL-marketplace/utils.js.map +1 -0
- package/dist/features/IL-marketplace/workspace/useGuidelineWorkspace.js +2 -0
- package/dist/features/IL-marketplace/workspace/useGuidelineWorkspace.js.map +1 -0
- package/dist/features/IL-marketplace/workspace/workspace.context.js +2 -0
- package/dist/features/IL-marketplace/workspace/workspace.context.js.map +1 -0
- package/dist/features/IL-marketplace/workspace/workspace.runtime.js +2 -0
- package/dist/features/IL-marketplace/workspace/workspace.runtime.js.map +1 -0
- package/dist/features/InstantLearning/_components/ChatComponent.js +1 -1
- package/dist/features/InstantLearning/_components/ContextualChatComponent.js +1 -1
- package/dist/features/InstantLearning/_components/ContextualLearningForm.js +1 -1
- package/dist/features/InstantLearning/_components/LearningDetailsForm.js +1 -1
- package/dist/features/LSCGuidelinesCart/Cart/Cart.js +2 -0
- package/dist/features/LSCGuidelinesCart/Cart/Cart.js.map +1 -0
- package/dist/features/LSCGuidelinesCart/Cart/Cart.styles.js +2 -0
- package/dist/features/LSCGuidelinesCart/Cart/Cart.styles.js.map +1 -0
- package/dist/features/LSCGuidelinesCart/GuidelineCard.js +2 -0
- package/dist/features/LSCGuidelinesCart/GuidelineCard.js.map +1 -0
- package/dist/features/LSCGuidelinesCart/GuidelineCard.styles.js +2 -0
- package/dist/features/LSCGuidelinesCart/GuidelineCard.styles.js.map +1 -0
- package/dist/features/LSCGuidelinesCart/GuidelinesLandingPage.js +2 -0
- package/dist/features/LSCGuidelinesCart/GuidelinesLandingPage.js.map +1 -0
- package/dist/features/LSCGuidelinesCart/GuidelinesLandingPage.styles.js +2 -0
- package/dist/features/LSCGuidelinesCart/GuidelinesLandingPage.styles.js.map +1 -0
- package/dist/features/LSCGuidelinesCart/LearningManagementWrapper.js +2 -0
- package/dist/features/LSCGuidelinesCart/LearningManagementWrapper.js.map +1 -0
- package/dist/features/LSCGuidelinesCart/api.js +2 -0
- package/dist/features/LSCGuidelinesCart/api.js.map +1 -0
- package/dist/features/LSCGuidelinesCart/endpoints.js +2 -0
- package/dist/features/LSCGuidelinesCart/endpoints.js.map +1 -0
- package/dist/features/LearningManagement/AuditLog/AuditLog.js +1 -1
- package/dist/features/LearningManagement/LearningManagement.js +1 -1
- package/dist/features/LearningManagement/LearningManagementTest.js +2 -0
- package/dist/features/LearningManagement/LearningManagementTest.js.map +1 -0
- package/dist/features/LearningManagement/LearningTemplateLayout.js +1 -1
- package/dist/features/LearningManagement/RBAC/AccessManagementPanel.js +1 -1
- package/dist/features/LearningManagement/RBAC/AccessPanel.js +1 -1
- package/dist/features/LearningManagement/RuleContent/AddScopeApprovalSearchComponent.js +1 -1
- package/dist/features/LearningManagement/RuleContent/AddScopeModal.js +1 -1
- package/dist/features/LearningManagement/RuleContent/ApprovalLearningDialog.js +1 -1
- package/dist/features/LearningManagement/RuleContent/ContentLogic.js +1 -1
- package/dist/features/LearningManagement/RuleContent/InstructionPromptBlock.js +2 -0
- package/dist/features/LearningManagement/RuleContent/InstructionPromptBlock.js.map +1 -0
- package/dist/features/LearningManagement/RuleContent/RuleAccordionHeader.js +1 -1
- package/dist/features/LearningManagement/RuleContent/RuleContent.js +1 -1
- package/dist/features/LearningManagement/RuleContent/RuleHeader.js +1 -1
- package/dist/features/LearningManagement/RuleContent/RuleTierList.js +1 -1
- package/dist/features/LearningManagement/RuleContent/TierCard.js +1 -1
- package/dist/features/LearningManagement/RuleContent/VariantCard.js +1 -1
- package/dist/features/LearningManagement/Sidebar.js +1 -1
- package/dist/features/LearningManagement/StationsContent/StationsContent.js +1 -1
- package/dist/features/LearningManagement/apis/apiConfig.js +1 -1
- package/dist/features/LearningManagement/apis/scopeApis.js +1 -1
- package/dist/features/LearningManagement/assets/Search-result(add new).svg.js +2 -0
- package/dist/features/LearningManagement/assets/Search-result(add new).svg.js.map +1 -0
- package/dist/features/LearningManagement/components/ConfirmationModal.js +1 -1
- package/dist/features/LearningManagement/components/CreateRuleSetLegacyModal.js +1 -1
- package/dist/features/LearningManagement/components/EmptyLearningState.js +1 -1
- package/dist/features/LearningManagement/components/InstantLearningModal.js +1 -1
- package/dist/features/LearningManagement/components/InstantLearningModalDynamic.js +2 -0
- package/dist/features/LearningManagement/components/InstantLearningModalDynamic.js.map +1 -0
- package/dist/features/LearningManagement/components/PromptTextEditor.js +2 -0
- package/dist/features/LearningManagement/components/PromptTextEditor.js.map +1 -0
- package/dist/features/LearningManagement/components/ScopeTree/TreeMenu.js +1 -1
- package/dist/features/LearningManagement/components/ScopeTree/TreeNode.js +1 -1
- package/dist/features/LearningManagement/components/ScopeTree/TreeNodeHeader.js +1 -1
- package/dist/features/LearningManagement/components/ScopeTree/TreeSidebar.js +1 -1
- package/dist/features/LearningManagement/components/StationOnboarding/BackwardStationOnboardModal.js +2 -0
- package/dist/features/LearningManagement/components/StationOnboarding/BackwardStationOnboardModal.js.map +1 -0
- package/dist/features/LearningManagement/components/StationOnboarding/DayToggleSelector.js +2 -0
- package/dist/features/LearningManagement/components/StationOnboarding/DayToggleSelector.js.map +1 -0
- package/dist/features/LearningManagement/components/StationOnboarding/StationOnboardModal.js +1 -1
- package/dist/features/LearningManagement/config.js +1 -1
- package/dist/features/LearningManagement/constants.js +2 -0
- package/dist/features/LearningManagement/constants.js.map +1 -0
- package/dist/features/LearningManagement/hooks/useLearningTemplateQueryParams.js +1 -1
- package/dist/features/LearningManagement/queries/useLMSConfigQuery.js +2 -0
- package/dist/features/LearningManagement/queries/useLMSConfigQuery.js.map +1 -0
- package/dist/features/LearningManagement/store/useEnvStore.js +1 -1
- package/dist/features/LearningManagement/store/useExternalWorkflowStore.js +2 -0
- package/dist/features/LearningManagement/store/useExternalWorkflowStore.js.map +1 -0
- package/dist/features/LearningManagement/store/useLMSConfigStore.js +2 -0
- package/dist/features/LearningManagement/store/useLMSConfigStore.js.map +1 -0
- package/dist/features/LearningManagement/store/useLearningTemplateStore.js +1 -1
- package/dist/features/LearningManagement/store/usePermissionsStore.js +1 -1
- package/dist/features/LearningManagement/styles/PromptTextEditor.module.css.js +2 -0
- package/dist/features/LearningManagement/styles/PromptTextEditor.module.css.js.map +1 -0
- package/dist/features/LearningManagement/styles/RuleAccordion.module.css.js +1 -1
- package/dist/features/LearningManagement/styles/ScopeTree.module.css.js +1 -1
- package/dist/features/LearningManagement/styles/Sidebar.module.css.js +1 -1
- package/dist/features/LearningManagement/styles/TierCard.module.css.js +1 -1
- package/dist/features/LearningManagement/utils/learningMetadataUtils.js +2 -0
- package/dist/features/LearningManagement/utils/learningMetadataUtils.js.map +1 -0
- package/dist/features/LearningManagement/utils/resizeObserverErrorGuard.js +2 -0
- package/dist/features/LearningManagement/utils/resizeObserverErrorGuard.js.map +1 -0
- package/dist/features/LearningManagement/utils/treeUtils.js +1 -1
- package/dist/hooks/useAgentFix.js +1 -1
- package/dist/hooks/useAgentSuggestions.js +1 -1
- package/dist/hooks/useAgentValidation.js +1 -1
- package/dist/hooks/useExistingAgentCheck.js +1 -1
- package/dist/hooks/useExistingPromptCheck.js +1 -1
- package/dist/hooks/usePromptFix.js +1 -1
- package/dist/hooks/usePromptSuggestions.js +1 -1
- package/dist/hooks/usePromptValidation.js +1 -1
- package/dist/index.js +1 -1
- package/dist/node_modules/@e-llm-studio/audit-log/dist/styles.css.js +2 -0
- package/dist/node_modules/@e-llm-studio/audit-log/dist/styles.css.js.map +1 -0
- package/dist/plugins/ValueTypes/Default/DefaultTeachMeRenderer.js +1 -1
- package/dist/plugins/ValueTypes/Guidelines/GuidelinesTeachMeRenderer.js +1 -1
- package/dist/plugins/ValueTypes/RadioTrafficLearning/RadioTrafficLearningRenderer.js +1 -1
- package/dist/schema-driven/BPARenderer.js +2 -0
- package/dist/schema-driven/BPARenderer.js.map +1 -0
- package/dist/schema-driven/FallbackField.js +2 -0
- package/dist/schema-driven/FallbackField.js.map +1 -0
- package/dist/schema-driven/SchemaRenderer.js +2 -0
- package/dist/schema-driven/SchemaRenderer.js.map +1 -0
- package/dist/schema-driven/adapters/ConditionSectionAdapter.js +2 -0
- package/dist/schema-driven/adapters/ConditionSectionAdapter.js.map +1 -0
- package/dist/schema-driven/adapters/ConfigSectionAdapter.js +2 -0
- package/dist/schema-driven/adapters/ConfigSectionAdapter.js.map +1 -0
- package/dist/schema-driven/adapters/GlobalSetupAccordionAdapter.js +2 -0
- package/dist/schema-driven/adapters/GlobalSetupAccordionAdapter.js.map +1 -0
- package/dist/schema-driven/adapters/PromptTextEditorAdapter.js +2 -0
- package/dist/schema-driven/adapters/PromptTextEditorAdapter.js.map +1 -0
- package/dist/schema-driven/adapters/ScopeSectionAdapter.js +2 -0
- package/dist/schema-driven/adapters/ScopeSectionAdapter.js.map +1 -0
- package/dist/schema-driven/adapters/TextInputAdapter.js +2 -0
- package/dist/schema-driven/adapters/TextInputAdapter.js.map +1 -0
- package/dist/schema-driven/adapters/VariantListWrapperAdapter.js +2 -0
- package/dist/schema-driven/adapters/VariantListWrapperAdapter.js.map +1 -0
- package/dist/schema-driven/components/ConditionSectionField.js +2 -0
- package/dist/schema-driven/components/ConditionSectionField.js.map +1 -0
- package/dist/schema-driven/components/ConfigSectionField.js +2 -0
- package/dist/schema-driven/components/ConfigSectionField.js.map +1 -0
- package/dist/schema-driven/components/DropdownSectionField.js +2 -0
- package/dist/schema-driven/components/DropdownSectionField.js.map +1 -0
- package/dist/schema-driven/components/GlobalSetupAccordionField.js +2 -0
- package/dist/schema-driven/components/GlobalSetupAccordionField.js.map +1 -0
- package/dist/schema-driven/components/GroupEditRow.js +2 -0
- package/dist/schema-driven/components/GroupEditRow.js.map +1 -0
- package/dist/schema-driven/components/PromptTextEditorField.js +2 -0
- package/dist/schema-driven/components/PromptTextEditorField.js.map +1 -0
- package/dist/schema-driven/components/ScopeSectionField.js +2 -0
- package/dist/schema-driven/components/ScopeSectionField.js.map +1 -0
- package/dist/schema-driven/components/TextInputField.js +2 -0
- package/dist/schema-driven/components/TextInputField.js.map +1 -0
- package/dist/schema-driven/components/VariantListField.js +2 -0
- package/dist/schema-driven/components/VariantListField.js.map +1 -0
- package/dist/schema-driven/demoSchema.js +2 -0
- package/dist/schema-driven/demoSchema.js.map +1 -0
- package/dist/schema-driven/primitives/Accordion.js +2 -0
- package/dist/schema-driven/primitives/Accordion.js.map +1 -0
- package/dist/schema-driven/store/useDynamicFormStore.js +2 -0
- package/dist/schema-driven/store/useDynamicFormStore.js.map +1 -0
- package/dist/schema-driven/types.js +2 -0
- package/dist/schema-driven/types.js.map +1 -0
- package/dist/schema-driven/utils/PayloadUtils.js +2 -0
- package/dist/schema-driven/utils/PayloadUtils.js.map +1 -0
- package/dist/schema-driven/utils/aiReasoning.js +2 -0
- package/dist/schema-driven/utils/aiReasoning.js.map +1 -0
- package/dist/service/InstantLearningService.js +1 -1
- package/dist/types/src/ComponentRegistry.d.ts +13 -0
- package/dist/types/src/ComponentRegistry.d.ts.map +1 -0
- package/dist/types/src/ContinueWithTemplateModal.d.ts +17 -0
- package/dist/types/src/ContinueWithTemplateModal.d.ts.map +1 -0
- package/dist/types/src/ILMarketplaceMockTest.d.ts +3 -0
- package/dist/types/src/ILMarketplaceMockTest.d.ts.map +1 -0
- package/dist/types/src/ILMarketplaceTest.d.ts +3 -0
- package/dist/types/src/ILMarketplaceTest.d.ts.map +1 -0
- package/dist/types/src/ILMarketplaceWrapper.d.ts +50 -0
- package/dist/types/src/ILMarketplaceWrapper.d.ts.map +1 -0
- package/dist/types/src/api/transport.d.ts +44 -0
- package/dist/types/src/api/transport.d.ts.map +1 -0
- package/dist/types/src/features/DocumentLearning/DocumentLearning.d.ts.map +1 -1
- package/dist/types/src/features/DocumentLearning/_components/BookLearningForm.d.ts.map +1 -1
- package/dist/types/src/features/DocumentLearning/_components/LearningDetailsForm.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/ILOTJ.d.ts +2 -2
- package/dist/types/src/features/IL-OTJ/ILOTJ.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/ILOTJTest.d.ts +597 -0
- package/dist/types/src/features/IL-OTJ/ILOTJTest.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/ValueTypeWrappers/TeachMePlugin.d.ts +9 -17
- package/dist/types/src/features/IL-OTJ/ValueTypeWrappers/TeachMePlugin.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/ValueTypeWrappers/TeachMeWrapper.d.ts +6 -0
- package/dist/types/src/features/IL-OTJ/ValueTypeWrappers/TeachMeWrapper.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/ChatComponents/ChatComponent.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/CitationLink.d.ts +1 -1
- package/dist/types/src/features/IL-OTJ/_components/CitationLink.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/CriticalGaps.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/ILPopup.d.ts +3 -1
- package/dist/types/src/features/IL-OTJ/_components/ILPopup.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/InputDataReasoningCard.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/MarkdownComponents/MarkdownElements.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/MarkdownComponents/MarkdownSelect.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/MarkdownRenderer.d.ts +25 -0
- package/dist/types/src/features/IL-OTJ/_components/MarkdownRenderer.d.ts.map +1 -0
- package/dist/types/src/features/IL-OTJ/_components/MessageRendering/ClickableChatComponents.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/MessageRendering/RuleValidationCard.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/ViewFormUpdateCard.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/ViewIdentifiedFieldsCard.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/index.d.ts +2 -0
- package/dist/types/src/features/IL-OTJ/_components/index.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/organisms/DropdownSection/DropdownSection.d.ts +17 -0
- package/dist/types/src/features/IL-OTJ/_components/organisms/DropdownSection/DropdownSection.d.ts.map +1 -0
- package/dist/types/src/features/IL-OTJ/_components/organisms/DropdownSection/index.d.ts +2 -0
- package/dist/types/src/features/IL-OTJ/_components/organisms/DropdownSection/index.d.ts.map +1 -0
- package/dist/types/src/features/IL-OTJ/_components/templates/RuleComparison/RuleComparison.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/templates/SchemaDriven/SchemaDrivenCreateRule.d.ts +12 -0
- package/dist/types/src/features/IL-OTJ/_components/templates/SchemaDriven/SchemaDrivenCreateRule.d.ts.map +1 -0
- package/dist/types/src/features/IL-OTJ/_components/templates/TemplatesMap/templatesMap.d.ts +2 -1
- package/dist/types/src/features/IL-OTJ/_components/templates/TemplatesMap/templatesMap.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/templates/TrafficManager/CreateRule.d.ts +6 -0
- package/dist/types/src/features/IL-OTJ/_components/templates/TrafficManager/CreateRule.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/helpers/message-rendering-utils.d.ts.map +1 -1
- package/dist/types/src/features/IL-marketplace/components/GuidelineCardMenu.d.ts +28 -0
- package/dist/types/src/features/IL-marketplace/components/GuidelineCardMenu.d.ts.map +1 -0
- package/dist/types/src/features/IL-marketplace/components/GuidelineCart.d.ts +4 -0
- package/dist/types/src/features/IL-marketplace/components/GuidelineCart.d.ts.map +1 -0
- package/dist/types/src/features/IL-marketplace/components/GuidelineCartHeader.d.ts +14 -0
- package/dist/types/src/features/IL-marketplace/components/GuidelineCartHeader.d.ts.map +1 -0
- package/dist/types/src/features/IL-marketplace/components/GuidelineCartItem.d.ts +16 -0
- package/dist/types/src/features/IL-marketplace/components/GuidelineCartItem.d.ts.map +1 -0
- package/dist/types/src/features/IL-marketplace/components/GuidelineConfirmDialog.d.ts +18 -0
- package/dist/types/src/features/IL-marketplace/components/GuidelineConfirmDialog.d.ts.map +1 -0
- package/dist/types/src/features/IL-marketplace/components/GuidelineEmptyState.d.ts +11 -0
- package/dist/types/src/features/IL-marketplace/components/GuidelineEmptyState.d.ts.map +1 -0
- package/dist/types/src/features/IL-marketplace/components/GuidelineFilterPanel.d.ts +9 -0
- package/dist/types/src/features/IL-marketplace/components/GuidelineFilterPanel.d.ts.map +1 -0
- package/dist/types/src/features/IL-marketplace/components/GuidelineHeader.d.ts +4 -0
- package/dist/types/src/features/IL-marketplace/components/GuidelineHeader.d.ts.map +1 -0
- package/dist/types/src/features/IL-marketplace/components/GuidelineIconButton.d.ts +15 -0
- package/dist/types/src/features/IL-marketplace/components/GuidelineIconButton.d.ts.map +1 -0
- package/dist/types/src/features/IL-marketplace/components/GuidelineLandingPage.d.ts +4 -0
- package/dist/types/src/features/IL-marketplace/components/GuidelineLandingPage.d.ts.map +1 -0
- package/dist/types/src/features/IL-marketplace/components/GuidelineLibrary.d.ts +59 -0
- package/dist/types/src/features/IL-marketplace/components/GuidelineLibrary.d.ts.map +1 -0
- package/dist/types/src/features/IL-marketplace/components/GuidelineLibraryCard.d.ts +44 -0
- package/dist/types/src/features/IL-marketplace/components/GuidelineLibraryCard.d.ts.map +1 -0
- package/dist/types/src/features/IL-marketplace/components/GuidelineProceedButton.d.ts +4 -0
- package/dist/types/src/features/IL-marketplace/components/GuidelineProceedButton.d.ts.map +1 -0
- package/dist/types/src/features/IL-marketplace/components/GuidelineSelectButton.d.ts +11 -0
- package/dist/types/src/features/IL-marketplace/components/GuidelineSelectButton.d.ts.map +1 -0
- package/dist/types/src/features/IL-marketplace/components/GuidelineStatusChip.d.ts +8 -0
- package/dist/types/src/features/IL-marketplace/components/GuidelineStatusChip.d.ts.map +1 -0
- package/dist/types/src/features/IL-marketplace/components/GuidelineTooltip.d.ts +10 -0
- package/dist/types/src/features/IL-marketplace/components/GuidelineTooltip.d.ts.map +1 -0
- package/dist/types/src/features/IL-marketplace/components/LearningManagementWrapper.d.ts +19 -0
- package/dist/types/src/features/IL-marketplace/components/LearningManagementWrapper.d.ts.map +1 -0
- package/dist/types/src/features/IL-marketplace/constants.d.ts +175 -0
- package/dist/types/src/features/IL-marketplace/constants.d.ts.map +1 -0
- package/dist/types/src/features/IL-marketplace/hooks/useControllableState.d.ts +8 -0
- package/dist/types/src/features/IL-marketplace/hooks/useControllableState.d.ts.map +1 -0
- package/dist/types/src/features/IL-marketplace/hooks/useGuidelineSelection.d.ts +17 -0
- package/dist/types/src/features/IL-marketplace/hooks/useGuidelineSelection.d.ts.map +1 -0
- package/dist/types/src/features/IL-marketplace/hooks/useGuidelineWorkspaceLegacyBridge.d.ts +6 -0
- package/dist/types/src/features/IL-marketplace/hooks/useGuidelineWorkspaceLegacyBridge.d.ts.map +1 -0
- package/dist/types/src/features/IL-marketplace/icons/GuidelineSpinner.d.ts +7 -0
- package/dist/types/src/features/IL-marketplace/icons/GuidelineSpinner.d.ts.map +1 -0
- package/dist/types/src/features/IL-marketplace/index.d.ts +38 -0
- package/dist/types/src/features/IL-marketplace/index.d.ts.map +1 -0
- package/dist/types/src/features/IL-marketplace/queryClient.d.ts +3 -0
- package/dist/types/src/features/IL-marketplace/queryClient.d.ts.map +1 -0
- package/dist/types/src/features/IL-marketplace/services/IL-marketplace.api.d.ts +103 -0
- package/dist/types/src/features/IL-marketplace/services/IL-marketplace.api.d.ts.map +1 -0
- package/dist/types/src/features/IL-marketplace/services/guideline.api.d.ts +2 -0
- package/dist/types/src/features/IL-marketplace/services/guideline.api.d.ts.map +1 -0
- package/dist/types/src/features/IL-marketplace/services/guideline.cart.api.d.ts +28 -0
- package/dist/types/src/features/IL-marketplace/services/guideline.cart.api.d.ts.map +1 -0
- package/dist/types/src/features/IL-marketplace/services/guideline.chat.d.ts +2 -0
- package/dist/types/src/features/IL-marketplace/services/guideline.chat.d.ts.map +1 -0
- package/dist/types/src/features/IL-marketplace/services/guideline.content.d.ts +2 -0
- package/dist/types/src/features/IL-marketplace/services/guideline.content.d.ts.map +1 -0
- package/dist/types/src/features/IL-marketplace/services/guideline.core.api.d.ts +51 -0
- package/dist/types/src/features/IL-marketplace/services/guideline.core.api.d.ts.map +1 -0
- package/dist/types/src/features/IL-marketplace/services/guideline.runtime.config.d.ts +47 -0
- package/dist/types/src/features/IL-marketplace/services/guideline.runtime.config.d.ts.map +1 -0
- package/dist/types/src/features/IL-marketplace/services/guideline.session.d.ts +10 -0
- package/dist/types/src/features/IL-marketplace/services/guideline.session.d.ts.map +1 -0
- package/dist/types/src/features/IL-marketplace/services/instant-learning.api.d.ts +112 -0
- package/dist/types/src/features/IL-marketplace/services/instant-learning.api.d.ts.map +1 -0
- package/dist/types/src/features/IL-marketplace/services/instant-learning.wishlist.d.ts +8 -0
- package/dist/types/src/features/IL-marketplace/services/instant-learning.wishlist.d.ts.map +1 -0
- package/dist/types/src/features/IL-marketplace/types/add-context.types.d.ts +39 -0
- package/dist/types/src/features/IL-marketplace/types/add-context.types.d.ts.map +1 -0
- package/dist/types/src/features/IL-marketplace/types/api.types.d.ts +116 -0
- package/dist/types/src/features/IL-marketplace/types/api.types.d.ts.map +1 -0
- package/dist/types/src/features/IL-marketplace/types/file-item.d.ts +51 -0
- package/dist/types/src/features/IL-marketplace/types/file-item.d.ts.map +1 -0
- package/dist/types/src/features/IL-marketplace/types/guideline.api.types.d.ts +11 -0
- package/dist/types/src/features/IL-marketplace/types/guideline.api.types.d.ts.map +1 -0
- package/dist/types/src/features/IL-marketplace/types/guideline.types.d.ts +42 -0
- package/dist/types/src/features/IL-marketplace/types/guideline.types.d.ts.map +1 -0
- package/dist/types/src/features/IL-marketplace/types.d.ts +403 -0
- package/dist/types/src/features/IL-marketplace/types.d.ts.map +1 -0
- package/dist/types/src/features/IL-marketplace/utils/addContextHelpers.d.ts +6 -0
- package/dist/types/src/features/IL-marketplace/utils/addContextHelpers.d.ts.map +1 -0
- package/dist/types/src/features/IL-marketplace/utils/cn.d.ts +3 -0
- package/dist/types/src/features/IL-marketplace/utils/cn.d.ts.map +1 -0
- package/dist/types/src/features/IL-marketplace/utils/guidelineFiles.d.ts +17 -0
- package/dist/types/src/features/IL-marketplace/utils/guidelineFiles.d.ts.map +1 -0
- package/dist/types/src/features/IL-marketplace/utils/guidelineOverlay.d.ts +3 -0
- package/dist/types/src/features/IL-marketplace/utils/guidelineOverlay.d.ts.map +1 -0
- package/dist/types/src/features/IL-marketplace/utils/guidelineSort.d.ts +3 -0
- package/dist/types/src/features/IL-marketplace/utils/guidelineSort.d.ts.map +1 -0
- package/dist/types/src/features/IL-marketplace/utils/microfrontend.d.ts +13 -0
- package/dist/types/src/features/IL-marketplace/utils/microfrontend.d.ts.map +1 -0
- package/dist/types/src/features/IL-marketplace/utils/session.d.ts +4 -0
- package/dist/types/src/features/IL-marketplace/utils/session.d.ts.map +1 -0
- package/dist/types/src/features/IL-marketplace/utils/url.d.ts +2 -0
- package/dist/types/src/features/IL-marketplace/utils/url.d.ts.map +1 -0
- package/dist/types/src/features/IL-marketplace/utils.d.ts +45 -0
- package/dist/types/src/features/IL-marketplace/utils.d.ts.map +1 -0
- package/dist/types/src/features/IL-marketplace/workspace/useGuidelineWorkspace.d.ts +44 -0
- package/dist/types/src/features/IL-marketplace/workspace/useGuidelineWorkspace.d.ts.map +1 -0
- package/dist/types/src/features/IL-marketplace/workspace/workspace.context.d.ts +9 -0
- package/dist/types/src/features/IL-marketplace/workspace/workspace.context.d.ts.map +1 -0
- package/dist/types/src/features/IL-marketplace/workspace/workspace.runtime.d.ts +12 -0
- package/dist/types/src/features/IL-marketplace/workspace/workspace.runtime.d.ts.map +1 -0
- package/dist/types/src/features/IL-marketplace/workspace/workspace.selectors.d.ts +5 -0
- package/dist/types/src/features/IL-marketplace/workspace/workspace.selectors.d.ts.map +1 -0
- package/dist/types/src/features/IL-marketplace/workspace/workspace.types.d.ts +89 -0
- package/dist/types/src/features/IL-marketplace/workspace/workspace.types.d.ts.map +1 -0
- package/dist/types/src/features/InstantLearning/_components/ContextualLearningForm.d.ts.map +1 -1
- package/dist/types/src/features/InstantLearning/_components/LearningDetailsForm.d.ts.map +1 -1
- package/dist/types/src/features/LSCGuidelinesCart/Cart/Cart.d.ts +10 -0
- package/dist/types/src/features/LSCGuidelinesCart/Cart/Cart.d.ts.map +1 -0
- package/dist/types/src/features/LSCGuidelinesCart/Cart/Cart.styles.d.ts +6 -0
- package/dist/types/src/features/LSCGuidelinesCart/Cart/Cart.styles.d.ts.map +1 -0
- package/dist/types/src/features/LSCGuidelinesCart/GuidelineCard.d.ts +11 -0
- package/dist/types/src/features/LSCGuidelinesCart/GuidelineCard.d.ts.map +1 -0
- package/dist/types/src/features/LSCGuidelinesCart/GuidelineCard.styles.d.ts +6 -0
- package/dist/types/src/features/LSCGuidelinesCart/GuidelineCard.styles.d.ts.map +1 -0
- package/dist/types/src/features/LSCGuidelinesCart/GuidelinesLandingPage.d.ts +11 -0
- package/dist/types/src/features/LSCGuidelinesCart/GuidelinesLandingPage.d.ts.map +1 -0
- package/dist/types/src/features/LSCGuidelinesCart/GuidelinesLandingPage.styles.d.ts +6 -0
- package/dist/types/src/features/LSCGuidelinesCart/GuidelinesLandingPage.styles.d.ts.map +1 -0
- package/dist/types/src/features/LSCGuidelinesCart/LearningManagementWrapper.d.ts +14 -0
- package/dist/types/src/features/LSCGuidelinesCart/LearningManagementWrapper.d.ts.map +1 -0
- package/dist/types/src/features/LSCGuidelinesCart/api.d.ts +3 -0
- package/dist/types/src/features/LSCGuidelinesCart/api.d.ts.map +1 -0
- package/dist/types/src/features/LSCGuidelinesCart/endpoints.d.ts +4 -0
- package/dist/types/src/features/LSCGuidelinesCart/endpoints.d.ts.map +1 -0
- package/dist/types/src/features/LSCGuidelinesCart/interfacesApi.d.ts +25 -0
- package/dist/types/src/features/LSCGuidelinesCart/interfacesApi.d.ts.map +1 -0
- package/dist/types/src/features/LearningManagement/AuditLog/AuditLog.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/LearningManagement.d.ts +17 -1
- package/dist/types/src/features/LearningManagement/LearningManagement.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/LearningManagementTest.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/LearningTemplateLayout.d.ts +4 -0
- package/dist/types/src/features/LearningManagement/LearningTemplateLayout.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/RBAC/AccessManagementPanel.d.ts +1 -1
- package/dist/types/src/features/LearningManagement/RBAC/AccessManagementPanel.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/RBAC/AccessPanel.d.ts +0 -2
- package/dist/types/src/features/LearningManagement/RBAC/AccessPanel.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/RuleContent/AddScopeApprovalSearchComponent.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/RuleContent/AddScopeModal.d.ts +6 -0
- package/dist/types/src/features/LearningManagement/RuleContent/AddScopeModal.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/RuleContent/ApprovalLearningDialog.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/RuleContent/ContentLogic.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/RuleContent/InstructionPromptBlock.d.ts +27 -0
- package/dist/types/src/features/LearningManagement/RuleContent/InstructionPromptBlock.d.ts.map +1 -0
- package/dist/types/src/features/LearningManagement/RuleContent/RuleAccordionHeader.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/RuleContent/RuleContent.d.ts +1 -0
- package/dist/types/src/features/LearningManagement/RuleContent/RuleContent.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/RuleContent/RuleHeader.d.ts +2 -0
- package/dist/types/src/features/LearningManagement/RuleContent/RuleHeader.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/RuleContent/RuleTierList.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/RuleContent/TierCard.d.ts +1 -0
- package/dist/types/src/features/LearningManagement/RuleContent/TierCard.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/RuleContent/VariantCard.d.ts +4 -0
- package/dist/types/src/features/LearningManagement/RuleContent/VariantCard.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/Sidebar.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/StationsContent/StationsContent.d.ts +1 -0
- package/dist/types/src/features/LearningManagement/StationsContent/StationsContent.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/apis/apiConfig.d.ts +9 -0
- package/dist/types/src/features/LearningManagement/apis/apiConfig.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/apis/scopeApis.d.ts +40 -5
- package/dist/types/src/features/LearningManagement/apis/scopeApis.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/components/ConfirmationModal.d.ts +2 -1
- package/dist/types/src/features/LearningManagement/components/ConfirmationModal.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/components/CreateRuleSetLegacyModal.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/components/EmptyLearningState.d.ts +6 -0
- package/dist/types/src/features/LearningManagement/components/EmptyLearningState.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/components/InstantLearningModal.d.ts +2 -0
- package/dist/types/src/features/LearningManagement/components/InstantLearningModal.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/components/InstantLearningModalDynamic.d.ts +47 -0
- package/dist/types/src/features/LearningManagement/components/InstantLearningModalDynamic.d.ts.map +1 -0
- package/dist/types/src/features/LearningManagement/components/PromptTextEditor.d.ts +44 -0
- package/dist/types/src/features/LearningManagement/components/PromptTextEditor.d.ts.map +1 -0
- package/dist/types/src/features/LearningManagement/components/ScopeTree/TreeMenu.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/components/ScopeTree/TreeNode.d.ts +9 -0
- package/dist/types/src/features/LearningManagement/components/ScopeTree/TreeNode.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/components/ScopeTree/TreeNodeHeader.d.ts +2 -0
- package/dist/types/src/features/LearningManagement/components/ScopeTree/TreeNodeHeader.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/components/ScopeTree/TreeSidebar.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/components/StationOnboarding/BackwardStationOnboardModal.d.ts +12 -0
- package/dist/types/src/features/LearningManagement/components/StationOnboarding/BackwardStationOnboardModal.d.ts.map +1 -0
- package/dist/types/src/features/LearningManagement/components/StationOnboarding/DayToggleSelector.d.ts +13 -0
- package/dist/types/src/features/LearningManagement/components/StationOnboarding/DayToggleSelector.d.ts.map +1 -0
- package/dist/types/src/features/LearningManagement/components/StationOnboarding/StationOnboardModal.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/constants.d.ts +19 -0
- package/dist/types/src/features/LearningManagement/constants.d.ts.map +1 -0
- package/dist/types/src/features/LearningManagement/hooks/useLearningTemplateQueryParams.d.ts +13 -0
- package/dist/types/src/features/LearningManagement/hooks/useLearningTemplateQueryParams.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/queries/useApprovalQueries.d.ts +11 -8
- package/dist/types/src/features/LearningManagement/queries/useApprovalQueries.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/queries/useLMSConfigQuery.d.ts +4 -0
- package/dist/types/src/features/LearningManagement/queries/useLMSConfigQuery.d.ts.map +1 -0
- package/dist/types/src/features/LearningManagement/store/useEnvStore.d.ts +2 -0
- package/dist/types/src/features/LearningManagement/store/useEnvStore.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/store/useExternalWorkflowStore.d.ts +31 -0
- package/dist/types/src/features/LearningManagement/store/useExternalWorkflowStore.d.ts.map +1 -0
- package/dist/types/src/features/LearningManagement/store/useLMSConfigStore.d.ts +288 -0
- package/dist/types/src/features/LearningManagement/store/useLMSConfigStore.d.ts.map +1 -0
- package/dist/types/src/features/LearningManagement/store/useLearningTemplateStore.d.ts +11 -0
- package/dist/types/src/features/LearningManagement/store/useLearningTemplateStore.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/store/usePermissionsStore.d.ts +2 -1
- package/dist/types/src/features/LearningManagement/store/usePermissionsStore.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/types.d.ts +8 -0
- package/dist/types/src/features/LearningManagement/types.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/utils/learningMetadataUtils.d.ts +12 -0
- package/dist/types/src/features/LearningManagement/utils/learningMetadataUtils.d.ts.map +1 -0
- package/dist/types/src/features/LearningManagement/utils/resizeObserverErrorGuard.d.ts +2 -0
- package/dist/types/src/features/LearningManagement/utils/resizeObserverErrorGuard.d.ts.map +1 -0
- package/dist/types/src/features/LearningManagement/utils/treeUtils.d.ts +2 -1
- package/dist/types/src/features/LearningManagement/utils/treeUtils.d.ts.map +1 -1
- package/dist/types/src/hooks/useAgentFix.d.ts.map +1 -1
- package/dist/types/src/hooks/useAgentSuggestions.d.ts.map +1 -1
- package/dist/types/src/hooks/useAgentValidation.d.ts.map +1 -1
- package/dist/types/src/hooks/useExistingAgentCheck.d.ts.map +1 -1
- package/dist/types/src/hooks/useExistingPromptCheck.d.ts.map +1 -1
- package/dist/types/src/hooks/usePromptFix.d.ts.map +1 -1
- package/dist/types/src/hooks/usePromptSuggestions.d.ts.map +1 -1
- package/dist/types/src/hooks/usePromptValidation.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +42 -0
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/plugins/ValueTypes/Category/CategoryTeachMeRenderer.d.ts +1 -0
- package/dist/types/src/plugins/ValueTypes/Category/CategoryTeachMeRenderer.d.ts.map +1 -1
- package/dist/types/src/plugins/ValueTypes/Default/DefaultTeachMeRenderer.d.ts +17 -0
- package/dist/types/src/plugins/ValueTypes/Default/DefaultTeachMeRenderer.d.ts.map +1 -1
- package/dist/types/src/plugins/ValueTypes/Default/DefaultTeachMeRendererOld.d.ts.map +1 -1
- package/dist/types/src/plugins/ValueTypes/Guidelines/GuidelinesTeachMeRenderer.d.ts +1 -0
- package/dist/types/src/plugins/ValueTypes/Guidelines/GuidelinesTeachMeRenderer.d.ts.map +1 -1
- package/dist/types/src/schema-driven/BPARenderer.d.ts +14 -0
- package/dist/types/src/schema-driven/BPARenderer.d.ts.map +1 -0
- package/dist/types/src/schema-driven/FallbackField.d.ts +13 -0
- package/dist/types/src/schema-driven/FallbackField.d.ts.map +1 -0
- package/dist/types/src/schema-driven/SchemaRenderer.d.ts +21 -0
- package/dist/types/src/schema-driven/SchemaRenderer.d.ts.map +1 -0
- package/dist/types/src/schema-driven/adapters/ConditionSectionAdapter.d.ts +11 -0
- package/dist/types/src/schema-driven/adapters/ConditionSectionAdapter.d.ts.map +1 -0
- package/dist/types/src/schema-driven/adapters/ConfigSectionAdapter.d.ts +13 -0
- package/dist/types/src/schema-driven/adapters/ConfigSectionAdapter.d.ts.map +1 -0
- package/dist/types/src/schema-driven/adapters/GlobalSetupAccordionAdapter.d.ts +5 -0
- package/dist/types/src/schema-driven/adapters/GlobalSetupAccordionAdapter.d.ts.map +1 -0
- package/dist/types/src/schema-driven/adapters/PromptTextEditorAdapter.d.ts +13 -0
- package/dist/types/src/schema-driven/adapters/PromptTextEditorAdapter.d.ts.map +1 -0
- package/dist/types/src/schema-driven/adapters/ScopeSectionAdapter.d.ts +5 -0
- package/dist/types/src/schema-driven/adapters/ScopeSectionAdapter.d.ts.map +1 -0
- package/dist/types/src/schema-driven/adapters/TextInputAdapter.d.ts +18 -0
- package/dist/types/src/schema-driven/adapters/TextInputAdapter.d.ts.map +1 -0
- package/dist/types/src/schema-driven/adapters/VariantListWrapperAdapter.d.ts +17 -0
- package/dist/types/src/schema-driven/adapters/VariantListWrapperAdapter.d.ts.map +1 -0
- package/dist/types/src/schema-driven/components/ConditionSectionField.d.ts +3 -0
- package/dist/types/src/schema-driven/components/ConditionSectionField.d.ts.map +1 -0
- package/dist/types/src/schema-driven/components/ConfigSectionField.d.ts +3 -0
- package/dist/types/src/schema-driven/components/ConfigSectionField.d.ts.map +1 -0
- package/dist/types/src/schema-driven/components/DropdownSectionField.d.ts +3 -0
- package/dist/types/src/schema-driven/components/DropdownSectionField.d.ts.map +1 -0
- package/dist/types/src/schema-driven/components/GlobalSetupAccordionField.d.ts +3 -0
- package/dist/types/src/schema-driven/components/GlobalSetupAccordionField.d.ts.map +1 -0
- package/dist/types/src/schema-driven/components/GroupEditRow.d.ts +3 -0
- package/dist/types/src/schema-driven/components/GroupEditRow.d.ts.map +1 -0
- package/dist/types/src/schema-driven/components/PromptTextEditorField.d.ts +3 -0
- package/dist/types/src/schema-driven/components/PromptTextEditorField.d.ts.map +1 -0
- package/dist/types/src/schema-driven/components/ScopeSectionField.d.ts +3 -0
- package/dist/types/src/schema-driven/components/ScopeSectionField.d.ts.map +1 -0
- package/dist/types/src/schema-driven/components/TextInputField.d.ts +3 -0
- package/dist/types/src/schema-driven/components/TextInputField.d.ts.map +1 -0
- package/dist/types/src/schema-driven/components/VariantListField.d.ts +3 -0
- package/dist/types/src/schema-driven/components/VariantListField.d.ts.map +1 -0
- package/dist/types/src/schema-driven/demoSchema.d.ts +13 -0
- package/dist/types/src/schema-driven/demoSchema.d.ts.map +1 -0
- package/dist/types/src/schema-driven/primitives/Accordion.d.ts +10 -0
- package/dist/types/src/schema-driven/primitives/Accordion.d.ts.map +1 -0
- package/dist/types/src/schema-driven/store/useDynamicFormStore.d.ts +19 -0
- package/dist/types/src/schema-driven/store/useDynamicFormStore.d.ts.map +1 -0
- package/dist/types/src/schema-driven/types.d.ts +63 -0
- package/dist/types/src/schema-driven/types.d.ts.map +1 -0
- package/dist/types/src/schema-driven/utils/PayloadUtils.d.ts +40 -0
- package/dist/types/src/schema-driven/utils/PayloadUtils.d.ts.map +1 -0
- package/dist/types/src/schema-driven/utils/aiReasoning.d.ts +5 -0
- package/dist/types/src/schema-driven/utils/aiReasoning.d.ts.map +1 -0
- package/dist/types/src/service/API.d.ts.map +1 -1
- package/dist/types/src/service/GoogleFilePickerService.d.ts.map +1 -1
- package/dist/types/src/service/InstantLearningService.d.ts +12 -1
- package/dist/types/src/service/InstantLearningService.d.ts.map +1 -1
- package/dist/types/src/service/ModelService.d.ts.map +1 -1
- package/dist/types/src/service/SavedDataSetService.d.ts.map +1 -1
- package/dist/types/src/utils/bookGenieAPI.d.ts.map +1 -1
- package/dist/types/src/utils/date.d.ts.map +1 -1
- package/dist/types/src/utils/instantLearningAPI.d.ts.map +1 -1
- package/dist/utils/agentGenieAPI.js +1 -1
- package/dist/utils/bookGenieAPI.js +1 -1
- package/dist/utils/instantLearningAPI.js +1 -1
- package/package.json +42 -18
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__makeTemplateObject as n,__awaiter as e,__generator as i,__assign as t,__rest as o,__spreadArray as a}from"tslib";import{jsxs as r,jsx as l,Fragment as s}from"react/jsx-runtime";import{useState as c,useRef as d,useEffect as u,useCallback as g,useMemo as f}from"react";import{keyframes as p,Box as m,Typography as h,Tooltip as v,Switch as y,TextField as b,IconButton as x,CircularProgress as w,InputAdornment as C,FormControl as L,Select as _,MenuItem as S,Button as k,Snackbar as T,Alert as A,Accordion as F,AccordionSummary as D,AccordionDetails as I}from"@mui/material";import M from"@mui/icons-material/Delete";import j from"@mui/icons-material/Save";import E from"@mui/icons-material/Edit";import O from"@mui/icons-material/Add";import R from"@mui/icons-material/CheckCircleOutline";import N from"@mui/icons-material/Cancel";import W from"@mui/icons-material/KeyboardArrowUp";import{Info as P,Lightbulb as z}from"lucide-react";import J from"../InstantLearning.module.css.js";import B from"./ConflictingLearningWarnCard.js";import U from"./ConflictingLearningWarnCardDB.js";import{publishAgenticFeedbackForVariantIngestion as V}from"../../../service/InstantLearningService.js";import{parseVariant as G}from"../../../utils/variantParser.js";var Z,H=function(H){var Q,K,q=H.organizationName,$=H.selectedText,X=H.scopeOptions,Y=H.devModeTag,nn=H.chatAssistantName,en=H.chatLogo,tn=void 0===en?null:en,on=H.submitFunction;H.setShowChat,H.showChat;var an=H.formDataState,rn=H.setFormDataState,ln=H.instantLearningSuggestions;H.setHasUserFilledForm,H.hasUserFilledForm;var sn=H.isNewChatClicked,cn=H.setIsNewChatClicked,dn=H.setHasUserWrittenModification,un=H.extractedModification,gn=H.save,fn=H.extractedTooltip;H.isSaveLoading,H.shouldTriggerSave;var pn=H.baseUrl;H.topic_table,H.variant_table,H.scope_table,H.embedding_column_name,H.embedding_model;var mn=H.validationWtaResponse,hn=H.setValidationWtaResponse,vn=H.learningWtaResponse,yn=H.setLearningWtaResponse,bn=H.setIsFormSavedClicked,xn=H.onDeleteLearning,wn=H.onMergeLearning,Cn=H.mergeLearningTrigger,Ln=H.resetLearningTrigger,_n=H.editConflictingLearningTrigger,Sn=H.editSimilarLearningTrigger,kn=H.setSendMessageInChat,Tn=H.isMergeLoading,An=H.setIsMergeLoading;H.setSendValidationMessage;var Fn=H.validationRecommendations,Dn=H.setFormValidating,In=H.isFromAudacy,Mn=void 0!==In&&In,jn=H.isFromDashboard,En=void 0!==jn&&jn,On=c({context:"",issue_with_response:"",original:null!=$?$:"",modification:"",whenToApply:"",whenNotToApply:"",tooltip:"",scope:Mn?"":X.length>0?X[0].value:"",isTooltipEnabled:!1,isModificationEnabled:!0,isDevMode:!1}),Rn=On[0],Nn=On[1],Wn=c(!1),Pn=Wn[0],zn=Wn[1],Jn=c(!1),Bn=Jn[0],Un=Jn[1],Vn=c(!1),Gn=Vn[0],Zn=Vn[1],Hn=c(!1),Qn=Hn[0],Kn=Hn[1],qn=c([]),$n=qn[0],Xn=qn[1],Yn=c([]),ne=Yn[0],ee=Yn[1],ie=c(!1),te=ie[0],oe=ie[1],ae=c(!1),re=ae[0],le=ae[1],se=d(""),ce=d(""),de=c(null),ue=de[0],ge=de[1],fe=c(null),pe=fe[0],me=fe[1],he=c({wta:!1,wnta:!1}),ve=he[0],ye=he[1],be=c("idle"),xe=be[0],we=be[1],Ce=c({wta:!1,wnta:!1}),Le=Ce[0],_e=Ce[1];u(function(){An(!1)},[]);var Se=c(!1),ke=Se[0];Se[1];var Te=c(!1);Te[0];var Ae=Te[1],Fe=c(null),De=Fe[0];Fe[1];var Ie=c(!1);Ie[0],Ie[1];var Me=c(null);Me[0];var je=Me[1],Ee=c(null),Oe=Ee[0],Re=Ee[1],Ne=c(!1),We=Ne[0],Pe=Ne[1],ze=c(!1);ze[0];var Je=ze[1],Be=c(null),Ue=Be[0],Ve=Be[1],Ge=c(null),Ze=Ge[0],He=Ge[1],Qe=c(new Set),Ke=Qe[0],qe=Qe[1],$e=c(null),Xe=$e[0],Ye=$e[1],ni=c(new Set),ei=ni[0],ii=ni[1],ti=p(Z||(Z=n(["\n 0%, 80%, 100% {\n transform: scale(0);\n }\n 40% {\n transform: scale(1.0);\n }\n "],["\n 0%, 80%, 100% {\n transform: scale(0);\n }\n 40% {\n transform: scale(1.0);\n }\n "]))),oi=g(function(n,t){return e(void 0,void 0,void 0,function(){var e;return i(this,function(i){switch(i.label){case 0:we(t),"validating"===t&&Dn(!0),i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,n()];case 2:return[2,i.sent()];case 3:return e=i.sent(),console.error("An error occurred during ".concat(t,":"),e),[3,5];case 4:return"validating"===t&&Dn(!1),we("idle"),[7];case 5:return[2]}})})},[Dn]);u(function(){Fn?(ge(Fn.wta),me(Fn.wnta),ye({wta:!!Fn.wta,wnta:!!Fn.wnta}),_e({wta:!1,wnta:!1})):(ge(null),me(null),ye({wta:!1,wnta:!1}))},[Fn]),u(function(){try{_n&&"object"==typeof _n&&Object.keys(_n).length>0&&(console.log("Processing conflicting learning edit actions:",_n),Object.entries(_n).forEach(function(n){var o=n[0],a=n[1];return e(void 0,void 0,void 0,function(){var n,e,r,l,s,c,d,u,g;return i(this,function(i){switch(i.label){case 0:if(!(a&&a.edit_actions&&a.edit_actions.action))return[3,6];if(console.log("Processing conflicting learning edit action:",o,a),ii(function(n){return new Set(n).add(o)}),n=a.conditions_whentoapply||[],e=a.conditions_whennottoapply||[],r=Array.isArray(n)?n.join(" ").replace(/\s+and\s+/gi," and ").replace(/\s+/g," ").trim():n||"",l=Array.isArray(e)?e.join(" ").replace(/\s+and\s+/gi," and ").replace(/\s+/g," ").trim():e||"",Ve(function(n){if(!n)return n;var e=t({},n);return Object.keys(e).forEach(function(n){e[n]&&e[n].id===o&&(e[n]=t(t({},e[n]),{feedback:t(t({},e[n].feedback),{variant:a.variant,when_to_apply:r,when_not_to_apply:l})}))}),e}),console.log("Updated form with conflicting learning conditions:",{whenToApply:r,whenNotToApply:l}),!(pn&&q&&nn))return[3,5];i.label=1;case 1:return i.trys.push([1,3,,4]),(s=Ue?Object.values(Ue).find(function(n){return n&&n.id===o}):null)?s.feedback?(c=G(a.variant),d={status:"approved",metadata:{userName:"M Kathyayani",userEmailId:"madumbu.kathyayani@techolution.com",llm:"claude-3.5-sonnet",isVariantFlow:!0,isUpdateAction:!0,isAgentsFeedback:!0,variant:{id:o,variant:a.variant,conditions_whentoapply:r,conditions_whennottoapply:l,scope:{name:"Custom",value:{scopeId:"askmod-scope-id",scopeName:"askmod"}},topic:{id:null,value:c.topic||"default"},categories:[],originalQuestion:"",parameterizedQuestion:null,created_at:(new Date).toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!0}),created_by:null,updated_at:(new Date).toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!0}),updated_by:"madumbu.kathyayani@techolution.com",instantLearningType:"iL",appliedTagsIL:[],tagMappingInfoIL:{}}}},console.log("[LearningDetailsForm] Saving edited conditions for conflicting learning ".concat(o,":"),d),[4,V({baseUrl:pn,organizationName:q,chatAssistantName:nn,payload:d})]):(console.error("[LearningDetailsForm] Learning feedback not found for ID: ".concat(o)),[2]):(console.error("[LearningDetailsForm] Learning object not found for ID: ".concat(o)),[2]);case 2:return(u=i.sent()).ok?(console.log("edit notifc"),Ye({status:"success",message:"Successfully saved edited conditions for this learning"}),console.log("[LearningDetailsForm] Successfully saved edited conditions for conflicting learning ".concat(o))):(console.error("[LearningDetailsForm] Failed to save edited conditions for conflicting learning ".concat(o,":"),u.status,u.statusText),Ye({status:"error",message:"Failed to save edited conditions for this learning"})),[3,4];case 3:return g=i.sent(),Ye({status:"error",message:"Error saving edited conditions for learning"}),console.error("[LearningDetailsForm] Error saving edited conditions for conflicting learning ".concat(o,":"),g),[3,4];case 4:return[3,6];case 5:console.log("[LearningDetailsForm] Missing required context for edit API call"),i.label=6;case 6:return[2]}})})})),Sn&&"object"==typeof Sn&&Object.keys(Sn).length>0&&(console.log("Processing similar learning edit actions:",Sn),Object.entries(Sn).forEach(function(n){var o=n[0],a=n[1];return e(void 0,void 0,void 0,function(){var n,e,r,l,s,c,d,u,g;return i(this,function(i){switch(i.label){case 0:if(!(a&&a.edit_actions&&a.edit_actions.action))return[3,6];if(console.log("Processing similar learning edit action:",o,a),ii(function(n){return new Set(n).add(o)}),n=a.conditions_whentoapply||[],e=a.conditions_whennottoapply||[],r=Array.isArray(n)?n.join(" ").replace(/\s+and\s+/gi," and ").replace(/\s+/g," ").trim():n||"",l=Array.isArray(e)?e.join(" ").replace(/\s+and\s+/gi," and ").replace(/\s+/g," ").trim():e||"",He(function(n){if(!n)return n;var e=t({},n);return Object.keys(e).forEach(function(n){e[n]&&e[n].id===o&&(e[n]=t(t({},e[n]),{feedback:t(t({},e[n].feedback),{variant:a.variant,when_to_apply:r,when_not_to_apply:l})}))}),e}),console.log("Updated form with similar learning conditions:",{whenToApply:r,whenNotToApply:l}),!(pn&&q&&nn))return[3,5];i.label=1;case 1:return i.trys.push([1,3,,4]),(s=Ze?Object.values(Ze).find(function(n){return n&&n.id===o}):null)?s.feedback?(c=G(a.variant),d={status:"approved",metadata:{userName:"M Kathyayani",userEmailId:"madumbu.kathyayani@techolution.com",llm:"claude-3.5-sonnet",isVariantFlow:!0,isUpdateAction:!0,isAgentsFeedback:!0,variant:{id:o,variant:a.variant,conditions_whentoapply:r,conditions_whennottoapply:l,scope:{name:"Custom",value:{scopeId:"askmod-scope-id",scopeName:"askmod"}},topic:{id:null,value:c.topic||"default"},categories:[],originalQuestion:"",parameterizedQuestion:null,created_at:(new Date).toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!0}),created_by:null,updated_at:(new Date).toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!0}),updated_by:"madumbu.kathyayani@techolution.com",instantLearningType:"iL",appliedTagsIL:[],tagMappingInfoIL:{}}}},console.log("[LearningDetailsForm] Saving edited conditions for similar learning ".concat(o,":"),d),[4,V({baseUrl:pn,organizationName:q,chatAssistantName:nn,payload:d})]):(console.error("[LearningDetailsForm] Learning feedback not found for ID: ".concat(o)),[2]):(console.error("[LearningDetailsForm] Learning object not found for ID: ".concat(o)),[2]);case 2:return(u=i.sent()).ok?(console.log("edit notifc"),Ye({status:"success",message:"Successfully saved edited conditions for this similar learning"}),console.log("[LearningDetailsForm] Successfully saved edited conditions for this similar learning")):(console.error("[LearningDetailsForm] Failed to save edited conditions for similar learning ".concat(o,":"),u.status,u.statusText),Ye({status:"error",message:"Failed to save edited conditions for this learning"})),[3,4];case 3:return g=i.sent(),console.error("[LearningDetailsForm] Error saving edited conditions for similar learning ".concat(o,":"),g),[3,4];case 4:return[3,6];case 5:console.log("[LearningDetailsForm] Missing required context for edit API call"),i.label=6;case 6:return[2]}})})}))}catch(n){console.error("Error processing edit tool actions:",n)}},[_n,Sn,Ve,He,pn,q,nn]);var ai=function(n){var e=n.condition,i=n.onAccept,o=n.onReject;return r(m,t({sx:{display:"flex",alignItems:"center",justifyContent:"space-between",p:1,mb:1,backgroundColor:"#f0f4f8",border:"1px solid #d1d9e6",borderRadius:"4px"}},{children:[l(h,t({sx:{flex:1,fontFamily:"Plus Jakarta Sans"}},{children:e})),r(m,{children:[l(x,t({onClick:i,size:"small",sx:{color:"green"}},{children:l(R,{})})),l(x,t({onClick:o,size:"small",sx:{color:"red"}},{children:l(N,{})}))]})]}))},ri=function(n){var e=n.color,i=void 0===e?"#fff":e,o=n.size,a=void 0===o?12:o;return r("svg",t({width:a,height:a,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:[l("path",{d:"M11.4867 9.37021C11.6517 8.87521 12.3507 8.87521 12.5157 9.37021L13.4832 12.2757C13.6961 12.9144 14.0549 13.4947 14.5311 13.9707C15.0073 14.4466 15.5879 14.8051 16.2267 15.0177L19.1307 15.9852C19.6257 16.1502 19.6257 16.8492 19.1307 17.0142L16.2252 17.9817C15.5865 18.1947 15.0062 18.5535 14.5302 19.0297C14.0543 19.5059 13.6958 20.0864 13.4832 20.7252L12.5157 23.6292C12.3188 23.8989 12.0012 24.0019 11.7759 23.9658L10.5192 20.7237C10.3064 20.0852 9.9478 19.505 9.47187 19.029C8.99594 18.5531 8.41572 18.1945 7.77718 17.9817L4.87168 17.0142C4.37668 16.8492 4.37668 16.1502 4.87168 15.9852L7.77718 15.0177C8.41572 14.8049 8.99594 14.4463 9.47187 13.9704C9.9478 13.4945 10.3064 12.9142 10.5192 12.2757L11.4867 9.37021Z",fill:i}),l("path",{d:"M5.69218 1.72171C5.8106 1.52009 6.19176 1.52009 6.31018 1.72171L6.89068 3.46471C7.15018 4.24171 7.75918 4.85071 8.53618 5.11021L10.2792 5.69071C10.4808 5.75512 10.4808 6.24724 10.2792 6.31018L8.53618 6.88921C7.75918 7.15018 7.15018 7.75918 6.89068 8.53618L6.31018 10.2777C6.19176 10.4793 5.8106 10.4793 5.69218 10.2777L5.11168 8.53471C4.85071 7.75918 4.24171 7.15018 3.46618 6.88921L1.72318 6.30871C1.52156 6.24576 1.52156 5.75512 1.72318 5.69071L3.46618 5.11021C4.24171 4.85071 4.85071 4.24171 5.11168 3.46471L5.69218 1.72171Z",fill:i}),l("path",{d:"M16.2957 0.148207C16.4119 0.016038 16.5905 0.016038 16.7067 0.148207L17.0937 1.30921C17.2662 1.82821 17.6727 2.23471 18.1917 2.40721L19.3527 2.79421C19.4848 2.83676 19.4848 3.16265 19.3527 3.20521L18.1917 3.59221C17.6727 3.76521 17.2662 4.17171 17.0937 4.69021L16.7067 5.85121C16.5905 5.98338 16.4119 5.98338 16.2957 5.85121L15.9087 4.69021C15.7377 4.17171 15.3312 3.76521 14.8122 3.59221L13.6512 3.20521C13.519 3.16265 13.519 2.83676 13.6512 2.79421L14.8122 2.40721C15.3312 2.23471 15.7377 1.82821 15.9102 1.30921L16.2957 0.148207Z",fill:i})]}))},li=function(n){var e=n.score;return r(m,t({sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1.5,py:.5,borderRadius:"16px",backgroundColor:"#10B981",color:"white",fontSize:"0.8rem",fontWeight:600,fontFamily:"Plus Jakarta Sans"}},{children:[l(ri,{}),r(h,t({sx:{fontSize:"0.8rem",fontWeight:600,fontFamily:"inherit"}},{children:[e,"%"]}))]}))},si=function(n){var e=n.reason,i=n.title;return r(F,t({elevation:0,sx:{backgroundColor:"#f3f0ff",border:"1px solid #dcd6f7",borderRadius:2,mb:2,"&::before":{display:"none"}}},{children:[l(D,t({expandIcon:l(W,{style:{color:"#5928ed"}}),sx:{minHeight:"auto","& .MuiAccordionSummary-content":{margin:"12px 0"}}},{children:r(m,t({sx:{display:"flex",alignItems:"center",gap:1}},{children:[l(z,{size:16,color:"#5928ed"}),l(h,t({sx:{fontSize:"0.85rem",fontWeight:600,color:"#5928ed",fontFamily:"Plus Jakarta Sans"}},{children:i}))]}))})),l(I,t({sx:{pt:0,pb:1.5,backgroundColor:"#faf9ff"}},{children:l(h,t({sx:{fontSize:"0.9rem",color:"#4A4458",fontFamily:"Plus Jakarta Sans"}},{children:e}))}))]}))},ci=function(n,e,i){"wta"===e?(Pe(!1),Le.wta?Xn(function(e){return Array.from(new Set(a(a([],e,!0),[n],!1)))}):(Xn([n]),_e(function(n){return t(t({},n),{wta:!0})})),ge(function(n){if(!n||!n.when_to_apply)return n;var e=t({},n.when_to_apply);return delete e[i],t(t({},n),{when_to_apply:e})}),ye(function(n){return t(t({},n),{wta:!1})})):(Pe(!1),Le.wnta?ee(function(e){return Array.from(new Set(a(a([],e,!0),[n],!1)))}):(ee([n]),_e(function(n){return t(t({},n),{wnta:!0})})),me(function(n){if(!n||!n.when_not_to_apply)return n;var e=t({},n.when_not_to_apply);return delete e[i],t(t({},n),{when_not_to_apply:e})}),ye(function(n){return t(t({},n),{wnta:!1})}))},di=function(n,e,i){"wta"===e?(ge(function(n){if(!n||!n.when_to_apply)return n;var e=t({},n.when_to_apply);return delete e[i],t(t({},n),{when_to_apply:e})}),ye(function(n){return t(t({},n),{wta:!1})})):(me(function(n){if(!n||!n.when_not_to_apply)return n;var e=t({},n.when_not_to_apply);return delete e[i],t(t({},n),{when_not_to_apply:e})}),ye(function(n){return t(t({},n),{wnta:!1})}))},ui=g(function(n){return e(void 0,void 0,void 0,function(){var e,t,o,a;return i(this,function(i){switch(i.label){case 0:if(console.log("[LearningDetailsForm] Merging learning from chat:",n),!Ze)return console.log("No similar learnings data available"),[2];if(!(e=Object.values(Ze).find(function(e){return e&&e.id===n})))return console.log("Learning with ID ".concat(n," not found in similar learnings")),[2];if(console.log("Found learning to merge:",e),console.log("🔵 LEARNING DETAILS FORM - Merge button clicked, waiting for merge response to provide correct conditions"),An(!0),He(function(e){if(!e)return{};var i={};return Object.keys(e).forEach(function(t){e[t].id!==n&&(i[t]=e[t])}),i}),qe(function(e){return new Set(e).add(n)}),setTimeout(function(){Ve(function(n){return He(function(e){return n&&0!==Object.keys(n).length||e&&0!==Object.keys(e).length||Je(!1),e}),n})},100),console.log("[LearningDetailsForm] Successfully merged learning from chat"),!(pn&&q&&nn))return[3,5];i.label=1;case 1:return i.trys.push([1,3,,4]),t={status:"approved",metadata:{userName:"M Kathyayani",userEmailId:"madumbu.kathyayani@techolution.com",llm:"claude-3.5-sonnet",isVariantFlow:!0,isDeleteAction:!0,isAgentsFeedback:!0,variant:{id:n,scope:{name:"User",value:[{name:"M Kathyayani",email:"madumbu.kathyayani@techolution.com",userId:"8059658c-a65c-4e14-89aa-a5195f5d09f5"}]},topic:{id:null,value:"default"},variant:"Learning ID: ".concat(n),question:"",categories:[],created_at:(new Date).toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!0}),originalQuestion:"",parameterizedQuestion:"",conditions_whentoapply:"",conditions_whennottoapply:"",parentId:null}}},console.log("[LearningDetailsForm] Deleting merged learning with ID: ".concat(n)),[4,V({baseUrl:pn,organizationName:q,chatAssistantName:nn,payload:t})];case 2:return(o=i.sent()).ok?(Ye({status:"success",message:"Learning merged successfully."}),console.log("[LearningDetailsForm] Successfully deleted merged learning ".concat(n))):(console.error("[LearningDetailsForm] Failed to delete merged learning",o.status,o.statusText),Ye({status:"error",message:"Failed to complete merge for learning."})),[3,4];case 3:return a=i.sent(),console.error("[LearningDetailsForm] Error deleting merged learning ".concat(n,":"),a),[3,4];case 4:return[3,6];case 5:console.log("[LearningDetailsForm] Missing required context for delete API call"),i.label=6;case 6:return[2]}})})},[Ze,rn,Xn,ee,pn,q,nn]);u(function(){Cn&&(ui(Cn),wn&&wn(Cn))},[Cn,wn,ui]),u(function(){(null==an?void 0:an._extractedOriginalUpdate)&&(console.log("🔵 LEARNING DETAILS FORM - Syncing extracted original:",an.original),Nn(function(n){return t(t({},n),{original:an.original||""})}),rn(function(n){return n?(n._extractedOriginalUpdate,o(n,["_extractedOriginalUpdate"])):n}))},[null==an?void 0:an._extractedOriginalUpdate,null==an?void 0:an.original,rn]),u(function(){Ln&&(console.log("[LearningDetailsForm] 🔄 RESET TRIGGER RECEIVED - Clearing all learning data"),console.log("[LearningDetailsForm] Before reset - DBCWtaApiResponse:",Ue?Object.keys(Ue).length:0,"items"),console.log("[LearningDetailsForm] Before reset - DBSWtaApiResponse:",Ze?Object.keys(Ze).length:0,"items"),Ve(null),He(null),Je(!1),Pe(!1),qe(new Set),Xn([]),ee([]),An(!1),ii(new Set),Nn(function(n){return t(t({},n),{original:En?"":n.original,whenToApply:"",whenNotToApply:"",tooltip:"",modification:"",isTooltipEnabled:!1,isModificationEnabled:!0})}),console.log("[LearningDetailsForm] ✅ Learning data reset completed"))},[Ln]);var gi=f(function(){var n,e,i,t,o,a=""!==(null===(n=null==Rn?void 0:Rn.original)||void 0===n?void 0:n.trim()),r=(null==$n?void 0:$n.length)>0,l=$n.every(function(n){return""!==n.trim()}),s=!(null==Rn?void 0:Rn.isModificationEnabled)||""!==(null===(e=null==Rn?void 0:Rn.modification)||void 0===e?void 0:e.trim()),c=!(null==Rn?void 0:Rn.isTooltipEnabled)||""!==(null===(i=null==Rn?void 0:Rn.tooltip)||void 0===i?void 0:i.trim()),d=(null==Rn?void 0:Rn.isModificationEnabled)&&""!==(null===(t=null==Rn?void 0:Rn.modification)||void 0===t?void 0:t.trim())||(null==Rn?void 0:Rn.isTooltipEnabled)&&""!==(null===(o=null==Rn?void 0:Rn.tooltip)||void 0===o?void 0:o.trim()),u=""!==Rn.scope;return a&&r&&l&&s&&c&&d&&!(te||re)&&u},[Rn,$n,te,re]),fi=f(function(){if(We&&Oe)return!0;var n=Object.values(Ue||{}),e=Object.values(Ze||{}),i=a(a([],n.map(function(n){return n.id}),!0),e.map(function(n){return n.id}),!0);return 0!==i.length&&!i.every(function(n){return ei.has(n)})},[We,Oe,Ue,Ze,ei]),pi=d(null);u(function(){Rn.isModificationEnabled||Nn(function(n){return t(t({},n),{modification:""})}),Rn.isTooltipEnabled||Nn(function(n){return t(t({},n),{tooltip:""})})},[Rn.isModificationEnabled,Rn.isTooltipEnabled]),u(function(){if(""===un&&(null==Rn?void 0:Rn.isTooltipEnabled)&&Nn(function(n){return t(t({},n),{isModificationEnabled:!1})}),""!==un||(null==Rn?void 0:Rn.isTooltipEnabled)||Nn(function(n){return t(t({},n),{modification:""})}),un&&""!==un){Nn(function(n){return t(t({},n),{modification:un,isModificationEnabled:!0})}),Kn(!0);var n=setTimeout(function(){Kn(!1)},400);return function(){return clearTimeout(n)}}},[un]),u(function(){""===fn&&Nn(function(n){return t(t({},n),{isTooltipEnabled:!1})}),fn&&""!==fn&&Nn(function(n){return t(t({},n),{tooltip:fn,isTooltipEnabled:!0})})},[fn]),u(function(){sn&&qe(new Set)},[sn]),u(function(){sn&&(Nn(function(n){return t(t({},n),{original:En?"":n.original,modification:"",tooltip:"",isTooltipEnabled:!1,isModificationEnabled:!0,whenToApply:"",whenNotToApply:""})}),Xn([]),ee([]),An(!1),cn(!1),Ae(!1),Pe(!1),Je(!1))},[sn]),u(function(){rn(Rn)},[Rn]),u(function(){(null==an?void 0:an._mergeUpdate)&&(console.log("🔵 LEARNING DETAILS FORM - Detected merge update:",an),an._mergeWTA&&(console.log("🔵 LEARNING DETAILS FORM - Updating suggestedWTA with merge data:",an._mergeWTA),Xn(an._mergeWTA)),an._mergeWNTA&&(console.log("🔵 LEARNING DETAILS FORM - Updating suggestedWnTA with merge data:",an._mergeWNTA),ee(an._mergeWNTA)),rn(function(n){return n._mergeUpdate,n._mergeWTA,n._mergeWNTA,o(n,["_mergeUpdate","_mergeWTA","_mergeWNTA"])}))},[null==an?void 0:an._mergeUpdate,null==an?void 0:an._mergeWTA,null==an?void 0:an._mergeWNTA]),u(function(){""===Rn.original.trim()||""===Rn.modification.trim()&&""===Rn.tooltip.trim()||Pn||zn(!0)},[Rn]),u(function(){if((null==$n?void 0:$n.length)>=0){var n=$n.join(" OR ");Rn.whenToApply!==n&&Nn(function(e){return t(t({},e),{whenToApply:n})})}},[JSON.stringify($n),Rn.whenToApply]),u(function(){if((null==ne?void 0:ne.length)>=0){var n=ne.join(" OR ");Rn.whenNotToApply!==n&&Nn(function(e){return t(t({},e),{whenNotToApply:n})})}},[JSON.stringify(ne),Rn.whenNotToApply]),u(function(){if((null==$n?void 0:$n.length)>0&&!te){Un(!0);var n=setTimeout(function(){Un(!1)},400);return function(){return clearTimeout(n)}}},[JSON.stringify($n)]),u(function(){if((null==ne?void 0:ne.length)>0&&!re){Zn(!0);var n=setTimeout(function(){Zn(!1)},400);return function(){return clearTimeout(n)}}},[JSON.stringify(ne)]),u(function(){if(ln){oe(!1),le(!1);var n=function(n){return n&&/[a-zA-Z]/.test(n)};if(Array.isArray(null==ln?void 0:ln.conditions_whentoapply)){var e=ln.conditions_whentoapply.map(function(n){return n.when_to_apply}).filter(function(e){return n(e)});Xn(e),Nn(function(n){return t(t({},n),{whenToApply:e.join(" OR ")})})}if(Array.isArray(null==ln?void 0:ln.conditions_whennottoapply)){var i=ln.conditions_whennottoapply.map(function(n){return n.when_not_to_apply}).filter(function(e){return n(e)});ee(i),Nn(function(n){return t(t({},n),{whenNotToApply:i.join(" OR ")})})}}},[ln]),u(function(){var n,e;((null===(n=null==ln?void 0:ln.conditions_whentoapply)||void 0===n?void 0:n.length)>0||(null===(e=null==ln?void 0:ln.conditions_whennottoapply)||void 0===e?void 0:e.length)>0)&&(ge(null),me(null),Pe(!1))},[ln]);var mi=d(null),hi=g(function(){mi.current&&clearTimeout(mi.current),mi.current=setTimeout(function(){dn(!0)},1e3)},[]),vi=g(function(n){return function(e){Nn(function(i){var o;return t(t({},i),((o={})[n]=e.target.value,o))}),hi()}},[hi]),yi=function(n){return n.replace(new RegExp("<".concat(Y,">"),"gi"),"").replace(new RegExp("</".concat(Y,">"),"gi"),"").replace(/<\/?[^>]+(>|$)/g,"")},bi=g(function(n){var e=yi(n);Nn(function(n){return t(t({},n),{tooltip:e})}),hi()},[hi]),xi=function(n){return function(e){var i=e.target.checked,o={};"isTooltipEnabled"===n?o={tooltip:i?Rn.tooltip:"",isModificationEnabled:!i||Rn.isModificationEnabled}:"isModificationEnabled"===n&&(o={modification:i?Rn.modification:""}),Nn(function(e){var a;return t(t(t({},e),o),((a={})[n]=i,a))})}};u(function(){if(gn){console.log("'save: true' received. Forcibly clearing all conflict UI states."),Pe(!1),Re(null),bn(!0);e(void 0,void 0,void 0,function(){return i(this,function(n){return fi?(console.error("Save action triggered via prop, but is blocked due to unresolved conflicts."),[2]):(console.log("Form submitted:",Rn),we("saving"),""===(null==Rn?void 0:Rn.modification)&&Nn(function(n){return t(t({},n),{isModificationEnabled:!1})}),""===(null==Rn?void 0:Rn.tooltip)&&Nn(function(n){return t(t({},n),{isTooltipEnabled:!1})}),on(Rn,function(){return we("idle")}),[2])})})}},[gn,fi]);u(function(){mn&&!1===mn.is_valid?(Pe(!0),Re(mn.conflictingConditions),Di()):mn&&mn.is_valid?(Pe(!1),Re(null),console.log("valid response received, calling handleSubmit")):(Pe(!1),console.log("resetting validateWtaApiResponse"),Re(null))},[mn]),u(function(){if(vn){ii(new Set);var n=(null==vn?void 0:vn.conflicting_learnings)||{},e=(null==vn?void 0:vn.similar_learnings)||{};Object.keys(n).length,Object.keys(e).length;var i=Object.keys(n).reduce(function(e,i){var t=n[i];return Ke.has(t.id)||(e[i]=t),e},{}),t=Object.keys(e).reduce(function(n,i){var t=e[i];return Ke.has(t.id)||(n[i]=t),n},{});Ve(i),He(t);var o=Object.keys(i).length>0,a=Object.keys(t).length>0;o||a?(Je(!0),Pe(!1),Di()):!0===(null==vn?void 0:vn.is_valid_db)&&Je(!1)}},[vn,Ke]);var wi,Ci,Li,_i=function(){return e(void 0,void 0,void 0,function(){var n,e,t,o,a,r,l,s;return i(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),[4,fetch("".concat(pn,"/instant_learning/validate-wta"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({whenToApply:null===(o=null===(t=null==Rn?void 0:Rn.whenToApply)||void 0===t?void 0:t.split("OR"))||void 0===o?void 0:o.filter(function(n){return""!==n}),whenNotToApply:null===(r=null===(a=null==Rn?void 0:Rn.whenNotToApply)||void 0===a?void 0:a.split("OR"))||void 0===r?void 0:r.filter(function(n){return""!==n})})})];case 1:return[4,i.sent().json()];case 2:return(n=i.sent()).response&&hn(n.response),n&&n.response&&n.response.is_valid?(je(null),Pe(!1),Re(null)):n&&n.response&&!n.response.is_valid&&(je(null===(l=n.response)||void 0===l?void 0:l.reason),Pe(!0),Re(n.response.conflictingConditions),Di(),kn("Validation failed. Do you have any recommendations for me?")),[2,null===(s=null==n?void 0:n.response)||void 0===s?void 0:s.is_valid];case 3:return e=i.sent(),console.error("API error:",e),[3,4];case 4:return[2]}})})},Si=function(){return e(void 0,void 0,void 0,function(){var n,e,t;return i(this,function(i){switch(i.label){case 0:console.error("Calling LearningWtaApi"),n=Rn.modification&&""!==Rn.modification.trim()?"Replace ".concat(Rn.original," with ").concat(Rn.modification):"Replace ".concat(Rn.original," with <sup>").concat(Rn.tooltip,"</sup>"),i.label=1;case 1:return i.trys.push([1,4,,5]),[4,fetch("".concat(pn,"/instant_learning/similar-variants"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({topic_table:"".concat(q,"-instantLearning-topics"),variant_table:"".concat(q,"-instantLearning-variants"),scope_table:"".concat(q,"-instantLearning-scopes"),scope_id:Rn.scope,embedding_column_name:"variant_embedding",embedding_model:"mxbai-embed-large-v1",topic:Rn.original,top_k:5,llm_model:"gemini-2.5-flash-lite",similarity_threshold:"0.6",variants:{variant:n,conditions_whentoapply:Array.isArray(Rn.whenToApply)?Rn.whenToApply.filter(Boolean).join(" OR "):Rn.whenToApply||"",conditions_whennottoapply:Array.isArray(Rn.whenNotToApply)?Rn.whenNotToApply.filter(Boolean).join(" OR "):Rn.whenNotToApply||""}})})];case 2:return[4,i.sent().json()];case 3:return e=i.sent(),console.error("[Learn] Data:",e.response),console.error("[Learn] is_valid_db:",e.response.is_valid_db),console.error("[Learn] conlficting_learnings:",e.response.conflicting_learnings),console.error("[Learn] similar_learnings:",e.response.similar_learnings),e&&e.response&&yn(e.response),[3,5];case 4:return t=i.sent(),console.error("API error:",t),[3,5];case 5:return[2]}})})},ki=d(null),Ti=c(!1),Ai=Ti[0],Fi=Ti[1],Di=function(){var n=ki.current;n&&setTimeout(function(){n.scrollTo({top:n.scrollHeight,behavior:"smooth"}),Fi(!1)},200)};return u(function(){var n=ki.current,e=function(){var n=ki.current;if(n){var e=n.scrollTop,i=n.scrollHeight,t=n.clientHeight;Fi(!(i-(e+t)<=35))}};return n&&(n.addEventListener("scroll",e),e()),function(){n&&n.removeEventListener("scroll",e)}},[Ai]),r(m,t({p:0,className:J.customFont,sx:{display:"flex",flexDirection:"column",height:"100%",width:"100%"}},{children:[l(m,{children:l(h,t({sx:{fontSize:20,fontWeight:600,fontFamily:"Plus Jakarta Sans"}},{children:"Instant Learning"}))}),r(m,t({sx:{fontFamily:"Plus Jakarta Sans",display:"flex",flexDirection:"column",gap:2,justifyContent:"space-between",flexGrow:1,paddingTop:"20px",height:"calc(100% - 30px)",overflow:"auto"}},{children:[r(m,t({sx:{display:"flex",flexDirection:"column",gap:"20px",height:"calc(100% - 90px)",overflow:"auto",position:"relative"},ref:ki},{children:[r(m,t({sx:{display:"flex",gap:2}},{children:[r(m,t({sx:{flex:1}},{children:[r(m,t({sx:{display:"flex",alignItems:"center"}},{children:[r(h,t({sx:{fontFamily:"Plus Jakarta Sans",fontSize:"1rem",fontWeight:600,display:"flex",alignItems:"center"}},{children:["Original"," ",l(m,t({component:"span",sx:{color:"red"}},{children:"*"})),l(v,t({title:"Original word/phrase which needs to be replaced",placement:"top",arrow:!0,componentsProps:{tooltip:{sx:{fontSize:"0.875rem",padding:"0.5rem",fontFamily:"Plus Jakarta Sans, sans-serif"}}}},{children:l(P,{size:16,style:{paddingLeft:"0.25rem"}})}))]})),l(y,{sx:{visibility:"hidden"},disabled:!0})]})),l(b,{sx:{"& .MuiInputBase-root":{fontFamily:"Plus Jakarta Sans, sans-serif"},"& .MuiInputLabel-root":{fontFamily:"Plus Jakarta Sans, sans-serif"}},id:"original",value:Rn.original,onChange:vi("original"),fullWidth:!0,placeholder:"Enter original"})]})),r(m,t({sx:{flex:1}},{children:[r(m,t({sx:{display:"flex",alignItems:"center"}},{children:[r(h,t({sx:{fontFamily:"Plus Jakarta Sans",fontWeight:600,fontSize:"1rem",display:"flex",alignItems:"center"}},{children:["Modification",Rn.isModificationEnabled&&!Rn.isTooltipEnabled&&l(m,t({component:"span",sx:{color:"red"}},{children:"*"})),l(v,t({title:"Modified word/phrase which Original needs to be replaced with",placement:"top",arrow:!0,componentsProps:{tooltip:{sx:{fontSize:"0.875rem",padding:"0.5rem",fontFamily:"Plus Jakarta Sans, sans-serif"}}}},{children:l(P,{size:16,style:{paddingLeft:"0.25rem"}})}))]})),l(y,{checked:Rn.isModificationEnabled,disabled:!Rn.isTooltipEnabled,onChange:xi("isModificationEnabled"),sx:{"& .MuiSwitch-switchBase.Mui-checked":{color:"#5928ed"},"& .MuiSwitch-switchBase.Mui-checked + .MuiSwitch-track":{backgroundColor:"#5928ed"}}})]})),Rn.isModificationEnabled&&l(b,{sx:{"& .MuiInputBase-root":{fontFamily:"Plus Jakarta Sans, sans-serif"},"& .MuiInputLabel-root":{fontFamily:"Plus Jakarta Sans, sans-serif"},boxShadow:Qn?"0 0 12px 3px rgba(34, 197, 94, 0.6)":"none",transition:"box-shadow 0.3s ease-in-out"},id:"modification",value:Rn.modification,onChange:vi("modification"),fullWidth:!0,placeholder:"Change ".concat($," to...")})]}))]})),r(m,t({sx:{display:"flex",gap:2}},{children:[l(m,{sx:{flex:1}}),r(m,t({sx:{flex:1}},{children:[r(m,t({sx:{display:"flex",justifyContent:"space-between"}},{children:[r(m,t({sx:{display:"flex",alignItems:"center"}},{children:[r(h,t({sx:{fontSize:"1rem",fontWeight:600,fontFamily:"Plus Jakarta Sans",display:"flex",alignItems:"center"}},{children:["Tooltip",Rn.isTooltipEnabled&&l(m,t({component:"span",sx:{color:"red"}},{children:"*"})),l(v,t({title:"Adds a tooltip to the modification or the original word",placement:"top",arrow:!0,componentsProps:{tooltip:{sx:{fontSize:"0.875rem",padding:"0.5rem",fontFamily:"Plus Jakarta Sans, sans-serif"}}}},{children:l(P,{size:16,style:{paddingLeft:"0.25rem"}})}))]})),l(y,{checked:Rn.isTooltipEnabled,onChange:xi("isTooltipEnabled"),sx:{"& .MuiSwitch-switchBase.Mui-checked":{color:"#5928ed"},"& .MuiSwitch-switchBase.Mui-checked + .MuiSwitch-track":{backgroundColor:"#5928ed"}}})]})),Rn.isTooltipEnabled&&r(m,t({sx:{display:"flex",alignItems:"center"}},{children:[l(h,t({sx:{fontSize:14,fontWeight:600,fontFamily:"Plus Jakarta Sans"}},{children:"Dev Mode"})),l(y,{checked:Rn.isDevMode,onChange:xi("isDevMode"),sx:{"& .MuiSwitch-switchBase.Mui-checked":{color:"#4b5563"},"& .MuiSwitch-switchBase.Mui-checked + .MuiSwitch-track":{backgroundColor:"#4b5563"}}})]}))]})),Rn.isTooltipEnabled&&l(b,{id:"tooltip",inputRef:pi,value:(Li=yi(Rn.tooltip),Rn.isDevMode?"<".concat(Y,">").concat(Li,"</").concat(Y,">"):Li),onChange:function(n){return bi(n.target.value)},onFocus:function(){setTimeout(function(){if(Rn.isDevMode){var n=yi(Rn.tooltip),e="<".concat(Y,">").length+n.length,i=pi.current;i&&i.setSelectionRange(e,e)}},0)},fullWidth:!0,placeholder:Rn.isDevMode?"<".concat(Y,">Enter tooltip content</").concat(Y,">"):"Enter tooltip content",sx:{"& .MuiInputBase-root":{fontFamily:"Plus Jakarta Sans, sans-serif"},"& .MuiInputLabel-root":{fontFamily:"Plus Jakarta Sans, sans-serif"}}})]}))]})),r(m,t({sx:{display:"flex",gap:2,minHeight:"".concat(Rn.isTooltipEnabled?"400px":"380px"),flexShrink:0}},{children:[r(m,t({sx:{flex:1,height:"100%"}},{children:[r(h,t({sx:{fontSize:"1rem",fontWeight:600,marginBottom:"8px",fontFamily:"Plus Jakarta Sans, sans-serif",display:"flex",alignItems:"center"},gutterBottom:!0},{children:["When To Apply",l(m,t({component:"span",sx:{color:"red"}},{children:"*"})),l(v,t({title:"Specific situations or conditions where this learning should be applied.",placement:"top",arrow:!0,componentsProps:{tooltip:{sx:{fontSize:"0.875rem",padding:"0.5rem",fontFamily:"Plus Jakarta Sans, sans-serif"}}}},{children:l(P,{size:16,style:{paddingLeft:"0.25rem"}})}))]})),r(m,t({sx:{border:"1px solid #ccc",borderRadius:"8px",padding:2,height:"calc(100% - 64px)",display:"flex",flexDirection:"column",boxShadow:Bn?"0 0 12px 3px rgba(34, 197, 94, 0.6)":"none",transition:"box-shadow 0.3s ease-in-out"}},{children:[r(m,t({display:"flex",alignItems:"center",justifyContent:"space-between",sx:{mb:"8px"}},{children:[r(m,t({display:"flex",gap:"0.25rem",alignItems:"center"},{children:[l("svg",t({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:l("g",t({id:"bi:stars"},{children:l("path",{id:"Vector",d:"M11.4867 9.37021C11.6517 8.87521 12.3507 8.87521 12.5157 9.37021L13.4832 12.2757C13.6961 12.9144 14.0549 13.4947 14.5311 13.9707C15.0073 14.4466 15.5879 14.8051 16.2267 15.0177L19.1307 15.9852C19.6257 16.1502 19.6257 16.8492 19.1307 17.0142L16.2252 17.9817C15.5865 18.1947 15.0062 18.5535 14.5302 19.0297C14.0543 19.5059 13.6958 20.0864 13.4832 20.7252L12.5157 23.6292C12.4801 23.7376 12.4112 23.832 12.3188 23.8989C12.2264 23.9658 12.1153 24.0019 12.0012 24.0019C11.8871 24.0019 11.7759 23.9658 11.6835 23.8989C11.5912 23.832 11.5223 23.7376 11.4867 23.6292L10.5192 20.7237C10.3064 20.0852 9.9478 19.505 9.47187 19.029C8.99594 18.5531 8.41572 18.1945 7.77718 17.9817L4.87168 17.0142C4.76329 16.9786 4.6689 16.9097 4.60198 16.8173C4.53506 16.725 4.49904 16.6138 4.49904 16.4997C4.49904 16.3856 4.53506 16.2745 4.60198 16.1821C4.6689 16.0897 4.76329 16.0208 4.87168 15.9852L7.77718 15.0177C8.41572 14.8049 8.99594 14.4463 9.47187 13.9704C9.9478 13.4945 10.3064 12.9142 10.5192 12.2757L11.4867 9.37021ZM5.69218 1.72171C5.71369 1.65675 5.75512 1.60022 5.8106 1.56016C5.86607 1.52009 5.93275 1.49853 6.00118 1.49853C6.06961 1.49853 6.13629 1.52009 6.19176 1.56016C6.24724 1.60022 6.28867 1.65675 6.31018 1.72171L6.89068 3.46471C7.15018 4.24171 7.75918 4.85071 8.53618 5.11021L10.2792 5.69071C10.3441 5.71222 10.4007 5.75365 10.4407 5.80912C10.4808 5.86459 10.5024 5.93128 10.5024 5.99971C10.5024 6.06813 10.4808 6.13482 10.4407 6.19029C10.4007 6.24576 10.3441 6.2872 10.2792 6.30871L8.53618 6.88921C8.15274 7.01647 7.80431 7.23149 7.51864 7.51717C7.23296 7.80284 7.01794 8.15127 6.89068 8.53471L6.31018 10.2777C6.28867 10.3427 6.24724 10.3992 6.19176 10.4393C6.13629 10.4793 6.06961 10.5009 6.00118 10.5009C5.93275 10.5009 5.86607 10.4793 5.8106 10.4393C5.75512 10.3992 5.71369 10.3427 5.69218 10.2777L5.11168 8.53471C4.98442 8.15127 4.7694 7.80284 4.48372 7.51717C4.19805 7.23149 3.84962 7.01647 3.46618 6.88921L1.72318 6.30871C1.65822 6.2872 1.60169 6.24576 1.56163 6.19029C1.52156 6.13482 1.5 6.06813 1.5 5.99971C1.5 5.93128 1.52156 5.86459 1.56163 5.80912C1.60169 5.75365 1.65822 5.71222 1.72318 5.69071L3.46618 5.11021C3.84962 4.98295 4.19805 4.76792 4.48372 4.48225C4.7694 4.19657 4.98442 3.84815 5.11168 3.46471L5.69218 1.72171ZM16.2957 0.148207C16.3105 0.105497 16.3382 0.068461 16.3751 0.0422495C16.4119 0.016038 16.456 0.00195312 16.5012 0.00195312C16.5464 0.00195313 16.5905 0.016038 16.6273 0.0422495C16.6641 0.068461 16.6919 0.105497 16.7067 0.148207L17.0937 1.30921C17.2662 1.82821 17.6727 2.23471 18.1917 2.40721L19.3527 2.79421C19.3954 2.80901 19.4324 2.83676 19.4586 2.87359C19.4848 2.91042 19.4989 2.9545 19.4989 2.99971C19.4989 3.04491 19.4848 3.08899 19.4586 3.12582C19.4324 3.16265 19.3954 3.1904 19.3527 3.20521L18.1917 3.59221C17.9361 3.67771 17.7039 3.82139 17.5134 4.01193C17.3229 4.20247 17.1792 4.43467 17.0937 4.69021L16.7067 5.85121C16.6919 5.89392 16.6641 5.93095 16.6273 5.95717C16.5905 5.98338 16.5464 5.99746 16.5012 5.99746C16.456 5.99746 16.4119 5.98338 16.3751 5.95717C16.3382 5.93095 16.3105 5.89392 16.2957 5.85121L15.9087 4.69021C15.8232 4.43467 15.6795 4.20247 15.489 4.01193C15.2984 3.82139 15.0662 3.67771 14.8107 3.59221L13.6512 3.20521C13.6085 3.1904 13.5714 3.16265 13.5452 3.12582C13.519 3.08899 13.5049 3.04491 13.5049 2.99971C13.5049 2.9545 13.519 2.91042 13.5452 2.87359C13.5714 2.83676 13.6085 2.80901 13.6512 2.79421L14.8122 2.40721C15.3312 2.23471 15.7377 1.82821 15.9102 1.30921L16.2957 0.148207Z",fill:"#5928ed"})}))})),l(h,t({variant:"body1",sx:{ml:tn?1:0,fontWeight:"600",fontFamily:"Plus Jakarta Sans",color:"#5928ed"}},{children:"AI Suggestions"}))]})),r(m,{children:[l(v,t({title:"Add New Condition",placement:"top",arrow:!0},{children:l(x,t({onClick:function(){Xn(function(n){return a(a([],n,!0),[""],!1)}),oe(!0)},size:"small",sx:{color:"gray","&:hover":{color:"black"}}},{children:l(O,{fontSize:"small"})}))})),$n.length>0&&l(v,t({title:te?"Save":"Edit Conditions",placement:"top",arrow:!0},{children:l("span",{children:l(x,t({onClick:te?function(){return e(void 0,void 0,void 0,function(){var n,t,o,a,r,l,s;return i(this,function(c){return n=$n.filter(function(n){return""!==n.trim()}),(t=JSON.stringify(n))===se.current?(console.log("WTA conditions unchanged. Skipping validation."),oe(!1),[2]):(Xn(n),oe(!1),o=""!==(null===(r=Rn.original)||void 0===r?void 0:r.trim()),a=""!==(null===(l=Rn.modification)||void 0===l?void 0:l.trim())||""!==(null===(s=Rn.tooltip)||void 0===s?void 0:s.trim()),o&&a?(oi(function(){return e(void 0,void 0,void 0,function(){return i(this,function(n){switch(n.label){case 0:return[4,_i()];case 1:return n.sent()?[4,Si()]:[3,3];case 2:n.sent(),n.label=3;case 3:return[2]}})})},"validating"),se.current=t,[2]):(se.current=t,[2]))})})}:function(){return oe(!0)},size:"small",disabled:te&&$n.some(function(n){return""===n.trim()}),sx:{color:"gray","&:hover":{color:"black"}}},{children:l(te?j:E,{fontSize:"small"})}))})}))]})]})),l(m,t({sx:{flexGrow:1,overflow:"auto",paddingTop:"16px"}},{children:Tn?l("div",t({style:{height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"}},{children:r("div",t({style:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"0.5rem",paddingTop:"1rem",paddingBottom:"1rem"}},{children:[l(w,{size:24,sx:{color:"#5928ED",mb:1}}),l("div",t({style:{fontWeight:"700",color:"#5928ED"}},{children:"Merging conditions..."})),l("div",t({style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",gap:"0.25rem",fontSize:"0.875rem",flexFlow:"wrap"}},{children:l("div",{children:"Processing merge response...."})}))]}))})):Bn?r(m,t({sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%",gap:2}},{children:[l(w,{size:24}),l("span",{children:"Loading When to apply..."})]})):r(s,{children:[$n.length>0&&l("ol",t({style:{paddingLeft:"0rem",margin:0}},{children:$n.map(function(n,e){return r(m,t({component:"li",sx:{display:"flex",alignItems:"flex-start",gap:1,mb:e<$n.length-1?2:0}},{children:[l(b,{variant:"outlined",disabled:!te,fullWidth:!0,multiline:!0,value:n,error:te&&!n.trim(),helperText:te&&!n.trim()?"This field cannot be empty":"",onChange:function(n){var i=a([],$n,!0);i[e]=n.target.value,hn(null),yn({similar_learnings:"",conflicting_learnings:""}),Xn(i),Nn(function(n){return t(t({},n),{whenToApply:i.join(" OR ")})})},sx:{backgroundColor:"#f9fafb",borderRadius:1,fontFamily:"Plus Jakarta Sans, sans-serif","& .MuiInputBase-root":{fontFamily:"Plus Jakarta Sans, sans-serif"},"& .MuiInputLabel-root":{fontFamily:"Plus Jakarta Sans, sans-serif"},"& .MuiInputBase-input.Mui-disabled":{color:"#000",WebkitTextFillColor:"#000"}},InputProps:{startAdornment:r(C,t({position:"start",sx:{color:"#000",alignSelf:"flex-start",paddingTop:"12px"}},{children:[e+1,"."]}))}}),te&&l(x,t({onClick:function(){var n=$n.filter(function(n,i){return i!==e});Xn(n),Nn(function(e){return t(t({},e),{whenToApply:n.join(" OR ")})})},sx:{mt:1},size:"large"},{children:l(M,{})}))]}),e)})})),"validating"===xe&&r(m,t({sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:"6px",mt:2,fontFamily:'"Plus Jakarta Sans", sans-serif',color:"#5a28ed"}},{children:[l(h,t({variant:"body2",sx:{color:"#5a28ed"}},{children:"Validating your conditions"})),l(m,{sx:{width:"8px",height:"8px",bgcolor:"#5a28ed",borderRadius:"50%",animation:"".concat(ti," 1.4s infinite ease-in-out both"),animationDelay:"-0.32s"}}),l(m,{sx:{width:"8px",height:"8px",bgcolor:"#5a28ed",borderRadius:"50%",animation:"".concat(ti," 1.4s infinite ease-in-out both"),animationDelay:"-0.16s"}}),l(m,{sx:{width:"8px",height:"8px",bgcolor:"#5a28ed",borderRadius:"50%",animation:"".concat(ti," 1.4s infinite ease-in-out both")}})]})),(null==ue?void 0:ue.when_to_apply)&&Object.keys(ue.when_to_apply).length>0&&r(m,t({mt:$n.length>0?3:0},{children:[ve.wta&&r(m,t({sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:1.5}},{children:[l(h,t({variant:"subtitle2",sx:{fontWeight:"bold",fontFamily:"Plus Jakarta Sans"}},{children:"AI's Recommended Fix:"})),l(li,{score:ue.confidence_score})]})),ve.wta&&l(si,{reason:ue.reason,title:"Why these suggestions?"}),Object.entries(ue.when_to_apply).map(function(n){var e=n[0],i=n[1];return l(ai,{condition:"".concat(e,". ").concat(i),onAccept:function(){return ci(i,"wta",e)},onReject:function(){return di(0,"wta",e)}},"rec-wta-".concat(e))})]})),0===$n.length&&(!(null==ue?void 0:ue.when_to_apply)||0===Object.keys(ue.when_to_apply).length)&&l("div",t({style:{height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"}},{children:r("div",t({style:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"0.5rem",paddingTop:"1rem",paddingBottom:"1rem"}},{children:[l("div",t({style:{fontWeight:"700",color:"#6b7280"}},{children:"No suggestions found"})),r("div",t({style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",gap:"0.25rem",fontSize:"1rem",flexFlow:"wrap"}},{children:[l("div",t({style:{}},{children:"Tell us about your learning in "})),l("span",t({style:{color:"#5928ED",fontWeight:"700"}},{children:"InstantLearning.AI"}))," ",l("span",{children:"Chat"})]}))]}))}))]})}))]}))]})),r(m,t({sx:{flex:1,height:"100%"}},{children:[r(h,t({sx:{fontSize:"1rem",fontWeight:600,marginBottom:"8px",fontFamily:"Plus Jakarta Sans",display:"flex",alignItems:"center"},gutterBottom:!0},{children:["When Not To Apply",l(v,t({title:"Cases where this learning should not be applied to avoid incorrect responses.",placement:"top",arrow:!0,componentsProps:{tooltip:{sx:{fontSize:"0.875rem",padding:"0.5rem",fontFamily:"Plus Jakarta Sans, sans-serif"}}}},{children:l(P,{size:16,style:{paddingLeft:"0.25rem"}})}))]})),r(m,t({sx:{border:"1px solid #ccc",borderRadius:"8px",padding:2,height:"calc(100% - 64px)",display:"flex",flexDirection:"column",boxShadow:Gn?"0 0 12px 3px rgba(34, 197, 94, 0.6)":"none",transition:"box-shadow 0.3s ease-in-out"}},{children:[r(m,t({display:"flex",alignItems:"center",justifyContent:"space-between",sx:{mb:"8px"}},{children:[r(m,t({display:"flex",gap:"0.25rem",alignItems:"center"},{children:[l("svg",t({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:l("g",t({id:"bi:stars"},{children:l("path",{id:"Vector",d:"M11.4867 9.37021C11.6517 8.87521 12.3507 8.87521 12.5157 9.37021L13.4832 12.2757C13.6961 12.9144 14.0549 13.4947 14.5311 13.9707C15.0073 14.4466 15.5879 14.8051 16.2267 15.0177L19.1307 15.9852C19.6257 16.1502 19.6257 16.8492 19.1307 17.0142L16.2252 17.9817C15.5865 18.1947 15.0062 18.5535 14.5302 19.0297C14.0543 19.5059 13.6958 20.0864 13.4832 20.7252L12.5157 23.6292C12.4801 23.7376 12.4112 23.832 12.3188 23.8989C12.2264 23.9658 12.1153 24.0019 12.0012 24.0019C11.8871 24.0019 11.7759 23.9658 11.6835 23.8989C11.5912 23.832 11.5223 23.7376 11.4867 23.6292L10.5192 20.7237C10.3064 20.0852 9.9478 19.505 9.47187 19.029C8.99594 18.5531 8.41572 18.1945 7.77718 17.9817L4.87168 17.0142C4.76329 16.9786 4.6689 16.9097 4.60198 16.8173C4.53506 16.725 4.49904 16.6138 4.49904 16.4997C4.49904 16.3856 4.53506 16.2745 4.60198 16.1821C4.6689 16.0897 4.76329 16.0208 4.87168 15.9852L7.77718 15.0177C8.41572 14.8049 8.99594 14.4463 9.47187 13.9704C9.9478 13.4945 10.3064 12.9142 10.5192 12.2757L11.4867 9.37021ZM5.69218 1.72171C5.71369 1.65675 5.75512 1.60022 5.8106 1.56016C5.86607 1.52009 5.93275 1.49853 6.00118 1.49853C6.06961 1.49853 6.13629 1.52009 6.19176 1.56016C6.24724 1.60022 6.28867 1.65675 6.31018 1.72171L6.89068 3.46471C7.15018 4.24171 7.75918 4.85071 8.53618 5.11021L10.2792 5.69071C10.3441 5.71222 10.4007 5.75365 10.4407 5.80912C10.4808 5.86459 10.5024 5.93128 10.5024 5.99971C10.5024 6.06813 10.4808 6.13482 10.4407 6.19029C10.4007 6.24576 10.3441 6.2872 10.2792 6.30871L8.53618 6.88921C8.15274 7.01647 7.80431 7.23149 7.51864 7.51717C7.23296 7.80284 7.01794 8.15127 6.89068 8.53471L6.31018 10.2777C6.28867 10.3427 6.24724 10.3992 6.19176 10.4393C6.13629 10.4793 6.06961 10.5009 6.00118 10.5009C5.93275 10.5009 5.86607 10.4793 5.8106 10.4393C5.75512 10.3992 5.71369 10.3427 5.69218 10.2777L5.11168 8.53471C4.98442 8.15127 4.7694 7.80284 4.48372 7.51717C4.19805 7.23149 3.84962 7.01647 3.46618 6.88921L1.72318 6.30871C1.65822 6.2872 1.60169 6.24576 1.56163 6.19029C1.52156 6.13482 1.5 6.06813 1.5 5.99971C1.5 5.93128 1.52156 5.86459 1.56163 5.80912C1.60169 5.75365 1.65822 5.71222 1.72318 5.69071L3.46618 5.11021C3.84962 4.98295 4.19805 4.76792 4.48372 4.48225C4.7694 4.19657 4.98442 3.84815 5.11168 3.46471L5.69218 1.72171ZM16.2957 0.148207C16.3105 0.105497 16.3382 0.068461 16.3751 0.0422495C16.4119 0.016038 16.456 0.00195312 16.5012 0.00195312C16.5464 0.00195313 16.5905 0.016038 16.6273 0.0422495C16.6641 0.068461 16.6919 0.105497 16.7067 0.148207L17.0937 1.30921C17.2662 1.82821 17.6727 2.23471 18.1917 2.40721L19.3527 2.79421C19.3954 2.80901 19.4324 2.83676 19.4586 2.87359C19.4848 2.91042 19.4989 2.9545 19.4989 2.99971C19.4989 3.04491 19.4848 3.08899 19.4586 3.12582C19.4324 3.16265 19.3954 3.1904 19.3527 3.20521L18.1917 3.59221C17.9361 3.67771 17.7039 3.82139 17.5134 4.01193C17.3229 4.20247 17.1792 4.43467 17.0937 4.69021L16.7067 5.85121C16.6919 5.89392 16.6641 5.93095 16.6273 5.95717C16.5905 5.98338 16.5464 5.99746 16.5012 5.99746C16.456 5.99746 16.4119 5.98338 16.3751 5.95717C16.3382 5.93095 16.3105 5.89392 16.2957 5.85121L15.9087 4.69021C15.8232 4.43467 15.6795 4.20247 15.489 4.01193C15.2984 3.82139 15.0662 3.67771 14.8107 3.59221L13.6512 3.20521C13.6085 3.1904 13.5714 3.16265 13.5452 3.12582C13.519 3.08899 13.5049 3.04491 13.5049 2.99971C13.5049 2.9545 13.519 2.91042 13.5452 2.87359C13.5714 2.83676 13.6085 2.80901 13.6512 2.79421L14.8122 2.40721C15.3312 2.23471 15.7377 1.82821 15.9102 1.30921L16.2957 0.148207Z",fill:"#5928ed"})}))})),l(h,t({variant:"body1",sx:{ml:tn?1:0,fontWeight:"600",fontFamily:"Plus Jakarta Sans",color:"#5928ed"}},{children:"AI Suggestions"}))]})),r(m,{children:[l(v,t({title:"Add New Condition",placement:"top",arrow:!0},{children:l(x,t({onClick:function(){ee(function(n){return a(a([],n,!0),[""],!1)}),le(!0)},size:"small",sx:{color:"gray","&:hover":{color:"black"}}},{children:l(O,{fontSize:"small"})}))})),ne.length>0&&l(v,t({title:re?"Save":"Edit Conditions",placement:"top",arrow:!0},{children:l("span",{children:l(x,t({onClick:re?function(){return e(void 0,void 0,void 0,function(){var n,t,o,a,r,l,s;return i(this,function(c){return n=ne.filter(function(n){return""!==n.trim()}),(t=JSON.stringify(n))===ce.current?(console.log("WnTA conditions unchanged. Skipping validation."),le(!1),[2]):(ee(n),le(!1),o=""!==(null===(r=Rn.original)||void 0===r?void 0:r.trim()),a=""!==(null===(l=Rn.modification)||void 0===l?void 0:l.trim())||""!==(null===(s=Rn.tooltip)||void 0===s?void 0:s.trim()),o&&a?(""!==Rn.whenToApply.trim()&&(oi(function(){return e(void 0,void 0,void 0,function(){return i(this,function(n){switch(n.label){case 0:return[4,_i()];case 1:return n.sent()?[4,Si()]:[3,3];case 2:n.sent(),n.label=3;case 3:return[2]}})})},"validating"),ce.current=t),[2]):(ce.current=t,[2]))})})}:function(){return le(!0)},size:"small",disabled:re&&ne.some(function(n){return""===n.trim()}),sx:{color:"gray","&:hover":{color:"black"}}},{children:l(re?j:E,{fontSize:"small"})}))})}))]})]})),l(m,t({sx:{flexGrow:1,overflow:"auto",paddingTop:"16px"}},{children:Tn?l("div",{style:{height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"}}):Gn?r(m,t({sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%",gap:2}},{children:[l(w,{size:24}),l("span",{children:"Loading When not to apply..."})]})):r(s,{children:[ne.length>0&&l("ol",t({style:{paddingLeft:"0rem",margin:0}},{children:ne.map(function(n,e){return r(m,t({component:"li",sx:{display:"flex",alignItems:"flex-start",gap:1,mb:e<ne.length-1?2:0}},{children:[l(b,{variant:"outlined",disabled:!re,fullWidth:!0,multiline:!0,value:n,error:re&&!n.trim(),helperText:re&&!n.trim()?"This field cannot be empty":"",onChange:function(n){var i=a([],ne,!0);i[e]=n.target.value,hn(null),yn({similar_learnings:"",conflicting_learnings:""}),ee(i),Nn(function(n){return t(t({},n),{whenNotToApply:i.join(" OR ")})})},sx:{backgroundColor:"#f9fafb",borderRadius:1,fontFamily:"Plus Jakarta Sans, sans-serif","& .MuiInputBase-root":{fontFamily:"Plus Jakarta Sans, sans-serif"},"& .MuiInputLabel-root":{fontFamily:"Plus Jakarta Sans, sans-serif"},"& .MuiInputBase-input.Mui-disabled":{color:"#000",WebkitTextFillColor:"#000"}},InputProps:{startAdornment:r(C,t({position:"start",sx:{color:"#000",alignSelf:"flex-start",paddingTop:"12px"}},{children:[e+1,"."]}))}}),re&&l(x,t({onClick:function(){var n=ne.filter(function(n,i){return i!==e});ee(n),Nn(function(e){return t(t({},e),{whenNotToApply:n.join(" OR ")})})},sx:{mt:1},size:"large"},{children:l(M,{})}))]}),e)})})),ne.length>0&&"validating"===xe&&r(m,t({sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:"6px",mt:2,fontFamily:'"Plus Jakarta Sans", sans-serif',color:"#5a28ed"}},{children:[l(h,t({variant:"body2",sx:{color:"#5a28ed"}},{children:"Validating your conditions"})),l(m,{sx:{width:"8px",height:"8px",bgcolor:"#5a28ed",borderRadius:"50%",animation:"".concat(ti," 1.4s infinite ease-in-out both"),animationDelay:"-0.32s"}}),l(m,{sx:{width:"8px",height:"8px",bgcolor:"#5a28ed",borderRadius:"50%",animation:"".concat(ti," 1.4s infinite ease-in-out both"),animationDelay:"-0.16s"}}),l(m,{sx:{width:"8px",height:"8px",bgcolor:"#5a28ed",borderRadius:"50%",animation:"".concat(ti," 1.4s infinite ease-in-out both")}})]})),(null==pe?void 0:pe.when_not_to_apply)&&Object.keys(pe.when_not_to_apply).length>0&&r(m,t({mt:ne.length>0?3:0},{children:[ve.wnta&&r(m,t({sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:1.5}},{children:[l(h,t({variant:"subtitle2",sx:{fontWeight:"bold",fontFamily:"Plus Jakarta Sans"}},{children:"AI's Recommended Fix:"})),l(li,{score:pe.confidence_score})]})),ve.wnta&&l(si,{reason:pe.reason,title:"Why these suggestions?"}),Object.entries(pe.when_not_to_apply).map(function(n){var e=n[0],i=n[1];return l(ai,{condition:"".concat(e,". ").concat(i),onAccept:function(){return ci(i,"wnta",e)},onReject:function(){return di(0,"wnta",e)}},"rec-wnta-".concat(e))})]})),0===ne.length&&(!(null==pe?void 0:pe.when_not_to_apply)||0===Object.keys(pe.when_not_to_apply).length)&&l("div",t({style:{height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"}},{children:r("div",t({style:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"0.5rem",paddingTop:"1rem",paddingBottom:"1rem"}},{children:[l("div",t({style:{fontWeight:"700",color:"#6b7280"}},{children:"No suggestions found"})),r("div",t({style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",gap:"0.25rem",fontSize:"1rem",flexFlow:"wrap"}},{children:[l("div",t({style:{}},{children:"Tell us about your learning in "})),l("span",t({style:{color:"#5928ED",fontWeight:"700"}},{children:"InstantLearning.AI"}))," ",l("span",{children:"Chat"})]}))]}))}))]})}))]}))]}))]})),We&&Oe&&l(B,{conflictingConditions:Oe}),(Ci=Ue&&Object.keys(Ue).length>0||Ze&&Object.keys(Ze).length>0,console.log("[LearningDetailsForm] 🔍 Checking if warning cards should show:",Ci),console.log("[LearningDetailsForm] DBCWtaApiResponse keys:",Ue?Object.keys(Ue).length:0),console.log("[LearningDetailsForm] DBSWtaApiResponse keys:",Ze?Object.keys(Ze).length:0),Ci&&l(U,{conflictingConditions:[Object.values(Ue||{}),Object.values(Ze||{})],baseUrl:pn,organizationName:q,chatAssistantName:nn||"",curlPayload:null!==(K=null!==(Q=null==De?void 0:De.curlPayload)&&void 0!==Q?Q:null===window||void 0===window?void 0:window.__DELETE_CURL__)&&void 0!==K?K:"",onDeleted:function(n){console.log("[LearningDetailsForm] Learning deleted:",n),qe(function(e){return new Set(e).add(n)}),Ve(function(e){if(!e)return{};var i=Object.values(e).filter(function(e){return e.id!==n});console.log("[LearningDetailsForm] Re-keying conflicting learnings after delete:",{deletedId:n,remainingCount:i.length,remainingLearnings:i.map(function(n){return{id:n.id,variant:n.feedback.variant}})});var t={};return i.forEach(function(n,e){var i=String.fromCharCode(65+e);t[i]=n,console.log("[LearningDetailsForm] Conflicting learning ".concat(e," gets key '").concat(i,"':"),n.feedback.variant)}),console.log("[LearningDetailsForm] Final conflicting learnings object:",Object.keys(t)),t}),He(function(e){if(!e)return{};var i=Object.values(e).filter(function(e){return e.id!==n});console.log("[LearningDetailsForm] Re-keying similar learnings after delete:",{deletedId:n,remainingCount:i.length,remainingLearnings:i.map(function(n){return{id:n.id,variant:n.feedback.variant}})});var t={};return i.forEach(function(n,e){var i=String.fromCharCode(65+e);t[i]=n,console.log("[LearningDetailsForm] Similar learning ".concat(e," gets key '").concat(i,"':"),n.feedback.variant)}),console.log("[LearningDetailsForm] Final similar learnings object:",Object.keys(t)),t}),setTimeout(function(){Ve(function(n){return He(function(e){return n&&0!==Object.keys(n).length||e&&0!==Object.keys(e).length||Je(!1),e}),n})},100)},onMergeMessage:function(n){console.log("[LearningDetailsForm] 🟡 MERGE MESSAGE RECEIVED:",n),console.log("[LearningDetailsForm] onMergeLearning available:",!!wn),wn?(console.log("[LearningDetailsForm] Calling onMergeLearning with:",n),wn(n)):console.log("[LearningDetailsForm] ❌ onMergeLearning not available")},onDeleteLearning:xn,setSendMessageInChat:kn,editConflictingLearningTrigger:_n,editSimilarLearningTrigger:Sn,operationStatus:Xe,onOperationComplete:function(){return Ye(null)},onSetOperationStatus:Ye}))]})),r(m,t({sx:{display:"flex",gap:2}},{children:[r(m,t({sx:{flex:1}},{children:[r(h,t({sx:{fontSize:"1rem",fontWeight:600,fontFamily:"Plus Jakarta Sans"},gutterBottom:!0},{children:["Scope ",l(m,t({component:"span",sx:{color:"red"}},{children:"*"}))]})),l(L,t({sx:{width:"50%",fontFamily:"Plus Jakarta Sans"},variant:"outlined"},{children:r(_,t({id:"scope",value:Rn.scope,onChange:(wi="scope",function(n){Nn(function(e){var i;return t(t({},e),((i={})[wi]=n.target.value,i))})}),displayEmpty:!0,sx:{fontFamily:"Plus Jakarta Sans"},fullWidth:!0},{children:[l(S,t({value:"",disabled:!0},{children:"Select scope"})),X.map(function(n,e){return l(S,t({value:n.value,sx:{fontFamily:"Plus Jakarta Sans"}},{children:n.labelText}),e)})]}))}))]})),l(m,t({sx:{flex:1,display:"flex",alignItems:"flex-end",justifyContent:"flex-end"}},{children:r(k,t({variant:"contained",onClick:function(){return e(void 0,void 0,void 0,function(){return i(this,function(n){return fi?(console.warn("Save blocked by button click: Unresolved conflicts are present."),Di(),[2]):(bn(!0),[2])})})},sx:{width:"30%",height:"56px",fontFamily:"Plus Jakarta Sans",backgroundColor:"green",textTransform:"capitalize","&:hover":{backgroundColor:"#006400"},pointerEvents:ke?"none":"auto"},disabled:!gi||fi||"idle"!==xe},{children:["idle"!==xe&&l(w,{sx:{marginRight:"8px",color:"#fff"},size:16}),"saving"===xe?"Saving":"validating"===xe?"Validating":"Save"]}))}))]}))]})),Xe&&l(T,t({open:!0,autoHideDuration:4e3,onClose:function(){return Ye(null)},anchorOrigin:{vertical:"top",horizontal:"right"}},{children:l(A,t({onClose:function(){return Ye(null)},severity:Xe.status,sx:{width:"100%"}},{children:Xe.message}))}))]}))};export{H as default};
|
|
1
|
+
import{__makeTemplateObject as n,__awaiter as e,__generator as i,__assign as t,__rest as o,__spreadArray as a}from"tslib";import{jsxs as r,jsx as l,Fragment as s}from"react/jsx-runtime";import{useState as c,useRef as d,useEffect as u,useCallback as g,useMemo as f}from"react";import{keyframes as p,Box as m,Typography as h,Tooltip as v,Switch as y,TextField as b,IconButton as x,CircularProgress as w,InputAdornment as C,FormControl as L,Select as _,MenuItem as S,Button as k,Snackbar as T,Alert as A,Accordion as F,AccordionSummary as D,AccordionDetails as I}from"@mui/material";import M from"@mui/icons-material/Delete";import E from"@mui/icons-material/Save";import j from"@mui/icons-material/Edit";import O from"@mui/icons-material/Add";import R from"@mui/icons-material/CheckCircleOutline";import W from"@mui/icons-material/Cancel";import N from"@mui/icons-material/KeyboardArrowUp";import{Info as P,Lightbulb as z}from"lucide-react";import J from"../InstantLearning.module.css.js";import B from"./ConflictingLearningWarnCard.js";import U from"./ConflictingLearningWarnCardDB.js";import{publishAgenticFeedbackForVariantIngestion as V}from"../../../service/InstantLearningService.js";import{parseVariant as G}from"../../../utils/variantParser.js";import{http as Z}from"../../../api/transport.js";var H,Q=function(Q){var K,q,$=Q.organizationName,X=Q.selectedText,Y=Q.scopeOptions,nn=Q.devModeTag,en=Q.chatAssistantName,tn=Q.chatLogo,on=void 0===tn?null:tn,an=Q.submitFunction;Q.setShowChat,Q.showChat;var rn=Q.formDataState,ln=Q.setFormDataState,sn=Q.instantLearningSuggestions;Q.setHasUserFilledForm,Q.hasUserFilledForm;var cn=Q.isNewChatClicked,dn=Q.setIsNewChatClicked,un=Q.setHasUserWrittenModification,gn=Q.extractedModification,fn=Q.save,pn=Q.extractedTooltip;Q.isSaveLoading,Q.shouldTriggerSave;var mn=Q.baseUrl;Q.topic_table,Q.variant_table,Q.scope_table,Q.embedding_column_name,Q.embedding_model;var hn=Q.validationWtaResponse,vn=Q.setValidationWtaResponse,yn=Q.learningWtaResponse,bn=Q.setLearningWtaResponse,xn=Q.setIsFormSavedClicked,wn=Q.onDeleteLearning,Cn=Q.onMergeLearning,Ln=Q.mergeLearningTrigger,_n=Q.resetLearningTrigger,Sn=Q.editConflictingLearningTrigger,kn=Q.editSimilarLearningTrigger,Tn=Q.setSendMessageInChat,An=Q.isMergeLoading,Fn=Q.setIsMergeLoading;Q.setSendValidationMessage;var Dn=Q.validationRecommendations,In=Q.setFormValidating,Mn=Q.isFromAudacy,En=void 0!==Mn&&Mn,jn=Q.isFromDashboard,On=void 0!==jn&&jn,Rn=c({context:"",issue_with_response:"",original:null!=X?X:"",modification:"",whenToApply:"",whenNotToApply:"",tooltip:"",scope:En?"":Y.length>0?Y[0].value:"",isTooltipEnabled:!1,isModificationEnabled:!0,isDevMode:!1}),Wn=Rn[0],Nn=Rn[1],Pn=c(!1),zn=Pn[0],Jn=Pn[1],Bn=c(!1),Un=Bn[0],Vn=Bn[1],Gn=c(!1),Zn=Gn[0],Hn=Gn[1],Qn=c(!1),Kn=Qn[0],qn=Qn[1],$n=c([]),Xn=$n[0],Yn=$n[1],ne=c([]),ee=ne[0],ie=ne[1],te=c(!1),oe=te[0],ae=te[1],re=c(!1),le=re[0],se=re[1],ce=d(""),de=d(""),ue=c(null),ge=ue[0],fe=ue[1],pe=c(null),me=pe[0],he=pe[1],ve=c({wta:!1,wnta:!1}),ye=ve[0],be=ve[1],xe=c("idle"),we=xe[0],Ce=xe[1],Le=c({wta:!1,wnta:!1}),_e=Le[0],Se=Le[1];u(function(){Fn(!1)},[]);var ke=c(!1),Te=ke[0];ke[1];var Ae=c(!1);Ae[0];var Fe=Ae[1],De=c(null),Ie=De[0];De[1];var Me=c(!1);Me[0],Me[1];var Ee=c(null);Ee[0];var je=Ee[1],Oe=c(null),Re=Oe[0],We=Oe[1],Ne=c(!1),Pe=Ne[0],ze=Ne[1],Je=c(!1);Je[0];var Be=Je[1],Ue=c(null),Ve=Ue[0],Ge=Ue[1],Ze=c(null),He=Ze[0],Qe=Ze[1],Ke=c(new Set),qe=Ke[0],$e=Ke[1],Xe=c(null),Ye=Xe[0],ni=Xe[1],ei=c(new Set),ii=ei[0],ti=ei[1],oi=p(H||(H=n(["\n 0%, 80%, 100% {\n transform: scale(0);\n }\n 40% {\n transform: scale(1.0);\n }\n "],["\n 0%, 80%, 100% {\n transform: scale(0);\n }\n 40% {\n transform: scale(1.0);\n }\n "]))),ai=g(function(n,t){return e(void 0,void 0,void 0,function(){var e;return i(this,function(i){switch(i.label){case 0:Ce(t),"validating"===t&&In(!0),i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,n()];case 2:return[2,i.sent()];case 3:return e=i.sent(),console.error("An error occurred during ".concat(t,":"),e),[3,5];case 4:return"validating"===t&&In(!1),Ce("idle"),[7];case 5:return[2]}})})},[In]);u(function(){Dn?(fe(Dn.wta),he(Dn.wnta),be({wta:!!Dn.wta,wnta:!!Dn.wnta}),Se({wta:!1,wnta:!1})):(fe(null),he(null),be({wta:!1,wnta:!1}))},[Dn]),u(function(){try{Sn&&"object"==typeof Sn&&Object.keys(Sn).length>0&&(console.log("Processing conflicting learning edit actions:",Sn),Object.entries(Sn).forEach(function(n){var o=n[0],a=n[1];return e(void 0,void 0,void 0,function(){var n,e,r,l,s,c,d,u,g;return i(this,function(i){switch(i.label){case 0:if(!(a&&a.edit_actions&&a.edit_actions.action))return[3,6];if(console.log("Processing conflicting learning edit action:",o,a),ti(function(n){return new Set(n).add(o)}),n=a.conditions_whentoapply||[],e=a.conditions_whennottoapply||[],r=Array.isArray(n)?n.join(" ").replace(/\s+and\s+/gi," and ").replace(/\s+/g," ").trim():n||"",l=Array.isArray(e)?e.join(" ").replace(/\s+and\s+/gi," and ").replace(/\s+/g," ").trim():e||"",Ge(function(n){if(!n)return n;var e=t({},n);return Object.keys(e).forEach(function(n){e[n]&&e[n].id===o&&(e[n]=t(t({},e[n]),{feedback:t(t({},e[n].feedback),{variant:a.variant,when_to_apply:r,when_not_to_apply:l})}))}),e}),console.log("Updated form with conflicting learning conditions:",{whenToApply:r,whenNotToApply:l}),!(mn&&$&&en))return[3,5];i.label=1;case 1:return i.trys.push([1,3,,4]),(s=Ve?Object.values(Ve).find(function(n){return n&&n.id===o}):null)?s.feedback?(c=G(a.variant),d={status:"approved",metadata:{userName:"M Kathyayani",userEmailId:"madumbu.kathyayani@techolution.com",llm:"claude-3.5-sonnet",isVariantFlow:!0,isUpdateAction:!0,isAgentsFeedback:!0,variant:{id:o,variant:a.variant,conditions_whentoapply:r,conditions_whennottoapply:l,scope:{name:"Custom",value:{scopeId:"askmod-scope-id",scopeName:"askmod"}},topic:{id:null,value:c.topic||"default"},categories:[],originalQuestion:"",parameterizedQuestion:null,created_at:(new Date).toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!0}),created_by:null,updated_at:(new Date).toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!0}),updated_by:"madumbu.kathyayani@techolution.com",instantLearningType:"iL",appliedTagsIL:[],tagMappingInfoIL:{}}}},console.log("[LearningDetailsForm] Saving edited conditions for conflicting learning ".concat(o,":"),d),[4,V({baseUrl:mn,organizationName:$,chatAssistantName:en,payload:d})]):(console.error("[LearningDetailsForm] Learning feedback not found for ID: ".concat(o)),[2]):(console.error("[LearningDetailsForm] Learning object not found for ID: ".concat(o)),[2]);case 2:return(u=i.sent()).ok?(console.log("edit notifc"),ni({status:"success",message:"Successfully saved edited conditions for this learning"}),console.log("[LearningDetailsForm] Successfully saved edited conditions for conflicting learning ".concat(o))):(console.error("[LearningDetailsForm] Failed to save edited conditions for conflicting learning ".concat(o,":"),u.status,u.statusText),ni({status:"error",message:"Failed to save edited conditions for this learning"})),[3,4];case 3:return g=i.sent(),ni({status:"error",message:"Error saving edited conditions for learning"}),console.error("[LearningDetailsForm] Error saving edited conditions for conflicting learning ".concat(o,":"),g),[3,4];case 4:return[3,6];case 5:console.log("[LearningDetailsForm] Missing required context for edit API call"),i.label=6;case 6:return[2]}})})})),kn&&"object"==typeof kn&&Object.keys(kn).length>0&&(console.log("Processing similar learning edit actions:",kn),Object.entries(kn).forEach(function(n){var o=n[0],a=n[1];return e(void 0,void 0,void 0,function(){var n,e,r,l,s,c,d,u,g;return i(this,function(i){switch(i.label){case 0:if(!(a&&a.edit_actions&&a.edit_actions.action))return[3,6];if(console.log("Processing similar learning edit action:",o,a),ti(function(n){return new Set(n).add(o)}),n=a.conditions_whentoapply||[],e=a.conditions_whennottoapply||[],r=Array.isArray(n)?n.join(" ").replace(/\s+and\s+/gi," and ").replace(/\s+/g," ").trim():n||"",l=Array.isArray(e)?e.join(" ").replace(/\s+and\s+/gi," and ").replace(/\s+/g," ").trim():e||"",Qe(function(n){if(!n)return n;var e=t({},n);return Object.keys(e).forEach(function(n){e[n]&&e[n].id===o&&(e[n]=t(t({},e[n]),{feedback:t(t({},e[n].feedback),{variant:a.variant,when_to_apply:r,when_not_to_apply:l})}))}),e}),console.log("Updated form with similar learning conditions:",{whenToApply:r,whenNotToApply:l}),!(mn&&$&&en))return[3,5];i.label=1;case 1:return i.trys.push([1,3,,4]),(s=He?Object.values(He).find(function(n){return n&&n.id===o}):null)?s.feedback?(c=G(a.variant),d={status:"approved",metadata:{userName:"M Kathyayani",userEmailId:"madumbu.kathyayani@techolution.com",llm:"claude-3.5-sonnet",isVariantFlow:!0,isUpdateAction:!0,isAgentsFeedback:!0,variant:{id:o,variant:a.variant,conditions_whentoapply:r,conditions_whennottoapply:l,scope:{name:"Custom",value:{scopeId:"askmod-scope-id",scopeName:"askmod"}},topic:{id:null,value:c.topic||"default"},categories:[],originalQuestion:"",parameterizedQuestion:null,created_at:(new Date).toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!0}),created_by:null,updated_at:(new Date).toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!0}),updated_by:"madumbu.kathyayani@techolution.com",instantLearningType:"iL",appliedTagsIL:[],tagMappingInfoIL:{}}}},console.log("[LearningDetailsForm] Saving edited conditions for similar learning ".concat(o,":"),d),[4,V({baseUrl:mn,organizationName:$,chatAssistantName:en,payload:d})]):(console.error("[LearningDetailsForm] Learning feedback not found for ID: ".concat(o)),[2]):(console.error("[LearningDetailsForm] Learning object not found for ID: ".concat(o)),[2]);case 2:return(u=i.sent()).ok?(console.log("edit notifc"),ni({status:"success",message:"Successfully saved edited conditions for this similar learning"}),console.log("[LearningDetailsForm] Successfully saved edited conditions for this similar learning")):(console.error("[LearningDetailsForm] Failed to save edited conditions for similar learning ".concat(o,":"),u.status,u.statusText),ni({status:"error",message:"Failed to save edited conditions for this learning"})),[3,4];case 3:return g=i.sent(),console.error("[LearningDetailsForm] Error saving edited conditions for similar learning ".concat(o,":"),g),[3,4];case 4:return[3,6];case 5:console.log("[LearningDetailsForm] Missing required context for edit API call"),i.label=6;case 6:return[2]}})})}))}catch(n){console.error("Error processing edit tool actions:",n)}},[Sn,kn,Ge,Qe,mn,$,en]);var ri=function(n){var e=n.condition,i=n.onAccept,o=n.onReject;return r(m,t({sx:{display:"flex",alignItems:"center",justifyContent:"space-between",p:1,mb:1,backgroundColor:"#f0f4f8",border:"1px solid #d1d9e6",borderRadius:"4px"}},{children:[l(h,t({sx:{flex:1,fontFamily:"Plus Jakarta Sans"}},{children:e})),r(m,{children:[l(x,t({onClick:i,size:"small",sx:{color:"green"}},{children:l(R,{})})),l(x,t({onClick:o,size:"small",sx:{color:"red"}},{children:l(W,{})}))]})]}))},li=function(n){var e=n.color,i=void 0===e?"#fff":e,o=n.size,a=void 0===o?12:o;return r("svg",t({width:a,height:a,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:[l("path",{d:"M11.4867 9.37021C11.6517 8.87521 12.3507 8.87521 12.5157 9.37021L13.4832 12.2757C13.6961 12.9144 14.0549 13.4947 14.5311 13.9707C15.0073 14.4466 15.5879 14.8051 16.2267 15.0177L19.1307 15.9852C19.6257 16.1502 19.6257 16.8492 19.1307 17.0142L16.2252 17.9817C15.5865 18.1947 15.0062 18.5535 14.5302 19.0297C14.0543 19.5059 13.6958 20.0864 13.4832 20.7252L12.5157 23.6292C12.3188 23.8989 12.0012 24.0019 11.7759 23.9658L10.5192 20.7237C10.3064 20.0852 9.9478 19.505 9.47187 19.029C8.99594 18.5531 8.41572 18.1945 7.77718 17.9817L4.87168 17.0142C4.37668 16.8492 4.37668 16.1502 4.87168 15.9852L7.77718 15.0177C8.41572 14.8049 8.99594 14.4463 9.47187 13.9704C9.9478 13.4945 10.3064 12.9142 10.5192 12.2757L11.4867 9.37021Z",fill:i}),l("path",{d:"M5.69218 1.72171C5.8106 1.52009 6.19176 1.52009 6.31018 1.72171L6.89068 3.46471C7.15018 4.24171 7.75918 4.85071 8.53618 5.11021L10.2792 5.69071C10.4808 5.75512 10.4808 6.24724 10.2792 6.31018L8.53618 6.88921C7.75918 7.15018 7.15018 7.75918 6.89068 8.53618L6.31018 10.2777C6.19176 10.4793 5.8106 10.4793 5.69218 10.2777L5.11168 8.53471C4.85071 7.75918 4.24171 7.15018 3.46618 6.88921L1.72318 6.30871C1.52156 6.24576 1.52156 5.75512 1.72318 5.69071L3.46618 5.11021C4.24171 4.85071 4.85071 4.24171 5.11168 3.46471L5.69218 1.72171Z",fill:i}),l("path",{d:"M16.2957 0.148207C16.4119 0.016038 16.5905 0.016038 16.7067 0.148207L17.0937 1.30921C17.2662 1.82821 17.6727 2.23471 18.1917 2.40721L19.3527 2.79421C19.4848 2.83676 19.4848 3.16265 19.3527 3.20521L18.1917 3.59221C17.6727 3.76521 17.2662 4.17171 17.0937 4.69021L16.7067 5.85121C16.5905 5.98338 16.4119 5.98338 16.2957 5.85121L15.9087 4.69021C15.7377 4.17171 15.3312 3.76521 14.8122 3.59221L13.6512 3.20521C13.519 3.16265 13.519 2.83676 13.6512 2.79421L14.8122 2.40721C15.3312 2.23471 15.7377 1.82821 15.9102 1.30921L16.2957 0.148207Z",fill:i})]}))},si=function(n){var e=n.score;return r(m,t({sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1.5,py:.5,borderRadius:"16px",backgroundColor:"#10B981",color:"white",fontSize:"0.8rem",fontWeight:600,fontFamily:"Plus Jakarta Sans"}},{children:[l(li,{}),r(h,t({sx:{fontSize:"0.8rem",fontWeight:600,fontFamily:"inherit"}},{children:[e,"%"]}))]}))},ci=function(n){var e=n.reason,i=n.title;return r(F,t({elevation:0,sx:{backgroundColor:"#f3f0ff",border:"1px solid #dcd6f7",borderRadius:2,mb:2,"&::before":{display:"none"}}},{children:[l(D,t({expandIcon:l(N,{style:{color:"#5928ed"}}),sx:{minHeight:"auto","& .MuiAccordionSummary-content":{margin:"12px 0"}}},{children:r(m,t({sx:{display:"flex",alignItems:"center",gap:1}},{children:[l(z,{size:16,color:"#5928ed"}),l(h,t({sx:{fontSize:"0.85rem",fontWeight:600,color:"#5928ed",fontFamily:"Plus Jakarta Sans"}},{children:i}))]}))})),l(I,t({sx:{pt:0,pb:1.5,backgroundColor:"#faf9ff"}},{children:l(h,t({sx:{fontSize:"0.9rem",color:"#4A4458",fontFamily:"Plus Jakarta Sans"}},{children:e}))}))]}))},di=function(n,e,i){"wta"===e?(ze(!1),_e.wta?Yn(function(e){return Array.from(new Set(a(a([],e,!0),[n],!1)))}):(Yn([n]),Se(function(n){return t(t({},n),{wta:!0})})),fe(function(n){if(!n||!n.when_to_apply)return n;var e=t({},n.when_to_apply);return delete e[i],t(t({},n),{when_to_apply:e})}),be(function(n){return t(t({},n),{wta:!1})})):(ze(!1),_e.wnta?ie(function(e){return Array.from(new Set(a(a([],e,!0),[n],!1)))}):(ie([n]),Se(function(n){return t(t({},n),{wnta:!0})})),he(function(n){if(!n||!n.when_not_to_apply)return n;var e=t({},n.when_not_to_apply);return delete e[i],t(t({},n),{when_not_to_apply:e})}),be(function(n){return t(t({},n),{wnta:!1})}))},ui=function(n,e,i){"wta"===e?(fe(function(n){if(!n||!n.when_to_apply)return n;var e=t({},n.when_to_apply);return delete e[i],t(t({},n),{when_to_apply:e})}),be(function(n){return t(t({},n),{wta:!1})})):(he(function(n){if(!n||!n.when_not_to_apply)return n;var e=t({},n.when_not_to_apply);return delete e[i],t(t({},n),{when_not_to_apply:e})}),be(function(n){return t(t({},n),{wnta:!1})}))},gi=g(function(n){return e(void 0,void 0,void 0,function(){var e,t,o,a;return i(this,function(i){switch(i.label){case 0:if(console.log("[LearningDetailsForm] Merging learning from chat:",n),!He)return console.log("No similar learnings data available"),[2];if(!(e=Object.values(He).find(function(e){return e&&e.id===n})))return console.log("Learning with ID ".concat(n," not found in similar learnings")),[2];if(console.log("Found learning to merge:",e),console.log("🔵 LEARNING DETAILS FORM - Merge button clicked, waiting for merge response to provide correct conditions"),Fn(!0),Qe(function(e){if(!e)return{};var i={};return Object.keys(e).forEach(function(t){e[t].id!==n&&(i[t]=e[t])}),i}),$e(function(e){return new Set(e).add(n)}),setTimeout(function(){Ge(function(n){return Qe(function(e){return n&&0!==Object.keys(n).length||e&&0!==Object.keys(e).length||Be(!1),e}),n})},100),console.log("[LearningDetailsForm] Successfully merged learning from chat"),!(mn&&$&&en))return[3,5];i.label=1;case 1:return i.trys.push([1,3,,4]),t={status:"approved",metadata:{userName:"M Kathyayani",userEmailId:"madumbu.kathyayani@techolution.com",llm:"claude-3.5-sonnet",isVariantFlow:!0,isDeleteAction:!0,isAgentsFeedback:!0,variant:{id:n,scope:{name:"User",value:[{name:"M Kathyayani",email:"madumbu.kathyayani@techolution.com",userId:"8059658c-a65c-4e14-89aa-a5195f5d09f5"}]},topic:{id:null,value:"default"},variant:"Learning ID: ".concat(n),question:"",categories:[],created_at:(new Date).toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!0}),originalQuestion:"",parameterizedQuestion:"",conditions_whentoapply:"",conditions_whennottoapply:"",parentId:null}}},console.log("[LearningDetailsForm] Deleting merged learning with ID: ".concat(n)),[4,V({baseUrl:mn,organizationName:$,chatAssistantName:en,payload:t})];case 2:return(o=i.sent()).ok?(ni({status:"success",message:"Learning merged successfully."}),console.log("[LearningDetailsForm] Successfully deleted merged learning ".concat(n))):(console.error("[LearningDetailsForm] Failed to delete merged learning",o.status,o.statusText),ni({status:"error",message:"Failed to complete merge for learning."})),[3,4];case 3:return a=i.sent(),console.error("[LearningDetailsForm] Error deleting merged learning ".concat(n,":"),a),[3,4];case 4:return[3,6];case 5:console.log("[LearningDetailsForm] Missing required context for delete API call"),i.label=6;case 6:return[2]}})})},[He,ln,Yn,ie,mn,$,en]);u(function(){Ln&&(gi(Ln),Cn&&Cn(Ln))},[Ln,Cn,gi]),u(function(){(null==rn?void 0:rn._extractedOriginalUpdate)&&(console.log("🔵 LEARNING DETAILS FORM - Syncing extracted original:",rn.original),Nn(function(n){return t(t({},n),{original:rn.original||""})}),ln(function(n){return n?(n._extractedOriginalUpdate,o(n,["_extractedOriginalUpdate"])):n}))},[null==rn?void 0:rn._extractedOriginalUpdate,null==rn?void 0:rn.original,ln]),u(function(){_n&&(console.log("[LearningDetailsForm] 🔄 RESET TRIGGER RECEIVED - Clearing all learning data"),console.log("[LearningDetailsForm] Before reset - DBCWtaApiResponse:",Ve?Object.keys(Ve).length:0,"items"),console.log("[LearningDetailsForm] Before reset - DBSWtaApiResponse:",He?Object.keys(He).length:0,"items"),Ge(null),Qe(null),Be(!1),ze(!1),$e(new Set),Yn([]),ie([]),Fn(!1),ti(new Set),Nn(function(n){return t(t({},n),{original:On?"":n.original,whenToApply:"",whenNotToApply:"",tooltip:"",modification:"",isTooltipEnabled:!1,isModificationEnabled:!0})}),console.log("[LearningDetailsForm] ✅ Learning data reset completed"))},[_n]);var fi=f(function(){var n,e,i,t,o,a=""!==(null===(n=null==Wn?void 0:Wn.original)||void 0===n?void 0:n.trim()),r=(null==Xn?void 0:Xn.length)>0,l=Xn.every(function(n){return""!==n.trim()}),s=!(null==Wn?void 0:Wn.isModificationEnabled)||""!==(null===(e=null==Wn?void 0:Wn.modification)||void 0===e?void 0:e.trim()),c=!(null==Wn?void 0:Wn.isTooltipEnabled)||""!==(null===(i=null==Wn?void 0:Wn.tooltip)||void 0===i?void 0:i.trim()),d=(null==Wn?void 0:Wn.isModificationEnabled)&&""!==(null===(t=null==Wn?void 0:Wn.modification)||void 0===t?void 0:t.trim())||(null==Wn?void 0:Wn.isTooltipEnabled)&&""!==(null===(o=null==Wn?void 0:Wn.tooltip)||void 0===o?void 0:o.trim()),u=""!==Wn.scope;return a&&r&&l&&s&&c&&d&&!(oe||le)&&u},[Wn,Xn,oe,le]),pi=f(function(){if(Pe&&Re)return!0;var n=Object.values(Ve||{}),e=Object.values(He||{}),i=a(a([],n.map(function(n){return n.id}),!0),e.map(function(n){return n.id}),!0);return 0!==i.length&&!i.every(function(n){return ii.has(n)})},[Pe,Re,Ve,He,ii]),mi=d(null);u(function(){Wn.isModificationEnabled||Nn(function(n){return t(t({},n),{modification:""})}),Wn.isTooltipEnabled||Nn(function(n){return t(t({},n),{tooltip:""})})},[Wn.isModificationEnabled,Wn.isTooltipEnabled]),u(function(){if(""===gn&&(null==Wn?void 0:Wn.isTooltipEnabled)&&Nn(function(n){return t(t({},n),{isModificationEnabled:!1})}),""!==gn||(null==Wn?void 0:Wn.isTooltipEnabled)||Nn(function(n){return t(t({},n),{modification:""})}),gn&&""!==gn){Nn(function(n){return t(t({},n),{modification:gn,isModificationEnabled:!0})}),qn(!0);var n=setTimeout(function(){qn(!1)},400);return function(){return clearTimeout(n)}}},[gn]),u(function(){""===pn&&Nn(function(n){return t(t({},n),{isTooltipEnabled:!1})}),pn&&""!==pn&&Nn(function(n){return t(t({},n),{tooltip:pn,isTooltipEnabled:!0})})},[pn]),u(function(){cn&&$e(new Set)},[cn]),u(function(){cn&&(Nn(function(n){return t(t({},n),{original:On?"":n.original,modification:"",tooltip:"",isTooltipEnabled:!1,isModificationEnabled:!0,whenToApply:"",whenNotToApply:""})}),Yn([]),ie([]),Fn(!1),dn(!1),Fe(!1),ze(!1),Be(!1))},[cn]),u(function(){ln(Wn)},[Wn]),u(function(){(null==rn?void 0:rn._mergeUpdate)&&(console.log("🔵 LEARNING DETAILS FORM - Detected merge update:",rn),rn._mergeWTA&&(console.log("🔵 LEARNING DETAILS FORM - Updating suggestedWTA with merge data:",rn._mergeWTA),Yn(rn._mergeWTA)),rn._mergeWNTA&&(console.log("🔵 LEARNING DETAILS FORM - Updating suggestedWnTA with merge data:",rn._mergeWNTA),ie(rn._mergeWNTA)),ln(function(n){return n._mergeUpdate,n._mergeWTA,n._mergeWNTA,o(n,["_mergeUpdate","_mergeWTA","_mergeWNTA"])}))},[null==rn?void 0:rn._mergeUpdate,null==rn?void 0:rn._mergeWTA,null==rn?void 0:rn._mergeWNTA]),u(function(){""===Wn.original.trim()||""===Wn.modification.trim()&&""===Wn.tooltip.trim()||zn||Jn(!0)},[Wn]),u(function(){if((null==Xn?void 0:Xn.length)>=0){var n=Xn.join(" OR ");Wn.whenToApply!==n&&Nn(function(e){return t(t({},e),{whenToApply:n})})}},[JSON.stringify(Xn),Wn.whenToApply]),u(function(){if((null==ee?void 0:ee.length)>=0){var n=ee.join(" OR ");Wn.whenNotToApply!==n&&Nn(function(e){return t(t({},e),{whenNotToApply:n})})}},[JSON.stringify(ee),Wn.whenNotToApply]),u(function(){if((null==Xn?void 0:Xn.length)>0&&!oe){Vn(!0);var n=setTimeout(function(){Vn(!1)},400);return function(){return clearTimeout(n)}}},[JSON.stringify(Xn)]),u(function(){if((null==ee?void 0:ee.length)>0&&!le){Hn(!0);var n=setTimeout(function(){Hn(!1)},400);return function(){return clearTimeout(n)}}},[JSON.stringify(ee)]),u(function(){if(sn){ae(!1),se(!1);var n=function(n){return n&&/[a-zA-Z]/.test(n)};if(Array.isArray(null==sn?void 0:sn.conditions_whentoapply)){var e=sn.conditions_whentoapply.map(function(n){return n.when_to_apply}).filter(function(e){return n(e)});Yn(e),Nn(function(n){return t(t({},n),{whenToApply:e.join(" OR ")})})}if(Array.isArray(null==sn?void 0:sn.conditions_whennottoapply)){var i=sn.conditions_whennottoapply.map(function(n){return n.when_not_to_apply}).filter(function(e){return n(e)});ie(i),Nn(function(n){return t(t({},n),{whenNotToApply:i.join(" OR ")})})}}},[sn]),u(function(){var n,e;((null===(n=null==sn?void 0:sn.conditions_whentoapply)||void 0===n?void 0:n.length)>0||(null===(e=null==sn?void 0:sn.conditions_whennottoapply)||void 0===e?void 0:e.length)>0)&&(fe(null),he(null),ze(!1))},[sn]);var hi=d(null),vi=g(function(){hi.current&&clearTimeout(hi.current),hi.current=setTimeout(function(){un(!0)},1e3)},[]),yi=g(function(n){return function(e){Nn(function(i){var o;return t(t({},i),((o={})[n]=e.target.value,o))}),vi()}},[vi]),bi=function(n){return n.replace(new RegExp("<".concat(nn,">"),"gi"),"").replace(new RegExp("</".concat(nn,">"),"gi"),"").replace(/<\/?[^>]+(>|$)/g,"")},xi=g(function(n){var e=bi(n);Nn(function(n){return t(t({},n),{tooltip:e})}),vi()},[vi]),wi=function(n){return function(e){var i=e.target.checked,o={};"isTooltipEnabled"===n?o={tooltip:i?Wn.tooltip:"",isModificationEnabled:!i||Wn.isModificationEnabled}:"isModificationEnabled"===n&&(o={modification:i?Wn.modification:""}),Nn(function(e){var a;return t(t(t({},e),o),((a={})[n]=i,a))})}};u(function(){if(fn){console.log("'save: true' received. Forcibly clearing all conflict UI states."),ze(!1),We(null),xn(!0);e(void 0,void 0,void 0,function(){return i(this,function(n){return pi?(console.error("Save action triggered via prop, but is blocked due to unresolved conflicts."),[2]):(console.log("Form submitted:",Wn),Ce("saving"),""===(null==Wn?void 0:Wn.modification)&&Nn(function(n){return t(t({},n),{isModificationEnabled:!1})}),""===(null==Wn?void 0:Wn.tooltip)&&Nn(function(n){return t(t({},n),{isTooltipEnabled:!1})}),an(Wn,function(){return Ce("idle")}),[2])})})}},[fn,pi]);u(function(){hn&&!1===hn.is_valid?(ze(!0),We(hn.conflictingConditions),Ii()):hn&&hn.is_valid?(ze(!1),We(null),console.log("valid response received, calling handleSubmit")):(ze(!1),console.log("resetting validateWtaApiResponse"),We(null))},[hn]),u(function(){if(yn){ti(new Set);var n=(null==yn?void 0:yn.conflicting_learnings)||{},e=(null==yn?void 0:yn.similar_learnings)||{};Object.keys(n).length,Object.keys(e).length;var i=Object.keys(n).reduce(function(e,i){var t=n[i];return qe.has(t.id)||(e[i]=t),e},{}),t=Object.keys(e).reduce(function(n,i){var t=e[i];return qe.has(t.id)||(n[i]=t),n},{});Ge(i),Qe(t);var o=Object.keys(i).length>0,a=Object.keys(t).length>0;o||a?(Be(!0),ze(!1),Ii()):!0===(null==yn?void 0:yn.is_valid_db)&&Be(!1)}},[yn,qe]);var Ci,Li,_i,Si=function(){return e(void 0,void 0,void 0,function(){var n,e,t,o,a,r,l,s,c;return i(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,Z.post("".concat(mn,"/instant_learning/validate-wta"),{whenToApply:null===(a=null===(o=null==Wn?void 0:Wn.whenToApply)||void 0===o?void 0:o.split("OR"))||void 0===a?void 0:a.filter(function(n){return""!==n}),whenNotToApply:null===(l=null===(r=null==Wn?void 0:Wn.whenNotToApply)||void 0===r?void 0:r.split("OR"))||void 0===l?void 0:l.filter(function(n){return""!==n})},{headers:{"Content-Type":"application/json"}})];case 1:return n=i.sent(),(e=n.data).response&&vn(e.response),e&&e.response&&e.response.is_valid?(je(null),ze(!1),We(null)):e&&e.response&&!e.response.is_valid&&(je(null===(s=e.response)||void 0===s?void 0:s.reason),ze(!0),We(e.response.conflictingConditions),Ii(),Tn("Validation failed. Do you have any recommendations for me?")),[2,null===(c=null==e?void 0:e.response)||void 0===c?void 0:c.is_valid];case 2:return t=i.sent(),console.error("API error:",t),[3,3];case 3:return[2]}})})},ki=function(){return e(void 0,void 0,void 0,function(){var n,e,t,o;return i(this,function(i){switch(i.label){case 0:console.error("Calling LearningWtaApi"),n=Wn.modification&&""!==Wn.modification.trim()?"Replace ".concat(Wn.original," with ").concat(Wn.modification):"Replace ".concat(Wn.original," with <sup>").concat(Wn.tooltip,"</sup>"),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,Z.post("".concat(mn,"/instant_learning/similar-variants"),{topic_table:"".concat($,"-instantLearning-topics"),variant_table:"".concat($,"-instantLearning-variants"),scope_table:"".concat($,"-instantLearning-scopes"),scope_id:Wn.scope,embedding_column_name:"variant_embedding",embedding_model:"mxbai-embed-large-v1",topic:Wn.original,top_k:5,llm_model:"gemini-2.5-flash-lite",similarity_threshold:"0.6",variants:{variant:n,conditions_whentoapply:Array.isArray(Wn.whenToApply)?Wn.whenToApply.filter(Boolean).join(" OR "):Wn.whenToApply||"",conditions_whennottoapply:Array.isArray(Wn.whenNotToApply)?Wn.whenNotToApply.filter(Boolean).join(" OR "):Wn.whenNotToApply||""}},{headers:{"Content-Type":"application/json"}})];case 2:return e=i.sent(),t=e.data,console.error("[Learn] Data:",t.response),console.error("[Learn] is_valid_db:",t.response.is_valid_db),console.error("[Learn] conlficting_learnings:",t.response.conflicting_learnings),console.error("[Learn] similar_learnings:",t.response.similar_learnings),t&&t.response&&bn(t.response),[3,4];case 3:return o=i.sent(),console.error("API error:",o),[3,4];case 4:return[2]}})})},Ti=d(null),Ai=c(!1),Fi=Ai[0],Di=Ai[1],Ii=function(){var n=Ti.current;n&&setTimeout(function(){n.scrollTo({top:n.scrollHeight,behavior:"smooth"}),Di(!1)},200)};return u(function(){var n=Ti.current,e=function(){var n=Ti.current;if(n){var e=n.scrollTop,i=n.scrollHeight,t=n.clientHeight;Di(!(i-(e+t)<=35))}};return n&&(n.addEventListener("scroll",e),e()),function(){n&&n.removeEventListener("scroll",e)}},[Fi]),r(m,t({p:0,className:J.customFont,sx:{display:"flex",flexDirection:"column",height:"100%",width:"100%"}},{children:[l(m,{children:l(h,t({sx:{fontSize:20,fontWeight:600,fontFamily:"Plus Jakarta Sans"}},{children:"Instant Learning"}))}),r(m,t({sx:{fontFamily:"Plus Jakarta Sans",display:"flex",flexDirection:"column",gap:2,justifyContent:"space-between",flexGrow:1,paddingTop:"20px",height:"calc(100% - 30px)",overflow:"auto"}},{children:[r(m,t({sx:{display:"flex",flexDirection:"column",gap:"20px",height:"calc(100% - 90px)",overflow:"auto",position:"relative"},ref:Ti},{children:[r(m,t({sx:{display:"flex",gap:2}},{children:[r(m,t({sx:{flex:1}},{children:[r(m,t({sx:{display:"flex",alignItems:"center"}},{children:[r(h,t({sx:{fontFamily:"Plus Jakarta Sans",fontSize:"1rem",fontWeight:600,display:"flex",alignItems:"center"}},{children:["Original"," ",l(m,t({component:"span",sx:{color:"red"}},{children:"*"})),l(v,t({title:"Original word/phrase which needs to be replaced",placement:"top",arrow:!0,componentsProps:{tooltip:{sx:{fontSize:"0.875rem",padding:"0.5rem",fontFamily:"Plus Jakarta Sans, sans-serif"}}}},{children:l(P,{size:16,style:{paddingLeft:"0.25rem"}})}))]})),l(y,{sx:{visibility:"hidden"},disabled:!0})]})),l(b,{sx:{"& .MuiInputBase-root":{fontFamily:"Plus Jakarta Sans, sans-serif"},"& .MuiInputLabel-root":{fontFamily:"Plus Jakarta Sans, sans-serif"}},id:"original",value:Wn.original,onChange:yi("original"),fullWidth:!0,placeholder:"Enter original"})]})),r(m,t({sx:{flex:1}},{children:[r(m,t({sx:{display:"flex",alignItems:"center"}},{children:[r(h,t({sx:{fontFamily:"Plus Jakarta Sans",fontWeight:600,fontSize:"1rem",display:"flex",alignItems:"center"}},{children:["Modification",Wn.isModificationEnabled&&!Wn.isTooltipEnabled&&l(m,t({component:"span",sx:{color:"red"}},{children:"*"})),l(v,t({title:"Modified word/phrase which Original needs to be replaced with",placement:"top",arrow:!0,componentsProps:{tooltip:{sx:{fontSize:"0.875rem",padding:"0.5rem",fontFamily:"Plus Jakarta Sans, sans-serif"}}}},{children:l(P,{size:16,style:{paddingLeft:"0.25rem"}})}))]})),l(y,{checked:Wn.isModificationEnabled,disabled:!Wn.isTooltipEnabled,onChange:wi("isModificationEnabled"),sx:{"& .MuiSwitch-switchBase.Mui-checked":{color:"#5928ed"},"& .MuiSwitch-switchBase.Mui-checked + .MuiSwitch-track":{backgroundColor:"#5928ed"}}})]})),Wn.isModificationEnabled&&l(b,{sx:{"& .MuiInputBase-root":{fontFamily:"Plus Jakarta Sans, sans-serif"},"& .MuiInputLabel-root":{fontFamily:"Plus Jakarta Sans, sans-serif"},boxShadow:Kn?"0 0 12px 3px rgba(34, 197, 94, 0.6)":"none",transition:"box-shadow 0.3s ease-in-out"},id:"modification",value:Wn.modification,onChange:yi("modification"),fullWidth:!0,placeholder:"Change ".concat(X," to...")})]}))]})),r(m,t({sx:{display:"flex",gap:2}},{children:[l(m,{sx:{flex:1}}),r(m,t({sx:{flex:1}},{children:[r(m,t({sx:{display:"flex",justifyContent:"space-between"}},{children:[r(m,t({sx:{display:"flex",alignItems:"center"}},{children:[r(h,t({sx:{fontSize:"1rem",fontWeight:600,fontFamily:"Plus Jakarta Sans",display:"flex",alignItems:"center"}},{children:["Tooltip",Wn.isTooltipEnabled&&l(m,t({component:"span",sx:{color:"red"}},{children:"*"})),l(v,t({title:"Adds a tooltip to the modification or the original word",placement:"top",arrow:!0,componentsProps:{tooltip:{sx:{fontSize:"0.875rem",padding:"0.5rem",fontFamily:"Plus Jakarta Sans, sans-serif"}}}},{children:l(P,{size:16,style:{paddingLeft:"0.25rem"}})}))]})),l(y,{checked:Wn.isTooltipEnabled,onChange:wi("isTooltipEnabled"),sx:{"& .MuiSwitch-switchBase.Mui-checked":{color:"#5928ed"},"& .MuiSwitch-switchBase.Mui-checked + .MuiSwitch-track":{backgroundColor:"#5928ed"}}})]})),Wn.isTooltipEnabled&&r(m,t({sx:{display:"flex",alignItems:"center"}},{children:[l(h,t({sx:{fontSize:14,fontWeight:600,fontFamily:"Plus Jakarta Sans"}},{children:"Dev Mode"})),l(y,{checked:Wn.isDevMode,onChange:wi("isDevMode"),sx:{"& .MuiSwitch-switchBase.Mui-checked":{color:"#4b5563"},"& .MuiSwitch-switchBase.Mui-checked + .MuiSwitch-track":{backgroundColor:"#4b5563"}}})]}))]})),Wn.isTooltipEnabled&&l(b,{id:"tooltip",inputRef:mi,value:(_i=bi(Wn.tooltip),Wn.isDevMode?"<".concat(nn,">").concat(_i,"</").concat(nn,">"):_i),onChange:function(n){return xi(n.target.value)},onFocus:function(){setTimeout(function(){if(Wn.isDevMode){var n=bi(Wn.tooltip),e="<".concat(nn,">").length+n.length,i=mi.current;i&&i.setSelectionRange(e,e)}},0)},fullWidth:!0,placeholder:Wn.isDevMode?"<".concat(nn,">Enter tooltip content</").concat(nn,">"):"Enter tooltip content",sx:{"& .MuiInputBase-root":{fontFamily:"Plus Jakarta Sans, sans-serif"},"& .MuiInputLabel-root":{fontFamily:"Plus Jakarta Sans, sans-serif"}}})]}))]})),r(m,t({sx:{display:"flex",gap:2,minHeight:"".concat(Wn.isTooltipEnabled?"400px":"380px"),flexShrink:0}},{children:[r(m,t({sx:{flex:1,height:"100%"}},{children:[r(h,t({sx:{fontSize:"1rem",fontWeight:600,marginBottom:"8px",fontFamily:"Plus Jakarta Sans, sans-serif",display:"flex",alignItems:"center"},gutterBottom:!0},{children:["When To Apply",l(m,t({component:"span",sx:{color:"red"}},{children:"*"})),l(v,t({title:"Specific situations or conditions where this learning should be applied.",placement:"top",arrow:!0,componentsProps:{tooltip:{sx:{fontSize:"0.875rem",padding:"0.5rem",fontFamily:"Plus Jakarta Sans, sans-serif"}}}},{children:l(P,{size:16,style:{paddingLeft:"0.25rem"}})}))]})),r(m,t({sx:{border:"1px solid #ccc",borderRadius:"8px",padding:2,height:"calc(100% - 64px)",display:"flex",flexDirection:"column",boxShadow:Un?"0 0 12px 3px rgba(34, 197, 94, 0.6)":"none",transition:"box-shadow 0.3s ease-in-out"}},{children:[r(m,t({display:"flex",alignItems:"center",justifyContent:"space-between",sx:{mb:"8px"}},{children:[r(m,t({display:"flex",gap:"0.25rem",alignItems:"center"},{children:[l("svg",t({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:l("g",t({id:"bi:stars"},{children:l("path",{id:"Vector",d:"M11.4867 9.37021C11.6517 8.87521 12.3507 8.87521 12.5157 9.37021L13.4832 12.2757C13.6961 12.9144 14.0549 13.4947 14.5311 13.9707C15.0073 14.4466 15.5879 14.8051 16.2267 15.0177L19.1307 15.9852C19.6257 16.1502 19.6257 16.8492 19.1307 17.0142L16.2252 17.9817C15.5865 18.1947 15.0062 18.5535 14.5302 19.0297C14.0543 19.5059 13.6958 20.0864 13.4832 20.7252L12.5157 23.6292C12.4801 23.7376 12.4112 23.832 12.3188 23.8989C12.2264 23.9658 12.1153 24.0019 12.0012 24.0019C11.8871 24.0019 11.7759 23.9658 11.6835 23.8989C11.5912 23.832 11.5223 23.7376 11.4867 23.6292L10.5192 20.7237C10.3064 20.0852 9.9478 19.505 9.47187 19.029C8.99594 18.5531 8.41572 18.1945 7.77718 17.9817L4.87168 17.0142C4.76329 16.9786 4.6689 16.9097 4.60198 16.8173C4.53506 16.725 4.49904 16.6138 4.49904 16.4997C4.49904 16.3856 4.53506 16.2745 4.60198 16.1821C4.6689 16.0897 4.76329 16.0208 4.87168 15.9852L7.77718 15.0177C8.41572 14.8049 8.99594 14.4463 9.47187 13.9704C9.9478 13.4945 10.3064 12.9142 10.5192 12.2757L11.4867 9.37021ZM5.69218 1.72171C5.71369 1.65675 5.75512 1.60022 5.8106 1.56016C5.86607 1.52009 5.93275 1.49853 6.00118 1.49853C6.06961 1.49853 6.13629 1.52009 6.19176 1.56016C6.24724 1.60022 6.28867 1.65675 6.31018 1.72171L6.89068 3.46471C7.15018 4.24171 7.75918 4.85071 8.53618 5.11021L10.2792 5.69071C10.3441 5.71222 10.4007 5.75365 10.4407 5.80912C10.4808 5.86459 10.5024 5.93128 10.5024 5.99971C10.5024 6.06813 10.4808 6.13482 10.4407 6.19029C10.4007 6.24576 10.3441 6.2872 10.2792 6.30871L8.53618 6.88921C8.15274 7.01647 7.80431 7.23149 7.51864 7.51717C7.23296 7.80284 7.01794 8.15127 6.89068 8.53471L6.31018 10.2777C6.28867 10.3427 6.24724 10.3992 6.19176 10.4393C6.13629 10.4793 6.06961 10.5009 6.00118 10.5009C5.93275 10.5009 5.86607 10.4793 5.8106 10.4393C5.75512 10.3992 5.71369 10.3427 5.69218 10.2777L5.11168 8.53471C4.98442 8.15127 4.7694 7.80284 4.48372 7.51717C4.19805 7.23149 3.84962 7.01647 3.46618 6.88921L1.72318 6.30871C1.65822 6.2872 1.60169 6.24576 1.56163 6.19029C1.52156 6.13482 1.5 6.06813 1.5 5.99971C1.5 5.93128 1.52156 5.86459 1.56163 5.80912C1.60169 5.75365 1.65822 5.71222 1.72318 5.69071L3.46618 5.11021C3.84962 4.98295 4.19805 4.76792 4.48372 4.48225C4.7694 4.19657 4.98442 3.84815 5.11168 3.46471L5.69218 1.72171ZM16.2957 0.148207C16.3105 0.105497 16.3382 0.068461 16.3751 0.0422495C16.4119 0.016038 16.456 0.00195312 16.5012 0.00195312C16.5464 0.00195313 16.5905 0.016038 16.6273 0.0422495C16.6641 0.068461 16.6919 0.105497 16.7067 0.148207L17.0937 1.30921C17.2662 1.82821 17.6727 2.23471 18.1917 2.40721L19.3527 2.79421C19.3954 2.80901 19.4324 2.83676 19.4586 2.87359C19.4848 2.91042 19.4989 2.9545 19.4989 2.99971C19.4989 3.04491 19.4848 3.08899 19.4586 3.12582C19.4324 3.16265 19.3954 3.1904 19.3527 3.20521L18.1917 3.59221C17.9361 3.67771 17.7039 3.82139 17.5134 4.01193C17.3229 4.20247 17.1792 4.43467 17.0937 4.69021L16.7067 5.85121C16.6919 5.89392 16.6641 5.93095 16.6273 5.95717C16.5905 5.98338 16.5464 5.99746 16.5012 5.99746C16.456 5.99746 16.4119 5.98338 16.3751 5.95717C16.3382 5.93095 16.3105 5.89392 16.2957 5.85121L15.9087 4.69021C15.8232 4.43467 15.6795 4.20247 15.489 4.01193C15.2984 3.82139 15.0662 3.67771 14.8107 3.59221L13.6512 3.20521C13.6085 3.1904 13.5714 3.16265 13.5452 3.12582C13.519 3.08899 13.5049 3.04491 13.5049 2.99971C13.5049 2.9545 13.519 2.91042 13.5452 2.87359C13.5714 2.83676 13.6085 2.80901 13.6512 2.79421L14.8122 2.40721C15.3312 2.23471 15.7377 1.82821 15.9102 1.30921L16.2957 0.148207Z",fill:"#5928ed"})}))})),l(h,t({variant:"body1",sx:{ml:on?1:0,fontWeight:"600",fontFamily:"Plus Jakarta Sans",color:"#5928ed"}},{children:"AI Suggestions"}))]})),r(m,{children:[l(v,t({title:"Add New Condition",placement:"top",arrow:!0},{children:l(x,t({onClick:function(){Yn(function(n){return a(a([],n,!0),[""],!1)}),ae(!0)},size:"small",sx:{color:"gray","&:hover":{color:"black"}}},{children:l(O,{fontSize:"small"})}))})),Xn.length>0&&l(v,t({title:oe?"Save":"Edit Conditions",placement:"top",arrow:!0},{children:l("span",{children:l(x,t({onClick:oe?function(){return e(void 0,void 0,void 0,function(){var n,t,o,a,r,l,s;return i(this,function(c){return n=Xn.filter(function(n){return""!==n.trim()}),(t=JSON.stringify(n))===ce.current?(console.log("WTA conditions unchanged. Skipping validation."),ae(!1),[2]):(Yn(n),ae(!1),o=""!==(null===(r=Wn.original)||void 0===r?void 0:r.trim()),a=""!==(null===(l=Wn.modification)||void 0===l?void 0:l.trim())||""!==(null===(s=Wn.tooltip)||void 0===s?void 0:s.trim()),o&&a?(ai(function(){return e(void 0,void 0,void 0,function(){return i(this,function(n){switch(n.label){case 0:return[4,Si()];case 1:return n.sent()?[4,ki()]:[3,3];case 2:n.sent(),n.label=3;case 3:return[2]}})})},"validating"),ce.current=t,[2]):(ce.current=t,[2]))})})}:function(){return ae(!0)},size:"small",disabled:oe&&Xn.some(function(n){return""===n.trim()}),sx:{color:"gray","&:hover":{color:"black"}}},{children:l(oe?E:j,{fontSize:"small"})}))})}))]})]})),l(m,t({sx:{flexGrow:1,overflow:"auto",paddingTop:"16px"}},{children:An?l("div",t({style:{height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"}},{children:r("div",t({style:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"0.5rem",paddingTop:"1rem",paddingBottom:"1rem"}},{children:[l(w,{size:24,sx:{color:"#5928ED",mb:1}}),l("div",t({style:{fontWeight:"700",color:"#5928ED"}},{children:"Merging conditions..."})),l("div",t({style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",gap:"0.25rem",fontSize:"0.875rem",flexFlow:"wrap"}},{children:l("div",{children:"Processing merge response...."})}))]}))})):Un?r(m,t({sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%",gap:2}},{children:[l(w,{size:24}),l("span",{children:"Loading When to apply..."})]})):r(s,{children:[Xn.length>0&&l("ol",t({style:{paddingLeft:"0rem",margin:0}},{children:Xn.map(function(n,e){return r(m,t({component:"li",sx:{display:"flex",alignItems:"flex-start",gap:1,mb:e<Xn.length-1?2:0}},{children:[l(b,{variant:"outlined",disabled:!oe,fullWidth:!0,multiline:!0,value:n,error:oe&&!n.trim(),helperText:oe&&!n.trim()?"This field cannot be empty":"",onChange:function(n){var i=a([],Xn,!0);i[e]=n.target.value,vn(null),bn({similar_learnings:"",conflicting_learnings:""}),Yn(i),Nn(function(n){return t(t({},n),{whenToApply:i.join(" OR ")})})},sx:{backgroundColor:"#f9fafb",borderRadius:1,fontFamily:"Plus Jakarta Sans, sans-serif","& .MuiInputBase-root":{fontFamily:"Plus Jakarta Sans, sans-serif"},"& .MuiInputLabel-root":{fontFamily:"Plus Jakarta Sans, sans-serif"},"& .MuiInputBase-input.Mui-disabled":{color:"#000",WebkitTextFillColor:"#000"}},InputProps:{startAdornment:r(C,t({position:"start",sx:{color:"#000",alignSelf:"flex-start",paddingTop:"12px"}},{children:[e+1,"."]}))}}),oe&&l(x,t({onClick:function(){var n=Xn.filter(function(n,i){return i!==e});Yn(n),Nn(function(e){return t(t({},e),{whenToApply:n.join(" OR ")})})},sx:{mt:1},size:"large"},{children:l(M,{})}))]}),e)})})),"validating"===we&&r(m,t({sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:"6px",mt:2,fontFamily:'"Plus Jakarta Sans", sans-serif',color:"#5a28ed"}},{children:[l(h,t({variant:"body2",sx:{color:"#5a28ed"}},{children:"Validating your conditions"})),l(m,{sx:{width:"8px",height:"8px",bgcolor:"#5a28ed",borderRadius:"50%",animation:"".concat(oi," 1.4s infinite ease-in-out both"),animationDelay:"-0.32s"}}),l(m,{sx:{width:"8px",height:"8px",bgcolor:"#5a28ed",borderRadius:"50%",animation:"".concat(oi," 1.4s infinite ease-in-out both"),animationDelay:"-0.16s"}}),l(m,{sx:{width:"8px",height:"8px",bgcolor:"#5a28ed",borderRadius:"50%",animation:"".concat(oi," 1.4s infinite ease-in-out both")}})]})),(null==ge?void 0:ge.when_to_apply)&&Object.keys(ge.when_to_apply).length>0&&r(m,t({mt:Xn.length>0?3:0},{children:[ye.wta&&r(m,t({sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:1.5}},{children:[l(h,t({variant:"subtitle2",sx:{fontWeight:"bold",fontFamily:"Plus Jakarta Sans"}},{children:"AI's Recommended Fix:"})),l(si,{score:ge.confidence_score})]})),ye.wta&&l(ci,{reason:ge.reason,title:"Why these suggestions?"}),Object.entries(ge.when_to_apply).map(function(n){var e=n[0],i=n[1];return l(ri,{condition:"".concat(e,". ").concat(i),onAccept:function(){return di(i,"wta",e)},onReject:function(){return ui(0,"wta",e)}},"rec-wta-".concat(e))})]})),0===Xn.length&&(!(null==ge?void 0:ge.when_to_apply)||0===Object.keys(ge.when_to_apply).length)&&l("div",t({style:{height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"}},{children:r("div",t({style:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"0.5rem",paddingTop:"1rem",paddingBottom:"1rem"}},{children:[l("div",t({style:{fontWeight:"700",color:"#6b7280"}},{children:"No suggestions found"})),r("div",t({style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",gap:"0.25rem",fontSize:"1rem",flexFlow:"wrap"}},{children:[l("div",t({style:{}},{children:"Tell us about your learning in "})),l("span",t({style:{color:"#5928ED",fontWeight:"700"}},{children:"InstantLearning.AI"}))," ",l("span",{children:"Chat"})]}))]}))}))]})}))]}))]})),r(m,t({sx:{flex:1,height:"100%"}},{children:[r(h,t({sx:{fontSize:"1rem",fontWeight:600,marginBottom:"8px",fontFamily:"Plus Jakarta Sans",display:"flex",alignItems:"center"},gutterBottom:!0},{children:["When Not To Apply",l(v,t({title:"Cases where this learning should not be applied to avoid incorrect responses.",placement:"top",arrow:!0,componentsProps:{tooltip:{sx:{fontSize:"0.875rem",padding:"0.5rem",fontFamily:"Plus Jakarta Sans, sans-serif"}}}},{children:l(P,{size:16,style:{paddingLeft:"0.25rem"}})}))]})),r(m,t({sx:{border:"1px solid #ccc",borderRadius:"8px",padding:2,height:"calc(100% - 64px)",display:"flex",flexDirection:"column",boxShadow:Zn?"0 0 12px 3px rgba(34, 197, 94, 0.6)":"none",transition:"box-shadow 0.3s ease-in-out"}},{children:[r(m,t({display:"flex",alignItems:"center",justifyContent:"space-between",sx:{mb:"8px"}},{children:[r(m,t({display:"flex",gap:"0.25rem",alignItems:"center"},{children:[l("svg",t({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:l("g",t({id:"bi:stars"},{children:l("path",{id:"Vector",d:"M11.4867 9.37021C11.6517 8.87521 12.3507 8.87521 12.5157 9.37021L13.4832 12.2757C13.6961 12.9144 14.0549 13.4947 14.5311 13.9707C15.0073 14.4466 15.5879 14.8051 16.2267 15.0177L19.1307 15.9852C19.6257 16.1502 19.6257 16.8492 19.1307 17.0142L16.2252 17.9817C15.5865 18.1947 15.0062 18.5535 14.5302 19.0297C14.0543 19.5059 13.6958 20.0864 13.4832 20.7252L12.5157 23.6292C12.4801 23.7376 12.4112 23.832 12.3188 23.8989C12.2264 23.9658 12.1153 24.0019 12.0012 24.0019C11.8871 24.0019 11.7759 23.9658 11.6835 23.8989C11.5912 23.832 11.5223 23.7376 11.4867 23.6292L10.5192 20.7237C10.3064 20.0852 9.9478 19.505 9.47187 19.029C8.99594 18.5531 8.41572 18.1945 7.77718 17.9817L4.87168 17.0142C4.76329 16.9786 4.6689 16.9097 4.60198 16.8173C4.53506 16.725 4.49904 16.6138 4.49904 16.4997C4.49904 16.3856 4.53506 16.2745 4.60198 16.1821C4.6689 16.0897 4.76329 16.0208 4.87168 15.9852L7.77718 15.0177C8.41572 14.8049 8.99594 14.4463 9.47187 13.9704C9.9478 13.4945 10.3064 12.9142 10.5192 12.2757L11.4867 9.37021ZM5.69218 1.72171C5.71369 1.65675 5.75512 1.60022 5.8106 1.56016C5.86607 1.52009 5.93275 1.49853 6.00118 1.49853C6.06961 1.49853 6.13629 1.52009 6.19176 1.56016C6.24724 1.60022 6.28867 1.65675 6.31018 1.72171L6.89068 3.46471C7.15018 4.24171 7.75918 4.85071 8.53618 5.11021L10.2792 5.69071C10.3441 5.71222 10.4007 5.75365 10.4407 5.80912C10.4808 5.86459 10.5024 5.93128 10.5024 5.99971C10.5024 6.06813 10.4808 6.13482 10.4407 6.19029C10.4007 6.24576 10.3441 6.2872 10.2792 6.30871L8.53618 6.88921C8.15274 7.01647 7.80431 7.23149 7.51864 7.51717C7.23296 7.80284 7.01794 8.15127 6.89068 8.53471L6.31018 10.2777C6.28867 10.3427 6.24724 10.3992 6.19176 10.4393C6.13629 10.4793 6.06961 10.5009 6.00118 10.5009C5.93275 10.5009 5.86607 10.4793 5.8106 10.4393C5.75512 10.3992 5.71369 10.3427 5.69218 10.2777L5.11168 8.53471C4.98442 8.15127 4.7694 7.80284 4.48372 7.51717C4.19805 7.23149 3.84962 7.01647 3.46618 6.88921L1.72318 6.30871C1.65822 6.2872 1.60169 6.24576 1.56163 6.19029C1.52156 6.13482 1.5 6.06813 1.5 5.99971C1.5 5.93128 1.52156 5.86459 1.56163 5.80912C1.60169 5.75365 1.65822 5.71222 1.72318 5.69071L3.46618 5.11021C3.84962 4.98295 4.19805 4.76792 4.48372 4.48225C4.7694 4.19657 4.98442 3.84815 5.11168 3.46471L5.69218 1.72171ZM16.2957 0.148207C16.3105 0.105497 16.3382 0.068461 16.3751 0.0422495C16.4119 0.016038 16.456 0.00195312 16.5012 0.00195312C16.5464 0.00195313 16.5905 0.016038 16.6273 0.0422495C16.6641 0.068461 16.6919 0.105497 16.7067 0.148207L17.0937 1.30921C17.2662 1.82821 17.6727 2.23471 18.1917 2.40721L19.3527 2.79421C19.3954 2.80901 19.4324 2.83676 19.4586 2.87359C19.4848 2.91042 19.4989 2.9545 19.4989 2.99971C19.4989 3.04491 19.4848 3.08899 19.4586 3.12582C19.4324 3.16265 19.3954 3.1904 19.3527 3.20521L18.1917 3.59221C17.9361 3.67771 17.7039 3.82139 17.5134 4.01193C17.3229 4.20247 17.1792 4.43467 17.0937 4.69021L16.7067 5.85121C16.6919 5.89392 16.6641 5.93095 16.6273 5.95717C16.5905 5.98338 16.5464 5.99746 16.5012 5.99746C16.456 5.99746 16.4119 5.98338 16.3751 5.95717C16.3382 5.93095 16.3105 5.89392 16.2957 5.85121L15.9087 4.69021C15.8232 4.43467 15.6795 4.20247 15.489 4.01193C15.2984 3.82139 15.0662 3.67771 14.8107 3.59221L13.6512 3.20521C13.6085 3.1904 13.5714 3.16265 13.5452 3.12582C13.519 3.08899 13.5049 3.04491 13.5049 2.99971C13.5049 2.9545 13.519 2.91042 13.5452 2.87359C13.5714 2.83676 13.6085 2.80901 13.6512 2.79421L14.8122 2.40721C15.3312 2.23471 15.7377 1.82821 15.9102 1.30921L16.2957 0.148207Z",fill:"#5928ed"})}))})),l(h,t({variant:"body1",sx:{ml:on?1:0,fontWeight:"600",fontFamily:"Plus Jakarta Sans",color:"#5928ed"}},{children:"AI Suggestions"}))]})),r(m,{children:[l(v,t({title:"Add New Condition",placement:"top",arrow:!0},{children:l(x,t({onClick:function(){ie(function(n){return a(a([],n,!0),[""],!1)}),se(!0)},size:"small",sx:{color:"gray","&:hover":{color:"black"}}},{children:l(O,{fontSize:"small"})}))})),ee.length>0&&l(v,t({title:le?"Save":"Edit Conditions",placement:"top",arrow:!0},{children:l("span",{children:l(x,t({onClick:le?function(){return e(void 0,void 0,void 0,function(){var n,t,o,a,r,l,s;return i(this,function(c){return n=ee.filter(function(n){return""!==n.trim()}),(t=JSON.stringify(n))===de.current?(console.log("WnTA conditions unchanged. Skipping validation."),se(!1),[2]):(ie(n),se(!1),o=""!==(null===(r=Wn.original)||void 0===r?void 0:r.trim()),a=""!==(null===(l=Wn.modification)||void 0===l?void 0:l.trim())||""!==(null===(s=Wn.tooltip)||void 0===s?void 0:s.trim()),o&&a?(""!==Wn.whenToApply.trim()&&(ai(function(){return e(void 0,void 0,void 0,function(){return i(this,function(n){switch(n.label){case 0:return[4,Si()];case 1:return n.sent()?[4,ki()]:[3,3];case 2:n.sent(),n.label=3;case 3:return[2]}})})},"validating"),de.current=t),[2]):(de.current=t,[2]))})})}:function(){return se(!0)},size:"small",disabled:le&&ee.some(function(n){return""===n.trim()}),sx:{color:"gray","&:hover":{color:"black"}}},{children:l(le?E:j,{fontSize:"small"})}))})}))]})]})),l(m,t({sx:{flexGrow:1,overflow:"auto",paddingTop:"16px"}},{children:An?l("div",{style:{height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"}}):Zn?r(m,t({sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%",gap:2}},{children:[l(w,{size:24}),l("span",{children:"Loading When not to apply..."})]})):r(s,{children:[ee.length>0&&l("ol",t({style:{paddingLeft:"0rem",margin:0}},{children:ee.map(function(n,e){return r(m,t({component:"li",sx:{display:"flex",alignItems:"flex-start",gap:1,mb:e<ee.length-1?2:0}},{children:[l(b,{variant:"outlined",disabled:!le,fullWidth:!0,multiline:!0,value:n,error:le&&!n.trim(),helperText:le&&!n.trim()?"This field cannot be empty":"",onChange:function(n){var i=a([],ee,!0);i[e]=n.target.value,vn(null),bn({similar_learnings:"",conflicting_learnings:""}),ie(i),Nn(function(n){return t(t({},n),{whenNotToApply:i.join(" OR ")})})},sx:{backgroundColor:"#f9fafb",borderRadius:1,fontFamily:"Plus Jakarta Sans, sans-serif","& .MuiInputBase-root":{fontFamily:"Plus Jakarta Sans, sans-serif"},"& .MuiInputLabel-root":{fontFamily:"Plus Jakarta Sans, sans-serif"},"& .MuiInputBase-input.Mui-disabled":{color:"#000",WebkitTextFillColor:"#000"}},InputProps:{startAdornment:r(C,t({position:"start",sx:{color:"#000",alignSelf:"flex-start",paddingTop:"12px"}},{children:[e+1,"."]}))}}),le&&l(x,t({onClick:function(){var n=ee.filter(function(n,i){return i!==e});ie(n),Nn(function(e){return t(t({},e),{whenNotToApply:n.join(" OR ")})})},sx:{mt:1},size:"large"},{children:l(M,{})}))]}),e)})})),ee.length>0&&"validating"===we&&r(m,t({sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:"6px",mt:2,fontFamily:'"Plus Jakarta Sans", sans-serif',color:"#5a28ed"}},{children:[l(h,t({variant:"body2",sx:{color:"#5a28ed"}},{children:"Validating your conditions"})),l(m,{sx:{width:"8px",height:"8px",bgcolor:"#5a28ed",borderRadius:"50%",animation:"".concat(oi," 1.4s infinite ease-in-out both"),animationDelay:"-0.32s"}}),l(m,{sx:{width:"8px",height:"8px",bgcolor:"#5a28ed",borderRadius:"50%",animation:"".concat(oi," 1.4s infinite ease-in-out both"),animationDelay:"-0.16s"}}),l(m,{sx:{width:"8px",height:"8px",bgcolor:"#5a28ed",borderRadius:"50%",animation:"".concat(oi," 1.4s infinite ease-in-out both")}})]})),(null==me?void 0:me.when_not_to_apply)&&Object.keys(me.when_not_to_apply).length>0&&r(m,t({mt:ee.length>0?3:0},{children:[ye.wnta&&r(m,t({sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:1.5}},{children:[l(h,t({variant:"subtitle2",sx:{fontWeight:"bold",fontFamily:"Plus Jakarta Sans"}},{children:"AI's Recommended Fix:"})),l(si,{score:me.confidence_score})]})),ye.wnta&&l(ci,{reason:me.reason,title:"Why these suggestions?"}),Object.entries(me.when_not_to_apply).map(function(n){var e=n[0],i=n[1];return l(ri,{condition:"".concat(e,". ").concat(i),onAccept:function(){return di(i,"wnta",e)},onReject:function(){return ui(0,"wnta",e)}},"rec-wnta-".concat(e))})]})),0===ee.length&&(!(null==me?void 0:me.when_not_to_apply)||0===Object.keys(me.when_not_to_apply).length)&&l("div",t({style:{height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"}},{children:r("div",t({style:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"0.5rem",paddingTop:"1rem",paddingBottom:"1rem"}},{children:[l("div",t({style:{fontWeight:"700",color:"#6b7280"}},{children:"No suggestions found"})),r("div",t({style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",gap:"0.25rem",fontSize:"1rem",flexFlow:"wrap"}},{children:[l("div",t({style:{}},{children:"Tell us about your learning in "})),l("span",t({style:{color:"#5928ED",fontWeight:"700"}},{children:"InstantLearning.AI"}))," ",l("span",{children:"Chat"})]}))]}))}))]})}))]}))]}))]})),Pe&&Re&&l(B,{conflictingConditions:Re}),(Li=Ve&&Object.keys(Ve).length>0||He&&Object.keys(He).length>0,console.log("[LearningDetailsForm] 🔍 Checking if warning cards should show:",Li),console.log("[LearningDetailsForm] DBCWtaApiResponse keys:",Ve?Object.keys(Ve).length:0),console.log("[LearningDetailsForm] DBSWtaApiResponse keys:",He?Object.keys(He).length:0),Li&&l(U,{conflictingConditions:[Object.values(Ve||{}),Object.values(He||{})],baseUrl:mn,organizationName:$,chatAssistantName:en||"",curlPayload:null!==(q=null!==(K=null==Ie?void 0:Ie.curlPayload)&&void 0!==K?K:null===window||void 0===window?void 0:window.__DELETE_CURL__)&&void 0!==q?q:"",onDeleted:function(n){console.log("[LearningDetailsForm] Learning deleted:",n),$e(function(e){return new Set(e).add(n)}),Ge(function(e){if(!e)return{};var i=Object.values(e).filter(function(e){return e.id!==n});console.log("[LearningDetailsForm] Re-keying conflicting learnings after delete:",{deletedId:n,remainingCount:i.length,remainingLearnings:i.map(function(n){return{id:n.id,variant:n.feedback.variant}})});var t={};return i.forEach(function(n,e){var i=String.fromCharCode(65+e);t[i]=n,console.log("[LearningDetailsForm] Conflicting learning ".concat(e," gets key '").concat(i,"':"),n.feedback.variant)}),console.log("[LearningDetailsForm] Final conflicting learnings object:",Object.keys(t)),t}),Qe(function(e){if(!e)return{};var i=Object.values(e).filter(function(e){return e.id!==n});console.log("[LearningDetailsForm] Re-keying similar learnings after delete:",{deletedId:n,remainingCount:i.length,remainingLearnings:i.map(function(n){return{id:n.id,variant:n.feedback.variant}})});var t={};return i.forEach(function(n,e){var i=String.fromCharCode(65+e);t[i]=n,console.log("[LearningDetailsForm] Similar learning ".concat(e," gets key '").concat(i,"':"),n.feedback.variant)}),console.log("[LearningDetailsForm] Final similar learnings object:",Object.keys(t)),t}),setTimeout(function(){Ge(function(n){return Qe(function(e){return n&&0!==Object.keys(n).length||e&&0!==Object.keys(e).length||Be(!1),e}),n})},100)},onMergeMessage:function(n){console.log("[LearningDetailsForm] 🟡 MERGE MESSAGE RECEIVED:",n),console.log("[LearningDetailsForm] onMergeLearning available:",!!Cn),Cn?(console.log("[LearningDetailsForm] Calling onMergeLearning with:",n),Cn(n)):console.log("[LearningDetailsForm] ❌ onMergeLearning not available")},onDeleteLearning:wn,setSendMessageInChat:Tn,editConflictingLearningTrigger:Sn,editSimilarLearningTrigger:kn,operationStatus:Ye,onOperationComplete:function(){return ni(null)},onSetOperationStatus:ni}))]})),r(m,t({sx:{display:"flex",gap:2}},{children:[r(m,t({sx:{flex:1}},{children:[r(h,t({sx:{fontSize:"1rem",fontWeight:600,fontFamily:"Plus Jakarta Sans"},gutterBottom:!0},{children:["Scope ",l(m,t({component:"span",sx:{color:"red"}},{children:"*"}))]})),l(L,t({sx:{width:"50%",fontFamily:"Plus Jakarta Sans"},variant:"outlined"},{children:r(_,t({id:"scope",value:Wn.scope,onChange:(Ci="scope",function(n){Nn(function(e){var i;return t(t({},e),((i={})[Ci]=n.target.value,i))})}),displayEmpty:!0,sx:{fontFamily:"Plus Jakarta Sans"},fullWidth:!0},{children:[l(S,t({value:"",disabled:!0},{children:"Select scope"})),Y.map(function(n,e){return l(S,t({value:n.value,sx:{fontFamily:"Plus Jakarta Sans"}},{children:n.labelText}),e)})]}))}))]})),l(m,t({sx:{flex:1,display:"flex",alignItems:"flex-end",justifyContent:"flex-end"}},{children:r(k,t({variant:"contained",onClick:function(){return e(void 0,void 0,void 0,function(){return i(this,function(n){return pi?(console.warn("Save blocked by button click: Unresolved conflicts are present."),Ii(),[2]):(xn(!0),[2])})})},sx:{width:"30%",height:"56px",fontFamily:"Plus Jakarta Sans",backgroundColor:"green",textTransform:"capitalize","&:hover":{backgroundColor:"#006400"},pointerEvents:Te?"none":"auto"},disabled:!fi||pi||"idle"!==we},{children:["idle"!==we&&l(w,{sx:{marginRight:"8px",color:"#fff"},size:16}),"saving"===we?"Saving":"validating"===we?"Validating":"Save"]}))}))]}))]})),Ye&&l(T,t({open:!0,autoHideDuration:4e3,onClose:function(){return ni(null)},anchorOrigin:{vertical:"top",horizontal:"right"}},{children:l(A,t({onClose:function(){return ni(null)},severity:Ye.status,sx:{width:"100%"}},{children:Ye.message}))}))]}))};export{Q as default};
|
|
2
2
|
//# sourceMappingURL=LearningDetailsForm.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{__assign as t}from"tslib";import{jsxs as e,jsx as n}from"react/jsx-runtime";import{useState as i}from"react";import{Check as r,Eye as c,X as l}from"lucide-react";import o from"./Cart.styles.js";function a(t){try{var e=new Date(t),n=e.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),i=e.toLocaleDateString("en-GB").replace(/\//g,"/");return"Added on - ".concat(n," | ").concat(i)}catch(e){return t}}function d(d){var s,u=d.items,h=d.onRemove,m=d.onProceed,p=i(null),y=p[0],f=p[1];var g=null!==(s=u.find(function(t){return t.instant_learning_id===y}))&&void 0!==s?s:null;return e("section",t({style:o.cartSection},{children:[e("div",t({style:o.cartHeaderRow},{children:[n("p",t({style:o.cartTitle},{children:"Guideline Cart"})),e("span",t({style:o.cartBadge},{children:[u.length," Added"]}))]})),n("p",t({style:o.cartDescription},{children:"Click an item to select it for this session"})),n("div",t({style:o.cartBody},{children:n("div",t({style:o.cartList},{children:0===u.length?n("div",t({style:o.emptyState},{children:"No guidelines added yet"})):u.map(function(i){var d=i.instant_learning_id===y;return e("div",t({style:d?o.cartItemSelected:o.cartItem,onClick:function(){return t=i.instant_learning_id,void f(function(e){return e===t?null:t});var t}},{children:[e("div",t({style:o.cartItemTop},{children:[e("div",t({style:o.cartItemTopLeft},{children:[n("span",t({style:d?o.cartCheckbox:o.cartCheckboxEmpty},{children:d&&n(r,{size:12,strokeWidth:3})})),n("p",t({style:o.cartItemName},{children:i.instant_learning_title}))]})),e("div",t({style:o.cartItemIcons},{children:[n(c,{size:16,strokeWidth:2}),n("button",t({type:"button",style:o.removeBtn,onClick:function(t){return function(t,e){t.stopPropagation(),y===e&&f(null),h(e)}(t,i.instant_learning_id)}},{children:n(l,{size:16,strokeWidth:2})}))]}))]})),n("p",t({style:o.cartItemDescription},{children:i.instant_learning_description})),n("p",t({style:o.cartItemDate},{children:a(i.created_at)}))]}),i.instant_learning_id)})}))})),n("button",t({type:"button",style:g?o.proceedButton:o.proceedButtonDisabled,disabled:!g,onClick:function(){return g&&m(g)}},{children:n("span",{children:"Proceed with Selected"})}))]}))}export{d as Cart,d as default};
|
|
2
|
+
//# sourceMappingURL=Cart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Cart.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e={cartSection:{display:"flex",width:"100%",flexDirection:"column",borderRadius:12,border:"1px solid #5B2CF4",background:"#F5F1FF",padding:28,fontFamily:"Inter, sans-serif",boxShadow:"0 1px 4px rgba(16,24,40,0.04)"},cartHeaderRow:{display:"flex",alignItems:"center",gap:12},cartTitle:{fontSize:18,fontWeight:700,color:"#1F2937",margin:0},cartBadge:{display:"inline-flex",height:24,alignItems:"center",borderRadius:9999,background:"#EDE7FF",padding:"0 12px",fontSize:12,fontWeight:600,color:"#5B2CF4",whiteSpace:"nowrap"},cartDescription:{marginTop:4,fontSize:13,color:"#667085"},cartBody:{marginTop:24,minHeight:280,flex:"1 1 0%",overflow:"hidden"},cartList:{maxHeight:420,overflowY:"auto",paddingRight:8,display:"flex",flexDirection:"column",gap:16},emptyState:{display:"flex",alignItems:"center",justifyContent:"center",height:120,fontSize:14,color:"#98A2B3"},cartItem:{display:"flex",flexDirection:"column",borderRadius:10,border:"1px solid #EAECF0",background:"#ffffff",padding:16,cursor:"pointer"},cartItemSelected:{display:"flex",flexDirection:"column",borderRadius:10,border:"2px solid #4438F5",background:"#F5F3FF",padding:16,cursor:"pointer"},cartItemTop:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:8},cartItemTopLeft:{display:"flex",alignItems:"center",gap:8,minWidth:0},cartCheckbox:{display:"inline-flex",height:18,width:18,flexShrink:0,alignItems:"center",justifyContent:"center",borderRadius:4,background:"#4438F5",color:"#ffffff"},cartCheckboxEmpty:{display:"inline-flex",height:18,width:18,flexShrink:0,alignItems:"center",justifyContent:"center",borderRadius:4,border:"2px solid #D0D5DD",background:"#ffffff"},cartItemName:{fontSize:14,fontWeight:600,color:"#1F2937",margin:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},cartItemIcons:{display:"flex",alignItems:"center",gap:10,flexShrink:0,color:"#98A2B3"},cartItemDescription:{marginTop:8,fontSize:13,color:"#667085"},cartItemDate:{marginTop:8,fontSize:12,color:"#98A2B3"},proceedButton:{marginTop:24,display:"inline-flex",height:44,width:"100%",alignItems:"center",justifyContent:"center",gap:8,borderRadius:6,background:"#4438F5",fontSize:15,fontWeight:600,color:"#ffffff",border:"none",boxShadow:"0 1px 2px rgba(16,24,40,0.08)",cursor:"pointer"},proceedButtonDisabled:{marginTop:24,display:"inline-flex",height:44,width:"100%",alignItems:"center",justifyContent:"center",gap:8,borderRadius:6,background:"#C4C9D4",fontSize:15,fontWeight:600,color:"#ffffff",border:"none",cursor:"not-allowed"},removeBtn:{background:"none",border:"none",padding:0,cursor:"pointer",display:"flex",alignItems:"center",color:"#98A2B3"}};export{e as default};
|
|
2
|
+
//# sourceMappingURL=Cart.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Cart.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{__assign as t}from"tslib";import{jsxs as e,jsx as r}from"react/jsx-runtime";import{BookOpen as i,Eye as n,MoreVertical as d,UserCheck as o,Compass as c,Check as l,Plus as s}from"lucide-react";import a from"./GuidelineCard.styles.js";function u(t){try{var e=new Date(t),r=e.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),i=e.toLocaleDateString("en-GB").replace(/\//g,"/");return"Added on - ".concat(r," | ").concat(i)}catch(e){return t}}function h(h){var p=h.guideline,y=h.inCart,f=h.onToggleCart,m=h.onExplore;return e("div",t({style:a.card},{children:[e("div",t({style:a.cardTop},{children:[e("div",t({style:a.cardTopLeft},{children:[r(i,{size:18,strokeWidth:2,color:"#6D5BFF"}),r("p",t({style:a.cardTitle},{children:p.instant_learning_title}))]})),e("div",t({style:a.cardTopIcons},{children:[r(n,{size:16,strokeWidth:2}),r(d,{size:16,strokeWidth:2}),r(o,{size:16,strokeWidth:2})]}))]})),r("p",t({style:a.cardDescription},{children:p.instant_learning_description})),r("p",t({style:a.cardDate},{children:u(p.created_at)})),e("div",t({style:a.cardActionsRow},{children:[e("button",t({type:"button",style:a.exploreButton,onClick:function(){return null==m?void 0:m(p)}},{children:[r(c,{size:15,strokeWidth:2.4}),r("span",{children:"Explore"})]})),e("button",y?t({type:"button",style:a.cardAddedButton,onClick:function(){return f(p)}},{children:[r(l,{size:16,strokeWidth:2.4}),r("span",{children:"Added to Cart"})]}):t({type:"button",style:a.cardAddButton,onClick:function(){return f(p)}},{children:[r(s,{size:16,strokeWidth:2.4}),r("span",{children:"Add to Cart"})]}))]}))]}))}export{h as GuidelineCard,h as default};
|
|
2
|
+
//# sourceMappingURL=GuidelineCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GuidelineCard.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e={card:{display:"flex",flexDirection:"column",borderRadius:10,border:"1px solid #EAECF0",background:"#ffffff",padding:20,boxShadow:"0 1px 2px rgba(16,24,40,0.04)"},cardTop:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:8},cardTopLeft:{display:"flex",alignItems:"center",gap:8,minWidth:0},cardTitle:{fontSize:15,fontWeight:600,lineHeight:"24px",color:"#1F2937",margin:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},cardTopIcons:{display:"flex",alignItems:"center",gap:10,flexShrink:0,color:"#98A2B3"},cardDescription:{marginTop:8,fontSize:13,lineHeight:"19px",color:"#667085",overflow:"hidden",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"},cardDate:{marginTop:12,fontSize:12,color:"#98A2B3"},cardActions:{marginTop:16},cardAddButton:{display:"inline-flex",height:36,flex:1,alignItems:"center",justifyContent:"center",gap:8,borderRadius:6,border:"1px solid #4438F5",background:"#ffffff",fontSize:13,fontWeight:600,color:"#4438F5",cursor:"pointer"},cardAddedButton:{display:"inline-flex",height:36,flex:1,alignItems:"center",justifyContent:"center",gap:8,borderRadius:6,border:"1px solid #EAE7FF",background:"#EDE9FE",fontSize:13,fontWeight:600,color:"#4438F5",cursor:"pointer"},exploreButton:{display:"inline-flex",height:36,flex:1,alignItems:"center",justifyContent:"center",gap:6,borderRadius:6,border:"1px solid #D0D5DD",background:"#ffffff",fontSize:13,fontWeight:600,color:"#344054",cursor:"pointer"},cardActionsRow:{display:"flex",gap:8,marginTop:16}};export{e as default};
|
|
2
|
+
//# sourceMappingURL=GuidelineCard.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GuidelineCard.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{__assign as n,__spreadArray as e}from"tslib";import{jsx as t,jsxs as i,Fragment as r}from"react/jsx-runtime";import{useState as o,useEffect as l}from"react";import{CircleHelp as d,Plus as a,UserCheck as s,Clock3 as u,ShoppingBag as c,ChevronDown as p,ChevronUp as h}from"lucide-react";import{fetchGuidelineInstances as m}from"./api.js";import{GuidelineCard as f}from"./GuidelineCard.js";import{Cart as y}from"./Cart/Cart.js";import{LearningManagementWrapper as g}from"./LearningManagementWrapper.js";import b from"./GuidelinesLandingPage.styles.js";function _(n,e){var t,i,r,o;return e?null!==(o=null===(r=n.mode_mappings.find(function(n){return n.mode_id===e}))||void 0===r?void 0:r.application_integration_id)&&void 0!==o?o:"":null!==(i=null===(t=n.mode_mappings[0])||void 0===t?void 0:t.application_integration_id)&&void 0!==i?i:""}function v(v){var k=v.baseUrl,S=v.token,W=v.userDetails,z=v.modeId,C=o([]),j=C[0],w=C[1],G=o(6),I=G[0],x=G[1],A=o([]),L=A[0],M=A[1],T=o(!0),B=T[0],D=T[1],E=o(null),P=E[0],R=E[1],H=o(null),K=H[0],U=H[1];l(function(){D(!0),R(null),m(k,S).then(function(n){w(n.data)}).catch(function(n){return R(n.message)}).finally(function(){return D(!1)})},[k,S]);var q=new Set(L.map(function(n){return n.instant_learning_id}));function F(n){M(function(t){return t.some(function(e){return e.instant_learning_id===n.instant_learning_id})?t.filter(function(e){return e.instant_learning_id!==n.instant_learning_id}):e(e([],t,!0),[n],!1)})}var J=j.slice(0,I),N=j.length-I,O=I>6;return t("div",n({style:b.page},{children:i("main",n({style:b.main},{children:[i("section",n({style:b.headerSection},{children:[i("div",n({style:b.intro},{children:[t("h1",n({style:b.title},{children:"Add Guidelines"})),t("p",n({style:b.description},{children:"Add guidelines that shape how your agent behaves, responds, and interprets."})),i("button",n({type:"button",style:b.debugLink},{children:[t("span",{children:"Know more about debug mode"}),t(d,{size:18,strokeWidth:2})]}))]})),i("button",n({type:"button",style:b.addButton},{children:[t(a,{size:20,strokeWidth:2.4}),t("span",{children:"Add Guideline"})]}))]})),i("section",n({style:b.bodySection},{children:[i("section",n({style:b.librarySection},{children:[i("div",n({style:b.libraryTabs},{children:[i("button",n({type:"button",style:n(n({},b.tab),b.tabActive)},{children:[t(s,{size:18,strokeWidth:2}),t("span",{children:"Saved"})]})),i("button",n({type:"button",style:b.tab},{children:[t(u,{size:18,strokeWidth:2}),t("span",{children:"Recently used"})]})),i("button",n({type:"button",style:b.tab},{children:[t(c,{size:18,strokeWidth:2}),t("span",{children:"Marketplace"})]}))]})),K?t(g,{userDetails:W,appIntegrationId:_(K,z),modeId:z,guidelineTitle:K.instant_learning_title,onBack:function(){return U(null)}}):i(r,{children:[B&&t("p",n({style:b.loadingState},{children:"Loading guidelines..."})),P&&i("p",n({style:b.errorState},{children:["Error: ",P]})),!B&&!P&&i(r,{children:[t("div",n({style:b.libraryGrid},{children:J.map(function(n){return t(f,{guideline:n,inCart:q.has(n.instant_learning_id),onToggleCart:F,onExplore:U},n.instant_learning_id)})})),i("div",n({style:{display:"flex",alignItems:"center",gap:16}},{children:[N>0&&i("button",n({type:"button",style:b.showMore,onClick:function(){return x(function(n){return n+6})}},{children:[i("span",{children:["Show more guidelines (",N,")"]}),t(p,{size:16,strokeWidth:2.4})]})),O&&i("button",n({type:"button",style:b.showMore,onClick:function(){return x(6)}},{children:[t("span",{children:"Hide"}),t(h,{size:16,strokeWidth:2.4})]}))]}))]})]})]})),t(y,{items:L,onRemove:function(n){M(function(e){return e.filter(function(e){return e.instant_learning_id!==n})})},onProceed:function(){}})]}))]}))}))}export{v as GuidelineLandingPage,v as default};
|
|
2
|
+
//# sourceMappingURL=GuidelinesLandingPage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GuidelinesLandingPage.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e={page:{height:"100%",width:"100%",background:"#ffffff",fontFamily:"Inter, sans-serif"},main:{height:"100%",overflow:"auto",padding:40},headerSection:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:24,justifyContent:"space-between",alignItems:"flex-start"},intro:{minWidth:280,flex:"1 1 0%"},title:{fontSize:30,fontWeight:700,lineHeight:"38px",color:"#6D35F2",margin:0},description:{marginTop:8,fontSize:19,lineHeight:"28px",color:"#1F2937"},debugLink:{marginTop:12,display:"inline-flex",alignItems:"center",gap:8,fontSize:14,fontWeight:500,color:"#53657D",background:"none",border:"none",padding:0,cursor:"pointer"},addButton:{display:"inline-flex",height:44,minWidth:210,flexShrink:0,alignItems:"center",justifyContent:"center",gap:12,borderRadius:6,background:"#4438F5",padding:"0 20px",fontSize:15,fontWeight:600,color:"#ffffff",border:"none",boxShadow:"0 1px 2px rgba(16,24,40,0.08)",cursor:"pointer",marginLeft:"auto"},bodySection:{marginTop:48,display:"grid",width:"100%",gridTemplateColumns:"minmax(0,1fr) minmax(300px,360px)",alignItems:"start",gap:24},librarySection:{minWidth:0},libraryTabs:{display:"flex",borderBottom:"1px solid #EAECF0"},tab:{position:"relative",display:"inline-flex",height:40,alignItems:"center",gap:8,padding:"0 16px",fontSize:14,fontWeight:500,background:"none",border:"none",cursor:"pointer",color:"#B5BDC8"},tabActive:{color:"#1F2937",boxShadow:"inset 0 -3px 0 0 #6D5BFF"},libraryGrid:{marginTop:24,display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:20},showMore:{marginTop:28,display:"inline-flex",alignItems:"center",gap:8,fontSize:14,fontWeight:600,color:"#5B2CF4",background:"none",border:"none",cursor:"pointer"},loadingState:{marginTop:24,fontSize:14,color:"#667085"},errorState:{marginTop:24,fontSize:14,color:"#F04438"}};export{e as default};
|
|
2
|
+
//# sourceMappingURL=GuidelinesLandingPage.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GuidelinesLandingPage.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as i,jsxs as a}from"react/jsx-runtime";import{ArrowLeft as t}from"lucide-react";import{QueryClient as r,QueryClientProvider as n}from"@tanstack/react-query";import o from"../LearningManagement/LearningManagement.js";var l={config:{CUSTOM_SCOPE_GROUP_NAME:"Preview",INSTANT_LEARNING_TYPE:"iL",MODEL:"claude-3.5-sonnet",CONFIG_MASTER_NAME:"preview-config",SCOPE_NAME:"Custom",ASSISTANT_NAME:"preview",ORGANIZATION_NAME:"techolution",BASE_URL:"https://devllmstudio.creativeworkspace.ai",BASE_WEBSOCKET_URL:"wss://devllmstudio.creativeworkspace.ai/graphql",CHAT_TITLE:"Preview",CHAT_TITLE_EDIT:"Preview Edit",FORM_TITLE:"Learning Details",INITIAL_CHAT_MESSAGE:"Hi",CATEGORY:"Global-Template",SOCKET_TIMEOUT:24e4},llmStudioUrl:"https://devllmstudio.creativeworkspace.ai",audacyBackendUrl:"https://dev-audacy-traffic-manager.techo.camp",auditLogConfig:{configId:"6a1825e9fb722c37637b9490"},ilLabels:{setupLabel:"Learning Setup",ruleTitle:"Learning Title",ruleDescriptionTitle:"Learning Description"},rbacConfig:{applicationName:"IL Mode - ILOTJ",applicationId:"6a22c19581f05dc3afc8ad57",moduleId:"6a22c19581f05dc3afc8ad8e",applicationModuleId:"6a22c19581f05dc3afc8ad88",applicationResourceId:"6a22c19681f05dc3afc8ad94",appsecRbacUrl:"https://dev-cw-appsec.techo.camp/granularApi",appsecBaseUrl:"https://dev-cw-appsec.techo.camp"}},c=new r,d={wrapper:{display:"flex",flexDirection:"column",height:"100%",minHeight:0},header:{display:"flex",alignItems:"center",gap:12,padding:"10px 0",borderBottom:"1px solid #EAECF0",flexShrink:0},backButton:{display:"inline-flex",alignItems:"center",gap:6,background:"none",border:"none",cursor:"pointer",fontSize:14,fontWeight:500,color:"#344054",padding:"4px 8px",borderRadius:6},headerTitle:{fontSize:14,fontWeight:600,color:"#1F2937",margin:0,flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},headerActions:{display:"flex",alignItems:"center",gap:8,marginLeft:"auto"},lmsContainer:{flex:1,minHeight:0,overflow:"hidden"}};function p(r){var p=r.userDetails,s=r.appIntegrationId,f=r.modeId,m=r.guidelineTitle,g=r.onBack,u=r.headerActions;return i(n,e({client:c},{children:a("div",e({style:d.wrapper},{children:[a("div",e({style:d.header},{children:[a("button",e({type:"button",style:d.backButton,onClick:g},{children:[i(t,{size:16,strokeWidth:2}),"Back"]})),m&&i("p",e({style:d.headerTitle},{children:m})),u&&i("div",e({style:d.headerActions},{children:u}))]})),i("div",e({style:d.lmsContainer},{children:i(o,e({},l,{userDetails:p,app_integration_id:s,modeId:f}),"lms-explore")}))]}))}))}export{p as LearningManagementWrapper,p as default};
|
|
2
|
+
//# sourceMappingURL=LearningManagementWrapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LearningManagementWrapper.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{__awaiter as t,__generator as n}from"tslib";import{endpoints as e}from"./endpoints.js";function i(i,o){return t(this,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return[4,fetch(e.listInstances(i),{headers:{accept:"application/json, text/plain, */*",authorization:"Bearer ".concat(o)}})];case 1:if(!(t=n.sent()).ok)throw new Error("Failed to fetch guidelines: ".concat(t.status));return[2,t.json()]}})})}export{i as fetchGuidelineInstances};
|
|
2
|
+
//# sourceMappingURL=api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"endpoints.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsxs as
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as o,jsx as t}from"react/jsx-runtime";import{useState as i,useMemo as n,useEffect as a}from"react";import{AuditLog as r}from"@e-llm-studio/audit-log";import"@e-llm-studio/audit-log/dist/styles.css";import{getAxiosConfig as l}from"../../../api/transport.js";import{User as c,ExternalLink as s}from"lucide-react";import d from"./ChangeLogDiff.js";import{dt as p}from"../store/useLMSConfigStore.js";import h from"../RBAC/AccessPanel.module.css.js";import{usePermissionsStore as g}from"../store/usePermissionsStore.js";import u from"../store/useEnvStore.js";import{useConfigStore as m}from"../store/useConfigStore.js";var f=function(f){var b=f.configId,y=f.ruleData,x=f.scopeId,v=f.scopeName,w=(null==v?void 0:v.trim())||"Selected",C=i("scope"),S=C[0],T=C[1];m.getState().configuration;var L=g(function(e){return e.hasPermission}),A=u(function(e){var o;return(null===(o=e.rbacConfig)||void 0===o?void 0:o.applicationResourceId)||""}),k=Boolean(x&&L("ilotj.scope.changeLog.view",x)),D=Boolean(A&&L("ilotj.application.changeLog.view",A)),I=n(function(){var e=[];return x&&e.push(x),e},[y,x]);a(function(){console.log("Flattened External Resource IDs:",I)},[I]);var j={configId:b,axiosConfig:l(),getData:{baseUrl:window.location.origin.includes("local")?"https://dev.appmod.ai":window.location.origin,endpoint:"/changelog/audit-log/fetch"},distinctValuesApi:{baseUrl:window.location.origin.includes("local")?"https://dev.appmod.ai":window.location.origin,endpoint:"/changelog/audit-log/distinct-values"},sidebar:{config:{showAnalystFilter:!0,showDateFilter:!0,showChangeTitleFilter:!0,showImpactPercentage:!1},labels:{title:"Filters",multiSelectLabel:"Modified By",multiSelectHint:"Filter by the user who made the change",changeTitleLabel:"Change Action",changeTitleHint:"Filter by Actions"}},table:{tableProps:{scrollable:!0,scrollHeight:"80vh",showGridlines:!0,size:"small",rowClassName:function(){return"custom-compact-row"},pt:{bodyCell:{style:{paddingTop:"4px",paddingBottom:"4px"}}}},hiddenColumns:["actions","changeSummary","changeDateTime","logId"],extraColumns:[{key:"modifiedBy",header:"Modified By",body:function(i){return o("div",e({style:{display:"flex",alignItems:"center",gap:"8px"}},{children:[t(c,{size:16,color:"#64748b",style:{flexShrink:0}}),t("span",e({style:{fontWeight:500}},{children:i.modifiedBy}))]}))},style:{width:"15%",minWidth:"140px"}},{key:"changeAction",header:"Action",body:function(o){var i,n,a=(i=o.changeTitle,(n=(i||"").toUpperCase()).includes("CREATE")?{color:"#2e7d32",backgroundColor:"#edf7ed",borderColor:"#c8e6c9",boxShadow:"0 1px 2px rgba(46, 125, 50, 0.08)"}:n.includes("UPDATE")||n.includes("TOGGLE")?{color:"#1565c0",backgroundColor:"#e3f2fd",borderColor:"#bbdefb",boxShadow:"0 1px 2px rgba(21, 101, 192, 0.08)"}:n.includes("DELETE")?{color:"#c62828",backgroundColor:"#fdeeed",borderColor:"#ffcdd2",boxShadow:"0 1px 2px rgba(198, 40, 40, 0.08)"}:{color:"#475569",backgroundColor:"#f8fafc",borderColor:"#cbd5e1",boxShadow:"0 1px 2px rgba(15, 23, 42, 0.06)"}),r=o.changeTitle?o.changeTitle.replace(/_/g," "):"—";return t("span",e({style:{color:a.color,backgroundColor:a.backgroundColor,border:"1px solid ".concat(a.borderColor),boxShadow:a.boxShadow,padding:"6px 12px",borderRadius:"999px",fontSize:"12px",lineHeight:1,fontWeight:600,display:"inline-block",minWidth:"76px",textAlign:"center",textTransform:"capitalize"}},{children:r}))},style:{width:"15%",textAlign:"center"}},{key:"customChangeSummary",header:"Change Summary",body:function(e){var o;return t(d,{change:null!==(o=e.actionText)&&void 0!==o?o:"-"})},style:{width:"30%",minWidth:"200px"}},{key:"redirectLink",header:"Link",body:function(i){var n,a=(null===(n=i.metadata)||void 0===n?void 0:n.redirect_url)||i.redirect_url;return a?t("div",e({style:{display:"flex",justifyContent:"center",alignItems:"center"}},{children:o("a",e({href:a,target:"_blank",rel:"noopener noreferrer",style:{display:"flex",alignItems:"center",gap:"6px",color:"#2563eb",textDecoration:"none",fontWeight:500,fontSize:"13px"}},{children:["View ",t(s,{size:14})]}))})):t("span",e({style:{color:"#94a3b8",display:"flex",justifyContent:"center"}},{children:"—"}))},style:{width:"10%",minWidth:"90px",textAlign:"center"}},{key:"customChangeDateTime",header:"Change Time and Date",body:function(i){if(!i.actionDate)return t("span",e({style:{color:"#94a3b8"}},{children:"—"}));var n=new Date(i.actionDate),a=n.toLocaleDateString("en-US",{month:"short",day:"2-digit",year:"numeric"}),r=n.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"});return o("div",e({style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"4px",fontSize:"13px",color:"#475569"}},{children:[t("span",e({style:{fontWeight:500}},{children:a})),t("span",{children:r})]}))},style:{width:"15%",minWidth:"150px",textAlign:"center"}}]},filters:{config:{showFilterButton:!0,showSort:!0,showDate:!0,showSearch:!0,sortOptions:{latest:!0,oldest:!0,impactHighToLow:!1,impactLowToHigh:!1}}}};return t("div",e({style:{height:"100%",overflowY:"auto"}},{children:o("div",e({style:{padding:"24px",fontFamily:"Arial, sans-serif"}},{children:[o("div",e({style:{marginBottom:"16px",paddingBottom:"4px"}},{children:[t("h1",e({style:{margin:0,color:"#334155",fontSize:"20px",fontWeight:700,lineHeight:1.25}},{children:p("history.title","".concat(w," - Audit Log"),{scope_name:w})})),t("p",e({style:{margin:"8px 0 0",color:"#667085",fontSize:"16px",fontWeight:500,lineHeight:1}},{children:p("history.subtitle","Track all learning updates and modifications with the ".concat(w," scope."),{scope_name:w})}))]})),o("div",e({className:h.accessTabs,role:"tablist","aria-label":"Audit log level"},{children:[t("button",e({type:"button",role:"tab","aria-selected":"scope"===S,className:"".concat(h.accessTab," ").concat("scope"===S?h.accessTabActive:""),onClick:function(){return T("scope")},disabled:!k,title:k?"":"You do not have permission to view scope level change log"},{children:p("history.scopeLevel","Scope Level")})),t("button",e({type:"button",role:"tab","aria-selected":"application"===S,className:"".concat(h.accessTab," ").concat("application"===S?h.accessTabActive:""),onClick:function(){return T("application")},disabled:!D,title:D?"":"You do not have permission to view application level change log"},{children:p("history.applicationLevel","Application Level")}))]})),"scope"===S?t(r,e({},j,{query:{externalResourceId:I.length>0?I:[""],paginationLimit:10}}),"scope-audit-log"):t(r,e({},j,{query:{externalResourceId:[],paginationLimit:10}}),"application-audit-log")]}))}))};export{f as default};
|
|
2
2
|
//# sourceMappingURL=AuditLog.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__spreadArray as e,__assign as t,__awaiter as n,__generator as r}from"tslib";import{jsx as o,jsxs as s,Fragment as i}from"react/jsx-runtime";import{useState as a,useRef as l,useEffect as c}from"react";import{BookOpen as u,Users as d,History as p}from"lucide-react";import{useLearningTemplateStore as m}from"./store/useLearningTemplateStore.js";import{Toast as f}from"primereact/toast";import v from"./styles/LearningTemplateManagement.module.css.js";import g from"./LearningTemplateLayout.js";import h from"./components/EmptyLearningState.js";import y from"./store/useAuthStore.js";import{fetchTiers as S,fetchScopes as b,inheritScope as C,inheritScopeBackwardCompatible as T,createRuleSet as E,renameScope as I,deleteRuleSet as L,requestAccess as A}from"./apis/scopeApis.js";import{QUERY_PARAM_KEYS as O,setQueryParams as w}from"./hooks/useLearningTemplateQueryParams.js";import R from"./components/ConfirmationModal.js";import j from"./components/LearningTemplateManagementSkeleton.js";import{findNodePathById as N}from"./utils/treeUtils.js";import D from"./store/useEnvStore.js";import{useConfigStore as _}from"./store/useConfigStore.js";import{TooltipProvider as k}from"./components/ToolTip.js";import P from"./components/CreateRuleSetLegacyModal.js";import{usePermissionsStore as U}from"./store/usePermissionsStore.js";import{useAppSecRolesStore as G}from"./store/useAppSecRolesStore.js";import{useGetAppSecRolesQuery as M}from"./queries/useApprovalQueries.js";import B from"./RuleContent/AddScopeModal.js";import{useLocation as F}from"react-router-dom";import q from"./shared/SuccessToastContent.js";import x from"./shared/ErrorToastContent.js";import H from"./RuleContent/RenameScopeModal.js";var Q=[{id:"learnings",label:"Learnings",icon:u,badgeKey:"learningsCount"},{id:"access",label:"Access",icon:d},{id:"history",label:"Change History",icon:p}],z=new Set(Q.map(function(e){return e.id}));function K(u){var d,p,K,V=this,W=u.userDetails,Y=u.llmStudioUrl,J=u.audacyBackendUrl,X=u.ilLabels,Z=u.config,$=u.rbacConfig,ee=u.auditLogConfig,te=u.app_integration_id,ne=u.backwardCompatibility,re=void 0!==ne&&ne,oe=m(function(e){return e.selectedRuleSetId}),se=m(function(e){return e.setSelectedRuleSetId}),ie=m(function(e){return e.error}),ae=m(function(e){return e.setError}),le=m(function(e){return e.setStations}),ce=m(function(e){return e.scopeTreeData}),ue=m(function(e){return e.setScopeTreeData}),de=a({isOpen:!1,type:"GLOBAL"}),pe=de[0],me=de[1],fe=a(!1),ve=fe[0],ge=fe[1],he=a(!1),ye=he[0],Se=he[1],be=a("learnings"),Ce=be[0],Te=be[1],Ee=a(null),Ie=Ee[0],Le=Ee[1],Ae=a(null),Oe=Ae[0],we=Ae[1],Re=l(null),je=l(null),Ne=l(!1),De=l(null),_e=y();_e.user;var ke=_e.setUser,Pe=_(),Ue=Pe.setConfig,Ge=Pe.setIlLabels,Me=e([{type:"GLOBAL",label:"Global",addChildLabel:"Add Scope",addChildType:"SCOPE"},t({type:"SCOPE",label:"Scope"},!re&&{addChildLabel:"Add Subscope",addChildType:"SUBSCOPE"})],re?[]:[{type:"SUBSCOPE",label:"Subscope"}],!0),Be=function(){try{return F()}catch(e){return{search:""}}}();c(function(){if(!Ne.current){var e=new URLSearchParams(window.location.search),t=e.get(O.RULESET_ID),n=e.get(O.SECTION),r=n&&z.has(n)?n:"learnings";(null==t?void 0:t.length)&&se&&Te&&(se(t),Te(r),Ne.current=!0)}},[null==Be?void 0:Be.search,Te,se]);var Fe=U(function(e){return e.fetchPermissions}),qe=U(function(e){return e.hasPermission}),xe=G(function(e){return e.setRoles}),He=D(function(e){return e.appsecRbacUrl})===$.appsecRbacUrl,Qe=M($.applicationId,He).data;c(function(){Qe&&xe(Qe.map(function(e){return{_id:e._id,name:e.name}}))},[Qe,xe]),c(function(){var e;console.log("userDetails",W),ke(W),console.log("llmStudioUrl",Y),console.log("audacyBackendUrl",J),D.getState().setLlmStudioUrl(Y),D.getState().setAudacyBackendUrl(J),D.getState().setRbacConfig($),D.getState().setAuditLogConfig(ee),Ue(Z),Ge(X),m.getState().setAppIntegrationId(null!=te?te:null),m.getState().setBackwardCompatibility(re),m.getState().setToken(null!==(e=null==W?void 0:W.accessToken)&&void 0!==e?e:null)},[W,ke,Y,J,$,ee,Z,Ue,X,Ge,te,re]),c(function(){(null==W?void 0:W.accessToken)&&Y&&S()},[te,null==W?void 0:W.accessToken,Y]);var ze=function(e){return void 0===e&&(e=!0),n(V,void 0,void 0,function(){var n,o,s,i,a,l;return r(this,function(r){switch(r.label){case 0:e&&ge(!0),ae(null),r.label=1;case 1:return r.trys.push([1,4,5,6]),[4,Fe($.applicationId)];case 2:return r.sent(),n=function(e){if(!U.getState().hasPermission("ilotj.scope.view",e.id))return null;var r=e.children?e.children.map(function(e){return n(e)}).filter(function(e){return null!==e}):[];return t(t({},e),{children:r})},[4,b(te,W.accessToken)];case 3:return(o=r.sent())&&o.data&&o.data.data&&(s=o.data.data,Array.isArray(s)&&(s=s.length>0?s[0]:null),s?(i=n(s))?(Le(null),ue({data:i}),je.current?(se(je.current),Te("learnings"),je.current=null):m.getState().selectedRuleSetId||se(i.id)):(Le(null!==(l=s.id)&&void 0!==l?l:null),ue(null)):(Le(null),ue(null))),[3,6];case 4:return a=r.sent(),console.error("Failed to fetch rule sets or permissions",a),ae("Failed to load data. Please try again later."),[3,6];case 5:return ge(!1),[7];case 6:return[2]}})})};c(function(){var e;(null===(e=null==W?void 0:W.accessToken)||void 0===e?void 0:e.length)&&He?ze(!0):console.warn("Error: Trying to fetch rules without access token",W)},[null==W?void 0:W.accessToken,ae,le,$.applicationId,He]);var Ke=function(e,o,s){return n(V,void 0,void 0,function(){var n,o,s,i,a,l,c,u;return r(this,function(r){switch(r.label){case 0:Se(!0),r.label=1;case 1:return r.trys.push([1,4,5,6]),[4,L(e,W.accessToken)];case 2:return r.sent(),m.getState().selectedRuleSetId===e&&(n=m.getState().scopeTreeData,(o=N((null==n?void 0:n.data)||null,e))&&o.length>1&&(s=o[o.length-2],se(s),Te("learnings"))),[4,ze(!0)];case 3:return r.sent(),me(function(e){return t(t({},e),{isOpen:!1})}),null===(a=De.current)||void 0===a||a.show({severity:"success",summary:"Deleted Successfully",detail:"The scope was permanently removed."}),[3,6];case 4:return i=r.sent(),console.error("An error occurred during scope deletion.",i),null===(l=De.current)||void 0===l||l.show({severity:"error",summary:"Delete Failed",detail:(null===(u=null===(c=null==i?void 0:i.response)||void 0===c?void 0:c.data)||void 0===u?void 0:u.message)||"There was an error deleting the scope. Please try again."}),[3,6];case 5:return Se(!1),[7];case 6:return[2]}})})},Ve=ce,We=Oe?{data:{id:Oe.stationId,name:Oe.stationName,type:"STATION",metrics:{learningsCount:Oe.learningsCount,stationsCount:0},children:[]}}:Ve,Ye=!!(null==We?void 0:We.data);null===(d=null==We?void 0:We.data)||void 0===d||d.type;var Je=U(function(e){return e.hasGlobalPermission})("ilotj.scope.global.create",$.applicationResourceId||""),Xe=Oe?Q.filter(function(e){return"stations"!==e.id}):Q;return o(k,{children:s("div",t({className:v.learningManagementContainer},{children:[o("div",t({className:v.mainWrapper},{children:ve?o(j,{}):ie?s("div",t({className:v.errorContainer},{children:[o("div",t({className:v.errorTitle},{children:"Error Loading Data"})),o("p",t({className:v.errorDesc},{children:ie})),o("button",t({onClick:function(){return ze(!0)},className:v.tryAgainBtn},{children:"Try Again"}))]})):Ye?o(g,{onOpenCreateModal:function(){return me({isOpen:!0,type:"GLOBAL"})},onAddChild:function(e,t,n){return me({isOpen:!0,type:t,parentId:e,parentName:n})},onRenameChild:function(e,t){return me({isOpen:!0,type:"RENAME",scopeId:e,initialName:t})},onDeleteChild:function(e,t,o){return n(V,void 0,void 0,function(){var n,s,i;return r(this,function(r){switch(r.label){case 0:return n=m.getState().scopeTreeData,s=N((null==n?void 0:n.data)||null,e),i=!!s&&3===s.length,0!==o?[3,2]:[4,Ke(e)];case 1:return r.sent(),[3,3];case 2:me({isOpen:!0,type:"DELETE",scopeId:e,initialName:t,isSubscope:i}),r.label=3;case 3:return[2]}})})},canDeleteScope:function(e){return qe("ilotj.scope.delete",e)},canEditScope:function(e){return qe("ilotj.scope.edit",e)},canCreateScope:function(e){return qe("ilotj.scope.create",e)},onSectionSelect:function(e,t){var n;console.log("Section Selected:",{scopeId:e,sectionId:t}),w(((n={})[O.SECTION]="learnings"===t?null:t,n[O.RULESET_ID]=e,n)),Te(t),se(e)},activeSectionId:Ce,scopeTreeData:We,sectionsConfig:Xe,onViewStation:function(e){Re.current=oe,we(e),Te("learnings"),se(e.stationId)},onRefreshRuleSets:function(e,t){void 0===e&&(e=!0),t&&(je.current=t),ze(e)},nodeTypesConfig:Me,app_integration_id:te,token:W.accessToken}):o(h,{onCreate:function(){return me({isOpen:!0,type:"GLOBAL"})},title:"No Global Scope has been added!",desc:"Start by creating a Global scope to define base learnings that apply across all stations.",button:"Create Global Scope",canCreateRule:Je,noAccessTitle:"Access Restricted",noAccessDesc:"You do not have access to create a Global scope for this application.",onRequestAccess:function(){return n(V,void 0,void 0,function(){var e,t,n,s,i,a,l,c,u;return r(this,function(r){switch(r.label){case 0:if(!(e=(null===(s=null===(n=m.getState().scopeTreeData)||void 0===n?void 0:n.data)||void 0===s?void 0:s.id)||Ie))return null===(i=De.current)||void 0===i||i.show({severity:"error",sticky:!1,className:v.errorToast,content:o(x,{message:"Unable to identify the global scope for this access request."})}),[2];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,A(e)];case 2:return r.sent(),null===(a=De.current)||void 0===a||a.show({severity:"success",sticky:!1,life:3e3,className:v.successToast,content:o(q,{message:"Access request submitted successfully!"})}),[3,4];case 3:return t=r.sent(),null===(l=De.current)||void 0===l||l.show({severity:"error",sticky:!1,className:v.errorToast,content:o(x,{message:(null===(u=null===(c=null==t?void 0:t.response)||void 0===c?void 0:c.data)||void 0===u?void 0:u.detail)||"Failed to request access. Please try again."})}),[3,4];case 4:return[2]}})})}})})),o(f,{ref:De,pt:{root:{style:{zIndex:9999}}}}),re&&pe.isOpen&&"DELETE"!==pe.type&&"RENAME"!==pe.type?o(P,{isOpen:!0,onClose:function(){return me(t(t({},pe),{isOpen:!1}))},onSubmit:function(e){return n(V,void 0,void 0,function(){var n,o,s,i,a,l,c,u,d,p,f,v,g,h,y,S,b,I,L,A;return r(this,function(r){switch(r.label){case 0:Se(!0),n=m.getState().backwardCompatibility,r.label=1;case 1:return r.trys.push([1,12,13,14]),o=void 0,n&&"object"==typeof e?o=e:(s=e,i="SCOPE"===pe.type&&pe.parentId,a=i?"genreRuleSet":pe.type,o={topic:a,scope_reference_id:null,scopeDescription:"demo",parentScopeId:pe.parentId||null,scopeName:s,scopeReferenceMetadata:{},applicationMappingId:te}),[4,E(o,W.accessToken)];case 2:if(l=r.sent(),!(c=null===(h=null==l?void 0:l.data)||void 0===h?void 0:h.scopeId))return[3,10];if(je.current=c,u=n&&(null===(y=o.topic)||void 0===y?void 0:y.toLowerCase().includes("genre")),d=!n&&"GLOBAL"!==pe.type&&pe.parentId,!u&&!d)return[3,10];if(!(p=n?null===(b=null===(S=m.getState().scopeTreeData)||void 0===S?void 0:S.data)||void 0===b?void 0:b.id:pe.parentId))return[3,10];if(!re)return[3,7];r.label=3;case 3:return r.trys.push([3,5,,6]),[4,T({source_scope_id:p,target_scope_id:c})];case 4:return r.sent(),[3,6];case 5:return f=r.sent(),console.error("Failed to inherit rules for the new scope:",f),[3,6];case 6:return[3,10];case 7:return r.trys.push([7,9,,10]),[4,C({source_scope_id:p,target_scope_id:c,application_mapping_id:te||"",is_copy_parent_variant_id:!1})];case 8:return r.sent(),[3,10];case 9:return v=r.sent(),console.error("Failed to inherit rules for the new scope:",v),[3,10];case 10:return[4,ze(!0)];case 11:return r.sent(),me(function(e){return t(t({},e),{isOpen:!1})}),[3,14];case 12:throw g=r.sent(),console.error("An error occurred during scope creation.",g),null===(I=De.current)||void 0===I||I.show({severity:"error",summary:"Creation Failed",detail:(null===(A=null===(L=null==g?void 0:g.response)||void 0===L?void 0:L.data)||void 0===A?void 0:A.message)||"There was an error creating the scope. Please try again."}),g;case 13:return Se(!1),[7];case 14:return[2]}})})},hasGlobalRuleSet:Ye,canCreateGlobal:Je,globalScopeId:null!==(K=null===(p=null==ce?void 0:ce.data)||void 0===p?void 0:p.id)&&void 0!==K?K:null}):s(i,{children:[o(B,{isOpen:pe.isOpen&&"DELETE"!==pe.type&&"RENAME"!==pe.type,onClose:function(){return me(t(t({},pe),{isOpen:!1}))},onCreate:function(e){e&&(je.current=e),ze(!0)},hasGlobalRuleSet:Ye,parentId:pe.parentId}),o(H,{isOpen:pe.isOpen&&"RENAME"===pe.type,onClose:function(){return me(t(t({},pe),{isOpen:!1}))},onSave:function(e){return n(V,void 0,void 0,function(){var n,s,i,a;return r(this,function(r){switch(r.label){case 0:Se(!0),r.label=1;case 1:return r.trys.push([1,4,5,6]),pe.scopeId?[4,I({scope_id:pe.scopeId,scope_name:e})]:[2];case 2:return r.sent(),[4,ze(!0)];case 3:return r.sent(),me(function(e){return t(t({},e),{isOpen:!1})}),[3,6];case 4:throw n=r.sent(),console.error("An error occurred during scope rename.",n),null===(s=De.current)||void 0===s||s.show({severity:"error",sticky:!1,className:v.errorToast,content:o(x,{message:(null===(a=null===(i=null==n?void 0:n.response)||void 0===i?void 0:i.data)||void 0===a?void 0:a.message)||"There was an error renaming the scope. Please try again."})}),n;case 5:return Se(!1),[7];case 6:return[2]}})})},initialName:pe.initialName})]}),o(R,{isOpen:pe.isOpen&&"DELETE"===pe.type,onCancel:function(){return me(t(t({},pe),{isOpen:!1}))},onConfirm:function(){return Ke(pe.scopeId,pe.initialName,pe.isSubscope)},title:"Delete Scope",description:s(i,{children:["Deleting ",o("span",t({className:v.highlight},{children:pe.initialName||"this scope"}))," will permanently remove all Learnings, Access rules, and Change History inside it. This cannot be undone."]}),confirmText:"Delete",confirmBgColor:"#EF4444",isLoading:ye})]}))})}export{K as default};
|
|
1
|
+
import{__assign as e,__spreadArray as n,__awaiter as t,__generator as r}from"tslib";import{jsx as o,jsxs as s,Fragment as a}from"react/jsx-runtime";import{useState as i,useRef as c,useCallback as l,useEffect as u}from"react";import{applyAxiosConfig as d}from"../../api/transport.js";import{BookOpen as p,Users as m,History as f}from"lucide-react";import{useLearningTemplateStore as v}from"./store/useLearningTemplateStore.js";import{Toast as g}from"primereact/toast";import h from"./styles/LearningTemplateManagement.module.css.js";import S from"./LearningTemplateLayout.js";import y from"./components/EmptyLearningState.js";import b from"./store/useAuthStore.js";import{fetchTiers as C,getILInstance as T,fetchScopes as I,inheritScope as L,inheritScopeBackwardCompatible as A,createRuleSet as E,renameScope as R,deleteRuleSet as w,requestAccess as O}from"./apis/scopeApis.js";import{useRuleTemplateQueryParams as j,setQueryParams as N,QUERY_PARAM_KEYS as _}from"./hooks/useLearningTemplateQueryParams.js";import D from"./components/ConfirmationModal.js";import k from"./components/LearningTemplateManagementSkeleton.js";import{findNodePathById as M,findNodeById as P}from"./utils/treeUtils.js";import U from"./store/useEnvStore.js";import{useConfigStore as B}from"./store/useConfigStore.js";import{TooltipProvider as q}from"./components/ToolTip.js";import G from"./components/CreateRuleSetLegacyModal.js";import{usePermissionsStore as F}from"./store/usePermissionsStore.js";import{useAppSecRolesStore as x}from"./store/useAppSecRolesStore.js";import{useGetAppSecRolesQuery as H}from"./queries/useApprovalQueries.js";import{useLMSConfigQuery as Q}from"./queries/useLMSConfigQuery.js";import z from"./RuleContent/AddScopeModal.js";import K from"./components/RuleContentSkeleton.js";import V from"./components/ErrorStateDisplay.js";import{useLocation as W,useSearchParams as Y}from"react-router-dom";import J from"./shared/SuccessToastContent.js";import X from"./shared/ErrorToastContent.js";import Z from"./RuleContent/RenameScopeModal.js";import{dt as $,useLMSConfigStore as ee}from"./store/useLMSConfigStore.js";import{MIDDLE_DRAWER_DT_PATH as ne,MIDDLE_DRAWER_CONTEXT_MENU_DT_PATH as te,EMPTY_STATE_DT_PATH as re}from"./constants.js";function oe(oe){var se,ae,ie,ce=this,le=oe.userDetails,ue=oe.llmStudioUrl,de=oe.audacyBackendUrl,pe=oe.ilLabels,me=oe.config,fe=oe.rbacConfig,ve=oe.auditLogConfig,ge=oe.app_integration_id,he=oe.backwardCompatibility,Se=void 0!==he&&he,ye=oe.cognitiveCompareCompatibility,be=void 0!==ye&&ye,Ce=oe.modeId,Te=oe.modeDetails,Ie=oe.pluginPayload,Le=oe.axiosConfig;d(Le);var Ae=[{id:"learnings",label:$("".concat(ne,".treeMenu.submenu.learnings"),"Learnings"),icon:p,badgeKey:"learningsCount"},{id:"access",label:$("".concat(ne,".treeMenu.submenu.access"),"Access"),icon:m},{id:"history",label:$("".concat(ne,".treeMenu.submenu.changeHistory"),"Change History"),icon:f}],Ee=new Set(Ae.map(function(e){return e.id})),Re=j().clearLearningParams,we=v(function(e){return e.selectedRuleSetId}),Oe=v(function(e){return e.setSelectedRuleSetId}),je=v(function(e){return e.setIlInstanceId}),Ne=v(function(e){return e.error}),_e=v(function(e){return e.setError}),De=v(function(e){return e.setStations}),ke=v(function(e){return e.scopeTreeData}),Me=v(function(e){return e.setScopeTreeData}),Pe=i({isOpen:!1,type:"GLOBAL"}),Ue=Pe[0],Be=Pe[1],qe=i(!1),Ge=qe[0],Fe=qe[1],xe=i(!1),He=xe[0],Qe=xe[1],ze=i("learnings"),Ke=ze[0],Ve=ze[1],We=i(null),Ye=We[0],Je=We[1],Xe=i(!1),Ze=Xe[0],$e=Xe[1],en=i(null),nn=en[0];en[1];var tn=i(!1),rn=tn[0],on=tn[1],sn=i(!1),an=sn[0],cn=sn[1];c(null);var ln=c(null),un=c(!1),dn=c(null),pn=b();pn.user;var mn=pn.setUser,fn=B(),vn=fn.setConfig,gn=fn.setIlLabels,hn=function(){try{return W()}catch(e){return{search:""}}}(),Sn=function(){try{return Y()[1]}catch(e){return null}}(),yn=l(function(e){if(Sn){var n=new URLSearchParams(window.location.search);Object.entries(e).forEach(function(e){var t=e[0],r=e[1];null==r||""===r?n.delete(t):n.set(t,r)}),Sn(n,{replace:!0})}else N(e)},[Sn]);u(function(){if(!un.current){var e=new URLSearchParams(window.location.search),n=e.get(_.RULESET_ID),t=e.get(_.SECTION),r=t&&(null==Ee?void 0:Ee.has(t))?t:"learnings";(null==n?void 0:n.length)&&Oe&&Ve&&(Oe(n),Ve(r),un.current=!0)}},[null==hn?void 0:hn.search,Ve,Oe]),u(function(){return function(){Re()}},[Re]),u(function(){var e;we&&yn(((e={})[_.RULESET_ID]=we,e))},[we,yn]),u(function(){var n;(null==Ie?void 0:Ie.learningManagement)&&ee.getState().setLMSConfig(e(e({},Ie.learningManagement),{agents:null!==(n=Ie.agents)&&void 0!==n?n:{}}))},[Ie]);var bn=F(function(e){return e.fetchPermissions}),Cn=F(function(e){return e.hasPermission}),Tn=x(function(e){return e.setRoles}),In=U(function(e){return e.appsecRbacUrl})===fe.appsecRbacUrl,Ln=H(fe.applicationId,In).data,An=Q(null!=ge?ge:"",Se),En=An.isLoading,Rn=An.isError,wn=An.refetch;An.isSuccess;var On=i(0),jn=On[0],Nn=On[1];u(function(){if(!Se&&ge&&ue){t(ce,void 0,void 0,function(){var e,n,t,o,s,a,i;return r(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,T(ge)];case 1:return e=r.sent(),(null===(o=null==e?void 0:e.data)||void 0===o?void 0:o.ILInstanceId)&&je(e.data.ILInstanceId),"number"==typeof(n=null===(i=null===(a=null===(s=null==e?void 0:e.data)||void 0===s?void 0:s.learningManagement)||void 0===a?void 0:a.scopeAndHierarchy)||void 0===i?void 0:i.maxHierarchyLevels)&&n>0&&Nn(n-1),[3,3];case 2:return t=r.sent(),console.error("Failed to fetch IL instance for hierarchy levels:",t),[3,3];case 3:return[2]}})})}},[ge,ue]),u(function(){Ln&&Tn(Ln.map(function(e){return{_id:e._id,name:e.name}}))},[Ln,Tn]),u(function(){var e;console.log("userDetails",le),mn(le),console.log("llmStudioUrl",ue),console.log("audacyBackendUrl",de),U.getState().setLlmStudioUrl(ue),U.getState().setAudacyBackendUrl(de),U.getState().setRbacConfig(fe),U.getState().setAuditLogConfig(ve),U.getState().setBaseModeName((null==Te?void 0:Te.modeNameFromURL)||null),vn(me),gn(pe),v.getState().setAppIntegrationId(null!=ge?ge:null),v.getState().setBackwardCompatibility(Se),v.getState().setCognitiveCompareCompatibility(null!=be&&be),v.getState().setToken(null!==(e=null==le?void 0:le.accessToken)&&void 0!==e?e:null)},[le,mn,ue,de,fe,ve,me,vn,pe,gn,ge,Se,be,Te]),u(function(){(null==le?void 0:le.accessToken)&&ue&&C()},[ge,null==le?void 0:le.accessToken,ue]);var _n=function(n){return void 0===n&&(n=!0),t(ce,void 0,void 0,function(){var t,o,s,a,i,c,l,u,d,p,m,f;return r(this,function(r){switch(r.label){case 0:n&&Fe(!0),_e(null),r.label=1;case 1:return r.trys.push([1,7,8,9]),[4,bn(fe.applicationId)];case 2:r.sent(),t=function(n){var r=F.getState().hasPermission("ilotj.scope.view",n.id),o=n.children?n.children.map(function(e){return t(e)}).filter(function(e){return null!==e}):[];return r||0!==o.length?e(e({},n),{hasAccess:r,children:o}):null},o=void 0,r.label=3;case 3:return r.trys.push([3,5,,6]),[4,I(ge,le.accessToken)];case 4:return o=r.sent(),[3,6];case 5:if(s=r.sent(),403===(null===(m=null==s?void 0:s.response)||void 0===m?void 0:m.status))return Me(null),Je(fe.applicationResourceId||null),$e(!0),[2];throw s;case 6:return o&&o.data&&o.data.data&&(a=o.data.data,Array.isArray(a)&&(a=a.length>0?a[0]:null),a?(i=t(a))?(Je(null),$e(!1),Me({data:i}),ln.current?(Oe(ln.current),Ve("learnings"),ln.current=null):(c=v.getState().selectedRuleSetId,l=c?P(i,c):null,c&&l||(u=function(e){if(e.hasAccess)return e;for(var n=0,t=e.children||[];n<t.length;n++){var r=t[n],o=u(r);if(o)return o}return null},d=u(i),Oe(d?d.id:i.id)))):(Je(null!==(f=a.id)&&void 0!==f?f:null),$e(!1),Me(null)):(Je(null),$e(!1),Me(null))),[3,9];case 7:return p=r.sent(),console.error("Failed to fetch rule sets or permissions",p),_e("Failed to load data. Please try again later."),[3,9];case 8:return Fe(!1),[7];case 9:return[2]}})})};u(function(){var e;(null===(e=null==le?void 0:le.accessToken)||void 0===e?void 0:e.length)&&In?_n(!0):console.warn("Error: Trying to fetch rules without access token",le)},[null==le?void 0:le.accessToken,_e,De,fe.applicationId,In]);var Dn=function(n,o,s){return t(ce,void 0,void 0,function(){var t,o,s,a,i,c,l,u;return r(this,function(r){switch(r.label){case 0:Qe(!0),r.label=1;case 1:return r.trys.push([1,4,5,6]),[4,w(n,le.accessToken)];case 2:return r.sent(),v.getState().selectedRuleSetId===n&&(t=v.getState().scopeTreeData,(o=M((null==t?void 0:t.data)||null,n))&&o.length>1&&(s=o[o.length-2],Oe(s),Ve("learnings"))),[4,_n(!0)];case 3:return r.sent(),Be(function(n){return e(e({},n),{isOpen:!1})}),null===(i=dn.current)||void 0===i||i.show({severity:"success",summary:"Deleted Successfully",detail:"The scope was permanently removed."}),[3,6];case 4:return a=r.sent(),console.error("An error occurred during scope deletion.",a),null===(c=dn.current)||void 0===c||c.show({severity:"error",summary:"Delete Failed",detail:(null===(u=null===(l=null==a?void 0:a.response)||void 0===l?void 0:l.data)||void 0===u?void 0:u.message)||"There was an error deleting the scope. Please try again."}),[3,6];case 5:return Qe(!1),[7];case 6:return[2]}})})},kn=function(e,n){var t;console.log("Section Selected:",{scopeId:e,sectionId:n}),yn(((t={})[_.SECTION]="learnings"===n?null:n,t)),Ve(n),Oe(e),cn(!1)},Mn=ke,Pn=nn?{data:{id:nn.stationId,name:nn.stationName,type:"STATION",metrics:{learningsCount:nn.learningsCount,stationsCount:0},children:[]}}:Mn,Un=!!(null==Pn?void 0:Pn.data);null===(se=null==Pn?void 0:Pn.data)||void 0===se||se.type;var Bn=F(function(e){return e.hasGlobalPermission})("ilotj.scope.global.create",fe.applicationResourceId||""),qn=function(e){return t(ce,void 0,void 0,function(){var n,t,s,a,i,c,l,u,d,p;return r(this,function(r){switch(r.label){case 0:if(!(n="string"==typeof e?e:(null===(c=null===(i=v.getState().scopeTreeData)||void 0===i?void 0:i.data)||void 0===c?void 0:c.id)||Ye)&&!Ze)return null===(l=dn.current)||void 0===l||l.show({severity:"error",sticky:!1,className:h.errorToast,content:o(X,{message:"Unable to identify the global scope for this access request."})}),[2];on(!0),r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,O(n,Ze)];case 2:return r.sent(),cn(!0),null===(u=dn.current)||void 0===u||u.show({severity:"success",sticky:!1,life:3e3,className:h.successToast,content:o(J,{message:"Access request submitted successfully!"})}),[3,5];case 3:return t=r.sent(),s=null===(d=null==t?void 0:t.response)||void 0===d?void 0:d.data,a="GLOBAL_SCOPE_NOT_FOUND"===(null==s?void 0:s.code)?"Unable to identify the global scope for this access request.":(null==s?void 0:s.detail)||(null==s?void 0:s.message)||"Failed to request access. Please try again.",null===(p=dn.current)||void 0===p||p.show({severity:"error",sticky:!1,className:h.errorToast,content:o(X,{message:a})}),[3,5];case 4:return on(!1),[7];case 5:return[2]}})})};if(En)return o("div",e({className:h.learningManagementContainer},{children:o(K,{})}));if(Rn)return o("div",e({className:h.learningManagementContainer},{children:o(V,{errorMessage:"Failed to load configuration. Please try again.",onRetry:function(){return wn()},title:"Error Loading Configuration"})}));var Gn=n(n([{type:"GLOBAL",label:"Global",addChildLabel:"".concat($("".concat(ne,".addScope"),"Add Scope")),addChildType:"SCOPE"}],Array.from({length:jn},function(){return e({type:"SCOPE",label:$("".concat(ne,".scope"),"Scope")},!Se&&{addChildLabel:$("".concat(te,".addSubScope"),"Add Subscope"),addChildType:"SUBSCOPE"})}),!0),Se?[]:[{type:"SUBSCOPE",label:$("".concat(ne,".subScope"),"Subscope")}],!0),Fn=nn?Ae.filter(function(e){return"stations"!==e.id}):Ae;return o(q,{children:s("div",e({className:h.learningManagementContainer},{children:[o("div",e({className:h.mainWrapper},{children:Ge?o(k,{}):Ne?s("div",e({className:h.errorContainer},{children:[o("div",e({className:h.errorTitle},{children:"Error Loading Data"})),o("p",e({className:h.errorDesc},{children:Ne})),o("button",e({onClick:function(){return _n(!0)},className:h.tryAgainBtn},{children:"Try Again"}))]})):Un?o(S,{onOpenCreateModal:function(){return Be({isOpen:!0,type:"GLOBAL"})},onAddChild:function(e,n,t){return Be({isOpen:!0,type:n,parentId:e,parentName:t})},onRenameChild:function(e,n){return Be({isOpen:!0,type:"RENAME",scopeId:e,initialName:n})},onDeleteChild:function(e,n,o){return t(ce,void 0,void 0,function(){var t,s,a;return r(this,function(r){switch(r.label){case 0:return t=v.getState().scopeTreeData,s=M((null==t?void 0:t.data)||null,e),a=!!s&&3===s.length,0!==o?[3,2]:[4,Dn(e)];case 1:return r.sent(),[3,3];case 2:Be({isOpen:!0,type:"DELETE",scopeId:e,initialName:n,isSubscope:a}),r.label=3;case 3:return[2]}})})},canDeleteScope:function(e){return Cn("ilotj.scope.delete",e)},canEditScope:function(e){return Cn("ilotj.scope.edit",e)},canCreateScope:function(e){return Cn("ilotj.scope.create",e)},onSectionSelect:kn,activeSectionId:Ke,scopeTreeData:Pn,sectionsConfig:Fn,onViewStation:function(e){kn(e.stationId,"learnings")},onRefreshRuleSets:function(e,n){void 0===e&&(e=!0),n&&(ln.current=n),_n(e)},nodeTypesConfig:Gn,app_integration_id:ge,token:le.accessToken,modeId:Ce,onRequestAccess:qn,isRequestingAccess:rn,isAccessRequested:an}):o(y,{onCreate:function(){return Be({isOpen:!0,type:"GLOBAL"})},title:$("".concat(re,".title"),"No Global Scope has been added!"),desc:$("".concat(re,".desc"),"Start by creating a Global scope to define base learnings that apply across all stations."),button:$("".concat(re,".createGlobalScope"),"Create Global Scope"),canCreateRule:Bn,noAccessTitle:$("".concat(re,".noAccessTitle"),"Access Restricted"),noAccessDesc:$("".concat(re,".noAccessDesc"),"You do not have access for this application."),requestAccessButton:$("".concat(re,".requestAccessButton"),"Request Access"),requestSentButton:$("".concat(re,".requestSentButton"),"Request Sent"),onRequestAccess:qn,isRequestingAccess:rn,isAccessRequested:an})})),o(g,{ref:dn,pt:{root:{style:{zIndex:9999}}}}),Se&&Ue.isOpen&&"DELETE"!==Ue.type&&"RENAME"!==Ue.type?o(G,{isOpen:!0,onClose:function(){return Be(e(e({},Ue),{isOpen:!1}))},onSubmit:function(n){return t(ce,void 0,void 0,function(){var t,o,s,a,i,c,l,u,d,p,m,f,g,h,S,y,b,C,T,I;return r(this,function(r){switch(r.label){case 0:Qe(!0),t=v.getState().backwardCompatibility,r.label=1;case 1:return r.trys.push([1,12,13,14]),o=void 0,t&&"object"==typeof n?o=n:(s=n,a="SCOPE"===Ue.type&&Ue.parentId,i=a?"genreRuleSet":Ue.type,o={topic:i,scope_reference_id:null,scopeDescription:"demo",parentScopeId:Ue.parentId||null,scopeName:s,scopeReferenceMetadata:{},applicationMappingId:ge}),[4,E(o,le.accessToken)];case 2:if(c=r.sent(),!(l=null===(h=null==c?void 0:c.data)||void 0===h?void 0:h.scopeId))return[3,10];if(ln.current=l,u=t&&(null===(S=o.topic)||void 0===S?void 0:S.toLowerCase().includes("genre")),d=!t&&"GLOBAL"!==Ue.type&&Ue.parentId,!u&&!d)return[3,10];if(!(p=t?null===(b=null===(y=v.getState().scopeTreeData)||void 0===y?void 0:y.data)||void 0===b?void 0:b.id:Ue.parentId))return[3,10];if(!Se)return[3,7];r.label=3;case 3:return r.trys.push([3,5,,6]),[4,A({source_scope_id:p,target_scope_id:l})];case 4:return r.sent(),[3,6];case 5:return m=r.sent(),console.error("Failed to inherit rules for the new scope:",m),[3,6];case 6:return[3,10];case 7:return r.trys.push([7,9,,10]),[4,L({source_scope_id:p,target_scope_id:l,application_mapping_id:ge||"",is_copy_parent_variant_id:!1})];case 8:return r.sent(),[3,10];case 9:return f=r.sent(),console.error("Failed to inherit rules for the new scope:",f),[3,10];case 10:return[4,_n(!0)];case 11:return r.sent(),Be(function(n){return e(e({},n),{isOpen:!1})}),[3,14];case 12:throw g=r.sent(),console.error("An error occurred during scope creation.",g),null===(C=dn.current)||void 0===C||C.show({severity:"error",summary:"Creation Failed",detail:(null===(I=null===(T=null==g?void 0:g.response)||void 0===T?void 0:T.data)||void 0===I?void 0:I.message)||"There was an error creating the scope. Please try again."}),g;case 13:return Qe(!1),[7];case 14:return[2]}})})},hasGlobalRuleSet:Un,canCreateGlobal:Bn,globalScopeId:null!==(ie=null===(ae=null==ke?void 0:ke.data)||void 0===ae?void 0:ae.id)&&void 0!==ie?ie:null}):s(a,{children:[o(z,{isOpen:Ue.isOpen&&"DELETE"!==Ue.type&&"RENAME"!==Ue.type,onClose:function(){return Be(e(e({},Ue),{isOpen:!1}))},onCreate:function(e){e&&(ln.current=e),_n(!0)},hasGlobalRuleSet:Un,parentId:Ue.parentId}),o(Z,{isOpen:Ue.isOpen&&"RENAME"===Ue.type,onClose:function(){return Be(e(e({},Ue),{isOpen:!1}))},onSave:function(n){return t(ce,void 0,void 0,function(){var t,s,a,i,c,l;return r(this,function(r){switch(r.label){case 0:Qe(!0),r.label=1;case 1:return r.trys.push([1,4,5,6]),Ue.scopeId?(t=v.getState().backwardCompatibility,s=t?{scope_id:Ue.scopeId,scope_name:n}:{scope_id:Ue.scopeId,scope_type:"Custom",scope_name:n,application_mapping_id:ge},[4,R(s,le.accessToken)]):[2];case 2:return r.sent(),[4,_n(!0)];case 3:return r.sent(),Be(function(n){return e(e({},n),{isOpen:!1})}),[3,6];case 4:throw a=r.sent(),console.error("An error occurred during scope rename.",a),null===(i=dn.current)||void 0===i||i.show({severity:"error",sticky:!1,className:h.errorToast,content:o(X,{message:(null===(l=null===(c=null==a?void 0:a.response)||void 0===c?void 0:c.data)||void 0===l?void 0:l.message)||"There was an error renaming the scope. Please try again."})}),a;case 5:return Qe(!1),[7];case 6:return[2]}})})},initialName:Ue.initialName})]}),o(D,{isOpen:Ue.isOpen&&"DELETE"===Ue.type,onCancel:function(){return Be(e(e({},Ue),{isOpen:!1}))},onConfirm:function(){return Dn(Ue.scopeId,Ue.initialName,Ue.isSubscope)},title:"Delete Scope",description:s(a,{children:["Deleting ",o("span",e({className:h.highlight},{children:Ue.initialName||"this scope"}))," will permanently remove all Learnings, Access rules, and Change History inside it. This cannot be undone."]}),confirmText:"Delete",confirmBgColor:"#EF4444",isLoading:He})]}))})}export{oe as default};
|
|
2
2
|
//# sourceMappingURL=LearningManagement.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"tslib";import"react/jsx-runtime";import"react";import"../../api/transport.js";import"lucide-react";import"./store/useLearningTemplateStore.js";import"primereact/toast";import"./apis/scopeApis.js";import"./store/usePermissionsStore.js";import"./store/useLMSConfigStore.js";import"./components/ToolTip.js";import"./store/useAuthStore.js";import"@mui/material";import"@mui/icons-material/Check";import"@mui/icons-material/CloseRounded";import{QueryClient as t}from"@tanstack/react-query";import"./store/useEnvStore.js";import"date-fns/format";import"date-fns/isValid";import"date-fns/parseISO";import"framer-motion";import"../IL-OTJ/_components/atoms/Textarea/Textarea.js";import"../IL-OTJ/_components/InputDataReasoningCard.js";import"../IL-OTJ/_components/TooltipComponent.js";import"../IL-OTJ/_components/templates/TemplatesMap/templatesMap.js";import"../IL-OTJ/store/CitationsContext.js";import"uuid";import"@mui/material/Tooltip";import"react-markdown";import"rehype-raw";import"@e-llm-studio/streaming-response";import"@e-llm-studio/watch-me-work";import"../IL-OTJ/_components/ChatComponents/ChatHeader.js";import"remark-gfm";import"../IL-OTJ/_components/MarkdownComponents/MarkdownElements.js";import"../IL-OTJ/_components/CitationLink.js";import"@e-llm-studio/citation";import"react-icons/bs";import"../IL-marketplace/components/GuidelineIconButton.js";import"@radix-ui/react-tooltip";import"@e-llm-studio/creative-workspace-ui-component";import"../IL-marketplace/queryClient.js";import"axios";import"./store/useAppSecRolesStore.js";import"./config.js";import"../IL-OTJ/ValueTypeWrappers/TeachMePlugin.js";import"./store/useConfigStore.js";import"appsec-ui";import"react-dom";import"./components/StationOnboarding/InputField.js";import"@e-llm-studio/audit-log";import"@e-llm-studio/audit-log/dist/styles.css";import"./AuditLog/ChangeLogDiff.js";import"./hooks/useLearningTemplateQueryParams.js";import"react-router-dom";new t;
|
|
2
|
+
//# sourceMappingURL=LearningManagementTest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LearningManagementTest.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|