@epam/ai-dial-attachment-canvas 1.3.0-dev.290 → 1.3.0-dev.296
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/AttachmentCanvas/AttachmentCanvas.d.ts.map +1 -1
- package/components/AttachmentCanvasBody/AttachmentCanvasBody.d.ts.map +1 -1
- package/components/AttachmentCanvasContainer/AttachmentCanvasContainer.d.ts.map +1 -1
- package/context/AttachmentCanvasContext.d.ts +6 -2
- package/context/AttachmentCanvasContext.d.ts.map +1 -1
- package/hooks/useOpenAttachmentCanvas/useOpenAttachmentCanvas.d.ts.map +1 -1
- package/index.js +589 -568
- package/models/attachment-canvas.d.ts +7 -1
- package/models/attachment-canvas.d.ts.map +1 -1
- package/package.json +4 -4
package/index.js
CHANGED
|
@@ -2,42 +2,42 @@ import { a as e, i as t, n, r, t as i } from "./attachment-canvas-BgwyzrRC.js";
|
|
|
2
2
|
import { i as a, o, t as s } from "./LazyContentBoundary-rT6s5wBc.js";
|
|
3
3
|
import { AttachmentType as c, CodeBlockTheme as l, DEFAULT_MARKDOWN_CLASS_NAMES as u, FileExtension as d, MIMEType as f, MarkdownRenderer as p, buildCssVars as m, copyToClipboard as h, isSyntaxHighlightingAllowed as g, mergeClasses as _, restrainedSyntaxTheme as v, stripUrlQueryAndFragment as y } from "@epam/ai-dial-chat-shared";
|
|
4
4
|
import { SidebarOrientation as b, SidebarPanel as x } from "@epam/ai-dial-sidebar";
|
|
5
|
-
import { DIAL_ICON_SIZE as S, DIAL_KIT_ICON_STROKE as C, ElementSize as w, GhostIconButton as T, LinkButton as E, LiveRegion as D, Spinner as O } from "@epam/ai-dial-ui-kit";
|
|
6
|
-
import { IconAlertTriangle as k, IconArrowsMaximize as A, IconCheck as j, IconCode as
|
|
7
|
-
import { createContext as
|
|
8
|
-
import { JsonView as
|
|
9
|
-
import { Fragment as
|
|
10
|
-
import { AppBridge as
|
|
11
|
-
import { McpUiHostContextChangedNotificationSchema as
|
|
12
|
-
import { VisualizerConnector as
|
|
5
|
+
import { DIAL_ICON_SIZE as S, DIAL_KIT_ICON_STROKE as C, ElementSize as w, GhostButton as ee, GhostIconButton as T, LinkButton as E, LiveRegion as D, Spinner as O } from "@epam/ai-dial-ui-kit";
|
|
6
|
+
import { IconAlertTriangle as k, IconArrowsMaximize as A, IconCheck as j, IconCode as te, IconCopy as ne, IconDownload as re, IconEye as ie, IconLock as ae, IconMarkdown as oe, IconRefresh as se } from "@tabler/icons-react";
|
|
7
|
+
import { createContext as M, lazy as N, memo as P, useCallback as F, useContext as ce, useEffect as I, useMemo as L, useRef as R, useState as z } from "react";
|
|
8
|
+
import { JsonView as le, defaultStyles as ue } from "react-json-view-lite";
|
|
9
|
+
import { Fragment as de, jsx as B, jsxs as V } from "react/jsx-runtime";
|
|
10
|
+
import { AppBridge as H, AppFrame as fe } from "@mcp-ui/client";
|
|
11
|
+
import { McpUiHostContextChangedNotificationSchema as U } from "@modelcontextprotocol/ext-apps/app-bridge";
|
|
12
|
+
import { VisualizerConnector as W, VisualizerConnectorEvents as pe, VisualizerConnectorRequests as me } from "@epam/ai-dial-visualizer-connector";
|
|
13
13
|
//#region src/constants/public-class-names.ts
|
|
14
|
-
var
|
|
14
|
+
var he = { panel: "dial-attachment-canvas-panel" }, ge = {
|
|
15
15
|
container: "_container_k7ib4_1",
|
|
16
16
|
containerLight: "_containerLight_k7ib4_5"
|
|
17
|
-
},
|
|
17
|
+
}, G = {
|
|
18
18
|
[l.Dark]: v,
|
|
19
19
|
[l.Light]: v
|
|
20
|
-
},
|
|
20
|
+
}, K = () => N(async () => {
|
|
21
21
|
let { Prism: e } = await import("react-syntax-highlighter");
|
|
22
22
|
return { default: e };
|
|
23
|
-
}),
|
|
24
|
-
let { text: a, language: o } = e, c =
|
|
23
|
+
}), _e = P(({ content: e, codeBlockTheme: t = l.Light, labels: n, codeClassName: r = "dial-code-text", errorLabelClassName: i }) => {
|
|
24
|
+
let { text: a, language: o } = e, c = L(() => g(a), [a]), u = o == null || o === "plaintext" || !c, d = G[t], f = t === l.Light, [p, m] = z(0), h = L(K, [p]), v = F(() => {
|
|
25
25
|
m((e) => e + 1);
|
|
26
|
-
}, []), y = /* @__PURE__ */
|
|
26
|
+
}, []), y = /* @__PURE__ */ B("pre", {
|
|
27
27
|
className: _(r, "p-4 wrap-break-word whitespace-pre-wrap"),
|
|
28
28
|
children: a
|
|
29
29
|
});
|
|
30
|
-
return /* @__PURE__ */
|
|
30
|
+
return /* @__PURE__ */ B("div", {
|
|
31
31
|
dir: "ltr",
|
|
32
|
-
className: _("h-full overflow-auto",
|
|
33
|
-
children: u ? y : /* @__PURE__ */
|
|
32
|
+
className: _("h-full overflow-auto", ge.container, f && ge.containerLight),
|
|
33
|
+
children: u ? y : /* @__PURE__ */ B(s, {
|
|
34
34
|
retryKey: p,
|
|
35
35
|
onRetry: v,
|
|
36
36
|
pendingContent: y,
|
|
37
37
|
errorContent: y,
|
|
38
38
|
labels: n,
|
|
39
39
|
errorLabelClassName: i,
|
|
40
|
-
children: /* @__PURE__ */
|
|
40
|
+
children: /* @__PURE__ */ B(h, {
|
|
41
41
|
language: o,
|
|
42
42
|
style: d,
|
|
43
43
|
customStyle: {
|
|
@@ -53,8 +53,8 @@ var K = { panel: "dial-attachment-canvas-panel" }, q = {
|
|
|
53
53
|
})
|
|
54
54
|
})
|
|
55
55
|
});
|
|
56
|
-
}),
|
|
57
|
-
let { htmlFrameBlockedLabel: c = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: l = "Open in new tab" } = t, [u, d] =
|
|
56
|
+
}), ve = "dial-html-preview:render", ye = { openInNewTabButton: "_openInNewTabButton_c1arc_1" }, be = P(({ content: e, labels: t, isSourceView: n, title: r, codeBlockTheme: a, openInNewTabButtonTypographyClassName: o = "dial-body-semi-text", codeClassName: s }) => {
|
|
57
|
+
let { htmlFrameBlockedLabel: c = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: l = "Open in new tab" } = t, [u, d] = z(!0), [f, p] = z(!1), [m, h] = z(void 0), [g, v] = z(!1), [y, b] = z(!1), x = R(null), S = R(null), C = R(!1), w = R({
|
|
58
58
|
content: e,
|
|
59
59
|
generation: 0
|
|
60
60
|
});
|
|
@@ -62,12 +62,12 @@ var K = { panel: "dial-attachment-canvas-panel" }, q = {
|
|
|
62
62
|
content: e,
|
|
63
63
|
generation: w.current.generation + 1
|
|
64
64
|
});
|
|
65
|
-
let
|
|
66
|
-
|
|
65
|
+
let ee = w.current.generation;
|
|
66
|
+
I(() => {
|
|
67
67
|
d(!0), p(!1), h(void 0), v(!1), b(!1);
|
|
68
68
|
}, [e]);
|
|
69
|
-
let
|
|
70
|
-
|
|
69
|
+
let T = R(n);
|
|
70
|
+
T.current !== n && (T.current = n, n && y && b(!1), !n && C.current && (C.current = !1, d(!0))), I(() => {
|
|
71
71
|
if (!n || e.srcdoc != null || e.resolveSourceText == null || m != null) return;
|
|
72
72
|
let t = !1, r = e.resolveSourceText;
|
|
73
73
|
return (async () => {
|
|
@@ -88,72 +88,72 @@ var K = { panel: "dial-attachment-canvas-panel" }, q = {
|
|
|
88
88
|
e,
|
|
89
89
|
m
|
|
90
90
|
]);
|
|
91
|
-
let
|
|
92
|
-
if (d(!1),
|
|
91
|
+
let D = e.isSameOriginUrl === !0 && e.url != null, k = !D && e.srcdoc != null, A = k ? e.srcdocHostUrl : void 0, j = e.srcdoc, te = F((e) => {
|
|
92
|
+
if (d(!1), A != null) {
|
|
93
93
|
let e = x.current?.contentWindow;
|
|
94
|
-
e != null && e !== S.current &&
|
|
95
|
-
type:
|
|
96
|
-
html:
|
|
94
|
+
e != null && e !== S.current && j != null && (S.current = e, e.postMessage({
|
|
95
|
+
type: ve,
|
|
96
|
+
html: j
|
|
97
97
|
}, "*"));
|
|
98
|
-
} else if (!(
|
|
98
|
+
} else if (!(k || D)) try {
|
|
99
99
|
x.current?.contentDocument ?? p(!0);
|
|
100
100
|
} catch {
|
|
101
101
|
p(!0);
|
|
102
102
|
}
|
|
103
103
|
}, [
|
|
104
|
-
A,
|
|
105
104
|
k,
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
105
|
+
D,
|
|
106
|
+
A,
|
|
107
|
+
j
|
|
108
|
+
]), ne = F(() => {
|
|
109
109
|
d(!1), p(!0);
|
|
110
|
-
}, []),
|
|
111
|
-
if (n &&
|
|
110
|
+
}, []), re = e.srcdoc ?? m, ie = e.srcdoc != null || e.resolveSourceText != null, ae = e.srcdoc == null && e.resolveSourceText != null && m == null && !y;
|
|
111
|
+
if (n && ie && (re != null || g || ae)) return C.current = !0, re == null ? /* @__PURE__ */ B("div", {
|
|
112
112
|
className: "flex h-full items-center justify-center",
|
|
113
|
-
children: /* @__PURE__ */
|
|
114
|
-
}) : /* @__PURE__ */
|
|
113
|
+
children: /* @__PURE__ */ B(O, {})
|
|
114
|
+
}) : /* @__PURE__ */ B(_e, {
|
|
115
115
|
content: {
|
|
116
116
|
type: i.Code,
|
|
117
|
-
text:
|
|
117
|
+
text: re,
|
|
118
118
|
language: "html"
|
|
119
119
|
},
|
|
120
120
|
codeBlockTheme: a,
|
|
121
121
|
codeClassName: s
|
|
122
122
|
});
|
|
123
|
-
if (f) return /* @__PURE__ */
|
|
123
|
+
if (f) return /* @__PURE__ */ V("div", {
|
|
124
124
|
className: "flex h-full flex-col items-center justify-center gap-3 p-4",
|
|
125
|
-
children: [/* @__PURE__ */
|
|
125
|
+
children: [/* @__PURE__ */ B("p", {
|
|
126
126
|
className: "text-center",
|
|
127
127
|
children: c
|
|
128
|
-
}), e.url != null && /* @__PURE__ */
|
|
128
|
+
}), e.url != null && /* @__PURE__ */ B(E, {
|
|
129
129
|
href: e.url,
|
|
130
130
|
target: "_blank",
|
|
131
131
|
label: l,
|
|
132
|
-
className:
|
|
132
|
+
className: ye.openInNewTabButton,
|
|
133
133
|
textClassName: o
|
|
134
134
|
})]
|
|
135
135
|
});
|
|
136
|
-
let
|
|
137
|
-
return /* @__PURE__ */
|
|
136
|
+
let oe = k ? A : e.url, se = k && A == null ? e.srcdoc : void 0;
|
|
137
|
+
return /* @__PURE__ */ V("div", {
|
|
138
138
|
className: "relative h-full",
|
|
139
|
-
children: [u && /* @__PURE__ */
|
|
139
|
+
children: [u && /* @__PURE__ */ B("div", {
|
|
140
140
|
className: "absolute inset-0 flex items-center justify-center",
|
|
141
|
-
children: /* @__PURE__ */
|
|
142
|
-
}), /* @__PURE__ */
|
|
141
|
+
children: /* @__PURE__ */ B(O, {})
|
|
142
|
+
}), /* @__PURE__ */ B("iframe", {
|
|
143
143
|
ref: x,
|
|
144
144
|
title: r,
|
|
145
|
-
src:
|
|
146
|
-
srcDoc:
|
|
147
|
-
sandbox:
|
|
145
|
+
src: oe,
|
|
146
|
+
srcDoc: se,
|
|
147
|
+
sandbox: k || D ? "allow-scripts" : "allow-scripts allow-same-origin",
|
|
148
148
|
className: _("h-full w-full border-none", u ? "invisible" : ""),
|
|
149
|
-
onLoad:
|
|
150
|
-
onError:
|
|
151
|
-
},
|
|
149
|
+
onLoad: te,
|
|
150
|
+
onError: ne
|
|
151
|
+
}, ee)]
|
|
152
152
|
});
|
|
153
|
-
}),
|
|
153
|
+
}), xe = {
|
|
154
154
|
name: "MCP-UI Host",
|
|
155
155
|
version: "1.0.0"
|
|
156
|
-
},
|
|
156
|
+
}, Se = { openLinks: {} }, Ce = (e) => {
|
|
157
157
|
let t;
|
|
158
158
|
try {
|
|
159
159
|
t = new URL(e);
|
|
@@ -167,20 +167,20 @@ var K = { panel: "dial-attachment-canvas-panel" }, q = {
|
|
|
167
167
|
return !1;
|
|
168
168
|
}
|
|
169
169
|
return !0;
|
|
170
|
-
},
|
|
170
|
+
}, we = (e, t, n) => {
|
|
171
171
|
if (n) {
|
|
172
172
|
e.style.maxWidth = "", e.style.maxHeight = "";
|
|
173
173
|
return;
|
|
174
174
|
}
|
|
175
175
|
let r = t;
|
|
176
176
|
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`));
|
|
177
|
-
},
|
|
178
|
-
let r =
|
|
179
|
-
|
|
177
|
+
}, Te = (e, t, n) => {
|
|
178
|
+
let r = R(e);
|
|
179
|
+
I(() => {
|
|
180
180
|
r.current = e;
|
|
181
181
|
});
|
|
182
|
-
let [i, a] =
|
|
183
|
-
return
|
|
182
|
+
let [i, a] = z(null), [o, s] = z(!1);
|
|
183
|
+
return I(() => {
|
|
184
184
|
let e = null;
|
|
185
185
|
try {
|
|
186
186
|
let n = t.current?.getBoundingClientRect(), i = n != null && n.width > 0 && n.height > 0 ? {
|
|
@@ -190,15 +190,15 @@ var K = { panel: "dial-attachment-canvas-panel" }, q = {
|
|
|
190
190
|
height: Math.round(n.height)
|
|
191
191
|
}
|
|
192
192
|
} : r.current.hostContext;
|
|
193
|
-
e = new
|
|
193
|
+
e = new H(null, r.current.hostInfo ?? xe, Se, { hostContext: i }), e.onopenlink = async ({ url: e }) => {
|
|
194
194
|
let t = r.current.onOpenLink;
|
|
195
|
-
return (t == null ?
|
|
195
|
+
return (t == null ? Ce(e) : t(e)) === !1 ? { isError: !0 } : {};
|
|
196
196
|
}, e.onrequestdisplaymode = async ({ mode: e }) => {
|
|
197
197
|
let t = r.current.onRequestDisplayMode, n = r.current.hostContext?.displayMode ?? "inline";
|
|
198
198
|
return { mode: t?.(e) ?? n };
|
|
199
|
-
}, e.oncalltool = (e) => r.current.onToolCall(e.name, e.arguments), e.setNotificationHandler(
|
|
199
|
+
}, e.oncalltool = (e) => r.current.onToolCall(e.name, e.arguments), e.setNotificationHandler(U, ({ params: e }) => {
|
|
200
200
|
let n = t.current?.querySelector("iframe");
|
|
201
|
-
n != null &&
|
|
201
|
+
n != null && we(n, e.containerDimensions, r.current.hostContext?.displayMode === "fullscreen");
|
|
202
202
|
}), a(e);
|
|
203
203
|
} catch (e) {
|
|
204
204
|
console.error("[useMcpAppBridge] Error creating AppBridge:", e), s(!0);
|
|
@@ -206,22 +206,22 @@ var K = { panel: "dial-attachment-canvas-panel" }, q = {
|
|
|
206
206
|
return () => {
|
|
207
207
|
e?.close().catch((e) => console.error("[useMcpAppBridge] Error closing AppBridge:", e));
|
|
208
208
|
};
|
|
209
|
-
}, [t]),
|
|
209
|
+
}, [t]), I(() => {
|
|
210
210
|
i != null && i.transport != null && n != null && i.setHostContext(n);
|
|
211
211
|
}, [i, n]), {
|
|
212
212
|
appBridge: i,
|
|
213
213
|
hasFailed: o
|
|
214
214
|
};
|
|
215
|
-
},
|
|
215
|
+
}, q = {
|
|
216
216
|
loadingOverlay: "_loadingOverlay_1kink_2",
|
|
217
217
|
fullscreenFrame: "_fullscreenFrame_1kink_21",
|
|
218
218
|
loadingFrame: "_loadingFrame_1kink_29",
|
|
219
219
|
statusLabel: "_statusLabel_1kink_33",
|
|
220
220
|
statusDetail: "_statusDetail_1kink_38",
|
|
221
221
|
errorIcon: "_errorIcon_1kink_42"
|
|
222
|
-
},
|
|
223
|
-
let [r, i] =
|
|
224
|
-
|
|
222
|
+
}, Ee = ({ content: e, errorLabel: t = "Failed to load app", onAppInfo: n }) => {
|
|
223
|
+
let [r, i] = z("loading"), [a, o] = z(), { html: s, sandboxUrl: c, toolInput: l, toolResult: u, hostContext: d } = e, f = L(() => ({ url: new URL(c) }), [c]), p = d?.displayMode === "fullscreen", m = R(null), [h, g] = z();
|
|
224
|
+
I(() => {
|
|
225
225
|
let e = m.current;
|
|
226
226
|
if (!e) return;
|
|
227
227
|
let t = new ResizeObserver(([e]) => {
|
|
@@ -234,15 +234,15 @@ var K = { panel: "dial-attachment-canvas-panel" }, q = {
|
|
|
234
234
|
});
|
|
235
235
|
return t.observe(e), () => t.disconnect();
|
|
236
236
|
}, []);
|
|
237
|
-
let { appBridge: v, hasFailed: y } =
|
|
237
|
+
let { appBridge: v, hasFailed: y } = Te(e, m, L(() => d == null || h == null ? d : {
|
|
238
238
|
...d,
|
|
239
239
|
containerDimensions: h
|
|
240
240
|
}, [d, h])), b = y || r === "error";
|
|
241
|
-
return /* @__PURE__ */
|
|
241
|
+
return /* @__PURE__ */ V("div", {
|
|
242
242
|
ref: m,
|
|
243
|
-
className: _("relative h-full w-full", b ? "min-h-[160px]" : "min-h-[100px]", p &&
|
|
243
|
+
className: _("relative h-full w-full", b ? "min-h-[160px]" : "min-h-[100px]", p && q.fullscreenFrame, !p && r === "loading" && q.loadingFrame),
|
|
244
244
|
children: [
|
|
245
|
-
v != null && !b && /* @__PURE__ */
|
|
245
|
+
v != null && !b && /* @__PURE__ */ B(fe, {
|
|
246
246
|
html: s,
|
|
247
247
|
sandbox: f,
|
|
248
248
|
appBridge: v,
|
|
@@ -256,29 +256,29 @@ var K = { panel: "dial-attachment-canvas-panel" }, q = {
|
|
|
256
256
|
o(e.message), i("error");
|
|
257
257
|
}
|
|
258
258
|
}),
|
|
259
|
-
!b && r === "loading" && /* @__PURE__ */
|
|
260
|
-
className: _("absolute inset-0 flex flex-col items-center justify-center gap-2",
|
|
261
|
-
children: /* @__PURE__ */
|
|
259
|
+
!b && r === "loading" && /* @__PURE__ */ B("div", {
|
|
260
|
+
className: _("absolute inset-0 flex flex-col items-center justify-center gap-2", q.loadingOverlay),
|
|
261
|
+
children: /* @__PURE__ */ B(O, {})
|
|
262
262
|
}),
|
|
263
|
-
b && /* @__PURE__ */
|
|
263
|
+
b && /* @__PURE__ */ V("div", {
|
|
264
264
|
className: "absolute inset-0 flex flex-col items-center justify-center gap-2 p-4",
|
|
265
|
-
children: [/* @__PURE__ */
|
|
265
|
+
children: [/* @__PURE__ */ B(k, {
|
|
266
266
|
size: 60,
|
|
267
267
|
stroke: C,
|
|
268
268
|
"aria-hidden": !0,
|
|
269
|
-
className:
|
|
270
|
-
}), /* @__PURE__ */
|
|
269
|
+
className: q.errorIcon
|
|
270
|
+
}), /* @__PURE__ */ V("p", {
|
|
271
271
|
role: "status",
|
|
272
|
-
className: _("text-center",
|
|
273
|
-
children: [t, a && /* @__PURE__ */
|
|
274
|
-
className:
|
|
272
|
+
className: _("text-center", q.statusLabel),
|
|
273
|
+
children: [t, a && /* @__PURE__ */ V(de, { children: [/* @__PURE__ */ B("br", {}), /* @__PURE__ */ B("span", {
|
|
274
|
+
className: q.statusDetail,
|
|
275
275
|
children: a
|
|
276
276
|
})] })]
|
|
277
277
|
})]
|
|
278
278
|
})
|
|
279
279
|
]
|
|
280
280
|
});
|
|
281
|
-
},
|
|
281
|
+
}, J = {
|
|
282
282
|
viewer: "_viewer_gdafg_2",
|
|
283
283
|
spreadsheetCanvas: "_spreadsheetCanvas_gdafg_6",
|
|
284
284
|
formulaPanel: "_formulaPanel_gdafg_12",
|
|
@@ -286,13 +286,13 @@ var K = { panel: "dial-attachment-canvas-panel" }, q = {
|
|
|
286
286
|
statusOverlay: "_statusOverlay_gdafg_27",
|
|
287
287
|
errorIcon: "_errorIcon_gdafg_32",
|
|
288
288
|
highlight: "_highlight_gdafg_40"
|
|
289
|
-
},
|
|
289
|
+
}, De = (e) => {
|
|
290
290
|
if (e?.kind !== "range") return "";
|
|
291
291
|
let { activeCell: t } = e.selection, n = e.cells.find(({ address: e }) => e.row === t.row && e.col === t.col);
|
|
292
292
|
if (n == null) return "";
|
|
293
293
|
let r = n.formula;
|
|
294
294
|
return r == null || r.trim().length === 0 ? n.displayText : r.startsWith("=") ? r : `=${r}`;
|
|
295
|
-
},
|
|
295
|
+
}, Y = async (e, t, { onError: n, onXlsxSelectionContextChange: i }) => {
|
|
296
296
|
switch (t) {
|
|
297
297
|
case r.Docx: {
|
|
298
298
|
let [{ DocxScrollViewer: t }, { chartEx: r }] = await Promise.all([import("@silurus/ooxml/docx"), import("@silurus/ooxml/chart-ex")]);
|
|
@@ -314,7 +314,7 @@ var K = { panel: "dial-attachment-canvas-panel" }, q = {
|
|
|
314
314
|
}
|
|
315
315
|
case r.Csv: {
|
|
316
316
|
let { XlsxSheetViewer: t } = await import("@silurus/ooxml/xlsx"), r = document.createElement("canvas");
|
|
317
|
-
r.className =
|
|
317
|
+
r.className = J.spreadsheetCanvas, e.replaceChildren(r);
|
|
318
318
|
let i = new t(r, {
|
|
319
319
|
showScrollbars: !0,
|
|
320
320
|
onError: n
|
|
@@ -338,7 +338,7 @@ var K = { panel: "dial-attachment-canvas-panel" }, q = {
|
|
|
338
338
|
});
|
|
339
339
|
}
|
|
340
340
|
}
|
|
341
|
-
},
|
|
341
|
+
}, Oe = async (e, t, n, i) => {
|
|
342
342
|
let { onError: a, onXlsxSelectionContextChange: o, onGeometryInvalidated: s } = n;
|
|
343
343
|
switch (t.format) {
|
|
344
344
|
case r.Docx: {
|
|
@@ -347,7 +347,7 @@ var K = { panel: "dial-attachment-canvas-panel" }, q = {
|
|
|
347
347
|
import("@silurus/ooxml/chart-ex"),
|
|
348
348
|
import("./ooxml-highlight-surfaces-C18JJb0P.js")
|
|
349
349
|
]), l = await n.load(t.url, { chartEx: o });
|
|
350
|
-
if (i()) throw l.destroy(), new
|
|
350
|
+
if (i()) throw l.destroy(), new ke();
|
|
351
351
|
let u = r.fromDocument(e, l, {
|
|
352
352
|
enableTextSelection: !0,
|
|
353
353
|
refitOnResize: !0,
|
|
@@ -367,7 +367,7 @@ var K = { panel: "dial-attachment-canvas-panel" }, q = {
|
|
|
367
367
|
import("@silurus/ooxml/chart-ex"),
|
|
368
368
|
import("./ooxml-highlight-surfaces-C18JJb0P.js")
|
|
369
369
|
]), l = await n.load(t.url, { chartEx: o });
|
|
370
|
-
if (i()) throw l.destroy(), new
|
|
370
|
+
if (i()) throw l.destroy(), new ke();
|
|
371
371
|
let u = r.fromPresentation(e, l, {
|
|
372
372
|
enableTextSelection: !0,
|
|
373
373
|
refitOnResize: !0,
|
|
@@ -401,15 +401,15 @@ var K = { panel: "dial-attachment-canvas-panel" }, q = {
|
|
|
401
401
|
};
|
|
402
402
|
}
|
|
403
403
|
case r.Csv: {
|
|
404
|
-
let r = await
|
|
404
|
+
let r = await Y(e, t.format, n);
|
|
405
405
|
return await r.load(t.url), { viewer: r };
|
|
406
406
|
}
|
|
407
407
|
}
|
|
408
|
-
},
|
|
409
|
-
let u =
|
|
410
|
-
|
|
411
|
-
let
|
|
412
|
-
return
|
|
408
|
+
}, ke = class extends Error {}, Ae = ({ content: t, fileName: n, loadErrorLabel: i, formulaLabel: a, formulaLabelClassName: o, formulaValueClassName: s, highlightsLabel: c = "Cited locations", highlightNavigatedLabel: l = "Scrolled to the cited location" }) => {
|
|
409
|
+
let u = R(null), [d, f] = z(!0), [p, m] = z(!1), [h, g] = z(""), [v, y] = z([]), [b, x] = z(!1), { highlights: S, selectedHighlightId: w } = t, ee = S != null && S.length > 0, T = R(void 0), E = R(S);
|
|
410
|
+
E.current = S;
|
|
411
|
+
let A = R(void 0);
|
|
412
|
+
return I(() => {
|
|
413
413
|
let e = u.current;
|
|
414
414
|
if (e == null) return;
|
|
415
415
|
let n, r, i = !1, a, o = () => i;
|
|
@@ -419,7 +419,7 @@ var K = { panel: "dial-attachment-canvas-panel" }, q = {
|
|
|
419
419
|
a = void 0, c();
|
|
420
420
|
}));
|
|
421
421
|
}, c = async () => {
|
|
422
|
-
let e = n?.highlights, t =
|
|
422
|
+
let e = n?.highlights, t = E.current;
|
|
423
423
|
if (!(i || e == null || t == null)) try {
|
|
424
424
|
let n = await e.measure(t);
|
|
425
425
|
i || y(n);
|
|
@@ -431,7 +431,7 @@ var K = { panel: "dial-attachment-canvas-panel" }, q = {
|
|
|
431
431
|
i || (f(!1), m(!0));
|
|
432
432
|
},
|
|
433
433
|
onXlsxSelectionContextChange: (e) => {
|
|
434
|
-
i || g(
|
|
434
|
+
i || g(De(e));
|
|
435
435
|
},
|
|
436
436
|
onGeometryInvalidated: s
|
|
437
437
|
}, d = () => {
|
|
@@ -439,44 +439,44 @@ var K = { panel: "dial-attachment-canvas-panel" }, q = {
|
|
|
439
439
|
n?.viewer.resize?.(), s();
|
|
440
440
|
}), r.observe(e));
|
|
441
441
|
};
|
|
442
|
-
return e.addEventListener("scroll", s, !0),
|
|
442
|
+
return e.addEventListener("scroll", s, !0), A.current = s, (async () => {
|
|
443
443
|
try {
|
|
444
|
-
if (
|
|
445
|
-
let r = await
|
|
444
|
+
if (ee) {
|
|
445
|
+
let r = await Oe(e, t, l, o);
|
|
446
446
|
if (i) {
|
|
447
447
|
r.viewer.destroy(), r.engine?.destroy();
|
|
448
448
|
return;
|
|
449
449
|
}
|
|
450
|
-
n = r,
|
|
450
|
+
n = r, T.current = r.highlights, d();
|
|
451
451
|
} else {
|
|
452
|
-
let r = await
|
|
452
|
+
let r = await Y(e, t.format, l);
|
|
453
453
|
if (i) {
|
|
454
454
|
r.destroy();
|
|
455
455
|
return;
|
|
456
456
|
}
|
|
457
|
-
if (n = { viewer: r },
|
|
457
|
+
if (n = { viewer: r }, T.current = void 0, await r.load(t.url), i) return;
|
|
458
458
|
d();
|
|
459
459
|
}
|
|
460
460
|
if (i) return;
|
|
461
461
|
f(!1), await c();
|
|
462
462
|
} catch (t) {
|
|
463
|
-
if (t instanceof
|
|
464
|
-
n?.viewer.destroy(), n?.engine?.destroy(), n = void 0,
|
|
463
|
+
if (t instanceof ke || i) return;
|
|
464
|
+
n?.viewer.destroy(), n?.engine?.destroy(), n = void 0, T.current = void 0, e.replaceChildren(), f(!1), m(!0);
|
|
465
465
|
}
|
|
466
466
|
})(), () => {
|
|
467
|
-
i = !0, e.removeEventListener("scroll", s, !0), a != null && cancelAnimationFrame(a),
|
|
467
|
+
i = !0, e.removeEventListener("scroll", s, !0), a != null && cancelAnimationFrame(a), A.current = void 0, r?.disconnect(), n?.viewer.destroy(), n?.engine?.destroy(), T.current = void 0, e.replaceChildren();
|
|
468
468
|
};
|
|
469
469
|
}, [
|
|
470
470
|
t.format,
|
|
471
471
|
t.url,
|
|
472
|
-
|
|
473
|
-
]),
|
|
474
|
-
|
|
475
|
-
}, [S]),
|
|
472
|
+
ee
|
|
473
|
+
]), I(() => {
|
|
474
|
+
A.current?.();
|
|
475
|
+
}, [S]), I(() => {
|
|
476
476
|
x(!1);
|
|
477
|
-
let t =
|
|
477
|
+
let t = T.current;
|
|
478
478
|
if (t == null || d) return;
|
|
479
|
-
let n = (
|
|
479
|
+
let n = (E.current?.find(({ id: e }) => e === w))?.locations.at(0);
|
|
480
480
|
if (n == null) return;
|
|
481
481
|
let r = !1;
|
|
482
482
|
return (async () => {
|
|
@@ -490,38 +490,38 @@ var K = { panel: "dial-attachment-canvas-panel" }, q = {
|
|
|
490
490
|
})(), () => {
|
|
491
491
|
r = !0;
|
|
492
492
|
};
|
|
493
|
-
}, [w, d]), /* @__PURE__ */
|
|
493
|
+
}, [w, d]), /* @__PURE__ */ V("div", {
|
|
494
494
|
className: "relative flex h-full w-full min-w-0 flex-col overflow-hidden",
|
|
495
495
|
children: [
|
|
496
|
-
t.format === r.Xlsx && /* @__PURE__ */
|
|
496
|
+
t.format === r.Xlsx && /* @__PURE__ */ V("div", {
|
|
497
497
|
role: "region",
|
|
498
498
|
"aria-label": a,
|
|
499
|
-
className: _("flex min-w-0 shrink-0 items-center gap-2 border-b px-3 py-2",
|
|
500
|
-
children: [/* @__PURE__ */
|
|
499
|
+
className: _("flex min-w-0 shrink-0 items-center gap-2 border-b px-3 py-2", J.formulaPanel),
|
|
500
|
+
children: [/* @__PURE__ */ B("span", {
|
|
501
501
|
"aria-hidden": "true",
|
|
502
502
|
className: _("shrink-0", o),
|
|
503
503
|
children: "fx"
|
|
504
|
-
}), /* @__PURE__ */
|
|
504
|
+
}), /* @__PURE__ */ B("code", {
|
|
505
505
|
dir: "ltr",
|
|
506
506
|
tabIndex: 0,
|
|
507
507
|
"aria-live": "polite",
|
|
508
|
-
className: _("h-8 min-w-0 flex-1 overflow-x-auto rounded border px-2 py-1 whitespace-nowrap focus-visible:outline",
|
|
508
|
+
className: _("h-8 min-w-0 flex-1 overflow-x-auto rounded border px-2 py-1 whitespace-nowrap focus-visible:outline", J.formulaValue, s),
|
|
509
509
|
children: h
|
|
510
510
|
})]
|
|
511
511
|
}),
|
|
512
|
-
/* @__PURE__ */
|
|
512
|
+
/* @__PURE__ */ V("div", {
|
|
513
513
|
className: "relative min-h-0 w-full flex-1",
|
|
514
|
-
children: [/* @__PURE__ */
|
|
514
|
+
children: [/* @__PURE__ */ B("div", {
|
|
515
515
|
ref: u,
|
|
516
516
|
role: "document",
|
|
517
517
|
"aria-label": n,
|
|
518
518
|
"aria-busy": d,
|
|
519
|
-
className: _("h-full w-full overflow-hidden",
|
|
520
|
-
}), v.length > 0 && /* @__PURE__ */
|
|
519
|
+
className: _("h-full w-full overflow-hidden", J.viewer)
|
|
520
|
+
}), v.length > 0 && /* @__PURE__ */ B("div", {
|
|
521
521
|
role: "region",
|
|
522
522
|
"aria-label": c,
|
|
523
523
|
className: "pointer-events-none absolute inset-0 overflow-hidden",
|
|
524
|
-
children: v.map((e, t) => /* @__PURE__ */
|
|
524
|
+
children: v.map((e, t) => /* @__PURE__ */ B("div", {
|
|
525
525
|
"aria-hidden": "true",
|
|
526
526
|
style: {
|
|
527
527
|
left: `${e.left}px`,
|
|
@@ -531,26 +531,26 @@ var K = { panel: "dial-attachment-canvas-panel" }, q = {
|
|
|
531
531
|
},
|
|
532
532
|
"data-selected": e.highlightId === w,
|
|
533
533
|
"data-clipped": e.isClippedAtEnd === !0,
|
|
534
|
-
className: _("absolute",
|
|
534
|
+
className: _("absolute", J.highlight)
|
|
535
535
|
}, `${e.highlightId}-${t}`))
|
|
536
536
|
})]
|
|
537
537
|
}),
|
|
538
|
-
/* @__PURE__ */
|
|
538
|
+
/* @__PURE__ */ B(D, {
|
|
539
539
|
visuallyHidden: !0,
|
|
540
540
|
children: b ? l : ""
|
|
541
541
|
}),
|
|
542
|
-
(d || p) && /* @__PURE__ */
|
|
542
|
+
(d || p) && /* @__PURE__ */ B("div", {
|
|
543
543
|
role: p ? "alert" : void 0,
|
|
544
544
|
"aria-live": "polite",
|
|
545
|
-
className: _("absolute inset-0 flex items-center justify-center",
|
|
546
|
-
children: d ? /* @__PURE__ */
|
|
545
|
+
className: _("absolute inset-0 flex items-center justify-center", J.statusOverlay),
|
|
546
|
+
children: d ? /* @__PURE__ */ B(O, { size: 48 }) : /* @__PURE__ */ V("div", {
|
|
547
547
|
className: "flex flex-col items-center gap-2",
|
|
548
|
-
children: [/* @__PURE__ */
|
|
548
|
+
children: [/* @__PURE__ */ B(k, {
|
|
549
549
|
"aria-hidden": "true",
|
|
550
550
|
size: 60,
|
|
551
551
|
stroke: C,
|
|
552
|
-
className:
|
|
553
|
-
}), /* @__PURE__ */
|
|
552
|
+
className: J.errorIcon
|
|
553
|
+
}), /* @__PURE__ */ B("p", {
|
|
554
554
|
className: "text-center",
|
|
555
555
|
children: i
|
|
556
556
|
})]
|
|
@@ -558,12 +558,12 @@ var K = { panel: "dial-attachment-canvas-panel" }, q = {
|
|
|
558
558
|
})
|
|
559
559
|
]
|
|
560
560
|
});
|
|
561
|
-
},
|
|
561
|
+
}, je = (e, t) => {
|
|
562
562
|
let n = e.toLowerCase();
|
|
563
563
|
return t.find((e) => e.contentType.split(",").some((e) => e.trim().toLowerCase() === n && e.trim() !== ""));
|
|
564
|
-
},
|
|
564
|
+
}, Me = (e, t) => {
|
|
565
565
|
if (e != null && e !== "") return Object.prototype.hasOwnProperty.call(t, e) ? t[e] : void 0;
|
|
566
|
-
},
|
|
566
|
+
}, Ne = (e) => `${e}:grouped-visualizer`, Pe = (e, t) => {
|
|
567
567
|
let n = (t.contentType ?? "").split(",").map((e) => e.trim().toLowerCase()).filter((e) => e !== ""), r = [], i = [];
|
|
568
568
|
return e.forEach((e) => {
|
|
569
569
|
e.url != null && e.url !== "" && (n.length === 0 || n.includes(e.contentType.toLowerCase())) ? r.push(e) : i.push(e);
|
|
@@ -571,34 +571,34 @@ var K = { panel: "dial-attachment-canvas-panel" }, q = {
|
|
|
571
571
|
claimed: r,
|
|
572
572
|
unclaimed: i
|
|
573
573
|
};
|
|
574
|
-
},
|
|
574
|
+
}, Fe = (e) => {
|
|
575
575
|
if (typeof e != "object" || !e || !Object.prototype.hasOwnProperty.call(e, "message")) return;
|
|
576
576
|
let { message: t } = e;
|
|
577
577
|
return typeof t == "string" && t.trim() !== "" ? t : void 0;
|
|
578
|
-
},
|
|
578
|
+
}, Ie = {
|
|
579
579
|
loadingOverlay: "_loadingOverlay_12637_1",
|
|
580
580
|
statusLabel: "_statusLabel_12637_5",
|
|
581
581
|
errorIcon: "_errorIcon_12637_9"
|
|
582
|
-
},
|
|
583
|
-
let s =
|
|
582
|
+
}, Le = ({ content: e, loadingLabel: t, errorLabel: n = "Failed to load visualizer", frameTitle: r, colors: a, onSendMessage: o }) => {
|
|
583
|
+
let s = R(null), [c, l] = z("loading"), { url: u, visualizerName: d, requestTimeout: f } = e, p = R(e);
|
|
584
584
|
p.current = e;
|
|
585
|
-
let h =
|
|
586
|
-
return h.current = o,
|
|
585
|
+
let h = R(o);
|
|
586
|
+
return h.current = o, I(() => {
|
|
587
587
|
let e = s.current;
|
|
588
588
|
if (!e) return;
|
|
589
589
|
l("loading");
|
|
590
|
-
let t = new
|
|
590
|
+
let t = new W(e, {
|
|
591
591
|
domain: u,
|
|
592
592
|
visualizerName: d,
|
|
593
593
|
requestTimeout: f
|
|
594
|
-
}), n = !0, r = t.subscribe(`${d}/${
|
|
595
|
-
let t =
|
|
594
|
+
}), n = !0, r = t.subscribe(`${d}/${pe.SendMessage}`, (e) => {
|
|
595
|
+
let t = Fe(e);
|
|
596
596
|
t != null && h.current?.(t);
|
|
597
597
|
});
|
|
598
598
|
return (async () => {
|
|
599
599
|
if (await t.ready(), !n) return;
|
|
600
600
|
let e = p.current;
|
|
601
|
-
if (e.type === i.GroupedVisualizer) await t.send(
|
|
601
|
+
if (e.type === i.GroupedVisualizer) await t.send(me.SendGroupedVisualizeData, {
|
|
602
602
|
attachments: e.attachments,
|
|
603
603
|
layout: e.layout
|
|
604
604
|
});
|
|
@@ -607,7 +607,7 @@ var K = { panel: "dial-attachment-canvas-panel" }, q = {
|
|
|
607
607
|
layout: r,
|
|
608
608
|
...typeof i == "object" && i ? i : {}
|
|
609
609
|
};
|
|
610
|
-
await t.send(
|
|
610
|
+
await t.send(me.SendVisualizeData, {
|
|
611
611
|
mimeType: n,
|
|
612
612
|
visualizerData: a
|
|
613
613
|
});
|
|
@@ -622,7 +622,7 @@ var K = { panel: "dial-attachment-canvas-panel" }, q = {
|
|
|
622
622
|
u,
|
|
623
623
|
d,
|
|
624
624
|
f
|
|
625
|
-
]),
|
|
625
|
+
]), I(() => {
|
|
626
626
|
let e = r ?? d.trim();
|
|
627
627
|
e !== "" && s.current?.querySelector("iframe")?.setAttribute("title", e);
|
|
628
628
|
}, [
|
|
@@ -630,7 +630,7 @@ var K = { panel: "dial-attachment-canvas-panel" }, q = {
|
|
|
630
630
|
d,
|
|
631
631
|
u,
|
|
632
632
|
f
|
|
633
|
-
]), /* @__PURE__ */
|
|
633
|
+
]), /* @__PURE__ */ V("div", {
|
|
634
634
|
className: "relative h-full w-full",
|
|
635
635
|
style: m({
|
|
636
636
|
"--vs-loading-bg": a?.loadingBackground,
|
|
@@ -638,27 +638,27 @@ var K = { panel: "dial-attachment-canvas-panel" }, q = {
|
|
|
638
638
|
"--vs-error-icon": a?.errorIcon
|
|
639
639
|
}),
|
|
640
640
|
children: [
|
|
641
|
-
/* @__PURE__ */
|
|
641
|
+
/* @__PURE__ */ B("div", {
|
|
642
642
|
ref: s,
|
|
643
643
|
className: "h-full w-full"
|
|
644
644
|
}),
|
|
645
|
-
c === "loading" && /* @__PURE__ */
|
|
646
|
-
className: _("absolute inset-0 flex flex-col items-center justify-center gap-2",
|
|
647
|
-
children: [/* @__PURE__ */
|
|
648
|
-
className: _("text-center",
|
|
645
|
+
c === "loading" && /* @__PURE__ */ V("div", {
|
|
646
|
+
className: _("absolute inset-0 flex flex-col items-center justify-center gap-2", Ie.loadingOverlay),
|
|
647
|
+
children: [/* @__PURE__ */ B(O, {}), t && /* @__PURE__ */ B("p", {
|
|
648
|
+
className: _("text-center", Ie.statusLabel),
|
|
649
649
|
children: t
|
|
650
650
|
})]
|
|
651
651
|
}),
|
|
652
|
-
c === "error" && /* @__PURE__ */
|
|
652
|
+
c === "error" && /* @__PURE__ */ V("div", {
|
|
653
653
|
className: "absolute inset-0 flex flex-col items-center justify-center gap-2",
|
|
654
|
-
children: [/* @__PURE__ */
|
|
654
|
+
children: [/* @__PURE__ */ B(k, {
|
|
655
655
|
size: 60,
|
|
656
656
|
stroke: C,
|
|
657
657
|
"aria-hidden": !0,
|
|
658
|
-
className:
|
|
659
|
-
}), /* @__PURE__ */
|
|
658
|
+
className: Ie.errorIcon
|
|
659
|
+
}), /* @__PURE__ */ B("p", {
|
|
660
660
|
role: "status",
|
|
661
|
-
className: _("text-center",
|
|
661
|
+
className: _("text-center", Ie.statusLabel),
|
|
662
662
|
children: n
|
|
663
663
|
})]
|
|
664
664
|
})
|
|
@@ -679,73 +679,73 @@ var K = { panel: "dial-attachment-canvas-panel" }, q = {
|
|
|
679
679
|
jsonExpandIcon: "_jsonExpandIcon_fvnln_54",
|
|
680
680
|
jsonCollapseIcon: "_jsonCollapseIcon_fvnln_67",
|
|
681
681
|
jsonCollapsedContent: "_jsonCollapsedContent_fvnln_84"
|
|
682
|
-
},
|
|
683
|
-
let [r, i] =
|
|
684
|
-
return
|
|
682
|
+
}, Re = () => N(async () => ({ default: (await import("./PdfContent-CyCIPzRp.js")).PdfContent })), ze = ({ url: e, fileName: t, loadErrorLabel: n }) => {
|
|
683
|
+
let [r, i] = z(!1);
|
|
684
|
+
return I(() => {
|
|
685
685
|
i(!1);
|
|
686
|
-
}, [e]), r ? /* @__PURE__ */
|
|
686
|
+
}, [e]), r ? /* @__PURE__ */ V("div", {
|
|
687
687
|
className: "flex flex-col items-center gap-2",
|
|
688
|
-
children: [/* @__PURE__ */
|
|
688
|
+
children: [/* @__PURE__ */ B(k, {
|
|
689
689
|
size: 60,
|
|
690
690
|
stroke: C,
|
|
691
691
|
className: X.errorIcon
|
|
692
|
-
}), /* @__PURE__ */
|
|
692
|
+
}), /* @__PURE__ */ B("p", {
|
|
693
693
|
className: _("text-center", X.statusLabel),
|
|
694
694
|
children: n
|
|
695
695
|
})]
|
|
696
|
-
}) : /* @__PURE__ */
|
|
696
|
+
}) : /* @__PURE__ */ B("img", {
|
|
697
697
|
src: e,
|
|
698
698
|
alt: t ?? "",
|
|
699
699
|
className: "max-h-full max-w-full object-contain",
|
|
700
700
|
onError: () => i(!0)
|
|
701
701
|
});
|
|
702
|
-
},
|
|
703
|
-
let { colors:
|
|
704
|
-
|
|
705
|
-
}, []),
|
|
706
|
-
|
|
702
|
+
}, Be = P(({ 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", loadErrorRetryLabel: l = "Retry", forbiddenErrorLabel: d = "You don't have permission to access this file", visualizerErrorLabel: f, htmlFrameBlockedLabel: h = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: g = "Open in new tab", pdfThumbnailsLabel: v, pdfShowThumbnailsLabel: y, pdfHideThumbnailsLabel: b, pdfPageNumberLabel: x, pdfContentLoadingLabel: S, pdfContentErrorLabel: w, pdfContentRetryLabel: T, xlsxFormulaLabel: E = "Formula", codeContentLoadingLabel: D, codeContentErrorLabel: A, codeContentRetryLabel: j, tableCopyLabel: te, tableCopiedLabel: ne, tableDownloadCsvLabel: re, codeBlockCopyLabel: ie, codeBlockCopiedLabel: oe, codeBlockDownloadLabel: se, tableScrollRegionAriaLabel: M, mathScrollRegionAriaLabel: N, ooxmlHighlightsLabel: P, ooxmlHighlightNavigatedLabel: ce } = {}, styles: de, codeBlockTheme: H, tableDownloadFilename: fe, loadPdf: U, hidePdfToolbar: W = !1, configurePdfWorker: pe, onAppInfo: me, onRetry: he, onVisualizerSendMessage: ge }) => {
|
|
703
|
+
let { colors: G, typography: K, bodyClassName: ve, cssVars: ye } = de ?? {}, [xe, Se] = z(0), Ce = L(Re, [xe]), we = F(() => {
|
|
704
|
+
Se((e) => e + 1);
|
|
705
|
+
}, []), Te = R(void 0), [q, J] = z(0), De = F((e) => {
|
|
706
|
+
Te.current = e;
|
|
707
707
|
}, []);
|
|
708
|
-
|
|
709
|
-
let t =
|
|
710
|
-
t != null && (
|
|
708
|
+
I(() => {
|
|
709
|
+
let t = Te.current;
|
|
710
|
+
t != null && (Te.current = void 0, e.type === i.Pdf && e.url === t && J((e) => e + 1));
|
|
711
711
|
}, [e]);
|
|
712
|
-
let Y =
|
|
712
|
+
let Y = K?.fontClassName != null, Oe = L(() => ({
|
|
713
713
|
...m({
|
|
714
|
-
"--ac-text":
|
|
715
|
-
"--ac-status-text":
|
|
716
|
-
"--ac-error-icon":
|
|
717
|
-
"--ac-open-in-new-tab-text":
|
|
718
|
-
"--ac-json-border":
|
|
719
|
-
"--ac-json-bg":
|
|
720
|
-
"--ac-json-label":
|
|
721
|
-
"--ac-json-clickable-label":
|
|
722
|
-
"--ac-json-punctuation":
|
|
723
|
-
"--ac-json-string":
|
|
724
|
-
"--ac-json-number":
|
|
725
|
-
"--ac-json-boolean":
|
|
726
|
-
"--ac-json-null":
|
|
727
|
-
"--ac-json-toggle-icon":
|
|
728
|
-
"--ac-json-toggle-icon-hover":
|
|
729
|
-
"--ac-ooxml-bg":
|
|
730
|
-
"--ac-ooxml-formula-border":
|
|
731
|
-
"--ac-ooxml-formula-bg":
|
|
732
|
-
"--ac-ooxml-formula-text":
|
|
733
|
-
"--ac-ooxml-highlight-border":
|
|
734
|
-
"--ac-ooxml-highlight-bg":
|
|
735
|
-
"--ac-json-collapsed-text":
|
|
736
|
-
"--ac-json-collapsed-bg":
|
|
737
|
-
"--ac-focus-outline":
|
|
738
|
-
"--ac-code-bg":
|
|
739
|
-
"--ac-mcp-app-loading-bg":
|
|
740
|
-
"--ac-mcp-app-status-text":
|
|
741
|
-
"--ac-font-family": Y ? void 0 :
|
|
742
|
-
"--ac-font-size": Y ? void 0 :
|
|
743
|
-
"--ac-font-weight": Y ? void 0 :
|
|
744
|
-
"--ac-line-height": Y ? void 0 :
|
|
745
|
-
"--ac-letter-spacing": Y ? void 0 :
|
|
714
|
+
"--ac-text": G?.text,
|
|
715
|
+
"--ac-status-text": G?.statusText,
|
|
716
|
+
"--ac-error-icon": G?.errorIcon,
|
|
717
|
+
"--ac-open-in-new-tab-text": G?.openInNewTabText,
|
|
718
|
+
"--ac-json-border": G?.jsonBorder,
|
|
719
|
+
"--ac-json-bg": G?.jsonBackground,
|
|
720
|
+
"--ac-json-label": G?.jsonLabel,
|
|
721
|
+
"--ac-json-clickable-label": G?.jsonClickableLabel,
|
|
722
|
+
"--ac-json-punctuation": G?.jsonPunctuation,
|
|
723
|
+
"--ac-json-string": G?.jsonString,
|
|
724
|
+
"--ac-json-number": G?.jsonNumber,
|
|
725
|
+
"--ac-json-boolean": G?.jsonBoolean,
|
|
726
|
+
"--ac-json-null": G?.jsonNull,
|
|
727
|
+
"--ac-json-toggle-icon": G?.jsonToggleIcon,
|
|
728
|
+
"--ac-json-toggle-icon-hover": G?.jsonToggleIconHover,
|
|
729
|
+
"--ac-ooxml-bg": G?.ooxmlBackground,
|
|
730
|
+
"--ac-ooxml-formula-border": G?.ooxmlFormulaBorder,
|
|
731
|
+
"--ac-ooxml-formula-bg": G?.ooxmlFormulaBackground,
|
|
732
|
+
"--ac-ooxml-formula-text": G?.ooxmlFormulaText,
|
|
733
|
+
"--ac-ooxml-highlight-border": G?.ooxmlHighlightBorder,
|
|
734
|
+
"--ac-ooxml-highlight-bg": G?.ooxmlHighlightBackground,
|
|
735
|
+
"--ac-json-collapsed-text": G?.jsonCollapsedText,
|
|
736
|
+
"--ac-json-collapsed-bg": G?.jsonCollapsedBackground,
|
|
737
|
+
"--ac-focus-outline": G?.focusOutline,
|
|
738
|
+
"--ac-code-bg": G?.codeBackground,
|
|
739
|
+
"--ac-mcp-app-loading-bg": G?.mcpAppLoadingBackground,
|
|
740
|
+
"--ac-mcp-app-status-text": G?.mcpAppStatusText,
|
|
741
|
+
"--ac-font-family": Y ? void 0 : K?.fontFamily,
|
|
742
|
+
"--ac-font-size": Y ? void 0 : K?.fontSize,
|
|
743
|
+
"--ac-font-weight": Y ? void 0 : K?.fontWeight,
|
|
744
|
+
"--ac-line-height": Y ? void 0 : K?.lineHeight,
|
|
745
|
+
"--ac-letter-spacing": Y ? void 0 : K?.letterSpacing
|
|
746
746
|
}),
|
|
747
|
-
...
|
|
748
|
-
}), [
|
|
747
|
+
...ye
|
|
748
|
+
}), [de]), ke = L(() => {
|
|
749
749
|
switch (e.type) {
|
|
750
750
|
case i.Image:
|
|
751
751
|
case i.Audio:
|
|
@@ -763,52 +763,52 @@ var K = { panel: "dial-attachment-canvas-panel" }, q = {
|
|
|
763
763
|
case i.MarkdownTable: return "flex h-full min-h-0 flex-col overflow-hidden p-4";
|
|
764
764
|
default: return "h-full overflow-auto p-4";
|
|
765
765
|
}
|
|
766
|
-
}, [e.type]),
|
|
766
|
+
}, [e.type]), je = L(() => {
|
|
767
767
|
switch (e.type) {
|
|
768
|
-
case i.PlainText: return /* @__PURE__ */
|
|
769
|
-
className: _("wrap-break-word whitespace-pre-wrap", X.body,
|
|
768
|
+
case i.PlainText: return /* @__PURE__ */ B("pre", {
|
|
769
|
+
className: _("wrap-break-word whitespace-pre-wrap", X.body, K?.fontClassName),
|
|
770
770
|
children: e.text
|
|
771
771
|
});
|
|
772
|
-
case i.Image: return /* @__PURE__ */
|
|
772
|
+
case i.Image: return /* @__PURE__ */ B(ze, {
|
|
773
773
|
url: e.url,
|
|
774
774
|
fileName: r,
|
|
775
775
|
loadErrorLabel: c
|
|
776
776
|
});
|
|
777
|
-
case i.Audio: return /* @__PURE__ */
|
|
777
|
+
case i.Audio: return /* @__PURE__ */ B("audio", {
|
|
778
778
|
controls: !0,
|
|
779
779
|
controlsList: "nodownload",
|
|
780
780
|
src: e.url,
|
|
781
781
|
"aria-label": r ?? "Audio attachment",
|
|
782
782
|
className: "w-full max-w-sm",
|
|
783
783
|
preload: "metadata",
|
|
784
|
-
children: e.mimeType && /* @__PURE__ */
|
|
784
|
+
children: e.mimeType && /* @__PURE__ */ B("source", {
|
|
785
785
|
src: e.url,
|
|
786
786
|
type: e.mimeType
|
|
787
787
|
})
|
|
788
788
|
});
|
|
789
|
-
case i.Markdown: return /* @__PURE__ */
|
|
789
|
+
case i.Markdown: return /* @__PURE__ */ B("div", {
|
|
790
790
|
className: "p-4",
|
|
791
|
-
children: /* @__PURE__ */
|
|
791
|
+
children: /* @__PURE__ */ B(p, {
|
|
792
792
|
content: e.text,
|
|
793
793
|
isStreaming: !1,
|
|
794
794
|
codeBlockTheme: H,
|
|
795
|
-
codeBlockCopyLabel:
|
|
796
|
-
codeBlockCopiedLabel:
|
|
797
|
-
codeBlockDownloadLabel:
|
|
798
|
-
tableScrollRegionAriaLabel:
|
|
799
|
-
mathScrollRegionAriaLabel:
|
|
795
|
+
codeBlockCopyLabel: ie,
|
|
796
|
+
codeBlockCopiedLabel: oe,
|
|
797
|
+
codeBlockDownloadLabel: se,
|
|
798
|
+
tableScrollRegionAriaLabel: M,
|
|
799
|
+
mathScrollRegionAriaLabel: N,
|
|
800
800
|
classNames: u
|
|
801
801
|
})
|
|
802
802
|
});
|
|
803
|
-
case i.MarkdownTable: return /* @__PURE__ */
|
|
803
|
+
case i.MarkdownTable: return /* @__PURE__ */ B(p, {
|
|
804
804
|
content: e.text,
|
|
805
805
|
isStreaming: !1,
|
|
806
806
|
codeBlockTheme: H,
|
|
807
|
-
codeBlockCopyLabel:
|
|
808
|
-
codeBlockCopiedLabel:
|
|
809
|
-
codeBlockDownloadLabel:
|
|
810
|
-
tableScrollRegionAriaLabel:
|
|
811
|
-
mathScrollRegionAriaLabel:
|
|
807
|
+
codeBlockCopyLabel: ie,
|
|
808
|
+
codeBlockCopiedLabel: oe,
|
|
809
|
+
codeBlockDownloadLabel: se,
|
|
810
|
+
tableScrollRegionAriaLabel: M,
|
|
811
|
+
mathScrollRegionAriaLabel: N,
|
|
812
812
|
containerClassName: "flex h-full min-h-0 flex-col",
|
|
813
813
|
classNames: {
|
|
814
814
|
...u,
|
|
@@ -816,24 +816,24 @@ var K = { panel: "dial-attachment-canvas-panel" }, q = {
|
|
|
816
816
|
tableScrollContainer: "max-h-full"
|
|
817
817
|
},
|
|
818
818
|
tableActionLabels: {
|
|
819
|
-
copyLabel:
|
|
820
|
-
copiedLabel:
|
|
821
|
-
downloadCsvLabel:
|
|
819
|
+
copyLabel: te,
|
|
820
|
+
copiedLabel: ne,
|
|
821
|
+
downloadCsvLabel: re
|
|
822
822
|
},
|
|
823
|
-
tableDownloadFilename:
|
|
823
|
+
tableDownloadFilename: fe
|
|
824
824
|
});
|
|
825
825
|
case i.Json: {
|
|
826
|
-
let t =
|
|
827
|
-
return /* @__PURE__ */
|
|
826
|
+
let t = K?.jsonLabelClassName ?? (K?.jsonClassName ? void 0 : "dial-code-semi-text");
|
|
827
|
+
return /* @__PURE__ */ B("div", {
|
|
828
828
|
dir: "ltr",
|
|
829
829
|
className: "h-full overflow-auto",
|
|
830
|
-
children: /* @__PURE__ */
|
|
830
|
+
children: /* @__PURE__ */ B("div", {
|
|
831
831
|
className: _("m-3 overflow-auto rounded-md border", X.jsonWrapper),
|
|
832
|
-
children: /* @__PURE__ */
|
|
832
|
+
children: /* @__PURE__ */ B(le, {
|
|
833
833
|
data: e.value,
|
|
834
834
|
style: {
|
|
835
|
-
container: _("whitespace-pre-wrap wrap-break-word p-2",
|
|
836
|
-
basicChildStyle:
|
|
835
|
+
container: _("whitespace-pre-wrap wrap-break-word p-2", K?.jsonClassName ?? "dial-code-text"),
|
|
836
|
+
basicChildStyle: ue.basicChildStyle,
|
|
837
837
|
childFieldsContainer: "m-0 ps-3",
|
|
838
838
|
label: _("me-1", t, X.jsonLabel),
|
|
839
839
|
clickableLabel: _("me-1 cursor-pointer hover:underline", t, X.jsonClickableLabel),
|
|
@@ -846,130 +846,138 @@ var K = { panel: "dial-attachment-canvas-panel" }, q = {
|
|
|
846
846
|
punctuation: _("me-1", X.jsonPunctuation),
|
|
847
847
|
collapseIcon: _("me-1 cursor-pointer select-none transition-colors", X.jsonCollapseIcon),
|
|
848
848
|
expandIcon: _("me-1 cursor-pointer select-none transition-colors", X.jsonExpandIcon),
|
|
849
|
-
collapsedContent: _(
|
|
849
|
+
collapsedContent: _(K?.jsonCollapsedClassName ?? "dial-caption-text", "me-1 cursor-pointer rounded px-1", X.jsonCollapsedContent)
|
|
850
850
|
}
|
|
851
851
|
})
|
|
852
852
|
})
|
|
853
853
|
});
|
|
854
854
|
}
|
|
855
|
-
case i.Code: return /* @__PURE__ */
|
|
855
|
+
case i.Code: return /* @__PURE__ */ B(_e, {
|
|
856
856
|
content: e,
|
|
857
857
|
codeBlockTheme: H,
|
|
858
|
-
codeClassName:
|
|
859
|
-
errorLabelClassName:
|
|
858
|
+
codeClassName: K?.codeClassName,
|
|
859
|
+
errorLabelClassName: K?.errorMessageClassName,
|
|
860
860
|
labels: {
|
|
861
|
-
loadingLabel:
|
|
862
|
-
errorLabel:
|
|
863
|
-
retryLabel:
|
|
861
|
+
loadingLabel: D,
|
|
862
|
+
errorLabel: A,
|
|
863
|
+
retryLabel: j
|
|
864
864
|
}
|
|
865
865
|
});
|
|
866
|
-
case i.Html: return /* @__PURE__ */
|
|
866
|
+
case i.Html: return /* @__PURE__ */ B(be, {
|
|
867
867
|
content: e,
|
|
868
868
|
labels: {
|
|
869
|
-
htmlFrameBlockedLabel:
|
|
870
|
-
htmlOpenInNewTabLabel:
|
|
869
|
+
htmlFrameBlockedLabel: h,
|
|
870
|
+
htmlOpenInNewTabLabel: g
|
|
871
871
|
},
|
|
872
872
|
isSourceView: a,
|
|
873
873
|
title: r,
|
|
874
874
|
codeBlockTheme: H,
|
|
875
|
-
codeClassName:
|
|
875
|
+
codeClassName: K?.codeClassName
|
|
876
876
|
});
|
|
877
|
-
case i.Pdf: return /* @__PURE__ */
|
|
878
|
-
retryKey:
|
|
879
|
-
onRetry:
|
|
880
|
-
errorLabelClassName:
|
|
877
|
+
case i.Pdf: return /* @__PURE__ */ B(s, {
|
|
878
|
+
retryKey: xe,
|
|
879
|
+
onRetry: we,
|
|
880
|
+
errorLabelClassName: K?.errorMessageClassName,
|
|
881
881
|
labels: {
|
|
882
|
-
loadingLabel:
|
|
883
|
-
errorLabel:
|
|
884
|
-
retryLabel:
|
|
882
|
+
loadingLabel: S,
|
|
883
|
+
errorLabel: w,
|
|
884
|
+
retryLabel: T
|
|
885
885
|
},
|
|
886
|
-
children: /* @__PURE__ */
|
|
886
|
+
children: /* @__PURE__ */ B(Ce, {
|
|
887
887
|
fileName: r,
|
|
888
888
|
url: e.url,
|
|
889
889
|
highlights: e.highlights ?? [],
|
|
890
890
|
selectedHighlightId: e.selectedHighlightId,
|
|
891
891
|
selectedPageNumber: e.page,
|
|
892
|
-
loadPdf:
|
|
893
|
-
onLoadError:
|
|
894
|
-
hideHeader:
|
|
895
|
-
configurePdfWorker:
|
|
896
|
-
errorLabelClassName:
|
|
892
|
+
loadPdf: U,
|
|
893
|
+
onLoadError: De,
|
|
894
|
+
hideHeader: W,
|
|
895
|
+
configurePdfWorker: pe,
|
|
896
|
+
errorLabelClassName: K?.errorMessageClassName,
|
|
897
897
|
labels: {
|
|
898
|
-
thumbnailsLabel:
|
|
899
|
-
showThumbnailsLabel:
|
|
900
|
-
hideThumbnailsLabel:
|
|
901
|
-
pageNumberLabel:
|
|
902
|
-
loadingLabel:
|
|
903
|
-
errorLabel:
|
|
904
|
-
retryLabel:
|
|
898
|
+
thumbnailsLabel: v,
|
|
899
|
+
showThumbnailsLabel: y,
|
|
900
|
+
hideThumbnailsLabel: b,
|
|
901
|
+
pageNumberLabel: x,
|
|
902
|
+
loadingLabel: S,
|
|
903
|
+
errorLabel: w,
|
|
904
|
+
retryLabel: T
|
|
905
905
|
}
|
|
906
906
|
})
|
|
907
|
-
}, `${e.url}#${
|
|
908
|
-
case i.Ooxml: return /* @__PURE__ */
|
|
907
|
+
}, `${e.url}#${q}`);
|
|
908
|
+
case i.Ooxml: return /* @__PURE__ */ B(Ae, {
|
|
909
909
|
content: e,
|
|
910
910
|
fileName: r,
|
|
911
911
|
loadErrorLabel: c,
|
|
912
|
-
formulaLabel:
|
|
913
|
-
formulaLabelClassName:
|
|
914
|
-
formulaValueClassName:
|
|
915
|
-
highlightsLabel:
|
|
916
|
-
highlightNavigatedLabel:
|
|
912
|
+
formulaLabel: E,
|
|
913
|
+
formulaLabelClassName: K?.xlsxFormulaLabelClassName ?? "dial-italic-text",
|
|
914
|
+
formulaValueClassName: K?.xlsxFormulaValueClassName ?? "dial-code-text",
|
|
915
|
+
highlightsLabel: P,
|
|
916
|
+
highlightNavigatedLabel: ce
|
|
917
917
|
});
|
|
918
918
|
case i.Visualizer:
|
|
919
|
-
case i.GroupedVisualizer: return /* @__PURE__ */
|
|
919
|
+
case i.GroupedVisualizer: return /* @__PURE__ */ B(Le, {
|
|
920
920
|
content: e,
|
|
921
|
-
errorLabel:
|
|
922
|
-
onSendMessage:
|
|
921
|
+
errorLabel: f,
|
|
922
|
+
onSendMessage: ge
|
|
923
923
|
});
|
|
924
|
-
case i.McpApp: return /* @__PURE__ */
|
|
924
|
+
case i.McpApp: return /* @__PURE__ */ B(Ee, {
|
|
925
925
|
content: e,
|
|
926
|
-
onAppInfo:
|
|
926
|
+
onAppInfo: me
|
|
927
927
|
});
|
|
928
|
-
case i.Unsupported: return /* @__PURE__ */
|
|
928
|
+
case i.Unsupported: return /* @__PURE__ */ B("p", {
|
|
929
929
|
className: _("text-center", X.statusLabel),
|
|
930
930
|
children: o
|
|
931
931
|
});
|
|
932
932
|
case i.Error: {
|
|
933
933
|
let t = e.errorType === n.Forbidden;
|
|
934
|
-
return /* @__PURE__ */
|
|
934
|
+
return /* @__PURE__ */ V("div", {
|
|
935
935
|
className: "flex flex-col items-center gap-2",
|
|
936
|
-
children: [
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
936
|
+
children: [
|
|
937
|
+
B(t ? ae : k, {
|
|
938
|
+
size: 60,
|
|
939
|
+
stroke: C,
|
|
940
|
+
className: X.errorIcon
|
|
941
|
+
}),
|
|
942
|
+
/* @__PURE__ */ B("p", {
|
|
943
|
+
className: _("text-center", X.statusLabel),
|
|
944
|
+
children: t ? d : c
|
|
945
|
+
}),
|
|
946
|
+
!t && he != null && /* @__PURE__ */ B(ee, {
|
|
947
|
+
label: l,
|
|
948
|
+
onClick: he
|
|
949
|
+
})
|
|
950
|
+
]
|
|
944
951
|
});
|
|
945
952
|
}
|
|
946
953
|
}
|
|
947
954
|
}, [
|
|
948
955
|
e,
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
956
|
+
K?.fontClassName,
|
|
957
|
+
K?.jsonClassName,
|
|
958
|
+
K?.jsonLabelClassName,
|
|
959
|
+
K?.xlsxFormulaLabelClassName,
|
|
960
|
+
K?.xlsxFormulaValueClassName,
|
|
961
|
+
K?.codeClassName,
|
|
962
|
+
K?.jsonCollapsedClassName,
|
|
963
|
+
K?.errorMessageClassName,
|
|
957
964
|
r,
|
|
958
965
|
H,
|
|
959
966
|
o,
|
|
960
967
|
c,
|
|
961
968
|
l,
|
|
962
969
|
d,
|
|
963
|
-
fe,
|
|
964
970
|
f,
|
|
971
|
+
ge,
|
|
965
972
|
h,
|
|
966
|
-
a,
|
|
967
|
-
ce,
|
|
968
|
-
le,
|
|
969
|
-
G,
|
|
970
|
-
ue,
|
|
971
|
-
de,
|
|
972
973
|
g,
|
|
974
|
+
a,
|
|
975
|
+
fe,
|
|
976
|
+
U,
|
|
977
|
+
W,
|
|
978
|
+
pe,
|
|
979
|
+
me,
|
|
980
|
+
he,
|
|
973
981
|
v,
|
|
974
982
|
y,
|
|
975
983
|
b,
|
|
@@ -980,212 +988,215 @@ var K = { panel: "dial-attachment-canvas-panel" }, q = {
|
|
|
980
988
|
E,
|
|
981
989
|
D,
|
|
982
990
|
A,
|
|
983
|
-
ye,
|
|
984
|
-
ge,
|
|
985
|
-
be,
|
|
986
|
-
Se,
|
|
987
|
-
J,
|
|
988
991
|
j,
|
|
989
|
-
|
|
990
|
-
|
|
992
|
+
Ce,
|
|
993
|
+
xe,
|
|
994
|
+
we,
|
|
995
|
+
q,
|
|
996
|
+
De,
|
|
991
997
|
te,
|
|
992
|
-
|
|
998
|
+
ne,
|
|
993
999
|
re,
|
|
994
1000
|
ie,
|
|
1001
|
+
oe,
|
|
1002
|
+
se,
|
|
1003
|
+
M,
|
|
1004
|
+
N,
|
|
995
1005
|
P,
|
|
996
|
-
|
|
997
|
-
I
|
|
1006
|
+
ce
|
|
998
1007
|
]);
|
|
999
|
-
return /* @__PURE__ */
|
|
1000
|
-
style: t ? void 0 :
|
|
1001
|
-
className: _(t ? "flex h-full items-center justify-center" :
|
|
1002
|
-
children: t ? /* @__PURE__ */
|
|
1008
|
+
return /* @__PURE__ */ B("div", {
|
|
1009
|
+
style: t ? void 0 : Oe,
|
|
1010
|
+
className: _(t ? "flex h-full items-center justify-center" : ke, ve),
|
|
1011
|
+
children: t ? /* @__PURE__ */ B(O, {}) : je
|
|
1003
1012
|
});
|
|
1004
|
-
}),
|
|
1013
|
+
}), Ve = {
|
|
1005
1014
|
mcpAppDivider: "_mcpAppDivider_1gxed_1",
|
|
1006
1015
|
mcpAppVersion: "_mcpAppVersion_1gxed_5",
|
|
1007
1016
|
panelHeader: "_panelHeader_1gxed_9"
|
|
1008
|
-
},
|
|
1009
|
-
let [
|
|
1010
|
-
|
|
1011
|
-
}, [
|
|
1012
|
-
|
|
1013
|
-
}, [
|
|
1014
|
-
|
|
1015
|
-
}, [
|
|
1016
|
-
|
|
1017
|
-
|
|
1017
|
+
}, He = 2e3, Ue = P(({ isOpen: e, isLoading: t = !1, onClose: n, onRetry: r, content: a, fileName: s, leftActions: c, labels: { ariaLabel: l, closeLabel: u = "Close", resizeLabel: d = "Resize panel", downloadLabel: f = "Download", copyTextLabel: p = "Copy text", copiedTextLabel: h = "Copied!", copyMarkdownLabel: g = "Copy as Markdown", copiedMarkdownLabel: v = "Copied!", copyJsonLabel: y = "Copy as JSON", copiedJsonLabel: w = "Copied!", visualizerErrorLabel: ee, unsupportedLabel: E = "Preview is not supported for this file", loadErrorLabel: D = "Failed to load file", loadErrorRetryLabel: O = "Retry", forbiddenErrorLabel: k = "You don't have permission to access this file", htmlFrameBlockedLabel: A = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: ae = "Open in new tab", htmlViewSourceLabel: M = "View source", htmlViewRenderedLabel: N = "View rendered", mcpAppReloadLabel: P = "Reload", pdfThumbnailsLabel: ce, pdfShowThumbnailsLabel: le, pdfHideThumbnailsLabel: ue, pdfPageNumberLabel: H, pdfContentLoadingLabel: fe, pdfContentErrorLabel: U, pdfContentRetryLabel: W, xlsxFormulaLabel: pe, codeContentLoadingLabel: me, codeContentErrorLabel: ge, codeContentRetryLabel: G, tableCopyLabel: K, tableCopiedLabel: _e, tableDownloadCsvLabel: ve, codeBlockCopyLabel: ye, codeBlockCopiedLabel: be, codeBlockDownloadLabel: xe, tableScrollRegionAriaLabel: Se, mathScrollRegionAriaLabel: Ce, ooxmlHighlightsLabel: we, ooxmlHighlightNavigatedLabel: Te }, onDownload: q, onCopyText: Ee, onCopyMarkdown: J, onCopyJson: De, tableDownloadFilename: Y, isMobile: Oe = !1, defaultWidth: ke, minWidth: Ae = 600, maxWidth: je = 1500, onResizeStop: Me, styles: Ne, codeBlockTheme: Pe, loadPdf: Fe, configurePdfWorker: Ie, onVisualizerSendMessage: Le }) => {
|
|
1018
|
+
let [X, Re] = z(!1), [ze, Ue] = z(!1), [We, Z] = z(!1), [Ge, Ke] = z(!1), [qe, Je] = z(void 0), Q = R(null), Ye = R(null), Xe = R(null), Ze = F(() => {
|
|
1019
|
+
Ee?.(), Q.current != null && clearTimeout(Q.current), Re(!0), Q.current = setTimeout(() => Re(!1), He);
|
|
1020
|
+
}, [Ee]), Qe = F(() => {
|
|
1021
|
+
J?.(), Ye.current != null && clearTimeout(Ye.current), Ue(!0), Ye.current = setTimeout(() => Ue(!1), He);
|
|
1022
|
+
}, [J]), $e = F(() => {
|
|
1023
|
+
De?.(), Xe.current != null && clearTimeout(Xe.current), Z(!0), Xe.current = setTimeout(() => Z(!1), He);
|
|
1024
|
+
}, [De]);
|
|
1025
|
+
I(() => () => {
|
|
1026
|
+
Q.current != null && clearTimeout(Q.current), Ye.current != null && clearTimeout(Ye.current), Xe.current != null && clearTimeout(Xe.current);
|
|
1018
1027
|
}, []);
|
|
1019
|
-
let
|
|
1020
|
-
|
|
1028
|
+
let et = F(() => {
|
|
1029
|
+
Ke((e) => !e);
|
|
1021
1030
|
}, []);
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
}, [
|
|
1025
|
-
let { className:
|
|
1026
|
-
"--ac-mcp-app-divider":
|
|
1027
|
-
"--ac-mcp-app-version":
|
|
1028
|
-
}), [
|
|
1029
|
-
style:
|
|
1031
|
+
I(() => {
|
|
1032
|
+
Ke(!1), Je(void 0);
|
|
1033
|
+
}, [a]);
|
|
1034
|
+
let { className: $, panelStyles: tt, ...nt } = Ne ?? {}, { colors: rt, typography: it } = nt, at = L(() => m({
|
|
1035
|
+
"--ac-mcp-app-divider": rt?.mcpAppDividerColor,
|
|
1036
|
+
"--ac-mcp-app-version": rt?.mcpAppVersionColor
|
|
1037
|
+
}), [rt?.mcpAppDividerColor, rt?.mcpAppVersionColor]), ot = a.type === i.McpApp && qe != null ? /* @__PURE__ */ V("span", {
|
|
1038
|
+
style: at,
|
|
1030
1039
|
children: [
|
|
1031
|
-
/* @__PURE__ */
|
|
1032
|
-
/* @__PURE__ */
|
|
1040
|
+
/* @__PURE__ */ B("span", { children: s }),
|
|
1041
|
+
/* @__PURE__ */ B("span", {
|
|
1033
1042
|
"aria-hidden": !0,
|
|
1034
|
-
className: _("mx-1.5 inline-block h-3 w-0 border-s align-middle",
|
|
1043
|
+
className: _("mx-1.5 inline-block h-3 w-0 border-s align-middle", Ve.mcpAppDivider)
|
|
1035
1044
|
}),
|
|
1036
|
-
/* @__PURE__ */
|
|
1037
|
-
|
|
1038
|
-
className: _("ms-2",
|
|
1039
|
-
children:
|
|
1045
|
+
/* @__PURE__ */ B("span", { children: qe.name }),
|
|
1046
|
+
qe.version && /* @__PURE__ */ B("span", {
|
|
1047
|
+
className: _("ms-2", it?.mcpAppVersionClassName ?? "dial-caption-text", Ve.mcpAppVersion),
|
|
1048
|
+
children: qe.version
|
|
1040
1049
|
})
|
|
1041
1050
|
]
|
|
1042
|
-
}) :
|
|
1043
|
-
return /* @__PURE__ */
|
|
1051
|
+
}) : s, st = !t && a.type === i.Html && (a.srcdoc != null || a.resolveSourceText != null), ct = !t && Ee != null && (a.type === i.PlainText || a.type === i.Code), lt = !t && J != null && a.type === i.Markdown, ut = !t && De != null && a.type === i.Json, dt = !t && q != null && o(a), ft = !t && a.type === i.McpApp && a.onReload != null;
|
|
1052
|
+
return /* @__PURE__ */ B(x, {
|
|
1044
1053
|
isOpen: e,
|
|
1045
1054
|
orientation: b.Right,
|
|
1046
|
-
title:
|
|
1055
|
+
title: ot,
|
|
1047
1056
|
labels: {
|
|
1048
|
-
ariaLabel:
|
|
1049
|
-
closeLabel:
|
|
1050
|
-
resizeLabel:
|
|
1057
|
+
ariaLabel: l,
|
|
1058
|
+
closeLabel: u,
|
|
1059
|
+
resizeLabel: d
|
|
1051
1060
|
},
|
|
1052
1061
|
onClose: n,
|
|
1053
|
-
resizable: !
|
|
1054
|
-
defaultWidth:
|
|
1055
|
-
minWidth:
|
|
1056
|
-
maxWidth:
|
|
1057
|
-
onResizeStop:
|
|
1062
|
+
resizable: !Oe,
|
|
1063
|
+
defaultWidth: ke,
|
|
1064
|
+
minWidth: Ae,
|
|
1065
|
+
maxWidth: je,
|
|
1066
|
+
onResizeStop: Me,
|
|
1058
1067
|
styles: {
|
|
1059
|
-
|
|
1068
|
+
...tt,
|
|
1060
1069
|
cssVars: {
|
|
1061
|
-
...m({ "--ac-header-border":
|
|
1062
|
-
|
|
1070
|
+
...m({ "--ac-header-border": rt?.headerBorder }),
|
|
1071
|
+
...tt?.cssVars
|
|
1063
1072
|
},
|
|
1064
|
-
titleClassName:
|
|
1065
|
-
headerClassName: _("border-b",
|
|
1066
|
-
className: _(e ? "mobile:w-full mobile:max-w-full" : "w-0",
|
|
1073
|
+
titleClassName: tt?.titleClassName ?? "dial-h3-text",
|
|
1074
|
+
headerClassName: _("border-b", Ve.panelHeader, tt?.headerClassName),
|
|
1075
|
+
className: _(e ? "mobile:w-full mobile:max-w-full" : "w-0", $, tt?.className, he.panel)
|
|
1067
1076
|
},
|
|
1068
|
-
leftActions:
|
|
1069
|
-
rightActions:
|
|
1070
|
-
|
|
1071
|
-
icon: /* @__PURE__ */
|
|
1077
|
+
leftActions: c,
|
|
1078
|
+
rightActions: st || ct || lt || ut || dt || ft ? /* @__PURE__ */ V(de, { children: [
|
|
1079
|
+
ft && /* @__PURE__ */ B(T, {
|
|
1080
|
+
icon: /* @__PURE__ */ B(se, {
|
|
1072
1081
|
size: S.LG,
|
|
1073
1082
|
stroke: C,
|
|
1074
1083
|
"aria-hidden": !0
|
|
1075
1084
|
}),
|
|
1076
|
-
"aria-label":
|
|
1077
|
-
tooltipProps: { tooltip:
|
|
1078
|
-
onClick:
|
|
1085
|
+
"aria-label": P,
|
|
1086
|
+
tooltipProps: { tooltip: P },
|
|
1087
|
+
onClick: a.type === i.McpApp ? a.onReload : void 0
|
|
1079
1088
|
}),
|
|
1080
|
-
|
|
1081
|
-
icon:
|
|
1089
|
+
st && /* @__PURE__ */ B(T, {
|
|
1090
|
+
icon: B(Ge ? ie : te, {
|
|
1082
1091
|
size: S.LG,
|
|
1083
1092
|
stroke: C,
|
|
1084
1093
|
"aria-hidden": !0
|
|
1085
1094
|
}),
|
|
1086
|
-
"aria-label":
|
|
1087
|
-
"aria-pressed":
|
|
1088
|
-
tooltipProps: { tooltip:
|
|
1089
|
-
onClick:
|
|
1095
|
+
"aria-label": Ge ? N : M,
|
|
1096
|
+
"aria-pressed": Ge,
|
|
1097
|
+
tooltipProps: { tooltip: Ge ? N : M },
|
|
1098
|
+
onClick: et
|
|
1090
1099
|
}),
|
|
1091
|
-
|
|
1092
|
-
icon:
|
|
1100
|
+
ct && /* @__PURE__ */ B(T, {
|
|
1101
|
+
icon: B(X ? j : ne, {
|
|
1093
1102
|
size: S.LG,
|
|
1094
1103
|
stroke: C,
|
|
1095
1104
|
"aria-hidden": !0
|
|
1096
1105
|
}),
|
|
1097
|
-
"aria-label":
|
|
1098
|
-
tooltipProps: { tooltip:
|
|
1099
|
-
onClick:
|
|
1106
|
+
"aria-label": X ? h : p,
|
|
1107
|
+
tooltipProps: { tooltip: X ? h : p },
|
|
1108
|
+
onClick: Ze
|
|
1100
1109
|
}),
|
|
1101
|
-
|
|
1102
|
-
icon:
|
|
1110
|
+
lt && /* @__PURE__ */ B(T, {
|
|
1111
|
+
icon: B(ze ? j : oe, {
|
|
1103
1112
|
size: S.LG,
|
|
1104
1113
|
stroke: C,
|
|
1105
1114
|
"aria-hidden": !0
|
|
1106
1115
|
}),
|
|
1107
|
-
"aria-label":
|
|
1108
|
-
tooltipProps: { tooltip:
|
|
1109
|
-
onClick:
|
|
1116
|
+
"aria-label": ze ? v : g,
|
|
1117
|
+
tooltipProps: { tooltip: ze ? v : g },
|
|
1118
|
+
onClick: Qe
|
|
1110
1119
|
}),
|
|
1111
|
-
|
|
1112
|
-
icon:
|
|
1120
|
+
ut && /* @__PURE__ */ B(T, {
|
|
1121
|
+
icon: B(We ? j : ne, {
|
|
1113
1122
|
size: S.LG,
|
|
1114
1123
|
stroke: C,
|
|
1115
1124
|
"aria-hidden": !0
|
|
1116
1125
|
}),
|
|
1117
|
-
"aria-label":
|
|
1118
|
-
tooltipProps: { tooltip:
|
|
1119
|
-
onClick:
|
|
1126
|
+
"aria-label": We ? w : y,
|
|
1127
|
+
tooltipProps: { tooltip: We ? w : y },
|
|
1128
|
+
onClick: $e
|
|
1120
1129
|
}),
|
|
1121
|
-
|
|
1122
|
-
icon: /* @__PURE__ */
|
|
1130
|
+
dt && /* @__PURE__ */ B(T, {
|
|
1131
|
+
icon: /* @__PURE__ */ B(re, {
|
|
1123
1132
|
size: S.LG,
|
|
1124
1133
|
stroke: C
|
|
1125
1134
|
}),
|
|
1126
|
-
"aria-label":
|
|
1127
|
-
tooltipProps: { tooltip:
|
|
1128
|
-
onClick:
|
|
1135
|
+
"aria-label": f,
|
|
1136
|
+
tooltipProps: { tooltip: f },
|
|
1137
|
+
onClick: q
|
|
1129
1138
|
})
|
|
1130
1139
|
] }) : null,
|
|
1131
|
-
children: /* @__PURE__ */
|
|
1132
|
-
content:
|
|
1140
|
+
children: /* @__PURE__ */ B(Be, {
|
|
1141
|
+
content: a,
|
|
1133
1142
|
isLoading: t,
|
|
1134
|
-
fileName:
|
|
1135
|
-
isHtmlSourceView:
|
|
1136
|
-
onAppInfo:
|
|
1143
|
+
fileName: s,
|
|
1144
|
+
isHtmlSourceView: Ge,
|
|
1145
|
+
onAppInfo: a.type === i.McpApp ? Je : void 0,
|
|
1146
|
+
onRetry: r,
|
|
1137
1147
|
labels: {
|
|
1138
1148
|
unsupportedLabel: E,
|
|
1139
1149
|
loadErrorLabel: D,
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1150
|
+
loadErrorRetryLabel: O,
|
|
1151
|
+
forbiddenErrorLabel: k,
|
|
1152
|
+
visualizerErrorLabel: ee,
|
|
1153
|
+
htmlFrameBlockedLabel: A,
|
|
1154
|
+
htmlOpenInNewTabLabel: ae,
|
|
1155
|
+
pdfThumbnailsLabel: ce,
|
|
1156
|
+
pdfShowThumbnailsLabel: le,
|
|
1157
|
+
pdfHideThumbnailsLabel: ue,
|
|
1158
|
+
pdfPageNumberLabel: H,
|
|
1159
|
+
pdfContentLoadingLabel: fe,
|
|
1160
|
+
pdfContentErrorLabel: U,
|
|
1161
|
+
pdfContentRetryLabel: W,
|
|
1162
|
+
xlsxFormulaLabel: pe,
|
|
1163
|
+
codeContentLoadingLabel: me,
|
|
1164
|
+
codeContentErrorLabel: ge,
|
|
1165
|
+
codeContentRetryLabel: G,
|
|
1166
|
+
tableCopyLabel: K,
|
|
1167
|
+
tableCopiedLabel: _e,
|
|
1168
|
+
tableDownloadCsvLabel: ve,
|
|
1169
|
+
codeBlockCopyLabel: ye,
|
|
1170
|
+
codeBlockCopiedLabel: be,
|
|
1171
|
+
codeBlockDownloadLabel: xe,
|
|
1172
|
+
tableScrollRegionAriaLabel: Se,
|
|
1173
|
+
mathScrollRegionAriaLabel: Ce,
|
|
1174
|
+
ooxmlHighlightsLabel: we,
|
|
1175
|
+
ooxmlHighlightNavigatedLabel: Te
|
|
1165
1176
|
},
|
|
1166
|
-
styles:
|
|
1167
|
-
codeBlockTheme:
|
|
1168
|
-
tableDownloadFilename:
|
|
1169
|
-
loadPdf:
|
|
1170
|
-
configurePdfWorker:
|
|
1171
|
-
onVisualizerSendMessage:
|
|
1177
|
+
styles: nt,
|
|
1178
|
+
codeBlockTheme: Pe,
|
|
1179
|
+
tableDownloadFilename: Y,
|
|
1180
|
+
loadPdf: Fe,
|
|
1181
|
+
configurePdfWorker: Ie,
|
|
1182
|
+
onVisualizerSendMessage: Le
|
|
1172
1183
|
})
|
|
1173
1184
|
});
|
|
1174
|
-
}),
|
|
1185
|
+
}), We = /* @__PURE__ */ new Set(["html", "htm"]), Z = {
|
|
1175
1186
|
docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
1176
1187
|
xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
1177
1188
|
pptx: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
1178
|
-
},
|
|
1189
|
+
}, Ge = /* @__PURE__ */ 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(".")), Ke = {
|
|
1179
1190
|
docx: r.Docx,
|
|
1180
1191
|
xlsx: r.Xlsx,
|
|
1181
1192
|
pptx: r.Pptx,
|
|
1182
1193
|
csv: r.Csv
|
|
1183
|
-
},
|
|
1194
|
+
}, qe = {
|
|
1184
1195
|
[Z.docx]: r.Docx,
|
|
1185
1196
|
[Z.xlsx]: r.Xlsx,
|
|
1186
1197
|
[Z.pptx]: r.Pptx,
|
|
1187
1198
|
[f.CSV]: r.Csv
|
|
1188
|
-
},
|
|
1199
|
+
}, Je = {
|
|
1189
1200
|
[r.Docx]: Z.docx,
|
|
1190
1201
|
[r.Xlsx]: Z.xlsx,
|
|
1191
1202
|
[r.Pptx]: Z.pptx,
|
|
@@ -1193,21 +1204,21 @@ var K = { panel: "dial-attachment-canvas-panel" }, q = {
|
|
|
1193
1204
|
}, Q = (e, t) => {
|
|
1194
1205
|
let n = t?.split(";", 1)[0].trim().toLowerCase();
|
|
1195
1206
|
if (n != null) {
|
|
1196
|
-
let e =
|
|
1207
|
+
let e = qe[n];
|
|
1197
1208
|
if (e != null) return e;
|
|
1198
1209
|
}
|
|
1199
1210
|
let r = e.lastIndexOf(".");
|
|
1200
|
-
if (r !== -1) return
|
|
1201
|
-
},
|
|
1211
|
+
if (r !== -1) return Ke[e.slice(r + 1).toLowerCase()];
|
|
1212
|
+
}, Ye = (e, t) => Q(e, t) != null, Xe = (e, t) => {
|
|
1202
1213
|
let n = Q(e, t);
|
|
1203
|
-
return n == null ? void 0 :
|
|
1204
|
-
}, Xe = (e) => {
|
|
1205
|
-
let t = e.lastIndexOf(".");
|
|
1206
|
-
return t !== -1 && We.has(e.slice(t + 1).toLowerCase());
|
|
1214
|
+
return n == null ? void 0 : Je[n];
|
|
1207
1215
|
}, Ze = (e) => {
|
|
1208
1216
|
let t = e.lastIndexOf(".");
|
|
1209
|
-
return t !== -1 &&
|
|
1210
|
-
}, Qe = {
|
|
1217
|
+
return t !== -1 && Ge.has(e.slice(t + 1).toLowerCase());
|
|
1218
|
+
}, Qe = (e) => {
|
|
1219
|
+
let t = e.lastIndexOf(".");
|
|
1220
|
+
return t !== -1 && We.has(e.slice(t + 1).toLowerCase());
|
|
1221
|
+
}, $e = {
|
|
1211
1222
|
xml: "xml",
|
|
1212
1223
|
csv: "plaintext",
|
|
1213
1224
|
tsv: "plaintext",
|
|
@@ -1255,144 +1266,148 @@ var K = { panel: "dial-attachment-canvas-panel" }, q = {
|
|
|
1255
1266
|
gitignore: "plaintext",
|
|
1256
1267
|
dockerfile: "plaintext",
|
|
1257
1268
|
makefile: "plaintext"
|
|
1258
|
-
},
|
|
1269
|
+
}, et = (e) => $e[e], $ = (e) => ({
|
|
1259
1270
|
type: i.Unsupported,
|
|
1260
1271
|
...e != null && { url: e }
|
|
1261
|
-
}),
|
|
1272
|
+
}), tt = (e) => ({
|
|
1262
1273
|
type: i.Error,
|
|
1263
1274
|
errorType: n.LoadFailed,
|
|
1264
1275
|
...e != null && { url: e }
|
|
1265
|
-
}),
|
|
1276
|
+
}), nt = (e) => ({
|
|
1266
1277
|
type: i.Error,
|
|
1267
1278
|
errorType: n.Forbidden,
|
|
1268
1279
|
...e != null && { url: e }
|
|
1269
|
-
}),
|
|
1280
|
+
}), rt = (e) => {
|
|
1270
1281
|
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;
|
|
1271
|
-
},
|
|
1272
|
-
let t =
|
|
1282
|
+
}, it = (e) => {
|
|
1283
|
+
let t = rt(e);
|
|
1273
1284
|
t != null && URL.revokeObjectURL(t);
|
|
1274
|
-
},
|
|
1285
|
+
}, at = {
|
|
1275
1286
|
type: i.PlainText,
|
|
1276
1287
|
text: ""
|
|
1277
|
-
},
|
|
1278
|
-
|
|
1279
|
-
var
|
|
1280
|
-
let t =
|
|
1288
|
+
}, ot = M(void 0);
|
|
1289
|
+
ot.displayName = "AttachmentCanvasContext";
|
|
1290
|
+
var st = M(void 0), ct = ({ children: e }) => {
|
|
1291
|
+
let t = R(0), n = F(() => {
|
|
1281
1292
|
let e = ++t.current;
|
|
1282
1293
|
return () => e === t.current;
|
|
1283
1294
|
}, []);
|
|
1284
|
-
|
|
1295
|
+
I(() => () => {
|
|
1285
1296
|
t.current += 1;
|
|
1286
1297
|
}, []);
|
|
1287
|
-
let [r, i] =
|
|
1288
|
-
u(e), f(t), o(!0), i(!0);
|
|
1289
|
-
}, []),
|
|
1290
|
-
c(e), u(t), f(n), o(!1), i(!0);
|
|
1291
|
-
}, []),
|
|
1292
|
-
c(
|
|
1298
|
+
let [r, i] = z(!1), [a, o] = z(!1), [s, c] = z(at), [l, u] = z(void 0), [d, f] = z(void 0), [p, m] = z(void 0), h = F((e, t) => {
|
|
1299
|
+
u(e), f(t), m(void 0), o(!0), i(!0);
|
|
1300
|
+
}, []), g = F((e, t, n, r) => {
|
|
1301
|
+
c(e), u(t), f(n), m(r == null ? void 0 : () => r), o(!1), i(!0);
|
|
1302
|
+
}, []), _ = F(() => {
|
|
1303
|
+
c(at), i(!1), o(!1), f(void 0), m(void 0);
|
|
1293
1304
|
}, []);
|
|
1294
|
-
return
|
|
1295
|
-
let e =
|
|
1305
|
+
return I(() => () => {
|
|
1306
|
+
let e = rt(s);
|
|
1296
1307
|
e != null && URL.revokeObjectURL(e);
|
|
1297
|
-
}, [s]), /* @__PURE__ */
|
|
1298
|
-
value:
|
|
1308
|
+
}, [s]), /* @__PURE__ */ B(ot.Provider, {
|
|
1309
|
+
value: L(() => ({
|
|
1299
1310
|
isOpen: r,
|
|
1300
1311
|
isLoading: a,
|
|
1301
1312
|
content: s,
|
|
1302
1313
|
fileName: l,
|
|
1303
1314
|
attachmentId: d,
|
|
1304
|
-
openCanvasLoading:
|
|
1305
|
-
openCanvas:
|
|
1306
|
-
closeCanvas:
|
|
1315
|
+
openCanvasLoading: h,
|
|
1316
|
+
openCanvas: g,
|
|
1317
|
+
closeCanvas: _,
|
|
1318
|
+
retryCanvas: p
|
|
1307
1319
|
}), [
|
|
1308
1320
|
r,
|
|
1309
1321
|
a,
|
|
1310
1322
|
s,
|
|
1311
1323
|
l,
|
|
1312
1324
|
d,
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1325
|
+
h,
|
|
1326
|
+
g,
|
|
1327
|
+
_,
|
|
1328
|
+
p
|
|
1316
1329
|
]),
|
|
1317
|
-
children: /* @__PURE__ */
|
|
1330
|
+
children: /* @__PURE__ */ B(st.Provider, {
|
|
1318
1331
|
value: n,
|
|
1319
1332
|
children: e
|
|
1320
1333
|
})
|
|
1321
1334
|
});
|
|
1322
|
-
},
|
|
1323
|
-
let e =
|
|
1335
|
+
}, lt = () => {
|
|
1336
|
+
let e = ce(ot);
|
|
1324
1337
|
if (!e) throw Error("useAttachmentCanvas must be used within an AttachmentCanvasProvider");
|
|
1325
1338
|
return e;
|
|
1326
|
-
},
|
|
1327
|
-
let e =
|
|
1339
|
+
}, ut = () => ce(st), dt = () => {
|
|
1340
|
+
let e = ce(st);
|
|
1328
1341
|
if (!e) throw Error("useLatestCanvasRequest must be used within an AttachmentCanvasProvider");
|
|
1329
|
-
let t =
|
|
1330
|
-
return
|
|
1342
|
+
let t = R(void 0);
|
|
1343
|
+
return I(() => (t.current = {}, () => {
|
|
1331
1344
|
t.current = void 0;
|
|
1332
|
-
}), []),
|
|
1345
|
+
}), []), F(() => {
|
|
1333
1346
|
let n = t.current, r = e();
|
|
1334
1347
|
return () => n !== void 0 && t.current === n && r();
|
|
1335
1348
|
}, [e]);
|
|
1336
|
-
},
|
|
1337
|
-
let { ariaLabel: p = "Attachment preview", closeLabel: m = "Close", downloadLabel: g = "Download", unsupportedLabel: _ = "Preview is not supported for this file", loadErrorLabel: v = "Failed to load file",
|
|
1338
|
-
a(
|
|
1339
|
-
}, [
|
|
1340
|
-
(
|
|
1341
|
-
}, [
|
|
1342
|
-
|
|
1343
|
-
}, [
|
|
1344
|
-
|
|
1345
|
-
}, [
|
|
1346
|
-
return /* @__PURE__ */
|
|
1347
|
-
isOpen:
|
|
1348
|
-
isLoading:
|
|
1349
|
-
onClose:
|
|
1350
|
-
|
|
1351
|
-
|
|
1349
|
+
}, ft = P(({ labels: e, leftActions: t, isMobile: n = !1, defaultWidth: r, minWidth: o, maxWidth: s, codeBlockTheme: c, tableDownloadFilename: l, loadPdf: u, configurePdfWorker: d, onVisualizerSendMessage: f }) => {
|
|
1350
|
+
let { ariaLabel: p = "Attachment preview", closeLabel: m = "Close", downloadLabel: g = "Download", unsupportedLabel: _ = "Preview is not supported for this file", loadErrorLabel: v = "Failed to load file", loadErrorRetryLabel: y, forbiddenErrorLabel: b = "You don't have permission to access this file", copyTextLabel: x, copiedTextLabel: S, copyMarkdownLabel: C, copiedMarkdownLabel: w, copyJsonLabel: ee, copiedJsonLabel: T, htmlFrameBlockedLabel: E, htmlOpenInNewTabLabel: D, htmlViewSourceLabel: O, htmlViewRenderedLabel: k, pdfThumbnailsLabel: A, pdfShowThumbnailsLabel: j, pdfHideThumbnailsLabel: te, pdfPageNumberLabel: ne, pdfContentLoadingLabel: re, pdfContentErrorLabel: ie, pdfContentRetryLabel: ae, xlsxFormulaLabel: oe, codeContentLoadingLabel: se, codeContentErrorLabel: M, codeContentRetryLabel: N, tableCopyLabel: P, tableCopiedLabel: ce, tableDownloadCsvLabel: I, codeBlockCopyLabel: L, codeBlockCopiedLabel: R, codeBlockDownloadLabel: z, tableScrollRegionAriaLabel: le, mathScrollRegionAriaLabel: ue, ooxmlHighlightsLabel: de, ooxmlHighlightNavigatedLabel: V } = e ?? {}, { isOpen: H, isLoading: fe, content: U, fileName: W, closeCanvas: pe, retryCanvas: me } = lt(), he = F(() => {
|
|
1351
|
+
a(U, W);
|
|
1352
|
+
}, [U, W]), ge = F(() => {
|
|
1353
|
+
(U.type === i.PlainText || U.type === i.Code) && h(U.text);
|
|
1354
|
+
}, [U]), G = F(() => {
|
|
1355
|
+
U.type === i.Markdown && h(U.text);
|
|
1356
|
+
}, [U]), K = F(() => {
|
|
1357
|
+
U.type === i.Json && h(JSON.stringify(U.value, null, 2));
|
|
1358
|
+
}, [U]);
|
|
1359
|
+
return /* @__PURE__ */ B(Ue, {
|
|
1360
|
+
isOpen: H,
|
|
1361
|
+
isLoading: fe,
|
|
1362
|
+
onClose: pe,
|
|
1363
|
+
onRetry: me,
|
|
1364
|
+
content: U,
|
|
1365
|
+
fileName: W,
|
|
1352
1366
|
leftActions: t,
|
|
1353
1367
|
labels: {
|
|
1354
1368
|
ariaLabel: p,
|
|
1355
1369
|
closeLabel: m,
|
|
1356
1370
|
downloadLabel: g,
|
|
1357
|
-
copyTextLabel:
|
|
1358
|
-
copiedTextLabel:
|
|
1359
|
-
copyMarkdownLabel:
|
|
1360
|
-
copiedMarkdownLabel:
|
|
1361
|
-
copyJsonLabel:
|
|
1371
|
+
copyTextLabel: x,
|
|
1372
|
+
copiedTextLabel: S,
|
|
1373
|
+
copyMarkdownLabel: C,
|
|
1374
|
+
copiedMarkdownLabel: w,
|
|
1375
|
+
copyJsonLabel: ee,
|
|
1362
1376
|
copiedJsonLabel: T,
|
|
1363
1377
|
unsupportedLabel: _,
|
|
1364
1378
|
loadErrorLabel: v,
|
|
1365
|
-
|
|
1379
|
+
loadErrorRetryLabel: y,
|
|
1380
|
+
forbiddenErrorLabel: b,
|
|
1366
1381
|
htmlFrameBlockedLabel: E,
|
|
1367
1382
|
htmlOpenInNewTabLabel: D,
|
|
1368
1383
|
htmlViewSourceLabel: O,
|
|
1369
1384
|
htmlViewRenderedLabel: k,
|
|
1370
1385
|
pdfThumbnailsLabel: A,
|
|
1371
1386
|
pdfShowThumbnailsLabel: j,
|
|
1372
|
-
pdfHideThumbnailsLabel:
|
|
1373
|
-
pdfPageNumberLabel:
|
|
1374
|
-
pdfContentLoadingLabel:
|
|
1375
|
-
pdfContentErrorLabel:
|
|
1376
|
-
pdfContentRetryLabel:
|
|
1377
|
-
xlsxFormulaLabel:
|
|
1378
|
-
codeContentLoadingLabel:
|
|
1379
|
-
codeContentErrorLabel:
|
|
1380
|
-
codeContentRetryLabel:
|
|
1381
|
-
tableCopyLabel:
|
|
1382
|
-
tableCopiedLabel:
|
|
1383
|
-
tableDownloadCsvLabel:
|
|
1384
|
-
codeBlockCopyLabel:
|
|
1385
|
-
codeBlockCopiedLabel:
|
|
1386
|
-
codeBlockDownloadLabel:
|
|
1387
|
-
tableScrollRegionAriaLabel:
|
|
1388
|
-
mathScrollRegionAriaLabel:
|
|
1389
|
-
ooxmlHighlightsLabel:
|
|
1390
|
-
ooxmlHighlightNavigatedLabel:
|
|
1387
|
+
pdfHideThumbnailsLabel: te,
|
|
1388
|
+
pdfPageNumberLabel: ne,
|
|
1389
|
+
pdfContentLoadingLabel: re,
|
|
1390
|
+
pdfContentErrorLabel: ie,
|
|
1391
|
+
pdfContentRetryLabel: ae,
|
|
1392
|
+
xlsxFormulaLabel: oe,
|
|
1393
|
+
codeContentLoadingLabel: se,
|
|
1394
|
+
codeContentErrorLabel: M,
|
|
1395
|
+
codeContentRetryLabel: N,
|
|
1396
|
+
tableCopyLabel: P,
|
|
1397
|
+
tableCopiedLabel: ce,
|
|
1398
|
+
tableDownloadCsvLabel: I,
|
|
1399
|
+
codeBlockCopyLabel: L,
|
|
1400
|
+
codeBlockCopiedLabel: R,
|
|
1401
|
+
codeBlockDownloadLabel: z,
|
|
1402
|
+
tableScrollRegionAriaLabel: le,
|
|
1403
|
+
mathScrollRegionAriaLabel: ue,
|
|
1404
|
+
ooxmlHighlightsLabel: de,
|
|
1405
|
+
ooxmlHighlightNavigatedLabel: V
|
|
1391
1406
|
},
|
|
1392
|
-
onDownload:
|
|
1393
|
-
onCopyText:
|
|
1394
|
-
onCopyMarkdown:
|
|
1395
|
-
onCopyJson:
|
|
1407
|
+
onDownload: he,
|
|
1408
|
+
onCopyText: U.type === i.PlainText || U.type === i.Code ? ge : void 0,
|
|
1409
|
+
onCopyMarkdown: U.type === i.Markdown ? G : void 0,
|
|
1410
|
+
onCopyJson: U.type === i.Json ? K : void 0,
|
|
1396
1411
|
tableDownloadFilename: l,
|
|
1397
1412
|
isMobile: n,
|
|
1398
1413
|
defaultWidth: r,
|
|
@@ -1403,30 +1418,30 @@ var ot = P(void 0), st = ({ children: e }) => {
|
|
|
1403
1418
|
loadPdf: u,
|
|
1404
1419
|
onVisualizerSendMessage: f
|
|
1405
1420
|
});
|
|
1406
|
-
}),
|
|
1421
|
+
}), pt = {
|
|
1407
1422
|
frame: "_frame_1ys0b_1",
|
|
1408
1423
|
header: "_header_1ys0b_6",
|
|
1409
1424
|
title: "_title_1ys0b_10"
|
|
1410
|
-
},
|
|
1425
|
+
}, mt = P(({ 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 }) => {
|
|
1411
1426
|
let p = e.visualizerName.trim(), h = !u && p !== "";
|
|
1412
|
-
return /* @__PURE__ */
|
|
1413
|
-
className: _("flex w-full min-w-0 flex-col overflow-hidden", !l && ["rounded-xl border",
|
|
1427
|
+
return /* @__PURE__ */ V("div", {
|
|
1428
|
+
className: _("flex w-full min-w-0 flex-col overflow-hidden", !l && ["rounded-xl border", pt.frame]),
|
|
1414
1429
|
style: m({
|
|
1415
1430
|
"--igv-bg": d?.background,
|
|
1416
1431
|
"--igv-border": d?.border,
|
|
1417
1432
|
"--igv-title-text": d?.titleText
|
|
1418
1433
|
}),
|
|
1419
|
-
children: [/* @__PURE__ */
|
|
1420
|
-
className: _("flex min-h-10 items-center gap-2 py-2", h ? "justify-between" : "justify-end", !l && ["border-b px-4",
|
|
1421
|
-
children: [h && /* @__PURE__ */
|
|
1422
|
-
className: _("min-w-0 truncate", c,
|
|
1434
|
+
children: [/* @__PURE__ */ V("div", {
|
|
1435
|
+
className: _("flex min-h-10 items-center gap-2 py-2", h ? "justify-between" : "justify-end", !l && ["border-b px-4", pt.header]),
|
|
1436
|
+
children: [h && /* @__PURE__ */ B("span", {
|
|
1437
|
+
className: _("min-w-0 truncate", c, pt.title),
|
|
1423
1438
|
children: p
|
|
1424
|
-
}), /* @__PURE__ */
|
|
1439
|
+
}), /* @__PURE__ */ B("div", {
|
|
1425
1440
|
role: "toolbar",
|
|
1426
1441
|
"aria-label": i,
|
|
1427
1442
|
className: "flex items-center gap-1",
|
|
1428
|
-
children: /* @__PURE__ */
|
|
1429
|
-
icon: /* @__PURE__ */
|
|
1443
|
+
children: /* @__PURE__ */ B(T, {
|
|
1444
|
+
icon: /* @__PURE__ */ B(A, {
|
|
1430
1445
|
size: S.SM,
|
|
1431
1446
|
stroke: C,
|
|
1432
1447
|
"aria-hidden": !0
|
|
@@ -1436,10 +1451,10 @@ var ot = P(void 0), st = ({ children: e }) => {
|
|
|
1436
1451
|
onClick: n
|
|
1437
1452
|
})
|
|
1438
1453
|
})]
|
|
1439
|
-
}), /* @__PURE__ */
|
|
1454
|
+
}), /* @__PURE__ */ B("div", {
|
|
1440
1455
|
className: "w-full",
|
|
1441
1456
|
style: { height: `${t}px` },
|
|
1442
|
-
children: /* @__PURE__ */
|
|
1457
|
+
children: /* @__PURE__ */ B(Le, {
|
|
1443
1458
|
content: e,
|
|
1444
1459
|
loadingLabel: o,
|
|
1445
1460
|
errorLabel: s,
|
|
@@ -1448,7 +1463,7 @@ var ot = P(void 0), st = ({ children: e }) => {
|
|
|
1448
1463
|
})
|
|
1449
1464
|
})]
|
|
1450
1465
|
});
|
|
1451
|
-
}),
|
|
1466
|
+
}), ht = (e) => {
|
|
1452
1467
|
let t;
|
|
1453
1468
|
try {
|
|
1454
1469
|
t = new URL(e).pathname;
|
|
@@ -1461,23 +1476,23 @@ var ot = P(void 0), st = ({ children: e }) => {
|
|
|
1461
1476
|
} catch {
|
|
1462
1477
|
return n;
|
|
1463
1478
|
}
|
|
1464
|
-
},
|
|
1465
|
-
let { openCanvas: n, openCanvasLoading: r, closeCanvas: a } =
|
|
1479
|
+
}, gt = (e, t) => {
|
|
1480
|
+
let { openCanvas: n, openCanvasLoading: r, closeCanvas: a } = lt(), o = ut(), { customVisualizers: s, themeId: l, onBeforeOpen: u } = t, p = R(null), m = F(async (t, n, r) => {
|
|
1466
1481
|
if (t.url == null && t.referenceUrl != null) {
|
|
1467
1482
|
let i = e.resolveReferencePdfContent(t);
|
|
1468
1483
|
if (i != null) return r(i, t.name, n);
|
|
1469
1484
|
}
|
|
1470
|
-
let a = t.contentType.toLowerCase(),
|
|
1471
|
-
if (
|
|
1472
|
-
let i = await e.resolveVisualizerContent(t,
|
|
1485
|
+
let a = t.contentType.toLowerCase(), o = je(a, s);
|
|
1486
|
+
if (o != null) {
|
|
1487
|
+
let i = await e.resolveVisualizerContent(t, o, l);
|
|
1473
1488
|
if (i != null) return r(i, t.name, n);
|
|
1474
1489
|
}
|
|
1475
1490
|
if (!a && t.data != null) {
|
|
1476
1491
|
let i = await e.resolveTextContent(t);
|
|
1477
1492
|
if (i != null) return r(i, t.name, n);
|
|
1478
1493
|
}
|
|
1479
|
-
let
|
|
1480
|
-
if (
|
|
1494
|
+
let c = Q("", a);
|
|
1495
|
+
if (c != null) return r(await e.resolveOoxmlContent(t, c) ?? $(e.resolveContentUrl(t)), t.name, n);
|
|
1481
1496
|
switch (a) {
|
|
1482
1497
|
case f.PDF: return r(await e.resolvePdfContent(t) ?? $(e.resolveContentUrl(t)), t.name, n);
|
|
1483
1498
|
case f.Markdown: return r(await e.resolveMarkdownContent(t) ?? $(e.resolveContentUrl(t)), t.name, n);
|
|
@@ -1500,8 +1515,8 @@ var ot = P(void 0), st = ({ children: e }) => {
|
|
|
1500
1515
|
return i != null && r(i, t.name, n);
|
|
1501
1516
|
}
|
|
1502
1517
|
}
|
|
1503
|
-
let g = t.name != null &&
|
|
1504
|
-
if (t.name != null && !
|
|
1518
|
+
let g = t.name != null && Qe(t.name) || t.url != null && Qe(ht(t.url));
|
|
1519
|
+
if (t.name != null && !Ze(t.name) && !g) return r($(e.resolveContentUrl(t)), t.name, n);
|
|
1505
1520
|
if (g) {
|
|
1506
1521
|
let a = await e.resolveHtmlContent(t);
|
|
1507
1522
|
return a == null ? e.hasTextSource(t) ? r($(e.resolveContentUrl(t)), t.name, n) : t.url != null && r({
|
|
@@ -1509,19 +1524,18 @@ var ot = P(void 0), st = ({ children: e }) => {
|
|
|
1509
1524
|
url: t.url
|
|
1510
1525
|
}, t.name, n) : r(a, t.name, n);
|
|
1511
1526
|
}
|
|
1512
|
-
let _ = await e.resolveCodeContent(t,
|
|
1527
|
+
let _ = await e.resolveCodeContent(t, et(m));
|
|
1513
1528
|
return _ != null && r(_, t.name, n);
|
|
1514
1529
|
}, [
|
|
1515
|
-
o,
|
|
1516
1530
|
s,
|
|
1531
|
+
l,
|
|
1517
1532
|
e
|
|
1518
|
-
])
|
|
1519
|
-
|
|
1520
|
-
let d = () => s == null || s(), f = (e, t, r) => d() ? (n(e, t, r), !0) : (rt(e), !1);
|
|
1533
|
+
]), h = F(async (t, s = t.id, l) => {
|
|
1534
|
+
let d = () => l == null || l(), f = (e, t, r) => d() ? (n(e, t, r), !0) : (it(e), !1);
|
|
1521
1535
|
switch (t.type) {
|
|
1522
1536
|
case c.Image: {
|
|
1523
1537
|
let r = e.resolveImageContent(t);
|
|
1524
|
-
return r != null && (
|
|
1538
|
+
return r != null && (u?.(), n(r, t.name, s), !0);
|
|
1525
1539
|
}
|
|
1526
1540
|
case c.Audio: {
|
|
1527
1541
|
let e = t.playUrl ?? t.url;
|
|
@@ -1529,18 +1543,21 @@ var ot = P(void 0), st = ({ children: e }) => {
|
|
|
1529
1543
|
type: i.Audio,
|
|
1530
1544
|
url: e,
|
|
1531
1545
|
mimeType: t.contentType || void 0
|
|
1532
|
-
}, t.name,
|
|
1546
|
+
}, t.name, s), !0);
|
|
1533
1547
|
}
|
|
1534
1548
|
case c.File: {
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1549
|
+
let e = () => {
|
|
1550
|
+
p.current?.(t, s, o?.());
|
|
1551
|
+
}, i = (t, r, i) => d() ? (n(t, r, i, e), !0) : (it(t), !1);
|
|
1552
|
+
u?.(), r(t.name, s);
|
|
1553
|
+
let c = await m(t, s, i);
|
|
1554
|
+
return !c && d() && a(), c;
|
|
1538
1555
|
}
|
|
1539
1556
|
case c.Pasted:
|
|
1540
1557
|
case c.Prompt: {
|
|
1541
|
-
|
|
1558
|
+
u?.(), r(t.name, s);
|
|
1542
1559
|
let n = await e.resolveTextContent(t);
|
|
1543
|
-
return n == null ? (d() && a(), !1) : f(n, t.name,
|
|
1560
|
+
return n == null ? (d() && a(), !1) : f(n, t.name, s);
|
|
1544
1561
|
}
|
|
1545
1562
|
default: return !1;
|
|
1546
1563
|
}
|
|
@@ -1548,10 +1565,14 @@ var ot = P(void 0), st = ({ children: e }) => {
|
|
|
1548
1565
|
n,
|
|
1549
1566
|
r,
|
|
1550
1567
|
a,
|
|
1551
|
-
l,
|
|
1552
1568
|
u,
|
|
1553
|
-
|
|
1554
|
-
|
|
1569
|
+
m,
|
|
1570
|
+
e,
|
|
1571
|
+
o
|
|
1572
|
+
]);
|
|
1573
|
+
return I(() => {
|
|
1574
|
+
p.current = h;
|
|
1575
|
+
}, [h]), { openAttachmentCanvas: h };
|
|
1555
1576
|
};
|
|
1556
1577
|
//#endregion
|
|
1557
|
-
export {
|
|
1578
|
+
export { he as ATTACHMENT_CANVAS_CLASS, Ue as AttachmentCanvas, Be as AttachmentCanvasBody, ft as AttachmentCanvasContainer, ct as AttachmentCanvasProvider, i as AttachmentContentType, n as AttachmentErrorType, _e as CodeContent, ve as HTML_PREVIEW_FRAME_RENDER_MESSAGE, mt as InlineGroupedVisualizer, Ee as McpAppCanvasRenderer, r as OoxmlFileType, t as OoxmlHighlightKind, nt as createForbiddenCanvasContent, tt as createLoadErrorCanvasContent, $ as createUnsupportedCanvasContent, a as downloadAttachmentContent, et as extensionToLanguage, Me as findVisualizerForApplication, je as findVisualizerForMime, Q as getOoxmlFileType, Xe as getOoxmlMimeType, Ne as groupedVisualizerCanvasKey, o as isDownloadable, Qe as isHtmlPreviewable, Ye as isOoxmlPreviewable, Ze as isTextPreviewable, Pe as partitionAttachmentsForApplicationVisualizer, lt as useAttachmentCanvas, dt as useLatestCanvasRequest, gt as useOpenAttachmentCanvas };
|