@aiquants/markdown-explorer 0.27.0 → 0.29.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 (37) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/README.md +12 -5
  3. package/dist/{EditSurface-B1yD7ywF.cjs → EditSurface-B9IpZlBX.cjs} +2 -2
  4. package/dist/{EditSurface-sUNqYw9o.js → EditSurface-BrdChI9n.js} +54 -54
  5. package/dist/{ExplorerSplit-pClUl3-e.js → ExplorerSplit-B-fr2nlU.js} +99 -99
  6. package/dist/{ExplorerSplit-Bn3ZnEMZ.cjs → ExplorerSplit-B99KbYXc.cjs} +1 -1
  7. package/dist/MultiLayout-BZ0zTAoi.cjs +1 -0
  8. package/dist/{MultiLayout-B-ft4_Vs.js → MultiLayout-Pf-6yPif.js} +167 -168
  9. package/dist/NativeScrollBar-Bj5_LmwY.cjs +1 -0
  10. package/dist/{NativeScrollBar-ByawerpG.js → NativeScrollBar-ybJw3OHE.js} +6 -7
  11. package/dist/{TreeLayout-DjIVKBG4.js → TreeLayout-C4l591Nc.js} +9 -9
  12. package/dist/{TreeLayout-CXHbKdxy.cjs → TreeLayout-CblPMzQi.cjs} +1 -1
  13. package/dist/index-CnX313Ss.cjs +15 -0
  14. package/dist/{index-BNAkC0g3.js → index-awodBw8r.js} +1054 -1021
  15. package/dist/index.cjs +1 -1
  16. package/dist/index.js +10 -10
  17. package/dist/{location-BNFdxzhn.js → location-CKuabtKl.js} +83 -82
  18. package/dist/location-l_HysaZR.cjs +1 -0
  19. package/dist/{merge-BBU1pDoT.cjs → merge-DffWW96L.cjs} +1 -1
  20. package/dist/{merge-DhHzRcAI.js → merge-qfptirid.js} +1 -1
  21. package/dist/server.cjs +1 -1
  22. package/dist/server.js +2 -2
  23. package/dist/styles/markdown-explorer.css +1 -1
  24. package/dist/tapScrollCircle-CDBXEKvI.cjs +1 -0
  25. package/dist/tapScrollCircle-DYmzWI-8.js +12 -0
  26. package/dist/{useSplitPersistence-xGOSwpLM.cjs → useSplitPersistence-9Nu6J1WF.cjs} +1 -1
  27. package/dist/{useSplitPersistence-D5EjJwCg.js → useSplitPersistence-Bf4M35Il.js} +1 -1
  28. package/docs/behavior/layout.md +6 -2
  29. package/package.json +5 -5
  30. package/dist/MultiLayout-0Jh08fxo.cjs +0 -1
  31. package/dist/NativeScrollBar-D9QrjRJa.cjs +0 -1
  32. package/dist/index-DRMNpWDJ.cjs +0 -15
  33. package/dist/location-yvU5HUY1.cjs +0 -1
  34. package/dist/scrollBarGeometry-C46jBtmM.cjs +0 -1
  35. package/dist/scrollBarGeometry-DOBdGNV-.js +0 -4
  36. package/dist/tapScrollCircle-C5DGI-0H.cjs +0 -1
  37. package/dist/tapScrollCircle-u4EXeLhx.js +0 -6
@@ -1,27 +1,27 @@
1
1
  import { jsxs as B, jsx as c, Fragment as pe } from "react/jsx-runtime";
2
2
  import * as E from "react";
3
- import { createContext as ve, use as se, useMemo as X, useSyncExternalStore as oe, useRef as U, useLayoutEffect as Y, useCallback as F, useId as Te, useEffect as ee, Component as Yn, Suspense as Ie, lazy as Pt, useState as V, useEffectEvent as le } from "react";
4
- import { useParams as uo, useSearchParams as fo, matchPath as mo, useBlocker as ho, useNavigate as po, Link as go, useHref as nt, useLocation as Xn, useRevalidator as wo } from "react-router";
5
- import { k as vo, h as Jn, H as bo, E as Qn, a as er, I as yo, J as Qt, K as ko, L as Le, e as Ne, m as Eo, M as So, O as xo, Q as To, R as en, T as Ro, U as tn, V as Oo, w as Co, W as Mo } from "./location-BNFdxzhn.js";
6
- import { SPREADSHEET_BLOCK_LABEL_PLACEHOLDERS as nn, SPREADSHEET_BLOCK_LABEL_CATALOGS as Xe } from "@aiquants/markdown/code-blocks";
7
- import { H as fe, i as Lo, I as rt, J as Ao, A as te, K as dt, B as ut, z as No, L as Do, f as Po, N as Io, O as $o, P as _o, Q as Fo, R as rn, x as qo, S as Bo, T as Uo, U as Ho, D as zo, y as jo, V as Vo, W as Zo, X as Wo, w as on } from "./dataRoute-DLhQfdoW.js";
8
- import { HostedScrollArea as sn, SpreadsheetBlock as Go, useMarkdownToolbarState as Ko, MarkdownViewer as tr } from "@aiquants/markdown";
9
- import { SOURCE_LINES_ATTRIBUTE as nr, parseSourceLines as Yo } from "@aiquants/markdown/source-lines";
10
- import { iterateTsvRows as Xo, iterateTsvPrefixRows as Jo, serializeTsv as Qo } from "@aiquants/spreadsheet/tsv";
11
- import { SPREADSHEET_MAX_OPERATION_CELLS as an } from "@aiquants/spreadsheet/view";
12
- import { DEFAULT_CONTENT_ALIGN as es } from "@aiquants/markdown/viewer-settings";
13
- import { w as Rt, r as Ot, a as ts, b as ln, s as Ce, c as ns } from "./storage-CmGHg7OA.js";
14
- import { createShouldRevalidate as rs } from "@aiquants/route-revalidation";
15
- const cn = Object.freeze(["en", "ja"]), os = "en", It = (e) => `viewerSpreadsheet${e.charAt(0).toUpperCase()}${e.slice(1)}`, rr = Object.freeze(Object.keys(Xe.en)), or = (e) => Object.fromEntries(rr.map((t) => [It(t), Xe[e][t].text])), ss = Object.freeze({
3
+ import { createContext as ve, use as se, useMemo as X, useSyncExternalStore as re, useRef as U, useLayoutEffect as Y, useCallback as F, useId as Te, useEffect as ee, Component as Qn, Suspense as Ie, lazy as $t, useState as V, useEffectEvent as le } from "react";
4
+ import { useParams as vo, useSearchParams as bo, matchPath as yo, useBlocker as ko, useNavigate as Eo, Link as So, useHref as nt, useLocation as er, useRevalidator as xo } from "react-router";
5
+ import { k as To, h as tr, H as Ro, E as nr, a as rr, I as Co, J as nn, K as Oo, s as Lo, L as Mo, M as Me, e as Ne, m as Ao, O as No, Q as Do, R as Po, T as rn, U as Io, V as on, W as $o, w as _o, X as Fo } from "./location-CKuabtKl.js";
6
+ import { SPREADSHEET_BLOCK_LABEL_PLACEHOLDERS as sn, SPREADSHEET_BLOCK_LABEL_CATALOGS as Xe } from "@aiquants/markdown/code-blocks";
7
+ import { H as fe, i as qo, I as rt, J as Bo, A as te, K as dt, B as ut, z as Uo, L as Ho, f as zo, N as jo, O as Vo, P as Zo, Q as Wo, R as an, x as Go, S as Ko, T as Yo, U as Xo, D as Jo, y as Qo, V as es, W as ts, X as ns, w as ln } from "./dataRoute-DLhQfdoW.js";
8
+ import { HostedScrollArea as cn, SpreadsheetBlock as rs, useMarkdownToolbarState as os, MarkdownViewer as or } from "@aiquants/markdown";
9
+ import { SOURCE_LINES_ATTRIBUTE as sr, parseSourceLines as ss } from "@aiquants/markdown/source-lines";
10
+ import { iterateTsvRows as as, iterateTsvPrefixRows as is, serializeTsv as ls } from "@aiquants/spreadsheet/tsv";
11
+ import { SPREADSHEET_MAX_OPERATION_CELLS as dn } from "@aiquants/spreadsheet/view";
12
+ import { DEFAULT_CONTENT_ALIGN as cs } from "@aiquants/markdown/viewer-settings";
13
+ import { w as Ct, r as Ot, a as ds, b as un, s as Oe, c as us } from "./storage-CmGHg7OA.js";
14
+ import { createShouldRevalidate as fs } from "@aiquants/route-revalidation";
15
+ const fn = Object.freeze(["en", "ja"]), ms = "en", _t = (e) => `viewerSpreadsheet${e.charAt(0).toUpperCase()}${e.slice(1)}`, ar = Object.freeze(Object.keys(Xe.en)), ir = (e) => Object.fromEntries(ar.map((t) => [_t(t), Xe[e][t].text])), hs = Object.freeze({
16
16
  panelMoved: Object.freeze(["title", "column", "position"]),
17
17
  panelMoveUnavailable: Object.freeze(["title", "move"]),
18
18
  panelDragStarted: Object.freeze(["title"]),
19
19
  panelDragCancelled: Object.freeze(["title"]),
20
20
  multiColumnRegion: Object.freeze(["column"]),
21
21
  viewerSvgImageSourceRegion: Object.freeze(["name"]),
22
- ...Object.fromEntries(rr.filter((e) => nn[e].length > 0).map((e) => [It(e), nn[e]]))
23
- }), as = /\{(\w+)\}/gu, sr = {
24
- ...or("en"),
22
+ ...Object.fromEntries(ar.filter((e) => sn[e].length > 0).map((e) => [_t(e), sn[e]]))
23
+ }), ps = /\{(\w+)\}/gu, lr = {
24
+ ...ir("en"),
25
25
  explorerRegion: "Explorer",
26
26
  sourceLabel: "Source",
27
27
  refreshTreeLabel: "Refresh tree",
@@ -316,8 +316,8 @@ const cn = Object.freeze(["en", "ja"]), os = "en", It = (e) => `viewerSpreadshee
316
316
  multiColumnEmpty: "This column is empty",
317
317
  multiColumnRegion: "Column {column}",
318
318
  panelDropHere: "Drop the panel here"
319
- }, is = {
320
- ...or("ja"),
319
+ }, gs = {
320
+ ...ir("ja"),
321
321
  explorerRegion: "エクスプローラー",
322
322
  sourceLabel: "ソース",
323
323
  refreshTreeLabel: "ツリーを更新",
@@ -612,24 +612,24 @@ const cn = Object.freeze(["en", "ja"]), os = "en", It = (e) => `viewerSpreadshee
612
612
  multiColumnEmpty: "この列は空です",
613
613
  multiColumnRegion: "{column} 列目",
614
614
  panelDropHere: "ここへパネルをドロップ"
615
- }, ls = Object.freeze({
616
- en: Object.freeze(sr),
617
- ja: Object.freeze(is)
618
- }), ar = Object.freeze(Object.keys(sr)), cs = new Set(ar), ds = (e) => cs.has(e), Ge = (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, ir = (e) => {
619
- if (e === void 0) return os;
620
- if (cn.includes(e)) return e;
621
- throw new RangeError(`[markdown-explorer] locale is the UI language (${cn.map((t) => JSON.stringify(t)).join(" or ")}), not a BCP 47 tag; got ${Ge(e)}`);
622
- }, dn = (e, t) => {
623
- const n = ls[ir(e)];
615
+ }, ws = Object.freeze({
616
+ en: Object.freeze(lr),
617
+ ja: Object.freeze(gs)
618
+ }), cr = Object.freeze(Object.keys(lr)), vs = new Set(cr), bs = (e) => vs.has(e), Ge = (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, dr = (e) => {
619
+ if (e === void 0) return ms;
620
+ if (fn.includes(e)) return e;
621
+ throw new RangeError(`[markdown-explorer] locale is the UI language (${fn.map((t) => JSON.stringify(t)).join(" or ")}), not a BCP 47 tag; got ${Ge(e)}`);
622
+ }, mn = (e, t) => {
623
+ const n = ws[dr(e)];
624
624
  if (t === void 0) return n;
625
625
  if (t === null || typeof t != "object")
626
626
  throw new RangeError(`[markdown-explorer] labels must be an object; got ${Ge(t)}`);
627
- if (!vo(t))
627
+ if (!To(t))
628
628
  throw new RangeError(`[markdown-explorer] labels must be a plain object; got ${Ge(t)}`);
629
629
  const r = t, o = { ...n };
630
630
  for (const s of Object.keys(r)) {
631
- if (!ds(s))
632
- throw new RangeError(`[markdown-explorer] labels.${s} is not a known label key; expected one of ${ar.join(", ")}`);
631
+ if (!bs(s))
632
+ throw new RangeError(`[markdown-explorer] labels.${s} is not a known label key; expected one of ${cr.join(", ")}`);
633
633
  const a = r[s];
634
634
  if (a === void 0) continue;
635
635
  const i = typeof n[s];
@@ -637,35 +637,35 @@ const cn = Object.freeze(["en", "ja"]), os = "en", It = (e) => `viewerSpreadshee
637
637
  throw new TypeError(`[markdown-explorer] labels.${s} must be a ${i}; got ${Ge(a)}`);
638
638
  if (typeof a == "string" && a.trim() === "")
639
639
  throw new RangeError(`[markdown-explorer] labels.${s} must be a non-blank string`);
640
- const f = ss[s];
640
+ const f = hs[s];
641
641
  if (typeof a == "string" && f !== void 0) {
642
- for (const [, u] of a.matchAll(as))
642
+ for (const [, u] of a.matchAll(ps))
643
643
  if (!f.includes(u ?? ""))
644
644
  throw new RangeError(`[markdown-explorer] labels.${s} uses the unknown placeholder {${String(u)}}; it accepts ${f.map((l) => `{${l}}`).join(", ")}`);
645
645
  }
646
646
  o[s] = a;
647
647
  }
648
648
  return Object.freeze(o);
649
- }, us = (e, t) => {
649
+ }, ys = (e, t) => {
650
650
  if (Object.is(e, t)) return !0;
651
651
  if (e === null || t === null || typeof e != "object" || typeof t != "object") return !1;
652
652
  const n = e, r = t, o = Object.keys(n), s = Object.keys(r);
653
653
  return o.length === s.length && s.every((a) => Object.hasOwn(n, a) && Object.is(n[a], r[a]));
654
- }, un = Object.freeze(["light", "dark"]), fs = (e) => {
654
+ }, hn = Object.freeze(["light", "dark"]), ks = (e) => {
655
655
  if (e === void 0) return "light";
656
- if (un.includes(e)) return e;
657
- throw new RangeError(`[markdown-explorer] theme must be ${un.map((t) => JSON.stringify(t)).join(" or ")}; got ${typeof e == "string" ? JSON.stringify(e) : typeof e}`);
658
- }, lr = ve(null), $ = () => {
659
- const e = se(lr);
656
+ if (hn.includes(e)) return e;
657
+ throw new RangeError(`[markdown-explorer] theme must be ${hn.map((t) => JSON.stringify(t)).join(" or ")}; got ${typeof e == "string" ? JSON.stringify(e) : typeof e}`);
658
+ }, ur = ve(null), $ = () => {
659
+ const e = se(ur);
660
660
  if (e === null) throw new Error("[markdown-explorer] explorer components must be rendered inside <MarkdownExplorer>");
661
661
  return e;
662
662
  }, Je = (e) => {
663
663
  const { viewSettings: t } = $(), n = () => e(t.getSnapshot());
664
- return oe(t.subscribe, n, n);
665
- }, $t = () => {
666
- const { config: e } = $(), t = uo()["*"], [n] = fo(), r = n.toString();
667
- return X(() => Jn(e, t, new URLSearchParams(r)), [e, t, r]);
668
- }, cr = {
664
+ return re(t.subscribe, n, n);
665
+ }, Ft = () => {
666
+ const { config: e } = $(), t = vo()["*"], [n] = bo(), r = n.toString();
667
+ return X(() => tr(e, t, new URLSearchParams(r)), [e, t, r]);
668
+ }, fr = {
669
669
  unauthorized: ["failureUnauthorizedTitle", "failureUnauthorizedBody"],
670
670
  forbidden: ["failureForbiddenTitle", "failureForbiddenBody"],
671
671
  "not-found": ["failureNotFoundTitle", "failureNotFoundBody"],
@@ -674,14 +674,14 @@ const cn = Object.freeze(["en", "ja"]), os = "en", It = (e) => `viewerSpreadshee
674
674
  "too-large": ["failureTooLargeTitle", "failureTooLargeBody"],
675
675
  unsupported: ["failureUnsupportedTitle", "failureUnsupportedBody"],
676
676
  failed: ["failureFailedTitle", "failureFailedBody"]
677
- }, de = (e, t) => e[cr[t][0]], Re = ({ failure: e, alert: t, onRetry: n, testId: r }) => {
678
- const { labels: o } = $(), s = de(o, e.reason), a = o[cr[e.reason][1]], i = e.reason === "unauthorized" || e.reason === "forbidden" || e.reason === "failed" ? "danger" : "warning";
677
+ }, de = (e, t) => e[fr[t][0]], Re = ({ failure: e, alert: t, onRetry: n, testId: r }) => {
678
+ const { labels: o } = $(), s = de(o, e.reason), a = o[fr[e.reason][1]], i = e.reason === "unauthorized" || e.reason === "forbidden" || e.reason === "failed" ? "danger" : "warning";
679
679
  return /* @__PURE__ */ B("div", { className: "aqmx-callout", role: t ? "alert" : void 0, "data-aqmx-tone": i, "data-testid": r === null ? void 0 : r, "data-aqmx-failure": r === null ? void 0 : e.reason, children: [
680
680
  /* @__PURE__ */ c("p", { className: "aqmx-callout-title", children: s }),
681
681
  /* @__PURE__ */ c("p", { className: "aqmx-callout-body", children: a }),
682
682
  e.reason === "unauthorized" ? /* @__PURE__ */ c("button", { type: "button", className: "aqmx-callout-action", onClick: () => window.location.reload(), children: o.reloadPage }) : n !== void 0 && e.reason === "failed" ? /* @__PURE__ */ c("button", { type: "button", className: "aqmx-callout-action", onClick: n, children: o.retry }) : null
683
683
  ] });
684
- }, ms = (e, t) => {
684
+ }, Es = (e, t) => {
685
685
  const { phase: n, save: r, dirty: o } = t;
686
686
  switch (n.kind) {
687
687
  case "opening":
@@ -707,7 +707,7 @@ const cn = Object.freeze(["en", "ja"]), os = "en", It = (e) => `viewerSpreadshee
707
707
  break;
708
708
  }
709
709
  return o ? e.draftUnsaved : "";
710
- }, hs = (e, t, n) => {
710
+ }, Ss = (e, t, n) => {
711
711
  switch (t.kind) {
712
712
  case "draft":
713
713
  return e.draftNotSaved;
@@ -733,28 +733,28 @@ const cn = Object.freeze(["en", "ja"]), os = "en", It = (e) => `viewerSpreadshee
733
733
  for (const t of [...e]) t();
734
734
  }
735
735
  };
736
- }, ps = "<<<<<<<", gs = "=======", ws = ">>>>>>>", fn = (e, t) => e === t || e.startsWith(`${t} `), mn = (e) => vs(e.split(`
737
- `)), vs = (e) => {
736
+ }, xs = "<<<<<<<", Ts = "=======", Rs = ">>>>>>>", pn = (e, t) => e === t || e.startsWith(`${t} `), gn = (e) => Cs(e.split(`
737
+ `)), Cs = (e) => {
738
738
  const t = [];
739
739
  let n = null, r = null, o = 0;
740
740
  for (const s of e) {
741
741
  o += 1;
742
742
  const a = s.charCodeAt(0);
743
- a !== 60 && a !== 61 && a !== 62 || (fn(s, ps) ? (n = o, r = null) : s === gs ? n !== null && r === null ? r = o : n = null : fn(s, ws) && (n !== null && r !== null && t.push({ start: n, separator: r, end: o }), n = null, r = null));
743
+ a !== 60 && a !== 61 && a !== 62 || (pn(s, xs) ? (n = o, r = null) : s === Ts ? n !== null && r === null ? r = o : n = null : pn(s, Rs) && (n !== null && r !== null && t.push({ start: n, separator: r, end: o }), n = null, r = null));
744
744
  }
745
745
  return t;
746
- }, hn = (e) => e.includes(`\r
746
+ }, wn = (e) => e.includes(`\r
747
747
  `) ? `\r
748
748
  ` : `
749
749
  `, ft = (e) => e.replace(/\r\n?/gu, `
750
- `), bs = (e, t) => t === `
750
+ `), Os = (e, t) => t === `
751
751
  ` ? e : e.replaceAll(`
752
752
  `, `\r
753
- `), ys = 3, ks = /^\d+(?:\.\d+)?$/u, Es = (e) => {
754
- if (e === null || !ks.test(e)) return null;
753
+ `), Ls = 3, Ms = /^\d+(?:\.\d+)?$/u, As = (e) => {
754
+ if (e === null || !Ms.test(e)) return null;
755
755
  const t = Number(e);
756
- return t >= er && t <= Qn ? t : null;
757
- }, mt = Object.freeze({ kind: "idle" }), pn = Object.freeze({ kind: "draft" }), Ss = ({ data: e, conflictLabels: t, onSaveSettled: n, sideBySideSetting: r, editorShareSetting: o }) => {
756
+ return t >= rr && t <= nr ? t : null;
757
+ }, mt = Object.freeze({ kind: "idle" }), vn = Object.freeze({ kind: "draft" }), Ns = ({ data: e, conflictLabels: t, onSaveSettled: n, sideBySideSetting: r, editorShareSetting: o }) => {
758
758
  const s = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map(), l = qe();
759
759
  let d = null, h = null, g = null;
760
760
  const v = (m, p) => {
@@ -774,8 +774,8 @@ const cn = Object.freeze(["en", "ja"]), os = "en", It = (e) => `viewerSpreadshee
774
774
  return;
775
775
  }
776
776
  const I = ft(A.text), _ = A.kind === "draft";
777
- p.base = { text: I, version: _ ? null : A.version }, p.draft = I, p.ending = hn(A.text), v(p, { phase: { kind: "editing" }, history: _ ? !1 : A.history, dirty: !1, save: _ ? pn : mt, generation: p.value.generation + 1 });
778
- }, C = (m) => {
777
+ p.base = { text: I, version: _ ? null : A.version }, p.draft = I, p.ending = wn(A.text), v(p, { phase: { kind: "editing" }, history: _ ? !1 : A.history, dirty: !1, save: _ ? vn : mt, generation: p.value.generation + 1 });
778
+ }, O = (m) => {
779
779
  const p = s.get(m);
780
780
  p !== void 0 && (p.controller.abort(), s.delete(m), i.delete(m));
781
781
  }, R = (m, p, x) => (m.set(p, x), () => {
@@ -788,10 +788,10 @@ const cn = Object.freeze(["en", "ja"]), os = "en", It = (e) => `viewerSpreadshee
788
788
  if (p === void 0 || p.value.phase.kind !== "editing" || p.base === null || p.value.save.kind === "saving") return;
789
789
  const { version: x } = p.base;
790
790
  if (x === null) {
791
- n(m, pn);
791
+ n(m, vn);
792
792
  return;
793
793
  }
794
- const A = mn(p.draft).length;
794
+ const A = gn(p.draft).length;
795
795
  if (A > 0) {
796
796
  q(m, p, { kind: "conflicts", count: A });
797
797
  return;
@@ -800,27 +800,27 @@ const cn = Object.freeze(["en", "ja"]), os = "en", It = (e) => `viewerSpreadshee
800
800
  const { signal: I } = p.controller;
801
801
  let _ = { text: p.base.text, version: x }, b = p.draft, S = !1;
802
802
  v(p, { save: { kind: "saving" } });
803
- for (let M = 0; M < ys; M += 1) {
804
- const L = await e.save(m, _.version, bs(b, p.ending), I);
805
- if (!y(m, p) || I.aborted || !("kind" in L)) return;
806
- if (L.kind === "saved") {
807
- f.get(m)?.flush(), p.base = { text: b, version: L.version }, q(m, p, { kind: "saved", merged: S }, { dirty: p.draft !== b });
803
+ for (let L = 0; L < Ls; L += 1) {
804
+ const M = await e.save(m, _.version, Os(b, p.ending), I);
805
+ if (!y(m, p) || I.aborted || !("kind" in M)) return;
806
+ if (M.kind === "saved") {
807
+ f.get(m)?.flush(), p.base = { text: b, version: M.version }, q(m, p, { kind: "saved", merged: S }, { dirty: p.draft !== b });
808
808
  return;
809
809
  }
810
- if (L.kind === "grant") {
811
- q(m, p, { kind: "grant", href: L.href });
810
+ if (M.kind === "grant") {
811
+ q(m, p, { kind: "grant", href: M.href });
812
812
  return;
813
813
  }
814
- if (L.kind === "failure") {
815
- q(m, p, { kind: "failed", failure: L.failure });
814
+ if (M.kind === "failure") {
815
+ q(m, p, { kind: "failed", failure: M.failure });
816
816
  return;
817
817
  }
818
- const { mergeDraft: P } = await import("./merge-DhHzRcAI.js");
818
+ const { mergeDraft: P } = await import("./merge-qfptirid.js");
819
819
  if (!y(m, p) || I.aborted) return;
820
820
  const H = f.get(m);
821
821
  H?.flush();
822
- const K = ft(L.text), w = P(_.text, p.draft, K, t());
823
- if (_ = { text: K, version: L.version }, p.base = _, p.ending = hn(L.text), p.draft = w.text, H?.adopt(w.text), w.kind === "conflicts") {
822
+ const K = ft(M.text), w = P(_.text, p.draft, K, t());
823
+ if (_ = { text: K, version: M.version }, p.base = _, p.ending = wn(M.text), p.draft = w.text, H?.adopt(w.text), w.kind === "conflicts") {
824
824
  q(m, p, { kind: "conflicts", count: w.conflicts }, { dirty: !0, generation: p.value.generation + 1 });
825
825
  return;
826
826
  }
@@ -868,7 +868,7 @@ const cn = Object.freeze(["en", "ja"]), os = "en", It = (e) => `viewerSpreadshee
868
868
  I !== x.value.dirty && (A.dirty = I);
869
869
  const { save: _ } = x.value;
870
870
  if (_.kind === "conflicts") {
871
- const b = mn(p).length;
871
+ const b = gn(p).length;
872
872
  b === 0 ? A.save = mt : b !== _.count && (A.save = { kind: "conflicts", count: b });
873
873
  }
874
874
  (A.dirty !== void 0 || A.save !== void 0) && v(x, A);
@@ -889,7 +889,7 @@ const cn = Object.freeze(["en", "ja"]), os = "en", It = (e) => `viewerSpreadshee
889
889
  close: (m) => {
890
890
  if (!s.has(m)) return;
891
891
  const p = f.get(m), x = p === void 0 ? null : p.returnPoint();
892
- C(m), x === null ? a.delete(m) : a.set(m, x), l.emit();
892
+ O(m), x === null ? a.delete(m) : a.set(m, x), l.emit();
893
893
  },
894
894
  takeReturn: (m) => {
895
895
  const p = a.get(m) ?? null;
@@ -897,7 +897,7 @@ const cn = Object.freeze(["en", "ja"]), os = "en", It = (e) => `viewerSpreadshee
897
897
  },
898
898
  dirtyPaths: () => [...s.values()].filter((m) => m.value.dirty).map((m) => m.value.path),
899
899
  discard: (m) => {
900
- for (const p of m) C(p);
900
+ for (const p of m) O(p);
901
901
  m.length > 0 && l.emit();
902
902
  },
903
903
  editorState: {
@@ -928,7 +928,7 @@ const cn = Object.freeze(["en", "ja"]), os = "en", It = (e) => `viewerSpreadshee
928
928
  paths: m,
929
929
  settle: (A) => {
930
930
  if (g === x) {
931
- if (g = null, A) for (const I of m) C(I);
931
+ if (g = null, A) for (const I of m) O(I);
932
932
  l.emit(), p(A);
933
933
  }
934
934
  }
@@ -940,10 +940,10 @@ const cn = Object.freeze(["en", "ja"]), os = "en", It = (e) => `viewerSpreadshee
940
940
  setSideBySide: (m) => {
941
941
  d !== m && (d = m, r.write(m), l.emit());
942
942
  },
943
- editorShare: () => (h ??= o.read() ?? bo, h),
943
+ editorShare: () => (h ??= o.read() ?? Ro, h),
944
944
  setEditorShare: (m) => {
945
945
  if (!Number.isFinite(m)) throw new RangeError(`[markdown-explorer] an editor share must be a finite number; got ${String(m)}`);
946
- const p = Math.min(Qn, Math.max(er, m));
946
+ const p = Math.min(nr, Math.max(rr, m));
947
947
  h !== p && (h = p, o.write(p));
948
948
  },
949
949
  setView: (m, p) => {
@@ -955,18 +955,18 @@ const cn = Object.freeze(["en", "ja"]), os = "en", It = (e) => `viewerSpreadshee
955
955
  p !== void 0 && !p.value.previewPrepared && v(p, { previewPrepared: !0 });
956
956
  }
957
957
  };
958
- }, dr = (e) => {
958
+ }, mr = (e) => {
959
959
  e.preventDefault(), e.stopPropagation();
960
- }, xs = (e) => e.endsWith("px") ? Number.parseFloat(e) : Number.NaN, ur = "data-aqmx-content-pane", Ct = Object.freeze({ [ur]: "" }), Ts = "--aqmx-dialog-left", Rs = "--aqmx-dialog-top", Os = '[data-testid="markdown-explorer"]', Cs = (e) => {
961
- const t = e.closest(Os)?.querySelectorAll(`[${ur}]`), n = t?.item(t.length - 1);
960
+ }, Ds = (e) => e.endsWith("px") ? Number.parseFloat(e) : Number.NaN, hr = "data-aqmx-content-pane", Lt = Object.freeze({ [hr]: "" }), Ps = "--aqmx-dialog-left", Is = "--aqmx-dialog-top", $s = '[data-testid="markdown-explorer"]', _s = (e) => {
961
+ const t = e.closest($s)?.querySelectorAll(`[${hr}]`), n = t?.item(t.length - 1);
962
962
  if (!(n instanceof HTMLElement)) throw new Error("[markdown-explorer] a dialog opened where the explorer marks no content pane");
963
963
  return n;
964
- }, Ms = (e) => {
965
- const t = xs(getComputedStyle(e).marginTop);
964
+ }, Fs = (e) => {
965
+ const t = Ds(getComputedStyle(e).marginTop);
966
966
  if (Number.isNaN(t)) return null;
967
- const n = Cs(e), r = e.getBoundingClientRect(), o = e.ownerDocument.documentElement, { left: s, top: a } = yo(n.getBoundingClientRect(), { width: r.width + 2 * t, height: r.height + 2 * t }, { width: o.clientWidth, height: o.clientHeight });
968
- return e.style.setProperty(Ts, `${String(s)}px`), e.style.setProperty(Rs, `${String(a)}px`), n;
969
- }, Ls = (e) => e.preventDefault(), fr = ({ open: e, onOpen: t, onDismiss: n }) => {
967
+ const n = _s(e), r = e.getBoundingClientRect(), o = e.ownerDocument.documentElement, { left: s, top: a } = Co(n.getBoundingClientRect(), { width: r.width + 2 * t, height: r.height + 2 * t }, { width: o.clientWidth, height: o.clientHeight });
968
+ return e.style.setProperty(Ps, `${String(s)}px`), e.style.setProperty(Is, `${String(a)}px`), n;
969
+ }, qs = (e) => e.preventDefault(), pr = ({ open: e, onOpen: t, onDismiss: n }) => {
970
970
  const r = U(null), o = U(null), s = U(!1), a = U(t);
971
971
  Y(() => {
972
972
  a.current = t;
@@ -984,7 +984,7 @@ const cn = Object.freeze(["en", "ja"]), os = "en", It = (e) => `viewerSpreadshee
984
984
  const d = new ResizeObserver(() => g());
985
985
  let h = null;
986
986
  const g = () => {
987
- const y = Ms(l);
987
+ const y = Fs(l);
988
988
  y === null || y === h || (h !== null && d.unobserve(h), d.observe(y), h = y);
989
989
  };
990
990
  g(), d.observe(l);
@@ -995,7 +995,7 @@ const cn = Object.freeze(["en", "ja"]), os = "en", It = (e) => `viewerSpreadshee
995
995
  }, [e]);
996
996
  const i = F(
997
997
  (l) => {
998
- l.key !== "Escape" || l.defaultPrevented || (dr(l), n());
998
+ l.key !== "Escape" || l.defaultPrevented || (mr(l), n());
999
999
  },
1000
1000
  [n]
1001
1001
  ), f = F(
@@ -1006,9 +1006,9 @@ const cn = Object.freeze(["en", "ja"]), os = "en", It = (e) => `viewerSpreadshee
1006
1006
  ), u = F(() => {
1007
1007
  s.current && n();
1008
1008
  }, [n]);
1009
- return { ref: r, onKeyDown: i, onClick: f, onCancel: Ls, onClose: u };
1010
- }, mr = ({ open: e, title: t, body: n, confirmLabel: r, cancelLabel: o, onConfirm: s, onCancel: a, testId: i }) => {
1011
- const f = U(null), u = Te(), l = Te(), d = F(() => f.current?.focus(), []), h = fr({ open: e, onOpen: d, onDismiss: a });
1009
+ return { ref: r, onKeyDown: i, onClick: f, onCancel: qs, onClose: u };
1010
+ }, gr = ({ open: e, title: t, body: n, confirmLabel: r, cancelLabel: o, onConfirm: s, onCancel: a, testId: i }) => {
1011
+ const f = U(null), u = Te(), l = Te(), d = F(() => f.current?.focus(), []), h = pr({ open: e, onOpen: d, onDismiss: a });
1012
1012
  return /* @__PURE__ */ c("dialog", { ...h, className: "aqmx-confirm", "aria-labelledby": u, "aria-describedby": l, "data-testid": i, children: /* @__PURE__ */ B("div", { className: "aqmx-confirm-panel", children: [
1013
1013
  /* @__PURE__ */ c("p", { id: u, className: "aqmx-confirm-title", children: t }),
1014
1014
  /* @__PURE__ */ c("p", { id: l, className: "aqmx-confirm-body", children: n }),
@@ -1027,7 +1027,7 @@ const cn = Object.freeze(["en", "ja"]), os = "en", It = (e) => `viewerSpreadshee
1027
1027
  t.status = "rejected", t.reason = n;
1028
1028
  }
1029
1029
  )), t;
1030
- }, hr = (e) => Object.assign(Promise.resolve(e), { status: "fulfilled", value: e }), Ae = (e) => e.status === "fulfilled" ? e.value : void 0, As = Object.freeze({ readme: Object.freeze({ status: "loading" }), claim: !1 }), Ns = Object.freeze({ readme: Object.freeze({ status: "loading" }), claim: !0 }), Ds = (e, t, n) => {
1030
+ }, wr = (e) => Object.assign(Promise.resolve(e), { status: "fulfilled", value: e }), Ae = (e) => e.status === "fulfilled" ? e.value : void 0, Bs = Object.freeze({ readme: Object.freeze({ status: "loading" }), claim: !1 }), Us = Object.freeze({ readme: Object.freeze({ status: "loading" }), claim: !0 }), Hs = (e, t, n) => {
1031
1031
  const r = /* @__PURE__ */ new Set(), o = [...e].reverse();
1032
1032
  for (let s = o.pop(); s !== void 0; s = o.pop()) {
1033
1033
  if (s.type !== "directory" || r.has(s.path)) continue;
@@ -1037,21 +1037,21 @@ const cn = Object.freeze(["en", "ja"]), os = "en", It = (e) => `viewerSpreadshee
1037
1037
  if (i !== null) for (const f of [...i].reverse()) o.push(f);
1038
1038
  }
1039
1039
  return null;
1040
- }, Ps = (e, t, n) => {
1040
+ }, zs = (e, t, n) => {
1041
1041
  const r = Ae(e.read(t));
1042
- if (r === void 0 || r.status === "deferred") return As;
1042
+ if (r === void 0 || r.status === "deferred") return Bs;
1043
1043
  if (r.status === "error") return { readme: { status: "failed", failure: r.failure, retry: () => e.retry(t) }, claim: !1 };
1044
- const o = Ds(r.entries, n, (a) => e.children(t, a));
1045
- if (o !== null) return { readme: { status: "ok", readme: Qt(o) }, claim: !1 };
1044
+ const o = Hs(r.entries, n, (a) => e.children(t, a));
1045
+ if (o !== null) return { readme: { status: "ok", readme: nn(o) }, claim: !1 };
1046
1046
  const s = e.children(t, n);
1047
- return s === void 0 || s.status === "loading" ? Ns : s.status === "failed" ? { readme: { status: "failed", failure: s.failure, retry: () => e.retryChildren(t, n) }, claim: !0 } : { readme: { status: "ok", readme: Qt(s.entries) }, claim: !0 };
1048
- }, Is = (e, t, n) => {
1049
- const { readme: r } = Ps(e, t, n);
1047
+ return s === void 0 || s.status === "loading" ? Us : s.status === "failed" ? { readme: { status: "failed", failure: s.failure, retry: () => e.retryChildren(t, n) }, claim: !0 } : { readme: { status: "ok", readme: nn(s.entries) }, claim: !0 };
1048
+ }, js = (e, t, n) => {
1049
+ const { readme: r } = zs(e, t, n);
1050
1050
  return r.status === "ok" ? r.readme : null;
1051
- }, $s = (e, t, n) => {
1052
- const r = mo({ path: `${e.basePath}/*`, end: !0 }, t.pathname);
1051
+ }, Vs = (e, t, n) => {
1052
+ const r = yo({ path: `${e.basePath}/*`, end: !0 }, t.pathname);
1053
1053
  if (r === null) return /* @__PURE__ */ new Set();
1054
- const { location: o } = Jn(e, r.params["*"], new URLSearchParams(t.search));
1054
+ const { location: o } = tr(e, r.params["*"], new URLSearchParams(t.search));
1055
1055
  switch (o.view) {
1056
1056
  case "tree": {
1057
1057
  const s = o.folder === null ? o.doc : n(o.source, o.folder);
@@ -1062,24 +1062,24 @@ const cn = Object.freeze(["en", "ja"]), os = "en", It = (e) => `viewerSpreadshee
1062
1062
  case "multi":
1063
1063
  return new Set(o.docs);
1064
1064
  }
1065
- }, pr = (e) => {
1065
+ }, vr = (e) => {
1066
1066
  const { edits: t } = $(), n = F(() => t.session(e), [t, e]);
1067
- return oe(t.subscribe, n, _s);
1068
- }, gr = () => !1, _s = () => {
1069
- }, Fs = () => {
1067
+ return re(t.subscribe, n, Zs);
1068
+ }, br = () => !1, Zs = () => {
1069
+ }, Ws = () => {
1070
1070
  const { edits: e } = $();
1071
- return oe(e.subscribe, e.hasSessions, gr);
1072
- }, qs = () => {
1071
+ return re(e.subscribe, e.hasSessions, br);
1072
+ }, Gs = () => {
1073
1073
  const { edits: e } = $();
1074
- return oe(e.subscribe, e.sideBySide, gr);
1075
- }, Bs = () => null, Us = () => {
1074
+ return re(e.subscribe, e.sideBySide, br);
1075
+ }, Ks = () => null, Ys = () => {
1076
1076
  const { edits: e, labels: t, config: n, trees: r } = $(), o = U([]), s = F(
1077
1077
  ({ nextLocation: g }) => {
1078
- const v = $s(n, g, (y, T) => Is(r, y, T));
1078
+ const v = Vs(n, g, (y, T) => js(r, y, T));
1079
1079
  return e.flushDrafts(), o.current = e.dirtyPaths().filter((y) => !v.has(y)), o.current.length > 0;
1080
1080
  },
1081
1081
  [e, n, r]
1082
- ), a = ho(s), i = Fs();
1082
+ ), a = ko(s), i = Ws();
1083
1083
  ee(() => {
1084
1084
  if (!i) return;
1085
1085
  const g = (v) => {
@@ -1087,9 +1087,9 @@ const cn = Object.freeze(["en", "ja"]), os = "en", It = (e) => `viewerSpreadshee
1087
1087
  };
1088
1088
  return window.addEventListener("beforeunload", g), () => window.removeEventListener("beforeunload", g);
1089
1089
  }, [i, e]);
1090
- const f = oe(e.subscribe, e.discardRequest, Bs), u = a.state === "blocked", l = u ? o.current : f === null ? [] : f.paths, d = l.map((g) => fe(g)).join(", "), h = l.length > 0 && l.every((g) => e.session(g)?.save.kind === "draft");
1090
+ const f = re(e.subscribe, e.discardRequest, Ks), u = a.state === "blocked", l = u ? o.current : f === null ? [] : f.paths, d = l.map((g) => fe(g)).join(", "), h = l.length > 0 && l.every((g) => e.session(g)?.save.kind === "draft");
1091
1091
  return /* @__PURE__ */ c(
1092
- mr,
1092
+ gr,
1093
1093
  {
1094
1094
  open: u || f !== null,
1095
1095
  title: h ? t.draftDiscardTitle : t.unsavedTitle,
@@ -1114,7 +1114,7 @@ const cn = Object.freeze(["en", "ja"]), os = "en", It = (e) => `viewerSpreadshee
1114
1114
  }
1115
1115
  );
1116
1116
  };
1117
- function Hs({
1117
+ function Xs({
1118
1118
  title: e,
1119
1119
  titleId: t,
1120
1120
  ...n
@@ -1135,18 +1135,18 @@ function Hs({
1135
1135
  clipRule: "evenodd"
1136
1136
  }));
1137
1137
  }
1138
- const zs = /* @__PURE__ */ E.forwardRef(Hs);
1138
+ const Js = /* @__PURE__ */ E.forwardRef(Xs);
1139
1139
  let ht = null;
1140
- const wr = () => (ht ??= import("./EditSurface-sUNqYw9o.js").catch((e) => {
1140
+ const yr = () => (ht ??= import("./EditSurface-BrdChI9n.js").catch((e) => {
1141
1141
  throw ht = null, e;
1142
- }), ht), js = () => {
1143
- wr().catch(() => {
1142
+ }), ht), Qs = () => {
1143
+ yr().catch(() => {
1144
1144
  });
1145
- }, Vs = (e) => {
1146
- const { default: t } = se(wr());
1145
+ }, ea = (e) => {
1146
+ const { default: t } = se(yr());
1147
1147
  return /* @__PURE__ */ c(t, { ...e });
1148
1148
  };
1149
- class Zs extends Yn {
1149
+ class ta extends Qn {
1150
1150
  state = { failed: !1 };
1151
1151
  static getDerivedStateFromError() {
1152
1152
  return { failed: !0 };
@@ -1156,55 +1156,55 @@ class Zs extends Yn {
1156
1156
  return this.state.failed ? this.props.fallback(this.retry) : this.props.children;
1157
1157
  }
1158
1158
  }
1159
- const _t = `[${nr}]`, Ws = "[data-aqmd-content]", Gs = 'a[href], button, input, select, textarea, summary, label, [contenteditable], [role="menu"], iframe, video, audio, object, embed, svg, [data-aqmd-spreadsheet-editable], [data-aqmd-spreadsheet-fullscreen], [data-aqmd-svg-image-source]', Ks = 200, _e = (e) => Yo(e.getAttribute(nr)), Ys = (e, t) => {
1159
+ const qt = `[${sr}]`, na = "[data-aqmd-content]", ra = 'a[href], button, input, select, textarea, summary, label, [contenteditable], [role="menu"], iframe, video, audio, object, embed, svg, [data-aqmd-spreadsheet-editable], [data-aqmd-spreadsheet-fullscreen], [data-aqmd-svg-image-source]', oa = 200, _e = (e) => ss(e.getAttribute(sr)), sa = (e, t) => {
1160
1160
  for (let r = e; r !== null && t.contains(r); r = r.parentElement) {
1161
1161
  const o = _e(r);
1162
1162
  if (o !== null) return { block: r, lines: o, own: !0 };
1163
1163
  }
1164
1164
  let n = null;
1165
- for (const r of t.querySelectorAll(_t)) {
1165
+ for (const r of t.querySelectorAll(qt)) {
1166
1166
  if (!(r.compareDocumentPosition(e) & Node.DOCUMENT_POSITION_FOLLOWING)) break;
1167
1167
  const o = _e(r);
1168
1168
  o !== null && (n = { block: r, lines: o });
1169
1169
  }
1170
1170
  return n === null ? null : { ...n, own: !1 };
1171
- }, Xs = (e, t) => {
1171
+ }, aa = (e, t) => {
1172
1172
  let n = 0;
1173
1173
  for (let r = e.indexOf(t); r >= 0; r = e.indexOf(t, r + t.length)) n += 1;
1174
1174
  return n;
1175
- }, Js = (e) => e.closest(Ws) !== null && e.closest(Gs) === null, Qs = (e, t, n) => {
1176
- const r = Ys(e, t);
1175
+ }, ia = (e) => e.closest(na) !== null && e.closest(ra) === null, la = (e, t, n) => {
1176
+ const r = sa(e, t);
1177
1177
  if (r === null) return null;
1178
1178
  const { block: o, own: s } = r;
1179
1179
  if (!s) {
1180
1180
  const i = r.lines.last + 1;
1181
1181
  return { lines: { first: i, last: i }, word: null, occurrence: 0, clientTop: Qe(e) };
1182
1182
  }
1183
- const a = ra(o, n);
1183
+ const a = fa(o, n);
1184
1184
  return a === null ? { lines: r.lines, word: null, occurrence: 0, clientTop: Qe(o) } : { lines: r.lines, word: a.text, occurrence: a.occurrence, clientTop: a.clientTop };
1185
- }, ea = (e, t) => {
1185
+ }, ca = (e, t) => {
1186
1186
  let n = null, r = null, o = null;
1187
- for (const a of e.querySelectorAll(_t)) {
1187
+ for (const a of e.querySelectorAll(qt)) {
1188
1188
  const i = _e(a);
1189
1189
  if (i === null) continue;
1190
- n ??= na(t, a);
1190
+ n ??= ua(t, a);
1191
1191
  const { top: f, bottom: u } = a.getBoundingClientRect();
1192
1192
  f <= n && n < u ? r = { lines: i, block: a } : o === null && f >= n && (o = { lines: i, block: a });
1193
1193
  }
1194
1194
  const s = r === null ? o : r;
1195
1195
  return s === null ? null : { lines: s.lines, word: null, occurrence: 0, clientTop: Qe(s.block) };
1196
- }, ta = (e) => e === e.ownerDocument.scrollingElement ? 0 : e.getBoundingClientRect().top + e.clientTop, na = (e, t) => {
1196
+ }, da = (e) => e === e.ownerDocument.scrollingElement ? 0 : e.getBoundingClientRect().top + e.clientTop, ua = (e, t) => {
1197
1197
  const n = Number.parseFloat(getComputedStyle(t).scrollMarginTop);
1198
- return ta(e) + (Number.isFinite(n) ? n : 0);
1199
- }, ra = (e, t) => {
1198
+ return da(e) + (Number.isFinite(n) ? n : 0);
1199
+ }, fa = (e, t) => {
1200
1200
  if (t === null || t.rangeCount === 0) return null;
1201
1201
  const n = t.getRangeAt(0);
1202
1202
  if (!(e.contains(n.startContainer) && e.contains(n.endContainer))) return null;
1203
1203
  const r = n.toString().trim();
1204
- if (r === "" || r.length > Ks || /[\r\n]/u.test(r)) return null;
1204
+ if (r === "" || r.length > oa || /[\r\n]/u.test(r)) return null;
1205
1205
  const o = e.ownerDocument.createRange();
1206
- return o.setStart(e, 0), o.setEnd(n.startContainer, n.startOffset), { text: r, occurrence: Xs(o.toString(), r), clientTop: n.getBoundingClientRect().top };
1207
- }, nu = (e, t) => {
1206
+ return o.setStart(e, 0), o.setEnd(n.startContainer, n.startOffset), { text: r, occurrence: aa(o.toString(), r), clientTop: n.getBoundingClientRect().top };
1207
+ }, wu = (e, t) => {
1208
1208
  const n = e.split(`
1209
1209
  `), r = Math.min(t.lines.first, n.length), o = Math.min(t.lines.last, n.length), s = { line: r, column: 0 };
1210
1210
  if (t.word === null) return s;
@@ -1216,21 +1216,21 @@ const _t = `[${nr}]`, Ws = "[data-aqmd-content]", Gs = 'a[href], button, input,
1216
1216
  a += 1;
1217
1217
  }
1218
1218
  }
1219
- return a > 0 ? oa(n, r, o, t.word) ?? s : s;
1220
- }, oa = (e, t, n, r) => {
1219
+ return a > 0 ? ma(n, r, o, t.word) ?? s : s;
1220
+ }, ma = (e, t, n, r) => {
1221
1221
  for (let o = n; o >= t; o -= 1) {
1222
1222
  const s = (e[o - 1] ?? "").lastIndexOf(r);
1223
1223
  if (s >= 0) return { line: o, column: s };
1224
1224
  }
1225
1225
  return null;
1226
- }, sa = (e, t) => {
1226
+ }, ha = (e, t) => {
1227
1227
  let n = null, r = null;
1228
- for (const o of e.querySelectorAll(_t)) {
1228
+ for (const o of e.querySelectorAll(qt)) {
1229
1229
  const s = _e(o);
1230
1230
  s === null || s.first > t || (s.last >= t ? n = o : (r === null || s.last >= r.last) && (r = { element: o, last: s.last }));
1231
1231
  }
1232
1232
  return n !== null ? n : r === null ? null : r.element;
1233
- }, aa = (e, t) => {
1233
+ }, pa = (e, t) => {
1234
1234
  const { bottom: n } = e.getBoundingClientRect(), r = Qe(e), o = _e(e);
1235
1235
  if (o === null) return r;
1236
1236
  const s = Math.min(Math.max(t - o.first, 0) / (o.last - o.first + 1), 1);
@@ -1246,20 +1246,20 @@ const _t = `[${nr}]`, Ws = "[data-aqmd-content]", Gs = 'a[href], button, input,
1246
1246
  if (i > 0) return a;
1247
1247
  }
1248
1248
  return e.getBoundingClientRect().top;
1249
- }, Ft = Object.freeze({
1249
+ }, Bt = Object.freeze({
1250
1250
  browse: Object.freeze({ replace: !0, preventScrollReset: !0, defaultShouldRevalidate: !1 }),
1251
1251
  "switch-source": Object.freeze({ replace: !1, preventScrollReset: !0, defaultShouldRevalidate: !1 }),
1252
1252
  "switch-view": Object.freeze({ replace: !1, preventScrollReset: !1, defaultShouldRevalidate: !1 }),
1253
1253
  "follow-link": Object.freeze({ replace: !1, preventScrollReset: !1, defaultShouldRevalidate: !1 })
1254
- }), ru = (e) => Ft[e], ot = () => {
1255
- const e = po();
1254
+ }), vu = (e) => Bt[e], ot = () => {
1255
+ const e = Eo();
1256
1256
  return F(
1257
1257
  (t, n) => {
1258
- e(t, Ft[n]);
1258
+ e(t, Bt[n]);
1259
1259
  },
1260
1260
  [e]
1261
1261
  );
1262
- }, ia = ({ navigation: e, ...t }) => /* @__PURE__ */ c(go, { ...t, ...Ft[e] }), vr = (e) => {
1262
+ }, ga = ({ navigation: e, ...t }) => /* @__PURE__ */ c(So, { ...t, ...Bt[e] }), kr = (e) => {
1263
1263
  const t = e.ownerDocument;
1264
1264
  if (e.focus({ preventScroll: !0 }), t.activeElement === e) return !0;
1265
1265
  if (e.hasAttribute("tabindex")) return !1;
@@ -1269,7 +1269,7 @@ const _t = `[${nr}]`, Ws = "[data-aqmd-content]", Gs = 'a[href], button, input,
1269
1269
  t.activeElement !== e && (e.removeAttribute("tabindex"), e.removeEventListener("blur", n));
1270
1270
  };
1271
1271
  return e.addEventListener("blur", n), !0;
1272
- }, la = (e, t) => {
1272
+ }, wa = (e, t) => {
1273
1273
  const n = U(null), r = U(null), o = U(null), s = F(() => {
1274
1274
  n.current !== null && window.clearTimeout(n.current), n.current = null, r.current = null;
1275
1275
  }, []);
@@ -1296,7 +1296,7 @@ const _t = `[${nr}]`, Ws = "[data-aqmd-content]", Gs = 'a[href], button, input,
1296
1296
  const l = t(u);
1297
1297
  l !== r.current && (s(), l !== null && (r.current = l, n.current = window.setTimeout(() => {
1298
1298
  n.current = null, a(l);
1299
- }, ko)));
1299
+ }, Oo)));
1300
1300
  },
1301
1301
  [s, t, a]
1302
1302
  ), f = F(
@@ -1314,8 +1314,8 @@ const _t = `[${nr}]`, Ws = "[data-aqmd-content]", Gs = 'a[href], button, input,
1314
1314
  }),
1315
1315
  [i, f]
1316
1316
  );
1317
- }, ca = Pt(() => import("./NativeScrollBar-ByawerpG.js").then((e) => ({ default: e.NativeScrollBar })));
1318
- class da extends Yn {
1317
+ }, va = $t(() => import("./NativeScrollBar-ybJw3OHE.js").then((e) => ({ default: e.NativeScrollBar })));
1318
+ class ba extends Qn {
1319
1319
  state = { failed: !1 };
1320
1320
  static getDerivedStateFromError() {
1321
1321
  return { failed: !0 };
@@ -1327,7 +1327,33 @@ class da extends Yn {
1327
1327
  return this.state.failed ? null : this.props.children;
1328
1328
  }
1329
1329
  }
1330
- const ua = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ c(da, { children: /* @__PURE__ */ c(Ie, { fallback: null, children: /* @__PURE__ */ c(ca, { scroller: e, withCircle: t }) }) }), br = (e) => /* @__PURE__ */ c(ua, { scroller: e, withCircle: !0 }), yr = () => {
1330
+ const ya = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ c(ba, { children: /* @__PURE__ */ c(Ie, { fallback: null, children: /* @__PURE__ */ c(va, { scroller: e, withCircle: t }) }) }), Er = (e) => /* @__PURE__ */ c(ya, { scroller: e, withCircle: !0 }), bu = 8, Ut = Lo, Sr = Mo[3], xr = Ut + 2 * Sr, yu = -(Ut + Sr), ka = Object.freeze({ minSpeedMultiplier: 0.25, maxSpeedMultiplier: 18 });
1331
+ let Tr = null, pt = null;
1332
+ const Mt = /* @__PURE__ */ new Set(), Ea = (e) => (Mt.add(e), () => {
1333
+ Mt.delete(e);
1334
+ }), Sa = () => {
1335
+ pt === null && (pt = import("./tapScrollCircle-DYmzWI-8.js").then((e) => {
1336
+ const t = e.TAP_SCROLL_CIRCLE.renderVisual;
1337
+ if (t === void 0) throw new TypeError("[markdown-explorer] the bars' tap-scroll circle has no look to share");
1338
+ Tr = t;
1339
+ for (const n of [...Mt]) n();
1340
+ }).catch((e) => {
1341
+ pt = null, console.error("[markdown-explorer] the look of a table's tap-scroll circle failed to load; the circle still scrolls without it.", e);
1342
+ }));
1343
+ }, xa = ({ look: e, state: t }) => e(t), Ta = (e) => {
1344
+ const t = re(
1345
+ Ea,
1346
+ () => Tr,
1347
+ () => null
1348
+ );
1349
+ return ee(() => {
1350
+ t === null && Sa();
1351
+ }, [t]), t === null ? null : /* @__PURE__ */ c(xa, { look: t, state: e });
1352
+ }, Rr = Object.freeze({
1353
+ renderVisual: (e) => /* @__PURE__ */ c(Ta, { ...e }),
1354
+ ...ka,
1355
+ size: Ut
1356
+ }), Cr = () => {
1331
1357
  const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Set();
1332
1358
  let n = !1;
1333
1359
  const r = (o) => {
@@ -1361,9 +1387,9 @@ const ua = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ c(da, { children:
1361
1387
  return !(Array.isArray(e) && Array.isArray(t)) || e.length !== t.length ? !1 : e.every((s, a) => et(s, t[a]));
1362
1388
  const n = e, r = t, o = Object.keys(n);
1363
1389
  return o.length !== Object.keys(r).length ? !1 : o.every((s) => Object.hasOwn(r, s) && et(n[s], r[s]));
1364
- }, fa = 55e3, gn = Object.freeze({ status: "deferred" }), pt = Object.freeze({ status: "refreshed" }), gt = Object.freeze({ status: "shown", failed: !1 }), je = Object.freeze({ status: "shown", failed: !0 }), Ve = Object.freeze({ status: "superseded" }), ge = (e) => e === void 0 || e.status === "deferred" ? null : e.status === "loaded" ? e : e.previous, ma = (e) => e !== void 0 && e.status === "loaded" && e.document.kind !== "failure", ha = ({ client: e, capacity: t }) => {
1390
+ }, Ra = 55e3, bn = Object.freeze({ status: "deferred" }), gt = Object.freeze({ status: "refreshed" }), wt = Object.freeze({ status: "shown", failed: !1 }), je = Object.freeze({ status: "shown", failed: !0 }), Ve = Object.freeze({ status: "superseded" }), ge = (e) => e === void 0 || e.status === "deferred" ? null : e.status === "loaded" ? e : e.previous, Ca = (e) => e !== void 0 && e.status === "loaded" && e.document.kind !== "failure", Oa = ({ client: e, capacity: t }) => {
1365
1391
  if (!Number.isInteger(t) || t < 1) throw new RangeError(`[markdown-explorer] the document cache capacity must be a positive integer; got ${String(t)}`);
1366
- const n = /* @__PURE__ */ new Map(), r = yr(), o = qe(), s = /* @__PURE__ */ new WeakSet(), a = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map();
1392
+ const n = /* @__PURE__ */ new Map(), r = Cr(), o = qe(), s = /* @__PURE__ */ new WeakSet(), a = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map();
1367
1393
  let u = 0;
1368
1394
  const l = o.emit, d = () => (u += 1, u), h = () => {
1369
1395
  if (!(n.size <= t))
@@ -1373,92 +1399,92 @@ const ua = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ c(da, { children:
1373
1399
  }
1374
1400
  }, g = (b, S) => {
1375
1401
  n.delete(b), n.set(b, S);
1376
- }, v = (b) => performance.now() - b.validatedAt >= fa, y = (b, S, M) => {
1377
- const L = n.get(b), P = ge(L?.snapshot), H = M || L?.refreshPending === !0, K = $e(e.document(b, { refresh: H }).then((k) => ({ status: "loaded", document: k }))), w = { snapshot: { status: "pending", promise: K, previous: P }, validatedAt: performance.now(), opened: S, background: null, refreshPending: !1, seeded: void 0, stamp: d() };
1402
+ }, v = (b) => performance.now() - b.validatedAt >= Ra, y = (b, S, L) => {
1403
+ const M = n.get(b), P = ge(M?.snapshot), H = L || M?.refreshPending === !0, K = $e(e.document(b, { refresh: H }).then((k) => ({ status: "loaded", document: k }))), w = { snapshot: { status: "pending", promise: K, previous: P }, validatedAt: performance.now(), opened: S, background: null, refreshPending: !1, seeded: void 0, stamp: d() };
1378
1404
  return g(b, w), h(), K.then((k) => {
1379
1405
  n.get(b) === w && (w.snapshot = k, w.stamp = d(), l());
1380
1406
  }), w;
1381
- }, T = (b, S, M, L, P, H) => {
1382
- S.background === M && (S.background = null, !(n.get(b) !== S || S.snapshot !== L) && (P.kind === "failure" && L.document.kind !== "failure" || (S.validatedAt = H, S.stamp = d(), et(L.document, P) || (S.snapshot = { status: "loaded", document: P }), l())));
1383
- }, C = async (b, S) => {
1384
- const M = S.snapshot;
1385
- if (M.status !== "loaded") return null;
1386
- const L = {};
1387
- S.background = L;
1407
+ }, T = (b, S, L, M, P, H) => {
1408
+ S.background === L && (S.background = null, !(n.get(b) !== S || S.snapshot !== M) && (P.kind === "failure" && M.document.kind !== "failure" || (S.validatedAt = H, S.stamp = d(), et(M.document, P) || (S.snapshot = { status: "loaded", document: P }), l())));
1409
+ }, O = async (b, S) => {
1410
+ const L = S.snapshot;
1411
+ if (L.status !== "loaded") return null;
1412
+ const M = {};
1413
+ S.background = M;
1388
1414
  const P = performance.now(), H = e.document(b, { refresh: S.refreshPending });
1389
1415
  S.refreshPending = !1;
1390
- const K = await H, w = S.background === L && n.get(b) === S && S.snapshot === M;
1391
- return T(b, S, L, M, K, P), w ? K : null;
1416
+ const K = await H, w = S.background === M && n.get(b) === S && S.snapshot === L;
1417
+ return T(b, S, M, L, K, P), w ? K : null;
1392
1418
  }, R = (b, S) => {
1393
- const { snapshot: M } = S;
1394
- return M.status === "pending" ? !1 : M.status === "loaded" && M.document.kind !== "failure" ? (C(b, S), !1) : (M.status === "loaded" && s.add(M), y(b, !0, !1), !0);
1419
+ const { snapshot: L } = S;
1420
+ return L.status === "pending" ? !1 : L.status === "loaded" && L.document.kind !== "failure" ? (O(b, S), !1) : (L.status === "loaded" && s.add(L), y(b, !0, !1), !0);
1395
1421
  }, q = (b) => {
1396
1422
  i.delete(b);
1397
1423
  const S = f.get(b);
1398
1424
  if (S !== void 0) {
1399
1425
  f.delete(b);
1400
- for (const M of S) M();
1426
+ for (const L of S) L();
1401
1427
  }
1402
- }, D = (b, S) => new Promise((M) => {
1428
+ }, D = (b, S) => new Promise((L) => {
1403
1429
  if (i.get(b) === S || !r.isHeld(b)) {
1404
- M();
1430
+ L();
1405
1431
  return;
1406
1432
  }
1407
- const L = f.get(b);
1408
- L === void 0 ? f.set(b, /* @__PURE__ */ new Set([M])) : L.add(M);
1433
+ const M = f.get(b);
1434
+ M === void 0 ? f.set(b, /* @__PURE__ */ new Set([L])) : M.add(L);
1409
1435
  }), m = (b, S) => {
1410
- const M = a.get(b);
1411
- if (M === void 0) {
1436
+ const L = a.get(b);
1437
+ if (L === void 0) {
1412
1438
  S.resolve(null);
1413
1439
  return;
1414
1440
  }
1415
- if (M.last !== null && M.last.stamp >= S.stamp) {
1416
- S.resolve(M.last);
1441
+ if (L.last !== null && L.last.stamp >= S.stamp) {
1442
+ S.resolve(L.last);
1417
1443
  return;
1418
1444
  }
1419
- M.waiters.add(S);
1420
- }, p = async (b, S, M) => {
1421
- const L = await new Promise((P) => m(b, { stamp: S.stamp, resolve: P }));
1445
+ L.waiters.add(S);
1446
+ }, p = async (b, S, L) => {
1447
+ const M = await new Promise((P) => m(b, { stamp: S.stamp, resolve: P }));
1422
1448
  if (n.get(b) !== S) return Ve;
1423
- if (L === null) return M ? pt : gt;
1424
- if (!M) return L.failure === null ? gt : je;
1425
- switch (L.before) {
1449
+ if (M === null) return L ? gt : wt;
1450
+ if (!L) return M.failure === null ? wt : je;
1451
+ switch (M.before) {
1426
1452
  case "copy":
1427
- return L.failure === null ? pt : { status: "failed", failure: L.failure };
1453
+ return M.failure === null ? gt : { status: "failed", failure: M.failure };
1428
1454
  case "failure":
1429
- return L.failure === null ? gt : je;
1455
+ return M.failure === null ? wt : je;
1430
1456
  case "none":
1431
- return L.failure === null ? pt : je;
1457
+ return M.failure === null ? gt : je;
1432
1458
  }
1433
1459
  }, x = (b) => {
1434
1460
  const S = { showing: "none", last: null, waiters: /* @__PURE__ */ new Set() };
1435
1461
  a.set(b, S);
1436
- let M = !1;
1462
+ let L = !1;
1437
1463
  return {
1438
- settle: (L, P) => {
1439
- if (M || L === void 0) return;
1440
- const H = { stamp: L, failure: P, before: S.showing };
1464
+ settle: (M, P) => {
1465
+ if (L || M === void 0) return;
1466
+ const H = { stamp: M, failure: P, before: S.showing };
1441
1467
  S.last = H, P === null ? S.showing = "copy" : S.showing === "none" && (S.showing = "failure");
1442
1468
  for (const K of [...S.waiters])
1443
- L < K.stamp || (S.waiters.delete(K), K.resolve(H));
1469
+ M < K.stamp || (S.waiters.delete(K), K.resolve(H));
1444
1470
  },
1445
1471
  release: () => {
1446
- if (M) return;
1447
- M = !0, a.get(b) === S && a.delete(b);
1448
- const L = [...S.waiters];
1449
- S.waiters.clear(), L.length > 0 && queueMicrotask(() => {
1450
- for (const P of L) m(b, P);
1472
+ if (L) return;
1473
+ L = !0, a.get(b) === S && a.delete(b);
1474
+ const M = [...S.waiters];
1475
+ S.waiters.clear(), M.length > 0 && queueMicrotask(() => {
1476
+ for (const P of M) m(b, P);
1451
1477
  });
1452
1478
  }
1453
1479
  };
1454
1480
  }, A = (b) => {
1455
1481
  const S = r.hold(b);
1456
- let M = !1;
1482
+ let L = !1;
1457
1483
  return () => {
1458
- if (M) return;
1459
- M = !0, S();
1460
- const L = n.get(b);
1461
- L !== void 0 && g(b, L), h(), r.isHeld(b) || queueMicrotask(() => {
1484
+ if (L) return;
1485
+ L = !0, S();
1486
+ const M = n.get(b);
1487
+ M !== void 0 && g(b, M), h(), r.isHeld(b) || queueMicrotask(() => {
1462
1488
  r.isHeld(b) || q(b);
1463
1489
  });
1464
1490
  };
@@ -1472,12 +1498,12 @@ const ua = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ c(da, { children:
1472
1498
  S !== void 0 && S.snapshot.status !== "deferred" || (y(b, !1, !1), l());
1473
1499
  },
1474
1500
  open: (b) => {
1475
- const S = r.resumes(b), M = A(b), L = n.get(b);
1476
- if (L === void 0 || L.snapshot.status === "deferred")
1477
- return y(b, !0, !1), l(), M;
1478
- if (g(b, L), S) return M;
1479
- const { snapshot: P } = L;
1480
- return P.status === "pending" ? (L.opened = !0, M) : P.document.kind === "failure" ? (L.opened || v(L) ? (s.add(P), y(b, !0, !1), l()) : L.opened = !0, M) : (L.opened = !0, L.background === null && v(L) && C(b, L), M);
1501
+ const S = r.resumes(b), L = A(b), M = n.get(b);
1502
+ if (M === void 0 || M.snapshot.status === "deferred")
1503
+ return y(b, !0, !1), l(), L;
1504
+ if (g(b, M), S) return L;
1505
+ const { snapshot: P } = M;
1506
+ return P.status === "pending" ? (M.opened = !0, L) : P.document.kind === "failure" ? (M.opened || v(M) ? (s.add(P), y(b, !0, !1), l()) : M.opened = !0, L) : (M.opened = !0, M.background === null && v(M) && O(b, M), L);
1481
1507
  },
1482
1508
  retain: A,
1483
1509
  retry: (b) => {
@@ -1485,54 +1511,54 @@ const ua = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ c(da, { children:
1485
1511
  S === void 0 || S.snapshot.status !== "loaded" || S.snapshot.document.kind !== "failure" || (y(b, !0, !1), l());
1486
1512
  },
1487
1513
  seed: (b, S) => {
1488
- const M = performance.now(), L = $e(
1514
+ const L = performance.now(), M = $e(
1489
1515
  S.then(
1490
- (k) => k === null ? gn : { status: "loaded", document: k },
1491
- () => gn
1516
+ (k) => k === null ? bn : { status: "loaded", document: k },
1517
+ () => bn
1492
1518
  )
1493
1519
  ), P = n.get(b);
1494
1520
  if (P !== void 0 && P.snapshot.status === "loaded") {
1495
- const k = P.snapshot, O = {};
1496
- P.background = O, L.then((N) => {
1521
+ const k = P.snapshot, C = {};
1522
+ P.background = C, M.then((N) => {
1497
1523
  if (N.status === "loaded") {
1498
- T(b, P, O, k, N.document, M);
1524
+ T(b, P, C, k, N.document, L);
1499
1525
  return;
1500
1526
  }
1501
- P.background === O && (P.background = null);
1527
+ P.background === C && (P.background = null);
1502
1528
  });
1503
1529
  return;
1504
1530
  }
1505
- const H = P !== void 0 && P.snapshot.status === "pending" ? P.snapshot.previous : null, K = { status: "pending", promise: L, previous: H }, w = { snapshot: K, validatedAt: M, opened: P?.opened === !0, background: null, refreshPending: P?.refreshPending === !0, seeded: K, stamp: d() };
1506
- g(b, w), h(), L.then((k) => {
1531
+ const H = P !== void 0 && P.snapshot.status === "pending" ? P.snapshot.previous : null, K = { status: "pending", promise: M, previous: H }, w = { snapshot: K, validatedAt: L, opened: P?.opened === !0, background: null, refreshPending: P?.refreshPending === !0, seeded: K, stamp: d() };
1532
+ g(b, w), h(), M.then((k) => {
1507
1533
  n.get(b) === w && (k.status === "deferred" && r.isHeld(b) ? y(b, w.opened, !1) : (w.snapshot = k, w.stamp = d()), l());
1508
1534
  });
1509
1535
  },
1510
1536
  invalidate: () => {
1511
1537
  let b = !1;
1512
- for (const [S, M] of [...n]) {
1513
- if (M.validatedAt = Number.NEGATIVE_INFINITY, M.opened = !0, M.refreshPending = !0, !r.isHeld(S)) continue;
1514
- const { snapshot: L } = M;
1515
- if (L.status !== "pending") {
1516
- R(S, M) && (b = !0);
1538
+ for (const [S, L] of [...n]) {
1539
+ if (L.validatedAt = Number.NEGATIVE_INFINITY, L.opened = !0, L.refreshPending = !0, !r.isHeld(S)) continue;
1540
+ const { snapshot: M } = L;
1541
+ if (M.status !== "pending") {
1542
+ R(S, L) && (b = !0);
1517
1543
  continue;
1518
1544
  }
1519
- L.promise.then(() => {
1520
- n.get(S) === M && M.refreshPending && r.isHeld(S) && R(S, M) && l();
1545
+ M.promise.then(() => {
1546
+ n.get(S) === L && L.refreshPending && r.isHeld(S) && R(S, L) && l();
1521
1547
  });
1522
1548
  }
1523
1549
  b && l();
1524
1550
  },
1525
1551
  refresh: async (b) => {
1526
1552
  const S = n.get(b);
1527
- if (S !== void 0 && ma(S.snapshot)) {
1553
+ if (S !== void 0 && Ca(S.snapshot)) {
1528
1554
  S.refreshPending = !0;
1529
- const P = await C(b, S);
1555
+ const P = await O(b, S);
1530
1556
  return P === null ? Ve : P.kind === "failure" ? { status: "failed", failure: P.failure } : p(b, S, !0);
1531
1557
  }
1532
- const M = y(b, !0, !0);
1533
- if (l(), M.snapshot.status !== "pending") return Ve;
1534
- const L = await M.snapshot.promise;
1535
- return n.get(b) !== M || L.status !== "loaded" ? Ve : L.document.kind === "failure" ? je : (await D(b, L), p(b, M, !1));
1558
+ const L = y(b, !0, !0);
1559
+ if (l(), L.snapshot.status !== "pending") return Ve;
1560
+ const M = await L.snapshot.promise;
1561
+ return n.get(b) !== L || M.status !== "loaded" ? Ve : M.document.kind === "failure" ? je : (await D(b, M), p(b, L, !1));
1536
1562
  },
1537
1563
  clear: () => {
1538
1564
  n.clear();
@@ -1543,19 +1569,19 @@ const ua = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ c(da, { children:
1543
1569
  readPart: x,
1544
1570
  noteShown: (b, S) => {
1545
1571
  i.set(b, S);
1546
- const M = f.get(b);
1547
- if (M !== void 0) {
1572
+ const L = f.get(b);
1573
+ if (L !== void 0) {
1548
1574
  f.delete(b);
1549
- for (const L of M) L();
1575
+ for (const M of L) M();
1550
1576
  }
1551
1577
  },
1552
1578
  noteFailureShown: (b) => s.has(b) ? !1 : (s.add(b), !0)
1553
1579
  };
1554
- }, we = ve("fill"), pa = Object.freeze({ blockSize: "100%" }), Be = ({ scrollerProps: e, children: t }) => se(we) === "content" ? /* @__PURE__ */ c(sn, { scrollerProps: e, children: t }) : /* @__PURE__ */ c(sn, { scrollerProps: { ...e, style: pa }, rowClassName: "aqmx-document-scroll-row", renderScrollBar: br, children: t }), ga = Object.freeze(["l1", "l2", "l3", "l4", "l5", "l6", "l7", "l8"]), wa = Object.freeze({ className: "aqmx-document-failure", "data-aqmx-document-scroller": "" }), Oe = ({ label: e, testId: t }) => /* @__PURE__ */ B(pe, { children: [
1555
- /* @__PURE__ */ c("div", { className: "aqmx-skeleton", "aria-hidden": "true", "data-testid": t, children: ga.map((n) => /* @__PURE__ */ c("span", {}, n)) }),
1580
+ }, we = ve("fill"), La = "--aqmx-tap-circle-gutter", Ma = Object.freeze({ blockSize: "100%", [La]: `${String(xr)}px` }), Be = ({ scrollerProps: e, children: t }) => se(we) === "content" ? /* @__PURE__ */ c(cn, { scrollerProps: e, children: t }) : /* @__PURE__ */ c(cn, { scrollerProps: { ...e, style: Ma }, rowClassName: "aqmx-document-scroll-row", renderScrollBar: Er, children: t }), Aa = Object.freeze(["l1", "l2", "l3", "l4", "l5", "l6", "l7", "l8"]), Na = Object.freeze({ className: "aqmx-document-failure", "data-aqmx-document-scroller": "" }), Ce = ({ label: e, testId: t }) => /* @__PURE__ */ B(pe, { children: [
1581
+ /* @__PURE__ */ c("div", { className: "aqmx-skeleton", "aria-hidden": "true", "data-testid": t, children: Aa.map((n) => /* @__PURE__ */ c("span", {}, n)) }),
1556
1582
  /* @__PURE__ */ c("p", { className: "aqmx-sr-only", children: e })
1557
- ] }), qt = ({ failure: e, onRetry: t, testId: n }) => /* @__PURE__ */ c(Be, { scrollerProps: wa, children: /* @__PURE__ */ c(Re, { failure: e, alert: !1, onRetry: t, testId: n }) });
1558
- function va({
1583
+ ] }), Ht = ({ failure: e, onRetry: t, testId: n }) => /* @__PURE__ */ c(Be, { scrollerProps: Na, children: /* @__PURE__ */ c(Re, { failure: e, alert: !1, onRetry: t, testId: n }) });
1584
+ function Da({
1559
1585
  title: e,
1560
1586
  titleId: t,
1561
1587
  ...n
@@ -1580,8 +1606,8 @@ function va({
1580
1606
  clipRule: "evenodd"
1581
1607
  }));
1582
1608
  }
1583
- const ba = /* @__PURE__ */ E.forwardRef(va);
1584
- function ya({
1609
+ const Pa = /* @__PURE__ */ E.forwardRef(Da);
1610
+ function Ia({
1585
1611
  title: e,
1586
1612
  titleId: t,
1587
1613
  ...n
@@ -1604,8 +1630,8 @@ function ya({
1604
1630
  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"
1605
1631
  }));
1606
1632
  }
1607
- const ka = /* @__PURE__ */ E.forwardRef(ya);
1608
- function Ea({
1633
+ const $a = /* @__PURE__ */ E.forwardRef(Ia);
1634
+ function _a({
1609
1635
  title: e,
1610
1636
  titleId: t,
1611
1637
  ...n
@@ -1626,33 +1652,33 @@ function Ea({
1626
1652
  clipRule: "evenodd"
1627
1653
  }));
1628
1654
  }
1629
- const Sa = /* @__PURE__ */ E.forwardRef(Ea), xa = 2e3, wn = Object.freeze({ outcome: "idle" }), Ta = (e) => {
1655
+ const Fa = /* @__PURE__ */ E.forwardRef(_a), qa = 2e3, yn = Object.freeze({ outcome: "idle" }), Ba = (e) => {
1630
1656
  const t = navigator.clipboard;
1631
1657
  return t === void 0 ? Promise.reject(new Error("[markdown-explorer] this browser has no asynchronous clipboard")) : t.writeText(e);
1632
- }, Ra = ({ text: e }) => {
1633
- const { announcer: t, labels: n } = $(), [r, o] = V(wn);
1658
+ }, Ua = ({ text: e }) => {
1659
+ const { announcer: t, labels: n } = $(), [r, o] = V(yn);
1634
1660
  ee(() => {
1635
1661
  if (r.outcome === "idle") return;
1636
- const f = setTimeout(() => o(wn), xa);
1662
+ const f = setTimeout(() => o(yn), qa);
1637
1663
  return () => clearTimeout(f);
1638
1664
  }, [r]);
1639
1665
  const s = (f) => {
1640
1666
  o({ outcome: f }), t.announce(f === "copied" ? n.copiedText : n.copyTextFailed);
1641
1667
  }, a = () => {
1642
- Ta(e).then(
1668
+ Ba(e).then(
1643
1669
  () => s("copied"),
1644
1670
  () => s("failed")
1645
1671
  );
1646
1672
  }, i = r.outcome === "copied" ? n.copiedText : r.outcome === "failed" ? n.copyTextFailed : n.copyText;
1647
1673
  return (
1648
- /* @__PURE__ */ c("button", { type: "button", className: "aqmx-icon-button", "aria-label": n.copyText, title: i, onClick: a, "data-aqmx-copy-outcome": r.outcome, "data-testid": "markdown-explorer-file-copy", children: r.outcome === "copied" ? /* @__PURE__ */ c(ba, {}) : r.outcome === "failed" ? /* @__PURE__ */ c(Sa, {}) : /* @__PURE__ */ c(ka, {}) })
1674
+ /* @__PURE__ */ c("button", { type: "button", className: "aqmx-icon-button", "aria-label": n.copyText, title: i, onClick: a, "data-aqmx-copy-outcome": r.outcome, "data-testid": "markdown-explorer-file-copy", children: r.outcome === "copied" ? /* @__PURE__ */ c(Pa, {}) : r.outcome === "failed" ? /* @__PURE__ */ c(Fa, {}) : /* @__PURE__ */ c($a, {}) })
1649
1675
  );
1650
- }, kr = ve(null), Oa = () => {
1651
- const e = se(kr);
1676
+ }, Or = ve(null), Ha = () => {
1677
+ const e = se(Or);
1652
1678
  if (e === null) throw new Error("[markdown-explorer] a document's content reads its own part only inside a document pane (DocumentContentChannelContext)");
1653
1679
  return e;
1654
1680
  };
1655
- function Ca({
1681
+ function za({
1656
1682
  title: e,
1657
1683
  titleId: t,
1658
1684
  ...n
@@ -1673,8 +1699,8 @@ function Ca({
1673
1699
  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"
1674
1700
  }));
1675
1701
  }
1676
- const Ma = /* @__PURE__ */ E.forwardRef(Ca);
1677
- function La({
1702
+ const ja = /* @__PURE__ */ E.forwardRef(za);
1703
+ function Va({
1678
1704
  title: e,
1679
1705
  titleId: t,
1680
1706
  ...n
@@ -1699,17 +1725,17 @@ function La({
1699
1725
  clipRule: "evenodd"
1700
1726
  }));
1701
1727
  }
1702
- const Aa = /* @__PURE__ */ E.forwardRef(La), Ue = ({ name: e, openUrl: t, downloadUrl: n, icon: r, children: o }) => {
1728
+ const Za = /* @__PURE__ */ E.forwardRef(Va), Ue = ({ name: e, openUrl: t, downloadUrl: n, icon: r, children: o }) => {
1703
1729
  const { labels: s } = $();
1704
1730
  return /* @__PURE__ */ B("div", { className: "aqmx-document-toolbar", children: [
1705
1731
  /* @__PURE__ */ c("span", { className: "aqmx-document-file-icon", "aria-hidden": "true", children: r }),
1706
1732
  /* @__PURE__ */ c("span", { className: "aqmx-document-title", title: e, "data-testid": "markdown-explorer-file-name", children: e }),
1707
1733
  o,
1708
- /* @__PURE__ */ c("a", { className: "aqmx-icon-button", href: t, target: "_blank", rel: "noopener noreferrer", "aria-label": s.openInNewTab, title: s.openInNewTab, "data-testid": "markdown-explorer-file-open", children: /* @__PURE__ */ c(Aa, {}) }),
1709
- /* @__PURE__ */ c("a", { className: "aqmx-icon-button", href: n, download: e, "aria-label": s.download, title: s.download, "data-testid": "markdown-explorer-file-download", children: /* @__PURE__ */ c(Ma, {}) })
1734
+ /* @__PURE__ */ c("a", { className: "aqmx-icon-button", href: t, target: "_blank", rel: "noopener noreferrer", "aria-label": s.openInNewTab, title: s.openInNewTab, "data-testid": "markdown-explorer-file-open", children: /* @__PURE__ */ c(Za, {}) }),
1735
+ /* @__PURE__ */ c("a", { className: "aqmx-icon-button", href: n, download: e, "aria-label": s.download, title: s.download, "data-testid": "markdown-explorer-file-download", children: /* @__PURE__ */ c(ja, {}) })
1710
1736
  ] });
1711
1737
  };
1712
- function Na({
1738
+ function Wa({
1713
1739
  title: e,
1714
1740
  titleId: t,
1715
1741
  ...n
@@ -1730,45 +1756,45 @@ function Na({
1730
1756
  clipRule: "evenodd"
1731
1757
  }));
1732
1758
  }
1733
- const Da = /* @__PURE__ */ E.forwardRef(Na), Pa = Object.freeze({ className: "aqmx-document-stage" }), Ia = ({ document: e }) => {
1759
+ const Ga = /* @__PURE__ */ E.forwardRef(Wa), Ka = Object.freeze({ className: "aqmx-document-stage" }), Ya = ({ document: e }) => {
1734
1760
  const { labels: t } = $();
1735
1761
  return /* @__PURE__ */ B("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-file-view", children: [
1736
- /* @__PURE__ */ c(Ue, { name: e.name, openUrl: e.url, downloadUrl: e.url, icon: /* @__PURE__ */ c(Da, {}) }),
1737
- /* @__PURE__ */ c(Be, { scrollerProps: Pa, children: /* @__PURE__ */ B("div", { className: "aqmx-callout", role: "note", "data-testid": "markdown-explorer-file-not-shown", children: [
1762
+ /* @__PURE__ */ c(Ue, { name: e.name, openUrl: e.url, downloadUrl: e.url, icon: /* @__PURE__ */ c(Ga, {}) }),
1763
+ /* @__PURE__ */ c(Be, { scrollerProps: Ka, children: /* @__PURE__ */ B("div", { className: "aqmx-callout", role: "note", "data-testid": "markdown-explorer-file-not-shown", children: [
1738
1764
  /* @__PURE__ */ c("p", { className: "aqmx-callout-body", children: t.fileNotShown }),
1739
1765
  /* @__PURE__ */ c("a", { className: "aqmx-callout-action", href: e.url, download: e.name, "data-testid": "markdown-explorer-file-not-shown-download", children: t.download })
1740
1766
  ] }) })
1741
1767
  ] });
1742
- }, st = "[data-aqmd-scroll-container], [data-aqmx-document-scroller]", $a = (e) => {
1768
+ }, st = "[data-aqmd-scroll-container], [data-aqmx-document-scroller]", Xa = (e) => {
1743
1769
  const t = e.indexOf("#");
1744
1770
  return t === -1 ? "" : e.slice(t);
1745
- }, _a = /(%[0-9A-Fa-f]{2})/u, Bt = (e) => {
1771
+ }, Ja = /(%[0-9A-Fa-f]{2})/u, zt = (e) => {
1746
1772
  if (!e.startsWith("#") || e.length === 1) return null;
1747
- const t = new TextEncoder(), n = e.slice(1).split(_a).flatMap((r, o) => o % 2 === 1 ? [Number.parseInt(r.slice(1), 16)] : [...t.encode(r)]);
1773
+ const t = new TextEncoder(), n = e.slice(1).split(Ja).flatMap((r, o) => o % 2 === 1 ? [Number.parseInt(r.slice(1), 16)] : [...t.encode(r)]);
1748
1774
  return new TextDecoder("utf-8", { ignoreBOM: !0 }).decode(Uint8Array.from(n));
1749
- }, Er = (e) => `#${encodeURIComponent(e)}`, Fa = (e) => {
1775
+ }, Lr = (e) => `#${encodeURIComponent(e)}`, Qa = (e) => {
1750
1776
  if (e === "#") return !0;
1751
- const t = Bt(e);
1777
+ const t = zt(e);
1752
1778
  return t !== null && t.replace(/[A-Z]/gu, (n) => n.toLowerCase()) === "top";
1753
- }, Sr = (e, t) => {
1779
+ }, Mr = (e, t) => {
1754
1780
  if (t === "") return null;
1755
1781
  for (const n of e.querySelectorAll("[id]"))
1756
1782
  if (n.id === t) return n;
1757
1783
  return null;
1758
- }, qa = "http://www.w3.org/1999/xhtml", vn = (e, t) => {
1784
+ }, ei = "http://www.w3.org/1999/xhtml", kn = (e, t) => {
1759
1785
  if (t === "") return null;
1760
- const n = Sr(e, t);
1786
+ const n = Mr(e, t);
1761
1787
  if (n !== null) return n;
1762
1788
  for (const r of e.querySelectorAll("a[name]"))
1763
- if (r.localName === "a" && r.namespaceURI === qa && r.getAttribute("name") === t) return r;
1789
+ if (r.localName === "a" && r.namespaceURI === ei && r.getAttribute("name") === t) return r;
1764
1790
  return null;
1765
- }, xr = (e, t) => {
1791
+ }, Ar = (e, t) => {
1766
1792
  if (e === null || !t.startsWith("#")) return null;
1767
- const n = vn(e, t.slice(1));
1793
+ const n = kn(e, t.slice(1));
1768
1794
  if (n !== null) return n;
1769
- const r = Bt(t);
1770
- return r === null ? null : vn(e, r);
1771
- }, bn = (e) => {
1795
+ const r = zt(t);
1796
+ return r === null ? null : kn(e, r);
1797
+ }, En = (e) => {
1772
1798
  const { body: t, documentElement: n } = e.ownerDocument;
1773
1799
  if (e === t) {
1774
1800
  const o = getComputedStyle(n);
@@ -1776,22 +1802,22 @@ const Da = /* @__PURE__ */ E.forwardRef(Na), Pa = Object.freeze({ className: "aq
1776
1802
  }
1777
1803
  const { overflowY: r } = getComputedStyle(e);
1778
1804
  return r === "auto" || r === "scroll";
1779
- }, Ba = (e) => {
1805
+ }, ti = (e) => {
1780
1806
  const { body: t, documentElement: n } = e, r = getComputedStyle(n), o = r.overflowX === "visible" && r.overflowY === "visible" && t !== null ? getComputedStyle(t).overflowY : r.overflowY;
1781
1807
  return o !== "hidden" && o !== "clip";
1782
- }, Ua = (e, t) => {
1808
+ }, ni = (e, t) => {
1783
1809
  const n = t.closest(st), r = n !== null && e.contains(n) ? n : e;
1784
- if (r.scrollHeight > r.clientHeight && bn(r)) return r;
1810
+ if (r.scrollHeight > r.clientHeight && En(r)) return r;
1785
1811
  const o = e.getBoundingClientRect().height, { documentElement: s, scrollingElement: a } = e.ownerDocument;
1786
1812
  for (let i = e.parentElement; i !== null && i !== s; i = i.parentElement)
1787
- if (bn(i) && i.scrollHeight > i.clientHeight && i.clientHeight < o) return i;
1788
- return a instanceof Element && Ba(e.ownerDocument) && a.scrollHeight > a.clientHeight && a.clientHeight < o ? a : r;
1789
- }, Ha = Object.freeze({
1790
- scrollerOf: Ua,
1813
+ if (En(i) && i.scrollHeight > i.clientHeight && i.clientHeight < o) return i;
1814
+ return a instanceof Element && ti(e.ownerDocument) && a.scrollHeight > a.clientHeight && a.clientHeight < o ? a : r;
1815
+ }, ri = Object.freeze({
1816
+ scrollerOf: ni,
1791
1817
  reveal: (e) => {
1792
- e.scrollIntoView(Mt);
1818
+ e.scrollIntoView(At);
1793
1819
  }
1794
- }), Mt = Object.freeze({ block: "nearest", inline: "nearest", behavior: "instant" }), za = (e, t) => {
1820
+ }), At = Object.freeze({ block: "nearest", inline: "nearest", behavior: "instant" }), oi = (e, t) => {
1795
1821
  for (let n = t; n !== null && n !== e; n = n.parentElement) {
1796
1822
  const r = n.parentElement;
1797
1823
  if (r instanceof HTMLDetailsElement && n !== r.querySelector(":scope > summary") && (r.open = !0), n.getAttribute("hidden")?.toLowerCase() === "until-found") {
@@ -1799,23 +1825,23 @@ const Da = /* @__PURE__ */ E.forwardRef(Na), Pa = Object.freeze({ className: "aq
1799
1825
  n.removeAttribute("hidden");
1800
1826
  }
1801
1827
  }
1802
- }, ja = (e, t) => {
1828
+ }, si = (e, t) => {
1803
1829
  if (t.getClientRects().length === 0) return;
1804
1830
  const n = e === e.ownerDocument.scrollingElement ? 0 : e.getBoundingClientRect().top + e.clientTop, { scrollMarginTop: r, scrollMarginBottom: o } = getComputedStyle(t), s = Number.parseFloat(r), a = t.getBoundingClientRect(), i = a.height + s + Number.parseFloat(o) > e.clientHeight;
1805
1831
  if (!i && Math.abs(a.top - s - n) < 1) {
1806
- t.scrollIntoView(Mt);
1832
+ t.scrollIntoView(At);
1807
1833
  return;
1808
1834
  }
1809
- e.scrollBy({ top: i ? a.top - n - e.clientHeight : a.bottom - n + e.clientHeight, behavior: "instant" }), t.scrollIntoView(Mt);
1810
- }, Va = (e, t) => {
1835
+ e.scrollBy({ top: i ? a.top - n - e.clientHeight : a.bottom - n + e.clientHeight, behavior: "instant" }), t.scrollIntoView(At);
1836
+ }, ai = (e, t) => {
1811
1837
  const n = t.scrollerOf(e, e.querySelector(st) ?? e);
1812
1838
  n.getClientRects().length !== 0 && (n.scrollTo({ top: 0, left: 0, behavior: "instant" }), t.reveal(n));
1813
- }, yn = (e, t, n) => {
1839
+ }, Sn = (e, t, n) => {
1814
1840
  if (e === null) return null;
1815
- const r = xr(e, t);
1816
- return r === null ? (Fa(t) && Va(e, n), null) : (za(e, r), ja(n.scrollerOf(e, r), r), n.reveal(r), r);
1841
+ const r = Ar(e, t);
1842
+ return r === null ? (Qa(t) && ai(e, n), null) : (oi(e, r), si(n.scrollerOf(e, r), r), n.reveal(r), r);
1817
1843
  };
1818
- function Za({
1844
+ function ii({
1819
1845
  title: e,
1820
1846
  titleId: t,
1821
1847
  ...n
@@ -1834,8 +1860,8 @@ function Za({
1834
1860
  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"
1835
1861
  }));
1836
1862
  }
1837
- const Wa = /* @__PURE__ */ E.forwardRef(Za);
1838
- function Ga({
1863
+ const li = /* @__PURE__ */ E.forwardRef(ii);
1864
+ function ci({
1839
1865
  title: e,
1840
1866
  titleId: t,
1841
1867
  ...n
@@ -1858,8 +1884,8 @@ function Ga({
1858
1884
  clipRule: "evenodd"
1859
1885
  }));
1860
1886
  }
1861
- const Ka = /* @__PURE__ */ E.forwardRef(Ga);
1862
- function Ya({
1887
+ const di = /* @__PURE__ */ E.forwardRef(ci);
1888
+ function ui({
1863
1889
  title: e,
1864
1890
  titleId: t,
1865
1891
  ...n
@@ -1882,8 +1908,8 @@ function Ya({
1882
1908
  clipRule: "evenodd"
1883
1909
  }));
1884
1910
  }
1885
- const Xa = /* @__PURE__ */ E.forwardRef(Ya);
1886
- function Ja({
1911
+ const fi = /* @__PURE__ */ E.forwardRef(ui);
1912
+ function mi({
1887
1913
  title: e,
1888
1914
  titleId: t,
1889
1915
  ...n
@@ -1904,7 +1930,7 @@ function Ja({
1904
1930
  clipRule: "evenodd"
1905
1931
  }));
1906
1932
  }
1907
- const Qa = /* @__PURE__ */ E.forwardRef(Ja), Lt = "data-aqmx-key-repeat", At = Object.freeze({ [Lt]: "allow" }), ei = `[${Lt}="${At[Lt]}"]`, ti = () => {
1933
+ const hi = /* @__PURE__ */ E.forwardRef(mi), Nt = "data-aqmx-key-repeat", Dt = Object.freeze({ [Nt]: "allow" }), pi = `[${Nt}="${Dt[Nt]}"]`, gi = () => {
1908
1934
  let e = null;
1909
1935
  return {
1910
1936
  onKeyDownCapture: (t) => {
@@ -1913,7 +1939,7 @@ const Qa = /* @__PURE__ */ E.forwardRef(Ja), Lt = "data-aqmx-key-repeat", At = O
1913
1939
  e = t.target instanceof Element ? t.target : null;
1914
1940
  return;
1915
1941
  }
1916
- e !== null && t.target === e && e.closest(ei) !== null || (t.preventDefault(), t.stopPropagation());
1942
+ e !== null && t.target === e && e.closest(pi) !== null || (t.preventDefault(), t.stopPropagation());
1917
1943
  }
1918
1944
  },
1919
1945
  onKeyUpCapture: (t) => {
@@ -1923,7 +1949,7 @@ const Qa = /* @__PURE__ */ E.forwardRef(Ja), Lt = "data-aqmx-key-repeat", At = O
1923
1949
  t.target === e && (e = null);
1924
1950
  }
1925
1951
  };
1926
- }, Ke = Object.freeze([1 / Le ** 2, 1 / Le, 1, Le, Le ** 2]), kn = Object.freeze({ mode: "fit" }), ni = 1, Tr = Object.freeze({ className: "aqmx-document-canvas", "data-testid": "markdown-explorer-image-canvas" }), En = `[data-testid="${Tr["data-testid"]}"]`, ri = ve(null), oi = (e, t) => e.width > 0 && e.height > 0 && t.width - e.width <= ni ? { base: e, scale: t.width / e.width } : t.width > 0 && t.height > 0 ? { base: t, scale: 1 } : null, Sn = (e, t, n) => {
1952
+ }, Ke = Object.freeze([1 / Me ** 2, 1 / Me, 1, Me, Me ** 2]), xn = Object.freeze({ mode: "fit" }), wi = 1, Nr = Object.freeze({ className: "aqmx-document-canvas", "data-testid": "markdown-explorer-image-canvas" }), Tn = `[data-testid="${Nr["data-testid"]}"]`, vi = ve(null), bi = (e, t) => e.width > 0 && e.height > 0 && t.width - e.width <= wi ? { base: e, scale: t.width / e.width } : t.width > 0 && t.height > 0 ? { base: t, scale: 1 } : null, Rn = (e, t, n) => {
1927
1953
  if (e.mode === "level") {
1928
1954
  const o = e.index + n;
1929
1955
  return o >= 0 && o < Ke.length ? o : null;
@@ -1931,29 +1957,29 @@ const Qa = /* @__PURE__ */ E.forwardRef(Ja), Lt = "data-aqmx-key-repeat", At = O
1931
1957
  if (t === null || !Number.isFinite(t) || t <= 0) return null;
1932
1958
  const r = n === 1 ? Ke.findIndex((o) => o > t) : Ke.findLastIndex((o) => o < t);
1933
1959
  return r === -1 ? null : r;
1934
- }, xn = (e, t, n) => {
1960
+ }, Cn = (e, t, n) => {
1935
1961
  if (e.mode === "level") {
1936
- const o = Sn(e, null, n);
1962
+ const o = Rn(e, null, n);
1937
1963
  return o === null ? null : { mode: "level", index: o, base: e.base };
1938
1964
  }
1939
1965
  if (t === null) return null;
1940
- const r = Sn(e, t.scale, n);
1966
+ const r = Rn(e, t.scale, n);
1941
1967
  return r === null ? null : { mode: "level", index: r, base: t.base };
1942
- }, si = (e, t) => {
1968
+ }, yi = (e, t) => {
1943
1969
  if (e <= 0 || t <= 0) return 0;
1944
- const n = Math.trunc(Math.log(t / e) / Math.log(Le));
1970
+ const n = Math.trunc(Math.log(t / e) / Math.log(Me));
1945
1971
  return n === 0 ? 0 : n;
1946
- }, Tn = (e) => {
1972
+ }, On = (e) => {
1947
1973
  const t = e[0], n = e[1];
1948
1974
  return e.length !== 2 || t === void 0 || n === void 0 ? null : { distance: Math.hypot(n.clientX - t.clientX, n.clientY - t.clientY), middle: { x: (t.clientX + n.clientX) / 2, y: (t.clientY + n.clientY) / 2 } };
1949
- }, ai = (e) => {
1975
+ }, ki = (e) => {
1950
1976
  const t = Ke[e];
1951
1977
  if (t === void 0) throw new RangeError(`[markdown-explorer] no image zoom step ${String(e)}`);
1952
1978
  return t;
1953
- }, Rn = (e, t, n) => e !== null && e.width === t && e.height === n ? e : { width: t, height: n }, ii = ({ document: e }) => {
1954
- const { labels: t } = $(), n = se(ri), [r] = V(() => n === null ? null : n.read(e.url)), [o, s] = V(r === null ? kn : r.zoom), [a, i] = V(r === null ? null : r.reported), [f, u] = V(null), l = U(null), d = F((D) => {
1979
+ }, Ln = (e, t, n) => e !== null && e.width === t && e.height === n ? e : { width: t, height: n }, Ei = ({ document: e }) => {
1980
+ const { labels: t } = $(), n = se(vi), [r] = V(() => n === null ? null : n.read(e.url)), [o, s] = V(r === null ? xn : r.zoom), [a, i] = V(r === null ? null : r.reported), [f, u] = V(null), l = U(null), d = F((D) => {
1955
1981
  const { naturalWidth: m, naturalHeight: p } = D;
1956
- i((x) => Rn(x, m, p));
1982
+ i((x) => Ln(x, m, p));
1957
1983
  }, []), h = F(
1958
1984
  (D) => {
1959
1985
  l.current = D, !(D === null || !D.complete) && (D.naturalWidth > 0 || D.naturalHeight > 0 ? d(D) : D.decode().then(
@@ -1969,37 +1995,37 @@ const Qa = /* @__PURE__ */ E.forwardRef(Ja), Lt = "data-aqmx-key-repeat", At = O
1969
1995
  }, [n, e.url, o, a]), Y(() => {
1970
1996
  const D = l.current;
1971
1997
  if (D === null || a === null || o.mode !== "fit") return;
1972
- const m = () => u((x) => Rn(x, D.clientWidth, D.clientHeight));
1998
+ const m = () => u((x) => Ln(x, D.clientWidth, D.clientHeight));
1973
1999
  if (m(), typeof ResizeObserver > "u") return;
1974
2000
  const p = new ResizeObserver(m);
1975
2001
  return p.observe(D), () => p.disconnect();
1976
2002
  }, [a, o.mode]);
1977
- const g = a === null || f === null ? null : oi(a, f), v = xn(o, g, -1), y = xn(o, g, 1), T = o.mode === "level" ? ai(o.index) : null, C = U({ zoomIn: y, zoomOut: v });
2003
+ const g = a === null || f === null ? null : bi(a, f), v = Cn(o, g, -1), y = Cn(o, g, 1), T = o.mode === "level" ? ki(o.index) : null, O = U({ zoomIn: y, zoomOut: v });
1978
2004
  Y(() => {
1979
- C.current = { zoomIn: y, zoomOut: v };
2005
+ O.current = { zoomIn: y, zoomOut: v };
1980
2006
  });
1981
2007
  const R = U(null);
1982
2008
  Y(() => {
1983
- const D = R.current, m = l.current?.closest(En);
2009
+ const D = R.current, m = l.current?.closest(Tn);
1984
2010
  R.current = null, !(D === null || m === null || m === void 0) && (m.scrollLeft = D.across * m.scrollWidth - D.x, m.scrollTop = D.down * m.scrollHeight - D.y);
1985
2011
  }, [o]), ee(() => {
1986
- const D = l.current?.closest(En);
2012
+ const D = l.current?.closest(Tn);
1987
2013
  if (D == null) return;
1988
2014
  let m = null;
1989
2015
  const p = (I) => {
1990
- const _ = Tn(I.touches);
2016
+ const _ = On(I.touches);
1991
2017
  m = _ === null ? null : { distance: _.distance, steps: 0 };
1992
2018
  }, x = (I) => {
1993
- const _ = Tn(I.touches);
2019
+ const _ = On(I.touches);
1994
2020
  if (m === null || _ === null) return;
1995
2021
  I.preventDefault();
1996
- const b = si(m.distance, _.distance);
2022
+ const b = yi(m.distance, _.distance);
1997
2023
  if (b === m.steps) return;
1998
- const S = b > m.steps ? 1 : -1, M = S === 1 ? C.current.zoomIn : C.current.zoomOut;
1999
- if (M === null) return;
2024
+ const S = b > m.steps ? 1 : -1, L = S === 1 ? O.current.zoomIn : O.current.zoomOut;
2025
+ if (L === null) return;
2000
2026
  m.steps += S;
2001
- const L = D.getBoundingClientRect(), P = _.middle.x - L.left, H = _.middle.y - L.top;
2002
- R.current = D.scrollWidth > 0 && D.scrollHeight > 0 ? { x: P, y: H, across: (D.scrollLeft + P) / D.scrollWidth, down: (D.scrollTop + H) / D.scrollHeight } : null, s(M);
2027
+ const M = D.getBoundingClientRect(), P = _.middle.x - M.left, H = _.middle.y - M.top;
2028
+ R.current = D.scrollWidth > 0 && D.scrollHeight > 0 ? { x: P, y: H, across: (D.scrollLeft + P) / D.scrollWidth, down: (D.scrollTop + H) / D.scrollHeight } : null, s(L);
2003
2029
  }, A = (I) => {
2004
2030
  I.touches.length < 2 && (m = null);
2005
2031
  };
@@ -2009,7 +2035,7 @@ const Qa = /* @__PURE__ */ E.forwardRef(Ja), Lt = "data-aqmx-key-repeat", At = O
2009
2035
  }, []);
2010
2036
  const q = o.mode === "level" && T !== null ? { width: `${o.base.width * T}px`, height: `${o.base.height * T}px` } : void 0;
2011
2037
  return /* @__PURE__ */ B("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-image-view", children: [
2012
- /* @__PURE__ */ B(Ue, { name: e.name, openUrl: e.url, downloadUrl: e.url, icon: /* @__PURE__ */ c(Qa, {}), children: [
2038
+ /* @__PURE__ */ B(Ue, { name: e.name, openUrl: e.url, downloadUrl: e.url, icon: /* @__PURE__ */ c(hi, {}), children: [
2013
2039
  /* @__PURE__ */ c(
2014
2040
  "button",
2015
2041
  {
@@ -2021,8 +2047,8 @@ const Qa = /* @__PURE__ */ E.forwardRef(Ja), Lt = "data-aqmx-key-repeat", At = O
2021
2047
  onClick: () => {
2022
2048
  v !== null && s(v);
2023
2049
  },
2024
- ...At,
2025
- children: /* @__PURE__ */ c(Ka, {})
2050
+ ...Dt,
2051
+ children: /* @__PURE__ */ c(di, {})
2026
2052
  }
2027
2053
  ),
2028
2054
  /* @__PURE__ */ c("output", { className: "aqmx-document-level", "aria-live": "polite", "data-testid": "markdown-explorer-image-level", children: T === null ? t.imageFitLevel : t.imageZoomLevel(Math.round(T * 100)) }),
@@ -2037,33 +2063,33 @@ const Qa = /* @__PURE__ */ E.forwardRef(Ja), Lt = "data-aqmx-key-repeat", At = O
2037
2063
  onClick: () => {
2038
2064
  y !== null && s(y);
2039
2065
  },
2040
- ...At,
2041
- children: /* @__PURE__ */ c(Xa, {})
2066
+ ...Dt,
2067
+ children: /* @__PURE__ */ c(fi, {})
2042
2068
  }
2043
2069
  ),
2044
- /* @__PURE__ */ c("button", { type: "button", className: "aqmx-icon-button", "aria-label": t.imageFit, title: t.imageFit, "aria-pressed": o.mode === "fit", onClick: () => s(kn), children: /* @__PURE__ */ c(Wa, {}) })
2070
+ /* @__PURE__ */ c("button", { type: "button", className: "aqmx-icon-button", "aria-label": t.imageFit, title: t.imageFit, "aria-pressed": o.mode === "fit", onClick: () => s(xn), children: /* @__PURE__ */ c(li, {}) })
2045
2071
  ] }),
2046
- /* @__PURE__ */ c(Be, { scrollerProps: Tr, children: /* @__PURE__ */ c("img", { ref: h, className: "aqmx-document-image", src: e.url, alt: e.name, "data-aqmx-image-mode": o.mode, style: q, onLoad: (D) => d(D.currentTarget), "data-testid": "markdown-explorer-image" }) })
2072
+ /* @__PURE__ */ c(Be, { scrollerProps: Nr, children: /* @__PURE__ */ c("img", { ref: h, className: "aqmx-document-image", src: e.url, alt: e.name, "data-aqmx-image-mode": o.mode, style: q, onLoad: (D) => d(D.currentTarget), "data-testid": "markdown-explorer-image" }) })
2047
2073
  ] });
2048
- }, li = async (e, t, n) => {
2074
+ }, Si = async (e, t, n) => {
2049
2075
  const r = await e.text(t, n);
2050
2076
  if (!("kind" in r)) throw n.reason;
2051
2077
  return r.kind === "text" ? { kind: "text", text: r.text, truncated: r.truncated } : { kind: "failure", retryable: r.failure.reason === "failed" };
2052
- }, Rr = ve(null), at = ve(void 0), Or = ve(null), it = () => {
2053
- const e = se(Rr);
2078
+ }, Dr = ve(null), at = ve(void 0), Pr = ve(null), it = () => {
2079
+ const e = se(Dr);
2054
2080
  if (e === null) throw new Error("[markdown-explorer] document links must be rendered inside a document pane");
2055
2081
  return e;
2056
- }, ci = () => {
2057
- const e = se(Or);
2082
+ }, xi = () => {
2083
+ const e = se(Pr);
2058
2084
  if (e === null) throw new Error("[markdown-explorer] table-of-contents entries must be rendered inside a document pane's links");
2059
2085
  return e;
2060
- }, lt = (e, t, n, r) => t.kind === "panel" ? Ne(e, { view: "tree", source: n, doc: r }) : t.view === "single" ? Ne(e, { view: "single", source: n, doc: r, overrides: t.overrides, embed: t.embed }) : Ne(e, { view: "tree", source: n, doc: r, overrides: t.overrides }), di = ({ children: e }) => {
2061
- const { config: t } = $(), n = it(), r = $t(), o = r.kind === "location" ? r.location.source : void 0, s = nt(lt(t, n.navigation, o, n.currentPath));
2062
- return /* @__PURE__ */ c(at, { value: o, children: /* @__PURE__ */ c(Or, { value: s, children: e }) });
2063
- }, ui = 'a[data-link-kind="doc"][data-doc-path]:not([data-doc-exists="false"])', fi = (e) => {
2064
- const t = e instanceof Element ? e.closest(ui) : null;
2086
+ }, lt = (e, t, n, r) => t.kind === "panel" ? Ne(e, { view: "tree", source: n, doc: r }) : t.view === "single" ? Ne(e, { view: "single", source: n, doc: r, overrides: t.overrides, embed: t.embed }) : Ne(e, { view: "tree", source: n, doc: r, overrides: t.overrides }), Ti = ({ children: e }) => {
2087
+ const { config: t } = $(), n = it(), r = Ft(), o = r.kind === "location" ? r.location.source : void 0, s = nt(lt(t, n.navigation, o, n.currentPath));
2088
+ return /* @__PURE__ */ c(at, { value: o, children: /* @__PURE__ */ c(Pr, { value: s, children: e }) });
2089
+ }, Ri = 'a[data-link-kind="doc"][data-doc-path]:not([data-doc-exists="false"])', Ci = (e) => {
2090
+ const t = e instanceof Element ? e.closest(Ri) : null;
2065
2091
  return t === null ? null : t.getAttribute("data-doc-path");
2066
- }, ct = (e) => !e.defaultPrevented && e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey, mi = ({ to: e, docPath: t, fragment: n, exists: r, className: o, attributes: s, onDocumentLink: a, scope: i, children: f }) => {
2092
+ }, ct = (e) => !e.defaultPrevented && e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey, Oi = ({ to: e, docPath: t, fragment: n, exists: r, className: o, attributes: s, onDocumentLink: a, scope: i, children: f }) => {
2067
2093
  const u = nt(e);
2068
2094
  return /* @__PURE__ */ c("a", { ...s, href: u, className: o, "data-link-kind": "doc", "data-doc-path": t, "data-doc-exists": r, onClick: (d) => {
2069
2095
  if (ct(d)) {
@@ -2074,10 +2100,10 @@ const Qa = /* @__PURE__ */ E.forwardRef(Ja), Lt = "data-aqmx-key-repeat", At = O
2074
2100
  a(t, n);
2075
2101
  }
2076
2102
  }, children: f });
2077
- }, hi = ({ href: e, docPath: t, docExists: n, className: r, attributes: o, children: s }) => {
2078
- const { config: a } = $(), i = it(), f = se(at), u = $a(e), { navigation: l } = i, d = `${lt(a, l, f, t)}${u}`, h = n === !1 ? "false" : void 0;
2079
- return l.kind === "page" ? /* @__PURE__ */ c(ia, { ...o, to: d, navigation: "follow-link", className: r, "data-link-kind": "doc", "data-doc-path": t, "data-doc-exists": h, children: s }) : /* @__PURE__ */ c(mi, { to: d, docPath: t, fragment: u, exists: h, className: r, attributes: o, onDocumentLink: l.onDocumentLink, scope: i, children: s });
2080
- }, pi = ({ className: e, attributes: t, children: n }) => {
2103
+ }, Li = ({ href: e, docPath: t, docExists: n, className: r, attributes: o, children: s }) => {
2104
+ const { config: a } = $(), i = it(), f = se(at), u = Xa(e), { navigation: l } = i, d = `${lt(a, l, f, t)}${u}`, h = n === !1 ? "false" : void 0;
2105
+ return l.kind === "page" ? /* @__PURE__ */ c(ga, { ...o, to: d, navigation: "follow-link", className: r, "data-link-kind": "doc", "data-doc-path": t, "data-doc-exists": h, children: s }) : /* @__PURE__ */ c(Oi, { to: d, docPath: t, fragment: u, exists: h, className: r, attributes: o, onDocumentLink: l.onDocumentLink, scope: i, children: s });
2106
+ }, Mi = ({ className: e, attributes: t, children: n }) => {
2081
2107
  const { labels: r } = $();
2082
2108
  return (
2083
2109
  /* @__PURE__ */ B("a", { ...t, className: e === void 0 ? "aqmx-document-inert-link" : `${e} aqmx-document-inert-link`, title: r.inertLink, "data-link-kind": "doc", "data-doc-exists": "false", children: [
@@ -2089,34 +2115,34 @@ const Qa = /* @__PURE__ */ E.forwardRef(Ja), Lt = "data-aqmx-key-repeat", At = O
2089
2115
  ] })
2090
2116
  ] })
2091
2117
  );
2092
- }, gi = ({ href: e, className: t, attributes: n, scope: r, children: o }) => {
2118
+ }, Ai = ({ href: e, className: t, attributes: n, scope: r, children: o }) => {
2093
2119
  const { config: s } = $(), a = se(at), i = nt(`${lt(s, r.navigation, a, r.currentPath)}${e}`);
2094
2120
  return /* @__PURE__ */ c("a", { ...n, href: i, className: t, onClick: (u) => {
2095
2121
  ct(u) && (u.preventDefault(), r.scrollWithin(e));
2096
2122
  }, children: o });
2097
- }, wi = ({ href: e, className: t, attributes: n, children: r }) => {
2123
+ }, Ni = ({ href: e, className: t, attributes: n, children: r }) => {
2098
2124
  const o = it();
2099
2125
  return o.navigation.kind === "page" ? /* @__PURE__ */ c("a", { ...n, href: e, className: t, onClick: (a) => {
2100
2126
  if (!ct(a)) return;
2101
2127
  const i = a.currentTarget;
2102
2128
  e === "#" ? o.followEmptyFragment(a.nativeEvent) : i.href === i.ownerDocument.URL && o.followSameUrlJump(e, a.nativeEvent);
2103
- }, children: r }) : /* @__PURE__ */ c(gi, { href: e, className: t, attributes: n, scope: o, children: r });
2104
- }, vi = ({ href: e, kind: t, docPath: n, docExists: r, className: o, attributes: s, children: a }) => t === "doc" ? n === void 0 || !Lo(n) ? /* @__PURE__ */ c(pi, { className: o, attributes: s, children: a }) : /* @__PURE__ */ c(hi, { href: e, docPath: n, docExists: r, className: o, attributes: s, children: a }) : e.startsWith("#") ? /* @__PURE__ */ c(wi, { href: e, className: o, attributes: s, children: a }) : /* @__PURE__ */ c("a", { ...s, href: e, className: o, children: a }), bi = () => {
2129
+ }, children: r }) : /* @__PURE__ */ c(Ai, { href: e, className: t, attributes: n, scope: o, children: r });
2130
+ }, Di = ({ href: e, kind: t, docPath: n, docExists: r, className: o, attributes: s, children: a }) => t === "doc" ? n === void 0 || !qo(n) ? /* @__PURE__ */ c(Mi, { className: o, attributes: s, children: a }) : /* @__PURE__ */ c(Li, { href: e, docPath: n, docExists: r, className: o, attributes: s, children: a }) : e.startsWith("#") ? /* @__PURE__ */ c(Ni, { href: e, className: o, attributes: s, children: a }) : /* @__PURE__ */ c("a", { ...s, href: e, className: o, children: a }), Pi = () => {
2105
2131
  const { config: e } = $(), t = it(), n = se(at), r = ot();
2106
2132
  return F(
2107
2133
  (o, s) => {
2108
2134
  if (!ct(s)) return !0;
2109
2135
  s.preventDefault();
2110
- const a = Er(o.id), { navigation: i } = t;
2111
- return i.kind === "panel" || Bt(s.currentTarget.ownerDocument.location.hash) === o.id ? (t.scrollWithin(a), !0) : (r(`${lt(e, i, n, t.currentPath)}${a}`, "follow-link"), !0);
2136
+ const a = Lr(o.id), { navigation: i } = t;
2137
+ return i.kind === "panel" || zt(s.currentTarget.ownerDocument.location.hash) === o.id ? (t.scrollWithin(a), !0) : (r(`${lt(e, i, n, t.currentPath)}${a}`, "follow-link"), !0);
2112
2138
  },
2113
2139
  [e, t, n, r]
2114
2140
  );
2115
- }, yi = () => {
2116
- const e = ci();
2117
- return F((t) => `${e}${Er(t.id)}`, [e]);
2141
+ }, Ii = () => {
2142
+ const e = xi();
2143
+ return F((t) => `${e}${Lr(t.id)}`, [e]);
2118
2144
  };
2119
- function ki({
2145
+ function $i({
2120
2146
  title: e,
2121
2147
  titleId: t,
2122
2148
  ...n
@@ -2135,8 +2161,8 @@ function ki({
2135
2161
  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"
2136
2162
  }));
2137
2163
  }
2138
- const Ei = /* @__PURE__ */ E.forwardRef(ki);
2139
- function Si({
2164
+ const _i = /* @__PURE__ */ E.forwardRef($i);
2165
+ function Fi({
2140
2166
  title: e,
2141
2167
  titleId: t,
2142
2168
  ...n
@@ -2157,8 +2183,8 @@ function Si({
2157
2183
  clipRule: "evenodd"
2158
2184
  }));
2159
2185
  }
2160
- const xi = /* @__PURE__ */ E.forwardRef(Si);
2161
- function Ti({
2186
+ const qi = /* @__PURE__ */ E.forwardRef(Fi);
2187
+ function Bi({
2162
2188
  title: e,
2163
2189
  titleId: t,
2164
2190
  ...n
@@ -2179,9 +2205,9 @@ function Ti({
2179
2205
  clipRule: "evenodd"
2180
2206
  }));
2181
2207
  }
2182
- const Ri = /* @__PURE__ */ E.forwardRef(Ti), Oi = Object.freeze({ className: "aqmx-document-stage" }), Ci = () => () => {
2183
- }, Mi = () => navigator.pdfViewerEnabled !== !1, Li = () => null, Ai = ({ document: e }) => {
2184
- const { labels: t } = $(), n = oe(Ci, Mi, Li);
2208
+ const Ui = /* @__PURE__ */ E.forwardRef(Bi), Hi = Object.freeze({ className: "aqmx-document-stage" }), zi = () => () => {
2209
+ }, ji = () => navigator.pdfViewerEnabled !== !1, Vi = () => null, Zi = ({ document: e }) => {
2210
+ const { labels: t } = $(), n = re(zi, ji, Vi);
2185
2211
  return n === null ? null : n ? /* @__PURE__ */ c("iframe", { className: "aqmx-document-frame", src: e.url, title: e.name, "data-testid": "markdown-explorer-media-player" }) : /* @__PURE__ */ B("div", { className: "aqmx-callout", role: "note", "data-testid": "markdown-explorer-pdf-not-shown", children: [
2186
2212
  /* @__PURE__ */ c("p", { className: "aqmx-callout-body", children: t.pdfNotShown }),
2187
2213
  /* @__PURE__ */ B("div", { className: "aqmx-callout-actions", children: [
@@ -2189,20 +2215,20 @@ const Ri = /* @__PURE__ */ E.forwardRef(Ti), Oi = Object.freeze({ className: "aq
2189
2215
  /* @__PURE__ */ c("a", { className: "aqmx-callout-action", href: e.url, download: e.name, "data-testid": "markdown-explorer-pdf-not-shown-download", children: t.download })
2190
2216
  ] })
2191
2217
  ] });
2192
- }, Ni = (e) => {
2218
+ }, Wi = (e) => {
2193
2219
  switch (e) {
2194
2220
  case "video":
2195
- return /* @__PURE__ */ c(xi, {});
2221
+ return /* @__PURE__ */ c(qi, {});
2196
2222
  case "audio":
2197
- return /* @__PURE__ */ c(Ri, {});
2223
+ return /* @__PURE__ */ c(Ui, {});
2198
2224
  case "pdf":
2199
- return /* @__PURE__ */ c(Ei, {});
2225
+ return /* @__PURE__ */ c(_i, {});
2200
2226
  default: {
2201
2227
  const t = e;
2202
2228
  throw new RangeError(`[markdown-explorer] unknown media type ${String(t)}`);
2203
2229
  }
2204
2230
  }
2205
- }, Di = ({ document: e }) => {
2231
+ }, Gi = ({ document: e }) => {
2206
2232
  const { labels: t } = $();
2207
2233
  switch (e.mediaType) {
2208
2234
  case "video":
@@ -2214,16 +2240,16 @@ const Ri = /* @__PURE__ */ E.forwardRef(Ti), Oi = Object.freeze({ className: "aq
2214
2240
  /* @__PURE__ */ c("audio", { className: "aqmx-document-audio", src: e.url, controls: !0, preload: "metadata", "aria-label": e.name, "data-testid": "markdown-explorer-media-player", children: t.mediaUnsupported })
2215
2241
  );
2216
2242
  case "pdf":
2217
- return /* @__PURE__ */ c(Ai, { document: e });
2243
+ return /* @__PURE__ */ c(Zi, { document: e });
2218
2244
  default: {
2219
2245
  const n = e.mediaType;
2220
2246
  throw new RangeError(`[markdown-explorer] unknown media type ${String(n)}`);
2221
2247
  }
2222
2248
  }
2223
- }, Pi = ({ document: e }) => /* @__PURE__ */ B("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-media-view", "data-aqmx-media-type": e.mediaType, children: [
2224
- /* @__PURE__ */ c(Ue, { name: e.name, openUrl: e.url, downloadUrl: e.url, icon: Ni(e.mediaType) }),
2225
- /* @__PURE__ */ c(Be, { scrollerProps: Oi, children: /* @__PURE__ */ c(Di, { document: e }) })
2226
- ] }), Ut = (e) => {
2249
+ }, Ki = ({ document: e }) => /* @__PURE__ */ B("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-media-view", "data-aqmx-media-type": e.mediaType, children: [
2250
+ /* @__PURE__ */ c(Ue, { name: e.name, openUrl: e.url, downloadUrl: e.url, icon: Wi(e.mediaType) }),
2251
+ /* @__PURE__ */ c(Be, { scrollerProps: Hi, children: /* @__PURE__ */ c(Gi, { document: e }) })
2252
+ ] }), jt = (e) => {
2227
2253
  switch (e.kind) {
2228
2254
  case "markdown":
2229
2255
  return "markdown";
@@ -2234,14 +2260,14 @@ const Ri = /* @__PURE__ */ E.forwardRef(Ti), Oi = Object.freeze({ className: "aq
2234
2260
  default:
2235
2261
  return null;
2236
2262
  }
2237
- }, Ii = (e) => {
2238
- const { documents: t } = $(), n = F(() => t.peek(e), [t, e]), r = F(() => t.peekSeeded(e), [t, e]), o = oe(t.subscribe, n, r), s = ge(o);
2239
- return s === null ? null : Ut(s.document);
2240
- }, $i = (e) => {
2263
+ }, Yi = (e) => {
2264
+ const { documents: t } = $(), n = F(() => t.peek(e), [t, e]), r = F(() => t.peekSeeded(e), [t, e]), o = re(t.subscribe, n, r), s = ge(o);
2265
+ return s === null ? null : jt(s.document);
2266
+ }, Xi = (e) => {
2241
2267
  const { config: t } = $(), n = ot(), r = F(() => n(Ne(t, { ...e, markup: !e.markup }), "browse"), [t, n, e]);
2242
2268
  return X(() => ({ shown: e.markup, toggle: r }), [e.markup, r]);
2243
2269
  };
2244
- function _i({
2270
+ function Ji({
2245
2271
  title: e,
2246
2272
  titleId: t,
2247
2273
  ...n
@@ -2262,16 +2288,16 @@ function _i({
2262
2288
  clipRule: "evenodd"
2263
2289
  }));
2264
2290
  }
2265
- const Fi = /* @__PURE__ */ E.forwardRef(_i), qi = 100, Bi = 32767, Ye = Object.freeze({ maxCells: an, maxColumns: an / qi, maxCellLength: Bi }), Cr = 44, Mr = 10, Lr = 13, Ze = '"', On = (e, t) => {
2291
+ const Qi = /* @__PURE__ */ E.forwardRef(Ji), el = 100, tl = 32767, Ye = Object.freeze({ maxCells: dn, maxColumns: dn / el, maxCellLength: tl }), Ir = 44, $r = 10, _r = 13, Ze = '"', Mn = (e, t) => {
2266
2292
  let n = t;
2267
2293
  for (; n < e.length; ) {
2268
2294
  const r = e.charCodeAt(n);
2269
- if (r === Cr || r === Mr || r === Lr) return n;
2295
+ if (r === Ir || r === $r || r === _r) return n;
2270
2296
  n += 1;
2271
2297
  }
2272
2298
  return n;
2273
2299
  };
2274
- function* Ui(e, t) {
2300
+ function* nl(e, t) {
2275
2301
  let n = [], r = 0;
2276
2302
  for (; ; ) {
2277
2303
  let o;
@@ -2291,10 +2317,10 @@ function* Ui(e, t) {
2291
2317
  r = f + 1;
2292
2318
  break;
2293
2319
  }
2294
- const i = On(e, r);
2320
+ const i = Mn(e, r);
2295
2321
  o += e.slice(r, i), r = i;
2296
2322
  } else {
2297
- const a = On(e, r);
2323
+ const a = Mn(e, r);
2298
2324
  o = e.slice(r, a), r = a;
2299
2325
  }
2300
2326
  if (n.push(o), r >= e.length) {
@@ -2302,15 +2328,15 @@ function* Ui(e, t) {
2302
2328
  return;
2303
2329
  }
2304
2330
  const s = e.charCodeAt(r);
2305
- if (r += 1, s !== Cr && (yield n, n = [], s === Lr && e.charCodeAt(r) === Mr && (r += 1), r >= e.length))
2331
+ if (r += 1, s !== Ir && (yield n, n = [], s === _r && e.charCodeAt(r) === $r && (r += 1), r >= e.length))
2306
2332
  return;
2307
2333
  }
2308
2334
  }
2309
- const Hi = (e, t, n) => t === "csv" ? Ui(e, n) : n === "whole" ? Xo(e) : Jo(e), zi = (e, t) => {
2335
+ const rl = (e, t, n) => t === "csv" ? nl(e, n) : n === "whole" ? as(e) : is(e), ol = (e, t) => {
2310
2336
  if (e.length <= t) return e;
2311
2337
  const n = e.charCodeAt(t - 1);
2312
2338
  return e.slice(0, n >= 55296 && n <= 56319 ? t - 1 : t);
2313
- }, Ar = (e, t) => {
2339
+ }, Fr = (e, t) => {
2314
2340
  const n = [];
2315
2341
  let r = 0, o = !1, s = !1;
2316
2342
  for (const i of e) {
@@ -2319,17 +2345,17 @@ const Hi = (e, t, n) => t === "csv" ? Ui(e, n) : n === "whole" ? Xo(e) : Jo(e),
2319
2345
  s = !0;
2320
2346
  break;
2321
2347
  }
2322
- const l = f.some((d) => d.length > t.maxCellLength) ? f.map((d) => zi(d, t.maxCellLength)) : f;
2348
+ const l = f.some((d) => d.length > t.maxCellLength) ? f.map((d) => ol(d, t.maxCellLength)) : f;
2323
2349
  l !== i && (o = !0), n.push(l), r = u;
2324
2350
  }
2325
2351
  return { rows: n.map((i) => i.length === r ? i : [...i, ...Array(r - i.length).fill("")]), truncated: s || o, full: s };
2326
- }, wt = (e, t, n, r, o) => {
2327
- const s = Eo(e, t, r);
2328
- if (s === null) return { kind: "unreadable", code: "encoding", encodings: So(e, t, r) };
2352
+ }, vt = (e, t, n, r, o) => {
2353
+ const s = Ao(e, t, r);
2354
+ if (s === null) return { kind: "unreadable", code: "encoding", encodings: No(e, t, r) };
2329
2355
  if (s.includes("\0")) return { kind: "unreadable", code: "binary" };
2330
- const a = Ar(Hi(s, n, t ? "whole" : "prefix"), o);
2356
+ const a = Fr(rl(s, n, t ? "whole" : "prefix"), o);
2331
2357
  return t ? a.truncated || a.rows.some((i) => i.some((f) => f !== "")) ? { kind: "table", table: a } : { kind: "empty" } : a.rows.length === 0 ? { kind: "unreadable", code: "long-row" } : { kind: "table", table: { ...a, truncated: !0 } };
2332
- }, ji = Object.freeze({ maxPartBytes: 64 * 1024 * 1024, maxSheets: 256 }), Nr = (e) => {
2358
+ }, sl = Object.freeze({ maxPartBytes: 64 * 1024 * 1024, maxSheets: 256 }), qr = (e) => {
2333
2359
  const t = [];
2334
2360
  let n = 0, r = !1;
2335
2361
  const o = (s) => {
@@ -2355,14 +2381,14 @@ const Hi = (e, t, n) => t === "csv" ? Ui(e, n) : n === "whole" ? Xo(e) : Jo(e),
2355
2381
  for (let d = 0; d < i && !r; d += 1) o(d === 0 ? u : [...u]);
2356
2382
  },
2357
2383
  full: () => r,
2358
- table: () => Ar(t, e)
2384
+ table: () => Fr(t, e)
2359
2385
  };
2360
- }, Vi = (e) => {
2386
+ }, al = (e) => {
2361
2387
  const t = Array.from(e.currentTarget.querySelectorAll('[role="tab"]')), n = e.target instanceof HTMLButtonElement ? t.indexOf(e.target) : -1;
2362
2388
  if (n === -1) return;
2363
2389
  const r = getComputedStyle(e.currentTarget).direction === "rtl" ? "ArrowRight" : "ArrowLeft", o = r === "ArrowLeft" ? "ArrowRight" : "ArrowLeft", s = e.key === o ? (n + 1) % t.length : e.key === r ? (n - 1 + t.length) % t.length : e.key === "Home" ? 0 : e.key === "End" ? t.length - 1 : null;
2364
2390
  s !== null && (e.preventDefault(), t[s]?.focus());
2365
- }, Zi = ({ names: e, selected: t, onSelect: n, label: r, tabIdOf: o, panelId: s }) => /* @__PURE__ */ c("div", { role: "tablist", "aria-label": r, className: "aqmx-sheet-tabs", "data-testid": "markdown-explorer-spreadsheet-sheets", onKeyDown: Vi, children: e.map((a, i) => /* @__PURE__ */ c(
2391
+ }, il = ({ names: e, selected: t, onSelect: n, label: r, tabIdOf: o, panelId: s }) => /* @__PURE__ */ c("div", { role: "tablist", "aria-label": r, className: "aqmx-sheet-tabs", "data-testid": "markdown-explorer-spreadsheet-sheets", onKeyDown: al, children: e.map((a, i) => /* @__PURE__ */ c(
2366
2392
  "button",
2367
2393
  {
2368
2394
  type: "button",
@@ -2377,8 +2403,8 @@ const Hi = (e, t, n) => t === "csv" ? Ui(e, n) : n === "whole" ? Xo(e) : Jo(e),
2377
2403
  children: a
2378
2404
  },
2379
2405
  i
2380
- )) }), Dr = 64 * 1024, Wi = (e) => {
2381
- let t = new Uint8Array(Math.min(e, Dr)), n = 0;
2406
+ )) }), Br = 64 * 1024, ll = (e) => {
2407
+ let t = new Uint8Array(Math.min(e, Br)), n = 0;
2382
2408
  return {
2383
2409
  append: (r) => {
2384
2410
  if (n + r.byteLength > t.byteLength) {
@@ -2390,80 +2416,80 @@ const Hi = (e, t, n) => t === "csv" ? Ui(e, n) : n === "whole" ? Xo(e) : Jo(e),
2390
2416
  bytes: () => t.subarray(0, n),
2391
2417
  length: () => n
2392
2418
  };
2393
- }, Gi = async (e) => {
2419
+ }, cl = async (e) => {
2394
2420
  for (; ; ) {
2395
2421
  const { done: t, value: n } = await e.read();
2396
2422
  if (t) return !0;
2397
2423
  if (n.byteLength > 0) return !1;
2398
2424
  }
2399
- }, Ki = async (e, t) => {
2400
- const { format: n, legacyEncoding: r, maxBytes: o, budget: s } = t, a = e.getReader(), i = Wi(o);
2401
- let f = Dr;
2425
+ }, dl = async (e, t) => {
2426
+ const { format: n, legacyEncoding: r, maxBytes: o, budget: s } = t, a = e.getReader(), i = ll(o);
2427
+ let f = Br;
2402
2428
  try {
2403
2429
  for (; ; ) {
2404
2430
  const { done: u, value: l } = await a.read();
2405
- if (u) return wt(i.bytes(), !0, n, r, s);
2431
+ if (u) return vt(i.bytes(), !0, n, r, s);
2406
2432
  const d = o - i.length();
2407
2433
  if (i.append(l.byteLength > d ? l.subarray(0, d) : l), i.length() === o) {
2408
- const g = l.byteLength <= d && await Gi(a);
2409
- return wt(i.bytes(), g, n, r, s);
2434
+ const g = l.byteLength <= d && await cl(a);
2435
+ return vt(i.bytes(), g, n, r, s);
2410
2436
  }
2411
2437
  if (i.length() < f) continue;
2412
2438
  f = i.length() * 2;
2413
- const h = wt(i.bytes(), !1, n, r, s);
2439
+ const h = vt(i.bytes(), !1, n, r, s);
2414
2440
  if (h.kind === "unreadable" && h.code !== "long-row" || h.kind === "table" && h.table.full) return h;
2415
2441
  }
2416
2442
  } finally {
2417
2443
  a.cancel().catch(() => {
2418
2444
  });
2419
2445
  }
2420
- }, Pr = async (e, t, n, r) => {
2446
+ }, Ur = async (e, t, n, r) => {
2421
2447
  const o = await e.asset(rt(t), r);
2422
2448
  if (o.status === "cancelled") return null;
2423
2449
  if (o.status === "error") return { kind: "failure", failure: o.failure };
2424
2450
  let s;
2425
2451
  try {
2426
- s = await Ki(o.body, n);
2452
+ s = await dl(o.body, n);
2427
2453
  } catch {
2428
2454
  return r.aborted ? null : { kind: "failure", failure: { reason: "failed" } };
2429
2455
  }
2430
2456
  return r.aborted ? null : s.kind === "table" ? { kind: "table", rows: s.table.rows, truncated: s.table.truncated } : s;
2431
- }, Ht = (e, t, n) => {
2432
- const { documents: r, labels: o } = $(), s = Oa(), a = F(() => r.answerStampOf(e), [r, e]), i = oe(r.subscribe, a, a), [f, u] = V(0), l = X(() => ({ read: n, stamp: i, attempt: f }), [n, i, f]), [d, h] = V({ settled: null, shown: null, failure: null }), g = U(null), v = le((C, R) => {
2433
- if (g.current?.settle(R.stamp, C.kind === "failure" ? C.failure : null), C.kind === "read") {
2434
- h({ settled: R, shown: C.value, failure: null });
2457
+ }, Vt = (e, t, n) => {
2458
+ const { documents: r, labels: o } = $(), s = Ha(), a = F(() => r.answerStampOf(e), [r, e]), i = re(r.subscribe, a, a), [f, u] = V(0), l = X(() => ({ read: n, stamp: i, attempt: f }), [n, i, f]), [d, h] = V({ settled: null, shown: null, failure: null }), g = U(null), v = le((O, R) => {
2459
+ if (g.current?.settle(R.stamp, O.kind === "failure" ? O.failure : null), O.kind === "read") {
2460
+ h({ settled: R, shown: O.value, failure: null });
2435
2461
  return;
2436
2462
  }
2437
2463
  if (d.shown !== null) {
2438
2464
  h({ settled: R, shown: d.shown, failure: null });
2439
2465
  return;
2440
2466
  }
2441
- h({ settled: R, shown: null, failure: C.failure }), s.announceFailure(o.documentFailed(t, de(o, C.failure.reason)));
2467
+ h({ settled: R, shown: null, failure: O.failure }), s.announceFailure(o.documentFailed(t, de(o, O.failure.reason)));
2442
2468
  });
2443
2469
  ee(() => {
2444
- const C = s.readPart();
2445
- return g.current = C, () => {
2446
- g.current = null, C.release();
2470
+ const O = s.readPart();
2471
+ return g.current = O, () => {
2472
+ g.current = null, O.release();
2447
2473
  };
2448
2474
  }, [s]), ee(() => {
2449
- const C = new AbortController();
2450
- return l.read(C.signal).then((R) => {
2451
- R !== null && !C.signal.aborted && v(R, l);
2452
- }), () => C.abort();
2475
+ const O = new AbortController();
2476
+ return l.read(O.signal).then((R) => {
2477
+ R !== null && !O.signal.aborted && v(R, l);
2478
+ }), () => O.abort();
2453
2479
  }, [l]);
2454
2480
  const y = d.settled !== l && (d.shown !== null || d.failure !== null);
2455
2481
  Y(() => y ? s.holdBusy() : void 0, [y, s]);
2456
- const T = F(() => u((C) => C + 1), []);
2482
+ const T = F(() => u((O) => O + 1), []);
2457
2483
  return { shown: d.shown, failure: d.failure, retry: T };
2458
- }, Ir = (e, t) => {
2484
+ }, Hr = (e, t) => {
2459
2485
  const n = {};
2460
2486
  for (const r of Object.keys(Xe[t])) {
2461
- const o = e[It(r)];
2487
+ const o = e[_t(r)];
2462
2488
  o !== Xe[t][r].text && (n[r] = o);
2463
2489
  }
2464
2490
  return n;
2465
- }, Yi = (e, t) => Object.fromEntries(Object.entries(Ir(e, t)).map(([n, r]) => [`spreadsheet${n.charAt(0).toUpperCase()}${n.slice(1)}`, r])), Xi = (e, t) => ({
2466
- ...Yi(e, t),
2491
+ }, ul = (e, t) => Object.fromEntries(Object.entries(Hr(e, t)).map(([n, r]) => [`spreadsheet${n.charAt(0).toUpperCase()}${n.slice(1)}`, r])), fl = (e, t) => ({
2492
+ ...ul(e, t),
2467
2493
  loading: e.viewerLoading,
2468
2494
  errorPrefix: e.viewerErrorPrefix,
2469
2495
  styleTitle: e.viewerStyleTitle,
@@ -2521,28 +2547,28 @@ const Hi = (e, t, n) => t === "csv" ? Ui(e, n) : n === "whole" ? Xo(e) : Jo(e),
2521
2547
  svgImageCopyImage: e.viewerSvgImageCopyImage,
2522
2548
  svgImageCopiedImage: e.viewerSvgImageCopiedImage,
2523
2549
  svgImageCopyImageFailed: e.viewerSvgImageCopyImageFailed
2524
- }), $r = (e, t, n) => {
2550
+ }), zr = (e, t, n) => {
2525
2551
  if (t !== void 0) return t;
2526
2552
  if (n !== void 0) return n;
2527
2553
  const [r] = e.documentStyles;
2528
2554
  if (r === void 0) throw new Error("[markdown-explorer] the configuration has no document style");
2529
2555
  return r.name;
2530
- }, _r = (e, t) => e !== void 0 ? e : t !== void 0 ? t : es;
2556
+ }, jr = (e, t) => e !== void 0 ? e : t !== void 0 ? t : cs;
2531
2557
  class ne extends Error {
2532
2558
  refusal;
2533
2559
  constructor(t, n) {
2534
2560
  super(n), this.name = "WorkbookError", this.refusal = t;
2535
2561
  }
2536
2562
  }
2537
- const Ji = /* @__PURE__ */ new Map([
2563
+ const ml = /* @__PURE__ */ new Map([
2538
2564
  ["lt", "<"],
2539
2565
  ["gt", ">"],
2540
2566
  ["amp", "&"],
2541
2567
  ["quot", '"'],
2542
2568
  ["apos", "'"]
2543
- ]), Qi = /&(#x[0-9A-Fa-f]+|#[0-9]+|[A-Za-z_][A-Za-z0-9._-]*);/gu, el = /([^\s=/>]+)\s*=\s*(?:"([^"]*)"|'([^']*)')/gu, tl = /^[^\s/>]+/u, Se = (e) => {
2569
+ ]), hl = /&(#x[0-9A-Fa-f]+|#[0-9]+|[A-Za-z_][A-Za-z0-9._-]*);/gu, pl = /([^\s=/>]+)\s*=\s*(?:"([^"]*)"|'([^']*)')/gu, gl = /^[^\s/>]+/u, Se = (e) => {
2544
2570
  throw new ne("not-workbook", `the XML ${e}`);
2545
- }, Cn = (e) => Number.isInteger(e) && e >= 0 && e <= 1114111 ? String.fromCodePoint(e) : Se(`refers to the code point ${e}`), Fr = (e) => e.includes("&") ? e.replace(Qi, (t, n) => n.startsWith("#x") ? Cn(Number.parseInt(n.slice(2), 16)) : n.startsWith("#") ? Cn(Number.parseInt(n.slice(1), 10)) : Ji.get(n) ?? Se(`names the undeclared entity ${t}`)) : e, Nt = (e) => e.slice(e.indexOf(":") + 1), nl = (e, t) => {
2571
+ }, An = (e) => Number.isInteger(e) && e >= 0 && e <= 1114111 ? String.fromCodePoint(e) : Se(`refers to the code point ${e}`), Vr = (e) => e.includes("&") ? e.replace(hl, (t, n) => n.startsWith("#x") ? An(Number.parseInt(n.slice(2), 16)) : n.startsWith("#") ? An(Number.parseInt(n.slice(1), 10)) : ml.get(n) ?? Se(`names the undeclared entity ${t}`)) : e, Pt = (e) => e.slice(e.indexOf(":") + 1), wl = (e, t) => {
2546
2572
  let n = "";
2547
2573
  for (let r = t; r < e.length; r += 1) {
2548
2574
  const o = e[r];
@@ -2554,18 +2580,18 @@ const Ji = /* @__PURE__ */ new Map([
2554
2580
  return r;
2555
2581
  }
2556
2582
  return -1;
2557
- }, rl = (e) => {
2583
+ }, vl = (e) => {
2558
2584
  const t = /* @__PURE__ */ new Map();
2559
- for (const n of e.matchAll(el)) t.set(Nt(n[1] ?? ""), Fr(n[2] ?? n[3] ?? ""));
2585
+ for (const n of e.matchAll(pl)) t.set(Pt(n[1] ?? ""), Vr(n[2] ?? n[3] ?? ""));
2560
2586
  return t;
2561
- }, qr = (e, t) => {
2587
+ }, Zr = (e, t) => {
2562
2588
  let n = "";
2563
2589
  const r = () => {
2564
2590
  let o = 0;
2565
2591
  for (; !t(); ) {
2566
2592
  const s = n.indexOf("<", o);
2567
2593
  if (s === -1) break;
2568
- if (s > o && (e.text?.(Fr(n.slice(o, s))), o = s), n.startsWith("<!--", s)) {
2594
+ if (s > o && (e.text?.(Vr(n.slice(o, s))), o = s), n.startsWith("<!--", s)) {
2569
2595
  const u = n.indexOf("-->", s + 4);
2570
2596
  if (u === -1) break;
2571
2597
  o = u + 3;
@@ -2585,14 +2611,14 @@ const Ji = /* @__PURE__ */ new Map([
2585
2611
  o = u + 2;
2586
2612
  continue;
2587
2613
  }
2588
- const i = nl(n, s + 1);
2614
+ const i = wl(n, s + 1);
2589
2615
  if (i === -1) break;
2590
2616
  const f = n.slice(s + 1, i);
2591
2617
  if (f.startsWith("/"))
2592
- e.end?.(Nt(f.slice(1).trim()));
2618
+ e.end?.(Pt(f.slice(1).trim()));
2593
2619
  else {
2594
- const u = f.endsWith("/"), l = u ? f.slice(0, -1) : f, d = tl.exec(l)?.[0] ?? Se("has a tag without a name"), h = Nt(d);
2595
- e.start?.(h, rl(l.slice(d.length)), u), u && e.end?.(h);
2620
+ const u = f.endsWith("/"), l = u ? f.slice(0, -1) : f, d = gl.exec(l)?.[0] ?? Se("has a tag without a name"), h = Pt(d);
2621
+ e.start?.(h, vl(l.slice(d.length)), u), u && e.end?.(h);
2596
2622
  }
2597
2623
  o = i + 1;
2598
2624
  }
@@ -2607,7 +2633,7 @@ const Ji = /* @__PURE__ */ new Map([
2607
2633
  }
2608
2634
  };
2609
2635
  }, He = async (e, t, n) => {
2610
- const r = qr(t, n), o = new TextDecoder("utf-8", { fatal: !0 }), s = e.getReader();
2636
+ const r = Zr(t, n), o = new TextDecoder("utf-8", { fatal: !0 }), s = e.getReader();
2611
2637
  try {
2612
2638
  for (; !n(); ) {
2613
2639
  const { done: a, value: i } = await s.read();
@@ -2624,44 +2650,44 @@ const Ji = /* @__PURE__ */ new Map([
2624
2650
  s.cancel().catch(() => {
2625
2651
  });
2626
2652
  }
2627
- }, ol = 101010256, sl = 33639248, al = 67324752, Br = 22, il = 65535, Mn = 46, Ln = 30, ll = 1, An = 0, cl = 8, dl = 65535, Me = 4294967295, ul = new TextDecoder("utf-8"), ae = (e) => {
2653
+ }, bl = 101010256, yl = 33639248, kl = 67324752, Wr = 22, El = 65535, Nn = 46, Dn = 30, Sl = 1, Pn = 0, xl = 8, Tl = 65535, Le = 4294967295, Rl = new TextDecoder("utf-8"), ae = (e) => {
2628
2654
  throw new ne("not-workbook", `the ZIP package ${e}`);
2629
- }, fl = (e) => {
2630
- const t = e.byteLength - Br, n = Math.max(0, t - il);
2655
+ }, Cl = (e) => {
2656
+ const t = e.byteLength - Wr, n = Math.max(0, t - El);
2631
2657
  for (let r = t; r >= n; r -= 1)
2632
- if (e.getUint32(r, !0) === ol) return r;
2658
+ if (e.getUint32(r, !0) === bl) return r;
2633
2659
  return ae("has no end of central directory record");
2634
- }, ml = (e) => {
2635
- if (e.byteLength < Br) return ae("is shorter than its end record");
2636
- const t = new DataView(e.buffer, e.byteOffset, e.byteLength), n = fl(t), r = t.getUint16(n + 4, !0), o = t.getUint16(n + 6, !0), s = t.getUint16(n + 10, !0), a = t.getUint32(n + 12, !0), i = t.getUint32(n + 16, !0);
2660
+ }, Ol = (e) => {
2661
+ if (e.byteLength < Wr) return ae("is shorter than its end record");
2662
+ const t = new DataView(e.buffer, e.byteOffset, e.byteLength), n = Cl(t), r = t.getUint16(n + 4, !0), o = t.getUint16(n + 6, !0), s = t.getUint16(n + 10, !0), a = t.getUint32(n + 12, !0), i = t.getUint32(n + 16, !0);
2637
2663
  if (r !== 0 || o !== 0) return ae("spans several disks");
2638
- if (s === dl || a === Me || i === Me) return ae("is a ZIP64 package");
2664
+ if (s === Tl || a === Le || i === Le) return ae("is a ZIP64 package");
2639
2665
  if (i + a > n) return ae("has a central directory past its end record");
2640
2666
  const f = /* @__PURE__ */ new Map();
2641
2667
  let u = i;
2642
2668
  for (let l = 0; l < s; l += 1) {
2643
- if (u + Mn > n || t.getUint32(u, !0) !== sl) return ae("has a malformed central directory");
2644
- const d = t.getUint16(u + 8, !0), h = t.getUint16(u + 10, !0), g = t.getUint32(u + 20, !0), v = t.getUint32(u + 24, !0), y = t.getUint16(u + 28, !0), T = t.getUint16(u + 30, !0), C = t.getUint16(u + 32, !0), R = t.getUint32(u + 42, !0), q = u + Mn;
2669
+ if (u + Nn > n || t.getUint32(u, !0) !== yl) return ae("has a malformed central directory");
2670
+ const d = t.getUint16(u + 8, !0), h = t.getUint16(u + 10, !0), g = t.getUint32(u + 20, !0), v = t.getUint32(u + 24, !0), y = t.getUint16(u + 28, !0), T = t.getUint16(u + 30, !0), O = t.getUint16(u + 32, !0), R = t.getUint32(u + 42, !0), q = u + Nn;
2645
2671
  if (q + y > n) return ae("has a name past its central directory");
2646
- const D = ul.decode(e.subarray(q, q + y));
2647
- if (g === Me || v === Me || R === Me) return ae("has a ZIP64 entry");
2672
+ const D = Rl.decode(e.subarray(q, q + y));
2673
+ if (g === Le || v === Le || R === Le) return ae("has a ZIP64 entry");
2648
2674
  if (!D.endsWith("/")) {
2649
2675
  if (f.has(D)) return ae(`names ${D} twice`);
2650
- f.set(D, { name: D, encrypted: (d & ll) !== 0, method: h, compressedSize: g, uncompressedSize: v, localHeaderOffset: R });
2676
+ f.set(D, { name: D, encrypted: (d & Sl) !== 0, method: h, compressedSize: g, uncompressedSize: v, localHeaderOffset: R });
2651
2677
  }
2652
- u = q + y + T + C;
2678
+ u = q + y + T + O;
2653
2679
  }
2654
2680
  return { bytes: e, entries: f };
2655
- }, hl = (e, t) => {
2681
+ }, Ll = (e, t) => {
2656
2682
  const { bytes: n } = e, r = new DataView(n.buffer, n.byteOffset, n.byteLength), o = t.localHeaderOffset;
2657
- if (o + Ln > n.byteLength || r.getUint32(o, !0) !== al) return ae(`has no local header for ${t.name}`);
2658
- const s = o + Ln + r.getUint16(o + 26, !0) + r.getUint16(o + 28, !0), a = s + t.compressedSize;
2683
+ if (o + Dn > n.byteLength || r.getUint32(o, !0) !== kl) return ae(`has no local header for ${t.name}`);
2684
+ const s = o + Dn + r.getUint16(o + 26, !0) + r.getUint16(o + 28, !0), a = s + t.compressedSize;
2659
2685
  return a > n.byteLength ? ae(`has the data of ${t.name} past its end`) : { start: s, end: a };
2660
- }, Ur = (e) => new ReadableStream({
2686
+ }, Gr = (e) => new ReadableStream({
2661
2687
  start(t) {
2662
2688
  e.byteLength > 0 && t.enqueue(e), t.close();
2663
2689
  }
2664
- }), pl = (e) => Ur(e).pipeThrough(new DecompressionStream("deflate-raw")), gl = (e, t) => {
2690
+ }), Ml = (e) => Gr(e).pipeThrough(new DecompressionStream("deflate-raw")), Al = (e, t) => {
2665
2691
  let n = 0;
2666
2692
  return new TransformStream({
2667
2693
  transform(r, o) {
@@ -2676,10 +2702,10 @@ const Ji = /* @__PURE__ */ new Map([
2676
2702
  const r = e.entries.get(t);
2677
2703
  if (r === void 0) return null;
2678
2704
  if (r.encrypted) throw new ne("encrypted", `${t} is encrypted`);
2679
- if (r.method !== An && r.method !== cl) return ae(`compresses ${t} with method ${r.method}`);
2705
+ if (r.method !== Pn && r.method !== xl) return ae(`compresses ${t} with method ${r.method}`);
2680
2706
  if (r.uncompressedSize > n) throw new ne("too-large", `${t} declares ${r.uncompressedSize} bytes`);
2681
- const { start: o, end: s } = hl(e, r), a = e.bytes.subarray(o, s);
2682
- return (r.method === An ? Ur(a) : pl(a)).pipeThrough(gl(t, n));
2707
+ const { start: o, end: s } = Ll(e, r), a = e.bytes.subarray(o, s);
2708
+ return (r.method === Pn ? Gr(a) : Ml(a)).pipeThrough(Al(t, n));
2683
2709
  }, tt = async (e, t, n) => {
2684
2710
  const r = Fe(e, t, n);
2685
2711
  if (r === null) return null;
@@ -2698,10 +2724,10 @@ const Ji = /* @__PURE__ */ new Map([
2698
2724
  } finally {
2699
2725
  s.releaseLock();
2700
2726
  }
2701
- }, Nn = "content.xml", wl = "META-INF/manifest.xml", Hr = (e) => {
2727
+ }, In = "content.xml", Nl = "META-INF/manifest.xml", Kr = (e) => {
2702
2728
  throw new ne("not-workbook", `the spreadsheet ${e}`);
2703
- }, Dn = (e, t) => Fe(e, Nn, t.maxPartBytes) ?? Hr(`has no ${Nn}`), vl = async (e, t) => {
2704
- const n = Fe(e, wl, t.maxPartBytes);
2729
+ }, $n = (e, t) => Fe(e, In, t.maxPartBytes) ?? Kr(`has no ${In}`), Dl = async (e, t) => {
2730
+ const n = Fe(e, Nl, t.maxPartBytes);
2705
2731
  if (n === null) return !1;
2706
2732
  let r = !1;
2707
2733
  return await He(
@@ -2713,7 +2739,7 @@ const Ji = /* @__PURE__ */ new Map([
2713
2739
  },
2714
2740
  () => r
2715
2741
  ), r;
2716
- }, bl = async (e) => {
2742
+ }, Pl = async (e) => {
2717
2743
  const t = [], n = /* @__PURE__ */ new Set();
2718
2744
  let r = null, o = 0;
2719
2745
  return await He(
@@ -2728,11 +2754,11 @@ const Ji = /* @__PURE__ */ new Map([
2728
2754
  },
2729
2755
  () => !1
2730
2756
  ), { tables: t, hidingStyles: n };
2731
- }, vt = (e) => {
2757
+ }, bt = (e) => {
2732
2758
  const t = Number(e);
2733
2759
  return Number.isInteger(t) && t > 0 ? t : 1;
2734
- }, yl = async (e, t, n) => {
2735
- const r = Nr(n);
2760
+ }, Il = async (e, t, n) => {
2761
+ const r = qr(n);
2736
2762
  let o = 0, s = 0, a = !1, i = !1, f = 0, u = 1, l = /* @__PURE__ */ new Map(), d = 0, h = null;
2737
2763
  return await He(
2738
2764
  e,
@@ -2742,8 +2768,8 @@ const Ji = /* @__PURE__ */ new Map([
2742
2768
  s === 0 && (a = o === t, o += 1), y || (s += 1);
2743
2769
  return;
2744
2770
  }
2745
- !a || s !== 1 || (g === "table-row" ? (u = vt(v.get("number-rows-repeated")), l = /* @__PURE__ */ new Map(), d = 0) : g === "table-cell" || g === "covered-table-cell" ? h = { repeat: vt(v.get("number-columns-repeated")), covered: g === "covered-table-cell", parts: [], paragraphs: 0, paragraphDepth: 0, annotationDepth: 0 } : h !== null && h.annotationDepth === 0 && (g === "annotation" && !y ? h.annotationDepth += 1 : g === "p" || g === "h" ? (h.paragraphs > 0 && h.parts.push(`
2746
- `), h.paragraphs += 1, y || (h.paragraphDepth += 1)) : h.paragraphDepth > 0 && (g === "s" ? h.parts.push(" ".repeat(vt(v.get("c")))) : g === "tab" ? h.parts.push(" ") : g === "line-break" && h.parts.push(`
2771
+ !a || s !== 1 || (g === "table-row" ? (u = bt(v.get("number-rows-repeated")), l = /* @__PURE__ */ new Map(), d = 0) : g === "table-cell" || g === "covered-table-cell" ? h = { repeat: bt(v.get("number-columns-repeated")), covered: g === "covered-table-cell", parts: [], paragraphs: 0, paragraphDepth: 0, annotationDepth: 0 } : h !== null && h.annotationDepth === 0 && (g === "annotation" && !y ? h.annotationDepth += 1 : g === "p" || g === "h" ? (h.paragraphs > 0 && h.parts.push(`
2772
+ `), h.paragraphs += 1, y || (h.paragraphDepth += 1)) : h.paragraphDepth > 0 && (g === "s" ? h.parts.push(" ".repeat(bt(v.get("c")))) : g === "tab" ? h.parts.push(" ") : g === "line-break" && h.parts.push(`
2747
2773
  `))));
2748
2774
  },
2749
2775
  end: (g) => {
@@ -2771,18 +2797,18 @@ const Ji = /* @__PURE__ */ new Map([
2771
2797
  },
2772
2798
  () => i || r.full()
2773
2799
  ), r.table();
2774
- }, kl = async (e, t) => {
2775
- if (await vl(e, t)) throw new ne("encrypted", "the spreadsheet's manifest names encryption data");
2776
- const { tables: n, hidingStyles: r } = await bl(Dn(e, t)), o = [];
2800
+ }, $l = async (e, t) => {
2801
+ if (await Dl(e, t)) throw new ne("encrypted", "the spreadsheet's manifest names encryption data");
2802
+ const { tables: n, hidingStyles: r } = await Pl($n(e, t)), o = [];
2777
2803
  let s = 0;
2778
2804
  return n.forEach((a, i) => {
2779
2805
  if (r.has(a.style)) {
2780
2806
  s += 1;
2781
2807
  return;
2782
2808
  }
2783
- o.push({ name: a.name, read: async (f) => yl(Dn(e, t), i, f) });
2784
- }), o.length === 0 && Hr("shows no table"), { sheets: o.slice(0, t.maxSheets), unshownSheets: s, unlistedSheets: Math.max(0, o.length - t.maxSheets) };
2785
- }, Ee = Object.freeze({ kind: "general" }), El = new Map([
2809
+ o.push({ name: a.name, read: async (f) => Il($n(e, t), i, f) });
2810
+ }), o.length === 0 && Kr("shows no table"), { sheets: o.slice(0, t.maxSheets), unshownSheets: s, unlistedSheets: Math.max(0, o.length - t.maxSheets) };
2811
+ }, Ee = Object.freeze({ kind: "general" }), _l = new Map([
2786
2812
  [0, "General"],
2787
2813
  [1, "0"],
2788
2814
  [2, "0.00"],
@@ -2814,7 +2840,7 @@ const Ji = /* @__PURE__ */ new Map([
2814
2840
  [47, "mmss.0"],
2815
2841
  [48, "##0.0E+0"],
2816
2842
  [49, "@"]
2817
- ]), Sl = /^\[(h+|m+|s+)\]$/iu, xl = (e) => {
2843
+ ]), Fl = /^\[(h+|m+|s+)\]$/iu, ql = (e) => {
2818
2844
  let t = "", n = !1;
2819
2845
  for (let r = 0; r < e.length; r += 1) {
2820
2846
  const o = e[r];
@@ -2826,13 +2852,13 @@ const Ji = /* @__PURE__ */ new Map([
2826
2852
  r += 1;
2827
2853
  else if (o === "[") {
2828
2854
  const s = e.indexOf("]", r + 1), a = e.slice(r, s === -1 ? e.length : s + 1);
2829
- Sl.test(a) && (t += a.slice(1, -1), n = !0), r = s === -1 ? e.length : s;
2855
+ Fl.test(a) && (t += a.slice(1, -1), n = !0), r = s === -1 ? e.length : s;
2830
2856
  } else
2831
2857
  t += o;
2832
2858
  }
2833
2859
  return { text: t.toLowerCase(), elapsed: n };
2834
- }, Tl = (e) => {
2835
- const { text: t, elapsed: n } = xl(e);
2860
+ }, Bl = (e) => {
2861
+ const { text: t, elapsed: n } = ql(e);
2836
2862
  if (t === "" || t === "general" || t.includes("@") || /[0#?.]e[+-]/u.test(t)) return Ee;
2837
2863
  const r = n || /[hs]/u.test(t) || t.includes("am/pm") || t.includes("a/p"), o = /[ydge]/u.test(t.replace(/am\/pm|a\/p/gu, "")) || t.includes("m") && !r;
2838
2864
  if (o || r) return { kind: "date-time", date: o, time: r, seconds: t.includes("s"), elapsed: n };
@@ -2841,77 +2867,77 @@ const Ji = /* @__PURE__ */ new Map([
2841
2867
  if (s === void 0) return Ee;
2842
2868
  const a = /,*$/u.exec(s)?.[0].length ?? 0, [i = "", f = ""] = s.slice(0, s.length - a).split("."), u = (f.match(/[0#?]/gu) ?? []).length;
2843
2869
  return t.includes("%") ? { kind: "percent", decimals: u } : { kind: "fixed", decimals: u, grouping: i.includes(","), scale: 1e3 ** a };
2844
- }, Rl = (e, t) => {
2845
- const n = t.get(e) ?? El.get(e);
2846
- return n === void 0 ? Ee : Tl(n);
2847
- }, zt = (e) => {
2870
+ }, Ul = (e, t) => {
2871
+ const n = t.get(e) ?? _l.get(e);
2872
+ return n === void 0 ? Ee : Bl(n);
2873
+ }, Zt = (e) => {
2848
2874
  if (Number.isInteger(e) && Math.abs(e) < 1e15) return String(e);
2849
2875
  const [t = "", n] = e.toPrecision(15).split("e"), r = t.includes(".") ? t.replace(/0+$/u, "").replace(/\.$/u, "") : t;
2850
2876
  return n === void 0 ? r : `${r}E${n.startsWith("-") ? n : `+${n.replace("+", "")}`}`;
2851
- }, Pn = (e, t, n) => {
2877
+ }, _n = (e, t, n) => {
2852
2878
  const r = Math.abs(e).toFixed(t);
2853
- if (r.includes("e")) return zt(e);
2879
+ if (r.includes("e")) return Zt(e);
2854
2880
  const [o = "", s] = r.split("."), a = n ? o.replace(/\B(?=(\d{3})+(?!\d))/gu, ",") : o;
2855
2881
  return `${e < 0 && /[1-9]/u.test(r) ? "-" : ""}${a}${s === void 0 ? "" : `.${s}`}`;
2856
- }, Ol = 864e5, In = 86400, Cl = 2958465, xe = (e, t) => String(e).padStart(t, "0"), Ml = (e, t) => {
2882
+ }, Hl = 864e5, Fn = 86400, zl = 2958465, xe = (e, t) => String(e).padStart(t, "0"), jl = (e, t) => {
2857
2883
  if (!t && e === 0) return "1900-01-00";
2858
2884
  if (!t && e === 60) return "1900-02-29";
2859
- const n = t ? Date.UTC(1904, 0, 1) : e < 60 ? Date.UTC(1899, 11, 31) : Date.UTC(1899, 11, 30), r = new Date(n + e * Ol);
2885
+ const n = t ? Date.UTC(1904, 0, 1) : e < 60 ? Date.UTC(1899, 11, 31) : Date.UTC(1899, 11, 30), r = new Date(n + e * Hl);
2860
2886
  return `${xe(r.getUTCFullYear(), 4)}-${xe(r.getUTCMonth() + 1, 2)}-${xe(r.getUTCDate(), 2)}`;
2861
- }, Ll = (e, t, n) => {
2862
- if (e < 0 || e >= Cl + 1) return zt(e);
2863
- let r = Math.floor(e), o = Math.round((e - r) * In);
2864
- o === In && (r += 1, o = 0);
2887
+ }, Vl = (e, t, n) => {
2888
+ if (e < 0 || e >= zl + 1) return Zt(e);
2889
+ let r = Math.floor(e), o = Math.round((e - r) * Fn);
2890
+ o === Fn && (r += 1, o = 0);
2865
2891
  const s = Math.floor(o / 3600), a = Math.floor(o % 3600 / 60), i = `${xe(t.elapsed ? r * 24 + s : s, 2)}:${xe(a, 2)}${t.seconds ? `:${xe(o % 60, 2)}` : ""}`;
2866
2892
  if (t.elapsed || !t.date) return i;
2867
- const f = Ml(r, n);
2893
+ const f = jl(r, n);
2868
2894
  return t.time ? `${f} ${i}` : f;
2869
- }, Al = (e, t, n) => {
2895
+ }, Zl = (e, t, n) => {
2870
2896
  switch (t.kind) {
2871
2897
  case "general":
2872
- return zt(e);
2898
+ return Zt(e);
2873
2899
  case "date-time":
2874
- return Ll(e, t, n);
2900
+ return Vl(e, t, n);
2875
2901
  case "percent":
2876
- return `${Pn(e * 100, t.decimals, !1)}%`;
2902
+ return `${_n(e * 100, t.decimals, !1)}%`;
2877
2903
  case "fixed":
2878
- return Pn(e / t.scale, t.decimals, t.grouping);
2904
+ return _n(e / t.scale, t.decimals, t.grouping);
2879
2905
  }
2880
- }, zr = "_rels/.rels", ce = (e) => {
2906
+ }, Yr = "_rels/.rels", ce = (e) => {
2881
2907
  throw new ne("not-workbook", `the workbook ${e}`);
2882
- }, jt = (e, t) => {
2883
- const n = qr(t, () => !1);
2908
+ }, Wt = (e, t) => {
2909
+ const n = Zr(t, () => !1);
2884
2910
  n.write(e), n.finish();
2885
- }, Nl = (e, t) => {
2911
+ }, Wl = (e, t) => {
2886
2912
  try {
2887
2913
  return decodeURIComponent(e);
2888
2914
  } catch {
2889
2915
  return ce(`points to a malformed part name (${t})`);
2890
2916
  }
2891
- }, Dl = (e, t) => {
2917
+ }, Gl = (e, t) => {
2892
2918
  const r = [...t.startsWith("/") ? [] : e.split("/").slice(0, -1)];
2893
2919
  for (const o of t.split("/"))
2894
- o === "" || o === "." || (o === ".." ? (r.length === 0 && ce(`points above its root (${t})`), r.pop()) : r.push(Nl(o, t)));
2920
+ o === "" || o === "." || (o === ".." ? (r.length === 0 && ce(`points above its root (${t})`), r.pop()) : r.push(Wl(o, t)));
2895
2921
  return r.join("/");
2896
- }, Pl = (e) => {
2922
+ }, Kl = (e) => {
2897
2923
  const t = e.lastIndexOf("/");
2898
2924
  return `${e.slice(0, t + 1)}_rels/${e.slice(t + 1)}.rels`;
2899
- }, $n = async (e, t, n) => {
2900
- const r = await tt(e, t === "" ? zr : Pl(t), n.maxPartBytes), o = /* @__PURE__ */ new Map();
2901
- return r === null || jt(r, {
2925
+ }, qn = async (e, t, n) => {
2926
+ const r = await tt(e, t === "" ? Yr : Kl(t), n.maxPartBytes), o = /* @__PURE__ */ new Map();
2927
+ return r === null || Wt(r, {
2902
2928
  start: (s, a) => {
2903
2929
  if (s !== "Relationship") return;
2904
2930
  const i = a.get("Id"), f = a.get("Type"), u = a.get("Target");
2905
- i === void 0 || f === void 0 || u === void 0 || a.get("TargetMode") === "External" || o.set(i, { type: f, target: Dl(t, u) });
2931
+ i === void 0 || f === void 0 || u === void 0 || a.get("TargetMode") === "External" || o.set(i, { type: f, target: Gl(t, u) });
2906
2932
  }
2907
2933
  }), o;
2908
- }, bt = (e, t) => {
2934
+ }, yt = (e, t) => {
2909
2935
  for (const n of e.values()) if (n.type.endsWith(`/${t}`)) return n.target;
2910
2936
  return null;
2911
- }, Il = (e) => {
2937
+ }, Yl = (e) => {
2912
2938
  const t = [];
2913
2939
  let n = !1;
2914
- return jt(e, {
2940
+ return Wt(e, {
2915
2941
  start: (r, o) => {
2916
2942
  if (r === "workbookPr") {
2917
2943
  const s = o.get("date1904");
@@ -2919,7 +2945,7 @@ const Ji = /* @__PURE__ */ new Map([
2919
2945
  } else r === "sheet" && t.push({ name: o.get("name") ?? "", state: o.get("state") ?? "visible", relationship: o.get("id") ?? "" });
2920
2946
  }
2921
2947
  }), { sheets: t, date1904: n };
2922
- }, $l = async (e) => {
2948
+ }, Xl = async (e) => {
2923
2949
  const t = [];
2924
2950
  let n = null, r = !1, o = 0;
2925
2951
  return await He(
@@ -2937,10 +2963,10 @@ const Ji = /* @__PURE__ */ new Map([
2937
2963
  },
2938
2964
  () => !1
2939
2965
  ), t;
2940
- }, _l = (e) => {
2966
+ }, Jl = (e) => {
2941
2967
  const t = /* @__PURE__ */ new Map(), n = [];
2942
2968
  let r = !1;
2943
- return jt(e, {
2969
+ return Wt(e, {
2944
2970
  start: (o, s) => {
2945
2971
  if (o === "numFmt") {
2946
2972
  const a = Number(s.get("numFmtId")), i = s.get("formatCode");
@@ -2955,19 +2981,19 @@ const Ji = /* @__PURE__ */ new Map([
2955
2981
  end: (o) => {
2956
2982
  o === "cellXfs" && (r = !1);
2957
2983
  }
2958
- }), n.map((o) => Rl(o, t));
2959
- }, Fl = /^(\d{4}-\d{2}-\d{2})(?:T(\d{2}:\d{2}(?::\d{2})?)(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})?)?$/u, ql = (e) => {
2960
- const t = Fl.exec(e);
2984
+ }), n.map((o) => Ul(o, t));
2985
+ }, Ql = /^(\d{4}-\d{2}-\d{2})(?:T(\d{2}:\d{2}(?::\d{2})?)(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})?)?$/u, ec = (e) => {
2986
+ const t = Ql.exec(e);
2961
2987
  if (t === null) return e;
2962
2988
  const [, n, r] = t;
2963
2989
  return r === void 0 || /^00:00(?::00)?$/u.test(r) ? n ?? e : `${n} ${r}`;
2964
- }, Bl = /^([A-Za-z]{1,3})(\d+)$/u, Ul = (e) => {
2965
- const t = Bl.exec(e)?.[1];
2990
+ }, tc = /^([A-Za-z]{1,3})(\d+)$/u, nc = (e) => {
2991
+ const t = tc.exec(e)?.[1];
2966
2992
  if (t === void 0) return null;
2967
2993
  let n = 0;
2968
2994
  for (const r of t.toUpperCase()) n = n * 26 + (r.charCodeAt(0) - 64);
2969
2995
  return n - 1;
2970
- }, Hl = (e, t, n, r) => {
2996
+ }, rc = (e, t, n, r) => {
2971
2997
  const o = e.value.join("");
2972
2998
  switch (e.type) {
2973
2999
  case "s":
@@ -2980,16 +3006,16 @@ const Ji = /* @__PURE__ */ new Map([
2980
3006
  case "e":
2981
3007
  return o;
2982
3008
  case "d":
2983
- return ql(o.trim());
3009
+ return ec(o.trim());
2984
3010
  default: {
2985
3011
  const s = o.trim();
2986
3012
  if (s === "") return "";
2987
3013
  const a = Number(s);
2988
- return Number.isFinite(a) ? Al(a, n[e.style] ?? Ee, r) : s;
3014
+ return Number.isFinite(a) ? Zl(a, n[e.style] ?? Ee, r) : s;
2989
3015
  }
2990
3016
  }
2991
- }, zl = async (e, t, n, r, o) => {
2992
- const s = Nr(t);
3017
+ }, oc = async (e, t, n, r, o) => {
3018
+ const s = qr(t);
2993
3019
  let a = -1, i = /* @__PURE__ */ new Map(), f = 0, u = null;
2994
3020
  return await He(
2995
3021
  e,
@@ -2999,13 +3025,13 @@ const Ji = /* @__PURE__ */ new Map([
2999
3025
  const g = Number(d.get("r"));
3000
3026
  a = Number.isInteger(g) && g > a + 1 ? g - 1 : a + 1, i = /* @__PURE__ */ new Map(), f = 0;
3001
3027
  } else if (l === "c") {
3002
- const g = Ul(d.get("r") ?? "") ?? f, v = Number(d.get("s") ?? "0");
3028
+ const g = nc(d.get("r") ?? "") ?? f, v = Number(d.get("s") ?? "0");
3003
3029
  u = { column: g, type: d.get("t") ?? "n", style: Number.isInteger(v) ? v : 0, value: [], inline: [], inValue: !1, inInlineText: !1, phoneticDepth: 0 };
3004
3030
  } else u !== null && (l === "v" ? u.inValue = !h : l === "rPh" && !h ? u.phoneticDepth += 1 : l === "t" && u.type === "inlineStr" && u.phoneticDepth === 0 && (u.inInlineText = !h));
3005
3031
  },
3006
3032
  end: (l) => {
3007
3033
  if (l === "c" && u !== null) {
3008
- const d = Hl(u, n, r, o);
3034
+ const d = rc(u, n, r, o);
3009
3035
  d !== "" && i.set(u.column, d), f = u.column + 1, u = null;
3010
3036
  } else l === "row" ? s.addRow(a, i, 1) : u !== null && (l === "v" ? u.inValue = !1 : l === "rPh" ? u.phoneticDepth = Math.max(0, u.phoneticDepth - 1) : l === "t" && (u.inInlineText = !1));
3011
3037
  },
@@ -3015,8 +3041,8 @@ const Ji = /* @__PURE__ */ new Map([
3015
3041
  },
3016
3042
  s.full
3017
3043
  ), s.table();
3018
- }, jl = async (e, t) => {
3019
- const n = bt(await $n(e, "", t), "officeDocument") ?? ce("has no officeDocument relationship"), r = await tt(e, n, t.maxPartBytes) ?? ce(`has no part ${n}`), { sheets: o, date1904: s } = Il(r), a = await $n(e, n, t), i = bt(a, "sharedStrings"), f = i === null ? null : Fe(e, i, t.maxPartBytes), u = f === null ? [] : await $l(f), l = bt(a, "styles"), d = l === null ? null : await tt(e, l, t.maxPartBytes), h = d === null ? [] : _l(d), g = [];
3044
+ }, sc = async (e, t) => {
3045
+ const n = yt(await qn(e, "", t), "officeDocument") ?? ce("has no officeDocument relationship"), r = await tt(e, n, t.maxPartBytes) ?? ce(`has no part ${n}`), { sheets: o, date1904: s } = Yl(r), a = await qn(e, n, t), i = yt(a, "sharedStrings"), f = i === null ? null : Fe(e, i, t.maxPartBytes), u = f === null ? [] : await Xl(f), l = yt(a, "styles"), d = l === null ? null : await tt(e, l, t.maxPartBytes), h = d === null ? [] : Jl(d), g = [];
3020
3046
  let v = 0;
3021
3047
  for (const y of o) {
3022
3048
  const T = a.get(y.relationship) ?? ce(`lists the sheet ${y.name} without its relationship`);
@@ -3026,27 +3052,27 @@ const Ji = /* @__PURE__ */ new Map([
3026
3052
  }
3027
3053
  e.entries.has(T.target) || ce(`has no part ${T.target} for the sheet ${y.name}`), g.push({
3028
3054
  name: y.name,
3029
- read: async (C) => {
3055
+ read: async (O) => {
3030
3056
  const R = Fe(e, T.target, t.maxPartBytes) ?? ce(`has no part ${T.target}`);
3031
- return zl(R, C, u, h, s);
3057
+ return oc(R, O, u, h, s);
3032
3058
  }
3033
3059
  });
3034
3060
  }
3035
3061
  return g.length === 0 && ce("shows no sheet"), { sheets: g.slice(0, t.maxSheets), unshownSheets: v, unlistedSheets: Math.max(0, g.length - t.maxSheets) };
3036
- }, Vl = Object.freeze([80, 75, 3, 4]), Zl = Object.freeze([208, 207, 17, 224, 161, 177, 26, 225]), yt = Uint8Array.from([..."EncryptedPackage"].flatMap((e) => [e.charCodeAt(0), 0])), Wl = /* @__PURE__ */ new Set(["application/vnd.oasis.opendocument.spreadsheet", "application/vnd.oasis.opendocument.spreadsheet-template"]), Gl = "mimetype", jr = (e, t) => e.byteLength >= t.length && t.every((n, r) => e[r] === n), Vr = (e) => jr(e, Vl), Zr = (e) => jr(e, Zl), Kl = (e) => {
3037
- const t = e.byteLength - yt.byteLength;
3062
+ }, ac = Object.freeze([80, 75, 3, 4]), ic = Object.freeze([208, 207, 17, 224, 161, 177, 26, 225]), kt = Uint8Array.from([..."EncryptedPackage"].flatMap((e) => [e.charCodeAt(0), 0])), lc = /* @__PURE__ */ new Set(["application/vnd.oasis.opendocument.spreadsheet", "application/vnd.oasis.opendocument.spreadsheet-template"]), cc = "mimetype", Xr = (e, t) => e.byteLength >= t.length && t.every((n, r) => e[r] === n), Jr = (e) => Xr(e, ac), Qr = (e) => Xr(e, ic), dc = (e) => {
3063
+ const t = e.byteLength - kt.byteLength;
3038
3064
  for (let n = 0; n <= t; n += 1)
3039
- if (e[n] === yt[0] && yt.every((r, o) => e[n + o] === r)) return !0;
3065
+ if (e[n] === kt[0] && kt.every((r, o) => e[n + o] === r)) return !0;
3040
3066
  return !1;
3041
- }, Yl = async (e, t) => {
3042
- if (Zr(e))
3043
- throw Kl(e) ? new ne("encrypted", "the bytes are a password-protected workbook") : new ne("not-workbook", "the bytes are a compound file (a legacy .xls)");
3044
- if (!Vr(e)) throw new ne("not-workbook", "the bytes are no ZIP package");
3045
- const n = ml(e), r = await tt(n, Gl, t.maxPartBytes);
3046
- if (r !== null && Wl.has(r.trim())) return kl(n, t);
3047
- if (n.entries.has(zr)) return jl(n, t);
3067
+ }, uc = async (e, t) => {
3068
+ if (Qr(e))
3069
+ throw dc(e) ? new ne("encrypted", "the bytes are a password-protected workbook") : new ne("not-workbook", "the bytes are a compound file (a legacy .xls)");
3070
+ if (!Jr(e)) throw new ne("not-workbook", "the bytes are no ZIP package");
3071
+ const n = Ol(e), r = await tt(n, cc, t.maxPartBytes);
3072
+ if (r !== null && lc.has(r.trim())) return $l(n, t);
3073
+ if (n.entries.has(Yr)) return sc(n, t);
3048
3074
  throw new ne("not-workbook", "the ZIP package is neither an OpenDocument spreadsheet nor an Office Open XML package");
3049
- }, Xl = async (e, t) => {
3075
+ }, fc = async (e, t) => {
3050
3076
  const n = e.getReader(), r = [];
3051
3077
  let o = 0;
3052
3078
  try {
@@ -3065,34 +3091,34 @@ const Ji = /* @__PURE__ */ new Map([
3065
3091
  for (const i of r)
3066
3092
  s.set(i, a), a += i.byteLength;
3067
3093
  return s;
3068
- }, Wr = async (e, t) => {
3094
+ }, eo = async (e, t) => {
3069
3095
  try {
3070
3096
  return { kind: "table", table: await e.read(t) };
3071
3097
  } catch (n) {
3072
3098
  return { kind: "refused", refusal: n instanceof ne ? n.refusal : "not-workbook" };
3073
3099
  }
3074
- }, Jl = async (e, t, n, r, o) => {
3075
- const s = await e.asset(Ao(t), o);
3100
+ }, mc = async (e, t, n, r, o) => {
3101
+ const s = await e.asset(Bo(t), o);
3076
3102
  if (s.status === "cancelled") return null;
3077
3103
  if (s.status === "error") return { kind: "failure", failure: s.failure };
3078
3104
  let a;
3079
3105
  try {
3080
- a = await Xl(s.body, n.maxBytes);
3106
+ a = await fc(s.body, n.maxBytes);
3081
3107
  } catch {
3082
3108
  return o.aborted ? null : { kind: "failure", failure: { reason: "failed" } };
3083
3109
  }
3084
3110
  if (o.aborted) return null;
3085
3111
  if (a === null) return { kind: "refused", refusal: "too-large" };
3086
- if (!(Vr(a) || Zr(a))) return { kind: "not-package" };
3112
+ if (!(Jr(a) || Qr(a))) return { kind: "not-package" };
3087
3113
  try {
3088
- const i = await Yl(a, n.limits), f = r === null ? -1 : i.sheets.findIndex((h) => h.name === r), u = Math.max(f, 0), l = i.sheets[u];
3114
+ const i = await uc(a, n.limits), f = r === null ? -1 : i.sheets.findIndex((h) => h.name === r), u = Math.max(f, 0), l = i.sheets[u];
3089
3115
  if (l === void 0) return { kind: "refused", refusal: "not-workbook" };
3090
- const d = await Wr(l, n.budget);
3116
+ const d = await eo(l, n.budget);
3091
3117
  return o.aborted ? null : { kind: "workbook", workbook: i, selected: u, sheet: d };
3092
3118
  } catch (i) {
3093
3119
  return i instanceof ne ? { kind: "refused", refusal: i.refusal } : o.aborted ? null : { kind: "failure", failure: { reason: "failed" } };
3094
3120
  }
3095
- }, Ql = Object.freeze({ className: "aqmx-document-spreadsheet-body", "data-aqmx-document-scroller": "" }), ec = (e, t) => {
3121
+ }, hc = Object.freeze({ className: "aqmx-document-spreadsheet-body", "data-aqmx-document-scroller": "" }), pc = (e, t) => {
3096
3122
  switch (t.code) {
3097
3123
  case "encoding":
3098
3124
  return e.spreadsheetUnreadableEncoding(t.encodings);
@@ -3101,7 +3127,7 @@ const Ji = /* @__PURE__ */ new Map([
3101
3127
  case "long-row":
3102
3128
  return e.spreadsheetLongRow;
3103
3129
  }
3104
- }, _n = (e, t) => {
3130
+ }, Bn = (e, t) => {
3105
3131
  switch (t) {
3106
3132
  case "encrypted":
3107
3133
  return e.spreadsheetWorkbookEncrypted;
@@ -3110,13 +3136,13 @@ const Ji = /* @__PURE__ */ new Map([
3110
3136
  case "too-large":
3111
3137
  return e.spreadsheetWorkbookTooLarge;
3112
3138
  }
3113
- }, kt = (e) => e.every((t) => t.every((n) => n === "")), Gr = ({ name: e, url: t, openUrl: n, state: r, children: o }) => /* @__PURE__ */ B("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-spreadsheet-view", "data-aqmx-spreadsheet": r, children: [
3114
- /* @__PURE__ */ c(Ue, { name: e, openUrl: n, downloadUrl: t, icon: /* @__PURE__ */ c(Fi, {}) }),
3115
- /* @__PURE__ */ c(Be, { scrollerProps: Ql, children: /* @__PURE__ */ c("div", { className: "aqmx-document-spreadsheet-column", children: o }) })
3116
- ] }), Kr = ({ rows: e, title: t }) => {
3117
- const { labels: n, locale: r, theme: o } = $(), s = se(we), a = X(() => ({ ...Ir(n, r), table: t, fullscreenDialog: n.spreadsheetFullscreen(t) }), [n, r, t]), i = X(() => Qo(e), [e]);
3139
+ }, Et = (e) => e.every((t) => t.every((n) => n === "")), to = ({ name: e, url: t, openUrl: n, state: r, children: o }) => /* @__PURE__ */ B("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-spreadsheet-view", "data-aqmx-spreadsheet": r, children: [
3140
+ /* @__PURE__ */ c(Ue, { name: e, openUrl: n, downloadUrl: t, icon: /* @__PURE__ */ c(Qi, {}) }),
3141
+ /* @__PURE__ */ c(Be, { scrollerProps: hc, children: /* @__PURE__ */ c("div", { className: "aqmx-document-spreadsheet-column", children: o }) })
3142
+ ] }), no = ({ rows: e, title: t }) => {
3143
+ const { labels: n, locale: r, theme: o } = $(), s = se(we), a = X(() => ({ ...Hr(n, r), table: t, fullscreenDialog: n.spreadsheetFullscreen(t) }), [n, r, t]), i = X(() => ls(e), [e]);
3118
3144
  return (
3119
- /* @__PURE__ */ c("div", { className: "aqmx-document-spreadsheet", "data-theme": o, children: /* @__PURE__ */ c(Go, { tsv: i, layout: s === "fill" ? "fill" : "inline", locale: r, labels: a }) })
3145
+ /* @__PURE__ */ c("div", { className: "aqmx-document-spreadsheet", "data-theme": o, children: /* @__PURE__ */ c(rs, { tsv: i, layout: s === "fill" ? "fill" : "inline", locale: r, labels: a, tapScrollCircle: Rr }) })
3120
3146
  );
3121
3147
  }, De = ({ note: e, testId: t, code: n, download: r }) => {
3122
3148
  const { labels: o } = $();
@@ -3124,81 +3150,81 @@ const Ji = /* @__PURE__ */ new Map([
3124
3150
  /* @__PURE__ */ c("p", { className: "aqmx-callout-body", children: e }),
3125
3151
  /* @__PURE__ */ c("a", { className: "aqmx-callout-action", href: r.url, download: r.name, "data-testid": "markdown-explorer-spreadsheet-unreadable-download", children: o.download })
3126
3152
  ] }) });
3127
- }, Yr = ({ reading: e, name: t, url: n }) => {
3153
+ }, ro = ({ reading: e, name: t, url: n }) => {
3128
3154
  const { labels: r } = $();
3129
3155
  switch (e.kind) {
3130
3156
  case "table":
3131
3157
  return /* @__PURE__ */ B(pe, { children: [
3132
3158
  e.truncated ? /* @__PURE__ */ c("p", { className: "aqmx-callout aqmx-document-notice", role: "note", "data-testid": "markdown-explorer-spreadsheet-truncated", children: r.spreadsheetTruncated }) : null,
3133
- /* @__PURE__ */ c(Kr, { rows: e.rows, title: t })
3159
+ /* @__PURE__ */ c(no, { rows: e.rows, title: t })
3134
3160
  ] });
3135
3161
  case "empty":
3136
3162
  return /* @__PURE__ */ c(De, { note: r.spreadsheetEmpty, testId: "markdown-explorer-spreadsheet-empty" });
3137
3163
  case "unreadable":
3138
- return /* @__PURE__ */ c(De, { note: ec(r, e), testId: "markdown-explorer-spreadsheet-unreadable", code: e.code, download: { url: n, name: t } });
3164
+ return /* @__PURE__ */ c(De, { note: pc(r, e), testId: "markdown-explorer-spreadsheet-unreadable", code: e.code, download: { url: n, name: t } });
3139
3165
  }
3140
- }, tc = ({ path: e, document: t }) => t.format === "workbook" ? /* @__PURE__ */ c(rc, { path: e, document: t }) : /* @__PURE__ */ c(nc, { path: e, document: t, format: t.format }), nc = ({ path: e, document: t, format: n }) => {
3166
+ }, gc = ({ path: e, document: t }) => t.format === "workbook" ? /* @__PURE__ */ c(vc, { path: e, document: t }) : /* @__PURE__ */ c(wc, { path: e, document: t, format: t.format }), wc = ({ path: e, document: t, format: n }) => {
3141
3167
  const { config: r, data: o, labels: s } = $(), { name: a, url: i } = t, f = F(
3142
3168
  async (h) => {
3143
- const g = await Pr(o, i, { format: n, legacyEncoding: r.legacyTextEncoding, maxBytes: r.spreadsheets.maxBytes, budget: Ye }, h);
3169
+ const g = await Ur(o, i, { format: n, legacyEncoding: r.legacyTextEncoding, maxBytes: r.spreadsheets.maxBytes, budget: Ye }, h);
3144
3170
  return g === null || g.kind === "failure" ? g : { kind: "read", value: g };
3145
3171
  },
3146
3172
  [o, i, n, r.legacyTextEncoding, r.spreadsheets.maxBytes]
3147
- ), { shown: u, failure: l, retry: d } = Ht(e, a, f);
3148
- return /* @__PURE__ */ B(Gr, { name: a, url: i, openUrl: rt(i), state: u === null ? l === null ? "loading" : "failure" : u.kind, children: [
3149
- u === null && l === null ? /* @__PURE__ */ c(Oe, { label: s.spreadsheetLoading, testId: "markdown-explorer-spreadsheet-skeleton" }) : null,
3173
+ ), { shown: u, failure: l, retry: d } = Vt(e, a, f);
3174
+ return /* @__PURE__ */ B(to, { name: a, url: i, openUrl: rt(i), state: u === null ? l === null ? "loading" : "failure" : u.kind, children: [
3175
+ u === null && l === null ? /* @__PURE__ */ c(Ce, { label: s.spreadsheetLoading, testId: "markdown-explorer-spreadsheet-skeleton" }) : null,
3150
3176
  u === null && l !== null ? /* @__PURE__ */ c("div", { className: "aqmx-document-spreadsheet-failure", children: /* @__PURE__ */ c(Re, { failure: l, alert: !1, onRetry: d, testId: "markdown-explorer-spreadsheet-failure" }) }) : null,
3151
- u === null ? null : /* @__PURE__ */ c(Yr, { reading: u, name: a, url: i })
3177
+ u === null ? null : /* @__PURE__ */ c(ro, { reading: u, name: a, url: i })
3152
3178
  ] });
3153
- }, rc = ({ path: e, document: t }) => {
3179
+ }, vc = ({ path: e, document: t }) => {
3154
3180
  const { config: n, data: r, labels: o } = $(), { name: s, url: a, firstSheetText: i } = t, f = Te(), u = U(null), l = F(
3155
3181
  async (b) => {
3156
- const S = await Jl(r, a, { maxBytes: n.spreadsheets.maxWorkbookBytes, limits: ji, budget: Ye }, u.current, b);
3182
+ const S = await mc(r, a, { maxBytes: n.spreadsheets.maxWorkbookBytes, limits: sl, budget: Ye }, u.current, b);
3157
3183
  if (S === null || S.kind === "failure") return S;
3158
3184
  if (S.kind === "workbook") return { kind: "read", value: S };
3159
3185
  if (i !== null) {
3160
- const M = await Pr(r, a, { format: i, legacyEncoding: n.legacyTextEncoding, maxBytes: n.spreadsheets.maxBytes, budget: Ye }, b);
3161
- return M === null || M.kind === "failure" ? M : { kind: "read", value: { kind: "first-sheet", reading: M } };
3186
+ const L = await Ur(r, a, { format: i, legacyEncoding: n.legacyTextEncoding, maxBytes: n.spreadsheets.maxBytes, budget: Ye }, b);
3187
+ return L === null || L.kind === "failure" ? L : { kind: "read", value: { kind: "first-sheet", reading: L } };
3162
3188
  }
3163
3189
  return { kind: "read", value: { kind: "refused", refusal: S.kind === "not-package" ? "not-workbook" : S.refusal } };
3164
3190
  },
3165
3191
  [r, a, i, n.legacyTextEncoding, n.spreadsheets.maxBytes, n.spreadsheets.maxWorkbookBytes]
3166
- ), { shown: d, failure: h, retry: g } = Ht(e, s, l), [v, y] = V(null), T = U(/* @__PURE__ */ new WeakMap()), C = d?.kind === "workbook" ? d : null, R = C === null ? null : v !== null && v.workbook === C.workbook ? v : { workbook: C.workbook, index: C.selected, reading: C.sheet }, q = (b) => {
3167
- if (C === null) return;
3168
- const S = C.workbook.sheets[b];
3192
+ ), { shown: d, failure: h, retry: g } = Vt(e, s, l), [v, y] = V(null), T = U(/* @__PURE__ */ new WeakMap()), O = d?.kind === "workbook" ? d : null, R = O === null ? null : v !== null && v.workbook === O.workbook ? v : { workbook: O.workbook, index: O.selected, reading: O.sheet }, q = (b) => {
3193
+ if (O === null) return;
3194
+ const S = O.workbook.sheets[b];
3169
3195
  if (S === void 0) return;
3170
3196
  u.current = S.name;
3171
- let M = T.current.get(C.workbook);
3172
- M === void 0 && (M = /* @__PURE__ */ new Map([[C.selected, C.sheet]]), T.current.set(C.workbook, M));
3173
- const L = M.get(b), P = { workbook: C.workbook, index: b, reading: L ?? null };
3174
- if (y(P), L !== void 0) return;
3175
- const H = M;
3176
- Wr(S, Ye).then((K) => {
3197
+ let L = T.current.get(O.workbook);
3198
+ L === void 0 && (L = /* @__PURE__ */ new Map([[O.selected, O.sheet]]), T.current.set(O.workbook, L));
3199
+ const M = L.get(b), P = { workbook: O.workbook, index: b, reading: M ?? null };
3200
+ if (y(P), M !== void 0) return;
3201
+ const H = L;
3202
+ eo(S, Ye).then((K) => {
3177
3203
  H.set(b, K), y((w) => w === P ? { ...P, reading: K } : w);
3178
3204
  });
3179
- }, D = R === null ? null : R.reading === null ? "loading" : R.reading.kind === "refused" ? "unreadable" : kt(R.reading.table.rows) ? "empty" : "table", m = d === null ? h === null ? "loading" : "failure" : d.kind === "first-sheet" ? d.reading.kind : d.kind === "refused" ? "unreadable" : D ?? "loading", p = i === null ? a : rt(a), x = (b) => `${f}-sheet-${b}`, A = `${f}-panel`, I = R === null ? null : C?.workbook.sheets[R.index]?.name ?? null, _ = C !== null && C.workbook.sheets.length > 1;
3180
- return /* @__PURE__ */ B(Gr, { name: s, url: a, openUrl: p, state: m, children: [
3181
- d === null && h === null ? /* @__PURE__ */ c(Oe, { label: o.spreadsheetLoading, testId: "markdown-explorer-spreadsheet-skeleton" }) : null,
3205
+ }, D = R === null ? null : R.reading === null ? "loading" : R.reading.kind === "refused" ? "unreadable" : Et(R.reading.table.rows) ? "empty" : "table", m = d === null ? h === null ? "loading" : "failure" : d.kind === "first-sheet" ? d.reading.kind : d.kind === "refused" ? "unreadable" : D ?? "loading", p = i === null ? a : rt(a), x = (b) => `${f}-sheet-${b}`, A = `${f}-panel`, I = R === null ? null : O?.workbook.sheets[R.index]?.name ?? null, _ = O !== null && O.workbook.sheets.length > 1;
3206
+ return /* @__PURE__ */ B(to, { name: s, url: a, openUrl: p, state: m, children: [
3207
+ d === null && h === null ? /* @__PURE__ */ c(Ce, { label: o.spreadsheetLoading, testId: "markdown-explorer-spreadsheet-skeleton" }) : null,
3182
3208
  d === null && h !== null ? /* @__PURE__ */ c("div", { className: "aqmx-document-spreadsheet-failure", children: /* @__PURE__ */ c(Re, { failure: h, alert: !1, onRetry: g, testId: "markdown-explorer-spreadsheet-failure" }) }) : null,
3183
- d?.kind === "refused" ? /* @__PURE__ */ c(De, { note: _n(o, d.refusal), testId: "markdown-explorer-spreadsheet-unreadable", code: d.refusal, download: { url: a, name: s } }) : null,
3209
+ d?.kind === "refused" ? /* @__PURE__ */ c(De, { note: Bn(o, d.refusal), testId: "markdown-explorer-spreadsheet-unreadable", code: d.refusal, download: { url: a, name: s } }) : null,
3184
3210
  d?.kind === "first-sheet" ? /* @__PURE__ */ B(pe, { children: [
3185
3211
  /* @__PURE__ */ c("p", { className: "aqmx-callout aqmx-document-notice", role: "note", "data-testid": "markdown-explorer-spreadsheet-first-sheet", children: o.spreadsheetWorkbookFirstSheet }),
3186
- /* @__PURE__ */ c(Yr, { reading: d.reading, name: s, url: a })
3212
+ /* @__PURE__ */ c(ro, { reading: d.reading, name: s, url: a })
3187
3213
  ] }) : null,
3188
- C === null || R === null || I === null ? null : /* @__PURE__ */ B(pe, { children: [
3189
- C.workbook.unshownSheets > 0 ? /* @__PURE__ */ c("p", { className: "aqmx-callout aqmx-document-notice", role: "note", "data-testid": "markdown-explorer-spreadsheet-unshown-sheets", children: o.spreadsheetUnshownSheets(C.workbook.unshownSheets) }) : null,
3190
- C.workbook.unlistedSheets > 0 ? /* @__PURE__ */ c("p", { className: "aqmx-callout aqmx-document-notice", role: "note", "data-testid": "markdown-explorer-spreadsheet-unlisted-sheets", children: o.spreadsheetUnlistedSheets(C.workbook.sheets.length) }) : null,
3191
- _ ? /* @__PURE__ */ c(Zi, { names: C.workbook.sheets.map((b) => b.name), selected: R.index, onSelect: q, label: o.spreadsheetSheets(s), tabIdOf: x, panelId: A }) : null,
3214
+ O === null || R === null || I === null ? null : /* @__PURE__ */ B(pe, { children: [
3215
+ O.workbook.unshownSheets > 0 ? /* @__PURE__ */ c("p", { className: "aqmx-callout aqmx-document-notice", role: "note", "data-testid": "markdown-explorer-spreadsheet-unshown-sheets", children: o.spreadsheetUnshownSheets(O.workbook.unshownSheets) }) : null,
3216
+ O.workbook.unlistedSheets > 0 ? /* @__PURE__ */ c("p", { className: "aqmx-callout aqmx-document-notice", role: "note", "data-testid": "markdown-explorer-spreadsheet-unlisted-sheets", children: o.spreadsheetUnlistedSheets(O.workbook.sheets.length) }) : null,
3217
+ _ ? /* @__PURE__ */ c(il, { names: O.workbook.sheets.map((b) => b.name), selected: R.index, onSelect: q, label: o.spreadsheetSheets(s), tabIdOf: x, panelId: A }) : null,
3192
3218
  /* @__PURE__ */ B("div", { className: "aqmx-document-spreadsheet-sheet", "data-testid": "markdown-explorer-spreadsheet-sheet", "data-aqmx-sheet": R.index, ..._ ? { role: "tabpanel", id: A, "aria-labelledby": x(R.index) } : {}, children: [
3193
- R.reading === null ? /* @__PURE__ */ c(Oe, { label: o.spreadsheetSheetLoading, testId: "markdown-explorer-spreadsheet-sheet-skeleton" }) : null,
3219
+ R.reading === null ? /* @__PURE__ */ c(Ce, { label: o.spreadsheetSheetLoading, testId: "markdown-explorer-spreadsheet-sheet-skeleton" }) : null,
3194
3220
  R.reading?.kind === "table" && R.reading.table.truncated ? /* @__PURE__ */ c("p", { className: "aqmx-callout aqmx-document-notice", role: "note", "data-testid": "markdown-explorer-spreadsheet-truncated", children: o.spreadsheetTruncated }) : null,
3195
- R.reading?.kind === "refused" ? /* @__PURE__ */ c(De, { note: _n(o, R.reading.refusal), testId: "markdown-explorer-spreadsheet-unreadable", code: R.reading.refusal, download: { url: a, name: s } }) : null,
3196
- R.reading?.kind === "table" && kt(R.reading.table.rows) ? /* @__PURE__ */ c(De, { note: o.spreadsheetSheetEmpty, testId: "markdown-explorer-spreadsheet-empty" }) : null,
3197
- R.reading?.kind === "table" && !kt(R.reading.table.rows) ? /* @__PURE__ */ c(Kr, { rows: R.reading.table.rows, title: o.spreadsheetSheetName(s, I) }, R.index) : null
3221
+ R.reading?.kind === "refused" ? /* @__PURE__ */ c(De, { note: Bn(o, R.reading.refusal), testId: "markdown-explorer-spreadsheet-unreadable", code: R.reading.refusal, download: { url: a, name: s } }) : null,
3222
+ R.reading?.kind === "table" && Et(R.reading.table.rows) ? /* @__PURE__ */ c(De, { note: o.spreadsheetSheetEmpty, testId: "markdown-explorer-spreadsheet-empty" }) : null,
3223
+ R.reading?.kind === "table" && !Et(R.reading.table.rows) ? /* @__PURE__ */ c(no, { rows: R.reading.table.rows, title: o.spreadsheetSheetName(s, I) }, R.index) : null
3198
3224
  ] })
3199
3225
  ] })
3200
3226
  ] });
3201
- }, oc = Object.freeze({ kind: "empty" }), sc = (e, t, n) => {
3227
+ }, bc = Object.freeze({ kind: "empty" }), yc = (e, t, n) => {
3202
3228
  if (t.view === "multi" || t.overrides[n] === void 0) return null;
3203
3229
  const r = n === "style" ? { align: t.overrides.align } : { style: t.overrides.style };
3204
3230
  return Ne(e, { ...t, overrides: r });
@@ -3210,7 +3236,7 @@ const Ji = /* @__PURE__ */ new Map([
3210
3236
  i
3211
3237
  ] })
3212
3238
  );
3213
- }, ac = ({ absence: e, announces: t, announceFailure: n }) => {
3239
+ }, kc = ({ absence: e, announces: t, announceFailure: n }) => {
3214
3240
  const { labels: r, announcer: o } = $(), s = e.kind === "no-readme" ? e.folder : null, a = e.kind === "failure" ? e.folder : null, i = e.kind === "failure" ? e.failure : null;
3215
3241
  switch (ee(() => {
3216
3242
  t && s !== null && o.announce(r.folderReadmeMissing(fe(s)));
@@ -3220,119 +3246,119 @@ const Ji = /* @__PURE__ */ new Map([
3220
3246
  case "empty":
3221
3247
  return /* @__PURE__ */ c(Pe, { kind: "empty", label: r.documentRegion, stale: !1, busy: !1, children: /* @__PURE__ */ c("div", { className: "aqmx-empty", "data-testid": "markdown-explorer-document-empty", children: /* @__PURE__ */ c("p", { className: "aqmx-empty-title", children: r.documentEmpty }) }) });
3222
3248
  case "loading":
3223
- return /* @__PURE__ */ c(Vt, { label: r.documentRegion });
3249
+ return /* @__PURE__ */ c(Gt, { label: r.documentRegion });
3224
3250
  case "no-readme":
3225
3251
  return /* @__PURE__ */ c(Pe, { kind: "empty", label: r.documentRegion, stale: !1, busy: !1, children: /* @__PURE__ */ c("div", { className: "aqmx-empty", "data-testid": "markdown-explorer-folder-empty", children: /* @__PURE__ */ c("p", { className: "aqmx-empty-title", children: r.folderReadmeMissing(fe(e.folder)) }) }) });
3226
3252
  case "failure":
3227
- return /* @__PURE__ */ c(Pe, { kind: "failure", label: r.documentRegion, stale: !1, busy: !1, children: /* @__PURE__ */ c(qt, { failure: e.failure, onRetry: e.onRetry, testId: "markdown-explorer-folder-failure" }) });
3253
+ return /* @__PURE__ */ c(Pe, { kind: "failure", label: r.documentRegion, stale: !1, busy: !1, children: /* @__PURE__ */ c(Ht, { failure: e.failure, onRetry: e.onRetry, testId: "markdown-explorer-folder-failure" }) });
3228
3254
  }
3229
- }, Vt = ({ label: e }) => {
3255
+ }, Gt = ({ label: e }) => {
3230
3256
  const { labels: t } = $();
3231
- return /* @__PURE__ */ c(Pe, { kind: "loading", label: e, stale: !1, busy: !0, children: /* @__PURE__ */ c(Oe, { label: t.documentLoading, testId: "markdown-explorer-document-skeleton" }) });
3232
- }, Fn = Object.freeze(["wheel", "touchstart", "pointerdown", "keydown"]), ic = ({ path: e, document: t, viewer: n, editing: r }) => {
3233
- const { reportMathDiagnostics: o, edits: s } = $(), a = X(() => ({ htmlContent: t.htmlContent, headings: [...t.headings] }), [t]), i = bi(), f = yi(), u = X(() => o === void 0 ? void 0 : (m) => o(e, m), [o, e]), l = U(null), { editable: d, doubleClick: h, region: g, paneScroll: v, stale: y } = r;
3257
+ return /* @__PURE__ */ c(Pe, { kind: "loading", label: e, stale: !1, busy: !0, children: /* @__PURE__ */ c(Ce, { label: t.documentLoading, testId: "markdown-explorer-document-skeleton" }) });
3258
+ }, Un = Object.freeze(["wheel", "touchstart", "pointerdown", "keydown"]), Ec = ({ path: e, document: t, viewer: n, editing: r }) => {
3259
+ const { reportMathDiagnostics: o, edits: s } = $(), a = X(() => ({ htmlContent: t.htmlContent, headings: [...t.headings] }), [t]), i = Pi(), f = Ii(), u = X(() => o === void 0 ? void 0 : (m) => o(e, m), [o, e]), l = U(null), { editable: d, doubleClick: h, region: g, paneScroll: v, stale: y } = r;
3234
3260
  Y(() => {
3235
3261
  if (d)
3236
3262
  return s.bindView(e, {
3237
3263
  anchor: () => {
3238
3264
  const m = l.current, p = g(), x = m === null ? null : m.querySelector(st);
3239
- return m === null || p === null || x === null ? null : ea(m, v.scrollerOf(p, x));
3265
+ return m === null || p === null || x === null ? null : ca(m, v.scrollerOf(p, x));
3240
3266
  }
3241
3267
  });
3242
3268
  }, [s, e, d, g, v]);
3243
3269
  const T = (m) => {
3244
3270
  const p = l.current, { target: x } = m;
3245
- !h || p === null || !(x instanceof Element) || !Js(x) || (m.stopPropagation(), s.start(e, Qs(x, p, p.ownerDocument.getSelection())));
3246
- }, C = U(null), R = U(y);
3271
+ !h || p === null || !(x instanceof Element) || !ia(x) || (m.stopPropagation(), s.start(e, la(x, p, p.ownerDocument.getSelection())));
3272
+ }, O = U(null), R = U(y);
3247
3273
  Y(() => {
3248
3274
  R.current = y;
3249
3275
  });
3250
3276
  const q = le((m) => {
3251
- const p = l.current, x = g(), A = p === null ? null : sa(p, m.line);
3277
+ const p = l.current, x = g(), A = p === null ? null : ha(p, m.line);
3252
3278
  if (x === null || A === null) return !1;
3253
3279
  const I = v.scrollerOf(x, A);
3254
- return I.scrollTop += aa(A, m.line) - m.clientTop, !0;
3280
+ return I.scrollTop += pa(A, m.line) - m.clientTop, !0;
3255
3281
  }), D = le((m) => {
3256
3282
  const p = g();
3257
3283
  if (p === null) return;
3258
3284
  const x = () => {
3259
- for (const I of Fn) p.removeEventListener(I, A, !0);
3260
- C.current?.release === x && (C.current = null);
3285
+ for (const I of Un) p.removeEventListener(I, A, !0);
3286
+ O.current?.release === x && (O.current = null);
3261
3287
  }, A = () => x();
3262
- for (const I of Fn) p.addEventListener(I, A, { capture: !0, passive: !0 });
3263
- C.current = { point: m, release: x };
3288
+ for (const I of Un) p.addEventListener(I, A, { capture: !0, passive: !0 });
3289
+ O.current = { point: m, release: x };
3264
3290
  });
3265
3291
  return Y(() => {
3266
3292
  const m = s.takeReturn(e);
3267
3293
  if (m !== null)
3268
3294
  return queueMicrotask(() => {
3269
3295
  q(m) && R.current && D(m);
3270
- }), () => C.current?.release();
3296
+ }), () => O.current?.release();
3271
3297
  }, [s, e]), Y(() => {
3272
- const m = C.current;
3298
+ const m = O.current;
3273
3299
  m === null || y || (m.release(), q(m.point));
3274
3300
  }, [t, y]),
3275
- /* @__PURE__ */ c("div", { ref: l, className: "aqmx-document-viewer", onDoubleClick: T, children: /* @__PURE__ */ c(tr, { ...n, onHeadingSelect: i, headingHref: f, onMathDiagnostics: u, parseResult: a, content: null }) });
3276
- }, Xr = ({ document: e, viewer: t }) => {
3301
+ /* @__PURE__ */ c("div", { ref: l, className: "aqmx-document-viewer", onDoubleClick: T, children: /* @__PURE__ */ c(or, { ...n, onHeadingSelect: i, headingHref: f, onMathDiagnostics: u, parseResult: a, content: null }) });
3302
+ }, oo = ({ document: e, viewer: t }) => {
3277
3303
  const { labels: n } = $();
3278
3304
  return /* @__PURE__ */ B(pe, { children: [
3279
- /* @__PURE__ */ c(Ue, { name: e.name, openUrl: rt(e.url), downloadUrl: e.url, icon: /* @__PURE__ */ c(zs, {}), children: e.truncated ? null : /* @__PURE__ */ c(Ra, { text: e.text }) }),
3305
+ /* @__PURE__ */ c(Ue, { name: e.name, openUrl: rt(e.url), downloadUrl: e.url, icon: /* @__PURE__ */ c(Js, {}), children: e.truncated ? null : /* @__PURE__ */ c(Ua, { text: e.text }) }),
3280
3306
  e.truncated ? /* @__PURE__ */ c("p", { className: "aqmx-callout aqmx-document-notice", role: "note", "data-testid": "markdown-explorer-text-truncated", children: n.textTruncated }) : null,
3281
- /* @__PURE__ */ c("div", { className: "aqmx-document-viewer", children: /* @__PURE__ */ c(tr, { ...t, parseResult: null, content: e.text }) })
3307
+ /* @__PURE__ */ c("div", { className: "aqmx-document-viewer", children: /* @__PURE__ */ c(or, { ...t, parseResult: null, content: e.text }) })
3282
3308
  ] });
3283
- }, Et = ({ path: e, name: t, viewer: n }) => {
3309
+ }, St = ({ path: e, name: t, viewer: n }) => {
3284
3310
  const { data: r, labels: o } = $(), s = F(
3285
3311
  async (u) => {
3286
3312
  const l = await r.text(e, u);
3287
3313
  return "kind" in l ? l.kind === "failure" ? { kind: "failure", failure: l.failure } : { kind: "read", value: l } : null;
3288
3314
  },
3289
3315
  [r, e]
3290
- ), { shown: a, failure: i, retry: f } = Ht(e, t, s);
3291
- return a !== null ? /* @__PURE__ */ c(Xr, { document: a, viewer: n }) : i !== null ? /* @__PURE__ */ c(qt, { failure: i, onRetry: f, testId: "markdown-explorer-markup-failure" }) : /* @__PURE__ */ c(Oe, { label: o.markupLoading, testId: "markdown-explorer-markup-skeleton" });
3292
- }, lc = Object.freeze({ reason: "failed" }), cc = (e) => {
3316
+ ), { shown: a, failure: i, retry: f } = Vt(e, t, s);
3317
+ return a !== null ? /* @__PURE__ */ c(oo, { document: a, viewer: n }) : i !== null ? /* @__PURE__ */ c(Ht, { failure: i, onRetry: f, testId: "markdown-explorer-markup-failure" }) : /* @__PURE__ */ c(Ce, { label: o.markupLoading, testId: "markdown-explorer-markup-skeleton" });
3318
+ }, Sc = Object.freeze({ reason: "failed" }), xc = (e) => {
3293
3319
  const { labels: t } = $();
3294
3320
  return /* @__PURE__ */ c(
3295
- Zs,
3321
+ ta,
3296
3322
  {
3297
- fallback: (n) => /* @__PURE__ */ c("div", { className: "aqmx-edit-message", children: /* @__PURE__ */ c(Re, { failure: lc, alert: !1, onRetry: n, testId: "markdown-explorer-edit-load-failure" }) }),
3298
- children: /* @__PURE__ */ c(Ie, { fallback: /* @__PURE__ */ c(Oe, { label: t.editLoading, testId: "markdown-explorer-edit-skeleton" }), children: /* @__PURE__ */ c(Vs, { ...e }) })
3323
+ fallback: (n) => /* @__PURE__ */ c("div", { className: "aqmx-edit-message", children: /* @__PURE__ */ c(Re, { failure: Sc, alert: !1, onRetry: n, testId: "markdown-explorer-edit-load-failure" }) }),
3324
+ children: /* @__PURE__ */ c(Ie, { fallback: /* @__PURE__ */ c(Ce, { label: t.editLoading, testId: "markdown-explorer-edit-skeleton" }), children: /* @__PURE__ */ c(ea, { ...e }) })
3299
3325
  }
3300
3326
  );
3301
- }, dc = ({ path: e, document: t, view: n, viewer: r, onRetry: o, editing: s }) => {
3327
+ }, Tc = ({ path: e, document: t, view: n, viewer: r, onRetry: o, editing: s }) => {
3302
3328
  switch (t.kind) {
3303
3329
  case "markdown": {
3304
3330
  const { session: a, layout: i, region: f, paneScroll: u, stale: l } = s;
3305
- if (n === "edit" && a !== void 0) return /* @__PURE__ */ c(cc, { path: e, name: t.name, session: a, layout: i, viewer: r, region: f, paneScroll: u });
3306
- if (n === "markup") return /* @__PURE__ */ c(Et, { path: e, name: t.name, viewer: r });
3331
+ if (n === "edit" && a !== void 0) return /* @__PURE__ */ c(xc, { path: e, name: t.name, session: a, layout: i, viewer: r, region: f, paneScroll: u });
3332
+ if (n === "markup") return /* @__PURE__ */ c(St, { path: e, name: t.name, viewer: r });
3307
3333
  const d = t.edit !== null && (t.edit.kind === "inline" || t.edit.kind === "draft");
3308
- return /* @__PURE__ */ c(ic, { path: e, document: t, viewer: r, editing: { editable: d, doubleClick: d && i === "fill", region: f, paneScroll: u, stale: l } });
3334
+ return /* @__PURE__ */ c(Ec, { path: e, document: t, viewer: r, editing: { editable: d, doubleClick: d && i === "fill", region: f, paneScroll: u, stale: l } });
3309
3335
  }
3310
3336
  case "text":
3311
- return /* @__PURE__ */ c(Xr, { document: t, viewer: r });
3337
+ return /* @__PURE__ */ c(oo, { document: t, viewer: r });
3312
3338
  case "image":
3313
- return n === "markup" && Ut(t) === "svg" ? /* @__PURE__ */ c(Et, { path: e, name: t.name, viewer: r }) : /* @__PURE__ */ c(ii, { document: t });
3339
+ return n === "markup" && jt(t) === "svg" ? /* @__PURE__ */ c(St, { path: e, name: t.name, viewer: r }) : /* @__PURE__ */ c(Ei, { document: t });
3314
3340
  case "media":
3315
- return /* @__PURE__ */ c(Pi, { document: t });
3341
+ return /* @__PURE__ */ c(Ki, { document: t });
3316
3342
  case "spreadsheet":
3317
- return n === "markup" ? /* @__PURE__ */ c(Et, { path: e, name: t.name, viewer: r }) : /* @__PURE__ */ c(tc, { path: e, document: t });
3343
+ return n === "markup" ? /* @__PURE__ */ c(St, { path: e, name: t.name, viewer: r }) : /* @__PURE__ */ c(gc, { path: e, document: t });
3318
3344
  case "file":
3319
- return /* @__PURE__ */ c(Ia, { document: t });
3345
+ return /* @__PURE__ */ c(Ya, { document: t });
3320
3346
  case "failure":
3321
- return /* @__PURE__ */ c(qt, { failure: t.failure, onRetry: o, testId: "markdown-explorer-document-failure" });
3347
+ return /* @__PURE__ */ c(Ht, { failure: t.failure, onRetry: o, testId: "markdown-explorer-document-failure" });
3322
3348
  default: {
3323
3349
  const a = t;
3324
3350
  throw new RangeError(`[markdown-explorer] unknown document kind in ${JSON.stringify(a)}`);
3325
3351
  }
3326
3352
  }
3327
- }, uc = 'a[href], button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), iframe, audio[controls], video[controls], [tabindex]:not([tabindex="-1"])', fc = (e, t, n) => {
3328
- const [r] = t.kind === "markdown" ? t.headings : [], o = [n === null ? null : xr(e, n), r === void 0 ? null : Sr(e, r.id), e.querySelector(st), e.querySelector(uc)];
3353
+ }, Rc = 'a[href], button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), iframe, audio[controls], video[controls], [tabindex]:not([tabindex="-1"])', Cc = (e, t, n) => {
3354
+ const [r] = t.kind === "markdown" ? t.headings : [], o = [n === null ? null : Ar(e, n), r === void 0 ? null : Mr(e, r.id), e.querySelector(st), e.querySelector(Rc)];
3329
3355
  for (const s of o)
3330
- if (s instanceof HTMLElement && vr(s)) return s;
3356
+ if (s instanceof HTMLElement && kr(s)) return s;
3331
3357
  return null;
3332
- }, qn = (e, t, n) => {
3358
+ }, Hn = (e, t, n) => {
3333
3359
  const { activeElement: r, body: o } = e.ownerDocument, s = r === null || r === o;
3334
- t instanceof HTMLElement && n && (s || e.contains(r)) && vr(t);
3335
- }, mc = (e) => {
3360
+ t instanceof HTMLElement && n && (s || e.contains(r)) && kr(t);
3361
+ }, Oc = (e) => {
3336
3362
  const t = U(!1);
3337
3363
  return Y(() => {
3338
3364
  const n = e.current;
@@ -3358,11 +3384,11 @@ const Ji = /* @__PURE__ */ new Map([
3358
3384
  clearTimeout(a), o.removeEventListener("pointerdown", i, !0), o.removeEventListener("mousedown", i, !0), o.removeEventListener("focusin", f, !0), o.removeEventListener("blur", l), o.removeEventListener("focus", d), n.removeEventListener("focusout", u);
3359
3385
  };
3360
3386
  }, [e]), t;
3361
- }, hc = Object.freeze({ count: 0, recovered: !1 }), pc = ({ path: e, snapshot: t, markup: n, stale: r, viewer: o, editLayout: s, regionLabel: a, navigation: i, fragment: f, paneScroll: u, announces: l, announceFailure: d, onDocumentShown: h }) => {
3362
- const { labels: g, announcer: v, documents: y } = $(), { document: T } = t, C = U(null), R = U(null), q = U(null), D = U(0), m = mc(C), p = U({ path: e, document: T }), x = U(null), A = F(
3387
+ }, Lc = Object.freeze({ count: 0, recovered: !1 }), Mc = ({ path: e, snapshot: t, markup: n, stale: r, viewer: o, editLayout: s, regionLabel: a, navigation: i, fragment: f, paneScroll: u, announces: l, announceFailure: d, onDocumentShown: h }) => {
3388
+ const { labels: g, announcer: v, documents: y } = $(), { document: T } = t, O = U(null), R = U(null), q = U(null), D = U(0), m = Oc(O), p = U({ path: e, document: T }), x = U(null), A = F(
3363
3389
  (j) => {
3364
- const Z = C.current, Q = yn(Z, j, u);
3365
- Z !== null && Q !== null && qn(Z, Q, m.current);
3390
+ const Z = O.current, Q = Sn(Z, j, u);
3391
+ Z !== null && Q !== null && Hn(Z, Q, m.current);
3366
3392
  },
3367
3393
  [u, m]
3368
3394
  ), I = F(
@@ -3380,31 +3406,31 @@ const Ji = /* @__PURE__ */ new Map([
3380
3406
  }, 0);
3381
3407
  },
3382
3408
  [A]
3383
- ), b = X(() => ({ navigation: i, currentPath: e, scrollWithin: A, followSameUrlJump: I, followEmptyFragment: _ }), [i, e, A, I, _]), S = F(() => y.retry(e), [y, e]), M = la(y, fi), L = pr(e), P = L !== void 0 ? "edit" : n ? "markup" : "rendered", H = Ut(T) === null ? void 0 : P, K = F(() => C.current, []), w = X(() => ({ session: L, layout: s, region: K, paneScroll: u, stale: r }), [L, s, K, u, r]), k = H === "edit" ? !1 : r, O = se(we), N = H === "edit" && s === "fill" ? "fill" : O, [z, W] = V(0), J = U(0), G = U(!1), [ie, Wt] = V(hc), [Gt, to] = V(0), Kt = U(d), Yt = U(r);
3409
+ ), b = X(() => ({ navigation: i, currentPath: e, scrollWithin: A, followSameUrlJump: I, followEmptyFragment: _ }), [i, e, A, I, _]), S = F(() => y.retry(e), [y, e]), L = wa(y, Ci), M = vr(e), P = M !== void 0 ? "edit" : n ? "markup" : "rendered", H = jt(T) === null ? void 0 : P, K = F(() => O.current, []), w = X(() => ({ session: M, layout: s, region: K, paneScroll: u, stale: r }), [M, s, K, u, r]), k = H === "edit" ? !1 : r, C = se(we), N = H === "edit" && s === "fill" ? "fill" : C, [z, W] = V(0), J = U(0), G = U(!1), [ie, Yt] = V(Lc), [Xt, lo] = V(0), Jt = U(d), Qt = U(r);
3384
3410
  Y(() => {
3385
- Kt.current = d, Yt.current = r;
3411
+ Jt.current = d, Qt.current = r;
3386
3412
  }, [d, r]);
3387
- const no = X(
3413
+ const co = X(
3388
3414
  () => ({
3389
3415
  announceFailure: (j) => {
3390
- Yt.current || Kt.current(j);
3416
+ Qt.current || Jt.current(j);
3391
3417
  },
3392
3418
  readPart: () => {
3393
3419
  const j = y.readPart(e);
3394
3420
  J.current += 1;
3395
- let Z = !1, Q = !1, re = !1;
3421
+ let Z = !1, Q = !1, oe = !1;
3396
3422
  return {
3397
3423
  settle: (be, ye) => {
3398
- if (j.settle(be, ye), !(re || Z)) {
3424
+ if (j.settle(be, ye), !(oe || Z)) {
3399
3425
  if (ye !== null) {
3400
3426
  Q = !0, G.current = !1;
3401
3427
  return;
3402
3428
  }
3403
- Z = !0, Wt((ze) => ({ count: ze.count + 1, recovered: Q }));
3429
+ Z = !0, Yt((ze) => ({ count: ze.count + 1, recovered: Q }));
3404
3430
  }
3405
3431
  },
3406
3432
  release: () => {
3407
- re || (re = !0, j.release(), J.current -= 1, Z || to((be) => be + 1));
3433
+ oe || (oe = !0, j.release(), J.current -= 1, Z || lo((be) => be + 1));
3408
3434
  }
3409
3435
  };
3410
3436
  },
@@ -3417,94 +3443,95 @@ const Ji = /* @__PURE__ */ new Map([
3417
3443
  }
3418
3444
  }),
3419
3445
  [y, e]
3420
- ), Xt = k || z > 0, ro = le((j, Z) => {
3446
+ ), en = k || z > 0, uo = le((j, Z) => {
3421
3447
  const Q = R.current;
3422
3448
  if (Q !== null && Q.path === j && Q.snapshot === Z) return;
3423
3449
  R.current = { path: j, snapshot: Z }, y.noteShown(j, Z);
3424
- const re = Z.document;
3425
- if (re.kind === "failure") {
3426
- G.current = !1, y.noteFailureShown(Z) && d(g.documentFailed(fe(j), de(g, re.failure.reason)));
3450
+ const oe = Z.document;
3451
+ if (oe.kind === "failure") {
3452
+ G.current = !1, y.noteFailureShown(Z) && d(g.documentFailed(fe(j), de(g, oe.failure.reason)));
3427
3453
  return;
3428
3454
  }
3429
- h?.(j, re), !(!l || Q !== null && Q.path === j && Q.snapshot.document.kind !== "failure") && (G.current = J.current > 0, G.current || v.announce(g.documentShown(re.name)));
3455
+ h?.(j, oe), !(!l || Q !== null && Q.path === j && Q.snapshot.document.kind !== "failure") && (G.current = J.current > 0, G.current || v.announce(g.documentShown(oe.name)));
3430
3456
  });
3431
3457
  ee(() => {
3432
- ro(e, t);
3458
+ uo(e, t);
3433
3459
  }, [e, t]);
3434
- const oo = le(() => {
3460
+ const fo = le(() => {
3435
3461
  f.kind === "panel" && f.consume();
3436
- }), Jt = le((j) => {
3437
- const Z = C.current;
3462
+ }), tn = le((j) => {
3463
+ const Z = O.current;
3438
3464
  if (Z === null || !m.current) return null;
3439
- const { activeElement: Q, body: re } = Z.ownerDocument;
3440
- return Q !== null && Q !== re ? null : fc(Z, T, j);
3441
- }), so = le((j) => {
3465
+ const { activeElement: Q, body: oe } = Z.ownerDocument;
3466
+ return Q !== null && Q !== oe ? null : Cc(Z, T, j);
3467
+ }), mo = le((j) => {
3442
3468
  const Z = G.current;
3443
- G.current = !1, !r && (j && Jt(null), l && (j || Z) && T.kind !== "failure" && v.announce(g.documentShown(T.name)));
3469
+ G.current = !1, !r && (j && tn(null), l && (j || Z) && T.kind !== "failure" && v.announce(g.documentShown(T.name)));
3444
3470
  });
3445
3471
  ee(() => {
3446
- ie.count > 0 && so(ie.recovered);
3472
+ ie.count > 0 && mo(ie.recovered);
3447
3473
  }, [ie]);
3448
- const ao = le(() => {
3474
+ const ho = le(() => {
3449
3475
  J.current > 0 || !G.current || (G.current = !1, l && !r && T.kind !== "failure" && v.announce(g.documentShown(T.name)));
3450
3476
  });
3451
3477
  ee(() => {
3452
- Gt > 0 && ao();
3453
- }, [Gt]);
3454
- const io = le((j) => {
3455
- const Z = C.current;
3456
- Z !== null && qn(Z, j, m.current);
3457
- }), lo = le((j) => u.reveal(j)), co = le((j) => yn(C.current, j, u));
3478
+ Xt > 0 && ho();
3479
+ }, [Xt]);
3480
+ const po = le((j) => {
3481
+ const Z = O.current;
3482
+ Z !== null && Hn(Z, j, m.current);
3483
+ }), go = le((j) => u.reveal(j)), wo = le((j) => Sn(O.current, j, u));
3458
3484
  return ee(() => {
3459
3485
  if (r) return;
3460
3486
  const j = p.current.path !== e, Z = j || p.current.document !== T;
3461
3487
  p.current = { path: e, document: T };
3462
3488
  const Q = x.current !== e;
3463
3489
  x.current = e;
3464
- let re = null;
3465
- f.kind === "page" ? q.current !== f.navigation && (q.current = f.navigation, D.current += 1, re = f.fragment) : f.fragment !== null && (re = f.fragment, oo());
3490
+ let oe = null;
3491
+ f.kind === "page" ? q.current !== f.navigation && (q.current = f.navigation, D.current += 1, oe = f.fragment) : f.fragment !== null && (oe = f.fragment, fo());
3466
3492
  const be = () => {
3467
- const ye = re === null ? null : co(re);
3493
+ const ye = oe === null ? null : wo(oe);
3468
3494
  if (!Z) {
3469
- ye !== null && io(ye);
3495
+ ye !== null && po(ye);
3470
3496
  return;
3471
3497
  }
3472
- const ze = Jt(f.fragment);
3473
- j && ye === null && ze !== null && lo(ze);
3498
+ const ze = tn(f.fragment);
3499
+ j && ye === null && ze !== null && go(ze);
3474
3500
  };
3475
3501
  Q ? queueMicrotask(be) : be();
3476
- }, [f, e, T, r]), /* @__PURE__ */ c(we, { value: N, children: /* @__PURE__ */ c(Pe, { kind: T.kind, view: H, label: a(e, T), stale: Xt, busy: Xt, frameRef: C, intent: M, children: /* @__PURE__ */ c(Rr, { value: b, children: /* @__PURE__ */ c(di, { children: /* @__PURE__ */ c(kr, { value: no, children: /* @__PURE__ */ c(dc, { path: e, document: T, view: P, viewer: o, onRetry: S, editing: w }, e) }) }) }) }) });
3477
- }, Zt = Object.freeze({ kind: "skeleton" }), gc = (e, t, n, r, o) => {
3502
+ }, [f, e, T, r]), /* @__PURE__ */ c(we, { value: N, children: /* @__PURE__ */ c(Pe, { kind: T.kind, view: H, label: a(e, T), stale: en, busy: en, frameRef: O, intent: L, children: /* @__PURE__ */ c(Dr, { value: b, children: /* @__PURE__ */ c(Ti, { children: /* @__PURE__ */ c(Or, { value: co, children: /* @__PURE__ */ c(Tc, { path: e, document: T, view: P, viewer: o, onRetry: S, editing: w }, e) }) }) }) }) });
3503
+ }, Kt = Object.freeze({ kind: "skeleton" }), Ac = (e, t, n, r, o) => {
3478
3504
  if (t?.status === "loaded") return { kind: "document", path: e, snapshot: t, stale: !1 };
3479
3505
  const s = ge(t);
3480
3506
  if (s !== null) return { kind: "document", path: e, snapshot: s, stale: !0 };
3481
3507
  if (o && t?.status === "pending") return { kind: "streaming", path: e, promise: t.promise };
3482
3508
  const a = n === null || n === e ? null : ge(r);
3483
- return n === null || a === null ? Zt : { kind: "document", path: n, snapshot: a, stale: !0 };
3484
- }, wc = (e, t) => t.status === "deferred" ? Zt : { kind: "document", path: e, snapshot: t, stale: !1 }, vc = ({ requestedPath: e, content: t, markup: n, ...r }) => {
3485
- const o = t.kind === "streaming" ? wc(t.path, se(t.promise)) : t;
3486
- return o.kind !== "document" ? /* @__PURE__ */ c(Vt, { label: r.regionLabel(e, null) }) : /* @__PURE__ */ c(pc, { path: o.path, snapshot: o.snapshot, markup: n, stale: o.stale, ...r });
3487
- }, Jr = ({ path: e, absence: t, markup: n, display: r, navigation: o, fragment: s, paneScroll: a, announces: i, announceFailure: f, onDocumentShown: u }) => {
3488
- const { config: l, labels: d, locale: h, theme: g, documents: v, data: y } = $(), T = Ko(), C = U(!1);
3509
+ return n === null || a === null ? Kt : { kind: "document", path: n, snapshot: a, stale: !0 };
3510
+ }, Nc = (e, t) => t.status === "deferred" ? Kt : { kind: "document", path: e, snapshot: t, stale: !1 }, Dc = ({ requestedPath: e, content: t, markup: n, ...r }) => {
3511
+ const o = t.kind === "streaming" ? Nc(t.path, se(t.promise)) : t;
3512
+ return o.kind !== "document" ? /* @__PURE__ */ c(Gt, { label: r.regionLabel(e, null) }) : /* @__PURE__ */ c(Mc, { path: o.path, snapshot: o.snapshot, markup: n, stale: o.stale, ...r });
3513
+ }, so = ({ path: e, absence: t, markup: n, display: r, navigation: o, fragment: s, paneScroll: a, announces: i, announceFailure: f, onDocumentShown: u }) => {
3514
+ const { config: l, labels: d, locale: h, theme: g, documents: v, data: y } = $(), T = os(), O = U(!1);
3489
3515
  Y(() => {
3490
- C.current = !0;
3516
+ O.current = !0;
3491
3517
  }, []);
3492
- const [R, q] = V(null), [D, m] = V(n), p = F(() => e === null ? void 0 : v.peek(e), [v, e]), x = oe(v.subscribe, p, p), A = F(() => R === null ? void 0 : v.peek(R), [v, R]), I = oe(v.subscribe, A, A);
3518
+ const [R, q] = V(null), [D, m] = V(n), p = F(() => e === null ? void 0 : v.peek(e), [v, e]), x = re(v.subscribe, p, p), A = F(() => R === null ? void 0 : v.peek(R), [v, R]), I = re(v.subscribe, A, A);
3493
3519
  Y(() => e === null ? void 0 : v.open(e), [v, e]), Y(() => R === null ? void 0 : v.retain(R), [v, R]);
3494
- const _ = e === null ? Zt : gc(e, x, R, I, !C.current), b = e === null ? null : _.kind === "document" && !_.stale ? _.path : R;
3520
+ const _ = e === null ? Kt : Ac(e, x, R, I, !O.current), b = e === null ? null : _.kind === "document" && !_.stale ? _.path : R;
3495
3521
  b !== R && q(b);
3496
3522
  const S = _.kind !== "document" || _.path === e;
3497
3523
  S && n !== D && m(n);
3498
- const M = X(() => Xi(d, h), [d, h]), L = X(() => ({ read: (O, N) => li(y, O, N) }), [y]), P = X(() => [...l.iframeHosts], [l]), H = o.kind === "panel", K = X(
3524
+ const L = X(() => fl(d, h), [d, h]), M = X(() => ({ read: (C, N) => Si(y, C, N) }), [y]), P = X(() => [...l.iframeHosts], [l]), H = o.kind === "panel", K = X(
3499
3525
  () => ({
3500
- labels: M,
3526
+ labels: L,
3501
3527
  spreadsheetLocale: h,
3528
+ spreadsheetTapScrollCircle: Rr,
3502
3529
  emptyMessage: d.documentEmpty,
3503
3530
  theme: g,
3504
3531
  availableStyles: l.documentStyles,
3505
3532
  iFrameAllowedDomains: P,
3506
3533
  embeds: l.embeds,
3507
- linkComponent: vi,
3534
+ linkComponent: Di,
3508
3535
  toolbar: T,
3509
3536
  style: r.style,
3510
3537
  onStyleChange: r.onStyleChange,
@@ -3516,13 +3543,14 @@ const Ji = /* @__PURE__ */ new Map([
3516
3543
  padding: r.padding,
3517
3544
  width: r.width === void 0 ? void 0 : `min(${r.width}, 100%)`,
3518
3545
  maxWidth: r.maxWidth === void 0 ? void 0 : `min(${r.maxWidth}, 100%)`,
3519
- renderScrollBar: H ? void 0 : br,
3520
- imageSource: L
3546
+ renderScrollBar: H ? void 0 : Er,
3547
+ scrollBarGutter: H ? void 0 : xr,
3548
+ imageSource: M
3521
3549
  }),
3522
- [M, h, d.documentEmpty, g, l.documentStyles, P, l.embeds, T, r, H, L]
3523
- ), w = F((O, N) => H ? N === null || N.kind === "failure" ? fe(O) : N.name : d.documentRegion, [H, d.documentRegion]), k = H ? "content" : "fill";
3524
- return e === null ? /* @__PURE__ */ c(we, { value: k, children: /* @__PURE__ */ c(ac, { absence: t, announces: i, announceFailure: f }) }) : /* @__PURE__ */ c(we, { value: k, children: /* @__PURE__ */ c(Ie, { fallback: /* @__PURE__ */ c(Vt, { label: w(e, null) }), children: /* @__PURE__ */ c(
3525
- vc,
3550
+ [L, h, d.documentEmpty, g, l.documentStyles, P, l.embeds, T, r, H, M]
3551
+ ), w = F((C, N) => H ? N === null || N.kind === "failure" ? fe(C) : N.name : d.documentRegion, [H, d.documentRegion]), k = H ? "content" : "fill";
3552
+ return e === null ? /* @__PURE__ */ c(we, { value: k, children: /* @__PURE__ */ c(kc, { absence: t, announces: i, announceFailure: f }) }) : /* @__PURE__ */ c(we, { value: k, children: /* @__PURE__ */ c(Ie, { fallback: /* @__PURE__ */ c(Gt, { label: w(e, null) }), children: /* @__PURE__ */ c(
3553
+ Dc,
3526
3554
  {
3527
3555
  requestedPath: e,
3528
3556
  content: _,
@@ -3538,15 +3566,15 @@ const Ji = /* @__PURE__ */ new Map([
3538
3566
  onDocumentShown: u
3539
3567
  }
3540
3568
  ) }) });
3541
- }, bc = ({ path: e, absence: t, markup: n, variant: r, onDocumentShown: o }) => {
3542
- const { config: s, viewSettings: a, announcer: i } = $(), f = Je((I) => I.style), u = Je((I) => I.align), l = ot(), d = Xn(), h = $t(), { view: g, overrides: v, embed: y } = r, T = F(
3569
+ }, Pc = ({ path: e, absence: t, markup: n, variant: r, onDocumentShown: o }) => {
3570
+ const { config: s, viewSettings: a, announcer: i } = $(), f = Je((I) => I.style), u = Je((I) => I.align), l = ot(), d = er(), h = Ft(), { view: g, overrides: v, embed: y } = r, T = F(
3543
3571
  (I) => {
3544
3572
  if (h.kind !== "location") return;
3545
- const _ = sc(s, h.location, I);
3573
+ const _ = yc(s, h.location, I);
3546
3574
  _ !== null && l(_, "browse");
3547
3575
  },
3548
3576
  [s, l, h]
3549
- ), C = F(
3577
+ ), O = F(
3550
3578
  (I) => {
3551
3579
  a.update({ style: I }), T("style");
3552
3580
  },
@@ -3556,10 +3584,10 @@ const Ji = /* @__PURE__ */ new Map([
3556
3584
  a.update({ align: I }), T("align");
3557
3585
  },
3558
3586
  [a, T]
3559
- ), q = $r(s, v.style, f), D = _r(v.align, u), m = X(
3587
+ ), q = zr(s, v.style, f), D = jr(v.align, u), m = X(
3560
3588
  () => ({
3561
3589
  style: q,
3562
- onStyleChange: C,
3590
+ onStyleChange: O,
3563
3591
  align: D,
3564
3592
  onAlignChange: R,
3565
3593
  showToc: y.showToc !== !1,
@@ -3570,11 +3598,11 @@ const Ji = /* @__PURE__ */ new Map([
3570
3598
  maxWidth: y.maxWidth,
3571
3599
  editLayout: "fill"
3572
3600
  }),
3573
- [q, C, D, R, y]
3601
+ [q, O, D, R, y]
3574
3602
  ), p = X(() => ({ kind: "page", view: g, overrides: v, embed: y }), [g, v, y]), x = X(() => ({ kind: "page", fragment: d.hash, navigation: d }), [d]), A = F((I) => i.announce(I), [i]);
3575
- return /* @__PURE__ */ c(Jr, { path: e, absence: t, markup: n, display: m, navigation: p, fragment: x, paneScroll: Ha, announces: !0, announceFailure: A, onDocumentShown: o });
3576
- }, yc = ({ path: e, absence: t, markup: n, variant: r, onDocumentShown: o }) => {
3577
- const { config: s, viewSettings: a } = $(), i = Je((p) => p.style), f = Je((p) => p.align), [u, l] = V(() => $r(s, void 0, i)), d = _r(void 0, f), h = F((p) => a.update({ align: p }), [a]), { maximized: g, onDocumentLink: v, pendingHash: y, onHashConsumed: T, announceFailure: C, paneScroll: R } = r, q = X(
3603
+ return /* @__PURE__ */ c(so, { path: e, absence: t, markup: n, display: m, navigation: p, fragment: x, paneScroll: ri, announces: !0, announceFailure: A, onDocumentShown: o });
3604
+ }, Ic = ({ path: e, absence: t, markup: n, variant: r, onDocumentShown: o }) => {
3605
+ const { config: s, viewSettings: a } = $(), i = Je((p) => p.style), f = Je((p) => p.align), [u, l] = V(() => zr(s, void 0, i)), d = jr(void 0, f), h = F((p) => a.update({ align: p }), [a]), { maximized: g, onDocumentLink: v, pendingHash: y, onHashConsumed: T, announceFailure: O, paneScroll: R } = r, q = X(
3578
3606
  () => ({
3579
3607
  style: u,
3580
3608
  onStyleChange: l,
@@ -3590,9 +3618,9 @@ const Ji = /* @__PURE__ */ new Map([
3590
3618
  }),
3591
3619
  [u, d, h, g]
3592
3620
  ), D = X(() => ({ kind: "panel", onDocumentLink: v }), [v]), m = X(() => ({ kind: "panel", fragment: y, consume: T }), [y, T]);
3593
- return /* @__PURE__ */ c(Jr, { path: e, absence: t, markup: n, display: q, navigation: D, fragment: m, paneScroll: R, announces: !1, announceFailure: C, onDocumentShown: o });
3594
- }, kc = ({ path: e, absence: t, markup: n, variant: r, onDocumentShown: o }) => r.kind === "page" ? /* @__PURE__ */ c(bc, { path: e, absence: t, markup: n, variant: r, onDocumentShown: o }) : /* @__PURE__ */ c(yc, { path: e, absence: t, markup: n, variant: r, onDocumentShown: o });
3595
- function Ec({
3621
+ return /* @__PURE__ */ c(so, { path: e, absence: t, markup: n, display: q, navigation: D, fragment: m, paneScroll: R, announces: !1, announceFailure: O, onDocumentShown: o });
3622
+ }, $c = ({ path: e, absence: t, markup: n, variant: r, onDocumentShown: o }) => r.kind === "page" ? /* @__PURE__ */ c(Pc, { path: e, absence: t, markup: n, variant: r, onDocumentShown: o }) : /* @__PURE__ */ c(Ic, { path: e, absence: t, markup: n, variant: r, onDocumentShown: o });
3623
+ function _c({
3596
3624
  title: e,
3597
3625
  titleId: t,
3598
3626
  ...n
@@ -3613,8 +3641,8 @@ function Ec({
3613
3641
  clipRule: "evenodd"
3614
3642
  }));
3615
3643
  }
3616
- const Sc = /* @__PURE__ */ E.forwardRef(Ec);
3617
- function xc({
3644
+ const Fc = /* @__PURE__ */ E.forwardRef(_c);
3645
+ function qc({
3618
3646
  title: e,
3619
3647
  titleId: t,
3620
3648
  ...n
@@ -3635,8 +3663,8 @@ function xc({
3635
3663
  clipRule: "evenodd"
3636
3664
  }));
3637
3665
  }
3638
- const Qr = /* @__PURE__ */ E.forwardRef(xc);
3639
- function Tc({
3666
+ const ao = /* @__PURE__ */ E.forwardRef(qc);
3667
+ function Bc({
3640
3668
  title: e,
3641
3669
  titleId: t,
3642
3670
  ...n
@@ -3657,8 +3685,8 @@ function Tc({
3657
3685
  clipRule: "evenodd"
3658
3686
  }));
3659
3687
  }
3660
- const Rc = /* @__PURE__ */ E.forwardRef(Tc);
3661
- function Oc({
3688
+ const Uc = /* @__PURE__ */ E.forwardRef(Bc);
3689
+ function Hc({
3662
3690
  title: e,
3663
3691
  titleId: t,
3664
3692
  ...n
@@ -3683,8 +3711,8 @@ function Oc({
3683
3711
  clipRule: "evenodd"
3684
3712
  }));
3685
3713
  }
3686
- const Cc = /* @__PURE__ */ E.forwardRef(Oc);
3687
- function Mc({
3714
+ const zc = /* @__PURE__ */ E.forwardRef(Hc);
3715
+ function jc({
3688
3716
  title: e,
3689
3717
  titleId: t,
3690
3718
  ...n
@@ -3705,8 +3733,8 @@ function Mc({
3705
3733
  clipRule: "evenodd"
3706
3734
  }));
3707
3735
  }
3708
- const Lc = /* @__PURE__ */ E.forwardRef(Mc);
3709
- function Ac({
3736
+ const Vc = /* @__PURE__ */ E.forwardRef(jc);
3737
+ function Zc({
3710
3738
  title: e,
3711
3739
  titleId: t,
3712
3740
  ...n
@@ -3729,8 +3757,8 @@ function Ac({
3729
3757
  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"
3730
3758
  }));
3731
3759
  }
3732
- const Nc = /* @__PURE__ */ E.forwardRef(Ac);
3733
- function Dc({
3760
+ const Wc = /* @__PURE__ */ E.forwardRef(Zc);
3761
+ function Gc({
3734
3762
  title: e,
3735
3763
  titleId: t,
3736
3764
  ...n
@@ -3753,8 +3781,8 @@ function Dc({
3753
3781
  clipRule: "evenodd"
3754
3782
  }));
3755
3783
  }
3756
- const Pc = /* @__PURE__ */ E.forwardRef(Dc);
3757
- function Ic({
3784
+ const Kc = /* @__PURE__ */ E.forwardRef(Gc);
3785
+ function Yc({
3758
3786
  title: e,
3759
3787
  titleId: t,
3760
3788
  ...n
@@ -3775,8 +3803,8 @@ function Ic({
3775
3803
  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"
3776
3804
  }));
3777
3805
  }
3778
- const $c = /* @__PURE__ */ E.forwardRef(Ic);
3779
- function _c({
3806
+ const Xc = /* @__PURE__ */ E.forwardRef(Yc);
3807
+ function Jc({
3780
3808
  title: e,
3781
3809
  titleId: t,
3782
3810
  ...n
@@ -3795,7 +3823,7 @@ function _c({
3795
3823
  d: "M15 3.75H9v16.5h6V3.75ZM16.5 20.25h3.375c1.035 0 1.875-.84 1.875-1.875V5.625c0-1.036-.84-1.875-1.875-1.875H16.5v16.5ZM4.125 3.75H7.5v16.5H4.125a1.875 1.875 0 0 1-1.875-1.875V5.625c0-1.036.84-1.875 1.875-1.875Z"
3796
3824
  }));
3797
3825
  }
3798
- const Fc = /* @__PURE__ */ E.forwardRef(_c), qc = ({ href: e, onRetry: t, testId: n }) => {
3826
+ const Qc = /* @__PURE__ */ E.forwardRef(Jc), ed = ({ href: e, onRetry: t, testId: n }) => {
3799
3827
  const { labels: r, onEditGrant: o } = $(), [s, a] = V(!1), i = () => {
3800
3828
  o === void 0 || s || (a(!0), o(e).then((f) => {
3801
3829
  f && t();
@@ -3811,23 +3839,23 @@ const Fc = /* @__PURE__ */ E.forwardRef(_c), qc = ({ href: e, onRetry: t, testId
3811
3839
  /* @__PURE__ */ c("button", { type: "button", className: "aqmx-callout-action", "data-testid": `${n}-retry`, onClick: t, children: r.editGrantRetry })
3812
3840
  ] })
3813
3841
  ] });
3814
- }, Bc = "Control+E Meta+E", Uc = (e, t, n) => n && t ? "split" : e.view, Bn = (e, t, n, r) => {
3842
+ }, td = "Control+E Meta+E", nd = (e, t, n) => n && t ? "split" : e.view, zn = (e, t, n, r) => {
3815
3843
  if (n === "split") {
3816
3844
  e.setSideBySide(!0);
3817
3845
  return;
3818
3846
  }
3819
3847
  e.setView(t, n), r && e.sideBySide() && e.setSideBySide(!1);
3820
- }, ou = (e) => e === "split" ? null : e, Hc = (e) => e === "preview" ? "editor" : "preview", zc = (e) => /Mac|iPhone|iPad|iPod/u.test(e), jc = (e, t) => {
3848
+ }, ku = (e) => e === "split" ? null : e, rd = (e) => e === "preview" ? "editor" : "preview", od = (e) => /Mac|iPhone|iPad|iPod/u.test(e), sd = (e, t) => {
3821
3849
  if (e.isComposing || e.altKey || e.shiftKey || (t ? !e.metaKey || e.ctrlKey : !e.ctrlKey || e.metaKey)) return !1;
3822
3850
  const n = e.key.toLowerCase();
3823
3851
  return n === "e" || e.code === "KeyE" && /^\p{L}$/u.test(n) && !/^[a-z]$/u.test(n);
3824
- }, Un = (e, t, n) => {
3852
+ }, jn = (e, t, n) => {
3825
3853
  const r = e.modifiedAt === null ? Number.NaN : Date.parse(e.modifiedAt);
3826
3854
  return n(Number.isNaN(r) ? e.id : t.format(r), e.author === null ? "" : e.author);
3827
- }, Vc = ({ path: e, documentName: t, open: n, onClose: r }) => {
3828
- const { data: o, edits: s, labels: a, locale: i, announcer: f } = $(), u = Te(), [l, d] = V(null), [h, g] = V(0), [v, y] = V(null), [T, C] = V(null), R = X(() => new Intl.DateTimeFormat(i, { dateStyle: "medium", timeStyle: "short" }), [i]), q = F(() => {
3829
- y(null), C(null);
3830
- }, []), D = fr({ open: n, onOpen: q, onDismiss: r });
3855
+ }, ad = ({ path: e, documentName: t, open: n, onClose: r }) => {
3856
+ const { data: o, edits: s, labels: a, locale: i, announcer: f } = $(), u = Te(), [l, d] = V(null), [h, g] = V(0), [v, y] = V(null), [T, O] = V(null), R = X(() => new Intl.DateTimeFormat(i, { dateStyle: "medium", timeStyle: "short" }), [i]), q = F(() => {
3857
+ y(null), O(null);
3858
+ }, []), D = pr({ open: n, onOpen: q, onDismiss: r });
3831
3859
  ee(() => {
3832
3860
  if (!n) return;
3833
3861
  const x = new AbortController();
@@ -3837,8 +3865,8 @@ const Fc = /* @__PURE__ */ E.forwardRef(_c), qc = ({ href: e, onRetry: t, testId
3837
3865
  }, [n, o, e, h]), ee(() => {
3838
3866
  if (!n || v === null) return;
3839
3867
  const x = new AbortController();
3840
- return C(null), o.revision(e, v, x.signal).then((A) => {
3841
- "kind" in A && C(A);
3868
+ return O(null), o.revision(e, v, x.signal).then((A) => {
3869
+ "kind" in A && O(A);
3842
3870
  }), () => x.abort();
3843
3871
  }, [n, o, e, v]);
3844
3872
  const m = () => {
@@ -3847,25 +3875,25 @@ const Fc = /* @__PURE__ */ E.forwardRef(_c), qc = ({ href: e, onRetry: t, testId
3847
3875
  return /* @__PURE__ */ c("dialog", { ...D, className: "aqmx-confirm aqmx-history", "aria-labelledby": u, "data-testid": "markdown-explorer-history", children: /* @__PURE__ */ B("div", { className: "aqmx-confirm-panel aqmx-history-panel", children: [
3848
3876
  /* @__PURE__ */ c("p", { id: u, className: "aqmx-confirm-title", children: a.historyTitle(t) }),
3849
3877
  l === null ? /* @__PURE__ */ c("p", { className: "aqmx-history-note", "data-testid": "markdown-explorer-history-loading", children: a.historyLoading }) : l.kind === "failure" ? /* @__PURE__ */ c(Re, { failure: l.failure, alert: !1, onRetry: () => g((x) => x + 1), testId: "markdown-explorer-history-failure" }) : l.revisions.length === 0 ? /* @__PURE__ */ c("p", { className: "aqmx-history-note", "data-testid": "markdown-explorer-history-empty", children: a.historyEmpty }) : /* @__PURE__ */ c("ul", { className: "aqmx-history-list", "data-testid": "markdown-explorer-history-list", children: l.revisions.map((x) => /* @__PURE__ */ c("li", { children: /* @__PURE__ */ B("button", { type: "button", className: "aqmx-history-entry", "aria-pressed": x.id === v, "data-testid": "markdown-explorer-history-entry", onClick: () => y(x.id), children: [
3850
- /* @__PURE__ */ c("span", { children: Un(x, R, a.historyEntry) }),
3878
+ /* @__PURE__ */ c("span", { children: jn(x, R, a.historyEntry) }),
3851
3879
  x.current ? /* @__PURE__ */ c("span", { className: "aqmx-history-mark", children: a.historyCurrent }) : null,
3852
3880
  x.kept ? /* @__PURE__ */ c("span", { className: "aqmx-history-mark", children: a.historyKept }) : null
3853
3881
  ] }) }, x.id)) }),
3854
3882
  v === null ? null : T === null ? /* @__PURE__ */ c("p", { className: "aqmx-history-note", children: a.historyLoading }) : T.kind === "failure" ? /* @__PURE__ */ c(Re, { failure: T.failure, alert: !1, testId: "markdown-explorer-history-revision-failure" }) : (
3855
- /* @__PURE__ */ c("section", { className: "aqmx-history-text", tabIndex: 0, "aria-label": p === void 0 ? a.historyTitle(t) : Un(p, R, a.historyEntry), "data-testid": "markdown-explorer-history-text", children: /* @__PURE__ */ c("pre", { children: T.text }) })
3883
+ /* @__PURE__ */ c("section", { className: "aqmx-history-text", tabIndex: 0, "aria-label": p === void 0 ? a.historyTitle(t) : jn(p, R, a.historyEntry), "data-testid": "markdown-explorer-history-text", children: /* @__PURE__ */ c("pre", { children: T.text }) })
3856
3884
  ),
3857
3885
  /* @__PURE__ */ B("div", { className: "aqmx-confirm-actions", children: [
3858
3886
  /* @__PURE__ */ c("button", { type: "button", className: "aqmx-callout-action", "data-testid": "markdown-explorer-history-close", onClick: r, children: a.historyClose }),
3859
3887
  /* @__PURE__ */ c("button", { type: "button", className: "aqmx-callout-action", "aria-disabled": T === null || T.kind !== "revision", "data-testid": "markdown-explorer-history-restore", onClick: m, children: a.historyRestore })
3860
3888
  ] })
3861
3889
  ] }) });
3862
- }, Zc = (e) => {
3863
- const { documents: t } = $(), n = F(() => t.peek(e), [t, e]), r = F(() => t.peekSeeded(e), [t, e]), o = oe(t.subscribe, n, r), s = ge(o)?.document;
3890
+ }, id = (e) => {
3891
+ const { documents: t } = $(), n = F(() => t.peek(e), [t, e]), r = F(() => t.peekSeeded(e), [t, e]), o = re(t.subscribe, n, r), s = ge(o)?.document;
3864
3892
  return s === void 0 || s.kind === "failure" ? { edit: null, name: fe(e) } : { edit: s.kind === "markdown" || s.kind === "spreadsheet" ? s.edit : null, name: s.name };
3865
3893
  }, me = (e) => {
3866
3894
  e.stopPropagation();
3867
- }, Wc = ({ path: e, documentName: t, iconOnly: n, previewAvailable: r, draft: o }) => {
3868
- const { draftConverter: s, edits: a, labels: i } = $(), f = oe(
3895
+ }, ld = ({ path: e, documentName: t, iconOnly: n, previewAvailable: r, draft: o }) => {
3896
+ const { draftConverter: s, edits: a, labels: i } = $(), f = re(
3869
3897
  a.subscribe,
3870
3898
  () => a.session(e) !== void 0,
3871
3899
  () => !1
@@ -3878,7 +3906,7 @@ const Fc = /* @__PURE__ */ E.forwardRef(_c), qc = ({ href: e, onRetry: t, testId
3878
3906
  const y = a.session(e);
3879
3907
  y?.dirty === !0 ? l(y.save.kind === "draft" ? "draft" : "unsaved") : a.close(e);
3880
3908
  }, h = () => {
3881
- f || (js(), r && a.sideBySide() && s?.prepare?.());
3909
+ f || (Qs(), r && a.sideBySide() && s?.prepare?.());
3882
3910
  }, g = n ? o ? i.editDraftDocumentNamed(t) : i.editDocumentNamed(t) : null, v = o ? i.editDraftDocument : i.editDocument;
3883
3911
  return /* @__PURE__ */ B(pe, { children: [
3884
3912
  /* @__PURE__ */ B(
@@ -3895,13 +3923,13 @@ const Fc = /* @__PURE__ */ E.forwardRef(_c), qc = ({ href: e, onRetry: t, testId
3895
3923
  onPointerEnter: h,
3896
3924
  onFocus: h,
3897
3925
  children: [
3898
- /* @__PURE__ */ c($c, { "aria-hidden": "true" }),
3926
+ /* @__PURE__ */ c(Xc, { "aria-hidden": "true" }),
3899
3927
  g === null ? /* @__PURE__ */ c("span", { children: i.editDocumentLabel }) : null
3900
3928
  ]
3901
3929
  }
3902
3930
  ),
3903
3931
  /* @__PURE__ */ c(
3904
- mr,
3932
+ gr,
3905
3933
  {
3906
3934
  open: u !== null,
3907
3935
  title: u === "draft" ? i.draftDiscardTitle : i.unsavedTitle,
@@ -3916,7 +3944,7 @@ const Fc = /* @__PURE__ */ E.forwardRef(_c), qc = ({ href: e, onRetry: t, testId
3916
3944
  }
3917
3945
  )
3918
3946
  ] });
3919
- }, Gc = ({ href: e, documentName: t, iconOnly: n }) => {
3947
+ }, cd = ({ href: e, documentName: t, iconOnly: n }) => {
3920
3948
  const { labels: r } = $(), o = n ? r.editExternallyNamed(t) : null;
3921
3949
  return /* @__PURE__ */ B(
3922
3950
  "a",
@@ -3930,29 +3958,29 @@ const Fc = /* @__PURE__ */ E.forwardRef(_c), qc = ({ href: e, onRetry: t, testId
3930
3958
  "data-testid": "markdown-explorer-document-edit-external",
3931
3959
  onDoubleClick: me,
3932
3960
  children: [
3933
- /* @__PURE__ */ c(Rc, { "aria-hidden": "true" }),
3961
+ /* @__PURE__ */ c(Uc, { "aria-hidden": "true" }),
3934
3962
  o === null ? /* @__PURE__ */ c("span", { children: r.editExternallyLabel }) : null
3935
3963
  ]
3936
3964
  }
3937
3965
  );
3938
- }, Kc = ({ session: e }) => {
3939
- const { labels: t } = $(), n = ms(t, e);
3966
+ }, dd = ({ session: e }) => {
3967
+ const { labels: t } = $(), n = Es(t, e);
3940
3968
  return /* @__PURE__ */ c("p", { className: "aqmx-edit-status", title: n === "" ? void 0 : n, "data-testid": "markdown-explorer-edit-status", "data-aqmx-save": e.save.kind, children: n });
3941
- }, Yc = Object.freeze(["editor", "split", "preview"]), Xc = Object.freeze(["editor", "preview"]), Jc = Object.freeze({ editor: Qr, split: Fc, preview: Pc }), Qc = ({ path: e, documentName: t, iconOnly: n, session: r, previewAvailable: o }) => {
3942
- const { draftConverter: s, edits: a, labels: i } = $(), f = qs(), u = Uc(r, f, o), l = o ? Yc : Xc, d = Te(), h = U(/* @__PURE__ */ new Map()), g = {
3969
+ }, ud = Object.freeze(["editor", "split", "preview"]), fd = Object.freeze(["editor", "preview"]), md = Object.freeze({ editor: ao, split: Qc, preview: Kc }), hd = ({ path: e, documentName: t, iconOnly: n, session: r, previewAvailable: o }) => {
3970
+ const { draftConverter: s, edits: a, labels: i } = $(), f = Gs(), u = nd(r, f, o), l = o ? ud : fd, d = Te(), h = U(/* @__PURE__ */ new Map()), g = {
3943
3971
  editor: { label: i.editViewEditor, tooltip: i.editViewEditorTooltip },
3944
3972
  split: { label: i.editViewSplit, tooltip: i.editViewSplitTooltip },
3945
3973
  preview: { label: i.editViewPreview, tooltip: i.editViewPreviewTooltip }
3946
3974
  }, v = () => {
3947
3975
  a.preparePreview(e), s?.prepare?.();
3948
3976
  }, y = (T) => {
3949
- if (!jc(T.nativeEvent, zc(navigator.platform))) return;
3950
- dr(T);
3951
- const C = Hc(u);
3952
- Bn(a, e, C, o), h.current.get(C)?.focus();
3977
+ if (!sd(T.nativeEvent, od(navigator.platform))) return;
3978
+ mr(T);
3979
+ const O = rd(u);
3980
+ zn(a, e, O, o), h.current.get(O)?.focus();
3953
3981
  };
3954
3982
  return /* @__PURE__ */ c("div", { role: "radiogroup", "aria-label": n ? i.editViewNamed(t) : i.editView, className: "aqmx-edit-view", "data-testid": "markdown-explorer-edit-view", onKeyDown: y, children: l.map((T) => {
3955
- const C = Jc[T], { label: R, tooltip: q } = g[T], D = T === "preview" ? v : void 0;
3983
+ const O = md[T], { label: R, tooltip: q } = g[T], D = T === "preview" ? v : void 0;
3956
3984
  return /* @__PURE__ */ B("label", { className: n ? "aqmx-icon-button" : "aqmx-icon-button aqmx-labelled-button", children: [
3957
3985
  /* @__PURE__ */ c(
3958
3986
  "input",
@@ -3965,20 +3993,20 @@ const Fc = /* @__PURE__ */ E.forwardRef(_c), qc = ({ href: e, onRetry: t, testId
3965
3993
  value: T,
3966
3994
  checked: T === u,
3967
3995
  "aria-label": R,
3968
- "aria-keyshortcuts": T === "split" ? void 0 : Bc,
3996
+ "aria-keyshortcuts": T === "split" ? void 0 : td,
3969
3997
  title: q,
3970
3998
  "data-testid": `markdown-explorer-edit-view-${T}`,
3971
- onChange: () => Bn(a, e, T, o),
3999
+ onChange: () => zn(a, e, T, o),
3972
4000
  onDoubleClick: me,
3973
4001
  onPointerEnter: D,
3974
4002
  onFocus: D
3975
4003
  }
3976
4004
  ),
3977
- /* @__PURE__ */ c(C, { "aria-hidden": "true" }),
4005
+ /* @__PURE__ */ c(O, { "aria-hidden": "true" }),
3978
4006
  n ? null : /* @__PURE__ */ c("span", { children: R })
3979
4007
  ] }, T);
3980
4008
  }) });
3981
- }, ed = ({ path: e, documentName: t, iconOnly: n, session: r, previewAvailable: o }) => {
4009
+ }, pd = ({ path: e, documentName: t, iconOnly: n, session: r, previewAvailable: o }) => {
3982
4010
  const { edits: s, labels: a } = $(), [i, f] = V(!1);
3983
4011
  if (r.phase.kind !== "editing") return null;
3984
4012
  const u = r.save.kind === "saving", l = u || !r.dirty, d = () => {
@@ -3988,35 +4016,35 @@ const Fc = /* @__PURE__ */ E.forwardRef(_c), qc = ({ href: e, onRetry: t, testId
3988
4016
  }, h = (g) => n ? { className: "aqmx-icon-button", "aria-label": g } : { className: "aqmx-icon-button aqmx-labelled-button" };
3989
4017
  return /* @__PURE__ */ B(pe, { children: [
3990
4018
  r.save.kind === "conflicts" ? /* @__PURE__ */ B("button", { type: "button", ...h(a.conflictNext), title: a.conflictNext, "data-testid": "markdown-explorer-edit-next-conflict", onClick: () => s.nextConflict(e), onDoubleClick: me, children: [
3991
- /* @__PURE__ */ c(Cc, { "aria-hidden": "true" }),
4019
+ /* @__PURE__ */ c(zc, { "aria-hidden": "true" }),
3992
4020
  n ? null : /* @__PURE__ */ c("span", { children: a.conflictNext })
3993
4021
  ] }) : null,
3994
- /* @__PURE__ */ c(Qc, { path: e, documentName: t, iconOnly: n, session: r, previewAvailable: o }),
4022
+ /* @__PURE__ */ c(hd, { path: e, documentName: t, iconOnly: n, session: r, previewAvailable: o }),
3995
4023
  r.history ? /* @__PURE__ */ B("button", { type: "button", ...h(a.historyOpen), title: a.historyOpen, "aria-haspopup": "dialog", "data-testid": "markdown-explorer-edit-history", onClick: () => f(!0), onDoubleClick: me, children: [
3996
- /* @__PURE__ */ c(Lc, { "aria-hidden": "true" }),
4024
+ /* @__PURE__ */ c(Vc, { "aria-hidden": "true" }),
3997
4025
  n ? null : /* @__PURE__ */ c("span", { children: a.historyOpen })
3998
4026
  ] }) : null,
3999
4027
  r.save.kind === "draft" ? null : /* @__PURE__ */ B("button", { type: "button", ...h(a.saveDraft), title: a.saveDraftTooltip, "aria-disabled": l, "aria-busy": u, "aria-keyshortcuts": "Control+S Meta+S", "data-testid": "markdown-explorer-edit-save", onClick: d, onDoubleClick: me, children: [
4000
- /* @__PURE__ */ c(Nc, { "aria-hidden": "true" }),
4028
+ /* @__PURE__ */ c(Wc, { "aria-hidden": "true" }),
4001
4029
  n ? null : /* @__PURE__ */ c("span", { children: a.saveDraft })
4002
4030
  ] }),
4003
- r.history ? /* @__PURE__ */ c(Vc, { path: e, documentName: t, open: i, onClose: () => f(!1) }) : null
4031
+ r.history ? /* @__PURE__ */ c(ad, { path: e, documentName: t, open: i, onClose: () => f(!1) }) : null
4004
4032
  ] });
4005
- }, td = ({ path: e, session: t }) => {
4033
+ }, gd = ({ path: e, session: t }) => {
4006
4034
  const { edits: n } = $();
4007
- return t.save.kind !== "grant" ? null : /* @__PURE__ */ c(qc, { href: t.save.href, onRetry: () => {
4035
+ return t.save.kind !== "grant" ? null : /* @__PURE__ */ c(ed, { href: t.save.href, onRetry: () => {
4008
4036
  n.save(e);
4009
4037
  }, testId: "markdown-explorer-save-grant" });
4010
- }, nd = /* @__PURE__ */ new Set(), rd = (e, t, n) => {
4011
- const { documents: r, announcer: o, labels: s } = $(), a = F(() => r.peek(e), [r, e]), i = F(() => r.peekSeeded(e), [r, e]), f = oe(r.subscribe, a, i), u = F(() => r.answerStampOf(e), [r, e]), l = oe(r.subscribe, u, u), [d] = V(() => /* @__PURE__ */ new Set()), [h, g] = V(nd), [v, y] = V(null);
4038
+ }, wd = /* @__PURE__ */ new Set(), vd = (e, t, n) => {
4039
+ const { documents: r, announcer: o, labels: s } = $(), a = F(() => r.peek(e), [r, e]), i = F(() => r.peekSeeded(e), [r, e]), f = re(r.subscribe, a, i), u = F(() => r.answerStampOf(e), [r, e]), l = re(r.subscribe, u, u), [d] = V(() => /* @__PURE__ */ new Set()), [h, g] = V(wd), [v, y] = V(null);
4012
4040
  v !== null && (v.path !== e || v.markup !== n) && y(null);
4013
4041
  const T = U(null);
4014
4042
  Y(() => (T.current = e, () => {
4015
4043
  T.current = null;
4016
4044
  }), [e]);
4017
- const C = U(n);
4045
+ const O = U(n);
4018
4046
  Y(() => {
4019
- C.current = n;
4047
+ O.current = n;
4020
4048
  }, [n]);
4021
4049
  const R = F(() => {
4022
4050
  const m = e, p = r.peek(m);
@@ -4025,7 +4053,7 @@ const Fc = /* @__PURE__ */ E.forwardRef(_c), qc = ({ href: e, onRetry: t, testId
4025
4053
  const x = await r.refresh(m);
4026
4054
  if (T.current !== m || x.status === "superseded") return;
4027
4055
  if (x.status === "failed") {
4028
- y({ path: m, failure: x.failure, stamp: r.answerStampOf(m), markup: C.current }), o.announce(s.documentRefreshFailed(de(s, x.failure.reason)));
4056
+ y({ path: m, failure: x.failure, stamp: r.answerStampOf(m), markup: O.current }), o.announce(s.documentRefreshFailed(de(s, x.failure.reason)));
4029
4057
  return;
4030
4058
  }
4031
4059
  if (x.status === "shown" && (t || x.failed)) return;
@@ -4038,7 +4066,7 @@ const Fc = /* @__PURE__ */ E.forwardRef(_c), qc = ({ href: e, onRetry: t, testId
4038
4066
  })());
4039
4067
  }, [e, t, d, r, o, s]), q = h.has(e), D = v !== null && v.path === e && v.stamp === l && v.markup === n ? v.failure : null;
4040
4068
  return { refreshing: q, unavailable: q || f?.status === "pending", failure: D, refresh: R };
4041
- }, od = (e, t) => {
4069
+ }, bd = (e, t) => {
4042
4070
  switch (t) {
4043
4071
  case "markdown":
4044
4072
  return e.showMarkup;
@@ -4048,30 +4076,30 @@ const Fc = /* @__PURE__ */ E.forwardRef(_c), qc = ({ href: e, onRetry: t, testId
4048
4076
  case "tsv":
4049
4077
  return e.showSpreadsheetMarkup(t.toUpperCase());
4050
4078
  }
4051
- }, sd = Object.freeze({ kind: "page" }), ad = ({ path: e, placement: t, markup: n }) => {
4052
- const { labels: r } = $(), { refreshing: o, unavailable: s, failure: a, refresh: i } = rd(e, t.kind === "page", n.shown), f = Ii(e), u = Zc(e), l = pr(e), d = t.kind === "panel" ? r.refreshDocumentNamed(t.documentName) : null, h = t.kind === "panel" ? r.showMarkupNamed(t.documentName) : null, g = t.kind === "panel", v = t.kind === "panel" ? t.documentName : u.name, y = t.kind === "page" || t.maximized;
4079
+ }, yd = Object.freeze({ kind: "page" }), kd = ({ path: e, placement: t, markup: n }) => {
4080
+ const { labels: r } = $(), { refreshing: o, unavailable: s, failure: a, refresh: i } = vd(e, t.kind === "page", n.shown), f = Yi(e), u = id(e), l = vr(e), d = t.kind === "panel" ? r.refreshDocumentNamed(t.documentName) : null, h = t.kind === "panel" ? r.showMarkupNamed(t.documentName) : null, g = t.kind === "panel", v = t.kind === "panel" ? t.documentName : u.name, y = t.kind === "page" || t.maximized;
4053
4081
  return /* @__PURE__ */ B("div", { className: "aqmx-document-refresh-bar", "data-testid": "markdown-explorer-document-refresh-bar", "data-aqmx-editing": l === void 0 ? void 0 : "true", children: [
4054
4082
  /* @__PURE__ */ B("div", { className: "aqmx-document-refresh-row", children: [
4055
- l === void 0 ? null : /* @__PURE__ */ c(Kc, { session: l }),
4056
- l === void 0 ? null : /* @__PURE__ */ c(ed, { path: e, documentName: v, iconOnly: g, session: l, previewAvailable: y }),
4083
+ l === void 0 ? null : /* @__PURE__ */ c(dd, { session: l }),
4084
+ l === void 0 ? null : /* @__PURE__ */ c(pd, { path: e, documentName: v, iconOnly: g, session: l, previewAvailable: y }),
4057
4085
  l === void 0 && f !== null ? /* @__PURE__ */ B(
4058
4086
  "button",
4059
4087
  {
4060
4088
  type: "button",
4061
4089
  className: h === null ? "aqmx-icon-button aqmx-labelled-button" : "aqmx-icon-button",
4062
- title: h === null ? od(r, f) : h,
4090
+ title: h === null ? bd(r, f) : h,
4063
4091
  "aria-label": h === null ? void 0 : h,
4064
4092
  "aria-pressed": n.shown,
4065
4093
  "data-testid": "markdown-explorer-document-markup",
4066
4094
  onClick: n.toggle,
4067
4095
  onDoubleClick: me,
4068
4096
  children: [
4069
- /* @__PURE__ */ c(Qr, { "aria-hidden": "true" }),
4097
+ /* @__PURE__ */ c(ao, { "aria-hidden": "true" }),
4070
4098
  h === null ? /* @__PURE__ */ c("span", { children: r.showMarkupLabel }) : null
4071
4099
  ]
4072
4100
  }
4073
4101
  ) : null,
4074
- l !== void 0 || u.edit?.kind === "inline" || u.edit?.kind === "draft" ? /* @__PURE__ */ c(Wc, { path: e, documentName: v, iconOnly: g, previewAvailable: y, draft: u.edit?.kind === "draft" }) : u.edit?.kind === "external" ? /* @__PURE__ */ c(Gc, { href: u.edit.href, documentName: v, iconOnly: g }) : null,
4102
+ l !== void 0 || u.edit?.kind === "inline" || u.edit?.kind === "draft" ? /* @__PURE__ */ c(ld, { path: e, documentName: v, iconOnly: g, previewAvailable: y, draft: u.edit?.kind === "draft" }) : u.edit?.kind === "external" ? /* @__PURE__ */ c(cd, { href: u.edit.href, documentName: v, iconOnly: g }) : null,
4075
4103
  l === void 0 ? /* @__PURE__ */ B(
4076
4104
  "button",
4077
4105
  {
@@ -4086,27 +4114,27 @@ const Fc = /* @__PURE__ */ E.forwardRef(_c), qc = ({ href: e, onRetry: t, testId
4086
4114
  onClick: i,
4087
4115
  onDoubleClick: me,
4088
4116
  children: [
4089
- /* @__PURE__ */ c(Sc, { "aria-hidden": "true" }),
4117
+ /* @__PURE__ */ c(Fc, { "aria-hidden": "true" }),
4090
4118
  d === null ? /* @__PURE__ */ c("span", { children: r.refreshDocumentLabel }) : null
4091
4119
  ]
4092
4120
  }
4093
4121
  ) : null
4094
4122
  ] }),
4095
4123
  l !== void 0 || a === null ? null : /* @__PURE__ */ c("p", { className: "aqmx-document-refresh-failure", "data-testid": "markdown-explorer-document-refresh-failure", "data-aqmx-failure": a.reason, children: r.documentRefreshFailed(de(r, a.reason)) }),
4096
- l === void 0 ? null : /* @__PURE__ */ c(td, { path: e, session: l })
4124
+ l === void 0 ? null : /* @__PURE__ */ c(gd, { path: e, session: l })
4097
4125
  ] });
4098
- }, id = ({ location: e }) => {
4099
- const t = e.doc, n = X(() => ({ kind: "page", view: "single", overrides: e.overrides, embed: e.embed }), [e.overrides, e.embed]), r = $i(e);
4100
- return /* @__PURE__ */ B("div", { className: "aqmx-single aqmx-document-column", "data-testid": "markdown-explorer-single", ...Ct, children: [
4101
- /* @__PURE__ */ c(ad, { path: t, placement: sd, markup: r }),
4102
- /* @__PURE__ */ c(kc, { path: t, absence: oc, markup: e.markup, variant: n })
4126
+ }, Ed = ({ location: e }) => {
4127
+ const t = e.doc, n = X(() => ({ kind: "page", view: "single", overrides: e.overrides, embed: e.embed }), [e.overrides, e.embed]), r = Xi(e);
4128
+ return /* @__PURE__ */ B("div", { className: "aqmx-single aqmx-document-column", "data-testid": "markdown-explorer-single", ...Lt, children: [
4129
+ /* @__PURE__ */ c(kd, { path: t, placement: yd, markup: r }),
4130
+ /* @__PURE__ */ c($c, { path: t, absence: bc, markup: e.markup, variant: n })
4103
4131
  ] });
4104
- }, ld = ({ holds: e, testId: t }) => {
4132
+ }, Sd = ({ holds: e, testId: t }) => {
4105
4133
  const { labels: n, announcer: r } = $(), o = Te();
4106
4134
  Y(() => e ? r.claim(o) : void 0, [e, r, o]);
4107
- const s = F(() => r.shownIn(o), [r, o]), a = oe(r.subscribe, s, s);
4135
+ const s = F(() => r.shownIn(o), [r, o]), a = re(r.subscribe, s, s);
4108
4136
  return /* @__PURE__ */ c("div", { className: "aqmx-sr-only", role: "status", "aria-live": "polite", "aria-atomic": "true", "data-testid": t, children: a.length > 1 ? n.announcementSequence(a) : a[0] });
4109
- }, ke = Object.freeze([]), cd = (e) => {
4137
+ }, ke = Object.freeze([]), xd = (e) => {
4110
4138
  const t = /* @__PURE__ */ new Set();
4111
4139
  let n = ke, r = [], o = !1;
4112
4140
  const s = [], a = (l) => {
@@ -4141,16 +4169,16 @@ const Fc = /* @__PURE__ */ E.forwardRef(_c), qc = ({ href: e, onRetry: t, testId
4141
4169
  },
4142
4170
  shownIn: (l) => i() === l ? n : ke
4143
4171
  };
4144
- }, ue = Object.freeze({ status: "cancelled" }), Hn = (e) => {
4172
+ }, ue = Object.freeze({ status: "cancelled" }), Vn = (e) => {
4145
4173
  if (e === null || typeof e != "object") return null;
4146
4174
  const { failure: t } = e;
4147
- if (Do(t) !== null) return null;
4175
+ if (Ho(t) !== null) return null;
4148
4176
  const { reason: n, code: r } = t;
4149
- return Po(n, r);
4150
- }, dd = ({ dataPath: e, onScope: t, fetch: n }) => {
4177
+ return zo(n, r);
4178
+ }, Td = ({ dataPath: e, onScope: t, fetch: n }) => {
4151
4179
  const r = n ?? ((l, d) => globalThis.fetch(l, d)), o = (l, d) => `${e}/${l}?${new URLSearchParams(d).toString()}`, s = (l) => {
4152
4180
  l.status === 401 && t(null);
4153
- const d = l.headers.get(No);
4181
+ const d = l.headers.get(Uo);
4154
4182
  d !== null && t(d);
4155
4183
  }, a = async (l, d, h, g) => {
4156
4184
  let v;
@@ -4173,29 +4201,29 @@ const Fc = /* @__PURE__ */ E.forwardRef(_c), qc = ({ href: e, onRetry: t, testId
4173
4201
  T = !1;
4174
4202
  }
4175
4203
  if (T) return y;
4176
- const C = Hn(y);
4177
- return g(C !== null ? C : { reason: v.status === 200 ? "failed" : dt(v.status) });
4178
- }, i = { [on]: qo }, f = { [on]: jo, "Content-Type": `${zo}; charset=utf-8` }, u = async (l, d, h) => {
4204
+ const O = Vn(y);
4205
+ return g(O !== null ? O : { reason: v.status === 200 ? "failed" : dt(v.status) });
4206
+ }, i = { [ln]: Go }, f = { [ln]: Qo, "Content-Type": `${Jo}; charset=utf-8` }, u = async (l, d, h) => {
4179
4207
  const g = await a(l, d, h, (v) => ut(v.reason, v.code));
4180
4208
  return d.signal.aborted ? ue : g;
4181
4209
  };
4182
4210
  return {
4183
- tree: (l) => a(o("tree", { [te.source]: l }), { method: "GET" }, rn, (d) => ({ status: "error", failure: d })),
4211
+ tree: (l) => a(o("tree", { [te.source]: l }), { method: "GET" }, an, (d) => ({ status: "error", failure: d })),
4184
4212
  children: async (l, d, h) => {
4185
- const g = await a(o("children", { [te.source]: l, [te.path]: d }), { method: "GET", signal: h }, Fo, (v) => ({ status: "error", failure: v }));
4213
+ const g = await a(o("children", { [te.source]: l, [te.path]: d }), { method: "GET", signal: h }, Wo, (v) => ({ status: "error", failure: v }));
4186
4214
  return h.aborted ? ue : g;
4187
4215
  },
4188
4216
  ancestors: async (l, d, h) => {
4189
- const g = await a(o("ancestors", { [te.source]: l, [te.path]: d }), { method: "GET", signal: h }, _o, (v) => ({ status: "error", failure: v }));
4217
+ const g = await a(o("ancestors", { [te.source]: l, [te.path]: d }), { method: "GET", signal: h }, Zo, (v) => ({ status: "error", failure: v }));
4190
4218
  return h.aborted ? ue : g;
4191
4219
  },
4192
4220
  reveal: async (l, d, h) => {
4193
- const g = await a(o("reveal", { [te.source]: l, [te.path]: d }), { method: "GET", signal: h }, $o, (v) => ({ status: "error", failure: v }));
4221
+ const g = await a(o("reveal", { [te.source]: l, [te.path]: d }), { method: "GET", signal: h }, Vo, (v) => ({ status: "error", failure: v }));
4194
4222
  return h.aborted ? ue : g;
4195
4223
  },
4196
- document: (l, { refresh: d }) => a(o("document", { [te.path]: l }), d ? { method: "GET", headers: i } : { method: "GET" }, Wo, (h) => ut(h.reason, h.code)),
4224
+ document: (l, { refresh: d }) => a(o("document", { [te.path]: l }), d ? { method: "GET", headers: i } : { method: "GET" }, ns, (h) => ut(h.reason, h.code)),
4197
4225
  text: async (l, d) => {
4198
- const h = await a(o("text", { [te.path]: l }), { method: "GET", signal: d }, Io, (g) => ut(g.reason, g.code));
4226
+ const h = await a(o("text", { [te.path]: l }), { method: "GET", signal: d }, jo, (g) => ut(g.reason, g.code));
4199
4227
  return d.aborted ? ue : h;
4200
4228
  },
4201
4229
  asset: async (l, d) => {
@@ -4213,17 +4241,17 @@ const Fc = /* @__PURE__ */ E.forwardRef(_c), qc = ({ href: e, onRetry: t, testId
4213
4241
  } catch {
4214
4242
  }
4215
4243
  if (d.aborted) return ue;
4216
- const v = Hn(g);
4244
+ const v = Vn(g);
4217
4245
  return { status: "error", failure: v === null ? { reason: dt(h.status) } : v };
4218
4246
  },
4219
- edit: (l, d) => u(o("edit", { [te.path]: l }), { method: "GET", signal: d }, Zo),
4220
- save: (l, d, h, g) => u(o("save", { [te.path]: l, [te.base]: d }), { method: "POST", headers: f, body: h, signal: g }, Vo),
4221
- preview: (l, d, h) => u(o("preview", { [te.path]: l }), { method: "POST", headers: f, body: d, signal: h }, Ho),
4222
- revisions: (l, d) => u(o("revisions", { [te.path]: l }), { method: "GET", signal: d }, Uo),
4223
- revision: (l, d, h) => u(o("revision", { [te.path]: l, [te.revision]: d }), { method: "GET", signal: h }, Bo),
4224
- refresh: (l) => a(o("refresh", { [te.source]: l }), { method: "POST", headers: i }, rn, (d) => ({ status: "error", failure: d }))
4247
+ edit: (l, d) => u(o("edit", { [te.path]: l }), { method: "GET", signal: d }, ts),
4248
+ save: (l, d, h, g) => u(o("save", { [te.path]: l, [te.base]: d }), { method: "POST", headers: f, body: h, signal: g }, es),
4249
+ preview: (l, d, h) => u(o("preview", { [te.path]: l }), { method: "POST", headers: f, body: d, signal: h }, Xo),
4250
+ revisions: (l, d) => u(o("revisions", { [te.path]: l }), { method: "GET", signal: d }, Yo),
4251
+ revision: (l, d, h) => u(o("revision", { [te.path]: l, [te.revision]: d }), { method: "GET", signal: h }, Ko),
4252
+ refresh: (l) => a(o("refresh", { [te.source]: l }), { method: "POST", headers: i }, an, (d) => ({ status: "error", failure: d }))
4225
4253
  };
4226
- }, ud = () => {
4254
+ }, Rd = () => {
4227
4255
  let e = null, t = null;
4228
4256
  return {
4229
4257
  settle: (n) => {
@@ -4238,20 +4266,20 @@ const Fc = /* @__PURE__ */ E.forwardRef(_c), qc = ({ href: e, onRetry: t, testId
4238
4266
  return t = null, o;
4239
4267
  }
4240
4268
  };
4241
- }, fd = (e) => {
4269
+ }, Cd = (e) => {
4242
4270
  const t = Ot(e);
4243
- if (t === null) return tn;
4271
+ if (t === null) return on;
4244
4272
  try {
4245
- return Oo(JSON.parse(t));
4273
+ return $o(JSON.parse(t));
4246
4274
  } catch (n) {
4247
- return console.warn(`[markdown-explorer] localStorage key ${JSON.stringify(e)} does not hold JSON; using the default tree settings.`, n), tn;
4275
+ return console.warn(`[markdown-explorer] localStorage key ${JSON.stringify(e)} does not hold JSON; using the default tree settings.`, n), on;
4248
4276
  }
4249
- }, zn = (e, t) => {
4277
+ }, Zn = (e, t) => {
4250
4278
  let n = null;
4251
4279
  const r = () => {
4252
4280
  if (n === null) {
4253
- const s = fd(e);
4254
- n = { changes: s, settings: en(t, s) };
4281
+ const s = Cd(e);
4282
+ n = { changes: s, settings: rn(t, s) };
4255
4283
  }
4256
4284
  return n;
4257
4285
  }, o = qe();
@@ -4262,34 +4290,34 @@ const Fc = /* @__PURE__ */ E.forwardRef(_c), qc = ({ href: e, onRetry: t, testId
4262
4290
  getServerSnapshot: () => t,
4263
4291
  subscribe: o.subscribe,
4264
4292
  advance: (s) => {
4265
- const { changes: a, settings: i } = r(), f = xo(a, s, To(i, s)[s], t);
4266
- return n = { changes: f, settings: en(t, f) }, o.emit(), Rt(e, Ro(f)), n.settings;
4293
+ const { changes: a, settings: i } = r(), f = Do(a, s, Po(i, s)[s], t);
4294
+ return n = { changes: f, settings: rn(t, f) }, o.emit(), Ct(e, Io(f)), n.settings;
4267
4295
  }
4268
4296
  };
4269
- }, md = Object.freeze({ status: "refreshed" }), hd = Object.freeze({ status: "superseded" }), Dt = Object.freeze({ status: "deferred" }), pd = hr(Dt), eo = 4, gd = eo - 1, jn = Object.freeze({ status: "loading" }), wd = Object.freeze({ status: "error", failure: Object.freeze({ reason: "failed" }) }), vd = (e) => {
4270
- const t = /* @__PURE__ */ new Map(), n = yr(), r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), i = qe(), f = /* @__PURE__ */ new Set();
4297
+ }, Od = Object.freeze({ status: "refreshed" }), Ld = Object.freeze({ status: "superseded" }), It = Object.freeze({ status: "deferred" }), Md = wr(It), io = 4, Ad = io - 1, Wn = Object.freeze({ status: "loading" }), Nd = Object.freeze({ status: "error", failure: Object.freeze({ reason: "failed" }) }), Dd = (e) => {
4298
+ const t = /* @__PURE__ */ new Map(), n = Cr(), r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), i = qe(), f = /* @__PURE__ */ new Set();
4271
4299
  let u = 0, l = 0;
4272
4300
  const d = { direct: null, bulk: null }, h = /* @__PURE__ */ new Set();
4273
4301
  let g = !1, v = 0;
4274
4302
  const y = () => {
4275
4303
  v += 1, i.emit();
4276
- }, T = (w) => o.get(w) ?? 0, C = (w) => {
4304
+ }, T = (w) => o.get(w) ?? 0, O = (w) => {
4277
4305
  let k = a.get(w);
4278
4306
  return k === void 0 && (k = { claims: /* @__PURE__ */ new Map(), unclaimed: /* @__PURE__ */ new Set(), direct: /* @__PURE__ */ new Set(), bulk: /* @__PURE__ */ new Set(), inFlight: /* @__PURE__ */ new Map() }, a.set(w, k)), k;
4279
- }, R = (w, k, O) => {
4280
- w.inFlight.delete(k), u -= 1, O.lane === "bulk" && (l -= 1);
4307
+ }, R = (w, k, C) => {
4308
+ w.inFlight.delete(k), u -= 1, C.lane === "bulk" && (l -= 1);
4281
4309
  }, q = (w) => {
4282
4310
  const k = a.get(w);
4283
4311
  if (k !== void 0) {
4284
- for (const [O, N] of [...k.inFlight])
4285
- R(k, O, N), N.controller.abort();
4312
+ for (const [C, N] of [...k.inFlight])
4313
+ R(k, C, N), N.controller.abort();
4286
4314
  k.direct.clear(), k.bulk.clear(), k.unclaimed.clear();
4287
4315
  }
4288
4316
  }, D = (w) => {
4289
4317
  const k = T(w) + 1;
4290
4318
  return o.set(w, k), q(w), k;
4291
4319
  }, m = (w, k) => {
4292
- const O = Ae(w), N = { promise: w, opened: k, stale: !1, loadedAt: O?.status === "ok" ? O.loadedAt : null };
4320
+ const C = Ae(w), N = { promise: w, opened: k, stale: !1, loadedAt: C?.status === "ok" ? C.loadedAt : null };
4293
4321
  return w.status === "pending" && w.then((z) => {
4294
4322
  z.status === "ok" && (N.loadedAt = z.loadedAt);
4295
4323
  }), N;
@@ -4297,7 +4325,7 @@ const Fc = /* @__PURE__ */ E.forwardRef(_c), qc = ({ href: e, onRetry: t, testId
4297
4325
  let k = r.get(w);
4298
4326
  return k === void 0 && (k = /* @__PURE__ */ new Map(), r.set(w, k)), k;
4299
4327
  }, x = (w) => {
4300
- const k = [...a.keys()], O = d[w], N = O === null ? 0 : k.indexOf(O) + 1;
4328
+ const k = [...a.keys()], C = d[w], N = C === null ? 0 : k.indexOf(C) + 1;
4301
4329
  for (let z = 0; z < k.length; z += 1) {
4302
4330
  const W = k[(N + z) % k.length], J = W === void 0 ? void 0 : a.get(W);
4303
4331
  if (!(W === void 0 || J === void 0)) {
@@ -4307,108 +4335,108 @@ const Fc = /* @__PURE__ */ E.forwardRef(_c), qc = ({ href: e, onRetry: t, testId
4307
4335
  }
4308
4336
  }
4309
4337
  return null;
4310
- }, A = (w, k, O, N) => {
4338
+ }, A = (w, k, C, N) => {
4311
4339
  const z = a.get(w);
4312
- if (z === void 0 || z.inFlight.get(k) !== O) return;
4313
- R(z, k, O);
4340
+ if (z === void 0 || z.inFlight.get(k) !== C) return;
4341
+ R(z, k, C);
4314
4342
  const W = (z.claims.get(k) ?? 0) > 0, J = p(w);
4315
4343
  if (N.status === "ok" ? J.set(k, { status: "loaded", entries: N.entries }) : N.status === "error" && W ? J.set(k, { status: "failed", failure: N.failure }) : J.delete(k), y(), N.status === "error" && W) {
4316
4344
  const G = { sourceId: w, path: k, failure: N.failure };
4317
4345
  for (const ie of [...f]) ie(G);
4318
4346
  }
4319
4347
  _();
4320
- }, I = (w, k, O) => {
4321
- const N = { controller: new AbortController(), lane: O };
4322
- C(w).inFlight.set(k, N), u += 1, O === "bulk" && (l += 1), e.children(w, k, N.controller.signal).then(
4348
+ }, I = (w, k, C) => {
4349
+ const N = { controller: new AbortController(), lane: C };
4350
+ O(w).inFlight.set(k, N), u += 1, C === "bulk" && (l += 1), e.children(w, k, N.controller.signal).then(
4323
4351
  (z) => A(w, k, N, z),
4324
- () => A(w, k, N, wd)
4352
+ () => A(w, k, N, Nd)
4325
4353
  );
4326
4354
  }, _ = () => {
4327
- for (; u < eo; ) {
4355
+ for (; u < io; ) {
4328
4356
  const w = x("direct");
4329
4357
  if (w !== null) {
4330
4358
  I(w.sourceId, w.path, "direct");
4331
4359
  continue;
4332
4360
  }
4333
- const k = l < gd ? x("bulk") : null;
4361
+ const k = l < Ad ? x("bulk") : null;
4334
4362
  if (k === null) return;
4335
4363
  I(k.sourceId, k.path, "bulk");
4336
4364
  }
4337
- }, b = (w, k, O) => {
4338
- if (!(k.direct.delete(O) || k.bulk.delete(O))) {
4339
- const z = k.inFlight.get(O);
4365
+ }, b = (w, k, C) => {
4366
+ if (!(k.direct.delete(C) || k.bulk.delete(C))) {
4367
+ const z = k.inFlight.get(C);
4340
4368
  if (z === void 0) return !1;
4341
- R(k, O, z), z.controller.abort();
4369
+ R(k, C, z), z.controller.abort();
4342
4370
  }
4343
- return r.get(w)?.delete(O), !0;
4371
+ return r.get(w)?.delete(C), !0;
4344
4372
  }, S = () => {
4345
4373
  g = !1;
4346
4374
  let w = !1;
4347
4375
  for (const k of h) {
4348
- const O = C(k);
4349
- for (const N of O.unclaimed)
4350
- (O.claims.get(N) ?? 0) === 0 && b(k, O, N) && (w = !0);
4351
- O.unclaimed.clear();
4376
+ const C = O(k);
4377
+ for (const N of C.unclaimed)
4378
+ (C.claims.get(N) ?? 0) === 0 && b(k, C, N) && (w = !0);
4379
+ C.unclaimed.clear();
4352
4380
  }
4353
4381
  h.clear(), w && (y(), _());
4354
- }, M = (w, k) => {
4382
+ }, L = (w, k) => {
4355
4383
  t.set(w, m($e(e.tree(w)), k));
4356
- }, L = (w, k, O) => {
4384
+ }, M = (w, k, C) => {
4357
4385
  D(w);
4358
- const N = m(hr(k), O);
4386
+ const N = m(wr(k), C);
4359
4387
  return t.set(w, N), r.delete(w), y(), _(), N;
4360
- }, P = (w, k, O, N) => {
4361
- if (O !== T(w) || t.get(w) !== k) return;
4388
+ }, P = (w, k, C, N) => {
4389
+ if (C !== T(w) || t.get(w) !== k) return;
4362
4390
  const z = Ae(k.promise);
4363
4391
  if (!(N.status !== "ok" || z?.status !== "ok" || k.loadedAt === null || N.loadedAt <= k.loadedAt)) {
4364
4392
  if (et(z.entries, N.entries)) {
4365
4393
  k.loadedAt = N.loadedAt;
4366
4394
  return;
4367
4395
  }
4368
- L(w, N, k.opened);
4396
+ M(w, N, k.opened);
4369
4397
  }
4370
4398
  }, H = (w, k) => {
4371
- const O = t.get(w);
4372
- return O !== void 0 && Ae(O.promise)?.status === k;
4399
+ const C = t.get(w);
4400
+ return C !== void 0 && Ae(C.promise)?.status === k;
4373
4401
  }, K = (w, k) => {
4374
4402
  k.stale = !1;
4375
- const O = T(w);
4376
- e.tree(w).then((N) => P(w, k, O, N));
4403
+ const C = T(w);
4404
+ e.tree(w).then((N) => P(w, k, C, N));
4377
4405
  };
4378
4406
  return {
4379
- read: (w) => t.get(w)?.promise ?? pd,
4407
+ read: (w) => t.get(w)?.promise ?? Md,
4380
4408
  open: (w) => {
4381
- const k = n.resumes(w), O = n.hold(w), N = t.get(w);
4382
- return N === void 0 || H(w, "deferred") ? (M(w, !0), y()) : k || (N.opened && H(w, "error") ? (M(w, !0), y()) : (N.opened = !0, N.stale && H(w, "ok") && K(w, N))), O;
4409
+ const k = n.resumes(w), C = n.hold(w), N = t.get(w);
4410
+ return N === void 0 || H(w, "deferred") ? (L(w, !0), y()) : k || (N.opened && H(w, "error") ? (L(w, !0), y()) : (N.opened = !0, N.stale && H(w, "ok") && K(w, N))), C;
4383
4411
  },
4384
4412
  retry: (w) => {
4385
- H(w, "error") && (M(w, !0), y());
4413
+ H(w, "error") && (L(w, !0), y());
4386
4414
  },
4387
4415
  seed: (w, k) => {
4388
- const O = k.then(
4389
- (W) => W === null ? Dt : W,
4390
- () => Dt
4416
+ const C = k.then(
4417
+ (W) => W === null ? It : W,
4418
+ () => It
4391
4419
  ), N = t.get(w);
4392
4420
  if (N !== void 0 && H(w, "ok")) {
4393
4421
  const W = T(w);
4394
- O.then((J) => P(w, N, W, J));
4422
+ C.then((J) => P(w, N, W, J));
4395
4423
  return;
4396
4424
  }
4397
4425
  D(w);
4398
- const z = m($e(O), N?.opened === !0);
4399
- t.set(w, z), r.delete(w), _(), O.then((W) => {
4400
- t.get(w) === z && (W.status === "deferred" && n.isHeld(w) && M(w, z.opened), y());
4426
+ const z = m($e(C), N?.opened === !0);
4427
+ t.set(w, z), r.delete(w), _(), C.then((W) => {
4428
+ t.get(w) === z && (W.status === "deferred" && n.isHeld(w) && L(w, z.opened), y());
4401
4429
  });
4402
4430
  },
4403
4431
  refresh: async (w) => {
4404
4432
  const k = (s.get(w) ?? 0) + 1;
4405
4433
  s.set(w, k);
4406
- const O = await e.refresh(w);
4407
- if (s.get(w) !== k) return hd;
4408
- if (O.status === "error") return { status: "failed", failure: O.failure };
4434
+ const C = await e.refresh(w);
4435
+ if (s.get(w) !== k) return Ld;
4436
+ if (C.status === "error") return { status: "failed", failure: C.failure };
4409
4437
  const N = t.get(w);
4410
- if (!(N !== void 0 && N.loadedAt !== null && H(w, "ok") && N.loadedAt > O.loadedAt)) {
4411
- const W = L(w, O, !0);
4438
+ if (!(N !== void 0 && N.loadedAt !== null && H(w, "ok") && N.loadedAt > C.loadedAt)) {
4439
+ const W = M(w, C, !0);
4412
4440
  if (N !== void 0 && N.promise.status === "pending") {
4413
4441
  const J = T(w);
4414
4442
  N.promise.then((G) => P(w, W, J, G));
@@ -4416,36 +4444,36 @@ const Fc = /* @__PURE__ */ E.forwardRef(_c), qc = ({ href: e, onRetry: t, testId
4416
4444
  }
4417
4445
  for (const [W, J] of t)
4418
4446
  W !== w && Ae(J.promise)?.status === "ok" && (J.stale = !0);
4419
- return md;
4447
+ return Od;
4420
4448
  },
4421
4449
  children: (w, k) => r.get(w)?.get(k),
4422
4450
  claimChildren: (w, k) => {
4423
- const O = C(w), N = p(w);
4451
+ const C = O(w), N = p(w);
4424
4452
  let z = !1, W = !1;
4425
4453
  for (const [G, ie] of k)
4426
- O.claims.set(G, (O.claims.get(G) ?? 0) + 1), N.get(G) === void 0 ? (N.set(G, jn), O[ie].add(G), z = !0, W = !0) : ie === "direct" && O.bulk.delete(G) && (O.direct.add(G), W = !0);
4454
+ C.claims.set(G, (C.claims.get(G) ?? 0) + 1), N.get(G) === void 0 ? (N.set(G, Wn), C[ie].add(G), z = !0, W = !0) : ie === "direct" && C.bulk.delete(G) && (C.direct.add(G), W = !0);
4427
4455
  z && y(), W && _();
4428
4456
  let J = !1;
4429
4457
  return () => {
4430
4458
  if (!J) {
4431
4459
  J = !0;
4432
4460
  for (const G of k.keys()) {
4433
- const ie = (O.claims.get(G) ?? 0) - 1;
4434
- ie > 0 ? O.claims.set(G, ie) : (O.claims.delete(G), O.unclaimed.add(G));
4461
+ const ie = (C.claims.get(G) ?? 0) - 1;
4462
+ ie > 0 ? C.claims.set(G, ie) : (C.claims.delete(G), C.unclaimed.add(G));
4435
4463
  }
4436
4464
  h.add(w), !g && (g = !0, queueMicrotask(S));
4437
4465
  }
4438
4466
  };
4439
4467
  },
4440
4468
  retryChildren: (w, k) => {
4441
- const O = r.get(w);
4442
- if (O === void 0 || O.get(k)?.status !== "failed") return;
4443
- const N = C(w);
4469
+ const C = r.get(w);
4470
+ if (C === void 0 || C.get(k)?.status !== "failed") return;
4471
+ const N = O(w);
4444
4472
  if ((N.claims.get(k) ?? 0) > 0) {
4445
- O.set(k, jn), N.direct.add(k), y(), _();
4473
+ C.set(k, Wn), N.direct.add(k), y(), _();
4446
4474
  return;
4447
4475
  }
4448
- O.delete(k), y();
4476
+ C.delete(k), y();
4449
4477
  },
4450
4478
  pendingChildren: (w) => {
4451
4479
  const k = a.get(w);
@@ -4462,7 +4490,7 @@ const Fc = /* @__PURE__ */ E.forwardRef(_c), qc = ({ href: e, onRetry: t, testId
4462
4490
  subscribe: i.subscribe,
4463
4491
  version: () => v
4464
4492
  };
4465
- }, bd = (e, t) => {
4493
+ }, Pd = (e, t) => {
4466
4494
  let n = e;
4467
4495
  const r = qe();
4468
4496
  return {
@@ -4472,66 +4500,66 @@ const Fc = /* @__PURE__ */ E.forwardRef(_c), qc = ({ href: e, onRetry: t, testId
4472
4500
  n = { ...n, ...o }, t(n), r.emit();
4473
4501
  }
4474
4502
  };
4475
- }, yd = 1;
4503
+ }, Id = 1;
4476
4504
  let We = 0, he = null;
4477
- const kd = () => {
4505
+ const $d = () => {
4478
4506
  const { documentElement: e, body: t } = document;
4479
4507
  We === 0 && (he = { htmlOverflow: e.style.overflow, bodyOverflow: t.style.overflow, htmlGutter: e.style.scrollbarGutter, bodyGutter: t.style.scrollbarGutter }, e.style.overflow = "hidden", t.style.overflow = "hidden", e.style.scrollbarGutter = "auto", t.style.scrollbarGutter = "auto"), We += 1;
4480
4508
  let n = !1;
4481
4509
  return () => {
4482
4510
  n || (n = !0, We -= 1, !(We > 0 || he === null) && (e.style.overflow = he.htmlOverflow, t.style.overflow = he.bodyOverflow, e.style.scrollbarGutter = he.htmlGutter, t.style.scrollbarGutter = he.bodyGutter, he = null));
4483
4511
  };
4484
- }, Ed = [
4512
+ }, _d = [
4485
4513
  { selector: '[data-aqmx-document-flow="fill"]', name: "document region" },
4486
4514
  { selector: "[data-aqmx-explorer-body]", name: "tree area" }
4487
- ], Vn = 1, Sd = 1e3, Zn = (e) => e.getClientRects().length > 0, St = "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.", xd = (e) => {
4488
- if (!Zn(e)) return null;
4515
+ ], Gn = 1, Fd = 1e3, Kn = (e) => e.getClientRects().length > 0, xt = "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.", qd = (e) => {
4516
+ if (!Kn(e)) return null;
4489
4517
  const t = e.getBoundingClientRect(), n = window.innerHeight;
4490
- if (t.bottom > n + yd)
4491
- 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. ${St}`;
4492
- if (t.height < Vn)
4493
- 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. ${St}`;
4494
- for (const { selector: r, name: o } of Ed)
4518
+ if (t.bottom > n + Id)
4519
+ 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. ${xt}`;
4520
+ if (t.height < Gn)
4521
+ 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. ${xt}`;
4522
+ for (const { selector: r, name: o } of _d)
4495
4523
  for (const s of e.querySelectorAll(r)) {
4496
- if (!Zn(s)) continue;
4524
+ if (!Kn(s)) continue;
4497
4525
  const a = s.getBoundingClientRect().height;
4498
- if (a < Vn)
4499
- return `[markdown-explorer] the explorer's ${o} collapsed to ${String(Math.round(a))}px while lockDocumentScroll stops the page from scrolling, so it cannot be read. ${St}`;
4526
+ if (a < Gn)
4527
+ return `[markdown-explorer] the explorer's ${o} collapsed to ${String(Math.round(a))}px while lockDocumentScroll stops the page from scrolling, so it cannot be read. ${xt}`;
4500
4528
  }
4501
4529
  return null;
4502
- }, Td = (e) => {
4530
+ }, Bd = (e) => {
4503
4531
  let t = !1, n;
4504
4532
  const r = () => {
4505
4533
  n = void 0;
4506
- const a = xd(e);
4534
+ const a = qd(e);
4507
4535
  a !== null && (t = !0, console.error(a));
4508
4536
  }, o = () => {
4509
- t || (clearTimeout(n), n = setTimeout(r, Sd));
4537
+ t || (clearTimeout(n), n = setTimeout(r, Fd));
4510
4538
  }, s = typeof ResizeObserver > "u" ? null : new ResizeObserver(o);
4511
4539
  return s?.observe(e), window.addEventListener("resize", o), o(), () => {
4512
4540
  clearTimeout(n), s?.disconnect(), window.removeEventListener("resize", o);
4513
4541
  };
4514
- }, Rd = (e, t) => {
4515
- ee(() => e ? kd() : void 0, [e]), ee(() => {
4542
+ }, Ud = (e, t) => {
4543
+ ee(() => e ? $d() : void 0, [e]), ee(() => {
4516
4544
  const n = t.current;
4517
4545
  if (!(!e || n === null))
4518
- return Td(n);
4546
+ return Bd(n);
4519
4547
  }, [e, t]);
4520
- }, Wn = '[data-testid="markdown-explorer-view-switch"]', Od = [
4521
- { control: Wn, successors: [Wn, '[data-testid="markdown-explorer-sheet-toggle"]'] },
4548
+ }, Yn = '[data-testid="markdown-explorer-view-switch"]', Hd = [
4549
+ { control: Yn, successors: [Yn, '[data-testid="markdown-explorer-sheet-toggle"]'] },
4522
4550
  { control: '[data-testid="markdown-explorer-selection-open"]', successors: ['[data-testid="markdown-explorer-panel-frame"]'] }
4523
- ], Cd = (e) => {
4524
- for (const t of Od) {
4551
+ ], zd = (e) => {
4552
+ for (const t of Hd) {
4525
4553
  const n = e.closest(t.control);
4526
4554
  if (n !== null) return { element: n, control: t };
4527
4555
  }
4528
4556
  return null;
4529
- }, Md = (e, t) => {
4557
+ }, jd = (e, t) => {
4530
4558
  const n = U(null);
4531
4559
  ee(() => {
4532
4560
  const o = (i) => {
4533
4561
  const f = e.current;
4534
- n.current = f !== null && i instanceof Element && f.contains(i) ? Cd(i) : null;
4562
+ n.current = f !== null && i instanceof Element && f.contains(i) ? zd(i) : null;
4535
4563
  }, s = (i) => o(i.target);
4536
4564
  o(document.activeElement);
4537
4565
  const a = (i) => {
@@ -4569,37 +4597,37 @@ const kd = () => {
4569
4597
  });
4570
4598
  return i.observe(a, { childList: !0, subtree: !0 }), () => i.disconnect();
4571
4599
  }, [t, e]);
4572
- }, Ld = Pt(() => import("./TreeLayout-DjIVKBG4.js").then((e) => ({ default: e.TreeLayout }))), Ad = Pt(() => import("./MultiLayout-B-ft4_Vs.js").then((e) => ({ default: e.MultiLayout }))), Nd = 64, Dd = {
4600
+ }, Vd = $t(() => import("./TreeLayout-C4l591Nc.js").then((e) => ({ default: e.TreeLayout }))), Zd = $t(() => import("./MultiLayout-Pf-6yPif.js").then((e) => ({ default: e.MultiLayout }))), Wd = 64, Gd = {
4573
4601
  request: (e) => {
4574
4602
  requestAnimationFrame(e);
4575
4603
  }
4576
- }, Gn = (e) => {
4604
+ }, Xn = (e) => {
4577
4605
  e.documents.clear(), e.trees.clear();
4578
- }, xt = (e, t) => {
4606
+ }, Tt = (e, t) => {
4579
4607
  t.tree !== null && e.trees.seed(t.tree.sourceId, t.tree.result);
4580
4608
  for (const { path: n, document: r } of t.documents) e.documents.seed(n, r);
4581
- }, Pd = (e, t) => {
4582
- const [n, r] = V(() => ({ overrides: t, locale: e, labels: dn(e, t) }));
4583
- if (n.locale === e && us(n.overrides, t)) return n.labels;
4584
- const o = { overrides: t, locale: e, labels: dn(e, t) };
4609
+ }, Kd = (e, t) => {
4610
+ const [n, r] = V(() => ({ overrides: t, locale: e, labels: mn(e, t) }));
4611
+ if (n.locale === e && ys(n.overrides, t)) return n.labels;
4612
+ const o = { overrides: t, locale: e, labels: mn(e, t) };
4585
4613
  return r(o), o.labels;
4586
- }, Id = (e, t, n) => {
4587
- const [r, o] = V(() => ({ scope: t, store: zn(e, n) }));
4614
+ }, Yd = (e, t, n) => {
4615
+ const [r, o] = V(() => ({ scope: t, store: Zn(e, n) }));
4588
4616
  if (r.scope === t && r.store.storageKey === e && r.store.defaults === n) return r.store;
4589
- const s = { scope: t, store: zn(e, n) };
4617
+ const s = { scope: t, store: Zn(e, n) };
4590
4618
  return o(s), s.store;
4591
- }, Tt = (e, t) => {
4619
+ }, Rt = (e, t) => {
4592
4620
  const [n, r] = V(() => ({ scope: e, value: t() }));
4593
4621
  if (n.scope === e) return n.value;
4594
4622
  const o = { scope: e, value: t() };
4595
4623
  return r(o), o.value;
4596
- }, $d = () => cd(Dd), Kn = "on", _d = "off", Fd = Object.freeze({ kind: "unavailable" }), qd = (e) => {
4624
+ }, Xd = () => xd(Gd), Jn = "on", Jd = "off", Qd = Object.freeze({ kind: "unavailable" }), eu = (e) => {
4597
4625
  if (e !== void 0 && (e === null || typeof e != "object" || typeof e.convert != "function"))
4598
4626
  throw new TypeError("[markdown-explorer] draftConverter must be an object with a convert function");
4599
- }, Bd = (e, t) => {
4627
+ }, tu = (e, t) => {
4600
4628
  const n = ge(e.peek(t));
4601
4629
  return n === null || n.document.kind === "failure" ? fe(t) : n.document.name;
4602
- }, su = ({
4630
+ }, Eu = ({
4603
4631
  data: e,
4604
4632
  config: t,
4605
4633
  storageNamespace: n,
@@ -4613,24 +4641,24 @@ const kd = () => {
4613
4641
  onEditGrant: l,
4614
4642
  draftConverter: d
4615
4643
  }) => {
4616
- ts(n), qd(d);
4617
- const h = ir(r), g = fs(s), v = Pd(h, o), { revalidate: y } = wo(), T = U(() => {
4618
- }), C = nt(t.dataPath), [R] = V(() => {
4619
- const O = dd({ dataPath: C, onScope: (z) => T.current(z) }), N = { documents: ha({ client: O, capacity: Math.max(Nd, t.multiView.maxPanels * 2) }), trees: vd(O) };
4620
- return xt(N, e), ln(n, e.scope), { data: O, ...N, aligned: { pageData: e, storageNamespace: n, pendingReader: null } };
4644
+ ds(n), eu(d);
4645
+ const h = dr(r), g = ks(s), v = Kd(h, o), { revalidate: y } = xo(), T = U(() => {
4646
+ }), O = nt(t.dataPath), [R] = V(() => {
4647
+ const C = Td({ dataPath: O, onScope: (z) => T.current(z) }), N = { documents: Oa({ client: C, capacity: Math.max(Wd, t.multiView.maxPanels * 2) }), trees: Dd(C) };
4648
+ return Tt(N, e), un(n, e.scope), { data: C, ...N, aligned: { pageData: e, storageNamespace: n, pendingReader: null } };
4621
4649
  });
4622
4650
  if (R.aligned.pageData !== e || R.aligned.storageNamespace !== n) {
4623
- const O = R.aligned.pageData;
4624
- R.aligned.pageData = e, R.aligned.storageNamespace = n, O !== e && (O.scope !== e.scope ? R.aligned.pendingReader = e : xt(R, e)), ln(n, e.scope);
4651
+ const C = R.aligned.pageData;
4652
+ R.aligned.pageData = e, R.aligned.storageNamespace = n, C !== e && (C.scope !== e.scope ? R.aligned.pendingReader = e : Tt(R, e)), un(n, e.scope);
4625
4653
  }
4626
- const q = Id(Ce(n).treeSettings, e.scope, t.defaultTreeSettings);
4654
+ const q = Yd(Oe(n).treeSettings, e.scope, t.defaultTreeSettings);
4627
4655
  Y(() => {
4628
- const O = R.aligned.pendingReader;
4629
- O !== null && (R.aligned.pendingReader = null, Gn(R), xt(R, O));
4656
+ const C = R.aligned.pendingReader;
4657
+ C !== null && (R.aligned.pendingReader = null, Xn(R), Tt(R, C));
4630
4658
  }, [e, R]), Y(() => {
4631
- let O = !1;
4659
+ let C = !1;
4632
4660
  return T.current = (N) => {
4633
- N === e.scope || O || (O = !0, N !== null && (Gn(R), ns(n)), y());
4661
+ N === e.scope || C || (C = !0, N !== null && (Xn(R), us(n)), y());
4634
4662
  }, () => {
4635
4663
  T.current = () => {
4636
4664
  };
@@ -4641,57 +4669,57 @@ const kd = () => {
4641
4669
  D.current = t.settingsCookie;
4642
4670
  }, [t.settingsCookie]);
4643
4671
  const [m] = V(
4644
- () => bd(e.settings, (O) => {
4645
- document.cookie = Mo(D.current, O, window.location.protocol === "https:");
4672
+ () => Pd(e.settings, (C) => {
4673
+ document.cookie = Fo(D.current, C, window.location.protocol === "https:");
4646
4674
  })
4647
- ), p = Tt(e.scope, $d), x = Tt(e.scope, ud), A = U(v);
4675
+ ), p = Rt(e.scope, Xd), x = Rt(e.scope, Rd), A = U(v);
4648
4676
  Y(() => {
4649
4677
  A.current = v;
4650
4678
  }, [v]);
4651
- const I = Tt(
4679
+ const I = Rt(
4652
4680
  e.scope,
4653
- () => Ss({
4681
+ () => Ns({
4654
4682
  data: R.data,
4655
4683
  conflictLabels: () => ({ ours: A.current.conflictOurs, theirs: A.current.conflictTheirs }),
4656
- onSaveSettled: (O, N) => {
4657
- N.kind === "saved" && R.documents.refresh(O);
4658
- const z = hs(A.current, N, Bd(R.documents, O));
4684
+ onSaveSettled: (C, N) => {
4685
+ N.kind === "saved" && R.documents.refresh(C);
4686
+ const z = Ss(A.current, N, tu(R.documents, C));
4659
4687
  z !== null && p.announce(z);
4660
4688
  },
4661
4689
  sideBySideSetting: {
4662
- read: () => Ot(Ce(n).editPreview) === Kn,
4663
- write: (O) => Rt(Ce(n).editPreview, O ? Kn : _d)
4690
+ read: () => Ot(Oe(n).editPreview) === Jn,
4691
+ write: (C) => Ct(Oe(n).editPreview, C ? Jn : Jd)
4664
4692
  },
4665
4693
  editorShareSetting: {
4666
- read: () => Es(Ot(Ce(n).editSplit)),
4667
- write: (O) => Rt(Ce(n).editSplit, String(O))
4694
+ read: () => As(Ot(Oe(n).editSplit)),
4695
+ write: (C) => Ct(Oe(n).editSplit, String(C))
4668
4696
  }
4669
4697
  })
4670
- ), _ = X(() => $e(e.notices.catch(() => [])), [e.notices]), b = e.sources.map((O) => O.id).join(`
4671
- `), S = X(() => Co(t, b.split(`
4672
- `)), [t, b]), M = U(u);
4698
+ ), _ = X(() => $e(e.notices.catch(() => [])), [e.notices]), b = e.sources.map((C) => C.id).join(`
4699
+ `), S = X(() => _o(t, b.split(`
4700
+ `)), [t, b]), L = U(u);
4673
4701
  Y(() => {
4674
- M.current = u;
4702
+ L.current = u;
4675
4703
  }, [u]);
4676
- const [L] = V(() => (O, N) => {
4677
- M.current?.(O, N);
4678
- }), P = u === void 0 ? void 0 : L, H = U(d);
4704
+ const [M] = V(() => (C, N) => {
4705
+ L.current?.(C, N);
4706
+ }), P = u === void 0 ? void 0 : M, H = U(d);
4679
4707
  Y(() => {
4680
4708
  H.current = d;
4681
4709
  }, [d]);
4682
4710
  const [K] = V(() => {
4683
- let O = !1;
4711
+ let C = !1;
4684
4712
  return {
4685
4713
  convert: (N, z) => {
4686
4714
  const W = H.current;
4687
- return W === void 0 ? Promise.resolve(Fd) : W.convert(N, z);
4715
+ return W === void 0 ? Promise.resolve(Qd) : W.convert(N, z);
4688
4716
  },
4689
4717
  prepare: () => {
4690
4718
  try {
4691
4719
  H.current?.prepare?.();
4692
4720
  } catch (N) {
4693
- if (O) return;
4694
- O = !0, console.error("[markdown-explorer] the draft converter's prepare threw", N);
4721
+ if (C) return;
4722
+ C = !0, console.error("[markdown-explorer] the draft converter's prepare threw", N);
4695
4723
  }
4696
4724
  }
4697
4725
  };
@@ -4720,81 +4748,86 @@ const kd = () => {
4720
4748
  }),
4721
4749
  [S, v, h, g, n, e.scope, e.sources, _, R, m, q, p, x, I, l, w, i, P]
4722
4750
  );
4723
- return /* @__PURE__ */ c(lr, { value: k, children: /* @__PURE__ */ c(Hd, { renderFrame: a, lockDocumentScroll: f }, e.scope) });
4724
- }, Ud = ({ ref: e, theme: t, view: n, children: r }) => {
4725
- const [o] = V(ti);
4751
+ return /* @__PURE__ */ c(ur, { value: k, children: /* @__PURE__ */ c(ru, { renderFrame: a, lockDocumentScroll: f }, e.scope) });
4752
+ }, nu = ({ ref: e, theme: t, view: n, children: r }) => {
4753
+ const [o] = V(gi);
4726
4754
  return /* @__PURE__ */ c("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 });
4727
- }, Hd = ({ renderFrame: e, lockDocumentScroll: t }) => {
4728
- const { theme: n, labels: r } = $(), o = $t(), { hash: s } = Xn(), a = ot(), i = U(null);
4729
- Rd(t, i), Y(() => {
4755
+ }, ru = ({ renderFrame: e, lockDocumentScroll: t }) => {
4756
+ const { theme: n, labels: r } = $(), o = Ft(), { hash: s } = er(), a = ot(), i = U(null);
4757
+ Ud(t, i), Y(() => {
4730
4758
  o.kind === "redirect" && a(`${o.href}${s}`, "browse");
4731
4759
  }, [o, s, a]);
4732
4760
  const { location: f } = o, u = f.view;
4733
- Md(i, u);
4734
- const l = f.view === "tree" ? /* @__PURE__ */ c(Ie, { fallback: /* @__PURE__ */ c("section", { className: "aqmx-split-fallback", "aria-label": r.explorerRegion, "aria-busy": "true", "data-testid": "markdown-explorer-split-loading", ...Ct }), children: /* @__PURE__ */ c(Ld, { location: f }) }) : f.view === "multi" ? /* @__PURE__ */ c(Ie, { fallback: /* @__PURE__ */ c("section", { className: "aqmx-stage-fallback", "aria-label": r.multiRegion, "aria-busy": "true", "data-testid": "markdown-explorer-stage-loading", ...Ct }), children: /* @__PURE__ */ c(Ad, { location: f }) }) : /* @__PURE__ */ c(id, { location: f }), d = /* @__PURE__ */ B(Ud, { ref: i, theme: n, view: u, children: [
4761
+ jd(i, u);
4762
+ const l = f.view === "tree" ? /* @__PURE__ */ c(Ie, { fallback: /* @__PURE__ */ c("section", { className: "aqmx-split-fallback", "aria-label": r.explorerRegion, "aria-busy": "true", "data-testid": "markdown-explorer-split-loading", ...Lt }), children: /* @__PURE__ */ c(Vd, { location: f }) }) : f.view === "multi" ? /* @__PURE__ */ c(Ie, { fallback: /* @__PURE__ */ c("section", { className: "aqmx-stage-fallback", "aria-label": r.multiRegion, "aria-busy": "true", "data-testid": "markdown-explorer-stage-loading", ...Lt }), children: /* @__PURE__ */ c(Zd, { location: f }) }) : /* @__PURE__ */ c(Ed, { location: f }), d = /* @__PURE__ */ B(nu, { ref: i, theme: n, view: u, children: [
4735
4763
  l,
4736
- /* @__PURE__ */ c(Us, {}),
4737
- /* @__PURE__ */ c(ld, { holds: !0, testId: "markdown-explorer-announcer" })
4764
+ /* @__PURE__ */ c(Ys, {}),
4765
+ /* @__PURE__ */ c(Sd, { holds: !0, testId: "markdown-explorer-announcer" })
4738
4766
  ] });
4739
4767
  return e === void 0 ? d : e({ view: u, children: d });
4740
- }, au = rs({ submissions: "skip", otherPath: "skip", query: "skip", hashChange: "skip" });
4768
+ }, Su = fs({ submissions: "skip", otherPath: "skip", query: "skip", hashChange: "skip" });
4741
4769
  export {
4742
- ss as $,
4743
- At as A,
4744
- zc as B,
4745
- ps as C,
4746
- ad as D,
4747
- qc as E,
4748
- As as F,
4749
- Bn as G,
4750
- Hc as H,
4751
- qe as I,
4752
- ru as J,
4753
- ri as K,
4754
- xs as L,
4755
- vr as M,
4756
- oc as N,
4757
- ua as O,
4758
- sd as P,
4759
- Sc as Q,
4760
- la as R,
4761
- Pc as S,
4762
- ia as T,
4763
- $t as U,
4764
- ld as V,
4765
- Je as W,
4766
- os as X,
4767
- un as Y,
4768
- ls as Z,
4769
- ar as _,
4770
- gs as a,
4771
- cn as a0,
4772
- su as a1,
4773
- dn as a2,
4774
- au as a3,
4775
- ws as b,
4776
- ot as c,
4777
- $i as d,
4778
- Ct as e,
4779
- kc as f,
4780
- ta as g,
4781
- vs as h,
4782
- sa as i,
4783
- ea as j,
4784
- de as k,
4785
- aa as l,
4786
- ge as m,
4787
- Js as n,
4788
- Qs as o,
4789
- Re as p,
4790
- Oe as q,
4791
- Ps as r,
4792
- qs as s,
4793
- Uc as t,
4770
+ Je as $,
4771
+ ku as A,
4772
+ Dt as B,
4773
+ xs as C,
4774
+ kd as D,
4775
+ ed as E,
4776
+ Bs as F,
4777
+ mr as G,
4778
+ sd as H,
4779
+ od as I,
4780
+ zn as J,
4781
+ rd as K,
4782
+ qe as L,
4783
+ vu as M,
4784
+ bu as N,
4785
+ vi as O,
4786
+ yd as P,
4787
+ Ds as Q,
4788
+ kr as R,
4789
+ ya as S,
4790
+ yu as T,
4791
+ xr as U,
4792
+ Fc as V,
4793
+ wa as W,
4794
+ Kc as X,
4795
+ ga as Y,
4796
+ Ft as Z,
4797
+ Sd as _,
4798
+ Ts as a,
4799
+ ms as a0,
4800
+ hn as a1,
4801
+ ws as a2,
4802
+ cr as a3,
4803
+ hs as a4,
4804
+ fn as a5,
4805
+ Eu as a6,
4806
+ mn as a7,
4807
+ Su as a8,
4808
+ Rs as b,
4809
+ Ut as c,
4810
+ ka as d,
4811
+ ot as e,
4812
+ bc as f,
4813
+ Xi as g,
4814
+ Lt as h,
4815
+ $c as i,
4816
+ da as j,
4817
+ Cs as k,
4818
+ ha as l,
4819
+ pa as m,
4820
+ ca as n,
4821
+ de as o,
4822
+ ge as p,
4823
+ ia as q,
4824
+ zs as r,
4825
+ la as s,
4826
+ Re as t,
4794
4827
  $ as u,
4795
- na as v,
4796
- nu as w,
4797
- ou as x,
4798
- dr as y,
4799
- jc as z
4828
+ ua as v,
4829
+ Ce as w,
4830
+ Gs as x,
4831
+ nd as y,
4832
+ wu as z
4800
4833
  };