@x-wave/blog 0.1.0

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 ADDED
@@ -0,0 +1,1288 @@
1
+ import { jsxs as d, jsx as e, Fragment as U } from "react/jsx-runtime";
2
+ import { useTranslation as R } from "react-i18next";
3
+ import { useLocation as Y, useNavigate as V, useParams as ge, Link as ie, Navigate as Ie } from "react-router-dom";
4
+ import { X as ae, Tag as ke, User as Ce, CalendarBlank as xe, MagnifyingGlass as de, List as ye, Sun as ue, Moon as he, Monitor as me, CaretDown as oe, Globe as Te, CaretRight as Le } from "@phosphor-icons/react";
5
+ import { useState as L, useEffect as P, createContext as Se, useContext as Be, useRef as z } from "react";
6
+ import Pe from "react-markdown";
7
+ import Me from "remark-gfm";
8
+ import ne from "i18next";
9
+ import { createPortal as pe } from "react-dom";
10
+ const De = "_tabContainer_yggpc_1", Ee = "_tab_yggpc_1", Oe = "_active_yggpc_45", G = {
11
+ tabContainer: De,
12
+ tab: Ee,
13
+ active: Oe
14
+ };
15
+ function Re({ hasAdvanced: t }) {
16
+ const { t: n } = R(), a = Y(), o = V();
17
+ if (!t) return null;
18
+ const s = new URLSearchParams(a.search).has("advanced"), u = () => {
19
+ if (s) {
20
+ const p = new URLSearchParams(a.search);
21
+ p.delete("advanced");
22
+ const v = p.toString(), $ = v ? `?${v}` : "";
23
+ o(`${a.pathname}${$}${a.hash}`);
24
+ }
25
+ }, r = () => {
26
+ if (!s) {
27
+ const p = new URLSearchParams(a.search);
28
+ p.set("advanced", ""), o(`${a.pathname}?${p.toString()}${a.hash}`);
29
+ }
30
+ };
31
+ return /* @__PURE__ */ d("div", { className: G.tabContainer, children: [
32
+ /* @__PURE__ */ e(
33
+ "button",
34
+ {
35
+ type: "button",
36
+ className: `${G.tab} ${s ? "" : G.active}`,
37
+ onClick: u,
38
+ children: n("ui.simple")
39
+ }
40
+ ),
41
+ /* @__PURE__ */ e(
42
+ "button",
43
+ {
44
+ type: "button",
45
+ className: `${G.tab} ${s ? G.active : ""}`,
46
+ onClick: r,
47
+ children: n("ui.advanced")
48
+ }
49
+ )
50
+ ] });
51
+ }
52
+ function fe(t) {
53
+ function n(a) {
54
+ const o = a.match(/^---\s*\n([\s\S]*?)\n---\s*\n/);
55
+ if (!o) return { frontmatter: {}, content: a };
56
+ const l = {}, s = o[1];
57
+ let u = "", r = !1;
58
+ const p = [];
59
+ for (const $ of s.split(`
60
+ `)) {
61
+ const m = $.trim();
62
+ if (m.startsWith("-")) {
63
+ if (r) {
64
+ const g = m.substring(1).trim();
65
+ p.push(g);
66
+ }
67
+ continue;
68
+ }
69
+ if (r && !m.startsWith("-") && (l[u] = p.slice(), p.length = 0, r = !1), m != null && m.includes(":")) {
70
+ const [g, ...c] = m.split(":"), f = c.join(":").trim();
71
+ if (u = g.trim(), !f) {
72
+ r = !0;
73
+ continue;
74
+ }
75
+ f === "true" ? l[u] = !0 : f === "false" ? l[u] = !1 : l[u] = f;
76
+ }
77
+ }
78
+ r && p.length > 0 && (l[u] = p);
79
+ const v = a.replace(
80
+ /^---\s*\n[\s\S]*?\n---\s*\n/,
81
+ ""
82
+ );
83
+ return { frontmatter: l, content: v };
84
+ }
85
+ return {
86
+ /**
87
+ * Load MDX content for a given language and slug.
88
+ * Automatically loads the advanced variant if `advanced` is true.
89
+ */
90
+ async loadMDXContent(a, o, l = !1) {
91
+ const s = l ? `${o}-advanced.mdx` : `${o}.mdx`, u = `./docs/${a}/${s}`, r = t[u];
92
+ if (!r) throw new Error(`File not found: ${u}`);
93
+ const p = await r(), { frontmatter: v, content: $ } = n(p);
94
+ return { content: $, frontmatter: v };
95
+ },
96
+ /**
97
+ * Load English content for generating consistent heading IDs.
98
+ * All heading anchors are derived from English content for stability across translations.
99
+ */
100
+ async loadEnglishContent(a, o = !1) {
101
+ const s = `./docs/en/${o ? `${a}-advanced.mdx` : `${a}.mdx`}`, u = t[s];
102
+ if (!u) throw new Error(`File not found: ${s}`);
103
+ const r = await u(), { content: p } = n(r);
104
+ return p;
105
+ },
106
+ /**
107
+ * Build a tag index from all MDX files.
108
+ * Scans frontmatter to extract tags and map them to documents.
109
+ *
110
+ * @param language - Language code to scan (defaults to 'en')
111
+ * @returns Promise resolving to tag index mapping tag names to document info
112
+ */
113
+ async buildTagIndex(a = "en") {
114
+ const o = {}, l = `./docs/${a}/`, s = Object.keys(t).filter(
115
+ (u) => u.startsWith(l)
116
+ );
117
+ for (const u of s)
118
+ try {
119
+ const r = t[u], p = await r(), { frontmatter: v, content: $ } = n(p), m = u.split("/").pop() || "", g = m.replace(".mdx", "").replace("-advanced", ""), c = $.match(/^#\s+(.+)$/m), f = c ? c[1].trim() : g;
120
+ if (m.includes("-advanced")) continue;
121
+ const _ = v.tags;
122
+ if (_ && Array.isArray(_))
123
+ for (const b of _)
124
+ o[b] || (o[b] = []), o[b].some((y) => y.slug === g) || o[b].push({ slug: g, title: f });
125
+ } catch (r) {
126
+ console.warn(`Failed to process ${u}:`, r);
127
+ }
128
+ return o;
129
+ }
130
+ };
131
+ }
132
+ function So(t) {
133
+ const n = fe(t);
134
+ return {
135
+ mdxFiles: t,
136
+ loadContent: n.loadMDXContent,
137
+ loadEnglishContent: n.loadEnglishContent
138
+ };
139
+ }
140
+ const ve = "app-theme", be = () => typeof window > "u" ? "light" : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", _e = (t) => t === "system" ? be() : t, je = () => typeof window > "u" ? "system" : localStorage.getItem(ve) || "system", we = () => {
141
+ const [t, n] = L(je);
142
+ return P(() => {
143
+ const o = _e(t), l = document.documentElement;
144
+ if (l.classList.remove("light", "dark"), l.classList.add(o), document.body.classList.remove("light", "dark"), document.body.classList.add(o), t === "system") {
145
+ const s = window.matchMedia("(prefers-color-scheme: dark)"), u = () => {
146
+ const r = be();
147
+ l.classList.remove("light", "dark"), l.classList.add(r), document.body.classList.remove("light", "dark"), document.body.classList.add(r);
148
+ };
149
+ return s.addEventListener("change", u), () => s.removeEventListener("change", u);
150
+ }
151
+ }, [t]), {
152
+ theme: t,
153
+ setTheme: (o) => {
154
+ localStorage.setItem(ve, o), n(o);
155
+ },
156
+ effectiveTheme: _e(t)
157
+ };
158
+ }, Ae = (t) => "items" in t, te = (t, n) => t.map((a) => Ae(a) ? {
159
+ title: ne.getFixedT(n)(a.title),
160
+ items: a.items.map((o) => ({
161
+ title: ne.getFixedT(n)(o.title),
162
+ slug: o.slug,
163
+ ...o.hasAdvanced && { hasAdvanced: o.hasAdvanced },
164
+ ...o.showTableOfContents !== void 0 && {
165
+ showTableOfContents: o.showTableOfContents
166
+ }
167
+ }))
168
+ } : {
169
+ title: ne.getFixedT(n)(a.title),
170
+ slug: a.slug,
171
+ ...a.hasAdvanced && { hasAdvanced: a.hasAdvanced },
172
+ ...a.showTableOfContents !== void 0 && {
173
+ showTableOfContents: a.showTableOfContents
174
+ }
175
+ }), X = (t) => t.toString().toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-+|-+$/g, ""), Ne = Se(null);
176
+ function Bo({ children: t, config: n, blog: a }) {
177
+ we();
178
+ const [o, l] = L({});
179
+ P(() => {
180
+ const { buildTagIndex: u } = fe(a.mdxFiles), r = n.supportedLanguages.map(async (p) => {
181
+ try {
182
+ const v = await u(p);
183
+ return { language: p, index: v };
184
+ } catch (v) {
185
+ return console.error(`Failed to build tag index for ${p}:`, v), { language: p, index: {} };
186
+ }
187
+ });
188
+ Promise.all(r).then((p) => {
189
+ const v = {};
190
+ for (const $ of p)
191
+ v[$.language] = $.index;
192
+ l(v);
193
+ }).catch((p) => {
194
+ console.error("Failed to build tag indices:", p);
195
+ });
196
+ }, [a.mdxFiles, n.supportedLanguages]);
197
+ const s = { ...n, tagIndex: o };
198
+ return /* @__PURE__ */ e(
199
+ Ne.Provider,
200
+ {
201
+ value: {
202
+ config: s,
203
+ loadContent: a.loadContent,
204
+ loadEnglishContent: a.loadEnglishContent
205
+ },
206
+ children: t
207
+ }
208
+ );
209
+ }
210
+ function W() {
211
+ const t = Be(Ne);
212
+ if (!t)
213
+ throw new Error("useBlogConfig must be used within a BlogProvider");
214
+ return t;
215
+ }
216
+ const He = "_tableOfContents_vn5e4_1", ze = "_header_vn5e4_20", We = "_title_vn5e4_24", Fe = "_nav_vn5e4_33", Ke = "_list_vn5e4_39", Ue = "_link_vn5e4_46", qe = "_active_vn5e4_70", Ge = "_level1_vn5e4_86", Qe = "_level2_vn5e4_92", Xe = "_level3_vn5e4_97", Ye = "_level4_vn5e4_103", Ve = "_level5_vn5e4_109", Je = "_level6_vn5e4_115", A = {
217
+ tableOfContents: He,
218
+ header: ze,
219
+ title: We,
220
+ nav: Fe,
221
+ list: Ke,
222
+ link: Ue,
223
+ active: qe,
224
+ level1: Ge,
225
+ level2: Qe,
226
+ level3: Xe,
227
+ level4: Ye,
228
+ level5: Ve,
229
+ level6: Je
230
+ };
231
+ function Ze({
232
+ content: t,
233
+ englishContent: n
234
+ }) {
235
+ const { t: a } = R(), o = Y(), l = V(), [s, u] = L([]), [r, p] = L(""), v = z(null);
236
+ P(() => {
237
+ p(""), (() => {
238
+ const g = /^(#{1,6})\s+(.+)$/gm, c = [];
239
+ let f = g.exec(t);
240
+ const _ = [];
241
+ for (; f !== null; ) {
242
+ const h = f[1].length, C = f[2].trim();
243
+ _.push({ level: h, text: C }), f = g.exec(t);
244
+ }
245
+ const b = /^(#{1,6})\s+(.+)$/gm;
246
+ let y = b.exec(n), S = 0;
247
+ for (; y !== null && S < _.length; ) {
248
+ const h = y[2].trim(), C = X(h);
249
+ c.push({
250
+ id: C,
251
+ text: _[S].text,
252
+ // Use localized text for display
253
+ level: _[S].level
254
+ }), S++, y = b.exec(n);
255
+ }
256
+ u(c);
257
+ })();
258
+ }, [t, n]), P(() => {
259
+ if (s.length === 0) return;
260
+ const m = setTimeout(() => {
261
+ const g = s.filter(
262
+ (c) => !document.getElementById(c.id)
263
+ );
264
+ g.length > 0 && console.warn("Some heading elements not found:", g);
265
+ }, 100);
266
+ return () => clearTimeout(m);
267
+ }, [s]), P(() => {
268
+ if (s.length === 0) return;
269
+ v.current && v.current.disconnect();
270
+ const m = setTimeout(() => {
271
+ const g = s.map((c) => document.getElementById(c.id)).filter(Boolean);
272
+ g.length !== 0 && (v.current = new IntersectionObserver(
273
+ (c) => {
274
+ const f = c.filter((_) => _.isIntersecting);
275
+ if (f.length > 0) {
276
+ const _ = f.reduce((b, y) => b.boundingClientRect.top < y.boundingClientRect.top ? b : y);
277
+ p(_.target.id);
278
+ }
279
+ },
280
+ {
281
+ rootMargin: "-80px 0% -80% 0%",
282
+ threshold: 0
283
+ }
284
+ ), g.forEach((c) => {
285
+ v.current && v.current.observe(c);
286
+ }));
287
+ }, 150);
288
+ return () => {
289
+ clearTimeout(m), v.current && v.current.disconnect();
290
+ };
291
+ }, [s]), P(() => () => {
292
+ v.current && v.current.disconnect();
293
+ }, []);
294
+ const $ = (m) => {
295
+ const g = document.getElementById(m);
296
+ if (g) {
297
+ const c = new URLSearchParams(o.search);
298
+ c.set("a", m), l(
299
+ `${o.pathname}?${c.toString()}${o.hash}`,
300
+ {
301
+ replace: !0
302
+ }
303
+ );
304
+ const b = g.getBoundingClientRect().top + window.pageYOffset - 80;
305
+ window.scrollTo({
306
+ top: b,
307
+ behavior: "smooth"
308
+ });
309
+ }
310
+ };
311
+ return s.length === 0 ? null : /* @__PURE__ */ d("aside", { className: A.tableOfContents, children: [
312
+ /* @__PURE__ */ e("div", { className: A.header, children: /* @__PURE__ */ e("span", { className: A.title, children: a("ui.onThisPage", "On this page") }) }),
313
+ /* @__PURE__ */ e("nav", { className: A.nav, children: /* @__PURE__ */ e("ul", { className: A.list, children: s.map((m) => /* @__PURE__ */ e("li", { className: A.item, children: /* @__PURE__ */ e(
314
+ "button",
315
+ {
316
+ className: `${A.link} ${A[`level${m.level}`]} ${r === m.id ? A.active : ""}`,
317
+ onClick: () => $(m.id),
318
+ type: "button",
319
+ children: m.text
320
+ }
321
+ ) }, m.id)) }) })
322
+ ] });
323
+ }
324
+ const et = "_overlay_s7p1r_1", tt = "_modal_s7p1r_26", nt = "_header_s7p1r_50", ot = "_title_s7p1r_58", at = "_closeButton_s7p1r_65", st = "_results_s7p1r_86", ct = "_resultsList_s7p1r_94", rt = "_resultItem_s7p1r_100", lt = "_resultTitle_s7p1r_119", it = "_resultSlug_s7p1r_124", dt = "_noResults_s7p1r_130", E = {
325
+ overlay: et,
326
+ modal: tt,
327
+ header: nt,
328
+ title: ot,
329
+ closeButton: at,
330
+ results: st,
331
+ resultsList: ct,
332
+ resultItem: rt,
333
+ resultTitle: lt,
334
+ resultSlug: it,
335
+ noResults: dt
336
+ };
337
+ function ut({
338
+ tag: t,
339
+ results: n,
340
+ language: a,
341
+ onClose: o
342
+ }) {
343
+ const { t: l } = R(), s = V(), u = (r) => {
344
+ s(`/${a}/${r}`), o();
345
+ };
346
+ return pe(
347
+ /* @__PURE__ */ e("div", { className: E.overlay, onClick: o, children: /* @__PURE__ */ d("div", { className: E.modal, onClick: (r) => r.stopPropagation(), children: [
348
+ /* @__PURE__ */ d("div", { className: E.header, children: [
349
+ /* @__PURE__ */ d("h2", { className: E.title, children: [
350
+ l("ui.tagResults"),
351
+ ": ",
352
+ t
353
+ ] }),
354
+ /* @__PURE__ */ e(
355
+ "button",
356
+ {
357
+ type: "button",
358
+ className: E.closeButton,
359
+ onClick: o,
360
+ "aria-label": "Close",
361
+ children: /* @__PURE__ */ e(ae, {})
362
+ }
363
+ )
364
+ ] }),
365
+ /* @__PURE__ */ e("div", { className: E.results, children: n.length === 0 ? /* @__PURE__ */ e("div", { className: E.noResults, children: l("ui.noTagResults") }) : /* @__PURE__ */ e("ul", { className: E.resultsList, children: n.map((r) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ d(
366
+ "button",
367
+ {
368
+ type: "button",
369
+ className: E.resultItem,
370
+ onClick: () => u(r.slug),
371
+ children: [
372
+ /* @__PURE__ */ e("div", { className: E.resultTitle, children: r.title }),
373
+ /* @__PURE__ */ d("div", { className: E.resultSlug, children: [
374
+ "/",
375
+ r.slug
376
+ ] })
377
+ ]
378
+ }
379
+ ) }, r.slug)) }) })
380
+ ] }) }),
381
+ document.body
382
+ );
383
+ }
384
+ const ht = "_tags_8uc6s_1", mt = "_compact_8uc6s_9", _t = "_tagLabel_8uc6s_15", gt = "_tagIcon_8uc6s_25", pt = "_tagList_8uc6s_30", ft = "_tag_8uc6s_1", K = {
385
+ tags: ht,
386
+ compact: mt,
387
+ tagLabel: _t,
388
+ tagIcon: gt,
389
+ tagList: pt,
390
+ tag: ft
391
+ };
392
+ function vt({ tags: t, variant: n = "default", onTagClick: a }) {
393
+ const { t: o } = R();
394
+ if (!t || t.length === 0) return null;
395
+ const l = (s) => {
396
+ a && a(s);
397
+ };
398
+ return /* @__PURE__ */ d(
399
+ "div",
400
+ {
401
+ className: `${K.tags} ${n === "compact" ? K.compact : ""}`,
402
+ children: [
403
+ n === "default" && /* @__PURE__ */ d("div", { className: K.tagLabel, children: [
404
+ /* @__PURE__ */ e(ke, { className: K.tagIcon, weight: "duotone" }),
405
+ /* @__PURE__ */ d("span", { children: [
406
+ o("ui.tags"),
407
+ ":"
408
+ ] })
409
+ ] }),
410
+ /* @__PURE__ */ e("div", { className: K.tagList, children: t.map((s) => /* @__PURE__ */ e(
411
+ "button",
412
+ {
413
+ type: "button",
414
+ className: K.tag,
415
+ onClick: () => l(s),
416
+ "aria-label": `${o("ui.filterByTag")}: ${s}`,
417
+ children: s
418
+ },
419
+ s
420
+ )) })
421
+ ]
422
+ }
423
+ );
424
+ }
425
+ const bt = "_contentPage_godc9_1", wt = "_metadata_godc9_20", Nt = "_author_godc9_30", $t = "_date_godc9_31", It = "_loadingContainer_godc9_48", kt = "_errorContainer_godc9_49", Ct = "_skeletonTitle_godc9_71", xt = "_skeletonParagraph_godc9_80", yt = "_skeletonParagraphShort_godc9_93", Tt = "_errorText_godc9_107", Lt = "_mdxContent_godc9_112", St = "_withMetadata_godc9_125", Bt = "_codeBlock_godc9_300", Pt = "_codeLanguage_godc9_304", B = {
426
+ contentPage: bt,
427
+ metadata: wt,
428
+ author: Nt,
429
+ date: $t,
430
+ loadingContainer: It,
431
+ errorContainer: kt,
432
+ skeletonTitle: Ct,
433
+ skeletonParagraph: xt,
434
+ skeletonParagraphShort: yt,
435
+ errorText: Tt,
436
+ mdxContent: Lt,
437
+ withMetadata: St,
438
+ codeBlock: Bt,
439
+ codeLanguage: Pt
440
+ };
441
+ function Po({ language: t }) {
442
+ var le;
443
+ const { slug: n } = ge(), a = Y(), { t: o } = R(), { config: l, loadContent: s, loadEnglishContent: u } = W(), [r, p] = L(""), [v, $] = L(""), [m, g] = L({}), [c, f] = L(!0), [_, b] = L(null), [y, S] = L(!0), [h, C] = L(null), M = z(0), q = z([]), J = ((i) => {
444
+ const w = {
445
+ advanced: !1,
446
+ anchor: ""
447
+ };
448
+ if (!i) return w;
449
+ const N = (i.startsWith("?") ? i.substring(1) : i).split("&");
450
+ for (const x of N)
451
+ x === "advanced" ? w.advanced = !0 : x.startsWith("a=") && (w.anchor = x.substring(2));
452
+ return w;
453
+ })(a.search), j = J.advanced;
454
+ if (P(() => {
455
+ (async () => {
456
+ if (!n) return;
457
+ f(!0), b(null), M.current = 0;
458
+ let w = !0;
459
+ for (const I of l.navigationData)
460
+ if ("items" in I) {
461
+ const N = I.items.find((x) => x.slug === n);
462
+ if (N) {
463
+ w = N.showTableOfContents !== !1;
464
+ break;
465
+ }
466
+ } else if (I.slug === n) {
467
+ w = I.showTableOfContents !== !1;
468
+ break;
469
+ }
470
+ S(w);
471
+ try {
472
+ let I;
473
+ try {
474
+ I = await s(t, n, j);
475
+ } catch {
476
+ if (j)
477
+ I = await s(t, n, !1);
478
+ else
479
+ throw new Error("Content not found");
480
+ }
481
+ let N = "";
482
+ try {
483
+ N = await u(n, j);
484
+ } catch {
485
+ j && (N = await u(n, !1));
486
+ }
487
+ const x = /^(#{1,6})\s+(.+)$/gm, O = [];
488
+ let F = x.exec(N);
489
+ for (; F !== null; ) {
490
+ const Z = F[2].trim();
491
+ O.push(Z), F = x.exec(N);
492
+ }
493
+ q.current = O, $(N), p(I.content), g(I.frontmatter);
494
+ } catch (I) {
495
+ b(I instanceof Error ? I.message : "Failed to load content");
496
+ } finally {
497
+ f(!1);
498
+ }
499
+ })();
500
+ }, [
501
+ n,
502
+ t,
503
+ j,
504
+ l.navigationData,
505
+ s,
506
+ u
507
+ ]), P(() => {
508
+ if (!c && J.anchor) {
509
+ const i = setTimeout(() => {
510
+ const w = document.getElementById(J.anchor);
511
+ if (w) {
512
+ const x = w.getBoundingClientRect().top + window.pageYOffset - 80;
513
+ window.scrollTo({
514
+ top: x,
515
+ behavior: "smooth"
516
+ });
517
+ }
518
+ }, 150);
519
+ return () => clearTimeout(i);
520
+ }
521
+ }, [c, J.anchor]), c)
522
+ return /* @__PURE__ */ e("div", { className: B.contentPage, children: /* @__PURE__ */ d("div", { className: B.loadingContainer, children: [
523
+ /* @__PURE__ */ e("div", { className: B.skeletonTitle }),
524
+ /* @__PURE__ */ e("div", { className: B.skeletonParagraph }),
525
+ /* @__PURE__ */ e("div", { className: B.skeletonParagraph }),
526
+ /* @__PURE__ */ e("div", { className: B.skeletonParagraphShort })
527
+ ] }) });
528
+ if (_)
529
+ return /* @__PURE__ */ e("div", { className: B.contentPage, children: /* @__PURE__ */ e("div", { className: B.errorContainer, children: /* @__PURE__ */ d("div", { className: B.errorText, children: [
530
+ "Error: ",
531
+ _
532
+ ] }) }) });
533
+ M.current = 0;
534
+ let re = !1;
535
+ const $e = () => /* @__PURE__ */ d("div", { className: B.metadata, children: [
536
+ m.author && /* @__PURE__ */ d("span", { className: B.author, children: [
537
+ /* @__PURE__ */ e(Ce, { size: 16, weight: "regular" }),
538
+ m.author
539
+ ] }),
540
+ m.date && /* @__PURE__ */ d("span", { className: B.date, children: [
541
+ /* @__PURE__ */ e(xe, { size: 16, weight: "regular" }),
542
+ o("ui.lastEdited"),
543
+ ": ",
544
+ m.date
545
+ ] })
546
+ ] });
547
+ return /* @__PURE__ */ d(U, { children: [
548
+ /* @__PURE__ */ d("div", { className: B.contentPage, children: [
549
+ /* @__PURE__ */ e(Re, { hasAdvanced: m.hasAdvanced || !1 }),
550
+ /* @__PURE__ */ e("div", { className: B.mdxContent, children: /* @__PURE__ */ e(
551
+ Pe,
552
+ {
553
+ remarkPlugins: [Me],
554
+ components: {
555
+ h1: ({ children: i }) => {
556
+ const w = M.current++, I = q.current[w] || "", N = X(I), x = j ? `?advanced&a=${N}` : `?a=${N}`, O = `#/${t}/${n}${x}`, F = !re;
557
+ re = !0;
558
+ const Z = m.date || m.author;
559
+ return /* @__PURE__ */ d(U, { children: [
560
+ /* @__PURE__ */ e(
561
+ "h1",
562
+ {
563
+ id: N,
564
+ className: F && Z ? B.withMetadata : void 0,
565
+ children: /* @__PURE__ */ e(
566
+ "a",
567
+ {
568
+ href: O,
569
+ style: { color: "inherit", textDecoration: "none" },
570
+ children: i
571
+ }
572
+ )
573
+ }
574
+ ),
575
+ F && Z && /* @__PURE__ */ e($e, {})
576
+ ] });
577
+ },
578
+ h2: ({ children: i }) => {
579
+ const w = M.current++, I = q.current[w] || "", N = X(I), x = j ? `?advanced&a=${N}` : `?a=${N}`, O = `#/${t}/${n}${x}`;
580
+ return /* @__PURE__ */ e("h2", { id: N, children: /* @__PURE__ */ e(
581
+ "a",
582
+ {
583
+ href: O,
584
+ style: { color: "inherit", textDecoration: "none" },
585
+ children: i
586
+ }
587
+ ) });
588
+ },
589
+ h3: ({ children: i }) => {
590
+ const w = M.current++, I = q.current[w] || "", N = X(I), x = j ? `?advanced&a=${N}` : `?a=${N}`, O = `#/${t}/${n}${x}`;
591
+ return /* @__PURE__ */ e("h3", { id: N, children: /* @__PURE__ */ e(
592
+ "a",
593
+ {
594
+ href: O,
595
+ style: { color: "inherit", textDecoration: "none" },
596
+ children: i
597
+ }
598
+ ) });
599
+ },
600
+ h4: ({ children: i }) => {
601
+ const w = M.current++, I = q.current[w] || "", N = X(I), x = j ? `?advanced&a=${N}` : `?a=${N}`, O = `#/${t}/${n}${x}`;
602
+ return /* @__PURE__ */ e("h4", { id: N, children: /* @__PURE__ */ e(
603
+ "a",
604
+ {
605
+ href: O,
606
+ style: { color: "inherit", textDecoration: "none" },
607
+ children: i
608
+ }
609
+ ) });
610
+ },
611
+ h5: ({ children: i }) => {
612
+ const w = `h5-${M.current++}`;
613
+ return /* @__PURE__ */ e("h5", { id: w, children: i });
614
+ },
615
+ h6: ({ children: i }) => {
616
+ const w = `h6-${M.current++}`;
617
+ return /* @__PURE__ */ e("h6", { id: w, children: i });
618
+ },
619
+ p: ({ children: i }) => /* @__PURE__ */ e("p", { children: i }),
620
+ ul: ({ children: i }) => /* @__PURE__ */ e("ul", { children: i }),
621
+ ol: ({ children: i }) => /* @__PURE__ */ e("ol", { children: i }),
622
+ li: ({ children: i }) => /* @__PURE__ */ e("li", { children: i }),
623
+ code: ({ className: i, children: w, ...I }) => {
624
+ if (!i)
625
+ return /* @__PURE__ */ e("code", { ...I, children: w });
626
+ const x = (i == null ? void 0 : i.replace("language-", "")) || "";
627
+ return /* @__PURE__ */ d("div", { className: B.codeBlock, children: [
628
+ x && /* @__PURE__ */ e("div", { className: B.codeLanguage, children: x }),
629
+ /* @__PURE__ */ e("pre", { children: /* @__PURE__ */ e("code", { className: i, ...I, children: w }) })
630
+ ] });
631
+ },
632
+ pre: ({ children: i }) => /* @__PURE__ */ e(U, { children: i }),
633
+ // Let code component handle pre styling
634
+ blockquote: ({ children: i }) => /* @__PURE__ */ e("blockquote", { children: i }),
635
+ a: ({ href: i, children: w, ...I }) => {
636
+ if (i != null && i.startsWith("./")) {
637
+ const N = i.slice(2), x = `#/${t}/${N}`;
638
+ return /* @__PURE__ */ e("a", { href: x, ...I, children: w });
639
+ }
640
+ return i != null && i.startsWith("http://") || i != null && i.startsWith("https://") ? /* @__PURE__ */ e(
641
+ "a",
642
+ {
643
+ href: i,
644
+ target: "_blank",
645
+ rel: "noopener noreferrer",
646
+ ...I,
647
+ children: w
648
+ }
649
+ ) : /* @__PURE__ */ e("a", { href: i, ...I, children: w });
650
+ },
651
+ strong: ({ children: i }) => /* @__PURE__ */ e("strong", { children: i }),
652
+ em: ({ children: i }) => /* @__PURE__ */ e("em", { children: i })
653
+ },
654
+ children: r
655
+ }
656
+ ) }),
657
+ m.tags && m.tags.length > 0 && /* @__PURE__ */ e(
658
+ vt,
659
+ {
660
+ tags: m.tags,
661
+ variant: "compact",
662
+ onTagClick: (i) => C(i)
663
+ }
664
+ )
665
+ ] }),
666
+ y && /* @__PURE__ */ e(Ze, { content: r, englishContent: v }),
667
+ h && ((le = l.tagIndex) == null ? void 0 : le[t]) && /* @__PURE__ */ e(
668
+ ut,
669
+ {
670
+ tag: h,
671
+ results: l.tagIndex[t][h] || [],
672
+ language: t,
673
+ onClose: () => C(null)
674
+ }
675
+ )
676
+ ] });
677
+ }
678
+ const Mt = "_searchButton_royne_1", Dt = "_searchIcon_royne_17", Et = "_searchHint_royne_23", Ot = "_kbd_royne_27", Rt = "_searchOverlay_royne_42", jt = "_searchModal_royne_67", At = "_searchHeader_royne_91", Ht = "_searchInput_royne_105", zt = "_closeButton_royne_123", Wt = "_searchResults_royne_144", Ft = "_resultsList_royne_152", Kt = "_resultItem_royne_158", Ut = "_selected_royne_173", qt = "_resultTitle_royne_176", Gt = "_resultSlug_royne_180", Qt = "_noResults_royne_186", Xt = "_searchHints_royne_193", Yt = "_hint_royne_210", T = {
679
+ searchButton: Mt,
680
+ searchIcon: Dt,
681
+ searchHint: Et,
682
+ kbd: Ot,
683
+ searchOverlay: Rt,
684
+ searchModal: jt,
685
+ searchHeader: At,
686
+ searchInput: Ht,
687
+ closeButton: zt,
688
+ searchResults: Wt,
689
+ resultsList: Ft,
690
+ resultItem: Kt,
691
+ selected: Ut,
692
+ resultTitle: qt,
693
+ resultSlug: Gt,
694
+ noResults: Qt,
695
+ searchHints: Xt,
696
+ hint: Yt
697
+ };
698
+ function Vt({ language: t }) {
699
+ const { t: n } = R(), { config: a } = W(), o = V(), [l, s] = L(!1), [u, r] = L(""), [p, v] = L([]), [$, m] = L(0), g = z(null), c = z(null), _ = typeof navigator < "u" && /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform) ? "⌘K" : "Ctrl+K", b = te(
700
+ a.navigationData,
701
+ t
702
+ ).flatMap((h) => "items" in h ? h.items.map((C) => ({
703
+ title: C.title,
704
+ slug: C.slug
705
+ })) : [{ title: h.title, slug: h.slug }]);
706
+ P(() => {
707
+ if (!u.trim()) {
708
+ v([]), m(0);
709
+ return;
710
+ }
711
+ const h = u.toLowerCase(), C = b.filter(
712
+ (M) => M.title.toLowerCase().includes(h) || M.slug.toLowerCase().includes(h)
713
+ );
714
+ v(C), m(0);
715
+ }, [u]), P(() => {
716
+ const h = (C) => {
717
+ (C.metaKey || C.ctrlKey) && C.key === "k" && (C.preventDefault(), s(!0), setTimeout(() => {
718
+ var M;
719
+ return (M = g.current) == null ? void 0 : M.focus();
720
+ }, 100)), C.key === "Escape" && l && (s(!1), r(""));
721
+ };
722
+ return document.addEventListener("keydown", h), () => document.removeEventListener("keydown", h);
723
+ }, [l]);
724
+ const y = (h) => {
725
+ h.key === "ArrowDown" ? (h.preventDefault(), m((C) => Math.min(C + 1, p.length - 1))) : h.key === "ArrowUp" ? (h.preventDefault(), m((C) => Math.max(C - 1, 0))) : h.key === "Enter" && p[$] && (h.preventDefault(), S(p[$].slug));
726
+ };
727
+ P(() => {
728
+ const h = (C) => {
729
+ c.current && !c.current.contains(C.target) && (s(!1), r(""));
730
+ };
731
+ return l && document.addEventListener("mousedown", h), () => document.removeEventListener("mousedown", h);
732
+ }, [l]);
733
+ const S = (h) => {
734
+ o(`/${t}/${h}`), s(!1), r("");
735
+ };
736
+ return /* @__PURE__ */ d(U, { children: [
737
+ /* @__PURE__ */ d(
738
+ "button",
739
+ {
740
+ type: "button",
741
+ className: T.searchButton,
742
+ onClick: () => {
743
+ s(!0), setTimeout(() => {
744
+ var h;
745
+ return (h = g.current) == null ? void 0 : h.focus();
746
+ }, 100);
747
+ },
748
+ "aria-label": n("ui.search"),
749
+ children: [
750
+ /* @__PURE__ */ e(de, { className: T.searchIcon }),
751
+ /* @__PURE__ */ e("span", { className: T.searchHint, children: n("ui.search") }),
752
+ /* @__PURE__ */ e("kbd", { className: T.kbd, children: _ })
753
+ ]
754
+ }
755
+ ),
756
+ l && pe(
757
+ /* @__PURE__ */ e(
758
+ "div",
759
+ {
760
+ className: T.searchOverlay,
761
+ onClick: () => {
762
+ s(!1), r("");
763
+ },
764
+ children: /* @__PURE__ */ d(
765
+ "div",
766
+ {
767
+ className: T.searchModal,
768
+ ref: c,
769
+ onClick: (h) => h.stopPropagation(),
770
+ children: [
771
+ /* @__PURE__ */ d("div", { className: T.searchHeader, children: [
772
+ /* @__PURE__ */ e(de, { className: T.searchIcon }),
773
+ /* @__PURE__ */ e(
774
+ "input",
775
+ {
776
+ ref: g,
777
+ type: "text",
778
+ className: T.searchInput,
779
+ placeholder: n("ui.searchPlaceholder"),
780
+ value: u,
781
+ onChange: (h) => r(h.target.value),
782
+ onKeyDown: y
783
+ }
784
+ ),
785
+ /* @__PURE__ */ e(
786
+ "button",
787
+ {
788
+ type: "button",
789
+ className: T.closeButton,
790
+ onClick: () => {
791
+ s(!1), r("");
792
+ },
793
+ "aria-label": "Close search",
794
+ children: /* @__PURE__ */ e(ae, {})
795
+ }
796
+ )
797
+ ] }),
798
+ u && /* @__PURE__ */ e("div", { className: T.searchResults, children: p.length === 0 ? /* @__PURE__ */ e("div", { className: T.noResults, children: n("ui.noSearchResults") }) : /* @__PURE__ */ e("ul", { className: T.resultsList, children: p.map((h, C) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ d(
799
+ "button",
800
+ {
801
+ type: "button",
802
+ className: `${T.resultItem} ${C === $ ? T.selected : ""}`,
803
+ onClick: () => S(h.slug),
804
+ onMouseEnter: () => m(C),
805
+ children: [
806
+ /* @__PURE__ */ e("div", { className: T.resultTitle, children: h.title }),
807
+ /* @__PURE__ */ d("div", { className: T.resultSlug, children: [
808
+ "/",
809
+ h.slug
810
+ ] })
811
+ ]
812
+ }
813
+ ) }, h.slug)) }) }),
814
+ !u && /* @__PURE__ */ d("div", { className: T.searchHints, children: [
815
+ /* @__PURE__ */ d("div", { className: T.hint, children: [
816
+ /* @__PURE__ */ e("kbd", { children: "↑" }),
817
+ /* @__PURE__ */ e("kbd", { children: "↓" }),
818
+ /* @__PURE__ */ e("span", { children: n("ui.searchNavigate") })
819
+ ] }),
820
+ /* @__PURE__ */ d("div", { className: T.hint, children: [
821
+ /* @__PURE__ */ e("kbd", { children: "↵" }),
822
+ /* @__PURE__ */ e("span", { children: n("ui.searchSelect") })
823
+ ] }),
824
+ /* @__PURE__ */ d("div", { className: T.hint, children: [
825
+ /* @__PURE__ */ e("kbd", { children: "esc" }),
826
+ /* @__PURE__ */ e("span", { children: n("ui.searchClose") })
827
+ ] })
828
+ ] })
829
+ ]
830
+ }
831
+ )
832
+ }
833
+ ),
834
+ document.body
835
+ )
836
+ ] });
837
+ }
838
+ const Jt = "_header_15xr7_1", Zt = "_container_15xr7_24", en = "_content_15xr7_36", tn = "_leftSection_15xr7_43", nn = "_mobileMenuButton_15xr7_49", on = "_burgerIcon_15xr7_87", an = "_logo_15xr7_92", sn = "_nav_15xr7_98", cn = "_navLink_15xr7_109", rn = "_externalIcon_15xr7_135", ln = "_supportDropdown_15xr7_141", dn = "_themeDropdown_15xr7_145", un = "_themeButton_15xr7_149", hn = "_themeIcon_15xr7_171", mn = "_supportButton_15xr7_177", _n = "_caretIcon_15xr7_198", gn = "_dropdownMenu_15xr7_208", pn = "_dropdownItem_15xr7_221", fn = "_dropdownIcon_15xr7_244", k = {
839
+ header: Jt,
840
+ container: Zt,
841
+ content: en,
842
+ leftSection: tn,
843
+ mobileMenuButton: nn,
844
+ burgerIcon: on,
845
+ logo: an,
846
+ nav: sn,
847
+ navLink: cn,
848
+ externalIcon: rn,
849
+ supportDropdown: ln,
850
+ themeDropdown: dn,
851
+ themeButton: un,
852
+ themeIcon: hn,
853
+ supportButton: mn,
854
+ caretIcon: _n,
855
+ dropdownMenu: gn,
856
+ dropdownItem: pn,
857
+ dropdownIcon: fn
858
+ };
859
+ function vn({ onMobileMenuToggle: t }) {
860
+ const { t: n, i18n: a } = R(), { config: o } = W(), l = o.header ?? {}, s = l.navLinks ?? [], u = l.dropdownItems ?? [], [r, p] = L(!1), [v, $] = L(!1), { theme: m, setTheme: g } = we(), c = z(null), f = z(null);
861
+ return P(() => {
862
+ const _ = (b) => {
863
+ c.current && !c.current.contains(b.target) && p(!1), f.current && !f.current.contains(b.target) && $(!1);
864
+ };
865
+ return document.addEventListener("mousedown", _), () => document.removeEventListener("mousedown", _);
866
+ }, []), /* @__PURE__ */ e("header", { className: k.header, children: /* @__PURE__ */ e("div", { className: k.container, children: /* @__PURE__ */ d("div", { className: k.content, children: [
867
+ /* @__PURE__ */ d("div", { className: k.leftSection, children: [
868
+ /* @__PURE__ */ e(
869
+ "button",
870
+ {
871
+ type: "button",
872
+ className: k.mobileMenuButton,
873
+ onClick: t,
874
+ "aria-label": "Open menu",
875
+ children: /* @__PURE__ */ e(ye, { className: k.burgerIcon })
876
+ }
877
+ ),
878
+ /* @__PURE__ */ e("div", { className: k.logo })
879
+ ] }),
880
+ /* @__PURE__ */ d("nav", { className: k.nav, children: [
881
+ /* @__PURE__ */ e(Vt, { language: a.language }),
882
+ /* @__PURE__ */ d("div", { className: k.themeDropdown, ref: f, children: [
883
+ /* @__PURE__ */ d(
884
+ "button",
885
+ {
886
+ type: "button",
887
+ className: k.themeButton,
888
+ onClick: () => $(!v),
889
+ "aria-expanded": v,
890
+ "aria-haspopup": "true",
891
+ "aria-label": n("ui.theme"),
892
+ children: [
893
+ m === "light" && /* @__PURE__ */ e(ue, { className: k.themeIcon }),
894
+ m === "dark" && /* @__PURE__ */ e(he, { className: k.themeIcon }),
895
+ m === "system" && /* @__PURE__ */ e(me, { className: k.themeIcon }),
896
+ /* @__PURE__ */ e(oe, { className: k.caretIcon })
897
+ ]
898
+ }
899
+ ),
900
+ v && /* @__PURE__ */ d("div", { className: k.dropdownMenu, children: [
901
+ /* @__PURE__ */ d(
902
+ "button",
903
+ {
904
+ type: "button",
905
+ onClick: () => {
906
+ g("light"), $(!1);
907
+ },
908
+ className: k.dropdownItem,
909
+ children: [
910
+ /* @__PURE__ */ e(ue, { className: k.dropdownIcon }),
911
+ n("ui.light")
912
+ ]
913
+ }
914
+ ),
915
+ /* @__PURE__ */ d(
916
+ "button",
917
+ {
918
+ type: "button",
919
+ onClick: () => {
920
+ g("dark"), $(!1);
921
+ },
922
+ className: k.dropdownItem,
923
+ children: [
924
+ /* @__PURE__ */ e(he, { className: k.dropdownIcon }),
925
+ n("ui.dark")
926
+ ]
927
+ }
928
+ ),
929
+ /* @__PURE__ */ d(
930
+ "button",
931
+ {
932
+ type: "button",
933
+ onClick: () => {
934
+ g("system"), $(!1);
935
+ },
936
+ className: k.dropdownItem,
937
+ children: [
938
+ /* @__PURE__ */ e(me, { className: k.dropdownIcon }),
939
+ n("ui.system")
940
+ ]
941
+ }
942
+ )
943
+ ] })
944
+ ] }),
945
+ u.length > 0 && /* @__PURE__ */ d("div", { className: k.supportDropdown, ref: c, children: [
946
+ /* @__PURE__ */ d(
947
+ "button",
948
+ {
949
+ type: "button",
950
+ className: k.supportButton,
951
+ onClick: () => p(!r),
952
+ "aria-expanded": r,
953
+ "aria-haspopup": "true",
954
+ children: [
955
+ n("ui.support"),
956
+ /* @__PURE__ */ e(oe, { className: k.caretIcon })
957
+ ]
958
+ }
959
+ ),
960
+ r && /* @__PURE__ */ e("div", { className: k.dropdownMenu, children: u.map((_, b) => {
961
+ const y = _.target ?? (_.url.startsWith("http") ? "_blank" : "_self"), S = _.rel ?? (y === "_blank" ? "noopener noreferrer" : void 0), h = _.icon;
962
+ return /* @__PURE__ */ d(
963
+ "a",
964
+ {
965
+ href: _.url,
966
+ target: y,
967
+ rel: S,
968
+ className: k.dropdownItem,
969
+ children: [
970
+ h && /* @__PURE__ */ e(h, { className: k.dropdownIcon }),
971
+ _.label
972
+ ]
973
+ },
974
+ b
975
+ );
976
+ }) })
977
+ ] }),
978
+ s.map((_, b) => {
979
+ const y = _.target ?? (typeof _.url == "string" && _.url.startsWith("http") ? "_blank" : "_self"), S = _.rel ?? (y === "_blank" ? "noopener noreferrer" : void 0), h = _.icon;
980
+ return /* @__PURE__ */ d(
981
+ "a",
982
+ {
983
+ href: _.url,
984
+ target: y,
985
+ rel: S,
986
+ className: _.className ?? k.navLink,
987
+ children: [
988
+ _.label,
989
+ h && /* @__PURE__ */ e(h, { className: k.externalIcon })
990
+ ]
991
+ },
992
+ b
993
+ );
994
+ })
995
+ ] })
996
+ ] }) }) });
997
+ }
998
+ const Q = (t) => "items" in t;
999
+ function se({
1000
+ styles: t,
1001
+ onLanguageChange: n
1002
+ }) {
1003
+ const { i18n: a } = R(), o = Y(), l = V(), { config: s } = W(), [u, r] = L(!1), p = z(null), v = a.language, $ = (g) => {
1004
+ const c = o.pathname.split("/").filter(Boolean), f = c[0];
1005
+ let _ = "";
1006
+ s.supportedLanguages.includes(f) ? (c[0] = g, _ = `/${c.join("/")}`) : _ = `/${g}${o.pathname}`;
1007
+ const b = _ + o.search + o.hash;
1008
+ a.changeLanguage(g), l(b), r(!1), n == null || n();
1009
+ };
1010
+ P(() => {
1011
+ const g = (c) => {
1012
+ p.current && !p.current.contains(c.target) && r(!1);
1013
+ };
1014
+ return document.addEventListener("mousedown", g), () => document.removeEventListener("mousedown", g);
1015
+ }, []);
1016
+ const m = (g) => a.getFixedT(g)("language") || g;
1017
+ return /* @__PURE__ */ d("div", { className: t.languageSelect, ref: p, children: [
1018
+ /* @__PURE__ */ d(
1019
+ "button",
1020
+ {
1021
+ type: "button",
1022
+ className: t.languageButton,
1023
+ onClick: () => r(!u),
1024
+ "aria-expanded": u,
1025
+ "aria-haspopup": "listbox",
1026
+ children: [
1027
+ /* @__PURE__ */ e(Te, { className: t.icon }),
1028
+ m(v),
1029
+ /* @__PURE__ */ e(oe, { className: t.chevron })
1030
+ ]
1031
+ }
1032
+ ),
1033
+ u && /* @__PURE__ */ e("div", { className: t.languageDropdown, role: "listbox", children: s.supportedLanguages.map((g) => /* @__PURE__ */ e(
1034
+ "button",
1035
+ {
1036
+ type: "button",
1037
+ className: `${t.languageOption} ${g === v ? t.selected : ""}`,
1038
+ onClick: () => $(g),
1039
+ role: "option",
1040
+ "aria-selected": g === v,
1041
+ children: m(g)
1042
+ },
1043
+ g
1044
+ )) })
1045
+ ] });
1046
+ }
1047
+ function ce({ styles: t, onLinkClick: n }) {
1048
+ const { i18n: a } = R(), o = Y(), { config: l } = W(), [s, u] = L(() => {
1049
+ const c = a.language;
1050
+ return te(l.navigationData, c).reduce(
1051
+ (_, b, y) => {
1052
+ if (Q(b)) {
1053
+ const S = l.navigationData[y], h = Q(S) && S.defaultOpen === !0;
1054
+ _[b.title] = h;
1055
+ }
1056
+ return _;
1057
+ },
1058
+ {}
1059
+ );
1060
+ }), r = a.language, p = te(
1061
+ l.navigationData,
1062
+ r
1063
+ );
1064
+ P(() => {
1065
+ const f = te(
1066
+ l.navigationData,
1067
+ r
1068
+ ).reduce(
1069
+ (_, b, y) => {
1070
+ if (Q(b)) {
1071
+ const S = l.navigationData[y], h = Q(S) && S.defaultOpen === !0;
1072
+ _[b.title] = h;
1073
+ }
1074
+ return _;
1075
+ },
1076
+ {}
1077
+ );
1078
+ u(f);
1079
+ }, [r, l.navigationData]);
1080
+ const v = (c) => {
1081
+ u((f) => ({
1082
+ ...f,
1083
+ [c]: !f[c]
1084
+ }));
1085
+ }, $ = (c) => {
1086
+ const f = o.pathname.split("/").filter(Boolean);
1087
+ return f[f.length - 1] === c;
1088
+ }, m = (c) => {
1089
+ const f = o.pathname.split("/").filter(Boolean);
1090
+ return f[0] && l.supportedLanguages.includes(f[0]) ? `/${f[0]}/${c}` : `/${r}/${c}`;
1091
+ }, g = () => {
1092
+ n == null || n();
1093
+ };
1094
+ return /* @__PURE__ */ e("div", { className: t.navigation, children: p.map((c) => Q(c) ? /* @__PURE__ */ d("div", { className: t.section, children: [
1095
+ /* @__PURE__ */ d(
1096
+ "button",
1097
+ {
1098
+ type: "button",
1099
+ className: `${t.sectionButton} ${s[c.title] ? t.expanded : ""}`,
1100
+ onClick: () => v(c.title),
1101
+ children: [
1102
+ c.title,
1103
+ /* @__PURE__ */ e(Le, { className: t.icon })
1104
+ ]
1105
+ }
1106
+ ),
1107
+ s[c.title] && /* @__PURE__ */ e("div", { className: t.sectionItems, children: c.items.map((f) => /* @__PURE__ */ e(
1108
+ ie,
1109
+ {
1110
+ to: m(f.slug),
1111
+ className: `${t.navItem} ${$(f.slug) ? t.active : ""}`,
1112
+ onClick: g,
1113
+ children: /* @__PURE__ */ e("div", { className: t.navItemContent, children: /* @__PURE__ */ e("span", { className: t.navItemTitle, children: f.title }) })
1114
+ },
1115
+ f.slug
1116
+ )) })
1117
+ ] }, c.title) : /* @__PURE__ */ e(
1118
+ ie,
1119
+ {
1120
+ to: m(c.slug),
1121
+ className: `${t.navItem} ${$(c.slug) ? t.active : ""}`,
1122
+ onClick: g,
1123
+ children: /* @__PURE__ */ e("div", { className: t.navItemContent, children: /* @__PURE__ */ e("span", { className: t.navItemTitle, children: c.title }) })
1124
+ },
1125
+ c.slug
1126
+ )) });
1127
+ }
1128
+ function Mo({
1129
+ styles: t,
1130
+ onLinkClick: n,
1131
+ onLanguageChange: a
1132
+ }) {
1133
+ return /* @__PURE__ */ d(U, { children: [
1134
+ /* @__PURE__ */ e(se, { styles: t, onLanguageChange: a }),
1135
+ /* @__PURE__ */ e(ce, { styles: t, onLinkClick: n })
1136
+ ] });
1137
+ }
1138
+ const bn = "_backdrop_17kcj_1", wn = "_open_17kcj_13", Nn = "_mobileMenu_17kcj_18", $n = "_header_17kcj_37", In = "_brand_17kcj_46", kn = "_cloudIcon_17kcj_53", Cn = "_title_17kcj_62", xn = "_closeButton_17kcj_69", yn = "_closeIcon_17kcj_101", Tn = "_languageSection_17kcj_106", Ln = "_languageSelect_17kcj_112", Sn = "_languageButton_17kcj_117", Bn = "_icon_17kcj_156", Pn = "_chevron_17kcj_162", Mn = "_languageDropdown_17kcj_172", Dn = "_languageOption_17kcj_185", En = "_selected_17kcj_226", On = "_scrollArea_17kcj_231", Rn = "_navigation_17kcj_237", jn = "_section_17kcj_241", An = "_sectionButton_17kcj_245", Hn = "_expanded_17kcj_285", zn = "_sectionItems_17kcj_289", Wn = "_navItem_17kcj_297", Fn = "_active_17kcj_310", Kn = "_navItemContent_17kcj_316", Un = "_navItemTitle_17kcj_322", D = {
1139
+ backdrop: bn,
1140
+ open: wn,
1141
+ mobileMenu: Nn,
1142
+ header: $n,
1143
+ brand: In,
1144
+ cloudIcon: kn,
1145
+ title: Cn,
1146
+ closeButton: xn,
1147
+ closeIcon: yn,
1148
+ languageSection: Tn,
1149
+ languageSelect: Ln,
1150
+ languageButton: Sn,
1151
+ icon: Bn,
1152
+ chevron: Pn,
1153
+ languageDropdown: Mn,
1154
+ languageOption: Dn,
1155
+ selected: En,
1156
+ scrollArea: On,
1157
+ navigation: Rn,
1158
+ section: jn,
1159
+ sectionButton: An,
1160
+ expanded: Hn,
1161
+ sectionItems: zn,
1162
+ navItem: Wn,
1163
+ active: Fn,
1164
+ navItemContent: Kn,
1165
+ navItemTitle: Un
1166
+ };
1167
+ function qn({ isOpen: t, onClose: n }) {
1168
+ const { config: a } = W(), o = a.logo;
1169
+ return P(() => (t ? document.body.style.overflow = "hidden" : document.body.style.overflow = "unset", () => {
1170
+ document.body.style.overflow = "unset";
1171
+ }), [t]), P(() => {
1172
+ const l = (s) => {
1173
+ s.key === "Escape" && t && n();
1174
+ };
1175
+ return document.addEventListener("keydown", l), () => document.removeEventListener("keydown", l);
1176
+ }, [t, n]), /* @__PURE__ */ d(U, { children: [
1177
+ /* @__PURE__ */ e(
1178
+ "div",
1179
+ {
1180
+ className: `${D.backdrop} ${t ? D.open : ""}`,
1181
+ onClick: n
1182
+ }
1183
+ ),
1184
+ /* @__PURE__ */ d("div", { className: `${D.mobileMenu} ${t ? D.open : ""}`, children: [
1185
+ /* @__PURE__ */ d("div", { className: D.header, children: [
1186
+ /* @__PURE__ */ d("div", { className: D.brand, children: [
1187
+ o && /* @__PURE__ */ e(o, { className: D.cloudIcon }),
1188
+ /* @__PURE__ */ e("h1", { className: D.title, children: a.title })
1189
+ ] }),
1190
+ /* @__PURE__ */ e(
1191
+ "button",
1192
+ {
1193
+ type: "button",
1194
+ className: D.closeButton,
1195
+ onClick: n,
1196
+ "aria-label": "Close menu",
1197
+ children: /* @__PURE__ */ e(ae, { className: D.closeIcon })
1198
+ }
1199
+ )
1200
+ ] }),
1201
+ /* @__PURE__ */ e("div", { className: D.languageSection, children: /* @__PURE__ */ e(se, { styles: D, onLanguageChange: n }) }),
1202
+ /* @__PURE__ */ e("div", { className: D.scrollArea, children: /* @__PURE__ */ e(ce, { styles: D, onLinkClick: n }) })
1203
+ ] })
1204
+ ] });
1205
+ }
1206
+ const Gn = "_sidebar_1pfbz_1", Qn = "_header_1pfbz_17", Xn = "_brand_1pfbz_29", Yn = "_cloudIcon_1pfbz_35", Vn = "_title_1pfbz_44", Jn = "_languageSelect_1pfbz_52", Zn = "_languageButton_1pfbz_58", eo = "_icon_1pfbz_96", to = "_chevron_1pfbz_101", no = "_languageDropdown_1pfbz_111", oo = "_languageOption_1pfbz_125", ao = "_selected_1pfbz_144", so = "_scrollArea_1pfbz_149", co = "_navigation_1pfbz_155", ro = "_section_1pfbz_161", lo = "_sectionButton_1pfbz_167", io = "_expanded_1pfbz_210", uo = "_sectionItems_1pfbz_214", ho = "_navItem_1pfbz_222", mo = "_active_1pfbz_235", _o = "_navItemContent_1pfbz_240", H = {
1207
+ sidebar: Gn,
1208
+ header: Qn,
1209
+ brand: Xn,
1210
+ cloudIcon: Yn,
1211
+ title: Vn,
1212
+ languageSelect: Jn,
1213
+ languageButton: Zn,
1214
+ icon: eo,
1215
+ chevron: to,
1216
+ languageDropdown: no,
1217
+ languageOption: oo,
1218
+ selected: ao,
1219
+ scrollArea: so,
1220
+ navigation: co,
1221
+ section: ro,
1222
+ sectionButton: lo,
1223
+ expanded: io,
1224
+ sectionItems: uo,
1225
+ navItem: ho,
1226
+ active: mo,
1227
+ navItemContent: _o
1228
+ };
1229
+ function go() {
1230
+ const { config: t } = W(), n = t.logo;
1231
+ return /* @__PURE__ */ d("div", { className: H.sidebar, children: [
1232
+ /* @__PURE__ */ d("div", { className: H.header, children: [
1233
+ /* @__PURE__ */ d("div", { className: H.brand, children: [
1234
+ n && /* @__PURE__ */ e(n, { className: H.cloudIcon }),
1235
+ /* @__PURE__ */ e("h1", { className: H.title, children: t.title })
1236
+ ] }),
1237
+ /* @__PURE__ */ e(se, { styles: H })
1238
+ ] }),
1239
+ /* @__PURE__ */ e("div", { className: H.scrollArea, children: /* @__PURE__ */ e(ce, { styles: H }) })
1240
+ ] });
1241
+ }
1242
+ const po = "_app_1vinw_1", fo = "_layout_1vinw_9", vo = "_main_1vinw_15", bo = "_contentWrapper_1vinw_27", ee = {
1243
+ app: po,
1244
+ layout: fo,
1245
+ main: vo,
1246
+ contentWrapper: bo
1247
+ };
1248
+ function Do({ children: t }) {
1249
+ const { language: n } = ge(), { i18n: a } = R(), { config: o } = W(), [l, s] = L(!1);
1250
+ P(() => {
1251
+ n && o.supportedLanguages.includes(n) && a.changeLanguage(n);
1252
+ }, [n, a, o.supportedLanguages]);
1253
+ const u = () => {
1254
+ s(!l);
1255
+ }, r = () => {
1256
+ s(!1);
1257
+ };
1258
+ return !n || !o.supportedLanguages.includes(n) ? /* @__PURE__ */ e(Ie, { to: "/en/welcome", replace: !0 }) : /* @__PURE__ */ d("div", { className: ee.app, children: [
1259
+ /* @__PURE__ */ e(vn, { onMobileMenuToggle: u }),
1260
+ /* @__PURE__ */ e(qn, { isOpen: l, onClose: r }),
1261
+ /* @__PURE__ */ d("div", { className: ee.layout, children: [
1262
+ /* @__PURE__ */ e(go, {}),
1263
+ /* @__PURE__ */ e("main", { className: ee.main, children: /* @__PURE__ */ e("div", { className: ee.contentWrapper, children: t }) })
1264
+ ] })
1265
+ ] });
1266
+ }
1267
+ export {
1268
+ Re as AdvancedModeToggle,
1269
+ Bo as BlogProvider,
1270
+ Po as ContentPage,
1271
+ Do as DocumentationLayout,
1272
+ vn as Header,
1273
+ se as LanguageSelector,
1274
+ qn as MobileMenu,
1275
+ Mo as NavigationContent,
1276
+ ce as NavigationMenu,
1277
+ Vt as SearchBar,
1278
+ go as Sidebar,
1279
+ Ze as TableOfContents,
1280
+ ut as TagResultsModal,
1281
+ vt as Tags,
1282
+ So as createBlogUtils,
1283
+ fe as createContentLoaders,
1284
+ X as generateHeadingId,
1285
+ te as getNavigationData,
1286
+ W as useBlogConfig,
1287
+ we as useTheme
1288
+ };