@epam/ai-dial-quotations 1.3.0-dev.252 → 1.3.0-dev.256

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.
@@ -1,4 +1,4 @@
1
- import { FC, ReactNode } from 'react';
1
+ import { FC, HTMLAttributes, ReactNode } from 'react';
2
2
  /** User-visible strings for `CitationMarker`. */
3
3
  export interface CitationMarkerLabels {
4
4
  /** Accessible label for the marker button. */
@@ -8,8 +8,8 @@ export interface CitationMarkerLabels {
8
8
  /** Button text when `annotationCount > 1`. */
9
9
  labelWithOverflow: string;
10
10
  }
11
- /** Props for the `CitationMarker` component. */
12
- export interface CitationMarkerProps {
11
+ /** Props for the `CitationMarker` component; the popup ARIA attributes are forwarded to the button. */
12
+ export interface CitationMarkerProps extends Pick<HTMLAttributes<HTMLButtonElement>, 'aria-haspopup' | 'aria-expanded' | 'aria-controls'> {
13
13
  /** Human-readable source name derived from the attachment URL. */
14
14
  sourceName: string;
15
15
  /** Total number of annotations in this citation group. */
@@ -1 +1 @@
1
- {"version":3,"file":"CitationMarker.d.ts","sourceRoot":"","sources":["../../../src/components/CitationMarker/CitationMarker.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGtC,iDAAiD;AACjD,MAAM,WAAW,oBAAoB;IACnC,8CAA8C;IAC9C,SAAS,EAAE,MAAM,CAAC;IAClB,gDAAgD;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,8CAA8C;IAC9C,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED,gDAAgD;AAChD,MAAM,WAAW,mBAAmB;IAClC,kEAAkE;IAClE,UAAU,EAAE,MAAM,CAAC;IACnB,0DAA0D;IAC1D,eAAe,EAAE,MAAM,CAAC;IACxB,yEAAyE;IACzE,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,mEAAmE;IACnE,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,4BAA4B;IAC5B,MAAM,EAAE,oBAAoB,CAAC;IAC7B,8FAA8F;IAC9F,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,sEAAsE;AACtE,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CA6BlD,CAAC"}
1
+ {"version":3,"file":"CitationMarker.d.ts","sourceRoot":"","sources":["../../../src/components/CitationMarker/CitationMarker.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,EAAE,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGtD,iDAAiD;AACjD,MAAM,WAAW,oBAAoB;IACnC,8CAA8C;IAC9C,SAAS,EAAE,MAAM,CAAC;IAClB,gDAAgD;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,8CAA8C;IAC9C,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED,uGAAuG;AACvG,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAC/C,cAAc,CAAC,iBAAiB,CAAC,EACjC,eAAe,GAAG,eAAe,GAAG,eAAe,CACpD;IACC,kEAAkE;IAClE,UAAU,EAAE,MAAM,CAAC;IACnB,0DAA0D;IAC1D,eAAe,EAAE,MAAM,CAAC;IACxB,yEAAyE;IACzE,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,mEAAmE;IACnE,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,4BAA4B;IAC5B,MAAM,EAAE,oBAAoB,CAAC;IAC7B,8FAA8F;IAC9F,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,sEAAsE;AACtE,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAiClD,CAAC"}
@@ -17,6 +17,10 @@ export interface UseCitationMarkdownComponentsCallbacks {
17
17
  isPreviewOpen?: boolean;
18
18
  /** Whether a marker click previews a single-citation file source directly instead of showing the card; web-link (HTML/XHTML) sources and multi-citation groups keep the card. Defaults to `false`. */
19
19
  previewFilesOnMarkerClick?: boolean;
20
+ /** Typography class of a cited paragraph. Defaults to `'dial-body-paragraph-text'`. */
21
+ paragraphClassName?: string;
22
+ /** Typography class of a cited paragraph while `isCompactTypography` is set. Defaults to `'dial-small-paragraph-text'`. */
23
+ compactParagraphClassName?: string;
20
24
  /** Builds the translated label bundles used by a given citation group's card and marker. */
21
25
  buildLabels(group: AnnotationGroup): {
22
26
  cardLabels: CitationCardLabels;
@@ -1 +1 @@
1
- {"version":3,"file":"useCitationMarkdownComponents.d.ts","sourceRoot":"","sources":["../../../src/hooks/useCitationMarkdownComponents/useCitationMarkdownComponents.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAE1E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAC;AACrF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gDAAgD,CAAC;AAQ3F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAM/E,6FAA6F;AAC7F,MAAM,WAAW,sCAAsC;IACrD,4GAA4G;IAC5G,SAAS,CAAC,UAAU,EAAE,UAAU,EAAE,KAAK,EAAE,eAAe,GAAG,IAAI,CAAC;IAChE,gFAAgF;IAChF,aAAa,CAAC,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC;IAChD,yEAAyE;IACzE,eAAe,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI,CAAC;IAC9C,oGAAoG;IACpG,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,wIAAwI;IACxI,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,sMAAsM;IACtM,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,4FAA4F;IAC5F,WAAW,CAAC,KAAK,EAAE,eAAe,GAAG;QACnC,UAAU,EAAE,kBAAkB,CAAC;QAC/B,YAAY,EAAE,oBAAoB,CAAC;KACpC,CAAC;CACH;AAeD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,eAAO,MAAM,6BAA6B,GACxC,SAAS,MAAM,EACf,QAAQ,eAAe,EAAE,EACzB,WAAW,sCAAsC,EACjD,qBAAmB,EACnB,6BAA2B,EAC3B,iBAAgB,eAAe,EAA0B,KACxD;IAAE,gBAAgB,EAAE,MAAM,CAAC;IAAC,kBAAkB,EAAE,UAAU,CAAA;CAkG5D,CAAC"}
1
+ {"version":3,"file":"useCitationMarkdownComponents.d.ts","sourceRoot":"","sources":["../../../src/hooks/useCitationMarkdownComponents/useCitationMarkdownComponents.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAE1E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAC;AACrF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gDAAgD,CAAC;AAQ3F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAM/E,6FAA6F;AAC7F,MAAM,WAAW,sCAAsC;IACrD,4GAA4G;IAC5G,SAAS,CAAC,UAAU,EAAE,UAAU,EAAE,KAAK,EAAE,eAAe,GAAG,IAAI,CAAC;IAChE,gFAAgF;IAChF,aAAa,CAAC,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC;IAChD,yEAAyE;IACzE,eAAe,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI,CAAC;IAC9C,oGAAoG;IACpG,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,wIAAwI;IACxI,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,sMAAsM;IACtM,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,uFAAuF;IACvF,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,2HAA2H;IAC3H,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,4FAA4F;IAC5F,WAAW,CAAC,KAAK,EAAE,eAAe,GAAG;QACnC,UAAU,EAAE,kBAAkB,CAAC;QAC/B,YAAY,EAAE,oBAAoB,CAAC;KACpC,CAAC;CACH;AAeD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,eAAO,MAAM,6BAA6B,GACxC,SAAS,MAAM,EACf,QAAQ,eAAe,EAAE,EACzB,WAAW,sCAAsC,EACjD,qBAAmB,EACnB,6BAA2B,EAC3B,iBAAgB,eAAe,EAA0B,KACxD;IAAE,gBAAgB,EAAE,MAAM,CAAC;IAAC,kBAAkB,EAAE,UAAU,CAAA;CAsG5D,CAAC"}
package/index.css CHANGED
@@ -1,3 +1,3 @@
1
1
  ._card_1kph1_1{background:var(--cc-card-bg,var(--bg-layer-raised,#fcfcfc))}._quote_1kph1_5{color:var(--cc-quote-text,var(--text-secondary,#57647a))}._title_1kph1_9{color:var(--cc-title-text,var(--text-primary,#161b2d))}._switcher_1kph1_13{color:var(--cc-switcher-text,var(--text-secondary,#57647a))}._sourceName_1kph1_17{color:var(--cc-source-name-text,var(--text-primary,#161b2d))}._trigger_119c8_7{max-width:calc(100% - .25rem)}._trigger_119c8_7>*{min-width:0;max-width:100%}td ._trigger_119c8_7,th ._trigger_119c8_7{width:100%;max-width:100%;margin-inline-start:0}td ._trigger_119c8_7>*,th ._trigger_119c8_7>*{max-width:100%}
2
2
  /*$vite$:1*//*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
3
- @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1}}}.collapse{visibility:collapse}.visible{visibility:visible}.fixed{position:fixed}.ms-1{margin-inline-start:.25rem}.mb-1\.5{margin-bottom:.375rem}.mb-3{margin-bottom:.75rem}.line-clamp-6{-webkit-line-clamp:6;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.hidden{display:none}.inline{display:inline}.inline-flex{display:inline-flex}.table{display:table}.table-cell{display:table-cell}.table-row{display:table-row}.max-h-\[min\(20rem\,50vh\)\]{max-height:min(20rem,50vh)}.w-\[400px\]{width:400px}.w-full{width:100%}.max-w-\[240px\]{max-width:240px}.max-w-full{max-width:100%}.min-w-0{min-width:0}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.resize{resize:both}.flex-col{flex-direction:column}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-start{justify-content:flex-start}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-y-auto{overflow-y:auto}.\!rounded-none{border-radius:0!important}.rounded-lg{border-radius:.5rem}.\!bg-transparent{background-color:#0000!important}.\!p-0{padding:0!important}.p-4{padding:1rem}.ps-\[1\.5em\]{padding-inline-start:1.5em}.align-middle{vertical-align:middle}.\[text-wrap\:pretty\]{text-wrap:pretty}.\[overflow-wrap\:anywhere\]{overflow-wrap:anywhere}.break-words{overflow-wrap:break-word}.ordinal{--tw-ordinal:ordinal;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.\!shadow-none{--tw-shadow:0 0 #0000!important;box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)!important}.shadow-lg{--tw-shadow:1px 10px 25px 12px var(--tw-shadow-color,var(--shadow-lg,#2764d914));box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.last\:mb-0:last-child{margin-bottom:0}.rtl\:scale-x-\[-1\]:where(:dir(rtl),[dir=rtl],[dir=rtl] *){--tw-scale-x:-1;scale:var(--tw-scale-x) var(--tw-scale-y)}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}
3
+ @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1}}}.collapse{visibility:collapse}.visible{visibility:visible}.fixed{position:fixed}.ms-1{margin-inline-start:.25rem}.mb-1\.5{margin-bottom:.375rem}.mb-3{margin-bottom:.75rem}.line-clamp-6{-webkit-line-clamp:6;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.hidden{display:none}.inline{display:inline}.inline-flex{display:inline-flex}.table{display:table}.table-cell{display:table-cell}.table-row{display:table-row}.max-h-\[min\(20rem\,50vh\)\]{max-height:min(20rem,50vh)}.w-\[400px\]{width:400px}.w-full{width:100%}.max-w-\[240px\]{max-width:240px}.max-w-full{max-width:100%}.min-w-0{min-width:0}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.resize{resize:both}.flex-col{flex-direction:column}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-start{justify-content:flex-start}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded-lg{border-radius:.5rem}.rounded-none\!{border-radius:0!important}.bg-transparent\!{background-color:#0000!important}.p-0\!{padding:0!important}.p-4{padding:1rem}.ps-\[1\.5em\]{padding-inline-start:1.5em}.align-middle{vertical-align:middle}.text-pretty{text-wrap:pretty}.wrap-anywhere{overflow-wrap:anywhere}.wrap-break-word{overflow-wrap:break-word}.ordinal{--tw-ordinal:ordinal;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.shadow-lg{--tw-shadow:1px 10px 25px 12px var(--tw-shadow-color,var(--shadow-lg,#2764d914));box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-none\!{--tw-shadow:0 0 #0000!important;box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)!important}.last\:mb-0:last-child{margin-bottom:0}.rtl\:scale-x-\[-1\]:where(:dir(rtl),[dir=rtl],[dir=rtl] *){--tw-scale-x:-1;scale:var(--tw-scale-x) var(--tw-scale-y)}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}
package/index.js CHANGED
@@ -1,58 +1,58 @@
1
1
  import { MIMEType as e, MarkdownRenderer as t, buildCssVars as n, isAnnotationSelector as r, mergeClasses as i, normalizePersistedHtmlTagAttachmentType as a, normalizeRawAnnotations as o } from "@epam/ai-dial-chat-shared";
2
2
  import { DIAL_KIT_ICON_STROKE as s, DialItemType as c, Dropdown as l, ElementSize as u, EllipsisTooltip as d, FileIcon as f, GhostIconButton as p, LinkButton as m, NeutralButton as h, PrimaryButton as g } from "@epam/ai-dial-ui-kit";
3
3
  import { IconChevronLeft as _, IconChevronRight as v } from "@tabler/icons-react";
4
- import { createContext as y, useCallback as b, useContext as x, useEffect as ee, useId as S, useLayoutEffect as C, useMemo as w, useRef as T, useState as E } from "react";
5
- import { Fragment as D, jsx as O, jsxs as k } from "react/jsx-runtime";
4
+ import { createContext as y, useCallback as b, useContext as x, useEffect as S, useId as ee, useLayoutEffect as C, useMemo as w, useRef as te, useState as T } from "react";
5
+ import { Fragment as E, jsx as D, jsxs as O } from "react/jsx-runtime";
6
6
  //#region src/constants/public-class-names.ts
7
- var A = {
7
+ var k = {
8
8
  citationCard: "dial-quotations-citation-card",
9
9
  citationDropdown: "dial-quotations-citation-dropdown",
10
10
  citationMarker: "dial-quotations-citation-marker"
11
- }, te = (t) => {
11
+ }, ne = (t) => {
12
12
  let n = t.body?.source?.attachment?.type;
13
13
  return n === e.HTML || n === e.XHTML;
14
- }, j = (e) => {
14
+ }, A = (e) => {
15
15
  try {
16
16
  return decodeURIComponent(e);
17
17
  } catch {
18
18
  return e;
19
19
  }
20
- }, M = (e) => {
20
+ }, j = (e) => {
21
21
  try {
22
22
  let t = new URL(e);
23
- return t.pathname.split("/").map((e) => j(e)).filter(Boolean).at(-1) ?? t.hostname;
23
+ return t.pathname.split("/").map((e) => A(e)).filter(Boolean).at(-1) ?? t.hostname;
24
24
  } catch {
25
- return e.split("/").map((e) => j(e)).filter(Boolean).at(-1) ?? e;
25
+ return e.split("/").map((e) => A(e)).filter(Boolean).at(-1) ?? e;
26
26
  }
27
- }, N = /\.([a-z0-9]{1,10})$/i, P = (e) => {
28
- let t = e == null ? null : N.exec(e.trim());
27
+ }, M = /\.([a-z0-9]{1,10})$/i, N = (e) => {
28
+ let t = e == null ? null : M.exec(e.trim());
29
29
  return t == null ? void 0 : `.${t[1].toLowerCase()}`;
30
- }, ne = (e) => {
30
+ }, re = (e) => {
31
31
  let t = e.body?.source?.attachment, n = t?.url;
32
- return (n == null ? void 0 : P(M(n))) ?? P(t?.title);
33
- }, F = (e, t) => e.body?.source?.attachment?.title ?? M(t), I = (e) => {
32
+ return (n == null ? void 0 : N(j(n))) ?? N(t?.title);
33
+ }, P = (e, t) => e.body?.source?.attachment?.title ?? j(t), F = (e) => {
34
34
  let t = e.target?.selector;
35
35
  return t?.type === "html_tag" ? t : void 0;
36
- }, re = (e) => I(e) != null, L = (e) => {
36
+ }, ie = (e) => F(e) != null, I = (e) => {
37
37
  let t = /* @__PURE__ */ new Map();
38
38
  for (let n of e) {
39
- if (re(n)) continue;
39
+ if (ie(n)) continue;
40
40
  let e = n.body?.source?.attachment?.url;
41
41
  if (e == null) continue;
42
42
  let r = t.get(e);
43
43
  r ? r.annotations.push(n) : t.set(e, {
44
44
  groupKey: e,
45
45
  sourceUrl: e,
46
- sourceName: F(n, e),
46
+ sourceName: P(n, e),
47
47
  annotations: [n],
48
48
  primaryAnnotation: n
49
49
  });
50
50
  }
51
51
  return Array.from(t.values());
52
- }, R = (e) => {
52
+ }, L = (e) => {
53
53
  let t = /* @__PURE__ */ new Map();
54
54
  for (let n of e) {
55
- let e = I(n)?.id;
55
+ let e = F(n)?.id;
56
56
  if (e == null) continue;
57
57
  let r = n.body?.source?.attachment?.url;
58
58
  if (r == null) continue;
@@ -60,109 +60,109 @@ var A = {
60
60
  i ? i.annotations.push(n) : t.set(e, {
61
61
  groupKey: `cit:${e}`,
62
62
  sourceUrl: r,
63
- sourceName: F(n, r),
63
+ sourceName: P(n, r),
64
64
  annotations: [n],
65
65
  primaryAnnotation: n
66
66
  });
67
67
  }
68
68
  return Array.from(t.values());
69
- }, ie = (e) => [...R(e), ...L(e)], ae = (e, t) => {
69
+ }, R = (e) => [...L(e), ...I(e)], z = (e, t) => {
70
70
  let n = e.body?.source?.attachment?.url;
71
71
  return n == null || !t.includes(e) ? [e] : t.filter((e) => e.body?.source?.attachment?.url === n);
72
- }, z = {
72
+ }, B = {
73
73
  card: "_card_1kph1_1",
74
74
  quote: "_quote_1kph1_5",
75
75
  title: "_title_1kph1_9",
76
76
  switcher: "_switcher_1kph1_13",
77
77
  sourceName: "_sourceName_1kph1_17"
78
- }, B = ({ group: e, activeIndex: r, onIndexChange: a, onPreview: o, onOpenInBrowser: l, isDownloadEnabled: h = !0, headerIcon: y, labels: b, typography: x, colors: w }) => {
79
- let D = e.annotations.length, j = e.annotations[r] ?? e.primaryAnnotation, M = D > 1, N = o == null || te(j), P = N ? void 0 : ne(j), F = P ?? e.sourceName, I = y ?? (P == null ? void 0 : /* @__PURE__ */ O(f, {
78
+ }, V = ({ group: e, activeIndex: r, onIndexChange: a, onPreview: o, onOpenInBrowser: l, isDownloadEnabled: h = !0, headerIcon: y, labels: b, typography: x, colors: w }) => {
79
+ let E = e.annotations.length, A = e.annotations[r] ?? e.primaryAnnotation, j = E > 1, M = o == null || ne(A), N = M ? void 0 : re(A), P = N ?? e.sourceName, F = y ?? (N == null ? void 0 : /* @__PURE__ */ D(f, {
80
80
  type: c.File,
81
- name: P,
82
- fileExtension: P,
81
+ name: N,
82
+ fileExtension: N,
83
83
  size: 16,
84
84
  decorative: !0,
85
85
  className: "shrink-0"
86
- })), re = x?.sourceNameClassName ?? "dial-tiny-text", L = x?.titleClassName ?? "dial-body-semi-text", R = x?.quoteClassName ?? "dial-small-text", ie = x?.quoteStrongClassName ?? "dial-small-semi-text", ae = x?.switcherClassName ?? "dial-tiny-text", B = n({
86
+ })), ie = x?.sourceNameClassName ?? "dial-tiny-text", I = x?.titleClassName ?? "dial-body-semi-text", L = x?.quoteClassName ?? "dial-small-text", R = x?.quoteStrongClassName ?? "dial-small-semi-text", z = x?.switcherClassName ?? "dial-tiny-text", V = n({
87
87
  "--cc-card-bg": w?.cardBackground,
88
88
  "--cc-quote-text": w?.quoteText,
89
89
  "--cc-title-text": w?.titleText,
90
90
  "--cc-switcher-text": w?.switcherText,
91
91
  "--cc-source-name-text": w?.sourceNameText
92
- }), V = j.body?.quote, H = S(), U = T(null), [W, G] = E(!1), [K, oe] = E(!1);
93
- return ee(() => {
94
- G(!1);
95
- }, [r, V]), C(() => {
96
- let e = U.current;
97
- if (!e || W) return;
98
- let t = () => oe(e.scrollHeight > e.clientHeight + 1);
92
+ }), H = A.body?.quote, U = ee(), W = te(null), [G, K] = T(!1), [q, ae] = T(!1);
93
+ return S(() => {
94
+ K(!1);
95
+ }, [r, H]), C(() => {
96
+ let e = W.current;
97
+ if (!e || G) return;
98
+ let t = () => ae(e.scrollHeight > e.clientHeight + 1);
99
99
  t();
100
100
  let n = new ResizeObserver(t);
101
101
  return n.observe(e), () => n.disconnect();
102
- }, [V, W]), /* @__PURE__ */ k("div", {
102
+ }, [H, G]), /* @__PURE__ */ O("div", {
103
103
  role: "dialog",
104
104
  "aria-modal": "true",
105
105
  "aria-label": b.ariaLabel,
106
- style: B,
107
- className: i("flex w-[400px] max-w-full flex-col gap-3 rounded-lg p-4 shadow-lg", z.card, A.citationCard),
106
+ style: V,
107
+ className: i("flex w-[400px] max-w-full flex-col gap-3 rounded-lg p-4 shadow-lg", B.card, k.citationCard),
108
108
  children: [
109
- /* @__PURE__ */ k("div", {
109
+ /* @__PURE__ */ O("div", {
110
110
  className: "flex items-center justify-between gap-2",
111
- children: [/* @__PURE__ */ k("div", {
111
+ children: [/* @__PURE__ */ O("div", {
112
112
  className: "flex min-w-0 items-center gap-1",
113
- children: [I, /* @__PURE__ */ O(d, {
114
- text: F,
115
- className: i(re, "min-w-0", z.sourceName)
113
+ children: [F, /* @__PURE__ */ D(d, {
114
+ text: P,
115
+ className: i(ie, "min-w-0", B.sourceName)
116
116
  })]
117
- }), M && /* @__PURE__ */ k("div", {
117
+ }), j && /* @__PURE__ */ O("div", {
118
118
  className: "flex shrink-0 items-center gap-1",
119
119
  children: [
120
- /* @__PURE__ */ O(p, {
121
- icon: /* @__PURE__ */ O(_, {
120
+ /* @__PURE__ */ D(p, {
121
+ icon: /* @__PURE__ */ D(_, {
122
122
  size: 14,
123
123
  className: "rtl:scale-x-[-1]",
124
124
  stroke: s
125
125
  }),
126
126
  size: u.Small,
127
127
  "aria-label": b.previousCitation,
128
- onClick: () => a((r - 1 + D) % D)
128
+ onClick: () => a((r - 1 + E) % E)
129
129
  }),
130
- /* @__PURE__ */ O("span", {
131
- className: i(ae, z.switcher),
132
- children: b.formatSwitcherText(r + 1, D)
130
+ /* @__PURE__ */ D("span", {
131
+ className: i(z, B.switcher),
132
+ children: b.formatSwitcherText(r + 1, E)
133
133
  }),
134
- /* @__PURE__ */ O(p, {
135
- icon: /* @__PURE__ */ O(v, {
134
+ /* @__PURE__ */ D(p, {
135
+ icon: /* @__PURE__ */ D(v, {
136
136
  size: 14,
137
137
  className: "rtl:scale-x-[-1]",
138
138
  stroke: s
139
139
  }),
140
140
  size: u.Small,
141
141
  "aria-label": b.nextCitation,
142
- onClick: () => a((r + 1) % D)
142
+ onClick: () => a((r + 1) % E)
143
143
  })
144
144
  ]
145
145
  })]
146
146
  }),
147
- (j.body?.title || j.body?.quote || M) && /* @__PURE__ */ k("div", {
147
+ (A.body?.title || A.body?.quote || j) && /* @__PURE__ */ O("div", {
148
148
  className: "flex flex-col gap-3",
149
- children: [j.body?.title && /* @__PURE__ */ O("p", {
150
- className: i(L, z.title, "break-words"),
151
- children: j.body.title
152
- }), (V || M) && /* @__PURE__ */ k("div", {
149
+ children: [A.body?.title && /* @__PURE__ */ D("p", {
150
+ className: i(I, B.title, "wrap-break-word"),
151
+ children: A.body.title
152
+ }), (H || j) && /* @__PURE__ */ O("div", {
153
153
  className: "flex flex-col items-start gap-1",
154
- children: [/* @__PURE__ */ O("div", {
155
- ref: U,
156
- id: H,
157
- tabIndex: W ? 0 : void 0,
158
- className: i(R, z.quote, "w-full break-words", W ? "max-h-[min(20rem,50vh)] overflow-y-auto" : "line-clamp-6"),
159
- children: V && /* @__PURE__ */ O(t, {
160
- content: V,
154
+ children: [/* @__PURE__ */ D("div", {
155
+ ref: W,
156
+ id: U,
157
+ tabIndex: G ? 0 : void 0,
158
+ className: i(L, B.quote, "w-full wrap-break-word", G ? "max-h-[min(20rem,50vh)] overflow-y-auto" : "line-clamp-6"),
159
+ children: H && /* @__PURE__ */ D(t, {
160
+ content: H,
161
161
  classNames: {
162
- p: i(R, z.quote),
163
- ul: i(R, "ps-[1.5em]"),
164
- ol: R,
165
- strong: ie
162
+ p: i(L, B.quote),
163
+ ul: i(L, "ps-[1.5em]"),
164
+ ol: L,
165
+ strong: R
166
166
  },
167
167
  codeBlockCopyLabel: b.codeBlockCopyLabel,
168
168
  codeBlockCopiedLabel: b.codeBlockCopiedLabel,
@@ -170,46 +170,47 @@ var A = {
170
170
  tableScrollRegionAriaLabel: b.tableScrollRegionAriaLabel,
171
171
  mathScrollRegionAriaLabel: b.mathScrollRegionAriaLabel
172
172
  })
173
- }), K && /* @__PURE__ */ O(m, {
174
- label: W ? b.showLess : b.showMore,
173
+ }), q && /* @__PURE__ */ D(m, {
174
+ label: G ? b.showLess : b.showMore,
175
175
  size: u.Small,
176
- "aria-expanded": W,
177
- "aria-controls": H,
178
- onClick: () => G((e) => !e)
176
+ "aria-expanded": G,
177
+ "aria-controls": U,
178
+ onClick: () => K((e) => !e)
179
179
  })]
180
180
  })]
181
181
  }),
182
- /* @__PURE__ */ k("div", {
182
+ /* @__PURE__ */ O("div", {
183
183
  className: "flex justify-start gap-2",
184
- children: [o && /* @__PURE__ */ O(g, {
184
+ children: [o && /* @__PURE__ */ D(g, {
185
185
  label: b.preview,
186
186
  size: u.Small,
187
- onClick: () => o(j)
188
- }), (N || h) && /* @__PURE__ */ O(g, {
189
- label: N ? b.openInBrowser : b.download,
187
+ onClick: () => o(A)
188
+ }), (M || h) && /* @__PURE__ */ D(g, {
189
+ label: M ? b.openInBrowser : b.download,
190
190
  size: u.Small,
191
- onClick: () => l(j)
191
+ onClick: () => l(A)
192
192
  })]
193
193
  })
194
194
  ]
195
195
  });
196
- }, V = ({ annotationCount: e, onOpen: t, icon: n, labels: r, labelClassName: a = "dial-caption-text" }) => /* @__PURE__ */ O(h, {
196
+ }, H = ({ annotationCount: e, onOpen: t, icon: n, labels: r, labelClassName: a = "dial-caption-text", ...o }) => /* @__PURE__ */ D(h, {
197
197
  size: u.Small,
198
- className: i("max-w-[240px]", A.citationMarker),
198
+ className: i("max-w-[240px]", k.citationMarker),
199
199
  textClassName: "min-w-0 truncate",
200
200
  iconBefore: n,
201
- label: /* @__PURE__ */ O("span", {
201
+ label: /* @__PURE__ */ D("span", {
202
202
  className: a,
203
203
  children: e > 1 ? r.labelWithOverflow : r.label
204
204
  }),
205
205
  "aria-label": r.ariaLabel,
206
+ ...o,
206
207
  onClick: t
207
- }), H = y(null), U = H.Provider, W = () => {
208
- let e = x(H);
208
+ }), U = y(null), W = U.Provider, G = () => {
209
+ let e = x(U);
209
210
  if (e == null) throw Error("useCitationCardContext must be used within a CitationCardProvider");
210
211
  return e;
211
- }, G = { trigger: "_trigger_119c8_7" }, K = ({ group: e, onPreview: t, isPreviewable: n, onOpenInBrowser: r, isDownloadEnabled: a = !0, isPreviewOpen: o = !1, previewFilesOnMarkerClick: s = !1, icon: c, headerIcon: u, cardLabels: d, markerLabels: f, cardTypography: p, markerLabelClassName: m }) => {
212
- let h = W(), g = S(), _ = h.isOpen(g), v = h.getActiveIndex(e.groupKey), y = e.annotations[v] ?? e.primaryAnnotation, x = n?.(y) ?? !0, ee = b((e) => {
212
+ }, K = { trigger: "_trigger_119c8_7" }, q = ({ group: e, onPreview: t, isPreviewable: n, onOpenInBrowser: r, isDownloadEnabled: a = !0, isPreviewOpen: o = !1, previewFilesOnMarkerClick: s = !1, icon: c, headerIcon: u, cardLabels: d, markerLabels: f, cardTypography: p, markerLabelClassName: m }) => {
213
+ let h = G(), g = ee(), _ = h.isOpen(g), v = h.getActiveIndex(e.groupKey), y = e.annotations[v] ?? e.primaryAnnotation, x = n?.(y) ?? !0, S = b((e) => {
213
214
  e || h.closePopup(g);
214
215
  }, [h, g]), C = w(() => t && x ? (e) => {
215
216
  t(e), h.closePopup(g);
@@ -218,8 +219,8 @@ var A = {
218
219
  x,
219
220
  h,
220
221
  g
221
- ]), T = b(() => {
222
- let t = e.annotations.length === 1, n = t && !te(y);
222
+ ]), te = b(() => {
223
+ let t = e.annotations.length === 1, n = t && !ne(y);
223
224
  (o && t || s && n) && C ? C(y) : h.openPopup(g);
224
225
  }, [
225
226
  o,
@@ -229,7 +230,7 @@ var A = {
229
230
  y,
230
231
  h,
231
232
  g
232
- ]), E = b(() => /* @__PURE__ */ O(B, {
233
+ ]), T = b(() => /* @__PURE__ */ D(V, {
233
234
  group: e,
234
235
  activeIndex: v,
235
236
  onIndexChange: (t) => h.setActiveIndex(e.groupKey, t),
@@ -250,25 +251,25 @@ var A = {
250
251
  d,
251
252
  p
252
253
  ]);
253
- return /* @__PURE__ */ O(l, {
254
+ return /* @__PURE__ */ D(l, {
254
255
  open: _,
255
- onOpenChange: ee,
256
+ onOpenChange: S,
256
257
  trigger: [],
257
258
  placement: "bottom-end",
258
259
  matchReferenceWidth: !1,
259
- className: i("ms-1 inline-flex align-middle", G.trigger),
260
- listClassName: i("!p-0 !bg-transparent !shadow-none !rounded-none", A.citationDropdown),
261
- renderOverlay: E,
262
- children: /* @__PURE__ */ O(V, {
260
+ className: i("ms-1 inline-flex align-middle", K.trigger),
261
+ listClassName: i("p-0! bg-transparent! shadow-none! rounded-none!", k.citationDropdown),
262
+ renderOverlay: T,
263
+ children: /* @__PURE__ */ D(H, {
263
264
  sourceName: e.sourceName,
264
265
  annotationCount: e.annotations.length,
265
- onOpen: T,
266
+ onOpen: te,
266
267
  icon: c,
267
268
  labels: f,
268
269
  labelClassName: m
269
270
  })
270
271
  });
271
- }, oe = (e) => {
272
+ }, ae = (e) => {
272
273
  let t = e.trim();
273
274
  if (!t.startsWith("|") || !t.endsWith("|") || /[\r\n]/.test(t)) return;
274
275
  let n = [], r = "";
@@ -277,11 +278,11 @@ var A = {
277
278
  i === "\\" && a != null && /[!-/:-@[-`{-~]/.test(a) ? (r += a, e += 1) : i === "|" ? (n.push(r.trim()), r = "") : r += i;
278
279
  }
279
280
  if (!(r !== "" || n.length < 2 || n.every((e) => e === "" || /^:?-{3,}:?$/.test(e)))) return n;
280
- }, se = (e) => {
281
+ }, oe = (e) => {
281
282
  if (e.type !== "docx_text_anchor" && e.type !== "pptx_text_anchor") return;
282
283
  let { text: t, occurrence: n, slide: r } = e;
283
284
  if (typeof t != "string" || typeof n != "number" || !Number.isSafeInteger(n) || n < 1) return;
284
- let i = oe(t);
285
+ let i = ae(t);
285
286
  if (i != null) {
286
287
  if (e.type === "docx_text_anchor") return {
287
288
  type: "docx_text_anchor",
@@ -295,13 +296,13 @@ var A = {
295
296
  slide: r
296
297
  };
297
298
  }
298
- }, ce = {
299
+ }, se = {
299
300
  backgroundColor: "transparent",
300
301
  borderColor: "var(--stroke-accent, #1D4ED8)",
301
302
  borderWidth: "2px",
302
303
  opacity: .5,
303
304
  hoverOpacity: .5
304
- }, le = (e) => {
305
+ }, ce = (e) => {
305
306
  if (typeof e != "object" || !e) return;
306
307
  let t = e, { lt: n, wh: r } = t;
307
308
  if (Array.isArray(n) && Array.isArray(r) && n.length >= 2 && r.length >= 2) {
@@ -320,7 +321,7 @@ var A = {
320
321
  x2: i + o,
321
322
  y2: a + s
322
323
  };
323
- }, q = (e) => {
324
+ }, J = (e) => {
324
325
  if (!r(e)) return;
325
326
  let t = e, n;
326
327
  if (t.type === "pdf_bbox") {
@@ -331,7 +332,7 @@ var A = {
331
332
  x2: i,
332
333
  y2: a
333
334
  });
334
- } else t.type === "pdf_region" && (n = le(t.bbox));
335
+ } else t.type === "pdf_region" && (n = ce(t.bbox));
335
336
  if (n == null) return;
336
337
  let i = t.page;
337
338
  if (!(typeof i != "number" || !Number.isInteger(i) || i < 1) && [
@@ -346,45 +347,45 @@ var A = {
346
347
  x2: n.x2,
347
348
  y2: n.y2
348
349
  };
349
- }, ue = (e) => {
350
+ }, le = (e) => {
350
351
  if (!r(e)) return;
351
352
  let t = e;
352
353
  if (t.type !== "pdf_bbox" && t.type !== "pdf_region") return;
353
354
  let n = t.page;
354
355
  return typeof n == "number" && Number.isInteger(n) && n >= 1 ? n : void 0;
355
- }, J = (e) => typeof e != "object" || !e ? String(e) : Array.isArray(e) ? `[${e.map(J).join(",")}]` : `{${Object.entries(e).filter(([, e]) => e !== void 0).sort(([e], [t]) => e < t ? -1 : +(e > t)).map(([e, t]) => `${e}=${J(t)}`).join(",")}}`, de = (e) => {
356
+ }, Y = (e) => typeof e != "object" || !e ? String(e) : Array.isArray(e) ? `[${e.map(Y).join(",")}]` : `{${Object.entries(e).filter(([, e]) => e !== void 0).sort(([e], [t]) => e < t ? -1 : +(e > t)).map(([e, t]) => `${e}=${Y(t)}`).join(",")}}`, ue = (e) => {
356
357
  let t = 5381;
357
358
  for (let n = 0; n < e.length; n += 1) t = t * 33 + e.charCodeAt(n) | 0;
358
359
  return (t >>> 0).toString(36);
359
- }, fe = (e) => {
360
+ }, de = (e) => {
360
361
  let t = e.body?.selector;
361
362
  if (t == null) return;
362
363
  let n = (Array.isArray(t) ? t : [t]).flatMap((e) => {
363
- let t = q(e);
364
+ let t = J(e);
364
365
  return t == null ? [] : [t];
365
366
  }), r = Te(e);
366
- if (n.length !== 0 || r.length !== 0) return J([n, r]);
367
+ if (n.length !== 0 || r.length !== 0) return Y([n, r]);
368
+ }, fe = (e) => {
369
+ let t = e.target?.selector, n = t?.type === "html_tag" ? t.id : void 0, r = typeof n == "string" ? n : void 0, i = de(e);
370
+ if (r != null || i != null) return ue(`${r ?? ""}|${i ?? ""}`);
367
371
  }, pe = (e) => {
368
- let t = e.target?.selector, n = t?.type === "html_tag" ? t.id : void 0, r = typeof n == "string" ? n : void 0, i = fe(e);
369
- if (r != null || i != null) return de(`${r ?? ""}|${i ?? ""}`);
370
- }, me = (e) => {
371
- let t = ge(e);
372
+ let t = he(e);
372
373
  return e.flatMap((e, n) => {
373
374
  let i = e.body?.selector;
374
375
  if (i == null) return [];
375
376
  let a = (Array.isArray(i) ? i : [i]).flatMap((e) => {
376
377
  if (!r(e)) return [];
377
- let t = q(e);
378
+ let t = J(e);
378
379
  return t == null ? [] : [t];
379
380
  });
380
381
  return a.length === 0 ? [] : [{
381
382
  id: t[n],
382
383
  bboxes: a,
383
- style: ce
384
+ style: se
384
385
  }];
385
386
  });
386
- }, he = (e, t) => e.index == null ? pe(e) ?? String(t) : String(e.index), ge = (e) => {
387
- let t = e.map((e, t) => he(e, t)), n = new Set(t), r = /* @__PURE__ */ new Set();
387
+ }, me = (e, t) => e.index == null ? fe(e) ?? String(t) : String(e.index), he = (e) => {
388
+ let t = e.map((e, t) => me(e, t)), n = new Set(t), r = /* @__PURE__ */ new Set();
388
389
  return t.map((e) => {
389
390
  if (!r.has(e)) return r.add(e), e;
390
391
  let t = 1;
@@ -392,20 +393,20 @@ var A = {
392
393
  let i = `${e}-${t}`;
393
394
  return n.add(i), r.add(i), i;
394
395
  });
395
- }, _e = (e) => {
396
+ }, ge = (e) => {
396
397
  let t = e.body?.selector;
397
398
  if (t == null) return;
398
399
  let n = Array.isArray(t) ? t : [t];
399
400
  for (let e of n) {
400
401
  if (!r(e)) continue;
401
- let t = q(e);
402
+ let t = J(e);
402
403
  if (t != null) return t.page;
403
404
  }
404
405
  for (let e of n) {
405
- let t = ue(e);
406
+ let t = le(e);
406
407
  if (t != null) return t;
407
408
  }
408
- }, Y = (e) => {
409
+ }, _e = (e) => {
409
410
  let t = e.custom_content?.annotations;
410
411
  if (t?.length) return t.filter((e) => e != null && e.body?.source?.attachment?.url != null).map(a);
411
412
  let n = e.custom_fields;
@@ -475,14 +476,14 @@ var A = {
475
476
  let t = we(e);
476
477
  return t ? [t] : [];
477
478
  }
478
- let t = se(e);
479
+ let t = oe(e);
479
480
  return t ? [t] : [];
480
481
  });
481
- }, Ee = (e, t) => w(() => t ? [] : Y(e), [t, e]), De = {
482
+ }, Ee = (e, t) => w(() => t ? [] : _e(e), [t, e]), De = {
482
483
  openOwnerKey: null,
483
484
  activeIndexByGroup: {}
484
485
  }, Oe = () => {
485
- let [e, t] = E(De), n = b((e) => {
486
+ let [e, t] = T(De), n = b((e) => {
486
487
  t((t) => ({
487
488
  ...t,
488
489
  openOwnerKey: e
@@ -556,13 +557,13 @@ var A = {
556
557
  let n = $(e, t);
557
558
  return Array.isArray(n) ? n : [n];
558
559
  }) : e;
559
- }, Be = (e, t) => /* @__PURE__ */ k(D, { children: [
560
+ }, Be = (e, t) => /* @__PURE__ */ O(E, { children: [
560
561
  e == null ? "<cit>" : `<cit data-id="${e}">`,
561
562
  t,
562
563
  "</cit>"
563
564
  ] }), Ve = ({ onPreview: e, isPreviewable: t, onOpenInBrowser: n, isDownloadEnabled: r = !0, isPreviewOpen: i = !1, previewFilesOnMarkerClick: a = !1, buildLabels: o }) => (s) => {
564
565
  let { cardLabels: c, markerLabels: l } = o(s);
565
- return /* @__PURE__ */ O(K, {
566
+ return /* @__PURE__ */ D(q, {
566
567
  group: s,
567
568
  onPreview: (t) => e(t, s),
568
569
  isPreviewable: t,
@@ -574,13 +575,13 @@ var A = {
574
575
  markerLabels: l
575
576
  }, `citation-${s.groupKey}`);
576
577
  }, He = {}, Ue = [], We = (e, t, n, r = !1, a = !1, o = Ue) => {
577
- let { onPreview: s, isPreviewable: c, onOpenInBrowser: l, isDownloadEnabled: u = !0, isPreviewOpen: d = !1, previewFilesOnMarkerClick: f = !1, buildLabels: p } = n, m = w(() => r ? Z(e) : X(t.length > 0 ? Ae(e, t) : e), [
578
+ let { onPreview: s, isPreviewable: c, onOpenInBrowser: l, isDownloadEnabled: u = !0, isPreviewOpen: d = !1, previewFilesOnMarkerClick: f = !1, paragraphClassName: p = "dial-body-paragraph-text", compactParagraphClassName: m = "dial-small-paragraph-text", buildLabels: h } = n, g = w(() => r ? Z(e) : X(t.length > 0 ? Ae(e, t) : e), [
578
579
  e,
579
580
  t,
580
581
  r
581
- ]), h = m.includes("<cit");
582
+ ]), _ = g.includes("<cit");
582
583
  return {
583
- processedContent: m,
584
+ processedContent: g,
584
585
  markdownComponents: w(() => {
585
586
  let e = Q(t, o), n = Ve({
586
587
  onPreview: s,
@@ -589,22 +590,22 @@ var A = {
589
590
  isDownloadEnabled: u,
590
591
  isPreviewOpen: d,
591
592
  previewFilesOnMarkerClick: f,
592
- buildLabels: p
593
+ buildLabels: h
593
594
  }), r = (e) => {
594
595
  let r = t[e];
595
596
  return r ? n(r) : null;
596
- }, m = { cit: (t) => {
597
+ }, g = { cit: (t) => {
597
598
  let r = t["data-id"] == null ? void 0 : e.get(t["data-id"]);
598
599
  return r ? n(r) : Be(t["data-id"], t.children);
599
600
  } };
600
- return t.length === 0 && o.length === 0 ? h ? m : He : {
601
- ...m,
602
- p: ({ children: e, ...t }) => /* @__PURE__ */ O("p", {
601
+ return t.length === 0 && o.length === 0 ? _ ? g : He : {
602
+ ...g,
603
+ p: ({ children: e, ...t }) => /* @__PURE__ */ D("p", {
603
604
  ...t,
604
- className: i(a ? "dial-small-paragraph-text" : "dial-body-paragraph-text", "mb-3 [text-wrap:pretty] [overflow-wrap:anywhere] last:mb-0"),
605
+ className: i(a ? m : p, "mb-3 text-pretty wrap-anywhere last:mb-0"),
605
606
  children: $(e, r)
606
607
  }),
607
- li: ({ children: e, ...t }) => /* @__PURE__ */ O("li", {
608
+ li: ({ children: e, ...t }) => /* @__PURE__ */ D("li", {
608
609
  ...t,
609
610
  className: "mb-1.5 last:mb-0",
610
611
  children: $(e, r)
@@ -619,9 +620,11 @@ var A = {
619
620
  u,
620
621
  d,
621
622
  f,
623
+ h,
622
624
  p,
625
+ m,
623
626
  a,
624
- h
627
+ _
625
628
  ])
626
629
  };
627
630
  }, Ge = [], Ke = (e, t, n = Ge) => {
@@ -657,7 +660,7 @@ var A = {
657
660
  baseUrl: t[1],
658
661
  page: t[2] == null ? null : Number(t[2])
659
662
  } : null;
660
- }, Xe = (t) => L((t ?? []).filter(qe).map((t) => {
663
+ }, Xe = (t) => I((t ?? []).filter(qe).map((t) => {
661
664
  let n = t.reference_url, r = Ye(n) != null;
662
665
  return { body: {
663
666
  quote: t.data,
@@ -676,8 +679,8 @@ var A = {
676
679
  return t?.type === "html_tag" && typeof t.id == "string" && typeof n?.url == "string" && (n.title == null || typeof n.title == "string");
677
680
  }, $e = (e) => w(() => {
678
681
  if (!Array.isArray(e)) return Ze;
679
- let t = R(e.filter(Qe));
682
+ let t = L(e.filter(Qe));
680
683
  return t.length ? t : Ze;
681
684
  }, [e]);
682
685
  //#endregion
683
- export { B as CitationCard, U as CitationCardProvider, K as CitationDropdown, V as CitationMarker, A as QUOTATIONS_CLASS, he as annotationHighlightId, ge as annotationHighlightIds, Te as annotationToOfficeHighlightLocations, me as annotationsToPdfHighlights, ae as gatherSameSourceAnnotations, _e as getAnnotationPdfPage, Xe as getReferenceAttachmentGroups, ie as groupAnnotations, R as groupAnnotationsByCitId, L as groupAnnotationsBySource, Ae as injectCitationSentinels, ve as isDocxRangeSelector, xe as isExcelRcRangeSelector, ye as isPptxRangeSelector, qe as isReferenceOnlyAttachment, Ye as parsePdfPageReference, Fe as prepareCitationContent, ze as replaceCitTagsWithSourceNames, $ as replaceSentinelsInChildren, Y as resolveMessageAnnotations, Z as stripCitTagsWhileStreaming, Ee as useAnnotations, Oe as useCitationCard, W as useCitationCardContext, We as useCitationMarkdownComponents, Ke as useCitationTagRenderer, $e as useHtmlTagAnnotationGroups };
686
+ export { V as CitationCard, W as CitationCardProvider, q as CitationDropdown, H as CitationMarker, k as QUOTATIONS_CLASS, me as annotationHighlightId, he as annotationHighlightIds, Te as annotationToOfficeHighlightLocations, pe as annotationsToPdfHighlights, z as gatherSameSourceAnnotations, ge as getAnnotationPdfPage, Xe as getReferenceAttachmentGroups, R as groupAnnotations, L as groupAnnotationsByCitId, I as groupAnnotationsBySource, Ae as injectCitationSentinels, ve as isDocxRangeSelector, xe as isExcelRcRangeSelector, ye as isPptxRangeSelector, qe as isReferenceOnlyAttachment, Ye as parsePdfPageReference, Fe as prepareCitationContent, ze as replaceCitTagsWithSourceNames, $ as replaceSentinelsInChildren, _e as resolveMessageAnnotations, Z as stripCitTagsWhileStreaming, Ee as useAnnotations, Oe as useCitationCard, G as useCitationCardContext, We as useCitationMarkdownComponents, Ke as useCitationTagRenderer, $e as useHtmlTagAnnotationGroups };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@epam/ai-dial-quotations",
3
3
  "description": "Citation and annotation components, hooks, and utilities for AI DIAL conversations",
4
- "version": "1.3.0-dev.252",
4
+ "version": "1.3.0-dev.256",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "main": "./index.js",
@@ -23,7 +23,7 @@
23
23
  },
24
24
  "peerDependencies": {
25
25
  "react": "^19.2.8",
26
- "@epam/ai-dial-chat-shared": "1.3.0-dev.252",
26
+ "@epam/ai-dial-chat-shared": "1.3.0-dev.256",
27
27
  "@epam/ai-dial-ui-kit": "^0.16.0-dev.56"
28
28
  },
29
29
  "repository": {