@epam/ai-dial-attachment-canvas 1.4.0-dev.146 → 1.4.0-dev.150

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