@e-llm-studio/instant-learning 1.3.0-alpha.10 → 1.3.0-alpha.13
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/dist/cjs/features/LearningManagement/LearningManagement.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/CreateLearningSetModal.js +1 -1
- package/dist/cjs/features/LearningManagement/components/CreateRuleSetLegacyModal.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/StationOnboardModal.js +1 -1
- package/dist/cjs/features/LearningManagement/store/usePermissionsStore.js +1 -1
- package/dist/features/LearningManagement/LearningManagement.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/CreateLearningSetModal.js +1 -1
- package/dist/features/LearningManagement/components/CreateRuleSetLegacyModal.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/StationOnboardModal.js +1 -1
- package/dist/features/LearningManagement/store/usePermissionsStore.js +1 -1
- package/dist/types/src/AccordianHeadTest.d.ts +1 -2
- package/dist/types/src/AccordianHeadTest.d.ts.map +1 -1
- package/dist/types/src/App.d.ts +1 -2
- package/dist/types/src/App.d.ts.map +1 -1
- package/dist/types/src/CommonComponents/AccordianHead/AccordianHead.d.ts +1 -1
- package/dist/types/src/CommonComponents/AccordianHead/AccordianHead.d.ts.map +1 -1
- package/dist/types/src/CommonComponents/GradientSparkleIcon.d.ts +1 -2
- package/dist/types/src/CommonComponents/GradientSparkleIcon.d.ts.map +1 -1
- package/dist/types/src/CommonComponents/HelloWorld.d.ts +1 -1
- package/dist/types/src/CommonComponents/HelloWorld.d.ts.map +1 -1
- package/dist/types/src/CommonComponents/NoTableData.d.ts +1 -1
- package/dist/types/src/CommonComponents/NoTableData.d.ts.map +1 -1
- package/dist/types/src/CommonComponents/Spinner.d.ts +1 -2
- package/dist/types/src/CommonComponents/Spinner.d.ts.map +1 -1
- package/dist/types/src/GoogleFilePickerDemo.d.ts +1 -2
- package/dist/types/src/GoogleFilePickerDemo.d.ts.map +1 -1
- package/dist/types/src/ThinkingBulbIconComponent.d.ts +1 -2
- package/dist/types/src/ThinkingBulbIconComponent.d.ts.map +1 -1
- package/dist/types/src/features/DataSelector/DataSelector.d.ts +1 -1
- package/dist/types/src/features/DataSelector/DataSelector.d.ts.map +1 -1
- package/dist/types/src/features/DataSelector/components/DataSelectionOptionsScreen.d.ts +1 -1
- package/dist/types/src/features/DataSelector/components/DataSelectionOptionsScreen.d.ts.map +1 -1
- package/dist/types/src/features/DataSelector/components/RLEFDataPointsListInSelectedDataSetCollection.d.ts +1 -1
- package/dist/types/src/features/DataSelector/components/RLEFDataPointsListInSelectedDataSetCollection.d.ts.map +1 -1
- package/dist/types/src/features/DataSelector/components/RLEFDataSetCollectionsList.d.ts +1 -1
- package/dist/types/src/features/DataSelector/components/RLEFDataSetCollectionsList.d.ts.map +1 -1
- package/dist/types/src/features/DataSelector/components/RlefDataTabsComponent.d.ts +1 -1
- package/dist/types/src/features/DataSelector/components/RlefDataTabsComponent.d.ts.map +1 -1
- package/dist/types/src/features/DataSelector/components/RlefHistoricalCopilotData.d.ts +1 -2
- package/dist/types/src/features/DataSelector/components/RlefHistoricalCopilotData.d.ts.map +1 -1
- package/dist/types/src/features/DataSelector/components/SavedDataSetListScreen.d.ts +1 -2
- package/dist/types/src/features/DataSelector/components/SavedDataSetListScreen.d.ts.map +1 -1
- package/dist/types/src/features/DataSelector/components/SelectedDataList.d.ts +1 -1
- package/dist/types/src/features/DataSelector/components/SelectedDataList.d.ts.map +1 -1
- package/dist/types/src/features/DataSelector/components/subcomponents/DataSetElement/DataSetElement.d.ts +1 -1
- package/dist/types/src/features/DataSelector/components/subcomponents/DataSetElement/DataSetElement.d.ts.map +1 -1
- package/dist/types/src/features/DataSelector/components/subcomponents/Pagination/Pagination.d.ts +1 -2
- package/dist/types/src/features/DataSelector/components/subcomponents/Pagination/Pagination.d.ts.map +1 -1
- package/dist/types/src/features/DocumentLearning/_components/MessageRendering.d.ts +1 -2
- package/dist/types/src/features/DocumentLearning/_components/MessageRendering.d.ts.map +1 -1
- package/dist/types/src/features/DocumentLearning/_components/MinimizedThinkingSteps.d.ts +1 -2
- package/dist/types/src/features/DocumentLearning/_components/MinimizedThinkingSteps.d.ts.map +1 -1
- package/dist/types/src/features/DocumentLearning/_components/_svg/ArrowDown.d.ts +1 -2
- package/dist/types/src/features/DocumentLearning/_components/_svg/ArrowDown.d.ts.map +1 -1
- package/dist/types/src/features/DocumentLearning/_components/_svg/ArrowIconBlue.d.ts +1 -2
- package/dist/types/src/features/DocumentLearning/_components/_svg/ArrowIconBlue.d.ts.map +1 -1
- package/dist/types/src/features/DocumentLearning/_components/_svg/CompleteIconGreen.d.ts +1 -2
- package/dist/types/src/features/DocumentLearning/_components/_svg/CompleteIconGreen.d.ts.map +1 -1
- package/dist/types/src/features/DocumentLearning/_components/_svg/NewChatIcon.d.ts +1 -2
- package/dist/types/src/features/DocumentLearning/_components/_svg/NewChatIcon.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/ValueTypeWrappers/TeachMeWrapper.d.ts +1 -1
- package/dist/types/src/features/IL-OTJ/ValueTypeWrappers/TeachMeWrapper.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/AccordianSection.d.ts +1 -2
- package/dist/types/src/features/IL-OTJ/_components/AccordianSection.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/ChatComponents/ChatHeader.d.ts +1 -2
- package/dist/types/src/features/IL-OTJ/_components/ChatComponents/ChatHeader.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/ConflictingReasoningCard.d.ts +1 -1
- package/dist/types/src/features/IL-OTJ/_components/ConflictingReasoningCard.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/CriticalGaps.d.ts +1 -2
- package/dist/types/src/features/IL-OTJ/_components/CriticalGaps.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/GapExplanationAccordion.d.ts +1 -1
- package/dist/types/src/features/IL-OTJ/_components/GapExplanationAccordion.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/ILPopup.d.ts +1 -1
- package/dist/types/src/features/IL-OTJ/_components/ILPopup.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/MarkdownComponents/MarkdownElements.d.ts +3 -3
- 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 +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/MessageRendering/ClickableChatComponents.d.ts +3 -3
- package/dist/types/src/features/IL-OTJ/_components/MessageRendering/ClickableChatComponents.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/MessageRendering/MessageRendering.d.ts +1 -2
- package/dist/types/src/features/IL-OTJ/_components/MessageRendering/MessageRendering.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/MinimizedThinkingSteps.d.ts +1 -2
- package/dist/types/src/features/IL-OTJ/_components/MinimizedThinkingSteps.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/ViewFormUpdateCard.d.ts +1 -2
- 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 +1 -2
- package/dist/types/src/features/IL-OTJ/_components/ViewIdentifiedFieldsCard.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/WatchMeWork/AgentStepsView.d.ts +1 -1
- package/dist/types/src/features/IL-OTJ/_components/WatchMeWork/AgentStepsView.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/WatchMeWork/StepDetailView.d.ts +1 -2
- package/dist/types/src/features/IL-OTJ/_components/WatchMeWork/StepDetailView.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/WatchMeWork/Thinkingstepshelper.d.ts +9 -9
- package/dist/types/src/features/IL-OTJ/_components/WatchMeWork/Thinkingstepshelper.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/WatchMeWork/WorkingIndicator.d.ts +1 -2
- package/dist/types/src/features/IL-OTJ/_components/WatchMeWork/WorkingIndicator.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/_svg/ArrowDown.d.ts +1 -2
- package/dist/types/src/features/IL-OTJ/_components/_svg/ArrowDown.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/_svg/ArrowIconBlue.d.ts +1 -2
- package/dist/types/src/features/IL-OTJ/_components/_svg/ArrowIconBlue.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/_svg/BookIcon.d.ts +1 -2
- package/dist/types/src/features/IL-OTJ/_components/_svg/BookIcon.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/_svg/ButtonCognitiveIcon.d.ts +1 -1
- package/dist/types/src/features/IL-OTJ/_components/_svg/ButtonCognitiveIcon.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/_svg/ChevronDown.d.ts +1 -2
- package/dist/types/src/features/IL-OTJ/_components/_svg/ChevronDown.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/_svg/ChevronIcon.d.ts +1 -1
- package/dist/types/src/features/IL-OTJ/_components/_svg/ChevronIcon.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/_svg/ChevronUp.d.ts +1 -2
- package/dist/types/src/features/IL-OTJ/_components/_svg/ChevronUp.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/_svg/CognitiveDecisioning.d.ts +1 -2
- package/dist/types/src/features/IL-OTJ/_components/_svg/CognitiveDecisioning.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/_svg/CompleteIconGreen.d.ts +1 -2
- package/dist/types/src/features/IL-OTJ/_components/_svg/CompleteIconGreen.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/_svg/GapIcon.d.ts +1 -1
- package/dist/types/src/features/IL-OTJ/_components/_svg/GapIcon.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/_svg/HumanWithBrainIcon.d.ts +1 -2
- package/dist/types/src/features/IL-OTJ/_components/_svg/HumanWithBrainIcon.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/_svg/InfoIcon.d.ts +1 -2
- package/dist/types/src/features/IL-OTJ/_components/_svg/InfoIcon.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/_svg/LeftAndRightArrow.d.ts +1 -1
- package/dist/types/src/features/IL-OTJ/_components/_svg/LeftAndRightArrow.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/_svg/Lightbulb.d.ts +1 -1
- package/dist/types/src/features/IL-OTJ/_components/_svg/Lightbulb.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/_svg/NewChatIcon.d.ts +1 -1
- package/dist/types/src/features/IL-OTJ/_components/_svg/NewChatIcon.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/_svg/PencilEdit.d.ts +1 -2
- package/dist/types/src/features/IL-OTJ/_components/_svg/PencilEdit.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/_svg/RadioButton.d.ts +1 -2
- package/dist/types/src/features/IL-OTJ/_components/_svg/RadioButton.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/_svg/RightSideIcons.d.ts +8 -9
- package/dist/types/src/features/IL-OTJ/_components/_svg/RightSideIcons.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/_svg/ScrollToBottom.d.ts +1 -2
- package/dist/types/src/features/IL-OTJ/_components/_svg/ScrollToBottom.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/_svg/SendButton.d.ts +1 -2
- package/dist/types/src/features/IL-OTJ/_components/_svg/SendButton.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/_svg/SparkleIcon.d.ts +1 -2
- package/dist/types/src/features/IL-OTJ/_components/_svg/SparkleIcon.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/_svg/TickIcon.d.ts +1 -1
- package/dist/types/src/features/IL-OTJ/_components/_svg/TickIcon.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/_svg/UserIcon.d.ts +1 -2
- package/dist/types/src/features/IL-OTJ/_components/_svg/UserIcon.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/_svg/WarningIcon.d.ts +1 -2
- package/dist/types/src/features/IL-OTJ/_components/_svg/WarningIcon.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/_svg/WatchMeWorkIcon.d.ts +1 -2
- package/dist/types/src/features/IL-OTJ/_components/_svg/WatchMeWorkIcon.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/atoms/Button/Button.d.ts +1 -1
- package/dist/types/src/features/IL-OTJ/_components/atoms/Button/Button.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/atoms/Dropdown/Dropdown.d.ts +1 -1
- package/dist/types/src/features/IL-OTJ/_components/atoms/Dropdown/Dropdown.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/atoms/Toggle/Toggle.d.ts +1 -2
- package/dist/types/src/features/IL-OTJ/_components/atoms/Toggle/Toggle.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/molecules/Condition/ConditionList.d.ts +1 -1
- package/dist/types/src/features/IL-OTJ/_components/molecules/Condition/ConditionList.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/molecules/Sections/SectionWrapper.d.ts +1 -1
- package/dist/types/src/features/IL-OTJ/_components/molecules/Sections/SectionWrapper.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/molecules/SeperationRow/SeparationRow.d.ts +1 -2
- package/dist/types/src/features/IL-OTJ/_components/molecules/SeperationRow/SeparationRow.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/organisms/ConditionSection/ConditionSection.d.ts +1 -2
- package/dist/types/src/features/IL-OTJ/_components/organisms/ConditionSection/ConditionSection.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/organisms/ConfigSection/ConfigSection.d.ts +1 -2
- package/dist/types/src/features/IL-OTJ/_components/organisms/ConfigSection/ConfigSection.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/organisms/ScopeSection/ScopeSection.d.ts +1 -1
- package/dist/types/src/features/IL-OTJ/_components/organisms/ScopeSection/ScopeSection.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/organisms/TextSection/TextSection.d.ts +1 -2
- package/dist/types/src/features/IL-OTJ/_components/organisms/TextSection/TextSection.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/templates/RuleComparison/AgentComposerRuleComparison.d.ts +1 -2
- package/dist/types/src/features/IL-OTJ/_components/templates/RuleComparison/AgentComposerRuleComparison.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/templates/RuleComparison/RuleComparison.d.ts +1 -2
- 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/RuleComparison/RuleComparisonNew.d.ts +1 -2
- package/dist/types/src/features/IL-OTJ/_components/templates/RuleComparison/RuleComparisonNew.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/templates/Testing/Testing.d.ts +1 -2
- package/dist/types/src/features/IL-OTJ/_components/templates/Testing/Testing.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/templates/TrafficManager/CreateRule.d.ts +1 -2
- package/dist/types/src/features/IL-OTJ/_components/templates/TrafficManager/CreateRule.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/templates/TrafficManager/TrafficManagerTemplate.d.ts +1 -2
- package/dist/types/src/features/IL-OTJ/_components/templates/TrafficManager/TrafficManagerTemplate.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/templates/WorkflowComposer/WorkflowComposer.d.ts +1 -2
- package/dist/types/src/features/IL-OTJ/_components/templates/WorkflowComposer/WorkflowComposer.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/store/CitationsContext.d.ts +1 -1
- package/dist/types/src/features/IL-OTJ/store/CitationsContext.d.ts.map +1 -1
- package/dist/types/src/features/InstantLearning/_components/MessageRendering.d.ts +1 -2
- package/dist/types/src/features/InstantLearning/_components/MessageRendering.d.ts.map +1 -1
- package/dist/types/src/features/InstantLearning/_components/MinimizedThinkingSteps.d.ts +1 -2
- package/dist/types/src/features/InstantLearning/_components/MinimizedThinkingSteps.d.ts.map +1 -1
- package/dist/types/src/features/InstantLearning/_components/_svg/ArrowDown.d.ts +1 -2
- package/dist/types/src/features/InstantLearning/_components/_svg/ArrowDown.d.ts.map +1 -1
- package/dist/types/src/features/InstantLearning/_components/_svg/ArrowIconBlue.d.ts +1 -2
- package/dist/types/src/features/InstantLearning/_components/_svg/ArrowIconBlue.d.ts.map +1 -1
- package/dist/types/src/features/InstantLearning/_components/_svg/CompleteIconGreen.d.ts +1 -2
- package/dist/types/src/features/InstantLearning/_components/_svg/CompleteIconGreen.d.ts.map +1 -1
- package/dist/types/src/features/InstantLearning/_components/_svg/NewChatIcon.d.ts +1 -2
- package/dist/types/src/features/InstantLearning/_components/_svg/NewChatIcon.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/LearningManagement.d.ts +1 -2
- package/dist/types/src/features/LearningManagement/LearningManagement.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/LearningManagementTest.d.ts +1 -2
- package/dist/types/src/features/LearningManagement/LearningManagementTest.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/RuleContent/ApprovalLearningDialog.d.ts +1 -2
- package/dist/types/src/features/LearningManagement/RuleContent/ApprovalLearningDialog.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/components/CardSkeleton.d.ts +1 -2
- package/dist/types/src/features/LearningManagement/components/CardSkeleton.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/components/CreateRuleSetLegacyModal.d.ts +1 -0
- package/dist/types/src/features/LearningManagement/components/CreateRuleSetLegacyModal.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/components/LearningTemplateManagementSkeleton.d.ts +1 -2
- package/dist/types/src/features/LearningManagement/components/LearningTemplateManagementSkeleton.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/components/RuleContentSkeleton.d.ts +1 -2
- package/dist/types/src/features/LearningManagement/components/RuleContentSkeleton.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/components/Skeleton.d.ts +1 -1
- package/dist/types/src/features/LearningManagement/components/Skeleton.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/UploadData/Components/SelectDataFromGoogleDrive/SelectDataFromGoogleDrive.d.ts +1 -1
- package/dist/types/src/features/UploadData/Components/SelectDataFromGoogleDrive/SelectDataFromGoogleDrive.d.ts.map +1 -1
- package/dist/types/src/features/UploadData/Components/SelectDataFromGoogleDrive/SelectDataFromGoogleDriveButton.d.ts +1 -1
- package/dist/types/src/features/UploadData/Components/SelectDataFromGoogleDrive/SelectDataFromGoogleDriveButton.d.ts.map +1 -1
- package/dist/types/src/features/UploadData/Components/SelectDataFromLocalSystem/SelectDataFromLocalSystem.d.ts +1 -1
- package/dist/types/src/features/UploadData/Components/SelectDataFromLocalSystem/SelectDataFromLocalSystem.d.ts.map +1 -1
- package/dist/types/src/features/UploadData/Components/SelectDataFromLocalSystem/SelectDataFromLocalSystemButton.d.ts +1 -1
- package/dist/types/src/features/UploadData/Components/SelectDataFromLocalSystem/SelectDataFromLocalSystemButton.d.ts.map +1 -1
- package/dist/types/src/features/UploadData/Components/SelectDataFromRLEF/Components/Dataset-collection.d.ts +1 -1
- package/dist/types/src/features/UploadData/Components/SelectDataFromRLEF/Components/Dataset-collection.d.ts.map +1 -1
- package/dist/types/src/features/UploadData/Components/SelectDataFromRLEF/Components/DatasetCollectionInfo.d.ts +1 -1
- package/dist/types/src/features/UploadData/Components/SelectDataFromRLEF/Components/DatasetCollectionInfo.d.ts.map +1 -1
- package/dist/types/src/features/UploadData/Components/SelectDataFromRLEF/Components/ProjectTaskSelect.d.ts +1 -1
- package/dist/types/src/features/UploadData/Components/SelectDataFromRLEF/Components/ProjectTaskSelect.d.ts.map +1 -1
- package/dist/types/src/features/UploadData/Components/SelectDataFromRLEF/Components/Tooltip.d.ts +1 -1
- package/dist/types/src/features/UploadData/Components/SelectDataFromRLEF/Components/Tooltip.d.ts.map +1 -1
- package/dist/types/src/features/UploadData/Components/SelectDataFromRLEF/Components/dataset-collectionFilterColumnMenuComponents/ConfidenceScoreColumnMenu.d.ts +1 -2
- package/dist/types/src/features/UploadData/Components/SelectDataFromRLEF/Components/dataset-collectionFilterColumnMenuComponents/ConfidenceScoreColumnMenu.d.ts.map +1 -1
- package/dist/types/src/features/UploadData/Components/SelectDataFromRLEF/Components/dataset-collectionFilterColumnMenuComponents/LabelColumnMenu.d.ts +1 -2
- package/dist/types/src/features/UploadData/Components/SelectDataFromRLEF/Components/dataset-collectionFilterColumnMenuComponents/LabelColumnMenu.d.ts.map +1 -1
- package/dist/types/src/features/UploadData/Components/SelectDataFromRLEF/Components/dataset-collectionFilterColumnMenuComponents/TableColumnResetFilterButton.d.ts +1 -2
- package/dist/types/src/features/UploadData/Components/SelectDataFromRLEF/Components/dataset-collectionFilterColumnMenuComponents/TableColumnResetFilterButton.d.ts.map +1 -1
- package/dist/types/src/features/UploadData/Components/SelectDataFromRLEF/Components/dataset-collectionFilterColumnMenuComponents/TagColumnMenu.d.ts +1 -2
- package/dist/types/src/features/UploadData/Components/SelectDataFromRLEF/Components/dataset-collectionFilterColumnMenuComponents/TagColumnMenu.d.ts.map +1 -1
- package/dist/types/src/features/UploadData/Components/SelectDataFromRLEF/Components/dropdown-with-radio.d.ts +1 -1
- package/dist/types/src/features/UploadData/Components/SelectDataFromRLEF/Components/dropdown-with-radio.d.ts.map +1 -1
- package/dist/types/src/features/UploadData/Components/SelectDataFromRLEF/Components/input-label-with-info.d.ts +1 -1
- package/dist/types/src/features/UploadData/Components/SelectDataFromRLEF/Components/input-label-with-info.d.ts.map +1 -1
- package/dist/types/src/features/UploadData/Components/SelectDataFromRLEF/SelectDataFromRLEF.d.ts +1 -1
- package/dist/types/src/features/UploadData/Components/SelectDataFromRLEF/SelectDataFromRLEF.d.ts.map +1 -1
- package/dist/types/src/features/UploadData/Components/SelectDataFromRLEF/SelectDataFromRLEFButton.d.ts +1 -1
- package/dist/types/src/features/UploadData/Components/SelectDataFromRLEF/SelectDataFromRLEFButton.d.ts.map +1 -1
- package/dist/types/src/features/UploadData/Components/SelectDataFromSavedDataSet/SelectDataFromSavedDataSet.d.ts +1 -1
- package/dist/types/src/features/UploadData/Components/SelectDataFromSavedDataSet/SelectDataFromSavedDataSet.d.ts.map +1 -1
- package/dist/types/src/features/UploadData/Components/SelectDataFromSavedDataSet/SelectDataFromSavedDataSetButton.d.ts +1 -1
- package/dist/types/src/features/UploadData/Components/SelectDataFromSavedDataSet/SelectDataFromSavedDataSetButton.d.ts.map +1 -1
- package/dist/types/src/plugins/ValueTypes/RadioTrafficLearning/RadioTrafficLearningRenderer.d.ts +1 -2
- package/dist/types/src/plugins/ValueTypes/RadioTrafficLearning/RadioTrafficLearningRenderer.d.ts.map +1 -1
- package/dist/types/src/routes/Routes.d.ts +1 -2
- package/dist/types/src/routes/Routes.d.ts.map +1 -1
- package/dist/types/src/utils/CustomSkeleton.d.ts +1 -1
- package/dist/types/src/utils/CustomSkeleton.d.ts.map +1 -1
- package/dist/types/src/utils/SkeletonLoader.d.ts +1 -1
- package/dist/types/src/utils/SkeletonLoader.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("react"),r=require("lucide-react"),s=require("./store/useLearningTemplateStore.js"),a=require("primereact/toast"),i=require("./styles/LearningTemplateManagement.module.css.js"),o=require("./LearningTemplateLayout.js"),l=require("./components/EmptyLearningState.js"),u=require("./store/useAuthStore.js"),c=require("./apis/scopeApis.js"),d=require("./hooks/useLearningTemplateQueryParams.js"),p=require("./components/ConfirmationModal.js"),g=require("./components/LearningTemplateManagementSkeleton.js"),f=require("./utils/treeUtils.js"),S=require("./store/useEnvStore.js"),m=require("./store/useConfigStore.js"),v=require("./components/ToolTip.js"),h=require("./components/CreateRuleSetLegacyModal.js"),_=require("./store/usePermissionsStore.js"),y=require("./store/useAppSecRolesStore.js"),T=require("./queries/useApprovalQueries.js"),b=require("./RuleContent/AddScopeModal.js"),C=require("react-router-dom"),L=require("./shared/SuccessToastContent.js"),j=require("./shared/ErrorToastContent.js"),E=require("./RuleContent/RenameScopeModal.js"),A=[{id:"learnings",label:"Learnings",icon:r.BookOpen,badgeKey:"learningsCount"},{id:"access",label:"Access",icon:r.Users},{id:"history",label:"Change History",icon:r.History}],R=new Set(A.map(function(e){return e.id}));exports.default=function(r){var w,O=this,I=r.userDetails,q=r.llmStudioUrl,N=r.audacyBackendUrl,P=r.ilLabels,k=r.config,x=r.rbacConfig,D=r.auditLogConfig,U=r.app_integration_id,M=r.backwardCompatibility,B=void 0!==M&&M,G=s.useLearningTemplateStore(function(e){return e.selectedRuleSetId}),F=s.useLearningTemplateStore(function(e){return e.setSelectedRuleSetId}),Q=s.useLearningTemplateStore(function(e){return e.error}),Y=s.useLearningTemplateStore(function(e){return e.setError}),K=s.useLearningTemplateStore(function(e){return e.setStations}),H=s.useLearningTemplateStore(function(e){return e.scopeTreeData}),z=s.useLearningTemplateStore(function(e){return e.setScopeTreeData}),V=n.useState({isOpen:!1,type:"GLOBAL"}),W=V[0],J=V[1],X=n.useState(!1),Z=X[0],$=X[1],ee=n.useState(!1),te=ee[0],ne=ee[1],re=n.useState("learnings"),se=re[0],ae=re[1],ie=n.useState(null),oe=ie[0],le=ie[1],ue=n.useState(null),ce=ue[0],de=ue[1],pe=n.useRef(null),ge=n.useRef(null),fe=n.useRef(null),Se=u.default();Se.user;var me=Se.setUser,ve=m.useConfigStore(),he=ve.setConfig,_e=ve.setIlLabels,ye=e.__spreadArray([{type:"GLOBAL",label:"Global",addChildLabel:"Add Scope",addChildType:"SCOPE"},e.__assign({type:"SCOPE",label:"Scope"},!B&&{addChildLabel:"Add Subscope",addChildType:"SUBSCOPE"})],B?[]:[{type:"SUBSCOPE",label:"Subscope"}],!0),Te=function(){try{return C.useLocation()}catch(e){return{search:""}}}();n.useEffect(function(){var e=new URLSearchParams(window.location.search),t=e.get(d.QUERY_PARAM_KEYS.RULESET_ID),n=e.get(d.QUERY_PARAM_KEYS.SECTION),r=n&&R.has(n)?n:"learnings";(null==t?void 0:t.length)&&F&&ae&&(F(t),ae(r))},[null==Te?void 0:Te.search,ae,F]);var be=_.usePermissionsStore(function(e){return e.fetchPermissions}),Ce=_.usePermissionsStore(function(e){return e.hasPermission}),Le=y.useAppSecRolesStore(function(e){return e.setRoles}),je=S.default(function(e){return e.appsecRbacUrl})===x.appsecRbacUrl,Ee=T.useGetAppSecRolesQuery(x.applicationId,je).data;n.useEffect(function(){Ee&&Le(Ee.map(function(e){return{_id:e._id,name:e.name}}))},[Ee,Le]),n.useEffect(function(){var e;console.log("userDetails",I),me(I),console.log("llmStudioUrl",q),console.log("audacyBackendUrl",N),S.default.getState().setLlmStudioUrl(q),S.default.getState().setAudacyBackendUrl(N),S.default.getState().setRbacConfig(x),S.default.getState().setAuditLogConfig(D),he(k),_e(P),s.useLearningTemplateStore.getState().setAppIntegrationId(null!=U?U:null),s.useLearningTemplateStore.getState().setBackwardCompatibility(B),s.useLearningTemplateStore.getState().setToken(null!==(e=I.accessToken)&&void 0!==e?e:null)},[I,me,q,N,x,D,k,he,P,_e,U,B]),n.useEffect(function(){(null==I?void 0:I.accessToken)&&q&&c.fetchTiers()},[U,null==I?void 0:I.accessToken,q]);var Ae=function(t){return void 0===t&&(t=!0),e.__awaiter(O,void 0,void 0,function(){var n,r,a,i,o,l;return e.__generator(this,function(u){switch(u.label){case 0:t&&$(!0),Y(null),u.label=1;case 1:return u.trys.push([1,4,5,6]),[4,be(x.applicationId)];case 2:return u.sent(),n=function(t){if(!_.usePermissionsStore.getState().hasPermission("ilotj.scope.view",t.id))return null;var r=t.children?t.children.map(function(e){return n(e)}).filter(function(e){return null!==e}):[];return e.__assign(e.__assign({},t),{children:r})},[4,c.fetchScopes(U,I.accessToken)];case 3:return(r=u.sent())&&r.data&&r.data.data&&(a=r.data.data,Array.isArray(a)&&(a=a.length>0?a[0]:null),a?(i=n(a))?(le(null),z({data:i}),ge.current?(F(ge.current),ae("learnings"),ge.current=null):s.useLearningTemplateStore.getState().selectedRuleSetId||F(i.id)):(le(null!==(l=a.id)&&void 0!==l?l:null),z(null)):(le(null),z(null))),[3,6];case 4:return o=u.sent(),console.error("Failed to fetch rule sets or permissions",o),Y("Failed to load data. Please try again later."),[3,6];case 5:return $(!1),[7];case 6:return[2]}})})};n.useEffect(function(){var e;(null===(e=null==I?void 0:I.accessToken)||void 0===e?void 0:e.length)&&je?Ae(!0):console.warn("Error: Trying to fetch rules without access token",I)},[null==I?void 0:I.accessToken,Y,K,x.applicationId,je]);var Re=function(n){return e.__awaiter(O,void 0,void 0,function(){var r,s,a,o;return e.__generator(this,function(l){switch(l.label){case 0:ne(!0),l.label=1;case 1:return l.trys.push([1,4,5,6]),W.scopeId?[4,c.renameScope({scope_id:W.scopeId,scope_name:n})]:[2];case 2:return l.sent(),[4,Ae(!0)];case 3:return l.sent(),J(function(t){return e.__assign(e.__assign({},t),{isOpen:!1})}),[3,6];case 4:throw r=l.sent(),console.error("An error occurred during scope rename.",r),null===(s=fe.current)||void 0===s||s.show({severity:"error",sticky:!1,className:i.default.errorToast,content:t.jsx(j.default,{message:(null===(o=null===(a=null==r?void 0:r.response)||void 0===a?void 0:a.data)||void 0===o?void 0:o.message)||"There was an error renaming the scope. Please try again."})}),r;case 5:return ne(!1),[7];case 6:return[2]}})})},we=function(t,n,r){return e.__awaiter(O,void 0,void 0,function(){var n,r,a,i,o,l,u,d;return e.__generator(this,function(p){switch(p.label){case 0:ne(!0),p.label=1;case 1:return p.trys.push([1,4,5,6]),[4,c.deleteRuleSet(t,I.accessToken)];case 2:return p.sent(),s.useLearningTemplateStore.getState().selectedRuleSetId===t&&(n=s.useLearningTemplateStore.getState().scopeTreeData,(r=f.findNodePathById((null==n?void 0:n.data)||null,t))&&r.length>1&&(a=r[r.length-2],F(a),ae("learnings"))),[4,Ae(!0)];case 3:return p.sent(),J(function(t){return e.__assign(e.__assign({},t),{isOpen:!1})}),null===(o=fe.current)||void 0===o||o.show({severity:"success",summary:"Deleted Successfully",detail:"The scope was permanently removed."}),[3,6];case 4:return i=p.sent(),console.error("An error occurred during scope deletion.",i),null===(l=fe.current)||void 0===l||l.show({severity:"error",summary:"Delete Failed",detail:(null===(d=null===(u=null==i?void 0:i.response)||void 0===u?void 0:u.data)||void 0===d?void 0:d.message)||"There was an error deleting the scope. Please try again."}),[3,6];case 5:return ne(!1),[7];case 6:return[2]}})})},Oe=H,Ie=ce?{data:{id:ce.stationId,name:ce.stationName,type:"STATION",metrics:{learningsCount:ce.learningsCount,stationsCount:0},children:[]}}:Oe,qe=!!(null==Ie?void 0:Ie.data);null===(w=null==Ie?void 0:Ie.data)||void 0===w||w.type;var Ne=_.usePermissionsStore(function(e){return e.hasGlobalPermission})("ilotj.scope.global.create",x.applicationResourceId||""),Pe=(ce?A.filter(function(e){return"stations"!==e.id}):A).filter(function(e){return!(!B&&"access"===e.id)});return t.jsx(v.TooltipProvider,{children:t.jsxs("div",e.__assign({className:i.default.learningManagementContainer},{children:[t.jsx("div",e.__assign({className:i.default.mainWrapper},{children:Z?t.jsx(g.default,{}):Q?t.jsxs("div",e.__assign({className:i.default.errorContainer},{children:[t.jsx("div",e.__assign({className:i.default.errorTitle},{children:"Error Loading Data"})),t.jsx("p",e.__assign({className:i.default.errorDesc},{children:Q})),t.jsx("button",e.__assign({onClick:function(){return Ae(!0)},className:i.default.tryAgainBtn},{children:"Try Again"}))]})):qe?t.jsx(o.default,{onOpenCreateModal:function(){return J({isOpen:!0,type:"GLOBAL"})},onAddChild:function(e,t,n){return J({isOpen:!0,type:t,parentId:e,parentName:n})},onRenameChild:function(e,t){return J({isOpen:!0,type:"RENAME",scopeId:e,initialName:t})},onDeleteChild:function(t,n,r){return e.__awaiter(O,void 0,void 0,function(){var a,i,o;return e.__generator(this,function(e){switch(e.label){case 0:return a=s.useLearningTemplateStore.getState().scopeTreeData,i=f.findNodePathById((null==a?void 0:a.data)||null,t),o=!!i&&3===i.length,0!==r?[3,2]:[4,we(t)];case 1:return e.sent(),[3,3];case 2:J({isOpen:!0,type:"DELETE",scopeId:t,initialName:n,isSubscope:o}),e.label=3;case 3:return[2]}})})},canDeleteScope:function(e){return Ce("ilotj.scope.delete",e)},canEditScope:function(e){return Ce("ilotj.scope.edit",e)},canCreateScope:function(e){return Ce("ilotj.scope.create",e)},onSectionSelect:function(e,t){var n;console.log("Section Selected:",{scopeId:e,sectionId:t}),d.setQueryParams(((n={})[d.QUERY_PARAM_KEYS.SECTION]="learnings"===t?null:t,n)),ae(t),F(e)},activeSectionId:se,scopeTreeData:Ie,sectionsConfig:Pe,onViewStation:function(e){pe.current=G,de(e),ae("learnings"),F(e.stationId)},onRefreshRuleSets:function(e,t){void 0===e&&(e=!0),t&&(ge.current=t),Ae(e)},nodeTypesConfig:ye,app_integration_id:U,token:I.accessToken}):t.jsx(l.default,{onCreate:function(){return J({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:Ne,noAccessTitle:"Access Restricted",noAccessDesc:"You do not have access to create a Global scope for this application.",onRequestAccess:function(){return e.__awaiter(O,void 0,void 0,function(){var n,r,a,o,l,u,d,p,g;return e.__generator(this,function(e){switch(e.label){case 0:if(!(n=(null===(o=null===(a=s.useLearningTemplateStore.getState().scopeTreeData)||void 0===a?void 0:a.data)||void 0===o?void 0:o.id)||oe))return null===(l=fe.current)||void 0===l||l.show({severity:"error",sticky:!1,className:i.default.errorToast,content:t.jsx(j.default,{message:"Unable to identify the global scope for this access request."})}),[2];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,c.requestAccess(n)];case 2:return e.sent(),null===(u=fe.current)||void 0===u||u.show({severity:"success",sticky:!1,life:3e3,className:i.default.successToast,content:t.jsx(L.default,{message:"Access request submitted successfully!"})}),[3,4];case 3:return r=e.sent(),null===(d=fe.current)||void 0===d||d.show({severity:"error",sticky:!1,className:i.default.errorToast,content:t.jsx(j.default,{message:(null===(g=null===(p=null==r?void 0:r.response)||void 0===p?void 0:p.data)||void 0===g?void 0:g.detail)||"Failed to request access. Please try again."})}),[3,4];case 4:return[2]}})})}})})),t.jsx(a.Toast,{ref:fe,pt:{root:{style:{zIndex:9999}}}}),B&&W.isOpen&&"DELETE"!==W.type&&"RENAME"!==W.type?t.jsx(h.default,{isOpen:!0,onClose:function(){return J(e.__assign(e.__assign({},W),{isOpen:!1}))},onSubmit:function(t){return e.__awaiter(O,void 0,void 0,function(){var n,r,a,i,o,l,u,d,p,g,f,S,m,v,h,_,y,T,b,C;return e.__generator(this,function(L){switch(L.label){case 0:ne(!0),n=s.useLearningTemplateStore.getState().backwardCompatibility,L.label=1;case 1:return L.trys.push([1,12,13,14]),r=void 0,n&&"object"==typeof t?r=t:(a=t,i="SCOPE"===W.type&&W.parentId,o=i?"genreRuleSet":W.type,r={topic:o,scope_reference_id:null,scopeDescription:"demo",parentScopeId:W.parentId||null,scopeName:a,scopeReferenceMetadata:{},applicationMappingId:U}),[4,c.createRuleSet(r,I.accessToken)];case 2:if(l=L.sent(),!(u=null===(v=null==l?void 0:l.data)||void 0===v?void 0:v.scopeId))return[3,10];if(ge.current=u,d=n&&(null===(h=r.topic)||void 0===h?void 0:h.toLowerCase().includes("genre")),p=!n&&"GLOBAL"!==W.type&&W.parentId,!d&&!p)return[3,10];if(!(g=n?null===(y=null===(_=s.useLearningTemplateStore.getState().scopeTreeData)||void 0===_?void 0:_.data)||void 0===y?void 0:y.id:W.parentId))return[3,10];if(!B)return[3,7];L.label=3;case 3:return L.trys.push([3,5,,6]),[4,c.inheritScopeBackwardCompatible({source_scope_id:g,target_scope_id:u})];case 4:return L.sent(),[3,6];case 5:return f=L.sent(),console.error("Failed to inherit rules for the new scope:",f),[3,6];case 6:return[3,10];case 7:return L.trys.push([7,9,,10]),[4,c.inheritScope({source_scope_id:g,target_scope_id:u,application_mapping_id:U||"",is_copy_parent_variant_id:!1})];case 8:return L.sent(),[3,10];case 9:return S=L.sent(),console.error("Failed to inherit rules for the new scope:",S),[3,10];case 10:return[4,Ae(!0)];case 11:return L.sent(),J(function(t){return e.__assign(e.__assign({},t),{isOpen:!1})}),[3,14];case 12:throw m=L.sent(),console.error("An error occurred during scope creation.",m),null===(T=fe.current)||void 0===T||T.show({severity:"error",summary:"Creation Failed",detail:(null===(C=null===(b=null==m?void 0:m.response)||void 0===b?void 0:b.data)||void 0===C?void 0:C.message)||"There was an error creating the scope. Please try again."}),m;case 13:return ne(!1),[7];case 14:return[2]}})})},hasGlobalRuleSet:qe,canCreateGlobal:Ne}):t.jsxs(t.Fragment,{children:[t.jsx(b.default,{isOpen:W.isOpen&&"DELETE"!==W.type&&"RENAME"!==W.type,onClose:function(){return J(e.__assign(e.__assign({},W),{isOpen:!1}))},onCreate:function(e){return Re(null!=e?e:"")},hasGlobalRuleSet:qe}),t.jsx(E.default,{isOpen:W.isOpen&&"RENAME"===W.type,onClose:function(){return J(e.__assign(e.__assign({},W),{isOpen:!1}))},onSave:Re,initialName:W.initialName})]}),t.jsx(p.default,{isOpen:W.isOpen&&"DELETE"===W.type,onCancel:function(){return J(e.__assign(e.__assign({},W),{isOpen:!1}))},onConfirm:function(){return we(W.scopeId,W.initialName,W.isSubscope)},title:"Delete Scope",description:t.jsxs(t.Fragment,{children:["Deleting ",t.jsx("span",e.__assign({className:i.default.highlight},{children:W.initialName||"this scope"}))," will permanently remove all Learnings, Access rules, and Change History inside it. This cannot be undone."]}),confirmText:"Delete",confirmBgColor:"#EF4444",isLoading:te})]}))})};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("react"),r=require("lucide-react"),s=require("./store/useLearningTemplateStore.js"),a=require("primereact/toast"),i=require("./styles/LearningTemplateManagement.module.css.js"),o=require("./LearningTemplateLayout.js"),l=require("./components/EmptyLearningState.js"),u=require("./store/useAuthStore.js"),c=require("./apis/scopeApis.js"),d=require("./hooks/useLearningTemplateQueryParams.js"),p=require("./components/ConfirmationModal.js"),g=require("./components/LearningTemplateManagementSkeleton.js"),f=require("./utils/treeUtils.js"),S=require("./store/useEnvStore.js"),m=require("./store/useConfigStore.js"),v=require("./components/ToolTip.js"),_=require("./components/CreateRuleSetLegacyModal.js"),h=require("./store/usePermissionsStore.js"),y=require("./store/useAppSecRolesStore.js"),T=require("./queries/useApprovalQueries.js"),b=require("./RuleContent/AddScopeModal.js"),C=require("react-router-dom"),L=require("./shared/SuccessToastContent.js"),E=require("./shared/ErrorToastContent.js"),j=require("./RuleContent/RenameScopeModal.js"),A=[{id:"learnings",label:"Learnings",icon:r.BookOpen,badgeKey:"learningsCount"},{id:"access",label:"Access",icon:r.Users},{id:"history",label:"Change History",icon:r.History}],R=new Set(A.map(function(e){return e.id}));exports.default=function(r){var w,I,O,q=this,N=r.userDetails,P=r.llmStudioUrl,k=r.audacyBackendUrl,x=r.ilLabels,D=r.config,U=r.rbacConfig,M=r.auditLogConfig,B=r.app_integration_id,G=r.backwardCompatibility,F=void 0!==G&&G,Y=s.useLearningTemplateStore(function(e){return e.selectedRuleSetId}),Q=s.useLearningTemplateStore(function(e){return e.setSelectedRuleSetId}),K=s.useLearningTemplateStore(function(e){return e.error}),H=s.useLearningTemplateStore(function(e){return e.setError}),z=s.useLearningTemplateStore(function(e){return e.setStations}),V=s.useLearningTemplateStore(function(e){return e.scopeTreeData}),W=s.useLearningTemplateStore(function(e){return e.setScopeTreeData}),J=n.useState({isOpen:!1,type:"GLOBAL"}),X=J[0],Z=J[1],$=n.useState(!1),ee=$[0],te=$[1],ne=n.useState(!1),re=ne[0],se=ne[1],ae=n.useState("learnings"),ie=ae[0],oe=ae[1],le=n.useState(null),ue=le[0],ce=le[1],de=n.useState(null),pe=de[0],ge=de[1],fe=n.useRef(null),Se=n.useRef(null),me=n.useRef(!1),ve=n.useRef(null),_e=u.default();_e.user;var he=_e.setUser,ye=m.useConfigStore(),Te=ye.setConfig,be=ye.setIlLabels,Ce=e.__spreadArray([{type:"GLOBAL",label:"Global",addChildLabel:"Add Scope",addChildType:"SCOPE"},e.__assign({type:"SCOPE",label:"Scope"},!F&&{addChildLabel:"Add Subscope",addChildType:"SUBSCOPE"})],F?[]:[{type:"SUBSCOPE",label:"Subscope"}],!0),Le=function(){try{return C.useLocation()}catch(e){return{search:""}}}();n.useEffect(function(){if(!me.current){var e=new URLSearchParams(window.location.search),t=e.get(d.QUERY_PARAM_KEYS.RULESET_ID),n=e.get(d.QUERY_PARAM_KEYS.SECTION),r=n&&R.has(n)?n:"learnings";(null==t?void 0:t.length)&&Q&&oe&&(Q(t),oe(r),me.current=!0)}},[null==Le?void 0:Le.search,oe,Q]);var Ee=h.usePermissionsStore(function(e){return e.fetchPermissions}),je=h.usePermissionsStore(function(e){return e.hasPermission}),Ae=y.useAppSecRolesStore(function(e){return e.setRoles}),Re=S.default(function(e){return e.appsecRbacUrl})===U.appsecRbacUrl,we=T.useGetAppSecRolesQuery(U.applicationId,Re).data;n.useEffect(function(){we&&Ae(we.map(function(e){return{_id:e._id,name:e.name}}))},[we,Ae]),n.useEffect(function(){var e;console.log("userDetails",N),he(N),console.log("llmStudioUrl",P),console.log("audacyBackendUrl",k),S.default.getState().setLlmStudioUrl(P),S.default.getState().setAudacyBackendUrl(k),S.default.getState().setRbacConfig(U),S.default.getState().setAuditLogConfig(M),Te(D),be(x),s.useLearningTemplateStore.getState().setAppIntegrationId(null!=B?B:null),s.useLearningTemplateStore.getState().setBackwardCompatibility(F),s.useLearningTemplateStore.getState().setToken(null!==(e=N.accessToken)&&void 0!==e?e:null)},[N,he,P,k,U,M,D,Te,x,be,B,F]),n.useEffect(function(){(null==N?void 0:N.accessToken)&&P&&c.fetchTiers()},[B,null==N?void 0:N.accessToken,P]);var Ie=function(t){return void 0===t&&(t=!0),e.__awaiter(q,void 0,void 0,function(){var n,r,a,i,o,l;return e.__generator(this,function(u){switch(u.label){case 0:t&&te(!0),H(null),u.label=1;case 1:return u.trys.push([1,4,5,6]),[4,Ee(U.applicationId)];case 2:return u.sent(),n=function(t){if(!h.usePermissionsStore.getState().hasPermission("ilotj.scope.view",t.id))return null;var r=t.children?t.children.map(function(e){return n(e)}).filter(function(e){return null!==e}):[];return e.__assign(e.__assign({},t),{children:r})},[4,c.fetchScopes(B,N.accessToken)];case 3:return(r=u.sent())&&r.data&&r.data.data&&(a=r.data.data,Array.isArray(a)&&(a=a.length>0?a[0]:null),a?(i=n(a))?(ce(null),W({data:i}),Se.current?(Q(Se.current),oe("learnings"),Se.current=null):s.useLearningTemplateStore.getState().selectedRuleSetId||Q(i.id)):(ce(null!==(l=a.id)&&void 0!==l?l:null),W(null)):(ce(null),W(null))),[3,6];case 4:return o=u.sent(),console.error("Failed to fetch rule sets or permissions",o),H("Failed to load data. Please try again later."),[3,6];case 5:return te(!1),[7];case 6:return[2]}})})};n.useEffect(function(){var e;(null===(e=null==N?void 0:N.accessToken)||void 0===e?void 0:e.length)&&Re?Ie(!0):console.warn("Error: Trying to fetch rules without access token",N)},[null==N?void 0:N.accessToken,H,z,U.applicationId,Re]);var Oe=function(n){return e.__awaiter(q,void 0,void 0,function(){var r,s,a,o;return e.__generator(this,function(l){switch(l.label){case 0:se(!0),l.label=1;case 1:return l.trys.push([1,4,5,6]),X.scopeId?[4,c.renameScope({scope_id:X.scopeId,scope_name:n})]:[2];case 2:return l.sent(),[4,Ie(!0)];case 3:return l.sent(),Z(function(t){return e.__assign(e.__assign({},t),{isOpen:!1})}),[3,6];case 4:throw r=l.sent(),console.error("An error occurred during scope rename.",r),null===(s=ve.current)||void 0===s||s.show({severity:"error",sticky:!1,className:i.default.errorToast,content:t.jsx(E.default,{message:(null===(o=null===(a=null==r?void 0:r.response)||void 0===a?void 0:a.data)||void 0===o?void 0:o.message)||"There was an error renaming the scope. Please try again."})}),r;case 5:return se(!1),[7];case 6:return[2]}})})},qe=function(t,n,r){return e.__awaiter(q,void 0,void 0,function(){var n,r,a,i,o,l,u,d;return e.__generator(this,function(p){switch(p.label){case 0:se(!0),p.label=1;case 1:return p.trys.push([1,4,5,6]),[4,c.deleteRuleSet(t,N.accessToken)];case 2:return p.sent(),s.useLearningTemplateStore.getState().selectedRuleSetId===t&&(n=s.useLearningTemplateStore.getState().scopeTreeData,(r=f.findNodePathById((null==n?void 0:n.data)||null,t))&&r.length>1&&(a=r[r.length-2],Q(a),oe("learnings"))),[4,Ie(!0)];case 3:return p.sent(),Z(function(t){return e.__assign(e.__assign({},t),{isOpen:!1})}),null===(o=ve.current)||void 0===o||o.show({severity:"success",summary:"Deleted Successfully",detail:"The scope was permanently removed."}),[3,6];case 4:return i=p.sent(),console.error("An error occurred during scope deletion.",i),null===(l=ve.current)||void 0===l||l.show({severity:"error",summary:"Delete Failed",detail:(null===(d=null===(u=null==i?void 0:i.response)||void 0===u?void 0:u.data)||void 0===d?void 0:d.message)||"There was an error deleting the scope. Please try again."}),[3,6];case 5:return se(!1),[7];case 6:return[2]}})})},Ne=V,Pe=pe?{data:{id:pe.stationId,name:pe.stationName,type:"STATION",metrics:{learningsCount:pe.learningsCount,stationsCount:0},children:[]}}:Ne,ke=!!(null==Pe?void 0:Pe.data);null===(w=null==Pe?void 0:Pe.data)||void 0===w||w.type;var xe=h.usePermissionsStore(function(e){return e.hasGlobalPermission})("ilotj.scope.global.create",U.applicationResourceId||""),De=(pe?A.filter(function(e){return"stations"!==e.id}):A).filter(function(e){return!(!F&&"access"===e.id)});return t.jsx(v.TooltipProvider,{children:t.jsxs("div",e.__assign({className:i.default.learningManagementContainer},{children:[t.jsx("div",e.__assign({className:i.default.mainWrapper},{children:ee?t.jsx(g.default,{}):K?t.jsxs("div",e.__assign({className:i.default.errorContainer},{children:[t.jsx("div",e.__assign({className:i.default.errorTitle},{children:"Error Loading Data"})),t.jsx("p",e.__assign({className:i.default.errorDesc},{children:K})),t.jsx("button",e.__assign({onClick:function(){return Ie(!0)},className:i.default.tryAgainBtn},{children:"Try Again"}))]})):ke?t.jsx(o.default,{onOpenCreateModal:function(){return Z({isOpen:!0,type:"GLOBAL"})},onAddChild:function(e,t,n){return Z({isOpen:!0,type:t,parentId:e,parentName:n})},onRenameChild:function(e,t){return Z({isOpen:!0,type:"RENAME",scopeId:e,initialName:t})},onDeleteChild:function(t,n,r){return e.__awaiter(q,void 0,void 0,function(){var a,i,o;return e.__generator(this,function(e){switch(e.label){case 0:return a=s.useLearningTemplateStore.getState().scopeTreeData,i=f.findNodePathById((null==a?void 0:a.data)||null,t),o=!!i&&3===i.length,0!==r?[3,2]:[4,qe(t)];case 1:return e.sent(),[3,3];case 2:Z({isOpen:!0,type:"DELETE",scopeId:t,initialName:n,isSubscope:o}),e.label=3;case 3:return[2]}})})},canDeleteScope:function(e){return je("ilotj.scope.delete",e)},canEditScope:function(e){return je("ilotj.scope.edit",e)},canCreateScope:function(e){return je("ilotj.scope.create",e)},onSectionSelect:function(e,t){var n;console.log("Section Selected:",{scopeId:e,sectionId:t}),d.setQueryParams(((n={})[d.QUERY_PARAM_KEYS.SECTION]="learnings"===t?null:t,n[d.QUERY_PARAM_KEYS.RULESET_ID]=e,n)),oe(t),Q(e)},activeSectionId:ie,scopeTreeData:Pe,sectionsConfig:De,onViewStation:function(e){fe.current=Y,ge(e),oe("learnings"),Q(e.stationId)},onRefreshRuleSets:function(e,t){void 0===e&&(e=!0),t&&(Se.current=t),Ie(e)},nodeTypesConfig:Ce,app_integration_id:B,token:N.accessToken}):t.jsx(l.default,{onCreate:function(){return Z({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:xe,noAccessTitle:"Access Restricted",noAccessDesc:"You do not have access to create a Global scope for this application.",onRequestAccess:function(){return e.__awaiter(q,void 0,void 0,function(){var n,r,a,o,l,u,d,p,g;return e.__generator(this,function(e){switch(e.label){case 0:if(!(n=(null===(o=null===(a=s.useLearningTemplateStore.getState().scopeTreeData)||void 0===a?void 0:a.data)||void 0===o?void 0:o.id)||ue))return null===(l=ve.current)||void 0===l||l.show({severity:"error",sticky:!1,className:i.default.errorToast,content:t.jsx(E.default,{message:"Unable to identify the global scope for this access request."})}),[2];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,c.requestAccess(n)];case 2:return e.sent(),null===(u=ve.current)||void 0===u||u.show({severity:"success",sticky:!1,life:3e3,className:i.default.successToast,content:t.jsx(L.default,{message:"Access request submitted successfully!"})}),[3,4];case 3:return r=e.sent(),null===(d=ve.current)||void 0===d||d.show({severity:"error",sticky:!1,className:i.default.errorToast,content:t.jsx(E.default,{message:(null===(g=null===(p=null==r?void 0:r.response)||void 0===p?void 0:p.data)||void 0===g?void 0:g.detail)||"Failed to request access. Please try again."})}),[3,4];case 4:return[2]}})})}})})),t.jsx(a.Toast,{ref:ve,pt:{root:{style:{zIndex:9999}}}}),F&&X.isOpen&&"DELETE"!==X.type&&"RENAME"!==X.type?t.jsx(_.default,{isOpen:!0,onClose:function(){return Z(e.__assign(e.__assign({},X),{isOpen:!1}))},onSubmit:function(t){return e.__awaiter(q,void 0,void 0,function(){var n,r,a,i,o,l,u,d,p,g,f,S,m,v,_,h,y,T,b,C;return e.__generator(this,function(L){switch(L.label){case 0:se(!0),n=s.useLearningTemplateStore.getState().backwardCompatibility,L.label=1;case 1:return L.trys.push([1,12,13,14]),r=void 0,n&&"object"==typeof t?r=t:(a=t,i="SCOPE"===X.type&&X.parentId,o=i?"genreRuleSet":X.type,r={topic:o,scope_reference_id:null,scopeDescription:"demo",parentScopeId:X.parentId||null,scopeName:a,scopeReferenceMetadata:{},applicationMappingId:B}),[4,c.createRuleSet(r,N.accessToken)];case 2:if(l=L.sent(),!(u=null===(v=null==l?void 0:l.data)||void 0===v?void 0:v.scopeId))return[3,10];if(Se.current=u,d=n&&(null===(_=r.topic)||void 0===_?void 0:_.toLowerCase().includes("genre")),p=!n&&"GLOBAL"!==X.type&&X.parentId,!d&&!p)return[3,10];if(!(g=n?null===(y=null===(h=s.useLearningTemplateStore.getState().scopeTreeData)||void 0===h?void 0:h.data)||void 0===y?void 0:y.id:X.parentId))return[3,10];if(!F)return[3,7];L.label=3;case 3:return L.trys.push([3,5,,6]),[4,c.inheritScopeBackwardCompatible({source_scope_id:g,target_scope_id:u})];case 4:return L.sent(),[3,6];case 5:return f=L.sent(),console.error("Failed to inherit rules for the new scope:",f),[3,6];case 6:return[3,10];case 7:return L.trys.push([7,9,,10]),[4,c.inheritScope({source_scope_id:g,target_scope_id:u,application_mapping_id:B||"",is_copy_parent_variant_id:!1})];case 8:return L.sent(),[3,10];case 9:return S=L.sent(),console.error("Failed to inherit rules for the new scope:",S),[3,10];case 10:return[4,Ie(!0)];case 11:return L.sent(),Z(function(t){return e.__assign(e.__assign({},t),{isOpen:!1})}),[3,14];case 12:throw m=L.sent(),console.error("An error occurred during scope creation.",m),null===(T=ve.current)||void 0===T||T.show({severity:"error",summary:"Creation Failed",detail:(null===(C=null===(b=null==m?void 0:m.response)||void 0===b?void 0:b.data)||void 0===C?void 0:C.message)||"There was an error creating the scope. Please try again."}),m;case 13:return se(!1),[7];case 14:return[2]}})})},hasGlobalRuleSet:ke,canCreateGlobal:xe,globalScopeId:null!==(O=null===(I=null==V?void 0:V.data)||void 0===I?void 0:I.id)&&void 0!==O?O:null}):t.jsxs(t.Fragment,{children:[t.jsx(b.default,{isOpen:X.isOpen&&"DELETE"!==X.type&&"RENAME"!==X.type,onClose:function(){return Z(e.__assign(e.__assign({},X),{isOpen:!1}))},onCreate:function(e){return Oe(null!=e?e:"")},hasGlobalRuleSet:ke}),t.jsx(j.default,{isOpen:X.isOpen&&"RENAME"===X.type,onClose:function(){return Z(e.__assign(e.__assign({},X),{isOpen:!1}))},onSave:Oe,initialName:X.initialName})]}),t.jsx(p.default,{isOpen:X.isOpen&&"DELETE"===X.type,onCancel:function(){return Z(e.__assign(e.__assign({},X),{isOpen:!1}))},onConfirm:function(){return qe(X.scopeId,X.initialName,X.isSubscope)},title:"Delete Scope",description:t.jsxs(t.Fragment,{children:["Deleting ",t.jsx("span",e.__assign({className:i.default.highlight},{children:X.initialName||"this scope"}))," will permanently remove all Learnings, Access rules, and Change History inside it. This cannot be undone."]}),confirmText:"Delete",confirmBgColor:"#EF4444",isLoading:re})]}))})};
|
|
2
2
|
//# sourceMappingURL=LearningManagement.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("react");exports.default="data:image/svg+xml,%3Csvg%20width%3D%22160%22%20height%3D%22153%22%20viewBox%3D%220%200%20160%20153%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M79.2744%20143.735C116.627%20143.735%20146.909%20113.508%20146.909%2076.223C146.909%2038.9359%20116.627%208.71106%2079.2744%208.71106C41.9192%208.71106%2011.6367%2038.9359%2011.6367%2076.223C11.6367%20113.508%2041.9192%20143.735%2079.2744%20143.735Z%22%20fill%3D%22%23F8FAFC%22%2F%3E%3Cpath%20d%3D%22M116.902%2030.8984H43.3269C38.7417%2030.8984%2035.0234%2034.7993%2035.0234%2039.6097H125.205C125.205%2034.7993%20121.489%2030.8984%20116.902%2030.8984Z%22%20fill%3D%22%23D0D9E4%22%2F%3E%3Cpath%20d%3D%22M35.0234%2039.6094H125.205V109.239C125.205%20112.335%20123.994%20115.304%20121.834%20117.494C119.674%20119.684%20116.745%20120.914%20113.692%20120.914H46.5394C43.4834%20120.914%2040.555%20119.684%2038.3973%20117.494C36.2372%20115.304%2035.0234%20112.335%2035.0234%20109.239V39.6094Z%22%20fill%3D%22%23F1F5F9%22%2F%3E%3Cpath%20d%3D%22M125.155%2039.6592V109.239C125.155%20112.322%20123.949%20115.279%20121.798%20117.459C119.647%20119.639%20116.731%20120.864%20113.691%20120.864H46.5391C43.4967%20120.864%2040.5809%20119.639%2038.4326%20117.459C36.2818%20115.279%2035.0732%20112.322%2035.0732%20109.239V39.6592H125.155Z%22%20stroke%3D%22%2364748B%22%20stroke-opacity%3D%220.1%22%20stroke-width%3D%220.1%22%2F%3E%3Cpath%20d%3D%22M70.571%2048.3203H48.9307C48.4799%2048.3203%2048.1133%2049.295%2048.1133%2050.4981C48.1133%2051.7012%2048.4799%2052.6759%2048.9307%2052.6759H70.571C71.0218%2052.6759%2071.386%2051.7012%2071.386%2050.4981C71.386%2049.295%2071.0218%2048.3203%2070.571%2048.3203Z%22%20fill%3D%22url%28%23paint0_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M70.571%2067.1953H48.9307C48.4799%2067.1953%2048.1133%2068.17%2048.1133%2069.3731C48.1133%2070.5762%2048.4799%2071.5509%2048.9307%2071.5509H70.571C71.0218%2071.5509%2071.386%2070.5762%2071.386%2069.3731C71.386%2068.17%2071.0218%2067.1953%2070.571%2067.1953Z%22%20fill%3D%22url%28%23paint1_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M70.571%2086.0703H48.9307C48.4799%2086.0703%2048.1133%2087.0468%2048.1133%2088.2493C48.1133%2089.4517%2048.4799%2090.4259%2048.9307%2090.4259H70.571C71.0218%2090.4259%2071.386%2089.4517%2071.386%2088.2493C71.386%2087.0468%2071.0218%2086.0703%2070.571%2086.0703Z%22%20fill%3D%22url%28%23paint2_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M70.571%20104.945H48.9307C48.4799%20104.945%2048.1133%20105.922%2048.1133%20107.124C48.1133%20108.327%2048.4799%20109.301%2048.9307%20109.301H70.571C71.0218%20109.301%2071.386%20108.327%2071.386%20107.124C71.386%20105.922%2071.0218%20104.945%2070.571%20104.945Z%22%20fill%3D%22url%28%23paint3_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M116.507%2048.3203H78.6367C77.8481%2048.3203%2077.207%2049.295%2077.207%2050.4981C77.207%2051.7012%2077.8481%2052.6759%2078.6367%2052.6759H116.507C117.296%2052.6759%20117.934%2051.7012%20117.934%2050.4981C117.934%2049.295%20117.296%2048.3203%20116.507%2048.3203Z%22%20fill%3D%22url%28%23paint4_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M116.507%2086.0703H78.6367C77.8481%2086.0703%2077.207%2087.045%2077.207%2088.2481C77.207%2089.4512%2077.8481%2090.4259%2078.6367%2090.4259H116.507C117.296%2090.4259%20117.934%2089.4512%20117.934%2088.2481C117.934%2087.045%20117.296%2086.0703%20116.507%2086.0703Z%22%20fill%3D%22url%28%23paint5_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M116.507%2067.1953H78.6367C77.8481%2067.1953%2077.207%2068.17%2077.207%2069.3731C77.207%2070.5762%2077.8481%2071.5509%2078.6367%2071.5509H116.507C117.296%2071.5509%20117.934%2070.5762%20117.934%2069.3731C117.934%2068.17%20117.296%2067.1953%20116.507%2067.1953Z%22%20fill%3D%22url%28%23paint6_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M116.507%20104.945H78.6367C77.8481%20104.945%2077.207%20105.92%2077.207%20107.123C77.207%20108.326%2077.8481%20109.301%2078.6367%20109.301H116.507C117.296%20109.301%20117.934%20108.326%20117.934%20107.123C117.934%20105.92%20117.296%20104.945%20116.507%20104.945Z%22%20fill%3D%22url%28%23paint7_linear_1020_82405%29%22%2F%3E%3CforeignObject%20x%3D%2270.7116%22%20y%3D%2260.6843%22%20width%3D%2279.8961%22%20height%3D%2279.81%22%3E%3Cdiv%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%22%20style%3D%22backdrop-filter%3Ablur%288.34px%29%3Bclip-path%3Aurl%28%23bgblur_0_1020_82405_clip_path%29%3Bheight%3A100%25%3Bwidth%3A100%25%22%3E%3C%2Fdiv%3E%3C%2FforeignObject%3E%3Cpath%20data-figma-bg-blur-radius%3D%2216.6751%22%20d%3D%22M110.659%20123.819C123.513%20123.819%20133.932%20113.419%20133.932%20100.589C133.932%2087.7597%20123.513%2077.3594%20110.659%2077.3594C97.8062%2077.3594%2087.3867%2087.7597%2087.3867%20100.589C87.3867%20113.419%2097.8062%20123.819%20110.659%20123.819Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M110.659%2085.3419C111.63%2085.3458%20112.413%2086.1299%20112.411%2087.0961L112.395%2098.2651L123.584%2098.2817C124.555%2098.2856%20125.338%2099.0696%20125.339%20100.038C125.335%20101.007%20124.55%20101.789%20123.579%20101.79L112.39%20101.773L112.373%20112.942C112.372%20113.908%20111.586%20114.69%20110.615%20114.691C109.645%20114.687%20108.862%20113.903%20108.861%20112.935L108.877%20101.766L97.6878%20101.749C96.7198%20101.748%2095.9366%20100.964%2095.9355%2099.9948C95.9395%2099.0261%2096.725%2098.2443%2097.693%2098.2458L108.883%2098.2623L108.899%2087.0934C108.903%2086.1247%20109.689%2085.3429%20110.659%2085.3419Z%22%20fill%3D%22%23CBD5E1%22%2F%3E%3Cdefs%3E%3CclipPath%20id%3D%22bgblur_0_1020_82405_clip_path%22%20transform%3D%22translate%28-70.7116%20-60.6843%29%22%3E%3Cpath%20d%3D%22M110.659%20123.819C123.513%20123.819%20133.932%20113.419%20133.932%20100.589C133.932%2087.7597%20123.513%2077.3594%20110.659%2077.3594C97.8062%2077.3594%2087.3867%2087.7597%2087.3867%20100.589C87.3867%20113.419%2097.8062%20123.819%20110.659%20123.819Z%22%2F%3E%3C%2FclipPath%3E%3ClinearGradient%20id%3D%22paint0_linear_1020_82405%22%20x1%3D%2247.1291%22%20y1%3D%2252.497%22%20x2%3D%2272.7628%22%20y2%3D%2252.497%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint1_linear_1020_82405%22%20x1%3D%2247.1291%22%20y1%3D%2271.372%22%20x2%3D%2272.7628%22%20y2%3D%2271.372%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint2_linear_1020_82405%22%20x1%3D%2247.1291%22%20y1%3D%2290.247%22%20x2%3D%2272.7628%22%20y2%3D%2290.247%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint3_linear_1020_82405%22%20x1%3D%2247.1291%22%20y1%3D%22109.122%22%20x2%3D%2272.7628%22%20y2%3D%22109.122%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint4_linear_1020_82405%22%20x1%3D%2275.4847%22%20y1%3D%2252.497%22%20x2%3D%22120.344%22%20y2%3D%2252.497%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint5_linear_1020_82405%22%20x1%3D%2275.4847%22%20y1%3D%2290.247%22%20x2%3D%22120.344%22%20y2%3D%2290.247%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint6_linear_1020_82405%22%20x1%3D%2275.4847%22%20y1%3D%2271.372%22%20x2%3D%22120.344%22%20y2%3D%2271.372%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint7_linear_1020_82405%22%20x1%3D%2275.4847%22%20y1%3D%22109.122%22%20x2%3D%22120.344%22%20y2%3D%22109.122%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3C%2Fsvg%3E";
|
|
2
|
+
//# sourceMappingURL=Search-result(add new).svg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Search-result(add new).svg.js","sources":["../../../../../src/features/LearningManagement/assets/Search-result(add new).svg"],"sourcesContent":["export default \"data:image/svg+xml,%3Csvg%20width%3D%22160%22%20height%3D%22153%22%20viewBox%3D%220%200%20160%20153%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M79.2744%20143.735C116.627%20143.735%20146.909%20113.508%20146.909%2076.223C146.909%2038.9359%20116.627%208.71106%2079.2744%208.71106C41.9192%208.71106%2011.6367%2038.9359%2011.6367%2076.223C11.6367%20113.508%2041.9192%20143.735%2079.2744%20143.735Z%22%20fill%3D%22%23F8FAFC%22%2F%3E%3Cpath%20d%3D%22M116.902%2030.8984H43.3269C38.7417%2030.8984%2035.0234%2034.7993%2035.0234%2039.6097H125.205C125.205%2034.7993%20121.489%2030.8984%20116.902%2030.8984Z%22%20fill%3D%22%23D0D9E4%22%2F%3E%3Cpath%20d%3D%22M35.0234%2039.6094H125.205V109.239C125.205%20112.335%20123.994%20115.304%20121.834%20117.494C119.674%20119.684%20116.745%20120.914%20113.692%20120.914H46.5394C43.4834%20120.914%2040.555%20119.684%2038.3973%20117.494C36.2372%20115.304%2035.0234%20112.335%2035.0234%20109.239V39.6094Z%22%20fill%3D%22%23F1F5F9%22%2F%3E%3Cpath%20d%3D%22M125.155%2039.6592V109.239C125.155%20112.322%20123.949%20115.279%20121.798%20117.459C119.647%20119.639%20116.731%20120.864%20113.691%20120.864H46.5391C43.4967%20120.864%2040.5809%20119.639%2038.4326%20117.459C36.2818%20115.279%2035.0732%20112.322%2035.0732%20109.239V39.6592H125.155Z%22%20stroke%3D%22%2364748B%22%20stroke-opacity%3D%220.1%22%20stroke-width%3D%220.1%22%2F%3E%3Cpath%20d%3D%22M70.571%2048.3203H48.9307C48.4799%2048.3203%2048.1133%2049.295%2048.1133%2050.4981C48.1133%2051.7012%2048.4799%2052.6759%2048.9307%2052.6759H70.571C71.0218%2052.6759%2071.386%2051.7012%2071.386%2050.4981C71.386%2049.295%2071.0218%2048.3203%2070.571%2048.3203Z%22%20fill%3D%22url%28%23paint0_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M70.571%2067.1953H48.9307C48.4799%2067.1953%2048.1133%2068.17%2048.1133%2069.3731C48.1133%2070.5762%2048.4799%2071.5509%2048.9307%2071.5509H70.571C71.0218%2071.5509%2071.386%2070.5762%2071.386%2069.3731C71.386%2068.17%2071.0218%2067.1953%2070.571%2067.1953Z%22%20fill%3D%22url%28%23paint1_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M70.571%2086.0703H48.9307C48.4799%2086.0703%2048.1133%2087.0468%2048.1133%2088.2493C48.1133%2089.4517%2048.4799%2090.4259%2048.9307%2090.4259H70.571C71.0218%2090.4259%2071.386%2089.4517%2071.386%2088.2493C71.386%2087.0468%2071.0218%2086.0703%2070.571%2086.0703Z%22%20fill%3D%22url%28%23paint2_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M70.571%20104.945H48.9307C48.4799%20104.945%2048.1133%20105.922%2048.1133%20107.124C48.1133%20108.327%2048.4799%20109.301%2048.9307%20109.301H70.571C71.0218%20109.301%2071.386%20108.327%2071.386%20107.124C71.386%20105.922%2071.0218%20104.945%2070.571%20104.945Z%22%20fill%3D%22url%28%23paint3_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M116.507%2048.3203H78.6367C77.8481%2048.3203%2077.207%2049.295%2077.207%2050.4981C77.207%2051.7012%2077.8481%2052.6759%2078.6367%2052.6759H116.507C117.296%2052.6759%20117.934%2051.7012%20117.934%2050.4981C117.934%2049.295%20117.296%2048.3203%20116.507%2048.3203Z%22%20fill%3D%22url%28%23paint4_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M116.507%2086.0703H78.6367C77.8481%2086.0703%2077.207%2087.045%2077.207%2088.2481C77.207%2089.4512%2077.8481%2090.4259%2078.6367%2090.4259H116.507C117.296%2090.4259%20117.934%2089.4512%20117.934%2088.2481C117.934%2087.045%20117.296%2086.0703%20116.507%2086.0703Z%22%20fill%3D%22url%28%23paint5_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M116.507%2067.1953H78.6367C77.8481%2067.1953%2077.207%2068.17%2077.207%2069.3731C77.207%2070.5762%2077.8481%2071.5509%2078.6367%2071.5509H116.507C117.296%2071.5509%20117.934%2070.5762%20117.934%2069.3731C117.934%2068.17%20117.296%2067.1953%20116.507%2067.1953Z%22%20fill%3D%22url%28%23paint6_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M116.507%20104.945H78.6367C77.8481%20104.945%2077.207%20105.92%2077.207%20107.123C77.207%20108.326%2077.8481%20109.301%2078.6367%20109.301H116.507C117.296%20109.301%20117.934%20108.326%20117.934%20107.123C117.934%20105.92%20117.296%20104.945%20116.507%20104.945Z%22%20fill%3D%22url%28%23paint7_linear_1020_82405%29%22%2F%3E%3CforeignObject%20x%3D%2270.7116%22%20y%3D%2260.6843%22%20width%3D%2279.8961%22%20height%3D%2279.81%22%3E%3Cdiv%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%22%20style%3D%22backdrop-filter%3Ablur%288.34px%29%3Bclip-path%3Aurl%28%23bgblur_0_1020_82405_clip_path%29%3Bheight%3A100%25%3Bwidth%3A100%25%22%3E%3C%2Fdiv%3E%3C%2FforeignObject%3E%3Cpath%20data-figma-bg-blur-radius%3D%2216.6751%22%20d%3D%22M110.659%20123.819C123.513%20123.819%20133.932%20113.419%20133.932%20100.589C133.932%2087.7597%20123.513%2077.3594%20110.659%2077.3594C97.8062%2077.3594%2087.3867%2087.7597%2087.3867%20100.589C87.3867%20113.419%2097.8062%20123.819%20110.659%20123.819Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M110.659%2085.3419C111.63%2085.3458%20112.413%2086.1299%20112.411%2087.0961L112.395%2098.2651L123.584%2098.2817C124.555%2098.2856%20125.338%2099.0696%20125.339%20100.038C125.335%20101.007%20124.55%20101.789%20123.579%20101.79L112.39%20101.773L112.373%20112.942C112.372%20113.908%20111.586%20114.69%20110.615%20114.691C109.645%20114.687%20108.862%20113.903%20108.861%20112.935L108.877%20101.766L97.6878%20101.749C96.7198%20101.748%2095.9366%20100.964%2095.9355%2099.9948C95.9395%2099.0261%2096.725%2098.2443%2097.693%2098.2458L108.883%2098.2623L108.899%2087.0934C108.903%2086.1247%20109.689%2085.3429%20110.659%2085.3419Z%22%20fill%3D%22%23CBD5E1%22%2F%3E%3Cdefs%3E%3CclipPath%20id%3D%22bgblur_0_1020_82405_clip_path%22%20transform%3D%22translate%28-70.7116%20-60.6843%29%22%3E%3Cpath%20d%3D%22M110.659%20123.819C123.513%20123.819%20133.932%20113.419%20133.932%20100.589C133.932%2087.7597%20123.513%2077.3594%20110.659%2077.3594C97.8062%2077.3594%2087.3867%2087.7597%2087.3867%20100.589C87.3867%20113.419%2097.8062%20123.819%20110.659%20123.819Z%22%2F%3E%3C%2FclipPath%3E%3ClinearGradient%20id%3D%22paint0_linear_1020_82405%22%20x1%3D%2247.1291%22%20y1%3D%2252.497%22%20x2%3D%2272.7628%22%20y2%3D%2252.497%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint1_linear_1020_82405%22%20x1%3D%2247.1291%22%20y1%3D%2271.372%22%20x2%3D%2272.7628%22%20y2%3D%2271.372%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint2_linear_1020_82405%22%20x1%3D%2247.1291%22%20y1%3D%2290.247%22%20x2%3D%2272.7628%22%20y2%3D%2290.247%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint3_linear_1020_82405%22%20x1%3D%2247.1291%22%20y1%3D%22109.122%22%20x2%3D%2272.7628%22%20y2%3D%22109.122%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint4_linear_1020_82405%22%20x1%3D%2275.4847%22%20y1%3D%2252.497%22%20x2%3D%22120.344%22%20y2%3D%2252.497%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint5_linear_1020_82405%22%20x1%3D%2275.4847%22%20y1%3D%2290.247%22%20x2%3D%22120.344%22%20y2%3D%2290.247%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint6_linear_1020_82405%22%20x1%3D%2275.4847%22%20y1%3D%2271.372%22%20x2%3D%22120.344%22%20y2%3D%2271.372%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint7_linear_1020_82405%22%20x1%3D%2275.4847%22%20y1%3D%22109.122%22%20x2%3D%22120.344%22%20y2%3D%22109.122%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3C%2Fsvg%3E\""],"names":[],"mappings":"qGA0Ke"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),s=require("react/jsx-runtime"),a=require("react"),l=require("lucide-react"),i=require("../styles/CreateLearningSetModal.module.css.js");exports.default=function(n){var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),s=require("react/jsx-runtime"),a=require("react"),l=require("lucide-react"),i=require("../styles/CreateLearningSetModal.module.css.js");exports.default=function(n){var t=n.isOpen,r=n.onClose,c=n.onSubmit,d=n.title,u=n.description,o=n.inputLabel,_=n.submitLabel,f=n.placeholder,m=void 0===f?"":f,g=n.initialValue,h=void 0===g?"":g,v=n.isLoading,x=void 0!==v&&v,j=a.useState(""),p=j[0],b=j[1],N=a.useState(null),C=N[0],q=N[1];if(a.useEffect(function(){t&&(b(h),q(null))},[t,h]),!t)return null;return s.jsx("div",e.__assign({className:i.default.overlay},{children:s.jsxs("div",e.__assign({className:i.default.modal},{children:[s.jsxs("div",e.__assign({className:i.default.header},{children:[s.jsxs("div",e.__assign({className:i.default.headerContent},{children:[s.jsx("h2",e.__assign({className:i.default.title},{children:d})),u&&s.jsx("p",e.__assign({className:i.default.description},{children:u}))]})),s.jsx("button",e.__assign({onClick:r,className:i.default.closeBtn,disabled:x},{children:s.jsx(l.X,{size:24})}))]})),s.jsx("div",e.__assign({className:i.default.form},{children:s.jsxs("div",e.__assign({className:i.default.formGroup},{children:[s.jsxs("label",e.__assign({className:i.default.label},{children:[s.jsx("span",e.__assign({className:i.default.asterisk},{children:"*"})),o]})),s.jsx("input",{type:"text",value:p,onChange:function(e){b(e.target.value),C&&q(null)},className:"".concat(i.default.inputField," ").concat(C?i.default.inputError:""),placeholder:m,disabled:x}),C&&s.jsx("p",e.__assign({className:i.default.errorMessage},{children:C}))]}))})),s.jsxs("div",e.__assign({className:i.default.footer},{children:[s.jsx("button",e.__assign({onClick:r,className:i.default.cancelBtn,disabled:x},{children:"Cancel"})),s.jsx("button",e.__assign({onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var s;return e.__generator(this,function(e){switch(e.label){case 0:if(!(p.trim()?(q(null),1):(q("".concat(o.replace("*","").trim()," is required")),0)))return[2];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,c(p)];case 2:return e.sent(),r(),[3,4];case 3:return s=e.sent(),q((null==s?void 0:s.message)||"An error occurred. Please try again."),[3,4];case 4:return[2]}})})},className:i.default.confirmBtn,disabled:x},{children:x?s.jsxs(s.Fragment,{children:[s.jsx(l.Loader2,{className:i.default.spinner}),"Save"===_?"Saving...":"Creating..."]}):_}))]}))]}))}))};
|
|
2
2
|
//# sourceMappingURL=CreateLearningSetModal.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("react/jsx-runtime"),i=require("react"),n=require("uuid"),t=require("../config.js"),s=require("../store/useAuthStore.js"),o=require("../RuleContent/AddScopeApprovalSearchComponent.js"),a=require("../store/useAppSecRolesStore.js"),l=require("../store/useEnvStore.js"),p=require("./ScopeSkeletonLoader.js");exports.default=function(d){var u=d.isOpen,c=d.onClose,g=d.onSubmit,x=d.hasGlobalRuleSet,_=void 0!==x&&x;d.canCreateGlobal;var f=i.useState("");
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("react/jsx-runtime"),i=require("react"),n=require("uuid"),t=require("../config.js"),s=require("../store/useAuthStore.js"),o=require("../RuleContent/AddScopeApprovalSearchComponent.js"),a=require("../store/useAppSecRolesStore.js"),l=require("../store/useEnvStore.js"),p=require("./ScopeSkeletonLoader.js");exports.default=function(d){var u=d.isOpen,c=d.onClose,g=d.onSubmit,x=d.hasGlobalRuleSet,_=void 0!==x&&x;d.canCreateGlobal;var f=d.globalScopeId,h=void 0===f?null:f,v=i.useState("");v[0];var b=v[1],m=i.useState(""),y=m[0],S=m[1],j=i.useState(""),C=j[0],q=j[1],k=i.useState(!1),E=k[0],w=k[1],B=i.useState({}),D=B[0],R=B[1],A=i.useState("approval_required"),z=A[0],I=A[1],F=i.useState([]),G=F[0],L=F[1],N=i.useState([]),T=N[0],W=N[1],O=i.useState(""),P=O[0],M=O[1],H=s.default().user,K=a.useAppSecRolesStore(function(e){return e.roles}),U=l.default(function(e){return e.rbacConfig});if(i.useEffect(function(){u&&(b(""),S(""),q(""),R({}),I("approval_required"),L([]),W([]),M(""))},[u]),!u)return null;var Y={overlay:{position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:50,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0, 0, 0, 0.3)"},modal:{position:"relative",width:"600px",borderRadius:"12px",backgroundColor:"#ffffff",padding:"24px",boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.25)",maxHeight:"90vh",overflowY:"auto"},header:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:"24px"},title:{margin:0,fontSize:"18px",fontWeight:500,color:"#19213D"},subtitle:{marginTop:"4px",fontSize:"14px",fontWeight:400,color:"#666F8D"},closeButton:{background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"#9CA3AF"},formGroup:{display:"flex",flexDirection:"column",marginBottom:"20px",gap:"6px"},label:{fontSize:"14px",fontWeight:500,color:"#19213D"},asterisk:{color:"#8F2C23",marginRight:"4px",fontSize:"16px",fontWeight:600},input:{width:"100%",padding:"8px 12px",borderRadius:"6px",border:"1px solid #E2E8F0",outline:"none",fontSize:"14px"},inputError:{border:"1px solid #8F2C23"},errorText:{margin:0,marginTop:"4px",fontSize:"12px",color:"#8F2C23"},textarea:{width:"100%",padding:"8px 12px",borderRadius:"6px",border:"1px solid #E2E8F0",outline:"none",fontSize:"14px",minHeight:"100px",maxHeight:"200px",overflowY:"auto",resize:"vertical"},footer:{display:"flex",justifyContent:"flex-end",gap:"12px",marginTop:"32px"},cancelBtn:{padding:"8px 16px",borderRadius:"6px",border:"1px solid #E2E8F0",backgroundColor:"transparent",color:"#64748B",fontSize:"14px",fontWeight:500,cursor:"pointer"},submitBtn:{padding:"8px 16px",borderRadius:"6px",border:"none",backgroundColor:"#2563EB",color:"#ffffff",fontSize:"14px",fontWeight:500,cursor:"pointer"},disabledBtn:{opacity:.5,cursor:"not-allowed"}};return E?r.jsx(p.default,{isLoading:E}):r.jsx("div",e.__assign({style:Y.overlay},{children:r.jsxs("div",e.__assign({style:Y.modal},{children:[r.jsxs("div",e.__assign({style:Y.header},{children:[r.jsxs("div",{children:[r.jsx("h2",e.__assign({style:Y.title},{children:"Create Scope"})),r.jsx("p",e.__assign({style:Y.subtitle},{children:"Create a scope to group and manage rules."}))]}),r.jsx("button",e.__assign({onClick:c,style:Y.closeButton},{children:"✕"}))]})),r.jsxs("div",{children:[r.jsxs("div",e.__assign({style:Y.formGroup},{children:[r.jsxs("label",e.__assign({style:Y.label},{children:[r.jsx("span",e.__assign({style:Y.asterisk},{children:"*"})),"Scope Name"]})),r.jsx("input",{type:"text",value:y,onChange:function(r){var i=r.target.value;if(i.length>50)return S(i.slice(0,50)),void R(function(r){return e.__assign(e.__assign({},r),{name:"Scope Name must be 50 characters or fewer"})});S(i),D.name&&R(function(r){return e.__assign(e.__assign({},r),{name:void 0})})},placeholder:"e.g. Global Learnings",style:e.__assign(e.__assign({},Y.input),D.name?Y.inputError:{})}),D.name&&r.jsx("p",e.__assign({style:Y.errorText},{children:D.name}))]})),r.jsxs("div",e.__assign({style:Y.formGroup},{children:[r.jsxs("label",e.__assign({style:Y.label},{children:[r.jsx("span",e.__assign({style:Y.asterisk},{children:"*"})),"Description"]})),r.jsx("input",{type:"text",value:C,onChange:function(r){var i=r.target.value;if(i.length>200)return q(i.slice(0,200)),void R(function(r){return e.__assign(e.__assign({},r),{description:"Description must be 200 characters or fewer"})});q(i),D.description&&R(function(r){return e.__assign(e.__assign({},r),{description:void 0})})},placeholder:"Enter short description for scope",style:e.__assign(e.__assign({},Y.input),D.description?Y.inputError:{})}),D.description&&r.jsx("p",e.__assign({style:Y.errorText},{children:D.description}))]})),r.jsxs("div",e.__assign({style:e.__assign(e.__assign({},Y.formGroup),{gap:"12px"})},{children:[r.jsx("label",e.__assign({style:Y.label},{children:"Approval Settings"})),r.jsxs("div",e.__assign({role:"radio","aria-checked":"approval_required"===z,tabIndex:0,style:{cursor:"pointer",display:"flex",flexDirection:"column",gap:"4px"},onClick:function(){return I("approval_required")},onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||I("approval_required")}},{children:[r.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"8px"}},{children:[r.jsx("div",e.__assign({style:{display:"flex",height:"16px",width:"16px",flexShrink:0,alignItems:"center",justifyContent:"center",borderRadius:"50%",border:"2px solid ".concat("approval_required"===z?"#2563EB":"#CBD5E1")}},{children:"approval_required"===z&&r.jsx("div",{style:{height:"8px",width:"8px",borderRadius:"50%",backgroundColor:"#2563EB"}})})),r.jsx("span",e.__assign({style:{fontSize:"14px",fontWeight:500,color:"#19213D"}},{children:"Approval Required Before Publishing"}))]})),r.jsx("p",e.__assign({style:{margin:0,marginLeft:"24px",fontSize:"12px",color:"#666F8D"}},{children:"Learnings require approval before publishing."}))]})),"approval_required"===z&&r.jsx(o.default,{selectedApprovers:G,selectedGroupOfApprovers:T,onApproversChange:L,onGroupsChange:W}),P&&r.jsx("p",e.__assign({style:{margin:0,marginLeft:"24px",fontSize:"12px",color:"#8F2C23"}},{children:P})),r.jsxs("div",e.__assign({role:"radio","aria-checked":"publish_without"===z,tabIndex:0,style:{cursor:"pointer",display:"flex",flexDirection:"column",gap:"4px"},onClick:function(){I("publish_without"),M("")},onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||(I("publish_without"),M(""))}},{children:[r.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"8px"}},{children:[r.jsx("div",e.__assign({style:{display:"flex",height:"16px",width:"16px",flexShrink:0,alignItems:"center",justifyContent:"center",borderRadius:"50%",border:"2px solid ".concat("publish_without"===z?"#2563EB":"#CBD5E1")}},{children:"publish_without"===z&&r.jsx("div",{style:{height:"8px",width:"8px",borderRadius:"50%",backgroundColor:"#2563EB"}})})),r.jsx("span",e.__assign({style:{fontSize:"14px",fontWeight:500,color:"#19213D"}},{children:"Publish Without Approval"}))]})),r.jsx("p",e.__assign({style:{margin:0,marginLeft:"24px",fontSize:"12px",color:"#666F8D"}},{children:"Learnings can be published directly."}))]}))]}))]}),r.jsxs("div",e.__assign({style:Y.footer},{children:[r.jsx("button",e.__assign({onClick:c,disabled:E,style:e.__assign(e.__assign({},Y.cancelBtn),E?Y.disabledBtn:{})},{children:"Cancel"})),r.jsx("button",e.__assign({onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var r,i,s,o,a,l,p,d;return e.__generator(this,function(u){switch(u.label){case 0:if(x={},f=!0,y.trim()||(x.name="Scope Name is required",f=!1),C.trim()||(x.description="Description is required",f=!1),R(x),!f)return[2];if("approval_required"===z&&0===G.length&&0===T.length)return M("Please select at least one approver or approver group."),[2];M(""),w(!0),r=_?"genreRuleSet":"globalRuleSet",i="approval_required"===z,console.log("topicData",r),s={topic:r,customScopeGroupName:t.IL_CONFIG_CONSTANTS.CUSTOM_SCOPE_GROUP_NAME,scopeDescription:C,parentScopeId:_?h:null,customScopeName:y,customScopeId:n.v4(),createByName:null==H?void 0:H.firstname,createdBy:null==H?void 0:H.email,approvalRequired:i,appsecData:{application:null==U?void 0:U.applicationId,module:null==U?void 0:U.moduleId,roles:e.__spreadArray(e.__spreadArray([],i?[{users:G.map(function(e){return e.email}),groups:T.map(function(e){return e._id}),role:null!==(l=null===(a=K.find(function(e){return"Learning Manager"===e.name}))||void 0===a?void 0:a._id)&&void 0!==l?l:""}]:[],!0),[{users:[null==H?void 0:H.email],groups:[],role:null!==(d=null===(p=K.find(function(e){return"Instant Learning Admin"===e.name}))||void 0===p?void 0:p._id)&&void 0!==d?d:""}],!1)}},u.label=1;case 1:return u.trys.push([1,3,4,5]),[4,g(s)];case 2:return u.sent(),c(),[3,5];case 3:return o=u.sent(),console.error("Error in submission",o),[3,5];case 4:return w(!1),[7];case 5:return[2]}var x,f})})},disabled:E,style:e.__assign(e.__assign({},Y.submitBtn),E?Y.disabledBtn:{})},{children:E?"Creating...":"Create Scope"}))]}))]}))}))};
|
|
2
2
|
//# sourceMappingURL=CreateRuleSetLegacyModal.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("react"),r=require("@mui/material"),o=require("lucide-react"),i=require("primereact/toast"),s=require("uuid"),a=require("../../assets/Search-result(add new).svg.js"),l=require("../../store/useAuthStore.js"),u=require("../../config.js"),c=require("../../apis/scopeApis.js"),d=require("./InputField.js"),p=require("./StationAutocomplete.js"),f=require("../CardSkeleton.js"),g=require("./OnboardingLoader.js"),x=require("./TemplateCard.js"),_=[{label:"5am to 7pm",value:"05:00 AM - 7:00 PM"},{label:"6am to 7pm",value:"06:00 AM - 7:00 PM"}],m=[{label:"Low Sellout",value:"Low Sellout"},{label:"High Sellout",value:"High Sellout"},{label:"None",value:""}],h=[{label:"None",value:"None"},{label:"Distribute spots evenly across all breaks in the hour",value:"Distribute spots evenly across all breaks in the hour"}];exports.default=function(v){var S,y=v.isOpen,b=v.onClose,j=v.onBoardStation,w=v.app_integration_id,C=v.token,T=v.stationNameParam,O=t.useState(null),F=O[0],N=O[1],B=t.useState([]),A=B[0],E=B[1],M=t.useState(0),D=M[0],q=M[1],I=t.useState(!0),k=I[0],P=I[1],R=t.useState(!1),z=R[0],L=R[1],W=t.useState([]),G=W[0],U=W[1],Y=t.useState(""),H=Y[0],K=Y[1],X=t.useState(""),J=X[0],Q=X[1],V=t.useState(!1),Z=V[0],$=V[1],ee=t.useState(!1),ne=ee[0],te=ee[1],re=t.useState(null),oe=re[0],ie=re[1],se=t.useState(!1),ae=se[0],le=se[1],ue=t.useState(0),ce=ue[0],de=ue[1],pe=t.useState(""),fe=pe[0],ge=pe[1],xe=l.default().user,_e=t.useRef(null),me=t.useRef(null),he=t.useRef(null),ve=t.useRef(null),Se=t.useState({region:"",primeTime:["06:00 AM - 7:00 PM"],genre:"Music",type:"",lowSelloutConfig:""}),ye=Se[0],be=Se[1],je=function(e,n){return e.find(function(e){return e.value===n})||null},we=t.useMemo(function(){return A.map(function(e){return{label:e.scope_name,value:e.scope_name}})},[A]),Ce=t.useMemo(function(){var e,n,t;if(!ye.genre)return null;var r=A.find(function(e){return e.scope_name===ye.genre});return r?{id:r.id,title:r.scope_name||"Unnamed Template",description:(null===(e=r.description)||void 0===e?void 0:e.trim())||"No description available.",inheritedText:(null===(n=r.inheritance)||void 0===n?void 0:n[0])||void 0,rulesCount:r.rules_count||0,tiersCount:r.tier_count||0,isCopy:null!==(t=r.is_copy)&&void 0!==t&&t}:null},[ye.genre,A]);t.useEffect(function(){return function(){he.current&&clearTimeout(he.current)}},[]);var Te=function(n){return e.__awaiter(void 0,void 0,void 0,function(){var t,r,o;return e.__generator(this,function(i){switch(i.label){case 0:if(z)return[2];L(!0),i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,c.retrieveGenreScopes({limit:"20",offset:String(n)})];case 2:return"success"===(null==(t=i.sent())?void 0:t.status)&&Array.isArray(null==t?void 0:t.data)?(r=t.data,E(function(t){if(0===n)return r;var o=new Set(t.map(function(e){return e.id})),i=r.filter(function(e){return!o.has(e.id)});return e.__spreadArray(e.__spreadArray([],t,!0),i,!0)}),r.length<20?P(!1):P(!0),q(n+20)):P(!1),[3,5];case 3:return o=i.sent(),console.error("[StationOnboard] Failed to fetch genre scopes:",o),P(!1),[3,5];case 4:return L(!1),[7];case 5:return[2]}})})};t.useEffect(function(){if(y&&(E([]),q(0),P(!0),Te(0),T)){ge(T);e.__awaiter(void 0,void 0,void 0,function(){var n,t,r;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,c.fetchStationsByKeyword(T,!0)];case 1:return!0===(null==(n=e.sent())?void 0:n.success)&&Array.isArray(null==n?void 0:n.data)&&(t=n.data.find(function(e){var n;return(null===(n=e.station_name)||void 0===n?void 0:n.toLowerCase())===T.toLowerCase()&&!e.ruleset_id}),t&&N(t)),[3,3];case 2:return r=e.sent(),console.error("[StationOnboard] Error auto-selecting station:",r),[3,3];case 3:return[2]}})})}},[y,T]);t.useEffect(function(){be(F?function(n){var t;return e.__assign(e.__assign({},n),{region:null!==(t=F.market)&&void 0!==t?t:""})}:{region:"",primeTime:["06:00 AM - 7:00 PM"],genre:"Music",type:"",lowSelloutConfig:""})},[F]),t.useEffect(function(){var e=setTimeout(function(){Q(H)},500);return function(){return clearTimeout(e)}},[H]),t.useEffect(function(){e.__awaiter(void 0,void 0,void 0,function(){var n,t,r;return e.__generator(this,function(e){switch(e.label){case 0:if(!J.trim())return U([]),[2];$(!0),e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,c.searchScopes({search_string:J})];case 2:return"success"===(null==(n=e.sent())?void 0:n.status)&&Array.isArray(null==n?void 0:n.data)?(t=n.data.map(function(e){var n,t,r;return{id:e.id,title:e.scope_name||"Unnamed Template",description:(null===(n=e.description)||void 0===n?void 0:n.trim())||"No description available.",inheritedText:(null===(t=e.inheritance)||void 0===t?void 0:t[0])||void 0,rulesCount:e.rules_count||0,tiersCount:e.tier_count||0,isCopy:null!==(r=e.is_copy)&&void 0!==r&&r}}),U(t)):U([]),[3,5];case 3:return r=e.sent(),console.error("[StationOnboard] Error searching scopes:",r),U([]),[3,5];case 4:return $(!1),[7];case 5:return[2]}})})},[J]),t.useEffect(function(){!J.trim()&&Ce&&ie(Ce.id)},[J,Ce]);var Oe=function(){setTimeout(function(){ve.current&&ve.current.scrollTo({top:ve.current.scrollHeight,behavior:"smooth"})},100)},Fe=function(){ge(""),N(null),be({region:"",primeTime:["06:00 AM - 7:00 PM"],genre:"Music",type:"",lowSelloutConfig:""}),U([]),K(""),ie(null),b()},Ne=function(n,t){var r;if("primeTime"!==n){var o=null!==(r=null==t?void 0:t.value)&&void 0!==r?r:"";be(function(t){var r;return e.__assign(e.__assign({},t),((r={})[n]=String(o),r))}),"genre"===n&&(te(!0),he.current&&clearTimeout(he.current),he.current=setTimeout(function(){var e=A.find(function(e){return e.scope_name===o});ie(e?e.id:null),te(!1)},800))}else{var i=(null==t?void 0:t.value)?String(t.value):"";be(function(n){return e.__assign(e.__assign({},n),{primeTime:i?[i]:[]})})}},Be=Boolean(F&&ye.region&&ye.primeTime.length>0&&ye.genre);return n.jsxs(r.Dialog,e.__assign({open:y,onClose:Fe,maxWidth:!1,disableEscapeKeyDown:!0,PaperProps:{sx:{width:"90vw",height:"90vh",borderRadius:"12px",display:"flex",flexDirection:"column",overflow:"hidden"}}},{children:[n.jsx(i.Toast,{ref:_e}),n.jsxs(r.Box,e.__assign({sx:{p:"20px 20px 20px 27px",borderBottom:"1px solid #F0F2F5",display:"flex",justifyContent:"space-between",alignItems:"center",bgcolor:"#fff"}},{children:[n.jsxs(r.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:.5}},{children:[n.jsx(r.Typography,e.__assign({sx:{fontSize:"18px",fontWeight:600,color:"#19213D"}},{children:"Onboard a Station"})),n.jsx(r.Typography,e.__assign({sx:{fontSize:"16px",fontWeight:400,color:"#666F8D"}},{children:"Onboard a station to start configuring learnings."}))]})),n.jsx(r.IconButton,e.__assign({onClick:Fe,disabled:ae,sx:{color:"#19213D"}},{children:n.jsx(o.X,{size:24})}))]})),n.jsxs(r.DialogContent,e.__assign({sx:{p:0,bgcolor:"#F8FAFC",display:"flex",flexDirection:"row",overflow:"hidden",position:"relative"}},{children:[n.jsx(g.default,{isLoading:ae,currentStep:ce,onComplete:function(){le(!1);var e=me.current;Fe(),j(e||void 0),me.current=null}}),n.jsxs(r.Box,e.__assign({sx:{display:"flex",flex:1,paddingY:"14px",paddingX:"20px",gap:3,overflowY:"hidden"}},{children:[n.jsxs(r.Box,e.__assign({ref:ve,sx:{flex:1,bgcolor:"#fff",p:3,borderRadius:"16px",border:"1px solid #F0F2F5",height:"100%",overflowY:"auto"}},{children:[n.jsx(r.Typography,e.__assign({sx:{fontSize:"1rem",fontWeight:600,mb:.5,color:"#19213D"}},{children:"Basic Details"})),n.jsx(r.Typography,e.__assign({sx:{fontSize:"0.75rem",color:"#00000080",mb:"20px"}},{children:"Set up basic station details to unlock AI recommended scopes."})),n.jsxs(r.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:"16px"}},{children:[n.jsxs(r.Box,e.__assign({className:"space-y-1.5"},{children:[n.jsxs("label",e.__assign({className:"text-sm font-medium text-[#19213D]"},{children:[n.jsx("span",e.__assign({className:"mr-0.5 text-xs font-semibold text-[#8F2C23]"},{children:"*"})),"Station Name/Call Letters"]})),n.jsx(p.default,{value:fe,onChange:ge,onStationSelect:function(e){return N(e)}})]})),n.jsx(d.default,{required:!0,disabled:!0,label:"Region",placeholder:"Select Region",value:ye.region||void 0,isSearchable:!1}),n.jsx(d.default,{required:!0,label:"Prime Time Window",placeholder:"Select Prime Time",options:_,value:je(_,(null===(S=ye.primeTime)||void 0===S?void 0:S[0])||""),onOptionChange:function(e){return Ne("primeTime",e)},isSearchable:!1}),n.jsx(r.Box,e.__assign({onClick:Oe,sx:{width:"100%"}},{children:n.jsx(d.default,{required:!0,label:"Genre",placeholder:"Select Genre",options:we,value:je(we,ye.genre),onOptionChange:function(e){return Ne("genre",e)},isSearchable:!1,onMenuScrollToBottom:function(){!z&&k&&Te(D)},isLoadingOptions:z,hasMoreOptions:k})})),n.jsx(r.Box,e.__assign({onClick:Oe,sx:{width:"100%"}},{children:n.jsx(d.default,{label:"Station Type",placeholder:"None",options:m,value:je(m,ye.type),onOptionChange:function(n){Ne("type",n),"Low Sellout"!==(null==n?void 0:n.value)&&be(function(n){return e.__assign(e.__assign({},n),{lowSelloutConfig:""})})},isSearchable:!1})})),"Low Sellout"===ye.type&&n.jsx(r.Box,e.__assign({onClick:Oe,sx:{width:"100%"}},{children:n.jsx(d.default,{label:"Low Sell Out Configurations",placeholder:"Select Configuration",options:h,value:je(h,ye.lowSelloutConfig),onOptionChange:function(e){return Ne("lowSelloutConfig",e)},isSearchable:!1})}))]}))]})),n.jsx(r.Box,e.__assign({sx:{flex:1,bgcolor:"#fff",p:3,borderRadius:"12px",border:"1px solid #F0F2F5",display:"flex",flexDirection:"column",height:"100%",overflowY:"auto"}},{children:ye.genre?n.jsxs(n.Fragment,{children:[n.jsx(r.Typography,e.__assign({sx:{fontSize:"1rem",fontWeight:500,mb:1.5}},{children:"Matching scope for your station"})),n.jsx(r.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:2,mb:4}},{children:ne?n.jsx(f.default,{}):Ce?n.jsx(x.default,e.__assign({},Ce,{isSelected:oe===Ce.id,onSelect:ie}),Ce.id):null})),n.jsx(r.Typography,e.__assign({sx:{fontSize:"1rem",fontWeight:500,mb:1.5}},{children:"Other available stations"})),n.jsxs("div",e.__assign({className:"relative mb-4 w-full"},{children:[n.jsx("input",{type:"text",value:H,onChange:function(e){return K(e.target.value)},placeholder:"Search for station...",className:"w-full rounded-lg border border-[#E2E8F0] px-10 py-[7px] text-[12px] outline-none transition-all placeholder:text-[#BAC0CC] focus:border-blue-500 focus:ring-1 focus:ring-blue-500"}),n.jsx(o.Search,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-400",size:16})]})),n.jsxs(r.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:2}},{children:[Z&&n.jsx(f.default,{}),!Z&&0===G.length&&J.trim()&&n.jsxs(r.Typography,e.__assign({sx:{fontSize:"0.875rem",color:"#64748B",textAlign:"center",py:4}},{children:['No scopes found matching "',J,'".']})),!Z&&G.map(function(t){return n.jsx(x.default,e.__assign({},t,{isSelected:oe===t.id,onSelect:ie}),t.id)})]}))]}):n.jsxs(n.Fragment,{children:[n.jsx(r.Typography,e.__assign({sx:{fontSize:"1rem",fontWeight:500,mb:1.5}},{children:"Fill in the station details to load AI recommended scopes"})),n.jsx(r.Typography,e.__assign({sx:{fontSize:"0.75rem",color:"#64748B",mb:3}},{children:"AI will recommend the most relevant scope for this station."})),n.jsx(r.Box,e.__assign({sx:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",opacity:.5,py:10}},{children:n.jsx("img",{src:a.default,alt:"Empty Result"})}))]})}))]}))]})),n.jsxs(r.Box,e.__assign({sx:{p:"12px 20px",borderTop:"1px solid #F0F2F5",display:"flex",justifyContent:"flex-end",gap:2,bgcolor:"#fff"}},{children:[n.jsx("button",e.__assign({onClick:Fe,disabled:ae,style:{padding:"7px 10px",borderRadius:"6px",color:"#64748B",border:"1px solid #E2E8F0",backgroundColor:"#fff",cursor:"pointer",fontSize:"14px",fontWeight:500}},{children:"Cancel"})),n.jsx("button",e.__assign({onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var n,t,r,o,i,a,l,d,p,f,g,x,_,m,h,v,S,y;return e.__generator(this,function(b){switch(b.label){case 0:if(!F||!oe)return console.error("[StationOnboard] Missing required data for onboarding"),[2];n=Ce?e.__spreadArray([Ce],G,!0):G,t=n.find(function(e){return e.id===oe}),r=null!==(_=null==t?void 0:t.isCopy)&&void 0!==_&&_,le(!0),de(0),o=null,b.label=1;case 1:return b.trys.push([1,3,,4]),i={topic:"customRuleSet",customScopeGroupName:(null===u.IL_CONFIG_CONSTANTS||void 0===u.IL_CONFIG_CONSTANTS?void 0:u.IL_CONFIG_CONSTANTS.CUSTOM_SCOPE_GROUP_NAME)||"Audacy-Traffic-Manager",scopeDescription:F.station_name||"New Station",parentScopeId:null,customScopeName:F.station_name||"New Station",customScopeId:s.v4(),createByName:(null==xe?void 0:xe.firstname)||"System",createdBy:(null==xe?void 0:xe.email)||"system@audacy.com",applicationMappingId:w},console.log("[StationOnboard] Step 1: Creating rule set with payload:",i),[4,c.createRuleSet(i,C)];case 2:if(a=b.sent(),!(o=null===(m=null==a?void 0:a.data)||void 0===m?void 0:m.scopeId))throw new Error("Failed to create scope - no scopeId returned");return de(1),[3,4];case 3:return l=b.sent(),console.error("[StationOnboard] Error creating rule set:",l),null===(h=_e.current)||void 0===h||h.show({severity:"error",life:3e3,summary:"Error",detail:"Failed to create rule set. Please try again."}),le(!1),de(0),[2];case 4:return b.trys.push([4,6,,11]),d={market:F.market,region:F.region,primetime_windows:ye.primeTime,genre:ye.genre,station_type:""===ye.type?null:ye.type,low_sellout_configurations:"Low Sellout"===ye.type?ye.lowSelloutConfig:null,ruleset_id:o,station_guid:F.station_guid,station_name:F.station_name||"New Station"},console.log("[StationOnboard] Step 2: Updating station with payload:",d),[4,c.updateStation(d)];case 5:return b.sent(),de(2),[3,11];case 6:p=b.sent(),console.error("[StationOnboard] Error updating station, rolling back rule set:",p),409===p.status?(null===(v=_e.current)||void 0===v||v.show({severity:"error",life:2500,summary:"Error updating station",detail:"Station already Onboarded."}),N(null),ie(null),ge(""),be(function(n){return e.__assign(e.__assign({},n),{region:""})})):null===(S=_e.current)||void 0===S||S.show({severity:"error",life:2500,summary:"Error updating station",detail:"Please try again."}),b.label=7;case 7:return b.trys.push([7,9,,10]),[4,c.deleteRuleSet(o,C)];case 8:return b.sent(),[3,10];case 9:return f=b.sent(),console.error("[StationOnboard] Failed to rollback rule set deletion:",f),[3,10];case 10:return le(!1),de(0),[2];case 11:return b.trys.push([11,13,,14]),g={source_scope_id:oe,target_scope_id:o,is_copy_parent_variant_id:r},console.log("[StationOnboard] Step 3: Inheriting scope with payload:",g),[4,c.inheritScope(g)];case 12:return b.sent(),de(3),[3,14];case 13:return x=b.sent(),console.error("[StationOnboard] Error inheriting scope (no rollback):",x),null===(y=_e.current)||void 0===y||y.show({severity:"error",life:3e3,summary:"Error",detail:"Failed to apply rule template. Please try again."}),le(!1),de(0),[2];case 14:return me.current=o,[2]}})})},disabled:!Be||ae,style:{padding:"7px 10px",borderRadius:"6px",border:"none",backgroundColor:Be?"#2563EB":"#BFDBFE",color:"#fff",cursor:Be&&!ae?"pointer":"not-allowed",fontSize:"14px",fontWeight:500,display:"flex",alignItems:"center",gap:"7px"}},{children:ae?n.jsxs(n.Fragment,{children:[n.jsx(r.CircularProgress,{size:16,color:"inherit"}),n.jsx("span",{children:"Onboarding..."})]}):n.jsxs(n.Fragment,{children:[n.jsx("span",{children:"Onboard Station"}),n.jsx(o.ArrowRight,{size:16})]})}))]}))]}))};
|
|
2
|
+
//# sourceMappingURL=BackwardStationOnboardModal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BackwardStationOnboardModal.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/dist/cjs/features/LearningManagement/components/StationOnboarding/StationOnboardModal.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),r=require("react"),i=require("@mui/material"),o=require("lucide-react"),t=require("primereact/toast"),s=require("uuid"),a=require("../../apis/scopeApis.js"),l=require("./StationAutocomplete.js"),u=require("../CardSkeleton.js"),c=require("./OnboardingLoader.js"),p=require("./TemplateCard.js"),d=require("../../styles/StationOnboardModal.module.css.js"),x=require("./InputField.js"),g=require("../../store/useAuthStore.js"),f=require("../../store/useConfigStore.js"),h=require("../../store/useLearningTemplateStore.js"),_=require("../../config.js"),m=require("../../store/useAppSecRolesStore.js"),v=require("../../store/useEnvStore.js"),y=require("../../RuleContent/AddScopeApprovalSearchComponent.js"),S=[{label:"PT - Pacific Time",value:"Pacific Time"},{label:"MT - Mountain Time",value:"Mountain Time"},{label:"CT - Central Time",value:"Central Time"},{label:"ET - Eastern Time",value:"Eastern Time"}],b=[{label:"6am to 7pm",value:"06:00 AM - 7:00 PM"},{label:"5am to 7pm",value:"05:00 AM - 7:00 PM"}],j=[{label:"Low Sellout",value:"Low Sellout"},{label:"High Sellout",value:"High Sellout"},{label:"None",value:""}],C=[{label:"None",value:"None"},{label:"Distribute spots evenly across all breaks in the hour",value:"Distribute spots evenly across all breaks in the hour"}];exports.default=function(w){var T,B=w.isOpen,F=w.onClose,E=w.onBoardStation,k=w.app_integration_id,q=w.token,D=r.useState(null),z=D[0],O=D[1],A=r.useState([]),R=A[0],I=A[1],L=r.useState(0),N=L[0],M=L[1],W=r.useState(!0),P=W[0],G=W[1],U=r.useState(!1),H=U[0],K=U[1],Y=r.useState([]),X=Y[0],Z=Y[1],V=r.useState(""),J=V[0],Q=V[1],$=r.useState(""),ee=$[0],ne=$[1],re=r.useState(!1),ie=re[0],oe=re[1],te=r.useState(!1),se=te[0],ae=te[1],le=r.useState(null),ue=le[0],ce=le[1],pe=r.useState(null);pe[0],pe[1];var de=r.useState(!1),xe=de[0],ge=de[1],fe=r.useState(0),he=fe[0],_e=fe[1],me=r.useState(""),ve=me[0],ye=me[1],Se=g.default().user,be=r.useRef(null),je=r.useRef(null),Ce=r.useRef(null),we=r.useRef(null);f.useConfigStore().configuration;var Te=r.useRef(null),Be=m.useAppSecRolesStore(function(e){return e.roles}),Fe=v.default(function(e){return e.rbacConfig}),Ee=r.useState("approval_required"),ke=Ee[0],qe=Ee[1],De=r.useState([]),ze=De[0],Oe=De[1],Ae=r.useState([]),Re=Ae[0],Ie=Ae[1],Le=r.useState(""),Ne=Le[0],Me=Le[1],We=r.useState({region:"",timezone:"",primeTime:[],genre:"",type:"",lowSelloutConfig:""}),Pe=We[0],Ge=We[1],Ue=function(e,n){return e.find(function(e){return e.value===n})||null},He=r.useMemo(function(){return R.map(function(e){return{label:e.scope_name,value:e.scope_name}})},[R]),Ke=r.useMemo(function(){var e,n,r;if(!Pe.genre)return null;var i=R.find(function(e){return e.scope_name===Pe.genre});return i?{id:i.id,title:i.scope_name||"Unnamed Template",description:(null===(e=i.description)||void 0===e?void 0:e.trim())||"No description available.",inheritedText:(null===(n=i.inheritance)||void 0===n?void 0:n[0])||void 0,rulesCount:i.rules_count||0,tiersCount:i.tier_count||0,isCopy:null!==(r=i.is_copy)&&void 0!==r&&r}:null},[Pe.genre,R]);r.useEffect(function(){return function(){Ce.current&&clearTimeout(Ce.current)}},[]);var Ye=function(n){return e.__awaiter(void 0,void 0,void 0,function(){var r,i,o;return e.__generator(this,function(t){switch(t.label){case 0:if(H)return[2];K(!0),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,a.retrieveGenreScopes({limit:"20",offset:String(n)})];case 2:return"success"===(null==(r=t.sent())?void 0:r.status)&&Array.isArray(null==r?void 0:r.data)?(i=r.data,I(function(r){if(0===n)return i;var o=new Set(r.map(function(e){return e.id})),t=i.filter(function(e){return!o.has(e.id)});return e.__spreadArray(e.__spreadArray([],r,!0),t,!0)}),i.length<20?G(!1):G(!0),M(n+20)):G(!1),[3,5];case 3:return o=t.sent(),console.error("[StationOnboard] Failed to fetch genre scopes:",o),G(!1),[3,5];case 4:return K(!1),[7];case 5:return[2]}})})};r.useEffect(function(){B&&(I([]),M(0),G(!0),Ye(0))},[B]);r.useEffect(function(){Ge(z?function(n){var r;return e.__assign(e.__assign({},n),{region:null!==(r=z.market)&&void 0!==r?r:""})}:{region:"",timezone:"",primeTime:[],genre:"",type:"",lowSelloutConfig:""})},[z]),r.useEffect(function(){var e=setTimeout(function(){ne(J)},500);return function(){return clearTimeout(e)}},[J]),r.useEffect(function(){e.__awaiter(void 0,void 0,void 0,function(){var n,r,i,o;return e.__generator(this,function(e){switch(e.label){case 0:if(!ee.trim())return Z([]),[2];oe(!0),e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,a.searchScopes({search_string:ee.trim()})];case 2:return"success"===(null==(n=e.sent())?void 0:n.status)&&Array.isArray(null==n?void 0:n.data)?(r=n.data.filter(function(e){var n,r=null!==(n=e.inheritance)&&void 0!==n?n:[],i=r.indexOf(e.scope_name);return!(i<=0)&&r[i-1]===Pe.genre}),i=r.map(function(e){var n,r,i;return{id:e.id,title:e.scope_name||"Unnamed Template",description:(null===(n=e.description)||void 0===n?void 0:n.trim())||"No description available.",inheritedText:(null===(r=e.inheritance)||void 0===r?void 0:r[0])||void 0,rulesCount:e.rules_count||0,tiersCount:e.tier_count||0,isCopy:null!==(i=e.is_copy)&&void 0!==i&&i}}),Z(i)):Z([]),[3,5];case 3:return o=e.sent(),console.error("[StationOnboard] Error searching scopes:",o),Z([]),[3,5];case 4:return oe(!1),[7];case 5:return[2]}})})},[ee,Pe.genre]),r.useEffect(function(){!ee.trim()&&Ke&&ce(Ke.id)},[ee,Ke]);var Xe=function(){setTimeout(function(){we.current&&we.current.scrollTo({top:we.current.scrollHeight,behavior:"smooth"})},100)},Ze=function(){ye(""),O(null),Ge({region:"",timezone:"",primeTime:[],genre:"",type:"",lowSelloutConfig:""}),Z([]),Q(""),ce(null),qe("approval_required"),Oe([]),Ie([]),Me(""),F()},Ve=function(n,r){var i;if("primeTime"!==n){var o=null!==(i=null==r?void 0:r.value)&&void 0!==i?i:"";Ge(function(r){var i;return e.__assign(e.__assign({},r),((i={})[n]=String(o),i))}),"genre"===n&&(ae(!0),Ce.current&&clearTimeout(Ce.current),Ce.current=setTimeout(function(){var e=R.find(function(e){return e.scope_name===o});ce(e?e.id:null),ae(!1)},800))}else{var t=(null==r?void 0:r.value)?String(r.value):"";Ge(function(n){return e.__assign(e.__assign({},n),{primeTime:t?[t]:[]})})}},Je=Boolean(z&&Pe.region&&Pe.timezone&&Pe.primeTime.length>0&&Pe.genre);return n.jsxs(i.Dialog,e.__assign({open:B,onClose:Ze,maxWidth:!1,disableEscapeKeyDown:!0,PaperProps:{sx:{width:"90vw",height:"90vh",borderRadius:"12px",display:"flex",flexDirection:"column",overflow:"hidden",fontFamily:"sans-serif"}}},{children:[n.jsx(t.Toast,{ref:be}),n.jsxs(i.Box,e.__assign({sx:{p:"20px 20px 20px 27px",borderBottom:"1px solid #F0F2F5",display:"flex",justifyContent:"space-between",alignItems:"center",bgcolor:"#fff"}},{children:[n.jsxs(i.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:.5}},{children:[n.jsx(i.Typography,e.__assign({sx:{fontSize:"18px",fontWeight:600,color:"#19213D"}},{children:"Onboard a Station"})),n.jsx(i.Typography,e.__assign({sx:{fontSize:"16px",fontWeight:400,color:"#666F8D"}},{children:"Onboard a station to start configuring learnings."}))]})),n.jsx(i.IconButton,e.__assign({onClick:Ze,disabled:xe,sx:{color:"#19213D"}},{children:n.jsx(o.X,{size:24})}))]})),n.jsxs(i.DialogContent,e.__assign({sx:{p:0,bgcolor:"#F8FAFC",display:"flex",flexDirection:"row",overflow:"hidden",position:"relative"}},{children:[n.jsx(c.default,{isLoading:xe,currentStep:he,onComplete:function(){ge(!1);var e=je.current;Ze(),E(e||void 0),je.current=null}}),n.jsx(i.Box,e.__assign({sx:{display:"flex",flex:1,flexDirection:"column",paddingY:"14px",paddingX:"20px",gap:2,overflowY:"auto"}},{children:n.jsxs(i.Box,e.__assign({sx:{display:"flex",gap:3}},{children:[n.jsxs(i.Box,e.__assign({ref:we,sx:{flex:1,bgcolor:"#fff",p:3,borderRadius:"16px",border:"1px solid #F0F2F5"}},{children:[n.jsx(i.Typography,e.__assign({sx:{fontSize:"1rem",fontWeight:600,mb:.5,color:"#19213D"}},{children:"Basic Details"})),n.jsx(i.Typography,e.__assign({sx:{fontSize:"0.75rem",color:"#00000080",mb:"20px"}},{children:"Set up basic station details to unlock AI recommended scopes."})),n.jsxs(i.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:"16px"}},{children:[n.jsxs(i.Box,e.__assign({className:d.default.formGroup},{children:[n.jsxs("label",e.__assign({className:d.default.label},{children:[n.jsx("span",e.__assign({className:d.default.asterisk},{children:"*"})),"Station Name/Call Letters"]})),n.jsx(l.default,{value:ve,onChange:ye,onStationSelect:function(e){return O(e)}})]})),n.jsx(x.default,{required:!0,disabled:!0,label:"Region",placeholder:"Select Region",value:Pe.region||void 0,isSearchable:!1}),n.jsx(x.default,{required:!0,label:"TimeZone",placeholder:"Select TimeZone",options:S,value:Ue(S,Pe.timezone),onOptionChange:function(e){return Ve("timezone",e)},isSearchable:!1}),n.jsx(x.default,{required:!0,label:"Prime Time Window",placeholder:"Select Prime Time",options:b,value:Ue(b,(null===(T=Pe.primeTime)||void 0===T?void 0:T[0])||""),onOptionChange:function(e){return Ve("primeTime",e)},isSearchable:!1}),n.jsx(i.Box,e.__assign({onClick:Xe,sx:{width:"100%"}},{children:n.jsx(x.default,{label:"Station Type",placeholder:"None",options:j,value:Ue(j,Pe.type),onOptionChange:function(n){Ve("type",n),"Low Sellout"!==(null==n?void 0:n.value)&&Ge(function(n){return e.__assign(e.__assign({},n),{lowSelloutConfig:""})})},isSearchable:!1})})),"Low Sellout"===Pe.type&&n.jsx(i.Box,e.__assign({onClick:Xe,sx:{width:"100%"}},{children:n.jsx(x.default,{label:"Low Sell Out Configurations",placeholder:"Select Configuration",options:C,value:Ue(C,Pe.lowSelloutConfig),onOptionChange:function(e){return Ve("lowSelloutConfig",e)},isSearchable:!1})})),h.useLearningTemplateStore.getState().backwardCompatibility&&n.jsxs("div",e.__assign({ref:Te,style:{display:"flex",flexDirection:"column",marginTop:"12px"}},{children:[n.jsx(i.Typography,e.__assign({sx:{fontSize:"1rem",fontWeight:600,mb:.5,color:"#19213D"}},{children:"Approval Settings"})),n.jsx(i.Typography,e.__assign({sx:{fontSize:"0.75rem",color:"#00000080",mb:"20px"}},{children:"Configure who can approve learnings before they get published."})),n.jsxs("div",e.__assign({style:{marginBottom:"12px",fontSize:"12px",color:"#8F2C23",gap:"16px"}},{children:[n.jsxs("div",e.__assign({style:{marginBottom:"12px",fontSize:"12px",color:"#8F2C23",gap:"12px"}},{children:[n.jsxs("div",e.__assign({role:"radio","aria-checked":"approval_required"===ke,tabIndex:0,style:{cursor:"pointer",display:"flex",flexDirection:"column",gap:"4px",marginBottom:"8px"},onClick:function(){return qe("approval_required")},onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||qe("approval_required")}},{children:[n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"8px"}},{children:[n.jsx("div",e.__assign({style:{display:"flex",height:"16px",width:"16px",flexShrink:0,alignItems:"center",justifyContent:"center",borderRadius:"50%",border:"2px solid ".concat("approval_required"===ke?"#2563EB":"#CBD5E1")}},{children:"approval_required"===ke&&n.jsx("div",{style:{height:"8px",width:"8px",borderRadius:"50%",backgroundColor:"#2563EB"}})})),n.jsx("span",e.__assign({style:{fontSize:"14px",fontWeight:500,color:"#19213D"}},{children:"Approval Required Before Publishing"}))]})),n.jsx("p",e.__assign({style:{margin:0,marginLeft:"24px",fontSize:"12px",color:"#666F8D"}},{children:"Learnings require approval before publishing."}))]})),n.jsxs("div",e.__assign({style:{gap:"16px"}},{children:["approval_required"===ke&&n.jsx(y.default,{selectedApprovers:ze,selectedGroupOfApprovers:Re,onApproversChange:function(e){Oe(e),Me("")},onGroupsChange:function(e){Ie(e),Me("")}}),Ne&&n.jsx("p",e.__assign({style:{margin:0,marginLeft:"24px",fontSize:"12px",color:"#8F2C23"}},{children:Ne}))]}))]})),n.jsxs("div",e.__assign({role:"radio","aria-checked":"publish_without"===ke,tabIndex:0,style:{cursor:"pointer",display:"flex",flexDirection:"column",gap:"4px"},onClick:function(){qe("publish_without"),Me("")},onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||(qe("publish_without"),Me(""))}},{children:[n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"8px"}},{children:[n.jsx("div",e.__assign({style:{display:"flex",height:"16px",width:"16px",flexShrink:0,alignItems:"center",justifyContent:"center",borderRadius:"50%",border:"2px solid ".concat("publish_without"===ke?"#2563EB":"#CBD5E1")}},{children:"publish_without"===ke&&n.jsx("div",{style:{height:"8px",width:"8px",borderRadius:"50%",backgroundColor:"#2563EB"}})})),n.jsx("span",e.__assign({style:{fontSize:"14px",fontWeight:500,color:"#19213D"}},{children:"Publish Without Approval"}))]})),n.jsx("p",e.__assign({style:{margin:0,marginLeft:"24px",fontSize:"12px",color:"#666F8D"}},{children:"Learnings can be published directly."}))]}))]}))]}))]}))]})),n.jsxs(i.Box,e.__assign({sx:{flex:1,bgcolor:"#fff",p:3,borderRadius:"12px",border:"1px solid #F0F2F5",display:"flex",flexDirection:"column"}},{children:[n.jsxs(i.Typography,e.__assign({sx:{fontSize:"1rem",fontWeight:600,mb:.5,color:"#19213D"}},{children:[n.jsx("span",e.__assign({style:{color:"#E53E3E",marginRight:"2px"}},{children:"*"})),"Select a scope for your station"]})),n.jsx(i.Typography,e.__assign({sx:{fontSize:"0.75rem",color:"#64748B",mb:"16px"}},{children:"Your station will inherit the rules from the selected scope."})),n.jsx(i.Box,e.__assign({sx:{mb:2}},{children:n.jsx(x.default,{required:!0,label:"",placeholder:"Select Genre",options:He,value:Ue(He,Pe.genre),onOptionChange:function(e){return Ve("genre",e)},isSearchable:!1,onMenuScrollToBottom:function(){!H&&P&&Ye(N)},isLoadingOptions:H,hasMoreOptions:P})})),n.jsx(i.Box,e.__assign({sx:{mb:3}},{children:se?n.jsx(u.default,{}):Ke?n.jsxs(i.Box,e.__assign({sx:{border:"1.5px solid #2563EB",borderRadius:"10px",p:"14px 16px",bgcolor:"#EFF6FF",display:"flex",alignItems:"flex-start",gap:"12px"}},{children:[n.jsx(i.Box,e.__assign({sx:{width:36,height:36,borderRadius:"8px",bgcolor:"#DBEAFE",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}},{children:n.jsxs("svg",e.__assign({width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"#2563EB",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:[n.jsx("circle",{cx:"12",cy:"12",r:"2"}),n.jsx("path",{d:"M16.24 7.76a6 6 0 0 1 0 8.49m-8.48-.01a6 6 0 0 1 0-8.49m11.31-2.82a10 10 0 0 1 0 14.14m-14.14 0a10 10 0 0 1 0-14.14"})]}))})),n.jsxs(i.Box,e.__assign({sx:{flex:1,minWidth:0}},{children:[n.jsx(i.Typography,e.__assign({sx:{fontSize:"0.875rem",fontWeight:600,color:"#1E3A5F",mb:"2px"}},{children:Ke.title})),n.jsx(i.Typography,e.__assign({sx:{fontSize:"0.75rem",color:"#2563EB",mb:"8px"}},{children:Ke.description})),n.jsxs(i.Box,e.__assign({sx:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"}},{children:[Ke.inheritedText&&n.jsxs(i.Box,e.__assign({component:"span",sx:{fontSize:"0.7rem",color:"#475569",bgcolor:"#F1F5F9",border:"1px solid #E2E8F0",borderRadius:"4px",px:"6px",py:"2px",display:"inline-flex",alignItems:"center",gap:"4px"}},{children:[n.jsxs("svg",e.__assign({width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:[n.jsx("polyline",{points:"15 3 21 3 21 9"}),n.jsx("path",{d:"M21 3L9 15"}),n.jsx("path",{d:"M3 21l6-6"})]})),Ke.inheritedText]})),n.jsxs(i.Box,e.__assign({component:"span",sx:{fontSize:"0.7rem",color:"#475569",bgcolor:"#F1F5F9",border:"1px solid #E2E8F0",borderRadius:"4px",px:"6px",py:"2px"}},{children:[Ke.rulesCount," rules"]})),n.jsxs(i.Box,e.__assign({component:"span",sx:{fontSize:"0.7rem",color:"#475569",bgcolor:"#F1F5F9",border:"1px solid #E2E8F0",borderRadius:"4px",px:"6px",py:"2px"}},{children:[Ke.tiersCount," Tiers"]}))]}))]}))]})):Pe.genre?null:n.jsx(i.Box,e.__assign({sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",opacity:.4,py:6,gap:1}},{children:n.jsx(i.Typography,e.__assign({sx:{fontSize:"0.75rem",color:"#94A3B8"}},{children:"Select a genre to load the matching scope"}))}))})),Pe.genre&&n.jsxs(n.Fragment,{children:[n.jsxs(i.Typography,e.__assign({sx:{fontSize:"1rem",fontWeight:600,mb:.5,color:"#19213D"}},{children:["Select an Existing Station from the “",Pe.genre,"” Scope"," ",n.jsx(i.Typography,e.__assign({component:"span",sx:{fontSize:"1rem",fontWeight:400,color:"#64748B"}},{children:"(Optional)"}))]})),n.jsxs(i.Typography,e.__assign({sx:{fontSize:"0.75rem",color:"#64748B",mb:"12px"}},{children:["Please select an existing station under the “",Pe.genre,"” category to copy its learnings."]})),n.jsxs("div",e.__assign({className:d.default.searchWrapper,style:{marginBottom:"12px"}},{children:[n.jsx("input",{type:"text",value:J,onChange:function(e){return Q(e.target.value)},placeholder:"Search for station...",className:d.default.searchInput}),n.jsx(o.Search,{className:d.default.searchIcon,size:16})]})),n.jsxs(i.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:2}},{children:[ie&&n.jsx(u.default,{}),!ie&&0===X.length&&ee.trim()&&n.jsxs(i.Typography,e.__assign({sx:{fontSize:"0.875rem",color:"#64748B",textAlign:"center",py:4}},{children:['No scopes found matching "',ee,'".']})),!ie&&X.map(function(r){return n.jsx(p.default,e.__assign({},r,{isSelected:ue===r.id,onSelect:function(e){var n;ce(ue===e?null!==(n=null==Ke?void 0:Ke.id)&&void 0!==n?n:null:e)}}),r.id)})]}))]})]}))]}))}))]})),n.jsxs(i.Box,e.__assign({sx:{p:"12px 20px",borderTop:"1px solid #F0F2F5",display:"flex",justifyContent:"flex-end",gap:2,bgcolor:"#fff"}},{children:[n.jsx("button",e.__assign({onClick:Ze,disabled:xe,style:{padding:"7px 10px",borderRadius:"6px",color:"#64748B",border:"1px solid #E2E8F0",backgroundColor:"#fff",cursor:"pointer",fontSize:"14px",fontWeight:500}},{children:"Cancel"})),n.jsx("button",e.__assign({onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var n,r,i,o,t,l,u,c,p,d,x,g,f,m,v,y,S,b;return e.__generator(this,function(j){switch(j.label){case 0:if(!z||!ue)return console.error("[StationOnboard] Missing required data for onboarding"),[2];if(h.useLearningTemplateStore.getState().backwardCompatibility&&"approval_required"===ke&&0===ze.length&&0===Re.length)return Me("Please select at least one approver or approver group."),setTimeout(function(){var e;null===(e=Te.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"center"})},50),[2];Me(""),n=Ke?e.__spreadArray([Ke],X,!0):X,r=n.find(function(e){return e.id===ue}),null==r?void 0:r.isCopy,ge(!0),_e(0),i=null,j.label=1;case 1:return j.trys.push([1,3,,4]),o=h.useLearningTemplateStore.getState().backwardCompatibility,t=o?{topic:"customRuleSet",customScopeGroupName:_.IL_CONFIG_CONSTANTS.CUSTOM_SCOPE_GROUP_NAME,scopeDescription:z.station_name||"New Station",parentScopeId:null,customScopeName:z.station_name||"New Station",customScopeId:s.v4(),createByName:(null==Se?void 0:Se.firstname)||"System",createdBy:(null==Se?void 0:Se.email)||"system@audacy.com",scopeType:"Station",approvalRequired:"approval_required"===ke,audacyStationMetadata:{genre:Pe.genre,low_sellout_configurations:"Low Sellout"===Pe.type?Pe.lowSelloutConfig:null,market:z.market,primetime_windows:Pe.primeTime,region:z.region,station_guid:z.station_guid,station_type:""===Pe.type?null:Pe.type},appsecData:{application:null==Fe?void 0:Fe.applicationId,module:null==Fe?void 0:Fe.moduleId,roles:e.__spreadArray(e.__spreadArray([],"approval_required"===ke?[{users:ze.map(function(e){return e.email}),groups:Re.map(function(e){return e._id}),role:null!==(g=null===(x=Be.find(function(e){return"Learning Manager"===e.name}))||void 0===x?void 0:x._id)&&void 0!==g?g:""}]:[],!0),[{users:[null==Se?void 0:Se.email],groups:[],role:null!==(m=null===(f=Be.find(function(e){return"Instant Learning Admin"===e.name}))||void 0===f?void 0:f._id)&&void 0!==m?m:""}],!1)}}:{topic:"customRuleSet",scope_reference_id:null,scopeDescription:"demo",parentScopeId:null,scopeName:z.station_name||"New Station",scopeReferenceMetadata:{},applicationMappingId:k},console.log("[StationOnboard] Step 1: Creating rule set with payload:",t),[4,a.createRuleSet(t,q)];case 2:if(l=j.sent(),!(i=null===(v=null==l?void 0:l.data)||void 0===v?void 0:v.scopeId))throw new Error("Failed to create scope - no scopeId returned");return console.log("[StationOnboard] Step 1 Complete: Created scope with ID:",i),_e(1),[3,4];case 3:return u=j.sent(),console.error("[StationOnboard] Error creating rule set:",u),null===(y=be.current)||void 0===y||y.show({severity:"error",life:3e3,summary:"Error",detail:"Failed to create rule set. Please try again."}),ge(!1),_e(0),[2];case 4:return j.trys.push([4,6,,7]),c=null!==ue&&ue!==(null==Ke?void 0:Ke.id),p={source_scope_id:c?ue:null!==(S=null==Ke?void 0:Ke.id)&&void 0!==S?S:ue,target_scope_id:i,is_copy_parent_variant_id:c},console.log("[StationOnboard] Step 3: Inheriting scope with payload:",p),[4,a.inheritScopeBackwardCompatible(p)];case 5:return j.sent(),console.log("[StationOnboard] Step 3 Complete: Scope inherited"),_e(3),[3,7];case 6:return d=j.sent(),console.error("[StationOnboard] Error inheriting scope (no rollback):",d),null===(b=be.current)||void 0===b||b.show({severity:"error",life:3e3,summary:"Error",detail:"Failed to apply rule template. Please try again."}),ge(!1),_e(0),[2];case 7:return je.current=i,console.log("[StationOnboard] Onboarding completed successfully!"),[2]}})})},disabled:!Je||xe,style:{padding:"7px 10px",borderRadius:"6px",border:"none",backgroundColor:Je?"#2563EB":"#BFDBFE",color:"#fff",cursor:Je&&!xe?"pointer":"not-allowed",fontSize:"14px",fontWeight:500,display:"flex",alignItems:"center",gap:"7px"}},{children:xe?n.jsxs(n.Fragment,{children:[n.jsx(i.CircularProgress,{size:16,color:"inherit"}),n.jsx("span",{children:"Onboarding..."})]}):n.jsxs(n.Fragment,{children:[n.jsx("span",{children:"Onboard Station"}),n.jsx(o.ArrowRight,{size:16})]})}))]}))]}))};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),r=require("react"),i=require("@mui/material"),o=require("lucide-react"),t=require("primereact/toast"),s=require("uuid"),l=require("../../apis/scopeApis.js"),a=require("./StationAutocomplete.js"),u=require("../CardSkeleton.js"),c=require("./OnboardingLoader.js"),p=require("./TemplateCard.js"),d=require("../../styles/StationOnboardModal.module.css.js"),x=require("./InputField.js"),g=require("../../store/useAuthStore.js"),f=require("../../store/useConfigStore.js"),h=require("../../store/useLearningTemplateStore.js"),_=require("../../config.js"),m=require("../../store/useAppSecRolesStore.js"),v=require("../../store/useEnvStore.js"),y=require("../../RuleContent/AddScopeApprovalSearchComponent.js"),S=[{label:"PT - Pacific Time",value:"Pacific Time"},{label:"MT - Mountain Time",value:"Mountain Time"},{label:"CT - Central Time",value:"Central Time"},{label:"ET - Eastern Time",value:"Eastern Time"}],b=[{label:"6am to 7pm",value:"06:00 AM - 7:00 PM"},{label:"5am to 7pm",value:"05:00 AM - 7:00 PM"}],j=[{label:"Low Sellout",value:"Low Sellout"},{label:"High Sellout",value:"High Sellout"},{label:"None",value:""}],C=[{label:"None",value:"None"},{label:"Distribute spots evenly across all breaks in the hour",value:"Distribute spots evenly across all breaks in the hour"}];exports.default=function(w){var T,B=w.isOpen,F=w.onClose,E=w.onBoardStation,k=w.app_integration_id,q=w.token,D=r.useState(null),z=D[0],O=D[1],A=r.useState([]),R=A[0],I=A[1],L=r.useState(0),N=L[0],M=L[1],W=r.useState(!0),P=W[0],G=W[1],U=r.useState(!1),H=U[0],K=U[1],Y=r.useState([]),X=Y[0],Z=Y[1],V=r.useState(""),J=V[0],Q=V[1],$=r.useState(""),ee=$[0],ne=$[1],re=r.useState(!1),ie=re[0],oe=re[1],te=r.useState(!1),se=te[0],le=te[1],ae=r.useState(null),ue=ae[0],ce=ae[1],pe=r.useState(null);pe[0],pe[1];var de=r.useState(!1),xe=de[0],ge=de[1],fe=r.useState(0),he=fe[0],_e=fe[1],me=r.useState(""),ve=me[0],ye=me[1],Se=g.default().user,be=r.useRef(null),je=r.useRef(null),Ce=r.useRef(null),we=r.useRef(null);f.useConfigStore().configuration;var Te=r.useRef(null),Be=m.useAppSecRolesStore(function(e){return e.roles}),Fe=v.default(function(e){return e.rbacConfig}),Ee=r.useState("approval_required"),ke=Ee[0],qe=Ee[1],De=r.useState([]),ze=De[0],Oe=De[1],Ae=r.useState([]),Re=Ae[0],Ie=Ae[1],Le=r.useState(""),Ne=Le[0],Me=Le[1],We=r.useState({region:"",timezone:"",primeTime:[],genre:"",type:"",lowSelloutConfig:""}),Pe=We[0],Ge=We[1],Ue=function(e,n){return e.find(function(e){return e.value===n})||null},He=r.useMemo(function(){return R.map(function(e){return{label:e.scope_name,value:e.scope_name}})},[R]),Ke=r.useMemo(function(){var e,n,r;if(!Pe.genre)return null;var i=R.find(function(e){return e.scope_name===Pe.genre});return i?{id:i.id,title:i.scope_name||"Unnamed Template",description:(null===(e=i.description)||void 0===e?void 0:e.trim())||"No description available.",inheritedText:(null===(n=i.inheritance)||void 0===n?void 0:n[0])||void 0,rulesCount:i.rules_count||0,tiersCount:i.tier_count||0,isCopy:null!==(r=i.is_copy)&&void 0!==r&&r}:null},[Pe.genre,R]);r.useEffect(function(){return function(){Ce.current&&clearTimeout(Ce.current)}},[]);var Ye=function(n){return e.__awaiter(void 0,void 0,void 0,function(){var r,i,o;return e.__generator(this,function(t){switch(t.label){case 0:if(H)return[2];K(!0),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,l.retrieveGenreScopes({limit:"20",offset:String(n)})];case 2:return"success"===(null==(r=t.sent())?void 0:r.status)&&Array.isArray(null==r?void 0:r.data)?(i=r.data,I(function(r){if(0===n)return i;var o=new Set(r.map(function(e){return e.id})),t=i.filter(function(e){return!o.has(e.id)});return e.__spreadArray(e.__spreadArray([],r,!0),t,!0)}),i.length<20?G(!1):G(!0),M(n+20)):G(!1),[3,5];case 3:return o=t.sent(),console.error("[StationOnboard] Failed to fetch genre scopes:",o),G(!1),[3,5];case 4:return K(!1),[7];case 5:return[2]}})})};r.useEffect(function(){B&&(I([]),M(0),G(!0),Ye(0))},[B]);r.useEffect(function(){Ge(z?function(n){var r;return e.__assign(e.__assign({},n),{region:null!==(r=z.market)&&void 0!==r?r:""})}:{region:"",timezone:"",primeTime:[],genre:"",type:"",lowSelloutConfig:""})},[z]),r.useEffect(function(){var e=setTimeout(function(){ne(J)},500);return function(){return clearTimeout(e)}},[J]),r.useEffect(function(){e.__awaiter(void 0,void 0,void 0,function(){var n,r,i,o;return e.__generator(this,function(e){switch(e.label){case 0:if(!ee.trim())return Z([]),[2];oe(!0),e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,l.searchScopes({search_string:ee.trim()})];case 2:return"success"===(null==(n=e.sent())?void 0:n.status)&&Array.isArray(null==n?void 0:n.data)?(r=n.data.filter(function(e){var n,r=null!==(n=e.inheritance)&&void 0!==n?n:[],i=r.indexOf(e.scope_name);return!(i<=0)&&r[i-1]===Pe.genre}),i=r.map(function(e){var n,r,i;return{id:e.id,title:e.scope_name||"Unnamed Template",description:(null===(n=e.description)||void 0===n?void 0:n.trim())||"No description available.",inheritedText:(null===(r=e.inheritance)||void 0===r?void 0:r[0])||void 0,rulesCount:e.rules_count||0,tiersCount:e.tier_count||0,isCopy:null!==(i=e.is_copy)&&void 0!==i&&i}}),Z(i)):Z([]),[3,5];case 3:return o=e.sent(),console.error("[StationOnboard] Error searching scopes:",o),Z([]),[3,5];case 4:return oe(!1),[7];case 5:return[2]}})})},[ee,Pe.genre]),r.useEffect(function(){!ee.trim()&&Ke&&ce(Ke.id)},[ee,Ke]);var Xe=function(){setTimeout(function(){we.current&&we.current.scrollTo({top:we.current.scrollHeight,behavior:"smooth"})},100)},Ze=function(){ye(""),O(null),Ge({region:"",timezone:"",primeTime:[],genre:"",type:"",lowSelloutConfig:""}),Z([]),Q(""),ce(null),qe("approval_required"),Oe([]),Ie([]),Me(""),F()},Ve=function(n,r){var i;if("primeTime"!==n){var o=null!==(i=null==r?void 0:r.value)&&void 0!==i?i:"";Ge(function(r){var i;return e.__assign(e.__assign({},r),((i={})[n]=String(o),i))}),"genre"===n&&(le(!0),Ce.current&&clearTimeout(Ce.current),Ce.current=setTimeout(function(){var e=R.find(function(e){return e.scope_name===o});ce(e?e.id:null),le(!1)},800))}else{var t=(null==r?void 0:r.value)?String(r.value):"";Ge(function(n){return e.__assign(e.__assign({},n),{primeTime:t?[t]:[]})})}},Je=Boolean(z&&Pe.region&&Pe.timezone&&Pe.primeTime.length>0&&Pe.genre);return n.jsxs(i.Dialog,e.__assign({open:B,onClose:Ze,maxWidth:!1,disableEscapeKeyDown:!0,PaperProps:{sx:{width:"90vw",height:"90vh",borderRadius:"12px",display:"flex",flexDirection:"column",overflow:"hidden",fontFamily:"sans-serif"}}},{children:[n.jsx(t.Toast,{ref:be}),n.jsxs(i.Box,e.__assign({sx:{p:"20px 20px 20px 27px",borderBottom:"1px solid #F0F2F5",display:"flex",justifyContent:"space-between",alignItems:"center",bgcolor:"#fff"}},{children:[n.jsxs(i.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:.5}},{children:[n.jsx(i.Typography,e.__assign({sx:{fontSize:"18px",fontWeight:600,color:"#19213D"}},{children:"Onboard a Station"})),n.jsx(i.Typography,e.__assign({sx:{fontSize:"16px",fontWeight:400,color:"#666F8D"}},{children:"Onboard a station to start configuring learnings."}))]})),n.jsx(i.IconButton,e.__assign({onClick:Ze,disabled:xe,sx:{color:"#19213D"}},{children:n.jsx(o.X,{size:24})}))]})),n.jsxs(i.DialogContent,e.__assign({sx:{p:0,bgcolor:"#F8FAFC",display:"flex",flexDirection:"row",overflow:"hidden",position:"relative"}},{children:[n.jsx(c.default,{isLoading:xe,currentStep:he,onComplete:function(){ge(!1);var e=je.current;Ze(),E(e||void 0),je.current=null}}),n.jsx(i.Box,e.__assign({sx:{display:"flex",flex:1,flexDirection:"column",paddingY:"14px",paddingX:"20px",gap:2,overflowY:"auto"}},{children:n.jsxs(i.Box,e.__assign({sx:{display:"flex",gap:3}},{children:[n.jsxs(i.Box,e.__assign({ref:we,sx:{flex:1,bgcolor:"#fff",p:3,borderRadius:"16px",border:"1px solid #F0F2F5"}},{children:[n.jsx(i.Typography,e.__assign({sx:{fontSize:"1rem",fontWeight:600,mb:.5,color:"#19213D"}},{children:"Basic Details"})),n.jsx(i.Typography,e.__assign({sx:{fontSize:"0.75rem",color:"#00000080",mb:"20px"}},{children:"Set up basic station details to unlock AI recommended scopes."})),n.jsxs(i.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:"16px"}},{children:[n.jsxs(i.Box,e.__assign({className:d.default.formGroup},{children:[n.jsxs("label",e.__assign({className:d.default.label},{children:[n.jsx("span",e.__assign({className:d.default.asterisk},{children:"*"})),"Station Name/Call Letters"]})),n.jsx(a.default,{value:ve,onChange:ye,onStationSelect:function(e){return O(e)}})]})),n.jsx(x.default,{required:!0,disabled:!0,label:"Region",placeholder:"Select Region",value:Pe.region||void 0,isSearchable:!1}),n.jsx(x.default,{required:!0,label:"TimeZone",placeholder:"Select TimeZone",options:S,value:Ue(S,Pe.timezone),onOptionChange:function(e){return Ve("timezone",e)},isSearchable:!1}),n.jsx(x.default,{required:!0,label:"Prime Time Window",placeholder:"Select Prime Time",options:b,value:Ue(b,(null===(T=Pe.primeTime)||void 0===T?void 0:T[0])||""),onOptionChange:function(e){return Ve("primeTime",e)},isSearchable:!1}),n.jsx(i.Box,e.__assign({onClick:Xe,sx:{width:"100%"}},{children:n.jsx(x.default,{label:"Station Type",placeholder:"None",options:j,value:Ue(j,Pe.type),onOptionChange:function(n){Ve("type",n),"Low Sellout"!==(null==n?void 0:n.value)&&Ge(function(n){return e.__assign(e.__assign({},n),{lowSelloutConfig:""})})},isSearchable:!1})})),"Low Sellout"===Pe.type&&n.jsx(i.Box,e.__assign({onClick:Xe,sx:{width:"100%"}},{children:n.jsx(x.default,{label:"Low Sell Out Configurations",placeholder:"Select Configuration",options:C,value:Ue(C,Pe.lowSelloutConfig),onOptionChange:function(e){return Ve("lowSelloutConfig",e)},isSearchable:!1})})),h.useLearningTemplateStore.getState().backwardCompatibility&&n.jsxs("div",e.__assign({ref:Te,style:{display:"flex",flexDirection:"column",marginTop:"12px"}},{children:[n.jsx(i.Typography,e.__assign({sx:{fontSize:"1rem",fontWeight:600,mb:.5,color:"#19213D"}},{children:"Approval Settings"})),n.jsx(i.Typography,e.__assign({sx:{fontSize:"0.75rem",color:"#00000080",mb:"20px"}},{children:"Configure who can approve learnings before they get published."})),n.jsxs("div",e.__assign({style:{marginBottom:"12px",fontSize:"12px",color:"#8F2C23",gap:"16px"}},{children:[n.jsxs("div",e.__assign({style:{marginBottom:"12px",fontSize:"12px",color:"#8F2C23",gap:"12px"}},{children:[n.jsxs("div",e.__assign({role:"radio","aria-checked":"approval_required"===ke,tabIndex:0,style:{cursor:"pointer",display:"flex",flexDirection:"column",gap:"4px",marginBottom:"8px"},onClick:function(){return qe("approval_required")},onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||qe("approval_required")}},{children:[n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"8px"}},{children:[n.jsx("div",e.__assign({style:{display:"flex",height:"16px",width:"16px",flexShrink:0,alignItems:"center",justifyContent:"center",borderRadius:"50%",border:"2px solid ".concat("approval_required"===ke?"#2563EB":"#CBD5E1")}},{children:"approval_required"===ke&&n.jsx("div",{style:{height:"8px",width:"8px",borderRadius:"50%",backgroundColor:"#2563EB"}})})),n.jsx("span",e.__assign({style:{fontSize:"14px",fontWeight:500,color:"#19213D"}},{children:"Approval Required Before Publishing"}))]})),n.jsx("p",e.__assign({style:{margin:0,marginLeft:"24px",fontSize:"12px",color:"#666F8D"}},{children:"Learnings require approval before publishing."}))]})),n.jsxs("div",e.__assign({style:{gap:"16px"}},{children:["approval_required"===ke&&n.jsx(y.default,{selectedApprovers:ze,selectedGroupOfApprovers:Re,onApproversChange:function(e){Oe(e),Me("")},onGroupsChange:function(e){Ie(e),Me("")}}),Ne&&n.jsx("p",e.__assign({style:{margin:0,marginLeft:"24px",fontSize:"12px",color:"#8F2C23"}},{children:Ne}))]}))]})),n.jsxs("div",e.__assign({role:"radio","aria-checked":"publish_without"===ke,tabIndex:0,style:{cursor:"pointer",display:"flex",flexDirection:"column",gap:"4px"},onClick:function(){qe("publish_without"),Me("")},onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||(qe("publish_without"),Me(""))}},{children:[n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"8px"}},{children:[n.jsx("div",e.__assign({style:{display:"flex",height:"16px",width:"16px",flexShrink:0,alignItems:"center",justifyContent:"center",borderRadius:"50%",border:"2px solid ".concat("publish_without"===ke?"#2563EB":"#CBD5E1")}},{children:"publish_without"===ke&&n.jsx("div",{style:{height:"8px",width:"8px",borderRadius:"50%",backgroundColor:"#2563EB"}})})),n.jsx("span",e.__assign({style:{fontSize:"14px",fontWeight:500,color:"#19213D"}},{children:"Publish Without Approval"}))]})),n.jsx("p",e.__assign({style:{margin:0,marginLeft:"24px",fontSize:"12px",color:"#666F8D"}},{children:"Learnings can be published directly."}))]}))]}))]}))]}))]})),n.jsxs(i.Box,e.__assign({sx:{flex:1,bgcolor:"#fff",p:3,borderRadius:"12px",border:"1px solid #F0F2F5",display:"flex",flexDirection:"column"}},{children:[n.jsxs(i.Typography,e.__assign({sx:{fontSize:"1rem",fontWeight:600,mb:.5,color:"#19213D"}},{children:[n.jsx("span",e.__assign({style:{color:"#E53E3E",marginRight:"2px"}},{children:"*"})),"Select a scope for your station"]})),n.jsx(i.Typography,e.__assign({sx:{fontSize:"0.75rem",color:"#64748B",mb:"16px"}},{children:"Your station will inherit the rules from the selected scope."})),n.jsx(i.Box,e.__assign({sx:{mb:2}},{children:n.jsx(x.default,{required:!0,label:"",placeholder:"Select Genre",options:He,value:Ue(He,Pe.genre),onOptionChange:function(e){return Ve("genre",e)},isSearchable:!1,onMenuScrollToBottom:function(){!H&&P&&Ye(N)},isLoadingOptions:H,hasMoreOptions:P})})),n.jsx(i.Box,e.__assign({sx:{mb:3}},{children:se?n.jsx(u.default,{}):Ke?n.jsxs(i.Box,e.__assign({sx:{border:"1.5px solid #2563EB",borderRadius:"10px",p:"14px 16px",bgcolor:"#EFF6FF",display:"flex",alignItems:"flex-start",gap:"12px"}},{children:[n.jsx(i.Box,e.__assign({sx:{width:36,height:36,borderRadius:"8px",bgcolor:"#DBEAFE",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}},{children:n.jsxs("svg",e.__assign({width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"#2563EB",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:[n.jsx("circle",{cx:"12",cy:"12",r:"2"}),n.jsx("path",{d:"M16.24 7.76a6 6 0 0 1 0 8.49m-8.48-.01a6 6 0 0 1 0-8.49m11.31-2.82a10 10 0 0 1 0 14.14m-14.14 0a10 10 0 0 1 0-14.14"})]}))})),n.jsxs(i.Box,e.__assign({sx:{flex:1,minWidth:0}},{children:[n.jsx(i.Typography,e.__assign({sx:{fontSize:"0.875rem",fontWeight:600,color:"#1E3A5F",mb:"2px"}},{children:Ke.title})),n.jsx(i.Typography,e.__assign({sx:{fontSize:"0.75rem",color:"#2563EB",mb:"8px"}},{children:Ke.description})),n.jsxs(i.Box,e.__assign({sx:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"}},{children:[Ke.inheritedText&&n.jsxs(i.Box,e.__assign({component:"span",sx:{fontSize:"0.7rem",color:"#475569",bgcolor:"#F1F5F9",border:"1px solid #E2E8F0",borderRadius:"4px",px:"6px",py:"2px",display:"inline-flex",alignItems:"center",gap:"4px"}},{children:[n.jsxs("svg",e.__assign({width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:[n.jsx("polyline",{points:"15 3 21 3 21 9"}),n.jsx("path",{d:"M21 3L9 15"}),n.jsx("path",{d:"M3 21l6-6"})]})),Ke.inheritedText]})),n.jsxs(i.Box,e.__assign({component:"span",sx:{fontSize:"0.7rem",color:"#475569",bgcolor:"#F1F5F9",border:"1px solid #E2E8F0",borderRadius:"4px",px:"6px",py:"2px"}},{children:[Ke.rulesCount," rules"]})),n.jsxs(i.Box,e.__assign({component:"span",sx:{fontSize:"0.7rem",color:"#475569",bgcolor:"#F1F5F9",border:"1px solid #E2E8F0",borderRadius:"4px",px:"6px",py:"2px"}},{children:[Ke.tiersCount," Tiers"]}))]}))]}))]})):Pe.genre?null:n.jsx(i.Box,e.__assign({sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",opacity:.4,py:6,gap:1}},{children:n.jsx(i.Typography,e.__assign({sx:{fontSize:"0.75rem",color:"#94A3B8"}},{children:"Select a genre to load the matching scope"}))}))})),Pe.genre&&n.jsxs(n.Fragment,{children:[n.jsxs(i.Typography,e.__assign({sx:{fontSize:"1rem",fontWeight:600,mb:.5,color:"#19213D"}},{children:["Select an Existing Station from the “",Pe.genre,"” Scope"," ",n.jsx(i.Typography,e.__assign({component:"span",sx:{fontSize:"1rem",fontWeight:400,color:"#64748B"}},{children:"(Optional)"}))]})),n.jsxs(i.Typography,e.__assign({sx:{fontSize:"0.75rem",color:"#64748B",mb:"12px"}},{children:["Please select an existing station under the “",Pe.genre,"” category to copy its learnings."]})),n.jsxs("div",e.__assign({className:d.default.searchWrapper,style:{marginBottom:"12px"}},{children:[n.jsx("input",{type:"text",value:J,onChange:function(e){return Q(e.target.value)},placeholder:"Search for station...",className:d.default.searchInput}),n.jsx(o.Search,{className:d.default.searchIcon,size:16})]})),n.jsxs(i.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:2}},{children:[ie&&n.jsx(u.default,{}),!ie&&0===X.length&&ee.trim()&&n.jsxs(i.Typography,e.__assign({sx:{fontSize:"0.875rem",color:"#64748B",textAlign:"center",py:4}},{children:['No scopes found matching "',ee,'".']})),!ie&&X.map(function(r){return n.jsx(p.default,e.__assign({},r,{isSelected:ue===r.id,onSelect:function(e){var n;ce(ue===e?null!==(n=null==Ke?void 0:Ke.id)&&void 0!==n?n:null:e)}}),r.id)})]}))]})]}))]}))}))]})),n.jsxs(i.Box,e.__assign({sx:{p:"12px 20px",borderTop:"1px solid #F0F2F5",display:"flex",justifyContent:"flex-end",gap:2,bgcolor:"#fff"}},{children:[n.jsx("button",e.__assign({onClick:Ze,disabled:xe,style:{padding:"7px 10px",borderRadius:"6px",color:"#64748B",border:"1px solid #E2E8F0",backgroundColor:"#fff",cursor:"pointer",fontSize:"14px",fontWeight:500}},{children:"Cancel"})),n.jsx("button",e.__assign({onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var n,r,i,o,t,a,u,c,p,d,x,g,f,m,v,y,S,b,j;return e.__generator(this,function(C){switch(C.label){case 0:if(!z||!ue)return console.error("[StationOnboard] Missing required data for onboarding"),[2];if(h.useLearningTemplateStore.getState().backwardCompatibility&&"approval_required"===ke&&0===ze.length&&0===Re.length)return Me("Please select at least one approver or approver group."),setTimeout(function(){var e;null===(e=Te.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"center"})},50),[2];Me(""),n=Ke?e.__spreadArray([Ke],X,!0):X,r=n.find(function(e){return e.id===ue}),null==r?void 0:r.isCopy,ge(!0),_e(0),i=null,C.label=1;case 1:return C.trys.push([1,3,,4]),o=h.useLearningTemplateStore.getState().backwardCompatibility,t=o?{topic:"customRuleSet",customScopeGroupName:_.IL_CONFIG_CONSTANTS.CUSTOM_SCOPE_GROUP_NAME,scopeDescription:z.station_name||"New Station",parentScopeId:null!==(x=null==Ke?void 0:Ke.id)&&void 0!==x?x:null,customScopeName:z.station_name||"New Station",customScopeId:s.v4(),createByName:(null==Se?void 0:Se.firstname)||"System",createdBy:(null==Se?void 0:Se.email)||"system@audacy.com",scopeType:"Station",approvalRequired:"approval_required"===ke,audacyStationMetadata:{genre:Pe.genre,low_sellout_configurations:"Low Sellout"===Pe.type?Pe.lowSelloutConfig:null,market:z.market,primetime_windows:Pe.primeTime,region:z.region,station_guid:z.station_guid,station_type:""===Pe.type?null:Pe.type},appsecData:{application:null==Fe?void 0:Fe.applicationId,module:null==Fe?void 0:Fe.moduleId,roles:e.__spreadArray(e.__spreadArray([],"approval_required"===ke?[{users:ze.map(function(e){return e.email}),groups:Re.map(function(e){return e._id}),role:null!==(f=null===(g=Be.find(function(e){return"Learning Manager"===e.name}))||void 0===g?void 0:g._id)&&void 0!==f?f:""}]:[],!0),[{users:[null==Se?void 0:Se.email],groups:[],role:null!==(v=null===(m=Be.find(function(e){return"Instant Learning Admin"===e.name}))||void 0===m?void 0:m._id)&&void 0!==v?v:""}],!1)}}:{topic:"customRuleSet",scope_reference_id:null,scopeDescription:"demo",parentScopeId:null,scopeName:z.station_name||"New Station",scopeReferenceMetadata:{},applicationMappingId:k},console.log("[StationOnboard] Step 1: Creating rule set with payload:",t),[4,l.createRuleSet(t,q)];case 2:if(a=C.sent(),!(i=null===(y=null==a?void 0:a.data)||void 0===y?void 0:y.scopeId))throw new Error("Failed to create scope - no scopeId returned");return console.log("[StationOnboard] Step 1 Complete: Created scope with ID:",i),_e(1),[3,4];case 3:return u=C.sent(),console.error("[StationOnboard] Error creating rule set:",u),null===(S=be.current)||void 0===S||S.show({severity:"error",life:3e3,summary:"Error",detail:"Failed to create rule set. Please try again."}),ge(!1),_e(0),[2];case 4:return C.trys.push([4,6,,7]),c=null!==ue&&ue!==(null==Ke?void 0:Ke.id),p={source_scope_id:c?ue:null!==(b=null==Ke?void 0:Ke.id)&&void 0!==b?b:ue,target_scope_id:i,is_copy_parent_variant_id:c},console.log("[StationOnboard] Step 3: Inheriting scope with payload:",p),[4,l.inheritScopeBackwardCompatible(p)];case 5:return C.sent(),console.log("[StationOnboard] Step 3 Complete: Scope inherited"),_e(3),[3,7];case 6:return d=C.sent(),console.error("[StationOnboard] Error inheriting scope (no rollback):",d),null===(j=be.current)||void 0===j||j.show({severity:"error",life:3e3,summary:"Error",detail:"Failed to apply rule template. Please try again."}),ge(!1),_e(0),[2];case 7:return je.current=i,console.log("[StationOnboard] Onboarding completed successfully!"),[2]}})})},disabled:!Je||xe,style:{padding:"7px 10px",borderRadius:"6px",border:"none",backgroundColor:Je?"#2563EB":"#BFDBFE",color:"#fff",cursor:Je&&!xe?"pointer":"not-allowed",fontSize:"14px",fontWeight:500,display:"flex",alignItems:"center",gap:"7px"}},{children:xe?n.jsxs(n.Fragment,{children:[n.jsx(i.CircularProgress,{size:16,color:"inherit"}),n.jsx("span",{children:"Onboarding..."})]}):n.jsxs(n.Fragment,{children:[n.jsx("span",{children:"Onboard Station"}),n.jsx(o.ArrowRight,{size:16})]})}))]}))]}))};
|
|
2
2
|
//# sourceMappingURL=StationOnboardModal.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("zustand"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("zustand"),s=require("../apis/scopeApis.js"),n=require("./useEnvStore.js"),i=function(e,r){return!!r&&function(e){return e?"string"==typeof e?[e]:[e._id,e.id,e.resourceId,e.resource_id].filter(function(e){return"string"==typeof e&&e.length>0}):[]}(e).includes(r)},o=r.create(function(r,o){return{accessData:[],isLoading:!1,error:null,fetchPermissions:function(n,i){return e.__awaiter(void 0,void 0,void 0,function(){var o,t,a;return e.__generator(this,function(e){switch(e.label){case 0:if(!n)return[2];r({isLoading:!0,error:null}),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,s.appsecApi.get("/users/me",{params:{appId:n,resourceId:i}})];case 2:return o=e.sent(),r({accessData:(null===(a=o.data)||void 0===a?void 0:a.data)||[],isLoading:!1}),[3,4];case 3:return t=e.sent(),console.error("Failed to fetch permissions:",t),r({error:t.message||"Failed to fetch permissions",isLoading:!1}),[3,4];case 4:return[2]}})})},hasPermission:function(e,r){var s,t=o().accessData,a=null===(s=n.default.getState().rbacConfig)||void 0===s?void 0:s.applicationResourceId,u=function(e,r){return t.some(function(s){var n,o,t;return i(s.resourceId,r)&&null!==(t=null===(o=null===(n=s.role)||void 0===n?void 0:n.permissions)||void 0===o?void 0:o.some(function(r){return r.name===e}))&&void 0!==t&&t})};return!(!a||!u(e,a))||u(e,r)},hasGlobalPermission:function(e,r){return!!r&&(o().hasApplicationAccess(r)||o().hasPermission(e,r))},hasApplicationAccess:function(e){return!!e&&o().accessData.some(function(r){var s,n,o;return i(r.resourceId,e)&&null!==(o=null===(n=null===(s=r.role)||void 0===s?void 0:s.permissions)||void 0===n?void 0:n.some(function(e){return"ilotj.scope.access.application.user.add"===e.name}))&&void 0!==o&&o})},reset:function(){return r({accessData:[],isLoading:!1,error:null})}}});exports.usePermissionsStore=o;
|
|
2
2
|
//# sourceMappingURL=usePermissionsStore.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 L,deleteRuleSet as A,requestAccess as O}from"./apis/scopeApis.js";import{QUERY_PARAM_KEYS as w,setQueryParams as I}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 k from"./store/useEnvStore.js";import{useConfigStore as D}from"./store/useConfigStore.js";import{TooltipProvider as _}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=this,K=u.userDetails,V=u.llmStudioUrl,W=u.audacyBackendUrl,Y=u.ilLabels,J=u.config,X=u.rbacConfig,Z=u.auditLogConfig,$=u.app_integration_id,ee=u.backwardCompatibility,te=void 0!==ee&&ee,ne=m(function(e){return e.selectedRuleSetId}),re=m(function(e){return e.setSelectedRuleSetId}),oe=m(function(e){return e.error}),se=m(function(e){return e.setError}),ie=m(function(e){return e.setStations}),ae=m(function(e){return e.scopeTreeData}),le=m(function(e){return e.setScopeTreeData}),ce=a({isOpen:!1,type:"GLOBAL"}),ue=ce[0],de=ce[1],pe=a(!1),me=pe[0],fe=pe[1],ve=a(!1),ge=ve[0],he=ve[1],ye=a("learnings"),Se=ye[0],be=ye[1],Ce=a(null),Te=Ce[0],Ee=Ce[1],Le=a(null),Ae=Le[0],Oe=Le[1],we=l(null),Ie=l(null),Re=l(null),je=y();je.user;var Ne=je.setUser,ke=D(),De=ke.setConfig,_e=ke.setIlLabels,Pe=e([{type:"GLOBAL",label:"Global",addChildLabel:"Add Scope",addChildType:"SCOPE"},t({type:"SCOPE",label:"Scope"},!te&&{addChildLabel:"Add Subscope",addChildType:"SUBSCOPE"})],te?[]:[{type:"SUBSCOPE",label:"Subscope"}],!0),Ue=function(){try{return F()}catch(e){return{search:""}}}();c(function(){var e=new URLSearchParams(window.location.search),t=e.get(w.RULESET_ID),n=e.get(w.SECTION),r=n&&z.has(n)?n:"learnings";(null==t?void 0:t.length)&&re&&be&&(re(t),be(r))},[null==Ue?void 0:Ue.search,be,re]);var Ge=U(function(e){return e.fetchPermissions}),Me=U(function(e){return e.hasPermission}),Be=G(function(e){return e.setRoles}),Fe=k(function(e){return e.appsecRbacUrl})===X.appsecRbacUrl,qe=M(X.applicationId,Fe).data;c(function(){qe&&Be(qe.map(function(e){return{_id:e._id,name:e.name}}))},[qe,Be]),c(function(){var e;console.log("userDetails",K),Ne(K),console.log("llmStudioUrl",V),console.log("audacyBackendUrl",W),k.getState().setLlmStudioUrl(V),k.getState().setAudacyBackendUrl(W),k.getState().setRbacConfig(X),k.getState().setAuditLogConfig(Z),De(J),_e(Y),m.getState().setAppIntegrationId(null!=$?$:null),m.getState().setBackwardCompatibility(te),m.getState().setToken(null!==(e=K.accessToken)&&void 0!==e?e:null)},[K,Ne,V,W,X,Z,J,De,Y,_e,$,te]),c(function(){(null==K?void 0:K.accessToken)&&V&&S()},[$,null==K?void 0:K.accessToken,V]);var xe=function(e){return void 0===e&&(e=!0),n(p,void 0,void 0,function(){var n,o,s,i,a,l;return r(this,function(r){switch(r.label){case 0:e&&fe(!0),se(null),r.label=1;case 1:return r.trys.push([1,4,5,6]),[4,Ge(X.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($,K.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))?(Ee(null),le({data:i}),Ie.current?(re(Ie.current),be("learnings"),Ie.current=null):m.getState().selectedRuleSetId||re(i.id)):(Ee(null!==(l=s.id)&&void 0!==l?l:null),le(null)):(Ee(null),le(null))),[3,6];case 4:return a=r.sent(),console.error("Failed to fetch rule sets or permissions",a),se("Failed to load data. Please try again later."),[3,6];case 5:return fe(!1),[7];case 6:return[2]}})})};c(function(){var e;(null===(e=null==K?void 0:K.accessToken)||void 0===e?void 0:e.length)&&Fe?xe(!0):console.warn("Error: Trying to fetch rules without access token",K)},[null==K?void 0:K.accessToken,se,ie,X.applicationId,Fe]);var He=function(e){return n(p,void 0,void 0,function(){var n,s,i,a;return r(this,function(r){switch(r.label){case 0:he(!0),r.label=1;case 1:return r.trys.push([1,4,5,6]),ue.scopeId?[4,L({scope_id:ue.scopeId,scope_name:e})]:[2];case 2:return r.sent(),[4,xe(!0)];case 3:return r.sent(),de(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=Re.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 he(!1),[7];case 6:return[2]}})})},Qe=function(e,o,s){return n(p,void 0,void 0,function(){var n,o,s,i,a,l,c,u;return r(this,function(r){switch(r.label){case 0:he(!0),r.label=1;case 1:return r.trys.push([1,4,5,6]),[4,A(e,K.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],re(s),be("learnings"))),[4,xe(!0)];case 3:return r.sent(),de(function(e){return t(t({},e),{isOpen:!1})}),null===(a=Re.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=Re.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 he(!1),[7];case 6:return[2]}})})},ze=ae,Ke=Ae?{data:{id:Ae.stationId,name:Ae.stationName,type:"STATION",metrics:{learningsCount:Ae.learningsCount,stationsCount:0},children:[]}}:ze,Ve=!!(null==Ke?void 0:Ke.data);null===(d=null==Ke?void 0:Ke.data)||void 0===d||d.type;var We=U(function(e){return e.hasGlobalPermission})("ilotj.scope.global.create",X.applicationResourceId||""),Ye=(Ae?Q.filter(function(e){return"stations"!==e.id}):Q).filter(function(e){return!(!te&&"access"===e.id)});return o(_,{children:s("div",t({className:v.learningManagementContainer},{children:[o("div",t({className:v.mainWrapper},{children:me?o(j,{}):oe?s("div",t({className:v.errorContainer},{children:[o("div",t({className:v.errorTitle},{children:"Error Loading Data"})),o("p",t({className:v.errorDesc},{children:oe})),o("button",t({onClick:function(){return xe(!0)},className:v.tryAgainBtn},{children:"Try Again"}))]})):Ve?o(g,{onOpenCreateModal:function(){return de({isOpen:!0,type:"GLOBAL"})},onAddChild:function(e,t,n){return de({isOpen:!0,type:t,parentId:e,parentName:n})},onRenameChild:function(e,t){return de({isOpen:!0,type:"RENAME",scopeId:e,initialName:t})},onDeleteChild:function(e,t,o){return n(p,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,Qe(e)];case 1:return r.sent(),[3,3];case 2:de({isOpen:!0,type:"DELETE",scopeId:e,initialName:t,isSubscope:i}),r.label=3;case 3:return[2]}})})},canDeleteScope:function(e){return Me("ilotj.scope.delete",e)},canEditScope:function(e){return Me("ilotj.scope.edit",e)},canCreateScope:function(e){return Me("ilotj.scope.create",e)},onSectionSelect:function(e,t){var n;console.log("Section Selected:",{scopeId:e,sectionId:t}),I(((n={})[w.SECTION]="learnings"===t?null:t,n)),be(t),re(e)},activeSectionId:Se,scopeTreeData:Ke,sectionsConfig:Ye,onViewStation:function(e){we.current=ne,Oe(e),be("learnings"),re(e.stationId)},onRefreshRuleSets:function(e,t){void 0===e&&(e=!0),t&&(Ie.current=t),xe(e)},nodeTypesConfig:Pe,app_integration_id:$,token:K.accessToken}):o(h,{onCreate:function(){return de({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:We,noAccessTitle:"Access Restricted",noAccessDesc:"You do not have access to create a Global scope for this application.",onRequestAccess:function(){return n(p,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)||Te))return null===(i=Re.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,O(e)];case 2:return r.sent(),null===(a=Re.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=Re.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:Re,pt:{root:{style:{zIndex:9999}}}}),te&&ue.isOpen&&"DELETE"!==ue.type&&"RENAME"!==ue.type?o(P,{isOpen:!0,onClose:function(){return de(t(t({},ue),{isOpen:!1}))},onSubmit:function(e){return n(p,void 0,void 0,function(){var n,o,s,i,a,l,c,u,d,p,f,v,g,h,y,S,b,L,A,O;return r(this,function(r){switch(r.label){case 0:he(!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"===ue.type&&ue.parentId,a=i?"genreRuleSet":ue.type,o={topic:a,scope_reference_id:null,scopeDescription:"demo",parentScopeId:ue.parentId||null,scopeName:s,scopeReferenceMetadata:{},applicationMappingId:$}),[4,E(o,K.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(Ie.current=c,u=n&&(null===(y=o.topic)||void 0===y?void 0:y.toLowerCase().includes("genre")),d=!n&&"GLOBAL"!==ue.type&&ue.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:ue.parentId))return[3,10];if(!te)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:$||"",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,xe(!0)];case 11:return r.sent(),de(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===(L=Re.current)||void 0===L||L.show({severity:"error",summary:"Creation Failed",detail:(null===(O=null===(A=null==g?void 0:g.response)||void 0===A?void 0:A.data)||void 0===O?void 0:O.message)||"There was an error creating the scope. Please try again."}),g;case 13:return he(!1),[7];case 14:return[2]}})})},hasGlobalRuleSet:Ve,canCreateGlobal:We}):s(i,{children:[o(B,{isOpen:ue.isOpen&&"DELETE"!==ue.type&&"RENAME"!==ue.type,onClose:function(){return de(t(t({},ue),{isOpen:!1}))},onCreate:function(e){return He(null!=e?e:"")},hasGlobalRuleSet:Ve}),o(H,{isOpen:ue.isOpen&&"RENAME"===ue.type,onClose:function(){return de(t(t({},ue),{isOpen:!1}))},onSave:He,initialName:ue.initialName})]}),o(R,{isOpen:ue.isOpen&&"DELETE"===ue.type,onCancel:function(){return de(t(t({},ue),{isOpen:!1}))},onConfirm:function(){return Qe(ue.scopeId,ue.initialName,ue.isSubscope)},title:"Delete Scope",description:s(i,{children:["Deleting ",o("span",t({className:v.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:ge})]}))})}export{K as default};
|
|
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 L,deleteRuleSet as I,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),Le=Ee[0],Ie=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=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))?(Ie(null),ue({data:i}),je.current?(se(je.current),Te("learnings"),je.current=null):m.getState().selectedRuleSetId||se(i.id)):(Ie(null!==(l=s.id)&&void 0!==l?l:null),ue(null)):(Ie(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){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,L({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]}})})},Ve=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,I(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]}})})},We=ce,Ye=Oe?{data:{id:Oe.stationId,name:Oe.stationName,type:"STATION",metrics:{learningsCount:Oe.learningsCount,stationsCount:0},children:[]}}:We,Je=!!(null==Ye?void 0:Ye.data);null===(d=null==Ye?void 0:Ye.data)||void 0===d||d.type;var Xe=U(function(e){return e.hasGlobalPermission})("ilotj.scope.global.create",$.applicationResourceId||""),Ze=(Oe?Q.filter(function(e){return"stations"!==e.id}):Q).filter(function(e){return!(!re&&"access"===e.id)});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"}))]})):Je?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,Ve(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:Ye,sectionsConfig:Ze,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:Xe,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)||Le))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,L,I,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===(L=De.current)||void 0===L||L.show({severity:"error",summary:"Creation Failed",detail:(null===(A=null===(I=null==g?void 0:g.response)||void 0===I?void 0:I.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:Je,canCreateGlobal:Xe,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){return Ke(null!=e?e:"")},hasGlobalRuleSet:Je}),o(H,{isOpen:pe.isOpen&&"RENAME"===pe.type,onClose:function(){return me(t(t({},pe),{isOpen:!1}))},onSave:Ke,initialName:pe.initialName})]}),o(R,{isOpen:pe.isOpen&&"DELETE"===pe.type,onCancel:function(){return me(t(t({},pe),{isOpen:!1}))},onConfirm:function(){return Ve(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};
|
|
2
2
|
//# sourceMappingURL=LearningManagement.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"react";var t="data:image/svg+xml,%3Csvg%20width%3D%22160%22%20height%3D%22153%22%20viewBox%3D%220%200%20160%20153%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M79.2744%20143.735C116.627%20143.735%20146.909%20113.508%20146.909%2076.223C146.909%2038.9359%20116.627%208.71106%2079.2744%208.71106C41.9192%208.71106%2011.6367%2038.9359%2011.6367%2076.223C11.6367%20113.508%2041.9192%20143.735%2079.2744%20143.735Z%22%20fill%3D%22%23F8FAFC%22%2F%3E%3Cpath%20d%3D%22M116.902%2030.8984H43.3269C38.7417%2030.8984%2035.0234%2034.7993%2035.0234%2039.6097H125.205C125.205%2034.7993%20121.489%2030.8984%20116.902%2030.8984Z%22%20fill%3D%22%23D0D9E4%22%2F%3E%3Cpath%20d%3D%22M35.0234%2039.6094H125.205V109.239C125.205%20112.335%20123.994%20115.304%20121.834%20117.494C119.674%20119.684%20116.745%20120.914%20113.692%20120.914H46.5394C43.4834%20120.914%2040.555%20119.684%2038.3973%20117.494C36.2372%20115.304%2035.0234%20112.335%2035.0234%20109.239V39.6094Z%22%20fill%3D%22%23F1F5F9%22%2F%3E%3Cpath%20d%3D%22M125.155%2039.6592V109.239C125.155%20112.322%20123.949%20115.279%20121.798%20117.459C119.647%20119.639%20116.731%20120.864%20113.691%20120.864H46.5391C43.4967%20120.864%2040.5809%20119.639%2038.4326%20117.459C36.2818%20115.279%2035.0732%20112.322%2035.0732%20109.239V39.6592H125.155Z%22%20stroke%3D%22%2364748B%22%20stroke-opacity%3D%220.1%22%20stroke-width%3D%220.1%22%2F%3E%3Cpath%20d%3D%22M70.571%2048.3203H48.9307C48.4799%2048.3203%2048.1133%2049.295%2048.1133%2050.4981C48.1133%2051.7012%2048.4799%2052.6759%2048.9307%2052.6759H70.571C71.0218%2052.6759%2071.386%2051.7012%2071.386%2050.4981C71.386%2049.295%2071.0218%2048.3203%2070.571%2048.3203Z%22%20fill%3D%22url%28%23paint0_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M70.571%2067.1953H48.9307C48.4799%2067.1953%2048.1133%2068.17%2048.1133%2069.3731C48.1133%2070.5762%2048.4799%2071.5509%2048.9307%2071.5509H70.571C71.0218%2071.5509%2071.386%2070.5762%2071.386%2069.3731C71.386%2068.17%2071.0218%2067.1953%2070.571%2067.1953Z%22%20fill%3D%22url%28%23paint1_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M70.571%2086.0703H48.9307C48.4799%2086.0703%2048.1133%2087.0468%2048.1133%2088.2493C48.1133%2089.4517%2048.4799%2090.4259%2048.9307%2090.4259H70.571C71.0218%2090.4259%2071.386%2089.4517%2071.386%2088.2493C71.386%2087.0468%2071.0218%2086.0703%2070.571%2086.0703Z%22%20fill%3D%22url%28%23paint2_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M70.571%20104.945H48.9307C48.4799%20104.945%2048.1133%20105.922%2048.1133%20107.124C48.1133%20108.327%2048.4799%20109.301%2048.9307%20109.301H70.571C71.0218%20109.301%2071.386%20108.327%2071.386%20107.124C71.386%20105.922%2071.0218%20104.945%2070.571%20104.945Z%22%20fill%3D%22url%28%23paint3_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M116.507%2048.3203H78.6367C77.8481%2048.3203%2077.207%2049.295%2077.207%2050.4981C77.207%2051.7012%2077.8481%2052.6759%2078.6367%2052.6759H116.507C117.296%2052.6759%20117.934%2051.7012%20117.934%2050.4981C117.934%2049.295%20117.296%2048.3203%20116.507%2048.3203Z%22%20fill%3D%22url%28%23paint4_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M116.507%2086.0703H78.6367C77.8481%2086.0703%2077.207%2087.045%2077.207%2088.2481C77.207%2089.4512%2077.8481%2090.4259%2078.6367%2090.4259H116.507C117.296%2090.4259%20117.934%2089.4512%20117.934%2088.2481C117.934%2087.045%20117.296%2086.0703%20116.507%2086.0703Z%22%20fill%3D%22url%28%23paint5_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M116.507%2067.1953H78.6367C77.8481%2067.1953%2077.207%2068.17%2077.207%2069.3731C77.207%2070.5762%2077.8481%2071.5509%2078.6367%2071.5509H116.507C117.296%2071.5509%20117.934%2070.5762%20117.934%2069.3731C117.934%2068.17%20117.296%2067.1953%20116.507%2067.1953Z%22%20fill%3D%22url%28%23paint6_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M116.507%20104.945H78.6367C77.8481%20104.945%2077.207%20105.92%2077.207%20107.123C77.207%20108.326%2077.8481%20109.301%2078.6367%20109.301H116.507C117.296%20109.301%20117.934%20108.326%20117.934%20107.123C117.934%20105.92%20117.296%20104.945%20116.507%20104.945Z%22%20fill%3D%22url%28%23paint7_linear_1020_82405%29%22%2F%3E%3CforeignObject%20x%3D%2270.7116%22%20y%3D%2260.6843%22%20width%3D%2279.8961%22%20height%3D%2279.81%22%3E%3Cdiv%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%22%20style%3D%22backdrop-filter%3Ablur%288.34px%29%3Bclip-path%3Aurl%28%23bgblur_0_1020_82405_clip_path%29%3Bheight%3A100%25%3Bwidth%3A100%25%22%3E%3C%2Fdiv%3E%3C%2FforeignObject%3E%3Cpath%20data-figma-bg-blur-radius%3D%2216.6751%22%20d%3D%22M110.659%20123.819C123.513%20123.819%20133.932%20113.419%20133.932%20100.589C133.932%2087.7597%20123.513%2077.3594%20110.659%2077.3594C97.8062%2077.3594%2087.3867%2087.7597%2087.3867%20100.589C87.3867%20113.419%2097.8062%20123.819%20110.659%20123.819Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M110.659%2085.3419C111.63%2085.3458%20112.413%2086.1299%20112.411%2087.0961L112.395%2098.2651L123.584%2098.2817C124.555%2098.2856%20125.338%2099.0696%20125.339%20100.038C125.335%20101.007%20124.55%20101.789%20123.579%20101.79L112.39%20101.773L112.373%20112.942C112.372%20113.908%20111.586%20114.69%20110.615%20114.691C109.645%20114.687%20108.862%20113.903%20108.861%20112.935L108.877%20101.766L97.6878%20101.749C96.7198%20101.748%2095.9366%20100.964%2095.9355%2099.9948C95.9395%2099.0261%2096.725%2098.2443%2097.693%2098.2458L108.883%2098.2623L108.899%2087.0934C108.903%2086.1247%20109.689%2085.3429%20110.659%2085.3419Z%22%20fill%3D%22%23CBD5E1%22%2F%3E%3Cdefs%3E%3CclipPath%20id%3D%22bgblur_0_1020_82405_clip_path%22%20transform%3D%22translate%28-70.7116%20-60.6843%29%22%3E%3Cpath%20d%3D%22M110.659%20123.819C123.513%20123.819%20133.932%20113.419%20133.932%20100.589C133.932%2087.7597%20123.513%2077.3594%20110.659%2077.3594C97.8062%2077.3594%2087.3867%2087.7597%2087.3867%20100.589C87.3867%20113.419%2097.8062%20123.819%20110.659%20123.819Z%22%2F%3E%3C%2FclipPath%3E%3ClinearGradient%20id%3D%22paint0_linear_1020_82405%22%20x1%3D%2247.1291%22%20y1%3D%2252.497%22%20x2%3D%2272.7628%22%20y2%3D%2252.497%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint1_linear_1020_82405%22%20x1%3D%2247.1291%22%20y1%3D%2271.372%22%20x2%3D%2272.7628%22%20y2%3D%2271.372%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint2_linear_1020_82405%22%20x1%3D%2247.1291%22%20y1%3D%2290.247%22%20x2%3D%2272.7628%22%20y2%3D%2290.247%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint3_linear_1020_82405%22%20x1%3D%2247.1291%22%20y1%3D%22109.122%22%20x2%3D%2272.7628%22%20y2%3D%22109.122%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint4_linear_1020_82405%22%20x1%3D%2275.4847%22%20y1%3D%2252.497%22%20x2%3D%22120.344%22%20y2%3D%2252.497%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint5_linear_1020_82405%22%20x1%3D%2275.4847%22%20y1%3D%2290.247%22%20x2%3D%22120.344%22%20y2%3D%2290.247%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint6_linear_1020_82405%22%20x1%3D%2275.4847%22%20y1%3D%2271.372%22%20x2%3D%22120.344%22%20y2%3D%2271.372%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint7_linear_1020_82405%22%20x1%3D%2275.4847%22%20y1%3D%22109.122%22%20x2%3D%22120.344%22%20y2%3D%22109.122%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3C%2Fsvg%3E";export{t as default};
|
|
2
|
+
//# sourceMappingURL=Search-result(add new).svg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Search-result(add new).svg.js","sources":["../../../../src/features/LearningManagement/assets/Search-result(add new).svg"],"sourcesContent":["export default \"data:image/svg+xml,%3Csvg%20width%3D%22160%22%20height%3D%22153%22%20viewBox%3D%220%200%20160%20153%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M79.2744%20143.735C116.627%20143.735%20146.909%20113.508%20146.909%2076.223C146.909%2038.9359%20116.627%208.71106%2079.2744%208.71106C41.9192%208.71106%2011.6367%2038.9359%2011.6367%2076.223C11.6367%20113.508%2041.9192%20143.735%2079.2744%20143.735Z%22%20fill%3D%22%23F8FAFC%22%2F%3E%3Cpath%20d%3D%22M116.902%2030.8984H43.3269C38.7417%2030.8984%2035.0234%2034.7993%2035.0234%2039.6097H125.205C125.205%2034.7993%20121.489%2030.8984%20116.902%2030.8984Z%22%20fill%3D%22%23D0D9E4%22%2F%3E%3Cpath%20d%3D%22M35.0234%2039.6094H125.205V109.239C125.205%20112.335%20123.994%20115.304%20121.834%20117.494C119.674%20119.684%20116.745%20120.914%20113.692%20120.914H46.5394C43.4834%20120.914%2040.555%20119.684%2038.3973%20117.494C36.2372%20115.304%2035.0234%20112.335%2035.0234%20109.239V39.6094Z%22%20fill%3D%22%23F1F5F9%22%2F%3E%3Cpath%20d%3D%22M125.155%2039.6592V109.239C125.155%20112.322%20123.949%20115.279%20121.798%20117.459C119.647%20119.639%20116.731%20120.864%20113.691%20120.864H46.5391C43.4967%20120.864%2040.5809%20119.639%2038.4326%20117.459C36.2818%20115.279%2035.0732%20112.322%2035.0732%20109.239V39.6592H125.155Z%22%20stroke%3D%22%2364748B%22%20stroke-opacity%3D%220.1%22%20stroke-width%3D%220.1%22%2F%3E%3Cpath%20d%3D%22M70.571%2048.3203H48.9307C48.4799%2048.3203%2048.1133%2049.295%2048.1133%2050.4981C48.1133%2051.7012%2048.4799%2052.6759%2048.9307%2052.6759H70.571C71.0218%2052.6759%2071.386%2051.7012%2071.386%2050.4981C71.386%2049.295%2071.0218%2048.3203%2070.571%2048.3203Z%22%20fill%3D%22url%28%23paint0_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M70.571%2067.1953H48.9307C48.4799%2067.1953%2048.1133%2068.17%2048.1133%2069.3731C48.1133%2070.5762%2048.4799%2071.5509%2048.9307%2071.5509H70.571C71.0218%2071.5509%2071.386%2070.5762%2071.386%2069.3731C71.386%2068.17%2071.0218%2067.1953%2070.571%2067.1953Z%22%20fill%3D%22url%28%23paint1_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M70.571%2086.0703H48.9307C48.4799%2086.0703%2048.1133%2087.0468%2048.1133%2088.2493C48.1133%2089.4517%2048.4799%2090.4259%2048.9307%2090.4259H70.571C71.0218%2090.4259%2071.386%2089.4517%2071.386%2088.2493C71.386%2087.0468%2071.0218%2086.0703%2070.571%2086.0703Z%22%20fill%3D%22url%28%23paint2_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M70.571%20104.945H48.9307C48.4799%20104.945%2048.1133%20105.922%2048.1133%20107.124C48.1133%20108.327%2048.4799%20109.301%2048.9307%20109.301H70.571C71.0218%20109.301%2071.386%20108.327%2071.386%20107.124C71.386%20105.922%2071.0218%20104.945%2070.571%20104.945Z%22%20fill%3D%22url%28%23paint3_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M116.507%2048.3203H78.6367C77.8481%2048.3203%2077.207%2049.295%2077.207%2050.4981C77.207%2051.7012%2077.8481%2052.6759%2078.6367%2052.6759H116.507C117.296%2052.6759%20117.934%2051.7012%20117.934%2050.4981C117.934%2049.295%20117.296%2048.3203%20116.507%2048.3203Z%22%20fill%3D%22url%28%23paint4_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M116.507%2086.0703H78.6367C77.8481%2086.0703%2077.207%2087.045%2077.207%2088.2481C77.207%2089.4512%2077.8481%2090.4259%2078.6367%2090.4259H116.507C117.296%2090.4259%20117.934%2089.4512%20117.934%2088.2481C117.934%2087.045%20117.296%2086.0703%20116.507%2086.0703Z%22%20fill%3D%22url%28%23paint5_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M116.507%2067.1953H78.6367C77.8481%2067.1953%2077.207%2068.17%2077.207%2069.3731C77.207%2070.5762%2077.8481%2071.5509%2078.6367%2071.5509H116.507C117.296%2071.5509%20117.934%2070.5762%20117.934%2069.3731C117.934%2068.17%20117.296%2067.1953%20116.507%2067.1953Z%22%20fill%3D%22url%28%23paint6_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M116.507%20104.945H78.6367C77.8481%20104.945%2077.207%20105.92%2077.207%20107.123C77.207%20108.326%2077.8481%20109.301%2078.6367%20109.301H116.507C117.296%20109.301%20117.934%20108.326%20117.934%20107.123C117.934%20105.92%20117.296%20104.945%20116.507%20104.945Z%22%20fill%3D%22url%28%23paint7_linear_1020_82405%29%22%2F%3E%3CforeignObject%20x%3D%2270.7116%22%20y%3D%2260.6843%22%20width%3D%2279.8961%22%20height%3D%2279.81%22%3E%3Cdiv%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%22%20style%3D%22backdrop-filter%3Ablur%288.34px%29%3Bclip-path%3Aurl%28%23bgblur_0_1020_82405_clip_path%29%3Bheight%3A100%25%3Bwidth%3A100%25%22%3E%3C%2Fdiv%3E%3C%2FforeignObject%3E%3Cpath%20data-figma-bg-blur-radius%3D%2216.6751%22%20d%3D%22M110.659%20123.819C123.513%20123.819%20133.932%20113.419%20133.932%20100.589C133.932%2087.7597%20123.513%2077.3594%20110.659%2077.3594C97.8062%2077.3594%2087.3867%2087.7597%2087.3867%20100.589C87.3867%20113.419%2097.8062%20123.819%20110.659%20123.819Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M110.659%2085.3419C111.63%2085.3458%20112.413%2086.1299%20112.411%2087.0961L112.395%2098.2651L123.584%2098.2817C124.555%2098.2856%20125.338%2099.0696%20125.339%20100.038C125.335%20101.007%20124.55%20101.789%20123.579%20101.79L112.39%20101.773L112.373%20112.942C112.372%20113.908%20111.586%20114.69%20110.615%20114.691C109.645%20114.687%20108.862%20113.903%20108.861%20112.935L108.877%20101.766L97.6878%20101.749C96.7198%20101.748%2095.9366%20100.964%2095.9355%2099.9948C95.9395%2099.0261%2096.725%2098.2443%2097.693%2098.2458L108.883%2098.2623L108.899%2087.0934C108.903%2086.1247%20109.689%2085.3429%20110.659%2085.3419Z%22%20fill%3D%22%23CBD5E1%22%2F%3E%3Cdefs%3E%3CclipPath%20id%3D%22bgblur_0_1020_82405_clip_path%22%20transform%3D%22translate%28-70.7116%20-60.6843%29%22%3E%3Cpath%20d%3D%22M110.659%20123.819C123.513%20123.819%20133.932%20113.419%20133.932%20100.589C133.932%2087.7597%20123.513%2077.3594%20110.659%2077.3594C97.8062%2077.3594%2087.3867%2087.7597%2087.3867%20100.589C87.3867%20113.419%2097.8062%20123.819%20110.659%20123.819Z%22%2F%3E%3C%2FclipPath%3E%3ClinearGradient%20id%3D%22paint0_linear_1020_82405%22%20x1%3D%2247.1291%22%20y1%3D%2252.497%22%20x2%3D%2272.7628%22%20y2%3D%2252.497%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint1_linear_1020_82405%22%20x1%3D%2247.1291%22%20y1%3D%2271.372%22%20x2%3D%2272.7628%22%20y2%3D%2271.372%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint2_linear_1020_82405%22%20x1%3D%2247.1291%22%20y1%3D%2290.247%22%20x2%3D%2272.7628%22%20y2%3D%2290.247%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint3_linear_1020_82405%22%20x1%3D%2247.1291%22%20y1%3D%22109.122%22%20x2%3D%2272.7628%22%20y2%3D%22109.122%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint4_linear_1020_82405%22%20x1%3D%2275.4847%22%20y1%3D%2252.497%22%20x2%3D%22120.344%22%20y2%3D%2252.497%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint5_linear_1020_82405%22%20x1%3D%2275.4847%22%20y1%3D%2290.247%22%20x2%3D%22120.344%22%20y2%3D%2290.247%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint6_linear_1020_82405%22%20x1%3D%2275.4847%22%20y1%3D%2271.372%22%20x2%3D%22120.344%22%20y2%3D%2271.372%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint7_linear_1020_82405%22%20x1%3D%2275.4847%22%20y1%3D%22109.122%22%20x2%3D%22120.344%22%20y2%3D%22109.122%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3C%2Fsvg%3E\""],"names":["EmptyResultIconSVG"],"mappings":"cA0KA,IAAAA,EAAe"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e,__awaiter as
|
|
1
|
+
import{__assign as e,__awaiter as a,__generator as r}from"tslib";import{jsx as l,jsxs as i,Fragment as n}from"react/jsx-runtime";import{useState as s,useEffect as t}from"react";import{X as c,Loader2 as o}from"lucide-react";import d from"../styles/CreateLearningSetModal.module.css.js";var u=function(u){var m=u.isOpen,h=u.onClose,p=u.onSubmit,v=u.title,f=u.description,N=u.inputLabel,b=u.submitLabel,g=u.placeholder,C=void 0===g?"":g,y=u.initialValue,k=void 0===y?"":y,L=u.isLoading,S=void 0!==L&&L,x=s(""),B=x[0],j=x[1],M=s(null),q=M[0],w=M[1];if(t(function(){m&&(j(k),w(null))},[m,k]),!m)return null;return l("div",e({className:d.overlay},{children:i("div",e({className:d.modal},{children:[i("div",e({className:d.header},{children:[i("div",e({className:d.headerContent},{children:[l("h2",e({className:d.title},{children:v})),f&&l("p",e({className:d.description},{children:f}))]})),l("button",e({onClick:h,className:d.closeBtn,disabled:S},{children:l(c,{size:24})}))]})),l("div",e({className:d.form},{children:i("div",e({className:d.formGroup},{children:[i("label",e({className:d.label},{children:[l("span",e({className:d.asterisk},{children:"*"})),N]})),l("input",{type:"text",value:B,onChange:function(e){j(e.target.value),q&&w(null)},className:"".concat(d.inputField," ").concat(q?d.inputError:""),placeholder:C,disabled:S}),q&&l("p",e({className:d.errorMessage},{children:q}))]}))})),i("div",e({className:d.footer},{children:[l("button",e({onClick:h,className:d.cancelBtn,disabled:S},{children:"Cancel"})),l("button",e({onClick:function(){return a(void 0,void 0,void 0,function(){var e;return r(this,function(a){switch(a.label){case 0:if(!(B.trim()?(w(null),1):(w("".concat(N.replace("*","").trim()," is required")),0)))return[2];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,p(B)];case 2:return a.sent(),h(),[3,4];case 3:return e=a.sent(),w((null==e?void 0:e.message)||"An error occurred. Please try again."),[3,4];case 4:return[2]}})})},className:d.confirmBtn,disabled:S},{children:S?i(n,{children:[l(o,{className:d.spinner}),"Save"===b?"Saving...":"Creating..."]}):b}))]}))]}))}))};export{u as default};
|
|
2
2
|
//# sourceMappingURL=CreateLearningSetModal.js.map
|