@canofold/markdown 0.3.1 → 0.3.2
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/README.md +2 -0
- package/README.zh-CN.md +2 -0
- package/dist/ImageGallery-Bcpjlfh9.js +569 -0
- package/dist/Markdown-607_slPB.js +117 -0
- package/dist/assets-CqlggKr8.js +77 -0
- package/dist/client/bundler.js +308 -0
- package/dist/client/chunks/{client-CTpZrdpv.js → client-CHUUETWE.js} +3 -3
- package/dist/client/chunks/{gallery-BTg1qJjd.js → gallery-Cr0TgC1h.js} +2 -2
- package/dist/client/chunks/{image-BsfZtDsx.js → image-6_o7fPkU.js} +3 -3
- package/dist/client/chunks/provider-k1N-5njv.js +1037 -0
- package/dist/client/chunks/react-runtime-DRPMrVPX.js +12062 -0
- package/dist/client/chunks/{serialized-Ck9NBdg7.js → serialized-Chn9ydGA.js} +334 -295
- package/dist/client/chunks/{table-jaJMPch3.js → table-D99-Zhc8.js} +3 -3
- package/dist/client/index.js +1 -1
- package/dist/componentMap-CKSUGzQH.js +1483 -0
- package/dist/copyText-C0ZgrMnH.js +18 -0
- package/dist/{directiveValidation-BdVbgcY_.js → directiveValidation-B7LY-R5p.js} +187 -248
- package/dist/fileKinds-BPzIxbaS.js +170 -0
- package/dist/gallery-BqQ-i0TC.js +42 -0
- package/dist/image-CiPni6Az.js +38 -0
- package/dist/index.js +2 -2
- package/dist/plugins-CXYBB-oH.js +130 -0
- package/dist/{prepareMarkdown-DPMq7203.js → prepareMarkdown-CS6sALIb.js} +13 -11
- package/dist/provider-BJDHf4Z_.js +8 -0
- package/dist/serialized-DFiNQYA5.js +39 -0
- package/dist/server/analyze.js +11 -11
- package/dist/server.js +30 -28
- package/dist/table-DQSeLjVL.js +32 -0
- package/package.json +14 -9
- package/dist/Markdown-CPG2lcO7.js +0 -2127
- package/dist/client/chunks/provider-DNSHvvN7.js +0 -841
- package/dist/client/chunks/react-runtime-Dzgdzn6D.js +0 -10571
- package/dist/plugins-StkCS2su.js +0 -298
|
@@ -0,0 +1,1483 @@
|
|
|
1
|
+
import { useState as B, useEffect as re, Children as E, isValidElement as D, useRef as V, cloneElement as O, useMemo as ta, useId as oa, version as na, Fragment as ca, createElement as v } from "react";
|
|
2
|
+
import { jsxs as k, jsx as l, Fragment as U } from "react/jsx-runtime";
|
|
3
|
+
import { Check as ra, ChevronDown as ia, CheckCircle2 as la, TriangleAlert as sa, CircleAlert as da, Info as fa } from "lucide-react";
|
|
4
|
+
import { D as M, b as j, s as u, m as K, c as q, e as Q, d as R, r as W, u as ua, t as ba, g as Ve, f as pa, h as Ge, i as He, j as me, k as ma, I as he, l as ya, n as ge } from "./ImageGallery-Bcpjlfh9.js";
|
|
5
|
+
import "react-dom";
|
|
6
|
+
import { c as Ze } from "./copyText-C0ZgrMnH.js";
|
|
7
|
+
import { m as ha, a as ga } from "./fileKinds-BPzIxbaS.js";
|
|
8
|
+
const qe = 1500;
|
|
9
|
+
function ue({
|
|
10
|
+
value: e,
|
|
11
|
+
label: a,
|
|
12
|
+
action: t,
|
|
13
|
+
className: o = "cf-block-button",
|
|
14
|
+
icon: c = "copy",
|
|
15
|
+
failureLabel: i = M.copyFailed
|
|
16
|
+
}) {
|
|
17
|
+
const [n, r] = B("idle");
|
|
18
|
+
re(() => {
|
|
19
|
+
if (n === "idle") return;
|
|
20
|
+
const d = setTimeout(() => r("idle"), qe);
|
|
21
|
+
return () => clearTimeout(d);
|
|
22
|
+
}, [n]);
|
|
23
|
+
const s = n === "success" ? `${a} ✓` : n === "error" ? i : a;
|
|
24
|
+
return /* @__PURE__ */ k(
|
|
25
|
+
"button",
|
|
26
|
+
{
|
|
27
|
+
className: `${o}${n === "success" ? " cf-action-success" : ""}${n === "error" ? " cf-action-error" : ""}`,
|
|
28
|
+
type: "button",
|
|
29
|
+
"data-cf-action": t,
|
|
30
|
+
"data-cf-copied": n === "success" ? "true" : void 0,
|
|
31
|
+
"data-cf-copy-error": n === "error" ? "true" : void 0,
|
|
32
|
+
"aria-label": s,
|
|
33
|
+
title: s,
|
|
34
|
+
onClick: async () => {
|
|
35
|
+
try {
|
|
36
|
+
r(await Ze(e) ? "success" : "error");
|
|
37
|
+
} catch {
|
|
38
|
+
r("error");
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
children: [
|
|
42
|
+
/* @__PURE__ */ l("span", { className: "cf-action-icon cf-action-icon-copy", "aria-hidden": "true", children: /* @__PURE__ */ l(j, { name: c }) }),
|
|
43
|
+
/* @__PURE__ */ l("span", { className: "cf-action-icon cf-action-icon-success", "aria-hidden": "true", children: /* @__PURE__ */ l(ra, { size: 16, strokeWidth: 2, "aria-hidden": "true" }) }),
|
|
44
|
+
/* @__PURE__ */ l("span", { className: "cf-sr-only", "aria-live": "polite", "aria-atomic": "true", children: n === "idle" ? "" : s })
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
function va({
|
|
50
|
+
value: e,
|
|
51
|
+
filename: a,
|
|
52
|
+
label: t,
|
|
53
|
+
action: o,
|
|
54
|
+
className: c = "cf-block-button",
|
|
55
|
+
contentType: i = "text/plain;charset=utf-8"
|
|
56
|
+
}) {
|
|
57
|
+
const [n, r] = B();
|
|
58
|
+
return re(() => {
|
|
59
|
+
if (typeof URL > "u" || typeof URL.createObjectURL != "function") return;
|
|
60
|
+
const s = URL.createObjectURL(new Blob([e], { type: i }));
|
|
61
|
+
return r(s), () => URL.revokeObjectURL(s);
|
|
62
|
+
}, [i, e]), /* @__PURE__ */ l(
|
|
63
|
+
"a",
|
|
64
|
+
{
|
|
65
|
+
className: c,
|
|
66
|
+
href: n ?? "#",
|
|
67
|
+
download: a,
|
|
68
|
+
"data-cf-action": o,
|
|
69
|
+
"aria-disabled": n ? void 0 : "true",
|
|
70
|
+
"aria-label": t,
|
|
71
|
+
title: t,
|
|
72
|
+
tabIndex: n ? void 0 : -1,
|
|
73
|
+
onClick: (s) => {
|
|
74
|
+
n || s.preventDefault();
|
|
75
|
+
},
|
|
76
|
+
children: /* @__PURE__ */ l(j, { name: "download" })
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
function Ca({ filename: e, language: a }) {
|
|
81
|
+
const t = ha(e, a), o = ga(e, a);
|
|
82
|
+
return /* @__PURE__ */ l(
|
|
83
|
+
"span",
|
|
84
|
+
{
|
|
85
|
+
className: "cf-code-file-icon",
|
|
86
|
+
"data-cf-file-icon": o,
|
|
87
|
+
"data-cf-file-kind": t,
|
|
88
|
+
"aria-hidden": "true"
|
|
89
|
+
}
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
function wa(e) {
|
|
93
|
+
const a = Q(e).find((t) => R(t) === "pre");
|
|
94
|
+
return W(a ? a.props.children : e);
|
|
95
|
+
}
|
|
96
|
+
function ve({
|
|
97
|
+
children: e,
|
|
98
|
+
source: a,
|
|
99
|
+
language: t,
|
|
100
|
+
filename: o,
|
|
101
|
+
overflow: c,
|
|
102
|
+
copyLabel: i,
|
|
103
|
+
copyFailureLabel: n,
|
|
104
|
+
...r
|
|
105
|
+
}) {
|
|
106
|
+
const s = r, d = a ?? (u(s, "data-cf-source", "dataCfSource") || wa(e)), b = t ?? (u(s, "data-cf-language", "dataCfLanguage") || "text"), f = o ?? (u(s, "data-cf-filename", "dataCfFilename") || void 0), h = u(s, "data-cf-code-overflow", "dataCfCodeOverflow"), m = c ?? (h === "wrap" || h === "scroll" ? h : void 0), w = i ?? (u(s, "data-cf-copy-label", "dataCfCopyLabel") || M.copyCode), C = n ?? (u(s, "data-cf-copy-failure-label", "dataCfCopyFailureLabel") || M.copyFailed), T = K("cf-code", s.className), { className: p, ...L } = q(s);
|
|
107
|
+
return /* @__PURE__ */ k(
|
|
108
|
+
"figure",
|
|
109
|
+
{
|
|
110
|
+
...L,
|
|
111
|
+
className: T,
|
|
112
|
+
"data-cf-component": "code-block",
|
|
113
|
+
"data-cf-slot": "root",
|
|
114
|
+
"data-cf-code-overflow": m,
|
|
115
|
+
children: [
|
|
116
|
+
/* @__PURE__ */ l(
|
|
117
|
+
ka,
|
|
118
|
+
{
|
|
119
|
+
source: d,
|
|
120
|
+
language: b,
|
|
121
|
+
filename: f,
|
|
122
|
+
copyLabel: w,
|
|
123
|
+
copyFailureLabel: C
|
|
124
|
+
}
|
|
125
|
+
),
|
|
126
|
+
e
|
|
127
|
+
]
|
|
128
|
+
}
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
function ka({
|
|
132
|
+
source: e,
|
|
133
|
+
language: a,
|
|
134
|
+
filename: t,
|
|
135
|
+
copyLabel: o = M.copyCode,
|
|
136
|
+
copyFailureLabel: c = M.copyFailed
|
|
137
|
+
}) {
|
|
138
|
+
return /* @__PURE__ */ l(
|
|
139
|
+
"div",
|
|
140
|
+
{
|
|
141
|
+
className: "cf-code-bar",
|
|
142
|
+
"data-cf-slot": "toolbar",
|
|
143
|
+
"data-cf-behavior": "code-toolbar",
|
|
144
|
+
"data-cf-language": a,
|
|
145
|
+
"data-cf-filename": t,
|
|
146
|
+
"data-cf-copy-label": o,
|
|
147
|
+
"data-cf-copy-failure-label": c,
|
|
148
|
+
children: /* @__PURE__ */ k(U, { children: [
|
|
149
|
+
t ? /* @__PURE__ */ k("span", { className: "cf-code-file", "data-cf-slot": "title", "data-cf-language": a, children: [
|
|
150
|
+
/* @__PURE__ */ l(Ca, { filename: t, language: a }),
|
|
151
|
+
/* @__PURE__ */ l("span", { className: "cf-code-file-name", children: t })
|
|
152
|
+
] }) : /* @__PURE__ */ l("span", { className: "cf-code-lang", "data-cf-slot": "title", children: a }),
|
|
153
|
+
/* @__PURE__ */ l("div", { className: "cf-block-actions", "data-cf-slot": "actions", children: /* @__PURE__ */ l(
|
|
154
|
+
ue,
|
|
155
|
+
{
|
|
156
|
+
value: e,
|
|
157
|
+
label: o,
|
|
158
|
+
failureLabel: c,
|
|
159
|
+
action: "copy-code"
|
|
160
|
+
}
|
|
161
|
+
) })
|
|
162
|
+
] })
|
|
163
|
+
}
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
function Ce({
|
|
167
|
+
children: e,
|
|
168
|
+
value: a,
|
|
169
|
+
copyLabel: t,
|
|
170
|
+
copyFailureLabel: o,
|
|
171
|
+
className: c,
|
|
172
|
+
inner: i = !1,
|
|
173
|
+
...n
|
|
174
|
+
}) {
|
|
175
|
+
const r = a ?? (u(n, "data-cf-value", "dataCfValue") || W(e)), s = t || u(n, "data-cf-copy-label", "dataCfCopyLabel") || M.copySnippet, d = o || u(n, "data-cf-copy-failure-label", "dataCfCopyFailureLabel") || M.copyFailed, b = K("cf-copy-snippet", c), { className: f, ...h } = q(n), m = /* @__PURE__ */ k(U, { children: [
|
|
176
|
+
/* @__PURE__ */ l("code", { "data-cf-slot": "content", children: e ?? r }),
|
|
177
|
+
/* @__PURE__ */ l(
|
|
178
|
+
ue,
|
|
179
|
+
{
|
|
180
|
+
value: r,
|
|
181
|
+
label: s,
|
|
182
|
+
action: "copy-snippet",
|
|
183
|
+
className: "cf-copy-snippet-button",
|
|
184
|
+
failureLabel: d
|
|
185
|
+
}
|
|
186
|
+
)
|
|
187
|
+
] });
|
|
188
|
+
return i ? m : /* @__PURE__ */ l(
|
|
189
|
+
"span",
|
|
190
|
+
{
|
|
191
|
+
...h,
|
|
192
|
+
className: b,
|
|
193
|
+
"data-cf-component": "copy-snippet",
|
|
194
|
+
"data-cf-slot": "root",
|
|
195
|
+
"data-cf-behavior": "copy-snippet",
|
|
196
|
+
"data-cf-value": r,
|
|
197
|
+
"data-cf-copy-label": s,
|
|
198
|
+
"data-cf-copy-failure-label": d,
|
|
199
|
+
children: m
|
|
200
|
+
}
|
|
201
|
+
);
|
|
202
|
+
}
|
|
203
|
+
function we(e) {
|
|
204
|
+
return e.type === "root" ? ["r", e.children.map(we)] : e.type === "element" ? ["e", e.tagName, e.properties, e.children.map(we)] : e.type === "comment" ? ["c", e.value] : ["t", "value" in e ? String(e.value) : ""];
|
|
205
|
+
}
|
|
206
|
+
function ke(e) {
|
|
207
|
+
return e[0] === "r" ? { type: "root", children: e[1].map(ke) } : e[0] === "e" ? {
|
|
208
|
+
type: "element",
|
|
209
|
+
tagName: e[1],
|
|
210
|
+
properties: e[2],
|
|
211
|
+
children: e[3].map(ke)
|
|
212
|
+
} : e[0] === "c" ? { type: "comment", value: e[1] } : { type: "text", value: e[1] };
|
|
213
|
+
}
|
|
214
|
+
function Le(e) {
|
|
215
|
+
return Array.isArray(e) ? e[0] === "r" ? e.length === 2 && Array.isArray(e[1]) && e[1].every(Le) : e[0] === "e" ? e.length === 4 && typeof e[1] == "string" && !!e[2] && typeof e[2] == "object" && !Array.isArray(e[2]) && Array.isArray(e[3]) && e[3].every(Le) : (e[0] === "t" || e[0] === "c") && e.length === 2 && typeof e[1] == "string" : !1;
|
|
216
|
+
}
|
|
217
|
+
function La(e) {
|
|
218
|
+
try {
|
|
219
|
+
return !e || typeof e != "object" || typeof e.type != "string" ? void 0 : JSON.stringify(we(e));
|
|
220
|
+
} catch {
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
function Ya(e) {
|
|
225
|
+
try {
|
|
226
|
+
const a = JSON.parse(e ?? "null");
|
|
227
|
+
return Le(a) ? ke(a) : void 0;
|
|
228
|
+
} catch {
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
function Ne({
|
|
233
|
+
children: e,
|
|
234
|
+
node: a,
|
|
235
|
+
src: t,
|
|
236
|
+
alt: o,
|
|
237
|
+
caption: c,
|
|
238
|
+
title: i,
|
|
239
|
+
width: n,
|
|
240
|
+
height: r,
|
|
241
|
+
loading: s,
|
|
242
|
+
srcSet: d,
|
|
243
|
+
sizes: b,
|
|
244
|
+
zoomLabel: f,
|
|
245
|
+
closeLabel: h,
|
|
246
|
+
inner: m = !1,
|
|
247
|
+
...w
|
|
248
|
+
}) {
|
|
249
|
+
const C = w, T = ua(), p = t && T ? T(t, "src") : t, L = d && T ? ba(d, T) : d, y = Ve(pa()), x = E.toArray(e).find(
|
|
250
|
+
(Z) => D(Z) && R(Z) === "img"
|
|
251
|
+
), A = E.toArray(e).find((Z) => {
|
|
252
|
+
if (!D(Z)) return !1;
|
|
253
|
+
const ae = Z;
|
|
254
|
+
return R(ae) === "figcaption" || ae.props["data-cf-slot"] === "caption";
|
|
255
|
+
}), F = f || u(C, "data-cf-zoom-label", "dataCfZoomLabel") || M.zoomImage, I = h || u(C, "data-cf-close-label", "dataCfCloseLabel") || M.closeImagePreview, [S, _] = B(!1), P = V(null), N = V(null), z = V(null), H = () => _(!1), Y = Ge({
|
|
256
|
+
open: S,
|
|
257
|
+
close: H,
|
|
258
|
+
dialogRef: z,
|
|
259
|
+
initialFocusRef: N,
|
|
260
|
+
triggerRef: P
|
|
261
|
+
}), oe = x ?? (p ? /* @__PURE__ */ l(
|
|
262
|
+
"img",
|
|
263
|
+
{
|
|
264
|
+
src: p,
|
|
265
|
+
alt: o ?? "",
|
|
266
|
+
title: i,
|
|
267
|
+
width: n,
|
|
268
|
+
height: r,
|
|
269
|
+
loading: s,
|
|
270
|
+
srcSet: L,
|
|
271
|
+
sizes: b,
|
|
272
|
+
"data-cf-element": "image"
|
|
273
|
+
}
|
|
274
|
+
) : null), J = A ?? (c ? /* @__PURE__ */ l("figcaption", { "data-cf-slot": "caption", children: c }) : null), ee = K("cf-media-frame", C.className), { className: ie, ...le } = q(C);
|
|
275
|
+
if (!oe)
|
|
276
|
+
return m ? /* @__PURE__ */ l(U, { children: e }) : /* @__PURE__ */ l("figure", { ...le, className: ee, "data-cf-component": "image", "data-cf-slot": "root", children: e });
|
|
277
|
+
const pe = /* @__PURE__ */ k(U, { children: [
|
|
278
|
+
/* @__PURE__ */ l(
|
|
279
|
+
"button",
|
|
280
|
+
{
|
|
281
|
+
ref: P,
|
|
282
|
+
className: "cf-media-zoom",
|
|
283
|
+
type: "button",
|
|
284
|
+
"data-cf-action": "zoom-image",
|
|
285
|
+
"data-cf-slot": "action",
|
|
286
|
+
"aria-label": F,
|
|
287
|
+
"aria-haspopup": "dialog",
|
|
288
|
+
title: F,
|
|
289
|
+
onClick: () => _(!0),
|
|
290
|
+
children: oe
|
|
291
|
+
}
|
|
292
|
+
),
|
|
293
|
+
J ? y ? /* @__PURE__ */ l(y, { ...J.props, "data-cf-slot": "caption", children: J.props.children }) : /* @__PURE__ */ l("figcaption", { "data-cf-slot": "caption", children: J.props.children }) : null,
|
|
294
|
+
S ? /* @__PURE__ */ l(He, { children: /* @__PURE__ */ k(
|
|
295
|
+
"div",
|
|
296
|
+
{
|
|
297
|
+
ref: z,
|
|
298
|
+
className: "cf-image-lightbox",
|
|
299
|
+
"data-cf-slot": "lightbox",
|
|
300
|
+
role: "dialog",
|
|
301
|
+
"aria-modal": "true",
|
|
302
|
+
"aria-label": F,
|
|
303
|
+
tabIndex: -1,
|
|
304
|
+
onKeyDown: Y,
|
|
305
|
+
children: [
|
|
306
|
+
/* @__PURE__ */ l(
|
|
307
|
+
"div",
|
|
308
|
+
{
|
|
309
|
+
className: "cf-image-lightbox-backdrop",
|
|
310
|
+
"data-cf-action": "close-image",
|
|
311
|
+
"aria-hidden": "true",
|
|
312
|
+
onClick: H
|
|
313
|
+
}
|
|
314
|
+
),
|
|
315
|
+
/* @__PURE__ */ k("div", { className: "cf-image-lightbox-card", children: [
|
|
316
|
+
/* @__PURE__ */ l(
|
|
317
|
+
"button",
|
|
318
|
+
{
|
|
319
|
+
ref: N,
|
|
320
|
+
className: "cf-icon-button cf-image-lightbox-close",
|
|
321
|
+
type: "button",
|
|
322
|
+
"data-cf-action": "close-image",
|
|
323
|
+
"data-cf-slot": "close",
|
|
324
|
+
"aria-label": I,
|
|
325
|
+
onClick: H,
|
|
326
|
+
children: /* @__PURE__ */ l(j, { name: "close" })
|
|
327
|
+
}
|
|
328
|
+
),
|
|
329
|
+
O(oe, { loading: "eager" }),
|
|
330
|
+
J ? /* @__PURE__ */ l("p", { children: W(J.props.children) }) : null
|
|
331
|
+
] })
|
|
332
|
+
]
|
|
333
|
+
}
|
|
334
|
+
) }) : null
|
|
335
|
+
] });
|
|
336
|
+
return m ? pe : /* @__PURE__ */ l(
|
|
337
|
+
"figure",
|
|
338
|
+
{
|
|
339
|
+
...le,
|
|
340
|
+
className: ee,
|
|
341
|
+
"data-cf-component": "image",
|
|
342
|
+
"data-cf-slot": "root",
|
|
343
|
+
"data-cf-island": "image",
|
|
344
|
+
"data-cf-zoom-label": F,
|
|
345
|
+
"data-cf-close-label": I,
|
|
346
|
+
"data-cf-island-data": La(a),
|
|
347
|
+
children: pe
|
|
348
|
+
}
|
|
349
|
+
);
|
|
350
|
+
}
|
|
351
|
+
function Na(e) {
|
|
352
|
+
return Q(e).find((a) => R(a) === "table");
|
|
353
|
+
}
|
|
354
|
+
function Me(e) {
|
|
355
|
+
return e ? Q(e.props.children).filter((a) => R(a) === "tr") : [];
|
|
356
|
+
}
|
|
357
|
+
function se(e) {
|
|
358
|
+
return Q(e.props.children).filter(
|
|
359
|
+
(a) => R(a) === "th" || R(a) === "td"
|
|
360
|
+
);
|
|
361
|
+
}
|
|
362
|
+
function je(e, a) {
|
|
363
|
+
return Q(e.props.children).find(
|
|
364
|
+
(t) => R(t) === a
|
|
365
|
+
);
|
|
366
|
+
}
|
|
367
|
+
function Ma(e) {
|
|
368
|
+
return /[",\n]/.test(e) ? `"${e.replace(/"/g, '""')}"` : e;
|
|
369
|
+
}
|
|
370
|
+
function Sa(e) {
|
|
371
|
+
return e ? Q(e.props.children).filter(
|
|
372
|
+
(t) => R(t) === "thead" || R(t) === "tbody"
|
|
373
|
+
).flatMap(
|
|
374
|
+
(t) => Me(t).map(
|
|
375
|
+
(o) => se(o).map((c) => Ma(W(c.props.children))).join(",")
|
|
376
|
+
)
|
|
377
|
+
).join(`
|
|
378
|
+
`) : "";
|
|
379
|
+
}
|
|
380
|
+
function Fa(e, a, t, o) {
|
|
381
|
+
if (!e) return null;
|
|
382
|
+
const c = je(e, "thead"), i = je(e, "tbody"), n = Me(c), r = n[0] ? se(n[0]).map((b, f) => {
|
|
383
|
+
const h = a?.column === f, m = h ? a.direction : void 0;
|
|
384
|
+
return O(b, {
|
|
385
|
+
"aria-sort": h ? m === "asc" ? "ascending" : "descending" : void 0,
|
|
386
|
+
children: /* @__PURE__ */ k(
|
|
387
|
+
"button",
|
|
388
|
+
{
|
|
389
|
+
className: "cf-sort-button",
|
|
390
|
+
type: "button",
|
|
391
|
+
"data-cf-action": "sort-table",
|
|
392
|
+
"data-column": String(f),
|
|
393
|
+
"data-sort": m,
|
|
394
|
+
"aria-pressed": h ? "true" : "false",
|
|
395
|
+
"aria-label": t.replace("{column}", String(f + 1)),
|
|
396
|
+
title: t.replace("{column}", String(f + 1)),
|
|
397
|
+
onClick: () => o?.(f),
|
|
398
|
+
children: [
|
|
399
|
+
/* @__PURE__ */ l("span", { className: "cf-sort-label", children: b.props.children }),
|
|
400
|
+
/* @__PURE__ */ l("span", { className: "cf-sort-icon", "aria-hidden": "true", children: /* @__PURE__ */ l(j, { name: "sort", direction: m }) })
|
|
401
|
+
]
|
|
402
|
+
}
|
|
403
|
+
)
|
|
404
|
+
});
|
|
405
|
+
}) : [], s = i ? Me(i).slice().sort((b, f) => {
|
|
406
|
+
if (!a) return 0;
|
|
407
|
+
const h = W(se(b)[a.column]?.props.children), m = W(se(f)[a.column]?.props.children), w = h.localeCompare(m, void 0, { numeric: !0, sensitivity: "base" });
|
|
408
|
+
return a.direction === "asc" ? w : -w;
|
|
409
|
+
}) : [], d = Q(e.props.children).map((b) => R(b) === "thead" && n[0] ? O(b, {
|
|
410
|
+
children: n.map(
|
|
411
|
+
(f, h) => h === 0 ? O(f, { children: r }) : f
|
|
412
|
+
)
|
|
413
|
+
}) : R(b) === "tbody" && i && a ? O(b, { children: s }) : b);
|
|
414
|
+
return O(e, { children: d });
|
|
415
|
+
}
|
|
416
|
+
function Se({
|
|
417
|
+
children: e,
|
|
418
|
+
tableTitle: a,
|
|
419
|
+
copyLabel: t,
|
|
420
|
+
copyFailureLabel: o,
|
|
421
|
+
downloadLabel: c,
|
|
422
|
+
zoomLabel: i,
|
|
423
|
+
closeLabel: n,
|
|
424
|
+
sortLabel: r,
|
|
425
|
+
serializedTable: s,
|
|
426
|
+
inner: d = !1,
|
|
427
|
+
...b
|
|
428
|
+
}) {
|
|
429
|
+
const f = b, h = Na(e), m = ta(() => Sa(h), [h]), [w, C] = B(null), [T, p] = B(!1), L = V(null), y = V(null), x = V(null), A = a || u(f, "data-cf-table-title", "dataCfTableTitle") || M.tableTitle, F = t || u(f, "data-cf-copy-label", "dataCfCopyLabel") || M.copyTableCsv, I = o || u(f, "data-cf-copy-failure-label", "dataCfCopyFailureLabel") || M.copyFailed, S = c || u(f, "data-cf-download-label", "dataCfDownloadLabel") || M.downloadTableCsv, _ = i || u(f, "data-cf-zoom-label", "dataCfZoomLabel") || M.zoomTable, P = n || u(f, "data-cf-close-label", "dataCfCloseLabel") || M.closeTablePreview, N = r || u(f, "data-cf-sort-label", "dataCfSortLabel") || M.sortTableColumn, z = s ?? u(f, "data-cf-table", "dataCfTable"), H = K("cf-table-window", f.className), { className: Y, ...oe } = q(f), ee = Fa(h, w, N, (ae) => C(
|
|
430
|
+
(Be) => Be?.column === ae ? Be.direction === "asc" ? { column: ae, direction: "desc" } : null : { column: ae, direction: "asc" }
|
|
431
|
+
)), ie = () => p(!1), le = Ge({
|
|
432
|
+
open: T,
|
|
433
|
+
close: ie,
|
|
434
|
+
dialogRef: x,
|
|
435
|
+
initialFocusRef: x,
|
|
436
|
+
triggerRef: L
|
|
437
|
+
}), Z = /* @__PURE__ */ k(U, { children: [
|
|
438
|
+
/* @__PURE__ */ k("div", { className: "cf-block-toolbar", "data-cf-slot": "toolbar", children: [
|
|
439
|
+
/* @__PURE__ */ k("span", { className: "cf-block-title", "data-cf-slot": "title", children: [
|
|
440
|
+
/* @__PURE__ */ l(j, { name: "table" }),
|
|
441
|
+
/* @__PURE__ */ l("span", { children: A })
|
|
442
|
+
] }),
|
|
443
|
+
/* @__PURE__ */ k("div", { className: "cf-block-actions", "data-cf-slot": "actions", children: [
|
|
444
|
+
/* @__PURE__ */ l(
|
|
445
|
+
ue,
|
|
446
|
+
{
|
|
447
|
+
value: m,
|
|
448
|
+
label: F,
|
|
449
|
+
failureLabel: I,
|
|
450
|
+
action: "copy-table"
|
|
451
|
+
}
|
|
452
|
+
),
|
|
453
|
+
/* @__PURE__ */ l(
|
|
454
|
+
va,
|
|
455
|
+
{
|
|
456
|
+
value: m,
|
|
457
|
+
filename: "table.csv",
|
|
458
|
+
label: S,
|
|
459
|
+
action: "download-table",
|
|
460
|
+
contentType: "text/csv;charset=utf-8"
|
|
461
|
+
}
|
|
462
|
+
),
|
|
463
|
+
/* @__PURE__ */ l(
|
|
464
|
+
"button",
|
|
465
|
+
{
|
|
466
|
+
ref: L,
|
|
467
|
+
className: "cf-block-button",
|
|
468
|
+
type: "button",
|
|
469
|
+
"data-cf-action": "zoom-table",
|
|
470
|
+
"aria-label": _,
|
|
471
|
+
title: _,
|
|
472
|
+
"aria-haspopup": "dialog",
|
|
473
|
+
onClick: () => p(!0),
|
|
474
|
+
children: /* @__PURE__ */ l(j, { name: "maximize" })
|
|
475
|
+
}
|
|
476
|
+
)
|
|
477
|
+
] })
|
|
478
|
+
] }),
|
|
479
|
+
/* @__PURE__ */ l("div", { className: "cf-data-table", "data-cf-slot": "content", children: ee ?? e }),
|
|
480
|
+
T && ee ? /* @__PURE__ */ l(He, { children: /* @__PURE__ */ k(
|
|
481
|
+
"div",
|
|
482
|
+
{
|
|
483
|
+
ref: x,
|
|
484
|
+
className: "cf-table-preview",
|
|
485
|
+
"data-cf-slot": "preview",
|
|
486
|
+
role: "dialog",
|
|
487
|
+
"aria-modal": "true",
|
|
488
|
+
"aria-label": A,
|
|
489
|
+
tabIndex: -1,
|
|
490
|
+
onKeyDown: le,
|
|
491
|
+
children: [
|
|
492
|
+
/* @__PURE__ */ l(
|
|
493
|
+
"div",
|
|
494
|
+
{
|
|
495
|
+
className: "cf-table-preview-backdrop",
|
|
496
|
+
"data-cf-action": "close-table",
|
|
497
|
+
"aria-hidden": "true",
|
|
498
|
+
onClick: ie
|
|
499
|
+
}
|
|
500
|
+
),
|
|
501
|
+
/* @__PURE__ */ k("div", { className: "cf-table-preview-card", children: [
|
|
502
|
+
/* @__PURE__ */ k("div", { className: "cf-table-preview-head", children: [
|
|
503
|
+
/* @__PURE__ */ l("strong", { children: A }),
|
|
504
|
+
/* @__PURE__ */ l(
|
|
505
|
+
"button",
|
|
506
|
+
{
|
|
507
|
+
ref: y,
|
|
508
|
+
className: "cf-icon-button",
|
|
509
|
+
type: "button",
|
|
510
|
+
"data-cf-action": "close-table",
|
|
511
|
+
"data-cf-slot": "close",
|
|
512
|
+
"aria-label": P,
|
|
513
|
+
onClick: ie,
|
|
514
|
+
children: /* @__PURE__ */ l(j, { name: "close" })
|
|
515
|
+
}
|
|
516
|
+
)
|
|
517
|
+
] }),
|
|
518
|
+
/* @__PURE__ */ l("div", { className: "cf-table-preview-body", children: /* @__PURE__ */ l("div", { className: "cf-table-window", children: /* @__PURE__ */ l("div", { className: "cf-data-table", children: ee }) }) })
|
|
519
|
+
] })
|
|
520
|
+
]
|
|
521
|
+
}
|
|
522
|
+
) }) : null
|
|
523
|
+
] });
|
|
524
|
+
return d ? Z : /* @__PURE__ */ l(
|
|
525
|
+
"figure",
|
|
526
|
+
{
|
|
527
|
+
...oe,
|
|
528
|
+
className: H,
|
|
529
|
+
"data-cf-component": "table",
|
|
530
|
+
"data-cf-slot": "root",
|
|
531
|
+
"data-cf-island": "table",
|
|
532
|
+
"data-cf-table-title": A,
|
|
533
|
+
"data-cf-copy-label": F,
|
|
534
|
+
"data-cf-copy-failure-label": I,
|
|
535
|
+
"data-cf-download-label": S,
|
|
536
|
+
"data-cf-zoom-label": _,
|
|
537
|
+
"data-cf-close-label": P,
|
|
538
|
+
"data-cf-sort-label": N,
|
|
539
|
+
"data-cf-table": z || void 0,
|
|
540
|
+
children: Z
|
|
541
|
+
}
|
|
542
|
+
);
|
|
543
|
+
}
|
|
544
|
+
function xa(e) {
|
|
545
|
+
return e.replace(/\r\n?/g, `
|
|
546
|
+
`).split(`
|
|
547
|
+
`).map((a, t, o) => {
|
|
548
|
+
const c = a.match(/^(\s*)([$>])(\s*)/), i = c ? null : a.match(/^(\s*)([✓✔✕✖!→•])(\s*)/), n = c ? /* @__PURE__ */ k(U, { children: [
|
|
549
|
+
/* @__PURE__ */ l("span", { className: "cf-terminal-prompt", children: `${c[1]}${c[2]}` }),
|
|
550
|
+
c[3] || " ",
|
|
551
|
+
a.slice(c[0].length)
|
|
552
|
+
] }) : i ? /* @__PURE__ */ k(U, { children: [
|
|
553
|
+
/* @__PURE__ */ l("span", { className: "cf-terminal-status", children: `${i[1]}${i[2]}` }),
|
|
554
|
+
i[3] || " ",
|
|
555
|
+
a.slice(i[0].length)
|
|
556
|
+
] }) : /* @__PURE__ */ l("span", { className: "cf-terminal-output", children: a });
|
|
557
|
+
return /* @__PURE__ */ k("span", { children: [
|
|
558
|
+
n,
|
|
559
|
+
t < o.length - 1 ? `
|
|
560
|
+
` : null
|
|
561
|
+
] }, `${t}-${a}`);
|
|
562
|
+
});
|
|
563
|
+
}
|
|
564
|
+
function de({
|
|
565
|
+
children: e,
|
|
566
|
+
node: a,
|
|
567
|
+
title: t,
|
|
568
|
+
source: o,
|
|
569
|
+
copyLabel: c,
|
|
570
|
+
copyFailureLabel: i,
|
|
571
|
+
...n
|
|
572
|
+
}) {
|
|
573
|
+
const r = n, s = t || u(r, "data-cf-title", "dataCfTitle") || M.terminalTitle, d = o ?? u(r, "data-cf-source", "dataCfSource"), b = c || u(r, "data-cf-copy-label", "dataCfCopyLabel") || M.copyTerminal, f = i || u(r, "data-cf-copy-failure-label", "dataCfCopyFailureLabel") || M.copyFailed, h = K("cf-terminal", r.className), { className: m, ...w } = q(r);
|
|
574
|
+
return /* @__PURE__ */ k("div", { ...w, className: h, "data-cf-component": "terminal", "data-cf-slot": "root", children: [
|
|
575
|
+
/* @__PURE__ */ l(
|
|
576
|
+
Ta,
|
|
577
|
+
{
|
|
578
|
+
title: s,
|
|
579
|
+
source: d,
|
|
580
|
+
copyLabel: b,
|
|
581
|
+
copyFailureLabel: f
|
|
582
|
+
}
|
|
583
|
+
),
|
|
584
|
+
/* @__PURE__ */ l("pre", { "data-cf-slot": "content", children: xa(d) })
|
|
585
|
+
] });
|
|
586
|
+
}
|
|
587
|
+
function Ta({
|
|
588
|
+
title: e,
|
|
589
|
+
source: a,
|
|
590
|
+
copyLabel: t = M.copyTerminal,
|
|
591
|
+
copyFailureLabel: o = M.copyFailed,
|
|
592
|
+
inner: c = !1
|
|
593
|
+
}) {
|
|
594
|
+
const i = /* @__PURE__ */ k(U, { children: [
|
|
595
|
+
/* @__PURE__ */ l("span", { children: e }),
|
|
596
|
+
/* @__PURE__ */ l(
|
|
597
|
+
ue,
|
|
598
|
+
{
|
|
599
|
+
value: a,
|
|
600
|
+
label: t,
|
|
601
|
+
action: "copy-terminal",
|
|
602
|
+
className: "cf-copy-snippet-button",
|
|
603
|
+
failureLabel: o
|
|
604
|
+
}
|
|
605
|
+
)
|
|
606
|
+
] });
|
|
607
|
+
return c ? i : /* @__PURE__ */ l(
|
|
608
|
+
"div",
|
|
609
|
+
{
|
|
610
|
+
className: "cf-terminal-head",
|
|
611
|
+
"data-cf-slot": "toolbar",
|
|
612
|
+
"data-cf-behavior": "terminal-toolbar",
|
|
613
|
+
"data-cf-title": e,
|
|
614
|
+
"data-cf-copy-label": t,
|
|
615
|
+
"data-cf-copy-failure-label": o,
|
|
616
|
+
children: i
|
|
617
|
+
}
|
|
618
|
+
);
|
|
619
|
+
}
|
|
620
|
+
function Re(e, a, t) {
|
|
621
|
+
const o = e;
|
|
622
|
+
return o[a] ?? o[t];
|
|
623
|
+
}
|
|
624
|
+
function ne(e) {
|
|
625
|
+
return D(e);
|
|
626
|
+
}
|
|
627
|
+
function Je(e) {
|
|
628
|
+
return String(Re(e.props, "data-cf-tab", "dataCfTab") ?? "");
|
|
629
|
+
}
|
|
630
|
+
function Aa(e) {
|
|
631
|
+
return String(Re(e.props, "data-cf-tab-panel", "dataCfTabPanel") ?? "");
|
|
632
|
+
}
|
|
633
|
+
function Fe(e) {
|
|
634
|
+
return E.toArray(e.props.children).filter(ne);
|
|
635
|
+
}
|
|
636
|
+
function xe(e) {
|
|
637
|
+
return e.props.disabled === !0 || e.props["aria-disabled"] === "true";
|
|
638
|
+
}
|
|
639
|
+
function Ia(e) {
|
|
640
|
+
return e.props["aria-selected"] === !0 || e.props["aria-selected"] === "true";
|
|
641
|
+
}
|
|
642
|
+
function _e(e) {
|
|
643
|
+
return Number.parseInt(na, 10) >= 19 ? e.props.ref : e.ref;
|
|
644
|
+
}
|
|
645
|
+
function Da(e, a, t = "smooth") {
|
|
646
|
+
if (typeof e.scrollTo != "function") return;
|
|
647
|
+
const o = a.offsetLeft, c = o + a.offsetWidth;
|
|
648
|
+
o < e.scrollLeft ? e.scrollTo({ left: o, behavior: t }) : c > e.scrollLeft + e.clientWidth && e.scrollTo({ left: c - e.clientWidth, behavior: t });
|
|
649
|
+
}
|
|
650
|
+
function $a(e, a, t, o, c, i) {
|
|
651
|
+
const n = E.toArray(e), r = n.findIndex((p) => ne(p) && p.props.role === "tablist");
|
|
652
|
+
if (r < 0) return e;
|
|
653
|
+
const s = n[r], d = Fe(s);
|
|
654
|
+
if (!d.length) return e;
|
|
655
|
+
const b = d.map((p, L) => Je(p) || `tab-${L + 1}`), f = d.flatMap((p, L) => xe(p) ? [] : [L]), h = (p, L = !1) => {
|
|
656
|
+
p && (t(p), queueMicrotask(() => {
|
|
657
|
+
const y = o.current[p];
|
|
658
|
+
y && (Da(c.current ?? y.parentElement ?? y, y), L && y.focus());
|
|
659
|
+
}));
|
|
660
|
+
}, m = (p, L) => {
|
|
661
|
+
if (!["ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown", "Home", "End"].includes(p.key)) return;
|
|
662
|
+
const y = f.indexOf(L);
|
|
663
|
+
if (y < 0 || f.length === 0) return;
|
|
664
|
+
p.preventDefault(), p.stopPropagation();
|
|
665
|
+
const x = p.key === "Home" ? f[0] : p.key === "End" ? f.at(-1) : f[(y + (p.key === "ArrowRight" || p.key === "ArrowDown" ? 1 : -1) + f.length) % f.length];
|
|
666
|
+
if (x === void 0) return;
|
|
667
|
+
const A = b[x];
|
|
668
|
+
A && h(A, !0);
|
|
669
|
+
}, w = d.map((p, L) => {
|
|
670
|
+
const y = b[L] ?? `tab-${L + 1}`, x = y === a, A = p.props.onClick, F = p.props.onKeyDown, I = _e(p);
|
|
671
|
+
return O(p, {
|
|
672
|
+
id: `${i}-tab-${L + 1}`,
|
|
673
|
+
"aria-controls": `${i}-panel-${L + 1}`,
|
|
674
|
+
"aria-selected": x ? "true" : "false",
|
|
675
|
+
tabIndex: x ? 0 : -1,
|
|
676
|
+
ref: (S) => {
|
|
677
|
+
o.current[y] = S, typeof I == "function" ? I(S) : I && "current" in I && (I.current = S);
|
|
678
|
+
},
|
|
679
|
+
onClick: (S) => {
|
|
680
|
+
A?.(S), !S.defaultPrevented && (S.stopPropagation(), h(y));
|
|
681
|
+
},
|
|
682
|
+
onKeyDown: (S) => {
|
|
683
|
+
F?.(S), S.defaultPrevented || m(S, L);
|
|
684
|
+
}
|
|
685
|
+
});
|
|
686
|
+
}), C = _e(s), T = O(s, {
|
|
687
|
+
children: w,
|
|
688
|
+
ref: (p) => {
|
|
689
|
+
c.current = p, typeof C == "function" ? C(p) : C && "current" in C && (C.current = p);
|
|
690
|
+
}
|
|
691
|
+
});
|
|
692
|
+
return n.map((p, L) => {
|
|
693
|
+
if (L === r) return T;
|
|
694
|
+
if (!ne(p) || p.props.role !== "tabpanel") return p;
|
|
695
|
+
const y = n.filter((A) => ne(A) && A.props.role === "tabpanel").indexOf(p), x = Aa(p) || b[y] || "";
|
|
696
|
+
return O(p, {
|
|
697
|
+
id: `${i}-panel-${y + 1}`,
|
|
698
|
+
"aria-labelledby": `${i}-tab-${y + 1}`,
|
|
699
|
+
hidden: x !== a
|
|
700
|
+
});
|
|
701
|
+
});
|
|
702
|
+
}
|
|
703
|
+
function ce({
|
|
704
|
+
children: e,
|
|
705
|
+
kind: a = "tabs",
|
|
706
|
+
component: t,
|
|
707
|
+
...o
|
|
708
|
+
}) {
|
|
709
|
+
const i = E.toArray(e).find(
|
|
710
|
+
(N) => ne(N) && N.props.role === "tablist"
|
|
711
|
+
), n = i ? Fe(i).map((N, z) => Je(N) || `tab-${z + 1}`) : [], r = i ? Fe(i) : [], s = r.findIndex(
|
|
712
|
+
(N) => Ia(N) && !xe(N)
|
|
713
|
+
), d = r.findIndex((N) => !xe(N)), b = n[s >= 0 ? s : d] ?? "", [f, h] = B(b), m = n.includes(f) ? f : b, w = V({}), C = V(null), [T, p] = B(!1), [L, y] = B(!1), x = oa().replace(/:/g, ""), F = String(Re(o, "data-cf-tabs-id", "dataCfTabsId") ?? "") || `cf-tabs-${x}`, I = $a(e, m, h, w, C, F);
|
|
714
|
+
re(() => {
|
|
715
|
+
if (a !== "code-group") return;
|
|
716
|
+
const N = C.current;
|
|
717
|
+
if (!N) return;
|
|
718
|
+
const z = () => {
|
|
719
|
+
const Y = Math.max(0, N.scrollWidth - N.clientWidth);
|
|
720
|
+
p(Y > 1 && N.scrollLeft > 1), y(Y > 1 && N.scrollLeft < Y - 1);
|
|
721
|
+
};
|
|
722
|
+
z(), N.addEventListener("scroll", z, { passive: !0 });
|
|
723
|
+
const H = typeof ResizeObserver > "u" ? void 0 : new ResizeObserver(z);
|
|
724
|
+
return H?.observe(N), () => {
|
|
725
|
+
N.removeEventListener("scroll", z), H?.disconnect();
|
|
726
|
+
};
|
|
727
|
+
}, [e, a]);
|
|
728
|
+
const S = (N) => {
|
|
729
|
+
const z = C.current;
|
|
730
|
+
!z || typeof z.scrollBy != "function" || z.scrollBy({
|
|
731
|
+
left: N * Math.max(180, z.clientWidth * 0.72),
|
|
732
|
+
behavior: "smooth"
|
|
733
|
+
});
|
|
734
|
+
}, _ = q(o), P = K(
|
|
735
|
+
a === "code-group" ? "cf-tabs cf-code-group" : "cf-tabs",
|
|
736
|
+
o.className
|
|
737
|
+
);
|
|
738
|
+
return t ? /* @__PURE__ */ l(
|
|
739
|
+
t,
|
|
740
|
+
{
|
|
741
|
+
..._,
|
|
742
|
+
className: P,
|
|
743
|
+
kind: a,
|
|
744
|
+
"data-cf-component": a,
|
|
745
|
+
"data-cf-slot": "root",
|
|
746
|
+
"data-cf-behavior": "tabs",
|
|
747
|
+
"data-cf-tabs-id": F,
|
|
748
|
+
children: I
|
|
749
|
+
}
|
|
750
|
+
) : /* @__PURE__ */ k(
|
|
751
|
+
"div",
|
|
752
|
+
{
|
|
753
|
+
..._,
|
|
754
|
+
className: P,
|
|
755
|
+
"data-cf-component": a,
|
|
756
|
+
"data-cf-slot": "root",
|
|
757
|
+
"data-cf-behavior": "tabs",
|
|
758
|
+
"data-cf-tabs-id": F,
|
|
759
|
+
children: [
|
|
760
|
+
a === "code-group" ? /* @__PURE__ */ l(
|
|
761
|
+
"button",
|
|
762
|
+
{
|
|
763
|
+
type: "button",
|
|
764
|
+
className: "cf-code-tabs-scroll cf-code-tabs-scroll-start",
|
|
765
|
+
"data-cf-action": "scroll-code-tabs",
|
|
766
|
+
"data-cf-direction": "-1",
|
|
767
|
+
"aria-label": "Previous code files",
|
|
768
|
+
hidden: !T,
|
|
769
|
+
onClick: () => S(-1),
|
|
770
|
+
children: /* @__PURE__ */ l(j, { name: "previous", size: 18 })
|
|
771
|
+
}
|
|
772
|
+
) : null,
|
|
773
|
+
I,
|
|
774
|
+
a === "code-group" ? /* @__PURE__ */ l(
|
|
775
|
+
"button",
|
|
776
|
+
{
|
|
777
|
+
type: "button",
|
|
778
|
+
className: "cf-code-tabs-scroll cf-code-tabs-scroll-end",
|
|
779
|
+
"data-cf-action": "scroll-code-tabs",
|
|
780
|
+
"data-cf-direction": "1",
|
|
781
|
+
"aria-label": "Next code files",
|
|
782
|
+
hidden: !L,
|
|
783
|
+
onClick: () => S(1),
|
|
784
|
+
children: /* @__PURE__ */ l(j, { name: "next", size: 18 })
|
|
785
|
+
}
|
|
786
|
+
) : null
|
|
787
|
+
]
|
|
788
|
+
}
|
|
789
|
+
);
|
|
790
|
+
}
|
|
791
|
+
function Ue(e) {
|
|
792
|
+
if (typeof e.type == "string") return e.type;
|
|
793
|
+
const a = e.type.displayName ?? "";
|
|
794
|
+
return a.startsWith("Markdown") ? a.slice(8).toLowerCase() : "";
|
|
795
|
+
}
|
|
796
|
+
function Qe(e) {
|
|
797
|
+
return typeof e == "string" && !e.trim();
|
|
798
|
+
}
|
|
799
|
+
function Te(e, a, t, o) {
|
|
800
|
+
if (!D(e)) return e;
|
|
801
|
+
const c = e, i = E.toArray(c.props.children).filter((y) => !Qe(y)), n = c.props["data-cf-file-tree-file"] !== void 0 || c.props.dataCfFileTreeFile !== void 0, r = c.props["data-cf-file-tree-branch"] !== void 0 || c.props.dataCfFileTreeBranch !== void 0, s = c.props["aria-current"] === "page" || c.props["aria-current"] === !0 || c.props["data-cf-current"] !== void 0 || c.props.dataCfCurrent !== void 0, d = r ? i.findIndex(
|
|
802
|
+
(y) => D(y) && Ue(y) === "button"
|
|
803
|
+
) : -1, b = r ? i.findIndex(
|
|
804
|
+
(y) => D(y) && Ue(y) === "ul"
|
|
805
|
+
) : -1, f = String(
|
|
806
|
+
c.props["data-cf-file-tree-path"] ?? c.props.dataCfFileTreePath ?? ""
|
|
807
|
+
), h = d >= 0 ? W(i[d].props.children) : "", m = f || `${a}:${h.trim().toLowerCase()}`, w = d >= 0 ? i[d].props["aria-expanded"] : void 0, C = r ? t[m] ?? (w !== !1 && w !== "false") : !0, T = i.map((y, x) => {
|
|
808
|
+
const A = `${a}.${x}`;
|
|
809
|
+
if (r && x === d && D(y)) {
|
|
810
|
+
const F = y, I = F.props.onClick, S = E.toArray(F.props.children), _ = S.some(
|
|
811
|
+
(P) => D(P) && (P.props["data-cf-slot"] === "folder-icon" || P.props.dataCfSlot === "folder-icon")
|
|
812
|
+
);
|
|
813
|
+
return O(F, {
|
|
814
|
+
className: K("cf-file-tree-folder", F.props.className),
|
|
815
|
+
"data-cf-action": "toggle-file-tree",
|
|
816
|
+
"data-cf-file-tree-toggle": "",
|
|
817
|
+
"aria-expanded": String(C),
|
|
818
|
+
children: _ ? S : [
|
|
819
|
+
/* @__PURE__ */ l("span", { className: "cf-file-tree-folder-icon", "data-cf-slot": "folder-icon", children: /* @__PURE__ */ l(j, { name: "folder" }) }, "folder-icon"),
|
|
820
|
+
...S
|
|
821
|
+
],
|
|
822
|
+
onClick: (P) => {
|
|
823
|
+
typeof I == "function" && I(P), P.defaultPrevented || o(m, !C);
|
|
824
|
+
}
|
|
825
|
+
});
|
|
826
|
+
}
|
|
827
|
+
if (r && x === b && D(y)) {
|
|
828
|
+
const F = Te(y, A, t, o);
|
|
829
|
+
return /* @__PURE__ */ l(
|
|
830
|
+
"div",
|
|
831
|
+
{
|
|
832
|
+
className: "cf-file-tree-children",
|
|
833
|
+
"data-cf-state": C ? "expanded" : "collapsed",
|
|
834
|
+
"aria-hidden": C ? void 0 : "true",
|
|
835
|
+
inert: C ? void 0 : !0,
|
|
836
|
+
children: F
|
|
837
|
+
},
|
|
838
|
+
`${m}-children`
|
|
839
|
+
);
|
|
840
|
+
}
|
|
841
|
+
return Te(y, A, t, o);
|
|
842
|
+
}), p = i.some(
|
|
843
|
+
(y) => D(y) && (y.props["data-cf-slot"] === "file-icon" || y.props.dataCfSlot === "file-icon")
|
|
844
|
+
), L = n && !p ? [
|
|
845
|
+
/* @__PURE__ */ l("span", { className: "cf-file-tree-file-icon", "data-cf-slot": "file-icon", children: /* @__PURE__ */ l(j, { name: "file" }) }, "file-icon"),
|
|
846
|
+
...T
|
|
847
|
+
] : T;
|
|
848
|
+
return O(c, {
|
|
849
|
+
...n || r ? {
|
|
850
|
+
className: K(
|
|
851
|
+
[
|
|
852
|
+
n ? "cf-file-tree-file" : "",
|
|
853
|
+
r ? "cf-file-tree-branch" : "",
|
|
854
|
+
s ? "cf-file-tree-current" : ""
|
|
855
|
+
].filter(Boolean).join(" "),
|
|
856
|
+
c.props.className
|
|
857
|
+
)
|
|
858
|
+
} : {},
|
|
859
|
+
...r ? {
|
|
860
|
+
"data-cf-state": C ? "expanded" : "collapsed",
|
|
861
|
+
"data-cf-file-tree-path": m
|
|
862
|
+
} : {},
|
|
863
|
+
children: L
|
|
864
|
+
});
|
|
865
|
+
}
|
|
866
|
+
function Ae({ children: e, ...a }) {
|
|
867
|
+
const [t, o] = B({}), c = E.toArray(e).filter((r) => !Qe(r)).map(
|
|
868
|
+
(r, s) => Te(
|
|
869
|
+
r,
|
|
870
|
+
String(s),
|
|
871
|
+
t,
|
|
872
|
+
(d, b) => o((f) => ({ ...f, [d]: b }))
|
|
873
|
+
)
|
|
874
|
+
), i = E.map(
|
|
875
|
+
c,
|
|
876
|
+
(r) => D(r) ? O(r, { "data-cf-slot": "content" }) : r
|
|
877
|
+
), n = q(a);
|
|
878
|
+
return /* @__PURE__ */ l(
|
|
879
|
+
"div",
|
|
880
|
+
{
|
|
881
|
+
...n,
|
|
882
|
+
className: K("cf-file-tree", a.className),
|
|
883
|
+
"data-cf-component": "file-tree",
|
|
884
|
+
"data-cf-slot": "root",
|
|
885
|
+
"data-cf-behavior": "file-tree",
|
|
886
|
+
children: i
|
|
887
|
+
}
|
|
888
|
+
);
|
|
889
|
+
}
|
|
890
|
+
function X(e, a, t) {
|
|
891
|
+
return {
|
|
892
|
+
...q(e),
|
|
893
|
+
...t ? { className: K(t, e.className) } : {},
|
|
894
|
+
"data-cf-component": a,
|
|
895
|
+
"data-cf-slot": "root"
|
|
896
|
+
};
|
|
897
|
+
}
|
|
898
|
+
function fe({ children: e, ...a }) {
|
|
899
|
+
const t = String(
|
|
900
|
+
a["data-callout"] ?? a.dataCallout ?? "info"
|
|
901
|
+
), o = t === "tip" ? la : t === "warning" ? sa : t === "danger" ? da : fa, c = E.map(e, (i) => {
|
|
902
|
+
if (!D(i)) return i;
|
|
903
|
+
const n = i;
|
|
904
|
+
return n.props["data-cf-slot"] === "title" || n.props.dataCfSlot === "title" ? O(n, {
|
|
905
|
+
children: /* @__PURE__ */ k(U, { children: [
|
|
906
|
+
/* @__PURE__ */ l(o, { className: "cf-callout-icon", size: 17, strokeWidth: 2, "aria-hidden": "true" }),
|
|
907
|
+
n.props.children
|
|
908
|
+
] })
|
|
909
|
+
}) : i;
|
|
910
|
+
});
|
|
911
|
+
return v("div", X(a, "callout", "cf-callout"), c);
|
|
912
|
+
}
|
|
913
|
+
function Ie({ children: e, ...a }) {
|
|
914
|
+
return v("ol", X(a, "steps", "cf-steps"), e);
|
|
915
|
+
}
|
|
916
|
+
function za(e) {
|
|
917
|
+
const a = E.toArray(e), t = a.findIndex(
|
|
918
|
+
(o) => D(o) && R(o) === "summary"
|
|
919
|
+
);
|
|
920
|
+
return t < 0 ? { summary: void 0, content: a } : {
|
|
921
|
+
summary: a[t],
|
|
922
|
+
content: a.filter(
|
|
923
|
+
(o, c) => c !== t && !(typeof o == "string" && o.trim().length === 0)
|
|
924
|
+
)
|
|
925
|
+
};
|
|
926
|
+
}
|
|
927
|
+
function De({ children: e, onToggle: a, ...t }) {
|
|
928
|
+
const o = t.open === !0, [c, i] = B(o), [n, r] = B(!1), s = V(null), { summary: d, content: b } = za(e), f = D(d) ? (() => {
|
|
929
|
+
const m = d, w = m.props.onClick;
|
|
930
|
+
return O(m, {
|
|
931
|
+
children: /* @__PURE__ */ k(U, { children: [
|
|
932
|
+
m.props.children,
|
|
933
|
+
/* @__PURE__ */ l(ia, { className: "cf-details-chevron", size: 17, strokeWidth: 2, "aria-hidden": "true" })
|
|
934
|
+
] }),
|
|
935
|
+
onClick: (C) => {
|
|
936
|
+
if (w?.(C), C.defaultPrevented) return;
|
|
937
|
+
const T = C.currentTarget.closest("details");
|
|
938
|
+
queueMicrotask(() => i(T?.open ?? !1));
|
|
939
|
+
}
|
|
940
|
+
});
|
|
941
|
+
})() : d;
|
|
942
|
+
re(() => {
|
|
943
|
+
r(!0);
|
|
944
|
+
}, []);
|
|
945
|
+
const h = /* @__PURE__ */ k(U, { children: [
|
|
946
|
+
f,
|
|
947
|
+
/* @__PURE__ */ l(
|
|
948
|
+
"div",
|
|
949
|
+
{
|
|
950
|
+
ref: s,
|
|
951
|
+
className: "cf-details-content",
|
|
952
|
+
"data-cf-slot": "content",
|
|
953
|
+
inert: n && !c ? !0 : void 0,
|
|
954
|
+
children: /* @__PURE__ */ l("div", { className: "cf-details-content-inner", children: b.map((m, w) => /* @__PURE__ */ l(ca, { children: m }, D(m) && m.key !== null ? m.key : `details-${w}`)) })
|
|
955
|
+
}
|
|
956
|
+
)
|
|
957
|
+
] });
|
|
958
|
+
return /* @__PURE__ */ l(
|
|
959
|
+
"details",
|
|
960
|
+
{
|
|
961
|
+
...X(t, "details"),
|
|
962
|
+
"data-cf-behavior": "details",
|
|
963
|
+
"data-cf-enhanced": n ? "true" : void 0,
|
|
964
|
+
onToggle: (m) => {
|
|
965
|
+
i(m.currentTarget.open), a?.(m);
|
|
966
|
+
},
|
|
967
|
+
children: h
|
|
968
|
+
}
|
|
969
|
+
);
|
|
970
|
+
}
|
|
971
|
+
function Xe(e, a) {
|
|
972
|
+
return E.map(e, (t) => D(t) ? O(t, { "data-cf-slot": a }) : t);
|
|
973
|
+
}
|
|
974
|
+
function $e({ children: e, ...a }) {
|
|
975
|
+
return /* @__PURE__ */ l("div", { ...X(a, "card-grid", "cf-card-grid"), children: Xe(e, "card") });
|
|
976
|
+
}
|
|
977
|
+
function ze({ children: e, ...a }) {
|
|
978
|
+
return /* @__PURE__ */ l("section", { ...X(a, "api", "cf-api-block"), children: Xe(e, "section") });
|
|
979
|
+
}
|
|
980
|
+
function Pe({ children: e, ...a }) {
|
|
981
|
+
return /* @__PURE__ */ l("aside", { ...X(a, "aside", "cf-aside"), children: e });
|
|
982
|
+
}
|
|
983
|
+
function Oe({ children: e, ...a }) {
|
|
984
|
+
const t = X(a, "badge", "cf-badge");
|
|
985
|
+
return /* @__PURE__ */ l("span", { ...t, "data-cf-slot": "label", children: e });
|
|
986
|
+
}
|
|
987
|
+
function Pa({
|
|
988
|
+
anchor: e,
|
|
989
|
+
anchorLabel: a,
|
|
990
|
+
copyFailureLabel: t = M.copyFailed
|
|
991
|
+
}) {
|
|
992
|
+
const [o, c] = B("idle");
|
|
993
|
+
re(() => {
|
|
994
|
+
if (o === "idle") return;
|
|
995
|
+
const s = setTimeout(() => c("idle"), qe);
|
|
996
|
+
return () => clearTimeout(s);
|
|
997
|
+
}, [o]);
|
|
998
|
+
const i = async () => {
|
|
999
|
+
const s = typeof window > "u" ? e : `${window.location.origin}${window.location.pathname}${window.location.search}${e}`;
|
|
1000
|
+
try {
|
|
1001
|
+
c(await Ze(s) ? "success" : "error");
|
|
1002
|
+
} catch {
|
|
1003
|
+
c("error");
|
|
1004
|
+
}
|
|
1005
|
+
}, n = a || M.copySectionLink, r = o === "success" ? `${n} ✓` : o === "error" ? t : n;
|
|
1006
|
+
return /* @__PURE__ */ k(
|
|
1007
|
+
"button",
|
|
1008
|
+
{
|
|
1009
|
+
className: `cf-anchor${o === "success" ? " cf-action-success" : ""}${o === "error" ? " cf-action-error" : ""}`,
|
|
1010
|
+
type: "button",
|
|
1011
|
+
"data-anchor": e,
|
|
1012
|
+
"data-cf-action": "copy-section-link",
|
|
1013
|
+
"data-cf-anchor-label": n,
|
|
1014
|
+
"data-cf-copy-error": o === "error" ? "true" : void 0,
|
|
1015
|
+
"aria-label": r,
|
|
1016
|
+
title: r,
|
|
1017
|
+
onClick: i,
|
|
1018
|
+
children: [
|
|
1019
|
+
/* @__PURE__ */ l(j, { name: "link" }),
|
|
1020
|
+
/* @__PURE__ */ l("span", { className: "cf-sr-only", "aria-live": "polite", "aria-atomic": "true", children: o === "idle" ? "" : r })
|
|
1021
|
+
]
|
|
1022
|
+
}
|
|
1023
|
+
);
|
|
1024
|
+
}
|
|
1025
|
+
function Oa({
|
|
1026
|
+
level: e,
|
|
1027
|
+
as: a,
|
|
1028
|
+
id: t,
|
|
1029
|
+
anchor: o,
|
|
1030
|
+
anchorLabel: c,
|
|
1031
|
+
copyFailureLabel: i,
|
|
1032
|
+
children: n,
|
|
1033
|
+
className: r,
|
|
1034
|
+
...s
|
|
1035
|
+
}) {
|
|
1036
|
+
const d = a ?? `h${e}`, b = r?.split(/\s+/).filter(Boolean) ?? [], f = b.some((w) => w === "sr-only" || w === "cf-sr-only"), h = e > 1 && !!o && !f;
|
|
1037
|
+
f && !b.includes("cf-sr-only") && b.push("cf-sr-only"), h && b.push("cf-heading-with-anchor");
|
|
1038
|
+
const m = b.join(" ");
|
|
1039
|
+
return /* @__PURE__ */ k(d, { ...s, id: t, className: m || void 0, children: [
|
|
1040
|
+
n,
|
|
1041
|
+
h && o ? /* @__PURE__ */ l(
|
|
1042
|
+
"span",
|
|
1043
|
+
{
|
|
1044
|
+
className: "cf-anchor-island",
|
|
1045
|
+
"data-cf-behavior": "heading",
|
|
1046
|
+
"data-cf-anchor": o,
|
|
1047
|
+
"data-cf-anchor-label": c || M.copySectionLink,
|
|
1048
|
+
"data-cf-copy-failure-label": i || M.copyFailed,
|
|
1049
|
+
children: /* @__PURE__ */ l(
|
|
1050
|
+
Pa,
|
|
1051
|
+
{
|
|
1052
|
+
anchor: o,
|
|
1053
|
+
anchorLabel: c,
|
|
1054
|
+
copyFailureLabel: i
|
|
1055
|
+
}
|
|
1056
|
+
)
|
|
1057
|
+
}
|
|
1058
|
+
) : null
|
|
1059
|
+
] });
|
|
1060
|
+
}
|
|
1061
|
+
function We(e, a) {
|
|
1062
|
+
return E.toArray(e).find((t) => {
|
|
1063
|
+
if (!D(t)) return !1;
|
|
1064
|
+
const o = t;
|
|
1065
|
+
return R(o) === a || a === "figcaption" && (o.props["data-cf-slot"] === "caption" || o.props.dataCfSlot === "caption");
|
|
1066
|
+
});
|
|
1067
|
+
}
|
|
1068
|
+
function Ye(e, a, t) {
|
|
1069
|
+
const o = { ...a, children: t };
|
|
1070
|
+
if (e === "code-block")
|
|
1071
|
+
return {
|
|
1072
|
+
...o,
|
|
1073
|
+
source: u(a, "data-cf-source", "dataCfSource") || W(t),
|
|
1074
|
+
language: u(a, "data-cf-language", "dataCfLanguage") || "text",
|
|
1075
|
+
copyLabel: u(a, "data-cf-copy-label", "dataCfCopyLabel") || void 0,
|
|
1076
|
+
copyFailureLabel: u(a, "data-cf-copy-failure-label", "dataCfCopyFailureLabel") || void 0
|
|
1077
|
+
};
|
|
1078
|
+
if (e === "copy-snippet")
|
|
1079
|
+
return {
|
|
1080
|
+
...o,
|
|
1081
|
+
value: u(a, "data-cf-value", "dataCfValue") || W(t),
|
|
1082
|
+
copyLabel: u(a, "data-cf-copy-label", "dataCfCopyLabel") || void 0,
|
|
1083
|
+
copyFailureLabel: u(a, "data-cf-copy-failure-label", "dataCfCopyFailureLabel") || void 0
|
|
1084
|
+
};
|
|
1085
|
+
if (e === "table")
|
|
1086
|
+
return {
|
|
1087
|
+
...o,
|
|
1088
|
+
tableTitle: u(a, "data-cf-table-title", "dataCfTableTitle") || void 0,
|
|
1089
|
+
copyLabel: u(a, "data-cf-copy-label", "dataCfCopyLabel") || void 0,
|
|
1090
|
+
copyFailureLabel: u(a, "data-cf-copy-failure-label", "dataCfCopyFailureLabel") || void 0,
|
|
1091
|
+
downloadLabel: u(a, "data-cf-download-label", "dataCfDownloadLabel") || void 0,
|
|
1092
|
+
zoomLabel: u(a, "data-cf-zoom-label", "dataCfZoomLabel") || void 0,
|
|
1093
|
+
closeLabel: u(a, "data-cf-close-label", "dataCfCloseLabel") || void 0,
|
|
1094
|
+
sortLabel: u(a, "data-cf-sort-label", "dataCfSortLabel") || void 0
|
|
1095
|
+
};
|
|
1096
|
+
if (e === "image") {
|
|
1097
|
+
const c = We(t, "img"), i = We(t, "figcaption"), n = c ? me(c.props, "width") : void 0, r = c ? me(c.props, "height") : void 0, s = c ? me(c.props, "loading") : void 0;
|
|
1098
|
+
return {
|
|
1099
|
+
...o,
|
|
1100
|
+
src: c && u(c.props, "src") || void 0,
|
|
1101
|
+
alt: c ? u(c.props, "alt") : void 0,
|
|
1102
|
+
caption: i ? W(i.props.children) : void 0,
|
|
1103
|
+
title: c && u(c.props, "title") || void 0,
|
|
1104
|
+
width: typeof n == "string" || typeof n == "number" ? n : void 0,
|
|
1105
|
+
height: typeof r == "string" || typeof r == "number" ? r : void 0,
|
|
1106
|
+
loading: s === "eager" || s === "lazy" ? s : void 0,
|
|
1107
|
+
srcSet: c && u(c.props, "srcSet", "srcset") || void 0,
|
|
1108
|
+
sizes: c && u(c.props, "sizes") || void 0,
|
|
1109
|
+
zoomLabel: u(a, "data-cf-zoom-label", "dataCfZoomLabel") || void 0,
|
|
1110
|
+
closeLabel: u(a, "data-cf-close-label", "dataCfCloseLabel") || void 0
|
|
1111
|
+
};
|
|
1112
|
+
}
|
|
1113
|
+
return e === "terminal" ? {
|
|
1114
|
+
...o,
|
|
1115
|
+
title: u(a, "data-cf-title", "dataCfTitle") || void 0,
|
|
1116
|
+
source: u(a, "data-cf-source", "dataCfSource"),
|
|
1117
|
+
copyLabel: u(a, "data-cf-copy-label", "dataCfCopyLabel") || void 0,
|
|
1118
|
+
copyFailureLabel: u(a, "data-cf-copy-failure-label", "dataCfCopyFailureLabel") || void 0
|
|
1119
|
+
} : e === "gallery" ? {
|
|
1120
|
+
...o,
|
|
1121
|
+
items: ma(void 0, a.node, t),
|
|
1122
|
+
labels: {
|
|
1123
|
+
gallery: u(a, "data-cf-gallery-label", "dataCfGalleryLabel") || void 0,
|
|
1124
|
+
close: u(a, "data-cf-close-label", "dataCfCloseLabel") || void 0,
|
|
1125
|
+
previous: u(a, "data-cf-previous-label", "dataCfPreviousLabel") || void 0,
|
|
1126
|
+
next: u(a, "data-cf-next-label", "dataCfNextLabel") || void 0,
|
|
1127
|
+
thumbnails: u(a, "data-cf-thumbnails-label", "dataCfThumbnailsLabel") || void 0,
|
|
1128
|
+
image: u(a, "data-cf-image-label", "dataCfImageLabel") || void 0
|
|
1129
|
+
}
|
|
1130
|
+
} : o;
|
|
1131
|
+
}
|
|
1132
|
+
function Ra(e) {
|
|
1133
|
+
return Array.isArray(e) ? e.join(" ") : typeof e == "string" ? e : "";
|
|
1134
|
+
}
|
|
1135
|
+
function $(e, a) {
|
|
1136
|
+
const t = [Ra(e), a].filter(Boolean);
|
|
1137
|
+
return t.length ? t.join(" ") : void 0;
|
|
1138
|
+
}
|
|
1139
|
+
const Ee = {
|
|
1140
|
+
callout: { className: "callout", override: "Callout" },
|
|
1141
|
+
tabs: { className: "tabs", override: "Tabs" },
|
|
1142
|
+
"code-group": { className: "tabs", override: "CodeGroup" },
|
|
1143
|
+
steps: { className: "steps", override: "Steps" },
|
|
1144
|
+
"code-block": { className: "codeBlock", override: "CodeBlock" },
|
|
1145
|
+
"copy-snippet": { className: "copySnippet", override: "CopySnippet" },
|
|
1146
|
+
table: { className: "table", override: "Table" },
|
|
1147
|
+
image: { className: "image", override: "Image" },
|
|
1148
|
+
terminal: { className: "terminal", override: "Terminal" },
|
|
1149
|
+
details: { className: "details", override: "Details" },
|
|
1150
|
+
"file-tree": { className: "fileTree", override: "FileTree" },
|
|
1151
|
+
gallery: { className: "gallery", override: "Gallery" },
|
|
1152
|
+
"card-grid": { className: "cardGrid", override: "CardGrid" },
|
|
1153
|
+
api: { className: "api", override: "Api" },
|
|
1154
|
+
aside: { className: "aside", override: "Aside" },
|
|
1155
|
+
badge: { className: "badge", override: "Badge" }
|
|
1156
|
+
};
|
|
1157
|
+
function Ke(e) {
|
|
1158
|
+
const a = typeof e == "string" ? e : "";
|
|
1159
|
+
return Object.hasOwn(Ee, a) ? a : void 0;
|
|
1160
|
+
}
|
|
1161
|
+
function be(e) {
|
|
1162
|
+
return Ke(e["data-cf-component"]) ?? Ke(e.dataCfComponent);
|
|
1163
|
+
}
|
|
1164
|
+
function Ea(e, a) {
|
|
1165
|
+
return a[Ee[e].className];
|
|
1166
|
+
}
|
|
1167
|
+
function te(e, a) {
|
|
1168
|
+
return e[Ee[a].override];
|
|
1169
|
+
}
|
|
1170
|
+
function G(e, a) {
|
|
1171
|
+
return e[a];
|
|
1172
|
+
}
|
|
1173
|
+
function ea(e, a, t, o, c, i) {
|
|
1174
|
+
const n = $(a.className, Ea(e, o)), r = te(c, e);
|
|
1175
|
+
if (r) {
|
|
1176
|
+
const s = Ye(e, { ...a, className: n }, t);
|
|
1177
|
+
return v(r, aa(e, s, i));
|
|
1178
|
+
}
|
|
1179
|
+
if (e === "file-tree") return v(Ae, { ...a, className: n, children: t });
|
|
1180
|
+
if (e === "gallery") return v(he, { ...a, className: n, children: t });
|
|
1181
|
+
if (e === "terminal") return v(de, { ...a, className: n, children: t });
|
|
1182
|
+
if (e === "copy-snippet")
|
|
1183
|
+
return v(Ce, { ...a, className: n, children: t });
|
|
1184
|
+
if (e === "card-grid") return v($e, { ...a, className: n, children: t });
|
|
1185
|
+
if (e === "api") return v(ze, { ...a, className: n, children: t });
|
|
1186
|
+
if (e === "aside") return v(Pe, { ...a, className: n, children: t });
|
|
1187
|
+
if (e === "badge") return v(Oe, { ...a, className: n, children: t });
|
|
1188
|
+
}
|
|
1189
|
+
function aa(e, a, t) {
|
|
1190
|
+
const o = ge(a, t);
|
|
1191
|
+
return e !== "gallery" || !Array.isArray(o.items) ? o : {
|
|
1192
|
+
...o,
|
|
1193
|
+
items: o.items.map(
|
|
1194
|
+
(c) => c && typeof c == "object" ? ge(c, t) : c
|
|
1195
|
+
)
|
|
1196
|
+
};
|
|
1197
|
+
}
|
|
1198
|
+
function g(e, a, t, o, c) {
|
|
1199
|
+
const i = a.replace(/[A-Z]/g, (r) => `-${r.toLowerCase()}`);
|
|
1200
|
+
function n({ children: r, node: s, ...d }) {
|
|
1201
|
+
const b = G(o, e) ?? e, f = ge(d, c);
|
|
1202
|
+
if (a === "heading" && /^h[1-6]$/.test(e)) {
|
|
1203
|
+
const h = d["data-cf-anchor"] ?? d.dataCfAnchor, m = d["data-cf-anchor-label"] ?? d.dataCfAnchorLabel, w = d["data-cf-copy-failure-label"] ?? d.dataCfCopyFailureLabel;
|
|
1204
|
+
return v(Oa, {
|
|
1205
|
+
...f,
|
|
1206
|
+
as: b,
|
|
1207
|
+
level: Number(e.slice(1)),
|
|
1208
|
+
anchor: typeof h == "string" ? h : void 0,
|
|
1209
|
+
anchorLabel: typeof m == "string" ? m : void 0,
|
|
1210
|
+
copyFailureLabel: typeof w == "string" ? w : void 0,
|
|
1211
|
+
className: $(f.className, t[a]),
|
|
1212
|
+
"data-cf-element": i,
|
|
1213
|
+
children: r
|
|
1214
|
+
});
|
|
1215
|
+
}
|
|
1216
|
+
return v(
|
|
1217
|
+
b,
|
|
1218
|
+
{
|
|
1219
|
+
...f,
|
|
1220
|
+
className: $(f.className, t[a]),
|
|
1221
|
+
"data-cf-element": i
|
|
1222
|
+
},
|
|
1223
|
+
r
|
|
1224
|
+
);
|
|
1225
|
+
}
|
|
1226
|
+
return n.displayName = `Markdown${e.charAt(0).toUpperCase()}${e.slice(1)}`, n;
|
|
1227
|
+
}
|
|
1228
|
+
function Ba(e, a) {
|
|
1229
|
+
return function({ children: o, node: c, ...i }) {
|
|
1230
|
+
const n = i["data-cf-icon"] ?? i.dataCfIcon, r = typeof n == "string" ? ya(e, n) : void 0;
|
|
1231
|
+
if (r)
|
|
1232
|
+
return v(r, {
|
|
1233
|
+
size: Number(i.width ?? 16),
|
|
1234
|
+
className: typeof i.className == "string" ? i.className : void 0,
|
|
1235
|
+
"aria-hidden": i["aria-hidden"]
|
|
1236
|
+
});
|
|
1237
|
+
const { ["data-cf-icon"]: s, dataCfIcon: d, ...b } = i;
|
|
1238
|
+
return v(G(a, "svg") ?? "svg", b, o);
|
|
1239
|
+
};
|
|
1240
|
+
}
|
|
1241
|
+
function ja(e, a) {
|
|
1242
|
+
return function({ children: o, node: c, ...i }) {
|
|
1243
|
+
const n = i["data-cf-slot"] === "caption" ? Ve(e) : void 0;
|
|
1244
|
+
return n ? v(n, {
|
|
1245
|
+
children: o,
|
|
1246
|
+
className: typeof i.className == "string" ? i.className : void 0,
|
|
1247
|
+
"data-cf-slot": typeof i["data-cf-slot"] == "string" ? i["data-cf-slot"] : void 0
|
|
1248
|
+
}) : v(G(a, "figcaption") ?? "figcaption", i, o);
|
|
1249
|
+
};
|
|
1250
|
+
}
|
|
1251
|
+
function _a(e, a, t) {
|
|
1252
|
+
return function({ children: c, node: i, ...n }) {
|
|
1253
|
+
const r = be(n), s = r ? te(a, r) : void 0;
|
|
1254
|
+
if (r === "callout")
|
|
1255
|
+
return v(s ?? fe, {
|
|
1256
|
+
...n,
|
|
1257
|
+
className: $(n.className, e.callout),
|
|
1258
|
+
children: c
|
|
1259
|
+
});
|
|
1260
|
+
if (r === "tabs" || r === "code-group")
|
|
1261
|
+
return v(ce, {
|
|
1262
|
+
...n,
|
|
1263
|
+
className: $(n.className, e.tabs),
|
|
1264
|
+
kind: r,
|
|
1265
|
+
component: s,
|
|
1266
|
+
children: c
|
|
1267
|
+
});
|
|
1268
|
+
const d = r && ea(r, { ...n, node: i }, c, e, a, t);
|
|
1269
|
+
return d || v(
|
|
1270
|
+
G(a, "div") ?? "div",
|
|
1271
|
+
{
|
|
1272
|
+
...n,
|
|
1273
|
+
...r ? { "data-cf-component": r } : {}
|
|
1274
|
+
},
|
|
1275
|
+
c
|
|
1276
|
+
);
|
|
1277
|
+
};
|
|
1278
|
+
}
|
|
1279
|
+
function ye(e, a, t, o) {
|
|
1280
|
+
return function({ children: i, node: n, ...r }) {
|
|
1281
|
+
const s = be(r), d = s ? te(t, s) : void 0;
|
|
1282
|
+
if (s === "callout")
|
|
1283
|
+
return v(d ?? fe, {
|
|
1284
|
+
...r,
|
|
1285
|
+
className: $(r.className, a.callout),
|
|
1286
|
+
children: i
|
|
1287
|
+
});
|
|
1288
|
+
if (s === "tabs" || s === "code-group")
|
|
1289
|
+
return v(ce, {
|
|
1290
|
+
...r,
|
|
1291
|
+
className: $(r.className, a.tabs),
|
|
1292
|
+
kind: s,
|
|
1293
|
+
component: d,
|
|
1294
|
+
children: i
|
|
1295
|
+
});
|
|
1296
|
+
const b = s && ea(s, { ...r, node: n }, i, a, t, o);
|
|
1297
|
+
if (b) return b;
|
|
1298
|
+
const f = e === "section" && (r["data-cf-element"] === "footnotes" || r.dataCfElement === "footnotes");
|
|
1299
|
+
return v(
|
|
1300
|
+
G(t, e) ?? e,
|
|
1301
|
+
{
|
|
1302
|
+
...r,
|
|
1303
|
+
className: f ? $(r.className, a.footnotes) : r.className,
|
|
1304
|
+
...f ? { "data-cf-element": "footnotes" } : {},
|
|
1305
|
+
...s ? { "data-cf-component": s } : {}
|
|
1306
|
+
},
|
|
1307
|
+
i
|
|
1308
|
+
);
|
|
1309
|
+
};
|
|
1310
|
+
}
|
|
1311
|
+
function Ua(e, a, t) {
|
|
1312
|
+
return function({ children: c, node: i, ...n }) {
|
|
1313
|
+
const r = be(n);
|
|
1314
|
+
if (r && ["code-block", "table", "image", "terminal"].includes(r)) {
|
|
1315
|
+
const d = e[r === "code-block" ? "codeBlock" : r], b = te(a, r);
|
|
1316
|
+
if (b) {
|
|
1317
|
+
const f = Ye(
|
|
1318
|
+
r,
|
|
1319
|
+
{ ...n, className: $(n.className, d) },
|
|
1320
|
+
c
|
|
1321
|
+
);
|
|
1322
|
+
return v(b, aa(r, f, t));
|
|
1323
|
+
}
|
|
1324
|
+
return r === "code-block" ? v(ve, {
|
|
1325
|
+
...n,
|
|
1326
|
+
className: $(n.className, d),
|
|
1327
|
+
children: c
|
|
1328
|
+
}) : r === "table" ? v(Se, {
|
|
1329
|
+
...n,
|
|
1330
|
+
className: $(n.className, d),
|
|
1331
|
+
children: c
|
|
1332
|
+
}) : r === "image" ? v(Ne, {
|
|
1333
|
+
...n,
|
|
1334
|
+
className: $(n.className, d),
|
|
1335
|
+
children: c
|
|
1336
|
+
}) : r === "terminal" ? v(de, {
|
|
1337
|
+
...n,
|
|
1338
|
+
node: i,
|
|
1339
|
+
className: $(n.className, d),
|
|
1340
|
+
children: c
|
|
1341
|
+
}) : v(
|
|
1342
|
+
G(a, "figure") ?? "figure",
|
|
1343
|
+
{ ...n, className: $(n.className, d), "data-cf-component": r },
|
|
1344
|
+
c
|
|
1345
|
+
);
|
|
1346
|
+
}
|
|
1347
|
+
return v(
|
|
1348
|
+
G(a, "figure") ?? "figure",
|
|
1349
|
+
{
|
|
1350
|
+
...n,
|
|
1351
|
+
...r ? { "data-cf-component": r } : {}
|
|
1352
|
+
},
|
|
1353
|
+
c
|
|
1354
|
+
);
|
|
1355
|
+
};
|
|
1356
|
+
}
|
|
1357
|
+
function Wa(e, a) {
|
|
1358
|
+
return function({ children: o, node: c, ...i }) {
|
|
1359
|
+
const n = be(i);
|
|
1360
|
+
if (n === "steps") {
|
|
1361
|
+
const r = te(a, n) ?? Ie;
|
|
1362
|
+
return v(r, {
|
|
1363
|
+
...i,
|
|
1364
|
+
className: $(i.className, e.steps),
|
|
1365
|
+
children: o
|
|
1366
|
+
});
|
|
1367
|
+
}
|
|
1368
|
+
return v(
|
|
1369
|
+
G(a, "ol") ?? "ol",
|
|
1370
|
+
{
|
|
1371
|
+
...i,
|
|
1372
|
+
className: $(i.className, e.list),
|
|
1373
|
+
...n ? { "data-cf-component": n } : {}
|
|
1374
|
+
},
|
|
1375
|
+
o
|
|
1376
|
+
);
|
|
1377
|
+
};
|
|
1378
|
+
}
|
|
1379
|
+
function Ka(e, a) {
|
|
1380
|
+
return function({ children: o, node: c, ...i }) {
|
|
1381
|
+
const n = te(a, "details") ?? G(a, "details") ?? De;
|
|
1382
|
+
return v(n, {
|
|
1383
|
+
...i,
|
|
1384
|
+
node: c,
|
|
1385
|
+
className: $(i.className, e.details),
|
|
1386
|
+
children: o
|
|
1387
|
+
});
|
|
1388
|
+
};
|
|
1389
|
+
}
|
|
1390
|
+
function Va(e = {}, a = {}, t = {}, o) {
|
|
1391
|
+
return {
|
|
1392
|
+
h1: g("h1", "heading", e, t, o),
|
|
1393
|
+
h2: g("h2", "heading", e, t, o),
|
|
1394
|
+
h3: g("h3", "heading", e, t, o),
|
|
1395
|
+
h4: g("h4", "heading", e, t, o),
|
|
1396
|
+
h5: g("h5", "heading", e, t, o),
|
|
1397
|
+
h6: g("h6", "heading", e, t, o),
|
|
1398
|
+
p: g("p", "paragraph", e, t, o),
|
|
1399
|
+
a: g("a", "link", e, t, o),
|
|
1400
|
+
ul: g("ul", "list", e, t, o),
|
|
1401
|
+
ol: Wa(e, t),
|
|
1402
|
+
li: g("li", "listItem", e, t, o),
|
|
1403
|
+
blockquote: g("blockquote", "blockquote", e, t),
|
|
1404
|
+
hr: g("hr", "horizontalRule", e, t),
|
|
1405
|
+
strong: g("strong", "strong", e, t),
|
|
1406
|
+
em: g("em", "emphasis", e, t),
|
|
1407
|
+
del: g("del", "strikethrough", e, t),
|
|
1408
|
+
mark: g("mark", "highlight", e, t),
|
|
1409
|
+
kbd: g("kbd", "keyboard", e, t),
|
|
1410
|
+
sup: g("sup", "superscript", e, t),
|
|
1411
|
+
sub: g("sub", "subscript", e, t),
|
|
1412
|
+
code: g("code", "inlineCode", e, t),
|
|
1413
|
+
div: _a(e, t, o),
|
|
1414
|
+
aside: ye("aside", e, t, o),
|
|
1415
|
+
section: ye("section", e, t, o),
|
|
1416
|
+
span: ye("span", e, t, o),
|
|
1417
|
+
pre: g("pre", "code", e, t),
|
|
1418
|
+
table: g("table", "table", e, t),
|
|
1419
|
+
thead: g("thead", "tableHead", e, t),
|
|
1420
|
+
tbody: g("tbody", "tableBody", e, t),
|
|
1421
|
+
tr: g("tr", "tableRow", e, t),
|
|
1422
|
+
th: g("th", "tableHeader", e, t),
|
|
1423
|
+
td: g("td", "tableCell", e, t),
|
|
1424
|
+
input: g("input", "taskCheckbox", e, t),
|
|
1425
|
+
figure: Ua(e, t, o),
|
|
1426
|
+
img: g("img", "image", e, t, o),
|
|
1427
|
+
video: g("video", "video", e, t, o),
|
|
1428
|
+
audio: g("audio", "audio", e, t, o),
|
|
1429
|
+
iframe: g("iframe", "embed", e, t, o),
|
|
1430
|
+
dl: g("dl", "definitionList", e, t),
|
|
1431
|
+
dt: g("dt", "definitionTerm", e, t),
|
|
1432
|
+
dd: g("dd", "definitionDescription", e, t),
|
|
1433
|
+
summary: g("summary", "summary", e, t),
|
|
1434
|
+
figcaption: ja(a, t),
|
|
1435
|
+
svg: Ba(a, t),
|
|
1436
|
+
details: Ka(e, t),
|
|
1437
|
+
MarkdownCallout: fe,
|
|
1438
|
+
MarkdownTabs: ce,
|
|
1439
|
+
MarkdownSteps: Ie,
|
|
1440
|
+
MarkdownCodeBlock: ve,
|
|
1441
|
+
MarkdownCopySnippet: Ce,
|
|
1442
|
+
MarkdownTable: Se,
|
|
1443
|
+
MarkdownImage: Ne,
|
|
1444
|
+
MarkdownDetails: De,
|
|
1445
|
+
MarkdownTerminal: de,
|
|
1446
|
+
MarkdownFileTree: Ae,
|
|
1447
|
+
MarkdownGallery: he,
|
|
1448
|
+
MarkdownCardGrid: $e,
|
|
1449
|
+
MarkdownApiBlock: ze,
|
|
1450
|
+
MarkdownAside: Pe,
|
|
1451
|
+
MarkdownBadge: Oe,
|
|
1452
|
+
Callout: fe,
|
|
1453
|
+
Tabs: ce,
|
|
1454
|
+
CodeGroup: ce,
|
|
1455
|
+
Steps: Ie,
|
|
1456
|
+
CodeBlock: ve,
|
|
1457
|
+
CopySnippet: Ce,
|
|
1458
|
+
Table: Se,
|
|
1459
|
+
Image: Ne,
|
|
1460
|
+
Details: De,
|
|
1461
|
+
Terminal: de,
|
|
1462
|
+
FileTree: Ae,
|
|
1463
|
+
Gallery: he,
|
|
1464
|
+
CardGrid: $e,
|
|
1465
|
+
Api: ze,
|
|
1466
|
+
Aside: Pe,
|
|
1467
|
+
Badge: Oe
|
|
1468
|
+
};
|
|
1469
|
+
}
|
|
1470
|
+
function et(e = {}, a = {}, t = {}, o) {
|
|
1471
|
+
const c = Va(e, a, t, o);
|
|
1472
|
+
for (const [i, n] of Object.entries(t))
|
|
1473
|
+
/^[A-Z]/.test(i) && (c[i] = n);
|
|
1474
|
+
return c;
|
|
1475
|
+
}
|
|
1476
|
+
export {
|
|
1477
|
+
Ne as M,
|
|
1478
|
+
Se as a,
|
|
1479
|
+
et as b,
|
|
1480
|
+
Va as c,
|
|
1481
|
+
Ya as d,
|
|
1482
|
+
La as s
|
|
1483
|
+
};
|