@e-llm-studio/citation 0.0.214 → 0.0.215
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 +254 -38
- package/dist/cjs/features/GptWebCitation/GptWebCitation.js +1 -1
- package/dist/cjs/features/GptWebCitation/GptWebCitation.module.css.js +1 -1
- package/dist/cjs/features/GptWebCitation/GptWebCitationImageCitation.js +1 -1
- package/dist/cjs/features/GptWebCitation/GptWebCitationImageFullScreenView.js +1 -1
- package/dist/cjs/features/GptWebCitation/GptWebCitationSkeleton.js +1 -1
- package/dist/cjs/features/GptWebCitation/utils/citationData.utils.js +1 -1
- package/dist/cjs/features/GptWebCitation/utils/fixedHeight.utils.js +2 -0
- package/dist/cjs/features/GptWebCitation/utils/fixedHeight.utils.js.map +1 -0
- package/dist/cjs/features/GptWebCitation/utils/styleOverrides.utils.js +2 -0
- package/dist/cjs/features/GptWebCitation/utils/styleOverrides.utils.js.map +1 -0
- package/dist/cjs/index.js +1 -1
- package/dist/features/GptWebCitation/GptWebCitation.js +1 -1
- package/dist/features/GptWebCitation/GptWebCitation.module.css.js +1 -1
- package/dist/features/GptWebCitation/GptWebCitationImageCitation.js +1 -1
- package/dist/features/GptWebCitation/GptWebCitationImageFullScreenView.js +1 -1
- package/dist/features/GptWebCitation/GptWebCitationSkeleton.js +1 -1
- package/dist/features/GptWebCitation/utils/citationData.utils.js +1 -1
- package/dist/features/GptWebCitation/utils/fixedHeight.utils.js +2 -0
- package/dist/features/GptWebCitation/utils/fixedHeight.utils.js.map +1 -0
- package/dist/features/GptWebCitation/utils/styleOverrides.utils.js +2 -0
- package/dist/features/GptWebCitation/utils/styleOverrides.utils.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/types/src/features/GptWebCitation/GptWebCitation.d.ts +10 -0
- package/dist/types/src/features/GptWebCitation/GptWebCitation.d.ts.map +1 -1
- package/dist/types/src/features/GptWebCitation/GptWebCitationImageCitation.d.ts +9 -1
- package/dist/types/src/features/GptWebCitation/GptWebCitationImageCitation.d.ts.map +1 -1
- package/dist/types/src/features/GptWebCitation/GptWebCitationImageFullScreenView.d.ts +3 -1
- package/dist/types/src/features/GptWebCitation/GptWebCitationImageFullScreenView.d.ts.map +1 -1
- package/dist/types/src/features/GptWebCitation/GptWebCitationSkeleton.d.ts +12 -1
- package/dist/types/src/features/GptWebCitation/GptWebCitationSkeleton.d.ts.map +1 -1
- package/dist/types/src/features/GptWebCitation/GptWebCitationTest.d.ts +1 -1
- package/dist/types/src/features/GptWebCitation/GptWebCitationTest.d.ts.map +1 -1
- package/dist/types/src/features/GptWebCitation/WebCitationSampleResponse.d.ts.map +1 -1
- package/dist/types/src/features/GptWebCitation/types.d.ts +289 -18
- package/dist/types/src/features/GptWebCitation/types.d.ts.map +1 -1
- package/dist/types/src/features/GptWebCitation/utils/citationData.utils.d.ts +2 -0
- package/dist/types/src/features/GptWebCitation/utils/citationData.utils.d.ts.map +1 -1
- package/dist/types/src/features/GptWebCitation/utils/fixedHeight.utils.d.ts +10 -0
- package/dist/types/src/features/GptWebCitation/utils/fixedHeight.utils.d.ts.map +1 -0
- package/dist/types/src/features/GptWebCitation/utils/styleOverrides.utils.d.ts +6 -0
- package/dist/types/src/features/GptWebCitation/utils/styleOverrides.utils.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +2 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/cjs/features/GptWebCitation/GptWebCitationMarkdown.js +0 -2
- package/dist/cjs/features/GptWebCitation/GptWebCitationMarkdown.js.map +0 -1
- package/dist/features/GptWebCitation/GptWebCitationMarkdown.js +0 -2
- package/dist/features/GptWebCitation/GptWebCitationMarkdown.js.map +0 -1
package/README.md
CHANGED
|
@@ -681,31 +681,51 @@ const reasoningData = {
|
|
|
681
681
|
|
|
682
682
|
`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.
|
|
683
683
|
|
|
684
|
-
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
|
|
684
|
+
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 screenshot snapshot of the source page (when available), a relevance score badge, visit links, and a **View GPT Citation** toggle to switch back.
|
|
685
|
+
|
|
686
|
+
The component is **presentational** — it does not fetch web citations. The parent owns `webCitationData`, `webCitationStatus`, and view toggling.
|
|
685
687
|
|
|
686
688
|
### Features
|
|
687
689
|
|
|
688
690
|
- **Dual citation views** — Toggle between GPT reasoning and web-based citation
|
|
689
691
|
- **Non-invasive GPT integration** — Wraps `CognitiveInternalgptCoreComponent` via props; no changes to GPT citation code required
|
|
690
|
-
- **
|
|
691
|
-
- **
|
|
692
|
+
- **Screenshot web citations** — Renders `imageMetadata.signed_url` when the API returns a snapshot
|
|
693
|
+
- **Status-driven skeleton UI** — `"pending"` loading skeleton and `"error"` fallback with **Visit Link**
|
|
694
|
+
- **`defaultCitationUrl`** — Immediate visit link while fetch is in progress (before `highlightedUrl` arrives)
|
|
695
|
+
- **Visit link priority** — `highlightedUrl` from API response wins over `defaultCitationUrl` in pending/error states
|
|
692
696
|
- **Relevance score badge** — Auto-extracted from web citation content (e.g. "decision strength is 85%")
|
|
693
|
-
- **Loading skeleton** — Built-in loading state while web citation is being generated
|
|
694
697
|
- **Expand screenshot button** — Optional full-screen image view (`showExpandImageButton`)
|
|
698
|
+
- **Custom icons** — Override expand and external-link icons via `iconsConfig`
|
|
699
|
+
- **Fixed height mode** — Optional `isFixedHeight` keeps GPT and web panels the same size with contained screenshots
|
|
695
700
|
- **Style overrides** — Customize layout via the `styles` prop without editing component internals
|
|
696
701
|
|
|
697
702
|
### Installation / Import
|
|
698
703
|
|
|
699
704
|
```tsx
|
|
700
705
|
import GptWebCitation from '@e-llm-studio/citation/GptWebCitation';
|
|
706
|
+
|
|
707
|
+
// Optional utilities and types
|
|
708
|
+
import {
|
|
709
|
+
mapCitationDataToDisplay,
|
|
710
|
+
getWebCitationImageUrl,
|
|
711
|
+
resolveSkeletonVisitUrl,
|
|
712
|
+
type GptWebCitationStatus,
|
|
713
|
+
type IWebCitationApiResponse,
|
|
714
|
+
type IGptWebCitationStyleOverrides,
|
|
715
|
+
type IGptWebCitationImageStyles,
|
|
716
|
+
type IGptWebCitationSkeletonStyles,
|
|
717
|
+
type IGptWebCitationVisitLinkStyles,
|
|
718
|
+
type IGptWebCitationFullScreenStyles,
|
|
719
|
+
} from '@e-llm-studio/citation';
|
|
701
720
|
```
|
|
702
721
|
|
|
703
722
|
### Usage 1: Basic GPT + Web Citation Toggle
|
|
704
723
|
|
|
705
724
|
```tsx
|
|
706
725
|
import { useState } from 'react';
|
|
707
|
-
import { ChevronDown, ChevronUp, Maximize2, X } from 'lucide-react';
|
|
726
|
+
import { ChevronDown, ChevronUp, ExternalLink, Maximize2, X } from 'lucide-react';
|
|
708
727
|
import GptWebCitation from '@e-llm-studio/citation/GptWebCitation';
|
|
728
|
+
import type { GptWebCitationStatus } from '@e-llm-studio/citation';
|
|
709
729
|
|
|
710
730
|
const gptCitation = {
|
|
711
731
|
item: {
|
|
@@ -727,31 +747,42 @@ const gptCitation = {
|
|
|
727
747
|
previewCallback: () => window.open('/preview/document'),
|
|
728
748
|
};
|
|
729
749
|
|
|
750
|
+
const webCitationIcons = {
|
|
751
|
+
MaximizeIcon: Maximize2,
|
|
752
|
+
ExternalLinkIcon: ExternalLink,
|
|
753
|
+
};
|
|
754
|
+
|
|
730
755
|
function CitationPanel() {
|
|
731
756
|
const [showWebCitation, setShowWebCitation] = useState(false);
|
|
732
757
|
const [webCitationData, setWebCitationData] = useState(undefined);
|
|
733
|
-
const [
|
|
758
|
+
const [webCitationStatus, setWebCitationStatus] =
|
|
759
|
+
useState<GptWebCitationStatus>('pending');
|
|
734
760
|
|
|
735
761
|
const handleGenerateWebCitation = async () => {
|
|
736
762
|
setShowWebCitation(true);
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
763
|
+
setWebCitationStatus('pending');
|
|
764
|
+
|
|
765
|
+
try {
|
|
766
|
+
const response = await fetch('/api/web-citation/generate');
|
|
767
|
+
const data = await response.json();
|
|
768
|
+
setWebCitationData(data);
|
|
769
|
+
setWebCitationStatus('success');
|
|
770
|
+
} catch {
|
|
771
|
+
setWebCitationStatus('error');
|
|
772
|
+
}
|
|
744
773
|
};
|
|
745
774
|
|
|
746
775
|
return (
|
|
747
776
|
<GptWebCitation
|
|
748
777
|
gptCitation={gptCitation}
|
|
778
|
+
defaultCitationUrl="https://example.com/article"
|
|
749
779
|
isWebCitation={true}
|
|
750
780
|
webCitationData={webCitationData}
|
|
781
|
+
webCitationStatus={webCitationStatus}
|
|
751
782
|
showWebCitation={showWebCitation}
|
|
752
|
-
isWebCitationLoading={isLoading}
|
|
753
783
|
onGenerateWebCitation={handleGenerateWebCitation}
|
|
754
784
|
onToggleCitationView={() => setShowWebCitation((prev) => !prev)}
|
|
785
|
+
iconsConfig={webCitationIcons}
|
|
755
786
|
/>
|
|
756
787
|
);
|
|
757
788
|
}
|
|
@@ -768,6 +799,8 @@ const webCitationData = {
|
|
|
768
799
|
'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>',
|
|
769
800
|
citationType: 'web',
|
|
770
801
|
citationUrl: 'https://example.com/article',
|
|
802
|
+
highlightedUrl: 'https://example.com/article#highlight',
|
|
803
|
+
message: 'Citation processed successfully',
|
|
771
804
|
imageMetadata: {
|
|
772
805
|
signed_url: 'https://storage.example.com/image_citations/screenshot.png',
|
|
773
806
|
blob_path: 'image_citations/screenshot.png',
|
|
@@ -777,21 +810,33 @@ const webCitationData = {
|
|
|
777
810
|
|
|
778
811
|
<GptWebCitation
|
|
779
812
|
gptCitation={gptCitation}
|
|
813
|
+
defaultCitationUrl="https://example.com/article"
|
|
780
814
|
isWebCitation={true}
|
|
781
815
|
webCitationData={webCitationData}
|
|
816
|
+
webCitationStatus="success"
|
|
782
817
|
showWebCitation={true}
|
|
783
818
|
/>
|
|
784
819
|
```
|
|
785
820
|
|
|
786
|
-
When `imageMetadata.signed_url` is present
|
|
821
|
+
When `imageMetadata.signed_url` is present and `webCitationStatus` is `"success"`, the component renders a screenshot snapshot. If the image is unavailable or the fetch fails, an error skeleton is shown with a **Visit Link** (using `highlightedUrl` or `defaultCitationUrl`).
|
|
822
|
+
|
|
823
|
+
#### Visit link resolution
|
|
824
|
+
|
|
825
|
+
| UI state | Visit link source |
|
|
826
|
+
| --- | --- |
|
|
827
|
+
| Pending / error skeleton | `highlightedUrl` from `webCitationData` → else `defaultCitationUrl` prop |
|
|
828
|
+
| Screenshot footer (success) | `citationUrl` from `webCitationData` |
|
|
829
|
+
|
|
830
|
+
Use `resolveSkeletonVisitUrl(highlightedUrl, defaultCitationUrl)` from `@e-llm-studio/citation` if you need the same logic outside the component.
|
|
787
831
|
|
|
788
832
|
### Usage 3: GPT-Only Mode (No Web Citation)
|
|
789
833
|
|
|
790
|
-
Set `isWebCitation={false}` to render only the GPT citation with no toggle button:
|
|
834
|
+
Set `isWebCitation={false}` to render only the GPT citation with no toggle button. `defaultCitationUrl` is still required by the prop contract but is unused in GPT-only mode:
|
|
791
835
|
|
|
792
836
|
```tsx
|
|
793
837
|
<GptWebCitation
|
|
794
838
|
gptCitation={gptCitation}
|
|
839
|
+
defaultCitationUrl="https://example.com/article"
|
|
795
840
|
isWebCitation={false}
|
|
796
841
|
/>
|
|
797
842
|
```
|
|
@@ -803,8 +848,10 @@ Hide the web citation screenshot expand button:
|
|
|
803
848
|
```tsx
|
|
804
849
|
<GptWebCitation
|
|
805
850
|
gptCitation={gptCitation}
|
|
851
|
+
defaultCitationUrl="https://example.com/article"
|
|
806
852
|
isWebCitation={true}
|
|
807
853
|
webCitationData={webCitationData}
|
|
854
|
+
webCitationStatus="success"
|
|
808
855
|
showWebCitation={true}
|
|
809
856
|
showExpandImageButton={false}
|
|
810
857
|
/>
|
|
@@ -815,6 +862,7 @@ Hide the GPT citation header maximize/expand icon:
|
|
|
815
862
|
```tsx
|
|
816
863
|
<GptWebCitation
|
|
817
864
|
gptCitation={gptCitation}
|
|
865
|
+
defaultCitationUrl="https://example.com/article"
|
|
818
866
|
isWebCitation={true}
|
|
819
867
|
showGptMaximizeButton={false}
|
|
820
868
|
/>
|
|
@@ -824,7 +872,7 @@ You can also use `gptCitation.disableMaximize: true` directly on the GPT config.
|
|
|
824
872
|
|
|
825
873
|
### Usage 5: Custom Styling via Props (matched heights)
|
|
826
874
|
|
|
827
|
-
Layout, borders, and heights for **both GPT and web views** can be controlled from the parent without modifying component internals:
|
|
875
|
+
Layout, borders, and heights for **both GPT and web views** can be controlled from the parent without modifying component internals. Prefer **`isFixedHeight`** (Usage 6) when you only need equal panel size + contained screenshots; use `styles` when you need granular control over skeleton, image, visit-link, or full-screen elements:
|
|
828
876
|
|
|
829
877
|
```tsx
|
|
830
878
|
const sharedPanelHeight = '520px';
|
|
@@ -835,9 +883,15 @@ const sharedContentHeight = '384px';
|
|
|
835
883
|
...gptCitation,
|
|
836
884
|
bodyHeight: sharedContentHeight,
|
|
837
885
|
}}
|
|
886
|
+
defaultCitationUrl="https://example.com/article"
|
|
838
887
|
isWebCitation={true}
|
|
839
888
|
webCitationData={webCitationData}
|
|
889
|
+
webCitationStatus="success"
|
|
840
890
|
showGptMaximizeButton={true}
|
|
891
|
+
iconsConfig={{
|
|
892
|
+
MaximizeIcon: Maximize2,
|
|
893
|
+
ExternalLinkIcon: ExternalLink,
|
|
894
|
+
}}
|
|
841
895
|
styles={{
|
|
842
896
|
container: { maxWidth: 900 },
|
|
843
897
|
gptCitation: {
|
|
@@ -878,33 +932,143 @@ const sharedContentHeight = '384px';
|
|
|
878
932
|
| `gptCitation.footerAction` | GPT view | View Web Citation button row in footer |
|
|
879
933
|
| `gptCitation.toggleButton` | GPT view | View Web Citation button styles |
|
|
880
934
|
| `webCitation.panel` | Web view | Outer web citation card |
|
|
881
|
-
| `webCitation.header` | Web view | Source label +
|
|
882
|
-
| `webCitation.content` | Web view |
|
|
935
|
+
| `webCitation.header` | Web view | Source label + relevance score badge row |
|
|
936
|
+
| `webCitation.content` | Web view | Screenshot or loading/error skeleton |
|
|
883
937
|
| `webCitation.footer` | Web view | View GPT Citation + Learned From row |
|
|
884
938
|
| `webCitation.toggleButton` | Web view | View GPT Citation button styles |
|
|
885
939
|
| `webCitation.learnedFrom` | Web view | "Learned From …" text styles |
|
|
940
|
+
| `webCitation.visitLink.row` | Image + skeleton | Shared visit link row (merged with scoped overrides below) |
|
|
941
|
+
| `webCitation.visitLink.hint` | Image + skeleton | Shared visit link hint text |
|
|
942
|
+
| `webCitation.visitLink.link` | Image + skeleton | Shared visit link anchor styles |
|
|
943
|
+
| `webCitation.image.wrapper` | Screenshot view | Outer image citation wrapper |
|
|
944
|
+
| `webCitation.image.center` | Screenshot view | Center column (viewport or inline skeleton) |
|
|
945
|
+
| `webCitation.image.viewport` | Screenshot view | Viewport around scroll container |
|
|
946
|
+
| `webCitation.image.scrollContainer` | Screenshot view | Scrollable screenshot container |
|
|
947
|
+
| `webCitation.image.image` | Screenshot view | Screenshot `<img>` element |
|
|
948
|
+
| `webCitation.image.expandButton` | Screenshot view | Full-screen expand button |
|
|
949
|
+
| `webCitation.image.visitLink.*` | Screenshot footer | Image-specific visit link overrides (merged on top of `webCitation.visitLink`) |
|
|
950
|
+
| `webCitation.image.fullScreen.overlay` | Full-screen viewer | Portal overlay backdrop |
|
|
951
|
+
| `webCitation.image.fullScreen.content` | Full-screen viewer | Modal content card |
|
|
952
|
+
| `webCitation.image.fullScreen.closeButton` | Full-screen viewer | Close button |
|
|
953
|
+
| `webCitation.image.fullScreen.imageWrapper` | Full-screen viewer | Scrollable image wrapper |
|
|
954
|
+
| `webCitation.image.fullScreen.image` | Full-screen viewer | Full-screen `<img>` |
|
|
955
|
+
| `webCitation.skeleton.container` | Pending/error | Outer skeleton column |
|
|
956
|
+
| `webCitation.skeleton.frame` | Pending/error | Gray skeleton frame |
|
|
957
|
+
| `webCitation.skeleton.shimmer` | Pending | Shimmer animation overlay |
|
|
958
|
+
| `webCitation.skeleton.pending.content` | Pending | Centered pending content block |
|
|
959
|
+
| `webCitation.skeleton.pending.text` | Pending | Loading message text |
|
|
960
|
+
| `webCitation.skeleton.pending.actionRow` | Pending | Visit link row |
|
|
961
|
+
| `webCitation.skeleton.pending.actionHint` | Pending | "to view details" hint |
|
|
962
|
+
| `webCitation.skeleton.error.content` | Error | Error content block |
|
|
963
|
+
| `webCitation.skeleton.error.title` | Error | "No preview available" title |
|
|
964
|
+
| `webCitation.skeleton.error.message` | Error | Restriction message |
|
|
965
|
+
| `webCitation.skeleton.error.actionGroup` | Error | Action row wrapper |
|
|
966
|
+
| `webCitation.skeleton.error.detailsToggle` | Error | Error details expand button |
|
|
967
|
+
| `webCitation.skeleton.error.detailsMessage` | Error | Expanded error details text |
|
|
968
|
+
| `webCitation.skeleton.error.visitLinkGlow` | Error | Glowing visit link (merged on top of visit link styles) |
|
|
969
|
+
| `webCitation.skeleton.visitLink.*` | Pending/error | Skeleton-specific visit link overrides (merged on top of `webCitation.visitLink`) |
|
|
886
970
|
|
|
887
971
|
Legacy flat keys (`gptCitationWrapper`, `footerAction`, `webCitationButton`) still work for backward compatibility.
|
|
888
972
|
|
|
973
|
+
#### Example: customize screenshot and pending skeleton
|
|
974
|
+
|
|
975
|
+
```tsx
|
|
976
|
+
<GptWebCitation
|
|
977
|
+
gptCitation={gptCitation}
|
|
978
|
+
defaultCitationUrl="https://example.com/article"
|
|
979
|
+
isWebCitation
|
|
980
|
+
webCitationData={data}
|
|
981
|
+
webCitationStatus={status}
|
|
982
|
+
styles={{
|
|
983
|
+
webCitation: {
|
|
984
|
+
visitLink: {
|
|
985
|
+
link: { backgroundColor: 'rgba(37, 99, 235, 0.08)', borderRadius: 8 },
|
|
986
|
+
},
|
|
987
|
+
image: {
|
|
988
|
+
scrollContainer: { borderRadius: 16, borderColor: '#d1d5db' },
|
|
989
|
+
image: { objectFit: 'contain', maxHeight: 360 },
|
|
990
|
+
expandButton: { backgroundColor: '#111827' },
|
|
991
|
+
},
|
|
992
|
+
skeleton: {
|
|
993
|
+
frame: { minHeight: 320, backgroundColor: '#f8fafc' },
|
|
994
|
+
pending: {
|
|
995
|
+
text: { fontSize: 14, color: '#374151' },
|
|
996
|
+
},
|
|
997
|
+
error: {
|
|
998
|
+
title: { color: '#dc2626' },
|
|
999
|
+
visitLinkGlow: { borderColor: '#dc2626' },
|
|
1000
|
+
},
|
|
1001
|
+
},
|
|
1002
|
+
},
|
|
1003
|
+
}}
|
|
1004
|
+
/>
|
|
1005
|
+
```
|
|
1006
|
+
|
|
1007
|
+
### Usage 6: Fixed height mode (matched GPT + web panels)
|
|
1008
|
+
|
|
1009
|
+
Set `isFixedHeight={true}` when you want GPT and web citation views to share the same panel dimensions. Screenshots use `object-fit: contain` so tall pages stay inside the box without layout shift when toggling views.
|
|
1010
|
+
|
|
1011
|
+
```tsx
|
|
1012
|
+
<GptWebCitation
|
|
1013
|
+
gptCitation={{
|
|
1014
|
+
...gptCitation,
|
|
1015
|
+
bodyHeight: '384px', // optional — customizes inner content height
|
|
1016
|
+
}}
|
|
1017
|
+
defaultCitationUrl="https://example.com/article"
|
|
1018
|
+
isWebCitation
|
|
1019
|
+
isFixedHeight
|
|
1020
|
+
webCitationData={webCitationData}
|
|
1021
|
+
webCitationStatus="success"
|
|
1022
|
+
showWebCitation={showWebCitation}
|
|
1023
|
+
onToggleCitationView={() => setShowWeb((v) => !v)}
|
|
1024
|
+
/>
|
|
1025
|
+
```
|
|
1026
|
+
|
|
1027
|
+
| Scenario | Panel height |
|
|
1028
|
+
| --- | --- |
|
|
1029
|
+
| `isFixedHeight` + `isWebCitation` (toggle footer present) | `520px` default, or `calc(bodyHeight + 3.25rem)` when `gptCitation.bodyHeight` is set |
|
|
1030
|
+
| `isFixedHeight` + `isWebCitation={false}` (GPT only) | `520px` default, or `gptCitation.bodyHeight` when set |
|
|
1031
|
+
|
|
1032
|
+
`isFixedHeight` applies flex layout and contained images automatically. For manual per-element styling without fixed dimensions, use `styles` (Usage 5) instead.
|
|
1033
|
+
|
|
889
1034
|
### Props
|
|
890
1035
|
|
|
891
1036
|
| Prop | Type | Default | Description |
|
|
892
1037
|
|------|------|---------|-------------|
|
|
893
|
-
| `gptCitation` | `IGptCitationConfig` | **required** | GPT citation config passed to `CognitiveInternalgptCoreComponent`
|
|
894
|
-
| `
|
|
895
|
-
| `
|
|
896
|
-
| `
|
|
897
|
-
| `
|
|
898
|
-
| `
|
|
1038
|
+
| `gptCitation` | `IGptCitationConfig` | **required** | GPT citation config passed to `CognitiveInternalgptCoreComponent` |
|
|
1039
|
+
| `defaultCitationUrl` | `string` | **required** | Fallback source URL for **Visit Link** in pending/error skeletons. Used when `webCitationData.highlightedUrl` is not yet available |
|
|
1040
|
+
| `isWebCitation` | `boolean` | `false` | When `true`, enables web citation toggle and web view |
|
|
1041
|
+
| `webCitationData` | `IWebCitationApiResponse` | — | Web citation API response (screenshot metadata, URLs, optional message) |
|
|
1042
|
+
| `webCitationStatus` | `"pending"` \| `"success"` \| `"error"` | inferred | Lifecycle status from parent API call. Inferred from `webCitationData` when omitted |
|
|
1043
|
+
| `showWebCitation` | `boolean` | `true` (uncontrolled) | `false` = GPT view, `true` = web view. Omit for uncontrolled internal state |
|
|
1044
|
+
| `onGenerateWebCitation` | `() => void` | — | Called when web view opens and no cached screenshot exists. Parent should fetch and update status/data. Also invoked once on mount when `isWebCitation` + `showWebCitation` are true and no image is cached |
|
|
899
1045
|
| `onToggleCitationView` | `() => void` | — | Called when user toggles between GPT and web views |
|
|
900
|
-
| `showExpandImageButton` | `boolean` | `true` | Show/hide
|
|
901
|
-
| `showGptMaximizeButton` | `boolean` | `true` | Show/hide
|
|
902
|
-
| `
|
|
1046
|
+
| `showExpandImageButton` | `boolean` | `true` | Show/hide full-screen expand on screenshot |
|
|
1047
|
+
| `showGptMaximizeButton` | `boolean` | `true` | Show/hide GPT header maximize icon (`gptCitation.disableMaximize: true` when `false`) |
|
|
1048
|
+
| `iconsConfig` | `IGptWebCitationImageIconsConfig` | — | `MaximizeIcon` and `ExternalLinkIcon` overrides for web view |
|
|
1049
|
+
| `topic` | `string` | auto | Override topic label in web header |
|
|
903
1050
|
| `sourceLabel` | `string` | auto | Override header source label in web view |
|
|
904
|
-
| `relevanceScore` | `number` | auto | Override relevance/decision strength
|
|
905
|
-
| `learnedFrom` | `string` | auto | Site name
|
|
1051
|
+
| `relevanceScore` | `number` | auto | Override relevance/decision strength badge (%) |
|
|
1052
|
+
| `learnedFrom` | `string` | auto | Site name in web footer (auto-derived from `citationUrl`) |
|
|
1053
|
+
| `sourceModel` | `string` | — | **Deprecated.** Use `sourceLabel` instead |
|
|
1054
|
+
| `isFixedHeight` | `boolean` | `false` | When `true`, GPT and web panels share the same fixed height/width; screenshot uses `object-fit: contain` |
|
|
906
1055
|
| `styles` | `IGptWebCitationStyleOverrides` | — | Style overrides for GPT and web citation views (see Usage 5) |
|
|
907
1056
|
|
|
1057
|
+
When `isFixedHeight` is `true`, both views use the same panel height (`520px` by default, or `gptCitation.bodyHeight` + toggle footer). Pair with `gptCitation.bodyHeight` to customize the content area (e.g. `"384px"`).
|
|
1058
|
+
|
|
1059
|
+
#### `webCitationStatus` inference
|
|
1060
|
+
|
|
1061
|
+
When `webCitationStatus` is omitted, the component derives it in this order:
|
|
1062
|
+
|
|
1063
|
+
| Priority | Condition | Status |
|
|
1064
|
+
| --- | --- | --- |
|
|
1065
|
+
| 1 | Valid screenshot URL in `webCitationData` (`signed_url` or `gs_uri`) | `"success"` (always — image wins over explicit status) |
|
|
1066
|
+
| 2 | Explicit `webCitationStatus` prop | uses prop value |
|
|
1067
|
+
| 3 | `webCitationData` present but no image URL | `"error"` |
|
|
1068
|
+
| 4 | No `webCitationData` | `"pending"` |
|
|
1069
|
+
|
|
1070
|
+
Pass `webCitationStatus="pending"` explicitly while your fetch is in flight (before the image URL is available).
|
|
1071
|
+
|
|
908
1072
|
### `IGptCitationConfig` (gptCitation prop)
|
|
909
1073
|
|
|
910
1074
|
| Field | Type | Description |
|
|
@@ -913,35 +1077,87 @@ Legacy flat keys (`gptCitationWrapper`, `footerAction`, `webCitationButton`) sti
|
|
|
913
1077
|
| `headerTitle` | `string` | Panel header title |
|
|
914
1078
|
| `index` | `number` | Citation index |
|
|
915
1079
|
| `iconsConfig` | `object` | Icon components (`ChevronDownIcon`, `ChevronUpIcon`, `MaximizeIcon`, `CloseIcon`) |
|
|
916
|
-
| `DocumentTitle` | `string` | Source document label shown in the GPT footer (right side) |
|
|
1080
|
+
| `DocumentTitle` | `string` | Source document label shown in the GPT footer (right side). Hidden when `isWebCitation` is true |
|
|
917
1081
|
| `previewCallback` | `() => void` | Called when the source link is clicked |
|
|
918
|
-
| `bodyHeight` | `string` | Optional fixed GPT content body height (
|
|
1082
|
+
| `bodyHeight` | `string` | Optional fixed GPT content body height (pair with `styles.webCitation.content`) |
|
|
919
1083
|
| `disableMaximize` | `boolean` | Disable GPT header fullscreen maximize button (or use `showGptMaximizeButton={false}`) |
|
|
920
1084
|
|
|
1085
|
+
### `IGptWebCitationImageIconsConfig` (iconsConfig prop)
|
|
1086
|
+
|
|
1087
|
+
| Field | Type | Fallback |
|
|
1088
|
+
|-------|------|----------|
|
|
1089
|
+
| `MaximizeIcon` | `ElementType` | `gptCitation.iconsConfig.MaximizeIcon`, then `Maximize2` |
|
|
1090
|
+
| `ExternalLinkIcon` | `ElementType` | `ExternalLink` |
|
|
1091
|
+
|
|
1092
|
+
### Style override types (`styles` prop)
|
|
1093
|
+
|
|
1094
|
+
Nested under `styles.webCitation`:
|
|
1095
|
+
|
|
1096
|
+
| Type | Keys | Purpose |
|
|
1097
|
+
| --- | --- | --- |
|
|
1098
|
+
| `IGptWebCitationVisitLinkStyles` | `row`, `hint`, `link` | Visit link row shared by image footer and skeletons |
|
|
1099
|
+
| `IGptWebCitationImageStyles` | `wrapper`, `center`, `viewport`, `scrollContainer`, `image`, `expandButton`, `visitLink`, `fullScreen` | Screenshot view + inline loading skeleton while image decodes |
|
|
1100
|
+
| `IGptWebCitationSkeletonStyles` | `container`, `frame`, `shimmer`, `pending.*`, `error.*`, `visitLink` | Pending/error skeleton UI |
|
|
1101
|
+
| `IGptWebCitationFullScreenStyles` | `overlay`, `content`, `closeButton`, `imageWrapper`, `image` | Full-screen screenshot modal |
|
|
1102
|
+
|
|
1103
|
+
`webCitation.visitLink` merges with scoped `image.visitLink` or `skeleton.visitLink` overrides (scoped wins on conflict).
|
|
1104
|
+
|
|
921
1105
|
### `IWebCitationApiResponse` (webCitationData prop)
|
|
922
1106
|
|
|
923
1107
|
| Field | Type | Description |
|
|
924
1108
|
|-------|------|-------------|
|
|
925
1109
|
| `citationId` | `string` | Unique citation identifier |
|
|
926
|
-
| `content` | `string` | HTML/markdown
|
|
1110
|
+
| `content` | `string` | HTML/markdown explanation (used for topic/score extraction) |
|
|
927
1111
|
| `citationType` | `string` | Citation type (e.g. `"web"`) |
|
|
928
|
-
| `citationUrl` | `string` | Original source URL |
|
|
1112
|
+
| `citationUrl` | `string` | Original source URL (screenshot footer **Visit Link**) |
|
|
1113
|
+
| `highlightedUrl` | `string` | Highlighted URL from API (preferred for skeleton **Visit Link**) |
|
|
1114
|
+
| `message` | `string` | API status or error message |
|
|
929
1115
|
| `imageMetadata` | `object` | Image snapshot metadata |
|
|
930
|
-
| `imageMetadata.signed_url` | `string` | Signed URL for screenshot
|
|
1116
|
+
| `imageMetadata.signed_url` | `string` | Signed URL for screenshot (preferred) |
|
|
931
1117
|
| `imageMetadata.gs_uri` | `string` | GCS URI fallback for image |
|
|
932
1118
|
| `db` | `object` | Database metadata (`citation_id`, `blob_path`) |
|
|
933
1119
|
|
|
1120
|
+
### Utility helpers
|
|
1121
|
+
|
|
1122
|
+
Exported from `@e-llm-studio/citation`:
|
|
1123
|
+
|
|
1124
|
+
| Function | Purpose |
|
|
1125
|
+
| --- | --- |
|
|
1126
|
+
| `mapCitationDataToDisplay(data)` | Normalizes API response → display fields (`topic`, `highlightedUrl`, `relevanceScore`, etc.) |
|
|
1127
|
+
| `getWebCitationImageUrl(data)` | Resolves screenshot URL from `imageMetadata` |
|
|
1128
|
+
| `resolveSkeletonVisitUrl(highlightedUrl, defaultCitationUrl)` | Visit link for pending/error skeletons |
|
|
1129
|
+
| `extractTopicFromContent(content)` | First anchor text from content |
|
|
1130
|
+
| `extractRelevanceScoreFromContent(content)` | Parses decision strength / confidence % |
|
|
1131
|
+
| `extractLearnedFromUrl(citationUrl)` | Hostname → site name for footer |
|
|
1132
|
+
| `sanitizeExternalUrl(url)` | Safe http(s) URL for links |
|
|
1133
|
+
|
|
934
1134
|
### View Behavior
|
|
935
1135
|
|
|
936
1136
|
| State | What renders |
|
|
937
1137
|
|-------|--------------|
|
|
938
1138
|
| `isWebCitation={false}` | GPT citation only |
|
|
939
|
-
| `isWebCitation={true}`, `showWebCitation={false}` | GPT citation + **View Web Citation** button
|
|
940
|
-
| `isWebCitation={true}`, `showWebCitation={true}` |
|
|
1139
|
+
| `isWebCitation={true}`, `showWebCitation={false}` | GPT citation + **View Web Citation** button |
|
|
1140
|
+
| `isWebCitation={true}`, `showWebCitation={true}`, `webCitationStatus="pending"` | Shimmer skeleton + optional **Visit Link** (`highlightedUrl` → `defaultCitationUrl`) |
|
|
1141
|
+
| `isWebCitation={true}`, `showWebCitation={true}`, `webCitationStatus="success"` | Screenshot (pending skeleton while image loads) + footer **Visit Link** |
|
|
1142
|
+
| `isWebCitation={true}`, `showWebCitation={true}`, `webCitationStatus="error"` | Error skeleton ("No preview available") + inline **Visit Link** |
|
|
1143
|
+
| `isFixedHeight={true}` | GPT and web outer panels share height; screenshot `object-fit: contain`; skeleton fills content area |
|
|
1144
|
+
|
|
1145
|
+
#### Auto-fetch
|
|
1146
|
+
|
|
1147
|
+
When `isWebCitation` is true and the web view is open with no cached screenshot, `onGenerateWebCitation` is called:
|
|
1148
|
+
|
|
1149
|
+
1. Once on mount (per `webCitationData.citationId`)
|
|
1150
|
+
2. Again when the user clicks **View Web Citation** and no image is cached
|
|
1151
|
+
|
|
1152
|
+
The parent should set `webCitationStatus="pending"`, fetch, then update `webCitationData` and status.
|
|
1153
|
+
|
|
1154
|
+
#### Error skeleton
|
|
1155
|
+
|
|
1156
|
+
The error state shows a fixed title ("No preview available"), a restriction message ("This website restricts external previews"), and an inline **Visit Link** when a source URL is available.
|
|
941
1157
|
|
|
942
1158
|
### Local Test Component
|
|
943
1159
|
|
|
944
|
-
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.
|
|
1160
|
+
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. The harness uses `sampleWebCitationApiResponse` from `WebCitationSampleResponse.ts`, simulates a 2s fetch delay when **View Web Citation** is clicked, and accepts `isFixedHeight`, `webCitationStatus`, `iconsConfig`, and `styles` props for local experimentation.
|
|
945
1161
|
|
|
946
1162
|
---
|
|
947
1163
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),t=require("react"),n=require("lucide-react"),o=require("../CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.js"),l=require("./GptWebCitationImageCitation.js"),a=require("./GptWebCitationSkeleton.js"),s=require("./utils/citationData.utils.js"),r=require("./utils/styleOverrides.utils.js"),u=require("./utils/fixedHeight.utils.js"),d=require("./GptWebCitation.module.css.js"),c=require("../../assests/svg/NeuralNetworkIcon.js"),g=function(t){var o=t.variant,l=t.disabled,a=t.onClick,s=t.title,r=t.style;return i.jsx("button",e.__assign({type:"button",className:d.default.webCitationButton,onClick:a,disabled:l,title:s,style:r},{children:"gpt"===o?i.jsxs(i.Fragment,{children:[i.jsx(c.default,{className:d.default.webCitationButtonIcon}),"View GPT Citation"]}):i.jsxs(i.Fragment,{children:[i.jsx(n.Globe,{size:24,className:d.default.webCitationButtonIcon}),"View Web Citation"]})}))};exports.default=function(c){var v,p,b,_=c.gptCitation,C=c.defaultCitationUrl,f=c.isWebCitation,m=void 0!==f&&f,x=c.webCitationData,w=c.topic,h=c.sourceLabel,k=c.relevanceScore,j=c.learnedFrom,y=c.webCitationStatus,F=c.onGenerateWebCitation,S=c.showWebCitation,I=c.onToggleCitationView,L=c.showExpandImageButton,W=void 0===L||L,B=c.showGptMaximizeButton,H=c.iconsConfig,N=c.isFixedHeight,M=void 0!==N&&N,V=c.styles,q=t.useMemo(function(){return function(i){var t,n,o,l,a,s,u,d,c,g,v;return{container:null==i?void 0:i.container,gptWrapper:e.__assign(e.__assign({},null===(t=null==i?void 0:i.gptCitation)||void 0===t?void 0:t.wrapper),null==i?void 0:i.gptCitationWrapper),gptFooterAction:e.__assign(e.__assign({},null===(n=null==i?void 0:i.gptCitation)||void 0===n?void 0:n.footerAction),null==i?void 0:i.footerAction),gptToggleButton:e.__assign(e.__assign({},null===(o=null==i?void 0:i.gptCitation)||void 0===o?void 0:o.toggleButton),null==i?void 0:i.webCitationButton),webPanel:e.__assign(e.__assign({},null==i?void 0:i.container),null===(l=null==i?void 0:i.webCitation)||void 0===l?void 0:l.panel),webHeader:null===(a=null==i?void 0:i.webCitation)||void 0===a?void 0:a.header,webContent:null===(s=null==i?void 0:i.webCitation)||void 0===s?void 0:s.content,webFooter:null===(u=null==i?void 0:i.webCitation)||void 0===u?void 0:u.footer,webToggleButton:e.__assign(e.__assign({},null===(d=null==i?void 0:i.webCitation)||void 0===d?void 0:d.toggleButton),null==i?void 0:i.webCitationButton),webLearnedFrom:null===(c=null==i?void 0:i.webCitation)||void 0===c?void 0:c.learnedFrom,webImage:null===(g=null==i?void 0:i.webCitation)||void 0===g?void 0:g.image,webSkeleton:null===(v=null==i?void 0:i.webCitation)||void 0===v?void 0:v.skeleton,webImageVisitLink:r.resolveWebCitationVisitLinkStyles(null==i?void 0:i.webCitation,"image"),webSkeletonVisitLink:r.resolveWebCitationVisitLinkStyles(null==i?void 0:i.webCitation,"skeleton")}}(V)},[V]),E=t.useMemo(function(){return M?u.resolveFixedHeightLayout(_.bodyHeight,m):null},[M,_.bodyHeight,m]),T=t.useMemo(function(){return E?u.getFixedPanelStyle(E.panelHeight):void 0},[E]),z=t.useMemo(function(){var e,i;return{MaximizeIcon:null!==(e=null==H?void 0:H.MaximizeIcon)&&void 0!==e?e:null===(i=_.iconsConfig)||void 0===i?void 0:i.MaximizeIcon,ExternalLinkIcon:null==H?void 0:H.ExternalLinkIcon}},[H,null===(v=_.iconsConfig)||void 0===v?void 0:v.MaximizeIcon]),U=t.useMemo(function(){return e.__assign(e.__assign(e.__assign(e.__assign({},_),M&&E?{bodyHeight:E.gptBodyHeight}:{}),{disableMaximize:void 0!==B?!B:_.disableMaximize}),m?{DocumentTitle:void 0,previewCallback:void 0}:{})},[_,B,m,M,E]),A=t.useState(!0),D=A[0],G=A[1],P=t.useRef(!1),O=null!=S?S:D,R=void 0!==S,J=t.useMemo(function(){return x?s.mapCitationDataToDisplay(x):null},[x]),K=null!==(p=null!=w?w:null==J?void 0:J.topic)&&void 0!==p?p:"Web Citation",Q=null!==(b=null!=k?k:null==J?void 0:J.relevanceScore)&&void 0!==b?b:0,X=null!=j?j:null==J?void 0:J.learnedFrom,Y=null==J?void 0:J.citationUrl,Z=s.resolveSkeletonVisitUrl(null==J?void 0:J.highlightedUrl,C),$=s.getWebCitationImageUrl(x),ee=t.useMemo(function(){return function(e,i,t){return t?"success":e||(i?"error":"pending")}(y,x,$)},[y,x,$]);t.useEffect(function(){P.current=!1},[null==x?void 0:x.citationId]),t.useEffect(function(){m&&O&&($||P.current||(P.current=!0,null==F||F()))},[m,O,$,F,null==x?void 0:x.citationId]);var ie=t.useCallback(function(){I?I():R||G(!1)},[I,R]),te=t.useCallback(function(){I?I():R||G(!0),$||"success"===ee||null==F||F()},[I,R,$,ee,F]),ne=null!=h?h:"Source: Web Citation > ".concat(K),oe=function(t){var n=!!U.DocumentTitle,l=[d.default.gptCitationWrapper,n?d.default.gptCitationWrapperWithSource:"",M?d.default.gptCitationWrapperFixedHeight:""].filter(Boolean).join(" ");return i.jsxs("div",e.__assign({className:l,style:e.__assign(e.__assign({},q.gptWrapper),T)},{children:[i.jsx(o.default,e.__assign({},U,{splitterCustomStyle:!0})),t&&(n?i.jsx("div",e.__assign({className:d.default.gptCitationFooterAction,style:q.gptFooterAction},{children:t})):i.jsx("div",e.__assign({className:[d.default.gptCitationToggleFooter,M?d.default.gptCitationToggleFooterFixedHeight:""].filter(Boolean).join(" "),style:q.gptFooterAction},{children:t})))]}))};return m?O?i.jsxs("div",e.__assign({className:[d.default.panel,M?d.default.gptCitationWrapperFixedHeight:""].filter(Boolean).join(" "),style:e.__assign(e.__assign({},q.webPanel),T)},{children:[i.jsxs("div",e.__assign({className:d.default.panelHeader,style:q.webHeader},{children:[i.jsx("span",e.__assign({className:d.default.panelSource},{children:ne})),i.jsx("div",e.__assign({className:d.default.panelHeaderActions},{children:Q>0&&i.jsxs("div",e.__assign({className:d.default.confidenceBadge,title:"Decision strength"},{children:[i.jsx(n.Sparkles,{size:14}),Q,"%"]}))}))]})),i.jsx("div",e.__assign({className:[d.default.panelContent,d.default.panelContentExpanded,M?d.default.panelContentFixedHeight:""].filter(Boolean).join(" "),style:e.__assign(e.__assign({},q.webContent),M?u.getFixedWebContentStyle():void 0)},{children:"pending"===ee?i.jsx(a.default,{status:"pending",citationUrl:Z,ExternalLinkIcon:z.ExternalLinkIcon,styles:q.webSkeleton,visitLinkStyles:q.webSkeletonVisitLink,isFixedHeight:M}):"success"===ee&&$?i.jsx(l.default,{citationImage:$,citationUrl:Y,skeletonVisitUrl:Z,showExpandImageButton:W,iconsConfig:z,styles:q.webImage,visitLinkStyles:q.webImageVisitLink,skeletonStyles:q.webSkeleton,skeletonVisitLinkStyles:q.webSkeletonVisitLink,isFixedHeight:M}):i.jsx(a.default,{status:"error",citationUrl:Z,ExternalLinkIcon:z.ExternalLinkIcon,styles:q.webSkeleton,visitLinkStyles:q.webSkeletonVisitLink,isFixedHeight:M})})),i.jsxs("div",e.__assign({className:d.default.panelFooter,style:q.webFooter},{children:[i.jsx(g,{variant:"gpt",onClick:ie,style:q.webToggleButton}),X&&i.jsxs("span",e.__assign({className:d.default.learnedFrom,style:q.webLearnedFrom},{children:["Learned From ",X]}))]}))]})):i.jsx("div",e.__assign({className:d.default.overlay,style:q.container},{children:oe(i.jsx(g,{variant:"web",onClick:te,title:"View web-based citation for this source.",style:q.gptToggleButton}))})):i.jsx("div",e.__assign({className:d.default.overlay,style:q.container},{children:oe()}))};
|
|
2
2
|
//# sourceMappingURL=GptWebCitation.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(".GptWebCitation-module_overlay__OY5pa{display:flex;flex-direction:column;font-family:Plus Jakarta Sans,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;width:100%}.GptWebCitation-module_gptCitationWrapper__EN7nk{background-color:#fff;border:solid #e5e7eb;border-radius:8px;border-width:1px 1px 2px;box-shadow:0 1px 2px #0000000d;box-sizing:border-box;display:flex;flex-direction:column;overflow:hidden;position:relative;width:100%}.GptWebCitation-module_gptCitationToggleFooter__ncfLT{align-items:center;background-color:#f2f4f7;border-top:1px solid #e5e7eb;display:flex;flex-shrink:0;padding:1rem 1.5rem}.GptWebCitation-module_gptCitationFooterAction__WWpAY{align-items:center;bottom:0;box-sizing:border-box;display:flex;height:3rem;left:1.5rem;padding:0;pointer-events:none;position:absolute;z-index:2}.GptWebCitation-module_gptCitationFooterAction__WWpAY>*{pointer-events:auto}.GptWebCitation-module_gptCitationWrapperWithSource__1-ynq [class*=modalFooterSource]{justify-content:flex-end!important;padding-left:13rem}.GptWebCitation-module_panel__ek9Lq{background-color:#fff;border:1px solid #e5e7eb;border-radius:8px;box-shadow:0 1px 2px #0000000d;color:#1f2937;display:flex;flex-direction:column;font-family:Plus Jakarta Sans,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;width:100%}.GptWebCitation-module_panelHeader__afwge{align-items:center;background-color:#f9fafb;border-bottom:1px solid #e5e7eb;display:flex;font-size:13px;gap:8px;justify-content:space-between;padding:8px 16px}.GptWebCitation-module_panelSource__oFl-c{color:#374151;flex:1;font-weight:600;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.GptWebCitation-module_panelHeaderActions__sGrhi{align-items:center;display:flex;flex-shrink:0;gap:8px}.GptWebCitation-module_pagination__VQvbY{align-items:center;background-color:#fff;border:1px solid #d1d5db;border-radius:6px;display:flex;gap:2px;padding:2px 4px}.GptWebCitation-module_paginationButton__fzJyQ{align-items:center;background:#0000;border:none;border-radius:4px;color:#6b7280;cursor:pointer;display:flex;justify-content:center;padding:2px}.GptWebCitation-module_paginationButton__fzJyQ:hover:not(:disabled){background-color:#f3f4f6}.GptWebCitation-module_paginationButton__fzJyQ:disabled{cursor:not-allowed;opacity:.4}.GptWebCitation-module_paginationLabel__S7t1W{color:#6b7280;font-size:12px;min-width:36px;padding:0 4px;text-align:center}.GptWebCitation-module_confidenceBadge__4BBTf{align-items:center;background-color:#ecfdf5;border:1px solid #10b981;border-radius:9999px;color:#059669;display:inline-flex;font-size:13px;font-weight:500;gap:4px;padding:4px 10px}.GptWebCitation-module_panelContent__vg-mG{max-height:192px;overflow-y:auto;padding:8px 12px 12px}.GptWebCitation-module_panelContentExpanded__3aGjq{display:flex;flex-direction:column;max-height:none;min-height:384px;overflow:hidden}.GptWebCitation-module_markdownBody__5kdwH{color:#374151;font-size:14px;line-height:1.6}.GptWebCitation-module_markdownBody__5kdwH ol{list-style-type:lower-alpha;margin:0;padding-left:1.25rem}.GptWebCitation-module_markdownBody__5kdwH li{margin-bottom:8px}.GptWebCitation-module_markdownBody__5kdwH code{background-color:#f3f4f6;border-radius:4px;color:#1f2937;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:13px;padding:1px 6px}.GptWebCitation-module_highlight__Xr1wl{background-color:#fef08a;border-radius:2px;color:#1f2937;padding:0 2px}.GptWebCitation-module_highlightActive__iFuz5{background-color:#fde047;border:1px solid #eab308;box-shadow:0 1px 2px #0000001a}.GptWebCitation-module_citationLink__kH9JC{color:#2563eb;font-weight:500;text-decoration:none}.GptWebCitation-module_citationLink__kH9JC:hover{text-decoration:underline}.GptWebCitation-module_citationLinkActive__SShYx{background-color:#fef08a;border:1px solid #eab308;border-radius:2px;color:#1f2937;padding:0 2px}.GptWebCitation-module_panelFooter__wm98C{align-items:center;background-color:#f9fafb;border-top:1px solid #e5e7eb;display:flex;font-size:13px;justify-content:space-between;padding:8px 16px}.GptWebCitation-module_webCitationButton__blI--{align-items:center;background-color:#f9fafb;border:1px solid #e5e7eb;border-radius:8px;color:#2563eb;cursor:pointer;display:inline-flex;font-size:14px;font-weight:700;gap:8px;justify-content:center;line-height:1.25;min-width:180px;padding:6px 16px;transition:background-color .15s ease;white-space:nowrap}.GptWebCitation-module_webCitationButton__blI--:hover:not(:disabled){background-color:#f3f4f6}.GptWebCitation-module_webCitationButton__blI--:disabled{cursor:not-allowed;opacity:.75}.GptWebCitation-module_webCitationButtonIcon__r9lPc{color:#2563eb;flex-shrink:0}.GptWebCitation-module_learnedFrom__DMyLS{color:#6b7280;font-size:13px}.GptWebCitation-module_imageCitationWrapper__iQUSw{box-sizing:border-box;display:flex;flex:1;flex-direction:column;gap:12px;min-height:0;padding:8px 4px;width:100%}.GptWebCitation-module_imageCitationCenter__DMlqn{display:flex;flex:1;justify-content:center;min-height:0;position:relative;width:100%}.GptWebCitation-module_imageCitationViewport__xcotr{height:100%;max-width:100%;min-height:0;position:relative;width:100%}.GptWebCitation-module_imageCitationScrollContainer__bAQNk{background-color:#f9fafb;border:1px solid #e5e7eb;border-radius:12px;height:100%;max-height:100%;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;scrollbar-color:#cbd5e1 #0000;scrollbar-width:thin;width:100%}.GptWebCitation-module_imageCitationScrollContainer__bAQNk::-webkit-scrollbar{width:8px}.GptWebCitation-module_imageCitationScrollContainer__bAQNk::-webkit-scrollbar-thumb{background-color:#cbd5e1;border-radius:9999px}.GptWebCitation-module_imageCitationScrollContainer__bAQNk::-webkit-scrollbar-track{background-color:initial}.GptWebCitation-module_citationImage__7rWdT{background-color:#f9fafb;border:none;border-radius:0;display:block;height:auto;max-width:100%;object-fit:unset;width:100%}.GptWebCitation-module_citationImagePreload__L7ibJ{height:0;opacity:0;pointer-events:none;position:absolute;visibility:hidden;width:0}.GptWebCitation-module_expandImageButton__598k6{align-items:center;background-color:#374151eb;border:none;border-radius:6px;bottom:12px;box-shadow:0 2px 6px #0003;color:#fff;cursor:pointer;display:inline-flex;height:32px;justify-content:center;padding:0;position:absolute;right:12px;transition:background-color .15s ease;width:32px;z-index:2}.GptWebCitation-module_expandImageButton__598k6:hover{background-color:#1f2937}.GptWebCitation-module_expandImageButton__598k6 svg{flex-shrink:0}.GptWebCitation-module_fullScreenOverlay__Z5U8h{align-items:center;backdrop-filter:blur(4px);background-color:#0009;display:flex;inset:0;justify-content:center;overflow:hidden;overscroll-behavior:contain;padding:16px;position:fixed;z-index:1100}.GptWebCitation-module_fullScreenContent__xIXZR{background-color:#fff;border:1px solid #e5e7eb;border-radius:16px;box-shadow:0 25px 50px -12px #00000040;max-height:90vh;max-width:95vw;overflow:hidden;position:relative}.GptWebCitation-module_fullScreenCloseButton__lnaT1{align-items:center;background-color:#374151eb;border:none;border-radius:6px;box-shadow:0 2px 6px #0003;color:#fff;cursor:pointer;display:inline-flex;height:32px;justify-content:center;padding:0;position:absolute;right:16px;top:16px;transition:background-color .15s ease;width:32px;z-index:1}.GptWebCitation-module_fullScreenCloseButton__lnaT1:hover{background-color:#1f2937}.GptWebCitation-module_fullScreenImageWrapper__ADPGU{align-items:flex-start;display:flex;justify-content:center;max-height:80vh;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;padding:8px;scrollbar-color:#cbd5e1 #0000;scrollbar-width:thin;width:100%}.GptWebCitation-module_fullScreenImage__jLVAQ{border-radius:12px;height:auto;max-width:100%;object-fit:unset;width:100%}.GptWebCitation-module_visitLinkRow__H8ai5{align-items:center;display:flex;flex-shrink:0;gap:12px;justify-content:flex-start;padding:4px 8px 0;width:100%}.GptWebCitation-module_visitLinkHint__FAwob{color:#6b7280;font-size:13px;line-height:1.4}.GptWebCitation-module_visitLink__1BDo8{align-items:center;background-color:#2563eb1f;border-radius:6px;color:#2563eb;display:inline-flex;flex-shrink:0;font-size:13px;font-weight:600;gap:6px;padding:6px 12px;text-decoration:none;white-space:nowrap}.GptWebCitation-module_visitLink__1BDo8:hover{background-color:#2563eb2e;text-decoration:none}.GptWebCitation-module_skeleton__1q51h{align-items:center;background-color:#f3f4f6;border-radius:12px;display:flex;justify-content:center;min-height:384px;overflow:hidden;padding:24px;position:relative;width:100%}.GptWebCitation-module_skeletonText__E6XgN{color:#6b7280;font-size:14px;line-height:1.5;max-width:320px;position:relative;text-align:center;z-index:1}.GptWebCitation-module_skeletonShimmer__yqWJh{animation:GptWebCitation-module_shimmer__-ZbQA 1.5s linear infinite;background:linear-gradient(90deg,#0000,#fff9,#0000);inset:0;position:absolute}@keyframes GptWebCitation-module_shimmer__-ZbQA{0%{transform:translateX(-100%)}to{transform:translateX(100%)}}"));const o=document.head||document.getElementsByTagName("head")[0]||document.documentElement;o&&o.appendChild(e)}(),exports.default={overlay:"GptWebCitation-module_overlay__OY5pa",gptCitationWrapper:"GptWebCitation-module_gptCitationWrapper__EN7nk",gptCitationToggleFooter:"GptWebCitation-module_gptCitationToggleFooter__ncfLT",gptCitationFooterAction:"GptWebCitation-module_gptCitationFooterAction__WWpAY",gptCitationWrapperWithSource:"GptWebCitation-module_gptCitationWrapperWithSource__1-ynq",panel:"GptWebCitation-module_panel__ek9Lq",panelHeader:"GptWebCitation-module_panelHeader__afwge",panelSource:"GptWebCitation-module_panelSource__oFl-c",panelHeaderActions:"GptWebCitation-module_panelHeaderActions__sGrhi",pagination:"GptWebCitation-module_pagination__VQvbY",paginationButton:"GptWebCitation-module_paginationButton__fzJyQ",paginationLabel:"GptWebCitation-module_paginationLabel__S7t1W",confidenceBadge:"GptWebCitation-module_confidenceBadge__4BBTf",panelContent:"GptWebCitation-module_panelContent__vg-mG",panelContentExpanded:"GptWebCitation-module_panelContentExpanded__3aGjq",markdownBody:"GptWebCitation-module_markdownBody__5kdwH",highlight:"GptWebCitation-module_highlight__Xr1wl",highlightActive:"GptWebCitation-module_highlightActive__iFuz5",citationLink:"GptWebCitation-module_citationLink__kH9JC",citationLinkActive:"GptWebCitation-module_citationLinkActive__SShYx",panelFooter:"GptWebCitation-module_panelFooter__wm98C",webCitationButton:"GptWebCitation-module_webCitationButton__blI--",webCitationButtonIcon:"GptWebCitation-module_webCitationButtonIcon__r9lPc",learnedFrom:"GptWebCitation-module_learnedFrom__DMyLS",imageCitationWrapper:"GptWebCitation-module_imageCitationWrapper__iQUSw",imageCitationCenter:"GptWebCitation-module_imageCitationCenter__DMlqn",imageCitationViewport:"GptWebCitation-module_imageCitationViewport__xcotr",imageCitationScrollContainer:"GptWebCitation-module_imageCitationScrollContainer__bAQNk",citationImage:"GptWebCitation-module_citationImage__7rWdT",citationImagePreload:"GptWebCitation-module_citationImagePreload__L7ibJ",expandImageButton:"GptWebCitation-module_expandImageButton__598k6",fullScreenOverlay:"GptWebCitation-module_fullScreenOverlay__Z5U8h",fullScreenContent:"GptWebCitation-module_fullScreenContent__xIXZR",fullScreenCloseButton:"GptWebCitation-module_fullScreenCloseButton__lnaT1",fullScreenImageWrapper:"GptWebCitation-module_fullScreenImageWrapper__ADPGU",fullScreenImage:"GptWebCitation-module_fullScreenImage__jLVAQ",visitLinkRow:"GptWebCitation-module_visitLinkRow__H8ai5",visitLinkHint:"GptWebCitation-module_visitLinkHint__FAwob",visitLink:"GptWebCitation-module_visitLink__1BDo8",skeleton:"GptWebCitation-module_skeleton__1q51h",skeletonText:"GptWebCitation-module_skeletonText__E6XgN",skeletonShimmer:"GptWebCitation-module_skeletonShimmer__yqWJh",shimmer:"GptWebCitation-module_shimmer__-ZbQA"};
|
|
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(".GptWebCitation-module_overlay__OY5pa{display:flex;flex-direction:column;font-family:Plus Jakarta Sans,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;width:100%}.GptWebCitation-module_gptCitationWrapper__EN7nk{background-color:#fff;border:solid #e5e7eb;border-radius:8px;border-width:1px 1px 2px;box-shadow:0 1px 2px #0000000d;box-sizing:border-box;display:flex;flex-direction:column;overflow:hidden;position:relative;width:100%}.GptWebCitation-module_gptCitationToggleFooter__ncfLT{align-items:center;background-color:#f2f4f7;border-top:1px solid #e5e7eb;display:flex;flex-shrink:0;padding:1rem 1.5rem}.GptWebCitation-module_gptCitationFooterAction__WWpAY{align-items:center;bottom:0;box-sizing:border-box;display:flex;height:3rem;left:1.5rem;padding:0;pointer-events:none;position:absolute;z-index:2}.GptWebCitation-module_gptCitationFooterAction__WWpAY>*{pointer-events:auto}.GptWebCitation-module_gptCitationWrapperWithSource__1-ynq [class*=modalFooterSource]{justify-content:flex-end!important;padding-left:13rem}.GptWebCitation-module_panel__ek9Lq{background-color:#fff;border:1px solid #e5e7eb;border-radius:8px;box-shadow:0 1px 2px #0000000d;color:#1f2937;display:flex;flex-direction:column;font-family:Plus Jakarta Sans,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;width:100%}.GptWebCitation-module_panelHeader__afwge{align-items:center;background-color:#f9fafb;border-bottom:1px solid #e5e7eb;display:flex;font-size:13px;gap:8px;justify-content:space-between;padding:8px 16px}.GptWebCitation-module_panelSource__oFl-c{color:#374151;flex:1;font-weight:600;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.GptWebCitation-module_panelHeaderActions__sGrhi{align-items:center;display:flex;flex-shrink:0;gap:8px}.GptWebCitation-module_pagination__VQvbY{align-items:center;background-color:#fff;border:1px solid #d1d5db;border-radius:6px;display:flex;gap:2px;padding:2px 4px}.GptWebCitation-module_paginationButton__fzJyQ{align-items:center;background:#0000;border:none;border-radius:4px;color:#6b7280;cursor:pointer;display:flex;justify-content:center;padding:2px}.GptWebCitation-module_paginationButton__fzJyQ:hover:not(:disabled){background-color:#f3f4f6}.GptWebCitation-module_paginationButton__fzJyQ:disabled{cursor:not-allowed;opacity:.4}.GptWebCitation-module_paginationLabel__S7t1W{color:#6b7280;font-size:12px;min-width:36px;padding:0 4px;text-align:center}.GptWebCitation-module_confidenceBadge__4BBTf{align-items:center;background-color:#ecfdf5;border:1px solid #10b981;border-radius:9999px;color:#059669;display:inline-flex;font-size:13px;font-weight:500;gap:4px;padding:4px 10px}.GptWebCitation-module_panelContent__vg-mG{max-height:192px;overflow-y:auto;padding:8px 12px 12px}.GptWebCitation-module_panelContentExpanded__3aGjq{display:flex;flex-direction:column;max-height:none;min-height:384px;overflow:hidden}.GptWebCitation-module_panelContentFixedHeight__1RNIv{flex:1;max-height:none;min-height:0!important;overflow:hidden}.GptWebCitation-module_gptCitationWrapperFixedHeight__Mr7EX{overflow:hidden}.GptWebCitation-module_gptCitationToggleFooterFixedHeight__I-RHz{flex-shrink:0}.GptWebCitation-module_imageCitationCenterFixedHeight__lX3cM,.GptWebCitation-module_imageCitationWrapperFixedHeight__h8i31{flex:1;min-height:0;overflow:hidden}.GptWebCitation-module_imageCitationViewportFixedHeight__tgJ6n{height:100%;min-height:0}.GptWebCitation-module_imageCitationScrollContainerFixedHeight__VMwOt{align-items:center;display:flex;height:100%;justify-content:center;min-height:0}.GptWebCitation-module_citationImageContained__Bx-j5{height:100%;max-height:100%;max-width:100%;object-fit:contain;width:100%}.GptWebCitation-module_skeletonFrameFixedHeight__lPjN7{flex:1;height:100%;min-height:0!important}.GptWebCitation-module_skeletonContainerFixedHeight__XgOLH{flex:1;height:100%;min-height:0}.GptWebCitation-module_markdownBody__5kdwH{color:#374151;font-size:14px;line-height:1.6}.GptWebCitation-module_markdownBody__5kdwH ol{list-style-type:lower-alpha;margin:0;padding-left:1.25rem}.GptWebCitation-module_markdownBody__5kdwH li{margin-bottom:8px}.GptWebCitation-module_markdownBody__5kdwH code{background-color:#f3f4f6;border-radius:4px;color:#1f2937;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:13px;padding:1px 6px}.GptWebCitation-module_highlight__Xr1wl{background-color:#fef08a;border-radius:2px;color:#1f2937;padding:0 2px}.GptWebCitation-module_highlightActive__iFuz5{background-color:#fde047;border:1px solid #eab308;box-shadow:0 1px 2px #0000001a}.GptWebCitation-module_citationLink__kH9JC{color:#2563eb;font-weight:500;text-decoration:none}.GptWebCitation-module_citationLink__kH9JC:hover{text-decoration:underline}.GptWebCitation-module_citationLinkActive__SShYx{background-color:#fef08a;border:1px solid #eab308;border-radius:2px;color:#1f2937;padding:0 2px}.GptWebCitation-module_panelFooter__wm98C{align-items:center;background-color:#f9fafb;border-top:1px solid #e5e7eb;display:flex;font-size:13px;justify-content:space-between;padding:8px 16px}.GptWebCitation-module_webCitationButton__blI--{align-items:center;background-color:#f9fafb;border:1px solid #e5e7eb;border-radius:8px;color:#2563eb;cursor:pointer;display:inline-flex;font-size:14px;font-weight:700;gap:8px;justify-content:center;line-height:1.25;min-width:180px;padding:6px 16px;transition:background-color .15s ease;white-space:nowrap}.GptWebCitation-module_webCitationButton__blI--:hover:not(:disabled){background-color:#f3f4f6}.GptWebCitation-module_webCitationButton__blI--:disabled{cursor:not-allowed;opacity:.75}.GptWebCitation-module_webCitationButtonIcon__r9lPc{color:#2563eb;flex-shrink:0}.GptWebCitation-module_learnedFrom__DMyLS{color:#6b7280;font-size:13px}.GptWebCitation-module_imageCitationWrapper__iQUSw{box-sizing:border-box;display:flex;flex:1;flex-direction:column;gap:12px;min-height:0;padding:8px 4px;width:100%}.GptWebCitation-module_imageCitationCenter__DMlqn{align-items:stretch;display:flex;flex:1;justify-content:center;min-height:0;position:relative;width:100%}.GptWebCitation-module_imageCitationViewport__xcotr{height:100%;max-width:100%;min-height:0;position:relative;width:100%}.GptWebCitation-module_imageCitationScrollContainer__bAQNk{background-color:#f9fafb;border:1px solid #e5e7eb;border-radius:12px;height:100%;max-height:100%;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;scrollbar-color:#cbd5e1 #0000;scrollbar-width:thin;width:100%}.GptWebCitation-module_imageCitationScrollContainer__bAQNk::-webkit-scrollbar{width:8px}.GptWebCitation-module_imageCitationScrollContainer__bAQNk::-webkit-scrollbar-thumb{background-color:#cbd5e1;border-radius:9999px}.GptWebCitation-module_imageCitationScrollContainer__bAQNk::-webkit-scrollbar-track{background-color:initial}.GptWebCitation-module_citationImage__7rWdT{background-color:#f9fafb;border:none;border-radius:0;display:block;height:auto;max-width:100%;object-fit:unset;width:100%}.GptWebCitation-module_citationImagePreload__L7ibJ{height:0;opacity:0;pointer-events:none;position:absolute;visibility:hidden;width:0}.GptWebCitation-module_expandImageButton__598k6{align-items:center;background-color:#374151eb;border:none;border-radius:6px;bottom:12px;box-shadow:0 2px 6px #0003;color:#fff;cursor:pointer;display:inline-flex;height:32px;justify-content:center;padding:0;position:absolute;right:12px;transition:background-color .15s ease;width:32px;z-index:2}.GptWebCitation-module_expandImageButton__598k6:hover{background-color:#1f2937}.GptWebCitation-module_expandImageButton__598k6 svg{flex-shrink:0}.GptWebCitation-module_fullScreenOverlay__Z5U8h{align-items:center;backdrop-filter:blur(4px);background-color:#0009;display:flex;inset:0;justify-content:center;overflow:hidden;overscroll-behavior:contain;padding:16px;position:fixed;z-index:1100}.GptWebCitation-module_fullScreenContent__xIXZR{background-color:#fff;border:1px solid #e5e7eb;border-radius:16px;box-shadow:0 25px 50px -12px #00000040;max-height:90vh;max-width:95vw;overflow:hidden;position:relative}.GptWebCitation-module_fullScreenCloseButton__lnaT1{align-items:center;background-color:#374151eb;border:none;border-radius:6px;box-shadow:0 2px 6px #0003;color:#fff;cursor:pointer;display:inline-flex;height:32px;justify-content:center;padding:0;position:absolute;right:16px;top:16px;transition:background-color .15s ease;width:32px;z-index:1}.GptWebCitation-module_fullScreenCloseButton__lnaT1:hover{background-color:#1f2937}.GptWebCitation-module_fullScreenImageWrapper__ADPGU{align-items:flex-start;display:flex;justify-content:center;max-height:80vh;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;padding:8px;scrollbar-color:#cbd5e1 #0000;scrollbar-width:thin;width:100%}.GptWebCitation-module_fullScreenImage__jLVAQ{border-radius:12px;height:auto;max-width:100%;object-fit:unset;width:100%}.GptWebCitation-module_visitLinkRow__H8ai5{align-items:center;display:flex;flex-shrink:0;gap:12px;justify-content:flex-start;padding:4px 8px 0;width:100%}.GptWebCitation-module_visitLinkHint__FAwob{color:#6b7280;font-size:10px;line-height:1.4}.GptWebCitation-module_visitLink__1BDo8{align-items:center;background-color:#2563eb1f;border-radius:6px;color:#2563eb;display:inline-flex;flex-shrink:0;font-size:13px;font-weight:600;gap:6px;padding:6px 12px;text-decoration:none;transition:all .15s ease;white-space:nowrap}.GptWebCitation-module_visitLink__1BDo8:hover{background-color:#2563eb2e;text-decoration:none}.GptWebCitation-module_skeleton__1q51h{align-items:center;background-color:#f3f4f6;border-radius:12px;display:flex;justify-content:center;min-height:384px;overflow:hidden;position:relative;width:100%}.GptWebCitation-module_skeletonShimmer__yqWJh{animation:GptWebCitation-module_shimmer__-ZbQA 1.5s linear infinite;background:linear-gradient(90deg,#0000,#fff9,#0000);inset:0;position:absolute}.GptWebCitation-module_skeletonPendingContainer__-ZSgz{display:flex;flex:1;flex-direction:column;width:100%}.GptWebCitation-module_skeletonPendingContent__ttLpr{align-items:center;display:flex;flex-direction:column;gap:12px;justify-content:center;max-width:420px;padding:24px;position:relative;text-align:center;z-index:1}.GptWebCitation-module_skeletonPendingText__AnHRb{color:#6b7280;font-size:13px;line-height:1.5}.GptWebCitation-module_skeletonPendingActionRow__C-rPf{align-items:center;display:flex;flex-wrap:wrap;gap:8px;justify-content:center}.GptWebCitation-module_skeletonPendingActionHint__PB8CQ{color:#6b7280;font-size:13px;line-height:1.4}.GptWebCitation-module_skeletonErrorContent__Y4PXh{align-items:center;box-sizing:border-box;display:flex;flex-direction:column;gap:8px;justify-content:center;max-width:100%;padding:24px;position:relative;text-align:center;width:100%;z-index:1}.GptWebCitation-module_skeletonErrorTitle__PeL4e{color:#6b7280;font-size:14px;font-weight:600;margin:0}.GptWebCitation-module_skeletonErrorMessageLine__a5B0M{align-items:center;color:#6b7280;display:inline-flex;flex-wrap:nowrap;font-size:13px;gap:6px;justify-content:center;line-height:1.5;margin:0;max-width:100%;white-space:nowrap}.GptWebCitation-module_skeletonErrorInlineVisitLink__HgWl4{align-items:center;color:#2563eb;display:inline-flex;flex-shrink:0;font-weight:500;gap:6px;text-decoration:underline;white-space:nowrap}.GptWebCitation-module_skeletonErrorInlineVisitLink__HgWl4:hover{color:#1d4ed8}.GptWebCitation-module_skeletonErrorMessageSuffix__in2K-{flex-shrink:0;white-space:nowrap}.GptWebCitation-module_skeletonErrorDetails__6e2LW{align-items:center;display:flex;flex-direction:column;gap:6px;width:100%}.GptWebCitation-module_skeletonErrorActionGroup__w5g4K{align-items:center;display:flex;flex-direction:column;gap:8px;width:100%}.GptWebCitation-module_skeletonErrorDetailsToggle__osJ2y{align-items:center;background:#0000;border:none;border-radius:4px;color:#9ca3af;cursor:pointer;display:inline-flex;font-size:11px;gap:4px;line-height:1.4;padding:2px 6px;transition:color .15s ease,background-color .15s ease}.GptWebCitation-module_skeletonErrorDetailsToggle__osJ2y:hover{background-color:#6b728014;color:#6b7280}.GptWebCitation-module_skeletonErrorChevron__WprUR{flex-shrink:0}.GptWebCitation-module_skeletonErrorDetailsLabel__fXQ2H{font-weight:500}.GptWebCitation-module_skeletonErrorDetailsMessage__GrE-j{background-color:#6b72801a;border-radius:6px;color:#6b7280;font-size:11px;line-height:1.45;margin:0;max-width:100%;padding:8px 10px;text-align:left;word-break:break-word}.GptWebCitation-module_skeletonVisitLinkGlow__ABLi8{animation:GptWebCitation-module_glowPulse__6-t4P 1.8s ease-in-out infinite;background-color:#2563eb14;border:1.5px solid #2563eb8c}@keyframes GptWebCitation-module_shimmer__-ZbQA{0%{transform:translateX(-100%)}to{transform:translateX(100%)}}@keyframes GptWebCitation-module_glowPulse__6-t4P{0%,to{border-color:#2563eb66;box-shadow:0 0 0 0 #2563eb4d}50%{border-color:#2563ebcc;box-shadow:0 0 12px 3px #2563eb66}}"));const i=document.head||document.getElementsByTagName("head")[0]||document.documentElement;i&&i.appendChild(e)}(),exports.default={overlay:"GptWebCitation-module_overlay__OY5pa",gptCitationWrapper:"GptWebCitation-module_gptCitationWrapper__EN7nk",gptCitationToggleFooter:"GptWebCitation-module_gptCitationToggleFooter__ncfLT",gptCitationFooterAction:"GptWebCitation-module_gptCitationFooterAction__WWpAY",gptCitationWrapperWithSource:"GptWebCitation-module_gptCitationWrapperWithSource__1-ynq",panel:"GptWebCitation-module_panel__ek9Lq",panelHeader:"GptWebCitation-module_panelHeader__afwge",panelSource:"GptWebCitation-module_panelSource__oFl-c",panelHeaderActions:"GptWebCitation-module_panelHeaderActions__sGrhi",pagination:"GptWebCitation-module_pagination__VQvbY",paginationButton:"GptWebCitation-module_paginationButton__fzJyQ",paginationLabel:"GptWebCitation-module_paginationLabel__S7t1W",confidenceBadge:"GptWebCitation-module_confidenceBadge__4BBTf",panelContent:"GptWebCitation-module_panelContent__vg-mG",panelContentExpanded:"GptWebCitation-module_panelContentExpanded__3aGjq",panelContentFixedHeight:"GptWebCitation-module_panelContentFixedHeight__1RNIv",gptCitationWrapperFixedHeight:"GptWebCitation-module_gptCitationWrapperFixedHeight__Mr7EX",gptCitationToggleFooterFixedHeight:"GptWebCitation-module_gptCitationToggleFooterFixedHeight__I-RHz",imageCitationWrapperFixedHeight:"GptWebCitation-module_imageCitationWrapperFixedHeight__h8i31",imageCitationCenterFixedHeight:"GptWebCitation-module_imageCitationCenterFixedHeight__lX3cM",imageCitationViewportFixedHeight:"GptWebCitation-module_imageCitationViewportFixedHeight__tgJ6n",imageCitationScrollContainerFixedHeight:"GptWebCitation-module_imageCitationScrollContainerFixedHeight__VMwOt",citationImageContained:"GptWebCitation-module_citationImageContained__Bx-j5",skeletonFrameFixedHeight:"GptWebCitation-module_skeletonFrameFixedHeight__lPjN7",skeletonContainerFixedHeight:"GptWebCitation-module_skeletonContainerFixedHeight__XgOLH",markdownBody:"GptWebCitation-module_markdownBody__5kdwH",highlight:"GptWebCitation-module_highlight__Xr1wl",highlightActive:"GptWebCitation-module_highlightActive__iFuz5",citationLink:"GptWebCitation-module_citationLink__kH9JC",citationLinkActive:"GptWebCitation-module_citationLinkActive__SShYx",panelFooter:"GptWebCitation-module_panelFooter__wm98C",webCitationButton:"GptWebCitation-module_webCitationButton__blI--",webCitationButtonIcon:"GptWebCitation-module_webCitationButtonIcon__r9lPc",learnedFrom:"GptWebCitation-module_learnedFrom__DMyLS",imageCitationWrapper:"GptWebCitation-module_imageCitationWrapper__iQUSw",imageCitationCenter:"GptWebCitation-module_imageCitationCenter__DMlqn",imageCitationViewport:"GptWebCitation-module_imageCitationViewport__xcotr",imageCitationScrollContainer:"GptWebCitation-module_imageCitationScrollContainer__bAQNk",citationImage:"GptWebCitation-module_citationImage__7rWdT",citationImagePreload:"GptWebCitation-module_citationImagePreload__L7ibJ",expandImageButton:"GptWebCitation-module_expandImageButton__598k6",fullScreenOverlay:"GptWebCitation-module_fullScreenOverlay__Z5U8h",fullScreenContent:"GptWebCitation-module_fullScreenContent__xIXZR",fullScreenCloseButton:"GptWebCitation-module_fullScreenCloseButton__lnaT1",fullScreenImageWrapper:"GptWebCitation-module_fullScreenImageWrapper__ADPGU",fullScreenImage:"GptWebCitation-module_fullScreenImage__jLVAQ",visitLinkRow:"GptWebCitation-module_visitLinkRow__H8ai5",visitLinkHint:"GptWebCitation-module_visitLinkHint__FAwob",visitLink:"GptWebCitation-module_visitLink__1BDo8",skeleton:"GptWebCitation-module_skeleton__1q51h",skeletonShimmer:"GptWebCitation-module_skeletonShimmer__yqWJh",shimmer:"GptWebCitation-module_shimmer__-ZbQA",skeletonPendingContainer:"GptWebCitation-module_skeletonPendingContainer__-ZSgz",skeletonPendingContent:"GptWebCitation-module_skeletonPendingContent__ttLpr",skeletonPendingText:"GptWebCitation-module_skeletonPendingText__AnHRb",skeletonPendingActionRow:"GptWebCitation-module_skeletonPendingActionRow__C-rPf",skeletonPendingActionHint:"GptWebCitation-module_skeletonPendingActionHint__PB8CQ",skeletonErrorContent:"GptWebCitation-module_skeletonErrorContent__Y4PXh",skeletonErrorTitle:"GptWebCitation-module_skeletonErrorTitle__PeL4e",skeletonErrorMessageLine:"GptWebCitation-module_skeletonErrorMessageLine__a5B0M",skeletonErrorInlineVisitLink:"GptWebCitation-module_skeletonErrorInlineVisitLink__HgWl4",skeletonErrorMessageSuffix:"GptWebCitation-module_skeletonErrorMessageSuffix__in2K-",skeletonErrorDetails:"GptWebCitation-module_skeletonErrorDetails__6e2LW",skeletonErrorActionGroup:"GptWebCitation-module_skeletonErrorActionGroup__w5g4K",skeletonErrorDetailsToggle:"GptWebCitation-module_skeletonErrorDetailsToggle__osJ2y",skeletonErrorChevron:"GptWebCitation-module_skeletonErrorChevron__WprUR",skeletonErrorDetailsLabel:"GptWebCitation-module_skeletonErrorDetailsLabel__fXQ2H",skeletonErrorDetailsMessage:"GptWebCitation-module_skeletonErrorDetailsMessage__GrE-j",skeletonVisitLinkGlow:"GptWebCitation-module_skeletonVisitLinkGlow__ABLi8",glowPulse:"GptWebCitation-module_glowPulse__6-t4P"};
|
|
2
2
|
//# sourceMappingURL=GptWebCitation.module.css.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),t=require("react"),n=require("lucide-react"),l=require("./GptWebCitationImageFullScreenView.js"),a=require("./GptWebCitationSkeleton.js"),s=require("./utils/citationData.utils.js"),o=require("./GptWebCitation.module.css.js");exports.default=function(r){var d,u,c=r.citationImage,g=r.citationUrl,f=r.skeletonVisitUrl,v=r.showExpandImageButton,x=void 0===v||v,m=r.iconsConfig,p=r.styles,j=r.visitLinkStyles,k=r.skeletonStyles,C=r.skeletonVisitLinkStyles,h=r.isFixedHeight,_=void 0!==h&&h,y=null!==(d=null==m?void 0:m.MaximizeIcon)&&void 0!==d?d:n.Maximize2,b=null!==(u=null==m?void 0:m.ExternalLinkIcon)&&void 0!==u?u:n.ExternalLink,w=t.useState(!1),I=w[0],L=w[1],S=t.useState("loading"),N=S[0],q=S[1];t.useEffect(function(){var e=!0;q("loading"),L(!1);var i=new Image;return i.onload=function(){e&&q("loaded")},i.onerror=function(){e&&q("error")},i.src=c,function(){e=!1,i.onload=null,i.onerror=null}},[c]);var B="loaded"===N,E=s.sanitizeExternalUrl(g);return i.jsxs("div",e.__assign({className:[o.default.imageCitationWrapper,_?o.default.imageCitationWrapperFixedHeight:""].filter(Boolean).join(" "),style:null==p?void 0:p.wrapper},{children:[i.jsx("div",e.__assign({className:[o.default.imageCitationCenter,_?o.default.imageCitationCenterFixedHeight:""].filter(Boolean).join(" "),style:null==p?void 0:p.center},{children:B?i.jsxs("div",e.__assign({className:[o.default.imageCitationViewport,_?o.default.imageCitationViewportFixedHeight:""].filter(Boolean).join(" "),style:null==p?void 0:p.viewport},{children:[i.jsx("div",e.__assign({className:[o.default.imageCitationScrollContainer,_?o.default.imageCitationScrollContainerFixedHeight:""].filter(Boolean).join(" "),style:null==p?void 0:p.scrollContainer},{children:i.jsx("img",{src:c,alt:"Web citation snapshot",className:[o.default.citationImage,_?o.default.citationImageContained:""].filter(Boolean).join(" "),style:null==p?void 0:p.image})})),x&&i.jsx("button",e.__assign({type:"button",onClick:function(e){e.stopPropagation(),L(!0)},className:o.default.expandImageButton,style:null==p?void 0:p.expandButton,"aria-label":"View citation image in full screen",title:"Expand image"},{children:i.jsx(y,{size:16,strokeWidth:2})}))]})):i.jsx(a.default,{status:"error"===N?"error":"pending",citationUrl:null!=f?f:g,ExternalLinkIcon:null==m?void 0:m.ExternalLinkIcon,styles:k,visitLinkStyles:C,isFixedHeight:_})})),E&&B&&i.jsxs("div",e.__assign({className:o.default.visitLinkRow,style:null==j?void 0:j.row},{children:[i.jsx("span",e.__assign({className:o.default.visitLinkHint,style:null==j?void 0:j.hint},{children:"Open link in new tab to read in detail"})),i.jsxs("a",e.__assign({href:E,target:"_blank",rel:"noreferrer",className:o.default.visitLink,style:null==j?void 0:j.link},{children:["Visit Link",i.jsx(b,{size:16})]}))]})),I&&B&&i.jsx(l.default,{src:c,onClose:function(){return L(!1)},styles:null==p?void 0:p.fullScreen})]}))};
|
|
2
2
|
//# sourceMappingURL=GptWebCitationImageCitation.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),l=require("react/jsx-runtime"),t=require("react"),r=require("react-dom"),s=require("lucide-react"),n=require("./utils/styleOverrides.utils.js"),o=require("./GptWebCitation.module.css.js"),i=function(e){return e.stopPropagation()},a=function(e){e.stopPropagation()};exports.default=function(u){var c=u.src,d=u.onClose,v=u.styles;return t.useEffect(function(){var e=document.body.style.overflow;return document.body.style.overflow="hidden",function(){document.body.style.overflow=e}},[]),r.createPortal(l.jsx("div",e.__assign({role:"dialog","aria-modal":"true",className:o.default.fullScreenOverlay,style:n.resolveInlineStyle(null==v?void 0:v.overlay),onClick:d,onWheel:a},{children:l.jsxs("div",e.__assign({className:o.default.fullScreenContent,style:n.resolveInlineStyle(null==v?void 0:v.content),onClick:i},{children:[l.jsx("button",e.__assign({type:"button",onClick:d,className:o.default.fullScreenCloseButton,style:n.resolveInlineStyle(null==v?void 0:v.closeButton),"aria-label":"Close full screen view"},{children:l.jsx(s.X,{size:18,strokeWidth:2})})),l.jsx("div",e.__assign({className:o.default.fullScreenImageWrapper,style:n.resolveInlineStyle(null==v?void 0:v.imageWrapper)},{children:l.jsx("img",{src:c,alt:"Citation full view",className:o.default.fullScreenImage,style:n.resolveInlineStyle(null==v?void 0:v.image)})}))]}))})),document.body)};
|
|
2
2
|
//# sourceMappingURL=GptWebCitationImageFullScreenView.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),s=require("lucide-react"),l=require("./utils/citationData.utils.js"),n=require("./GptWebCitation.module.css.js");exports.default=function(t){var a,r,o,d,u,c,v,g,x,_=t.status,f=t.ExternalLinkIcon,m=t.citationUrl,h=t.styles,j=t.visitLinkStyles,k=t.isFixedHeight,p=void 0!==k&&k,y=null!=f?f:s.ExternalLink,N=l.sanitizeExternalUrl(m),w=[n.default.skeletonPendingContainer,p?n.default.skeletonContainerFixedHeight:""].filter(Boolean).join(" "),L=[n.default.skeleton,p?n.default.skeletonFrameFixedHeight:""].filter(Boolean).join(" ");return"error"===_?i.jsx("div",e.__assign({className:w,style:null==h?void 0:h.container},{children:i.jsx("div",e.__assign({className:L,style:null==h?void 0:h.frame},{children:i.jsxs("div",e.__assign({className:n.default.skeletonErrorContent,style:null===(a=null==h?void 0:h.error)||void 0===a?void 0:a.content},{children:[i.jsx("span",e.__assign({className:n.default.skeletonErrorTitle,style:null===(r=null==h?void 0:h.error)||void 0===r?void 0:r.title},{children:"No preview available"})),i.jsxs("p",e.__assign({className:n.default.skeletonErrorMessageLine,style:null===(o=null==h?void 0:h.error)||void 0===o?void 0:o.message},{children:[i.jsx("span",{children:"This website restricts external previews"}),N&&i.jsxs(i.Fragment,{children:[i.jsxs("a",e.__assign({href:N,target:"_blank",rel:"noopener noreferrer",className:n.default.skeletonErrorInlineVisitLink,style:null==j?void 0:j.link},{children:["Visit Link",i.jsx(y,{size:12})]})),i.jsx("span",e.__assign({className:n.default.skeletonErrorMessageSuffix},{children:"to view details"}))]})]}))]}))}))})):i.jsx("div",e.__assign({className:w,style:null==h?void 0:h.container},{children:i.jsxs("div",e.__assign({className:L,style:null==h?void 0:h.frame},{children:[i.jsx("div",{className:n.default.skeletonShimmer,style:null==h?void 0:h.shimmer}),i.jsxs("div",e.__assign({className:n.default.skeletonPendingContent,style:null===(d=null==h?void 0:h.pending)||void 0===d?void 0:d.content},{children:[i.jsx("span",e.__assign({className:n.default.skeletonPendingText,style:null===(u=null==h?void 0:h.pending)||void 0===u?void 0:u.text},{children:"Loading a snapshot of citation from source website...."})),N&&i.jsxs("div",e.__assign({className:n.default.skeletonPendingActionRow,style:null!==(c=null==j?void 0:j.row)&&void 0!==c?c:null===(v=null==h?void 0:h.pending)||void 0===v?void 0:v.actionRow},{children:[i.jsxs("a",e.__assign({href:N,target:"_blank",rel:"noopener noreferrer",className:n.default.visitLink,style:null==j?void 0:j.link},{children:[i.jsx(y,{size:14}),"Visit Link"]})),i.jsx("span",e.__assign({className:n.default.skeletonPendingActionHint,style:null!==(g=null==j?void 0:j.hint)&&void 0!==g?g:null===(x=null==h?void 0:h.pending)||void 0===x?void 0:x.actionHint},{children:"to view details"}))]}))]}))]}))}))};
|
|
2
2
|
//# sourceMappingURL=GptWebCitationSkeleton.js.map
|