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