@epam/ai-dial-attachment-canvas 1.4.0-dev.182 → 1.4.0-dev.187

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,60 +1,60 @@
1
1
  import { t as e } from "./McpAppCanvasRenderer-DXUdyMtZ.js";
2
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";
3
+ import { a as o, n as s, s as c, t as l } from "./PdfLoadingSkeleton-tRSHLlMc.js";
4
+ import { AttachmentType as u, CodeBlockTheme as d, DEFAULT_MARKDOWN_CLASS_NAMES as f, FileExtension as p, MIMEType as m, MarkdownRenderer as h, buildCssVars as g, copyToClipboard as _, isSyntaxHighlightingAllowed as v, mergeClasses as y, restrainedSyntaxTheme as b, stripUrlQueryAndFragment as x } from "@epam/ai-dial-chat-shared";
5
+ import { SidebarOrientation as S, SidebarPanel as C } from "@epam/ai-dial-sidebar";
6
+ import { DIAL_ICON_SIZE as w, DIAL_KIT_ICON_STROKE as T, ElementSize as E, GhostButton as D, GhostIconButton as O, LinkButton as ee, LiveRegion as k, LiveRegionPoliteness as A, Spinner as te } from "@epam/ai-dial-ui-kit";
7
+ import { IconAlertTriangle as j, IconArrowsMaximize as ne, IconCheck as re, IconCode as ie, IconCopy as ae, IconDownload as oe, IconEye as se, IconLock as ce, IconMarkdown as le, IconRefresh as ue } from "@tabler/icons-react";
8
+ import { createContext as M, lazy as N, memo as P, useCallback as F, useContext as de, useEffect as I, useMemo as L, useRef as R, useState as z } from "react";
9
+ import { JsonView as fe, defaultStyles as pe } from "react-json-view-lite";
10
+ import { Fragment as B, jsx as V, jsxs as H } from "react/jsx-runtime";
11
+ import { VisualizerConnector as me, VisualizerConnectorEvents as U, VisualizerConnectorRequests as he } from "@epam/ai-dial-visualizer-connector";
12
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 = {
13
+ var W = { panel: "dial-attachment-canvas-panel" }, G = "h-full overflow-auto p-4 flex items-center justify-center", K = "h-full overflow-hidden", ge = {
14
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,
15
+ [a.Image]: G,
16
+ [a.Audio]: G,
17
+ [a.Unsupported]: G,
18
+ [a.Error]: G,
19
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,
20
+ [a.Pdf]: K,
21
+ [a.Ooxml]: K,
22
+ [a.Visualizer]: K,
23
+ [a.GroupedVisualizer]: K,
24
+ [a.McpApp]: K,
25
+ [a.Code]: K,
26
+ [a.Html]: K,
27
27
  [a.Markdown]: "h-full overflow-auto",
28
28
  [a.MarkdownTable]: "flex h-full min-h-0 flex-col overflow-hidden p-4"
29
- }, ve = {
29
+ }, _e = {
30
30
  container: "_container_k7ib4_1",
31
31
  containerLight: "_containerLight_k7ib4_5"
32
- }, ye = {
33
- [u.Dark]: y,
34
- [u.Light]: y
35
- }, G = () => le(async () => {
32
+ }, ve = {
33
+ [d.Dark]: b,
34
+ [d.Light]: b
35
+ }, ye = () => N(async () => {
36
36
  let { Prism: e } = await import("react-syntax-highlighter");
37
37
  return { default: e };
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(() => {
38
+ }), be = P(({ content: e, codeBlockTheme: t = d.Light, labels: n, codeClassName: r = "dial-code-text", errorLabelClassName: i }) => {
39
+ let { text: a, language: o } = e, c = L(() => v(a), [a]), l = o == null || o === "plaintext" || !c, u = ve[t], f = t === d.Light, [p, m] = z(0), h = L(ye, [p]), g = F(() => {
40
40
  m((e) => e + 1);
41
- }, []), y = /* @__PURE__ */ B("pre", {
42
- className: v(r, "p-4 wrap-break-word whitespace-pre-wrap"),
41
+ }, []), _ = /* @__PURE__ */ V("pre", {
42
+ className: y(r, "p-4 wrap-break-word whitespace-pre-wrap"),
43
43
  children: a
44
44
  });
45
- return /* @__PURE__ */ B("div", {
45
+ return /* @__PURE__ */ V("div", {
46
46
  dir: "ltr",
47
- className: v("h-full overflow-auto", ve.container, f && ve.containerLight),
48
- children: l ? y : /* @__PURE__ */ B(c, {
47
+ className: y("h-full overflow-auto", _e.container, f && _e.containerLight),
48
+ children: l ? _ : /* @__PURE__ */ V(s, {
49
49
  retryKey: p,
50
50
  onRetry: g,
51
- pendingContent: y,
52
- errorContent: y,
51
+ pendingContent: _,
52
+ errorContent: _,
53
53
  labels: n,
54
54
  errorLabelClassName: i,
55
- children: /* @__PURE__ */ B(h, {
55
+ children: /* @__PURE__ */ V(h, {
56
56
  language: o,
57
- style: d,
57
+ style: u,
58
58
  customStyle: {
59
59
  margin: 0,
60
60
  borderRadius: 0,
@@ -68,8 +68,8 @@ var H = { panel: "dial-attachment-canvas-panel" }, U = "h-full overflow-auto p-4
68
68
  })
69
69
  })
70
70
  });
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({
71
+ }), xe = "dial-html-preview:render", q = { 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), [_, v] = z(!1), [b, x] = z(!1), S = R(null), C = R(null), w = R(!1), T = R({
73
73
  content: e,
74
74
  generation: 0
75
75
  });
@@ -77,23 +77,23 @@ var H = { panel: "dial-attachment-canvas-panel" }, U = "h-full overflow-auto p-4
77
77
  content: e,
78
78
  generation: T.current.generation + 1
79
79
  });
80
- let ee = T.current.generation;
80
+ let E = T.current.generation;
81
81
  I(() => {
82
- f(!0), m(!1), g(void 0), y(!1), x(!1);
82
+ f(!0), m(!1), g(void 0), v(!1), x(!1);
83
83
  }, [e]);
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(() => {
84
+ let D = R(n);
85
+ D.current !== n && (D.current = n, n && b && x(!1), !n && w.current && (w.current = !1, f(!0))), I(() => {
86
86
  if (!n || e.srcdoc != null || e.resolveSourceText == null || h != null) return;
87
87
  let t = !1, r = e.resolveSourceText;
88
88
  return (async () => {
89
- y(!0);
89
+ v(!0);
90
90
  try {
91
91
  let e = await r();
92
92
  t || g(e);
93
93
  } catch {
94
94
  t || x(!0);
95
95
  } finally {
96
- t || y(!1);
96
+ t || v(!1);
97
97
  }
98
98
  })(), () => {
99
99
  t = !0;
@@ -107,7 +107,7 @@ var H = { panel: "dial-attachment-canvas-panel" }, U = "h-full overflow-auto p-4
107
107
  if (f(!1), A != null) {
108
108
  let e = S.current?.contentWindow;
109
109
  e != null && e !== C.current && j != null && (C.current = e, e.postMessage({
110
- type: K,
110
+ type: xe,
111
111
  html: j
112
112
  }, "*"));
113
113
  } else if (!(k || O)) try {
@@ -122,50 +122,50 @@ var H = { panel: "dial-attachment-canvas-panel" }, U = "h-full overflow-auto p-4
122
122
  j
123
123
  ]), re = F(() => {
124
124
  f(!1), m(!0);
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", {
125
+ }, []), ie = e.srcdoc ?? h, ae = e.srcdoc != null || e.resolveSourceText != null, oe = e.srcdoc == null && e.resolveSourceText != null && h == null && !b;
126
+ if (n && ae && (ie != null || _ || oe)) return w.current = !0, ie == null ? /* @__PURE__ */ V("div", {
127
127
  className: "flex h-full items-center justify-center",
128
- children: /* @__PURE__ */ B(te, { ariaLabel: u })
129
- }) : /* @__PURE__ */ B(be, {
128
+ children: /* @__PURE__ */ V(te, { ariaLabel: u })
129
+ }) : /* @__PURE__ */ V(be, {
130
130
  content: {
131
131
  type: a.Code,
132
- text: M,
132
+ text: ie,
133
133
  language: "html"
134
134
  },
135
135
  codeBlockTheme: i,
136
136
  codeClassName: s
137
137
  });
138
- if (p) return /* @__PURE__ */ V("div", {
138
+ if (p) return /* @__PURE__ */ H("div", {
139
139
  className: "flex h-full flex-col items-center justify-center gap-3 p-4",
140
- children: [/* @__PURE__ */ B("p", {
140
+ children: [/* @__PURE__ */ V("p", {
141
141
  className: "text-center",
142
142
  children: c
143
- }), e.url != null && /* @__PURE__ */ B(D, {
143
+ }), e.url != null && /* @__PURE__ */ V(ee, {
144
144
  href: e.url,
145
145
  target: "_blank",
146
146
  label: l,
147
- className: xe.openInNewTabButton,
147
+ className: q.openInNewTabButton,
148
148
  textClassName: o
149
149
  })]
150
150
  });
151
- let oe = k ? A : e.url, se = k && A == null ? e.srcdoc : void 0;
152
- return /* @__PURE__ */ V("div", {
151
+ let se = k ? A : e.url, ce = k && A == null ? e.srcdoc : void 0;
152
+ return /* @__PURE__ */ H("div", {
153
153
  className: "relative h-full",
154
- children: [d && /* @__PURE__ */ B("div", {
154
+ children: [d && /* @__PURE__ */ V("div", {
155
155
  className: "absolute inset-0 flex items-center justify-center",
156
- children: /* @__PURE__ */ B(te, { ariaLabel: u })
157
- }), /* @__PURE__ */ B("iframe", {
156
+ children: /* @__PURE__ */ V(te, { ariaLabel: u })
157
+ }), /* @__PURE__ */ V("iframe", {
158
158
  ref: S,
159
159
  title: r,
160
- src: oe,
161
- srcDoc: se,
160
+ src: se,
161
+ srcDoc: ce,
162
162
  sandbox: k || O ? "allow-scripts" : "allow-scripts allow-same-origin",
163
- className: v("h-full w-full border-none", d ? "invisible" : ""),
163
+ className: y("h-full w-full border-none", d ? "invisible" : ""),
164
164
  onLoad: ne,
165
165
  onError: re
166
- }, ee)]
166
+ }, E)]
167
167
  });
168
- }), q = {
168
+ }), J = {
169
169
  viewer: "_viewer_gdafg_2",
170
170
  spreadsheetCanvas: "_spreadsheetCanvas_gdafg_6",
171
171
  formulaPanel: "_formulaPanel_gdafg_12",
@@ -201,7 +201,7 @@ var H = { panel: "dial-attachment-canvas-panel" }, U = "h-full overflow-auto p-4
201
201
  }
202
202
  case i.Csv: {
203
203
  let { XlsxSheetViewer: t } = await import("@silurus/ooxml/xlsx"), r = document.createElement("canvas");
204
- r.className = q.spreadsheetCanvas, e.replaceChildren(r);
204
+ r.className = J.spreadsheetCanvas, e.replaceChildren(r);
205
205
  let i = new t(r, {
206
206
  showScrollbars: !0,
207
207
  onError: n
@@ -293,9 +293,9 @@ var H = { panel: "dial-attachment-canvas-panel" }, U = "h-full overflow-auto p-4
293
293
  }
294
294
  }
295
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);
296
+ let d = R(null), [f, p] = z(!0), [m, h] = z(!1), [g, _] = z(""), [v, b] = z([]), [x, S] = z(!1), { highlights: C, selectedHighlightId: w } = e, E = C != null && C.length > 0, D = R(void 0), O = R(C);
297
+ O.current = C;
298
+ let ee = R(void 0);
299
299
  return I(() => {
300
300
  let t = d.current;
301
301
  if (t == null) return;
@@ -306,7 +306,7 @@ var H = { panel: "dial-attachment-canvas-panel" }, U = "h-full overflow-auto p-4
306
306
  a = void 0, c();
307
307
  }));
308
308
  }, c = async () => {
309
- let e = n?.highlights, t = D.current;
309
+ let e = n?.highlights, t = O.current;
310
310
  if (!(i || e == null || t == null)) try {
311
311
  let n = await e.measure(t);
312
312
  i || b(n);
@@ -326,44 +326,44 @@ var H = { panel: "dial-attachment-canvas-panel" }, U = "h-full overflow-auto p-4
326
326
  n?.viewer.resize?.(), s();
327
327
  }), r.observe(t));
328
328
  };
329
- return t.addEventListener("scroll", s, !0), j.current = s, (async () => {
329
+ return t.addEventListener("scroll", s, !0), ee.current = s, (async () => {
330
330
  try {
331
- if (ee) {
331
+ if (E) {
332
332
  let r = await Te(t, e, l, o);
333
333
  if (i) {
334
334
  r.viewer.destroy(), r.engine?.destroy();
335
335
  return;
336
336
  }
337
- n = r, E.current = r.highlights, u();
337
+ n = r, D.current = r.highlights, u();
338
338
  } else {
339
339
  let r = await we(t, e.format, l);
340
340
  if (i) {
341
341
  r.destroy();
342
342
  return;
343
343
  }
344
- if (n = { viewer: r }, E.current = void 0, await r.load(e.url), i) return;
344
+ if (n = { viewer: r }, D.current = void 0, await r.load(e.url), i) return;
345
345
  u();
346
346
  }
347
347
  if (i) return;
348
348
  p(!1), await c();
349
349
  } catch (e) {
350
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);
351
+ n?.viewer.destroy(), n?.engine?.destroy(), n = void 0, D.current = void 0, t.replaceChildren(), p(!1), h(!0);
352
352
  }
353
353
  })(), () => {
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();
354
+ i = !0, t.removeEventListener("scroll", s, !0), a != null && cancelAnimationFrame(a), ee.current = void 0, r?.disconnect(), n?.viewer.destroy(), n?.engine?.destroy(), D.current = void 0, t.replaceChildren();
355
355
  };
356
356
  }, [
357
357
  e.format,
358
358
  e.url,
359
- ee
359
+ E
360
360
  ]), I(() => {
361
- j.current?.();
361
+ ee.current?.();
362
362
  }, [C]), I(() => {
363
363
  S(!1);
364
- let e = E.current;
364
+ let e = D.current;
365
365
  if (e == null || f) return;
366
- let n = (D.current?.find(({ id: e }) => e === T))?.locations.at(0);
366
+ let n = (O.current?.find(({ id: e }) => e === w))?.locations.at(0);
367
367
  if (n == null) return;
368
368
  let r = !1;
369
369
  return (async () => {
@@ -377,38 +377,38 @@ var H = { panel: "dial-attachment-canvas-panel" }, U = "h-full overflow-auto p-4
377
377
  })(), () => {
378
378
  r = !0;
379
379
  };
380
- }, [T, f]), /* @__PURE__ */ V("div", {
380
+ }, [w, f]), /* @__PURE__ */ H("div", {
381
381
  className: "relative flex h-full w-full min-w-0 flex-col overflow-hidden",
382
382
  children: [
383
- e.format === i.Xlsx && /* @__PURE__ */ V("div", {
383
+ e.format === i.Xlsx && /* @__PURE__ */ H("div", {
384
384
  role: "region",
385
385
  "aria-label": a,
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", {
386
+ className: y("flex min-w-0 shrink-0 items-center gap-2 border-b px-3 py-2", J.formulaPanel),
387
+ children: [/* @__PURE__ */ V("span", {
388
388
  "aria-hidden": "true",
389
- className: v("shrink-0", o),
389
+ className: y("shrink-0", o),
390
390
  children: "fx"
391
- }), /* @__PURE__ */ B("code", {
391
+ }), /* @__PURE__ */ V("code", {
392
392
  dir: "ltr",
393
393
  tabIndex: 0,
394
394
  "aria-live": "polite",
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),
395
+ className: y("h-8 min-w-0 flex-1 overflow-x-auto rounded border px-2 py-1 whitespace-nowrap focus-visible:outline", J.formulaValue, s),
396
396
  children: g
397
397
  })]
398
398
  }),
399
- /* @__PURE__ */ V("div", {
399
+ /* @__PURE__ */ H("div", {
400
400
  className: "relative min-h-0 w-full flex-1",
401
- children: [/* @__PURE__ */ B("div", {
401
+ children: [/* @__PURE__ */ V("div", {
402
402
  ref: d,
403
403
  role: "document",
404
404
  "aria-label": n,
405
405
  "aria-busy": f,
406
- className: v("h-full w-full overflow-hidden", q.viewer)
407
- }), y.length > 0 && /* @__PURE__ */ B("div", {
406
+ className: y("h-full w-full overflow-hidden", J.viewer)
407
+ }), v.length > 0 && /* @__PURE__ */ V("div", {
408
408
  role: "region",
409
409
  "aria-label": c,
410
410
  className: "pointer-events-none absolute inset-0 overflow-hidden",
411
- children: y.map((e, t) => /* @__PURE__ */ B("div", {
411
+ children: v.map((e, t) => /* @__PURE__ */ V("div", {
412
412
  "aria-hidden": "true",
413
413
  style: {
414
414
  left: `${e.left}px`,
@@ -416,34 +416,34 @@ var H = { panel: "dial-attachment-canvas-panel" }, U = "h-full overflow-auto p-4
416
416
  width: `${e.width}px`,
417
417
  height: `${e.height}px`
418
418
  },
419
- "data-selected": e.highlightId === T,
419
+ "data-selected": e.highlightId === w,
420
420
  "data-clipped": e.isClippedAtEnd === !0,
421
- className: v("absolute", q.highlight)
421
+ className: y("absolute", J.highlight)
422
422
  }, `${e.highlightId}-${t}`))
423
423
  })]
424
424
  }),
425
- /* @__PURE__ */ B(O, {
425
+ /* @__PURE__ */ V(k, {
426
426
  visuallyHidden: !0,
427
427
  children: x ? l : ""
428
428
  }),
429
- /* @__PURE__ */ B(O, {
430
- politeness: k.Assertive,
429
+ /* @__PURE__ */ V(k, {
430
+ politeness: A.Assertive,
431
431
  visuallyHidden: !0,
432
432
  children: !f && m ? r : ""
433
433
  }),
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, {
434
+ (f || m) && /* @__PURE__ */ V("div", {
435
+ className: y("absolute inset-0 flex items-center justify-center", J.statusOverlay),
436
+ children: f ? /* @__PURE__ */ V(te, {
437
437
  size: 48,
438
438
  ariaLabel: u
439
- }) : /* @__PURE__ */ V("div", {
439
+ }) : /* @__PURE__ */ H("div", {
440
440
  className: "flex flex-col items-center gap-2",
441
- children: [/* @__PURE__ */ B(A, {
441
+ children: [/* @__PURE__ */ V(j, {
442
442
  "aria-hidden": "true",
443
443
  size: 60,
444
- stroke: w,
445
- className: q.errorIcon
446
- }), /* @__PURE__ */ B("p", {
444
+ stroke: T,
445
+ className: J.errorIcon
446
+ }), /* @__PURE__ */ V("p", {
447
447
  "aria-hidden": !0,
448
448
  className: "text-center",
449
449
  children: r
@@ -452,7 +452,7 @@ var H = { panel: "dial-attachment-canvas-panel" }, U = "h-full overflow-auto p-4
452
452
  })
453
453
  ]
454
454
  });
455
- }, J = (e, t) => {
455
+ }, Y = (e, t) => {
456
456
  let n = e.toLowerCase();
457
457
  return t.find((e) => e.contentType.split(",").some((e) => e.trim().toLowerCase() === n && e.trim() !== ""));
458
458
  }, Oe = (e, t) => {
@@ -485,14 +485,14 @@ var H = { panel: "dial-attachment-canvas-panel" }, U = "h-full overflow-auto p-4
485
485
  domain: u,
486
486
  visualizerName: d,
487
487
  requestTimeout: f
488
- }), n = !0, r = t.subscribe(`${d}/${he.SendMessage}`, (e) => {
488
+ }), n = !0, r = t.subscribe(`${d}/${U.SendMessage}`, (e) => {
489
489
  let t = je(e);
490
490
  t != null && m.current?.(t);
491
491
  });
492
492
  return (async () => {
493
493
  if (await t.ready(), !n) return;
494
494
  let e = p.current;
495
- if (e.type === a.GroupedVisualizer) await t.send(ge.SendGroupedVisualizeData, {
495
+ if (e.type === a.GroupedVisualizer) await t.send(he.SendGroupedVisualizeData, {
496
496
  attachments: e.attachments,
497
497
  layout: e.layout
498
498
  });
@@ -501,7 +501,7 @@ var H = { panel: "dial-attachment-canvas-panel" }, U = "h-full overflow-auto p-4
501
501
  layout: r,
502
502
  ...typeof i == "object" && i ? i : {}
503
503
  };
504
- await t.send(ge.SendVisualizeData, {
504
+ await t.send(he.SendVisualizeData, {
505
505
  mimeType: n,
506
506
  visualizerData: a
507
507
  });
@@ -524,46 +524,46 @@ var H = { panel: "dial-attachment-canvas-panel" }, U = "h-full overflow-auto p-4
524
524
  d,
525
525
  u,
526
526
  f
527
- ]), /* @__PURE__ */ V("div", {
527
+ ]), /* @__PURE__ */ H("div", {
528
528
  className: "relative h-full w-full",
529
- style: h({
529
+ style: g({
530
530
  "--vs-loading-bg": i?.loadingBackground,
531
531
  "--vs-status-text": i?.statusText,
532
532
  "--vs-error-icon": i?.errorIcon
533
533
  }),
534
534
  children: [
535
- /* @__PURE__ */ B("div", {
535
+ /* @__PURE__ */ V("div", {
536
536
  ref: s,
537
537
  className: "h-full w-full"
538
538
  }),
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", {
539
+ c === "loading" && /* @__PURE__ */ H("div", {
540
+ className: y("absolute inset-0 flex flex-col items-center justify-center gap-2", Me.loadingOverlay),
541
+ children: [/* @__PURE__ */ V(te, { ariaLabel: t }), t && /* @__PURE__ */ V("p", {
542
542
  "aria-hidden": !0,
543
- className: v("text-center", Me.statusLabel),
543
+ className: y("text-center", Me.statusLabel),
544
544
  children: t
545
545
  })]
546
546
  }),
547
- /* @__PURE__ */ B(O, {
547
+ /* @__PURE__ */ V(k, {
548
548
  visuallyHidden: !0,
549
549
  children: c === "error" && n
550
550
  }),
551
- c === "error" && /* @__PURE__ */ V("div", {
551
+ c === "error" && /* @__PURE__ */ H("div", {
552
552
  className: "absolute inset-0 flex flex-col items-center justify-center gap-2",
553
- children: [/* @__PURE__ */ B(A, {
553
+ children: [/* @__PURE__ */ V(j, {
554
554
  size: 60,
555
- stroke: w,
555
+ stroke: T,
556
556
  "aria-hidden": !0,
557
557
  className: Me.errorIcon
558
- }), /* @__PURE__ */ B("p", {
558
+ }), /* @__PURE__ */ V("p", {
559
559
  "aria-hidden": !0,
560
- className: v("text-center", Me.statusLabel),
560
+ className: y("text-center", Me.statusLabel),
561
561
  children: n
562
562
  })]
563
563
  })
564
564
  ]
565
565
  });
566
- }, Y = {
566
+ }, X = {
567
567
  body: "_body_fvnln_4",
568
568
  statusLabel: "_statusLabel_fvnln_13",
569
569
  errorIcon: "_errorIcon_fvnln_17",
@@ -578,271 +578,272 @@ var H = { panel: "dial-attachment-canvas-panel" }, U = "h-full overflow-auto p-4
578
578
  jsonExpandIcon: "_jsonExpandIcon_fvnln_54",
579
579
  jsonCollapseIcon: "_jsonCollapseIcon_fvnln_67",
580
580
  jsonCollapsedContent: "_jsonCollapsedContent_fvnln_84"
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 }) => {
581
+ }, Pe = () => N(async () => ({ default: (await import("./PdfContent-DX6q6wTq.js")).PdfContent })), Fe = () => N(async () => ({ default: (await import("./McpAppCanvasRenderer-DXUdyMtZ.js").then((e) => e.n)).McpAppCanvasRenderer })), Ie = ({ url: e, fileName: t, loadErrorLabel: n }) => {
582
582
  let [r, i] = z(!1);
583
583
  return I(() => {
584
584
  i(!1);
585
- }, [e]), r ? /* @__PURE__ */ V("div", {
585
+ }, [e]), r ? /* @__PURE__ */ H("div", {
586
586
  className: "flex flex-col items-center gap-2",
587
- children: [/* @__PURE__ */ B(A, {
587
+ children: [/* @__PURE__ */ V(j, {
588
588
  size: 60,
589
- stroke: w,
590
- className: Y.errorIcon
591
- }), /* @__PURE__ */ B("p", {
592
- className: v("text-center", Y.statusLabel),
589
+ stroke: T,
590
+ className: X.errorIcon
591
+ }), /* @__PURE__ */ V("p", {
592
+ className: y("text-center", X.statusLabel),
593
593
  children: n
594
594
  })]
595
- }) : /* @__PURE__ */ B("img", {
595
+ }) : /* @__PURE__ */ V("img", {
596
596
  src: e,
597
597
  alt: t ?? "",
598
598
  className: "max-h-full max-w-full object-contain",
599
599
  onError: () => i(!0)
600
600
  });
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;
601
+ }, Le = P(({ content: e, isLoading: t = !1, loadingContentType: n, fileName: i, isHtmlSourceView: o = !1, labels: { unsupportedLabel: c = "Preview is not supported for this file", loadErrorLabel: u = "Failed to load file", loadErrorRetryLabel: d = "Retry", forbiddenErrorLabel: p = "You don't have permission to access this file", visualizerErrorLabel: m, htmlFrameBlockedLabel: _ = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: v = "Open in new tab", pdfThumbnailsLabel: b, pdfShowThumbnailsLabel: x, pdfHideThumbnailsLabel: S, pdfPageNumberLabel: C, pdfContentLoadingLabel: w, pdfContentErrorLabel: E, pdfContentRetryLabel: O, xlsxFormulaLabel: ee = "Formula", codeContentLoadingLabel: A, codeContentErrorLabel: ne, codeContentRetryLabel: re, tableCopyLabel: ie, tableCopiedLabel: ae, tableDownloadCsvLabel: oe, codeBlockCopyLabel: se, codeBlockCopiedLabel: le, codeBlockDownloadLabel: ue, tableScrollRegionAriaLabel: M, mathScrollRegionAriaLabel: N, ooxmlHighlightsLabel: P, ooxmlHighlightNavigatedLabel: de, loadingLabel: B = "Loading…" } = {}, styles: me, codeBlockTheme: U, tableDownloadFilename: he, loadPdf: W, hidePdfToolbar: G = !1, configurePdfWorker: K, onAppInfo: _e, onRetry: ve, onVisualizerSendMessage: ye, mcpAppHostContext: xe }) => {
602
+ let { colors: q, typography: J, bodyClassName: Ce, cssVars: we } = me ?? {}, [Te, Ee] = z(0), Y = L(Pe, [Te]), Oe = F(() => {
603
+ Ee((e) => e + 1);
604
+ }, []), [ke, Ae] = z(0), je = L(Fe, [ke]), Me = F(() => {
605
+ Ae((e) => e + 1);
606
+ }, []), Le = R(void 0), [Re, ze] = z(0), Be = F((e) => {
607
+ Le.current = e;
608
608
  }, []);
609
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));
610
+ let t = Le.current;
611
+ t != null && (Le.current = void 0, e.type === a.Pdf && e.url === t && ze((e) => e + 1));
612
612
  }, [e]);
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
613
+ let Ve = J?.fontClassName != null, He = L(() => ({
614
+ ...g({
615
+ "--ac-text": q?.text,
616
+ "--ac-status-text": q?.statusText,
617
+ "--ac-error-icon": q?.errorIcon,
618
+ "--ac-open-in-new-tab-text": q?.openInNewTabText,
619
+ "--ac-json-border": q?.jsonBorder,
620
+ "--ac-json-bg": q?.jsonBackground,
621
+ "--ac-json-label": q?.jsonLabel,
622
+ "--ac-json-clickable-label": q?.jsonClickableLabel,
623
+ "--ac-json-punctuation": q?.jsonPunctuation,
624
+ "--ac-json-string": q?.jsonString,
625
+ "--ac-json-number": q?.jsonNumber,
626
+ "--ac-json-boolean": q?.jsonBoolean,
627
+ "--ac-json-null": q?.jsonNull,
628
+ "--ac-json-toggle-icon": q?.jsonToggleIcon,
629
+ "--ac-json-toggle-icon-hover": q?.jsonToggleIconHover,
630
+ "--ac-ooxml-bg": q?.ooxmlBackground,
631
+ "--ac-ooxml-formula-border": q?.ooxmlFormulaBorder,
632
+ "--ac-ooxml-formula-bg": q?.ooxmlFormulaBackground,
633
+ "--ac-ooxml-formula-text": q?.ooxmlFormulaText,
634
+ "--ac-ooxml-highlight-border": q?.ooxmlHighlightBorder,
635
+ "--ac-ooxml-highlight-bg": q?.ooxmlHighlightBackground,
636
+ "--ac-json-collapsed-text": q?.jsonCollapsedText,
637
+ "--ac-json-collapsed-bg": q?.jsonCollapsedBackground,
638
+ "--ac-focus-outline": q?.focusOutline,
639
+ "--ac-code-bg": q?.codeBackground,
640
+ "--ac-mcp-app-loading-bg": q?.mcpAppLoadingBackground,
641
+ "--ac-mcp-app-status-text": q?.mcpAppStatusText,
642
+ "--ac-font-family": Ve ? void 0 : J?.fontFamily,
643
+ "--ac-font-size": Ve ? void 0 : J?.fontSize,
644
+ "--ac-font-weight": Ve ? void 0 : J?.fontWeight,
645
+ "--ac-line-height": Ve ? void 0 : J?.lineHeight,
646
+ "--ac-letter-spacing": Ve ? void 0 : J?.letterSpacing
647
647
  }),
648
- ...q
649
- }), [ue]), Be = _e[e.type], Z = e.type === a.McpApp ? ye : void 0, Ve = L(() => {
648
+ ...we
649
+ }), [me]), Ue = ge[e.type], We = e.type === a.McpApp ? xe : void 0, Ge = L(() => {
650
650
  switch (e.type) {
651
- case a.PlainText: return /* @__PURE__ */ B("pre", {
652
- className: v("wrap-break-word whitespace-pre-wrap", Y.body, K?.fontClassName),
651
+ case a.PlainText: return /* @__PURE__ */ V("pre", {
652
+ className: y("wrap-break-word whitespace-pre-wrap", X.body, J?.fontClassName),
653
653
  children: e.text
654
654
  });
655
- case a.Image: return /* @__PURE__ */ B(Ie, {
655
+ case a.Image: return /* @__PURE__ */ V(Ie, {
656
656
  url: e.url,
657
- fileName: n,
658
- loadErrorLabel: s
657
+ fileName: i,
658
+ loadErrorLabel: u
659
659
  });
660
- case a.Audio: return /* @__PURE__ */ B("audio", {
660
+ case a.Audio: return /* @__PURE__ */ V("audio", {
661
661
  controls: !0,
662
662
  controlsList: "nodownload",
663
663
  src: e.url,
664
- "aria-label": n ?? "Audio attachment",
664
+ "aria-label": i ?? "Audio attachment",
665
665
  className: "w-full max-w-sm",
666
666
  preload: "metadata",
667
- children: e.mimeType && /* @__PURE__ */ B("source", {
667
+ children: e.mimeType && /* @__PURE__ */ V("source", {
668
668
  src: e.url,
669
669
  type: e.mimeType
670
670
  })
671
671
  });
672
- case a.Markdown: return /* @__PURE__ */ B("div", {
672
+ case a.Markdown: return /* @__PURE__ */ V("div", {
673
673
  className: "p-4",
674
- children: /* @__PURE__ */ B(m, {
674
+ children: /* @__PURE__ */ V(h, {
675
675
  content: e.text,
676
676
  isStreaming: !1,
677
- codeBlockTheme: pe,
678
- codeBlockCopyLabel: M,
679
- codeBlockCopiedLabel: ie,
680
- codeBlockDownloadLabel: ae,
681
- tableScrollRegionAriaLabel: se,
682
- mathScrollRegionAriaLabel: ce,
683
- classNames: d
677
+ codeBlockTheme: U,
678
+ codeBlockCopyLabel: se,
679
+ codeBlockCopiedLabel: le,
680
+ codeBlockDownloadLabel: ue,
681
+ tableScrollRegionAriaLabel: M,
682
+ mathScrollRegionAriaLabel: N,
683
+ classNames: f
684
684
  })
685
685
  });
686
- case a.MarkdownTable: return /* @__PURE__ */ B(m, {
686
+ case a.MarkdownTable: return /* @__PURE__ */ V(h, {
687
687
  content: e.text,
688
688
  isStreaming: !1,
689
- codeBlockTheme: pe,
690
- codeBlockCopyLabel: M,
691
- codeBlockCopiedLabel: ie,
692
- codeBlockDownloadLabel: ae,
693
- tableScrollRegionAriaLabel: se,
694
- mathScrollRegionAriaLabel: ce,
689
+ codeBlockTheme: U,
690
+ codeBlockCopyLabel: se,
691
+ codeBlockCopiedLabel: le,
692
+ codeBlockDownloadLabel: ue,
693
+ tableScrollRegionAriaLabel: M,
694
+ mathScrollRegionAriaLabel: N,
695
695
  containerClassName: "flex h-full min-h-0 flex-col",
696
696
  classNames: {
697
- ...d,
697
+ ...f,
698
698
  tableWrapper: "my-0 max-h-full",
699
699
  tableScrollContainer: "max-h-full"
700
700
  },
701
701
  tableActionLabels: {
702
- copyLabel: j,
703
- copiedLabel: ne,
704
- downloadCsvLabel: re
702
+ copyLabel: ie,
703
+ copiedLabel: ae,
704
+ downloadCsvLabel: oe
705
705
  },
706
- tableDownloadFilename: me
706
+ tableDownloadFilename: he
707
707
  });
708
708
  case a.Json: {
709
- let t = K?.jsonLabelClassName ?? (K?.jsonClassName ? void 0 : "dial-code-semi-text");
710
- return /* @__PURE__ */ B("div", {
709
+ let t = J?.jsonLabelClassName ?? (J?.jsonClassName ? void 0 : "dial-code-semi-text");
710
+ return /* @__PURE__ */ V("div", {
711
711
  dir: "ltr",
712
712
  className: "h-full overflow-auto",
713
- children: /* @__PURE__ */ B("div", {
714
- className: v("m-3 overflow-auto rounded-md border", Y.jsonWrapper),
715
- children: /* @__PURE__ */ B(de, {
713
+ children: /* @__PURE__ */ V("div", {
714
+ className: y("m-3 overflow-auto rounded-md border", X.jsonWrapper),
715
+ children: /* @__PURE__ */ V(fe, {
716
716
  data: e.value,
717
717
  style: {
718
- container: v("whitespace-pre-wrap wrap-break-word p-2", K?.jsonClassName ?? "dial-code-text"),
719
- basicChildStyle: fe.basicChildStyle,
718
+ container: y("whitespace-pre-wrap wrap-break-word p-2", J?.jsonClassName ?? "dial-code-text"),
719
+ basicChildStyle: pe.basicChildStyle,
720
720
  childFieldsContainer: "m-0 ps-3",
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)
721
+ label: y("me-1", t, X.jsonLabel),
722
+ clickableLabel: y("me-1 cursor-pointer hover:underline", t, X.jsonClickableLabel),
723
+ nullValue: y("italic", X.jsonNullValue),
724
+ undefinedValue: y("italic", X.jsonNullValue),
725
+ stringValue: X.jsonStringValue,
726
+ booleanValue: X.jsonBooleanValue,
727
+ numberValue: X.jsonNumberValue,
728
+ otherValue: y("italic", X.jsonNullValue),
729
+ punctuation: y("me-1", X.jsonPunctuation),
730
+ collapseIcon: y("me-1 cursor-pointer select-none transition-colors", X.jsonCollapseIcon),
731
+ expandIcon: y("me-1 cursor-pointer select-none transition-colors", X.jsonExpandIcon),
732
+ collapsedContent: y(J?.jsonCollapsedClassName ?? "dial-caption-text", "me-1 cursor-pointer rounded px-1", X.jsonCollapsedContent)
733
733
  }
734
734
  })
735
735
  })
736
736
  });
737
737
  }
738
- case a.Code: return /* @__PURE__ */ B(be, {
738
+ case a.Code: return /* @__PURE__ */ V(be, {
739
739
  content: e,
740
- codeBlockTheme: pe,
741
- codeClassName: K?.codeClassName,
742
- errorLabelClassName: K?.errorMessageClassName,
740
+ codeBlockTheme: U,
741
+ codeClassName: J?.codeClassName,
742
+ errorLabelClassName: J?.errorMessageClassName,
743
743
  labels: {
744
- loadingLabel: D,
745
- errorLabel: O,
746
- retryLabel: k
744
+ loadingLabel: A,
745
+ errorLabel: ne,
746
+ retryLabel: re
747
747
  }
748
748
  });
749
- case a.Html: return /* @__PURE__ */ B(Se, {
749
+ case a.Html: return /* @__PURE__ */ V(Se, {
750
750
  content: e,
751
751
  labels: {
752
- htmlFrameBlockedLabel: p,
753
- htmlOpenInNewTabLabel: g,
754
- loadingLabel: P
752
+ htmlFrameBlockedLabel: _,
753
+ htmlOpenInNewTabLabel: v,
754
+ loadingLabel: B
755
755
  },
756
- isSourceView: i,
757
- title: n,
758
- codeBlockTheme: pe,
759
- codeClassName: K?.codeClassName
756
+ isSourceView: o,
757
+ title: i,
758
+ codeBlockTheme: U,
759
+ codeClassName: J?.codeClassName
760
760
  });
761
- case a.Pdf: return /* @__PURE__ */ B(c, {
762
- retryKey: Ce,
763
- onRetry: Ee,
764
- errorLabelClassName: K?.errorMessageClassName,
761
+ case a.Pdf: return /* @__PURE__ */ V(s, {
762
+ retryKey: Te,
763
+ onRetry: Oe,
764
+ pendingContent: /* @__PURE__ */ V(l, {}),
765
+ errorLabelClassName: J?.errorMessageClassName,
765
766
  labels: {
766
- loadingLabel: S,
767
- errorLabel: C,
768
- retryLabel: T
767
+ loadingLabel: w,
768
+ errorLabel: E,
769
+ retryLabel: O
769
770
  },
770
- children: /* @__PURE__ */ B(Te, {
771
- fileName: n,
771
+ children: /* @__PURE__ */ V(Y, {
772
+ fileName: i,
772
773
  url: e.url,
773
774
  highlights: e.highlights ?? [],
774
775
  selectedHighlightId: e.selectedHighlightId,
775
776
  selectedPageNumber: e.page,
776
- loadPdf: he,
777
- onLoadError: Re,
778
- hideHeader: ge,
779
- configurePdfWorker: H,
780
- errorLabelClassName: K?.errorMessageClassName,
777
+ loadPdf: W,
778
+ onLoadError: Be,
779
+ hideHeader: G,
780
+ configurePdfWorker: K,
781
+ errorLabelClassName: J?.errorMessageClassName,
781
782
  labels: {
782
- thumbnailsLabel: _,
783
- showThumbnailsLabel: y,
784
- hideThumbnailsLabel: b,
785
- pageNumberLabel: x,
786
- loadingLabel: S,
787
- errorLabel: C,
788
- retryLabel: T
783
+ thumbnailsLabel: b,
784
+ showThumbnailsLabel: x,
785
+ hideThumbnailsLabel: S,
786
+ pageNumberLabel: C,
787
+ loadingLabel: w,
788
+ errorLabel: E,
789
+ retryLabel: O
789
790
  }
790
791
  })
791
- }, `${e.url}#${Me}`);
792
- case a.Ooxml: return /* @__PURE__ */ B(De, {
792
+ }, `${e.url}#${Re}`);
793
+ case a.Ooxml: return /* @__PURE__ */ V(De, {
793
794
  content: e,
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
795
+ fileName: i,
796
+ loadErrorLabel: u,
797
+ formulaLabel: ee,
798
+ formulaLabelClassName: J?.xlsxFormulaLabelClassName ?? "dial-italic-text",
799
+ formulaValueClassName: J?.xlsxFormulaValueClassName ?? "dial-code-text",
800
+ highlightsLabel: P,
801
+ highlightNavigatedLabel: de,
802
+ loadingLabel: B
802
803
  });
803
804
  case a.Visualizer:
804
- case a.GroupedVisualizer: return /* @__PURE__ */ B(Ne, {
805
+ case a.GroupedVisualizer: return /* @__PURE__ */ V(Ne, {
805
806
  content: e,
806
- errorLabel: f,
807
- onSendMessage: ve
807
+ errorLabel: m,
808
+ onSendMessage: ye
808
809
  });
809
- case a.McpApp: return /* @__PURE__ */ B(c, {
810
- retryKey: J,
811
- onRetry: Ae,
812
- errorLabelClassName: K?.errorMessageClassName,
810
+ case a.McpApp: return /* @__PURE__ */ V(s, {
811
+ retryKey: ke,
812
+ onRetry: Me,
813
+ errorLabelClassName: J?.errorMessageClassName,
813
814
  labels: {
814
- loadingLabel: P,
815
- errorLabel: s,
816
- retryLabel: l
815
+ loadingLabel: B,
816
+ errorLabel: u,
817
+ retryLabel: d
817
818
  },
818
- children: /* @__PURE__ */ B(ke, {
819
+ children: /* @__PURE__ */ V(je, {
819
820
  content: e,
820
- loadingLabel: P,
821
- onAppInfo: U,
822
- hostContext: Z
821
+ loadingLabel: B,
822
+ onAppInfo: _e,
823
+ hostContext: We
823
824
  })
824
825
  });
825
- case a.Unsupported: return /* @__PURE__ */ B("p", {
826
- className: v("text-center", Y.statusLabel),
827
- children: o
826
+ case a.Unsupported: return /* @__PURE__ */ V("p", {
827
+ className: y("text-center", X.statusLabel),
828
+ children: c
828
829
  });
829
830
  case a.Error: {
830
831
  let t = e.errorType === r.Forbidden;
831
- return /* @__PURE__ */ V("div", {
832
+ return /* @__PURE__ */ H("div", {
832
833
  className: "flex flex-col items-center gap-2",
833
834
  children: [
834
- B(t ? oe : A, {
835
+ V(t ? ce : j, {
835
836
  size: 60,
836
- stroke: w,
837
- className: Y.errorIcon
837
+ stroke: T,
838
+ className: X.errorIcon
838
839
  }),
839
- /* @__PURE__ */ B("p", {
840
- className: v("text-center", Y.statusLabel),
841
- children: t ? u : s
840
+ /* @__PURE__ */ V("p", {
841
+ className: y("text-center", X.statusLabel),
842
+ children: t ? p : u
842
843
  }),
843
- !t && W != null && /* @__PURE__ */ B(ee, {
844
- label: l,
845
- onClick: W
844
+ !t && ve != null && /* @__PURE__ */ V(D, {
845
+ label: d,
846
+ onClick: ve
846
847
  })
847
848
  ]
848
849
  });
@@ -850,280 +851,284 @@ var H = { panel: "dial-attachment-canvas-panel" }, U = "h-full overflow-auto p-4
850
851
  }
851
852
  }, [
852
853
  e,
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,
863
- o,
864
- s,
865
- l,
854
+ J?.fontClassName,
855
+ J?.jsonClassName,
856
+ J?.jsonLabelClassName,
857
+ J?.xlsxFormulaLabelClassName,
858
+ J?.xlsxFormulaValueClassName,
859
+ J?.codeClassName,
860
+ J?.jsonCollapsedClassName,
861
+ J?.errorMessageClassName,
862
+ i,
863
+ U,
864
+ c,
866
865
  u,
867
- f,
868
- ve,
866
+ d,
869
867
  p,
870
- g,
871
- i,
872
- me,
868
+ m,
869
+ ye,
870
+ _,
871
+ v,
872
+ o,
873
873
  he,
874
- ge,
875
- H,
876
- U,
877
- Z,
878
874
  W,
879
- _,
880
- y,
875
+ G,
876
+ K,
877
+ _e,
878
+ We,
879
+ ve,
881
880
  b,
882
881
  x,
883
882
  S,
884
883
  C,
885
- T,
884
+ w,
886
885
  E,
887
- D,
888
886
  O,
889
- k,
890
- Te,
887
+ ee,
888
+ A,
889
+ ne,
890
+ re,
891
+ Y,
892
+ je,
891
893
  ke,
892
- J,
893
- Ae,
894
- Ce,
895
- Ee,
896
894
  Me,
895
+ Te,
896
+ Oe,
897
897
  Re,
898
- j,
899
- ne,
900
- re,
901
- M,
898
+ Be,
902
899
  ie,
903
900
  ae,
901
+ oe,
904
902
  se,
905
- ce,
906
- N,
907
903
  le,
908
- P
909
- ]);
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
904
+ ue,
905
+ M,
906
+ N,
907
+ P,
908
+ de,
909
+ B
910
+ ]), Ke = t && n === a.Pdf, Z = t ? Ke ? "h-full" : "flex h-full items-center justify-center" : Ue, qe = t ? Ke ? /* @__PURE__ */ V(l, {}) : /* @__PURE__ */ V(te, { ariaLabel: B }) : Ge;
911
+ return /* @__PURE__ */ H("div", {
912
+ style: t ? void 0 : He,
913
+ className: y(Z, Ce),
914
+ children: [qe, /* @__PURE__ */ V(k, {
915
+ visuallyHidden: !0,
916
+ children: Ke ? B : ""
917
+ })]
914
918
  });
915
919
  }), Re = {
916
920
  mcpAppDivider: "_mcpAppDivider_1gxed_1",
917
921
  mcpAppVersion: "_mcpAppVersion_1gxed_5",
918
922
  panelHeader: "_panelHeader_1gxed_9"
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);
923
+ }, ze = 2e3, Be = P(({ isOpen: e, isLoading: t = !1, loadingContentType: n, onClose: r, onRetry: i, content: o, fileName: s, leftActions: l, labels: { ariaLabel: u, closeLabel: d = "Close", resizeLabel: f = "Resize panel", downloadLabel: p = "Download", copyTextLabel: m = "Copy text", copiedTextLabel: h = "Copied!", copyMarkdownLabel: _ = "Copy as Markdown", copiedMarkdownLabel: v = "Copied!", copyJsonLabel: b = "Copy as JSON", copiedJsonLabel: x = "Copied!", visualizerErrorLabel: E, unsupportedLabel: D = "Preview is not supported for this file", loadErrorLabel: ee = "Failed to load file", loadErrorRetryLabel: k = "Retry", forbiddenErrorLabel: A = "You don't have permission to access this file", htmlFrameBlockedLabel: te = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: j = "Open in new tab", htmlViewSourceLabel: ne = "View source", htmlViewRenderedLabel: ce = "View rendered", mcpAppReloadLabel: M = "Reload", pdfThumbnailsLabel: N, pdfShowThumbnailsLabel: P, pdfHideThumbnailsLabel: de, pdfPageNumberLabel: fe, pdfContentLoadingLabel: pe, pdfContentErrorLabel: me, pdfContentRetryLabel: U, xlsxFormulaLabel: he, codeContentLoadingLabel: G, codeContentErrorLabel: K, codeContentRetryLabel: ge, tableCopyLabel: _e, tableCopiedLabel: ve, tableDownloadCsvLabel: ye, codeBlockCopyLabel: be, codeBlockCopiedLabel: xe, codeBlockDownloadLabel: q, tableScrollRegionAriaLabel: Se, mathScrollRegionAriaLabel: J, ooxmlHighlightsLabel: Ce, ooxmlHighlightNavigatedLabel: we, loadingLabel: Te }, onDownload: Ee, onCopyText: De, onCopyMarkdown: Y, onCopyJson: Oe, tableDownloadFilename: ke, isMobile: Ae = !1, isBoundedOverlay: je = !1, defaultWidth: Me, minWidth: Ne = 600, maxWidth: X = 1500, onResizeStop: Pe, styles: Fe, codeBlockTheme: Ie, loadPdf: Be, configurePdfWorker: Ve, onVisualizerSendMessage: He, mcpAppHostContext: Ue }) => {
924
+ let [We, Ge] = z(!1), [Ke, Z] = z(!1), [qe, Je] = z(!1), [Ye, Xe] = z(!1), [Ze, Qe] = z(void 0), Q = R(null), $e = R(null), et = R(null), tt = F(() => {
925
+ De?.(), Q.current != null && clearTimeout(Q.current), Ge(!0), Q.current = setTimeout(() => Ge(!1), ze);
926
+ }, [De]), nt = F(() => {
927
+ Y?.(), $e.current != null && clearTimeout($e.current), Z(!0), $e.current = setTimeout(() => Z(!1), ze);
928
+ }, [Y]), rt = F(() => {
929
+ Oe?.(), et.current != null && clearTimeout(et.current), Je(!0), et.current = setTimeout(() => Je(!1), ze);
926
930
  }, [Oe]);
927
931
  I(() => () => {
928
- Q.current != null && clearTimeout(Q.current), Qe.current != null && clearTimeout(Qe.current), $e.current != null && clearTimeout($e.current);
932
+ Q.current != null && clearTimeout(Q.current), $e.current != null && clearTimeout($e.current), et.current != null && clearTimeout(et.current);
929
933
  }, []);
930
- let rt = F(() => {
931
- Ye((e) => !e);
934
+ let it = F(() => {
935
+ Xe((e) => !e);
932
936
  }, []);
933
937
  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,
938
+ Xe(!1), Qe(void 0);
939
+ }, [o]);
940
+ let { className: at, panelStyles: ot, ...st } = Fe ?? {}, { colors: ct, typography: lt } = st, ut = L(() => g({
941
+ "--ac-mcp-app-divider": ct?.mcpAppDividerColor,
942
+ "--ac-mcp-app-version": ct?.mcpAppVersionColor
943
+ }), [ct?.mcpAppDividerColor, ct?.mcpAppVersionColor]), dt = o.type === a.McpApp && Ze != null ? /* @__PURE__ */ H("span", {
944
+ style: ut,
941
945
  children: [
942
- /* @__PURE__ */ B("span", { children: o }),
943
- /* @__PURE__ */ B("span", {
946
+ /* @__PURE__ */ V("span", { children: s }),
947
+ /* @__PURE__ */ V("span", {
944
948
  "aria-hidden": !0,
945
- className: v("mx-1.5 inline-block h-3 w-0 border-s align-middle", Re.mcpAppDivider)
949
+ className: y("mx-1.5 inline-block h-3 w-0 border-s align-middle", Re.mcpAppDivider)
946
950
  }),
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
951
+ /* @__PURE__ */ V("span", { children: Ze.name }),
952
+ Ze.version && /* @__PURE__ */ V("span", {
953
+ className: y("ms-2", lt?.mcpAppVersionClassName ?? "dial-caption-text", Re.mcpAppVersion),
954
+ children: Ze.version
951
955
  })
952
956
  ]
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, {
957
+ }) : s, ft = !t && o.type === a.Html && (o.srcdoc != null || o.resolveSourceText != null), $ = !t && De != null && (o.type === a.PlainText || o.type === a.Code), pt = !t && Y != null && o.type === a.Markdown, mt = !t && Oe != null && o.type === a.Json, ht = !t && Ee != null && c(o), gt = !t && o.type === a.McpApp && o.onReload != null;
958
+ return /* @__PURE__ */ V(C, {
955
959
  isOpen: e,
956
960
  isBoundedOverlay: je,
957
- orientation: x.Right,
958
- title: ut,
961
+ orientation: S.Right,
962
+ title: dt,
959
963
  labels: {
960
- ariaLabel: l,
961
- closeLabel: u,
962
- resizeLabel: d
964
+ ariaLabel: u,
965
+ closeLabel: d,
966
+ resizeLabel: f
963
967
  },
964
- onClose: n,
968
+ onClose: r,
965
969
  resizable: !Ae || je,
966
970
  defaultWidth: Me,
967
971
  minWidth: Ne,
968
- maxWidth: Y,
972
+ maxWidth: X,
969
973
  onResizeStop: Pe,
970
974
  styles: {
971
- ...at,
975
+ ...ot,
972
976
  cssVars: {
973
- ...h({ "--ac-header-border": st?.headerBorder }),
974
- ...at?.cssVars
977
+ ...g({ "--ac-header-border": ct?.headerBorder }),
978
+ ...ot?.cssVars
975
979
  },
976
- titleClassName: at?.titleClassName ?? "dial-h3-text",
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)
980
+ titleClassName: ot?.titleClassName ?? "dial-h3-text",
981
+ headerClassName: y("border-b", Re.panelHeader, ot?.headerClassName),
982
+ className: y(!je && (e ? "mobile:w-full mobile:max-w-full" : "w-0"), at, ot?.className, W.panel)
979
983
  },
980
- leftActions: 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,
984
+ leftActions: l,
985
+ rightActions: ft || $ || pt || mt || ht || gt ? /* @__PURE__ */ H(B, { children: [
986
+ gt && /* @__PURE__ */ V(O, {
987
+ icon: /* @__PURE__ */ V(ue, {
988
+ size: w.LG,
989
+ stroke: T,
986
990
  "aria-hidden": !0
987
991
  }),
988
- "aria-label": N,
989
- tooltipProps: { tooltip: N },
990
- onClick: i.type === a.McpApp ? i.onReload : void 0
992
+ "aria-label": M,
993
+ tooltipProps: { tooltip: M },
994
+ onClick: o.type === a.McpApp ? o.onReload : void 0
991
995
  }),
992
- dt && /* @__PURE__ */ B(E, {
993
- icon: B(Je ? ae : re, {
994
- size: C.LG,
995
- stroke: w,
996
+ ft && /* @__PURE__ */ V(O, {
997
+ icon: V(Ye ? se : ie, {
998
+ size: w.LG,
999
+ stroke: T,
996
1000
  "aria-hidden": !0
997
1001
  }),
998
- "aria-label": Je ? oe : j,
999
- "aria-pressed": Je,
1000
- tooltipProps: { tooltip: Je ? oe : j },
1001
- onClick: rt
1002
+ "aria-label": Ye ? ce : ne,
1003
+ "aria-pressed": Ye,
1004
+ tooltipProps: { tooltip: Ye ? ce : ne },
1005
+ onClick: it
1002
1006
  }),
1003
- $ && /* @__PURE__ */ B(E, {
1004
- icon: B(He ? ne : M, {
1005
- size: C.LG,
1006
- stroke: w,
1007
+ $ && /* @__PURE__ */ V(O, {
1008
+ icon: V(We ? re : ae, {
1009
+ size: w.LG,
1010
+ stroke: T,
1007
1011
  "aria-hidden": !0
1008
1012
  }),
1009
- "aria-label": He ? m : p,
1010
- tooltipProps: { tooltip: He ? m : p },
1011
- onClick: et
1013
+ "aria-label": We ? h : m,
1014
+ tooltipProps: { tooltip: We ? h : m },
1015
+ onClick: tt
1012
1016
  }),
1013
- ft && /* @__PURE__ */ B(E, {
1014
- icon: B(We ? ne : se, {
1015
- size: C.LG,
1016
- stroke: w,
1017
+ pt && /* @__PURE__ */ V(O, {
1018
+ icon: V(Ke ? re : le, {
1019
+ size: w.LG,
1020
+ stroke: T,
1017
1021
  "aria-hidden": !0
1018
1022
  }),
1019
- "aria-label": We ? _ : g,
1020
- tooltipProps: { tooltip: We ? _ : g },
1021
- onClick: tt
1023
+ "aria-label": Ke ? v : _,
1024
+ tooltipProps: { tooltip: Ke ? v : _ },
1025
+ onClick: nt
1022
1026
  }),
1023
- pt && /* @__PURE__ */ B(E, {
1024
- icon: B(Ke ? ne : M, {
1025
- size: C.LG,
1026
- stroke: w,
1027
+ mt && /* @__PURE__ */ V(O, {
1028
+ icon: V(qe ? re : ae, {
1029
+ size: w.LG,
1030
+ stroke: T,
1027
1031
  "aria-hidden": !0
1028
1032
  }),
1029
- "aria-label": Ke ? b : y,
1030
- tooltipProps: { tooltip: Ke ? b : y },
1031
- onClick: nt
1033
+ "aria-label": qe ? x : b,
1034
+ tooltipProps: { tooltip: qe ? x : b },
1035
+ onClick: rt
1032
1036
  }),
1033
- mt && /* @__PURE__ */ B(E, {
1034
- icon: /* @__PURE__ */ B(ie, {
1035
- size: C.LG,
1036
- stroke: w
1037
+ ht && /* @__PURE__ */ V(O, {
1038
+ icon: /* @__PURE__ */ V(oe, {
1039
+ size: w.LG,
1040
+ stroke: T
1037
1041
  }),
1038
- "aria-label": f,
1039
- tooltipProps: { tooltip: f },
1042
+ "aria-label": p,
1043
+ tooltipProps: { tooltip: p },
1040
1044
  onClick: Ee
1041
1045
  })
1042
1046
  ] }) : null,
1043
- children: /* @__PURE__ */ B(Le, {
1044
- content: i,
1047
+ children: /* @__PURE__ */ V(Le, {
1048
+ content: o,
1045
1049
  isLoading: t,
1046
- fileName: o,
1047
- isHtmlSourceView: Je,
1048
- onAppInfo: i.type === a.McpApp ? Ze : void 0,
1049
- onRetry: r,
1050
+ loadingContentType: n,
1051
+ fileName: s,
1052
+ isHtmlSourceView: Ye,
1053
+ onAppInfo: o.type === a.McpApp ? Qe : void 0,
1054
+ onRetry: i,
1050
1055
  labels: {
1051
- unsupportedLabel: ee,
1052
- loadErrorLabel: D,
1053
- loadErrorRetryLabel: O,
1054
- forbiddenErrorLabel: k,
1055
- visualizerErrorLabel: T,
1056
+ unsupportedLabel: D,
1057
+ loadErrorLabel: ee,
1058
+ loadErrorRetryLabel: k,
1059
+ forbiddenErrorLabel: A,
1060
+ visualizerErrorLabel: E,
1056
1061
  htmlFrameBlockedLabel: te,
1057
- htmlOpenInNewTabLabel: A,
1058
- pdfThumbnailsLabel: le,
1062
+ htmlOpenInNewTabLabel: j,
1063
+ pdfThumbnailsLabel: N,
1059
1064
  pdfShowThumbnailsLabel: P,
1060
- pdfHideThumbnailsLabel: ue,
1061
- pdfPageNumberLabel: de,
1062
- pdfContentLoadingLabel: fe,
1065
+ pdfHideThumbnailsLabel: de,
1066
+ pdfPageNumberLabel: fe,
1067
+ pdfContentLoadingLabel: pe,
1063
1068
  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,
1069
+ pdfContentRetryLabel: U,
1070
+ xlsxFormulaLabel: he,
1071
+ codeContentLoadingLabel: G,
1072
+ codeContentErrorLabel: K,
1073
+ codeContentRetryLabel: ge,
1074
+ tableCopyLabel: _e,
1075
+ tableCopiedLabel: ve,
1076
+ tableDownloadCsvLabel: ye,
1072
1077
  codeBlockCopyLabel: be,
1073
- codeBlockCopiedLabel: K,
1074
- codeBlockDownloadLabel: xe,
1078
+ codeBlockCopiedLabel: xe,
1079
+ codeBlockDownloadLabel: q,
1075
1080
  tableScrollRegionAriaLabel: Se,
1076
- mathScrollRegionAriaLabel: q,
1081
+ mathScrollRegionAriaLabel: J,
1077
1082
  ooxmlHighlightsLabel: Ce,
1078
1083
  ooxmlHighlightNavigatedLabel: we,
1079
1084
  loadingLabel: Te
1080
1085
  },
1081
- styles: ot,
1086
+ styles: st,
1082
1087
  codeBlockTheme: Ie,
1083
1088
  tableDownloadFilename: ke,
1084
- loadPdf: ze,
1085
- configurePdfWorker: Be,
1086
- onVisualizerSendMessage: Z,
1087
- mcpAppHostContext: Ve
1089
+ loadPdf: Be,
1090
+ configurePdfWorker: Ve,
1091
+ onVisualizerSendMessage: He,
1092
+ mcpAppHostContext: Ue
1088
1093
  })
1089
1094
  });
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
+ }), Ve = /* @__PURE__ */ new Set(["html", "htm"]), He = {
1096
+ docx: m.DOCX,
1097
+ xlsx: m.XLSX,
1098
+ pptx: m.PPTX
1099
+ }, Ue = /* @__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(".")), We = {
1095
1100
  docx: i.Docx,
1096
1101
  xlsx: i.Xlsx,
1097
1102
  pptx: i.Pptx,
1098
1103
  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) => {
1104
+ }, Ge = {
1105
+ [He.docx]: i.Docx,
1106
+ [He.xlsx]: i.Xlsx,
1107
+ [He.pptx]: i.Pptx,
1108
+ [m.CSV]: i.Csv
1109
+ }, Ke = {
1110
+ [i.Docx]: He.docx,
1111
+ [i.Xlsx]: He.xlsx,
1112
+ [i.Pptx]: He.pptx,
1113
+ [i.Csv]: m.CSV
1114
+ }, Z = (e, t) => {
1110
1115
  let n = t?.split(";", 1)[0].trim().toLowerCase();
1111
1116
  if (n != null) {
1112
- let e = Ue[n];
1117
+ let e = Ge[n];
1113
1118
  if (e != null) return e;
1114
1119
  }
1115
1120
  let r = e.lastIndexOf(".");
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) => {
1121
- let t = e.lastIndexOf(".");
1122
- return t !== -1 && Ve.has(e.slice(t + 1).toLowerCase());
1121
+ if (r !== -1) return We[e.slice(r + 1).toLowerCase()];
1122
+ }, qe = (e, t) => Z(e, t) != null, Je = (e, t) => {
1123
+ let n = Z(e, t);
1124
+ return n == null ? void 0 : Ke[n];
1123
1125
  }, Ye = (e) => {
1124
1126
  let t = e.lastIndexOf(".");
1125
- return t !== -1 && Be.has(e.slice(t + 1).toLowerCase());
1126
- }, Xe = {
1127
+ return t !== -1 && Ue.has(e.slice(t + 1).toLowerCase());
1128
+ }, Xe = (e) => {
1129
+ let t = e.lastIndexOf(".");
1130
+ return t !== -1 && Ve.has(e.slice(t + 1).toLowerCase());
1131
+ }, Ze = {
1127
1132
  xml: "xml",
1128
1133
  csv: "plaintext",
1129
1134
  tsv: "plaintext",
@@ -1171,28 +1176,28 @@ var H = { panel: "dial-attachment-canvas-panel" }, U = "h-full overflow-auto p-4
1171
1176
  gitignore: "plaintext",
1172
1177
  dockerfile: "plaintext",
1173
1178
  makefile: "plaintext"
1174
- }, Ze = (e) => Xe[e], Q = (e) => ({
1179
+ }, Qe = (e) => Ze[e], Q = (e) => ({
1175
1180
  type: a.Unsupported,
1176
1181
  ...e != null && { url: e }
1177
- }), Qe = (e) => ({
1182
+ }), $e = (e) => ({
1178
1183
  type: a.Error,
1179
1184
  errorType: r.LoadFailed,
1180
1185
  ...e != null && { url: e }
1181
- }), $e = (e) => ({
1186
+ }), et = (e) => ({
1182
1187
  type: a.Error,
1183
1188
  errorType: r.Forbidden,
1184
1189
  ...e != null && { url: e }
1185
- }), et = (e) => {
1190
+ }), tt = (e) => {
1186
1191
  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);
1192
+ }, nt = (e) => {
1193
+ let t = tt(e);
1189
1194
  t != null && URL.revokeObjectURL(t);
1190
- }, nt = {
1195
+ }, rt = {
1191
1196
  type: a.PlainText,
1192
1197
  text: ""
1193
- }, rt = N(void 0);
1194
- rt.displayName = "AttachmentCanvasContext";
1195
- var it = N(void 0), at = ({ children: e }) => {
1198
+ }, it = M(void 0);
1199
+ it.displayName = "AttachmentCanvasContext";
1200
+ var at = M(void 0), ot = ({ children: e }) => {
1196
1201
  let t = R(0), n = F(() => {
1197
1202
  let e = ++t.current;
1198
1203
  return () => e === t.current;
@@ -1200,49 +1205,51 @@ var it = N(void 0), at = ({ children: e }) => {
1200
1205
  I(() => () => {
1201
1206
  t.current += 1;
1202
1207
  }, []);
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) => {
1204
- u(e), f(t), m(void 0), o(!0), i(!0);
1205
- }, []), g = F((e, t, n, r) => {
1206
- c(e), u(t), f(n), m(r == null ? void 0 : () => r), o(!1), i(!0);
1207
- }, []), _ = F(() => {
1208
- c(nt), i(!1), o(!1), f(void 0), m(void 0);
1208
+ let [r, i] = z(!1), [a, o] = z(!1), [s, c] = z(void 0), [l, u] = z(rt), [d, f] = z(void 0), [p, m] = z(void 0), [h, g] = z(void 0), _ = F((e, t, n) => {
1209
+ f(e), m(t), c(n), g(void 0), o(!0), i(!0);
1210
+ }, []), v = F((e, t, n, r) => {
1211
+ u(e), f(t), m(n), g(r == null ? void 0 : () => r), o(!1), c(void 0), i(!0);
1212
+ }, []), y = F(() => {
1213
+ u(rt), i(!1), o(!1), c(void 0), m(void 0), g(void 0);
1209
1214
  }, []);
1210
1215
  return I(() => () => {
1211
- let e = et(s);
1216
+ let e = tt(l);
1212
1217
  e != null && URL.revokeObjectURL(e);
1213
- }, [s]), /* @__PURE__ */ B(rt.Provider, {
1218
+ }, [l]), /* @__PURE__ */ V(it.Provider, {
1214
1219
  value: L(() => ({
1215
1220
  isOpen: r,
1216
1221
  isLoading: a,
1217
- content: s,
1218
- fileName: l,
1219
- attachmentId: d,
1220
- openCanvasLoading: h,
1221
- openCanvas: g,
1222
- closeCanvas: _,
1223
- retryCanvas: p
1222
+ loadingContentType: s,
1223
+ content: l,
1224
+ fileName: d,
1225
+ attachmentId: p,
1226
+ openCanvasLoading: _,
1227
+ openCanvas: v,
1228
+ closeCanvas: y,
1229
+ retryCanvas: h
1224
1230
  }), [
1225
1231
  r,
1226
1232
  a,
1227
1233
  s,
1228
1234
  l,
1229
1235
  d,
1230
- h,
1231
- g,
1236
+ p,
1232
1237
  _,
1233
- p
1238
+ v,
1239
+ y,
1240
+ h
1234
1241
  ]),
1235
- children: /* @__PURE__ */ B(it.Provider, {
1242
+ children: /* @__PURE__ */ V(at.Provider, {
1236
1243
  value: n,
1237
1244
  children: e
1238
1245
  })
1239
1246
  });
1240
- }, ot = () => {
1241
- let e = ue(rt);
1247
+ }, st = () => {
1248
+ let e = de(it);
1242
1249
  if (!e) throw Error("useAttachmentCanvas must be used within an AttachmentCanvasProvider");
1243
1250
  return e;
1244
- }, st = () => ue(it), ct = () => {
1245
- let e = ue(it);
1251
+ }, ct = () => de(at), lt = () => {
1252
+ let e = de(at);
1246
1253
  if (!e) throw Error("useLatestCanvasRequest must be used within an AttachmentCanvasProvider");
1247
1254
  let t = R(void 0);
1248
1255
  return I(() => (t.current = {}, () => {
@@ -1251,69 +1258,70 @@ var it = N(void 0), at = ({ children: e }) => {
1251
1258
  let n = t.current, r = e();
1252
1259
  return () => n !== void 0 && t.current === n && r();
1253
1260
  }, [e]);
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,
1261
+ }, ut = 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 }) => {
1262
+ let { ariaLabel: h = "Attachment preview", closeLabel: g = "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: ee, htmlOpenInNewTabLabel: k, htmlViewSourceLabel: A, htmlViewRenderedLabel: te, pdfThumbnailsLabel: j, pdfShowThumbnailsLabel: ne, pdfHideThumbnailsLabel: re, pdfPageNumberLabel: ie, pdfContentLoadingLabel: ae, pdfContentErrorLabel: oe, pdfContentRetryLabel: se, xlsxFormulaLabel: ce, codeContentLoadingLabel: le, codeContentErrorLabel: ue, codeContentRetryLabel: M, tableCopyLabel: N, tableCopiedLabel: P, tableDownloadCsvLabel: de, codeBlockCopyLabel: I, codeBlockCopiedLabel: L, codeBlockDownloadLabel: R, tableScrollRegionAriaLabel: z, mathScrollRegionAriaLabel: fe, ooxmlHighlightsLabel: pe, ooxmlHighlightNavigatedLabel: B, loadingLabel: H } = e ?? {}, { isOpen: me, isLoading: U, loadingContentType: he, content: W, fileName: G, closeCanvas: K, retryCanvas: ge } = st(), _e = F(() => {
1263
+ o(W, G);
1264
+ }, [W, G]), ve = F(() => {
1265
+ (W.type === a.PlainText || W.type === a.Code) && _(W.text);
1266
+ }, [W]), ye = F(() => {
1267
+ W.type === a.Markdown && _(W.text);
1268
+ }, [W]), be = F(() => {
1269
+ W.type === a.Json && _(JSON.stringify(W.value, null, 2));
1270
+ }, [W]);
1271
+ return /* @__PURE__ */ V(Be, {
1272
+ isOpen: me,
1273
+ isLoading: U,
1274
+ loadingContentType: he,
1275
+ onClose: K,
1276
+ onRetry: ge,
1277
+ content: W,
1278
+ fileName: G,
1271
1279
  leftActions: t,
1272
1280
  labels: {
1273
1281
  ariaLabel: h,
1274
- closeLabel: _,
1282
+ closeLabel: g,
1275
1283
  downloadLabel: v,
1276
1284
  copyTextLabel: C,
1277
1285
  copiedTextLabel: w,
1278
1286
  copyMarkdownLabel: T,
1279
- copiedMarkdownLabel: ee,
1280
- copyJsonLabel: E,
1281
- copiedJsonLabel: D,
1287
+ copiedMarkdownLabel: E,
1288
+ copyJsonLabel: D,
1289
+ copiedJsonLabel: O,
1282
1290
  unsupportedLabel: y,
1283
1291
  loadErrorLabel: b,
1284
1292
  loadErrorRetryLabel: x,
1285
1293
  forbiddenErrorLabel: S,
1286
- htmlFrameBlockedLabel: O,
1294
+ htmlFrameBlockedLabel: ee,
1287
1295
  htmlOpenInNewTabLabel: k,
1288
- htmlViewSourceLabel: te,
1289
- htmlViewRenderedLabel: A,
1296
+ htmlViewSourceLabel: A,
1297
+ htmlViewRenderedLabel: te,
1290
1298
  pdfThumbnailsLabel: j,
1291
1299
  pdfShowThumbnailsLabel: ne,
1292
1300
  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,
1301
+ pdfPageNumberLabel: ie,
1302
+ pdfContentLoadingLabel: ae,
1303
+ pdfContentErrorLabel: oe,
1304
+ pdfContentRetryLabel: se,
1305
+ xlsxFormulaLabel: ce,
1306
+ codeContentLoadingLabel: le,
1307
+ codeContentErrorLabel: ue,
1308
+ codeContentRetryLabel: M,
1309
+ tableCopyLabel: N,
1310
+ tableCopiedLabel: P,
1311
+ tableDownloadCsvLabel: de,
1312
+ codeBlockCopyLabel: I,
1313
+ codeBlockCopiedLabel: L,
1314
+ codeBlockDownloadLabel: R,
1315
+ tableScrollRegionAriaLabel: z,
1308
1316
  mathScrollRegionAriaLabel: fe,
1309
1317
  ooxmlHighlightsLabel: pe,
1310
- ooxmlHighlightNavigatedLabel: V,
1311
- loadingLabel: me
1318
+ ooxmlHighlightNavigatedLabel: B,
1319
+ loadingLabel: H
1312
1320
  },
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,
1321
+ onDownload: _e,
1322
+ onCopyText: W.type === a.PlainText || W.type === a.Code ? ve : void 0,
1323
+ onCopyMarkdown: W.type === a.Markdown ? ye : void 0,
1324
+ onCopyJson: W.type === a.Json ? be : void 0,
1317
1325
  tableDownloadFilename: u,
1318
1326
  isMobile: n,
1319
1327
  isBoundedOverlay: r,
@@ -1326,43 +1334,43 @@ var it = N(void 0), at = ({ children: e }) => {
1326
1334
  onVisualizerSendMessage: p,
1327
1335
  mcpAppHostContext: m
1328
1336
  });
1329
- }), ut = {
1337
+ }), dt = {
1330
1338
  frame: "_frame_1ys0b_1",
1331
1339
  header: "_header_1ys0b_6",
1332
1340
  title: "_title_1ys0b_10"
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 }) => {
1341
+ }, ft = 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
1342
  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({
1343
+ return /* @__PURE__ */ H("div", {
1344
+ className: y("flex w-full min-w-0 flex-col overflow-hidden", !l && ["rounded-xl border", dt.frame]),
1345
+ style: g({
1338
1346
  "--igv-bg": d?.background,
1339
1347
  "--igv-border": d?.border,
1340
1348
  "--igv-title-text": d?.titleText
1341
1349
  }),
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),
1350
+ children: [/* @__PURE__ */ H("div", {
1351
+ className: y("flex min-h-10 items-center gap-2 py-2", m ? "justify-between" : "justify-end", !l && ["border-b px-4", dt.header]),
1352
+ children: [m && /* @__PURE__ */ V("span", {
1353
+ className: y("min-w-0 truncate", c, dt.title),
1346
1354
  children: p
1347
- }), /* @__PURE__ */ B("div", {
1355
+ }), /* @__PURE__ */ V("div", {
1348
1356
  role: "toolbar",
1349
1357
  "aria-label": i,
1350
1358
  className: "flex items-center gap-1",
1351
- children: /* @__PURE__ */ B(E, {
1352
- icon: /* @__PURE__ */ B(j, {
1353
- size: C.SM,
1354
- stroke: w,
1359
+ children: /* @__PURE__ */ V(O, {
1360
+ icon: /* @__PURE__ */ V(ne, {
1361
+ size: w.SM,
1362
+ stroke: T,
1355
1363
  "aria-hidden": !0
1356
1364
  }),
1357
1365
  "aria-label": r,
1358
- size: T.Small,
1366
+ size: E.Small,
1359
1367
  onClick: n
1360
1368
  })
1361
1369
  })]
1362
- }), /* @__PURE__ */ B("div", {
1370
+ }), /* @__PURE__ */ V("div", {
1363
1371
  className: "w-full",
1364
1372
  style: { height: `${t}px` },
1365
- children: /* @__PURE__ */ B(Ne, {
1373
+ children: /* @__PURE__ */ V(Ne, {
1366
1374
  content: e,
1367
1375
  loadingLabel: o,
1368
1376
  errorLabel: s,
@@ -1373,21 +1381,30 @@ var it = N(void 0), at = ({ children: e }) => {
1373
1381
  });
1374
1382
  }), $ = /* @__PURE__ */ function(e) {
1375
1383
  return e.Pdf = "resolvePdfContent", e.Markdown = "resolveMarkdownContent", e.Json = "resolveJsonContent", e;
1376
- }({}), ft = {
1377
- [p.PDF]: $.Pdf,
1384
+ }({}), pt = {
1385
+ [m.PDF]: $.Pdf,
1386
+ [m.Markdown]: $.Markdown,
1387
+ [m.JSON]: $.Json
1388
+ }, mt = {
1378
1389
  [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) => {
1390
+ [p.MarkdownAlt]: $.Markdown,
1391
+ [p.JSON]: $.Json,
1392
+ [p.PDF]: $.Pdf
1393
+ }, ht = (e, t) => {
1394
+ let n = e.contentType.toLowerCase();
1395
+ if (Y(n, t) != null || Z("", n) != null) return;
1396
+ let r = pt[n];
1397
+ if (r != null) return r === $.Pdf ? a.Pdf : void 0;
1398
+ let i = e.name ?? "";
1399
+ if (Z(i) != null) return;
1400
+ let o = i.lastIndexOf(".");
1401
+ return mt[o === -1 ? "" : i.slice(o + 1).toLowerCase()] === $.Pdf ? a.Pdf : void 0;
1402
+ }, gt = (e) => {
1386
1403
  let t;
1387
1404
  try {
1388
1405
  t = new URL(e).pathname;
1389
1406
  } catch {
1390
- t = b(e);
1407
+ t = x(e);
1391
1408
  }
1392
1409
  let n = t.split("/").filter(Boolean).pop() ?? "";
1393
1410
  try {
@@ -1395,13 +1412,13 @@ var it = N(void 0), at = ({ children: e }) => {
1395
1412
  } catch {
1396
1413
  return n;
1397
1414
  }
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) => {
1415
+ }, _t = (e, t) => {
1416
+ let { openCanvas: n, openCanvasLoading: r, closeCanvas: i } = st(), o = ct(), { customVisualizers: s, themeId: c, onBeforeOpen: l } = t, d = R(null), f = F(async (t, n, r) => {
1400
1417
  if (t.url == null && t.referenceUrl != null) {
1401
1418
  let i = e.resolveReferencePdfContent(t);
1402
1419
  if (i != null) return r(i, t.name, n);
1403
1420
  }
1404
- let i = t.contentType.toLowerCase(), o = J(i, s);
1421
+ let i = t.contentType.toLowerCase(), o = Y(i, s);
1405
1422
  if (o != null) {
1406
1423
  let i = await e.resolveVisualizerContent(t, o, c);
1407
1424
  if (i != null) return r(i, t.name, n);
@@ -1410,19 +1427,19 @@ var it = N(void 0), at = ({ children: e }) => {
1410
1427
  let i = await e.resolveTextContent(t);
1411
1428
  if (i != null) return r(i, t.name, n);
1412
1429
  }
1413
- let l = Ge("", i);
1430
+ let l = Z("", i);
1414
1431
  if (l != null) return r(await e.resolveOoxmlContent(t, l) ?? Q(e.resolveContentUrl(t)), t.name, n);
1415
- let u = ft[i];
1432
+ let u = pt[i];
1416
1433
  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);
1434
+ let d = t.name ?? "", f = d.lastIndexOf("."), p = f === -1 ? "" : d.slice(f + 1).toLowerCase(), m = Z(d);
1418
1435
  if (m != null) return r(await e.resolveOoxmlContent(t, m) ?? Q(e.resolveContentUrl(t)), t.name, n);
1419
- let h = pt[p];
1436
+ let h = mt[p];
1420
1437
  if (h != null) {
1421
1438
  let i = await e[h](t);
1422
1439
  return i != null && r(i, t.name, n);
1423
1440
  }
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);
1441
+ let g = t.name != null && Xe(t.name) || t.url != null && Xe(gt(t.url));
1442
+ if (t.name != null && !Ye(t.name) && !g) return r(Q(e.resolveContentUrl(t)), t.name, n);
1426
1443
  if (g) {
1427
1444
  let i = await e.resolveHtmlContent(t);
1428
1445
  return i == null ? e.hasTextSource(t) ? r(Q(e.resolveContentUrl(t)), t.name, n) : t.url != null && r({
@@ -1430,40 +1447,40 @@ var it = N(void 0), at = ({ children: e }) => {
1430
1447
  url: t.url
1431
1448
  }, t.name, n) : r(i, t.name, n);
1432
1449
  }
1433
- let _ = await e.resolveCodeContent(t, Ze(p));
1450
+ let _ = await e.resolveCodeContent(t, Qe(p));
1434
1451
  return _ != null && r(_, t.name, n);
1435
1452
  }, [
1436
1453
  s,
1437
1454
  c,
1438
1455
  e
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);
1456
+ ]), p = F(async (t, c = t.id, p) => {
1457
+ let m = () => p == null || p(), h = (e, t, r) => m() ? (n(e, t, r), !0) : (nt(e), !1);
1441
1458
  switch (t.type) {
1442
- case l.Image: {
1459
+ case u.Image: {
1443
1460
  let r = e.resolveImageContent(t);
1444
- return r != null && (u?.(), n(r, t.name, s), !0);
1461
+ return r != null && (l?.(), n(r, t.name, c), !0);
1445
1462
  }
1446
- case l.Audio: {
1463
+ case u.Audio: {
1447
1464
  let e = t.playUrl ?? t.url;
1448
1465
  return e != null && (n({
1449
1466
  type: a.Audio,
1450
1467
  url: e,
1451
1468
  mimeType: t.contentType || void 0
1452
- }, t.name, s), !0);
1469
+ }, t.name, c), !0);
1453
1470
  }
1454
- case l.File: {
1471
+ case u.File: {
1455
1472
  let e = () => {
1456
- d.current?.(t, s, o?.());
1457
- }, a = (t, r, i) => p() ? (n(t, r, i, e), !0) : (tt(t), !1);
1458
- u?.(), r(t.name, s);
1459
- let c = await f(t, s, a);
1460
- return !c && p() && i(), c;
1473
+ d.current?.(t, c, o?.());
1474
+ }, a = (t, r, i) => m() ? (n(t, r, i, e), !0) : (nt(t), !1);
1475
+ l?.(), r(t.name, c, ht(t, s));
1476
+ let u = await f(t, c, a);
1477
+ return !u && m() && i(), u;
1461
1478
  }
1462
- case l.Pasted:
1463
- case l.Prompt: {
1464
- u?.(), r(t.name, s);
1479
+ case u.Pasted:
1480
+ case u.Prompt: {
1481
+ l?.(), r(t.name, c);
1465
1482
  let n = await e.resolveTextContent(t);
1466
- return n == null ? (p() && i(), !1) : m(n, t.name, s);
1483
+ return n == null ? (m() && i(), !1) : h(n, t.name, c);
1467
1484
  }
1468
1485
  default: return !1;
1469
1486
  }
@@ -1471,14 +1488,15 @@ var it = N(void 0), at = ({ children: e }) => {
1471
1488
  n,
1472
1489
  r,
1473
1490
  i,
1474
- u,
1491
+ l,
1475
1492
  f,
1476
1493
  e,
1477
- o
1494
+ o,
1495
+ s
1478
1496
  ]);
1479
1497
  return I(() => {
1480
1498
  d.current = p;
1481
1499
  }, [p]), { openAttachmentCanvas: p };
1482
1500
  };
1483
1501
  //#endregion
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 };
1502
+ export { W as ATTACHMENT_CANVAS_CLASS, Be as AttachmentCanvas, Le as AttachmentCanvasBody, ut as AttachmentCanvasContainer, ot as AttachmentCanvasProvider, a as AttachmentContentType, r as AttachmentErrorType, be as CodeContent, xe as HTML_PREVIEW_FRAME_RENDER_MESSAGE, ft as InlineGroupedVisualizer, e as McpAppCanvasRenderer, i as OoxmlFileType, n as OoxmlHighlightKind, et as createForbiddenCanvasContent, $e as createLoadErrorCanvasContent, Q as createUnsupportedCanvasContent, o as downloadAttachmentContent, Qe as extensionToLanguage, Oe as findVisualizerForApplication, Y as findVisualizerForMime, Z as getOoxmlFileType, Je as getOoxmlMimeType, ke as groupedVisualizerCanvasKey, c as isDownloadable, Xe as isHtmlPreviewable, qe as isOoxmlPreviewable, Ye as isTextPreviewable, Ae as partitionAttachmentsForApplicationVisualizer, st as useAttachmentCanvas, lt as useLatestCanvasRequest, _t as useOpenAttachmentCanvas };