@epam/ai-dial-attachment-canvas 1.1.0-dev.411 → 1.1.0-dev.418

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,40 +1,40 @@
1
- import { c as e, i as t, l as n, o as r, s as i, t as a } from "./LazyContentBoundary-DkAcpR4S.js";
1
+ import { c as e, i as t, l as n, o as r, s as i, t as a } from "./LazyContentBoundary-9fvYBGuL.js";
2
2
  import { AttachmentType as o, CodeBlockTheme as s, DEFAULT_MARKDOWN_CLASS_NAMES as c, FileExtension as l, MIMEType as u, MarkdownRenderer as d, buildCssVars as f, copyToClipboard as p, mergeClasses as m, restrainedSyntaxTheme as h, stripUrlQueryAndFragment as g } from "@epam/ai-dial-chat-shared";
3
- import { SidebarOrientation as _, SidebarPanel as ee } from "@epam/ai-dial-sidebar";
4
- import { DIAL_ICON_SIZE as v, DIAL_KIT_ICON_STROKE as y, GhostIconButton as b, LinkButton as x, Spinner as S } from "@epam/ai-dial-ui-kit";
5
- import { IconAlertTriangle as C, IconCheck as w, IconCode as te, IconCopy as ne, IconDownload as re, IconEye as ie, IconLock as ae, IconMarkdown as oe, IconRefresh as se } from "@tabler/icons-react";
6
- import { createContext as T, lazy as E, memo as D, useCallback as O, useContext as k, useEffect as A, useMemo as j, useRef as M, useState as N } from "react";
7
- import { JsonView as ce, defaultStyles as le } from "react-json-view-lite";
8
- import { Fragment as ue, jsx as P, jsxs as F } from "react/jsx-runtime";
9
- import { AppRenderer as de } from "@mcp-ui/client";
10
- import { VisualizerConnectorRequests as I } from "@epam/ai-dial-shared";
11
- import { VisualizerConnector as fe } from "@epam/ai-dial-visualizer-connector";
12
- var L = {
3
+ import { SidebarOrientation as _, SidebarPanel as v } from "@epam/ai-dial-sidebar";
4
+ import { DIAL_ICON_SIZE as y, DIAL_KIT_ICON_STROKE as b, GhostIconButton as x, LinkButton as S, Spinner as C } from "@epam/ai-dial-ui-kit";
5
+ import { IconAlertTriangle as w, IconCheck as T, IconCode as E, IconCopy as D, IconDownload as ee, IconEye as te, IconLock as ne, IconMarkdown as re, IconRefresh as ie } from "@tabler/icons-react";
6
+ import { createContext as O, lazy as k, memo as A, useCallback as j, useContext as M, useEffect as N, useMemo as P, useRef as F, useState as I } from "react";
7
+ import { JsonView as ae, defaultStyles as oe } from "react-json-view-lite";
8
+ import { Fragment as se, jsx as L, jsxs as R } from "react/jsx-runtime";
9
+ import { AppRenderer as z } from "@mcp-ui/client";
10
+ import { VisualizerConnectorRequests as B } from "@epam/ai-dial-shared";
11
+ import { VisualizerConnector as ce } from "@epam/ai-dial-visualizer-connector";
12
+ var V = {
13
13
  container: "_container_1nhig_1",
14
14
  containerLight: "_containerLight_1nhig_5"
15
- }, pe = {
15
+ }, H = {
16
16
  [s.Dark]: h,
17
17
  [s.Light]: h
18
- }, R = () => E(async () => {
18
+ }, le = () => k(async () => {
19
19
  let { Prism: e } = await import("react-syntax-highlighter");
20
20
  return { default: e };
21
- }), me = D(({ content: e, codeBlockTheme: t = s.Light, labels: n }) => {
22
- let { text: r, language: i } = e, o = i == null || i === "plaintext", c = pe[t], l = t === s.Light, [u, d] = N(0), f = j(R, [u]), p = O(() => {
21
+ }), ue = A(({ content: e, codeBlockTheme: t = s.Light, labels: n }) => {
22
+ let { text: r, language: i } = e, o = i == null || i === "plaintext", c = H[t], l = t === s.Light, [u, d] = I(0), f = P(le, [u]), p = j(() => {
23
23
  d((e) => e + 1);
24
- }, []), h = /* @__PURE__ */ P("pre", {
24
+ }, []), h = /* @__PURE__ */ L("pre", {
25
25
  className: "whitespace-pre-wrap break-words p-4",
26
26
  children: r
27
27
  });
28
- return /* @__PURE__ */ P("div", {
28
+ return /* @__PURE__ */ L("div", {
29
29
  dir: "ltr",
30
- className: m("h-full overflow-auto", L.container, l && L.containerLight),
31
- children: o ? h : /* @__PURE__ */ P(a, {
30
+ className: m("h-full overflow-auto", V.container, l && V.containerLight),
31
+ children: o ? h : /* @__PURE__ */ L(a, {
32
32
  retryKey: u,
33
33
  onRetry: p,
34
34
  pendingContent: h,
35
35
  errorContent: h,
36
36
  labels: n,
37
- children: /* @__PURE__ */ P(f, {
37
+ children: /* @__PURE__ */ L(f, {
38
38
  language: i,
39
39
  style: c,
40
40
  customStyle: {
@@ -51,21 +51,21 @@ var L = {
51
51
  })
52
52
  })
53
53
  });
54
- }), he = { openInNewTabButton: "_openInNewTabButton_c1arc_1" }, ge = D(({ content: e, labels: t, isSourceView: n, title: r, codeBlockTheme: a, openInNewTabButtonTypographyClassName: o = "dial-body-semi-text" }) => {
55
- let { htmlFrameBlockedLabel: s = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: c = "Open in new tab" } = t, [l, u] = N(!0), [d, f] = N(!1), p = M(null);
56
- A(() => {
54
+ }), de = { openInNewTabButton: "_openInNewTabButton_c1arc_1" }, fe = A(({ content: e, labels: t, isSourceView: n, title: r, codeBlockTheme: a, openInNewTabButtonTypographyClassName: o = "dial-body-semi-text" }) => {
55
+ let { htmlFrameBlockedLabel: s = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: c = "Open in new tab" } = t, [l, u] = I(!0), [d, f] = I(!1), p = F(null);
56
+ N(() => {
57
57
  u(!0), f(!1);
58
58
  }, [e]);
59
- let h = O((t) => {
59
+ let h = j((t) => {
60
60
  if (u(!1), e.srcdoc == null) try {
61
61
  p.current?.contentDocument ?? f(!0);
62
62
  } catch {
63
63
  f(!0);
64
64
  }
65
- }, [e.srcdoc]), g = O(() => {
65
+ }, [e.srcdoc]), g = j(() => {
66
66
  u(!1), f(!0);
67
67
  }, []);
68
- if (n && e.srcdoc != null) return /* @__PURE__ */ P(me, {
68
+ if (n && e.srcdoc != null) return /* @__PURE__ */ L(ue, {
69
69
  content: {
70
70
  type: i.Code,
71
71
  text: e.srcdoc,
@@ -73,44 +73,44 @@ var L = {
73
73
  },
74
74
  codeBlockTheme: a
75
75
  });
76
- if (d) return /* @__PURE__ */ F("div", {
76
+ if (d) return /* @__PURE__ */ R("div", {
77
77
  className: "flex h-full flex-col items-center justify-center gap-3 p-4",
78
- children: [/* @__PURE__ */ P("p", {
78
+ children: [/* @__PURE__ */ L("p", {
79
79
  className: "text-center",
80
80
  children: s
81
- }), e.url != null && /* @__PURE__ */ P(x, {
81
+ }), e.url != null && /* @__PURE__ */ L(S, {
82
82
  href: e.url,
83
83
  target: "_blank",
84
84
  label: c,
85
- className: he.openInNewTabButton,
85
+ className: de.openInNewTabButton,
86
86
  textClassName: o
87
87
  })]
88
88
  });
89
- let _ = e.srcdoc != null, ee = _ ? void 0 : e.url, v = _ ? e.srcdoc : void 0;
90
- return /* @__PURE__ */ F("div", {
89
+ let _ = e.srcdoc != null, v = _ ? void 0 : e.url, y = _ ? e.srcdoc : void 0;
90
+ return /* @__PURE__ */ R("div", {
91
91
  className: "relative h-full",
92
- children: [l && /* @__PURE__ */ P("div", {
92
+ children: [l && /* @__PURE__ */ L("div", {
93
93
  className: "absolute inset-0 flex items-center justify-center",
94
- children: /* @__PURE__ */ P(S, {})
95
- }), /* @__PURE__ */ P("iframe", {
94
+ children: /* @__PURE__ */ L(C, {})
95
+ }), /* @__PURE__ */ L("iframe", {
96
96
  ref: p,
97
97
  title: r,
98
- src: ee,
99
- srcDoc: v,
98
+ src: v,
99
+ srcDoc: y,
100
100
  sandbox: _ ? "allow-scripts" : "allow-scripts allow-same-origin",
101
101
  className: m("h-full w-full border-none", l ? "invisible" : ""),
102
102
  onLoad: h,
103
103
  onError: g
104
104
  })]
105
105
  });
106
- }), z = {
106
+ }), U = {
107
107
  loadingOverlay: "_loadingOverlay_72o98_1",
108
108
  fullscreenFrame: "_fullscreenFrame_72o98_14",
109
109
  statusLabel: "_statusLabel_72o98_19",
110
110
  errorIcon: "_errorIcon_72o98_23"
111
- }, B = ({ content: e, errorLabel: t = "Failed to load app" }) => {
112
- let [n, r] = N("loading"), { html: i, sandboxUrl: a, toolName: o, toolInput: s, toolResult: c, hostContext: l, onToolCall: u } = e, d = j(() => ({ url: new URL(a) }), [a]), f = l?.displayMode === "fullscreen", p = M(null), [h, g] = N();
113
- A(() => {
111
+ }, pe = ({ content: e, errorLabel: t = "Failed to load app" }) => {
112
+ let [n, r] = I("loading"), { html: i, sandboxUrl: a, toolName: o, toolInput: s, toolResult: c, hostContext: l, onToolCall: u } = e, d = P(() => ({ url: new URL(a) }), [a]), f = l?.displayMode === "fullscreen", p = F(null), [h, g] = I();
113
+ N(() => {
114
114
  let e = p.current;
115
115
  if (!e) return;
116
116
  let t = new ResizeObserver(([e]) => {
@@ -123,15 +123,15 @@ var L = {
123
123
  });
124
124
  return t.observe(e), () => t.disconnect();
125
125
  }, []);
126
- let _ = j(() => l == null || h == null ? l : {
126
+ let _ = P(() => l == null || h == null ? l : {
127
127
  ...l,
128
128
  containerDimensions: h
129
129
  }, [l, h]);
130
- return /* @__PURE__ */ F("div", {
130
+ return /* @__PURE__ */ R("div", {
131
131
  ref: p,
132
- className: m("relative h-full w-full", f && z.fullscreenFrame),
132
+ className: m("relative h-full w-full", f && U.fullscreenFrame),
133
133
  children: [
134
- /* @__PURE__ */ P(de, {
134
+ /* @__PURE__ */ L(z, {
135
135
  html: i,
136
136
  toolName: o,
137
137
  toolInput: s,
@@ -142,39 +142,39 @@ var L = {
142
142
  onSizeChanged: () => r("ready"),
143
143
  onError: () => r("error")
144
144
  }),
145
- n === "loading" && /* @__PURE__ */ P("div", {
146
- className: m("absolute inset-0 flex flex-col items-center justify-center gap-2", z.loadingOverlay),
147
- children: /* @__PURE__ */ P(S, {})
145
+ n === "loading" && /* @__PURE__ */ L("div", {
146
+ className: m("absolute inset-0 flex flex-col items-center justify-center gap-2", U.loadingOverlay),
147
+ children: /* @__PURE__ */ L(C, {})
148
148
  }),
149
- n === "error" && /* @__PURE__ */ F("div", {
149
+ n === "error" && /* @__PURE__ */ R("div", {
150
150
  className: "absolute inset-0 flex flex-col items-center justify-center gap-2",
151
- children: [/* @__PURE__ */ P(C, {
151
+ children: [/* @__PURE__ */ L(w, {
152
152
  size: 60,
153
- stroke: y,
153
+ stroke: b,
154
154
  "aria-hidden": !0,
155
- className: z.errorIcon
156
- }), /* @__PURE__ */ P("p", {
155
+ className: U.errorIcon
156
+ }), /* @__PURE__ */ L("p", {
157
157
  role: "alert",
158
- className: m("text-center", z.statusLabel),
158
+ className: m("text-center", U.statusLabel),
159
159
  children: t
160
160
  })]
161
161
  })
162
162
  ]
163
163
  });
164
- }, V = {
164
+ }, W = {
165
165
  viewer: "_viewer_1npwu_1",
166
166
  spreadsheetCanvas: "_spreadsheetCanvas_1npwu_5",
167
167
  formulaPanel: "_formulaPanel_1npwu_11",
168
168
  formulaValue: "_formulaValue_1npwu_17",
169
169
  statusOverlay: "_statusOverlay_1npwu_23",
170
170
  errorIcon: "_errorIcon_1npwu_28"
171
- }, _e = (e) => {
171
+ }, me = (e) => {
172
172
  if (e?.kind !== "range") return "";
173
173
  let { activeCell: t } = e.selection, n = e.cells.find(({ address: e }) => e.row === t.row && e.col === t.col);
174
174
  if (n == null) return "";
175
175
  let r = n.formula;
176
176
  return r == null || r.trim().length === 0 ? n.displayText : r.startsWith("=") ? r : `=${r}`;
177
- }, ve = async (e, t, r, i) => {
177
+ }, he = async (e, t, r, i) => {
178
178
  switch (t) {
179
179
  case n.Docx: {
180
180
  let [{ DocxScrollViewer: t }, { chartEx: n }] = await Promise.all([import("./docx-B9qBTEkj.js"), import("./chart-ex-B0DgG3Dt.js")]);
@@ -196,7 +196,7 @@ var L = {
196
196
  }
197
197
  case n.Csv: {
198
198
  let { XlsxSheetViewer: t } = await import("./xlsx-BAXMTJTG.js"), n = document.createElement("canvas");
199
- n.className = V.spreadsheetCanvas, e.replaceChildren(n);
199
+ n.className = W.spreadsheetCanvas, e.replaceChildren(n);
200
200
  let i = new t(n, {
201
201
  showScrollbars: !0,
202
202
  onError: r
@@ -216,18 +216,18 @@ var L = {
216
216
  });
217
217
  }
218
218
  }
219
- }, ye = ({ content: e, fileName: t, loadErrorLabel: r, formulaLabel: i, formulaLabelClassName: a }) => {
220
- let o = M(null), [s, c] = N(!0), [l, u] = N(!1), [d, f] = N("");
221
- return A(() => {
219
+ }, ge = ({ content: e, fileName: t, loadErrorLabel: r, formulaLabel: i, formulaLabelClassName: a }) => {
220
+ let o = F(null), [s, c] = I(!0), [l, u] = I(!1), [d, f] = I("");
221
+ return N(() => {
222
222
  let t = o.current;
223
223
  if (t == null) return;
224
224
  let n, r = !1;
225
225
  return c(!0), u(!1), f(""), (async () => {
226
226
  try {
227
- let i = await ve(t, e.format, () => {
227
+ let i = await he(t, e.format, () => {
228
228
  r || (c(!1), u(!0));
229
229
  }, (e) => {
230
- r || f(_e(e));
230
+ r || f(me(e));
231
231
  });
232
232
  if (r) {
233
233
  i.destroy();
@@ -240,44 +240,44 @@ var L = {
240
240
  })(), () => {
241
241
  r = !0, n?.destroy(), t.replaceChildren();
242
242
  };
243
- }, [e.format, e.url]), /* @__PURE__ */ F("div", {
243
+ }, [e.format, e.url]), /* @__PURE__ */ R("div", {
244
244
  className: "relative flex h-full w-full min-w-0 flex-col overflow-hidden",
245
245
  children: [
246
- e.format === n.Xlsx && /* @__PURE__ */ F("div", {
246
+ e.format === n.Xlsx && /* @__PURE__ */ R("div", {
247
247
  role: "region",
248
248
  "aria-label": i,
249
- className: m("flex min-w-0 shrink-0 items-center gap-2 border-b px-3 py-2", V.formulaPanel),
250
- children: [/* @__PURE__ */ P("span", {
249
+ className: m("flex min-w-0 shrink-0 items-center gap-2 border-b px-3 py-2", W.formulaPanel),
250
+ children: [/* @__PURE__ */ L("span", {
251
251
  "aria-hidden": "true",
252
252
  className: m("shrink-0", a),
253
253
  children: "fx"
254
- }), /* @__PURE__ */ P("code", {
254
+ }), /* @__PURE__ */ L("code", {
255
255
  dir: "ltr",
256
256
  tabIndex: 0,
257
257
  "aria-live": "polite",
258
- className: m("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", V.formulaValue),
258
+ className: m("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", W.formulaValue),
259
259
  children: d
260
260
  })]
261
261
  }),
262
- /* @__PURE__ */ P("div", {
262
+ /* @__PURE__ */ L("div", {
263
263
  ref: o,
264
264
  role: "document",
265
265
  "aria-label": t,
266
266
  "aria-busy": s,
267
- className: m("min-h-0 w-full flex-1 overflow-hidden", V.viewer)
267
+ className: m("min-h-0 w-full flex-1 overflow-hidden", W.viewer)
268
268
  }),
269
- (s || l) && /* @__PURE__ */ P("div", {
269
+ (s || l) && /* @__PURE__ */ L("div", {
270
270
  role: l ? "alert" : void 0,
271
271
  "aria-live": "polite",
272
- className: m("absolute inset-0 flex items-center justify-center", V.statusOverlay),
273
- children: s ? /* @__PURE__ */ P(S, { size: 48 }) : /* @__PURE__ */ F("div", {
272
+ className: m("absolute inset-0 flex items-center justify-center", W.statusOverlay),
273
+ children: s ? /* @__PURE__ */ L(C, { size: 48 }) : /* @__PURE__ */ R("div", {
274
274
  className: "flex flex-col items-center gap-2",
275
- children: [/* @__PURE__ */ P(C, {
275
+ children: [/* @__PURE__ */ L(w, {
276
276
  "aria-hidden": "true",
277
277
  size: 60,
278
- stroke: y,
279
- className: V.errorIcon
280
- }), /* @__PURE__ */ P("p", {
278
+ stroke: b,
279
+ className: W.errorIcon
280
+ }), /* @__PURE__ */ L("p", {
281
281
  className: "text-center",
282
282
  children: r
283
283
  })]
@@ -285,17 +285,17 @@ var L = {
285
285
  })
286
286
  ]
287
287
  });
288
- }, H = {
288
+ }, G = {
289
289
  loadingOverlay: "_loadingOverlay_12637_1",
290
290
  statusLabel: "_statusLabel_12637_5",
291
291
  errorIcon: "_errorIcon_12637_9"
292
- }, be = ({ content: e, loadingLabel: t, errorLabel: n = "Failed to load visualizer", colors: r }) => {
293
- let i = M(null), [a, o] = N("loading"), { url: s, visualizerName: c, requestTimeout: l } = e, u = M(e);
294
- return u.current = e, A(() => {
292
+ }, _e = ({ content: e, loadingLabel: t, errorLabel: n = "Failed to load visualizer", colors: r }) => {
293
+ let i = F(null), [a, o] = I("loading"), { url: s, visualizerName: c, requestTimeout: l } = e, u = F(e);
294
+ return u.current = e, N(() => {
295
295
  let e = i.current;
296
296
  if (!e) return;
297
297
  o("loading");
298
- let t = new fe(e, {
298
+ let t = new ce(e, {
299
299
  domain: s,
300
300
  hostDomain: window.location.origin,
301
301
  visualizerName: c,
@@ -307,7 +307,7 @@ var L = {
307
307
  layout: r,
308
308
  ...typeof i == "object" && i ? i : {}
309
309
  };
310
- await t.send(I.sendVisualizeData, {
310
+ await t.send(B.sendVisualizeData, {
311
311
  mimeType: e,
312
312
  visualizerData: a
313
313
  }), n && o("ready");
@@ -320,7 +320,7 @@ var L = {
320
320
  s,
321
321
  c,
322
322
  l
323
- ]), /* @__PURE__ */ F("div", {
323
+ ]), /* @__PURE__ */ R("div", {
324
324
  className: "relative h-full w-full",
325
325
  style: f({
326
326
  "--vs-loading-bg": r?.loadingBackground,
@@ -328,33 +328,33 @@ var L = {
328
328
  "--vs-error-icon": r?.errorIcon
329
329
  }),
330
330
  children: [
331
- /* @__PURE__ */ P("div", {
331
+ /* @__PURE__ */ L("div", {
332
332
  ref: i,
333
333
  className: "h-full w-full"
334
334
  }),
335
- a === "loading" && /* @__PURE__ */ F("div", {
336
- className: m("absolute inset-0 flex flex-col items-center justify-center gap-2", H.loadingOverlay),
337
- children: [/* @__PURE__ */ P(S, {}), t && /* @__PURE__ */ P("p", {
338
- className: m("text-center", H.statusLabel),
335
+ a === "loading" && /* @__PURE__ */ R("div", {
336
+ className: m("absolute inset-0 flex flex-col items-center justify-center gap-2", G.loadingOverlay),
337
+ children: [/* @__PURE__ */ L(C, {}), t && /* @__PURE__ */ L("p", {
338
+ className: m("text-center", G.statusLabel),
339
339
  children: t
340
340
  })]
341
341
  }),
342
- a === "error" && /* @__PURE__ */ F("div", {
342
+ a === "error" && /* @__PURE__ */ R("div", {
343
343
  className: "absolute inset-0 flex flex-col items-center justify-center gap-2",
344
- children: [/* @__PURE__ */ P(C, {
344
+ children: [/* @__PURE__ */ L(w, {
345
345
  size: 60,
346
- stroke: y,
346
+ stroke: b,
347
347
  "aria-hidden": !0,
348
- className: H.errorIcon
349
- }), /* @__PURE__ */ P("p", {
348
+ className: G.errorIcon
349
+ }), /* @__PURE__ */ L("p", {
350
350
  role: "alert",
351
- className: m("text-center", H.statusLabel),
351
+ className: m("text-center", G.statusLabel),
352
352
  children: n
353
353
  })]
354
354
  })
355
355
  ]
356
356
  });
357
- }, U = {
357
+ }, K = {
358
358
  body: "_body_13ogb_4",
359
359
  statusLabel: "_statusLabel_13ogb_13",
360
360
  errorIcon: "_errorIcon_13ogb_17",
@@ -369,64 +369,64 @@ var L = {
369
369
  jsonExpandIcon: "_jsonExpandIcon_13ogb_54",
370
370
  jsonCollapseIcon: "_jsonCollapseIcon_13ogb_67",
371
371
  jsonCollapsedContent: "_jsonCollapsedContent_13ogb_84"
372
- }, xe = () => E(async () => ({ default: (await import("./PdfContent-BBUc0_SC.js")).PdfContent })), Se = ({ url: e, fileName: t, loadErrorLabel: n }) => {
373
- let [r, i] = N(!1);
374
- return A(() => {
372
+ }, ve = () => k(async () => ({ default: (await import("./PdfContent-BexpRNO0.js")).PdfContent })), ye = ({ url: e, fileName: t, loadErrorLabel: n }) => {
373
+ let [r, i] = I(!1);
374
+ return N(() => {
375
375
  i(!1);
376
- }, [e]), r ? /* @__PURE__ */ F("div", {
376
+ }, [e]), r ? /* @__PURE__ */ R("div", {
377
377
  className: "flex flex-col items-center gap-2",
378
- children: [/* @__PURE__ */ P(C, {
378
+ children: [/* @__PURE__ */ L(w, {
379
379
  size: 60,
380
- stroke: y,
381
- className: U.errorIcon
382
- }), /* @__PURE__ */ P("p", {
383
- className: m("text-center", U.statusLabel),
380
+ stroke: b,
381
+ className: K.errorIcon
382
+ }), /* @__PURE__ */ L("p", {
383
+ className: m("text-center", K.statusLabel),
384
384
  children: n
385
385
  })]
386
- }) : /* @__PURE__ */ P("img", {
386
+ }) : /* @__PURE__ */ L("img", {
387
387
  src: e,
388
388
  alt: t ?? "",
389
389
  className: "max-h-full max-w-full object-contain",
390
390
  onError: () => i(!0)
391
391
  });
392
- }, Ce = new Set([
392
+ }, be = new Set([
393
393
  i.PlainText,
394
394
  i.Code,
395
395
  i.Ooxml
396
- ]), we = D(({ content: t, isLoading: n = !1, fileName: r, isHtmlSourceView: o = !1, labels: { unsupportedLabel: s = "Preview is not supported for this file", loadErrorLabel: l = "Failed to load file", forbiddenErrorLabel: u = "You don't have permission to access this file", visualizerErrorLabel: p, htmlFrameBlockedLabel: h = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: g = "Open in new tab", pdfThumbnailsLabel: _, pdfShowThumbnailsLabel: ee, pdfHideThumbnailsLabel: v, pdfPageNumberLabel: b, pdfContentLoadingLabel: x, pdfContentErrorLabel: w, pdfContentRetryLabel: te, xlsxFormulaLabel: ne = "Formula", codeContentLoadingLabel: re, codeContentErrorLabel: ie, codeContentRetryLabel: oe } = {}, styles: se, codeBlockTheme: T, loadPdf: E, hidePdfToolbar: D = !1, configurePdfWorker: k }) => {
397
- let { colors: A, typography: M, bodyClassName: ue, cssVars: de } = se ?? {}, [I, fe] = N(0), L = j(xe, [I]), pe = O(() => {
398
- fe((e) => e + 1);
399
- }, []), R = M?.fontClassName != null, he = j(() => ({
396
+ ]), xe = A(({ content: t, isLoading: n = !1, fileName: r, isHtmlSourceView: o = !1, labels: { unsupportedLabel: s = "Preview is not supported for this file", loadErrorLabel: l = "Failed to load file", forbiddenErrorLabel: u = "You don't have permission to access this file", visualizerErrorLabel: p, htmlFrameBlockedLabel: h = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: g = "Open in new tab", pdfThumbnailsLabel: _, pdfShowThumbnailsLabel: v, pdfHideThumbnailsLabel: y, pdfPageNumberLabel: x, pdfContentLoadingLabel: S, pdfContentErrorLabel: T, pdfContentRetryLabel: E, xlsxFormulaLabel: D = "Formula", codeContentLoadingLabel: ee, codeContentErrorLabel: te, codeContentRetryLabel: re, tableCopyCsvLabel: ie, tableCopyTxtLabel: O, tableCopyMarkdownLabel: k, tableCopiedLabel: A, tableDownloadCsvLabel: M } = {}, styles: N, codeBlockTheme: F, tableDownloadFilename: se, loadPdf: z, hidePdfToolbar: B = !1, configurePdfWorker: ce }) => {
397
+ let { colors: V, typography: H, bodyClassName: le, cssVars: de } = N ?? {}, [U, W] = I(0), me = P(ve, [U]), he = j(() => {
398
+ W((e) => e + 1);
399
+ }, []), G = H?.fontClassName != null, xe = P(() => ({
400
400
  ...f({
401
- "--ac-text": A?.text,
402
- "--ac-status-text": A?.statusText,
403
- "--ac-error-icon": A?.errorIcon,
404
- "--ac-open-in-new-tab-text": A?.openInNewTabText,
405
- "--ac-json-border": A?.jsonBorder,
406
- "--ac-json-bg": A?.jsonBackground,
407
- "--ac-json-label": A?.jsonLabel,
408
- "--ac-json-clickable-label": A?.jsonClickableLabel,
409
- "--ac-json-punctuation": A?.jsonPunctuation,
410
- "--ac-json-string": A?.jsonString,
411
- "--ac-json-number": A?.jsonNumber,
412
- "--ac-json-boolean": A?.jsonBoolean,
413
- "--ac-json-null": A?.jsonNull,
414
- "--ac-json-toggle-icon": A?.jsonToggleIcon,
415
- "--ac-json-toggle-icon-hover": A?.jsonToggleIconHover,
416
- "--ac-ooxml-bg": A?.ooxmlBackground,
417
- "--ac-ooxml-formula-border": A?.ooxmlFormulaBorder,
418
- "--ac-ooxml-formula-bg": A?.ooxmlFormulaBackground,
419
- "--ac-ooxml-formula-text": A?.ooxmlFormulaText,
420
- "--ac-json-collapsed-text": A?.jsonCollapsedText,
421
- "--ac-json-collapsed-bg": A?.jsonCollapsedBackground,
422
- "--ac-font-family": R ? void 0 : M?.fontFamily,
423
- "--ac-font-size": R ? void 0 : M?.fontSize,
424
- "--ac-font-weight": R ? void 0 : M?.fontWeight,
425
- "--ac-line-height": R ? void 0 : M?.lineHeight,
426
- "--ac-letter-spacing": R ? void 0 : M?.letterSpacing
401
+ "--ac-text": V?.text,
402
+ "--ac-status-text": V?.statusText,
403
+ "--ac-error-icon": V?.errorIcon,
404
+ "--ac-open-in-new-tab-text": V?.openInNewTabText,
405
+ "--ac-json-border": V?.jsonBorder,
406
+ "--ac-json-bg": V?.jsonBackground,
407
+ "--ac-json-label": V?.jsonLabel,
408
+ "--ac-json-clickable-label": V?.jsonClickableLabel,
409
+ "--ac-json-punctuation": V?.jsonPunctuation,
410
+ "--ac-json-string": V?.jsonString,
411
+ "--ac-json-number": V?.jsonNumber,
412
+ "--ac-json-boolean": V?.jsonBoolean,
413
+ "--ac-json-null": V?.jsonNull,
414
+ "--ac-json-toggle-icon": V?.jsonToggleIcon,
415
+ "--ac-json-toggle-icon-hover": V?.jsonToggleIconHover,
416
+ "--ac-ooxml-bg": V?.ooxmlBackground,
417
+ "--ac-ooxml-formula-border": V?.ooxmlFormulaBorder,
418
+ "--ac-ooxml-formula-bg": V?.ooxmlFormulaBackground,
419
+ "--ac-ooxml-formula-text": V?.ooxmlFormulaText,
420
+ "--ac-json-collapsed-text": V?.jsonCollapsedText,
421
+ "--ac-json-collapsed-bg": V?.jsonCollapsedBackground,
422
+ "--ac-font-family": G ? void 0 : H?.fontFamily,
423
+ "--ac-font-size": G ? void 0 : H?.fontSize,
424
+ "--ac-font-weight": G ? void 0 : H?.fontWeight,
425
+ "--ac-line-height": G ? void 0 : H?.lineHeight,
426
+ "--ac-letter-spacing": G ? void 0 : H?.letterSpacing
427
427
  }),
428
428
  ...de
429
- }), [se]), z = j(() => {
429
+ }), [N]), Se = P(() => {
430
430
  switch (t.type) {
431
431
  case i.Image:
432
432
  case i.Audio:
@@ -439,73 +439,99 @@ var L = {
439
439
  case i.McpApp:
440
440
  case i.Code:
441
441
  case i.Html: return "h-full overflow-hidden";
442
+ case i.Markdown:
443
+ case i.MarkdownTable: return "flex h-full min-h-0 flex-col overflow-hidden p-4";
442
444
  default: return "h-full overflow-auto p-4";
443
445
  }
444
- }, [t.type]), V = j(() => {
446
+ }, [t.type]), Ce = P(() => {
445
447
  switch (t.type) {
446
- case i.PlainText: return /* @__PURE__ */ P("pre", {
447
- className: m("whitespace-pre-wrap break-words", U.body, M?.fontClassName),
448
+ case i.PlainText: return /* @__PURE__ */ L("pre", {
449
+ className: m("whitespace-pre-wrap break-words", K.body, H?.fontClassName),
448
450
  children: t.text
449
451
  });
450
- case i.Image: return /* @__PURE__ */ P(Se, {
452
+ case i.Image: return /* @__PURE__ */ L(ye, {
451
453
  url: t.url,
452
454
  fileName: r,
453
455
  loadErrorLabel: l
454
456
  });
455
- case i.Audio: return /* @__PURE__ */ P("audio", {
457
+ case i.Audio: return /* @__PURE__ */ L("audio", {
456
458
  controls: !0,
457
459
  src: t.url,
458
460
  "aria-label": r ?? "Audio attachment",
459
461
  className: "w-full max-w-sm",
460
462
  preload: "metadata",
461
- children: t.mimeType && /* @__PURE__ */ P("source", {
463
+ children: t.mimeType && /* @__PURE__ */ L("source", {
462
464
  src: t.url,
463
465
  type: t.mimeType
464
466
  })
465
467
  });
466
- case i.Markdown: return /* @__PURE__ */ P(d, {
468
+ case i.Markdown: return /* @__PURE__ */ L(d, {
469
+ content: t.text,
470
+ isStreaming: !1,
471
+ codeBlockTheme: F,
472
+ containerClassName: "flex h-full min-h-0 flex-col",
473
+ classNames: {
474
+ ...c,
475
+ tableWrapper: "my-0 max-h-full",
476
+ tableScrollContainer: "max-h-full"
477
+ }
478
+ });
479
+ case i.MarkdownTable: return /* @__PURE__ */ L(d, {
467
480
  content: t.text,
468
481
  isStreaming: !1,
469
- codeBlockTheme: T,
470
- classNames: c
482
+ codeBlockTheme: F,
483
+ containerClassName: "flex h-full min-h-0 flex-col",
484
+ classNames: {
485
+ ...c,
486
+ tableWrapper: "my-0 max-h-full",
487
+ tableScrollContainer: "max-h-full"
488
+ },
489
+ tableActionLabels: {
490
+ copyCsvLabel: ie,
491
+ copyTxtLabel: O,
492
+ copyMarkdownLabel: k,
493
+ copiedLabel: A,
494
+ downloadCsvLabel: M
495
+ },
496
+ tableDownloadFilename: se
471
497
  });
472
- case i.Json: return /* @__PURE__ */ P("div", {
498
+ case i.Json: return /* @__PURE__ */ L("div", {
473
499
  dir: "ltr",
474
500
  className: "h-full overflow-auto",
475
- children: /* @__PURE__ */ P("div", {
476
- className: m("m-3 overflow-auto rounded-md border", U.jsonWrapper),
477
- children: /* @__PURE__ */ P(ce, {
501
+ children: /* @__PURE__ */ L("div", {
502
+ className: m("m-3 overflow-auto rounded-md border", K.jsonWrapper),
503
+ children: /* @__PURE__ */ L(ae, {
478
504
  data: t.value,
479
505
  style: {
480
- container: m("whitespace-pre-wrap break-words p-2", M?.jsonClassName ?? "dial-code-text"),
481
- basicChildStyle: le.basicChildStyle,
506
+ container: m("whitespace-pre-wrap break-words p-2", H?.jsonClassName ?? "dial-code-text"),
507
+ basicChildStyle: oe.basicChildStyle,
482
508
  childFieldsContainer: "m-0 ps-3",
483
- label: m("me-1 font-semibold", U.jsonLabel),
484
- clickableLabel: m("me-1 cursor-pointer font-semibold hover:underline", U.jsonClickableLabel),
485
- nullValue: m("italic", U.jsonNullValue),
486
- undefinedValue: m("italic", U.jsonNullValue),
487
- stringValue: U.jsonStringValue,
488
- booleanValue: U.jsonBooleanValue,
489
- numberValue: U.jsonNumberValue,
490
- otherValue: m("italic", U.jsonNullValue),
491
- punctuation: m("me-1", U.jsonPunctuation),
492
- collapseIcon: m("me-1 cursor-pointer select-none transition-colors", U.jsonCollapseIcon),
493
- expandIcon: m("me-1 cursor-pointer select-none transition-colors", U.jsonExpandIcon),
494
- collapsedContent: m("me-1 cursor-pointer rounded px-1", U.jsonCollapsedContent)
509
+ label: m("me-1 font-semibold", K.jsonLabel),
510
+ clickableLabel: m("me-1 cursor-pointer font-semibold hover:underline", K.jsonClickableLabel),
511
+ nullValue: m("italic", K.jsonNullValue),
512
+ undefinedValue: m("italic", K.jsonNullValue),
513
+ stringValue: K.jsonStringValue,
514
+ booleanValue: K.jsonBooleanValue,
515
+ numberValue: K.jsonNumberValue,
516
+ otherValue: m("italic", K.jsonNullValue),
517
+ punctuation: m("me-1", K.jsonPunctuation),
518
+ collapseIcon: m("me-1 cursor-pointer select-none transition-colors", K.jsonCollapseIcon),
519
+ expandIcon: m("me-1 cursor-pointer select-none transition-colors", K.jsonExpandIcon),
520
+ collapsedContent: m("me-1 cursor-pointer rounded px-1", K.jsonCollapsedContent)
495
521
  }
496
522
  })
497
523
  })
498
524
  });
499
- case i.Code: return /* @__PURE__ */ P(me, {
525
+ case i.Code: return /* @__PURE__ */ L(ue, {
500
526
  content: t,
501
- codeBlockTheme: T,
527
+ codeBlockTheme: F,
502
528
  labels: {
503
- loadingLabel: re,
504
- errorLabel: ie,
505
- retryLabel: oe
529
+ loadingLabel: ee,
530
+ errorLabel: te,
531
+ retryLabel: re
506
532
  }
507
533
  });
508
- case i.Html: return /* @__PURE__ */ P(ge, {
534
+ case i.Html: return /* @__PURE__ */ L(fe, {
509
535
  content: t,
510
536
  labels: {
511
537
  htmlFrameBlockedLabel: h,
@@ -513,61 +539,62 @@ var L = {
513
539
  },
514
540
  isSourceView: o,
515
541
  title: r,
516
- codeBlockTheme: T
542
+ codeBlockTheme: F
517
543
  });
518
- case i.Pdf: return /* @__PURE__ */ P(a, {
519
- retryKey: I,
520
- onRetry: pe,
544
+ case i.Pdf: return /* @__PURE__ */ L(a, {
545
+ retryKey: U,
546
+ onRetry: he,
521
547
  labels: {
522
- loadingLabel: x,
523
- errorLabel: w,
524
- retryLabel: te
548
+ loadingLabel: S,
549
+ errorLabel: T,
550
+ retryLabel: E
525
551
  },
526
- children: /* @__PURE__ */ P(L, {
552
+ children: /* @__PURE__ */ L(me, {
527
553
  fileName: r,
528
554
  url: t.url,
529
555
  highlights: t.highlights ?? [],
530
556
  selectedHighlightId: t.selectedHighlightId,
531
- loadPdf: E,
532
- hideHeader: D,
533
- configurePdfWorker: k,
557
+ selectedPageNumber: t.page,
558
+ loadPdf: z,
559
+ hideHeader: B,
560
+ configurePdfWorker: ce,
534
561
  labels: {
535
562
  thumbnailsLabel: _,
536
- showThumbnailsLabel: ee,
537
- hideThumbnailsLabel: v,
538
- pageNumberLabel: b,
539
- loadingLabel: x,
540
- errorLabel: w,
541
- retryLabel: te
563
+ showThumbnailsLabel: v,
564
+ hideThumbnailsLabel: y,
565
+ pageNumberLabel: x,
566
+ loadingLabel: S,
567
+ errorLabel: T,
568
+ retryLabel: E
542
569
  }
543
570
  })
544
571
  }, t.url);
545
- case i.Ooxml: return /* @__PURE__ */ P(ye, {
572
+ case i.Ooxml: return /* @__PURE__ */ L(ge, {
546
573
  content: t,
547
574
  fileName: r,
548
575
  loadErrorLabel: l,
549
- formulaLabel: ne,
550
- formulaLabelClassName: M?.xlsxFormulaLabelClassName ?? "dial-italic-text"
576
+ formulaLabel: D,
577
+ formulaLabelClassName: H?.xlsxFormulaLabelClassName ?? "dial-italic-text"
551
578
  });
552
- case i.Visualizer: return /* @__PURE__ */ P(be, {
579
+ case i.Visualizer: return /* @__PURE__ */ L(_e, {
553
580
  content: t,
554
581
  errorLabel: p
555
582
  });
556
- case i.McpApp: return /* @__PURE__ */ P(B, { content: t });
557
- case i.Unsupported: return /* @__PURE__ */ P("p", {
558
- className: m("text-center", U.statusLabel),
583
+ case i.McpApp: return /* @__PURE__ */ L(pe, { content: t });
584
+ case i.Unsupported: return /* @__PURE__ */ L("p", {
585
+ className: m("text-center", K.statusLabel),
559
586
  children: s
560
587
  });
561
588
  case i.Error: {
562
589
  let n = t.errorType === e.Forbidden;
563
- return /* @__PURE__ */ F("div", {
590
+ return /* @__PURE__ */ R("div", {
564
591
  className: "flex flex-col items-center gap-2",
565
- children: [P(n ? ae : C, {
592
+ children: [L(n ? ne : w, {
566
593
  size: 60,
567
- stroke: y,
568
- className: U.errorIcon
569
- }), /* @__PURE__ */ P("p", {
570
- className: m("text-center", U.statusLabel),
594
+ stroke: b,
595
+ className: K.errorIcon
596
+ }), /* @__PURE__ */ L("p", {
597
+ className: m("text-center", K.statusLabel),
571
598
  children: n ? u : l
572
599
  })]
573
600
  });
@@ -575,11 +602,11 @@ var L = {
575
602
  }
576
603
  }, [
577
604
  t,
578
- M?.fontClassName,
579
- M?.jsonClassName,
580
- M?.xlsxFormulaLabelClassName,
605
+ H?.fontClassName,
606
+ H?.jsonClassName,
607
+ H?.xlsxFormulaLabelClassName,
581
608
  r,
582
- T,
609
+ F,
583
610
  s,
584
611
  l,
585
612
  u,
@@ -587,48 +614,54 @@ var L = {
587
614
  h,
588
615
  g,
589
616
  o,
590
- E,
591
- D,
592
- k,
617
+ se,
618
+ z,
619
+ B,
620
+ ce,
593
621
  _,
594
- ee,
595
622
  v,
596
- b,
623
+ y,
597
624
  x,
598
- w,
625
+ S,
626
+ T,
627
+ E,
628
+ D,
629
+ ee,
599
630
  te,
600
- ne,
601
631
  re,
632
+ me,
633
+ U,
634
+ he,
602
635
  ie,
603
- oe,
604
- L,
605
- I,
606
- pe
636
+ O,
637
+ k,
638
+ A,
639
+ M
607
640
  ]);
608
- return /* @__PURE__ */ P("div", {
609
- style: !n && Ce.has(t.type) ? he : void 0,
610
- className: m(n ? "flex h-full items-center justify-center" : z, ue),
611
- children: n ? /* @__PURE__ */ P(S, {}) : V
641
+ return /* @__PURE__ */ L("div", {
642
+ style: !n && be.has(t.type) ? xe : void 0,
643
+ className: m(n ? "flex h-full items-center justify-center" : Se, le),
644
+ children: n ? /* @__PURE__ */ L(C, {}) : Ce
612
645
  });
613
- }), Te = 2e3, Ee = D(({ isOpen: e, isLoading: t = !1, onClose: n, content: a, fileName: o, labels: { ariaLabel: s, closeLabel: c = "Close", downloadLabel: l = "Download", copyTextLabel: u = "Copy text", copiedTextLabel: d = "Copied!", copyMarkdownLabel: f = "Copy as Markdown", copiedMarkdownLabel: p = "Copied!", copyJsonLabel: h = "Copy as JSON", copiedJsonLabel: g = "Copied!", visualizerErrorLabel: x, unsupportedLabel: S = "Preview is not supported for this file", loadErrorLabel: C = "Failed to load file", forbiddenErrorLabel: ae = "You don't have permission to access this file", htmlFrameBlockedLabel: T = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: E = "Open in new tab", htmlViewSourceLabel: D = "View source", htmlViewRenderedLabel: k = "View rendered", mcpAppReloadLabel: j = "Reload", pdfThumbnailsLabel: ce, pdfShowThumbnailsLabel: le, pdfHideThumbnailsLabel: de, pdfPageNumberLabel: I, pdfContentLoadingLabel: fe, pdfContentErrorLabel: L, pdfContentRetryLabel: pe, xlsxFormulaLabel: R, codeContentLoadingLabel: me, codeContentErrorLabel: he, codeContentRetryLabel: ge }, onDownload: z, onCopyText: B, onCopyMarkdown: V, onCopyJson: _e, isMobile: ve = !1, defaultWidth: ye, minWidth: H = 600, maxWidth: be = 1500, onResizeStop: U, styles: xe, codeBlockTheme: Se, loadPdf: Ce, configurePdfWorker: Ee }) => {
614
- let [De, Oe] = N(!1), [W, ke] = N(!1), [G, Ae] = N(!1), [K, q] = N(!1), J = M(null), Y = M(null), X = M(null), je = O(() => {
615
- B?.(), J.current != null && clearTimeout(J.current), Oe(!0), J.current = setTimeout(() => Oe(!1), Te);
616
- }, [B]), Z = O(() => {
617
- V?.(), Y.current != null && clearTimeout(Y.current), ke(!0), Y.current = setTimeout(() => ke(!1), Te);
618
- }, [V]), Me = O(() => {
619
- _e?.(), X.current != null && clearTimeout(X.current), Ae(!0), X.current = setTimeout(() => Ae(!1), Te);
620
- }, [_e]);
621
- A(() => () => {
622
- J.current != null && clearTimeout(J.current), Y.current != null && clearTimeout(Y.current), X.current != null && clearTimeout(X.current);
646
+ }), Se = 2e3, Ce = A(({ isOpen: e, isLoading: t = !1, onClose: n, content: a, fileName: o, labels: { ariaLabel: s, closeLabel: c = "Close", downloadLabel: l = "Download", copyTextLabel: u = "Copy text", copiedTextLabel: d = "Copied!", copyMarkdownLabel: f = "Copy as Markdown", copiedMarkdownLabel: p = "Copied!", copyJsonLabel: h = "Copy as JSON", copiedJsonLabel: g = "Copied!", visualizerErrorLabel: S, unsupportedLabel: C = "Preview is not supported for this file", loadErrorLabel: w = "Failed to load file", forbiddenErrorLabel: ne = "You don't have permission to access this file", htmlFrameBlockedLabel: O = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: k = "Open in new tab", htmlViewSourceLabel: A = "View source", htmlViewRenderedLabel: M = "View rendered", mcpAppReloadLabel: P = "Reload", pdfThumbnailsLabel: ae, pdfShowThumbnailsLabel: oe, pdfHideThumbnailsLabel: z, pdfPageNumberLabel: B, pdfContentLoadingLabel: ce, pdfContentErrorLabel: V, pdfContentRetryLabel: H, xlsxFormulaLabel: le, codeContentLoadingLabel: ue, codeContentErrorLabel: de, codeContentRetryLabel: fe, tableCopyCsvLabel: U, tableCopyTxtLabel: pe, tableCopyMarkdownLabel: W, tableCopiedLabel: me, tableDownloadCsvLabel: he }, onDownload: ge, onCopyText: G, onCopyMarkdown: _e, onCopyJson: K, tableDownloadFilename: ve, isMobile: ye = !1, defaultWidth: be, minWidth: Ce = 600, maxWidth: we = 1500, onResizeStop: Te, styles: Ee, codeBlockTheme: De, loadPdf: Oe, configurePdfWorker: ke }) => {
647
+ let [Ae, q] = I(!1), [je, Me] = I(!1), [Ne, Pe] = I(!1), [J, Fe] = I(!1), Y = F(null), X = F(null), Z = F(null), Ie = j(() => {
648
+ G?.(), Y.current != null && clearTimeout(Y.current), q(!0), Y.current = setTimeout(() => q(!1), Se);
649
+ }, [G]), Le = j(() => {
650
+ _e?.(), X.current != null && clearTimeout(X.current), Me(!0), X.current = setTimeout(() => Me(!1), Se);
651
+ }, [_e]), Q = j(() => {
652
+ K?.(), Z.current != null && clearTimeout(Z.current), Pe(!0), Z.current = setTimeout(() => Pe(!1), Se);
653
+ }, [K]);
654
+ N(() => () => {
655
+ Y.current != null && clearTimeout(Y.current), X.current != null && clearTimeout(X.current), Z.current != null && clearTimeout(Z.current);
623
656
  }, []);
624
- let Ne = O(() => {
625
- q((e) => !e);
657
+ let Re = j(() => {
658
+ Fe((e) => !e);
626
659
  }, []);
627
- A(() => {
628
- q(!1);
660
+ N(() => {
661
+ Fe(!1);
629
662
  }, [a]);
630
- let { className: Pe, panelStyles: Q, ...Fe } = xe ?? {}, Ie = !t && a.type === i.Html && a.srcdoc != null, $ = !t && B != null && (a.type === i.PlainText || a.type === i.Code), Le = !t && V != null && a.type === i.Markdown, Re = !t && _e != null && a.type === i.Json, ze = !t && z != null && r(a), Be = !t && a.type === i.McpApp && a.onReload != null;
631
- return /* @__PURE__ */ P(ee, {
663
+ let { className: ze, panelStyles: $, ...Be } = Ee ?? {}, Ve = !t && a.type === i.Html && a.srcdoc != null, He = !t && G != null && (a.type === i.PlainText || a.type === i.Code), Ue = !t && _e != null && a.type === i.Markdown, We = !t && K != null && a.type === i.Json, Ge = !t && ge != null && r(a), Ke = !t && a.type === i.McpApp && a.onReload != null;
664
+ return /* @__PURE__ */ L(v, {
632
665
  isOpen: e,
633
666
  orientation: _.Right,
634
667
  title: o,
@@ -637,129 +670,135 @@ var L = {
637
670
  closeLabel: c
638
671
  },
639
672
  onClose: n,
640
- resizable: !ve,
641
- defaultWidth: ye,
642
- minWidth: H,
643
- maxWidth: be,
644
- onResizeStop: U,
673
+ resizable: !ye,
674
+ defaultWidth: be,
675
+ minWidth: Ce,
676
+ maxWidth: we,
677
+ onResizeStop: Te,
645
678
  styles: {
646
- ...Q,
647
- titleClassName: Q?.titleClassName ?? "dial-h3-text",
648
- headerClassName: m("border-b border-tertiary", Q?.headerClassName),
649
- className: m(e ? "mobile:w-full mobile:max-w-full" : "w-0", Pe, Q?.className)
679
+ ...$,
680
+ titleClassName: $?.titleClassName ?? "dial-h3-text",
681
+ headerClassName: m("border-b border-tertiary", $?.headerClassName),
682
+ className: m(e ? "mobile:w-full mobile:max-w-full" : "w-0", ze, $?.className)
650
683
  },
651
- rightActions: Ie || $ || Le || Re || ze || Be ? /* @__PURE__ */ F(ue, { children: [
652
- Be && /* @__PURE__ */ P(b, {
653
- icon: /* @__PURE__ */ P(se, {
654
- size: v.LG,
655
- stroke: y,
684
+ rightActions: Ve || He || Ue || We || Ge || Ke ? /* @__PURE__ */ R(se, { children: [
685
+ Ke && /* @__PURE__ */ L(x, {
686
+ icon: /* @__PURE__ */ L(ie, {
687
+ size: y.LG,
688
+ stroke: b,
656
689
  "aria-hidden": !0
657
690
  }),
658
- "aria-label": j,
659
- tooltipProps: { tooltip: j },
691
+ "aria-label": P,
692
+ tooltipProps: { tooltip: P },
660
693
  onClick: a.type === i.McpApp ? a.onReload : void 0
661
694
  }),
662
- Ie && /* @__PURE__ */ P(b, {
663
- icon: P(K ? ie : te, {
664
- size: v.LG,
665
- stroke: y,
695
+ Ve && /* @__PURE__ */ L(x, {
696
+ icon: L(J ? te : E, {
697
+ size: y.LG,
698
+ stroke: b,
666
699
  "aria-hidden": !0
667
700
  }),
668
- "aria-label": K ? k : D,
669
- "aria-pressed": K,
670
- tooltipProps: { tooltip: K ? k : D },
671
- onClick: Ne
701
+ "aria-label": J ? M : A,
702
+ "aria-pressed": J,
703
+ tooltipProps: { tooltip: J ? M : A },
704
+ onClick: Re
672
705
  }),
673
- $ && /* @__PURE__ */ P(b, {
674
- icon: P(De ? w : ne, {
675
- size: v.LG,
676
- stroke: y,
706
+ He && /* @__PURE__ */ L(x, {
707
+ icon: L(Ae ? T : D, {
708
+ size: y.LG,
709
+ stroke: b,
677
710
  "aria-hidden": !0
678
711
  }),
679
- "aria-label": De ? d : u,
680
- tooltipProps: { tooltip: De ? d : u },
681
- onClick: je
712
+ "aria-label": Ae ? d : u,
713
+ tooltipProps: { tooltip: Ae ? d : u },
714
+ onClick: Ie
682
715
  }),
683
- Le && /* @__PURE__ */ P(b, {
684
- icon: P(W ? w : oe, {
685
- size: v.LG,
686
- stroke: y,
716
+ Ue && /* @__PURE__ */ L(x, {
717
+ icon: L(je ? T : re, {
718
+ size: y.LG,
719
+ stroke: b,
687
720
  "aria-hidden": !0
688
721
  }),
689
- "aria-label": W ? p : f,
690
- tooltipProps: { tooltip: W ? p : f },
691
- onClick: Z
722
+ "aria-label": je ? p : f,
723
+ tooltipProps: { tooltip: je ? p : f },
724
+ onClick: Le
692
725
  }),
693
- Re && /* @__PURE__ */ P(b, {
694
- icon: P(G ? w : ne, {
695
- size: v.LG,
696
- stroke: y,
726
+ We && /* @__PURE__ */ L(x, {
727
+ icon: L(Ne ? T : D, {
728
+ size: y.LG,
729
+ stroke: b,
697
730
  "aria-hidden": !0
698
731
  }),
699
- "aria-label": G ? g : h,
700
- tooltipProps: { tooltip: G ? g : h },
701
- onClick: Me
732
+ "aria-label": Ne ? g : h,
733
+ tooltipProps: { tooltip: Ne ? g : h },
734
+ onClick: Q
702
735
  }),
703
- ze && /* @__PURE__ */ P(b, {
704
- icon: /* @__PURE__ */ P(re, {
705
- size: v.LG,
706
- stroke: y
736
+ Ge && /* @__PURE__ */ L(x, {
737
+ icon: /* @__PURE__ */ L(ee, {
738
+ size: y.LG,
739
+ stroke: b
707
740
  }),
708
741
  "aria-label": l,
709
742
  tooltipProps: { tooltip: l },
710
- onClick: z
743
+ onClick: ge
711
744
  })
712
745
  ] }) : null,
713
- children: /* @__PURE__ */ P(we, {
746
+ children: /* @__PURE__ */ L(xe, {
714
747
  content: a,
715
748
  isLoading: t,
716
749
  fileName: o,
717
- isHtmlSourceView: K,
750
+ isHtmlSourceView: J,
718
751
  labels: {
719
- unsupportedLabel: S,
720
- loadErrorLabel: C,
721
- forbiddenErrorLabel: ae,
722
- visualizerErrorLabel: x,
723
- htmlFrameBlockedLabel: T,
724
- htmlOpenInNewTabLabel: E,
725
- pdfThumbnailsLabel: ce,
726
- pdfShowThumbnailsLabel: le,
727
- pdfHideThumbnailsLabel: de,
728
- pdfPageNumberLabel: I,
729
- pdfContentLoadingLabel: fe,
730
- pdfContentErrorLabel: L,
731
- pdfContentRetryLabel: pe,
732
- xlsxFormulaLabel: R,
733
- codeContentLoadingLabel: me,
734
- codeContentErrorLabel: he,
735
- codeContentRetryLabel: ge
752
+ unsupportedLabel: C,
753
+ loadErrorLabel: w,
754
+ forbiddenErrorLabel: ne,
755
+ visualizerErrorLabel: S,
756
+ htmlFrameBlockedLabel: O,
757
+ htmlOpenInNewTabLabel: k,
758
+ pdfThumbnailsLabel: ae,
759
+ pdfShowThumbnailsLabel: oe,
760
+ pdfHideThumbnailsLabel: z,
761
+ pdfPageNumberLabel: B,
762
+ pdfContentLoadingLabel: ce,
763
+ pdfContentErrorLabel: V,
764
+ pdfContentRetryLabel: H,
765
+ xlsxFormulaLabel: le,
766
+ codeContentLoadingLabel: ue,
767
+ codeContentErrorLabel: de,
768
+ codeContentRetryLabel: fe,
769
+ tableCopyCsvLabel: U,
770
+ tableCopyTxtLabel: pe,
771
+ tableCopyMarkdownLabel: W,
772
+ tableCopiedLabel: me,
773
+ tableDownloadCsvLabel: he
736
774
  },
737
- styles: Fe,
738
- codeBlockTheme: Se,
739
- loadPdf: Ce,
740
- configurePdfWorker: Ee
775
+ styles: Be,
776
+ codeBlockTheme: De,
777
+ tableDownloadFilename: ve,
778
+ loadPdf: Oe,
779
+ configurePdfWorker: ke
741
780
  })
742
781
  });
743
- }), De = {
782
+ }), we = {
744
783
  type: i.PlainText,
745
784
  text: ""
746
- }, Oe = (e) => {
785
+ }, Te = (e) => {
747
786
  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;
748
- }, W = T(void 0);
749
- W.displayName = "AttachmentCanvasContext";
750
- var ke = ({ children: e }) => {
751
- let [t, n] = N(!1), [r, i] = N(!1), [a, o] = N(De), [s, c] = N(void 0), [l, u] = N(void 0), d = O((e, t) => {
787
+ }, Ee = O(void 0);
788
+ Ee.displayName = "AttachmentCanvasContext";
789
+ var De = ({ children: e }) => {
790
+ let [t, n] = I(!1), [r, i] = I(!1), [a, o] = I(we), [s, c] = I(void 0), [l, u] = I(void 0), d = j((e, t) => {
752
791
  c(e), u(t), i(!0), n(!0);
753
- }, []), f = O((e, t, r) => {
792
+ }, []), f = j((e, t, r) => {
754
793
  o(e), c(t), u(r), i(!1), n(!0);
755
- }, []), p = O(() => {
756
- o(De), n(!1), i(!1), u(void 0);
794
+ }, []), p = j(() => {
795
+ o(we), n(!1), i(!1), u(void 0);
757
796
  }, []);
758
- return A(() => () => {
759
- let e = Oe(a);
797
+ return N(() => () => {
798
+ let e = Te(a);
760
799
  e != null && URL.revokeObjectURL(e);
761
- }, [a]), /* @__PURE__ */ P(W.Provider, {
762
- value: j(() => ({
800
+ }, [a]), /* @__PURE__ */ L(Ee.Provider, {
801
+ value: P(() => ({
763
802
  isOpen: t,
764
803
  isLoading: r,
765
804
  content: a,
@@ -780,102 +819,108 @@ var ke = ({ children: e }) => {
780
819
  ]),
781
820
  children: e
782
821
  });
783
- }, G = () => {
784
- let e = k(W);
822
+ }, Oe = () => {
823
+ let e = M(Ee);
785
824
  if (!e) throw Error("useAttachmentCanvas must be used within an AttachmentCanvasProvider");
786
825
  return e;
787
- }, Ae = D(({ labels: e, isMobile: n = !1, defaultWidth: r, maxWidth: a, codeBlockTheme: o, configurePdfWorker: s }) => {
788
- let { ariaLabel: c = "Attachment preview", closeLabel: l = "Close", downloadLabel: u = "Download", unsupportedLabel: d = "Preview is not supported for this file", loadErrorLabel: f = "Failed to load file", forbiddenErrorLabel: m = "You don't have permission to access this file", copyTextLabel: h, copiedTextLabel: g, copyMarkdownLabel: _, copiedMarkdownLabel: ee, copyJsonLabel: v, copiedJsonLabel: y, htmlFrameBlockedLabel: b, htmlOpenInNewTabLabel: x, htmlViewSourceLabel: S, htmlViewRenderedLabel: C, pdfThumbnailsLabel: w, pdfShowThumbnailsLabel: te, pdfHideThumbnailsLabel: ne, pdfPageNumberLabel: re, pdfContentLoadingLabel: ie, pdfContentErrorLabel: ae, pdfContentRetryLabel: oe, xlsxFormulaLabel: se, codeContentLoadingLabel: T, codeContentErrorLabel: E, codeContentRetryLabel: D } = e ?? {}, { isOpen: k, isLoading: A, content: j, fileName: M, closeCanvas: N } = G(), ce = O(() => {
789
- t(j, M);
790
- }, [j, M]), le = O(() => {
791
- (j.type === i.PlainText || j.type === i.Code) && p(j.text);
792
- }, [j]), ue = O(() => {
793
- j.type === i.Markdown && p(j.text);
794
- }, [j]), F = O(() => {
795
- j.type === i.Json && p(JSON.stringify(j.value, null, 2));
796
- }, [j]);
797
- return /* @__PURE__ */ P(Ee, {
798
- isOpen: k,
799
- isLoading: A,
800
- onClose: N,
801
- content: j,
802
- fileName: M,
826
+ }, ke = A(({ labels: e, isMobile: n = !1, defaultWidth: r, maxWidth: a, codeBlockTheme: o, tableDownloadFilename: s, configurePdfWorker: c }) => {
827
+ let { ariaLabel: l = "Attachment preview", closeLabel: u = "Close", downloadLabel: d = "Download", unsupportedLabel: f = "Preview is not supported for this file", loadErrorLabel: m = "Failed to load file", forbiddenErrorLabel: h = "You don't have permission to access this file", copyTextLabel: g, copiedTextLabel: _, copyMarkdownLabel: v, copiedMarkdownLabel: y, copyJsonLabel: b, copiedJsonLabel: x, htmlFrameBlockedLabel: S, htmlOpenInNewTabLabel: C, htmlViewSourceLabel: w, htmlViewRenderedLabel: T, pdfThumbnailsLabel: E, pdfShowThumbnailsLabel: D, pdfHideThumbnailsLabel: ee, pdfPageNumberLabel: te, pdfContentLoadingLabel: ne, pdfContentErrorLabel: re, pdfContentRetryLabel: ie, xlsxFormulaLabel: O, codeContentLoadingLabel: k, codeContentErrorLabel: A, codeContentRetryLabel: M, tableCopyCsvLabel: N, tableCopyTxtLabel: P, tableCopyMarkdownLabel: F, tableCopiedLabel: I, tableDownloadCsvLabel: ae } = e ?? {}, { isOpen: oe, isLoading: se, content: R, fileName: z, closeCanvas: B } = Oe(), ce = j(() => {
828
+ t(R, z);
829
+ }, [R, z]), V = j(() => {
830
+ (R.type === i.PlainText || R.type === i.Code) && p(R.text);
831
+ }, [R]), H = j(() => {
832
+ R.type === i.Markdown && p(R.text);
833
+ }, [R]), le = j(() => {
834
+ R.type === i.Json && p(JSON.stringify(R.value, null, 2));
835
+ }, [R]);
836
+ return /* @__PURE__ */ L(Ce, {
837
+ isOpen: oe,
838
+ isLoading: se,
839
+ onClose: B,
840
+ content: R,
841
+ fileName: z,
803
842
  labels: {
804
- ariaLabel: c,
805
- closeLabel: l,
806
- downloadLabel: u,
807
- copyTextLabel: h,
808
- copiedTextLabel: g,
809
- copyMarkdownLabel: _,
810
- copiedMarkdownLabel: ee,
811
- copyJsonLabel: v,
812
- copiedJsonLabel: y,
813
- unsupportedLabel: d,
814
- loadErrorLabel: f,
815
- forbiddenErrorLabel: m,
816
- htmlFrameBlockedLabel: b,
817
- htmlOpenInNewTabLabel: x,
818
- htmlViewSourceLabel: S,
819
- htmlViewRenderedLabel: C,
820
- pdfThumbnailsLabel: w,
821
- pdfShowThumbnailsLabel: te,
822
- pdfHideThumbnailsLabel: ne,
823
- pdfPageNumberLabel: re,
824
- pdfContentLoadingLabel: ie,
825
- pdfContentErrorLabel: ae,
826
- pdfContentRetryLabel: oe,
827
- xlsxFormulaLabel: se,
828
- codeContentLoadingLabel: T,
829
- codeContentErrorLabel: E,
830
- codeContentRetryLabel: D
843
+ ariaLabel: l,
844
+ closeLabel: u,
845
+ downloadLabel: d,
846
+ copyTextLabel: g,
847
+ copiedTextLabel: _,
848
+ copyMarkdownLabel: v,
849
+ copiedMarkdownLabel: y,
850
+ copyJsonLabel: b,
851
+ copiedJsonLabel: x,
852
+ unsupportedLabel: f,
853
+ loadErrorLabel: m,
854
+ forbiddenErrorLabel: h,
855
+ htmlFrameBlockedLabel: S,
856
+ htmlOpenInNewTabLabel: C,
857
+ htmlViewSourceLabel: w,
858
+ htmlViewRenderedLabel: T,
859
+ pdfThumbnailsLabel: E,
860
+ pdfShowThumbnailsLabel: D,
861
+ pdfHideThumbnailsLabel: ee,
862
+ pdfPageNumberLabel: te,
863
+ pdfContentLoadingLabel: ne,
864
+ pdfContentErrorLabel: re,
865
+ pdfContentRetryLabel: ie,
866
+ xlsxFormulaLabel: O,
867
+ codeContentLoadingLabel: k,
868
+ codeContentErrorLabel: A,
869
+ codeContentRetryLabel: M,
870
+ tableCopyCsvLabel: N,
871
+ tableCopyTxtLabel: P,
872
+ tableCopyMarkdownLabel: F,
873
+ tableCopiedLabel: I,
874
+ tableDownloadCsvLabel: ae
831
875
  },
832
876
  onDownload: ce,
833
- onCopyText: j.type === i.PlainText || j.type === i.Code ? le : void 0,
834
- onCopyMarkdown: j.type === i.Markdown ? ue : void 0,
835
- onCopyJson: j.type === i.Json ? F : void 0,
877
+ onCopyText: R.type === i.PlainText || R.type === i.Code ? V : void 0,
878
+ onCopyMarkdown: R.type === i.Markdown ? H : void 0,
879
+ onCopyJson: R.type === i.Json ? le : void 0,
880
+ tableDownloadFilename: s,
836
881
  isMobile: n,
837
882
  defaultWidth: r,
838
883
  maxWidth: a,
839
884
  codeBlockTheme: o,
840
- configurePdfWorker: s
885
+ configurePdfWorker: c
841
886
  });
842
- }), K = new Set(["html", "htm"]), q = {
887
+ }), Ae = new Set(["html", "htm"]), q = {
843
888
  docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
844
889
  xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
845
890
  pptx: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
846
- }, J = 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(".")), Y = {
891
+ }, je = 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(".")), Me = {
847
892
  docx: n.Docx,
848
893
  xlsx: n.Xlsx,
849
894
  pptx: n.Pptx,
850
895
  csv: n.Csv
851
- }, X = {
896
+ }, Ne = {
852
897
  [q.docx]: n.Docx,
853
898
  [q.xlsx]: n.Xlsx,
854
899
  [q.pptx]: n.Pptx,
855
900
  [u.CSV]: n.Csv
856
- }, je = {
901
+ }, Pe = {
857
902
  [n.Docx]: q.docx,
858
903
  [n.Xlsx]: q.xlsx,
859
904
  [n.Pptx]: q.pptx,
860
905
  [n.Csv]: u.CSV
861
- }, Z = (e, t) => {
906
+ }, J = (e, t) => {
862
907
  let n = t?.split(";", 1)[0].trim().toLowerCase();
863
908
  if (n != null) {
864
- let e = X[n];
909
+ let e = Ne[n];
865
910
  if (e != null) return e;
866
911
  }
867
912
  let r = e.lastIndexOf(".");
868
- if (r !== -1) return Y[e.slice(r + 1).toLowerCase()];
869
- }, Me = (e, t) => Z(e, t) != null, Ne = (e, t) => {
870
- let n = Z(e, t);
871
- return n == null ? void 0 : je[n];
872
- }, Pe = (e) => {
913
+ if (r !== -1) return Me[e.slice(r + 1).toLowerCase()];
914
+ }, Fe = (e, t) => J(e, t) != null, Y = (e, t) => {
915
+ let n = J(e, t);
916
+ return n == null ? void 0 : Pe[n];
917
+ }, X = (e) => {
873
918
  let t = e.lastIndexOf(".");
874
- return t === -1 ? !1 : J.has(e.slice(t + 1).toLowerCase());
875
- }, Q = (e) => {
919
+ return t === -1 ? !1 : je.has(e.slice(t + 1).toLowerCase());
920
+ }, Z = (e) => {
876
921
  let t = e.lastIndexOf(".");
877
- return t === -1 ? !1 : K.has(e.slice(t + 1).toLowerCase());
878
- }, Fe = {
922
+ return t === -1 ? !1 : Ae.has(e.slice(t + 1).toLowerCase());
923
+ }, Ie = {
879
924
  xml: "xml",
880
925
  csv: "plaintext",
881
926
  tsv: "plaintext",
@@ -923,18 +968,18 @@ var ke = ({ children: e }) => {
923
968
  gitignore: "plaintext",
924
969
  dockerfile: "plaintext",
925
970
  makefile: "plaintext"
926
- }, Ie = (e) => Fe[e], $ = (e) => ({
971
+ }, Le = (e) => Ie[e], Q = (e) => ({
927
972
  type: i.Unsupported,
928
973
  ...e != null && { url: e }
929
- }), Le = (t) => ({
974
+ }), Re = (t) => ({
930
975
  type: i.Error,
931
976
  errorType: e.LoadFailed,
932
977
  ...t != null && { url: t }
933
- }), Re = (t) => ({
978
+ }), ze = (t) => ({
934
979
  type: i.Error,
935
980
  errorType: e.Forbidden,
936
981
  ...t != null && { url: t }
937
- }), ze = (e, t) => {
982
+ }), $ = (e, t) => {
938
983
  let n = e.toLowerCase();
939
984
  return t.find((e) => e.contentType.split(",").some((e) => e.trim().toLowerCase() === n && e.trim() !== ""));
940
985
  }, Be = (e) => {
@@ -951,12 +996,12 @@ var ke = ({ children: e }) => {
951
996
  return n;
952
997
  }
953
998
  }, Ve = (e, t) => {
954
- let { openCanvas: n, openCanvasLoading: r, closeCanvas: a } = G(), { customVisualizers: s, themeId: c, onBeforeOpen: d } = t, f = O(async (t, r) => {
999
+ let { openCanvas: n, openCanvasLoading: r, closeCanvas: a } = Oe(), { customVisualizers: s, themeId: c, onBeforeOpen: d } = t, f = j(async (t, r) => {
955
1000
  if (t.url == null && t.referenceUrl != null) {
956
1001
  let i = e.resolveReferencePdfContent(t);
957
1002
  if (i != null) return n(i, t.name, r), !0;
958
1003
  }
959
- let a = t.contentType.toLowerCase(), o = ze(a, s);
1004
+ let a = t.contentType.toLowerCase(), o = $(a, s);
960
1005
  if (o != null) {
961
1006
  let i = await e.resolveVisualizerContent(t, o, c);
962
1007
  if (i != null) return n(i, t.name, r), !0;
@@ -965,15 +1010,15 @@ var ke = ({ children: e }) => {
965
1010
  let i = await e.resolveTextContent(t);
966
1011
  if (i != null) return n(i, t.name, r), !0;
967
1012
  }
968
- let d = Z("", a);
969
- if (d != null) return n(await e.resolveOoxmlContent(t, d) ?? $(e.resolveContentUrl(t)), t.name, r), !0;
1013
+ let d = J("", a);
1014
+ if (d != null) return n(await e.resolveOoxmlContent(t, d) ?? Q(e.resolveContentUrl(t)), t.name, r), !0;
970
1015
  switch (a) {
971
- case u.PDF: return n(await e.resolvePdfContent(t) ?? $(e.resolveContentUrl(t)), t.name, r), !0;
972
- case u.Markdown: return n(await e.resolveMarkdownContent(t) ?? $(e.resolveContentUrl(t)), t.name, r), !0;
973
- case u.JSON: return n(await e.resolveJsonContent(t) ?? $(e.resolveContentUrl(t)), t.name, r), !0;
1016
+ case u.PDF: return n(await e.resolvePdfContent(t) ?? Q(e.resolveContentUrl(t)), t.name, r), !0;
1017
+ case u.Markdown: return n(await e.resolveMarkdownContent(t) ?? Q(e.resolveContentUrl(t)), t.name, r), !0;
1018
+ case u.JSON: return n(await e.resolveJsonContent(t) ?? Q(e.resolveContentUrl(t)), t.name, r), !0;
974
1019
  }
975
- let f = t.name ?? "", p = f.lastIndexOf("."), m = p === -1 ? "" : f.slice(p + 1).toLowerCase(), h = Z(f);
976
- if (h != null) return n(await e.resolveOoxmlContent(t, h) ?? $(e.resolveContentUrl(t)), t.name, r), !0;
1020
+ let f = t.name ?? "", p = f.lastIndexOf("."), m = p === -1 ? "" : f.slice(p + 1).toLowerCase(), h = J(f);
1021
+ if (h != null) return n(await e.resolveOoxmlContent(t, h) ?? Q(e.resolveContentUrl(t)), t.name, r), !0;
977
1022
  switch (m) {
978
1023
  case l.Markdown:
979
1024
  case l.MarkdownAlt: {
@@ -989,16 +1034,16 @@ var ke = ({ children: e }) => {
989
1034
  return i == null ? !1 : (n(i, t.name, r), !0);
990
1035
  }
991
1036
  }
992
- let g = t.name != null && Q(t.name) || t.url != null && Q(Be(t.url));
993
- if (t.name != null && !Pe(t.name) && !g) return n($(e.resolveContentUrl(t)), t.name, r), !0;
1037
+ let g = t.name != null && Z(t.name) || t.url != null && Z(Be(t.url));
1038
+ if (t.name != null && !X(t.name) && !g) return n(Q(e.resolveContentUrl(t)), t.name, r), !0;
994
1039
  if (g) {
995
1040
  let a = await e.resolveHtmlContent(t);
996
- return a == null ? e.hasTextSource(t) ? (n($(e.resolveContentUrl(t)), t.name, r), !0) : t.url == null ? !1 : (n({
1041
+ return a == null ? e.hasTextSource(t) ? (n(Q(e.resolveContentUrl(t)), t.name, r), !0) : t.url == null ? !1 : (n({
997
1042
  type: i.Html,
998
1043
  url: t.url
999
1044
  }, t.name, r), !0) : (n(a, t.name, r), !0);
1000
1045
  }
1001
- let _ = await e.resolveCodeContent(t, Ie(m));
1046
+ let _ = await e.resolveCodeContent(t, Le(m));
1002
1047
  return _ == null ? !1 : (n(_, t.name, r), !0);
1003
1048
  }, [
1004
1049
  n,
@@ -1006,7 +1051,7 @@ var ke = ({ children: e }) => {
1006
1051
  c,
1007
1052
  e
1008
1053
  ]);
1009
- return { openAttachmentCanvas: O(async (t, s = t.id) => {
1054
+ return { openAttachmentCanvas: j(async (t, s = t.id) => {
1010
1055
  switch (t.type) {
1011
1056
  case o.Image: {
1012
1057
  let r = e.resolveImageContent(t);
@@ -1043,4 +1088,4 @@ var ke = ({ children: e }) => {
1043
1088
  ]) };
1044
1089
  };
1045
1090
  //#endregion
1046
- export { Ee as AttachmentCanvas, we as AttachmentCanvasBody, Ae as AttachmentCanvasContainer, ke as AttachmentCanvasProvider, i as AttachmentContentType, e as AttachmentErrorType, me as CodeContent, B as McpAppCanvasRenderer, n as OoxmlFileType, Re as createForbiddenCanvasContent, Le as createLoadErrorCanvasContent, $ as createUnsupportedCanvasContent, t as downloadAttachmentContent, Ie as extensionToLanguage, ze as findVisualizerForMime, Z as getOoxmlFileType, Ne as getOoxmlMimeType, r as isDownloadable, Q as isHtmlPreviewable, Me as isOoxmlPreviewable, Pe as isTextPreviewable, G as useAttachmentCanvas, Ve as useOpenAttachmentCanvas };
1091
+ export { Ce as AttachmentCanvas, xe as AttachmentCanvasBody, ke as AttachmentCanvasContainer, De as AttachmentCanvasProvider, i as AttachmentContentType, e as AttachmentErrorType, ue as CodeContent, pe as McpAppCanvasRenderer, n as OoxmlFileType, ze as createForbiddenCanvasContent, Re as createLoadErrorCanvasContent, Q as createUnsupportedCanvasContent, t as downloadAttachmentContent, Le as extensionToLanguage, $ as findVisualizerForMime, J as getOoxmlFileType, Y as getOoxmlMimeType, r as isDownloadable, Z as isHtmlPreviewable, Fe as isOoxmlPreviewable, X as isTextPreviewable, Oe as useAttachmentCanvas, Ve as useOpenAttachmentCanvas };