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