@x-wave/blog 1.0.6 → 1.0.7
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/index.js +391 -372
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
import { jsxs as d, jsx as e, Fragment as z } from "react/jsx-runtime";
|
|
2
|
-
import { useTranslation as
|
|
3
|
-
import { useLocation as
|
|
4
|
-
import { X as se, Tag as Ce, User as Te, CalendarBlank as
|
|
2
|
+
import { useTranslation as O } from "react-i18next";
|
|
3
|
+
import { useLocation as U, useNavigate as G, useParams as ae, Link as de, Navigate as fe, Routes as ke, Route as ue } from "react-router-dom";
|
|
4
|
+
import { X as se, Tag as Ce, User as Te, CalendarBlank as Se, MagnifyingGlass as he, List as ye, Sun as me, Moon as ge, Monitor as _e, CaretDown as oe, Globe as Le, CaretRight as Pe } from "@phosphor-icons/react";
|
|
5
5
|
import { useState as L, useEffect as P, createContext as Be, useContext as Me, useRef as W } from "react";
|
|
6
6
|
import De from "react-markdown";
|
|
7
7
|
import Ee from "remark-gfm";
|
|
8
8
|
import ne from "i18next";
|
|
9
|
-
import { createPortal as
|
|
10
|
-
const Oe = "_tabContainer_zk6h4_1", Re = "_tab_zk6h4_1", je = "_active_zk6h4_45",
|
|
9
|
+
import { createPortal as ve } from "react-dom";
|
|
10
|
+
const Oe = "_tabContainer_zk6h4_1", Re = "_tab_zk6h4_1", je = "_active_zk6h4_45", X = {
|
|
11
11
|
tabContainer: Oe,
|
|
12
12
|
tab: Re,
|
|
13
13
|
active: je
|
|
14
14
|
};
|
|
15
15
|
function Ae({ hasAdvanced: t }) {
|
|
16
|
-
const { t: n } =
|
|
16
|
+
const { t: n } = O(), a = U(), s = G();
|
|
17
17
|
if (!t) return null;
|
|
18
|
-
const o = new URLSearchParams(a.search).has("advanced"),
|
|
18
|
+
const o = new URLSearchParams(a.search).has("advanced"), l = () => {
|
|
19
19
|
if (o) {
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
s(`${a.pathname}${
|
|
20
|
+
const u = new URLSearchParams(a.search);
|
|
21
|
+
u.delete("advanced");
|
|
22
|
+
const p = u.toString(), w = p ? `?${p}` : "";
|
|
23
|
+
s(`${a.pathname}${w}${a.hash}`);
|
|
24
24
|
}
|
|
25
25
|
}, g = () => {
|
|
26
26
|
if (!o) {
|
|
27
|
-
const
|
|
28
|
-
|
|
27
|
+
const u = new URLSearchParams(a.search);
|
|
28
|
+
u.set("advanced", ""), s(`${a.pathname}?${u.toString()}${a.hash}`);
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
|
-
return /* @__PURE__ */ d("div", { className:
|
|
31
|
+
return /* @__PURE__ */ d("div", { className: X.tabContainer, children: [
|
|
32
32
|
/* @__PURE__ */ e(
|
|
33
33
|
"button",
|
|
34
34
|
{
|
|
35
35
|
type: "button",
|
|
36
|
-
className: `${
|
|
37
|
-
onClick:
|
|
36
|
+
className: `${X.tab} ${o ? "" : X.active}`,
|
|
37
|
+
onClick: l,
|
|
38
38
|
children: n("ui.simple")
|
|
39
39
|
}
|
|
40
40
|
),
|
|
@@ -42,7 +42,7 @@ function Ae({ hasAdvanced: t }) {
|
|
|
42
42
|
"button",
|
|
43
43
|
{
|
|
44
44
|
type: "button",
|
|
45
|
-
className: `${
|
|
45
|
+
className: `${X.tab} ${o ? X.active : ""}`,
|
|
46
46
|
onClick: g,
|
|
47
47
|
children: n("ui.advanced")
|
|
48
48
|
}
|
|
@@ -56,55 +56,55 @@ function be(t) {
|
|
|
56
56
|
function n(a) {
|
|
57
57
|
const s = a.match(/^---\s*\n([\s\S]*?)\n---\s*\n/);
|
|
58
58
|
if (!s) return { frontmatter: {}, content: a };
|
|
59
|
-
const
|
|
60
|
-
let
|
|
61
|
-
const
|
|
62
|
-
for (const
|
|
59
|
+
const c = {}, o = s[1];
|
|
60
|
+
let l = "", g = !1;
|
|
61
|
+
const u = [];
|
|
62
|
+
for (const w of o.split(`
|
|
63
63
|
`)) {
|
|
64
|
-
const _ =
|
|
64
|
+
const _ = w.trim();
|
|
65
65
|
if (_.startsWith("-")) {
|
|
66
66
|
if (g) {
|
|
67
67
|
const v = _.substring(1).trim();
|
|
68
|
-
|
|
68
|
+
u.push(v);
|
|
69
69
|
}
|
|
70
70
|
continue;
|
|
71
71
|
}
|
|
72
|
-
if (g && !_.startsWith("-") && (l
|
|
73
|
-
const [v, ...r] = _.split(":"),
|
|
74
|
-
if (
|
|
72
|
+
if (g && !_.startsWith("-") && (c[l] = u.slice(), u.length = 0, g = !1), _ != null && _.includes(":")) {
|
|
73
|
+
const [v, ...r] = _.split(":"), f = r.join(":").trim();
|
|
74
|
+
if (l = v.trim(), !f) {
|
|
75
75
|
g = !0;
|
|
76
76
|
continue;
|
|
77
77
|
}
|
|
78
|
-
|
|
78
|
+
f === "true" ? c[l] = !0 : f === "false" ? c[l] = !1 : c[l] = f;
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
g &&
|
|
82
|
-
const
|
|
81
|
+
g && u.length > 0 && (c[l] = u);
|
|
82
|
+
const p = a.replace(
|
|
83
83
|
/^---\s*\n[\s\S]*?\n---\s*\n/,
|
|
84
84
|
""
|
|
85
85
|
);
|
|
86
|
-
return { frontmatter:
|
|
86
|
+
return { frontmatter: c, content: p };
|
|
87
87
|
}
|
|
88
88
|
return {
|
|
89
89
|
/**
|
|
90
90
|
* Load MDX content for a given language and slug.
|
|
91
91
|
* Automatically loads the advanced variant if `advanced` is true.
|
|
92
92
|
*/
|
|
93
|
-
async loadMDXContent(a, s,
|
|
94
|
-
const o =
|
|
95
|
-
if (!g) throw new Error(`File not found: ${
|
|
96
|
-
const
|
|
97
|
-
return { content:
|
|
93
|
+
async loadMDXContent(a, s, c = !1) {
|
|
94
|
+
const o = c ? `${s}-advanced.mdx` : `${s}.mdx`, l = `./docs/${a}/${o}`, g = t[l];
|
|
95
|
+
if (!g) throw new Error(`File not found: ${l}`);
|
|
96
|
+
const u = await g(), { frontmatter: p, content: w } = n(u);
|
|
97
|
+
return { content: w, frontmatter: p };
|
|
98
98
|
},
|
|
99
99
|
/**
|
|
100
100
|
* Load English content for generating consistent heading IDs.
|
|
101
101
|
* All heading anchors are derived from English content for stability across translations.
|
|
102
102
|
*/
|
|
103
103
|
async loadEnglishContent(a, s = !1) {
|
|
104
|
-
const o = `./docs/en/${s ? `${a}-advanced.mdx` : `${a}.mdx`}`,
|
|
105
|
-
if (!
|
|
106
|
-
const g = await
|
|
107
|
-
return
|
|
104
|
+
const o = `./docs/en/${s ? `${a}-advanced.mdx` : `${a}.mdx`}`, l = t[o];
|
|
105
|
+
if (!l) throw new Error(`File not found: ${o}`);
|
|
106
|
+
const g = await l(), { content: u } = n(g);
|
|
107
|
+
return u;
|
|
108
108
|
},
|
|
109
109
|
/**
|
|
110
110
|
* Build a tag index from all MDX files.
|
|
@@ -114,19 +114,19 @@ function be(t) {
|
|
|
114
114
|
* @returns Promise resolving to tag index mapping tag names to document info
|
|
115
115
|
*/
|
|
116
116
|
async buildTagIndex(a = "en") {
|
|
117
|
-
const s = {},
|
|
118
|
-
(
|
|
117
|
+
const s = {}, c = `./docs/${a}/`, o = Object.keys(t).filter(
|
|
118
|
+
(l) => l.startsWith(c)
|
|
119
119
|
);
|
|
120
|
-
for (const
|
|
120
|
+
for (const l of o)
|
|
121
121
|
try {
|
|
122
|
-
const g = t[
|
|
122
|
+
const g = t[l], u = await g(), { frontmatter: p, content: w } = n(u), _ = l.split("/").pop() || "", v = _.replace(".mdx", "").replace("-advanced", ""), r = w.match(/^#\s+(.+)$/m), f = r ? r[1].trim() : v;
|
|
123
123
|
if (_.includes("-advanced")) continue;
|
|
124
|
-
const i =
|
|
124
|
+
const i = p.tags;
|
|
125
125
|
if (i && Array.isArray(i))
|
|
126
126
|
for (const b of i)
|
|
127
|
-
s[b] || (s[b] = []), s[b].some((C) => C.slug === v) || s[b].push({ slug: v, title:
|
|
127
|
+
s[b] || (s[b] = []), s[b].some((C) => C.slug === v) || s[b].push({ slug: v, title: f });
|
|
128
128
|
} catch (g) {
|
|
129
|
-
console.warn(`Failed to process ${
|
|
129
|
+
console.warn(`Failed to process ${l}:`, g);
|
|
130
130
|
}
|
|
131
131
|
return s;
|
|
132
132
|
}
|
|
@@ -143,13 +143,13 @@ function Eo(t) {
|
|
|
143
143
|
const we = "app-theme", $e = () => typeof window > "u" ? "light" : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", pe = (t) => t === "system" ? $e() : t, qe = () => typeof window > "u" ? "system" : localStorage.getItem(we) || "system", Ne = () => {
|
|
144
144
|
const [t, n] = L(qe);
|
|
145
145
|
return P(() => {
|
|
146
|
-
const s = pe(t),
|
|
147
|
-
if (
|
|
148
|
-
const o = window.matchMedia("(prefers-color-scheme: dark)"),
|
|
149
|
-
const g = $e(),
|
|
150
|
-
|
|
146
|
+
const s = pe(t), c = document.querySelector(".xw-blog-root");
|
|
147
|
+
if (c && (c.classList.remove("light", "dark"), c.classList.add(s)), t === "system") {
|
|
148
|
+
const o = window.matchMedia("(prefers-color-scheme: dark)"), l = () => {
|
|
149
|
+
const g = $e(), u = document.querySelector(".xw-blog-root");
|
|
150
|
+
u && (u.classList.remove("light", "dark"), u.classList.add(g));
|
|
151
151
|
};
|
|
152
|
-
return o.addEventListener("change",
|
|
152
|
+
return o.addEventListener("change", l), () => o.removeEventListener("change", l);
|
|
153
153
|
}
|
|
154
154
|
}, [t]), {
|
|
155
155
|
theme: t,
|
|
@@ -175,34 +175,39 @@ const we = "app-theme", $e = () => typeof window > "u" ? "light" : window.matchM
|
|
|
175
175
|
...a.showTableOfContents !== void 0 && {
|
|
176
176
|
showTableOfContents: a.showTableOfContents
|
|
177
177
|
}
|
|
178
|
-
}),
|
|
179
|
-
function Oo({
|
|
178
|
+
}), V = (t) => t.toString().toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-+|-+$/g, ""), Ie = Be(null);
|
|
179
|
+
function Oo({
|
|
180
|
+
children: t,
|
|
181
|
+
config: n,
|
|
182
|
+
blog: a,
|
|
183
|
+
navigationData: s
|
|
184
|
+
}) {
|
|
180
185
|
Ne();
|
|
181
|
-
const [
|
|
186
|
+
const [c, o] = L({});
|
|
182
187
|
P(() => {
|
|
183
|
-
const { buildTagIndex:
|
|
188
|
+
const { buildTagIndex: g } = be(a.mdxFiles), u = n.supportedLanguages.map(async (p) => {
|
|
184
189
|
try {
|
|
185
|
-
const
|
|
186
|
-
return { language:
|
|
187
|
-
} catch (
|
|
188
|
-
return console.error(`Failed to build tag index for ${
|
|
190
|
+
const w = await g(p);
|
|
191
|
+
return { language: p, index: w };
|
|
192
|
+
} catch (w) {
|
|
193
|
+
return console.error(`Failed to build tag index for ${p}:`, w), { language: p, index: {} };
|
|
189
194
|
}
|
|
190
195
|
});
|
|
191
|
-
Promise.all(
|
|
192
|
-
const
|
|
193
|
-
for (const
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
}).catch((
|
|
197
|
-
console.error("Failed to build tag indices:",
|
|
196
|
+
Promise.all(u).then((p) => {
|
|
197
|
+
const w = {};
|
|
198
|
+
for (const _ of p)
|
|
199
|
+
w[_.language] = _.index;
|
|
200
|
+
o(w);
|
|
201
|
+
}).catch((p) => {
|
|
202
|
+
console.error("Failed to build tag indices:", p);
|
|
198
203
|
});
|
|
199
204
|
}, [a.mdxFiles, n.supportedLanguages]);
|
|
200
|
-
const
|
|
205
|
+
const l = { ...n, navigationData: s, tagIndex: c };
|
|
201
206
|
return /* @__PURE__ */ e(
|
|
202
207
|
Ie.Provider,
|
|
203
208
|
{
|
|
204
209
|
value: {
|
|
205
|
-
config:
|
|
210
|
+
config: l,
|
|
206
211
|
loadContent: a.loadContent,
|
|
207
212
|
loadEnglishContent: a.loadEnglishContent
|
|
208
213
|
},
|
|
@@ -210,13 +215,13 @@ function Oo({ children: t, config: n, blog: a }) {
|
|
|
210
215
|
}
|
|
211
216
|
);
|
|
212
217
|
}
|
|
213
|
-
function
|
|
218
|
+
function j() {
|
|
214
219
|
const t = Me(Ie);
|
|
215
220
|
if (!t)
|
|
216
221
|
throw new Error("useBlogConfig must be used within a BlogProvider");
|
|
217
222
|
return t;
|
|
218
223
|
}
|
|
219
|
-
const Fe = "_tableOfContents_11q9u_1", Ke = "_header_11q9u_20", ze = "_title_11q9u_24", Ue = "_nav_11q9u_33", Ge = "_list_11q9u_39", Qe = "_link_11q9u_46", Xe = "_active_11q9u_70", Ye = "_level1_11q9u_86", Ve = "_level2_11q9u_92", Je = "_level3_11q9u_97", Ze = "_level4_11q9u_103", et = "_level5_11q9u_109", tt = "_level6_11q9u_115",
|
|
224
|
+
const Fe = "_tableOfContents_11q9u_1", Ke = "_header_11q9u_20", ze = "_title_11q9u_24", Ue = "_nav_11q9u_33", Ge = "_list_11q9u_39", Qe = "_link_11q9u_46", Xe = "_active_11q9u_70", Ye = "_level1_11q9u_86", Ve = "_level2_11q9u_92", Je = "_level3_11q9u_97", Ze = "_level4_11q9u_103", et = "_level5_11q9u_109", tt = "_level6_11q9u_115", H = {
|
|
220
225
|
tableOfContents: Fe,
|
|
221
226
|
header: Ke,
|
|
222
227
|
title: ze,
|
|
@@ -235,28 +240,28 @@ function nt({
|
|
|
235
240
|
content: t,
|
|
236
241
|
englishContent: n
|
|
237
242
|
}) {
|
|
238
|
-
const { t: a } =
|
|
243
|
+
const { t: a } = O(), s = U(), c = G(), [o, l] = L([]), [g, u] = L(""), p = W(null);
|
|
239
244
|
P(() => {
|
|
240
|
-
|
|
245
|
+
u(""), (() => {
|
|
241
246
|
const v = /^(#{1,6})\s+(.+)$/gm, r = [];
|
|
242
|
-
let
|
|
247
|
+
let f = v.exec(t);
|
|
243
248
|
const i = [];
|
|
244
|
-
for (;
|
|
245
|
-
const
|
|
246
|
-
i.push({ level:
|
|
249
|
+
for (; f !== null; ) {
|
|
250
|
+
const m = f[1].length, $ = f[2].trim();
|
|
251
|
+
i.push({ level: m, text: $ }), f = v.exec(t);
|
|
247
252
|
}
|
|
248
253
|
const b = /^(#{1,6})\s+(.+)$/gm;
|
|
249
|
-
let C = b.exec(n),
|
|
250
|
-
for (; C !== null &&
|
|
251
|
-
const
|
|
254
|
+
let C = b.exec(n), S = 0;
|
|
255
|
+
for (; C !== null && S < i.length; ) {
|
|
256
|
+
const m = C[2].trim(), $ = V(m);
|
|
252
257
|
r.push({
|
|
253
|
-
id:
|
|
254
|
-
text: i[
|
|
258
|
+
id: $,
|
|
259
|
+
text: i[S].text,
|
|
255
260
|
// Use localized text for display
|
|
256
|
-
level: i[
|
|
257
|
-
}),
|
|
261
|
+
level: i[S].level
|
|
262
|
+
}), S++, C = b.exec(n);
|
|
258
263
|
}
|
|
259
|
-
|
|
264
|
+
l(r);
|
|
260
265
|
})();
|
|
261
266
|
}, [t, n]), P(() => {
|
|
262
267
|
if (o.length === 0) return;
|
|
@@ -269,15 +274,15 @@ function nt({
|
|
|
269
274
|
return () => clearTimeout(_);
|
|
270
275
|
}, [o]), P(() => {
|
|
271
276
|
if (o.length === 0) return;
|
|
272
|
-
|
|
277
|
+
p.current && p.current.disconnect();
|
|
273
278
|
const _ = setTimeout(() => {
|
|
274
279
|
const v = o.map((r) => document.getElementById(r.id)).filter(Boolean);
|
|
275
|
-
v.length !== 0 && (
|
|
280
|
+
v.length !== 0 && (p.current = new IntersectionObserver(
|
|
276
281
|
(r) => {
|
|
277
|
-
const
|
|
278
|
-
if (
|
|
279
|
-
const i =
|
|
280
|
-
|
|
282
|
+
const f = r.filter((i) => i.isIntersecting);
|
|
283
|
+
if (f.length > 0) {
|
|
284
|
+
const i = f.reduce((b, C) => b.boundingClientRect.top < C.boundingClientRect.top ? b : C);
|
|
285
|
+
u(i.target.id);
|
|
281
286
|
}
|
|
282
287
|
},
|
|
283
288
|
{
|
|
@@ -285,20 +290,20 @@ function nt({
|
|
|
285
290
|
threshold: 0
|
|
286
291
|
}
|
|
287
292
|
), v.forEach((r) => {
|
|
288
|
-
|
|
293
|
+
p.current && p.current.observe(r);
|
|
289
294
|
}));
|
|
290
295
|
}, 150);
|
|
291
296
|
return () => {
|
|
292
|
-
clearTimeout(_),
|
|
297
|
+
clearTimeout(_), p.current && p.current.disconnect();
|
|
293
298
|
};
|
|
294
299
|
}, [o]), P(() => () => {
|
|
295
|
-
|
|
300
|
+
p.current && p.current.disconnect();
|
|
296
301
|
}, []);
|
|
297
|
-
const
|
|
302
|
+
const w = (_) => {
|
|
298
303
|
const v = document.getElementById(_);
|
|
299
304
|
if (v) {
|
|
300
305
|
const r = new URLSearchParams(s.search);
|
|
301
|
-
r.set("a", _),
|
|
306
|
+
r.set("a", _), c(
|
|
302
307
|
`${s.pathname}?${r.toString()}${s.hash}`,
|
|
303
308
|
{
|
|
304
309
|
replace: !0
|
|
@@ -311,13 +316,13 @@ function nt({
|
|
|
311
316
|
});
|
|
312
317
|
}
|
|
313
318
|
};
|
|
314
|
-
return o.length === 0 ? null : /* @__PURE__ */ d("aside", { className:
|
|
315
|
-
/* @__PURE__ */ e("div", { className:
|
|
316
|
-
/* @__PURE__ */ e("nav", { className:
|
|
319
|
+
return o.length === 0 ? null : /* @__PURE__ */ d("aside", { className: H.tableOfContents, children: [
|
|
320
|
+
/* @__PURE__ */ e("div", { className: H.header, children: /* @__PURE__ */ e("span", { className: H.title, children: a("ui.onThisPage", "On this page") }) }),
|
|
321
|
+
/* @__PURE__ */ e("nav", { className: H.nav, children: /* @__PURE__ */ e("ul", { className: H.list, children: o.map((_) => /* @__PURE__ */ e("li", { className: H.item, children: /* @__PURE__ */ e(
|
|
317
322
|
"button",
|
|
318
323
|
{
|
|
319
|
-
className: `${
|
|
320
|
-
onClick: () =>
|
|
324
|
+
className: `${H.link} ${H[`level${_.level}`]} ${g === _.id ? H.active : ""}`,
|
|
325
|
+
onClick: () => w(_.id),
|
|
321
326
|
type: "button",
|
|
322
327
|
children: _.text
|
|
323
328
|
}
|
|
@@ -337,21 +342,21 @@ const ot = "_overlay_1e1d4_1", at = "_modal_1e1d4_26", st = "_header_1e1d4_50",
|
|
|
337
342
|
resultSlug: ht,
|
|
338
343
|
noResults: mt
|
|
339
344
|
};
|
|
340
|
-
function
|
|
345
|
+
function gt({
|
|
341
346
|
tag: t,
|
|
342
347
|
results: n,
|
|
343
348
|
language: a,
|
|
344
349
|
onClose: s
|
|
345
350
|
}) {
|
|
346
|
-
const { t:
|
|
347
|
-
const
|
|
348
|
-
|
|
351
|
+
const { t: c } = O(), { config: o } = j(), l = G(), g = (u) => {
|
|
352
|
+
const p = o.basePath || "";
|
|
353
|
+
l(`${p}/${a}/${u}`), s();
|
|
349
354
|
};
|
|
350
|
-
return
|
|
351
|
-
/* @__PURE__ */ e("div", { className: E.overlay, onClick: s, children: /* @__PURE__ */ d("div", { className: E.modal, onClick: (
|
|
355
|
+
return ve(
|
|
356
|
+
/* @__PURE__ */ e("div", { className: E.overlay, onClick: s, children: /* @__PURE__ */ d("div", { className: E.modal, onClick: (u) => u.stopPropagation(), children: [
|
|
352
357
|
/* @__PURE__ */ d("div", { className: E.header, children: [
|
|
353
358
|
/* @__PURE__ */ d("h2", { className: E.title, children: [
|
|
354
|
-
|
|
359
|
+
c("ui.tagResults"),
|
|
355
360
|
": ",
|
|
356
361
|
t
|
|
357
362
|
] }),
|
|
@@ -366,37 +371,37 @@ function _t({
|
|
|
366
371
|
}
|
|
367
372
|
)
|
|
368
373
|
] }),
|
|
369
|
-
/* @__PURE__ */ e("div", { className: E.results, children: n.length === 0 ? /* @__PURE__ */ e("div", { className: E.noResults, children:
|
|
374
|
+
/* @__PURE__ */ e("div", { className: E.results, children: n.length === 0 ? /* @__PURE__ */ e("div", { className: E.noResults, children: c("ui.noTagResults") }) : /* @__PURE__ */ e("ul", { className: E.resultsList, children: n.map((u) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ d(
|
|
370
375
|
"button",
|
|
371
376
|
{
|
|
372
377
|
type: "button",
|
|
373
378
|
className: E.resultItem,
|
|
374
|
-
onClick: () => g(
|
|
379
|
+
onClick: () => g(u.slug),
|
|
375
380
|
children: [
|
|
376
|
-
/* @__PURE__ */ e("div", { className: E.resultTitle, children:
|
|
381
|
+
/* @__PURE__ */ e("div", { className: E.resultTitle, children: u.title }),
|
|
377
382
|
/* @__PURE__ */ d("div", { className: E.resultSlug, children: [
|
|
378
383
|
"/",
|
|
379
|
-
|
|
384
|
+
u.slug
|
|
380
385
|
] })
|
|
381
386
|
]
|
|
382
387
|
}
|
|
383
|
-
) },
|
|
388
|
+
) }, u.slug)) }) })
|
|
384
389
|
] }) }),
|
|
385
390
|
document.body
|
|
386
391
|
);
|
|
387
392
|
}
|
|
388
|
-
const
|
|
389
|
-
tags:
|
|
393
|
+
const _t = "_tags_11t8a_1", pt = "_compact_11t8a_9", ft = "_tagLabel_11t8a_15", vt = "_tagIcon_11t8a_25", bt = "_tagList_11t8a_30", wt = "_tag_11t8a_1", K = {
|
|
394
|
+
tags: _t,
|
|
390
395
|
compact: pt,
|
|
391
|
-
tagLabel:
|
|
392
|
-
tagIcon:
|
|
396
|
+
tagLabel: ft,
|
|
397
|
+
tagIcon: vt,
|
|
393
398
|
tagList: bt,
|
|
394
399
|
tag: wt
|
|
395
400
|
};
|
|
396
401
|
function $t({ tags: t, variant: n = "default", onTagClick: a }) {
|
|
397
|
-
const { t: s } =
|
|
402
|
+
const { t: s } = O();
|
|
398
403
|
if (!t || t.length === 0) return null;
|
|
399
|
-
const
|
|
404
|
+
const c = (o) => {
|
|
400
405
|
a && a(o);
|
|
401
406
|
};
|
|
402
407
|
return /* @__PURE__ */ d(
|
|
@@ -416,7 +421,7 @@ function $t({ tags: t, variant: n = "default", onTagClick: a }) {
|
|
|
416
421
|
{
|
|
417
422
|
type: "button",
|
|
418
423
|
className: K.tag,
|
|
419
|
-
onClick: () =>
|
|
424
|
+
onClick: () => c(o),
|
|
420
425
|
"aria-label": `${s("ui.filterByTag")}: ${o}`,
|
|
421
426
|
children: o
|
|
422
427
|
},
|
|
@@ -426,15 +431,15 @@ function $t({ tags: t, variant: n = "default", onTagClick: a }) {
|
|
|
426
431
|
}
|
|
427
432
|
);
|
|
428
433
|
}
|
|
429
|
-
const Nt = "_contentPage_1nxj5_1", It = "_metadata_1nxj5_20", xt = "_author_1nxj5_30", kt = "_date_1nxj5_31", Ct = "_loadingContainer_1nxj5_48", Tt = "_errorContainer_1nxj5_49",
|
|
434
|
+
const Nt = "_contentPage_1nxj5_1", It = "_metadata_1nxj5_20", xt = "_author_1nxj5_30", kt = "_date_1nxj5_31", Ct = "_loadingContainer_1nxj5_48", Tt = "_errorContainer_1nxj5_49", St = "_skeletonTitle_1nxj5_71", yt = "_skeletonParagraph_1nxj5_80", Lt = "_skeletonParagraphShort_1nxj5_93", Pt = "_errorText_1nxj5_107", Bt = "_mdxContent_1nxj5_112", Mt = "_withMetadata_1nxj5_125", Dt = "_codeBlock_1nxj5_300", Et = "_codeLanguage_1nxj5_304", M = {
|
|
430
435
|
contentPage: Nt,
|
|
431
436
|
metadata: It,
|
|
432
437
|
author: xt,
|
|
433
438
|
date: kt,
|
|
434
439
|
loadingContainer: Ct,
|
|
435
440
|
errorContainer: Tt,
|
|
436
|
-
skeletonTitle:
|
|
437
|
-
skeletonParagraph:
|
|
441
|
+
skeletonTitle: St,
|
|
442
|
+
skeletonParagraph: yt,
|
|
438
443
|
skeletonParagraphShort: Lt,
|
|
439
444
|
errorText: Pt,
|
|
440
445
|
mdxContent: Bt,
|
|
@@ -444,83 +449,83 @@ const Nt = "_contentPage_1nxj5_1", It = "_metadata_1nxj5_20", xt = "_author_1nxj
|
|
|
444
449
|
};
|
|
445
450
|
function Ot({ language: t }) {
|
|
446
451
|
var ie;
|
|
447
|
-
const { slug: n } = ae(), a =
|
|
448
|
-
const
|
|
452
|
+
const { slug: n } = ae(), a = U(), { t: s } = O(), { config: c, loadContent: o, loadEnglishContent: l } = j(), [g, u] = L(""), [p, w] = L(""), [_, v] = L({}), [r, f] = L(!0), [i, b] = L(null), [C, S] = L(!0), [m, $] = L(null), B = W(0), Q = W([]), J = ((h) => {
|
|
453
|
+
const N = {
|
|
449
454
|
advanced: !1,
|
|
450
455
|
anchor: ""
|
|
451
456
|
};
|
|
452
|
-
if (!
|
|
453
|
-
const
|
|
454
|
-
for (const T of
|
|
455
|
-
T === "advanced" ?
|
|
456
|
-
return
|
|
457
|
-
})(a.search),
|
|
457
|
+
if (!h) return N;
|
|
458
|
+
const I = (h.startsWith("?") ? h.substring(1) : h).split("&");
|
|
459
|
+
for (const T of I)
|
|
460
|
+
T === "advanced" ? N.advanced = !0 : T.startsWith("a=") && (N.anchor = T.substring(2));
|
|
461
|
+
return N;
|
|
462
|
+
})(a.search), A = J.advanced;
|
|
458
463
|
if (P(() => {
|
|
459
464
|
(async () => {
|
|
460
465
|
if (!n) return;
|
|
461
|
-
|
|
462
|
-
let
|
|
463
|
-
for (const x of
|
|
466
|
+
f(!0), b(null), B.current = 0;
|
|
467
|
+
let N = !0;
|
|
468
|
+
for (const x of c.navigationData)
|
|
464
469
|
if ("items" in x) {
|
|
465
|
-
const
|
|
466
|
-
if (
|
|
467
|
-
|
|
470
|
+
const I = x.items.find((T) => T.slug === n);
|
|
471
|
+
if (I) {
|
|
472
|
+
N = I.showTableOfContents !== !1;
|
|
468
473
|
break;
|
|
469
474
|
}
|
|
470
475
|
} else if (x.slug === n) {
|
|
471
|
-
|
|
476
|
+
N = x.showTableOfContents !== !1;
|
|
472
477
|
break;
|
|
473
478
|
}
|
|
474
|
-
|
|
479
|
+
S(N);
|
|
475
480
|
try {
|
|
476
481
|
let x;
|
|
477
482
|
try {
|
|
478
|
-
x = await o(t, n,
|
|
483
|
+
x = await o(t, n, A);
|
|
479
484
|
} catch {
|
|
480
|
-
if (
|
|
485
|
+
if (A)
|
|
481
486
|
x = await o(t, n, !1);
|
|
482
487
|
else
|
|
483
488
|
throw new Error("Content not found");
|
|
484
489
|
}
|
|
485
|
-
let
|
|
490
|
+
let I = "";
|
|
486
491
|
try {
|
|
487
|
-
|
|
492
|
+
I = await l(n, A);
|
|
488
493
|
} catch {
|
|
489
|
-
|
|
494
|
+
A && (I = await l(n, !1));
|
|
490
495
|
}
|
|
491
|
-
const T = /^(#{1,6})\s+(.+)$/gm,
|
|
492
|
-
let F = T.exec(
|
|
496
|
+
const T = /^(#{1,6})\s+(.+)$/gm, R = [];
|
|
497
|
+
let F = T.exec(I);
|
|
493
498
|
for (; F !== null; ) {
|
|
494
499
|
const Z = F[2].trim();
|
|
495
|
-
|
|
500
|
+
R.push(Z), F = T.exec(I);
|
|
496
501
|
}
|
|
497
|
-
|
|
502
|
+
Q.current = R, w(I), u(x.content), v(x.frontmatter);
|
|
498
503
|
} catch (x) {
|
|
499
504
|
b(x instanceof Error ? x.message : "Failed to load content");
|
|
500
505
|
} finally {
|
|
501
|
-
|
|
506
|
+
f(!1);
|
|
502
507
|
}
|
|
503
508
|
})();
|
|
504
509
|
}, [
|
|
505
510
|
n,
|
|
506
511
|
t,
|
|
507
|
-
|
|
508
|
-
|
|
512
|
+
A,
|
|
513
|
+
c.navigationData,
|
|
509
514
|
o,
|
|
510
|
-
|
|
515
|
+
l
|
|
511
516
|
]), P(() => {
|
|
512
517
|
if (!r && J.anchor) {
|
|
513
|
-
const
|
|
514
|
-
const
|
|
515
|
-
if (
|
|
516
|
-
const T =
|
|
518
|
+
const h = setTimeout(() => {
|
|
519
|
+
const N = document.getElementById(J.anchor);
|
|
520
|
+
if (N) {
|
|
521
|
+
const T = N.getBoundingClientRect().top + window.pageYOffset - 80;
|
|
517
522
|
window.scrollTo({
|
|
518
523
|
top: T,
|
|
519
524
|
behavior: "smooth"
|
|
520
525
|
});
|
|
521
526
|
}
|
|
522
527
|
}, 150);
|
|
523
|
-
return () => clearTimeout(
|
|
528
|
+
return () => clearTimeout(h);
|
|
524
529
|
}
|
|
525
530
|
}, [r, J.anchor]), r)
|
|
526
531
|
return /* @__PURE__ */ e("div", { className: M.contentPage, children: /* @__PURE__ */ d("div", { className: M.loadingContainer, children: [
|
|
@@ -542,7 +547,7 @@ function Ot({ language: t }) {
|
|
|
542
547
|
_.author
|
|
543
548
|
] }),
|
|
544
549
|
_.date && /* @__PURE__ */ d("span", { className: M.date, children: [
|
|
545
|
-
/* @__PURE__ */ e(
|
|
550
|
+
/* @__PURE__ */ e(Se, { size: 16, weight: "regular" }),
|
|
546
551
|
s("ui.lastEdited"),
|
|
547
552
|
": ",
|
|
548
553
|
_.date
|
|
@@ -556,22 +561,22 @@ function Ot({ language: t }) {
|
|
|
556
561
|
{
|
|
557
562
|
remarkPlugins: [Ee],
|
|
558
563
|
components: {
|
|
559
|
-
h1: ({ children:
|
|
560
|
-
const
|
|
564
|
+
h1: ({ children: h }) => {
|
|
565
|
+
const N = B.current++, x = Q.current[N] || "", I = V(x), T = A ? `?advanced&a=${I}` : `?a=${I}`, R = `#/${t}/${n}${T}`, F = !le;
|
|
561
566
|
le = !0;
|
|
562
567
|
const Z = _.date || _.author;
|
|
563
568
|
return /* @__PURE__ */ d(z, { children: [
|
|
564
569
|
/* @__PURE__ */ e(
|
|
565
570
|
"h1",
|
|
566
571
|
{
|
|
567
|
-
id:
|
|
572
|
+
id: I,
|
|
568
573
|
className: F && Z ? M.withMetadata : void 0,
|
|
569
574
|
children: /* @__PURE__ */ e(
|
|
570
575
|
"a",
|
|
571
576
|
{
|
|
572
|
-
href:
|
|
577
|
+
href: R,
|
|
573
578
|
style: { color: "inherit", textDecoration: "none" },
|
|
574
|
-
children:
|
|
579
|
+
children: h
|
|
575
580
|
}
|
|
576
581
|
)
|
|
577
582
|
}
|
|
@@ -579,81 +584,81 @@ function Ot({ language: t }) {
|
|
|
579
584
|
F && Z && /* @__PURE__ */ e(xe, {})
|
|
580
585
|
] });
|
|
581
586
|
},
|
|
582
|
-
h2: ({ children:
|
|
583
|
-
const
|
|
584
|
-
return /* @__PURE__ */ e("h2", { id:
|
|
587
|
+
h2: ({ children: h }) => {
|
|
588
|
+
const N = B.current++, x = Q.current[N] || "", I = V(x), T = A ? `?advanced&a=${I}` : `?a=${I}`, R = `#/${t}/${n}${T}`;
|
|
589
|
+
return /* @__PURE__ */ e("h2", { id: I, children: /* @__PURE__ */ e(
|
|
585
590
|
"a",
|
|
586
591
|
{
|
|
587
|
-
href:
|
|
592
|
+
href: R,
|
|
588
593
|
style: { color: "inherit", textDecoration: "none" },
|
|
589
|
-
children:
|
|
594
|
+
children: h
|
|
590
595
|
}
|
|
591
596
|
) });
|
|
592
597
|
},
|
|
593
|
-
h3: ({ children:
|
|
594
|
-
const
|
|
595
|
-
return /* @__PURE__ */ e("h3", { id:
|
|
598
|
+
h3: ({ children: h }) => {
|
|
599
|
+
const N = B.current++, x = Q.current[N] || "", I = V(x), T = A ? `?advanced&a=${I}` : `?a=${I}`, R = `#/${t}/${n}${T}`;
|
|
600
|
+
return /* @__PURE__ */ e("h3", { id: I, children: /* @__PURE__ */ e(
|
|
596
601
|
"a",
|
|
597
602
|
{
|
|
598
|
-
href:
|
|
603
|
+
href: R,
|
|
599
604
|
style: { color: "inherit", textDecoration: "none" },
|
|
600
|
-
children:
|
|
605
|
+
children: h
|
|
601
606
|
}
|
|
602
607
|
) });
|
|
603
608
|
},
|
|
604
|
-
h4: ({ children:
|
|
605
|
-
const
|
|
606
|
-
return /* @__PURE__ */ e("h4", { id:
|
|
609
|
+
h4: ({ children: h }) => {
|
|
610
|
+
const N = B.current++, x = Q.current[N] || "", I = V(x), T = A ? `?advanced&a=${I}` : `?a=${I}`, R = `#/${t}/${n}${T}`;
|
|
611
|
+
return /* @__PURE__ */ e("h4", { id: I, children: /* @__PURE__ */ e(
|
|
607
612
|
"a",
|
|
608
613
|
{
|
|
609
|
-
href:
|
|
614
|
+
href: R,
|
|
610
615
|
style: { color: "inherit", textDecoration: "none" },
|
|
611
|
-
children:
|
|
616
|
+
children: h
|
|
612
617
|
}
|
|
613
618
|
) });
|
|
614
619
|
},
|
|
615
|
-
h5: ({ children:
|
|
616
|
-
const
|
|
617
|
-
return /* @__PURE__ */ e("h5", { id:
|
|
620
|
+
h5: ({ children: h }) => {
|
|
621
|
+
const N = `h5-${B.current++}`;
|
|
622
|
+
return /* @__PURE__ */ e("h5", { id: N, children: h });
|
|
618
623
|
},
|
|
619
|
-
h6: ({ children:
|
|
620
|
-
const
|
|
621
|
-
return /* @__PURE__ */ e("h6", { id:
|
|
624
|
+
h6: ({ children: h }) => {
|
|
625
|
+
const N = `h6-${B.current++}`;
|
|
626
|
+
return /* @__PURE__ */ e("h6", { id: N, children: h });
|
|
622
627
|
},
|
|
623
|
-
p: ({ children:
|
|
624
|
-
ul: ({ children:
|
|
625
|
-
ol: ({ children:
|
|
626
|
-
li: ({ children:
|
|
627
|
-
code: ({ className:
|
|
628
|
-
if (!
|
|
629
|
-
return /* @__PURE__ */ e("code", { ...x, children:
|
|
630
|
-
const T = (
|
|
628
|
+
p: ({ children: h }) => /* @__PURE__ */ e("p", { children: h }),
|
|
629
|
+
ul: ({ children: h }) => /* @__PURE__ */ e("ul", { children: h }),
|
|
630
|
+
ol: ({ children: h }) => /* @__PURE__ */ e("ol", { children: h }),
|
|
631
|
+
li: ({ children: h }) => /* @__PURE__ */ e("li", { children: h }),
|
|
632
|
+
code: ({ className: h, children: N, ...x }) => {
|
|
633
|
+
if (!h)
|
|
634
|
+
return /* @__PURE__ */ e("code", { ...x, children: N });
|
|
635
|
+
const T = (h == null ? void 0 : h.replace("language-", "")) || "";
|
|
631
636
|
return /* @__PURE__ */ d("div", { className: M.codeBlock, children: [
|
|
632
637
|
T && /* @__PURE__ */ e("div", { className: M.codeLanguage, children: T }),
|
|
633
|
-
/* @__PURE__ */ e("pre", { children: /* @__PURE__ */ e("code", { className:
|
|
638
|
+
/* @__PURE__ */ e("pre", { children: /* @__PURE__ */ e("code", { className: h, ...x, children: N }) })
|
|
634
639
|
] });
|
|
635
640
|
},
|
|
636
|
-
pre: ({ children:
|
|
641
|
+
pre: ({ children: h }) => /* @__PURE__ */ e(z, { children: h }),
|
|
637
642
|
// Let code component handle pre styling
|
|
638
|
-
blockquote: ({ children:
|
|
639
|
-
a: ({ href:
|
|
640
|
-
if (
|
|
641
|
-
const
|
|
642
|
-
return /* @__PURE__ */ e("a", { href: T, ...x, children:
|
|
643
|
+
blockquote: ({ children: h }) => /* @__PURE__ */ e("blockquote", { children: h }),
|
|
644
|
+
a: ({ href: h, children: N, ...x }) => {
|
|
645
|
+
if (h != null && h.startsWith("./")) {
|
|
646
|
+
const I = h.slice(2), T = `#/${t}/${I}`;
|
|
647
|
+
return /* @__PURE__ */ e("a", { href: T, ...x, children: N });
|
|
643
648
|
}
|
|
644
|
-
return
|
|
649
|
+
return h != null && h.startsWith("http://") || h != null && h.startsWith("https://") ? /* @__PURE__ */ e(
|
|
645
650
|
"a",
|
|
646
651
|
{
|
|
647
|
-
href:
|
|
652
|
+
href: h,
|
|
648
653
|
target: "_blank",
|
|
649
654
|
rel: "noopener noreferrer",
|
|
650
655
|
...x,
|
|
651
|
-
children:
|
|
656
|
+
children: N
|
|
652
657
|
}
|
|
653
|
-
) : /* @__PURE__ */ e("a", { href:
|
|
658
|
+
) : /* @__PURE__ */ e("a", { href: h, ...x, children: N });
|
|
654
659
|
},
|
|
655
|
-
strong: ({ children:
|
|
656
|
-
em: ({ children:
|
|
660
|
+
strong: ({ children: h }) => /* @__PURE__ */ e("strong", { children: h }),
|
|
661
|
+
em: ({ children: h }) => /* @__PURE__ */ e("em", { children: h })
|
|
657
662
|
},
|
|
658
663
|
children: g
|
|
659
664
|
}
|
|
@@ -663,23 +668,23 @@ function Ot({ language: t }) {
|
|
|
663
668
|
{
|
|
664
669
|
tags: _.tags,
|
|
665
670
|
variant: "compact",
|
|
666
|
-
onTagClick: (
|
|
671
|
+
onTagClick: (h) => $(h)
|
|
667
672
|
}
|
|
668
673
|
)
|
|
669
674
|
] }),
|
|
670
|
-
C && /* @__PURE__ */ e(nt, { content: g, englishContent:
|
|
671
|
-
|
|
672
|
-
|
|
675
|
+
C && /* @__PURE__ */ e(nt, { content: g, englishContent: p }),
|
|
676
|
+
m && ((ie = c.tagIndex) == null ? void 0 : ie[t]) && /* @__PURE__ */ e(
|
|
677
|
+
gt,
|
|
673
678
|
{
|
|
674
|
-
tag:
|
|
675
|
-
results:
|
|
679
|
+
tag: m,
|
|
680
|
+
results: c.tagIndex[t][m] || [],
|
|
676
681
|
language: t,
|
|
677
|
-
onClose: () =>
|
|
682
|
+
onClose: () => $(null)
|
|
678
683
|
}
|
|
679
684
|
)
|
|
680
685
|
] });
|
|
681
686
|
}
|
|
682
|
-
const Rt = "_searchButton_1k9sl_1", jt = "_searchIcon_1k9sl_17", At = "_searchHint_1k9sl_23", Ht = "_kbd_1k9sl_27", qt = "_searchOverlay_1k9sl_42", Wt = "_searchModal_1k9sl_67", Ft = "_searchHeader_1k9sl_91", Kt = "_searchInput_1k9sl_105", zt = "_closeButton_1k9sl_123", Ut = "_searchResults_1k9sl_144", Gt = "_resultsList_1k9sl_152", Qt = "_resultItem_1k9sl_158", Xt = "_selected_1k9sl_173", Yt = "_resultTitle_1k9sl_176", Vt = "_resultSlug_1k9sl_180", Jt = "_noResults_1k9sl_186", Zt = "_searchHints_1k9sl_193", en = "_hint_1k9sl_210",
|
|
687
|
+
const Rt = "_searchButton_1k9sl_1", jt = "_searchIcon_1k9sl_17", At = "_searchHint_1k9sl_23", Ht = "_kbd_1k9sl_27", qt = "_searchOverlay_1k9sl_42", Wt = "_searchModal_1k9sl_67", Ft = "_searchHeader_1k9sl_91", Kt = "_searchInput_1k9sl_105", zt = "_closeButton_1k9sl_123", Ut = "_searchResults_1k9sl_144", Gt = "_resultsList_1k9sl_152", Qt = "_resultItem_1k9sl_158", Xt = "_selected_1k9sl_173", Yt = "_resultTitle_1k9sl_176", Vt = "_resultSlug_1k9sl_180", Jt = "_noResults_1k9sl_186", Zt = "_searchHints_1k9sl_193", en = "_hint_1k9sl_210", y = {
|
|
683
688
|
searchButton: Rt,
|
|
684
689
|
searchIcon: jt,
|
|
685
690
|
searchHint: At,
|
|
@@ -700,102 +705,102 @@ const Rt = "_searchButton_1k9sl_1", jt = "_searchIcon_1k9sl_17", At = "_searchHi
|
|
|
700
705
|
hint: en
|
|
701
706
|
};
|
|
702
707
|
function tn({ language: t }) {
|
|
703
|
-
const { t: n } =
|
|
708
|
+
const { t: n } = O(), { config: a } = j(), s = G(), [c, o] = L(!1), [l, g] = L(""), [u, p] = L([]), [w, _] = L(0), v = W(null), r = W(null), i = typeof navigator < "u" && /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform) ? "⌘K" : "Ctrl+K", b = te(
|
|
704
709
|
a.navigationData,
|
|
705
710
|
t
|
|
706
|
-
).flatMap((
|
|
707
|
-
title:
|
|
708
|
-
slug:
|
|
709
|
-
})) : [{ title:
|
|
711
|
+
).flatMap((m) => "items" in m ? m.items.map(($) => ({
|
|
712
|
+
title: $.title,
|
|
713
|
+
slug: $.slug
|
|
714
|
+
})) : [{ title: m.title, slug: m.slug }]);
|
|
710
715
|
P(() => {
|
|
711
|
-
if (!
|
|
712
|
-
|
|
716
|
+
if (!l.trim()) {
|
|
717
|
+
p([]), _(0);
|
|
713
718
|
return;
|
|
714
719
|
}
|
|
715
|
-
const
|
|
716
|
-
(B) => B.title.toLowerCase().includes(
|
|
720
|
+
const m = l.toLowerCase(), $ = b.filter(
|
|
721
|
+
(B) => B.title.toLowerCase().includes(m) || B.slug.toLowerCase().includes(m)
|
|
717
722
|
);
|
|
718
|
-
|
|
719
|
-
}, [
|
|
720
|
-
const
|
|
721
|
-
(
|
|
723
|
+
p($), _(0);
|
|
724
|
+
}, [l]), P(() => {
|
|
725
|
+
const m = ($) => {
|
|
726
|
+
($.metaKey || $.ctrlKey) && $.key === "k" && ($.preventDefault(), o(!0), setTimeout(() => {
|
|
722
727
|
var B;
|
|
723
728
|
return (B = v.current) == null ? void 0 : B.focus();
|
|
724
|
-
}, 100)),
|
|
729
|
+
}, 100)), $.key === "Escape" && c && (o(!1), g(""));
|
|
725
730
|
};
|
|
726
|
-
return document.addEventListener("keydown",
|
|
727
|
-
}, [
|
|
728
|
-
const
|
|
731
|
+
return document.addEventListener("keydown", m), () => document.removeEventListener("keydown", m);
|
|
732
|
+
}, [c]), P(() => {
|
|
733
|
+
const m = () => {
|
|
729
734
|
o(!0), setTimeout(() => {
|
|
730
735
|
var B;
|
|
731
736
|
return (B = v.current) == null ? void 0 : B.focus();
|
|
732
737
|
}, 100);
|
|
733
|
-
},
|
|
738
|
+
}, $ = () => {
|
|
734
739
|
o(!1), g("");
|
|
735
740
|
};
|
|
736
|
-
return window.addEventListener("blog:open-search",
|
|
737
|
-
window.removeEventListener("blog:open-search",
|
|
741
|
+
return window.addEventListener("blog:open-search", m), window.addEventListener("blog:close-search", $), () => {
|
|
742
|
+
window.removeEventListener("blog:open-search", m), window.removeEventListener("blog:close-search", $);
|
|
738
743
|
};
|
|
739
744
|
}, []);
|
|
740
|
-
const C = (
|
|
741
|
-
|
|
745
|
+
const C = (m) => {
|
|
746
|
+
m.key === "ArrowDown" ? (m.preventDefault(), _(($) => Math.min($ + 1, u.length - 1))) : m.key === "ArrowUp" ? (m.preventDefault(), _(($) => Math.max($ - 1, 0))) : m.key === "Enter" && u[w] && (m.preventDefault(), S(u[w].slug));
|
|
742
747
|
};
|
|
743
748
|
P(() => {
|
|
744
|
-
const
|
|
745
|
-
r.current && !r.current.contains(
|
|
749
|
+
const m = ($) => {
|
|
750
|
+
r.current && !r.current.contains($.target) && (o(!1), g(""));
|
|
746
751
|
};
|
|
747
|
-
return
|
|
748
|
-
}, [
|
|
749
|
-
const
|
|
750
|
-
const
|
|
751
|
-
s(`${
|
|
752
|
+
return c && document.addEventListener("mousedown", m), () => document.removeEventListener("mousedown", m);
|
|
753
|
+
}, [c]);
|
|
754
|
+
const S = (m) => {
|
|
755
|
+
const $ = a.basePath || "";
|
|
756
|
+
s(`${$}/${t}/${m}`), o(!1), g("");
|
|
752
757
|
};
|
|
753
758
|
return /* @__PURE__ */ d(z, { children: [
|
|
754
759
|
/* @__PURE__ */ d(
|
|
755
760
|
"button",
|
|
756
761
|
{
|
|
757
762
|
type: "button",
|
|
758
|
-
className:
|
|
763
|
+
className: y.searchButton,
|
|
759
764
|
onClick: () => {
|
|
760
765
|
o(!0), setTimeout(() => {
|
|
761
|
-
var
|
|
762
|
-
return (
|
|
766
|
+
var m;
|
|
767
|
+
return (m = v.current) == null ? void 0 : m.focus();
|
|
763
768
|
}, 100);
|
|
764
769
|
},
|
|
765
770
|
"aria-label": n("ui.search"),
|
|
766
771
|
children: [
|
|
767
|
-
/* @__PURE__ */ e(he, { className:
|
|
768
|
-
/* @__PURE__ */ e("span", { className:
|
|
769
|
-
/* @__PURE__ */ e("kbd", { className:
|
|
772
|
+
/* @__PURE__ */ e(he, { className: y.searchIcon }),
|
|
773
|
+
/* @__PURE__ */ e("span", { className: y.searchHint, children: n("ui.search") }),
|
|
774
|
+
/* @__PURE__ */ e("kbd", { className: y.kbd, children: i })
|
|
770
775
|
]
|
|
771
776
|
}
|
|
772
777
|
),
|
|
773
|
-
|
|
778
|
+
c && ve(
|
|
774
779
|
/* @__PURE__ */ e(
|
|
775
780
|
"div",
|
|
776
781
|
{
|
|
777
|
-
className:
|
|
782
|
+
className: y.searchOverlay,
|
|
778
783
|
onClick: () => {
|
|
779
784
|
o(!1), g("");
|
|
780
785
|
},
|
|
781
786
|
children: /* @__PURE__ */ d(
|
|
782
787
|
"div",
|
|
783
788
|
{
|
|
784
|
-
className:
|
|
789
|
+
className: y.searchModal,
|
|
785
790
|
ref: r,
|
|
786
|
-
onClick: (
|
|
791
|
+
onClick: (m) => m.stopPropagation(),
|
|
787
792
|
children: [
|
|
788
|
-
/* @__PURE__ */ d("div", { className:
|
|
789
|
-
/* @__PURE__ */ e(he, { className:
|
|
793
|
+
/* @__PURE__ */ d("div", { className: y.searchHeader, children: [
|
|
794
|
+
/* @__PURE__ */ e(he, { className: y.searchIcon }),
|
|
790
795
|
/* @__PURE__ */ e(
|
|
791
796
|
"input",
|
|
792
797
|
{
|
|
793
798
|
ref: v,
|
|
794
799
|
type: "text",
|
|
795
|
-
className:
|
|
800
|
+
className: y.searchInput,
|
|
796
801
|
placeholder: n("ui.searchPlaceholder"),
|
|
797
|
-
value:
|
|
798
|
-
onChange: (
|
|
802
|
+
value: l,
|
|
803
|
+
onChange: (m) => g(m.target.value),
|
|
799
804
|
onKeyDown: C
|
|
800
805
|
}
|
|
801
806
|
),
|
|
@@ -803,7 +808,7 @@ function tn({ language: t }) {
|
|
|
803
808
|
"button",
|
|
804
809
|
{
|
|
805
810
|
type: "button",
|
|
806
|
-
className:
|
|
811
|
+
className: y.closeButton,
|
|
807
812
|
onClick: () => {
|
|
808
813
|
o(!1), g("");
|
|
809
814
|
},
|
|
@@ -812,33 +817,33 @@ function tn({ language: t }) {
|
|
|
812
817
|
}
|
|
813
818
|
)
|
|
814
819
|
] }),
|
|
815
|
-
|
|
820
|
+
l && /* @__PURE__ */ e("div", { className: y.searchResults, children: u.length === 0 ? /* @__PURE__ */ e("div", { className: y.noResults, children: n("ui.noSearchResults") }) : /* @__PURE__ */ e("ul", { className: y.resultsList, children: u.map((m, $) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ d(
|
|
816
821
|
"button",
|
|
817
822
|
{
|
|
818
823
|
type: "button",
|
|
819
|
-
className: `${
|
|
820
|
-
onClick: () =>
|
|
821
|
-
onMouseEnter: () => _(
|
|
824
|
+
className: `${y.resultItem} ${$ === w ? y.selected : ""}`,
|
|
825
|
+
onClick: () => S(m.slug),
|
|
826
|
+
onMouseEnter: () => _($),
|
|
822
827
|
children: [
|
|
823
|
-
/* @__PURE__ */ e("div", { className:
|
|
824
|
-
/* @__PURE__ */ d("div", { className:
|
|
828
|
+
/* @__PURE__ */ e("div", { className: y.resultTitle, children: m.title }),
|
|
829
|
+
/* @__PURE__ */ d("div", { className: y.resultSlug, children: [
|
|
825
830
|
"/",
|
|
826
|
-
|
|
831
|
+
m.slug
|
|
827
832
|
] })
|
|
828
833
|
]
|
|
829
834
|
}
|
|
830
|
-
) },
|
|
831
|
-
!
|
|
832
|
-
/* @__PURE__ */ d("div", { className:
|
|
835
|
+
) }, m.slug)) }) }),
|
|
836
|
+
!l && /* @__PURE__ */ d("div", { className: y.searchHints, children: [
|
|
837
|
+
/* @__PURE__ */ d("div", { className: y.hint, children: [
|
|
833
838
|
/* @__PURE__ */ e("kbd", { children: "↑" }),
|
|
834
839
|
/* @__PURE__ */ e("kbd", { children: "↓" }),
|
|
835
840
|
/* @__PURE__ */ e("span", { children: n("ui.searchNavigate") })
|
|
836
841
|
] }),
|
|
837
|
-
/* @__PURE__ */ d("div", { className:
|
|
842
|
+
/* @__PURE__ */ d("div", { className: y.hint, children: [
|
|
838
843
|
/* @__PURE__ */ e("kbd", { children: "↵" }),
|
|
839
844
|
/* @__PURE__ */ e("span", { children: n("ui.searchSelect") })
|
|
840
845
|
] }),
|
|
841
|
-
/* @__PURE__ */ d("div", { className:
|
|
846
|
+
/* @__PURE__ */ d("div", { className: y.hint, children: [
|
|
842
847
|
/* @__PURE__ */ e("kbd", { children: "esc" }),
|
|
843
848
|
/* @__PURE__ */ e("span", { children: n("ui.searchClose") })
|
|
844
849
|
] })
|
|
@@ -852,7 +857,7 @@ function tn({ language: t }) {
|
|
|
852
857
|
)
|
|
853
858
|
] });
|
|
854
859
|
}
|
|
855
|
-
const nn = "_header_jrobc_1", on = "_container_jrobc_24", an = "_content_jrobc_36", sn = "_leftSection_jrobc_43", cn = "_mobileMenuButton_jrobc_49", rn = "_burgerIcon_jrobc_87", ln = "_logo_jrobc_92", dn = "_nav_jrobc_98", un = "_navLink_jrobc_109", hn = "_externalIcon_jrobc_135", mn = "_supportDropdown_jrobc_141",
|
|
860
|
+
const nn = "_header_jrobc_1", on = "_container_jrobc_24", an = "_content_jrobc_36", sn = "_leftSection_jrobc_43", cn = "_mobileMenuButton_jrobc_49", rn = "_burgerIcon_jrobc_87", ln = "_logo_jrobc_92", dn = "_nav_jrobc_98", un = "_navLink_jrobc_109", hn = "_externalIcon_jrobc_135", mn = "_supportDropdown_jrobc_141", gn = "_themeDropdown_jrobc_145", _n = "_themeButton_jrobc_149", pn = "_themeIcon_jrobc_171", fn = "_supportButton_jrobc_177", vn = "_caretIcon_jrobc_198", bn = "_dropdownMenu_jrobc_208", wn = "_dropdownItem_jrobc_221", $n = "_dropdownIcon_jrobc_244", k = {
|
|
856
861
|
header: nn,
|
|
857
862
|
container: on,
|
|
858
863
|
content: an,
|
|
@@ -864,20 +869,20 @@ const nn = "_header_jrobc_1", on = "_container_jrobc_24", an = "_content_jrobc_3
|
|
|
864
869
|
navLink: un,
|
|
865
870
|
externalIcon: hn,
|
|
866
871
|
supportDropdown: mn,
|
|
867
|
-
themeDropdown:
|
|
868
|
-
themeButton:
|
|
872
|
+
themeDropdown: gn,
|
|
873
|
+
themeButton: _n,
|
|
869
874
|
themeIcon: pn,
|
|
870
|
-
supportButton:
|
|
871
|
-
caretIcon:
|
|
875
|
+
supportButton: fn,
|
|
876
|
+
caretIcon: vn,
|
|
872
877
|
dropdownMenu: bn,
|
|
873
878
|
dropdownItem: wn,
|
|
874
879
|
dropdownIcon: $n
|
|
875
880
|
};
|
|
876
881
|
function Nn({ onMobileMenuToggle: t }) {
|
|
877
|
-
const { t: n, i18n: a } =
|
|
882
|
+
const { t: n, i18n: a } = O(), { config: s } = j(), c = s.header ?? {}, o = c.navLinks ?? [], l = c.dropdownItems ?? [], [g, u] = L(!1), [p, w] = L(!1), { theme: _, setTheme: v } = Ne(), r = W(null), f = W(null);
|
|
878
883
|
return P(() => {
|
|
879
884
|
const i = (b) => {
|
|
880
|
-
r.current && !r.current.contains(b.target) &&
|
|
885
|
+
r.current && !r.current.contains(b.target) && u(!1), f.current && !f.current.contains(b.target) && w(!1);
|
|
881
886
|
};
|
|
882
887
|
return document.addEventListener("mousedown", i), () => document.removeEventListener("mousedown", i);
|
|
883
888
|
}, []), /* @__PURE__ */ e("header", { className: k.header, children: /* @__PURE__ */ e("div", { className: k.container, children: /* @__PURE__ */ d("div", { className: k.content, children: [
|
|
@@ -889,38 +894,38 @@ function Nn({ onMobileMenuToggle: t }) {
|
|
|
889
894
|
className: k.mobileMenuButton,
|
|
890
895
|
onClick: t,
|
|
891
896
|
"aria-label": "Open menu",
|
|
892
|
-
children: /* @__PURE__ */ e(
|
|
897
|
+
children: /* @__PURE__ */ e(ye, { className: k.burgerIcon })
|
|
893
898
|
}
|
|
894
899
|
),
|
|
895
900
|
/* @__PURE__ */ e("div", { className: k.logo })
|
|
896
901
|
] }),
|
|
897
902
|
/* @__PURE__ */ d("nav", { className: k.nav, children: [
|
|
898
903
|
/* @__PURE__ */ e(tn, { language: a.language }),
|
|
899
|
-
/* @__PURE__ */ d("div", { className: k.themeDropdown, ref:
|
|
904
|
+
/* @__PURE__ */ d("div", { className: k.themeDropdown, ref: f, children: [
|
|
900
905
|
/* @__PURE__ */ d(
|
|
901
906
|
"button",
|
|
902
907
|
{
|
|
903
908
|
type: "button",
|
|
904
909
|
className: k.themeButton,
|
|
905
|
-
onClick: () =>
|
|
906
|
-
"aria-expanded":
|
|
910
|
+
onClick: () => w(!p),
|
|
911
|
+
"aria-expanded": p,
|
|
907
912
|
"aria-haspopup": "true",
|
|
908
913
|
"aria-label": n("ui.theme"),
|
|
909
914
|
children: [
|
|
910
915
|
_ === "light" && /* @__PURE__ */ e(me, { className: k.themeIcon }),
|
|
911
|
-
_ === "dark" && /* @__PURE__ */ e(
|
|
912
|
-
_ === "system" && /* @__PURE__ */ e(
|
|
916
|
+
_ === "dark" && /* @__PURE__ */ e(ge, { className: k.themeIcon }),
|
|
917
|
+
_ === "system" && /* @__PURE__ */ e(_e, { className: k.themeIcon }),
|
|
913
918
|
/* @__PURE__ */ e(oe, { className: k.caretIcon })
|
|
914
919
|
]
|
|
915
920
|
}
|
|
916
921
|
),
|
|
917
|
-
|
|
922
|
+
p && /* @__PURE__ */ d("div", { className: k.dropdownMenu, children: [
|
|
918
923
|
/* @__PURE__ */ d(
|
|
919
924
|
"button",
|
|
920
925
|
{
|
|
921
926
|
type: "button",
|
|
922
927
|
onClick: () => {
|
|
923
|
-
v("light"),
|
|
928
|
+
v("light"), w(!1);
|
|
924
929
|
},
|
|
925
930
|
className: k.dropdownItem,
|
|
926
931
|
children: [
|
|
@@ -934,11 +939,11 @@ function Nn({ onMobileMenuToggle: t }) {
|
|
|
934
939
|
{
|
|
935
940
|
type: "button",
|
|
936
941
|
onClick: () => {
|
|
937
|
-
v("dark"),
|
|
942
|
+
v("dark"), w(!1);
|
|
938
943
|
},
|
|
939
944
|
className: k.dropdownItem,
|
|
940
945
|
children: [
|
|
941
|
-
/* @__PURE__ */ e(
|
|
946
|
+
/* @__PURE__ */ e(ge, { className: k.dropdownIcon }),
|
|
942
947
|
n("ui.dark")
|
|
943
948
|
]
|
|
944
949
|
}
|
|
@@ -948,24 +953,24 @@ function Nn({ onMobileMenuToggle: t }) {
|
|
|
948
953
|
{
|
|
949
954
|
type: "button",
|
|
950
955
|
onClick: () => {
|
|
951
|
-
v("system"),
|
|
956
|
+
v("system"), w(!1);
|
|
952
957
|
},
|
|
953
958
|
className: k.dropdownItem,
|
|
954
959
|
children: [
|
|
955
|
-
/* @__PURE__ */ e(
|
|
960
|
+
/* @__PURE__ */ e(_e, { className: k.dropdownIcon }),
|
|
956
961
|
n("ui.system")
|
|
957
962
|
]
|
|
958
963
|
}
|
|
959
964
|
)
|
|
960
965
|
] })
|
|
961
966
|
] }),
|
|
962
|
-
|
|
967
|
+
l.length > 0 && /* @__PURE__ */ d("div", { className: k.supportDropdown, ref: r, children: [
|
|
963
968
|
/* @__PURE__ */ d(
|
|
964
969
|
"button",
|
|
965
970
|
{
|
|
966
971
|
type: "button",
|
|
967
972
|
className: k.supportButton,
|
|
968
|
-
onClick: () =>
|
|
973
|
+
onClick: () => u(!g),
|
|
969
974
|
"aria-expanded": g,
|
|
970
975
|
"aria-haspopup": "true",
|
|
971
976
|
children: [
|
|
@@ -974,17 +979,17 @@ function Nn({ onMobileMenuToggle: t }) {
|
|
|
974
979
|
]
|
|
975
980
|
}
|
|
976
981
|
),
|
|
977
|
-
g && /* @__PURE__ */ e("div", { className: k.dropdownMenu, children:
|
|
978
|
-
const C = i.target ?? (i.url.startsWith("http") ? "_blank" : "_self"),
|
|
982
|
+
g && /* @__PURE__ */ e("div", { className: k.dropdownMenu, children: l.map((i, b) => {
|
|
983
|
+
const C = i.target ?? (i.url.startsWith("http") ? "_blank" : "_self"), S = i.rel ?? (C === "_blank" ? "noopener noreferrer" : void 0), m = i.icon;
|
|
979
984
|
return /* @__PURE__ */ d(
|
|
980
985
|
"a",
|
|
981
986
|
{
|
|
982
987
|
href: i.url,
|
|
983
988
|
target: C,
|
|
984
|
-
rel:
|
|
989
|
+
rel: S,
|
|
985
990
|
className: k.dropdownItem,
|
|
986
991
|
children: [
|
|
987
|
-
|
|
992
|
+
m && /* @__PURE__ */ e(m, { className: k.dropdownIcon }),
|
|
988
993
|
i.label
|
|
989
994
|
]
|
|
990
995
|
},
|
|
@@ -993,17 +998,17 @@ function Nn({ onMobileMenuToggle: t }) {
|
|
|
993
998
|
}) })
|
|
994
999
|
] }),
|
|
995
1000
|
o.map((i, b) => {
|
|
996
|
-
const C = i.target ?? (typeof i.url == "string" && i.url.startsWith("http") ? "_blank" : "_self"),
|
|
1001
|
+
const C = i.target ?? (typeof i.url == "string" && i.url.startsWith("http") ? "_blank" : "_self"), S = i.rel ?? (C === "_blank" ? "noopener noreferrer" : void 0), m = i.icon;
|
|
997
1002
|
return /* @__PURE__ */ d(
|
|
998
1003
|
"a",
|
|
999
1004
|
{
|
|
1000
1005
|
href: i.url,
|
|
1001
1006
|
target: C,
|
|
1002
|
-
rel:
|
|
1007
|
+
rel: S,
|
|
1003
1008
|
className: i.className ?? k.navLink,
|
|
1004
1009
|
children: [
|
|
1005
1010
|
i.label,
|
|
1006
|
-
|
|
1011
|
+
m && /* @__PURE__ */ e(m, { className: k.externalIcon })
|
|
1007
1012
|
]
|
|
1008
1013
|
},
|
|
1009
1014
|
b
|
|
@@ -1012,52 +1017,52 @@ function Nn({ onMobileMenuToggle: t }) {
|
|
|
1012
1017
|
] })
|
|
1013
1018
|
] }) }) });
|
|
1014
1019
|
}
|
|
1015
|
-
const
|
|
1020
|
+
const Y = (t) => "items" in t;
|
|
1016
1021
|
function ce({
|
|
1017
1022
|
styles: t,
|
|
1018
1023
|
onLanguageChange: n
|
|
1019
1024
|
}) {
|
|
1020
|
-
const { i18n: a } =
|
|
1025
|
+
const { i18n: a } = O(), s = U(), c = G(), { config: o } = j(), [l, g] = L(!1), u = W(null), p = a.language, w = (v) => {
|
|
1021
1026
|
const r = o.basePath || "";
|
|
1022
|
-
let
|
|
1023
|
-
r &&
|
|
1024
|
-
const i =
|
|
1027
|
+
let f = s.pathname;
|
|
1028
|
+
r && f.startsWith(r) && (f = f.slice(r.length));
|
|
1029
|
+
const i = f.split("/").filter(Boolean), b = i[0];
|
|
1025
1030
|
let C = "";
|
|
1026
|
-
o.supportedLanguages.includes(b) ? (i[0] = v, C = `${r}/${i.join("/")}`) : C = `${r}/${v}${
|
|
1027
|
-
const
|
|
1028
|
-
a.changeLanguage(v),
|
|
1031
|
+
o.supportedLanguages.includes(b) ? (i[0] = v, C = `${r}/${i.join("/")}`) : C = `${r}/${v}${f}`;
|
|
1032
|
+
const S = C + s.search + s.hash;
|
|
1033
|
+
a.changeLanguage(v), c(S), g(!1), n == null || n();
|
|
1029
1034
|
};
|
|
1030
1035
|
P(() => {
|
|
1031
1036
|
const v = (r) => {
|
|
1032
|
-
|
|
1037
|
+
u.current && !u.current.contains(r.target) && g(!1);
|
|
1033
1038
|
};
|
|
1034
1039
|
return document.addEventListener("mousedown", v), () => document.removeEventListener("mousedown", v);
|
|
1035
1040
|
}, []);
|
|
1036
1041
|
const _ = (v) => a.getFixedT(v)("language") || v;
|
|
1037
|
-
return /* @__PURE__ */ d("div", { className: t.languageSelect, ref:
|
|
1042
|
+
return /* @__PURE__ */ d("div", { className: t.languageSelect, ref: u, children: [
|
|
1038
1043
|
/* @__PURE__ */ d(
|
|
1039
1044
|
"button",
|
|
1040
1045
|
{
|
|
1041
1046
|
type: "button",
|
|
1042
1047
|
className: t.languageButton,
|
|
1043
|
-
onClick: () => g(!
|
|
1044
|
-
"aria-expanded":
|
|
1048
|
+
onClick: () => g(!l),
|
|
1049
|
+
"aria-expanded": l,
|
|
1045
1050
|
"aria-haspopup": "listbox",
|
|
1046
1051
|
children: [
|
|
1047
1052
|
/* @__PURE__ */ e(Le, { className: t.icon }),
|
|
1048
|
-
_(
|
|
1053
|
+
_(p),
|
|
1049
1054
|
/* @__PURE__ */ e(oe, { className: t.chevron })
|
|
1050
1055
|
]
|
|
1051
1056
|
}
|
|
1052
1057
|
),
|
|
1053
|
-
|
|
1058
|
+
l && /* @__PURE__ */ e("div", { className: t.languageDropdown, role: "listbox", children: o.supportedLanguages.map((v) => /* @__PURE__ */ e(
|
|
1054
1059
|
"button",
|
|
1055
1060
|
{
|
|
1056
1061
|
type: "button",
|
|
1057
|
-
className: `${t.languageOption} ${v ===
|
|
1058
|
-
onClick: () =>
|
|
1062
|
+
className: `${t.languageOption} ${v === p ? t.selected : ""}`,
|
|
1063
|
+
onClick: () => w(v),
|
|
1059
1064
|
role: "option",
|
|
1060
|
-
"aria-selected": v ===
|
|
1065
|
+
"aria-selected": v === p,
|
|
1061
1066
|
children: _(v)
|
|
1062
1067
|
},
|
|
1063
1068
|
v
|
|
@@ -1065,86 +1070,86 @@ function ce({
|
|
|
1065
1070
|
] });
|
|
1066
1071
|
}
|
|
1067
1072
|
function re({ styles: t, onLinkClick: n }) {
|
|
1068
|
-
const { i18n: a } =
|
|
1073
|
+
const { i18n: a } = O(), s = U(), { config: c } = j(), [o, l] = L(() => {
|
|
1069
1074
|
const r = a.language;
|
|
1070
|
-
return te(
|
|
1075
|
+
return te(c.navigationData, r).reduce(
|
|
1071
1076
|
(i, b, C) => {
|
|
1072
|
-
if (
|
|
1073
|
-
const
|
|
1074
|
-
i[b.title] =
|
|
1077
|
+
if (Y(b)) {
|
|
1078
|
+
const S = c.navigationData[C], m = Y(S) && S.defaultOpen === !0;
|
|
1079
|
+
i[b.title] = m;
|
|
1075
1080
|
}
|
|
1076
1081
|
return i;
|
|
1077
1082
|
},
|
|
1078
1083
|
{}
|
|
1079
1084
|
);
|
|
1080
|
-
}), g = a.language,
|
|
1081
|
-
|
|
1085
|
+
}), g = a.language, u = te(
|
|
1086
|
+
c.navigationData,
|
|
1082
1087
|
g
|
|
1083
1088
|
);
|
|
1084
1089
|
P(() => {
|
|
1085
|
-
const
|
|
1086
|
-
|
|
1090
|
+
const f = te(
|
|
1091
|
+
c.navigationData,
|
|
1087
1092
|
g
|
|
1088
1093
|
).reduce(
|
|
1089
1094
|
(i, b, C) => {
|
|
1090
|
-
if (
|
|
1091
|
-
const
|
|
1092
|
-
i[b.title] =
|
|
1095
|
+
if (Y(b)) {
|
|
1096
|
+
const S = c.navigationData[C], m = Y(S) && S.defaultOpen === !0;
|
|
1097
|
+
i[b.title] = m;
|
|
1093
1098
|
}
|
|
1094
1099
|
return i;
|
|
1095
1100
|
},
|
|
1096
1101
|
{}
|
|
1097
1102
|
);
|
|
1098
|
-
|
|
1099
|
-
}, [g,
|
|
1100
|
-
const
|
|
1101
|
-
|
|
1102
|
-
...
|
|
1103
|
-
[r]: !
|
|
1103
|
+
l(f);
|
|
1104
|
+
}, [g, c.navigationData]);
|
|
1105
|
+
const p = (r) => {
|
|
1106
|
+
l((f) => ({
|
|
1107
|
+
...f,
|
|
1108
|
+
[r]: !f[r]
|
|
1104
1109
|
}));
|
|
1105
|
-
},
|
|
1106
|
-
const
|
|
1110
|
+
}, w = (r) => {
|
|
1111
|
+
const f = c.basePath || "";
|
|
1107
1112
|
let i = s.pathname;
|
|
1108
|
-
|
|
1113
|
+
f && i.startsWith(f) && (i = i.slice(f.length));
|
|
1109
1114
|
const b = i.split("/").filter(Boolean);
|
|
1110
1115
|
return b[b.length - 1] === r;
|
|
1111
1116
|
}, _ = (r) => {
|
|
1112
|
-
const
|
|
1117
|
+
const f = c.basePath || "";
|
|
1113
1118
|
let i = s.pathname;
|
|
1114
|
-
|
|
1119
|
+
f && i.startsWith(f) && (i = i.slice(f.length));
|
|
1115
1120
|
const b = i.split("/").filter(Boolean);
|
|
1116
|
-
return b[0] &&
|
|
1121
|
+
return b[0] && c.supportedLanguages.includes(b[0]) ? `${f}/${b[0]}/${r}` : `${f}/${g}/${r}`;
|
|
1117
1122
|
}, v = () => {
|
|
1118
1123
|
n == null || n();
|
|
1119
1124
|
};
|
|
1120
|
-
return /* @__PURE__ */ e("div", { className: t.navigation, children:
|
|
1125
|
+
return /* @__PURE__ */ e("div", { className: t.navigation, children: u.map((r) => Y(r) ? /* @__PURE__ */ d("div", { className: t.section, children: [
|
|
1121
1126
|
/* @__PURE__ */ d(
|
|
1122
1127
|
"button",
|
|
1123
1128
|
{
|
|
1124
1129
|
type: "button",
|
|
1125
1130
|
className: `${t.sectionButton} ${o[r.title] ? t.expanded : ""}`,
|
|
1126
|
-
onClick: () =>
|
|
1131
|
+
onClick: () => p(r.title),
|
|
1127
1132
|
children: [
|
|
1128
1133
|
r.title,
|
|
1129
1134
|
/* @__PURE__ */ e(Pe, { className: t.icon })
|
|
1130
1135
|
]
|
|
1131
1136
|
}
|
|
1132
1137
|
),
|
|
1133
|
-
o[r.title] && /* @__PURE__ */ e("div", { className: t.sectionItems, children: r.items.map((
|
|
1138
|
+
o[r.title] && /* @__PURE__ */ e("div", { className: t.sectionItems, children: r.items.map((f) => /* @__PURE__ */ e(
|
|
1134
1139
|
de,
|
|
1135
1140
|
{
|
|
1136
|
-
to: _(
|
|
1137
|
-
className: `${t.navItem} ${
|
|
1141
|
+
to: _(f.slug),
|
|
1142
|
+
className: `${t.navItem} ${w(f.slug) ? t.active : ""}`,
|
|
1138
1143
|
onClick: v,
|
|
1139
|
-
children: /* @__PURE__ */ e("div", { className: t.navItemContent, children: /* @__PURE__ */ e("span", { className: t.navItemTitle, children:
|
|
1144
|
+
children: /* @__PURE__ */ e("div", { className: t.navItemContent, children: /* @__PURE__ */ e("span", { className: t.navItemTitle, children: f.title }) })
|
|
1140
1145
|
},
|
|
1141
|
-
|
|
1146
|
+
f.slug
|
|
1142
1147
|
)) })
|
|
1143
1148
|
] }, r.title) : /* @__PURE__ */ e(
|
|
1144
1149
|
de,
|
|
1145
1150
|
{
|
|
1146
1151
|
to: _(r.slug),
|
|
1147
|
-
className: `${t.navItem} ${
|
|
1152
|
+
className: `${t.navItem} ${w(r.slug) ? t.active : ""}`,
|
|
1148
1153
|
onClick: v,
|
|
1149
1154
|
children: /* @__PURE__ */ e("div", { className: t.navItemContent, children: /* @__PURE__ */ e("span", { className: t.navItemTitle, children: r.title }) })
|
|
1150
1155
|
},
|
|
@@ -1161,14 +1166,14 @@ function Ro({
|
|
|
1161
1166
|
/* @__PURE__ */ e(re, { styles: t, onLinkClick: n })
|
|
1162
1167
|
] });
|
|
1163
1168
|
}
|
|
1164
|
-
const In = "_backdrop_1a7pu_1", xn = "_open_1a7pu_13", kn = "_mobileMenu_1a7pu_18", Cn = "_header_1a7pu_37", Tn = "_brand_1a7pu_46",
|
|
1169
|
+
const In = "_backdrop_1a7pu_1", xn = "_open_1a7pu_13", kn = "_mobileMenu_1a7pu_18", Cn = "_header_1a7pu_37", Tn = "_brand_1a7pu_46", Sn = "_cloudIcon_1a7pu_53", yn = "_title_1a7pu_62", Ln = "_closeButton_1a7pu_69", Pn = "_closeIcon_1a7pu_101", Bn = "_languageSection_1a7pu_106", Mn = "_languageSelect_1a7pu_112", Dn = "_languageButton_1a7pu_117", En = "_icon_1a7pu_156", On = "_chevron_1a7pu_162", Rn = "_languageDropdown_1a7pu_172", jn = "_languageOption_1a7pu_185", An = "_selected_1a7pu_226", Hn = "_scrollArea_1a7pu_231", qn = "_navigation_1a7pu_237", Wn = "_section_1a7pu_241", Fn = "_sectionButton_1a7pu_245", Kn = "_expanded_1a7pu_285", zn = "_sectionItems_1a7pu_289", Un = "_navItem_1a7pu_297", Gn = "_active_1a7pu_310", Qn = "_navItemContent_1a7pu_316", Xn = "_navItemTitle_1a7pu_322", D = {
|
|
1165
1170
|
backdrop: In,
|
|
1166
1171
|
open: xn,
|
|
1167
1172
|
mobileMenu: kn,
|
|
1168
1173
|
header: Cn,
|
|
1169
1174
|
brand: Tn,
|
|
1170
|
-
cloudIcon:
|
|
1171
|
-
title:
|
|
1175
|
+
cloudIcon: Sn,
|
|
1176
|
+
title: yn,
|
|
1172
1177
|
closeButton: Ln,
|
|
1173
1178
|
closeIcon: Pn,
|
|
1174
1179
|
languageSection: Bn,
|
|
@@ -1191,14 +1196,14 @@ const In = "_backdrop_1a7pu_1", xn = "_open_1a7pu_13", kn = "_mobileMenu_1a7pu_1
|
|
|
1191
1196
|
navItemTitle: Xn
|
|
1192
1197
|
};
|
|
1193
1198
|
function Yn({ isOpen: t, onClose: n }) {
|
|
1194
|
-
const { config: a } =
|
|
1199
|
+
const { config: a } = j(), s = a.logo;
|
|
1195
1200
|
return P(() => (t ? document.body.style.overflow = "hidden" : document.body.style.overflow = "unset", () => {
|
|
1196
1201
|
document.body.style.overflow = "unset";
|
|
1197
1202
|
}), [t]), P(() => {
|
|
1198
|
-
const
|
|
1203
|
+
const c = (o) => {
|
|
1199
1204
|
o.key === "Escape" && t && n();
|
|
1200
1205
|
};
|
|
1201
|
-
return document.addEventListener("keydown",
|
|
1206
|
+
return document.addEventListener("keydown", c), () => document.removeEventListener("keydown", c);
|
|
1202
1207
|
}, [t, n]), /* @__PURE__ */ d(z, { children: [
|
|
1203
1208
|
/* @__PURE__ */ e(
|
|
1204
1209
|
"div",
|
|
@@ -1229,7 +1234,7 @@ function Yn({ isOpen: t, onClose: n }) {
|
|
|
1229
1234
|
] })
|
|
1230
1235
|
] });
|
|
1231
1236
|
}
|
|
1232
|
-
const Vn = "_sidebar_1tdxt_1", Jn = "_header_1tdxt_17", Zn = "_brand_1tdxt_29", eo = "_cloudIcon_1tdxt_35", to = "_title_1tdxt_44", no = "_languageSelect_1tdxt_55", oo = "_languageButton_1tdxt_61", ao = "_icon_1tdxt_99", so = "_chevron_1tdxt_104", co = "_languageDropdown_1tdxt_114", ro = "_languageOption_1tdxt_128", lo = "_selected_1tdxt_147", io = "_scrollArea_1tdxt_152", uo = "_navigation_1tdxt_158", ho = "_section_1tdxt_164", mo = "_sectionButton_1tdxt_170",
|
|
1237
|
+
const Vn = "_sidebar_1tdxt_1", Jn = "_header_1tdxt_17", Zn = "_brand_1tdxt_29", eo = "_cloudIcon_1tdxt_35", to = "_title_1tdxt_44", no = "_languageSelect_1tdxt_55", oo = "_languageButton_1tdxt_61", ao = "_icon_1tdxt_99", so = "_chevron_1tdxt_104", co = "_languageDropdown_1tdxt_114", ro = "_languageOption_1tdxt_128", lo = "_selected_1tdxt_147", io = "_scrollArea_1tdxt_152", uo = "_navigation_1tdxt_158", ho = "_section_1tdxt_164", mo = "_sectionButton_1tdxt_170", go = "_expanded_1tdxt_213", _o = "_sectionItems_1tdxt_217", po = "_navItem_1tdxt_225", fo = "_active_1tdxt_238", vo = "_navItemContent_1tdxt_243", q = {
|
|
1233
1238
|
sidebar: Vn,
|
|
1234
1239
|
header: Jn,
|
|
1235
1240
|
brand: Zn,
|
|
@@ -1246,21 +1251,21 @@ const Vn = "_sidebar_1tdxt_1", Jn = "_header_1tdxt_17", Zn = "_brand_1tdxt_29",
|
|
|
1246
1251
|
navigation: uo,
|
|
1247
1252
|
section: ho,
|
|
1248
1253
|
sectionButton: mo,
|
|
1249
|
-
expanded:
|
|
1250
|
-
sectionItems:
|
|
1254
|
+
expanded: go,
|
|
1255
|
+
sectionItems: _o,
|
|
1251
1256
|
navItem: po,
|
|
1252
|
-
active:
|
|
1253
|
-
navItemContent:
|
|
1257
|
+
active: fo,
|
|
1258
|
+
navItemContent: vo
|
|
1254
1259
|
};
|
|
1255
1260
|
function bo() {
|
|
1256
|
-
const { config: t } =
|
|
1261
|
+
const { config: t } = j(), n = t.logo, a = t.supportedLanguages.length > 1;
|
|
1257
1262
|
return /* @__PURE__ */ d("div", { className: q.sidebar, children: [
|
|
1258
1263
|
/* @__PURE__ */ d("div", { className: q.header, children: [
|
|
1259
1264
|
/* @__PURE__ */ d("div", { className: q.brand, children: [
|
|
1260
1265
|
n && /* @__PURE__ */ e(n, { className: q.cloudIcon }),
|
|
1261
1266
|
/* @__PURE__ */ e("div", { className: q.title, children: t.title })
|
|
1262
1267
|
] }),
|
|
1263
|
-
/* @__PURE__ */ e(ce, { styles: q })
|
|
1268
|
+
a && /* @__PURE__ */ e(ce, { styles: q })
|
|
1264
1269
|
] }),
|
|
1265
1270
|
/* @__PURE__ */ e("div", { className: q.scrollArea, children: /* @__PURE__ */ e(re, { styles: q }) })
|
|
1266
1271
|
] });
|
|
@@ -1272,23 +1277,23 @@ const wo = "_app_1v4z4_1", $o = "_layout_1v4z4_9", No = "_main_1v4z4_15", Io = "
|
|
|
1272
1277
|
contentWrapper: Io
|
|
1273
1278
|
};
|
|
1274
1279
|
function xo({ children: t }) {
|
|
1275
|
-
const { language: n } = ae(), { i18n: a } =
|
|
1280
|
+
const { language: n } = ae(), { i18n: a } = O(), { config: s } = j(), [c, o] = L(!1);
|
|
1276
1281
|
P(() => {
|
|
1277
1282
|
n && s.supportedLanguages.includes(n) && a.changeLanguage(n);
|
|
1278
1283
|
}, [n, a, s.supportedLanguages]);
|
|
1279
|
-
const
|
|
1280
|
-
o(!
|
|
1284
|
+
const l = () => {
|
|
1285
|
+
o(!c);
|
|
1281
1286
|
}, g = () => {
|
|
1282
1287
|
o(!1);
|
|
1283
1288
|
};
|
|
1284
1289
|
if (!n || !s.supportedLanguages.includes(n))
|
|
1285
|
-
return /* @__PURE__ */ e(
|
|
1286
|
-
const
|
|
1290
|
+
return /* @__PURE__ */ e(fe, { to: "/en/welcome", replace: !0 });
|
|
1291
|
+
const u = !!s.header, p = !!s.navigationData;
|
|
1287
1292
|
return /* @__PURE__ */ d("div", { className: ee.app, children: [
|
|
1288
|
-
|
|
1289
|
-
/* @__PURE__ */ e(Yn, { isOpen:
|
|
1293
|
+
u && /* @__PURE__ */ e(Nn, { onMobileMenuToggle: l }),
|
|
1294
|
+
/* @__PURE__ */ e(Yn, { isOpen: c, onClose: g }),
|
|
1290
1295
|
/* @__PURE__ */ d("div", { className: ee.layout, children: [
|
|
1291
|
-
/* @__PURE__ */ e(bo, {}),
|
|
1296
|
+
p && /* @__PURE__ */ e(bo, {}),
|
|
1292
1297
|
/* @__PURE__ */ e("main", { className: ee.main, children: /* @__PURE__ */ e("div", { className: ee.contentWrapper, children: t }) })
|
|
1293
1298
|
] })
|
|
1294
1299
|
] });
|
|
@@ -1297,7 +1302,7 @@ function jo() {
|
|
|
1297
1302
|
const { language: t } = ae();
|
|
1298
1303
|
return /* @__PURE__ */ e(xo, { children: /* @__PURE__ */ d(ke, { children: [
|
|
1299
1304
|
/* @__PURE__ */ e(ue, { path: "/:slug", element: /* @__PURE__ */ e(Ot, { language: t }) }),
|
|
1300
|
-
/* @__PURE__ */ e(ue, { path: "/", element: /* @__PURE__ */ e(
|
|
1305
|
+
/* @__PURE__ */ e(ue, { path: "/", element: /* @__PURE__ */ e(fe, { to: "welcome", replace: !0 }) })
|
|
1301
1306
|
] }) });
|
|
1302
1307
|
}
|
|
1303
1308
|
function Ao() {
|
|
@@ -1310,6 +1315,19 @@ function Ao() {
|
|
|
1310
1315
|
}
|
|
1311
1316
|
};
|
|
1312
1317
|
}
|
|
1318
|
+
function Ho() {
|
|
1319
|
+
const { i18n: t } = O(), n = U(), a = G(), { config: s } = j();
|
|
1320
|
+
return (c) => {
|
|
1321
|
+
const o = s.basePath || "";
|
|
1322
|
+
let l = n.pathname;
|
|
1323
|
+
o && l.startsWith(o) && (l = l.slice(o.length));
|
|
1324
|
+
const g = l.split("/").filter(Boolean), u = g[0];
|
|
1325
|
+
let p = "";
|
|
1326
|
+
s.supportedLanguages.includes(u) ? (g[0] = c, p = `${o}/${g.join("/")}`) : p = `${o}/${c}${l}`;
|
|
1327
|
+
const w = p + n.search + n.hash;
|
|
1328
|
+
t.changeLanguage(c), a(w);
|
|
1329
|
+
};
|
|
1330
|
+
}
|
|
1313
1331
|
export {
|
|
1314
1332
|
Ae as AdvancedModeToggle,
|
|
1315
1333
|
Oo as BlogProvider,
|
|
@@ -1325,13 +1343,14 @@ export {
|
|
|
1325
1343
|
tn as SearchBar,
|
|
1326
1344
|
bo as Sidebar,
|
|
1327
1345
|
nt as TableOfContents,
|
|
1328
|
-
|
|
1346
|
+
gt as TagResultsModal,
|
|
1329
1347
|
$t as Tags,
|
|
1330
1348
|
Eo as createBlogUtils,
|
|
1331
1349
|
be as createContentLoaders,
|
|
1332
|
-
|
|
1350
|
+
V as generateHeadingId,
|
|
1333
1351
|
te as getNavigationData,
|
|
1334
|
-
|
|
1352
|
+
j as useBlogConfig,
|
|
1353
|
+
Ho as useLanguageChange,
|
|
1335
1354
|
Ao as useSearchModal,
|
|
1336
1355
|
Ne as useTheme
|
|
1337
1356
|
};
|