@epam/ai-dial-attachment-canvas 1.2.0-dev.3 → 1.2.0-dev.34

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 (52) hide show
  1. package/{LazyContentBoundary-CRXN6PG3.js → LazyContentBoundary-Cxx8J-Bl.js} +2 -1
  2. package/{PdfContent-D71LPAe3.js → PdfContent-DN_j6BCb.js} +1 -1
  3. package/PdfContent.css +1 -1
  4. package/{attachment-canvas-nvhW3tKV.js → attachment-canvas-BNu9KfEu.js} +1 -1
  5. package/components/AttachmentCanvas/AttachmentCanvas.d.ts.map +1 -1
  6. package/components/AttachmentCanvasBody/AttachmentCanvasBody.d.ts.map +1 -1
  7. package/components/AttachmentCanvasContainer/AttachmentCanvasContainer.d.ts.map +1 -1
  8. package/components/InlineGroupedVisualizer/InlineGroupedVisualizer.d.ts +36 -0
  9. package/components/InlineGroupedVisualizer/InlineGroupedVisualizer.d.ts.map +1 -0
  10. package/components/PdfContent/PdfContent.d.ts.map +1 -1
  11. package/components/VisualizerCanvasRenderer/VisualizerCanvasRenderer.d.ts +5 -3
  12. package/components/VisualizerCanvasRenderer/VisualizerCanvasRenderer.d.ts.map +1 -1
  13. package/context/AttachmentCanvasContext.d.ts.map +1 -1
  14. package/hooks/useOpenAttachmentCanvas/useOpenAttachmentCanvas.d.ts +14 -1
  15. package/hooks/useOpenAttachmentCanvas/useOpenAttachmentCanvas.d.ts.map +1 -1
  16. package/index.css +2 -1
  17. package/index.d.ts +6 -3
  18. package/index.d.ts.map +1 -1
  19. package/index.js +567 -496
  20. package/models/attachment-canvas.d.ts +20 -9
  21. package/models/attachment-canvas.d.ts.map +1 -1
  22. package/{ooxml-highlight-surfaces-CaMjx8u-.js → ooxml-highlight-surfaces-vLEREQkr.js} +1 -1
  23. package/package.json +3 -3
  24. package/types/attachment-canvas.d.ts +2 -1
  25. package/types/attachment-canvas.d.ts.map +1 -1
  26. package/utils/content.d.ts +16 -2
  27. package/utils/content.d.ts.map +1 -1
  28. package/utils/download.d.ts.map +1 -1
  29. package/utils/visualizer.d.ts +29 -1
  30. package/utils/visualizer.d.ts.map +1 -1
  31. package/utils/vite-external-matcher.d.ts +5 -5
  32. package/utils/vite-external-matcher.d.ts.map +1 -1
  33. package/bounded-raw-part-cache-Cg1BsSZQ-DN8p45IK.js +0 -37900
  34. package/chart-ex-DsESBs97.js +0 -1009
  35. package/comment-occurrence-C8Y2uoVr-C1cxz2TU.js +0 -6
  36. package/comment-ui-runtime-BfE7MJZn-DhQ_eg15.js +0 -112
  37. package/comment-ui-runtime-BsK8pmUT-EgWiymew.js +0 -2
  38. package/comment-ui-runtime-DcJOYlw--B15auUq-.js +0 -170
  39. package/comments-Diid5ujN-BdQhRNjI.js +0 -282
  40. package/delimited-text-worker-host-BVY-Ecni-AimUmSn0.js +0 -25
  41. package/docx-B-VcIRoc.js +0 -29870
  42. package/line-distribute-Dtudnqhs--BYZNgzX.js +0 -1237
  43. package/line-metrics-B60C86uh-DfQUk7X1.js +0 -60
  44. package/pptx-CnoDB8Fv.js +0 -9211
  45. package/read-only-comment-decoration-Dz7eTQ4d-Cl3RKKH6.js +0 -94
  46. package/read-only-comment-margin-DkgzASAl-BbDxMI5E.js +0 -189
  47. package/render-worker-host-BfbnEChF-D2thMRGX.js +0 -7
  48. package/render-worker-host-DNL9dWRh-Bky38ZHE.js +0 -7
  49. package/render-worker-host-IkHrYOci-DbjyHK7U.js +0 -7
  50. package/renderer-module-contract-D91rkYHH-BtfSKxb4.js +0 -10063
  51. package/visible-index-BgiHEc1z-BOzE9X5U.js +0 -162
  52. package/xlsx-Dn0XSlTO.js +0 -8610
package/index.js CHANGED
@@ -1,42 +1,42 @@
1
- import { a as e, i as t, n, r, t as i } from "./attachment-canvas-nvhW3tKV.js";
2
- import { i as a, o, t as s } from "./LazyContentBoundary-CRXN6PG3.js";
1
+ import { a as e, i as t, n, r, t as i } from "./attachment-canvas-BNu9KfEu.js";
2
+ import { i as a, o, t as s } from "./LazyContentBoundary-Cxx8J-Bl.js";
3
3
  import { AttachmentType as c, CodeBlockTheme as l, DEFAULT_MARKDOWN_CLASS_NAMES as u, FileExtension as d, MIMEType as f, MarkdownRenderer as p, buildCssVars as m, copyToClipboard as h, mergeClasses as g, restrainedSyntaxTheme as _, stripUrlQueryAndFragment as v } from "@epam/ai-dial-chat-shared";
4
4
  import { SidebarOrientation as y, SidebarPanel as b } from "@epam/ai-dial-sidebar";
5
- import { DIAL_ICON_SIZE as x, DIAL_KIT_ICON_STROKE as S, GhostIconButton as C, LinkButton as w, Spinner as T } from "@epam/ai-dial-ui-kit";
6
- import { IconAlertTriangle as E, IconCheck as D, IconCode as O, IconCopy as k, IconDownload as ee, IconEye as te, IconLock as ne, IconMarkdown as re, IconRefresh as ie } from "@tabler/icons-react";
7
- import { createContext as ae, lazy as A, memo as j, useCallback as M, useContext as N, useEffect as P, useMemo as F, useRef as I, useState as L } from "react";
8
- import { JsonView as oe, defaultStyles as se } from "react-json-view-lite";
9
- import { Fragment as ce, jsx as R, jsxs as z } from "react/jsx-runtime";
10
- import { AppBridge as B, AppFrame as le } from "@mcp-ui/client";
11
- import { McpUiHostContextChangedNotificationSchema as ue } from "@modelcontextprotocol/ext-apps/app-bridge";
12
- import { VisualizerConnectorRequests as V } from "@epam/ai-dial-shared";
13
- import { VisualizerConnector as H } from "@epam/ai-dial-visualizer-connector";
14
- var de = {
5
+ import { DIAL_ICON_SIZE as x, DIAL_KIT_ICON_STROKE as S, ElementSize as C, GhostIconButton as w, LinkButton as T, Spinner as E } from "@epam/ai-dial-ui-kit";
6
+ import { IconAlertTriangle as D, IconArrowsMaximize as O, IconCheck as k, IconCode as ee, IconCopy as te, IconDownload as ne, IconEye as re, IconLock as ie, IconMarkdown as ae, IconRefresh as oe } from "@tabler/icons-react";
7
+ import { createContext as A, lazy as j, memo as M, useCallback as N, useContext as se, useEffect as P, useMemo as F, useRef as I, useState as L } from "react";
8
+ import { JsonView as ce, defaultStyles as le } from "react-json-view-lite";
9
+ import { Fragment as R, jsx as z, jsxs as B } from "react/jsx-runtime";
10
+ import { AppBridge as V, AppFrame as ue } from "@mcp-ui/client";
11
+ import { McpUiHostContextChangedNotificationSchema as de } from "@modelcontextprotocol/ext-apps/app-bridge";
12
+ import { VisualizerConnectorRequests as H } from "@epam/ai-dial-shared";
13
+ import { VisualizerConnector as fe } from "@epam/ai-dial-visualizer-connector";
14
+ var pe = {
15
15
  container: "_container_1nhig_1",
16
16
  containerLight: "_containerLight_1nhig_5"
17
- }, fe = {
17
+ }, me = {
18
18
  [l.Dark]: _,
19
19
  [l.Light]: _
20
- }, pe = () => A(async () => {
20
+ }, U = () => j(async () => {
21
21
  let { Prism: e } = await import("react-syntax-highlighter");
22
22
  return { default: e };
23
- }), me = j(({ content: e, codeBlockTheme: t = l.Light, labels: n }) => {
24
- let { text: r, language: i } = e, a = i == null || i === "plaintext", o = fe[t], c = t === l.Light, [u, d] = L(0), f = F(pe, [u]), p = M(() => {
23
+ }), he = M(({ content: e, codeBlockTheme: t = l.Light, labels: n }) => {
24
+ let { text: r, language: i } = e, a = i == null || i === "plaintext", o = me[t], c = t === l.Light, [u, d] = L(0), f = F(U, [u]), p = N(() => {
25
25
  d((e) => e + 1);
26
- }, []), m = /* @__PURE__ */ R("pre", {
26
+ }, []), m = /* @__PURE__ */ z("pre", {
27
27
  className: "whitespace-pre-wrap break-words p-4",
28
28
  children: r
29
29
  });
30
- return /* @__PURE__ */ R("div", {
30
+ return /* @__PURE__ */ z("div", {
31
31
  dir: "ltr",
32
- className: g("h-full overflow-auto", de.container, c && de.containerLight),
33
- children: a ? m : /* @__PURE__ */ R(s, {
32
+ className: g("h-full overflow-auto", pe.container, c && pe.containerLight),
33
+ children: a ? m : /* @__PURE__ */ z(s, {
34
34
  retryKey: u,
35
35
  onRetry: p,
36
36
  pendingContent: m,
37
37
  errorContent: m,
38
38
  labels: n,
39
- children: /* @__PURE__ */ R(f, {
39
+ children: /* @__PURE__ */ z(f, {
40
40
  language: i,
41
41
  style: o,
42
42
  customStyle: {
@@ -53,21 +53,21 @@ var de = {
53
53
  })
54
54
  })
55
55
  });
56
- }), he = { openInNewTabButton: "_openInNewTabButton_c1arc_1" }, ge = j(({ content: e, labels: t, isSourceView: n, title: r, codeBlockTheme: a, openInNewTabButtonTypographyClassName: o = "dial-body-semi-text" }) => {
56
+ }), ge = { openInNewTabButton: "_openInNewTabButton_c1arc_1" }, _e = M(({ content: e, labels: t, isSourceView: n, title: r, codeBlockTheme: a, openInNewTabButtonTypographyClassName: o = "dial-body-semi-text" }) => {
57
57
  let { htmlFrameBlockedLabel: s = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: c = "Open in new tab" } = t, [l, u] = L(!0), [d, f] = L(!1), p = I(null);
58
58
  P(() => {
59
59
  u(!0), f(!1);
60
60
  }, [e]);
61
- let m = M((t) => {
61
+ let m = N((t) => {
62
62
  if (u(!1), e.srcdoc == null) try {
63
63
  p.current?.contentDocument ?? f(!0);
64
64
  } catch {
65
65
  f(!0);
66
66
  }
67
- }, [e.srcdoc]), h = M(() => {
67
+ }, [e.srcdoc]), h = N(() => {
68
68
  u(!1), f(!0);
69
69
  }, []);
70
- if (n && e.srcdoc != null) return /* @__PURE__ */ R(me, {
70
+ if (n && e.srcdoc != null) return /* @__PURE__ */ z(he, {
71
71
  content: {
72
72
  type: i.Code,
73
73
  text: e.srcdoc,
@@ -75,26 +75,26 @@ var de = {
75
75
  },
76
76
  codeBlockTheme: a
77
77
  });
78
- if (d) return /* @__PURE__ */ z("div", {
78
+ if (d) return /* @__PURE__ */ B("div", {
79
79
  className: "flex h-full flex-col items-center justify-center gap-3 p-4",
80
- children: [/* @__PURE__ */ R("p", {
80
+ children: [/* @__PURE__ */ z("p", {
81
81
  className: "text-center",
82
82
  children: s
83
- }), e.url != null && /* @__PURE__ */ R(w, {
83
+ }), e.url != null && /* @__PURE__ */ z(T, {
84
84
  href: e.url,
85
85
  target: "_blank",
86
86
  label: c,
87
- className: he.openInNewTabButton,
87
+ className: ge.openInNewTabButton,
88
88
  textClassName: o
89
89
  })]
90
90
  });
91
91
  let _ = e.srcdoc != null, v = _ ? void 0 : e.url, y = _ ? e.srcdoc : void 0;
92
- return /* @__PURE__ */ z("div", {
92
+ return /* @__PURE__ */ B("div", {
93
93
  className: "relative h-full",
94
- children: [l && /* @__PURE__ */ R("div", {
94
+ children: [l && /* @__PURE__ */ z("div", {
95
95
  className: "absolute inset-0 flex items-center justify-center",
96
- children: /* @__PURE__ */ R(T, {})
97
- }), /* @__PURE__ */ R("iframe", {
96
+ children: /* @__PURE__ */ z(E, {})
97
+ }), /* @__PURE__ */ z("iframe", {
98
98
  ref: p,
99
99
  title: r,
100
100
  src: v,
@@ -105,10 +105,10 @@ var de = {
105
105
  onError: h
106
106
  })]
107
107
  });
108
- }), _e = {
108
+ }), ve = {
109
109
  name: "MCP-UI Host",
110
110
  version: "1.0.0"
111
- }, ve = { openLinks: {} }, U = (e) => {
111
+ }, ye = { openLinks: {} }, be = (e) => {
112
112
  let t;
113
113
  try {
114
114
  t = new URL(e);
@@ -122,14 +122,14 @@ var de = {
122
122
  return !1;
123
123
  }
124
124
  return !0;
125
- }, ye = (e, t, n) => {
125
+ }, xe = (e, t, n) => {
126
126
  if (n) {
127
127
  e.style.maxWidth = "", e.style.maxHeight = "";
128
128
  return;
129
129
  }
130
130
  let r = t;
131
131
  r != null && (r.width != null && (e.style.width = `${r.width}px`), r.maxWidth != null && (e.style.maxWidth = `${r.maxWidth}px`), r.height != null && (e.style.height = `${r.height}px`), r.maxHeight != null && (e.style.maxHeight = `${r.maxHeight}px`));
132
- }, be = (e, t, n) => {
132
+ }, Se = (e, t, n) => {
133
133
  let r = I(e);
134
134
  P(() => {
135
135
  r.current = e;
@@ -138,15 +138,15 @@ var de = {
138
138
  return P(() => {
139
139
  let e = null;
140
140
  try {
141
- e = new B(null, _e, ve, { hostContext: r.current.hostContext }), e.onopenlink = async ({ url: e }) => {
141
+ e = new V(null, ve, ye, { hostContext: r.current.hostContext }), e.onopenlink = async ({ url: e }) => {
142
142
  let t = r.current.onOpenLink;
143
- return (t == null ? U(e) : t(e)) === !1 ? { isError: !0 } : {};
143
+ return (t == null ? be(e) : t(e)) === !1 ? { isError: !0 } : {};
144
144
  }, e.onrequestdisplaymode = async ({ mode: e }) => {
145
145
  let t = r.current.onRequestDisplayMode, n = r.current.hostContext?.displayMode ?? "inline";
146
146
  return { mode: t?.(e) ?? n };
147
- }, e.oncalltool = (e) => r.current.onToolCall(e.name, e.arguments), e.setNotificationHandler(ue, ({ params: e }) => {
147
+ }, e.oncalltool = (e) => r.current.onToolCall(e.name, e.arguments), e.setNotificationHandler(de, ({ params: e }) => {
148
148
  let n = t.current?.querySelector("iframe");
149
- n != null && ye(n, e.containerDimensions, r.current.hostContext?.displayMode === "fullscreen");
149
+ n != null && xe(n, e.containerDimensions, r.current.hostContext?.displayMode === "fullscreen");
150
150
  }), a(e);
151
151
  } catch (e) {
152
152
  console.error("[useMcpAppBridge] Error creating AppBridge:", e), s(!0);
@@ -160,12 +160,12 @@ var de = {
160
160
  appBridge: i,
161
161
  hasFailed: o
162
162
  };
163
- }, W = {
163
+ }, Ce = {
164
164
  loadingOverlay: "_loadingOverlay_1aric_1",
165
165
  fullscreenFrame: "_fullscreenFrame_1aric_20",
166
166
  statusLabel: "_statusLabel_1aric_27",
167
167
  errorIcon: "_errorIcon_1aric_31"
168
- }, xe = ({ content: e, errorLabel: t = "Failed to load app" }) => {
168
+ }, we = ({ content: e, errorLabel: t = "Failed to load app" }) => {
169
169
  let [n, r] = L("loading"), { html: i, sandboxUrl: a, toolInput: o, toolResult: s, hostContext: c } = e, l = F(() => ({ url: new URL(a) }), [a]), u = c?.displayMode === "fullscreen", d = I(null), [f, p] = L();
170
170
  P(() => {
171
171
  let e = d.current;
@@ -180,15 +180,15 @@ var de = {
180
180
  });
181
181
  return t.observe(e), () => t.disconnect();
182
182
  }, []);
183
- let { appBridge: m, hasFailed: h } = be(e, d, F(() => c == null || f == null ? c : {
183
+ let { appBridge: m, hasFailed: h } = Se(e, d, F(() => c == null || f == null ? c : {
184
184
  ...c,
185
185
  containerDimensions: f
186
186
  }, [c, f])), _ = h || n === "error";
187
- return /* @__PURE__ */ z("div", {
187
+ return /* @__PURE__ */ B("div", {
188
188
  ref: d,
189
- className: g("relative h-full w-full", u && W.fullscreenFrame),
189
+ className: g("relative h-full w-full", u && Ce.fullscreenFrame),
190
190
  children: [
191
- m != null && /* @__PURE__ */ R(le, {
191
+ m != null && /* @__PURE__ */ z(ue, {
192
192
  html: i,
193
193
  sandbox: l,
194
194
  appBridge: m,
@@ -198,26 +198,26 @@ var de = {
198
198
  onInitialized: () => r("ready"),
199
199
  onError: () => r("error")
200
200
  }),
201
- !_ && n === "loading" && /* @__PURE__ */ R("div", {
202
- className: g("absolute inset-0 flex flex-col items-center justify-center gap-2", W.loadingOverlay),
203
- children: /* @__PURE__ */ R(T, {})
201
+ !_ && n === "loading" && /* @__PURE__ */ z("div", {
202
+ className: g("absolute inset-0 flex flex-col items-center justify-center gap-2", Ce.loadingOverlay),
203
+ children: /* @__PURE__ */ z(E, {})
204
204
  }),
205
- _ && /* @__PURE__ */ z("div", {
205
+ _ && /* @__PURE__ */ B("div", {
206
206
  className: "absolute inset-0 flex flex-col items-center justify-center gap-2",
207
- children: [/* @__PURE__ */ R(E, {
207
+ children: [/* @__PURE__ */ z(D, {
208
208
  size: 60,
209
209
  stroke: S,
210
210
  "aria-hidden": !0,
211
- className: W.errorIcon
212
- }), /* @__PURE__ */ R("p", {
211
+ className: Ce.errorIcon
212
+ }), /* @__PURE__ */ z("p", {
213
213
  role: "alert",
214
- className: g("text-center", W.statusLabel),
214
+ className: g("text-center", Ce.statusLabel),
215
215
  children: t
216
216
  })]
217
217
  })
218
218
  ]
219
219
  });
220
- }, G = {
220
+ }, W = {
221
221
  viewer: "_viewer_1w97n_2",
222
222
  spreadsheetCanvas: "_spreadsheetCanvas_1w97n_6",
223
223
  formulaPanel: "_formulaPanel_1w97n_12",
@@ -225,16 +225,16 @@ var de = {
225
225
  statusOverlay: "_statusOverlay_1w97n_24",
226
226
  errorIcon: "_errorIcon_1w97n_29",
227
227
  highlight: "_highlight_1w97n_37"
228
- }, Se = (e) => {
228
+ }, Te = (e) => {
229
229
  if (e?.kind !== "range") return "";
230
230
  let { activeCell: t } = e.selection, n = e.cells.find(({ address: e }) => e.row === t.row && e.col === t.col);
231
231
  if (n == null) return "";
232
232
  let r = n.formula;
233
233
  return r == null || r.trim().length === 0 ? n.displayText : r.startsWith("=") ? r : `=${r}`;
234
- }, Ce = async (e, t, { onError: n, onXlsxSelectionContextChange: i }) => {
234
+ }, Ee = async (e, t, { onError: n, onXlsxSelectionContextChange: i }) => {
235
235
  switch (t) {
236
236
  case r.Docx: {
237
- let [{ DocxScrollViewer: t }, { chartEx: r }] = await Promise.all([import("./docx-B-VcIRoc.js"), import("./chart-ex-DsESBs97.js")]);
237
+ let [{ DocxScrollViewer: t }, { chartEx: r }] = await Promise.all([import("@silurus/ooxml/docx"), import("@silurus/ooxml/chart-ex")]);
238
238
  return new t(e, {
239
239
  enableTextSelection: !0,
240
240
  refitOnResize: !0,
@@ -243,7 +243,7 @@ var de = {
243
243
  });
244
244
  }
245
245
  case r.Xlsx: {
246
- let [{ XlsxViewer: t }, { chartEx: r }] = await Promise.all([import("./xlsx-Dn0XSlTO.js"), import("./chart-ex-DsESBs97.js")]);
246
+ let [{ XlsxViewer: t }, { chartEx: r }] = await Promise.all([import("@silurus/ooxml/xlsx"), import("@silurus/ooxml/chart-ex")]);
247
247
  return new t(e, {
248
248
  showZoomSlider: !0,
249
249
  chartEx: r,
@@ -252,8 +252,8 @@ var de = {
252
252
  });
253
253
  }
254
254
  case r.Csv: {
255
- let { XlsxSheetViewer: t } = await import("./xlsx-Dn0XSlTO.js"), r = document.createElement("canvas");
256
- r.className = G.spreadsheetCanvas, e.replaceChildren(r);
255
+ let { XlsxSheetViewer: t } = await import("@silurus/ooxml/xlsx"), r = document.createElement("canvas");
256
+ r.className = W.spreadsheetCanvas, e.replaceChildren(r);
257
257
  let i = new t(r, {
258
258
  showScrollbars: !0,
259
259
  onError: n
@@ -264,7 +264,7 @@ var de = {
264
264
  };
265
265
  }
266
266
  case r.Pptx: {
267
- let [{ PptxScrollViewer: t }, { chartEx: r }] = await Promise.all([import("./pptx-CnoDB8Fv.js"), import("./chart-ex-DsESBs97.js")]);
267
+ let [{ PptxScrollViewer: t }, { chartEx: r }] = await Promise.all([import("@silurus/ooxml/pptx"), import("@silurus/ooxml/chart-ex")]);
268
268
  return new t(e, {
269
269
  enableTextSelection: !0,
270
270
  refitOnResize: !0,
@@ -273,16 +273,16 @@ var de = {
273
273
  });
274
274
  }
275
275
  }
276
- }, we = async (e, t, n, i) => {
276
+ }, De = async (e, t, n, i) => {
277
277
  let { onError: a, onXlsxSelectionContextChange: o, onGeometryInvalidated: s } = n;
278
278
  switch (t.format) {
279
279
  case r.Docx: {
280
280
  let [{ DocxDocument: n, DocxScrollViewer: r }, { chartEx: o }, { createDocxHighlightSurface: c }] = await Promise.all([
281
- import("./docx-B-VcIRoc.js"),
282
- import("./chart-ex-DsESBs97.js"),
283
- import("./ooxml-highlight-surfaces-CaMjx8u-.js")
281
+ import("@silurus/ooxml/docx"),
282
+ import("@silurus/ooxml/chart-ex"),
283
+ import("./ooxml-highlight-surfaces-vLEREQkr.js")
284
284
  ]), l = await n.load(t.url, { chartEx: o });
285
- if (i()) throw l.destroy(), new Te();
285
+ if (i()) throw l.destroy(), new Oe();
286
286
  let u = r.fromDocument(e, l, {
287
287
  enableTextSelection: !0,
288
288
  refitOnResize: !0,
@@ -298,11 +298,11 @@ var de = {
298
298
  }
299
299
  case r.Pptx: {
300
300
  let [{ PptxPresentation: n, PptxScrollViewer: r }, { chartEx: o }, { createPptxHighlightSurface: c }] = await Promise.all([
301
- import("./pptx-CnoDB8Fv.js"),
302
- import("./chart-ex-DsESBs97.js"),
303
- import("./ooxml-highlight-surfaces-CaMjx8u-.js")
301
+ import("@silurus/ooxml/pptx"),
302
+ import("@silurus/ooxml/chart-ex"),
303
+ import("./ooxml-highlight-surfaces-vLEREQkr.js")
304
304
  ]), l = await n.load(t.url, { chartEx: o });
305
- if (i()) throw l.destroy(), new Te();
305
+ if (i()) throw l.destroy(), new Oe();
306
306
  let u = r.fromPresentation(e, l, {
307
307
  enableTextSelection: !0,
308
308
  refitOnResize: !0,
@@ -318,9 +318,9 @@ var de = {
318
318
  }
319
319
  case r.Xlsx: {
320
320
  let [{ XlsxViewer: n }, { chartEx: r }, { createXlsxHighlightSurface: c }] = await Promise.all([
321
- import("./xlsx-Dn0XSlTO.js"),
322
- import("./chart-ex-DsESBs97.js"),
323
- import("./ooxml-highlight-surfaces-CaMjx8u-.js")
321
+ import("@silurus/ooxml/xlsx"),
322
+ import("@silurus/ooxml/chart-ex"),
323
+ import("./ooxml-highlight-surfaces-vLEREQkr.js")
324
324
  ]), l = new n(e, {
325
325
  showZoomSlider: !0,
326
326
  chartEx: r,
@@ -336,12 +336,12 @@ var de = {
336
336
  };
337
337
  }
338
338
  case r.Csv: {
339
- let r = await Ce(e, t.format, n);
339
+ let r = await Ee(e, t.format, n);
340
340
  return await r.load(t.url), { viewer: r };
341
341
  }
342
342
  }
343
- }, Te = class extends Error {}, Ee = ({ content: t, fileName: n, loadErrorLabel: i, formulaLabel: a, formulaLabelClassName: o, highlightsLabel: s = "Cited locations", highlightNavigatedLabel: c = "Scrolled to the cited location" }) => {
344
- let l = I(null), [u, d] = L(!0), [f, p] = L(!1), [m, h] = L(""), [_, v] = L([]), [y, b] = L(!1), { highlights: x, selectedHighlightId: C } = t, w = x != null && x.length > 0, D = I(void 0), O = I(x);
343
+ }, Oe = class extends Error {}, ke = ({ content: t, fileName: n, loadErrorLabel: i, formulaLabel: a, formulaLabelClassName: o, highlightsLabel: s = "Cited locations", highlightNavigatedLabel: c = "Scrolled to the cited location" }) => {
344
+ let l = I(null), [u, d] = L(!0), [f, p] = L(!1), [m, h] = L(""), [_, v] = L([]), [y, b] = L(!1), { highlights: x, selectedHighlightId: C } = t, w = x != null && x.length > 0, T = I(void 0), O = I(x);
345
345
  O.current = x;
346
346
  let k = I(void 0);
347
347
  return P(() => {
@@ -366,7 +366,7 @@ var de = {
366
366
  i || (d(!1), p(!0));
367
367
  },
368
368
  onXlsxSelectionContextChange: (e) => {
369
- i || h(Se(e));
369
+ i || h(Te(e));
370
370
  },
371
371
  onGeometryInvalidated: s
372
372
  }, f = () => {
@@ -375,28 +375,28 @@ var de = {
375
375
  return e.addEventListener("scroll", s, !0), k.current = s, (async () => {
376
376
  try {
377
377
  if (w) {
378
- let r = await we(e, t, u, o);
378
+ let r = await De(e, t, u, o);
379
379
  if (i) {
380
380
  r.viewer.destroy(), r.engine?.destroy();
381
381
  return;
382
382
  }
383
- n = r, D.current = r.highlights, f();
383
+ n = r, T.current = r.highlights, f();
384
384
  } else {
385
- let r = await Ce(e, t.format, u);
385
+ let r = await Ee(e, t.format, u);
386
386
  if (i) {
387
387
  r.destroy();
388
388
  return;
389
389
  }
390
- n = { viewer: r }, D.current = void 0, f(), await r.load(t.url);
390
+ n = { viewer: r }, T.current = void 0, f(), await r.load(t.url);
391
391
  }
392
392
  if (i) return;
393
393
  d(!1), await c();
394
394
  } catch (t) {
395
- if (t instanceof Te || i) return;
396
- n?.viewer.destroy(), n?.engine?.destroy(), n = void 0, D.current = void 0, e.replaceChildren(), d(!1), p(!0);
395
+ if (t instanceof Oe || i) return;
396
+ n?.viewer.destroy(), n?.engine?.destroy(), n = void 0, T.current = void 0, e.replaceChildren(), d(!1), p(!0);
397
397
  }
398
398
  })(), () => {
399
- i = !0, e.removeEventListener("scroll", s, !0), a != null && cancelAnimationFrame(a), k.current = void 0, r?.disconnect(), n?.viewer.destroy(), n?.engine?.destroy(), D.current = void 0, e.replaceChildren();
399
+ i = !0, e.removeEventListener("scroll", s, !0), a != null && cancelAnimationFrame(a), k.current = void 0, r?.disconnect(), n?.viewer.destroy(), n?.engine?.destroy(), T.current = void 0, e.replaceChildren();
400
400
  };
401
401
  }, [
402
402
  t.format,
@@ -406,7 +406,7 @@ var de = {
406
406
  k.current?.();
407
407
  }, [x]), P(() => {
408
408
  b(!1);
409
- let t = D.current;
409
+ let t = T.current;
410
410
  if (t == null || u) return;
411
411
  let n = (O.current?.find(({ id: e }) => e === C))?.locations.at(0);
412
412
  if (n == null) return;
@@ -422,38 +422,38 @@ var de = {
422
422
  })(), () => {
423
423
  r = !0;
424
424
  };
425
- }, [C, u]), /* @__PURE__ */ z("div", {
425
+ }, [C, u]), /* @__PURE__ */ B("div", {
426
426
  className: "relative flex h-full w-full min-w-0 flex-col overflow-hidden",
427
427
  children: [
428
- t.format === r.Xlsx && /* @__PURE__ */ z("div", {
428
+ t.format === r.Xlsx && /* @__PURE__ */ B("div", {
429
429
  role: "region",
430
430
  "aria-label": a,
431
- className: g("flex min-w-0 shrink-0 items-center gap-2 border-b px-3 py-2", G.formulaPanel),
432
- children: [/* @__PURE__ */ R("span", {
431
+ className: g("flex min-w-0 shrink-0 items-center gap-2 border-b px-3 py-2", W.formulaPanel),
432
+ children: [/* @__PURE__ */ z("span", {
433
433
  "aria-hidden": "true",
434
434
  className: g("shrink-0", o),
435
435
  children: "fx"
436
- }), /* @__PURE__ */ R("code", {
436
+ }), /* @__PURE__ */ z("code", {
437
437
  dir: "ltr",
438
438
  tabIndex: 0,
439
439
  "aria-live": "polite",
440
- className: g("h-8 min-w-0 flex-1 overflow-x-auto whitespace-nowrap rounded border px-2 py-1 text-sm focus-visible:outline focus-visible:outline-focus", G.formulaValue),
440
+ className: g("h-8 min-w-0 flex-1 overflow-x-auto whitespace-nowrap rounded border px-2 py-1 text-sm focus-visible:outline focus-visible:outline-focus", W.formulaValue),
441
441
  children: m
442
442
  })]
443
443
  }),
444
- /* @__PURE__ */ z("div", {
444
+ /* @__PURE__ */ B("div", {
445
445
  className: "relative min-h-0 w-full flex-1",
446
- children: [/* @__PURE__ */ R("div", {
446
+ children: [/* @__PURE__ */ z("div", {
447
447
  ref: l,
448
448
  role: "document",
449
449
  "aria-label": n,
450
450
  "aria-busy": u,
451
- className: g("h-full w-full overflow-hidden", G.viewer)
452
- }), _.length > 0 && /* @__PURE__ */ R("div", {
451
+ className: g("h-full w-full overflow-hidden", W.viewer)
452
+ }), _.length > 0 && /* @__PURE__ */ z("div", {
453
453
  role: "region",
454
454
  "aria-label": s,
455
455
  className: "pointer-events-none absolute inset-0 overflow-hidden",
456
- children: _.map((e, t) => /* @__PURE__ */ R("div", {
456
+ children: _.map((e, t) => /* @__PURE__ */ z("div", {
457
457
  "aria-hidden": "true",
458
458
  style: {
459
459
  left: `${e.left}px`,
@@ -463,28 +463,28 @@ var de = {
463
463
  },
464
464
  "data-selected": e.highlightId === C,
465
465
  "data-clipped": e.isClippedAtEnd === !0,
466
- className: g("absolute", G.highlight)
466
+ className: g("absolute", W.highlight)
467
467
  }, `${e.highlightId}-${t}`))
468
468
  })]
469
469
  }),
470
- /* @__PURE__ */ R("div", {
470
+ /* @__PURE__ */ z("div", {
471
471
  role: "status",
472
472
  "aria-live": "polite",
473
473
  className: "sr-only",
474
474
  children: y ? c : ""
475
475
  }),
476
- (u || f) && /* @__PURE__ */ R("div", {
476
+ (u || f) && /* @__PURE__ */ z("div", {
477
477
  role: f ? "alert" : void 0,
478
478
  "aria-live": "polite",
479
- className: g("absolute inset-0 flex items-center justify-center", G.statusOverlay),
480
- children: u ? /* @__PURE__ */ R(T, { size: 48 }) : /* @__PURE__ */ z("div", {
479
+ className: g("absolute inset-0 flex items-center justify-center", W.statusOverlay),
480
+ children: u ? /* @__PURE__ */ z(E, { size: 48 }) : /* @__PURE__ */ B("div", {
481
481
  className: "flex flex-col items-center gap-2",
482
- children: [/* @__PURE__ */ R(E, {
482
+ children: [/* @__PURE__ */ z(D, {
483
483
  "aria-hidden": "true",
484
484
  size: 60,
485
485
  stroke: S,
486
- className: G.errorIcon
487
- }), /* @__PURE__ */ R("p", {
486
+ className: W.errorIcon
487
+ }), /* @__PURE__ */ z("p", {
488
488
  className: "text-center",
489
489
  children: i
490
490
  })]
@@ -492,76 +492,92 @@ var de = {
492
492
  })
493
493
  ]
494
494
  });
495
- }, De = {
495
+ }, Ae = {
496
496
  loadingOverlay: "_loadingOverlay_12637_1",
497
497
  statusLabel: "_statusLabel_12637_5",
498
498
  errorIcon: "_errorIcon_12637_9"
499
- }, Oe = ({ content: e, loadingLabel: t, errorLabel: n = "Failed to load visualizer", colors: r }) => {
500
- let i = I(null), [a, o] = L("loading"), { url: s, visualizerName: c, requestTimeout: l } = e, u = I(e);
501
- return u.current = e, P(() => {
502
- let e = i.current;
499
+ }, je = ({ content: e, loadingLabel: t, errorLabel: n = "Failed to load visualizer", frameTitle: r, colors: a }) => {
500
+ let o = I(null), [s, c] = L("loading"), { url: l, visualizerName: u, requestTimeout: d } = e, f = I(e);
501
+ return f.current = e, P(() => {
502
+ let e = o.current;
503
503
  if (!e) return;
504
- o("loading");
505
- let t = new H(e, {
506
- domain: s,
504
+ c("loading");
505
+ let t = new fe(e, {
506
+ domain: l,
507
507
  hostDomain: window.location.origin,
508
- visualizerName: c,
509
- requestTimeout: l
508
+ visualizerName: u,
509
+ requestTimeout: d
510
510
  }), n = !0;
511
511
  return (async () => {
512
512
  if (await t.ready(), !n) return;
513
- let { mimeType: e, layout: r, data: i } = u.current, a = {
514
- layout: r,
515
- ...typeof i == "object" && i ? i : {}
516
- };
517
- await t.send(V.sendVisualizeData, {
518
- mimeType: e,
519
- visualizerData: a
520
- }), n && o("ready");
513
+ let e = f.current;
514
+ if (e.type === i.GroupedVisualizer) await t.send(H.sendGroupedVisualizeData, {
515
+ attachments: e.attachments,
516
+ layout: e.layout
517
+ });
518
+ else {
519
+ let { mimeType: n, layout: r, data: i } = e, a = {
520
+ layout: r,
521
+ ...typeof i == "object" && i ? i : {}
522
+ };
523
+ await t.send(H.sendVisualizeData, {
524
+ mimeType: n,
525
+ visualizerData: a
526
+ });
527
+ }
528
+ n && c("ready");
521
529
  })().catch(() => {
522
- n && o("error");
530
+ n && c("error");
523
531
  }), () => {
524
532
  n = !1, t.destroy();
525
533
  };
526
534
  }, [
527
- s,
528
- c,
529
- l
530
- ]), /* @__PURE__ */ z("div", {
535
+ l,
536
+ u,
537
+ d
538
+ ]), P(() => {
539
+ let e = r ?? u.trim();
540
+ e !== "" && o.current?.querySelector("iframe")?.setAttribute("title", e);
541
+ }, [
542
+ r,
543
+ u,
544
+ l,
545
+ d
546
+ ]), /* @__PURE__ */ B("div", {
531
547
  className: "relative h-full w-full",
532
548
  style: m({
533
- "--vs-loading-bg": r?.loadingBackground,
534
- "--vs-status-text": r?.statusText,
535
- "--vs-error-icon": r?.errorIcon
549
+ "--vs-loading-bg": a?.loadingBackground,
550
+ "--vs-status-text": a?.statusText,
551
+ "--vs-error-icon": a?.errorIcon
536
552
  }),
537
553
  children: [
538
- /* @__PURE__ */ R("div", {
539
- ref: i,
554
+ /* @__PURE__ */ z("div", {
555
+ ref: o,
540
556
  className: "h-full w-full"
541
557
  }),
542
- a === "loading" && /* @__PURE__ */ z("div", {
543
- className: g("absolute inset-0 flex flex-col items-center justify-center gap-2", De.loadingOverlay),
544
- children: [/* @__PURE__ */ R(T, {}), t && /* @__PURE__ */ R("p", {
545
- className: g("text-center", De.statusLabel),
558
+ s === "loading" && /* @__PURE__ */ B("div", {
559
+ className: g("absolute inset-0 flex flex-col items-center justify-center gap-2", Ae.loadingOverlay),
560
+ children: [/* @__PURE__ */ z(E, {}), t && /* @__PURE__ */ z("p", {
561
+ className: g("text-center", Ae.statusLabel),
546
562
  children: t
547
563
  })]
548
564
  }),
549
- a === "error" && /* @__PURE__ */ z("div", {
565
+ s === "error" && /* @__PURE__ */ B("div", {
550
566
  className: "absolute inset-0 flex flex-col items-center justify-center gap-2",
551
- children: [/* @__PURE__ */ R(E, {
567
+ children: [/* @__PURE__ */ z(D, {
552
568
  size: 60,
553
569
  stroke: S,
554
570
  "aria-hidden": !0,
555
- className: De.errorIcon
556
- }), /* @__PURE__ */ R("p", {
571
+ className: Ae.errorIcon
572
+ }), /* @__PURE__ */ z("p", {
557
573
  role: "alert",
558
- className: g("text-center", De.statusLabel),
574
+ className: g("text-center", Ae.statusLabel),
559
575
  children: n
560
576
  })]
561
577
  })
562
578
  ]
563
579
  });
564
- }, K = {
580
+ }, G = {
565
581
  body: "_body_13ogb_4",
566
582
  statusLabel: "_statusLabel_13ogb_13",
567
583
  errorIcon: "_errorIcon_13ogb_17",
@@ -576,66 +592,66 @@ var de = {
576
592
  jsonExpandIcon: "_jsonExpandIcon_13ogb_54",
577
593
  jsonCollapseIcon: "_jsonCollapseIcon_13ogb_67",
578
594
  jsonCollapsedContent: "_jsonCollapsedContent_13ogb_84"
579
- }, ke = () => A(async () => ({ default: (await import("./PdfContent-D71LPAe3.js")).PdfContent })), Ae = ({ url: e, fileName: t, loadErrorLabel: n }) => {
595
+ }, Me = () => j(async () => ({ default: (await import("./PdfContent-DN_j6BCb.js")).PdfContent })), Ne = ({ url: e, fileName: t, loadErrorLabel: n }) => {
580
596
  let [r, i] = L(!1);
581
597
  return P(() => {
582
598
  i(!1);
583
- }, [e]), r ? /* @__PURE__ */ z("div", {
599
+ }, [e]), r ? /* @__PURE__ */ B("div", {
584
600
  className: "flex flex-col items-center gap-2",
585
- children: [/* @__PURE__ */ R(E, {
601
+ children: [/* @__PURE__ */ z(D, {
586
602
  size: 60,
587
603
  stroke: S,
588
- className: K.errorIcon
589
- }), /* @__PURE__ */ R("p", {
590
- className: g("text-center", K.statusLabel),
604
+ className: G.errorIcon
605
+ }), /* @__PURE__ */ z("p", {
606
+ className: g("text-center", G.statusLabel),
591
607
  children: n
592
608
  })]
593
- }) : /* @__PURE__ */ R("img", {
609
+ }) : /* @__PURE__ */ z("img", {
594
610
  src: e,
595
611
  alt: t ?? "",
596
612
  className: "max-h-full max-w-full object-contain",
597
613
  onError: () => i(!0)
598
614
  });
599
- }, je = new Set([
615
+ }, Pe = new Set([
600
616
  i.PlainText,
601
617
  i.Code,
602
618
  i.Ooxml
603
- ]), Me = j(({ content: e, isLoading: t = !1, fileName: r, isHtmlSourceView: a = !1, labels: { unsupportedLabel: o = "Preview is not supported for this file", loadErrorLabel: c = "Failed to load file", forbiddenErrorLabel: l = "You don't have permission to access this file", visualizerErrorLabel: d, htmlFrameBlockedLabel: f = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: h = "Open in new tab", pdfThumbnailsLabel: _, pdfShowThumbnailsLabel: v, pdfHideThumbnailsLabel: y, pdfPageNumberLabel: b, pdfContentLoadingLabel: x, pdfContentErrorLabel: C, pdfContentRetryLabel: w, xlsxFormulaLabel: D = "Formula", codeContentLoadingLabel: O, codeContentErrorLabel: k, codeContentRetryLabel: ee, tableCopyCsvLabel: te, tableCopyTxtLabel: re, tableCopyMarkdownLabel: ie, tableCopiedLabel: ae, tableDownloadCsvLabel: A, ooxmlHighlightsLabel: j, ooxmlHighlightNavigatedLabel: N } = {}, styles: P, codeBlockTheme: I, tableDownloadFilename: ce, loadPdf: B, hidePdfToolbar: le = !1, configurePdfWorker: ue }) => {
604
- let { colors: V, typography: H, bodyClassName: de, cssVars: fe } = P ?? {}, [pe, he] = L(0), _e = F(ke, [pe]), ve = M(() => {
605
- he((e) => e + 1);
606
- }, []), U = H?.fontClassName != null, ye = F(() => ({
619
+ ]), Fe = M(({ content: e, isLoading: t = !1, fileName: r, isHtmlSourceView: a = !1, labels: { unsupportedLabel: o = "Preview is not supported for this file", loadErrorLabel: c = "Failed to load file", forbiddenErrorLabel: l = "You don't have permission to access this file", visualizerErrorLabel: d, htmlFrameBlockedLabel: f = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: h = "Open in new tab", pdfThumbnailsLabel: _, pdfShowThumbnailsLabel: v, pdfHideThumbnailsLabel: y, pdfPageNumberLabel: b, pdfContentLoadingLabel: x, pdfContentErrorLabel: C, pdfContentRetryLabel: w, xlsxFormulaLabel: T = "Formula", codeContentLoadingLabel: O, codeContentErrorLabel: k, codeContentRetryLabel: ee, tableCopyLabel: te, tableCopiedLabel: ne, tableDownloadCsvLabel: re, ooxmlHighlightsLabel: ae, ooxmlHighlightNavigatedLabel: oe } = {}, styles: A, codeBlockTheme: j, tableDownloadFilename: M, loadPdf: se, hidePdfToolbar: P = !1, configurePdfWorker: I }) => {
620
+ let { colors: R, typography: V, bodyClassName: ue, cssVars: de } = A ?? {}, [H, fe] = L(0), pe = F(Me, [H]), me = N(() => {
621
+ fe((e) => e + 1);
622
+ }, []), U = V?.fontClassName != null, ge = F(() => ({
607
623
  ...m({
608
- "--ac-text": V?.text,
609
- "--ac-status-text": V?.statusText,
610
- "--ac-error-icon": V?.errorIcon,
611
- "--ac-open-in-new-tab-text": V?.openInNewTabText,
612
- "--ac-json-border": V?.jsonBorder,
613
- "--ac-json-bg": V?.jsonBackground,
614
- "--ac-json-label": V?.jsonLabel,
615
- "--ac-json-clickable-label": V?.jsonClickableLabel,
616
- "--ac-json-punctuation": V?.jsonPunctuation,
617
- "--ac-json-string": V?.jsonString,
618
- "--ac-json-number": V?.jsonNumber,
619
- "--ac-json-boolean": V?.jsonBoolean,
620
- "--ac-json-null": V?.jsonNull,
621
- "--ac-json-toggle-icon": V?.jsonToggleIcon,
622
- "--ac-json-toggle-icon-hover": V?.jsonToggleIconHover,
623
- "--ac-ooxml-bg": V?.ooxmlBackground,
624
- "--ac-ooxml-formula-border": V?.ooxmlFormulaBorder,
625
- "--ac-ooxml-formula-bg": V?.ooxmlFormulaBackground,
626
- "--ac-ooxml-formula-text": V?.ooxmlFormulaText,
627
- "--ac-ooxml-highlight-border": V?.ooxmlHighlightBorder,
628
- "--ac-ooxml-highlight-bg": V?.ooxmlHighlightBackground,
629
- "--ac-json-collapsed-text": V?.jsonCollapsedText,
630
- "--ac-json-collapsed-bg": V?.jsonCollapsedBackground,
631
- "--ac-font-family": U ? void 0 : H?.fontFamily,
632
- "--ac-font-size": U ? void 0 : H?.fontSize,
633
- "--ac-font-weight": U ? void 0 : H?.fontWeight,
634
- "--ac-line-height": U ? void 0 : H?.lineHeight,
635
- "--ac-letter-spacing": U ? void 0 : H?.letterSpacing
624
+ "--ac-text": R?.text,
625
+ "--ac-status-text": R?.statusText,
626
+ "--ac-error-icon": R?.errorIcon,
627
+ "--ac-open-in-new-tab-text": R?.openInNewTabText,
628
+ "--ac-json-border": R?.jsonBorder,
629
+ "--ac-json-bg": R?.jsonBackground,
630
+ "--ac-json-label": R?.jsonLabel,
631
+ "--ac-json-clickable-label": R?.jsonClickableLabel,
632
+ "--ac-json-punctuation": R?.jsonPunctuation,
633
+ "--ac-json-string": R?.jsonString,
634
+ "--ac-json-number": R?.jsonNumber,
635
+ "--ac-json-boolean": R?.jsonBoolean,
636
+ "--ac-json-null": R?.jsonNull,
637
+ "--ac-json-toggle-icon": R?.jsonToggleIcon,
638
+ "--ac-json-toggle-icon-hover": R?.jsonToggleIconHover,
639
+ "--ac-ooxml-bg": R?.ooxmlBackground,
640
+ "--ac-ooxml-formula-border": R?.ooxmlFormulaBorder,
641
+ "--ac-ooxml-formula-bg": R?.ooxmlFormulaBackground,
642
+ "--ac-ooxml-formula-text": R?.ooxmlFormulaText,
643
+ "--ac-ooxml-highlight-border": R?.ooxmlHighlightBorder,
644
+ "--ac-ooxml-highlight-bg": R?.ooxmlHighlightBackground,
645
+ "--ac-json-collapsed-text": R?.jsonCollapsedText,
646
+ "--ac-json-collapsed-bg": R?.jsonCollapsedBackground,
647
+ "--ac-font-family": U ? void 0 : V?.fontFamily,
648
+ "--ac-font-size": U ? void 0 : V?.fontSize,
649
+ "--ac-font-weight": U ? void 0 : V?.fontWeight,
650
+ "--ac-line-height": U ? void 0 : V?.lineHeight,
651
+ "--ac-letter-spacing": U ? void 0 : V?.letterSpacing
636
652
  }),
637
- ...fe
638
- }), [P]), be = F(() => {
653
+ ...de
654
+ }), [A]), ve = F(() => {
639
655
  switch (e.type) {
640
656
  case i.Image:
641
657
  case i.Audio:
@@ -645,6 +661,7 @@ var de = {
645
661
  case i.Pdf:
646
662
  case i.Ooxml:
647
663
  case i.Visualizer:
664
+ case i.GroupedVisualizer:
648
665
  case i.McpApp:
649
666
  case i.Code:
650
667
  case i.Html: return "h-full overflow-hidden";
@@ -652,38 +669,38 @@ var de = {
652
669
  case i.MarkdownTable: return "flex h-full min-h-0 flex-col overflow-hidden p-4";
653
670
  default: return "h-full overflow-auto p-4";
654
671
  }
655
- }, [e.type]), W = F(() => {
672
+ }, [e.type]), ye = F(() => {
656
673
  switch (e.type) {
657
- case i.PlainText: return /* @__PURE__ */ R("pre", {
658
- className: g("whitespace-pre-wrap break-words", K.body, H?.fontClassName),
674
+ case i.PlainText: return /* @__PURE__ */ z("pre", {
675
+ className: g("whitespace-pre-wrap break-words", G.body, V?.fontClassName),
659
676
  children: e.text
660
677
  });
661
- case i.Image: return /* @__PURE__ */ R(Ae, {
678
+ case i.Image: return /* @__PURE__ */ z(Ne, {
662
679
  url: e.url,
663
680
  fileName: r,
664
681
  loadErrorLabel: c
665
682
  });
666
- case i.Audio: return /* @__PURE__ */ R("audio", {
683
+ case i.Audio: return /* @__PURE__ */ z("audio", {
667
684
  controls: !0,
668
685
  src: e.url,
669
686
  "aria-label": r ?? "Audio attachment",
670
687
  className: "w-full max-w-sm",
671
688
  preload: "metadata",
672
- children: e.mimeType && /* @__PURE__ */ R("source", {
689
+ children: e.mimeType && /* @__PURE__ */ z("source", {
673
690
  src: e.url,
674
691
  type: e.mimeType
675
692
  })
676
693
  });
677
- case i.Markdown: return /* @__PURE__ */ R(p, {
694
+ case i.Markdown: return /* @__PURE__ */ z(p, {
678
695
  content: e.text,
679
696
  isStreaming: !1,
680
- codeBlockTheme: I,
697
+ codeBlockTheme: j,
681
698
  classNames: u
682
699
  });
683
- case i.MarkdownTable: return /* @__PURE__ */ R(p, {
700
+ case i.MarkdownTable: return /* @__PURE__ */ z(p, {
684
701
  content: e.text,
685
702
  isStreaming: !1,
686
- codeBlockTheme: I,
703
+ codeBlockTheme: j,
687
704
  containerClassName: "flex h-full min-h-0 flex-col",
688
705
  classNames: {
689
706
  ...u,
@@ -691,51 +708,49 @@ var de = {
691
708
  tableScrollContainer: "max-h-full"
692
709
  },
693
710
  tableActionLabels: {
694
- copyCsvLabel: te,
695
- copyTxtLabel: re,
696
- copyMarkdownLabel: ie,
697
- copiedLabel: ae,
698
- downloadCsvLabel: A
711
+ copyLabel: te,
712
+ copiedLabel: ne,
713
+ downloadCsvLabel: re
699
714
  },
700
- tableDownloadFilename: ce
715
+ tableDownloadFilename: M
701
716
  });
702
- case i.Json: return /* @__PURE__ */ R("div", {
717
+ case i.Json: return /* @__PURE__ */ z("div", {
703
718
  dir: "ltr",
704
719
  className: "h-full overflow-auto",
705
- children: /* @__PURE__ */ R("div", {
706
- className: g("m-3 overflow-auto rounded-md border", K.jsonWrapper),
707
- children: /* @__PURE__ */ R(oe, {
720
+ children: /* @__PURE__ */ z("div", {
721
+ className: g("m-3 overflow-auto rounded-md border", G.jsonWrapper),
722
+ children: /* @__PURE__ */ z(ce, {
708
723
  data: e.value,
709
724
  style: {
710
- container: g("whitespace-pre-wrap break-words p-2", H?.jsonClassName ?? "dial-code-text"),
711
- basicChildStyle: se.basicChildStyle,
725
+ container: g("whitespace-pre-wrap break-words p-2", V?.jsonClassName ?? "dial-code-text"),
726
+ basicChildStyle: le.basicChildStyle,
712
727
  childFieldsContainer: "m-0 ps-3",
713
- label: g("me-1 font-semibold", K.jsonLabel),
714
- clickableLabel: g("me-1 cursor-pointer font-semibold hover:underline", K.jsonClickableLabel),
715
- nullValue: g("italic", K.jsonNullValue),
716
- undefinedValue: g("italic", K.jsonNullValue),
717
- stringValue: K.jsonStringValue,
718
- booleanValue: K.jsonBooleanValue,
719
- numberValue: K.jsonNumberValue,
720
- otherValue: g("italic", K.jsonNullValue),
721
- punctuation: g("me-1", K.jsonPunctuation),
722
- collapseIcon: g("me-1 cursor-pointer select-none transition-colors", K.jsonCollapseIcon),
723
- expandIcon: g("me-1 cursor-pointer select-none transition-colors", K.jsonExpandIcon),
724
- collapsedContent: g("me-1 cursor-pointer rounded px-1", K.jsonCollapsedContent)
728
+ label: g("me-1 font-semibold", G.jsonLabel),
729
+ clickableLabel: g("me-1 cursor-pointer font-semibold hover:underline", G.jsonClickableLabel),
730
+ nullValue: g("italic", G.jsonNullValue),
731
+ undefinedValue: g("italic", G.jsonNullValue),
732
+ stringValue: G.jsonStringValue,
733
+ booleanValue: G.jsonBooleanValue,
734
+ numberValue: G.jsonNumberValue,
735
+ otherValue: g("italic", G.jsonNullValue),
736
+ punctuation: g("me-1", G.jsonPunctuation),
737
+ collapseIcon: g("me-1 cursor-pointer select-none transition-colors", G.jsonCollapseIcon),
738
+ expandIcon: g("me-1 cursor-pointer select-none transition-colors", G.jsonExpandIcon),
739
+ collapsedContent: g("me-1 cursor-pointer rounded px-1", G.jsonCollapsedContent)
725
740
  }
726
741
  })
727
742
  })
728
743
  });
729
- case i.Code: return /* @__PURE__ */ R(me, {
744
+ case i.Code: return /* @__PURE__ */ z(he, {
730
745
  content: e,
731
- codeBlockTheme: I,
746
+ codeBlockTheme: j,
732
747
  labels: {
733
748
  loadingLabel: O,
734
749
  errorLabel: k,
735
750
  retryLabel: ee
736
751
  }
737
752
  });
738
- case i.Html: return /* @__PURE__ */ R(ge, {
753
+ case i.Html: return /* @__PURE__ */ z(_e, {
739
754
  content: e,
740
755
  labels: {
741
756
  htmlFrameBlockedLabel: f,
@@ -743,25 +758,25 @@ var de = {
743
758
  },
744
759
  isSourceView: a,
745
760
  title: r,
746
- codeBlockTheme: I
761
+ codeBlockTheme: j
747
762
  });
748
- case i.Pdf: return /* @__PURE__ */ R(s, {
749
- retryKey: pe,
750
- onRetry: ve,
763
+ case i.Pdf: return /* @__PURE__ */ z(s, {
764
+ retryKey: H,
765
+ onRetry: me,
751
766
  labels: {
752
767
  loadingLabel: x,
753
768
  errorLabel: C,
754
769
  retryLabel: w
755
770
  },
756
- children: /* @__PURE__ */ R(_e, {
771
+ children: /* @__PURE__ */ z(pe, {
757
772
  fileName: r,
758
773
  url: e.url,
759
774
  highlights: e.highlights ?? [],
760
775
  selectedHighlightId: e.selectedHighlightId,
761
776
  selectedPageNumber: e.page,
762
- loadPdf: B,
763
- hideHeader: le,
764
- configurePdfWorker: ue,
777
+ loadPdf: se,
778
+ hideHeader: P,
779
+ configurePdfWorker: I,
765
780
  labels: {
766
781
  thumbnailsLabel: _,
767
782
  showThumbnailsLabel: v,
@@ -773,34 +788,35 @@ var de = {
773
788
  }
774
789
  })
775
790
  }, e.url);
776
- case i.Ooxml: return /* @__PURE__ */ R(Ee, {
791
+ case i.Ooxml: return /* @__PURE__ */ z(ke, {
777
792
  content: e,
778
793
  fileName: r,
779
794
  loadErrorLabel: c,
780
- formulaLabel: D,
781
- formulaLabelClassName: H?.xlsxFormulaLabelClassName ?? "dial-italic-text",
782
- highlightsLabel: j,
783
- highlightNavigatedLabel: N
795
+ formulaLabel: T,
796
+ formulaLabelClassName: V?.xlsxFormulaLabelClassName ?? "dial-italic-text",
797
+ highlightsLabel: ae,
798
+ highlightNavigatedLabel: oe
784
799
  });
785
- case i.Visualizer: return /* @__PURE__ */ R(Oe, {
800
+ case i.Visualizer:
801
+ case i.GroupedVisualizer: return /* @__PURE__ */ z(je, {
786
802
  content: e,
787
803
  errorLabel: d
788
804
  });
789
- case i.McpApp: return /* @__PURE__ */ R(xe, { content: e });
790
- case i.Unsupported: return /* @__PURE__ */ R("p", {
791
- className: g("text-center", K.statusLabel),
805
+ case i.McpApp: return /* @__PURE__ */ z(we, { content: e });
806
+ case i.Unsupported: return /* @__PURE__ */ z("p", {
807
+ className: g("text-center", G.statusLabel),
792
808
  children: o
793
809
  });
794
810
  case i.Error: {
795
811
  let t = e.errorType === n.Forbidden;
796
- return /* @__PURE__ */ z("div", {
812
+ return /* @__PURE__ */ B("div", {
797
813
  className: "flex flex-col items-center gap-2",
798
- children: [R(t ? ne : E, {
814
+ children: [z(t ? ie : D, {
799
815
  size: 60,
800
816
  stroke: S,
801
- className: K.errorIcon
802
- }), /* @__PURE__ */ R("p", {
803
- className: g("text-center", K.statusLabel),
817
+ className: G.errorIcon
818
+ }), /* @__PURE__ */ z("p", {
819
+ className: g("text-center", G.statusLabel),
804
820
  children: t ? l : c
805
821
  })]
806
822
  });
@@ -808,11 +824,11 @@ var de = {
808
824
  }
809
825
  }, [
810
826
  e,
811
- H?.fontClassName,
812
- H?.jsonClassName,
813
- H?.xlsxFormulaLabelClassName,
827
+ V?.fontClassName,
828
+ V?.jsonClassName,
829
+ V?.xlsxFormulaLabelClassName,
814
830
  r,
815
- I,
831
+ j,
816
832
  o,
817
833
  c,
818
834
  l,
@@ -820,10 +836,10 @@ var de = {
820
836
  f,
821
837
  h,
822
838
  a,
823
- ce,
824
- B,
825
- le,
826
- ue,
839
+ M,
840
+ se,
841
+ P,
842
+ I,
827
843
  _,
828
844
  v,
829
845
  y,
@@ -831,45 +847,43 @@ var de = {
831
847
  x,
832
848
  C,
833
849
  w,
834
- D,
850
+ T,
835
851
  O,
836
852
  k,
837
853
  ee,
838
- _e,
839
854
  pe,
840
- ve,
855
+ H,
856
+ me,
841
857
  te,
858
+ ne,
842
859
  re,
843
- ie,
844
860
  ae,
845
- A,
846
- j,
847
- N
861
+ oe
848
862
  ]);
849
- return /* @__PURE__ */ R("div", {
850
- style: !t && je.has(e.type) ? ye : void 0,
851
- className: g(t ? "flex h-full items-center justify-center" : be, de),
852
- children: t ? /* @__PURE__ */ R(T, {}) : W
863
+ return /* @__PURE__ */ z("div", {
864
+ style: !t && Pe.has(e.type) ? ge : void 0,
865
+ className: g(t ? "flex h-full items-center justify-center" : ve, ue),
866
+ children: t ? /* @__PURE__ */ z(E, {}) : ye
853
867
  });
854
- }), Ne = 2e3, Pe = j(({ isOpen: e, isLoading: t = !1, onClose: n, content: r, fileName: a, labels: { ariaLabel: s, closeLabel: c = "Close", resizeLabel: l = "Resize panel", downloadLabel: u = "Download", copyTextLabel: d = "Copy text", copiedTextLabel: f = "Copied!", copyMarkdownLabel: p = "Copy as Markdown", copiedMarkdownLabel: m = "Copied!", copyJsonLabel: h = "Copy as JSON", copiedJsonLabel: _ = "Copied!", visualizerErrorLabel: v, unsupportedLabel: w = "Preview is not supported for this file", loadErrorLabel: T = "Failed to load file", forbiddenErrorLabel: E = "You don't have permission to access this file", htmlFrameBlockedLabel: ne = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: ae = "Open in new tab", htmlViewSourceLabel: A = "View source", htmlViewRenderedLabel: j = "View rendered", mcpAppReloadLabel: N = "Reload", pdfThumbnailsLabel: F, pdfShowThumbnailsLabel: oe, pdfHideThumbnailsLabel: se, pdfPageNumberLabel: B, pdfContentLoadingLabel: le, pdfContentErrorLabel: ue, pdfContentRetryLabel: V, xlsxFormulaLabel: H, codeContentLoadingLabel: de, codeContentErrorLabel: fe, codeContentRetryLabel: pe, tableCopyCsvLabel: me, tableCopyTxtLabel: he, tableCopyMarkdownLabel: ge, tableCopiedLabel: _e, tableDownloadCsvLabel: ve, ooxmlHighlightsLabel: U, ooxmlHighlightNavigatedLabel: ye }, onDownload: be, onCopyText: W, onCopyMarkdown: xe, onCopyJson: G, tableDownloadFilename: Se, isMobile: Ce = !1, defaultWidth: we, minWidth: Te = 600, maxWidth: Ee = 1500, onResizeStop: De, styles: Oe, codeBlockTheme: K, loadPdf: ke, configurePdfWorker: Ae }) => {
855
- let [je, Pe] = L(!1), [Fe, Ie] = L(!1), [q, Le] = L(!1), [J, Re] = L(!1), Y = I(null), X = I(null), Z = I(null), ze = M(() => {
856
- W?.(), Y.current != null && clearTimeout(Y.current), Pe(!0), Y.current = setTimeout(() => Pe(!1), Ne);
857
- }, [W]), Be = M(() => {
858
- xe?.(), X.current != null && clearTimeout(X.current), Ie(!0), X.current = setTimeout(() => Ie(!1), Ne);
859
- }, [xe]), Ve = M(() => {
860
- G?.(), Z.current != null && clearTimeout(Z.current), Le(!0), Z.current = setTimeout(() => Le(!1), Ne);
861
- }, [G]);
868
+ }), Ie = 2e3, Le = M(({ isOpen: e, isLoading: t = !1, onClose: n, content: r, fileName: a, labels: { ariaLabel: s, closeLabel: c = "Close", resizeLabel: l = "Resize panel", downloadLabel: u = "Download", copyTextLabel: d = "Copy text", copiedTextLabel: f = "Copied!", copyMarkdownLabel: p = "Copy as Markdown", copiedMarkdownLabel: m = "Copied!", copyJsonLabel: h = "Copy as JSON", copiedJsonLabel: _ = "Copied!", visualizerErrorLabel: v, unsupportedLabel: C = "Preview is not supported for this file", loadErrorLabel: T = "Failed to load file", forbiddenErrorLabel: E = "You don't have permission to access this file", htmlFrameBlockedLabel: D = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: O = "Open in new tab", htmlViewSourceLabel: ie = "View source", htmlViewRenderedLabel: A = "View rendered", mcpAppReloadLabel: j = "Reload", pdfThumbnailsLabel: M, pdfShowThumbnailsLabel: se, pdfHideThumbnailsLabel: F, pdfPageNumberLabel: ce, pdfContentLoadingLabel: le, pdfContentErrorLabel: V, pdfContentRetryLabel: ue, xlsxFormulaLabel: de, codeContentLoadingLabel: H, codeContentErrorLabel: fe, codeContentRetryLabel: pe, tableCopyLabel: me, tableCopiedLabel: U, tableDownloadCsvLabel: he, ooxmlHighlightsLabel: ge, ooxmlHighlightNavigatedLabel: _e }, onDownload: ve, onCopyText: ye, onCopyMarkdown: be, onCopyJson: xe, tableDownloadFilename: Se, isMobile: Ce = !1, defaultWidth: we, minWidth: W = 600, maxWidth: Te = 1500, onResizeStop: Ee, styles: De, codeBlockTheme: Oe, loadPdf: ke, configurePdfWorker: Ae }) => {
869
+ let [je, G] = L(!1), [Me, Ne] = L(!1), [Pe, Le] = L(!1), [K, q] = L(!1), J = I(null), Y = I(null), X = I(null), Re = N(() => {
870
+ ye?.(), J.current != null && clearTimeout(J.current), G(!0), J.current = setTimeout(() => G(!1), Ie);
871
+ }, [ye]), Z = N(() => {
872
+ be?.(), Y.current != null && clearTimeout(Y.current), Ne(!0), Y.current = setTimeout(() => Ne(!1), Ie);
873
+ }, [be]), ze = N(() => {
874
+ xe?.(), X.current != null && clearTimeout(X.current), Le(!0), X.current = setTimeout(() => Le(!1), Ie);
875
+ }, [xe]);
862
876
  P(() => () => {
863
- Y.current != null && clearTimeout(Y.current), X.current != null && clearTimeout(X.current), Z.current != null && clearTimeout(Z.current);
877
+ J.current != null && clearTimeout(J.current), Y.current != null && clearTimeout(Y.current), X.current != null && clearTimeout(X.current);
864
878
  }, []);
865
- let Q = M(() => {
866
- Re((e) => !e);
879
+ let Be = N(() => {
880
+ q((e) => !e);
867
881
  }, []);
868
882
  P(() => {
869
- Re(!1);
883
+ q(!1);
870
884
  }, [r]);
871
- let { className: He, panelStyles: Ue, ...We } = Oe ?? {}, Ge = !t && r.type === i.Html && r.srcdoc != null, Ke = !t && W != null && (r.type === i.PlainText || r.type === i.Code), qe = !t && xe != null && r.type === i.Markdown, $ = !t && G != null && r.type === i.Json, Je = !t && be != null && o(r), Ye = !t && r.type === i.McpApp && r.onReload != null;
872
- return /* @__PURE__ */ R(b, {
885
+ let { className: Ve, panelStyles: Q, ...He } = De ?? {}, Ue = !t && r.type === i.Html && r.srcdoc != null, $ = !t && ye != null && (r.type === i.PlainText || r.type === i.Code), We = !t && be != null && r.type === i.Markdown, Ge = !t && xe != null && r.type === i.Json, Ke = !t && ve != null && o(r), qe = !t && r.type === i.McpApp && r.onReload != null;
886
+ return /* @__PURE__ */ z(b, {
873
887
  isOpen: e,
874
888
  orientation: y.Right,
875
889
  title: a,
@@ -881,259 +895,150 @@ var de = {
881
895
  onClose: n,
882
896
  resizable: !Ce,
883
897
  defaultWidth: we,
884
- minWidth: Te,
885
- maxWidth: Ee,
886
- onResizeStop: De,
898
+ minWidth: W,
899
+ maxWidth: Te,
900
+ onResizeStop: Ee,
887
901
  styles: {
888
- ...Ue,
889
- titleClassName: Ue?.titleClassName ?? "dial-h3-text",
890
- headerClassName: g("border-b border-tertiary", Ue?.headerClassName),
891
- className: g(e ? "mobile:w-full mobile:max-w-full" : "w-0", He, Ue?.className)
902
+ ...Q,
903
+ titleClassName: Q?.titleClassName ?? "dial-h3-text",
904
+ headerClassName: g("border-b border-tertiary", Q?.headerClassName),
905
+ className: g(e ? "mobile:w-full mobile:max-w-full" : "w-0", Ve, Q?.className)
892
906
  },
893
- rightActions: Ge || Ke || qe || $ || Je || Ye ? /* @__PURE__ */ z(ce, { children: [
894
- Ye && /* @__PURE__ */ R(C, {
895
- icon: /* @__PURE__ */ R(ie, {
907
+ rightActions: Ue || $ || We || Ge || Ke || qe ? /* @__PURE__ */ B(R, { children: [
908
+ qe && /* @__PURE__ */ z(w, {
909
+ icon: /* @__PURE__ */ z(oe, {
896
910
  size: x.LG,
897
911
  stroke: S,
898
912
  "aria-hidden": !0
899
913
  }),
900
- "aria-label": N,
901
- tooltipProps: { tooltip: N },
914
+ "aria-label": j,
915
+ tooltipProps: { tooltip: j },
902
916
  onClick: r.type === i.McpApp ? r.onReload : void 0
903
917
  }),
904
- Ge && /* @__PURE__ */ R(C, {
905
- icon: R(J ? te : O, {
918
+ Ue && /* @__PURE__ */ z(w, {
919
+ icon: z(K ? re : ee, {
906
920
  size: x.LG,
907
921
  stroke: S,
908
922
  "aria-hidden": !0
909
923
  }),
910
- "aria-label": J ? j : A,
911
- "aria-pressed": J,
912
- tooltipProps: { tooltip: J ? j : A },
913
- onClick: Q
924
+ "aria-label": K ? A : ie,
925
+ "aria-pressed": K,
926
+ tooltipProps: { tooltip: K ? A : ie },
927
+ onClick: Be
914
928
  }),
915
- Ke && /* @__PURE__ */ R(C, {
916
- icon: R(je ? D : k, {
929
+ $ && /* @__PURE__ */ z(w, {
930
+ icon: z(je ? k : te, {
917
931
  size: x.LG,
918
932
  stroke: S,
919
933
  "aria-hidden": !0
920
934
  }),
921
935
  "aria-label": je ? f : d,
922
936
  tooltipProps: { tooltip: je ? f : d },
923
- onClick: ze
937
+ onClick: Re
924
938
  }),
925
- qe && /* @__PURE__ */ R(C, {
926
- icon: R(Fe ? D : re, {
939
+ We && /* @__PURE__ */ z(w, {
940
+ icon: z(Me ? k : ae, {
927
941
  size: x.LG,
928
942
  stroke: S,
929
943
  "aria-hidden": !0
930
944
  }),
931
- "aria-label": Fe ? m : p,
932
- tooltipProps: { tooltip: Fe ? m : p },
933
- onClick: Be
945
+ "aria-label": Me ? m : p,
946
+ tooltipProps: { tooltip: Me ? m : p },
947
+ onClick: Z
934
948
  }),
935
- $ && /* @__PURE__ */ R(C, {
936
- icon: R(q ? D : k, {
949
+ Ge && /* @__PURE__ */ z(w, {
950
+ icon: z(Pe ? k : te, {
937
951
  size: x.LG,
938
952
  stroke: S,
939
953
  "aria-hidden": !0
940
954
  }),
941
- "aria-label": q ? _ : h,
942
- tooltipProps: { tooltip: q ? _ : h },
943
- onClick: Ve
955
+ "aria-label": Pe ? _ : h,
956
+ tooltipProps: { tooltip: Pe ? _ : h },
957
+ onClick: ze
944
958
  }),
945
- Je && /* @__PURE__ */ R(C, {
946
- icon: /* @__PURE__ */ R(ee, {
959
+ Ke && /* @__PURE__ */ z(w, {
960
+ icon: /* @__PURE__ */ z(ne, {
947
961
  size: x.LG,
948
962
  stroke: S
949
963
  }),
950
964
  "aria-label": u,
951
965
  tooltipProps: { tooltip: u },
952
- onClick: be
966
+ onClick: ve
953
967
  })
954
968
  ] }) : null,
955
- children: /* @__PURE__ */ R(Me, {
969
+ children: /* @__PURE__ */ z(Fe, {
956
970
  content: r,
957
971
  isLoading: t,
958
972
  fileName: a,
959
- isHtmlSourceView: J,
973
+ isHtmlSourceView: K,
960
974
  labels: {
961
- unsupportedLabel: w,
975
+ unsupportedLabel: C,
962
976
  loadErrorLabel: T,
963
977
  forbiddenErrorLabel: E,
964
978
  visualizerErrorLabel: v,
965
- htmlFrameBlockedLabel: ne,
966
- htmlOpenInNewTabLabel: ae,
967
- pdfThumbnailsLabel: F,
968
- pdfShowThumbnailsLabel: oe,
969
- pdfHideThumbnailsLabel: se,
970
- pdfPageNumberLabel: B,
979
+ htmlFrameBlockedLabel: D,
980
+ htmlOpenInNewTabLabel: O,
981
+ pdfThumbnailsLabel: M,
982
+ pdfShowThumbnailsLabel: se,
983
+ pdfHideThumbnailsLabel: F,
984
+ pdfPageNumberLabel: ce,
971
985
  pdfContentLoadingLabel: le,
972
- pdfContentErrorLabel: ue,
973
- pdfContentRetryLabel: V,
974
- xlsxFormulaLabel: H,
975
- codeContentLoadingLabel: de,
986
+ pdfContentErrorLabel: V,
987
+ pdfContentRetryLabel: ue,
988
+ xlsxFormulaLabel: de,
989
+ codeContentLoadingLabel: H,
976
990
  codeContentErrorLabel: fe,
977
991
  codeContentRetryLabel: pe,
978
- tableCopyCsvLabel: me,
979
- tableCopyTxtLabel: he,
980
- tableCopyMarkdownLabel: ge,
981
- tableCopiedLabel: _e,
982
- tableDownloadCsvLabel: ve,
983
- ooxmlHighlightsLabel: U,
984
- ooxmlHighlightNavigatedLabel: ye
992
+ tableCopyLabel: me,
993
+ tableCopiedLabel: U,
994
+ tableDownloadCsvLabel: he,
995
+ ooxmlHighlightsLabel: ge,
996
+ ooxmlHighlightNavigatedLabel: _e
985
997
  },
986
- styles: We,
987
- codeBlockTheme: K,
998
+ styles: He,
999
+ codeBlockTheme: Oe,
988
1000
  tableDownloadFilename: Se,
989
1001
  loadPdf: ke,
990
1002
  configurePdfWorker: Ae
991
1003
  })
992
1004
  });
993
- }), Fe = {
994
- type: i.PlainText,
995
- text: ""
996
- }, Ie = (e) => {
997
- if (!(e.type !== i.Image && e.type !== i.Audio && e.type !== i.Pdf && e.type !== i.Ooxml)) return e.url.startsWith("blob:") ? e.url : void 0;
998
- }, q = ae(void 0);
999
- q.displayName = "AttachmentCanvasContext";
1000
- var Le = ({ children: e }) => {
1001
- let [t, n] = L(!1), [r, i] = L(!1), [a, o] = L(Fe), [s, c] = L(void 0), [l, u] = L(void 0), d = M((e, t) => {
1002
- c(e), u(t), i(!0), n(!0);
1003
- }, []), f = M((e, t, r) => {
1004
- o(e), c(t), u(r), i(!1), n(!0);
1005
- }, []), p = M(() => {
1006
- o(Fe), n(!1), i(!1), u(void 0);
1007
- }, []);
1008
- return P(() => () => {
1009
- let e = Ie(a);
1010
- e != null && URL.revokeObjectURL(e);
1011
- }, [a]), /* @__PURE__ */ R(q.Provider, {
1012
- value: F(() => ({
1013
- isOpen: t,
1014
- isLoading: r,
1015
- content: a,
1016
- fileName: s,
1017
- attachmentId: l,
1018
- openCanvasLoading: d,
1019
- openCanvas: f,
1020
- closeCanvas: p
1021
- }), [
1022
- t,
1023
- r,
1024
- a,
1025
- s,
1026
- l,
1027
- d,
1028
- f,
1029
- p
1030
- ]),
1031
- children: e
1032
- });
1033
- }, J = () => {
1034
- let e = N(q);
1035
- if (!e) throw Error("useAttachmentCanvas must be used within an AttachmentCanvasProvider");
1036
- return e;
1037
- }, Re = j(({ labels: e, isMobile: t = !1, defaultWidth: n, maxWidth: r, codeBlockTheme: o, tableDownloadFilename: s, configurePdfWorker: c }) => {
1038
- let { ariaLabel: l = "Attachment preview", closeLabel: u = "Close", downloadLabel: d = "Download", unsupportedLabel: f = "Preview is not supported for this file", loadErrorLabel: p = "Failed to load file", forbiddenErrorLabel: m = "You don't have permission to access this file", copyTextLabel: g, copiedTextLabel: _, copyMarkdownLabel: v, copiedMarkdownLabel: y, copyJsonLabel: b, copiedJsonLabel: x, htmlFrameBlockedLabel: S, htmlOpenInNewTabLabel: C, htmlViewSourceLabel: w, htmlViewRenderedLabel: T, pdfThumbnailsLabel: E, pdfShowThumbnailsLabel: D, pdfHideThumbnailsLabel: O, pdfPageNumberLabel: k, pdfContentLoadingLabel: ee, pdfContentErrorLabel: te, pdfContentRetryLabel: ne, xlsxFormulaLabel: re, codeContentLoadingLabel: ie, codeContentErrorLabel: ae, codeContentRetryLabel: A, tableCopyCsvLabel: j, tableCopyTxtLabel: N, tableCopyMarkdownLabel: P, tableCopiedLabel: F, tableDownloadCsvLabel: I, ooxmlHighlightsLabel: L, ooxmlHighlightNavigatedLabel: oe } = e ?? {}, { isOpen: se, isLoading: ce, content: z, fileName: B, closeCanvas: le } = J(), ue = M(() => {
1039
- a(z, B);
1040
- }, [z, B]), V = M(() => {
1041
- (z.type === i.PlainText || z.type === i.Code) && h(z.text);
1042
- }, [z]), H = M(() => {
1043
- z.type === i.Markdown && h(z.text);
1044
- }, [z]), de = M(() => {
1045
- z.type === i.Json && h(JSON.stringify(z.value, null, 2));
1046
- }, [z]);
1047
- return /* @__PURE__ */ R(Pe, {
1048
- isOpen: se,
1049
- isLoading: ce,
1050
- onClose: le,
1051
- content: z,
1052
- fileName: B,
1053
- labels: {
1054
- ariaLabel: l,
1055
- closeLabel: u,
1056
- downloadLabel: d,
1057
- copyTextLabel: g,
1058
- copiedTextLabel: _,
1059
- copyMarkdownLabel: v,
1060
- copiedMarkdownLabel: y,
1061
- copyJsonLabel: b,
1062
- copiedJsonLabel: x,
1063
- unsupportedLabel: f,
1064
- loadErrorLabel: p,
1065
- forbiddenErrorLabel: m,
1066
- htmlFrameBlockedLabel: S,
1067
- htmlOpenInNewTabLabel: C,
1068
- htmlViewSourceLabel: w,
1069
- htmlViewRenderedLabel: T,
1070
- pdfThumbnailsLabel: E,
1071
- pdfShowThumbnailsLabel: D,
1072
- pdfHideThumbnailsLabel: O,
1073
- pdfPageNumberLabel: k,
1074
- pdfContentLoadingLabel: ee,
1075
- pdfContentErrorLabel: te,
1076
- pdfContentRetryLabel: ne,
1077
- xlsxFormulaLabel: re,
1078
- codeContentLoadingLabel: ie,
1079
- codeContentErrorLabel: ae,
1080
- codeContentRetryLabel: A,
1081
- tableCopyCsvLabel: j,
1082
- tableCopyTxtLabel: N,
1083
- tableCopyMarkdownLabel: P,
1084
- tableCopiedLabel: F,
1085
- tableDownloadCsvLabel: I,
1086
- ooxmlHighlightsLabel: L,
1087
- ooxmlHighlightNavigatedLabel: oe
1088
- },
1089
- onDownload: ue,
1090
- onCopyText: z.type === i.PlainText || z.type === i.Code ? V : void 0,
1091
- onCopyMarkdown: z.type === i.Markdown ? H : void 0,
1092
- onCopyJson: z.type === i.Json ? de : void 0,
1093
- tableDownloadFilename: s,
1094
- isMobile: t,
1095
- defaultWidth: n,
1096
- maxWidth: r,
1097
- codeBlockTheme: o,
1098
- configurePdfWorker: c
1099
- });
1100
- }), Y = new Set(["html", "htm"]), X = {
1005
+ }), K = new Set(["html", "htm"]), q = {
1101
1006
  docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
1102
1007
  xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
1103
1008
  pptx: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
1104
- }, Z = new Set(/* @__PURE__ */ "txt.md.markdown.json.jsonl.ndjson.xml.csv.tsv.yaml.yml.toml.ini.conf.cfg.css.scss.sass.less.js.jsx.ts.tsx.mjs.cjs.mts.cts.py.rb.go.rs.java.kt.swift.c.h.cpp.cs.sh.bash.zsh.fish.ps1.log.env.gitignore.dockerfile.makefile.sql".split(".")), ze = {
1009
+ }, J = new Set(/* @__PURE__ */ "txt.md.markdown.json.jsonl.ndjson.xml.csv.tsv.yaml.yml.toml.ini.conf.cfg.css.scss.sass.less.js.jsx.ts.tsx.mjs.cjs.mts.cts.py.rb.go.rs.java.kt.swift.c.h.cpp.cs.sh.bash.zsh.fish.ps1.log.env.gitignore.dockerfile.makefile.sql".split(".")), Y = {
1105
1010
  docx: r.Docx,
1106
1011
  xlsx: r.Xlsx,
1107
1012
  pptx: r.Pptx,
1108
1013
  csv: r.Csv
1109
- }, Be = {
1110
- [X.docx]: r.Docx,
1111
- [X.xlsx]: r.Xlsx,
1112
- [X.pptx]: r.Pptx,
1014
+ }, X = {
1015
+ [q.docx]: r.Docx,
1016
+ [q.xlsx]: r.Xlsx,
1017
+ [q.pptx]: r.Pptx,
1113
1018
  [f.CSV]: r.Csv
1114
- }, Ve = {
1115
- [r.Docx]: X.docx,
1116
- [r.Xlsx]: X.xlsx,
1117
- [r.Pptx]: X.pptx,
1019
+ }, Re = {
1020
+ [r.Docx]: q.docx,
1021
+ [r.Xlsx]: q.xlsx,
1022
+ [r.Pptx]: q.pptx,
1118
1023
  [r.Csv]: f.CSV
1119
- }, Q = (e, t) => {
1024
+ }, Z = (e, t) => {
1120
1025
  let n = t?.split(";", 1)[0].trim().toLowerCase();
1121
1026
  if (n != null) {
1122
- let e = Be[n];
1027
+ let e = X[n];
1123
1028
  if (e != null) return e;
1124
1029
  }
1125
1030
  let r = e.lastIndexOf(".");
1126
- if (r !== -1) return ze[e.slice(r + 1).toLowerCase()];
1127
- }, He = (e, t) => Q(e, t) != null, Ue = (e, t) => {
1128
- let n = Q(e, t);
1129
- return n == null ? void 0 : Ve[n];
1130
- }, We = (e) => {
1031
+ if (r !== -1) return Y[e.slice(r + 1).toLowerCase()];
1032
+ }, ze = (e, t) => Z(e, t) != null, Be = (e, t) => {
1033
+ let n = Z(e, t);
1034
+ return n == null ? void 0 : Re[n];
1035
+ }, Ve = (e) => {
1131
1036
  let t = e.lastIndexOf(".");
1132
- return t === -1 ? !1 : Z.has(e.slice(t + 1).toLowerCase());
1133
- }, Ge = (e) => {
1037
+ return t === -1 ? !1 : J.has(e.slice(t + 1).toLowerCase());
1038
+ }, Q = (e) => {
1134
1039
  let t = e.lastIndexOf(".");
1135
- return t === -1 ? !1 : Y.has(e.slice(t + 1).toLowerCase());
1136
- }, Ke = {
1040
+ return t === -1 ? !1 : K.has(e.slice(t + 1).toLowerCase());
1041
+ }, He = {
1137
1042
  xml: "xml",
1138
1043
  csv: "plaintext",
1139
1044
  tsv: "plaintext",
@@ -1181,21 +1086,187 @@ var Le = ({ children: e }) => {
1181
1086
  gitignore: "plaintext",
1182
1087
  dockerfile: "plaintext",
1183
1088
  makefile: "plaintext"
1184
- }, qe = (e) => Ke[e], $ = (e) => ({
1089
+ }, Ue = (e) => He[e], $ = (e) => ({
1185
1090
  type: i.Unsupported,
1186
1091
  ...e != null && { url: e }
1187
- }), Je = (e) => ({
1092
+ }), We = (e) => ({
1188
1093
  type: i.Error,
1189
1094
  errorType: n.LoadFailed,
1190
1095
  ...e != null && { url: e }
1191
- }), Ye = (e) => ({
1096
+ }), Ge = (e) => ({
1192
1097
  type: i.Error,
1193
1098
  errorType: n.Forbidden,
1194
1099
  ...e != null && { url: e }
1195
- }), Xe = (e, t) => {
1100
+ }), Ke = (e) => {
1101
+ if (!(e.type !== i.Image && e.type !== i.Audio && e.type !== i.Pdf && e.type !== i.Ooxml)) return e.url.startsWith("blob:") ? e.url : void 0;
1102
+ }, qe = (e) => {
1103
+ let t = Ke(e);
1104
+ t != null && URL.revokeObjectURL(t);
1105
+ }, Je = {
1106
+ type: i.PlainText,
1107
+ text: ""
1108
+ }, Ye = A(void 0);
1109
+ Ye.displayName = "AttachmentCanvasContext";
1110
+ var Xe = ({ children: e }) => {
1111
+ let [t, n] = L(!1), [r, i] = L(!1), [a, o] = L(Je), [s, c] = L(void 0), [l, u] = L(void 0), d = N((e, t) => {
1112
+ c(e), u(t), i(!0), n(!0);
1113
+ }, []), f = N((e, t, r) => {
1114
+ o(e), c(t), u(r), i(!1), n(!0);
1115
+ }, []), p = N(() => {
1116
+ o(Je), n(!1), i(!1), u(void 0);
1117
+ }, []);
1118
+ return P(() => () => {
1119
+ let e = Ke(a);
1120
+ e != null && URL.revokeObjectURL(e);
1121
+ }, [a]), /* @__PURE__ */ z(Ye.Provider, {
1122
+ value: F(() => ({
1123
+ isOpen: t,
1124
+ isLoading: r,
1125
+ content: a,
1126
+ fileName: s,
1127
+ attachmentId: l,
1128
+ openCanvasLoading: d,
1129
+ openCanvas: f,
1130
+ closeCanvas: p
1131
+ }), [
1132
+ t,
1133
+ r,
1134
+ a,
1135
+ s,
1136
+ l,
1137
+ d,
1138
+ f,
1139
+ p
1140
+ ]),
1141
+ children: e
1142
+ });
1143
+ }, Ze = () => {
1144
+ let e = se(Ye);
1145
+ if (!e) throw Error("useAttachmentCanvas must be used within an AttachmentCanvasProvider");
1146
+ return e;
1147
+ }, Qe = M(({ labels: e, isMobile: t = !1, defaultWidth: n, maxWidth: r, codeBlockTheme: o, tableDownloadFilename: s, configurePdfWorker: c }) => {
1148
+ let { ariaLabel: l = "Attachment preview", closeLabel: u = "Close", downloadLabel: d = "Download", unsupportedLabel: f = "Preview is not supported for this file", loadErrorLabel: p = "Failed to load file", forbiddenErrorLabel: m = "You don't have permission to access this file", copyTextLabel: g, copiedTextLabel: _, copyMarkdownLabel: v, copiedMarkdownLabel: y, copyJsonLabel: b, copiedJsonLabel: x, htmlFrameBlockedLabel: S, htmlOpenInNewTabLabel: C, htmlViewSourceLabel: w, htmlViewRenderedLabel: T, pdfThumbnailsLabel: E, pdfShowThumbnailsLabel: D, pdfHideThumbnailsLabel: O, pdfPageNumberLabel: k, pdfContentLoadingLabel: ee, pdfContentErrorLabel: te, pdfContentRetryLabel: ne, xlsxFormulaLabel: re, codeContentLoadingLabel: ie, codeContentErrorLabel: ae, codeContentRetryLabel: oe, tableCopyLabel: A, tableCopiedLabel: j, tableDownloadCsvLabel: M, ooxmlHighlightsLabel: se, ooxmlHighlightNavigatedLabel: P } = e ?? {}, { isOpen: F, isLoading: I, content: L, fileName: ce, closeCanvas: le } = Ze(), R = N(() => {
1149
+ a(L, ce);
1150
+ }, [L, ce]), B = N(() => {
1151
+ (L.type === i.PlainText || L.type === i.Code) && h(L.text);
1152
+ }, [L]), V = N(() => {
1153
+ L.type === i.Markdown && h(L.text);
1154
+ }, [L]), ue = N(() => {
1155
+ L.type === i.Json && h(JSON.stringify(L.value, null, 2));
1156
+ }, [L]);
1157
+ return /* @__PURE__ */ z(Le, {
1158
+ isOpen: F,
1159
+ isLoading: I,
1160
+ onClose: le,
1161
+ content: L,
1162
+ fileName: ce,
1163
+ labels: {
1164
+ ariaLabel: l,
1165
+ closeLabel: u,
1166
+ downloadLabel: d,
1167
+ copyTextLabel: g,
1168
+ copiedTextLabel: _,
1169
+ copyMarkdownLabel: v,
1170
+ copiedMarkdownLabel: y,
1171
+ copyJsonLabel: b,
1172
+ copiedJsonLabel: x,
1173
+ unsupportedLabel: f,
1174
+ loadErrorLabel: p,
1175
+ forbiddenErrorLabel: m,
1176
+ htmlFrameBlockedLabel: S,
1177
+ htmlOpenInNewTabLabel: C,
1178
+ htmlViewSourceLabel: w,
1179
+ htmlViewRenderedLabel: T,
1180
+ pdfThumbnailsLabel: E,
1181
+ pdfShowThumbnailsLabel: D,
1182
+ pdfHideThumbnailsLabel: O,
1183
+ pdfPageNumberLabel: k,
1184
+ pdfContentLoadingLabel: ee,
1185
+ pdfContentErrorLabel: te,
1186
+ pdfContentRetryLabel: ne,
1187
+ xlsxFormulaLabel: re,
1188
+ codeContentLoadingLabel: ie,
1189
+ codeContentErrorLabel: ae,
1190
+ codeContentRetryLabel: oe,
1191
+ tableCopyLabel: A,
1192
+ tableCopiedLabel: j,
1193
+ tableDownloadCsvLabel: M,
1194
+ ooxmlHighlightsLabel: se,
1195
+ ooxmlHighlightNavigatedLabel: P
1196
+ },
1197
+ onDownload: R,
1198
+ onCopyText: L.type === i.PlainText || L.type === i.Code ? B : void 0,
1199
+ onCopyMarkdown: L.type === i.Markdown ? V : void 0,
1200
+ onCopyJson: L.type === i.Json ? ue : void 0,
1201
+ tableDownloadFilename: s,
1202
+ isMobile: t,
1203
+ defaultWidth: n,
1204
+ maxWidth: r,
1205
+ codeBlockTheme: o,
1206
+ configurePdfWorker: c
1207
+ });
1208
+ }), $e = {
1209
+ frame: "_frame_g47g7_1",
1210
+ header: "_header_g47g7_6",
1211
+ title: "_title_g47g7_10"
1212
+ }, et = M(({ content: e, height: t, onExpand: n, expandAriaLabel: r, actionsGroupAriaLabel: i = "Visualizer actions", frameTitle: a, loadingLabel: o, errorLabel: s, titleClassName: c = "dial-small-semi-text", colors: l }) => {
1213
+ let u = e.visualizerName.trim();
1214
+ return /* @__PURE__ */ B("div", {
1215
+ className: g("flex w-full min-w-0 flex-col overflow-hidden rounded-xl border", $e.frame),
1216
+ style: m({
1217
+ "--igv-bg": l?.background,
1218
+ "--igv-border": l?.border,
1219
+ "--igv-title-text": l?.titleText
1220
+ }),
1221
+ children: [/* @__PURE__ */ B("div", {
1222
+ className: g("flex min-h-10 items-center justify-between gap-2 border-b px-4 py-2", $e.header),
1223
+ children: [/* @__PURE__ */ z("span", {
1224
+ className: g("min-w-0 truncate", c, $e.title),
1225
+ children: u
1226
+ }), /* @__PURE__ */ z("div", {
1227
+ role: "toolbar",
1228
+ "aria-label": i,
1229
+ className: "flex items-center gap-1",
1230
+ children: /* @__PURE__ */ z(w, {
1231
+ icon: /* @__PURE__ */ z(O, {
1232
+ size: x.SM,
1233
+ stroke: S,
1234
+ "aria-hidden": !0
1235
+ }),
1236
+ "aria-label": r,
1237
+ size: C.Small,
1238
+ onClick: n
1239
+ })
1240
+ })]
1241
+ }), /* @__PURE__ */ z("div", {
1242
+ className: "w-full",
1243
+ style: { height: `${t}px` },
1244
+ children: /* @__PURE__ */ z(je, {
1245
+ content: e,
1246
+ loadingLabel: o,
1247
+ errorLabel: s,
1248
+ frameTitle: a
1249
+ })
1250
+ })]
1251
+ });
1252
+ }), tt = (e, t) => {
1196
1253
  let n = e.toLowerCase();
1197
1254
  return t.find((e) => e.contentType.split(",").some((e) => e.trim().toLowerCase() === n && e.trim() !== ""));
1198
- }, Ze = (e) => {
1255
+ }, nt = (e, t) => {
1256
+ if (!(e == null || e === "")) return Object.prototype.hasOwnProperty.call(t, e) ? t[e] : void 0;
1257
+ }, rt = (e) => `${e}:grouped-visualizer`, it = (e, t) => {
1258
+ let n = (t.contentType ?? "").split(",").map((e) => e.trim().toLowerCase()).filter((e) => e !== ""), r = [], i = [];
1259
+ return e.forEach((e) => {
1260
+ if (e.url != null && e.url !== "" && (n.length === 0 || n.includes(e.contentType.toLowerCase()))) {
1261
+ r.push(e);
1262
+ return;
1263
+ }
1264
+ i.push(e);
1265
+ }), {
1266
+ claimed: r,
1267
+ unclaimed: i
1268
+ };
1269
+ }, at = (e) => {
1199
1270
  let t;
1200
1271
  try {
1201
1272
  t = new URL(e).pathname;
@@ -1208,63 +1279,63 @@ var Le = ({ children: e }) => {
1208
1279
  } catch {
1209
1280
  return n;
1210
1281
  }
1211
- }, Qe = (e, t) => {
1212
- let { openCanvas: n, openCanvasLoading: r, closeCanvas: a } = J(), { customVisualizers: o, themeId: s, onBeforeOpen: l } = t, u = M(async (t, r) => {
1282
+ }, ot = (e, t) => {
1283
+ let { openCanvas: n, openCanvasLoading: r, closeCanvas: a } = Ze(), { customVisualizers: o, themeId: s, onBeforeOpen: l } = t, u = N(async (t, n, r) => {
1213
1284
  if (t.url == null && t.referenceUrl != null) {
1214
1285
  let i = e.resolveReferencePdfContent(t);
1215
- if (i != null) return n(i, t.name, r), !0;
1286
+ if (i != null) return r(i, t.name, n);
1216
1287
  }
1217
- let a = t.contentType.toLowerCase(), c = Xe(a, o);
1288
+ let a = t.contentType.toLowerCase(), c = tt(a, o);
1218
1289
  if (c != null) {
1219
1290
  let i = await e.resolveVisualizerContent(t, c, s);
1220
- if (i != null) return n(i, t.name, r), !0;
1291
+ if (i != null) return r(i, t.name, n);
1221
1292
  }
1222
1293
  if (!a && t.data != null) {
1223
1294
  let i = await e.resolveTextContent(t);
1224
- if (i != null) return n(i, t.name, r), !0;
1295
+ if (i != null) return r(i, t.name, n);
1225
1296
  }
1226
- let l = Q("", a);
1227
- if (l != null) return n(await e.resolveOoxmlContent(t, l) ?? $(e.resolveContentUrl(t)), t.name, r), !0;
1297
+ let l = Z("", a);
1298
+ if (l != null) return r(await e.resolveOoxmlContent(t, l) ?? $(e.resolveContentUrl(t)), t.name, n);
1228
1299
  switch (a) {
1229
- case f.PDF: return n(await e.resolvePdfContent(t) ?? $(e.resolveContentUrl(t)), t.name, r), !0;
1230
- case f.Markdown: return n(await e.resolveMarkdownContent(t) ?? $(e.resolveContentUrl(t)), t.name, r), !0;
1231
- case f.JSON: return n(await e.resolveJsonContent(t) ?? $(e.resolveContentUrl(t)), t.name, r), !0;
1300
+ case f.PDF: return r(await e.resolvePdfContent(t) ?? $(e.resolveContentUrl(t)), t.name, n);
1301
+ case f.Markdown: return r(await e.resolveMarkdownContent(t) ?? $(e.resolveContentUrl(t)), t.name, n);
1302
+ case f.JSON: return r(await e.resolveJsonContent(t) ?? $(e.resolveContentUrl(t)), t.name, n);
1232
1303
  }
1233
- let u = t.name ?? "", p = u.lastIndexOf("."), m = p === -1 ? "" : u.slice(p + 1).toLowerCase(), h = Q(u);
1234
- if (h != null) return n(await e.resolveOoxmlContent(t, h) ?? $(e.resolveContentUrl(t)), t.name, r), !0;
1304
+ let u = t.name ?? "", p = u.lastIndexOf("."), m = p === -1 ? "" : u.slice(p + 1).toLowerCase(), h = Z(u);
1305
+ if (h != null) return r(await e.resolveOoxmlContent(t, h) ?? $(e.resolveContentUrl(t)), t.name, n);
1235
1306
  switch (m) {
1236
1307
  case d.Markdown:
1237
1308
  case d.MarkdownAlt: {
1238
1309
  let i = await e.resolveMarkdownContent(t);
1239
- return i == null ? !1 : (n(i, t.name, r), !0);
1310
+ return i == null ? !1 : r(i, t.name, n);
1240
1311
  }
1241
1312
  case d.JSON: {
1242
1313
  let i = await e.resolveJsonContent(t);
1243
- return i == null ? !1 : (n(i, t.name, r), !0);
1314
+ return i == null ? !1 : r(i, t.name, n);
1244
1315
  }
1245
1316
  case d.PDF: {
1246
1317
  let i = await e.resolvePdfContent(t);
1247
- return i == null ? !1 : (n(i, t.name, r), !0);
1318
+ return i == null ? !1 : r(i, t.name, n);
1248
1319
  }
1249
1320
  }
1250
- let g = t.name != null && Ge(t.name) || t.url != null && Ge(Ze(t.url));
1251
- if (t.name != null && !We(t.name) && !g) return n($(e.resolveContentUrl(t)), t.name, r), !0;
1321
+ let g = t.name != null && Q(t.name) || t.url != null && Q(at(t.url));
1322
+ if (t.name != null && !Ve(t.name) && !g) return r($(e.resolveContentUrl(t)), t.name, n);
1252
1323
  if (g) {
1253
1324
  let a = await e.resolveHtmlContent(t);
1254
- return a == null ? e.hasTextSource(t) ? (n($(e.resolveContentUrl(t)), t.name, r), !0) : t.url == null ? !1 : (n({
1325
+ return a == null ? e.hasTextSource(t) ? r($(e.resolveContentUrl(t)), t.name, n) : t.url == null ? !1 : r({
1255
1326
  type: i.Html,
1256
1327
  url: t.url
1257
- }, t.name, r), !0) : (n(a, t.name, r), !0);
1328
+ }, t.name, n) : r(a, t.name, n);
1258
1329
  }
1259
- let _ = await e.resolveCodeContent(t, qe(m));
1260
- return _ == null ? !1 : (n(_, t.name, r), !0);
1330
+ let _ = await e.resolveCodeContent(t, Ue(m));
1331
+ return _ == null ? !1 : r(_, t.name, n);
1261
1332
  }, [
1262
- n,
1263
1333
  o,
1264
1334
  s,
1265
1335
  e
1266
1336
  ]);
1267
- return { openAttachmentCanvas: M(async (t, o = t.id) => {
1337
+ return { openAttachmentCanvas: N(async (t, o = t.id, s) => {
1338
+ let d = () => s == null || s(), f = (e, t, r) => d() ? (n(e, t, r), !0) : (qe(e), !1);
1268
1339
  switch (t.type) {
1269
1340
  case c.Image: {
1270
1341
  let r = e.resolveImageContent(t);
@@ -1280,14 +1351,14 @@ var Le = ({ children: e }) => {
1280
1351
  }
1281
1352
  case c.File: {
1282
1353
  l?.(), r(t.name, o);
1283
- let e = await u(t, o);
1284
- return e || a(), e;
1354
+ let e = await u(t, o, f);
1355
+ return !e && d() && a(), e;
1285
1356
  }
1286
1357
  case c.Pasted:
1287
1358
  case c.Prompt: {
1288
1359
  l?.(), r(t.name, o);
1289
- let i = await e.resolveTextContent(t);
1290
- return i == null ? (a(), !1) : (n(i, t.name, o), !0);
1360
+ let n = await e.resolveTextContent(t);
1361
+ return n == null ? (d() && a(), !1) : f(n, t.name, o);
1291
1362
  }
1292
1363
  default: return !1;
1293
1364
  }
@@ -1301,4 +1372,4 @@ var Le = ({ children: e }) => {
1301
1372
  ]) };
1302
1373
  };
1303
1374
  //#endregion
1304
- export { Pe as AttachmentCanvas, Me as AttachmentCanvasBody, Re as AttachmentCanvasContainer, Le as AttachmentCanvasProvider, i as AttachmentContentType, n as AttachmentErrorType, me as CodeContent, xe as McpAppCanvasRenderer, r as OoxmlFileType, t as OoxmlHighlightKind, Ye as createForbiddenCanvasContent, Je as createLoadErrorCanvasContent, $ as createUnsupportedCanvasContent, a as downloadAttachmentContent, qe as extensionToLanguage, Xe as findVisualizerForMime, Q as getOoxmlFileType, Ue as getOoxmlMimeType, o as isDownloadable, Ge as isHtmlPreviewable, He as isOoxmlPreviewable, We as isTextPreviewable, J as useAttachmentCanvas, Qe as useOpenAttachmentCanvas };
1375
+ export { Le as AttachmentCanvas, Fe as AttachmentCanvasBody, Qe as AttachmentCanvasContainer, Xe as AttachmentCanvasProvider, i as AttachmentContentType, n as AttachmentErrorType, he as CodeContent, et as InlineGroupedVisualizer, we as McpAppCanvasRenderer, r as OoxmlFileType, t as OoxmlHighlightKind, Ge as createForbiddenCanvasContent, We as createLoadErrorCanvasContent, $ as createUnsupportedCanvasContent, a as downloadAttachmentContent, Ue as extensionToLanguage, nt as findVisualizerForApplication, tt as findVisualizerForMime, Z as getOoxmlFileType, Be as getOoxmlMimeType, rt as groupedVisualizerCanvasKey, o as isDownloadable, Q as isHtmlPreviewable, ze as isOoxmlPreviewable, Ve as isTextPreviewable, it as partitionAttachmentsForApplicationVisualizer, Ze as useAttachmentCanvas, ot as useOpenAttachmentCanvas };