@viswa-test/test-citation 0.0.378 → 0.0.381
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +151 -0
- package/dist/assests/icons/InfoAlert.js +2 -0
- package/dist/assests/icons/InfoAlert.js.map +1 -0
- package/dist/cjs/assests/icons/InfoAlert.js +2 -0
- package/dist/cjs/assests/icons/InfoAlert.js.map +1 -0
- package/dist/cjs/features/BPACitationRenderer/BPACitationRenderer.js +1 -1
- package/dist/cjs/features/CognitiveCompare/CitationAnchor.js +1 -1
- package/dist/cjs/features/CognitiveCompare/CognitiveCompare.js +1 -1
- package/dist/cjs/features/CognitiveCompare/CognitiveComparehelpers.js +1 -1
- package/dist/cjs/features/CognitiveCompare/CognitivePopup.js +1 -1
- package/dist/cjs/features/CognitiveCompare/Guidelines/components/GuidelinePanel.js +1 -1
- package/dist/cjs/features/CognitiveCompare/Guidelines/components/WebGptPanel.js +1 -1
- package/dist/cjs/features/CognitiveCompare/Guidelines/utils/processGuidelinesMarkdown.js +1 -1
- package/dist/cjs/features/CognitiveCompare/components/SectionAccordion.js +1 -1
- package/dist/cjs/features/CognitiveCompare/components/SubSectionAccordion.js +1 -1
- package/dist/cjs/features/CognitiveCompare/hooks/memoizedMarkdown.js +1 -1
- package/dist/cjs/features/CognitiveCompare/hooks/useCompareData.js +1 -1
- package/dist/cjs/features/CognitiveCompare/hooks/useLinesCalculator.js +1 -1
- package/dist/cjs/features/CognitiveCompare/hooks/useSideBySide.js +1 -1
- package/dist/cjs/features/CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.js +1 -1
- package/dist/cjs/features/GptWebCitation/GptWebCitation.js +1 -1
- package/dist/cjs/features/GptWebCitation/GptWebCitationImageCitation.js +1 -1
- package/dist/cjs/features/GptWebCitation/utils/fixedHeight.utils.js +1 -1
- package/dist/cjs/features/ParentCitationComponent/ParentCitationComponent.js +2 -0
- package/dist/cjs/features/ParentCitationComponent/ParentCitationComponent.js.map +1 -0
- package/dist/cjs/features/PdfViewer/PdfContainer.js +1 -1
- package/dist/cjs/features/PdfViewer/PdfStyle.js +1 -1
- package/dist/cjs/features/PdfViewer/PdfToolbar.js +1 -1
- package/dist/cjs/features/PdfViewer/PdfViewer.js +1 -1
- package/dist/cjs/features/PdfViewer/nyc-components/BoundaryCard.js +2 -0
- package/dist/cjs/features/PdfViewer/nyc-components/BoundaryCard.js.map +1 -0
- package/dist/cjs/features/PdfViewer/nyc-components/CardWrapper.js +2 -0
- package/dist/cjs/features/PdfViewer/nyc-components/CardWrapper.js.map +1 -0
- package/dist/cjs/features/PdfViewer/nyc-components/CognitiveIcon.js +2 -0
- package/dist/cjs/features/PdfViewer/nyc-components/CognitiveIcon.js.map +1 -0
- package/dist/cjs/features/PdfViewer/nyc-components/LabelCheck.js +2 -0
- package/dist/cjs/features/PdfViewer/nyc-components/LabelCheck.js.map +1 -0
- package/dist/cjs/features/PdfViewer/nyc-components/SegmentReviewPdfWrapper.js +2 -0
- package/dist/cjs/features/PdfViewer/nyc-components/SegmentReviewPdfWrapper.js.map +1 -0
- package/dist/cjs/features/PdfViewer/nyc-components/infoAlert.js +2 -0
- package/dist/cjs/features/PdfViewer/nyc-components/infoAlert.js.map +1 -0
- package/dist/cjs/features/PdfViewer/nyc-components/reviewStepAdapters.js +2 -0
- package/dist/cjs/features/PdfViewer/nyc-components/reviewStepAdapters.js.map +1 -0
- package/dist/cjs/features/PdfViewer/rotationManager.js +2 -0
- package/dist/cjs/features/PdfViewer/rotationManager.js.map +1 -0
- package/dist/cjs/features/PdfViewer/usePdfHighlight.js +1 -1
- package/dist/cjs/features/PromptCitation/CitationDependencyGraph.js +2 -0
- package/dist/cjs/features/PromptCitation/CitationDependencyGraph.js.map +1 -0
- package/dist/cjs/features/PromptCitation/PromptCitation.js +2 -0
- package/dist/cjs/features/PromptCitation/PromptCitation.js.map +1 -0
- package/dist/cjs/features/PromptCitation/_components/CodeEditor.js +2 -0
- package/dist/cjs/features/PromptCitation/_components/CodeEditor.js.map +1 -0
- package/dist/cjs/features/PromptCitation/_components/Markdownrenderer.js +2 -0
- package/dist/cjs/features/PromptCitation/_components/Markdownrenderer.js.map +1 -0
- package/dist/cjs/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.js +1 -1
- package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/plugins/InitialHtml.js +1 -1
- package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/plugins/ManualNode.js +1 -1
- package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/plugins/UpdateNode.js +1 -1
- package/dist/cjs/features/RequirementAI/components/RichTextEditor/RichTextEditor.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CitationAnchor.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/HistoryMenu.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/ManualEditPopup.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/UserStoryCard.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/UserStoryCard.module.css.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/cws/CwsEvent.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/cws/CwsEventProvider.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/cws/SocketManager.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/cws/useCwsEvent.js +1 -1
- package/dist/cjs/features/RequirementAI/components/ai-reasoning/AiReasonMarkdownWrapper.js +1 -1
- package/dist/cjs/features/RequirementAI/components/ai-reasoning/AiReasoningCitationContent.js +1 -1
- package/dist/cjs/features/RequirementAI/components/citations/file-citation/FileCitationContent.js +1 -1
- package/dist/cjs/features/RequirementAI/components/citations/file-citation/FileCitationContent.module.css.js +1 -1
- package/dist/cjs/features/RequirementAI/components/citations/file-citation/FileCitationRender.js +1 -1
- package/dist/cjs/features/RequirementAI/components/citations/readfile-citation/ReadFileCitationContent.js +1 -1
- package/dist/cjs/features/RequirementAI/components/lsc-reason-gap/CustomChatCrRedirection.js +1 -1
- package/dist/cjs/features/RequirementAI/components/lsc-reason-gap/GapFilterBlock.js +1 -1
- package/dist/cjs/features/RequirementAI/components/segment/Segment.js +1 -1
- package/dist/cjs/features/RequirementAI/components/segment/SegmentWrapper.js +1 -1
- package/dist/cjs/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalScreen.js +1 -1
- package/dist/cjs/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.js +1 -1
- package/dist/cjs/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.module.css.js +1 -1
- package/dist/cjs/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.js +1 -1
- package/dist/cjs/features/RequirementAI/hooks/useStreamContentHandler.js +1 -1
- package/dist/cjs/features/RequirementAI/utils/helpers.js +1 -1
- package/dist/cjs/features/RequirementAI/utils/proccess-stream.utils.js +1 -1
- package/dist/cjs/features/ReviewPanel/ReviewPanel.js +2 -0
- package/dist/cjs/features/ReviewPanel/ReviewPanel.js.map +1 -0
- package/dist/cjs/features/SegmentReviewComponents/BoundaryCard.js +2 -0
- package/dist/cjs/features/SegmentReviewComponents/BoundaryCard.js.map +1 -0
- package/dist/cjs/features/SegmentReviewComponents/CardWrapper.js +2 -0
- package/dist/cjs/features/SegmentReviewComponents/CardWrapper.js.map +1 -0
- package/dist/cjs/features/SegmentReviewComponents/ChartBreakoutCircle.js +2 -0
- package/dist/cjs/features/SegmentReviewComponents/ChartBreakoutCircle.js.map +1 -0
- package/dist/cjs/features/SegmentReviewComponents/CognitiveIcon.js +2 -0
- package/dist/cjs/features/SegmentReviewComponents/CognitiveIcon.js.map +1 -0
- package/dist/cjs/features/SegmentReviewComponents/CognitiveIntegrity.js +2 -0
- package/dist/cjs/features/SegmentReviewComponents/CognitiveIntegrity.js.map +1 -0
- package/dist/cjs/features/SegmentReviewComponents/CognitiveScoreBadge.js +2 -0
- package/dist/cjs/features/SegmentReviewComponents/CognitiveScoreBadge.js.map +1 -0
- package/dist/cjs/features/SegmentReviewComponents/LabelCheck.js +2 -0
- package/dist/cjs/features/SegmentReviewComponents/LabelCheck.js.map +1 -0
- package/dist/cjs/features/SegmentReviewComponents/PageCheck.js +2 -0
- package/dist/cjs/features/SegmentReviewComponents/PageCheck.js.map +1 -0
- package/dist/cjs/features/SegmentReviewComponents/PageTypeChoiceCheck.js +2 -0
- package/dist/cjs/features/SegmentReviewComponents/PageTypeChoiceCheck.js.map +1 -0
- package/dist/cjs/features/SegmentReviewComponents/RevertCard.js +2 -0
- package/dist/cjs/features/SegmentReviewComponents/RevertCard.js.map +1 -0
- package/dist/cjs/features/SegmentReviewComponents/RevertSuccessCard.js +2 -0
- package/dist/cjs/features/SegmentReviewComponents/RevertSuccessCard.js.map +1 -0
- package/dist/cjs/features/SegmentReviewComponents/RevertSummaryNotice.js +2 -0
- package/dist/cjs/features/SegmentReviewComponents/RevertSummaryNotice.js.map +1 -0
- package/dist/cjs/features/SegmentReviewComponents/ReviewedBoundaryActions.js +2 -0
- package/dist/cjs/features/SegmentReviewComponents/ReviewedBoundaryActions.js.map +1 -0
- package/dist/cjs/features/SegmentReviewComponents/ReviewedCard.js +2 -0
- package/dist/cjs/features/SegmentReviewComponents/ReviewedCard.js.map +1 -0
- package/dist/cjs/features/SegmentReviewComponents/SegmentReviewPdfWrapper.js +2 -0
- package/dist/cjs/features/SegmentReviewComponents/SegmentReviewPdfWrapper.js.map +1 -0
- package/dist/cjs/features/SegmentReviewComponents/helper.js +2 -0
- package/dist/cjs/features/SegmentReviewComponents/helper.js.map +1 -0
- package/dist/cjs/features/SegmentReviewComponents/reviewScore.js +2 -0
- package/dist/cjs/features/SegmentReviewComponents/reviewScore.js.map +1 -0
- package/dist/cjs/features/SegmentReviewComponents/reviewStepAdapters.js +2 -0
- package/dist/cjs/features/SegmentReviewComponents/reviewStepAdapters.js.map +1 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/service/redlineService.js +1 -1
- package/dist/cjs/utils/tagHelper.js +1 -1
- package/dist/features/BPACitationRenderer/BPACitationRenderer.js +1 -1
- package/dist/features/CognitiveCompare/CitationAnchor.js +1 -1
- package/dist/features/CognitiveCompare/CognitiveCompare.js +1 -1
- package/dist/features/CognitiveCompare/CognitiveComparehelpers.js +1 -1
- package/dist/features/CognitiveCompare/CognitivePopup.js +1 -1
- package/dist/features/CognitiveCompare/Guidelines/components/GuidelinePanel.js +1 -1
- package/dist/features/CognitiveCompare/Guidelines/components/WebGptPanel.js +1 -1
- package/dist/features/CognitiveCompare/Guidelines/utils/processGuidelinesMarkdown.js +1 -1
- package/dist/features/CognitiveCompare/components/SectionAccordion.js +1 -1
- package/dist/features/CognitiveCompare/components/SubSectionAccordion.js +1 -1
- package/dist/features/CognitiveCompare/hooks/memoizedMarkdown.js +1 -1
- package/dist/features/CognitiveCompare/hooks/useCompareData.js +1 -1
- package/dist/features/CognitiveCompare/hooks/useLinesCalculator.js +1 -1
- package/dist/features/CognitiveCompare/hooks/useSideBySide.js +1 -1
- package/dist/features/CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.js +1 -1
- package/dist/features/GptWebCitation/GptWebCitation.js +1 -1
- package/dist/features/GptWebCitation/GptWebCitationImageCitation.js +1 -1
- package/dist/features/GptWebCitation/utils/fixedHeight.utils.js +1 -1
- package/dist/features/ParentCitationComponent/ParentCitationComponent.js +2 -0
- package/dist/features/ParentCitationComponent/ParentCitationComponent.js.map +1 -0
- package/dist/features/PdfViewer/PdfContainer.js +1 -1
- package/dist/features/PdfViewer/PdfStyle.js +1 -1
- package/dist/features/PdfViewer/PdfToolbar.js +1 -1
- package/dist/features/PdfViewer/PdfViewer.js +1 -1
- package/dist/features/PdfViewer/nyc-components/BoundaryCard.js +2 -0
- package/dist/features/PdfViewer/nyc-components/BoundaryCard.js.map +1 -0
- package/dist/features/PdfViewer/nyc-components/CardWrapper.js +2 -0
- package/dist/features/PdfViewer/nyc-components/CardWrapper.js.map +1 -0
- package/dist/features/PdfViewer/nyc-components/CognitiveIcon.js +2 -0
- package/dist/features/PdfViewer/nyc-components/CognitiveIcon.js.map +1 -0
- package/dist/features/PdfViewer/nyc-components/LabelCheck.js +2 -0
- package/dist/features/PdfViewer/nyc-components/LabelCheck.js.map +1 -0
- package/dist/features/PdfViewer/nyc-components/SegmentReviewPdfWrapper.js +2 -0
- package/dist/features/PdfViewer/nyc-components/SegmentReviewPdfWrapper.js.map +1 -0
- package/dist/features/PdfViewer/nyc-components/infoAlert.js +2 -0
- package/dist/features/PdfViewer/nyc-components/infoAlert.js.map +1 -0
- package/dist/features/PdfViewer/nyc-components/reviewStepAdapters.js +2 -0
- package/dist/features/PdfViewer/nyc-components/reviewStepAdapters.js.map +1 -0
- package/dist/features/PdfViewer/rotationManager.js +2 -0
- package/dist/features/PdfViewer/rotationManager.js.map +1 -0
- package/dist/features/PdfViewer/usePdfHighlight.js +1 -1
- package/dist/features/PromptCitation/CitationDependencyGraph.js +2 -0
- package/dist/features/PromptCitation/CitationDependencyGraph.js.map +1 -0
- package/dist/features/PromptCitation/PromptCitation.js +2 -0
- package/dist/features/PromptCitation/PromptCitation.js.map +1 -0
- package/dist/features/PromptCitation/_components/CodeEditor.js +2 -0
- package/dist/features/PromptCitation/_components/CodeEditor.js.map +1 -0
- package/dist/features/PromptCitation/_components/Markdownrenderer.js +2 -0
- package/dist/features/PromptCitation/_components/Markdownrenderer.js.map +1 -0
- package/dist/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.js +1 -1
- package/dist/features/RequirementAI/components/RichTextEditor/Editor/plugins/InitialHtml.js +1 -1
- package/dist/features/RequirementAI/components/RichTextEditor/Editor/plugins/ManualNode.js +1 -1
- package/dist/features/RequirementAI/components/RichTextEditor/Editor/plugins/UpdateNode.js +1 -1
- package/dist/features/RequirementAI/components/RichTextEditor/RichTextEditor.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CitationAnchor.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/Popups/HistoryMenu.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/Popups/ManualEditPopup.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/UserStoryCard.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/UserStoryCard.module.css.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/cws/CwsEvent.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/cws/CwsEventProvider.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/cws/SocketManager.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/cws/useCwsEvent.js +1 -1
- package/dist/features/RequirementAI/components/ai-reasoning/AiReasonMarkdownWrapper.js +1 -1
- package/dist/features/RequirementAI/components/ai-reasoning/AiReasoningCitationContent.js +1 -1
- package/dist/features/RequirementAI/components/citations/file-citation/FileCitationContent.js +1 -1
- package/dist/features/RequirementAI/components/citations/file-citation/FileCitationContent.module.css.js +1 -1
- package/dist/features/RequirementAI/components/citations/file-citation/FileCitationRender.js +1 -1
- package/dist/features/RequirementAI/components/citations/readfile-citation/ReadFileCitationContent.js +1 -1
- package/dist/features/RequirementAI/components/lsc-reason-gap/CustomChatCrRedirection.js +1 -1
- package/dist/features/RequirementAI/components/lsc-reason-gap/GapFilterBlock.js +1 -1
- package/dist/features/RequirementAI/components/segment/Segment.js +1 -1
- package/dist/features/RequirementAI/components/segment/SegmentWrapper.js +1 -1
- package/dist/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalScreen.js +1 -1
- package/dist/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.js +1 -1
- package/dist/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.module.css.js +1 -1
- package/dist/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.js +1 -1
- package/dist/features/RequirementAI/hooks/useStreamContentHandler.js +1 -1
- package/dist/features/RequirementAI/utils/helpers.js +1 -1
- package/dist/features/RequirementAI/utils/proccess-stream.utils.js +1 -1
- package/dist/features/ReviewPanel/ReviewPanel.js +2 -0
- package/dist/features/ReviewPanel/ReviewPanel.js.map +1 -0
- package/dist/features/SegmentReviewComponents/BoundaryCard.js +2 -0
- package/dist/features/SegmentReviewComponents/BoundaryCard.js.map +1 -0
- package/dist/features/SegmentReviewComponents/CardWrapper.js +2 -0
- package/dist/features/SegmentReviewComponents/CardWrapper.js.map +1 -0
- package/dist/features/SegmentReviewComponents/ChartBreakoutCircle.js +2 -0
- package/dist/features/SegmentReviewComponents/ChartBreakoutCircle.js.map +1 -0
- package/dist/features/SegmentReviewComponents/CognitiveIcon.js +2 -0
- package/dist/features/SegmentReviewComponents/CognitiveIcon.js.map +1 -0
- package/dist/features/SegmentReviewComponents/CognitiveIntegrity.js +2 -0
- package/dist/features/SegmentReviewComponents/CognitiveIntegrity.js.map +1 -0
- package/dist/features/SegmentReviewComponents/CognitiveScoreBadge.js +2 -0
- package/dist/features/SegmentReviewComponents/CognitiveScoreBadge.js.map +1 -0
- package/dist/features/SegmentReviewComponents/LabelCheck.js +2 -0
- package/dist/features/SegmentReviewComponents/LabelCheck.js.map +1 -0
- package/dist/features/SegmentReviewComponents/PageCheck.js +2 -0
- package/dist/features/SegmentReviewComponents/PageCheck.js.map +1 -0
- package/dist/features/SegmentReviewComponents/PageTypeChoiceCheck.js +2 -0
- package/dist/features/SegmentReviewComponents/PageTypeChoiceCheck.js.map +1 -0
- package/dist/features/SegmentReviewComponents/RevertCard.js +2 -0
- package/dist/features/SegmentReviewComponents/RevertCard.js.map +1 -0
- package/dist/features/SegmentReviewComponents/RevertSuccessCard.js +2 -0
- package/dist/features/SegmentReviewComponents/RevertSuccessCard.js.map +1 -0
- package/dist/features/SegmentReviewComponents/RevertSummaryNotice.js +2 -0
- package/dist/features/SegmentReviewComponents/RevertSummaryNotice.js.map +1 -0
- package/dist/features/SegmentReviewComponents/ReviewedBoundaryActions.js +2 -0
- package/dist/features/SegmentReviewComponents/ReviewedBoundaryActions.js.map +1 -0
- package/dist/features/SegmentReviewComponents/ReviewedCard.js +2 -0
- package/dist/features/SegmentReviewComponents/ReviewedCard.js.map +1 -0
- package/dist/features/SegmentReviewComponents/SegmentReviewPdfWrapper.js +2 -0
- package/dist/features/SegmentReviewComponents/SegmentReviewPdfWrapper.js.map +1 -0
- package/dist/features/SegmentReviewComponents/helper.js +2 -0
- package/dist/features/SegmentReviewComponents/helper.js.map +1 -0
- package/dist/features/SegmentReviewComponents/reviewScore.js +2 -0
- package/dist/features/SegmentReviewComponents/reviewScore.js.map +1 -0
- package/dist/features/SegmentReviewComponents/reviewStepAdapters.js +2 -0
- package/dist/features/SegmentReviewComponents/reviewStepAdapters.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/service/redlineService.js +1 -1
- package/dist/types/src/CitationDependencyGraphTest.d.ts +4 -0
- package/dist/types/src/CitationDependencyGraphTest.d.ts.map +1 -0
- package/dist/types/src/RedlineApprovalCardTest.d.ts +1 -0
- package/dist/types/src/RedlineApprovalCardTest.d.ts.map +1 -0
- package/dist/types/src/RedlineEditorTest.d.ts.map +1 -1
- package/dist/types/src/RedlineEditorTest2.d.ts +3 -0
- package/dist/types/src/RedlineEditorTest2.d.ts.map +1 -0
- package/dist/types/src/RequirementAiTest.d.ts.map +1 -1
- package/dist/types/src/assests/icons/ChartSplitIcon.d.ts +3 -0
- package/dist/types/src/assests/icons/ChartSplitIcon.d.ts.map +1 -0
- package/dist/types/src/assests/icons/InfoAlert.d.ts +3 -0
- package/dist/types/src/assests/icons/InfoAlert.d.ts.map +1 -0
- package/dist/types/src/commonConstants.d.ts +31103 -0
- package/dist/types/src/commonConstants.d.ts.map +1 -0
- package/dist/types/src/features/BPACitationRenderer/BPACitationRenderer.d.ts.map +1 -1
- package/dist/types/src/features/BPACitationRenderer/BPACitationRenderer.types.d.ts +1 -0
- package/dist/types/src/features/BPACitationRenderer/BPACitationRenderer.types.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CitationAnchor.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CognitiveCompare.d.ts +1 -1
- package/dist/types/src/features/CognitiveCompare/CognitiveCompare.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CognitiveCompareTypes.d.ts +1 -1
- package/dist/types/src/features/CognitiveCompare/CognitiveCompareTypes.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CognitiveComparehelpers.d.ts +0 -12
- package/dist/types/src/features/CognitiveCompare/CognitiveComparehelpers.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/Guidelines/components/GuidelinePanel.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/Guidelines/components/WebGptPanel.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/Guidelines/constants/guidelines.mockData.d.ts +456 -11335
- package/dist/types/src/features/CognitiveCompare/Guidelines/constants/guidelines.mockData.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/Guidelines/utils/processGuidelinesMarkdown.d.ts +1 -14
- package/dist/types/src/features/CognitiveCompare/Guidelines/utils/processGuidelinesMarkdown.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/components/SectionAccordion.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/components/SubSectionAccordion.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/hooks/memoizedMarkdown.d.ts +1 -2
- package/dist/types/src/features/CognitiveCompare/hooks/memoizedMarkdown.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/hooks/useCompareData.d.ts +1 -1
- package/dist/types/src/features/CognitiveCompare/hooks/useCompareData.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/hooks/useLinesCalculator.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/hooks/useSideBySide.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/utils/buildComparisonRows.test.d.ts +2 -0
- package/dist/types/src/features/CognitiveCompare/utils/buildComparisonRows.test.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.d.ts +0 -1
- package/dist/types/src/features/CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.d.ts.map +1 -1
- package/dist/types/src/features/GptWebCitation/GptWebCitation.d.ts.map +1 -1
- package/dist/types/src/features/GptWebCitation/GptWebCitationImageCitation.d.ts +1 -2
- package/dist/types/src/features/GptWebCitation/GptWebCitationImageCitation.d.ts.map +1 -1
- package/dist/types/src/features/GptWebCitation/types.d.ts +0 -11
- package/dist/types/src/features/GptWebCitation/types.d.ts.map +1 -1
- package/dist/types/src/features/GptWebCitation/utils/fixedHeight.utils.d.ts +0 -2
- package/dist/types/src/features/GptWebCitation/utils/fixedHeight.utils.d.ts.map +1 -1
- package/dist/types/src/features/ParentCitationComponent/ParentCitationComponent.d.ts +128 -0
- package/dist/types/src/features/ParentCitationComponent/ParentCitationComponent.d.ts.map +1 -0
- package/dist/types/src/features/ParentCitationComponent/ParentCitationComponentTest.d.ts +13 -0
- package/dist/types/src/features/ParentCitationComponent/ParentCitationComponentTest.d.ts.map +1 -0
- package/dist/types/src/features/PdfViewer/PdfContainer.d.ts +4 -2
- package/dist/types/src/features/PdfViewer/PdfContainer.d.ts.map +1 -1
- package/dist/types/src/features/PdfViewer/PdfStyle.d.ts.map +1 -1
- package/dist/types/src/features/PdfViewer/PdfToolbar.d.ts +4 -1
- package/dist/types/src/features/PdfViewer/PdfToolbar.d.ts.map +1 -1
- package/dist/types/src/features/PdfViewer/PdfViewer.d.ts +19 -2
- package/dist/types/src/features/PdfViewer/PdfViewer.d.ts.map +1 -1
- package/dist/types/src/features/PdfViewer/coordinateTransformer.d.ts +41 -0
- package/dist/types/src/features/PdfViewer/coordinateTransformer.d.ts.map +1 -0
- package/dist/types/src/features/PdfViewer/nyc-components/BoundaryCard.d.ts +59 -0
- package/dist/types/src/features/PdfViewer/nyc-components/BoundaryCard.d.ts.map +1 -0
- package/dist/types/src/features/PdfViewer/nyc-components/CardWrapper.d.ts +19 -0
- package/dist/types/src/features/PdfViewer/nyc-components/CardWrapper.d.ts.map +1 -0
- package/dist/types/src/features/PdfViewer/nyc-components/CognitiveIcon.d.ts +3 -0
- package/dist/types/src/features/PdfViewer/nyc-components/CognitiveIcon.d.ts.map +1 -0
- package/dist/types/src/features/PdfViewer/nyc-components/LabelCheck.d.ts +77 -0
- package/dist/types/src/features/PdfViewer/nyc-components/LabelCheck.d.ts.map +1 -0
- package/dist/types/src/features/PdfViewer/nyc-components/SegmentReviewPdfWrapper.d.ts +47 -0
- package/dist/types/src/features/PdfViewer/nyc-components/SegmentReviewPdfWrapper.d.ts.map +1 -0
- package/dist/types/src/features/PdfViewer/nyc-components/index.d.ts +15 -0
- package/dist/types/src/features/PdfViewer/nyc-components/index.d.ts.map +1 -0
- package/dist/types/src/features/PdfViewer/nyc-components/infoAlert.d.ts +3 -0
- package/dist/types/src/features/PdfViewer/nyc-components/infoAlert.d.ts.map +1 -0
- package/dist/types/src/features/PdfViewer/nyc-components/reviewStepAdapters.d.ts +36 -0
- package/dist/types/src/features/PdfViewer/nyc-components/reviewStepAdapters.d.ts.map +1 -0
- package/dist/types/src/features/PdfViewer/rotationManager.d.ts +23 -0
- package/dist/types/src/features/PdfViewer/rotationManager.d.ts.map +1 -0
- package/dist/types/src/features/PdfViewer/usePdfHighlight.d.ts +1 -0
- package/dist/types/src/features/PdfViewer/usePdfHighlight.d.ts.map +1 -1
- package/dist/types/src/features/PromptCitation/CitationDependencyGraph.d.ts +56 -0
- package/dist/types/src/features/PromptCitation/CitationDependencyGraph.d.ts.map +1 -0
- package/dist/types/src/features/PromptCitation/PromptCitation.d.ts +326 -0
- package/dist/types/src/features/PromptCitation/PromptCitation.d.ts.map +1 -0
- package/dist/types/src/features/PromptCitation/PromptCitationTest.d.ts +4 -0
- package/dist/types/src/features/PromptCitation/PromptCitationTest.d.ts.map +1 -0
- package/dist/types/src/features/PromptCitation/_components/CodeEditor.d.ts +30 -0
- package/dist/types/src/features/PromptCitation/_components/CodeEditor.d.ts.map +1 -0
- package/dist/types/src/features/PromptCitation/_components/HighlightedCodeDetails.d.ts +16 -0
- package/dist/types/src/features/PromptCitation/_components/HighlightedCodeDetails.d.ts.map +1 -0
- package/dist/types/src/features/PromptCitation/_components/Markdownrenderer.d.ts +23 -0
- package/dist/types/src/features/PromptCitation/_components/Markdownrenderer.d.ts.map +1 -0
- package/dist/types/src/features/PromptCitation/_components/ThemeToggle.d.ts +12 -0
- package/dist/types/src/features/PromptCitation/_components/ThemeToggle.d.ts.map +1 -0
- package/dist/types/src/features/PromptCitation/_components/TooltipComponent.d.ts +8 -0
- package/dist/types/src/features/PromptCitation/_components/TooltipComponent.d.ts.map +1 -0
- package/dist/types/src/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.d.ts +29 -39
- package/dist/types/src/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/plugins/InitialHtml.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/plugins/ManualNode.d.ts +0 -2
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/plugins/ManualNode.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/plugins/UpdateNode.d.ts +0 -2
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/plugins/UpdateNode.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/RichTextEditor.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CitationAnchor.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.d.ts +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/userstory.mock.data.d.ts +5439 -84
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/userstory.mock.data.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.d.ts +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/ManualEditPopup.d.ts +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/ManualEditPopup.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.d.ts +2 -2
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/UserStoryCard.d.ts +2 -20
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/UserStoryCard.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/CwsEvent.d.ts +2 -7
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/CwsEvent.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/CwsEventProvider.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/SocketManager.d.ts +1 -15
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/SocketManager.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/useCwsEvent.d.ts +1 -2
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/useCwsEvent.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/ai-reasoning/AiReasonMarkdownWrapper.d.ts +2 -3
- package/dist/types/src/features/RequirementAI/components/ai-reasoning/AiReasonMarkdownWrapper.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/ai-reasoning/AiReasoningCitationContent.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/citations/file-citation/FileCitationContent.d.ts +0 -1
- package/dist/types/src/features/RequirementAI/components/citations/file-citation/FileCitationContent.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/citations/file-citation/FileCitationRender.d.ts +0 -1
- package/dist/types/src/features/RequirementAI/components/citations/file-citation/FileCitationRender.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/citations/readfile-citation/ReadFileCitationContent.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/lsc-reason-gap/CustomChatCrRedirection.d.ts +2 -3
- package/dist/types/src/features/RequirementAI/components/lsc-reason-gap/CustomChatCrRedirection.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/lsc-reason-gap/GapFilterBlock.d.ts +1 -1
- package/dist/types/src/features/RequirementAI/components/lsc-reason-gap/GapFilterBlock.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/segment/Segment.d.ts +1 -3
- package/dist/types/src/features/RequirementAI/components/segment/Segment.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/segment/SegmentWrapper.d.ts +1 -2
- package/dist/types/src/features/RequirementAI/components/segment/SegmentWrapper.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalContext.d.ts +0 -1
- package/dist/types/src/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalContext.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalScreen.d.ts +0 -2
- package/dist/types/src/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalScreen.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.d.ts +1 -2
- package/dist/types/src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.d.ts +1 -2
- package/dist/types/src/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/hooks/useStreamContentHandler.d.ts +1 -1
- package/dist/types/src/features/RequirementAI/hooks/useStreamContentHandler.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/interfaces/userstory.interface.d.ts +0 -2
- package/dist/types/src/features/RequirementAI/interfaces/userstory.interface.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/types/aiReasoning.type.d.ts +0 -7
- package/dist/types/src/features/RequirementAI/types/aiReasoning.type.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/types/segment.type.d.ts +1 -2
- package/dist/types/src/features/RequirementAI/types/segment.type.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/utils/helpers.d.ts +0 -2
- package/dist/types/src/features/RequirementAI/utils/helpers.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/utils/proccess-stream.utils.d.ts.map +1 -1
- package/dist/types/src/features/SegmentReviewComponents/BoundaryCard.d.ts +85 -0
- package/dist/types/src/features/SegmentReviewComponents/BoundaryCard.d.ts.map +1 -0
- package/dist/types/src/features/SegmentReviewComponents/CardWrapper.d.ts +26 -0
- package/dist/types/src/features/SegmentReviewComponents/CardWrapper.d.ts.map +1 -0
- package/dist/types/src/features/SegmentReviewComponents/ChartBreakoutCircle.d.ts +3 -0
- package/dist/types/src/features/SegmentReviewComponents/ChartBreakoutCircle.d.ts.map +1 -0
- package/dist/types/src/features/SegmentReviewComponents/CognitiveIcon.d.ts +3 -0
- package/dist/types/src/features/SegmentReviewComponents/CognitiveIcon.d.ts.map +1 -0
- package/dist/types/src/features/SegmentReviewComponents/CognitiveIntegrity.d.ts +33 -0
- package/dist/types/src/features/SegmentReviewComponents/CognitiveIntegrity.d.ts.map +1 -0
- package/dist/types/src/features/SegmentReviewComponents/CognitiveScoreBadge.d.ts +7 -0
- package/dist/types/src/features/SegmentReviewComponents/CognitiveScoreBadge.d.ts.map +1 -0
- package/dist/types/src/features/SegmentReviewComponents/LabelCheck.d.ts +87 -0
- package/dist/types/src/features/SegmentReviewComponents/LabelCheck.d.ts.map +1 -0
- package/dist/types/src/features/SegmentReviewComponents/PageCheck.d.ts +57 -0
- package/dist/types/src/features/SegmentReviewComponents/PageCheck.d.ts.map +1 -0
- package/dist/types/src/features/SegmentReviewComponents/PageTypeChoiceCheck.d.ts +28 -0
- package/dist/types/src/features/SegmentReviewComponents/PageTypeChoiceCheck.d.ts.map +1 -0
- package/dist/types/src/features/SegmentReviewComponents/RevertCard.d.ts +37 -0
- package/dist/types/src/features/SegmentReviewComponents/RevertCard.d.ts.map +1 -0
- package/dist/types/src/features/SegmentReviewComponents/RevertSuccessCard.d.ts +9 -0
- package/dist/types/src/features/SegmentReviewComponents/RevertSuccessCard.d.ts.map +1 -0
- package/dist/types/src/features/SegmentReviewComponents/RevertSummaryNotice.d.ts +7 -0
- package/dist/types/src/features/SegmentReviewComponents/RevertSummaryNotice.d.ts.map +1 -0
- package/dist/types/src/features/SegmentReviewComponents/ReviewedBoundaryActions.d.ts +17 -0
- package/dist/types/src/features/SegmentReviewComponents/ReviewedBoundaryActions.d.ts.map +1 -0
- package/dist/types/src/features/SegmentReviewComponents/ReviewedCard.d.ts +33 -0
- package/dist/types/src/features/SegmentReviewComponents/ReviewedCard.d.ts.map +1 -0
- package/dist/types/src/features/SegmentReviewComponents/SegmentReviewPdfWrapper.d.ts +124 -0
- package/dist/types/src/features/SegmentReviewComponents/SegmentReviewPdfWrapper.d.ts.map +1 -0
- package/dist/types/src/features/SegmentReviewComponents/SegmentReviewRedirectionTest.d.ts +13 -0
- package/dist/types/src/features/SegmentReviewComponents/SegmentReviewRedirectionTest.d.ts.map +1 -0
- package/dist/types/src/features/SegmentReviewComponents/helper.d.ts +51 -0
- package/dist/types/src/features/SegmentReviewComponents/helper.d.ts.map +1 -0
- package/dist/types/src/features/SegmentReviewComponents/helper.test.d.ts +2 -0
- package/dist/types/src/features/SegmentReviewComponents/helper.test.d.ts.map +1 -0
- package/dist/types/src/features/SegmentReviewComponents/index.d.ts +25 -0
- package/dist/types/src/features/SegmentReviewComponents/index.d.ts.map +1 -0
- package/dist/types/src/features/SegmentReviewComponents/reviewScore.d.ts +4 -0
- package/dist/types/src/features/SegmentReviewComponents/reviewScore.d.ts.map +1 -0
- package/dist/types/src/features/SegmentReviewComponents/reviewStepAdapters.d.ts +243 -0
- package/dist/types/src/features/SegmentReviewComponents/reviewStepAdapters.d.ts.map +1 -0
- package/dist/types/src/features/SegmentReviewComponents/segmentReviewEdgeCases.test.d.ts +2 -0
- package/dist/types/src/features/SegmentReviewComponents/segmentReviewEdgeCases.test.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +8 -0
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/service/redlineService.d.ts.map +1 -1
- package/dist/types/src/utils/tagHelper.d.ts +0 -9
- package/dist/types/src/utils/tagHelper.d.ts.map +1 -1
- package/dist/utils/tagHelper.js +1 -1
- package/package.json +12 -2
- package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/constants/updateTags.js +0 -2
- package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/constants/updateTags.js.map +0 -1
- package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/plugins/ProtectTableCellBoundaries.js +0 -2
- package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/plugins/ProtectTableCellBoundaries.js.map +0 -1
- package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/utils/manualEditSerialization.js +0 -2
- package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/utils/manualEditSerialization.js.map +0 -1
- package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/utils/normalizeRedlineMarkdown.js +0 -2
- package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/utils/normalizeRedlineMarkdown.js.map +0 -1
- package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/utils/preserveMarkdownEmphasis.js +0 -2
- package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/utils/preserveMarkdownEmphasis.js.map +0 -1
- package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/utils/preserveMarkdownLineBreaks.js +0 -2
- package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/utils/preserveMarkdownLineBreaks.js.map +0 -1
- package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/utils/preserveMarkdownListFormatting.js +0 -2
- package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/utils/preserveMarkdownListFormatting.js.map +0 -1
- package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/utils/preserveReviewBoundaryWhitespace.js +0 -2
- package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/utils/preserveReviewBoundaryWhitespace.js.map +0 -1
- package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/utils/preserveTableDelimiters.js +0 -2
- package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/utils/preserveTableDelimiters.js.map +0 -1
- package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/utils/tableBoundaryRedlines.js +0 -2
- package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/utils/tableBoundaryRedlines.js.map +0 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.css.js +0 -2
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.css.js.map +0 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.js +0 -2
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.js.map +0 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.css.js +0 -2
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.css.js.map +0 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.js +0 -2
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.js.map +0 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.css.js +0 -2
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.css.js.map +0 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.js +0 -2
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.js.map +0 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/avatarUtils.js +0 -2
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/avatarUtils.js.map +0 -1
- package/dist/cjs/features/RequirementAI/components/userstory-with-citation/utils/inlineMarkdown.js +0 -2
- package/dist/cjs/features/RequirementAI/components/userstory-with-citation/utils/inlineMarkdown.js.map +0 -1
- package/dist/cjs/features/RequirementAI/utils/exponential-retry.js +0 -2
- package/dist/cjs/features/RequirementAI/utils/exponential-retry.js.map +0 -1
- package/dist/features/RequirementAI/components/RichTextEditor/Editor/constants/updateTags.js +0 -2
- package/dist/features/RequirementAI/components/RichTextEditor/Editor/constants/updateTags.js.map +0 -1
- package/dist/features/RequirementAI/components/RichTextEditor/Editor/plugins/ProtectTableCellBoundaries.js +0 -2
- package/dist/features/RequirementAI/components/RichTextEditor/Editor/plugins/ProtectTableCellBoundaries.js.map +0 -1
- package/dist/features/RequirementAI/components/RichTextEditor/Editor/utils/manualEditSerialization.js +0 -2
- package/dist/features/RequirementAI/components/RichTextEditor/Editor/utils/manualEditSerialization.js.map +0 -1
- package/dist/features/RequirementAI/components/RichTextEditor/Editor/utils/normalizeRedlineMarkdown.js +0 -2
- package/dist/features/RequirementAI/components/RichTextEditor/Editor/utils/normalizeRedlineMarkdown.js.map +0 -1
- package/dist/features/RequirementAI/components/RichTextEditor/Editor/utils/preserveMarkdownEmphasis.js +0 -2
- package/dist/features/RequirementAI/components/RichTextEditor/Editor/utils/preserveMarkdownEmphasis.js.map +0 -1
- package/dist/features/RequirementAI/components/RichTextEditor/Editor/utils/preserveMarkdownLineBreaks.js +0 -2
- package/dist/features/RequirementAI/components/RichTextEditor/Editor/utils/preserveMarkdownLineBreaks.js.map +0 -1
- package/dist/features/RequirementAI/components/RichTextEditor/Editor/utils/preserveMarkdownListFormatting.js +0 -2
- package/dist/features/RequirementAI/components/RichTextEditor/Editor/utils/preserveMarkdownListFormatting.js.map +0 -1
- package/dist/features/RequirementAI/components/RichTextEditor/Editor/utils/preserveReviewBoundaryWhitespace.js +0 -2
- package/dist/features/RequirementAI/components/RichTextEditor/Editor/utils/preserveReviewBoundaryWhitespace.js.map +0 -1
- package/dist/features/RequirementAI/components/RichTextEditor/Editor/utils/preserveTableDelimiters.js +0 -2
- package/dist/features/RequirementAI/components/RichTextEditor/Editor/utils/preserveTableDelimiters.js.map +0 -1
- package/dist/features/RequirementAI/components/RichTextEditor/Editor/utils/tableBoundaryRedlines.js +0 -2
- package/dist/features/RequirementAI/components/RichTextEditor/Editor/utils/tableBoundaryRedlines.js.map +0 -1
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.css.js +0 -2
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.css.js.map +0 -1
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.js +0 -2
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.js.map +0 -1
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.css.js +0 -2
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.css.js.map +0 -1
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.js +0 -2
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.js.map +0 -1
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.css.js +0 -2
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.css.js.map +0 -1
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.js +0 -2
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.js.map +0 -1
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/avatarUtils.js +0 -2
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/avatarUtils.js.map +0 -1
- package/dist/features/RequirementAI/components/userstory-with-citation/utils/inlineMarkdown.js +0 -2
- package/dist/features/RequirementAI/components/userstory-with-citation/utils/inlineMarkdown.js.map +0 -1
- package/dist/features/RequirementAI/utils/exponential-retry.js +0 -2
- package/dist/features/RequirementAI/utils/exponential-retry.js.map +0 -1
- package/dist/types/src/CitationAccordionTest.d.ts +0 -1
- package/dist/types/src/CitationAccordionTest.d.ts.map +0 -1
- package/dist/types/src/MockDeviationSummary.d.ts +0 -1
- package/dist/types/src/MockDeviationSummary.d.ts.map +0 -1
- package/dist/types/src/features/CognitiveCompare/Guidelines/constants/new-guidelines.mockData.d.ts +0 -33
- package/dist/types/src/features/CognitiveCompare/Guidelines/constants/new-guidelines.mockData.d.ts.map +0 -1
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/constants/updateTags.d.ts +0 -2
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/constants/updateTags.d.ts.map +0 -1
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/plugins/ProtectTableCellBoundaries.d.ts +0 -3
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/plugins/ProtectTableCellBoundaries.d.ts.map +0 -1
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/plugins/reviewBoundaryLexical.test.d.ts +0 -2
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/plugins/reviewBoundaryLexical.test.d.ts.map +0 -1
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/utils/manualEditSerialization.d.ts +0 -7
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/utils/manualEditSerialization.d.ts.map +0 -1
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/utils/normalizeRedlineMarkdown.d.ts +0 -2
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/utils/normalizeRedlineMarkdown.d.ts.map +0 -1
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/utils/preserveMarkdownEmphasis.d.ts +0 -29
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/utils/preserveMarkdownEmphasis.d.ts.map +0 -1
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/utils/preserveMarkdownEmphasis.test.d.ts +0 -2
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/utils/preserveMarkdownEmphasis.test.d.ts.map +0 -1
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/utils/preserveMarkdownLineBreaks.d.ts +0 -7
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/utils/preserveMarkdownLineBreaks.d.ts.map +0 -1
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/utils/preserveMarkdownListFormatting.d.ts +0 -3
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/utils/preserveMarkdownListFormatting.d.ts.map +0 -1
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/utils/preserveReviewBoundaryWhitespace.d.ts +0 -86
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/utils/preserveReviewBoundaryWhitespace.d.ts.map +0 -1
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/utils/preserveReviewBoundaryWhitespace.test.d.ts +0 -9
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/utils/preserveReviewBoundaryWhitespace.test.d.ts.map +0 -1
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/utils/preserveTableDelimiters.d.ts +0 -7
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/utils/preserveTableDelimiters.d.ts.map +0 -1
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/utils/tableBoundaryRedlines.d.ts +0 -5
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/utils/tableBoundaryRedlines.d.ts.map +0 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.d.ts +0 -10
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.d.ts.map +0 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.d.ts +0 -17
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.d.ts.map +0 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.d.ts +0 -23
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.d.ts.map +0 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Avatar/avatarUtils.d.ts +0 -3
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Avatar/avatarUtils.d.ts.map +0 -1
- package/dist/types/src/features/RequirementAI/components/common/onDemandCitationButton.d.ts +0 -12
- package/dist/types/src/features/RequirementAI/components/common/onDemandCitationButton.d.ts.map +0 -1
- package/dist/types/src/features/RequirementAI/components/userstory-with-citation/utils/inlineMarkdown.d.ts +0 -9
- package/dist/types/src/features/RequirementAI/components/userstory-with-citation/utils/inlineMarkdown.d.ts.map +0 -1
- package/dist/types/src/features/RequirementAI/utils/exponential-retry.d.ts +0 -12
- package/dist/types/src/features/RequirementAI/utils/exponential-retry.d.ts.map +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{__assign as o}from"tslib";import{jsx as e,jsxs as n,Fragment as l}from"react/jsx-runtime";import i,{useState as t,useRef as r,useEffect as d}from"react";import a from"@mui/material/Dialog";import s from"@mui/material/DialogContent";import p from"@mui/material/IconButton";import{InfoOutlined as c,Close as u}from"@mui/icons-material";import f from"@mui/material/Accordion";import v from"@mui/material/AccordionSummary";import h from"@mui/material/AccordionDetails";import m from"@mui/icons-material/ExpandMore";import g from"./_components/CodeEditor.js";import{themeManager as y}from"../../utils/themeManager.js";import{MarkdownRenderer as x}from"./_components/Markdownrenderer.js";import b from"@mui/material/Tooltip";import k from"../SPBAnalysisPanel/DependencyGraph.js";function w(e){if(!e||"object"!=typeof e)return null;var n=["Context & Inputs","Core Logic & Rules","Outputs & Schema"];if(Array.isArray(e.nodes)&&Array.isArray(e.edges)){var l=e.nodes,i=Array.isArray(e.clusters)&&e.clusters.length>0?e.clusters:null,t=new Set(l.map(function(o){return o.cluster_id}));if(!i||t.size<=1){var r=Math.max(1,Math.min(3,Math.ceil(l.length/3)));i=Array.from({length:r},function(o,e){return{id:"cl_".concat(e+1),label:n[e]||"Group ".concat(e+1)}}),l=l.map(function(e,n){var l=n%r,d=Math.floor(n/r);return o(o({},e),{cluster_id:i[l].id,x:e.x&&t.size>1?e.x:450*l+200,y:e.y&&t.size>1?e.y:180*d+100})})}return{graph_id:e.graph_id||"spb_graph",prompt_id:e.prompt_id||"",last_analyzed_at:e.last_analyzed_at||(new Date).toISOString(),clusters:i,nodes:l,edges:e.edges}}var d=Object.keys(e);if(0===d.length)return null;var a=d.length,s=Math.max(1,Math.min(3,Math.ceil(a/3))),p=Array.from({length:s},function(o,e){return{id:"cl_".concat(e+1),label:n[e]||"Group ".concat(e+1)}}),c=[],u=[];return d.forEach(function(o,n){var l=n%s,i=Math.floor(n/s),t=p[l].id,r=450*l+200,d=180*i+100,a=o.split("_").map(function(o){return o.charAt(0).toUpperCase()+o.slice(1)}).join(" "),f="node_".concat(o);c.push({id:f,label:a,cluster_id:t,x:r,y:d,description:"Section: ".concat(a)});var v=e[o];Array.isArray(v)&&v.forEach(function(e,n){var l;if(e&&"object"==typeof e){var i=e.dependent_on;if(i){var t="node_".concat(i),r="";"string"==typeof e.reasoning?r=e.reasoning:Array.isArray(e.reasoning)?r=e.reasoning.map(function(o){return"string"==typeof o?o:(null==o?void 0:o.text)||""}).filter(Boolean).join(" "):(null===(l=e.reasoning)||void 0===l?void 0:l.text)&&(r=String(e.reasoning.text)),u.push({id:"e_".concat(o,"_").concat(i,"_").concat(n),source:f,target:t,reasoning:r||"Depends on ".concat(i),score:"number"==typeof e.Score?e.Score:"number"==typeof e.score?e.score:80,gap:e.gap||"",dependency_type:e.dependency_type||"implicit"})}}})}),0===c.length?null:{graph_id:"spb_converted_graph",prompt_id:"",last_analyzed_at:(new Date).toISOString(),clusters:p,nodes:c,edges:u}}var S=function(n){var l=n.children,i=n.style;return e("div",o({style:o({fontWeight:"700",fontSize:"0.9rem",color:"#1a1a1a",marginBottom:"0.6rem",fontFamily:"Plus Jakarta Sans, sans-serif"},i)},{children:l}))},C=function(C){var I,A,T,F,P,W,_,B,z,L,H,D,R,J,M,j,E,G,N,O,q,V,U,Y,Z,K,Q,X,$,oo,eo,no,lo,io,to,ro,ao,so,po,co,uo,fo,vo,ho,mo,go,yo,xo,bo,ko,wo,So,Co,Io,Ao,To,Fo,Po,Wo,_o,Bo,zo,Lo,Ho,Do,Ro,Jo,Mo,jo,Eo,Go,No,Oo;C.prompt_title;var qo=C.modename,Vo=C.description,Uo=C.customMetaData;C.chevronUpComponent,C.chevronDownComponent,C.editorHeight,C.editorWidth;var Yo=C.isDarkModeEnabled,Zo=void 0===Yo||Yo,Ko=C.isDarkMode,Qo=C.startLine,Xo=void 0===Qo?8:Qo,$o=C.endLine,oe=void 0===$o?12:$o,ee=C.constraints_and_rules,ne=C.input_analysis,le=C.output_analysis;C.extraMetaData;var ie=C.showEditor,te=void 0===ie||ie,re=C.alwaysFullscreen,de=void 0!==re&&re,ae=C.renderAsComponent,se=void 0!==ae&&ae,pe=C.isFpb,ce=void 0===pe||pe,ue=C.isSpb,fe=void 0!==ue&&ue,ve=C.spbFunctionality,he=C.showDependencyIcon,me=void 0!==he&&he,ge=C.onDependencyGraphOpen,ye=C.onSectionClick,xe=C.categoryFields,be=C.total_apbs,ke=C.titleText,we=C.titleIcon,Se=C.dependencyGraphIcon,Ce=C.dependencyGraphArrowIcon,Ie=C.whenToApplyIcon,Ae=C.whenToApplyExpandIcon,Te=C.whenNotToApplyIcon,Fe=C.whenNotToApplyExpandIcon,Pe=C.specificationsIcon,We=C.specificationsInfoIcon,_e=C.specificationsExpandIcon,Be=C.styles,ze=C.defaultAccordionsExpanded,Le=void 0===ze||ze,He=C.defaultWhenToApplyExpanded,De=C.defaultWhenNotToApplyExpanded,Re=C.defaultSpecificationsExpanded,Je=C.defaultSpbFunctionalityExpanded,Me=null!==(I=null!=Ko?Ko:null==Be?void 0:Be.isDarkMode)&&void 0!==I?I:Zo,je=t(!1),Ee=je[0];je[1];var Ge=t(!1),Ne=Ge[0],Oe=Ge[1],qe=t(!1),Ve=qe[0],Ue=qe[1],Ye=r(null),Ze=t(de),Ke=Ze[0],Qe=Ze[1],Xe=t(!1),$e=Xe[0],on=Xe[1],en=t({startIndex:-1,endIndex:-1}),nn=en[0],ln=en[1],tn=t({}),rn=tn[0],dn=tn[1],an=t(function(){return y.getTheme(Me)}),sn=an[0],pn=an[1];d(function(){return y.subscribe(pn)},[]);var cn=null!==(A=null!=ke?ke:null==Uo?void 0:Uo.title)&&void 0!==A?A:"Untitled Prompt",un=(null==Uo?void 0:Uo.description)||Vo,fn=null==Uo?void 0:Uo.prompt,vn=(null==Uo?void 0:Uo.modename)||qo||"";null==Uo||Uo.citation_number;var hn=fn.split("\n").length;null!=be||(null===(T=null==Uo?void 0:Uo.sections)||void 0===T||T.length);var mn={startIndex:Xo,endIndex:oe},gn=[{label:"Strict Rules",content:ee},{label:"Input",content:ne},{label:"Output",content:le}].filter(function(o){return o.content}),yn=gn.length>0,xn=null!=He?He:Le,bn=null!=De?De:Le,kn=null!=Re?Re:Le,wn=null!=Je?Je:Le,Sn=function(e,n,l){var i,t,r,d,a,s;return{tooltip:{style:o(o({backgroundColor:l,color:"#ffffff",fontFamily:"Plus Jakarta Sans, sans-serif"},null==Be?void 0:Be.tooltip),e)},arrow:{style:o(o({color:null!==(s=null!==(d=null!==(t=null!==(i=null==n?void 0:n.color)&&void 0!==i?i:null==e?void 0:e.backgroundColor)&&void 0!==t?t:null===(r=null==Be?void 0:Be.tooltipArrow)||void 0===r?void 0:r.color)&&void 0!==d?d:null===(a=null==Be?void 0:Be.tooltip)||void 0===a?void 0:a.backgroundColor)&&void 0!==s?s:l},null==Be?void 0:Be.tooltipArrow),n)}}},Cn=e("div",o({style:o(o({display:"flex",gap:"2.5rem",borderTop:"1px solid #ebebeb",marginTop:"1rem",paddingTop:"1rem",fontSize:"0.875rem",fontWeight:"600",color:sn?"#e2e8f0":"#333",fontFamily:"Plus Jakarta Sans, sans-serif"},null==Be?void 0:Be.footer),null==Be?void 0:Be.previewStats)},{children:n("span",o({style:null==Be?void 0:Be.previewStatsItem},{children:["Total Lines: ",hn]}))}));d(function(){var o=Ye.current;o&&Ue(o.scrollHeight>o.clientHeight)},[un]);var In=function(){Qe(!1)},An=e(g,{startIndex:mn.startIndex,endIndex:mn.endIndex,language:"xml",editorHeight:"100%",editorWidth:"100%",code:fn,isHighlightingEnabled:!0,isDarkModeEnabled:sn,highlightCodeStatsLine:nn,setHighlightCodeStatsLine:ln,highlightCodeStatsVariable:rn,setHighlightCodeStatsVariable:dn,isExpanded:Ee||Ke,highlightIndexes:mn}),Tn=n(l,{children:[n("div",o({style:o({width:te?"50%":"100%",padding:"2rem 2.25rem",display:"flex",flexDirection:"column",overflowY:"auto",borderRight:te?"1px solid #ebebeb":"none",boxSizing:"border-box"},null==Be?void 0:Be.leftPanel)},{children:[n("div",o({style:{marginBottom:"1.25rem",display:"flex",alignItems:"center",gap:"0.75rem",flexWrap:"nowrap"}},{children:[e(b,o({title:e("span",o({style:o(o({},null==Be?void 0:Be.tooltipContent),null==Be?void 0:Be.titleTooltipContent)},{children:cn})),placement:"top",arrow:!0,componentsProps:Sn(o({fontSize:"0.75rem",maxWidth:320,padding:"6px 10px"},null==Be?void 0:Be.titleTooltip),null==Be?void 0:Be.titleTooltipArrow,sn?"#21262d":"#1a1a1a")},{children:n("span",o({style:o({fontWeight:"700",fontSize:"1.05rem",color:sn?"#ffffff":"#1a1a1a",fontFamily:"Plus Jakarta Sans, sans-serif",lineHeight:1.4,display:"flex",alignItems:"center",gap:"6px",minWidth:0,flexShrink:1},null==Be?void 0:Be.title)},{children:[null!=we?we:n("svg",o({width:null!==(P=null===(F=null==Be?void 0:Be.titleIcon)||void 0===F?void 0:F.width)&&void 0!==P?P:16,height:null!==(_=null===(W=null==Be?void 0:Be.titleIcon)||void 0===W?void 0:W.height)&&void 0!==_?_:16,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{color:null!==(z=null===(B=null==Be?void 0:Be.titleIcon)||void 0===B?void 0:B.color)&&void 0!==z?z:sn?"#ffffff":"#1a1a1a",flexShrink:0}},{children:[e("path",{d:"M4 6C4 4.895 4.895 4 6 4H14",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),e("path",{d:"M4 6V18C4 19.105 4.895 20 6 20H18C19.105 20 20 19.105 20 18V10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),e("line",{x1:"8",y1:"10",x2:"14",y2:"10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),e("line",{x1:"8",y1:"13",x2:"11",y2:"13",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),e("line",{x1:"13",y1:"13",x2:"16",y2:"13",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),e("line",{x1:"8",y1:"16",x2:"14",y2:"16",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),e("path",{d:"M19 1 L19.9 3.6 L22.5 4.5 L19.9 5.4 L19 8 L18.1 5.4 L15.5 4.5 L18.1 3.6 Z",fill:"currentColor"})]})),e("span",o({style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{children:cn.length>28?"".concat(cn.slice(0,28),".."):cn}))]}))})),ce&&!fe&&n("span",o({style:{display:"inline-flex",alignItems:"center",gap:"4px",background:null!==(H=null===(L=null==Be?void 0:Be.fpbBadge)||void 0===L?void 0:L.backgroundColor)&&void 0!==H?H:sn?"#e2e8f0":"#1a1a1a",borderRadius:"5px",padding:"2px 8px",fontSize:"0.72rem",fontWeight:"700",color:null!==(R=null===(D=null==Be?void 0:Be.fpbBadge)||void 0===D?void 0:D.color)&&void 0!==R?R:sn?"#0d1117":"#ffffff",letterSpacing:"0.08em",fontFamily:"Plus Jakarta Sans, sans-serif",textTransform:"uppercase",flexShrink:0}},{children:["FPB",e(b,o({title:n("span",o({style:o(o({fontSize:"0.7rem",lineHeight:1.5,fontFamily:"Plus Jakarta Sans, sans-serif",color:null!==(M=null===(J=null==Be?void 0:Be.fpbTooltip)||void 0===J?void 0:J.color)&&void 0!==M?M:"#ffffff"},null==Be?void 0:Be.tooltipContent),null==Be?void 0:Be.fpbTooltipContent)},{children:[e("strong",{children:"FPB (Functional Prompt Block):"})," A group of related prompt sections designed to perform a specific function or capability within the overall system prompt."]})),placement:"top",arrow:!0,componentsProps:Sn(o({maxWidth:280,padding:"8px 12px"},null==Be?void 0:Be.fpbTooltip),null==Be?void 0:Be.fpbTooltipArrow,"#1a1a1a")},{children:e(c,{style:{fontSize:"0.85rem",color:null!==(j=null==Be?void 0:Be.fpbInfoIconColor)&&void 0!==j?j:sn?"#1a1a1acc":"#ffffffcc",cursor:"default"}})}))]})),fe&&n("span",o({style:{display:"inline-flex",alignItems:"center",gap:"4px",background:null!==(G=null===(E=null==Be?void 0:Be.spbBadge)||void 0===E?void 0:E.backgroundColor)&&void 0!==G?G:sn?"#e2e8f0":"#1a1a1a",borderRadius:"5px",padding:"2px 8px",fontSize:"0.72rem",fontWeight:"700",color:null!==(O=null===(N=null==Be?void 0:Be.spbBadge)||void 0===N?void 0:N.color)&&void 0!==O?O:sn?"#0d1117":"#ffffff",letterSpacing:"0.08em",fontFamily:"Plus Jakarta Sans, sans-serif",textTransform:"uppercase",flexShrink:0}},{children:["SPB",e(b,o({title:n("span",o({style:o(o({fontSize:"0.7rem",lineHeight:1.5,fontFamily:"Plus Jakarta Sans, sans-serif",color:null!==(V=null===(q=null==Be?void 0:Be.spbTooltip)||void 0===q?void 0:q.color)&&void 0!==V?V:"#ffffff"},null==Be?void 0:Be.tooltipContent),null==Be?void 0:Be.spbTooltipContent)},{children:[e("strong",{children:"SPB (Shippable Prompt Block) :"})," is a complete system-level prompt that defines the overall behavior, instructions, guidelines, and context an AI system should follow when responding to users."]})),placement:"top",arrow:!0,componentsProps:Sn(o({maxWidth:280,padding:"8px 12px"},null==Be?void 0:Be.spbTooltip),null==Be?void 0:Be.spbTooltipArrow,"#1a1a1a")},{children:e(c,{style:{fontSize:"0.85rem",color:null!==(U=null==Be?void 0:Be.spbInfoIconColor)&&void 0!==U?U:sn?"#1a1a1acc":"#ffffffcc",cursor:"default"}})}))]})),vn&&e("span",o({style:{fontSize:"0.72rem",color:"#666",background:"#f0f0f0",borderRadius:"4px",padding:"1px 6px"}},{children:vn})),me&&e("div",{style:{flex:1}}),me&&e(b,o({title:e("span",o({style:o(o({fontSize:"0.7rem",fontFamily:"Plus Jakarta Sans, sans-serif"},null==Be?void 0:Be.tooltipContent),null==Be?void 0:Be.dependencyGraphTooltipContent)},{children:"Open dependency graph"})),placement:"top",arrow:!0,componentsProps:Sn(o({padding:"5px 10px"},null==Be?void 0:Be.dependencyGraphTooltip),null==Be?void 0:Be.dependencyGraphTooltipArrow,sn?"#21262d":"#1a1a1a")},{children:n("button",o({onClick:function(o){o.stopPropagation(),null==ge||ge("show dependency graph")},style:o({display:"inline-flex",alignItems:"center",gap:"5px",padding:"4px 10px 4px 8px",borderRadius:"8px",border:"1px solid ".concat(sn?"#30363d":"#d0d7de"),background:sn?"#21262d":"#f6f8fa",color:sn?"#e2e8f0":"#24292f",fontSize:"0.78rem",fontWeight:"600",fontFamily:"Plus Jakarta Sans, sans-serif",cursor:"pointer",flexShrink:0,whiteSpace:"nowrap"},null==Be?void 0:Be.dependencyGraphButton)},{children:[null!=Se?Se:n("svg",o({xmlns:"http://www.w3.org/2000/svg",width:"12px",height:"12px",viewBox:"0 0 48 48",fill:"none"},{children:[e("path",{d:"M24 33V15",stroke:null!==(Y=null==Be?void 0:Be.dependencyGraphIconStroke)&&void 0!==Y?Y:"currentColor",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"}),e("rect",{x:"10",y:"9",width:"28",height:"6",fill:null!==(Z=null==Be?void 0:Be.dependencyGraphIconFill)&&void 0!==Z?Z:"#2F88FF",stroke:null!==(K=null==Be?void 0:Be.dependencyGraphIconStroke)&&void 0!==K?K:"currentColor",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"}),e("path",{d:"M8 32L14 25H33.9743L40 32",stroke:null!==(Q=null==Be?void 0:Be.dependencyGraphIconStroke)&&void 0!==Q?Q:"currentColor",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"}),e("rect",{x:"4",y:"33",width:"8",height:"8",fill:null!==(X=null==Be?void 0:Be.dependencyGraphIconFill)&&void 0!==X?X:"#2F88FF",stroke:null!==($=null==Be?void 0:Be.dependencyGraphIconStroke)&&void 0!==$?$:"currentColor",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"}),e("rect",{x:"20",y:"33",width:"8",height:"8",fill:null!==(oo=null==Be?void 0:Be.dependencyGraphIconFill)&&void 0!==oo?oo:"#2F88FF",stroke:null!==(eo=null==Be?void 0:Be.dependencyGraphIconStroke)&&void 0!==eo?eo:"currentColor",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"}),e("rect",{x:"36",y:"33",width:"8",height:"8",fill:null!==(no=null==Be?void 0:Be.dependencyGraphIconFill)&&void 0!==no?no:"#2F88FF",stroke:null!==(lo=null==Be?void 0:Be.dependencyGraphIconStroke)&&void 0!==lo?lo:"currentColor",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})]})),"Graph",null!=Ce?Ce:n("svg",o({width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"},{children:[e("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),e("polyline",{points:"12 5 19 12 12 19"})]}))]}))}))]})),un&&n("div",o({style:{border:"1px solid ".concat(null!==(to=null===(io=null==Be?void 0:Be.descriptionCard)||void 0===io?void 0:io.borderColor)&&void 0!==to?to:"transparent"),borderRadius:null!==(ao=null===(ro=null==Be?void 0:Be.descriptionCard)||void 0===ro?void 0:ro.borderRadius)&&void 0!==ao?ao:"8px",padding:null!==(po=null===(so=null==Be?void 0:Be.descriptionCard)||void 0===so?void 0:so.padding)&&void 0!==po?po:"14px 16px",backgroundColor:null!==(uo=null===(co=null==Be?void 0:Be.descriptionCard)||void 0===co?void 0:co.backgroundColor)&&void 0!==uo?uo:"transparent",marginBottom:"1.5rem"}},{children:[e("div",o({style:o({fontWeight:"700",fontSize:"0.95rem",fontFamily:"Plus Jakarta Sans, sans-serif",marginBottom:"8px",color:sn?"#ffffff":"#111827"},null==Be?void 0:Be.descriptionHeading)},{children:"Prompt Overview"})),n("div",o({style:{position:"relative"}},{children:[e("p",o({ref:Ye,style:o({fontSize:"0.875rem",lineHeight:"1.7",margin:0,fontFamily:"Plus Jakarta Sans, sans-serif",color:sn?"#c9d1d9":"#444",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:Ne?"unset":4,overflow:Ne?"visible":"hidden"},null==Be?void 0:Be.description)},{children:un})),Ve&&!Ne&&e("button",o({onClick:function(){return Oe(!0)},style:o({position:"absolute",bottom:0,right:0,background:"linear-gradient(to right, transparent, ".concat(sn?"#0d1117":"#ffffff"," 40%)"),border:"none",paddingLeft:"2rem",paddingRight:0,cursor:"pointer",fontSize:"0.875rem",fontWeight:"600",fontFamily:"Plus Jakarta Sans, sans-serif",color:sn?"#7dd3fc":"#2563eb",lineHeight:"1.7"},null==Be?void 0:Be.descriptionMoreButton)},{children:"...more"})),Ne&&e("button",o({onClick:function(){return Oe(!1)},style:o({background:"none",border:"none",padding:"2px 0 0",cursor:"pointer",fontSize:"0.875rem",fontWeight:"600",fontFamily:"Plus Jakarta Sans, sans-serif",color:sn?"#7dd3fc":"#2563eb",display:"block"},null==Be?void 0:Be.descriptionLessButton)},{children:"less"}))]}))]})),xe&&xe.length>0&&e("div",o({style:o({display:"flex",flexWrap:"wrap",borderTop:"1px solid ".concat(sn?"#ffffff18":"#1a1a1a18"),borderBottom:"1px solid ".concat(sn?"#ffffff18":"#1a1a1a18"),marginBottom:"1.5rem"},null==Be?void 0:Be.categoryRow)},{children:xe.map(function(l,t){return n(i.Fragment,{children:[t>0&&e("div",{style:o({width:"1px",alignSelf:"stretch",background:sn?"#ffffff18":"#1a1a1a18"},null==Be?void 0:Be.categoryDivider)}),n("div",o({style:o({flex:"1 1 120px",padding:"12px 16px"},null==Be?void 0:Be.categoryItem)},{children:[e("div",o({style:o({fontSize:"0.72rem",fontWeight:"500",fontFamily:"Plus Jakarta Sans, sans-serif",color:sn?"#8b949e":"#6b7280",marginBottom:"4px"},null==Be?void 0:Be.categoryLabel)},{children:l.label})),e("div",o({style:o({fontSize:"0.875rem",fontWeight:"600",fontFamily:"Plus Jakarta Sans, sans-serif",color:sn?"#e2e8f0":"#111827"},null==Be?void 0:Be.categoryValue)},{children:l.value}))]}))]},t)})})),""!==(null==Uo?void 0:Uo.when_to_apply)&&n(f,o({defaultExpanded:xn,style:o({marginBottom:"1rem",border:"1px solid ".concat(null!==(vo=null===(fo=null==Be?void 0:Be.whenToApplyAccordion)||void 0===fo?void 0:fo.borderColor)&&void 0!==vo?vo:sn?"#ffffff18":"#1a1a1a18"),borderRadius:"28px !important",boxShadow:"none",background:"transparent"},null==Be?void 0:Be.whenToApplyAccordion)},{children:[e(v,o({expandIcon:null!=Ae?Ae:e(m,{style:{color:null!==(ho=null==Be?void 0:Be.whenAccordionChevronColor)&&void 0!==ho?ho:sn?"#e2e8f0":"#374151"}}),style:o({minHeight:"36px",padding:"0 12px",background:"transparent"},null==Be?void 0:Be.whenToApplyHeader)},{children:n("div",o({style:{display:"flex",alignItems:"center",gap:"10px"}},{children:[e("span",o({style:o({display:"inline-flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",borderRadius:"50%",border:"1.5px solid ".concat(null!==(mo=null==Be?void 0:Be.whenToApplyIconColor)&&void 0!==mo?mo:"#4ade80"),flexShrink:0},null==Be?void 0:Be.whenToApplyIconCircle)},{children:null!=Ie?Ie:e("svg",o({xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24"},{children:e("g",o({id:"Complete"},{children:e("g",o({id:"tick"},{children:e("polyline",{fill:"none",points:"3.7 14.3 9.6 19 20.3 5",stroke:null!==(go=null==Be?void 0:Be.whenToApplyIconColor)&&void 0!==go?go:"#4ade80",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})}))}))}))})),e("span",o({style:o({fontWeight:"600",fontSize:"0.9rem",fontFamily:"Plus Jakarta Sans, sans-serif",color:sn?"#e2e8f0":"#111827"},null==Be?void 0:Be.whenToApplyTitle)},{children:"When to apply"}))]}))})),e(h,o({style:o({padding:"12px 16px",background:null!==(xo=null===(yo=null==Be?void 0:Be.whenToApplyContent)||void 0===yo?void 0:yo.backgroundColor)&&void 0!==xo?xo:sn?"#ffffff08":"#1a1a1a06"},null==Be?void 0:Be.whenToApplyContent)},{children:e(x,{message:null==Uo?void 0:Uo.when_to_apply,style:null==Be?void 0:Be.markdownRenderer,codeStyle:null==Be?void 0:Be.markdownCode,preStyle:null==Be?void 0:Be.markdownPre,blockquoteStyle:null==Be?void 0:Be.markdownBlockquote,syntaxHighlighterTheme:null==Be?void 0:Be.syntaxHighlighterTheme,cognitiveDecisioningStyles:null==Be?void 0:Be.cognitiveDecisioning})}))]})),""!==(null==Uo?void 0:Uo.when_not_to_apply)&&n(f,o({defaultExpanded:bn,style:o({marginBottom:"1rem",border:"1px solid ".concat(null!==(ko=null===(bo=null==Be?void 0:Be.whenNotToApplyAccordion)||void 0===bo?void 0:bo.borderColor)&&void 0!==ko?ko:sn?"#ffffff18":"#1a1a1a18"),borderRadius:"8px !important",boxShadow:"none",background:"transparent"},null==Be?void 0:Be.whenNotToApplyAccordion)},{children:[e(v,o({expandIcon:null!=Fe?Fe:e(m,{style:{color:null!==(wo=null==Be?void 0:Be.whenAccordionChevronColor)&&void 0!==wo?wo:sn?"#e2e8f0":"#374151"}}),style:o({minHeight:"36px",padding:"0 12px",background:"transparent"},null==Be?void 0:Be.whenNotToApplyHeader)},{children:n("div",o({style:{display:"flex",alignItems:"center",gap:"10px"}},{children:[e("span",o({style:o({display:"inline-flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",borderRadius:"50%",border:"1.5px solid ".concat(null!==(So=null==Be?void 0:Be.whenNotToApplyIconColor)&&void 0!==So?So:"#f87171"),flexShrink:0},null==Be?void 0:Be.whenNotToApplyIconCircle)},{children:null!=Te?Te:e("svg",o({xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none"},{children:e("path",{d:"M19 5L5 19M5.00001 5L19 19",stroke:null!==(Co=null==Be?void 0:Be.whenNotToApplyIconColor)&&void 0!==Co?Co:"#f87171",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}))})),e("span",o({style:o({fontWeight:"600",fontSize:"0.9rem",fontFamily:"Plus Jakarta Sans, sans-serif",color:sn?"#e2e8f0":"#111827"},null==Be?void 0:Be.whenNotToApplyTitle)},{children:"When not to apply"}))]}))})),e(h,o({style:o({padding:"12px 16px",background:null!==(Ao=null===(Io=null==Be?void 0:Be.whenNotToApplyContent)||void 0===Io?void 0:Io.backgroundColor)&&void 0!==Ao?Ao:sn?"#ffffff08":"#1a1a1a06"},null==Be?void 0:Be.whenNotToApplyContent)},{children:e(x,{message:null==Uo?void 0:Uo.when_not_to_apply,style:null==Be?void 0:Be.markdownRenderer,codeStyle:null==Be?void 0:Be.markdownCode,preStyle:null==Be?void 0:Be.markdownPre,blockquoteStyle:null==Be?void 0:Be.markdownBlockquote,syntaxHighlighterTheme:null==Be?void 0:Be.syntaxHighlighterTheme,cognitiveDecisioningStyles:null==Be?void 0:Be.cognitiveDecisioning})}))]})),yn&&n(f,o({defaultExpanded:kn,style:o({marginBottom:"1rem",border:"1px solid ".concat(null!==(Fo=null===(To=null==Be?void 0:Be.specificationsSection)||void 0===To?void 0:To.borderColor)&&void 0!==Fo?Fo:sn?"#ffffff18":"#1a1a1a18"),borderRadius:"8px",boxShadow:"none",background:"transparent"},null==Be?void 0:Be.specificationsSection)},{children:[e(v,o({expandIcon:null!=_e?_e:e(m,{style:{color:null!==(Po=null==Be?void 0:Be.specificationsExpandIconColor)&&void 0!==Po?Po:sn?"#e2e8f0":"#374151"}}),style:{minHeight:"36px",padding:"0 12px",background:"transparent"}},{children:n("div",o({style:{display:"flex",alignItems:"center",gap:"10px"}},{children:[e("span",o({style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"18px",height:"18px",borderRadius:"5px",flexShrink:0}},{children:null!=Pe?Pe:n("svg",o({xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"#ffffff"},{children:[e("rect",{x:"4.5",y:"3.5",width:"15",height:"17",rx:"1.5",stroke:"#ffffff","stroke-width":"1.7"}),e("path",{d:"M8 8H16",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"}),e("path",{d:"M8 11.5H16",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"}),e("path",{d:"M8 15H13.5",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"})]}))})),e("span",o({style:o({fontWeight:"600",fontSize:"0.9rem",fontFamily:"Plus Jakarta Sans, sans-serif",color:sn?"#e2e8f0":"#111827"},null==Be?void 0:Be.specificationsTitle)},{children:"Specifications"})),e(b,o({title:n("span",o({style:o(o({fontSize:"0.7rem",lineHeight:1.5,fontFamily:"Plus Jakarta Sans, sans-serif",color:null!==(_o=null===(Wo=null==Be?void 0:Be.specificationsTooltip)||void 0===Wo?void 0:Wo.color)&&void 0!==_o?_o:"#ffffff"},null==Be?void 0:Be.tooltipContent),null==Be?void 0:Be.specificationsTooltipContent)},{children:[e("strong",{children:"Specifications:"})," Specifications are the details that define a prompt’s guidelines, expected inputs, expected outputs, and constraints or rules."]})),placement:"top",arrow:!0,componentsProps:Sn(o({maxWidth:280,padding:"8px 12px"},null==Be?void 0:Be.specificationsTooltip),null==Be?void 0:Be.specificationsTooltipArrow,"#1a1a1a")},{children:e("span",{children:null!=We?We:e(c,{style:{fontSize:"0.95rem",color:sn?"#aaaaaa":"#666666",cursor:"default"}})})}))]}))})),e(h,o({style:o({padding:"12px 16px",background:null!==(zo=null===(Bo=null==Be?void 0:Be.specificationsDetails)||void 0===Bo?void 0:Bo.backgroundColor)&&void 0!==zo?zo:sn?"#ffffff08":"#1a1a1a06",display:"flex",flexDirection:"column",gap:"12px"},null==Be?void 0:Be.specificationsDetails)},{children:gn.map(function(l){var i=l.label,t=l.content;return n("div",{children:[e("div",o({style:o({fontSize:"0.72rem",fontWeight:"700",color:"#6B7280",textTransform:"uppercase",letterSpacing:"0.06em",marginBottom:"0.3rem",fontFamily:"Plus Jakarta Sans, sans-serif"},null==Be?void 0:Be.specificationsItemLabel)},{children:i})),e(x,{message:t,fontSize:"0.83rem",style:null==Be?void 0:Be.markdownRenderer,codeStyle:null==Be?void 0:Be.markdownCode,preStyle:null==Be?void 0:Be.markdownPre,blockquoteStyle:null==Be?void 0:Be.markdownBlockquote,syntaxHighlighterTheme:null==Be?void 0:Be.syntaxHighlighterTheme,cognitiveDecisioningStyles:null==Be?void 0:Be.cognitiveDecisioning})]},i)})}))]})),(null==Uo?void 0:Uo.sections)&&Uo.sections.length>0&&n("div",o({style:{marginBottom:"1.5rem",marginTop:"0.6rem"}},{children:[n("div",o({style:{display:"flex",alignItems:"center",gap:"5px",marginBottom:"0.6rem",marginTop:"0.4rem"}},{children:[e(S,o({style:o(o({},null==Be?void 0:Be.sectionLabel),{marginBottom:0})},{children:"APB's"})),e(b,o({title:n("span",o({style:o(o({fontSize:"0.7rem",lineHeight:1.5,fontFamily:"Plus Jakarta Sans, sans-serif",color:null!==(Ro=null!==(Ho=null===(Lo=null==Be?void 0:Be.apbTooltip)||void 0===Lo?void 0:Lo.color)&&void 0!==Ho?Ho:null===(Do=null==Be?void 0:Be.fpbTooltip)||void 0===Do?void 0:Do.color)&&void 0!==Ro?Ro:"#ffffff"},null==Be?void 0:Be.tooltipContent),null==Be?void 0:Be.apbTooltipContent)},{children:[e("strong",{children:"APB (Atomic Prompt Block):"})," A self-contained prompt unit that handles one specific instruction, rule, or behavior within a Functional Prompt Block."]})),placement:"top",arrow:!0,componentsProps:Sn(o({maxWidth:280,padding:"8px 12px"},null!==(Jo=null==Be?void 0:Be.apbTooltip)&&void 0!==Jo?Jo:null==Be?void 0:Be.fpbTooltip),null!==(Mo=null==Be?void 0:Be.apbTooltipArrow)&&void 0!==Mo?Mo:null==Be?void 0:Be.fpbTooltipArrow,"#1a1a1a")},{children:e(c,{style:{fontSize:"0.95rem",color:sn?"#aaaaaa":"#666666",cursor:"default"}})}))]})),e("div",o({style:{display:"flex",flexDirection:"column",gap:"6px"}},{children:Uo.sections.map(function(l){var i,t,r,d,a,s,p,c,u,f;return n("div",o({style:{border:"1px solid ".concat(null!==(t=null===(i=null==Be?void 0:Be.sectionItem)||void 0===i?void 0:i.borderColor)&&void 0!==t?t:sn?"#ffffff22":"#1a1a1a22"),borderRadius:"8px",padding:"10px 14px"}},{children:[n("div",o({onClick:function(){return null==ye?void 0:ye(l.title)},style:{fontSize:"0.83rem",fontWeight:"600",color:null!==(d=null===(r=null==Be?void 0:Be.sectionItem)||void 0===r?void 0:r.titleColor)&&void 0!==d?d:sn?"#e2e8f0":"#111827",fontFamily:"Plus Jakarta Sans, sans-serif",cursor:ye?"pointer":"default",marginBottom:"4px",display:"inline-flex",alignItems:"center",gap:"5px"}},{children:[n("span",o({style:{fontSize:"0.68rem",fontWeight:"700",color:null!==(s=null===(a=null==Be?void 0:Be.sectionItem)||void 0===a?void 0:a.orderColor)&&void 0!==s?s:sn?"#6e7681":"#9CA3AF",fontFamily:"Plus Jakarta Sans, sans-serif",minWidth:"16px",flexShrink:0}},{children:[l.order,"."]})),e("span",o({style:{textDecoration:ye?"underline":"none",textDecorationColor:null!==(c=null===(p=null==Be?void 0:Be.sectionItem)||void 0===p?void 0:p.titleColor)&&void 0!==c?c:sn?"#e2e8f0":"#111827",textUnderlineOffset:"3px"}},{children:l.title})),ye&&n("svg",o({xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0,opacity:.5}},{children:[e("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),e("polyline",{points:"15 3 21 3 21 9"}),e("line",{x1:"10",y1:"14",x2:"21",y2:"3"})]}))]})),e("div",o({style:{fontSize:"0.76rem",color:null!==(f=null===(u=null==Be?void 0:Be.sectionItem)||void 0===u?void 0:u.descriptionColor)&&void 0!==f?f:sn?"#8b949e":"#6B7280",fontFamily:"Plus Jakarta Sans, sans-serif",lineHeight:1.55,paddingLeft:"22px"}},{children:l.description}))]}),l.order)})}))]})),ve&&n(f,o({defaultExpanded:wn,style:o({marginBottom:"1rem",marginTop:"0.6rem",border:"1px solid ".concat(null!==(Eo=null===(jo=null==Be?void 0:Be.spbSection)||void 0===jo?void 0:jo.borderColor)&&void 0!==Eo?Eo:sn?"#ffffff18":"#1a1a1a18"),borderRadius:"8px",boxShadow:"none",background:"transparent"},null==Be?void 0:Be.spbSection)},{children:[e(v,o({expandIcon:e(m,{style:{color:null!==(Go=null==Be?void 0:Be.spbChevronColor)&&void 0!==Go?Go:sn?"#e2e8f0":"#374151"}}),style:o({minHeight:"36px",padding:"0 12px",background:"transparent"},null==Be?void 0:Be.spbSectionHeader)},{children:n("div",o({style:{display:"flex",alignItems:"center",gap:"8px"}},{children:[n("span",o({style:o({fontWeight:"600",fontSize:"0.9rem",fontFamily:"Plus Jakarta Sans, sans-serif",color:sn?"#e2e8f0":"#111827"},null==Be?void 0:Be.spbSectionTitle)},{children:["SPB Functionalities (",ve.total_functionalities,")"]})),e("span",o({style:{color:sn?"#6e7681":"#9CA3AF",fontSize:"0.75rem"}},{children:"•"})),n("span",o({style:{fontSize:"0.78rem",fontWeight:"500",color:sn?"#6e7681":"#9CA3AF",fontFamily:"Plus Jakarta Sans, sans-serif"}},{children:[ve.total_apbs_identified," APBs"]}))]}))})),e(h,o({style:o({padding:"10px 12px",background:null!==(Oo=null===(No=null==Be?void 0:Be.spbSectionContent)||void 0===No?void 0:No.backgroundColor)&&void 0!==Oo?Oo:"transparent",display:"flex",flexDirection:"column",gap:"8px"},null==Be?void 0:Be.spbSectionContent)},{children:ve.functionality_analysis.map(function(l,i){var t,r,d,a,s,p,c,u,f;return n("div",o({style:o({border:"1px solid ".concat(null!==(r=null===(t=null==Be?void 0:Be.spbFunctionalityItem)||void 0===t?void 0:t.borderColor)&&void 0!==r?r:sn?"#ffffff14":"#1a1a1a14"),borderRadius:"10px",overflow:"hidden",padding:"4px",background:null!==(a=null===(d=null==Be?void 0:Be.spbFunctionalityItem)||void 0===d?void 0:d.backgroundColor)&&void 0!==a?a:sn?"#ffffff04":"#1a1a1a03"},null==Be?void 0:Be.spbFunctionalityItem)},{children:[n("div",o({style:o({padding:"12px 14px",borderRadius:"12px",background:null!==(p=null===(s=null==Be?void 0:Be.spbFunctionalityItemInner)||void 0===s?void 0:s.backgroundColor)&&void 0!==p?p:sn?"#ffffff08":"#1a1a1a07",borderBottom:"1px solid ".concat(null!==(u=null===(c=null==Be?void 0:Be.spbFunctionalityItemInner)||void 0===c?void 0:c.borderColor)&&void 0!==u?u:sn?"#ffffff10":"#1a1a1a10")},null==Be?void 0:Be.spbFunctionalityItemInner)},{children:[n("div",o({style:o({fontSize:"0.85rem",fontWeight:"700",color:sn?"#e2e8f0":"#111827",fontFamily:"Plus Jakarta Sans, sans-serif",marginBottom:"6px",lineHeight:1.4},null==Be?void 0:Be.spbFunctionalityItemName)},{children:[i+1,". ",l.name]})),e(x,{message:l.description,fontSize:"0.78rem",style:o({lineHeight:1.6,color:sn?"#8b949e":"#6B7280"},null!==(f=null==Be?void 0:Be.spbFunctionalityItemDescription)&&void 0!==f?f:{}),codeStyle:null==Be?void 0:Be.markdownCode,preStyle:null==Be?void 0:Be.markdownPre,blockquoteStyle:null==Be?void 0:Be.markdownBlockquote,syntaxHighlighterTheme:null==Be?void 0:Be.syntaxHighlighterTheme,cognitiveDecisioningStyles:null==Be?void 0:Be.cognitiveDecisioning})]})),l.apb_references&&l.apb_references.length>0&&n("div",o({style:o({display:"flex",alignItems:"center",flexWrap:"wrap",gap:"6px",padding:"8px 14px"},null==Be?void 0:Be.spbApbReferencesRow)},{children:[e("span",o({style:o({fontSize:"0.68rem",fontWeight:"500",color:sn?"#6e7681":"#9CA3AF",fontFamily:"Plus Jakarta Sans, sans-serif",flexShrink:0},null==Be?void 0:Be.spbApbReferencesLabel)},{children:"apb references:"})),l.apb_references.map(function(n,l){var i,t,r,d,a,s;return e(b,o({title:e("span",o({style:o(o({fontSize:"0.7rem",lineHeight:1.5,fontFamily:"Plus Jakarta Sans, sans-serif",color:null!==(d=null!==(t=null===(i=null==Be?void 0:Be.spbApbReferenceTooltip)||void 0===i?void 0:i.color)&&void 0!==t?t:null===(r=null==Be?void 0:Be.spbTooltip)||void 0===r?void 0:r.color)&&void 0!==d?d:"#ffffff"},null==Be?void 0:Be.tooltipContent),null==Be?void 0:Be.spbApbReferenceTooltipContent)},{children:n.context})),placement:"top",arrow:!0,componentsProps:Sn(o({maxWidth:240,padding:"6px 10px"},null!==(a=null==Be?void 0:Be.spbApbReferenceTooltip)&&void 0!==a?a:null==Be?void 0:Be.spbTooltip),null!==(s=null==Be?void 0:Be.spbApbReferenceTooltipArrow)&&void 0!==s?s:null==Be?void 0:Be.spbTooltipArrow,"#1a1a1a")},{children:e("span",o({style:o({display:"inline-flex",alignItems:"center",fontSize:"0.7rem",fontWeight:"500",fontFamily:"Plus Jakarta Sans, sans-serif",padding:"3px 10px",borderRadius:"6px",background:sn?"#ffffff0d":"#1a1a1a08",color:sn?"#c9d1d9":"#374151",cursor:"default",border:"1px solid ".concat(sn?"#ffffff18":"#1a1a1a14")},null==Be?void 0:Be.spbApbReference)},{children:e("span",o({style:o({},null==Be?void 0:Be.spbApbReferenceLabel)},{children:n.apb_name}))}))}),l)})]}))]}),i)})}))]})),!te&&n(l,{children:[e("div",{style:{flex:1}}),Cn]})]})),te&&n("div",o({style:o({width:"50%",padding:"1.75rem",display:"flex",flexDirection:"column",overflow:"hidden",boxSizing:"border-box"},null==Be?void 0:Be.rightPanel)},{children:[e("div",o({style:{fontWeight:"700",fontSize:"1rem",marginBottom:"1rem",color:"#1a1a1a",fontFamily:"Plus Jakarta Sans, sans-serif"}},{children:"Prompt Preview"})),e("div",o({style:{flex:1,border:"1px solid #e0e0e0",borderRadius:"0.875rem",overflow:"hidden",minHeight:0}},{children:An})),Cn]}))]});return n("div",o({style:null==Be?void 0:Be.root},{children:[se?e("div",o({style:o({display:"flex",width:"100%",fontFamily:"Plus Jakarta Sans, sans-serif",overflow:"hidden"},null==Be?void 0:Be.dialog)},{children:Tn})):n(a,o({open:Ke||de,onClose:In,maxWidth:"xl",fullWidth:!0,PaperProps:{style:o({borderRadius:"1rem",fontFamily:"Plus Jakarta Sans, sans-serif",height:"90vh",maxHeight:"90vh",overflow:"hidden"},null==Be?void 0:Be.dialog)}},{children:[e(p,o({onClick:In,size:"small",style:{position:"absolute",top:10,right:12,zIndex:20}},{children:e(u,{fontSize:"small"})})),e(s,o({style:{padding:0,display:"flex",height:"100%",overflow:"hidden"}},{children:Tn}))]})),$e&&(null==Uo?void 0:Uo.dependency_graph)&&n(a,o({open:$e,onClose:function(){return on(!1)},maxWidth:"xl",fullWidth:!0,PaperProps:{style:o({borderRadius:"1rem",height:"90vh",maxHeight:"90vh",overflow:"hidden"},null==Be?void 0:Be.graphDialog)}},{children:[e(p,o({onClick:function(){return on(!1)},size:"small",style:{position:"absolute",top:10,right:12,zIndex:20}},{children:e(u,{fontSize:"small"})})),e(s,o({style:{padding:"1rem",height:"100%",overflow:"hidden",boxSizing:"border-box"}},{children:e(k,{data:w(Uo.dependency_graph),isDarkMode:sn})}))]}))]}))};export{w as convertDependencyGraphData,C as default};
|
|
2
|
+
//# sourceMappingURL=PromptCitation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PromptCitation.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as n,jsxs as t,Fragment as i}from"react/jsx-runtime";import{useRef as r,useMemo as o,useState as a,useEffect as l,useCallback as d}from"react";import{generateClassName as u,cssPropertiesToString as s,getClassNameFromDiagnostic as c}from"../../../utils/codeCitations.utils.js";var g;!function(e){e[e.Error=0]="Error",e[e.Warning=1]="Warning",e[e.Information=2]="Information",e[e.Hint=3]="Hint"}(g||(g={}));var v=function(g){var v=g.startIndex,h=g.endIndex,f=g.language,m=g.editorHeight,p=g.editorWidth,x=g.code,I=g.isHighlightingEnabled,y=g.isDarkModeEnabled,S=g.openHighlightedCodeDetails,b=g.highlightCodeStatsLine;g.setHighlightCodeStatsLine;var C=g.highlightCodeStatsVariable;g.setHighlightCodeStatsVariable,g.setHighlightIndexes;var L=g.isExpanded,R=g.highlightIndexes,w=g.diagnostics,O=g.diagnosticStylesBySeverity,j=r(null),D=r([]);r([]);var H=r([]),k=r([]),E=o(function(){return v},[v]),M=o(function(){return h},[h]),N=a(null),V=N[0],W=N[1],z=a(null),A=z[0],F=z[1],T=a(null),q=T[0],_=T[1],B=a(void 0),J=B[0],P=B[1],G=a(null),K=G[0],Q=G[1];l(function(){Promise.all([import("@monaco-editor/react"),import("highlight.js/lib/core")]).then(function(e){var n=e[0],t=e[1];_(function(){return n.default});var i=t.default.highlightAuto(x).language;P(i)}).catch(function(){Q("Code editor dependencies not installed. Run: npm install @monaco-editor/react highlight.js")})},[x]);var U=o(function(){return O&&"object"==typeof O&&Object.entries(O).map(function(e){var n=e[0],t=e[1],i=[];return t.style&&i.push(".".concat(u(t.style,+n,!0)," {\n").concat(s(t.style),"\n}")),t.lightModeStyle&&i.push(".".concat(u(t.lightModeStyle,+n,!1)," {\n").concat(s(t.lightModeStyle),"\n}")),i.join("\n")}).join("\n")},[O]);l(function(){return function(){var e;(null===(e=j.current)||void 0===e?void 0:e._resizeObserver)&&j.current._resizeObserver.disconnect()}},[]),l(function(){if(I&&V&&j.current&&A){var e=V.start,n=V.end;if(X(j.current,e,n,b,C),-1===v&&w&&w.length>0){var t=w[0].range,i=t.lineStart,r=t.lineEnd;X(j.current,i,r,b,C)}}},[V,A,I,b,C]),l(function(){var e,n,t;if(A&&j.current&&I){var i=j.current;if(R&&(null===(e=Object.keys(R))||void 0===e?void 0:e.length)>0&&-1!==(null==R?void 0:R.startIndex)&&-1!==(null==R?void 0:R.endIndex)){var r=i.deltaDecorations(D.current,[{range:new A.Range(R.startIndex,1,R.endIndex,1),options:{isWholeLine:!0,className:"myLineHighlight"}}]);D.current=r}if(b&&(null===(n=Object.keys(b))||void 0===n?void 0:n.length)>0&&-1!==(null==b?void 0:b.startIndex)&&-1!==(null==b?void 0:b.endIndex)&&(null==b?void 0:b.name)){r=i.deltaDecorations(D.current,[{range:new A.Range(b.startIndex,1,b.endIndex,1),options:{isWholeLine:!0,className:"myLineHighlight"}}]);D.current=r}if(C&&(null===(t=Object.keys(C))||void 0===t?void 0:t.length)>0&&-1!==(null==C?void 0:C.startIndex)&&-1!==(null==C?void 0:C.endIndex)&&(null==b?void 0:b.name)){r=i.deltaDecorations(H.current,[{range:new A.Range(C.startIndex,1,C.endIndex,1),options:{isWholeLine:!0,className:"myLineHighlight"}}]);H.current=r}}},[v,h,I,A,b,JSON.stringify(C)]),l(function(){if(A&&j.current&&(null==w?void 0:w.length)&&O){var e=j.current,n=w.map(function(e){var n,t,i=c(e.severity,null==y||y,O);return{range:new A.Range(e.range.lineStart,null!==(n=e.range.columnStart)&&void 0!==n?n:1,e.range.lineEnd,null!==(t=e.range.columnEnd)&&void 0!==t?t:1),options:{className:i,isWholeLine:void 0===e.range.columnStart}}});k.current=e.deltaDecorations(k.current,n)}},[w,O,A,y]);var X=d(function(e,n,t,i,r){var o,a;if(A&&e&&I){var l=e.getModel();l&&(n=Math.max(-1,n),(t=Math.min(t,l.getLineCount()))<n&&(t=n),requestAnimationFrame(function(){e.revealRangeInCenterIfOutsideViewport(new A.Range(n,1,t,1),A.editor.ScrollType.Smooth),e.setSelection(new A.Range(n,1,t+1,1))}),i&&-1!==(null==i?void 0:i.startIndex)&&-1!==(null==i?void 0:i.endIndex)&&requestAnimationFrame(function(){e.revealRangeInCenterIfOutsideViewport(new A.Range(i.startIndex,1,i.endIndex,1),A.editor.ScrollType.Smooth),e.setSelection(new A.Range(i.startIndex,1,i.endIndex+1,1))}),0===(null===(o=Object.keys(r))||void 0===o?void 0:o.length)&&e.getContribution("editor.contrib.findController").getState().change({isRevealed:!1},!1),(null===(a=Object.keys(r))||void 0===a?void 0:a.length)>0&&(requestAnimationFrame(function(){e.revealRangeInCenterIfOutsideViewport(new A.Range(r.startIndex,1,r.endIndex,1),A.editor.ScrollType.Smooth),e.setSelection(new A.Range(r.startIndex,1,r.endIndex+1,1))}),e.trigger("keyboard","actions.find"),e.getAction("actions.find").run(),e.getContribution("editor.contrib.findController").getState().change({searchString:(null==r?void 0:r.variableName)||"",isRevealed:!0},!1)))}},[A,I,v,h,null==b?void 0:b.startIndex,null==b?void 0:b.endIndex,C]);l(function(){if(j.current&&A&&I){var e=j.current,n=e.onDidLayoutChange(function(){if(X(e,v,h,b,C),-1===v&&w&&w.length>0){var n=w[0].range,t=n.lineStart,i=n.lineEnd;X(e,t,i,b,C)}});return function(){return n.dispose()}}},[X,v,h,I,null==b?void 0:b.startIndex,null==b?void 0:b.endIndex,C,L]);var Y=d(function(e,n){X(e,E,M),j.current=e,F(n),W({start:E,end:M});var t=e.getContainerDomNode(),i=new ResizeObserver(function(){e.layout()});if(i.observe(t),j.current._resizeObserver=i,I){var r=e.getDomNode(),o=document.createElement("div");null==r||r.appendChild(o);var a=function(){var n=e.getTopForLineNumber(E)-e.getScrollTop();o.style.top="".concat(n,"px")};e.onDidScrollChange(a),a()}},[v,h,I,S]);return K?n("div",e({style:{color:"red",fontSize:"12px",padding:"8px"}},{children:K})):q?t(i,{children:[n(q,{height:m,width:p,defaultLanguage:J||f,defaultValue:x,theme:y?"vs-dark":"vs-light",onMount:Y,beforeMount:function(e){e.languages.typescript.javascriptDefaults.setDiagnosticsOptions({noSemanticValidation:!0,noSyntaxValidation:!0})},options:{minimap:{enabled:!1},overviewRulerLanes:3,fontFamily:"Plus Jakarta Sans, sans-serif",scrollBeyondLastLine:!1,readOnly:!0,smoothScrolling:!0,automaticLayout:!0,lineDecorationsWidth:10,padding:{top:20,bottom:20}}}),t("style",{children:[U,".myLineHighlight { background-color: rgba(0, 122, 204, 0.3); }"]})]}):n("div",e({style:{padding:"8px",color:"#666"}},{children:"Loading code editor..."}))};export{g as DiagnosticSeverity,v as default};
|
|
2
|
+
//# sourceMappingURL=CodeEditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeEditor.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{__rest as e,__assign as n,__awaiter as r,__generator as o}from"tslib";import{jsx as i,jsxs as t,Fragment as a}from"react/jsx-runtime";import l,{useState as d,useMemo as c,useRef as s,useEffect as u}from"react";import p from"react-markdown";import f from"rehype-raw";import{Tooltip as g,Box as h}from"@mui/material";import{Prism as v}from"react-syntax-highlighter";import{oneLight as m}from"react-syntax-highlighter/dist/esm/styles/prism";import{Check as y,ContentCopy as b,ExpandLess as x,ExpandMore as _}from"@mui/icons-material";import S from"@mui/icons-material/ExpandMoreOutlined";var k=function(e){var n,r,o;void 0===e&&(e="");var i=null==e?void 0:e.replace(/\\`/g,"`");return i=null==(i=null==(i=null===(o=null==(i=null===(r=null===(n=null==(i=null==i?void 0:i.replace(/```json\s*([\s\S]*?)```/g,function(e,n){return"<codebasename>".concat(n.trim(),"</codebasename>")}))?void 0:i.replace(/^```.*\n?/,""))||void 0===n?void 0:n.replace(/\n?```$/,""))||void 0===r?void 0:r.trim())?void 0:i.replace(/^```/,""))||void 0===o?void 0:o.replace(/```$/,""))?void 0:i.replace(/<\/summary>/g,"</summary>\n"))?void 0:i.replace(/<details>/g,"\n<details>")},w=function(e){var a=e.text,l=d(!1),c=l[0],s=l[1];return t("button",n({onClick:function(){return r(void 0,void 0,void 0,function(){return o(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,navigator.clipboard.writeText(a)];case 1:return e.sent(),s(!0),setTimeout(function(){return s(!1)},2e3),[3,3];case 2:return e.sent(),[3,3];case 3:return[2]}})})},"aria-label":"Copy code",style:{position:"absolute",top:8,right:8,display:"inline-flex",alignItems:"center",gap:4,padding:"3px 8px",fontSize:"0.68rem",fontWeight:500,fontFamily:"inherit",color:c?"#16a34a":"#6B7280",background:c?"#f0fdf4":"#f3f4f6",border:"1px solid ".concat(c?"#bbf7d0":"#e5e7eb"),borderRadius:6,cursor:"pointer",transition:"all 0.2s",opacity:.85},onMouseEnter:function(e){e.currentTarget.style.opacity="1"},onMouseLeave:function(e){e.currentTarget.style.opacity="0.85"}},{children:[i(c?y:b,{style:{fontSize:13}}),c?"Copied":"Copy"]}))},z=function(r){r.node;var o=e(r,["node"]),a=d(!1),c=a[0],p=a[1],f=s(null),g=l.Children.toArray(o.children),h=g.find(function(e){var n;return null===(n=null==e?void 0:e.props)||void 0===n?void 0:n["data-codebase-name"]}),v=!!h,m=v?h.props["data-codebase-name"]:"",y=g.map(function(e){var n;return"string"==typeof e?e:(null===(n=e.props)||void 0===n?void 0:n.children)||""}).join("").replace(/\*\*/g,"").trim(),b=v?"From ".concat(m," codebase"):y||"Accordion title not found";return u(function(){var e,n=null===(e=f.current)||void 0===e?void 0:e.parentElement;if(n){var r=function(){return p(n.open)};return r(),n.addEventListener("toggle",r),function(){return n.removeEventListener("toggle",r)}}},[]),t("summary",n({ref:f,style:{padding:"8px 12px",listStyleType:"none",cursor:"pointer",fontWeight:600,fontSize:"0.82rem",color:"#6932E2",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,borderRadius:8,background:c?"#f5f3ff":"transparent",transition:"background 0.2s"}},{children:[i("span",{children:b}),i("div",n({style:{display:"flex",alignItems:"center",flexShrink:0,color:"#6932E2"}},{children:i(c?x:_,{sx:{fontSize:"1.1rem"}})}))]}))},M=function(r){var o,s=r.message,u=r.fontSize,y=r.extraMetaData,b=r.style,x=r.codeStyle,_=r.preStyle,M=r.blockquoteStyle,C=r.syntaxHighlighterTheme,R=r.cognitiveDecisioningStyles,W=null!=u?u:"0.88rem",E=null!==(o=null==b?void 0:b.color)&&void 0!==o?o:"#1f2937",H=d({open:!1,data:null,activeKey:null}),T=H[0],L=H[1],K=c(function(){var e=function(e){var n={};return{processed:e.replace(/<!--\s*<ai_reasoning>\s*([\s\S]*?)\s*<\/ai_reasoning>\s*-->/g,function(e,r){try{var o=JSON.parse(r.trim()),i=o.id||"reasoning_".concat(Object.keys(n).length);return n[i]=o,'<aireasoning data-reasoning-key="'.concat(i,'">').concat(i,"</aireasoning>")}catch(e){return console.warn("[ai_reasoning] Failed to parse block:",e),""}}),reasoningMap:n}}(s||"");return{processedMessage:e.processed,inlineReasoningMap:e.reasoningMap}},[s]),j=K.processedMessage,B=K.inlineReasoningMap,F=c(function(){return{aireasoning:function(r){r.node;var o=e(r,["node"])["data-reasoning-key"],a=B[o];if(!a)return null;var l=T.open&&T.activeKey===o;return i("div",n({style:{margin:"6px 0"}},{children:t("span",n({onClick:function(e){e.stopPropagation();var n=function(e){var n,r,o,i,t,a,l,d=[];return(null!==(r=null===(n=e.aiReasoningCitation)||void 0===n?void 0:n.gpt_citation)&&void 0!==r?r:[]).forEach(function(e){var n,r,o,i,t,a,l,c,s,u,p,f=null!==(r=null===(n=e.customMetadata)||void 0===n?void 0:n.data_sources)&&void 0!==r?r:[],g=null!==(i=null===(o=e.customMetadata)||void 0===o?void 0:o.training_data_title)&&void 0!==i?i:[],h=null!==(a=null===(t=e.customMetadata)||void 0===t?void 0:t.paraphrase)&&void 0!==a?a:[],v=null===(l=f[0])||void 0===l?void 0:l.match(/<highlight>([\s\S]*?)<\/highlight>/),m=v?v[1].trim():null!==(c=f[0])&&void 0!==c?c:"";d.push({citation_number:Number(e.citation_number),section_ref:null!==(s=g[0])&&void 0!==s?s:"",training_data_title:null!==(u=g[0])&&void 0!==u?u:"",paraphrase:null!==(p=h[0])&&void 0!==p?p:"",data_sources:f,highlight:m})}),{block_cognitive_reasoning_html:null!==(i=null!==(o=e.Reasoning)&&void 0!==o?o:e.reasoning)&&void 0!==i?i:"",block_cognitive_gap_html:null!==(t=e.Gap)&&void 0!==t?t:"",block_cognitive_confidence:Number(null!==(l=null!==(a=e.Confidence_score)&&void 0!==a?a:e.decision_strength)&&void 0!==l?l:0),block_cognitive_citations:d}}(a);L(function(e){return e.open&&e.activeKey===o?{open:!1,data:null,activeKey:null}:{open:!0,data:n,activeKey:o}})},style:{display:"inline-flex",alignItems:"center",gap:6,cursor:"pointer",color:"#6932E2",fontWeight:500,fontSize:W,transition:"all 0.2s",padding:"2px 0"}},{children:[i("span",{children:o}),i("span",n({style:{display:"inline-flex",alignItems:"center",gap:2,border:"1px solid #e2e8f0",borderRadius:5,padding:"4px 2px"}},{children:i(S,{sx:{fontSize:"1rem",color:"#475569",transform:l?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s"}})}))]}))}))},codebasename:function(e){var r=e.children,o=("string"==typeof r[0]?r[0]:"").trim();return""!==o?t("div",n({"data-codebase-name":o,style:{position:"relative",margin:"12px 0"}},{children:[i(w,{text:String(r).replace(/\n$/,"")}),i(v,n({style:null!=C?C:m,language:"json",PreTag:"div",customStyle:n({borderRadius:8,padding:"1rem",fontSize:"0.8rem",border:"1px solid #e5e7eb",margin:0,lineHeight:1.6},_)},{children:String(r).replace(/\n$/,"")}))]})):i(a,{})},details:function(r){r.node;var o=e(r,["node"]);return i("details",n({},o,{style:{borderRadius:8,border:"1px solid #e9e5f5",backgroundColor:"transparent",margin:"8px 0",overflow:"hidden"}},{children:o.children}))},summary:z,p:function(r){r.node;var o=e(r,["node"]);return i("p",n({style:{wordWrap:"break-word",overflowWrap:"break-word",wordBreak:"break-word",whiteSpace:"normal",overflow:"hidden",display:"block",maxWidth:"100%",fontSize:W,lineHeight:1.7,margin:"4px 0",color:E}},{children:null==o?void 0:o.children}))},strong:function(r){r.node;var o=e(r,["node"]);return i("strong",n({style:{fontWeight:650,color:E}},{children:null==o?void 0:o.children}))},h1:function(r){r.node;var o=e(r,["node"]);return i("h1",n({style:{fontSize:"1.35rem",fontWeight:700,color:E,margin:"20px 0 8px",lineHeight:1.3,letterSpacing:"-0.01em"}},{children:o.children}))},h2:function(r){r.node;var o=e(r,["node"]);return i("h2",n({style:{fontSize:"1.15rem",fontWeight:650,color:E,margin:"16px 0 6px",lineHeight:1.35}},{children:o.children}))},h3:function(r){r.node;var o=e(r,["node"]);return i("h3",n({style:{fontSize:"1rem",fontWeight:600,color:E,margin:"14px 0 4px",lineHeight:1.4}},{children:o.children}))},h4:function(r){r.node;var o=e(r,["node"]);return i("h4",n({style:{fontSize:"0.92rem",fontWeight:600,color:E,margin:"12px 0 4px",lineHeight:1.4}},{children:o.children}))},ol:function(r){r.node;var o=e(r,["node"]);return i("ol",n({style:{listStyleType:"decimal",marginLeft:20,paddingLeft:4,display:"flex",flexDirection:"column",gap:2}},{children:null==o?void 0:o.children}))},ul:function(r){r.node;var o=e(r,["node"]);return i("ul",n({style:{listStyleType:"disc",marginLeft:20,paddingLeft:4,display:"flex",flexDirection:"column",gap:2}},{children:null==o?void 0:o.children}))},li:function(r){r.node;var o=e(r,["node"]);return i("li",n({style:{fontSize:W,lineHeight:1.7,color:E,paddingLeft:4}},{children:o.children}))},blockquote:function(r){r.node;var o=e(r,["node"]);return i("blockquote",n({style:n({margin:"12px 0",padding:"8px 16px",borderLeft:"3px solid #8b5cf6",background:"#faf5ff",borderRadius:"0 6px 6px 0",color:E,fontStyle:"italic",fontSize:W,lineHeight:1.65},M)},{children:o.children}))},hr:function(){return i("hr",{style:{border:"none",height:1,background:"linear-gradient(to right, transparent, #d1d5db, transparent)",margin:"16px 0"}})},table:function(r){r.node;var o=e(r,["node"]);return i("div",n({style:{overflowX:"auto",margin:"12px 0",borderRadius:8,border:"1px solid #e5e7eb"}},{children:i("table",n({style:{width:"100%",borderCollapse:"collapse",fontSize:"0.8rem",lineHeight:1.5}},{children:o.children}))}))},thead:function(r){r.node;var o=e(r,["node"]);return i("thead",n({style:{background:"#f9fafb",borderBottom:"2px solid #e5e7eb"}},{children:o.children}))},th:function(r){r.node;var o=e(r,["node"]);return i("th",n({style:{padding:"8px 12px",textAlign:"left",fontWeight:600,fontSize:"0.76rem",color:E,whiteSpace:"nowrap"}},{children:o.children}))},td:function(r){r.node;var o=e(r,["node"]);return i("td",n({style:{padding:"8px 12px",borderTop:"1px solid #f3f4f6",color:E,fontSize:"0.8rem"}},{children:o.children}))},a:function(r){var o=r.children;r.node;var l=e(r,["children","node"]),d=l["data-cognitive-reasoning"];if(d&&(null==y?void 0:y[d])){var c=T.open&&T.activeKey===d;return i(a,{children:t("span",n({onClick:function(e){e.stopPropagation();var n=function(e){var n,r,o,i,t;if(!e)return null;var a=[];return(null!==(r=null===(n=e.aiReasoningCitation)||void 0===n?void 0:n.gpt_citation)&&void 0!==r?r:[]).forEach(function(e){var n,r,o,i,t,l,d,c,s,u,p,f=null!==(r=null===(n=e.customMetadata)||void 0===n?void 0:n.data_sources)&&void 0!==r?r:[],g=null!==(i=null===(o=e.customMetadata)||void 0===o?void 0:o.training_data_title)&&void 0!==i?i:[],h=null!==(l=null===(t=e.customMetadata)||void 0===t?void 0:t.paraphrase)&&void 0!==l?l:[],v=null===(d=f[0])||void 0===d?void 0:d.match(/<highlight>([\s\S]*?)<\/highlight>/),m=v?v[1].trim():null!==(c=f[0])&&void 0!==c?c:"";a.push({citation_number:Number(e.citation_number),section_ref:null!==(s=g[0])&&void 0!==s?s:"",training_data_title:null!==(u=g[0])&&void 0!==u?u:"",paraphrase:null!==(p=h[0])&&void 0!==p?p:"",data_sources:f,highlight:m})}),{block_cognitive_reasoning_html:null!==(o=e.Reasoning)&&void 0!==o?o:"",block_cognitive_gap_html:null!==(i=e.Gap)&&void 0!==i?i:"",block_cognitive_confidence:Number(null!==(t=e.Confidence_score)&&void 0!==t?t:0),block_cognitive_citations:a}}(y[d]);L(function(e){return e.open&&e.activeKey===d?{open:!1,data:null,activeKey:null}:{open:!0,data:n,activeKey:d}})},style:{color:"#6932E2",fontWeight:500,cursor:"pointer",transition:"all 0.2s",padding:"0 2px",position:"relative",display:"inline-flex",alignItems:"center",gap:6}},{children:[o||"",i("span",n({style:{cursor:"pointer",padding:"4px 2px",display:"inline-flex",alignItems:"center",gap:2,border:"1px solid #e2e8f0",borderRadius:"5px"}},{children:i(S,{sx:{fontSize:"1rem",color:"#475569",transform:c?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s"}})}))]}))})}var s=!1;try{s=new URL(null==l?void 0:l.href).protocol.startsWith("http")}catch(e){s=!1}return s?i("a",n({href:null==l?void 0:l.href,style:{color:"#6932E2",textDecoration:"none",fontWeight:500,borderBottom:"1px solid #c4b5fd",transition:"border-color 0.2s, color 0.2s"},target:"_blank",rel:"noopener noreferrer",onMouseEnter:function(e){e.currentTarget.style.borderBottomColor="#6932E2"},onMouseLeave:function(e){e.currentTarget.style.borderBottomColor="#c4b5fd"}},{children:o})):i("span",{children:o})},sup:function(r){r.node;var o=e(r,["node"]);return i(g,n({title:o.children,placement:"top",arrow:!0},{children:i(h,n({component:"span",sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:16,height:16,borderRadius:"50%",background:"#ede9fe",color:"#7c3aed",fontSize:"0.6rem",fontWeight:700,verticalAlign:"super",cursor:"pointer",userSelect:"none",lineHeight:1,transition:"all 0.2s","&:hover":{background:"#7c3aed",color:"#fff"}},"aria-label":"Info",role:"button"},{children:"i"}))}))},code:function(e){var r=e.children;return i("code",n({style:n({fontFamily:"'JetBrains Mono', 'Fira Code', 'SF Mono', Menlo, monospace",fontSize:"0.82em",color:"#9333ea",background:"#faf5ff",padding:"1.5px 5px",borderRadius:4,border:"1px solid #f3e8ff",fontWeight:500},x)},{children:r}))},pre:function(e){var r=e.children,o=function(e){var n;return"string"==typeof e?e:(null===(n=null==e?void 0:e.props)||void 0===n?void 0:n.children)?(Array.isArray(e.props.children)?e.props.children:[e.props.children]).map(o).join(""):""},a=l.Children.toArray(r).map(o).join("");return t("div",n({style:{position:"relative",margin:"12px 0"}},{children:[i(w,{text:a}),i("pre",n({style:n({fontFamily:"'JetBrains Mono', 'Fira Code', 'SF Mono', Menlo, monospace",fontSize:"0.8rem",lineHeight:1.6,color:"#1f2937",background:"#f9fafb",border:"1px solid #e5e7eb",borderRadius:8,padding:"14px 16px",margin:0,overflowX:"auto",whiteSpace:"pre"},_)},{children:r}))]}))},img:function(r){r.node;var o=e(r,["node"]);return i("img",n({},o,{style:{maxWidth:"100%",height:"auto",borderRadius:8,margin:"8px 0",border:"1px solid #e5e7eb"},loading:"lazy"}))}}},[W,y,T.activeKey,T.open,B,E,x,_,M,C,R]);return i("div",n({className:"pg-markdown-renderer",style:n({fontSize:W,lineHeight:1.7,color:"#1f2937",wordBreak:"break-word",position:"relative"},b)},{children:i(p,n({components:F,rehypePlugins:[f],className:"react-markdown-renderer-with-overrides"},{children:k(j)}))}))};export{M as MarkdownRenderer,M as default};
|
|
2
|
+
//# sourceMappingURL=Markdownrenderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Markdownrenderer.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as e,jsx as
|
|
1
|
+
import{jsxs as e,jsx as n}from"react/jsx-runtime";import{createContext as t,useState as i,useMemo as o,useCallback as r,useContext as s}from"react";import{RefProvider as a}from"../../store/ref.context.js";import"../UserStoryCard/cws/CwsEvent.js";import l from"../UserStoryCard/cws/CwsEventProvider.js";import{Toaster as d}from"react-hot-toast";var c;!function(e){e.WAITING="waiting",e.IN_PROGRESS="in_progress",e.GENERATED="generated",e.FAILED="failed",e.GENERATE="generate",e.APPROVED="approved"}(c||(c={}));const u=t(null),g="user-story-lib",f=({children:t,userStory:s,setUserStory:c,aiReasoning:f,setAiReasoning:C,citations:m,setCitations:p,apiCachingConfig:h,customStyles:v,customIcons:I,searchQueryList:y,searchQueryReasoningIdList:R,citationConfig:S,chatHistory:E,chatCitationConfigs:A,gptCitationConfigs:w,diffEditConfig:D,aiReasoningAccordionOpenStates:b,persistedDataFiles:U,inlineUpdateComponentConfig:x,segmentComponentConfig:N,onEditBlocked:P,inlineManualComponentConfig:F,redlineConfig:L,sectionStatusConfig:T,customSectionConfig:_,updateRedlineDataParent:j,redlineCollaborativeConfig:k})=>{const[G,H]=i(0),[O,Q]=i(""),B=o(()=>{if(0===s.length||0===f.length)return Array(s.length).fill(0);const e=Array.from({length:s.length},()=>[]);return f.forEach(n=>{const t=Number(n.relevance_score);if(isNaN(t)||t<=0)return;const i=`ai_reasoning$${n.id}`,o=s.findIndex(e=>{var n;return e.value.includes(i)||(null===(n=e.sub_features)||void 0===n?void 0:n.some(e=>e.value.includes(i)))});-1!==o&&e[o].push(t)}),e.map(e=>0===e.length?0:Math.round(e.reduce((e,n)=>e+n,0)/e.length))},[s,f]),M=r(e=>{var n;const t=s.findIndex(n=>n.artifactId===e);return-1===t?0:null!==(n=B[t])&&void 0!==n?n:0},[s,B]);return e(u.Provider,{value:{chatHistory:E,userStory:s,setUserStory:c,aiReasoning:f,setAiReasoning:C,citations:m,setCitations:p,apiCachingConfig:h,customStyles:v,customIcons:I,searchQueryList:y,searchQueryReasoningIdList:R,citationConfig:S,getAvgScoreForStory:M,chatCitationConfigs:A,gptCitationConfigs:w,diffEditConfig:D,aiReasoningAccordionOpenStates:b,persistedDataFiles:U,currentHighlightIndex:G,setCurrentHighlightIndex:H,inlineUpdateComponentConfig:x,segmentComponentConfig:N,onEditBlocked:P,inlineManualComponentConfig:F,redlineConfig:L,redlineDcoumentId:O,setRedlineDocumentId:Q,sectionStatusConfig:T,customSectionConfig:_,updateRedlineDataParent:j,redlineCollaborativeConfig:k},children:[n(d,{position:"top-right",toasterId:g}),(null==k?void 0:k.initiateCollaborativeFlow)?n(l,{applicationId:null==k?void 0:k.modeId,baseUrl:null==k?void 0:k.cwsBaseUrl,authToken:null==k?void 0:k.authToken,children:n(a,{children:t})}):n(a,{children:t})]})},C=()=>{const e=s(u);if(!e)throw new Error("useRequirementAI must be used within RequirementAIWrapper");return e};export{c as SectionStatus,g as ToasterId,f as default,C as useRequirementAI};
|
|
2
2
|
//# sourceMappingURL=RequirementAIWrapper.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{useEffect as r}from"react";import{useLexicalComposerContext as t}from"@lexical/react/LexicalComposerContext";import{$generateNodesFromDOM as e}from"@lexical/html";import{$getRoot as o,$isParagraphNode as a}from"lexical";import i from"showdown";import{
|
|
1
|
+
import{useEffect as r}from"react";import{useLexicalComposerContext as t}from"@lexical/react/LexicalComposerContext";import{$generateNodesFromDOM as e}from"@lexical/html";import{$getRoot as o,$isParagraphNode as a}from"lexical";import i from"showdown";import{escapeTagIds as l,splitTagAcrossParagraphs as m}from"../../../../../../utils/tagHelper.js";const n=({initialValue:n,initialFormat:p,mode:c})=>{const[s]=t();return r(()=>{if(n){if(n=(()=>{let r=l(n,["manual","upt"]);return["del","ins","preserved","manual","upt"].forEach(t=>{r=m(r,t)}),r})(),p&&"html"!==p){var r=new i.Converter;n=r.makeHtml(n)}s.update(()=>{const r=o();r.clear();const t=(new DOMParser).parseFromString(n||"","text/html");e(s,t).forEach(t=>{try{a(t)&&t.setFormat("justify"),r.append(t)}catch(r){console.error("Error appending node to root: ",r)}})})}},[n,s]),r(()=>{s.setEditable("edit"===c)},[s,c]),null};export{n as InitialHtml};
|
|
2
2
|
//# sourceMappingURL=InitialHtml.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{ElementNode as t}from"lexical";class s extends t{static getType(){return"manual"}static clone(t){return new s(t.__id,t.__status,t.__key)}constructor(t=crypto.randomUUID(),s="",e){super(e),this.__id=t,this.__status=s}getId(){return this.getLatest().__id}getStatus(){return this.getLatest().__status}setStatus(t){this.getWritable().__status=t}createDOM(){const t=document.createElement("manual");return t.dataset.id=this.__id,t.className=`PlaygroundEditorTheme__manual-node-${this.__status}`,this.__status&&(t.dataset.status=this.__status),t.contentEditable="pending"===this.__status?"false":"true",t}exportDOM(){const t=document.createElement("manual");return t.id=this.__id,t.dataset.status=this.__status,{element:t}}updateDOM(t,s){return t.__id!==this.__id&&(s.dataset.id=this.__id),t.__status!==this.__status&&(this.__status?s.dataset.status=this.__status:delete s.dataset.status,s.contentEditable="pending"===this.__status?"false":"true"),!1}static importDOM(){return{manual:()=>({conversion:e,priority:1})}}static importJSON(t){var e;return new s(t.id,null!==(e=t.status)&&void 0!==e?e:"")}exportJSON(){return{...super.exportJSON(),type:"manual",version:1,id:this.__id,status:this.__status}}
|
|
1
|
+
import{ElementNode as t}from"lexical";class s extends t{static getType(){return"manual"}static clone(t){return new s(t.__id,t.__status,t.__key)}constructor(t=crypto.randomUUID(),s="",e){super(e),this.__id=t,this.__status=s}getId(){return this.getLatest().__id}getStatus(){return this.getLatest().__status}setStatus(t){this.getWritable().__status=t}createDOM(){const t=document.createElement("manual");return t.dataset.id=this.__id,t.className=`PlaygroundEditorTheme__manual-node-${this.__status}`,this.__status&&(t.dataset.status=this.__status),t.contentEditable="pending"===this.__status?"false":"true",t}exportDOM(){const t=document.createElement("manual");return t.id=this.__id,t.dataset.status=this.__status,{element:t}}updateDOM(t,s){return t.__id!==this.__id&&(s.dataset.id=this.__id),t.__status!==this.__status&&(this.__status?s.dataset.status=this.__status:delete s.dataset.status,s.contentEditable="pending"===this.__status?"false":"true"),!1}static importDOM(){return{manual:()=>({conversion:e,priority:1})}}static importJSON(t){var e;return new s(t.id,null!==(e=t.status)&&void 0!==e?e:"")}exportJSON(){return{...super.exportJSON(),type:"manual",version:1,id:this.__id,status:this.__status}}canInsertTextBefore(){return"pending"!==this.__status}canInsertTextAfter(){return"pending"!==this.__status}}function e(t){var e;return{node:new s(t.id||crypto.randomUUID(),null!==(e=t.dataset.status)&&void 0!==e?e:"")}}export{s as ManualNode};
|
|
2
2
|
//# sourceMappingURL=ManualNode.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{ElementNode as t}from"lexical";class s extends t{static getType(){return"update"}static clone(t){return new s(t.__id,t.__status,t.__key)}constructor(t=crypto.randomUUID(),s="",e){super(e),this.__id=t,this.__status=s}getId(){return this.getLatest().__id}getStatus(){return this.getLatest().__status}setStatus(t){this.getWritable().__status=t}createDOM(){const t=document.createElement("upt");return t.dataset.id=this.__id,t.className=`PlaygroundEditorTheme__update-node-${this.__status}`,this.__status&&(t.dataset.status=this.__status),t.contentEditable="pending"===this.__status?"false":"true",t}exportDOM(){const t=document.createElement("upt");return t.id=this.__id,t.dataset.status=this.__status,{element:t}}updateDOM(t,s){return t.__id!==this.__id&&(s.dataset.id=this.__id),t.__status!==this.__status&&(this.__status?s.dataset.status=this.__status:delete s.dataset.status,s.contentEditable="pending"===this.__status?"false":"true"),!1}static importDOM(){return{upt:()=>({conversion:e,priority:1})}}static importJSON(t){var e;return new s(t.id,null!==(e=t.status)&&void 0!==e?e:"")}exportJSON(){return{...super.exportJSON(),type:"update",version:1,id:this.__id,status:this.__status}}
|
|
1
|
+
import{ElementNode as t}from"lexical";class s extends t{static getType(){return"update"}static clone(t){return new s(t.__id,t.__status,t.__key)}constructor(t=crypto.randomUUID(),s="",e){super(e),this.__id=t,this.__status=s}getId(){return this.getLatest().__id}getStatus(){return this.getLatest().__status}setStatus(t){this.getWritable().__status=t}createDOM(){const t=document.createElement("upt");return t.dataset.id=this.__id,t.className=`PlaygroundEditorTheme__update-node-${this.__status}`,this.__status&&(t.dataset.status=this.__status),t.contentEditable="pending"===this.__status?"false":"true",t}exportDOM(){const t=document.createElement("upt");return t.id=this.__id,t.dataset.status=this.__status,{element:t}}updateDOM(t,s){return t.__id!==this.__id&&(s.dataset.id=this.__id),t.__status!==this.__status&&(this.__status?s.dataset.status=this.__status:delete s.dataset.status,s.contentEditable="pending"===this.__status?"false":"true"),!1}static importDOM(){return{upt:()=>({conversion:e,priority:1})}}static importJSON(t){var e;return new s(t.id,null!==(e=t.status)&&void 0!==e?e:"")}exportJSON(){return{...super.exportJSON(),type:"update",version:1,id:this.__id,status:this.__status}}canInsertTextBefore(){return"pending"!==this.__status}canInsertTextAfter(){return"pending"!==this.__status}}function e(t){var e;return{node:new s(t.id||crypto.randomUUID(),null!==(e=t.dataset.status)&&void 0!==e?e:"")}}export{s as UpdateNode};
|
|
2
2
|
//# sourceMappingURL=UpdateNode.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{forwardRef as r,useRef as n,useState as l,useEffect as o,useImperativeHandle as i}from"react";import{DEFAULT_TOOLBAR_CONFIG as a}from"./Editor/constants/editorConfig.js";import s from"./Editor/Editor.js";import{useRefStore as c}from"../../store/ref.context.js";import{$generateHtmlFromNodes as d}from"@lexical/html";import u from"turndown";import{tables as p}from"turndown-plugin-gfm";import{UnsavedChangesPopup as h}from"../UnsavedChangesPopup/UnsavedChangesPopup.js";import{mergeTagAcrossParagraphs as g,unescapeTagIds as m,preserveLegacyCommentRedlinesFromSource as f,preserveDocumentAnchorsFromSource as v,preserveInvisibleAnchorBeforeTablePipe as E}from"../../../../utils/tagHelper.js";import{INITIAL_CONTENT_UPDATE_TAG as b}from"./Editor/constants/updateTags.js";import{preserveEmphasisMarkersFromSource as x,markdownWithoutEmphasisMarkers as $}from"./Editor/utils/preserveMarkdownEmphasis.js";import{preserveTableDelimiterRowsFromSource as w}from"./Editor/utils/preserveTableDelimiters.js";import{preserveLineBreaksFromSource as A}from"./Editor/utils/preserveMarkdownLineBreaks.js";import{preserveListFormattingFromSource as y}from"./Editor/utils/preserveMarkdownListFormatting.js";const S=new u({headingStyle:"atx",codeBlockStyle:"fenced",emDelimiter:"*"}),C=e=>e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");S.keep(["ins","del","mark"]),S.keep(e=>["DELETED","CHANGED"].includes(e.nodeName)),S.addRule("ai-reasoning-link-passthrough",{filter:e=>{var t,r;return"A"===e.nodeName&&null!==(r=null===(t=e.getAttribute("href"))||void 0===t?void 0:t.includes("ai_reasoning$"))&&void 0!==r&&r},replacement:(e,t)=>{const r=t,n=r.getAttribute("href")||"",l=r.textContent||"";return`<a href="${o=n,C(o).replace(/"/g,""")}">${C(l)}</a>`;var o}}),S.keep(e=>"SPAN"===e.nodeName&&e.hasAttribute("highlight-id")),S.addRule("md-table-passthrough",{filter:e=>"PRE"===e.nodeName&&"true"===e.getAttribute("data-md-table"),replacement:(e,t)=>t.textContent||""}),S.use(p),S.addRule("stable-table-cell",{filter:["th","td"],replacement:(e,t)=>{var r,n;const l=t,o=0===Array.from(null!==(n=null===(r=l.parentElement)||void 0===r?void 0:r.children)&&void 0!==n?n:[]).indexOf(l);let i=e.trim().replace(/\n{2,}/g,"<br><br>").replace(/\n/g,"<br>");return/^(?:<br>)+$/.test(i)&&(i=""),i=T(i),o?i?`| ${i} |`:"| |":i?` ${i} |`:" |"}});const N=(e,t)=>{let r=0;for(let n=t-1;n>=0&&"\\"===e[n];n-=1)r+=1;return r%2==1},T=e=>e.split(/(<[^>]+>)/g).map(e=>{if(e.startsWith("<"))return e;let t="";for(let r=0;r<e.length;r+=1){const n=e[r];t+="|"!==n||N(e,r)?n:"\\|"}return t}).join("");S.addRule("stable-line-break",{filter:"br",replacement:()=>"<br>"});const B=e=>{var t,r;const n=null!==(r=null===(t=e.match(/^\s*/))||void 0===t?void 0:t[0])&&void 0!==r?r:"";let l=e.slice(n.length).trimEnd();const o=l.startsWith("|"),i=l.endsWith("|")&&!N(l,l.length-1);o&&(l=l.slice(1)),i&&(l=l.slice(0,-1));const a=[];let s="",c=!1,d="";for(let e=0;e<l.length;e+=1){const t=l[e];c?(s+=t,d?t!==d||N(l,e)||(d=""):'"'===t||"'"===t?d=t:">"===t&&(c=!1)):"<"===t?(c=!0,s+=t):"|"!==t||N(l,e)?s+=t:(a.push(s),s="")}return a.push(s),a.length<2?null:{indent:n,leadingPipe:o,trailingPipe:i,rawCells:a,cells:a.map(e=>e.trim())}},I=e=>!!e&&e.cells.every(e=>/^:?-{3,}:?$/.test(e)),L=e=>{const t=[];for(let r=1;r<e.length;r+=1){const n=B(e[r]),l=B(e[r-1]);if(!I(n)||!l)continue;const o=[{lineIndex:r-1,row:l},{lineIndex:r,row:n}];for(r+=1;r<e.length;){const t=B(e[r]);if(!t||I(t))break;o.push({lineIndex:r,row:t}),r+=1}t.push(o),r-=1}return t},R=e=>e.trim().replace(/(?:[ \t\u00a0]| )*<br\s*\/?>(?:[ \t\u00a0]| )*/gi,"<br>"),j=e=>e.replace(/<[^>]*>/g," ").replace(/[*_`~]+/g,"").replace(/ |\u00a0/gi," ").replace(/\s+/g," ").trim().toLocaleLowerCase(),q=(e,t)=>{const r=/(?:[ \t\u00a0]| )*<br\s*\/?>(?:[ \t\u00a0]| )*/gi,n=Array.from(e.matchAll(r)),l=n.map((t,r)=>{var l,o,i,a,s;return{raw:t[0],left:j(e.slice(null!==(o=null===(l=n[r-1])||void 0===l?void 0:l.index)&&void 0!==o?o:0,t.index).slice(-80)),right:j(e.slice((null!==(i=t.index)&&void 0!==i?i:0)+t[0].length,null!==(s=null===(a=n[r+1])||void 0===a?void 0:a.index)&&void 0!==s?s:e.length).slice(0,80)),used:!1}}),o=Array.from(t.matchAll(r));let i=0;return t.replace(r,(r,n)=>{var a,s,c,d;const u=o.findIndex(e=>e.index===n),p=u>0?(null!==(a=o[u-1].index)&&void 0!==a?a:0)+o[u-1][0].length:0,h=null!==(c=null===(s=o[u+1])||void 0===s?void 0:s.index)&&void 0!==c?c:t.length,g=j(t.slice(p,n).slice(-80)),m=j(t.slice(n+r.length,h).slice(0,80)),f=l.findIndex((e,t)=>t>=i&&!e.used&&(e.left&&g.endsWith(e.left)||g&&e.left.endsWith(g)||e.right&&m.startsWith(e.right)||m&&e.right.startsWith(m))),v=l[f];if(v)return v.used=!0,i=f+1,v.raw;for(;null===(d=l[i])||void 0===d?void 0:d.used;)i+=1;const E=l[i];return E?(E.used=!0,i+=1,E.raw):(r=>{var n,l;const o=t.slice(0,r),i=o.lastIndexOf("<manual"),a=o.lastIndexOf("</manual"),s=o.lastIndexOf("<ins"),c=o.lastIndexOf("</ins");if(i<=a||s<=c)return!1;const d=null!==(l=null===(n=o.slice(i).match(/^<manual\b[^>]*>/i))||void 0===n?void 0:n[0])&&void 0!==l?l:"",u=O(d);return Boolean(u&&!e.includes(u))})(n)?r:""})},k=new RegExp(String.raw`<(manual|upt)\b((?:[^>"']|"[^"]*"|'[^']*')*)>([\s\S]*?)<\/\1\s*>`,"gi"),O=e=>{var t,r;return null!==(r=null===(t=e.match(/\bid\s*=\s*(?:"([^"]*)"|'([^']*)')/i))||void 0===t?void 0:t.slice(1).find(Boolean))&&void 0!==r?r:""},W=e=>$(e).replace(/<(\/)?(del|ins|preserved)\b[^>]*>/gi,(e,t,r)=>` ZXQ${t?"CLOSE":"OPEN"}${String(r).toUpperCase()}QXZ `).replace(/<br\s*\/?>/gi,"\n").replace(/<[^>]*>/g,"").replace(/ |\u00a0/gi," ").replace(/>/gi,">").replace(/</gi,"<").replace(/"/gi,'"').replace(/'|'/gi,"'").replace(/&/gi,"&").replace(/\s+/g," ").trim(),M=(e,t)=>{const r=((e,t)=>{if(e.cells.length===t.cells.length)return t.cells;const r=e.cells.filter(Boolean),n=t.cells.filter(Boolean);if(r.length!==n.length)return null;let l=0;return e.cells.map(e=>{if(!e)return"";const t=n[l];return l+=1,t})})(e,t);if(!r)return null;const n=r.map((r,n)=>{var l,o,i,a,s,c,d,u,p;const h=e.rawCells[n],g=null!==(o=null===(l=h.match(/^\s*/))||void 0===l?void 0:l[0])&&void 0!==o?o:"",m=null!==(a=null===(i=h.match(/\s*$/))||void 0===i?void 0:i[0])&&void 0!==a?a:"";if(!h.trim()){if(!r)return h;const e=null!==(s=t.rawCells[n])&&void 0!==s?s:r;return`${null!==(d=null===(c=e.match(/^\s*/))||void 0===c?void 0:c[0])&&void 0!==d?d:""}${r}${null!==(p=null===(u=e.match(/\s*$/))||void 0===u?void 0:u[0])&&void 0!==p?p:""}`}const f=e.cells[n];if(R(f)===R(r))return h;return`${g}${q(f,r)}${m}`});return`${e.indent}${e.leadingPipe?"|":""}${n.join("|")}${e.trailingPipe?"|":""}`},P=e=>(e||"").replace(/\r\n/g,"\n").trim(),X=r(({type:r,value:u,handleUpdateState:p,onBlur:$,placeholder:C,minHeight:N,height:T,mode:B,doNotShowBorderInViewMode:R,onEditBlocked:j,onSaveUnsavedChanges:q,onDiscardUnsavedChanges:X,isSavingUnsavedChanges:D=!1},H)=>{const Q=n(null),[Z,K]=l({type:r,value:u}),[U,_]=l(0),[V,z]=l(!1),F=n(u),G=n(u),J=n(Boolean(u)),{contentRef:Y,setContentRef:ee}=c();o(()=>{K(e=>({...e,value:u})),F.current=u,G.current=u,J.current=Boolean(u),z(!1)},[u]),i(H,()=>({requestClose:()=>!("edit"===B&&P(F.current)!==P(G.current))||(z(!0),!1)}),[B]);return o(()=>{const e=()=>{Y&&Y.current&&_(Y.current.clientHeight-60)};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[Y]),e("div",{style:{position:"relative",width:"100%",height:T,minHeight:N},children:[V&&t(h,{isSaving:D,onSave:async()=>{await(null==q?void 0:q()),F.current=G.current,z(!1)},onDiscard:()=>{G.current=F.current,null==X||X(),z(!1)}}),t(s,{minHeight:N,height:T,placeholder:C||"Enter some text...",onChange:(e,t,r)=>{e.read(()=>{const e=d(t,null),n=(new DOMParser).parseFromString(e,"text/html");n.querySelectorAll("span").forEach(e=>{const t=e.getAttribute("style")||"";t.includes("background-color")&&(t.includes("rgb(219, 234, 254)")||t.includes("rgb(213, 232, 255)")||t.toLowerCase().includes("#d5e8ff"))&&e.setAttribute("data-review","insert"),t.includes("text-decoration")&&t.includes("line-through")&&e.setAttribute("data-review","delete")}),n.querySelectorAll("span[data-review]").forEach(e=>{const t="delete"===e.getAttribute("data-review")?"deleted":"changed",r=n.createElement(t);r.append(...Array.from(e.childNodes)),e.replaceWith(r)}),n.querySelectorAll("strong code").forEach(e=>{const t=e.parentElement;t&&t.replaceChild(document.createTextNode(e.textContent||""),e)}),n.querySelectorAll("code strong").forEach(e=>{const t=e.parentElement;t&&t.replaceChild(document.createTextNode(e.textContent||""),e)}),n.querySelectorAll("code").forEach(e=>{e.textContent=e.textContent||""}),n.querySelectorAll('a[href*="ai_reasoning$"]').forEach(e=>{(e=>{const t=e.getAttribute("href")||"";e.setAttribute("href",t.replace(/^https?:\/\//,"")),e.removeAttribute("class"),e.textContent=e.textContent||""})(e)});const l=["upt","manual","ins","del","preserved"];function o(e,t,r=Boolean(e.closest("td, th"))){const n=e.cloneNode(!0),i=new Map;n.querySelectorAll(l.join(",")).forEach(e=>{if(e===n)return;const l=`%%NESTED${i.size}%%`;i.set(l,o(e,t,r)),e.replaceWith(l)});const a=[];r&&n.querySelectorAll("br").forEach(e=>{const t=`ZXQTABLEBREAKTOKEN${a.length}QXZ`;a.push("<br>"),e.replaceWith(document.createTextNode(t))});let s=t.turndown(n.innerHTML);a.forEach((e,t)=>{s=s.replace(`ZXQTABLEBREAKTOKEN${t}QXZ`,e)}),i.forEach((e,t)=>{s=s.replace(t,e)});const c=Array.from(e.attributes).map(e=>`${e.name}="${e.value}"`).join(" "),d=e.tagName.toLowerCase();return c?`<${d} ${c}>${s}</${d}>`:`<${d}>${s}</${d}>`}n.querySelectorAll('a[href*="ai_reasoning$"]').forEach(e=>{const t=e.getAttribute("href")||"";e.setAttribute("href",t.replace(/^https?:\/\//,""))});const i=[];n.querySelectorAll("invisible").forEach((e,t)=>{const r=`ZXQINVISIBLETOKEN${t}QXZ`;i.push({html:e.outerHTML,placeholder:r}),e.replaceWith(n.createTextNode(r))});const a=[];["manual","upt"].forEach(e=>{n.querySelectorAll(e).forEach(e=>{const t=`ZXQREVIEWTOKEN${a.length}QXZ`;a.push({html:o(e,S),placeholder:t}),e.replaceWith(n.createTextNode(t))})});const s=[];n.querySelectorAll("p").forEach(e=>{if(e.closest("td, th"))return;if(!(""===e.textContent&&Array.from(e.childNodes).every(e=>"BR"===e.nodeName||e.nodeType===Node.TEXT_NODE&&""===e.textContent)))return;const t=`%%BLANKLINE${s.length}%%`;s.push(t),e.textContent=t}),n.querySelectorAll("table > colgroup").forEach(e=>{e.remove()});let c=S.turndown(n.body.innerHTML);s.forEach(e=>{c=c.replace(new RegExp(`\\n*${e}\\n*`,"g"),"\n\n")});for(let e=a.length-1;e>=0;e--){const{html:t,placeholder:r}=a[e];c=c.replace(r,t)}i.forEach(({html:e,placeholder:t})=>{c=c.replace(t,e)}),c=c.replace(/\*{4}([^*]+)\*{4}/g,"**$1**"),c=c.replace(/\s+class="PlaygroundEditorTheme__[^"]*"/g,""),c=c.replace(/<span\s+style="white-space:\s*pre-wrap;?">([\s\S]*?)<\/span>/g,"$1"),c=c.replace(/\s+style="white-space:\s*pre-wrap;?"/g,""),c=c.replace(/<b>\s*<strong>([\s\S]*?)<\/strong>\s*<\/b>/g,"<strong>$1</strong>"),c=c.replace(/<code([^>]*)>\s*<span[^>]*>([\s\S]*?)<\/span>\s*<\/code>/g,"<code$1>$2</code>");if(["upt","manual","del","ins","preserved"].forEach(e=>{c=g(c,e)}),c=m(c,["manual","upt"]),c=((e,t)=>{const r=Array.from(e.matchAll(new RegExp(k.source,"gi")));let n=t;return r.forEach(e=>{const[,t,r,l]=e,o=O(r);if(!o)return;const i=o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),a=new RegExp(String.raw`<${t}\b(?=(?:[^>"']|"[^"]*"|'[^']*')*\bid\s*=\s*(?:"${i}"|'${i}'))((?:[^>"']|"[^"]*"|'[^']*')*)>([\s\S]*?)<\/${t}\s*>`,"i");n=n.replace(a,(t,r,n)=>W(l)===W(n)?e[0]:t)}),n})(F.current,c),F.current.includes("--\x3e")&&(c=c.replace(/-->/gi,"--\x3e")),c=f(F.current,c),c=v(F.current,c),c=x(F.current,c),c=((e,t)=>{const r=e.split("\n"),n=w(e,t).split("\n"),l=L(r);return L(n).forEach((e,t)=>{const o=l[t];if(!o)return;const i=o.length===e.length?e.length:Math.min(2,o.length,e.length);e.slice(0,i).forEach(({lineIndex:e,row:t},l)=>{const i=o[l];if(I(i.row)&&I(t))return void(n[e]=r[i.lineIndex]);const a=M(i.row,t);null!==a&&(n[e]=a)})}),n.join("\n")})(F.current,c),c=E(F.current,c),c=y(F.current,c),c=A(F.current,c),r.has(b))return G.current=F.current,void(J.current=!1);J.current&&(F.current=c,J.current=!1),G.current=c,((e,t)=>{p(e,t)})("prompt",c)})},toolbarConfig:a,editorRef:Q,mode:B,initialString:{type:Z.type,value:Z.value},dynamicHeight:U,onBlur:$,doNotShowBorderInViewMode:R||!1,onEditBlocked:j})]})});X.displayName="RichTextEditor";export{X as default};
|
|
1
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{forwardRef as r,useRef as n,useState as o,useEffect as a,useImperativeHandle as l}from"react";import{DEFAULT_TOOLBAR_CONFIG as i}from"./Editor/constants/editorConfig.js";import c from"./Editor/Editor.js";import{useRefStore as s}from"../../store/ref.context.js";import{$generateHtmlFromNodes as u}from"@lexical/html";import d from"turndown";import{tables as p}from"turndown-plugin-gfm";import{UnsavedChangesPopup as h}from"../UnsavedChangesPopup/UnsavedChangesPopup.js";import{mergeTagAcrossParagraphs as g,unescapeTagIds as m}from"../../../../utils/tagHelper.js";const f=new d({headingStyle:"atx",codeBlockStyle:"fenced"}),E=e=>e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");f.keep(["ins","del","mark"]),f.addRule("ai-reasoning-link-passthrough",{filter:e=>{var t,r;return"A"===e.nodeName&&null!==(r=null===(t=e.getAttribute("href"))||void 0===t?void 0:t.includes("ai_reasoning$"))&&void 0!==r&&r},replacement:(e,t)=>{const r=t,n=r.getAttribute("href")||"",o=r.textContent||"";return`<a href="${a=n,E(a).replace(/"/g,""")}">${E(o)}</a>`;var a}}),f.keep(e=>"SPAN"===e.nodeName&&e.hasAttribute("highlight-id")),f.addRule("md-table-passthrough",{filter:e=>"PRE"===e.nodeName&&"true"===e.getAttribute("data-md-table"),replacement:(e,t)=>t.textContent||""}),f.use(p);const v=e=>(e||"").replace(/\r\n/g,"\n").trim(),$=r(({type:r,value:d,handleUpdateState:p,onBlur:E,placeholder:$,minHeight:A,height:S,mode:w,doNotShowBorderInViewMode:y,onEditBlocked:b,onSaveUnsavedChanges:x,onDiscardUnsavedChanges:C,isSavingUnsavedChanges:N=!1},B)=>{const T=n(null),[q,L]=o({type:r,value:d}),[_,H]=o(0),[I,R]=o(!1),j=n(d),k=n(d),M=n(Boolean(d)),{contentRef:P,setContentRef:U}=s();a(()=>{L(e=>({...e,value:d})),j.current=d,k.current=d,M.current=Boolean(d),R(!1)},[d]),l(B,()=>({requestClose:()=>!("edit"===w&&v(j.current)!==v(k.current))||(R(!0),!1)}),[w]);return a(()=>{const e=()=>{P&&P.current&&H(P.current.clientHeight-60)};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[P]),e("div",{style:{position:"relative",width:"100%",height:S,minHeight:A},children:[I&&t(h,{isSaving:N,onSave:async()=>{await(null==x?void 0:x()),j.current=k.current,R(!1)},onDiscard:()=>{k.current=j.current,null==C||C(),R(!1)}}),t(c,{minHeight:A,height:S,placeholder:$||"Enter some text...",onChange:(e,t)=>{e.read(()=>{const e=u(t,null),r=(new DOMParser).parseFromString(e,"text/html");r.querySelectorAll("span").forEach(e=>{const t=e.getAttribute("style")||"";t.includes("background-color")&&t.includes("rgb(219, 234, 254)")&&e.setAttribute("data-review","insert"),t.includes("text-decoration")&&t.includes("line-through")&&e.setAttribute("data-review","delete")}),r.querySelectorAll("strong code").forEach(e=>{const t=e.parentElement;t&&t.replaceChild(document.createTextNode(e.textContent||""),e)}),r.querySelectorAll("code strong").forEach(e=>{const t=e.parentElement;t&&t.replaceChild(document.createTextNode(e.textContent||""),e)}),r.querySelectorAll('a[href*="ai_reasoning$"]').forEach(e=>{(e=>{const t=e.getAttribute("href")||"";e.setAttribute("href",t.replace(/^https?:\/\//,"")),e.removeAttribute("class"),e.textContent=e.textContent||""})(e)});const n=["upt","manual","ins","del","preserved"];function o(e,t){const r=e.cloneNode(!0),a=new Map;r.querySelectorAll(n.join(",")).forEach(e=>{if(e===r)return;const n=`%%NESTED${a.size}%%`;a.set(n,o(e,t)),e.replaceWith(n)});let l=t.turndown(r.innerHTML);a.forEach((e,t)=>{l=l.replace(t,e)});const i=Array.from(e.attributes).map(e=>`${e.name}="${e.value}"`).join(" "),c=e.tagName.toLowerCase();return i?`<${c} ${i}>${l}</${c}>`:`<${c}>${l}</${c}>`}r.querySelectorAll('a[href*="ai_reasoning$"]').forEach(e=>{const t=e.getAttribute("href")||"";e.setAttribute("href",t.replace(/^https?:\/\//,""))});const a=[];r.querySelectorAll("invisible").forEach((e,t)=>{a.push(e.outerHTML),e.replaceWith(r.createTextNode(`%%INVISIBLE_${t}%%`))});const l=[];["manual","upt"].forEach(e=>{r.querySelectorAll(e).forEach((e,t)=>{l.push(o(e,f)),e.replaceWith(r.createTextNode(`%%REVIEW_${l.length-1}%%`))})});const i=[];r.querySelectorAll("table").forEach((e,t)=>{i.push(e.outerHTML);const n=r.createElement("p");n.textContent=`%%TABLE_${t}%%`,e.replaceWith(n)});let c=f.turndown(r.body.innerHTML);for(let e=l.length-1;e>=0;e--)c=c.replace(`%%REVIEW\\_${e}%%`,` ${l[e]} `);a.forEach((e,t)=>{c=c.replace(new RegExp(`%%INVISIBLE\\\\*_${t}%%`,"g"),` ${e} `)}),i.forEach((e,t)=>{c=c.replace(`%%TABLE\\_${t}%%`,`\n\n${e}\n\n`)}),c=c.replace(/\*{4}([^*]+)\*{4}/g,"**$1**"),c=c.replace(/\s+class="PlaygroundEditorTheme__[^"]*"/g,""),c=c.replace(/<span\s+style="white-space:\s*pre-wrap;?">([\s\S]*?)<\/span>/g,"$1"),c=c.replace(/\s+style="white-space:\s*pre-wrap;?"/g,""),c=c.replace(/<b>\s*<strong>([\s\S]*?)<\/strong>\s*<\/b>/g,"<strong>$1</strong>");["upt","manual","del","ins","preserved"].forEach(e=>{c=g(c,e)}),c=m(c,["manual","upt"]),M.current&&(j.current=c,M.current=!1),k.current=c,((e,t)=>{p(e,t)})("prompt",c)})},toolbarConfig:i,editorRef:T,mode:w,initialString:{type:q.type,value:q.value},dynamicHeight:_,onBlur:E,doNotShowBorderInViewMode:y||!1,onEditBlocked:b})]})});$.displayName="RichTextEditor";export{$ as default};
|
|
2
2
|
//# sourceMappingURL=RichTextEditor.js.map
|
package/dist/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CitationAnchor.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as i,jsx as o,Fragment as n}from"react/jsx-runtime";import{ChevronDown as l,ChevronUp as t,Maximize2 as e,X as r,ExternalLink as a}from"lucide-react";import{useState as d,useMemo as u,useEffect as c}from"react";import s from"./ResizableSplitPane.js";import{DefaultFullScreenCloseIcon as v,DefaultFullScreenIcon as p}from"../icons/PdfViewerIcons.js";import{CitationType as g,GptWebCitation as h,PdfViewer as m}from"@e-llm-studio/citation";import x from"react-markdown";import f from"rehype-raw";import{Box as b}from"@mui/material";import{useRequirementAI as y}from"../../RequirementAIWrapper/RequirementAIWrapper.js";import{getHrefQueryParam as C,guidelineCitationTypes as _}from"../../../utils/helpers.js";const w=i=>{if(i)try{const o=new URL(i).hostname.replace(/^www\./i,""),n=o.split(".")[0];return n?n.charAt(0).toUpperCase()+n.slice(1):o}catch(i){return}},F=(i,o)=>{const n=((i,o)=>(null==i?void 0:i.payloadCitationId)||(null==o?void 0:o.payloadCitationId)||(null==o?void 0:o.citation_uuid)||"")(i,o)||("function"==typeof(null===(l=globalThis.crypto)||void 0===l?void 0:l.randomUUID)?globalThis.crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,i=>{const o=Math.floor(16*Math.random());return("x"===i?o:o%4+8).toString(16)}));var l;return i&&"object"==typeof i&&(i.payloadCitationId=n),o&&"object"==typeof o&&(o.payloadCitationId=n,o.citation_uuid||(o.citation_uuid=n)),n},T=({href:v,metaData:p,citationTitle:T,isFullscreen:I,secondaryCitation:P})=>{var D,U,k,W,j,S,R,z,A,B,E,G,N,M,L,H;const O=u(()=>{var i;return null===(i=(Array.isArray(null==p?void 0:p.citations)?p.citations:[]).find(i=>`pdf_citation$${i.id}`===v))||void 0===i?void 0:i.data},[v,null==p?void 0:p.citations]),$=(null==p?void 0:p.guidelinesData)||"",V=u(()=>{const i=null==P?void 0:P.phraseToHighlight;if(!i)return $;const o=$.toLowerCase().indexOf(i.toLowerCase());return-1===o?$:[$.slice(0,o),'<mark style="background-color: #FEF08A; padding: 0 2px;">',$.slice(o,o+i.length),"</mark>",$.slice(o+i.length)].join("")},[$,null==P?void 0:P.phraseToHighlight]),q=u(()=>{var i;const o=Array.isArray(null==p?void 0:p.gptCitations)?p.gptCitations:[],n=((i="")=>{if(!i||"string"!=typeof i||!i.trim())return"";const o=i.match(/gpt_citation\$(\d+)/i);return o&&o.length>=2?o[1]:""})(null==P?void 0:P.href);if(!n)return null;const l=o.find(i=>String(null==i?void 0:i.id)===n),t=(null===(i=null==l?void 0:l.data)||void 0===i?void 0:i.extraMetaData)||{},e=(i=>Object.keys(i||{}).sort((i,o)=>Number(i)-Number(o)))(t),r=e[Number((null==P?void 0:P.occurrenceIndex)||0)]||e[0];return r?t[r]:null},[null==p?void 0:p.gptCitations,null==P?void 0:P.href,null==P?void 0:P.occurrenceIndex]),J=(null===(W=null===(k=null===(U=null===(D=null==q?void 0:q.aiReasoningCitation)||void 0===D?void 0:D.gpt_citation)||void 0===U?void 0:U[0])||void 0===k?void 0:k.customMetaData)||void 0===W?void 0:W.value)||{},K=(null===(R=null===(S=null===(j=null==q?void 0:q.aiReasoningCitation)||void 0===j?void 0:j.gpt_citation)||void 0===S?void 0:S[0])||void 0===R?void 0:R.customMetaData)||{},Q=u(()=>F(q,J),[J,q]),[X,Y]=d(),[Z,ii]=d("pending"),[oi,ni]=d(!0),{apiCachingConfig:li,citationConfig:ti}=y(),{getGptWebCitation:ei,gptWebCitationPartialPayload:ri}=li||{},ai=(null===(z=null==ti?void 0:ti.gptWeb)||void 0===z?void 0:z.displayMode)||g.GPT_WEB,di=null===(A=null==P?void 0:P.href)||void 0===A?void 0:A.includes("gpt_citation"),ui=(null==J?void 0:J.citationUrl)&&ei?ai:g.GPT,ci=u(()=>({...ri,citationId:Q,citationUrl:null==J?void 0:J.citationUrl,content:(null==q?void 0:q.Reasoning)||(null==J?void 0:J.text),citationType:null==J?void 0:J.citationType,citationNumber:Number((null==K?void 0:K.citation_number)||0)}),[ri,Q,null==K?void 0:K.citation_number,null==J?void 0:J.citationType,null==J?void 0:J.citationUrl,null==J?void 0:J.text,null==q?void 0:q.Reasoning]),si=u(()=>({item:{confidence_score:Number((null==q?void 0:q.Confidence_score)||0),text:(null==J?void 0:J.paraphrase)||(null==P?void 0:P.title)||"Web citation reasoning",dataSource:(null==J?void 0:J.text)||(null==q?void 0:q.Reasoning)||"",paraphrase:(null==J?void 0:J.paraphrase)||""},headerTitle:(null==J?void 0:J.label)||"GPT Web Citation",index:Number((null==K?void 0:K.citation_number)||1)-1,iconsConfig:{ChevronDownIcon:l,ChevronUpIcon:t,MaximizeIcon:e,CloseIcon:r}}),[null==P?void 0:P.title,null==K?void 0:K.citation_number,null==J?void 0:J.label,null==J?void 0:J.paraphrase,null==J?void 0:J.text,null==q?void 0:q.Confidence_score,null==q?void 0:q.Reasoning]);if(c(()=>{let i=!0;return(async()=>{var o,n;if(di&&(null==J?void 0:J.citationUrl)&&ui!==g.GPT&&(ui!==g.GPT_WEB||oi))if(ei){ii("pending");try{const l=await ei(ci);if(!i)return;Y(null!==(n=null!==(o=null==l?void 0:l.data)&&void 0!==o?o:null==l?void 0:l.responseData)&&void 0!==n?n:l),ii("success")}catch(o){if(!i)return;ii("error"),console.error("Failed to load GPT web citation",o)}}else ii("error")})(),()=>{i=!1}},[ei,ui,ci,di,null==J?void 0:J.citationUrl,oi]),!O)return null;const vi=(null===(B=null==p?void 0:p.docData)||void 0===B?void 0:B.documents)||{},pi=(null===(E=null==p?void 0:p.docData)||void 0===E?void 0:E.input_index_map)||{},gi=Object.values(pi).find(i=>{const o=null==vi?void 0:vi[i];return(null==O?void 0:O[i])&&("application/pdf"===(null==o?void 0:o.mime_type)||"base"===(null==o?void 0:o.role))}),hi=Object.keys(O).find(i=>{const o=null==vi?void 0:vi[i];return"application/pdf"===(null==o?void 0:o.mime_type)||"base"===(null==o?void 0:o.role)})||Object.keys(O)[0],mi=gi||hi||(null==pi?void 0:pi[0]),xi=Object.values(pi).find(i=>i!==mi),fi=mi?vi[mi]:null,bi=xi?vi[xi]:null,yi=mi?O[mi]:null,Ci=xi?O[xi]:null,_i=(null===(G=null==P?void 0:P.type)||void 0===G?void 0:G.toLowerCase())||"",wi=C(null==P?void 0:P.href,"citation_type").toLowerCase(),Fi=_.includes(_i)||_.includes(wi)||Boolean(null==P?void 0:P.phraseToHighlight),Ti=Boolean(q&&((null==J?void 0:J.citationUrl)||(null==J?void 0:J.text)||(null==q?void 0:q.Reasoning))),Ii=Boolean(di&&Ti),Pi=Boolean(Fi&&$),Di=P&&(Fi?Pi:Ii)?i("div",{style:{height:"100%",overflow:"auto",padding:"16px",boxSizing:"border-box",backgroundColor:"#FFFFFF",color:"#101828",fontFamily:'"Inter", sans-serif',fontSize:"13px",lineHeight:1.6},children:[o("div",{style:{fontWeight:700,marginBottom:"8px"},children:Fi?"Guideline Citation":"Web/GPT Citation"}),Fi?o(n,{children:o(b,{sx:{padding:"0px 12px",backgroundColor:"#FFFFFF",overflow:"visible"},children:o(x,{rehypePlugins:[f],children:V})})}):di?o(h,{gptCitation:si,defaultCitationUrl:(null==J?void 0:J.citationUrl)||"",citationType:ui,webCitationData:X,sourceLabel:`Source: Web Citation > ${(null==J?void 0:J.paraphrase)||(null==J?void 0:J.label)||"Web Citation"}`,learnedFrom:w(null==J?void 0:J.citationUrl),showWebCitation:oi,webCitationStatus:Z,onGenerateWebCitation:()=>ni(!0),onToggleCitationView:()=>ni(i=>!i),showExpandImageButton:!0,showGptMaximizeButton:!0,iconsConfig:{MaximizeIcon:e,ExternalLinkIcon:a},isFixedHeight:!1}):o("div",{children:"No secondary citation preview available."})]}):null;if(["Contract","clause"].includes(T)){const i=yi?o(m,{pdfName:null==fi?void 0:fi.title,pdfUrl:null==fi?void 0:fi.signed_url,highlightText:[null!==(N=null==yi?void 0:yi.highlighted_text)&&void 0!==N?N:""],highlightPages:{1:null===(M=null==yi?void 0:yi.custom_metadata)||void 0===M?void 0:M.pdf_start_page_number},jumpToPageValue:1,highlightCordinatePages:[],useCoordinates:!1}):null,n=Di||(Ci?o(m,{pdfName:null==bi?void 0:bi.title,pdfUrl:null==bi?void 0:bi.signed_url,jumpToPageValue:1,highlightText:[null!==(L=null==Ci?void 0:Ci.highlighted_text)&&void 0!==L?L:""],highlightPages:{1:null===(H=null==Ci?void 0:Ci.custom_metadata)||void 0===H?void 0:H.pdf_start_page_number},highlightCordinatePages:[],useCoordinates:!1}):null);return o("div",yi||Ci||Di?{style:{height:"100%",display:"flex",flexDirection:"column"},children:o(s,{leftComponent:i,rightComponent:n,isFullscreen:I})}:{children:"Missing PDF Citation. Please try again later"})}return o("div",{children:"No Citation Found. Please try again later"})},I=({href:n,children:e,metaData:r,secondaryCitation:a,chevronUpComponent:c=null,chevronDownComponent:s=null,customStyle:g={},defaultState:h=!1})=>{var m,x,f;const[b,y]=d(h),[C,_]=d(!1),w="string"==typeof e&&(null===(m=null==e?void 0:e.split("\n"))||void 0===m?void 0:m.length)>1?e.split("\n").join(" "):e,F="string"==typeof e?e:e[0],I=null!=c?c:(i=>{var n,l;return o(t,{size:null!==(n=null==i?void 0:i.fontSize)&&void 0!==n?n:16,color:null!==(l=null==i?void 0:i.color)&&void 0!==l?l:"rgb(214, 51, 132)"})})(null!==(x=null==g?void 0:g.arrow)&&void 0!==x?x:{}),P=null!=s?s:(i=>{var n,t;return o(l,{size:null!==(n=null==i?void 0:i.fontSize)&&void 0!==n?n:16,color:null!==(t=null==i?void 0:i.color)&&void 0!==t?t:"rgb(214, 51, 132)"})})(null!==(f=null==g?void 0:g.arrow)&&void 0!==f?f:{}),D=u(()=>(Array.isArray(null==r?void 0:r.citations)?r.citations:[]).some(i=>`pdf_citation$${i.id}`===n),[n,null==r?void 0:r.citations]);return["contract","clause"].includes(F.toLowerCase())&&D?i("span",{style:{display:"inline",...g.relativeWrapper||{}},children:[o("div",{style:{display:"inline",marginTop:0,...g.citationButtonWrapper||{}},children:i("button",{type:"button",onClick:()=>y(i=>!i),style:{display:"inline-flex",alignItems:"center",gap:"3px",fontFamily:'"Inter", sans-serif',backgroundColor:"transparent",padding:0,margin:0,fontSize:"13px",borderRadius:9999,cursor:"pointer",fontWeight:700,color:"rgb(214, 51, 132)",border:"none",textDecoration:"none",wordBreak:"break-word",whiteSpace:"normal",...g.citationButton||{}},children:[o("span",{children:w}),o("span",{style:{display:"flex",alignItems:"center"},children:b?I:P})]})}),b&&i("div",{style:C?{position:"fixed",inset:0,zIndex:999999,backgroundColor:"#FAFAFA",display:"flex",flexDirection:"column"}:{boxSizing:"border-box",border:"1px solid #E4E7EC",borderRadius:"8px",overflow:"hidden",marginTop:"8px",display:"flex",flexDirection:"column",width:"100%"},children:[o("div",{style:{display:"flex",justifyContent:"flex-end",padding:"6px 10px",borderBottom:"1px solid #E4E7EC",backgroundColor:"#FFFFFF",flexShrink:0},children:o("button",{onClick:()=>{_(i=>!i)},style:{background:"none",border:"none",cursor:"pointer",padding:"4px",borderRadius:"6px",color:"#475467",marginRight:"9px"},children:o(C?v:p,{})})}),o("div",{style:{flex:1,minHeight:0,height:"100%",overflow:"hidden"},children:o(T,{href:n,children:e,metaData:r,citationTitle:F,isFullscreen:C,secondaryCitation:a})})]})]}):null};export{I as default};
|
|
1
|
+
import{jsxs as i,jsx as o,Fragment as n}from"react/jsx-runtime";import{ChevronDown as l,ChevronUp as t,Maximize2 as e,X as a,ExternalLink as r}from"lucide-react";import{useState as d,useMemo as u,useEffect as c}from"react";import s from"./ResizableSplitPane.js";import{DefaultFullScreenCloseIcon as v,DefaultFullScreenIcon as p}from"../icons/PdfViewerIcons.js";import{CitationType as g,GptWebCitation as h,PdfViewer as m}from"@e-llm-studio/citation";import x from"react-markdown";import f from"rehype-raw";import{Box as b}from"@mui/material";import{useRequirementAI as y}from"../../RequirementAIWrapper/RequirementAIWrapper.js";const C=i=>{if(i)try{const o=new URL(i).hostname.replace(/^www\./i,""),n=o.split(".")[0];return n?n.charAt(0).toUpperCase()+n.slice(1):o}catch(i){return}},_=(i,o)=>{const n=((i,o)=>(null==i?void 0:i.payloadCitationId)||(null==o?void 0:o.payloadCitationId)||(null==o?void 0:o.citation_uuid)||"")(i,o)||("function"==typeof(null===(l=globalThis.crypto)||void 0===l?void 0:l.randomUUID)?globalThis.crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,i=>{const o=Math.floor(16*Math.random());return("x"===i?o:o%4+8).toString(16)}));var l;return i&&"object"==typeof i&&(i.payloadCitationId=n),o&&"object"==typeof o&&(o.payloadCitationId=n,o.citation_uuid||(o.citation_uuid=n)),n},F=({href:v,metaData:p,citationTitle:F,isFullscreen:w,secondaryCitation:T})=>{var I,D,k,P,S,U,W,j,R,z,A,E,N,B,G,M,L,H,O,$,V;const q=u(()=>{var i;return null===(i=(Array.isArray(null==p?void 0:p.citations)?p.citations:[]).find(i=>`pdf_citation$${i.id}`===v))||void 0===i?void 0:i.data},[v,null==p?void 0:p.citations]),J=null!==(S=null===(P=null===(k=null===(D=null===(I=null==p?void 0:p.guidelinesData)||void 0===I?void 0:I.artifactData)||void 0===D?void 0:D.userStorySnapshot)||void 0===k?void 0:k[0])||void 0===P?void 0:P.value)&&void 0!==S?S:"",K=u(()=>{const i=null==T?void 0:T.phraseToHighlight;if(!i)return J;const o=J.toLowerCase().indexOf(i.toLowerCase());return-1===o?J:[J.slice(0,o),'<mark style="background-color: #FEF08A; padding: 0 2px;">',J.slice(o,o+i.length),"</mark>",J.slice(o+i.length)].join("")},[J,null==T?void 0:T.phraseToHighlight]),Q=u(()=>{var i;const o=Array.isArray(null==p?void 0:p.gptCitations)?p.gptCitations:[],n=((i="")=>{const o=i.match(/gpt_citation\$(\d+)/i);return(null==o?void 0:o[1])||""})(null==T?void 0:T.href);if(!n)return null;const l=o.find(i=>String(null==i?void 0:i.id)===n),t=(null===(i=null==l?void 0:l.data)||void 0===i?void 0:i.extraMetaData)||{},e=(i=>Object.keys(i||{}).sort((i,o)=>Number(i)-Number(o)))(t),a=e[Number((null==T?void 0:T.occurrenceIndex)||0)]||e[0];return a?t[a]:null},[null==p?void 0:p.gptCitations,null==T?void 0:T.href,null==T?void 0:T.occurrenceIndex]),X=(null===(R=null===(j=null===(W=null===(U=null==Q?void 0:Q.aiReasoningCitation)||void 0===U?void 0:U.gpt_citation)||void 0===W?void 0:W[0])||void 0===j?void 0:j.customMetaData)||void 0===R?void 0:R.value)||{},Y=(null===(E=null===(A=null===(z=null==Q?void 0:Q.aiReasoningCitation)||void 0===z?void 0:z.gpt_citation)||void 0===A?void 0:A[0])||void 0===E?void 0:E.customMetaData)||{},Z=u(()=>_(Q,X),[X,Q]),[ii,oi]=d(),[ni,li]=d("pending"),[ti,ei]=d(!0),{apiCachingConfig:ai,citationConfig:ri}=y(),{getGptWebCitation:di,gptWebCitationPartialPayload:ui}=ai||{},ci=(null===(N=null==ri?void 0:ri.gptWeb)||void 0===N?void 0:N.displayMode)||g.GPT_WEB,si=null===(B=null==T?void 0:T.href)||void 0===B?void 0:B.includes("gpt_citation"),vi=u(()=>({...ui,citationId:Z,citationUrl:null==X?void 0:X.citationUrl,content:(null==Q?void 0:Q.Reasoning)||(null==X?void 0:X.text),citationType:null==X?void 0:X.citationType,citatioNumber:Number((null==Y?void 0:Y.citation_number)||0)}),[ui,Z,null==Y?void 0:Y.citation_number,null==X?void 0:X.citationType,null==X?void 0:X.citationUrl,null==X?void 0:X.text,null==Q?void 0:Q.Reasoning]),pi=u(()=>({item:{confidence_score:Number((null==Q?void 0:Q.Confidence_score)||0),text:(null==X?void 0:X.paraphrase)||(null==T?void 0:T.title)||"Web citation reasoning",dataSource:(null==X?void 0:X.text)||(null==Q?void 0:Q.Reasoning)||"",paraphrase:(null==X?void 0:X.paraphrase)||""},headerTitle:(null==X?void 0:X.label)||"GPT Web Citation",index:Number((null==Y?void 0:Y.citation_number)||1)-1,iconsConfig:{ChevronDownIcon:l,ChevronUpIcon:t,MaximizeIcon:e,CloseIcon:a}}),[null==T?void 0:T.title,null==Y?void 0:Y.citation_number,null==X?void 0:X.label,null==X?void 0:X.paraphrase,null==X?void 0:X.text,null==Q?void 0:Q.Confidence_score,null==Q?void 0:Q.Reasoning]);if(c(()=>{let i=!0;return(async()=>{var o,n;if(si&&(null==X?void 0:X.citationUrl)&&ci!==g.GPT&&(ci!==g.GPT_WEB||ti))if(di){li("pending");try{const l=await di(vi);if(!i)return;oi(null!==(n=null!==(o=null==l?void 0:l.data)&&void 0!==o?o:null==l?void 0:l.responseData)&&void 0!==n?n:l),li("success")}catch(o){if(!i)return;li("error"),console.error("Failed to load GPT web citation",o)}}else li("error")})(),()=>{i=!1}},[di,vi,ci,si,null==X?void 0:X.citationUrl,ti]),!q)return null;const gi=(null===(G=null==p?void 0:p.docData)||void 0===G?void 0:G.documents)||{},hi=(null===(M=null==p?void 0:p.docData)||void 0===M?void 0:M.input_index_map)||{},mi=Object.values(hi).find(i=>{const o=null==gi?void 0:gi[i];return(null==q?void 0:q[i])&&("application/pdf"===(null==o?void 0:o.mime_type)||"base"===(null==o?void 0:o.role))}),xi=Object.keys(q).find(i=>{const o=null==gi?void 0:gi[i];return"application/pdf"===(null==o?void 0:o.mime_type)||"base"===(null==o?void 0:o.role)})||Object.keys(q)[0],fi=mi||xi||(null==hi?void 0:hi[0]),bi=Object.values(hi).find(i=>i!==fi),yi=fi?gi[fi]:null,Ci=bi?gi[bi]:null,_i=fi?q[fi]:null,Fi=bi?q[bi]:null,wi="rulebook_citation"===((null===(L=null==T?void 0:T.type)||void 0===L?void 0:L.toLowerCase())||"")||Boolean(null==T?void 0:T.phraseToHighlight),Ti=T?i("div",{style:{height:"100%",overflow:"auto",padding:"16px",boxSizing:"border-box",backgroundColor:"#FFFFFF",color:"#101828",fontFamily:'"Inter", sans-serif',fontSize:"13px",lineHeight:1.6},children:[o("div",{style:{fontWeight:700,marginBottom:"8px"},children:wi?"Guideline Citation":"Web/GPT Citation"}),wi?o(n,{children:o(b,{sx:{padding:"0px 12px",backgroundColor:"#FFFFFF",overflow:"visible"},children:o(x,{rehypePlugins:[f],children:K})})}):si?o(h,{gptCitation:pi,defaultCitationUrl:(null==X?void 0:X.citationUrl)||"",citationType:ci,webCitationData:ii,sourceLabel:`Source: Web Citation > ${(null==X?void 0:X.paraphrase)||(null==X?void 0:X.label)||"Web Citation"}`,learnedFrom:C(null==X?void 0:X.citationUrl),showWebCitation:ti,webCitationStatus:ni,onGenerateWebCitation:()=>ei(!0),onToggleCitationView:()=>ei(i=>!i),showExpandImageButton:!0,showGptMaximizeButton:!0,iconsConfig:{MaximizeIcon:e,ExternalLinkIcon:r},isFixedHeight:!1}):o("div",{children:"No secondary citation preview available."})]}):null;if(["Contract","clause"].includes(F)){const i=_i?o(m,{pdfName:null==yi?void 0:yi.title,pdfUrl:null==yi?void 0:yi.signed_url,highlightText:[null!==(H=null==_i?void 0:_i.highlighted_text)&&void 0!==H?H:""],highlightPages:{1:null===(O=null==_i?void 0:_i.custom_metadata)||void 0===O?void 0:O.pdf_start_page_number},jumpToPageValue:1,highlightCordinatePages:[],useCoordinates:!1}):null,n=Ti||(Fi?o(m,{pdfName:null==Ci?void 0:Ci.title,pdfUrl:null==Ci?void 0:Ci.signed_url,jumpToPageValue:1,highlightText:[null!==($=null==Fi?void 0:Fi.highlighted_text)&&void 0!==$?$:""],highlightPages:{1:null===(V=null==Fi?void 0:Fi.custom_metadata)||void 0===V?void 0:V.pdf_start_page_number},highlightCordinatePages:[],useCoordinates:!1}):null);return o("div",_i||Fi||Ti?{style:{height:"100%",display:"flex",flexDirection:"column"},children:o(s,{leftComponent:i,rightComponent:n,isFullscreen:w})}:{children:"Missing PDF Citation. Please try again later"})}return o("div",{children:"No Citation Found. Please try again later"})},w=({href:n,children:e,metaData:a,secondaryCitation:r,chevronUpComponent:c=null,chevronDownComponent:s=null,customStyle:g={},defaultState:h=!1})=>{var m,x,f;const[b,y]=d(h),[C,_]=d(!1),w="string"==typeof e&&(null===(m=null==e?void 0:e.split("\n"))||void 0===m?void 0:m.length)>1?e.split("\n").join(" "):e,T="string"==typeof e?e:e[0],I=null!=c?c:(i=>{var n,l;return o(t,{size:null!==(n=null==i?void 0:i.fontSize)&&void 0!==n?n:16,color:null!==(l=null==i?void 0:i.color)&&void 0!==l?l:"rgb(214, 51, 132)"})})(null!==(x=null==g?void 0:g.arrow)&&void 0!==x?x:{}),D=null!=s?s:(i=>{var n,t;return o(l,{size:null!==(n=null==i?void 0:i.fontSize)&&void 0!==n?n:16,color:null!==(t=null==i?void 0:i.color)&&void 0!==t?t:"rgb(214, 51, 132)"})})(null!==(f=null==g?void 0:g.arrow)&&void 0!==f?f:{}),k=u(()=>(Array.isArray(null==a?void 0:a.citations)?a.citations:[]).some(i=>`pdf_citation$${i.id}`===n),[n,null==a?void 0:a.citations]);return["contract","clause"].includes(T.toLowerCase())&&k?i("span",{style:{display:"inline",...g.relativeWrapper||{}},children:[o("div",{style:{display:"inline",marginTop:0,...g.citationButtonWrapper||{}},children:i("button",{type:"button",onClick:()=>y(i=>!i),style:{display:"inline-flex",alignItems:"center",gap:"3px",fontFamily:'"Inter", sans-serif',backgroundColor:"transparent",padding:0,margin:0,fontSize:"13px",borderRadius:9999,cursor:"pointer",fontWeight:700,color:"rgb(214, 51, 132)",border:"none",textDecoration:"none",wordBreak:"break-word",whiteSpace:"normal",...g.citationButton||{}},children:[o("span",{children:w}),o("span",{style:{display:"flex",alignItems:"center"},children:b?I:D})]})}),b&&i("div",{style:C?{position:"fixed",inset:0,zIndex:999999,backgroundColor:"#FAFAFA",display:"flex",flexDirection:"column"}:{boxSizing:"border-box",border:"1px solid #E4E7EC",borderRadius:"8px",overflow:"hidden",marginTop:"8px",display:"flex",flexDirection:"column",width:"100%"},children:[o("div",{style:{display:"flex",justifyContent:"flex-end",padding:"6px 10px",borderBottom:"1px solid #E4E7EC",backgroundColor:"#FFFFFF",flexShrink:0},children:o("button",{onClick:()=>{_(i=>!i)},style:{background:"none",border:"none",cursor:"pointer",padding:"4px",borderRadius:"6px",color:"#475467",marginRight:"9px"},children:o(C?v:p,{})})}),o("div",{style:{flex:1,minHeight:0,height:"100%",overflow:"hidden"},children:o(F,{href:n,children:e,metaData:a,citationTitle:T,isFullscreen:C,secondaryCitation:r})})]})]}):null};export{w as default};
|
|
2
2
|
//# sourceMappingURL=CitationAnchor.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as e,jsx as i,Fragment as t}from"react/jsx-runtime";import a,{memo as n,useMemo as c,useRef as r,useCallback as l}from"react";import o from"../Popups/PopupDefaults.js";import d from"react-markdown";import s from"rehype-raw";import m from"./CitationComponent.module.css.js";import{ChevronUp as u}from"lucide-react";import{ReactComponent as p}from"../icons/cognitiveBrain.svg.js";import{ReactComponent as h}from"../icons/aiMagic.svg.js";import v from"./CitationAnchor.js";import{AiReasonMarkdownWrapper as g}from"../../ai-reasoning/AiReasonMarkdownWrapper.js";import{resolveRedline as _}from"../../../../../service/redlineService.js";import{useRequirementAI as y}from"../../RequirementAIWrapper/RequirementAIWrapper.js";import f from"../cws/CwsEvent.js";import{guidelineCitationTypes as N,getHrefQueryParam as b}from"../../../utils/helpers.js";const x=(e="")=>e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">"),I=(e,i)=>{try{const t=e.match(new RegExp(`${i}=(["'])([\\s\\S]*?)\\1(?=\\s+[\\w:-]+=|\\s*$)`,"i"));return t&&t.length>=3&&t[2]||""}catch(e){return console.error("Regex matching failed in getAnchorAttribute",e),""}},C=(e,i)=>I(i,"type")||b(e,"citation_type")||(e.includes("gpt_citation")?"gpt_citation":""),D=(e,i)=>{let t=[];try{t=(e=>{const i=[],t=/<a\b/gi;let a;for(;null!==(a=t.exec(e));){const n=a.index,c=e.indexOf("</a>",t.lastIndex);if(-1===c)break;const r=e.slice(n+2,c),l=r.lastIndexOf(">");-1!==l?(i.push({fullMatch:e.slice(n,c+4),attributes:r.slice(0,l),label:r.slice(l+1),index:n}),t.lastIndex=c+4):t.lastIndex=c+4}return i})(e)}catch(i){return console.error("Failed to parse anchors in line",i),e}const a=t.find(e=>{return i=e.attributes,I(i,"href").startsWith("pdf_citation$");var i}),n=t.find(e=>(e=>{const i=I(e,"href"),t=C(i,e).toLowerCase();return i.includes("gpt_citation")||N.includes(t)||e.includes("phrase_to_highlight=")})(e.attributes));if(!a||!n)return e;const c=((e,i,t,a,n)=>{const c=I(t,"href"),r=C(c,t),l=I(t,"reason"),o=b(c,"phrase_to_highlight"),d=c.includes("gpt_citation")&&void 0!==n?` data-secondary-occurrence-index="${n}"`:"";return`<a${e} data-dual-citation="true" data-secondary-href="${x(c)}" data-secondary-type="${x(r)}" data-secondary-title="${x(a)}" data-secondary-reason="${x(l)}" data-secondary-phrase-to-highlight="${x(o)}"${d}>${i}</a>`})(a.attributes,a.label,n.attributes,n.label,I(n.attributes,"href").includes("gpt_citation")?i():void 0),r=(n.index>a.index?e.slice(a.index+a.fullMatch.length,n.index):e.slice(n.index+n.fullMatch.length,a.index)).trim()?n.label:"";return e.replace(a.fullMatch,c).replace(n.fullMatch,r)},R=(e,i)=>{var t,a;let n=i;try{n=i.replace(/-([a-z])/g,(e,i)=>i.toUpperCase())}catch(e){console.error("String replacement failed in getDataAttribute",e)}return null!==(a=null!==(t=null==e?void 0:e[i])&&void 0!==t?t:null==e?void 0:e[n])&&void 0!==a?a:""},A=({text:e,item:t})=>{const a=c(()=>(e=>{let i=0;const t=()=>i++;return e.split("\n").map(e=>D(e,t)).join("\n")})(e),[e]);return i(d,{rehypePlugins:[s],components:{ol:({children:e})=>i("ol",{className:m["md-ol"],children:e}),ul:({children:e})=>i("ul",{className:m["md-ul"],children:e}),li:({children:e})=>i("li",{className:m["md-li"],children:e}),a:({node:e,href:a,children:n})=>{const c=(null==e?void 0:e.properties)||{},r=R(c,"data-secondary-href");return i(v,{href:a,children:n,secondaryCitation:r?{href:r,title:R(c,"data-secondary-title"),type:R(c,"data-secondary-type"),reason:R(c,"data-secondary-reason"),phraseToHighlight:R(c,"data-secondary-phrase-to-highlight"),occurrenceIndex:Number(R(c,"data-secondary-occurrence-index")||0)}:void 0,metaData:{citations:t.citations,docData:t.docData,guidelinesData:t.guidelinesData,gptCitations:t.gptCitations}})}},children:a.replace(/<br\s*\/?>/gi,"\n")})},$=({text:e,markdownStyles:t,citationStyles:a,customIcons:n})=>i(g,{message:e.replace(/<br\s*\/?>/gi,"\n"),customStyles:t,citationStyles:a,customIcons:n}),k=(e,i)=>{return e.disableAllActions===i.disableAllActions&&(e.redlineId===i.redlineId&&(e.aiReasonId===i.aiReasonId&&(e.relevanceScore===i.relevanceScore&&(e.reason===i.reason&&(e.impact===i.impact&&(e.explaination===i.explaination&&(e.gap===i.gap&&(t=e.item,a=i.item,t===a||(t&&a?t.citations===a.citations&&t.guidelinesData===a.guidelinesData&&t.docData===a.docData&&(null===(n=t.docData)||void 0===n?void 0:n.input_index_map)===(null===(c=a.docData)||void 0===c?void 0:c.input_index_map)&&(null===(r=t.docData)||void 0===r?void 0:r.documents)===(null===(l=a.docData)||void 0===l?void 0:l.documents):t===a)))))))));var t,a,n,c,r,l},S=n(function({item:n,title:r="Cognitive Decisioning AI",relevanceScore:l=0,showRelevanceScore:d=!0,reason:s="No reasoning provided.",impact:v="No Impact provided.",explaination:g="No explaination provided.",gap:_="None",onClose:y=()=>{},showResolveBtns:f=!1,sections:N,leftIcon:b,scoreIcon:x,className:I,customStyles:C={},markdownStyles:D,citationStyles:R,customIcons:k,actions:S,disableAllActions:w=!1,actionBtnDisabledStyle:j={},onBackClick:T,isImpactNeeded:H=!0,cognitiveTitle:B="Cognitive Integrity",labels:M={},chatHistory:P,resolveRedlineAction:L}){const E=c(()=>{const e=Number(l);return Number.isNaN(e)?0:Math.max(0,Math.min(100,Math.round(e)))},[l]),q=c(()=>{const e=M&&M.noGapsText||"1. No gaps identified.";return(e=>{if(!e)return!0;const i=e.trim().toLowerCase();return"none"===i||"no gap"===i||"no gaps"===i||"n/a"===i})(_)?e:_},[_]),W=M&&M.impact||"Impact",F=M&&M.explanation||"Explaination",G=M&&M.decisionFactors||"Decision Making Factors",U=M&&M.gaps||"Gaps in Decision",O=M&&M.accept||"Accept",z=M&&M.reject||"Reject",J=M&&M.backAriaLabel||"Go back",K=S||[{id:"reject",label:z,onClick:()=>L("reject"),className:m["btn-reject"]},{id:"accept",label:O,onClick:()=>L("accept"),className:m["btn-accept"]}],Q=P&&P.length>0;return e("div",{className:`${m["cite-acc"]} ${I||""}`,style:{...o.CitationAccordionDefaults.container,...null==C?void 0:C.container},children:[T&&e("div",{className:m["cite-acc__backHeader"],children:[i("button",{type:"button",className:m["cite-acc__backBtn"],onClick:e=>{e.stopPropagation(),T&&T()},"aria-label":J,children:"‹"}),i("span",{className:m["cite-acc__backTitle"],children:B})]}),i("div",{className:m["cite-body"],children:N&&N.length>0?N.map(t=>!1===t.show?null:e("div",{className:`${m["cite-acc__explain-body"]} ${t.bodyClassName||""}`,children:[e("div",{className:m["cite-acc__innerHeader"],style:{...o.CitationAccordionDefaults.innerHeader,...null==C?void 0:C.innerHeader},children:[i("div",{className:m["cite-acc__innerHeaderLeft"],children:i("div",{children:i("div",{className:m["cite-acc__innerTitle"],children:t.title})})}),i("button",{type:"button",onClick:e=>{e.stopPropagation(),y&&y()},children:i(u,{})})]}),i("div",{className:`${m["cite-acc__innerBody"]} text-sm text-gray-600`,style:{...o.CitationAccordionDefaults.innerBody,...null==C?void 0:C.innerBody},children:"string"==typeof t.content?i(A,{text:t.content,item:t.item||n||{}}):t.content})]},t.id||t.title)):e(t,{children:[H&&e("div",{className:m["cite-acc__explain-body"],children:[e("div",{className:m["cite-acc__innerHeader"],children:[i("div",{className:m["cite-acc__innerHeaderLeft"],children:i("div",{children:i("div",{className:m["cite-acc__innerTitle"],children:W})})}),i("button",{type:"button",onClick:e=>{e.stopPropagation(),y&&y()},children:i(u,{})})]}),i("div",{className:`${m["cite-acc__innerBody"]} text-sm text-gray-600`,children:i(A,{text:v||"",item:n||{}})})]}),g&&"No explaination provided."!==g&&e(t,{children:[e("div",{className:m["cite-acc__explain-body"],children:[i("div",{className:m["cite-acc__innerHeader"],children:i("div",{className:m["cite-acc__innerHeaderLeft"],children:i("div",{children:i("div",{className:m["cite-acc__innerTitle"],children:F})})})}),i("div",{className:`${m["cite-acc__innerBody"]} text-sm text-gray-600`,children:i(A,{text:g||"",item:{}})})]}),i("div",{style:{borderTop:"1px solid #e5e7eb",margin:"12px 0"}}),f&&i("div",{className:m["cite-acc__btn-container"],children:K.map(e=>{const t=w||e.disabled;return i("button",{className:e.className,onClick:t?void 0:e.onClick,disabled:t,style:{...e.style,...t?{opacity:.5,cursor:"not-allowed",...j,...e.disabledStyle}:{}},children:e.label},e.id)})})]}),e("div",{className:m["cite-acc__header"],children:[e("div",{className:m["cite-acc__headerLeft"],children:[i("span",{className:m["cite-acc__titleIcon"],children:b?"function"==typeof b?a.createElement(b):b:i(p,{})}),i("div",{className:m["cite-acc__title"],children:r})]}),i("div",{className:m["cite-acc__headerRight"],children:d&&e("span",{className:m["cite-acc__scoreBadge"],children:[x?"function"==typeof x?a.createElement(x):x:i(h,{}),e("span",{className:m["cite-acc__scoreText"],children:[E,"%"]})]})})]}),e("div",{className:m["cite-acc__explain-body"],children:[i("div",{className:m["cite-acc__innerHeader"],children:i("div",{className:m["cite-acc__innerHeaderLeft"],children:i("div",{children:i("div",{className:m["cite-acc__innerTitle"],children:G})})})}),i("div",{className:`${m["cite-acc__innerBody"]} text-sm text-gray-600`,children:Q?i($,{text:s||"",markdownStyles:D,citationStyles:R,customIcons:k}):i(A,{text:s||"",item:n||{}})})]}),e("div",{className:`${m["cite-acc__explain-body"]} ${m["cite-acc__explain-body_border"]}`,children:[i("div",{className:m["cite-acc__innerHeader"],children:i("div",{className:m["cite-acc__innerHeaderLeft"],children:i("div",{children:i("div",{className:m["cite-acc__innerTitle"],children:U})})})}),i("div",{className:`${m["cite-acc__innerBody"]} text-sm text-gray-600`,children:Q?i($,{text:q||"",markdownStyles:D,citationStyles:R,customIcons:k}):i(A,{text:q||"",item:n||{}})})]})]})})]})},k);var w=n(function(e){const{redlineDcoumentId:t,redlineConfig:a,updateRedlineDataParent:n}=y(),c=r({redlineDcoumentId:t,redlineConfig:a,updateRedlineDataParent:n}),o=r({onActionTrigger:e.onActionTrigger,redlineId:e.redlineId,aiReasonId:e.aiReasonId});c.current={redlineDcoumentId:t,redlineConfig:a,updateRedlineDataParent:n},o.current={onActionTrigger:e.onActionTrigger,redlineId:e.redlineId,aiReasonId:e.aiReasonId};const d=l(async e=>{var i,n,r,l,d;const{redlineDcoumentId:s,redlineConfig:m,updateRedlineDataParent:u}=c.current,{onActionTrigger:p,redlineId:h,aiReasonId:v}=o.current;try{await(null==p?void 0:p({status:"loading",action:e,metadata:{redlineId:h,aiReasonId:v}}))}catch(e){}if(null==a?void 0:a.callResolveRedline)try{const{updated_reqai:c}=await _({documentId:s,userEmail:null==m?void 0:m.userEmail,userName:null==m?void 0:m.userName,redlineId:null!=h?h:"",action:e,baseApiUrl:null==m?void 0:m.baseApiUrl,redlineConfigId:null!==(i=null==m?void 0:m.redlineConfigId)&&void 0!==i?i:""},null!==(n=null==m?void 0:m.token)&&void 0!==n?n:"");await(null==u?void 0:u(c));const o=null===(d=null===(l=null===(r=null==c?void 0:c.artifactData)||void 0===r?void 0:r.userStorySnapshot)||void 0===l?void 0:l[0])||void 0===d?void 0:d.artifactId;"string"==typeof o&&o.trim()&&"string"==typeof t&&t.trim()&&"string"==typeof(null==a?void 0:a.userName)&&(null==a?void 0:a.userName.trim())?f.emit(`redline-edit:${t}:${o}`,{updatedBy:null==a?void 0:a.userName}):console.error("invalid cwsEvent name or payload"),null==p||p({status:"success",action:e,metadata:{redlineId:h,aiReasonId:v}})}catch(i){null==p||p({status:"failed",action:e,metadata:{redlineId:h,aiReasonId:v}})}},[]);return i(S,{...e,resolveRedlineAction:d})},k);export{w as default};
|
|
1
|
+
import{jsxs as e,jsx as i,Fragment as t}from"react/jsx-runtime";import a,{memo as n,useMemo as c,useRef as r,useCallback as l}from"react";import o from"../Popups/PopupDefaults.js";import d from"react-markdown";import s from"rehype-raw";import m from"./CitationComponent.module.css.js";import{ChevronUp as p}from"lucide-react";import{ReactComponent as u}from"../icons/cognitiveBrain.svg.js";import{ReactComponent as h}from"../icons/aiMagic.svg.js";import v from"./CitationAnchor.js";import{AiReasonMarkdownWrapper as _}from"../../ai-reasoning/AiReasonMarkdownWrapper.js";import{resolveRedline as g}from"../../../../../service/redlineService.js";import{useRequirementAI as y}from"../../RequirementAIWrapper/RequirementAIWrapper.js";import f from"../cws/CwsEvent.js";const N=(e="")=>e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">"),b=(e,i)=>{const t=e.match(new RegExp(`${i}=(["'])(.*?)\\1`,"i"));return(null==t?void 0:t[2])||""},x=(e,i)=>{const t=[...e.matchAll(/<a\b((?:[^>"']|"[^"]*"|'[^']*')*)>([\s\S]*?)<\/a>/gi)].map(e=>{var i;return{fullMatch:e[0],attributes:e[1],label:e[2],index:null!==(i=e.index)&&void 0!==i?i:0}}),a=t.find(e=>{return i=e.attributes,b(i,"href").startsWith("pdf_citation$");var i}),n=t.find(e=>{return i=e.attributes,b(i,"href").includes("gpt_citation")||i.includes("phrase_to_highlight=");var i});if(!a||!n)return e;const c=((e,i,t,a,n)=>{const c=b(t,"href"),r=b(t,"type")||(c.includes("gpt_citation")?"gpt_citation":""),l=b(t,"reason"),o=c.split("?")[1]||"",d=o&&new URLSearchParams(o).get("phrase_to_highlight")||"",s=c.includes("gpt_citation")&&void 0!==n?` data-secondary-occurrence-index="${n}"`:"";return`<a${e} data-dual-citation="true" data-secondary-href="${N(c)}" data-secondary-type="${N(r)}" data-secondary-title="${N(a)}" data-secondary-reason="${N(l)}" data-secondary-phrase-to-highlight="${N(d)}"${s}>${i}</a>`})(a.attributes,a.label,n.attributes,n.label,b(n.attributes,"href").includes("gpt_citation")?i():void 0),r=(n.index>a.index?e.slice(a.index+a.fullMatch.length,n.index):e.slice(n.index+n.fullMatch.length,a.index)).trim()?n.label:"";return e.replace(a.fullMatch,c).replace(n.fullMatch,r)},I=(e,i)=>{var t,a;const n=i.replace(/-([a-z])/g,(e,i)=>i.toUpperCase());return null!==(a=null!==(t=null==e?void 0:e[i])&&void 0!==t?t:null==e?void 0:e[n])&&void 0!==a?a:""},C=({text:e,item:t})=>{const a=c(()=>(e=>{let i=0;const t=()=>i++;return e.split("\n").map(e=>x(e,t)).join("\n")})(e),[e]);return i(d,{rehypePlugins:[s],components:{ol:({children:e})=>i("ol",{className:m["md-ol"],children:e}),ul:({children:e})=>i("ul",{className:m["md-ul"],children:e}),li:({children:e})=>i("li",{className:m["md-li"],children:e}),a:({node:e,href:a,children:n})=>{const c=(null==e?void 0:e.properties)||{},r=I(c,"data-secondary-href");return i(v,{href:a,children:n,secondaryCitation:r?{href:r,title:I(c,"data-secondary-title"),type:I(c,"data-secondary-type"),reason:I(c,"data-secondary-reason"),phraseToHighlight:I(c,"data-secondary-phrase-to-highlight"),occurrenceIndex:Number(I(c,"data-secondary-occurrence-index")||0)}:void 0,metaData:{citations:t.citations,docData:t.docData,guidelinesData:t.guidelinesData,gptCitations:t.gptCitations}})}},children:a.replace(/<br\s*\/?>/gi,"\n")})},R=({text:e,markdownStyles:t,citationStyles:a,customIcons:n})=>i(_,{message:e.replace(/<br\s*\/?>/gi,"\n"),customStyles:t,citationStyles:a,customIcons:n}),A=(e,i)=>e.disableAllActions===i.disableAllActions&&(e.redlineId===i.redlineId&&(e.aiReasonId===i.aiReasonId&&(e.relevanceScore===i.relevanceScore&&(e.reason===i.reason&&(e.impact===i.impact&&(e.explaination===i.explaination&&e.gap===i.gap)))))),$=n(function({item:n,title:r="Cognitive Decisioning AI",relevanceScore:l=0,showRelevanceScore:d=!0,reason:s="No reasoning provided.",impact:v="No Impact provided.",explaination:_="No explaination provided.",gap:g="None",onClose:y=()=>{},showResolveBtns:f=!1,sections:N,leftIcon:b,scoreIcon:x,className:I,customStyles:A={},markdownStyles:$,citationStyles:k,customIcons:D,actions:S,disableAllActions:w=!1,actionBtnDisabledStyle:j={},onBackClick:T,isImpactNeeded:H=!0,cognitiveTitle:B="Cognitive Integrity",labels:M={},chatHistory:P,resolveRedlineAction:L}){const E=c(()=>{const e=Number(l);return Number.isNaN(e)?0:Math.max(0,Math.min(100,Math.round(e)))},[l]),q=c(()=>{const e=M&&M.noGapsText||"1. No gaps identified.";return(e=>{if(!e)return!0;const i=e.trim().toLowerCase();return"none"===i||"no gap"===i||"no gaps"===i||"n/a"===i})(g)?e:g},[g]),U=M&&M.impact||"Impact",W=M&&M.explanation||"Explaination",G=M&&M.decisionFactors||"Decision Making Factors",F=M&&M.gaps||"Gaps in Decision",z=M&&M.accept||"Accept",J=M&&M.reject||"Reject",K=M&&M.backAriaLabel||"Go back",O=S||[{id:"reject",label:J,onClick:()=>L("reject"),className:m["btn-reject"]},{id:"accept",label:z,onClick:()=>L("accept"),className:m["btn-accept"]}],Q=P&&P.length>0;return e("div",{className:`${m["cite-acc"]} ${I||""}`,style:{...o.CitationAccordionDefaults.container,...null==A?void 0:A.container},children:[T&&e("div",{className:m["cite-acc__backHeader"],children:[i("button",{type:"button",className:m["cite-acc__backBtn"],onClick:e=>{e.stopPropagation(),T&&T()},"aria-label":K,children:"‹"}),i("span",{className:m["cite-acc__backTitle"],children:B})]}),i("div",{className:m["cite-body"],children:N&&N.length>0?N.map(t=>!1===t.show?null:e("div",{className:`${m["cite-acc__explain-body"]} ${t.bodyClassName||""}`,children:[e("div",{className:m["cite-acc__innerHeader"],style:{...o.CitationAccordionDefaults.innerHeader,...null==A?void 0:A.innerHeader},children:[i("div",{className:m["cite-acc__innerHeaderLeft"],children:i("div",{children:i("div",{className:m["cite-acc__innerTitle"],children:t.title})})}),i("button",{type:"button",onClick:e=>{e.stopPropagation(),y&&y()},children:i(p,{})})]}),i("div",{className:`${m["cite-acc__innerBody"]} text-sm text-gray-600`,style:{...o.CitationAccordionDefaults.innerBody,...null==A?void 0:A.innerBody},children:"string"==typeof t.content?i(C,{text:t.content,item:t.item||n||{}}):t.content})]},t.id||t.title)):e(t,{children:[H&&e("div",{className:m["cite-acc__explain-body"],children:[e("div",{className:m["cite-acc__innerHeader"],children:[i("div",{className:m["cite-acc__innerHeaderLeft"],children:i("div",{children:i("div",{className:m["cite-acc__innerTitle"],children:U})})}),i("button",{type:"button",onClick:e=>{e.stopPropagation(),y&&y()},children:i(p,{})})]}),i("div",{className:`${m["cite-acc__innerBody"]} text-sm text-gray-600`,children:i(C,{text:v||"",item:n||{}})})]}),_&&"No explaination provided."!==_&&e(t,{children:[e("div",{className:m["cite-acc__explain-body"],children:[i("div",{className:m["cite-acc__innerHeader"],children:i("div",{className:m["cite-acc__innerHeaderLeft"],children:i("div",{children:i("div",{className:m["cite-acc__innerTitle"],children:W})})})}),i("div",{className:`${m["cite-acc__innerBody"]} text-sm text-gray-600`,children:i(C,{text:_||"",item:{}})})]}),i("div",{style:{borderTop:"1px solid #e5e7eb",margin:"12px 0"}}),f&&i("div",{className:m["cite-acc__btn-container"],children:O.map(e=>{const t=w||e.disabled;return i("button",{className:e.className,onClick:t?void 0:e.onClick,disabled:t,style:{...e.style,...t?{opacity:.5,cursor:"not-allowed",...j,...e.disabledStyle}:{}},children:e.label},e.id)})})]}),e("div",{className:m["cite-acc__header"],children:[e("div",{className:m["cite-acc__headerLeft"],children:[i("span",{className:m["cite-acc__titleIcon"],children:b?"function"==typeof b?a.createElement(b):b:i(u,{})}),i("div",{className:m["cite-acc__title"],children:r})]}),i("div",{className:m["cite-acc__headerRight"],children:d&&e("span",{className:m["cite-acc__scoreBadge"],children:[x?"function"==typeof x?a.createElement(x):x:i(h,{}),e("span",{className:m["cite-acc__scoreText"],children:[E,"%"]})]})})]}),e("div",{className:m["cite-acc__explain-body"],children:[i("div",{className:m["cite-acc__innerHeader"],children:i("div",{className:m["cite-acc__innerHeaderLeft"],children:i("div",{children:i("div",{className:m["cite-acc__innerTitle"],children:G})})})}),i("div",{className:`${m["cite-acc__innerBody"]} text-sm text-gray-600`,children:Q?i(R,{text:s||"",markdownStyles:$,citationStyles:k,customIcons:D}):i(C,{text:s||"",item:n||{}})})]}),e("div",{className:`${m["cite-acc__explain-body"]} ${m["cite-acc__explain-body_border"]}`,children:[i("div",{className:m["cite-acc__innerHeader"],children:i("div",{className:m["cite-acc__innerHeaderLeft"],children:i("div",{children:i("div",{className:m["cite-acc__innerTitle"],children:F})})})}),i("div",{className:`${m["cite-acc__innerBody"]} text-sm text-gray-600`,children:Q?i(R,{text:q||"",markdownStyles:$,citationStyles:k,customIcons:D}):i(C,{text:q||"",item:n||{}})})]})]})})]})},A);var k=n(function(e){const{redlineDcoumentId:t,redlineConfig:a,updateRedlineDataParent:n}=y(),c=r({redlineDcoumentId:t,redlineConfig:a,updateRedlineDataParent:n}),o=r({onActionTrigger:e.onActionTrigger,redlineId:e.redlineId,aiReasonId:e.aiReasonId});c.current={redlineDcoumentId:t,redlineConfig:a,updateRedlineDataParent:n},o.current={onActionTrigger:e.onActionTrigger,redlineId:e.redlineId,aiReasonId:e.aiReasonId};const d=l(async e=>{var i,t,a,n,r,l;const{redlineDcoumentId:d,redlineConfig:s,updateRedlineDataParent:m}=c.current,{onActionTrigger:p,redlineId:u,aiReasonId:h}=o.current;null==p||p({status:"loading",action:e,metadata:{redlineId:u,aiReasonId:h}});try{const{updated_reqai:c}=await g({documentId:d,userEmail:null==s?void 0:s.userEmail,userName:null==s?void 0:s.userName,redlineId:null!=u?u:"",action:e,baseApiUrl:null==s?void 0:s.baseApiUrl,redlineConfigId:null!==(i=null==s?void 0:s.redlineConfigId)&&void 0!==i?i:""},null!==(t=null==s?void 0:s.token)&&void 0!==t?t:"");await(null==m?void 0:m(c)),null===(a=f.emit)||void 0===a||a.call(f,`redline-edit:${d}:${null===(l=null===(r=null===(n=null==c?void 0:c.artifactData)||void 0===n?void 0:n.userStorySnapshot)||void 0===r?void 0:r[0])||void 0===l?void 0:l.artifactId}`,{updatedBy:null==s?void 0:s.userName}),null==p||p({status:"success",action:e,metadata:{redlineId:u,aiReasonId:h}})}catch(i){null==p||p({status:"failed",action:e,metadata:{redlineId:u,aiReasonId:h}})}},[]);return i($,{...e,resolveRedlineAction:d})},A);export{k as default};
|
|
2
2
|
//# sourceMappingURL=CognitiveComponent.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as e,jsx as i,Fragment as t}from"react/jsx-runtime";import{PenLine as n,CheckCircle as o,XCircle as l,Info as r,ChevronDown as d,ChevronRight as a}from"lucide-react";import s,{memo as c,useState as p}from"react";import{ToneToggle as g}from"./ToneToggle.js";import"../CognitiveComponents/CitationComponent.module.css.js";import{ReactComponent as v}from"../icons/cognitiveBrain.svg.js";import{ReactComponent as u}from"../icons/aiMagic.svg.js";import{Tooltip as h}from"@mui/material";import{useRequirementAI as m}from"../../RequirementAIWrapper/RequirementAIWrapper.js";import{resolveRedline as x}from"../../../../../service/redlineService.js";import{AiReasonMarkdownWrapper as f}from"../../ai-reasoning/AiReasonMarkdownWrapper.js";import y from"../cws/CwsEvent.js";const w=[{color:"#1D9E75",angle:-90,arcD:"M1 13 A10 10 0 0 1 1 13"},{color:"#BA7517",angle:0,arcD:"M1 13 A10 10 0 0 1 11 3"},{color:"#E24B4A",angle:90,arcD:"M1 13 A10 10 0 0 1 21 13"}],S=({toneIndex:t,configs:n=w})=>{const o=Math.min(t,n.length-1),{color:l,angle:r,arcD:d}=n[o]||n[1]||n[0],a=(r-90)*Math.PI/180,s=11+9*Math.cos(a),c=13+9*Math.sin(a);return e("svg",{width:"22",height:"14",viewBox:"0 0 22 14",fill:"none",children:[i("path",{d:"M1 13 A10 10 0 0 1 21 13",stroke:"#e5e5e5",strokeWidth:"2.5",strokeLinecap:"round"}),i("path",{d:d,stroke:l,strokeWidth:"2.5",strokeLinecap:"round"}),i("line",{x1:"11",y1:"13",x2:s,y2:c,stroke:l,strokeWidth:"2",strokeLinecap:"round"})]})},b=({type:e,customStyles:t={}})=>{const n={High:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #FECACA",background:"#FEF2F2",color:"#B91C1C",fontSize:"11px",fontWeight:"500"},Medium:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #F2E5A1",background:"#FFFBEB",color:"#B45309",fontSize:"11px",fontWeight:"500"},Low:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #8098F9",background:"#DBEAFE",color:"#444CE7",fontSize:"11px",fontWeight:"500"},...t},o=n[e]||n.Medium;return i("div",{style:o,children:e})},k=["Lenient","Balanced","Aggressive"],C={Lenient:"#1D9E75",Balanced:"#BA7517",Aggressive:"#E24B4A"},I={width:"350px",background:"#fff",border:"1px solid #ddd",borderRadius:"8px",padding:"16px",maxHeight:"450px",overflow:"auto"},B={display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12,position:"relative"},T={fontSize:11,fontWeight:500,letterSpacing:"0.08em",color:"#E24B4A",textTransform:"uppercase"},A={fontSize:15,fontWeight:500,margin:"0 0 8px",color:"#111",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},E={fontSize:13,color:"#666",lineHeight:1.6,margin:"0 0 14px",maxHeight:"100px",overflow:"auto"},R={marginBottom:14,borderTop:"0.5px solid #eee",paddingTop:12},W={fontSize:13,color:"#666",lineHeight:1.6,margin:"8px 0 0",maxHeight:"100px",overflow:"auto"},z={display:"flex",alignItems:"center",gap:6,background:"none",border:"none",cursor:"pointer",padding:0,width:"100%"},j={fontSize:11,fontWeight:500,textTransform:"uppercase",letterSpacing:"0.08em",color:"#E24B4A"},L={display:"flex",gap:8,marginBottom:18},D={flex:1,display:"flex",alignItems:"center",justifyContent:"center",gap:5,fontSize:12,fontWeight:500,padding:"7px 4px",borderRadius:8,border:"0.5px solid #ccc",background:"#fff",cursor:"pointer"},F={background:"none",border:"none",cursor:"pointer",fontSize:16,color:"#888",lineHeight:1,padding:0},M={borderTop:"0.5px solid #eee",padding:"14px 0px"},H={display:"flex",alignItems:"center",width:"100%",background:"none",border:"none",cursor:"pointer",padding:0,marginBottom:4},_={cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"12px",borderTop:"1px solid #eee",borderBottom:"none",paddingLeft:"12px",paddingRight:"12px"},N={display:"flex",alignItems:"center",gap:"4px",minWidth:0,flex:"1 1 auto",overflow:"hidden"},O={width:"28px",height:"28px",display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 28px"},$={fontSize:"13px",color:"#101828",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},P={display:"flex",alignItems:"center",gap:"10px",flex:"0 0 auto",minWidth:0,flexWrap:"nowrap"},V={display:"flex",padding:"4px 8px",alignItems:"center",gap:"4px",borderRadius:"var(--chip-border-radius, 16px)",border:"1px solid var(--Primitive-Gray-300, #d0d5dd)",flex:"0 1 auto",minWidth:0},U={color:"var(--Primitive-Purple-600, #6938ef)",fontFamily:"Inter",fontSize:"12px",fontStyle:"normal",fontWeight:500,lineHeight:"150%"},q={padding:"4px",border:"1px solid #EBEBEB",position:"absolute",width:"100px",textAlign:"center",borderRadius:"9px",background:"#fff",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",zIndex:1e3,top:"100%",right:0},G=c(function({onAssignClick:t,onOpenCognitive:n,cognitiveIconSmall:o,cognitiveTootipTitle:l,historyIconSmall:r,onHistoryClick:d,historyTootipTitle:a}){const s="20px";return e("div",{style:{...q,minWidth:"200px"},children:[e("div",{style:{padding:"8px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"10px"},onClick:t,children:[i("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:s,height:s,flexShrink:0},children:e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[i("path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"}),i("path",{d:"M16 3.128a4 4 0 0 1 0 7.744"}),i("path",{d:"M22 21v-2a4 4 0 0 0-3-3.87"}),i("circle",{cx:"9",cy:"7",r:"4"})]})}),i("span",{style:{fontSize:"13px",display:"flex",alignItems:"center",flex:1,textAlign:"left"},children:"Assign"})]}),n&&e("div",{style:{padding:"8px",borderTop:"1px solid #EBEBEB",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"10px"},onClick:e=>n(e),children:[o&&i("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:s,height:s,flexShrink:0},children:o}),i("span",{style:{fontSize:"13px",display:"flex",alignItems:"center",flex:1,textAlign:"left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:l})]}),d&&e("div",{style:{padding:"8px",borderTop:"1px solid #EBEBEB",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"10px"},onClick:e=>d(e),children:[r&&i("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:s,height:s,flexShrink:0},children:r}),i("span",{style:{fontSize:"13px",display:"flex",alignItems:"center",flex:1,textAlign:"left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:a})]})]})}),J=c(function({onAssignClick:t,onOpenCognitive:n,cognitiveIconSmall:o,cognitiveTootipTitle:l,historyIconSmall:r,onHistoryClick:d,historyTootipTitle:a}){const[s,c]=p(!1);return e("div",{style:{position:"relative",display:"flex"},children:[i("button",{onClick:()=>c(!s),style:{border:"none",background:"transparent",display:"flex",alignItems:"center",cursor:"pointer",fontSize:"18px",padding:0},children:e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#64748B",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[i("circle",{cx:"12",cy:"12",r:"1"}),i("circle",{cx:"12",cy:"5",r:"1"}),i("circle",{cx:"12",cy:"19",r:"1"})]})}),s&&i(G,{onAssignClick:t?()=>{c(!1),t&&t()}:void 0,onOpenCognitive:n?e=>{c(!1),n&&n(e)}:void 0,cognitiveIconSmall:o,cognitiveTootipTitle:l,historyIconSmall:r,onHistoryClick:d,historyTootipTitle:a})]})}),K=c(function({users:t,onClick:n}){const o=t.length;return e("div",{onClick:n,style:{display:"flex",padding:"2px 6px",border:"1px solid #E2E8F0",background:"#fff",cursor:"pointer",fontSize:"11px",gap:6,borderRadius:"16px",alignItems:"center"},children:[i("p",{style:{margin:"0px",display:"flex",alignItems:"center",color:"#475569",whiteSpace:"nowrap"},children:(null==t?void 0:t[0].length)>9?(null==t?void 0:t[0].slice(0,9))+"...":null==t?void 0:t[0]}),o>1&&e("p",{style:{margin:"0px",display:"flex",alignItems:"center",borderRadius:"50px",backgroundColor:"#E2E8F0",padding:"2px 6px",color:"#475569",fontWeight:500},children:["+",o-1]})]})}),Q=c(function({steps:t}){if(!(null==t?void 0:t.length))return null;const n=t.length>=3;return i("div",{style:{width:"100%",maxWidth:"100%",boxSizing:"border-box",marginBottom:10,overflow:"hidden"},children:i("div",{style:{width:"100%",maxWidth:"100%",boxSizing:"border-box",display:"flex",alignItems:"center",border:"1px solid #CBD5E1",borderRadius:8,padding:n?"6px 8px":"8px 10px",background:"#F8FAFC",gap:n?4:8,overflow:"hidden"},children:t.map((o,l)=>{const r=(e=>{const i=[{bg:"#FEF08A",text:"#854D0E"},{bg:"#D1FAE5",text:"#065F46"},{bg:"#E0F2FE",text:"#0369A1"},{bg:"#F3E8FF",text:"#6B21A8"}];return i[e%i.length]})(l),d=l===t.length-1;return e(s.Fragment,{children:[e("div",{title:o.label,style:{minWidth:0,flex:"1 1 0",display:"flex",alignItems:"center",justifyContent:"center",gap:n?4:6,overflow:"hidden"},children:[(a=o.status,e("svg","approved"===a?{xmlns:"http://www.w3.org/2000/svg",width:n?"14":"16",height:n?"14":"16",viewBox:"0 0 24 24",fill:"none",stroke:"#10B981",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[i("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),i("polyline",{points:"22 4 12 14.01 9 11.01"})]}:"rejected"===a?{xmlns:"http://www.w3.org/2000/svg",width:n?"14":"16",height:n?"14":"16",viewBox:"0 0 24 24",fill:"none",stroke:"#EF4444",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[i("circle",{cx:"12",cy:"12",r:"10"}),i("path",{d:"m15 9-6 6"}),i("path",{d:"m9 9 6 6"})]}:{xmlns:"http://www.w3.org/2000/svg",width:n?"14":"16",height:n?"14":"16",viewBox:"0 0 24 24",fill:"none",stroke:"#F59E0B",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[i("path",{d:"M5 22h14"}),i("path",{d:"M5 2h14"}),i("path",{d:"M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22"}),i("path",{d:"M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2"})]})),i("span",{style:{minWidth:0,color:"#475569",fontSize:n?12:13,lineHeight:"16px",fontWeight:600,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:o.label}),o.initials&&i("span",{style:{width:n?20:22,height:n?20:22,minWidth:n?20:22,borderRadius:"50%",background:r.bg,color:r.text,display:"flex",alignItems:"center",justifyContent:"center",fontSize:n?9:10,fontWeight:700,lineHeight:1},children:o.initials})]}),!d&&e("svg",{xmlns:"http://www.w3.org/2000/svg",width:n?"14":"18",height:n?"14":"18",viewBox:"0 0 24 24",fill:"none",stroke:"#94A3B8",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",style:{flex:"0 0 auto",minWidth:n?14:18},children:[i("path",{d:"M5 12h14"}),i("path",{d:"m12 5 7 7-7 7"})]})]},o.id);var a})})})});var X=c(function({onClose:s,aiReason:c,onActionTrigger:q,onIterate:G,initialTone:X,onRegenerate:Y,labels:Z={},toneLevelsConfig:ee=k,toneColorsConfig:ie=C,dialConfigs:te=w,actions:ne,disableAllActions:oe=!1,customStyles:le={},severityChipStyles:re={},customIcons:de={},onOpenCognitive:ae,onHistoryClick:se,historyIconSmall:ce,historyTootipTitle:pe,showTone:ge=!0,cognitiveSectionStyle:ve={},cognitiveScoreBadgeStyle:ue={},cognitiveScoreTextStyle:he={},cognitiveStyles:me={},cognitiveClassNames:xe={},cognitiveTitle:fe="Cognitive Integrity",cognitiveTootipTitle:ye="Cognitive Decisioning",cognitiveLeftIcon:we,cognitiveIconSmall:Se,showCognitiveRightArrow:be=!0,isStreaming:ke,onAssignClick:Ce,assignedUsers:Ie,onReviewUsersClick:Be,redlineId:Te,aiReasonId:Ae,displayVariant:Ee="default",reviewTitle:Re,reviewSubtitle:We,reviewStatusIcon:ze=e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",className:"lucide lucide-hourglass-icon lucide-hourglass",children:[i("path",{d:"M5 22h14"}),i("path",{d:"M5 2h14"}),i("path",{d:"M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22"}),i("path",{d:"M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2"})]}),reviewSteps:je=[],showReviewProgress:Le=!1,showOriginalText:De=!1,originalText:Fe,originalTextHeader:Me="Original text",hideSummaryText:He=!1,hideSeverityChip:_e=!1}){var Ne,Oe,$e,Pe,Ve,Ue,qe,Ge,Je,Ke,Qe,Xe,Ye,Ze,ei,ii,ti,ni,oi,li;let ri=ee.findIndex(e=>e===X);-1===ri&&(ri=1);const[di,ai]=p(!0),[si,ci]=p(!1),[pi,gi]=p(!1),[vi,ui]=p(ri),[hi]=p(ri),[mi,xi]=p(!0),fi="review"===Ee,yi=ee[vi],wi=ie[yi]||"#BA7517",Si=vi!==hi,bi=[{id:"iterate",icon:de.iterateIcon||i(n,{size:16,color:"#64748B"}),label:Z.btnIterate||"Iterate",color:"#64748B",onClick:G},{id:"accept",icon:de.acceptIcon||i(o,{size:16,color:"#10B981"}),label:Z.btnAccept||"Approve",color:"#10B981",useLabel:!0},{id:"reject",icon:de.rejectIcon||i(l,{size:16,color:"#DC2626"}),label:Z.btnReject||"Reject",color:"#DC2626",useLabel:!0}],{redlineDcoumentId:ki,redlineConfig:Ci,updateRedlineDataParent:Ii}=m(),Bi=ne||bi;return e("div",{onClick:e=>{e.stopPropagation()},style:{...I,...null===(Ne=null==le?void 0:le.DeviationSummaryStyles)||void 0===Ne?void 0:Ne.root},children:[e("div",{style:{...B,...null===(Oe=null==le?void 0:le.DeviationSummaryStyles)||void 0===Oe?void 0:Oe.header,marginBottom:fi?14:pi?"16px":"12px",...fi&&{backgroundColor:"#F1F5F9",padding:"12px 16px",marginTop:"-16px",marginLeft:"-16px",marginRight:"-16px",borderTopLeftRadius:"8px",borderTopRightRadius:"8px",borderBottom:"1px solid #E2E8F0"}},children:[e("div",fi?{style:{minWidth:0,flex:"1 1 auto"},children:[e("div",{style:{display:"flex",alignItems:"center",gap:8,color:"#1E293B",fontSize:16,fontWeight:600,lineHeight:1.2},children:[i("span",{style:{display:"inline-flex",alignItems:"center",color:"#64748B"},children:ze||de.summaryIcon||"⏳"}),i("span",{children:Re||"Redline In Review"})]}),i("div",{style:{marginTop:6,paddingLeft:28,color:"#475569",fontSize:13,lineHeight:1.2,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:We||(null===($e=null==c?void 0:c.redlining_details)||void 0===$e?void 0:$e.redline_title)})]}:{style:{display:"flex",alignItems:"center",gap:10},children:[e("div",{style:{display:"flex",alignItems:"center",gap:6},children:[i("span",{children:de.summaryIcon||i(r,{size:16,color:"#E24B4A"})}),i("span",{style:{...T,...null===(Pe=null==le?void 0:le.DeviationSummaryStyles)||void 0===Pe?void 0:Pe.title},children:Z.summaryHeader||"Summary"})]}),Ie&&Ie.length>0&&i(K,{users:Ie,onClick:e=>{e.stopPropagation(),null==Be||Be()}})]}),e("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[(Ce||ae||se)&&i(J,{onAssignClick:Ce,onOpenCognitive:ae,cognitiveIconSmall:Se,cognitiveTootipTitle:ye,historyIconSmall:ce,onHistoryClick:se,historyTootipTitle:pe}),i("button",{onClick:s,style:{...F,...null===(Ve=null==le?void 0:le.DeviationSummaryStyles)||void 0===Ve?void 0:Ve.closeBtn,color:"#64748B",fontSize:16},children:"✕"})]})]}),fi&&Le&&je.length>0&&i(Q,{steps:je}),!He&&!fi&&i(t,{children:i(h,{title:null===(Ue=null==c?void 0:c.redlining_details)||void 0===Ue?void 0:Ue.redline_title,children:i("p",{style:{...A,...null===(qe=null==le?void 0:le.DeviationSummaryStyles)||void 0===qe?void 0:qe.bodyText},children:null===(Ge=null==c?void 0:c.redlining_details)||void 0===Ge?void 0:Ge.redline_title})})}),i("p",{style:{...E,...null===(Je=null==le?void 0:le.DeviationSummaryStyles)||void 0===Je?void 0:Je.summary},children:null===(Ke=null==c?void 0:c.redlining_details)||void 0===Ke?void 0:Ke.redline_summary}),e("div",{style:{...R,...null===(Qe=null==le?void 0:le.DeviationSummaryStyles)||void 0===Qe?void 0:Qe.impactContainer},children:[e("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e("button",{onClick:()=>ai(!di),style:{...z,...null===(Xe=null==le?void 0:le.DeviationSummaryStyles)||void 0===Xe?void 0:Xe.impactToggle},children:[i("span",{style:{...j,...null===(Ye=null==le?void 0:le.DeviationSummaryStyles)||void 0===Ye?void 0:Ye.impactToggleLabel},children:Z.impactHeader||"Impact"}),i("span",{style:{fontSize:12,color:"#E24B4A",transition:"transform 0.2s",display:"flex",alignItems:"center",transform:di?"rotate(180deg)":"rotate(0deg)"},children:i(d,{size:16,color:"#E24B4A"})})]}),i(b,{type:(null==c?void 0:c.severity)||"Medium",customStyles:re})]}),di&&i(t,{children:i("div",{style:{...W,...null===(Ze=null==le?void 0:le.DeviationSummaryStyles)||void 0===Ze?void 0:Ze.impactText},children:i(f,{message:`${null!==(ii=null===(ei=null==c?void 0:c.redlining_details)||void 0===ei?void 0:ei.redline_impact)&&void 0!==ii?ii:Z.fallbackImpact||"This change reduces compliance obligations and lowers contractual risk thresholds."} [View chat](chat_citation$all)`,customStyles:null===(ti=null==le?void 0:le.DeviationSummaryStyles)||void 0===ti?void 0:ti.impactMarkdown})})})]}),fi&&De&&e("div",{style:{borderTop:"1px solid #E2E8F0",paddingTop:14,marginBottom:20},children:[e("button",{onClick:()=>xi(e=>!e),style:{background:"none",border:"none",padding:0,width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",color:"#1E293B",fontSize:21,fontWeight:600},children:[i("span",{children:Me}),i(d,{size:18,color:"#1E293B",style:{transform:mi?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s"}})]}),mi&&e("div",{style:{marginTop:10,border:"1px solid #CBD5E1",borderRadius:12,padding:"16px 20px",background:"#F8FAFC",color:"#475569",fontSize:20,lineHeight:1.7,fontStyle:"italic",boxShadow:"0 1px 2px rgba(15, 23, 42, 0.08)"},children:["“",Fe||"","”"]})]}),i("div",{style:{...L,...null===(ni=null==le?void 0:le.DeviationSummaryStyles)||void 0===ni?void 0:ni.actionContainer},children:Bi.map(i=>{var t,n;const o=oe||i.disabled,l=o?{cursor:"not-allowed",opacity:.5,...null===(t=null==le?void 0:le.DeviationSummaryStyles)||void 0===t?void 0:t.actionBtnDisabled,...i.disabledStyle}:{};return e("button",{style:{...D,...null===(n=null==le?void 0:le.DeviationSummaryStyles)||void 0===n?void 0:n.actionBtn,color:i.color,...i.style,...l},onClick:o?void 0:async()=>{var e,t;if(i.useLabel)try{await(null===(e=i.onClick)||void 0===e?void 0:e.call(i))}finally{await(async e=>{var i,t,n,o,l,r;try{await(null==q?void 0:q({status:"loading",action:e,metadata:{redlineId:Te,aiReasonId:Ae}}))}catch(e){}if(null==Ci?void 0:Ci.callResolveRedline)try{const{updated_reqai:d}=await x({documentId:ki,userEmail:null==Ci?void 0:Ci.userEmail,userName:null==Ci?void 0:Ci.userName,redlineId:null!==(i=null==c?void 0:c.redline_id)&&void 0!==i?i:"",action:e,baseApiUrl:null==Ci?void 0:Ci.baseApiUrl,redlineConfigId:null!==(t=null==Ci?void 0:Ci.redlineConfigId)&&void 0!==t?t:""},null!==(n=null==Ci?void 0:Ci.token)&&void 0!==n?n:"");await(null==Ii?void 0:Ii(d));const a=null===(r=null===(l=null===(o=null==d?void 0:d.artifactData)||void 0===o?void 0:o.userStorySnapshot)||void 0===l?void 0:l[0])||void 0===r?void 0:r.artifactId;"string"==typeof a&&a.trim()&&"string"==typeof ki&&ki.trim()&&"string"==typeof(null==Ci?void 0:Ci.userName)&&(null==Ci?void 0:Ci.userName.trim())?y.emit(`redline-edit:${ki}:${a}`,{updatedBy:null==Ci?void 0:Ci.userName}):console.error("invalid cwsEvent name or payload"),null==q||q({status:"success",action:e,metadata:{redlineId:Te,aiReasonId:Ae}})}catch(i){null==q||q({status:"failed",action:e,metadata:{redlineId:Te,aiReasonId:Ae}})}})(i.id.toLowerCase())}else await(null===(t=i.onClick)||void 0===t?void 0:t.call(i))},disabled:o,children:[i.icon,i.label]},i.id)})}),ge&&e("div",{style:{...M,...null===(oi=null==le?void 0:le.DeviationSummaryStyles)||void 0===oi?void 0:oi.toneContainer},children:[e("button",{onClick:()=>ci(!si),style:{...H,...null===(li=null==le?void 0:le.DeviationSummaryStyles)||void 0===li?void 0:li.toneToggleBtn},children:[e("div",{style:{display:"flex",alignItems:"center",gap:8},children:[i(S,{toneIndex:vi,configs:te}),i("span",{style:{fontSize:13,fontWeight:500,color:"#111"},children:Z.toneHeader||"Redline Tone"})]}),i("span",{style:{transition:"transform 0.2s",display:"flex",alignItems:"center",transform:si?"rotate(180deg)":"rotate(0deg)"},children:i(d,{size:16,color:"#111"})})]}),si&&e(t,{children:[i("p",{style:{fontSize:12,color:"#888",margin:"0 0 12px"},children:Z.toneDescription||"Controls how assertively AI is redlining"}),i(g,{isDirty:Si,onToneChange:e=>{ui(e)},toneColor:wi,toneIndex:vi,onClickRegenerate:()=>null==Y?void 0:Y(yi),toneLabels:ee,isStreaming:ke,aiReason:c})]})]}),ae&&e("div",{className:null==xe?void 0:xe.section,onClick:e=>{e.stopPropagation(),ae&&ae(e)},style:{..._,...null==me?void 0:me.section,...ve},children:[e("div",{className:null==xe?void 0:xe.headerLeft,style:{...N,...null==me?void 0:me.headerLeft},children:[i("span",{className:null==xe?void 0:xe.titleIcon,style:{...O,...null==me?void 0:me.titleIcon},children:null!=we?we:i(v,{})}),i("div",{className:null==xe?void 0:xe.cognitiveTitle,style:{...$,...null==me?void 0:me.cognitiveTitle},children:fe})]}),e("div",{className:null==xe?void 0:xe.headerRight,style:{...P,...null==me?void 0:me.headerRight},children:[void 0!==(null==c?void 0:c.relevance_score)&&null!==(null==c?void 0:c.relevance_score)?e("span",{className:null==xe?void 0:xe.scoreBadge,style:{...V,...null==me?void 0:me.scoreBadge,...ue},children:[i(u,{}),e("span",{className:null==xe?void 0:xe.scoreText,style:{...U,...null==me?void 0:me.scoreText,...he},children:[Math.round(Number(c.relevance_score)),"%"]})]}):null,be&&i("span",{style:{display:"flex",alignItems:"center"},children:i(a,{size:16,color:"#64748B"})})]})]})]})},(e,i)=>{var t,n,o,l;if(e.displayVariant!==i.displayVariant)return!1;if(e.reviewTitle!==i.reviewTitle)return!1;if(e.reviewSubtitle!==i.reviewSubtitle)return!1;if(e.showReviewProgress!==i.showReviewProgress)return!1;if(e.showOriginalText!==i.showOriginalText)return!1;if(e.originalText!==i.originalText)return!1;if(e.hideSummaryText!==i.hideSummaryText)return!1;if(e.hideSeverityChip!==i.hideSeverityChip)return!1;if((null!==(n=null===(t=e.reviewSteps)||void 0===t?void 0:t.length)&&void 0!==n?n:0)!==(null!==(l=null===(o=i.reviewSteps)||void 0===o?void 0:o.length)&&void 0!==l?l:0))return!1;if(e.reviewSteps&&i.reviewSteps){if(e.reviewSteps.map(e=>`${e.id}:${e.label}:${e.initials}:${e.status}`).join("|")!==i.reviewSteps.map(e=>`${e.id}:${e.label}:${e.initials}:${e.status}`).join("|"))return!1}return!0});export{G as AssignMenu,K as DisplayUsers,J as KebabMenu,X as default};
|
|
1
|
+
import{jsxs as e,jsx as i,Fragment as t}from"react/jsx-runtime";import{PenLine as n,CheckCircle as o,XCircle as l,Info as r,ChevronDown as d,ChevronRight as a}from"lucide-react";import s,{memo as c,useState as p}from"react";import{ToneToggle as g}from"./ToneToggle.js";import"../CognitiveComponents/CitationComponent.module.css.js";import{ReactComponent as h}from"../icons/cognitiveBrain.svg.js";import{ReactComponent as u}from"../icons/aiMagic.svg.js";import{Tooltip as v}from"@mui/material";import{useRequirementAI as m}from"../../RequirementAIWrapper/RequirementAIWrapper.js";import{resolveRedline as x}from"../../../../../service/redlineService.js";import{AiReasonMarkdownWrapper as f}from"../../ai-reasoning/AiReasonMarkdownWrapper.js";import y from"../cws/CwsEvent.js";const w=[{color:"#1D9E75",angle:-90,arcD:"M1 13 A10 10 0 0 1 1 13"},{color:"#BA7517",angle:0,arcD:"M1 13 A10 10 0 0 1 11 3"},{color:"#E24B4A",angle:90,arcD:"M1 13 A10 10 0 0 1 21 13"}],S=({toneIndex:t,configs:n=w})=>{const o=Math.min(t,n.length-1),{color:l,angle:r,arcD:d}=n[o]||n[1]||n[0],a=(r-90)*Math.PI/180,s=11+9*Math.cos(a),c=13+9*Math.sin(a);return e("svg",{width:"22",height:"14",viewBox:"0 0 22 14",fill:"none",children:[i("path",{d:"M1 13 A10 10 0 0 1 21 13",stroke:"#e5e5e5",strokeWidth:"2.5",strokeLinecap:"round"}),i("path",{d:d,stroke:l,strokeWidth:"2.5",strokeLinecap:"round"}),i("line",{x1:"11",y1:"13",x2:s,y2:c,stroke:l,strokeWidth:"2",strokeLinecap:"round"})]})},b=({type:e,customStyles:t={}})=>{const n={High:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #FECACA",background:"#FEF2F2",color:"#B91C1C",fontSize:"11px",fontWeight:"500"},Medium:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #F2E5A1",background:"#FFFBEB",color:"#B45309",fontSize:"11px",fontWeight:"500"},Low:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #8098F9",background:"#DBEAFE",color:"#444CE7",fontSize:"11px",fontWeight:"500"},...t},o=n[e]||n.Medium;return i("div",{style:o,children:e})},k=["Lenient","Balanced","Aggressive"],C={Lenient:"#1D9E75",Balanced:"#BA7517",Aggressive:"#E24B4A"},I={width:"350px",background:"#fff",border:"1px solid #ddd",borderRadius:"8px",padding:"16px",maxHeight:"450px",overflow:"auto"},B={display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12,position:"relative"},T={fontSize:11,fontWeight:500,letterSpacing:"0.08em",color:"#E24B4A",textTransform:"uppercase"},A={fontSize:15,fontWeight:500,margin:"0 0 8px",color:"#111",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},E={fontSize:13,color:"#666",lineHeight:1.6,margin:"0 0 14px",maxHeight:"100px",overflow:"auto"},R={marginBottom:14,borderTop:"0.5px solid #eee",paddingTop:12},W={fontSize:13,color:"#666",lineHeight:1.6,margin:"8px 0 0",maxHeight:"100px",overflow:"auto"},z={display:"flex",alignItems:"center",gap:6,background:"none",border:"none",cursor:"pointer",padding:0,width:"100%"},j={fontSize:11,fontWeight:500,textTransform:"uppercase",letterSpacing:"0.08em",color:"#E24B4A"},L={display:"flex",gap:8,marginBottom:18},D={flex:1,display:"flex",alignItems:"center",justifyContent:"center",gap:5,fontSize:12,fontWeight:500,padding:"7px 4px",borderRadius:8,border:"0.5px solid #ccc",background:"#fff",cursor:"pointer"},F={background:"none",border:"none",cursor:"pointer",fontSize:16,color:"#888",lineHeight:1,padding:0},M={borderTop:"0.5px solid #eee",padding:"14px 0px"},H={display:"flex",alignItems:"center",width:"100%",background:"none",border:"none",cursor:"pointer",padding:0,marginBottom:4},_={cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"12px",borderTop:"1px solid #eee",borderBottom:"none",paddingLeft:"12px",paddingRight:"12px"},O={display:"flex",alignItems:"center",gap:"4px",minWidth:0,flex:"1 1 auto",overflow:"hidden"},N={width:"28px",height:"28px",display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 28px"},$={fontSize:"13px",color:"#101828",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},P={display:"flex",alignItems:"center",gap:"10px",flex:"0 0 auto",minWidth:0,flexWrap:"nowrap"},V={display:"flex",padding:"4px 8px",alignItems:"center",gap:"4px",borderRadius:"var(--chip-border-radius, 16px)",border:"1px solid var(--Primitive-Gray-300, #d0d5dd)",flex:"0 1 auto",minWidth:0},U={color:"var(--Primitive-Purple-600, #6938ef)",fontFamily:"Inter",fontSize:"12px",fontStyle:"normal",fontWeight:500,lineHeight:"150%"},q={padding:"4px",border:"1px solid #EBEBEB",position:"absolute",width:"100px",textAlign:"center",borderRadius:"9px",background:"#fff",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",zIndex:1e3,top:"100%",right:0},G=c(function({onAssignClick:t,onOpenCognitive:n,cognitiveIconSmall:o,cognitiveTootipTitle:l,historyIconSmall:r,onHistoryClick:d,historyTootipTitle:a}){const s="20px";return e("div",{style:{...q,minWidth:"200px"},children:[e("div",{style:{padding:"8px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"10px"},onClick:t,children:[i("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:s,height:s,flexShrink:0},children:e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[i("path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"}),i("path",{d:"M16 3.128a4 4 0 0 1 0 7.744"}),i("path",{d:"M22 21v-2a4 4 0 0 0-3-3.87"}),i("circle",{cx:"9",cy:"7",r:"4"})]})}),i("span",{style:{fontSize:"13px",display:"flex",alignItems:"center",flex:1,textAlign:"left"},children:"Assign"})]}),n&&e("div",{style:{padding:"8px",borderTop:"1px solid #EBEBEB",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"10px"},onClick:e=>n(e),children:[o&&i("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:s,height:s,flexShrink:0},children:o}),i("span",{style:{fontSize:"13px",display:"flex",alignItems:"center",flex:1,textAlign:"left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:l})]}),d&&e("div",{style:{padding:"8px",borderTop:"1px solid #EBEBEB",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"10px"},onClick:e=>d(e),children:[r&&i("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:s,height:s,flexShrink:0},children:r}),i("span",{style:{fontSize:"13px",display:"flex",alignItems:"center",flex:1,textAlign:"left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:a})]})]})}),J=c(function({onAssignClick:t,onOpenCognitive:n,cognitiveIconSmall:o,cognitiveTootipTitle:l,historyIconSmall:r,onHistoryClick:d,historyTootipTitle:a}){const[s,c]=p(!1);return e("div",{style:{position:"relative",display:"flex"},children:[i("button",{onClick:()=>c(!s),style:{border:"none",background:"transparent",display:"flex",alignItems:"center",cursor:"pointer",fontSize:"18px",padding:0},children:e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#64748B",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[i("circle",{cx:"12",cy:"12",r:"1"}),i("circle",{cx:"12",cy:"5",r:"1"}),i("circle",{cx:"12",cy:"19",r:"1"})]})}),s&&i(G,{onAssignClick:t?()=>{c(!1),t&&t()}:void 0,onOpenCognitive:n?e=>{c(!1),n&&n(e)}:void 0,cognitiveIconSmall:o,cognitiveTootipTitle:l,historyIconSmall:r,onHistoryClick:d,historyTootipTitle:a})]})}),K=c(function({users:t,onClick:n}){const o=t.length;return e("div",{onClick:n,style:{display:"flex",padding:"2px 6px",border:"1px solid #E2E8F0",background:"#fff",cursor:"pointer",fontSize:"11px",gap:6,borderRadius:"16px",alignItems:"center"},children:[i("p",{style:{margin:"0px",display:"flex",alignItems:"center",color:"#475569",whiteSpace:"nowrap"},children:(null==t?void 0:t[0].length)>9?(null==t?void 0:t[0].slice(0,9))+"...":null==t?void 0:t[0]}),o>1&&e("p",{style:{margin:"0px",display:"flex",alignItems:"center",borderRadius:"50px",backgroundColor:"#E2E8F0",padding:"2px 6px",color:"#475569",fontWeight:500},children:["+",o-1]})]})}),Q=c(function({steps:t}){if(!(null==t?void 0:t.length))return null;const n=t.length>=3;return i("div",{style:{width:"100%",maxWidth:"100%",boxSizing:"border-box",marginBottom:10,overflow:"hidden"},children:i("div",{style:{width:"100%",maxWidth:"100%",boxSizing:"border-box",display:"flex",alignItems:"center",border:"1px solid #CBD5E1",borderRadius:8,padding:n?"6px 8px":"8px 10px",background:"#F8FAFC",gap:n?4:8,overflow:"hidden"},children:t.map((o,l)=>{const r=(e=>{const i=[{bg:"#FEF08A",text:"#854D0E"},{bg:"#D1FAE5",text:"#065F46"},{bg:"#E0F2FE",text:"#0369A1"},{bg:"#F3E8FF",text:"#6B21A8"}];return i[e%i.length]})(l),d=l===t.length-1;return e(s.Fragment,{children:[e("div",{title:o.label,style:{minWidth:0,flex:"1 1 0",display:"flex",alignItems:"center",justifyContent:"center",gap:n?4:6,overflow:"hidden"},children:[(a=o.status,e("svg","approved"===a?{xmlns:"http://www.w3.org/2000/svg",width:n?"14":"16",height:n?"14":"16",viewBox:"0 0 24 24",fill:"none",stroke:"#10B981",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[i("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),i("polyline",{points:"22 4 12 14.01 9 11.01"})]}:"rejected"===a?{xmlns:"http://www.w3.org/2000/svg",width:n?"14":"16",height:n?"14":"16",viewBox:"0 0 24 24",fill:"none",stroke:"#EF4444",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[i("circle",{cx:"12",cy:"12",r:"10"}),i("path",{d:"m15 9-6 6"}),i("path",{d:"m9 9 6 6"})]}:{xmlns:"http://www.w3.org/2000/svg",width:n?"14":"16",height:n?"14":"16",viewBox:"0 0 24 24",fill:"none",stroke:"#F59E0B",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[i("path",{d:"M5 22h14"}),i("path",{d:"M5 2h14"}),i("path",{d:"M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22"}),i("path",{d:"M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2"})]})),i("span",{style:{minWidth:0,color:"#475569",fontSize:n?12:13,lineHeight:"16px",fontWeight:600,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:o.label}),o.initials&&i("span",{style:{width:n?20:22,height:n?20:22,minWidth:n?20:22,borderRadius:"50%",background:r.bg,color:r.text,display:"flex",alignItems:"center",justifyContent:"center",fontSize:n?9:10,fontWeight:700,lineHeight:1},children:o.initials})]}),!d&&e("svg",{xmlns:"http://www.w3.org/2000/svg",width:n?"14":"18",height:n?"14":"18",viewBox:"0 0 24 24",fill:"none",stroke:"#94A3B8",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",style:{flex:"0 0 auto",minWidth:n?14:18},children:[i("path",{d:"M5 12h14"}),i("path",{d:"m12 5 7 7-7 7"})]})]},o.id);var a})})})});var X=c(function({onClose:s,aiReason:c,onActionTrigger:q,onIterate:G,initialTone:X,onRegenerate:Y,labels:Z={},toneLevelsConfig:ee=k,toneColorsConfig:ie=C,dialConfigs:te=w,actions:ne,disableAllActions:oe=!1,customStyles:le={},severityChipStyles:re={},customIcons:de={},onOpenCognitive:ae,onHistoryClick:se,historyIconSmall:ce,historyTootipTitle:pe,showTone:ge=!0,cognitiveSectionStyle:he={},cognitiveScoreBadgeStyle:ue={},cognitiveScoreTextStyle:ve={},cognitiveStyles:me={},cognitiveClassNames:xe={},cognitiveTitle:fe="Cognitive Integrity",cognitiveTootipTitle:ye="Cognitive Decisioning",cognitiveLeftIcon:we,cognitiveIconSmall:Se,showCognitiveRightArrow:be=!0,isStreaming:ke,onAssignClick:Ce,assignedUsers:Ie,onReviewUsersClick:Be,redlineId:Te,aiReasonId:Ae,displayVariant:Ee="default",reviewTitle:Re,reviewSubtitle:We,reviewStatusIcon:ze=e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",className:"lucide lucide-hourglass-icon lucide-hourglass",children:[i("path",{d:"M5 22h14"}),i("path",{d:"M5 2h14"}),i("path",{d:"M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22"}),i("path",{d:"M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2"})]}),reviewSteps:je=[],showReviewProgress:Le=!1,showOriginalText:De=!1,originalText:Fe,originalTextHeader:Me="Original text",hideSummaryText:He=!1,hideSeverityChip:_e=!1}){var Oe,Ne,$e,Pe,Ve,Ue,qe,Ge,Je,Ke,Qe,Xe,Ye,Ze,ei,ii,ti,ni,oi,li;let ri=ee.findIndex(e=>e===X);-1===ri&&(ri=1);const[di,ai]=p(!0),[si,ci]=p(!1),[pi,gi]=p(!1),[hi,ui]=p(ri),[vi]=p(ri),[mi,xi]=p(!0),fi="review"===Ee,yi=ee[hi],wi=ie[yi]||"#BA7517",Si=hi!==vi,bi=[{id:"iterate",icon:de.iterateIcon||i(n,{size:16,color:"#64748B"}),label:Z.btnIterate||"Iterate",color:"#64748B",onClick:G},{id:"accept",icon:de.acceptIcon||i(o,{size:16,color:"#10B981"}),label:Z.btnAccept||"Approve",color:"#10B981",useLabel:!0},{id:"reject",icon:de.rejectIcon||i(l,{size:16,color:"#DC2626"}),label:Z.btnReject||"Reject",color:"#DC2626",useLabel:!0}],{redlineDcoumentId:ki,redlineConfig:Ci,updateRedlineDataParent:Ii}=m(),Bi=ne||bi;return e("div",{onClick:e=>{e.stopPropagation()},style:{...I,...null===(Oe=null==le?void 0:le.DeviationSummaryStyles)||void 0===Oe?void 0:Oe.root},children:[e("div",{style:{...B,...null===(Ne=null==le?void 0:le.DeviationSummaryStyles)||void 0===Ne?void 0:Ne.header,marginBottom:fi?14:pi?"16px":"12px",...fi&&{backgroundColor:"#F1F5F9",padding:"12px 16px",marginTop:"-16px",marginLeft:"-16px",marginRight:"-16px",borderTopLeftRadius:"8px",borderTopRightRadius:"8px",borderBottom:"1px solid #E2E8F0"}},children:[e("div",fi?{style:{minWidth:0,flex:"1 1 auto"},children:[e("div",{style:{display:"flex",alignItems:"center",gap:8,color:"#1E293B",fontSize:16,fontWeight:600,lineHeight:1.2},children:[i("span",{style:{display:"inline-flex",alignItems:"center",color:"#64748B"},children:ze||de.summaryIcon||"⏳"}),i("span",{children:Re||"Redline In Review"})]}),i("div",{style:{marginTop:6,paddingLeft:28,color:"#475569",fontSize:13,lineHeight:1.2,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:We||(null===($e=null==c?void 0:c.redlining_details)||void 0===$e?void 0:$e.redline_title)})]}:{style:{display:"flex",alignItems:"center",gap:10},children:[e("div",{style:{display:"flex",alignItems:"center",gap:6},children:[i("span",{children:de.summaryIcon||i(r,{size:16,color:"#E24B4A"})}),i("span",{style:{...T,...null===(Pe=null==le?void 0:le.DeviationSummaryStyles)||void 0===Pe?void 0:Pe.title},children:Z.summaryHeader||"Summary"})]}),Ie&&Ie.length>0&&i(K,{users:Ie,onClick:e=>{e.stopPropagation(),null==Be||Be()}})]}),e("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[(Ce||ae||se)&&i(J,{onAssignClick:Ce,onOpenCognitive:ae,cognitiveIconSmall:Se,cognitiveTootipTitle:ye,historyIconSmall:ce,onHistoryClick:se,historyTootipTitle:pe}),i("button",{onClick:s,style:{...F,...null===(Ve=null==le?void 0:le.DeviationSummaryStyles)||void 0===Ve?void 0:Ve.closeBtn,color:"#64748B",fontSize:16},children:"✕"})]})]}),fi&&Le&&je.length>0&&i(Q,{steps:je}),!He&&!fi&&i(t,{children:i(v,{title:null===(Ue=null==c?void 0:c.redlining_details)||void 0===Ue?void 0:Ue.redline_title,children:i("p",{style:{...A,...null===(qe=null==le?void 0:le.DeviationSummaryStyles)||void 0===qe?void 0:qe.bodyText},children:null===(Ge=null==c?void 0:c.redlining_details)||void 0===Ge?void 0:Ge.redline_title})})}),i("p",{style:{...E,...null===(Je=null==le?void 0:le.DeviationSummaryStyles)||void 0===Je?void 0:Je.summary},children:null===(Ke=null==c?void 0:c.redlining_details)||void 0===Ke?void 0:Ke.redline_summary}),e("div",{style:{...R,...null===(Qe=null==le?void 0:le.DeviationSummaryStyles)||void 0===Qe?void 0:Qe.impactContainer},children:[e("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e("button",{onClick:()=>ai(!di),style:{...z,...null===(Xe=null==le?void 0:le.DeviationSummaryStyles)||void 0===Xe?void 0:Xe.impactToggle},children:[i("span",{style:{...j,...null===(Ye=null==le?void 0:le.DeviationSummaryStyles)||void 0===Ye?void 0:Ye.impactToggleLabel},children:Z.impactHeader||"Impact"}),i("span",{style:{fontSize:12,color:"#E24B4A",transition:"transform 0.2s",display:"flex",alignItems:"center",transform:di?"rotate(180deg)":"rotate(0deg)"},children:i(d,{size:16,color:"#E24B4A"})})]}),i(b,{type:(null==c?void 0:c.severity)||"Medium",customStyles:re})]}),di&&i(t,{children:i("div",{style:{...W,...null===(Ze=null==le?void 0:le.DeviationSummaryStyles)||void 0===Ze?void 0:Ze.impactText},children:i(f,{message:`${null!==(ii=null===(ei=null==c?void 0:c.redlining_details)||void 0===ei?void 0:ei.redline_impact)&&void 0!==ii?ii:Z.fallbackImpact||"This change reduces compliance obligations and lowers contractual risk thresholds."} [View chat](chat_citation$all)`,customStyles:null===(ti=null==le?void 0:le.DeviationSummaryStyles)||void 0===ti?void 0:ti.impactMarkdown})})})]}),fi&&De&&e("div",{style:{borderTop:"1px solid #E2E8F0",paddingTop:14,marginBottom:20},children:[e("button",{onClick:()=>xi(e=>!e),style:{background:"none",border:"none",padding:0,width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",color:"#1E293B",fontSize:21,fontWeight:600},children:[i("span",{children:Me}),i(d,{size:18,color:"#1E293B",style:{transform:mi?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s"}})]}),mi&&e("div",{style:{marginTop:10,border:"1px solid #CBD5E1",borderRadius:12,padding:"16px 20px",background:"#F8FAFC",color:"#475569",fontSize:20,lineHeight:1.7,fontStyle:"italic",boxShadow:"0 1px 2px rgba(15, 23, 42, 0.08)"},children:["“",Fe||"","”"]})]}),i("div",{style:{...L,...null===(ni=null==le?void 0:le.DeviationSummaryStyles)||void 0===ni?void 0:ni.actionContainer},children:Bi.map(i=>{var t,n;const o=oe||i.disabled,l=o?{cursor:"not-allowed",opacity:.5,...null===(t=null==le?void 0:le.DeviationSummaryStyles)||void 0===t?void 0:t.actionBtnDisabled,...i.disabledStyle}:{};return e("button",{style:{...D,...null===(n=null==le?void 0:le.DeviationSummaryStyles)||void 0===n?void 0:n.actionBtn,color:i.color,...i.style,...l},onClick:o?void 0:async()=>{var e,t;if(i.useLabel)try{await(null===(e=i.onClick)||void 0===e?void 0:e.call(i))}finally{await(async e=>{var i,t,n,o,l,r;null==q||q({status:"loading",action:e,metadata:{redlineId:Te,aiReasonId:Ae}});try{const{updated_reqai:d}=await x({documentId:ki,userEmail:null==Ci?void 0:Ci.userEmail,userName:null==Ci?void 0:Ci.userName,redlineId:null!==(i=null==c?void 0:c.redline_id)&&void 0!==i?i:"",action:e,baseApiUrl:null==Ci?void 0:Ci.baseApiUrl,redlineConfigId:null!==(t=null==Ci?void 0:Ci.redlineConfigId)&&void 0!==t?t:""},null!==(n=null==Ci?void 0:Ci.token)&&void 0!==n?n:"");await(null==Ii?void 0:Ii(d)),y.emit(`redline-edit:${ki}:${null===(r=null===(l=null===(o=null==d?void 0:d.artifactData)||void 0===o?void 0:o.userStorySnapshot)||void 0===l?void 0:l[0])||void 0===r?void 0:r.artifactId}`,{updatedBy:null==Ci?void 0:Ci.userName}),null==q||q({status:"success",action:e,metadata:{redlineId:Te,aiReasonId:Ae}})}catch(i){null==q||q({status:"failed",action:e,metadata:{redlineId:Te,aiReasonId:Ae}})}})(i.id.toLowerCase())}else await(null===(t=i.onClick)||void 0===t?void 0:t.call(i))},disabled:o,children:[i.icon,i.label]},i.id)})}),ge&&e("div",{style:{...M,...null===(oi=null==le?void 0:le.DeviationSummaryStyles)||void 0===oi?void 0:oi.toneContainer},children:[e("button",{onClick:()=>ci(!si),style:{...H,...null===(li=null==le?void 0:le.DeviationSummaryStyles)||void 0===li?void 0:li.toneToggleBtn},children:[e("div",{style:{display:"flex",alignItems:"center",gap:8},children:[i(S,{toneIndex:hi,configs:te}),i("span",{style:{fontSize:13,fontWeight:500,color:"#111"},children:Z.toneHeader||"Redline Tone"})]}),i("span",{style:{transition:"transform 0.2s",display:"flex",alignItems:"center",transform:si?"rotate(180deg)":"rotate(0deg)"},children:i(d,{size:16,color:"#111"})})]}),si&&e(t,{children:[i("p",{style:{fontSize:12,color:"#888",margin:"0 0 12px"},children:Z.toneDescription||"Controls how assertively AI is redlining"}),i(g,{isDirty:Si,onToneChange:e=>{ui(e)},toneColor:wi,toneIndex:hi,onClickRegenerate:()=>null==Y?void 0:Y(yi),toneLabels:ee,isStreaming:ke,aiReason:c})]})]}),ae&&e("div",{className:null==xe?void 0:xe.section,onClick:e=>{e.stopPropagation(),ae&&ae(e)},style:{..._,...null==me?void 0:me.section,...he},children:[e("div",{className:null==xe?void 0:xe.headerLeft,style:{...O,...null==me?void 0:me.headerLeft},children:[i("span",{className:null==xe?void 0:xe.titleIcon,style:{...N,...null==me?void 0:me.titleIcon},children:null!=we?we:i(h,{})}),i("div",{className:null==xe?void 0:xe.cognitiveTitle,style:{...$,...null==me?void 0:me.cognitiveTitle},children:fe})]}),e("div",{className:null==xe?void 0:xe.headerRight,style:{...P,...null==me?void 0:me.headerRight},children:[void 0!==(null==c?void 0:c.relevance_score)&&null!==(null==c?void 0:c.relevance_score)?e("span",{className:null==xe?void 0:xe.scoreBadge,style:{...V,...null==me?void 0:me.scoreBadge,...ue},children:[i(u,{}),e("span",{className:null==xe?void 0:xe.scoreText,style:{...U,...null==me?void 0:me.scoreText,...ve},children:[Math.round(Number(c.relevance_score)),"%"]})]}):null,be&&i("span",{style:{display:"flex",alignItems:"center"},children:i(a,{size:16,color:"#64748B"})})]})]})]})},(e,i)=>{var t,n,o,l;if(e.displayVariant!==i.displayVariant)return!1;if(e.reviewTitle!==i.reviewTitle)return!1;if(e.reviewSubtitle!==i.reviewSubtitle)return!1;if(e.showReviewProgress!==i.showReviewProgress)return!1;if(e.showOriginalText!==i.showOriginalText)return!1;if(e.originalText!==i.originalText)return!1;if(e.hideSummaryText!==i.hideSummaryText)return!1;if(e.hideSeverityChip!==i.hideSeverityChip)return!1;if((null!==(n=null===(t=e.reviewSteps)||void 0===t?void 0:t.length)&&void 0!==n?n:0)!==(null!==(l=null===(o=i.reviewSteps)||void 0===o?void 0:o.length)&&void 0!==l?l:0))return!1;if(e.reviewSteps&&i.reviewSteps){if(e.reviewSteps.map(e=>`${e.id}:${e.label}:${e.initials}:${e.status}`).join("|")!==i.reviewSteps.map(e=>`${e.id}:${e.label}:${e.initials}:${e.status}`).join("|"))return!1}return!0});export{G as AssignMenu,K as DisplayUsers,J as KebabMenu,X as default};
|
|
2
2
|
//# sourceMappingURL=DeviationSummary.js.map
|