@epam/ai-dial-attachment-canvas 1.2.0-dev.219 → 1.2.0-dev.229

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,45 +1,45 @@
1
1
  import { a as e, i as t, n, r, t as i } from "./attachment-canvas-BgwyzrRC.js";
2
2
  import { i as a, o, t as s } from "./LazyContentBoundary-tNE1ExbI.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, mergeClasses as g, restrainedSyntaxTheme as _, stripUrlQueryAndFragment as v } from "@epam/ai-dial-chat-shared";
4
- import { SidebarOrientation as y, SidebarPanel as b } from "@epam/ai-dial-sidebar";
5
- import { DIAL_ICON_SIZE as x, DIAL_KIT_ICON_STROKE as S, ElementSize as C, GhostIconButton as w, LinkButton as T, Spinner as E } from "@epam/ai-dial-ui-kit";
6
- import { IconAlertTriangle as D, IconArrowsMaximize as O, IconCheck as k, IconCode as ee, IconCopy as A, IconDownload as te, IconEye as ne, IconLock as re, IconMarkdown as ie, IconRefresh as ae } from "@tabler/icons-react";
7
- import { createContext as oe, lazy as j, memo as M, useCallback as N, useContext as P, useEffect as F, useMemo as I, useRef as L, useState as R } from "react";
8
- import { JsonView as se, defaultStyles as z } from "react-json-view-lite";
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, GhostIconButton as T, LinkButton as E, Spinner as D } from "@epam/ai-dial-ui-kit";
6
+ import { IconAlertTriangle as O, IconArrowsMaximize as k, IconCheck as A, IconCode as ee, IconCopy as te, IconDownload as ne, IconEye as re, IconLock as ie, IconMarkdown as ae, IconRefresh as oe } from "@tabler/icons-react";
7
+ import { createContext as j, lazy as M, memo as N, useCallback as P, useContext as se, useEffect as F, useMemo as I, useRef as L, useState as R } from "react";
8
+ import { JsonView as z, defaultStyles as ce } from "react-json-view-lite";
9
9
  import { Fragment as B, jsx as V, jsxs as H } from "react/jsx-runtime";
10
- import { AppBridge as U, AppFrame as W } from "@mcp-ui/client";
11
- import { McpUiHostContextChangedNotificationSchema as ce } from "@modelcontextprotocol/ext-apps/app-bridge";
12
- import { VisualizerConnectorRequests as le } from "@epam/ai-dial-shared";
13
- import { VisualizerConnector as ue } from "@epam/ai-dial-visualizer-connector";
10
+ import { AppBridge as U, AppFrame as le } from "@mcp-ui/client";
11
+ import { McpUiHostContextChangedNotificationSchema as ue } from "@modelcontextprotocol/ext-apps/app-bridge";
12
+ import { VisualizerConnectorRequests as W } from "@epam/ai-dial-shared";
13
+ import { VisualizerConnector as de } from "@epam/ai-dial-visualizer-connector";
14
14
  //#region src/constants/public-class-names.ts
15
- var de = { panel: "dial-attachment-canvas-panel" }, fe = {
15
+ var fe = { panel: "dial-attachment-canvas-panel" }, pe = {
16
16
  container: "_container_1nhig_1",
17
17
  containerLight: "_containerLight_1nhig_5"
18
- }, pe = {
19
- [l.Dark]: _,
20
- [l.Light]: _
21
- }, G = () => j(async () => {
18
+ }, G = {
19
+ [l.Dark]: v,
20
+ [l.Light]: v
21
+ }, me = () => M(async () => {
22
22
  let { Prism: e } = await import("react-syntax-highlighter");
23
23
  return { default: e };
24
- }), me = M(({ content: e, codeBlockTheme: t = l.Light, labels: n }) => {
25
- let { text: r, language: i } = e, a = i == null || i === "plaintext", o = pe[t], c = t === l.Light, [u, d] = R(0), f = I(G, [u]), p = N(() => {
26
- d((e) => e + 1);
27
- }, []), m = /* @__PURE__ */ V("pre", {
24
+ }), he = N(({ content: e, codeBlockTheme: t = l.Light, labels: n }) => {
25
+ let { text: r, language: i } = e, a = I(() => g(r), [r]), o = i == null || i === "plaintext" || !a, c = G[t], u = t === l.Light, [d, f] = R(0), p = I(me, [d]), m = P(() => {
26
+ f((e) => e + 1);
27
+ }, []), h = /* @__PURE__ */ V("pre", {
28
28
  className: "whitespace-pre-wrap break-words p-4",
29
29
  children: r
30
30
  });
31
31
  return /* @__PURE__ */ V("div", {
32
32
  dir: "ltr",
33
- className: g("h-full overflow-auto", fe.container, c && fe.containerLight),
34
- children: a ? m : /* @__PURE__ */ V(s, {
35
- retryKey: u,
36
- onRetry: p,
37
- pendingContent: m,
38
- errorContent: m,
33
+ className: _("h-full overflow-auto", pe.container, u && pe.containerLight),
34
+ children: o ? h : /* @__PURE__ */ V(s, {
35
+ retryKey: d,
36
+ onRetry: m,
37
+ pendingContent: h,
38
+ errorContent: h,
39
39
  labels: n,
40
- children: /* @__PURE__ */ V(f, {
40
+ children: /* @__PURE__ */ V(p, {
41
41
  language: i,
42
- style: o,
42
+ style: c,
43
43
  customStyle: {
44
44
  margin: 0,
45
45
  borderRadius: 0,
@@ -54,24 +54,24 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
54
54
  })
55
55
  })
56
56
  });
57
- }), he = { openInNewTabButton: "_openInNewTabButton_c1arc_1" }, ge = M(({ content: e, labels: t, isSourceView: n, title: r, codeBlockTheme: a, openInNewTabButtonTypographyClassName: o = "dial-body-semi-text" }) => {
58
- let { htmlFrameBlockedLabel: s = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: c = "Open in new tab" } = t, [l, u] = R(!0), [d, f] = R(!1), [p, m] = R(void 0), [h, _] = R(!1), [v, y] = R(!1), b = L(null);
57
+ }), ge = { openInNewTabButton: "_openInNewTabButton_c1arc_1" }, _e = N(({ content: e, labels: t, isSourceView: n, title: r, codeBlockTheme: a, openInNewTabButtonTypographyClassName: o = "dial-body-semi-text" }) => {
58
+ let { htmlFrameBlockedLabel: s = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: c = "Open in new tab" } = t, [l, u] = R(!0), [d, f] = R(!1), [p, m] = R(void 0), [h, g] = R(!1), [v, y] = R(!1), b = L(null);
59
59
  F(() => {
60
- u(!0), f(!1), m(void 0), _(!1), y(!1);
60
+ u(!0), f(!1), m(void 0), g(!1), y(!1);
61
61
  }, [e]);
62
62
  let x = L(n);
63
63
  x.current !== n && (x.current = n, n && v && y(!1)), F(() => {
64
64
  if (!n || e.srcdoc != null || e.resolveSourceText == null || p != null) return;
65
65
  let t = !1, r = e.resolveSourceText;
66
66
  return (async () => {
67
- _(!0);
67
+ g(!0);
68
68
  try {
69
69
  let e = await r();
70
70
  t || m(e);
71
71
  } catch {
72
72
  t || y(!0);
73
73
  } finally {
74
- t || _(!1);
74
+ t || g(!1);
75
75
  }
76
76
  })(), () => {
77
77
  t = !0;
@@ -81,19 +81,19 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
81
81
  e,
82
82
  p
83
83
  ]);
84
- let S = e.isSameOriginUrl === !0 && e.url != null, C = !S && e.srcdoc != null, w = N((e) => {
84
+ let S = e.isSameOriginUrl === !0 && e.url != null, C = !S && e.srcdoc != null, w = P((e) => {
85
85
  if (u(!1), !(C || S)) try {
86
86
  b.current?.contentDocument ?? f(!0);
87
87
  } catch {
88
88
  f(!0);
89
89
  }
90
- }, [C, S]), D = N(() => {
90
+ }, [C, S]), T = P(() => {
91
91
  u(!1), f(!0);
92
- }, []), O = e.srcdoc ?? p, k = e.srcdoc != null || e.resolveSourceText != null, ee = e.srcdoc == null && e.resolveSourceText != null && p == null && !v;
93
- if (n && k && (O != null || h || ee)) return O == null ? /* @__PURE__ */ V("div", {
92
+ }, []), O = e.srcdoc ?? p, k = e.srcdoc != null || e.resolveSourceText != null, A = e.srcdoc == null && e.resolveSourceText != null && p == null && !v;
93
+ if (n && k && (O != null || h || A)) return O == null ? /* @__PURE__ */ V("div", {
94
94
  className: "flex h-full items-center justify-center",
95
- children: /* @__PURE__ */ V(E, {})
96
- }) : /* @__PURE__ */ V(me, {
95
+ children: /* @__PURE__ */ V(D, {})
96
+ }) : /* @__PURE__ */ V(he, {
97
97
  content: {
98
98
  type: i.Code,
99
99
  text: O,
@@ -106,35 +106,35 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
106
106
  children: [/* @__PURE__ */ V("p", {
107
107
  className: "text-center",
108
108
  children: s
109
- }), e.url != null && /* @__PURE__ */ V(T, {
109
+ }), e.url != null && /* @__PURE__ */ V(E, {
110
110
  href: e.url,
111
111
  target: "_blank",
112
112
  label: c,
113
- className: he.openInNewTabButton,
113
+ className: ge.openInNewTabButton,
114
114
  textClassName: o
115
115
  })]
116
116
  });
117
- let A = C ? void 0 : e.url, te = C ? e.srcdoc : void 0;
117
+ let ee = C ? void 0 : e.url, te = C ? e.srcdoc : void 0;
118
118
  return /* @__PURE__ */ H("div", {
119
119
  className: "relative h-full",
120
120
  children: [l && /* @__PURE__ */ V("div", {
121
121
  className: "absolute inset-0 flex items-center justify-center",
122
- children: /* @__PURE__ */ V(E, {})
122
+ children: /* @__PURE__ */ V(D, {})
123
123
  }), /* @__PURE__ */ V("iframe", {
124
124
  ref: b,
125
125
  title: r,
126
- src: A,
126
+ src: ee,
127
127
  srcDoc: te,
128
128
  sandbox: C || S ? "allow-scripts" : "allow-scripts allow-same-origin",
129
- className: g("h-full w-full border-none", l ? "invisible" : ""),
129
+ className: _("h-full w-full border-none", l ? "invisible" : ""),
130
130
  onLoad: w,
131
- onError: D
131
+ onError: T
132
132
  })]
133
133
  });
134
- }), _e = {
134
+ }), ve = {
135
135
  name: "MCP-UI Host",
136
136
  version: "1.0.0"
137
- }, ve = { openLinks: {} }, ye = (e) => {
137
+ }, ye = { openLinks: {} }, be = (e) => {
138
138
  let t;
139
139
  try {
140
140
  t = new URL(e);
@@ -148,14 +148,14 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
148
148
  return !1;
149
149
  }
150
150
  return !0;
151
- }, be = (e, t, n) => {
151
+ }, xe = (e, t, n) => {
152
152
  if (n) {
153
153
  e.style.maxWidth = "", e.style.maxHeight = "";
154
154
  return;
155
155
  }
156
156
  let r = t;
157
157
  r != null && (r.width != null && (e.style.width = `${r.width}px`), r.maxWidth != null && (e.style.maxWidth = `${r.maxWidth}px`), r.height != null && (e.style.height = `${r.height}px`), r.maxHeight != null && (e.style.maxHeight = `${r.maxHeight}px`));
158
- }, xe = (e, t, n) => {
158
+ }, Se = (e, t, n) => {
159
159
  let r = L(e);
160
160
  F(() => {
161
161
  r.current = e;
@@ -171,15 +171,15 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
171
171
  height: Math.round(n.height)
172
172
  }
173
173
  } : r.current.hostContext;
174
- e = new U(null, r.current.hostInfo ?? _e, ve, { hostContext: i }), e.onopenlink = async ({ url: e }) => {
174
+ e = new U(null, r.current.hostInfo ?? ve, ye, { hostContext: i }), e.onopenlink = async ({ url: e }) => {
175
175
  let t = r.current.onOpenLink;
176
- return (t == null ? ye(e) : t(e)) === !1 ? { isError: !0 } : {};
176
+ return (t == null ? be(e) : t(e)) === !1 ? { isError: !0 } : {};
177
177
  }, e.onrequestdisplaymode = async ({ mode: e }) => {
178
178
  let t = r.current.onRequestDisplayMode, n = r.current.hostContext?.displayMode ?? "inline";
179
179
  return { mode: t?.(e) ?? n };
180
- }, e.oncalltool = (e) => r.current.onToolCall(e.name, e.arguments), e.setNotificationHandler(ce, ({ params: e }) => {
180
+ }, e.oncalltool = (e) => r.current.onToolCall(e.name, e.arguments), e.setNotificationHandler(ue, ({ params: e }) => {
181
181
  let n = t.current?.querySelector("iframe");
182
- n != null && be(n, e.containerDimensions, r.current.hostContext?.displayMode === "fullscreen");
182
+ n != null && xe(n, e.containerDimensions, r.current.hostContext?.displayMode === "fullscreen");
183
183
  }), a(e);
184
184
  } catch (e) {
185
185
  console.error("[useMcpAppBridge] Error creating AppBridge:", e), s(!0);
@@ -200,30 +200,30 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
200
200
  statusLabel: "_statusLabel_iea4a_33",
201
201
  statusDetail: "_statusDetail_iea4a_38",
202
202
  errorIcon: "_errorIcon_iea4a_42"
203
- }, Se = ({ content: e, errorLabel: t = "Failed to load app", onAppInfo: n }) => {
204
- let [r, i] = R("loading"), [a, o] = R(), { html: s, sandboxUrl: c, toolInput: l, toolResult: u, hostContext: d } = e, f = I(() => ({ url: new URL(c) }), [c]), p = d?.displayMode === "fullscreen", m = L(null), [h, _] = R();
203
+ }, Ce = ({ content: e, errorLabel: t = "Failed to load app", onAppInfo: n }) => {
204
+ let [r, i] = R("loading"), [a, o] = R(), { html: s, sandboxUrl: c, toolInput: l, toolResult: u, hostContext: d } = e, f = I(() => ({ url: new URL(c) }), [c]), p = d?.displayMode === "fullscreen", m = L(null), [h, g] = R();
205
205
  F(() => {
206
206
  let e = m.current;
207
207
  if (!e) return;
208
208
  let t = new ResizeObserver(([e]) => {
209
209
  if (!e) return;
210
210
  let { width: t, height: n } = e.contentRect;
211
- _({
211
+ g({
212
212
  width: Math.round(t),
213
213
  height: Math.round(n)
214
214
  });
215
215
  });
216
216
  return t.observe(e), () => t.disconnect();
217
217
  }, []);
218
- let { appBridge: v, hasFailed: y } = xe(e, m, I(() => d == null || h == null ? d : {
218
+ let { appBridge: v, hasFailed: y } = Se(e, m, I(() => d == null || h == null ? d : {
219
219
  ...d,
220
220
  containerDimensions: h
221
221
  }, [d, h])), b = y || r === "error";
222
222
  return /* @__PURE__ */ H("div", {
223
223
  ref: m,
224
- className: g("relative h-full min-h-[200px] w-full", p && K.fullscreenFrame, !p && r === "loading" && K.loadingFrame),
224
+ className: _("relative h-full min-h-[200px] w-full", p && K.fullscreenFrame, !p && r === "loading" && K.loadingFrame),
225
225
  children: [
226
- v != null && !b && /* @__PURE__ */ V(W, {
226
+ v != null && !b && /* @__PURE__ */ V(le, {
227
227
  html: s,
228
228
  sandbox: f,
229
229
  appBridge: v,
@@ -238,19 +238,19 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
238
238
  }
239
239
  }),
240
240
  !b && r === "loading" && /* @__PURE__ */ V("div", {
241
- className: g("absolute inset-0 flex flex-col items-center justify-center gap-2", K.loadingOverlay),
242
- children: /* @__PURE__ */ V(E, {})
241
+ className: _("absolute inset-0 flex flex-col items-center justify-center gap-2", K.loadingOverlay),
242
+ children: /* @__PURE__ */ V(D, {})
243
243
  }),
244
244
  b && /* @__PURE__ */ H("div", {
245
245
  className: "absolute inset-0 flex flex-col items-center justify-center gap-2 p-4",
246
- children: [/* @__PURE__ */ V(D, {
246
+ children: [/* @__PURE__ */ V(O, {
247
247
  size: 60,
248
- stroke: S,
248
+ stroke: C,
249
249
  "aria-hidden": !0,
250
250
  className: K.errorIcon
251
251
  }), /* @__PURE__ */ H("p", {
252
252
  role: "alert",
253
- className: g("text-center", K.statusLabel),
253
+ className: _("text-center", K.statusLabel),
254
254
  children: [t, a && /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("br", {}), /* @__PURE__ */ V("span", {
255
255
  className: K.statusDetail,
256
256
  children: a
@@ -267,13 +267,13 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
267
267
  statusOverlay: "_statusOverlay_1w97n_24",
268
268
  errorIcon: "_errorIcon_1w97n_29",
269
269
  highlight: "_highlight_1w97n_37"
270
- }, Ce = (e) => {
270
+ }, we = (e) => {
271
271
  if (e?.kind !== "range") return "";
272
272
  let { activeCell: t } = e.selection, n = e.cells.find(({ address: e }) => e.row === t.row && e.col === t.col);
273
273
  if (n == null) return "";
274
274
  let r = n.formula;
275
275
  return r == null || r.trim().length === 0 ? n.displayText : r.startsWith("=") ? r : `=${r}`;
276
- }, we = async (e, t, { onError: n, onXlsxSelectionContextChange: i }) => {
276
+ }, Te = async (e, t, { onError: n, onXlsxSelectionContextChange: i }) => {
277
277
  switch (t) {
278
278
  case r.Docx: {
279
279
  let [{ DocxScrollViewer: t }, { chartEx: r }] = await Promise.all([import("@silurus/ooxml/docx"), import("@silurus/ooxml/chart-ex")]);
@@ -319,7 +319,7 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
319
319
  });
320
320
  }
321
321
  }
322
- }, Te = async (e, t, n, i) => {
322
+ }, Ee = async (e, t, n, i) => {
323
323
  let { onError: a, onXlsxSelectionContextChange: o, onGeometryInvalidated: s } = n;
324
324
  switch (t.format) {
325
325
  case r.Docx: {
@@ -328,7 +328,7 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
328
328
  import("@silurus/ooxml/chart-ex"),
329
329
  import("./ooxml-highlight-surfaces-BzgOKpBV.js")
330
330
  ]), l = await n.load(t.url, { chartEx: o });
331
- if (i()) throw l.destroy(), new Ee();
331
+ if (i()) throw l.destroy(), new De();
332
332
  let u = r.fromDocument(e, l, {
333
333
  enableTextSelection: !0,
334
334
  refitOnResize: !0,
@@ -348,7 +348,7 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
348
348
  import("@silurus/ooxml/chart-ex"),
349
349
  import("./ooxml-highlight-surfaces-BzgOKpBV.js")
350
350
  ]), l = await n.load(t.url, { chartEx: o });
351
- if (i()) throw l.destroy(), new Ee();
351
+ if (i()) throw l.destroy(), new De();
352
352
  let u = r.fromPresentation(e, l, {
353
353
  enableTextSelection: !0,
354
354
  refitOnResize: !0,
@@ -382,13 +382,13 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
382
382
  };
383
383
  }
384
384
  case r.Csv: {
385
- let r = await we(e, t.format, n);
385
+ let r = await Te(e, t.format, n);
386
386
  return await r.load(t.url), { viewer: r };
387
387
  }
388
388
  }
389
- }, Ee = class extends Error {}, De = ({ content: t, fileName: n, loadErrorLabel: i, formulaLabel: a, formulaLabelClassName: o, highlightsLabel: s = "Cited locations", highlightNavigatedLabel: c = "Scrolled to the cited location" }) => {
390
- let l = L(null), [u, d] = R(!0), [f, p] = R(!1), [m, h] = R(""), [_, v] = R([]), [y, b] = R(!1), { highlights: x, selectedHighlightId: C } = t, w = x != null && x.length > 0, T = L(void 0), O = L(x);
391
- O.current = x;
389
+ }, De = class extends Error {}, Oe = ({ content: t, fileName: n, loadErrorLabel: i, formulaLabel: a, formulaLabelClassName: o, highlightsLabel: s = "Cited locations", highlightNavigatedLabel: c = "Scrolled to the cited location" }) => {
390
+ let l = L(null), [u, d] = R(!0), [f, p] = R(!1), [m, h] = R(""), [g, v] = R([]), [y, b] = R(!1), { highlights: x, selectedHighlightId: S } = t, w = x != null && x.length > 0, T = L(void 0), E = L(x);
391
+ E.current = x;
392
392
  let k = L(void 0);
393
393
  return F(() => {
394
394
  let e = l.current;
@@ -400,7 +400,7 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
400
400
  a = void 0, c();
401
401
  }));
402
402
  }, c = async () => {
403
- let e = n?.highlights, t = O.current;
403
+ let e = n?.highlights, t = E.current;
404
404
  if (!(i || e == null || t == null)) try {
405
405
  let n = await e.measure(t);
406
406
  i || v(n);
@@ -412,7 +412,7 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
412
412
  i || (d(!1), p(!0));
413
413
  },
414
414
  onXlsxSelectionContextChange: (e) => {
415
- i || h(Ce(e));
415
+ i || h(we(e));
416
416
  },
417
417
  onGeometryInvalidated: s
418
418
  }, f = () => {
@@ -423,14 +423,14 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
423
423
  return e.addEventListener("scroll", s, !0), k.current = s, (async () => {
424
424
  try {
425
425
  if (w) {
426
- let r = await Te(e, t, u, o);
426
+ let r = await Ee(e, t, u, o);
427
427
  if (i) {
428
428
  r.viewer.destroy(), r.engine?.destroy();
429
429
  return;
430
430
  }
431
431
  n = r, T.current = r.highlights, f();
432
432
  } else {
433
- let r = await we(e, t.format, u);
433
+ let r = await Te(e, t.format, u);
434
434
  if (i) {
435
435
  r.destroy();
436
436
  return;
@@ -441,7 +441,7 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
441
441
  if (i) return;
442
442
  d(!1), await c();
443
443
  } catch (t) {
444
- if (t instanceof Ee || i) return;
444
+ if (t instanceof De || i) return;
445
445
  n?.viewer.destroy(), n?.engine?.destroy(), n = void 0, T.current = void 0, e.replaceChildren(), d(!1), p(!0);
446
446
  }
447
447
  })(), () => {
@@ -457,7 +457,7 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
457
457
  b(!1);
458
458
  let t = T.current;
459
459
  if (t == null || u) return;
460
- let n = (O.current?.find(({ id: e }) => e === C))?.locations.at(0);
460
+ let n = (E.current?.find(({ id: e }) => e === S))?.locations.at(0);
461
461
  if (n == null) return;
462
462
  let r = !1;
463
463
  return (async () => {
@@ -471,22 +471,22 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
471
471
  })(), () => {
472
472
  r = !0;
473
473
  };
474
- }, [C, u]), /* @__PURE__ */ H("div", {
474
+ }, [S, u]), /* @__PURE__ */ H("div", {
475
475
  className: "relative flex h-full w-full min-w-0 flex-col overflow-hidden",
476
476
  children: [
477
477
  t.format === r.Xlsx && /* @__PURE__ */ H("div", {
478
478
  role: "region",
479
479
  "aria-label": a,
480
- className: g("flex min-w-0 shrink-0 items-center gap-2 border-b px-3 py-2", q.formulaPanel),
480
+ className: _("flex min-w-0 shrink-0 items-center gap-2 border-b px-3 py-2", q.formulaPanel),
481
481
  children: [/* @__PURE__ */ V("span", {
482
482
  "aria-hidden": "true",
483
- className: g("shrink-0", o),
483
+ className: _("shrink-0", o),
484
484
  children: "fx"
485
485
  }), /* @__PURE__ */ V("code", {
486
486
  dir: "ltr",
487
487
  tabIndex: 0,
488
488
  "aria-live": "polite",
489
- className: g("h-8 min-w-0 flex-1 overflow-x-auto whitespace-nowrap rounded border px-2 py-1 text-sm focus-visible:outline focus-visible:outline-focus", q.formulaValue),
489
+ className: _("h-8 min-w-0 flex-1 overflow-x-auto whitespace-nowrap rounded border px-2 py-1 text-sm focus-visible:outline focus-visible:outline-focus", q.formulaValue),
490
490
  children: m
491
491
  })]
492
492
  }),
@@ -497,12 +497,12 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
497
497
  role: "document",
498
498
  "aria-label": n,
499
499
  "aria-busy": u,
500
- className: g("h-full w-full overflow-hidden", q.viewer)
501
- }), _.length > 0 && /* @__PURE__ */ V("div", {
500
+ className: _("h-full w-full overflow-hidden", q.viewer)
501
+ }), g.length > 0 && /* @__PURE__ */ V("div", {
502
502
  role: "region",
503
503
  "aria-label": s,
504
504
  className: "pointer-events-none absolute inset-0 overflow-hidden",
505
- children: _.map((e, t) => /* @__PURE__ */ V("div", {
505
+ children: g.map((e, t) => /* @__PURE__ */ V("div", {
506
506
  "aria-hidden": "true",
507
507
  style: {
508
508
  left: `${e.left}px`,
@@ -510,9 +510,9 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
510
510
  width: `${e.width}px`,
511
511
  height: `${e.height}px`
512
512
  },
513
- "data-selected": e.highlightId === C,
513
+ "data-selected": e.highlightId === S,
514
514
  "data-clipped": e.isClippedAtEnd === !0,
515
- className: g("absolute", q.highlight)
515
+ className: _("absolute", q.highlight)
516
516
  }, `${e.highlightId}-${t}`))
517
517
  })]
518
518
  }),
@@ -525,13 +525,13 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
525
525
  (u || f) && /* @__PURE__ */ V("div", {
526
526
  role: f ? "alert" : void 0,
527
527
  "aria-live": "polite",
528
- className: g("absolute inset-0 flex items-center justify-center", q.statusOverlay),
529
- children: u ? /* @__PURE__ */ V(E, { size: 48 }) : /* @__PURE__ */ H("div", {
528
+ className: _("absolute inset-0 flex items-center justify-center", q.statusOverlay),
529
+ children: u ? /* @__PURE__ */ V(D, { size: 48 }) : /* @__PURE__ */ H("div", {
530
530
  className: "flex flex-col items-center gap-2",
531
- children: [/* @__PURE__ */ V(D, {
531
+ children: [/* @__PURE__ */ V(O, {
532
532
  "aria-hidden": "true",
533
533
  size: 60,
534
- stroke: S,
534
+ stroke: C,
535
535
  className: q.errorIcon
536
536
  }), /* @__PURE__ */ V("p", {
537
537
  className: "text-center",
@@ -541,17 +541,17 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
541
541
  })
542
542
  ]
543
543
  });
544
- }, Oe = {
544
+ }, ke = {
545
545
  loadingOverlay: "_loadingOverlay_12637_1",
546
546
  statusLabel: "_statusLabel_12637_5",
547
547
  errorIcon: "_errorIcon_12637_9"
548
- }, ke = ({ content: e, loadingLabel: t, errorLabel: n = "Failed to load visualizer", frameTitle: r, colors: a }) => {
548
+ }, Ae = ({ content: e, loadingLabel: t, errorLabel: n = "Failed to load visualizer", frameTitle: r, colors: a }) => {
549
549
  let o = L(null), [s, c] = R("loading"), { url: l, visualizerName: u, requestTimeout: d } = e, f = L(e);
550
550
  return f.current = e, F(() => {
551
551
  let e = o.current;
552
552
  if (!e) return;
553
553
  c("loading");
554
- let t = new ue(e, {
554
+ let t = new de(e, {
555
555
  domain: l,
556
556
  hostDomain: window.location.origin,
557
557
  visualizerName: u,
@@ -560,7 +560,7 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
560
560
  return (async () => {
561
561
  if (await t.ready(), !n) return;
562
562
  let e = f.current;
563
- if (e.type === i.GroupedVisualizer) await t.send(le.sendGroupedVisualizeData, {
563
+ if (e.type === i.GroupedVisualizer) await t.send(W.sendGroupedVisualizeData, {
564
564
  attachments: e.attachments,
565
565
  layout: e.layout
566
566
  });
@@ -569,7 +569,7 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
569
569
  layout: r,
570
570
  ...typeof i == "object" && i ? i : {}
571
571
  };
572
- await t.send(le.sendVisualizeData, {
572
+ await t.send(W.sendVisualizeData, {
573
573
  mimeType: n,
574
574
  visualizerData: a
575
575
  });
@@ -605,22 +605,22 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
605
605
  className: "h-full w-full"
606
606
  }),
607
607
  s === "loading" && /* @__PURE__ */ H("div", {
608
- className: g("absolute inset-0 flex flex-col items-center justify-center gap-2", Oe.loadingOverlay),
609
- children: [/* @__PURE__ */ V(E, {}), t && /* @__PURE__ */ V("p", {
610
- className: g("text-center", Oe.statusLabel),
608
+ className: _("absolute inset-0 flex flex-col items-center justify-center gap-2", ke.loadingOverlay),
609
+ children: [/* @__PURE__ */ V(D, {}), t && /* @__PURE__ */ V("p", {
610
+ className: _("text-center", ke.statusLabel),
611
611
  children: t
612
612
  })]
613
613
  }),
614
614
  s === "error" && /* @__PURE__ */ H("div", {
615
615
  className: "absolute inset-0 flex flex-col items-center justify-center gap-2",
616
- children: [/* @__PURE__ */ V(D, {
616
+ children: [/* @__PURE__ */ V(O, {
617
617
  size: 60,
618
- stroke: S,
618
+ stroke: C,
619
619
  "aria-hidden": !0,
620
- className: Oe.errorIcon
620
+ className: ke.errorIcon
621
621
  }), /* @__PURE__ */ V("p", {
622
622
  role: "alert",
623
- className: g("text-center", Oe.statusLabel),
623
+ className: _("text-center", ke.statusLabel),
624
624
  children: n
625
625
  })]
626
626
  })
@@ -641,18 +641,18 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
641
641
  jsonExpandIcon: "_jsonExpandIcon_13ogb_54",
642
642
  jsonCollapseIcon: "_jsonCollapseIcon_13ogb_67",
643
643
  jsonCollapsedContent: "_jsonCollapsedContent_13ogb_84"
644
- }, Ae = () => j(async () => ({ default: (await import("./PdfContent-BoAtghsO.js")).PdfContent })), je = ({ url: e, fileName: t, loadErrorLabel: n }) => {
644
+ }, je = () => M(async () => ({ default: (await import("./PdfContent-BoAtghsO.js")).PdfContent })), Me = ({ url: e, fileName: t, loadErrorLabel: n }) => {
645
645
  let [r, i] = R(!1);
646
646
  return F(() => {
647
647
  i(!1);
648
648
  }, [e]), r ? /* @__PURE__ */ H("div", {
649
649
  className: "flex flex-col items-center gap-2",
650
- children: [/* @__PURE__ */ V(D, {
650
+ children: [/* @__PURE__ */ V(O, {
651
651
  size: 60,
652
- stroke: S,
652
+ stroke: C,
653
653
  className: J.errorIcon
654
654
  }), /* @__PURE__ */ V("p", {
655
- className: g("text-center", J.statusLabel),
655
+ className: _("text-center", J.statusLabel),
656
656
  children: n
657
657
  })]
658
658
  }) : /* @__PURE__ */ V("img", {
@@ -661,46 +661,46 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
661
661
  className: "max-h-full max-w-full object-contain",
662
662
  onError: () => i(!0)
663
663
  });
664
- }, Me = new Set([
664
+ }, Ne = new Set([
665
665
  i.PlainText,
666
666
  i.Code,
667
667
  i.Ooxml
668
- ]), Ne = M(({ content: e, isLoading: t = !1, fileName: r, isHtmlSourceView: a = !1, labels: { unsupportedLabel: o = "Preview is not supported for this file", loadErrorLabel: c = "Failed to load file", forbiddenErrorLabel: l = "You don't have permission to access this file", visualizerErrorLabel: d, htmlFrameBlockedLabel: f = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: h = "Open in new tab", pdfThumbnailsLabel: _, pdfShowThumbnailsLabel: v, pdfHideThumbnailsLabel: y, pdfPageNumberLabel: b, pdfContentLoadingLabel: x, pdfContentErrorLabel: C, pdfContentRetryLabel: w, xlsxFormulaLabel: T = "Formula", codeContentLoadingLabel: O, codeContentErrorLabel: k, codeContentRetryLabel: ee, tableCopyLabel: A, tableCopiedLabel: te, tableDownloadCsvLabel: ne, ooxmlHighlightsLabel: ie, ooxmlHighlightNavigatedLabel: ae } = {}, styles: oe, codeBlockTheme: j, tableDownloadFilename: M, loadPdf: P, hidePdfToolbar: F = !1, configurePdfWorker: L, onAppInfo: B }) => {
669
- let { colors: U, typography: W, bodyClassName: ce, cssVars: le } = oe ?? {}, [ue, de] = R(0), fe = I(Ae, [ue]), pe = N(() => {
668
+ ]), Pe = N(({ content: e, isLoading: t = !1, fileName: r, isHtmlSourceView: a = !1, labels: { unsupportedLabel: o = "Preview is not supported for this file", loadErrorLabel: c = "Failed to load file", forbiddenErrorLabel: l = "You don't have permission to access this file", visualizerErrorLabel: d, htmlFrameBlockedLabel: f = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: h = "Open in new tab", pdfThumbnailsLabel: g, pdfShowThumbnailsLabel: v, pdfHideThumbnailsLabel: y, pdfPageNumberLabel: b, pdfContentLoadingLabel: x, pdfContentErrorLabel: S, pdfContentRetryLabel: w, xlsxFormulaLabel: T = "Formula", codeContentLoadingLabel: E, codeContentErrorLabel: k, codeContentRetryLabel: A, tableCopyLabel: ee, tableCopiedLabel: te, tableDownloadCsvLabel: ne, ooxmlHighlightsLabel: re, ooxmlHighlightNavigatedLabel: ae } = {}, styles: oe, codeBlockTheme: j, tableDownloadFilename: M, loadPdf: N, hidePdfToolbar: se = !1, configurePdfWorker: F, onAppInfo: L }) => {
669
+ let { colors: B, typography: U, bodyClassName: le, cssVars: ue } = oe ?? {}, [W, de] = R(0), fe = I(je, [W]), pe = P(() => {
670
670
  de((e) => e + 1);
671
- }, []), G = W?.fontClassName != null, he = I(() => ({
671
+ }, []), G = U?.fontClassName != null, me = I(() => ({
672
672
  ...m({
673
- "--ac-text": U?.text,
674
- "--ac-status-text": U?.statusText,
675
- "--ac-error-icon": U?.errorIcon,
676
- "--ac-open-in-new-tab-text": U?.openInNewTabText,
677
- "--ac-json-border": U?.jsonBorder,
678
- "--ac-json-bg": U?.jsonBackground,
679
- "--ac-json-label": U?.jsonLabel,
680
- "--ac-json-clickable-label": U?.jsonClickableLabel,
681
- "--ac-json-punctuation": U?.jsonPunctuation,
682
- "--ac-json-string": U?.jsonString,
683
- "--ac-json-number": U?.jsonNumber,
684
- "--ac-json-boolean": U?.jsonBoolean,
685
- "--ac-json-null": U?.jsonNull,
686
- "--ac-json-toggle-icon": U?.jsonToggleIcon,
687
- "--ac-json-toggle-icon-hover": U?.jsonToggleIconHover,
688
- "--ac-ooxml-bg": U?.ooxmlBackground,
689
- "--ac-ooxml-formula-border": U?.ooxmlFormulaBorder,
690
- "--ac-ooxml-formula-bg": U?.ooxmlFormulaBackground,
691
- "--ac-ooxml-formula-text": U?.ooxmlFormulaText,
692
- "--ac-ooxml-highlight-border": U?.ooxmlHighlightBorder,
693
- "--ac-ooxml-highlight-bg": U?.ooxmlHighlightBackground,
694
- "--ac-json-collapsed-text": U?.jsonCollapsedText,
695
- "--ac-json-collapsed-bg": U?.jsonCollapsedBackground,
696
- "--ac-font-family": G ? void 0 : W?.fontFamily,
697
- "--ac-font-size": G ? void 0 : W?.fontSize,
698
- "--ac-font-weight": G ? void 0 : W?.fontWeight,
699
- "--ac-line-height": G ? void 0 : W?.lineHeight,
700
- "--ac-letter-spacing": G ? void 0 : W?.letterSpacing
673
+ "--ac-text": B?.text,
674
+ "--ac-status-text": B?.statusText,
675
+ "--ac-error-icon": B?.errorIcon,
676
+ "--ac-open-in-new-tab-text": B?.openInNewTabText,
677
+ "--ac-json-border": B?.jsonBorder,
678
+ "--ac-json-bg": B?.jsonBackground,
679
+ "--ac-json-label": B?.jsonLabel,
680
+ "--ac-json-clickable-label": B?.jsonClickableLabel,
681
+ "--ac-json-punctuation": B?.jsonPunctuation,
682
+ "--ac-json-string": B?.jsonString,
683
+ "--ac-json-number": B?.jsonNumber,
684
+ "--ac-json-boolean": B?.jsonBoolean,
685
+ "--ac-json-null": B?.jsonNull,
686
+ "--ac-json-toggle-icon": B?.jsonToggleIcon,
687
+ "--ac-json-toggle-icon-hover": B?.jsonToggleIconHover,
688
+ "--ac-ooxml-bg": B?.ooxmlBackground,
689
+ "--ac-ooxml-formula-border": B?.ooxmlFormulaBorder,
690
+ "--ac-ooxml-formula-bg": B?.ooxmlFormulaBackground,
691
+ "--ac-ooxml-formula-text": B?.ooxmlFormulaText,
692
+ "--ac-ooxml-highlight-border": B?.ooxmlHighlightBorder,
693
+ "--ac-ooxml-highlight-bg": B?.ooxmlHighlightBackground,
694
+ "--ac-json-collapsed-text": B?.jsonCollapsedText,
695
+ "--ac-json-collapsed-bg": B?.jsonCollapsedBackground,
696
+ "--ac-font-family": G ? void 0 : U?.fontFamily,
697
+ "--ac-font-size": G ? void 0 : U?.fontSize,
698
+ "--ac-font-weight": G ? void 0 : U?.fontWeight,
699
+ "--ac-line-height": G ? void 0 : U?.lineHeight,
700
+ "--ac-letter-spacing": G ? void 0 : U?.letterSpacing
701
701
  }),
702
- ...le
703
- }), [oe]), _e = I(() => {
702
+ ...ue
703
+ }), [oe]), ge = I(() => {
704
704
  switch (e.type) {
705
705
  case i.Image:
706
706
  case i.Audio:
@@ -721,10 +721,10 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
721
721
  }, [e.type]), ve = I(() => {
722
722
  switch (e.type) {
723
723
  case i.PlainText: return /* @__PURE__ */ V("pre", {
724
- className: g("whitespace-pre-wrap break-words", J.body, W?.fontClassName),
724
+ className: _("whitespace-pre-wrap break-words", J.body, U?.fontClassName),
725
725
  children: e.text
726
726
  });
727
- case i.Image: return /* @__PURE__ */ V(je, {
727
+ case i.Image: return /* @__PURE__ */ V(Me, {
728
728
  url: e.url,
729
729
  fileName: r,
730
730
  loadErrorLabel: c
@@ -757,7 +757,7 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
757
757
  tableScrollContainer: "max-h-full"
758
758
  },
759
759
  tableActionLabels: {
760
- copyLabel: A,
760
+ copyLabel: ee,
761
761
  copiedLabel: te,
762
762
  downloadCsvLabel: ne
763
763
  },
@@ -767,39 +767,39 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
767
767
  dir: "ltr",
768
768
  className: "h-full overflow-auto",
769
769
  children: /* @__PURE__ */ V("div", {
770
- className: g("m-3 overflow-auto rounded-md border", J.jsonWrapper),
771
- children: /* @__PURE__ */ V(se, {
770
+ className: _("m-3 overflow-auto rounded-md border", J.jsonWrapper),
771
+ children: /* @__PURE__ */ V(z, {
772
772
  data: e.value,
773
773
  style: {
774
- container: g("whitespace-pre-wrap break-words p-2", W?.jsonClassName ?? "dial-code-text"),
775
- basicChildStyle: z.basicChildStyle,
774
+ container: _("whitespace-pre-wrap break-words p-2", U?.jsonClassName ?? "dial-code-text"),
775
+ basicChildStyle: ce.basicChildStyle,
776
776
  childFieldsContainer: "m-0 ps-3",
777
- label: g("me-1 font-semibold", J.jsonLabel),
778
- clickableLabel: g("me-1 cursor-pointer font-semibold hover:underline", J.jsonClickableLabel),
779
- nullValue: g("italic", J.jsonNullValue),
780
- undefinedValue: g("italic", J.jsonNullValue),
777
+ label: _("me-1 font-semibold", J.jsonLabel),
778
+ clickableLabel: _("me-1 cursor-pointer font-semibold hover:underline", J.jsonClickableLabel),
779
+ nullValue: _("italic", J.jsonNullValue),
780
+ undefinedValue: _("italic", J.jsonNullValue),
781
781
  stringValue: J.jsonStringValue,
782
782
  booleanValue: J.jsonBooleanValue,
783
783
  numberValue: J.jsonNumberValue,
784
- otherValue: g("italic", J.jsonNullValue),
785
- punctuation: g("me-1", J.jsonPunctuation),
786
- collapseIcon: g("me-1 cursor-pointer select-none transition-colors", J.jsonCollapseIcon),
787
- expandIcon: g("me-1 cursor-pointer select-none transition-colors", J.jsonExpandIcon),
788
- collapsedContent: g("me-1 cursor-pointer rounded px-1", J.jsonCollapsedContent)
784
+ otherValue: _("italic", J.jsonNullValue),
785
+ punctuation: _("me-1", J.jsonPunctuation),
786
+ collapseIcon: _("me-1 cursor-pointer select-none transition-colors", J.jsonCollapseIcon),
787
+ expandIcon: _("me-1 cursor-pointer select-none transition-colors", J.jsonExpandIcon),
788
+ collapsedContent: _("me-1 cursor-pointer rounded px-1", J.jsonCollapsedContent)
789
789
  }
790
790
  })
791
791
  })
792
792
  });
793
- case i.Code: return /* @__PURE__ */ V(me, {
793
+ case i.Code: return /* @__PURE__ */ V(he, {
794
794
  content: e,
795
795
  codeBlockTheme: j,
796
796
  labels: {
797
- loadingLabel: O,
797
+ loadingLabel: E,
798
798
  errorLabel: k,
799
- retryLabel: ee
799
+ retryLabel: A
800
800
  }
801
801
  });
802
- case i.Html: return /* @__PURE__ */ V(ge, {
802
+ case i.Html: return /* @__PURE__ */ V(_e, {
803
803
  content: e,
804
804
  labels: {
805
805
  htmlFrameBlockedLabel: f,
@@ -810,11 +810,11 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
810
810
  codeBlockTheme: j
811
811
  });
812
812
  case i.Pdf: return /* @__PURE__ */ V(s, {
813
- retryKey: ue,
813
+ retryKey: W,
814
814
  onRetry: pe,
815
815
  labels: {
816
816
  loadingLabel: x,
817
- errorLabel: C,
817
+ errorLabel: S,
818
818
  retryLabel: w
819
819
  },
820
820
  children: /* @__PURE__ */ V(fe, {
@@ -823,52 +823,52 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
823
823
  highlights: e.highlights ?? [],
824
824
  selectedHighlightId: e.selectedHighlightId,
825
825
  selectedPageNumber: e.page,
826
- loadPdf: P,
827
- hideHeader: F,
828
- configurePdfWorker: L,
826
+ loadPdf: N,
827
+ hideHeader: se,
828
+ configurePdfWorker: F,
829
829
  labels: {
830
- thumbnailsLabel: _,
830
+ thumbnailsLabel: g,
831
831
  showThumbnailsLabel: v,
832
832
  hideThumbnailsLabel: y,
833
833
  pageNumberLabel: b,
834
834
  loadingLabel: x,
835
- errorLabel: C,
835
+ errorLabel: S,
836
836
  retryLabel: w
837
837
  }
838
838
  })
839
839
  }, e.url);
840
- case i.Ooxml: return /* @__PURE__ */ V(De, {
840
+ case i.Ooxml: return /* @__PURE__ */ V(Oe, {
841
841
  content: e,
842
842
  fileName: r,
843
843
  loadErrorLabel: c,
844
844
  formulaLabel: T,
845
- formulaLabelClassName: W?.xlsxFormulaLabelClassName ?? "dial-italic-text",
846
- highlightsLabel: ie,
845
+ formulaLabelClassName: U?.xlsxFormulaLabelClassName ?? "dial-italic-text",
846
+ highlightsLabel: re,
847
847
  highlightNavigatedLabel: ae
848
848
  });
849
849
  case i.Visualizer:
850
- case i.GroupedVisualizer: return /* @__PURE__ */ V(ke, {
850
+ case i.GroupedVisualizer: return /* @__PURE__ */ V(Ae, {
851
851
  content: e,
852
852
  errorLabel: d
853
853
  });
854
- case i.McpApp: return /* @__PURE__ */ V(Se, {
854
+ case i.McpApp: return /* @__PURE__ */ V(Ce, {
855
855
  content: e,
856
- onAppInfo: B
856
+ onAppInfo: L
857
857
  });
858
858
  case i.Unsupported: return /* @__PURE__ */ V("p", {
859
- className: g("text-center", J.statusLabel),
859
+ className: _("text-center", J.statusLabel),
860
860
  children: o
861
861
  });
862
862
  case i.Error: {
863
863
  let t = e.errorType === n.Forbidden;
864
864
  return /* @__PURE__ */ H("div", {
865
865
  className: "flex flex-col items-center gap-2",
866
- children: [V(t ? re : D, {
866
+ children: [V(t ? ie : O, {
867
867
  size: 60,
868
- stroke: S,
868
+ stroke: C,
869
869
  className: J.errorIcon
870
870
  }), /* @__PURE__ */ V("p", {
871
- className: g("text-center", J.statusLabel),
871
+ className: _("text-center", J.statusLabel),
872
872
  children: t ? l : c
873
873
  })]
874
874
  });
@@ -876,9 +876,9 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
876
876
  }
877
877
  }, [
878
878
  e,
879
- W?.fontClassName,
880
- W?.jsonClassName,
881
- W?.xlsxFormulaLabelClassName,
879
+ U?.fontClassName,
880
+ U?.jsonClassName,
881
+ U?.xlsxFormulaLabelClassName,
882
882
  r,
883
883
  j,
884
884
  o,
@@ -889,76 +889,76 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
889
889
  h,
890
890
  a,
891
891
  M,
892
- P,
892
+ N,
893
+ se,
893
894
  F,
894
895
  L,
895
- B,
896
- _,
896
+ g,
897
897
  v,
898
898
  y,
899
899
  b,
900
900
  x,
901
- C,
901
+ S,
902
902
  w,
903
903
  T,
904
- O,
904
+ E,
905
905
  k,
906
- ee,
906
+ A,
907
907
  fe,
908
- ue,
908
+ W,
909
909
  pe,
910
- A,
910
+ ee,
911
911
  te,
912
912
  ne,
913
- ie,
913
+ re,
914
914
  ae
915
915
  ]);
916
916
  return /* @__PURE__ */ V("div", {
917
- style: !t && Me.has(e.type) ? he : void 0,
918
- className: g(t ? "flex h-full items-center justify-center" : _e, ce),
919
- children: t ? /* @__PURE__ */ V(E, {}) : ve
917
+ style: !t && Ne.has(e.type) ? me : void 0,
918
+ className: _(t ? "flex h-full items-center justify-center" : ge, le),
919
+ children: t ? /* @__PURE__ */ V(D, {}) : ve
920
920
  });
921
- }), Pe = {
921
+ }), Fe = {
922
922
  mcpAppDivider: "_mcpAppDivider_1jh5p_1",
923
923
  mcpAppVersion: "_mcpAppVersion_1jh5p_5"
924
- }, Fe = 2e3, Ie = M(({ isOpen: e, isLoading: t = !1, onClose: n, content: r, fileName: a, leftActions: s, labels: { ariaLabel: c, closeLabel: l = "Close", resizeLabel: u = "Resize panel", downloadLabel: d = "Download", copyTextLabel: f = "Copy text", copiedTextLabel: p = "Copied!", copyMarkdownLabel: h = "Copy as Markdown", copiedMarkdownLabel: _ = "Copied!", copyJsonLabel: v = "Copy as JSON", copiedJsonLabel: C = "Copied!", visualizerErrorLabel: T, unsupportedLabel: E = "Preview is not supported for this file", loadErrorLabel: D = "Failed to load file", forbiddenErrorLabel: O = "You don't have permission to access this file", htmlFrameBlockedLabel: re = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: oe = "Open in new tab", htmlViewSourceLabel: j = "View source", htmlViewRenderedLabel: M = "View rendered", mcpAppReloadLabel: P = "Reload", pdfThumbnailsLabel: se, pdfShowThumbnailsLabel: z, pdfHideThumbnailsLabel: U, pdfPageNumberLabel: W, pdfContentLoadingLabel: ce, pdfContentErrorLabel: le, pdfContentRetryLabel: ue, xlsxFormulaLabel: fe, codeContentLoadingLabel: pe, codeContentErrorLabel: G, codeContentRetryLabel: me, tableCopyLabel: he, tableCopiedLabel: ge, tableDownloadCsvLabel: _e, ooxmlHighlightsLabel: ve, ooxmlHighlightNavigatedLabel: ye }, onDownload: be, onCopyText: xe, onCopyMarkdown: K, onCopyJson: Se, tableDownloadFilename: q, isMobile: Ce = !1, defaultWidth: we, minWidth: Te = 600, maxWidth: Ee = 1500, onResizeStop: De, styles: Oe, codeBlockTheme: ke, loadPdf: J, configurePdfWorker: Ae }) => {
925
- let [je, Me] = R(!1), [Ie, Le] = R(!1), [Y, Re] = R(!1), [X, ze] = R(!1), [Be, Z] = R(void 0), Ve = L(null), He = L(null), Q = L(null), Ue = N(() => {
926
- xe?.(), Ve.current != null && clearTimeout(Ve.current), Me(!0), Ve.current = setTimeout(() => Me(!1), Fe);
927
- }, [xe]), We = N(() => {
928
- K?.(), He.current != null && clearTimeout(He.current), Le(!0), He.current = setTimeout(() => Le(!1), Fe);
929
- }, [K]), Ge = N(() => {
930
- Se?.(), Q.current != null && clearTimeout(Q.current), Re(!0), Q.current = setTimeout(() => Re(!1), Fe);
931
- }, [Se]);
924
+ }, Ie = 2e3, Le = N(({ isOpen: e, isLoading: t = !1, onClose: n, content: r, fileName: a, leftActions: s, labels: { ariaLabel: c, closeLabel: l = "Close", resizeLabel: u = "Resize panel", downloadLabel: d = "Download", copyTextLabel: f = "Copy text", copiedTextLabel: p = "Copied!", copyMarkdownLabel: h = "Copy as Markdown", copiedMarkdownLabel: g = "Copied!", copyJsonLabel: v = "Copy as JSON", copiedJsonLabel: y = "Copied!", visualizerErrorLabel: w, unsupportedLabel: E = "Preview is not supported for this file", loadErrorLabel: D = "Failed to load file", forbiddenErrorLabel: O = "You don't have permission to access this file", htmlFrameBlockedLabel: k = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: ie = "Open in new tab", htmlViewSourceLabel: j = "View source", htmlViewRenderedLabel: M = "View rendered", mcpAppReloadLabel: N = "Reload", pdfThumbnailsLabel: se, pdfShowThumbnailsLabel: z, pdfHideThumbnailsLabel: ce, pdfPageNumberLabel: U, pdfContentLoadingLabel: le, pdfContentErrorLabel: ue, pdfContentRetryLabel: W, xlsxFormulaLabel: de, codeContentLoadingLabel: pe, codeContentErrorLabel: G, codeContentRetryLabel: me, tableCopyLabel: he, tableCopiedLabel: ge, tableDownloadCsvLabel: _e, ooxmlHighlightsLabel: ve, ooxmlHighlightNavigatedLabel: ye }, onDownload: be, onCopyText: xe, onCopyMarkdown: Se, onCopyJson: K, tableDownloadFilename: Ce, isMobile: q = !1, defaultWidth: we, minWidth: Te = 600, maxWidth: Ee = 1500, onResizeStop: De, styles: Oe, codeBlockTheme: ke, loadPdf: Ae, configurePdfWorker: J }) => {
925
+ let [je, Me] = R(!1), [Ne, Le] = R(!1), [Re, Y] = R(!1), [X, ze] = R(!1), [Be, Ve] = R(void 0), Z = L(null), He = L(null), Ue = L(null), We = P(() => {
926
+ xe?.(), Z.current != null && clearTimeout(Z.current), Me(!0), Z.current = setTimeout(() => Me(!1), Ie);
927
+ }, [xe]), Ge = P(() => {
928
+ Se?.(), He.current != null && clearTimeout(He.current), Le(!0), He.current = setTimeout(() => Le(!1), Ie);
929
+ }, [Se]), Ke = P(() => {
930
+ K?.(), Ue.current != null && clearTimeout(Ue.current), Y(!0), Ue.current = setTimeout(() => Y(!1), Ie);
931
+ }, [K]);
932
932
  F(() => () => {
933
- Ve.current != null && clearTimeout(Ve.current), He.current != null && clearTimeout(He.current), Q.current != null && clearTimeout(Q.current);
933
+ Z.current != null && clearTimeout(Z.current), He.current != null && clearTimeout(He.current), Ue.current != null && clearTimeout(Ue.current);
934
934
  }, []);
935
- let $ = N(() => {
935
+ let qe = P(() => {
936
936
  ze((e) => !e);
937
937
  }, []);
938
938
  F(() => {
939
- ze(!1), Z(void 0);
939
+ ze(!1), Ve(void 0);
940
940
  }, [r]);
941
- let { className: Ke, panelStyles: qe, ...Je } = Oe ?? {}, { colors: Ye, typography: Xe } = Je, Ze = I(() => m({
942
- "--ac-mcp-app-divider": Ye?.mcpAppDividerColor,
943
- "--ac-mcp-app-version": Ye?.mcpAppVersionColor
944
- }), [Ye?.mcpAppDividerColor, Ye?.mcpAppVersionColor]), Qe = r.type === i.McpApp && Be != null ? /* @__PURE__ */ H("span", {
941
+ let { className: Q, panelStyles: Je, ...Ye } = Oe ?? {}, { colors: $, typography: Xe } = Ye, Ze = I(() => m({
942
+ "--ac-mcp-app-divider": $?.mcpAppDividerColor,
943
+ "--ac-mcp-app-version": $?.mcpAppVersionColor
944
+ }), [$?.mcpAppDividerColor, $?.mcpAppVersionColor]), Qe = r.type === i.McpApp && Be != null ? /* @__PURE__ */ H("span", {
945
945
  style: Ze,
946
946
  children: [
947
947
  /* @__PURE__ */ V("span", { children: a }),
948
948
  /* @__PURE__ */ V("span", {
949
949
  "aria-hidden": !0,
950
- className: g("mx-1.5 inline-block h-3 w-0 border-s align-middle", Pe.mcpAppDivider)
950
+ className: _("mx-1.5 inline-block h-3 w-0 border-s align-middle", Fe.mcpAppDivider)
951
951
  }),
952
952
  /* @__PURE__ */ V("span", { children: Be.name }),
953
953
  Be.version && /* @__PURE__ */ V("span", {
954
- className: g("ms-2", Xe?.mcpAppVersionClassName ?? "dial-caption-text", Pe.mcpAppVersion),
954
+ className: _("ms-2", Xe?.mcpAppVersionClassName ?? "dial-caption-text", Fe.mcpAppVersion),
955
955
  children: Be.version
956
956
  })
957
957
  ]
958
- }) : a, $e = !t && r.type === i.Html && (r.srcdoc != null || r.resolveSourceText != null), et = !t && xe != null && (r.type === i.PlainText || r.type === i.Code), tt = !t && K != null && r.type === i.Markdown, nt = !t && Se != null && r.type === i.Json, rt = !t && be != null && o(r), it = !t && r.type === i.McpApp && r.onReload != null;
959
- return /* @__PURE__ */ V(b, {
958
+ }) : a, $e = !t && r.type === i.Html && (r.srcdoc != null || r.resolveSourceText != null), et = !t && xe != null && (r.type === i.PlainText || r.type === i.Code), tt = !t && Se != null && r.type === i.Markdown, nt = !t && K != null && r.type === i.Json, rt = !t && be != null && o(r), it = !t && r.type === i.McpApp && r.onReload != null;
959
+ return /* @__PURE__ */ V(x, {
960
960
  isOpen: e,
961
- orientation: y.Right,
961
+ orientation: b.Right,
962
962
  title: Qe,
963
963
  labels: {
964
964
  ariaLabel: c,
@@ -966,101 +966,101 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
966
966
  resizeLabel: u
967
967
  },
968
968
  onClose: n,
969
- resizable: !Ce,
969
+ resizable: !q,
970
970
  defaultWidth: we,
971
971
  minWidth: Te,
972
972
  maxWidth: Ee,
973
973
  onResizeStop: De,
974
974
  styles: {
975
- ...qe,
976
- titleClassName: qe?.titleClassName ?? "dial-h3-text",
977
- headerClassName: g("border-b border-tertiary", qe?.headerClassName),
978
- className: g(e ? "mobile:w-full mobile:max-w-full" : "w-0", Ke, qe?.className, de.panel)
975
+ ...Je,
976
+ titleClassName: Je?.titleClassName ?? "dial-h3-text",
977
+ headerClassName: _("border-b border-tertiary", Je?.headerClassName),
978
+ className: _(e ? "mobile:w-full mobile:max-w-full" : "w-0", Q, Je?.className, fe.panel)
979
979
  },
980
980
  leftActions: s,
981
981
  rightActions: $e || et || tt || nt || rt || it ? /* @__PURE__ */ H(B, { children: [
982
- it && /* @__PURE__ */ V(w, {
983
- icon: /* @__PURE__ */ V(ae, {
984
- size: x.LG,
985
- stroke: S,
982
+ it && /* @__PURE__ */ V(T, {
983
+ icon: /* @__PURE__ */ V(oe, {
984
+ size: S.LG,
985
+ stroke: C,
986
986
  "aria-hidden": !0
987
987
  }),
988
- "aria-label": P,
989
- tooltipProps: { tooltip: P },
988
+ "aria-label": N,
989
+ tooltipProps: { tooltip: N },
990
990
  onClick: r.type === i.McpApp ? r.onReload : void 0
991
991
  }),
992
- $e && /* @__PURE__ */ V(w, {
993
- icon: V(X ? ne : ee, {
994
- size: x.LG,
995
- stroke: S,
992
+ $e && /* @__PURE__ */ V(T, {
993
+ icon: V(X ? re : ee, {
994
+ size: S.LG,
995
+ stroke: C,
996
996
  "aria-hidden": !0
997
997
  }),
998
998
  "aria-label": X ? M : j,
999
999
  "aria-pressed": X,
1000
1000
  tooltipProps: { tooltip: X ? M : j },
1001
- onClick: $
1001
+ onClick: qe
1002
1002
  }),
1003
- et && /* @__PURE__ */ V(w, {
1004
- icon: V(je ? k : A, {
1005
- size: x.LG,
1006
- stroke: S,
1003
+ et && /* @__PURE__ */ V(T, {
1004
+ icon: V(je ? A : te, {
1005
+ size: S.LG,
1006
+ stroke: C,
1007
1007
  "aria-hidden": !0
1008
1008
  }),
1009
1009
  "aria-label": je ? p : f,
1010
1010
  tooltipProps: { tooltip: je ? p : f },
1011
- onClick: Ue
1011
+ onClick: We
1012
1012
  }),
1013
- tt && /* @__PURE__ */ V(w, {
1014
- icon: V(Ie ? k : ie, {
1015
- size: x.LG,
1016
- stroke: S,
1013
+ tt && /* @__PURE__ */ V(T, {
1014
+ icon: V(Ne ? A : ae, {
1015
+ size: S.LG,
1016
+ stroke: C,
1017
1017
  "aria-hidden": !0
1018
1018
  }),
1019
- "aria-label": Ie ? _ : h,
1020
- tooltipProps: { tooltip: Ie ? _ : h },
1021
- onClick: We
1019
+ "aria-label": Ne ? g : h,
1020
+ tooltipProps: { tooltip: Ne ? g : h },
1021
+ onClick: Ge
1022
1022
  }),
1023
- nt && /* @__PURE__ */ V(w, {
1024
- icon: V(Y ? k : A, {
1025
- size: x.LG,
1026
- stroke: S,
1023
+ nt && /* @__PURE__ */ V(T, {
1024
+ icon: V(Re ? A : te, {
1025
+ size: S.LG,
1026
+ stroke: C,
1027
1027
  "aria-hidden": !0
1028
1028
  }),
1029
- "aria-label": Y ? C : v,
1030
- tooltipProps: { tooltip: Y ? C : v },
1031
- onClick: Ge
1029
+ "aria-label": Re ? y : v,
1030
+ tooltipProps: { tooltip: Re ? y : v },
1031
+ onClick: Ke
1032
1032
  }),
1033
- rt && /* @__PURE__ */ V(w, {
1034
- icon: /* @__PURE__ */ V(te, {
1035
- size: x.LG,
1036
- stroke: S
1033
+ rt && /* @__PURE__ */ V(T, {
1034
+ icon: /* @__PURE__ */ V(ne, {
1035
+ size: S.LG,
1036
+ stroke: C
1037
1037
  }),
1038
1038
  "aria-label": d,
1039
1039
  tooltipProps: { tooltip: d },
1040
1040
  onClick: be
1041
1041
  })
1042
1042
  ] }) : null,
1043
- children: /* @__PURE__ */ V(Ne, {
1043
+ children: /* @__PURE__ */ V(Pe, {
1044
1044
  content: r,
1045
1045
  isLoading: t,
1046
1046
  fileName: a,
1047
1047
  isHtmlSourceView: X,
1048
- onAppInfo: r.type === i.McpApp ? Z : void 0,
1048
+ onAppInfo: r.type === i.McpApp ? Ve : void 0,
1049
1049
  labels: {
1050
1050
  unsupportedLabel: E,
1051
1051
  loadErrorLabel: D,
1052
1052
  forbiddenErrorLabel: O,
1053
- visualizerErrorLabel: T,
1054
- htmlFrameBlockedLabel: re,
1055
- htmlOpenInNewTabLabel: oe,
1053
+ visualizerErrorLabel: w,
1054
+ htmlFrameBlockedLabel: k,
1055
+ htmlOpenInNewTabLabel: ie,
1056
1056
  pdfThumbnailsLabel: se,
1057
1057
  pdfShowThumbnailsLabel: z,
1058
- pdfHideThumbnailsLabel: U,
1059
- pdfPageNumberLabel: W,
1060
- pdfContentLoadingLabel: ce,
1061
- pdfContentErrorLabel: le,
1062
- pdfContentRetryLabel: ue,
1063
- xlsxFormulaLabel: fe,
1058
+ pdfHideThumbnailsLabel: ce,
1059
+ pdfPageNumberLabel: U,
1060
+ pdfContentLoadingLabel: le,
1061
+ pdfContentErrorLabel: ue,
1062
+ pdfContentRetryLabel: W,
1063
+ xlsxFormulaLabel: de,
1064
1064
  codeContentLoadingLabel: pe,
1065
1065
  codeContentErrorLabel: G,
1066
1066
  codeContentRetryLabel: me,
@@ -1070,28 +1070,28 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
1070
1070
  ooxmlHighlightsLabel: ve,
1071
1071
  ooxmlHighlightNavigatedLabel: ye
1072
1072
  },
1073
- styles: Je,
1073
+ styles: Ye,
1074
1074
  codeBlockTheme: ke,
1075
- tableDownloadFilename: q,
1076
- loadPdf: J,
1077
- configurePdfWorker: Ae
1075
+ tableDownloadFilename: Ce,
1076
+ loadPdf: Ae,
1077
+ configurePdfWorker: J
1078
1078
  })
1079
1079
  });
1080
- }), Le = new Set(["html", "htm"]), Y = {
1080
+ }), Re = new Set(["html", "htm"]), Y = {
1081
1081
  docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
1082
1082
  xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
1083
1083
  pptx: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
1084
- }, Re = new Set(/* @__PURE__ */ "txt.md.markdown.json.jsonl.ndjson.xml.csv.tsv.yaml.yml.toml.ini.conf.cfg.css.scss.sass.less.js.jsx.ts.tsx.mjs.cjs.mts.cts.py.rb.go.rs.java.kt.swift.c.h.cpp.cs.sh.bash.zsh.fish.ps1.log.env.gitignore.dockerfile.makefile.sql".split(".")), X = {
1084
+ }, X = new Set(/* @__PURE__ */ "txt.md.markdown.json.jsonl.ndjson.xml.csv.tsv.yaml.yml.toml.ini.conf.cfg.css.scss.sass.less.js.jsx.ts.tsx.mjs.cjs.mts.cts.py.rb.go.rs.java.kt.swift.c.h.cpp.cs.sh.bash.zsh.fish.ps1.log.env.gitignore.dockerfile.makefile.sql".split(".")), ze = {
1085
1085
  docx: r.Docx,
1086
1086
  xlsx: r.Xlsx,
1087
1087
  pptx: r.Pptx,
1088
1088
  csv: r.Csv
1089
- }, ze = {
1089
+ }, Be = {
1090
1090
  [Y.docx]: r.Docx,
1091
1091
  [Y.xlsx]: r.Xlsx,
1092
1092
  [Y.pptx]: r.Pptx,
1093
1093
  [f.CSV]: r.Csv
1094
- }, Be = {
1094
+ }, Ve = {
1095
1095
  [r.Docx]: Y.docx,
1096
1096
  [r.Xlsx]: Y.xlsx,
1097
1097
  [r.Pptx]: Y.pptx,
@@ -1099,21 +1099,21 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
1099
1099
  }, Z = (e, t) => {
1100
1100
  let n = t?.split(";", 1)[0].trim().toLowerCase();
1101
1101
  if (n != null) {
1102
- let e = ze[n];
1102
+ let e = Be[n];
1103
1103
  if (e != null) return e;
1104
1104
  }
1105
1105
  let r = e.lastIndexOf(".");
1106
- if (r !== -1) return X[e.slice(r + 1).toLowerCase()];
1107
- }, Ve = (e, t) => Z(e, t) != null, He = (e, t) => {
1106
+ if (r !== -1) return ze[e.slice(r + 1).toLowerCase()];
1107
+ }, He = (e, t) => Z(e, t) != null, Ue = (e, t) => {
1108
1108
  let n = Z(e, t);
1109
- return n == null ? void 0 : Be[n];
1110
- }, Q = (e) => {
1109
+ return n == null ? void 0 : Ve[n];
1110
+ }, We = (e) => {
1111
1111
  let t = e.lastIndexOf(".");
1112
- return t === -1 ? !1 : Re.has(e.slice(t + 1).toLowerCase());
1113
- }, Ue = (e) => {
1112
+ return t === -1 ? !1 : X.has(e.slice(t + 1).toLowerCase());
1113
+ }, Ge = (e) => {
1114
1114
  let t = e.lastIndexOf(".");
1115
- return t === -1 ? !1 : Le.has(e.slice(t + 1).toLowerCase());
1116
- }, We = {
1115
+ return t === -1 ? !1 : Re.has(e.slice(t + 1).toLowerCase());
1116
+ }, Ke = {
1117
1117
  xml: "xml",
1118
1118
  csv: "plaintext",
1119
1119
  tsv: "plaintext",
@@ -1161,39 +1161,39 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
1161
1161
  gitignore: "plaintext",
1162
1162
  dockerfile: "plaintext",
1163
1163
  makefile: "plaintext"
1164
- }, Ge = (e) => We[e], $ = (e) => ({
1164
+ }, qe = (e) => Ke[e], Q = (e) => ({
1165
1165
  type: i.Unsupported,
1166
1166
  ...e != null && { url: e }
1167
- }), Ke = (e) => ({
1167
+ }), Je = (e) => ({
1168
1168
  type: i.Error,
1169
1169
  errorType: n.LoadFailed,
1170
1170
  ...e != null && { url: e }
1171
- }), qe = (e) => ({
1171
+ }), Ye = (e) => ({
1172
1172
  type: i.Error,
1173
1173
  errorType: n.Forbidden,
1174
1174
  ...e != null && { url: e }
1175
- }), Je = (e) => {
1175
+ }), $ = (e) => {
1176
1176
  if (!(e.type !== i.Image && e.type !== i.Audio && e.type !== i.Pdf && e.type !== i.Ooxml)) return e.url.startsWith("blob:") ? e.url : void 0;
1177
- }, Ye = (e) => {
1178
- let t = Je(e);
1177
+ }, Xe = (e) => {
1178
+ let t = $(e);
1179
1179
  t != null && URL.revokeObjectURL(t);
1180
- }, Xe = {
1180
+ }, Ze = {
1181
1181
  type: i.PlainText,
1182
1182
  text: ""
1183
- }, Ze = oe(void 0);
1184
- Ze.displayName = "AttachmentCanvasContext";
1185
- var Qe = ({ children: e }) => {
1186
- let [t, n] = R(!1), [r, i] = R(!1), [a, o] = R(Xe), [s, c] = R(void 0), [l, u] = R(void 0), d = N((e, t) => {
1183
+ }, Qe = j(void 0);
1184
+ Qe.displayName = "AttachmentCanvasContext";
1185
+ var $e = ({ children: e }) => {
1186
+ let [t, n] = R(!1), [r, i] = R(!1), [a, o] = R(Ze), [s, c] = R(void 0), [l, u] = R(void 0), d = P((e, t) => {
1187
1187
  c(e), u(t), i(!0), n(!0);
1188
- }, []), f = N((e, t, r) => {
1188
+ }, []), f = P((e, t, r) => {
1189
1189
  o(e), c(t), u(r), i(!1), n(!0);
1190
- }, []), p = N(() => {
1191
- o(Xe), n(!1), i(!1), u(void 0);
1190
+ }, []), p = P(() => {
1191
+ o(Ze), n(!1), i(!1), u(void 0);
1192
1192
  }, []);
1193
1193
  return F(() => () => {
1194
- let e = Je(a);
1194
+ let e = $(a);
1195
1195
  e != null && URL.revokeObjectURL(e);
1196
- }, [a]), /* @__PURE__ */ V(Ze.Provider, {
1196
+ }, [a]), /* @__PURE__ */ V(Qe.Provider, {
1197
1197
  value: I(() => ({
1198
1198
  isOpen: t,
1199
1199
  isLoading: r,
@@ -1215,26 +1215,26 @@ var Qe = ({ children: e }) => {
1215
1215
  ]),
1216
1216
  children: e
1217
1217
  });
1218
- }, $e = () => {
1219
- let e = P(Ze);
1218
+ }, et = () => {
1219
+ let e = se(Qe);
1220
1220
  if (!e) throw Error("useAttachmentCanvas must be used within an AttachmentCanvasProvider");
1221
1221
  return e;
1222
- }, et = M(({ labels: e, leftActions: t, isMobile: n = !1, defaultWidth: r, maxWidth: o, codeBlockTheme: s, tableDownloadFilename: c, loadPdf: l, configurePdfWorker: u }) => {
1223
- let { ariaLabel: d = "Attachment preview", closeLabel: f = "Close", downloadLabel: p = "Download", unsupportedLabel: m = "Preview is not supported for this file", loadErrorLabel: g = "Failed to load file", forbiddenErrorLabel: _ = "You don't have permission to access this file", copyTextLabel: v, copiedTextLabel: y, copyMarkdownLabel: b, copiedMarkdownLabel: x, copyJsonLabel: S, copiedJsonLabel: C, htmlFrameBlockedLabel: w, htmlOpenInNewTabLabel: T, htmlViewSourceLabel: E, htmlViewRenderedLabel: D, pdfThumbnailsLabel: O, pdfShowThumbnailsLabel: k, pdfHideThumbnailsLabel: ee, pdfPageNumberLabel: A, pdfContentLoadingLabel: te, pdfContentErrorLabel: ne, pdfContentRetryLabel: re, xlsxFormulaLabel: ie, codeContentLoadingLabel: ae, codeContentErrorLabel: oe, codeContentRetryLabel: j, tableCopyLabel: M, tableCopiedLabel: P, tableDownloadCsvLabel: F, ooxmlHighlightsLabel: I, ooxmlHighlightNavigatedLabel: L } = e ?? {}, { isOpen: R, isLoading: se, content: z, fileName: B, closeCanvas: H } = $e(), U = N(() => {
1224
- a(z, B);
1225
- }, [z, B]), W = N(() => {
1222
+ }, tt = N(({ labels: e, leftActions: t, isMobile: n = !1, defaultWidth: r, maxWidth: o, codeBlockTheme: s, tableDownloadFilename: c, loadPdf: l, configurePdfWorker: u }) => {
1223
+ let { ariaLabel: d = "Attachment preview", closeLabel: f = "Close", downloadLabel: p = "Download", unsupportedLabel: m = "Preview is not supported for this file", loadErrorLabel: g = "Failed to load file", forbiddenErrorLabel: _ = "You don't have permission to access this file", copyTextLabel: v, copiedTextLabel: y, copyMarkdownLabel: b, copiedMarkdownLabel: x, copyJsonLabel: S, copiedJsonLabel: C, htmlFrameBlockedLabel: w, htmlOpenInNewTabLabel: T, htmlViewSourceLabel: E, htmlViewRenderedLabel: D, pdfThumbnailsLabel: O, pdfShowThumbnailsLabel: k, pdfHideThumbnailsLabel: A, pdfPageNumberLabel: ee, pdfContentLoadingLabel: te, pdfContentErrorLabel: ne, pdfContentRetryLabel: re, xlsxFormulaLabel: ie, codeContentLoadingLabel: ae, codeContentErrorLabel: oe, codeContentRetryLabel: j, tableCopyLabel: M, tableCopiedLabel: N, tableDownloadCsvLabel: se, ooxmlHighlightsLabel: F, ooxmlHighlightNavigatedLabel: I } = e ?? {}, { isOpen: L, isLoading: R, content: z, fileName: ce, closeCanvas: B } = et(), H = P(() => {
1224
+ a(z, ce);
1225
+ }, [z, ce]), U = P(() => {
1226
1226
  (z.type === i.PlainText || z.type === i.Code) && h(z.text);
1227
- }, [z]), ce = N(() => {
1227
+ }, [z]), le = P(() => {
1228
1228
  z.type === i.Markdown && h(z.text);
1229
- }, [z]), le = N(() => {
1229
+ }, [z]), ue = P(() => {
1230
1230
  z.type === i.Json && h(JSON.stringify(z.value, null, 2));
1231
1231
  }, [z]);
1232
- return /* @__PURE__ */ V(Ie, {
1233
- isOpen: R,
1234
- isLoading: se,
1235
- onClose: H,
1232
+ return /* @__PURE__ */ V(Le, {
1233
+ isOpen: L,
1234
+ isLoading: R,
1235
+ onClose: B,
1236
1236
  content: z,
1237
- fileName: B,
1237
+ fileName: ce,
1238
1238
  leftActions: t,
1239
1239
  labels: {
1240
1240
  ariaLabel: d,
@@ -1255,8 +1255,8 @@ var Qe = ({ children: e }) => {
1255
1255
  htmlViewRenderedLabel: D,
1256
1256
  pdfThumbnailsLabel: O,
1257
1257
  pdfShowThumbnailsLabel: k,
1258
- pdfHideThumbnailsLabel: ee,
1259
- pdfPageNumberLabel: A,
1258
+ pdfHideThumbnailsLabel: A,
1259
+ pdfPageNumberLabel: ee,
1260
1260
  pdfContentLoadingLabel: te,
1261
1261
  pdfContentErrorLabel: ne,
1262
1262
  pdfContentRetryLabel: re,
@@ -1265,15 +1265,15 @@ var Qe = ({ children: e }) => {
1265
1265
  codeContentErrorLabel: oe,
1266
1266
  codeContentRetryLabel: j,
1267
1267
  tableCopyLabel: M,
1268
- tableCopiedLabel: P,
1269
- tableDownloadCsvLabel: F,
1270
- ooxmlHighlightsLabel: I,
1271
- ooxmlHighlightNavigatedLabel: L
1268
+ tableCopiedLabel: N,
1269
+ tableDownloadCsvLabel: se,
1270
+ ooxmlHighlightsLabel: F,
1271
+ ooxmlHighlightNavigatedLabel: I
1272
1272
  },
1273
- onDownload: U,
1274
- onCopyText: z.type === i.PlainText || z.type === i.Code ? W : void 0,
1275
- onCopyMarkdown: z.type === i.Markdown ? ce : void 0,
1276
- onCopyJson: z.type === i.Json ? le : void 0,
1273
+ onDownload: H,
1274
+ onCopyText: z.type === i.PlainText || z.type === i.Code ? U : void 0,
1275
+ onCopyMarkdown: z.type === i.Markdown ? le : void 0,
1276
+ onCopyJson: z.type === i.Json ? ue : void 0,
1277
1277
  tableDownloadFilename: c,
1278
1278
  isMobile: n,
1279
1279
  defaultWidth: r,
@@ -1282,43 +1282,43 @@ var Qe = ({ children: e }) => {
1282
1282
  configurePdfWorker: u,
1283
1283
  loadPdf: l
1284
1284
  });
1285
- }), tt = {
1285
+ }), nt = {
1286
1286
  frame: "_frame_g47g7_1",
1287
1287
  header: "_header_g47g7_6",
1288
1288
  title: "_title_g47g7_10"
1289
- }, nt = M(({ content: e, height: t, onExpand: n, expandAriaLabel: r, actionsGroupAriaLabel: i = "Visualizer actions", frameTitle: a, loadingLabel: o, errorLabel: s, titleClassName: c = "dial-small-semi-text", isBorderless: l = !1, isTitleHidden: u = !1, colors: d }) => {
1289
+ }, rt = N(({ content: e, height: t, onExpand: n, expandAriaLabel: r, actionsGroupAriaLabel: i = "Visualizer actions", frameTitle: a, loadingLabel: o, errorLabel: s, titleClassName: c = "dial-small-semi-text", isBorderless: l = !1, isTitleHidden: u = !1, colors: d }) => {
1290
1290
  let f = e.visualizerName.trim(), p = !u && f !== "";
1291
1291
  return /* @__PURE__ */ H("div", {
1292
- className: g("flex w-full min-w-0 flex-col overflow-hidden", !l && ["rounded-xl border", tt.frame]),
1292
+ className: _("flex w-full min-w-0 flex-col overflow-hidden", !l && ["rounded-xl border", nt.frame]),
1293
1293
  style: m({
1294
1294
  "--igv-bg": d?.background,
1295
1295
  "--igv-border": d?.border,
1296
1296
  "--igv-title-text": d?.titleText
1297
1297
  }),
1298
1298
  children: [/* @__PURE__ */ H("div", {
1299
- className: g("flex min-h-10 items-center gap-2 py-2", p ? "justify-between" : "justify-end", !l && ["border-b px-4", tt.header]),
1299
+ className: _("flex min-h-10 items-center gap-2 py-2", p ? "justify-between" : "justify-end", !l && ["border-b px-4", nt.header]),
1300
1300
  children: [p && /* @__PURE__ */ V("span", {
1301
- className: g("min-w-0 truncate", c, tt.title),
1301
+ className: _("min-w-0 truncate", c, nt.title),
1302
1302
  children: f
1303
1303
  }), /* @__PURE__ */ V("div", {
1304
1304
  role: "toolbar",
1305
1305
  "aria-label": i,
1306
1306
  className: "flex items-center gap-1",
1307
- children: /* @__PURE__ */ V(w, {
1308
- icon: /* @__PURE__ */ V(O, {
1309
- size: x.SM,
1310
- stroke: S,
1307
+ children: /* @__PURE__ */ V(T, {
1308
+ icon: /* @__PURE__ */ V(k, {
1309
+ size: S.SM,
1310
+ stroke: C,
1311
1311
  "aria-hidden": !0
1312
1312
  }),
1313
1313
  "aria-label": r,
1314
- size: C.Small,
1314
+ size: w.Small,
1315
1315
  onClick: n
1316
1316
  })
1317
1317
  })]
1318
1318
  }), /* @__PURE__ */ V("div", {
1319
1319
  className: "w-full",
1320
1320
  style: { height: `${t}px` },
1321
- children: /* @__PURE__ */ V(ke, {
1321
+ children: /* @__PURE__ */ V(Ae, {
1322
1322
  content: e,
1323
1323
  loadingLabel: o,
1324
1324
  errorLabel: s,
@@ -1326,12 +1326,12 @@ var Qe = ({ children: e }) => {
1326
1326
  })
1327
1327
  })]
1328
1328
  });
1329
- }), rt = (e, t) => {
1329
+ }), it = (e, t) => {
1330
1330
  let n = e.toLowerCase();
1331
1331
  return t.find((e) => e.contentType.split(",").some((e) => e.trim().toLowerCase() === n && e.trim() !== ""));
1332
- }, it = (e, t) => {
1332
+ }, at = (e, t) => {
1333
1333
  if (!(e == null || e === "")) return Object.prototype.hasOwnProperty.call(t, e) ? t[e] : void 0;
1334
- }, at = (e) => `${e}:grouped-visualizer`, ot = (e, t) => {
1334
+ }, ot = (e) => `${e}:grouped-visualizer`, st = (e, t) => {
1335
1335
  let n = (t.contentType ?? "").split(",").map((e) => e.trim().toLowerCase()).filter((e) => e !== ""), r = [], i = [];
1336
1336
  return e.forEach((e) => {
1337
1337
  if (e.url != null && e.url !== "" && (n.length === 0 || n.includes(e.contentType.toLowerCase()))) {
@@ -1343,12 +1343,12 @@ var Qe = ({ children: e }) => {
1343
1343
  claimed: r,
1344
1344
  unclaimed: i
1345
1345
  };
1346
- }, st = (e) => {
1346
+ }, ct = (e) => {
1347
1347
  let t;
1348
1348
  try {
1349
1349
  t = new URL(e).pathname;
1350
1350
  } catch {
1351
- t = v(e);
1351
+ t = y(e);
1352
1352
  }
1353
1353
  let n = t.split("/").filter(Boolean).pop() ?? "";
1354
1354
  try {
@@ -1356,13 +1356,13 @@ var Qe = ({ children: e }) => {
1356
1356
  } catch {
1357
1357
  return n;
1358
1358
  }
1359
- }, ct = (e, t) => {
1360
- let { openCanvas: n, openCanvasLoading: r, closeCanvas: a } = $e(), { customVisualizers: o, themeId: s, onBeforeOpen: l } = t, u = N(async (t, n, r) => {
1359
+ }, lt = (e, t) => {
1360
+ let { openCanvas: n, openCanvasLoading: r, closeCanvas: a } = et(), { customVisualizers: o, themeId: s, onBeforeOpen: l } = t, u = P(async (t, n, r) => {
1361
1361
  if (t.url == null && t.referenceUrl != null) {
1362
1362
  let i = e.resolveReferencePdfContent(t);
1363
1363
  if (i != null) return r(i, t.name, n);
1364
1364
  }
1365
- let a = t.contentType.toLowerCase(), c = rt(a, o);
1365
+ let a = t.contentType.toLowerCase(), c = it(a, o);
1366
1366
  if (c != null) {
1367
1367
  let i = await e.resolveVisualizerContent(t, c, s);
1368
1368
  if (i != null) return r(i, t.name, n);
@@ -1372,14 +1372,14 @@ var Qe = ({ children: e }) => {
1372
1372
  if (i != null) return r(i, t.name, n);
1373
1373
  }
1374
1374
  let l = Z("", a);
1375
- if (l != null) return r(await e.resolveOoxmlContent(t, l) ?? $(e.resolveContentUrl(t)), t.name, n);
1375
+ if (l != null) return r(await e.resolveOoxmlContent(t, l) ?? Q(e.resolveContentUrl(t)), t.name, n);
1376
1376
  switch (a) {
1377
- case f.PDF: return r(await e.resolvePdfContent(t) ?? $(e.resolveContentUrl(t)), t.name, n);
1378
- case f.Markdown: return r(await e.resolveMarkdownContent(t) ?? $(e.resolveContentUrl(t)), t.name, n);
1379
- case f.JSON: return r(await e.resolveJsonContent(t) ?? $(e.resolveContentUrl(t)), t.name, n);
1377
+ case f.PDF: return r(await e.resolvePdfContent(t) ?? Q(e.resolveContentUrl(t)), t.name, n);
1378
+ case f.Markdown: return r(await e.resolveMarkdownContent(t) ?? Q(e.resolveContentUrl(t)), t.name, n);
1379
+ case f.JSON: return r(await e.resolveJsonContent(t) ?? Q(e.resolveContentUrl(t)), t.name, n);
1380
1380
  }
1381
1381
  let u = t.name ?? "", p = u.lastIndexOf("."), m = p === -1 ? "" : u.slice(p + 1).toLowerCase(), h = Z(u);
1382
- if (h != null) return r(await e.resolveOoxmlContent(t, h) ?? $(e.resolveContentUrl(t)), t.name, n);
1382
+ if (h != null) return r(await e.resolveOoxmlContent(t, h) ?? Q(e.resolveContentUrl(t)), t.name, n);
1383
1383
  switch (m) {
1384
1384
  case d.Markdown:
1385
1385
  case d.MarkdownAlt: {
@@ -1395,24 +1395,24 @@ var Qe = ({ children: e }) => {
1395
1395
  return i == null ? !1 : r(i, t.name, n);
1396
1396
  }
1397
1397
  }
1398
- let g = t.name != null && Ue(t.name) || t.url != null && Ue(st(t.url));
1399
- if (t.name != null && !Q(t.name) && !g) return r($(e.resolveContentUrl(t)), t.name, n);
1398
+ let g = t.name != null && Ge(t.name) || t.url != null && Ge(ct(t.url));
1399
+ if (t.name != null && !We(t.name) && !g) return r(Q(e.resolveContentUrl(t)), t.name, n);
1400
1400
  if (g) {
1401
1401
  let a = await e.resolveHtmlContent(t);
1402
- return a == null ? e.hasTextSource(t) ? r($(e.resolveContentUrl(t)), t.name, n) : t.url == null ? !1 : r({
1402
+ return a == null ? e.hasTextSource(t) ? r(Q(e.resolveContentUrl(t)), t.name, n) : t.url == null ? !1 : r({
1403
1403
  type: i.Html,
1404
1404
  url: t.url
1405
1405
  }, t.name, n) : r(a, t.name, n);
1406
1406
  }
1407
- let _ = await e.resolveCodeContent(t, Ge(m));
1407
+ let _ = await e.resolveCodeContent(t, qe(m));
1408
1408
  return _ == null ? !1 : r(_, t.name, n);
1409
1409
  }, [
1410
1410
  o,
1411
1411
  s,
1412
1412
  e
1413
1413
  ]);
1414
- return { openAttachmentCanvas: N(async (t, o = t.id, s) => {
1415
- let d = () => s == null || s(), f = (e, t, r) => d() ? (n(e, t, r), !0) : (Ye(e), !1);
1414
+ return { openAttachmentCanvas: P(async (t, o = t.id, s) => {
1415
+ let d = () => s == null || s(), f = (e, t, r) => d() ? (n(e, t, r), !0) : (Xe(e), !1);
1416
1416
  switch (t.type) {
1417
1417
  case c.Image: {
1418
1418
  let r = e.resolveImageContent(t);
@@ -1449,4 +1449,4 @@ var Qe = ({ children: e }) => {
1449
1449
  ]) };
1450
1450
  };
1451
1451
  //#endregion
1452
- export { de as ATTACHMENT_CANVAS_CLASS, Ie as AttachmentCanvas, Ne as AttachmentCanvasBody, et as AttachmentCanvasContainer, Qe as AttachmentCanvasProvider, i as AttachmentContentType, n as AttachmentErrorType, me as CodeContent, nt as InlineGroupedVisualizer, Se as McpAppCanvasRenderer, r as OoxmlFileType, t as OoxmlHighlightKind, qe as createForbiddenCanvasContent, Ke as createLoadErrorCanvasContent, $ as createUnsupportedCanvasContent, a as downloadAttachmentContent, Ge as extensionToLanguage, it as findVisualizerForApplication, rt as findVisualizerForMime, Z as getOoxmlFileType, He as getOoxmlMimeType, at as groupedVisualizerCanvasKey, o as isDownloadable, Ue as isHtmlPreviewable, Ve as isOoxmlPreviewable, Q as isTextPreviewable, ot as partitionAttachmentsForApplicationVisualizer, $e as useAttachmentCanvas, ct as useOpenAttachmentCanvas };
1452
+ export { fe as ATTACHMENT_CANVAS_CLASS, Le as AttachmentCanvas, Pe as AttachmentCanvasBody, tt as AttachmentCanvasContainer, $e as AttachmentCanvasProvider, i as AttachmentContentType, n as AttachmentErrorType, he as CodeContent, rt as InlineGroupedVisualizer, Ce as McpAppCanvasRenderer, r as OoxmlFileType, t as OoxmlHighlightKind, Ye as createForbiddenCanvasContent, Je as createLoadErrorCanvasContent, Q as createUnsupportedCanvasContent, a as downloadAttachmentContent, qe as extensionToLanguage, at as findVisualizerForApplication, it as findVisualizerForMime, Z as getOoxmlFileType, Ue as getOoxmlMimeType, ot as groupedVisualizerCanvasKey, o as isDownloadable, Ge as isHtmlPreviewable, He as isOoxmlPreviewable, We as isTextPreviewable, st as partitionAttachmentsForApplicationVisualizer, et as useAttachmentCanvas, lt as useOpenAttachmentCanvas };