@aiquants/markdown-explorer 0.19.0 → 0.20.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 +41 -1
- package/README.md +17 -9
- package/dist/EditSurface-D1yklbWu.js +833 -0
- package/dist/EditSurface-GxmyUeGE.cjs +3 -0
- package/dist/{ExplorerSplit-LiI3IUZn.js → ExplorerSplit-BAYa3WO3.js} +1 -1
- package/dist/{ExplorerSplit-BDkBN8A0.cjs → ExplorerSplit-DkE46pS0.cjs} +1 -1
- package/dist/{MultiLayout-KWacTPP8.js → MultiLayout-BkhnkQs5.js} +2 -2
- package/dist/{MultiLayout-BOaQK8fp.cjs → MultiLayout-DsxYURra.cjs} +1 -1
- package/dist/{NativeScrollBar-BPgV3kp-.cjs → NativeScrollBar-B57yWQVG.cjs} +1 -1
- package/dist/{NativeScrollBar-zzpty31a.js → NativeScrollBar-CcNqDlO6.js} +1 -1
- package/dist/{TreeLayout-C8IP4cjY.js → TreeLayout-Cf2PzZEI.js} +2 -2
- package/dist/{TreeLayout-S5TMf8_A.cjs → TreeLayout-DCGqVwt9.cjs} +1 -1
- package/dist/core/labels.d.cts +26 -0
- package/dist/core/labels.d.ts +26 -0
- package/dist/index-Bdve5EFS.cjs +13 -0
- package/dist/{index-Dz01kBab.js → index-DiLkl4dC.js} +1323 -1238
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{merge-ClVgYrkS.js → merge-BIXNcrea.js} +1 -1
- package/dist/{merge-B7Lkcdz0.cjs → merge-DSfJceoQ.cjs} +1 -1
- package/dist/sanitizePolicy-BWQtWhsL.js +98 -0
- package/dist/sanitizePolicy-gEXeavb-.cjs +1 -0
- package/dist/sanitizeWorker.cjs +1 -1
- package/dist/sanitizeWorker.js +1 -1
- package/docs/behavior/localization.md +5 -1
- package/docs/behavior/security.md +1 -1
- package/package.json +9 -7
- package/dist/EditSurface-4VX20isB.cjs +0 -2
- package/dist/EditSurface-Ckg-3iTA.js +0 -786
- package/dist/index-DrKHJNY4.cjs +0 -13
- package/dist/sanitizePolicy-DlrakwA4.js +0 -96
- package/dist/sanitizePolicy-DrIMuYCb.cjs +0 -1
|
@@ -1,21 +1,27 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as $, jsx as d, Fragment as Pe } from "react/jsx-runtime";
|
|
2
2
|
import * as y from "react";
|
|
3
|
-
import { createContext as pe, use as
|
|
4
|
-
import { useParams as _n, useSearchParams as In, matchPath as Bn, useBlocker as zn, useNavigate as jn, Link as Hn, useHref as
|
|
5
|
-
import { j as
|
|
6
|
-
import { F as se, i as tr, G as nr, y as
|
|
7
|
-
import { HostedScrollArea as
|
|
3
|
+
import { createContext as pe, use as re, useMemo as U, useSyncExternalStore as ee, useRef as _, useLayoutEffect as j, useCallback as P, useId as xe, useEffect as te, Component as tn, Suspense as ke, lazy as it, useState as z, useEffectEvent as ae } from "react";
|
|
4
|
+
import { useParams as _n, useSearchParams as In, matchPath as Bn, useBlocker as zn, useNavigate as jn, Link as Hn, useHref as Fe, useLocation as nn, useRevalidator as Vn } from "react-router";
|
|
5
|
+
import { j as Zn, g as rn, z as Un, E as on, a as an, B as Gn, D as wt, G as Wn, H as be, e as Se, I as Kn, J as Xn, K as gt, L as Yn, M as bt, O as Jn, w as Qn, Q as er } from "./location-B-m9scLf.js";
|
|
6
|
+
import { F as se, i as tr, G as nr, y as Y, x as rr, H as Et, z as Ve, I as or, J as ir, K as ar, L as lr, N as sr, f as dr, O as St, v as cr, P as ur, Q as fr, R as mr, B as hr, w as pr, S as vr, T as wr, U as gr, u as yt } from "./dataRoute-CObbjNxG.js";
|
|
7
|
+
import { HostedScrollArea as xt, useMarkdownToolbarState as br, MarkdownViewer as ln } from "@aiquants/markdown";
|
|
8
8
|
import { SOURCE_LINES_ATTRIBUTE as sn, parseSourceLines as Er } from "@aiquants/markdown/source-lines";
|
|
9
|
-
import { DEFAULT_CONTENT_ALIGN as
|
|
10
|
-
import { w as Je, r as Qe, a as
|
|
9
|
+
import { DEFAULT_CONTENT_ALIGN as Sr } from "@aiquants/markdown/viewer-settings";
|
|
10
|
+
import { w as Je, r as Qe, a as yr, b as kt, s as we, c as xr } from "./storage-CmGHg7OA.js";
|
|
11
11
|
import { createShouldRevalidate as kr } from "@aiquants/route-revalidation";
|
|
12
12
|
const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
|
|
13
13
|
panelMoved: Object.freeze(["title", "column", "position"]),
|
|
14
14
|
panelMoveUnavailable: Object.freeze(["title", "move"]),
|
|
15
15
|
panelDragStarted: Object.freeze(["title"]),
|
|
16
16
|
panelDragCancelled: Object.freeze(["title"]),
|
|
17
|
-
multiColumnRegion: Object.freeze(["column"])
|
|
18
|
-
|
|
17
|
+
multiColumnRegion: Object.freeze(["column"]),
|
|
18
|
+
viewerSpreadsheetSize: Object.freeze(["rows", "cols"]),
|
|
19
|
+
viewerSpreadsheetCopyFailed: Object.freeze(["reason"]),
|
|
20
|
+
viewerSpreadsheetCellAnnouncement: Object.freeze(["cell", "value"]),
|
|
21
|
+
viewerSpreadsheetSelectionAnnouncement: Object.freeze(["range"]),
|
|
22
|
+
viewerSpreadsheetOptionsError: Object.freeze(["message"]),
|
|
23
|
+
viewerSpreadsheetLoadFailed: Object.freeze(["message"])
|
|
24
|
+
}), Or = /\{(\w+)\}/gu, dn = {
|
|
19
25
|
explorerRegion: "Explorer",
|
|
20
26
|
sourceLabel: "Source",
|
|
21
27
|
refreshTreeLabel: "Refresh tree",
|
|
@@ -244,6 +250,32 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
|
|
|
244
250
|
viewerEmbeddedVideo: "embedded video",
|
|
245
251
|
viewerEmbeddedPost: "embedded post",
|
|
246
252
|
viewerEmbeddedFrame: "Embedded content",
|
|
253
|
+
viewerSpreadsheetTable: "Spreadsheet",
|
|
254
|
+
viewerSpreadsheetZoomIn: "Zoom in",
|
|
255
|
+
viewerSpreadsheetZoomOut: "Zoom out",
|
|
256
|
+
viewerSpreadsheetResetZoom: "Reset zoom",
|
|
257
|
+
viewerSpreadsheetHighlight: "Highlight the active row and column",
|
|
258
|
+
viewerSpreadsheetCopyAll: "Copy the whole table",
|
|
259
|
+
viewerSpreadsheetSaveTsv: "Save as TSV",
|
|
260
|
+
viewerSpreadsheetSaveMenu: "More ways to save",
|
|
261
|
+
viewerSpreadsheetSaveTsvWithBom: "Save with a BOM (for Excel)",
|
|
262
|
+
viewerSpreadsheetFullscreen: "View full screen",
|
|
263
|
+
viewerSpreadsheetExitFullscreen: "Exit full screen",
|
|
264
|
+
viewerSpreadsheetFullscreenDialog: "Spreadsheet (full screen)",
|
|
265
|
+
viewerSpreadsheetSize: "Rows {rows} × columns {cols}",
|
|
266
|
+
viewerSpreadsheetFileName: "spreadsheet.tsv",
|
|
267
|
+
viewerSpreadsheetCopied: "Copied the whole table.",
|
|
268
|
+
viewerSpreadsheetCopyFailed: "Could not copy the table: {reason}",
|
|
269
|
+
viewerSpreadsheetCellAnnouncement: "{cell}, {value}",
|
|
270
|
+
viewerSpreadsheetEmptyCell: "blank",
|
|
271
|
+
viewerSpreadsheetSelectionAnnouncement: "{range} selected",
|
|
272
|
+
viewerSpreadsheetReadOnly: "This table is read-only here.",
|
|
273
|
+
viewerSpreadsheetFormatRefused: "This table keeps text only, so formatting and links are not saved.",
|
|
274
|
+
viewerSpreadsheetFenceRefused: "A cell cannot begin a line with ``` or ~~~ in this table, so the change was not saved.",
|
|
275
|
+
viewerSpreadsheetEditConflict: "The table changed in the editor, so the change was not saved. Try again.",
|
|
276
|
+
viewerSpreadsheetOptionsError: "Invalid spreadsheet options: {message}",
|
|
277
|
+
viewerSpreadsheetLoadFailed: "Could not load the spreadsheet: {message}",
|
|
278
|
+
viewerSpreadsheetRetry: "Retry",
|
|
247
279
|
multiRegion: "Panels",
|
|
248
280
|
multiEmpty: "Select documents in the explorer to open them side by side.",
|
|
249
281
|
panelLimit: (e) => `You can open up to ${String(e)} panels at once.`,
|
|
@@ -276,7 +308,7 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
|
|
|
276
308
|
multiColumnEmpty: "This column is empty",
|
|
277
309
|
multiColumnRegion: "Column {column}",
|
|
278
310
|
panelDropHere: "Drop the panel here"
|
|
279
|
-
},
|
|
311
|
+
}, Cr = {
|
|
280
312
|
explorerRegion: "エクスプローラー",
|
|
281
313
|
sourceLabel: "ソース",
|
|
282
314
|
refreshTreeLabel: "ツリーを更新",
|
|
@@ -505,6 +537,32 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
|
|
|
505
537
|
viewerEmbeddedVideo: "埋め込みの動画",
|
|
506
538
|
viewerEmbeddedPost: "埋め込みの投稿",
|
|
507
539
|
viewerEmbeddedFrame: "埋め込みのコンテンツ",
|
|
540
|
+
viewerSpreadsheetTable: "表",
|
|
541
|
+
viewerSpreadsheetZoomIn: "拡大",
|
|
542
|
+
viewerSpreadsheetZoomOut: "縮小",
|
|
543
|
+
viewerSpreadsheetResetZoom: "拡大率を戻す",
|
|
544
|
+
viewerSpreadsheetHighlight: "選んだ行と列を強調",
|
|
545
|
+
viewerSpreadsheetCopyAll: "表全体をコピー",
|
|
546
|
+
viewerSpreadsheetSaveTsv: "TSV として保存",
|
|
547
|
+
viewerSpreadsheetSaveMenu: "ほかの保存の方法",
|
|
548
|
+
viewerSpreadsheetSaveTsvWithBom: "BOM を付けて保存 (Excel 向け)",
|
|
549
|
+
viewerSpreadsheetFullscreen: "全画面で見る",
|
|
550
|
+
viewerSpreadsheetExitFullscreen: "全画面を閉じる",
|
|
551
|
+
viewerSpreadsheetFullscreenDialog: "表 (全画面)",
|
|
552
|
+
viewerSpreadsheetSize: "{rows} 行 × {cols} 列",
|
|
553
|
+
viewerSpreadsheetFileName: "表.tsv",
|
|
554
|
+
viewerSpreadsheetCopied: "表全体をコピーしました。",
|
|
555
|
+
viewerSpreadsheetCopyFailed: "表をコピーできませんでした: {reason}",
|
|
556
|
+
viewerSpreadsheetCellAnnouncement: "{cell}、{value}",
|
|
557
|
+
viewerSpreadsheetEmptyCell: "空白",
|
|
558
|
+
viewerSpreadsheetSelectionAnnouncement: "{range} を選択",
|
|
559
|
+
viewerSpreadsheetReadOnly: "この表はここでは編集できません。",
|
|
560
|
+
viewerSpreadsheetFormatRefused: "この表は文字だけを保つため、書式とリンクは保存しません。",
|
|
561
|
+
viewerSpreadsheetFenceRefused: "セルの行頭に ``` や ~~~ を置くと表が壊れるため、この変更は保存しませんでした。",
|
|
562
|
+
viewerSpreadsheetEditConflict: "エディタで表が変わっていたため、この変更は保存しませんでした。もう一度お試しください。",
|
|
563
|
+
viewerSpreadsheetOptionsError: "表の指定の誤り: {message}",
|
|
564
|
+
viewerSpreadsheetLoadFailed: "表を読み込めませんでした: {message}",
|
|
565
|
+
viewerSpreadsheetRetry: "再試行",
|
|
508
566
|
multiRegion: "パネル",
|
|
509
567
|
multiEmpty: "エクスプローラーで文書を選ぶと、ここに並べて開きます。",
|
|
510
568
|
panelLimit: (e) => `同時に開けるのは ${String(e)} パネルまでです。`,
|
|
@@ -537,59 +595,59 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
|
|
|
537
595
|
multiColumnEmpty: "この列は空です",
|
|
538
596
|
multiColumnRegion: "{column} 列目",
|
|
539
597
|
panelDropHere: "ここへパネルをドロップ"
|
|
540
|
-
},
|
|
541
|
-
en: Object.freeze(
|
|
542
|
-
ja: Object.freeze(
|
|
543
|
-
}),
|
|
598
|
+
}, Mr = Object.freeze({
|
|
599
|
+
en: Object.freeze(dn),
|
|
600
|
+
ja: Object.freeze(Cr)
|
|
601
|
+
}), cn = Object.freeze(Object.keys(dn)), Ar = new Set(cn), Lr = (e) => Ar.has(e), Me = (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, un = (e) => {
|
|
544
602
|
if (e === void 0) return Tr;
|
|
545
603
|
if (Tt.includes(e)) return e;
|
|
546
|
-
throw new RangeError(`[markdown-explorer] locale is the UI language (${Tt.map((t) => JSON.stringify(t)).join(" or ")}), not a BCP 47 tag; got ${
|
|
604
|
+
throw new RangeError(`[markdown-explorer] locale is the UI language (${Tt.map((t) => JSON.stringify(t)).join(" or ")}), not a BCP 47 tag; got ${Me(e)}`);
|
|
547
605
|
}, Rt = (e, t) => {
|
|
548
|
-
const n =
|
|
606
|
+
const n = Mr[un(e)];
|
|
549
607
|
if (t === void 0) return n;
|
|
550
608
|
if (t === null || typeof t != "object")
|
|
551
|
-
throw new RangeError(`[markdown-explorer] labels must be an object; got ${
|
|
552
|
-
if (!
|
|
553
|
-
throw new RangeError(`[markdown-explorer] labels must be a plain object; got ${
|
|
609
|
+
throw new RangeError(`[markdown-explorer] labels must be an object; got ${Me(t)}`);
|
|
610
|
+
if (!Zn(t))
|
|
611
|
+
throw new RangeError(`[markdown-explorer] labels must be a plain object; got ${Me(t)}`);
|
|
554
612
|
const r = t, o = { ...n };
|
|
555
613
|
for (const i of Object.keys(r)) {
|
|
556
|
-
if (!
|
|
557
|
-
throw new RangeError(`[markdown-explorer] labels.${i} is not a known label key; expected one of ${
|
|
558
|
-
const
|
|
559
|
-
if (
|
|
614
|
+
if (!Lr(i))
|
|
615
|
+
throw new RangeError(`[markdown-explorer] labels.${i} is not a known label key; expected one of ${cn.join(", ")}`);
|
|
616
|
+
const a = r[i];
|
|
617
|
+
if (a === void 0) continue;
|
|
560
618
|
const u = typeof n[i];
|
|
561
|
-
if (typeof
|
|
562
|
-
throw new TypeError(`[markdown-explorer] labels.${i} must be a ${u}; got ${
|
|
563
|
-
if (typeof
|
|
619
|
+
if (typeof a !== u)
|
|
620
|
+
throw new TypeError(`[markdown-explorer] labels.${i} must be a ${u}; got ${Me(a)}`);
|
|
621
|
+
if (typeof a == "string" && a.trim() === "")
|
|
564
622
|
throw new RangeError(`[markdown-explorer] labels.${i} must be a non-blank string`);
|
|
565
623
|
const m = Rr[i];
|
|
566
|
-
if (typeof
|
|
567
|
-
for (const [, f] of
|
|
624
|
+
if (typeof a == "string" && m !== void 0) {
|
|
625
|
+
for (const [, f] of a.matchAll(Or))
|
|
568
626
|
if (!m.includes(f ?? ""))
|
|
569
|
-
throw new RangeError(`[markdown-explorer] labels.${i} uses the unknown placeholder {${String(f)}}; it accepts ${m.map((
|
|
627
|
+
throw new RangeError(`[markdown-explorer] labels.${i} uses the unknown placeholder {${String(f)}}; it accepts ${m.map((c) => `{${c}}`).join(", ")}`);
|
|
570
628
|
}
|
|
571
|
-
o[i] =
|
|
629
|
+
o[i] = a;
|
|
572
630
|
}
|
|
573
631
|
return Object.freeze(o);
|
|
574
632
|
}, Nr = (e, t) => {
|
|
575
633
|
if (Object.is(e, t)) return !0;
|
|
576
634
|
if (e === null || t === null || typeof e != "object" || typeof t != "object") return !1;
|
|
577
635
|
const n = e, r = t, o = Object.keys(n), i = Object.keys(r);
|
|
578
|
-
return o.length === i.length && i.every((
|
|
579
|
-
},
|
|
636
|
+
return o.length === i.length && i.every((a) => Object.hasOwn(n, a) && Object.is(n[a], r[a]));
|
|
637
|
+
}, Ot = Object.freeze(["light", "dark"]), Dr = (e) => {
|
|
580
638
|
if (e === void 0) return "light";
|
|
581
|
-
if (
|
|
582
|
-
throw new RangeError(`[markdown-explorer] theme must be ${
|
|
639
|
+
if (Ot.includes(e)) return e;
|
|
640
|
+
throw new RangeError(`[markdown-explorer] theme must be ${Ot.map((t) => JSON.stringify(t)).join(" or ")}; got ${typeof e == "string" ? JSON.stringify(e) : typeof e}`);
|
|
583
641
|
}, fn = pe(null), D = () => {
|
|
584
|
-
const e =
|
|
642
|
+
const e = re(fn);
|
|
585
643
|
if (e === null) throw new Error("[markdown-explorer] explorer components must be rendered inside <MarkdownExplorer>");
|
|
586
644
|
return e;
|
|
587
|
-
},
|
|
645
|
+
}, Le = (e) => {
|
|
588
646
|
const { viewSettings: t } = D(), n = () => e(t.getSnapshot());
|
|
589
647
|
return ee(t.subscribe, n, n);
|
|
590
|
-
},
|
|
648
|
+
}, at = () => {
|
|
591
649
|
const { config: e } = D(), t = _n()["*"], [n] = In(), r = n.toString();
|
|
592
|
-
return
|
|
650
|
+
return U(() => rn(e, t, new URLSearchParams(r)), [e, t, r]);
|
|
593
651
|
}, mn = {
|
|
594
652
|
unauthorized: ["failureUnauthorizedTitle", "failureUnauthorizedBody"],
|
|
595
653
|
forbidden: ["failureForbiddenTitle", "failureForbiddenBody"],
|
|
@@ -599,12 +657,12 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
|
|
|
599
657
|
"too-large": ["failureTooLargeTitle", "failureTooLargeBody"],
|
|
600
658
|
unsupported: ["failureUnsupportedTitle", "failureUnsupportedBody"],
|
|
601
659
|
failed: ["failureFailedTitle", "failureFailedBody"]
|
|
602
|
-
},
|
|
603
|
-
const { labels: o } = D(), i =
|
|
604
|
-
return /* @__PURE__ */
|
|
605
|
-
/* @__PURE__ */
|
|
606
|
-
/* @__PURE__ */
|
|
607
|
-
e.reason === "unauthorized" ? /* @__PURE__ */
|
|
660
|
+
}, le = (e, t) => e[mn[t][0]], me = ({ failure: e, alert: t, onRetry: n, testId: r }) => {
|
|
661
|
+
const { labels: o } = D(), i = le(o, e.reason), a = o[mn[e.reason][1]], u = e.reason === "unauthorized" || e.reason === "forbidden" || e.reason === "failed" ? "danger" : "warning";
|
|
662
|
+
return /* @__PURE__ */ $("div", { className: "aqmx-callout", role: t ? "alert" : void 0, "data-aqmx-tone": u, "data-testid": r === null ? void 0 : r, "data-aqmx-failure": r === null ? void 0 : e.reason, children: [
|
|
663
|
+
/* @__PURE__ */ d("p", { className: "aqmx-callout-title", children: i }),
|
|
664
|
+
/* @__PURE__ */ d("p", { className: "aqmx-callout-body", children: a }),
|
|
665
|
+
e.reason === "unauthorized" ? /* @__PURE__ */ d("button", { type: "button", className: "aqmx-callout-action", onClick: () => window.location.reload(), children: o.reloadPage }) : n !== void 0 && e.reason === "failed" ? /* @__PURE__ */ d("button", { type: "button", className: "aqmx-callout-action", onClick: n, children: o.retry }) : null
|
|
608
666
|
] });
|
|
609
667
|
}, Pr = (e, t) => {
|
|
610
668
|
const { phase: n, save: r, dirty: o } = t;
|
|
@@ -614,7 +672,7 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
|
|
|
614
672
|
case "grant":
|
|
615
673
|
return e.editGrantTitle;
|
|
616
674
|
case "failed":
|
|
617
|
-
return
|
|
675
|
+
return le(e, n.failure.reason);
|
|
618
676
|
}
|
|
619
677
|
switch (r.kind) {
|
|
620
678
|
case "draft":
|
|
@@ -626,13 +684,13 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
|
|
|
626
684
|
case "grant":
|
|
627
685
|
return e.editGrantTitle;
|
|
628
686
|
case "failed":
|
|
629
|
-
return e.draftSaveFailed(
|
|
687
|
+
return e.draftSaveFailed(le(e, r.failure.reason));
|
|
630
688
|
case "saved":
|
|
631
689
|
if (!o) return r.merged ? e.draftSavedMerged : e.draftSaved;
|
|
632
690
|
break;
|
|
633
691
|
}
|
|
634
692
|
return o ? e.draftUnsaved : "";
|
|
635
|
-
},
|
|
693
|
+
}, Fr = (e, t, n) => {
|
|
636
694
|
switch (t.kind) {
|
|
637
695
|
case "draft":
|
|
638
696
|
return e.draftNotSaved;
|
|
@@ -643,12 +701,12 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
|
|
|
643
701
|
case "grant":
|
|
644
702
|
return e.editGrantTitle;
|
|
645
703
|
case "failed":
|
|
646
|
-
return e.draftSaveFailed(
|
|
704
|
+
return e.draftSaveFailed(le(e, t.failure.reason));
|
|
647
705
|
case "idle":
|
|
648
706
|
case "saving":
|
|
649
707
|
return null;
|
|
650
708
|
}
|
|
651
|
-
},
|
|
709
|
+
}, Oe = () => {
|
|
652
710
|
const e = /* @__PURE__ */ new Set();
|
|
653
711
|
return {
|
|
654
712
|
subscribe: (t) => (e.add(t), () => {
|
|
@@ -658,288 +716,288 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
|
|
|
658
716
|
for (const t of [...e]) t();
|
|
659
717
|
}
|
|
660
718
|
};
|
|
661
|
-
},
|
|
719
|
+
}, $r = "<<<<<<<", qr = "=======", _r = ">>>>>>>", Ct = (e, t) => e === t || e.startsWith(`${t} `), Mt = (e) => Ir(e.split(`
|
|
662
720
|
`)), Ir = (e) => {
|
|
663
721
|
const t = [];
|
|
664
722
|
let n = null, r = null, o = 0;
|
|
665
723
|
for (const i of e) {
|
|
666
724
|
o += 1;
|
|
667
|
-
const
|
|
668
|
-
|
|
725
|
+
const a = i.charCodeAt(0);
|
|
726
|
+
a !== 60 && a !== 61 && a !== 62 || (Ct(i, $r) ? (n = o, r = null) : i === qr ? n !== null && r === null ? r = o : n = null : Ct(i, _r) && (n !== null && r !== null && t.push({ start: n, separator: r, end: o }), n = null, r = null));
|
|
669
727
|
}
|
|
670
728
|
return t;
|
|
671
|
-
},
|
|
729
|
+
}, At = (e) => e.includes(`\r
|
|
672
730
|
`) ? `\r
|
|
673
731
|
` : `
|
|
674
|
-
`,
|
|
732
|
+
`, Ze = (e) => e.replace(/\r\n?/gu, `
|
|
675
733
|
`), Br = (e, t) => t === `
|
|
676
734
|
` ? e : e.replaceAll(`
|
|
677
735
|
`, `\r
|
|
678
736
|
`), zr = 3, jr = /^\d+(?:\.\d+)?$/u, Hr = (e) => {
|
|
679
737
|
if (e === null || !jr.test(e)) return null;
|
|
680
738
|
const t = Number(e);
|
|
681
|
-
return t >=
|
|
682
|
-
},
|
|
683
|
-
const i = /* @__PURE__ */ new Map(),
|
|
684
|
-
let h = null, g = null,
|
|
685
|
-
const
|
|
686
|
-
|
|
687
|
-
}, R = (
|
|
739
|
+
return t >= an && t <= on ? t : null;
|
|
740
|
+
}, Ue = Object.freeze({ kind: "idle" }), Lt = Object.freeze({ kind: "draft" }), Vr = ({ data: e, conflictLabels: t, onSaveSettled: n, sideBySideSetting: r, editorShareSetting: o }) => {
|
|
741
|
+
const i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map(), c = Oe();
|
|
742
|
+
let h = null, g = null, E = null;
|
|
743
|
+
const k = (l, s) => {
|
|
744
|
+
l.value = { ...l.value, ...s }, c.emit();
|
|
745
|
+
}, R = (l, s) => i.get(l) === s, T = async (l, s) => {
|
|
688
746
|
s.controller.abort(), s.controller = new AbortController();
|
|
689
|
-
const { signal:
|
|
690
|
-
|
|
691
|
-
const
|
|
692
|
-
if (!R(
|
|
693
|
-
if (
|
|
694
|
-
|
|
747
|
+
const { signal: v } = s.controller;
|
|
748
|
+
k(s, { phase: { kind: "opening" } });
|
|
749
|
+
const O = await e.edit(l, v);
|
|
750
|
+
if (!R(l, s) || v.aborted || !("kind" in O)) return;
|
|
751
|
+
if (O.kind === "grant") {
|
|
752
|
+
k(s, { phase: { kind: "grant", href: O.href } });
|
|
695
753
|
return;
|
|
696
754
|
}
|
|
697
|
-
if (
|
|
698
|
-
|
|
755
|
+
if (O.kind === "failure") {
|
|
756
|
+
k(s, { phase: { kind: "failed", failure: O.failure } });
|
|
699
757
|
return;
|
|
700
758
|
}
|
|
701
|
-
const
|
|
702
|
-
s.base = { text:
|
|
703
|
-
}, A = (
|
|
704
|
-
const s = i.get(
|
|
705
|
-
s !== void 0 && (s.controller.abort(), i.delete(
|
|
706
|
-
}, L = (
|
|
707
|
-
|
|
708
|
-
}),
|
|
709
|
-
|
|
710
|
-
},
|
|
711
|
-
m.get(
|
|
712
|
-
const s = i.get(
|
|
759
|
+
const M = Ze(O.text), N = O.kind === "draft";
|
|
760
|
+
s.base = { text: M, version: N ? null : O.version }, s.draft = M, s.ending = At(O.text), k(s, { phase: { kind: "editing" }, history: N ? !1 : O.history, dirty: !1, save: N ? Lt : Ue, generation: s.value.generation + 1 });
|
|
761
|
+
}, A = (l) => {
|
|
762
|
+
const s = i.get(l);
|
|
763
|
+
s !== void 0 && (s.controller.abort(), i.delete(l), u.delete(l));
|
|
764
|
+
}, L = (l, s, v) => (l.set(s, v), () => {
|
|
765
|
+
l.get(s) === v && l.delete(s);
|
|
766
|
+
}), b = (l, s, v, O = {}) => {
|
|
767
|
+
k(s, { ...O, save: v }), n(l, v);
|
|
768
|
+
}, w = async (l) => {
|
|
769
|
+
m.get(l)?.flush();
|
|
770
|
+
const s = i.get(l);
|
|
713
771
|
if (s === void 0 || s.value.phase.kind !== "editing" || s.base === null || s.value.save.kind === "saving") return;
|
|
714
|
-
const { version:
|
|
715
|
-
if (
|
|
716
|
-
n(
|
|
772
|
+
const { version: v } = s.base;
|
|
773
|
+
if (v === null) {
|
|
774
|
+
n(l, Lt);
|
|
717
775
|
return;
|
|
718
776
|
}
|
|
719
|
-
const
|
|
720
|
-
if (
|
|
721
|
-
|
|
777
|
+
const O = Mt(s.draft).length;
|
|
778
|
+
if (O > 0) {
|
|
779
|
+
b(l, s, { kind: "conflicts", count: O });
|
|
722
780
|
return;
|
|
723
781
|
}
|
|
724
782
|
s.controller.abort(), s.controller = new AbortController();
|
|
725
|
-
const { signal:
|
|
726
|
-
let N = { text: s.base.text, version:
|
|
727
|
-
|
|
728
|
-
for (let
|
|
729
|
-
const
|
|
730
|
-
if (!R(
|
|
731
|
-
if (
|
|
732
|
-
m.get(
|
|
783
|
+
const { signal: M } = s.controller;
|
|
784
|
+
let N = { text: s.base.text, version: v }, q = s.draft, W = !1;
|
|
785
|
+
k(s, { save: { kind: "saving" } });
|
|
786
|
+
for (let G = 0; G < zr; G += 1) {
|
|
787
|
+
const I = await e.save(l, N.version, Br(q, s.ending), M);
|
|
788
|
+
if (!R(l, s) || M.aborted || !("kind" in I)) return;
|
|
789
|
+
if (I.kind === "saved") {
|
|
790
|
+
m.get(l)?.flush(), s.base = { text: q, version: I.version }, b(l, s, { kind: "saved", merged: W }, { dirty: s.draft !== q });
|
|
733
791
|
return;
|
|
734
792
|
}
|
|
735
|
-
if (
|
|
736
|
-
|
|
793
|
+
if (I.kind === "grant") {
|
|
794
|
+
b(l, s, { kind: "grant", href: I.href });
|
|
737
795
|
return;
|
|
738
796
|
}
|
|
739
|
-
if (
|
|
740
|
-
|
|
797
|
+
if (I.kind === "failure") {
|
|
798
|
+
b(l, s, { kind: "failed", failure: I.failure });
|
|
741
799
|
return;
|
|
742
800
|
}
|
|
743
|
-
const { mergeDraft:
|
|
744
|
-
if (!R(
|
|
745
|
-
const
|
|
746
|
-
|
|
747
|
-
const
|
|
748
|
-
if (N = { text:
|
|
749
|
-
|
|
801
|
+
const { mergeDraft: J } = await import("./merge-BIXNcrea.js");
|
|
802
|
+
if (!R(l, s) || M.aborted) return;
|
|
803
|
+
const H = m.get(l);
|
|
804
|
+
H?.flush();
|
|
805
|
+
const ne = Ze(I.text), p = J(N.text, s.draft, ne, t());
|
|
806
|
+
if (N = { text: ne, version: I.version }, s.base = N, s.ending = At(I.text), s.draft = p.text, H?.adopt(p.text), p.kind === "conflicts") {
|
|
807
|
+
b(l, s, { kind: "conflicts", count: p.conflicts }, { dirty: !0, generation: s.value.generation + 1 });
|
|
750
808
|
return;
|
|
751
809
|
}
|
|
752
810
|
if (W = !0, q = p.text, q === N.text) {
|
|
753
|
-
|
|
811
|
+
b(l, s, { kind: "saved", merged: W }, { dirty: !1, generation: s.value.generation + 1 });
|
|
754
812
|
return;
|
|
755
813
|
}
|
|
756
|
-
|
|
814
|
+
k(s, { dirty: !0, generation: s.value.generation + 1 });
|
|
757
815
|
}
|
|
758
|
-
|
|
816
|
+
b(l, s, { kind: "failed", failure: { reason: "failed" } });
|
|
759
817
|
};
|
|
760
818
|
return {
|
|
761
|
-
session: (
|
|
762
|
-
subscribe:
|
|
763
|
-
start: (
|
|
764
|
-
const
|
|
765
|
-
if (
|
|
766
|
-
|
|
819
|
+
session: (l) => i.get(l)?.value,
|
|
820
|
+
subscribe: c.subscribe,
|
|
821
|
+
start: (l, s) => {
|
|
822
|
+
const v = i.get(l);
|
|
823
|
+
if (v !== void 0) {
|
|
824
|
+
k(v, { request: { anchor: s }, view: "editor" }), (v.value.phase.kind === "failed" || v.value.phase.kind === "grant") && T(l, v);
|
|
767
825
|
return;
|
|
768
826
|
}
|
|
769
|
-
|
|
770
|
-
const
|
|
771
|
-
value: { path:
|
|
827
|
+
a.delete(l);
|
|
828
|
+
const O = {
|
|
829
|
+
value: { path: l, phase: { kind: "opening" }, view: "editor", previewPrepared: !1, history: !1, dirty: !1, save: Ue, generation: 0, request: { anchor: s } },
|
|
772
830
|
base: null,
|
|
773
831
|
draft: "",
|
|
774
832
|
ending: `
|
|
775
833
|
`,
|
|
776
834
|
controller: new AbortController()
|
|
777
835
|
};
|
|
778
|
-
i.set(
|
|
836
|
+
i.set(l, O), T(l, O);
|
|
779
837
|
},
|
|
780
|
-
retry: (
|
|
781
|
-
const s = i.get(
|
|
782
|
-
s === void 0 || s.value.phase.kind === "editing" ||
|
|
838
|
+
retry: (l) => {
|
|
839
|
+
const s = i.get(l);
|
|
840
|
+
s === void 0 || s.value.phase.kind === "editing" || T(l, s);
|
|
783
841
|
},
|
|
784
|
-
draft: (
|
|
785
|
-
const s = i.get(
|
|
842
|
+
draft: (l) => {
|
|
843
|
+
const s = i.get(l);
|
|
786
844
|
return s === void 0 || s.base === null ? null : s.draft;
|
|
787
845
|
},
|
|
788
|
-
setDraft: (
|
|
789
|
-
const
|
|
790
|
-
if (
|
|
791
|
-
|
|
792
|
-
const
|
|
793
|
-
|
|
794
|
-
const { save: N } =
|
|
846
|
+
setDraft: (l, s) => {
|
|
847
|
+
const v = i.get(l);
|
|
848
|
+
if (v === void 0 || v.base === null) return;
|
|
849
|
+
v.draft = s;
|
|
850
|
+
const O = {}, M = s !== v.base.text;
|
|
851
|
+
M !== v.value.dirty && (O.dirty = M);
|
|
852
|
+
const { save: N } = v.value;
|
|
795
853
|
if (N.kind === "conflicts") {
|
|
796
|
-
const q =
|
|
797
|
-
q === 0 ?
|
|
854
|
+
const q = Mt(s).length;
|
|
855
|
+
q === 0 ? O.save = Ue : q !== N.count && (O.save = { kind: "conflicts", count: q });
|
|
798
856
|
}
|
|
799
|
-
(
|
|
857
|
+
(O.dirty !== void 0 || O.save !== void 0) && k(v, O);
|
|
800
858
|
},
|
|
801
|
-
consumeRequest: (
|
|
802
|
-
const s = i.get(
|
|
803
|
-
s !== void 0 && s.value.request !== null &&
|
|
859
|
+
consumeRequest: (l) => {
|
|
860
|
+
const s = i.get(l);
|
|
861
|
+
s !== void 0 && s.value.request !== null && k(s, { request: null });
|
|
804
862
|
},
|
|
805
|
-
save:
|
|
806
|
-
replaceDraft: (
|
|
807
|
-
const
|
|
808
|
-
|
|
809
|
-
const
|
|
810
|
-
if (
|
|
811
|
-
const
|
|
812
|
-
|
|
863
|
+
save: w,
|
|
864
|
+
replaceDraft: (l, s) => {
|
|
865
|
+
const v = m.get(l);
|
|
866
|
+
v?.flush();
|
|
867
|
+
const O = i.get(l);
|
|
868
|
+
if (O === void 0 || O.base === null) return;
|
|
869
|
+
const M = Ze(s);
|
|
870
|
+
O.draft = M, v?.adopt(M), k(O, { dirty: M !== O.base.text, generation: O.value.generation + 1 });
|
|
813
871
|
},
|
|
814
|
-
close: (
|
|
815
|
-
if (!i.has(
|
|
816
|
-
const s = m.get(
|
|
817
|
-
A(
|
|
872
|
+
close: (l) => {
|
|
873
|
+
if (!i.has(l)) return;
|
|
874
|
+
const s = m.get(l), v = s === void 0 ? null : s.returnPoint();
|
|
875
|
+
A(l), v === null ? a.delete(l) : a.set(l, v), c.emit();
|
|
818
876
|
},
|
|
819
|
-
takeReturn: (
|
|
820
|
-
const s =
|
|
821
|
-
return
|
|
877
|
+
takeReturn: (l) => {
|
|
878
|
+
const s = a.get(l) ?? null;
|
|
879
|
+
return a.delete(l), s;
|
|
822
880
|
},
|
|
823
|
-
dirtyPaths: () => [...i.values()].filter((
|
|
824
|
-
discard: (
|
|
825
|
-
for (const s of
|
|
826
|
-
|
|
881
|
+
dirtyPaths: () => [...i.values()].filter((l) => l.value.dirty).map((l) => l.value.path),
|
|
882
|
+
discard: (l) => {
|
|
883
|
+
for (const s of l) A(s);
|
|
884
|
+
l.length > 0 && c.emit();
|
|
827
885
|
},
|
|
828
886
|
editorState: {
|
|
829
|
-
get: (
|
|
830
|
-
set: (
|
|
831
|
-
i.has(
|
|
887
|
+
get: (l) => u.get(l),
|
|
888
|
+
set: (l, s) => {
|
|
889
|
+
i.has(l) && u.set(l, s);
|
|
832
890
|
}
|
|
833
891
|
},
|
|
834
|
-
bindEditor: (
|
|
835
|
-
bindView: (
|
|
836
|
-
viewAnchor: (
|
|
837
|
-
const s = f.get(
|
|
892
|
+
bindEditor: (l, s) => L(m, l, s),
|
|
893
|
+
bindView: (l, s) => L(f, l, s),
|
|
894
|
+
viewAnchor: (l) => {
|
|
895
|
+
const s = f.get(l);
|
|
838
896
|
return s === void 0 ? null : s.anchor();
|
|
839
897
|
},
|
|
840
|
-
flush: (
|
|
898
|
+
flush: (l) => m.get(l)?.flush(),
|
|
841
899
|
flushDrafts: () => {
|
|
842
|
-
for (const
|
|
900
|
+
for (const l of m.values()) l.flush();
|
|
843
901
|
},
|
|
844
|
-
nextConflict: (
|
|
902
|
+
nextConflict: (l) => m.get(l)?.nextConflict() === !0,
|
|
845
903
|
hasSessions: () => i.size > 0,
|
|
846
|
-
unsavedAmong: (
|
|
904
|
+
unsavedAmong: (l) => {
|
|
847
905
|
for (const s of m.values()) s.flush();
|
|
848
|
-
return
|
|
906
|
+
return l.filter((s) => i.get(s)?.value.dirty === !0);
|
|
849
907
|
},
|
|
850
|
-
askToDiscard: (
|
|
851
|
-
|
|
852
|
-
const
|
|
853
|
-
paths:
|
|
854
|
-
settle: (
|
|
855
|
-
if (
|
|
856
|
-
if (
|
|
857
|
-
|
|
908
|
+
askToDiscard: (l) => new Promise((s) => {
|
|
909
|
+
E?.settle(!1);
|
|
910
|
+
const v = {
|
|
911
|
+
paths: l,
|
|
912
|
+
settle: (O) => {
|
|
913
|
+
if (E === v) {
|
|
914
|
+
if (E = null, O) for (const M of l) A(M);
|
|
915
|
+
c.emit(), s(O);
|
|
858
916
|
}
|
|
859
917
|
}
|
|
860
918
|
};
|
|
861
|
-
|
|
919
|
+
E = v, c.emit();
|
|
862
920
|
}),
|
|
863
|
-
discardRequest: () =>
|
|
921
|
+
discardRequest: () => E,
|
|
864
922
|
sideBySide: () => (h ??= r.read(), h),
|
|
865
|
-
setSideBySide: (
|
|
866
|
-
h !==
|
|
923
|
+
setSideBySide: (l) => {
|
|
924
|
+
h !== l && (h = l, r.write(l), c.emit());
|
|
867
925
|
},
|
|
868
|
-
editorShare: () => (g ??= o.read() ??
|
|
869
|
-
setEditorShare: (
|
|
870
|
-
if (!Number.isFinite(
|
|
871
|
-
const s = Math.min(on, Math.max(
|
|
926
|
+
editorShare: () => (g ??= o.read() ?? Un, g),
|
|
927
|
+
setEditorShare: (l) => {
|
|
928
|
+
if (!Number.isFinite(l)) throw new RangeError(`[markdown-explorer] an editor share must be a finite number; got ${String(l)}`);
|
|
929
|
+
const s = Math.min(on, Math.max(an, l));
|
|
872
930
|
g !== s && (g = s, o.write(s));
|
|
873
931
|
},
|
|
874
|
-
setView: (
|
|
875
|
-
const
|
|
876
|
-
|
|
932
|
+
setView: (l, s) => {
|
|
933
|
+
const v = i.get(l);
|
|
934
|
+
v === void 0 || v.value.view === s || (m.get(l)?.beforeView(s), k(v, { view: s, previewPrepared: v.value.previewPrepared || s === "preview" }));
|
|
877
935
|
},
|
|
878
|
-
preparePreview: (
|
|
879
|
-
const s = i.get(
|
|
880
|
-
s !== void 0 && !s.value.previewPrepared &&
|
|
936
|
+
preparePreview: (l) => {
|
|
937
|
+
const s = i.get(l);
|
|
938
|
+
s !== void 0 && !s.value.previewPrepared && k(s, { previewPrepared: !0 });
|
|
881
939
|
}
|
|
882
940
|
};
|
|
883
941
|
}, hn = (e) => {
|
|
884
942
|
e.preventDefault(), e.stopPropagation();
|
|
885
|
-
},
|
|
943
|
+
}, Zr = (e) => e.endsWith("px") ? Number.parseFloat(e) : Number.NaN, pn = "data-aqmx-content-pane", et = Object.freeze({ [pn]: "" }), Ur = "--aqmx-dialog-left", Gr = "--aqmx-dialog-top", Wr = '[data-testid="markdown-explorer"]', Kr = (e) => {
|
|
886
944
|
const t = e.closest(Wr)?.querySelectorAll(`[${pn}]`), n = t?.item(t.length - 1);
|
|
887
945
|
if (!(n instanceof HTMLElement)) throw new Error("[markdown-explorer] a dialog opened where the explorer marks no content pane");
|
|
888
946
|
return n;
|
|
889
947
|
}, Xr = (e) => {
|
|
890
|
-
const t =
|
|
948
|
+
const t = Zr(getComputedStyle(e).marginTop);
|
|
891
949
|
if (Number.isNaN(t)) return null;
|
|
892
|
-
const n = Kr(e), r = e.getBoundingClientRect(), o = e.ownerDocument.documentElement, { left: i, top:
|
|
893
|
-
return e.style.setProperty(
|
|
950
|
+
const n = Kr(e), r = e.getBoundingClientRect(), o = e.ownerDocument.documentElement, { left: i, top: a } = Gn(n.getBoundingClientRect(), { width: r.width + 2 * t, height: r.height + 2 * t }, { width: o.clientWidth, height: o.clientHeight });
|
|
951
|
+
return e.style.setProperty(Ur, `${String(i)}px`), e.style.setProperty(Gr, `${String(a)}px`), n;
|
|
894
952
|
}, Yr = (e) => e.preventDefault(), vn = ({ open: e, onOpen: t, onDismiss: n }) => {
|
|
895
|
-
const r = _(null), o = _(null), i = _(!1),
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
}, [t]),
|
|
953
|
+
const r = _(null), o = _(null), i = _(!1), a = _(t);
|
|
954
|
+
j(() => {
|
|
955
|
+
a.current = t;
|
|
956
|
+
}, [t]), j(() => {
|
|
899
957
|
i.current = e;
|
|
900
|
-
const
|
|
901
|
-
if (
|
|
902
|
-
if (e && !
|
|
903
|
-
const h =
|
|
904
|
-
o.current = h instanceof HTMLElement ? h : null,
|
|
905
|
-
} else !e &&
|
|
906
|
-
}, [e]),
|
|
907
|
-
const
|
|
908
|
-
if (!e ||
|
|
909
|
-
const h = new ResizeObserver(() =>
|
|
958
|
+
const c = r.current;
|
|
959
|
+
if (c !== null)
|
|
960
|
+
if (e && !c.open) {
|
|
961
|
+
const h = c.ownerDocument.activeElement;
|
|
962
|
+
o.current = h instanceof HTMLElement ? h : null, c.showModal(), a.current?.();
|
|
963
|
+
} else !e && c.open && (c.close(), o.current?.isConnected === !0 && o.current.focus(), o.current = null);
|
|
964
|
+
}, [e]), j(() => {
|
|
965
|
+
const c = r.current;
|
|
966
|
+
if (!e || c === null) return;
|
|
967
|
+
const h = new ResizeObserver(() => E());
|
|
910
968
|
let g = null;
|
|
911
|
-
const
|
|
912
|
-
const R = Xr(
|
|
969
|
+
const E = () => {
|
|
970
|
+
const R = Xr(c);
|
|
913
971
|
R === null || R === g || (g !== null && h.unobserve(g), h.observe(R), g = R);
|
|
914
972
|
};
|
|
915
|
-
|
|
916
|
-
const
|
|
917
|
-
return
|
|
918
|
-
h.disconnect(),
|
|
973
|
+
E(), h.observe(c);
|
|
974
|
+
const k = c.ownerDocument.defaultView;
|
|
975
|
+
return k?.addEventListener("resize", E), c.ownerDocument.addEventListener("scroll", E, { capture: !0, passive: !0 }), () => {
|
|
976
|
+
h.disconnect(), k?.removeEventListener("resize", E), c.ownerDocument.removeEventListener("scroll", E, { capture: !0 });
|
|
919
977
|
};
|
|
920
978
|
}, [e]);
|
|
921
979
|
const u = P(
|
|
922
|
-
(
|
|
923
|
-
|
|
980
|
+
(c) => {
|
|
981
|
+
c.key !== "Escape" || c.defaultPrevented || (hn(c), n());
|
|
924
982
|
},
|
|
925
983
|
[n]
|
|
926
984
|
), m = P(
|
|
927
|
-
(
|
|
928
|
-
|
|
985
|
+
(c) => {
|
|
986
|
+
c.target === c.currentTarget && n();
|
|
929
987
|
},
|
|
930
988
|
[n]
|
|
931
989
|
), f = P(() => {
|
|
932
990
|
i.current && n();
|
|
933
991
|
}, [n]);
|
|
934
992
|
return { ref: r, onKeyDown: u, onClick: m, onCancel: Yr, onClose: f };
|
|
935
|
-
}, wn = ({ open: e, title: t, body: n, confirmLabel: r, cancelLabel: o, onConfirm: i, onCancel:
|
|
936
|
-
const m = _(null), f =
|
|
937
|
-
return /* @__PURE__ */
|
|
938
|
-
/* @__PURE__ */
|
|
939
|
-
/* @__PURE__ */
|
|
940
|
-
/* @__PURE__ */
|
|
941
|
-
/* @__PURE__ */
|
|
942
|
-
/* @__PURE__ */
|
|
993
|
+
}, wn = ({ open: e, title: t, body: n, confirmLabel: r, cancelLabel: o, onConfirm: i, onCancel: a, testId: u }) => {
|
|
994
|
+
const m = _(null), f = xe(), c = xe(), h = P(() => m.current?.focus(), []), g = vn({ open: e, onOpen: h, onDismiss: a });
|
|
995
|
+
return /* @__PURE__ */ d("dialog", { ...g, className: "aqmx-confirm", "aria-labelledby": f, "aria-describedby": c, "data-testid": u, children: /* @__PURE__ */ $("div", { className: "aqmx-confirm-panel", children: [
|
|
996
|
+
/* @__PURE__ */ d("p", { id: f, className: "aqmx-confirm-title", children: t }),
|
|
997
|
+
/* @__PURE__ */ d("p", { id: c, className: "aqmx-confirm-body", children: n }),
|
|
998
|
+
/* @__PURE__ */ $("div", { className: "aqmx-confirm-actions", children: [
|
|
999
|
+
/* @__PURE__ */ d("button", { ref: m, type: "button", className: "aqmx-callout-action", "data-testid": `${u}-cancel`, onClick: a, children: o }),
|
|
1000
|
+
/* @__PURE__ */ d("button", { type: "button", className: "aqmx-callout-action", "data-aqmx-tone": "danger", "data-testid": `${u}-confirm`, onClick: i, children: r })
|
|
943
1001
|
] })
|
|
944
1002
|
] }) });
|
|
945
1003
|
}, Te = (e) => {
|
|
@@ -957,7 +1015,7 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
|
|
|
957
1015
|
for (let i = o.pop(); i !== void 0; i = o.pop()) {
|
|
958
1016
|
if (i.type !== "directory" || r.has(i.path)) continue;
|
|
959
1017
|
r.add(i.path);
|
|
960
|
-
const
|
|
1018
|
+
const a = i.lazy === !0 ? n(i.path) : void 0, u = i.lazy === !0 ? a?.status === "loaded" ? a.entries : null : i.children === void 0 ? [] : i.children;
|
|
961
1019
|
if (i.path === t) return u;
|
|
962
1020
|
if (u !== null) for (const m of [...u].reverse()) o.push(m);
|
|
963
1021
|
}
|
|
@@ -966,7 +1024,7 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
|
|
|
966
1024
|
const r = Ee(e.read(t));
|
|
967
1025
|
if (r === void 0 || r.status === "deferred") return Jr;
|
|
968
1026
|
if (r.status === "error") return { readme: { status: "failed", failure: r.failure, retry: () => e.retry(t) }, claim: !1 };
|
|
969
|
-
const o = eo(r.entries, n, (
|
|
1027
|
+
const o = eo(r.entries, n, (a) => e.children(t, a));
|
|
970
1028
|
if (o !== null) return { readme: { status: "ok", readme: wt(o) }, claim: !1 };
|
|
971
1029
|
const i = e.children(t, n);
|
|
972
1030
|
return i === void 0 || i.status === "loading" ? Qr : i.status === "failed" ? { readme: { status: "failed", failure: i.failure, retry: () => e.retryChildren(t, n) }, claim: !0 } : { readme: { status: "ok", readme: wt(i.entries) }, claim: !0 };
|
|
@@ -994,26 +1052,26 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
|
|
|
994
1052
|
}, io = () => {
|
|
995
1053
|
const { edits: e } = D();
|
|
996
1054
|
return ee(e.subscribe, e.hasSessions, En);
|
|
997
|
-
},
|
|
1055
|
+
}, ao = () => {
|
|
998
1056
|
const { edits: e } = D();
|
|
999
1057
|
return ee(e.subscribe, e.sideBySide, En);
|
|
1000
|
-
},
|
|
1058
|
+
}, lo = () => null, so = () => {
|
|
1001
1059
|
const { edits: e, labels: t, config: n, trees: r } = D(), o = _([]), i = P(
|
|
1002
|
-
({ nextLocation:
|
|
1003
|
-
const
|
|
1004
|
-
return e.flushDrafts(), o.current = e.dirtyPaths().filter((R) => !
|
|
1060
|
+
({ nextLocation: E }) => {
|
|
1061
|
+
const k = ro(n, E, (R, T) => no(r, R, T));
|
|
1062
|
+
return e.flushDrafts(), o.current = e.dirtyPaths().filter((R) => !k.has(R)), o.current.length > 0;
|
|
1005
1063
|
},
|
|
1006
1064
|
[e, n, r]
|
|
1007
|
-
),
|
|
1065
|
+
), a = zn(i), u = io();
|
|
1008
1066
|
te(() => {
|
|
1009
1067
|
if (!u) return;
|
|
1010
|
-
const
|
|
1011
|
-
e.flushDrafts(), e.dirtyPaths().length !== 0 && (
|
|
1068
|
+
const E = (k) => {
|
|
1069
|
+
e.flushDrafts(), e.dirtyPaths().length !== 0 && (k.preventDefault(), k.returnValue = !0);
|
|
1012
1070
|
};
|
|
1013
|
-
return window.addEventListener("beforeunload",
|
|
1071
|
+
return window.addEventListener("beforeunload", E), () => window.removeEventListener("beforeunload", E);
|
|
1014
1072
|
}, [u, e]);
|
|
1015
|
-
const m = ee(e.subscribe, e.discardRequest,
|
|
1016
|
-
return /* @__PURE__ */
|
|
1073
|
+
const m = ee(e.subscribe, e.discardRequest, lo), f = a.state === "blocked", c = f ? o.current : m === null ? [] : m.paths, h = c.map((E) => se(E)).join(", "), g = c.length > 0 && c.every((E) => e.session(E)?.save.kind === "draft");
|
|
1074
|
+
return /* @__PURE__ */ d(
|
|
1017
1075
|
wn,
|
|
1018
1076
|
{
|
|
1019
1077
|
open: f || m !== null,
|
|
@@ -1023,15 +1081,15 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
|
|
|
1023
1081
|
cancelLabel: t.unsavedStay,
|
|
1024
1082
|
testId: "markdown-explorer-unsaved-guard",
|
|
1025
1083
|
onConfirm: () => {
|
|
1026
|
-
if (
|
|
1027
|
-
e.discard(o.current),
|
|
1084
|
+
if (a.state === "blocked") {
|
|
1085
|
+
e.discard(o.current), a.proceed();
|
|
1028
1086
|
return;
|
|
1029
1087
|
}
|
|
1030
1088
|
m?.settle(!0);
|
|
1031
1089
|
},
|
|
1032
1090
|
onCancel: () => {
|
|
1033
|
-
if (
|
|
1034
|
-
|
|
1091
|
+
if (a.state === "blocked") {
|
|
1092
|
+
a.reset();
|
|
1035
1093
|
return;
|
|
1036
1094
|
}
|
|
1037
1095
|
m?.settle(!1);
|
|
@@ -1062,14 +1120,14 @@ function co({
|
|
|
1062
1120
|
}
|
|
1063
1121
|
const uo = /* @__PURE__ */ y.forwardRef(co);
|
|
1064
1122
|
let Ge = null;
|
|
1065
|
-
const
|
|
1123
|
+
const Sn = () => (Ge ??= import("./EditSurface-D1yklbWu.js").catch((e) => {
|
|
1066
1124
|
throw Ge = null, e;
|
|
1067
1125
|
}), Ge), fo = () => {
|
|
1068
|
-
|
|
1126
|
+
Sn().catch(() => {
|
|
1069
1127
|
});
|
|
1070
1128
|
}, mo = (e) => {
|
|
1071
|
-
const { default: t } =
|
|
1072
|
-
return /* @__PURE__ */
|
|
1129
|
+
const { default: t } = re(Sn());
|
|
1130
|
+
return /* @__PURE__ */ d(t, { ...e });
|
|
1073
1131
|
};
|
|
1074
1132
|
class ho extends tn {
|
|
1075
1133
|
state = { failed: !1 };
|
|
@@ -1081,13 +1139,13 @@ class ho extends tn {
|
|
|
1081
1139
|
return this.state.failed ? this.props.fallback(this.retry) : this.props.children;
|
|
1082
1140
|
}
|
|
1083
1141
|
}
|
|
1084
|
-
const
|
|
1142
|
+
const lt = `[${sn}]`, po = "[data-aqmd-content]", vo = 'a[href], button, input, select, textarea, summary, label, [contenteditable], [role="menu"], iframe, video, audio, object, embed, svg, [data-aqmd-spreadsheet-editable], [data-aqmd-spreadsheet-fullscreen]', wo = 200, Re = (e) => Er(e.getAttribute(sn)), go = (e, t) => {
|
|
1085
1143
|
for (let r = e; r !== null && t.contains(r); r = r.parentElement) {
|
|
1086
1144
|
const o = Re(r);
|
|
1087
1145
|
if (o !== null) return { block: r, lines: o, own: !0 };
|
|
1088
1146
|
}
|
|
1089
1147
|
let n = null;
|
|
1090
|
-
for (const r of t.querySelectorAll(
|
|
1148
|
+
for (const r of t.querySelectorAll(lt)) {
|
|
1091
1149
|
if (!(r.compareDocumentPosition(e) & Node.DOCUMENT_POSITION_FOLLOWING)) break;
|
|
1092
1150
|
const o = Re(r);
|
|
1093
1151
|
o !== null && (n = { block: r, lines: o });
|
|
@@ -1097,7 +1155,7 @@ const at = `[${sn}]`, po = "[data-aqmd-content]", vo = 'a[href], button, input,
|
|
|
1097
1155
|
let n = 0;
|
|
1098
1156
|
for (let r = e.indexOf(t); r >= 0; r = e.indexOf(t, r + t.length)) n += 1;
|
|
1099
1157
|
return n;
|
|
1100
|
-
}, Eo = (e) => e.closest(po) !== null && e.closest(vo) === null,
|
|
1158
|
+
}, Eo = (e) => e.closest(po) !== null && e.closest(vo) === null, So = (e, t, n) => {
|
|
1101
1159
|
const r = go(e, t);
|
|
1102
1160
|
if (r === null) return null;
|
|
1103
1161
|
const { block: o, own: i } = r;
|
|
@@ -1105,22 +1163,22 @@ const at = `[${sn}]`, po = "[data-aqmd-content]", vo = 'a[href], button, input,
|
|
|
1105
1163
|
const u = r.lines.last + 1;
|
|
1106
1164
|
return { lines: { first: u, last: u }, word: null, occurrence: 0, clientTop: Ne(e) };
|
|
1107
1165
|
}
|
|
1108
|
-
const
|
|
1109
|
-
return
|
|
1110
|
-
},
|
|
1166
|
+
const a = To(o, n);
|
|
1167
|
+
return a === null ? { lines: r.lines, word: null, occurrence: 0, clientTop: Ne(o) } : { lines: r.lines, word: a.text, occurrence: a.occurrence, clientTop: a.clientTop };
|
|
1168
|
+
}, yo = (e, t) => {
|
|
1111
1169
|
let n = null, r = null, o = null;
|
|
1112
|
-
for (const
|
|
1113
|
-
const u = Re(
|
|
1170
|
+
for (const a of e.querySelectorAll(lt)) {
|
|
1171
|
+
const u = Re(a);
|
|
1114
1172
|
if (u === null) continue;
|
|
1115
|
-
n ??= ko(t,
|
|
1116
|
-
const { top: m, bottom: f } =
|
|
1117
|
-
m <= n && n < f ? r = { lines: u, block:
|
|
1173
|
+
n ??= ko(t, a);
|
|
1174
|
+
const { top: m, bottom: f } = a.getBoundingClientRect();
|
|
1175
|
+
m <= n && n < f ? r = { lines: u, block: a } : o === null && m >= n && (o = { lines: u, block: a });
|
|
1118
1176
|
}
|
|
1119
1177
|
const i = r === null ? o : r;
|
|
1120
1178
|
return i === null ? null : { lines: i.lines, word: null, occurrence: 0, clientTop: Ne(i.block) };
|
|
1121
|
-
},
|
|
1179
|
+
}, xo = (e) => e === e.ownerDocument.scrollingElement ? 0 : e.getBoundingClientRect().top + e.clientTop, ko = (e, t) => {
|
|
1122
1180
|
const n = Number.parseFloat(getComputedStyle(t).scrollMarginTop);
|
|
1123
|
-
return
|
|
1181
|
+
return xo(e) + (Number.isFinite(n) ? n : 0);
|
|
1124
1182
|
}, To = (e, t) => {
|
|
1125
1183
|
if (t === null || t.rangeCount === 0) return null;
|
|
1126
1184
|
const n = t.getRangeAt(0);
|
|
@@ -1129,33 +1187,33 @@ const at = `[${sn}]`, po = "[data-aqmd-content]", vo = 'a[href], button, input,
|
|
|
1129
1187
|
if (r === "" || r.length > wo || /[\r\n]/u.test(r)) return null;
|
|
1130
1188
|
const o = e.ownerDocument.createRange();
|
|
1131
1189
|
return o.setStart(e, 0), o.setEnd(n.startContainer, n.startOffset), { text: r, occurrence: bo(o.toString(), r), clientTop: n.getBoundingClientRect().top };
|
|
1132
|
-
},
|
|
1190
|
+
}, Xl = (e, t) => {
|
|
1133
1191
|
const n = e.split(`
|
|
1134
1192
|
`), r = Math.min(t.lines.first, n.length), o = Math.min(t.lines.last, n.length), i = { line: r, column: 0 };
|
|
1135
1193
|
if (t.word === null) return i;
|
|
1136
|
-
let
|
|
1194
|
+
let a = 0;
|
|
1137
1195
|
for (let u = r; u <= o; u += 1) {
|
|
1138
1196
|
const m = n[u - 1] ?? "";
|
|
1139
1197
|
for (let f = m.indexOf(t.word); f >= 0; f = m.indexOf(t.word, f + t.word.length)) {
|
|
1140
|
-
if (
|
|
1141
|
-
|
|
1198
|
+
if (a === t.occurrence) return { line: u, column: f };
|
|
1199
|
+
a += 1;
|
|
1142
1200
|
}
|
|
1143
1201
|
}
|
|
1144
|
-
return
|
|
1202
|
+
return a > 0 ? Ro(n, r, o, t.word) ?? i : i;
|
|
1145
1203
|
}, Ro = (e, t, n, r) => {
|
|
1146
1204
|
for (let o = n; o >= t; o -= 1) {
|
|
1147
1205
|
const i = (e[o - 1] ?? "").lastIndexOf(r);
|
|
1148
1206
|
if (i >= 0) return { line: o, column: i };
|
|
1149
1207
|
}
|
|
1150
1208
|
return null;
|
|
1151
|
-
},
|
|
1209
|
+
}, Oo = (e, t) => {
|
|
1152
1210
|
let n = null, r = null;
|
|
1153
|
-
for (const o of e.querySelectorAll(
|
|
1211
|
+
for (const o of e.querySelectorAll(lt)) {
|
|
1154
1212
|
const i = Re(o);
|
|
1155
1213
|
i === null || i.first > t || (i.last >= t ? n = o : (r === null || i.last >= r.last) && (r = { element: o, last: i.last }));
|
|
1156
1214
|
}
|
|
1157
1215
|
return n !== null ? n : r === null ? null : r.element;
|
|
1158
|
-
},
|
|
1216
|
+
}, Co = (e, t) => {
|
|
1159
1217
|
const { bottom: n } = e.getBoundingClientRect(), r = Ne(e), o = Re(e);
|
|
1160
1218
|
if (o === null) return r;
|
|
1161
1219
|
const i = Math.min(Math.max(t - o.first, 0) / (o.last - o.first + 1), 1);
|
|
@@ -1167,8 +1225,8 @@ const at = `[${sn}]`, po = "[data-aqmd-content]", vo = 'a[href], button, input,
|
|
|
1167
1225
|
if (o < 0) continue;
|
|
1168
1226
|
const i = e.ownerDocument.createRange();
|
|
1169
1227
|
i.setStart(n, o), i.setEnd(n, o + 1);
|
|
1170
|
-
const { top:
|
|
1171
|
-
if (u > 0) return
|
|
1228
|
+
const { top: a, height: u } = i.getBoundingClientRect();
|
|
1229
|
+
if (u > 0) return a;
|
|
1172
1230
|
}
|
|
1173
1231
|
return e.getBoundingClientRect().top;
|
|
1174
1232
|
}, st = Object.freeze({
|
|
@@ -1176,7 +1234,7 @@ const at = `[${sn}]`, po = "[data-aqmd-content]", vo = 'a[href], button, input,
|
|
|
1176
1234
|
"switch-source": Object.freeze({ replace: !1, preventScrollReset: !0, defaultShouldRevalidate: !1 }),
|
|
1177
1235
|
"switch-view": Object.freeze({ replace: !1, preventScrollReset: !1, defaultShouldRevalidate: !1 }),
|
|
1178
1236
|
"follow-link": Object.freeze({ replace: !1, preventScrollReset: !1, defaultShouldRevalidate: !1 })
|
|
1179
|
-
}),
|
|
1237
|
+
}), Yl = (e) => st[e], $e = () => {
|
|
1180
1238
|
const e = jn();
|
|
1181
1239
|
return P(
|
|
1182
1240
|
(t, n) => {
|
|
@@ -1184,7 +1242,7 @@ const at = `[${sn}]`, po = "[data-aqmd-content]", vo = 'a[href], button, input,
|
|
|
1184
1242
|
},
|
|
1185
1243
|
[e]
|
|
1186
1244
|
);
|
|
1187
|
-
},
|
|
1245
|
+
}, Mo = ({ navigation: e, ...t }) => /* @__PURE__ */ d(Hn, { ...t, ...st[e] }), yn = (e) => {
|
|
1188
1246
|
const t = e.ownerDocument;
|
|
1189
1247
|
if (e.focus({ preventScroll: !0 }), t.activeElement === e) return !0;
|
|
1190
1248
|
if (e.hasAttribute("tabindex")) return !1;
|
|
@@ -1194,17 +1252,17 @@ const at = `[${sn}]`, po = "[data-aqmd-content]", vo = 'a[href], button, input,
|
|
|
1194
1252
|
t.activeElement !== e && (e.removeAttribute("tabindex"), e.removeEventListener("blur", n));
|
|
1195
1253
|
};
|
|
1196
1254
|
return e.addEventListener("blur", n), !0;
|
|
1197
|
-
},
|
|
1255
|
+
}, Ao = (e, t) => {
|
|
1198
1256
|
const n = _(null), r = _(null), o = _(null), i = P(() => {
|
|
1199
1257
|
n.current !== null && window.clearTimeout(n.current), n.current = null, r.current = null;
|
|
1200
1258
|
}, []);
|
|
1201
1259
|
te(() => i, [i]);
|
|
1202
|
-
const
|
|
1260
|
+
const a = P(
|
|
1203
1261
|
(f) => {
|
|
1204
1262
|
if (r.current !== f) return;
|
|
1205
|
-
const
|
|
1206
|
-
if (
|
|
1207
|
-
|
|
1263
|
+
const c = o.current;
|
|
1264
|
+
if (c !== null) {
|
|
1265
|
+
c.then(() => a(f));
|
|
1208
1266
|
return;
|
|
1209
1267
|
}
|
|
1210
1268
|
e.prefetch(f);
|
|
@@ -1218,19 +1276,19 @@ const at = `[${sn}]`, po = "[data-aqmd-content]", vo = 'a[href], button, input,
|
|
|
1218
1276
|
[e]
|
|
1219
1277
|
), u = P(
|
|
1220
1278
|
(f) => {
|
|
1221
|
-
const
|
|
1222
|
-
|
|
1223
|
-
n.current = null,
|
|
1279
|
+
const c = t(f);
|
|
1280
|
+
c !== r.current && (i(), c !== null && (r.current = c, n.current = window.setTimeout(() => {
|
|
1281
|
+
n.current = null, a(c);
|
|
1224
1282
|
}, Wn)));
|
|
1225
1283
|
},
|
|
1226
|
-
[i, t,
|
|
1284
|
+
[i, t, a]
|
|
1227
1285
|
), m = P(
|
|
1228
1286
|
(f) => {
|
|
1229
1287
|
t(f) !== r.current && i();
|
|
1230
1288
|
},
|
|
1231
1289
|
[i, t]
|
|
1232
1290
|
);
|
|
1233
|
-
return
|
|
1291
|
+
return U(
|
|
1234
1292
|
() => ({
|
|
1235
1293
|
onPointerOver: (f) => u(f.target),
|
|
1236
1294
|
onPointerOut: (f) => m(f.relatedTarget),
|
|
@@ -1239,7 +1297,7 @@ const at = `[${sn}]`, po = "[data-aqmd-content]", vo = 'a[href], button, input,
|
|
|
1239
1297
|
}),
|
|
1240
1298
|
[u, m]
|
|
1241
1299
|
);
|
|
1242
|
-
},
|
|
1300
|
+
}, Lo = it(() => import("./NativeScrollBar-CcNqDlO6.js").then((e) => ({ default: e.NativeScrollBar })));
|
|
1243
1301
|
class No extends tn {
|
|
1244
1302
|
state = { failed: !1 };
|
|
1245
1303
|
static getDerivedStateFromError() {
|
|
@@ -1252,7 +1310,7 @@ class No extends tn {
|
|
|
1252
1310
|
return this.state.failed ? null : this.props.children;
|
|
1253
1311
|
}
|
|
1254
1312
|
}
|
|
1255
|
-
const Do = ({ scroller: e, withCircle: t }) => /* @__PURE__ */
|
|
1313
|
+
const Do = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ d(No, { children: /* @__PURE__ */ d(ke, { fallback: null, children: /* @__PURE__ */ d(Lo, { scroller: e, withCircle: t }) }) }), xn = (e) => /* @__PURE__ */ d(Do, { scroller: e, withCircle: !0 }), kn = () => {
|
|
1256
1314
|
const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Set();
|
|
1257
1315
|
let n = !1;
|
|
1258
1316
|
const r = (o) => {
|
|
@@ -1267,9 +1325,9 @@ const Do = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ c(No, { children:
|
|
|
1267
1325
|
return () => {
|
|
1268
1326
|
if (i) return;
|
|
1269
1327
|
i = !0;
|
|
1270
|
-
const
|
|
1271
|
-
if (
|
|
1272
|
-
e.set(o,
|
|
1328
|
+
const a = e.get(o);
|
|
1329
|
+
if (a !== void 0 && a > 1) {
|
|
1330
|
+
e.set(o, a - 1);
|
|
1273
1331
|
return;
|
|
1274
1332
|
}
|
|
1275
1333
|
e.delete(o), r(o);
|
|
@@ -1283,129 +1341,129 @@ const Do = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ c(No, { children:
|
|
|
1283
1341
|
if (Object.is(e, t)) return !0;
|
|
1284
1342
|
if (typeof e != "object" || typeof t != "object" || e === null || t === null) return !1;
|
|
1285
1343
|
if (Array.isArray(e) || Array.isArray(t))
|
|
1286
|
-
return !(Array.isArray(e) && Array.isArray(t)) || e.length !== t.length ? !1 : e.every((i,
|
|
1344
|
+
return !(Array.isArray(e) && Array.isArray(t)) || e.length !== t.length ? !1 : e.every((i, a) => De(i, t[a]));
|
|
1287
1345
|
const n = e, r = t, o = Object.keys(n);
|
|
1288
1346
|
return o.length !== Object.keys(r).length ? !1 : o.every((i) => Object.hasOwn(r, i) && De(n[i], r[i]));
|
|
1289
|
-
}, Po = 55e3, Nt = Object.freeze({ status: "deferred" }), Dt = Object.freeze({ status: "refreshed" }), We = Object.freeze({ status: "superseded" }), ue = (e) => e === void 0 || e.status === "deferred" ? null : e.status === "loaded" ? e : e.previous, Tn = (e) => e !== void 0 && e.status === "loaded" && e.document.kind !== "failure",
|
|
1347
|
+
}, Po = 55e3, Nt = Object.freeze({ status: "deferred" }), Dt = Object.freeze({ status: "refreshed" }), We = Object.freeze({ status: "superseded" }), ue = (e) => e === void 0 || e.status === "deferred" ? null : e.status === "loaded" ? e : e.previous, Tn = (e) => e !== void 0 && e.status === "loaded" && e.document.kind !== "failure", Fo = ({ client: e, capacity: t }) => {
|
|
1290
1348
|
if (!Number.isInteger(t) || t < 1) throw new RangeError(`[markdown-explorer] the document cache capacity must be a positive integer; got ${String(t)}`);
|
|
1291
|
-
const n = /* @__PURE__ */ new Map(), r = kn(), o =
|
|
1292
|
-
let
|
|
1293
|
-
const u = o.emit, m = () => (
|
|
1349
|
+
const n = /* @__PURE__ */ new Map(), r = kn(), o = Oe(), i = /* @__PURE__ */ new WeakSet();
|
|
1350
|
+
let a = 0;
|
|
1351
|
+
const u = o.emit, m = () => (a += 1, a), f = () => {
|
|
1294
1352
|
if (!(n.size <= t))
|
|
1295
|
-
for (const
|
|
1353
|
+
for (const b of [...n.keys()]) {
|
|
1296
1354
|
if (n.size <= t) return;
|
|
1297
|
-
r.isHeld(
|
|
1355
|
+
r.isHeld(b) || n.delete(b);
|
|
1298
1356
|
}
|
|
1299
|
-
},
|
|
1300
|
-
n.delete(
|
|
1301
|
-
}, h = (
|
|
1302
|
-
const s = n.get(
|
|
1303
|
-
return
|
|
1304
|
-
n.get(
|
|
1357
|
+
}, c = (b, w) => {
|
|
1358
|
+
n.delete(b), n.set(b, w);
|
|
1359
|
+
}, h = (b) => performance.now() - b.validatedAt >= Po, g = (b, w, l) => {
|
|
1360
|
+
const s = n.get(b), v = ue(s?.snapshot), O = l || s?.refreshPending === !0, M = Te(e.document(b, { refresh: O }).then((q) => ({ status: "loaded", document: q }))), N = { snapshot: { status: "pending", promise: M, previous: v }, validatedAt: performance.now(), opened: w, background: null, refreshPending: !1, seeded: void 0, stamp: m() };
|
|
1361
|
+
return c(b, N), f(), M.then((q) => {
|
|
1362
|
+
n.get(b) === N && (N.snapshot = q, N.stamp = m(), u());
|
|
1305
1363
|
}), N;
|
|
1306
|
-
},
|
|
1307
|
-
|
|
1308
|
-
},
|
|
1309
|
-
const
|
|
1310
|
-
if (
|
|
1364
|
+
}, E = (b, w, l, s, v, O) => {
|
|
1365
|
+
w.background === l && (w.background = null, !(n.get(b) !== w || w.snapshot !== s) && (v.kind === "failure" && s.document.kind !== "failure" || (w.validatedAt = O, w.stamp = m(), De(s.document, v) || (w.snapshot = { status: "loaded", document: v }), u())));
|
|
1366
|
+
}, k = async (b, w) => {
|
|
1367
|
+
const l = w.snapshot;
|
|
1368
|
+
if (l.status !== "loaded") return null;
|
|
1311
1369
|
const s = {};
|
|
1312
|
-
|
|
1313
|
-
const
|
|
1314
|
-
|
|
1315
|
-
const
|
|
1316
|
-
return b
|
|
1317
|
-
}, R = (
|
|
1318
|
-
const { snapshot:
|
|
1319
|
-
return
|
|
1320
|
-
},
|
|
1321
|
-
const
|
|
1322
|
-
let
|
|
1370
|
+
w.background = s;
|
|
1371
|
+
const v = performance.now(), O = e.document(b, { refresh: w.refreshPending });
|
|
1372
|
+
w.refreshPending = !1;
|
|
1373
|
+
const M = await O, N = w.background === s && n.get(b) === w && w.snapshot === l;
|
|
1374
|
+
return E(b, w, s, l, M, v), N ? M : null;
|
|
1375
|
+
}, R = (b, w) => {
|
|
1376
|
+
const { snapshot: l } = w;
|
|
1377
|
+
return l.status === "pending" ? !1 : l.status === "loaded" && l.document.kind !== "failure" ? (k(b, w), !1) : (l.status === "loaded" && i.add(l), g(b, !0, !1), !0);
|
|
1378
|
+
}, T = (b) => {
|
|
1379
|
+
const w = r.hold(b);
|
|
1380
|
+
let l = !1;
|
|
1323
1381
|
return () => {
|
|
1324
|
-
if (
|
|
1325
|
-
|
|
1326
|
-
const s = n.get(
|
|
1327
|
-
s !== void 0 &&
|
|
1382
|
+
if (l) return;
|
|
1383
|
+
l = !0, w();
|
|
1384
|
+
const s = n.get(b);
|
|
1385
|
+
s !== void 0 && c(b, s), f();
|
|
1328
1386
|
};
|
|
1329
1387
|
};
|
|
1330
1388
|
return {
|
|
1331
|
-
peek: (
|
|
1332
|
-
peekSeeded: (
|
|
1333
|
-
answerStampOf: (
|
|
1334
|
-
prefetch: (
|
|
1335
|
-
const
|
|
1336
|
-
|
|
1389
|
+
peek: (b) => n.get(b)?.snapshot,
|
|
1390
|
+
peekSeeded: (b) => n.get(b)?.seeded,
|
|
1391
|
+
answerStampOf: (b) => n.get(b)?.stamp,
|
|
1392
|
+
prefetch: (b) => {
|
|
1393
|
+
const w = n.get(b);
|
|
1394
|
+
w !== void 0 && w.snapshot.status !== "deferred" || (g(b, !1, !1), u());
|
|
1337
1395
|
},
|
|
1338
|
-
open: (
|
|
1339
|
-
const
|
|
1396
|
+
open: (b) => {
|
|
1397
|
+
const w = r.resumes(b), l = T(b), s = n.get(b);
|
|
1340
1398
|
if (s === void 0 || s.snapshot.status === "deferred")
|
|
1341
|
-
return g(
|
|
1342
|
-
if (
|
|
1343
|
-
const { snapshot:
|
|
1344
|
-
return
|
|
1399
|
+
return g(b, !0, !1), u(), l;
|
|
1400
|
+
if (c(b, s), w) return l;
|
|
1401
|
+
const { snapshot: v } = s;
|
|
1402
|
+
return v.status === "pending" ? (s.opened = !0, l) : v.document.kind === "failure" ? (s.opened || h(s) ? (i.add(v), g(b, !0, !1), u()) : s.opened = !0, l) : (s.opened = !0, s.background === null && h(s) && k(b, s), l);
|
|
1345
1403
|
},
|
|
1346
|
-
retain:
|
|
1347
|
-
retry: (
|
|
1348
|
-
const
|
|
1349
|
-
|
|
1404
|
+
retain: T,
|
|
1405
|
+
retry: (b) => {
|
|
1406
|
+
const w = n.get(b);
|
|
1407
|
+
w === void 0 || w.snapshot.status !== "loaded" || w.snapshot.document.kind !== "failure" || (g(b, !0, !1), u());
|
|
1350
1408
|
},
|
|
1351
|
-
seed: (
|
|
1352
|
-
const
|
|
1353
|
-
|
|
1409
|
+
seed: (b, w) => {
|
|
1410
|
+
const l = performance.now(), s = Te(
|
|
1411
|
+
w.then(
|
|
1354
1412
|
(q) => q === null ? Nt : { status: "loaded", document: q },
|
|
1355
1413
|
() => Nt
|
|
1356
1414
|
)
|
|
1357
|
-
),
|
|
1358
|
-
if (
|
|
1359
|
-
const q =
|
|
1360
|
-
|
|
1361
|
-
if (
|
|
1362
|
-
b
|
|
1415
|
+
), v = n.get(b);
|
|
1416
|
+
if (v !== void 0 && v.snapshot.status === "loaded") {
|
|
1417
|
+
const q = v.snapshot, W = {};
|
|
1418
|
+
v.background = W, s.then((G) => {
|
|
1419
|
+
if (G.status === "loaded") {
|
|
1420
|
+
E(b, v, W, q, G.document, l);
|
|
1363
1421
|
return;
|
|
1364
1422
|
}
|
|
1365
|
-
|
|
1423
|
+
v.background === W && (v.background = null);
|
|
1366
1424
|
});
|
|
1367
1425
|
return;
|
|
1368
1426
|
}
|
|
1369
|
-
const
|
|
1370
|
-
|
|
1371
|
-
n.get(
|
|
1427
|
+
const O = v !== void 0 && v.snapshot.status === "pending" ? v.snapshot.previous : null, M = { status: "pending", promise: s, previous: O }, N = { snapshot: M, validatedAt: l, opened: v?.opened === !0, background: null, refreshPending: v?.refreshPending === !0, seeded: M, stamp: m() };
|
|
1428
|
+
c(b, N), f(), s.then((q) => {
|
|
1429
|
+
n.get(b) === N && (q.status === "deferred" && r.isHeld(b) ? g(b, N.opened, !1) : (N.snapshot = q, N.stamp = m()), u());
|
|
1372
1430
|
});
|
|
1373
1431
|
},
|
|
1374
1432
|
invalidate: () => {
|
|
1375
|
-
let
|
|
1376
|
-
for (const [
|
|
1377
|
-
if (
|
|
1378
|
-
const { snapshot: s } =
|
|
1433
|
+
let b = !1;
|
|
1434
|
+
for (const [w, l] of [...n]) {
|
|
1435
|
+
if (l.validatedAt = Number.NEGATIVE_INFINITY, l.opened = !0, l.refreshPending = !0, !r.isHeld(w)) continue;
|
|
1436
|
+
const { snapshot: s } = l;
|
|
1379
1437
|
if (s.status !== "pending") {
|
|
1380
|
-
R(
|
|
1438
|
+
R(w, l) && (b = !0);
|
|
1381
1439
|
continue;
|
|
1382
1440
|
}
|
|
1383
1441
|
s.promise.then(() => {
|
|
1384
|
-
n.get(
|
|
1442
|
+
n.get(w) === l && l.refreshPending && r.isHeld(w) && R(w, l) && u();
|
|
1385
1443
|
});
|
|
1386
1444
|
}
|
|
1387
|
-
|
|
1445
|
+
b && u();
|
|
1388
1446
|
},
|
|
1389
|
-
refresh: async (
|
|
1390
|
-
const
|
|
1391
|
-
if (
|
|
1392
|
-
|
|
1393
|
-
const s = await
|
|
1447
|
+
refresh: async (b) => {
|
|
1448
|
+
const w = n.get(b);
|
|
1449
|
+
if (w !== void 0 && Tn(w.snapshot)) {
|
|
1450
|
+
w.refreshPending = !0;
|
|
1451
|
+
const s = await k(b, w);
|
|
1394
1452
|
return s === null ? We : s.kind === "failure" ? { status: "failed", failure: s.failure } : Dt;
|
|
1395
1453
|
}
|
|
1396
|
-
const
|
|
1397
|
-
return u(),
|
|
1454
|
+
const l = g(b, !0, !0);
|
|
1455
|
+
return u(), l.snapshot.status !== "pending" ? We : (await l.snapshot.promise, n.get(b) === l ? Dt : We);
|
|
1398
1456
|
},
|
|
1399
1457
|
clear: () => {
|
|
1400
1458
|
n.clear();
|
|
1401
|
-
for (const
|
|
1459
|
+
for (const b of r.heldKeys()) g(b, !0, !1);
|
|
1402
1460
|
u();
|
|
1403
1461
|
},
|
|
1404
1462
|
subscribe: o.subscribe,
|
|
1405
|
-
noteFailureShown: (
|
|
1463
|
+
noteFailureShown: (b) => i.has(b) ? !1 : (i.add(b), !0)
|
|
1406
1464
|
};
|
|
1407
1465
|
};
|
|
1408
|
-
function
|
|
1466
|
+
function $o({
|
|
1409
1467
|
title: e,
|
|
1410
1468
|
titleId: t,
|
|
1411
1469
|
...n
|
|
@@ -1430,7 +1488,7 @@ function Fo({
|
|
|
1430
1488
|
clipRule: "evenodd"
|
|
1431
1489
|
}));
|
|
1432
1490
|
}
|
|
1433
|
-
const qo = /* @__PURE__ */ y.forwardRef(
|
|
1491
|
+
const qo = /* @__PURE__ */ y.forwardRef($o);
|
|
1434
1492
|
function _o({
|
|
1435
1493
|
title: e,
|
|
1436
1494
|
titleId: t,
|
|
@@ -1480,7 +1538,7 @@ const zo = /* @__PURE__ */ y.forwardRef(Bo), jo = 2e3, Pt = Object.freeze({ outc
|
|
|
1480
1538
|
const t = navigator.clipboard;
|
|
1481
1539
|
return t === void 0 ? Promise.reject(new Error("[markdown-explorer] this browser has no asynchronous clipboard")) : t.writeText(e);
|
|
1482
1540
|
}, Vo = ({ text: e }) => {
|
|
1483
|
-
const { announcer: t, labels: n } = D(), [r, o] =
|
|
1541
|
+
const { announcer: t, labels: n } = D(), [r, o] = z(Pt);
|
|
1484
1542
|
te(() => {
|
|
1485
1543
|
if (r.outcome === "idle") return;
|
|
1486
1544
|
const m = setTimeout(() => o(Pt), jo);
|
|
@@ -1488,17 +1546,17 @@ const zo = /* @__PURE__ */ y.forwardRef(Bo), jo = 2e3, Pt = Object.freeze({ outc
|
|
|
1488
1546
|
}, [r]);
|
|
1489
1547
|
const i = (m) => {
|
|
1490
1548
|
o({ outcome: m }), t.announce(m === "copied" ? n.copiedText : n.copyTextFailed);
|
|
1491
|
-
},
|
|
1549
|
+
}, a = () => {
|
|
1492
1550
|
Ho(e).then(
|
|
1493
1551
|
() => i("copied"),
|
|
1494
1552
|
() => i("failed")
|
|
1495
1553
|
);
|
|
1496
1554
|
}, u = r.outcome === "copied" ? n.copiedText : r.outcome === "failed" ? n.copyTextFailed : n.copyText;
|
|
1497
1555
|
return (
|
|
1498
|
-
/* @__PURE__ */
|
|
1556
|
+
/* @__PURE__ */ d("button", { type: "button", className: "aqmx-icon-button", "aria-label": n.copyText, title: u, onClick: a, "data-aqmx-copy-outcome": r.outcome, "data-testid": "markdown-explorer-file-copy", children: r.outcome === "copied" ? /* @__PURE__ */ d(qo, {}) : r.outcome === "failed" ? /* @__PURE__ */ d(zo, {}) : /* @__PURE__ */ d(Io, {}) })
|
|
1499
1557
|
);
|
|
1500
|
-
}, he = pe("fill"),
|
|
1501
|
-
function
|
|
1558
|
+
}, he = pe("fill"), Zo = Object.freeze({ blockSize: "100%" }), ve = ({ scrollerProps: e, children: t }) => re(he) === "content" ? /* @__PURE__ */ d(xt, { scrollerProps: e, children: t }) : /* @__PURE__ */ d(xt, { scrollerProps: { ...e, style: Zo }, rowClassName: "aqmx-document-scroll-row", renderScrollBar: xn, children: t });
|
|
1559
|
+
function Uo({
|
|
1502
1560
|
title: e,
|
|
1503
1561
|
titleId: t,
|
|
1504
1562
|
...n
|
|
@@ -1519,7 +1577,7 @@ function Zo({
|
|
|
1519
1577
|
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"
|
|
1520
1578
|
}));
|
|
1521
1579
|
}
|
|
1522
|
-
const Go = /* @__PURE__ */ y.forwardRef(
|
|
1580
|
+
const Go = /* @__PURE__ */ y.forwardRef(Uo);
|
|
1523
1581
|
function Wo({
|
|
1524
1582
|
title: e,
|
|
1525
1583
|
titleId: t,
|
|
@@ -1547,12 +1605,12 @@ function Wo({
|
|
|
1547
1605
|
}
|
|
1548
1606
|
const Ko = /* @__PURE__ */ y.forwardRef(Wo), qe = ({ name: e, openUrl: t, downloadUrl: n, icon: r, children: o }) => {
|
|
1549
1607
|
const { labels: i } = D();
|
|
1550
|
-
return /* @__PURE__ */
|
|
1551
|
-
/* @__PURE__ */
|
|
1552
|
-
/* @__PURE__ */
|
|
1608
|
+
return /* @__PURE__ */ $("div", { className: "aqmx-document-toolbar", children: [
|
|
1609
|
+
/* @__PURE__ */ d("span", { className: "aqmx-document-file-icon", "aria-hidden": "true", children: r }),
|
|
1610
|
+
/* @__PURE__ */ d("span", { className: "aqmx-document-title", title: e, "data-testid": "markdown-explorer-file-name", children: e }),
|
|
1553
1611
|
o,
|
|
1554
|
-
/* @__PURE__ */
|
|
1555
|
-
/* @__PURE__ */
|
|
1612
|
+
/* @__PURE__ */ d("a", { className: "aqmx-icon-button", href: t, target: "_blank", rel: "noopener noreferrer", "aria-label": i.openInNewTab, title: i.openInNewTab, "data-testid": "markdown-explorer-file-open", children: /* @__PURE__ */ d(Ko, {}) }),
|
|
1613
|
+
/* @__PURE__ */ d("a", { className: "aqmx-icon-button", href: n, download: e, "aria-label": i.download, title: i.download, "data-testid": "markdown-explorer-file-download", children: /* @__PURE__ */ d(Go, {}) })
|
|
1556
1614
|
] });
|
|
1557
1615
|
};
|
|
1558
1616
|
function Xo({
|
|
@@ -1578,43 +1636,43 @@ function Xo({
|
|
|
1578
1636
|
}
|
|
1579
1637
|
const Yo = /* @__PURE__ */ y.forwardRef(Xo), Jo = Object.freeze({ className: "aqmx-document-stage" }), Qo = ({ document: e }) => {
|
|
1580
1638
|
const { labels: t } = D();
|
|
1581
|
-
return /* @__PURE__ */
|
|
1582
|
-
/* @__PURE__ */
|
|
1583
|
-
/* @__PURE__ */
|
|
1584
|
-
/* @__PURE__ */
|
|
1585
|
-
/* @__PURE__ */
|
|
1639
|
+
return /* @__PURE__ */ $("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-file-view", children: [
|
|
1640
|
+
/* @__PURE__ */ d(qe, { name: e.name, openUrl: e.url, downloadUrl: e.url, icon: /* @__PURE__ */ d(Yo, {}) }),
|
|
1641
|
+
/* @__PURE__ */ d(ve, { scrollerProps: Jo, children: /* @__PURE__ */ $("div", { className: "aqmx-callout", role: "note", "data-testid": "markdown-explorer-file-not-shown", children: [
|
|
1642
|
+
/* @__PURE__ */ d("p", { className: "aqmx-callout-body", children: t.fileNotShown }),
|
|
1643
|
+
/* @__PURE__ */ d("a", { className: "aqmx-callout-action", href: e.url, download: e.name, "data-testid": "markdown-explorer-file-not-shown-download", children: t.download })
|
|
1586
1644
|
] }) })
|
|
1587
1645
|
] });
|
|
1588
1646
|
}, _e = "[data-aqmd-scroll-container], [data-aqmx-document-scroller]", ei = (e) => {
|
|
1589
1647
|
const t = e.indexOf("#");
|
|
1590
1648
|
return t === -1 ? "" : e.slice(t);
|
|
1591
|
-
}, ti = /(%[0-9A-Fa-f]{2})/u,
|
|
1649
|
+
}, ti = /(%[0-9A-Fa-f]{2})/u, dt = (e) => {
|
|
1592
1650
|
if (!e.startsWith("#") || e.length === 1) return null;
|
|
1593
1651
|
const t = new TextEncoder(), n = e.slice(1).split(ti).flatMap((r, o) => o % 2 === 1 ? [Number.parseInt(r.slice(1), 16)] : [...t.encode(r)]);
|
|
1594
1652
|
return new TextDecoder("utf-8", { ignoreBOM: !0 }).decode(Uint8Array.from(n));
|
|
1595
1653
|
}, Rn = (e) => `#${encodeURIComponent(e)}`, ni = (e) => {
|
|
1596
1654
|
if (e === "#") return !0;
|
|
1597
|
-
const t =
|
|
1655
|
+
const t = dt(e);
|
|
1598
1656
|
return t !== null && t.replace(/[A-Z]/gu, (n) => n.toLowerCase()) === "top";
|
|
1599
|
-
},
|
|
1657
|
+
}, On = (e, t) => {
|
|
1600
1658
|
if (t === "") return null;
|
|
1601
1659
|
for (const n of e.querySelectorAll("[id]"))
|
|
1602
1660
|
if (n.id === t) return n;
|
|
1603
1661
|
return null;
|
|
1604
|
-
}, ri = "http://www.w3.org/1999/xhtml",
|
|
1662
|
+
}, ri = "http://www.w3.org/1999/xhtml", Ft = (e, t) => {
|
|
1605
1663
|
if (t === "") return null;
|
|
1606
|
-
const n =
|
|
1664
|
+
const n = On(e, t);
|
|
1607
1665
|
if (n !== null) return n;
|
|
1608
1666
|
for (const r of e.querySelectorAll("a[name]"))
|
|
1609
1667
|
if (r.localName === "a" && r.namespaceURI === ri && r.getAttribute("name") === t) return r;
|
|
1610
1668
|
return null;
|
|
1611
|
-
},
|
|
1669
|
+
}, Cn = (e, t) => {
|
|
1612
1670
|
if (e === null || !t.startsWith("#")) return null;
|
|
1613
|
-
const n =
|
|
1671
|
+
const n = Ft(e, t.slice(1));
|
|
1614
1672
|
if (n !== null) return n;
|
|
1615
|
-
const r =
|
|
1616
|
-
return r === null ? null :
|
|
1617
|
-
},
|
|
1673
|
+
const r = dt(t);
|
|
1674
|
+
return r === null ? null : Ft(e, r);
|
|
1675
|
+
}, $t = (e) => {
|
|
1618
1676
|
const { body: t, documentElement: n } = e.ownerDocument;
|
|
1619
1677
|
if (e === t) {
|
|
1620
1678
|
const o = getComputedStyle(n);
|
|
@@ -1627,17 +1685,17 @@ const Yo = /* @__PURE__ */ y.forwardRef(Xo), Jo = Object.freeze({ className: "aq
|
|
|
1627
1685
|
return o !== "hidden" && o !== "clip";
|
|
1628
1686
|
}, ii = (e, t) => {
|
|
1629
1687
|
const n = t.closest(_e), r = n !== null && e.contains(n) ? n : e;
|
|
1630
|
-
if (r.scrollHeight > r.clientHeight &&
|
|
1631
|
-
const o = e.getBoundingClientRect().height, { documentElement: i, scrollingElement:
|
|
1688
|
+
if (r.scrollHeight > r.clientHeight && $t(r)) return r;
|
|
1689
|
+
const o = e.getBoundingClientRect().height, { documentElement: i, scrollingElement: a } = e.ownerDocument;
|
|
1632
1690
|
for (let u = e.parentElement; u !== null && u !== i; u = u.parentElement)
|
|
1633
|
-
if (
|
|
1634
|
-
return
|
|
1635
|
-
},
|
|
1691
|
+
if ($t(u) && u.scrollHeight > u.clientHeight && u.clientHeight < o) return u;
|
|
1692
|
+
return a instanceof Element && oi(e.ownerDocument) && a.scrollHeight > a.clientHeight && a.clientHeight < o ? a : r;
|
|
1693
|
+
}, ai = Object.freeze({
|
|
1636
1694
|
scrollerOf: ii,
|
|
1637
1695
|
reveal: (e) => {
|
|
1638
1696
|
e.scrollIntoView(tt);
|
|
1639
1697
|
}
|
|
1640
|
-
}), tt = Object.freeze({ block: "nearest", inline: "nearest", behavior: "instant" }),
|
|
1698
|
+
}), tt = Object.freeze({ block: "nearest", inline: "nearest", behavior: "instant" }), li = (e, t) => {
|
|
1641
1699
|
for (let n = t; n !== null && n !== e; n = n.parentElement) {
|
|
1642
1700
|
const r = n.parentElement;
|
|
1643
1701
|
if (r instanceof HTMLDetailsElement && n !== r.querySelector(":scope > summary") && (r.open = !0), n.getAttribute("hidden")?.toLowerCase() === "until-found") {
|
|
@@ -1647,21 +1705,21 @@ const Yo = /* @__PURE__ */ y.forwardRef(Xo), Jo = Object.freeze({ className: "aq
|
|
|
1647
1705
|
}
|
|
1648
1706
|
}, si = (e, t) => {
|
|
1649
1707
|
if (t.getClientRects().length === 0) return;
|
|
1650
|
-
const n = e === e.ownerDocument.scrollingElement ? 0 : e.getBoundingClientRect().top + e.clientTop, { scrollMarginTop: r, scrollMarginBottom: o } = getComputedStyle(t), i = Number.parseFloat(r),
|
|
1651
|
-
if (!u && Math.abs(
|
|
1708
|
+
const n = e === e.ownerDocument.scrollingElement ? 0 : e.getBoundingClientRect().top + e.clientTop, { scrollMarginTop: r, scrollMarginBottom: o } = getComputedStyle(t), i = Number.parseFloat(r), a = t.getBoundingClientRect(), u = a.height + i + Number.parseFloat(o) > e.clientHeight;
|
|
1709
|
+
if (!u && Math.abs(a.top - i - n) < 1) {
|
|
1652
1710
|
t.scrollIntoView(tt);
|
|
1653
1711
|
return;
|
|
1654
1712
|
}
|
|
1655
|
-
e.scrollBy({ top: u ?
|
|
1656
|
-
},
|
|
1713
|
+
e.scrollBy({ top: u ? a.top - n - e.clientHeight : a.bottom - n + e.clientHeight, behavior: "instant" }), t.scrollIntoView(tt);
|
|
1714
|
+
}, di = (e, t) => {
|
|
1657
1715
|
const n = t.scrollerOf(e, e.querySelector(_e) ?? e);
|
|
1658
1716
|
n.getClientRects().length !== 0 && (n.scrollTo({ top: 0, left: 0, behavior: "instant" }), t.reveal(n));
|
|
1659
1717
|
}, qt = (e, t, n) => {
|
|
1660
1718
|
if (e === null) return null;
|
|
1661
|
-
const r =
|
|
1662
|
-
return r === null ? (ni(t) &&
|
|
1719
|
+
const r = Cn(e, t);
|
|
1720
|
+
return r === null ? (ni(t) && di(e, n), null) : (li(e, r), si(n.scrollerOf(e, r), r), n.reveal(r), r);
|
|
1663
1721
|
};
|
|
1664
|
-
function
|
|
1722
|
+
function ci({
|
|
1665
1723
|
title: e,
|
|
1666
1724
|
titleId: t,
|
|
1667
1725
|
...n
|
|
@@ -1680,7 +1738,7 @@ function di({
|
|
|
1680
1738
|
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"
|
|
1681
1739
|
}));
|
|
1682
1740
|
}
|
|
1683
|
-
const ui = /* @__PURE__ */ y.forwardRef(
|
|
1741
|
+
const ui = /* @__PURE__ */ y.forwardRef(ci);
|
|
1684
1742
|
function fi({
|
|
1685
1743
|
title: e,
|
|
1686
1744
|
titleId: t,
|
|
@@ -1769,13 +1827,13 @@ const wi = /* @__PURE__ */ y.forwardRef(vi), nt = "data-aqmx-key-repeat", rt = O
|
|
|
1769
1827
|
t.target === e && (e = null);
|
|
1770
1828
|
}
|
|
1771
1829
|
};
|
|
1772
|
-
},
|
|
1830
|
+
}, Ae = Object.freeze([1 / be ** 2, 1 / be, 1, be, be ** 2]), _t = Object.freeze({ mode: "fit" }), Ei = 1, Mn = Object.freeze({ className: "aqmx-document-canvas", "data-testid": "markdown-explorer-image-canvas" }), It = `[data-testid="${Mn["data-testid"]}"]`, Si = pe(null), yi = (e, t) => e.width > 0 && e.height > 0 && t.width - e.width <= Ei ? { base: e, scale: t.width / e.width } : t.width > 0 && t.height > 0 ? { base: t, scale: 1 } : null, Bt = (e, t, n) => {
|
|
1773
1831
|
if (e.mode === "level") {
|
|
1774
1832
|
const o = e.index + n;
|
|
1775
|
-
return o >= 0 && o <
|
|
1833
|
+
return o >= 0 && o < Ae.length ? o : null;
|
|
1776
1834
|
}
|
|
1777
1835
|
if (t === null || !Number.isFinite(t) || t <= 0) return null;
|
|
1778
|
-
const r = n === 1 ?
|
|
1836
|
+
const r = n === 1 ? Ae.findIndex((o) => o > t) : Ae.findLastIndex((o) => o < t);
|
|
1779
1837
|
return r === -1 ? null : r;
|
|
1780
1838
|
}, zt = (e, t, n) => {
|
|
1781
1839
|
if (e.mode === "level") {
|
|
@@ -1785,7 +1843,7 @@ const wi = /* @__PURE__ */ y.forwardRef(vi), nt = "data-aqmx-key-repeat", rt = O
|
|
|
1785
1843
|
if (t === null) return null;
|
|
1786
1844
|
const r = Bt(e, t.scale, n);
|
|
1787
1845
|
return r === null ? null : { mode: "level", index: r, base: t.base };
|
|
1788
|
-
},
|
|
1846
|
+
}, xi = (e, t) => {
|
|
1789
1847
|
if (e <= 0 || t <= 0) return 0;
|
|
1790
1848
|
const n = Math.trunc(Math.log(t / e) / Math.log(be));
|
|
1791
1849
|
return n === 0 ? 0 : n;
|
|
@@ -1793,17 +1851,17 @@ const wi = /* @__PURE__ */ y.forwardRef(vi), nt = "data-aqmx-key-repeat", rt = O
|
|
|
1793
1851
|
const t = e[0], n = e[1];
|
|
1794
1852
|
return e.length !== 2 || t === void 0 || n === void 0 ? null : { distance: Math.hypot(n.clientX - t.clientX, n.clientY - t.clientY), middle: { x: (t.clientX + n.clientX) / 2, y: (t.clientY + n.clientY) / 2 } };
|
|
1795
1853
|
}, ki = (e) => {
|
|
1796
|
-
const t =
|
|
1854
|
+
const t = Ae[e];
|
|
1797
1855
|
if (t === void 0) throw new RangeError(`[markdown-explorer] no image zoom step ${String(e)}`);
|
|
1798
1856
|
return t;
|
|
1799
1857
|
}, Ht = (e, t, n) => e !== null && e.width === t && e.height === n ? e : { width: t, height: n }, Ti = ({ document: e }) => {
|
|
1800
|
-
const { labels: t } = D(), n =
|
|
1801
|
-
const { naturalWidth:
|
|
1802
|
-
u((
|
|
1858
|
+
const { labels: t } = D(), n = re(Si), [r] = z(() => n === null ? null : n.read(e.url)), [o, i] = z(r === null ? _t : r.zoom), [a, u] = z(r === null ? null : r.reported), [m, f] = z(null), c = _(null), h = P((w) => {
|
|
1859
|
+
const { naturalWidth: l, naturalHeight: s } = w;
|
|
1860
|
+
u((v) => Ht(v, l, s));
|
|
1803
1861
|
}, []), g = P(
|
|
1804
|
-
(
|
|
1805
|
-
|
|
1806
|
-
() => h(
|
|
1862
|
+
(w) => {
|
|
1863
|
+
c.current = w, !(w === null || !w.complete) && (w.naturalWidth > 0 || w.naturalHeight > 0 ? h(w) : w.decode().then(
|
|
1864
|
+
() => h(w),
|
|
1807
1865
|
() => {
|
|
1808
1866
|
}
|
|
1809
1867
|
));
|
|
@@ -1811,68 +1869,68 @@ const wi = /* @__PURE__ */ y.forwardRef(vi), nt = "data-aqmx-key-repeat", rt = O
|
|
|
1811
1869
|
[h]
|
|
1812
1870
|
);
|
|
1813
1871
|
te(() => {
|
|
1814
|
-
n !== null &&
|
|
1815
|
-
}, [n, e.url, o,
|
|
1816
|
-
const
|
|
1817
|
-
if (
|
|
1818
|
-
const
|
|
1819
|
-
if (
|
|
1820
|
-
const s = new ResizeObserver(
|
|
1821
|
-
return s.observe(
|
|
1822
|
-
}, [
|
|
1823
|
-
const
|
|
1824
|
-
|
|
1825
|
-
A.current = { zoomIn: R, zoomOut:
|
|
1872
|
+
n !== null && a !== null && n.save(e.url, { zoom: o, reported: a });
|
|
1873
|
+
}, [n, e.url, o, a]), j(() => {
|
|
1874
|
+
const w = c.current;
|
|
1875
|
+
if (w === null || a === null || o.mode !== "fit") return;
|
|
1876
|
+
const l = () => f((v) => Ht(v, w.clientWidth, w.clientHeight));
|
|
1877
|
+
if (l(), typeof ResizeObserver > "u") return;
|
|
1878
|
+
const s = new ResizeObserver(l);
|
|
1879
|
+
return s.observe(w), () => s.disconnect();
|
|
1880
|
+
}, [a, o.mode]);
|
|
1881
|
+
const E = a === null || m === null ? null : yi(a, m), k = zt(o, E, -1), R = zt(o, E, 1), T = o.mode === "level" ? ki(o.index) : null, A = _({ zoomIn: R, zoomOut: k });
|
|
1882
|
+
j(() => {
|
|
1883
|
+
A.current = { zoomIn: R, zoomOut: k };
|
|
1826
1884
|
});
|
|
1827
1885
|
const L = _(null);
|
|
1828
|
-
|
|
1829
|
-
const
|
|
1830
|
-
L.current = null, !(
|
|
1886
|
+
j(() => {
|
|
1887
|
+
const w = L.current, l = c.current?.closest(It);
|
|
1888
|
+
L.current = null, !(w === null || l === null || l === void 0) && (l.scrollLeft = w.across * l.scrollWidth - w.x, l.scrollTop = w.down * l.scrollHeight - w.y);
|
|
1831
1889
|
}, [o]), te(() => {
|
|
1832
|
-
const
|
|
1833
|
-
if (
|
|
1834
|
-
let
|
|
1835
|
-
const s = (
|
|
1836
|
-
const N = jt(
|
|
1837
|
-
|
|
1838
|
-
},
|
|
1839
|
-
const N = jt(
|
|
1840
|
-
if (
|
|
1841
|
-
|
|
1842
|
-
const q =
|
|
1843
|
-
if (q ===
|
|
1844
|
-
const W = q >
|
|
1845
|
-
if (
|
|
1846
|
-
|
|
1847
|
-
const
|
|
1848
|
-
L.current =
|
|
1849
|
-
},
|
|
1850
|
-
|
|
1890
|
+
const w = c.current?.closest(It);
|
|
1891
|
+
if (w == null) return;
|
|
1892
|
+
let l = null;
|
|
1893
|
+
const s = (M) => {
|
|
1894
|
+
const N = jt(M.touches);
|
|
1895
|
+
l = N === null ? null : { distance: N.distance, steps: 0 };
|
|
1896
|
+
}, v = (M) => {
|
|
1897
|
+
const N = jt(M.touches);
|
|
1898
|
+
if (l === null || N === null) return;
|
|
1899
|
+
M.preventDefault();
|
|
1900
|
+
const q = xi(l.distance, N.distance);
|
|
1901
|
+
if (q === l.steps) return;
|
|
1902
|
+
const W = q > l.steps ? 1 : -1, G = W === 1 ? A.current.zoomIn : A.current.zoomOut;
|
|
1903
|
+
if (G === null) return;
|
|
1904
|
+
l.steps += W;
|
|
1905
|
+
const I = w.getBoundingClientRect(), J = N.middle.x - I.left, H = N.middle.y - I.top;
|
|
1906
|
+
L.current = w.scrollWidth > 0 && w.scrollHeight > 0 ? { x: J, y: H, across: (w.scrollLeft + J) / w.scrollWidth, down: (w.scrollTop + H) / w.scrollHeight } : null, i(G);
|
|
1907
|
+
}, O = (M) => {
|
|
1908
|
+
M.touches.length < 2 && (l = null);
|
|
1851
1909
|
};
|
|
1852
|
-
return
|
|
1853
|
-
|
|
1910
|
+
return w.addEventListener("touchstart", s, { passive: !0 }), w.addEventListener("touchmove", v, { passive: !1 }), w.addEventListener("touchend", O, { passive: !0 }), w.addEventListener("touchcancel", O, { passive: !0 }), () => {
|
|
1911
|
+
w.removeEventListener("touchstart", s), w.removeEventListener("touchmove", v), w.removeEventListener("touchend", O), w.removeEventListener("touchcancel", O);
|
|
1854
1912
|
};
|
|
1855
1913
|
}, []);
|
|
1856
|
-
const
|
|
1857
|
-
return /* @__PURE__ */
|
|
1858
|
-
/* @__PURE__ */
|
|
1859
|
-
/* @__PURE__ */
|
|
1914
|
+
const b = o.mode === "level" && T !== null ? { width: `${o.base.width * T}px`, height: `${o.base.height * T}px` } : void 0;
|
|
1915
|
+
return /* @__PURE__ */ $("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-image-view", children: [
|
|
1916
|
+
/* @__PURE__ */ $(qe, { name: e.name, openUrl: e.url, downloadUrl: e.url, icon: /* @__PURE__ */ d(wi, {}), children: [
|
|
1917
|
+
/* @__PURE__ */ d(
|
|
1860
1918
|
"button",
|
|
1861
1919
|
{
|
|
1862
1920
|
type: "button",
|
|
1863
1921
|
className: "aqmx-icon-button",
|
|
1864
1922
|
"aria-label": t.imageZoomOut,
|
|
1865
1923
|
title: t.imageZoomOut,
|
|
1866
|
-
"aria-disabled":
|
|
1924
|
+
"aria-disabled": k === null,
|
|
1867
1925
|
onClick: () => {
|
|
1868
|
-
|
|
1926
|
+
k !== null && i(k);
|
|
1869
1927
|
},
|
|
1870
1928
|
...rt,
|
|
1871
|
-
children: /* @__PURE__ */
|
|
1929
|
+
children: /* @__PURE__ */ d(mi, {})
|
|
1872
1930
|
}
|
|
1873
1931
|
),
|
|
1874
|
-
/* @__PURE__ */
|
|
1875
|
-
/* @__PURE__ */
|
|
1932
|
+
/* @__PURE__ */ d("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)) }),
|
|
1933
|
+
/* @__PURE__ */ d(
|
|
1876
1934
|
"button",
|
|
1877
1935
|
{
|
|
1878
1936
|
type: "button",
|
|
@@ -1884,47 +1942,47 @@ const wi = /* @__PURE__ */ y.forwardRef(vi), nt = "data-aqmx-key-repeat", rt = O
|
|
|
1884
1942
|
R !== null && i(R);
|
|
1885
1943
|
},
|
|
1886
1944
|
...rt,
|
|
1887
|
-
children: /* @__PURE__ */
|
|
1945
|
+
children: /* @__PURE__ */ d(pi, {})
|
|
1888
1946
|
}
|
|
1889
1947
|
),
|
|
1890
|
-
/* @__PURE__ */
|
|
1948
|
+
/* @__PURE__ */ d("button", { type: "button", className: "aqmx-icon-button", "aria-label": t.imageFit, title: t.imageFit, "aria-pressed": o.mode === "fit", onClick: () => i(_t), children: /* @__PURE__ */ d(ui, {}) })
|
|
1891
1949
|
] }),
|
|
1892
|
-
/* @__PURE__ */
|
|
1950
|
+
/* @__PURE__ */ d(ve, { scrollerProps: Mn, children: /* @__PURE__ */ d("img", { ref: g, className: "aqmx-document-image", src: e.url, alt: e.name, "data-aqmx-image-mode": o.mode, style: b, onLoad: (w) => h(w.currentTarget), "data-testid": "markdown-explorer-image" }) })
|
|
1893
1951
|
] });
|
|
1894
|
-
},
|
|
1895
|
-
const e =
|
|
1952
|
+
}, An = pe(null), Ie = pe(void 0), Ln = pe(null), Be = () => {
|
|
1953
|
+
const e = re(An);
|
|
1896
1954
|
if (e === null) throw new Error("[markdown-explorer] document links must be rendered inside a document pane");
|
|
1897
1955
|
return e;
|
|
1898
1956
|
}, Ri = () => {
|
|
1899
|
-
const e =
|
|
1957
|
+
const e = re(Ln);
|
|
1900
1958
|
if (e === null) throw new Error("[markdown-explorer] table-of-contents entries must be rendered inside a document pane's links");
|
|
1901
1959
|
return e;
|
|
1902
|
-
}, ze = (e, t, n, r) => t.kind === "panel" ?
|
|
1903
|
-
const { config: t } = D(), n = Be(), r =
|
|
1904
|
-
return /* @__PURE__ */
|
|
1905
|
-
},
|
|
1906
|
-
const t = e instanceof Element ? e.closest(
|
|
1960
|
+
}, ze = (e, t, n, r) => t.kind === "panel" ? Se(e, { view: "tree", source: n, doc: r }) : t.view === "single" ? Se(e, { view: "single", source: n, doc: r, overrides: t.overrides, embed: t.embed }) : Se(e, { view: "tree", source: n, doc: r, overrides: t.overrides }), Oi = ({ children: e }) => {
|
|
1961
|
+
const { config: t } = D(), n = Be(), r = at(), o = r.kind === "location" ? r.location.source : void 0, i = Fe(ze(t, n.navigation, o, n.currentPath));
|
|
1962
|
+
return /* @__PURE__ */ d(Ie, { value: o, children: /* @__PURE__ */ d(Ln, { value: i, children: e }) });
|
|
1963
|
+
}, Ci = 'a[data-link-kind="doc"][data-doc-path]:not([data-doc-exists="false"])', Mi = (e) => {
|
|
1964
|
+
const t = e instanceof Element ? e.closest(Ci) : null;
|
|
1907
1965
|
return t === null ? null : t.getAttribute("data-doc-path");
|
|
1908
|
-
}, je = (e) => !e.defaultPrevented && e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey,
|
|
1909
|
-
const f =
|
|
1910
|
-
return /* @__PURE__ */
|
|
1966
|
+
}, je = (e) => !e.defaultPrevented && e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey, Ai = ({ to: e, docPath: t, fragment: n, exists: r, className: o, attributes: i, onDocumentLink: a, scope: u, children: m }) => {
|
|
1967
|
+
const f = Fe(e);
|
|
1968
|
+
return /* @__PURE__ */ d("a", { ...i, href: f, className: o, "data-link-kind": "doc", "data-doc-path": t, "data-doc-exists": r, onClick: (h) => {
|
|
1911
1969
|
if (je(h)) {
|
|
1912
1970
|
if (h.preventDefault(), t === u.currentPath && n !== "") {
|
|
1913
1971
|
u.scrollWithin(n);
|
|
1914
1972
|
return;
|
|
1915
1973
|
}
|
|
1916
|
-
|
|
1974
|
+
a(t, n);
|
|
1917
1975
|
}
|
|
1918
1976
|
}, children: m });
|
|
1919
|
-
},
|
|
1920
|
-
const { config:
|
|
1921
|
-
return
|
|
1977
|
+
}, Li = ({ href: e, docPath: t, docExists: n, className: r, attributes: o, children: i }) => {
|
|
1978
|
+
const { config: a } = D(), u = Be(), m = re(Ie), f = ei(e), { navigation: c } = u, h = `${ze(a, c, m, t)}${f}`, g = n === !1 ? "false" : void 0;
|
|
1979
|
+
return c.kind === "page" ? /* @__PURE__ */ d(Mo, { ...o, to: h, navigation: "follow-link", className: r, "data-link-kind": "doc", "data-doc-path": t, "data-doc-exists": g, children: i }) : /* @__PURE__ */ d(Ai, { to: h, docPath: t, fragment: f, exists: g, className: r, attributes: o, onDocumentLink: c.onDocumentLink, scope: u, children: i });
|
|
1922
1980
|
}, Ni = ({ className: e, attributes: t, children: n }) => {
|
|
1923
1981
|
const { labels: r } = D();
|
|
1924
1982
|
return (
|
|
1925
|
-
/* @__PURE__ */
|
|
1983
|
+
/* @__PURE__ */ $("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: [
|
|
1926
1984
|
n,
|
|
1927
|
-
/* @__PURE__ */
|
|
1985
|
+
/* @__PURE__ */ $("span", { className: "aqmx-sr-only", children: [
|
|
1928
1986
|
" (",
|
|
1929
1987
|
r.inertLink,
|
|
1930
1988
|
")"
|
|
@@ -1932,25 +1990,25 @@ const wi = /* @__PURE__ */ y.forwardRef(vi), nt = "data-aqmx-key-repeat", rt = O
|
|
|
1932
1990
|
] })
|
|
1933
1991
|
);
|
|
1934
1992
|
}, Di = ({ href: e, className: t, attributes: n, scope: r, children: o }) => {
|
|
1935
|
-
const { config: i } = D(),
|
|
1936
|
-
return /* @__PURE__ */
|
|
1993
|
+
const { config: i } = D(), a = re(Ie), u = Fe(`${ze(i, r.navigation, a, r.currentPath)}${e}`);
|
|
1994
|
+
return /* @__PURE__ */ d("a", { ...n, href: u, className: t, onClick: (f) => {
|
|
1937
1995
|
je(f) && (f.preventDefault(), r.scrollWithin(e));
|
|
1938
1996
|
}, children: o });
|
|
1939
1997
|
}, Pi = ({ href: e, className: t, attributes: n, children: r }) => {
|
|
1940
1998
|
const o = Be();
|
|
1941
|
-
return o.navigation.kind === "page" ? /* @__PURE__ */
|
|
1942
|
-
if (!je(
|
|
1943
|
-
const u =
|
|
1944
|
-
e === "#" ? o.followEmptyFragment(
|
|
1945
|
-
}, children: r }) : /* @__PURE__ */
|
|
1946
|
-
},
|
|
1947
|
-
const { config: e } = D(), t = Be(), n =
|
|
1999
|
+
return o.navigation.kind === "page" ? /* @__PURE__ */ d("a", { ...n, href: e, className: t, onClick: (a) => {
|
|
2000
|
+
if (!je(a)) return;
|
|
2001
|
+
const u = a.currentTarget;
|
|
2002
|
+
e === "#" ? o.followEmptyFragment(a.nativeEvent) : u.href === u.ownerDocument.URL && o.followSameUrlJump(e, a.nativeEvent);
|
|
2003
|
+
}, children: r }) : /* @__PURE__ */ d(Di, { href: e, className: t, attributes: n, scope: o, children: r });
|
|
2004
|
+
}, Fi = ({ href: e, kind: t, docPath: n, docExists: r, className: o, attributes: i, children: a }) => t === "doc" ? n === void 0 || !tr(n) ? /* @__PURE__ */ d(Ni, { className: o, attributes: i, children: a }) : /* @__PURE__ */ d(Li, { href: e, docPath: n, docExists: r, className: o, attributes: i, children: a }) : e.startsWith("#") ? /* @__PURE__ */ d(Pi, { href: e, className: o, attributes: i, children: a }) : /* @__PURE__ */ d("a", { ...i, href: e, className: o, children: a }), $i = () => {
|
|
2005
|
+
const { config: e } = D(), t = Be(), n = re(Ie), r = $e();
|
|
1948
2006
|
return P(
|
|
1949
2007
|
(o, i) => {
|
|
1950
2008
|
if (!je(i)) return !0;
|
|
1951
2009
|
i.preventDefault();
|
|
1952
|
-
const
|
|
1953
|
-
return u.kind === "panel" ||
|
|
2010
|
+
const a = Rn(o.id), { navigation: u } = t;
|
|
2011
|
+
return u.kind === "panel" || dt(i.currentTarget.ownerDocument.location.hash) === o.id ? (t.scrollWithin(a), !0) : (r(`${ze(e, u, n, t.currentPath)}${a}`, "follow-link"), !0);
|
|
1954
2012
|
},
|
|
1955
2013
|
[e, t, n, r]
|
|
1956
2014
|
);
|
|
@@ -2021,24 +2079,24 @@ function ji({
|
|
|
2021
2079
|
clipRule: "evenodd"
|
|
2022
2080
|
}));
|
|
2023
2081
|
}
|
|
2024
|
-
const Hi = /* @__PURE__ */ y.forwardRef(ji), Vi = Object.freeze({ className: "aqmx-document-stage" }),
|
|
2025
|
-
},
|
|
2026
|
-
const { labels: t } = D(), n = ee(
|
|
2027
|
-
return n === null ? null : n ? /* @__PURE__ */
|
|
2028
|
-
/* @__PURE__ */
|
|
2029
|
-
/* @__PURE__ */
|
|
2030
|
-
/* @__PURE__ */
|
|
2031
|
-
/* @__PURE__ */
|
|
2082
|
+
const Hi = /* @__PURE__ */ y.forwardRef(ji), Vi = Object.freeze({ className: "aqmx-document-stage" }), Zi = () => () => {
|
|
2083
|
+
}, Ui = () => navigator.pdfViewerEnabled !== !1, Gi = () => null, Wi = ({ document: e }) => {
|
|
2084
|
+
const { labels: t } = D(), n = ee(Zi, Ui, Gi);
|
|
2085
|
+
return n === null ? null : n ? /* @__PURE__ */ d("iframe", { className: "aqmx-document-frame", src: e.url, title: e.name, "data-testid": "markdown-explorer-media-player" }) : /* @__PURE__ */ $("div", { className: "aqmx-callout", role: "note", "data-testid": "markdown-explorer-pdf-not-shown", children: [
|
|
2086
|
+
/* @__PURE__ */ d("p", { className: "aqmx-callout-body", children: t.pdfNotShown }),
|
|
2087
|
+
/* @__PURE__ */ $("div", { className: "aqmx-callout-actions", children: [
|
|
2088
|
+
/* @__PURE__ */ d("a", { className: "aqmx-callout-action", href: e.url, target: "_blank", rel: "noopener noreferrer", "data-testid": "markdown-explorer-pdf-not-shown-open", children: t.openInNewTab }),
|
|
2089
|
+
/* @__PURE__ */ d("a", { className: "aqmx-callout-action", href: e.url, download: e.name, "data-testid": "markdown-explorer-pdf-not-shown-download", children: t.download })
|
|
2032
2090
|
] })
|
|
2033
2091
|
] });
|
|
2034
2092
|
}, Ki = (e) => {
|
|
2035
2093
|
switch (e) {
|
|
2036
2094
|
case "video":
|
|
2037
|
-
return /* @__PURE__ */
|
|
2095
|
+
return /* @__PURE__ */ d(zi, {});
|
|
2038
2096
|
case "audio":
|
|
2039
|
-
return /* @__PURE__ */
|
|
2097
|
+
return /* @__PURE__ */ d(Hi, {});
|
|
2040
2098
|
case "pdf":
|
|
2041
|
-
return /* @__PURE__ */
|
|
2099
|
+
return /* @__PURE__ */ d(Ii, {});
|
|
2042
2100
|
default: {
|
|
2043
2101
|
const t = e;
|
|
2044
2102
|
throw new RangeError(`[markdown-explorer] unknown media type ${String(t)}`);
|
|
@@ -2049,22 +2107,22 @@ const Hi = /* @__PURE__ */ y.forwardRef(ji), Vi = Object.freeze({ className: "aq
|
|
|
2049
2107
|
switch (e.mediaType) {
|
|
2050
2108
|
case "video":
|
|
2051
2109
|
return (
|
|
2052
|
-
/* @__PURE__ */
|
|
2110
|
+
/* @__PURE__ */ d("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 })
|
|
2053
2111
|
);
|
|
2054
2112
|
case "audio":
|
|
2055
2113
|
return (
|
|
2056
|
-
/* @__PURE__ */
|
|
2114
|
+
/* @__PURE__ */ d("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 })
|
|
2057
2115
|
);
|
|
2058
2116
|
case "pdf":
|
|
2059
|
-
return /* @__PURE__ */
|
|
2117
|
+
return /* @__PURE__ */ d(Wi, { document: e });
|
|
2060
2118
|
default: {
|
|
2061
2119
|
const n = e.mediaType;
|
|
2062
2120
|
throw new RangeError(`[markdown-explorer] unknown media type ${String(n)}`);
|
|
2063
2121
|
}
|
|
2064
2122
|
}
|
|
2065
|
-
}, Yi = ({ document: e }) => /* @__PURE__ */
|
|
2066
|
-
/* @__PURE__ */
|
|
2067
|
-
/* @__PURE__ */
|
|
2123
|
+
}, Yi = ({ document: e }) => /* @__PURE__ */ $("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-media-view", "data-aqmx-media-type": e.mediaType, children: [
|
|
2124
|
+
/* @__PURE__ */ d(qe, { name: e.name, openUrl: e.url, downloadUrl: e.url, icon: Ki(e.mediaType) }),
|
|
2125
|
+
/* @__PURE__ */ d(ve, { scrollerProps: Vi, children: /* @__PURE__ */ d(Xi, { document: e }) })
|
|
2068
2126
|
] }), Ji = (e) => ({
|
|
2069
2127
|
loading: e.viewerLoading,
|
|
2070
2128
|
errorPrefix: e.viewerErrorPrefix,
|
|
@@ -2106,6 +2164,32 @@ const Hi = /* @__PURE__ */ y.forwardRef(ji), Vi = Object.freeze({ className: "aq
|
|
|
2106
2164
|
mermaidPanRight: e.viewerMermaidPanRight,
|
|
2107
2165
|
mermaidDiagram: e.viewerMermaidDiagram,
|
|
2108
2166
|
mermaidRetry: e.viewerMermaidRetry,
|
|
2167
|
+
spreadsheetTable: e.viewerSpreadsheetTable,
|
|
2168
|
+
spreadsheetZoomIn: e.viewerSpreadsheetZoomIn,
|
|
2169
|
+
spreadsheetZoomOut: e.viewerSpreadsheetZoomOut,
|
|
2170
|
+
spreadsheetResetZoom: e.viewerSpreadsheetResetZoom,
|
|
2171
|
+
spreadsheetHighlight: e.viewerSpreadsheetHighlight,
|
|
2172
|
+
spreadsheetCopyAll: e.viewerSpreadsheetCopyAll,
|
|
2173
|
+
spreadsheetSaveTsv: e.viewerSpreadsheetSaveTsv,
|
|
2174
|
+
spreadsheetSaveMenu: e.viewerSpreadsheetSaveMenu,
|
|
2175
|
+
spreadsheetSaveTsvWithBom: e.viewerSpreadsheetSaveTsvWithBom,
|
|
2176
|
+
spreadsheetFullscreen: e.viewerSpreadsheetFullscreen,
|
|
2177
|
+
spreadsheetExitFullscreen: e.viewerSpreadsheetExitFullscreen,
|
|
2178
|
+
spreadsheetFullscreenDialog: e.viewerSpreadsheetFullscreenDialog,
|
|
2179
|
+
spreadsheetSize: e.viewerSpreadsheetSize,
|
|
2180
|
+
spreadsheetFileName: e.viewerSpreadsheetFileName,
|
|
2181
|
+
spreadsheetCopied: e.viewerSpreadsheetCopied,
|
|
2182
|
+
spreadsheetCopyFailed: e.viewerSpreadsheetCopyFailed,
|
|
2183
|
+
spreadsheetCellAnnouncement: e.viewerSpreadsheetCellAnnouncement,
|
|
2184
|
+
spreadsheetEmptyCell: e.viewerSpreadsheetEmptyCell,
|
|
2185
|
+
spreadsheetSelectionAnnouncement: e.viewerSpreadsheetSelectionAnnouncement,
|
|
2186
|
+
spreadsheetReadOnly: e.viewerSpreadsheetReadOnly,
|
|
2187
|
+
spreadsheetFormatRefused: e.viewerSpreadsheetFormatRefused,
|
|
2188
|
+
spreadsheetFenceRefused: e.viewerSpreadsheetFenceRefused,
|
|
2189
|
+
spreadsheetEditConflict: e.viewerSpreadsheetEditConflict,
|
|
2190
|
+
spreadsheetOptionsError: e.viewerSpreadsheetOptionsError,
|
|
2191
|
+
spreadsheetLoadFailed: e.viewerSpreadsheetLoadFailed,
|
|
2192
|
+
spreadsheetRetry: e.viewerSpreadsheetRetry,
|
|
2109
2193
|
embeddedVideo: e.viewerEmbeddedVideo,
|
|
2110
2194
|
embeddedPost: e.viewerEmbeddedPost,
|
|
2111
2195
|
embeddedFrame: e.viewerEmbeddedFrame
|
|
@@ -2115,273 +2199,274 @@ const Hi = /* @__PURE__ */ y.forwardRef(ji), Vi = Object.freeze({ className: "aq
|
|
|
2115
2199
|
const [r] = e.documentStyles;
|
|
2116
2200
|
if (r === void 0) throw new Error("[markdown-explorer] the configuration has no document style");
|
|
2117
2201
|
return r.name;
|
|
2118
|
-
}, Dn = (e, t) => e !== void 0 ? e : t !== void 0 ? t :
|
|
2202
|
+
}, Dn = (e, t) => e !== void 0 ? e : t !== void 0 ? t : Sr, Qi = Object.freeze({ kind: "empty" }), ct = Object.freeze(["l1", "l2", "l3", "l4", "l5", "l6", "l7", "l8"]), ea = (e, t, n) => {
|
|
2119
2203
|
if (t.view === "multi" || t.overrides[n] === void 0) return null;
|
|
2120
2204
|
const r = n === "style" ? { align: t.overrides.align } : { style: t.overrides.style };
|
|
2121
|
-
return
|
|
2122
|
-
},
|
|
2123
|
-
const m =
|
|
2205
|
+
return Se(e, { ...t, overrides: r });
|
|
2206
|
+
}, ye = ({ kind: e, view: t, label: n, stale: r, busy: o, frameRef: i, intent: a, children: u }) => {
|
|
2207
|
+
const m = re(he);
|
|
2124
2208
|
return (
|
|
2125
|
-
/* @__PURE__ */
|
|
2126
|
-
r ? /* @__PURE__ */
|
|
2209
|
+
/* @__PURE__ */ $("section", { ref: i, 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": m, className: "aqmx-document", ...a, children: [
|
|
2210
|
+
r ? /* @__PURE__ */ d("div", { className: "aqmx-progress", "aria-hidden": "true", "data-testid": "markdown-explorer-document-progress" }) : null,
|
|
2127
2211
|
u
|
|
2128
2212
|
] })
|
|
2129
2213
|
);
|
|
2130
|
-
},
|
|
2131
|
-
const { labels: r, announcer: o } = D(), i = e.kind === "no-readme" ? e.folder : null,
|
|
2214
|
+
}, ta = ({ absence: e, announces: t, announceFailure: n }) => {
|
|
2215
|
+
const { labels: r, announcer: o } = D(), i = e.kind === "no-readme" ? e.folder : null, a = e.kind === "failure" ? e.folder : null, u = e.kind === "failure" ? e.failure : null;
|
|
2132
2216
|
switch (te(() => {
|
|
2133
2217
|
t && i !== null && o.announce(r.folderReadmeMissing(se(i)));
|
|
2134
2218
|
}, [t, i, o, r]), te(() => {
|
|
2135
|
-
|
|
2136
|
-
}, [
|
|
2219
|
+
a !== null && u !== null && n(r.documentFailed(se(a), le(r, u.reason)));
|
|
2220
|
+
}, [a, u, n, r]), e.kind) {
|
|
2137
2221
|
case "empty":
|
|
2138
|
-
return /* @__PURE__ */
|
|
2222
|
+
return /* @__PURE__ */ d(ye, { kind: "empty", label: r.documentRegion, stale: !1, busy: !1, children: /* @__PURE__ */ d("div", { className: "aqmx-empty", "data-testid": "markdown-explorer-document-empty", children: /* @__PURE__ */ d("p", { className: "aqmx-empty-title", children: r.documentEmpty }) }) });
|
|
2139
2223
|
case "loading":
|
|
2140
|
-
return /* @__PURE__ */
|
|
2224
|
+
return /* @__PURE__ */ d(ut, { label: r.documentRegion });
|
|
2141
2225
|
case "no-readme":
|
|
2142
|
-
return /* @__PURE__ */
|
|
2226
|
+
return /* @__PURE__ */ d(ye, { kind: "empty", label: r.documentRegion, stale: !1, busy: !1, children: /* @__PURE__ */ d("div", { className: "aqmx-empty", "data-testid": "markdown-explorer-folder-empty", children: /* @__PURE__ */ d("p", { className: "aqmx-empty-title", children: r.folderReadmeMissing(se(e.folder)) }) }) });
|
|
2143
2227
|
case "failure":
|
|
2144
|
-
return /* @__PURE__ */
|
|
2228
|
+
return /* @__PURE__ */ d(ye, { kind: "failure", label: r.documentRegion, stale: !1, busy: !1, children: /* @__PURE__ */ d(ve, { scrollerProps: ft, children: /* @__PURE__ */ d(me, { failure: e.failure, alert: !1, onRetry: e.onRetry, testId: "markdown-explorer-folder-failure" }) }) });
|
|
2145
2229
|
}
|
|
2146
2230
|
}, ut = ({ label: e }) => {
|
|
2147
2231
|
const { labels: t } = D();
|
|
2148
|
-
return /* @__PURE__ */
|
|
2149
|
-
/* @__PURE__ */
|
|
2150
|
-
/* @__PURE__ */
|
|
2232
|
+
return /* @__PURE__ */ $(ye, { kind: "loading", label: e, stale: !1, busy: !0, children: [
|
|
2233
|
+
/* @__PURE__ */ d("div", { className: "aqmx-skeleton", "aria-hidden": "true", "data-testid": "markdown-explorer-document-skeleton", children: ct.map((n) => /* @__PURE__ */ d("span", {}, n)) }),
|
|
2234
|
+
/* @__PURE__ */ d("p", { className: "aqmx-sr-only", children: t.documentLoading })
|
|
2151
2235
|
] });
|
|
2152
|
-
}, Vt = Object.freeze(["wheel", "touchstart", "pointerdown", "keydown"]),
|
|
2153
|
-
const { reportMathDiagnostics: o, edits: i } = D(),
|
|
2154
|
-
|
|
2236
|
+
}, Vt = Object.freeze(["wheel", "touchstart", "pointerdown", "keydown"]), na = ({ path: e, document: t, viewer: n, editing: r }) => {
|
|
2237
|
+
const { reportMathDiagnostics: o, edits: i } = D(), a = U(() => ({ htmlContent: t.htmlContent, headings: [...t.headings] }), [t]), u = $i(), m = qi(), f = U(() => o === void 0 ? void 0 : (l) => o(e, l), [o, e]), c = _(null), { editable: h, doubleClick: g, region: E, paneScroll: k, stale: R } = r;
|
|
2238
|
+
j(() => {
|
|
2155
2239
|
if (h)
|
|
2156
2240
|
return i.bindView(e, {
|
|
2157
2241
|
anchor: () => {
|
|
2158
|
-
const
|
|
2159
|
-
return
|
|
2242
|
+
const l = c.current, s = E(), v = l === null ? null : l.querySelector(_e);
|
|
2243
|
+
return l === null || s === null || v === null ? null : yo(l, k.scrollerOf(s, v));
|
|
2160
2244
|
}
|
|
2161
2245
|
});
|
|
2162
|
-
}, [i, e, h,
|
|
2163
|
-
const
|
|
2164
|
-
const s =
|
|
2165
|
-
!g || s === null || !(
|
|
2246
|
+
}, [i, e, h, E, k]);
|
|
2247
|
+
const T = (l) => {
|
|
2248
|
+
const s = c.current, { target: v } = l;
|
|
2249
|
+
!g || s === null || !(v instanceof Element) || !Eo(v) || (l.stopPropagation(), i.start(e, So(v, s, s.ownerDocument.getSelection())));
|
|
2166
2250
|
}, A = _(null), L = _(R);
|
|
2167
|
-
|
|
2251
|
+
j(() => {
|
|
2168
2252
|
L.current = R;
|
|
2169
2253
|
});
|
|
2170
|
-
const
|
|
2171
|
-
const s =
|
|
2172
|
-
if (
|
|
2173
|
-
const
|
|
2174
|
-
return
|
|
2175
|
-
}),
|
|
2176
|
-
const s =
|
|
2254
|
+
const b = ae((l) => {
|
|
2255
|
+
const s = c.current, v = E(), O = s === null ? null : Oo(s, l.line);
|
|
2256
|
+
if (v === null || O === null) return !1;
|
|
2257
|
+
const M = k.scrollerOf(v, O);
|
|
2258
|
+
return M.scrollTop += Co(O, l.line) - l.clientTop, !0;
|
|
2259
|
+
}), w = ae((l) => {
|
|
2260
|
+
const s = E();
|
|
2177
2261
|
if (s === null) return;
|
|
2178
|
-
const
|
|
2179
|
-
for (const
|
|
2180
|
-
A.current?.release ===
|
|
2181
|
-
},
|
|
2182
|
-
for (const
|
|
2183
|
-
A.current = { point:
|
|
2262
|
+
const v = () => {
|
|
2263
|
+
for (const M of Vt) s.removeEventListener(M, O, !0);
|
|
2264
|
+
A.current?.release === v && (A.current = null);
|
|
2265
|
+
}, O = () => v();
|
|
2266
|
+
for (const M of Vt) s.addEventListener(M, O, { capture: !0, passive: !0 });
|
|
2267
|
+
A.current = { point: l, release: v };
|
|
2184
2268
|
});
|
|
2185
|
-
return
|
|
2186
|
-
const
|
|
2187
|
-
if (
|
|
2269
|
+
return j(() => {
|
|
2270
|
+
const l = i.takeReturn(e);
|
|
2271
|
+
if (l !== null)
|
|
2188
2272
|
return queueMicrotask(() => {
|
|
2189
|
-
|
|
2273
|
+
b(l) && L.current && w(l);
|
|
2190
2274
|
}), () => A.current?.release();
|
|
2191
|
-
}, [i, e]),
|
|
2192
|
-
const
|
|
2193
|
-
|
|
2275
|
+
}, [i, e]), j(() => {
|
|
2276
|
+
const l = A.current;
|
|
2277
|
+
l === null || R || (l.release(), b(l.point));
|
|
2194
2278
|
}, [t, R]),
|
|
2195
|
-
/* @__PURE__ */
|
|
2279
|
+
/* @__PURE__ */ d("div", { ref: c, className: "aqmx-document-viewer", onDoubleClick: T, children: /* @__PURE__ */ d(ln, { ...n, onHeadingSelect: u, headingHref: m, onMathDiagnostics: f, parseResult: a, content: null }) });
|
|
2196
2280
|
}, Pn = ({ document: e, viewer: t }) => {
|
|
2197
2281
|
const { labels: n } = D();
|
|
2198
|
-
return /* @__PURE__ */
|
|
2199
|
-
/* @__PURE__ */
|
|
2200
|
-
e.truncated ? /* @__PURE__ */
|
|
2201
|
-
/* @__PURE__ */
|
|
2282
|
+
return /* @__PURE__ */ $(Pe, { children: [
|
|
2283
|
+
/* @__PURE__ */ d(qe, { name: e.name, openUrl: nr(e.url), downloadUrl: e.url, icon: /* @__PURE__ */ d(uo, {}), children: e.truncated ? null : /* @__PURE__ */ d(Vo, { text: e.text }) }),
|
|
2284
|
+
e.truncated ? /* @__PURE__ */ d("p", { className: "aqmx-callout aqmx-document-notice", role: "note", "data-testid": "markdown-explorer-text-truncated", children: n.textTruncated }) : null,
|
|
2285
|
+
/* @__PURE__ */ d("div", { className: "aqmx-document-viewer", children: /* @__PURE__ */ d(ln, { ...t, parseResult: null, content: e.text }) })
|
|
2202
2286
|
] });
|
|
2203
|
-
},
|
|
2204
|
-
const { data: r, documents: o, announcer: i, labels:
|
|
2205
|
-
|
|
2287
|
+
}, ra = ({ path: e, name: t, viewer: n }) => {
|
|
2288
|
+
const { data: r, documents: o, announcer: i, labels: a } = D(), u = P(() => o.answerStampOf(e), [o, e]), m = ee(o.subscribe, u, u), [f, c] = z(0), h = U(() => ({ path: e, stamp: m, attempt: f }), [e, m, f]), [g, E] = z(null), k = ae((T) => {
|
|
2289
|
+
E(T), T.kind === "failure" && i.announce(a.documentFailed(t, le(a, T.failure.reason)));
|
|
2206
2290
|
});
|
|
2207
2291
|
te(() => {
|
|
2208
|
-
const
|
|
2209
|
-
return r.text(h.path,
|
|
2210
|
-
"kind" in A &&
|
|
2211
|
-
}), () =>
|
|
2292
|
+
const T = new AbortController();
|
|
2293
|
+
return r.text(h.path, T.signal).then((A) => {
|
|
2294
|
+
"kind" in A && k(A);
|
|
2295
|
+
}), () => T.abort();
|
|
2212
2296
|
}, [r, h]);
|
|
2213
|
-
const R = P(() =>
|
|
2214
|
-
return g === null ? /* @__PURE__ */
|
|
2215
|
-
/* @__PURE__ */
|
|
2216
|
-
/* @__PURE__ */
|
|
2217
|
-
] }) : g.kind === "failure" ? /* @__PURE__ */
|
|
2218
|
-
}, ft = Object.freeze({ className: "aqmx-document-failure", "data-aqmx-document-scroller": "" }),
|
|
2297
|
+
const R = P(() => c((T) => T + 1), []);
|
|
2298
|
+
return g === null ? /* @__PURE__ */ $(Pe, { children: [
|
|
2299
|
+
/* @__PURE__ */ d("div", { className: "aqmx-skeleton", "aria-hidden": "true", "data-testid": "markdown-explorer-markup-skeleton", children: ct.map((T) => /* @__PURE__ */ d("span", {}, T)) }),
|
|
2300
|
+
/* @__PURE__ */ d("p", { className: "aqmx-sr-only", children: a.markupLoading })
|
|
2301
|
+
] }) : g.kind === "failure" ? /* @__PURE__ */ d(ve, { scrollerProps: ft, children: /* @__PURE__ */ d(me, { failure: g.failure, alert: !1, onRetry: R, testId: "markdown-explorer-markup-failure" }) }) : /* @__PURE__ */ d(Pn, { document: g, viewer: n });
|
|
2302
|
+
}, ft = Object.freeze({ className: "aqmx-document-failure", "data-aqmx-document-scroller": "" }), oa = Object.freeze({ reason: "failed" }), ia = (e) => /* @__PURE__ */ d(
|
|
2219
2303
|
ho,
|
|
2220
2304
|
{
|
|
2221
|
-
fallback: (t) => /* @__PURE__ */
|
|
2222
|
-
children: /* @__PURE__ */
|
|
2305
|
+
fallback: (t) => /* @__PURE__ */ d("div", { className: "aqmx-edit-message", children: /* @__PURE__ */ d(me, { failure: oa, alert: !1, onRetry: t, testId: "markdown-explorer-edit-load-failure" }) }),
|
|
2306
|
+
children: /* @__PURE__ */ d(
|
|
2223
2307
|
ke,
|
|
2224
2308
|
{
|
|
2225
|
-
fallback: /* @__PURE__ */
|
|
2226
|
-
children: /* @__PURE__ */
|
|
2309
|
+
fallback: /* @__PURE__ */ d("div", { className: "aqmx-skeleton", "aria-hidden": "true", "data-testid": "markdown-explorer-edit-skeleton", children: ct.map((t) => /* @__PURE__ */ d("span", {}, t)) }),
|
|
2310
|
+
children: /* @__PURE__ */ d(mo, { ...e })
|
|
2227
2311
|
}
|
|
2228
2312
|
)
|
|
2229
2313
|
}
|
|
2230
|
-
),
|
|
2314
|
+
), aa = ({ path: e, document: t, view: n, viewer: r, onRetry: o, editing: i }) => {
|
|
2231
2315
|
switch (t.kind) {
|
|
2232
2316
|
case "markdown": {
|
|
2233
|
-
const { session:
|
|
2234
|
-
if (n === "edit" &&
|
|
2235
|
-
if (n === "markup") return /* @__PURE__ */
|
|
2317
|
+
const { session: a, layout: u, region: m, paneScroll: f, stale: c } = i;
|
|
2318
|
+
if (n === "edit" && a !== void 0) return /* @__PURE__ */ d(ia, { path: e, name: t.name, session: a, layout: u, viewer: r, region: m, paneScroll: f });
|
|
2319
|
+
if (n === "markup") return /* @__PURE__ */ d(ra, { path: e, name: t.name, viewer: r });
|
|
2236
2320
|
const h = t.edit !== null && (t.edit.kind === "inline" || t.edit.kind === "draft");
|
|
2237
|
-
return /* @__PURE__ */
|
|
2321
|
+
return /* @__PURE__ */ d(na, { path: e, document: t, viewer: r, editing: { editable: h, doubleClick: h && u === "fill", region: m, paneScroll: f, stale: c } });
|
|
2238
2322
|
}
|
|
2239
2323
|
case "text":
|
|
2240
|
-
return /* @__PURE__ */
|
|
2324
|
+
return /* @__PURE__ */ d(Pn, { document: t, viewer: r });
|
|
2241
2325
|
case "image":
|
|
2242
|
-
return /* @__PURE__ */
|
|
2326
|
+
return /* @__PURE__ */ d(Ti, { document: t });
|
|
2243
2327
|
case "media":
|
|
2244
|
-
return /* @__PURE__ */
|
|
2328
|
+
return /* @__PURE__ */ d(Yi, { document: t });
|
|
2245
2329
|
case "file":
|
|
2246
|
-
return /* @__PURE__ */
|
|
2330
|
+
return /* @__PURE__ */ d(Qo, { document: t });
|
|
2247
2331
|
case "failure":
|
|
2248
|
-
return /* @__PURE__ */
|
|
2332
|
+
return /* @__PURE__ */ d(ve, { scrollerProps: ft, children: /* @__PURE__ */ d(me, { failure: t.failure, alert: !1, onRetry: o, testId: "markdown-explorer-document-failure" }) });
|
|
2249
2333
|
default: {
|
|
2250
|
-
const
|
|
2251
|
-
throw new RangeError(`[markdown-explorer] unknown document kind in ${JSON.stringify(
|
|
2334
|
+
const a = t;
|
|
2335
|
+
throw new RangeError(`[markdown-explorer] unknown document kind in ${JSON.stringify(a)}`);
|
|
2252
2336
|
}
|
|
2253
2337
|
}
|
|
2254
|
-
},
|
|
2255
|
-
const [r] = t.kind === "markdown" ? t.headings : [], o = [n === null ? null :
|
|
2338
|
+
}, la = 'a[href], button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), iframe, audio[controls], video[controls], [tabindex]:not([tabindex="-1"])', sa = (e, t, n) => {
|
|
2339
|
+
const [r] = t.kind === "markdown" ? t.headings : [], o = [n === null ? null : Cn(e, n), r === void 0 ? null : On(e, r.id), e.querySelector(_e), e.querySelector(la)];
|
|
2256
2340
|
for (const i of o)
|
|
2257
|
-
if (i instanceof HTMLElement &&
|
|
2341
|
+
if (i instanceof HTMLElement && yn(i)) return i;
|
|
2258
2342
|
return null;
|
|
2259
|
-
},
|
|
2343
|
+
}, Zt = (e, t, n) => {
|
|
2260
2344
|
const { activeElement: r, body: o } = e.ownerDocument, i = r === null || r === o;
|
|
2261
|
-
t instanceof HTMLElement && n && (i || e.contains(r)) &&
|
|
2262
|
-
},
|
|
2345
|
+
t instanceof HTMLElement && n && (i || e.contains(r)) && yn(t);
|
|
2346
|
+
}, da = (e) => {
|
|
2263
2347
|
const t = _(!1);
|
|
2264
|
-
return
|
|
2348
|
+
return j(() => {
|
|
2265
2349
|
const n = e.current;
|
|
2266
2350
|
if (n === null) throw new Error("[markdown-explorer] the document region is not mounted");
|
|
2267
2351
|
const r = n.ownerDocument, o = r.defaultView;
|
|
2268
2352
|
if (o === null) throw new Error("[markdown-explorer] the document region's document has no window");
|
|
2269
|
-
let i = !1,
|
|
2353
|
+
let i = !1, a;
|
|
2270
2354
|
const u = (g) => {
|
|
2271
|
-
i = !(g.target instanceof Node && n.contains(g.target)), i && !n.contains(r.activeElement) && (t.current = !1), clearTimeout(
|
|
2355
|
+
i = !(g.target instanceof Node && n.contains(g.target)), i && !n.contains(r.activeElement) && (t.current = !1), clearTimeout(a), a = setTimeout(() => {
|
|
2272
2356
|
i = !1;
|
|
2273
2357
|
}, 0);
|
|
2274
2358
|
}, m = (g) => {
|
|
2275
2359
|
t.current = g.target instanceof Node && n.contains(g.target);
|
|
2276
2360
|
}, f = (g) => {
|
|
2277
2361
|
g.relatedTarget === null && i && (t.current = !1);
|
|
2278
|
-
},
|
|
2279
|
-
const { activeElement: g, body:
|
|
2280
|
-
g !== null && g !==
|
|
2362
|
+
}, c = () => {
|
|
2363
|
+
const { activeElement: g, body: E } = r;
|
|
2364
|
+
g !== null && g !== E && (t.current = n.contains(g));
|
|
2281
2365
|
}, h = () => {
|
|
2282
2366
|
i && !n.contains(r.activeElement) && (t.current = !1);
|
|
2283
2367
|
};
|
|
2284
|
-
return o.addEventListener("pointerdown", u, !0), o.addEventListener("mousedown", u, !0), o.addEventListener("focusin", m, !0), o.addEventListener("blur",
|
|
2285
|
-
clearTimeout(
|
|
2368
|
+
return o.addEventListener("pointerdown", u, !0), o.addEventListener("mousedown", u, !0), o.addEventListener("focusin", m, !0), o.addEventListener("blur", c), o.addEventListener("focus", h), n.addEventListener("focusout", f), () => {
|
|
2369
|
+
clearTimeout(a), o.removeEventListener("pointerdown", u, !0), o.removeEventListener("mousedown", u, !0), o.removeEventListener("focusin", m, !0), o.removeEventListener("blur", c), o.removeEventListener("focus", h), n.removeEventListener("focusout", f);
|
|
2286
2370
|
};
|
|
2287
2371
|
}, [e]), t;
|
|
2288
|
-
},
|
|
2289
|
-
const { labels:
|
|
2372
|
+
}, ca = ({ path: e, snapshot: t, markup: n, stale: r, viewer: o, editLayout: i, regionLabel: a, navigation: u, fragment: m, paneScroll: f, announces: c, announceFailure: h, onDocumentShown: g }) => {
|
|
2373
|
+
const { labels: E, announcer: k, documents: R } = D(), { document: T } = t, A = _(null), L = _(null), b = _(null), w = _(0), l = da(A), s = _({ path: e, document: T }), v = _(null), O = P(
|
|
2290
2374
|
(Z) => {
|
|
2291
2375
|
const X = A.current, Q = qt(X, Z, f);
|
|
2292
|
-
X !== null && Q !== null &&
|
|
2376
|
+
X !== null && Q !== null && Zt(X, Q, l.current);
|
|
2293
2377
|
},
|
|
2294
|
-
[f,
|
|
2295
|
-
),
|
|
2378
|
+
[f, l]
|
|
2379
|
+
), M = P(
|
|
2296
2380
|
(Z, X) => {
|
|
2297
|
-
const Q =
|
|
2381
|
+
const Q = w.current;
|
|
2298
2382
|
setTimeout(() => {
|
|
2299
|
-
!X.defaultPrevented &&
|
|
2383
|
+
!X.defaultPrevented && w.current === Q && O(Z);
|
|
2300
2384
|
}, 0);
|
|
2301
2385
|
},
|
|
2302
|
-
[
|
|
2386
|
+
[O]
|
|
2303
2387
|
), N = P(
|
|
2304
2388
|
(Z) => {
|
|
2305
2389
|
setTimeout(() => {
|
|
2306
|
-
Z.defaultPrevented ||
|
|
2390
|
+
Z.defaultPrevented || O("#");
|
|
2307
2391
|
}, 0);
|
|
2308
2392
|
},
|
|
2309
|
-
[
|
|
2310
|
-
), q =
|
|
2393
|
+
[O]
|
|
2394
|
+
), q = U(() => ({ navigation: u, currentPath: e, scrollWithin: O, followSameUrlJump: M, followEmptyFragment: N }), [u, e, O, M, N]), W = P(() => R.retry(e), [R, e]), G = Ao(R, Mi), I = bn(e), J = I !== void 0 ? "edit" : n ? "markup" : "rendered", H = T.kind === "markdown" ? J : void 0, ne = P(() => A.current, []), p = U(() => ({ session: I, layout: i, region: ne, paneScroll: f, stale: r }), [I, i, ne, f, r]), S = H === "edit" ? !1 : r, x = re(he), C = H === "edit" && i === "fill" ? "fill" : x, F = ae((Z, X) => {
|
|
2311
2395
|
const Q = L.current;
|
|
2312
2396
|
if (Q !== null && Q.path === Z && Q.snapshot === X) return;
|
|
2313
2397
|
L.current = { path: Z, snapshot: X };
|
|
2314
2398
|
const oe = X.document;
|
|
2315
2399
|
if (oe.kind === "failure") {
|
|
2316
|
-
R.noteFailureShown(X) && h(
|
|
2400
|
+
R.noteFailureShown(X) && h(E.documentFailed(se(Z), le(E, oe.failure.reason)));
|
|
2317
2401
|
return;
|
|
2318
2402
|
}
|
|
2319
|
-
g?.(Z, oe),
|
|
2403
|
+
g?.(Z, oe), c && (Q === null || Q.path !== Z || Q.snapshot.document.kind === "failure") && k.announce(E.documentShown(oe.name));
|
|
2320
2404
|
});
|
|
2321
2405
|
te(() => {
|
|
2322
|
-
|
|
2406
|
+
F(e, t);
|
|
2323
2407
|
}, [e, t]);
|
|
2324
|
-
const
|
|
2408
|
+
const B = ae(() => {
|
|
2325
2409
|
m.kind === "panel" && m.consume();
|
|
2326
|
-
}), K =
|
|
2410
|
+
}), K = ae((Z) => {
|
|
2327
2411
|
const X = A.current;
|
|
2328
|
-
if (X === null || !
|
|
2412
|
+
if (X === null || !l.current) return null;
|
|
2329
2413
|
const { activeElement: Q, body: oe } = X.ownerDocument;
|
|
2330
|
-
return Q !== null && Q !== oe ? null :
|
|
2331
|
-
}),
|
|
2414
|
+
return Q !== null && Q !== oe ? null : sa(X, T, Z);
|
|
2415
|
+
}), V = ae((Z) => {
|
|
2332
2416
|
const X = A.current;
|
|
2333
|
-
X !== null &&
|
|
2334
|
-
}), ie =
|
|
2417
|
+
X !== null && Zt(X, Z, l.current);
|
|
2418
|
+
}), ie = ae((Z) => f.reveal(Z)), ht = ae((Z) => qt(A.current, Z, f));
|
|
2335
2419
|
return te(() => {
|
|
2336
2420
|
if (r) return;
|
|
2337
|
-
const Z = s.current.path !== e, X = Z || s.current.document !==
|
|
2338
|
-
s.current = { path: e, document:
|
|
2339
|
-
const Q =
|
|
2340
|
-
|
|
2421
|
+
const Z = s.current.path !== e, X = Z || s.current.document !== T;
|
|
2422
|
+
s.current = { path: e, document: T };
|
|
2423
|
+
const Q = v.current !== e;
|
|
2424
|
+
v.current = e;
|
|
2341
2425
|
let oe = null;
|
|
2342
|
-
m.kind === "page" ?
|
|
2426
|
+
m.kind === "page" ? b.current !== m.navigation && (b.current = m.navigation, w.current += 1, oe = m.fragment) : m.fragment !== null && (oe = m.fragment, B());
|
|
2343
2427
|
const pt = () => {
|
|
2344
2428
|
const He = oe === null ? null : ht(oe);
|
|
2345
2429
|
if (!X) {
|
|
2346
|
-
He !== null &&
|
|
2430
|
+
He !== null && V(He);
|
|
2347
2431
|
return;
|
|
2348
2432
|
}
|
|
2349
2433
|
const vt = K(m.fragment);
|
|
2350
2434
|
Z && He === null && vt !== null && ie(vt);
|
|
2351
2435
|
};
|
|
2352
2436
|
Q ? queueMicrotask(pt) : pt();
|
|
2353
|
-
}, [m, e,
|
|
2354
|
-
}, mt = Object.freeze({ kind: "skeleton" }),
|
|
2437
|
+
}, [m, e, T, r]), /* @__PURE__ */ d(he, { value: C, children: /* @__PURE__ */ d(ye, { kind: T.kind, view: H, label: a(e, T), stale: S, busy: S, frameRef: A, intent: G, children: /* @__PURE__ */ d(An, { value: q, children: /* @__PURE__ */ d(Oi, { children: /* @__PURE__ */ d(aa, { path: e, document: T, view: J, viewer: o, onRetry: W, editing: p }, e) }) }) }) });
|
|
2438
|
+
}, mt = Object.freeze({ kind: "skeleton" }), ua = (e, t, n, r, o) => {
|
|
2355
2439
|
if (t?.status === "loaded") return { kind: "document", path: e, snapshot: t, stale: !1 };
|
|
2356
2440
|
const i = ue(t);
|
|
2357
2441
|
if (i !== null) return { kind: "document", path: e, snapshot: i, stale: !0 };
|
|
2358
2442
|
if (o && t?.status === "pending") return { kind: "streaming", path: e, promise: t.promise };
|
|
2359
|
-
const
|
|
2360
|
-
return n === null ||
|
|
2361
|
-
},
|
|
2362
|
-
const o = t.kind === "streaming" ?
|
|
2363
|
-
return o.kind !== "document" ? /* @__PURE__ */
|
|
2364
|
-
},
|
|
2365
|
-
const { config:
|
|
2366
|
-
|
|
2367
|
-
|
|
2443
|
+
const a = n === null || n === e ? null : ue(r);
|
|
2444
|
+
return n === null || a === null ? mt : { kind: "document", path: n, snapshot: a, stale: !0 };
|
|
2445
|
+
}, fa = (e, t) => t.status === "deferred" ? mt : { kind: "document", path: e, snapshot: t, stale: !1 }, ma = ({ requestedPath: e, content: t, markup: n, ...r }) => {
|
|
2446
|
+
const o = t.kind === "streaming" ? fa(t.path, re(t.promise)) : t;
|
|
2447
|
+
return o.kind !== "document" ? /* @__PURE__ */ d(ut, { label: r.regionLabel(e, null) }) : /* @__PURE__ */ d(ca, { path: o.path, snapshot: o.snapshot, markup: n, stale: o.stale, ...r });
|
|
2448
|
+
}, Fn = ({ path: e, absence: t, markup: n, display: r, navigation: o, fragment: i, paneScroll: a, announces: u, announceFailure: m, onDocumentShown: f }) => {
|
|
2449
|
+
const { config: c, labels: h, locale: g, theme: E, documents: k } = D(), R = br(), T = _(!1);
|
|
2450
|
+
j(() => {
|
|
2451
|
+
T.current = !0;
|
|
2368
2452
|
}, []);
|
|
2369
|
-
const [
|
|
2370
|
-
|
|
2371
|
-
const
|
|
2372
|
-
|
|
2373
|
-
const
|
|
2374
|
-
|
|
2375
|
-
const
|
|
2453
|
+
const [A, L] = z(null), [b, w] = z(n), l = P(() => e === null ? void 0 : k.peek(e), [k, e]), s = ee(k.subscribe, l, l), v = P(() => A === null ? void 0 : k.peek(A), [k, A]), O = ee(k.subscribe, v, v);
|
|
2454
|
+
j(() => e === null ? void 0 : k.open(e), [k, e]), j(() => A === null ? void 0 : k.retain(A), [k, A]);
|
|
2455
|
+
const M = e === null ? mt : ua(e, s, A, O, !T.current), N = e === null ? null : M.kind === "document" && !M.stale ? M.path : A;
|
|
2456
|
+
N !== A && L(N);
|
|
2457
|
+
const q = M.kind !== "document" || M.path === e;
|
|
2458
|
+
q && n !== b && w(n);
|
|
2459
|
+
const W = U(() => Ji(h), [h]), G = U(() => [...c.iframeHosts], [c]), I = o.kind === "panel", J = U(
|
|
2376
2460
|
() => ({
|
|
2377
|
-
labels:
|
|
2461
|
+
labels: W,
|
|
2462
|
+
spreadsheetLocale: g,
|
|
2378
2463
|
emptyMessage: h.documentEmpty,
|
|
2379
|
-
theme:
|
|
2380
|
-
availableStyles:
|
|
2381
|
-
iFrameAllowedDomains:
|
|
2382
|
-
embeds:
|
|
2383
|
-
linkComponent:
|
|
2384
|
-
toolbar:
|
|
2464
|
+
theme: E,
|
|
2465
|
+
availableStyles: c.documentStyles,
|
|
2466
|
+
iFrameAllowedDomains: G,
|
|
2467
|
+
embeds: c.embeds,
|
|
2468
|
+
linkComponent: Fi,
|
|
2469
|
+
toolbar: R,
|
|
2385
2470
|
style: r.style,
|
|
2386
2471
|
onStyleChange: r.onStyleChange,
|
|
2387
2472
|
align: r.align,
|
|
@@ -2392,50 +2477,50 @@ const Hi = /* @__PURE__ */ y.forwardRef(ji), Vi = Object.freeze({ className: "aq
|
|
|
2392
2477
|
padding: r.padding,
|
|
2393
2478
|
width: r.width === void 0 ? void 0 : `min(${r.width}, 100%)`,
|
|
2394
2479
|
maxWidth: r.maxWidth === void 0 ? void 0 : `min(${r.maxWidth}, 100%)`,
|
|
2395
|
-
renderScrollBar:
|
|
2480
|
+
renderScrollBar: I ? void 0 : xn
|
|
2396
2481
|
}),
|
|
2397
|
-
[
|
|
2398
|
-
),
|
|
2399
|
-
return e === null ? /* @__PURE__ */
|
|
2400
|
-
|
|
2482
|
+
[W, g, h.documentEmpty, E, c.documentStyles, G, c.embeds, R, r, I]
|
|
2483
|
+
), H = P((p, S) => I ? S === null || S.kind === "failure" ? se(p) : S.name : h.documentRegion, [I, h.documentRegion]), ne = I ? "content" : "fill";
|
|
2484
|
+
return e === null ? /* @__PURE__ */ d(he, { value: ne, children: /* @__PURE__ */ d(ta, { absence: t, announces: u, announceFailure: m }) }) : /* @__PURE__ */ d(he, { value: ne, children: /* @__PURE__ */ d(ke, { fallback: /* @__PURE__ */ d(ut, { label: H(e, null) }), children: /* @__PURE__ */ d(
|
|
2485
|
+
ma,
|
|
2401
2486
|
{
|
|
2402
2487
|
requestedPath: e,
|
|
2403
|
-
content:
|
|
2404
|
-
markup:
|
|
2405
|
-
viewer:
|
|
2488
|
+
content: M,
|
|
2489
|
+
markup: q ? n : b,
|
|
2490
|
+
viewer: J,
|
|
2406
2491
|
editLayout: r.editLayout,
|
|
2407
|
-
regionLabel:
|
|
2492
|
+
regionLabel: H,
|
|
2408
2493
|
navigation: o,
|
|
2409
2494
|
fragment: i,
|
|
2410
|
-
paneScroll:
|
|
2495
|
+
paneScroll: a,
|
|
2411
2496
|
announces: u,
|
|
2412
2497
|
announceFailure: m,
|
|
2413
2498
|
onDocumentShown: f
|
|
2414
2499
|
}
|
|
2415
2500
|
) }) });
|
|
2416
|
-
},
|
|
2417
|
-
const { config: i, viewSettings:
|
|
2418
|
-
(
|
|
2501
|
+
}, ha = ({ path: e, absence: t, markup: n, variant: r, onDocumentShown: o }) => {
|
|
2502
|
+
const { config: i, viewSettings: a, announcer: u } = D(), m = Le((M) => M.style), f = Le((M) => M.align), c = $e(), h = nn(), g = at(), { view: E, overrides: k, embed: R } = r, T = P(
|
|
2503
|
+
(M) => {
|
|
2419
2504
|
if (g.kind !== "location") return;
|
|
2420
|
-
const N =
|
|
2421
|
-
N !== null &&
|
|
2505
|
+
const N = ea(i, g.location, M);
|
|
2506
|
+
N !== null && c(N, "browse");
|
|
2422
2507
|
},
|
|
2423
|
-
[i,
|
|
2508
|
+
[i, c, g]
|
|
2424
2509
|
), A = P(
|
|
2425
|
-
(
|
|
2426
|
-
|
|
2510
|
+
(M) => {
|
|
2511
|
+
a.update({ style: M }), T("style");
|
|
2427
2512
|
},
|
|
2428
|
-
[
|
|
2513
|
+
[a, T]
|
|
2429
2514
|
), L = P(
|
|
2430
|
-
(
|
|
2431
|
-
|
|
2515
|
+
(M) => {
|
|
2516
|
+
a.update({ align: M }), T("align");
|
|
2432
2517
|
},
|
|
2433
|
-
[
|
|
2434
|
-
),
|
|
2518
|
+
[a, T]
|
|
2519
|
+
), b = Nn(i, k.style, m), w = Dn(k.align, f), l = U(
|
|
2435
2520
|
() => ({
|
|
2436
|
-
style:
|
|
2521
|
+
style: b,
|
|
2437
2522
|
onStyleChange: A,
|
|
2438
|
-
align:
|
|
2523
|
+
align: w,
|
|
2439
2524
|
onAlignChange: L,
|
|
2440
2525
|
showToc: R.showToc !== !1,
|
|
2441
2526
|
showStyle: R.showStyle !== !1,
|
|
@@ -2445,29 +2530,29 @@ const Hi = /* @__PURE__ */ y.forwardRef(ji), Vi = Object.freeze({ className: "aq
|
|
|
2445
2530
|
maxWidth: R.maxWidth,
|
|
2446
2531
|
editLayout: "fill"
|
|
2447
2532
|
}),
|
|
2448
|
-
[
|
|
2449
|
-
), s =
|
|
2450
|
-
return /* @__PURE__ */
|
|
2451
|
-
},
|
|
2452
|
-
const { config: i, viewSettings:
|
|
2533
|
+
[b, A, w, L, R]
|
|
2534
|
+
), s = U(() => ({ kind: "page", view: E, overrides: k, embed: R }), [E, k, R]), v = U(() => ({ kind: "page", fragment: h.hash, navigation: h }), [h]), O = P((M) => u.announce(M), [u]);
|
|
2535
|
+
return /* @__PURE__ */ d(Fn, { path: e, absence: t, markup: n, display: l, navigation: s, fragment: v, paneScroll: ai, announces: !0, announceFailure: O, onDocumentShown: o });
|
|
2536
|
+
}, pa = ({ path: e, absence: t, markup: n, variant: r, onDocumentShown: o }) => {
|
|
2537
|
+
const { config: i, viewSettings: a } = D(), u = Le((s) => s.style), m = Le((s) => s.align), [f, c] = z(() => Nn(i, void 0, u)), h = Dn(void 0, m), g = P((s) => a.update({ align: s }), [a]), { maximized: E, onDocumentLink: k, pendingHash: R, onHashConsumed: T, announceFailure: A, paneScroll: L } = r, b = U(
|
|
2453
2538
|
() => ({
|
|
2454
2539
|
style: f,
|
|
2455
|
-
onStyleChange:
|
|
2540
|
+
onStyleChange: c,
|
|
2456
2541
|
align: h,
|
|
2457
2542
|
onAlignChange: g,
|
|
2458
|
-
showToc:
|
|
2459
|
-
showStyle:
|
|
2460
|
-
showAlign:
|
|
2543
|
+
showToc: E,
|
|
2544
|
+
showStyle: E,
|
|
2545
|
+
showAlign: E,
|
|
2461
2546
|
padding: void 0,
|
|
2462
2547
|
width: void 0,
|
|
2463
2548
|
maxWidth: void 0,
|
|
2464
|
-
editLayout:
|
|
2549
|
+
editLayout: E ? "fill" : "content"
|
|
2465
2550
|
}),
|
|
2466
|
-
[f, h, g,
|
|
2467
|
-
),
|
|
2468
|
-
return /* @__PURE__ */
|
|
2469
|
-
},
|
|
2470
|
-
function
|
|
2551
|
+
[f, h, g, E]
|
|
2552
|
+
), w = U(() => ({ kind: "panel", onDocumentLink: k }), [k]), l = U(() => ({ kind: "panel", fragment: R, consume: T }), [R, T]);
|
|
2553
|
+
return /* @__PURE__ */ d(Fn, { path: e, absence: t, markup: n, display: b, navigation: w, fragment: l, paneScroll: L, announces: !1, announceFailure: A, onDocumentShown: o });
|
|
2554
|
+
}, va = ({ path: e, absence: t, markup: n, variant: r, onDocumentShown: o }) => r.kind === "page" ? /* @__PURE__ */ d(ha, { path: e, absence: t, markup: n, variant: r, onDocumentShown: o }) : /* @__PURE__ */ d(pa, { path: e, absence: t, markup: n, variant: r, onDocumentShown: o });
|
|
2555
|
+
function wa({
|
|
2471
2556
|
title: e,
|
|
2472
2557
|
titleId: t,
|
|
2473
2558
|
...n
|
|
@@ -2488,8 +2573,8 @@ function wl({
|
|
|
2488
2573
|
clipRule: "evenodd"
|
|
2489
2574
|
}));
|
|
2490
2575
|
}
|
|
2491
|
-
const
|
|
2492
|
-
function
|
|
2576
|
+
const ga = /* @__PURE__ */ y.forwardRef(wa);
|
|
2577
|
+
function ba({
|
|
2493
2578
|
title: e,
|
|
2494
2579
|
titleId: t,
|
|
2495
2580
|
...n
|
|
@@ -2510,8 +2595,8 @@ function bl({
|
|
|
2510
2595
|
clipRule: "evenodd"
|
|
2511
2596
|
}));
|
|
2512
2597
|
}
|
|
2513
|
-
const
|
|
2514
|
-
function
|
|
2598
|
+
const $n = /* @__PURE__ */ y.forwardRef(ba);
|
|
2599
|
+
function Ea({
|
|
2515
2600
|
title: e,
|
|
2516
2601
|
titleId: t,
|
|
2517
2602
|
...n
|
|
@@ -2532,8 +2617,8 @@ function El({
|
|
|
2532
2617
|
clipRule: "evenodd"
|
|
2533
2618
|
}));
|
|
2534
2619
|
}
|
|
2535
|
-
const
|
|
2536
|
-
function
|
|
2620
|
+
const Sa = /* @__PURE__ */ y.forwardRef(Ea);
|
|
2621
|
+
function ya({
|
|
2537
2622
|
title: e,
|
|
2538
2623
|
titleId: t,
|
|
2539
2624
|
...n
|
|
@@ -2558,8 +2643,8 @@ function xl({
|
|
|
2558
2643
|
clipRule: "evenodd"
|
|
2559
2644
|
}));
|
|
2560
2645
|
}
|
|
2561
|
-
const
|
|
2562
|
-
function
|
|
2646
|
+
const xa = /* @__PURE__ */ y.forwardRef(ya);
|
|
2647
|
+
function ka({
|
|
2563
2648
|
title: e,
|
|
2564
2649
|
titleId: t,
|
|
2565
2650
|
...n
|
|
@@ -2580,8 +2665,8 @@ function kl({
|
|
|
2580
2665
|
clipRule: "evenodd"
|
|
2581
2666
|
}));
|
|
2582
2667
|
}
|
|
2583
|
-
const
|
|
2584
|
-
function
|
|
2668
|
+
const Ta = /* @__PURE__ */ y.forwardRef(ka);
|
|
2669
|
+
function Ra({
|
|
2585
2670
|
title: e,
|
|
2586
2671
|
titleId: t,
|
|
2587
2672
|
...n
|
|
@@ -2604,8 +2689,8 @@ function Rl({
|
|
|
2604
2689
|
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"
|
|
2605
2690
|
}));
|
|
2606
2691
|
}
|
|
2607
|
-
const
|
|
2608
|
-
function
|
|
2692
|
+
const Oa = /* @__PURE__ */ y.forwardRef(Ra);
|
|
2693
|
+
function Ca({
|
|
2609
2694
|
title: e,
|
|
2610
2695
|
titleId: t,
|
|
2611
2696
|
...n
|
|
@@ -2628,8 +2713,8 @@ function Ol({
|
|
|
2628
2713
|
clipRule: "evenodd"
|
|
2629
2714
|
}));
|
|
2630
2715
|
}
|
|
2631
|
-
const
|
|
2632
|
-
function
|
|
2716
|
+
const Ma = /* @__PURE__ */ y.forwardRef(Ca);
|
|
2717
|
+
function Aa({
|
|
2633
2718
|
title: e,
|
|
2634
2719
|
titleId: t,
|
|
2635
2720
|
...n
|
|
@@ -2650,8 +2735,8 @@ function Ll({
|
|
|
2650
2735
|
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"
|
|
2651
2736
|
}));
|
|
2652
2737
|
}
|
|
2653
|
-
const
|
|
2654
|
-
function
|
|
2738
|
+
const La = /* @__PURE__ */ y.forwardRef(Aa);
|
|
2739
|
+
function Na({
|
|
2655
2740
|
title: e,
|
|
2656
2741
|
titleId: t,
|
|
2657
2742
|
...n
|
|
@@ -2670,112 +2755,112 @@ function Nl({
|
|
|
2670
2755
|
d: "M15 3.75H9v16.5h6V3.75ZM16.5 20.25h3.375c1.035 0 1.875-.84 1.875-1.875V5.625c0-1.036-.84-1.875-1.875-1.875H16.5v16.5ZM4.125 3.75H7.5v16.5H4.125a1.875 1.875 0 0 1-1.875-1.875V5.625c0-1.036.84-1.875 1.875-1.875Z"
|
|
2671
2756
|
}));
|
|
2672
2757
|
}
|
|
2673
|
-
const
|
|
2674
|
-
const { labels: r, onEditGrant: o } = D(), [i,
|
|
2675
|
-
o === void 0 || i || (
|
|
2758
|
+
const Da = /* @__PURE__ */ y.forwardRef(Na), Pa = ({ href: e, onRetry: t, testId: n }) => {
|
|
2759
|
+
const { labels: r, onEditGrant: o } = D(), [i, a] = z(!1), u = () => {
|
|
2760
|
+
o === void 0 || i || (a(!0), o(e).then((m) => {
|
|
2676
2761
|
m && t();
|
|
2677
|
-
}).finally(() =>
|
|
2762
|
+
}).finally(() => a(!1)));
|
|
2678
2763
|
};
|
|
2679
|
-
return /* @__PURE__ */
|
|
2680
|
-
/* @__PURE__ */
|
|
2681
|
-
/* @__PURE__ */
|
|
2682
|
-
/* @__PURE__ */
|
|
2683
|
-
o === void 0 ? /* @__PURE__ */
|
|
2684
|
-
/* @__PURE__ */
|
|
2764
|
+
return /* @__PURE__ */ $("div", { className: "aqmx-callout aqmx-edit-grant", "data-testid": n, children: [
|
|
2765
|
+
/* @__PURE__ */ d("p", { className: "aqmx-callout-title", children: r.editGrantTitle }),
|
|
2766
|
+
/* @__PURE__ */ d("p", { className: "aqmx-callout-body", children: r.editGrantBody }),
|
|
2767
|
+
/* @__PURE__ */ $("div", { className: "aqmx-edit-grant-actions", children: [
|
|
2768
|
+
o === void 0 ? /* @__PURE__ */ d("a", { className: "aqmx-callout-action", href: e, target: "_blank", rel: "noopener", "data-testid": `${n}-open`, children: r.editGrantAction }) : (
|
|
2769
|
+
/* @__PURE__ */ d("button", { type: "button", className: "aqmx-callout-action", "aria-disabled": i, "data-testid": `${n}-open`, onClick: u, children: r.editGrantAction })
|
|
2685
2770
|
),
|
|
2686
|
-
/* @__PURE__ */
|
|
2771
|
+
/* @__PURE__ */ d("button", { type: "button", className: "aqmx-callout-action", "data-testid": `${n}-retry`, onClick: t, children: r.editGrantRetry })
|
|
2687
2772
|
] })
|
|
2688
2773
|
] });
|
|
2689
|
-
},
|
|
2774
|
+
}, Fa = "Control+E Meta+E", $a = (e, t, n) => n && t ? "split" : e.view, Ut = (e, t, n, r) => {
|
|
2690
2775
|
if (n === "split") {
|
|
2691
2776
|
e.setSideBySide(!0);
|
|
2692
2777
|
return;
|
|
2693
2778
|
}
|
|
2694
2779
|
e.setView(t, n), r && e.sideBySide() && e.setSideBySide(!1);
|
|
2695
|
-
},
|
|
2780
|
+
}, Jl = (e) => e === "split" ? null : e, qa = (e) => e === "preview" ? "editor" : "preview", _a = (e) => /Mac|iPhone|iPad|iPod/u.test(e), Ia = (e, t) => {
|
|
2696
2781
|
if (e.isComposing || e.altKey || e.shiftKey || (t ? !e.metaKey || e.ctrlKey : !e.ctrlKey || e.metaKey)) return !1;
|
|
2697
2782
|
const n = e.key.toLowerCase();
|
|
2698
2783
|
return n === "e" || e.code === "KeyE" && /^\p{L}$/u.test(n) && !/^[a-z]$/u.test(n);
|
|
2699
2784
|
}, Gt = (e, t, n) => {
|
|
2700
2785
|
const r = e.modifiedAt === null ? Number.NaN : Date.parse(e.modifiedAt);
|
|
2701
2786
|
return n(Number.isNaN(r) ? e.id : t.format(r), e.author === null ? "" : e.author);
|
|
2702
|
-
},
|
|
2703
|
-
const { data: o, edits: i, labels:
|
|
2787
|
+
}, Ba = ({ path: e, documentName: t, open: n, onClose: r }) => {
|
|
2788
|
+
const { data: o, edits: i, labels: a, locale: u, announcer: m } = D(), f = xe(), [c, h] = z(null), [g, E] = z(0), [k, R] = z(null), [T, A] = z(null), L = U(() => new Intl.DateTimeFormat(u, { dateStyle: "medium", timeStyle: "short" }), [u]), b = P(() => {
|
|
2704
2789
|
R(null), A(null);
|
|
2705
|
-
}, []),
|
|
2790
|
+
}, []), w = vn({ open: n, onOpen: b, onDismiss: r });
|
|
2706
2791
|
te(() => {
|
|
2707
2792
|
if (!n) return;
|
|
2708
|
-
const
|
|
2709
|
-
return h(null), o.revisions(e,
|
|
2710
|
-
"kind" in
|
|
2711
|
-
}), () =>
|
|
2793
|
+
const v = new AbortController();
|
|
2794
|
+
return h(null), o.revisions(e, v.signal).then((O) => {
|
|
2795
|
+
"kind" in O && h(O);
|
|
2796
|
+
}), () => v.abort();
|
|
2712
2797
|
}, [n, o, e, g]), te(() => {
|
|
2713
|
-
if (!n ||
|
|
2714
|
-
const
|
|
2715
|
-
return A(null), o.revision(e,
|
|
2716
|
-
"kind" in
|
|
2717
|
-
}), () =>
|
|
2718
|
-
}, [n, o, e,
|
|
2719
|
-
const
|
|
2720
|
-
|
|
2721
|
-
}, s =
|
|
2722
|
-
return /* @__PURE__ */
|
|
2723
|
-
/* @__PURE__ */
|
|
2724
|
-
|
|
2725
|
-
/* @__PURE__ */
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
] }) },
|
|
2729
|
-
|
|
2730
|
-
/* @__PURE__ */
|
|
2798
|
+
if (!n || k === null) return;
|
|
2799
|
+
const v = new AbortController();
|
|
2800
|
+
return A(null), o.revision(e, k, v.signal).then((O) => {
|
|
2801
|
+
"kind" in O && A(O);
|
|
2802
|
+
}), () => v.abort();
|
|
2803
|
+
}, [n, o, e, k]);
|
|
2804
|
+
const l = () => {
|
|
2805
|
+
T === null || T.kind !== "revision" || (i.replaceDraft(e, T.text), m.announce(a.historyRestored(t)), r());
|
|
2806
|
+
}, s = c !== null && c.kind === "revisions" ? c.revisions.find((v) => v.id === k) : void 0;
|
|
2807
|
+
return /* @__PURE__ */ d("dialog", { ...w, className: "aqmx-confirm aqmx-history", "aria-labelledby": f, "data-testid": "markdown-explorer-history", children: /* @__PURE__ */ $("div", { className: "aqmx-confirm-panel aqmx-history-panel", children: [
|
|
2808
|
+
/* @__PURE__ */ d("p", { id: f, className: "aqmx-confirm-title", children: a.historyTitle(t) }),
|
|
2809
|
+
c === null ? /* @__PURE__ */ d("p", { className: "aqmx-history-note", "data-testid": "markdown-explorer-history-loading", children: a.historyLoading }) : c.kind === "failure" ? /* @__PURE__ */ d(me, { failure: c.failure, alert: !1, onRetry: () => E((v) => v + 1), testId: "markdown-explorer-history-failure" }) : c.revisions.length === 0 ? /* @__PURE__ */ d("p", { className: "aqmx-history-note", "data-testid": "markdown-explorer-history-empty", children: a.historyEmpty }) : /* @__PURE__ */ d("ul", { className: "aqmx-history-list", "data-testid": "markdown-explorer-history-list", children: c.revisions.map((v) => /* @__PURE__ */ d("li", { children: /* @__PURE__ */ $("button", { type: "button", className: "aqmx-history-entry", "aria-pressed": v.id === k, "data-testid": "markdown-explorer-history-entry", onClick: () => R(v.id), children: [
|
|
2810
|
+
/* @__PURE__ */ d("span", { children: Gt(v, L, a.historyEntry) }),
|
|
2811
|
+
v.current ? /* @__PURE__ */ d("span", { className: "aqmx-history-mark", children: a.historyCurrent }) : null,
|
|
2812
|
+
v.kept ? /* @__PURE__ */ d("span", { className: "aqmx-history-mark", children: a.historyKept }) : null
|
|
2813
|
+
] }) }, v.id)) }),
|
|
2814
|
+
k === null ? null : T === null ? /* @__PURE__ */ d("p", { className: "aqmx-history-note", children: a.historyLoading }) : T.kind === "failure" ? /* @__PURE__ */ d(me, { failure: T.failure, alert: !1, testId: "markdown-explorer-history-revision-failure" }) : (
|
|
2815
|
+
/* @__PURE__ */ d("section", { className: "aqmx-history-text", tabIndex: 0, "aria-label": s === void 0 ? a.historyTitle(t) : Gt(s, L, a.historyEntry), "data-testid": "markdown-explorer-history-text", children: /* @__PURE__ */ d("pre", { children: T.text }) })
|
|
2731
2816
|
),
|
|
2732
|
-
/* @__PURE__ */
|
|
2733
|
-
/* @__PURE__ */
|
|
2734
|
-
/* @__PURE__ */
|
|
2817
|
+
/* @__PURE__ */ $("div", { className: "aqmx-confirm-actions", children: [
|
|
2818
|
+
/* @__PURE__ */ d("button", { type: "button", className: "aqmx-callout-action", "data-testid": "markdown-explorer-history-close", onClick: r, children: a.historyClose }),
|
|
2819
|
+
/* @__PURE__ */ d("button", { type: "button", className: "aqmx-callout-action", "aria-disabled": T === null || T.kind !== "revision", "data-testid": "markdown-explorer-history-restore", onClick: l, children: a.historyRestore })
|
|
2735
2820
|
] })
|
|
2736
2821
|
] }) });
|
|
2737
|
-
},
|
|
2822
|
+
}, za = (e) => {
|
|
2738
2823
|
const { documents: t } = D(), n = P(() => t.peek(e), [t, e]), r = P(() => t.peekSeeded(e), [t, e]), o = ee(t.subscribe, n, r), i = ue(o)?.document;
|
|
2739
2824
|
return i === void 0 || i.kind === "failure" ? { edit: null, name: se(e) } : { edit: i.kind === "markdown" ? i.edit : null, name: i.name };
|
|
2740
|
-
},
|
|
2825
|
+
}, de = (e) => {
|
|
2741
2826
|
e.stopPropagation();
|
|
2742
|
-
},
|
|
2743
|
-
const { draftConverter: i, edits:
|
|
2744
|
-
|
|
2745
|
-
() =>
|
|
2827
|
+
}, ja = ({ path: e, documentName: t, iconOnly: n, previewAvailable: r, draft: o }) => {
|
|
2828
|
+
const { draftConverter: i, edits: a, labels: u } = D(), m = ee(
|
|
2829
|
+
a.subscribe,
|
|
2830
|
+
() => a.session(e) !== void 0,
|
|
2746
2831
|
() => !1
|
|
2747
|
-
), [f,
|
|
2832
|
+
), [f, c] = z(null), h = () => {
|
|
2748
2833
|
if (!m) {
|
|
2749
|
-
|
|
2834
|
+
a.start(e, a.viewAnchor(e));
|
|
2750
2835
|
return;
|
|
2751
2836
|
}
|
|
2752
|
-
|
|
2753
|
-
const R =
|
|
2754
|
-
R?.dirty === !0 ?
|
|
2837
|
+
a.flush(e);
|
|
2838
|
+
const R = a.session(e);
|
|
2839
|
+
R?.dirty === !0 ? c(R.save.kind === "draft" ? "draft" : "unsaved") : a.close(e);
|
|
2755
2840
|
}, g = () => {
|
|
2756
|
-
m || (fo(), r &&
|
|
2757
|
-
},
|
|
2758
|
-
return /* @__PURE__ */
|
|
2759
|
-
/* @__PURE__ */
|
|
2841
|
+
m || (fo(), r && a.sideBySide() && i?.prepare?.());
|
|
2842
|
+
}, E = n ? o ? u.editDraftDocumentNamed(t) : u.editDocumentNamed(t) : null, k = o ? u.editDraftDocument : u.editDocument;
|
|
2843
|
+
return /* @__PURE__ */ $(Pe, { children: [
|
|
2844
|
+
/* @__PURE__ */ $(
|
|
2760
2845
|
"button",
|
|
2761
2846
|
{
|
|
2762
2847
|
type: "button",
|
|
2763
|
-
className:
|
|
2764
|
-
title: m ? u.closeEditor :
|
|
2765
|
-
"aria-label":
|
|
2848
|
+
className: E === null ? "aqmx-icon-button aqmx-labelled-button" : "aqmx-icon-button",
|
|
2849
|
+
title: m ? u.closeEditor : E === null ? k : E,
|
|
2850
|
+
"aria-label": E === null ? void 0 : E,
|
|
2766
2851
|
"aria-pressed": m,
|
|
2767
2852
|
"data-testid": "markdown-explorer-document-edit",
|
|
2768
2853
|
onClick: h,
|
|
2769
|
-
onDoubleClick:
|
|
2854
|
+
onDoubleClick: de,
|
|
2770
2855
|
onPointerEnter: g,
|
|
2771
2856
|
onFocus: g,
|
|
2772
2857
|
children: [
|
|
2773
|
-
/* @__PURE__ */
|
|
2774
|
-
|
|
2858
|
+
/* @__PURE__ */ d(La, { "aria-hidden": "true" }),
|
|
2859
|
+
E === null ? /* @__PURE__ */ d("span", { children: u.editDocumentLabel }) : null
|
|
2775
2860
|
]
|
|
2776
2861
|
}
|
|
2777
2862
|
),
|
|
2778
|
-
/* @__PURE__ */
|
|
2863
|
+
/* @__PURE__ */ d(
|
|
2779
2864
|
wn,
|
|
2780
2865
|
{
|
|
2781
2866
|
open: f !== null,
|
|
@@ -2785,15 +2870,15 @@ const Dl = /* @__PURE__ */ y.forwardRef(Nl), Pl = ({ href: e, onRetry: t, testId
|
|
|
2785
2870
|
cancelLabel: u.unsavedStay,
|
|
2786
2871
|
testId: "markdown-explorer-edit-close-confirm",
|
|
2787
2872
|
onConfirm: () => {
|
|
2788
|
-
|
|
2873
|
+
c(null), a.close(e);
|
|
2789
2874
|
},
|
|
2790
|
-
onCancel: () =>
|
|
2875
|
+
onCancel: () => c(null)
|
|
2791
2876
|
}
|
|
2792
2877
|
)
|
|
2793
2878
|
] });
|
|
2794
|
-
},
|
|
2879
|
+
}, Ha = ({ href: e, documentName: t, iconOnly: n }) => {
|
|
2795
2880
|
const { labels: r } = D(), o = n ? r.editExternallyNamed(t) : null;
|
|
2796
|
-
return /* @__PURE__ */
|
|
2881
|
+
return /* @__PURE__ */ $(
|
|
2797
2882
|
"a",
|
|
2798
2883
|
{
|
|
2799
2884
|
className: o === null ? "aqmx-icon-button aqmx-labelled-button" : "aqmx-icon-button",
|
|
@@ -2803,126 +2888,126 @@ const Dl = /* @__PURE__ */ y.forwardRef(Nl), Pl = ({ href: e, onRetry: t, testId
|
|
|
2803
2888
|
title: o === null ? r.editExternally : o,
|
|
2804
2889
|
"aria-label": o === null ? void 0 : o,
|
|
2805
2890
|
"data-testid": "markdown-explorer-document-edit-external",
|
|
2806
|
-
onDoubleClick:
|
|
2891
|
+
onDoubleClick: de,
|
|
2807
2892
|
children: [
|
|
2808
|
-
/* @__PURE__ */
|
|
2809
|
-
o === null ? /* @__PURE__ */
|
|
2893
|
+
/* @__PURE__ */ d(Sa, { "aria-hidden": "true" }),
|
|
2894
|
+
o === null ? /* @__PURE__ */ d("span", { children: r.editExternallyLabel }) : null
|
|
2810
2895
|
]
|
|
2811
2896
|
}
|
|
2812
2897
|
);
|
|
2813
|
-
},
|
|
2898
|
+
}, Va = ({ session: e }) => {
|
|
2814
2899
|
const { labels: t } = D(), n = Pr(t, e);
|
|
2815
|
-
return /* @__PURE__ */
|
|
2816
|
-
},
|
|
2817
|
-
const { draftConverter: i, edits:
|
|
2900
|
+
return /* @__PURE__ */ d("p", { className: "aqmx-edit-status", title: n === "" ? void 0 : n, "data-testid": "markdown-explorer-edit-status", "data-aqmx-save": e.save.kind, children: n });
|
|
2901
|
+
}, Za = Object.freeze(["editor", "split", "preview"]), Ua = Object.freeze(["editor", "preview"]), Ga = Object.freeze({ editor: $n, split: Da, preview: Ma }), Wa = ({ path: e, documentName: t, iconOnly: n, session: r, previewAvailable: o }) => {
|
|
2902
|
+
const { draftConverter: i, edits: a, labels: u } = D(), m = ao(), f = $a(r, m, o), c = o ? Za : Ua, h = xe(), g = _(/* @__PURE__ */ new Map()), E = {
|
|
2818
2903
|
editor: { label: u.editViewEditor, tooltip: u.editViewEditorTooltip },
|
|
2819
2904
|
split: { label: u.editViewSplit, tooltip: u.editViewSplitTooltip },
|
|
2820
2905
|
preview: { label: u.editViewPreview, tooltip: u.editViewPreviewTooltip }
|
|
2821
|
-
},
|
|
2822
|
-
|
|
2823
|
-
}, R = (
|
|
2824
|
-
if (!
|
|
2825
|
-
hn(
|
|
2826
|
-
const A =
|
|
2827
|
-
|
|
2906
|
+
}, k = () => {
|
|
2907
|
+
a.preparePreview(e), i?.prepare?.();
|
|
2908
|
+
}, R = (T) => {
|
|
2909
|
+
if (!Ia(T.nativeEvent, _a(navigator.platform))) return;
|
|
2910
|
+
hn(T);
|
|
2911
|
+
const A = qa(f);
|
|
2912
|
+
Ut(a, e, A, o), g.current.get(A)?.focus();
|
|
2828
2913
|
};
|
|
2829
|
-
return /* @__PURE__ */
|
|
2830
|
-
const A =
|
|
2831
|
-
return /* @__PURE__ */
|
|
2832
|
-
/* @__PURE__ */
|
|
2914
|
+
return /* @__PURE__ */ d("div", { role: "radiogroup", "aria-label": n ? u.editViewNamed(t) : u.editView, className: "aqmx-edit-view", "data-testid": "markdown-explorer-edit-view", onKeyDown: R, children: c.map((T) => {
|
|
2915
|
+
const A = Ga[T], { label: L, tooltip: b } = E[T], w = T === "preview" ? k : void 0;
|
|
2916
|
+
return /* @__PURE__ */ $("label", { className: n ? "aqmx-icon-button" : "aqmx-icon-button aqmx-labelled-button", children: [
|
|
2917
|
+
/* @__PURE__ */ d(
|
|
2833
2918
|
"input",
|
|
2834
2919
|
{
|
|
2835
|
-
ref: (
|
|
2836
|
-
|
|
2920
|
+
ref: (l) => {
|
|
2921
|
+
l === null ? g.current.delete(T) : g.current.set(T, l);
|
|
2837
2922
|
},
|
|
2838
2923
|
type: "radio",
|
|
2839
2924
|
name: h,
|
|
2840
|
-
value:
|
|
2841
|
-
checked:
|
|
2925
|
+
value: T,
|
|
2926
|
+
checked: T === f,
|
|
2842
2927
|
"aria-label": L,
|
|
2843
|
-
"aria-keyshortcuts":
|
|
2844
|
-
title:
|
|
2845
|
-
"data-testid": `markdown-explorer-edit-view-${
|
|
2846
|
-
onChange: () =>
|
|
2847
|
-
onDoubleClick:
|
|
2848
|
-
onPointerEnter:
|
|
2849
|
-
onFocus:
|
|
2928
|
+
"aria-keyshortcuts": T === "split" ? void 0 : Fa,
|
|
2929
|
+
title: b,
|
|
2930
|
+
"data-testid": `markdown-explorer-edit-view-${T}`,
|
|
2931
|
+
onChange: () => Ut(a, e, T, o),
|
|
2932
|
+
onDoubleClick: de,
|
|
2933
|
+
onPointerEnter: w,
|
|
2934
|
+
onFocus: w
|
|
2850
2935
|
}
|
|
2851
2936
|
),
|
|
2852
|
-
/* @__PURE__ */
|
|
2853
|
-
n ? null : /* @__PURE__ */
|
|
2854
|
-
] },
|
|
2937
|
+
/* @__PURE__ */ d(A, { "aria-hidden": "true" }),
|
|
2938
|
+
n ? null : /* @__PURE__ */ d("span", { children: L })
|
|
2939
|
+
] }, T);
|
|
2855
2940
|
}) });
|
|
2856
|
-
},
|
|
2857
|
-
const { edits: i, labels:
|
|
2941
|
+
}, Ka = ({ path: e, documentName: t, iconOnly: n, session: r, previewAvailable: o }) => {
|
|
2942
|
+
const { edits: i, labels: a } = D(), [u, m] = z(!1);
|
|
2858
2943
|
if (r.phase.kind !== "editing") return null;
|
|
2859
|
-
const f = r.save.kind === "saving",
|
|
2944
|
+
const f = r.save.kind === "saving", c = f || !r.dirty, h = () => {
|
|
2860
2945
|
i.flush(e);
|
|
2861
|
-
const
|
|
2862
|
-
|
|
2863
|
-
}, g = (
|
|
2864
|
-
return /* @__PURE__ */
|
|
2865
|
-
r.save.kind === "conflicts" ? /* @__PURE__ */
|
|
2866
|
-
/* @__PURE__ */
|
|
2867
|
-
n ? null : /* @__PURE__ */
|
|
2946
|
+
const E = i.session(e);
|
|
2947
|
+
E === void 0 || !E.dirty || E.save.kind === "saving" || i.save(e);
|
|
2948
|
+
}, g = (E) => n ? { className: "aqmx-icon-button", "aria-label": E } : { className: "aqmx-icon-button aqmx-labelled-button" };
|
|
2949
|
+
return /* @__PURE__ */ $(Pe, { children: [
|
|
2950
|
+
r.save.kind === "conflicts" ? /* @__PURE__ */ $("button", { type: "button", ...g(a.conflictNext), title: a.conflictNext, "data-testid": "markdown-explorer-edit-next-conflict", onClick: () => i.nextConflict(e), onDoubleClick: de, children: [
|
|
2951
|
+
/* @__PURE__ */ d(xa, { "aria-hidden": "true" }),
|
|
2952
|
+
n ? null : /* @__PURE__ */ d("span", { children: a.conflictNext })
|
|
2868
2953
|
] }) : null,
|
|
2869
|
-
/* @__PURE__ */
|
|
2870
|
-
r.history ? /* @__PURE__ */
|
|
2871
|
-
/* @__PURE__ */
|
|
2872
|
-
n ? null : /* @__PURE__ */
|
|
2954
|
+
/* @__PURE__ */ d(Wa, { path: e, documentName: t, iconOnly: n, session: r, previewAvailable: o }),
|
|
2955
|
+
r.history ? /* @__PURE__ */ $("button", { type: "button", ...g(a.historyOpen), title: a.historyOpen, "aria-haspopup": "dialog", "data-testid": "markdown-explorer-edit-history", onClick: () => m(!0), onDoubleClick: de, children: [
|
|
2956
|
+
/* @__PURE__ */ d(Ta, { "aria-hidden": "true" }),
|
|
2957
|
+
n ? null : /* @__PURE__ */ d("span", { children: a.historyOpen })
|
|
2873
2958
|
] }) : null,
|
|
2874
|
-
r.save.kind === "draft" ? null : /* @__PURE__ */
|
|
2875
|
-
/* @__PURE__ */
|
|
2876
|
-
n ? null : /* @__PURE__ */
|
|
2959
|
+
r.save.kind === "draft" ? null : /* @__PURE__ */ $("button", { type: "button", ...g(a.saveDraft), title: a.saveDraftTooltip, "aria-disabled": c, "aria-busy": f, "aria-keyshortcuts": "Control+S Meta+S", "data-testid": "markdown-explorer-edit-save", onClick: h, onDoubleClick: de, children: [
|
|
2960
|
+
/* @__PURE__ */ d(Oa, { "aria-hidden": "true" }),
|
|
2961
|
+
n ? null : /* @__PURE__ */ d("span", { children: a.saveDraft })
|
|
2877
2962
|
] }),
|
|
2878
|
-
r.history ? /* @__PURE__ */
|
|
2963
|
+
r.history ? /* @__PURE__ */ d(Ba, { path: e, documentName: t, open: u, onClose: () => m(!1) }) : null
|
|
2879
2964
|
] });
|
|
2880
|
-
},
|
|
2965
|
+
}, Xa = ({ path: e, session: t }) => {
|
|
2881
2966
|
const { edits: n } = D();
|
|
2882
|
-
return t.save.kind !== "grant" ? null : /* @__PURE__ */
|
|
2967
|
+
return t.save.kind !== "grant" ? null : /* @__PURE__ */ d(Pa, { href: t.save.href, onRetry: () => {
|
|
2883
2968
|
n.save(e);
|
|
2884
2969
|
}, testId: "markdown-explorer-save-grant" });
|
|
2885
|
-
},
|
|
2970
|
+
}, Ya = (e) => {
|
|
2886
2971
|
const { documents: t } = D(), n = P(() => t.peek(e), [t, e]), r = P(() => t.peekSeeded(e), [t, e]), o = ee(t.subscribe, n, r);
|
|
2887
2972
|
return ue(o)?.document.kind === "markdown";
|
|
2888
|
-
},
|
|
2889
|
-
const { config: t } = D(), n =
|
|
2890
|
-
return
|
|
2891
|
-
},
|
|
2892
|
-
const { documents: n, announcer: r, labels: o } = D(), i = P(() => n.peek(e), [n, e]),
|
|
2893
|
-
|
|
2973
|
+
}, Ja = (e) => {
|
|
2974
|
+
const { config: t } = D(), n = $e(), r = P(() => n(Se(t, { ...e, markup: !e.markup }), "browse"), [t, n, e]);
|
|
2975
|
+
return U(() => ({ shown: e.markup, toggle: r }), [e.markup, r]);
|
|
2976
|
+
}, Qa = /* @__PURE__ */ new Set(), el = (e, t) => {
|
|
2977
|
+
const { documents: n, announcer: r, labels: o } = D(), i = P(() => n.peek(e), [n, e]), a = P(() => n.peekSeeded(e), [n, e]), u = ee(n.subscribe, i, a), m = P(() => n.answerStampOf(e), [n, e]), f = ee(n.subscribe, m, m), [c] = z(() => /* @__PURE__ */ new Set()), [h, g] = z(Qa), [E, k] = z(null);
|
|
2978
|
+
E !== null && E.path !== e && k(null);
|
|
2894
2979
|
const R = _(null);
|
|
2895
|
-
|
|
2980
|
+
j(() => (R.current = e, () => {
|
|
2896
2981
|
R.current = null;
|
|
2897
2982
|
}), [e]);
|
|
2898
|
-
const
|
|
2899
|
-
const
|
|
2900
|
-
if (
|
|
2901
|
-
const
|
|
2902
|
-
|
|
2983
|
+
const T = P(() => {
|
|
2984
|
+
const b = e, w = n.peek(b);
|
|
2985
|
+
if (c.has(b) || w?.status === "pending") return;
|
|
2986
|
+
const l = t && !Tn(w);
|
|
2987
|
+
c.add(b), g(new Set(c)), k(null), (async () => {
|
|
2903
2988
|
try {
|
|
2904
|
-
const s = await n.refresh(
|
|
2905
|
-
if (R.current !==
|
|
2989
|
+
const s = await n.refresh(b);
|
|
2990
|
+
if (R.current !== b || s.status === "superseded") return;
|
|
2906
2991
|
if (s.status === "failed") {
|
|
2907
|
-
|
|
2992
|
+
k({ path: b, failure: s.failure, stamp: n.answerStampOf(b) }), r.announce(o.documentRefreshFailed(le(o, s.failure.reason)));
|
|
2908
2993
|
return;
|
|
2909
2994
|
}
|
|
2910
|
-
const
|
|
2911
|
-
if (
|
|
2912
|
-
r.announce(o.documentRefreshed(
|
|
2995
|
+
const v = ue(n.peek(b));
|
|
2996
|
+
if (l || v === null || v.document.kind === "failure") return;
|
|
2997
|
+
r.announce(o.documentRefreshed(v.document.name));
|
|
2913
2998
|
} finally {
|
|
2914
|
-
|
|
2999
|
+
c.delete(b), g(new Set(c));
|
|
2915
3000
|
}
|
|
2916
3001
|
})();
|
|
2917
|
-
}, [e, t,
|
|
2918
|
-
return { refreshing: A, unavailable: A || u?.status === "pending", failure: L, refresh:
|
|
2919
|
-
},
|
|
2920
|
-
const { labels: r } = D(), { refreshing: o, unavailable: i, failure:
|
|
2921
|
-
return /* @__PURE__ */
|
|
2922
|
-
/* @__PURE__ */
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
3002
|
+
}, [e, t, c, n, r, o]), A = h.has(e), L = E !== null && E.path === e && E.stamp === f ? E.failure : null;
|
|
3003
|
+
return { refreshing: A, unavailable: A || u?.status === "pending", failure: L, refresh: T };
|
|
3004
|
+
}, tl = Object.freeze({ kind: "page" }), nl = ({ path: e, placement: t, markup: n }) => {
|
|
3005
|
+
const { labels: r } = D(), { refreshing: o, unavailable: i, failure: a, refresh: u } = el(e, t.kind === "page"), m = Ya(e), f = za(e), c = bn(e), h = t.kind === "panel" ? r.refreshDocumentNamed(t.documentName) : null, g = t.kind === "panel" ? r.showMarkupNamed(t.documentName) : null, E = t.kind === "panel", k = t.kind === "panel" ? t.documentName : f.name, R = t.kind === "page" || t.maximized;
|
|
3006
|
+
return /* @__PURE__ */ $("div", { className: "aqmx-document-refresh-bar", "data-testid": "markdown-explorer-document-refresh-bar", "data-aqmx-editing": c === void 0 ? void 0 : "true", children: [
|
|
3007
|
+
/* @__PURE__ */ $("div", { className: "aqmx-document-refresh-row", children: [
|
|
3008
|
+
c === void 0 ? null : /* @__PURE__ */ d(Va, { session: c }),
|
|
3009
|
+
c === void 0 ? null : /* @__PURE__ */ d(Ka, { path: e, documentName: k, iconOnly: E, session: c, previewAvailable: R }),
|
|
3010
|
+
c === void 0 && m ? /* @__PURE__ */ $(
|
|
2926
3011
|
"button",
|
|
2927
3012
|
{
|
|
2928
3013
|
type: "button",
|
|
@@ -2932,15 +3017,15 @@ const Dl = /* @__PURE__ */ y.forwardRef(Nl), Pl = ({ href: e, onRetry: t, testId
|
|
|
2932
3017
|
"aria-pressed": n.shown,
|
|
2933
3018
|
"data-testid": "markdown-explorer-document-markup",
|
|
2934
3019
|
onClick: n.toggle,
|
|
2935
|
-
onDoubleClick:
|
|
3020
|
+
onDoubleClick: de,
|
|
2936
3021
|
children: [
|
|
2937
|
-
/* @__PURE__ */
|
|
2938
|
-
g === null ? /* @__PURE__ */
|
|
3022
|
+
/* @__PURE__ */ d($n, { "aria-hidden": "true" }),
|
|
3023
|
+
g === null ? /* @__PURE__ */ d("span", { children: r.showMarkupLabel }) : null
|
|
2939
3024
|
]
|
|
2940
3025
|
}
|
|
2941
3026
|
) : null,
|
|
2942
|
-
|
|
2943
|
-
|
|
3027
|
+
c !== void 0 || f.edit?.kind === "inline" || f.edit?.kind === "draft" ? /* @__PURE__ */ d(ja, { path: e, documentName: k, iconOnly: E, previewAvailable: R, draft: f.edit?.kind === "draft" }) : f.edit?.kind === "external" ? /* @__PURE__ */ d(Ha, { href: f.edit.href, documentName: k, iconOnly: E }) : null,
|
|
3028
|
+
c === void 0 ? /* @__PURE__ */ $(
|
|
2944
3029
|
"button",
|
|
2945
3030
|
{
|
|
2946
3031
|
type: "button",
|
|
@@ -2952,126 +3037,126 @@ const Dl = /* @__PURE__ */ y.forwardRef(Nl), Pl = ({ href: e, onRetry: t, testId
|
|
|
2952
3037
|
"data-aqmx-busy": o ? "true" : void 0,
|
|
2953
3038
|
"data-testid": "markdown-explorer-document-refresh",
|
|
2954
3039
|
onClick: u,
|
|
2955
|
-
onDoubleClick:
|
|
3040
|
+
onDoubleClick: de,
|
|
2956
3041
|
children: [
|
|
2957
|
-
/* @__PURE__ */
|
|
2958
|
-
h === null ? /* @__PURE__ */
|
|
3042
|
+
/* @__PURE__ */ d(ga, { "aria-hidden": "true" }),
|
|
3043
|
+
h === null ? /* @__PURE__ */ d("span", { children: r.refreshDocumentLabel }) : null
|
|
2959
3044
|
]
|
|
2960
3045
|
}
|
|
2961
3046
|
) : null
|
|
2962
3047
|
] }),
|
|
2963
|
-
|
|
2964
|
-
|
|
3048
|
+
c !== void 0 || a === null ? null : /* @__PURE__ */ d("p", { className: "aqmx-document-refresh-failure", "data-testid": "markdown-explorer-document-refresh-failure", "data-aqmx-failure": a.reason, children: r.documentRefreshFailed(le(r, a.reason)) }),
|
|
3049
|
+
c === void 0 ? null : /* @__PURE__ */ d(Xa, { path: e, session: c })
|
|
2965
3050
|
] });
|
|
2966
|
-
},
|
|
2967
|
-
const t = e.doc, n =
|
|
2968
|
-
return /* @__PURE__ */
|
|
2969
|
-
/* @__PURE__ */
|
|
2970
|
-
/* @__PURE__ */
|
|
3051
|
+
}, rl = ({ location: e }) => {
|
|
3052
|
+
const t = e.doc, n = U(() => ({ kind: "page", view: "single", overrides: e.overrides, embed: e.embed }), [e.overrides, e.embed]), r = Ja(e);
|
|
3053
|
+
return /* @__PURE__ */ $("div", { className: "aqmx-single aqmx-document-column", "data-testid": "markdown-explorer-single", ...et, children: [
|
|
3054
|
+
/* @__PURE__ */ d(nl, { path: t, placement: tl, markup: r }),
|
|
3055
|
+
/* @__PURE__ */ d(va, { path: t, absence: Qi, markup: e.markup, variant: n })
|
|
2971
3056
|
] });
|
|
2972
|
-
},
|
|
2973
|
-
const { labels: n, announcer: r } = D(), o =
|
|
2974
|
-
|
|
2975
|
-
const i = P(() => r.shownIn(o), [r, o]),
|
|
2976
|
-
return /* @__PURE__ */
|
|
2977
|
-
}, fe = Object.freeze([]),
|
|
3057
|
+
}, ol = ({ holds: e, testId: t }) => {
|
|
3058
|
+
const { labels: n, announcer: r } = D(), o = xe();
|
|
3059
|
+
j(() => e ? r.claim(o) : void 0, [e, r, o]);
|
|
3060
|
+
const i = P(() => r.shownIn(o), [r, o]), a = ee(r.subscribe, i, i);
|
|
3061
|
+
return /* @__PURE__ */ d("div", { className: "aqmx-sr-only", role: "status", "aria-live": "polite", "aria-atomic": "true", "data-testid": t, children: a.length > 1 ? n.announcementSequence(a) : a[0] });
|
|
3062
|
+
}, fe = Object.freeze([]), il = (e) => {
|
|
2978
3063
|
const t = /* @__PURE__ */ new Set();
|
|
2979
3064
|
let n = fe, r = [], o = !1;
|
|
2980
|
-
const i = [],
|
|
2981
|
-
n =
|
|
3065
|
+
const i = [], a = (c) => {
|
|
3066
|
+
n = c;
|
|
2982
3067
|
for (const h of [...t]) h();
|
|
2983
|
-
}, u = () => i.at(-1)?.region, m = (
|
|
3068
|
+
}, u = () => i.at(-1)?.region, m = (c) => {
|
|
2984
3069
|
const h = u();
|
|
2985
|
-
|
|
3070
|
+
c(), u() !== h && n !== fe && a(fe);
|
|
2986
3071
|
}, f = () => {
|
|
2987
3072
|
o = !1;
|
|
2988
|
-
const
|
|
2989
|
-
r = [],
|
|
3073
|
+
const c = r.map((h) => "sentence" in h ? h.sentence : h.list(h.items));
|
|
3074
|
+
r = [], a(Object.freeze(c));
|
|
2990
3075
|
};
|
|
2991
3076
|
return {
|
|
2992
|
-
announce: (
|
|
2993
|
-
if (typeof
|
|
3077
|
+
announce: (c) => {
|
|
3078
|
+
if (typeof c == "string") r.push({ sentence: c });
|
|
2994
3079
|
else {
|
|
2995
|
-
const h = r.find((g) => "list" in g && g.list ===
|
|
2996
|
-
h !== void 0 && "items" in h ? h.items.push(
|
|
3080
|
+
const h = r.find((g) => "list" in g && g.list === c.list);
|
|
3081
|
+
h !== void 0 && "items" in h ? h.items.push(c.item) : r.push({ list: c.list, items: [c.item] });
|
|
2997
3082
|
}
|
|
2998
|
-
o || (o = !0, n !== fe &&
|
|
3083
|
+
o || (o = !0, n !== fe && a(fe), e.request(f));
|
|
2999
3084
|
},
|
|
3000
|
-
subscribe: (
|
|
3001
|
-
t.delete(
|
|
3085
|
+
subscribe: (c) => (t.add(c), () => {
|
|
3086
|
+
t.delete(c);
|
|
3002
3087
|
}),
|
|
3003
|
-
claim: (
|
|
3004
|
-
const h = { region:
|
|
3088
|
+
claim: (c) => {
|
|
3089
|
+
const h = { region: c };
|
|
3005
3090
|
return m(() => i.push(h)), () => m(() => {
|
|
3006
3091
|
const g = i.indexOf(h);
|
|
3007
3092
|
g !== -1 && i.splice(g, 1);
|
|
3008
3093
|
});
|
|
3009
3094
|
},
|
|
3010
|
-
shownIn: (
|
|
3095
|
+
shownIn: (c) => u() === c ? n : fe
|
|
3011
3096
|
};
|
|
3012
|
-
}, ge = Object.freeze({ status: "cancelled" }),
|
|
3097
|
+
}, ge = Object.freeze({ status: "cancelled" }), al = (e) => {
|
|
3013
3098
|
if (e === null || typeof e != "object") return null;
|
|
3014
3099
|
const { failure: t } = e;
|
|
3015
3100
|
if (sr(t) !== null) return null;
|
|
3016
3101
|
const { reason: n, code: r } = t;
|
|
3017
|
-
return
|
|
3018
|
-
},
|
|
3019
|
-
const r = n ?? ((f,
|
|
3020
|
-
let
|
|
3102
|
+
return dr(n, r);
|
|
3103
|
+
}, ll = ({ dataPath: e, onScope: t, fetch: n }) => {
|
|
3104
|
+
const r = n ?? ((f, c) => globalThis.fetch(f, c)), o = (f, c) => `${e}/${f}?${new URLSearchParams(c).toString()}`, i = async (f, c, h, g) => {
|
|
3105
|
+
let E;
|
|
3021
3106
|
try {
|
|
3022
|
-
|
|
3107
|
+
E = await r(f, { credentials: "same-origin", ...c, headers: { Accept: "application/json", ...c.headers } });
|
|
3023
3108
|
} catch {
|
|
3024
3109
|
return g({ reason: "failed" });
|
|
3025
3110
|
}
|
|
3026
|
-
|
|
3027
|
-
const
|
|
3028
|
-
|
|
3111
|
+
E.status === 401 && t(null);
|
|
3112
|
+
const k = E.headers.get(rr);
|
|
3113
|
+
k !== null && t(k);
|
|
3029
3114
|
let R;
|
|
3030
3115
|
try {
|
|
3031
|
-
R = await
|
|
3116
|
+
R = await E.json();
|
|
3032
3117
|
} catch {
|
|
3033
|
-
return g({ reason: Et(
|
|
3118
|
+
return g({ reason: Et(E.status) });
|
|
3034
3119
|
}
|
|
3035
|
-
let
|
|
3120
|
+
let T;
|
|
3036
3121
|
try {
|
|
3037
|
-
|
|
3122
|
+
T = h(R);
|
|
3038
3123
|
} catch {
|
|
3039
|
-
|
|
3124
|
+
T = !1;
|
|
3040
3125
|
}
|
|
3041
|
-
if (
|
|
3042
|
-
const A =
|
|
3043
|
-
return g(A !== null ? A : { reason:
|
|
3044
|
-
},
|
|
3045
|
-
const g = await i(f,
|
|
3046
|
-
return
|
|
3126
|
+
if (T) return R;
|
|
3127
|
+
const A = al(R);
|
|
3128
|
+
return g(A !== null ? A : { reason: E.status === 200 ? "failed" : Et(E.status) });
|
|
3129
|
+
}, a = { [yt]: cr }, u = { [yt]: pr, "Content-Type": `${hr}; charset=utf-8` }, m = async (f, c, h) => {
|
|
3130
|
+
const g = await i(f, c, h, (E) => Ve(E.reason, E.code));
|
|
3131
|
+
return c.signal.aborted ? ge : g;
|
|
3047
3132
|
};
|
|
3048
3133
|
return {
|
|
3049
|
-
tree: (f) => i(o("tree", { [
|
|
3050
|
-
children: async (f,
|
|
3051
|
-
const g = await i(o("children", { [
|
|
3134
|
+
tree: (f) => i(o("tree", { [Y.source]: f }), { method: "GET" }, St, (c) => ({ status: "error", failure: c })),
|
|
3135
|
+
children: async (f, c, h) => {
|
|
3136
|
+
const g = await i(o("children", { [Y.source]: f, [Y.path]: c }), { method: "GET", signal: h }, lr, (E) => ({ status: "error", failure: E }));
|
|
3052
3137
|
return h.aborted ? ge : g;
|
|
3053
3138
|
},
|
|
3054
|
-
ancestors: async (f,
|
|
3055
|
-
const g = await i(o("ancestors", { [
|
|
3139
|
+
ancestors: async (f, c, h) => {
|
|
3140
|
+
const g = await i(o("ancestors", { [Y.source]: f, [Y.path]: c }), { method: "GET", signal: h }, ar, (E) => ({ status: "error", failure: E }));
|
|
3056
3141
|
return h.aborted ? ge : g;
|
|
3057
3142
|
},
|
|
3058
|
-
reveal: async (f,
|
|
3059
|
-
const g = await i(o("reveal", { [
|
|
3143
|
+
reveal: async (f, c, h) => {
|
|
3144
|
+
const g = await i(o("reveal", { [Y.source]: f, [Y.path]: c }), { method: "GET", signal: h }, ir, (E) => ({ status: "error", failure: E }));
|
|
3060
3145
|
return h.aborted ? ge : g;
|
|
3061
3146
|
},
|
|
3062
|
-
document: (f, { refresh:
|
|
3063
|
-
text: async (f,
|
|
3064
|
-
const h = await i(o("text", { [
|
|
3065
|
-
return
|
|
3147
|
+
document: (f, { refresh: c }) => i(o("document", { [Y.path]: f }), c ? { method: "GET", headers: a } : { method: "GET" }, gr, (h) => Ve(h.reason, h.code)),
|
|
3148
|
+
text: async (f, c) => {
|
|
3149
|
+
const h = await i(o("text", { [Y.path]: f }), { method: "GET", signal: c }, or, (g) => Ve(g.reason, g.code));
|
|
3150
|
+
return c.aborted ? ge : h;
|
|
3066
3151
|
},
|
|
3067
|
-
edit: (f,
|
|
3068
|
-
save: (f,
|
|
3069
|
-
preview: (f,
|
|
3070
|
-
revisions: (f,
|
|
3071
|
-
revision: (f,
|
|
3072
|
-
refresh: (f) => i(o("refresh", { [
|
|
3152
|
+
edit: (f, c) => m(o("edit", { [Y.path]: f }), { method: "GET", signal: c }, wr),
|
|
3153
|
+
save: (f, c, h, g) => m(o("save", { [Y.path]: f, [Y.base]: c }), { method: "POST", headers: u, body: h, signal: g }, vr),
|
|
3154
|
+
preview: (f, c, h) => m(o("preview", { [Y.path]: f }), { method: "POST", headers: u, body: c, signal: h }, mr),
|
|
3155
|
+
revisions: (f, c) => m(o("revisions", { [Y.path]: f }), { method: "GET", signal: c }, fr),
|
|
3156
|
+
revision: (f, c, h) => m(o("revision", { [Y.path]: f, [Y.revision]: c }), { method: "GET", signal: h }, ur),
|
|
3157
|
+
refresh: (f) => i(o("refresh", { [Y.source]: f }), { method: "POST", headers: a }, St, (c) => ({ status: "error", failure: c }))
|
|
3073
3158
|
};
|
|
3074
|
-
},
|
|
3159
|
+
}, sl = () => {
|
|
3075
3160
|
let e = null, t = null;
|
|
3076
3161
|
return {
|
|
3077
3162
|
settle: (n) => {
|
|
@@ -3086,7 +3171,7 @@ const Dl = /* @__PURE__ */ y.forwardRef(Nl), Pl = ({ href: e, onRetry: t, testId
|
|
|
3086
3171
|
return t = null, o;
|
|
3087
3172
|
}
|
|
3088
3173
|
};
|
|
3089
|
-
},
|
|
3174
|
+
}, dl = (e) => {
|
|
3090
3175
|
const t = Qe(e);
|
|
3091
3176
|
if (t === null) return bt;
|
|
3092
3177
|
try {
|
|
@@ -3098,11 +3183,11 @@ const Dl = /* @__PURE__ */ y.forwardRef(Nl), Pl = ({ href: e, onRetry: t, testId
|
|
|
3098
3183
|
let n = null;
|
|
3099
3184
|
const r = () => {
|
|
3100
3185
|
if (n === null) {
|
|
3101
|
-
const i =
|
|
3186
|
+
const i = dl(e);
|
|
3102
3187
|
n = { changes: i, settings: gt(t, i) };
|
|
3103
3188
|
}
|
|
3104
3189
|
return n;
|
|
3105
|
-
}, o =
|
|
3190
|
+
}, o = Oe();
|
|
3106
3191
|
return {
|
|
3107
3192
|
storageKey: e,
|
|
3108
3193
|
defaults: t,
|
|
@@ -3110,209 +3195,209 @@ const Dl = /* @__PURE__ */ y.forwardRef(Nl), Pl = ({ href: e, onRetry: t, testId
|
|
|
3110
3195
|
getServerSnapshot: () => t,
|
|
3111
3196
|
subscribe: o.subscribe,
|
|
3112
3197
|
advance: (i) => {
|
|
3113
|
-
const { changes:
|
|
3198
|
+
const { changes: a, settings: u } = r(), m = Kn(a, i, Xn(u, i)[i], t);
|
|
3114
3199
|
return n = { changes: m, settings: gt(t, m) }, o.emit(), Je(e, Yn(m)), n.settings;
|
|
3115
3200
|
}
|
|
3116
3201
|
};
|
|
3117
|
-
},
|
|
3118
|
-
const t = /* @__PURE__ */ new Map(), n = kn(), r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(),
|
|
3119
|
-
let f = 0,
|
|
3202
|
+
}, cl = Object.freeze({ status: "refreshed" }), ul = Object.freeze({ status: "superseded" }), ot = Object.freeze({ status: "deferred" }), fl = gn(ot), qn = 4, ml = qn - 1, Kt = Object.freeze({ status: "loading" }), hl = Object.freeze({ status: "error", failure: Object.freeze({ reason: "failed" }) }), pl = (e) => {
|
|
3203
|
+
const t = /* @__PURE__ */ new Map(), n = kn(), r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), u = Oe(), m = /* @__PURE__ */ new Set();
|
|
3204
|
+
let f = 0, c = 0;
|
|
3120
3205
|
const h = { direct: null, bulk: null }, g = /* @__PURE__ */ new Set();
|
|
3121
|
-
let
|
|
3206
|
+
let E = !1, k = 0;
|
|
3122
3207
|
const R = () => {
|
|
3123
|
-
|
|
3124
|
-
},
|
|
3125
|
-
let
|
|
3126
|
-
return
|
|
3127
|
-
}, L = (p,
|
|
3128
|
-
p.inFlight.delete(
|
|
3129
|
-
},
|
|
3130
|
-
const
|
|
3131
|
-
if (
|
|
3132
|
-
for (const [
|
|
3133
|
-
L(
|
|
3134
|
-
|
|
3208
|
+
k += 1, u.emit();
|
|
3209
|
+
}, T = (p) => o.get(p) ?? 0, A = (p) => {
|
|
3210
|
+
let S = a.get(p);
|
|
3211
|
+
return S === void 0 && (S = { claims: /* @__PURE__ */ new Map(), unclaimed: /* @__PURE__ */ new Set(), direct: /* @__PURE__ */ new Set(), bulk: /* @__PURE__ */ new Set(), inFlight: /* @__PURE__ */ new Map() }, a.set(p, S)), S;
|
|
3212
|
+
}, L = (p, S, x) => {
|
|
3213
|
+
p.inFlight.delete(S), f -= 1, x.lane === "bulk" && (c -= 1);
|
|
3214
|
+
}, b = (p) => {
|
|
3215
|
+
const S = a.get(p);
|
|
3216
|
+
if (S !== void 0) {
|
|
3217
|
+
for (const [x, C] of [...S.inFlight])
|
|
3218
|
+
L(S, x, C), C.controller.abort();
|
|
3219
|
+
S.direct.clear(), S.bulk.clear(), S.unclaimed.clear();
|
|
3135
3220
|
}
|
|
3136
|
-
}, v = (p) => {
|
|
3137
|
-
const x = S(p) + 1;
|
|
3138
|
-
return o.set(p, x), E(p), x;
|
|
3139
|
-
}, a = (p, x) => {
|
|
3140
|
-
const k = Ee(p), O = { promise: p, opened: x, stale: !1, loadedAt: k?.status === "ok" ? k.loadedAt : null };
|
|
3141
|
-
return p.status === "pending" && p.then(($) => {
|
|
3142
|
-
$.status === "ok" && (O.loadedAt = $.loadedAt);
|
|
3143
|
-
}), O;
|
|
3144
|
-
}, s = (p) => {
|
|
3145
|
-
let x = r.get(p);
|
|
3146
|
-
return x === void 0 && (x = /* @__PURE__ */ new Map(), r.set(p, x)), x;
|
|
3147
3221
|
}, w = (p) => {
|
|
3148
|
-
const
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3222
|
+
const S = T(p) + 1;
|
|
3223
|
+
return o.set(p, S), b(p), S;
|
|
3224
|
+
}, l = (p, S) => {
|
|
3225
|
+
const x = Ee(p), C = { promise: p, opened: S, stale: !1, loadedAt: x?.status === "ok" ? x.loadedAt : null };
|
|
3226
|
+
return p.status === "pending" && p.then((F) => {
|
|
3227
|
+
F.status === "ok" && (C.loadedAt = F.loadedAt);
|
|
3228
|
+
}), C;
|
|
3229
|
+
}, s = (p) => {
|
|
3230
|
+
let S = r.get(p);
|
|
3231
|
+
return S === void 0 && (S = /* @__PURE__ */ new Map(), r.set(p, S)), S;
|
|
3232
|
+
}, v = (p) => {
|
|
3233
|
+
const S = [...a.keys()], x = h[p], C = x === null ? 0 : S.indexOf(x) + 1;
|
|
3234
|
+
for (let F = 0; F < S.length; F += 1) {
|
|
3235
|
+
const B = S[(C + F) % S.length], K = B === void 0 ? void 0 : a.get(B);
|
|
3236
|
+
if (!(B === void 0 || K === void 0)) {
|
|
3237
|
+
for (const V of K[p])
|
|
3238
|
+
if ((K.claims.get(V) ?? 0) !== 0)
|
|
3239
|
+
return K[p].delete(V), h[p] = B, { sourceId: B, path: V };
|
|
3155
3240
|
}
|
|
3156
3241
|
}
|
|
3157
3242
|
return null;
|
|
3158
|
-
},
|
|
3159
|
-
const
|
|
3160
|
-
if (
|
|
3161
|
-
L(
|
|
3162
|
-
const
|
|
3163
|
-
if (
|
|
3164
|
-
const
|
|
3165
|
-
for (const ie of [...m]) ie(
|
|
3243
|
+
}, O = (p, S, x, C) => {
|
|
3244
|
+
const F = a.get(p);
|
|
3245
|
+
if (F === void 0 || F.inFlight.get(S) !== x) return;
|
|
3246
|
+
L(F, S, x);
|
|
3247
|
+
const B = (F.claims.get(S) ?? 0) > 0, K = s(p);
|
|
3248
|
+
if (C.status === "ok" ? K.set(S, { status: "loaded", entries: C.entries }) : C.status === "error" && B ? K.set(S, { status: "failed", failure: C.failure }) : K.delete(S), R(), C.status === "error" && B) {
|
|
3249
|
+
const V = { sourceId: p, path: S, failure: C.failure };
|
|
3250
|
+
for (const ie of [...m]) ie(V);
|
|
3166
3251
|
}
|
|
3167
3252
|
N();
|
|
3168
|
-
},
|
|
3169
|
-
const
|
|
3170
|
-
A(p).inFlight.set(
|
|
3171
|
-
(
|
|
3172
|
-
() =>
|
|
3253
|
+
}, M = (p, S, x) => {
|
|
3254
|
+
const C = { controller: new AbortController(), lane: x };
|
|
3255
|
+
A(p).inFlight.set(S, C), f += 1, x === "bulk" && (c += 1), e.children(p, S, C.controller.signal).then(
|
|
3256
|
+
(F) => O(p, S, C, F),
|
|
3257
|
+
() => O(p, S, C, hl)
|
|
3173
3258
|
);
|
|
3174
3259
|
}, N = () => {
|
|
3175
3260
|
for (; f < qn; ) {
|
|
3176
|
-
const p =
|
|
3261
|
+
const p = v("direct");
|
|
3177
3262
|
if (p !== null) {
|
|
3178
|
-
|
|
3263
|
+
M(p.sourceId, p.path, "direct");
|
|
3179
3264
|
continue;
|
|
3180
3265
|
}
|
|
3181
|
-
const
|
|
3182
|
-
if (
|
|
3183
|
-
|
|
3266
|
+
const S = c < ml ? v("bulk") : null;
|
|
3267
|
+
if (S === null) return;
|
|
3268
|
+
M(S.sourceId, S.path, "bulk");
|
|
3184
3269
|
}
|
|
3185
|
-
}, q = (p,
|
|
3186
|
-
if (!(
|
|
3187
|
-
const
|
|
3188
|
-
if (
|
|
3189
|
-
L(
|
|
3270
|
+
}, q = (p, S, x) => {
|
|
3271
|
+
if (!(S.direct.delete(x) || S.bulk.delete(x))) {
|
|
3272
|
+
const F = S.inFlight.get(x);
|
|
3273
|
+
if (F === void 0) return !1;
|
|
3274
|
+
L(S, x, F), F.controller.abort();
|
|
3190
3275
|
}
|
|
3191
|
-
return r.get(p)?.delete(
|
|
3276
|
+
return r.get(p)?.delete(x), !0;
|
|
3192
3277
|
}, W = () => {
|
|
3193
|
-
|
|
3278
|
+
E = !1;
|
|
3194
3279
|
let p = !1;
|
|
3195
|
-
for (const
|
|
3196
|
-
const
|
|
3197
|
-
for (const
|
|
3198
|
-
(
|
|
3199
|
-
|
|
3280
|
+
for (const S of g) {
|
|
3281
|
+
const x = A(S);
|
|
3282
|
+
for (const C of x.unclaimed)
|
|
3283
|
+
(x.claims.get(C) ?? 0) === 0 && q(S, x, C) && (p = !0);
|
|
3284
|
+
x.unclaimed.clear();
|
|
3200
3285
|
}
|
|
3201
3286
|
g.clear(), p && (R(), N());
|
|
3202
|
-
},
|
|
3203
|
-
t.set(p,
|
|
3204
|
-
},
|
|
3205
|
-
|
|
3206
|
-
const
|
|
3207
|
-
return t.set(p,
|
|
3208
|
-
},
|
|
3209
|
-
if (
|
|
3210
|
-
const
|
|
3211
|
-
if (!(
|
|
3212
|
-
if (De(
|
|
3213
|
-
|
|
3287
|
+
}, G = (p, S) => {
|
|
3288
|
+
t.set(p, l(Te(e.tree(p)), S));
|
|
3289
|
+
}, I = (p, S, x) => {
|
|
3290
|
+
w(p);
|
|
3291
|
+
const C = l(gn(S), x);
|
|
3292
|
+
return t.set(p, C), r.delete(p), R(), N(), C;
|
|
3293
|
+
}, J = (p, S, x, C) => {
|
|
3294
|
+
if (x !== T(p) || t.get(p) !== S) return;
|
|
3295
|
+
const F = Ee(S.promise);
|
|
3296
|
+
if (!(C.status !== "ok" || F?.status !== "ok" || S.loadedAt === null || C.loadedAt <= S.loadedAt)) {
|
|
3297
|
+
if (De(F.entries, C.entries)) {
|
|
3298
|
+
S.loadedAt = C.loadedAt;
|
|
3214
3299
|
return;
|
|
3215
3300
|
}
|
|
3216
|
-
|
|
3301
|
+
I(p, C, S.opened);
|
|
3217
3302
|
}
|
|
3218
|
-
},
|
|
3219
|
-
const
|
|
3220
|
-
return
|
|
3221
|
-
},
|
|
3222
|
-
|
|
3223
|
-
const
|
|
3224
|
-
e.tree(p).then((
|
|
3303
|
+
}, H = (p, S) => {
|
|
3304
|
+
const x = t.get(p);
|
|
3305
|
+
return x !== void 0 && Ee(x.promise)?.status === S;
|
|
3306
|
+
}, ne = (p, S) => {
|
|
3307
|
+
S.stale = !1;
|
|
3308
|
+
const x = T(p);
|
|
3309
|
+
e.tree(p).then((C) => J(p, S, x, C));
|
|
3225
3310
|
};
|
|
3226
3311
|
return {
|
|
3227
|
-
read: (p) => t.get(p)?.promise ??
|
|
3312
|
+
read: (p) => t.get(p)?.promise ?? fl,
|
|
3228
3313
|
open: (p) => {
|
|
3229
|
-
const
|
|
3230
|
-
return
|
|
3314
|
+
const S = n.resumes(p), x = n.hold(p), C = t.get(p);
|
|
3315
|
+
return C === void 0 || H(p, "deferred") ? (G(p, !0), R()) : S || (C.opened && H(p, "error") ? (G(p, !0), R()) : (C.opened = !0, C.stale && H(p, "ok") && ne(p, C))), x;
|
|
3231
3316
|
},
|
|
3232
3317
|
retry: (p) => {
|
|
3233
|
-
|
|
3318
|
+
H(p, "error") && (G(p, !0), R());
|
|
3234
3319
|
},
|
|
3235
|
-
seed: (p,
|
|
3236
|
-
const
|
|
3237
|
-
(
|
|
3320
|
+
seed: (p, S) => {
|
|
3321
|
+
const x = S.then(
|
|
3322
|
+
(B) => B === null ? ot : B,
|
|
3238
3323
|
() => ot
|
|
3239
|
-
),
|
|
3240
|
-
if (
|
|
3241
|
-
const
|
|
3242
|
-
|
|
3324
|
+
), C = t.get(p);
|
|
3325
|
+
if (C !== void 0 && H(p, "ok")) {
|
|
3326
|
+
const B = T(p);
|
|
3327
|
+
x.then((K) => J(p, C, B, K));
|
|
3243
3328
|
return;
|
|
3244
3329
|
}
|
|
3245
|
-
|
|
3246
|
-
const
|
|
3247
|
-
t.set(p,
|
|
3248
|
-
t.get(p) ===
|
|
3330
|
+
w(p);
|
|
3331
|
+
const F = l(Te(x), C?.opened === !0);
|
|
3332
|
+
t.set(p, F), r.delete(p), N(), x.then((B) => {
|
|
3333
|
+
t.get(p) === F && (B.status === "deferred" && n.isHeld(p) && G(p, F.opened), R());
|
|
3249
3334
|
});
|
|
3250
3335
|
},
|
|
3251
3336
|
refresh: async (p) => {
|
|
3252
|
-
const
|
|
3253
|
-
i.set(p,
|
|
3254
|
-
const
|
|
3255
|
-
if (i.get(p) !==
|
|
3256
|
-
if (
|
|
3257
|
-
const
|
|
3258
|
-
if (!(
|
|
3259
|
-
const
|
|
3260
|
-
if (
|
|
3261
|
-
const K =
|
|
3262
|
-
|
|
3337
|
+
const S = (i.get(p) ?? 0) + 1;
|
|
3338
|
+
i.set(p, S);
|
|
3339
|
+
const x = await e.refresh(p);
|
|
3340
|
+
if (i.get(p) !== S) return ul;
|
|
3341
|
+
if (x.status === "error") return { status: "failed", failure: x.failure };
|
|
3342
|
+
const C = t.get(p);
|
|
3343
|
+
if (!(C !== void 0 && C.loadedAt !== null && H(p, "ok") && C.loadedAt > x.loadedAt)) {
|
|
3344
|
+
const B = I(p, x, !0);
|
|
3345
|
+
if (C !== void 0 && C.promise.status === "pending") {
|
|
3346
|
+
const K = T(p);
|
|
3347
|
+
C.promise.then((V) => J(p, B, K, V));
|
|
3263
3348
|
}
|
|
3264
3349
|
}
|
|
3265
|
-
for (const [
|
|
3266
|
-
|
|
3267
|
-
return
|
|
3350
|
+
for (const [B, K] of t)
|
|
3351
|
+
B !== p && Ee(K.promise)?.status === "ok" && (K.stale = !0);
|
|
3352
|
+
return cl;
|
|
3268
3353
|
},
|
|
3269
|
-
children: (p,
|
|
3270
|
-
claimChildren: (p,
|
|
3271
|
-
const
|
|
3272
|
-
let
|
|
3273
|
-
for (const [
|
|
3274
|
-
|
|
3275
|
-
|
|
3354
|
+
children: (p, S) => r.get(p)?.get(S),
|
|
3355
|
+
claimChildren: (p, S) => {
|
|
3356
|
+
const x = A(p), C = s(p);
|
|
3357
|
+
let F = !1, B = !1;
|
|
3358
|
+
for (const [V, ie] of S)
|
|
3359
|
+
x.claims.set(V, (x.claims.get(V) ?? 0) + 1), C.get(V) === void 0 ? (C.set(V, Kt), x[ie].add(V), F = !0, B = !0) : ie === "direct" && x.bulk.delete(V) && (x.direct.add(V), B = !0);
|
|
3360
|
+
F && R(), B && N();
|
|
3276
3361
|
let K = !1;
|
|
3277
3362
|
return () => {
|
|
3278
3363
|
if (!K) {
|
|
3279
3364
|
K = !0;
|
|
3280
|
-
for (const
|
|
3281
|
-
const ie = (
|
|
3282
|
-
ie > 0 ?
|
|
3365
|
+
for (const V of S.keys()) {
|
|
3366
|
+
const ie = (x.claims.get(V) ?? 0) - 1;
|
|
3367
|
+
ie > 0 ? x.claims.set(V, ie) : (x.claims.delete(V), x.unclaimed.add(V));
|
|
3283
3368
|
}
|
|
3284
|
-
g.add(p), !
|
|
3369
|
+
g.add(p), !E && (E = !0, queueMicrotask(W));
|
|
3285
3370
|
}
|
|
3286
3371
|
};
|
|
3287
3372
|
},
|
|
3288
|
-
retryChildren: (p,
|
|
3289
|
-
const
|
|
3290
|
-
if (
|
|
3291
|
-
const
|
|
3292
|
-
if ((
|
|
3293
|
-
|
|
3373
|
+
retryChildren: (p, S) => {
|
|
3374
|
+
const x = r.get(p);
|
|
3375
|
+
if (x === void 0 || x.get(S)?.status !== "failed") return;
|
|
3376
|
+
const C = A(p);
|
|
3377
|
+
if ((C.claims.get(S) ?? 0) > 0) {
|
|
3378
|
+
x.set(S, Kt), C.direct.add(S), R(), N();
|
|
3294
3379
|
return;
|
|
3295
3380
|
}
|
|
3296
|
-
|
|
3381
|
+
x.delete(S), R();
|
|
3297
3382
|
},
|
|
3298
3383
|
pendingChildren: (p) => {
|
|
3299
|
-
const
|
|
3300
|
-
return
|
|
3384
|
+
const S = a.get(p);
|
|
3385
|
+
return S === void 0 ? 0 : S.direct.size + S.bulk.size + S.inFlight.size;
|
|
3301
3386
|
},
|
|
3302
3387
|
clear: () => {
|
|
3303
|
-
for (const p of /* @__PURE__ */ new Set([...t.keys(), ...r.keys(), ...o.keys(), ...
|
|
3304
|
-
for (const [p,
|
|
3388
|
+
for (const p of /* @__PURE__ */ new Set([...t.keys(), ...r.keys(), ...o.keys(), ...a.keys()])) w(p);
|
|
3389
|
+
for (const [p, S] of i) i.set(p, S + 1);
|
|
3305
3390
|
t.clear(), r.clear(), R();
|
|
3306
3391
|
},
|
|
3307
3392
|
subscribeChildrenFailures: (p) => (m.add(p), () => {
|
|
3308
3393
|
m.delete(p);
|
|
3309
3394
|
}),
|
|
3310
3395
|
subscribe: u.subscribe,
|
|
3311
|
-
version: () =>
|
|
3396
|
+
version: () => k
|
|
3312
3397
|
};
|
|
3313
|
-
},
|
|
3398
|
+
}, vl = (e, t) => {
|
|
3314
3399
|
let n = e;
|
|
3315
|
-
const r =
|
|
3400
|
+
const r = Oe();
|
|
3316
3401
|
return {
|
|
3317
3402
|
getSnapshot: () => n,
|
|
3318
3403
|
subscribe: r.subscribe,
|
|
@@ -3320,80 +3405,80 @@ const Dl = /* @__PURE__ */ y.forwardRef(Nl), Pl = ({ href: e, onRetry: t, testId
|
|
|
3320
3405
|
n = { ...n, ...o }, t(n), r.emit();
|
|
3321
3406
|
}
|
|
3322
3407
|
};
|
|
3323
|
-
},
|
|
3324
|
-
let
|
|
3325
|
-
const
|
|
3408
|
+
}, wl = 1;
|
|
3409
|
+
let Ce = 0, ce = null;
|
|
3410
|
+
const gl = () => {
|
|
3326
3411
|
const { documentElement: e, body: t } = document;
|
|
3327
|
-
|
|
3412
|
+
Ce === 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"), Ce += 1;
|
|
3328
3413
|
let n = !1;
|
|
3329
3414
|
return () => {
|
|
3330
|
-
n || (n = !0,
|
|
3415
|
+
n || (n = !0, Ce -= 1, !(Ce > 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));
|
|
3331
3416
|
};
|
|
3332
|
-
},
|
|
3417
|
+
}, bl = [
|
|
3333
3418
|
{ selector: '[data-aqmx-document-flow="fill"]', name: "document region" },
|
|
3334
3419
|
{ selector: "[data-aqmx-explorer-body]", name: "tree area" }
|
|
3335
|
-
], Xt = 1,
|
|
3420
|
+
], Xt = 1, El = 1e3, Yt = (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.", Sl = (e) => {
|
|
3336
3421
|
if (!Yt(e)) return null;
|
|
3337
3422
|
const t = e.getBoundingClientRect(), n = window.innerHeight;
|
|
3338
|
-
if (t.bottom > n +
|
|
3423
|
+
if (t.bottom > n + wl)
|
|
3339
3424
|
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}`;
|
|
3340
3425
|
if (t.height < Xt)
|
|
3341
3426
|
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}`;
|
|
3342
|
-
for (const { selector: r, name: o } of
|
|
3427
|
+
for (const { selector: r, name: o } of bl)
|
|
3343
3428
|
for (const i of e.querySelectorAll(r)) {
|
|
3344
3429
|
if (!Yt(i)) continue;
|
|
3345
|
-
const
|
|
3346
|
-
if (
|
|
3347
|
-
return `[markdown-explorer] the explorer's ${o} collapsed to ${String(Math.round(
|
|
3430
|
+
const a = i.getBoundingClientRect().height;
|
|
3431
|
+
if (a < Xt)
|
|
3432
|
+
return `[markdown-explorer] the explorer's ${o} collapsed to ${String(Math.round(a))}px while lockDocumentScroll stops the page from scrolling, so it cannot be read. ${Ke}`;
|
|
3348
3433
|
}
|
|
3349
3434
|
return null;
|
|
3350
|
-
},
|
|
3435
|
+
}, yl = (e) => {
|
|
3351
3436
|
let t = !1, n;
|
|
3352
3437
|
const r = () => {
|
|
3353
3438
|
n = void 0;
|
|
3354
|
-
const
|
|
3355
|
-
|
|
3439
|
+
const a = Sl(e);
|
|
3440
|
+
a !== null && (t = !0, console.error(a));
|
|
3356
3441
|
}, o = () => {
|
|
3357
|
-
t || (clearTimeout(n), n = setTimeout(r,
|
|
3442
|
+
t || (clearTimeout(n), n = setTimeout(r, El));
|
|
3358
3443
|
}, i = typeof ResizeObserver > "u" ? null : new ResizeObserver(o);
|
|
3359
3444
|
return i?.observe(e), window.addEventListener("resize", o), o(), () => {
|
|
3360
3445
|
clearTimeout(n), i?.disconnect(), window.removeEventListener("resize", o);
|
|
3361
3446
|
};
|
|
3362
|
-
},
|
|
3363
|
-
te(() => e ?
|
|
3447
|
+
}, xl = (e, t) => {
|
|
3448
|
+
te(() => e ? gl() : void 0, [e]), te(() => {
|
|
3364
3449
|
const n = t.current;
|
|
3365
3450
|
if (!(!e || n === null))
|
|
3366
|
-
return
|
|
3451
|
+
return yl(n);
|
|
3367
3452
|
}, [e, t]);
|
|
3368
|
-
}, Jt = '[data-testid="markdown-explorer-view-switch"]',
|
|
3453
|
+
}, Jt = '[data-testid="markdown-explorer-view-switch"]', kl = [
|
|
3369
3454
|
{ control: Jt, successors: [Jt, '[data-testid="markdown-explorer-sheet-toggle"]'] },
|
|
3370
3455
|
{ control: '[data-testid="markdown-explorer-selection-open"]', successors: ['[data-testid="markdown-explorer-panel-frame"]'] }
|
|
3371
|
-
],
|
|
3372
|
-
for (const t of
|
|
3456
|
+
], Tl = (e) => {
|
|
3457
|
+
for (const t of kl) {
|
|
3373
3458
|
const n = e.closest(t.control);
|
|
3374
3459
|
if (n !== null) return { element: n, control: t };
|
|
3375
3460
|
}
|
|
3376
3461
|
return null;
|
|
3377
|
-
},
|
|
3462
|
+
}, Rl = (e, t) => {
|
|
3378
3463
|
const n = _(null);
|
|
3379
3464
|
te(() => {
|
|
3380
3465
|
const o = (u) => {
|
|
3381
3466
|
const m = e.current;
|
|
3382
|
-
n.current = m !== null && u instanceof Element && m.contains(u) ?
|
|
3467
|
+
n.current = m !== null && u instanceof Element && m.contains(u) ? Tl(u) : null;
|
|
3383
3468
|
}, i = (u) => o(u.target);
|
|
3384
3469
|
o(document.activeElement);
|
|
3385
|
-
const
|
|
3470
|
+
const a = (u) => {
|
|
3386
3471
|
const m = u.target;
|
|
3387
3472
|
u.relatedTarget !== null || !(m instanceof Element) || queueMicrotask(() => {
|
|
3388
3473
|
n.current?.element === m && m.isConnected && document.activeElement !== m && (n.current = null);
|
|
3389
3474
|
});
|
|
3390
3475
|
};
|
|
3391
|
-
return document.addEventListener("focusin", i), document.addEventListener("focusout",
|
|
3392
|
-
document.removeEventListener("focusin", i), document.removeEventListener("focusout",
|
|
3476
|
+
return document.addEventListener("focusin", i), document.addEventListener("focusout", a), () => {
|
|
3477
|
+
document.removeEventListener("focusin", i), document.removeEventListener("focusout", a);
|
|
3393
3478
|
};
|
|
3394
3479
|
}, [e]);
|
|
3395
3480
|
const r = _(t);
|
|
3396
|
-
|
|
3481
|
+
j(() => {
|
|
3397
3482
|
if (r.current === t) return;
|
|
3398
3483
|
r.current = t;
|
|
3399
3484
|
const o = n.current;
|
|
@@ -3403,21 +3488,21 @@ const ga = () => {
|
|
|
3403
3488
|
if (m !== null && m !== document.body && m !== o.element) return !0;
|
|
3404
3489
|
const f = e.current;
|
|
3405
3490
|
if (f === null) return !0;
|
|
3406
|
-
for (const
|
|
3407
|
-
for (const h of f.querySelectorAll(
|
|
3491
|
+
for (const c of o.control.successors)
|
|
3492
|
+
for (const h of f.querySelectorAll(c))
|
|
3408
3493
|
if (h !== o.element && (h.focus({ preventScroll: !0 }), document.activeElement === h))
|
|
3409
3494
|
return !0;
|
|
3410
3495
|
return !1;
|
|
3411
3496
|
};
|
|
3412
3497
|
if (i()) return;
|
|
3413
|
-
const
|
|
3414
|
-
if (
|
|
3498
|
+
const a = e.current;
|
|
3499
|
+
if (a === null) return;
|
|
3415
3500
|
const u = new MutationObserver(() => {
|
|
3416
3501
|
i() && u.disconnect();
|
|
3417
3502
|
});
|
|
3418
|
-
return u.observe(
|
|
3503
|
+
return u.observe(a, { childList: !0, subtree: !0 }), () => u.disconnect();
|
|
3419
3504
|
}, [t, e]);
|
|
3420
|
-
},
|
|
3505
|
+
}, Ol = it(() => import("./TreeLayout-Cf2PzZEI.js").then((e) => ({ default: e.TreeLayout }))), Cl = it(() => import("./MultiLayout-BkhnkQs5.js").then((e) => ({ default: e.MultiLayout }))), Ml = 64, Al = {
|
|
3421
3506
|
request: (e) => {
|
|
3422
3507
|
requestAnimationFrame(e);
|
|
3423
3508
|
}
|
|
@@ -3426,129 +3511,129 @@ const ga = () => {
|
|
|
3426
3511
|
}, Xe = (e, t) => {
|
|
3427
3512
|
t.tree !== null && e.trees.seed(t.tree.sourceId, t.tree.result);
|
|
3428
3513
|
for (const { path: n, document: r } of t.documents) e.documents.seed(n, r);
|
|
3429
|
-
},
|
|
3430
|
-
const [n, r] =
|
|
3514
|
+
}, Ll = (e, t) => {
|
|
3515
|
+
const [n, r] = z(() => ({ overrides: t, locale: e, labels: Rt(e, t) }));
|
|
3431
3516
|
if (n.locale === e && Nr(n.overrides, t)) return n.labels;
|
|
3432
3517
|
const o = { overrides: t, locale: e, labels: Rt(e, t) };
|
|
3433
3518
|
return r(o), o.labels;
|
|
3434
|
-
},
|
|
3435
|
-
const [r, o] =
|
|
3519
|
+
}, Nl = (e, t, n) => {
|
|
3520
|
+
const [r, o] = z(() => ({ scope: t, store: Wt(e, n) }));
|
|
3436
3521
|
if (r.scope === t && r.store.storageKey === e && r.store.defaults === n) return r.store;
|
|
3437
3522
|
const i = { scope: t, store: Wt(e, n) };
|
|
3438
3523
|
return o(i), i.store;
|
|
3439
3524
|
}, Ye = (e, t) => {
|
|
3440
|
-
const [n, r] =
|
|
3525
|
+
const [n, r] = z(() => ({ scope: e, value: t() }));
|
|
3441
3526
|
if (n.scope === e) return n.value;
|
|
3442
3527
|
const o = { scope: e, value: t() };
|
|
3443
3528
|
return r(o), o.value;
|
|
3444
|
-
},
|
|
3529
|
+
}, Dl = () => il(Al), en = "on", Pl = "off", Fl = Object.freeze({ kind: "unavailable" }), $l = (e) => {
|
|
3445
3530
|
if (e !== void 0 && (e === null || typeof e != "object" || typeof e.convert != "function"))
|
|
3446
3531
|
throw new TypeError("[markdown-explorer] draftConverter must be an object with a convert function");
|
|
3447
|
-
},
|
|
3532
|
+
}, ql = (e, t) => {
|
|
3448
3533
|
const n = ue(e.peek(t));
|
|
3449
3534
|
return n === null || n.document.kind === "failure" ? se(t) : n.document.name;
|
|
3450
|
-
},
|
|
3535
|
+
}, Ql = ({
|
|
3451
3536
|
data: e,
|
|
3452
3537
|
config: t,
|
|
3453
3538
|
storageNamespace: n,
|
|
3454
3539
|
locale: r,
|
|
3455
3540
|
labels: o,
|
|
3456
3541
|
theme: i,
|
|
3457
|
-
renderFrame:
|
|
3542
|
+
renderFrame: a,
|
|
3458
3543
|
renderTreeFailure: u,
|
|
3459
3544
|
lockDocumentScroll: m = !1,
|
|
3460
3545
|
onMathDiagnostics: f,
|
|
3461
|
-
onEditGrant:
|
|
3546
|
+
onEditGrant: c,
|
|
3462
3547
|
draftConverter: h
|
|
3463
3548
|
}) => {
|
|
3464
|
-
|
|
3465
|
-
const g = un(r),
|
|
3466
|
-
}), A =
|
|
3467
|
-
const
|
|
3468
|
-
return Xe(
|
|
3549
|
+
yr(n), $l(h);
|
|
3550
|
+
const g = un(r), E = Dr(i), k = Ll(g, o), { revalidate: R } = Vn(), T = _(() => {
|
|
3551
|
+
}), A = Fe(t.dataPath), [L] = z(() => {
|
|
3552
|
+
const x = ll({ dataPath: A, onScope: (F) => T.current(F) }), C = { documents: Fo({ client: x, capacity: Math.max(Ml, t.multiView.maxPanels * 2) }), trees: pl(x) };
|
|
3553
|
+
return Xe(C, e), kt(n, e.scope), { data: x, ...C, aligned: { pageData: e, storageNamespace: n, pendingReader: null } };
|
|
3469
3554
|
});
|
|
3470
3555
|
if (L.aligned.pageData !== e || L.aligned.storageNamespace !== n) {
|
|
3471
|
-
const
|
|
3472
|
-
L.aligned.pageData = e, L.aligned.storageNamespace = n,
|
|
3556
|
+
const x = L.aligned.pageData;
|
|
3557
|
+
L.aligned.pageData = e, L.aligned.storageNamespace = n, x !== e && (x.scope !== e.scope ? L.aligned.pendingReader = e : Xe(L, e)), kt(n, e.scope);
|
|
3473
3558
|
}
|
|
3474
|
-
const
|
|
3475
|
-
|
|
3476
|
-
const
|
|
3477
|
-
|
|
3478
|
-
}, [e, L]),
|
|
3479
|
-
let
|
|
3480
|
-
return
|
|
3481
|
-
|
|
3559
|
+
const b = Nl(we(n).treeSettings, e.scope, t.defaultTreeSettings);
|
|
3560
|
+
j(() => {
|
|
3561
|
+
const x = L.aligned.pendingReader;
|
|
3562
|
+
x !== null && (L.aligned.pendingReader = null, Qt(L), Xe(L, x));
|
|
3563
|
+
}, [e, L]), j(() => {
|
|
3564
|
+
let x = !1;
|
|
3565
|
+
return T.current = (C) => {
|
|
3566
|
+
C === e.scope || x || (x = !0, C !== null && (Qt(L), xr(n)), R());
|
|
3482
3567
|
}, () => {
|
|
3483
|
-
|
|
3568
|
+
T.current = () => {
|
|
3484
3569
|
};
|
|
3485
3570
|
};
|
|
3486
3571
|
}, [e, R, L, n]);
|
|
3487
|
-
const
|
|
3488
|
-
|
|
3489
|
-
|
|
3572
|
+
const w = _(t.settingsCookie);
|
|
3573
|
+
j(() => {
|
|
3574
|
+
w.current = t.settingsCookie;
|
|
3490
3575
|
}, [t.settingsCookie]);
|
|
3491
|
-
const [
|
|
3492
|
-
() =>
|
|
3493
|
-
document.cookie = er(
|
|
3576
|
+
const [l] = z(
|
|
3577
|
+
() => vl(e.settings, (x) => {
|
|
3578
|
+
document.cookie = er(w.current, x, window.location.protocol === "https:");
|
|
3494
3579
|
})
|
|
3495
|
-
), s = Ye(e.scope,
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
}, [
|
|
3499
|
-
const
|
|
3580
|
+
), s = Ye(e.scope, Dl), v = Ye(e.scope, sl), O = _(k);
|
|
3581
|
+
j(() => {
|
|
3582
|
+
O.current = k;
|
|
3583
|
+
}, [k]);
|
|
3584
|
+
const M = Ye(
|
|
3500
3585
|
e.scope,
|
|
3501
3586
|
() => Vr({
|
|
3502
3587
|
data: L.data,
|
|
3503
|
-
conflictLabels: () => ({ ours:
|
|
3504
|
-
onSaveSettled: (
|
|
3505
|
-
|
|
3506
|
-
const
|
|
3507
|
-
|
|
3588
|
+
conflictLabels: () => ({ ours: O.current.conflictOurs, theirs: O.current.conflictTheirs }),
|
|
3589
|
+
onSaveSettled: (x, C) => {
|
|
3590
|
+
C.kind === "saved" && L.documents.refresh(x);
|
|
3591
|
+
const F = Fr(O.current, C, ql(L.documents, x));
|
|
3592
|
+
F !== null && s.announce(F);
|
|
3508
3593
|
},
|
|
3509
3594
|
sideBySideSetting: {
|
|
3510
3595
|
read: () => Qe(we(n).editPreview) === en,
|
|
3511
|
-
write: (
|
|
3596
|
+
write: (x) => Je(we(n).editPreview, x ? en : Pl)
|
|
3512
3597
|
},
|
|
3513
3598
|
editorShareSetting: {
|
|
3514
3599
|
read: () => Hr(Qe(we(n).editSplit)),
|
|
3515
|
-
write: (
|
|
3600
|
+
write: (x) => Je(we(n).editSplit, String(x))
|
|
3516
3601
|
}
|
|
3517
3602
|
})
|
|
3518
|
-
), N =
|
|
3519
|
-
`), W =
|
|
3520
|
-
`)), [t, q]),
|
|
3521
|
-
|
|
3522
|
-
|
|
3603
|
+
), N = U(() => Te(e.notices.catch(() => [])), [e.notices]), q = e.sources.map((x) => x.id).join(`
|
|
3604
|
+
`), W = U(() => Qn(t, q.split(`
|
|
3605
|
+
`)), [t, q]), G = _(f);
|
|
3606
|
+
j(() => {
|
|
3607
|
+
G.current = f;
|
|
3523
3608
|
}, [f]);
|
|
3524
|
-
const [
|
|
3525
|
-
|
|
3526
|
-
}),
|
|
3527
|
-
|
|
3528
|
-
|
|
3609
|
+
const [I] = z(() => (x, C) => {
|
|
3610
|
+
G.current?.(x, C);
|
|
3611
|
+
}), J = f === void 0 ? void 0 : I, H = _(h);
|
|
3612
|
+
j(() => {
|
|
3613
|
+
H.current = h;
|
|
3529
3614
|
}, [h]);
|
|
3530
|
-
const [
|
|
3531
|
-
let
|
|
3615
|
+
const [ne] = z(() => {
|
|
3616
|
+
let x = !1;
|
|
3532
3617
|
return {
|
|
3533
|
-
convert: (
|
|
3534
|
-
const
|
|
3535
|
-
return
|
|
3618
|
+
convert: (C, F) => {
|
|
3619
|
+
const B = H.current;
|
|
3620
|
+
return B === void 0 ? Promise.resolve(Fl) : B.convert(C, F);
|
|
3536
3621
|
},
|
|
3537
3622
|
prepare: () => {
|
|
3538
3623
|
try {
|
|
3539
|
-
|
|
3540
|
-
} catch (
|
|
3541
|
-
if (
|
|
3542
|
-
|
|
3624
|
+
H.current?.prepare?.();
|
|
3625
|
+
} catch (C) {
|
|
3626
|
+
if (x) return;
|
|
3627
|
+
x = !0, console.error("[markdown-explorer] the draft converter's prepare threw", C);
|
|
3543
3628
|
}
|
|
3544
3629
|
}
|
|
3545
3630
|
};
|
|
3546
|
-
}), p = h === void 0 ? void 0 :
|
|
3631
|
+
}), p = h === void 0 ? void 0 : ne, S = U(
|
|
3547
3632
|
() => ({
|
|
3548
3633
|
config: W,
|
|
3549
|
-
labels:
|
|
3634
|
+
labels: k,
|
|
3550
3635
|
locale: g,
|
|
3551
|
-
theme:
|
|
3636
|
+
theme: E,
|
|
3552
3637
|
storageNamespace: n,
|
|
3553
3638
|
scope: e.scope,
|
|
3554
3639
|
sources: e.sources,
|
|
@@ -3556,92 +3641,92 @@ const ga = () => {
|
|
|
3556
3641
|
documents: L.documents,
|
|
3557
3642
|
trees: L.trees,
|
|
3558
3643
|
data: L.data,
|
|
3559
|
-
viewSettings:
|
|
3560
|
-
treeSettings:
|
|
3644
|
+
viewSettings: l,
|
|
3645
|
+
treeSettings: b,
|
|
3561
3646
|
announcer: s,
|
|
3562
|
-
reveals:
|
|
3563
|
-
edits:
|
|
3564
|
-
onEditGrant:
|
|
3647
|
+
reveals: v,
|
|
3648
|
+
edits: M,
|
|
3649
|
+
onEditGrant: c,
|
|
3565
3650
|
draftConverter: p,
|
|
3566
3651
|
renderTreeFailure: u,
|
|
3567
|
-
reportMathDiagnostics:
|
|
3652
|
+
reportMathDiagnostics: J
|
|
3568
3653
|
}),
|
|
3569
|
-
[W,
|
|
3654
|
+
[W, k, g, E, n, e.scope, e.sources, N, L, l, b, s, v, M, c, p, u, J]
|
|
3570
3655
|
);
|
|
3571
|
-
return /* @__PURE__ */
|
|
3572
|
-
},
|
|
3573
|
-
const [o] =
|
|
3574
|
-
return /* @__PURE__ */
|
|
3575
|
-
},
|
|
3576
|
-
const { theme: n, labels: r } = D(), o =
|
|
3577
|
-
|
|
3578
|
-
o.kind === "redirect" &&
|
|
3579
|
-
}, [o, i,
|
|
3656
|
+
return /* @__PURE__ */ d(fn, { value: S, children: /* @__PURE__ */ d(Il, { renderFrame: a, lockDocumentScroll: m }, e.scope) });
|
|
3657
|
+
}, _l = ({ ref: e, theme: t, view: n, children: r }) => {
|
|
3658
|
+
const [o] = z(bi);
|
|
3659
|
+
return /* @__PURE__ */ d("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 });
|
|
3660
|
+
}, Il = ({ renderFrame: e, lockDocumentScroll: t }) => {
|
|
3661
|
+
const { theme: n, labels: r } = D(), o = at(), { hash: i } = nn(), a = $e(), u = _(null);
|
|
3662
|
+
xl(t, u), j(() => {
|
|
3663
|
+
o.kind === "redirect" && a(`${o.href}${i}`, "browse");
|
|
3664
|
+
}, [o, i, a]);
|
|
3580
3665
|
const { location: m } = o, f = m.view;
|
|
3581
|
-
|
|
3582
|
-
const
|
|
3583
|
-
|
|
3584
|
-
/* @__PURE__ */
|
|
3585
|
-
/* @__PURE__ */
|
|
3666
|
+
Rl(u, f);
|
|
3667
|
+
const c = m.view === "tree" ? /* @__PURE__ */ d(ke, { fallback: /* @__PURE__ */ d("section", { className: "aqmx-split-fallback", "aria-label": r.explorerRegion, "aria-busy": "true", "data-testid": "markdown-explorer-split-loading", ...et }), children: /* @__PURE__ */ d(Ol, { location: m }) }) : m.view === "multi" ? /* @__PURE__ */ d(ke, { fallback: /* @__PURE__ */ d("section", { className: "aqmx-stage-fallback", "aria-label": r.multiRegion, "aria-busy": "true", "data-testid": "markdown-explorer-stage-loading", ...et }), children: /* @__PURE__ */ d(Cl, { location: m }) }) : /* @__PURE__ */ d(rl, { location: m }), h = /* @__PURE__ */ $(_l, { ref: u, theme: n, view: f, children: [
|
|
3668
|
+
c,
|
|
3669
|
+
/* @__PURE__ */ d(so, {}),
|
|
3670
|
+
/* @__PURE__ */ d(ol, { holds: !0, testId: "markdown-explorer-announcer" })
|
|
3586
3671
|
] });
|
|
3587
3672
|
return e === void 0 ? h : e({ view: f, children: h });
|
|
3588
3673
|
}, es = kr({ submissions: "skip", otherPath: "skip", query: "skip", hashChange: "skip" });
|
|
3589
3674
|
export {
|
|
3590
3675
|
Tt as $,
|
|
3591
3676
|
rt as A,
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
3677
|
+
Ut as B,
|
|
3678
|
+
$r as C,
|
|
3679
|
+
nl as D,
|
|
3680
|
+
Pa as E,
|
|
3596
3681
|
Jr as F,
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3682
|
+
qa as G,
|
|
3683
|
+
Oe as H,
|
|
3684
|
+
Yl as I,
|
|
3685
|
+
Si as J,
|
|
3686
|
+
Zr as K,
|
|
3687
|
+
yn as L,
|
|
3603
3688
|
Do as M,
|
|
3604
3689
|
Qi as N,
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
|
|
3690
|
+
ga as O,
|
|
3691
|
+
tl as P,
|
|
3692
|
+
Ao as Q,
|
|
3693
|
+
Ma as R,
|
|
3694
|
+
Mo as S,
|
|
3695
|
+
at as T,
|
|
3696
|
+
ol as U,
|
|
3697
|
+
Le as V,
|
|
3613
3698
|
Tr as W,
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3699
|
+
Ot as X,
|
|
3700
|
+
Mr as Y,
|
|
3701
|
+
cn as Z,
|
|
3617
3702
|
Rr as _,
|
|
3618
3703
|
qr as a,
|
|
3619
|
-
|
|
3704
|
+
Ql as a0,
|
|
3620
3705
|
Rt as a1,
|
|
3621
3706
|
es as a2,
|
|
3622
3707
|
_r as b,
|
|
3623
|
-
|
|
3624
|
-
|
|
3708
|
+
$e as c,
|
|
3709
|
+
Ja as d,
|
|
3625
3710
|
et as e,
|
|
3626
|
-
|
|
3627
|
-
|
|
3711
|
+
va as f,
|
|
3712
|
+
xo as g,
|
|
3628
3713
|
Ir as h,
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3714
|
+
Oo as i,
|
|
3715
|
+
yo as j,
|
|
3716
|
+
le as k,
|
|
3717
|
+
Co as l,
|
|
3633
3718
|
ue as m,
|
|
3634
3719
|
Eo as n,
|
|
3635
|
-
|
|
3720
|
+
So as o,
|
|
3636
3721
|
me as p,
|
|
3637
|
-
|
|
3722
|
+
ao as q,
|
|
3638
3723
|
to as r,
|
|
3639
|
-
|
|
3640
|
-
|
|
3724
|
+
$a as s,
|
|
3725
|
+
Xl as t,
|
|
3641
3726
|
D as u,
|
|
3642
3727
|
ko as v,
|
|
3643
|
-
|
|
3728
|
+
Jl as w,
|
|
3644
3729
|
hn as x,
|
|
3645
|
-
|
|
3646
|
-
|
|
3730
|
+
Ia as y,
|
|
3731
|
+
_a as z
|
|
3647
3732
|
};
|