@epam/ai-dial-attachment-canvas 1.2.0-dev.21 → 1.2.0-dev.217

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