@epam/ai-dial-attachment-canvas 1.2.0-dev.253 → 1.2.0-dev.258
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/components/AttachmentCanvas/AttachmentCanvas.d.ts.map +1 -1
- package/components/AttachmentCanvasBody/AttachmentCanvasBody.d.ts.map +1 -1
- package/components/AttachmentCanvasContainer/AttachmentCanvasContainer.d.ts +2 -0
- package/components/AttachmentCanvasContainer/AttachmentCanvasContainer.d.ts.map +1 -1
- package/components/HtmlContent/HtmlContent.d.ts.map +1 -1
- package/components/InlineGroupedVisualizer/InlineGroupedVisualizer.d.ts +2 -0
- package/components/InlineGroupedVisualizer/InlineGroupedVisualizer.d.ts.map +1 -1
- package/components/VisualizerCanvasRenderer/VisualizerCanvasRenderer.d.ts +2 -0
- package/components/VisualizerCanvasRenderer/VisualizerCanvasRenderer.d.ts.map +1 -1
- package/constants/html-preview.d.ts +9 -0
- package/constants/html-preview.d.ts.map +1 -0
- package/index.css +1 -1
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +517 -482
- package/models/attachment-canvas.d.ts +6 -0
- package/models/attachment-canvas.d.ts.map +1 -1
- package/package.json +4 -4
- package/utils/visualizer.d.ts +6 -0
- package/utils/visualizer.d.ts.map +1 -1
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
|
|
7
|
-
import { createContext as
|
|
8
|
-
import { JsonView as
|
|
9
|
-
import { Fragment as
|
|
10
|
-
import { AppBridge as
|
|
11
|
-
import { McpUiHostContextChangedNotificationSchema as
|
|
12
|
-
import { VisualizerConnectorRequests as
|
|
13
|
-
import { VisualizerConnector as
|
|
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 oe, defaultStyles as V } 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 K } from "@mcp-ui/client";
|
|
11
|
+
import { McpUiHostContextChangedNotificationSchema as se } from "@modelcontextprotocol/ext-apps/app-bridge";
|
|
12
|
+
import { VisualizerConnectorEvents as ce, 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
|
|
15
|
+
var de = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
16
16
|
container: "_container_1nhig_1",
|
|
17
17
|
containerLight: "_containerLight_1nhig_5"
|
|
18
|
-
},
|
|
18
|
+
}, q = {
|
|
19
19
|
[l.Dark]: v,
|
|
20
20
|
[l.Light]: v
|
|
21
|
-
},
|
|
21
|
+
}, pe = () => P(async () => {
|
|
22
22
|
let { Prism: e } = await import("react-syntax-highlighter");
|
|
23
23
|
return { default: e };
|
|
24
|
-
}),
|
|
25
|
-
let { text: r, language: i } = e, a =
|
|
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 = q[t], u = t === l.Light, [d, f] = B(0), p = R(pe, [d]), m = I(() => {
|
|
26
26
|
f((e) => e + 1);
|
|
27
|
-
}, []), h = /* @__PURE__ */
|
|
27
|
+
}, []), h = /* @__PURE__ */ U("pre", {
|
|
28
28
|
className: "whitespace-pre-wrap break-words p-4",
|
|
29
29
|
children: r
|
|
30
30
|
});
|
|
31
|
-
return /* @__PURE__ */
|
|
31
|
+
return /* @__PURE__ */ U("div", {
|
|
32
32
|
dir: "ltr",
|
|
33
|
-
className: _("h-full overflow-auto",
|
|
34
|
-
children: o ? h : /* @__PURE__ */
|
|
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__ */
|
|
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 =
|
|
58
|
-
let { htmlFrameBlockedLabel: s = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: c = "Open in new tab" } = t, [l, u] =
|
|
59
|
-
|
|
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
|
|
63
|
-
|
|
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
|
|
85
|
-
if (u(!1),
|
|
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
|
-
}, [
|
|
106
|
+
}, [
|
|
107
|
+
k,
|
|
108
|
+
O,
|
|
109
|
+
A,
|
|
110
|
+
j
|
|
111
|
+
]), te = I(() => {
|
|
91
112
|
u(!1), f(!0);
|
|
92
|
-
}, []),
|
|
93
|
-
if (n &&
|
|
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__ */
|
|
96
|
-
}) : /* @__PURE__ */
|
|
116
|
+
children: /* @__PURE__ */ U(D, {})
|
|
117
|
+
}) : /* @__PURE__ */ U(me, {
|
|
97
118
|
content: {
|
|
98
119
|
type: i.Code,
|
|
99
|
-
text:
|
|
120
|
+
text: M,
|
|
100
121
|
language: "html"
|
|
101
122
|
},
|
|
102
123
|
codeBlockTheme: a
|
|
103
124
|
});
|
|
104
|
-
if (d) return /* @__PURE__ */
|
|
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__ */
|
|
127
|
+
children: [/* @__PURE__ */ U("p", {
|
|
107
128
|
className: "text-center",
|
|
108
129
|
children: s
|
|
109
|
-
}), e.url != null && /* @__PURE__ */
|
|
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
|
|
118
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
141
|
+
children: [l && /* @__PURE__ */ U("div", {
|
|
121
142
|
className: "absolute inset-0 flex items-center justify-center",
|
|
122
|
-
children: /* @__PURE__ */
|
|
123
|
-
}), /* @__PURE__ */
|
|
143
|
+
children: /* @__PURE__ */ U(D, {})
|
|
144
|
+
}), /* @__PURE__ */ U("iframe", {
|
|
124
145
|
ref: b,
|
|
125
146
|
title: r,
|
|
126
|
-
src:
|
|
127
|
-
srcDoc:
|
|
128
|
-
sandbox:
|
|
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:
|
|
131
|
-
onError:
|
|
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 =
|
|
160
|
-
|
|
180
|
+
let r = z(e);
|
|
181
|
+
L(() => {
|
|
161
182
|
r.current = e;
|
|
162
183
|
});
|
|
163
|
-
let [i, a] =
|
|
164
|
-
return
|
|
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
|
|
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(
|
|
201
|
+
}, e.oncalltool = (e) => r.current.onToolCall(e.name, e.arguments), e.setNotificationHandler(se, ({ 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]),
|
|
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
|
-
},
|
|
217
|
+
}, J = {
|
|
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] =
|
|
205
|
-
|
|
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,
|
|
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__ */
|
|
243
|
+
return /* @__PURE__ */ W("div", {
|
|
223
244
|
ref: m,
|
|
224
|
-
className: _("relative h-full min-h-[200px] w-full", p &&
|
|
245
|
+
className: _("relative h-full min-h-[200px] w-full", p && J.fullscreenFrame, !p && r === "loading" && J.loadingFrame),
|
|
225
246
|
children: [
|
|
226
|
-
v != null && !b && /* @__PURE__ */
|
|
247
|
+
v != null && !b && /* @__PURE__ */ U(K, {
|
|
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__ */
|
|
241
|
-
className: _("absolute inset-0 flex flex-col items-center justify-center gap-2",
|
|
242
|
-
children: /* @__PURE__ */
|
|
261
|
+
!b && r === "loading" && /* @__PURE__ */ U("div", {
|
|
262
|
+
className: _("absolute inset-0 flex flex-col items-center justify-center gap-2", J.loadingOverlay),
|
|
263
|
+
children: /* @__PURE__ */ U(D, {})
|
|
243
264
|
}),
|
|
244
|
-
b && /* @__PURE__ */
|
|
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__ */
|
|
267
|
+
children: [/* @__PURE__ */ U(O, {
|
|
247
268
|
size: 60,
|
|
248
269
|
stroke: C,
|
|
249
270
|
"aria-hidden": !0,
|
|
250
|
-
className:
|
|
251
|
-
}), /* @__PURE__ */
|
|
271
|
+
className: J.errorIcon
|
|
272
|
+
}), /* @__PURE__ */ W("p", {
|
|
252
273
|
role: "alert",
|
|
253
|
-
className: _("text-center",
|
|
254
|
-
children: [t, a && /* @__PURE__ */ H
|
|
255
|
-
className:
|
|
274
|
+
className: _("text-center", J.statusLabel),
|
|
275
|
+
children: [t, a && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("br", {}), /* @__PURE__ */ U("span", {
|
|
276
|
+
className: J.statusDetail,
|
|
256
277
|
children: a
|
|
257
278
|
})] })]
|
|
258
279
|
})]
|
|
259
280
|
})
|
|
260
281
|
]
|
|
261
282
|
});
|
|
262
|
-
},
|
|
283
|
+
}, Y = {
|
|
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 =
|
|
319
|
+
r.className = Y.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 =
|
|
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 =
|
|
393
|
-
return
|
|
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
|
-
]),
|
|
475
|
+
]), L(() => {
|
|
455
476
|
k.current?.();
|
|
456
|
-
}, [x]),
|
|
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__ */
|
|
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__ */
|
|
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",
|
|
481
|
-
children: [/* @__PURE__ */
|
|
501
|
+
className: _("flex min-w-0 shrink-0 items-center gap-2 border-b px-3 py-2", Y.formulaPanel),
|
|
502
|
+
children: [/* @__PURE__ */ U("span", {
|
|
482
503
|
"aria-hidden": "true",
|
|
483
504
|
className: _("shrink-0", o),
|
|
484
505
|
children: "fx"
|
|
485
|
-
}), /* @__PURE__ */
|
|
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",
|
|
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", Y.formulaValue),
|
|
490
511
|
children: m
|
|
491
512
|
})]
|
|
492
513
|
}),
|
|
493
|
-
/* @__PURE__ */
|
|
514
|
+
/* @__PURE__ */ W("div", {
|
|
494
515
|
className: "relative min-h-0 w-full flex-1",
|
|
495
|
-
children: [/* @__PURE__ */
|
|
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",
|
|
501
|
-
}), g.length > 0 && /* @__PURE__ */
|
|
521
|
+
className: _("h-full w-full overflow-hidden", Y.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__ */
|
|
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",
|
|
536
|
+
className: _("absolute", Y.highlight)
|
|
516
537
|
}, `${e.highlightId}-${t}`))
|
|
517
538
|
})]
|
|
518
539
|
}),
|
|
519
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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",
|
|
529
|
-
children: u ? /* @__PURE__ */
|
|
549
|
+
className: _("absolute inset-0 flex items-center justify-center", Y.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__ */
|
|
552
|
+
children: [/* @__PURE__ */ U(O, {
|
|
532
553
|
"aria-hidden": "true",
|
|
533
554
|
size: 60,
|
|
534
555
|
stroke: C,
|
|
535
|
-
className:
|
|
536
|
-
}), /* @__PURE__ */
|
|
556
|
+
className: Y.errorIcon
|
|
557
|
+
}), /* @__PURE__ */ U("p", {
|
|
537
558
|
className: "text-center",
|
|
538
559
|
children: i
|
|
539
560
|
})]
|
|
@@ -541,26 +562,52 @@ var fe = { panel: "dial-attachment-canvas-panel" }, pe = {
|
|
|
541
562
|
})
|
|
542
563
|
]
|
|
543
564
|
});
|
|
544
|
-
}, ke = {
|
|
565
|
+
}, ke = (e, t) => {
|
|
566
|
+
let n = e.toLowerCase();
|
|
567
|
+
return t.find((e) => e.contentType.split(",").some((e) => e.trim().toLowerCase() === n && e.trim() !== ""));
|
|
568
|
+
}, Ae = (e, t) => {
|
|
569
|
+
if (!(e == null || e === "")) return Object.prototype.hasOwnProperty.call(t, e) ? t[e] : void 0;
|
|
570
|
+
}, je = (e) => `${e}:grouped-visualizer`, Me = (e, t) => {
|
|
571
|
+
let n = (t.contentType ?? "").split(",").map((e) => e.trim().toLowerCase()).filter((e) => e !== ""), r = [], i = [];
|
|
572
|
+
return e.forEach((e) => {
|
|
573
|
+
if (e.url != null && e.url !== "" && (n.length === 0 || n.includes(e.contentType.toLowerCase()))) {
|
|
574
|
+
r.push(e);
|
|
575
|
+
return;
|
|
576
|
+
}
|
|
577
|
+
i.push(e);
|
|
578
|
+
}), {
|
|
579
|
+
claimed: r,
|
|
580
|
+
unclaimed: i
|
|
581
|
+
};
|
|
582
|
+
}, Ne = (e) => {
|
|
583
|
+
if (typeof e != "object" || !e || !Object.prototype.hasOwnProperty.call(e, "message")) return;
|
|
584
|
+
let { message: t } = e;
|
|
585
|
+
return typeof t == "string" && t.trim() !== "" ? t : void 0;
|
|
586
|
+
}, Pe = {
|
|
545
587
|
loadingOverlay: "_loadingOverlay_12637_1",
|
|
546
588
|
statusLabel: "_statusLabel_12637_5",
|
|
547
589
|
errorIcon: "_errorIcon_12637_9"
|
|
548
|
-
},
|
|
549
|
-
let
|
|
550
|
-
|
|
551
|
-
|
|
590
|
+
}, Fe = ({ content: e, loadingLabel: t, errorLabel: n = "Failed to load visualizer", frameTitle: r, colors: a, onSendMessage: o }) => {
|
|
591
|
+
let s = z(null), [c, l] = B("loading"), { url: u, visualizerName: d, requestTimeout: f } = e, p = z(e);
|
|
592
|
+
p.current = e;
|
|
593
|
+
let h = z(o);
|
|
594
|
+
return h.current = o, L(() => {
|
|
595
|
+
let e = s.current;
|
|
552
596
|
if (!e) return;
|
|
553
|
-
|
|
554
|
-
let t = new
|
|
555
|
-
domain:
|
|
597
|
+
l("loading");
|
|
598
|
+
let t = new ue(e, {
|
|
599
|
+
domain: u,
|
|
556
600
|
hostDomain: window.location.origin,
|
|
557
|
-
visualizerName:
|
|
558
|
-
requestTimeout:
|
|
559
|
-
}), n = !0
|
|
601
|
+
visualizerName: d,
|
|
602
|
+
requestTimeout: f
|
|
603
|
+
}), n = !0, r = t.subscribe(`${d}/${ce.sendMessage}`, (e) => {
|
|
604
|
+
let t = Ne(e);
|
|
605
|
+
t != null && h.current?.(t);
|
|
606
|
+
});
|
|
560
607
|
return (async () => {
|
|
561
608
|
if (await t.ready(), !n) return;
|
|
562
|
-
let e =
|
|
563
|
-
if (e.type === i.GroupedVisualizer) await t.send(
|
|
609
|
+
let e = p.current;
|
|
610
|
+
if (e.type === i.GroupedVisualizer) await t.send(le.sendGroupedVisualizeData, {
|
|
564
611
|
attachments: e.attachments,
|
|
565
612
|
layout: e.layout
|
|
566
613
|
});
|
|
@@ -569,30 +616,30 @@ var fe = { panel: "dial-attachment-canvas-panel" }, pe = {
|
|
|
569
616
|
layout: r,
|
|
570
617
|
...typeof i == "object" && i ? i : {}
|
|
571
618
|
};
|
|
572
|
-
await t.send(
|
|
619
|
+
await t.send(le.sendVisualizeData, {
|
|
573
620
|
mimeType: n,
|
|
574
621
|
visualizerData: a
|
|
575
622
|
});
|
|
576
623
|
}
|
|
577
|
-
n &&
|
|
624
|
+
n && l("ready");
|
|
578
625
|
})().catch(() => {
|
|
579
|
-
n &&
|
|
626
|
+
n && l("error");
|
|
580
627
|
}), () => {
|
|
581
|
-
n = !1, t.destroy();
|
|
628
|
+
n = !1, r(), t.destroy();
|
|
582
629
|
};
|
|
583
630
|
}, [
|
|
584
|
-
l,
|
|
585
631
|
u,
|
|
586
|
-
d
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
e
|
|
632
|
+
d,
|
|
633
|
+
f
|
|
634
|
+
]), L(() => {
|
|
635
|
+
let e = r ?? d.trim();
|
|
636
|
+
e !== "" && s.current?.querySelector("iframe")?.setAttribute("title", e);
|
|
590
637
|
}, [
|
|
591
638
|
r,
|
|
639
|
+
d,
|
|
592
640
|
u,
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
]), /* @__PURE__ */ H("div", {
|
|
641
|
+
f
|
|
642
|
+
]), /* @__PURE__ */ W("div", {
|
|
596
643
|
className: "relative h-full w-full",
|
|
597
644
|
style: m({
|
|
598
645
|
"--vs-loading-bg": a?.loadingBackground,
|
|
@@ -600,33 +647,33 @@ var fe = { panel: "dial-attachment-canvas-panel" }, pe = {
|
|
|
600
647
|
"--vs-error-icon": a?.errorIcon
|
|
601
648
|
}),
|
|
602
649
|
children: [
|
|
603
|
-
/* @__PURE__ */
|
|
604
|
-
ref:
|
|
650
|
+
/* @__PURE__ */ U("div", {
|
|
651
|
+
ref: s,
|
|
605
652
|
className: "h-full w-full"
|
|
606
653
|
}),
|
|
607
|
-
|
|
608
|
-
className: _("absolute inset-0 flex flex-col items-center justify-center gap-2",
|
|
609
|
-
children: [/* @__PURE__ */
|
|
610
|
-
className: _("text-center",
|
|
654
|
+
c === "loading" && /* @__PURE__ */ W("div", {
|
|
655
|
+
className: _("absolute inset-0 flex flex-col items-center justify-center gap-2", Pe.loadingOverlay),
|
|
656
|
+
children: [/* @__PURE__ */ U(D, {}), t && /* @__PURE__ */ U("p", {
|
|
657
|
+
className: _("text-center", Pe.statusLabel),
|
|
611
658
|
children: t
|
|
612
659
|
})]
|
|
613
660
|
}),
|
|
614
|
-
|
|
661
|
+
c === "error" && /* @__PURE__ */ W("div", {
|
|
615
662
|
className: "absolute inset-0 flex flex-col items-center justify-center gap-2",
|
|
616
|
-
children: [/* @__PURE__ */
|
|
663
|
+
children: [/* @__PURE__ */ U(O, {
|
|
617
664
|
size: 60,
|
|
618
665
|
stroke: C,
|
|
619
666
|
"aria-hidden": !0,
|
|
620
|
-
className:
|
|
621
|
-
}), /* @__PURE__ */
|
|
667
|
+
className: Pe.errorIcon
|
|
668
|
+
}), /* @__PURE__ */ U("p", {
|
|
622
669
|
role: "alert",
|
|
623
|
-
className: _("text-center",
|
|
670
|
+
className: _("text-center", Pe.statusLabel),
|
|
624
671
|
children: n
|
|
625
672
|
})]
|
|
626
673
|
})
|
|
627
674
|
]
|
|
628
675
|
});
|
|
629
|
-
},
|
|
676
|
+
}, X = {
|
|
630
677
|
body: "_body_13ogb_4",
|
|
631
678
|
statusLabel: "_statusLabel_13ogb_13",
|
|
632
679
|
errorIcon: "_errorIcon_13ogb_17",
|
|
@@ -641,66 +688,66 @@ var fe = { panel: "dial-attachment-canvas-panel" }, pe = {
|
|
|
641
688
|
jsonExpandIcon: "_jsonExpandIcon_13ogb_54",
|
|
642
689
|
jsonCollapseIcon: "_jsonCollapseIcon_13ogb_67",
|
|
643
690
|
jsonCollapsedContent: "_jsonCollapsedContent_13ogb_84"
|
|
644
|
-
},
|
|
645
|
-
let [r, i] =
|
|
646
|
-
return
|
|
691
|
+
}, Ie = () => P(async () => ({ default: (await import("./PdfContent-BoAtghsO.js")).PdfContent })), Le = ({ url: e, fileName: t, loadErrorLabel: n }) => {
|
|
692
|
+
let [r, i] = B(!1);
|
|
693
|
+
return L(() => {
|
|
647
694
|
i(!1);
|
|
648
|
-
}, [e]), r ? /* @__PURE__ */
|
|
695
|
+
}, [e]), r ? /* @__PURE__ */ W("div", {
|
|
649
696
|
className: "flex flex-col items-center gap-2",
|
|
650
|
-
children: [/* @__PURE__ */
|
|
697
|
+
children: [/* @__PURE__ */ U(O, {
|
|
651
698
|
size: 60,
|
|
652
699
|
stroke: C,
|
|
653
|
-
className:
|
|
654
|
-
}), /* @__PURE__ */
|
|
655
|
-
className: _("text-center",
|
|
700
|
+
className: X.errorIcon
|
|
701
|
+
}), /* @__PURE__ */ U("p", {
|
|
702
|
+
className: _("text-center", X.statusLabel),
|
|
656
703
|
children: n
|
|
657
704
|
})]
|
|
658
|
-
}) : /* @__PURE__ */
|
|
705
|
+
}) : /* @__PURE__ */ U("img", {
|
|
659
706
|
src: e,
|
|
660
707
|
alt: t ?? "",
|
|
661
708
|
className: "max-h-full max-w-full object-contain",
|
|
662
709
|
onError: () => i(!0)
|
|
663
710
|
});
|
|
664
|
-
},
|
|
711
|
+
}, Re = new Set([
|
|
665
712
|
i.PlainText,
|
|
666
713
|
i.Code,
|
|
667
714
|
i.Ooxml
|
|
668
|
-
]),
|
|
669
|
-
let { colors:
|
|
670
|
-
|
|
671
|
-
}, []),
|
|
715
|
+
]), ze = 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, onVisualizerSendMessage: H }) => {
|
|
716
|
+
let { colors: G, typography: K, bodyClassName: se, cssVars: ce } = ie ?? {}, [le, ue] = B(0), de = R(Ie, [le]), fe = I(() => {
|
|
717
|
+
ue((e) => e + 1);
|
|
718
|
+
}, []), q = K?.fontClassName != null, pe = R(() => ({
|
|
672
719
|
...m({
|
|
673
|
-
"--ac-text":
|
|
674
|
-
"--ac-status-text":
|
|
675
|
-
"--ac-error-icon":
|
|
676
|
-
"--ac-open-in-new-tab-text":
|
|
677
|
-
"--ac-json-border":
|
|
678
|
-
"--ac-json-bg":
|
|
679
|
-
"--ac-json-label":
|
|
680
|
-
"--ac-json-clickable-label":
|
|
681
|
-
"--ac-json-punctuation":
|
|
682
|
-
"--ac-json-string":
|
|
683
|
-
"--ac-json-number":
|
|
684
|
-
"--ac-json-boolean":
|
|
685
|
-
"--ac-json-null":
|
|
686
|
-
"--ac-json-toggle-icon":
|
|
687
|
-
"--ac-json-toggle-icon-hover":
|
|
688
|
-
"--ac-ooxml-bg":
|
|
689
|
-
"--ac-ooxml-formula-border":
|
|
690
|
-
"--ac-ooxml-formula-bg":
|
|
691
|
-
"--ac-ooxml-formula-text":
|
|
692
|
-
"--ac-ooxml-highlight-border":
|
|
693
|
-
"--ac-ooxml-highlight-bg":
|
|
694
|
-
"--ac-json-collapsed-text":
|
|
695
|
-
"--ac-json-collapsed-bg":
|
|
696
|
-
"--ac-font-family":
|
|
697
|
-
"--ac-font-size":
|
|
698
|
-
"--ac-font-weight":
|
|
699
|
-
"--ac-line-height":
|
|
700
|
-
"--ac-letter-spacing":
|
|
720
|
+
"--ac-text": G?.text,
|
|
721
|
+
"--ac-status-text": G?.statusText,
|
|
722
|
+
"--ac-error-icon": G?.errorIcon,
|
|
723
|
+
"--ac-open-in-new-tab-text": G?.openInNewTabText,
|
|
724
|
+
"--ac-json-border": G?.jsonBorder,
|
|
725
|
+
"--ac-json-bg": G?.jsonBackground,
|
|
726
|
+
"--ac-json-label": G?.jsonLabel,
|
|
727
|
+
"--ac-json-clickable-label": G?.jsonClickableLabel,
|
|
728
|
+
"--ac-json-punctuation": G?.jsonPunctuation,
|
|
729
|
+
"--ac-json-string": G?.jsonString,
|
|
730
|
+
"--ac-json-number": G?.jsonNumber,
|
|
731
|
+
"--ac-json-boolean": G?.jsonBoolean,
|
|
732
|
+
"--ac-json-null": G?.jsonNull,
|
|
733
|
+
"--ac-json-toggle-icon": G?.jsonToggleIcon,
|
|
734
|
+
"--ac-json-toggle-icon-hover": G?.jsonToggleIconHover,
|
|
735
|
+
"--ac-ooxml-bg": G?.ooxmlBackground,
|
|
736
|
+
"--ac-ooxml-formula-border": G?.ooxmlFormulaBorder,
|
|
737
|
+
"--ac-ooxml-formula-bg": G?.ooxmlFormulaBackground,
|
|
738
|
+
"--ac-ooxml-formula-text": G?.ooxmlFormulaText,
|
|
739
|
+
"--ac-ooxml-highlight-border": G?.ooxmlHighlightBorder,
|
|
740
|
+
"--ac-ooxml-highlight-bg": G?.ooxmlHighlightBackground,
|
|
741
|
+
"--ac-json-collapsed-text": G?.jsonCollapsedText,
|
|
742
|
+
"--ac-json-collapsed-bg": G?.jsonCollapsedBackground,
|
|
743
|
+
"--ac-font-family": q ? void 0 : K?.fontFamily,
|
|
744
|
+
"--ac-font-size": q ? void 0 : K?.fontSize,
|
|
745
|
+
"--ac-font-weight": q ? void 0 : K?.fontWeight,
|
|
746
|
+
"--ac-line-height": q ? void 0 : K?.lineHeight,
|
|
747
|
+
"--ac-letter-spacing": q ? void 0 : K?.letterSpacing
|
|
701
748
|
}),
|
|
702
|
-
...
|
|
703
|
-
}), [
|
|
749
|
+
...ce
|
|
750
|
+
}), [ie]), he = R(() => {
|
|
704
751
|
switch (e.type) {
|
|
705
752
|
case i.Image:
|
|
706
753
|
case i.Audio:
|
|
@@ -718,39 +765,39 @@ var fe = { panel: "dial-attachment-canvas-panel" }, pe = {
|
|
|
718
765
|
case i.MarkdownTable: return "flex h-full min-h-0 flex-col overflow-hidden p-4";
|
|
719
766
|
default: return "h-full overflow-auto p-4";
|
|
720
767
|
}
|
|
721
|
-
}, [e.type]),
|
|
768
|
+
}, [e.type]), ge = R(() => {
|
|
722
769
|
switch (e.type) {
|
|
723
|
-
case i.PlainText: return /* @__PURE__ */
|
|
724
|
-
className: _("whitespace-pre-wrap break-words",
|
|
770
|
+
case i.PlainText: return /* @__PURE__ */ U("pre", {
|
|
771
|
+
className: _("whitespace-pre-wrap break-words", X.body, K?.fontClassName),
|
|
725
772
|
children: e.text
|
|
726
773
|
});
|
|
727
|
-
case i.Image: return /* @__PURE__ */
|
|
774
|
+
case i.Image: return /* @__PURE__ */ U(Le, {
|
|
728
775
|
url: e.url,
|
|
729
776
|
fileName: r,
|
|
730
777
|
loadErrorLabel: c
|
|
731
778
|
});
|
|
732
|
-
case i.Audio: return /* @__PURE__ */
|
|
779
|
+
case i.Audio: return /* @__PURE__ */ U("audio", {
|
|
733
780
|
controls: !0,
|
|
734
781
|
controlsList: "nodownload",
|
|
735
782
|
src: e.url,
|
|
736
783
|
"aria-label": r ?? "Audio attachment",
|
|
737
784
|
className: "w-full max-w-sm",
|
|
738
785
|
preload: "metadata",
|
|
739
|
-
children: e.mimeType && /* @__PURE__ */
|
|
786
|
+
children: e.mimeType && /* @__PURE__ */ U("source", {
|
|
740
787
|
src: e.url,
|
|
741
788
|
type: e.mimeType
|
|
742
789
|
})
|
|
743
790
|
});
|
|
744
|
-
case i.Markdown: return /* @__PURE__ */
|
|
791
|
+
case i.Markdown: return /* @__PURE__ */ U(p, {
|
|
745
792
|
content: e.text,
|
|
746
793
|
isStreaming: !1,
|
|
747
|
-
codeBlockTheme:
|
|
794
|
+
codeBlockTheme: N,
|
|
748
795
|
classNames: u
|
|
749
796
|
});
|
|
750
|
-
case i.MarkdownTable: return /* @__PURE__ */
|
|
797
|
+
case i.MarkdownTable: return /* @__PURE__ */ U(p, {
|
|
751
798
|
content: e.text,
|
|
752
799
|
isStreaming: !1,
|
|
753
|
-
codeBlockTheme:
|
|
800
|
+
codeBlockTheme: N,
|
|
754
801
|
containerClassName: "flex h-full min-h-0 flex-col",
|
|
755
802
|
classNames: {
|
|
756
803
|
...u,
|
|
@@ -758,49 +805,49 @@ var fe = { panel: "dial-attachment-canvas-panel" }, pe = {
|
|
|
758
805
|
tableScrollContainer: "max-h-full"
|
|
759
806
|
},
|
|
760
807
|
tableActionLabels: {
|
|
761
|
-
copyLabel:
|
|
762
|
-
copiedLabel:
|
|
763
|
-
downloadCsvLabel:
|
|
808
|
+
copyLabel: j,
|
|
809
|
+
copiedLabel: ee,
|
|
810
|
+
downloadCsvLabel: te
|
|
764
811
|
},
|
|
765
|
-
tableDownloadFilename:
|
|
812
|
+
tableDownloadFilename: P
|
|
766
813
|
});
|
|
767
|
-
case i.Json: return /* @__PURE__ */
|
|
814
|
+
case i.Json: return /* @__PURE__ */ U("div", {
|
|
768
815
|
dir: "ltr",
|
|
769
816
|
className: "h-full overflow-auto",
|
|
770
|
-
children: /* @__PURE__ */
|
|
771
|
-
className: _("m-3 overflow-auto rounded-md border",
|
|
772
|
-
children: /* @__PURE__ */
|
|
817
|
+
children: /* @__PURE__ */ U("div", {
|
|
818
|
+
className: _("m-3 overflow-auto rounded-md border", X.jsonWrapper),
|
|
819
|
+
children: /* @__PURE__ */ U(oe, {
|
|
773
820
|
data: e.value,
|
|
774
821
|
style: {
|
|
775
|
-
container: _("whitespace-pre-wrap break-words p-2",
|
|
776
|
-
basicChildStyle:
|
|
822
|
+
container: _("whitespace-pre-wrap break-words p-2", K?.jsonClassName ?? "dial-code-text"),
|
|
823
|
+
basicChildStyle: V.basicChildStyle,
|
|
777
824
|
childFieldsContainer: "m-0 ps-3",
|
|
778
|
-
label: _("me-1 font-semibold",
|
|
779
|
-
clickableLabel: _("me-1 cursor-pointer font-semibold hover:underline",
|
|
780
|
-
nullValue: _("italic",
|
|
781
|
-
undefinedValue: _("italic",
|
|
782
|
-
stringValue:
|
|
783
|
-
booleanValue:
|
|
784
|
-
numberValue:
|
|
785
|
-
otherValue: _("italic",
|
|
786
|
-
punctuation: _("me-1",
|
|
787
|
-
collapseIcon: _("me-1 cursor-pointer select-none transition-colors",
|
|
788
|
-
expandIcon: _("me-1 cursor-pointer select-none transition-colors",
|
|
789
|
-
collapsedContent: _("me-1 cursor-pointer rounded px-1",
|
|
825
|
+
label: _("me-1 font-semibold", X.jsonLabel),
|
|
826
|
+
clickableLabel: _("me-1 cursor-pointer font-semibold hover:underline", X.jsonClickableLabel),
|
|
827
|
+
nullValue: _("italic", X.jsonNullValue),
|
|
828
|
+
undefinedValue: _("italic", X.jsonNullValue),
|
|
829
|
+
stringValue: X.jsonStringValue,
|
|
830
|
+
booleanValue: X.jsonBooleanValue,
|
|
831
|
+
numberValue: X.jsonNumberValue,
|
|
832
|
+
otherValue: _("italic", X.jsonNullValue),
|
|
833
|
+
punctuation: _("me-1", X.jsonPunctuation),
|
|
834
|
+
collapseIcon: _("me-1 cursor-pointer select-none transition-colors", X.jsonCollapseIcon),
|
|
835
|
+
expandIcon: _("me-1 cursor-pointer select-none transition-colors", X.jsonExpandIcon),
|
|
836
|
+
collapsedContent: _("me-1 cursor-pointer rounded px-1", X.jsonCollapsedContent)
|
|
790
837
|
}
|
|
791
838
|
})
|
|
792
839
|
})
|
|
793
840
|
});
|
|
794
|
-
case i.Code: return /* @__PURE__ */
|
|
841
|
+
case i.Code: return /* @__PURE__ */ U(me, {
|
|
795
842
|
content: e,
|
|
796
|
-
codeBlockTheme:
|
|
843
|
+
codeBlockTheme: N,
|
|
797
844
|
labels: {
|
|
798
845
|
loadingLabel: E,
|
|
799
846
|
errorLabel: k,
|
|
800
847
|
retryLabel: A
|
|
801
848
|
}
|
|
802
849
|
});
|
|
803
|
-
case i.Html: return /* @__PURE__ */
|
|
850
|
+
case i.Html: return /* @__PURE__ */ U(_e, {
|
|
804
851
|
content: e,
|
|
805
852
|
labels: {
|
|
806
853
|
htmlFrameBlockedLabel: f,
|
|
@@ -808,25 +855,25 @@ var fe = { panel: "dial-attachment-canvas-panel" }, pe = {
|
|
|
808
855
|
},
|
|
809
856
|
isSourceView: a,
|
|
810
857
|
title: r,
|
|
811
|
-
codeBlockTheme:
|
|
858
|
+
codeBlockTheme: N
|
|
812
859
|
});
|
|
813
|
-
case i.Pdf: return /* @__PURE__ */
|
|
814
|
-
retryKey:
|
|
815
|
-
onRetry:
|
|
860
|
+
case i.Pdf: return /* @__PURE__ */ U(s, {
|
|
861
|
+
retryKey: le,
|
|
862
|
+
onRetry: fe,
|
|
816
863
|
labels: {
|
|
817
864
|
loadingLabel: x,
|
|
818
865
|
errorLabel: S,
|
|
819
866
|
retryLabel: w
|
|
820
867
|
},
|
|
821
|
-
children: /* @__PURE__ */
|
|
868
|
+
children: /* @__PURE__ */ U(de, {
|
|
822
869
|
fileName: r,
|
|
823
870
|
url: e.url,
|
|
824
871
|
highlights: e.highlights ?? [],
|
|
825
872
|
selectedHighlightId: e.selectedHighlightId,
|
|
826
873
|
selectedPageNumber: e.page,
|
|
827
|
-
loadPdf:
|
|
828
|
-
hideHeader:
|
|
829
|
-
configurePdfWorker:
|
|
874
|
+
loadPdf: F,
|
|
875
|
+
hideHeader: ae,
|
|
876
|
+
configurePdfWorker: L,
|
|
830
877
|
labels: {
|
|
831
878
|
thumbnailsLabel: g,
|
|
832
879
|
showThumbnailsLabel: v,
|
|
@@ -838,38 +885,39 @@ var fe = { panel: "dial-attachment-canvas-panel" }, pe = {
|
|
|
838
885
|
}
|
|
839
886
|
})
|
|
840
887
|
}, e.url);
|
|
841
|
-
case i.Ooxml: return /* @__PURE__ */
|
|
888
|
+
case i.Ooxml: return /* @__PURE__ */ U(Oe, {
|
|
842
889
|
content: e,
|
|
843
890
|
fileName: r,
|
|
844
891
|
loadErrorLabel: c,
|
|
845
892
|
formulaLabel: T,
|
|
846
|
-
formulaLabelClassName:
|
|
847
|
-
highlightsLabel:
|
|
848
|
-
highlightNavigatedLabel:
|
|
893
|
+
formulaLabelClassName: K?.xlsxFormulaLabelClassName ?? "dial-italic-text",
|
|
894
|
+
highlightsLabel: M,
|
|
895
|
+
highlightNavigatedLabel: re
|
|
849
896
|
});
|
|
850
897
|
case i.Visualizer:
|
|
851
|
-
case i.GroupedVisualizer: return /* @__PURE__ */
|
|
898
|
+
case i.GroupedVisualizer: return /* @__PURE__ */ U(Fe, {
|
|
852
899
|
content: e,
|
|
853
|
-
errorLabel: d
|
|
900
|
+
errorLabel: d,
|
|
901
|
+
onSendMessage: H
|
|
854
902
|
});
|
|
855
|
-
case i.McpApp: return /* @__PURE__ */
|
|
903
|
+
case i.McpApp: return /* @__PURE__ */ U(Ce, {
|
|
856
904
|
content: e,
|
|
857
|
-
onAppInfo:
|
|
905
|
+
onAppInfo: z
|
|
858
906
|
});
|
|
859
|
-
case i.Unsupported: return /* @__PURE__ */
|
|
860
|
-
className: _("text-center",
|
|
907
|
+
case i.Unsupported: return /* @__PURE__ */ U("p", {
|
|
908
|
+
className: _("text-center", X.statusLabel),
|
|
861
909
|
children: o
|
|
862
910
|
});
|
|
863
911
|
case i.Error: {
|
|
864
912
|
let t = e.errorType === n.Forbidden;
|
|
865
|
-
return /* @__PURE__ */
|
|
913
|
+
return /* @__PURE__ */ W("div", {
|
|
866
914
|
className: "flex flex-col items-center gap-2",
|
|
867
|
-
children: [
|
|
915
|
+
children: [U(t ? ne : O, {
|
|
868
916
|
size: 60,
|
|
869
917
|
stroke: C,
|
|
870
|
-
className:
|
|
871
|
-
}), /* @__PURE__ */
|
|
872
|
-
className: _("text-center",
|
|
918
|
+
className: X.errorIcon
|
|
919
|
+
}), /* @__PURE__ */ U("p", {
|
|
920
|
+
className: _("text-center", X.statusLabel),
|
|
873
921
|
children: t ? l : c
|
|
874
922
|
})]
|
|
875
923
|
});
|
|
@@ -877,23 +925,24 @@ var fe = { panel: "dial-attachment-canvas-panel" }, pe = {
|
|
|
877
925
|
}
|
|
878
926
|
}, [
|
|
879
927
|
e,
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
928
|
+
K?.fontClassName,
|
|
929
|
+
K?.jsonClassName,
|
|
930
|
+
K?.xlsxFormulaLabelClassName,
|
|
883
931
|
r,
|
|
884
|
-
|
|
932
|
+
N,
|
|
885
933
|
o,
|
|
886
934
|
c,
|
|
887
935
|
l,
|
|
888
936
|
d,
|
|
937
|
+
H,
|
|
889
938
|
f,
|
|
890
939
|
h,
|
|
891
940
|
a,
|
|
892
|
-
|
|
893
|
-
N,
|
|
894
|
-
se,
|
|
941
|
+
P,
|
|
895
942
|
F,
|
|
943
|
+
ae,
|
|
896
944
|
L,
|
|
945
|
+
z,
|
|
897
946
|
g,
|
|
898
947
|
v,
|
|
899
948
|
y,
|
|
@@ -905,216 +954,217 @@ var fe = { panel: "dial-attachment-canvas-panel" }, pe = {
|
|
|
905
954
|
E,
|
|
906
955
|
k,
|
|
907
956
|
A,
|
|
957
|
+
de,
|
|
958
|
+
le,
|
|
908
959
|
fe,
|
|
909
|
-
|
|
910
|
-
pe,
|
|
960
|
+
j,
|
|
911
961
|
ee,
|
|
912
962
|
te,
|
|
913
|
-
|
|
914
|
-
re
|
|
915
|
-
ae
|
|
963
|
+
M,
|
|
964
|
+
re
|
|
916
965
|
]);
|
|
917
|
-
return /* @__PURE__ */
|
|
918
|
-
style: !t &&
|
|
919
|
-
className: _(t ? "flex h-full items-center justify-center" :
|
|
920
|
-
children: t ? /* @__PURE__ */
|
|
966
|
+
return /* @__PURE__ */ U("div", {
|
|
967
|
+
style: !t && Re.has(e.type) ? pe : void 0,
|
|
968
|
+
className: _(t ? "flex h-full items-center justify-center" : he, se),
|
|
969
|
+
children: t ? /* @__PURE__ */ U(D, {}) : ge
|
|
921
970
|
});
|
|
922
|
-
}),
|
|
971
|
+
}), Be = {
|
|
923
972
|
mcpAppDivider: "_mcpAppDivider_1jh5p_1",
|
|
924
973
|
mcpAppVersion: "_mcpAppVersion_1jh5p_5"
|
|
925
|
-
},
|
|
926
|
-
let [je, Me] =
|
|
927
|
-
|
|
928
|
-
}, [
|
|
929
|
-
|
|
930
|
-
}, [
|
|
931
|
-
|
|
932
|
-
}, [
|
|
933
|
-
|
|
934
|
-
|
|
974
|
+
}, Ve = 2e3, He = 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: oe, pdfHideThumbnailsLabel: V, pdfPageNumberLabel: G, pdfContentLoadingLabel: K, pdfContentErrorLabel: se, pdfContentRetryLabel: ce, xlsxFormulaLabel: le, codeContentLoadingLabel: ue, codeContentErrorLabel: fe, codeContentRetryLabel: q, tableCopyLabel: pe, tableCopiedLabel: me, tableDownloadCsvLabel: he, ooxmlHighlightsLabel: ge, ooxmlHighlightNavigatedLabel: _e }, onDownload: ve, onCopyText: ye, onCopyMarkdown: be, onCopyJson: xe, tableDownloadFilename: Se, isMobile: J = !1, defaultWidth: Ce, minWidth: Y = 600, maxWidth: we = 1500, onResizeStop: Te, styles: Ee, codeBlockTheme: De, loadPdf: Oe, configurePdfWorker: ke, onVisualizerSendMessage: Ae }) => {
|
|
975
|
+
let [je, Me] = B(!1), [Ne, Pe] = B(!1), [Fe, X] = B(!1), [Ie, Le] = B(!1), [Re, He] = B(void 0), Ue = z(null), Z = z(null), We = z(null), Ge = I(() => {
|
|
976
|
+
ye?.(), Ue.current != null && clearTimeout(Ue.current), Me(!0), Ue.current = setTimeout(() => Me(!1), Ve);
|
|
977
|
+
}, [ye]), Ke = I(() => {
|
|
978
|
+
be?.(), Z.current != null && clearTimeout(Z.current), Pe(!0), Z.current = setTimeout(() => Pe(!1), Ve);
|
|
979
|
+
}, [be]), qe = I(() => {
|
|
980
|
+
xe?.(), We.current != null && clearTimeout(We.current), X(!0), We.current = setTimeout(() => X(!1), Ve);
|
|
981
|
+
}, [xe]);
|
|
982
|
+
L(() => () => {
|
|
983
|
+
Ue.current != null && clearTimeout(Ue.current), Z.current != null && clearTimeout(Z.current), We.current != null && clearTimeout(We.current);
|
|
935
984
|
}, []);
|
|
936
|
-
let
|
|
937
|
-
|
|
985
|
+
let Je = I(() => {
|
|
986
|
+
Le((e) => !e);
|
|
938
987
|
}, []);
|
|
939
|
-
|
|
940
|
-
|
|
988
|
+
L(() => {
|
|
989
|
+
Le(!1), He(void 0);
|
|
941
990
|
}, [r]);
|
|
942
|
-
let { className:
|
|
943
|
-
"--ac-mcp-app-divider":
|
|
944
|
-
"--ac-mcp-app-version":
|
|
945
|
-
}), [
|
|
946
|
-
style:
|
|
991
|
+
let { className: Ye, panelStyles: Xe, ...Ze } = Ee ?? {}, { colors: Q, typography: Qe } = Ze, $e = R(() => m({
|
|
992
|
+
"--ac-mcp-app-divider": Q?.mcpAppDividerColor,
|
|
993
|
+
"--ac-mcp-app-version": Q?.mcpAppVersionColor
|
|
994
|
+
}), [Q?.mcpAppDividerColor, Q?.mcpAppVersionColor]), $ = r.type === i.McpApp && Re != null ? /* @__PURE__ */ W("span", {
|
|
995
|
+
style: $e,
|
|
947
996
|
children: [
|
|
948
|
-
/* @__PURE__ */
|
|
949
|
-
/* @__PURE__ */
|
|
997
|
+
/* @__PURE__ */ U("span", { children: a }),
|
|
998
|
+
/* @__PURE__ */ U("span", {
|
|
950
999
|
"aria-hidden": !0,
|
|
951
|
-
className: _("mx-1.5 inline-block h-3 w-0 border-s align-middle",
|
|
1000
|
+
className: _("mx-1.5 inline-block h-3 w-0 border-s align-middle", Be.mcpAppDivider)
|
|
952
1001
|
}),
|
|
953
|
-
/* @__PURE__ */
|
|
954
|
-
|
|
955
|
-
className: _("ms-2",
|
|
956
|
-
children:
|
|
1002
|
+
/* @__PURE__ */ U("span", { children: Re.name }),
|
|
1003
|
+
Re.version && /* @__PURE__ */ U("span", {
|
|
1004
|
+
className: _("ms-2", Qe?.mcpAppVersionClassName ?? "dial-caption-text", Be.mcpAppVersion),
|
|
1005
|
+
children: Re.version
|
|
957
1006
|
})
|
|
958
1007
|
]
|
|
959
|
-
}) : a,
|
|
960
|
-
return /* @__PURE__ */
|
|
1008
|
+
}) : a, et = !t && r.type === i.Html && (r.srcdoc != null || r.resolveSourceText != null), tt = !t && ye != null && (r.type === i.PlainText || r.type === i.Code), nt = !t && be != null && r.type === i.Markdown, rt = !t && xe != null && r.type === i.Json, it = !t && ve != null && o(r), at = !t && r.type === i.McpApp && r.onReload != null;
|
|
1009
|
+
return /* @__PURE__ */ U(x, {
|
|
961
1010
|
isOpen: e,
|
|
962
1011
|
orientation: b.Right,
|
|
963
|
-
title:
|
|
1012
|
+
title: $,
|
|
964
1013
|
labels: {
|
|
965
1014
|
ariaLabel: c,
|
|
966
1015
|
closeLabel: l,
|
|
967
1016
|
resizeLabel: u
|
|
968
1017
|
},
|
|
969
1018
|
onClose: n,
|
|
970
|
-
resizable: !
|
|
971
|
-
defaultWidth:
|
|
972
|
-
minWidth:
|
|
973
|
-
maxWidth:
|
|
974
|
-
onResizeStop:
|
|
1019
|
+
resizable: !J,
|
|
1020
|
+
defaultWidth: Ce,
|
|
1021
|
+
minWidth: Y,
|
|
1022
|
+
maxWidth: we,
|
|
1023
|
+
onResizeStop: Te,
|
|
975
1024
|
styles: {
|
|
976
|
-
...
|
|
977
|
-
titleClassName:
|
|
978
|
-
headerClassName: _("border-b border-tertiary",
|
|
979
|
-
className: _(e ? "mobile:w-full mobile:max-w-full" : "w-0",
|
|
1025
|
+
...Xe,
|
|
1026
|
+
titleClassName: Xe?.titleClassName ?? "dial-h3-text",
|
|
1027
|
+
headerClassName: _("border-b border-tertiary", Xe?.headerClassName),
|
|
1028
|
+
className: _(e ? "mobile:w-full mobile:max-w-full" : "w-0", Ye, Xe?.className, de.panel)
|
|
980
1029
|
},
|
|
981
1030
|
leftActions: s,
|
|
982
|
-
rightActions:
|
|
983
|
-
|
|
984
|
-
icon: /* @__PURE__ */
|
|
1031
|
+
rightActions: et || tt || nt || rt || it || at ? /* @__PURE__ */ W(H, { children: [
|
|
1032
|
+
at && /* @__PURE__ */ U(T, {
|
|
1033
|
+
icon: /* @__PURE__ */ U(ie, {
|
|
985
1034
|
size: S.LG,
|
|
986
1035
|
stroke: C,
|
|
987
1036
|
"aria-hidden": !0
|
|
988
1037
|
}),
|
|
989
|
-
"aria-label":
|
|
990
|
-
tooltipProps: { tooltip:
|
|
1038
|
+
"aria-label": F,
|
|
1039
|
+
tooltipProps: { tooltip: F },
|
|
991
1040
|
onClick: r.type === i.McpApp ? r.onReload : void 0
|
|
992
1041
|
}),
|
|
993
|
-
|
|
994
|
-
icon:
|
|
1042
|
+
et && /* @__PURE__ */ U(T, {
|
|
1043
|
+
icon: U(Ie ? M : j, {
|
|
995
1044
|
size: S.LG,
|
|
996
1045
|
stroke: C,
|
|
997
1046
|
"aria-hidden": !0
|
|
998
1047
|
}),
|
|
999
|
-
"aria-label":
|
|
1000
|
-
"aria-pressed":
|
|
1001
|
-
tooltipProps: { tooltip:
|
|
1002
|
-
onClick:
|
|
1048
|
+
"aria-label": Ie ? P : N,
|
|
1049
|
+
"aria-pressed": Ie,
|
|
1050
|
+
tooltipProps: { tooltip: Ie ? P : N },
|
|
1051
|
+
onClick: Je
|
|
1003
1052
|
}),
|
|
1004
|
-
|
|
1005
|
-
icon:
|
|
1053
|
+
tt && /* @__PURE__ */ U(T, {
|
|
1054
|
+
icon: U(je ? A : ee, {
|
|
1006
1055
|
size: S.LG,
|
|
1007
1056
|
stroke: C,
|
|
1008
1057
|
"aria-hidden": !0
|
|
1009
1058
|
}),
|
|
1010
1059
|
"aria-label": je ? p : f,
|
|
1011
1060
|
tooltipProps: { tooltip: je ? p : f },
|
|
1012
|
-
onClick:
|
|
1061
|
+
onClick: Ge
|
|
1013
1062
|
}),
|
|
1014
|
-
|
|
1015
|
-
icon:
|
|
1063
|
+
nt && /* @__PURE__ */ U(T, {
|
|
1064
|
+
icon: U(Ne ? A : re, {
|
|
1016
1065
|
size: S.LG,
|
|
1017
1066
|
stroke: C,
|
|
1018
1067
|
"aria-hidden": !0
|
|
1019
1068
|
}),
|
|
1020
1069
|
"aria-label": Ne ? g : h,
|
|
1021
1070
|
tooltipProps: { tooltip: Ne ? g : h },
|
|
1022
|
-
onClick:
|
|
1071
|
+
onClick: Ke
|
|
1023
1072
|
}),
|
|
1024
|
-
|
|
1025
|
-
icon:
|
|
1073
|
+
rt && /* @__PURE__ */ U(T, {
|
|
1074
|
+
icon: U(Fe ? A : ee, {
|
|
1026
1075
|
size: S.LG,
|
|
1027
1076
|
stroke: C,
|
|
1028
1077
|
"aria-hidden": !0
|
|
1029
1078
|
}),
|
|
1030
|
-
"aria-label":
|
|
1031
|
-
tooltipProps: { tooltip:
|
|
1032
|
-
onClick:
|
|
1079
|
+
"aria-label": Fe ? y : v,
|
|
1080
|
+
tooltipProps: { tooltip: Fe ? y : v },
|
|
1081
|
+
onClick: qe
|
|
1033
1082
|
}),
|
|
1034
|
-
|
|
1035
|
-
icon: /* @__PURE__ */
|
|
1083
|
+
it && /* @__PURE__ */ U(T, {
|
|
1084
|
+
icon: /* @__PURE__ */ U(te, {
|
|
1036
1085
|
size: S.LG,
|
|
1037
1086
|
stroke: C
|
|
1038
1087
|
}),
|
|
1039
1088
|
"aria-label": d,
|
|
1040
1089
|
tooltipProps: { tooltip: d },
|
|
1041
|
-
onClick:
|
|
1090
|
+
onClick: ve
|
|
1042
1091
|
})
|
|
1043
1092
|
] }) : null,
|
|
1044
|
-
children: /* @__PURE__ */
|
|
1093
|
+
children: /* @__PURE__ */ U(ze, {
|
|
1045
1094
|
content: r,
|
|
1046
1095
|
isLoading: t,
|
|
1047
1096
|
fileName: a,
|
|
1048
|
-
isHtmlSourceView:
|
|
1049
|
-
onAppInfo: r.type === i.McpApp ?
|
|
1097
|
+
isHtmlSourceView: Ie,
|
|
1098
|
+
onAppInfo: r.type === i.McpApp ? He : void 0,
|
|
1050
1099
|
labels: {
|
|
1051
1100
|
unsupportedLabel: E,
|
|
1052
1101
|
loadErrorLabel: D,
|
|
1053
1102
|
forbiddenErrorLabel: O,
|
|
1054
1103
|
visualizerErrorLabel: w,
|
|
1055
1104
|
htmlFrameBlockedLabel: k,
|
|
1056
|
-
htmlOpenInNewTabLabel:
|
|
1057
|
-
pdfThumbnailsLabel:
|
|
1058
|
-
pdfShowThumbnailsLabel:
|
|
1059
|
-
pdfHideThumbnailsLabel:
|
|
1060
|
-
pdfPageNumberLabel:
|
|
1061
|
-
pdfContentLoadingLabel:
|
|
1062
|
-
pdfContentErrorLabel:
|
|
1063
|
-
pdfContentRetryLabel:
|
|
1064
|
-
xlsxFormulaLabel:
|
|
1065
|
-
codeContentLoadingLabel:
|
|
1066
|
-
codeContentErrorLabel:
|
|
1067
|
-
codeContentRetryLabel:
|
|
1068
|
-
tableCopyLabel:
|
|
1069
|
-
tableCopiedLabel:
|
|
1070
|
-
tableDownloadCsvLabel:
|
|
1071
|
-
ooxmlHighlightsLabel:
|
|
1072
|
-
ooxmlHighlightNavigatedLabel:
|
|
1105
|
+
htmlOpenInNewTabLabel: ne,
|
|
1106
|
+
pdfThumbnailsLabel: ae,
|
|
1107
|
+
pdfShowThumbnailsLabel: oe,
|
|
1108
|
+
pdfHideThumbnailsLabel: V,
|
|
1109
|
+
pdfPageNumberLabel: G,
|
|
1110
|
+
pdfContentLoadingLabel: K,
|
|
1111
|
+
pdfContentErrorLabel: se,
|
|
1112
|
+
pdfContentRetryLabel: ce,
|
|
1113
|
+
xlsxFormulaLabel: le,
|
|
1114
|
+
codeContentLoadingLabel: ue,
|
|
1115
|
+
codeContentErrorLabel: fe,
|
|
1116
|
+
codeContentRetryLabel: q,
|
|
1117
|
+
tableCopyLabel: pe,
|
|
1118
|
+
tableCopiedLabel: me,
|
|
1119
|
+
tableDownloadCsvLabel: he,
|
|
1120
|
+
ooxmlHighlightsLabel: ge,
|
|
1121
|
+
ooxmlHighlightNavigatedLabel: _e
|
|
1073
1122
|
},
|
|
1074
|
-
styles:
|
|
1075
|
-
codeBlockTheme:
|
|
1076
|
-
tableDownloadFilename:
|
|
1077
|
-
loadPdf:
|
|
1078
|
-
configurePdfWorker:
|
|
1123
|
+
styles: Ze,
|
|
1124
|
+
codeBlockTheme: De,
|
|
1125
|
+
tableDownloadFilename: Se,
|
|
1126
|
+
loadPdf: Oe,
|
|
1127
|
+
configurePdfWorker: ke,
|
|
1128
|
+
onVisualizerSendMessage: Ae
|
|
1079
1129
|
})
|
|
1080
1130
|
});
|
|
1081
|
-
}),
|
|
1131
|
+
}), Ue = new Set(["html", "htm"]), Z = {
|
|
1082
1132
|
docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
1083
1133
|
xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
1084
1134
|
pptx: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
1085
|
-
},
|
|
1135
|
+
}, We = new Set(/* @__PURE__ */ "txt.md.markdown.json.jsonl.ndjson.xml.csv.tsv.yaml.yml.toml.ini.conf.cfg.css.scss.sass.less.js.jsx.ts.tsx.mjs.cjs.mts.cts.py.rb.go.rs.java.kt.swift.c.h.cpp.cs.sh.bash.zsh.fish.ps1.log.env.gitignore.dockerfile.makefile.sql".split(".")), Ge = {
|
|
1086
1136
|
docx: r.Docx,
|
|
1087
1137
|
xlsx: r.Xlsx,
|
|
1088
1138
|
pptx: r.Pptx,
|
|
1089
1139
|
csv: r.Csv
|
|
1090
|
-
},
|
|
1091
|
-
[
|
|
1092
|
-
[
|
|
1093
|
-
[
|
|
1140
|
+
}, Ke = {
|
|
1141
|
+
[Z.docx]: r.Docx,
|
|
1142
|
+
[Z.xlsx]: r.Xlsx,
|
|
1143
|
+
[Z.pptx]: r.Pptx,
|
|
1094
1144
|
[f.CSV]: r.Csv
|
|
1095
|
-
},
|
|
1096
|
-
[r.Docx]:
|
|
1097
|
-
[r.Xlsx]:
|
|
1098
|
-
[r.Pptx]:
|
|
1145
|
+
}, qe = {
|
|
1146
|
+
[r.Docx]: Z.docx,
|
|
1147
|
+
[r.Xlsx]: Z.xlsx,
|
|
1148
|
+
[r.Pptx]: Z.pptx,
|
|
1099
1149
|
[r.Csv]: f.CSV
|
|
1100
|
-
},
|
|
1150
|
+
}, Je = (e, t) => {
|
|
1101
1151
|
let n = t?.split(";", 1)[0].trim().toLowerCase();
|
|
1102
1152
|
if (n != null) {
|
|
1103
|
-
let e =
|
|
1153
|
+
let e = Ke[n];
|
|
1104
1154
|
if (e != null) return e;
|
|
1105
1155
|
}
|
|
1106
1156
|
let r = e.lastIndexOf(".");
|
|
1107
|
-
if (r !== -1) return
|
|
1108
|
-
},
|
|
1109
|
-
let n =
|
|
1110
|
-
return n == null ? void 0 :
|
|
1111
|
-
},
|
|
1157
|
+
if (r !== -1) return Ge[e.slice(r + 1).toLowerCase()];
|
|
1158
|
+
}, Ye = (e, t) => Je(e, t) != null, Xe = (e, t) => {
|
|
1159
|
+
let n = Je(e, t);
|
|
1160
|
+
return n == null ? void 0 : qe[n];
|
|
1161
|
+
}, Ze = (e) => {
|
|
1112
1162
|
let t = e.lastIndexOf(".");
|
|
1113
|
-
return t === -1 ? !1 :
|
|
1114
|
-
},
|
|
1163
|
+
return t === -1 ? !1 : We.has(e.slice(t + 1).toLowerCase());
|
|
1164
|
+
}, Q = (e) => {
|
|
1115
1165
|
let t = e.lastIndexOf(".");
|
|
1116
|
-
return t === -1 ? !1 :
|
|
1117
|
-
},
|
|
1166
|
+
return t === -1 ? !1 : Ue.has(e.slice(t + 1).toLowerCase());
|
|
1167
|
+
}, Qe = {
|
|
1118
1168
|
xml: "xml",
|
|
1119
1169
|
csv: "plaintext",
|
|
1120
1170
|
tsv: "plaintext",
|
|
@@ -1162,40 +1212,40 @@ var fe = { panel: "dial-attachment-canvas-panel" }, pe = {
|
|
|
1162
1212
|
gitignore: "plaintext",
|
|
1163
1213
|
dockerfile: "plaintext",
|
|
1164
1214
|
makefile: "plaintext"
|
|
1165
|
-
},
|
|
1215
|
+
}, $e = (e) => Qe[e], $ = (e) => ({
|
|
1166
1216
|
type: i.Unsupported,
|
|
1167
1217
|
...e != null && { url: e }
|
|
1168
|
-
}),
|
|
1218
|
+
}), et = (e) => ({
|
|
1169
1219
|
type: i.Error,
|
|
1170
1220
|
errorType: n.LoadFailed,
|
|
1171
1221
|
...e != null && { url: e }
|
|
1172
|
-
}),
|
|
1222
|
+
}), tt = (e) => ({
|
|
1173
1223
|
type: i.Error,
|
|
1174
1224
|
errorType: n.Forbidden,
|
|
1175
1225
|
...e != null && { url: e }
|
|
1176
|
-
}),
|
|
1226
|
+
}), nt = (e) => {
|
|
1177
1227
|
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
|
-
},
|
|
1179
|
-
let t =
|
|
1228
|
+
}, rt = (e) => {
|
|
1229
|
+
let t = nt(e);
|
|
1180
1230
|
t != null && URL.revokeObjectURL(t);
|
|
1181
|
-
},
|
|
1231
|
+
}, it = {
|
|
1182
1232
|
type: i.PlainText,
|
|
1183
1233
|
text: ""
|
|
1184
|
-
},
|
|
1185
|
-
|
|
1186
|
-
var
|
|
1187
|
-
let [t, n] =
|
|
1234
|
+
}, at = N(void 0);
|
|
1235
|
+
at.displayName = "AttachmentCanvasContext";
|
|
1236
|
+
var ot = ({ children: e }) => {
|
|
1237
|
+
let [t, n] = B(!1), [r, i] = B(!1), [a, o] = B(it), [s, c] = B(void 0), [l, u] = B(void 0), d = I((e, t) => {
|
|
1188
1238
|
c(e), u(t), i(!0), n(!0);
|
|
1189
|
-
}, []), f =
|
|
1239
|
+
}, []), f = I((e, t, r) => {
|
|
1190
1240
|
o(e), c(t), u(r), i(!1), n(!0);
|
|
1191
|
-
}, []), p =
|
|
1192
|
-
o(
|
|
1241
|
+
}, []), p = I(() => {
|
|
1242
|
+
o(it), n(!1), i(!1), u(void 0);
|
|
1193
1243
|
}, []);
|
|
1194
|
-
return
|
|
1195
|
-
let e =
|
|
1244
|
+
return L(() => () => {
|
|
1245
|
+
let e = nt(a);
|
|
1196
1246
|
e != null && URL.revokeObjectURL(e);
|
|
1197
|
-
}, [a]), /* @__PURE__ */
|
|
1198
|
-
value:
|
|
1247
|
+
}, [a]), /* @__PURE__ */ U(at.Provider, {
|
|
1248
|
+
value: R(() => ({
|
|
1199
1249
|
isOpen: t,
|
|
1200
1250
|
isLoading: r,
|
|
1201
1251
|
content: a,
|
|
@@ -1216,97 +1266,98 @@ var $e = ({ children: e }) => {
|
|
|
1216
1266
|
]),
|
|
1217
1267
|
children: e
|
|
1218
1268
|
});
|
|
1219
|
-
},
|
|
1220
|
-
let e =
|
|
1269
|
+
}, st = () => {
|
|
1270
|
+
let e = ae(at);
|
|
1221
1271
|
if (!e) throw Error("useAttachmentCanvas must be used within an AttachmentCanvasProvider");
|
|
1222
1272
|
return e;
|
|
1223
|
-
},
|
|
1224
|
-
let { ariaLabel:
|
|
1225
|
-
a(
|
|
1226
|
-
}, [
|
|
1227
|
-
(
|
|
1228
|
-
}, [
|
|
1229
|
-
|
|
1230
|
-
}, [
|
|
1231
|
-
|
|
1232
|
-
}, [
|
|
1233
|
-
return /* @__PURE__ */
|
|
1234
|
-
isOpen:
|
|
1235
|
-
isLoading:
|
|
1236
|
-
onClose:
|
|
1237
|
-
content:
|
|
1238
|
-
fileName:
|
|
1273
|
+
}, ct = F(({ labels: e, leftActions: t, isMobile: n = !1, defaultWidth: r, maxWidth: o, codeBlockTheme: s, tableDownloadFilename: c, loadPdf: l, configurePdfWorker: u, onVisualizerSendMessage: d }) => {
|
|
1274
|
+
let { ariaLabel: f = "Attachment preview", closeLabel: p = "Close", downloadLabel: m = "Download", unsupportedLabel: g = "Preview is not supported for this file", loadErrorLabel: _ = "Failed to load file", forbiddenErrorLabel: v = "You don't have permission to access this file", copyTextLabel: y, copiedTextLabel: b, copyMarkdownLabel: x, copiedMarkdownLabel: S, copyJsonLabel: C, copiedJsonLabel: w, htmlFrameBlockedLabel: T, htmlOpenInNewTabLabel: E, htmlViewSourceLabel: D, htmlViewRenderedLabel: O, pdfThumbnailsLabel: k, pdfShowThumbnailsLabel: A, pdfHideThumbnailsLabel: j, pdfPageNumberLabel: ee, pdfContentLoadingLabel: te, pdfContentErrorLabel: M, pdfContentRetryLabel: ne, xlsxFormulaLabel: re, codeContentLoadingLabel: ie, codeContentErrorLabel: N, codeContentRetryLabel: P, tableCopyLabel: F, tableCopiedLabel: ae, tableDownloadCsvLabel: L, ooxmlHighlightsLabel: R, ooxmlHighlightNavigatedLabel: z } = e ?? {}, { isOpen: B, isLoading: oe, content: V, fileName: H, closeCanvas: W } = st(), G = I(() => {
|
|
1275
|
+
a(V, H);
|
|
1276
|
+
}, [V, H]), K = I(() => {
|
|
1277
|
+
(V.type === i.PlainText || V.type === i.Code) && h(V.text);
|
|
1278
|
+
}, [V]), se = I(() => {
|
|
1279
|
+
V.type === i.Markdown && h(V.text);
|
|
1280
|
+
}, [V]), ce = I(() => {
|
|
1281
|
+
V.type === i.Json && h(JSON.stringify(V.value, null, 2));
|
|
1282
|
+
}, [V]);
|
|
1283
|
+
return /* @__PURE__ */ U(He, {
|
|
1284
|
+
isOpen: B,
|
|
1285
|
+
isLoading: oe,
|
|
1286
|
+
onClose: W,
|
|
1287
|
+
content: V,
|
|
1288
|
+
fileName: H,
|
|
1239
1289
|
leftActions: t,
|
|
1240
1290
|
labels: {
|
|
1241
|
-
ariaLabel:
|
|
1242
|
-
closeLabel:
|
|
1243
|
-
downloadLabel:
|
|
1244
|
-
copyTextLabel:
|
|
1245
|
-
copiedTextLabel:
|
|
1246
|
-
copyMarkdownLabel:
|
|
1247
|
-
copiedMarkdownLabel:
|
|
1248
|
-
copyJsonLabel:
|
|
1249
|
-
copiedJsonLabel:
|
|
1250
|
-
unsupportedLabel:
|
|
1251
|
-
loadErrorLabel:
|
|
1252
|
-
forbiddenErrorLabel:
|
|
1253
|
-
htmlFrameBlockedLabel:
|
|
1254
|
-
htmlOpenInNewTabLabel:
|
|
1255
|
-
htmlViewSourceLabel:
|
|
1256
|
-
htmlViewRenderedLabel:
|
|
1257
|
-
pdfThumbnailsLabel:
|
|
1258
|
-
pdfShowThumbnailsLabel:
|
|
1259
|
-
pdfHideThumbnailsLabel:
|
|
1291
|
+
ariaLabel: f,
|
|
1292
|
+
closeLabel: p,
|
|
1293
|
+
downloadLabel: m,
|
|
1294
|
+
copyTextLabel: y,
|
|
1295
|
+
copiedTextLabel: b,
|
|
1296
|
+
copyMarkdownLabel: x,
|
|
1297
|
+
copiedMarkdownLabel: S,
|
|
1298
|
+
copyJsonLabel: C,
|
|
1299
|
+
copiedJsonLabel: w,
|
|
1300
|
+
unsupportedLabel: g,
|
|
1301
|
+
loadErrorLabel: _,
|
|
1302
|
+
forbiddenErrorLabel: v,
|
|
1303
|
+
htmlFrameBlockedLabel: T,
|
|
1304
|
+
htmlOpenInNewTabLabel: E,
|
|
1305
|
+
htmlViewSourceLabel: D,
|
|
1306
|
+
htmlViewRenderedLabel: O,
|
|
1307
|
+
pdfThumbnailsLabel: k,
|
|
1308
|
+
pdfShowThumbnailsLabel: A,
|
|
1309
|
+
pdfHideThumbnailsLabel: j,
|
|
1260
1310
|
pdfPageNumberLabel: ee,
|
|
1261
1311
|
pdfContentLoadingLabel: te,
|
|
1262
|
-
pdfContentErrorLabel:
|
|
1263
|
-
pdfContentRetryLabel:
|
|
1264
|
-
xlsxFormulaLabel:
|
|
1265
|
-
codeContentLoadingLabel:
|
|
1266
|
-
codeContentErrorLabel:
|
|
1267
|
-
codeContentRetryLabel:
|
|
1268
|
-
tableCopyLabel:
|
|
1269
|
-
tableCopiedLabel:
|
|
1270
|
-
tableDownloadCsvLabel:
|
|
1271
|
-
ooxmlHighlightsLabel:
|
|
1272
|
-
ooxmlHighlightNavigatedLabel:
|
|
1312
|
+
pdfContentErrorLabel: M,
|
|
1313
|
+
pdfContentRetryLabel: ne,
|
|
1314
|
+
xlsxFormulaLabel: re,
|
|
1315
|
+
codeContentLoadingLabel: ie,
|
|
1316
|
+
codeContentErrorLabel: N,
|
|
1317
|
+
codeContentRetryLabel: P,
|
|
1318
|
+
tableCopyLabel: F,
|
|
1319
|
+
tableCopiedLabel: ae,
|
|
1320
|
+
tableDownloadCsvLabel: L,
|
|
1321
|
+
ooxmlHighlightsLabel: R,
|
|
1322
|
+
ooxmlHighlightNavigatedLabel: z
|
|
1273
1323
|
},
|
|
1274
|
-
onDownload:
|
|
1275
|
-
onCopyText:
|
|
1276
|
-
onCopyMarkdown:
|
|
1277
|
-
onCopyJson:
|
|
1324
|
+
onDownload: G,
|
|
1325
|
+
onCopyText: V.type === i.PlainText || V.type === i.Code ? K : void 0,
|
|
1326
|
+
onCopyMarkdown: V.type === i.Markdown ? se : void 0,
|
|
1327
|
+
onCopyJson: V.type === i.Json ? ce : void 0,
|
|
1278
1328
|
tableDownloadFilename: c,
|
|
1279
1329
|
isMobile: n,
|
|
1280
1330
|
defaultWidth: r,
|
|
1281
1331
|
maxWidth: o,
|
|
1282
1332
|
codeBlockTheme: s,
|
|
1283
1333
|
configurePdfWorker: u,
|
|
1284
|
-
loadPdf: l
|
|
1334
|
+
loadPdf: l,
|
|
1335
|
+
onVisualizerSendMessage: d
|
|
1285
1336
|
});
|
|
1286
|
-
}),
|
|
1337
|
+
}), lt = {
|
|
1287
1338
|
frame: "_frame_g47g7_1",
|
|
1288
1339
|
header: "_header_g47g7_6",
|
|
1289
1340
|
title: "_title_g47g7_10"
|
|
1290
|
-
},
|
|
1291
|
-
let
|
|
1292
|
-
return /* @__PURE__ */
|
|
1293
|
-
className: _("flex w-full min-w-0 flex-col overflow-hidden", !l && ["rounded-xl border",
|
|
1341
|
+
}, ut = 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, onVisualizerSendMessage: f }) => {
|
|
1342
|
+
let p = e.visualizerName.trim(), h = !u && p !== "";
|
|
1343
|
+
return /* @__PURE__ */ W("div", {
|
|
1344
|
+
className: _("flex w-full min-w-0 flex-col overflow-hidden", !l && ["rounded-xl border", lt.frame]),
|
|
1294
1345
|
style: m({
|
|
1295
1346
|
"--igv-bg": d?.background,
|
|
1296
1347
|
"--igv-border": d?.border,
|
|
1297
1348
|
"--igv-title-text": d?.titleText
|
|
1298
1349
|
}),
|
|
1299
|
-
children: [/* @__PURE__ */
|
|
1300
|
-
className: _("flex min-h-10 items-center gap-2 py-2",
|
|
1301
|
-
children: [
|
|
1302
|
-
className: _("min-w-0 truncate", c,
|
|
1303
|
-
children:
|
|
1304
|
-
}), /* @__PURE__ */
|
|
1350
|
+
children: [/* @__PURE__ */ W("div", {
|
|
1351
|
+
className: _("flex min-h-10 items-center gap-2 py-2", h ? "justify-between" : "justify-end", !l && ["border-b px-4", lt.header]),
|
|
1352
|
+
children: [h && /* @__PURE__ */ U("span", {
|
|
1353
|
+
className: _("min-w-0 truncate", c, lt.title),
|
|
1354
|
+
children: p
|
|
1355
|
+
}), /* @__PURE__ */ U("div", {
|
|
1305
1356
|
role: "toolbar",
|
|
1306
1357
|
"aria-label": i,
|
|
1307
1358
|
className: "flex items-center gap-1",
|
|
1308
|
-
children: /* @__PURE__ */
|
|
1309
|
-
icon: /* @__PURE__ */
|
|
1359
|
+
children: /* @__PURE__ */ U(T, {
|
|
1360
|
+
icon: /* @__PURE__ */ U(k, {
|
|
1310
1361
|
size: S.SM,
|
|
1311
1362
|
stroke: C,
|
|
1312
1363
|
"aria-hidden": !0
|
|
@@ -1316,35 +1367,19 @@ var $e = ({ children: e }) => {
|
|
|
1316
1367
|
onClick: n
|
|
1317
1368
|
})
|
|
1318
1369
|
})]
|
|
1319
|
-
}), /* @__PURE__ */
|
|
1370
|
+
}), /* @__PURE__ */ U("div", {
|
|
1320
1371
|
className: "w-full",
|
|
1321
1372
|
style: { height: `${t}px` },
|
|
1322
|
-
children: /* @__PURE__ */
|
|
1373
|
+
children: /* @__PURE__ */ U(Fe, {
|
|
1323
1374
|
content: e,
|
|
1324
1375
|
loadingLabel: o,
|
|
1325
1376
|
errorLabel: s,
|
|
1326
|
-
frameTitle: a
|
|
1377
|
+
frameTitle: a,
|
|
1378
|
+
onSendMessage: f
|
|
1327
1379
|
})
|
|
1328
1380
|
})]
|
|
1329
1381
|
});
|
|
1330
|
-
}),
|
|
1331
|
-
let n = e.toLowerCase();
|
|
1332
|
-
return t.find((e) => e.contentType.split(",").some((e) => e.trim().toLowerCase() === n && e.trim() !== ""));
|
|
1333
|
-
}, at = (e, t) => {
|
|
1334
|
-
if (!(e == null || e === "")) return Object.prototype.hasOwnProperty.call(t, e) ? t[e] : void 0;
|
|
1335
|
-
}, ot = (e) => `${e}:grouped-visualizer`, st = (e, t) => {
|
|
1336
|
-
let n = (t.contentType ?? "").split(",").map((e) => e.trim().toLowerCase()).filter((e) => e !== ""), r = [], i = [];
|
|
1337
|
-
return e.forEach((e) => {
|
|
1338
|
-
if (e.url != null && e.url !== "" && (n.length === 0 || n.includes(e.contentType.toLowerCase()))) {
|
|
1339
|
-
r.push(e);
|
|
1340
|
-
return;
|
|
1341
|
-
}
|
|
1342
|
-
i.push(e);
|
|
1343
|
-
}), {
|
|
1344
|
-
claimed: r,
|
|
1345
|
-
unclaimed: i
|
|
1346
|
-
};
|
|
1347
|
-
}, ct = (e) => {
|
|
1382
|
+
}), dt = (e) => {
|
|
1348
1383
|
let t;
|
|
1349
1384
|
try {
|
|
1350
1385
|
t = new URL(e).pathname;
|
|
@@ -1357,13 +1392,13 @@ var $e = ({ children: e }) => {
|
|
|
1357
1392
|
} catch {
|
|
1358
1393
|
return n;
|
|
1359
1394
|
}
|
|
1360
|
-
},
|
|
1361
|
-
let { openCanvas: n, openCanvasLoading: r, closeCanvas: a } =
|
|
1395
|
+
}, ft = (e, t) => {
|
|
1396
|
+
let { openCanvas: n, openCanvasLoading: r, closeCanvas: a } = st(), { customVisualizers: o, themeId: s, onBeforeOpen: l } = t, u = I(async (t, n, r) => {
|
|
1362
1397
|
if (t.url == null && t.referenceUrl != null) {
|
|
1363
1398
|
let i = e.resolveReferencePdfContent(t);
|
|
1364
1399
|
if (i != null) return r(i, t.name, n);
|
|
1365
1400
|
}
|
|
1366
|
-
let a = t.contentType.toLowerCase(), c =
|
|
1401
|
+
let a = t.contentType.toLowerCase(), c = ke(a, o);
|
|
1367
1402
|
if (c != null) {
|
|
1368
1403
|
let i = await e.resolveVisualizerContent(t, c, s);
|
|
1369
1404
|
if (i != null) return r(i, t.name, n);
|
|
@@ -1372,15 +1407,15 @@ var $e = ({ children: e }) => {
|
|
|
1372
1407
|
let i = await e.resolveTextContent(t);
|
|
1373
1408
|
if (i != null) return r(i, t.name, n);
|
|
1374
1409
|
}
|
|
1375
|
-
let l =
|
|
1376
|
-
if (l != null) return r(await e.resolveOoxmlContent(t, l) ??
|
|
1410
|
+
let l = Je("", a);
|
|
1411
|
+
if (l != null) return r(await e.resolveOoxmlContent(t, l) ?? $(e.resolveContentUrl(t)), t.name, n);
|
|
1377
1412
|
switch (a) {
|
|
1378
|
-
case f.PDF: return r(await e.resolvePdfContent(t) ??
|
|
1379
|
-
case f.Markdown: return r(await e.resolveMarkdownContent(t) ??
|
|
1380
|
-
case f.JSON: return r(await e.resolveJsonContent(t) ??
|
|
1413
|
+
case f.PDF: return r(await e.resolvePdfContent(t) ?? $(e.resolveContentUrl(t)), t.name, n);
|
|
1414
|
+
case f.Markdown: return r(await e.resolveMarkdownContent(t) ?? $(e.resolveContentUrl(t)), t.name, n);
|
|
1415
|
+
case f.JSON: return r(await e.resolveJsonContent(t) ?? $(e.resolveContentUrl(t)), t.name, n);
|
|
1381
1416
|
}
|
|
1382
|
-
let u = t.name ?? "", p = u.lastIndexOf("."), m = p === -1 ? "" : u.slice(p + 1).toLowerCase(), h =
|
|
1383
|
-
if (h != null) return r(await e.resolveOoxmlContent(t, h) ??
|
|
1417
|
+
let u = t.name ?? "", p = u.lastIndexOf("."), m = p === -1 ? "" : u.slice(p + 1).toLowerCase(), h = Je(u);
|
|
1418
|
+
if (h != null) return r(await e.resolveOoxmlContent(t, h) ?? $(e.resolveContentUrl(t)), t.name, n);
|
|
1384
1419
|
switch (m) {
|
|
1385
1420
|
case d.Markdown:
|
|
1386
1421
|
case d.MarkdownAlt: {
|
|
@@ -1396,24 +1431,24 @@ var $e = ({ children: e }) => {
|
|
|
1396
1431
|
return i == null ? !1 : r(i, t.name, n);
|
|
1397
1432
|
}
|
|
1398
1433
|
}
|
|
1399
|
-
let g = t.name != null &&
|
|
1400
|
-
if (t.name != null && !
|
|
1434
|
+
let g = t.name != null && Q(t.name) || t.url != null && Q(dt(t.url));
|
|
1435
|
+
if (t.name != null && !Ze(t.name) && !g) return r($(e.resolveContentUrl(t)), t.name, n);
|
|
1401
1436
|
if (g) {
|
|
1402
1437
|
let a = await e.resolveHtmlContent(t);
|
|
1403
|
-
return a == null ? e.hasTextSource(t) ? r(
|
|
1438
|
+
return a == null ? e.hasTextSource(t) ? r($(e.resolveContentUrl(t)), t.name, n) : t.url == null ? !1 : r({
|
|
1404
1439
|
type: i.Html,
|
|
1405
1440
|
url: t.url
|
|
1406
1441
|
}, t.name, n) : r(a, t.name, n);
|
|
1407
1442
|
}
|
|
1408
|
-
let _ = await e.resolveCodeContent(t,
|
|
1443
|
+
let _ = await e.resolveCodeContent(t, $e(m));
|
|
1409
1444
|
return _ == null ? !1 : r(_, t.name, n);
|
|
1410
1445
|
}, [
|
|
1411
1446
|
o,
|
|
1412
1447
|
s,
|
|
1413
1448
|
e
|
|
1414
1449
|
]);
|
|
1415
|
-
return { openAttachmentCanvas:
|
|
1416
|
-
let d = () => s == null || s(), f = (e, t, r) => d() ? (n(e, t, r), !0) : (
|
|
1450
|
+
return { openAttachmentCanvas: I(async (t, o = t.id, s) => {
|
|
1451
|
+
let d = () => s == null || s(), f = (e, t, r) => d() ? (n(e, t, r), !0) : (rt(e), !1);
|
|
1417
1452
|
switch (t.type) {
|
|
1418
1453
|
case c.Image: {
|
|
1419
1454
|
let r = e.resolveImageContent(t);
|
|
@@ -1450,4 +1485,4 @@ var $e = ({ children: e }) => {
|
|
|
1450
1485
|
]) };
|
|
1451
1486
|
};
|
|
1452
1487
|
//#endregion
|
|
1453
|
-
export {
|
|
1488
|
+
export { de as ATTACHMENT_CANVAS_CLASS, He as AttachmentCanvas, ze as AttachmentCanvasBody, ct as AttachmentCanvasContainer, ot as AttachmentCanvasProvider, i as AttachmentContentType, n as AttachmentErrorType, me as CodeContent, he as HTML_PREVIEW_FRAME_RENDER_MESSAGE, ut as InlineGroupedVisualizer, Ce as McpAppCanvasRenderer, r as OoxmlFileType, t as OoxmlHighlightKind, tt as createForbiddenCanvasContent, et as createLoadErrorCanvasContent, $ as createUnsupportedCanvasContent, a as downloadAttachmentContent, $e as extensionToLanguage, Ae as findVisualizerForApplication, ke as findVisualizerForMime, Je as getOoxmlFileType, Xe as getOoxmlMimeType, je as groupedVisualizerCanvasKey, o as isDownloadable, Q as isHtmlPreviewable, Ye as isOoxmlPreviewable, Ze as isTextPreviewable, Me as partitionAttachmentsForApplicationVisualizer, st as useAttachmentCanvas, ft as useOpenAttachmentCanvas };
|