@epam/ai-dial-attachment-canvas 1.2.0-dev.14 → 1.2.0-dev.141
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/{LazyContentBoundary-CRXN6PG3.js → LazyContentBoundary-tNE1ExbI.js} +2 -1
- package/{PdfContent-D71LPAe3.js → PdfContent-BoAtghsO.js} +1 -1
- package/{attachment-canvas-nvhW3tKV.js → attachment-canvas-BgwyzrRC.js} +2 -2
- 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/InlineGroupedVisualizer/InlineGroupedVisualizer.d.ts +36 -0
- package/components/InlineGroupedVisualizer/InlineGroupedVisualizer.d.ts.map +1 -0
- package/components/McpAppCanvasRenderer/McpAppCanvasRenderer.d.ts +3 -0
- package/components/McpAppCanvasRenderer/McpAppCanvasRenderer.d.ts.map +1 -1
- package/components/OoxmlContent/OoxmlContent.d.ts.map +1 -1
- package/components/VisualizerCanvasRenderer/VisualizerCanvasRenderer.d.ts +5 -3
- package/components/VisualizerCanvasRenderer/VisualizerCanvasRenderer.d.ts.map +1 -1
- package/constants/public-class-names.d.ts +11 -0
- package/constants/public-class-names.d.ts.map +1 -0
- package/hooks/useMcpAppBridge/useMcpAppBridge.d.ts.map +1 -1
- package/index.css +2 -1
- package/index.d.ts +6 -2
- package/index.d.ts.map +1 -1
- package/index.js +569 -451
- package/models/attachment-canvas.d.ts +52 -11
- package/models/attachment-canvas.d.ts.map +1 -1
- package/{ooxml-highlight-surfaces-CaMjx8u-.js → ooxml-highlight-surfaces-BzgOKpBV.js} +182 -74
- package/package.json +5 -5
- package/types/attachment-canvas.d.ts +6 -1
- package/types/attachment-canvas.d.ts.map +1 -1
- package/utils/content.d.ts +1 -1
- package/utils/content.d.ts.map +1 -1
- package/utils/download.d.ts.map +1 -1
- package/utils/ooxml-highlight-surfaces.d.ts.map +1 -1
- package/utils/ooxml-table-row-highlight.d.ts +8 -0
- package/utils/ooxml-table-row-highlight.d.ts.map +1 -0
- package/utils/visualizer.d.ts +29 -1
- package/utils/visualizer.d.ts.map +1 -1
- package/utils/vite-external-matcher.d.ts +5 -5
- package/utils/vite-external-matcher.d.ts.map +1 -1
- package/bounded-raw-part-cache-Cg1BsSZQ-DN8p45IK.js +0 -37900
- package/chart-ex-DsESBs97.js +0 -1009
- package/comment-occurrence-C8Y2uoVr-C1cxz2TU.js +0 -6
- package/comment-ui-runtime-BfE7MJZn-DhQ_eg15.js +0 -112
- package/comment-ui-runtime-BsK8pmUT-EgWiymew.js +0 -2
- package/comment-ui-runtime-DcJOYlw--B15auUq-.js +0 -170
- package/comments-Diid5ujN-BdQhRNjI.js +0 -282
- package/delimited-text-worker-host-BVY-Ecni-AimUmSn0.js +0 -25
- package/docx-B-VcIRoc.js +0 -29870
- package/line-distribute-Dtudnqhs--BYZNgzX.js +0 -1237
- package/line-metrics-B60C86uh-DfQUk7X1.js +0 -60
- package/pptx-CnoDB8Fv.js +0 -9211
- package/read-only-comment-decoration-Dz7eTQ4d-Cl3RKKH6.js +0 -94
- package/read-only-comment-margin-DkgzASAl-BbDxMI5E.js +0 -189
- package/render-worker-host-BfbnEChF-D2thMRGX.js +0 -7
- package/render-worker-host-DNL9dWRh-Bky38ZHE.js +0 -7
- package/render-worker-host-IkHrYOci-DbjyHK7U.js +0 -7
- package/renderer-module-contract-D91rkYHH-BtfSKxb4.js +0 -10063
- package/visible-index-BgiHEc1z-BOzE9X5U.js +0 -162
- package/xlsx-Dn0XSlTO.js +0 -8610
package/index.js
CHANGED
|
@@ -1,42 +1,43 @@
|
|
|
1
|
-
import { a as e, i as t, n, r, t as i } from "./attachment-canvas-
|
|
2
|
-
import { i as a, o, t as s } from "./LazyContentBoundary-
|
|
1
|
+
import { a as e, i as t, n, r, t as i } from "./attachment-canvas-BgwyzrRC.js";
|
|
2
|
+
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, mergeClasses as g, restrainedSyntaxTheme as _, stripUrlQueryAndFragment as v } from "@epam/ai-dial-chat-shared";
|
|
4
4
|
import { SidebarOrientation as y, SidebarPanel as b } from "@epam/ai-dial-sidebar";
|
|
5
|
-
import { DIAL_ICON_SIZE as x, DIAL_KIT_ICON_STROKE as S,
|
|
6
|
-
import { IconAlertTriangle as
|
|
7
|
-
import { createContext as
|
|
8
|
-
import { JsonView as
|
|
9
|
-
import { Fragment as
|
|
10
|
-
import { AppBridge as
|
|
5
|
+
import { DIAL_ICON_SIZE as x, DIAL_KIT_ICON_STROKE as S, ElementSize as C, GhostIconButton as w, LinkButton as T, Spinner as E } from "@epam/ai-dial-ui-kit";
|
|
6
|
+
import { IconAlertTriangle as D, IconArrowsMaximize as O, IconCheck as k, IconCode as ee, IconCopy as te, IconDownload as ne, IconEye as re, IconLock as ie, IconMarkdown as ae, IconRefresh as oe } from "@tabler/icons-react";
|
|
7
|
+
import { createContext as A, lazy as j, memo as M, useCallback as N, useContext as se, useEffect as P, useMemo as F, useRef as I, useState as L } from "react";
|
|
8
|
+
import { JsonView as R, defaultStyles as ce } from "react-json-view-lite";
|
|
9
|
+
import { Fragment as le, jsx as z, jsxs as B } from "react/jsx-runtime";
|
|
10
|
+
import { AppBridge as V, AppFrame as H } from "@mcp-ui/client";
|
|
11
11
|
import { McpUiHostContextChangedNotificationSchema as ue } from "@modelcontextprotocol/ext-apps/app-bridge";
|
|
12
|
-
import { VisualizerConnectorRequests as
|
|
13
|
-
import { VisualizerConnector as
|
|
14
|
-
|
|
12
|
+
import { VisualizerConnectorRequests as de } from "@epam/ai-dial-shared";
|
|
13
|
+
import { VisualizerConnector as fe } from "@epam/ai-dial-visualizer-connector";
|
|
14
|
+
//#region src/constants/public-class-names.ts
|
|
15
|
+
var pe = { panel: "dial-attachment-canvas-panel" }, me = {
|
|
15
16
|
container: "_container_1nhig_1",
|
|
16
17
|
containerLight: "_containerLight_1nhig_5"
|
|
17
|
-
},
|
|
18
|
+
}, he = {
|
|
18
19
|
[l.Dark]: _,
|
|
19
20
|
[l.Light]: _
|
|
20
|
-
}, U = () =>
|
|
21
|
+
}, U = () => j(async () => {
|
|
21
22
|
let { Prism: e } = await import("react-syntax-highlighter");
|
|
22
23
|
return { default: e };
|
|
23
|
-
}),
|
|
24
|
-
let { text: r, language: i } = e, a = i == null || i === "plaintext", o =
|
|
24
|
+
}), ge = M(({ content: e, codeBlockTheme: t = l.Light, labels: n }) => {
|
|
25
|
+
let { text: r, language: i } = e, a = i == null || i === "plaintext", o = he[t], c = t === l.Light, [u, d] = L(0), f = F(U, [u]), p = N(() => {
|
|
25
26
|
d((e) => e + 1);
|
|
26
|
-
}, []), m = /* @__PURE__ */
|
|
27
|
+
}, []), m = /* @__PURE__ */ z("pre", {
|
|
27
28
|
className: "whitespace-pre-wrap break-words p-4",
|
|
28
29
|
children: r
|
|
29
30
|
});
|
|
30
|
-
return /* @__PURE__ */
|
|
31
|
+
return /* @__PURE__ */ z("div", {
|
|
31
32
|
dir: "ltr",
|
|
32
|
-
className: g("h-full overflow-auto",
|
|
33
|
-
children: a ? m : /* @__PURE__ */
|
|
33
|
+
className: g("h-full overflow-auto", me.container, c && me.containerLight),
|
|
34
|
+
children: a ? m : /* @__PURE__ */ z(s, {
|
|
34
35
|
retryKey: u,
|
|
35
36
|
onRetry: p,
|
|
36
37
|
pendingContent: m,
|
|
37
38
|
errorContent: m,
|
|
38
39
|
labels: n,
|
|
39
|
-
children: /* @__PURE__ */
|
|
40
|
+
children: /* @__PURE__ */ z(f, {
|
|
40
41
|
language: i,
|
|
41
42
|
style: o,
|
|
42
43
|
customStyle: {
|
|
@@ -53,21 +54,21 @@ var de = {
|
|
|
53
54
|
})
|
|
54
55
|
})
|
|
55
56
|
});
|
|
56
|
-
}),
|
|
57
|
+
}), _e = { openInNewTabButton: "_openInNewTabButton_c1arc_1" }, ve = M(({ content: e, labels: t, isSourceView: n, title: r, codeBlockTheme: a, openInNewTabButtonTypographyClassName: o = "dial-body-semi-text" }) => {
|
|
57
58
|
let { htmlFrameBlockedLabel: s = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: c = "Open in new tab" } = t, [l, u] = L(!0), [d, f] = L(!1), p = I(null);
|
|
58
59
|
P(() => {
|
|
59
60
|
u(!0), f(!1);
|
|
60
61
|
}, [e]);
|
|
61
|
-
let m =
|
|
62
|
+
let m = N((t) => {
|
|
62
63
|
if (u(!1), e.srcdoc == null) try {
|
|
63
64
|
p.current?.contentDocument ?? f(!0);
|
|
64
65
|
} catch {
|
|
65
66
|
f(!0);
|
|
66
67
|
}
|
|
67
|
-
}, [e.srcdoc]), h =
|
|
68
|
+
}, [e.srcdoc]), h = N(() => {
|
|
68
69
|
u(!1), f(!0);
|
|
69
70
|
}, []);
|
|
70
|
-
if (n && e.srcdoc != null) return /* @__PURE__ */
|
|
71
|
+
if (n && e.srcdoc != null) return /* @__PURE__ */ z(ge, {
|
|
71
72
|
content: {
|
|
72
73
|
type: i.Code,
|
|
73
74
|
text: e.srcdoc,
|
|
@@ -75,26 +76,26 @@ var de = {
|
|
|
75
76
|
},
|
|
76
77
|
codeBlockTheme: a
|
|
77
78
|
});
|
|
78
|
-
if (d) return /* @__PURE__ */
|
|
79
|
+
if (d) return /* @__PURE__ */ B("div", {
|
|
79
80
|
className: "flex h-full flex-col items-center justify-center gap-3 p-4",
|
|
80
|
-
children: [/* @__PURE__ */
|
|
81
|
+
children: [/* @__PURE__ */ z("p", {
|
|
81
82
|
className: "text-center",
|
|
82
83
|
children: s
|
|
83
|
-
}), e.url != null && /* @__PURE__ */
|
|
84
|
+
}), e.url != null && /* @__PURE__ */ z(T, {
|
|
84
85
|
href: e.url,
|
|
85
86
|
target: "_blank",
|
|
86
87
|
label: c,
|
|
87
|
-
className:
|
|
88
|
+
className: _e.openInNewTabButton,
|
|
88
89
|
textClassName: o
|
|
89
90
|
})]
|
|
90
91
|
});
|
|
91
92
|
let _ = e.srcdoc != null, v = _ ? void 0 : e.url, y = _ ? e.srcdoc : void 0;
|
|
92
|
-
return /* @__PURE__ */
|
|
93
|
+
return /* @__PURE__ */ B("div", {
|
|
93
94
|
className: "relative h-full",
|
|
94
|
-
children: [l && /* @__PURE__ */
|
|
95
|
+
children: [l && /* @__PURE__ */ z("div", {
|
|
95
96
|
className: "absolute inset-0 flex items-center justify-center",
|
|
96
|
-
children: /* @__PURE__ */
|
|
97
|
-
}), /* @__PURE__ */
|
|
97
|
+
children: /* @__PURE__ */ z(E, {})
|
|
98
|
+
}), /* @__PURE__ */ z("iframe", {
|
|
98
99
|
ref: p,
|
|
99
100
|
title: r,
|
|
100
101
|
src: v,
|
|
@@ -105,10 +106,10 @@ var de = {
|
|
|
105
106
|
onError: h
|
|
106
107
|
})]
|
|
107
108
|
});
|
|
108
|
-
}),
|
|
109
|
+
}), ye = {
|
|
109
110
|
name: "MCP-UI Host",
|
|
110
111
|
version: "1.0.0"
|
|
111
|
-
},
|
|
112
|
+
}, be = { openLinks: {} }, xe = (e) => {
|
|
112
113
|
let t;
|
|
113
114
|
try {
|
|
114
115
|
t = new URL(e);
|
|
@@ -122,14 +123,14 @@ var de = {
|
|
|
122
123
|
return !1;
|
|
123
124
|
}
|
|
124
125
|
return !0;
|
|
125
|
-
},
|
|
126
|
+
}, Se = (e, t, n) => {
|
|
126
127
|
if (n) {
|
|
127
128
|
e.style.maxWidth = "", e.style.maxHeight = "";
|
|
128
129
|
return;
|
|
129
130
|
}
|
|
130
131
|
let r = t;
|
|
131
132
|
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`));
|
|
132
|
-
},
|
|
133
|
+
}, Ce = (e, t, n) => {
|
|
133
134
|
let r = I(e);
|
|
134
135
|
P(() => {
|
|
135
136
|
r.current = e;
|
|
@@ -138,15 +139,22 @@ var de = {
|
|
|
138
139
|
return P(() => {
|
|
139
140
|
let e = null;
|
|
140
141
|
try {
|
|
141
|
-
|
|
142
|
+
let n = t.current?.getBoundingClientRect(), i = n != null && n.width > 0 && n.height > 0 ? {
|
|
143
|
+
...r.current.hostContext,
|
|
144
|
+
containerDimensions: {
|
|
145
|
+
width: Math.round(n.width),
|
|
146
|
+
height: Math.round(n.height)
|
|
147
|
+
}
|
|
148
|
+
} : r.current.hostContext;
|
|
149
|
+
e = new V(null, r.current.hostInfo ?? ye, be, { hostContext: i }), e.onopenlink = async ({ url: e }) => {
|
|
142
150
|
let t = r.current.onOpenLink;
|
|
143
|
-
return (t == null ?
|
|
151
|
+
return (t == null ? xe(e) : t(e)) === !1 ? { isError: !0 } : {};
|
|
144
152
|
}, e.onrequestdisplaymode = async ({ mode: e }) => {
|
|
145
153
|
let t = r.current.onRequestDisplayMode, n = r.current.hostContext?.displayMode ?? "inline";
|
|
146
154
|
return { mode: t?.(e) ?? n };
|
|
147
155
|
}, e.oncalltool = (e) => r.current.onToolCall(e.name, e.arguments), e.setNotificationHandler(ue, ({ params: e }) => {
|
|
148
156
|
let n = t.current?.querySelector("iframe");
|
|
149
|
-
n != null &&
|
|
157
|
+
n != null && Se(n, e.containerDimensions, r.current.hostContext?.displayMode === "fullscreen");
|
|
150
158
|
}), a(e);
|
|
151
159
|
} catch (e) {
|
|
152
160
|
console.error("[useMcpAppBridge] Error creating AppBridge:", e), s(!0);
|
|
@@ -155,69 +163,78 @@ var de = {
|
|
|
155
163
|
e?.close().catch((e) => console.error("[useMcpAppBridge] Error closing AppBridge:", e));
|
|
156
164
|
};
|
|
157
165
|
}, [t]), P(() => {
|
|
158
|
-
i != null && n != null && i.setHostContext(n);
|
|
166
|
+
i != null && i.transport != null && n != null && i.setHostContext(n);
|
|
159
167
|
}, [i, n]), {
|
|
160
168
|
appBridge: i,
|
|
161
169
|
hasFailed: o
|
|
162
170
|
};
|
|
163
|
-
},
|
|
164
|
-
loadingOverlay: "
|
|
165
|
-
fullscreenFrame: "
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
171
|
+
}, W = {
|
|
172
|
+
loadingOverlay: "_loadingOverlay_iea4a_2",
|
|
173
|
+
fullscreenFrame: "_fullscreenFrame_iea4a_21",
|
|
174
|
+
loadingFrame: "_loadingFrame_iea4a_29",
|
|
175
|
+
statusLabel: "_statusLabel_iea4a_33",
|
|
176
|
+
statusDetail: "_statusDetail_iea4a_38",
|
|
177
|
+
errorIcon: "_errorIcon_iea4a_42"
|
|
178
|
+
}, we = ({ content: e, errorLabel: t = "Failed to load app", onAppInfo: n }) => {
|
|
179
|
+
let [r, i] = L("loading"), [a, o] = L(), { html: s, sandboxUrl: c, toolInput: l, toolResult: u, hostContext: d } = e, f = F(() => ({ url: new URL(c) }), [c]), p = d?.displayMode === "fullscreen", m = I(null), [h, _] = L();
|
|
170
180
|
P(() => {
|
|
171
|
-
let e =
|
|
181
|
+
let e = m.current;
|
|
172
182
|
if (!e) return;
|
|
173
183
|
let t = new ResizeObserver(([e]) => {
|
|
174
184
|
if (!e) return;
|
|
175
185
|
let { width: t, height: n } = e.contentRect;
|
|
176
|
-
|
|
186
|
+
_({
|
|
177
187
|
width: Math.round(t),
|
|
178
188
|
height: Math.round(n)
|
|
179
189
|
});
|
|
180
190
|
});
|
|
181
191
|
return t.observe(e), () => t.disconnect();
|
|
182
192
|
}, []);
|
|
183
|
-
let { appBridge:
|
|
184
|
-
...
|
|
185
|
-
containerDimensions:
|
|
186
|
-
}, [
|
|
187
|
-
return /* @__PURE__ */
|
|
188
|
-
ref:
|
|
189
|
-
className: g("relative h-full w-full",
|
|
193
|
+
let { appBridge: v, hasFailed: y } = Ce(e, m, F(() => d == null || h == null ? d : {
|
|
194
|
+
...d,
|
|
195
|
+
containerDimensions: h
|
|
196
|
+
}, [d, h])), b = y || r === "error";
|
|
197
|
+
return /* @__PURE__ */ B("div", {
|
|
198
|
+
ref: m,
|
|
199
|
+
className: g("relative h-full min-h-[200px] w-full", p && W.fullscreenFrame, !p && r === "loading" && W.loadingFrame),
|
|
190
200
|
children: [
|
|
191
|
-
|
|
192
|
-
html:
|
|
193
|
-
sandbox:
|
|
194
|
-
appBridge:
|
|
195
|
-
toolInput:
|
|
196
|
-
toolResult:
|
|
197
|
-
onSizeChanged: () =>
|
|
198
|
-
onInitialized: () =>
|
|
199
|
-
|
|
201
|
+
v != null && !b && /* @__PURE__ */ z(H, {
|
|
202
|
+
html: s,
|
|
203
|
+
sandbox: f,
|
|
204
|
+
appBridge: v,
|
|
205
|
+
toolInput: l,
|
|
206
|
+
toolResult: u,
|
|
207
|
+
onSizeChanged: () => i("ready"),
|
|
208
|
+
onInitialized: (e) => {
|
|
209
|
+
i("ready"), e.appVersion != null && n?.(e.appVersion);
|
|
210
|
+
},
|
|
211
|
+
onError: (e) => {
|
|
212
|
+
o(e.message), i("error");
|
|
213
|
+
}
|
|
200
214
|
}),
|
|
201
|
-
!
|
|
202
|
-
className: g("absolute inset-0 flex flex-col items-center justify-center gap-2",
|
|
203
|
-
children: /* @__PURE__ */
|
|
215
|
+
!b && r === "loading" && /* @__PURE__ */ z("div", {
|
|
216
|
+
className: g("absolute inset-0 flex flex-col items-center justify-center gap-2", W.loadingOverlay),
|
|
217
|
+
children: /* @__PURE__ */ z(E, {})
|
|
204
218
|
}),
|
|
205
|
-
|
|
206
|
-
className: "absolute inset-0 flex flex-col items-center justify-center gap-2",
|
|
207
|
-
children: [/* @__PURE__ */
|
|
219
|
+
b && /* @__PURE__ */ B("div", {
|
|
220
|
+
className: "absolute inset-0 flex flex-col items-center justify-center gap-2 p-4",
|
|
221
|
+
children: [/* @__PURE__ */ z(D, {
|
|
208
222
|
size: 60,
|
|
209
223
|
stroke: S,
|
|
210
224
|
"aria-hidden": !0,
|
|
211
|
-
className:
|
|
212
|
-
}), /* @__PURE__ */
|
|
225
|
+
className: W.errorIcon
|
|
226
|
+
}), /* @__PURE__ */ B("p", {
|
|
213
227
|
role: "alert",
|
|
214
|
-
className: g("text-center",
|
|
215
|
-
children: t
|
|
228
|
+
className: g("text-center", W.statusLabel),
|
|
229
|
+
children: [t, a && /* @__PURE__ */ B(le, { children: [/* @__PURE__ */ z("br", {}), /* @__PURE__ */ z("span", {
|
|
230
|
+
className: W.statusDetail,
|
|
231
|
+
children: a
|
|
232
|
+
})] })]
|
|
216
233
|
})]
|
|
217
234
|
})
|
|
218
235
|
]
|
|
219
236
|
});
|
|
220
|
-
},
|
|
237
|
+
}, G = {
|
|
221
238
|
viewer: "_viewer_1w97n_2",
|
|
222
239
|
spreadsheetCanvas: "_spreadsheetCanvas_1w97n_6",
|
|
223
240
|
formulaPanel: "_formulaPanel_1w97n_12",
|
|
@@ -225,16 +242,16 @@ var de = {
|
|
|
225
242
|
statusOverlay: "_statusOverlay_1w97n_24",
|
|
226
243
|
errorIcon: "_errorIcon_1w97n_29",
|
|
227
244
|
highlight: "_highlight_1w97n_37"
|
|
228
|
-
},
|
|
245
|
+
}, Te = (e) => {
|
|
229
246
|
if (e?.kind !== "range") return "";
|
|
230
247
|
let { activeCell: t } = e.selection, n = e.cells.find(({ address: e }) => e.row === t.row && e.col === t.col);
|
|
231
248
|
if (n == null) return "";
|
|
232
249
|
let r = n.formula;
|
|
233
250
|
return r == null || r.trim().length === 0 ? n.displayText : r.startsWith("=") ? r : `=${r}`;
|
|
234
|
-
},
|
|
251
|
+
}, Ee = async (e, t, { onError: n, onXlsxSelectionContextChange: i }) => {
|
|
235
252
|
switch (t) {
|
|
236
253
|
case r.Docx: {
|
|
237
|
-
let [{ DocxScrollViewer: t }, { chartEx: r }] = await Promise.all([import("
|
|
254
|
+
let [{ DocxScrollViewer: t }, { chartEx: r }] = await Promise.all([import("@silurus/ooxml/docx"), import("@silurus/ooxml/chart-ex")]);
|
|
238
255
|
return new t(e, {
|
|
239
256
|
enableTextSelection: !0,
|
|
240
257
|
refitOnResize: !0,
|
|
@@ -243,7 +260,7 @@ var de = {
|
|
|
243
260
|
});
|
|
244
261
|
}
|
|
245
262
|
case r.Xlsx: {
|
|
246
|
-
let [{ XlsxViewer: t }, { chartEx: r }] = await Promise.all([import("
|
|
263
|
+
let [{ XlsxViewer: t }, { chartEx: r }] = await Promise.all([import("@silurus/ooxml/xlsx"), import("@silurus/ooxml/chart-ex")]);
|
|
247
264
|
return new t(e, {
|
|
248
265
|
showZoomSlider: !0,
|
|
249
266
|
chartEx: r,
|
|
@@ -252,19 +269,23 @@ var de = {
|
|
|
252
269
|
});
|
|
253
270
|
}
|
|
254
271
|
case r.Csv: {
|
|
255
|
-
let { XlsxSheetViewer: t } = await import("
|
|
256
|
-
r.className =
|
|
272
|
+
let { XlsxSheetViewer: t } = await import("@silurus/ooxml/xlsx"), r = document.createElement("canvas");
|
|
273
|
+
r.className = G.spreadsheetCanvas, e.replaceChildren(r);
|
|
257
274
|
let i = new t(r, {
|
|
258
275
|
showScrollbars: !0,
|
|
259
276
|
onError: n
|
|
260
277
|
});
|
|
261
278
|
return {
|
|
262
279
|
load: (e) => i.load(e, { format: "csv" }),
|
|
263
|
-
destroy: () => i.destroy()
|
|
280
|
+
destroy: () => i.destroy(),
|
|
281
|
+
resize: () => {
|
|
282
|
+
let { width: t, height: n } = e.getBoundingClientRect();
|
|
283
|
+
return t > 0 && (r.style.width = `${t}px`), n > 0 && (r.style.height = `${n}px`), i.relayout();
|
|
284
|
+
}
|
|
264
285
|
};
|
|
265
286
|
}
|
|
266
287
|
case r.Pptx: {
|
|
267
|
-
let [{ PptxScrollViewer: t }, { chartEx: r }] = await Promise.all([import("
|
|
288
|
+
let [{ PptxScrollViewer: t }, { chartEx: r }] = await Promise.all([import("@silurus/ooxml/pptx"), import("@silurus/ooxml/chart-ex")]);
|
|
268
289
|
return new t(e, {
|
|
269
290
|
enableTextSelection: !0,
|
|
270
291
|
refitOnResize: !0,
|
|
@@ -273,16 +294,16 @@ var de = {
|
|
|
273
294
|
});
|
|
274
295
|
}
|
|
275
296
|
}
|
|
276
|
-
},
|
|
297
|
+
}, De = async (e, t, n, i) => {
|
|
277
298
|
let { onError: a, onXlsxSelectionContextChange: o, onGeometryInvalidated: s } = n;
|
|
278
299
|
switch (t.format) {
|
|
279
300
|
case r.Docx: {
|
|
280
301
|
let [{ DocxDocument: n, DocxScrollViewer: r }, { chartEx: o }, { createDocxHighlightSurface: c }] = await Promise.all([
|
|
281
|
-
import("
|
|
282
|
-
import("
|
|
283
|
-
import("./ooxml-highlight-surfaces-
|
|
302
|
+
import("@silurus/ooxml/docx"),
|
|
303
|
+
import("@silurus/ooxml/chart-ex"),
|
|
304
|
+
import("./ooxml-highlight-surfaces-BzgOKpBV.js")
|
|
284
305
|
]), l = await n.load(t.url, { chartEx: o });
|
|
285
|
-
if (i()) throw l.destroy(), new
|
|
306
|
+
if (i()) throw l.destroy(), new Oe();
|
|
286
307
|
let u = r.fromDocument(e, l, {
|
|
287
308
|
enableTextSelection: !0,
|
|
288
309
|
refitOnResize: !0,
|
|
@@ -298,11 +319,11 @@ var de = {
|
|
|
298
319
|
}
|
|
299
320
|
case r.Pptx: {
|
|
300
321
|
let [{ PptxPresentation: n, PptxScrollViewer: r }, { chartEx: o }, { createPptxHighlightSurface: c }] = await Promise.all([
|
|
301
|
-
import("
|
|
302
|
-
import("
|
|
303
|
-
import("./ooxml-highlight-surfaces-
|
|
322
|
+
import("@silurus/ooxml/pptx"),
|
|
323
|
+
import("@silurus/ooxml/chart-ex"),
|
|
324
|
+
import("./ooxml-highlight-surfaces-BzgOKpBV.js")
|
|
304
325
|
]), l = await n.load(t.url, { chartEx: o });
|
|
305
|
-
if (i()) throw l.destroy(), new
|
|
326
|
+
if (i()) throw l.destroy(), new Oe();
|
|
306
327
|
let u = r.fromPresentation(e, l, {
|
|
307
328
|
enableTextSelection: !0,
|
|
308
329
|
refitOnResize: !0,
|
|
@@ -318,9 +339,9 @@ var de = {
|
|
|
318
339
|
}
|
|
319
340
|
case r.Xlsx: {
|
|
320
341
|
let [{ XlsxViewer: n }, { chartEx: r }, { createXlsxHighlightSurface: c }] = await Promise.all([
|
|
321
|
-
import("
|
|
322
|
-
import("
|
|
323
|
-
import("./ooxml-highlight-surfaces-
|
|
342
|
+
import("@silurus/ooxml/xlsx"),
|
|
343
|
+
import("@silurus/ooxml/chart-ex"),
|
|
344
|
+
import("./ooxml-highlight-surfaces-BzgOKpBV.js")
|
|
324
345
|
]), l = new n(e, {
|
|
325
346
|
showZoomSlider: !0,
|
|
326
347
|
chartEx: r,
|
|
@@ -336,12 +357,12 @@ var de = {
|
|
|
336
357
|
};
|
|
337
358
|
}
|
|
338
359
|
case r.Csv: {
|
|
339
|
-
let r = await
|
|
360
|
+
let r = await Ee(e, t.format, n);
|
|
340
361
|
return await r.load(t.url), { viewer: r };
|
|
341
362
|
}
|
|
342
363
|
}
|
|
343
|
-
},
|
|
344
|
-
let l = I(null), [u, d] = L(!0), [f, p] = L(!1), [m, h] = L(""), [_, v] = L([]), [y, b] = L(!1), { highlights: x, selectedHighlightId: C } = t, w = x != null && x.length > 0,
|
|
364
|
+
}, Oe = class extends Error {}, ke = ({ content: t, fileName: n, loadErrorLabel: i, formulaLabel: a, formulaLabelClassName: o, highlightsLabel: s = "Cited locations", highlightNavigatedLabel: c = "Scrolled to the cited location" }) => {
|
|
365
|
+
let l = I(null), [u, d] = L(!0), [f, p] = L(!1), [m, h] = L(""), [_, v] = L([]), [y, b] = L(!1), { highlights: x, selectedHighlightId: C } = t, w = x != null && x.length > 0, T = I(void 0), O = I(x);
|
|
345
366
|
O.current = x;
|
|
346
367
|
let k = I(void 0);
|
|
347
368
|
return P(() => {
|
|
@@ -366,37 +387,40 @@ var de = {
|
|
|
366
387
|
i || (d(!1), p(!0));
|
|
367
388
|
},
|
|
368
389
|
onXlsxSelectionContextChange: (e) => {
|
|
369
|
-
i || h(
|
|
390
|
+
i || h(Te(e));
|
|
370
391
|
},
|
|
371
392
|
onGeometryInvalidated: s
|
|
372
393
|
}, f = () => {
|
|
373
|
-
i || (r = new ResizeObserver(
|
|
394
|
+
i || (r = new ResizeObserver(() => {
|
|
395
|
+
n?.viewer.resize?.(), s();
|
|
396
|
+
}), r.observe(e));
|
|
374
397
|
};
|
|
375
398
|
return e.addEventListener("scroll", s, !0), k.current = s, (async () => {
|
|
376
399
|
try {
|
|
377
400
|
if (w) {
|
|
378
|
-
let r = await
|
|
401
|
+
let r = await De(e, t, u, o);
|
|
379
402
|
if (i) {
|
|
380
403
|
r.viewer.destroy(), r.engine?.destroy();
|
|
381
404
|
return;
|
|
382
405
|
}
|
|
383
|
-
n = r,
|
|
406
|
+
n = r, T.current = r.highlights, f();
|
|
384
407
|
} else {
|
|
385
|
-
let r = await
|
|
408
|
+
let r = await Ee(e, t.format, u);
|
|
386
409
|
if (i) {
|
|
387
410
|
r.destroy();
|
|
388
411
|
return;
|
|
389
412
|
}
|
|
390
|
-
n = { viewer: r },
|
|
413
|
+
if (n = { viewer: r }, T.current = void 0, await r.load(t.url), i) return;
|
|
414
|
+
f();
|
|
391
415
|
}
|
|
392
416
|
if (i) return;
|
|
393
417
|
d(!1), await c();
|
|
394
418
|
} catch (t) {
|
|
395
|
-
if (t instanceof
|
|
396
|
-
n?.viewer.destroy(), n?.engine?.destroy(), n = void 0,
|
|
419
|
+
if (t instanceof Oe || i) return;
|
|
420
|
+
n?.viewer.destroy(), n?.engine?.destroy(), n = void 0, T.current = void 0, e.replaceChildren(), d(!1), p(!0);
|
|
397
421
|
}
|
|
398
422
|
})(), () => {
|
|
399
|
-
i = !0, e.removeEventListener("scroll", s, !0), a != null && cancelAnimationFrame(a), k.current = void 0, r?.disconnect(), n?.viewer.destroy(), n?.engine?.destroy(),
|
|
423
|
+
i = !0, e.removeEventListener("scroll", s, !0), a != null && cancelAnimationFrame(a), k.current = void 0, r?.disconnect(), n?.viewer.destroy(), n?.engine?.destroy(), T.current = void 0, e.replaceChildren();
|
|
400
424
|
};
|
|
401
425
|
}, [
|
|
402
426
|
t.format,
|
|
@@ -406,7 +430,7 @@ var de = {
|
|
|
406
430
|
k.current?.();
|
|
407
431
|
}, [x]), P(() => {
|
|
408
432
|
b(!1);
|
|
409
|
-
let t =
|
|
433
|
+
let t = T.current;
|
|
410
434
|
if (t == null || u) return;
|
|
411
435
|
let n = (O.current?.find(({ id: e }) => e === C))?.locations.at(0);
|
|
412
436
|
if (n == null) return;
|
|
@@ -422,38 +446,38 @@ var de = {
|
|
|
422
446
|
})(), () => {
|
|
423
447
|
r = !0;
|
|
424
448
|
};
|
|
425
|
-
}, [C, u]), /* @__PURE__ */
|
|
449
|
+
}, [C, u]), /* @__PURE__ */ B("div", {
|
|
426
450
|
className: "relative flex h-full w-full min-w-0 flex-col overflow-hidden",
|
|
427
451
|
children: [
|
|
428
|
-
t.format === r.Xlsx && /* @__PURE__ */
|
|
452
|
+
t.format === r.Xlsx && /* @__PURE__ */ B("div", {
|
|
429
453
|
role: "region",
|
|
430
454
|
"aria-label": a,
|
|
431
|
-
className: g("flex min-w-0 shrink-0 items-center gap-2 border-b px-3 py-2",
|
|
432
|
-
children: [/* @__PURE__ */
|
|
455
|
+
className: g("flex min-w-0 shrink-0 items-center gap-2 border-b px-3 py-2", G.formulaPanel),
|
|
456
|
+
children: [/* @__PURE__ */ z("span", {
|
|
433
457
|
"aria-hidden": "true",
|
|
434
458
|
className: g("shrink-0", o),
|
|
435
459
|
children: "fx"
|
|
436
|
-
}), /* @__PURE__ */
|
|
460
|
+
}), /* @__PURE__ */ z("code", {
|
|
437
461
|
dir: "ltr",
|
|
438
462
|
tabIndex: 0,
|
|
439
463
|
"aria-live": "polite",
|
|
440
|
-
className: g("h-8 min-w-0 flex-1 overflow-x-auto whitespace-nowrap rounded border px-2 py-1 text-sm focus-visible:outline focus-visible:outline-focus",
|
|
464
|
+
className: g("h-8 min-w-0 flex-1 overflow-x-auto whitespace-nowrap rounded border px-2 py-1 text-sm focus-visible:outline focus-visible:outline-focus", G.formulaValue),
|
|
441
465
|
children: m
|
|
442
466
|
})]
|
|
443
467
|
}),
|
|
444
|
-
/* @__PURE__ */
|
|
468
|
+
/* @__PURE__ */ B("div", {
|
|
445
469
|
className: "relative min-h-0 w-full flex-1",
|
|
446
|
-
children: [/* @__PURE__ */
|
|
470
|
+
children: [/* @__PURE__ */ z("div", {
|
|
447
471
|
ref: l,
|
|
448
472
|
role: "document",
|
|
449
473
|
"aria-label": n,
|
|
450
474
|
"aria-busy": u,
|
|
451
|
-
className: g("h-full w-full overflow-hidden",
|
|
452
|
-
}), _.length > 0 && /* @__PURE__ */
|
|
475
|
+
className: g("h-full w-full overflow-hidden", G.viewer)
|
|
476
|
+
}), _.length > 0 && /* @__PURE__ */ z("div", {
|
|
453
477
|
role: "region",
|
|
454
478
|
"aria-label": s,
|
|
455
479
|
className: "pointer-events-none absolute inset-0 overflow-hidden",
|
|
456
|
-
children: _.map((e, t) => /* @__PURE__ */
|
|
480
|
+
children: _.map((e, t) => /* @__PURE__ */ z("div", {
|
|
457
481
|
"aria-hidden": "true",
|
|
458
482
|
style: {
|
|
459
483
|
left: `${e.left}px`,
|
|
@@ -463,28 +487,28 @@ var de = {
|
|
|
463
487
|
},
|
|
464
488
|
"data-selected": e.highlightId === C,
|
|
465
489
|
"data-clipped": e.isClippedAtEnd === !0,
|
|
466
|
-
className: g("absolute",
|
|
490
|
+
className: g("absolute", G.highlight)
|
|
467
491
|
}, `${e.highlightId}-${t}`))
|
|
468
492
|
})]
|
|
469
493
|
}),
|
|
470
|
-
/* @__PURE__ */
|
|
494
|
+
/* @__PURE__ */ z("div", {
|
|
471
495
|
role: "status",
|
|
472
496
|
"aria-live": "polite",
|
|
473
497
|
className: "sr-only",
|
|
474
498
|
children: y ? c : ""
|
|
475
499
|
}),
|
|
476
|
-
(u || f) && /* @__PURE__ */
|
|
500
|
+
(u || f) && /* @__PURE__ */ z("div", {
|
|
477
501
|
role: f ? "alert" : void 0,
|
|
478
502
|
"aria-live": "polite",
|
|
479
|
-
className: g("absolute inset-0 flex items-center justify-center",
|
|
480
|
-
children: u ? /* @__PURE__ */
|
|
503
|
+
className: g("absolute inset-0 flex items-center justify-center", G.statusOverlay),
|
|
504
|
+
children: u ? /* @__PURE__ */ z(E, { size: 48 }) : /* @__PURE__ */ B("div", {
|
|
481
505
|
className: "flex flex-col items-center gap-2",
|
|
482
|
-
children: [/* @__PURE__ */
|
|
506
|
+
children: [/* @__PURE__ */ z(D, {
|
|
483
507
|
"aria-hidden": "true",
|
|
484
508
|
size: 60,
|
|
485
509
|
stroke: S,
|
|
486
|
-
className:
|
|
487
|
-
}), /* @__PURE__ */
|
|
510
|
+
className: G.errorIcon
|
|
511
|
+
}), /* @__PURE__ */ z("p", {
|
|
488
512
|
className: "text-center",
|
|
489
513
|
children: i
|
|
490
514
|
})]
|
|
@@ -492,76 +516,92 @@ var de = {
|
|
|
492
516
|
})
|
|
493
517
|
]
|
|
494
518
|
});
|
|
495
|
-
},
|
|
519
|
+
}, Ae = {
|
|
496
520
|
loadingOverlay: "_loadingOverlay_12637_1",
|
|
497
521
|
statusLabel: "_statusLabel_12637_5",
|
|
498
522
|
errorIcon: "_errorIcon_12637_9"
|
|
499
|
-
},
|
|
500
|
-
let
|
|
501
|
-
return
|
|
502
|
-
let e =
|
|
523
|
+
}, je = ({ content: e, loadingLabel: t, errorLabel: n = "Failed to load visualizer", frameTitle: r, colors: a }) => {
|
|
524
|
+
let o = I(null), [s, c] = L("loading"), { url: l, visualizerName: u, requestTimeout: d } = e, f = I(e);
|
|
525
|
+
return f.current = e, P(() => {
|
|
526
|
+
let e = o.current;
|
|
503
527
|
if (!e) return;
|
|
504
|
-
|
|
505
|
-
let t = new
|
|
506
|
-
domain:
|
|
528
|
+
c("loading");
|
|
529
|
+
let t = new fe(e, {
|
|
530
|
+
domain: l,
|
|
507
531
|
hostDomain: window.location.origin,
|
|
508
|
-
visualizerName:
|
|
509
|
-
requestTimeout:
|
|
532
|
+
visualizerName: u,
|
|
533
|
+
requestTimeout: d
|
|
510
534
|
}), n = !0;
|
|
511
535
|
return (async () => {
|
|
512
536
|
if (await t.ready(), !n) return;
|
|
513
|
-
let
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
537
|
+
let e = f.current;
|
|
538
|
+
if (e.type === i.GroupedVisualizer) await t.send(de.sendGroupedVisualizeData, {
|
|
539
|
+
attachments: e.attachments,
|
|
540
|
+
layout: e.layout
|
|
541
|
+
});
|
|
542
|
+
else {
|
|
543
|
+
let { mimeType: n, layout: r, data: i } = e, a = {
|
|
544
|
+
layout: r,
|
|
545
|
+
...typeof i == "object" && i ? i : {}
|
|
546
|
+
};
|
|
547
|
+
await t.send(de.sendVisualizeData, {
|
|
548
|
+
mimeType: n,
|
|
549
|
+
visualizerData: a
|
|
550
|
+
});
|
|
551
|
+
}
|
|
552
|
+
n && c("ready");
|
|
521
553
|
})().catch(() => {
|
|
522
|
-
n &&
|
|
554
|
+
n && c("error");
|
|
523
555
|
}), () => {
|
|
524
556
|
n = !1, t.destroy();
|
|
525
557
|
};
|
|
526
558
|
}, [
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
]),
|
|
559
|
+
l,
|
|
560
|
+
u,
|
|
561
|
+
d
|
|
562
|
+
]), P(() => {
|
|
563
|
+
let e = r ?? u.trim();
|
|
564
|
+
e !== "" && o.current?.querySelector("iframe")?.setAttribute("title", e);
|
|
565
|
+
}, [
|
|
566
|
+
r,
|
|
567
|
+
u,
|
|
568
|
+
l,
|
|
569
|
+
d
|
|
570
|
+
]), /* @__PURE__ */ B("div", {
|
|
531
571
|
className: "relative h-full w-full",
|
|
532
572
|
style: m({
|
|
533
|
-
"--vs-loading-bg":
|
|
534
|
-
"--vs-status-text":
|
|
535
|
-
"--vs-error-icon":
|
|
573
|
+
"--vs-loading-bg": a?.loadingBackground,
|
|
574
|
+
"--vs-status-text": a?.statusText,
|
|
575
|
+
"--vs-error-icon": a?.errorIcon
|
|
536
576
|
}),
|
|
537
577
|
children: [
|
|
538
|
-
/* @__PURE__ */
|
|
539
|
-
ref:
|
|
578
|
+
/* @__PURE__ */ z("div", {
|
|
579
|
+
ref: o,
|
|
540
580
|
className: "h-full w-full"
|
|
541
581
|
}),
|
|
542
|
-
|
|
543
|
-
className: g("absolute inset-0 flex flex-col items-center justify-center gap-2",
|
|
544
|
-
children: [/* @__PURE__ */
|
|
545
|
-
className: g("text-center",
|
|
582
|
+
s === "loading" && /* @__PURE__ */ B("div", {
|
|
583
|
+
className: g("absolute inset-0 flex flex-col items-center justify-center gap-2", Ae.loadingOverlay),
|
|
584
|
+
children: [/* @__PURE__ */ z(E, {}), t && /* @__PURE__ */ z("p", {
|
|
585
|
+
className: g("text-center", Ae.statusLabel),
|
|
546
586
|
children: t
|
|
547
587
|
})]
|
|
548
588
|
}),
|
|
549
|
-
|
|
589
|
+
s === "error" && /* @__PURE__ */ B("div", {
|
|
550
590
|
className: "absolute inset-0 flex flex-col items-center justify-center gap-2",
|
|
551
|
-
children: [/* @__PURE__ */
|
|
591
|
+
children: [/* @__PURE__ */ z(D, {
|
|
552
592
|
size: 60,
|
|
553
593
|
stroke: S,
|
|
554
594
|
"aria-hidden": !0,
|
|
555
|
-
className:
|
|
556
|
-
}), /* @__PURE__ */
|
|
595
|
+
className: Ae.errorIcon
|
|
596
|
+
}), /* @__PURE__ */ z("p", {
|
|
557
597
|
role: "alert",
|
|
558
|
-
className: g("text-center",
|
|
598
|
+
className: g("text-center", Ae.statusLabel),
|
|
559
599
|
children: n
|
|
560
600
|
})]
|
|
561
601
|
})
|
|
562
602
|
]
|
|
563
603
|
});
|
|
564
|
-
},
|
|
604
|
+
}, K = {
|
|
565
605
|
body: "_body_13ogb_4",
|
|
566
606
|
statusLabel: "_statusLabel_13ogb_13",
|
|
567
607
|
errorIcon: "_errorIcon_13ogb_17",
|
|
@@ -576,34 +616,34 @@ var de = {
|
|
|
576
616
|
jsonExpandIcon: "_jsonExpandIcon_13ogb_54",
|
|
577
617
|
jsonCollapseIcon: "_jsonCollapseIcon_13ogb_67",
|
|
578
618
|
jsonCollapsedContent: "_jsonCollapsedContent_13ogb_84"
|
|
579
|
-
},
|
|
619
|
+
}, Me = () => j(async () => ({ default: (await import("./PdfContent-BoAtghsO.js")).PdfContent })), Ne = ({ url: e, fileName: t, loadErrorLabel: n }) => {
|
|
580
620
|
let [r, i] = L(!1);
|
|
581
621
|
return P(() => {
|
|
582
622
|
i(!1);
|
|
583
|
-
}, [e]), r ? /* @__PURE__ */
|
|
623
|
+
}, [e]), r ? /* @__PURE__ */ B("div", {
|
|
584
624
|
className: "flex flex-col items-center gap-2",
|
|
585
|
-
children: [/* @__PURE__ */
|
|
625
|
+
children: [/* @__PURE__ */ z(D, {
|
|
586
626
|
size: 60,
|
|
587
627
|
stroke: S,
|
|
588
|
-
className:
|
|
589
|
-
}), /* @__PURE__ */
|
|
590
|
-
className: g("text-center",
|
|
628
|
+
className: K.errorIcon
|
|
629
|
+
}), /* @__PURE__ */ z("p", {
|
|
630
|
+
className: g("text-center", K.statusLabel),
|
|
591
631
|
children: n
|
|
592
632
|
})]
|
|
593
|
-
}) : /* @__PURE__ */
|
|
633
|
+
}) : /* @__PURE__ */ z("img", {
|
|
594
634
|
src: e,
|
|
595
635
|
alt: t ?? "",
|
|
596
636
|
className: "max-h-full max-w-full object-contain",
|
|
597
637
|
onError: () => i(!0)
|
|
598
638
|
});
|
|
599
|
-
},
|
|
639
|
+
}, Pe = new Set([
|
|
600
640
|
i.PlainText,
|
|
601
641
|
i.Code,
|
|
602
642
|
i.Ooxml
|
|
603
|
-
]),
|
|
604
|
-
let { colors: V, typography: H, bodyClassName:
|
|
605
|
-
|
|
606
|
-
}, []),
|
|
643
|
+
]), Fe = M(({ content: e, isLoading: t = !1, fileName: r, isHtmlSourceView: a = !1, labels: { unsupportedLabel: o = "Preview is not supported for this file", loadErrorLabel: c = "Failed to load file", forbiddenErrorLabel: l = "You don't have permission to access this file", visualizerErrorLabel: d, htmlFrameBlockedLabel: f = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: h = "Open in new tab", pdfThumbnailsLabel: _, pdfShowThumbnailsLabel: v, pdfHideThumbnailsLabel: y, pdfPageNumberLabel: b, pdfContentLoadingLabel: x, pdfContentErrorLabel: C, pdfContentRetryLabel: w, xlsxFormulaLabel: T = "Formula", codeContentLoadingLabel: O, codeContentErrorLabel: k, codeContentRetryLabel: ee, tableCopyLabel: te, tableCopiedLabel: ne, tableDownloadCsvLabel: re, ooxmlHighlightsLabel: ae, ooxmlHighlightNavigatedLabel: oe } = {}, styles: A, codeBlockTheme: j, tableDownloadFilename: M, loadPdf: se, hidePdfToolbar: P = !1, configurePdfWorker: I, onAppInfo: le }) => {
|
|
644
|
+
let { colors: V, typography: H, bodyClassName: ue, cssVars: de } = A ?? {}, [fe, pe] = L(0), me = F(Me, [fe]), he = N(() => {
|
|
645
|
+
pe((e) => e + 1);
|
|
646
|
+
}, []), U = H?.fontClassName != null, _e = F(() => ({
|
|
607
647
|
...m({
|
|
608
648
|
"--ac-text": V?.text,
|
|
609
649
|
"--ac-status-text": V?.statusText,
|
|
@@ -628,14 +668,14 @@ var de = {
|
|
|
628
668
|
"--ac-ooxml-highlight-bg": V?.ooxmlHighlightBackground,
|
|
629
669
|
"--ac-json-collapsed-text": V?.jsonCollapsedText,
|
|
630
670
|
"--ac-json-collapsed-bg": V?.jsonCollapsedBackground,
|
|
631
|
-
"--ac-font-family":
|
|
632
|
-
"--ac-font-size":
|
|
633
|
-
"--ac-font-weight":
|
|
634
|
-
"--ac-line-height":
|
|
635
|
-
"--ac-letter-spacing":
|
|
671
|
+
"--ac-font-family": U ? void 0 : H?.fontFamily,
|
|
672
|
+
"--ac-font-size": U ? void 0 : H?.fontSize,
|
|
673
|
+
"--ac-font-weight": U ? void 0 : H?.fontWeight,
|
|
674
|
+
"--ac-line-height": U ? void 0 : H?.lineHeight,
|
|
675
|
+
"--ac-letter-spacing": U ? void 0 : H?.letterSpacing
|
|
636
676
|
}),
|
|
637
|
-
...
|
|
638
|
-
}), [
|
|
677
|
+
...de
|
|
678
|
+
}), [A]), ye = F(() => {
|
|
639
679
|
switch (e.type) {
|
|
640
680
|
case i.Image:
|
|
641
681
|
case i.Audio:
|
|
@@ -645,6 +685,7 @@ var de = {
|
|
|
645
685
|
case i.Pdf:
|
|
646
686
|
case i.Ooxml:
|
|
647
687
|
case i.Visualizer:
|
|
688
|
+
case i.GroupedVisualizer:
|
|
648
689
|
case i.McpApp:
|
|
649
690
|
case i.Code:
|
|
650
691
|
case i.Html: return "h-full overflow-hidden";
|
|
@@ -652,38 +693,38 @@ var de = {
|
|
|
652
693
|
case i.MarkdownTable: return "flex h-full min-h-0 flex-col overflow-hidden p-4";
|
|
653
694
|
default: return "h-full overflow-auto p-4";
|
|
654
695
|
}
|
|
655
|
-
}, [e.type]),
|
|
696
|
+
}, [e.type]), be = F(() => {
|
|
656
697
|
switch (e.type) {
|
|
657
|
-
case i.PlainText: return /* @__PURE__ */
|
|
658
|
-
className: g("whitespace-pre-wrap break-words",
|
|
698
|
+
case i.PlainText: return /* @__PURE__ */ z("pre", {
|
|
699
|
+
className: g("whitespace-pre-wrap break-words", K.body, H?.fontClassName),
|
|
659
700
|
children: e.text
|
|
660
701
|
});
|
|
661
|
-
case i.Image: return /* @__PURE__ */
|
|
702
|
+
case i.Image: return /* @__PURE__ */ z(Ne, {
|
|
662
703
|
url: e.url,
|
|
663
704
|
fileName: r,
|
|
664
705
|
loadErrorLabel: c
|
|
665
706
|
});
|
|
666
|
-
case i.Audio: return /* @__PURE__ */
|
|
707
|
+
case i.Audio: return /* @__PURE__ */ z("audio", {
|
|
667
708
|
controls: !0,
|
|
668
709
|
src: e.url,
|
|
669
710
|
"aria-label": r ?? "Audio attachment",
|
|
670
711
|
className: "w-full max-w-sm",
|
|
671
712
|
preload: "metadata",
|
|
672
|
-
children: e.mimeType && /* @__PURE__ */
|
|
713
|
+
children: e.mimeType && /* @__PURE__ */ z("source", {
|
|
673
714
|
src: e.url,
|
|
674
715
|
type: e.mimeType
|
|
675
716
|
})
|
|
676
717
|
});
|
|
677
|
-
case i.Markdown: return /* @__PURE__ */
|
|
718
|
+
case i.Markdown: return /* @__PURE__ */ z(p, {
|
|
678
719
|
content: e.text,
|
|
679
720
|
isStreaming: !1,
|
|
680
|
-
codeBlockTheme:
|
|
721
|
+
codeBlockTheme: j,
|
|
681
722
|
classNames: u
|
|
682
723
|
});
|
|
683
|
-
case i.MarkdownTable: return /* @__PURE__ */
|
|
724
|
+
case i.MarkdownTable: return /* @__PURE__ */ z(p, {
|
|
684
725
|
content: e.text,
|
|
685
726
|
isStreaming: !1,
|
|
686
|
-
codeBlockTheme:
|
|
727
|
+
codeBlockTheme: j,
|
|
687
728
|
containerClassName: "flex h-full min-h-0 flex-col",
|
|
688
729
|
classNames: {
|
|
689
730
|
...u,
|
|
@@ -691,51 +732,49 @@ var de = {
|
|
|
691
732
|
tableScrollContainer: "max-h-full"
|
|
692
733
|
},
|
|
693
734
|
tableActionLabels: {
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
copiedLabel: ae,
|
|
698
|
-
downloadCsvLabel: A
|
|
735
|
+
copyLabel: te,
|
|
736
|
+
copiedLabel: ne,
|
|
737
|
+
downloadCsvLabel: re
|
|
699
738
|
},
|
|
700
|
-
tableDownloadFilename:
|
|
739
|
+
tableDownloadFilename: M
|
|
701
740
|
});
|
|
702
|
-
case i.Json: return /* @__PURE__ */
|
|
741
|
+
case i.Json: return /* @__PURE__ */ z("div", {
|
|
703
742
|
dir: "ltr",
|
|
704
743
|
className: "h-full overflow-auto",
|
|
705
|
-
children: /* @__PURE__ */
|
|
706
|
-
className: g("m-3 overflow-auto rounded-md border",
|
|
707
|
-
children: /* @__PURE__ */ R
|
|
744
|
+
children: /* @__PURE__ */ z("div", {
|
|
745
|
+
className: g("m-3 overflow-auto rounded-md border", K.jsonWrapper),
|
|
746
|
+
children: /* @__PURE__ */ z(R, {
|
|
708
747
|
data: e.value,
|
|
709
748
|
style: {
|
|
710
749
|
container: g("whitespace-pre-wrap break-words p-2", H?.jsonClassName ?? "dial-code-text"),
|
|
711
|
-
basicChildStyle:
|
|
750
|
+
basicChildStyle: ce.basicChildStyle,
|
|
712
751
|
childFieldsContainer: "m-0 ps-3",
|
|
713
|
-
label: g("me-1 font-semibold",
|
|
714
|
-
clickableLabel: g("me-1 cursor-pointer font-semibold hover:underline",
|
|
715
|
-
nullValue: g("italic",
|
|
716
|
-
undefinedValue: g("italic",
|
|
717
|
-
stringValue:
|
|
718
|
-
booleanValue:
|
|
719
|
-
numberValue:
|
|
720
|
-
otherValue: g("italic",
|
|
721
|
-
punctuation: g("me-1",
|
|
722
|
-
collapseIcon: g("me-1 cursor-pointer select-none transition-colors",
|
|
723
|
-
expandIcon: g("me-1 cursor-pointer select-none transition-colors",
|
|
724
|
-
collapsedContent: g("me-1 cursor-pointer rounded px-1",
|
|
752
|
+
label: g("me-1 font-semibold", K.jsonLabel),
|
|
753
|
+
clickableLabel: g("me-1 cursor-pointer font-semibold hover:underline", K.jsonClickableLabel),
|
|
754
|
+
nullValue: g("italic", K.jsonNullValue),
|
|
755
|
+
undefinedValue: g("italic", K.jsonNullValue),
|
|
756
|
+
stringValue: K.jsonStringValue,
|
|
757
|
+
booleanValue: K.jsonBooleanValue,
|
|
758
|
+
numberValue: K.jsonNumberValue,
|
|
759
|
+
otherValue: g("italic", K.jsonNullValue),
|
|
760
|
+
punctuation: g("me-1", K.jsonPunctuation),
|
|
761
|
+
collapseIcon: g("me-1 cursor-pointer select-none transition-colors", K.jsonCollapseIcon),
|
|
762
|
+
expandIcon: g("me-1 cursor-pointer select-none transition-colors", K.jsonExpandIcon),
|
|
763
|
+
collapsedContent: g("me-1 cursor-pointer rounded px-1", K.jsonCollapsedContent)
|
|
725
764
|
}
|
|
726
765
|
})
|
|
727
766
|
})
|
|
728
767
|
});
|
|
729
|
-
case i.Code: return /* @__PURE__ */
|
|
768
|
+
case i.Code: return /* @__PURE__ */ z(ge, {
|
|
730
769
|
content: e,
|
|
731
|
-
codeBlockTheme:
|
|
770
|
+
codeBlockTheme: j,
|
|
732
771
|
labels: {
|
|
733
772
|
loadingLabel: O,
|
|
734
773
|
errorLabel: k,
|
|
735
774
|
retryLabel: ee
|
|
736
775
|
}
|
|
737
776
|
});
|
|
738
|
-
case i.Html: return /* @__PURE__ */
|
|
777
|
+
case i.Html: return /* @__PURE__ */ z(ve, {
|
|
739
778
|
content: e,
|
|
740
779
|
labels: {
|
|
741
780
|
htmlFrameBlockedLabel: f,
|
|
@@ -743,25 +782,25 @@ var de = {
|
|
|
743
782
|
},
|
|
744
783
|
isSourceView: a,
|
|
745
784
|
title: r,
|
|
746
|
-
codeBlockTheme:
|
|
785
|
+
codeBlockTheme: j
|
|
747
786
|
});
|
|
748
|
-
case i.Pdf: return /* @__PURE__ */
|
|
749
|
-
retryKey:
|
|
750
|
-
onRetry:
|
|
787
|
+
case i.Pdf: return /* @__PURE__ */ z(s, {
|
|
788
|
+
retryKey: fe,
|
|
789
|
+
onRetry: he,
|
|
751
790
|
labels: {
|
|
752
791
|
loadingLabel: x,
|
|
753
792
|
errorLabel: C,
|
|
754
793
|
retryLabel: w
|
|
755
794
|
},
|
|
756
|
-
children: /* @__PURE__ */
|
|
795
|
+
children: /* @__PURE__ */ z(me, {
|
|
757
796
|
fileName: r,
|
|
758
797
|
url: e.url,
|
|
759
798
|
highlights: e.highlights ?? [],
|
|
760
799
|
selectedHighlightId: e.selectedHighlightId,
|
|
761
800
|
selectedPageNumber: e.page,
|
|
762
|
-
loadPdf:
|
|
763
|
-
hideHeader:
|
|
764
|
-
configurePdfWorker:
|
|
801
|
+
loadPdf: se,
|
|
802
|
+
hideHeader: P,
|
|
803
|
+
configurePdfWorker: I,
|
|
765
804
|
labels: {
|
|
766
805
|
thumbnailsLabel: _,
|
|
767
806
|
showThumbnailsLabel: v,
|
|
@@ -773,34 +812,38 @@ var de = {
|
|
|
773
812
|
}
|
|
774
813
|
})
|
|
775
814
|
}, e.url);
|
|
776
|
-
case i.Ooxml: return /* @__PURE__ */
|
|
815
|
+
case i.Ooxml: return /* @__PURE__ */ z(ke, {
|
|
777
816
|
content: e,
|
|
778
817
|
fileName: r,
|
|
779
818
|
loadErrorLabel: c,
|
|
780
|
-
formulaLabel:
|
|
819
|
+
formulaLabel: T,
|
|
781
820
|
formulaLabelClassName: H?.xlsxFormulaLabelClassName ?? "dial-italic-text",
|
|
782
|
-
highlightsLabel:
|
|
783
|
-
highlightNavigatedLabel:
|
|
821
|
+
highlightsLabel: ae,
|
|
822
|
+
highlightNavigatedLabel: oe
|
|
784
823
|
});
|
|
785
|
-
case i.Visualizer:
|
|
824
|
+
case i.Visualizer:
|
|
825
|
+
case i.GroupedVisualizer: return /* @__PURE__ */ z(je, {
|
|
786
826
|
content: e,
|
|
787
827
|
errorLabel: d
|
|
788
828
|
});
|
|
789
|
-
case i.McpApp: return /* @__PURE__ */
|
|
790
|
-
|
|
791
|
-
|
|
829
|
+
case i.McpApp: return /* @__PURE__ */ z(we, {
|
|
830
|
+
content: e,
|
|
831
|
+
onAppInfo: le
|
|
832
|
+
});
|
|
833
|
+
case i.Unsupported: return /* @__PURE__ */ z("p", {
|
|
834
|
+
className: g("text-center", K.statusLabel),
|
|
792
835
|
children: o
|
|
793
836
|
});
|
|
794
837
|
case i.Error: {
|
|
795
838
|
let t = e.errorType === n.Forbidden;
|
|
796
|
-
return /* @__PURE__ */
|
|
839
|
+
return /* @__PURE__ */ B("div", {
|
|
797
840
|
className: "flex flex-col items-center gap-2",
|
|
798
|
-
children: [
|
|
841
|
+
children: [z(t ? ie : D, {
|
|
799
842
|
size: 60,
|
|
800
843
|
stroke: S,
|
|
801
|
-
className:
|
|
802
|
-
}), /* @__PURE__ */
|
|
803
|
-
className: g("text-center",
|
|
844
|
+
className: K.errorIcon
|
|
845
|
+
}), /* @__PURE__ */ z("p", {
|
|
846
|
+
className: g("text-center", K.statusLabel),
|
|
804
847
|
children: t ? l : c
|
|
805
848
|
})]
|
|
806
849
|
});
|
|
@@ -812,7 +855,7 @@ var de = {
|
|
|
812
855
|
H?.jsonClassName,
|
|
813
856
|
H?.xlsxFormulaLabelClassName,
|
|
814
857
|
r,
|
|
815
|
-
|
|
858
|
+
j,
|
|
816
859
|
o,
|
|
817
860
|
c,
|
|
818
861
|
l,
|
|
@@ -820,10 +863,11 @@ var de = {
|
|
|
820
863
|
f,
|
|
821
864
|
h,
|
|
822
865
|
a,
|
|
823
|
-
|
|
824
|
-
|
|
866
|
+
M,
|
|
867
|
+
se,
|
|
868
|
+
P,
|
|
869
|
+
I,
|
|
825
870
|
le,
|
|
826
|
-
ue,
|
|
827
871
|
_,
|
|
828
872
|
v,
|
|
829
873
|
y,
|
|
@@ -831,202 +875,219 @@ var de = {
|
|
|
831
875
|
x,
|
|
832
876
|
C,
|
|
833
877
|
w,
|
|
834
|
-
|
|
878
|
+
T,
|
|
835
879
|
O,
|
|
836
880
|
k,
|
|
837
881
|
ee,
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
882
|
+
me,
|
|
883
|
+
fe,
|
|
884
|
+
he,
|
|
841
885
|
te,
|
|
886
|
+
ne,
|
|
842
887
|
re,
|
|
843
|
-
ie,
|
|
844
888
|
ae,
|
|
845
|
-
|
|
846
|
-
j,
|
|
847
|
-
N
|
|
889
|
+
oe
|
|
848
890
|
]);
|
|
849
|
-
return /* @__PURE__ */
|
|
850
|
-
style: !t &&
|
|
851
|
-
className: g(t ? "flex h-full items-center justify-center" : ye,
|
|
852
|
-
children: t ? /* @__PURE__ */
|
|
891
|
+
return /* @__PURE__ */ z("div", {
|
|
892
|
+
style: !t && Pe.has(e.type) ? _e : void 0,
|
|
893
|
+
className: g(t ? "flex h-full items-center justify-center" : ye, ue),
|
|
894
|
+
children: t ? /* @__PURE__ */ z(E, {}) : be
|
|
853
895
|
});
|
|
854
|
-
}),
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
896
|
+
}), Ie = {
|
|
897
|
+
mcpAppDivider: "_mcpAppDivider_1jh5p_1",
|
|
898
|
+
mcpAppVersion: "_mcpAppVersion_1jh5p_5"
|
|
899
|
+
}, Le = 2e3, Re = M(({ isOpen: e, isLoading: t = !1, onClose: n, content: r, fileName: a, labels: { ariaLabel: s, closeLabel: c = "Close", resizeLabel: l = "Resize panel", downloadLabel: u = "Download", copyTextLabel: d = "Copy text", copiedTextLabel: f = "Copied!", copyMarkdownLabel: p = "Copy as Markdown", copiedMarkdownLabel: h = "Copied!", copyJsonLabel: _ = "Copy as JSON", copiedJsonLabel: v = "Copied!", visualizerErrorLabel: C, unsupportedLabel: T = "Preview is not supported for this file", loadErrorLabel: E = "Failed to load file", forbiddenErrorLabel: D = "You don't have permission to access this file", htmlFrameBlockedLabel: O = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: ie = "Open in new tab", htmlViewSourceLabel: A = "View source", htmlViewRenderedLabel: j = "View rendered", mcpAppReloadLabel: M = "Reload", pdfThumbnailsLabel: se, pdfShowThumbnailsLabel: R, pdfHideThumbnailsLabel: ce, pdfPageNumberLabel: V, pdfContentLoadingLabel: H, pdfContentErrorLabel: ue, pdfContentRetryLabel: de, xlsxFormulaLabel: fe, codeContentLoadingLabel: me, codeContentErrorLabel: he, codeContentRetryLabel: U, tableCopyLabel: ge, tableCopiedLabel: _e, tableDownloadCsvLabel: ve, ooxmlHighlightsLabel: ye, ooxmlHighlightNavigatedLabel: be }, onDownload: xe, onCopyText: Se, onCopyMarkdown: Ce, onCopyJson: W, tableDownloadFilename: we, isMobile: G = !1, defaultWidth: Te, minWidth: Ee = 600, maxWidth: De = 1500, onResizeStop: Oe, styles: ke, codeBlockTheme: Ae, loadPdf: je, configurePdfWorker: K }) => {
|
|
900
|
+
let [Me, Ne] = L(!1), [Pe, Re] = L(!1), [ze, q] = L(!1), [J, Be] = L(!1), [Ve, He] = L(void 0), Y = I(null), X = I(null), Z = I(null), Ue = N(() => {
|
|
901
|
+
Se?.(), Y.current != null && clearTimeout(Y.current), Ne(!0), Y.current = setTimeout(() => Ne(!1), Le);
|
|
902
|
+
}, [Se]), We = N(() => {
|
|
903
|
+
Ce?.(), X.current != null && clearTimeout(X.current), Re(!0), X.current = setTimeout(() => Re(!1), Le);
|
|
904
|
+
}, [Ce]), Ge = N(() => {
|
|
905
|
+
W?.(), Z.current != null && clearTimeout(Z.current), q(!0), Z.current = setTimeout(() => q(!1), Le);
|
|
906
|
+
}, [W]);
|
|
862
907
|
P(() => () => {
|
|
863
|
-
|
|
908
|
+
Y.current != null && clearTimeout(Y.current), X.current != null && clearTimeout(X.current), Z.current != null && clearTimeout(Z.current);
|
|
864
909
|
}, []);
|
|
865
|
-
let
|
|
866
|
-
|
|
910
|
+
let Ke = N(() => {
|
|
911
|
+
Be((e) => !e);
|
|
867
912
|
}, []);
|
|
868
913
|
P(() => {
|
|
869
|
-
|
|
914
|
+
Be(!1), He(void 0);
|
|
870
915
|
}, [r]);
|
|
871
|
-
let { className:
|
|
872
|
-
|
|
916
|
+
let { className: Q, panelStyles: qe, ...Je } = ke ?? {}, { colors: $, typography: Ye } = Je, Xe = F(() => m({
|
|
917
|
+
"--ac-mcp-app-divider": $?.mcpAppDividerColor,
|
|
918
|
+
"--ac-mcp-app-version": $?.mcpAppVersionColor
|
|
919
|
+
}), [$?.mcpAppDividerColor, $?.mcpAppVersionColor]), Ze = r.type === i.McpApp && Ve != null ? /* @__PURE__ */ B("span", {
|
|
920
|
+
style: Xe,
|
|
921
|
+
children: [
|
|
922
|
+
/* @__PURE__ */ z("span", { children: a }),
|
|
923
|
+
/* @__PURE__ */ z("span", {
|
|
924
|
+
"aria-hidden": !0,
|
|
925
|
+
className: g("mx-1.5 inline-block h-3 w-0 border-s align-middle", Ie.mcpAppDivider)
|
|
926
|
+
}),
|
|
927
|
+
/* @__PURE__ */ z("span", { children: Ve.name }),
|
|
928
|
+
Ve.version && /* @__PURE__ */ z("span", {
|
|
929
|
+
className: g("ms-2", Ye?.mcpAppVersionClassName ?? "dial-caption-text", Ie.mcpAppVersion),
|
|
930
|
+
children: Ve.version
|
|
931
|
+
})
|
|
932
|
+
]
|
|
933
|
+
}) : a, Qe = !t && r.type === i.Html && r.srcdoc != null, $e = !t && Se != null && (r.type === i.PlainText || r.type === i.Code), et = !t && Ce != null && r.type === i.Markdown, tt = !t && W != null && r.type === i.Json, nt = !t && xe != null && o(r), rt = !t && r.type === i.McpApp && r.onReload != null;
|
|
934
|
+
return /* @__PURE__ */ z(b, {
|
|
873
935
|
isOpen: e,
|
|
874
936
|
orientation: y.Right,
|
|
875
|
-
title:
|
|
937
|
+
title: Ze,
|
|
876
938
|
labels: {
|
|
877
939
|
ariaLabel: s,
|
|
878
940
|
closeLabel: c,
|
|
879
941
|
resizeLabel: l
|
|
880
942
|
},
|
|
881
943
|
onClose: n,
|
|
882
|
-
resizable: !
|
|
883
|
-
defaultWidth:
|
|
884
|
-
minWidth:
|
|
885
|
-
maxWidth:
|
|
886
|
-
onResizeStop:
|
|
944
|
+
resizable: !G,
|
|
945
|
+
defaultWidth: Te,
|
|
946
|
+
minWidth: Ee,
|
|
947
|
+
maxWidth: De,
|
|
948
|
+
onResizeStop: Oe,
|
|
887
949
|
styles: {
|
|
888
|
-
...
|
|
889
|
-
titleClassName:
|
|
890
|
-
headerClassName: g("border-b border-tertiary",
|
|
891
|
-
className: g(e ? "mobile:w-full mobile:max-w-full" : "w-0",
|
|
950
|
+
...qe,
|
|
951
|
+
titleClassName: qe?.titleClassName ?? "dial-h3-text",
|
|
952
|
+
headerClassName: g("border-b border-tertiary", qe?.headerClassName),
|
|
953
|
+
className: g(e ? "mobile:w-full mobile:max-w-full" : "w-0", Q, qe?.className, pe.panel)
|
|
892
954
|
},
|
|
893
|
-
rightActions:
|
|
894
|
-
|
|
895
|
-
icon: /* @__PURE__ */
|
|
955
|
+
rightActions: Qe || $e || et || tt || nt || rt ? /* @__PURE__ */ B(le, { children: [
|
|
956
|
+
rt && /* @__PURE__ */ z(w, {
|
|
957
|
+
icon: /* @__PURE__ */ z(oe, {
|
|
896
958
|
size: x.LG,
|
|
897
959
|
stroke: S,
|
|
898
960
|
"aria-hidden": !0
|
|
899
961
|
}),
|
|
900
|
-
"aria-label":
|
|
901
|
-
tooltipProps: { tooltip:
|
|
962
|
+
"aria-label": M,
|
|
963
|
+
tooltipProps: { tooltip: M },
|
|
902
964
|
onClick: r.type === i.McpApp ? r.onReload : void 0
|
|
903
965
|
}),
|
|
904
|
-
|
|
905
|
-
icon:
|
|
966
|
+
Qe && /* @__PURE__ */ z(w, {
|
|
967
|
+
icon: z(J ? re : ee, {
|
|
906
968
|
size: x.LG,
|
|
907
969
|
stroke: S,
|
|
908
970
|
"aria-hidden": !0
|
|
909
971
|
}),
|
|
910
|
-
"aria-label":
|
|
911
|
-
"aria-pressed":
|
|
912
|
-
tooltipProps: { tooltip:
|
|
913
|
-
onClick:
|
|
972
|
+
"aria-label": J ? j : A,
|
|
973
|
+
"aria-pressed": J,
|
|
974
|
+
tooltipProps: { tooltip: J ? j : A },
|
|
975
|
+
onClick: Ke
|
|
914
976
|
}),
|
|
915
|
-
|
|
916
|
-
icon:
|
|
977
|
+
$e && /* @__PURE__ */ z(w, {
|
|
978
|
+
icon: z(Me ? k : te, {
|
|
917
979
|
size: x.LG,
|
|
918
980
|
stroke: S,
|
|
919
981
|
"aria-hidden": !0
|
|
920
982
|
}),
|
|
921
|
-
"aria-label":
|
|
922
|
-
tooltipProps: { tooltip:
|
|
923
|
-
onClick:
|
|
983
|
+
"aria-label": Me ? f : d,
|
|
984
|
+
tooltipProps: { tooltip: Me ? f : d },
|
|
985
|
+
onClick: Ue
|
|
924
986
|
}),
|
|
925
|
-
|
|
926
|
-
icon:
|
|
987
|
+
et && /* @__PURE__ */ z(w, {
|
|
988
|
+
icon: z(Pe ? k : ae, {
|
|
927
989
|
size: x.LG,
|
|
928
990
|
stroke: S,
|
|
929
991
|
"aria-hidden": !0
|
|
930
992
|
}),
|
|
931
|
-
"aria-label": Pe ?
|
|
932
|
-
tooltipProps: { tooltip: Pe ?
|
|
933
|
-
onClick:
|
|
993
|
+
"aria-label": Pe ? h : p,
|
|
994
|
+
tooltipProps: { tooltip: Pe ? h : p },
|
|
995
|
+
onClick: We
|
|
934
996
|
}),
|
|
935
|
-
|
|
936
|
-
icon:
|
|
997
|
+
tt && /* @__PURE__ */ z(w, {
|
|
998
|
+
icon: z(ze ? k : te, {
|
|
937
999
|
size: x.LG,
|
|
938
1000
|
stroke: S,
|
|
939
1001
|
"aria-hidden": !0
|
|
940
1002
|
}),
|
|
941
|
-
"aria-label":
|
|
942
|
-
tooltipProps: { tooltip:
|
|
943
|
-
onClick:
|
|
1003
|
+
"aria-label": ze ? v : _,
|
|
1004
|
+
tooltipProps: { tooltip: ze ? v : _ },
|
|
1005
|
+
onClick: Ge
|
|
944
1006
|
}),
|
|
945
|
-
|
|
946
|
-
icon: /* @__PURE__ */
|
|
1007
|
+
nt && /* @__PURE__ */ z(w, {
|
|
1008
|
+
icon: /* @__PURE__ */ z(ne, {
|
|
947
1009
|
size: x.LG,
|
|
948
1010
|
stroke: S
|
|
949
1011
|
}),
|
|
950
1012
|
"aria-label": u,
|
|
951
1013
|
tooltipProps: { tooltip: u },
|
|
952
|
-
onClick:
|
|
1014
|
+
onClick: xe
|
|
953
1015
|
})
|
|
954
1016
|
] }) : null,
|
|
955
|
-
children: /* @__PURE__ */
|
|
1017
|
+
children: /* @__PURE__ */ z(Fe, {
|
|
956
1018
|
content: r,
|
|
957
1019
|
isLoading: t,
|
|
958
1020
|
fileName: a,
|
|
959
|
-
isHtmlSourceView:
|
|
1021
|
+
isHtmlSourceView: J,
|
|
1022
|
+
onAppInfo: r.type === i.McpApp ? He : void 0,
|
|
960
1023
|
labels: {
|
|
961
|
-
unsupportedLabel:
|
|
962
|
-
loadErrorLabel:
|
|
963
|
-
forbiddenErrorLabel:
|
|
964
|
-
visualizerErrorLabel:
|
|
965
|
-
htmlFrameBlockedLabel:
|
|
966
|
-
htmlOpenInNewTabLabel:
|
|
967
|
-
pdfThumbnailsLabel:
|
|
968
|
-
pdfShowThumbnailsLabel:
|
|
969
|
-
pdfHideThumbnailsLabel:
|
|
970
|
-
pdfPageNumberLabel:
|
|
971
|
-
pdfContentLoadingLabel:
|
|
1024
|
+
unsupportedLabel: T,
|
|
1025
|
+
loadErrorLabel: E,
|
|
1026
|
+
forbiddenErrorLabel: D,
|
|
1027
|
+
visualizerErrorLabel: C,
|
|
1028
|
+
htmlFrameBlockedLabel: O,
|
|
1029
|
+
htmlOpenInNewTabLabel: ie,
|
|
1030
|
+
pdfThumbnailsLabel: se,
|
|
1031
|
+
pdfShowThumbnailsLabel: R,
|
|
1032
|
+
pdfHideThumbnailsLabel: ce,
|
|
1033
|
+
pdfPageNumberLabel: V,
|
|
1034
|
+
pdfContentLoadingLabel: H,
|
|
972
1035
|
pdfContentErrorLabel: ue,
|
|
973
|
-
pdfContentRetryLabel:
|
|
974
|
-
xlsxFormulaLabel:
|
|
975
|
-
codeContentLoadingLabel:
|
|
976
|
-
codeContentErrorLabel:
|
|
1036
|
+
pdfContentRetryLabel: de,
|
|
1037
|
+
xlsxFormulaLabel: fe,
|
|
1038
|
+
codeContentLoadingLabel: me,
|
|
1039
|
+
codeContentErrorLabel: he,
|
|
977
1040
|
codeContentRetryLabel: U,
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
ooxmlHighlightsLabel: W,
|
|
984
|
-
ooxmlHighlightNavigatedLabel: ve
|
|
1041
|
+
tableCopyLabel: ge,
|
|
1042
|
+
tableCopiedLabel: _e,
|
|
1043
|
+
tableDownloadCsvLabel: ve,
|
|
1044
|
+
ooxmlHighlightsLabel: ye,
|
|
1045
|
+
ooxmlHighlightNavigatedLabel: be
|
|
985
1046
|
},
|
|
986
|
-
styles:
|
|
987
|
-
codeBlockTheme:
|
|
988
|
-
tableDownloadFilename:
|
|
989
|
-
loadPdf:
|
|
990
|
-
configurePdfWorker:
|
|
1047
|
+
styles: Je,
|
|
1048
|
+
codeBlockTheme: Ae,
|
|
1049
|
+
tableDownloadFilename: we,
|
|
1050
|
+
loadPdf: je,
|
|
1051
|
+
configurePdfWorker: K
|
|
991
1052
|
})
|
|
992
1053
|
});
|
|
993
|
-
}),
|
|
1054
|
+
}), ze = new Set(["html", "htm"]), q = {
|
|
994
1055
|
docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
995
1056
|
xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
996
1057
|
pptx: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
997
|
-
},
|
|
1058
|
+
}, 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(".")), Be = {
|
|
998
1059
|
docx: r.Docx,
|
|
999
1060
|
xlsx: r.Xlsx,
|
|
1000
1061
|
pptx: r.Pptx,
|
|
1001
1062
|
csv: r.Csv
|
|
1002
|
-
},
|
|
1003
|
-
[
|
|
1004
|
-
[
|
|
1005
|
-
[
|
|
1063
|
+
}, Ve = {
|
|
1064
|
+
[q.docx]: r.Docx,
|
|
1065
|
+
[q.xlsx]: r.Xlsx,
|
|
1066
|
+
[q.pptx]: r.Pptx,
|
|
1006
1067
|
[f.CSV]: r.Csv
|
|
1007
|
-
},
|
|
1008
|
-
[r.Docx]:
|
|
1009
|
-
[r.Xlsx]:
|
|
1010
|
-
[r.Pptx]:
|
|
1068
|
+
}, He = {
|
|
1069
|
+
[r.Docx]: q.docx,
|
|
1070
|
+
[r.Xlsx]: q.xlsx,
|
|
1071
|
+
[r.Pptx]: q.pptx,
|
|
1011
1072
|
[r.Csv]: f.CSV
|
|
1012
|
-
},
|
|
1073
|
+
}, Y = (e, t) => {
|
|
1013
1074
|
let n = t?.split(";", 1)[0].trim().toLowerCase();
|
|
1014
1075
|
if (n != null) {
|
|
1015
|
-
let e =
|
|
1076
|
+
let e = Ve[n];
|
|
1016
1077
|
if (e != null) return e;
|
|
1017
1078
|
}
|
|
1018
1079
|
let r = e.lastIndexOf(".");
|
|
1019
|
-
if (r !== -1) return
|
|
1020
|
-
},
|
|
1021
|
-
let n =
|
|
1022
|
-
return n == null ? void 0 :
|
|
1023
|
-
},
|
|
1080
|
+
if (r !== -1) return Be[e.slice(r + 1).toLowerCase()];
|
|
1081
|
+
}, X = (e, t) => Y(e, t) != null, Z = (e, t) => {
|
|
1082
|
+
let n = Y(e, t);
|
|
1083
|
+
return n == null ? void 0 : He[n];
|
|
1084
|
+
}, Ue = (e) => {
|
|
1024
1085
|
let t = e.lastIndexOf(".");
|
|
1025
|
-
return t === -1 ? !1 :
|
|
1026
|
-
},
|
|
1086
|
+
return t === -1 ? !1 : J.has(e.slice(t + 1).toLowerCase());
|
|
1087
|
+
}, We = (e) => {
|
|
1027
1088
|
let t = e.lastIndexOf(".");
|
|
1028
|
-
return t === -1 ? !1 :
|
|
1029
|
-
},
|
|
1089
|
+
return t === -1 ? !1 : ze.has(e.slice(t + 1).toLowerCase());
|
|
1090
|
+
}, Ge = {
|
|
1030
1091
|
xml: "xml",
|
|
1031
1092
|
csv: "plaintext",
|
|
1032
1093
|
tsv: "plaintext",
|
|
@@ -1074,39 +1135,39 @@ var de = {
|
|
|
1074
1135
|
gitignore: "plaintext",
|
|
1075
1136
|
dockerfile: "plaintext",
|
|
1076
1137
|
makefile: "plaintext"
|
|
1077
|
-
},
|
|
1138
|
+
}, Ke = (e) => Ge[e], Q = (e) => ({
|
|
1078
1139
|
type: i.Unsupported,
|
|
1079
1140
|
...e != null && { url: e }
|
|
1080
|
-
}),
|
|
1141
|
+
}), qe = (e) => ({
|
|
1081
1142
|
type: i.Error,
|
|
1082
1143
|
errorType: n.LoadFailed,
|
|
1083
1144
|
...e != null && { url: e }
|
|
1084
|
-
}),
|
|
1145
|
+
}), Je = (e) => ({
|
|
1085
1146
|
type: i.Error,
|
|
1086
1147
|
errorType: n.Forbidden,
|
|
1087
1148
|
...e != null && { url: e }
|
|
1088
|
-
}),
|
|
1149
|
+
}), $ = (e) => {
|
|
1089
1150
|
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;
|
|
1090
|
-
},
|
|
1091
|
-
let t =
|
|
1151
|
+
}, Ye = (e) => {
|
|
1152
|
+
let t = $(e);
|
|
1092
1153
|
t != null && URL.revokeObjectURL(t);
|
|
1093
|
-
},
|
|
1154
|
+
}, Xe = {
|
|
1094
1155
|
type: i.PlainText,
|
|
1095
1156
|
text: ""
|
|
1096
|
-
},
|
|
1097
|
-
|
|
1098
|
-
var
|
|
1099
|
-
let [t, n] = L(!1), [r, i] = L(!1), [a, o] = L(
|
|
1157
|
+
}, Ze = A(void 0);
|
|
1158
|
+
Ze.displayName = "AttachmentCanvasContext";
|
|
1159
|
+
var Qe = ({ children: e }) => {
|
|
1160
|
+
let [t, n] = L(!1), [r, i] = L(!1), [a, o] = L(Xe), [s, c] = L(void 0), [l, u] = L(void 0), d = N((e, t) => {
|
|
1100
1161
|
c(e), u(t), i(!0), n(!0);
|
|
1101
|
-
}, []), f =
|
|
1162
|
+
}, []), f = N((e, t, r) => {
|
|
1102
1163
|
o(e), c(t), u(r), i(!1), n(!0);
|
|
1103
|
-
}, []), p =
|
|
1104
|
-
o(
|
|
1164
|
+
}, []), p = N(() => {
|
|
1165
|
+
o(Xe), n(!1), i(!1), u(void 0);
|
|
1105
1166
|
}, []);
|
|
1106
1167
|
return P(() => () => {
|
|
1107
|
-
let e =
|
|
1168
|
+
let e = $(a);
|
|
1108
1169
|
e != null && URL.revokeObjectURL(e);
|
|
1109
|
-
}, [a]), /* @__PURE__ */
|
|
1170
|
+
}, [a]), /* @__PURE__ */ z(Ze.Provider, {
|
|
1110
1171
|
value: F(() => ({
|
|
1111
1172
|
isOpen: t,
|
|
1112
1173
|
isLoading: r,
|
|
@@ -1128,77 +1189,134 @@ var Je = ({ children: e }) => {
|
|
|
1128
1189
|
]),
|
|
1129
1190
|
children: e
|
|
1130
1191
|
});
|
|
1131
|
-
},
|
|
1132
|
-
let e =
|
|
1192
|
+
}, $e = () => {
|
|
1193
|
+
let e = se(Ze);
|
|
1133
1194
|
if (!e) throw Error("useAttachmentCanvas must be used within an AttachmentCanvasProvider");
|
|
1134
1195
|
return e;
|
|
1135
|
-
},
|
|
1136
|
-
let { ariaLabel:
|
|
1137
|
-
a(
|
|
1138
|
-
}, [
|
|
1139
|
-
(
|
|
1140
|
-
}, [
|
|
1141
|
-
|
|
1142
|
-
}, [
|
|
1143
|
-
|
|
1144
|
-
}, [
|
|
1145
|
-
return /* @__PURE__ */
|
|
1146
|
-
isOpen:
|
|
1147
|
-
isLoading:
|
|
1196
|
+
}, et = M(({ labels: e, isMobile: t = !1, defaultWidth: n, maxWidth: r, codeBlockTheme: o, tableDownloadFilename: s, loadPdf: c, configurePdfWorker: l }) => {
|
|
1197
|
+
let { ariaLabel: u = "Attachment preview", closeLabel: d = "Close", downloadLabel: f = "Download", unsupportedLabel: p = "Preview is not supported for this file", loadErrorLabel: m = "Failed to load file", forbiddenErrorLabel: g = "You don't have permission to access this file", copyTextLabel: _, copiedTextLabel: v, copyMarkdownLabel: y, copiedMarkdownLabel: b, copyJsonLabel: x, copiedJsonLabel: S, htmlFrameBlockedLabel: C, htmlOpenInNewTabLabel: w, htmlViewSourceLabel: T, htmlViewRenderedLabel: E, pdfThumbnailsLabel: D, pdfShowThumbnailsLabel: O, pdfHideThumbnailsLabel: k, pdfPageNumberLabel: ee, pdfContentLoadingLabel: te, pdfContentErrorLabel: ne, pdfContentRetryLabel: re, xlsxFormulaLabel: ie, codeContentLoadingLabel: ae, codeContentErrorLabel: oe, codeContentRetryLabel: A, tableCopyLabel: j, tableCopiedLabel: M, tableDownloadCsvLabel: se, ooxmlHighlightsLabel: P, ooxmlHighlightNavigatedLabel: F } = e ?? {}, { isOpen: I, isLoading: L, content: R, fileName: ce, closeCanvas: le } = $e(), B = N(() => {
|
|
1198
|
+
a(R, ce);
|
|
1199
|
+
}, [R, ce]), V = N(() => {
|
|
1200
|
+
(R.type === i.PlainText || R.type === i.Code) && h(R.text);
|
|
1201
|
+
}, [R]), H = N(() => {
|
|
1202
|
+
R.type === i.Markdown && h(R.text);
|
|
1203
|
+
}, [R]), ue = N(() => {
|
|
1204
|
+
R.type === i.Json && h(JSON.stringify(R.value, null, 2));
|
|
1205
|
+
}, [R]);
|
|
1206
|
+
return /* @__PURE__ */ z(Re, {
|
|
1207
|
+
isOpen: I,
|
|
1208
|
+
isLoading: L,
|
|
1148
1209
|
onClose: le,
|
|
1149
|
-
content:
|
|
1150
|
-
fileName:
|
|
1210
|
+
content: R,
|
|
1211
|
+
fileName: ce,
|
|
1151
1212
|
labels: {
|
|
1152
|
-
ariaLabel:
|
|
1153
|
-
closeLabel:
|
|
1154
|
-
downloadLabel:
|
|
1155
|
-
copyTextLabel:
|
|
1156
|
-
copiedTextLabel:
|
|
1157
|
-
copyMarkdownLabel:
|
|
1158
|
-
copiedMarkdownLabel:
|
|
1159
|
-
copyJsonLabel:
|
|
1160
|
-
copiedJsonLabel:
|
|
1161
|
-
unsupportedLabel:
|
|
1162
|
-
loadErrorLabel:
|
|
1163
|
-
forbiddenErrorLabel:
|
|
1164
|
-
htmlFrameBlockedLabel:
|
|
1165
|
-
htmlOpenInNewTabLabel:
|
|
1166
|
-
htmlViewSourceLabel:
|
|
1167
|
-
htmlViewRenderedLabel:
|
|
1168
|
-
pdfThumbnailsLabel:
|
|
1169
|
-
pdfShowThumbnailsLabel:
|
|
1170
|
-
pdfHideThumbnailsLabel:
|
|
1171
|
-
pdfPageNumberLabel:
|
|
1172
|
-
pdfContentLoadingLabel:
|
|
1173
|
-
pdfContentErrorLabel:
|
|
1174
|
-
pdfContentRetryLabel:
|
|
1175
|
-
xlsxFormulaLabel:
|
|
1176
|
-
codeContentLoadingLabel:
|
|
1177
|
-
codeContentErrorLabel:
|
|
1213
|
+
ariaLabel: u,
|
|
1214
|
+
closeLabel: d,
|
|
1215
|
+
downloadLabel: f,
|
|
1216
|
+
copyTextLabel: _,
|
|
1217
|
+
copiedTextLabel: v,
|
|
1218
|
+
copyMarkdownLabel: y,
|
|
1219
|
+
copiedMarkdownLabel: b,
|
|
1220
|
+
copyJsonLabel: x,
|
|
1221
|
+
copiedJsonLabel: S,
|
|
1222
|
+
unsupportedLabel: p,
|
|
1223
|
+
loadErrorLabel: m,
|
|
1224
|
+
forbiddenErrorLabel: g,
|
|
1225
|
+
htmlFrameBlockedLabel: C,
|
|
1226
|
+
htmlOpenInNewTabLabel: w,
|
|
1227
|
+
htmlViewSourceLabel: T,
|
|
1228
|
+
htmlViewRenderedLabel: E,
|
|
1229
|
+
pdfThumbnailsLabel: D,
|
|
1230
|
+
pdfShowThumbnailsLabel: O,
|
|
1231
|
+
pdfHideThumbnailsLabel: k,
|
|
1232
|
+
pdfPageNumberLabel: ee,
|
|
1233
|
+
pdfContentLoadingLabel: te,
|
|
1234
|
+
pdfContentErrorLabel: ne,
|
|
1235
|
+
pdfContentRetryLabel: re,
|
|
1236
|
+
xlsxFormulaLabel: ie,
|
|
1237
|
+
codeContentLoadingLabel: ae,
|
|
1238
|
+
codeContentErrorLabel: oe,
|
|
1178
1239
|
codeContentRetryLabel: A,
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
ooxmlHighlightsLabel: L,
|
|
1185
|
-
ooxmlHighlightNavigatedLabel: oe
|
|
1240
|
+
tableCopyLabel: j,
|
|
1241
|
+
tableCopiedLabel: M,
|
|
1242
|
+
tableDownloadCsvLabel: se,
|
|
1243
|
+
ooxmlHighlightsLabel: P,
|
|
1244
|
+
ooxmlHighlightNavigatedLabel: F
|
|
1186
1245
|
},
|
|
1187
|
-
onDownload:
|
|
1188
|
-
onCopyText:
|
|
1189
|
-
onCopyMarkdown:
|
|
1190
|
-
onCopyJson:
|
|
1246
|
+
onDownload: B,
|
|
1247
|
+
onCopyText: R.type === i.PlainText || R.type === i.Code ? V : void 0,
|
|
1248
|
+
onCopyMarkdown: R.type === i.Markdown ? H : void 0,
|
|
1249
|
+
onCopyJson: R.type === i.Json ? ue : void 0,
|
|
1191
1250
|
tableDownloadFilename: s,
|
|
1192
1251
|
isMobile: t,
|
|
1193
1252
|
defaultWidth: n,
|
|
1194
1253
|
maxWidth: r,
|
|
1195
1254
|
codeBlockTheme: o,
|
|
1196
|
-
configurePdfWorker:
|
|
1255
|
+
configurePdfWorker: l,
|
|
1256
|
+
loadPdf: c
|
|
1197
1257
|
});
|
|
1198
|
-
}),
|
|
1258
|
+
}), tt = {
|
|
1259
|
+
frame: "_frame_g47g7_1",
|
|
1260
|
+
header: "_header_g47g7_6",
|
|
1261
|
+
title: "_title_g47g7_10"
|
|
1262
|
+
}, nt = M(({ content: e, height: t, onExpand: n, expandAriaLabel: r, actionsGroupAriaLabel: i = "Visualizer actions", frameTitle: a, loadingLabel: o, errorLabel: s, titleClassName: c = "dial-small-semi-text", colors: l }) => {
|
|
1263
|
+
let u = e.visualizerName.trim();
|
|
1264
|
+
return /* @__PURE__ */ B("div", {
|
|
1265
|
+
className: g("flex w-full min-w-0 flex-col overflow-hidden rounded-xl border", tt.frame),
|
|
1266
|
+
style: m({
|
|
1267
|
+
"--igv-bg": l?.background,
|
|
1268
|
+
"--igv-border": l?.border,
|
|
1269
|
+
"--igv-title-text": l?.titleText
|
|
1270
|
+
}),
|
|
1271
|
+
children: [/* @__PURE__ */ B("div", {
|
|
1272
|
+
className: g("flex min-h-10 items-center justify-between gap-2 border-b px-4 py-2", tt.header),
|
|
1273
|
+
children: [/* @__PURE__ */ z("span", {
|
|
1274
|
+
className: g("min-w-0 truncate", c, tt.title),
|
|
1275
|
+
children: u
|
|
1276
|
+
}), /* @__PURE__ */ z("div", {
|
|
1277
|
+
role: "toolbar",
|
|
1278
|
+
"aria-label": i,
|
|
1279
|
+
className: "flex items-center gap-1",
|
|
1280
|
+
children: /* @__PURE__ */ z(w, {
|
|
1281
|
+
icon: /* @__PURE__ */ z(O, {
|
|
1282
|
+
size: x.SM,
|
|
1283
|
+
stroke: S,
|
|
1284
|
+
"aria-hidden": !0
|
|
1285
|
+
}),
|
|
1286
|
+
"aria-label": r,
|
|
1287
|
+
size: C.Small,
|
|
1288
|
+
onClick: n
|
|
1289
|
+
})
|
|
1290
|
+
})]
|
|
1291
|
+
}), /* @__PURE__ */ z("div", {
|
|
1292
|
+
className: "w-full",
|
|
1293
|
+
style: { height: `${t}px` },
|
|
1294
|
+
children: /* @__PURE__ */ z(je, {
|
|
1295
|
+
content: e,
|
|
1296
|
+
loadingLabel: o,
|
|
1297
|
+
errorLabel: s,
|
|
1298
|
+
frameTitle: a
|
|
1299
|
+
})
|
|
1300
|
+
})]
|
|
1301
|
+
});
|
|
1302
|
+
}), rt = (e, t) => {
|
|
1199
1303
|
let n = e.toLowerCase();
|
|
1200
1304
|
return t.find((e) => e.contentType.split(",").some((e) => e.trim().toLowerCase() === n && e.trim() !== ""));
|
|
1201
|
-
},
|
|
1305
|
+
}, it = (e, t) => {
|
|
1306
|
+
if (!(e == null || e === "")) return Object.prototype.hasOwnProperty.call(t, e) ? t[e] : void 0;
|
|
1307
|
+
}, at = (e) => `${e}:grouped-visualizer`, ot = (e, t) => {
|
|
1308
|
+
let n = (t.contentType ?? "").split(",").map((e) => e.trim().toLowerCase()).filter((e) => e !== ""), r = [], i = [];
|
|
1309
|
+
return e.forEach((e) => {
|
|
1310
|
+
if (e.url != null && e.url !== "" && (n.length === 0 || n.includes(e.contentType.toLowerCase()))) {
|
|
1311
|
+
r.push(e);
|
|
1312
|
+
return;
|
|
1313
|
+
}
|
|
1314
|
+
i.push(e);
|
|
1315
|
+
}), {
|
|
1316
|
+
claimed: r,
|
|
1317
|
+
unclaimed: i
|
|
1318
|
+
};
|
|
1319
|
+
}, st = (e) => {
|
|
1202
1320
|
let t;
|
|
1203
1321
|
try {
|
|
1204
1322
|
t = new URL(e).pathname;
|
|
@@ -1211,13 +1329,13 @@ var Je = ({ children: e }) => {
|
|
|
1211
1329
|
} catch {
|
|
1212
1330
|
return n;
|
|
1213
1331
|
}
|
|
1214
|
-
},
|
|
1215
|
-
let { openCanvas: n, openCanvasLoading: r, closeCanvas: a } =
|
|
1332
|
+
}, ct = (e, t) => {
|
|
1333
|
+
let { openCanvas: n, openCanvasLoading: r, closeCanvas: a } = $e(), { customVisualizers: o, themeId: s, onBeforeOpen: l } = t, u = N(async (t, n, r) => {
|
|
1216
1334
|
if (t.url == null && t.referenceUrl != null) {
|
|
1217
1335
|
let i = e.resolveReferencePdfContent(t);
|
|
1218
1336
|
if (i != null) return r(i, t.name, n);
|
|
1219
1337
|
}
|
|
1220
|
-
let a = t.contentType.toLowerCase(), c =
|
|
1338
|
+
let a = t.contentType.toLowerCase(), c = rt(a, o);
|
|
1221
1339
|
if (c != null) {
|
|
1222
1340
|
let i = await e.resolveVisualizerContent(t, c, s);
|
|
1223
1341
|
if (i != null) return r(i, t.name, n);
|
|
@@ -1226,15 +1344,15 @@ var Je = ({ children: e }) => {
|
|
|
1226
1344
|
let i = await e.resolveTextContent(t);
|
|
1227
1345
|
if (i != null) return r(i, t.name, n);
|
|
1228
1346
|
}
|
|
1229
|
-
let l =
|
|
1230
|
-
if (l != null) return r(await e.resolveOoxmlContent(t, l) ??
|
|
1347
|
+
let l = Y("", a);
|
|
1348
|
+
if (l != null) return r(await e.resolveOoxmlContent(t, l) ?? Q(e.resolveContentUrl(t)), t.name, n);
|
|
1231
1349
|
switch (a) {
|
|
1232
|
-
case f.PDF: return r(await e.resolvePdfContent(t) ??
|
|
1233
|
-
case f.Markdown: return r(await e.resolveMarkdownContent(t) ??
|
|
1234
|
-
case f.JSON: return r(await e.resolveJsonContent(t) ??
|
|
1350
|
+
case f.PDF: return r(await e.resolvePdfContent(t) ?? Q(e.resolveContentUrl(t)), t.name, n);
|
|
1351
|
+
case f.Markdown: return r(await e.resolveMarkdownContent(t) ?? Q(e.resolveContentUrl(t)), t.name, n);
|
|
1352
|
+
case f.JSON: return r(await e.resolveJsonContent(t) ?? Q(e.resolveContentUrl(t)), t.name, n);
|
|
1235
1353
|
}
|
|
1236
|
-
let u = t.name ?? "", p = u.lastIndexOf("."), m = p === -1 ? "" : u.slice(p + 1).toLowerCase(), h =
|
|
1237
|
-
if (h != null) return r(await e.resolveOoxmlContent(t, h) ??
|
|
1354
|
+
let u = t.name ?? "", p = u.lastIndexOf("."), m = p === -1 ? "" : u.slice(p + 1).toLowerCase(), h = Y(u);
|
|
1355
|
+
if (h != null) return r(await e.resolveOoxmlContent(t, h) ?? Q(e.resolveContentUrl(t)), t.name, n);
|
|
1238
1356
|
switch (m) {
|
|
1239
1357
|
case d.Markdown:
|
|
1240
1358
|
case d.MarkdownAlt: {
|
|
@@ -1250,24 +1368,24 @@ var Je = ({ children: e }) => {
|
|
|
1250
1368
|
return i == null ? !1 : r(i, t.name, n);
|
|
1251
1369
|
}
|
|
1252
1370
|
}
|
|
1253
|
-
let g = t.name != null &&
|
|
1254
|
-
if (t.name != null && !
|
|
1371
|
+
let g = t.name != null && We(t.name) || t.url != null && We(st(t.url));
|
|
1372
|
+
if (t.name != null && !Ue(t.name) && !g) return r(Q(e.resolveContentUrl(t)), t.name, n);
|
|
1255
1373
|
if (g) {
|
|
1256
1374
|
let a = await e.resolveHtmlContent(t);
|
|
1257
|
-
return a == null ? e.hasTextSource(t) ? r(
|
|
1375
|
+
return a == null ? e.hasTextSource(t) ? r(Q(e.resolveContentUrl(t)), t.name, n) : t.url == null ? !1 : r({
|
|
1258
1376
|
type: i.Html,
|
|
1259
1377
|
url: t.url
|
|
1260
1378
|
}, t.name, n) : r(a, t.name, n);
|
|
1261
1379
|
}
|
|
1262
|
-
let _ = await e.resolveCodeContent(t,
|
|
1380
|
+
let _ = await e.resolveCodeContent(t, Ke(m));
|
|
1263
1381
|
return _ == null ? !1 : r(_, t.name, n);
|
|
1264
1382
|
}, [
|
|
1265
1383
|
o,
|
|
1266
1384
|
s,
|
|
1267
1385
|
e
|
|
1268
1386
|
]);
|
|
1269
|
-
return { openAttachmentCanvas:
|
|
1270
|
-
let d = () => s == null || s(), f = (e, t, r) => d() ? (n(e, t, r), !0) : (
|
|
1387
|
+
return { openAttachmentCanvas: N(async (t, o = t.id, s) => {
|
|
1388
|
+
let d = () => s == null || s(), f = (e, t, r) => d() ? (n(e, t, r), !0) : (Ye(e), !1);
|
|
1271
1389
|
switch (t.type) {
|
|
1272
1390
|
case c.Image: {
|
|
1273
1391
|
let r = e.resolveImageContent(t);
|
|
@@ -1304,4 +1422,4 @@ var Je = ({ children: e }) => {
|
|
|
1304
1422
|
]) };
|
|
1305
1423
|
};
|
|
1306
1424
|
//#endregion
|
|
1307
|
-
export {
|
|
1425
|
+
export { pe as ATTACHMENT_CANVAS_CLASS, Re as AttachmentCanvas, Fe as AttachmentCanvasBody, et as AttachmentCanvasContainer, Qe as AttachmentCanvasProvider, i as AttachmentContentType, n as AttachmentErrorType, ge as CodeContent, nt as InlineGroupedVisualizer, we as McpAppCanvasRenderer, r as OoxmlFileType, t as OoxmlHighlightKind, Je as createForbiddenCanvasContent, qe as createLoadErrorCanvasContent, Q as createUnsupportedCanvasContent, a as downloadAttachmentContent, Ke as extensionToLanguage, it as findVisualizerForApplication, rt as findVisualizerForMime, Y as getOoxmlFileType, Z as getOoxmlMimeType, at as groupedVisualizerCanvasKey, o as isDownloadable, We as isHtmlPreviewable, X as isOoxmlPreviewable, Ue as isTextPreviewable, ot as partitionAttachmentsForApplicationVisualizer, $e as useAttachmentCanvas, ct as useOpenAttachmentCanvas };
|