@viswa-test/test-citation 0.0.382 → 0.0.383
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/features/CognitiveCompare/CitationAnchor.js +1 -1
- package/dist/cjs/features/CognitiveCompare/CitationRenderer.js +1 -1
- package/dist/cjs/features/CognitiveCompare/CitationRendererInner.js +2 -0
- package/dist/cjs/features/CognitiveCompare/CitationRendererInner.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/CognitiveCompare.js +1 -1
- package/dist/cjs/features/CognitiveCompare/CognitiveCompareConstants.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/CompareContext.js +1 -1
- package/dist/cjs/features/CognitiveCompare/GptWebCitationPanel.js +2 -0
- package/dist/cjs/features/CognitiveCompare/GptWebCitationPanel.js.map +1 -0
- 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/useOnDemandCitationCache.js +2 -0
- package/dist/cjs/features/CognitiveCompare/hooks/useOnDemandCitationCache.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/hooks/useSideBySide.js +1 -1
- package/dist/cjs/features/CognitiveCompare/onDemandCitations/cacheKey.js +2 -0
- package/dist/cjs/features/CognitiveCompare/onDemandCitations/cacheKey.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/onDemandCitations/contextBuilder.js +2 -0
- package/dist/cjs/features/CognitiveCompare/onDemandCitations/contextBuilder.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/onDemandCitations/href.js +2 -0
- package/dist/cjs/features/CognitiveCompare/onDemandCitations/href.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/onDemandCitations/payload.js +2 -0
- package/dist/cjs/features/CognitiveCompare/onDemandCitations/payload.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/onDemandCitations/response.js +2 -0
- package/dist/cjs/features/CognitiveCompare/onDemandCitations/response.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/utils/normalizeInlineMarkdown.js +2 -0
- package/dist/cjs/features/CognitiveCompare/utils/normalizeInlineMarkdown.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/utils/onDemandCitations.js +2 -0
- package/dist/cjs/features/CognitiveCompare/utils/onDemandCitations.js.map +1 -0
- 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/PdfViewer/PdfToolbar.js +1 -1
- package/dist/cjs/features/PdfViewer/PdfViewer.js +1 -1
- package/dist/cjs/features/PdfViewer/usePdfHighlight.js +1 -1
- package/dist/cjs/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.js +1 -1
- package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/constants/changeTags.js +2 -0
- package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/constants/changeTags.js.map +1 -0
- package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/utils/normalizeRedlineMarkdown.js +2 -0
- package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/utils/normalizeRedlineMarkdown.js.map +1 -0
- package/dist/cjs/features/RequirementAI/components/RichTextEditor/RichTextEditor.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.css.js +2 -0
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.css.js.map +1 -0
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.js +2 -0
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.js.map +1 -0
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.css.js +2 -0
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.css.js.map +1 -0
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.js +2 -0
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.js.map +1 -0
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.css.js +2 -0
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.css.js.map +1 -0
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.js +2 -0
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.js.map +1 -0
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/avatarUtils.js +2 -0
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/avatarUtils.js.map +1 -0
- 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/SegmentReviewComponents/BoundaryCard.js +1 -1
- package/dist/cjs/features/SegmentReviewComponents/CognitiveScoreBadge.js +1 -1
- package/dist/cjs/features/SegmentReviewComponents/RevertSuccessCard.js +1 -1
- package/dist/cjs/features/SegmentReviewComponents/SegmentReviewPdfWrapper.js +1 -1
- package/dist/cjs/features/SegmentReviewComponents/helper.js +1 -1
- package/dist/cjs/features/SegmentReviewComponents/reviewStepAdapters.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/service/redlineService.js +1 -1
- package/dist/features/CognitiveCompare/CitationAnchor.js +1 -1
- package/dist/features/CognitiveCompare/CitationRenderer.js +1 -1
- package/dist/features/CognitiveCompare/CitationRendererInner.js +2 -0
- package/dist/features/CognitiveCompare/CitationRendererInner.js.map +1 -0
- package/dist/features/CognitiveCompare/CognitiveCompare.js +1 -1
- package/dist/features/CognitiveCompare/CognitiveCompareConstants.js +1 -1
- package/dist/features/CognitiveCompare/CognitiveComparehelpers.js +1 -1
- package/dist/features/CognitiveCompare/CognitivePopup.js +1 -1
- package/dist/features/CognitiveCompare/CompareContext.js +1 -1
- package/dist/features/CognitiveCompare/GptWebCitationPanel.js +2 -0
- package/dist/features/CognitiveCompare/GptWebCitationPanel.js.map +1 -0
- 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/useOnDemandCitationCache.js +2 -0
- package/dist/features/CognitiveCompare/hooks/useOnDemandCitationCache.js.map +1 -0
- package/dist/features/CognitiveCompare/hooks/useSideBySide.js +1 -1
- package/dist/features/CognitiveCompare/onDemandCitations/cacheKey.js +2 -0
- package/dist/features/CognitiveCompare/onDemandCitations/cacheKey.js.map +1 -0
- package/dist/features/CognitiveCompare/onDemandCitations/contextBuilder.js +2 -0
- package/dist/features/CognitiveCompare/onDemandCitations/contextBuilder.js.map +1 -0
- package/dist/features/CognitiveCompare/onDemandCitations/href.js +2 -0
- package/dist/features/CognitiveCompare/onDemandCitations/href.js.map +1 -0
- package/dist/features/CognitiveCompare/onDemandCitations/payload.js +2 -0
- package/dist/features/CognitiveCompare/onDemandCitations/payload.js.map +1 -0
- package/dist/features/CognitiveCompare/onDemandCitations/response.js +2 -0
- package/dist/features/CognitiveCompare/onDemandCitations/response.js.map +1 -0
- package/dist/features/CognitiveCompare/utils/normalizeInlineMarkdown.js +2 -0
- package/dist/features/CognitiveCompare/utils/normalizeInlineMarkdown.js.map +1 -0
- package/dist/features/CognitiveCompare/utils/onDemandCitations.js +2 -0
- package/dist/features/CognitiveCompare/utils/onDemandCitations.js.map +1 -0
- 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/PdfViewer/PdfToolbar.js +1 -1
- package/dist/features/PdfViewer/PdfViewer.js +1 -1
- package/dist/features/PdfViewer/usePdfHighlight.js +1 -1
- package/dist/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.js +1 -1
- package/dist/features/RequirementAI/components/RichTextEditor/Editor/constants/changeTags.js +2 -0
- package/dist/features/RequirementAI/components/RichTextEditor/Editor/constants/changeTags.js.map +1 -0
- package/dist/features/RequirementAI/components/RichTextEditor/Editor/utils/normalizeRedlineMarkdown.js +2 -0
- package/dist/features/RequirementAI/components/RichTextEditor/Editor/utils/normalizeRedlineMarkdown.js.map +1 -0
- package/dist/features/RequirementAI/components/RichTextEditor/RichTextEditor.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.css.js +2 -0
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.css.js.map +1 -0
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.js +2 -0
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.js.map +1 -0
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.css.js +2 -0
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.css.js.map +1 -0
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.js +2 -0
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.js.map +1 -0
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.css.js +2 -0
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.css.js.map +1 -0
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.js +2 -0
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.js.map +1 -0
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/avatarUtils.js +2 -0
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/avatarUtils.js.map +1 -0
- 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/SegmentReviewComponents/BoundaryCard.js +1 -1
- package/dist/features/SegmentReviewComponents/CognitiveScoreBadge.js +1 -1
- package/dist/features/SegmentReviewComponents/RevertSuccessCard.js +1 -1
- package/dist/features/SegmentReviewComponents/SegmentReviewPdfWrapper.js +1 -1
- package/dist/features/SegmentReviewComponents/helper.js +1 -1
- package/dist/features/SegmentReviewComponents/reviewStepAdapters.js +1 -1
- package/dist/index.js +1 -1
- package/dist/service/redlineService.js +1 -1
- package/dist/types/src/CognitiveCompareTest.d.ts.map +1 -1
- package/dist/types/src/RedlineEditorTest.d.ts.map +1 -1
- package/dist/types/src/RequirementAiTest.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CitationAnchor.d.ts +2 -0
- package/dist/types/src/features/CognitiveCompare/CitationAnchor.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CitationRenderer.d.ts +8 -1
- package/dist/types/src/features/CognitiveCompare/CitationRenderer.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CitationRendererInner.d.ts +13 -0
- package/dist/types/src/features/CognitiveCompare/CitationRendererInner.d.ts.map +1 -0
- 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/CognitiveCompareConstants.d.ts +1 -1
- package/dist/types/src/features/CognitiveCompare/CognitiveCompareConstants.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CognitiveCompareTypes.d.ts +12 -1
- package/dist/types/src/features/CognitiveCompare/CognitiveCompareTypes.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CognitiveComparehelpers.d.ts +12 -0
- package/dist/types/src/features/CognitiveCompare/CognitiveComparehelpers.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CognitivePopup.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CompareContext.d.ts +9 -1
- package/dist/types/src/features/CognitiveCompare/CompareContext.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/GptWebCitationPanel.d.ts +6 -0
- package/dist/types/src/features/CognitiveCompare/GptWebCitationPanel.d.ts.map +1 -0
- 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 +3028 -891
- 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 +14 -1
- 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 +2 -1
- 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/useOnDemandCitationCache.d.ts +10 -0
- package/dist/types/src/features/CognitiveCompare/hooks/useOnDemandCitationCache.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/hooks/useSideBySide.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/onDemandCitations/cacheKey.d.ts +3 -0
- package/dist/types/src/features/CognitiveCompare/onDemandCitations/cacheKey.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/onDemandCitations/contextBuilder.d.ts +16 -0
- package/dist/types/src/features/CognitiveCompare/onDemandCitations/contextBuilder.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/onDemandCitations/href.d.ts +6 -0
- package/dist/types/src/features/CognitiveCompare/onDemandCitations/href.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/onDemandCitations/index.d.ts +7 -0
- package/dist/types/src/features/CognitiveCompare/onDemandCitations/index.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/onDemandCitations/payload.d.ts +4 -0
- package/dist/types/src/features/CognitiveCompare/onDemandCitations/payload.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/onDemandCitations/response.d.ts +3 -0
- package/dist/types/src/features/CognitiveCompare/onDemandCitations/response.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/onDemandCitations/types.d.ts +134 -0
- package/dist/types/src/features/CognitiveCompare/onDemandCitations/types.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/utils/normalizeInlineMarkdown.d.ts +6 -0
- package/dist/types/src/features/CognitiveCompare/utils/normalizeInlineMarkdown.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/utils/onDemandCitations.d.ts +2 -0
- package/dist/types/src/features/CognitiveCompare/utils/onDemandCitations.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.d.ts +1 -0
- 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 +2 -1
- package/dist/types/src/features/GptWebCitation/GptWebCitationImageCitation.d.ts.map +1 -1
- package/dist/types/src/features/GptWebCitation/types.d.ts +11 -0
- package/dist/types/src/features/GptWebCitation/types.d.ts.map +1 -1
- package/dist/types/src/features/GptWebCitation/utils/fixedHeight.utils.d.ts +2 -0
- package/dist/types/src/features/GptWebCitation/utils/fixedHeight.utils.d.ts.map +1 -1
- package/dist/types/src/features/PdfViewer/PdfToolbar.d.ts.map +1 -1
- package/dist/types/src/features/PdfViewer/PdfViewer.d.ts.map +1 -1
- package/dist/types/src/features/PdfViewer/usePdfHighlight.d.ts +0 -1
- package/dist/types/src/features/PdfViewer/usePdfHighlight.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.d.ts +39 -29
- package/dist/types/src/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/constants/changeTags.d.ts +2 -0
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/constants/changeTags.d.ts.map +1 -0
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/utils/normalizeRedlineMarkdown.d.ts +2 -0
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/utils/normalizeRedlineMarkdown.d.ts.map +1 -0
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/RichTextEditor.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.d.ts +10 -0
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.d.ts.map +1 -0
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.d.ts +17 -0
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.d.ts.map +1 -0
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.d.ts +23 -0
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.d.ts.map +1 -0
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Avatar/avatarUtils.d.ts +3 -0
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Avatar/avatarUtils.d.ts.map +1 -0
- 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 +84 -5439
- 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 +19 -2
- 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 +7 -2
- 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 +15 -1
- 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 +2 -1
- 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 +3 -2
- 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 +1 -0
- 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 +1 -0
- 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/common/onDemandCitationButton.d.ts +12 -0
- package/dist/types/src/features/RequirementAI/components/common/onDemandCitationButton.d.ts.map +1 -0
- package/dist/types/src/features/RequirementAI/components/lsc-reason-gap/CustomChatCrRedirection.d.ts +3 -2
- 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 +3 -1
- 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 +2 -1
- 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 +1 -0
- 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 +2 -0
- 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 +2 -1
- 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 +2 -1
- 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 +2 -0
- 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 +3 -0
- 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 +2 -1
- package/dist/types/src/features/RequirementAI/types/segment.type.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/utils/helpers.d.ts +2 -0
- 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.map +1 -1
- package/dist/types/src/features/SegmentReviewComponents/CognitiveScoreBadge.d.ts.map +1 -1
- package/dist/types/src/features/SegmentReviewComponents/PageCheck.d.ts +0 -6
- package/dist/types/src/features/SegmentReviewComponents/PageCheck.d.ts.map +1 -1
- package/dist/types/src/features/SegmentReviewComponents/RevertSuccessCard.d.ts.map +1 -1
- package/dist/types/src/features/SegmentReviewComponents/SegmentReviewPdfWrapper.d.ts.map +1 -1
- package/dist/types/src/features/SegmentReviewComponents/SegmentReviewRedirectionTest.d.ts.map +1 -1
- package/dist/types/src/features/SegmentReviewComponents/helper.d.ts +4 -2
- package/dist/types/src/features/SegmentReviewComponents/helper.d.ts.map +1 -1
- package/dist/types/src/features/SegmentReviewComponents/index.d.ts +1 -3
- package/dist/types/src/features/SegmentReviewComponents/index.d.ts.map +1 -1
- package/dist/types/src/features/SegmentReviewComponents/reviewStepAdapters.d.ts +1 -2
- package/dist/types/src/features/SegmentReviewComponents/reviewStepAdapters.d.ts.map +1 -1
- package/dist/types/src/service/redlineService.d.ts.map +1 -1
- package/package.json +4 -4
- package/dist/cjs/features/GptWebCitation/GptWebCitationMarkdown.js +0 -2
- package/dist/cjs/features/GptWebCitation/GptWebCitationMarkdown.js.map +0 -1
- package/dist/cjs/features/ParentCitationComponent/ParentCitationComponent.js +0 -2
- package/dist/cjs/features/ParentCitationComponent/ParentCitationComponent.js.map +0 -1
- package/dist/cjs/features/PdfViewer/nyc-components/BoundaryCard.js +0 -2
- package/dist/cjs/features/PdfViewer/nyc-components/BoundaryCard.js.map +0 -1
- package/dist/cjs/features/PdfViewer/nyc-components/CardWrapper.js +0 -2
- package/dist/cjs/features/PdfViewer/nyc-components/CardWrapper.js.map +0 -1
- package/dist/cjs/features/PdfViewer/nyc-components/CognitiveIcon.js +0 -2
- package/dist/cjs/features/PdfViewer/nyc-components/CognitiveIcon.js.map +0 -1
- package/dist/cjs/features/PdfViewer/nyc-components/LabelCheck.js +0 -2
- package/dist/cjs/features/PdfViewer/nyc-components/LabelCheck.js.map +0 -1
- package/dist/cjs/features/PdfViewer/nyc-components/SegmentReviewPdfWrapper.js +0 -2
- package/dist/cjs/features/PdfViewer/nyc-components/SegmentReviewPdfWrapper.js.map +0 -1
- package/dist/cjs/features/PdfViewer/nyc-components/infoAlert.js +0 -2
- package/dist/cjs/features/PdfViewer/nyc-components/infoAlert.js.map +0 -1
- package/dist/cjs/features/PdfViewer/nyc-components/reviewStepAdapters.js +0 -2
- package/dist/cjs/features/PdfViewer/nyc-components/reviewStepAdapters.js.map +0 -1
- package/dist/cjs/features/SegmentReviewComponents/PageTypeChoiceCheck.js +0 -2
- package/dist/cjs/features/SegmentReviewComponents/PageTypeChoiceCheck.js.map +0 -1
- package/dist/cjs/features/SegmentReviewComponents/reviewScore.js +0 -2
- package/dist/cjs/features/SegmentReviewComponents/reviewScore.js.map +0 -1
- package/dist/features/GptWebCitation/GptWebCitationMarkdown.js +0 -2
- package/dist/features/GptWebCitation/GptWebCitationMarkdown.js.map +0 -1
- package/dist/features/ParentCitationComponent/ParentCitationComponent.js +0 -2
- package/dist/features/ParentCitationComponent/ParentCitationComponent.js.map +0 -1
- package/dist/features/PdfViewer/nyc-components/BoundaryCard.js +0 -2
- package/dist/features/PdfViewer/nyc-components/BoundaryCard.js.map +0 -1
- package/dist/features/PdfViewer/nyc-components/CardWrapper.js +0 -2
- package/dist/features/PdfViewer/nyc-components/CardWrapper.js.map +0 -1
- package/dist/features/PdfViewer/nyc-components/CognitiveIcon.js +0 -2
- package/dist/features/PdfViewer/nyc-components/CognitiveIcon.js.map +0 -1
- package/dist/features/PdfViewer/nyc-components/LabelCheck.js +0 -2
- package/dist/features/PdfViewer/nyc-components/LabelCheck.js.map +0 -1
- package/dist/features/PdfViewer/nyc-components/SegmentReviewPdfWrapper.js +0 -2
- package/dist/features/PdfViewer/nyc-components/SegmentReviewPdfWrapper.js.map +0 -1
- package/dist/features/PdfViewer/nyc-components/infoAlert.js +0 -2
- package/dist/features/PdfViewer/nyc-components/infoAlert.js.map +0 -1
- package/dist/features/PdfViewer/nyc-components/reviewStepAdapters.js +0 -2
- package/dist/features/PdfViewer/nyc-components/reviewStepAdapters.js.map +0 -1
- package/dist/features/SegmentReviewComponents/PageTypeChoiceCheck.js +0 -2
- package/dist/features/SegmentReviewComponents/PageTypeChoiceCheck.js.map +0 -1
- package/dist/features/SegmentReviewComponents/reviewScore.js +0 -2
- package/dist/features/SegmentReviewComponents/reviewScore.js.map +0 -1
- package/dist/types/node_modules/react-markdown/lib/complex-types.d.ts +0 -23
- package/dist/types/node_modules/react-markdown/lib/complex-types.d.ts.map +0 -1
- package/dist/types/src/Background.d.ts +0 -7
- package/dist/types/src/Background.d.ts.map +0 -1
- package/dist/types/src/RedlineApprovalCardTest.d.ts +0 -1
- package/dist/types/src/RedlineApprovalCardTest.d.ts.map +0 -1
- package/dist/types/src/RedlineEditorTest2.d.ts +0 -3
- package/dist/types/src/RedlineEditorTest2.d.ts.map +0 -1
- package/dist/types/src/commonConstants.d.ts +0 -31103
- package/dist/types/src/commonConstants.d.ts.map +0 -1
- package/dist/types/src/features/CognitiveCompare/utils/buildComparisonRows.test.d.ts +0 -2
- package/dist/types/src/features/CognitiveCompare/utils/buildComparisonRows.test.d.ts.map +0 -1
- package/dist/types/src/features/ParentCitationComponent/ParentCitationComponent.d.ts +0 -128
- package/dist/types/src/features/ParentCitationComponent/ParentCitationComponent.d.ts.map +0 -1
- package/dist/types/src/features/ParentCitationComponent/ParentCitationComponentTest.d.ts +0 -13
- package/dist/types/src/features/ParentCitationComponent/ParentCitationComponentTest.d.ts.map +0 -1
- package/dist/types/src/features/PdfViewer/nyc-components/BoundaryCard.d.ts +0 -59
- package/dist/types/src/features/PdfViewer/nyc-components/BoundaryCard.d.ts.map +0 -1
- package/dist/types/src/features/PdfViewer/nyc-components/CardWrapper.d.ts +0 -19
- package/dist/types/src/features/PdfViewer/nyc-components/CardWrapper.d.ts.map +0 -1
- package/dist/types/src/features/PdfViewer/nyc-components/CognitiveIcon.d.ts +0 -3
- package/dist/types/src/features/PdfViewer/nyc-components/CognitiveIcon.d.ts.map +0 -1
- package/dist/types/src/features/PdfViewer/nyc-components/LabelCheck.d.ts +0 -77
- package/dist/types/src/features/PdfViewer/nyc-components/LabelCheck.d.ts.map +0 -1
- package/dist/types/src/features/PdfViewer/nyc-components/SegmentReviewPdfWrapper.d.ts +0 -47
- package/dist/types/src/features/PdfViewer/nyc-components/SegmentReviewPdfWrapper.d.ts.map +0 -1
- package/dist/types/src/features/PdfViewer/nyc-components/index.d.ts +0 -15
- package/dist/types/src/features/PdfViewer/nyc-components/index.d.ts.map +0 -1
- package/dist/types/src/features/PdfViewer/nyc-components/infoAlert.d.ts +0 -3
- package/dist/types/src/features/PdfViewer/nyc-components/infoAlert.d.ts.map +0 -1
- package/dist/types/src/features/PdfViewer/nyc-components/reviewStepAdapters.d.ts +0 -36
- package/dist/types/src/features/PdfViewer/nyc-components/reviewStepAdapters.d.ts.map +0 -1
- package/dist/types/src/features/SegmentReviewComponents/PageTypeChoiceCheck.d.ts +0 -28
- package/dist/types/src/features/SegmentReviewComponents/PageTypeChoiceCheck.d.ts.map +0 -1
- package/dist/types/src/features/SegmentReviewComponents/helper.test.d.ts +0 -2
- package/dist/types/src/features/SegmentReviewComponents/helper.test.d.ts.map +0 -1
- package/dist/types/src/features/SegmentReviewComponents/reviewScore.d.ts +0 -4
- package/dist/types/src/features/SegmentReviewComponents/reviewScore.d.ts.map +0 -1
- package/dist/types/src/features/SegmentReviewComponents/segmentReviewEdgeCases.test.d.ts +0 -2
- package/dist/types/src/features/SegmentReviewComponents/segmentReviewEdgeCases.test.d.ts.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__spreadArray as n,__assign as e}from"tslib";import{jsxs as l,jsx as i,Fragment as o}from"react/jsx-runtime";import{useMemo as t,useState as r,useRef as d,useEffect as a}from"react";import{ExternalLink as s,ChevronUp as c,ChevronDown as u}from"lucide-react";import v from"./CognitiveNonWebSearchReasoning.module.css.js";var h=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return n.filter(Boolean).join(" ")},m=function(n){return n.split(/(\*\*.*?\*\*|__.*?__)/g).map(function(n,l){return n.startsWith("**")&&n.endsWith("**")||n.startsWith("__")&&n.endsWith("__")?i("strong",e({className:v.boldText},{children:n.slice(2,-2)}),l):n})},g=function(g){var p=g.item,f=g.headerTitle;g.index;var x=g.iconsConfig,y=g.DocumentTitle,b=g.previewCallback,N=g.bodyHeight,C=g.disableMaximize,I=void 0!==C&&C,k=g.splitterCustomStyle,T=void 0!==k&&k,H=g.themeTokens,L=g.classNames,B=g.styles,w=p.dataSource,z=p.confidence_score,S=p.trainingDataTitle,A=null==x?void 0:x.ChevronDownIcon,F=null==x?void 0:x.ChevronUpIcon,_=null==x?void 0:x.MaximizeIcon,D=null==x?void 0:x.CloseIcon,R=t(function(){var e=(w?w.replace(/\\n/g,"\n").replace(/\n+/g,"\n"):"").split(/(<highlight>[\s\S]*?<\/highlight>)/g),l=0,i=e.map(function(n){var e=n.startsWith("<highlight>"),i={text:e?n.replace(/<\/?highlight>/g,""):n,isHighlight:e,highlightIndex:e?l:-1};return e&&l++,i}),o=i.filter(function(n){return n.isHighlight}).length,t=[],r=[];return i.forEach(function(e){var l=e.text,i=e.isHighlight,o=e.highlightIndex;l.split("\n").forEach(function(e,l){l>0&&((r.length>0||t.length>0)&&t.push(n([],r,!0)),r=[]),e&&r.push({text:e,isHighlight:i,highlightIndex:o})})}),r.length>0&&t.push(n([],r,!0)),{processedLines:t.map(function(n){var e=n.map(function(n){return n.text}).join(""),l=e.match(/^(\s*)(-|\*|\d+\.)\s+(.*)$/);return{segments:n,isListItem:!!l,isHeader:!!e.match(/^(Title|Description|Training-basis):\s*(.*)$/i),indent:(null==l?void 0:l[1])||"",content:(null==l?void 0:l[3])||e}}),totalHighlights:o}},[w]),W=R.processedLines,j=R.totalHighlights,M=r(0),V=M[0],E=M[1],$=d(null),U=d(null),Y=d(null),q=d([]),G=d([]);a(function(){q.current=q.current.slice(0,j),G.current=G.current.slice(0,j)},[j]),a(function(){if(j>0){E(0);var n=setTimeout(function(){var n;null===(n=q.current[0])||void 0===n||n.scrollIntoView({behavior:"smooth",block:"center"})},50);return function(){return clearTimeout(n)}}},[j]);var J=function(n,e){setTimeout(function(){var l=e?G.current[n]:q.current[n];null==l||l.scrollIntoView({behavior:"smooth",block:"center"})},50)},K=function(n){if(void 0===n&&(n=!1),j){var e=V>0?V-1:j-1;E(e),J(e,n)}},O=function(n){if(void 0===n&&(n=!1),j){var e=V<j-1?V+1:0;E(e),J(e,n)}},P=function(n){var o=n?G:q,t=0;return W.map(function(n,r){n.isHeader&&(t=0),n.isListItem&&(t+=1);var d=function(){return n.segments.map(function(l,t){var r=l.isHighlight&&l.highlightIndex===V,d=l.text;return n.isListItem&&0===t&&(d=l.text.replace(/^(\s*)(-|\*|\d+\.)\s+/,"")),l.isHighlight?i("span",e({ref:function(n){n&&(o.current[l.highlightIndex]=n)},className:h(v.highlight,r?v.highlightActive:void 0,null==L?void 0:L.highlight,r?null==L?void 0:L.highlightActive:void 0),style:r?e(e({},null==B?void 0:B.highlight),null==B?void 0:B.highlightActive):null==B?void 0:B.highlight},{children:m(d)}),t):i("span",{children:m(d)},t)})};return n.isHeader?i("span",e({className:h(v.headerLine,null==L?void 0:L.headerLine),style:null==B?void 0:B.headerLine},{children:d()}),r):n.isListItem?l("span",e({className:h(v.listItemLine,null==L?void 0:L.listItemLine),style:e({paddingLeft:n.indent?"1rem":"0"},null==B?void 0:B.listItemLine)},{children:[l("span",e({className:h(v.listCounter,null==L?void 0:L.listCounter),style:null==B?void 0:B.listCounter},{children:[t,"."]})),i("span",{children:d()})]}),r):i("span",e({className:h(v.blockLine,null==L?void 0:L.blockLine),style:null==B?void 0:B.blockLine},{children:d()}),r)})},Q=function(n){return j>1?l("div",e({className:h(n?v.modalNavContainer:v.navigationContainer,n?null==L?void 0:L.modalNavContainer:null==L?void 0:L.navigationContainer),style:n?null==B?void 0:B.modalNavContainer:null==B?void 0:B.navigationContainer},{children:[F&&i("button",e({onClick:function(){return K(n)},className:h(n?v.modalNavButton:v.navButton,null==L?void 0:L.navButton),style:null==B?void 0:B.navButton},{children:i(F,{className:h(v.navIcon,null==L?void 0:L.navIcon),style:null==B?void 0:B.navIcon})})),l("span",e({className:h(v.navCounter,null==L?void 0:L.navCounter),style:null==B?void 0:B.navCounter},{children:[V+1,"/",j]})),A&&i("button",e({onClick:function(){return O(n)},className:h(n?v.modalNavButton:v.navButton,null==L?void 0:L.navButton),style:null==B?void 0:B.navButton},{children:i(A,{className:h(v.navIcon,null==L?void 0:L.navIcon),style:null==B?void 0:B.navIcon})}))]})):null},X=null!=z?l("span",e({className:h(v.confidenceBadge,null==L?void 0:L.confidenceBadge),style:null==B?void 0:B.confidenceBadge},{children:[i("span",e({className:v.confidenceStar},{children:"✦"})),l("span",e({className:v.confidenceScore},{children:[z,"%"]}))]})):null,Z=T?{backgroundColor:"white",padding:"1rem 1.5rem"}:void 0,nn=l(o,{children:[S&&i("div",e({className:h(v.footer,null==L?void 0:L.footer),style:e(e({},Z),null==B?void 0:B.footer)},{children:i("span",e({className:h(v.trainingTitle,null==L?void 0:L.trainingTitle),style:null==B?void 0:B.trainingTitle},{children:S}))})),y&&i("div",e({className:h(v.modalFooterSource,null==L?void 0:L.modalFooterSource),style:e(e({},Z),null==B?void 0:B.modalFooterSource)},{children:l("button",e({type:"button",onClick:function(){return null==b?void 0:b()},className:h(v.trainingTitleLink,null==L?void 0:L.trainingTitleLink),style:null==B?void 0:B.trainingTitleLink},{children:[y,i(s,{size:16,color:"#2563eb"})]}))}))]});return l(o,{children:[l("div",e({className:h(v.expandedContainer,null==L?void 0:L.expandedContainer),style:e(e(e(e({},H),N?{height:"".concat(N),display:"flex",flexDirection:"column"}:void 0),T?{border:"none",borderRadius:0,marginLeft:"0px",marginTop:"0px"}:void 0),null==B?void 0:B.expandedContainer)},{children:[l("div",e({className:h(v.expandedHeader,null==L?void 0:L.expandedHeader),style:e(e({},T?{backgroundColor:"white",padding:"0.5rem 1.5rem"}:void 0),null==B?void 0:B.expandedHeader)},{children:[i("span",e({className:h(v.headerTitle,null==L?void 0:L.headerTitle),style:null==B?void 0:B.headerTitle},{children:f})),l("div",e({className:h(v.headerActions,null==L?void 0:L.headerActions),style:null==B?void 0:B.headerActions},{children:[T?j>1&&l(o,{children:[l("span",e({style:{fontSize:"12px",color:"#888"}},{children:[V+1," / ",j]})),i("button",e({onClick:function(){return K(!0)},disabled:V<=0,style:{padding:"2px 4px",cursor:V<=0?"not-allowed":"pointer",opacity:V<=0?.4:1,border:"1px solid #ddd",borderRadius:"3px",background:"white",display:"flex",alignItems:"center"}},{children:i(c,{size:14,color:"#64748b"})})),i("button",e({onClick:function(){return O(!0)},disabled:V>=j-1,style:{padding:"2px 4px",cursor:V>=j-1?"not-allowed":"pointer",opacity:V>=j-1?.4:1,border:"1px solid #ddd",borderRadius:"3px",background:"white",display:"flex",alignItems:"center"}},{children:i(u,{size:14,color:"#64748b"})}))]}):Q(!1),X,!I&&_&&i("button",e({onClick:function(){var n;return null===(n=Y.current)||void 0===n?void 0:n.showModal()},className:h(v.maximizeButton,null==L?void 0:L.maximizeButton),style:null==B?void 0:B.maximizeButton,title:"View fullscreen"},{children:i(_,{className:v.maximizeIcon})}))]}))]})),i("div",e({ref:$,className:h(v.contentArea,null==L?void 0:L.contentArea),style:e(e(e({},N?{flex:1,maxHeight:"300px",overflowY:"scroll",minHeight:0}:void 0),T?{padding:"1rem 1.5rem"}:void 0),null==B?void 0:B.contentArea)},{children:i("div",e({className:h(v.contentInner,null==L?void 0:L.contentInner),style:null==B?void 0:B.contentInner},{children:P(!1)}))})),nn]})),!I&&i("dialog",e({ref:Y,className:v.modalDialog,onClick:function(n){var e;n.target===Y.current&&(null===(e=Y.current)||void 0===e||e.close())}},{children:l("div",e({className:h(v.modalContainer,null==L?void 0:L.modalContainer),style:null==B?void 0:B.modalContainer},{children:[l("div",e({className:h(v.modalHeader,null==L?void 0:L.modalHeader),style:null==B?void 0:B.modalHeader},{children:[i("span",e({className:h(v.modalHeaderTitle,null==L?void 0:L.modalHeaderTitle),style:null==B?void 0:B.modalHeaderTitle},{children:f})),l("div",e({className:h(v.modalHeaderActions,null==L?void 0:L.modalHeaderActions),style:null==B?void 0:B.modalHeaderActions},{children:[T?j>1&&l(o,{children:[l("span",e({style:{fontSize:"12px",color:"#888"}},{children:[V+1," / ",j]})),i("button",e({onClick:function(){return K(!0)},disabled:V<=0,style:{padding:"2px 4px",cursor:V<=0?"not-allowed":"pointer",opacity:V<=0?.4:1,border:"1px solid #ddd",borderRadius:"3px",background:"white",display:"flex",alignItems:"center"}},{children:i(c,{size:14,color:"#64748b"})})),i("button",e({onClick:function(){return O(!0)},disabled:V>=j-1,style:{padding:"2px 4px",cursor:V>=j-1?"not-allowed":"pointer",opacity:V>=j-1?.4:1,border:"1px solid #ddd",borderRadius:"3px",background:"white",display:"flex",alignItems:"center"}},{children:i(u,{size:14,color:"#64748b"})}))]}):Q(!0),X,D&&i("button",e({onClick:function(){var n;return null===(n=Y.current)||void 0===n?void 0:n.close()},className:h(v.closeButton,null==L?void 0:L.closeButton),style:null==B?void 0:B.closeButton,title:"Close"},{children:i(D,{className:h(v.closeIcon,null==L?void 0:L.closeIcon),style:null==B?void 0:B.closeIcon})}))]}))]})),i("div",e({ref:U,className:h(v.modalContent,null==L?void 0:L.modalContent),style:null==B?void 0:B.modalContent},{children:i("div",e({className:h(v.modalContentInner,null==L?void 0:L.modalContentInner),style:null==B?void 0:B.modalContentInner},{children:P(!0)}))})),S&&i("div",e({className:h(v.modalFooter,null==L?void 0:L.modalFooter),style:null==B?void 0:B.modalFooter},{children:i("span",e({className:h(v.trainingTitle,null==L?void 0:L.trainingTitle),style:null==B?void 0:B.trainingTitle},{children:S}))})),y&&i("div",e({className:h(v.modalFooterSource,null==L?void 0:L.modalFooterSource),style:null==B?void 0:B.modalFooterSource},{children:l("button",e({type:"button",onClick:function(){var n;null==b||b(),null===(n=Y.current)||void 0===n||n.close()},className:h(v.trainingTitleLink,null==L?void 0:L.trainingTitleLink),style:null==B?void 0:B.trainingTitleLink},{children:[y,i(s,{size:16,color:"#2563eb"})]}))}))]}))}))]})};export{g as default};
|
|
1
|
+
import{__spreadArray as n,__assign as e}from"tslib";import{jsxs as l,jsx as i,Fragment as o}from"react/jsx-runtime";import{useMemo as t,useState as r,useRef as d,useEffect as a}from"react";import{ExternalLink as c,ChevronUp as s,ChevronDown as u}from"lucide-react";import v from"./CognitiveNonWebSearchReasoning.module.css.js";var h=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return n.filter(Boolean).join(" ")},m=function(n){return n.split(/(\*\*.*?\*\*|__.*?__)/g).map(function(n,l){return n.startsWith("**")&&n.endsWith("**")||n.startsWith("__")&&n.endsWith("__")?i("strong",e({className:v.boldText},{children:n.slice(2,-2)}),l):n})},g=function(g){var p=g.item,f=g.headerTitle;g.index;var x=g.iconsConfig,y=g.DocumentTitle,b=g.previewCallback,C=g.bodyHeight,N=g.disableMaximize,I=void 0!==N&&N,k=g.onFullscreenChange,T=g.splitterCustomStyle,H=void 0!==T&&T,L=g.themeTokens,B=g.classNames,w=g.styles,z=p.dataSource,S=p.confidence_score,A=p.trainingDataTitle,F=null==x?void 0:x.ChevronDownIcon,_=null==x?void 0:x.ChevronUpIcon,D=null==x?void 0:x.MaximizeIcon,R=null==x?void 0:x.CloseIcon,W=t(function(){var e=(z?z.replace(/\\n/g,"\n").replace(/\n+/g,"\n"):"").split(/(<highlight>[\s\S]*?<\/highlight>)/g),l=0,i=e.map(function(n){var e=n.startsWith("<highlight>"),i={text:e?n.replace(/<\/?highlight>/g,""):n,isHighlight:e,highlightIndex:e?l:-1};return e&&l++,i}),o=i.filter(function(n){return n.isHighlight}).length,t=[],r=[];return i.forEach(function(e){var l=e.text,i=e.isHighlight,o=e.highlightIndex;l.split("\n").forEach(function(e,l){l>0&&((r.length>0||t.length>0)&&t.push(n([],r,!0)),r=[]),e&&r.push({text:e,isHighlight:i,highlightIndex:o})})}),r.length>0&&t.push(n([],r,!0)),{processedLines:t.map(function(n){var e=n.map(function(n){return n.text}).join(""),l=e.match(/^(\s*)(-|\*|\d+\.)\s+(.*)$/);return{segments:n,isListItem:!!l,isHeader:!!e.match(/^(Title|Description|Training-basis):\s*(.*)$/i),indent:(null==l?void 0:l[1])||"",content:(null==l?void 0:l[3])||e}}),totalHighlights:o}},[z]),j=W.processedLines,M=W.totalHighlights,V=r(0),E=V[0],$=V[1],U=d(null),Y=d(null),q=d(null),G=d([]),J=d([]);a(function(){G.current=G.current.slice(0,M),J.current=J.current.slice(0,M)},[M]),a(function(){if(M>0){$(0);var n=setTimeout(function(){var n;null===(n=G.current[0])||void 0===n||n.scrollIntoView({behavior:"smooth",block:"center"})},50);return function(){return clearTimeout(n)}}},[M]),a(function(){return function(){var n;(null===(n=q.current)||void 0===n?void 0:n.open)&&(null==k||k(!1))}},[k]);var K=function(n,e){setTimeout(function(){var l=e?J.current[n]:G.current[n];null==l||l.scrollIntoView({behavior:"smooth",block:"center"})},50)},O=function(n){if(void 0===n&&(n=!1),M){var e=E>0?E-1:M-1;$(e),K(e,n)}},P=function(n){if(void 0===n&&(n=!1),M){var e=E<M-1?E+1:0;$(e),K(e,n)}},Q=function(n){var o=n?J:G,t=0;return j.map(function(n,r){n.isHeader&&(t=0),n.isListItem&&(t+=1);var d=function(){return n.segments.map(function(l,t){var r=l.isHighlight&&l.highlightIndex===E,d=l.text;return n.isListItem&&0===t&&(d=l.text.replace(/^(\s*)(-|\*|\d+\.)\s+/,"")),l.isHighlight?i("span",e({ref:function(n){n&&(o.current[l.highlightIndex]=n)},className:h(v.highlight,r?v.highlightActive:void 0,null==B?void 0:B.highlight,r?null==B?void 0:B.highlightActive:void 0),style:r?e(e({},null==w?void 0:w.highlight),null==w?void 0:w.highlightActive):null==w?void 0:w.highlight},{children:m(d)}),t):i("span",{children:m(d)},t)})};return n.isHeader?i("span",e({className:h(v.headerLine,null==B?void 0:B.headerLine),style:null==w?void 0:w.headerLine},{children:d()}),r):n.isListItem?l("span",e({className:h(v.listItemLine,null==B?void 0:B.listItemLine),style:e({paddingLeft:n.indent?"1rem":"0"},null==w?void 0:w.listItemLine)},{children:[l("span",e({className:h(v.listCounter,null==B?void 0:B.listCounter),style:null==w?void 0:w.listCounter},{children:[t,"."]})),i("span",{children:d()})]}),r):i("span",e({className:h(v.blockLine,null==B?void 0:B.blockLine),style:null==w?void 0:w.blockLine},{children:d()}),r)})},X=function(n){return M>1?l("div",e({className:h(n?v.modalNavContainer:v.navigationContainer,n?null==B?void 0:B.modalNavContainer:null==B?void 0:B.navigationContainer),style:n?null==w?void 0:w.modalNavContainer:null==w?void 0:w.navigationContainer},{children:[_&&i("button",e({onClick:function(){return O(n)},className:h(n?v.modalNavButton:v.navButton,null==B?void 0:B.navButton),style:null==w?void 0:w.navButton},{children:i(_,{className:h(v.navIcon,null==B?void 0:B.navIcon),style:null==w?void 0:w.navIcon})})),l("span",e({className:h(v.navCounter,null==B?void 0:B.navCounter),style:null==w?void 0:w.navCounter},{children:[E+1,"/",M]})),F&&i("button",e({onClick:function(){return P(n)},className:h(n?v.modalNavButton:v.navButton,null==B?void 0:B.navButton),style:null==w?void 0:w.navButton},{children:i(F,{className:h(v.navIcon,null==B?void 0:B.navIcon),style:null==w?void 0:w.navIcon})}))]})):null},Z=null!=S?l("span",e({className:h(v.confidenceBadge,null==B?void 0:B.confidenceBadge),style:null==w?void 0:w.confidenceBadge},{children:[i("span",e({className:v.confidenceStar},{children:"✦"})),l("span",e({className:v.confidenceScore},{children:[S,"%"]}))]})):null,nn=H?{backgroundColor:"white",padding:"1rem 1.5rem"}:void 0,en=l(o,{children:[A&&i("div",e({className:h(v.footer,null==B?void 0:B.footer),style:e(e({},nn),null==w?void 0:w.footer)},{children:i("span",e({className:h(v.trainingTitle,null==B?void 0:B.trainingTitle),style:null==w?void 0:w.trainingTitle},{children:A}))})),y&&i("div",e({className:h(v.modalFooterSource,null==B?void 0:B.modalFooterSource),style:e(e({},nn),null==w?void 0:w.modalFooterSource)},{children:l("button",e({type:"button",onClick:function(){return null==b?void 0:b()},className:h(v.trainingTitleLink,null==B?void 0:B.trainingTitleLink),style:null==w?void 0:w.trainingTitleLink},{children:[y,i(c,{size:16,color:"#2563eb"})]}))}))]});return l(o,{children:[l("div",e({className:h(v.expandedContainer,null==B?void 0:B.expandedContainer),style:e(e(e(e({},L),C?{height:"".concat(C),display:"flex",flexDirection:"column"}:void 0),H?{border:"none",borderRadius:0,marginLeft:"0px",marginTop:"0px"}:void 0),null==w?void 0:w.expandedContainer)},{children:[l("div",e({className:h(v.expandedHeader,null==B?void 0:B.expandedHeader),style:e(e({},H?{backgroundColor:"white",padding:"0.5rem 1.5rem"}:void 0),null==w?void 0:w.expandedHeader)},{children:[i("span",e({className:h(v.headerTitle,null==B?void 0:B.headerTitle),style:null==w?void 0:w.headerTitle},{children:f})),l("div",e({className:h(v.headerActions,null==B?void 0:B.headerActions),style:null==w?void 0:w.headerActions},{children:[H?M>1&&l(o,{children:[l("span",e({style:{fontSize:"12px",color:"#888"}},{children:[E+1," / ",M]})),i("button",e({onClick:function(){return O(!0)},disabled:E<=0,style:{padding:"2px 4px",cursor:E<=0?"not-allowed":"pointer",opacity:E<=0?.4:1,border:"1px solid #ddd",borderRadius:"3px",background:"white",display:"flex",alignItems:"center"}},{children:i(s,{size:14,color:"#64748b"})})),i("button",e({onClick:function(){return P(!0)},disabled:E>=M-1,style:{padding:"2px 4px",cursor:E>=M-1?"not-allowed":"pointer",opacity:E>=M-1?.4:1,border:"1px solid #ddd",borderRadius:"3px",background:"white",display:"flex",alignItems:"center"}},{children:i(u,{size:14,color:"#64748b"})}))]}):X(!1),Z,!I&&D&&i("button",e({onClick:function(){var n;null==k||k(!0),null===(n=q.current)||void 0===n||n.showModal()},className:h(v.maximizeButton,null==B?void 0:B.maximizeButton),style:null==w?void 0:w.maximizeButton,title:"View fullscreen"},{children:i(D,{className:v.maximizeIcon})}))]}))]})),i("div",e({ref:U,className:h(v.contentArea,null==B?void 0:B.contentArea),style:e(e(e({},C?{flex:1,maxHeight:"300px",overflowY:"scroll",minHeight:0}:void 0),H?{padding:"1rem 1.5rem"}:void 0),null==w?void 0:w.contentArea)},{children:i("div",e({className:h(v.contentInner,null==B?void 0:B.contentInner),style:null==w?void 0:w.contentInner},{children:Q(!1)}))})),en]})),!I&&i("dialog",e({ref:q,className:v.modalDialog,onClose:function(){return null==k?void 0:k(!1)},onClick:function(n){var e;n.target===q.current&&(null===(e=q.current)||void 0===e||e.close())}},{children:l("div",e({className:h(v.modalContainer,null==B?void 0:B.modalContainer),style:null==w?void 0:w.modalContainer},{children:[l("div",e({className:h(v.modalHeader,null==B?void 0:B.modalHeader),style:null==w?void 0:w.modalHeader},{children:[i("span",e({className:h(v.modalHeaderTitle,null==B?void 0:B.modalHeaderTitle),style:null==w?void 0:w.modalHeaderTitle},{children:f})),l("div",e({className:h(v.modalHeaderActions,null==B?void 0:B.modalHeaderActions),style:null==w?void 0:w.modalHeaderActions},{children:[H?M>1&&l(o,{children:[l("span",e({style:{fontSize:"12px",color:"#888"}},{children:[E+1," / ",M]})),i("button",e({onClick:function(){return O(!0)},disabled:E<=0,style:{padding:"2px 4px",cursor:E<=0?"not-allowed":"pointer",opacity:E<=0?.4:1,border:"1px solid #ddd",borderRadius:"3px",background:"white",display:"flex",alignItems:"center"}},{children:i(s,{size:14,color:"#64748b"})})),i("button",e({onClick:function(){return P(!0)},disabled:E>=M-1,style:{padding:"2px 4px",cursor:E>=M-1?"not-allowed":"pointer",opacity:E>=M-1?.4:1,border:"1px solid #ddd",borderRadius:"3px",background:"white",display:"flex",alignItems:"center"}},{children:i(u,{size:14,color:"#64748b"})}))]}):X(!0),Z,R&&i("button",e({onClick:function(){var n;return null===(n=q.current)||void 0===n?void 0:n.close()},className:h(v.closeButton,null==B?void 0:B.closeButton),style:null==w?void 0:w.closeButton,title:"Close"},{children:i(R,{className:h(v.closeIcon,null==B?void 0:B.closeIcon),style:null==w?void 0:w.closeIcon})}))]}))]})),i("div",e({ref:Y,className:h(v.modalContent,null==B?void 0:B.modalContent),style:null==w?void 0:w.modalContent},{children:i("div",e({className:h(v.modalContentInner,null==B?void 0:B.modalContentInner),style:null==w?void 0:w.modalContentInner},{children:Q(!0)}))})),A&&i("div",e({className:h(v.modalFooter,null==B?void 0:B.modalFooter),style:null==w?void 0:w.modalFooter},{children:i("span",e({className:h(v.trainingTitle,null==B?void 0:B.trainingTitle),style:null==w?void 0:w.trainingTitle},{children:A}))})),y&&i("div",e({className:h(v.modalFooterSource,null==B?void 0:B.modalFooterSource),style:null==w?void 0:w.modalFooterSource},{children:l("button",e({type:"button",onClick:function(){var n;null==b||b(),null===(n=q.current)||void 0===n||n.close()},className:h(v.trainingTitleLink,null==B?void 0:B.trainingTitleLink),style:null==w?void 0:w.trainingTitleLink},{children:[y,i(c,{size:16,color:"#2563eb"})]}))}))]}))}))]})};export{g as default};
|
|
2
2
|
//# sourceMappingURL=CognitiveInternalgptCoreComponent.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as i}from"tslib";import{jsx as t,jsxs as e,Fragment as n}from"react/jsx-runtime";import{useMemo as o,useState as l,useCallback as a}from"react";import{Sparkles as r,Globe as s}from"lucide-react";import d from"../CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.js";import u from"./GptWebCitationImageCitation.js";import c from"./GptWebCitationSkeleton.js";import{allowsGptCitationView as v,allowsWebCitationView as
|
|
1
|
+
import{__assign as i}from"tslib";import{jsx as t,jsxs as e,Fragment as n}from"react/jsx-runtime";import{useMemo as o,useState as l,useCallback as a}from"react";import{Sparkles as r,Globe as s}from"lucide-react";import d from"../CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.js";import u from"./GptWebCitationImageCitation.js";import c from"./GptWebCitationSkeleton.js";import{allowsGptCitationView as v,allowsWebCitationView as g,showsCitationViewToggle as p,CitationType as m}from"./types.js";import{mapCitationDataToDisplay as b,resolveSkeletonVisitUrl as C,getWebCitationImageUrl as w}from"./utils/citationData.utils.js";import{resolveWebCitationVisitLinkStyles as h}from"./utils/styleOverrides.utils.js";import{resolveFixedHeightLayout as f,getFixedPanelStyle as k,getParentHeightPanelStyle as y,getParentHeightGptBodyHeight as x,getFixedWebContentStyle as F}from"./utils/fixedHeight.utils.js";import I from"./GptWebCitation.module.css.js";import B from"../../assests/svg/NeuralNetworkIcon.js";var S=function(o){var l=o.variant,a=o.disabled,r=o.onClick,d=o.title,u=o.style;return t("button",i({type:"button",className:I.webCitationButton,onClick:r,disabled:a,title:d,style:u},{children:e(n,"gpt"===l?{children:[t(B,{className:I.webCitationButtonIcon}),"View GPT Citation"]}:{children:[t(s,{size:24,className:I.webCitationButtonIcon}),"View Web Citation"]})}))},H=function(n){var s,B,H,L,N=n.gptCitation,W=n.defaultCitationUrl,j=n.citationType,T=n.webCitationData,E=n.topic,V=n.sourceLabel,z=n.relevanceScore,G=n.learnedFrom,A=n.webCitationStatus,M=n.onGenerateWebCitation,P=n.showWebCitation,U=n.onToggleCitationView,D=n.showExpandImageButton,O=void 0===D||D,R=n.onFullscreenChange,q=n.showGptMaximizeButton,J=n.iconsConfig,K=n.isFixedHeight,Q=void 0!==K&&K,X=n.useParentHeight,Y=void 0!==X&&X,Z=n.styles,$=o(function(){return function(t){var e,n,o,l,a,r,s,d,u,c,v;return{container:null==t?void 0:t.container,gptWrapper:i(i({},null===(e=null==t?void 0:t.gptCitation)||void 0===e?void 0:e.wrapper),null==t?void 0:t.gptCitationWrapper),gptFooterAction:i(i({},null===(n=null==t?void 0:t.gptCitation)||void 0===n?void 0:n.footerAction),null==t?void 0:t.footerAction),gptToggleButton:i(i({},null===(o=null==t?void 0:t.gptCitation)||void 0===o?void 0:o.toggleButton),null==t?void 0:t.webCitationButton),webPanel:i(i({},null==t?void 0:t.container),null===(l=null==t?void 0:t.webCitation)||void 0===l?void 0:l.panel),webHeader:null===(a=null==t?void 0:t.webCitation)||void 0===a?void 0:a.header,webContent:null===(r=null==t?void 0:t.webCitation)||void 0===r?void 0:r.content,webFooter:null===(s=null==t?void 0:t.webCitation)||void 0===s?void 0:s.footer,webToggleButton:i(i({},null===(d=null==t?void 0:t.webCitation)||void 0===d?void 0:d.toggleButton),null==t?void 0:t.webCitationButton),webLearnedFrom:null===(u=null==t?void 0:t.webCitation)||void 0===u?void 0:u.learnedFrom,webImage:null===(c=null==t?void 0:t.webCitation)||void 0===c?void 0:c.image,webSkeleton:null===(v=null==t?void 0:t.webCitation)||void 0===v?void 0:v.skeleton,webImageVisitLink:h(null==t?void 0:t.webCitation,"image"),webSkeletonVisitLink:h(null==t?void 0:t.webCitation,"skeleton")}}(Z)},[Z]),_=v(j),ii=g(j),ti=p(j),ei=Q||Y,ni=o(function(){return Q?f(N.bodyHeight,ti):null},[Q,N.bodyHeight,ti]),oi=o(function(){return ni?k(ni.panelHeight):void 0},[ni]),li=o(function(){return Y?y():void 0},[Y]),ai=null!=li?li:oi,ri=o(function(){var i,t;return{MaximizeIcon:null!==(i=null==J?void 0:J.MaximizeIcon)&&void 0!==i?i:null===(t=N.iconsConfig)||void 0===t?void 0:t.MaximizeIcon,ExternalLinkIcon:null==J?void 0:J.ExternalLinkIcon}},[J,null===(s=N.iconsConfig)||void 0===s?void 0:s.MaximizeIcon]),si=o(function(){var t=Y?{bodyHeight:x(ti)}:Q&&ni?{bodyHeight:ni.gptBodyHeight}:{};return i(i(i(i({},N),t),{disableMaximize:void 0!==q?!q:N.disableMaximize}),ti||j===m.WEB?{DocumentTitle:void 0,previewCallback:void 0}:{})},[N,q,ti,j,Y,Q,ni]),di=l(j!==m.GPT),ui=di[0],ci=di[1],vi=j!==m.GPT&&(j===m.WEB||(null!=P?P:ui)),gi=void 0!==P,pi=o(function(){return T?b(T):null},[T]),mi=null!==(B=null!=E?E:null==pi?void 0:pi.topic)&&void 0!==B?B:"Web Citation",bi=null!==(H=null!=z?z:null==pi?void 0:pi.relevanceScore)&&void 0!==H?H:0,Ci=null!=G?G:null==pi?void 0:pi.learnedFrom,wi=C(null==pi?void 0:pi.highlightedUrl,null!==(L=null==pi?void 0:pi.citationUrl)&&void 0!==L?L:W),hi=w(T),fi=o(function(){return function(i,t,e){return e?"success":i||(t?"error":"pending")}(A,T,hi)},[A,T,hi]),ki=a(function(){U?U():gi||ci(!1)},[U,gi]),yi=a(function(){U?U():gi||ci(!0),hi||"success"===fi||null==M||M()},[U,gi,hi,fi,M]),xi=null!=V?V:"Source: Web Citation > ".concat(mi),Fi=function(n){var o=!!si.DocumentTitle,l=[I.gptCitationWrapper,o?I.gptCitationWrapperWithSource:"",ei?I.gptCitationWrapperFixedHeight:""].filter(Boolean).join(" ");return e("div",i({className:l,style:i(i({},$.gptWrapper),ai)},{children:[t(d,i({},si,{splitterCustomStyle:!0,onFullscreenChange:R})),n&&t("div",i(o?{className:I.gptCitationFooterAction,style:$.gptFooterAction}:{className:[I.gptCitationToggleFooter,ei?I.gptCitationToggleFooterFixedHeight:""].filter(Boolean).join(" "),style:$.gptFooterAction},{children:n}))]}))};return _&&!vi?t("div",i({className:I.overlay,style:i(i({},$.container),li)},{children:Fi(ti?t(S,{variant:"web",onClick:yi,title:"View web-based citation for this source.",style:$.gptToggleButton}):void 0)})):ii?e("div",i({className:[I.panel,ei?I.gptCitationWrapperFixedHeight:""].filter(Boolean).join(" "),style:i(i({},$.webPanel),ai)},{children:[e("div",i({className:I.panelHeader,style:$.webHeader},{children:[t("span",i({className:I.panelSource},{children:xi})),t("div",i({className:I.panelHeaderActions},{children:bi>0&&e("div",i({className:I.confidenceBadge,title:"Decision strength"},{children:[t(r,{size:14}),bi,"%"]}))}))]})),t("div",i({className:[I.panelContent,I.panelContentExpanded,ei?I.panelContentFixedHeight:""].filter(Boolean).join(" "),style:i(i({},$.webContent),ei?F():void 0)},{children:"pending"===fi?t(c,{status:"pending",citationUrl:wi,ExternalLinkIcon:ri.ExternalLinkIcon,styles:$.webSkeleton,visitLinkStyles:$.webSkeletonVisitLink,isFixedHeight:ei}):"success"===fi&&hi?t(u,{citationImage:hi,citationUrl:wi,showExpandImageButton:O,iconsConfig:ri,styles:$.webImage,visitLinkStyles:$.webImageVisitLink,skeletonStyles:$.webSkeleton,skeletonVisitLinkStyles:$.webSkeletonVisitLink,isFixedHeight:ei,onFullscreenChange:R}):t(c,{status:"error",citationUrl:wi,ExternalLinkIcon:ri.ExternalLinkIcon,styles:$.webSkeleton,visitLinkStyles:$.webSkeletonVisitLink,isFixedHeight:ei})})),e("div",i({className:I.panelFooter,style:$.webFooter},{children:[ti?t(S,{variant:"gpt",onClick:ki,style:$.webToggleButton}):null,Ci&&e("span",i({className:I.learnedFrom,style:$.webLearnedFrom},{children:["Learned From ",Ci]}))]}))]})):t("div",i({className:I.overlay,style:i(i({},$.container),li)},{children:Fi()}))};export{H as default};
|
|
2
2
|
//# sourceMappingURL=GptWebCitation.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as i}from"tslib";import{jsxs as e,jsx as
|
|
1
|
+
import{__assign as i}from"tslib";import{jsxs as e,jsx as n}from"react/jsx-runtime";import{useState as t,useRef as l,useEffect as o}from"react";import{Maximize2 as r,ExternalLink as a}from"lucide-react";import s from"./GptWebCitationImageFullScreenView.js";import c from"./GptWebCitationSkeleton.js";import{sanitizeExternalUrl as d}from"./utils/citationData.utils.js";import u from"./GptWebCitation.module.css.js";var m=function(m){var v,g,p=m.citationImage,f=m.citationUrl,C=m.skeletonVisitUrl,h=m.showExpandImageButton,k=void 0===h||h,y=m.iconsConfig,x=m.styles,w=m.visitLinkStyles,I=m.skeletonStyles,b=m.skeletonVisitLinkStyles,j=m.isFixedHeight,L=void 0!==j&&j,N=m.onFullscreenChange,S=null!==(v=null==y?void 0:y.MaximizeIcon)&&void 0!==v?v:r,B=null!==(g=null==y?void 0:y.ExternalLinkIcon)&&void 0!==g?g:a,F=t(!1),H=F[0],V=F[1],W=t("loading"),E=W[0],z=W[1],G=l(!1);o(function(){var i=!0;G.current&&(G.current=!1,null==N||N(!1)),z("loading"),V(!1);var e=new Image;return e.onload=function(){i&&z("loaded")},e.onerror=function(){i&&z("error")},e.src=p,function(){i=!1,e.onload=null,e.onerror=null}},[p,N]),o(function(){return function(){G.current&&(G.current=!1,null==N||N(!1))}},[N]);var U="loaded"===E,D=d(f);return e("div",i({className:[u.imageCitationWrapper,L?u.imageCitationWrapperFixedHeight:""].filter(Boolean).join(" "),style:null==x?void 0:x.wrapper},{children:[n("div",i({className:[u.imageCitationCenter,L?u.imageCitationCenterFixedHeight:""].filter(Boolean).join(" "),style:null==x?void 0:x.center},{children:U?e("div",i({className:[u.imageCitationViewport,L?u.imageCitationViewportFixedHeight:""].filter(Boolean).join(" "),style:null==x?void 0:x.viewport},{children:[n("div",i({className:[u.imageCitationScrollContainer,L?u.imageCitationScrollContainerFixedHeight:""].filter(Boolean).join(" "),style:null==x?void 0:x.scrollContainer},{children:n("img",{src:p,alt:"Web citation snapshot",className:[u.citationImage,L?u.citationImageContained:""].filter(Boolean).join(" "),style:null==x?void 0:x.image})})),k&&n("button",i({type:"button",onClick:function(i){i.stopPropagation(),G.current=!0,null==N||N(!0),V(!0)},className:u.expandImageButton,style:null==x?void 0:x.expandButton,"aria-label":"View citation image in full screen",title:"Expand image"},{children:n(S,{size:16,strokeWidth:2})}))]})):n(c,{status:"error"===E?"error":"pending",citationUrl:null!=C?C:f,ExternalLinkIcon:null==y?void 0:y.ExternalLinkIcon,styles:I,visitLinkStyles:b,isFixedHeight:L})})),D&&U&&e("div",i({className:u.visitLinkRow,style:null==w?void 0:w.row},{children:[n("span",i({className:u.visitLinkHint,style:null==w?void 0:w.hint},{children:"Open link in new tab to read in detail"})),e("a",i({href:D,target:"_blank",rel:"noreferrer",className:u.visitLink,style:null==w?void 0:w.link},{children:["Visit Link",n(B,{size:16})]}))]})),H&&U&&n(s,{src:p,onClose:function(){G.current=!1,null==N||N(!1),V(!1)},styles:null==x?void 0:x.fullScreen})]}))};export{m as default};
|
|
2
2
|
//# sourceMappingURL=GptWebCitationImageCitation.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var e="520px",
|
|
1
|
+
var e="520px",n="3.25rem",t=function(t,i){if(void 0===i&&(i=!0),!i){var o=null!=t?t:e;return{contentHeight:o,gptBodyHeight:o,panelHeight:o}}if(t)return{contentHeight:t,gptBodyHeight:t,panelHeight:"calc(".concat(t," + ").concat(n,")")};var c="calc(".concat(e," - ").concat(n,")");return{contentHeight:c,gptBodyHeight:c,panelHeight:e}},i=function(e){return{height:e,minHeight:e,maxHeight:e,width:"100%",display:"flex",flexDirection:"column",overflow:"hidden",boxSizing:"border-box"}},o=function(){return{height:"100%",minHeight:0,width:"100%",display:"flex",flexDirection:"column",overflow:"hidden",boxSizing:"border-box"}},c=function(e){return void 0===e&&(e=!0),e?"calc(100% - ".concat(n,")"):"100%"},r=function(){return{flex:1,minHeight:0,maxHeight:"none",overflow:"hidden",display:"flex",flexDirection:"column"}};export{i as getFixedPanelStyle,r as getFixedWebContentStyle,c as getParentHeightGptBodyHeight,o as getParentHeightPanelStyle,t as resolveFixedHeightLayout};
|
|
2
2
|
//# sourceMappingURL=fixedHeight.utils.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsxs as t,jsx as n}from"react/jsx-runtime";import o from"react";import{pdfStyles as
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as t,jsx as n}from"react/jsx-runtime";import o from"react";import{pdfStyles as i}from"./PdfStyle.js";import{DefaultPdfIcon as r,DefaultFullScreenIcon as l,DefaultDownloadIcon as a,DefaultCloseIcon as d}from"../../assests/svg/PdfViewerIcons.js";import c from"@mui/material/Tooltip";import{Info as s}from"lucide-react";import p from"@mui/icons-material/RotateRight";var u=function(u){u.highlightIndex;var h=u.totalHighlights,g=u.controls,f=u.currentPosition,x=u.pdfName,m=u.onClose,v=u.pdfUrl,y=u.viewerRef,b=u.customStyles,w=u.customClasses,k=u.customIcons,S=u.headerAction,F=u.isZoomEnabled,I=void 0===F||F,C=u.showHighlightsAction,W=void 0===C||C,D=u.showFullScreenAction,E=void 0===D||D,R=u.currentSegment,T=u.segmentTooltipText,B=void 0===T?"Details of current segment":T,j=u.currentPage,L=u.totalPages,P=u.onPageNavigate,z=u.onRotatePage,A=u.currentPageRotation,N=void 0===A?0:A,H=u.showRotateButton,M=void 0===H||H,O=g.ZoomInButton,Z=g.ZoomOutButton,_=g.ZoomPopover,G=g.goToPrevious,V=g.goToNext,q=o.useState(String(j)),K=q[0],U=q[1];o.useEffect(function(){U(String(j))},[j]);var X={padding:"4px",borderRadius:"6px",background:"transparent",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s ease",flexShrink:0},Y=function(e){return String(e).padStart(2,"0")};return t("div",e({style:e(e(e({marginBottom:"12px",background:"#FAFAFA",borderBottom:"1px solid #F3F4F6",borderTopLeftRadius:"12px",borderTopRightRadius:"12px"},i.header),null==b?void 0:b.header),{display:"flex",flexDirection:"column",alignItems:"stretch",gap:"12px"})},{children:[t("div",e({style:{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",columnGap:"16px",rowGap:"12px",minWidth:0}},{children:[t("div",e({style:{display:"flex",alignItems:"center",gap:"12px",flex:"1 1 180px",minWidth:0}},{children:[n("div",e({style:e(e(e({},{borderRadius:"21px",border:"6px solid #E8F3FF",background:"#D5E8FF",display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",boxSizing:"content-box"}),null==b?void 0:b.pdfIconWrapper),{flexShrink:0})},{children:(null==k?void 0:k.pdfIcon)||n(r,{})})),n(c,e({title:x||"",arrow:!0,placement:"top"},{children:n("div",e({style:{flex:1,minWidth:0,overflow:"hidden"}},{children:n("span",e({style:e({display:"block",width:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",fontWeight:500,cursor:"default"},null==b?void 0:b.pdfName),className:null==w?void 0:w.pdfName},{children:x}))}))}))]})),t("div",e({style:{display:"flex",alignItems:"center",gap:W?"16px":"2px",color:"#4B5563",flex:"0 1 auto",marginLeft:"auto",whiteSpace:"nowrap",minWidth:0,maxWidth:"100%",overflowX:"auto",overflowY:"hidden",scrollbarWidth:"thin"}},{children:[L>0&&t("div",e({style:{display:"flex",alignItems:"center",gap:"4px",color:"#475467",flexShrink:0,whiteSpace:"nowrap"}},{children:[n("input",{"aria-label":"Current page",inputMode:"numeric",pattern:"[0-9]*",value:K,onChange:function(e){var t=e.target.value.replace(/\D/g,"");U(t)},onBlur:function(){var e=Number(K);if(!Number.isInteger(e)||e<1)U(String(j));else{var t=L?Math.min(e,L):e;P(t),U(String(t))}},onKeyDown:function(e){"Enter"===e.key&&e.currentTarget.blur(),"Escape"===e.key&&(U(String(j)),e.currentTarget.blur())},style:{width:"40px",height:"28px",border:"1px solid #E5E7EB",borderRadius:"4px",background:"#FFFFFF",color:"#111827",fontSize:"14px",fontWeight:500,textAlign:"center",outline:"none",boxSizing:"border-box"}}),n("span",e({style:{fontSize:"14px",fontWeight:500,color:"#111827"}},{children:"/"})),n("span",e({style:{fontSize:"14px",fontWeight:500,color:"#111827"}},{children:String(L)}))]})),I&&t("div",e({style:{display:"flex",alignItems:"center",gap:"4px"}},{children:[n(Z,{}),n("div",e({style:{fontSize:"14px",fontWeight:500,width:"56px",textAlign:"center"}},{children:n(_,{})})),n(O,{})]})),M&&z&&L>0&&n(c,e({title:"Rotate page (".concat(N,"°)")},{children:n("button",e({onClick:function(){z&&"function"==typeof z&&z()},style:{background:"none",border:"none",cursor:"pointer",padding:"2px 4px",color:0!==N?"#1976d2":"#475467",display:"flex",alignItems:"center",justifyContent:"center",lineHeight:1,height:"20px",width:"20px",transition:"color 0.2s ease"},onMouseEnter:function(e){e.currentTarget&&(e.currentTarget.style.color="#1976d2")},onMouseLeave:function(e){e.currentTarget&&(e.currentTarget.style.color=0!==N?"#1976d2":"#475467")},"aria-label":"Rotate current page"},{children:n(p,{sx:{fontSize:"18px"}})}))})),!!h&&W&&t("div",e({style:{display:"flex",alignItems:"center",gap:"4px"}},{children:[t("span",e({style:{fontSize:"14px",color:"#475467",fontWeight:500,lineHeight:1}},{children:[f," of ",h]})),n("button",e({style:{background:"none",border:"none",cursor:f<=1?"not-allowed":"pointer",padding:"2px 4px",color:f<=1?"#D0D5DD":"#475467",display:"flex",alignItems:"center",justifyContent:"center",lineHeight:1,height:"20px",width:"20px"},onClick:G,disabled:f<=1},{children:n("svg",e({width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},{children:n("path",{d:"M2 8L6 4L10 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))})),n("button",e({style:{background:"none",border:"none",cursor:f===h?"not-allowed":"pointer",padding:"2px 4px",color:f===h?"#D0D5DD":"#475467",display:"flex",alignItems:"center",justifyContent:"center",lineHeight:1,height:"20px",width:"20px"},onClick:V,disabled:f===h},{children:n("svg",e({width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},{children:n("path",{d:"M2 4L6 8L10 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))}))]})),n("div",{style:{width:"1px",height:"20px",background:"#D1D5DB",margin:"0 4px",flexShrink:0}}),t("div",e({style:{display:"flex",alignItems:"center",gap:"8px",flexShrink:0,whiteSpace:"nowrap"}},{children:[!1!==E&&((null==S?void 0:S.icon)&&(null==S?void 0:S.onClick)?n(c,e({title:(null==S?void 0:S.tooltip)||"",arrow:!0,placement:"top"},{children:n("div",e({onClick:S.onClick,style:e({display:"flex",alignItems:"center",cursor:"pointer"},X)},{children:S.icon}))})):n("button",e({onClick:function(){var e=null==y?void 0:y.current;e&&(document.fullscreenElement?document.exitFullscreen():e.requestFullscreen().catch(function(e){console.error("Error attempting to enable fullscreen: ".concat(e.message))}))},style:X,title:"Full Screen"},{children:(null==k?void 0:k.fullScreenIcon)||n(l,{})}))),v&&n("a",e({href:v,target:"_blank",rel:"noopener noreferrer",style:X,title:"Open in new tab"},{children:(null==k?void 0:k.downloadIcon)||n(a,{})})),m&&n("button",e({onClick:m,style:X,title:"Close"},{children:(null==k?void 0:k.closeIcon)||n(d,{})}))]}))]}))]})),R&&t("div",e({style:{background:"#EEF2FF",border:"1px solid #A5B4FC",borderRadius:"8px",color:"#4F46E5",display:"flex",alignItems:"center",gap:"12px",minWidth:0,padding:"10px 16px",fontSize:"12px",fontWeight:500,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},{children:[n(c,e({title:B,arrow:!0,placement:"top"},{children:n(s,{size:16,color:"#4F46E5",strokeWidth:2,style:{flexShrink:0}})})),n("span",e({style:{overflow:"hidden",textOverflow:"ellipsis"}},{children:n(c,e({title:R.title,arrow:!0,placement:"top"},{children:t("span",{children:["Viewing ",R.title," • Pages ",Y(R.start_page),"-",Y(R.end_page)]})}))}))]}))]}))};export{u as default};
|
|
2
2
|
//# sourceMappingURL=PdfToolbar.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e,__awaiter as t,__generator as n}from"tslib";import{jsx as r,jsxs as i,Fragment as o}from"react/jsx-runtime";import{SpecialZoomLevel as a}from"@react-pdf-viewer/core";import u from"./PdfContainer.js";import l from"./PdfToolbar.js";import{pdfStyles as c}from"./PdfStyle.js";import{PdfHighlightControls as d}from"./usePdfHighlight.js";import{rotationManager as s}from"./rotationManager.js";import"@react-pdf-viewer/zoom/lib/styles/index.css";import"@react-pdf-viewer/page-navigation/lib/styles/index.css";import"@react-pdf-viewer/core/lib/styles/index.css";import"@react-pdf-viewer/search/lib/styles/index.css";import g,{useRef as f,useState as h,useMemo as v,useEffect as m}from"react";import p from"../ScannedDocCitation/ScannedDocCitation.js";var w=function(w){var y=w.pdfUrl,P=w.highlightText,
|
|
1
|
+
import{__assign as e,__awaiter as t,__generator as n}from"tslib";import{jsx as r,jsxs as i,Fragment as o}from"react/jsx-runtime";import{SpecialZoomLevel as a}from"@react-pdf-viewer/core";import u from"./PdfContainer.js";import l from"./PdfToolbar.js";import{pdfStyles as c}from"./PdfStyle.js";import{PdfHighlightControls as d}from"./usePdfHighlight.js";import{rotationManager as s}from"./rotationManager.js";import"@react-pdf-viewer/zoom/lib/styles/index.css";import"@react-pdf-viewer/page-navigation/lib/styles/index.css";import"@react-pdf-viewer/core/lib/styles/index.css";import"@react-pdf-viewer/search/lib/styles/index.css";import g,{useRef as f,useState as h,useMemo as v,useEffect as m}from"react";import p from"../ScannedDocCitation/ScannedDocCitation.js";var w=function(w){var y=w.pdfUrl,P=w.highlightText,x=w.highlightPages,T=w.highlightCordinatePages,b=w.highlightColor,C=void 0===b?"yellow":b,S=w.activeHighlightColor,A=void 0===S?"#f7dc51":S,R=w.jumpToPageValue,_=void 0===R?0:R,I=w.pdfName,q=w.onClose,L=w.customStyles,H=w.customClasses,N=w.customIcons,j=w.useCoordinates,B=w.fallbackPages,F=w.activeCitationIndex,M=w.onActiveCitationChange,E=w.headerAction,D=w.isZoomEnabled,V=void 0===D||D,W=w.showHighlightsAction,z=void 0===W||W,O=w.defaultScale,U=void 0===O?a.ActualSize:O,k=w.useRange,Z=void 0!==k&&k,J=w.rangeOfPages,K=void 0===J?null:J,G=w.showFullScreenAction,Q=void 0===G||G,X=w.showRotateButton,Y=void 0!==X&&X,$=w.segments,ee=void 0===$?[{title:"Document 2",start_page:52,end_page:52,page_count:1}]:$,te=w.segmentTooltipText,ne=w.onCurrentPageChange,re=w.navigationRequest,ie=w.onNavigationSettled,oe=w.disablePdfAnnotations,ae=void 0!==oe&&oe,ue=w.disablePdfTextLayer,le=void 0!==ue&&ue,ce=w.renderPage,de=w.setRenderRange,se=f(null),ge=function(e){switch(e){case"ActualSize":return a.ActualSize;case"PageFit":return a.PageFit;case"PageWidth":return a.PageWidth;default:return null!=e?e:a.PageWidth}}(U),fe=h(0),he=fe[0],ve=fe[1],me=h(0),pe=me[0],we=me[1],ye=h(0),Pe=ye[0],xe=ye[1],Te=f(null),be=f(null),Ce=f(0),Se=f(null),Ae=v(function(){if(!y)return"";try{return new URL(y,window.location.origin).pathname.split("/").pop()||"default"}catch(e){return"default"}},[y]);m(function(){Ae&&s.setPdfIdentifier(Ae)},[Ae]);m(function(){return s.onRotationChange(function(e,t){e===he+1&&xe(t)})},[he]),m(function(){var e=new MutationObserver(function(){var e,t=null===(e=se.current)||void 0===e?void 0:e.querySelectorAll('[data-testid^="core__page-layer-"]'),n=new Set;null==t||t.forEach(function(e){var t,r=null===(t=e.getAttribute("data-testid"))||void 0===t?void 0:t.match(/core__page-layer-(\d+)/);if(r&&r.length>=2){var i=parseInt(r[1],10)+1;n.has(i)||(s.registerPageElement(i,e),n.add(i))}})});return se.current&&(e.observe(se.current,{childList:!0,subtree:!0,attributes:!1}),Se.current=e),function(){e.disconnect(),Se.current=null}},[]),m(function(){return function(){s.clearAll(),Se.current&&Se.current.disconnect()}},[]),m(function(){var e=he+1;xe(s.getRotation(e))},[he]);var Re,_e=v(function(){return ae||le?function(t){var n=le?r("div",e({"aria-hidden":"true",style:{display:"none"}},{children:t.textLayer.children})):t.textLayer.children,a=e(e({},t),{annotationLayer:e(e({},t.annotationLayer),{children:ae?null:t.annotationLayer.children}),textLayer:e(e({},t.textLayer),{children:n})});return ce?ce(a):i(o,{children:[t.canvasLayer.children,n,!ae&&t.annotationLayer.children]})}:ce},[ae,le,ce]),Ie=v(function(){if(j)return new Set(T.map(function(e){return e.pageIndex}));var e=new Set;return Object.values(x).forEach(function(t){t>0&&e.add(t-1)}),e},[T,x,j]),qe=(Re=P)&&0!==Re.length?Re.filter(function(e){return!Re.some(function(t){return t!==e&&t.includes(e)})}):Re,Le=d(qe,j?{}:x,se,Ie,j,j?T:[],C,A),He=Le.highlightIndex,Ne=Le.cursorIndex,je=Le.setCursorIndex,Be=Le.orderedKeys,Fe=Le.totalHighlights,Me=Le.getValidPosition,Ee=Le.tryJump,De=Le.jumpToPage,Ve=Le.plugins,We=Le.controls,ze=Le.hideNonTargetHighlights,Oe=Le.deduplicateHighlights,Ue=Me(Ne),ke=v(function(){var e=he+1;return ee.find(function(t){return e>=t.start_page&&e<=t.end_page})},[he,ee]);m(function(){void 0!==F&&F!==Ne&&je(F)},[F]);var Ze=e(e({},We),{goToNext:function(){Ne>=Fe-1||(We.goToNext(),M&&M(Ne+1))},goToPrevious:function(){Ne<=0||(We.goToPrevious(),M&&M(Ne-1))}}),Je=g.useCallback(function(e,t){Ce.current+=1;var n=Ce.current;null!=be.current&&window.clearTimeout(be.current);var r=null,i=0,o=0,a=function(){var u,l;if(Ce.current===n){o+=1;var c=null===(u=se.current)||void 0===u?void 0:u.querySelector(".rpv-core__inner-pages"),d=null===(l=se.current)||void 0===l?void 0:l.querySelector('[data-testid="core__page-layer-'.concat(t-1,'"]'));if(!c||!d)return o>=40?(be.current=null,void(null==ie||ie({pageNumber:t,requestId:e.requestId}))):void(be.current=window.setTimeout(a,50));r===c.scrollTop?i+=1:(r=c.scrollTop,i=0);var s=c.getBoundingClientRect(),g=d.getBoundingClientRect(),f=Boolean(s&&g&&g.bottom>s.top&&g.top<s.bottom);if(i>=2&&f||o>=40)return be.current=null,void(null==ie||ie({pageNumber:t,requestId:e.requestId}));be.current=window.setTimeout(a,50)}};be.current=window.setTimeout(a,50)},[ie]);if(m(function(){return function(){Ce.current+=1,null!=be.current&&window.clearTimeout(be.current)}},[]),m(function(){var e;if(re&&!(pe<=0)){var t=Math.min(Math.max(Math.trunc(re.pageNumber),1),pe),n="".concat(null!==(e=re.requestId)&&void 0!==e?e:t,":").concat(t);Te.current!==n&&(Te.current=n,ve(t-1),De(t-1),Je(re,t))}},[De,re,pe,Je]),!y)return r(p,{pages:B,activeCitationIndex:F,onActiveCitationChange:M,headerAction:E});return i("div",e({ref:se,className:(null==H?void 0:H.pdfViewerWrapper)||"","data-disable-pdf-annotations":ae?"true":void 0,"data-pdf-page-fit":ge===a.PageFit?"true":void 0,style:e(e(e({height:"100%",minHeight:0,minWidth:0,overflow:"hidden",display:"flex",flexDirection:"column"},c.pdfViewer),{display:"flex",flexDirection:"column",height:"100%",width:"100%",backgroundColor:"#FAFAFA"}),null==L?void 0:L.pdfViewer)},{children:[r(l,{highlightIndex:He,totalHighlights:Fe,controls:Ze,currentPosition:Ue,pdfName:I,onClose:q,pdfUrl:y,viewerRef:se,customStyles:L,customClasses:H,customIcons:N,headerAction:E,isZoomEnabled:V,showHighlightsAction:z,showFullScreenAction:Q,currentSegment:ke,segmentTooltipText:te,currentPage:he+1,totalPages:pe,onPageNavigate:function(e){var t=Math.min(Math.max(e,1),pe||e);ve(t-1),De(t-1)},onRotatePage:function(){var e=he+1;s.rotatePageBy90(e),xe(s.getRotation(e))},currentPageRotation:Pe,showRotateButton:Y}),r(u,{defaultScale:ge,pdfUrl:y,plugins:Ve,customStyles:L,onLoad:function(e){we(e.doc.numPages);var r=!j&&!Z&&_<=0;if(_>0&&!Z){var i=_-1,o=Be[i],a=x[o],u=T[i];je(i),console.log(u,"cordinateTargetHighlight"),j&&u.pageIndex>0&&De(u.pageIndex),a>0&&(setTimeout(function(){ze(Ie),Oe(a-1)},1e3),j||De(a-1))}else if(Z&&K&&2===K.length){t(void 0,void 0,void 0,function(){var e,t,r,i,o;return n(this,function(n){switch(n.label){case 0:e=K[0],t=K[1],r=e,n.label=1;case 1:return r<=t?(De(i=r-1),[4,new Promise(function(e){return setTimeout(e,1e3)})]):[3,4];case 2:if(n.sent(),ze(Ie),(o=Oe(i))&&o>0)return[3,4];n.label=3;case 3:return r++,[3,1];case 4:return[2]}})})}else if(!j&&x){var l=Be.find(function(e){return x[e]>0});if(void 0!==l){var c=x[l]-1;De(c),setTimeout(function(){ze(Ie),Oe(c)},1e3)}}requestAnimationFrame(function(){r&&Ee(),!j&&_>0&&!Z&&function(){if(se.current){var e=_-1,t=Be[e],n=x[t],r=n>0?n-1:0,i={};Be.forEach(function(e,t){var n=x[e];n>0&&(i[n]||(i[n]=[]),i[n].push(t))});var o=(i[n]||[]).indexOf(e),a=0,u=function(){var e,t;if(!(++a>40)){var n=null===(e=se.current)||void 0===e?void 0:e.querySelector(".rpv-core__inner-pages");if(n){var i=null===(t=se.current)||void 0===t?void 0:t.querySelector('[data-testid="core__page-layer-'.concat(r,'"]'));if(i){var l=n.getBoundingClientRect(),c=i.getBoundingClientRect();if(c.top<l.bottom&&c.bottom>l.top){var d=i.querySelectorAll(".rpv-search__highlight")[o];if(d){var s=d.getBoundingClientRect(),g=n.scrollTop+(s.top-l.top)-n.clientHeight/2+s.height/2;n.scrollTo({top:g,behavior:"smooth"})}else setTimeout(u,100)}else setTimeout(u,100)}else setTimeout(u,100)}else setTimeout(u,100)}};setTimeout(u,500)}}()})},onPageChange:function(e){var t=e.currentPage;ve(t),null==ne||ne(t+1),Ie.has(t)?(Oe(t),ze(Ie)):ze(Ie)},renderPage:_e,setRenderRange:de})]}))};export{w as default};
|
|
2
2
|
//# sourceMappingURL=PdfViewer.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__spreadArray as e,__assign as t}from"tslib";import{jsx as r,Fragment as n}from"react/jsx-runtime";import{useState as i,useRef as o,useMemo as a}from"react";import{searchPlugin as l}from"@react-pdf-viewer/search";import{pageNavigationPlugin as c}from"@react-pdf-viewer/page-navigation";import{zoomPlugin as u}from"@react-pdf-viewer/zoom";import{highlightPlugin as h}from"@react-pdf-viewer/highlight";var f=function(f,g,s,p,v,d,m,x){void 0===m&&(m="yellow"),void 0===x&&(x="#F6D739");var T=i(0),y=T[0],b=T[1],w=o(!1),M=i(0),I=M[0],_=M[1];o([]);var S=function(e){return e.replace(/[^\S\n]+/g," ").trim()},E=function(e){return(e||"").toLowerCase().replace(/\u00ad/g,"").replace(/[""]/g,'"').replace(/['']/g,"'").replace(/[\u2013\u2014]/g,"-").replace(/-/g," ").replace(/[^\w\s]/g,"").replace(/\s+/g," ").trim()},A=function(e){var t=e.trim(),r=(t=(t=t.replace(/[\u200B-\u200D\uFEFF]/g,"").replace(/[\u00A0\u2009\u202F]/g," ")).replace(/^[-•]\s+/,"")).match(/^((\d+(?:\.\d+)*[.)]?)|[A-Za-z][.)]|\([A-Za-z0-9]+\)|(?:i|ii|iii|iv|v|vi|vii|viii|ix|x)[.)])\s*/i);return r?t.slice(r[0].length).trim():t},B=function(e){var t=E(e),r=t.replace(/\s+/g,""),n=new Set;return t&&n.add(t),r&&n.add(r),n},k=function(e){return e.replace(/\\([''])/g,"$1").replace(/\]\s*\n\s*\(/g,"](").replace(/&[#\w]+;/g,function(e){return t=e,(r=document.createElement("textarea")).innerHTML=t,r.value;var t,r}).replace(/<br\s*\/?>/gi,"\n").replace(/\[([^\]]+)\]\(([^)]+)\)/g,"$1").replace(/`([^`]+)`/g,"$1")},z=function(e){return e?k(e).split(/\n+/).map(A).flatMap(function(e){var t=e.match(/^\s*\|(.+)\|\s*$/);return t?t[1].split("|").map(function(e){return e.trim()}).filter(Boolean):[e]}).map(function(e){return S(function(e){return e.replace(/(^|\W)[*_]{1,3}([^*_]+)[*_]{1,3}(?=\W|$)/g,"$1$2")}(e))}).filter(Boolean):[]},j=Object.keys(g).map(Number).sort(function(e,t){return e-t}),q=a(function(){return v?d.length:v?0:Object.values(g).filter(function(e){return e>0}).length},[d,g]),C=function(r){if(s.current){var n=s.current.querySelector('[data-testid="search__highlights-'.concat(r,'"]'));if(n){var i=Array.from(n.querySelectorAll(".rpv-search__highlight"));if(0!==i.length){var o=$.map(B),a=P.map(B);if(0!==o.length||0!==a.length){var l=i.map(function(e){var r=function(e){var t=e.getBoundingClientRect();if(t.height>0||t.width>0)return{top:t.top,left:t.left,right:t.right};var r=e.offsetTop,n=e.offsetLeft;return{top:r,left:n,right:n+e.offsetWidth}}(e),n=(e.textContent||"").trim(),i=(e.getAttribute("title")||"").trim();return t({el:e,text:n||i},r)}).filter(function(e){return e.text.length>0}).sort(function(e,t){return e.top-t.top||e.left-t.left});if(0!==l.length){var c=[],u=null,h=[],g=function(){if(u){var e=h.join(" ");u.title=E(e),u.title&&c.push(u),u=null,h=[]}};if(l.forEach(function(e){if(!u)return u={title:"",elements:[e.el],lastTop:e.top,lastRight:e.right},void(h=[e.text]);var t=Math.abs(e.top-u.lastTop)<=5,r=e.left<=u.lastRight+28;t&&r?(u.elements.push(e.el),u.lastTop=e.top,u.lastRight=Math.max(u.lastRight,e.right),h.push(e.text)):(g(),u={title:"",elements:[e.el],lastTop:e.top,lastRight:e.right},h=[e.text])}),g(),0!==c.length){for(var p=function(e,t){if(!e)return!1;if(t.has(e))return!0;for(var r=e.replace(/\s+/g,""),n=0,i=Array.from(t);n<i.length;n++){var o=i[n];if(o){var a=o.replace(/\s+/g,"");if(a===r)return!0;if(o.length>=8&&e.length>=5&&o.includes(e))return!0;if(a.length>=8&&r.length>=5&&a.includes(r))return!0;if(e.length>=10&&o.length>=8&&e.includes(o))return!0;if(r.length>=10&&a.length>=8&&r.includes(a))return!0}}return!1},v=0,d=new Set,m=function(e){if(!e||e.length<8)return null;for(var t=e.replace(/\s+/g,""),r=0;r<c.length;r++)for(var n="",i="",o=new Set,a=r;a<c.length&&a<r+20;a++){var l=c[a].title;if(n=n?"".concat(n," ").concat(l):l,i=i?"".concat(i).concat(l.replace(/\s+/g,"")):l.replace(/\s+/g,""),o.add(a),n.includes(e)||i.includes(t))return o;if(n.length>=15&&(e.includes(n)||t.includes(i)))return o;if(n.length>e.length+150)break}return null},x=0,T=Array.from(new Set(e(e([],$,!0),P,!0).map(E).filter(function(e){return e.length>=8}))).sort(function(e,t){return t.length-e.length});x<T.length;x++){var y=m(T[x]);y&&y.size>0&&(y.forEach(function(e){return d.add(e)}),v=d.size)}if(0===v){var b=function(e){if(0===e.length)return null;for(var t=null,r=0,n=e;r<n.length;r++)for(var i=n[r],o=0,a=Array.from(i);o<a.length;o++){var l=a[o];if(l&&!(l.length<5))for(var u=l.replace(/\s+/g,""),h=0;h<c.length;h++)for(var f="",g="",s=new Set,p=h;p<c.length&&p<h+15;p++){var v=c[p].title;if(f=f?"".concat(f," ").concat(v):v,g=g?"".concat(g).concat(v.replace(/\s+/g,"")):v.replace(/\s+/g,""),s.add(p),f.includes(l)||g.includes(u)){var d=Math.max(0,f.length-l.length);(!t||d<t.extra)&&(t={blocks:new Set(s),extra:d});break}if(f.length>l.length+120)break}}return t?t.blocks:null}(o);b&&b.size>0&&(b.forEach(function(e){return d.add(e)}),v=d.size)}var w=function(e){if(e.length<2)return 40;for(var t=[],r=1;r<e.length;r++){var n=Math.abs(e[r].lastTop-e[r-1].lastTop);n>0&&t.push(n)}if(0===t.length)return 40;t.sort(function(e,t){return e-t});var i=t[Math.floor(t.length/2)],o=Math.round(2.25*i);return Math.min(60,Math.max(24,o))}(c),M=P.map(E).filter(function(e){return e.length>=8}),I=M.map(function(e){return e.split(/\s+/).filter(function(e){return e.length>=2})});if(0===v)for(var _=a,S=0;S<c.length;S++)for(var A=c[S].title,k=0;k<_.length;k++)if(p(A,_[k])){for(var z=0,j=new Set,q=k,C=S-1,R=S;R<c.length&&q<_.length;R++){if(p(c[R].title,_[q])){if(C>=0){var H=c[C].lastTop,F=c[R].lastTop;if(Math.abs(F-H)>w)break}z++,j.add(R),C=R,q++}else if(q>0&&p(c[R].title,_[q-1])){H=c[C].lastTop,F=c[R].lastTop;Math.abs(F-H)<=3&&(j.add(R),C=R)}if(R-C>6)break}z>v&&(v=z,d=j)}if(v<Math.min(3,M.length)&&M.length>0){var N=new Set;c.forEach(function(e,t){var r=e.title.split(/\s+/).filter(function(e){return e.length>=2});if(!(r.length<2))for(var n=new Set(r),i=0,o=I;i<o.length;i++){var a=o[i];if(!(a.length<2)){for(var l=0,c=0,u=a;c<u.length;c++){var h=u[c];n.has(h)&&l++}var f=l/a.length;if(l>=3||f>=.5){N.add(t);break}}}}),N.size>0&&(d=N,v=Math.max(v,N.size))}var Z=new Set;if(O.forEach(function(e){var t=E(e);t&&(Z.add(t),Z.add(t.replace(/\s+/g,"")))}),0===v){var L=new Set;if(c.forEach(function(e,t){var r=e.title.replace(/\s+/g,"");if(Z.has(e.title)||Z.has(r))L.add(t);else for(var n=Array.from(Z),i=0;i<n.length;i++){var o=n[i];if(o.length>=10&&o.includes(e.title)&&e.title.length>=5){L.add(t);break}}}),0===L.size)return 0;d=L}c.forEach(function(e,t){var r=d.has(t);e.elements.forEach(function(e){r?(e.classList.add("verified-match"),e.style.display=""):(e.style.display="none",e.classList.remove("verified-match"))})});var D=[];return c.forEach(function(e,t){d.has(t)&&e.elements.forEach(function(e){return D.push(e)})}),requestAnimationFrame(function(){var e=D.map(function(e){return{el:e,rect:e.getBoundingClientRect()}}).filter(function(e){return e.rect.width>0&&e.rect.height>0}).sort(function(e,t){return t.rect.width*t.rect.height-e.rect.width*e.rect.height}),t=[];e.forEach(function(e){var r=e.el,n=e.rect;t.some(function(e){return t=e.rect,r=n,i=Math.max(0,Math.min(t.right,r.right)-Math.max(t.left,r.left))*Math.max(0,Math.min(t.bottom,r.bottom)-Math.max(t.top,r.top)),((o=Math.min(t.width*t.height,r.width*r.height))>0?i/o:0)>.5;var t,r,i,o})?(r.style.display="none",r.classList.remove("verified-match")):t.push({el:r,rect:n})})}),console.groupCollapsed("[debug: PDF ordered matching - Page ".concat(r,"]")),console.log("input->",f),console.log("processed sentences->",$),console.log("processed lines->",P),console.log("Expected sentence count:",o.length),console.log("Expected line count:",a.length),console.log("Matched sequence length:",v),console.log("blocksToKeep",d,"size",d.size),console.groupEnd(),d.size}}}}}}},R=function(e){s.current&&s.current.querySelectorAll(".rpv-search__highlights").forEach(function(t){var r=t.getAttribute("data-testid"),n=parseInt((null==r?void 0:r.replace(/search__highlights-/g,""))||"-1"),i=t.querySelectorAll(".rpv-search__highlight");e.has(n)||i.forEach(function(e){e.style.display="none"})})},H=f.map(function(e){return function(e){return e?k(e).split(/\n{2,}/).map(function(e){return z(e).join(" ")}).map(function(e){return S(e)}).filter(Boolean):[]}(e)}).flat(),F=f.map(function(e){return z(e)}).flat(),N=H.some(function(e){return e.length>=3})?3:1,$=H.filter(function(e){return e.length>=N}),P=F.filter(function(e){return e.length>=N}),Z=P.flatMap(function(e){return function(e,t,r){void 0===t&&(t=6),void 0===r&&(r=4);var n=e.split(/\s+/).filter(Boolean);if(n.length<=t)return[];for(var i=[],o=0;o+t<=n.length;o+=r)i.push(n.slice(o,o+t).join(" "));return n.length>t&&(n.length-t)%r!==0&&i.push(n.slice(n.length-t).join(" ")),i}(e)}),O=Array.from(new Set(e(e(e([],$,!0),P,!0),Z,!0).flatMap(function(e){var t=S(e.replace(/[\u00A0\u2009\u202F]/g," ").replace(/\u00ad/g,"").replace(/[""]/g,'"').replace(/['']/g,"'"));if(!t)return[];var r=t.replace(/[\u2013\u2014]/g,"-"),n=S(r.replace(/(\w)-\s+(\w)/g,"$1$2")),i=S(r.replace(/-/g," ")),o=S(r.replace(/-/g,"")),a=S(t.replace(/[^\w\s]/g,"")),l=new Set([t,r,n,i,o,a]);return Array.from(l).filter(Boolean)}))).filter(function(e){var t=e.split(/\s+/).filter(Boolean);return!(e.length<N)&&(t.length>=3||e.length>=12)}),L=l({keyword:O}),D=c(),W=u(),K=L.jumpToMatch,J=D.jumpToPage,V=W.zoomTo,G=W.ZoomInButton,Q=W.ZoomOutButton,U=W.ZoomPopover,X=a(function(){return function(r){if(0===r.length)return[];var n=new Map;r.forEach(function(e,r){var i=null!=e.pageNumber?e.pageNumber-1:e.pageIndex;n.has(i)||n.set(i,[]),n.get(i).push(t(t({},e),{originalIndex:r}))});var i=[];return n.forEach(function(t){for(var r=e([],t,!0).sort(function(e,t){return e.top!==t.top?e.top-t.top:e.left-t.left}),n=new Array(r.length).fill(!1),o=0;o<r.length;o++)if(!n[o]){var a=r[o],l=a.left,c=a.top,u=a.width,h=a.height,f=a.pageIndex,g=a.pageNumber,s=l+u,p=c+h,v=[r[o].originalIndex];n[o]=!0;for(var d=!0;d;){d=!1;for(var m=o+1;m<r.length;m++)if(!n[m]){var x=r[m],T=x.left+x.width,y=x.top+x.height,b=Math.max(0,Math.min(s,T)-Math.max(l,x.left))*Math.max(0,Math.min(p,y)-Math.max(c,x.top)),w=Math.max(u*h,1e-4),M=Math.max(x.width*x.height,1e-4),I=Math.min(w,M);(I>0?b/I:0)>=.8&&(l=Math.min(l,x.left),c=Math.min(c,x.top),u=(s=Math.max(s,T))-l,h=(p=Math.max(p,y))-c,v.push(x.originalIndex),n[m]=!0,d=!0)}}i.push({pageIndex:f,pageNumber:g,left:l,top:c,width:u,height:h,originalIndexes:v})}}),i}(d)},[d]),Y=h({renderHighlights:function(e){return r(n,{children:X.filter(function(t){return null!=t.pageNumber?t.pageNumber-1===e.pageIndex:t.pageIndex===e.pageIndex}).map(function(e){var t=e.originalIndexes.includes(I);return r("div",{style:{position:"absolute",left:"".concat(e.left,"%"),top:"".concat(e.top+.08*e.height,"%"),width:"".concat(e.width,"%"),height:"".concat(.95*e.height,"%"),background:t?x:m,opacity:t?.7:.4,transition:"background 0.2s, opacity 0.2s",border:t?"1px solid ".concat("red"):"1px solid transparent"}},e.originalIndexes.join("-"))})})}}),ee=function(){if(!w.current)try{K(0),w.current=!0;var e=d[0];e&&v&&re(e.pageIndex,e.top)}catch(e){requestAnimationFrame(ee)}},te=function(e,t){if(s.current&&s.current.querySelector(".rpv-core__viewer")){var r=-1,n=function(){var i,o,a=null===(i=s.current)||void 0===i?void 0:i.querySelector(".rpv-core__inner-pages");if(a){if(a.scrollTop!==r)return r=a.scrollTop,void setTimeout(n,100);var l=null===(o=s.current)||void 0===o?void 0:o.querySelector('[data-testid="core__page-layer-'.concat(e,'"]'));if(l){var c=l.querySelectorAll(".rpv-search__highlight")[t];if(c){var u=a.getBoundingClientRect(),h=c.getBoundingClientRect(),f=a.scrollTop+(h.top-u.top)-a.clientHeight/2+h.height/2;a.scrollTo({top:f,behavior:"smooth"})}}}};setTimeout(n,300)}},re=function(e,t,r){if(void 0===r&&(r=0),s.current){var n=0,i=function(){var o,a;if(!(++n>60)){var l=null===(o=s.current)||void 0===o?void 0:o.querySelector(".rpv-core__inner-pages");if(l){var c=null===(a=s.current)||void 0===a?void 0:a.querySelector('[data-testid="core__page-layer-'.concat(e,'"]'));if(c){var u=c.getBoundingClientRect();if(0!==u.height){var h=l.getBoundingClientRect(),f=t/100*u.height,g=r/100*u.height,p=u.top-h.top+f,v=p+g;if(!(p>=80&&v<=l.clientHeight-80)){var d=p<80?l.scrollTop+p-80:l.scrollTop+v-l.clientHeight+80;l.scrollTo({top:d,behavior:"smooth"})}}else setTimeout(i,100)}else setTimeout(i,100)}else setTimeout(i,100)}};setTimeout(i,100)}},ne=a(function(){var e={};return j.forEach(function(t,r){var n=g[t];n>0&&(e[n]||(e[n]=[]),e[n].push(r))}),e},[j,g]),ie=function(e){var t=g[j[e]];return(ne[t]||[]).indexOf(e)},oe=function(e,t,r){if(void 0===r&&(r=0),s.current){var n=-1,i=0,o=function(){var a,l;if(!(++i>60)){var c=null===(a=s.current)||void 0===a?void 0:a.querySelector(".rpv-core__inner-pages");if(c){if(c.scrollTop!==n)return n=c.scrollTop,void setTimeout(o,100);var u=null===(l=s.current)||void 0===l?void 0:l.querySelector('[data-testid="core__page-layer-'.concat(e,'"]'));if(u){var h=u.getBoundingClientRect();if(0!==h.height){var f=c.getBoundingClientRect(),g=t/100*h.height,p=r/100*h.height,v=h.top-f.top+g,d=v+p;if(!(v>=80&&d<=c.clientHeight-80)){var m=v<80?c.scrollTop+v-80:c.scrollTop+d-c.clientHeight+80;c.scrollTo({top:m,behavior:"instant"})}}else setTimeout(o,100)}else setTimeout(o,100)}else setTimeout(o,100)}};setTimeout(o,100)}};return{setHighlightIndex:b,highlightIndex:y,cursorIndex:I,setCursorIndex:_,orderedKeys:j,totalHighlights:q,getValidPosition:function(e){if(v)return e+1;if(!g)return 0;for(var t=0,r=0;r<=e;r++)g[j[r]]>0&&t++;return t},tryJump:ee,jumpToPage:J,zoomTo:V,hideNonTargetHighlights:R,deduplicateHighlights:C,scrollToCoord:re,plugins:[v?Y:L,D,W],controls:{ZoomInButton:G,ZoomOutButton:Q,ZoomPopover:U,zoomTo:V,goToNext:function(){if(v&&d)for(var e=I+1;e<d.length;e++){var t=d[e],r=d[I];return _(e),void(t.pageIndex!==r.pageIndex?(J(t.pageIndex),oe(t.pageIndex,t.top,t.height)):re(t.pageIndex,t.top,t.height))}else{var n=function(e){var t=j[e];if(g[t]>0){var r=g[t]-1,n=ie(e);return _(e),J(g[t]-1),te(r,n),setTimeout(function(){C(r)},500),1===Object.keys(g).length&&R(p),{value:void 0}}};for(e=I+1;e<j.length;e++){var i=n(e);if("object"==typeof i)return i.value}}},goToPrevious:function(){if(v&&d)for(var e=I-1;e>=0;e--){var t=d[e],r=d[I];return _(e),void(t.pageIndex!==r.pageIndex?(J(t.pageIndex),oe(t.pageIndex,t.top,t.height)):re(t.pageIndex,t.top,t.height))}else{var n=function(e){var t=j[e];if(g[t]>0){var r=g[t]-1,n=ie(e);return _(e),J(g[t]-1),te(r,n),setTimeout(function(){C(r)},500),1===Object.keys(g).length&&R(p),{value:void 0}}};for(e=I-1;e>=0;e--){var i=n(e);if("object"==typeof i)return i.value}}}}}};export{f as PdfHighlightControls};
|
|
1
|
+
import{__spreadArray as e,__assign as t}from"tslib";import{jsx as r,Fragment as n}from"react/jsx-runtime";import{useState as i,useRef as o,useMemo as a}from"react";import{searchPlugin as l}from"@react-pdf-viewer/search";import{pageNavigationPlugin as c}from"@react-pdf-viewer/page-navigation";import{zoomPlugin as u}from"@react-pdf-viewer/zoom";import{highlightPlugin as h}from"@react-pdf-viewer/highlight";var f=function(f,g,s,p,v,d,m,x){void 0===m&&(m="yellow"),void 0===x&&(x="#F6D739");var T=i(0),y=T[0],b=T[1],w=o(!1),M=i(0),I=M[0],_=M[1];o([]);var S=function(e){return e.replace(/[^\S\n]+/g," ").trim()},E=function(e){return(e||"").toLowerCase().replace(/\u00ad/g,"").replace(/[""]/g,'"').replace(/['']/g,"'").replace(/[\u2013\u2014]/g,"-").replace(/-/g," ").replace(/[^\w\s]/g,"").replace(/\s+/g," ").trim()},A=function(e){var t=e.trim(),r=(t=(t=t.replace(/[\u200B-\u200D\uFEFF]/g,"").replace(/[\u00A0\u2009\u202F]/g," ")).replace(/^[-•]\s+/,"")).match(/^((\d+(?:\.\d+)*[.)]?)|[A-Za-z][.)]|\([A-Za-z0-9]+\)|(?:i|ii|iii|iv|v|vi|vii|viii|ix|x)[.)])\s*/i);return r?t.slice(r[0].length).trim():t},B=function(e){var t=E(e),r=t.replace(/\s+/g,""),n=new Set;return t&&n.add(t),r&&n.add(r),n},k=function(e){return e.replace(/\\([''])/g,"$1").replace(/\]\s*\n\s*\(/g,"](").replace(/&[#\w]+;/g,function(e){return t=e,(r=document.createElement("textarea")).innerHTML=t,r.value;var t,r}).replace(/<br\s*\/?>/gi,"\n").replace(/\[([^\]]+)\]\(([^)]+)\)/g,"$1").replace(/`([^`]+)`/g,"$1")},j=function(e){return e?k(e).split(/\n+/).map(A).flatMap(function(e){var t=e.match(/^\s*\|(.+)\|\s*$/);return t?t[1].split("|").map(function(e){return e.trim()}).filter(Boolean):[e]}).map(function(e){return S(function(e){return e.replace(/(^|\W)[*_]{1,3}([^*_]+)[*_]{1,3}(?=\W|$)/g,"$1$2")}(e))}).filter(Boolean):[]},q=Object.keys(g).map(Number).sort(function(e,t){return e-t}),z=a(function(){return v?d.length:v?0:Object.values(g).filter(function(e){return e>0}).length},[d,g]),C=function(r){if(s.current){var n=s.current.querySelector('[data-testid="search__highlights-'.concat(r,'"]'));if(n){var i=Array.from(n.querySelectorAll(".rpv-search__highlight"));if(0!==i.length){var o=$.map(B),a=P.map(B);if(0!==o.length||0!==a.length){var l=i.map(function(e){var r=function(e){var t=e.getBoundingClientRect();if(t.height>0||t.width>0)return{top:t.top,left:t.left,right:t.right};var r=e.offsetTop,n=e.offsetLeft;return{top:r,left:n,right:n+e.offsetWidth}}(e),n=(e.textContent||"").trim(),i=(e.getAttribute("title")||"").trim();return t({el:e,text:n||i},r)}).filter(function(e){return e.text.length>0}).sort(function(e,t){return e.top-t.top||e.left-t.left});if(0!==l.length){var c=[],u=null,h=[],g=function(){if(u){var e=h.join(" ");u.title=E(e),u.title&&c.push(u),u=null,h=[]}};if(l.forEach(function(e){if(!u)return u={title:"",elements:[e.el],lastTop:e.top,lastRight:e.right},void(h=[e.text]);var t=Math.abs(e.top-u.lastTop)<=5,r=e.left<=u.lastRight+28;t&&r?(u.elements.push(e.el),u.lastTop=e.top,u.lastRight=Math.max(u.lastRight,e.right),h.push(e.text)):(g(),u={title:"",elements:[e.el],lastTop:e.top,lastRight:e.right},h=[e.text])}),g(),0!==c.length){for(var p=function(e,t){if(!e)return!1;if(t.has(e))return!0;for(var r=e.replace(/\s+/g,""),n=0,i=Array.from(t);n<i.length;n++){var o=i[n];if(o){var a=o.replace(/\s+/g,"");if(a===r)return!0;if(o.length>=8&&e.length>=5&&o.includes(e))return!0;if(a.length>=8&&r.length>=5&&a.includes(r))return!0;if(e.length>=10&&o.length>=8&&e.includes(o))return!0;if(r.length>=10&&a.length>=8&&r.includes(a))return!0}}return!1},v=0,d=new Set,m=function(e){if(!e||e.length<8)return null;for(var t=e.replace(/\s+/g,""),r=0;r<c.length;r++)for(var n="",i="",o=new Set,a=r;a<c.length&&a<r+20;a++){var l=c[a].title;if(n=n?"".concat(n," ").concat(l):l,i=i?"".concat(i).concat(l.replace(/\s+/g,"")):l.replace(/\s+/g,""),o.add(a),n.includes(e)||i.includes(t))return o;if(n.length>=15&&(e.includes(n)||t.includes(i)))return o;if(n.length>e.length+150)break}return null},x=0,T=Array.from(new Set(e(e([],$,!0),P,!0).map(E).filter(function(e){return e.length>=8}))).sort(function(e,t){return t.length-e.length});x<T.length;x++){var y=m(T[x]);y&&y.size>0&&(y.forEach(function(e){return d.add(e)}),v=d.size)}if(0===v){var b=function(e){if(0===e.length)return null;for(var t=null,r=0,n=e;r<n.length;r++)for(var i=n[r],o=0,a=Array.from(i);o<a.length;o++){var l=a[o];if(l&&!(l.length<5))for(var u=l.replace(/\s+/g,""),h=0;h<c.length;h++)for(var f="",g="",s=new Set,p=h;p<c.length&&p<h+15;p++){var v=c[p].title;if(f=f?"".concat(f," ").concat(v):v,g=g?"".concat(g).concat(v.replace(/\s+/g,"")):v.replace(/\s+/g,""),s.add(p),f.includes(l)||g.includes(u)){var d=Math.max(0,f.length-l.length);(!t||d<t.extra)&&(t={blocks:new Set(s),extra:d});break}if(f.length>l.length+120)break}}return t?t.blocks:null}(o);b&&b.size>0&&(b.forEach(function(e){return d.add(e)}),v=d.size)}var w=function(e){if(e.length<2)return 40;for(var t=[],r=1;r<e.length;r++){var n=Math.abs(e[r].lastTop-e[r-1].lastTop);n>0&&t.push(n)}if(0===t.length)return 40;t.sort(function(e,t){return e-t});var i=t[Math.floor(t.length/2)],o=Math.round(2.25*i);return Math.min(60,Math.max(24,o))}(c),M=P.map(E).filter(function(e){return e.length>=8}),I=M.map(function(e){return e.split(/\s+/).filter(function(e){return e.length>=2})});if(0===v)for(var _=a,S=0;S<c.length;S++)for(var A=c[S].title,k=0;k<_.length;k++)if(p(A,_[k])){for(var j=0,q=new Set,z=k,C=S-1,R=S;R<c.length&&z<_.length;R++){if(p(c[R].title,_[z])){if(C>=0){var H=c[C].lastTop,F=c[R].lastTop;if(Math.abs(F-H)>w)break}j++,q.add(R),C=R,z++}else if(z>0&&p(c[R].title,_[z-1])){H=c[C].lastTop,F=c[R].lastTop;Math.abs(F-H)<=3&&(q.add(R),C=R)}if(R-C>6)break}j>v&&(v=j,d=q)}if(v<Math.min(3,M.length)&&M.length>0){var N=new Set;c.forEach(function(e,t){var r=e.title.split(/\s+/).filter(function(e){return e.length>=2});if(!(r.length<2))for(var n=new Set(r),i=0,o=I;i<o.length;i++){var a=o[i];if(!(a.length<2)){for(var l=0,c=0,u=a;c<u.length;c++){var h=u[c];n.has(h)&&l++}var f=l/a.length;if(l>=3||f>=.5){N.add(t);break}}}}),N.size>0&&(d=N,v=Math.max(v,N.size))}var Z=new Set;if(O.forEach(function(e){var t=E(e);t&&(Z.add(t),Z.add(t.replace(/\s+/g,"")))}),0===v){var L=new Set;if(c.forEach(function(e,t){var r=e.title.replace(/\s+/g,"");if(Z.has(e.title)||Z.has(r))L.add(t);else for(var n=Array.from(Z),i=0;i<n.length;i++){var o=n[i];if(o.length>=10&&o.includes(e.title)&&e.title.length>=5){L.add(t);break}}}),0===L.size)return 0;d=L}c.forEach(function(e,t){var r=d.has(t);e.elements.forEach(function(e){r?(e.classList.add("verified-match"),e.style.display=""):(e.style.display="none",e.classList.remove("verified-match"))})});var D=[];return c.forEach(function(e,t){d.has(t)&&e.elements.forEach(function(e){return D.push(e)})}),requestAnimationFrame(function(){var e=D.map(function(e){return{el:e,rect:e.getBoundingClientRect()}}).filter(function(e){return e.rect.width>0&&e.rect.height>0}).sort(function(e,t){return t.rect.width*t.rect.height-e.rect.width*e.rect.height}),t=[];e.forEach(function(e){var r=e.el,n=e.rect;t.some(function(e){return t=e.rect,r=n,i=Math.max(0,Math.min(t.right,r.right)-Math.max(t.left,r.left))*Math.max(0,Math.min(t.bottom,r.bottom)-Math.max(t.top,r.top)),((o=Math.min(t.width*t.height,r.width*r.height))>0?i/o:0)>.5;var t,r,i,o})?(r.style.display="none",r.classList.remove("verified-match")):t.push({el:r,rect:n})})}),console.groupCollapsed("[debug: PDF ordered matching - Page ".concat(r,"]")),console.log("input->",f),console.log("processed sentences->",$),console.log("processed lines->",P),console.log("Expected sentence count:",o.length),console.log("Expected line count:",a.length),console.log("Matched sequence length:",v),console.log("blocksToKeep",d,"size",d.size),console.groupEnd(),d.size}}}}}}},R=function(e){s.current&&s.current.querySelectorAll(".rpv-search__highlights").forEach(function(t){var r=t.getAttribute("data-testid"),n=parseInt((null==r?void 0:r.replace(/search__highlights-/g,""))||"-1"),i=t.querySelectorAll(".rpv-search__highlight");e.has(n)||i.forEach(function(e){e.style.display="none"})})},H=f.map(function(e){return function(e){return e?k(e).split(/\n{2,}/).map(function(e){return j(e).join(" ")}).map(function(e){return S(e)}).filter(Boolean):[]}(e)}).flat(),F=f.map(function(e){return j(e)}).flat(),N=H.some(function(e){return e.length>=3})?3:1,$=H.filter(function(e){return e.length>=N}),P=F.filter(function(e){return e.length>=N}),Z=P.flatMap(function(e){return function(e,t,r){void 0===t&&(t=6),void 0===r&&(r=4);var n=e.split(/\s+/).filter(Boolean);if(n.length<=t)return[];for(var i=[],o=0;o+t<=n.length;o+=r)i.push(n.slice(o,o+t).join(" "));return n.length>t&&(n.length-t)%r!==0&&i.push(n.slice(n.length-t).join(" ")),i}(e)}),O=Array.from(new Set(e(e(e([],$,!0),P,!0),Z,!0).flatMap(function(e){var t=S(e.replace(/[\u00A0\u2009\u202F]/g," ").replace(/\u00ad/g,"").replace(/[""]/g,'"').replace(/['']/g,"'"));if(!t)return[];var r=t.replace(/[\u2013\u2014]/g,"-"),n=S(r.replace(/(\w)-\s+(\w)/g,"$1$2")),i=S(r.replace(/-/g," ")),o=S(r.replace(/-/g,"")),a=S(t.replace(/[^\w\s]/g,"")),l=new Set([t,r,n,i,o,a]);return Array.from(l).filter(Boolean)}))).filter(function(e){var t=e.split(/\s+/).filter(Boolean);return!(e.length<N)&&(t.length>=3||e.length>=12)}),L=l({keyword:O}),D=c(),W=u(),K=L.jumpToMatch,J=D.jumpToPage,V=W.zoomTo,G=W.ZoomInButton,Q=W.ZoomOutButton,U=W.ZoomPopover,X=a(function(){return function(r){if(0===r.length)return[];var n=new Map;r.forEach(function(e,r){var i=null!=e.pageNumber?e.pageNumber-1:e.pageIndex;n.has(i)||n.set(i,[]),n.get(i).push(t(t({},e),{originalIndex:r}))});var i=[];return n.forEach(function(t){for(var r=e([],t,!0).sort(function(e,t){return e.top!==t.top?e.top-t.top:e.left-t.left}),n=new Array(r.length).fill(!1),o=0;o<r.length;o++)if(!n[o]){var a=r[o],l=a.left,c=a.top,u=a.width,h=a.height,f=a.pageIndex,g=a.pageNumber,s=l+u,p=c+h,v=[r[o].originalIndex];n[o]=!0;for(var d=!0;d;){d=!1;for(var m=o+1;m<r.length;m++)if(!n[m]){var x=r[m],T=x.left+x.width,y=x.top+x.height,b=Math.max(0,Math.min(s,T)-Math.max(l,x.left))*Math.max(0,Math.min(p,y)-Math.max(c,x.top)),w=Math.max(u*h,1e-4),M=Math.max(x.width*x.height,1e-4),I=Math.min(w,M);(I>0?b/I:0)>=.8&&(l=Math.min(l,x.left),c=Math.min(c,x.top),u=(s=Math.max(s,T))-l,h=(p=Math.max(p,y))-c,v.push(x.originalIndex),n[m]=!0,d=!0)}}i.push({pageIndex:f,pageNumber:g,left:l,top:c,width:u,height:h,originalIndexes:v})}}),i}(d)},[d]),Y=h({renderHighlights:function(e){return r(n,{children:X.filter(function(t){return null!=t.pageNumber?t.pageNumber-1===e.pageIndex:t.pageIndex===e.pageIndex}).map(function(e){var t=e.originalIndexes.includes(I);return r("div",{style:{position:"absolute",left:"".concat(e.left,"%"),top:"".concat(e.top+.08*e.height,"%"),width:"".concat(e.width,"%"),height:"".concat(.95*e.height,"%"),background:t?x:m,opacity:t?.7:.4,transition:"background 0.2s, opacity 0.2s",border:t?"1px solid ".concat("red"):"1px solid transparent"}},e.originalIndexes.join("-"))})})}}),ee=function(){if(!w.current)try{K(0),w.current=!0;var e=d[0];e&&v&&re(e.pageIndex,e.top)}catch(e){requestAnimationFrame(ee)}},te=function(e,t){if(s.current&&s.current.querySelector(".rpv-core__viewer")){var r=-1,n=function(){var i,o,a=null===(i=s.current)||void 0===i?void 0:i.querySelector(".rpv-core__inner-pages");if(a){if(a.scrollTop!==r)return r=a.scrollTop,void setTimeout(n,100);var l=null===(o=s.current)||void 0===o?void 0:o.querySelector('[data-testid="core__page-layer-'.concat(e,'"]'));if(l){var c=l.querySelectorAll(".rpv-search__highlight")[t];if(c){var u=a.getBoundingClientRect(),h=c.getBoundingClientRect(),f=a.scrollTop+(h.top-u.top)-a.clientHeight/2+h.height/2;a.scrollTo({top:f,behavior:"smooth"})}}}};setTimeout(n,300)}},re=function(e,t,r){if(void 0===r&&(r=0),s.current){var n=0,i=function(){var o,a;if(!(++n>60)){var l=null===(o=s.current)||void 0===o?void 0:o.querySelector(".rpv-core__inner-pages");if(l){var c=null===(a=s.current)||void 0===a?void 0:a.querySelector('[data-testid="core__page-layer-'.concat(e,'"]'));if(c){var u=c.getBoundingClientRect();if(0!==u.height){var h=l.getBoundingClientRect(),f=t/100*u.height,g=r/100*u.height,p=u.top-h.top+f,v=p+g;if(!(p>=80&&v<=l.clientHeight-80)){var d=p<80?l.scrollTop+p-80:l.scrollTop+v-l.clientHeight+80;l.scrollTo({top:d,behavior:"smooth"})}}else setTimeout(i,100)}else setTimeout(i,100)}else setTimeout(i,100)}};setTimeout(i,100)}},ne=a(function(){var e={};return q.forEach(function(t,r){var n=g[t];n>0&&(e[n]||(e[n]=[]),e[n].push(r))}),e},[q,g]),ie=function(e){var t=g[q[e]];return(ne[t]||[]).indexOf(e)},oe=function(e,t,r){if(void 0===r&&(r=0),s.current){var n=-1,i=0,o=function(){var a,l;if(!(++i>60)){var c=null===(a=s.current)||void 0===a?void 0:a.querySelector(".rpv-core__inner-pages");if(c){if(c.scrollTop!==n)return n=c.scrollTop,void setTimeout(o,100);var u=null===(l=s.current)||void 0===l?void 0:l.querySelector('[data-testid="core__page-layer-'.concat(e,'"]'));if(u){var h=u.getBoundingClientRect();if(0!==h.height){var f=c.getBoundingClientRect(),g=t/100*h.height,p=r/100*h.height,v=h.top-f.top+g,d=v+p;if(!(v>=80&&d<=c.clientHeight-80)){var m=v<80?c.scrollTop+v-80:c.scrollTop+d-c.clientHeight+80;c.scrollTo({top:m,behavior:"instant"})}}else setTimeout(o,100)}else setTimeout(o,100)}else setTimeout(o,100)}};setTimeout(o,100)}};return{setHighlightIndex:b,highlightIndex:y,cursorIndex:I,setCursorIndex:_,orderedKeys:q,totalHighlights:z,getValidPosition:function(e){if(v)return e+1;if(!g)return 0;for(var t=0,r=0;r<=e;r++)g[q[r]]>0&&t++;return t},tryJump:ee,jumpToPage:J,zoomTo:V,hideNonTargetHighlights:R,deduplicateHighlights:C,scrollToCoord:re,plugins:[v?Y:L,D,W],controls:{ZoomInButton:G,ZoomOutButton:Q,ZoomPopover:U,goToNext:function(){if(v&&d)for(var e=I+1;e<d.length;e++){var t=d[e],r=d[I];return _(e),void(t.pageIndex!==r.pageIndex?(J(t.pageIndex),oe(t.pageIndex,t.top,t.height)):re(t.pageIndex,t.top,t.height))}else{var n=function(e){var t=q[e];if(g[t]>0){var r=g[t]-1,n=ie(e);return _(e),J(g[t]-1),te(r,n),setTimeout(function(){C(r)},500),1===Object.keys(g).length&&R(p),{value:void 0}}};for(e=I+1;e<q.length;e++){var i=n(e);if("object"==typeof i)return i.value}}},goToPrevious:function(){if(v&&d)for(var e=I-1;e>=0;e--){var t=d[e],r=d[I];return _(e),void(t.pageIndex!==r.pageIndex?(J(t.pageIndex),oe(t.pageIndex,t.top,t.height)):re(t.pageIndex,t.top,t.height))}else{var n=function(e){var t=q[e];if(g[t]>0){var r=g[t]-1,n=ie(e);return _(e),J(g[t]-1),te(r,n),setTimeout(function(){C(r)},500),1===Object.keys(g).length&&R(p),{value:void 0}}};for(e=I-1;e>=0;e--){var i=n(e);if("object"==typeof i)return i.value}}}}}};export{f as PdfHighlightControls};
|
|
2
2
|
//# sourceMappingURL=usePdfHighlight.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as e,jsx as
|
|
1
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{createContext as n,useState as i,useMemo as o,useCallback as r,useContext as a}from"react";import{RefProvider as s}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=n(null),g="user-story-lib",C=({children:n,userStory:a,setUserStory:c,aiReasoning:C,setAiReasoning:f,citations:m,setCitations:h,apiCachingConfig:p,customStyles:v,customIcons:S,searchQueryList:I,searchQueryReasoningIdList:E,citationConfig:y,chatHistory:R,chatCitationConfigs:A,gptCitationConfigs:D,diffEditConfig:w,aiReasoningAccordionOpenStates:b,persistedDataFiles:U,inlineUpdateComponentConfig:x,segmentComponentConfig:F,onEditBlocked:N,inlineManualComponentConfig:P,redlineConfig:T,sectionStatusConfig:O,customSectionConfig:L,updateRedlineDataParent:_,redlineCollaborativeConfig:j,onFetchOnDemandCitation:k})=>{const[G,H]=i(0),[Q,B]=i(""),M=o(()=>{if(0===a.length||0===C.length)return Array(a.length).fill(0);const e=Array.from({length:a.length},()=>[]);return C.forEach(t=>{const n=Number(t.relevance_score);if(isNaN(n)||n<=0)return;const i=`ai_reasoning$${t.id}`,o=a.findIndex(e=>{var t;return e.value.includes(i)||(null===(t=e.sub_features)||void 0===t?void 0:t.some(e=>e.value.includes(i)))});-1!==o&&e[o].push(n)}),e.map(e=>0===e.length?0:Math.round(e.reduce((e,t)=>e+t,0)/e.length))},[a,C]),q=r(e=>{var t;const n=a.findIndex(t=>t.artifactId===e);return-1===n?0:null!==(t=M[n])&&void 0!==t?t:0},[a,M]),[W,$]=i(null);return e(u.Provider,{value:{chatHistory:R,userStory:a,setUserStory:c,aiReasoning:C,setAiReasoning:f,citations:m,setCitations:h,apiCachingConfig:p,customStyles:v,customIcons:S,searchQueryList:I,searchQueryReasoningIdList:E,citationConfig:y,getAvgScoreForStory:q,chatCitationConfigs:A,gptCitationConfigs:D,diffEditConfig:w,aiReasoningAccordionOpenStates:b,persistedDataFiles:U,currentHighlightIndex:G,setCurrentHighlightIndex:H,inlineUpdateComponentConfig:x,segmentComponentConfig:F,onEditBlocked:N,inlineManualComponentConfig:P,redlineConfig:T,redlineDcoumentId:Q,setRedlineDocumentId:B,sectionStatusConfig:O,customSectionConfig:L,updateRedlineDataParent:_,redlineCollaborativeConfig:j,selectedSectionToEdit:W,setSelectedSectionToEdit:$,onFetchOnDemandCitation:k},children:[t(d,{position:"top-right",toasterId:g}),(null==j?void 0:j.initiateCollaborativeFlow)?t(l,{applicationId:null==j?void 0:j.modeId,baseUrl:null==j?void 0:j.cwsBaseUrl,authToken:null==j?void 0:j.authToken,children:t(s,{children:n})}):t(s,{children:n})]})},f=()=>{const e=a(u);if(!e)throw new Error("useRequirementAI must be used within RequirementAIWrapper");return e};export{c as SectionStatus,g as ToasterId,C as default,f as useRequirementAI};
|
|
2
2
|
//# sourceMappingURL=RequirementAIWrapper.js.map
|
package/dist/features/RequirementAI/components/RichTextEditor/Editor/constants/changeTags.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"changeTags.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=String.raw`(?:[^>"']|"[^"]*"|'[^']*')*`,t=new RegExp(String.raw`<updated\b(${e})>([\s\S]*?)<\/updated\s*>`,"gi"),n=new RegExp(String.raw`<upt\b(${e})>([\s\S]*?)<\/upt\s*>`,"gi"),r=new RegExp(String.raw`<(deleted|changed)\b(${e})>([\s\S]*?)<\/\1\s*>`,"gi"),i=e=>{const t=e.trim();if(!t.includes("|"))return null;const n=[];let r="";for(let e=0;e<t.length;e+=1){const i=t[e],s=e>0&&"\\"===t[e-1];"|"!==i||s?r+=i:(n.push(r.trim()),r="")}return n.push(r.trim()),t.startsWith("|")&&n.shift(),t.endsWith("|")&&n.pop(),n},s=e=>!!(null==e?void 0:e.length)&&e.every(e=>/^:?-{3,}:?$/.test(e)),d=e=>`| ${e.join(" | ")} |`,l=e=>e.replace(n,(e,t,n)=>{if(!(e=>{const t=e.split("\n");return t.some((e,n)=>{var r;return n>0&&s(i(e))&&!!(null===(r=i(t[n-1]))||void 0===r?void 0:r.length)})})(n))return e;return`<updated${t}>${n.replace(/<del\b([^>]*)>/gi,"<deleted$1>").replace(/<\/del\s*>/gi,"</deleted>").replace(/<ins\b([^>]*)>/gi,"<changed$1>").replace(/<\/ins\s*>/gi,"</changed>")}</updated>`}),a=n=>{if(!n)return"";let a=l(n).replace(t,(e,t,n)=>{if(!n.includes("|"))return e;if(!/\bid\s*=\s*["']ai_reasoning\$/i.test(t))return n;const r=/\bdata-main\b/i.test(t)?"":" data-main",i=((e,t)=>{const n=t.match(/\bid\s*=\s*["']([^"']+)["']/i);if(!n)return e;const r=encodeURIComponent(n[1]);return e.replace(/<(deleted|changed)\b([^>]*)>/gi,(e,t,n)=>/\bdata-upt-id\s*=/i.test(n)?e:`<${t}${n} data-upt-id="${r}">`)})(n,t);return`<upt${t}${r}></upt>\n\n${i}`});return a=(t=>{const n=new RegExp(String.raw`(<deleted\b${e}>(?:(?!<\/deleted\s*>)[\s\S])*?\|(?:(?!<\/deleted\s*>)[\s\S])*?<\/deleted\s*>)\s*(<changed\b${e}>[^|]*?<\/changed\s*>)\s*\|`,"gi"),d=t.replace(n,(e,t,n)=>{var r;return`${(null!==(r=t.replace(/<\/deleted\s*>$/i,"").trimEnd().split("\n").at(-1))&&void 0!==r?r:"").trimEnd().endsWith("|")?t:t.replace(/<\/deleted\s*>$/i," |</deleted>")}\n${n}`}),l=new RegExp(String.raw`(<deleted\b${e}>(?:(?!<\/deleted\s*>)[\s\S])*?\|(?:(?!<\/deleted\s*>)[\s\S])*?<\/deleted\s*>)\s*(?=<changed\b${e}>)`,"gi"),a=d.replace(l,"$1\n\n");return a.replace(r,(e,t,n,r,d)=>{if(!r.includes("|"))return e;const l=a.slice(0,d),c=/(?:^|\n)[ \t]*$/.test(l);return r.split("\n").map((e,r)=>{if(!e)return e;let d=e;d.includes("|")&&!/^\s*\|/.test(d)&&(r>0||c)&&(d=`| ${d}`);const l=i(d);return s(l)?d:d.split(/(\|)/).map(e=>"|"!==e&&e.trim()?`<${t}${n}>${e}</${t}>`:e).join("")}).join("\n")})})(a),a=a.replace(/([([])\s+(?=<(?:deleted|changed)>)/gi,"$1"),(e=>{const t=e.split("\n");for(let e=1;e<t.length;e+=1){const n=i(t[e]);if(!s(n))continue;const r=i(t[e-1]);if(!(null==r?void 0:r.length))continue;for(;r.length>n.length;){const e=r.findIndex(e=>""===e);if(-1===e)break;r.splice(e,1)}const l=Math.max(r.length,n.length);let a=e+1,c=0;for(;a<t.length&&""!==t[a].trim();){const e=i(t[a]);if(!e)break;for(;e.length>l;){const t=e.findIndex(e=>""===e);if(-1===t)break;e.splice(t,1)}t[a]=d(e),c=Math.max(c,e.length),a+=1}const g=Math.max(r.length,n.length,c);for(;r.length<g;)r.push("");for(;n.length<g;)n.push("---");t[e-1]=d(r),t[e]=d(n)}return t.join("\n")})(a)};export{a as normalizeRedlineMarkdown};
|
|
2
|
+
//# sourceMappingURL=normalizeRedlineMarkdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalizeRedlineMarkdown.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -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 o,useEffect as a,useImperativeHandle as l}from"react";import{DEFAULT_TOOLBAR_CONFIG as
|
|
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 c}from"./Editor/constants/editorConfig.js";import i from"./Editor/Editor.js";import{useRefStore as s}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}from"../../../../utils/tagHelper.js";const f=new u({headingStyle:"atx",codeBlockStyle:"fenced"}),E=e=>e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");f.keep(["ins","del","mark"]),f.keep(e=>["DELETED","CHANGED"].includes(e.nodeName)),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(),A=r(({type:r,value:u,handleUpdateState:p,onBlur:E,placeholder:A,minHeight:y,height:$,mode:S,doNotShowBorderInViewMode:w,onEditBlocked:x,onSaveUnsavedChanges:C,onDiscardUnsavedChanges:b,isSavingUnsavedChanges:N=!1},T)=>{const B=n(null),[L,q]=o({type:r,value:u}),[R,_]=o(0),[H,I]=o(!1),k=n(u),j=n(u),D=n(Boolean(u)),{contentRef:M,setContentRef:W}=s();a(()=>{q(e=>({...e,value:u})),k.current=u,j.current=u,D.current=Boolean(u),I(!1)},[u]),l(T,()=>({requestClose:()=>!("edit"===S&&v(k.current)!==v(j.current))||(I(!0),!1)}),[S]);return a(()=>{const e=()=>{M&&M.current&&_(M.current.clientHeight-60)};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[M]),e("div",{style:{position:"relative",width:"100%",height:$,minHeight:y},children:[H&&t(h,{isSaving:N,onSave:async()=>{await(null==C?void 0:C()),k.current=j.current,I(!1)},onDiscard:()=>{j.current=k.current,null==b||b(),I(!1)}}),t(i,{minHeight:y,height:$,placeholder:A||"Enter some text...",onChange:(e,t)=>{e.read(()=>{const e=d(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)")||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")}),r.querySelectorAll("span[data-review]").forEach(e=>{const t="delete"===e.getAttribute("data-review")?"deleted":"changed",n=r.createElement(t);n.append(...Array.from(e.childNodes)),e.replaceWith(n)}),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("code").forEach(e=>{e.textContent=e.textContent||""}),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 c=Array.from(e.attributes).map(e=>`${e.name}="${e.value}"`).join(" "),i=e.tagName.toLowerCase();return c?`<${i} ${c}>${l}</${i}>`:`<${i}>${l}</${i}>`}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 c=[];r.querySelectorAll("p").forEach(e=>{if(!(""===e.textContent&&Array.from(e.childNodes).every(e=>"BR"===e.nodeName||e.nodeType===Node.TEXT_NODE&&""===e.textContent)))return;const t=`%%BLANKLINE${c.length}%%`;c.push(t),e.textContent=t});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 s=f.turndown(r.body.innerHTML);c.forEach(e=>{s=s.replace(new RegExp(`\\n*${e}\\n*`,"g"),"\n\n")});for(let e=l.length-1;e>=0;e--)s=s.replace(`%%REVIEW\\_${e}%%`,` ${l[e]} `);a.forEach((e,t)=>{s=s.replace(new RegExp(`%%INVISIBLE\\\\*_${t}%%`,"g"),` ${e} `)}),i.forEach((e,t)=>{s=s.replace(`%%TABLE\\_${t}%%`,`\n\n${e}\n\n`)}),s=s.replace(/\*{4}([^*]+)\*{4}/g,"**$1**"),s=s.replace(/\s+class="PlaygroundEditorTheme__[^"]*"/g,""),s=s.replace(/<span\s+style="white-space:\s*pre-wrap;?">([\s\S]*?)<\/span>/g,"$1"),s=s.replace(/\s+style="white-space:\s*pre-wrap;?"/g,""),s=s.replace(/<b>\s*<strong>([\s\S]*?)<\/strong>\s*<\/b>/g,"<strong>$1</strong>"),s=s.replace(/<code([^>]*)>\s*<span[^>]*>([\s\S]*?)<\/span>\s*<\/code>/g,"<code$1>$2</code>");["upt","manual","del","ins","preserved"].forEach(e=>{s=g(s,e)}),s=m(s,["manual","upt"]),D.current&&(k.current=s,D.current=!1),j.current=s,((e,t)=>{p(e,t)})("prompt",s)})},toolbarConfig:c,editorRef:B,mode:S,initialString:{type:L.type,value:L.value},dynamicHeight:R,onBlur:E,doNotShowBorderInViewMode:w||!1,onEditBlocked:x})]})});A.displayName="RichTextEditor";export{A as default};
|
|
2
2
|
//# sourceMappingURL=RichTextEditor.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e=".avatar{align-items:center;border-radius:50%;box-sizing:border-box;color:#475467;display:flex;flex-shrink:0;font-family:Inter;font-weight:600;justify-content:center;line-height:1;position:relative;user-select:none}.avatar--bordered{border:2px solid #fff}.online-dot{background:#22c55e;border:2px solid #fff;border-radius:50%;bottom:-1px;position:absolute;right:-1px}";!function(){if("undefined"==typeof document)return;const t=document.createElement("style");t.type="text/css";const n=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;n&&t.setAttribute("nonce",n),t.appendChild(document.createTextNode(e));const o=document.head||document.getElementsByTagName("head")[0]||document.documentElement;o&&o.appendChild(t)}();export{e as default};
|
|
2
|
+
//# sourceMappingURL=Avatar.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Avatar.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsxs as a,jsx as t}from"react/jsx-runtime";import"./Avatar.css.js";import{getAvatarColor as e,getInitials as r}from"./avatarUtils.js";function i({name:i,online:s=!1,size:o=56,bordered:n=!1}){return a("div",{className:"avatar "+(n?"avatar--bordered":""),style:{width:o,height:o,background:e(i),fontSize:Math.max(12,.38*o)},children:[r(i),s&&t("span",{className:"online-dot",style:{width:Math.max(8,.28*o),height:Math.max(8,.28*o)}})]})}export{i as default};
|
|
2
|
+
//# sourceMappingURL=Avatar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Avatar.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e=".avatar-group{align-items:center;cursor:pointer;display:inline-flex;gap:6px;position:relative;user-select:none}.avatar-stack{align-items:center;display:flex}.avatar-wrapper{margin-left:-10px;position:relative}.avatar-wrapper:first-child{margin-left:0}.avatar-more{align-items:center;background:#f2f4f7;border:2px solid #fff;border-radius:50%;box-sizing:border-box;color:#667085;display:flex;font-size:11px;font-weight:600;height:32px;justify-content:center;line-height:1;user-select:none;width:32px}.avatar-chevron{color:#667085;cursor:pointer;height:16px;transition:transform .2s ease;width:16px}.avatar-chevron.open{transform:rotate(180deg)}.avatar-group-container{display:inline-block;position:relative}.collaborators-popup-wrapper{left:-100px;position:absolute;z-index:1000}";!function(){if("undefined"==typeof document)return;const t=document.createElement("style");t.type="text/css";const n=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;n&&t.setAttribute("nonce",n),t.appendChild(document.createTextNode(e));const a=document.head||document.getElementsByTagName("head")[0]||document.documentElement;a&&a.appendChild(t)}();export{e as default};
|
|
2
|
+
//# sourceMappingURL=CollaboratorsGroup.css.js.map
|
package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.css.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CollaboratorsGroup.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsxs as e,jsx as r}from"react/jsx-runtime";import{useState as a,useRef as s,useEffect as o}from"react";import"./CollaboratorsGroup.css.js";import t from"./Avatar.js";import n from"./CollaboratorsPopup.js";import{ChevronDown as i}from"lucide-react";function c({users:c,owner:l,activeUsers:m,previousUsers:d=[],maxVisible:p=3}){const v=c.slice(0,p),u=c.length-v.length,[h,f]=a(!1),N=s(null);return o(()=>{function e(e){N.current&&!N.current.contains(e.target)&&f(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),e("div",{className:"avatar-group-container",ref:N,children:[e("div",{className:"avatar-group",onClick:()=>f(e=>!e),children:[e("div",{className:"avatar-stack",children:[v.map((e,a)=>r("div",{className:"avatar-wrapper",style:{zIndex:a+1},children:r(t,{name:e.name,online:e.online,size:32,bordered:!0})},e.id)),u>0&&r("div",{className:"avatar-wrapper",style:{zIndex:v.length+1},children:e("div",{className:"avatar-more",children:["+",u]})})]}),r(i,{className:"avatar-chevron "+(h?"open":"")})]}),h&&r("div",{className:"collaborators-popup-wrapper",children:r(n,{owner:l,activeUsers:m,previousUsers:d})})]})}export{c as default};
|
|
2
|
+
//# sourceMappingURL=CollaboratorsGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CollaboratorsGroup.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e=".collaborators-popover{background:#fff;border-radius:12px;box-shadow:0 10px 30px #0000001f,0 2px 8px #0000000f;font-family:Inter,sans-serif;max-height:400px;overflow-y:auto;padding:12px;width:280px}.owner-section,.user-row{align-items:center;display:flex}.user-row+.user-row{margin-top:10px}.user-info{margin-left:12px;min-width:0}.user-name{align-items:center;color:#344054;display:flex;font-size:14px;font-weight:600;gap:3px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.you{color:#667085;font-weight:400}.user-subtitle{color:#667085;font-size:13px;margin-top:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.divider{background:#eaecf0;height:1px;margin:12px 0}.section-title{color:#98a2b3;font-size:12px;font-weight:600;letter-spacing:.04em;margin-bottom:10px;text-transform:uppercase}.section-title.previous{margin-top:18px}.faded{opacity:.45}.user-text{display:inline-block;max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}";!function(){if("undefined"==typeof document)return;const t=document.createElement("style");t.type="text/css";const o=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;o&&t.setAttribute("nonce",o),t.appendChild(document.createTextNode(e));const n=document.head||document.getElementsByTagName("head")[0]||document.documentElement;n&&n.appendChild(t)}();export{e as default};
|
|
2
|
+
//# sourceMappingURL=CollaboratorsPopup.css.js.map
|
package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.css.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CollaboratorsPopup.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsxs as e,jsx as s,Fragment as i}from"react/jsx-runtime";import"./CollaboratorsPopup.css.js";import a from"./Avatar.js";import{Tooltip as r}from"@mui/material";function n({user:i}){return e("div",{className:"user-row "+(i.faded?"faded":""),children:[s(a,{name:i.name,online:i.online,size:40}),e("div",{className:"user-info",children:[e("div",{className:"user-name",children:[s(r,{title:i.name,children:s("span",{className:"user-text",children:i.name})}),!!i.isUser&&s("span",{className:"you",children:"(You)"})]}),s("div",{className:"user-subtitle",children:s(r,{title:i.subtitle,children:s("span",{className:"user-text",children:i.subtitle})})})]})]})}function l({owner:l,activeUsers:t,previousUsers:c=[]}){return e("div",{className:"collaborators-popover",children:[l&&e("div",{className:"owner-section",children:[s(a,{name:l.name,online:l.online,size:40}),e("div",{className:"user-info",children:[e("div",{className:"user-name",children:[s(r,{title:l.name,children:s("span",{className:"user-text",children:l.name})}),!!l.isUser&&s("span",{className:"you",children:"(You)"})]}),s("div",{className:"user-subtitle",children:"Owner"})]})]}),(t.length>0||c.length>0)&&s("div",{className:"divider"}),t.length>0&&e(i,{children:[s("div",{className:"section-title",children:"On this document"}),t.map(e=>s(n,{user:e},e.id))]}),c.length>0&&e(i,{children:[s("div",{className:"section-title previous",children:"Previously active"}),c.map(e=>s(n,{user:{...e,faded:!0}},e.id))]})]})}export{l as default};
|
|
2
|
+
//# sourceMappingURL=CollaboratorsPopup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CollaboratorsPopup.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const F=["#FFF3B0","#D9F7E5","#EEE3FF","#DDEBFF","#FFE2E2","#FFE9CC","#DFF5FF","#FDE2F3"];function t(F){return F.trim().split(/\s+/).slice(0,2).map(F=>{var t;return null===(t=F[0])||void 0===t?void 0:t.toUpperCase()}).join("")}function e(t){let e=0;for(let F=0;F<t.length;F++)e=t.charCodeAt(F)+((e<<5)-e);return F[Math.abs(e)%F.length]}export{e as getAvatarColor,t as getInitials};
|
|
2
|
+
//# sourceMappingURL=avatarUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"avatarUtils.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
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 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};
|
|
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};
|
|
2
2
|
//# sourceMappingURL=CitationAnchor.js.map
|