@aiquants/markdown-explorer 0.8.0 → 0.10.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/CHANGELOG.md +17 -0
- package/README.md +6 -3
- package/dist/{EditSurface-CaS1O6Nt.js → EditSurface-1Jf0CG-f.js} +1 -1
- package/dist/{EditSurface-5nbW7NTP.cjs → EditSurface-B-l3Do_C.cjs} +1 -1
- package/dist/{ExplorerSplit-C9Y02nvj.js → ExplorerSplit-D0zf7Cr_.js} +2 -2
- package/dist/{ExplorerSplit-D60N3_X7.cjs → ExplorerSplit-WX8afxrQ.cjs} +1 -1
- package/dist/{MultiLayout-CqTyFZ_i.cjs → MultiLayout-Bq10p3a3.cjs} +1 -1
- package/dist/{MultiLayout-DBpUTcCQ.js → MultiLayout-Jy9BKofx.js} +4 -4
- package/dist/{NativeScrollBar-CiVlg2ob.js → NativeScrollBar-CyiyL47o.js} +1 -1
- package/dist/{NativeScrollBar-QlOtnddZ.cjs → NativeScrollBar-Dt6xH5Mb.cjs} +1 -1
- package/dist/{TreeLayout-bk-Ziybl.js → TreeLayout-8pRo1ANN.js} +3 -3
- package/dist/{TreeLayout-uwvAgr-t.cjs → TreeLayout-kVWFEKJD.cjs} +1 -1
- package/dist/core/labels.d.cts +3 -0
- package/dist/core/labels.d.ts +3 -0
- package/dist/dataRoute-8pyILcjL.cjs +1 -0
- package/dist/dataRoute-Csl1WBDz.js +278 -0
- package/dist/{index-etFEpIE_.js → index-CfcJEnrC.js} +1126 -1027
- package/dist/index-sNJrKoGN.cjs +13 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +14 -14
- package/dist/{location-DmzVAFvo.cjs → location-CRYkEWiC.cjs} +1 -1
- package/dist/{location-Q4sgRrUm.js → location-Dc1qNEGm.js} +1 -1
- package/dist/{merge-BR4jKpIc.cjs → merge-D0aGvFKC.cjs} +1 -1
- package/dist/{merge-DfI0ro2L.js → merge-SRCxtHk2.js} +1 -1
- package/dist/sanitizeWorker.cjs +1 -1
- package/dist/sanitizeWorker.js +1 -1
- package/dist/server.cjs +1 -1
- package/dist/server.js +632 -621
- package/docs/behavior/dom-hooks.md +2 -1
- package/docs/behavior/layout.md +3 -2
- package/docs/behavior/localization.md +1 -0
- package/docs/behavior/security.md +2 -1
- package/docs/behavior/url-contract.md +1 -0
- package/package.json +1 -1
- package/dist/dataRoute-CcZ8PK00.cjs +0 -1
- package/dist/dataRoute-D1vE1wFW.js +0 -270
- package/dist/index-Dlkzr6Zn.cjs +0 -13
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { jsxs as F, jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import { createContext as me, use as
|
|
4
|
-
import { useParams as
|
|
5
|
-
import { f as
|
|
6
|
-
import {
|
|
7
|
-
import { HostedScrollArea as vt, useMarkdownToolbarState as
|
|
8
|
-
import { SOURCE_LINES_ATTRIBUTE as
|
|
9
|
-
import { DEFAULT_CONTENT_ALIGN as
|
|
10
|
-
import { w as
|
|
11
|
-
const bt = Object.freeze(["en", "ja"]),
|
|
1
|
+
import { jsxs as F, jsx as a, Fragment as Ne } from "react/jsx-runtime";
|
|
2
|
+
import * as b from "react";
|
|
3
|
+
import { createContext as me, use as re, useMemo as U, useSyncExternalStore as te, useRef as B, useId as Oe, useLayoutEffect as V, useCallback as P, useEffect as ne, Component as Vt, Suspense as ge, lazy as tt, useState as I, useEffectEvent as ie } from "react";
|
|
4
|
+
import { useParams as Cn, useSearchParams as On, matchPath as An, useBlocker as Ln, useNavigate as Mn, Link as Nn, useHref as De, useLocation as Gt, useRevalidator as Dn } from "react-router";
|
|
5
|
+
import { f as $n, a as Kt, u as Pn, G as ke, e as pe, x as Fn, y as qn, z as ft, B as _n, D as mt, H as Bn, w as In, I as jn } from "./location-Dc1qNEGm.js";
|
|
6
|
+
import { C as Ee, i as Hn, F as zn, x as Y, w as Un, G as ht, y as He, H as Zn, I as Vn, J as Gn, K as Kn, L as Wn, f as Xn, N as pt, u as Yn, O as Jn, P as Qn, Q as er, A as tr, v as nr, R as rr, S as or, T as lr, t as gt } from "./dataRoute-Csl1WBDz.js";
|
|
7
|
+
import { HostedScrollArea as vt, useMarkdownToolbarState as ir, MarkdownViewer as Wt } from "@aiquants/markdown";
|
|
8
|
+
import { SOURCE_LINES_ATTRIBUTE as Xt, parseSourceLines as sr } from "@aiquants/markdown/source-lines";
|
|
9
|
+
import { DEFAULT_CONTENT_ALIGN as ar } from "@aiquants/markdown/viewer-settings";
|
|
10
|
+
import { w as Yt, r as Jt, a as cr, b as wt, s as ze, c as dr } from "./storage-BSthKLSG.js";
|
|
11
|
+
const bt = Object.freeze(["en", "ja"]), ur = "en", fr = Object.freeze({
|
|
12
12
|
panelMoved: Object.freeze(["title", "column", "position"]),
|
|
13
13
|
panelMoveUnavailable: Object.freeze(["title", "move"]),
|
|
14
14
|
panelDragStarted: Object.freeze(["title"]),
|
|
15
15
|
panelDragCancelled: Object.freeze(["title"]),
|
|
16
16
|
multiColumnRegion: Object.freeze(["column"])
|
|
17
|
-
}),
|
|
17
|
+
}), mr = /\{(\w+)\}/gu, Qt = {
|
|
18
18
|
explorerRegion: "Explorer",
|
|
19
19
|
sourceLabel: "Source",
|
|
20
20
|
refreshTreeLabel: "Refresh tree",
|
|
@@ -173,6 +173,9 @@ const bt = Object.freeze(["en", "ja"]), cr = "en", dr = Object.freeze({
|
|
|
173
173
|
imageZoomLevel: (e) => `${String(e)}%`,
|
|
174
174
|
openInNewTab: "Open in a new tab",
|
|
175
175
|
download: "Download",
|
|
176
|
+
copyText: "Copy the text",
|
|
177
|
+
copiedText: "Copied the text",
|
|
178
|
+
copyTextFailed: "Could not copy the text",
|
|
176
179
|
mediaUnsupported: "Your browser cannot play this file.",
|
|
177
180
|
fileNotShown: "This file cannot be shown here. Download it to open it.",
|
|
178
181
|
viewerLoading: "Loading data...",
|
|
@@ -239,7 +242,7 @@ const bt = Object.freeze(["en", "ja"]), cr = "en", dr = Object.freeze({
|
|
|
239
242
|
multiColumnEmpty: "This column is empty",
|
|
240
243
|
multiColumnRegion: "Column {column}",
|
|
241
244
|
panelDropHere: "Drop the panel here"
|
|
242
|
-
},
|
|
245
|
+
}, hr = {
|
|
243
246
|
explorerRegion: "エクスプローラー",
|
|
244
247
|
sourceLabel: "ソース",
|
|
245
248
|
refreshTreeLabel: "ツリーを更新",
|
|
@@ -398,6 +401,9 @@ const bt = Object.freeze(["en", "ja"]), cr = "en", dr = Object.freeze({
|
|
|
398
401
|
imageZoomLevel: (e) => `${String(e)}%`,
|
|
399
402
|
openInNewTab: "新しいタブで開く",
|
|
400
403
|
download: "ダウンロード",
|
|
404
|
+
copyText: "テキストをコピー",
|
|
405
|
+
copiedText: "テキストをコピーしました",
|
|
406
|
+
copyTextFailed: "テキストをコピーできませんでした",
|
|
401
407
|
mediaUnsupported: "このブラウザではこのファイルを再生できません。",
|
|
402
408
|
fileNotShown: "このファイルはここでは表示できません。ダウンロードして開いてください。",
|
|
403
409
|
viewerLoading: "データを読み込み中...",
|
|
@@ -464,24 +470,24 @@ const bt = Object.freeze(["en", "ja"]), cr = "en", dr = Object.freeze({
|
|
|
464
470
|
multiColumnEmpty: "この列は空です",
|
|
465
471
|
multiColumnRegion: "{column} 列目",
|
|
466
472
|
panelDropHere: "ここへパネルをドロップ"
|
|
467
|
-
},
|
|
468
|
-
en: Object.freeze(
|
|
469
|
-
ja: Object.freeze(
|
|
470
|
-
}),
|
|
471
|
-
if (e === void 0) return
|
|
473
|
+
}, pr = Object.freeze({
|
|
474
|
+
en: Object.freeze(Qt),
|
|
475
|
+
ja: Object.freeze(hr)
|
|
476
|
+
}), en = Object.freeze(Object.keys(Qt)), gr = new Set(en), vr = (e) => gr.has(e), Te = (e) => e === null ? "null" : typeof e == "string" ? JSON.stringify(e.length > 40 ? `${e.slice(0, 40)}…` : e) : typeof e == "function" ? "a function" : Array.isArray(e) ? "an array" : typeof e, tn = (e) => {
|
|
477
|
+
if (e === void 0) return ur;
|
|
472
478
|
if (bt.includes(e)) return e;
|
|
473
479
|
throw new RangeError(`[markdown-explorer] locale is the UI language (${bt.map((t) => JSON.stringify(t)).join(" or ")}), not a BCP 47 tag; got ${Te(e)}`);
|
|
474
480
|
}, Et = (e, t) => {
|
|
475
|
-
const n =
|
|
481
|
+
const n = pr[tn(e)];
|
|
476
482
|
if (t === void 0) return n;
|
|
477
483
|
if (t === null || typeof t != "object")
|
|
478
484
|
throw new RangeError(`[markdown-explorer] labels must be an object; got ${Te(t)}`);
|
|
479
|
-
if (
|
|
485
|
+
if (!$n(t))
|
|
480
486
|
throw new RangeError(`[markdown-explorer] labels must be a plain object; got ${Te(t)}`);
|
|
481
487
|
const r = t, o = { ...n };
|
|
482
488
|
for (const l of Object.keys(r)) {
|
|
483
|
-
if (!
|
|
484
|
-
throw new RangeError(`[markdown-explorer] labels.${l} is not a known label key; expected one of ${
|
|
489
|
+
if (!vr(l))
|
|
490
|
+
throw new RangeError(`[markdown-explorer] labels.${l} is not a known label key; expected one of ${en.join(", ")}`);
|
|
485
491
|
const i = r[l];
|
|
486
492
|
if (i === void 0) continue;
|
|
487
493
|
const d = typeof n[l];
|
|
@@ -489,35 +495,35 @@ const bt = Object.freeze(["en", "ja"]), cr = "en", dr = Object.freeze({
|
|
|
489
495
|
throw new TypeError(`[markdown-explorer] labels.${l} must be a ${d}; got ${Te(i)}`);
|
|
490
496
|
if (typeof i == "string" && i.trim() === "")
|
|
491
497
|
throw new RangeError(`[markdown-explorer] labels.${l} must be a non-blank string`);
|
|
492
|
-
const
|
|
493
|
-
if (typeof i == "string" &&
|
|
494
|
-
for (const [, f] of i.matchAll(
|
|
495
|
-
if (!
|
|
496
|
-
throw new RangeError(`[markdown-explorer] labels.${l} uses the unknown placeholder {${String(f)}}; it accepts ${
|
|
498
|
+
const g = fr[l];
|
|
499
|
+
if (typeof i == "string" && g !== void 0) {
|
|
500
|
+
for (const [, f] of i.matchAll(mr))
|
|
501
|
+
if (!g.includes(f ?? ""))
|
|
502
|
+
throw new RangeError(`[markdown-explorer] labels.${l} uses the unknown placeholder {${String(f)}}; it accepts ${g.map((u) => `{${u}}`).join(", ")}`);
|
|
497
503
|
}
|
|
498
504
|
o[l] = i;
|
|
499
505
|
}
|
|
500
506
|
return Object.freeze(o);
|
|
501
|
-
},
|
|
507
|
+
}, wr = (e, t) => {
|
|
502
508
|
if (Object.is(e, t)) return !0;
|
|
503
509
|
if (e === null || t === null || typeof e != "object" || typeof t != "object") return !1;
|
|
504
510
|
const n = e, r = t, o = Object.keys(n), l = Object.keys(r);
|
|
505
511
|
return o.length === l.length && l.every((i) => Object.hasOwn(n, i) && Object.is(n[i], r[i]));
|
|
506
|
-
}, yt = Object.freeze(["light", "dark"]),
|
|
512
|
+
}, yt = Object.freeze(["light", "dark"]), br = (e) => {
|
|
507
513
|
if (e === void 0) return "light";
|
|
508
514
|
if (yt.includes(e)) return e;
|
|
509
515
|
throw new RangeError(`[markdown-explorer] theme must be ${yt.map((t) => JSON.stringify(t)).join(" or ")}; got ${typeof e == "string" ? JSON.stringify(e) : typeof e}`);
|
|
510
|
-
},
|
|
511
|
-
const e =
|
|
516
|
+
}, nn = me(null), D = () => {
|
|
517
|
+
const e = re(nn);
|
|
512
518
|
if (e === null) throw new Error("[markdown-explorer] explorer components must be rendered inside <MarkdownExplorer>");
|
|
513
519
|
return e;
|
|
514
520
|
}, Ae = (e) => {
|
|
515
521
|
const { viewSettings: t } = D(), n = () => e(t.getSnapshot());
|
|
516
522
|
return te(t.subscribe, n, n);
|
|
517
523
|
}, nt = () => {
|
|
518
|
-
const { config: e } = D(), t =
|
|
519
|
-
return U(() =>
|
|
520
|
-
},
|
|
524
|
+
const { config: e } = D(), t = Cn()["*"], [n] = On(), r = n.toString();
|
|
525
|
+
return U(() => Kt(e, t, new URLSearchParams(r)), [e, t, r]);
|
|
526
|
+
}, rn = {
|
|
521
527
|
unauthorized: ["failureUnauthorizedTitle", "failureUnauthorizedBody"],
|
|
522
528
|
forbidden: ["failureForbiddenTitle", "failureForbiddenBody"],
|
|
523
529
|
"not-found": ["failureNotFoundTitle", "failureNotFoundBody"],
|
|
@@ -526,14 +532,14 @@ const bt = Object.freeze(["en", "ja"]), cr = "en", dr = Object.freeze({
|
|
|
526
532
|
"too-large": ["failureTooLargeTitle", "failureTooLargeBody"],
|
|
527
533
|
unsupported: ["failureUnsupportedTitle", "failureUnsupportedBody"],
|
|
528
534
|
failed: ["failureFailedTitle", "failureFailedBody"]
|
|
529
|
-
}, ae = (e, t) => e[
|
|
530
|
-
const { labels: o } = D(), l = ae(o, e.reason), i = o[
|
|
535
|
+
}, ae = (e, t) => e[rn[t][0]], ve = ({ failure: e, alert: t, onRetry: n, testId: r }) => {
|
|
536
|
+
const { labels: o } = D(), l = ae(o, e.reason), i = o[rn[e.reason][1]], d = e.reason === "unauthorized" || e.reason === "forbidden" || e.reason === "failed" ? "danger" : "warning";
|
|
531
537
|
return /* @__PURE__ */ F("div", { className: "aqmx-callout", role: t ? "alert" : void 0, "data-aqmx-tone": d, "data-testid": r === null ? void 0 : r, "data-aqmx-failure": r === null ? void 0 : e.reason, children: [
|
|
532
|
-
/* @__PURE__ */
|
|
533
|
-
/* @__PURE__ */
|
|
534
|
-
e.reason === "unauthorized" ? /* @__PURE__ */
|
|
538
|
+
/* @__PURE__ */ a("p", { className: "aqmx-callout-title", children: l }),
|
|
539
|
+
/* @__PURE__ */ a("p", { className: "aqmx-callout-body", children: i }),
|
|
540
|
+
e.reason === "unauthorized" ? /* @__PURE__ */ a("button", { type: "button", className: "aqmx-callout-action", onClick: () => window.location.reload(), children: o.reloadPage }) : n !== void 0 && e.reason === "failed" ? /* @__PURE__ */ a("button", { type: "button", className: "aqmx-callout-action", onClick: n, children: o.retry }) : null
|
|
535
541
|
] });
|
|
536
|
-
},
|
|
542
|
+
}, Er = (e, t) => {
|
|
537
543
|
const { phase: n, save: r, dirty: o } = t;
|
|
538
544
|
switch (n.kind) {
|
|
539
545
|
case "opening":
|
|
@@ -557,7 +563,7 @@ const bt = Object.freeze(["en", "ja"]), cr = "en", dr = Object.freeze({
|
|
|
557
563
|
break;
|
|
558
564
|
}
|
|
559
565
|
return o ? e.draftUnsaved : "";
|
|
560
|
-
},
|
|
566
|
+
}, yr = (e, t, n) => {
|
|
561
567
|
switch (t.kind) {
|
|
562
568
|
case "saved":
|
|
563
569
|
return t.merged ? e.documentSavedMerged(n) : e.documentSaved(n);
|
|
@@ -581,108 +587,108 @@ const bt = Object.freeze(["en", "ja"]), cr = "en", dr = Object.freeze({
|
|
|
581
587
|
for (const t of [...e]) t();
|
|
582
588
|
}
|
|
583
589
|
};
|
|
584
|
-
},
|
|
585
|
-
`)),
|
|
590
|
+
}, xr = "<<<<<<<", kr = "=======", Sr = ">>>>>>>", xt = (e, t) => e === t || e.startsWith(`${t} `), kt = (e) => Rr(e.split(`
|
|
591
|
+
`)), Rr = (e) => {
|
|
586
592
|
const t = [];
|
|
587
593
|
let n = null, r = null, o = 0;
|
|
588
594
|
for (const l of e) {
|
|
589
595
|
o += 1;
|
|
590
596
|
const i = l.charCodeAt(0);
|
|
591
|
-
i !== 60 && i !== 61 && i !== 62 || (
|
|
597
|
+
i !== 60 && i !== 61 && i !== 62 || (xt(l, xr) ? (n = o, r = null) : l === kr ? n !== null && r === null ? r = o : n = null : xt(l, Sr) && (n !== null && r !== null && t.push({ start: n, separator: r, end: o }), n = null, r = null));
|
|
592
598
|
}
|
|
593
599
|
return t;
|
|
594
|
-
},
|
|
600
|
+
}, St = (e) => e.includes(`\r
|
|
595
601
|
`) ? `\r
|
|
596
602
|
` : `
|
|
597
603
|
`, Ue = (e) => e.replace(/\r\n?/gu, `
|
|
598
|
-
`),
|
|
604
|
+
`), Tr = (e, t) => t === `
|
|
599
605
|
` ? e : e.replaceAll(`
|
|
600
606
|
`, `\r
|
|
601
|
-
`),
|
|
602
|
-
const o = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map(),
|
|
603
|
-
let u = null,
|
|
604
|
-
const m = (s,
|
|
605
|
-
s.value = { ...s.value, ...
|
|
606
|
-
},
|
|
607
|
-
|
|
608
|
-
const { signal: h } =
|
|
609
|
-
m(
|
|
607
|
+
`), Cr = 3, Ze = Object.freeze({ kind: "idle" }), Or = ({ data: e, conflictLabels: t, onSaveSettled: n, previewSetting: r }) => {
|
|
608
|
+
const o = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map(), f = ye();
|
|
609
|
+
let u = null, p = null;
|
|
610
|
+
const m = (s, c) => {
|
|
611
|
+
s.value = { ...s.value, ...c }, f.emit();
|
|
612
|
+
}, x = (s, c) => o.get(s) === c, O = async (s, c) => {
|
|
613
|
+
c.controller.abort(), c.controller = new AbortController();
|
|
614
|
+
const { signal: h } = c.controller;
|
|
615
|
+
m(c, { phase: { kind: "opening" } });
|
|
610
616
|
const w = await e.edit(s, h);
|
|
611
|
-
if (!
|
|
617
|
+
if (!x(s, c) || h.aborted || !("kind" in w)) return;
|
|
612
618
|
if (w.kind === "grant") {
|
|
613
|
-
m(
|
|
619
|
+
m(c, { phase: { kind: "grant", href: w.href } });
|
|
614
620
|
return;
|
|
615
621
|
}
|
|
616
622
|
if (w.kind === "failure") {
|
|
617
|
-
m(
|
|
623
|
+
m(c, { phase: { kind: "failed", failure: w.failure } });
|
|
618
624
|
return;
|
|
619
625
|
}
|
|
620
|
-
const
|
|
621
|
-
|
|
622
|
-
},
|
|
623
|
-
const
|
|
624
|
-
|
|
625
|
-
}, T = (s,
|
|
626
|
-
s.get(
|
|
627
|
-
}),
|
|
628
|
-
m(
|
|
626
|
+
const k = Ue(w.text);
|
|
627
|
+
c.base = { text: k, version: w.version }, c.draft = k, c.ending = St(w.text), m(c, { phase: { kind: "editing" }, history: w.history, dirty: !1, save: Ze, generation: c.value.generation + 1 });
|
|
628
|
+
}, y = (s) => {
|
|
629
|
+
const c = o.get(s);
|
|
630
|
+
c !== void 0 && (c.controller.abort(), o.delete(s), i.delete(s));
|
|
631
|
+
}, T = (s, c, h) => (s.set(c, h), () => {
|
|
632
|
+
s.get(c) === h && s.delete(c);
|
|
633
|
+
}), S = (s, c, h, w = {}) => {
|
|
634
|
+
m(c, { ...w, save: h }), n(s, h);
|
|
629
635
|
}, M = async (s) => {
|
|
630
636
|
d.get(s)?.flush();
|
|
631
|
-
const
|
|
632
|
-
if (
|
|
633
|
-
const h =
|
|
637
|
+
const c = o.get(s);
|
|
638
|
+
if (c === void 0 || c.value.phase.kind !== "editing" || c.base === null || c.value.save.kind === "saving") return;
|
|
639
|
+
const h = kt(c.draft).length;
|
|
634
640
|
if (h > 0) {
|
|
635
|
-
|
|
641
|
+
S(s, c, { kind: "conflicts", count: h });
|
|
636
642
|
return;
|
|
637
643
|
}
|
|
638
|
-
|
|
639
|
-
const { signal: w } =
|
|
640
|
-
let
|
|
641
|
-
m(
|
|
642
|
-
for (let N = 0; N <
|
|
643
|
-
const q = await e.save(s,
|
|
644
|
-
if (!
|
|
644
|
+
c.controller.abort(), c.controller = new AbortController();
|
|
645
|
+
const { signal: w } = c.controller;
|
|
646
|
+
let k = c.base, L = c.draft, R = !1;
|
|
647
|
+
m(c, { save: { kind: "saving" } });
|
|
648
|
+
for (let N = 0; N < Cr; N += 1) {
|
|
649
|
+
const q = await e.save(s, k.version, Tr(L, c.ending), w);
|
|
650
|
+
if (!x(s, c) || w.aborted || !("kind" in q)) return;
|
|
645
651
|
if (q.kind === "saved") {
|
|
646
|
-
d.get(s)?.flush(),
|
|
652
|
+
d.get(s)?.flush(), c.base = { text: L, version: q.version }, S(s, c, { kind: "saved", merged: R }, { dirty: c.draft !== L });
|
|
647
653
|
return;
|
|
648
654
|
}
|
|
649
655
|
if (q.kind === "grant") {
|
|
650
|
-
|
|
656
|
+
S(s, c, { kind: "grant", href: q.href });
|
|
651
657
|
return;
|
|
652
658
|
}
|
|
653
659
|
if (q.kind === "failure") {
|
|
654
|
-
|
|
660
|
+
S(s, c, { kind: "failed", failure: q.failure });
|
|
655
661
|
return;
|
|
656
662
|
}
|
|
657
|
-
const { mergeDraft: W } = await import("./merge-
|
|
658
|
-
if (!
|
|
663
|
+
const { mergeDraft: W } = await import("./merge-SRCxtHk2.js");
|
|
664
|
+
if (!x(s, c) || w.aborted) return;
|
|
659
665
|
const J = d.get(s);
|
|
660
666
|
J?.flush();
|
|
661
|
-
const ee = Ue(q.text), X = W(
|
|
662
|
-
if (
|
|
663
|
-
|
|
667
|
+
const ee = Ue(q.text), X = W(k.text, c.draft, ee, t());
|
|
668
|
+
if (k = { text: ee, version: q.version }, c.base = k, c.ending = St(q.text), c.draft = X.text, J?.adopt(X.text), X.kind === "conflicts") {
|
|
669
|
+
S(s, c, { kind: "conflicts", count: X.conflicts }, { dirty: !0, generation: c.value.generation + 1 });
|
|
664
670
|
return;
|
|
665
671
|
}
|
|
666
|
-
if (R = !0, L = X.text, L ===
|
|
667
|
-
|
|
672
|
+
if (R = !0, L = X.text, L === k.text) {
|
|
673
|
+
S(s, c, { kind: "saved", merged: R }, { dirty: !1, generation: c.value.generation + 1 });
|
|
668
674
|
return;
|
|
669
675
|
}
|
|
670
|
-
m(
|
|
676
|
+
m(c, { dirty: !0, generation: c.value.generation + 1 });
|
|
671
677
|
}
|
|
672
|
-
|
|
678
|
+
S(s, c, { kind: "failed", failure: { reason: "failed" } });
|
|
673
679
|
};
|
|
674
680
|
return {
|
|
675
681
|
session: (s) => o.get(s)?.value,
|
|
676
682
|
subscribe: f.subscribe,
|
|
677
|
-
start: (s,
|
|
683
|
+
start: (s, c) => {
|
|
678
684
|
const h = o.get(s);
|
|
679
685
|
if (h !== void 0) {
|
|
680
|
-
m(h, { request: { anchor:
|
|
686
|
+
m(h, { request: { anchor: c } }), (h.value.phase.kind === "failed" || h.value.phase.kind === "grant") && O(s, h);
|
|
681
687
|
return;
|
|
682
688
|
}
|
|
683
689
|
l.delete(s);
|
|
684
690
|
const w = {
|
|
685
|
-
value: { path: s, phase: { kind: "opening" }, history: !1, dirty: !1, save: Ze, generation: 0, request: { anchor:
|
|
691
|
+
value: { path: s, phase: { kind: "opening" }, history: !1, dirty: !1, save: Ze, generation: 0, request: { anchor: c } },
|
|
686
692
|
base: null,
|
|
687
693
|
draft: "",
|
|
688
694
|
ending: `
|
|
@@ -692,64 +698,64 @@ const bt = Object.freeze(["en", "ja"]), cr = "en", dr = Object.freeze({
|
|
|
692
698
|
o.set(s, w), O(s, w);
|
|
693
699
|
},
|
|
694
700
|
retry: (s) => {
|
|
695
|
-
const
|
|
696
|
-
|
|
701
|
+
const c = o.get(s);
|
|
702
|
+
c === void 0 || c.value.phase.kind === "editing" || O(s, c);
|
|
697
703
|
},
|
|
698
704
|
draft: (s) => {
|
|
699
|
-
const
|
|
700
|
-
return
|
|
705
|
+
const c = o.get(s);
|
|
706
|
+
return c === void 0 || c.base === null ? null : c.draft;
|
|
701
707
|
},
|
|
702
|
-
setDraft: (s,
|
|
708
|
+
setDraft: (s, c) => {
|
|
703
709
|
const h = o.get(s);
|
|
704
710
|
if (h === void 0 || h.base === null) return;
|
|
705
|
-
h.draft =
|
|
706
|
-
const w = {},
|
|
707
|
-
|
|
711
|
+
h.draft = c;
|
|
712
|
+
const w = {}, k = c !== h.base.text;
|
|
713
|
+
k !== h.value.dirty && (w.dirty = k);
|
|
708
714
|
const { save: L } = h.value;
|
|
709
715
|
if (L.kind === "conflicts") {
|
|
710
|
-
const R =
|
|
716
|
+
const R = kt(c).length;
|
|
711
717
|
R === 0 ? w.save = Ze : R !== L.count && (w.save = { kind: "conflicts", count: R });
|
|
712
718
|
}
|
|
713
719
|
(w.dirty !== void 0 || w.save !== void 0) && m(h, w);
|
|
714
720
|
},
|
|
715
721
|
consumeRequest: (s) => {
|
|
716
|
-
const
|
|
717
|
-
|
|
722
|
+
const c = o.get(s);
|
|
723
|
+
c !== void 0 && c.value.request !== null && m(c, { request: null });
|
|
718
724
|
},
|
|
719
725
|
save: M,
|
|
720
|
-
replaceDraft: (s,
|
|
726
|
+
replaceDraft: (s, c) => {
|
|
721
727
|
const h = d.get(s);
|
|
722
728
|
h?.flush();
|
|
723
729
|
const w = o.get(s);
|
|
724
730
|
if (w === void 0 || w.base === null) return;
|
|
725
|
-
const
|
|
726
|
-
w.draft =
|
|
731
|
+
const k = Ue(c);
|
|
732
|
+
w.draft = k, h?.adopt(k), m(w, { dirty: k !== w.base.text, generation: w.value.generation + 1 });
|
|
727
733
|
},
|
|
728
734
|
close: (s) => {
|
|
729
735
|
if (!o.has(s)) return;
|
|
730
|
-
const
|
|
731
|
-
|
|
736
|
+
const c = d.get(s), h = c === void 0 ? null : c.returnPoint();
|
|
737
|
+
y(s), h === null ? l.delete(s) : l.set(s, h), f.emit();
|
|
732
738
|
},
|
|
733
739
|
takeReturn: (s) => {
|
|
734
|
-
const
|
|
735
|
-
return l.delete(s),
|
|
740
|
+
const c = l.get(s) ?? null;
|
|
741
|
+
return l.delete(s), c;
|
|
736
742
|
},
|
|
737
743
|
dirtyPaths: () => [...o.values()].filter((s) => s.value.dirty).map((s) => s.value.path),
|
|
738
744
|
discard: (s) => {
|
|
739
|
-
for (const
|
|
745
|
+
for (const c of s) y(c);
|
|
740
746
|
s.length > 0 && f.emit();
|
|
741
747
|
},
|
|
742
748
|
editorState: {
|
|
743
749
|
get: (s) => i.get(s),
|
|
744
|
-
set: (s,
|
|
745
|
-
o.has(s) && i.set(s,
|
|
750
|
+
set: (s, c) => {
|
|
751
|
+
o.has(s) && i.set(s, c);
|
|
746
752
|
}
|
|
747
753
|
},
|
|
748
|
-
bindEditor: (s,
|
|
749
|
-
bindView: (s,
|
|
754
|
+
bindEditor: (s, c) => T(d, s, c),
|
|
755
|
+
bindView: (s, c) => T(g, s, c),
|
|
750
756
|
viewAnchor: (s) => {
|
|
751
|
-
const
|
|
752
|
-
return
|
|
757
|
+
const c = g.get(s);
|
|
758
|
+
return c === void 0 ? null : c.anchor();
|
|
753
759
|
},
|
|
754
760
|
flush: (s) => d.get(s)?.flush(),
|
|
755
761
|
flushDrafts: () => {
|
|
@@ -758,55 +764,55 @@ const bt = Object.freeze(["en", "ja"]), cr = "en", dr = Object.freeze({
|
|
|
758
764
|
nextConflict: (s) => d.get(s)?.nextConflict() === !0,
|
|
759
765
|
hasSessions: () => o.size > 0,
|
|
760
766
|
unsavedAmong: (s) => {
|
|
761
|
-
for (const
|
|
762
|
-
return s.filter((
|
|
767
|
+
for (const c of d.values()) c.flush();
|
|
768
|
+
return s.filter((c) => o.get(c)?.value.dirty === !0);
|
|
763
769
|
},
|
|
764
|
-
askToDiscard: (s) => new Promise((
|
|
765
|
-
|
|
770
|
+
askToDiscard: (s) => new Promise((c) => {
|
|
771
|
+
p?.settle(!1);
|
|
766
772
|
const h = {
|
|
767
773
|
paths: s,
|
|
768
774
|
settle: (w) => {
|
|
769
|
-
if (
|
|
770
|
-
if (
|
|
771
|
-
f.emit(),
|
|
775
|
+
if (p === h) {
|
|
776
|
+
if (p = null, w) for (const k of s) y(k);
|
|
777
|
+
f.emit(), c(w);
|
|
772
778
|
}
|
|
773
779
|
}
|
|
774
780
|
};
|
|
775
|
-
|
|
781
|
+
p = h, f.emit();
|
|
776
782
|
}),
|
|
777
|
-
discardRequest: () =>
|
|
783
|
+
discardRequest: () => p,
|
|
778
784
|
previewShown: () => (u ??= r.read(), u),
|
|
779
785
|
setPreviewShown: (s) => {
|
|
780
786
|
u !== s && (u = s, r.write(s), f.emit());
|
|
781
787
|
}
|
|
782
788
|
};
|
|
783
|
-
},
|
|
789
|
+
}, on = (e) => {
|
|
784
790
|
e.preventDefault(), e.stopPropagation();
|
|
785
|
-
},
|
|
786
|
-
const
|
|
791
|
+
}, ln = ({ open: e, title: t, body: n, confirmLabel: r, cancelLabel: o, onConfirm: l, onCancel: i, testId: d }) => {
|
|
792
|
+
const g = B(null), f = B(null), u = B(null), p = Oe(), m = Oe();
|
|
787
793
|
return V(() => {
|
|
788
|
-
const
|
|
789
|
-
if (
|
|
790
|
-
if (e && !
|
|
791
|
-
const T =
|
|
792
|
-
u.current = T instanceof HTMLElement ? T : null,
|
|
793
|
-
} else !e &&
|
|
794
|
-
}, [e]), /* @__PURE__ */
|
|
795
|
-
|
|
796
|
-
}, onClick: (
|
|
797
|
-
|
|
798
|
-
}, onCancel: (
|
|
799
|
-
/* @__PURE__ */
|
|
800
|
-
/* @__PURE__ */
|
|
794
|
+
const y = g.current;
|
|
795
|
+
if (y !== null)
|
|
796
|
+
if (e && !y.open) {
|
|
797
|
+
const T = y.ownerDocument.activeElement;
|
|
798
|
+
u.current = T instanceof HTMLElement ? T : null, y.showModal(), f.current?.focus();
|
|
799
|
+
} else !e && y.open && (y.close(), u.current?.isConnected === !0 && u.current.focus(), u.current = null);
|
|
800
|
+
}, [e]), /* @__PURE__ */ a("dialog", { ref: g, className: "aqmx-confirm", "aria-labelledby": p, "aria-describedby": m, "data-testid": d, onKeyDown: (y) => {
|
|
801
|
+
y.key !== "Escape" || y.defaultPrevented || (on(y), i());
|
|
802
|
+
}, onClick: (y) => {
|
|
803
|
+
y.target === y.currentTarget && i();
|
|
804
|
+
}, onCancel: (y) => y.preventDefault(), children: /* @__PURE__ */ F("div", { className: "aqmx-confirm-panel", children: [
|
|
805
|
+
/* @__PURE__ */ a("p", { id: p, className: "aqmx-confirm-title", children: t }),
|
|
806
|
+
/* @__PURE__ */ a("p", { id: m, className: "aqmx-confirm-body", children: n }),
|
|
801
807
|
/* @__PURE__ */ F("div", { className: "aqmx-confirm-actions", children: [
|
|
802
|
-
/* @__PURE__ */
|
|
803
|
-
/* @__PURE__ */
|
|
808
|
+
/* @__PURE__ */ a("button", { ref: f, type: "button", className: "aqmx-callout-action", "data-testid": `${d}-cancel`, onClick: i, children: o }),
|
|
809
|
+
/* @__PURE__ */ a("button", { type: "button", className: "aqmx-callout-action", "data-aqmx-tone": "danger", "data-testid": `${d}-confirm`, onClick: l, children: r })
|
|
804
810
|
] })
|
|
805
811
|
] }) });
|
|
806
|
-
},
|
|
807
|
-
const n =
|
|
812
|
+
}, Ar = (e, t) => {
|
|
813
|
+
const n = An({ path: `${e.basePath}/*`, end: !0 }, t.pathname);
|
|
808
814
|
if (n === null) return /* @__PURE__ */ new Set();
|
|
809
|
-
const { location: r } =
|
|
815
|
+
const { location: r } = Kt(e, n.params["*"], new URLSearchParams(t.search));
|
|
810
816
|
switch (r.view) {
|
|
811
817
|
case "tree":
|
|
812
818
|
return new Set(r.doc === null ? [] : [r.doc]);
|
|
@@ -815,36 +821,36 @@ const bt = Object.freeze(["en", "ja"]), cr = "en", dr = Object.freeze({
|
|
|
815
821
|
case "multi":
|
|
816
822
|
return new Set(r.docs);
|
|
817
823
|
}
|
|
818
|
-
},
|
|
824
|
+
}, sn = (e) => {
|
|
819
825
|
const { edits: t } = D(), n = P(() => t.session(e), [t, e]);
|
|
820
|
-
return te(t.subscribe, n,
|
|
821
|
-
},
|
|
822
|
-
},
|
|
826
|
+
return te(t.subscribe, n, Lr);
|
|
827
|
+
}, an = () => !1, Lr = () => {
|
|
828
|
+
}, Mr = () => {
|
|
823
829
|
const { edits: e } = D();
|
|
824
|
-
return te(e.subscribe, e.hasSessions,
|
|
825
|
-
},
|
|
830
|
+
return te(e.subscribe, e.hasSessions, an);
|
|
831
|
+
}, Nr = () => {
|
|
826
832
|
const { edits: e } = D();
|
|
827
|
-
return te(e.subscribe, e.previewShown,
|
|
828
|
-
},
|
|
833
|
+
return te(e.subscribe, e.previewShown, an);
|
|
834
|
+
}, Dr = () => null, $r = () => {
|
|
829
835
|
const { edits: e, labels: t, config: n } = D(), r = B([]), o = P(
|
|
830
|
-
({ nextLocation:
|
|
831
|
-
const m =
|
|
832
|
-
return e.flushDrafts(), r.current = e.dirtyPaths().filter((
|
|
836
|
+
({ nextLocation: p }) => {
|
|
837
|
+
const m = Ar(n, p);
|
|
838
|
+
return e.flushDrafts(), r.current = e.dirtyPaths().filter((x) => !m.has(x)), r.current.length > 0;
|
|
833
839
|
},
|
|
834
840
|
[e, n]
|
|
835
|
-
), l =
|
|
836
|
-
|
|
841
|
+
), l = Ln(o), i = Mr();
|
|
842
|
+
ne(() => {
|
|
837
843
|
if (!i) return;
|
|
838
|
-
const
|
|
844
|
+
const p = (m) => {
|
|
839
845
|
e.flushDrafts(), e.dirtyPaths().length !== 0 && (m.preventDefault(), m.returnValue = !0);
|
|
840
846
|
};
|
|
841
|
-
return window.addEventListener("beforeunload",
|
|
847
|
+
return window.addEventListener("beforeunload", p), () => window.removeEventListener("beforeunload", p);
|
|
842
848
|
}, [i, e]);
|
|
843
|
-
const d = te(e.subscribe, e.discardRequest,
|
|
844
|
-
return /* @__PURE__ */
|
|
845
|
-
|
|
849
|
+
const d = te(e.subscribe, e.discardRequest, Dr), g = l.state === "blocked", u = (g ? r.current : d === null ? [] : d.paths).map((p) => Ee(p)).join(", ");
|
|
850
|
+
return /* @__PURE__ */ a(
|
|
851
|
+
ln,
|
|
846
852
|
{
|
|
847
|
-
open:
|
|
853
|
+
open: g || d !== null,
|
|
848
854
|
title: t.unsavedTitle,
|
|
849
855
|
body: t.unsavedBody(u),
|
|
850
856
|
confirmLabel: t.unsavedDiscard,
|
|
@@ -867,12 +873,12 @@ const bt = Object.freeze(["en", "ja"]), cr = "en", dr = Object.freeze({
|
|
|
867
873
|
}
|
|
868
874
|
);
|
|
869
875
|
};
|
|
870
|
-
function
|
|
876
|
+
function Pr({
|
|
871
877
|
title: e,
|
|
872
878
|
titleId: t,
|
|
873
879
|
...n
|
|
874
880
|
}, r) {
|
|
875
|
-
return /* @__PURE__ */
|
|
881
|
+
return /* @__PURE__ */ b.createElement("svg", Object.assign({
|
|
876
882
|
xmlns: "http://www.w3.org/2000/svg",
|
|
877
883
|
viewBox: "0 0 20 20",
|
|
878
884
|
fill: "currentColor",
|
|
@@ -880,26 +886,26 @@ function Dr({
|
|
|
880
886
|
"data-slot": "icon",
|
|
881
887
|
ref: r,
|
|
882
888
|
"aria-labelledby": t
|
|
883
|
-
}, n), e ? /* @__PURE__ */
|
|
889
|
+
}, n), e ? /* @__PURE__ */ b.createElement("title", {
|
|
884
890
|
id: t
|
|
885
|
-
}, e) : null, /* @__PURE__ */
|
|
891
|
+
}, e) : null, /* @__PURE__ */ b.createElement("path", {
|
|
886
892
|
fillRule: "evenodd",
|
|
887
893
|
d: "M4.5 2A1.5 1.5 0 0 0 3 3.5v13A1.5 1.5 0 0 0 4.5 18h11a1.5 1.5 0 0 0 1.5-1.5V7.621a1.5 1.5 0 0 0-.44-1.06l-4.12-4.122A1.5 1.5 0 0 0 11.378 2H4.5Zm2.25 8.5a.75.75 0 0 0 0 1.5h6.5a.75.75 0 0 0 0-1.5h-6.5Zm0 3a.75.75 0 0 0 0 1.5h6.5a.75.75 0 0 0 0-1.5h-6.5Z",
|
|
888
894
|
clipRule: "evenodd"
|
|
889
895
|
}));
|
|
890
896
|
}
|
|
891
|
-
const
|
|
897
|
+
const Fr = /* @__PURE__ */ b.forwardRef(Pr);
|
|
892
898
|
let Ve = null;
|
|
893
|
-
const
|
|
899
|
+
const cn = () => (Ve ??= import("./EditSurface-1Jf0CG-f.js").catch((e) => {
|
|
894
900
|
throw Ve = null, e;
|
|
895
901
|
}), Ve), Rt = () => {
|
|
896
|
-
|
|
902
|
+
cn().catch(() => {
|
|
897
903
|
});
|
|
898
|
-
},
|
|
899
|
-
const { default: t } =
|
|
900
|
-
return /* @__PURE__ */
|
|
904
|
+
}, qr = (e) => {
|
|
905
|
+
const { default: t } = re(cn());
|
|
906
|
+
return /* @__PURE__ */ a(t, { ...e });
|
|
901
907
|
};
|
|
902
|
-
class
|
|
908
|
+
class _r extends Vt {
|
|
903
909
|
state = { failed: !1 };
|
|
904
910
|
static getDerivedStateFromError() {
|
|
905
911
|
return { failed: !0 };
|
|
@@ -909,7 +915,7 @@ class Fr extends Zt {
|
|
|
909
915
|
return this.state.failed ? this.props.fallback(this.retry) : this.props.children;
|
|
910
916
|
}
|
|
911
917
|
}
|
|
912
|
-
const rt = `[${
|
|
918
|
+
const rt = `[${Xt}]`, Br = "[data-aqmd-content]", Ir = 'a[href], button, input, select, textarea, summary, label, [contenteditable], [role="menu"], iframe, video, audio, object, embed, svg', jr = 200, we = (e) => sr(e.getAttribute(Xt)), Hr = (e, t) => {
|
|
913
919
|
for (let r = e; r !== null && t.contains(r); r = r.parentElement) {
|
|
914
920
|
const o = we(r);
|
|
915
921
|
if (o !== null) return { block: r, lines: o, own: !0 };
|
|
@@ -921,69 +927,69 @@ const rt = `[${Wt}]`, qr = "[data-aqmd-content]", _r = 'a[href], button, input,
|
|
|
921
927
|
o !== null && (n = { block: r, lines: o });
|
|
922
928
|
}
|
|
923
929
|
return n === null ? null : { ...n, own: !1 };
|
|
924
|
-
},
|
|
930
|
+
}, zr = (e, t) => {
|
|
925
931
|
let n = 0;
|
|
926
932
|
for (let r = e.indexOf(t); r >= 0; r = e.indexOf(t, r + t.length)) n += 1;
|
|
927
933
|
return n;
|
|
928
|
-
},
|
|
929
|
-
const r =
|
|
934
|
+
}, Ur = (e) => e.closest(Br) !== null && e.closest(Ir) === null, Zr = (e, t, n) => {
|
|
935
|
+
const r = Hr(e, t);
|
|
930
936
|
if (r === null) return null;
|
|
931
937
|
const { block: o, own: l } = r;
|
|
932
938
|
if (!l) {
|
|
933
939
|
const d = r.lines.last + 1;
|
|
934
940
|
return { lines: { first: d, last: d }, word: null, occurrence: 0, clientTop: Le(e) };
|
|
935
941
|
}
|
|
936
|
-
const i =
|
|
942
|
+
const i = Wr(o, n);
|
|
937
943
|
return i === null ? { lines: r.lines, word: null, occurrence: 0, clientTop: Le(o) } : { lines: r.lines, word: i.text, occurrence: i.occurrence, clientTop: i.clientTop };
|
|
938
|
-
},
|
|
944
|
+
}, Vr = (e, t) => {
|
|
939
945
|
let n = null, r = null, o = null;
|
|
940
946
|
for (const i of e.querySelectorAll(rt)) {
|
|
941
947
|
const d = we(i);
|
|
942
948
|
if (d === null) continue;
|
|
943
|
-
n ??=
|
|
944
|
-
const { top:
|
|
945
|
-
|
|
949
|
+
n ??= Kr(t, i);
|
|
950
|
+
const { top: g, bottom: f } = i.getBoundingClientRect();
|
|
951
|
+
g <= n && n < f ? r = { lines: d, block: i } : o === null && g >= n && (o = { lines: d, block: i });
|
|
946
952
|
}
|
|
947
953
|
const l = r === null ? o : r;
|
|
948
954
|
return l === null ? null : { lines: l.lines, word: null, occurrence: 0, clientTop: Le(l.block) };
|
|
949
|
-
},
|
|
955
|
+
}, Gr = (e) => e === e.ownerDocument.scrollingElement ? 0 : e.getBoundingClientRect().top + e.clientTop, Kr = (e, t) => {
|
|
950
956
|
const n = Number.parseFloat(getComputedStyle(t).scrollMarginTop);
|
|
951
|
-
return
|
|
952
|
-
},
|
|
957
|
+
return Gr(e) + (Number.isFinite(n) ? n : 0);
|
|
958
|
+
}, Wr = (e, t) => {
|
|
953
959
|
if (t === null || t.rangeCount === 0) return null;
|
|
954
960
|
const n = t.getRangeAt(0);
|
|
955
961
|
if (!(e.contains(n.startContainer) && e.contains(n.endContainer))) return null;
|
|
956
962
|
const r = n.toString().trim();
|
|
957
|
-
if (r === "" || r.length >
|
|
963
|
+
if (r === "" || r.length > jr || /[\r\n]/u.test(r)) return null;
|
|
958
964
|
const o = e.ownerDocument.createRange();
|
|
959
|
-
return o.setStart(e, 0), o.setEnd(n.startContainer, n.startOffset), { text: r, occurrence:
|
|
960
|
-
},
|
|
965
|
+
return o.setStart(e, 0), o.setEnd(n.startContainer, n.startOffset), { text: r, occurrence: zr(o.toString(), r), clientTop: n.getBoundingClientRect().top };
|
|
966
|
+
}, ns = (e, t) => {
|
|
961
967
|
const n = e.split(`
|
|
962
968
|
`), r = Math.min(t.lines.first, n.length), o = Math.min(t.lines.last, n.length), l = { line: r, column: 0 };
|
|
963
969
|
if (t.word === null) return l;
|
|
964
970
|
let i = 0;
|
|
965
971
|
for (let d = r; d <= o; d += 1) {
|
|
966
|
-
const
|
|
967
|
-
for (let f =
|
|
972
|
+
const g = n[d - 1] ?? "";
|
|
973
|
+
for (let f = g.indexOf(t.word); f >= 0; f = g.indexOf(t.word, f + t.word.length)) {
|
|
968
974
|
if (i === t.occurrence) return { line: d, column: f };
|
|
969
975
|
i += 1;
|
|
970
976
|
}
|
|
971
977
|
}
|
|
972
|
-
return i > 0 ?
|
|
973
|
-
},
|
|
978
|
+
return i > 0 ? Xr(n, r, o, t.word) ?? l : l;
|
|
979
|
+
}, Xr = (e, t, n, r) => {
|
|
974
980
|
for (let o = n; o >= t; o -= 1) {
|
|
975
981
|
const l = (e[o - 1] ?? "").lastIndexOf(r);
|
|
976
982
|
if (l >= 0) return { line: o, column: l };
|
|
977
983
|
}
|
|
978
984
|
return null;
|
|
979
|
-
},
|
|
985
|
+
}, Yr = (e, t) => {
|
|
980
986
|
let n = null, r = null;
|
|
981
987
|
for (const o of e.querySelectorAll(rt)) {
|
|
982
988
|
const l = we(o);
|
|
983
989
|
l === null || l.first > t || (l.last >= t ? n = o : (r === null || l.last >= r.last) && (r = { element: o, last: l.last }));
|
|
984
990
|
}
|
|
985
991
|
return n !== null ? n : r === null ? null : r.element;
|
|
986
|
-
},
|
|
992
|
+
}, Jr = (e, t) => {
|
|
987
993
|
const { bottom: n } = e.getBoundingClientRect(), r = Le(e), o = we(e);
|
|
988
994
|
if (o === null) return r;
|
|
989
995
|
const l = Math.min(Math.max(t - o.first, 0) / (o.last - o.first + 1), 1);
|
|
@@ -1004,15 +1010,15 @@ const rt = `[${Wt}]`, qr = "[data-aqmd-content]", _r = 'a[href], button, input,
|
|
|
1004
1010
|
"switch-source": Object.freeze({ replace: !1, preventScrollReset: !0, defaultShouldRevalidate: !1 }),
|
|
1005
1011
|
"switch-view": Object.freeze({ replace: !1, preventScrollReset: !1, defaultShouldRevalidate: !1 }),
|
|
1006
1012
|
"follow-link": Object.freeze({ replace: !1, preventScrollReset: !1, defaultShouldRevalidate: !1 })
|
|
1007
|
-
}),
|
|
1008
|
-
const e =
|
|
1013
|
+
}), rs = (e) => ot[e], $e = () => {
|
|
1014
|
+
const e = Mn();
|
|
1009
1015
|
return P(
|
|
1010
1016
|
(t, n) => {
|
|
1011
1017
|
e(t, ot[n]);
|
|
1012
1018
|
},
|
|
1013
1019
|
[e]
|
|
1014
1020
|
);
|
|
1015
|
-
},
|
|
1021
|
+
}, Qr = ({ navigation: e, ...t }) => /* @__PURE__ */ a(Nn, { ...t, ...ot[e] }), dn = (e) => {
|
|
1016
1022
|
const t = e.ownerDocument;
|
|
1017
1023
|
if (e.focus({ preventScroll: !0 }), t.activeElement === e) return !0;
|
|
1018
1024
|
if (e.hasAttribute("tabindex")) return !1;
|
|
@@ -1022,11 +1028,11 @@ const rt = `[${Wt}]`, qr = "[data-aqmd-content]", _r = 'a[href], button, input,
|
|
|
1022
1028
|
t.activeElement !== e && (e.removeAttribute("tabindex"), e.removeEventListener("blur", n));
|
|
1023
1029
|
};
|
|
1024
1030
|
return e.addEventListener("blur", n), !0;
|
|
1025
|
-
},
|
|
1031
|
+
}, eo = (e, t) => {
|
|
1026
1032
|
const n = B(null), r = B(null), o = B(null), l = P(() => {
|
|
1027
1033
|
n.current !== null && window.clearTimeout(n.current), n.current = null, r.current = null;
|
|
1028
1034
|
}, []);
|
|
1029
|
-
|
|
1035
|
+
ne(() => l, [l]);
|
|
1030
1036
|
const i = P(
|
|
1031
1037
|
(f) => {
|
|
1032
1038
|
if (r.current !== f) return;
|
|
@@ -1036,9 +1042,9 @@ const rt = `[${Wt}]`, qr = "[data-aqmd-content]", _r = 'a[href], button, input,
|
|
|
1036
1042
|
return;
|
|
1037
1043
|
}
|
|
1038
1044
|
e.prefetch(f);
|
|
1039
|
-
const
|
|
1040
|
-
if (
|
|
1041
|
-
const m = Promise.allSettled([
|
|
1045
|
+
const p = e.peek(f);
|
|
1046
|
+
if (p?.status !== "pending") return;
|
|
1047
|
+
const m = Promise.allSettled([p.promise]);
|
|
1042
1048
|
o.current = m, m.then(() => {
|
|
1043
1049
|
o.current === m && (o.current = null);
|
|
1044
1050
|
});
|
|
@@ -1049,10 +1055,10 @@ const rt = `[${Wt}]`, qr = "[data-aqmd-content]", _r = 'a[href], button, input,
|
|
|
1049
1055
|
const u = t(f);
|
|
1050
1056
|
u !== r.current && (l(), u !== null && (r.current = u, n.current = window.setTimeout(() => {
|
|
1051
1057
|
n.current = null, i(u);
|
|
1052
|
-
},
|
|
1058
|
+
}, Pn)));
|
|
1053
1059
|
},
|
|
1054
1060
|
[l, t, i]
|
|
1055
|
-
),
|
|
1061
|
+
), g = P(
|
|
1056
1062
|
(f) => {
|
|
1057
1063
|
t(f) !== r.current && l();
|
|
1058
1064
|
},
|
|
@@ -1061,14 +1067,14 @@ const rt = `[${Wt}]`, qr = "[data-aqmd-content]", _r = 'a[href], button, input,
|
|
|
1061
1067
|
return U(
|
|
1062
1068
|
() => ({
|
|
1063
1069
|
onPointerOver: (f) => d(f.target),
|
|
1064
|
-
onPointerOut: (f) =>
|
|
1070
|
+
onPointerOut: (f) => g(f.relatedTarget),
|
|
1065
1071
|
onFocus: (f) => d(f.target),
|
|
1066
|
-
onBlur: (f) =>
|
|
1072
|
+
onBlur: (f) => g(f.relatedTarget)
|
|
1067
1073
|
}),
|
|
1068
|
-
[d,
|
|
1074
|
+
[d, g]
|
|
1069
1075
|
);
|
|
1070
|
-
},
|
|
1071
|
-
class
|
|
1076
|
+
}, to = tt(() => import("./NativeScrollBar-CyiyL47o.js").then((e) => ({ default: e.NativeScrollBar })));
|
|
1077
|
+
class no extends Vt {
|
|
1072
1078
|
state = { failed: !1 };
|
|
1073
1079
|
static getDerivedStateFromError() {
|
|
1074
1080
|
return { failed: !0 };
|
|
@@ -1080,7 +1086,7 @@ class eo extends Zt {
|
|
|
1080
1086
|
return this.state.failed ? null : this.props.children;
|
|
1081
1087
|
}
|
|
1082
1088
|
}
|
|
1083
|
-
const
|
|
1089
|
+
const ro = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ a(no, { children: /* @__PURE__ */ a(ge, { fallback: null, children: /* @__PURE__ */ a(to, { scroller: e, withCircle: t }) }) }), un = (e) => /* @__PURE__ */ a(ro, { scroller: e, withCircle: !0 }), fn = () => {
|
|
1084
1090
|
const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Set();
|
|
1085
1091
|
let n = !1;
|
|
1086
1092
|
const r = (o) => {
|
|
@@ -1124,43 +1130,43 @@ const to = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ c(eo, { children:
|
|
|
1124
1130
|
t.status = "rejected", t.reason = n;
|
|
1125
1131
|
}
|
|
1126
1132
|
)), t;
|
|
1127
|
-
},
|
|
1133
|
+
}, mn = (e) => Object.assign(Promise.resolve(e), { status: "fulfilled", value: e }), Se = (e) => e.status === "fulfilled" ? e.value : void 0, oo = 55e3, Tt = Object.freeze({ status: "deferred" }), Ct = Object.freeze({ status: "refreshed" }), Ge = Object.freeze({ status: "superseded" }), de = (e) => e === void 0 || e.status === "deferred" ? null : e.status === "loaded" ? e : e.previous, hn = (e) => e !== void 0 && e.status === "loaded" && e.document.kind !== "failure", lo = ({ client: e, capacity: t }) => {
|
|
1128
1134
|
if (!Number.isInteger(t) || t < 1) throw new RangeError(`[markdown-explorer] the document cache capacity must be a positive integer; got ${String(t)}`);
|
|
1129
|
-
const n = /* @__PURE__ */ new Map(), r =
|
|
1135
|
+
const n = /* @__PURE__ */ new Map(), r = fn(), o = ye(), l = /* @__PURE__ */ new WeakSet();
|
|
1130
1136
|
let i = 0;
|
|
1131
|
-
const d = o.emit,
|
|
1137
|
+
const d = o.emit, g = () => (i += 1, i), f = () => {
|
|
1132
1138
|
if (!(n.size <= t))
|
|
1133
1139
|
for (const s of [...n.keys()]) {
|
|
1134
1140
|
if (n.size <= t) return;
|
|
1135
1141
|
r.isHeld(s) || n.delete(s);
|
|
1136
1142
|
}
|
|
1137
|
-
}, u = (s,
|
|
1138
|
-
n.delete(s), n.set(s,
|
|
1139
|
-
},
|
|
1140
|
-
const w = n.get(s),
|
|
1143
|
+
}, u = (s, c) => {
|
|
1144
|
+
n.delete(s), n.set(s, c);
|
|
1145
|
+
}, p = (s) => performance.now() - s.validatedAt >= oo, m = (s, c, h) => {
|
|
1146
|
+
const w = n.get(s), k = de(w?.snapshot), L = h || w?.refreshPending === !0, R = be(e.document(s, { refresh: L }).then((q) => ({ status: "loaded", document: q }))), N = { snapshot: { status: "pending", promise: R, previous: k }, validatedAt: performance.now(), opened: c, background: null, refreshPending: !1, seeded: void 0, stamp: g() };
|
|
1141
1147
|
return u(s, N), f(), R.then((q) => {
|
|
1142
|
-
n.get(s) === N && (N.snapshot = q, N.stamp =
|
|
1148
|
+
n.get(s) === N && (N.snapshot = q, N.stamp = g(), d());
|
|
1143
1149
|
}), N;
|
|
1144
|
-
},
|
|
1145
|
-
|
|
1146
|
-
}, O = async (s,
|
|
1147
|
-
const h =
|
|
1150
|
+
}, x = (s, c, h, w, k, L) => {
|
|
1151
|
+
c.background === h && (c.background = null, !(n.get(s) !== c || c.snapshot !== w) && (k.kind === "failure" && w.document.kind !== "failure" || (c.validatedAt = L, c.stamp = g(), Me(w.document, k) || (c.snapshot = { status: "loaded", document: k }), d())));
|
|
1152
|
+
}, O = async (s, c) => {
|
|
1153
|
+
const h = c.snapshot;
|
|
1148
1154
|
if (h.status !== "loaded") return null;
|
|
1149
1155
|
const w = {};
|
|
1150
|
-
|
|
1151
|
-
const
|
|
1152
|
-
|
|
1153
|
-
const R = await L, N =
|
|
1154
|
-
return
|
|
1155
|
-
},
|
|
1156
|
-
const { snapshot: h } =
|
|
1157
|
-
return h.status === "pending" ? !1 : h.status === "loaded" && h.document.kind !== "failure" ? (O(s,
|
|
1156
|
+
c.background = w;
|
|
1157
|
+
const k = performance.now(), L = e.document(s, { refresh: c.refreshPending });
|
|
1158
|
+
c.refreshPending = !1;
|
|
1159
|
+
const R = await L, N = c.background === w && n.get(s) === c && c.snapshot === h;
|
|
1160
|
+
return x(s, c, w, h, R, k), N ? R : null;
|
|
1161
|
+
}, y = (s, c) => {
|
|
1162
|
+
const { snapshot: h } = c;
|
|
1163
|
+
return h.status === "pending" ? !1 : h.status === "loaded" && h.document.kind !== "failure" ? (O(s, c), !1) : (h.status === "loaded" && l.add(h), m(s, !0, !1), !0);
|
|
1158
1164
|
}, T = (s) => {
|
|
1159
|
-
const
|
|
1165
|
+
const c = r.hold(s);
|
|
1160
1166
|
let h = !1;
|
|
1161
1167
|
return () => {
|
|
1162
1168
|
if (h) return;
|
|
1163
|
-
h = !0,
|
|
1169
|
+
h = !0, c();
|
|
1164
1170
|
const w = n.get(s);
|
|
1165
1171
|
w !== void 0 && u(s, w), f();
|
|
1166
1172
|
};
|
|
@@ -1170,65 +1176,65 @@ const to = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ c(eo, { children:
|
|
|
1170
1176
|
peekSeeded: (s) => n.get(s)?.seeded,
|
|
1171
1177
|
answerStampOf: (s) => n.get(s)?.stamp,
|
|
1172
1178
|
prefetch: (s) => {
|
|
1173
|
-
const
|
|
1174
|
-
|
|
1179
|
+
const c = n.get(s);
|
|
1180
|
+
c !== void 0 && c.snapshot.status !== "deferred" || (m(s, !1, !1), d());
|
|
1175
1181
|
},
|
|
1176
1182
|
open: (s) => {
|
|
1177
|
-
const
|
|
1183
|
+
const c = r.resumes(s), h = T(s), w = n.get(s);
|
|
1178
1184
|
if (w === void 0 || w.snapshot.status === "deferred")
|
|
1179
1185
|
return m(s, !0, !1), d(), h;
|
|
1180
|
-
if (u(s, w),
|
|
1181
|
-
const { snapshot:
|
|
1182
|
-
return
|
|
1186
|
+
if (u(s, w), c) return h;
|
|
1187
|
+
const { snapshot: k } = w;
|
|
1188
|
+
return k.status === "pending" ? (w.opened = !0, h) : k.document.kind === "failure" ? (w.opened || p(w) ? (l.add(k), m(s, !0, !1), d()) : w.opened = !0, h) : (w.opened = !0, w.background === null && p(w) && O(s, w), h);
|
|
1183
1189
|
},
|
|
1184
1190
|
retain: T,
|
|
1185
1191
|
retry: (s) => {
|
|
1186
|
-
const
|
|
1187
|
-
|
|
1192
|
+
const c = n.get(s);
|
|
1193
|
+
c === void 0 || c.snapshot.status !== "loaded" || c.snapshot.document.kind !== "failure" || (m(s, !0, !1), d());
|
|
1188
1194
|
},
|
|
1189
|
-
seed: (s,
|
|
1195
|
+
seed: (s, c) => {
|
|
1190
1196
|
const h = performance.now(), w = be(
|
|
1191
|
-
|
|
1197
|
+
c.then(
|
|
1192
1198
|
(q) => q === null ? Tt : { status: "loaded", document: q },
|
|
1193
1199
|
() => Tt
|
|
1194
1200
|
)
|
|
1195
|
-
),
|
|
1196
|
-
if (
|
|
1197
|
-
const q =
|
|
1198
|
-
|
|
1201
|
+
), k = n.get(s);
|
|
1202
|
+
if (k !== void 0 && k.snapshot.status === "loaded") {
|
|
1203
|
+
const q = k.snapshot, W = {};
|
|
1204
|
+
k.background = W, w.then((J) => {
|
|
1199
1205
|
if (J.status === "loaded") {
|
|
1200
|
-
|
|
1206
|
+
x(s, k, W, q, J.document, h);
|
|
1201
1207
|
return;
|
|
1202
1208
|
}
|
|
1203
|
-
|
|
1209
|
+
k.background === W && (k.background = null);
|
|
1204
1210
|
});
|
|
1205
1211
|
return;
|
|
1206
1212
|
}
|
|
1207
|
-
const L =
|
|
1213
|
+
const L = k !== void 0 && k.snapshot.status === "pending" ? k.snapshot.previous : null, R = { status: "pending", promise: w, previous: L }, N = { snapshot: R, validatedAt: h, opened: k?.opened === !0, background: null, refreshPending: k?.refreshPending === !0, seeded: R, stamp: g() };
|
|
1208
1214
|
u(s, N), f(), w.then((q) => {
|
|
1209
|
-
n.get(s) === N && (q.status === "deferred" && r.isHeld(s) ? m(s, N.opened, !1) : (N.snapshot = q, N.stamp =
|
|
1215
|
+
n.get(s) === N && (q.status === "deferred" && r.isHeld(s) ? m(s, N.opened, !1) : (N.snapshot = q, N.stamp = g()), d());
|
|
1210
1216
|
});
|
|
1211
1217
|
},
|
|
1212
1218
|
invalidate: () => {
|
|
1213
1219
|
let s = !1;
|
|
1214
|
-
for (const [
|
|
1215
|
-
if (h.validatedAt = Number.NEGATIVE_INFINITY, h.opened = !0, h.refreshPending = !0, !r.isHeld(
|
|
1220
|
+
for (const [c, h] of [...n]) {
|
|
1221
|
+
if (h.validatedAt = Number.NEGATIVE_INFINITY, h.opened = !0, h.refreshPending = !0, !r.isHeld(c)) continue;
|
|
1216
1222
|
const { snapshot: w } = h;
|
|
1217
1223
|
if (w.status !== "pending") {
|
|
1218
|
-
|
|
1224
|
+
y(c, h) && (s = !0);
|
|
1219
1225
|
continue;
|
|
1220
1226
|
}
|
|
1221
1227
|
w.promise.then(() => {
|
|
1222
|
-
n.get(
|
|
1228
|
+
n.get(c) === h && h.refreshPending && r.isHeld(c) && y(c, h) && d();
|
|
1223
1229
|
});
|
|
1224
1230
|
}
|
|
1225
1231
|
s && d();
|
|
1226
1232
|
},
|
|
1227
1233
|
refresh: async (s) => {
|
|
1228
|
-
const
|
|
1229
|
-
if (
|
|
1230
|
-
|
|
1231
|
-
const w = await O(s,
|
|
1234
|
+
const c = n.get(s);
|
|
1235
|
+
if (c !== void 0 && hn(c.snapshot)) {
|
|
1236
|
+
c.refreshPending = !0;
|
|
1237
|
+
const w = await O(s, c);
|
|
1232
1238
|
return w === null ? Ge : w.kind === "failure" ? { status: "failed", failure: w.failure } : Ct;
|
|
1233
1239
|
}
|
|
1234
1240
|
const h = m(s, !0, !0);
|
|
@@ -1242,13 +1248,63 @@ const to = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ c(eo, { children:
|
|
|
1242
1248
|
subscribe: o.subscribe,
|
|
1243
1249
|
noteFailureShown: (s) => l.has(s) ? !1 : (l.add(s), !0)
|
|
1244
1250
|
};
|
|
1245
|
-
}
|
|
1246
|
-
function
|
|
1251
|
+
};
|
|
1252
|
+
function io({
|
|
1253
|
+
title: e,
|
|
1254
|
+
titleId: t,
|
|
1255
|
+
...n
|
|
1256
|
+
}, r) {
|
|
1257
|
+
return /* @__PURE__ */ b.createElement("svg", Object.assign({
|
|
1258
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1259
|
+
viewBox: "0 0 20 20",
|
|
1260
|
+
fill: "currentColor",
|
|
1261
|
+
"aria-hidden": "true",
|
|
1262
|
+
"data-slot": "icon",
|
|
1263
|
+
ref: r,
|
|
1264
|
+
"aria-labelledby": t
|
|
1265
|
+
}, n), e ? /* @__PURE__ */ b.createElement("title", {
|
|
1266
|
+
id: t
|
|
1267
|
+
}, e) : null, /* @__PURE__ */ b.createElement("path", {
|
|
1268
|
+
fillRule: "evenodd",
|
|
1269
|
+
d: "M18 5.25a2.25 2.25 0 0 0-2.012-2.238A2.25 2.25 0 0 0 13.75 1h-1.5a2.25 2.25 0 0 0-2.238 2.012c-.875.092-1.6.686-1.884 1.488H11A2.5 2.5 0 0 1 13.5 7v7h2.25A2.25 2.25 0 0 0 18 11.75v-6.5ZM12.25 2.5a.75.75 0 0 0-.75.75v.25h3v-.25a.75.75 0 0 0-.75-.75h-1.5Z",
|
|
1270
|
+
clipRule: "evenodd"
|
|
1271
|
+
}), /* @__PURE__ */ b.createElement("path", {
|
|
1272
|
+
fillRule: "evenodd",
|
|
1273
|
+
d: "M3 6a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1H3Zm6.874 4.166a.75.75 0 1 0-1.248-.832l-2.493 3.739-.853-.853a.75.75 0 0 0-1.06 1.06l1.5 1.5a.75.75 0 0 0 1.154-.114l3-4.5Z",
|
|
1274
|
+
clipRule: "evenodd"
|
|
1275
|
+
}));
|
|
1276
|
+
}
|
|
1277
|
+
const so = /* @__PURE__ */ b.forwardRef(io);
|
|
1278
|
+
function ao({
|
|
1279
|
+
title: e,
|
|
1280
|
+
titleId: t,
|
|
1281
|
+
...n
|
|
1282
|
+
}, r) {
|
|
1283
|
+
return /* @__PURE__ */ b.createElement("svg", Object.assign({
|
|
1284
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1285
|
+
viewBox: "0 0 20 20",
|
|
1286
|
+
fill: "currentColor",
|
|
1287
|
+
"aria-hidden": "true",
|
|
1288
|
+
"data-slot": "icon",
|
|
1289
|
+
ref: r,
|
|
1290
|
+
"aria-labelledby": t
|
|
1291
|
+
}, n), e ? /* @__PURE__ */ b.createElement("title", {
|
|
1292
|
+
id: t
|
|
1293
|
+
}, e) : null, /* @__PURE__ */ b.createElement("path", {
|
|
1294
|
+
fillRule: "evenodd",
|
|
1295
|
+
d: "M15.988 3.012A2.25 2.25 0 0 1 18 5.25v6.5A2.25 2.25 0 0 1 15.75 14H13.5v-3.379a3 3 0 0 0-.879-2.121l-3.12-3.121a3 3 0 0 0-1.402-.791 2.252 2.252 0 0 1 1.913-1.576A2.25 2.25 0 0 1 12.25 1h1.5a2.25 2.25 0 0 1 2.238 2.012ZM11.5 3.25a.75.75 0 0 1 .75-.75h1.5a.75.75 0 0 1 .75.75v.25h-3v-.25Z",
|
|
1296
|
+
clipRule: "evenodd"
|
|
1297
|
+
}), /* @__PURE__ */ b.createElement("path", {
|
|
1298
|
+
d: "M3.5 6A1.5 1.5 0 0 0 2 7.5v9A1.5 1.5 0 0 0 3.5 18h7a1.5 1.5 0 0 0 1.5-1.5v-5.879a1.5 1.5 0 0 0-.44-1.06L8.44 6.439A1.5 1.5 0 0 0 7.378 6H3.5Z"
|
|
1299
|
+
}));
|
|
1300
|
+
}
|
|
1301
|
+
const co = /* @__PURE__ */ b.forwardRef(ao);
|
|
1302
|
+
function uo({
|
|
1247
1303
|
title: e,
|
|
1248
1304
|
titleId: t,
|
|
1249
1305
|
...n
|
|
1250
1306
|
}, r) {
|
|
1251
|
-
return /* @__PURE__ */
|
|
1307
|
+
return /* @__PURE__ */ b.createElement("svg", Object.assign({
|
|
1252
1308
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1253
1309
|
viewBox: "0 0 20 20",
|
|
1254
1310
|
fill: "currentColor",
|
|
@@ -1256,21 +1312,64 @@ function lo({
|
|
|
1256
1312
|
"data-slot": "icon",
|
|
1257
1313
|
ref: r,
|
|
1258
1314
|
"aria-labelledby": t
|
|
1259
|
-
}, n), e ? /* @__PURE__ */
|
|
1315
|
+
}, n), e ? /* @__PURE__ */ b.createElement("title", {
|
|
1260
1316
|
id: t
|
|
1261
|
-
}, e) : null, /* @__PURE__ */
|
|
1317
|
+
}, e) : null, /* @__PURE__ */ b.createElement("path", {
|
|
1318
|
+
fillRule: "evenodd",
|
|
1319
|
+
d: "M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495ZM10 5a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 10 5Zm0 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",
|
|
1320
|
+
clipRule: "evenodd"
|
|
1321
|
+
}));
|
|
1322
|
+
}
|
|
1323
|
+
const fo = /* @__PURE__ */ b.forwardRef(uo), mo = 2e3, Ot = Object.freeze({ outcome: "idle" }), ho = (e) => {
|
|
1324
|
+
const t = navigator.clipboard;
|
|
1325
|
+
return t === void 0 ? Promise.reject(new Error("[markdown-explorer] this browser has no asynchronous clipboard")) : t.writeText(e);
|
|
1326
|
+
}, po = ({ text: e }) => {
|
|
1327
|
+
const { announcer: t, labels: n } = D(), [r, o] = I(Ot);
|
|
1328
|
+
ne(() => {
|
|
1329
|
+
if (r.outcome === "idle") return;
|
|
1330
|
+
const g = setTimeout(() => o(Ot), mo);
|
|
1331
|
+
return () => clearTimeout(g);
|
|
1332
|
+
}, [r]);
|
|
1333
|
+
const l = (g) => {
|
|
1334
|
+
o({ outcome: g }), t.announce(g === "copied" ? n.copiedText : n.copyTextFailed);
|
|
1335
|
+
}, i = () => {
|
|
1336
|
+
ho(e).then(
|
|
1337
|
+
() => l("copied"),
|
|
1338
|
+
() => l("failed")
|
|
1339
|
+
);
|
|
1340
|
+
}, d = r.outcome === "copied" ? n.copiedText : r.outcome === "failed" ? n.copyTextFailed : n.copyText;
|
|
1341
|
+
return (
|
|
1342
|
+
/* @__PURE__ */ a("button", { type: "button", className: "aqmx-icon-button", "aria-label": n.copyText, title: d, onClick: i, "data-aqmx-copy-outcome": r.outcome, "data-testid": "markdown-explorer-file-copy", children: r.outcome === "copied" ? /* @__PURE__ */ a(so, {}) : r.outcome === "failed" ? /* @__PURE__ */ a(fo, {}) : /* @__PURE__ */ a(co, {}) })
|
|
1343
|
+
);
|
|
1344
|
+
}, fe = me("fill"), go = Object.freeze({ blockSize: "100%" }), xe = ({ scrollerProps: e, children: t }) => re(fe) === "content" ? /* @__PURE__ */ a(vt, { scrollerProps: e, children: t }) : /* @__PURE__ */ a(vt, { scrollerProps: { ...e, style: go }, rowClassName: "aqmx-document-scroll-row", renderScrollBar: un, children: t });
|
|
1345
|
+
function vo({
|
|
1346
|
+
title: e,
|
|
1347
|
+
titleId: t,
|
|
1348
|
+
...n
|
|
1349
|
+
}, r) {
|
|
1350
|
+
return /* @__PURE__ */ b.createElement("svg", Object.assign({
|
|
1351
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1352
|
+
viewBox: "0 0 20 20",
|
|
1353
|
+
fill: "currentColor",
|
|
1354
|
+
"aria-hidden": "true",
|
|
1355
|
+
"data-slot": "icon",
|
|
1356
|
+
ref: r,
|
|
1357
|
+
"aria-labelledby": t
|
|
1358
|
+
}, n), e ? /* @__PURE__ */ b.createElement("title", {
|
|
1359
|
+
id: t
|
|
1360
|
+
}, e) : null, /* @__PURE__ */ b.createElement("path", {
|
|
1262
1361
|
d: "M10.75 2.75a.75.75 0 0 0-1.5 0v8.614L6.295 8.235a.75.75 0 1 0-1.09 1.03l4.25 4.5a.75.75 0 0 0 1.09 0l4.25-4.5a.75.75 0 0 0-1.09-1.03l-2.955 3.129V2.75Z"
|
|
1263
|
-
}), /* @__PURE__ */
|
|
1362
|
+
}), /* @__PURE__ */ b.createElement("path", {
|
|
1264
1363
|
d: "M3.5 12.75a.75.75 0 0 0-1.5 0v2.5A2.75 2.75 0 0 0 4.75 18h10.5A2.75 2.75 0 0 0 18 15.25v-2.5a.75.75 0 0 0-1.5 0v2.5c0 .69-.56 1.25-1.25 1.25H4.75c-.69 0-1.25-.56-1.25-1.25v-2.5Z"
|
|
1265
1364
|
}));
|
|
1266
1365
|
}
|
|
1267
|
-
const
|
|
1268
|
-
function
|
|
1366
|
+
const wo = /* @__PURE__ */ b.forwardRef(vo);
|
|
1367
|
+
function bo({
|
|
1269
1368
|
title: e,
|
|
1270
1369
|
titleId: t,
|
|
1271
1370
|
...n
|
|
1272
1371
|
}, r) {
|
|
1273
|
-
return /* @__PURE__ */
|
|
1372
|
+
return /* @__PURE__ */ b.createElement("svg", Object.assign({
|
|
1274
1373
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1275
1374
|
viewBox: "0 0 20 20",
|
|
1276
1375
|
fill: "currentColor",
|
|
@@ -1278,34 +1377,34 @@ function so({
|
|
|
1278
1377
|
"data-slot": "icon",
|
|
1279
1378
|
ref: r,
|
|
1280
1379
|
"aria-labelledby": t
|
|
1281
|
-
}, n), e ? /* @__PURE__ */
|
|
1380
|
+
}, n), e ? /* @__PURE__ */ b.createElement("title", {
|
|
1282
1381
|
id: t
|
|
1283
|
-
}, e) : null, /* @__PURE__ */
|
|
1382
|
+
}, e) : null, /* @__PURE__ */ b.createElement("path", {
|
|
1284
1383
|
fillRule: "evenodd",
|
|
1285
1384
|
d: "M4.25 5.5a.75.75 0 0 0-.75.75v8.5c0 .414.336.75.75.75h8.5a.75.75 0 0 0 .75-.75v-4a.75.75 0 0 1 1.5 0v4A2.25 2.25 0 0 1 12.75 17h-8.5A2.25 2.25 0 0 1 2 14.75v-8.5A2.25 2.25 0 0 1 4.25 4h5a.75.75 0 0 1 0 1.5h-5Z",
|
|
1286
1385
|
clipRule: "evenodd"
|
|
1287
|
-
}), /* @__PURE__ */
|
|
1386
|
+
}), /* @__PURE__ */ b.createElement("path", {
|
|
1288
1387
|
fillRule: "evenodd",
|
|
1289
1388
|
d: "M6.194 12.753a.75.75 0 0 0 1.06.053L16.5 4.44v2.81a.75.75 0 0 0 1.5 0v-4.5a.75.75 0 0 0-.75-.75h-4.5a.75.75 0 0 0 0 1.5h2.553l-9.056 8.194a.75.75 0 0 0-.053 1.06Z",
|
|
1290
1389
|
clipRule: "evenodd"
|
|
1291
1390
|
}));
|
|
1292
1391
|
}
|
|
1293
|
-
const
|
|
1294
|
-
const { labels:
|
|
1392
|
+
const Eo = /* @__PURE__ */ b.forwardRef(bo), Pe = ({ name: e, openUrl: t, downloadUrl: n, icon: r, children: o }) => {
|
|
1393
|
+
const { labels: l } = D();
|
|
1295
1394
|
return /* @__PURE__ */ F("div", { className: "aqmx-document-toolbar", children: [
|
|
1296
|
-
/* @__PURE__ */
|
|
1297
|
-
/* @__PURE__ */
|
|
1298
|
-
|
|
1299
|
-
/* @__PURE__ */
|
|
1300
|
-
/* @__PURE__ */
|
|
1395
|
+
/* @__PURE__ */ a("span", { className: "aqmx-document-file-icon", "aria-hidden": "true", children: r }),
|
|
1396
|
+
/* @__PURE__ */ a("span", { className: "aqmx-document-title", title: e, "data-testid": "markdown-explorer-file-name", children: e }),
|
|
1397
|
+
o,
|
|
1398
|
+
/* @__PURE__ */ a("a", { className: "aqmx-icon-button", href: t, target: "_blank", rel: "noopener noreferrer", "aria-label": l.openInNewTab, title: l.openInNewTab, "data-testid": "markdown-explorer-file-open", children: /* @__PURE__ */ a(Eo, {}) }),
|
|
1399
|
+
/* @__PURE__ */ a("a", { className: "aqmx-icon-button", href: n, download: e, "aria-label": l.download, title: l.download, "data-testid": "markdown-explorer-file-download", children: /* @__PURE__ */ a(wo, {}) })
|
|
1301
1400
|
] });
|
|
1302
1401
|
};
|
|
1303
|
-
function
|
|
1402
|
+
function yo({
|
|
1304
1403
|
title: e,
|
|
1305
1404
|
titleId: t,
|
|
1306
1405
|
...n
|
|
1307
1406
|
}, r) {
|
|
1308
|
-
return /* @__PURE__ */
|
|
1407
|
+
return /* @__PURE__ */ b.createElement("svg", Object.assign({
|
|
1309
1408
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1310
1409
|
viewBox: "0 0 20 20",
|
|
1311
1410
|
fill: "currentColor",
|
|
@@ -1313,31 +1412,31 @@ function co({
|
|
|
1313
1412
|
"data-slot": "icon",
|
|
1314
1413
|
ref: r,
|
|
1315
1414
|
"aria-labelledby": t
|
|
1316
|
-
}, n), e ? /* @__PURE__ */
|
|
1415
|
+
}, n), e ? /* @__PURE__ */ b.createElement("title", {
|
|
1317
1416
|
id: t
|
|
1318
|
-
}, e) : null, /* @__PURE__ */
|
|
1417
|
+
}, e) : null, /* @__PURE__ */ b.createElement("path", {
|
|
1319
1418
|
fillRule: "evenodd",
|
|
1320
1419
|
d: "M4.5 2A1.5 1.5 0 0 0 3 3.5v13A1.5 1.5 0 0 0 4.5 18h11a1.5 1.5 0 0 0 1.5-1.5V7.621a1.5 1.5 0 0 0-.44-1.06l-4.12-4.122A1.5 1.5 0 0 0 11.378 2H4.5Zm4.75 6.75a.75.75 0 0 1 1.5 0v2.546l.943-1.048a.75.75 0 0 1 1.114 1.004l-2.25 2.5a.75.75 0 0 1-1.114 0l-2.25-2.5a.75.75 0 1 1 1.114-1.004l.943 1.048V8.75Z",
|
|
1321
1420
|
clipRule: "evenodd"
|
|
1322
1421
|
}));
|
|
1323
1422
|
}
|
|
1324
|
-
const
|
|
1423
|
+
const xo = /* @__PURE__ */ b.forwardRef(yo), ko = Object.freeze({ className: "aqmx-document-stage" }), So = ({ document: e }) => {
|
|
1325
1424
|
const { labels: t } = D();
|
|
1326
1425
|
return /* @__PURE__ */ F("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-file-view", children: [
|
|
1327
|
-
/* @__PURE__ */
|
|
1328
|
-
/* @__PURE__ */
|
|
1329
|
-
/* @__PURE__ */
|
|
1330
|
-
/* @__PURE__ */
|
|
1426
|
+
/* @__PURE__ */ a(Pe, { name: e.name, openUrl: e.url, downloadUrl: e.url, icon: /* @__PURE__ */ a(xo, {}) }),
|
|
1427
|
+
/* @__PURE__ */ a(xe, { scrollerProps: ko, children: /* @__PURE__ */ F("div", { className: "aqmx-callout", role: "note", "data-testid": "markdown-explorer-file-not-shown", children: [
|
|
1428
|
+
/* @__PURE__ */ a("p", { className: "aqmx-callout-body", children: t.fileNotShown }),
|
|
1429
|
+
/* @__PURE__ */ a("a", { className: "aqmx-callout-action", href: e.url, download: e.name, "data-testid": "markdown-explorer-file-not-shown-download", children: t.download })
|
|
1331
1430
|
] }) })
|
|
1332
1431
|
] });
|
|
1333
|
-
}, Fe = "[data-aqmd-scroll-container], [data-aqmx-document-scroller]",
|
|
1432
|
+
}, Fe = "[data-aqmd-scroll-container], [data-aqmx-document-scroller]", Ro = (e) => {
|
|
1334
1433
|
const t = e.indexOf("#");
|
|
1335
1434
|
return t === -1 ? "" : e.slice(t);
|
|
1336
|
-
},
|
|
1435
|
+
}, To = /(%[0-9A-Fa-f]{2})/u, lt = (e) => {
|
|
1337
1436
|
if (!e.startsWith("#") || e.length === 1) return null;
|
|
1338
|
-
const t = new TextEncoder(), n = e.slice(1).split(
|
|
1437
|
+
const t = new TextEncoder(), n = e.slice(1).split(To).flatMap((r, o) => o % 2 === 1 ? [Number.parseInt(r.slice(1), 16)] : [...t.encode(r)]);
|
|
1339
1438
|
return new TextDecoder("utf-8", { ignoreBOM: !0 }).decode(Uint8Array.from(n));
|
|
1340
|
-
},
|
|
1439
|
+
}, pn = (e) => `#${encodeURIComponent(e)}`, Co = (e) => {
|
|
1341
1440
|
if (e === "#") return !0;
|
|
1342
1441
|
const t = lt(e);
|
|
1343
1442
|
return t !== null && t.replace(/[A-Z]/gu, (n) => n.toLowerCase()) === "top";
|
|
@@ -1346,20 +1445,20 @@ const uo = /* @__PURE__ */ y.forwardRef(co), fo = Object.freeze({ className: "aq
|
|
|
1346
1445
|
for (const n of e.querySelectorAll("[id]"))
|
|
1347
1446
|
if (n.id === t) return n;
|
|
1348
1447
|
return null;
|
|
1349
|
-
},
|
|
1448
|
+
}, Oo = "http://www.w3.org/1999/xhtml", At = (e, t) => {
|
|
1350
1449
|
if (t === "") return null;
|
|
1351
1450
|
const n = gn(e, t);
|
|
1352
1451
|
if (n !== null) return n;
|
|
1353
1452
|
for (const r of e.querySelectorAll("a[name]"))
|
|
1354
|
-
if (r.localName === "a" && r.namespaceURI ===
|
|
1453
|
+
if (r.localName === "a" && r.namespaceURI === Oo && r.getAttribute("name") === t) return r;
|
|
1355
1454
|
return null;
|
|
1356
|
-
},
|
|
1455
|
+
}, vn = (e, t) => {
|
|
1357
1456
|
if (e === null || !t.startsWith("#")) return null;
|
|
1358
|
-
const n =
|
|
1457
|
+
const n = At(e, t.slice(1));
|
|
1359
1458
|
if (n !== null) return n;
|
|
1360
1459
|
const r = lt(t);
|
|
1361
|
-
return r === null ? null :
|
|
1362
|
-
},
|
|
1460
|
+
return r === null ? null : At(e, r);
|
|
1461
|
+
}, Lt = (e) => {
|
|
1363
1462
|
const { body: t, documentElement: n } = e.ownerDocument;
|
|
1364
1463
|
if (e === t) {
|
|
1365
1464
|
const o = getComputedStyle(n);
|
|
@@ -1367,22 +1466,22 @@ const uo = /* @__PURE__ */ y.forwardRef(co), fo = Object.freeze({ className: "aq
|
|
|
1367
1466
|
}
|
|
1368
1467
|
const { overflowY: r } = getComputedStyle(e);
|
|
1369
1468
|
return r === "auto" || r === "scroll";
|
|
1370
|
-
},
|
|
1469
|
+
}, Ao = (e) => {
|
|
1371
1470
|
const { body: t, documentElement: n } = e, r = getComputedStyle(n), o = r.overflowX === "visible" && r.overflowY === "visible" && t !== null ? getComputedStyle(t).overflowY : r.overflowY;
|
|
1372
1471
|
return o !== "hidden" && o !== "clip";
|
|
1373
|
-
},
|
|
1472
|
+
}, Lo = (e, t) => {
|
|
1374
1473
|
const n = t.closest(Fe), r = n !== null && e.contains(n) ? n : e;
|
|
1375
|
-
if (r.scrollHeight > r.clientHeight &&
|
|
1474
|
+
if (r.scrollHeight > r.clientHeight && Lt(r)) return r;
|
|
1376
1475
|
const o = e.getBoundingClientRect().height, { documentElement: l, scrollingElement: i } = e.ownerDocument;
|
|
1377
1476
|
for (let d = e.parentElement; d !== null && d !== l; d = d.parentElement)
|
|
1378
|
-
if (
|
|
1379
|
-
return i instanceof Element &&
|
|
1380
|
-
},
|
|
1381
|
-
scrollerOf:
|
|
1477
|
+
if (Lt(d) && d.scrollHeight > d.clientHeight && d.clientHeight < o) return d;
|
|
1478
|
+
return i instanceof Element && Ao(e.ownerDocument) && i.scrollHeight > i.clientHeight && i.clientHeight < o ? i : r;
|
|
1479
|
+
}, Mo = Object.freeze({
|
|
1480
|
+
scrollerOf: Lo,
|
|
1382
1481
|
reveal: (e) => {
|
|
1383
1482
|
e.scrollIntoView(Ye);
|
|
1384
1483
|
}
|
|
1385
|
-
}), Ye = Object.freeze({ block: "nearest", inline: "nearest", behavior: "instant" }),
|
|
1484
|
+
}), Ye = Object.freeze({ block: "nearest", inline: "nearest", behavior: "instant" }), No = (e, t) => {
|
|
1386
1485
|
for (let n = t; n !== null && n !== e; n = n.parentElement) {
|
|
1387
1486
|
const r = n.parentElement;
|
|
1388
1487
|
if (r instanceof HTMLDetailsElement && n !== r.querySelector(":scope > summary") && (r.open = !0), n.getAttribute("hidden")?.toLowerCase() === "until-found") {
|
|
@@ -1390,7 +1489,7 @@ const uo = /* @__PURE__ */ y.forwardRef(co), fo = Object.freeze({ className: "aq
|
|
|
1390
1489
|
n.removeAttribute("hidden");
|
|
1391
1490
|
}
|
|
1392
1491
|
}
|
|
1393
|
-
},
|
|
1492
|
+
}, Do = (e, t) => {
|
|
1394
1493
|
if (t.getClientRects().length === 0) return;
|
|
1395
1494
|
const n = e === e.ownerDocument.scrollingElement ? 0 : e.getBoundingClientRect().top + e.clientTop, { scrollMarginTop: r, scrollMarginBottom: o } = getComputedStyle(t), l = Number.parseFloat(r), i = t.getBoundingClientRect(), d = i.height + l + Number.parseFloat(o) > e.clientHeight;
|
|
1396
1495
|
if (!d && Math.abs(i.top - l - n) < 1) {
|
|
@@ -1398,20 +1497,20 @@ const uo = /* @__PURE__ */ y.forwardRef(co), fo = Object.freeze({ className: "aq
|
|
|
1398
1497
|
return;
|
|
1399
1498
|
}
|
|
1400
1499
|
e.scrollBy({ top: d ? i.top - n - e.clientHeight : i.bottom - n + e.clientHeight, behavior: "instant" }), t.scrollIntoView(Ye);
|
|
1401
|
-
},
|
|
1500
|
+
}, $o = (e, t) => {
|
|
1402
1501
|
const n = t.scrollerOf(e, e.querySelector(Fe) ?? e);
|
|
1403
1502
|
n.getClientRects().length !== 0 && (n.scrollTo({ top: 0, left: 0, behavior: "instant" }), t.reveal(n));
|
|
1404
|
-
},
|
|
1503
|
+
}, Mt = (e, t, n) => {
|
|
1405
1504
|
if (e === null) return null;
|
|
1406
|
-
const r =
|
|
1407
|
-
return r === null ? (
|
|
1505
|
+
const r = vn(e, t);
|
|
1506
|
+
return r === null ? (Co(t) && $o(e, n), null) : (No(e, r), Do(n.scrollerOf(e, r), r), n.reveal(r), r);
|
|
1408
1507
|
};
|
|
1409
|
-
function
|
|
1508
|
+
function Po({
|
|
1410
1509
|
title: e,
|
|
1411
1510
|
titleId: t,
|
|
1412
1511
|
...n
|
|
1413
1512
|
}, r) {
|
|
1414
|
-
return /* @__PURE__ */
|
|
1513
|
+
return /* @__PURE__ */ b.createElement("svg", Object.assign({
|
|
1415
1514
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1416
1515
|
viewBox: "0 0 20 20",
|
|
1417
1516
|
fill: "currentColor",
|
|
@@ -1419,19 +1518,19 @@ function xo({
|
|
|
1419
1518
|
"data-slot": "icon",
|
|
1420
1519
|
ref: r,
|
|
1421
1520
|
"aria-labelledby": t
|
|
1422
|
-
}, n), e ? /* @__PURE__ */
|
|
1521
|
+
}, n), e ? /* @__PURE__ */ b.createElement("title", {
|
|
1423
1522
|
id: t
|
|
1424
|
-
}, e) : null, /* @__PURE__ */
|
|
1523
|
+
}, e) : null, /* @__PURE__ */ b.createElement("path", {
|
|
1425
1524
|
d: "M3.28 2.22a.75.75 0 0 0-1.06 1.06L5.44 6.5H2.75a.75.75 0 0 0 0 1.5h4.5A.75.75 0 0 0 8 7.25v-4.5a.75.75 0 0 0-1.5 0v2.69L3.28 2.22ZM13.5 2.75a.75.75 0 0 0-1.5 0v4.5c0 .414.336.75.75.75h4.5a.75.75 0 0 0 0-1.5h-2.69l3.22-3.22a.75.75 0 0 0-1.06-1.06L13.5 5.44V2.75ZM3.28 17.78l3.22-3.22v2.69a.75.75 0 0 0 1.5 0v-4.5a.75.75 0 0 0-.75-.75h-4.5a.75.75 0 0 0 0 1.5h2.69l-3.22 3.22a.75.75 0 1 0 1.06 1.06ZM13.5 14.56l3.22 3.22a.75.75 0 1 0 1.06-1.06l-3.22-3.22h2.69a.75.75 0 0 0 0-1.5h-4.5a.75.75 0 0 0-.75.75v4.5a.75.75 0 0 0 1.5 0v-2.69Z"
|
|
1426
1525
|
}));
|
|
1427
1526
|
}
|
|
1428
|
-
const
|
|
1429
|
-
function
|
|
1527
|
+
const Fo = /* @__PURE__ */ b.forwardRef(Po);
|
|
1528
|
+
function qo({
|
|
1430
1529
|
title: e,
|
|
1431
1530
|
titleId: t,
|
|
1432
1531
|
...n
|
|
1433
1532
|
}, r) {
|
|
1434
|
-
return /* @__PURE__ */
|
|
1533
|
+
return /* @__PURE__ */ b.createElement("svg", Object.assign({
|
|
1435
1534
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1436
1535
|
viewBox: "0 0 20 20",
|
|
1437
1536
|
fill: "currentColor",
|
|
@@ -1439,23 +1538,23 @@ function To({
|
|
|
1439
1538
|
"data-slot": "icon",
|
|
1440
1539
|
ref: r,
|
|
1441
1540
|
"aria-labelledby": t
|
|
1442
|
-
}, n), e ? /* @__PURE__ */
|
|
1541
|
+
}, n), e ? /* @__PURE__ */ b.createElement("title", {
|
|
1443
1542
|
id: t
|
|
1444
|
-
}, e) : null, /* @__PURE__ */
|
|
1543
|
+
}, e) : null, /* @__PURE__ */ b.createElement("path", {
|
|
1445
1544
|
d: "M6.75 8.25a.75.75 0 0 0 0 1.5h4.5a.75.75 0 0 0 0-1.5h-4.5Z"
|
|
1446
|
-
}), /* @__PURE__ */
|
|
1545
|
+
}), /* @__PURE__ */ b.createElement("path", {
|
|
1447
1546
|
fillRule: "evenodd",
|
|
1448
1547
|
d: "M9 2a7 7 0 1 0 4.391 12.452l3.329 3.328a.75.75 0 1 0 1.06-1.06l-3.328-3.329A7 7 0 0 0 9 2ZM3.5 9a5.5 5.5 0 1 1 11 0 5.5 5.5 0 0 1-11 0Z",
|
|
1449
1548
|
clipRule: "evenodd"
|
|
1450
1549
|
}));
|
|
1451
1550
|
}
|
|
1452
|
-
const
|
|
1453
|
-
function
|
|
1551
|
+
const _o = /* @__PURE__ */ b.forwardRef(qo);
|
|
1552
|
+
function Bo({
|
|
1454
1553
|
title: e,
|
|
1455
1554
|
titleId: t,
|
|
1456
1555
|
...n
|
|
1457
1556
|
}, r) {
|
|
1458
|
-
return /* @__PURE__ */
|
|
1557
|
+
return /* @__PURE__ */ b.createElement("svg", Object.assign({
|
|
1459
1558
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1460
1559
|
viewBox: "0 0 20 20",
|
|
1461
1560
|
fill: "currentColor",
|
|
@@ -1463,23 +1562,23 @@ function Oo({
|
|
|
1463
1562
|
"data-slot": "icon",
|
|
1464
1563
|
ref: r,
|
|
1465
1564
|
"aria-labelledby": t
|
|
1466
|
-
}, n), e ? /* @__PURE__ */
|
|
1565
|
+
}, n), e ? /* @__PURE__ */ b.createElement("title", {
|
|
1467
1566
|
id: t
|
|
1468
|
-
}, e) : null, /* @__PURE__ */
|
|
1567
|
+
}, e) : null, /* @__PURE__ */ b.createElement("path", {
|
|
1469
1568
|
d: "M9 6a.75.75 0 0 1 .75.75v1.5h1.5a.75.75 0 0 1 0 1.5h-1.5v1.5a.75.75 0 0 1-1.5 0v-1.5h-1.5a.75.75 0 0 1 0-1.5h1.5v-1.5A.75.75 0 0 1 9 6Z"
|
|
1470
|
-
}), /* @__PURE__ */
|
|
1569
|
+
}), /* @__PURE__ */ b.createElement("path", {
|
|
1471
1570
|
fillRule: "evenodd",
|
|
1472
1571
|
d: "M2 9a7 7 0 1 1 12.452 4.391l3.328 3.329a.75.75 0 1 1-1.06 1.06l-3.329-3.328A7 7 0 0 1 2 9Zm7-5.5a5.5 5.5 0 1 0 0 11 5.5 5.5 0 0 0 0-11Z",
|
|
1473
1572
|
clipRule: "evenodd"
|
|
1474
1573
|
}));
|
|
1475
1574
|
}
|
|
1476
|
-
const
|
|
1477
|
-
function
|
|
1575
|
+
const Io = /* @__PURE__ */ b.forwardRef(Bo);
|
|
1576
|
+
function jo({
|
|
1478
1577
|
title: e,
|
|
1479
1578
|
titleId: t,
|
|
1480
1579
|
...n
|
|
1481
1580
|
}, r) {
|
|
1482
|
-
return /* @__PURE__ */
|
|
1581
|
+
return /* @__PURE__ */ b.createElement("svg", Object.assign({
|
|
1483
1582
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1484
1583
|
viewBox: "0 0 20 20",
|
|
1485
1584
|
fill: "currentColor",
|
|
@@ -1487,15 +1586,15 @@ function Lo({
|
|
|
1487
1586
|
"data-slot": "icon",
|
|
1488
1587
|
ref: r,
|
|
1489
1588
|
"aria-labelledby": t
|
|
1490
|
-
}, n), e ? /* @__PURE__ */
|
|
1589
|
+
}, n), e ? /* @__PURE__ */ b.createElement("title", {
|
|
1491
1590
|
id: t
|
|
1492
|
-
}, e) : null, /* @__PURE__ */
|
|
1591
|
+
}, e) : null, /* @__PURE__ */ b.createElement("path", {
|
|
1493
1592
|
fillRule: "evenodd",
|
|
1494
1593
|
d: "M1 5.25A2.25 2.25 0 0 1 3.25 3h13.5A2.25 2.25 0 0 1 19 5.25v9.5A2.25 2.25 0 0 1 16.75 17H3.25A2.25 2.25 0 0 1 1 14.75v-9.5Zm1.5 5.81v3.69c0 .414.336.75.75.75h13.5a.75.75 0 0 0 .75-.75v-2.69l-2.22-2.219a.75.75 0 0 0-1.06 0l-1.91 1.909.47.47a.75.75 0 1 1-1.06 1.06L6.53 8.091a.75.75 0 0 0-1.06 0l-2.97 2.97ZM12 7a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z",
|
|
1495
1594
|
clipRule: "evenodd"
|
|
1496
1595
|
}));
|
|
1497
1596
|
}
|
|
1498
|
-
const
|
|
1597
|
+
const Ho = /* @__PURE__ */ b.forwardRef(jo), Je = "data-aqmx-key-repeat", Qe = Object.freeze({ [Je]: "allow" }), zo = `[${Je}="${Qe[Je]}"]`, Uo = () => {
|
|
1499
1598
|
let e = null;
|
|
1500
1599
|
return {
|
|
1501
1600
|
onKeyDownCapture: (t) => {
|
|
@@ -1504,7 +1603,7 @@ const Mo = /* @__PURE__ */ y.forwardRef(Lo), Je = "data-aqmx-key-repeat", Qe = O
|
|
|
1504
1603
|
e = t.target instanceof Element ? t.target : null;
|
|
1505
1604
|
return;
|
|
1506
1605
|
}
|
|
1507
|
-
e !== null && t.target === e && e.closest(
|
|
1606
|
+
e !== null && t.target === e && e.closest(zo) !== null || (t.preventDefault(), t.stopPropagation());
|
|
1508
1607
|
}
|
|
1509
1608
|
},
|
|
1510
1609
|
onKeyUpCapture: (t) => {
|
|
@@ -1514,7 +1613,7 @@ const Mo = /* @__PURE__ */ y.forwardRef(Lo), Je = "data-aqmx-key-repeat", Qe = O
|
|
|
1514
1613
|
t.target === e && (e = null);
|
|
1515
1614
|
}
|
|
1516
1615
|
};
|
|
1517
|
-
}, Ce = Object.freeze([1 /
|
|
1616
|
+
}, Ce = Object.freeze([1 / ke ** 2, 1 / ke, 1, ke, ke ** 2]), Nt = Object.freeze({ mode: "fit" }), Zo = 1, Vo = Object.freeze({ className: "aqmx-document-canvas", "data-testid": "markdown-explorer-image-canvas" }), Go = me(null), Ko = (e, t) => e.width > 0 && e.height > 0 && t.width - e.width <= Zo ? { base: e, scale: t.width / e.width } : t.width > 0 && t.height > 0 ? { base: t, scale: 1 } : null, Dt = (e, t, n) => {
|
|
1518
1617
|
if (e.mode === "level") {
|
|
1519
1618
|
const o = e.index + n;
|
|
1520
1619
|
return o >= 0 && o < Ce.length ? o : null;
|
|
@@ -1522,46 +1621,46 @@ const Mo = /* @__PURE__ */ y.forwardRef(Lo), Je = "data-aqmx-key-repeat", Qe = O
|
|
|
1522
1621
|
if (t === null || !Number.isFinite(t) || t <= 0) return null;
|
|
1523
1622
|
const r = n === 1 ? Ce.findIndex((o) => o > t) : Ce.findLastIndex((o) => o < t);
|
|
1524
1623
|
return r === -1 ? null : r;
|
|
1525
|
-
},
|
|
1624
|
+
}, $t = (e, t, n) => {
|
|
1526
1625
|
if (e.mode === "level") {
|
|
1527
|
-
const o =
|
|
1626
|
+
const o = Dt(e, null, n);
|
|
1528
1627
|
return o === null ? null : { mode: "level", index: o, base: e.base };
|
|
1529
1628
|
}
|
|
1530
1629
|
if (t === null) return null;
|
|
1531
|
-
const r =
|
|
1630
|
+
const r = Dt(e, t.scale, n);
|
|
1532
1631
|
return r === null ? null : { mode: "level", index: r, base: t.base };
|
|
1533
|
-
},
|
|
1632
|
+
}, Wo = (e) => {
|
|
1534
1633
|
const t = Ce[e];
|
|
1535
1634
|
if (t === void 0) throw new RangeError(`[markdown-explorer] no image zoom step ${String(e)}`);
|
|
1536
1635
|
return t;
|
|
1537
|
-
},
|
|
1538
|
-
const { labels: t } = D(), n =
|
|
1539
|
-
const { naturalWidth: s, naturalHeight:
|
|
1540
|
-
d((h) =>
|
|
1636
|
+
}, Pt = (e, t, n) => e !== null && e.width === t && e.height === n ? e : { width: t, height: n }, Xo = ({ document: e }) => {
|
|
1637
|
+
const { labels: t } = D(), n = re(Go), [r] = I(() => n === null ? null : n.read(e.url)), [o, l] = I(r === null ? Nt : r.zoom), [i, d] = I(r === null ? null : r.reported), [g, f] = I(null), u = B(null), p = P((M) => {
|
|
1638
|
+
const { naturalWidth: s, naturalHeight: c } = M;
|
|
1639
|
+
d((h) => Pt(h, s, c));
|
|
1541
1640
|
}, []), m = P(
|
|
1542
1641
|
(M) => {
|
|
1543
|
-
u.current = M, !(M === null || !M.complete) && (M.naturalWidth > 0 || M.naturalHeight > 0 ?
|
|
1544
|
-
() =>
|
|
1642
|
+
u.current = M, !(M === null || !M.complete) && (M.naturalWidth > 0 || M.naturalHeight > 0 ? p(M) : M.decode().then(
|
|
1643
|
+
() => p(M),
|
|
1545
1644
|
() => {
|
|
1546
1645
|
}
|
|
1547
1646
|
));
|
|
1548
1647
|
},
|
|
1549
|
-
[
|
|
1648
|
+
[p]
|
|
1550
1649
|
);
|
|
1551
|
-
|
|
1650
|
+
ne(() => {
|
|
1552
1651
|
n !== null && i !== null && n.save(e.url, { zoom: o, reported: i });
|
|
1553
1652
|
}, [n, e.url, o, i]), V(() => {
|
|
1554
1653
|
const M = u.current;
|
|
1555
1654
|
if (M === null || i === null || o.mode !== "fit") return;
|
|
1556
|
-
const s = () => f((h) =>
|
|
1655
|
+
const s = () => f((h) => Pt(h, M.clientWidth, M.clientHeight));
|
|
1557
1656
|
if (s(), typeof ResizeObserver > "u") return;
|
|
1558
|
-
const
|
|
1559
|
-
return
|
|
1657
|
+
const c = new ResizeObserver(s);
|
|
1658
|
+
return c.observe(M), () => c.disconnect();
|
|
1560
1659
|
}, [i, o.mode]);
|
|
1561
|
-
const
|
|
1660
|
+
const x = i === null || g === null ? null : Ko(i, g), O = $t(o, x, -1), y = $t(o, x, 1), T = o.mode === "level" ? Wo(o.index) : null, S = o.mode === "level" && T !== null ? { width: `${o.base.width * T}px`, height: `${o.base.height * T}px` } : void 0;
|
|
1562
1661
|
return /* @__PURE__ */ F("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-image-view", children: [
|
|
1563
|
-
/* @__PURE__ */ F(Pe, { name: e.name, url: e.url, icon: /* @__PURE__ */
|
|
1564
|
-
/* @__PURE__ */
|
|
1662
|
+
/* @__PURE__ */ F(Pe, { name: e.name, openUrl: e.url, downloadUrl: e.url, icon: /* @__PURE__ */ a(Ho, {}), children: [
|
|
1663
|
+
/* @__PURE__ */ a(
|
|
1565
1664
|
"button",
|
|
1566
1665
|
{
|
|
1567
1666
|
type: "button",
|
|
@@ -1573,58 +1672,58 @@ const Mo = /* @__PURE__ */ y.forwardRef(Lo), Je = "data-aqmx-key-repeat", Qe = O
|
|
|
1573
1672
|
O !== null && l(O);
|
|
1574
1673
|
},
|
|
1575
1674
|
...Qe,
|
|
1576
|
-
children: /* @__PURE__ */
|
|
1675
|
+
children: /* @__PURE__ */ a(_o, {})
|
|
1577
1676
|
}
|
|
1578
1677
|
),
|
|
1579
|
-
/* @__PURE__ */
|
|
1580
|
-
/* @__PURE__ */
|
|
1678
|
+
/* @__PURE__ */ a("output", { className: "aqmx-document-level", "aria-live": "polite", "data-testid": "markdown-explorer-image-level", children: T === null ? t.imageFitLevel : t.imageZoomLevel(Math.round(T * 100)) }),
|
|
1679
|
+
/* @__PURE__ */ a(
|
|
1581
1680
|
"button",
|
|
1582
1681
|
{
|
|
1583
1682
|
type: "button",
|
|
1584
1683
|
className: "aqmx-icon-button",
|
|
1585
1684
|
"aria-label": t.imageZoomIn,
|
|
1586
1685
|
title: t.imageZoomIn,
|
|
1587
|
-
"aria-disabled":
|
|
1686
|
+
"aria-disabled": y === null,
|
|
1588
1687
|
onClick: () => {
|
|
1589
|
-
|
|
1688
|
+
y !== null && l(y);
|
|
1590
1689
|
},
|
|
1591
1690
|
...Qe,
|
|
1592
|
-
children: /* @__PURE__ */
|
|
1691
|
+
children: /* @__PURE__ */ a(Io, {})
|
|
1593
1692
|
}
|
|
1594
1693
|
),
|
|
1595
|
-
/* @__PURE__ */
|
|
1694
|
+
/* @__PURE__ */ a("button", { type: "button", className: "aqmx-icon-button", "aria-label": t.imageFit, title: t.imageFit, "aria-pressed": o.mode === "fit", onClick: () => l(Nt), children: /* @__PURE__ */ a(Fo, {}) })
|
|
1596
1695
|
] }),
|
|
1597
|
-
/* @__PURE__ */
|
|
1696
|
+
/* @__PURE__ */ a(xe, { scrollerProps: Vo, children: /* @__PURE__ */ a("img", { ref: m, className: "aqmx-document-image", src: e.url, alt: e.name, "data-aqmx-image-mode": o.mode, style: S, onLoad: (M) => p(M.currentTarget), "data-testid": "markdown-explorer-image" }) })
|
|
1598
1697
|
] });
|
|
1599
|
-
},
|
|
1600
|
-
const e =
|
|
1698
|
+
}, wn = me(null), qe = me(void 0), bn = me(null), _e = () => {
|
|
1699
|
+
const e = re(wn);
|
|
1601
1700
|
if (e === null) throw new Error("[markdown-explorer] document links must be rendered inside a document pane");
|
|
1602
1701
|
return e;
|
|
1603
|
-
},
|
|
1604
|
-
const e =
|
|
1702
|
+
}, Yo = () => {
|
|
1703
|
+
const e = re(bn);
|
|
1605
1704
|
if (e === null) throw new Error("[markdown-explorer] table-of-contents entries must be rendered inside a document pane's links");
|
|
1606
1705
|
return e;
|
|
1607
|
-
}, Be = (e, t, n, r) => t.kind === "panel" ?
|
|
1706
|
+
}, Be = (e, t, n, r) => t.kind === "panel" ? pe(e, { view: "tree", source: n, doc: r }) : t.view === "single" ? pe(e, { view: "single", source: n, doc: r, overrides: t.overrides, embed: t.embed }) : pe(e, { view: "tree", source: n, doc: r, overrides: t.overrides }), Jo = ({ children: e }) => {
|
|
1608
1707
|
const { config: t } = D(), n = _e(), r = nt(), o = r.kind === "location" ? r.location.source : void 0, l = De(Be(t, n.navigation, o, n.currentPath));
|
|
1609
|
-
return /* @__PURE__ */
|
|
1610
|
-
},
|
|
1611
|
-
const t = e instanceof Element ? e.closest(
|
|
1708
|
+
return /* @__PURE__ */ a(qe, { value: o, children: /* @__PURE__ */ a(bn, { value: l, children: e }) });
|
|
1709
|
+
}, Qo = 'a[data-link-kind="doc"][data-doc-path]:not([data-doc-exists="false"])', el = (e) => {
|
|
1710
|
+
const t = e instanceof Element ? e.closest(Qo) : null;
|
|
1612
1711
|
return t === null ? null : t.getAttribute("data-doc-path");
|
|
1613
|
-
}, Ie = (e) => !e.defaultPrevented && e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey,
|
|
1712
|
+
}, Ie = (e) => !e.defaultPrevented && e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey, tl = ({ to: e, docPath: t, fragment: n, exists: r, className: o, attributes: l, onDocumentLink: i, scope: d, children: g }) => {
|
|
1614
1713
|
const f = De(e);
|
|
1615
|
-
return /* @__PURE__ */
|
|
1616
|
-
if (Ie(
|
|
1617
|
-
if (
|
|
1714
|
+
return /* @__PURE__ */ a("a", { ...l, href: f, className: o, "data-link-kind": "doc", "data-doc-path": t, "data-doc-exists": r, onClick: (p) => {
|
|
1715
|
+
if (Ie(p)) {
|
|
1716
|
+
if (p.preventDefault(), t === d.currentPath && n !== "") {
|
|
1618
1717
|
d.scrollWithin(n);
|
|
1619
1718
|
return;
|
|
1620
1719
|
}
|
|
1621
1720
|
i(t, n);
|
|
1622
1721
|
}
|
|
1623
|
-
}, children:
|
|
1624
|
-
},
|
|
1625
|
-
const { config: i } = D(), d = _e(),
|
|
1626
|
-
return u.kind === "page" ? /* @__PURE__ */
|
|
1627
|
-
},
|
|
1722
|
+
}, children: g });
|
|
1723
|
+
}, nl = ({ href: e, docPath: t, docExists: n, className: r, attributes: o, children: l }) => {
|
|
1724
|
+
const { config: i } = D(), d = _e(), g = re(qe), f = Ro(e), { navigation: u } = d, p = `${Be(i, u, g, t)}${f}`, m = n === !1 ? "false" : void 0;
|
|
1725
|
+
return u.kind === "page" ? /* @__PURE__ */ a(Qr, { ...o, to: p, navigation: "follow-link", className: r, "data-link-kind": "doc", "data-doc-path": t, "data-doc-exists": m, children: l }) : /* @__PURE__ */ a(tl, { to: p, docPath: t, fragment: f, exists: m, className: r, attributes: o, onDocumentLink: u.onDocumentLink, scope: d, children: l });
|
|
1726
|
+
}, rl = ({ className: e, attributes: t, children: n }) => {
|
|
1628
1727
|
const { labels: r } = D();
|
|
1629
1728
|
return (
|
|
1630
1729
|
/* @__PURE__ */ F("a", { ...t, className: e === void 0 ? "aqmx-document-inert-link" : `${e} aqmx-document-inert-link`, title: r.inertLink, "data-link-kind": "doc", "data-doc-exists": "false", children: [
|
|
@@ -1636,39 +1735,39 @@ const Mo = /* @__PURE__ */ y.forwardRef(Lo), Je = "data-aqmx-key-repeat", Qe = O
|
|
|
1636
1735
|
] })
|
|
1637
1736
|
] })
|
|
1638
1737
|
);
|
|
1639
|
-
},
|
|
1640
|
-
const { config: l } = D(), i =
|
|
1641
|
-
return /* @__PURE__ */
|
|
1738
|
+
}, ol = ({ href: e, className: t, attributes: n, scope: r, children: o }) => {
|
|
1739
|
+
const { config: l } = D(), i = re(qe), d = De(`${Be(l, r.navigation, i, r.currentPath)}${e}`);
|
|
1740
|
+
return /* @__PURE__ */ a("a", { ...n, href: d, className: t, onClick: (f) => {
|
|
1642
1741
|
Ie(f) && (f.preventDefault(), r.scrollWithin(e));
|
|
1643
1742
|
}, children: o });
|
|
1644
|
-
},
|
|
1743
|
+
}, ll = ({ href: e, className: t, attributes: n, children: r }) => {
|
|
1645
1744
|
const o = _e();
|
|
1646
|
-
return o.navigation.kind === "page" ? /* @__PURE__ */
|
|
1745
|
+
return o.navigation.kind === "page" ? /* @__PURE__ */ a("a", { ...n, href: e, className: t, onClick: (i) => {
|
|
1647
1746
|
if (!Ie(i)) return;
|
|
1648
1747
|
const d = i.currentTarget;
|
|
1649
1748
|
e === "#" ? o.followEmptyFragment(i.nativeEvent) : d.href === d.ownerDocument.URL && o.followSameUrlJump(e, i.nativeEvent);
|
|
1650
|
-
}, children: r }) : /* @__PURE__ */
|
|
1651
|
-
},
|
|
1652
|
-
const { config: e } = D(), t = _e(), n =
|
|
1749
|
+
}, children: r }) : /* @__PURE__ */ a(ol, { href: e, className: t, attributes: n, scope: o, children: r });
|
|
1750
|
+
}, il = ({ href: e, kind: t, docPath: n, docExists: r, className: o, attributes: l, children: i }) => t === "doc" ? n === void 0 || !Hn(n) ? /* @__PURE__ */ a(rl, { className: o, attributes: l, children: i }) : /* @__PURE__ */ a(nl, { href: e, docPath: n, docExists: r, className: o, attributes: l, children: i }) : e.startsWith("#") ? /* @__PURE__ */ a(ll, { href: e, className: o, attributes: l, children: i }) : /* @__PURE__ */ a("a", { ...l, href: e, className: o, children: i }), sl = () => {
|
|
1751
|
+
const { config: e } = D(), t = _e(), n = re(qe), r = $e();
|
|
1653
1752
|
return P(
|
|
1654
1753
|
(o, l) => {
|
|
1655
1754
|
if (!Ie(l)) return !0;
|
|
1656
1755
|
l.preventDefault();
|
|
1657
|
-
const i =
|
|
1756
|
+
const i = pn(o.id), { navigation: d } = t;
|
|
1658
1757
|
return d.kind === "panel" || lt(l.currentTarget.ownerDocument.location.hash) === o.id ? (t.scrollWithin(i), !0) : (r(`${Be(e, d, n, t.currentPath)}${i}`, "follow-link"), !0);
|
|
1659
1758
|
},
|
|
1660
1759
|
[e, t, n, r]
|
|
1661
1760
|
);
|
|
1662
|
-
},
|
|
1663
|
-
const e =
|
|
1664
|
-
return P((t) => `${e}${
|
|
1761
|
+
}, al = () => {
|
|
1762
|
+
const e = Yo();
|
|
1763
|
+
return P((t) => `${e}${pn(t.id)}`, [e]);
|
|
1665
1764
|
};
|
|
1666
|
-
function
|
|
1765
|
+
function cl({
|
|
1667
1766
|
title: e,
|
|
1668
1767
|
titleId: t,
|
|
1669
1768
|
...n
|
|
1670
1769
|
}, r) {
|
|
1671
|
-
return /* @__PURE__ */
|
|
1770
|
+
return /* @__PURE__ */ b.createElement("svg", Object.assign({
|
|
1672
1771
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1673
1772
|
viewBox: "0 0 20 20",
|
|
1674
1773
|
fill: "currentColor",
|
|
@@ -1676,19 +1775,19 @@ function Jo({
|
|
|
1676
1775
|
"data-slot": "icon",
|
|
1677
1776
|
ref: r,
|
|
1678
1777
|
"aria-labelledby": t
|
|
1679
|
-
}, n), e ? /* @__PURE__ */
|
|
1778
|
+
}, n), e ? /* @__PURE__ */ b.createElement("title", {
|
|
1680
1779
|
id: t
|
|
1681
|
-
}, e) : null, /* @__PURE__ */
|
|
1780
|
+
}, e) : null, /* @__PURE__ */ b.createElement("path", {
|
|
1682
1781
|
d: "M3 3.5A1.5 1.5 0 0 1 4.5 2h6.879a1.5 1.5 0 0 1 1.06.44l4.122 4.12A1.5 1.5 0 0 1 17 7.622V16.5a1.5 1.5 0 0 1-1.5 1.5h-11A1.5 1.5 0 0 1 3 16.5v-13Z"
|
|
1683
1782
|
}));
|
|
1684
1783
|
}
|
|
1685
|
-
const
|
|
1686
|
-
function
|
|
1784
|
+
const dl = /* @__PURE__ */ b.forwardRef(cl);
|
|
1785
|
+
function ul({
|
|
1687
1786
|
title: e,
|
|
1688
1787
|
titleId: t,
|
|
1689
1788
|
...n
|
|
1690
1789
|
}, r) {
|
|
1691
|
-
return /* @__PURE__ */
|
|
1790
|
+
return /* @__PURE__ */ b.createElement("svg", Object.assign({
|
|
1692
1791
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1693
1792
|
viewBox: "0 0 20 20",
|
|
1694
1793
|
fill: "currentColor",
|
|
@@ -1696,21 +1795,21 @@ function el({
|
|
|
1696
1795
|
"data-slot": "icon",
|
|
1697
1796
|
ref: r,
|
|
1698
1797
|
"aria-labelledby": t
|
|
1699
|
-
}, n), e ? /* @__PURE__ */
|
|
1798
|
+
}, n), e ? /* @__PURE__ */ b.createElement("title", {
|
|
1700
1799
|
id: t
|
|
1701
|
-
}, e) : null, /* @__PURE__ */
|
|
1800
|
+
}, e) : null, /* @__PURE__ */ b.createElement("path", {
|
|
1702
1801
|
fillRule: "evenodd",
|
|
1703
1802
|
d: "M1 4.75C1 3.784 1.784 3 2.75 3h14.5c.966 0 1.75.784 1.75 1.75v10.515a1.75 1.75 0 0 1-1.75 1.75h-1.5c-.078 0-.155-.005-.23-.015H4.48c-.075.01-.152.015-.23.015h-1.5A1.75 1.75 0 0 1 1 15.265V4.75Zm16.5 7.385V11.01a.25.25 0 0 0-.25-.25h-1.5a.25.25 0 0 0-.25.25v1.125c0 .138.112.25.25.25h1.5a.25.25 0 0 0 .25-.25Zm0 2.005a.25.25 0 0 0-.25-.25h-1.5a.25.25 0 0 0-.25.25v1.125c0 .108.069.2.165.235h1.585a.25.25 0 0 0 .25-.25v-1.11Zm-15 1.11v-1.11a.25.25 0 0 1 .25-.25h1.5a.25.25 0 0 1 .25.25v1.125a.25.25 0 0 1-.164.235H2.75a.25.25 0 0 1-.25-.25Zm2-4.24v1.125a.25.25 0 0 1-.25.25h-1.5a.25.25 0 0 1-.25-.25V11.01a.25.25 0 0 1 .25-.25h1.5a.25.25 0 0 1 .25.25Zm13-2.005V7.88a.25.25 0 0 0-.25-.25h-1.5a.25.25 0 0 0-.25.25v1.125c0 .138.112.25.25.25h1.5a.25.25 0 0 0 .25-.25ZM4.25 7.63a.25.25 0 0 1 .25.25v1.125a.25.25 0 0 1-.25.25h-1.5a.25.25 0 0 1-.25-.25V7.88a.25.25 0 0 1 .25-.25h1.5Zm0-3.13a.25.25 0 0 1 .25.25v1.125a.25.25 0 0 1-.25.25h-1.5a.25.25 0 0 1-.25-.25V4.75a.25.25 0 0 1 .25-.25h1.5Zm11.5 1.625a.25.25 0 0 1-.25-.25V4.75a.25.25 0 0 1 .25-.25h1.5a.25.25 0 0 1 .25.25v1.125a.25.25 0 0 1-.25.25h-1.5Zm-9 3.125a.75.75 0 0 0 0 1.5h6.5a.75.75 0 0 0 0-1.5h-6.5Z",
|
|
1704
1803
|
clipRule: "evenodd"
|
|
1705
1804
|
}));
|
|
1706
1805
|
}
|
|
1707
|
-
const
|
|
1708
|
-
function
|
|
1806
|
+
const fl = /* @__PURE__ */ b.forwardRef(ul);
|
|
1807
|
+
function ml({
|
|
1709
1808
|
title: e,
|
|
1710
1809
|
titleId: t,
|
|
1711
1810
|
...n
|
|
1712
1811
|
}, r) {
|
|
1713
|
-
return /* @__PURE__ */
|
|
1812
|
+
return /* @__PURE__ */ b.createElement("svg", Object.assign({
|
|
1714
1813
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1715
1814
|
viewBox: "0 0 20 20",
|
|
1716
1815
|
fill: "currentColor",
|
|
@@ -1718,49 +1817,49 @@ function nl({
|
|
|
1718
1817
|
"data-slot": "icon",
|
|
1719
1818
|
ref: r,
|
|
1720
1819
|
"aria-labelledby": t
|
|
1721
|
-
}, n), e ? /* @__PURE__ */
|
|
1820
|
+
}, n), e ? /* @__PURE__ */ b.createElement("title", {
|
|
1722
1821
|
id: t
|
|
1723
|
-
}, e) : null, /* @__PURE__ */
|
|
1822
|
+
}, e) : null, /* @__PURE__ */ b.createElement("path", {
|
|
1724
1823
|
fillRule: "evenodd",
|
|
1725
1824
|
d: "M17.721 1.599a.75.75 0 0 1 .279.583v11.29a2.25 2.25 0 0 1-1.774 2.2l-2.041.44a2.216 2.216 0 0 1-.938-4.332l2.662-.577a.75.75 0 0 0 .591-.733V6.112l-8 1.73v7.684a2.25 2.25 0 0 1-1.774 2.2l-2.042.44a2.216 2.216 0 1 1-.935-4.331l2.659-.573A.75.75 0 0 0 7 12.529V4.236a.75.75 0 0 1 .591-.733l9.5-2.054a.75.75 0 0 1 .63.15Z",
|
|
1726
1825
|
clipRule: "evenodd"
|
|
1727
1826
|
}));
|
|
1728
1827
|
}
|
|
1729
|
-
const
|
|
1828
|
+
const hl = /* @__PURE__ */ b.forwardRef(ml), pl = Object.freeze({ className: "aqmx-document-stage" }), gl = (e) => {
|
|
1730
1829
|
switch (e) {
|
|
1731
1830
|
case "video":
|
|
1732
|
-
return /* @__PURE__ */
|
|
1831
|
+
return /* @__PURE__ */ a(fl, {});
|
|
1733
1832
|
case "audio":
|
|
1734
|
-
return /* @__PURE__ */
|
|
1833
|
+
return /* @__PURE__ */ a(hl, {});
|
|
1735
1834
|
case "pdf":
|
|
1736
|
-
return /* @__PURE__ */
|
|
1835
|
+
return /* @__PURE__ */ a(dl, {});
|
|
1737
1836
|
default: {
|
|
1738
1837
|
const t = e;
|
|
1739
1838
|
throw new RangeError(`[markdown-explorer] unknown media type ${String(t)}`);
|
|
1740
1839
|
}
|
|
1741
1840
|
}
|
|
1742
|
-
},
|
|
1841
|
+
}, vl = ({ document: e }) => {
|
|
1743
1842
|
const { labels: t } = D();
|
|
1744
1843
|
switch (e.mediaType) {
|
|
1745
1844
|
case "video":
|
|
1746
1845
|
return (
|
|
1747
|
-
/* @__PURE__ */
|
|
1846
|
+
/* @__PURE__ */ a("video", { className: "aqmx-document-video", src: e.url, controls: !0, preload: "metadata", "aria-label": e.name, "data-testid": "markdown-explorer-media-player", children: t.mediaUnsupported })
|
|
1748
1847
|
);
|
|
1749
1848
|
case "audio":
|
|
1750
1849
|
return (
|
|
1751
|
-
/* @__PURE__ */
|
|
1850
|
+
/* @__PURE__ */ a("audio", { className: "aqmx-document-audio", src: e.url, controls: !0, preload: "metadata", "aria-label": e.name, "data-testid": "markdown-explorer-media-player", children: t.mediaUnsupported })
|
|
1752
1851
|
);
|
|
1753
1852
|
case "pdf":
|
|
1754
|
-
return /* @__PURE__ */
|
|
1853
|
+
return /* @__PURE__ */ a("iframe", { className: "aqmx-document-frame", src: e.url, title: e.name, "data-testid": "markdown-explorer-media-player" });
|
|
1755
1854
|
default: {
|
|
1756
1855
|
const n = e.mediaType;
|
|
1757
1856
|
throw new RangeError(`[markdown-explorer] unknown media type ${String(n)}`);
|
|
1758
1857
|
}
|
|
1759
1858
|
}
|
|
1760
|
-
},
|
|
1761
|
-
/* @__PURE__ */
|
|
1762
|
-
/* @__PURE__ */
|
|
1763
|
-
] }),
|
|
1859
|
+
}, wl = ({ document: e }) => /* @__PURE__ */ F("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-media-view", "data-aqmx-media-type": e.mediaType, children: [
|
|
1860
|
+
/* @__PURE__ */ a(Pe, { name: e.name, openUrl: e.url, downloadUrl: e.url, icon: gl(e.mediaType) }),
|
|
1861
|
+
/* @__PURE__ */ a(xe, { scrollerProps: pl, children: /* @__PURE__ */ a(vl, { document: e }) })
|
|
1862
|
+
] }), bl = (e) => ({
|
|
1764
1863
|
loading: e.viewerLoading,
|
|
1765
1864
|
errorPrefix: e.viewerErrorPrefix,
|
|
1766
1865
|
styleTitle: e.viewerStyleTitle,
|
|
@@ -1794,144 +1893,144 @@ const rl = /* @__PURE__ */ y.forwardRef(nl), ol = Object.freeze({ className: "aq
|
|
|
1794
1893
|
embeddedVideo: e.viewerEmbeddedVideo,
|
|
1795
1894
|
embeddedPost: e.viewerEmbeddedPost,
|
|
1796
1895
|
embeddedFrame: e.viewerEmbeddedFrame
|
|
1797
|
-
}),
|
|
1896
|
+
}), En = (e, t, n) => {
|
|
1798
1897
|
if (t !== void 0) return t;
|
|
1799
1898
|
if (n !== void 0) return n;
|
|
1800
1899
|
const [r] = e.documentStyles;
|
|
1801
1900
|
if (r === void 0) throw new Error("[markdown-explorer] the configuration has no document style");
|
|
1802
1901
|
return r.name;
|
|
1803
|
-
},
|
|
1902
|
+
}, yn = (e, t) => e !== void 0 ? e : t !== void 0 ? t : ar, it = Object.freeze(["l1", "l2", "l3", "l4", "l5", "l6", "l7", "l8"]), El = (e, t, n) => {
|
|
1804
1903
|
if (t.view === "multi" || t.overrides[n] === void 0) return null;
|
|
1805
1904
|
const r = n === "style" ? { align: t.overrides.align } : { style: t.overrides.style };
|
|
1806
|
-
return
|
|
1905
|
+
return pe(e, { ...t, overrides: r });
|
|
1807
1906
|
}, st = ({ kind: e, view: t, label: n, stale: r, busy: o, frameRef: l, intent: i, children: d }) => {
|
|
1808
|
-
const
|
|
1907
|
+
const g = re(fe);
|
|
1809
1908
|
return (
|
|
1810
|
-
/* @__PURE__ */ F("section", { ref: l, role: "region", "aria-label": n, "aria-busy": o, "data-testid": "markdown-explorer-document", "data-aqmx-document-kind": e, "data-aqmx-document-view": t, "data-aqmx-document-flow":
|
|
1811
|
-
r ? /* @__PURE__ */
|
|
1909
|
+
/* @__PURE__ */ F("section", { ref: l, role: "region", "aria-label": n, "aria-busy": o, "data-testid": "markdown-explorer-document", "data-aqmx-document-kind": e, "data-aqmx-document-view": t, "data-aqmx-document-flow": g, className: "aqmx-document", ...i, children: [
|
|
1910
|
+
r ? /* @__PURE__ */ a("div", { className: "aqmx-progress", "aria-hidden": "true", "data-testid": "markdown-explorer-document-progress" }) : null,
|
|
1812
1911
|
d
|
|
1813
1912
|
] })
|
|
1814
1913
|
);
|
|
1815
|
-
},
|
|
1914
|
+
}, yl = () => {
|
|
1816
1915
|
const { labels: e } = D();
|
|
1817
|
-
return /* @__PURE__ */
|
|
1818
|
-
},
|
|
1916
|
+
return /* @__PURE__ */ a(st, { kind: "empty", label: e.documentRegion, stale: !1, busy: !1, children: /* @__PURE__ */ a("div", { className: "aqmx-empty", "data-testid": "markdown-explorer-document-empty", children: /* @__PURE__ */ a("p", { className: "aqmx-empty-title", children: e.documentEmpty }) }) });
|
|
1917
|
+
}, xn = ({ label: e }) => {
|
|
1819
1918
|
const { labels: t } = D();
|
|
1820
1919
|
return /* @__PURE__ */ F(st, { kind: "loading", label: e, stale: !1, busy: !0, children: [
|
|
1821
|
-
/* @__PURE__ */
|
|
1822
|
-
/* @__PURE__ */
|
|
1920
|
+
/* @__PURE__ */ a("div", { className: "aqmx-skeleton", "aria-hidden": "true", "data-testid": "markdown-explorer-document-skeleton", children: it.map((n) => /* @__PURE__ */ a("span", {}, n)) }),
|
|
1921
|
+
/* @__PURE__ */ a("p", { className: "aqmx-sr-only", children: t.documentLoading })
|
|
1823
1922
|
] });
|
|
1824
|
-
},
|
|
1825
|
-
const { reportMathDiagnostics: o, edits: l } = D(), i = U(() => ({ htmlContent: t.htmlContent, headings: [...t.headings] }), [t]), d =
|
|
1923
|
+
}, Ft = Object.freeze(["wheel", "touchstart", "pointerdown", "keydown"]), xl = ({ path: e, document: t, viewer: n, editing: r }) => {
|
|
1924
|
+
const { reportMathDiagnostics: o, edits: l } = D(), i = U(() => ({ htmlContent: t.htmlContent, headings: [...t.headings] }), [t]), d = sl(), g = al(), f = U(() => o === void 0 ? void 0 : (h) => o(e, h), [o, e]), u = B(null), { editable: p, doubleClick: m, region: x, paneScroll: O, stale: y } = r;
|
|
1826
1925
|
V(() => {
|
|
1827
|
-
if (
|
|
1926
|
+
if (p)
|
|
1828
1927
|
return l.bindView(e, {
|
|
1829
1928
|
anchor: () => {
|
|
1830
|
-
const h = u.current, w =
|
|
1831
|
-
return h === null || w === null ||
|
|
1929
|
+
const h = u.current, w = x(), k = h === null ? null : h.querySelector(Fe);
|
|
1930
|
+
return h === null || w === null || k === null ? null : Vr(h, O.scrollerOf(w, k));
|
|
1832
1931
|
}
|
|
1833
1932
|
});
|
|
1834
|
-
}, [l, e,
|
|
1933
|
+
}, [l, e, p, x, O]);
|
|
1835
1934
|
const T = (h) => {
|
|
1836
|
-
const w = u.current, { target:
|
|
1837
|
-
!m || w === null || !(
|
|
1838
|
-
},
|
|
1935
|
+
const w = u.current, { target: k } = h;
|
|
1936
|
+
!m || w === null || !(k instanceof Element) || !Ur(k) || (h.stopPropagation(), l.start(e, Zr(k, w, w.ownerDocument.getSelection())));
|
|
1937
|
+
}, S = B(null), M = B(y);
|
|
1839
1938
|
V(() => {
|
|
1840
|
-
M.current =
|
|
1939
|
+
M.current = y;
|
|
1841
1940
|
});
|
|
1842
1941
|
const s = ie((h) => {
|
|
1843
|
-
const w = u.current,
|
|
1844
|
-
if (
|
|
1845
|
-
const R = O.scrollerOf(
|
|
1846
|
-
return R.scrollTop +=
|
|
1847
|
-
}),
|
|
1848
|
-
const w =
|
|
1942
|
+
const w = u.current, k = x(), L = w === null ? null : Yr(w, h.line);
|
|
1943
|
+
if (k === null || L === null) return !1;
|
|
1944
|
+
const R = O.scrollerOf(k, L);
|
|
1945
|
+
return R.scrollTop += Jr(L, h.line) - h.clientTop, !0;
|
|
1946
|
+
}), c = ie((h) => {
|
|
1947
|
+
const w = x();
|
|
1849
1948
|
if (w === null) return;
|
|
1850
|
-
const
|
|
1851
|
-
for (const R of
|
|
1852
|
-
|
|
1853
|
-
}, L = () =>
|
|
1854
|
-
for (const R of
|
|
1855
|
-
|
|
1949
|
+
const k = () => {
|
|
1950
|
+
for (const R of Ft) w.removeEventListener(R, L, !0);
|
|
1951
|
+
S.current?.release === k && (S.current = null);
|
|
1952
|
+
}, L = () => k();
|
|
1953
|
+
for (const R of Ft) w.addEventListener(R, L, { capture: !0, passive: !0 });
|
|
1954
|
+
S.current = { point: h, release: k };
|
|
1856
1955
|
});
|
|
1857
1956
|
return V(() => {
|
|
1858
1957
|
const h = l.takeReturn(e);
|
|
1859
1958
|
if (h !== null)
|
|
1860
1959
|
return queueMicrotask(() => {
|
|
1861
|
-
s(h) && M.current &&
|
|
1862
|
-
}), () =>
|
|
1960
|
+
s(h) && M.current && c(h);
|
|
1961
|
+
}), () => S.current?.release();
|
|
1863
1962
|
}, [l, e]), V(() => {
|
|
1864
|
-
const h =
|
|
1865
|
-
h === null ||
|
|
1866
|
-
}, [t,
|
|
1867
|
-
/* @__PURE__ */
|
|
1963
|
+
const h = S.current;
|
|
1964
|
+
h === null || y || (h.release(), s(h.point));
|
|
1965
|
+
}, [t, y]),
|
|
1966
|
+
/* @__PURE__ */ a("div", { ref: u, className: "aqmx-document-viewer", onDoubleClick: T, children: /* @__PURE__ */ a(Wt, { ...n, onHeadingSelect: d, headingHref: g, onMathDiagnostics: f, parseResult: i, content: null }) });
|
|
1868
1967
|
}, kn = ({ document: e, viewer: t }) => {
|
|
1869
1968
|
const { labels: n } = D();
|
|
1870
1969
|
return /* @__PURE__ */ F(Ne, { children: [
|
|
1871
|
-
/* @__PURE__ */
|
|
1872
|
-
e.truncated ? /* @__PURE__ */
|
|
1873
|
-
/* @__PURE__ */
|
|
1970
|
+
/* @__PURE__ */ a(Pe, { name: e.name, openUrl: zn(e.url), downloadUrl: e.url, icon: /* @__PURE__ */ a(Fr, {}), children: e.truncated ? null : /* @__PURE__ */ a(po, { text: e.text }) }),
|
|
1971
|
+
e.truncated ? /* @__PURE__ */ a("p", { className: "aqmx-callout aqmx-document-notice", role: "note", "data-testid": "markdown-explorer-text-truncated", children: n.textTruncated }) : null,
|
|
1972
|
+
/* @__PURE__ */ a("div", { className: "aqmx-document-viewer", children: /* @__PURE__ */ a(Wt, { ...t, parseResult: null, content: e.text }) })
|
|
1874
1973
|
] });
|
|
1875
|
-
},
|
|
1876
|
-
const { data: r, documents: o, announcer: l, labels: i } = D(), d = P(() => o.answerStampOf(e), [o, e]),
|
|
1877
|
-
|
|
1974
|
+
}, kl = ({ path: e, name: t, viewer: n }) => {
|
|
1975
|
+
const { data: r, documents: o, announcer: l, labels: i } = D(), d = P(() => o.answerStampOf(e), [o, e]), g = te(o.subscribe, d, d), [f, u] = I(0), p = U(() => ({ path: e, stamp: g, attempt: f }), [e, g, f]), [m, x] = I(null), O = ie((T) => {
|
|
1976
|
+
x(T), T.kind === "failure" && l.announce(i.documentFailed(t, ae(i, T.failure.reason)));
|
|
1878
1977
|
});
|
|
1879
|
-
|
|
1978
|
+
ne(() => {
|
|
1880
1979
|
const T = new AbortController();
|
|
1881
|
-
return r.text(
|
|
1882
|
-
"kind" in
|
|
1980
|
+
return r.text(p.path, T.signal).then((S) => {
|
|
1981
|
+
"kind" in S && O(S);
|
|
1883
1982
|
}), () => T.abort();
|
|
1884
|
-
}, [r,
|
|
1885
|
-
const
|
|
1983
|
+
}, [r, p]);
|
|
1984
|
+
const y = P(() => u((T) => T + 1), []);
|
|
1886
1985
|
return m === null ? /* @__PURE__ */ F(Ne, { children: [
|
|
1887
|
-
/* @__PURE__ */
|
|
1888
|
-
/* @__PURE__ */
|
|
1889
|
-
] }) : m.kind === "failure" ? /* @__PURE__ */
|
|
1890
|
-
}, Sn = Object.freeze({ className: "aqmx-document-failure", "data-aqmx-document-scroller": "" }),
|
|
1891
|
-
|
|
1986
|
+
/* @__PURE__ */ a("div", { className: "aqmx-skeleton", "aria-hidden": "true", "data-testid": "markdown-explorer-markup-skeleton", children: it.map((T) => /* @__PURE__ */ a("span", {}, T)) }),
|
|
1987
|
+
/* @__PURE__ */ a("p", { className: "aqmx-sr-only", children: i.markupLoading })
|
|
1988
|
+
] }) : m.kind === "failure" ? /* @__PURE__ */ a(xe, { scrollerProps: Sn, children: /* @__PURE__ */ a(ve, { failure: m.failure, alert: !1, onRetry: y, testId: "markdown-explorer-markup-failure" }) }) : /* @__PURE__ */ a(kn, { document: m, viewer: n });
|
|
1989
|
+
}, Sn = Object.freeze({ className: "aqmx-document-failure", "data-aqmx-document-scroller": "" }), Sl = Object.freeze({ reason: "failed" }), Rl = (e) => /* @__PURE__ */ a(
|
|
1990
|
+
_r,
|
|
1892
1991
|
{
|
|
1893
|
-
fallback: (t) => /* @__PURE__ */
|
|
1894
|
-
children: /* @__PURE__ */
|
|
1895
|
-
|
|
1992
|
+
fallback: (t) => /* @__PURE__ */ a("div", { className: "aqmx-edit-message", children: /* @__PURE__ */ a(ve, { failure: Sl, alert: !1, onRetry: t, testId: "markdown-explorer-edit-load-failure" }) }),
|
|
1993
|
+
children: /* @__PURE__ */ a(
|
|
1994
|
+
ge,
|
|
1896
1995
|
{
|
|
1897
|
-
fallback: /* @__PURE__ */
|
|
1898
|
-
children: /* @__PURE__ */
|
|
1996
|
+
fallback: /* @__PURE__ */ a("div", { className: "aqmx-skeleton", "aria-hidden": "true", "data-testid": "markdown-explorer-edit-skeleton", children: it.map((t) => /* @__PURE__ */ a("span", {}, t)) }),
|
|
1997
|
+
children: /* @__PURE__ */ a(qr, { ...e })
|
|
1899
1998
|
}
|
|
1900
1999
|
)
|
|
1901
2000
|
}
|
|
1902
|
-
),
|
|
2001
|
+
), Tl = ({ path: e, document: t, view: n, viewer: r, onRetry: o, editing: l }) => {
|
|
1903
2002
|
switch (t.kind) {
|
|
1904
2003
|
case "markdown": {
|
|
1905
|
-
const { session: i, layout: d, region:
|
|
1906
|
-
if (n === "edit" && i !== void 0) return /* @__PURE__ */
|
|
1907
|
-
if (n === "markup") return /* @__PURE__ */
|
|
1908
|
-
const
|
|
1909
|
-
return /* @__PURE__ */
|
|
2004
|
+
const { session: i, layout: d, region: g, paneScroll: f, stale: u } = l;
|
|
2005
|
+
if (n === "edit" && i !== void 0) return /* @__PURE__ */ a(Rl, { path: e, name: t.name, session: i, layout: d, viewer: r, region: g, paneScroll: f });
|
|
2006
|
+
if (n === "markup") return /* @__PURE__ */ a(kl, { path: e, name: t.name, viewer: r });
|
|
2007
|
+
const p = t.edit !== null && t.edit.kind === "inline";
|
|
2008
|
+
return /* @__PURE__ */ a(xl, { path: e, document: t, viewer: r, editing: { editable: p, doubleClick: p && d === "fill", region: g, paneScroll: f, stale: u } });
|
|
1910
2009
|
}
|
|
1911
2010
|
case "text":
|
|
1912
|
-
return /* @__PURE__ */
|
|
2011
|
+
return /* @__PURE__ */ a(kn, { document: t, viewer: r });
|
|
1913
2012
|
case "image":
|
|
1914
|
-
return /* @__PURE__ */
|
|
2013
|
+
return /* @__PURE__ */ a(Xo, { document: t });
|
|
1915
2014
|
case "media":
|
|
1916
|
-
return /* @__PURE__ */
|
|
2015
|
+
return /* @__PURE__ */ a(wl, { document: t });
|
|
1917
2016
|
case "file":
|
|
1918
|
-
return /* @__PURE__ */
|
|
2017
|
+
return /* @__PURE__ */ a(So, { document: t });
|
|
1919
2018
|
case "failure":
|
|
1920
|
-
return /* @__PURE__ */
|
|
2019
|
+
return /* @__PURE__ */ a(xe, { scrollerProps: Sn, children: /* @__PURE__ */ a(ve, { failure: t.failure, alert: !1, onRetry: o, testId: "markdown-explorer-document-failure" }) });
|
|
1921
2020
|
default: {
|
|
1922
2021
|
const i = t;
|
|
1923
2022
|
throw new RangeError(`[markdown-explorer] unknown document kind in ${JSON.stringify(i)}`);
|
|
1924
2023
|
}
|
|
1925
2024
|
}
|
|
1926
|
-
},
|
|
1927
|
-
const [r] = t.kind === "markdown" ? t.headings : [], o = [n === null ? null :
|
|
2025
|
+
}, Cl = 'a[href], button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), iframe, audio[controls], video[controls], [tabindex]:not([tabindex="-1"])', Ol = (e, t, n) => {
|
|
2026
|
+
const [r] = t.kind === "markdown" ? t.headings : [], o = [n === null ? null : vn(e, n), r === void 0 ? null : gn(e, r.id), e.querySelector(Fe), e.querySelector(Cl)];
|
|
1928
2027
|
for (const l of o)
|
|
1929
|
-
if (l instanceof HTMLElement &&
|
|
2028
|
+
if (l instanceof HTMLElement && dn(l)) return l;
|
|
1930
2029
|
return null;
|
|
1931
|
-
},
|
|
2030
|
+
}, qt = (e, t, n) => {
|
|
1932
2031
|
const { activeElement: r, body: o } = e.ownerDocument, l = r === null || r === o;
|
|
1933
|
-
t instanceof HTMLElement && n && (l || e.contains(r)) &&
|
|
1934
|
-
},
|
|
2032
|
+
t instanceof HTMLElement && n && (l || e.contains(r)) && dn(t);
|
|
2033
|
+
}, Al = (e) => {
|
|
1935
2034
|
const t = B(!1);
|
|
1936
2035
|
return V(() => {
|
|
1937
2036
|
const n = e.current;
|
|
@@ -1943,32 +2042,32 @@ const rl = /* @__PURE__ */ y.forwardRef(nl), ol = Object.freeze({ className: "aq
|
|
|
1943
2042
|
l = !(m.target instanceof Node && n.contains(m.target)), l && !n.contains(r.activeElement) && (t.current = !1), clearTimeout(i), i = setTimeout(() => {
|
|
1944
2043
|
l = !1;
|
|
1945
2044
|
}, 0);
|
|
1946
|
-
},
|
|
2045
|
+
}, g = (m) => {
|
|
1947
2046
|
t.current = m.target instanceof Node && n.contains(m.target);
|
|
1948
2047
|
}, f = (m) => {
|
|
1949
2048
|
m.relatedTarget === null && l && (t.current = !1);
|
|
1950
2049
|
}, u = () => {
|
|
1951
|
-
const { activeElement: m, body:
|
|
1952
|
-
m !== null && m !==
|
|
1953
|
-
},
|
|
2050
|
+
const { activeElement: m, body: x } = r;
|
|
2051
|
+
m !== null && m !== x && (t.current = n.contains(m));
|
|
2052
|
+
}, p = () => {
|
|
1954
2053
|
l && !n.contains(r.activeElement) && (t.current = !1);
|
|
1955
2054
|
};
|
|
1956
|
-
return o.addEventListener("pointerdown", d, !0), o.addEventListener("mousedown", d, !0), o.addEventListener("focusin",
|
|
1957
|
-
clearTimeout(i), o.removeEventListener("pointerdown", d, !0), o.removeEventListener("mousedown", d, !0), o.removeEventListener("focusin",
|
|
2055
|
+
return o.addEventListener("pointerdown", d, !0), o.addEventListener("mousedown", d, !0), o.addEventListener("focusin", g, !0), o.addEventListener("blur", u), o.addEventListener("focus", p), n.addEventListener("focusout", f), () => {
|
|
2056
|
+
clearTimeout(i), o.removeEventListener("pointerdown", d, !0), o.removeEventListener("mousedown", d, !0), o.removeEventListener("focusin", g, !0), o.removeEventListener("blur", u), o.removeEventListener("focus", p), n.removeEventListener("focusout", f);
|
|
1958
2057
|
};
|
|
1959
2058
|
}, [e]), t;
|
|
1960
|
-
},
|
|
1961
|
-
const { labels:
|
|
2059
|
+
}, Ll = ({ path: e, snapshot: t, markup: n, stale: r, viewer: o, editLayout: l, regionLabel: i, navigation: d, fragment: g, paneScroll: f, announces: u, announceFailure: p, onDocumentShown: m }) => {
|
|
2060
|
+
const { labels: x, announcer: O, documents: y } = D(), { document: T } = t, S = B(null), M = B(null), s = B(null), c = B(0), h = Al(S), w = B({ path: e, document: T }), k = B(null), L = P(
|
|
1962
2061
|
(z) => {
|
|
1963
|
-
const K =
|
|
1964
|
-
K !== null && Q !== null &&
|
|
2062
|
+
const K = S.current, Q = Mt(K, z, f);
|
|
2063
|
+
K !== null && Q !== null && qt(K, Q, h.current);
|
|
1965
2064
|
},
|
|
1966
2065
|
[f, h]
|
|
1967
2066
|
), R = P(
|
|
1968
2067
|
(z, K) => {
|
|
1969
|
-
const Q =
|
|
2068
|
+
const Q = c.current;
|
|
1970
2069
|
setTimeout(() => {
|
|
1971
|
-
!K.defaultPrevented &&
|
|
2070
|
+
!K.defaultPrevented && c.current === Q && L(z);
|
|
1972
2071
|
}, 0);
|
|
1973
2072
|
},
|
|
1974
2073
|
[L]
|
|
@@ -1979,81 +2078,81 @@ const rl = /* @__PURE__ */ y.forwardRef(nl), ol = Object.freeze({ className: "aq
|
|
|
1979
2078
|
}, 0);
|
|
1980
2079
|
},
|
|
1981
2080
|
[L]
|
|
1982
|
-
), q = U(() => ({ navigation: d, currentPath: e, scrollWithin: L, followSameUrlJump: R, followEmptyFragment: N }), [d, e, L, R, N]), W = P(() =>
|
|
2081
|
+
), q = U(() => ({ navigation: d, currentPath: e, scrollWithin: L, followSameUrlJump: R, followEmptyFragment: N }), [d, e, L, R, N]), W = P(() => y.retry(e), [y, e]), J = eo(y, el), ee = sn(e), X = ee !== void 0 ? "edit" : n ? "markup" : "rendered", $ = T.kind === "markdown" ? X : void 0, G = P(() => S.current, []), v = U(() => ({ session: ee, layout: l, region: G, paneScroll: f, stale: r }), [ee, l, G, f, r]), E = $ === "edit" ? !1 : r, C = re(fe), A = $ === "edit" && l === "fill" ? "fill" : C, _ = ie((z, K) => {
|
|
1983
2082
|
const Q = M.current;
|
|
1984
2083
|
if (Q !== null && Q.path === z && Q.snapshot === K) return;
|
|
1985
2084
|
M.current = { path: z, snapshot: K };
|
|
1986
|
-
const
|
|
1987
|
-
if (
|
|
1988
|
-
|
|
2085
|
+
const oe = K.document;
|
|
2086
|
+
if (oe.kind === "failure") {
|
|
2087
|
+
y.noteFailureShown(K) && p(x.documentFailed(Ee(z), ae(x, oe.failure.reason)));
|
|
1989
2088
|
return;
|
|
1990
2089
|
}
|
|
1991
|
-
m?.(z,
|
|
2090
|
+
m?.(z, oe), u && (Q === null || Q.path !== z || Q.snapshot.document.kind === "failure") && O.announce(x.documentShown(oe.name));
|
|
1992
2091
|
});
|
|
1993
|
-
|
|
2092
|
+
ne(() => {
|
|
1994
2093
|
_(e, t);
|
|
1995
2094
|
}, [e, t]);
|
|
1996
2095
|
const j = ie(() => {
|
|
1997
|
-
|
|
2096
|
+
g.kind === "panel" && g.consume();
|
|
1998
2097
|
}), Z = ie((z) => {
|
|
1999
|
-
const K =
|
|
2098
|
+
const K = S.current;
|
|
2000
2099
|
if (K === null || !h.current) return null;
|
|
2001
|
-
const { activeElement: Q, body:
|
|
2002
|
-
return Q !== null && Q !==
|
|
2100
|
+
const { activeElement: Q, body: oe } = K.ownerDocument;
|
|
2101
|
+
return Q !== null && Q !== oe ? null : Ol(K, T, z);
|
|
2003
2102
|
}), H = ie((z) => {
|
|
2004
|
-
const K =
|
|
2005
|
-
K !== null &&
|
|
2006
|
-
}), le = ie((z) => f.reveal(z)), ct = ie((z) =>
|
|
2007
|
-
return
|
|
2103
|
+
const K = S.current;
|
|
2104
|
+
K !== null && qt(K, z, h.current);
|
|
2105
|
+
}), le = ie((z) => f.reveal(z)), ct = ie((z) => Mt(S.current, z, f));
|
|
2106
|
+
return ne(() => {
|
|
2008
2107
|
if (r) return;
|
|
2009
2108
|
const z = w.current.path !== e, K = z || w.current.document !== T;
|
|
2010
2109
|
w.current = { path: e, document: T };
|
|
2011
|
-
const Q =
|
|
2012
|
-
|
|
2013
|
-
let
|
|
2014
|
-
|
|
2110
|
+
const Q = k.current !== e;
|
|
2111
|
+
k.current = e;
|
|
2112
|
+
let oe = null;
|
|
2113
|
+
g.kind === "page" ? s.current !== g.navigation && (s.current = g.navigation, c.current += 1, oe = g.fragment) : g.fragment !== null && (oe = g.fragment, j());
|
|
2015
2114
|
const dt = () => {
|
|
2016
|
-
const je =
|
|
2115
|
+
const je = oe === null ? null : ct(oe);
|
|
2017
2116
|
if (!K) {
|
|
2018
2117
|
je !== null && H(je);
|
|
2019
2118
|
return;
|
|
2020
2119
|
}
|
|
2021
|
-
const ut = Z(
|
|
2120
|
+
const ut = Z(g.fragment);
|
|
2022
2121
|
z && je === null && ut !== null && le(ut);
|
|
2023
2122
|
};
|
|
2024
2123
|
Q ? queueMicrotask(dt) : dt();
|
|
2025
|
-
}, [
|
|
2026
|
-
}, at = Object.freeze({ kind: "skeleton" }),
|
|
2124
|
+
}, [g, e, T, r]), /* @__PURE__ */ a(fe, { value: A, children: /* @__PURE__ */ a(st, { kind: T.kind, view: $, label: i(e, T), stale: E, busy: E, frameRef: S, intent: J, children: /* @__PURE__ */ a(wn, { value: q, children: /* @__PURE__ */ a(Jo, { children: /* @__PURE__ */ a(Tl, { path: e, document: T, view: X, viewer: o, onRetry: W, editing: v }, e) }) }) }) });
|
|
2125
|
+
}, at = Object.freeze({ kind: "skeleton" }), Ml = (e, t, n, r, o) => {
|
|
2027
2126
|
if (t?.status === "loaded") return { kind: "document", path: e, snapshot: t, stale: !1 };
|
|
2028
2127
|
const l = de(t);
|
|
2029
2128
|
if (l !== null) return { kind: "document", path: e, snapshot: l, stale: !0 };
|
|
2030
2129
|
if (o && t?.status === "pending") return { kind: "streaming", path: e, promise: t.promise };
|
|
2031
2130
|
const i = n === null || n === e ? null : de(r);
|
|
2032
2131
|
return n === null || i === null ? at : { kind: "document", path: n, snapshot: i, stale: !0 };
|
|
2033
|
-
},
|
|
2034
|
-
const o = t.kind === "streaming" ?
|
|
2035
|
-
return o.kind !== "document" ? /* @__PURE__ */
|
|
2036
|
-
},
|
|
2037
|
-
const { config: f, labels: u, theme:
|
|
2132
|
+
}, Nl = (e, t) => t.status === "deferred" ? at : { kind: "document", path: e, snapshot: t, stale: !1 }, Dl = ({ requestedPath: e, content: t, markup: n, ...r }) => {
|
|
2133
|
+
const o = t.kind === "streaming" ? Nl(t.path, re(t.promise)) : t;
|
|
2134
|
+
return o.kind !== "document" ? /* @__PURE__ */ a(xn, { label: r.regionLabel(e, null) }) : /* @__PURE__ */ a(Ll, { path: o.path, snapshot: o.snapshot, markup: n, stale: o.stale, ...r });
|
|
2135
|
+
}, Rn = ({ path: e, markup: t, display: n, navigation: r, fragment: o, paneScroll: l, announces: i, announceFailure: d, onDocumentShown: g }) => {
|
|
2136
|
+
const { config: f, labels: u, theme: p, documents: m } = D(), x = ir(), O = B(!1);
|
|
2038
2137
|
V(() => {
|
|
2039
2138
|
O.current = !0;
|
|
2040
2139
|
}, []);
|
|
2041
|
-
const [
|
|
2042
|
-
V(() => e === null ? void 0 : m.open(e), [m, e]), V(() =>
|
|
2043
|
-
const
|
|
2044
|
-
L !==
|
|
2045
|
-
const R =
|
|
2046
|
-
R && t !==
|
|
2047
|
-
const N = U(() =>
|
|
2140
|
+
const [y, T] = I(null), [S, M] = I(t), s = P(() => e === null ? void 0 : m.peek(e), [m, e]), c = te(m.subscribe, s, s), h = P(() => y === null ? void 0 : m.peek(y), [m, y]), w = te(m.subscribe, h, h);
|
|
2141
|
+
V(() => e === null ? void 0 : m.open(e), [m, e]), V(() => y === null ? void 0 : m.retain(y), [m, y]);
|
|
2142
|
+
const k = e === null ? at : Ml(e, c, y, w, !O.current), L = e === null ? null : k.kind === "document" && !k.stale ? k.path : y;
|
|
2143
|
+
L !== y && T(L);
|
|
2144
|
+
const R = k.kind !== "document" || k.path === e;
|
|
2145
|
+
R && t !== S && M(t);
|
|
2146
|
+
const N = U(() => bl(u), [u]), q = U(() => [...f.iframeHosts], [f]), W = r.kind === "panel", J = U(
|
|
2048
2147
|
() => ({
|
|
2049
2148
|
labels: N,
|
|
2050
2149
|
emptyMessage: u.documentEmpty,
|
|
2051
|
-
theme:
|
|
2150
|
+
theme: p,
|
|
2052
2151
|
availableStyles: f.documentStyles,
|
|
2053
2152
|
iFrameAllowedDomains: q,
|
|
2054
2153
|
embeds: f.embeds,
|
|
2055
|
-
linkComponent:
|
|
2056
|
-
toolbar:
|
|
2154
|
+
linkComponent: il,
|
|
2155
|
+
toolbar: x,
|
|
2057
2156
|
style: n.style,
|
|
2058
2157
|
onStyleChange: n.onStyleChange,
|
|
2059
2158
|
align: n.align,
|
|
@@ -2064,16 +2163,16 @@ const rl = /* @__PURE__ */ y.forwardRef(nl), ol = Object.freeze({ className: "aq
|
|
|
2064
2163
|
padding: n.padding,
|
|
2065
2164
|
width: n.width === void 0 ? void 0 : `min(${n.width}, 100%)`,
|
|
2066
2165
|
maxWidth: n.maxWidth === void 0 ? void 0 : `min(${n.maxWidth}, 100%)`,
|
|
2067
|
-
renderScrollBar: W ? void 0 :
|
|
2166
|
+
renderScrollBar: W ? void 0 : un
|
|
2068
2167
|
}),
|
|
2069
|
-
[N, u.documentEmpty,
|
|
2168
|
+
[N, u.documentEmpty, p, f.documentStyles, q, f.embeds, x, n, W]
|
|
2070
2169
|
), ee = P(($, G) => W ? G === null || G.kind === "failure" ? Ee($) : G.name : u.documentRegion, [W, u.documentRegion]), X = W ? "content" : "fill";
|
|
2071
|
-
return e === null ? /* @__PURE__ */
|
|
2072
|
-
|
|
2170
|
+
return e === null ? /* @__PURE__ */ a(fe, { value: X, children: /* @__PURE__ */ a(yl, {}) }) : /* @__PURE__ */ a(fe, { value: X, children: /* @__PURE__ */ a(ge, { fallback: /* @__PURE__ */ a(xn, { label: ee(e, null) }), children: /* @__PURE__ */ a(
|
|
2171
|
+
Dl,
|
|
2073
2172
|
{
|
|
2074
2173
|
requestedPath: e,
|
|
2075
|
-
content:
|
|
2076
|
-
markup: R ? t :
|
|
2174
|
+
content: k,
|
|
2175
|
+
markup: R ? t : S,
|
|
2077
2176
|
viewer: J,
|
|
2078
2177
|
editLayout: n.editLayout,
|
|
2079
2178
|
regionLabel: ee,
|
|
@@ -2082,33 +2181,33 @@ const rl = /* @__PURE__ */ y.forwardRef(nl), ol = Object.freeze({ className: "aq
|
|
|
2082
2181
|
paneScroll: l,
|
|
2083
2182
|
announces: i,
|
|
2084
2183
|
announceFailure: d,
|
|
2085
|
-
onDocumentShown:
|
|
2184
|
+
onDocumentShown: g
|
|
2086
2185
|
}
|
|
2087
2186
|
) }) });
|
|
2088
|
-
},
|
|
2089
|
-
const { config: o, viewSettings: l, announcer: i } = D(), d = Ae((L) => L.style),
|
|
2187
|
+
}, $l = ({ path: e, markup: t, variant: n, onDocumentShown: r }) => {
|
|
2188
|
+
const { config: o, viewSettings: l, announcer: i } = D(), d = Ae((L) => L.style), g = Ae((L) => L.align), f = $e(), u = Gt(), p = nt(), { view: m, overrides: x, embed: O } = n, y = P(
|
|
2090
2189
|
(L) => {
|
|
2091
|
-
if (
|
|
2092
|
-
const R =
|
|
2190
|
+
if (p.kind !== "location") return;
|
|
2191
|
+
const R = El(o, p.location, L);
|
|
2093
2192
|
R !== null && f(R, "browse");
|
|
2094
2193
|
},
|
|
2095
|
-
[o, f,
|
|
2194
|
+
[o, f, p]
|
|
2096
2195
|
), T = P(
|
|
2097
2196
|
(L) => {
|
|
2098
|
-
l.update({ style: L }),
|
|
2197
|
+
l.update({ style: L }), y("style");
|
|
2099
2198
|
},
|
|
2100
|
-
[l,
|
|
2101
|
-
),
|
|
2199
|
+
[l, y]
|
|
2200
|
+
), S = P(
|
|
2102
2201
|
(L) => {
|
|
2103
|
-
l.update({ align: L }),
|
|
2202
|
+
l.update({ align: L }), y("align");
|
|
2104
2203
|
},
|
|
2105
|
-
[l,
|
|
2106
|
-
), M =
|
|
2204
|
+
[l, y]
|
|
2205
|
+
), M = En(o, x.style, d), s = yn(x.align, g), c = U(
|
|
2107
2206
|
() => ({
|
|
2108
2207
|
style: M,
|
|
2109
2208
|
onStyleChange: T,
|
|
2110
2209
|
align: s,
|
|
2111
|
-
onAlignChange:
|
|
2210
|
+
onAlignChange: S,
|
|
2112
2211
|
showToc: O.showToc !== !1,
|
|
2113
2212
|
showStyle: O.showStyle !== !1,
|
|
2114
2213
|
showAlign: O.showAlign !== !1,
|
|
@@ -2117,16 +2216,16 @@ const rl = /* @__PURE__ */ y.forwardRef(nl), ol = Object.freeze({ className: "aq
|
|
|
2117
2216
|
maxWidth: O.maxWidth,
|
|
2118
2217
|
editLayout: "fill"
|
|
2119
2218
|
}),
|
|
2120
|
-
[M, T, s,
|
|
2121
|
-
), h = U(() => ({ kind: "page", view: m, overrides:
|
|
2122
|
-
return /* @__PURE__ */
|
|
2123
|
-
},
|
|
2124
|
-
const { config: o, viewSettings: l } = D(), i = Ae((h) => h.style), d = Ae((h) => h.align), [
|
|
2219
|
+
[M, T, s, S, O]
|
|
2220
|
+
), h = U(() => ({ kind: "page", view: m, overrides: x, embed: O }), [m, x, O]), w = U(() => ({ kind: "page", fragment: u.hash, navigation: u }), [u]), k = P((L) => i.announce(L), [i]);
|
|
2221
|
+
return /* @__PURE__ */ a(Rn, { path: e, markup: t, display: c, navigation: h, fragment: w, paneScroll: Mo, announces: !0, announceFailure: k, onDocumentShown: r });
|
|
2222
|
+
}, Pl = ({ path: e, markup: t, variant: n, onDocumentShown: r }) => {
|
|
2223
|
+
const { config: o, viewSettings: l } = D(), i = Ae((h) => h.style), d = Ae((h) => h.align), [g, f] = I(() => En(o, void 0, i)), u = yn(void 0, d), p = P((h) => l.update({ align: h }), [l]), { maximized: m, onDocumentLink: x, pendingHash: O, onHashConsumed: y, announceFailure: T, paneScroll: S } = n, M = U(
|
|
2125
2224
|
() => ({
|
|
2126
|
-
style:
|
|
2225
|
+
style: g,
|
|
2127
2226
|
onStyleChange: f,
|
|
2128
2227
|
align: u,
|
|
2129
|
-
onAlignChange:
|
|
2228
|
+
onAlignChange: p,
|
|
2130
2229
|
showToc: m,
|
|
2131
2230
|
showStyle: m,
|
|
2132
2231
|
showAlign: m,
|
|
@@ -2135,16 +2234,16 @@ const rl = /* @__PURE__ */ y.forwardRef(nl), ol = Object.freeze({ className: "aq
|
|
|
2135
2234
|
maxWidth: void 0,
|
|
2136
2235
|
editLayout: m ? "fill" : "content"
|
|
2137
2236
|
}),
|
|
2138
|
-
[
|
|
2139
|
-
), s = U(() => ({ kind: "panel", onDocumentLink:
|
|
2140
|
-
return /* @__PURE__ */
|
|
2141
|
-
},
|
|
2142
|
-
function
|
|
2237
|
+
[g, u, p, m]
|
|
2238
|
+
), s = U(() => ({ kind: "panel", onDocumentLink: x }), [x]), c = U(() => ({ kind: "panel", fragment: O, consume: y }), [O, y]);
|
|
2239
|
+
return /* @__PURE__ */ a(Rn, { path: e, markup: t, display: M, navigation: s, fragment: c, paneScroll: S, announces: !1, announceFailure: T, onDocumentShown: r });
|
|
2240
|
+
}, Fl = ({ path: e, markup: t, variant: n, onDocumentShown: r }) => n.kind === "page" ? /* @__PURE__ */ a($l, { path: e, markup: t, variant: n, onDocumentShown: r }) : /* @__PURE__ */ a(Pl, { path: e, markup: t, variant: n, onDocumentShown: r });
|
|
2241
|
+
function ql({
|
|
2143
2242
|
title: e,
|
|
2144
2243
|
titleId: t,
|
|
2145
2244
|
...n
|
|
2146
2245
|
}, r) {
|
|
2147
|
-
return /* @__PURE__ */
|
|
2246
|
+
return /* @__PURE__ */ b.createElement("svg", Object.assign({
|
|
2148
2247
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2149
2248
|
viewBox: "0 0 24 24",
|
|
2150
2249
|
fill: "currentColor",
|
|
@@ -2152,21 +2251,21 @@ function Tl({
|
|
|
2152
2251
|
"data-slot": "icon",
|
|
2153
2252
|
ref: r,
|
|
2154
2253
|
"aria-labelledby": t
|
|
2155
|
-
}, n), e ? /* @__PURE__ */
|
|
2254
|
+
}, n), e ? /* @__PURE__ */ b.createElement("title", {
|
|
2156
2255
|
id: t
|
|
2157
|
-
}, e) : null, /* @__PURE__ */
|
|
2256
|
+
}, e) : null, /* @__PURE__ */ b.createElement("path", {
|
|
2158
2257
|
fillRule: "evenodd",
|
|
2159
2258
|
d: "M4.755 10.059a7.5 7.5 0 0 1 12.548-3.364l1.903 1.903h-3.183a.75.75 0 1 0 0 1.5h4.992a.75.75 0 0 0 .75-.75V4.356a.75.75 0 0 0-1.5 0v3.18l-1.9-1.9A9 9 0 0 0 3.306 9.67a.75.75 0 1 0 1.45.388Zm15.408 3.352a.75.75 0 0 0-.919.53 7.5 7.5 0 0 1-12.548 3.364l-1.902-1.903h3.183a.75.75 0 0 0 0-1.5H2.984a.75.75 0 0 0-.75.75v4.992a.75.75 0 0 0 1.5 0v-3.18l1.9 1.9a9 9 0 0 0 15.059-4.035.75.75 0 0 0-.53-.918Z",
|
|
2160
2259
|
clipRule: "evenodd"
|
|
2161
2260
|
}));
|
|
2162
2261
|
}
|
|
2163
|
-
const
|
|
2164
|
-
function
|
|
2262
|
+
const _l = /* @__PURE__ */ b.forwardRef(ql);
|
|
2263
|
+
function Bl({
|
|
2165
2264
|
title: e,
|
|
2166
2265
|
titleId: t,
|
|
2167
2266
|
...n
|
|
2168
2267
|
}, r) {
|
|
2169
|
-
return /* @__PURE__ */
|
|
2268
|
+
return /* @__PURE__ */ b.createElement("svg", Object.assign({
|
|
2170
2269
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2171
2270
|
viewBox: "0 0 24 24",
|
|
2172
2271
|
fill: "currentColor",
|
|
@@ -2174,21 +2273,21 @@ function Ol({
|
|
|
2174
2273
|
"data-slot": "icon",
|
|
2175
2274
|
ref: r,
|
|
2176
2275
|
"aria-labelledby": t
|
|
2177
|
-
}, n), e ? /* @__PURE__ */
|
|
2276
|
+
}, n), e ? /* @__PURE__ */ b.createElement("title", {
|
|
2178
2277
|
id: t
|
|
2179
|
-
}, e) : null, /* @__PURE__ */
|
|
2278
|
+
}, e) : null, /* @__PURE__ */ b.createElement("path", {
|
|
2180
2279
|
fillRule: "evenodd",
|
|
2181
2280
|
d: "M14.447 3.026a.75.75 0 0 1 .527.921l-4.5 16.5a.75.75 0 0 1-1.448-.394l4.5-16.5a.75.75 0 0 1 .921-.527ZM16.72 6.22a.75.75 0 0 1 1.06 0l5.25 5.25a.75.75 0 0 1 0 1.06l-5.25 5.25a.75.75 0 1 1-1.06-1.06L21.44 12l-4.72-4.72a.75.75 0 0 1 0-1.06Zm-9.44 0a.75.75 0 0 1 0 1.06L2.56 12l4.72 4.72a.75.75 0 0 1-1.06 1.06L.97 12.53a.75.75 0 0 1 0-1.06l5.25-5.25a.75.75 0 0 1 1.06 0Z",
|
|
2182
2281
|
clipRule: "evenodd"
|
|
2183
2282
|
}));
|
|
2184
2283
|
}
|
|
2185
|
-
const
|
|
2186
|
-
function
|
|
2284
|
+
const Il = /* @__PURE__ */ b.forwardRef(Bl);
|
|
2285
|
+
function jl({
|
|
2187
2286
|
title: e,
|
|
2188
2287
|
titleId: t,
|
|
2189
2288
|
...n
|
|
2190
2289
|
}, r) {
|
|
2191
|
-
return /* @__PURE__ */
|
|
2290
|
+
return /* @__PURE__ */ b.createElement("svg", Object.assign({
|
|
2192
2291
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2193
2292
|
viewBox: "0 0 24 24",
|
|
2194
2293
|
fill: "currentColor",
|
|
@@ -2196,21 +2295,21 @@ function Ll({
|
|
|
2196
2295
|
"data-slot": "icon",
|
|
2197
2296
|
ref: r,
|
|
2198
2297
|
"aria-labelledby": t
|
|
2199
|
-
}, n), e ? /* @__PURE__ */
|
|
2298
|
+
}, n), e ? /* @__PURE__ */ b.createElement("title", {
|
|
2200
2299
|
id: t
|
|
2201
|
-
}, e) : null, /* @__PURE__ */
|
|
2300
|
+
}, e) : null, /* @__PURE__ */ b.createElement("path", {
|
|
2202
2301
|
fillRule: "evenodd",
|
|
2203
2302
|
d: "M15.75 2.25H21a.75.75 0 0 1 .75.75v5.25a.75.75 0 0 1-1.5 0V4.81L8.03 17.03a.75.75 0 0 1-1.06-1.06L19.19 3.75h-3.44a.75.75 0 0 1 0-1.5Zm-10.5 4.5a1.5 1.5 0 0 0-1.5 1.5v10.5a1.5 1.5 0 0 0 1.5 1.5h10.5a1.5 1.5 0 0 0 1.5-1.5V10.5a.75.75 0 0 1 1.5 0v8.25a3 3 0 0 1-3 3H5.25a3 3 0 0 1-3-3V8.25a3 3 0 0 1 3-3h8.25a.75.75 0 0 1 0 1.5H5.25Z",
|
|
2204
2303
|
clipRule: "evenodd"
|
|
2205
2304
|
}));
|
|
2206
2305
|
}
|
|
2207
|
-
const
|
|
2208
|
-
function
|
|
2306
|
+
const Hl = /* @__PURE__ */ b.forwardRef(jl);
|
|
2307
|
+
function zl({
|
|
2209
2308
|
title: e,
|
|
2210
2309
|
titleId: t,
|
|
2211
2310
|
...n
|
|
2212
2311
|
}, r) {
|
|
2213
|
-
return /* @__PURE__ */
|
|
2312
|
+
return /* @__PURE__ */ b.createElement("svg", Object.assign({
|
|
2214
2313
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2215
2314
|
viewBox: "0 0 24 24",
|
|
2216
2315
|
fill: "currentColor",
|
|
@@ -2218,25 +2317,25 @@ function Nl({
|
|
|
2218
2317
|
"data-slot": "icon",
|
|
2219
2318
|
ref: r,
|
|
2220
2319
|
"aria-labelledby": t
|
|
2221
|
-
}, n), e ? /* @__PURE__ */
|
|
2320
|
+
}, n), e ? /* @__PURE__ */ b.createElement("title", {
|
|
2222
2321
|
id: t
|
|
2223
|
-
}, e) : null, /* @__PURE__ */
|
|
2322
|
+
}, e) : null, /* @__PURE__ */ b.createElement("path", {
|
|
2224
2323
|
fillRule: "evenodd",
|
|
2225
2324
|
d: "M11.47 13.28a.75.75 0 0 0 1.06 0l7.5-7.5a.75.75 0 0 0-1.06-1.06L12 11.69 5.03 4.72a.75.75 0 0 0-1.06 1.06l7.5 7.5Z",
|
|
2226
2325
|
clipRule: "evenodd"
|
|
2227
|
-
}), /* @__PURE__ */
|
|
2326
|
+
}), /* @__PURE__ */ b.createElement("path", {
|
|
2228
2327
|
fillRule: "evenodd",
|
|
2229
2328
|
d: "M11.47 19.28a.75.75 0 0 0 1.06 0l7.5-7.5a.75.75 0 1 0-1.06-1.06L12 17.69l-6.97-6.97a.75.75 0 0 0-1.06 1.06l7.5 7.5Z",
|
|
2230
2329
|
clipRule: "evenodd"
|
|
2231
2330
|
}));
|
|
2232
2331
|
}
|
|
2233
|
-
const
|
|
2234
|
-
function
|
|
2332
|
+
const Ul = /* @__PURE__ */ b.forwardRef(zl);
|
|
2333
|
+
function Zl({
|
|
2235
2334
|
title: e,
|
|
2236
2335
|
titleId: t,
|
|
2237
2336
|
...n
|
|
2238
2337
|
}, r) {
|
|
2239
|
-
return /* @__PURE__ */
|
|
2338
|
+
return /* @__PURE__ */ b.createElement("svg", Object.assign({
|
|
2240
2339
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2241
2340
|
viewBox: "0 0 24 24",
|
|
2242
2341
|
fill: "currentColor",
|
|
@@ -2244,21 +2343,21 @@ function $l({
|
|
|
2244
2343
|
"data-slot": "icon",
|
|
2245
2344
|
ref: r,
|
|
2246
2345
|
"aria-labelledby": t
|
|
2247
|
-
}, n), e ? /* @__PURE__ */
|
|
2346
|
+
}, n), e ? /* @__PURE__ */ b.createElement("title", {
|
|
2248
2347
|
id: t
|
|
2249
|
-
}, e) : null, /* @__PURE__ */
|
|
2348
|
+
}, e) : null, /* @__PURE__ */ b.createElement("path", {
|
|
2250
2349
|
fillRule: "evenodd",
|
|
2251
2350
|
d: "M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25ZM12.75 6a.75.75 0 0 0-1.5 0v6c0 .414.336.75.75.75h4.5a.75.75 0 0 0 0-1.5h-3.75V6Z",
|
|
2252
2351
|
clipRule: "evenodd"
|
|
2253
2352
|
}));
|
|
2254
2353
|
}
|
|
2255
|
-
const
|
|
2256
|
-
function
|
|
2354
|
+
const Vl = /* @__PURE__ */ b.forwardRef(Zl);
|
|
2355
|
+
function Gl({
|
|
2257
2356
|
title: e,
|
|
2258
2357
|
titleId: t,
|
|
2259
2358
|
...n
|
|
2260
2359
|
}, r) {
|
|
2261
|
-
return /* @__PURE__ */
|
|
2360
|
+
return /* @__PURE__ */ b.createElement("svg", Object.assign({
|
|
2262
2361
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2263
2362
|
viewBox: "0 0 24 24",
|
|
2264
2363
|
fill: "currentColor",
|
|
@@ -2266,23 +2365,23 @@ function Fl({
|
|
|
2266
2365
|
"data-slot": "icon",
|
|
2267
2366
|
ref: r,
|
|
2268
2367
|
"aria-labelledby": t
|
|
2269
|
-
}, n), e ? /* @__PURE__ */
|
|
2368
|
+
}, n), e ? /* @__PURE__ */ b.createElement("title", {
|
|
2270
2369
|
id: t
|
|
2271
|
-
}, e) : null, /* @__PURE__ */
|
|
2370
|
+
}, e) : null, /* @__PURE__ */ b.createElement("path", {
|
|
2272
2371
|
fillRule: "evenodd",
|
|
2273
2372
|
d: "M9 1.5H5.625c-1.036 0-1.875.84-1.875 1.875v17.25c0 1.035.84 1.875 1.875 1.875h12.75c1.035 0 1.875-.84 1.875-1.875V12.75A3.75 3.75 0 0 0 16.5 9h-1.875a1.875 1.875 0 0 1-1.875-1.875V5.25A3.75 3.75 0 0 0 9 1.5Zm6.61 10.936a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 14.47a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z",
|
|
2274
2373
|
clipRule: "evenodd"
|
|
2275
|
-
}), /* @__PURE__ */
|
|
2374
|
+
}), /* @__PURE__ */ b.createElement("path", {
|
|
2276
2375
|
d: "M12.971 1.816A5.23 5.23 0 0 1 14.25 5.25v1.875c0 .207.168.375.375.375H16.5a5.23 5.23 0 0 1 3.434 1.279 9.768 9.768 0 0 0-6.963-6.963Z"
|
|
2277
2376
|
}));
|
|
2278
2377
|
}
|
|
2279
|
-
const
|
|
2280
|
-
function
|
|
2378
|
+
const Kl = /* @__PURE__ */ b.forwardRef(Gl);
|
|
2379
|
+
function Wl({
|
|
2281
2380
|
title: e,
|
|
2282
2381
|
titleId: t,
|
|
2283
2382
|
...n
|
|
2284
2383
|
}, r) {
|
|
2285
|
-
return /* @__PURE__ */
|
|
2384
|
+
return /* @__PURE__ */ b.createElement("svg", Object.assign({
|
|
2286
2385
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2287
2386
|
viewBox: "0 0 24 24",
|
|
2288
2387
|
fill: "currentColor",
|
|
@@ -2290,23 +2389,23 @@ function _l({
|
|
|
2290
2389
|
"data-slot": "icon",
|
|
2291
2390
|
ref: r,
|
|
2292
2391
|
"aria-labelledby": t
|
|
2293
|
-
}, n), e ? /* @__PURE__ */
|
|
2392
|
+
}, n), e ? /* @__PURE__ */ b.createElement("title", {
|
|
2294
2393
|
id: t
|
|
2295
|
-
}, e) : null, /* @__PURE__ */
|
|
2394
|
+
}, e) : null, /* @__PURE__ */ b.createElement("path", {
|
|
2296
2395
|
d: "M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"
|
|
2297
|
-
}), /* @__PURE__ */
|
|
2396
|
+
}), /* @__PURE__ */ b.createElement("path", {
|
|
2298
2397
|
fillRule: "evenodd",
|
|
2299
2398
|
d: "M1.323 11.447C2.811 6.976 7.028 3.75 12.001 3.75c4.97 0 9.185 3.223 10.675 7.69.12.362.12.752 0 1.113-1.487 4.471-5.705 7.697-10.677 7.697-4.97 0-9.186-3.223-10.675-7.69a1.762 1.762 0 0 1 0-1.113ZM17.25 12a5.25 5.25 0 1 1-10.5 0 5.25 5.25 0 0 1 10.5 0Z",
|
|
2300
2399
|
clipRule: "evenodd"
|
|
2301
2400
|
}));
|
|
2302
2401
|
}
|
|
2303
|
-
const
|
|
2304
|
-
function
|
|
2402
|
+
const Xl = /* @__PURE__ */ b.forwardRef(Wl);
|
|
2403
|
+
function Yl({
|
|
2305
2404
|
title: e,
|
|
2306
2405
|
titleId: t,
|
|
2307
2406
|
...n
|
|
2308
2407
|
}, r) {
|
|
2309
|
-
return /* @__PURE__ */
|
|
2408
|
+
return /* @__PURE__ */ b.createElement("svg", Object.assign({
|
|
2310
2409
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2311
2410
|
viewBox: "0 0 24 24",
|
|
2312
2411
|
fill: "currentColor",
|
|
@@ -2314,49 +2413,49 @@ function Il({
|
|
|
2314
2413
|
"data-slot": "icon",
|
|
2315
2414
|
ref: r,
|
|
2316
2415
|
"aria-labelledby": t
|
|
2317
|
-
}, n), e ? /* @__PURE__ */
|
|
2416
|
+
}, n), e ? /* @__PURE__ */ b.createElement("title", {
|
|
2318
2417
|
id: t
|
|
2319
|
-
}, e) : null, /* @__PURE__ */
|
|
2418
|
+
}, e) : null, /* @__PURE__ */ b.createElement("path", {
|
|
2320
2419
|
d: "M21.731 2.269a2.625 2.625 0 0 0-3.712 0l-1.157 1.157 3.712 3.712 1.157-1.157a2.625 2.625 0 0 0 0-3.712ZM19.513 8.199l-3.712-3.712-8.4 8.4a5.25 5.25 0 0 0-1.32 2.214l-.8 2.685a.75.75 0 0 0 .933.933l2.685-.8a5.25 5.25 0 0 0 2.214-1.32l8.4-8.4Z"
|
|
2321
|
-
}), /* @__PURE__ */
|
|
2420
|
+
}), /* @__PURE__ */ b.createElement("path", {
|
|
2322
2421
|
d: "M5.25 5.25a3 3 0 0 0-3 3v10.5a3 3 0 0 0 3 3h10.5a3 3 0 0 0 3-3V13.5a.75.75 0 0 0-1.5 0v5.25a1.5 1.5 0 0 1-1.5 1.5H5.25a1.5 1.5 0 0 1-1.5-1.5V8.25a1.5 1.5 0 0 1 1.5-1.5h5.25a.75.75 0 0 0 0-1.5H5.25Z"
|
|
2323
2422
|
}));
|
|
2324
2423
|
}
|
|
2325
|
-
const
|
|
2424
|
+
const Jl = /* @__PURE__ */ b.forwardRef(Yl), Ql = ({ href: e, onRetry: t, testId: n }) => {
|
|
2326
2425
|
const { labels: r, onEditGrant: o } = D(), [l, i] = I(!1), d = () => {
|
|
2327
|
-
o === void 0 || l || (i(!0), o(e).then((
|
|
2328
|
-
|
|
2426
|
+
o === void 0 || l || (i(!0), o(e).then((g) => {
|
|
2427
|
+
g && t();
|
|
2329
2428
|
}).finally(() => i(!1)));
|
|
2330
2429
|
};
|
|
2331
2430
|
return /* @__PURE__ */ F("div", { className: "aqmx-callout aqmx-edit-grant", "data-testid": n, children: [
|
|
2332
|
-
/* @__PURE__ */
|
|
2333
|
-
/* @__PURE__ */
|
|
2431
|
+
/* @__PURE__ */ a("p", { className: "aqmx-callout-title", children: r.editGrantTitle }),
|
|
2432
|
+
/* @__PURE__ */ a("p", { className: "aqmx-callout-body", children: r.editGrantBody }),
|
|
2334
2433
|
/* @__PURE__ */ F("div", { className: "aqmx-edit-grant-actions", children: [
|
|
2335
|
-
o === void 0 ? /* @__PURE__ */
|
|
2336
|
-
/* @__PURE__ */
|
|
2434
|
+
o === void 0 ? /* @__PURE__ */ a("a", { className: "aqmx-callout-action", href: e, target: "_blank", rel: "noopener", "data-testid": `${n}-open`, children: r.editGrantAction }) : (
|
|
2435
|
+
/* @__PURE__ */ a("button", { type: "button", className: "aqmx-callout-action", "aria-disabled": l, "data-testid": `${n}-open`, onClick: d, children: r.editGrantAction })
|
|
2337
2436
|
),
|
|
2338
|
-
/* @__PURE__ */
|
|
2437
|
+
/* @__PURE__ */ a("button", { type: "button", className: "aqmx-callout-action", "data-testid": `${n}-retry`, onClick: t, children: r.editGrantRetry })
|
|
2339
2438
|
] })
|
|
2340
2439
|
] });
|
|
2341
|
-
},
|
|
2440
|
+
}, _t = (e, t, n) => {
|
|
2342
2441
|
const r = e.modifiedAt === null ? Number.NaN : Date.parse(e.modifiedAt);
|
|
2343
2442
|
return n(Number.isNaN(r) ? e.id : t.format(r), e.author === null ? "" : e.author);
|
|
2344
|
-
},
|
|
2345
|
-
const { data: o, edits: l, labels: i, locale: d, announcer:
|
|
2443
|
+
}, ei = ({ path: e, documentName: t, open: n, onClose: r }) => {
|
|
2444
|
+
const { data: o, edits: l, labels: i, locale: d, announcer: g } = D(), f = B(null), u = B(null), p = Oe(), [m, x] = I(null), [O, y] = I(0), [T, S] = I(null), [M, s] = I(null), c = U(() => new Intl.DateTimeFormat(d, { dateStyle: "medium", timeStyle: "short" }), [d]);
|
|
2346
2445
|
V(() => {
|
|
2347
2446
|
const R = f.current;
|
|
2348
2447
|
if (R !== null)
|
|
2349
2448
|
if (n && !R.open) {
|
|
2350
2449
|
const N = R.ownerDocument.activeElement;
|
|
2351
|
-
u.current = N instanceof HTMLElement ? N : null,
|
|
2450
|
+
u.current = N instanceof HTMLElement ? N : null, S(null), s(null), R.showModal();
|
|
2352
2451
|
} else !n && R.open && (R.close(), u.current?.isConnected === !0 && u.current.focus(), u.current = null);
|
|
2353
|
-
}, [n]),
|
|
2452
|
+
}, [n]), ne(() => {
|
|
2354
2453
|
if (!n) return;
|
|
2355
2454
|
const R = new AbortController();
|
|
2356
|
-
return
|
|
2357
|
-
"kind" in N &&
|
|
2455
|
+
return x(null), o.revisions(e, R.signal).then((N) => {
|
|
2456
|
+
"kind" in N && x(N);
|
|
2358
2457
|
}), () => R.abort();
|
|
2359
|
-
}, [n, o, e, O]),
|
|
2458
|
+
}, [n, o, e, O]), ne(() => {
|
|
2360
2459
|
if (!n || T === null) return;
|
|
2361
2460
|
const R = new AbortController();
|
|
2362
2461
|
return s(null), o.revision(e, T, R.signal).then((N) => {
|
|
@@ -2364,38 +2463,38 @@ const jl = /* @__PURE__ */ y.forwardRef(Il), Hl = ({ href: e, onRetry: t, testId
|
|
|
2364
2463
|
}), () => R.abort();
|
|
2365
2464
|
}, [n, o, e, T]);
|
|
2366
2465
|
const h = () => {
|
|
2367
|
-
M === null || M.kind !== "revision" || (l.replaceDraft(e, M.text),
|
|
2466
|
+
M === null || M.kind !== "revision" || (l.replaceDraft(e, M.text), g.announce(i.historyRestored(t)), r());
|
|
2368
2467
|
}, w = (R) => {
|
|
2369
|
-
R.key !== "Escape" || R.defaultPrevented || (
|
|
2370
|
-
},
|
|
2468
|
+
R.key !== "Escape" || R.defaultPrevented || (on(R), r());
|
|
2469
|
+
}, k = (R) => {
|
|
2371
2470
|
R.target === R.currentTarget && r();
|
|
2372
2471
|
}, L = m !== null && m.kind === "revisions" ? m.revisions.find((R) => R.id === T) : void 0;
|
|
2373
|
-
return /* @__PURE__ */
|
|
2374
|
-
/* @__PURE__ */
|
|
2375
|
-
m === null ? /* @__PURE__ */
|
|
2376
|
-
/* @__PURE__ */
|
|
2377
|
-
R.current ? /* @__PURE__ */
|
|
2378
|
-
R.kept ? /* @__PURE__ */
|
|
2472
|
+
return /* @__PURE__ */ a("dialog", { ref: f, className: "aqmx-confirm aqmx-history", "aria-labelledby": p, "data-testid": "markdown-explorer-history", onKeyDown: w, onClick: k, onCancel: (R) => R.preventDefault(), children: /* @__PURE__ */ F("div", { className: "aqmx-confirm-panel aqmx-history-panel", children: [
|
|
2473
|
+
/* @__PURE__ */ a("p", { id: p, className: "aqmx-confirm-title", children: i.historyTitle(t) }),
|
|
2474
|
+
m === null ? /* @__PURE__ */ a("p", { className: "aqmx-history-note", "data-testid": "markdown-explorer-history-loading", children: i.historyLoading }) : m.kind === "failure" ? /* @__PURE__ */ a(ve, { failure: m.failure, alert: !1, onRetry: () => y((R) => R + 1), testId: "markdown-explorer-history-failure" }) : m.revisions.length === 0 ? /* @__PURE__ */ a("p", { className: "aqmx-history-note", "data-testid": "markdown-explorer-history-empty", children: i.historyEmpty }) : /* @__PURE__ */ a("ul", { className: "aqmx-history-list", "data-testid": "markdown-explorer-history-list", children: m.revisions.map((R) => /* @__PURE__ */ a("li", { children: /* @__PURE__ */ F("button", { type: "button", className: "aqmx-history-entry", "aria-pressed": R.id === T, "data-testid": "markdown-explorer-history-entry", onClick: () => S(R.id), children: [
|
|
2475
|
+
/* @__PURE__ */ a("span", { children: _t(R, c, i.historyEntry) }),
|
|
2476
|
+
R.current ? /* @__PURE__ */ a("span", { className: "aqmx-history-mark", children: i.historyCurrent }) : null,
|
|
2477
|
+
R.kept ? /* @__PURE__ */ a("span", { className: "aqmx-history-mark", children: i.historyKept }) : null
|
|
2379
2478
|
] }) }, R.id)) }),
|
|
2380
|
-
T === null ? null : M === null ? /* @__PURE__ */
|
|
2381
|
-
/* @__PURE__ */
|
|
2479
|
+
T === null ? null : M === null ? /* @__PURE__ */ a("p", { className: "aqmx-history-note", children: i.historyLoading }) : M.kind === "failure" ? /* @__PURE__ */ a(ve, { failure: M.failure, alert: !1, testId: "markdown-explorer-history-revision-failure" }) : (
|
|
2480
|
+
/* @__PURE__ */ a("section", { className: "aqmx-history-text", tabIndex: 0, "aria-label": L === void 0 ? i.historyTitle(t) : _t(L, c, i.historyEntry), "data-testid": "markdown-explorer-history-text", children: /* @__PURE__ */ a("pre", { children: M.text }) })
|
|
2382
2481
|
),
|
|
2383
2482
|
/* @__PURE__ */ F("div", { className: "aqmx-confirm-actions", children: [
|
|
2384
|
-
/* @__PURE__ */
|
|
2385
|
-
/* @__PURE__ */
|
|
2483
|
+
/* @__PURE__ */ a("button", { type: "button", className: "aqmx-callout-action", "data-testid": "markdown-explorer-history-close", onClick: r, children: i.historyClose }),
|
|
2484
|
+
/* @__PURE__ */ a("button", { type: "button", className: "aqmx-callout-action", "aria-disabled": M === null || M.kind !== "revision", "data-testid": "markdown-explorer-history-restore", onClick: h, children: i.historyRestore })
|
|
2386
2485
|
] })
|
|
2387
2486
|
] }) });
|
|
2388
|
-
},
|
|
2487
|
+
}, ti = (e) => {
|
|
2389
2488
|
const { documents: t } = D(), n = P(() => t.peek(e), [t, e]), r = P(() => t.peekSeeded(e), [t, e]), o = te(t.subscribe, n, r), l = de(o)?.document;
|
|
2390
2489
|
return l === void 0 || l.kind === "failure" ? { edit: null, name: Ee(e) } : { edit: l.kind === "markdown" ? l.edit : null, name: l.name };
|
|
2391
2490
|
}, se = (e) => {
|
|
2392
2491
|
e.stopPropagation();
|
|
2393
|
-
},
|
|
2492
|
+
}, ni = ({ path: e, documentName: t, iconOnly: n }) => {
|
|
2394
2493
|
const { edits: r, labels: o } = D(), l = te(
|
|
2395
2494
|
r.subscribe,
|
|
2396
2495
|
() => r.session(e) !== void 0,
|
|
2397
2496
|
() => !1
|
|
2398
|
-
), [i, d] = I(!1),
|
|
2497
|
+
), [i, d] = I(!1), g = () => {
|
|
2399
2498
|
if (!l) {
|
|
2400
2499
|
r.start(e, r.viewAnchor(e));
|
|
2401
2500
|
return;
|
|
@@ -2412,18 +2511,18 @@ const jl = /* @__PURE__ */ y.forwardRef(Il), Hl = ({ href: e, onRetry: t, testId
|
|
|
2412
2511
|
"aria-label": f === null ? void 0 : f,
|
|
2413
2512
|
"aria-pressed": l,
|
|
2414
2513
|
"data-testid": "markdown-explorer-document-edit",
|
|
2415
|
-
onClick:
|
|
2514
|
+
onClick: g,
|
|
2416
2515
|
onDoubleClick: se,
|
|
2417
2516
|
onPointerEnter: Rt,
|
|
2418
2517
|
onFocus: Rt,
|
|
2419
2518
|
children: [
|
|
2420
|
-
/* @__PURE__ */
|
|
2421
|
-
f === null ? /* @__PURE__ */
|
|
2519
|
+
/* @__PURE__ */ a(Jl, { "aria-hidden": "true" }),
|
|
2520
|
+
f === null ? /* @__PURE__ */ a("span", { children: o.editDocumentLabel }) : null
|
|
2422
2521
|
]
|
|
2423
2522
|
}
|
|
2424
2523
|
),
|
|
2425
|
-
/* @__PURE__ */
|
|
2426
|
-
|
|
2524
|
+
/* @__PURE__ */ a(
|
|
2525
|
+
ln,
|
|
2427
2526
|
{
|
|
2428
2527
|
open: i,
|
|
2429
2528
|
title: o.unsavedTitle,
|
|
@@ -2438,7 +2537,7 @@ const jl = /* @__PURE__ */ y.forwardRef(Il), Hl = ({ href: e, onRetry: t, testId
|
|
|
2438
2537
|
}
|
|
2439
2538
|
)
|
|
2440
2539
|
] });
|
|
2441
|
-
},
|
|
2540
|
+
}, ri = ({ href: e, documentName: t, iconOnly: n }) => {
|
|
2442
2541
|
const { labels: r } = D(), o = n ? r.editExternallyNamed(t) : null;
|
|
2443
2542
|
return /* @__PURE__ */ F(
|
|
2444
2543
|
"a",
|
|
@@ -2452,87 +2551,87 @@ const jl = /* @__PURE__ */ y.forwardRef(Il), Hl = ({ href: e, onRetry: t, testId
|
|
|
2452
2551
|
"data-testid": "markdown-explorer-document-edit-external",
|
|
2453
2552
|
onDoubleClick: se,
|
|
2454
2553
|
children: [
|
|
2455
|
-
/* @__PURE__ */
|
|
2456
|
-
o === null ? /* @__PURE__ */
|
|
2554
|
+
/* @__PURE__ */ a(Hl, { "aria-hidden": "true" }),
|
|
2555
|
+
o === null ? /* @__PURE__ */ a("span", { children: r.editExternallyLabel }) : null
|
|
2457
2556
|
]
|
|
2458
2557
|
}
|
|
2459
2558
|
);
|
|
2460
|
-
},
|
|
2461
|
-
const { labels: t } = D(), n =
|
|
2462
|
-
return /* @__PURE__ */
|
|
2463
|
-
},
|
|
2464
|
-
const { edits: l, labels: i } = D(), d =
|
|
2559
|
+
}, oi = ({ session: e }) => {
|
|
2560
|
+
const { labels: t } = D(), n = Er(t, e);
|
|
2561
|
+
return /* @__PURE__ */ a("p", { className: "aqmx-edit-status", title: n === "" ? void 0 : n, "data-testid": "markdown-explorer-edit-status", "data-aqmx-save": e.save.kind, children: n });
|
|
2562
|
+
}, li = ({ path: e, documentName: t, iconOnly: n, session: r, previewAvailable: o }) => {
|
|
2563
|
+
const { edits: l, labels: i } = D(), d = Nr(), [g, f] = I(!1);
|
|
2465
2564
|
if (r.phase.kind !== "editing") return null;
|
|
2466
|
-
const u = r.save.kind === "saving",
|
|
2565
|
+
const u = r.save.kind === "saving", p = u || !r.dirty, m = () => {
|
|
2467
2566
|
l.flush(e);
|
|
2468
2567
|
const O = l.session(e);
|
|
2469
2568
|
O === void 0 || !O.dirty || O.save.kind === "saving" || l.save(e);
|
|
2470
|
-
},
|
|
2569
|
+
}, x = (O) => n ? { className: "aqmx-icon-button", "aria-label": O } : { className: "aqmx-icon-button aqmx-labelled-button" };
|
|
2471
2570
|
return /* @__PURE__ */ F(Ne, { children: [
|
|
2472
|
-
r.save.kind === "conflicts" ? /* @__PURE__ */ F("button", { type: "button", ...
|
|
2473
|
-
/* @__PURE__ */
|
|
2474
|
-
n ? null : /* @__PURE__ */
|
|
2571
|
+
r.save.kind === "conflicts" ? /* @__PURE__ */ F("button", { type: "button", ...x(i.conflictNext), title: i.conflictNext, "data-testid": "markdown-explorer-edit-next-conflict", onClick: () => l.nextConflict(e), onDoubleClick: se, children: [
|
|
2572
|
+
/* @__PURE__ */ a(Ul, { "aria-hidden": "true" }),
|
|
2573
|
+
n ? null : /* @__PURE__ */ a("span", { children: i.conflictNext })
|
|
2475
2574
|
] }) : null,
|
|
2476
|
-
o ? /* @__PURE__ */ F("button", { type: "button", ...
|
|
2477
|
-
/* @__PURE__ */
|
|
2478
|
-
n ? null : /* @__PURE__ */
|
|
2575
|
+
o ? /* @__PURE__ */ F("button", { type: "button", ...x(i.previewToggle), title: i.previewToggle, "aria-pressed": d, "data-testid": "markdown-explorer-edit-preview-toggle", onClick: () => l.setPreviewShown(!d), onDoubleClick: se, children: [
|
|
2576
|
+
/* @__PURE__ */ a(Xl, { "aria-hidden": "true" }),
|
|
2577
|
+
n ? null : /* @__PURE__ */ a("span", { children: i.previewToggle })
|
|
2479
2578
|
] }) : null,
|
|
2480
|
-
r.history ? /* @__PURE__ */ F("button", { type: "button", ...
|
|
2481
|
-
/* @__PURE__ */
|
|
2482
|
-
n ? null : /* @__PURE__ */
|
|
2579
|
+
r.history ? /* @__PURE__ */ F("button", { type: "button", ...x(i.historyOpen), title: i.historyOpen, "aria-haspopup": "dialog", "data-testid": "markdown-explorer-edit-history", onClick: () => f(!0), onDoubleClick: se, children: [
|
|
2580
|
+
/* @__PURE__ */ a(Vl, { "aria-hidden": "true" }),
|
|
2581
|
+
n ? null : /* @__PURE__ */ a("span", { children: i.historyOpen })
|
|
2483
2582
|
] }) : null,
|
|
2484
|
-
/* @__PURE__ */ F("button", { type: "button", ...
|
|
2485
|
-
/* @__PURE__ */
|
|
2486
|
-
n ? null : /* @__PURE__ */
|
|
2583
|
+
/* @__PURE__ */ F("button", { type: "button", ...x(i.saveDraft), title: i.saveDraftTooltip, "aria-disabled": p, "aria-busy": u, "aria-keyshortcuts": "Control+S Meta+S", "data-testid": "markdown-explorer-edit-save", onClick: m, onDoubleClick: se, children: [
|
|
2584
|
+
/* @__PURE__ */ a(Kl, { "aria-hidden": "true" }),
|
|
2585
|
+
n ? null : /* @__PURE__ */ a("span", { children: i.saveDraft })
|
|
2487
2586
|
] }),
|
|
2488
|
-
r.history ? /* @__PURE__ */
|
|
2587
|
+
r.history ? /* @__PURE__ */ a(ei, { path: e, documentName: t, open: g, onClose: () => f(!1) }) : null
|
|
2489
2588
|
] });
|
|
2490
|
-
},
|
|
2589
|
+
}, ii = ({ path: e, session: t }) => {
|
|
2491
2590
|
const { edits: n } = D();
|
|
2492
|
-
return t.save.kind !== "grant" ? null : /* @__PURE__ */
|
|
2591
|
+
return t.save.kind !== "grant" ? null : /* @__PURE__ */ a(Ql, { href: t.save.href, onRetry: () => {
|
|
2493
2592
|
n.save(e);
|
|
2494
2593
|
}, testId: "markdown-explorer-save-grant" });
|
|
2495
|
-
},
|
|
2594
|
+
}, si = (e) => {
|
|
2496
2595
|
const { documents: t } = D(), n = P(() => t.peek(e), [t, e]), r = P(() => t.peekSeeded(e), [t, e]), o = te(t.subscribe, n, r);
|
|
2497
2596
|
return de(o)?.document.kind === "markdown";
|
|
2498
|
-
},
|
|
2499
|
-
const { config: t } = D(), n = $e(), r = P(() => n(
|
|
2597
|
+
}, ai = (e) => {
|
|
2598
|
+
const { config: t } = D(), n = $e(), r = P(() => n(pe(t, { ...e, markup: !e.markup }), "browse"), [t, n, e]);
|
|
2500
2599
|
return U(() => ({ shown: e.markup, toggle: r }), [e.markup, r]);
|
|
2501
|
-
},
|
|
2502
|
-
const { documents: n, announcer: r, labels: o } = D(), l = P(() => n.peek(e), [n, e]), i = P(() => n.peekSeeded(e), [n, e]), d = te(n.subscribe, l, i),
|
|
2503
|
-
|
|
2504
|
-
const
|
|
2505
|
-
V(() => (
|
|
2506
|
-
|
|
2600
|
+
}, ci = /* @__PURE__ */ new Set(), di = (e, t) => {
|
|
2601
|
+
const { documents: n, announcer: r, labels: o } = D(), l = P(() => n.peek(e), [n, e]), i = P(() => n.peekSeeded(e), [n, e]), d = te(n.subscribe, l, i), g = P(() => n.answerStampOf(e), [n, e]), f = te(n.subscribe, g, g), [u] = I(() => /* @__PURE__ */ new Set()), [p, m] = I(ci), [x, O] = I(null);
|
|
2602
|
+
x !== null && x.path !== e && O(null);
|
|
2603
|
+
const y = B(null);
|
|
2604
|
+
V(() => (y.current = e, () => {
|
|
2605
|
+
y.current = null;
|
|
2507
2606
|
}), [e]);
|
|
2508
2607
|
const T = P(() => {
|
|
2509
|
-
const s = e,
|
|
2510
|
-
if (u.has(s) ||
|
|
2511
|
-
const h = t && !
|
|
2608
|
+
const s = e, c = n.peek(s);
|
|
2609
|
+
if (u.has(s) || c?.status === "pending") return;
|
|
2610
|
+
const h = t && !hn(c);
|
|
2512
2611
|
u.add(s), m(new Set(u)), O(null), (async () => {
|
|
2513
2612
|
try {
|
|
2514
2613
|
const w = await n.refresh(s);
|
|
2515
|
-
if (
|
|
2614
|
+
if (y.current !== s || w.status === "superseded") return;
|
|
2516
2615
|
if (w.status === "failed") {
|
|
2517
2616
|
O({ path: s, failure: w.failure, stamp: n.answerStampOf(s) }), r.announce(o.documentRefreshFailed(ae(o, w.failure.reason)));
|
|
2518
2617
|
return;
|
|
2519
2618
|
}
|
|
2520
|
-
const
|
|
2521
|
-
if (h ||
|
|
2522
|
-
r.announce(o.documentRefreshed(
|
|
2619
|
+
const k = de(n.peek(s));
|
|
2620
|
+
if (h || k === null || k.document.kind === "failure") return;
|
|
2621
|
+
r.announce(o.documentRefreshed(k.document.name));
|
|
2523
2622
|
} finally {
|
|
2524
2623
|
u.delete(s), m(new Set(u));
|
|
2525
2624
|
}
|
|
2526
2625
|
})();
|
|
2527
|
-
}, [e, t, u, n, r, o]),
|
|
2528
|
-
return { refreshing:
|
|
2529
|
-
},
|
|
2530
|
-
const { labels: r } = D(), { refreshing: o, unavailable: l, failure: i, refresh: d } =
|
|
2626
|
+
}, [e, t, u, n, r, o]), S = p.has(e), M = x !== null && x.path === e && x.stamp === f ? x.failure : null;
|
|
2627
|
+
return { refreshing: S, unavailable: S || d?.status === "pending", failure: M, refresh: T };
|
|
2628
|
+
}, ui = Object.freeze({ kind: "page" }), fi = ({ path: e, placement: t, markup: n }) => {
|
|
2629
|
+
const { labels: r } = D(), { refreshing: o, unavailable: l, failure: i, refresh: d } = di(e, t.kind === "page"), g = si(e), f = ti(e), u = sn(e), p = t.kind === "panel" ? r.refreshDocumentNamed(t.documentName) : null, m = t.kind === "panel" ? r.showMarkupNamed(t.documentName) : null, x = t.kind === "panel", O = t.kind === "panel" ? t.documentName : f.name, y = t.kind === "page" || t.maximized;
|
|
2531
2630
|
return /* @__PURE__ */ F("div", { className: "aqmx-document-refresh-bar", "data-testid": "markdown-explorer-document-refresh-bar", "data-aqmx-editing": u === void 0 ? void 0 : "true", children: [
|
|
2532
2631
|
/* @__PURE__ */ F("div", { className: "aqmx-document-refresh-row", children: [
|
|
2533
|
-
u === void 0 ? null : /* @__PURE__ */
|
|
2534
|
-
u === void 0 ? null : /* @__PURE__ */
|
|
2535
|
-
u === void 0 &&
|
|
2632
|
+
u === void 0 ? null : /* @__PURE__ */ a(oi, { session: u }),
|
|
2633
|
+
u === void 0 ? null : /* @__PURE__ */ a(li, { path: e, documentName: O, iconOnly: x, session: u, previewAvailable: y }),
|
|
2634
|
+
u === void 0 && g ? /* @__PURE__ */ F(
|
|
2536
2635
|
"button",
|
|
2537
2636
|
{
|
|
2538
2637
|
type: "button",
|
|
@@ -2544,19 +2643,19 @@ const jl = /* @__PURE__ */ y.forwardRef(Il), Hl = ({ href: e, onRetry: t, testId
|
|
|
2544
2643
|
onClick: n.toggle,
|
|
2545
2644
|
onDoubleClick: se,
|
|
2546
2645
|
children: [
|
|
2547
|
-
/* @__PURE__ */
|
|
2548
|
-
m === null ? /* @__PURE__ */
|
|
2646
|
+
/* @__PURE__ */ a(Il, { "aria-hidden": "true" }),
|
|
2647
|
+
m === null ? /* @__PURE__ */ a("span", { children: r.showMarkupLabel }) : null
|
|
2549
2648
|
]
|
|
2550
2649
|
}
|
|
2551
2650
|
) : null,
|
|
2552
|
-
u !== void 0 || f.edit?.kind === "inline" ? /* @__PURE__ */
|
|
2651
|
+
u !== void 0 || f.edit?.kind === "inline" ? /* @__PURE__ */ a(ni, { path: e, documentName: O, iconOnly: x }) : f.edit?.kind === "external" ? /* @__PURE__ */ a(ri, { href: f.edit.href, documentName: O, iconOnly: x }) : null,
|
|
2553
2652
|
u === void 0 ? /* @__PURE__ */ F(
|
|
2554
2653
|
"button",
|
|
2555
2654
|
{
|
|
2556
2655
|
type: "button",
|
|
2557
|
-
className:
|
|
2558
|
-
title:
|
|
2559
|
-
"aria-label":
|
|
2656
|
+
className: p === null ? "aqmx-icon-button aqmx-labelled-button" : "aqmx-icon-button",
|
|
2657
|
+
title: p === null ? r.refreshDocument : p,
|
|
2658
|
+
"aria-label": p === null ? void 0 : p,
|
|
2560
2659
|
"aria-disabled": l,
|
|
2561
2660
|
"aria-busy": o,
|
|
2562
2661
|
"data-aqmx-busy": o ? "true" : void 0,
|
|
@@ -2564,46 +2663,46 @@ const jl = /* @__PURE__ */ y.forwardRef(Il), Hl = ({ href: e, onRetry: t, testId
|
|
|
2564
2663
|
onClick: d,
|
|
2565
2664
|
onDoubleClick: se,
|
|
2566
2665
|
children: [
|
|
2567
|
-
/* @__PURE__ */
|
|
2568
|
-
|
|
2666
|
+
/* @__PURE__ */ a(_l, { "aria-hidden": "true" }),
|
|
2667
|
+
p === null ? /* @__PURE__ */ a("span", { children: r.refreshDocumentLabel }) : null
|
|
2569
2668
|
]
|
|
2570
2669
|
}
|
|
2571
2670
|
) : null
|
|
2572
2671
|
] }),
|
|
2573
|
-
u !== void 0 || i === null ? null : /* @__PURE__ */
|
|
2574
|
-
u === void 0 ? null : /* @__PURE__ */
|
|
2672
|
+
u !== void 0 || i === null ? null : /* @__PURE__ */ a("p", { className: "aqmx-document-refresh-failure", "data-testid": "markdown-explorer-document-refresh-failure", "data-aqmx-failure": i.reason, children: r.documentRefreshFailed(ae(r, i.reason)) }),
|
|
2673
|
+
u === void 0 ? null : /* @__PURE__ */ a(ii, { path: e, session: u })
|
|
2575
2674
|
] });
|
|
2576
|
-
},
|
|
2577
|
-
const t = e.doc, n = U(() => ({ kind: "page", view: "single", overrides: e.overrides, embed: e.embed }), [e.overrides, e.embed]), r =
|
|
2675
|
+
}, mi = ({ location: e }) => {
|
|
2676
|
+
const t = e.doc, n = U(() => ({ kind: "page", view: "single", overrides: e.overrides, embed: e.embed }), [e.overrides, e.embed]), r = ai(e);
|
|
2578
2677
|
return /* @__PURE__ */ F("div", { className: "aqmx-single aqmx-document-column", "data-testid": "markdown-explorer-single", children: [
|
|
2579
|
-
/* @__PURE__ */
|
|
2580
|
-
/* @__PURE__ */
|
|
2678
|
+
/* @__PURE__ */ a(fi, { path: t, placement: ui, markup: r }),
|
|
2679
|
+
/* @__PURE__ */ a(Fl, { path: t, markup: e.markup, variant: n })
|
|
2581
2680
|
] });
|
|
2582
|
-
},
|
|
2681
|
+
}, hi = ({ holds: e, testId: t }) => {
|
|
2583
2682
|
const { labels: n, announcer: r } = D(), o = Oe();
|
|
2584
2683
|
V(() => e ? r.claim(o) : void 0, [e, r, o]);
|
|
2585
2684
|
const l = P(() => r.shownIn(o), [r, o]), i = te(r.subscribe, l, l);
|
|
2586
|
-
return /* @__PURE__ */
|
|
2587
|
-
}, ue = Object.freeze([]),
|
|
2685
|
+
return /* @__PURE__ */ a("div", { className: "aqmx-sr-only", role: "status", "aria-live": "polite", "aria-atomic": "true", "data-testid": t, children: i.length > 1 ? n.announcementSequence(i) : i[0] });
|
|
2686
|
+
}, ue = Object.freeze([]), pi = (e) => {
|
|
2588
2687
|
const t = /* @__PURE__ */ new Set();
|
|
2589
2688
|
let n = ue, r = [], o = !1;
|
|
2590
2689
|
const l = [], i = (u) => {
|
|
2591
2690
|
n = u;
|
|
2592
|
-
for (const
|
|
2593
|
-
}, d = () => l.at(-1)?.region,
|
|
2594
|
-
const
|
|
2595
|
-
u(), d() !==
|
|
2691
|
+
for (const p of [...t]) p();
|
|
2692
|
+
}, d = () => l.at(-1)?.region, g = (u) => {
|
|
2693
|
+
const p = d();
|
|
2694
|
+
u(), d() !== p && n !== ue && i(ue);
|
|
2596
2695
|
}, f = () => {
|
|
2597
2696
|
o = !1;
|
|
2598
|
-
const u = r.map((
|
|
2697
|
+
const u = r.map((p) => "sentence" in p ? p.sentence : p.list(p.items));
|
|
2599
2698
|
r = [], i(Object.freeze(u));
|
|
2600
2699
|
};
|
|
2601
2700
|
return {
|
|
2602
2701
|
announce: (u) => {
|
|
2603
2702
|
if (typeof u == "string") r.push({ sentence: u });
|
|
2604
2703
|
else {
|
|
2605
|
-
const
|
|
2606
|
-
|
|
2704
|
+
const p = r.find((m) => "list" in m && m.list === u.list);
|
|
2705
|
+
p !== void 0 && "items" in p ? p.items.push(u.item) : r.push({ list: u.list, items: [u.item] });
|
|
2607
2706
|
}
|
|
2608
2707
|
o || (o = !0, n !== ue && i(ue), e.request(f));
|
|
2609
2708
|
},
|
|
@@ -2611,77 +2710,77 @@ const jl = /* @__PURE__ */ y.forwardRef(Il), Hl = ({ href: e, onRetry: t, testId
|
|
|
2611
2710
|
t.delete(u);
|
|
2612
2711
|
}),
|
|
2613
2712
|
claim: (u) => {
|
|
2614
|
-
const
|
|
2615
|
-
return
|
|
2616
|
-
const m = l.indexOf(
|
|
2713
|
+
const p = { region: u };
|
|
2714
|
+
return g(() => l.push(p)), () => g(() => {
|
|
2715
|
+
const m = l.indexOf(p);
|
|
2617
2716
|
m !== -1 && l.splice(m, 1);
|
|
2618
2717
|
});
|
|
2619
2718
|
},
|
|
2620
2719
|
shownIn: (u) => d() === u ? n : ue
|
|
2621
2720
|
};
|
|
2622
|
-
}, he = Object.freeze({ status: "cancelled" }),
|
|
2721
|
+
}, he = Object.freeze({ status: "cancelled" }), gi = (e) => {
|
|
2623
2722
|
if (e === null || typeof e != "object") return null;
|
|
2624
2723
|
const { failure: t } = e;
|
|
2625
|
-
if (
|
|
2724
|
+
if (Wn(t) !== null) return null;
|
|
2626
2725
|
const { reason: n, code: r } = t;
|
|
2627
|
-
return
|
|
2628
|
-
},
|
|
2629
|
-
const r = n ?? ((f, u) => globalThis.fetch(f, u)), o = (f, u) => `${e}/${f}?${new URLSearchParams(u).toString()}`, l = async (f, u,
|
|
2630
|
-
let
|
|
2726
|
+
return Xn(n, r);
|
|
2727
|
+
}, vi = ({ dataPath: e, onScope: t, fetch: n }) => {
|
|
2728
|
+
const r = n ?? ((f, u) => globalThis.fetch(f, u)), o = (f, u) => `${e}/${f}?${new URLSearchParams(u).toString()}`, l = async (f, u, p, m) => {
|
|
2729
|
+
let x;
|
|
2631
2730
|
try {
|
|
2632
|
-
|
|
2731
|
+
x = await r(f, { credentials: "same-origin", ...u, headers: { Accept: "application/json", ...u.headers } });
|
|
2633
2732
|
} catch {
|
|
2634
2733
|
return m({ reason: "failed" });
|
|
2635
2734
|
}
|
|
2636
|
-
|
|
2637
|
-
const O =
|
|
2735
|
+
x.status === 401 && t(null);
|
|
2736
|
+
const O = x.headers.get(Un);
|
|
2638
2737
|
O !== null && t(O);
|
|
2639
|
-
let
|
|
2738
|
+
let y;
|
|
2640
2739
|
try {
|
|
2641
|
-
|
|
2740
|
+
y = await x.json();
|
|
2642
2741
|
} catch {
|
|
2643
|
-
return m({ reason: ht(
|
|
2742
|
+
return m({ reason: ht(x.status) });
|
|
2644
2743
|
}
|
|
2645
2744
|
let T;
|
|
2646
2745
|
try {
|
|
2647
|
-
T =
|
|
2746
|
+
T = p(y);
|
|
2648
2747
|
} catch {
|
|
2649
2748
|
T = !1;
|
|
2650
2749
|
}
|
|
2651
|
-
if (T) return
|
|
2652
|
-
const
|
|
2653
|
-
return m(
|
|
2654
|
-
}, i = { [
|
|
2655
|
-
const m = await l(f, u,
|
|
2750
|
+
if (T) return y;
|
|
2751
|
+
const S = gi(y);
|
|
2752
|
+
return m(S !== null ? S : { reason: x.status === 200 ? "failed" : ht(x.status) });
|
|
2753
|
+
}, i = { [gt]: Yn }, d = { [gt]: nr, "Content-Type": `${tr}; charset=utf-8` }, g = async (f, u, p) => {
|
|
2754
|
+
const m = await l(f, u, p, (x) => He(x.reason, x.code));
|
|
2656
2755
|
return u.signal.aborted ? he : m;
|
|
2657
2756
|
};
|
|
2658
2757
|
return {
|
|
2659
|
-
tree: (f) => l(o("tree", { [Y.source]: f }), { method: "GET" },
|
|
2660
|
-
children: async (f, u,
|
|
2661
|
-
const m = await l(o("children", { [Y.source]: f, [Y.path]: u }), { method: "GET", signal:
|
|
2662
|
-
return
|
|
2758
|
+
tree: (f) => l(o("tree", { [Y.source]: f }), { method: "GET" }, pt, (u) => ({ status: "error", failure: u })),
|
|
2759
|
+
children: async (f, u, p) => {
|
|
2760
|
+
const m = await l(o("children", { [Y.source]: f, [Y.path]: u }), { method: "GET", signal: p }, Kn, (x) => ({ status: "error", failure: x }));
|
|
2761
|
+
return p.aborted ? he : m;
|
|
2663
2762
|
},
|
|
2664
|
-
ancestors: async (f, u,
|
|
2665
|
-
const m = await l(o("ancestors", { [Y.source]: f, [Y.path]: u }), { method: "GET", signal:
|
|
2666
|
-
return
|
|
2763
|
+
ancestors: async (f, u, p) => {
|
|
2764
|
+
const m = await l(o("ancestors", { [Y.source]: f, [Y.path]: u }), { method: "GET", signal: p }, Gn, (x) => ({ status: "error", failure: x }));
|
|
2765
|
+
return p.aborted ? he : m;
|
|
2667
2766
|
},
|
|
2668
|
-
reveal: async (f, u,
|
|
2669
|
-
const m = await l(o("reveal", { [Y.source]: f, [Y.path]: u }), { method: "GET", signal:
|
|
2670
|
-
return
|
|
2767
|
+
reveal: async (f, u, p) => {
|
|
2768
|
+
const m = await l(o("reveal", { [Y.source]: f, [Y.path]: u }), { method: "GET", signal: p }, Vn, (x) => ({ status: "error", failure: x }));
|
|
2769
|
+
return p.aborted ? he : m;
|
|
2671
2770
|
},
|
|
2672
|
-
document: (f, { refresh: u }) => l(o("document", { [Y.path]: f }), u ? { method: "GET", headers: i } : { method: "GET" },
|
|
2771
|
+
document: (f, { refresh: u }) => l(o("document", { [Y.path]: f }), u ? { method: "GET", headers: i } : { method: "GET" }, lr, (p) => He(p.reason, p.code)),
|
|
2673
2772
|
text: async (f, u) => {
|
|
2674
|
-
const
|
|
2675
|
-
return u.aborted ? he :
|
|
2773
|
+
const p = await l(o("text", { [Y.path]: f }), { method: "GET", signal: u }, Zn, (m) => He(m.reason, m.code));
|
|
2774
|
+
return u.aborted ? he : p;
|
|
2676
2775
|
},
|
|
2677
|
-
edit: (f, u) =>
|
|
2678
|
-
save: (f, u,
|
|
2679
|
-
preview: (f, u,
|
|
2680
|
-
revisions: (f, u) =>
|
|
2681
|
-
revision: (f, u,
|
|
2682
|
-
refresh: (f) => l(o("refresh", { [Y.source]: f }), { method: "POST", headers: i },
|
|
2776
|
+
edit: (f, u) => g(o("edit", { [Y.path]: f }), { method: "GET", signal: u }, or),
|
|
2777
|
+
save: (f, u, p, m) => g(o("save", { [Y.path]: f, [Y.base]: u }), { method: "POST", headers: d, body: p, signal: m }, rr),
|
|
2778
|
+
preview: (f, u, p) => g(o("preview", { [Y.path]: f }), { method: "POST", headers: d, body: u, signal: p }, er),
|
|
2779
|
+
revisions: (f, u) => g(o("revisions", { [Y.path]: f }), { method: "GET", signal: u }, Qn),
|
|
2780
|
+
revision: (f, u, p) => g(o("revision", { [Y.path]: f, [Y.revision]: u }), { method: "GET", signal: p }, Jn),
|
|
2781
|
+
refresh: (f) => l(o("refresh", { [Y.source]: f }), { method: "POST", headers: i }, pt, (u) => ({ status: "error", failure: u }))
|
|
2683
2782
|
};
|
|
2684
|
-
},
|
|
2783
|
+
}, wi = () => {
|
|
2685
2784
|
let e = null, t = null;
|
|
2686
2785
|
return {
|
|
2687
2786
|
settle: (n) => {
|
|
@@ -2696,19 +2795,19 @@ const jl = /* @__PURE__ */ y.forwardRef(Il), Hl = ({ href: e, onRetry: t, testId
|
|
|
2696
2795
|
return t = null, o;
|
|
2697
2796
|
}
|
|
2698
2797
|
};
|
|
2699
|
-
},
|
|
2700
|
-
const t =
|
|
2798
|
+
}, bi = (e) => {
|
|
2799
|
+
const t = Jt(e);
|
|
2701
2800
|
if (t === null) return mt;
|
|
2702
2801
|
try {
|
|
2703
|
-
return
|
|
2802
|
+
return Bn(JSON.parse(t));
|
|
2704
2803
|
} catch (n) {
|
|
2705
2804
|
return console.warn(`[markdown-explorer] localStorage key ${JSON.stringify(e)} does not hold JSON; using the default tree settings.`, n), mt;
|
|
2706
2805
|
}
|
|
2707
|
-
},
|
|
2806
|
+
}, Bt = (e, t) => {
|
|
2708
2807
|
let n = null;
|
|
2709
2808
|
const r = () => {
|
|
2710
2809
|
if (n === null) {
|
|
2711
|
-
const l =
|
|
2810
|
+
const l = bi(e);
|
|
2712
2811
|
n = { changes: l, settings: ft(t, l) };
|
|
2713
2812
|
}
|
|
2714
2813
|
return n;
|
|
@@ -2720,207 +2819,207 @@ const jl = /* @__PURE__ */ y.forwardRef(Il), Hl = ({ href: e, onRetry: t, testId
|
|
|
2720
2819
|
getServerSnapshot: () => t,
|
|
2721
2820
|
subscribe: o.subscribe,
|
|
2722
2821
|
advance: (l) => {
|
|
2723
|
-
const { changes: i, settings: d } = r(),
|
|
2724
|
-
return n = { changes:
|
|
2822
|
+
const { changes: i, settings: d } = r(), g = Fn(i, l, qn(d, l)[l], t);
|
|
2823
|
+
return n = { changes: g, settings: ft(t, g) }, o.emit(), Yt(e, _n(g)), n.settings;
|
|
2725
2824
|
}
|
|
2726
2825
|
};
|
|
2727
|
-
},
|
|
2728
|
-
const t = /* @__PURE__ */ new Map(), n =
|
|
2826
|
+
}, Ei = Object.freeze({ status: "refreshed" }), yi = Object.freeze({ status: "superseded" }), et = Object.freeze({ status: "deferred" }), xi = mn(et), Tn = 4, ki = Tn - 1, It = Object.freeze({ status: "loading" }), Si = Object.freeze({ status: "error", failure: Object.freeze({ reason: "failed" }) }), Ri = (e) => {
|
|
2827
|
+
const t = /* @__PURE__ */ new Map(), n = fn(), r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), d = ye(), g = /* @__PURE__ */ new Set();
|
|
2729
2828
|
let f = 0, u = 0;
|
|
2730
|
-
const
|
|
2731
|
-
let
|
|
2732
|
-
const
|
|
2829
|
+
const p = { direct: null, bulk: null }, m = /* @__PURE__ */ new Set();
|
|
2830
|
+
let x = !1, O = 0;
|
|
2831
|
+
const y = () => {
|
|
2733
2832
|
O += 1, d.emit();
|
|
2734
|
-
}, T = (
|
|
2735
|
-
let
|
|
2736
|
-
return
|
|
2737
|
-
}, M = (
|
|
2738
|
-
|
|
2739
|
-
}, s = (
|
|
2740
|
-
const
|
|
2741
|
-
if (
|
|
2742
|
-
for (const [C, A] of [...
|
|
2743
|
-
M(
|
|
2744
|
-
|
|
2833
|
+
}, T = (v) => o.get(v) ?? 0, S = (v) => {
|
|
2834
|
+
let E = i.get(v);
|
|
2835
|
+
return E === void 0 && (E = { claims: /* @__PURE__ */ new Map(), unclaimed: /* @__PURE__ */ new Set(), direct: /* @__PURE__ */ new Set(), bulk: /* @__PURE__ */ new Set(), inFlight: /* @__PURE__ */ new Map() }, i.set(v, E)), E;
|
|
2836
|
+
}, M = (v, E, C) => {
|
|
2837
|
+
v.inFlight.delete(E), f -= 1, C.lane === "bulk" && (u -= 1);
|
|
2838
|
+
}, s = (v) => {
|
|
2839
|
+
const E = i.get(v);
|
|
2840
|
+
if (E !== void 0) {
|
|
2841
|
+
for (const [C, A] of [...E.inFlight])
|
|
2842
|
+
M(E, C, A), A.controller.abort();
|
|
2843
|
+
E.direct.clear(), E.bulk.clear(), E.unclaimed.clear();
|
|
2745
2844
|
}
|
|
2746
|
-
},
|
|
2747
|
-
const
|
|
2748
|
-
return o.set(
|
|
2749
|
-
}, h = (
|
|
2750
|
-
const C =
|
|
2751
|
-
return
|
|
2845
|
+
}, c = (v) => {
|
|
2846
|
+
const E = T(v) + 1;
|
|
2847
|
+
return o.set(v, E), s(v), E;
|
|
2848
|
+
}, h = (v, E) => {
|
|
2849
|
+
const C = Se(v), A = { promise: v, opened: E, stale: !1, loadedAt: C?.status === "ok" ? C.loadedAt : null };
|
|
2850
|
+
return v.status === "pending" && v.then((_) => {
|
|
2752
2851
|
_.status === "ok" && (A.loadedAt = _.loadedAt);
|
|
2753
2852
|
}), A;
|
|
2754
|
-
}, w = (
|
|
2755
|
-
let
|
|
2756
|
-
return
|
|
2757
|
-
},
|
|
2758
|
-
const
|
|
2759
|
-
for (let _ = 0; _ <
|
|
2760
|
-
const j =
|
|
2853
|
+
}, w = (v) => {
|
|
2854
|
+
let E = r.get(v);
|
|
2855
|
+
return E === void 0 && (E = /* @__PURE__ */ new Map(), r.set(v, E)), E;
|
|
2856
|
+
}, k = (v) => {
|
|
2857
|
+
const E = [...i.keys()], C = p[v], A = C === null ? 0 : E.indexOf(C) + 1;
|
|
2858
|
+
for (let _ = 0; _ < E.length; _ += 1) {
|
|
2859
|
+
const j = E[(A + _) % E.length], Z = j === void 0 ? void 0 : i.get(j);
|
|
2761
2860
|
if (!(j === void 0 || Z === void 0)) {
|
|
2762
|
-
for (const H of Z[
|
|
2861
|
+
for (const H of Z[v])
|
|
2763
2862
|
if ((Z.claims.get(H) ?? 0) !== 0)
|
|
2764
|
-
return Z[
|
|
2863
|
+
return Z[v].delete(H), p[v] = j, { sourceId: j, path: H };
|
|
2765
2864
|
}
|
|
2766
2865
|
}
|
|
2767
2866
|
return null;
|
|
2768
|
-
}, L = (
|
|
2769
|
-
const _ = i.get(
|
|
2770
|
-
if (_ === void 0 || _.inFlight.get(
|
|
2771
|
-
M(_,
|
|
2772
|
-
const j = (_.claims.get(
|
|
2773
|
-
if (A.status === "ok" ? Z.set(
|
|
2774
|
-
const H = { sourceId:
|
|
2775
|
-
for (const le of [...
|
|
2867
|
+
}, L = (v, E, C, A) => {
|
|
2868
|
+
const _ = i.get(v);
|
|
2869
|
+
if (_ === void 0 || _.inFlight.get(E) !== C) return;
|
|
2870
|
+
M(_, E, C);
|
|
2871
|
+
const j = (_.claims.get(E) ?? 0) > 0, Z = w(v);
|
|
2872
|
+
if (A.status === "ok" ? Z.set(E, { status: "loaded", entries: A.entries }) : A.status === "error" && j ? Z.set(E, { status: "failed", failure: A.failure }) : Z.delete(E), y(), A.status === "error" && j) {
|
|
2873
|
+
const H = { sourceId: v, path: E, failure: A.failure };
|
|
2874
|
+
for (const le of [...g]) le(H);
|
|
2776
2875
|
}
|
|
2777
2876
|
N();
|
|
2778
|
-
}, R = (
|
|
2877
|
+
}, R = (v, E, C) => {
|
|
2779
2878
|
const A = { controller: new AbortController(), lane: C };
|
|
2780
|
-
|
|
2781
|
-
(_) => L(
|
|
2782
|
-
() => L(
|
|
2879
|
+
S(v).inFlight.set(E, A), f += 1, C === "bulk" && (u += 1), e.children(v, E, A.controller.signal).then(
|
|
2880
|
+
(_) => L(v, E, A, _),
|
|
2881
|
+
() => L(v, E, A, Si)
|
|
2783
2882
|
);
|
|
2784
2883
|
}, N = () => {
|
|
2785
|
-
for (; f <
|
|
2786
|
-
const
|
|
2787
|
-
if (
|
|
2788
|
-
R(
|
|
2884
|
+
for (; f < Tn; ) {
|
|
2885
|
+
const v = k("direct");
|
|
2886
|
+
if (v !== null) {
|
|
2887
|
+
R(v.sourceId, v.path, "direct");
|
|
2789
2888
|
continue;
|
|
2790
2889
|
}
|
|
2791
|
-
const
|
|
2792
|
-
if (
|
|
2793
|
-
R(
|
|
2890
|
+
const E = u < ki ? k("bulk") : null;
|
|
2891
|
+
if (E === null) return;
|
|
2892
|
+
R(E.sourceId, E.path, "bulk");
|
|
2794
2893
|
}
|
|
2795
|
-
}, q = (
|
|
2796
|
-
if (!(
|
|
2797
|
-
const _ =
|
|
2894
|
+
}, q = (v, E, C) => {
|
|
2895
|
+
if (!(E.direct.delete(C) || E.bulk.delete(C))) {
|
|
2896
|
+
const _ = E.inFlight.get(C);
|
|
2798
2897
|
if (_ === void 0) return !1;
|
|
2799
|
-
M(
|
|
2898
|
+
M(E, C, _), _.controller.abort();
|
|
2800
2899
|
}
|
|
2801
|
-
return r.get(
|
|
2900
|
+
return r.get(v)?.delete(C), !0;
|
|
2802
2901
|
}, W = () => {
|
|
2803
|
-
|
|
2804
|
-
let
|
|
2805
|
-
for (const
|
|
2806
|
-
const C =
|
|
2902
|
+
x = !1;
|
|
2903
|
+
let v = !1;
|
|
2904
|
+
for (const E of m) {
|
|
2905
|
+
const C = S(E);
|
|
2807
2906
|
for (const A of C.unclaimed)
|
|
2808
|
-
(C.claims.get(A) ?? 0) === 0 && q(
|
|
2907
|
+
(C.claims.get(A) ?? 0) === 0 && q(E, C, A) && (v = !0);
|
|
2809
2908
|
C.unclaimed.clear();
|
|
2810
2909
|
}
|
|
2811
|
-
m.clear(),
|
|
2812
|
-
}, J = (
|
|
2813
|
-
t.set(
|
|
2814
|
-
}, ee = (
|
|
2815
|
-
|
|
2816
|
-
const A = h(
|
|
2817
|
-
return t.set(
|
|
2818
|
-
}, X = (
|
|
2819
|
-
if (C !== T(
|
|
2820
|
-
const _ =
|
|
2821
|
-
if (!(A.status !== "ok" || _?.status !== "ok" ||
|
|
2910
|
+
m.clear(), v && (y(), N());
|
|
2911
|
+
}, J = (v, E) => {
|
|
2912
|
+
t.set(v, h(be(e.tree(v)), E));
|
|
2913
|
+
}, ee = (v, E, C) => {
|
|
2914
|
+
c(v);
|
|
2915
|
+
const A = h(mn(E), C);
|
|
2916
|
+
return t.set(v, A), r.delete(v), y(), N(), A;
|
|
2917
|
+
}, X = (v, E, C, A) => {
|
|
2918
|
+
if (C !== T(v) || t.get(v) !== E) return;
|
|
2919
|
+
const _ = Se(E.promise);
|
|
2920
|
+
if (!(A.status !== "ok" || _?.status !== "ok" || E.loadedAt === null || A.loadedAt <= E.loadedAt)) {
|
|
2822
2921
|
if (Me(_.entries, A.entries)) {
|
|
2823
|
-
|
|
2922
|
+
E.loadedAt = A.loadedAt;
|
|
2824
2923
|
return;
|
|
2825
2924
|
}
|
|
2826
|
-
ee(
|
|
2925
|
+
ee(v, A, E.opened);
|
|
2827
2926
|
}
|
|
2828
|
-
}, $ = (
|
|
2829
|
-
const C = t.get(
|
|
2830
|
-
return C !== void 0 &&
|
|
2831
|
-
}, G = (
|
|
2832
|
-
|
|
2833
|
-
const C = T(
|
|
2834
|
-
e.tree(
|
|
2927
|
+
}, $ = (v, E) => {
|
|
2928
|
+
const C = t.get(v);
|
|
2929
|
+
return C !== void 0 && Se(C.promise)?.status === E;
|
|
2930
|
+
}, G = (v, E) => {
|
|
2931
|
+
E.stale = !1;
|
|
2932
|
+
const C = T(v);
|
|
2933
|
+
e.tree(v).then((A) => X(v, E, C, A));
|
|
2835
2934
|
};
|
|
2836
2935
|
return {
|
|
2837
|
-
read: (
|
|
2838
|
-
open: (
|
|
2839
|
-
const
|
|
2840
|
-
return A === void 0 || $(
|
|
2936
|
+
read: (v) => t.get(v)?.promise ?? xi,
|
|
2937
|
+
open: (v) => {
|
|
2938
|
+
const E = n.resumes(v), C = n.hold(v), A = t.get(v);
|
|
2939
|
+
return A === void 0 || $(v, "deferred") ? (J(v, !0), y()) : E || (A.opened && $(v, "error") ? (J(v, !0), y()) : (A.opened = !0, A.stale && $(v, "ok") && G(v, A))), C;
|
|
2841
2940
|
},
|
|
2842
|
-
retry: (
|
|
2843
|
-
$(
|
|
2941
|
+
retry: (v) => {
|
|
2942
|
+
$(v, "error") && (J(v, !0), y());
|
|
2844
2943
|
},
|
|
2845
|
-
seed: (
|
|
2846
|
-
const C =
|
|
2944
|
+
seed: (v, E) => {
|
|
2945
|
+
const C = E.then(
|
|
2847
2946
|
(j) => j === null ? et : j,
|
|
2848
2947
|
() => et
|
|
2849
|
-
), A = t.get(
|
|
2850
|
-
if (A !== void 0 && $(
|
|
2851
|
-
const j = T(
|
|
2852
|
-
C.then((Z) => X(
|
|
2948
|
+
), A = t.get(v);
|
|
2949
|
+
if (A !== void 0 && $(v, "ok")) {
|
|
2950
|
+
const j = T(v);
|
|
2951
|
+
C.then((Z) => X(v, A, j, Z));
|
|
2853
2952
|
return;
|
|
2854
2953
|
}
|
|
2855
|
-
|
|
2954
|
+
c(v);
|
|
2856
2955
|
const _ = h(be(C), A?.opened === !0);
|
|
2857
|
-
t.set(
|
|
2858
|
-
t.get(
|
|
2956
|
+
t.set(v, _), r.delete(v), N(), C.then((j) => {
|
|
2957
|
+
t.get(v) === _ && (j.status === "deferred" && n.isHeld(v) && J(v, _.opened), y());
|
|
2859
2958
|
});
|
|
2860
2959
|
},
|
|
2861
|
-
refresh: async (
|
|
2862
|
-
const
|
|
2863
|
-
l.set(
|
|
2864
|
-
const C = await e.refresh(
|
|
2865
|
-
if (l.get(
|
|
2960
|
+
refresh: async (v) => {
|
|
2961
|
+
const E = (l.get(v) ?? 0) + 1;
|
|
2962
|
+
l.set(v, E);
|
|
2963
|
+
const C = await e.refresh(v);
|
|
2964
|
+
if (l.get(v) !== E) return yi;
|
|
2866
2965
|
if (C.status === "error") return { status: "failed", failure: C.failure };
|
|
2867
|
-
const A = t.get(
|
|
2868
|
-
if (!(A !== void 0 && A.loadedAt !== null && $(
|
|
2869
|
-
const j = ee(
|
|
2966
|
+
const A = t.get(v);
|
|
2967
|
+
if (!(A !== void 0 && A.loadedAt !== null && $(v, "ok") && A.loadedAt > C.loadedAt)) {
|
|
2968
|
+
const j = ee(v, C, !0);
|
|
2870
2969
|
if (A !== void 0 && A.promise.status === "pending") {
|
|
2871
|
-
const Z = T(
|
|
2872
|
-
A.promise.then((H) => X(
|
|
2970
|
+
const Z = T(v);
|
|
2971
|
+
A.promise.then((H) => X(v, j, Z, H));
|
|
2873
2972
|
}
|
|
2874
2973
|
}
|
|
2875
2974
|
for (const [j, Z] of t)
|
|
2876
|
-
j !==
|
|
2877
|
-
return
|
|
2975
|
+
j !== v && Se(Z.promise)?.status === "ok" && (Z.stale = !0);
|
|
2976
|
+
return Ei;
|
|
2878
2977
|
},
|
|
2879
|
-
children: (
|
|
2880
|
-
claimChildren: (
|
|
2881
|
-
const C =
|
|
2978
|
+
children: (v, E) => r.get(v)?.get(E),
|
|
2979
|
+
claimChildren: (v, E) => {
|
|
2980
|
+
const C = S(v), A = w(v);
|
|
2882
2981
|
let _ = !1, j = !1;
|
|
2883
|
-
for (const [H, le] of
|
|
2884
|
-
C.claims.set(H, (C.claims.get(H) ?? 0) + 1), A.get(H) === void 0 ? (A.set(H,
|
|
2885
|
-
_ &&
|
|
2982
|
+
for (const [H, le] of E)
|
|
2983
|
+
C.claims.set(H, (C.claims.get(H) ?? 0) + 1), A.get(H) === void 0 ? (A.set(H, It), C[le].add(H), _ = !0, j = !0) : le === "direct" && C.bulk.delete(H) && (C.direct.add(H), j = !0);
|
|
2984
|
+
_ && y(), j && N();
|
|
2886
2985
|
let Z = !1;
|
|
2887
2986
|
return () => {
|
|
2888
2987
|
if (!Z) {
|
|
2889
2988
|
Z = !0;
|
|
2890
|
-
for (const H of
|
|
2989
|
+
for (const H of E.keys()) {
|
|
2891
2990
|
const le = (C.claims.get(H) ?? 0) - 1;
|
|
2892
2991
|
le > 0 ? C.claims.set(H, le) : (C.claims.delete(H), C.unclaimed.add(H));
|
|
2893
2992
|
}
|
|
2894
|
-
m.add(
|
|
2993
|
+
m.add(v), !x && (x = !0, queueMicrotask(W));
|
|
2895
2994
|
}
|
|
2896
2995
|
};
|
|
2897
2996
|
},
|
|
2898
|
-
retryChildren: (
|
|
2899
|
-
const C = r.get(
|
|
2900
|
-
if (C === void 0 || C.get(
|
|
2901
|
-
const A =
|
|
2902
|
-
if ((A.claims.get(
|
|
2903
|
-
C.set(
|
|
2997
|
+
retryChildren: (v, E) => {
|
|
2998
|
+
const C = r.get(v);
|
|
2999
|
+
if (C === void 0 || C.get(E)?.status !== "failed") return;
|
|
3000
|
+
const A = S(v);
|
|
3001
|
+
if ((A.claims.get(E) ?? 0) > 0) {
|
|
3002
|
+
C.set(E, It), A.direct.add(E), y(), N();
|
|
2904
3003
|
return;
|
|
2905
3004
|
}
|
|
2906
|
-
C.delete(
|
|
3005
|
+
C.delete(E), y();
|
|
2907
3006
|
},
|
|
2908
|
-
pendingChildren: (
|
|
2909
|
-
const
|
|
2910
|
-
return
|
|
3007
|
+
pendingChildren: (v) => {
|
|
3008
|
+
const E = i.get(v);
|
|
3009
|
+
return E === void 0 ? 0 : E.direct.size + E.bulk.size + E.inFlight.size;
|
|
2911
3010
|
},
|
|
2912
3011
|
clear: () => {
|
|
2913
|
-
for (const
|
|
2914
|
-
for (const [
|
|
2915
|
-
t.clear(), r.clear(),
|
|
3012
|
+
for (const v of /* @__PURE__ */ new Set([...t.keys(), ...r.keys(), ...o.keys(), ...i.keys()])) c(v);
|
|
3013
|
+
for (const [v, E] of l) l.set(v, E + 1);
|
|
3014
|
+
t.clear(), r.clear(), y();
|
|
2916
3015
|
},
|
|
2917
|
-
subscribeChildrenFailures: (
|
|
2918
|
-
|
|
3016
|
+
subscribeChildrenFailures: (v) => (g.add(v), () => {
|
|
3017
|
+
g.delete(v);
|
|
2919
3018
|
}),
|
|
2920
3019
|
subscribe: d.subscribe,
|
|
2921
3020
|
version: () => O
|
|
2922
3021
|
};
|
|
2923
|
-
},
|
|
3022
|
+
}, Ti = (e, t) => {
|
|
2924
3023
|
let n = e;
|
|
2925
3024
|
const r = ye();
|
|
2926
3025
|
return {
|
|
@@ -2930,70 +3029,70 @@ const jl = /* @__PURE__ */ y.forwardRef(Il), Hl = ({ href: e, onRetry: t, testId
|
|
|
2930
3029
|
n = { ...n, ...o }, t(n), r.emit();
|
|
2931
3030
|
}
|
|
2932
3031
|
};
|
|
2933
|
-
},
|
|
3032
|
+
}, Ci = 1;
|
|
2934
3033
|
let Re = 0, ce = null;
|
|
2935
|
-
const
|
|
3034
|
+
const Oi = () => {
|
|
2936
3035
|
const { documentElement: e, body: t } = document;
|
|
2937
3036
|
Re === 0 && (ce = { htmlOverflow: e.style.overflow, bodyOverflow: t.style.overflow, htmlGutter: e.style.scrollbarGutter, bodyGutter: t.style.scrollbarGutter }, e.style.overflow = "hidden", t.style.overflow = "hidden", e.style.scrollbarGutter = "auto", t.style.scrollbarGutter = "auto"), Re += 1;
|
|
2938
3037
|
let n = !1;
|
|
2939
3038
|
return () => {
|
|
2940
3039
|
n || (n = !0, Re -= 1, !(Re > 0 || ce === null) && (e.style.overflow = ce.htmlOverflow, t.style.overflow = ce.bodyOverflow, e.style.scrollbarGutter = ce.htmlGutter, t.style.scrollbarGutter = ce.bodyGutter, ce = null));
|
|
2941
3040
|
};
|
|
2942
|
-
},
|
|
3041
|
+
}, Ai = [
|
|
2943
3042
|
{ selector: '[data-aqmx-document-flow="fill"]', name: "document region" },
|
|
2944
3043
|
{ selector: "[data-aqmx-explorer-body]", name: "tree area" }
|
|
2945
|
-
],
|
|
2946
|
-
if (!
|
|
3044
|
+
], jt = 1, Ht = (e) => e.getClientRects().length > 0, Ke = "Give the explorer's container a definite block size (for example height: 100dvh, or a flex column of definite height whose item has flex: 1 and min-height: 0; in a fresh React Router app also html and body at height: 100%) instead of an auto or only a minimum height.", Li = (e) => {
|
|
3045
|
+
if (!Ht(e)) return null;
|
|
2947
3046
|
const t = e.getBoundingClientRect(), n = window.innerHeight;
|
|
2948
|
-
if (t.bottom > n +
|
|
3047
|
+
if (t.bottom > n + Ci)
|
|
2949
3048
|
return `[markdown-explorer] the explorer ends ${String(Math.round(t.bottom))}px down a ${String(n)}px viewport while lockDocumentScroll stops the page from scrolling, so the rest cannot be reached. ${Ke}`;
|
|
2950
|
-
if (t.height <
|
|
3049
|
+
if (t.height < jt)
|
|
2951
3050
|
return `[markdown-explorer] the explorer collapsed to ${String(Math.round(t.height))}px while lockDocumentScroll stops the page from scrolling, so nothing can be read. ${Ke}`;
|
|
2952
|
-
for (const { selector: r, name: o } of
|
|
3051
|
+
for (const { selector: r, name: o } of Ai)
|
|
2953
3052
|
for (const l of e.querySelectorAll(r)) {
|
|
2954
|
-
if (!
|
|
3053
|
+
if (!Ht(l)) continue;
|
|
2955
3054
|
const i = l.getBoundingClientRect().height;
|
|
2956
|
-
if (i <
|
|
3055
|
+
if (i < jt)
|
|
2957
3056
|
return `[markdown-explorer] the explorer's ${o} collapsed to ${String(Math.round(i))}px while lockDocumentScroll stops the page from scrolling, so it cannot be read. ${Ke}`;
|
|
2958
3057
|
}
|
|
2959
3058
|
return null;
|
|
2960
|
-
},
|
|
3059
|
+
}, Mi = (e) => {
|
|
2961
3060
|
let t = !1;
|
|
2962
3061
|
const n = () => {
|
|
2963
3062
|
if (t) return;
|
|
2964
|
-
const o =
|
|
3063
|
+
const o = Li(e);
|
|
2965
3064
|
o !== null && (t = !0, console.error(o));
|
|
2966
3065
|
}, r = typeof ResizeObserver > "u" ? null : new ResizeObserver(n);
|
|
2967
3066
|
return r?.observe(e), window.addEventListener("resize", n), n(), () => {
|
|
2968
3067
|
r?.disconnect(), window.removeEventListener("resize", n);
|
|
2969
3068
|
};
|
|
2970
|
-
},
|
|
2971
|
-
|
|
3069
|
+
}, Ni = (e, t) => {
|
|
3070
|
+
ne(() => e ? Oi() : void 0, [e]), ne(() => {
|
|
2972
3071
|
const n = t.current;
|
|
2973
3072
|
if (!(!e || n === null))
|
|
2974
|
-
return
|
|
3073
|
+
return Mi(n);
|
|
2975
3074
|
}, [e, t]);
|
|
2976
|
-
},
|
|
2977
|
-
{ control:
|
|
3075
|
+
}, zt = '[data-testid="markdown-explorer-view-switch"]', Di = [
|
|
3076
|
+
{ control: zt, successors: [zt, '[data-testid="markdown-explorer-sheet-toggle"]'] },
|
|
2978
3077
|
{ control: '[data-testid="markdown-explorer-selection-open"]', successors: ['[data-testid="markdown-explorer-panel-frame"]'] }
|
|
2979
|
-
],
|
|
2980
|
-
for (const t of
|
|
3078
|
+
], $i = (e) => {
|
|
3079
|
+
for (const t of Di) {
|
|
2981
3080
|
const n = e.closest(t.control);
|
|
2982
3081
|
if (n !== null) return { element: n, control: t };
|
|
2983
3082
|
}
|
|
2984
3083
|
return null;
|
|
2985
|
-
},
|
|
3084
|
+
}, Pi = (e, t) => {
|
|
2986
3085
|
const n = B(null);
|
|
2987
|
-
|
|
3086
|
+
ne(() => {
|
|
2988
3087
|
const o = (d) => {
|
|
2989
|
-
const
|
|
2990
|
-
n.current =
|
|
3088
|
+
const g = e.current;
|
|
3089
|
+
n.current = g !== null && d instanceof Element && g.contains(d) ? $i(d) : null;
|
|
2991
3090
|
}, l = (d) => o(d.target);
|
|
2992
3091
|
o(document.activeElement);
|
|
2993
3092
|
const i = (d) => {
|
|
2994
|
-
const
|
|
2995
|
-
d.relatedTarget !== null || !(
|
|
2996
|
-
n.current?.element ===
|
|
3093
|
+
const g = d.target;
|
|
3094
|
+
d.relatedTarget !== null || !(g instanceof Element) || queueMicrotask(() => {
|
|
3095
|
+
n.current?.element === g && g.isConnected && document.activeElement !== g && (n.current = null);
|
|
2997
3096
|
});
|
|
2998
3097
|
};
|
|
2999
3098
|
return document.addEventListener("focusin", l), document.addEventListener("focusout", i), () => {
|
|
@@ -3007,13 +3106,13 @@ const vi = () => {
|
|
|
3007
3106
|
const o = n.current;
|
|
3008
3107
|
if (o === null) return;
|
|
3009
3108
|
const l = () => {
|
|
3010
|
-
const
|
|
3011
|
-
if (
|
|
3109
|
+
const g = document.activeElement;
|
|
3110
|
+
if (g !== null && g !== document.body && g !== o.element) return !0;
|
|
3012
3111
|
const f = e.current;
|
|
3013
3112
|
if (f === null) return !0;
|
|
3014
3113
|
for (const u of o.control.successors)
|
|
3015
|
-
for (const
|
|
3016
|
-
if (
|
|
3114
|
+
for (const p of f.querySelectorAll(u))
|
|
3115
|
+
if (p !== o.element && (p.focus({ preventScroll: !0 }), document.activeElement === p))
|
|
3017
3116
|
return !0;
|
|
3018
3117
|
return !1;
|
|
3019
3118
|
};
|
|
@@ -3025,86 +3124,86 @@ const vi = () => {
|
|
|
3025
3124
|
});
|
|
3026
3125
|
return d.observe(i, { childList: !0, subtree: !0 }), () => d.disconnect();
|
|
3027
3126
|
}, [t, e]);
|
|
3028
|
-
},
|
|
3127
|
+
}, Fi = tt(() => import("./TreeLayout-8pRo1ANN.js").then((e) => ({ default: e.TreeLayout }))), qi = tt(() => import("./MultiLayout-Jy9BKofx.js").then((e) => ({ default: e.MultiLayout }))), _i = 64, Bi = {
|
|
3029
3128
|
request: (e) => {
|
|
3030
3129
|
requestAnimationFrame(e);
|
|
3031
3130
|
}
|
|
3032
|
-
},
|
|
3131
|
+
}, Ut = (e) => {
|
|
3033
3132
|
e.documents.clear(), e.trees.clear();
|
|
3034
3133
|
}, We = (e, t) => {
|
|
3035
3134
|
t.tree !== null && e.trees.seed(t.tree.sourceId, t.tree.result);
|
|
3036
3135
|
for (const { path: n, document: r } of t.documents) e.documents.seed(n, r);
|
|
3037
|
-
},
|
|
3136
|
+
}, Ii = (e, t) => {
|
|
3038
3137
|
const [n, r] = I(() => ({ overrides: t, locale: e, labels: Et(e, t) }));
|
|
3039
|
-
if (n.locale === e &&
|
|
3138
|
+
if (n.locale === e && wr(n.overrides, t)) return n.labels;
|
|
3040
3139
|
const o = { overrides: t, locale: e, labels: Et(e, t) };
|
|
3041
3140
|
return r(o), o.labels;
|
|
3042
|
-
},
|
|
3043
|
-
const [r, o] = I(() => ({ scope: t, store:
|
|
3141
|
+
}, ji = (e, t, n) => {
|
|
3142
|
+
const [r, o] = I(() => ({ scope: t, store: Bt(e, n) }));
|
|
3044
3143
|
if (r.scope === t && r.store.storageKey === e && r.store.defaults === n) return r.store;
|
|
3045
|
-
const l = { scope: t, store:
|
|
3144
|
+
const l = { scope: t, store: Bt(e, n) };
|
|
3046
3145
|
return o(l), l.store;
|
|
3047
3146
|
}, Xe = (e, t) => {
|
|
3048
3147
|
const [n, r] = I(() => ({ scope: e, value: t() }));
|
|
3049
3148
|
if (n.scope === e) return n.value;
|
|
3050
3149
|
const o = { scope: e, value: t() };
|
|
3051
3150
|
return r(o), o.value;
|
|
3052
|
-
},
|
|
3151
|
+
}, Hi = () => pi(Bi), Zt = "on", zi = "off", Ui = (e, t) => {
|
|
3053
3152
|
const n = de(e.peek(t));
|
|
3054
3153
|
return n === null || n.document.kind === "failure" ? Ee(t) : n.document.name;
|
|
3055
|
-
},
|
|
3056
|
-
|
|
3057
|
-
const
|
|
3058
|
-
}), T = De(t.dataPath), [
|
|
3059
|
-
const $ =
|
|
3154
|
+
}, os = ({ data: e, config: t, storageNamespace: n, locale: r, labels: o, theme: l, renderFrame: i, renderTreeFailure: d, lockDocumentScroll: g = !1, onMathDiagnostics: f, onEditGrant: u }) => {
|
|
3155
|
+
cr(n);
|
|
3156
|
+
const p = tn(r), m = br(l), x = Ii(p, o), { revalidate: O } = Dn(), y = B(() => {
|
|
3157
|
+
}), T = De(t.dataPath), [S] = I(() => {
|
|
3158
|
+
const $ = vi({ dataPath: T, onScope: (v) => y.current(v) }), G = { documents: lo({ client: $, capacity: Math.max(_i, t.multiView.maxPanels * 2) }), trees: Ri($) };
|
|
3060
3159
|
return We(G, e), wt(n, e.scope), { data: $, ...G, aligned: { pageData: e, storageNamespace: n, pendingReader: null } };
|
|
3061
3160
|
});
|
|
3062
|
-
if (
|
|
3063
|
-
const $ =
|
|
3064
|
-
|
|
3161
|
+
if (S.aligned.pageData !== e || S.aligned.storageNamespace !== n) {
|
|
3162
|
+
const $ = S.aligned.pageData;
|
|
3163
|
+
S.aligned.pageData = e, S.aligned.storageNamespace = n, $ !== e && ($.scope !== e.scope ? S.aligned.pendingReader = e : We(S, e)), wt(n, e.scope);
|
|
3065
3164
|
}
|
|
3066
|
-
const M =
|
|
3165
|
+
const M = ji(ze(n).treeSettings, e.scope, t.defaultTreeSettings);
|
|
3067
3166
|
V(() => {
|
|
3068
|
-
const $ =
|
|
3069
|
-
$ !== null && (
|
|
3070
|
-
}, [e,
|
|
3167
|
+
const $ = S.aligned.pendingReader;
|
|
3168
|
+
$ !== null && (S.aligned.pendingReader = null, Ut(S), We(S, $));
|
|
3169
|
+
}, [e, S]), V(() => {
|
|
3071
3170
|
let $ = !1;
|
|
3072
|
-
return
|
|
3073
|
-
G === e.scope || $ || ($ = !0, G !== null && (
|
|
3171
|
+
return y.current = (G) => {
|
|
3172
|
+
G === e.scope || $ || ($ = !0, G !== null && (Ut(S), dr(n)), O());
|
|
3074
3173
|
}, () => {
|
|
3075
|
-
|
|
3174
|
+
y.current = () => {
|
|
3076
3175
|
};
|
|
3077
3176
|
};
|
|
3078
|
-
}, [e, O,
|
|
3177
|
+
}, [e, O, S, n]);
|
|
3079
3178
|
const s = B(t.settingsCookie);
|
|
3080
3179
|
V(() => {
|
|
3081
3180
|
s.current = t.settingsCookie;
|
|
3082
3181
|
}, [t.settingsCookie]);
|
|
3083
|
-
const [
|
|
3084
|
-
() =>
|
|
3085
|
-
document.cookie =
|
|
3182
|
+
const [c] = I(
|
|
3183
|
+
() => Ti(e.settings, ($) => {
|
|
3184
|
+
document.cookie = jn(s.current, $, window.location.protocol === "https:");
|
|
3086
3185
|
})
|
|
3087
|
-
), h = Xe(e.scope,
|
|
3186
|
+
), h = Xe(e.scope, Hi), w = Xe(e.scope, wi), k = B(x);
|
|
3088
3187
|
V(() => {
|
|
3089
|
-
|
|
3090
|
-
}, [
|
|
3188
|
+
k.current = x;
|
|
3189
|
+
}, [x]);
|
|
3091
3190
|
const L = Xe(
|
|
3092
3191
|
e.scope,
|
|
3093
|
-
() =>
|
|
3094
|
-
data:
|
|
3095
|
-
conflictLabels: () => ({ ours:
|
|
3192
|
+
() => Or({
|
|
3193
|
+
data: S.data,
|
|
3194
|
+
conflictLabels: () => ({ ours: k.current.conflictOurs, theirs: k.current.conflictTheirs }),
|
|
3096
3195
|
onSaveSettled: ($, G) => {
|
|
3097
|
-
G.kind === "saved" &&
|
|
3098
|
-
const
|
|
3099
|
-
|
|
3196
|
+
G.kind === "saved" && S.documents.refresh($);
|
|
3197
|
+
const v = yr(k.current, G, Ui(S.documents, $));
|
|
3198
|
+
v !== null && h.announce(v);
|
|
3100
3199
|
},
|
|
3101
3200
|
previewSetting: {
|
|
3102
|
-
read: () =>
|
|
3103
|
-
write: ($) =>
|
|
3201
|
+
read: () => Jt(ze(n).editPreview) === Zt,
|
|
3202
|
+
write: ($) => Yt(ze(n).editPreview, $ ? Zt : zi)
|
|
3104
3203
|
}
|
|
3105
3204
|
})
|
|
3106
3205
|
), R = U(() => be(e.notices.catch(() => [])), [e.notices]), N = e.sources.map(($) => $.id).join(`
|
|
3107
|
-
`), q = U(() =>
|
|
3206
|
+
`), q = U(() => In(t, N.split(`
|
|
3108
3207
|
`)), [t, N]), W = B(f);
|
|
3109
3208
|
V(() => {
|
|
3110
3209
|
W.current = f;
|
|
@@ -3114,17 +3213,17 @@ const vi = () => {
|
|
|
3114
3213
|
}), ee = f === void 0 ? void 0 : J, X = U(
|
|
3115
3214
|
() => ({
|
|
3116
3215
|
config: q,
|
|
3117
|
-
labels:
|
|
3118
|
-
locale:
|
|
3216
|
+
labels: x,
|
|
3217
|
+
locale: p,
|
|
3119
3218
|
theme: m,
|
|
3120
3219
|
storageNamespace: n,
|
|
3121
3220
|
scope: e.scope,
|
|
3122
3221
|
sources: e.sources,
|
|
3123
3222
|
notices: R,
|
|
3124
|
-
documents:
|
|
3125
|
-
trees:
|
|
3126
|
-
data:
|
|
3127
|
-
viewSettings:
|
|
3223
|
+
documents: S.documents,
|
|
3224
|
+
trees: S.trees,
|
|
3225
|
+
data: S.data,
|
|
3226
|
+
viewSettings: c,
|
|
3128
3227
|
treeSettings: M,
|
|
3129
3228
|
announcer: h,
|
|
3130
3229
|
reveals: w,
|
|
@@ -3133,67 +3232,67 @@ const vi = () => {
|
|
|
3133
3232
|
renderTreeFailure: d,
|
|
3134
3233
|
reportMathDiagnostics: ee
|
|
3135
3234
|
}),
|
|
3136
|
-
[q,
|
|
3235
|
+
[q, x, p, m, n, e.scope, e.sources, R, S, c, M, h, w, L, u, d, ee]
|
|
3137
3236
|
);
|
|
3138
|
-
return /* @__PURE__ */
|
|
3139
|
-
},
|
|
3140
|
-
const [o] = I(
|
|
3141
|
-
return /* @__PURE__ */
|
|
3142
|
-
},
|
|
3143
|
-
const { theme: n, labels: r } = D(), o = nt(), { hash: l } =
|
|
3144
|
-
|
|
3237
|
+
return /* @__PURE__ */ a(nn, { value: X, children: /* @__PURE__ */ a(Vi, { renderFrame: i, lockDocumentScroll: g }, e.scope) });
|
|
3238
|
+
}, Zi = ({ ref: e, theme: t, view: n, children: r }) => {
|
|
3239
|
+
const [o] = I(Uo);
|
|
3240
|
+
return /* @__PURE__ */ a("div", { ref: e, className: "aqmx-root", "data-aqmx-theme": t, "data-aqmx-view": n, "data-testid": "markdown-explorer", onKeyDownCapture: o.onKeyDownCapture, onKeyUpCapture: o.onKeyUpCapture, onBlurCapture: o.onBlurCapture, children: r });
|
|
3241
|
+
}, Vi = ({ renderFrame: e, lockDocumentScroll: t }) => {
|
|
3242
|
+
const { theme: n, labels: r } = D(), o = nt(), { hash: l } = Gt(), i = $e(), d = B(null);
|
|
3243
|
+
Ni(t, d), V(() => {
|
|
3145
3244
|
o.kind === "redirect" && i(`${o.href}${l}`, "browse");
|
|
3146
3245
|
}, [o, l, i]);
|
|
3147
|
-
const { location:
|
|
3148
|
-
|
|
3149
|
-
const u =
|
|
3246
|
+
const { location: g } = o, f = g.view;
|
|
3247
|
+
Pi(d, f);
|
|
3248
|
+
const u = g.view === "tree" ? /* @__PURE__ */ a(ge, { fallback: /* @__PURE__ */ a("section", { className: "aqmx-split-fallback", "aria-label": r.explorerRegion, "aria-busy": "true", "data-testid": "markdown-explorer-split-loading" }), children: /* @__PURE__ */ a(Fi, { location: g }) }) : g.view === "multi" ? /* @__PURE__ */ a(ge, { fallback: /* @__PURE__ */ a("section", { className: "aqmx-stage-fallback", "aria-label": r.multiRegion, "aria-busy": "true", "data-testid": "markdown-explorer-stage-loading" }), children: /* @__PURE__ */ a(qi, { location: g }) }) : /* @__PURE__ */ a(mi, { location: g }), p = /* @__PURE__ */ F(Zi, { ref: d, theme: n, view: f, children: [
|
|
3150
3249
|
u,
|
|
3151
|
-
/* @__PURE__ */
|
|
3152
|
-
/* @__PURE__ */
|
|
3250
|
+
/* @__PURE__ */ a($r, {}),
|
|
3251
|
+
/* @__PURE__ */ a(hi, { holds: !0, testId: "markdown-explorer-announcer" })
|
|
3153
3252
|
] });
|
|
3154
|
-
return e === void 0 ?
|
|
3155
|
-
},
|
|
3253
|
+
return e === void 0 ? p : e({ view: f, children: p });
|
|
3254
|
+
}, ls = ({ currentUrl: e, nextUrl: t, formMethod: n, defaultShouldRevalidate: r }) => n === void 0 && e.href === t.href && r;
|
|
3156
3255
|
export {
|
|
3157
3256
|
Qe as A,
|
|
3158
3257
|
yt as B,
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3258
|
+
xr as C,
|
|
3259
|
+
fi as D,
|
|
3260
|
+
Ql as E,
|
|
3162
3261
|
ve as F,
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3262
|
+
en as G,
|
|
3263
|
+
fr as H,
|
|
3264
|
+
Go as I,
|
|
3166
3265
|
bt as J,
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3266
|
+
os as K,
|
|
3267
|
+
ro as L,
|
|
3268
|
+
pr as M,
|
|
3170
3269
|
Et as N,
|
|
3171
|
-
|
|
3172
|
-
|
|
3270
|
+
ls as O,
|
|
3271
|
+
ui as P,
|
|
3173
3272
|
$e as a,
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3273
|
+
ai as b,
|
|
3274
|
+
Fl as c,
|
|
3275
|
+
kr as d,
|
|
3276
|
+
Sr as e,
|
|
3277
|
+
Gr as f,
|
|
3278
|
+
Rr as g,
|
|
3180
3279
|
ae as h,
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3280
|
+
Yr as i,
|
|
3281
|
+
Nr as j,
|
|
3282
|
+
on as k,
|
|
3283
|
+
Jr as l,
|
|
3185
3284
|
ye as m,
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3285
|
+
rs as n,
|
|
3286
|
+
dn as o,
|
|
3287
|
+
ns as p,
|
|
3288
|
+
_l as q,
|
|
3289
|
+
eo as r,
|
|
3290
|
+
Xl as s,
|
|
3291
|
+
Qr as t,
|
|
3193
3292
|
D as u,
|
|
3194
|
-
|
|
3293
|
+
Kr as v,
|
|
3195
3294
|
nt as w,
|
|
3196
|
-
|
|
3295
|
+
hi as x,
|
|
3197
3296
|
Ae as y,
|
|
3198
|
-
|
|
3297
|
+
ur as z
|
|
3199
3298
|
};
|