@epam/ai-dial-attachment-canvas 1.1.0-dev.44 → 1.1.0-dev.440

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.
Files changed (71) hide show
  1. package/LazyContentBoundary-CL7J_W9c.js +166 -0
  2. package/PdfContent-solOLCRi.js +239 -0
  3. package/PdfContent.css +1 -0
  4. package/attachment-canvas-Bp6WeQws.js +12 -0
  5. package/bounded-raw-part-cache-BfbSxRIL-DD07NKh9.js +37832 -0
  6. package/chart-ex-B0DgG3Dt.js +1009 -0
  7. package/comment-occurrence-CqejEuts-7SeKCBXk.js +6 -0
  8. package/comment-ui-runtime-DEtgcmj7-B1G7PH4z.js +170 -0
  9. package/comment-ui-runtime-TLHustXJ-DWCXG2mL.js +2 -0
  10. package/comment-ui-runtime-lXwVOgjW-Be4RALsI.js +112 -0
  11. package/comments-CAn2A_Xh-CdgNAj0h.js +282 -0
  12. package/components/AttachmentCanvas/AttachmentCanvas.d.ts +1 -0
  13. package/components/AttachmentCanvas/AttachmentCanvas.d.ts.map +1 -1
  14. package/components/AttachmentCanvasBody/AttachmentCanvasBody.d.ts +4 -0
  15. package/components/AttachmentCanvasBody/AttachmentCanvasBody.d.ts.map +1 -0
  16. package/components/AttachmentCanvasContainer/AttachmentCanvasContainer.d.ts +14 -0
  17. package/components/AttachmentCanvasContainer/AttachmentCanvasContainer.d.ts.map +1 -1
  18. package/components/CodeContent/CodeContent.d.ts +24 -0
  19. package/components/CodeContent/CodeContent.d.ts.map +1 -0
  20. package/components/HtmlContent/HtmlContent.d.ts +21 -0
  21. package/components/HtmlContent/HtmlContent.d.ts.map +1 -0
  22. package/components/LazyContentBoundary/LazyContentBoundary.d.ts +73 -0
  23. package/components/LazyContentBoundary/LazyContentBoundary.d.ts.map +1 -0
  24. package/components/McpAppCanvasRenderer/McpAppCanvasRenderer.d.ts +12 -0
  25. package/components/McpAppCanvasRenderer/McpAppCanvasRenderer.d.ts.map +1 -0
  26. package/components/OoxmlContent/OoxmlContent.d.ts +22 -0
  27. package/components/OoxmlContent/OoxmlContent.d.ts.map +1 -0
  28. package/components/PdfContent/PdfContent.d.ts +56 -0
  29. package/components/PdfContent/PdfContent.d.ts.map +1 -1
  30. package/components/VisualizerCanvasRenderer/VisualizerCanvasRenderer.d.ts +25 -0
  31. package/components/VisualizerCanvasRenderer/VisualizerCanvasRenderer.d.ts.map +1 -0
  32. package/constants/file.d.ts +8 -0
  33. package/constants/file.d.ts.map +1 -1
  34. package/context/AttachmentCanvasContext.d.ts +5 -3
  35. package/context/AttachmentCanvasContext.d.ts.map +1 -1
  36. package/delimited-text-worker-host-DcHj_JZt-DWJmaPag.js +25 -0
  37. package/docx-B9qBTEkj.js +29822 -0
  38. package/hooks/useOpenAttachmentCanvas/useOpenAttachmentCanvas.d.ts +64 -0
  39. package/hooks/useOpenAttachmentCanvas/useOpenAttachmentCanvas.d.ts.map +1 -0
  40. package/index.css +1 -2
  41. package/index.d.ts +11 -3
  42. package/index.d.ts.map +1 -1
  43. package/index.js +1123 -17237
  44. package/line-distribute-IsUGfHXm-DeITjLzJ.js +1234 -0
  45. package/line-metrics-CBbw80Ko-DoOuwYxZ.js +60 -0
  46. package/models/attachment-canvas.d.ts +314 -11
  47. package/models/attachment-canvas.d.ts.map +1 -1
  48. package/ooxml-highlight-surfaces-BhfVZvru.js +294 -0
  49. package/package.json +17 -9
  50. package/pptx-dkJw0-Vx.js +9179 -0
  51. package/read-only-comment-decoration-BTnWEeo5-BNhbteYc.js +94 -0
  52. package/read-only-comment-margin-plStyGfE-mggNAMB_.js +189 -0
  53. package/render-worker-host-BEfLZvSL-COy91Rd8.js +7 -0
  54. package/render-worker-host-Ba6Fchqr-DZeKpMWD.js +7 -0
  55. package/render-worker-host-C3xwtHnv-BBGHFdo9.js +7 -0
  56. package/renderer-module-contract-Cu-GKuPd-Bt0YZuzB.js +10063 -0
  57. package/types/attachment-canvas.d.ts +22 -0
  58. package/types/attachment-canvas.d.ts.map +1 -1
  59. package/utils/content.d.ts +11 -0
  60. package/utils/content.d.ts.map +1 -1
  61. package/utils/download.d.ts.map +1 -1
  62. package/utils/ooxml-highlight-geometry.d.ts +158 -0
  63. package/utils/ooxml-highlight-geometry.d.ts.map +1 -0
  64. package/utils/ooxml-highlight-surfaces.d.ts +42 -0
  65. package/utils/ooxml-highlight-surfaces.d.ts.map +1 -0
  66. package/utils/visualizer.d.ts +8 -0
  67. package/utils/visualizer.d.ts.map +1 -0
  68. package/utils/vite-external-matcher.d.ts +16 -0
  69. package/utils/vite-external-matcher.d.ts.map +1 -0
  70. package/visible-index-DPoQYSDt-9lRc-2Ik.js +162 -0
  71. package/xlsx-BAXMTJTG.js +8585 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HtmlContent.d.ts","sourceRoot":"","sources":["../../../src/components/HtmlContent/HtmlContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAGhE,OAAO,EACL,KAAK,EAAE,EAOR,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EACV,sBAAsB,EACtB,iBAAiB,EAClB,MAAM,gCAAgC,CAAC;AAKxC,qCAAqC;AACrC,MAAM,WAAW,gBAAgB;IAC/B,kCAAkC;IAClC,OAAO,EAAE,iBAAiB,CAAC;IAC3B,0CAA0C;IAC1C,MAAM,EAAE,IAAI,CACV,sBAAsB,EACtB,uBAAuB,GAAG,uBAAuB,CAClD,CAAC;IACF,wFAAwF;IACxF,YAAY,EAAE,OAAO,CAAC;IACtB,wDAAwD;IACxD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iJAAiJ;IACjJ,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,8HAA8H;IAC9H,qCAAqC,CAAC,EAAE,MAAM,CAAC;CAChD;AAED,4GAA4G;AAC5G,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CA6G5C,CAAC"}
@@ -0,0 +1,73 @@
1
+ import { Component, FC, ReactNode } from 'react';
2
+ /** User-visible strings for {@link LazyContentBoundary}. All fields have English defaults. */
3
+ export interface LazyContentBoundaryLabels {
4
+ /** Accessible status text announced while the lazy content loads. Defaults to `'Loading…'`. */
5
+ loadingLabel?: string;
6
+ /** Message shown when the lazy content fails to load. Defaults to `'Failed to load content'`. */
7
+ errorLabel?: string;
8
+ /** Label and accessible name for the retry control. Defaults to `'Retry'`. */
9
+ retryLabel?: string;
10
+ }
11
+ /** Props for {@link LazyContentBoundary}. */
12
+ export interface LazyContentBoundaryProps {
13
+ /** The lazy-loaded content to render once ready. */
14
+ children: ReactNode;
15
+ /**
16
+ * Changing this value clears a previously caught error. The caller must
17
+ * pair it with recreating the `lazy()` reference passed as `children` —
18
+ * React caches a rejected `lazy()` promise forever, so retrying only
19
+ * works if a genuinely new `lazy()` component is mounted, not the same one
20
+ * that already rejected.
21
+ */
22
+ retryKey: number;
23
+ /**
24
+ * Called when the user activates the retry control. The caller is
25
+ * responsible for changing `retryKey` and recreating the `lazy()`
26
+ * reference in response (see `retryKey`'s doc).
27
+ */
28
+ onRetry: () => void;
29
+ /**
30
+ * Rendered inside the `role="status"` region while the lazy import is
31
+ * pending, alongside the accessible `loadingLabel`. Defaults to a
32
+ * centered `Spinner`.
33
+ */
34
+ pendingContent?: ReactNode;
35
+ /**
36
+ * Rendered above the `role="alert"` retry message when the lazy import
37
+ * fails — e.g. a plain-text fallback that stays usable while retry is
38
+ * offered. Omitted by default.
39
+ */
40
+ errorContent?: ReactNode;
41
+ /** User-visible strings. All fields have English defaults. */
42
+ labels?: LazyContentBoundaryLabels;
43
+ }
44
+ interface LazyContentPendingProps {
45
+ loadingLabel: string;
46
+ pendingContent?: ReactNode;
47
+ }
48
+ /** Accessible pending state shared by lazy imports and asynchronous runtime preparation. */
49
+ export declare const LazyContentPending: FC<LazyContentPendingProps>;
50
+ interface LazyContentErrorProps {
51
+ errorLabel: string;
52
+ retryLabel: string;
53
+ onRetry: () => void;
54
+ errorContent?: ReactNode;
55
+ }
56
+ /** Accessible retry state shared by lazy imports and asynchronous runtime preparation. */
57
+ export declare const LazyContentError: FC<LazyContentErrorProps>;
58
+ interface LazyContentBoundaryState {
59
+ /** Whether the wrapped lazy import has thrown (a rejected dynamic import). */
60
+ hasError: boolean;
61
+ }
62
+ /**
63
+ * Wraps a `lazy()`-loaded component with an accessible pending state
64
+ * (`role="status"`) and a retryable failure state (`role="alert"`).
65
+ */
66
+ export declare class LazyContentBoundary extends Component<LazyContentBoundaryProps, LazyContentBoundaryState> {
67
+ state: LazyContentBoundaryState;
68
+ static getDerivedStateFromError(): LazyContentBoundaryState;
69
+ componentDidUpdate(prevProps: LazyContentBoundaryProps): void;
70
+ render(): ReactNode;
71
+ }
72
+ export {};
73
+ //# sourceMappingURL=LazyContentBoundary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LazyContentBoundary.d.ts","sourceRoot":"","sources":["../../../src/components/LazyContentBoundary/LazyContentBoundary.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAY,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAErE,8FAA8F;AAC9F,MAAM,WAAW,yBAAyB;IACxC,+FAA+F;IAC/F,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iGAAiG;IACjG,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8EAA8E;IAC9E,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,6CAA6C;AAC7C,MAAM,WAAW,wBAAwB;IACvC,oDAAoD;IACpD,QAAQ,EAAE,SAAS,CAAC;IACpB;;;;;;OAMG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB;;;;OAIG;IACH,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B;;;;OAIG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,8DAA8D;IAC9D,MAAM,CAAC,EAAE,yBAAyB,CAAC;CACpC;AAED,UAAU,uBAAuB;IAC/B,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,SAAS,CAAC;CAC5B;AAED,4FAA4F;AAC5F,eAAO,MAAM,kBAAkB,EAAE,EAAE,CAAC,uBAAuB,CAY1D,CAAC;AAEF,UAAU,qBAAqB;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,YAAY,CAAC,EAAE,SAAS,CAAC;CAC1B;AAED,0FAA0F;AAC1F,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CAetD,CAAC;AAEF,UAAU,wBAAwB;IAChC,8EAA8E;IAC9E,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED;;;GAGG;AACH,qBAAa,mBAAoB,SAAQ,SAAS,CAChD,wBAAwB,EACxB,wBAAwB,CACzB;IACU,KAAK,EAAE,wBAAwB,CAAuB;IAE/D,MAAM,CAAC,wBAAwB,IAAI,wBAAwB;IAIlD,kBAAkB,CAAC,SAAS,EAAE,wBAAwB,GAAG,IAAI;IAY7D,MAAM,IAAI,SAAS;CAqC7B"}
@@ -0,0 +1,12 @@
1
+ import { FC } from 'react';
2
+ import { McpAppCanvasContent } from '../../models/attachment-canvas';
3
+ /** Props for the `McpAppCanvasRenderer` component. */
4
+ export interface McpAppCanvasRendererProps {
5
+ /** MCP App content to render. */
6
+ content: McpAppCanvasContent;
7
+ /** Message shown when the app fails to initialize. Defaults to `'Failed to load app'`. */
8
+ errorLabel?: string;
9
+ }
10
+ /** Renders an MCP app in a sandboxed iframe inside the attachment canvas. */
11
+ export declare const McpAppCanvasRenderer: FC<McpAppCanvasRendererProps>;
12
+ //# sourceMappingURL=McpAppCanvasRenderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"McpAppCanvasRenderer.d.ts","sourceRoot":"","sources":["../../../src/components/McpAppCanvasRenderer/McpAppCanvasRenderer.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAE,EAAwC,MAAM,OAAO,CAAC;AACtE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAG1E,sDAAsD;AACtD,MAAM,WAAW,yBAAyB;IACxC,iCAAiC;IACjC,OAAO,EAAE,mBAAmB,CAAC;IAC7B,0FAA0F;IAC1F,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAeD,6EAA6E;AAC7E,eAAO,MAAM,oBAAoB,EAAE,EAAE,CAAC,yBAAyB,CAmH9D,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { FC } from 'react';
2
+ import { OoxmlCanvasContent } from '../../models/attachment-canvas';
3
+ interface OoxmlContentProps {
4
+ /** OOXML or CSV source and format to render. */
5
+ content: OoxmlCanvasContent;
6
+ /** File name used as the viewer's accessible name. */
7
+ fileName?: string;
8
+ /** Message shown when the document parser or renderer fails. */
9
+ loadErrorLabel: string;
10
+ /** Accessible label for the panel that shows the active XLSX cell content. */
11
+ formulaLabel: string;
12
+ /** CSS class applied to the decorative `fx` label. */
13
+ formulaLabelClassName: string;
14
+ /** Accessible label for the cited-locations overlay region. Defaults to `'Cited locations'`. */
15
+ highlightsLabel?: string;
16
+ /** Status announced once the cited location has been brought into view. Defaults to `'Scrolled to the cited location'`. */
17
+ highlightNavigatedLabel?: string;
18
+ }
19
+ /** Renders DOCX, XLSX, PPTX, and CSV attachments with `@silurus/ooxml`, optionally highlighting cited locations. */
20
+ export declare const OoxmlContent: FC<OoxmlContentProps>;
21
+ export {};
22
+ //# sourceMappingURL=OoxmlContent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OoxmlContent.d.ts","sourceRoot":"","sources":["../../../src/components/OoxmlContent/OoxmlContent.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAE,EAA+B,MAAM,OAAO,CAAC;AAC7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AA8OzE,UAAU,iBAAiB;IACzB,gDAAgD;IAChD,OAAO,EAAE,kBAAkB,CAAC;IAC5B,sDAAsD;IACtD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gEAAgE;IAChE,cAAc,EAAE,MAAM,CAAC;IACvB,8EAA8E;IAC9E,YAAY,EAAE,MAAM,CAAC;IACrB,sDAAsD;IACtD,qBAAqB,EAAE,MAAM,CAAC;IAC9B,gGAAgG;IAChG,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,2HAA2H;IAC3H,uBAAuB,CAAC,EAAE,MAAM,CAAC;CAClC;AAED,oHAAoH;AACpH,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CA2R9C,CAAC"}
@@ -1,11 +1,67 @@
1
1
  import { InputHighlightData } from '@epam/pdf-highlighter-kit';
2
2
  import { FC } from 'react';
3
+ /** User-visible strings for the collapsible thumbnails section. */
4
+ export interface PdfContentLabels {
5
+ /** Accessible name for the thumbnails region — not shown visibly. Defaults to `'Thumbnails'`. */
6
+ thumbnailsLabel?: string;
7
+ /** Accessible label for the FAB button when the thumbnails panel is closed. Defaults to `'Show thumbnails'`. */
8
+ showThumbnailsLabel?: string;
9
+ /** Accessible label for the FAB button when the thumbnails panel is open. Defaults to `'Hide thumbnails'`. */
10
+ hideThumbnailsLabel?: string;
11
+ /** Accessible label for the current-page number input at the top of the thumbnails panel. Defaults to `'Page number'`. */
12
+ pageNumberLabel?: string;
13
+ /** Accessible status text announced while the host prepares the PDF runtime. Defaults to `'Loading…'`. */
14
+ loadingLabel?: string;
15
+ /** Message shown when the host fails to prepare the PDF runtime. Defaults to `'Failed to load content'`. */
16
+ errorLabel?: string;
17
+ /** Label and accessible name for retrying PDF runtime preparation. Defaults to `'Retry'`. */
18
+ retryLabel?: string;
19
+ }
20
+ /** Props for the `PdfContent` component. */
3
21
  export interface PdfContentProps {
22
+ /** URL of the PDF file to display. */
4
23
  url: string;
24
+ /** Highlight annotations to overlay on the document. */
5
25
  highlights: InputHighlightData[];
26
+ /** ID of the highlight that should be scrolled into view on mount. */
6
27
  selectedHighlightId?: string;
28
+ /**
29
+ * 1-based page to navigate to on initial load and whenever it changes,
30
+ * independent of highlight geometry — forwarded directly to the underlying
31
+ * `DocumentPreview`'s own `selectedPageNumber` prop. Takes precedence over
32
+ * the highlight-bbox-derived page when both are present.
33
+ */
34
+ selectedPageNumber?: number;
35
+ /** Custom fetcher for the PDF blob; falls back to a plain `fetch` wrapper. */
7
36
  loadPdf?: (url: string) => Promise<Blob>;
37
+ /** File name shown in the canvas header. */
8
38
  fileName?: string;
39
+ /**
40
+ * Configures `pdfjs-dist`'s worker (`GlobalWorkerOptions.workerSrc`) for the
41
+ * host app. Called once, the first time a PDF attachment is opened, and
42
+ * awaited before the viewer mounts. Concurrent PDF opens share one
43
+ * in-flight call; a successful call is memoized so later opens never
44
+ * repeat it. A rejected call is not cached — the next PDF open (or a
45
+ * subsequent retry) invokes it again. When omitted,
46
+ * `@epam/pdf-highlighter-kit`'s own CDN-hosted worker fallback is used
47
+ * instead, so PDF rendering still works, just without the host's own
48
+ * bundled worker asset.
49
+ */
50
+ configurePdfWorker?: () => void | Promise<void>;
51
+ /**
52
+ * Hides the underlying `DocumentPreview`'s own title/zoom toolbar row —
53
+ * for hosts that render their own header and don't want it duplicated.
54
+ * `DocumentPreview` (`@epam/ai-dial-react-pdf-highlighter`) has no public
55
+ * prop for this, so it is done via `containerClassName` targeting that
56
+ * row's structural position; this only holds while `PdfContent` itself
57
+ * never passes `title`/`fileName` through to `DocumentPreview` (it
58
+ * currently doesn't — see the unused `fileName` prop above). Defaults to
59
+ * `false`, preserving the existing chat sidebar canvas's appearance.
60
+ */
61
+ hideHeader?: boolean;
62
+ /** User-visible strings for the thumbnails section. All fields have English defaults. */
63
+ labels?: PdfContentLabels;
9
64
  }
65
+ /** Renders a PDF with highlight annotations, a floating collapsible thumbnails panel, and page navigation. */
10
66
  export declare const PdfContent: FC<PdfContentProps>;
11
67
  //# sourceMappingURL=PdfContent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PdfContent.d.ts","sourceRoot":"","sources":["../../../src/components/PdfContent/PdfContent.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EACL,KAAK,EAAE,EAMR,MAAM,OAAO,CAAC;AAIf,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,kBAAkB,EAAE,CAAC;IACjC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CAyF1C,CAAC"}
1
+ {"version":3,"file":"PdfContent.d.ts","sourceRoot":"","sources":["../../../src/components/PdfContent/PdfContent.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,OAAO,EACL,KAAK,EAAE,EAQR,MAAM,OAAO,CAAC;AAcf,OAAO,gDAAgD,CAAC;AACxD,OAAO,yDAAyD,CAAC;AAkFjE,mEAAmE;AACnE,MAAM,WAAW,gBAAgB;IAC/B,iGAAiG;IACjG,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gHAAgH;IAChH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,8GAA8G;IAC9G,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,0HAA0H;IAC1H,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,0GAA0G;IAC1G,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,4GAA4G;IAC5G,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,6FAA6F;IAC7F,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,4CAA4C;AAC5C,MAAM,WAAW,eAAe;IAC9B,sCAAsC;IACtC,GAAG,EAAE,MAAM,CAAC;IACZ,wDAAwD;IACxD,UAAU,EAAE,kBAAkB,EAAE,CAAC;IACjC,sEAAsE;IACtE,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,8EAA8E;IAC9E,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC,4CAA4C;IAC5C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;;;;;;;OAUG;IACH,kBAAkB,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChD;;;;;;;;;OASG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,yFAAyF;IACzF,MAAM,CAAC,EAAE,gBAAgB,CAAC;CAC3B;AAED,8GAA8G;AAC9G,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CA6b1C,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { FC } from 'react';
2
+ import { VisualizerCanvasContent } from '../../models/attachment-canvas';
3
+ /** Props for the `VisualizerCanvasRenderer` component. */
4
+ export interface VisualizerCanvasRendererProps {
5
+ /** Visualizer content to render. */
6
+ content: VisualizerCanvasContent;
7
+ /** Text shown alongside the spinner while the handshake/data delivery is pending. Omitted by default (spinner only). */
8
+ loadingLabel?: string;
9
+ /** Message shown when the visualizer fails to receive its data. Defaults to `'Failed to load visualizer'`. */
10
+ errorLabel?: string;
11
+ /** Color overrides applied as CSS custom properties. */
12
+ colors?: VisualizerCanvasRendererColors;
13
+ }
14
+ /** Color overrides for `VisualizerCanvasRenderer`, applied as CSS custom properties. */
15
+ export interface VisualizerCanvasRendererColors {
16
+ /** Background of the loading overlay. Defaults to `--bg-layer-sunken`. */
17
+ loadingBackground?: string;
18
+ /** Loading/error message text color. Defaults to `--text-primary`. */
19
+ statusText?: string;
20
+ /** Error icon color. Defaults to `--text-error`. */
21
+ errorIcon?: string;
22
+ }
23
+ /** Mounts a sandboxed visualizer iframe, drives the handshake, and delivers visualize data. */
24
+ export declare const VisualizerCanvasRenderer: FC<VisualizerCanvasRendererProps>;
25
+ //# sourceMappingURL=VisualizerCanvasRenderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VisualizerCanvasRenderer.d.ts","sourceRoot":"","sources":["../../../src/components/VisualizerCanvasRenderer/VisualizerCanvasRenderer.tsx"],"names":[],"mappings":"AAoCA,OAAO,EAAE,KAAK,EAAE,EAA+B,MAAM,OAAO,CAAC;AAC7D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAG9E,0DAA0D;AAC1D,MAAM,WAAW,6BAA6B;IAC5C,oCAAoC;IACpC,OAAO,EAAE,uBAAuB,CAAC;IACjC,wHAAwH;IACxH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,8GAA8G;IAC9G,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,wDAAwD;IACxD,MAAM,CAAC,EAAE,8BAA8B,CAAC;CACzC;AAED,wFAAwF;AACxF,MAAM,WAAW,8BAA8B;IAC7C,0EAA0E;IAC1E,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,sEAAsE;IACtE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oDAAoD;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAQD,+FAA+F;AAC/F,eAAO,MAAM,wBAAwB,EAAE,EAAE,CAAC,6BAA6B,CAmHtE,CAAC"}
@@ -1,3 +1,11 @@
1
+ /** File extensions that are rendered as HTML in a sandboxed iframe. */
2
+ export declare const HTML_EXTENSIONS: Set<string>;
3
+ /** MIME types for the supported Office Open XML formats. */
4
+ export declare const OOXML_MIME_TYPES: {
5
+ readonly docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
6
+ readonly xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
7
+ readonly pptx: "application/vnd.openxmlformats-officedocument.presentationml.presentation";
8
+ };
1
9
  /** File extensions that are known to be previewable as plain text. */
2
10
  export declare const TEXT_EXTENSIONS: Set<string>;
3
11
  //# sourceMappingURL=file.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../src/constants/file.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,eAAO,MAAM,eAAe,aAoD1B,CAAC"}
1
+ {"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../src/constants/file.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,eAAO,MAAM,eAAe,aAA2B,CAAC;AAExD,4DAA4D;AAC5D,eAAO,MAAM,gBAAgB;;;;CAInB,CAAC;AAEX,sEAAsE;AACtE,eAAO,MAAM,eAAe,aAkD1B,CAAC"}
@@ -10,17 +10,19 @@ export interface AttachmentCanvasContextValue {
10
10
  content: AttachmentCanvasContent;
11
11
  /** File name shown in the canvas header. */
12
12
  fileName: string | undefined;
13
+ /** ID of the attachment currently displayed in the canvas, if any. */
14
+ attachmentId: string | undefined;
13
15
  /** Open the canvas immediately in a loading state before content has resolved. */
14
- openCanvasLoading: (fileName?: string) => void;
16
+ openCanvasLoading: (fileName?: string, attachmentId?: string) => void;
15
17
  /** Open the canvas with the given content and optional file name. */
16
- openCanvas: (content: AttachmentCanvasContent, fileName?: string) => void;
18
+ openCanvas: (content: AttachmentCanvasContent, fileName?: string, attachmentId?: string) => void;
17
19
  /** Close the canvas. */
18
20
  closeCanvas: () => void;
19
21
  }
20
22
  /** Provides attachment canvas state to all descendants. */
21
23
  export declare const AttachmentCanvasProvider: ({ children, }: {
22
24
  children: ReactNode;
23
- }) => import("react/jsx-runtime").JSX.Element;
25
+ }) => import("react").JSX.Element;
24
26
  /** Consumes the attachment canvas context. Must be used inside `AttachmentCanvasProvider`. */
25
27
  export declare const useAttachmentCanvas: () => AttachmentCanvasContextValue;
26
28
  //# sourceMappingURL=AttachmentCanvasContext.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AttachmentCanvasContext.d.ts","sourceRoot":"","sources":["../../src/context/AttachmentCanvasContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AA2B3E,sDAAsD;AACtD,MAAM,WAAW,4BAA4B;IAC3C,kDAAkD;IAClD,MAAM,EAAE,OAAO,CAAC;IAChB,uFAAuF;IACvF,SAAS,EAAE,OAAO,CAAC;IACnB,iDAAiD;IACjD,OAAO,EAAE,uBAAuB,CAAC;IACjC,4CAA4C;IAC5C,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,kFAAkF;IAClF,iBAAiB,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/C,qEAAqE;IACrE,UAAU,EAAE,CAAC,OAAO,EAAE,uBAAuB,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1E,wBAAwB;IACxB,WAAW,EAAE,MAAM,IAAI,CAAC;CACzB;AAOD,2DAA2D;AAC3D,eAAO,MAAM,wBAAwB,GAAI,eAEtC;IACD,QAAQ,EAAE,SAAS,CAAC;CACrB,4CAgEA,CAAC;AAEF,8FAA8F;AAC9F,eAAO,MAAM,mBAAmB,QAAO,4BAQtC,CAAC"}
1
+ {"version":3,"file":"AttachmentCanvasContext.d.ts","sourceRoot":"","sources":["../../src/context/AttachmentCanvasContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AA4B3E,sDAAsD;AACtD,MAAM,WAAW,4BAA4B;IAC3C,kDAAkD;IAClD,MAAM,EAAE,OAAO,CAAC;IAChB,uFAAuF;IACvF,SAAS,EAAE,OAAO,CAAC;IACnB,iDAAiD;IACjD,OAAO,EAAE,uBAAuB,CAAC;IACjC,4CAA4C;IAC5C,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,sEAAsE;IACtE,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,kFAAkF;IAClF,iBAAiB,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACtE,qEAAqE;IACrE,UAAU,EAAE,CACV,OAAO,EAAE,uBAAuB,EAChC,QAAQ,CAAC,EAAE,MAAM,EACjB,YAAY,CAAC,EAAE,MAAM,KAClB,IAAI,CAAC;IACV,wBAAwB;IACxB,WAAW,EAAE,MAAM,IAAI,CAAC;CACzB;AAOD,2DAA2D;AAC3D,eAAO,MAAM,wBAAwB,GAAI,eAEtC;IACD,QAAQ,EAAE,SAAS,CAAC;CACrB,gCAgFA,CAAC;AAEF,8FAA8F;AAC9F,eAAO,MAAM,mBAAmB,QAAO,4BAQtC,CAAC"}
@@ -0,0 +1,25 @@
1
+ //#region ../../node_modules/@silurus/ooxml/dist/delimited-text-worker-host-DcHj_JZt.js
2
+ var e = "var e=(e,t)=>()=>(e&&(t=e(e=0)),t),t=class e extends Error{code;constructor(t,n){super(n),this.name=`OoxmlError`,this.code=t,Object.setPrototypeOf(this,e.prototype)}},n=class e extends Error{code=`ooxml-resource-limit`;details;constructor(t,n){super(t),this.name=`OoxmlResourceLimitError`;let r=n.violation,i=Object.freeze({format:r.format,operation:r.operation,resource:r.resource,metric:r.metric,...r.part===void 0?{}:{part:r.part},limit:r.limit,observed:r.observed,configurable:r.configurable,usage:Object.freeze({archiveEntryCount:r.usage.archiveEntryCount,declaredInflatedBytes:r.usage.declaredInflatedBytes,...r.usage.largestInflatedEntryBytes===void 0?{}:{largestInflatedEntryBytes:r.usage.largestInflatedEntryBytes},distinctInflatedBytes:r.usage.distinctInflatedBytes,operationInflatedBytes:r.usage.operationInflatedBytes})});this.details=Object.freeze({stage:n.stage,violation:i}),Object.setPrototypeOf(this,e.prototype)}};function r(e){return e===`image-dimension`||e===`image-pixels`||e===`active-decoded-bytes`}function i(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0}function a(e){if(!(!e||typeof e!=`object`))try{let t=e,n=t.code,a=t.metric,o=t.limit,s=t.observed;return n!==`ooxml-decoded-image-limit`||!r(a)||!i(o)||!i(s)||s<=o?void 0:{metric:a,limit:o,observed:s}}catch{return}}var o,s,c,l=e((()=>{o=1<<25,s=1<<27,o*4,s*4,c=class e extends RangeError{code=`ooxml-decoded-image-limit`;constructor(t,n,r){super(`OOXML decoded image limit exceeded: ${t} ${r} > ${n}`),this.metric=t,this.limit=n,this.observed=r,this.name=`OoxmlDecodedImageLimitError`,Object.setPrototypeOf(this,e.prototype)}}}));function u(e){if(!(typeof e!=`object`||!e))try{let t=e,n=t.code,r=t.message;return n===`ooxml-tiff-decode`&&typeof r==`string`?{message:r}:void 0}catch{return}}var d=e((()=>{}));function f(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>0}function p(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return f(t.requiredBytes)&&f(t.offeredBytes)&&t.requiredBytes>t.offeredBytes}var m=class e extends RangeError{code=`ooxml-insufficient-credit`;requiredBytes;offeredBytes;constructor(t){super(`Pull unit requires ${t.requiredBytes} bytes but credit is ${t.offeredBytes}`),this.name=`PullSessionInsufficientCreditError`,this.requiredBytes=t.requiredBytes,this.offeredBytes=t.offeredBytes,Object.setPrototypeOf(this,e.prototype)}};function h(e){if(e instanceof m)return e;let t=e instanceof Error?e.message:String(e);if(!t.startsWith(`OOXML_INSUFFICIENT_CREDIT:`))return;let n;try{n=JSON.parse(t.slice(26))}catch{return}if(!n||typeof n!=`object`||Array.isArray(n))return;let r=n;if(!(r.code!==`ooxml-insufficient-credit`||!p(r)))return new m(r)}l(),d();const g=`OOXML_RESOURCE_LIMIT:`;function _(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0}function v(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return _(t.archiveEntryCount)&&_(t.declaredInflatedBytes)&&(t.largestInflatedEntryBytes===void 0||_(t.largestInflatedEntryBytes))&&_(t.distinctInflatedBytes)&&_(t.operationInflatedBytes)}function y(e){return e===`docx`||e===`xlsx`||e===`pptx`}function b(e){return e===`container`||e===`decompression`||e===`parsing`||e===`serialization`||e===`layout`||e===`rendering`||e===`worker`}function x(e,t){return typeof e==`string`&&e.length>0&&e.length<=t&&!/[\\u0000-\\u001f\\u007f]/u.test(e)}function S(e){return x(e,128)&&/^[a-z0-9][a-z0-9-]*$/u.test(e)}function C(e){return!x(e,4096)||e.startsWith(`/`)||e.startsWith(`\\\\`)||e.includes(`\\\\`)||e.includes(`?`)||e.includes(`#`)||e.includes(`://`)||/^[a-z]:/iu.test(e)?!1:e.split(`/`).every(e=>e!==``&&e!==`.`&&e!==`..`)}const w=new Map([[`archive-entry:declared-inflated-bytes`,{stage:`container`,part:`required`}],[`archive-entry:actual-inflated-bytes`,{stage:`decompression`,part:`required`}],[`archive:entry-count`,{stage:`container`,part:`forbidden`}],[`archive:central-directory-bytes`,{stage:`container`,part:`forbidden`,configurable:!1}],[`archive:distinct-inflated-bytes`,{stage:`decompression`,part:`required`}],[`xml-event:bytes`,{stage:`parsing`,part:`optional`,configurable:!1}],[`xml-context:bytes`,{stage:`parsing`,part:`optional`,configurable:!1}],[`xml-tree:depth`,{stage:`parsing`,part:`optional`,configurable:!1}],[`worksheet-row:projected-bytes`,{stage:`parsing`,part:`optional`,configurable:!1}],[`worksheet-shell:projected-bytes`,{stage:`parsing`,part:`optional`,configurable:!1}]]),T=new Set([...w.keys()].map(e=>e.slice(0,e.indexOf(`:`)))),E=new Set([...w.keys()].map(e=>e.slice(e.indexOf(`:`)+1)));function D(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return!y(t.format)||!x(t.operation,256)||!S(t.resource)||!S(t.metric)||!_(t.limit)||!_(t.observed)||typeof t.configurable!=`boolean`||!v(t.usage)?!1:!(`part`in t)||C(t.part)}function O(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;if(!b(t.stage)||!D(t.violation))return!1;let n=t.violation,r=w.get(`${n.resource}:${n.metric}`);return r?t.stage!==r.stage||r.configurable===!1&&n.configurable!==!1?!1:r.part===`required`?n.part!==void 0:r.part===`forbidden`?n.part===void 0:!0:!(T.has(n.resource)&&E.has(n.metric))}function k(e){return{archiveEntryCount:e.archiveEntryCount,declaredInflatedBytes:e.declaredInflatedBytes,...e.largestInflatedEntryBytes===void 0?{}:{largestInflatedEntryBytes:e.largestInflatedEntryBytes},distinctInflatedBytes:e.distinctInflatedBytes,operationInflatedBytes:e.operationInflatedBytes}}function A(e){if(!O(e))return;let t=e.violation,n={stage:e.stage,violation:{format:t.format,operation:t.operation,resource:t.resource,metric:t.metric,...t.part===void 0?{}:{part:t.part},limit:t.limit,observed:t.observed,configurable:t.configurable,usage:k(t.usage)}};return O(n)?n:void 0}function j(e){let t=e.violation;return`OOXML resource limit exceeded${t.part?` for ${t.part}`:``}: ${t.metric} ${t.observed} > ${t.limit}`}function M(e){let t=e instanceof Error?e.message:String(e);if(!t.startsWith(g))return;let r;try{r=JSON.parse(t.slice(21))}catch{return}if(!r||typeof r!=`object`)return;let i=r;if(!(i.code!==`ooxml-resource-limit`||!O(i.details)))return new n(j(i.details),i.details)}function N(e){let r=a(e);if(r){let e=new c(r.metric,r.limit,r.observed);return{message:e.message,errorName:e.name,code:e.code,decodedImage:r}}let i=u(e);if(i)return{message:i.message,errorName:`TiffDecodeError`,code:`ooxml-tiff-decode`};let o=h(e);if(o)return{message:o.message,errorName:o.name,code:o.code,insufficientCredit:{requiredBytes:o.requiredBytes,offeredBytes:o.offeredBytes}};let s=e instanceof t||e instanceof n?e:M(e);if(s instanceof n){let e=A(s.details);return e?{message:typeof s.message==`string`?s.message:j(e),errorName:`OoxmlResourceLimitError`,code:`ooxml-resource-limit`,resourceLimit:e}:{message:`Invalid OOXML resource-limit error payload`,errorName:`Error`}}if(s instanceof t)return{message:typeof s.message==`string`?s.message:String(s.message),errorName:x(s.name,128)?s.name:`OoxmlError`,...S(s.code)?{code:s.code}:{}};let l=e instanceof Error?e.message:String(e);if(typeof l==`string`&&l.startsWith(g))return{message:`Invalid OOXML resource-limit payload`,errorName:`Error`};let d=e instanceof Error?e:Error(l),f=d;return{message:typeof d.message==`string`?d.message:String(d.message),errorName:x(d.name,128)?d.name:`Error`,...typeof f.code==`string`?{code:f.code}:{}}}function P(e){try{return N(e)}catch{return{message:`Worker operation failed with an unreadable error`,errorName:`Error`}}}function F(e,t){if(!Number.isSafeInteger(e)||e<0)throw Error(`${t} must be a non-negative safe integer`)}function I(e,t,n){return F(e,`resource measurement`),F(t,`resource measurement`),F(n,`resource measurement limit`),e>n||t>n||t>n-e?n===2**53-1?n:n+1:e+t}function L(e,t=2**53-1){F(t,`resource measurement limit`);let n=0;for(let r=0;r<e.length;r+=1){let i=e.charCodeAt(r),a;if(i<=127)a=1;else if(i<=2047)a=2;else if(i>=55296&&i<=56319&&r+1<e.length){let t=e.charCodeAt(r+1);t>=56320&&t<=57343?(a=4,r+=1):a=3}else a=3;if(n=I(n,a,t),n>t)return n}return n}function R(e,t=2**53-1){F(t,`resource measurement limit`);let n=I(0,2,t);if(n>t)return n;for(let r=0;r<e.length;r+=1){let i=e.charCodeAt(r),a;if(i===34||i===92||i===8||i===9||i===10||i===12||i===13)a=2;else if(i<=31)a=6;else if(i<=127)a=1;else if(i<=2047)a=2;else if(i>=55296&&i<=56319&&r+1<e.length){let t=e.charCodeAt(r+1);t>=56320&&t<=57343?(a=4,r+=1):a=6}else a=i>=55296&&i<=57343?6:3;if(n=I(n,a,t),n>t)return n}return n}function z(e,t){return I(0,e,t)}function B(e,t=2**53-1,n=!1){if(F(t,`resource measurement limit`),e===null)return{jsonBytes:z(4,t),stringValueUtf8Bytes:0};if(typeof e==`string`)return{jsonBytes:R(e,t),stringValueUtf8Bytes:L(e,t)};if(typeof e==`boolean`)return{jsonBytes:z(e?4:5,t),stringValueUtf8Bytes:0};if(typeof e==`number`)return{jsonBytes:z((Number.isFinite(e)?String(Object.is(e,-0)?0:e):`null`).length,t),stringValueUtf8Bytes:0};if(typeof e==`bigint`)throw TypeError(`BigInt values cannot be serialized to JSON`);if(Array.isArray(e)){let n=z(2,t),r=0;for(let i=0;i<e.length;i+=1){i!==0&&(n=I(n,1,t));let a=B(e[i],t,!0);n=I(n,a.jsonBytes,t),r=I(r,a.stringValueUtf8Bytes,t)}return{jsonBytes:n,stringValueUtf8Bytes:r}}if(typeof e==`object`){let n=z(2,t),r=0,i=0;for(let[a,o]of Object.entries(e)){if(o===void 0||typeof o==`function`||typeof o==`symbol`)continue;i++!==0&&(n=I(n,1,t)),n=I(n,R(a,t),t),n=I(n,1,t);let e=B(o,t);n=I(n,e.jsonBytes,t),r=I(r,e.stringValueUtf8Bytes,t)}return{jsonBytes:n,stringValueUtf8Bytes:r}}return{jsonBytes:n?z(4,t):0,stringValueUtf8Bytes:0}}const V=1e5,H=25e4,U=33554432,W=67108864,G=Object.freeze({archiveEntryCount:0,declaredInflatedBytes:0,distinctInflatedBytes:0,operationInflatedBytes:0});function K(e){let t=e.reduce((e,t)=>I(e,t.cells.length,H),0);return{rows:e.length,cells:t,ownedUtf8Bytes:e.reduce((e,t)=>t.cells.reduce((e,t)=>{let n=B(t.value,U).stringValueUtf8Bytes;return I(e,I(n,t.formula===void 0?0:L(t.formula,U),U),U)},e),0)}}function q(e){return J(e,K(e.rows))}function J(e,t){let n=B(e,67108864);return{...t,jsonBytes:n.jsonBytes}}function Y(e,t,r,i,a,o,s){let c=r===`worksheet-json`?`serialization`:`parsing`;return new n(`OOXML resource limit exceeded${t?` for ${t}`:``}: ${i} ${o} > ${a}`,{stage:c,violation:{format:`xlsx`,operation:e,resource:r,metric:i,...t===void 0?{}:{part:t},limit:a,observed:Math.min(o,a+1),configurable:!1,usage:s??G}})}function X(e,t,n,r){let i=[[`rows`,e.rows,V],[`cells`,e.cells,H],[`owned-utf8-bytes`,e.ownedUtf8Bytes,U]];for(let[e,a,o]of i)if(a>o)throw Y(t,n,e===`owned-utf8-bytes`?`worksheet-cell-content`:`worksheet-model`,e,o,a,r)}function Z(e,t,n,r){if(e>W)throw Y(t,n,`worksheet-json`,`bytes`,W,e,r)}const Q=`load-delimited-text`,$=W;function ee(e){if(e>$)throw Y(Q,void 0,`delimited-text-source`,`bytes`,$,e)}const te=Object.freeze({fonts:[Object.freeze({bold:!1,italic:!1,underline:!1,strike:!1,size:11,color:null,name:`Calibri`})],fills:[Object.freeze({patternType:`none`,fgColor:null,bgColor:null})],borders:[Object.freeze({left:null,right:null,top:null,bottom:null})],cellXfs:[Object.freeze({fontId:0,fillId:0,borderId:0,numFmtId:0,alignH:null,alignV:null,wrapText:!1})],numFmts:[],dxfs:[]});function ne(e,t){ee(e.byteLength);let n;try{n=new TextDecoder(t.encoding,{fatal:!0}).decode(e)}catch(e){throw TypeError(`Delimited text could not be decoded as ${t.encoding}`,{cause:e})}let r=[],i=[],a=``,o,s=1,c=1,l=0,u=0,d=!1,f=!1,p=e=>{a+=e,a.length>=4096&&((o??=[]).push(a),a=``)},m=()=>{if(l++,l>H)throw Y(Q,void 0,`worksheet-model`,`cells`,H,l);if(c>16384)throw RangeError(`Delimited text row ${s} has more than 16384 columns`);let e=o?o.join(``)+a:a;if(e!==``){if(u+=L(e,U+1),u>U)throw Y(Q,void 0,`worksheet-cell-content`,`owned-utf8-bytes`,U,u);i.push({row:s,col:c,value:{type:`text`,text:e}})}a=``,o=void 0,c++,f=!1},h=()=>{if(s>V)throw Y(Q,void 0,`worksheet-model`,`rows`,V,s);r.push({index:s,height:null,cells:i}),i=[],s++,c=1};for(let e=0;e<n.length;e++){let r=n[e];if(d){if(r!==`\"`){r===`\\r`?(p(`\n`),n[e+1]===`\n`&&e++):p(r);continue}n[e+1]===`\"`?(p(`\"`),e++):(d=!1,f=!0);continue}if(f){if(r!==t.delimiter&&r!==`\\r`&&r!==`\n`)throw SyntaxError(`Unexpected character after closing quote at row ${s}, column ${c}`)}else if(r===`\"`&&a===``&&o===void 0){d=!0;continue}if(r===t.delimiter){m();continue}if(r===`\\r`||r===`\n`){m(),h(),r===`\\r`&&n[e+1]===`\n`&&e++;continue}p(r)}if(d)throw SyntaxError(`Unterminated quoted field at row ${s}, column ${c}`);let g=n.endsWith(`\n`)||n.endsWith(`\\r`);n.length>0&&!g&&(m(),h());let _={name:t.sheetName,rows:r,colWidths:{},rowHeights:{},defaultColWidth:8.43,defaultRowHeight:15,mergeCells:[],freezeRows:0,freezeCols:0,conditionalFormats:[],images:[],charts:[],defaultFontFamily:`Calibri`,defaultFontSize:11},v=q(_);return X(v,Q,void 0),Z(v.jsonBytes,Q,void 0),{workbook:{workbook:{sheets:[{name:t.sheetName,sheetId:1,rId:`rId1`}]},styles:te,sharedStrings:[]},worksheet:_}}self.onmessage=e=>{let t=e.data;try{let{workbook:e,worksheet:n}=ne(t.data,t.options),r=new TextEncoder().encode(JSON.stringify(n)).buffer,i={type:`delimitedTextParsed`,id:t.id,workbook:e,worksheetJson:r};self.postMessage(i,[r])}catch(e){let n={type:`error`,id:t.id,...P(e)};self.postMessage(n)}};", t = typeof self < "u" && self.Blob && new Blob(["URL.revokeObjectURL(import.meta.url);", e], { type: "text/javascript;charset=utf-8" });
3
+ function n(n) {
4
+ let r;
5
+ try {
6
+ if (r = t && (self.URL || self.webkitURL).createObjectURL(t), !r) throw "";
7
+ let e = new Worker(r, {
8
+ type: "module",
9
+ name: n?.name
10
+ });
11
+ return e.addEventListener("error", () => {
12
+ (self.URL || self.webkitURL).revokeObjectURL(r);
13
+ }), e;
14
+ } catch {
15
+ return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(e), {
16
+ type: "module",
17
+ name: n?.name
18
+ });
19
+ }
20
+ }
21
+ function r() {
22
+ return new n();
23
+ }
24
+ //#endregion
25
+ export { r as createDelimitedTextWorker };