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