@epam/ai-dial-attachment-canvas 1.2.0-dev.253 → 1.2.0-dev.256

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