@e-llm-studio/citation 0.0.210 → 0.0.211
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -270
- package/dist/cjs/features/CognitiveCompare/hooks/memoizedMarkdown.js +1 -1
- package/dist/cjs/features/RequirementAiCitations/WebCitation/WebCitationWithImageContent.js +1 -1
- package/dist/cjs/features/RequirementAiCitations/WebCitation/WebCitationWithImageContent.module.css.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/features/CognitiveCompare/hooks/memoizedMarkdown.js +1 -1
- package/dist/features/RequirementAiCitations/WebCitation/WebCitationWithImageContent.js +1 -1
- package/dist/features/RequirementAiCitations/WebCitation/WebCitationWithImageContent.module.css.js +1 -1
- package/dist/index.js +1 -1
- package/dist/types/src/features/CognitiveCompare/hooks/useCompareLayout.d.ts +1 -0
- package/dist/types/src/features/CognitiveCompare/hooks/useCompareLayout.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +0 -3
- package/dist/types/src/index.d.ts.map +1 -1
- package/package.json +1 -6
- package/dist/assests/svg/NeuralNetworkIcon.js +0 -2
- package/dist/assests/svg/NeuralNetworkIcon.js.map +0 -1
- package/dist/cjs/assests/svg/NeuralNetworkIcon.js +0 -2
- package/dist/cjs/assests/svg/NeuralNetworkIcon.js.map +0 -1
- package/dist/cjs/features/GptWebCitation/GptWebCitation.js +0 -2
- package/dist/cjs/features/GptWebCitation/GptWebCitation.js.map +0 -1
- package/dist/cjs/features/GptWebCitation/GptWebCitation.module.css.js +0 -2
- package/dist/cjs/features/GptWebCitation/GptWebCitation.module.css.js.map +0 -1
- package/dist/cjs/features/GptWebCitation/GptWebCitationImageCitation.js +0 -2
- package/dist/cjs/features/GptWebCitation/GptWebCitationImageCitation.js.map +0 -1
- package/dist/cjs/features/GptWebCitation/GptWebCitationImageFullScreenView.js +0 -2
- package/dist/cjs/features/GptWebCitation/GptWebCitationImageFullScreenView.js.map +0 -1
- package/dist/cjs/features/GptWebCitation/GptWebCitationMarkdown.js +0 -2
- package/dist/cjs/features/GptWebCitation/GptWebCitationMarkdown.js.map +0 -1
- package/dist/cjs/features/GptWebCitation/GptWebCitationSkeleton.js +0 -2
- package/dist/cjs/features/GptWebCitation/GptWebCitationSkeleton.js.map +0 -1
- package/dist/cjs/features/GptWebCitation/utils/citationData.utils.js +0 -2
- package/dist/cjs/features/GptWebCitation/utils/citationData.utils.js.map +0 -1
- package/dist/features/GptWebCitation/GptWebCitation.js +0 -2
- package/dist/features/GptWebCitation/GptWebCitation.js.map +0 -1
- package/dist/features/GptWebCitation/GptWebCitation.module.css.js +0 -2
- package/dist/features/GptWebCitation/GptWebCitation.module.css.js.map +0 -1
- package/dist/features/GptWebCitation/GptWebCitationImageCitation.js +0 -2
- package/dist/features/GptWebCitation/GptWebCitationImageCitation.js.map +0 -1
- package/dist/features/GptWebCitation/GptWebCitationImageFullScreenView.js +0 -2
- package/dist/features/GptWebCitation/GptWebCitationImageFullScreenView.js.map +0 -1
- package/dist/features/GptWebCitation/GptWebCitationMarkdown.js +0 -2
- package/dist/features/GptWebCitation/GptWebCitationMarkdown.js.map +0 -1
- package/dist/features/GptWebCitation/GptWebCitationSkeleton.js +0 -2
- package/dist/features/GptWebCitation/GptWebCitationSkeleton.js.map +0 -1
- package/dist/features/GptWebCitation/utils/citationData.utils.js +0 -2
- package/dist/features/GptWebCitation/utils/citationData.utils.js.map +0 -1
- package/dist/types/src/assests/svg/NeuralNetworkIcon.d.ts +0 -9
- package/dist/types/src/assests/svg/NeuralNetworkIcon.d.ts.map +0 -1
- package/dist/types/src/features/GptWebCitation/GptWebCitation.d.ts +0 -5
- package/dist/types/src/features/GptWebCitation/GptWebCitation.d.ts.map +0 -1
- package/dist/types/src/features/GptWebCitation/GptWebCitationImageCitation.d.ts +0 -8
- package/dist/types/src/features/GptWebCitation/GptWebCitationImageCitation.d.ts.map +0 -1
- package/dist/types/src/features/GptWebCitation/GptWebCitationImageFullScreenView.d.ts +0 -8
- package/dist/types/src/features/GptWebCitation/GptWebCitationImageFullScreenView.d.ts.map +0 -1
- package/dist/types/src/features/GptWebCitation/GptWebCitationMarkdown.d.ts +0 -9
- package/dist/types/src/features/GptWebCitation/GptWebCitationMarkdown.d.ts.map +0 -1
- package/dist/types/src/features/GptWebCitation/GptWebCitationSkeleton.d.ts +0 -3
- package/dist/types/src/features/GptWebCitation/GptWebCitationSkeleton.d.ts.map +0 -1
- package/dist/types/src/features/GptWebCitation/GptWebCitationTest.d.ts +0 -4
- package/dist/types/src/features/GptWebCitation/GptWebCitationTest.d.ts.map +0 -1
- package/dist/types/src/features/GptWebCitation/WebCitationSampleResponse.d.ts +0 -4
- package/dist/types/src/features/GptWebCitation/WebCitationSampleResponse.d.ts.map +0 -1
- package/dist/types/src/features/GptWebCitation/types.d.ts +0 -112
- package/dist/types/src/features/GptWebCitation/types.d.ts.map +0 -1
- package/dist/types/src/features/GptWebCitation/utils/citationData.utils.d.ts +0 -8
- package/dist/types/src/features/GptWebCitation/utils/citationData.utils.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
- [CognitiveDecisioningCard](#cognitivedecisioningcard) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/CognitiveDecisioning/CognitiveDecisioningReadme.md)
|
|
14
14
|
- [CognitiveCompare](#cognitivecompare) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/new-compare-ui/citation/src/features/CognitiveCompare/README.md)
|
|
15
15
|
- [CognitiveInternalGPTReasoning](#cognitiveinternalgptreasoning) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/CognitiveInternalgptReasoning/README.md)
|
|
16
|
-
- [GptWebCitation](#gptwebcitation)
|
|
17
16
|
- [CodeCitation](#codecitation) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/CodeCitation/README.md)
|
|
18
17
|
- [ChatDrawer](#chatdrawer) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/ChatDrawer/ChatDrawerReadme.md)
|
|
19
18
|
- [CitationsViewer](#citationsviewer) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/CitationViewer/CitationViewerReadme.md)
|
|
@@ -673,275 +672,6 @@ const reasoningData = {
|
|
|
673
672
|
|
|
674
673
|
---
|
|
675
674
|
|
|
676
|
-
## GptWebCitation
|
|
677
|
-
|
|
678
|
-
### Overview
|
|
679
|
-
|
|
680
|
-
`GptWebCitation` is a composite React component that wraps the GPT reasoning citation (`CognitiveInternalgptCoreComponent`) and adds an optional **Web Citation** view. Users can toggle between GPT and web-based citations without modifying the underlying GPT citation code.
|
|
681
|
-
|
|
682
|
-
In **GPT view**, the component renders the standard GPT citation panel with a **View Web Citation** button on the left and the document source link on the right (inside the GPT citation footer). In **Web Citation view**, it shows a web snapshot (image or markdown content) with highlight navigation, relevance score, and a **View GPT Citation** toggle to switch back.
|
|
683
|
-
|
|
684
|
-
### Features
|
|
685
|
-
|
|
686
|
-
- **Dual citation views** — Toggle between GPT reasoning and web-based citation
|
|
687
|
-
- **Non-invasive GPT integration** — Wraps `CognitiveInternalgptCoreComponent` via props; no changes to GPT citation code required
|
|
688
|
-
- **Image & markdown web citations** — Supports screenshot snapshots (`imageMetadata.signed_url`) or HTML/markdown content
|
|
689
|
-
- **Highlight pagination** — Navigate between highlighted anchors in web citation markdown
|
|
690
|
-
- **Relevance score badge** — Auto-extracted from web citation content (e.g. "decision strength is 85%")
|
|
691
|
-
- **Loading skeleton** — Built-in loading state while web citation is being generated
|
|
692
|
-
- **Expand screenshot button** — Optional full-screen image view (`showExpandImageButton`)
|
|
693
|
-
- **Style overrides** — Customize layout via the `styles` prop without editing component internals
|
|
694
|
-
|
|
695
|
-
### Installation / Import
|
|
696
|
-
|
|
697
|
-
```tsx
|
|
698
|
-
import GptWebCitation from '@e-llm-studio/citation/GptWebCitation';
|
|
699
|
-
```
|
|
700
|
-
|
|
701
|
-
### Usage 1: Basic GPT + Web Citation Toggle
|
|
702
|
-
|
|
703
|
-
```tsx
|
|
704
|
-
import { useState } from 'react';
|
|
705
|
-
import { ChevronDown, ChevronUp, Maximize2, X } from 'lucide-react';
|
|
706
|
-
import GptWebCitation from '@e-llm-studio/citation/GptWebCitation';
|
|
707
|
-
|
|
708
|
-
const gptCitation = {
|
|
709
|
-
item: {
|
|
710
|
-
confidence_score: 100,
|
|
711
|
-
text: 'Standard financial data interpretation patterns.',
|
|
712
|
-
dataSource:
|
|
713
|
-
'Title: Commodity Market Analysis\n\n- <highlight>Verify the most recent timestamp in search results.</highlight>\n- Analyze safe-haven asset demand and geopolitical triggers.',
|
|
714
|
-
paraphrase: 'Market interpretation patterns for commodity price reporting.',
|
|
715
|
-
},
|
|
716
|
-
headerTitle: 'Summary Citations',
|
|
717
|
-
index: 0,
|
|
718
|
-
iconsConfig: {
|
|
719
|
-
ChevronDownIcon: ChevronDown,
|
|
720
|
-
ChevronUpIcon: ChevronUp,
|
|
721
|
-
MaximizeIcon: Maximize2,
|
|
722
|
-
CloseIcon: X,
|
|
723
|
-
},
|
|
724
|
-
DocumentTitle: 'Source : Employee Handbook - Code of Conduct Section.pdf',
|
|
725
|
-
previewCallback: () => window.open('/preview/document'),
|
|
726
|
-
};
|
|
727
|
-
|
|
728
|
-
function CitationPanel() {
|
|
729
|
-
const [showWebCitation, setShowWebCitation] = useState(false);
|
|
730
|
-
const [webCitationData, setWebCitationData] = useState(undefined);
|
|
731
|
-
const [isLoading, setIsLoading] = useState(false);
|
|
732
|
-
|
|
733
|
-
const handleGenerateWebCitation = async () => {
|
|
734
|
-
setShowWebCitation(true);
|
|
735
|
-
setIsLoading(true);
|
|
736
|
-
|
|
737
|
-
const response = await fetch('/api/web-citation/generate');
|
|
738
|
-
const data = await response.json();
|
|
739
|
-
|
|
740
|
-
setWebCitationData(data);
|
|
741
|
-
setIsLoading(false);
|
|
742
|
-
};
|
|
743
|
-
|
|
744
|
-
return (
|
|
745
|
-
<GptWebCitation
|
|
746
|
-
gptCitation={gptCitation}
|
|
747
|
-
isWebCitation={true}
|
|
748
|
-
webCitationData={webCitationData}
|
|
749
|
-
showWebCitation={showWebCitation}
|
|
750
|
-
isWebCitationLoading={isLoading}
|
|
751
|
-
onGenerateWebCitation={handleGenerateWebCitation}
|
|
752
|
-
onToggleCitationView={() => setShowWebCitation((prev) => !prev)}
|
|
753
|
-
/>
|
|
754
|
-
);
|
|
755
|
-
}
|
|
756
|
-
```
|
|
757
|
-
|
|
758
|
-
### Usage 2: Web Citation API Response Shape
|
|
759
|
-
|
|
760
|
-
Pass the API response from your web citation service as `webCitationData`:
|
|
761
|
-
|
|
762
|
-
```tsx
|
|
763
|
-
const webCitationData = {
|
|
764
|
-
citationId: '550e8400-e29b-41d4-a716-446655440061',
|
|
765
|
-
content:
|
|
766
|
-
'The decision strength is 85% because:<ol><li>The exact <a href="https://example.com/article">valuation of SpaceX</a> fluctuates between sources.</li></ol>',
|
|
767
|
-
citationType: 'web',
|
|
768
|
-
citationUrl: 'https://example.com/article',
|
|
769
|
-
imageMetadata: {
|
|
770
|
-
signed_url: 'https://storage.example.com/image_citations/screenshot.png',
|
|
771
|
-
blob_path: 'image_citations/screenshot.png',
|
|
772
|
-
gs_uri: 'gs://bucket/image_citations/screenshot.png',
|
|
773
|
-
},
|
|
774
|
-
};
|
|
775
|
-
|
|
776
|
-
<GptWebCitation
|
|
777
|
-
gptCitation={gptCitation}
|
|
778
|
-
isWebCitation={true}
|
|
779
|
-
webCitationData={webCitationData}
|
|
780
|
-
showWebCitation={true}
|
|
781
|
-
/>
|
|
782
|
-
```
|
|
783
|
-
|
|
784
|
-
When `imageMetadata.signed_url` is present, the component renders a screenshot snapshot. Otherwise it falls back to rendering the `content` field as markdown/HTML.
|
|
785
|
-
|
|
786
|
-
### Usage 3: GPT-Only Mode (No Web Citation)
|
|
787
|
-
|
|
788
|
-
Set `isWebCitation={false}` to render only the GPT citation with no toggle button:
|
|
789
|
-
|
|
790
|
-
```tsx
|
|
791
|
-
<GptWebCitation
|
|
792
|
-
gptCitation={gptCitation}
|
|
793
|
-
isWebCitation={false}
|
|
794
|
-
/>
|
|
795
|
-
```
|
|
796
|
-
|
|
797
|
-
### Usage 4: Hide Expand Buttons
|
|
798
|
-
|
|
799
|
-
Hide the web citation screenshot expand button:
|
|
800
|
-
|
|
801
|
-
```tsx
|
|
802
|
-
<GptWebCitation
|
|
803
|
-
gptCitation={gptCitation}
|
|
804
|
-
isWebCitation={true}
|
|
805
|
-
webCitationData={webCitationData}
|
|
806
|
-
showWebCitation={true}
|
|
807
|
-
showExpandImageButton={false}
|
|
808
|
-
/>
|
|
809
|
-
```
|
|
810
|
-
|
|
811
|
-
Hide the GPT citation header maximize/expand icon:
|
|
812
|
-
|
|
813
|
-
```tsx
|
|
814
|
-
<GptWebCitation
|
|
815
|
-
gptCitation={gptCitation}
|
|
816
|
-
isWebCitation={true}
|
|
817
|
-
showGptMaximizeButton={false}
|
|
818
|
-
/>
|
|
819
|
-
```
|
|
820
|
-
|
|
821
|
-
You can also use `gptCitation.disableMaximize: true` directly on the GPT config.
|
|
822
|
-
|
|
823
|
-
### Usage 5: Custom Styling via Props (matched heights)
|
|
824
|
-
|
|
825
|
-
Layout, borders, and heights for **both GPT and web views** can be controlled from the parent without modifying component internals:
|
|
826
|
-
|
|
827
|
-
```tsx
|
|
828
|
-
const sharedPanelHeight = '520px';
|
|
829
|
-
const sharedContentHeight = '384px';
|
|
830
|
-
|
|
831
|
-
<GptWebCitation
|
|
832
|
-
gptCitation={{
|
|
833
|
-
...gptCitation,
|
|
834
|
-
bodyHeight: sharedContentHeight,
|
|
835
|
-
}}
|
|
836
|
-
isWebCitation={true}
|
|
837
|
-
webCitationData={webCitationData}
|
|
838
|
-
showGptMaximizeButton={true}
|
|
839
|
-
styles={{
|
|
840
|
-
container: { maxWidth: 900 },
|
|
841
|
-
gptCitation: {
|
|
842
|
-
wrapper: {
|
|
843
|
-
minHeight: sharedPanelHeight,
|
|
844
|
-
border: '1px solid #e5e7eb',
|
|
845
|
-
borderRadius: 8,
|
|
846
|
-
},
|
|
847
|
-
footerAction: { left: '1.5rem' },
|
|
848
|
-
toggleButton: { minWidth: 180, fontSize: 14 },
|
|
849
|
-
},
|
|
850
|
-
webCitation: {
|
|
851
|
-
panel: {
|
|
852
|
-
minHeight: sharedPanelHeight,
|
|
853
|
-
border: '1px solid #e5e7eb',
|
|
854
|
-
borderRadius: 8,
|
|
855
|
-
},
|
|
856
|
-
header: { padding: '8px 16px' },
|
|
857
|
-
content: {
|
|
858
|
-
minHeight: sharedContentHeight,
|
|
859
|
-
maxHeight: sharedContentHeight,
|
|
860
|
-
overflowY: 'auto',
|
|
861
|
-
},
|
|
862
|
-
footer: { padding: '8px 16px' },
|
|
863
|
-
toggleButton: { minWidth: 180, fontSize: 14 },
|
|
864
|
-
learnedFrom: { fontSize: 13 },
|
|
865
|
-
},
|
|
866
|
-
}}
|
|
867
|
-
/>
|
|
868
|
-
```
|
|
869
|
-
|
|
870
|
-
#### Style keys
|
|
871
|
-
|
|
872
|
-
| Key | Applies to | Description |
|
|
873
|
-
|-----|------------|-------------|
|
|
874
|
-
| `container` | Both views | Shared outer wrapper (`overlay` in GPT view, merged into web `panel`) |
|
|
875
|
-
| `gptCitation.wrapper` | GPT view | Border card around GPT citation (left/right borders restored here) |
|
|
876
|
-
| `gptCitation.footerAction` | GPT view | View Web Citation button row in footer |
|
|
877
|
-
| `gptCitation.toggleButton` | GPT view | View Web Citation button styles |
|
|
878
|
-
| `webCitation.panel` | Web view | Outer web citation card |
|
|
879
|
-
| `webCitation.header` | Web view | Source label + pagination + score badge row |
|
|
880
|
-
| `webCitation.content` | Web view | Main content area (markdown, image, skeleton) |
|
|
881
|
-
| `webCitation.footer` | Web view | View GPT Citation + Learned From row |
|
|
882
|
-
| `webCitation.toggleButton` | Web view | View GPT Citation button styles |
|
|
883
|
-
| `webCitation.learnedFrom` | Web view | "Learned From …" text styles |
|
|
884
|
-
|
|
885
|
-
Legacy flat keys (`gptCitationWrapper`, `footerAction`, `webCitationButton`) still work for backward compatibility.
|
|
886
|
-
|
|
887
|
-
### Props
|
|
888
|
-
|
|
889
|
-
| Prop | Type | Default | Description |
|
|
890
|
-
|------|------|---------|-------------|
|
|
891
|
-
| `gptCitation` | `IGptCitationConfig` | **required** | GPT citation config passed to `CognitiveInternalgptCoreComponent` (`item`, `headerTitle`, `iconsConfig`, `DocumentTitle`, `previewCallback`, etc.) |
|
|
892
|
-
| `isWebCitation` | `boolean` | `false` | When `true`, enables web citation toggle and web view. When `false`, only GPT citation is shown. |
|
|
893
|
-
| `webCitationData` | `IWebCitationApiResponse` | — | Web citation API response (content, image snapshot, URL) |
|
|
894
|
-
| `showWebCitation` | `boolean` | — | Controls which view is active. Omit for uncontrolled internal state. |
|
|
895
|
-
| `onGenerateWebCitation` | `() => void` | — | Called when user clicks **View Web Citation** and no cached web data exists yet |
|
|
896
|
-
| `isWebCitationLoading` | `boolean` | `false` | Parent-controlled loading state while web citation is being fetched |
|
|
897
|
-
| `onToggleCitationView` | `() => void` | — | Called when user toggles between GPT and web views |
|
|
898
|
-
| `showExpandImageButton` | `boolean` | `true` | Show/hide the full-screen expand button on web citation image snapshots |
|
|
899
|
-
| `showGptMaximizeButton` | `boolean` | `true` | Show/hide the GPT citation header maximize/expand icon (`gptCitation.disableMaximize: true` when `false`) |
|
|
900
|
-
| `topic` | `string` | auto | Override topic label in web citation header (auto-extracted from content if omitted) |
|
|
901
|
-
| `sourceLabel` | `string` | auto | Override header source label in web view |
|
|
902
|
-
| `relevanceScore` | `number` | auto | Override relevance/decision strength score (auto-extracted from content if omitted) |
|
|
903
|
-
| `learnedFrom` | `string` | auto | Site name shown in web citation footer (auto-extracted from `citationUrl` if omitted) |
|
|
904
|
-
| `styles` | `IGptWebCitationStyleOverrides` | — | Style overrides for GPT and web citation views (see Usage 5) |
|
|
905
|
-
|
|
906
|
-
### `IGptCitationConfig` (gptCitation prop)
|
|
907
|
-
|
|
908
|
-
| Field | Type | Description |
|
|
909
|
-
|-------|------|-------------|
|
|
910
|
-
| `item` | `INonReasoningSource` | GPT reasoning data (`dataSource`, `confidence_score`, highlights, etc.) |
|
|
911
|
-
| `headerTitle` | `string` | Panel header title |
|
|
912
|
-
| `index` | `number` | Citation index |
|
|
913
|
-
| `iconsConfig` | `object` | Icon components (`ChevronDownIcon`, `ChevronUpIcon`, `MaximizeIcon`, `CloseIcon`) |
|
|
914
|
-
| `DocumentTitle` | `string` | Source document label shown in the GPT footer (right side) |
|
|
915
|
-
| `previewCallback` | `() => void` | Called when the source link is clicked |
|
|
916
|
-
| `bodyHeight` | `string` | Optional fixed GPT content body height (use with `styles.webCitation.content` to match web view height) |
|
|
917
|
-
| `disableMaximize` | `boolean` | Disable GPT header fullscreen maximize button (or use `showGptMaximizeButton={false}`) |
|
|
918
|
-
|
|
919
|
-
### `IWebCitationApiResponse` (webCitationData prop)
|
|
920
|
-
|
|
921
|
-
| Field | Type | Description |
|
|
922
|
-
|-------|------|-------------|
|
|
923
|
-
| `citationId` | `string` | Unique citation identifier |
|
|
924
|
-
| `content` | `string` | HTML/markdown web citation content |
|
|
925
|
-
| `citationType` | `string` | Citation type (e.g. `"web"`) |
|
|
926
|
-
| `citationUrl` | `string` | Original source URL |
|
|
927
|
-
| `imageMetadata` | `object` | Image snapshot metadata |
|
|
928
|
-
| `imageMetadata.signed_url` | `string` | Signed URL for screenshot image (preferred) |
|
|
929
|
-
| `imageMetadata.gs_uri` | `string` | GCS URI fallback for image |
|
|
930
|
-
| `db` | `object` | Database metadata (`citation_id`, `blob_path`) |
|
|
931
|
-
|
|
932
|
-
### View Behavior
|
|
933
|
-
|
|
934
|
-
| State | What renders |
|
|
935
|
-
|-------|--------------|
|
|
936
|
-
| `isWebCitation={false}` | GPT citation only |
|
|
937
|
-
| `isWebCitation={true}`, `showWebCitation={false}` | GPT citation + **View Web Citation** button (left footer) + source link (right footer) |
|
|
938
|
-
| `isWebCitation={true}`, `showWebCitation={true}` | Web citation panel with snapshot/markdown, highlight nav, and **View GPT Citation** button |
|
|
939
|
-
|
|
940
|
-
### Local Test Component
|
|
941
|
-
|
|
942
|
-
A test harness is available at `src/features/GptWebCitation/GptWebCitationTest.tsx`. Run the citation dev server with `GptWebCitationTest` mounted in `src/index.tsx` to preview the component interactively.
|
|
943
|
-
|
|
944
|
-
---
|
|
945
675
|
|
|
946
676
|
## CodeCitation
|
|
947
677
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("tslib"),e=require("react/jsx-runtime"),t=require("@mui/material"),r=require("react"),i=require("../CognitiveCompareConstants.js"),o=require("lucide-react"),a=require("react-markdown"),s=require("../CognitiveComparehelpers.js"),l=require("rehype-raw"),c=require("remark-gfm");function d(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}var u=d(r),g=d(a),h=d(l),p=function(n){return"function"==typeof n?n:(null==n?void 0:n.default)||n},f=[p(d(c).default)],v=[p(h.default)],x=u.default.memo(function(a){var l=a.content,c=a.overlayContent,d=a.sxStyles,h=a.deviationBadges,p=void 0===h?[]:h,x=a.highlights,m=void 0===x?[]:x;a.maintainRelativeOrder;var _=a.highlightBg,b=a.suppressHighlightBg,y=void 0!==b&&b,B=a.collisionKey,E=r.useRef(null),j=!!c,C=r.useMemo(function(){return p.reduce(function(e,t){var r;return n.__assign(n.__assign({},e),((r={})[t.id]=t,r))},{})},[p]),k=r.useRef({badgeMap:C,highlightBg:_,hideHighlightBg:j,suppressHighlightBg:y});k.current={badgeMap:C,highlightBg:_,hideHighlightBg:j,suppressHighlightBg:y};var S=function(e,t){return u.default.Children.map(e,function(e){var r;if(!u.default.isValidElement(e))return e;var i=(null===(r=e.props)||void 0===r?void 0:r.children)?S(e.props.children,t):e.props.children,o=u.default.cloneElement(e,n.__assign(n.__assign({},e.props),{children:i}));return t(o)})},F=r.useMemo(function(){return{mark:function(t){var r,i,o,a,s=t.children,l=n.__rest(t,["children"]),c=k.current,d=c.badgeMap,u=c.highlightBg,g=c.hideHighlightBg,h=c.suppressHighlightBg,p=l["data-badge-id"],f=p?d[p]:null,v=l["data-highlight-color"],x=null!==(a=null!==(i=null!=v?v:null===(r=null==f?void 0:f.style)||void 0===r?void 0:r.highlightBg)&&void 0!==i?i:null===(o=null==f?void 0:f.style)||void 0===o?void 0:o.badgeBg)&&void 0!==a?a:u,m="true"===l["data-is-suggested-deviation-fix"]||h;return e.jsx("span",n.__assign({style:n.__assign(n.__assign(n.__assign({},m?{}:{backgroundColor:x}),{borderRadius:"2px",display:"inline",boxDecorationBreak:"clone",WebkitBoxDecorationBreak:"clone",backgroundClip:"padding-box",padding:"0 1px"}),g?{color:"transparent"}:{})},{children:s}))},span:function(r){var a,s,l,c,d,u,g=r.children,h=n.__rest(r,["children"]),p=k.current.badgeMap,f=h["data-badge-id"];if(!f)return e.jsx("span",n.__assign({},h,{children:g}));var v=p[f];if(!v)return e.jsx("span",n.__assign({},h,{children:g}));var x="number"==typeof v.stackIndex?v.stackIndex:0,m="translateY(calc(-20% + ".concat(12*x,"px + var(--badge-nudge, 0px)))");return e.jsxs(t.Box,n.__assign({component:"span",sx:{position:"static",display:"inline"}},{children:[e.jsxs(t.Box,n.__assign({ref:v.badgeRef,className:"deviation-badge","data-side":v.side||"right",sx:n.__assign(n.__assign({fontStyle:"normal",position:"absolute",zIndex:30+x,display:"inline-flex",alignItems:"stretch",fontSize:"10px",bgcolor:(null===(a=v.style)||void 0===a?void 0:a.badgeBg)||"#EEF2FF",color:(null===(s=v.style)||void 0===s?void 0:s.badgeText)||i.DEFAULT_DEVIAION_COLOR,border:"1px solid ".concat((null===(l=v.style)||void 0===l?void 0:l.badgeBorder)||"#C7D2FE"),borderRadius:"12px",fontWeight:600,whiteSpace:"nowrap",boxShadow:"0 1px 3px rgba(0,0,0,0.07)",overflow:"hidden",transition:"none"},"left"===v.side?{right:"-16px",transform:"".concat(m," translateX(calc(100% + 8px))")}:{left:"-16px",transform:"".concat(m," translateX(calc(-100% - 8px))")}),v.isConnected&&v.style&&{outline:"2px solid ".concat(v.style.badgeBorder),outlineOffset:"1px"})},{children:[e.jsxs(t.Box,n.__assign({onClick:function(n){n.stopPropagation(),v.onSummaryClick&&v.onSummaryClick(n)},sx:{display:"flex",alignItems:"center",px:1,py:.3,cursor:"pointer","&:hover":{bgcolor:"rgba(0,0,0,0.04)"}}},{children:[e.jsx(t.Box,n.__assign({component:"span",sx:{fontSize:"10px",fontWeight:700}},{children:v.label})),("left"===v.side||v.isOrphan)&&e.jsx(t.Box,n.__assign({component:"span",sx:{fontSize:"10px",pl:.5,ml:.5,borderLeft:"1px solid ".concat((null===(c=v.style)||void 0===c?void 0:c.badgeBorder)||"#C7D2FE")}},{children:null!=v.score&&"N/A"!==v.score&&"NA"!==v.score&&0!==v.score?"".concat(v.score):"N/A"===v.score||"NA"===v.score?"N/A":"Same"}))]})),("left"===v.side||v.isOrphan)&&e.jsx(t.Box,n.__assign({onClick:function(n){n.stopPropagation(),v.onClick&&v.onClick(n)},sx:{display:"flex",alignItems:"center",px:.5,borderLeft:"1px solid ".concat((null===(d=v.style)||void 0===d?void 0:d.badgeBorder)||"#C7D2FE"),cursor:"pointer","&:hover":{bgcolor:"rgba(0,0,0,0.06)"}}},{children:e.jsx(o.EllipsisVertical,{size:12,color:(null===(u=v.style)||void 0===u?void 0:u.badgeText)||"#3730A3"})}))]})),g]}))},table:function(r){var i=r.children;return e.jsx(t.Box,n.__assign({component:"table",sx:{width:"100%",borderCollapse:"collapse",my:1,fontSize:"inherit"}},{children:i}))},thead:function(r){var i=r.children;return e.jsx(t.Box,n.__assign({component:"thead"},{children:i}))},tbody:function(r){var i=r.children;return e.jsx(t.Box,n.__assign({component:"tbody"},{children:i}))},tr:function(r){var i=r.children;return e.jsx(t.Box,n.__assign({component:"tr",sx:{borderBottom:"1px solid #E5E7EB"}},{children:i}))},th:function(r){var i=r.children;return e.jsx(t.Box,n.__assign({component:"th",sx:{border:"1px solid #E5E7EB",padding:"8px",textAlign:"left",fontWeight:600,backgroundColor:"#F9FAFB"}},{children:i}))},td:function(r){var i=r.children;return e.jsx(t.Box,n.__assign({component:"td",sx:{border:"1px solid #E5E7EB",padding:"8px",verticalAlign:"top"}},{children:i}))},code:function(t){var r=t.children;return e.jsx("span",n.__assign({style:{fontFamily:"inherit",fontSize:"inherit"}},{children:r}))},pre:function(t){var r=t.children;return e.jsx("span",n.__assign({style:{fontFamily:"inherit",fontSize:"inherit",display:"block",whiteSpace:"pre-wrap"}},{children:r}))},updated:function(n){var t=n.children;return e.jsx(e.Fragment,{children:t})},deleted:function(t){var r=t.children,i=S(r,function(n){return u.default.cloneElement(n,{"data-is-suggested-deviation-fix":"true"})});return e.jsx("span",n.__assign({style:{boxShadow:"inset 0 1px 0 #EF4444, inset 0 -1px 0 #EF4444",backgroundColor:"#FCCCCC",textDecoration:"line-through"}},{children:i}))},changed:function(t){var r=t.children,i=S(r,function(n){return u.default.cloneElement(n,{"data-is-suggested-deviation-fix":"true"})});return e.jsx("span",n.__assign({style:{boxShadow:"inset 0 1px 0 #2F59FF, inset 0 -1px 0 #2F59FF",backgroundColor:"#D5E8FF"}},{children:i}))},ul:function(r){var i=r.children,o=n.__rest(r,["children"]);return e.jsx(t.Box,n.__assign({component:"ul",sx:{mt:1,mb:1,pl:3,listStyleType:"disc"}},o,{children:i}))},ol:function(r){var i=r.children,o=n.__rest(r,["children"]);return e.jsx(t.Box,n.__assign({component:"ol",sx:{mt:1,mb:1,pl:3,listStyleType:"decimal"}},o,{children:i}))},li:function(r){var i=r.children,o=n.__rest(r,["children"]);return e.jsx(t.Box,n.__assign({component:"li",sx:{mb:.5,display:"list-item"}},o,{children:i}))}}},[]),w=function(n){if(!n||"string"!=typeof n)return"";var e=n,t=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(/((?:<\/?[a-z]+[^>]*>\s*)+)([*+\-] |\d+\. )/gi,"$2$1")).replace(/\\(['"])/g,"$1").replace(/\\n/g,"\n").replace(/\\\./g,".").replace(/\r\n/g,"\n")).replace(/^(\d+\.)(\s{2,})/gm,function(n,e,t){return"".concat(e.slice(0,-1),"\\.").concat(t)})).replace(/^(\d+\.)\s*\n+(\s+)(\S)/gm,function(n,e,t,r){return"".concat(e," ").concat(r)})).replace(/([^\n])\n(#{1,6} )/g,"$1\n\n$2")).replace(/([^\n])\n([ \t]*(?:[#*+\-] |\d+\. ))/g,"$1\n\n$2")).replace(/\n{3,}/g,"\n\n")).replace(/^[ \t]+(?![ \t]*([\*\-\+] |\d+\. ))/gm,function(n){return n.replace(/ /g," ").replace(/\t/g," ")})).split(/(\n{2,})/);return(e=t.map(function(n){return/^\n+$/.test(n)||/\|.*\|/.test(n)&&/\|[\s:|-]+\|/.test(n)||/^#{1,6} /.test(n.trimStart())?n:n.replace(/\n(?=[^\n])/g,function(e,t){var r=n.slice(t+1);return/^[ \t]*([#>|\-*+]|\d+\.)/.test(r)?"\n":" "})}).join("")).trim()},M=function(n){return n.replace(/[\.,;:]/g," ")},A=r.useMemo(function(){return p.map(function(n){return{id:n.id,connected:n.isConnected,stackIndex:n.stackIndex,size:n.size}})},[p]),T=r.useMemo(function(){var e=w(l||""),t=y?M(e):e,r=(p||[]).map(function(n){var e,t;return{id:null==n?void 0:n.id,highlight:w((null==n?void 0:n.highlight)||""),highlightColor:(null===(e=null==n?void 0:n.style)||void 0===e?void 0:e.highlightBg)||(null===(t=null==n?void 0:n.style)||void 0===t?void 0:t.badgeBg)||_}}).filter(function(n){return n.id&&n.highlight}),i={};r.forEach(function(n){i[n.highlight]||(i[n.highlight]=[]),i[n.highlight].push(n)});var o=function(n,e,t,r){void 0===e&&(e=""),void 0===r&&(r=[]);var i=!1,o=function(n){var o=function(n,e,t){var r,i,o;void 0===e&&(e="");var a=n.match(/^(\s*)([\s\S]*?)(\s*)$/);if(!a)return n;var s=null!==(r=a[1])&&void 0!==r?r:"",l=null!==(i=a[2])&&void 0!==i?i:"",c=null!==(o=a[3])&&void 0!==o?o:"";return l?s+function(n,e){void 0===n&&(n="");var t=e?' data-highlight-color="'.concat(e,'"'):"",r=n?' data-badge-id="'.concat(n,'"'):"";return"<mark".concat(r).concat(t,">")}(e,t)+l+"</mark>"+c:n}(n,e,t),a=o;if(!i&&r.length>0){i=!0;var s="",l="";r.forEach(function(n){s+=function(n){return'<span data-badge-id="'.concat(n,'">')}(n.id),l="</span>"+l}),a=s+o+l}return""+a};return n.split(/(\n+)/).map(function(n){return/^\n+$/.test(n)?n:n.trim()?""===n.replace(/[|:\-\s]/g,"")&&n.includes("-")?n:n.includes("|")?n.split(/(\|)/).map(function(n){return"|"!==n&&n.trim()?o(n):n}).join(""):o(n):n}).join("")},a=[];Object.entries(i).forEach(function(n){var r=n[0],i=n[1],o=e.indexOf(r),l=!1;if(-1===o&&y){var c=M(r);-1!==(o=t.indexOf(c))&&(l=!0)}if(-1!==o){for(var d=i[0].highlightColor,u=1;u<i.length;u++)d=s.mixHexColors(d,i[u].highlightColor||"");a.push({highlight:r,start:o,end:o+r.length,badges:i,color:d,usedLooseMatch:l})}});var c=new Set(Object.keys(i));(m||[]).forEach(function(n){if(n){var r=w(n);if(r&&!c.has(r)){var i=e.indexOf(r),o=!1;if(-1===i&&y){var s=M(r);-1!==(i=t.indexOf(s))&&(o=!0)}if(-1!==i){var l=e.slice(0,i);(l.match(/</g)||[]).length===(l.match(/>/g)||[]).length&&a.push({highlight:r,start:i,end:i+r.length,badges:[],color:_||"",usedLooseMatch:o})}}}}),a.sort(function(n,e){return n.start-e.start||e.end-n.end});var d=[],u={};a.forEach(function(n,e){for(var t=n.start,r=n.end,i=0,o=d;i<o.length;i++){var a=o[i],s=a.start,l=a.end,c=t<l&&r>l&&t>=s,g=t<s&&r>s&&r<=l;if(t>=s&&r<=l){n.orphaned=!0,u[e]=a.matchIdx;break}c&&(t=l),g&&(r=s)}n.trimmedStart=t,n.trimmedEnd=r,!n.orphaned&&t<r&&d.push({start:t,end:r,matchIdx:e})});var g={};Object.entries(u).forEach(function(n){var e=n[0],t=n[1],r=Number(e);g[t]||(g[t]=[]),g[t].push(r)});var h=a.map(function(e,t){return n.__assign(n.__assign({},e),{idx:t})}).filter(function(n){return!n.orphaned}).sort(function(n,e){var t,r;return(null!==(t=e.trimmedStart)&&void 0!==t?t:e.start)-(null!==(r=n.trimmedStart)&&void 0!==r?r:n.start)});return h.forEach(function(n){var t,r,i,l,c=null!==(t=n.trimmedStart)&&void 0!==t?t:n.start,d=null!==(r=n.trimmedEnd)&&void 0!==r?r:n.end;if(!(c>=d)){var u=e.slice(c,d),h=function(n,e,t,r){if(!t.length)return n;var i=t.map(function(n){return a[n]}).sort(function(n,e){return n.start-e.start}),l="",c=0;return i.forEach(function(t){var i,a,d=Math.max(c,t.start-e),u=Math.max(d,t.end-e);if(!(d>=u)){var g=s.mixHexColors(r,t.color||"");l+=n.slice(c,d),l+=o(n.slice(d,u),(null===(a=null===(i=t.badges)||void 0===i?void 0:i[0])||void 0===a?void 0:a.id)||"",g,t.badges||[]),c=u}}),l+=n.slice(c)}(n.usedLooseMatch||c!==n.start||d!==n.end?u:n.highlight,n.start,g[n.idx]||[],n.color),p=o(h,(null===(l=null===(i=n.badges)||void 0===i?void 0:i[0])||void 0===l?void 0:l.id)||"",n.color,n.badges||[]);e=e.slice(0,c)+p+e.slice(d)}}),e},[l,p,m,_,y]),z=r.useMemo(function(){return c?w(c||""):""},[c]),O=!!c,q={"& *":{fontFamily:"inherit"},"& code, & pre, & kbd, & samp":{fontFamily:"inherit !important",fontSize:"inherit",background:"none",padding:0,border:"none",whiteSpace:"pre-wrap"},"& p, & li, & ul, & ol":{position:"static",overflow:"visible",whiteSpace:"pre-wrap"}},I=n.__assign(n.__assign(n.__assign(n.__assign({},d),q),{position:"relative",overflow:"visible",whiteSpace:"normal",gridArea:"1 / 1",zIndex:2}),O?{color:"transparent",userSelect:"none",pointerEvents:"none","& .deviation-badge":{pointerEvents:"auto"},"& table":{visibility:"hidden",margin:"0 !important"},"& th, & td":{padding:"0 !important",border:"none !important",backgroundColor:"transparent !important"},"& tr":{border:"none !important"},"& p:empty":{display:"none"}}:{}),P=n.__assign(n.__assign(n.__assign({},d),q),{position:"relative",overflow:"visible",whiteSpace:"normal",gridArea:"1 / 1",zIndex:1,pointerEvents:"auto"});return r.useLayoutEffect(function(){if(E.current){var n=function(){var n=Array.from(E.current.querySelectorAll(".deviation-badge"));if(0!==n.length){n.forEach(function(n){n.style.setProperty("--badge-nudge","0px")});var e=n.filter(function(n){return"left"===n.dataset.side}),t=n.filter(function(n){return"left"!==n.dataset.side}),r=E.current.getBoundingClientRect(),i=r.bottom-4,o=r.top+4,a=function(n){if(0!==n.length){var e=n.map(function(n){var e=n.getBoundingClientRect();return{el:n,naturalTop:e.top,height:e.height,currentTop:e.top}});e.sort(function(n,e){return n.naturalTop-e.naturalTop});var t=[],r=[];e.forEach(function(n){if(0===r.length)r.push(n);else{var e=r[r.length-1],i=e.currentTop+e.height;n.naturalTop<i+8?(n.currentTop=i+8,r.push(n)):(t.push(r),r=[n])}}),r.length>0&&t.push(r),t.forEach(function(n){var e=n[n.length-1],t=e.currentTop+e.height;if(t>i){var r=t-i,a=n[0].currentTop-o,s=Math.max(0,Math.min(r,a));n.forEach(function(n){n.currentTop-=s})}}),t.flat().forEach(function(n){var e=n.currentTop-n.naturalTop;n.el.style.setProperty("--badge-nudge","".concat(e,"px"))})}};a(e),a(t)}},e=requestAnimationFrame(function(){requestAnimationFrame(function(){n()})}),t=new ResizeObserver(function(){requestAnimationFrame(n)});return t.observe(E.current),function(){t.disconnect(),cancelAnimationFrame(e)}}},[T,B,A]),e.jsxs(t.Box,n.__assign({ref:E,sx:{position:"relative",display:"grid"}},{children:[e.jsx(t.Typography,n.__assign({component:"div",sx:n.__assign(n.__assign({},I),{padding:"3px"})},{children:e.jsx(g.default,n.__assign({components:F,remarkPlugins:f,rehypePlugins:v},{children:T.replace(/#{3}/g,"")}))})),O&&e.jsx(t.Typography,n.__assign({component:"div",sx:P},{children:e.jsx(g.default,n.__assign({components:F,remarkPlugins:f,rehypePlugins:v},{children:z}))}))]}))},s.areMarkdownPropsEqual);exports.MemoizedMarkdown=x;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("tslib"),e=require("react/jsx-runtime"),t=require("@mui/material"),r=require("react"),i=require("../CognitiveCompareConstants.js"),o=require("lucide-react"),a=require("react-markdown"),s=require("../CognitiveComparehelpers.js"),l=require("rehype-raw"),c=require("remark-gfm");function d(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}var u=d(r),g=d(a),h=d(l),p=function(n){return"function"==typeof n?n:(null==n?void 0:n.default)||n},f=[p(d(c).default)],v=[p(h.default)],x=u.default.memo(function(a){var l=a.content,c=a.overlayContent,d=a.sxStyles,h=a.deviationBadges,p=void 0===h?[]:h,x=a.highlights,m=void 0===x?[]:x;a.maintainRelativeOrder;var _=a.highlightBg,b=a.suppressHighlightBg,y=void 0!==b&&b,B=a.collisionKey,E=r.useRef(null),j=!!c,C=r.useMemo(function(){return p.reduce(function(e,t){var r;return n.__assign(n.__assign({},e),((r={})[t.id]=t,r))},{})},[p]),k=r.useRef({badgeMap:C,highlightBg:_,hideHighlightBg:j,suppressHighlightBg:y});k.current={badgeMap:C,highlightBg:_,hideHighlightBg:j,suppressHighlightBg:y};var S=function(e,t){return u.default.Children.map(e,function(e){var r;if(!u.default.isValidElement(e))return e;var i=(null===(r=e.props)||void 0===r?void 0:r.children)?S(e.props.children,t):e.props.children,o=u.default.cloneElement(e,n.__assign(n.__assign({},e.props),{children:i}));return t(o)})},F=r.useMemo(function(){return{mark:function(t){var r,i,o,a,s=t.children,l=n.__rest(t,["children"]),c=k.current,d=c.badgeMap,u=c.highlightBg,g=c.hideHighlightBg,h=c.suppressHighlightBg,p=l["data-badge-id"],f=p?d[p]:null,v=l["data-highlight-color"],x=null!==(a=null!==(i=null!=v?v:null===(r=null==f?void 0:f.style)||void 0===r?void 0:r.highlightBg)&&void 0!==i?i:null===(o=null==f?void 0:f.style)||void 0===o?void 0:o.badgeBg)&&void 0!==a?a:u,m="true"===l["data-is-suggested-deviation-fix"]||h;return e.jsx("span",n.__assign({style:n.__assign(n.__assign(n.__assign({},m?{}:{backgroundColor:x}),{borderRadius:"2px",display:"inline",boxDecorationBreak:"clone",WebkitBoxDecorationBreak:"clone",backgroundClip:"padding-box",padding:"0 1px"}),g?{color:"transparent"}:{})},{children:s}))},span:function(r){var a,s,l,c,d,u,g=r.children,h=n.__rest(r,["children"]),p=k.current.badgeMap,f=h["data-badge-id"];if(!f)return e.jsx("span",n.__assign({},h,{children:g}));var v=p[f];if(!v)return e.jsx("span",n.__assign({},h,{children:g}));var x="number"==typeof v.stackIndex?v.stackIndex:0,m="translateY(calc(-20% + ".concat(12*x,"px + var(--badge-nudge, 0px)))");return e.jsxs(t.Box,n.__assign({component:"span",sx:{position:"static",display:"inline"}},{children:[e.jsxs(t.Box,n.__assign({ref:v.badgeRef,className:"deviation-badge","data-side":v.side||"right",sx:n.__assign(n.__assign({fontStyle:"normal",position:"absolute",zIndex:30+x,display:"inline-flex",alignItems:"stretch",fontSize:"10px",bgcolor:(null===(a=v.style)||void 0===a?void 0:a.badgeBg)||"#EEF2FF",color:(null===(s=v.style)||void 0===s?void 0:s.badgeText)||i.DEFAULT_DEVIAION_COLOR,border:"1px solid ".concat((null===(l=v.style)||void 0===l?void 0:l.badgeBorder)||"#C7D2FE"),borderRadius:"12px",fontWeight:600,whiteSpace:"nowrap",boxShadow:"0 1px 3px rgba(0,0,0,0.07)",overflow:"hidden",transition:"none"},"left"===v.side?{right:"-16px",transform:"".concat(m," translateX(calc(100% + 8px))")}:{left:"-16px",transform:"".concat(m," translateX(calc(-100% - 8px))")}),v.isConnected&&v.style&&{outline:"2px solid ".concat(v.style.badgeBorder),outlineOffset:"1px"})},{children:[e.jsxs(t.Box,n.__assign({onClick:function(n){n.stopPropagation(),v.onSummaryClick&&v.onSummaryClick(n)},sx:{display:"flex",alignItems:"center",px:1,py:.3,cursor:"pointer","&:hover":{bgcolor:"rgba(0,0,0,0.04)"}}},{children:[e.jsx(t.Box,n.__assign({component:"span",sx:{fontSize:"10px",fontWeight:700}},{children:v.label})),("left"===v.side||v.isOrphan)&&e.jsx(t.Box,n.__assign({component:"span",sx:{fontSize:"10px",pl:.5,ml:.5,borderLeft:"1px solid ".concat((null===(c=v.style)||void 0===c?void 0:c.badgeBorder)||"#C7D2FE")}},{children:null!=v.score&&"N/A"!==v.score&&"NA"!==v.score&&0!==v.score?"".concat(v.score):"N/A"===v.score||"NA"===v.score?"N/A":"Same"}))]})),("left"===v.side||v.isOrphan)&&e.jsx(t.Box,n.__assign({onClick:function(n){n.stopPropagation(),v.onClick&&v.onClick(n)},sx:{display:"flex",alignItems:"center",px:.5,borderLeft:"1px solid ".concat((null===(d=v.style)||void 0===d?void 0:d.badgeBorder)||"#C7D2FE"),cursor:"pointer","&:hover":{bgcolor:"rgba(0,0,0,0.06)"}}},{children:e.jsx(o.EllipsisVertical,{size:12,color:(null===(u=v.style)||void 0===u?void 0:u.badgeText)||"#3730A3"})}))]})),g]}))},table:function(r){var i=r.children;return e.jsx(t.Box,n.__assign({component:"table",sx:{width:"100%",borderCollapse:"collapse",my:1,fontSize:"inherit"}},{children:i}))},thead:function(r){var i=r.children;return e.jsx(t.Box,n.__assign({component:"thead"},{children:i}))},tbody:function(r){var i=r.children;return e.jsx(t.Box,n.__assign({component:"tbody"},{children:i}))},tr:function(r){var i=r.children;return e.jsx(t.Box,n.__assign({component:"tr",sx:{borderBottom:"1px solid #E5E7EB"}},{children:i}))},th:function(r){var i=r.children;return e.jsx(t.Box,n.__assign({component:"th",sx:{border:"1px solid #E5E7EB",padding:"8px",textAlign:"left",fontWeight:600,backgroundColor:"#F9FAFB"}},{children:i}))},td:function(r){var i=r.children;return e.jsx(t.Box,n.__assign({component:"td",sx:{border:"1px solid #E5E7EB",padding:"8px",verticalAlign:"top"}},{children:i}))},code:function(t){var r=t.children;return e.jsx("span",n.__assign({style:{fontFamily:"inherit",fontSize:"inherit"}},{children:r}))},pre:function(t){var r=t.children;return e.jsx("span",n.__assign({style:{fontFamily:"inherit",fontSize:"inherit",display:"block",whiteSpace:"pre-wrap"}},{children:r}))},updated:function(n){var t=n.children;return e.jsx(e.Fragment,{children:t})},deleted:function(t){var r=t.children,i=S(r,function(n){return u.default.cloneElement(n,{"data-is-suggested-deviation-fix":"true"})});return e.jsx("span",n.__assign({style:{boxShadow:"inset 0 1px 0 #EF4444, inset 0 -1px 0 #EF4444",backgroundColor:"#FCCCCC",textDecoration:"line-through"}},{children:i}))},changed:function(t){var r=t.children,i=S(r,function(n){return u.default.cloneElement(n,{"data-is-suggested-deviation-fix":"true"})});return e.jsx("span",n.__assign({style:{boxShadow:"inset 0 1px 0 #2F59FF, inset 0 -1px 0 #2F59FF",backgroundColor:"#D5E8FF"}},{children:i}))},ul:function(r){var i=r.children;return e.jsx(t.Box,n.__assign({component:"ul",sx:{mt:1,mb:1,pl:3,listStyleType:"disc"}},{children:i}))},ol:function(r){var i=r.children;return e.jsx(t.Box,n.__assign({component:"ol",sx:{mt:1,mb:1,pl:3,listStyleType:"decimal"}},{children:i}))},li:function(r){var i=r.children;return e.jsx(t.Box,n.__assign({component:"li",sx:{mb:.5,display:"list-item"}},{children:i}))}}},[]),w=function(n){if(!n||"string"!=typeof n)return"";var e=n,t=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(/((?:<\/?[a-z]+[^>]*>\s*)+)([*+\-] |\d+\. )/gi,"$2$1")).replace(/\\(['"])/g,"$1").replace(/\\n/g,"\n").replace(/\\\./g,".").replace(/\r\n/g,"\n")).replace(/^(\d+\.)(\s{2,})/gm,function(n,e,t){return"".concat(e.slice(0,-1),"\\.").concat(t)})).replace(/^(\d+\.)\s*\n+(\s+)(\S)/gm,function(n,e,t,r){return"".concat(e," ").concat(r)})).replace(/([^\n])\n(#{1,6} )/g,"$1\n\n$2")).replace(/([^\n])\n([ \t]*(?:[#*+\-] |\d+\. ))/g,"$1\n\n$2")).replace(/\n{3,}/g,"\n\n")).replace(/^[ \t]+(?![ \t]*([\*\-\+] |\d+\. ))/gm,function(n){return n.replace(/ /g," ").replace(/\t/g," ")})).split(/(\n{2,})/);return(e=t.map(function(n){return/^\n+$/.test(n)||/\|.*\|/.test(n)&&/\|[\s:|-]+\|/.test(n)||/^#{1,6} /.test(n.trimStart())?n:n.replace(/\n(?=[^\n])/g,function(e,t){var r=n.slice(t+1);return/^[ \t]*([#>|\-*+]|\d+\.)/.test(r)?"\n":" "})}).join("")).trim()},M=function(n){return n.replace(/[\.,;:]/g," ")},A=r.useMemo(function(){return p.map(function(n){return{id:n.id,connected:n.isConnected,stackIndex:n.stackIndex,size:n.size}})},[p]),T=r.useMemo(function(){var e=w(l||""),t=y?M(e):e,r=(p||[]).map(function(n){var e,t;return{id:null==n?void 0:n.id,highlight:w((null==n?void 0:n.highlight)||""),highlightColor:(null===(e=null==n?void 0:n.style)||void 0===e?void 0:e.highlightBg)||(null===(t=null==n?void 0:n.style)||void 0===t?void 0:t.badgeBg)||_}}).filter(function(n){return n.id&&n.highlight}),i={};r.forEach(function(n){i[n.highlight]||(i[n.highlight]=[]),i[n.highlight].push(n)});var o=function(n,e,t,r){void 0===e&&(e=""),void 0===r&&(r=[]);var i=!1,o=function(n){var o=function(n,e,t){var r,i,o;void 0===e&&(e="");var a=n.match(/^(\s*)([\s\S]*?)(\s*)$/);if(!a)return n;var s=null!==(r=a[1])&&void 0!==r?r:"",l=null!==(i=a[2])&&void 0!==i?i:"",c=null!==(o=a[3])&&void 0!==o?o:"";return l?s+function(n,e){void 0===n&&(n="");var t=e?' data-highlight-color="'.concat(e,'"'):"",r=n?' data-badge-id="'.concat(n,'"'):"";return"<mark".concat(r).concat(t,">")}(e,t)+l+"</mark>"+c:n}(n,e,t),a=o;if(!i&&r.length>0){i=!0;var s="",l="";r.forEach(function(n){s+=function(n){return'<span data-badge-id="'.concat(n,'">')}(n.id),l="</span>"+l}),a=s+o+l}return""+a};return n.split(/(\n+)/).map(function(n){return/^\n+$/.test(n)?n:n.trim()?""===n.replace(/[|:\-\s]/g,"")&&n.includes("-")?n:n.includes("|")?n.split(/(\|)/).map(function(n){return"|"!==n&&n.trim()?o(n):n}).join(""):o(n):n}).join("")},a=[];Object.entries(i).forEach(function(n){var r=n[0],i=n[1],o=e.indexOf(r),l=!1;if(-1===o&&y){var c=M(r);-1!==(o=t.indexOf(c))&&(l=!0)}if(-1!==o){for(var d=i[0].highlightColor,u=1;u<i.length;u++)d=s.mixHexColors(d,i[u].highlightColor||"");a.push({highlight:r,start:o,end:o+r.length,badges:i,color:d,usedLooseMatch:l})}});var c=new Set(Object.keys(i));(m||[]).forEach(function(n){if(n){var r=w(n);if(r&&!c.has(r)){var i=e.indexOf(r),o=!1;if(-1===i&&y){var s=M(r);-1!==(i=t.indexOf(s))&&(o=!0)}if(-1!==i){var l=e.slice(0,i);(l.match(/</g)||[]).length===(l.match(/>/g)||[]).length&&a.push({highlight:r,start:i,end:i+r.length,badges:[],color:_||"",usedLooseMatch:o})}}}}),a.sort(function(n,e){return n.start-e.start||e.end-n.end});var d=[],u={};a.forEach(function(n,e){for(var t=n.start,r=n.end,i=0,o=d;i<o.length;i++){var a=o[i],s=a.start,l=a.end,c=t<l&&r>l&&t>=s,g=t<s&&r>s&&r<=l;if(t>=s&&r<=l){n.orphaned=!0,u[e]=a.matchIdx;break}c&&(t=l),g&&(r=s)}n.trimmedStart=t,n.trimmedEnd=r,!n.orphaned&&t<r&&d.push({start:t,end:r,matchIdx:e})});var g={};Object.entries(u).forEach(function(n){var e=n[0],t=n[1],r=Number(e);g[t]||(g[t]=[]),g[t].push(r)});var h=a.map(function(e,t){return n.__assign(n.__assign({},e),{idx:t})}).filter(function(n){return!n.orphaned}).sort(function(n,e){var t,r;return(null!==(t=e.trimmedStart)&&void 0!==t?t:e.start)-(null!==(r=n.trimmedStart)&&void 0!==r?r:n.start)});return h.forEach(function(n){var t,r,i,l,c=null!==(t=n.trimmedStart)&&void 0!==t?t:n.start,d=null!==(r=n.trimmedEnd)&&void 0!==r?r:n.end;if(!(c>=d)){var u=e.slice(c,d),h=function(n,e,t,r){if(!t.length)return n;var i=t.map(function(n){return a[n]}).sort(function(n,e){return n.start-e.start}),l="",c=0;return i.forEach(function(t){var i,a,d=Math.max(c,t.start-e),u=Math.max(d,t.end-e);if(!(d>=u)){var g=s.mixHexColors(r,t.color||"");l+=n.slice(c,d),l+=o(n.slice(d,u),(null===(a=null===(i=t.badges)||void 0===i?void 0:i[0])||void 0===a?void 0:a.id)||"",g,t.badges||[]),c=u}}),l+=n.slice(c)}(n.usedLooseMatch||c!==n.start||d!==n.end?u:n.highlight,n.start,g[n.idx]||[],n.color),p=o(h,(null===(l=null===(i=n.badges)||void 0===i?void 0:i[0])||void 0===l?void 0:l.id)||"",n.color,n.badges||[]);e=e.slice(0,c)+p+e.slice(d)}}),e},[l,p,m,_,y]),z=r.useMemo(function(){return c?w(c||""):""},[c]),O=!!c,q={"& *":{fontFamily:"inherit"},"& code, & pre, & kbd, & samp":{fontFamily:"inherit !important",fontSize:"inherit",background:"none",padding:0,border:"none",whiteSpace:"pre-wrap"},"& p, & li, & ul, & ol":{position:"static",overflow:"visible",whiteSpace:"pre-wrap"}},I=n.__assign(n.__assign(n.__assign(n.__assign({},d),q),{position:"relative",overflow:"visible",whiteSpace:"normal",gridArea:"1 / 1",zIndex:2}),O?{color:"transparent",userSelect:"none",pointerEvents:"none","& .deviation-badge":{pointerEvents:"auto"},"& table":{visibility:"hidden",margin:"0 !important"},"& th, & td":{padding:"0 !important",border:"none !important",backgroundColor:"transparent !important"},"& tr":{border:"none !important"},"& p:empty":{display:"none"}}:{}),P=n.__assign(n.__assign(n.__assign({},d),q),{position:"relative",overflow:"visible",whiteSpace:"normal",gridArea:"1 / 1",zIndex:1,pointerEvents:"auto"});return r.useLayoutEffect(function(){if(E.current){var n=function(){var n=Array.from(E.current.querySelectorAll(".deviation-badge"));if(0!==n.length){n.forEach(function(n){n.style.setProperty("--badge-nudge","0px")});var e=n.filter(function(n){return"left"===n.dataset.side}),t=n.filter(function(n){return"left"!==n.dataset.side}),r=E.current.getBoundingClientRect(),i=r.bottom-4,o=r.top+4,a=function(n){if(0!==n.length){var e=n.map(function(n){var e=n.getBoundingClientRect();return{el:n,naturalTop:e.top,height:e.height,currentTop:e.top}});e.sort(function(n,e){return n.naturalTop-e.naturalTop});var t=[],r=[];e.forEach(function(n){if(0===r.length)r.push(n);else{var e=r[r.length-1],i=e.currentTop+e.height;n.naturalTop<i+8?(n.currentTop=i+8,r.push(n)):(t.push(r),r=[n])}}),r.length>0&&t.push(r),t.forEach(function(n){var e=n[n.length-1],t=e.currentTop+e.height;if(t>i){var r=t-i,a=n[0].currentTop-o,s=Math.max(0,Math.min(r,a));n.forEach(function(n){n.currentTop-=s})}}),t.flat().forEach(function(n){var e=n.currentTop-n.naturalTop;n.el.style.setProperty("--badge-nudge","".concat(e,"px"))})}};a(e),a(t)}},e=requestAnimationFrame(function(){requestAnimationFrame(function(){n()})}),t=new ResizeObserver(function(){requestAnimationFrame(n)});return t.observe(E.current),function(){t.disconnect(),cancelAnimationFrame(e)}}},[T,B,A]),e.jsxs(t.Box,n.__assign({ref:E,sx:{position:"relative",display:"grid"}},{children:[e.jsx(t.Typography,n.__assign({component:"div",sx:n.__assign(n.__assign({},I),{padding:"3px"})},{children:e.jsx(g.default,n.__assign({components:F,remarkPlugins:f,rehypePlugins:v},{children:T.replace(/#{3}/g,"")}))})),O&&e.jsx(t.Typography,n.__assign({component:"div",sx:P},{children:e.jsx(g.default,n.__assign({components:F,remarkPlugins:f,rehypePlugins:v},{children:z}))}))]}))},s.areMarkdownPropsEqual);exports.MemoizedMarkdown=x;
|
|
2
2
|
//# sourceMappingURL=memoizedMarkdown.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),l=require("react/jsx-runtime"),i=require("react"),s=require("../components/CitationAIConfidenceDisplay.js"),n=require("../AiReasoning/components/icons/FullScreenIcon.js"),a=require("./components/ImagePreviewDialog.js"),t=require("@mui/material"),r=require("./WebCitationWithImageContent.module.css.js");exports.default=function(o){var d,c,u,g,v,f,m,h=null===(d=null==o?void 0:o.closeCitationConfig)||void 0===d?void 0:d.CloseIcon,C=o.visitIcon,j=i.useState(!1),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),l=require("react/jsx-runtime"),i=require("react"),s=require("../components/CitationAIConfidenceDisplay.js"),n=require("../AiReasoning/components/icons/FullScreenIcon.js"),a=require("./components/ImagePreviewDialog.js"),t=require("@mui/material"),r=require("./WebCitationWithImageContent.module.css.js");exports.default=function(o){var d,c,u,g,v,f,m,h=null===(d=null==o?void 0:o.closeCitationConfig)||void 0===d?void 0:d.CloseIcon,C=o.visitIcon,j=i.useState(!1),p=j[0],x=j[1],_=null===(c=null==o?void 0:o.cachingConfig)||void 0===c?void 0:c.queryClient,y=o.styles,N=["getSignedUrl",o.gsUtilPath||""],I=null!==(g=null===(u=o.cachingConfig)||void 0===u?void 0:u.useGetSignedUrlQuery)&&void 0!==g?g:function(){return{data:void 0}},P=null!==(f=null===(v=o.cachingConfig)||void 0===v?void 0:v.useGetSignedUrlMutation)&&void 0!==f?f:function(){return{mutate:function(e){},isPending:!1}},U=I((null==o?void 0:o.gsUtilPath)||"",N).data,S=P((null==o?void 0:o.gsUtilPath)||""),k=S.mutate,D=S.isPending;return i.useEffect(function(){o.signedUrl||o.gsUtilPath&&(((null==_?void 0:_.getQueryData)?_.getQueryData(N):void 0)||k({gsUtilPath:o.gsUtilPath}))},[o.gsUtilPath,o.signedUrl,_,k]),l.jsxs("div",e.__assign({className:r.default.container,style:null==y?void 0:y.container},{children:[l.jsxs("div",e.__assign({className:r.default.header,style:null==y?void 0:y.header},{children:[l.jsx("div",e.__assign({className:r.default.headerLeft,style:null==y?void 0:y.headerLeft},{children:l.jsx("a",e.__assign({className:r.default.link,target:"_blank",rel:"noopener noreferrer",href:o.url},{children:o.label}))})),(null==o?void 0:o.closeCitationConfig)?l.jsxs("div",e.__assign({className:r.default.headerActions,style:null==y?void 0:y.headerActions},{children:[s.renderCitationAIConfidenceDisplay(o.relevanceScore,!1,null==y?void 0:y.aiConfidenceDisplayPill),l.jsx("div",{className:r.default.divider,style:null==y?void 0:y.divider}),h&&l.jsx("div",e.__assign({className:r.default.closeIconWrapper,style:null==y?void 0:y.closeIconWrapper,onClick:o.closeCitationConfig.handleCloseCitationPreview},{children:l.jsx(h,{className:r.default.closeIcon})}))]})):l.jsx(l.Fragment,{children:s.renderCitationAIConfidenceDisplay(o.relevanceScore,!0,null==y?void 0:y.aiConfidenceDisplayPill)})]})),o.signedUrl?l.jsxs("div",e.__assign({className:r.default.imageWrapper,style:null==y?void 0:y.imageWrapper},{children:[l.jsx("img",{src:o.signedUrl,alt:"images",className:r.default.image,style:null==y?void 0:y.image}),l.jsx("div",e.__assign({className:r.default.fullScreenButton,style:null==y?void 0:y.fullScreenButton,onClick:function(){return x(!0)}},{children:l.jsx(n.default,{})})),l.jsx(a.default,{open:p,handleClose:function(){return x(!1)},src:o.signedUrl,CloseIcon:o.PreviewDialogCloseIcon,styles:null===(m=o.styles)||void 0===m?void 0:m.previewDialogStyles})]})):D?l.jsxs("div",e.__assign({className:r.default.loaderContainer},{children:[l.jsx("style",{children:".mui-circular-progress-circle { stroke-linecap: round; }"}),l.jsx(t.CircularProgress,{size:48,thickness:4,style:{color:"#4F85FF"},classes:{circle:"mui-circular-progress-circle"}}),l.jsx("span",e.__assign({className:r.default.loaderText,style:null==y?void 0:y.loaderText},{children:"Loading Image..."}))]})):U&&l.jsxs("div",e.__assign({className:r.default.imageWrapper},{children:[l.jsx("img",{src:U,alt:"images",className:r.default.image,style:null==y?void 0:y.image}),l.jsx("div",e.__assign({className:r.default.fullScreenButton,style:null==y?void 0:y.fullScreenButton,onClick:function(){return x(!0)}},{children:l.jsx(n.default,{})})),l.jsx(a.default,{open:p,handleClose:function(){return x(!1)},src:U,CloseIcon:o.PreviewDialogCloseIcon,styles:null==y?void 0:y.previewDialogStyles})]})),l.jsx("div",e.__assign({className:r.default.footer,style:null==y?void 0:y.footer},{children:l.jsxs("div",e.__assign({className:r.default.footerContent,style:null==y?void 0:y.footerContent},{children:[l.jsx("span",{children:"Open link in new tab to read in detail"}),l.jsxs("a",e.__assign({className:r.default.visitLink,style:null==y?void 0:y.visitLink,href:o.url,target:"_blank",rel:"noopener noreferrer"},{children:[l.jsx("span",{children:"Visit Link"}),l.jsx(C,{className:r.default.visitIcon})]}))]}))}))]}))};
|
|
2
2
|
//# sourceMappingURL=WebCitationWithImageContent.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});!function(){if("undefined"==typeof document)return;const e=document.createElement("style");e.type="text/css";const t=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;t&&e.setAttribute("nonce",t),e.appendChild(document.createTextNode(".WebCitationWithImageContent-module_container__0caP3{border:1px solid #e5e7eb;display:flex;flex-direction:column;gap:1rem;height:100%;min-height:200px;position:relative}.WebCitationWithImageContent-module_header__yd-ED{align-items:center;border-bottom:1px solid #e5e7eb;display:flex;flex-direction:row;justify-content:space-between;padding:.5rem 1rem;width:100%}.WebCitationWithImageContent-module_headerLeft__vemHH{align-items:center;display:flex;flex-direction:row;gap:.5rem}.WebCitationWithImageContent-module_link__9am5l{color:#1f2937;font-weight:600;text-decoration-color:#1f2937;text-decoration:none}.WebCitationWithImageContent-module_headerActions__pinS2{align-items:center;display:flex;flex-direction:row;gap:1rem;justify-content:space-between}.WebCitationWithImageContent-module_divider__OR-bP{align-self:stretch;background-color:#e5e7eb;margin-bottom:-.5rem;margin-top:-.5rem;width:1px}.WebCitationWithImageContent-module_closeIconWrapper__D6HHj{cursor:pointer}.WebCitationWithImageContent-module_closeIcon__CDrjR{color:#6b7280;height:1.5rem;width:1.5rem}.WebCitationWithImageContent-module_imageWrapper__Zk2jF{padding-left:.75rem;padding-right:.75rem;position:relative}.WebCitationWithImageContent-module_image__KJMJS{border:1px solid #e5e7eb;border-radius:8px;width:100%}.WebCitationWithImageContent-module_fullScreenButton__JH8MC{background-color:#f9fafb;border:1px solid #d0d5dd;border-radius:8px;bottom:.5rem;cursor:pointer;padding:.5rem;position:absolute;right:1.25rem}.WebCitationWithImageContent-module_loaderContainer__9UQBM{align-items:center;display:flex;flex-direction:column;justify-content:center;min-height:400px}.WebCitationWithImageContent-module_loaderText__fqlg2{color:#4b5563;font-size:.875rem;font-weight:500;margin-top:.5rem}.WebCitationWithImageContent-module_footer__7-3Et{
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});!function(){if("undefined"==typeof document)return;const e=document.createElement("style");e.type="text/css";const t=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;t&&e.setAttribute("nonce",t),e.appendChild(document.createTextNode(".WebCitationWithImageContent-module_container__0caP3{border:1px solid #e5e7eb;display:flex;flex-direction:column;gap:1rem;height:100%;min-height:200px;position:relative}.WebCitationWithImageContent-module_header__yd-ED{align-items:center;border-bottom:1px solid #e5e7eb;display:flex;flex-direction:row;justify-content:space-between;padding:.5rem 1rem;width:100%}.WebCitationWithImageContent-module_headerLeft__vemHH{align-items:center;display:flex;flex-direction:row;gap:.5rem}.WebCitationWithImageContent-module_link__9am5l{color:#1f2937;font-weight:600;text-decoration-color:#1f2937;text-decoration:none}.WebCitationWithImageContent-module_headerActions__pinS2{align-items:center;display:flex;flex-direction:row;gap:1rem;justify-content:space-between}.WebCitationWithImageContent-module_divider__OR-bP{align-self:stretch;background-color:#e5e7eb;margin-bottom:-.5rem;margin-top:-.5rem;width:1px}.WebCitationWithImageContent-module_closeIconWrapper__D6HHj{cursor:pointer}.WebCitationWithImageContent-module_closeIcon__CDrjR{color:#6b7280;height:1.5rem;width:1.5rem}.WebCitationWithImageContent-module_imageWrapper__Zk2jF{padding-left:.75rem;padding-right:.75rem;position:relative}.WebCitationWithImageContent-module_image__KJMJS{border:1px solid #e5e7eb;border-radius:8px;width:100%}.WebCitationWithImageContent-module_fullScreenButton__JH8MC{background-color:#f9fafb;border:1px solid #d0d5dd;border-radius:8px;bottom:.5rem;cursor:pointer;padding:.5rem;position:absolute;right:1.25rem}.WebCitationWithImageContent-module_loaderContainer__9UQBM{align-items:center;display:flex;flex-direction:column;justify-content:center;min-height:400px}.WebCitationWithImageContent-module_loaderText__fqlg2{color:#4b5563;font-size:.875rem;font-weight:500;margin-top:.5rem}.WebCitationWithImageContent-module_footer__7-3Et{align-items:center;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between;padding-bottom:1rem;width:100%}.WebCitationWithImageContent-module_footerContent__U60cY{align-items:center;color:#000;display:flex;flex-direction:row;gap:.5rem;padding-left:.75rem}.WebCitationWithImageContent-module_visitLink__YiGQo{align-items:center;background-color:#eee9fd;border-radius:8px;color:#5928ed;display:flex;flex-direction:row;gap:.5rem;padding:.25rem .5rem;text-decoration:none;width:fit-content}.WebCitationWithImageContent-module_visitIcon__FjN9-{color:#5928ed;height:1rem;width:1rem}"));const o=document.head||document.getElementsByTagName("head")[0]||document.documentElement;o&&o.appendChild(e)}(),exports.default={container:"WebCitationWithImageContent-module_container__0caP3",header:"WebCitationWithImageContent-module_header__yd-ED",headerLeft:"WebCitationWithImageContent-module_headerLeft__vemHH",link:"WebCitationWithImageContent-module_link__9am5l",headerActions:"WebCitationWithImageContent-module_headerActions__pinS2",divider:"WebCitationWithImageContent-module_divider__OR-bP",closeIconWrapper:"WebCitationWithImageContent-module_closeIconWrapper__D6HHj",closeIcon:"WebCitationWithImageContent-module_closeIcon__CDrjR",imageWrapper:"WebCitationWithImageContent-module_imageWrapper__Zk2jF",image:"WebCitationWithImageContent-module_image__KJMJS",fullScreenButton:"WebCitationWithImageContent-module_fullScreenButton__JH8MC",loaderContainer:"WebCitationWithImageContent-module_loaderContainer__9UQBM",loaderText:"WebCitationWithImageContent-module_loaderText__fqlg2",footer:"WebCitationWithImageContent-module_footer__7-3Et",footerContent:"WebCitationWithImageContent-module_footerContent__U60cY",visitLink:"WebCitationWithImageContent-module_visitLink__YiGQo",visitIcon:"WebCitationWithImageContent-module_visitIcon__FjN9-"};
|
|
2
2
|
//# sourceMappingURL=WebCitationWithImageContent.module.css.js.map
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./features/CodeCitation/CodeCitation.js"),t=require("./features/ProjectAccordion/ProjectAccordion.js"),i=require("./features/BookCitation/BookCitation.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./features/CodeCitation/CodeCitation.js"),t=require("./features/ProjectAccordion/ProjectAccordion.js"),i=require("./features/BookCitation/BookCitation.js"),n=require("./features/Bookemon/Bookemon.js"),o=require("./features/PdfEditorCitation/PdfEditorCitation.js"),r=require("./features/CitationRenderer/CitationRenderer.js"),a=require("./features/CitationRenderer/MarkdownRenderer.js"),s=require("./features/CodeCitation/_components/CodeEditor.js"),u=require("./features/PaginatedTable/PaginatedTable.js"),C=require("./features/CognitiveInternalgptReasoning/CognitiveInternalgptReasoningComponent.js"),d=require("./features/ChatCitation/ChatCitationRenderer.js"),f=require("./features/CognitiveDecisioning/CognitiveDecisioningWrapper.js"),p=require("./features/PdfViewer/PdfViewer.js"),l=require("./features/CognitiveDecisioning/FaqCitation/FaqCitation.js"),g=require("./features/RequirementAiCitations/ImageCitation/ImageCitationContent.js"),x=require("./features/RequirementAiCitations/VideoCitation/VideoCitationContent.js"),q=require("./features/RequirementAiCitations/FileCitation/FileCitationContent.js"),j=require("./features/RequirementAiCitations/WebCitation/WebCitationWithImageContent.js"),m=require("./features/MarkdownWithImageCitation/MarkdownWithImageCitation.js"),c=require("./features/RequirementAiCitations/AiReasoning/AiReasoningCitation.js"),R=require("./features/TableCitation/TableCitationContent.js"),I=require("./features/CitationViewer/CitationsViewer.js"),S=require("./features/ExcelCitation/ExcelCitations.js"),T=require("./features/ScannedDocCitation/ScannedDocCitation.js"),E=require("./features/ChatDrawer/ChatDrawer.js"),D=require("./features/ChatDrawer/constants/ChatDrawer.js"),A=require("./features/SplitterCitations/SplitterCitationsComponent.js"),P=require("./features/CognitiveCompare/CognitiveCompare.js"),v=require("./features/CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.js"),w=require("./features/TextualGuidelines/TextualGuideLinesComponent.js"),h=require("./features/IngestionStatus/IngestionStatusComponent.js"),_=require("./features/ManageRemainders/ManageReminders.js");exports.CodeCitation=e.default,exports.ProjectAccordian=t.default,exports.BookCitation=i.default,exports.Bookemon=n.default,exports.PdfCitation=o.PdfEditorCitation,exports.CitationRenderer=r.default,exports.MarkdownRenderer=a.default,Object.defineProperty(exports,"DiagnosticSeverity",{enumerable:!0,get:function(){return s.DiagnosticSeverity}}),exports.PaginatedTable=u.default,exports.InternalgptReasoningComponent=C.default,exports.NonWebReasoningComponent=C.default,exports.ChatCitation=d.default,exports.CognitiveDecisioningCard=f.default,exports.PdfViewer=p.default,exports.FaqCitation=l.default,exports.ImageCitationContent=g.default,exports.VideoCitationContent=x.default,exports.FileCitationContent=q.default,exports.WebCitationWithImageContent=j.default,exports.MarkdownWithImageCitation=m.default,exports.AiReasoningCitation=c.default,exports.TableCitationContent=R.default,exports.CitationsViewer=I.default,exports.ExcelCitation=S.default,exports.ScannedDocCitation=T.default,exports.ChatDrawer=E.default,exports.FILE_INGESTION_STATUS=D.FILE_INGESTION_STATUS,exports.SUMMARY_EXPAND_HEIGHT_NUDGE=D.SUMMARY_EXPAND_HEIGHT_NUDGE,exports.TRUNCATE_THRESHOLD=D.TRUNCATE_THRESHOLD,exports.SplitterCitationsComponent=A.default,exports.CognitiveCompare=P.default,exports.CognitiveInternalgptCoreComponent=v.default,exports.TextualGuideLinesComponent=w.default,exports.IngestionStatusChip=h.IngestionStatusChip,exports.IngestionStatusComponent=h.IngestionStatusComponent,exports.ManageReminders=_.ManageReminders;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as n,__rest as e}from"tslib";import{jsx as t,jsxs as r,Fragment as i}from"react/jsx-runtime";import{Box as o,Typography as a}from"@mui/material";import l,{useRef as c,useMemo as d,useLayoutEffect as s}from"react";import{DEFAULT_DEVIAION_COLOR as u}from"../CognitiveCompareConstants.js";import{EllipsisVertical as h}from"lucide-react";import p from"react-markdown";import{mixHexColors as g,areMarkdownPropsEqual as f}from"../CognitiveComparehelpers.js";import v from"rehype-raw";import m from"remark-gfm";var b=function(n){return"function"==typeof n?n:(null==n?void 0:n.default)||n},x=[b(m)],y=[b(v)],E=l.memo(function(f){var v=f.content,m=f.overlayContent,b=f.sxStyles,E=f.deviationBadges,C=void 0===E?[]:E,S=f.highlights,k=void 0===S?[]:S;f.maintainRelativeOrder;var B=f.highlightBg,F=f.suppressHighlightBg,w=void 0!==F&&F,A=f.collisionKey,T=c(null),z=!!m,I=d(function(){return C.reduce(function(e,t){var r;return n(n({},e),((r={})[t.id]=t,r))},{})},[C]),O=c({badgeMap:I,highlightBg:B,hideHighlightBg:z,suppressHighlightBg:w});O.current={badgeMap:I,highlightBg:B,hideHighlightBg:z,suppressHighlightBg:w};var M=function(e,t){return l.Children.map(e,function(e){var r;if(!l.isValidElement(e))return e;var i=(null===(r=e.props)||void 0===r?void 0:r.children)?M(e.props.children,t):e.props.children,o=l.cloneElement(e,n(n({},e.props),{children:i}));return t(o)})},$=d(function(){return{mark:function(r){var i,o,a,l,c=r.children,d=e(r,["children"]),s=O.current,u=s.badgeMap,h=s.highlightBg,p=s.hideHighlightBg,g=s.suppressHighlightBg,f=d["data-badge-id"],v=f?u[f]:null,m=d["data-highlight-color"],b=null!==(l=null!==(o=null!=m?m:null===(i=null==v?void 0:v.style)||void 0===i?void 0:i.highlightBg)&&void 0!==o?o:null===(a=null==v?void 0:v.style)||void 0===a?void 0:a.badgeBg)&&void 0!==l?l:h,x="true"===d["data-is-suggested-deviation-fix"]||g;return t("span",n({style:n(n(n({},x?{}:{backgroundColor:b}),{borderRadius:"2px",display:"inline",boxDecorationBreak:"clone",WebkitBoxDecorationBreak:"clone",backgroundClip:"padding-box",padding:"0 1px"}),p?{color:"transparent"}:{})},{children:c}))},span:function(i){var a,l,c,d,s,p,g=i.children,f=e(i,["children"]),v=O.current.badgeMap,m=f["data-badge-id"];if(!m)return t("span",n({},f,{children:g}));var b=v[m];if(!b)return t("span",n({},f,{children:g}));var x="number"==typeof b.stackIndex?b.stackIndex:0,y="translateY(calc(-20% + ".concat(12*x,"px + var(--badge-nudge, 0px)))");return r(o,n({component:"span",sx:{position:"static",display:"inline"}},{children:[r(o,n({ref:b.badgeRef,className:"deviation-badge","data-side":b.side||"right",sx:n(n({fontStyle:"normal",position:"absolute",zIndex:30+x,display:"inline-flex",alignItems:"stretch",fontSize:"10px",bgcolor:(null===(a=b.style)||void 0===a?void 0:a.badgeBg)||"#EEF2FF",color:(null===(l=b.style)||void 0===l?void 0:l.badgeText)||u,border:"1px solid ".concat((null===(c=b.style)||void 0===c?void 0:c.badgeBorder)||"#C7D2FE"),borderRadius:"12px",fontWeight:600,whiteSpace:"nowrap",boxShadow:"0 1px 3px rgba(0,0,0,0.07)",overflow:"hidden",transition:"none"},"left"===b.side?{right:"-16px",transform:"".concat(y," translateX(calc(100% + 8px))")}:{left:"-16px",transform:"".concat(y," translateX(calc(-100% - 8px))")}),b.isConnected&&b.style&&{outline:"2px solid ".concat(b.style.badgeBorder),outlineOffset:"1px"})},{children:[r(o,n({onClick:function(n){n.stopPropagation(),b.onSummaryClick&&b.onSummaryClick(n)},sx:{display:"flex",alignItems:"center",px:1,py:.3,cursor:"pointer","&:hover":{bgcolor:"rgba(0,0,0,0.04)"}}},{children:[t(o,n({component:"span",sx:{fontSize:"10px",fontWeight:700}},{children:b.label})),("left"===b.side||b.isOrphan)&&t(o,n({component:"span",sx:{fontSize:"10px",pl:.5,ml:.5,borderLeft:"1px solid ".concat((null===(d=b.style)||void 0===d?void 0:d.badgeBorder)||"#C7D2FE")}},{children:null!=b.score&&"N/A"!==b.score&&"NA"!==b.score&&0!==b.score?"".concat(b.score):"N/A"===b.score||"NA"===b.score?"N/A":"Same"}))]})),("left"===b.side||b.isOrphan)&&t(o,n({onClick:function(n){n.stopPropagation(),b.onClick&&b.onClick(n)},sx:{display:"flex",alignItems:"center",px:.5,borderLeft:"1px solid ".concat((null===(s=b.style)||void 0===s?void 0:s.badgeBorder)||"#C7D2FE"),cursor:"pointer","&:hover":{bgcolor:"rgba(0,0,0,0.06)"}}},{children:t(h,{size:12,color:(null===(p=b.style)||void 0===p?void 0:p.badgeText)||"#3730A3"})}))]})),g]}))},table:function(e){var r=e.children;return t(o,n({component:"table",sx:{width:"100%",borderCollapse:"collapse",my:1,fontSize:"inherit"}},{children:r}))},thead:function(e){var r=e.children;return t(o,n({component:"thead"},{children:r}))},tbody:function(e){var r=e.children;return t(o,n({component:"tbody"},{children:r}))},tr:function(e){var r=e.children;return t(o,n({component:"tr",sx:{borderBottom:"1px solid #E5E7EB"}},{children:r}))},th:function(e){var r=e.children;return t(o,n({component:"th",sx:{border:"1px solid #E5E7EB",padding:"8px",textAlign:"left",fontWeight:600,backgroundColor:"#F9FAFB"}},{children:r}))},td:function(e){var r=e.children;return t(o,n({component:"td",sx:{border:"1px solid #E5E7EB",padding:"8px",verticalAlign:"top"}},{children:r}))},code:function(e){var r=e.children;return t("span",n({style:{fontFamily:"inherit",fontSize:"inherit"}},{children:r}))},pre:function(e){var r=e.children;return t("span",n({style:{fontFamily:"inherit",fontSize:"inherit",display:"block",whiteSpace:"pre-wrap"}},{children:r}))},updated:function(n){var e=n.children;return t(i,{children:e})},deleted:function(e){var r=e.children,i=M(r,function(n){return l.cloneElement(n,{"data-is-suggested-deviation-fix":"true"})});return t("span",n({style:{boxShadow:"inset 0 1px 0 #EF4444, inset 0 -1px 0 #EF4444",backgroundColor:"#FCCCCC",textDecoration:"line-through"}},{children:i}))},changed:function(e){var r=e.children,i=M(r,function(n){return l.cloneElement(n,{"data-is-suggested-deviation-fix":"true"})});return t("span",n({style:{boxShadow:"inset 0 1px 0 #2F59FF, inset 0 -1px 0 #2F59FF",backgroundColor:"#D5E8FF"}},{children:i}))},ul:function(r){var i=r.children,a=e(r,["children"]);return t(o,n({component:"ul",sx:{mt:1,mb:1,pl:3,listStyleType:"disc"}},a,{children:i}))},ol:function(r){var i=r.children,a=e(r,["children"]);return t(o,n({component:"ol",sx:{mt:1,mb:1,pl:3,listStyleType:"decimal"}},a,{children:i}))},li:function(r){var i=r.children,a=e(r,["children"]);return t(o,n({component:"li",sx:{mb:.5,display:"list-item"}},a,{children:i}))}}},[]),j=function(n){if(!n||"string"!=typeof n)return"";var e=n,t=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(/((?:<\/?[a-z]+[^>]*>\s*)+)([*+\-] |\d+\. )/gi,"$2$1")).replace(/\\(['"])/g,"$1").replace(/\\n/g,"\n").replace(/\\\./g,".").replace(/\r\n/g,"\n")).replace(/^(\d+\.)(\s{2,})/gm,function(n,e,t){return"".concat(e.slice(0,-1),"\\.").concat(t)})).replace(/^(\d+\.)\s*\n+(\s+)(\S)/gm,function(n,e,t,r){return"".concat(e," ").concat(r)})).replace(/([^\n])\n(#{1,6} )/g,"$1\n\n$2")).replace(/([^\n])\n([ \t]*(?:[#*+\-] |\d+\. ))/g,"$1\n\n$2")).replace(/\n{3,}/g,"\n\n")).replace(/^[ \t]+(?![ \t]*([\*\-\+] |\d+\. ))/gm,function(n){return n.replace(/ /g," ").replace(/\t/g," ")})).split(/(\n{2,})/);return(e=t.map(function(n){return/^\n+$/.test(n)||/\|.*\|/.test(n)&&/\|[\s:|-]+\|/.test(n)||/^#{1,6} /.test(n.trimStart())?n:n.replace(/\n(?=[^\n])/g,function(e,t){var r=n.slice(t+1);return/^[ \t]*([#>|\-*+]|\d+\.)/.test(r)?"\n":" "})}).join("")).trim()},P=function(n){return n.replace(/[\.,;:]/g," ")},D=d(function(){return C.map(function(n){return{id:n.id,connected:n.isConnected,stackIndex:n.stackIndex,size:n.size}})},[C]),H=d(function(){var e=j(v||""),t=w?P(e):e,r=(C||[]).map(function(n){var e,t;return{id:null==n?void 0:n.id,highlight:j((null==n?void 0:n.highlight)||""),highlightColor:(null===(e=null==n?void 0:n.style)||void 0===e?void 0:e.highlightBg)||(null===(t=null==n?void 0:n.style)||void 0===t?void 0:t.badgeBg)||B}}).filter(function(n){return n.id&&n.highlight}),i={};r.forEach(function(n){i[n.highlight]||(i[n.highlight]=[]),i[n.highlight].push(n)});var o=function(n,e,t,r){void 0===e&&(e=""),void 0===r&&(r=[]);var i=!1,o=function(n){var o=function(n,e,t){var r,i,o;void 0===e&&(e="");var a=n.match(/^(\s*)([\s\S]*?)(\s*)$/);if(!a)return n;var l=null!==(r=a[1])&&void 0!==r?r:"",c=null!==(i=a[2])&&void 0!==i?i:"",d=null!==(o=a[3])&&void 0!==o?o:"";return c?l+function(n,e){void 0===n&&(n="");var t=e?' data-highlight-color="'.concat(e,'"'):"",r=n?' data-badge-id="'.concat(n,'"'):"";return"<mark".concat(r).concat(t,">")}(e,t)+c+"</mark>"+d:n}(n,e,t),a=o;if(!i&&r.length>0){i=!0;var l="",c="";r.forEach(function(n){l+=function(n){return'<span data-badge-id="'.concat(n,'">')}(n.id),c="</span>"+c}),a=l+o+c}return""+a};return n.split(/(\n+)/).map(function(n){return/^\n+$/.test(n)?n:n.trim()?""===n.replace(/[|:\-\s]/g,"")&&n.includes("-")?n:n.includes("|")?n.split(/(\|)/).map(function(n){return"|"!==n&&n.trim()?o(n):n}).join(""):o(n):n}).join("")},a=[];Object.entries(i).forEach(function(n){var r=n[0],i=n[1],o=e.indexOf(r),l=!1;if(-1===o&&w){var c=P(r);-1!==(o=t.indexOf(c))&&(l=!0)}if(-1!==o){for(var d=i[0].highlightColor,s=1;s<i.length;s++)d=g(d,i[s].highlightColor||"");a.push({highlight:r,start:o,end:o+r.length,badges:i,color:d,usedLooseMatch:l})}});var l=new Set(Object.keys(i));(k||[]).forEach(function(n){if(n){var r=j(n);if(r&&!l.has(r)){var i=e.indexOf(r),o=!1;if(-1===i&&w){var c=P(r);-1!==(i=t.indexOf(c))&&(o=!0)}if(-1!==i){var d=e.slice(0,i);(d.match(/</g)||[]).length===(d.match(/>/g)||[]).length&&a.push({highlight:r,start:i,end:i+r.length,badges:[],color:B||"",usedLooseMatch:o})}}}}),a.sort(function(n,e){return n.start-e.start||e.end-n.end});var c=[],d={};a.forEach(function(n,e){for(var t=n.start,r=n.end,i=0,o=c;i<o.length;i++){var a=o[i],l=a.start,s=a.end,u=t<s&&r>s&&t>=l,h=t<l&&r>l&&r<=s;if(t>=l&&r<=s){n.orphaned=!0,d[e]=a.matchIdx;break}u&&(t=s),h&&(r=l)}n.trimmedStart=t,n.trimmedEnd=r,!n.orphaned&&t<r&&c.push({start:t,end:r,matchIdx:e})});var s={};Object.entries(d).forEach(function(n){var e=n[0],t=n[1],r=Number(e);s[t]||(s[t]=[]),s[t].push(r)});var u=a.map(function(e,t){return n(n({},e),{idx:t})}).filter(function(n){return!n.orphaned}).sort(function(n,e){var t,r;return(null!==(t=e.trimmedStart)&&void 0!==t?t:e.start)-(null!==(r=n.trimmedStart)&&void 0!==r?r:n.start)});return u.forEach(function(n){var t,r,i,l,c=null!==(t=n.trimmedStart)&&void 0!==t?t:n.start,d=null!==(r=n.trimmedEnd)&&void 0!==r?r:n.end;if(!(c>=d)){var u=e.slice(c,d),h=function(n,e,t,r){if(!t.length)return n;var i=t.map(function(n){return a[n]}).sort(function(n,e){return n.start-e.start}),l="",c=0;return i.forEach(function(t){var i,a,d=Math.max(c,t.start-e),s=Math.max(d,t.end-e);if(!(d>=s)){var u=g(r,t.color||"");l+=n.slice(c,d),l+=o(n.slice(d,s),(null===(a=null===(i=t.badges)||void 0===i?void 0:i[0])||void 0===a?void 0:a.id)||"",u,t.badges||[]),c=s}}),l+=n.slice(c)}(n.usedLooseMatch||c!==n.start||d!==n.end?u:n.highlight,n.start,s[n.idx]||[],n.color),p=o(h,(null===(l=null===(i=n.badges)||void 0===i?void 0:i[0])||void 0===l?void 0:l.id)||"",n.color,n.badges||[]);e=e.slice(0,c)+p+e.slice(d)}}),e},[v,C,k,B,w]),N=d(function(){return m?j(m||""):""},[m]),R=!!m,L={"& *":{fontFamily:"inherit"},"& code, & pre, & kbd, & samp":{fontFamily:"inherit !important",fontSize:"inherit",background:"none",padding:0,border:"none",whiteSpace:"pre-wrap"},"& p, & li, & ul, & ol":{position:"static",overflow:"visible",whiteSpace:"pre-wrap"}},q=n(n(n(n({},b),L),{position:"relative",overflow:"visible",whiteSpace:"normal",gridArea:"1 / 1",zIndex:2}),R?{color:"transparent",userSelect:"none",pointerEvents:"none","& .deviation-badge":{pointerEvents:"auto"},"& table":{visibility:"hidden",margin:"0 !important"},"& th, & td":{padding:"0 !important",border:"none !important",backgroundColor:"transparent !important"},"& tr":{border:"none !important"},"& p:empty":{display:"none"}}:{}),W=n(n(n({},b),L),{position:"relative",overflow:"visible",whiteSpace:"normal",gridArea:"1 / 1",zIndex:1,pointerEvents:"auto"});return s(function(){if(T.current){var n=function(){var n=Array.from(T.current.querySelectorAll(".deviation-badge"));if(0!==n.length){n.forEach(function(n){n.style.setProperty("--badge-nudge","0px")});var e=n.filter(function(n){return"left"===n.dataset.side}),t=n.filter(function(n){return"left"!==n.dataset.side}),r=T.current.getBoundingClientRect(),i=r.bottom-4,o=r.top+4,a=function(n){if(0!==n.length){var e=n.map(function(n){var e=n.getBoundingClientRect();return{el:n,naturalTop:e.top,height:e.height,currentTop:e.top}});e.sort(function(n,e){return n.naturalTop-e.naturalTop});var t=[],r=[];e.forEach(function(n){if(0===r.length)r.push(n);else{var e=r[r.length-1],i=e.currentTop+e.height;n.naturalTop<i+8?(n.currentTop=i+8,r.push(n)):(t.push(r),r=[n])}}),r.length>0&&t.push(r),t.forEach(function(n){var e=n[n.length-1],t=e.currentTop+e.height;if(t>i){var r=t-i,a=n[0].currentTop-o,l=Math.max(0,Math.min(r,a));n.forEach(function(n){n.currentTop-=l})}}),t.flat().forEach(function(n){var e=n.currentTop-n.naturalTop;n.el.style.setProperty("--badge-nudge","".concat(e,"px"))})}};a(e),a(t)}},e=requestAnimationFrame(function(){requestAnimationFrame(function(){n()})}),t=new ResizeObserver(function(){requestAnimationFrame(n)});return t.observe(T.current),function(){t.disconnect(),cancelAnimationFrame(e)}}},[H,A,D]),r(o,n({ref:T,sx:{position:"relative",display:"grid"}},{children:[t(a,n({component:"div",sx:n(n({},q),{padding:"3px"})},{children:t(p,n({components:$,remarkPlugins:x,rehypePlugins:y},{children:H.replace(/#{3}/g,"")}))})),R&&t(a,n({component:"div",sx:W},{children:t(p,n({components:$,remarkPlugins:x,rehypePlugins:y},{children:N}))}))]}))},f);export{E as MemoizedMarkdown};
|
|
1
|
+
import{__assign as n,__rest as e}from"tslib";import{jsx as t,jsxs as r,Fragment as i}from"react/jsx-runtime";import{Box as o,Typography as a}from"@mui/material";import l,{useRef as c,useMemo as d,useLayoutEffect as s}from"react";import{DEFAULT_DEVIAION_COLOR as u}from"../CognitiveCompareConstants.js";import{EllipsisVertical as h}from"lucide-react";import p from"react-markdown";import{mixHexColors as g,areMarkdownPropsEqual as f}from"../CognitiveComparehelpers.js";import v from"rehype-raw";import m from"remark-gfm";var b=function(n){return"function"==typeof n?n:(null==n?void 0:n.default)||n},x=[b(m)],y=[b(v)],E=l.memo(function(f){var v=f.content,m=f.overlayContent,b=f.sxStyles,E=f.deviationBadges,C=void 0===E?[]:E,S=f.highlights,k=void 0===S?[]:S;f.maintainRelativeOrder;var B=f.highlightBg,F=f.suppressHighlightBg,w=void 0!==F&&F,A=f.collisionKey,T=c(null),z=!!m,I=d(function(){return C.reduce(function(e,t){var r;return n(n({},e),((r={})[t.id]=t,r))},{})},[C]),O=c({badgeMap:I,highlightBg:B,hideHighlightBg:z,suppressHighlightBg:w});O.current={badgeMap:I,highlightBg:B,hideHighlightBg:z,suppressHighlightBg:w};var M=function(e,t){return l.Children.map(e,function(e){var r;if(!l.isValidElement(e))return e;var i=(null===(r=e.props)||void 0===r?void 0:r.children)?M(e.props.children,t):e.props.children,o=l.cloneElement(e,n(n({},e.props),{children:i}));return t(o)})},$=d(function(){return{mark:function(r){var i,o,a,l,c=r.children,d=e(r,["children"]),s=O.current,u=s.badgeMap,h=s.highlightBg,p=s.hideHighlightBg,g=s.suppressHighlightBg,f=d["data-badge-id"],v=f?u[f]:null,m=d["data-highlight-color"],b=null!==(l=null!==(o=null!=m?m:null===(i=null==v?void 0:v.style)||void 0===i?void 0:i.highlightBg)&&void 0!==o?o:null===(a=null==v?void 0:v.style)||void 0===a?void 0:a.badgeBg)&&void 0!==l?l:h,x="true"===d["data-is-suggested-deviation-fix"]||g;return t("span",n({style:n(n(n({},x?{}:{backgroundColor:b}),{borderRadius:"2px",display:"inline",boxDecorationBreak:"clone",WebkitBoxDecorationBreak:"clone",backgroundClip:"padding-box",padding:"0 1px"}),p?{color:"transparent"}:{})},{children:c}))},span:function(i){var a,l,c,d,s,p,g=i.children,f=e(i,["children"]),v=O.current.badgeMap,m=f["data-badge-id"];if(!m)return t("span",n({},f,{children:g}));var b=v[m];if(!b)return t("span",n({},f,{children:g}));var x="number"==typeof b.stackIndex?b.stackIndex:0,y="translateY(calc(-20% + ".concat(12*x,"px + var(--badge-nudge, 0px)))");return r(o,n({component:"span",sx:{position:"static",display:"inline"}},{children:[r(o,n({ref:b.badgeRef,className:"deviation-badge","data-side":b.side||"right",sx:n(n({fontStyle:"normal",position:"absolute",zIndex:30+x,display:"inline-flex",alignItems:"stretch",fontSize:"10px",bgcolor:(null===(a=b.style)||void 0===a?void 0:a.badgeBg)||"#EEF2FF",color:(null===(l=b.style)||void 0===l?void 0:l.badgeText)||u,border:"1px solid ".concat((null===(c=b.style)||void 0===c?void 0:c.badgeBorder)||"#C7D2FE"),borderRadius:"12px",fontWeight:600,whiteSpace:"nowrap",boxShadow:"0 1px 3px rgba(0,0,0,0.07)",overflow:"hidden",transition:"none"},"left"===b.side?{right:"-16px",transform:"".concat(y," translateX(calc(100% + 8px))")}:{left:"-16px",transform:"".concat(y," translateX(calc(-100% - 8px))")}),b.isConnected&&b.style&&{outline:"2px solid ".concat(b.style.badgeBorder),outlineOffset:"1px"})},{children:[r(o,n({onClick:function(n){n.stopPropagation(),b.onSummaryClick&&b.onSummaryClick(n)},sx:{display:"flex",alignItems:"center",px:1,py:.3,cursor:"pointer","&:hover":{bgcolor:"rgba(0,0,0,0.04)"}}},{children:[t(o,n({component:"span",sx:{fontSize:"10px",fontWeight:700}},{children:b.label})),("left"===b.side||b.isOrphan)&&t(o,n({component:"span",sx:{fontSize:"10px",pl:.5,ml:.5,borderLeft:"1px solid ".concat((null===(d=b.style)||void 0===d?void 0:d.badgeBorder)||"#C7D2FE")}},{children:null!=b.score&&"N/A"!==b.score&&"NA"!==b.score&&0!==b.score?"".concat(b.score):"N/A"===b.score||"NA"===b.score?"N/A":"Same"}))]})),("left"===b.side||b.isOrphan)&&t(o,n({onClick:function(n){n.stopPropagation(),b.onClick&&b.onClick(n)},sx:{display:"flex",alignItems:"center",px:.5,borderLeft:"1px solid ".concat((null===(s=b.style)||void 0===s?void 0:s.badgeBorder)||"#C7D2FE"),cursor:"pointer","&:hover":{bgcolor:"rgba(0,0,0,0.06)"}}},{children:t(h,{size:12,color:(null===(p=b.style)||void 0===p?void 0:p.badgeText)||"#3730A3"})}))]})),g]}))},table:function(e){var r=e.children;return t(o,n({component:"table",sx:{width:"100%",borderCollapse:"collapse",my:1,fontSize:"inherit"}},{children:r}))},thead:function(e){var r=e.children;return t(o,n({component:"thead"},{children:r}))},tbody:function(e){var r=e.children;return t(o,n({component:"tbody"},{children:r}))},tr:function(e){var r=e.children;return t(o,n({component:"tr",sx:{borderBottom:"1px solid #E5E7EB"}},{children:r}))},th:function(e){var r=e.children;return t(o,n({component:"th",sx:{border:"1px solid #E5E7EB",padding:"8px",textAlign:"left",fontWeight:600,backgroundColor:"#F9FAFB"}},{children:r}))},td:function(e){var r=e.children;return t(o,n({component:"td",sx:{border:"1px solid #E5E7EB",padding:"8px",verticalAlign:"top"}},{children:r}))},code:function(e){var r=e.children;return t("span",n({style:{fontFamily:"inherit",fontSize:"inherit"}},{children:r}))},pre:function(e){var r=e.children;return t("span",n({style:{fontFamily:"inherit",fontSize:"inherit",display:"block",whiteSpace:"pre-wrap"}},{children:r}))},updated:function(n){var e=n.children;return t(i,{children:e})},deleted:function(e){var r=e.children,i=M(r,function(n){return l.cloneElement(n,{"data-is-suggested-deviation-fix":"true"})});return t("span",n({style:{boxShadow:"inset 0 1px 0 #EF4444, inset 0 -1px 0 #EF4444",backgroundColor:"#FCCCCC",textDecoration:"line-through"}},{children:i}))},changed:function(e){var r=e.children,i=M(r,function(n){return l.cloneElement(n,{"data-is-suggested-deviation-fix":"true"})});return t("span",n({style:{boxShadow:"inset 0 1px 0 #2F59FF, inset 0 -1px 0 #2F59FF",backgroundColor:"#D5E8FF"}},{children:i}))},ul:function(e){var r=e.children;return t(o,n({component:"ul",sx:{mt:1,mb:1,pl:3,listStyleType:"disc"}},{children:r}))},ol:function(e){var r=e.children;return t(o,n({component:"ol",sx:{mt:1,mb:1,pl:3,listStyleType:"decimal"}},{children:r}))},li:function(e){var r=e.children;return t(o,n({component:"li",sx:{mb:.5,display:"list-item"}},{children:r}))}}},[]),j=function(n){if(!n||"string"!=typeof n)return"";var e=n,t=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(/((?:<\/?[a-z]+[^>]*>\s*)+)([*+\-] |\d+\. )/gi,"$2$1")).replace(/\\(['"])/g,"$1").replace(/\\n/g,"\n").replace(/\\\./g,".").replace(/\r\n/g,"\n")).replace(/^(\d+\.)(\s{2,})/gm,function(n,e,t){return"".concat(e.slice(0,-1),"\\.").concat(t)})).replace(/^(\d+\.)\s*\n+(\s+)(\S)/gm,function(n,e,t,r){return"".concat(e," ").concat(r)})).replace(/([^\n])\n(#{1,6} )/g,"$1\n\n$2")).replace(/([^\n])\n([ \t]*(?:[#*+\-] |\d+\. ))/g,"$1\n\n$2")).replace(/\n{3,}/g,"\n\n")).replace(/^[ \t]+(?![ \t]*([\*\-\+] |\d+\. ))/gm,function(n){return n.replace(/ /g," ").replace(/\t/g," ")})).split(/(\n{2,})/);return(e=t.map(function(n){return/^\n+$/.test(n)||/\|.*\|/.test(n)&&/\|[\s:|-]+\|/.test(n)||/^#{1,6} /.test(n.trimStart())?n:n.replace(/\n(?=[^\n])/g,function(e,t){var r=n.slice(t+1);return/^[ \t]*([#>|\-*+]|\d+\.)/.test(r)?"\n":" "})}).join("")).trim()},P=function(n){return n.replace(/[\.,;:]/g," ")},D=d(function(){return C.map(function(n){return{id:n.id,connected:n.isConnected,stackIndex:n.stackIndex,size:n.size}})},[C]),H=d(function(){var e=j(v||""),t=w?P(e):e,r=(C||[]).map(function(n){var e,t;return{id:null==n?void 0:n.id,highlight:j((null==n?void 0:n.highlight)||""),highlightColor:(null===(e=null==n?void 0:n.style)||void 0===e?void 0:e.highlightBg)||(null===(t=null==n?void 0:n.style)||void 0===t?void 0:t.badgeBg)||B}}).filter(function(n){return n.id&&n.highlight}),i={};r.forEach(function(n){i[n.highlight]||(i[n.highlight]=[]),i[n.highlight].push(n)});var o=function(n,e,t,r){void 0===e&&(e=""),void 0===r&&(r=[]);var i=!1,o=function(n){var o=function(n,e,t){var r,i,o;void 0===e&&(e="");var a=n.match(/^(\s*)([\s\S]*?)(\s*)$/);if(!a)return n;var l=null!==(r=a[1])&&void 0!==r?r:"",c=null!==(i=a[2])&&void 0!==i?i:"",d=null!==(o=a[3])&&void 0!==o?o:"";return c?l+function(n,e){void 0===n&&(n="");var t=e?' data-highlight-color="'.concat(e,'"'):"",r=n?' data-badge-id="'.concat(n,'"'):"";return"<mark".concat(r).concat(t,">")}(e,t)+c+"</mark>"+d:n}(n,e,t),a=o;if(!i&&r.length>0){i=!0;var l="",c="";r.forEach(function(n){l+=function(n){return'<span data-badge-id="'.concat(n,'">')}(n.id),c="</span>"+c}),a=l+o+c}return""+a};return n.split(/(\n+)/).map(function(n){return/^\n+$/.test(n)?n:n.trim()?""===n.replace(/[|:\-\s]/g,"")&&n.includes("-")?n:n.includes("|")?n.split(/(\|)/).map(function(n){return"|"!==n&&n.trim()?o(n):n}).join(""):o(n):n}).join("")},a=[];Object.entries(i).forEach(function(n){var r=n[0],i=n[1],o=e.indexOf(r),l=!1;if(-1===o&&w){var c=P(r);-1!==(o=t.indexOf(c))&&(l=!0)}if(-1!==o){for(var d=i[0].highlightColor,s=1;s<i.length;s++)d=g(d,i[s].highlightColor||"");a.push({highlight:r,start:o,end:o+r.length,badges:i,color:d,usedLooseMatch:l})}});var l=new Set(Object.keys(i));(k||[]).forEach(function(n){if(n){var r=j(n);if(r&&!l.has(r)){var i=e.indexOf(r),o=!1;if(-1===i&&w){var c=P(r);-1!==(i=t.indexOf(c))&&(o=!0)}if(-1!==i){var d=e.slice(0,i);(d.match(/</g)||[]).length===(d.match(/>/g)||[]).length&&a.push({highlight:r,start:i,end:i+r.length,badges:[],color:B||"",usedLooseMatch:o})}}}}),a.sort(function(n,e){return n.start-e.start||e.end-n.end});var c=[],d={};a.forEach(function(n,e){for(var t=n.start,r=n.end,i=0,o=c;i<o.length;i++){var a=o[i],l=a.start,s=a.end,u=t<s&&r>s&&t>=l,h=t<l&&r>l&&r<=s;if(t>=l&&r<=s){n.orphaned=!0,d[e]=a.matchIdx;break}u&&(t=s),h&&(r=l)}n.trimmedStart=t,n.trimmedEnd=r,!n.orphaned&&t<r&&c.push({start:t,end:r,matchIdx:e})});var s={};Object.entries(d).forEach(function(n){var e=n[0],t=n[1],r=Number(e);s[t]||(s[t]=[]),s[t].push(r)});var u=a.map(function(e,t){return n(n({},e),{idx:t})}).filter(function(n){return!n.orphaned}).sort(function(n,e){var t,r;return(null!==(t=e.trimmedStart)&&void 0!==t?t:e.start)-(null!==(r=n.trimmedStart)&&void 0!==r?r:n.start)});return u.forEach(function(n){var t,r,i,l,c=null!==(t=n.trimmedStart)&&void 0!==t?t:n.start,d=null!==(r=n.trimmedEnd)&&void 0!==r?r:n.end;if(!(c>=d)){var u=e.slice(c,d),h=function(n,e,t,r){if(!t.length)return n;var i=t.map(function(n){return a[n]}).sort(function(n,e){return n.start-e.start}),l="",c=0;return i.forEach(function(t){var i,a,d=Math.max(c,t.start-e),s=Math.max(d,t.end-e);if(!(d>=s)){var u=g(r,t.color||"");l+=n.slice(c,d),l+=o(n.slice(d,s),(null===(a=null===(i=t.badges)||void 0===i?void 0:i[0])||void 0===a?void 0:a.id)||"",u,t.badges||[]),c=s}}),l+=n.slice(c)}(n.usedLooseMatch||c!==n.start||d!==n.end?u:n.highlight,n.start,s[n.idx]||[],n.color),p=o(h,(null===(l=null===(i=n.badges)||void 0===i?void 0:i[0])||void 0===l?void 0:l.id)||"",n.color,n.badges||[]);e=e.slice(0,c)+p+e.slice(d)}}),e},[v,C,k,B,w]),N=d(function(){return m?j(m||""):""},[m]),R=!!m,L={"& *":{fontFamily:"inherit"},"& code, & pre, & kbd, & samp":{fontFamily:"inherit !important",fontSize:"inherit",background:"none",padding:0,border:"none",whiteSpace:"pre-wrap"},"& p, & li, & ul, & ol":{position:"static",overflow:"visible",whiteSpace:"pre-wrap"}},q=n(n(n(n({},b),L),{position:"relative",overflow:"visible",whiteSpace:"normal",gridArea:"1 / 1",zIndex:2}),R?{color:"transparent",userSelect:"none",pointerEvents:"none","& .deviation-badge":{pointerEvents:"auto"},"& table":{visibility:"hidden",margin:"0 !important"},"& th, & td":{padding:"0 !important",border:"none !important",backgroundColor:"transparent !important"},"& tr":{border:"none !important"},"& p:empty":{display:"none"}}:{}),W=n(n(n({},b),L),{position:"relative",overflow:"visible",whiteSpace:"normal",gridArea:"1 / 1",zIndex:1,pointerEvents:"auto"});return s(function(){if(T.current){var n=function(){var n=Array.from(T.current.querySelectorAll(".deviation-badge"));if(0!==n.length){n.forEach(function(n){n.style.setProperty("--badge-nudge","0px")});var e=n.filter(function(n){return"left"===n.dataset.side}),t=n.filter(function(n){return"left"!==n.dataset.side}),r=T.current.getBoundingClientRect(),i=r.bottom-4,o=r.top+4,a=function(n){if(0!==n.length){var e=n.map(function(n){var e=n.getBoundingClientRect();return{el:n,naturalTop:e.top,height:e.height,currentTop:e.top}});e.sort(function(n,e){return n.naturalTop-e.naturalTop});var t=[],r=[];e.forEach(function(n){if(0===r.length)r.push(n);else{var e=r[r.length-1],i=e.currentTop+e.height;n.naturalTop<i+8?(n.currentTop=i+8,r.push(n)):(t.push(r),r=[n])}}),r.length>0&&t.push(r),t.forEach(function(n){var e=n[n.length-1],t=e.currentTop+e.height;if(t>i){var r=t-i,a=n[0].currentTop-o,l=Math.max(0,Math.min(r,a));n.forEach(function(n){n.currentTop-=l})}}),t.flat().forEach(function(n){var e=n.currentTop-n.naturalTop;n.el.style.setProperty("--badge-nudge","".concat(e,"px"))})}};a(e),a(t)}},e=requestAnimationFrame(function(){requestAnimationFrame(function(){n()})}),t=new ResizeObserver(function(){requestAnimationFrame(n)});return t.observe(T.current),function(){t.disconnect(),cancelAnimationFrame(e)}}},[H,A,D]),r(o,n({ref:T,sx:{position:"relative",display:"grid"}},{children:[t(a,n({component:"div",sx:n(n({},q),{padding:"3px"})},{children:t(p,n({components:$,remarkPlugins:x,rehypePlugins:y},{children:H.replace(/#{3}/g,"")}))})),R&&t(a,n({component:"div",sx:W},{children:t(p,n({components:$,remarkPlugins:x,rehypePlugins:y},{children:N}))}))]}))},f);export{E as MemoizedMarkdown};
|
|
2
2
|
//# sourceMappingURL=memoizedMarkdown.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsxs as l,jsx as i,Fragment as n}from"react/jsx-runtime";import{useState as o,useEffect as r}from"react";import{renderCitationAIConfidenceDisplay as t}from"../components/CitationAIConfidenceDisplay.js";import s from"../AiReasoning/components/icons/FullScreenIcon.js";import a from"./components/ImagePreviewDialog.js";import{CircularProgress as c}from"@mui/material";import d from"./WebCitationWithImageContent.module.css.js";var u=function(u){var v,m,g,f,
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as l,jsx as i,Fragment as n}from"react/jsx-runtime";import{useState as o,useEffect as r}from"react";import{renderCitationAIConfidenceDisplay as t}from"../components/CitationAIConfidenceDisplay.js";import s from"../AiReasoning/components/icons/FullScreenIcon.js";import a from"./components/ImagePreviewDialog.js";import{CircularProgress as c}from"@mui/material";import d from"./WebCitationWithImageContent.module.css.js";var u=function(u){var v,m,g,h,f,p,C,y=null===(v=null==u?void 0:u.closeCitationConfig)||void 0===v?void 0:v.CloseIcon,N=u.visitIcon,I=o(!1),P=I[0],U=I[1],k=null===(m=null==u?void 0:u.cachingConfig)||void 0===m?void 0:m.queryClient,S=u.styles,D=["getSignedUrl",u.gsUtilPath||""],w=null!==(h=null===(g=u.cachingConfig)||void 0===g?void 0:g.useGetSignedUrlQuery)&&void 0!==h?h:function(){return{data:void 0}},W=null!==(p=null===(f=u.cachingConfig)||void 0===f?void 0:f.useGetSignedUrlMutation)&&void 0!==p?p:function(){return{mutate:function(e){},isPending:!1}},b=w((null==u?void 0:u.gsUtilPath)||"",D).data,L=W((null==u?void 0:u.gsUtilPath)||""),j=L.mutate,x=L.isPending;return r(function(){u.signedUrl||u.gsUtilPath&&(((null==k?void 0:k.getQueryData)?k.getQueryData(D):void 0)||j({gsUtilPath:u.gsUtilPath}))},[u.gsUtilPath,u.signedUrl,k,j]),l("div",e({className:d.container,style:null==S?void 0:S.container},{children:[l("div",e({className:d.header,style:null==S?void 0:S.header},{children:[i("div",e({className:d.headerLeft,style:null==S?void 0:S.headerLeft},{children:i("a",e({className:d.link,target:"_blank",rel:"noopener noreferrer",href:u.url},{children:u.label}))})),(null==u?void 0:u.closeCitationConfig)?l("div",e({className:d.headerActions,style:null==S?void 0:S.headerActions},{children:[t(u.relevanceScore,!1,null==S?void 0:S.aiConfidenceDisplayPill),i("div",{className:d.divider,style:null==S?void 0:S.divider}),y&&i("div",e({className:d.closeIconWrapper,style:null==S?void 0:S.closeIconWrapper,onClick:u.closeCitationConfig.handleCloseCitationPreview},{children:i(y,{className:d.closeIcon})}))]})):i(n,{children:t(u.relevanceScore,!0,null==S?void 0:S.aiConfidenceDisplayPill)})]})),u.signedUrl?l("div",e({className:d.imageWrapper,style:null==S?void 0:S.imageWrapper},{children:[i("img",{src:u.signedUrl,alt:"images",className:d.image,style:null==S?void 0:S.image}),i("div",e({className:d.fullScreenButton,style:null==S?void 0:S.fullScreenButton,onClick:function(){return U(!0)}},{children:i(s,{})})),i(a,{open:P,handleClose:function(){return U(!1)},src:u.signedUrl,CloseIcon:u.PreviewDialogCloseIcon,styles:null===(C=u.styles)||void 0===C?void 0:C.previewDialogStyles})]})):x?l("div",e({className:d.loaderContainer},{children:[i("style",{children:".mui-circular-progress-circle { stroke-linecap: round; }"}),i(c,{size:48,thickness:4,style:{color:"#4F85FF"},classes:{circle:"mui-circular-progress-circle"}}),i("span",e({className:d.loaderText,style:null==S?void 0:S.loaderText},{children:"Loading Image..."}))]})):b&&l("div",e({className:d.imageWrapper},{children:[i("img",{src:b,alt:"images",className:d.image,style:null==S?void 0:S.image}),i("div",e({className:d.fullScreenButton,style:null==S?void 0:S.fullScreenButton,onClick:function(){return U(!0)}},{children:i(s,{})})),i(a,{open:P,handleClose:function(){return U(!1)},src:b,CloseIcon:u.PreviewDialogCloseIcon,styles:null==S?void 0:S.previewDialogStyles})]})),i("div",e({className:d.footer,style:null==S?void 0:S.footer},{children:l("div",e({className:d.footerContent,style:null==S?void 0:S.footerContent},{children:[i("span",{children:"Open link in new tab to read in detail"}),l("a",e({className:d.visitLink,style:null==S?void 0:S.visitLink,href:u.url,target:"_blank",rel:"noopener noreferrer"},{children:[i("span",{children:"Visit Link"}),i(N,{className:d.visitIcon})]}))]}))}))]}))};export{u as default};
|
|
2
2
|
//# sourceMappingURL=WebCitationWithImageContent.js.map
|
package/dist/features/RequirementAiCitations/WebCitation/WebCitationWithImageContent.module.css.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var e={container:"WebCitationWithImageContent-module_container__0caP3",header:"WebCitationWithImageContent-module_header__yd-ED",headerLeft:"WebCitationWithImageContent-module_headerLeft__vemHH",link:"WebCitationWithImageContent-module_link__9am5l",headerActions:"WebCitationWithImageContent-module_headerActions__pinS2",divider:"WebCitationWithImageContent-module_divider__OR-bP",closeIconWrapper:"WebCitationWithImageContent-module_closeIconWrapper__D6HHj",closeIcon:"WebCitationWithImageContent-module_closeIcon__CDrjR",imageWrapper:"WebCitationWithImageContent-module_imageWrapper__Zk2jF",image:"WebCitationWithImageContent-module_image__KJMJS",fullScreenButton:"WebCitationWithImageContent-module_fullScreenButton__JH8MC",loaderContainer:"WebCitationWithImageContent-module_loaderContainer__9UQBM",loaderText:"WebCitationWithImageContent-module_loaderText__fqlg2",footer:"WebCitationWithImageContent-module_footer__7-3Et",footerContent:"WebCitationWithImageContent-module_footerContent__U60cY",visitLink:"WebCitationWithImageContent-module_visitLink__YiGQo",visitIcon:"WebCitationWithImageContent-module_visitIcon__FjN9-"};!function(){if("undefined"==typeof document)return;const e=document.createElement("style");e.type="text/css";const t=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;t&&e.setAttribute("nonce",t),e.appendChild(document.createTextNode(".WebCitationWithImageContent-module_container__0caP3{border:1px solid #e5e7eb;display:flex;flex-direction:column;gap:1rem;height:100%;min-height:200px;position:relative}.WebCitationWithImageContent-module_header__yd-ED{align-items:center;border-bottom:1px solid #e5e7eb;display:flex;flex-direction:row;justify-content:space-between;padding:.5rem 1rem;width:100%}.WebCitationWithImageContent-module_headerLeft__vemHH{align-items:center;display:flex;flex-direction:row;gap:.5rem}.WebCitationWithImageContent-module_link__9am5l{color:#1f2937;font-weight:600;text-decoration-color:#1f2937;text-decoration:none}.WebCitationWithImageContent-module_headerActions__pinS2{align-items:center;display:flex;flex-direction:row;gap:1rem;justify-content:space-between}.WebCitationWithImageContent-module_divider__OR-bP{align-self:stretch;background-color:#e5e7eb;margin-bottom:-.5rem;margin-top:-.5rem;width:1px}.WebCitationWithImageContent-module_closeIconWrapper__D6HHj{cursor:pointer}.WebCitationWithImageContent-module_closeIcon__CDrjR{color:#6b7280;height:1.5rem;width:1.5rem}.WebCitationWithImageContent-module_imageWrapper__Zk2jF{padding-left:.75rem;padding-right:.75rem;position:relative}.WebCitationWithImageContent-module_image__KJMJS{border:1px solid #e5e7eb;border-radius:8px;width:100%}.WebCitationWithImageContent-module_fullScreenButton__JH8MC{background-color:#f9fafb;border:1px solid #d0d5dd;border-radius:8px;bottom:.5rem;cursor:pointer;padding:.5rem;position:absolute;right:1.25rem}.WebCitationWithImageContent-module_loaderContainer__9UQBM{align-items:center;display:flex;flex-direction:column;justify-content:center;min-height:400px}.WebCitationWithImageContent-module_loaderText__fqlg2{color:#4b5563;font-size:.875rem;font-weight:500;margin-top:.5rem}.WebCitationWithImageContent-module_footer__7-3Et{
|
|
1
|
+
var e={container:"WebCitationWithImageContent-module_container__0caP3",header:"WebCitationWithImageContent-module_header__yd-ED",headerLeft:"WebCitationWithImageContent-module_headerLeft__vemHH",link:"WebCitationWithImageContent-module_link__9am5l",headerActions:"WebCitationWithImageContent-module_headerActions__pinS2",divider:"WebCitationWithImageContent-module_divider__OR-bP",closeIconWrapper:"WebCitationWithImageContent-module_closeIconWrapper__D6HHj",closeIcon:"WebCitationWithImageContent-module_closeIcon__CDrjR",imageWrapper:"WebCitationWithImageContent-module_imageWrapper__Zk2jF",image:"WebCitationWithImageContent-module_image__KJMJS",fullScreenButton:"WebCitationWithImageContent-module_fullScreenButton__JH8MC",loaderContainer:"WebCitationWithImageContent-module_loaderContainer__9UQBM",loaderText:"WebCitationWithImageContent-module_loaderText__fqlg2",footer:"WebCitationWithImageContent-module_footer__7-3Et",footerContent:"WebCitationWithImageContent-module_footerContent__U60cY",visitLink:"WebCitationWithImageContent-module_visitLink__YiGQo",visitIcon:"WebCitationWithImageContent-module_visitIcon__FjN9-"};!function(){if("undefined"==typeof document)return;const e=document.createElement("style");e.type="text/css";const t=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;t&&e.setAttribute("nonce",t),e.appendChild(document.createTextNode(".WebCitationWithImageContent-module_container__0caP3{border:1px solid #e5e7eb;display:flex;flex-direction:column;gap:1rem;height:100%;min-height:200px;position:relative}.WebCitationWithImageContent-module_header__yd-ED{align-items:center;border-bottom:1px solid #e5e7eb;display:flex;flex-direction:row;justify-content:space-between;padding:.5rem 1rem;width:100%}.WebCitationWithImageContent-module_headerLeft__vemHH{align-items:center;display:flex;flex-direction:row;gap:.5rem}.WebCitationWithImageContent-module_link__9am5l{color:#1f2937;font-weight:600;text-decoration-color:#1f2937;text-decoration:none}.WebCitationWithImageContent-module_headerActions__pinS2{align-items:center;display:flex;flex-direction:row;gap:1rem;justify-content:space-between}.WebCitationWithImageContent-module_divider__OR-bP{align-self:stretch;background-color:#e5e7eb;margin-bottom:-.5rem;margin-top:-.5rem;width:1px}.WebCitationWithImageContent-module_closeIconWrapper__D6HHj{cursor:pointer}.WebCitationWithImageContent-module_closeIcon__CDrjR{color:#6b7280;height:1.5rem;width:1.5rem}.WebCitationWithImageContent-module_imageWrapper__Zk2jF{padding-left:.75rem;padding-right:.75rem;position:relative}.WebCitationWithImageContent-module_image__KJMJS{border:1px solid #e5e7eb;border-radius:8px;width:100%}.WebCitationWithImageContent-module_fullScreenButton__JH8MC{background-color:#f9fafb;border:1px solid #d0d5dd;border-radius:8px;bottom:.5rem;cursor:pointer;padding:.5rem;position:absolute;right:1.25rem}.WebCitationWithImageContent-module_loaderContainer__9UQBM{align-items:center;display:flex;flex-direction:column;justify-content:center;min-height:400px}.WebCitationWithImageContent-module_loaderText__fqlg2{color:#4b5563;font-size:.875rem;font-weight:500;margin-top:.5rem}.WebCitationWithImageContent-module_footer__7-3Et{align-items:center;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between;padding-bottom:1rem;width:100%}.WebCitationWithImageContent-module_footerContent__U60cY{align-items:center;color:#000;display:flex;flex-direction:row;gap:.5rem;padding-left:.75rem}.WebCitationWithImageContent-module_visitLink__YiGQo{align-items:center;background-color:#eee9fd;border-radius:8px;color:#5928ed;display:flex;flex-direction:row;gap:.5rem;padding:.25rem .5rem;text-decoration:none;width:fit-content}.WebCitationWithImageContent-module_visitIcon__FjN9-{color:#5928ed;height:1rem;width:1rem}"));const o=document.head||document.getElementsByTagName("head")[0]||document.documentElement;o&&o.appendChild(e)}();export{e as default};
|
|
2
2
|
//# sourceMappingURL=WebCitationWithImageContent.module.css.js.map
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{default as CodeCitation}from"./features/CodeCitation/CodeCitation.js";export{default as ProjectAccordian}from"./features/ProjectAccordion/ProjectAccordion.js";export{default as BookCitation}from"./features/BookCitation/BookCitation.js";export{default as Bookemon}from"./features/Bookemon/Bookemon.js";export{PdfEditorCitation as PdfCitation}from"./features/PdfEditorCitation/PdfEditorCitation.js";export{default as CitationRenderer}from"./features/CitationRenderer/CitationRenderer.js";export{default as MarkdownRenderer}from"./features/CitationRenderer/MarkdownRenderer.js";export{DiagnosticSeverity}from"./features/CodeCitation/_components/CodeEditor.js";export{default as PaginatedTable}from"./features/PaginatedTable/PaginatedTable.js";export{default as InternalgptReasoningComponent,default as NonWebReasoningComponent}from"./features/CognitiveInternalgptReasoning/CognitiveInternalgptReasoningComponent.js";export{default as ChatCitation}from"./features/ChatCitation/ChatCitationRenderer.js";export{default as CognitiveDecisioningCard}from"./features/CognitiveDecisioning/CognitiveDecisioningWrapper.js";export{default as PdfViewer}from"./features/PdfViewer/PdfViewer.js";export{default as FaqCitation}from"./features/CognitiveDecisioning/FaqCitation/FaqCitation.js";export{default as ImageCitationContent}from"./features/RequirementAiCitations/ImageCitation/ImageCitationContent.js";export{default as VideoCitationContent}from"./features/RequirementAiCitations/VideoCitation/VideoCitationContent.js";export{default as FileCitationContent}from"./features/RequirementAiCitations/FileCitation/FileCitationContent.js";export{default as WebCitationWithImageContent}from"./features/RequirementAiCitations/WebCitation/WebCitationWithImageContent.js";export{default as MarkdownWithImageCitation}from"./features/MarkdownWithImageCitation/MarkdownWithImageCitation.js";export{default as AiReasoningCitation}from"./features/RequirementAiCitations/AiReasoning/AiReasoningCitation.js";export{default as TableCitationContent}from"./features/TableCitation/TableCitationContent.js";export{default as CitationsViewer}from"./features/CitationViewer/CitationsViewer.js";export{default as ExcelCitation}from"./features/ExcelCitation/ExcelCitations.js";export{default as ScannedDocCitation}from"./features/ScannedDocCitation/ScannedDocCitation.js";export{default as ChatDrawer}from"./features/ChatDrawer/ChatDrawer.js";export{FILE_INGESTION_STATUS,SUMMARY_EXPAND_HEIGHT_NUDGE,TRUNCATE_THRESHOLD}from"./features/ChatDrawer/constants/ChatDrawer.js";export{default as SplitterCitationsComponent}from"./features/SplitterCitations/SplitterCitationsComponent.js";export{default as CognitiveCompare}from"./features/CognitiveCompare/CognitiveCompare.js";export{default as CognitiveInternalgptCoreComponent}from"./features/CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.js";export{default as TextualGuideLinesComponent}from"./features/TextualGuidelines/TextualGuideLinesComponent.js";export{IngestionStatusChip,IngestionStatusComponent}from"./features/IngestionStatus/IngestionStatusComponent.js";export{ManageReminders}from"./features/ManageRemainders/ManageReminders.js";
|
|
1
|
+
export{default as CodeCitation}from"./features/CodeCitation/CodeCitation.js";export{default as ProjectAccordian}from"./features/ProjectAccordion/ProjectAccordion.js";export{default as BookCitation}from"./features/BookCitation/BookCitation.js";export{default as Bookemon}from"./features/Bookemon/Bookemon.js";export{PdfEditorCitation as PdfCitation}from"./features/PdfEditorCitation/PdfEditorCitation.js";export{default as CitationRenderer}from"./features/CitationRenderer/CitationRenderer.js";export{default as MarkdownRenderer}from"./features/CitationRenderer/MarkdownRenderer.js";export{DiagnosticSeverity}from"./features/CodeCitation/_components/CodeEditor.js";export{default as PaginatedTable}from"./features/PaginatedTable/PaginatedTable.js";export{default as InternalgptReasoningComponent,default as NonWebReasoningComponent}from"./features/CognitiveInternalgptReasoning/CognitiveInternalgptReasoningComponent.js";export{default as ChatCitation}from"./features/ChatCitation/ChatCitationRenderer.js";export{default as CognitiveDecisioningCard}from"./features/CognitiveDecisioning/CognitiveDecisioningWrapper.js";export{default as PdfViewer}from"./features/PdfViewer/PdfViewer.js";export{default as FaqCitation}from"./features/CognitiveDecisioning/FaqCitation/FaqCitation.js";export{default as ImageCitationContent}from"./features/RequirementAiCitations/ImageCitation/ImageCitationContent.js";export{default as VideoCitationContent}from"./features/RequirementAiCitations/VideoCitation/VideoCitationContent.js";export{default as FileCitationContent}from"./features/RequirementAiCitations/FileCitation/FileCitationContent.js";export{default as WebCitationWithImageContent}from"./features/RequirementAiCitations/WebCitation/WebCitationWithImageContent.js";export{default as MarkdownWithImageCitation}from"./features/MarkdownWithImageCitation/MarkdownWithImageCitation.js";export{default as AiReasoningCitation}from"./features/RequirementAiCitations/AiReasoning/AiReasoningCitation.js";export{default as TableCitationContent}from"./features/TableCitation/TableCitationContent.js";export{default as CitationsViewer}from"./features/CitationViewer/CitationsViewer.js";export{default as ExcelCitation}from"./features/ExcelCitation/ExcelCitations.js";export{default as ScannedDocCitation}from"./features/ScannedDocCitation/ScannedDocCitation.js";export{default as ChatDrawer}from"./features/ChatDrawer/ChatDrawer.js";export{FILE_INGESTION_STATUS,SUMMARY_EXPAND_HEIGHT_NUDGE,TRUNCATE_THRESHOLD}from"./features/ChatDrawer/constants/ChatDrawer.js";export{default as SplitterCitationsComponent}from"./features/SplitterCitations/SplitterCitationsComponent.js";export{default as CognitiveCompare}from"./features/CognitiveCompare/CognitiveCompare.js";export{default as CognitiveInternalgptCoreComponent}from"./features/CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.js";export{default as TextualGuideLinesComponent}from"./features/TextualGuidelines/TextualGuideLinesComponent.js";export{IngestionStatusChip,IngestionStatusComponent}from"./features/IngestionStatus/IngestionStatusComponent.js";export{ManageReminders}from"./features/ManageRemainders/ManageReminders.js";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
export declare const useCompareLayout: (initialMaintainOrder: boolean, scrollContainerRef: React.RefObject<HTMLDivElement>, lhsBadgeRefs: any, rhsBadgeRefs: any, proposedSections: any[], existingSections: any[]) => {
|
|
2
3
|
maintainRelativeOrder: boolean;
|
|
3
4
|
setMaintainRelativeOrder: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCompareLayout.d.ts","sourceRoot":"","sources":["../../../../../../src/features/CognitiveCompare/hooks/useCompareLayout.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,gBAAgB,yBACL,OAAO,sBACT,MAAM,SAAS,CAAC,cAAc,CAAC,gBACrC,GAAG,gBACH,GAAG,oBACC,GAAG,EAAE,oBACL,GAAG,EAAE;;;;;;;;;;;;;;;;;;;;;;CAkFxB,CAAC"}
|
|
1
|
+
{"version":3,"file":"useCompareLayout.d.ts","sourceRoot":"","sources":["../../../../../../src/features/CognitiveCompare/hooks/useCompareLayout.tsx"],"names":[],"mappings":";AAGA,eAAO,MAAM,gBAAgB,yBACL,OAAO,sBACT,MAAM,SAAS,CAAC,cAAc,CAAC,gBACrC,GAAG,gBACH,GAAG,oBACC,GAAG,EAAE,oBACL,GAAG,EAAE;;;;;;;;;;;;;;;;;;;;;;CAkFxB,CAAC"}
|