@epam/ai-dial-attachment-canvas 1.3.0-dev.28 → 1.3.0-dev.288

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