@aiquants/markdown-explorer 0.39.0 → 0.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/README.md +3 -1
- package/dist/{EditSurface-CZnjX0sv.cjs → EditSurface-DFHZLbWC.cjs} +1 -1
- package/dist/{EditSurface-CUPN9dUY.js → EditSurface-DV4FuQVx.js} +3 -3
- package/dist/{ExplorerSplit-DHpgdXhb.js → ExplorerSplit-DTkr0q2C.js} +4 -4
- package/dist/{ExplorerSplit-DWBhCe7m.cjs → ExplorerSplit-DnuuUifU.cjs} +1 -1
- package/dist/{MultiLayout-BkHbfUuh.cjs → MultiLayout-CC0VPiFf.cjs} +1 -1
- package/dist/{MultiLayout-HmvjE8ht.js → MultiLayout-S77I1xQr.js} +3 -3
- package/dist/{NativeScrollBar-CzGhZ-w3.cjs → NativeScrollBar-C2n-DzEJ.cjs} +1 -1
- package/dist/{NativeScrollBar-DAukiH01.js → NativeScrollBar-DMCPxFeR.js} +2 -2
- package/dist/{TreeLayout-dtnugwQ7.js → TreeLayout-BGTzh0L4.js} +3 -3
- package/dist/{TreeLayout-BEvPaxLb.cjs → TreeLayout-DjJMAxWJ.cjs} +1 -1
- package/dist/core/config.d.cts +2 -0
- package/dist/core/config.d.ts +2 -0
- package/dist/{explorerCore-CUtc1Vmx.js → explorerCore-COhVrnGO.js} +1 -1
- package/dist/{explorerCore-Dj7RxZRd.cjs → explorerCore-diILGZTv.cjs} +1 -1
- package/dist/{index-D6at9qMs.cjs → index-AfEbgYQI.cjs} +8 -8
- package/dist/{index-BBJoJu-b.js → index-CWFyLa0N.js} +9 -8
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/dist/location-Csj3eAm_.cjs +1 -0
- package/dist/{location-T9o5XYpX.js → location-DFfbnUZ9.js} +26 -19
- package/dist/{merge-CkMe5hqA.js → merge-D-Oak4Xy.js} +1 -1
- package/dist/{merge-XyuOlVWP.cjs → merge-DvoikrFp.cjs} +1 -1
- package/dist/server.cjs +1 -1
- package/dist/server.js +3 -3
- package/dist/serverCore.cjs +1 -1
- package/dist/serverCore.js +3 -3
- package/dist/styles/markdown-explorer.css +1 -1
- package/dist/{tapScrollCircle-ExxyHVWY.cjs → tapScrollCircle-CS3hbyGb.cjs} +1 -1
- package/dist/{tapScrollCircle-CvWJKtbF.js → tapScrollCircle-DKoj17z6.js} +1 -1
- package/dist/{useSplitPersistence-BCitqdAe.cjs → useSplitPersistence-C6s7a4Iu.cjs} +1 -1
- package/dist/{useSplitPersistence-C86jW1yY.js → useSplitPersistence-CC9bx9iq.js} +1 -1
- package/package.json +3 -3
- package/dist/location-DFXJSMit.cjs +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## Unreleased
|
|
4
|
+
|
|
5
|
+
### Breaking
|
|
6
|
+
|
|
7
|
+
- **The `@aiquants/markdown` peer floor rises from `^13.3.0` to `^13.4.0`.** The new `documentFontFamily` option is passed
|
|
8
|
+
through to `@aiquants/markdown`'s viewer, whose `documentFontFamily` prop ships in 13.4.0, so a host on an older markdown
|
|
9
|
+
cannot apply a document font. `@aiquants/markdown-explorer-host` raises its own explorer peer floor to `^0.40.0` to
|
|
10
|
+
match, released together with this version.
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **A host sets a document's text font through the `documentFontFamily` configuration option.** The explorer passes the
|
|
15
|
+
value through to `@aiquants/markdown`'s viewer verbatim, which sets `--aqmd-document-font-family` on the document root
|
|
16
|
+
and reads it through `font-family`, overriding the display style's font; omitted or `undefined`, the document keeps its
|
|
17
|
+
display style's font. The explorer never sanitizes the value — the host passes an already-safe CSS `font-family`,
|
|
18
|
+
resolved and sanitized from a person's choice with `@aiquants/fonts`, so a stack's unquoted generic fallback (the
|
|
19
|
+
`sans-serif` in `"Noto Sans JP", sans-serif`) is kept intact rather than corrupted by re-sanitizing. A blank or
|
|
20
|
+
whitespace-only string throws a `RangeError` (omit it for the display style's font); anything but a string a `TypeError`.
|
|
21
|
+
- **The explorer chrome's font is settable through `--aqmx-ui-font-family`.** The explorer's tree, toolbars and menus take
|
|
22
|
+
`font-family: var(--aqmx-ui-font-family, inherit)` on the root; the property is left undeclared, so without it the chrome
|
|
23
|
+
inherits the page's font as before, and a value set on `:root` (or an ancestor of the explorer) applies it. A document's
|
|
24
|
+
own text is separate (its display style and `documentFontFamily`), and the editor and other monospace surfaces keep
|
|
25
|
+
their own fonts.
|
|
26
|
+
|
|
3
27
|
## 0.39.0 (2026-11-16) — A 44 px resize divider, prose line heights and an opt-in document floor (WCAG 2.2); the auth-core peer floor rises to ^0.9.0
|
|
4
28
|
|
|
5
29
|
### Breaking
|
package/README.md
CHANGED
|
@@ -50,7 +50,7 @@ A single-view (embedding) page never downloads the tree and multi-panel views, w
|
|
|
50
50
|
|
|
51
51
|
- React 19.2.7 or later and React Router 8 in framework mode (route modules with `loader` / `headers`).
|
|
52
52
|
- Node.js 22.22 or later (the floor React Router 8 declares). The package ships ES modules and CommonJS; the CommonJS entries load the ESM-only `react-router` through `require(esm)`.
|
|
53
|
-
- The peer packages, at these versions or later within the caret ranges the package declares: `@aiquants/auth-core` ^0.9.0 (the access failure contract: the occurrence the host's presenter draws, and the 403 refusal of the page loader, `accessFailureResponse`), `@aiquants/markdown` ^13.
|
|
53
|
+
- The peer packages, at these versions or later within the caret ranges the package declares: `@aiquants/auth-core` ^0.9.0 (the access failure contract: the occurrence the host's presenter draws, and the 403 refusal of the page loader, `accessFailureResponse`), `@aiquants/markdown` ^13.4.0 (document rendering;
|
|
54
54
|
the column width and colour pair a reader picks in its display popover (`CONTENT_MEASURES` and `CONTENT_COLORS` of `@aiquants/markdown/viewer-settings`) and the labels of the popover's sections and of a diagram's notices, a document's language for its content (`contentLang`) apart from the UI language of the labels the explorer passes (`labelsLang`), and the size of a document table's tap-scroll circle (`spreadsheetTapScrollCircle`'s `size`);
|
|
55
55
|
the gutter its scroll container keeps beside the explorer's bar for the tap-scroll circle (`scrollBarGutter`, given as a custom property that a media query sets), code blocks whose Copy button sits in a header row above the code, and documents whose front matter does not render; the Source toggle of a storage SVG image that stands alone in a paragraph, read through `imageSource`, and a Copy that copies the image as a PNG image or its source, the source readable in every display style, a notice in place of a block that cannot render and plain text for a fence in a language it does not know;
|
|
56
56
|
the full screen of its tables, Mermaid diagrams and SVG images, which every block marks with the same DOM hook (`data-aqmd-fullscreen`), and `DEFAULT_MARKDOWN_STYLE`, the style a document starts in by default; its components' stylesheet without utilities,
|
|
@@ -116,6 +116,7 @@ The source ids are not part of it: they are the ids of the server's `sources` (a
|
|
|
116
116
|
| `documentStyles?` | `readonly { name, className }[]` | Document styles, in the order the style section of the viewer's display popover lists them; `@aiquants/markdown`'s `DEFAULT_MARKDOWN_STYLES` (None, GitHub, Zenn; also exported without React from `@aiquants/markdown/viewer-settings`) when omitted. |
|
|
117
117
|
| `defaultDocumentStyle?` | `string` | The style a document starts in while neither the URL (`style`) nor the reader's saved preference names one: the name of one of `documentStyles`, matched exactly (`"zenn"` is not `"Zenn"`). `@aiquants/markdown`'s `DEFAULT_MARKDOWN_STYLE` (`"Zenn"`, also exported from `@aiquants/markdown/viewer-settings`) when omitted, also when given as `undefined`; it never falls back to the first style, so a host whose `documentStyles` leave Zenn out names its own, or the configuration throws. A name that is not one of `documentStyles` throws a `RangeError` naming the styles, and anything but a string a `TypeError`. |
|
|
118
118
|
| `mermaidModifier?` | `PanZoomModifier` | The modifier key that gates a mermaid diagram's pan and zoom with the mouse (drag and wheel), so a plain drag still selects text and clicks nodes: `"ctrl"` or `"shift"`. The explorer passes it through to `@aiquants/markdown`'s viewer, which gates on it and keeps the diagram's mode label neutral so the app names the key in its own setting; the viewer applies `DEFAULT_PAN_ZOOM_MODIFIER` (`"ctrl"`) when this is omitted or `undefined`. A value that is not `"ctrl"` or `"shift"` throws a `RangeError` naming them. |
|
|
119
|
+
| `documentFontFamily?` | `string` | The CSS `font-family` for a document's text. The explorer passes it through to `@aiquants/markdown`'s viewer verbatim, which sets `--aqmd-document-font-family` on the document root to this value and reads it through `font-family`, overriding the display style's font; omitted or `undefined`, the document keeps its display style's font. The explorer never sanitizes the value — pass an already-safe CSS `font-family`, resolved and sanitized from a person's choice with `@aiquants/fonts`, because re-sanitizing here would corrupt a stack's unquoted generic fallback (such as the `sans-serif` in `"Noto Sans JP", sans-serif`). A blank or whitespace-only string throws a `RangeError` (omit it for the display style's font), and anything but a string a `TypeError`. This sets a document's own text; the explorer chrome's font is the separate `--aqmx-ui-font-family` (see [Styling](#5-load-the-styles)). |
|
|
119
120
|
| `iframeHosts?` | `readonly string[]` | Host names whose `https:` iframes written in documents may load (exact match); none when omitted. They gate only iframes written in documents; provider frames come from `embeds`, and no iframe of the page's own origin ever renders, whatever is listed. |
|
|
120
121
|
| `appOrigins?` | `readonly string[]` | The origins the app's own pages are served from, as the browser writes them (`scheme://host[:port]`, such as `http://wails.localhost` or `wails://localhost`): a document's absolute URL of one of them is the app's own, like a relative or path-absolute one, and stays only under the paths its use allows (see [Security](docs/behavior/security.md#html)). None by default. |
|
|
121
122
|
| `mediaDataPath?` | `string` | An absolute `http:` or `https:` URL, of an origin and a mount path, that the asset URLs of videos, audio and PDF documents are built on instead of the data route (a separate media server's data route, for example); a document's `video`, `audio` and `source` may then use it too. None by default (see [Hosting](docs/behavior/hosting.md#the-apps-own-urls-apporigins-and-mediadatapath)). |
|
|
@@ -353,6 +354,7 @@ to; load it when your documents contain math.
|
|
|
353
354
|
- A maximized multi-view panel and the tree view's maximized document cover the viewport inside the explorer's maximize insets, `--aqmx-maximize-top`, `--aqmx-maximize-right`, `--aqmx-maximize-bottom` and `--aqmx-maximize-left` (all `0px` by default; the stage hands them to drag-drop-panels' `--aqdd-maximize-*`), so one binding in your layout keeps your own header or menu visible in both views. Everything of the explorer they cover (the explorer and its handle, the rail of a closed explorer or the sheet's bar, and the other panels) is inert until the panel or the document is restored.
|
|
354
355
|
Your own chrome is not: whatever of it they cover stays in the Tab order and in the accessibility tree, so either bind the insets so they leave it uncovered, or make it inert (or `visibility: hidden`) while something is maximized — the maximized panel's frame and the tree view's maximized document column carry `data-aqmx-maximized="true"`, the split's frame carries `data-aqmx-content-covers-page="true"` in both cases (`:has([data-aqmx-content-covers-page="true"])`), and the URL carries `maximized`.
|
|
355
356
|
- The tree and single views' document bar touches the page's top inline-end corner, where a host may float a control of its own (a menu switch). The bar keeps `--aqmx-page-bar-inset-inline-end` (`0px` by default) free at the end of its button row, beside the focus ring's room, so its last button (Edit while a document is edited, Refresh document otherwise) never sits under that control. The explorer leaves the property undeclared, so a value set on `:root` (or any ancestor of the explorer) reaches the bar.
|
|
357
|
+
- The explorer's chrome (its tree, toolbars and menus) takes its font from `--aqmx-ui-font-family`. The explorer leaves the property undeclared and falls back to `inherit`, so without it the chrome inherits the page's font (as before); a value set on `:root` (or any ancestor of the explorer) applies it. A document's own text is governed instead by its display style and the `documentFontFamily` option, and the editor and other monospace surfaces keep their own fonts.
|
|
356
358
|
|
|
357
359
|
## Views and URLs
|
|
358
360
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("react/jsx-runtime"),m=require("react"),b=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("react/jsx-runtime"),m=require("react"),b=require("./index-AfEbgYQI.cjs"),Z=require("@aiquants/markdown/code-blocks"),J=require("@codemirror/commands"),we=require("@codemirror/lang-markdown"),ie=require("@codemirror/language"),Ee=require("@codemirror/search"),K=require("@codemirror/state"),_=require("@codemirror/view"),D=require("@lezer/highlight"),Ge=require("@aiquants/markdown"),me=require("@aiquants/markdown/source-lines"),ne=require("./ownUrls-BTPGNhBt.cjs"),pe=require("./sanitizePolicy-C-ehd0J_.cjs"),We=require("isomorphic-dompurify"),$=require("./location-Csj3eAm_.cjs"),Xe=require("./describeValue-Ccvhbt36.cjs"),ce=require("@aiquants/resize-panels"),be=require("./useSplitPersistence-C6s7a4Iu.cjs"),Pe={history:J.historyField},$e=ie.HighlightStyle.define([{tag:[D.tags.heading1,D.tags.heading2,D.tags.heading3,D.tags.heading4,D.tags.heading5,D.tags.heading6,D.tags.heading],color:"var(--aqmx-syntax-heading)",fontWeight:"700"},{tag:D.tags.strong,fontWeight:"700"},{tag:D.tags.emphasis,fontStyle:"italic"},{tag:D.tags.strikethrough,textDecoration:"line-through"},{tag:D.tags.link,color:"var(--aqmx-syntax-link)",textDecoration:"underline"},{tag:D.tags.url,color:"var(--aqmx-syntax-url)"},{tag:D.tags.monospace,color:"var(--aqmx-syntax-code)"},{tag:D.tags.quote,color:"var(--aqmx-syntax-quote)"},{tag:[D.tags.processingInstruction,D.tags.contentSeparator,D.tags.labelName,D.tags.meta],color:"var(--aqmx-syntax-mark)"}]),Ke=_.EditorView.theme({"&":{height:"100%",color:"var(--aqmx-text)",backgroundColor:"var(--aqmx-surface)",fontSize:"var(--aqmx-font-size-title)"},"&.cm-focused":{outline:"none"},".cm-scroller":{fontFamily:'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace',lineHeight:"var(--aqmx-line-height-prose)"},".cm-content":{caretColor:"var(--aqmx-text)",paddingBlock:"var(--aqmx-space-6)"},".cm-line":{paddingInline:"var(--aqmx-space-6)"},"&.cm-focused .cm-cursor":{borderLeftColor:"var(--aqmx-text)"},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"var(--aqmx-editor-selection)"},".cm-activeLine":{backgroundColor:"var(--aqmx-editor-active-line)"},".cm-gutters":{backgroundColor:"var(--aqmx-surface-raised)",color:"var(--aqmx-editor-gutter)",borderInlineEnd:"var(--aqmx-space-1) solid var(--aqmx-border)"},".cm-activeLineGutter":{backgroundColor:"var(--aqmx-editor-active-line)"},".cm-searchMatch":{outline:"var(--aqmx-space-1) solid var(--aqmx-border-strong)"},".cm-panels":{backgroundColor:"var(--aqmx-surface-raised)",color:"var(--aqmx-text)"}}),Ne="data-aqmx-conflict-actions",Ye=_.Decoration.line({attributes:{"data-aqmx-conflict-line":"marker"}}),Je=_.Decoration.line({attributes:{"data-aqmx-conflict-line":"ours"}}),Qe=_.Decoration.line({attributes:{"data-aqmx-conflict-line":"theirs"}});class Ze extends _.WidgetType{constructor(t,n){super(),this.index=t,this.labels=n}index;labels;eq(t){return t.index===this.index&&t.labels===this.labels}toDOM(t){const n=document.createElement("div");n.setAttribute(Ne,String(this.index));for(const[o,s]of[["ours",this.labels.useOurs],["theirs",this.labels.useTheirs],["both",this.labels.keepBoth]]){const r=document.createElement("button");r.type="button",r.textContent=s,r.setAttribute("data-aqmx-conflict-choice",o),r.addEventListener("mousedown",l=>l.preventDefault()),r.addEventListener("click",()=>{const l=se(t.state.doc)[this.index];l!==void 0&&(De(t,l,o),t.focus())}),n.append(r)}return n}ignoreEvent(){return!0}}const se=e=>b.findConflictsInLines(e.iterLines()),xe=(e,t)=>{const n=new K.RangeSetBuilder;return se(e).forEach((o,s)=>{const r=e.line(o.start);n.add(r.from,r.from,_.Decoration.widget({widget:new Ze(s,t),block:!0,side:-1}));for(let l=o.start;l<=o.end;l+=1){const i=e.line(l).from,f=l===o.start||l===o.separator||l===o.end?Ye:l<o.separator?Je:Qe;n.add(i,i,f)}}),n.finish()},et=e=>K.StateField.define({create:t=>xe(t.doc,e),update:(t,n)=>n.docChanged?xe(n.state.doc,e):t,provide:t=>_.EditorView.decorations.from(t)}),De=(e,t,n)=>{const{doc:o}=e.state,s=(E,c)=>{const w=[];for(let u=E;u<=c;u+=1)w.push(o.line(u).text);return w},r=s(t.start+1,t.separator-1),l=s(t.separator+1,t.end-1),i=n==="ours"?r:n==="theirs"?l:[...r,...l];let f=o.line(t.start).from,d=o.line(t.end).to;i.length===0&&(t.end<o.lines?d+=1:t.start>1&&(f-=1));const x=i.join(`
|
|
2
2
|
`);e.dispatch({changes:{from:f,to:d,insert:x},selection:K.EditorSelection.cursor(f),scrollIntoView:!0,userEvent:"input.resolve"})},Se="input.preview",tt=20,nt=_.ViewPlugin.fromClass(class{constructor(e){this.view=e,this.schedule()}view;cancel=null;update(e){e.docChanged&&this.schedule()}schedule(){if(this.cancel!==null||ie.syntaxTreeAvailable(this.view.state))return;const e=this.view.dom.ownerDocument.defaultView;if(e===null)return;const t=()=>{this.cancel=null,ie.ensureSyntaxTree(this.view.state,this.view.state.doc.length,tt),this.schedule()};if(typeof e.requestIdleCallback=="function"){const n=e.requestIdleCallback(t);this.cancel=()=>e.cancelIdleCallback(n)}else{const n=e.setTimeout(t,0);this.cancel=()=>e.clearTimeout(n)}}destroy(){this.cancel?.(),this.cancel=null}}),rt=/`{3,}|~{3,}/u,re=Object.freeze({kind:"absent"}),de=Object.freeze({kind:"unreadable"}),ot=(e,t,n)=>{const o=[];for(let f=t.parent;f!==null;f=f.parent)(f.name==="Blockquote"||f.name==="ListItem")&&o.unshift(f);const s=[],r=[],l=f=>{const d=r.indexOf(f);return d===-1?r.length:d};for(const f of o){const d=e.lineAt(f.from).number;if(f.name==="ListItem"){const x=Z.listItemWidthOn(e.line(d).text,s,l(d));if(x===null)return null;s.push({kind:"listItem",width:x})}else s.push({kind:"quote"});r.push(d)}const i=Z.openingFenceOn(n.text,s,l(n.number));return i===null?null:{containers:s,...i}},st=(e,t)=>{const{doc:n}=e;let o=n.lineAt(t).to;for(;;){const s=ie.ensureSyntaxTree(e,o,Number.POSITIVE_INFINITY);if(s===null)return null;const r=s.resolveInner(t,1),l=r.parent;if(r.name!=="CodeMark"||l===null||l.name!=="FencedCode"||l.from!==r.from)return null;if(l.to<o||o>=n.length)return l;o=Math.min(n.length,l.to+Math.max(l.to-t,1))}},ye=(e,t)=>{const{doc:n}=e;if(!Number.isInteger(t)||t<1||t>n.lines)return re;const o=n.line(t),s=rt.exec(o.text);if(s===null)return re;const r=st(e,o.from+s.index);if(r===null)return re;const l=r.getChild("CodeInfo");if(l===null)return re;const i=Z.fencedCodeLanguageOf(n.sliceString(l.from,l.to));if(i===null)return de;if(i!==Z.SPREADSHEETS_LANGUAGE)return re;const f=ot(n,r,o);if(f===null)return de;const[,...d]=r.getChildren("CodeMark"),x=d.at(-1),E=x===void 0?n.lineAt(r.to).number:n.lineAt(x.from).number-1,c=[];let w="";for(let u=t+1;u<=E;u+=1){const p=n.line(u).text,g=Z.readFencedLine(p,f);if(g===null)return de;c.push(p),w+=u<n.lines?`${g.content}
|
|
3
3
|
`:g.content}return{kind:"found",firstLine:t+1,lines:c,layout:f,body:w}},it=({parent:e,scroll:t,text:n,saved:o,labels:s,revisions:r,onChange:l,onGeometry:i,onSave:f})=>{let d=!1;const x=[_.EditorView.scrollHandler.of((u,p,g)=>(lt(u,p.head,g,t),!0)),_.lineNumbers(),_.highlightActiveLineGutter(),J.history(),_.drawSelection(),_.highlightActiveLine(),Ee.highlightSelectionMatches(),_.EditorView.lineWrapping,we.markdown({base:we.markdownLanguage}),nt,ie.syntaxHighlighting($e),et(s),_.keymap.of([{key:"Mod-s",preventDefault:!0,run:()=>(f(),!0)},...Ee.searchKeymap,...J.historyKeymap,...J.defaultKeymap]),_.EditorView.contentAttributes.of({"aria-label":s.editor,"aria-multiline":"true"}),_.EditorView.updateListener.of(u=>{for(const p of u.transactions)p.docChanged&&r.record(p.changes,p.newDoc);u.docChanged&&l(u.transactions.every(p=>!p.docChanged||p.isUserEvent(Se))),(u.docChanged||u.heightChanged||u.geometryChanged)&&i(u.docChanged&&!d)}),Ke],E=ut(o,x)??K.EditorState.create({doc:n,extensions:x}),c=new _.EditorView({state:E,parent:e});r.mount(c.state.doc);const w=u=>{d=!0;try{u()}finally{d=!1}};return{text:()=>c.state.doc.toString(),replaceText:u=>{const p=c.state.doc.toString();if(p===u)return;let g=0;const y=Math.min(p.length,u.length);for(;g<y&&p.charCodeAt(g)===u.charCodeAt(g);)g+=1;let h=0;for(;h<y-g&&p.charCodeAt(p.length-1-h)===u.charCodeAt(u.length-1-h);)h+=1;c.dispatch({changes:{from:g,to:p.length-h,insert:u.slice(g,u.length-h)},userEvent:"input.replace"})},replaceBody:(u,p,g,y)=>{const{doc:h}=c.state,T=r.lineOf(y,u);if(T===null)return"changed";const O=ye(c.state,T);if(O.kind==="absent")return"changed";if(O.kind==="unreadable")return"unwritable";if(O.body!==Z.fencedBodyAsRead(p,O.layout))return"changed";const L=Z.planFencedBodyEdit(O.lines,O.layout,g);if(L.kind!=="edit")return L.kind;if(L.from===L.to&&L.lines.length===0)return"written";const N=F=>{const j=O.firstLine+F;return j<=h.lines?h.line(j).from:h.length},M=N(L.from),B=`${M===h.length&&h.sliceString(h.length-1)!==`
|
|
4
4
|
`?`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as M, jsxs as re, Fragment as et } from "react/jsx-runtime";
|
|
2
2
|
import { useState as oe, useRef as N, useLayoutEffect as D, useEffectEvent as Ee, useEffect as Ve, useImperativeHandle as tt, useMemo as Y, startTransition as nt, useCallback as J, useId as rt } from "react";
|
|
3
|
-
import { v as ie, k as ge, l as ot, u as se, m as it, n as st, o as lt, p as ct, q as at, t as ut, w as He, A as dt, x as ze, y as ft, E as mt, z as pt, B as ht, G as gt, H as vt, I as xe, J as Se, K as wt, L as bt, M as ye, O as Et, Q as xt, R as St, S as yt } from "./index-
|
|
3
|
+
import { v as ie, k as ge, l as ot, u as se, m as it, n as st, o as lt, p as ct, q as at, t as ut, w as He, A as dt, x as ze, y as ft, E as mt, z as pt, B as ht, G as gt, H as vt, I as xe, J as Se, K as wt, L as bt, M as ye, O as Et, Q as xt, R as St, S as yt } from "./index-CWFyLa0N.js";
|
|
4
4
|
import { fencedBodyAsRead as kt, planFencedBodyEdit as Tt, fencedCodeLanguageOf as At, SPREADSHEETS_LANGUAGE as It, readFencedLine as Ot, listItemWidthOn as Ct, openingFenceOn as Lt } from "@aiquants/markdown/code-blocks";
|
|
5
5
|
import { history as Mt, historyKeymap as qt, defaultKeymap as Rt, historyField as _t, redo as Pt, undo as Nt, isolateHistory as Dt } from "@codemirror/commands";
|
|
6
6
|
import { markdown as Bt, markdownLanguage as Vt } from "@codemirror/lang-markdown";
|
|
@@ -14,10 +14,10 @@ import { SOURCE_LINES_ATTRIBUTE as Ge, parseSourceLines as nn } from "@aiquants/
|
|
|
14
14
|
import { U as rn, k as le, E as on } from "./ownUrls-DD0cSCsF.js";
|
|
15
15
|
import { H as sn, c as ln, M as cn } from "./sanitizePolicy-DAPnUUVm.js";
|
|
16
16
|
import an from "isomorphic-dompurify";
|
|
17
|
-
import { o as un, C as dn, E as fn, m as mn, n as ce, q as pn } from "./location-
|
|
17
|
+
import { o as un, C as dn, E as fn, m as mn, n as ce, q as pn } from "./location-DFfbnUZ9.js";
|
|
18
18
|
import { d as hn } from "./describeValue-CLlVRO8d.js";
|
|
19
19
|
import { PanelGroup as gn, Panel as ke, PanelResizeHandle as vn } from "@aiquants/resize-panels";
|
|
20
|
-
import { t as wn, u as bn } from "./useSplitPersistence-
|
|
20
|
+
import { t as wn, u as bn } from "./useSplitPersistence-CC9bx9iq.js";
|
|
21
21
|
const We = { history: _t }, En = Ft.define([
|
|
22
22
|
{ tag: [_.heading1, _.heading2, _.heading3, _.heading4, _.heading5, _.heading6, _.heading], color: "var(--aqmx-syntax-heading)", fontWeight: "700" },
|
|
23
23
|
{ tag: _.strong, fontWeight: "700" },
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/*! Bundled third-party code: @heroicons/react 2.2.0 (MIT, ./licenses/@heroicons/react/LICENSE) */
|
|
2
2
|
import { jsx as d, jsxs as C, Fragment as mt } from "react/jsx-runtime";
|
|
3
|
-
import { u as D, a4 as xt, w as Ze, A as wt, y as Qt, a5 as ze, c as Jt, Y as gt, a6 as en, a7 as tn, a8 as nn, M as Ve, a9 as rn, aa as ln, ab as an, x as on, ac as sn, ad as cn, ae as dn, af as un, ag as vt, ah as fn, ai as pn, aj as hn } from "./index-
|
|
3
|
+
import { u as D, a4 as xt, w as Ze, A as wt, y as Qt, a5 as ze, c as Jt, Y as gt, a6 as en, a7 as tn, a8 as nn, M as Ve, a9 as rn, aa as ln, ab as an, x as on, ac as sn, ad as cn, ae as dn, af as un, ag as vt, ah as fn, ai as pn, aj as hn } from "./index-CWFyLa0N.js";
|
|
4
4
|
import * as h from "react";
|
|
5
5
|
import { use as Re, createContext as Ce, useState as q, useCallback as w, useMemo as I, useRef as E, useLayoutEffect as $, useEffect as Z, useSyncExternalStore as je, Suspense as bt, useId as qe } from "react";
|
|
6
|
-
import { x as mn, y as xn, z as wn, A as Et, B as gn, D as vn, F as bn, G as at, H as En, I as yn, n as Fe, C as Rn, J as Sn } from "./location-
|
|
6
|
+
import { x as mn, y as xn, z as wn, A as Et, B as gn, D as vn, F as bn, G as at, H as En, I as yn, n as Fe, C as Rn, J as Sn } from "./location-DFfbnUZ9.js";
|
|
7
7
|
import { useHref as ot, useLocation as Tn, useNavigationType as An } from "react-router";
|
|
8
8
|
import { V as st } from "./ownUrls-DD0cSCsF.js";
|
|
9
9
|
import { useDirectoryTreeState as On, DirectoryTree as Nn } from "@aiquants/directory-tree";
|
|
10
|
-
import { TOUCH_TAP_SCROLL_CIRCLE as Ln, TAP_SCROLL_CIRCLE as kn } from "./tapScrollCircle-
|
|
10
|
+
import { TOUCH_TAP_SCROLL_CIRCLE as Ln, TAP_SCROLL_CIRCLE as kn } from "./tapScrollCircle-DKoj17z6.js";
|
|
11
11
|
import { s as Fn } from "./storage-D1uSw-xj.js";
|
|
12
12
|
import { d as yt } from "./describeValue-CLlVRO8d.js";
|
|
13
13
|
import { PanelGroup as Cn, Panel as ct, PanelResizeHandle as qn } from "@aiquants/resize-panels";
|
|
14
|
-
import { t as Pn, u as Mn } from "./useSplitPersistence-
|
|
14
|
+
import { t as Pn, u as Mn } from "./useSplitPersistence-CC9bx9iq.js";
|
|
15
15
|
function _n({
|
|
16
16
|
title: e,
|
|
17
17
|
titleId: t,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! Bundled third-party code: @heroicons/react 2.2.0 (MIT, ./licenses/@heroicons/react/LICENSE) */
|
|
2
|
-
"use strict";const a=require("react/jsx-runtime"),b=require("./index-D6at9qMs.cjs"),n=require("react"),_=require("./location-DFXJSMit.cjs"),Le=require("react-router"),We=require("./ownUrls-BTPGNhBt.cjs"),rt=require("@aiquants/directory-tree"),nt=require("./tapScrollCircle-ExxyHVWY.cjs"),qt=require("./storage-BpYsprog.cjs"),lt=require("./describeValue-Ccvhbt36.cjs"),ke=require("@aiquants/resize-panels"),Xe=require("./useSplitPersistence-BCitqdAe.cjs");function Mt(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const l=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,l.get?l:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const h=Mt(n);function _t({title:e,titleId:t,...r},l){return h.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},r),e?h.createElement("title",{id:t},e):null,h.createElement("path",{fillRule:"evenodd",d:"M19.5 21a3 3 0 0 0 3-3V9a3 3 0 0 0-3-3h-5.379a.75.75 0 0 1-.53-.22L11.47 3.66A2.25 2.25 0 0 0 9.879 3H4.5a3 3 0 0 0-3 3v12a3 3 0 0 0 3 3h15ZM9 12.75a.75.75 0 0 0 0 1.5h6a.75.75 0 0 0 0-1.5H9Z",clipRule:"evenodd"}))}const It=h.forwardRef(_t);function Dt({title:e,titleId:t,...r},l){return h.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},r),e?h.createElement("title",{id:t},e):null,h.createElement("path",{fillRule:"evenodd",d:"M19.5 21a3 3 0 0 0 3-3V9a3 3 0 0 0-3-3h-5.379a.75.75 0 0 1-.53-.22L11.47 3.66A2.25 2.25 0 0 0 9.879 3H4.5a3 3 0 0 0-3 3v12a3 3 0 0 0 3 3h15Zm-6.75-10.5a.75.75 0 0 0-1.5 0v2.25H9a.75.75 0 0 0 0 1.5h2.25v2.25a.75.75 0 0 0 1.5 0v-2.25H15a.75.75 0 0 0 0-1.5h-2.25V10.5Z",clipRule:"evenodd"}))}const Ht=h.forwardRef(Dt);function Bt({title:e,titleId:t,...r},l){return h.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},r),e?h.createElement("title",{id:t},e):null,h.createElement("path",{d:"M16.5 6a3 3 0 0 0-3-3H6a3 3 0 0 0-3 3v7.5a3 3 0 0 0 3 3v-6A4.5 4.5 0 0 1 10.5 6h6Z"}),h.createElement("path",{d:"M18 7.5a3 3 0 0 1 3 3V18a3 3 0 0 1-3 3h-7.5a3 3 0 0 1-3-3v-7.5a3 3 0 0 1 3-3H18Z"}))}const Zt=h.forwardRef(Bt);function $t({title:e,titleId:t,...r},l){return h.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},r),e?h.createElement("title",{id:t},e):null,h.createElement("path",{fillRule:"evenodd",d:"M3 6a3 3 0 0 1 3-3h2.25a3 3 0 0 1 3 3v2.25a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3V6Zm9.75 0a3 3 0 0 1 3-3H18a3 3 0 0 1 3 3v2.25a3 3 0 0 1-3 3h-2.25a3 3 0 0 1-3-3V6ZM3 15.75a3 3 0 0 1 3-3h2.25a3 3 0 0 1 3 3V18a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3v-2.25Zm9.75 0a3 3 0 0 1 3-3H18a3 3 0 0 1 3 3V18a3 3 0 0 1-3 3h-2.25a3 3 0 0 1-3-3v-2.25Z",clipRule:"evenodd"}))}const zt=h.forwardRef($t),Vt="http://path.invalid",Kt=/[\t\n\r]/gu,Ut=(e,t,r,l)=>{const c=e.replace(Kt,"");if(!c.startsWith("/")||c.startsWith("//")||c.includes("\\"))return null;const{pathname:i,search:o,hash:s}=new URL(c,Vt);return!We.isUnder(i,[t])||We.isUnder(i,[r])?null:`${l}${i.slice(t.length)}${o}${s}`},Wt=()=>{const{notices:e,config:t}=b.useExplorer(),r=n.use(e),l=Le.useHref(t.basePath),c=Le.useHref(t.dataPath);return r.length===0?null:a.jsx("div",{className:"aqmx-explorer-notices",children:r.map(i=>{const o=i.action===void 0?null:Ut(i.action.href,l,c,t.basePath);return a.jsxs("div",{className:"aqmx-callout","data-aqmx-tone":i.tone,"data-testid":"markdown-explorer-notice","data-aqmx-notice":i.id,children:[a.jsx("p",{className:"aqmx-callout-title",children:i.title}),i.body===void 0?null:a.jsx("p",{className:"aqmx-callout-body",children:i.body}),i.action===void 0?null:o===null?a.jsx("a",{className:"aqmx-callout-action",href:i.action.href,children:i.action.label}):a.jsx(b.ExplorerLink,{className:"aqmx-callout-action",to:o,navigation:"follow-link",children:i.action.label})]},i.id)})})};function Xt({title:e,titleId:t,...r},l){return h.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},r),e?h.createElement("title",{id:t},e):null,h.createElement("path",{fillRule:"evenodd",d:"M6.912 3a3 3 0 0 0-2.868 2.118l-2.411 7.838a3 3 0 0 0-.133.882V18a3 3 0 0 0 3 3h15a3 3 0 0 0 3-3v-4.162c0-.299-.045-.596-.133-.882l-2.412-7.838A3 3 0 0 0 17.088 3H6.912Zm13.823 9.75-2.213-7.191A1.5 1.5 0 0 0 17.088 4.5H6.912a1.5 1.5 0 0 0-1.434 1.059L3.265 12.75H6.11a3 3 0 0 1 2.684 1.658l.256.513a1.5 1.5 0 0 0 1.342.829h3.218a1.5 1.5 0 0 0 1.342-.83l.256-.512a3 3 0 0 1 2.684-1.658h2.844Z",clipRule:"evenodd"}))}const Gt=h.forwardRef(Xt),qe=n.createContext(!0),at=n.createContext(null),ot="\0loop\0",st="\0",Yt=()=>{const e=new WeakMap,t=new WeakMap,r=new WeakMap,l=o=>{const s=e.get(o);if(s!==void 0)return s;const p=Object.freeze({type:"loop",name:o.name,path:o.path});return e.set(o,p),p},c=(o,s,p)=>{let f=!1;const d=o.map(m=>{const w=i(m,s,p);return w!==m&&(f=!0),w});if(!f)return o;const u=r.get(o);return u!==void 0&&u.length===d.length&&u.every((m,w)=>m===d[w])?u:(r.set(o,d),d)},i=(o,s,p)=>{if(o.type!=="directory")return o;if(p.has(o.path))return l(o);const f=o.lazy===!0?s(o.path):void 0,d=f?.status==="loaded",u=d?f.entries:o.children;if(u===void 0)return o;p.add(o.path);const m=c(u,s,p);if(p.delete(o.path),!d&&m===o.children)return o;const w=t.get(o);if(w!==void 0&&w.state===f&&w.children===m)return w.grafted;const g={...o,children:m,lazy:d?!1:o.lazy};return t.set(o,{state:f,children:m,grafted:g}),g};return(o,s)=>c(o,s,new Set)},Qt=(e,t)=>`${ot}${e}${st}${t}`,me=e=>e.startsWith(ot),Jt=e=>e.slice(e.lastIndexOf(st)+1),ae="data-aqmx-path",er=(e,t,r,l,c)=>{const i={aqmxPath:e.path};return e.modifiedAt!==void 0&&(i.aqmxModifiedAt=e.modifiedAt),r&&(i.aqmxOpen=!0),(l==="loading"||l==="failed")&&(i.aqmxChildren=l),{name:e.name,type:e.type,absolutePath:e.path,relativePath:e.path,mimeType:e.mimeType,children:t,label:c,data:i}},tr=(e,t,r,l)=>{const c=Qt(t,e.path);return{name:r,type:"directory",absolutePath:c,relativePath:c,children:l,data:{aqmxLoop:e.path}}},rr=()=>{const e=new WeakMap,t=new WeakMap,r=new WeakMap,l=[],c=(s,p,f)=>{const d=s.map(m=>m.type==="loop"?i(m,p,f):o(m,p)),u=r.get(s);return u!==void 0&&u.length===d.length&&u.every((m,w)=>m===d[w])?u:(r.set(s,d),d)},i=(s,p,f)=>{const d=t.get(s);if(d!==void 0&&d.parentKey===f&&d.loopFolderName===p.loopFolderName)return d.row;const u=tr(s,f,p.loopFolderName(s.name),l);return t.set(s,{row:u,parentKey:f,loopFolderName:p.loopFolderName}),u},o=(s,p)=>{const f=s.type==="directory"?s.children===void 0?l:c(s.children,p,s.path):void 0,d=p.openPaths.has(s.path),u=s.type==="directory"&&s.lazy===!0?p.childrenOf(s.path)?.status:void 0,m=u==="failed"?p.renderFailedFolder:void 0,w=e.get(s);if(w!==void 0&&w.open===d&&w.childrenStatus===u&&w.children===f&&w.renderFailedFolder===m)return w.row;const g=er(s,f,d,u,m===void 0?void 0:m(s));return e.set(s,{row:g,open:d,childrenStatus:u,children:f,renderFailedFolder:m}),g};return(s,p)=>c(s,p,"")},nr=e=>{if(e===void 0)return;const t=r=>{const l=r.data?.aqmxModifiedAt;return typeof l=="number"?{name:r.name,path:r.absolutePath,type:r.type,modifiedAt:l}:{name:r.name,path:r.absolutePath,type:r.type}};return(r,l)=>e(t(r),t(l))},Fe=(e,t)=>{const r=e.filter(l=>l.type==="directory");return t===void 0?r:r.sort(t)},lr=(e,t)=>{const r=new Map;let l=0;const c=i=>{for(const o of Fe(i,t.compare))if(t.isShownExpanded(o.path)){if(o.lazy!==!0){o.children!==void 0&&c(o.children);continue}r.has(o.path)||(r.set(o.path,t.isDirect(o.path)?"direct":"bulk"),t.childrenOf(o.path)?.status!=="failed"&&(l+=1))}};return c(e),{folders:r,waiting:l}},ar=e=>{const t=new Set,r=l=>{for(const c of l)c.type==="directory"&&(c.lazy===!0&&t.add(c.path),c.children!==void 0&&r(c.children))};return r(e),t},ct=(e,t)=>{for(const r of e){if(r.type!=="directory")continue;if(r.path===t)return r;const l=r.children===void 0?null:ct(r.children,t);if(l!==null)return l}return null},it=(e,t,r)=>{for(const l of e){if(l===t)return{parent:r};const c=l.children===void 0?null:it(l.children,t,l);if(c!==null)return c}return null},or=(e,t,r)=>{const l=it(e,r,null);if(l===null)throw new Error(`[markdown-explorer] the pressed folder's row is not among the tree's rows: ${lt.describeValue(r.absolutePath)}`);if(l.parent!==null)return{kind:"folder",path:l.parent.absolutePath};const c=_.folderReadmeOf(t.filter(i=>i.type!=="loop"));return c===null?{kind:"nothing"}:{kind:"document",path:c}},sr=(e,t,r,l)=>{let c=e;for(const i of t){const o=c.find(s=>s.type==="directory"&&s.path===i);if(o===void 0)return"missing";if(o.lazy===!0)return l.childrenOf(o.path)?.status==="failed"?"failed":"loading";if(!l.isShownExpanded(o.path))return"loading";c=o.children??[]}return c.some(i=>i.type==="file"&&i.path===r)?"ready":"missing"},Ge=new Set,cr=(e,t)=>e.has(t)?e:new Set(e).add(t),ir=(e,t)=>{if(!t.some(l=>e.has(l)))return e;const r=new Set(t);return new Set([...e].filter(l=>!r.has(l)))},ur=(e,t)=>[...e].every(r=>t.has(r))?e:new Set([...e].filter(r=>t.has(r))),dr=()=>{const[e,t]=n.useState(Ge),r=n.useCallback(o=>t(s=>cr(s,o)),[]),l=n.useCallback(o=>t(s=>ir(s,o)),[]),c=n.useCallback(o=>t(s=>ur(s,o)),[]),i=n.useCallback(()=>t(Ge),[]);return n.useMemo(()=>({direct:e,markDirect:r,unmarkDirect:l,pruneDirect:c,clearDirect:i}),[e,r,l,c,i])},fr=e=>({budget:e,handled:new Set,loads:new Set,opened:0,folderLimited:!1,depthLimited:!1,announcedStart:!1,issuedAgainst:null}),pr=(e,t)=>{const r=[];let l=Fe(t.entries,t.compare);for(let c=1;l.length>0;c+=1){const i=[];for(const o of l){const{path:s}=o;if(t.isShownExpanded(s))e.handled.add(s);else{if(e.handled.has(s))continue;if(e.handled.add(s),o.lazy===!0&&t.childrenOf(s)===void 0){if(c>e.budget.maxDepth){e.depthLimited=!0;continue}if(e.loads.size>=e.budget.maxFolders){e.folderLimited=!0;continue}e.loads.add(s)}r.push(s),e.opened+=1}o.lazy!==!0&&o.children!==void 0&&i.push(...Fe(o.children,t.compare))}l=i}return r},ut=(e,t)=>e.every(r=>r.type!=="directory"||t(r.path)&&(r.lazy===!0||r.children===void 0||ut(r.children,t))),mr=(e,t)=>{if(e.folderLimited)return{kind:"folder-limit",opened:e.opened};if(e.depthLimited)return{kind:"depth-limit",opened:e.opened};let r=0;for(const l of e.loads)t.childrenOf(l)?.status==="failed"&&(r+=1);return{kind:"done",opened:e.opened,failed:r,complete:ut(t.entries,t.isShownExpanded)}},Ne=Object.freeze({state:"idle"}),hr=e=>{const t=n.useRef(null),r=n.useRef(e),[l,c]=n.useState(Ne);n.useLayoutEffect(()=>{r.current=e});const i=n.useCallback(()=>{t.current===null&&(t.current=fr(r.current.budget),c({state:"running",opened:0}))},[]),o=n.useCallback(()=>{t.current=null,c(Ne)},[]),s=n.useCallback(p=>{const f=t.current;if(f===null)return;const d=pr(f,p);if(d.length>0&&(f.issuedAgainst=p.expanded,r.current.expandMultiple([...d])),!f.announcedStart&&(f.loads.size>0||p.waiting>0)&&(f.announcedStart=!0,r.current.onStart()),d.length===0&&!p.expansionPending&&p.expanded!==f.issuedAgainst&&p.waiting===0){t.current=null;const m=mr(f,p);c(m.kind==="done"?Ne:{state:"stopped",stop:m.kind,opened:m.opened}),r.current.onFinish(m);return}const{opened:u}=f;c(m=>m.state==="running"&&m.opened===u?m:{state:"running",opened:u})},[]);return n.useMemo(()=>({status:l,start:i,end:o,advance:s}),[l,i,o,s])},Ye=["pointerdown","wheel","touchstart","keydown","focusin"],xr=8,Qe={least:Number.POSITIVE_INFINITY,stalled:0},wr=({tree:e,container:t,path:r,chain:l,rows:c,cancel:i,displayed:o,placement:s})=>{const p=n.useRef(null),f=n.useRef(!0),d=n.useRef(Qe),u=n.useRef(null),m=n.useRef(null),w=n.useRef(l),g=n.useRef(s);n.useLayoutEffect(()=>{w.current=l,g.current=s},[l,s]);const v=n.useCallback(()=>{const k=u.current;k!==null&&(u.current=null,k.phase==="asking"?k.controller.abort():w.current?.open(null))},[]),y=n.useCallback(()=>{p.current=null,v()},[v]),T=n.useCallback(()=>{const k=t.current;p.current===null||m.current!==null||k===null||k.getClientRects().length===0||(m.current=requestAnimationFrame(()=>{m.current=null;const j=p.current;if(j===null)return;const P=g.current(j);if(P===0){f.current=!0,u.current?.phase==="opening"&&v();return}if(e.current?.scrollToPath(j,{align:"nearest"})===!0){u.current?.phase==="opening"&&v();const{least:C,stalled:q}=d.current;d.current=P<C?{least:P,stalled:0}:{least:C,stalled:q+1},d.current.stalled<xr&&T();return}const S=u.current;if(S===null){p.current=null;return}S.phase==="opening"&&w.current?.progress(S.folders,j)!=="loading"&&y()}))},[e,t,v,y]),A=n.useCallback(()=>{f.current=!1,d.current=Qe,T()},[T]);n.useEffect(()=>{const k=t.current;if(k===null)return;const j=typeof ResizeObserver>"u"?null:new ResizeObserver(A);j?.observe(k);for(const P of Ye)k.addEventListener(P,y,{passive:!0});return()=>{j?.disconnect();for(const P of Ye)k.removeEventListener(P,y);m.current!==null&&cancelAnimationFrame(m.current),m.current=null,v()}},[t,A,y,v]);const R=l!==null;n.useEffect(()=>{const k=t.current;if(y(),r===null||k===null||k.contains(k.ownerDocument.activeElement))return;p.current=r;const j=w.current;if(R&&j!==null){const P=new AbortController,S={phase:"asking",controller:P};u.current=S,j.ancestors(r,P.signal).then(C=>{u.current===S&&(C===null?u.current=null:(u.current={phase:"opening",folders:C},w.current?.open(C)),A())})}A()},[r,R,t,y,A]),n.useEffect(()=>{(u.current?.phase==="opening"||p.current!==null&&!f.current)&&A()},[c,A]);const I=n.useRef(i);n.useEffect(()=>{I.current!==i&&(I.current=i,y())},[i,y]);const M=n.useRef(o);n.useEffect(()=>{M.current&&!o&&v(),M.current=o},[o,v])},gr="--aqmx-tree-line",br=Object.freeze(["(forced-colors: active)","(prefers-color-scheme: dark)"]),Er="data-aqmx-tree-probe",vr=Object.freeze({rowHeight:_.CONTROL_BLOCK_PIXELS,lineColor:null}),Rr=(e,t,r)=>{const[l,c]=n.useState(vr);return n.useLayoutEffect(()=>{const i=e.current;if(i===null)return;const o=()=>{const f=Math.round(i.getBoundingClientRect().height),d=getComputedStyle(i),u=d.getPropertyValue(gr).trim()===""?null:d.color;c(m=>{const w=Number.isFinite(f)&&f>0?f:m.rowHeight;return m.rowHeight===w&&m.lineColor===u?m:{rowHeight:w,lineColor:u}})};o();const s=br.map(f=>window.matchMedia(f));for(const f of s)f.addEventListener("change",o);const p=typeof ResizeObserver>"u"?null:new ResizeObserver(o);return p?.observe(i),()=>{for(const f of s)f.removeEventListener("change",o);p?.disconnect()}},[e,t,r]),l},dt="markdown-explorer-tree-scroll",Sr=.5,ft=(e,t)=>[...e.querySelectorAll(`[role="treeitem"][${ae}]`)].find(r=>r.getAttribute(ae)===t),yr=(e,t)=>{const r=ft(e,t),l=r?.closest(`[data-testid="${dt}"]`);if(r===void 0||l===null||l===void 0)return Number.POSITIVE_INFINITY;const c=l.getBoundingClientRect(),i=r.getBoundingClientRect(),o=c.top-i.top,s=i.height>c.height?Math.abs(o):Math.max(0,o)+Math.max(0,i.bottom-c.bottom);return s<=Sr?0:s},Pe=Object.freeze({testId:dt,overscanCount:13,callbackThrottleMs:13,scrollBarOptions:Object.freeze({width:8,...b.SCROLL_BAR_CONTROLS,enableArrowButtons:!0,enableArrowButtonTabStops:!1,enableScrollToTopBottomButtons:!0,tapScrollCircleOptions:nt.TAP_SCROLL_CIRCLE}),behaviorOptions:Object.freeze({enablePointerDrag:!0})}),kr=Object.freeze({...Pe,scrollBarOptions:Object.freeze({...Pe.scrollBarOptions,...b.TOUCH_SCROLL_BAR_CONTROLS,tapScrollCircleOptions:nt.TOUCH_TAP_SCROLL_CIRCLE})}),Cr=e=>e?kr:Pe,Lr={hoverClassName:"",directorySelectedClassName:"",itemSelectedClassName:""},Tr={color:"inherit",fontSize:"inherit"},jr={fontSize:"inherit"},Ar=new Set,Or=new Map,Nr={color:"var(--aqmx-tree-line)"},pt=e=>e instanceof Element?e.closest(`[${ae}]`):null,Fr=e=>{const t=pt(e);return t===null||t.getAttribute("data-entry-type")!=="file"?null:t.getAttribute(ae)},mt=(e,t,r,l)=>r==="folder-limit"?e.expandAllFolderLimit(l,t.maxFolders,e.expandAll):e.expandAllDepthLimit(l,t.maxDepth),Pr=(e,t,r)=>r.kind==="done"?e.expandAllDone(r.opened,r.failed,r.complete):mt(e,t,r.kind,r.opened),ht=()=>{const{labels:e}=b.useExplorer();return a.jsxs("div",{className:"aqmx-explorer-loading","aria-busy":"true","data-testid":"markdown-explorer-tree-loading",children:[a.jsx("p",{className:"aqmx-explorer-loading-text",children:e.treeLoading}),a.jsxs("div",{className:"aqmx-skeleton","aria-hidden":"true",children:[a.jsx("span",{}),a.jsx("span",{}),a.jsx("span",{}),a.jsx("span",{}),a.jsx("span",{})]})]})},qr=()=>{const{labels:e}=b.useExplorer();return a.jsxs("div",{className:"aqmx-empty","data-testid":"markdown-explorer-tree-empty",children:[a.jsx(Gt,{className:"aqmx-explorer-empty-icon","aria-hidden":"true"}),a.jsx("p",{className:"aqmx-empty-title",children:e.treeEmptyTitle}),a.jsx("p",{className:"aqmx-explorer-empty-body",children:e.treeEmptyBody})]})},Mr=({name:e,onRetry:t})=>{const{labels:r}=b.useExplorer(),l=n.useId();return a.jsxs("span",{className:"aqmx-explorer-folder-failed",children:[a.jsx("span",{className:"aqmx-explorer-folder-name",children:e}),a.jsx("span",{id:l,className:"aqmx-explorer-folder-error",children:r.folderLoadFailed}),a.jsxs("button",{type:"button",className:"aqmx-explorer-folder-retry","aria-describedby":l,"data-testid":"markdown-explorer-folder-retry",onClick:c=>{c.stopPropagation();const i=c.currentTarget,o=i.ownerDocument.activeElement===i?i.closest('[role="treeitem"]'):null;o instanceof HTMLElement&&b.focusWithoutScroll(o),t()},onKeyDown:c=>{c.key!=="Escape"&&c.stopPropagation()},children:[a.jsx(b.ForwardRef,{className:"aqmx-explorer-folder-retry-icon","aria-hidden":"true"}),a.jsx("span",{className:"aqmx-explorer-folder-retry-text",children:r.retry})]})]})},_r=({entries:e,version:t,mode:r,sourceId:l,settings:c,reveal:i,openPaths:o,selection:s,onOpenDocument:p,folders:f,onRevealSource:d,expansion:u,onShown:m,marks:w,claimsHeld:g,expandAll:v,revealCancel:y})=>{const{trees:T,documents:A,labels:R,locale:I,theme:M,paletteKey:k,data:j,config:P,sources:S,reveals:C}=b.useExplorer(),q=n.use(qe),L=n.use(at),[D]=n.useState(()=>L?.get(l)),W=Cr(b.useCoarsePointer()),ce=n.useMemo(()=>D===void 0?W:{...W,initialScrollAnchor:D},[W,D]),[ie]=n.useState(rr),V=n.useRef(null),{rowHeight:oe,lineColor:X}=Rr(V,M,k),{isExpanded:Y,toggle:se,expandMultiple:H,collapseMultiple:ue,expanded:K,isPending:N}=u,{alwaysExpanded:Q,sortMode:U,folderPlacement:de,readmePlacement:fe}=c,{direct:ge,markDirect:J,unmarkDirect:te,pruneDirect:be}=w,{running:he,advance:xe}=v,O=n.useRef(null),$=n.useRef(null);n.useLayoutEffect(()=>{if(L===null)return;const x=O;return()=>{const E=x.current===null?null:x.current.getScrollAnchor();E===null?L.delete(l):L.set(l,E)}},[L,l]);const G=n.useMemo(()=>_.createEntryComparator({sortMode:U,folderPlacement:de,readmePlacement:fe}),[U,de,fe]),Rt=n.useMemo(()=>nr(G),[G]),ee=n.useCallback(x=>T.children(l,x),[T,l]),re=n.useMemo(()=>ar(e),[e]),we=n.useCallback(x=>Q&&!re.has(x),[Q,re]),ne=n.useCallback(x=>!me(x)&&(Y(x)||we(x)),[Y,we]),B=n.useRef({shownExpanded:ne,isExpanded:Y,isHeld:we,unloadedFolders:re,entries:e,childrenOf:ee,folderSelection:f,openDocument:p});n.useLayoutEffect(()=>{B.current={shownExpanded:ne,isExpanded:Y,isHeld:we,unloadedFolders:re,entries:e,childrenOf:ee,folderSelection:f,openDocument:p}},[ne,Y,we,re,e,ee,f,p]);const[le]=n.useState(()=>new Map),Te=n.useCallback((x,E)=>{C.settle(E),x.open(E)},[C]),Ee=n.useCallback((x,E)=>{E.kind!=="nothing"&&C.settle(E.path),x.close(E)},[C]),pe=n.useCallback((x,E)=>{for(const F of x){const Z=le.get(F);if(Z===void 0)continue;le.delete(F);const z=B.current.folderSelection;!E&&z!==null&&z.current===F&&Ee(z,Z)}},[le,Ee]),De=n.useCallback(x=>{O.current?.scrollToPath(x,{align:"nearest"}),requestAnimationFrame(()=>{const E=$.current,F=E===null?void 0:ft(E,x);F!==void 0&&b.focusWithoutScroll(F)})},[]),St=n.useCallback(x=>{if(me(x)){De(Jt(x));return}pe([x],!B.current.shownExpanded(x)),B.current.isExpanded(x)?te([x]):B.current.unloadedFolders.has(x)&&J(x),se(x)},[De,pe,J,te,se]),je=n.useCallback(x=>{const E=x.filter(F=>!me(F));E.length!==0&&(pe(E,!1),te(E),ue(E))},[pe,te,ue]),yt=n.useCallback(x=>{const E=x.filter(F=>!me(F));if(E.length!==0){if(E.length<x.length&&E.every(F=>B.current.shownExpanded(F))){je(E);return}pe(E,!0),H(E)}},[pe,H,je]),He=n.useCallback(x=>a.jsx(Mr,{name:x.name,onRetry:()=>{J(x.path),T.retryChildren(l,x.path),B.current.shownExpanded(x.path)||H([x.path])}}),[T,l,J,H]),Be=r==="multi"?o:Ar,{loopFolderName:Ze}=R,ve=n.useMemo(()=>ie(e,{openPaths:Be,childrenOf:ee,renderFailedFolder:He,loopFolderName:Ze}),[ie,e,Be,ee,He,Ze,t]),$e=n.useRef(ve);n.useLayoutEffect(()=>{$e.current=ve},[ve]);const kt=b.useIntentPrefetch(A,Fr),ze=n.useRef([]),Re=n.useCallback(()=>{for(const x of ze.current)B.current.unloadedFolders.has(x)&&J(x)},[J]),{maxDepth:Ae}=P.revealDocument,Ve=n.useRef(d);n.useLayoutEffect(()=>{Ve.current=d},[d]);const Ct=n.useMemo(()=>({ancestors:async(x,E)=>{const F=C.take(l,x);if(F!==null)return F;if(!C.mayMove(x)){const z=await j.ancestors(l,x,E);return z.status!=="ok"||z.ancestors===null||z.ancestors.length>Ae?null:z.ancestors}const Z=await j.reveal(l,x,E);return Z.status!=="ok"||Z.source===null||Z.ancestors.length>Ae?null:Z.source===l?Z.ancestors:(E.aborted||!S.some(z=>z.id===Z.source)||(C.move(Z.source,x,Z.ancestors),Ve.current(Z.source)),null)},open:x=>{ze.current=x??[],x!==null&&(Re(),H([...x]))},progress:(x,E)=>sr(B.current.entries,x,E,{isShownExpanded:B.current.shownExpanded,childrenOf:B.current.childrenOf})}),[j,l,S,C,Ae,Re,H]);n.useEffect(()=>Re(),[Re,re]);const Lt=n.useMemo(()=>[e,t,K],[e,t,K]),Tt=n.useCallback(x=>$.current===null?Number.POSITIVE_INFINITY:yr($.current,x),[]);wr({tree:O,container:$,path:i.path,chain:i.openFolders?Ct:null,rows:Lt,cancel:y,displayed:q,placement:Tt});const Ke=n.useCallback(x=>ge.has(x),[ge]),Se=n.useMemo(()=>lr(e,{isShownExpanded:ne,childrenOf:ee,compare:G,isDirect:Ke}),[e,ne,ee,G,Ke,t]),ye=q&&g;n.useLayoutEffect(()=>{m(e)},[e,m]),n.useLayoutEffect(()=>()=>m(null),[m]),n.useEffect(()=>T.claimChildren(l,ye?Se.folders:Or),[T,l,ye,Se]),n.useEffect(()=>be(re),[be,re]),n.useEffect(()=>{ye&&he&&xe({entries:e,isShownExpanded:ne,childrenOf:ee,compare:G,expanded:K,waiting:Se.waiting,expansionPending:N})},[ye,he,xe,e,ne,ee,G,K,Se,N]);const jt=n.useCallback(x=>{const E=x.entry.absolutePath,{folderSelection:F,openDocument:Z}=B.current;if(x.isDirectory){if(F===null||me(E))return;const z=E===F.current,Ue=or($e.current,B.current.entries,x.entry);if(B.current.isHeld(E)){x.preventDefault(),le.delete(E),z?Ee(F,Ue):Te(F,E);return}le.set(E,Ue),x.isExpanded||z||Te(F,E);return}C.settle(E),Z(E)},[C,le,Ee,Te]),At=n.useCallback(x=>{if(x.key!=="ArrowLeft"&&x.key!=="ArrowRight")return;const E=pt(x.target),F=E===null?null:E.getAttribute(ae);F!==null&&le.delete(F)},[le]),{onChange:Oe}=s,Ot=n.useMemo(()=>Oe===null?void 0:(x,E)=>{me(x.absolutePath)||Oe({path:x.absolutePath,name:x.name,selected:E})},[Oe]),Nt=n.useMemo(()=>new Set(s.items),[s.items]),Ft=n.useMemo(()=>({entryKindDirectory:R.treeEntryKindDirectory,entryKindFile:R.treeEntryKindFile,scrollUp:R.treeScrollUp,scrollDown:R.treeScrollDown,scrollToTop:R.treeScrollToTop,scrollToBottom:R.treeScrollToBottom}),[R]),Pt=X===null?{showTreeLines:!1}:{showTreeLines:c.lines,lineColor:X};return a.jsxs("div",{ref:$,className:"aqmx-explorer-tree","data-testid":"markdown-explorer-tree",onKeyDownCapture:At,...kt,children:[a.jsx("span",{ref:V,className:"aqmx-explorer-tree-probe","aria-hidden":"true",[Er]:""}),a.jsx(rt.DirectoryTree,{ref:O,entries:ve,expansion:{toggle:St,isExpanded:ne,expandMultiple:yt,collapseMultiple:je,isPending:N&&!he,doubleClickAction:c.doubleClickAction},selection:{mode:s.mode,selectedPath:s.shownPath,currentPath:s.shownPath,selectedItems:Nt,onEntryClick:jt,onSelectionChange:Ot},visual:{className:"aqmx-explorer-tree-view",ariaLabel:R.treeRegion,...Pt,showExpandIcons:c.expandIcons,expandIconStyle:Nr,showDirectoryIcons:c.directoryIcons,showFileIcons:c.fileIcons,expandIconSize:c.expandIconSize,itemHeight:oe,removeRootIndent:c.removeRootIndent,highlightStyles:Lr,entryStyle:jr,nameStyle:Tr},virtualScroll:ce,sort:Rt,locale:I,labels:Ft})]})},Ir=({pending:e,status:t})=>{const{labels:r}=b.useExplorer(),l=t.state!=="running",[c,i]=n.useState(0),o=n.useRef(!0);n.useLayoutEffect(()=>{const p=o.current;if(o.current=l,!l||e>0&&!p){i(0);return}if(e>0){i(e);return}if(c===0)return;const f=setTimeout(()=>i(0),0);return()=>clearTimeout(f)},[l,e,c]);const s=l&&e===0?c:e;return s===0&&l?null:a.jsxs("p",{className:"aqmx-explorer-tree-progress","data-testid":"markdown-explorer-tree-progress","data-aqmx-loading":String(s),"data-aqmx-expand-all":t.state,children:[s>0?a.jsx(b.ForwardRef,{className:"aqmx-explorer-tree-progress-icon","aria-hidden":"true"}):null,a.jsx("span",{children:t.state==="running"?r.expandAllProgress(t.opened,s):r.foldersLoading(s)})]})},Dr=({stop:e,opened:t,budget:r})=>{const{labels:l}=b.useExplorer();return a.jsx("p",{className:"aqmx-explorer-expand-all-stop","data-testid":"markdown-explorer-expand-all-stop","data-aqmx-stop":e,children:mt(l,r,e,t)})},Hr=({entries:e,...t})=>{const{trees:r}=b.useExplorer(),l=n.useSyncExternalStore(r.subscribe,r.version,r.version),{sourceId:c}=t,[i]=n.useState(Yt),o=n.useMemo(()=>i(e,s=>r.children(c,s)),[i,e,r,c,l]);return o.length===0?a.jsx(qr,{}):a.jsx(_r,{entries:o,version:l,...t})},Br=({result:e,onRetry:t,...r})=>{const{renderTreeFailure:l}=b.useExplorer(),c=n.use(e);if(c.status==="deferred")return a.jsx(ht,{});if(c.status==="ok")return a.jsx(Hr,{entries:c.entries,...r});const i=l?.(c.failure);return a.jsx("div",{className:"aqmx-explorer-tree-message","data-testid":"markdown-explorer-tree-failure","data-aqmx-failure":c.failure.reason,children:i!==void 0?i:a.jsx(b.FailureView,{failure:c.failure,alert:!0,onRetry:t,testId:null})})},Zr=Object.freeze([]),$r=e=>e!==void 0&&e.status==="failed"&&b.isAccessFailureReason(e.failure.reason),zr=({failure:e,onRetry:t})=>a.jsx(b.AccessFailureNotice,{failure:e,place:"read",deniedSentence:null,retry:t,testId:"markdown-explorer-folder-access-failure"}),Vr=({onControls:e,...t})=>{const{trees:r,storageNamespace:l,labels:c,announcer:i,config:o}=b.useExplorer(),{sourceId:s}=t,p=rt.useDirectoryTreeState({storageKey:qt.storageKeys(l).treeExpansion(s)});n.useSyncExternalStore(r.subscribe,r.version,r.version);const f=r.read(s),d=n.useCallback(()=>r.retry(s),[r,s]);n.useLayoutEffect(()=>r.open(s),[r,s]);const u=dr(),{expanded:m,expandMultiple:w,collapseAll:g}=p,[v,y]=n.useState(null),T=v!==m,A=n.useRef(m);n.useLayoutEffect(()=>{A.current=m},[m]);const R=o.expandAll,I=n.useCallback(()=>i.announce(c.expandAllStarted),[i,c]),M=n.useCallback(N=>i.announce(Pr(c,R,N)),[i,c,R]),k=hr({budget:R,expandMultiple:w,onStart:I,onFinish:M}),{status:j,start:P,end:S,advance:C}=k,q=j.state==="running",L=n.useMemo(()=>({running:q,advance:C}),[q,C]),D=n.useRef(null),[W,ce]=n.useState(!1),ie=n.useCallback(N=>{D.current=N,ce(N!==null)},[]),[V,oe]=n.useState(null);n.useEffect(()=>r.subscribeChildrenFailures(N=>{const Q=N.sourceId===s&&D.current!==null?ct(D.current,N.path):null;if(Q!==null){if(b.isAccessFailureReason(N.failure.reason)){oe(U=>U===null?{failure:N.failure,paths:[N.path]}:U.paths.includes(N.path)?U:{failure:U.failure,paths:[...U.paths,N.path]});return}i.announce({list:c.foldersLoadFailedNamed,item:Q.name})}}),[r,s,i,c]);const X=V===null?Zr:V.paths.filter(N=>$r(r.children(s,N)));V!==null&&X.length===0&&oe(null);const Y=()=>{for(const N of X)r.retryChildren(s,N)},{clearDirect:se}=u,[H,ue]=n.useState(0),K=n.useCallback(()=>{ue(N=>N+1),S(),se(),y(A.current),g()},[S,se,g]);return n.useEffect(()=>{e({collapseAll:K,expandAll:W?P:null,expanding:q})},[e,K,P,W,q]),n.useEffect(()=>()=>e(null),[e]),n.useEffect(()=>{W||S()},[W,S]),a.jsxs(a.Fragment,{children:[V===null||X.length===0?null:a.jsx(zr,{failure:V.failure,onRetry:Y}),j.state==="stopped"?a.jsx(Dr,{stop:j.stop,opened:j.opened,budget:R}):null,a.jsxs("div",{className:"aqmx-explorer-tree-area",children:[a.jsx(n.Suspense,{fallback:a.jsx(ht,{}),children:a.jsx(Br,{result:f,onRetry:d,expansion:p,onShown:ie,marks:u,claimsHeld:T,expandAll:L,revealCancel:H,...t})}),a.jsx(Ir,{pending:r.pendingChildren(s),status:j})]})]})};function Kr({title:e,titleId:t,...r},l){return h.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},r),e?h.createElement("title",{id:t},e):null,h.createElement("path",{fillRule:"evenodd",d:"M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))}const Me=h.forwardRef(Kr),Je="markdown-explorer-selection-remove",Ur=({selection:e,onRemove:t,onClear:r,onOpenSelection:l,onLeave:c})=>{const{labels:i}=b.useExplorer(),o=n.useId(),s=n.useRef(null),p=[...e],f=(u,m)=>{if(m.ownerDocument.activeElement===m){const w=s.current===null?[]:[...s.current.querySelectorAll(`[data-testid="${Je}"]`)],g=w.indexOf(m),v=[w[g+1],w[g-1]].find(y=>y!==void 0);v===void 0?c():v.focus()}t(u)},d=()=>{const u=s.current;u!==null&&u.contains(u.ownerDocument.activeElement)&&c(),r()};return a.jsxs("section",{ref:s,className:"aqmx-explorer-tray","aria-labelledby":o,"data-testid":"markdown-explorer-selection-tray",children:[a.jsxs("div",{className:"aqmx-explorer-tray-header",children:[a.jsx("p",{id:o,className:"aqmx-explorer-tray-title",children:i.selectionTitle(p.length)}),a.jsx("button",{type:"button",className:"aqmx-explorer-tray-button","data-testid":"markdown-explorer-selection-clear",onClick:d,children:i.clearSelection})]}),a.jsx("ul",{className:"aqmx-explorer-tray-list",children:p.map(([u,m])=>a.jsxs("li",{className:"aqmx-explorer-tray-item",children:[a.jsx("span",{className:"aqmx-explorer-tray-name",title:u,children:m}),a.jsx("button",{type:"button",className:"aqmx-icon-button aqmx-explorer-tray-remove","aria-label":i.removeFromSelection(m),title:i.removeFromSelection(m),"data-testid":Je,"data-aqmx-path":u,onClick:w=>f(u,w.currentTarget),children:a.jsx(Me,{"aria-hidden":"true"})})]},u))}),l===void 0?null:a.jsx("button",{type:"button",className:"aqmx-explorer-tray-open","data-testid":"markdown-explorer-selection-open",onClick:()=>l(p.map(([u])=>u)),children:i.openSelectionInMulti(p.length)})]})},Ce=new Map,Wr=(e,t)=>{if(t.selected===e.has(t.path))return e;const r=new Map(e);return t.selected?r.set(t.path,t.name):r.delete(t.path),r},Xr=(e,t)=>{if(!e.has(t))return e;const r=new Map(e);return r.delete(t),r},xt=n.createContext(null),Gr=e=>{const t=n.use(xt);n.useLayoutEffect(()=>{if(t!==null)return t(e),()=>t(!1)},[t,e])};function Yr({title:e,titleId:t,...r},l){return h.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},r),e?h.createElement("title",{id:t},e):null,h.createElement("path",{fillRule:"evenodd",d:"M6.97 2.47a.75.75 0 0 1 1.06 0l4.5 4.5a.75.75 0 0 1-1.06 1.06L8.25 4.81V16.5a.75.75 0 0 1-1.5 0V4.81L3.53 8.03a.75.75 0 0 1-1.06-1.06l4.5-4.5Zm9.53 4.28a.75.75 0 0 1 .75.75v11.69l3.22-3.22a.75.75 0 1 1 1.06 1.06l-4.5 4.5a.75.75 0 0 1-1.06 0l-4.5-4.5a.75.75 0 1 1 1.06-1.06l3.22 3.22V7.5a.75.75 0 0 1 .75-.75Z",clipRule:"evenodd"}))}const Qr=h.forwardRef(Yr);function Jr({title:e,titleId:t,...r},l){return h.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},r),e?h.createElement("title",{id:t},e):null,h.createElement("path",{d:"M11.25 4.533A9.707 9.707 0 0 0 6 3a9.735 9.735 0 0 0-3.25.555.75.75 0 0 0-.5.707v14.25a.75.75 0 0 0 1 .707A8.237 8.237 0 0 1 6 18.75c1.995 0 3.823.707 5.25 1.886V4.533ZM12.75 20.636A8.214 8.214 0 0 1 18 18.75c.966 0 1.89.166 2.75.47a.75.75 0 0 0 1-.708V4.262a.75.75 0 0 0-.5-.707A9.735 9.735 0 0 0 18 3a9.707 9.707 0 0 0-5.25 1.533v16.103Z"}))}const en=h.forwardRef(Jr);function tn({title:e,titleId:t,...r},l){return h.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},r),e?h.createElement("title",{id:t},e):null,h.createElement("path",{fillRule:"evenodd",d:"M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm13.36-1.814a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z",clipRule:"evenodd"}))}const rn=h.forwardRef(tn);function nn({title:e,titleId:t,...r},l){return h.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},r),e?h.createElement("title",{id:t},e):null,h.createElement("path",{fillRule:"evenodd",d:"M7.72 12.53a.75.75 0 0 1 0-1.06l7.5-7.5a.75.75 0 1 1 1.06 1.06L9.31 12l6.97 6.97a.75.75 0 1 1-1.06 1.06l-7.5-7.5Z",clipRule:"evenodd"}))}const ln=h.forwardRef(nn);function an({title:e,titleId:t,...r},l){return h.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},r),e?h.createElement("title",{id:t},e):null,h.createElement("path",{fillRule:"evenodd",d:"M11.47 4.72a.75.75 0 0 1 1.06 0l3.75 3.75a.75.75 0 0 1-1.06 1.06L12 6.31 8.78 9.53a.75.75 0 0 1-1.06-1.06l3.75-3.75Zm-3.75 9.75a.75.75 0 0 1 1.06 0L12 17.69l3.22-3.22a.75.75 0 1 1 1.06 1.06l-3.75 3.75a.75.75 0 0 1-1.06 0l-3.75-3.75a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))}const on=h.forwardRef(an);function sn({title:e,titleId:t,...r},l){return h.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},r),e?h.createElement("title",{id:t},e):null,h.createElement("path",{fillRule:"evenodd",d:"M11.078 2.25c-.917 0-1.699.663-1.85 1.567L9.05 4.889c-.02.12-.115.26-.297.348a7.493 7.493 0 0 0-.986.57c-.166.115-.334.126-.45.083L6.3 5.508a1.875 1.875 0 0 0-2.282.819l-.922 1.597a1.875 1.875 0 0 0 .432 2.385l.84.692c.095.078.17.229.154.43a7.598 7.598 0 0 0 0 1.139c.015.2-.059.352-.153.43l-.841.692a1.875 1.875 0 0 0-.432 2.385l.922 1.597a1.875 1.875 0 0 0 2.282.818l1.019-.382c.115-.043.283-.031.45.082.312.214.641.405.985.57.182.088.277.228.297.35l.178 1.071c.151.904.933 1.567 1.85 1.567h1.844c.916 0 1.699-.663 1.85-1.567l.178-1.072c.02-.12.114-.26.297-.349.344-.165.673-.356.985-.57.167-.114.335-.125.45-.082l1.02.382a1.875 1.875 0 0 0 2.28-.819l.923-1.597a1.875 1.875 0 0 0-.432-2.385l-.84-.692c-.095-.078-.17-.229-.154-.43a7.614 7.614 0 0 0 0-1.139c-.016-.2.059-.352.153-.43l.84-.692c.708-.582.891-1.59.433-2.385l-.922-1.597a1.875 1.875 0 0 0-2.282-.818l-1.02.382c-.114.043-.282.031-.449-.083a7.49 7.49 0 0 0-.985-.57c-.183-.087-.277-.227-.297-.348l-.179-1.072a1.875 1.875 0 0 0-1.85-1.567h-1.843ZM12 15.75a3.75 3.75 0 1 0 0-7.5 3.75 3.75 0 0 0 0 7.5Z",clipRule:"evenodd"}))}const cn=h.forwardRef(sn);function un({title:e,titleId:t,...r},l){return h.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},r),e?h.createElement("title",{id:t},e):null,h.createElement("path",{fillRule:"evenodd",d:"M12 1.5a.75.75 0 0 1 .75.75V4.5a.75.75 0 0 1-1.5 0V2.25A.75.75 0 0 1 12 1.5ZM5.636 4.136a.75.75 0 0 1 1.06 0l1.592 1.591a.75.75 0 0 1-1.061 1.06l-1.591-1.59a.75.75 0 0 1 0-1.061Zm12.728 0a.75.75 0 0 1 0 1.06l-1.591 1.592a.75.75 0 0 1-1.06-1.061l1.59-1.591a.75.75 0 0 1 1.061 0Zm-6.816 4.496a.75.75 0 0 1 .82.311l5.228 7.917a.75.75 0 0 1-.777 1.148l-2.097-.43 1.045 3.9a.75.75 0 0 1-1.45.388l-1.044-3.899-1.601 1.42a.75.75 0 0 1-1.247-.606l.569-9.47a.75.75 0 0 1 .554-.68ZM3 10.5a.75.75 0 0 1 .75-.75H6a.75.75 0 0 1 0 1.5H3.75A.75.75 0 0 1 3 10.5Zm14.25 0a.75.75 0 0 1 .75-.75h2.25a.75.75 0 0 1 0 1.5H18a.75.75 0 0 1-.75-.75Zm-8.962 3.712a.75.75 0 0 1 0 1.061l-1.591 1.591a.75.75 0 1 1-1.061-1.06l1.591-1.592a.75.75 0 0 1 1.06 0Z",clipRule:"evenodd"}))}const dn=h.forwardRef(un);function fn({title:e,titleId:t,...r},l){return h.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},r),e?h.createElement("title",{id:t},e):null,h.createElement("path",{fillRule:"evenodd",d:"M5.625 1.5c-1.036 0-1.875.84-1.875 1.875v17.25c0 1.035.84 1.875 1.875 1.875h12.75c1.035 0 1.875-.84 1.875-1.875V12.75A3.75 3.75 0 0 0 16.5 9h-1.875a1.875 1.875 0 0 1-1.875-1.875V5.25A3.75 3.75 0 0 0 9 1.5H5.625ZM7.5 15a.75.75 0 0 1 .75-.75h7.5a.75.75 0 0 1 0 1.5h-7.5A.75.75 0 0 1 7.5 15Zm.75 2.25a.75.75 0 0 0 0 1.5H12a.75.75 0 0 0 0-1.5H8.25Z",clipRule:"evenodd"}),h.createElement("path",{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"}))}const pn=h.forwardRef(fn);function mn({title:e,titleId:t,...r},l){return h.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},r),e?h.createElement("title",{id:t},e):null,h.createElement("path",{d:"M19.5 21a3 3 0 0 0 3-3v-4.5a3 3 0 0 0-3-3h-15a3 3 0 0 0-3 3V18a3 3 0 0 0 3 3h15ZM1.5 10.146V6a3 3 0 0 1 3-3h5.379a2.25 2.25 0 0 1 1.59.659l2.122 2.121c.14.141.331.22.53.22H19.5a3 3 0 0 1 3 3v1.146A4.483 4.483 0 0 0 19.5 9h-15a4.483 4.483 0 0 0-3 1.146Z"}))}const hn=h.forwardRef(mn);function xn({title:e,titleId:t,...r},l){return h.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},r),e?h.createElement("title",{id:t},e):null,h.createElement("path",{d:"M19.906 9c.382 0 .749.057 1.094.162V9a3 3 0 0 0-3-3h-3.879a.75.75 0 0 1-.53-.22L11.47 3.66A2.25 2.25 0 0 0 9.879 3H6a3 3 0 0 0-3 3v3.162A3.756 3.756 0 0 1 4.094 9h15.812ZM4.094 10.5a2.25 2.25 0 0 0-2.227 2.568l.857 6A2.25 2.25 0 0 0 4.951 21H19.05a2.25 2.25 0 0 0 2.227-1.932l.857-6a2.25 2.25 0 0 0-2.227-2.568H4.094Z"}))}const wn=h.forwardRef(xn);function gn({title:e,titleId:t,...r},l){return h.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},r),e?h.createElement("title",{id:t},e):null,h.createElement("path",{fillRule:"evenodd",d:"M10.5 3.75a6.75 6.75 0 1 0 0 13.5 6.75 6.75 0 0 0 0-13.5ZM2.25 10.5a8.25 8.25 0 1 1 14.59 5.28l4.69 4.69a.75.75 0 1 1-1.06 1.06l-4.69-4.69A8.25 8.25 0 0 1 2.25 10.5Zm8.25-3.75a.75.75 0 0 1 .75.75v2.25h2.25a.75.75 0 0 1 0 1.5h-2.25v2.25a.75.75 0 0 1-1.5 0v-2.25H7.5a.75.75 0 0 1 0-1.5h2.25V7.5a.75.75 0 0 1 .75-.75Z",clipRule:"evenodd"}))}const bn=h.forwardRef(gn);function En({title:e,titleId:t,...r},l){return h.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},r),e?h.createElement("title",{id:t},e):null,h.createElement("path",{fillRule:"evenodd",d:"M4.125 3C3.089 3 2.25 3.84 2.25 4.875V18a3 3 0 0 0 3 3h15a3 3 0 0 1-3-3V4.875C17.25 3.839 16.41 3 15.375 3H4.125ZM12 9.75a.75.75 0 0 0 0 1.5h1.5a.75.75 0 0 0 0-1.5H12Zm-.75-2.25a.75.75 0 0 1 .75-.75h1.5a.75.75 0 0 1 0 1.5H12a.75.75 0 0 1-.75-.75ZM6 12.75a.75.75 0 0 0 0 1.5h7.5a.75.75 0 0 0 0-1.5H6Zm-.75 3.75a.75.75 0 0 1 .75-.75h7.5a.75.75 0 0 1 0 1.5H6a.75.75 0 0 1-.75-.75ZM6 6.75a.75.75 0 0 0-.75.75v3c0 .414.336.75.75.75h3a.75.75 0 0 0 .75-.75v-3A.75.75 0 0 0 9 6.75H6Z",clipRule:"evenodd"}),h.createElement("path",{d:"M18.75 6.75h1.875c.621 0 1.125.504 1.125 1.125V18a1.5 1.5 0 0 1-3 0V6.75Z"}))}const vn=h.forwardRef(En);function Rn({title:e,titleId:t,...r},l){return h.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},r),e?h.createElement("title",{id:t},e):null,h.createElement("path",{d:"M5.625 3.75a2.625 2.625 0 1 0 0 5.25h12.75a2.625 2.625 0 0 0 0-5.25H5.625ZM3.75 11.25a.75.75 0 0 0 0 1.5h16.5a.75.75 0 0 0 0-1.5H3.75ZM3 15.75a.75.75 0 0 1 .75-.75h16.5a.75.75 0 0 1 0 1.5H3.75a.75.75 0 0 1-.75-.75ZM3.75 18.75a.75.75 0 0 0 0 1.5h16.5a.75.75 0 0 0 0-1.5H3.75Z"}))}const Sn=h.forwardRef(Rn),yn=Object.freeze({sortMode:Qr,folderPlacement:hn,readmePlacement:en,selectionMode:rn,doubleClickAction:dn,expandIconSize:bn,alwaysExpanded:b.ForwardRef$2,revealDocument:b.ForwardRef$1,showFolderReadme:vn,removeRootIndent:ln,lines:Sn,expandIcons:on,directoryIcons:wn,fileIcons:pn}),wt=(e,t)=>{const r=e[t.labelKey];if(typeof r!="string")throw new TypeError(`[markdown-explorer] the tree setting ${t.key} must name a string label; labels.${t.labelKey} is ${lt.describeValue(r)}`);return r},kn=({id:e,settings:t,descriptors:r,onAdvance:l,onClose:c,ref:i})=>{const{labels:o}=b.useExplorer(),s=n.useRef([]);n.useEffect(()=>{s.current[0]?.focus()},[]);const p=n.useCallback(d=>{const u=r.length;s.current[(d%u+u)%u]?.focus()},[r.length]),f=n.useCallback((d,u)=>{switch(d.key){case"ArrowDown":d.preventDefault(),p(u+1);break;case"ArrowUp":d.preventDefault(),p(u-1);break;case"Home":d.preventDefault(),p(0);break;case"End":d.preventDefault(),p(r.length-1);break;case"Escape":b.consumeKey(d),c();break;case"Tab":c();break}},[r.length,p,c]);return a.jsx("div",{ref:i,id:e,role:"menu","aria-label":o.treeSettings,className:"aqmx-explorer-menu","data-testid":"markdown-explorer-tree-settings-menu",children:r.map((d,u)=>{const m=yn[d.key],w=wt(o,d),g=_.formatTreeSettingValue(o,t,d.key),v=t[d.key],y=typeof v=="boolean"?{role:"menuitemcheckbox","aria-checked":v,"aria-label":w}:{role:"menuitem","aria-label":`${w}: ${g}`};return a.jsxs("button",{ref:T=>{s.current[u]=T},type:"button",tabIndex:-1,...y,title:`${w}: ${g}`,className:"aqmx-explorer-menu-item","data-testid":"markdown-explorer-tree-settings-item","data-aqmx-setting":d.key,onClick:()=>l(d),onKeyDown:T=>f(T,u),children:[a.jsx(m,{className:"aqmx-explorer-menu-icon","aria-hidden":"true"}),a.jsx("span",{className:"aqmx-explorer-menu-name",children:w}),a.jsx("span",{className:"aqmx-explorer-menu-value",children:g})]},d.key)})})},Cn=({settings:e,descriptors:t,onAdvance:r})=>{const{labels:l,announcer:c}=b.useExplorer(),[i,o]=n.useState(!1),s=n.useRef(null),p=n.useRef(null),f=n.useRef(null),d=n.useId(),u=n.useCallback(()=>{s.current?.focus(),o(!1)},[]);n.useEffect(()=>{if(!i)return;const g=v=>{v.target instanceof Node&&(s.current?.contains(v.target)===!0||p.current?.contains(v.target)===!0)||(o(!1),f.current!==null&&window.clearTimeout(f.current),f.current=window.setTimeout(()=>{f.current=null,(document.activeElement===null||document.activeElement===document.body)&&s.current?.focus()},0))};return document.addEventListener("pointerdown",g),()=>document.removeEventListener("pointerdown",g)},[i]),n.useEffect(()=>()=>{f.current!==null&&window.clearTimeout(f.current)},[]);const m=n.useCallback(g=>{g.key!=="Escape"||!i||(b.consumeKey(g),u())},[i,u]),w=n.useCallback(g=>{const v=r(g.key);c.announce(l.settingAnnouncement(wt(l,g),_.formatTreeSettingValue(l,v,g.key)))},[c,l,r]);return{trigger:a.jsx("button",{ref:s,type:"button",className:"aqmx-icon-button","aria-haspopup":"menu","aria-expanded":i,"aria-controls":i?d:void 0,"aria-label":l.treeSettings,title:l.treeSettings,"data-testid":"markdown-explorer-tree-settings",onClick:()=>o(g=>!g),onKeyDown:m,children:a.jsx(cn,{"aria-hidden":"true"})}),menu:i?a.jsx(kn,{ref:p,id:d,settings:e,descriptors:t,onAdvance:w,onClose:u}):null}},Ln=()=>{const{treeSettings:e}=b.useExplorer();return{settings:n.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getServerSnapshot),advance:e.advance}},et=new Set,Tn='[role="tree"] [role="treeitem"][tabindex="0"]',jn="[data-directory-tree-tab-stop]",An=e=>{const{mode:t,sourceId:r,currentPath:l,openPaths:c,onOpenDocument:i,onSourceChange:o,onRevealSource:s,viewSwitch:p}=e,{labels:f,sources:d,trees:u,documents:m,announcer:w,reveals:g}=b.useExplorer(),{settings:v,advance:y}=Ln(),T=n.useMemo(()=>_.visibleTreeSettingDescriptors(t),[t]),A=t==="tree"&&v.selectionMode==="multiple";Gr(A);const R=e.mode==="tree"?e.tray.onGatheredChange:null,I=e.mode==="tree"?e.onOpenSelection:void 0,M=e.mode==="tree"?e.onOpenFolder:null,k=e.mode==="tree"?e.onCloseFolder:null,j=e.mode==="tree"&&e.currentFolder,P=n.useMemo(()=>M===null||k===null||!v.showFolderReadme?null:{current:l,open:M,close:k},[M,k,l,v.showFolderReadme]),S=e.mode==="tree"&&A?e.tray.gathered:Ce,C=n.useCallback(O=>{const $=y(O);return $.selectionMode!=="multiple"&&R?.(Ce),$},[y,R]),q=Cn({settings:v,descriptors:T,onAdvance:C}),L=n.useCallback(O=>R?.($=>Wr($,O)),[R]),D=n.useCallback(O=>R?.($=>Xr($,O)),[R]),W=n.useCallback(()=>R?.(Ce),[R]),ce=n.useRef(null),ie=n.useCallback(()=>{const O=ce.current;if(O===null)return;[Tn,jn,'[data-testid="markdown-explorer-tree-settings"]'].map(G=>O.querySelector(G)).find(G=>G!==null)?.focus()},[]),V=n.useMemo(()=>new Set(S.keys()),[S]),oe=n.useMemo(()=>l===null?et:new Set([l]),[l]),X=n.useMemo(()=>{if(t==="multi")return{mode:"multiple",items:c,shownPath:null,onChange:null};switch(v.selectionMode){case"single":return{mode:"single",items:oe,shownPath:l,onChange:null};case"multiple":return{mode:"multiple",items:V,shownPath:l,onChange:L};case"none":return{mode:"none",items:et,shownPath:null,onChange:null}}},[t,c,v.selectionMode,oe,l,V,L]),Y=n.useMemo(()=>v.revealDocument?{path:l,openFolders:!j}:{path:X.shownPath,openFolders:!1},[v.revealDocument,l,j,X.shownPath]),se=n.useCallback(O=>{l!==null&&g.settle(l),o(O)},[l,g,o]),[H,ue]=n.useState(null),[K,N]=n.useState(!1),[Q,U]=n.useState(null),de=n.useRef(!1),fe=n.useCallback(async()=>{if(!de.current){de.current=!0,N(!0),U(null);try{const O=await u.refresh(r);if(O.status==="superseded")return;m.invalidate(),O.status==="failed"?U({sourceId:r,failure:O.failure}):w.announce(f.treeRefreshed)}finally{de.current=!1,N(!1)}}},[u,m,r,w,f]),ge=n.useCallback(()=>{fe()},[fe]),J=H===null?null:H.expandAll,te=H?.expanding===!0,be=d.find(O=>O.id===r),he=p.target==="multi"?zt:Zt,xe=p.target==="multi"?f.switchToMulti:f.switchToTree;return a.jsxs("nav",{ref:ce,"aria-label":f.explorerRegion,className:"aqmx-explorer","data-testid":"markdown-explorer-explorer","data-aqmx-mode":t,children:[a.jsxs("div",{className:"aqmx-explorer-header",children:[d.length>1?a.jsx("select",{className:"aqmx-explorer-source","aria-label":f.sourceLabel,title:be?.label,value:r,onChange:O=>se(O.currentTarget.value),"data-testid":"markdown-explorer-source-select",children:d.map(O=>a.jsx("option",{value:O.id,children:O.label},O.id))}):null,a.jsxs("div",{className:"aqmx-explorer-actions",children:[a.jsx(b.ExplorerLink,{to:p.href,navigation:"switch-view",className:"aqmx-icon-button","aria-label":xe,title:xe,"data-testid":"markdown-explorer-view-switch","data-aqmx-target":p.target,children:a.jsx(he,{"aria-hidden":"true"})}),a.jsxs("button",{type:"button",className:"aqmx-icon-button aqmx-labelled-button",title:f.refreshTree,"aria-disabled":K,"aria-busy":K,"data-aqmx-busy":K?"true":void 0,"data-testid":"markdown-explorer-refresh",onClick:()=>{fe()},children:[a.jsx(b.ForwardRef,{"aria-hidden":"true"}),a.jsx("span",{children:f.refreshTreeLabel})]}),a.jsx("button",{type:"button",className:"aqmx-icon-button","aria-label":f.expandAll,title:f.expandAll,"aria-disabled":J===null||te,"aria-busy":te,"data-aqmx-busy":te?"true":void 0,"data-testid":"markdown-explorer-expand-all",onClick:()=>J?.(),children:a.jsx(Ht,{"aria-hidden":"true"})}),a.jsx("button",{type:"button",className:"aqmx-icon-button","aria-label":f.collapseAll,title:f.collapseAll,"aria-disabled":H===null,"data-testid":"markdown-explorer-collapse-all",onClick:()=>H?.collapseAll(),children:a.jsx(It,{"aria-hidden":"true"})}),q.trigger]})]}),a.jsxs("div",{className:"aqmx-explorer-body","data-aqmx-explorer-body":"",children:[a.jsx(b.SheetAccessFailureList,{}),Q!==null&&Q.sourceId===r?a.jsx(On,{failure:Q.failure,onRetry:ge}):null,a.jsx(n.Suspense,{fallback:null,children:a.jsx(Wt,{})}),a.jsx(Vr,{mode:t,sourceId:r,settings:v,reveal:Y,openPaths:c,selection:X,onOpenDocument:i,folders:P,onRevealSource:s,onControls:ue},r),A&&S.size>0?a.jsx(Ur,{selection:S,onRemove:D,onClear:W,onOpenSelection:I,onLeave:ie}):null,q.menu]})]})},On=({failure:e,onRetry:t})=>{const{labels:r}=b.useExplorer(),{reason:l}=e;return b.isAccessFailureReason(l)?a.jsx(b.AccessFailureNotice,{failure:e,place:"read",deniedSentence:null,retry:t,testId:"markdown-explorer-refresh-failure"}):a.jsx("p",{role:"alert",className:"aqmx-explorer-refresh-failure","data-testid":"markdown-explorer-refresh-failure","data-aqmx-failure":l,children:r.treeRefreshFailed(b.failureTitleOf(r,l))})};function Nn({title:e,titleId:t,...r},l){return h.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},r),e?h.createElement("title",{id:t},e):null,h.createElement("path",{fillRule:"evenodd",d:"M3 6.75A.75.75 0 0 1 3.75 6h16.5a.75.75 0 0 1 0 1.5H3.75A.75.75 0 0 1 3 6.75ZM3 12a.75.75 0 0 1 .75-.75h16.5a.75.75 0 0 1 0 1.5H3.75A.75.75 0 0 1 3 12Zm0 5.25a.75.75 0 0 1 .75-.75h16.5a.75.75 0 0 1 0 1.5H3.75a.75.75 0 0 1-.75-.75Z",clipRule:"evenodd"}))}const gt=h.forwardRef(Nn),Fn=({explorer:e,toggleRef:t,covered:r,merged:l,onNoticeSlotChange:c,accessFailures:i,dismissals:o})=>{const{labels:s}=b.useExplorer(),p=Le.useLocation(),f=Le.useNavigationType(),{location:d}=b.useExplorerLocation(),[u,m]=n.useState(!1),[w,g]=n.useState({navigated:p,source:d.source}),[v,y]=n.useState(!1);w.navigated!==p&&(g({navigated:p,source:d.source}),w.source===d.source&&!v&&b.explorerNavigationOf(f,p.state)!=="close-folder"&&m(!1));const[T,A]=n.useState(o);T!==o&&(A(o),m(!1));const R=n.useRef(null),I=n.useRef(null),M=n.useRef(null),k=n.useRef(!1),j=n.useId();n.useLayoutEffect(()=>{const L=R.current;L!==null&&(u&&!L.open?(L.showModal(),I.current?.focus()):!u&&L.open&&(L.close(),t.current?.focus()),c(u?M.current:null))},[u,t,c]),n.useLayoutEffect(()=>()=>c(null),[c]);const P=n.useCallback(L=>{L.key!=="Escape"||L.defaultPrevented||(b.consumeKey(L),m(!1))},[]),S=n.useCallback(L=>{k.current=L.target===L.currentTarget},[]),C=n.useCallback(L=>{const D=k.current;k.current=!1,D&&L.target===L.currentTarget&&m(!1)},[]),q=n.useCallback(()=>{m(!1)},[]);return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"aqmx-sheet-bar",inert:r,"data-testid":"markdown-explorer-sheet-bar","data-aqmx-sheet-bar-merged":l?"true":"false",children:a.jsxs("button",{ref:t,type:"button",className:"aqmx-explorer-toggle",title:l?s.showExplorer:void 0,"aria-haspopup":"dialog","aria-expanded":u,"aria-controls":j,"data-testid":"markdown-explorer-sheet-toggle",onClick:()=>m(!0),children:[a.jsx(gt,{"aria-hidden":"true"}),a.jsx("span",{className:l?"aqmx-sr-only":void 0,children:s.showExplorer})]})}),a.jsx("dialog",{ref:R,id:j,className:"aqmx-sheet","aria-label":s.explorerRegion,"data-testid":"markdown-explorer-sheet",onKeyDown:P,onPointerDown:S,onClick:C,onClose:q,children:a.jsxs("div",{className:"aqmx-sheet-panel",children:[a.jsxs("div",{className:"aqmx-explorer-chrome",children:[a.jsx("div",{ref:M,className:"aqmx-sheet-notice-slot"}),a.jsx("button",{ref:I,type:"button",className:"aqmx-explorer-close","aria-label":s.hideExplorer,title:s.hideExplorer,"data-testid":"markdown-explorer-sheet-close",onClick:()=>m(!1),children:a.jsx(Me,{"aria-hidden":"true"})})]}),a.jsx("div",{className:"aqmx-sheet-body",children:a.jsx(qe,{value:u,children:a.jsx(b.SheetAccessFailuresContext,{value:i,children:a.jsx(xt,{value:y,children:e})})})}),a.jsx(b.LiveRegion,{holds:u,deferWhileFullscreenIn:null,testId:"markdown-explorer-sheet-announcer"})]})})]})},bt=n.createContext(null),_e="aqmx-explorer",Et="aqmx-content",Ie='[role="tree"] [role="treeitem"]',Pn=`${Ie}[tabindex="0"]`,qn="[data-directory-tree-tab-stop]",Mn=(e,t)=>{for(const r of e.querySelectorAll(`[data-panel-id="${_e}"] ${Ie}`))if(r.getAttribute(ae)===t)return r;return null},tt=(e,t)=>({inlineSize:e>0?e:null,rootFontPixels:t>0?t:_.ASSUMED_ROOT_FONT_PIXELS}),_n=(e,t)=>{const[r,l]=n.useState(()=>tt(0,0));return n.useLayoutEffect(()=>{const c=e.current,i=t.current;if(c===null||i===null)throw new Error("[markdown-explorer] the split frame is not mounted");const o={frame:c.getBoundingClientRect().width,rem:i.getBoundingClientRect().width},s=()=>{const f=tt(o.frame,o.rem);l(d=>d.inlineSize===f.inlineSize&&d.rootFontPixels===f.rootFontPixels?d:f)};s();const p=new ResizeObserver(f=>{for(const d of f){const[u]=d.borderBoxSize;u!==void 0&&(d.target===c&&(o.frame=u.inlineSize),d.target===i&&(o.rem=u.inlineSize))}s()});return p.observe(c),p.observe(i),()=>p.disconnect()},[e,t]),r},vt=e=>`aqmx-split-handle-${e}`,In=(e,{frameRef:t,sheetToggleRef:r,railToggleRef:l,closeButtonRef:c,handleId:i})=>{const o=n.useRef(!1),s=n.useRef(null),p=n.useRef(!1);n.useLayoutEffect(()=>{const d=t.current;if(d===null)throw new Error("[markdown-explorer] the split frame is not mounted");const u=w=>{const g=w.target instanceof Element?w.target:null;o.current=g!==null&&g.closest(`[data-panel-id="${Et}"]`)===null,!p.current&&(s.current=g?.closest(`${Ie}[${ae}]`)?.getAttribute(ae)??null)},m=w=>{w.relatedTarget instanceof Node&&!d.contains(w.relatedTarget)&&(o.current=!1)};return d.addEventListener("focusin",u),d.addEventListener("focusout",m),()=>{d.removeEventListener("focusin",u),d.removeEventListener("focusout",m)}},[t]);const f=n.useRef(e);n.useLayoutEffect(()=>{const d=f.current;if(d===e)return;f.current=e;const u=t.current;if(u===null||!o.current)return;const m=w=>{const{activeElement:g,body:v}=u.ownerDocument;if(g!==null&&g!==v)return;const y=w.find(T=>T!==null);if(y!=null){p.current=!0;try{y.focus()}finally{p.current=!1}}};if(e==="sheet"){m([r.current]);return}if(e==="rail"){m([l.current]);return}if(d==="rail"){m([c.current]);return}queueMicrotask(()=>{if(f.current!==e||!o.current)return;const w=s.current,g=`[data-panel-id="${_e}"]`;m([w===null?null:Mn(u,w),u.querySelector(`${g} ${Pn}`),u.querySelector(`${g} ${qn}`),u.querySelector(`[data-resize-handle-id="${i}"]`)])})},[e,t,r,l,c,i])},Dn=e=>e==="tree"?"treeExplorerHidden":"multiExplorerHidden",Hn=({view:e,explorer:t,content:r,contentCoversPage:l=!1,sheetDismissals:c=0,onDraggingChange:i})=>{const{viewSettings:o}=b.useExplorer(),s=n.useRef(null),[p,f]=n.useState(null),d=n.useRef(null),u=n.useRef(null),m=n.useRef(null),w=n.useRef(null),{inlineSize:g,rootFontPixels:v}=_n(s,d),y=Dn(e),T=b.useViewSetting(L=>L[y]===!0),A=g!==null&&g<_.explorerSheetBelowPixels(v),R=A?"sheet":T?"rail":"split";In(R,{frameRef:s,sheetToggleRef:u,railToggleRef:m,closeButtonRef:w,handleId:vt(e)});const I=n.useCallback(()=>o.update({[y]:!0}),[o,y]),M=n.useCallback(()=>o.update({[y]:!1}),[o,y]),[k,j]=n.useState(!1),P=n.useMemo(()=>A?{lane:!l,onBar:j}:null,[A,l]),[S]=n.useState(()=>new Map),[C]=n.useState(b.createSheetAccessFailures),q=A&&p!==null?C:null;return a.jsx(at,{value:S,children:a.jsxs("div",{ref:s,className:"aqmx-split-frame","data-aqmx-explorer-mode":R,"data-aqmx-measured":g===null?"false":"true","data-aqmx-content-covers-page":l?"true":"false",children:[a.jsx("span",{ref:d,className:"aqmx-rem-probe","aria-hidden":"true","data-aqmx-rem-probe":""}),A?a.jsx(Fn,{explorer:t,toggleRef:u,covered:l,merged:k,onNoticeSlotChange:f,accessFailures:C,dismissals:c}):null,a.jsxs("div",{className:"aqmx-split-row",children:[R==="rail"?a.jsx(Bn,{toggleRef:m,covered:l,onOpen:M}):null,a.jsx(bt,{value:A?p:null,children:a.jsx(b.AccessFailureRelayContext,{value:q,children:a.jsx(b.SheetBarContext,{value:P,children:a.jsx(Zn,{view:e,mode:R,explorer:t,content:r,contentCoversPage:l,onDraggingChange:i,explorerMinPixels:_.explorerMinPixels(v),closeButtonRef:w,onHide:I})})})})]})]})})},Bn=({toggleRef:e,covered:t,onOpen:r})=>{const{labels:l}=b.useExplorer();return a.jsx("div",{className:"aqmx-split-rail",inert:t,"data-testid":"markdown-explorer-rail",children:a.jsx("button",{ref:e,type:"button",className:"aqmx-explorer-toggle","aria-expanded":!1,"aria-label":l.showExplorer,title:l.showExplorer,"data-testid":"markdown-explorer-rail-toggle",onClick:r,children:a.jsx(gt,{"aria-hidden":"true"})})})},Zn=({view:e,mode:t,explorer:r,content:l,contentCoversPage:c,onDraggingChange:i,explorerMinPixels:o,closeButtonRef:s,onHide:p})=>{const{viewSettings:f,labels:d}=b.useExplorer(),u=n.useMemo(()=>Xe.toPanelGroupLabels(d),[d]),w=b.useViewSetting(S=>e==="tree"?S.treeExplorer:S.multiExplorer)??(e==="tree"?_.EXPLORER_DEFAULT_PERCENT:_.EXPLORER_MULTI_DEFAULT_PERCENT),g=n.useRef(!1),[v,y]=n.useState(!1),T=n.useRef(!1),A=n.useRef(i);n.useLayoutEffect(()=>{A.current=i},[i]);const R=Xe.useSplitPersistence(n.useCallback(S=>{if(S.length!==2)return;const[C=0,q=0]=S,L=C+q;if(L<=0||C<=0)return;const D=Math.min(_.EXPLORER_MAX_PERCENT,C/L*100);f.update(e==="tree"?{treeExplorer:D}:{multiExplorer:D})},[f,e]));n.useEffect(()=>()=>{g.current&&A.current?.(!1)},[]);const I=_.COARSE_TARGET_PIXELS,M=t==="split",k=n.useCallback(()=>{T.current=!1,y(!1),p()},[p]),j=n.useCallback((S,C)=>{const[q=0,L=0]=S;S.length===2&&L>0&&(T.current=q<=0,y(T.current)),R.layoutChanged(S,C),T.current&&C.source==="keyboard"&&k()},[R,k]),P=n.useCallback(S=>{g.current=S,i?.(S),R.draggingChanged(S),!S&&T.current&&k()},[i,R,k]);return a.jsxs(ke.PanelGroup,{id:`aqmx-split-${e}`,direction:"horizontal",onLayout:j,labels:u,className:"aqmx-split","data-aqmx-split":e,children:[M?a.jsxs(ke.Panel,{id:_e,defaultSize:{value:w,unit:"percentage"},minSize:{value:o,unit:"pixels"},maxSize:{value:_.EXPLORER_MAX_PERCENT,unit:"percentage"},collapsible:{from:"end"},pixelAdjustPriority:1,inert:c,className:"aqmx-split-explorer",children:[a.jsx("div",{className:"aqmx-explorer-chrome",children:a.jsx("button",{ref:s,type:"button",className:"aqmx-explorer-close","aria-label":d.hideExplorer,title:d.hideExplorer,"data-testid":"markdown-explorer-split-close",onClick:k,children:a.jsx(Me,{"aria-hidden":"true"})})}),a.jsx(qe,{value:!v,children:r})]}):null,M?a.jsx(ke.PanelResizeHandle,{id:vt(e),thickness:I,indicator:{visible:!0,thickness:_.SPLIT_HANDLE_PIXELS.gripThickness,length:_.SPLIT_HANDLE_PIXELS.gripLength,barThickness:_.SPLIT_HANDLE_PIXELS.barThickness,barLength:_.SPLIT_HANDLE_PIXELS.barLength},title:d.resizeExplorer,"aria-label":d.resizeExplorer,onDragging:P,inert:c,className:"aqmx-split-handle"}):null,a.jsx(ke.Panel,{id:Et,defaultSize:{value:M?100-w:100,unit:"percentage"},contentOverflow:"hidden",className:"aqmx-split-content",...c?{style:{isolation:"auto"}}:{},children:l})]})};exports.EMPTY_SELECTION=Ce;exports.ExplorerPane=An;exports.ExplorerSplit=Hn;exports.SheetNoticeSlotContext=bt;
|
|
2
|
+
"use strict";const a=require("react/jsx-runtime"),b=require("./index-AfEbgYQI.cjs"),n=require("react"),_=require("./location-Csj3eAm_.cjs"),Le=require("react-router"),We=require("./ownUrls-BTPGNhBt.cjs"),rt=require("@aiquants/directory-tree"),nt=require("./tapScrollCircle-CS3hbyGb.cjs"),qt=require("./storage-BpYsprog.cjs"),lt=require("./describeValue-Ccvhbt36.cjs"),ke=require("@aiquants/resize-panels"),Xe=require("./useSplitPersistence-C6s7a4Iu.cjs");function Mt(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const l=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,l.get?l:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const h=Mt(n);function _t({title:e,titleId:t,...r},l){return h.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},r),e?h.createElement("title",{id:t},e):null,h.createElement("path",{fillRule:"evenodd",d:"M19.5 21a3 3 0 0 0 3-3V9a3 3 0 0 0-3-3h-5.379a.75.75 0 0 1-.53-.22L11.47 3.66A2.25 2.25 0 0 0 9.879 3H4.5a3 3 0 0 0-3 3v12a3 3 0 0 0 3 3h15ZM9 12.75a.75.75 0 0 0 0 1.5h6a.75.75 0 0 0 0-1.5H9Z",clipRule:"evenodd"}))}const It=h.forwardRef(_t);function Dt({title:e,titleId:t,...r},l){return h.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},r),e?h.createElement("title",{id:t},e):null,h.createElement("path",{fillRule:"evenodd",d:"M19.5 21a3 3 0 0 0 3-3V9a3 3 0 0 0-3-3h-5.379a.75.75 0 0 1-.53-.22L11.47 3.66A2.25 2.25 0 0 0 9.879 3H4.5a3 3 0 0 0-3 3v12a3 3 0 0 0 3 3h15Zm-6.75-10.5a.75.75 0 0 0-1.5 0v2.25H9a.75.75 0 0 0 0 1.5h2.25v2.25a.75.75 0 0 0 1.5 0v-2.25H15a.75.75 0 0 0 0-1.5h-2.25V10.5Z",clipRule:"evenodd"}))}const Ht=h.forwardRef(Dt);function Bt({title:e,titleId:t,...r},l){return h.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},r),e?h.createElement("title",{id:t},e):null,h.createElement("path",{d:"M16.5 6a3 3 0 0 0-3-3H6a3 3 0 0 0-3 3v7.5a3 3 0 0 0 3 3v-6A4.5 4.5 0 0 1 10.5 6h6Z"}),h.createElement("path",{d:"M18 7.5a3 3 0 0 1 3 3V18a3 3 0 0 1-3 3h-7.5a3 3 0 0 1-3-3v-7.5a3 3 0 0 1 3-3H18Z"}))}const Zt=h.forwardRef(Bt);function $t({title:e,titleId:t,...r},l){return h.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},r),e?h.createElement("title",{id:t},e):null,h.createElement("path",{fillRule:"evenodd",d:"M3 6a3 3 0 0 1 3-3h2.25a3 3 0 0 1 3 3v2.25a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3V6Zm9.75 0a3 3 0 0 1 3-3H18a3 3 0 0 1 3 3v2.25a3 3 0 0 1-3 3h-2.25a3 3 0 0 1-3-3V6ZM3 15.75a3 3 0 0 1 3-3h2.25a3 3 0 0 1 3 3V18a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3v-2.25Zm9.75 0a3 3 0 0 1 3-3H18a3 3 0 0 1 3 3V18a3 3 0 0 1-3 3h-2.25a3 3 0 0 1-3-3v-2.25Z",clipRule:"evenodd"}))}const zt=h.forwardRef($t),Vt="http://path.invalid",Kt=/[\t\n\r]/gu,Ut=(e,t,r,l)=>{const c=e.replace(Kt,"");if(!c.startsWith("/")||c.startsWith("//")||c.includes("\\"))return null;const{pathname:i,search:o,hash:s}=new URL(c,Vt);return!We.isUnder(i,[t])||We.isUnder(i,[r])?null:`${l}${i.slice(t.length)}${o}${s}`},Wt=()=>{const{notices:e,config:t}=b.useExplorer(),r=n.use(e),l=Le.useHref(t.basePath),c=Le.useHref(t.dataPath);return r.length===0?null:a.jsx("div",{className:"aqmx-explorer-notices",children:r.map(i=>{const o=i.action===void 0?null:Ut(i.action.href,l,c,t.basePath);return a.jsxs("div",{className:"aqmx-callout","data-aqmx-tone":i.tone,"data-testid":"markdown-explorer-notice","data-aqmx-notice":i.id,children:[a.jsx("p",{className:"aqmx-callout-title",children:i.title}),i.body===void 0?null:a.jsx("p",{className:"aqmx-callout-body",children:i.body}),i.action===void 0?null:o===null?a.jsx("a",{className:"aqmx-callout-action",href:i.action.href,children:i.action.label}):a.jsx(b.ExplorerLink,{className:"aqmx-callout-action",to:o,navigation:"follow-link",children:i.action.label})]},i.id)})})};function Xt({title:e,titleId:t,...r},l){return h.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},r),e?h.createElement("title",{id:t},e):null,h.createElement("path",{fillRule:"evenodd",d:"M6.912 3a3 3 0 0 0-2.868 2.118l-2.411 7.838a3 3 0 0 0-.133.882V18a3 3 0 0 0 3 3h15a3 3 0 0 0 3-3v-4.162c0-.299-.045-.596-.133-.882l-2.412-7.838A3 3 0 0 0 17.088 3H6.912Zm13.823 9.75-2.213-7.191A1.5 1.5 0 0 0 17.088 4.5H6.912a1.5 1.5 0 0 0-1.434 1.059L3.265 12.75H6.11a3 3 0 0 1 2.684 1.658l.256.513a1.5 1.5 0 0 0 1.342.829h3.218a1.5 1.5 0 0 0 1.342-.83l.256-.512a3 3 0 0 1 2.684-1.658h2.844Z",clipRule:"evenodd"}))}const Gt=h.forwardRef(Xt),qe=n.createContext(!0),at=n.createContext(null),ot="\0loop\0",st="\0",Yt=()=>{const e=new WeakMap,t=new WeakMap,r=new WeakMap,l=o=>{const s=e.get(o);if(s!==void 0)return s;const p=Object.freeze({type:"loop",name:o.name,path:o.path});return e.set(o,p),p},c=(o,s,p)=>{let f=!1;const d=o.map(m=>{const w=i(m,s,p);return w!==m&&(f=!0),w});if(!f)return o;const u=r.get(o);return u!==void 0&&u.length===d.length&&u.every((m,w)=>m===d[w])?u:(r.set(o,d),d)},i=(o,s,p)=>{if(o.type!=="directory")return o;if(p.has(o.path))return l(o);const f=o.lazy===!0?s(o.path):void 0,d=f?.status==="loaded",u=d?f.entries:o.children;if(u===void 0)return o;p.add(o.path);const m=c(u,s,p);if(p.delete(o.path),!d&&m===o.children)return o;const w=t.get(o);if(w!==void 0&&w.state===f&&w.children===m)return w.grafted;const g={...o,children:m,lazy:d?!1:o.lazy};return t.set(o,{state:f,children:m,grafted:g}),g};return(o,s)=>c(o,s,new Set)},Qt=(e,t)=>`${ot}${e}${st}${t}`,me=e=>e.startsWith(ot),Jt=e=>e.slice(e.lastIndexOf(st)+1),ae="data-aqmx-path",er=(e,t,r,l,c)=>{const i={aqmxPath:e.path};return e.modifiedAt!==void 0&&(i.aqmxModifiedAt=e.modifiedAt),r&&(i.aqmxOpen=!0),(l==="loading"||l==="failed")&&(i.aqmxChildren=l),{name:e.name,type:e.type,absolutePath:e.path,relativePath:e.path,mimeType:e.mimeType,children:t,label:c,data:i}},tr=(e,t,r,l)=>{const c=Qt(t,e.path);return{name:r,type:"directory",absolutePath:c,relativePath:c,children:l,data:{aqmxLoop:e.path}}},rr=()=>{const e=new WeakMap,t=new WeakMap,r=new WeakMap,l=[],c=(s,p,f)=>{const d=s.map(m=>m.type==="loop"?i(m,p,f):o(m,p)),u=r.get(s);return u!==void 0&&u.length===d.length&&u.every((m,w)=>m===d[w])?u:(r.set(s,d),d)},i=(s,p,f)=>{const d=t.get(s);if(d!==void 0&&d.parentKey===f&&d.loopFolderName===p.loopFolderName)return d.row;const u=tr(s,f,p.loopFolderName(s.name),l);return t.set(s,{row:u,parentKey:f,loopFolderName:p.loopFolderName}),u},o=(s,p)=>{const f=s.type==="directory"?s.children===void 0?l:c(s.children,p,s.path):void 0,d=p.openPaths.has(s.path),u=s.type==="directory"&&s.lazy===!0?p.childrenOf(s.path)?.status:void 0,m=u==="failed"?p.renderFailedFolder:void 0,w=e.get(s);if(w!==void 0&&w.open===d&&w.childrenStatus===u&&w.children===f&&w.renderFailedFolder===m)return w.row;const g=er(s,f,d,u,m===void 0?void 0:m(s));return e.set(s,{row:g,open:d,childrenStatus:u,children:f,renderFailedFolder:m}),g};return(s,p)=>c(s,p,"")},nr=e=>{if(e===void 0)return;const t=r=>{const l=r.data?.aqmxModifiedAt;return typeof l=="number"?{name:r.name,path:r.absolutePath,type:r.type,modifiedAt:l}:{name:r.name,path:r.absolutePath,type:r.type}};return(r,l)=>e(t(r),t(l))},Fe=(e,t)=>{const r=e.filter(l=>l.type==="directory");return t===void 0?r:r.sort(t)},lr=(e,t)=>{const r=new Map;let l=0;const c=i=>{for(const o of Fe(i,t.compare))if(t.isShownExpanded(o.path)){if(o.lazy!==!0){o.children!==void 0&&c(o.children);continue}r.has(o.path)||(r.set(o.path,t.isDirect(o.path)?"direct":"bulk"),t.childrenOf(o.path)?.status!=="failed"&&(l+=1))}};return c(e),{folders:r,waiting:l}},ar=e=>{const t=new Set,r=l=>{for(const c of l)c.type==="directory"&&(c.lazy===!0&&t.add(c.path),c.children!==void 0&&r(c.children))};return r(e),t},ct=(e,t)=>{for(const r of e){if(r.type!=="directory")continue;if(r.path===t)return r;const l=r.children===void 0?null:ct(r.children,t);if(l!==null)return l}return null},it=(e,t,r)=>{for(const l of e){if(l===t)return{parent:r};const c=l.children===void 0?null:it(l.children,t,l);if(c!==null)return c}return null},or=(e,t,r)=>{const l=it(e,r,null);if(l===null)throw new Error(`[markdown-explorer] the pressed folder's row is not among the tree's rows: ${lt.describeValue(r.absolutePath)}`);if(l.parent!==null)return{kind:"folder",path:l.parent.absolutePath};const c=_.folderReadmeOf(t.filter(i=>i.type!=="loop"));return c===null?{kind:"nothing"}:{kind:"document",path:c}},sr=(e,t,r,l)=>{let c=e;for(const i of t){const o=c.find(s=>s.type==="directory"&&s.path===i);if(o===void 0)return"missing";if(o.lazy===!0)return l.childrenOf(o.path)?.status==="failed"?"failed":"loading";if(!l.isShownExpanded(o.path))return"loading";c=o.children??[]}return c.some(i=>i.type==="file"&&i.path===r)?"ready":"missing"},Ge=new Set,cr=(e,t)=>e.has(t)?e:new Set(e).add(t),ir=(e,t)=>{if(!t.some(l=>e.has(l)))return e;const r=new Set(t);return new Set([...e].filter(l=>!r.has(l)))},ur=(e,t)=>[...e].every(r=>t.has(r))?e:new Set([...e].filter(r=>t.has(r))),dr=()=>{const[e,t]=n.useState(Ge),r=n.useCallback(o=>t(s=>cr(s,o)),[]),l=n.useCallback(o=>t(s=>ir(s,o)),[]),c=n.useCallback(o=>t(s=>ur(s,o)),[]),i=n.useCallback(()=>t(Ge),[]);return n.useMemo(()=>({direct:e,markDirect:r,unmarkDirect:l,pruneDirect:c,clearDirect:i}),[e,r,l,c,i])},fr=e=>({budget:e,handled:new Set,loads:new Set,opened:0,folderLimited:!1,depthLimited:!1,announcedStart:!1,issuedAgainst:null}),pr=(e,t)=>{const r=[];let l=Fe(t.entries,t.compare);for(let c=1;l.length>0;c+=1){const i=[];for(const o of l){const{path:s}=o;if(t.isShownExpanded(s))e.handled.add(s);else{if(e.handled.has(s))continue;if(e.handled.add(s),o.lazy===!0&&t.childrenOf(s)===void 0){if(c>e.budget.maxDepth){e.depthLimited=!0;continue}if(e.loads.size>=e.budget.maxFolders){e.folderLimited=!0;continue}e.loads.add(s)}r.push(s),e.opened+=1}o.lazy!==!0&&o.children!==void 0&&i.push(...Fe(o.children,t.compare))}l=i}return r},ut=(e,t)=>e.every(r=>r.type!=="directory"||t(r.path)&&(r.lazy===!0||r.children===void 0||ut(r.children,t))),mr=(e,t)=>{if(e.folderLimited)return{kind:"folder-limit",opened:e.opened};if(e.depthLimited)return{kind:"depth-limit",opened:e.opened};let r=0;for(const l of e.loads)t.childrenOf(l)?.status==="failed"&&(r+=1);return{kind:"done",opened:e.opened,failed:r,complete:ut(t.entries,t.isShownExpanded)}},Ne=Object.freeze({state:"idle"}),hr=e=>{const t=n.useRef(null),r=n.useRef(e),[l,c]=n.useState(Ne);n.useLayoutEffect(()=>{r.current=e});const i=n.useCallback(()=>{t.current===null&&(t.current=fr(r.current.budget),c({state:"running",opened:0}))},[]),o=n.useCallback(()=>{t.current=null,c(Ne)},[]),s=n.useCallback(p=>{const f=t.current;if(f===null)return;const d=pr(f,p);if(d.length>0&&(f.issuedAgainst=p.expanded,r.current.expandMultiple([...d])),!f.announcedStart&&(f.loads.size>0||p.waiting>0)&&(f.announcedStart=!0,r.current.onStart()),d.length===0&&!p.expansionPending&&p.expanded!==f.issuedAgainst&&p.waiting===0){t.current=null;const m=mr(f,p);c(m.kind==="done"?Ne:{state:"stopped",stop:m.kind,opened:m.opened}),r.current.onFinish(m);return}const{opened:u}=f;c(m=>m.state==="running"&&m.opened===u?m:{state:"running",opened:u})},[]);return n.useMemo(()=>({status:l,start:i,end:o,advance:s}),[l,i,o,s])},Ye=["pointerdown","wheel","touchstart","keydown","focusin"],xr=8,Qe={least:Number.POSITIVE_INFINITY,stalled:0},wr=({tree:e,container:t,path:r,chain:l,rows:c,cancel:i,displayed:o,placement:s})=>{const p=n.useRef(null),f=n.useRef(!0),d=n.useRef(Qe),u=n.useRef(null),m=n.useRef(null),w=n.useRef(l),g=n.useRef(s);n.useLayoutEffect(()=>{w.current=l,g.current=s},[l,s]);const v=n.useCallback(()=>{const k=u.current;k!==null&&(u.current=null,k.phase==="asking"?k.controller.abort():w.current?.open(null))},[]),y=n.useCallback(()=>{p.current=null,v()},[v]),T=n.useCallback(()=>{const k=t.current;p.current===null||m.current!==null||k===null||k.getClientRects().length===0||(m.current=requestAnimationFrame(()=>{m.current=null;const j=p.current;if(j===null)return;const P=g.current(j);if(P===0){f.current=!0,u.current?.phase==="opening"&&v();return}if(e.current?.scrollToPath(j,{align:"nearest"})===!0){u.current?.phase==="opening"&&v();const{least:C,stalled:q}=d.current;d.current=P<C?{least:P,stalled:0}:{least:C,stalled:q+1},d.current.stalled<xr&&T();return}const S=u.current;if(S===null){p.current=null;return}S.phase==="opening"&&w.current?.progress(S.folders,j)!=="loading"&&y()}))},[e,t,v,y]),A=n.useCallback(()=>{f.current=!1,d.current=Qe,T()},[T]);n.useEffect(()=>{const k=t.current;if(k===null)return;const j=typeof ResizeObserver>"u"?null:new ResizeObserver(A);j?.observe(k);for(const P of Ye)k.addEventListener(P,y,{passive:!0});return()=>{j?.disconnect();for(const P of Ye)k.removeEventListener(P,y);m.current!==null&&cancelAnimationFrame(m.current),m.current=null,v()}},[t,A,y,v]);const R=l!==null;n.useEffect(()=>{const k=t.current;if(y(),r===null||k===null||k.contains(k.ownerDocument.activeElement))return;p.current=r;const j=w.current;if(R&&j!==null){const P=new AbortController,S={phase:"asking",controller:P};u.current=S,j.ancestors(r,P.signal).then(C=>{u.current===S&&(C===null?u.current=null:(u.current={phase:"opening",folders:C},w.current?.open(C)),A())})}A()},[r,R,t,y,A]),n.useEffect(()=>{(u.current?.phase==="opening"||p.current!==null&&!f.current)&&A()},[c,A]);const I=n.useRef(i);n.useEffect(()=>{I.current!==i&&(I.current=i,y())},[i,y]);const M=n.useRef(o);n.useEffect(()=>{M.current&&!o&&v(),M.current=o},[o,v])},gr="--aqmx-tree-line",br=Object.freeze(["(forced-colors: active)","(prefers-color-scheme: dark)"]),Er="data-aqmx-tree-probe",vr=Object.freeze({rowHeight:_.CONTROL_BLOCK_PIXELS,lineColor:null}),Rr=(e,t,r)=>{const[l,c]=n.useState(vr);return n.useLayoutEffect(()=>{const i=e.current;if(i===null)return;const o=()=>{const f=Math.round(i.getBoundingClientRect().height),d=getComputedStyle(i),u=d.getPropertyValue(gr).trim()===""?null:d.color;c(m=>{const w=Number.isFinite(f)&&f>0?f:m.rowHeight;return m.rowHeight===w&&m.lineColor===u?m:{rowHeight:w,lineColor:u}})};o();const s=br.map(f=>window.matchMedia(f));for(const f of s)f.addEventListener("change",o);const p=typeof ResizeObserver>"u"?null:new ResizeObserver(o);return p?.observe(i),()=>{for(const f of s)f.removeEventListener("change",o);p?.disconnect()}},[e,t,r]),l},dt="markdown-explorer-tree-scroll",Sr=.5,ft=(e,t)=>[...e.querySelectorAll(`[role="treeitem"][${ae}]`)].find(r=>r.getAttribute(ae)===t),yr=(e,t)=>{const r=ft(e,t),l=r?.closest(`[data-testid="${dt}"]`);if(r===void 0||l===null||l===void 0)return Number.POSITIVE_INFINITY;const c=l.getBoundingClientRect(),i=r.getBoundingClientRect(),o=c.top-i.top,s=i.height>c.height?Math.abs(o):Math.max(0,o)+Math.max(0,i.bottom-c.bottom);return s<=Sr?0:s},Pe=Object.freeze({testId:dt,overscanCount:13,callbackThrottleMs:13,scrollBarOptions:Object.freeze({width:8,...b.SCROLL_BAR_CONTROLS,enableArrowButtons:!0,enableArrowButtonTabStops:!1,enableScrollToTopBottomButtons:!0,tapScrollCircleOptions:nt.TAP_SCROLL_CIRCLE}),behaviorOptions:Object.freeze({enablePointerDrag:!0})}),kr=Object.freeze({...Pe,scrollBarOptions:Object.freeze({...Pe.scrollBarOptions,...b.TOUCH_SCROLL_BAR_CONTROLS,tapScrollCircleOptions:nt.TOUCH_TAP_SCROLL_CIRCLE})}),Cr=e=>e?kr:Pe,Lr={hoverClassName:"",directorySelectedClassName:"",itemSelectedClassName:""},Tr={color:"inherit",fontSize:"inherit"},jr={fontSize:"inherit"},Ar=new Set,Or=new Map,Nr={color:"var(--aqmx-tree-line)"},pt=e=>e instanceof Element?e.closest(`[${ae}]`):null,Fr=e=>{const t=pt(e);return t===null||t.getAttribute("data-entry-type")!=="file"?null:t.getAttribute(ae)},mt=(e,t,r,l)=>r==="folder-limit"?e.expandAllFolderLimit(l,t.maxFolders,e.expandAll):e.expandAllDepthLimit(l,t.maxDepth),Pr=(e,t,r)=>r.kind==="done"?e.expandAllDone(r.opened,r.failed,r.complete):mt(e,t,r.kind,r.opened),ht=()=>{const{labels:e}=b.useExplorer();return a.jsxs("div",{className:"aqmx-explorer-loading","aria-busy":"true","data-testid":"markdown-explorer-tree-loading",children:[a.jsx("p",{className:"aqmx-explorer-loading-text",children:e.treeLoading}),a.jsxs("div",{className:"aqmx-skeleton","aria-hidden":"true",children:[a.jsx("span",{}),a.jsx("span",{}),a.jsx("span",{}),a.jsx("span",{}),a.jsx("span",{})]})]})},qr=()=>{const{labels:e}=b.useExplorer();return a.jsxs("div",{className:"aqmx-empty","data-testid":"markdown-explorer-tree-empty",children:[a.jsx(Gt,{className:"aqmx-explorer-empty-icon","aria-hidden":"true"}),a.jsx("p",{className:"aqmx-empty-title",children:e.treeEmptyTitle}),a.jsx("p",{className:"aqmx-explorer-empty-body",children:e.treeEmptyBody})]})},Mr=({name:e,onRetry:t})=>{const{labels:r}=b.useExplorer(),l=n.useId();return a.jsxs("span",{className:"aqmx-explorer-folder-failed",children:[a.jsx("span",{className:"aqmx-explorer-folder-name",children:e}),a.jsx("span",{id:l,className:"aqmx-explorer-folder-error",children:r.folderLoadFailed}),a.jsxs("button",{type:"button",className:"aqmx-explorer-folder-retry","aria-describedby":l,"data-testid":"markdown-explorer-folder-retry",onClick:c=>{c.stopPropagation();const i=c.currentTarget,o=i.ownerDocument.activeElement===i?i.closest('[role="treeitem"]'):null;o instanceof HTMLElement&&b.focusWithoutScroll(o),t()},onKeyDown:c=>{c.key!=="Escape"&&c.stopPropagation()},children:[a.jsx(b.ForwardRef,{className:"aqmx-explorer-folder-retry-icon","aria-hidden":"true"}),a.jsx("span",{className:"aqmx-explorer-folder-retry-text",children:r.retry})]})]})},_r=({entries:e,version:t,mode:r,sourceId:l,settings:c,reveal:i,openPaths:o,selection:s,onOpenDocument:p,folders:f,onRevealSource:d,expansion:u,onShown:m,marks:w,claimsHeld:g,expandAll:v,revealCancel:y})=>{const{trees:T,documents:A,labels:R,locale:I,theme:M,paletteKey:k,data:j,config:P,sources:S,reveals:C}=b.useExplorer(),q=n.use(qe),L=n.use(at),[D]=n.useState(()=>L?.get(l)),W=Cr(b.useCoarsePointer()),ce=n.useMemo(()=>D===void 0?W:{...W,initialScrollAnchor:D},[W,D]),[ie]=n.useState(rr),V=n.useRef(null),{rowHeight:oe,lineColor:X}=Rr(V,M,k),{isExpanded:Y,toggle:se,expandMultiple:H,collapseMultiple:ue,expanded:K,isPending:N}=u,{alwaysExpanded:Q,sortMode:U,folderPlacement:de,readmePlacement:fe}=c,{direct:ge,markDirect:J,unmarkDirect:te,pruneDirect:be}=w,{running:he,advance:xe}=v,O=n.useRef(null),$=n.useRef(null);n.useLayoutEffect(()=>{if(L===null)return;const x=O;return()=>{const E=x.current===null?null:x.current.getScrollAnchor();E===null?L.delete(l):L.set(l,E)}},[L,l]);const G=n.useMemo(()=>_.createEntryComparator({sortMode:U,folderPlacement:de,readmePlacement:fe}),[U,de,fe]),Rt=n.useMemo(()=>nr(G),[G]),ee=n.useCallback(x=>T.children(l,x),[T,l]),re=n.useMemo(()=>ar(e),[e]),we=n.useCallback(x=>Q&&!re.has(x),[Q,re]),ne=n.useCallback(x=>!me(x)&&(Y(x)||we(x)),[Y,we]),B=n.useRef({shownExpanded:ne,isExpanded:Y,isHeld:we,unloadedFolders:re,entries:e,childrenOf:ee,folderSelection:f,openDocument:p});n.useLayoutEffect(()=>{B.current={shownExpanded:ne,isExpanded:Y,isHeld:we,unloadedFolders:re,entries:e,childrenOf:ee,folderSelection:f,openDocument:p}},[ne,Y,we,re,e,ee,f,p]);const[le]=n.useState(()=>new Map),Te=n.useCallback((x,E)=>{C.settle(E),x.open(E)},[C]),Ee=n.useCallback((x,E)=>{E.kind!=="nothing"&&C.settle(E.path),x.close(E)},[C]),pe=n.useCallback((x,E)=>{for(const F of x){const Z=le.get(F);if(Z===void 0)continue;le.delete(F);const z=B.current.folderSelection;!E&&z!==null&&z.current===F&&Ee(z,Z)}},[le,Ee]),De=n.useCallback(x=>{O.current?.scrollToPath(x,{align:"nearest"}),requestAnimationFrame(()=>{const E=$.current,F=E===null?void 0:ft(E,x);F!==void 0&&b.focusWithoutScroll(F)})},[]),St=n.useCallback(x=>{if(me(x)){De(Jt(x));return}pe([x],!B.current.shownExpanded(x)),B.current.isExpanded(x)?te([x]):B.current.unloadedFolders.has(x)&&J(x),se(x)},[De,pe,J,te,se]),je=n.useCallback(x=>{const E=x.filter(F=>!me(F));E.length!==0&&(pe(E,!1),te(E),ue(E))},[pe,te,ue]),yt=n.useCallback(x=>{const E=x.filter(F=>!me(F));if(E.length!==0){if(E.length<x.length&&E.every(F=>B.current.shownExpanded(F))){je(E);return}pe(E,!0),H(E)}},[pe,H,je]),He=n.useCallback(x=>a.jsx(Mr,{name:x.name,onRetry:()=>{J(x.path),T.retryChildren(l,x.path),B.current.shownExpanded(x.path)||H([x.path])}}),[T,l,J,H]),Be=r==="multi"?o:Ar,{loopFolderName:Ze}=R,ve=n.useMemo(()=>ie(e,{openPaths:Be,childrenOf:ee,renderFailedFolder:He,loopFolderName:Ze}),[ie,e,Be,ee,He,Ze,t]),$e=n.useRef(ve);n.useLayoutEffect(()=>{$e.current=ve},[ve]);const kt=b.useIntentPrefetch(A,Fr),ze=n.useRef([]),Re=n.useCallback(()=>{for(const x of ze.current)B.current.unloadedFolders.has(x)&&J(x)},[J]),{maxDepth:Ae}=P.revealDocument,Ve=n.useRef(d);n.useLayoutEffect(()=>{Ve.current=d},[d]);const Ct=n.useMemo(()=>({ancestors:async(x,E)=>{const F=C.take(l,x);if(F!==null)return F;if(!C.mayMove(x)){const z=await j.ancestors(l,x,E);return z.status!=="ok"||z.ancestors===null||z.ancestors.length>Ae?null:z.ancestors}const Z=await j.reveal(l,x,E);return Z.status!=="ok"||Z.source===null||Z.ancestors.length>Ae?null:Z.source===l?Z.ancestors:(E.aborted||!S.some(z=>z.id===Z.source)||(C.move(Z.source,x,Z.ancestors),Ve.current(Z.source)),null)},open:x=>{ze.current=x??[],x!==null&&(Re(),H([...x]))},progress:(x,E)=>sr(B.current.entries,x,E,{isShownExpanded:B.current.shownExpanded,childrenOf:B.current.childrenOf})}),[j,l,S,C,Ae,Re,H]);n.useEffect(()=>Re(),[Re,re]);const Lt=n.useMemo(()=>[e,t,K],[e,t,K]),Tt=n.useCallback(x=>$.current===null?Number.POSITIVE_INFINITY:yr($.current,x),[]);wr({tree:O,container:$,path:i.path,chain:i.openFolders?Ct:null,rows:Lt,cancel:y,displayed:q,placement:Tt});const Ke=n.useCallback(x=>ge.has(x),[ge]),Se=n.useMemo(()=>lr(e,{isShownExpanded:ne,childrenOf:ee,compare:G,isDirect:Ke}),[e,ne,ee,G,Ke,t]),ye=q&&g;n.useLayoutEffect(()=>{m(e)},[e,m]),n.useLayoutEffect(()=>()=>m(null),[m]),n.useEffect(()=>T.claimChildren(l,ye?Se.folders:Or),[T,l,ye,Se]),n.useEffect(()=>be(re),[be,re]),n.useEffect(()=>{ye&&he&&xe({entries:e,isShownExpanded:ne,childrenOf:ee,compare:G,expanded:K,waiting:Se.waiting,expansionPending:N})},[ye,he,xe,e,ne,ee,G,K,Se,N]);const jt=n.useCallback(x=>{const E=x.entry.absolutePath,{folderSelection:F,openDocument:Z}=B.current;if(x.isDirectory){if(F===null||me(E))return;const z=E===F.current,Ue=or($e.current,B.current.entries,x.entry);if(B.current.isHeld(E)){x.preventDefault(),le.delete(E),z?Ee(F,Ue):Te(F,E);return}le.set(E,Ue),x.isExpanded||z||Te(F,E);return}C.settle(E),Z(E)},[C,le,Ee,Te]),At=n.useCallback(x=>{if(x.key!=="ArrowLeft"&&x.key!=="ArrowRight")return;const E=pt(x.target),F=E===null?null:E.getAttribute(ae);F!==null&&le.delete(F)},[le]),{onChange:Oe}=s,Ot=n.useMemo(()=>Oe===null?void 0:(x,E)=>{me(x.absolutePath)||Oe({path:x.absolutePath,name:x.name,selected:E})},[Oe]),Nt=n.useMemo(()=>new Set(s.items),[s.items]),Ft=n.useMemo(()=>({entryKindDirectory:R.treeEntryKindDirectory,entryKindFile:R.treeEntryKindFile,scrollUp:R.treeScrollUp,scrollDown:R.treeScrollDown,scrollToTop:R.treeScrollToTop,scrollToBottom:R.treeScrollToBottom}),[R]),Pt=X===null?{showTreeLines:!1}:{showTreeLines:c.lines,lineColor:X};return a.jsxs("div",{ref:$,className:"aqmx-explorer-tree","data-testid":"markdown-explorer-tree",onKeyDownCapture:At,...kt,children:[a.jsx("span",{ref:V,className:"aqmx-explorer-tree-probe","aria-hidden":"true",[Er]:""}),a.jsx(rt.DirectoryTree,{ref:O,entries:ve,expansion:{toggle:St,isExpanded:ne,expandMultiple:yt,collapseMultiple:je,isPending:N&&!he,doubleClickAction:c.doubleClickAction},selection:{mode:s.mode,selectedPath:s.shownPath,currentPath:s.shownPath,selectedItems:Nt,onEntryClick:jt,onSelectionChange:Ot},visual:{className:"aqmx-explorer-tree-view",ariaLabel:R.treeRegion,...Pt,showExpandIcons:c.expandIcons,expandIconStyle:Nr,showDirectoryIcons:c.directoryIcons,showFileIcons:c.fileIcons,expandIconSize:c.expandIconSize,itemHeight:oe,removeRootIndent:c.removeRootIndent,highlightStyles:Lr,entryStyle:jr,nameStyle:Tr},virtualScroll:ce,sort:Rt,locale:I,labels:Ft})]})},Ir=({pending:e,status:t})=>{const{labels:r}=b.useExplorer(),l=t.state!=="running",[c,i]=n.useState(0),o=n.useRef(!0);n.useLayoutEffect(()=>{const p=o.current;if(o.current=l,!l||e>0&&!p){i(0);return}if(e>0){i(e);return}if(c===0)return;const f=setTimeout(()=>i(0),0);return()=>clearTimeout(f)},[l,e,c]);const s=l&&e===0?c:e;return s===0&&l?null:a.jsxs("p",{className:"aqmx-explorer-tree-progress","data-testid":"markdown-explorer-tree-progress","data-aqmx-loading":String(s),"data-aqmx-expand-all":t.state,children:[s>0?a.jsx(b.ForwardRef,{className:"aqmx-explorer-tree-progress-icon","aria-hidden":"true"}):null,a.jsx("span",{children:t.state==="running"?r.expandAllProgress(t.opened,s):r.foldersLoading(s)})]})},Dr=({stop:e,opened:t,budget:r})=>{const{labels:l}=b.useExplorer();return a.jsx("p",{className:"aqmx-explorer-expand-all-stop","data-testid":"markdown-explorer-expand-all-stop","data-aqmx-stop":e,children:mt(l,r,e,t)})},Hr=({entries:e,...t})=>{const{trees:r}=b.useExplorer(),l=n.useSyncExternalStore(r.subscribe,r.version,r.version),{sourceId:c}=t,[i]=n.useState(Yt),o=n.useMemo(()=>i(e,s=>r.children(c,s)),[i,e,r,c,l]);return o.length===0?a.jsx(qr,{}):a.jsx(_r,{entries:o,version:l,...t})},Br=({result:e,onRetry:t,...r})=>{const{renderTreeFailure:l}=b.useExplorer(),c=n.use(e);if(c.status==="deferred")return a.jsx(ht,{});if(c.status==="ok")return a.jsx(Hr,{entries:c.entries,...r});const i=l?.(c.failure);return a.jsx("div",{className:"aqmx-explorer-tree-message","data-testid":"markdown-explorer-tree-failure","data-aqmx-failure":c.failure.reason,children:i!==void 0?i:a.jsx(b.FailureView,{failure:c.failure,alert:!0,onRetry:t,testId:null})})},Zr=Object.freeze([]),$r=e=>e!==void 0&&e.status==="failed"&&b.isAccessFailureReason(e.failure.reason),zr=({failure:e,onRetry:t})=>a.jsx(b.AccessFailureNotice,{failure:e,place:"read",deniedSentence:null,retry:t,testId:"markdown-explorer-folder-access-failure"}),Vr=({onControls:e,...t})=>{const{trees:r,storageNamespace:l,labels:c,announcer:i,config:o}=b.useExplorer(),{sourceId:s}=t,p=rt.useDirectoryTreeState({storageKey:qt.storageKeys(l).treeExpansion(s)});n.useSyncExternalStore(r.subscribe,r.version,r.version);const f=r.read(s),d=n.useCallback(()=>r.retry(s),[r,s]);n.useLayoutEffect(()=>r.open(s),[r,s]);const u=dr(),{expanded:m,expandMultiple:w,collapseAll:g}=p,[v,y]=n.useState(null),T=v!==m,A=n.useRef(m);n.useLayoutEffect(()=>{A.current=m},[m]);const R=o.expandAll,I=n.useCallback(()=>i.announce(c.expandAllStarted),[i,c]),M=n.useCallback(N=>i.announce(Pr(c,R,N)),[i,c,R]),k=hr({budget:R,expandMultiple:w,onStart:I,onFinish:M}),{status:j,start:P,end:S,advance:C}=k,q=j.state==="running",L=n.useMemo(()=>({running:q,advance:C}),[q,C]),D=n.useRef(null),[W,ce]=n.useState(!1),ie=n.useCallback(N=>{D.current=N,ce(N!==null)},[]),[V,oe]=n.useState(null);n.useEffect(()=>r.subscribeChildrenFailures(N=>{const Q=N.sourceId===s&&D.current!==null?ct(D.current,N.path):null;if(Q!==null){if(b.isAccessFailureReason(N.failure.reason)){oe(U=>U===null?{failure:N.failure,paths:[N.path]}:U.paths.includes(N.path)?U:{failure:U.failure,paths:[...U.paths,N.path]});return}i.announce({list:c.foldersLoadFailedNamed,item:Q.name})}}),[r,s,i,c]);const X=V===null?Zr:V.paths.filter(N=>$r(r.children(s,N)));V!==null&&X.length===0&&oe(null);const Y=()=>{for(const N of X)r.retryChildren(s,N)},{clearDirect:se}=u,[H,ue]=n.useState(0),K=n.useCallback(()=>{ue(N=>N+1),S(),se(),y(A.current),g()},[S,se,g]);return n.useEffect(()=>{e({collapseAll:K,expandAll:W?P:null,expanding:q})},[e,K,P,W,q]),n.useEffect(()=>()=>e(null),[e]),n.useEffect(()=>{W||S()},[W,S]),a.jsxs(a.Fragment,{children:[V===null||X.length===0?null:a.jsx(zr,{failure:V.failure,onRetry:Y}),j.state==="stopped"?a.jsx(Dr,{stop:j.stop,opened:j.opened,budget:R}):null,a.jsxs("div",{className:"aqmx-explorer-tree-area",children:[a.jsx(n.Suspense,{fallback:a.jsx(ht,{}),children:a.jsx(Br,{result:f,onRetry:d,expansion:p,onShown:ie,marks:u,claimsHeld:T,expandAll:L,revealCancel:H,...t})}),a.jsx(Ir,{pending:r.pendingChildren(s),status:j})]})]})};function Kr({title:e,titleId:t,...r},l){return h.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},r),e?h.createElement("title",{id:t},e):null,h.createElement("path",{fillRule:"evenodd",d:"M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))}const Me=h.forwardRef(Kr),Je="markdown-explorer-selection-remove",Ur=({selection:e,onRemove:t,onClear:r,onOpenSelection:l,onLeave:c})=>{const{labels:i}=b.useExplorer(),o=n.useId(),s=n.useRef(null),p=[...e],f=(u,m)=>{if(m.ownerDocument.activeElement===m){const w=s.current===null?[]:[...s.current.querySelectorAll(`[data-testid="${Je}"]`)],g=w.indexOf(m),v=[w[g+1],w[g-1]].find(y=>y!==void 0);v===void 0?c():v.focus()}t(u)},d=()=>{const u=s.current;u!==null&&u.contains(u.ownerDocument.activeElement)&&c(),r()};return a.jsxs("section",{ref:s,className:"aqmx-explorer-tray","aria-labelledby":o,"data-testid":"markdown-explorer-selection-tray",children:[a.jsxs("div",{className:"aqmx-explorer-tray-header",children:[a.jsx("p",{id:o,className:"aqmx-explorer-tray-title",children:i.selectionTitle(p.length)}),a.jsx("button",{type:"button",className:"aqmx-explorer-tray-button","data-testid":"markdown-explorer-selection-clear",onClick:d,children:i.clearSelection})]}),a.jsx("ul",{className:"aqmx-explorer-tray-list",children:p.map(([u,m])=>a.jsxs("li",{className:"aqmx-explorer-tray-item",children:[a.jsx("span",{className:"aqmx-explorer-tray-name",title:u,children:m}),a.jsx("button",{type:"button",className:"aqmx-icon-button aqmx-explorer-tray-remove","aria-label":i.removeFromSelection(m),title:i.removeFromSelection(m),"data-testid":Je,"data-aqmx-path":u,onClick:w=>f(u,w.currentTarget),children:a.jsx(Me,{"aria-hidden":"true"})})]},u))}),l===void 0?null:a.jsx("button",{type:"button",className:"aqmx-explorer-tray-open","data-testid":"markdown-explorer-selection-open",onClick:()=>l(p.map(([u])=>u)),children:i.openSelectionInMulti(p.length)})]})},Ce=new Map,Wr=(e,t)=>{if(t.selected===e.has(t.path))return e;const r=new Map(e);return t.selected?r.set(t.path,t.name):r.delete(t.path),r},Xr=(e,t)=>{if(!e.has(t))return e;const r=new Map(e);return r.delete(t),r},xt=n.createContext(null),Gr=e=>{const t=n.use(xt);n.useLayoutEffect(()=>{if(t!==null)return t(e),()=>t(!1)},[t,e])};function Yr({title:e,titleId:t,...r},l){return h.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},r),e?h.createElement("title",{id:t},e):null,h.createElement("path",{fillRule:"evenodd",d:"M6.97 2.47a.75.75 0 0 1 1.06 0l4.5 4.5a.75.75 0 0 1-1.06 1.06L8.25 4.81V16.5a.75.75 0 0 1-1.5 0V4.81L3.53 8.03a.75.75 0 0 1-1.06-1.06l4.5-4.5Zm9.53 4.28a.75.75 0 0 1 .75.75v11.69l3.22-3.22a.75.75 0 1 1 1.06 1.06l-4.5 4.5a.75.75 0 0 1-1.06 0l-4.5-4.5a.75.75 0 1 1 1.06-1.06l3.22 3.22V7.5a.75.75 0 0 1 .75-.75Z",clipRule:"evenodd"}))}const Qr=h.forwardRef(Yr);function Jr({title:e,titleId:t,...r},l){return h.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},r),e?h.createElement("title",{id:t},e):null,h.createElement("path",{d:"M11.25 4.533A9.707 9.707 0 0 0 6 3a9.735 9.735 0 0 0-3.25.555.75.75 0 0 0-.5.707v14.25a.75.75 0 0 0 1 .707A8.237 8.237 0 0 1 6 18.75c1.995 0 3.823.707 5.25 1.886V4.533ZM12.75 20.636A8.214 8.214 0 0 1 18 18.75c.966 0 1.89.166 2.75.47a.75.75 0 0 0 1-.708V4.262a.75.75 0 0 0-.5-.707A9.735 9.735 0 0 0 18 3a9.707 9.707 0 0 0-5.25 1.533v16.103Z"}))}const en=h.forwardRef(Jr);function tn({title:e,titleId:t,...r},l){return h.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},r),e?h.createElement("title",{id:t},e):null,h.createElement("path",{fillRule:"evenodd",d:"M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm13.36-1.814a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z",clipRule:"evenodd"}))}const rn=h.forwardRef(tn);function nn({title:e,titleId:t,...r},l){return h.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},r),e?h.createElement("title",{id:t},e):null,h.createElement("path",{fillRule:"evenodd",d:"M7.72 12.53a.75.75 0 0 1 0-1.06l7.5-7.5a.75.75 0 1 1 1.06 1.06L9.31 12l6.97 6.97a.75.75 0 1 1-1.06 1.06l-7.5-7.5Z",clipRule:"evenodd"}))}const ln=h.forwardRef(nn);function an({title:e,titleId:t,...r},l){return h.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},r),e?h.createElement("title",{id:t},e):null,h.createElement("path",{fillRule:"evenodd",d:"M11.47 4.72a.75.75 0 0 1 1.06 0l3.75 3.75a.75.75 0 0 1-1.06 1.06L12 6.31 8.78 9.53a.75.75 0 0 1-1.06-1.06l3.75-3.75Zm-3.75 9.75a.75.75 0 0 1 1.06 0L12 17.69l3.22-3.22a.75.75 0 1 1 1.06 1.06l-3.75 3.75a.75.75 0 0 1-1.06 0l-3.75-3.75a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))}const on=h.forwardRef(an);function sn({title:e,titleId:t,...r},l){return h.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},r),e?h.createElement("title",{id:t},e):null,h.createElement("path",{fillRule:"evenodd",d:"M11.078 2.25c-.917 0-1.699.663-1.85 1.567L9.05 4.889c-.02.12-.115.26-.297.348a7.493 7.493 0 0 0-.986.57c-.166.115-.334.126-.45.083L6.3 5.508a1.875 1.875 0 0 0-2.282.819l-.922 1.597a1.875 1.875 0 0 0 .432 2.385l.84.692c.095.078.17.229.154.43a7.598 7.598 0 0 0 0 1.139c.015.2-.059.352-.153.43l-.841.692a1.875 1.875 0 0 0-.432 2.385l.922 1.597a1.875 1.875 0 0 0 2.282.818l1.019-.382c.115-.043.283-.031.45.082.312.214.641.405.985.57.182.088.277.228.297.35l.178 1.071c.151.904.933 1.567 1.85 1.567h1.844c.916 0 1.699-.663 1.85-1.567l.178-1.072c.02-.12.114-.26.297-.349.344-.165.673-.356.985-.57.167-.114.335-.125.45-.082l1.02.382a1.875 1.875 0 0 0 2.28-.819l.923-1.597a1.875 1.875 0 0 0-.432-2.385l-.84-.692c-.095-.078-.17-.229-.154-.43a7.614 7.614 0 0 0 0-1.139c-.016-.2.059-.352.153-.43l.84-.692c.708-.582.891-1.59.433-2.385l-.922-1.597a1.875 1.875 0 0 0-2.282-.818l-1.02.382c-.114.043-.282.031-.449-.083a7.49 7.49 0 0 0-.985-.57c-.183-.087-.277-.227-.297-.348l-.179-1.072a1.875 1.875 0 0 0-1.85-1.567h-1.843ZM12 15.75a3.75 3.75 0 1 0 0-7.5 3.75 3.75 0 0 0 0 7.5Z",clipRule:"evenodd"}))}const cn=h.forwardRef(sn);function un({title:e,titleId:t,...r},l){return h.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},r),e?h.createElement("title",{id:t},e):null,h.createElement("path",{fillRule:"evenodd",d:"M12 1.5a.75.75 0 0 1 .75.75V4.5a.75.75 0 0 1-1.5 0V2.25A.75.75 0 0 1 12 1.5ZM5.636 4.136a.75.75 0 0 1 1.06 0l1.592 1.591a.75.75 0 0 1-1.061 1.06l-1.591-1.59a.75.75 0 0 1 0-1.061Zm12.728 0a.75.75 0 0 1 0 1.06l-1.591 1.592a.75.75 0 0 1-1.06-1.061l1.59-1.591a.75.75 0 0 1 1.061 0Zm-6.816 4.496a.75.75 0 0 1 .82.311l5.228 7.917a.75.75 0 0 1-.777 1.148l-2.097-.43 1.045 3.9a.75.75 0 0 1-1.45.388l-1.044-3.899-1.601 1.42a.75.75 0 0 1-1.247-.606l.569-9.47a.75.75 0 0 1 .554-.68ZM3 10.5a.75.75 0 0 1 .75-.75H6a.75.75 0 0 1 0 1.5H3.75A.75.75 0 0 1 3 10.5Zm14.25 0a.75.75 0 0 1 .75-.75h2.25a.75.75 0 0 1 0 1.5H18a.75.75 0 0 1-.75-.75Zm-8.962 3.712a.75.75 0 0 1 0 1.061l-1.591 1.591a.75.75 0 1 1-1.061-1.06l1.591-1.592a.75.75 0 0 1 1.06 0Z",clipRule:"evenodd"}))}const dn=h.forwardRef(un);function fn({title:e,titleId:t,...r},l){return h.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},r),e?h.createElement("title",{id:t},e):null,h.createElement("path",{fillRule:"evenodd",d:"M5.625 1.5c-1.036 0-1.875.84-1.875 1.875v17.25c0 1.035.84 1.875 1.875 1.875h12.75c1.035 0 1.875-.84 1.875-1.875V12.75A3.75 3.75 0 0 0 16.5 9h-1.875a1.875 1.875 0 0 1-1.875-1.875V5.25A3.75 3.75 0 0 0 9 1.5H5.625ZM7.5 15a.75.75 0 0 1 .75-.75h7.5a.75.75 0 0 1 0 1.5h-7.5A.75.75 0 0 1 7.5 15Zm.75 2.25a.75.75 0 0 0 0 1.5H12a.75.75 0 0 0 0-1.5H8.25Z",clipRule:"evenodd"}),h.createElement("path",{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"}))}const pn=h.forwardRef(fn);function mn({title:e,titleId:t,...r},l){return h.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},r),e?h.createElement("title",{id:t},e):null,h.createElement("path",{d:"M19.5 21a3 3 0 0 0 3-3v-4.5a3 3 0 0 0-3-3h-15a3 3 0 0 0-3 3V18a3 3 0 0 0 3 3h15ZM1.5 10.146V6a3 3 0 0 1 3-3h5.379a2.25 2.25 0 0 1 1.59.659l2.122 2.121c.14.141.331.22.53.22H19.5a3 3 0 0 1 3 3v1.146A4.483 4.483 0 0 0 19.5 9h-15a4.483 4.483 0 0 0-3 1.146Z"}))}const hn=h.forwardRef(mn);function xn({title:e,titleId:t,...r},l){return h.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},r),e?h.createElement("title",{id:t},e):null,h.createElement("path",{d:"M19.906 9c.382 0 .749.057 1.094.162V9a3 3 0 0 0-3-3h-3.879a.75.75 0 0 1-.53-.22L11.47 3.66A2.25 2.25 0 0 0 9.879 3H6a3 3 0 0 0-3 3v3.162A3.756 3.756 0 0 1 4.094 9h15.812ZM4.094 10.5a2.25 2.25 0 0 0-2.227 2.568l.857 6A2.25 2.25 0 0 0 4.951 21H19.05a2.25 2.25 0 0 0 2.227-1.932l.857-6a2.25 2.25 0 0 0-2.227-2.568H4.094Z"}))}const wn=h.forwardRef(xn);function gn({title:e,titleId:t,...r},l){return h.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},r),e?h.createElement("title",{id:t},e):null,h.createElement("path",{fillRule:"evenodd",d:"M10.5 3.75a6.75 6.75 0 1 0 0 13.5 6.75 6.75 0 0 0 0-13.5ZM2.25 10.5a8.25 8.25 0 1 1 14.59 5.28l4.69 4.69a.75.75 0 1 1-1.06 1.06l-4.69-4.69A8.25 8.25 0 0 1 2.25 10.5Zm8.25-3.75a.75.75 0 0 1 .75.75v2.25h2.25a.75.75 0 0 1 0 1.5h-2.25v2.25a.75.75 0 0 1-1.5 0v-2.25H7.5a.75.75 0 0 1 0-1.5h2.25V7.5a.75.75 0 0 1 .75-.75Z",clipRule:"evenodd"}))}const bn=h.forwardRef(gn);function En({title:e,titleId:t,...r},l){return h.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},r),e?h.createElement("title",{id:t},e):null,h.createElement("path",{fillRule:"evenodd",d:"M4.125 3C3.089 3 2.25 3.84 2.25 4.875V18a3 3 0 0 0 3 3h15a3 3 0 0 1-3-3V4.875C17.25 3.839 16.41 3 15.375 3H4.125ZM12 9.75a.75.75 0 0 0 0 1.5h1.5a.75.75 0 0 0 0-1.5H12Zm-.75-2.25a.75.75 0 0 1 .75-.75h1.5a.75.75 0 0 1 0 1.5H12a.75.75 0 0 1-.75-.75ZM6 12.75a.75.75 0 0 0 0 1.5h7.5a.75.75 0 0 0 0-1.5H6Zm-.75 3.75a.75.75 0 0 1 .75-.75h7.5a.75.75 0 0 1 0 1.5H6a.75.75 0 0 1-.75-.75ZM6 6.75a.75.75 0 0 0-.75.75v3c0 .414.336.75.75.75h3a.75.75 0 0 0 .75-.75v-3A.75.75 0 0 0 9 6.75H6Z",clipRule:"evenodd"}),h.createElement("path",{d:"M18.75 6.75h1.875c.621 0 1.125.504 1.125 1.125V18a1.5 1.5 0 0 1-3 0V6.75Z"}))}const vn=h.forwardRef(En);function Rn({title:e,titleId:t,...r},l){return h.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},r),e?h.createElement("title",{id:t},e):null,h.createElement("path",{d:"M5.625 3.75a2.625 2.625 0 1 0 0 5.25h12.75a2.625 2.625 0 0 0 0-5.25H5.625ZM3.75 11.25a.75.75 0 0 0 0 1.5h16.5a.75.75 0 0 0 0-1.5H3.75ZM3 15.75a.75.75 0 0 1 .75-.75h16.5a.75.75 0 0 1 0 1.5H3.75a.75.75 0 0 1-.75-.75ZM3.75 18.75a.75.75 0 0 0 0 1.5h16.5a.75.75 0 0 0 0-1.5H3.75Z"}))}const Sn=h.forwardRef(Rn),yn=Object.freeze({sortMode:Qr,folderPlacement:hn,readmePlacement:en,selectionMode:rn,doubleClickAction:dn,expandIconSize:bn,alwaysExpanded:b.ForwardRef$2,revealDocument:b.ForwardRef$1,showFolderReadme:vn,removeRootIndent:ln,lines:Sn,expandIcons:on,directoryIcons:wn,fileIcons:pn}),wt=(e,t)=>{const r=e[t.labelKey];if(typeof r!="string")throw new TypeError(`[markdown-explorer] the tree setting ${t.key} must name a string label; labels.${t.labelKey} is ${lt.describeValue(r)}`);return r},kn=({id:e,settings:t,descriptors:r,onAdvance:l,onClose:c,ref:i})=>{const{labels:o}=b.useExplorer(),s=n.useRef([]);n.useEffect(()=>{s.current[0]?.focus()},[]);const p=n.useCallback(d=>{const u=r.length;s.current[(d%u+u)%u]?.focus()},[r.length]),f=n.useCallback((d,u)=>{switch(d.key){case"ArrowDown":d.preventDefault(),p(u+1);break;case"ArrowUp":d.preventDefault(),p(u-1);break;case"Home":d.preventDefault(),p(0);break;case"End":d.preventDefault(),p(r.length-1);break;case"Escape":b.consumeKey(d),c();break;case"Tab":c();break}},[r.length,p,c]);return a.jsx("div",{ref:i,id:e,role:"menu","aria-label":o.treeSettings,className:"aqmx-explorer-menu","data-testid":"markdown-explorer-tree-settings-menu",children:r.map((d,u)=>{const m=yn[d.key],w=wt(o,d),g=_.formatTreeSettingValue(o,t,d.key),v=t[d.key],y=typeof v=="boolean"?{role:"menuitemcheckbox","aria-checked":v,"aria-label":w}:{role:"menuitem","aria-label":`${w}: ${g}`};return a.jsxs("button",{ref:T=>{s.current[u]=T},type:"button",tabIndex:-1,...y,title:`${w}: ${g}`,className:"aqmx-explorer-menu-item","data-testid":"markdown-explorer-tree-settings-item","data-aqmx-setting":d.key,onClick:()=>l(d),onKeyDown:T=>f(T,u),children:[a.jsx(m,{className:"aqmx-explorer-menu-icon","aria-hidden":"true"}),a.jsx("span",{className:"aqmx-explorer-menu-name",children:w}),a.jsx("span",{className:"aqmx-explorer-menu-value",children:g})]},d.key)})})},Cn=({settings:e,descriptors:t,onAdvance:r})=>{const{labels:l,announcer:c}=b.useExplorer(),[i,o]=n.useState(!1),s=n.useRef(null),p=n.useRef(null),f=n.useRef(null),d=n.useId(),u=n.useCallback(()=>{s.current?.focus(),o(!1)},[]);n.useEffect(()=>{if(!i)return;const g=v=>{v.target instanceof Node&&(s.current?.contains(v.target)===!0||p.current?.contains(v.target)===!0)||(o(!1),f.current!==null&&window.clearTimeout(f.current),f.current=window.setTimeout(()=>{f.current=null,(document.activeElement===null||document.activeElement===document.body)&&s.current?.focus()},0))};return document.addEventListener("pointerdown",g),()=>document.removeEventListener("pointerdown",g)},[i]),n.useEffect(()=>()=>{f.current!==null&&window.clearTimeout(f.current)},[]);const m=n.useCallback(g=>{g.key!=="Escape"||!i||(b.consumeKey(g),u())},[i,u]),w=n.useCallback(g=>{const v=r(g.key);c.announce(l.settingAnnouncement(wt(l,g),_.formatTreeSettingValue(l,v,g.key)))},[c,l,r]);return{trigger:a.jsx("button",{ref:s,type:"button",className:"aqmx-icon-button","aria-haspopup":"menu","aria-expanded":i,"aria-controls":i?d:void 0,"aria-label":l.treeSettings,title:l.treeSettings,"data-testid":"markdown-explorer-tree-settings",onClick:()=>o(g=>!g),onKeyDown:m,children:a.jsx(cn,{"aria-hidden":"true"})}),menu:i?a.jsx(kn,{ref:p,id:d,settings:e,descriptors:t,onAdvance:w,onClose:u}):null}},Ln=()=>{const{treeSettings:e}=b.useExplorer();return{settings:n.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getServerSnapshot),advance:e.advance}},et=new Set,Tn='[role="tree"] [role="treeitem"][tabindex="0"]',jn="[data-directory-tree-tab-stop]",An=e=>{const{mode:t,sourceId:r,currentPath:l,openPaths:c,onOpenDocument:i,onSourceChange:o,onRevealSource:s,viewSwitch:p}=e,{labels:f,sources:d,trees:u,documents:m,announcer:w,reveals:g}=b.useExplorer(),{settings:v,advance:y}=Ln(),T=n.useMemo(()=>_.visibleTreeSettingDescriptors(t),[t]),A=t==="tree"&&v.selectionMode==="multiple";Gr(A);const R=e.mode==="tree"?e.tray.onGatheredChange:null,I=e.mode==="tree"?e.onOpenSelection:void 0,M=e.mode==="tree"?e.onOpenFolder:null,k=e.mode==="tree"?e.onCloseFolder:null,j=e.mode==="tree"&&e.currentFolder,P=n.useMemo(()=>M===null||k===null||!v.showFolderReadme?null:{current:l,open:M,close:k},[M,k,l,v.showFolderReadme]),S=e.mode==="tree"&&A?e.tray.gathered:Ce,C=n.useCallback(O=>{const $=y(O);return $.selectionMode!=="multiple"&&R?.(Ce),$},[y,R]),q=Cn({settings:v,descriptors:T,onAdvance:C}),L=n.useCallback(O=>R?.($=>Wr($,O)),[R]),D=n.useCallback(O=>R?.($=>Xr($,O)),[R]),W=n.useCallback(()=>R?.(Ce),[R]),ce=n.useRef(null),ie=n.useCallback(()=>{const O=ce.current;if(O===null)return;[Tn,jn,'[data-testid="markdown-explorer-tree-settings"]'].map(G=>O.querySelector(G)).find(G=>G!==null)?.focus()},[]),V=n.useMemo(()=>new Set(S.keys()),[S]),oe=n.useMemo(()=>l===null?et:new Set([l]),[l]),X=n.useMemo(()=>{if(t==="multi")return{mode:"multiple",items:c,shownPath:null,onChange:null};switch(v.selectionMode){case"single":return{mode:"single",items:oe,shownPath:l,onChange:null};case"multiple":return{mode:"multiple",items:V,shownPath:l,onChange:L};case"none":return{mode:"none",items:et,shownPath:null,onChange:null}}},[t,c,v.selectionMode,oe,l,V,L]),Y=n.useMemo(()=>v.revealDocument?{path:l,openFolders:!j}:{path:X.shownPath,openFolders:!1},[v.revealDocument,l,j,X.shownPath]),se=n.useCallback(O=>{l!==null&&g.settle(l),o(O)},[l,g,o]),[H,ue]=n.useState(null),[K,N]=n.useState(!1),[Q,U]=n.useState(null),de=n.useRef(!1),fe=n.useCallback(async()=>{if(!de.current){de.current=!0,N(!0),U(null);try{const O=await u.refresh(r);if(O.status==="superseded")return;m.invalidate(),O.status==="failed"?U({sourceId:r,failure:O.failure}):w.announce(f.treeRefreshed)}finally{de.current=!1,N(!1)}}},[u,m,r,w,f]),ge=n.useCallback(()=>{fe()},[fe]),J=H===null?null:H.expandAll,te=H?.expanding===!0,be=d.find(O=>O.id===r),he=p.target==="multi"?zt:Zt,xe=p.target==="multi"?f.switchToMulti:f.switchToTree;return a.jsxs("nav",{ref:ce,"aria-label":f.explorerRegion,className:"aqmx-explorer","data-testid":"markdown-explorer-explorer","data-aqmx-mode":t,children:[a.jsxs("div",{className:"aqmx-explorer-header",children:[d.length>1?a.jsx("select",{className:"aqmx-explorer-source","aria-label":f.sourceLabel,title:be?.label,value:r,onChange:O=>se(O.currentTarget.value),"data-testid":"markdown-explorer-source-select",children:d.map(O=>a.jsx("option",{value:O.id,children:O.label},O.id))}):null,a.jsxs("div",{className:"aqmx-explorer-actions",children:[a.jsx(b.ExplorerLink,{to:p.href,navigation:"switch-view",className:"aqmx-icon-button","aria-label":xe,title:xe,"data-testid":"markdown-explorer-view-switch","data-aqmx-target":p.target,children:a.jsx(he,{"aria-hidden":"true"})}),a.jsxs("button",{type:"button",className:"aqmx-icon-button aqmx-labelled-button",title:f.refreshTree,"aria-disabled":K,"aria-busy":K,"data-aqmx-busy":K?"true":void 0,"data-testid":"markdown-explorer-refresh",onClick:()=>{fe()},children:[a.jsx(b.ForwardRef,{"aria-hidden":"true"}),a.jsx("span",{children:f.refreshTreeLabel})]}),a.jsx("button",{type:"button",className:"aqmx-icon-button","aria-label":f.expandAll,title:f.expandAll,"aria-disabled":J===null||te,"aria-busy":te,"data-aqmx-busy":te?"true":void 0,"data-testid":"markdown-explorer-expand-all",onClick:()=>J?.(),children:a.jsx(Ht,{"aria-hidden":"true"})}),a.jsx("button",{type:"button",className:"aqmx-icon-button","aria-label":f.collapseAll,title:f.collapseAll,"aria-disabled":H===null,"data-testid":"markdown-explorer-collapse-all",onClick:()=>H?.collapseAll(),children:a.jsx(It,{"aria-hidden":"true"})}),q.trigger]})]}),a.jsxs("div",{className:"aqmx-explorer-body","data-aqmx-explorer-body":"",children:[a.jsx(b.SheetAccessFailureList,{}),Q!==null&&Q.sourceId===r?a.jsx(On,{failure:Q.failure,onRetry:ge}):null,a.jsx(n.Suspense,{fallback:null,children:a.jsx(Wt,{})}),a.jsx(Vr,{mode:t,sourceId:r,settings:v,reveal:Y,openPaths:c,selection:X,onOpenDocument:i,folders:P,onRevealSource:s,onControls:ue},r),A&&S.size>0?a.jsx(Ur,{selection:S,onRemove:D,onClear:W,onOpenSelection:I,onLeave:ie}):null,q.menu]})]})},On=({failure:e,onRetry:t})=>{const{labels:r}=b.useExplorer(),{reason:l}=e;return b.isAccessFailureReason(l)?a.jsx(b.AccessFailureNotice,{failure:e,place:"read",deniedSentence:null,retry:t,testId:"markdown-explorer-refresh-failure"}):a.jsx("p",{role:"alert",className:"aqmx-explorer-refresh-failure","data-testid":"markdown-explorer-refresh-failure","data-aqmx-failure":l,children:r.treeRefreshFailed(b.failureTitleOf(r,l))})};function Nn({title:e,titleId:t,...r},l){return h.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},r),e?h.createElement("title",{id:t},e):null,h.createElement("path",{fillRule:"evenodd",d:"M3 6.75A.75.75 0 0 1 3.75 6h16.5a.75.75 0 0 1 0 1.5H3.75A.75.75 0 0 1 3 6.75ZM3 12a.75.75 0 0 1 .75-.75h16.5a.75.75 0 0 1 0 1.5H3.75A.75.75 0 0 1 3 12Zm0 5.25a.75.75 0 0 1 .75-.75h16.5a.75.75 0 0 1 0 1.5H3.75a.75.75 0 0 1-.75-.75Z",clipRule:"evenodd"}))}const gt=h.forwardRef(Nn),Fn=({explorer:e,toggleRef:t,covered:r,merged:l,onNoticeSlotChange:c,accessFailures:i,dismissals:o})=>{const{labels:s}=b.useExplorer(),p=Le.useLocation(),f=Le.useNavigationType(),{location:d}=b.useExplorerLocation(),[u,m]=n.useState(!1),[w,g]=n.useState({navigated:p,source:d.source}),[v,y]=n.useState(!1);w.navigated!==p&&(g({navigated:p,source:d.source}),w.source===d.source&&!v&&b.explorerNavigationOf(f,p.state)!=="close-folder"&&m(!1));const[T,A]=n.useState(o);T!==o&&(A(o),m(!1));const R=n.useRef(null),I=n.useRef(null),M=n.useRef(null),k=n.useRef(!1),j=n.useId();n.useLayoutEffect(()=>{const L=R.current;L!==null&&(u&&!L.open?(L.showModal(),I.current?.focus()):!u&&L.open&&(L.close(),t.current?.focus()),c(u?M.current:null))},[u,t,c]),n.useLayoutEffect(()=>()=>c(null),[c]);const P=n.useCallback(L=>{L.key!=="Escape"||L.defaultPrevented||(b.consumeKey(L),m(!1))},[]),S=n.useCallback(L=>{k.current=L.target===L.currentTarget},[]),C=n.useCallback(L=>{const D=k.current;k.current=!1,D&&L.target===L.currentTarget&&m(!1)},[]),q=n.useCallback(()=>{m(!1)},[]);return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"aqmx-sheet-bar",inert:r,"data-testid":"markdown-explorer-sheet-bar","data-aqmx-sheet-bar-merged":l?"true":"false",children:a.jsxs("button",{ref:t,type:"button",className:"aqmx-explorer-toggle",title:l?s.showExplorer:void 0,"aria-haspopup":"dialog","aria-expanded":u,"aria-controls":j,"data-testid":"markdown-explorer-sheet-toggle",onClick:()=>m(!0),children:[a.jsx(gt,{"aria-hidden":"true"}),a.jsx("span",{className:l?"aqmx-sr-only":void 0,children:s.showExplorer})]})}),a.jsx("dialog",{ref:R,id:j,className:"aqmx-sheet","aria-label":s.explorerRegion,"data-testid":"markdown-explorer-sheet",onKeyDown:P,onPointerDown:S,onClick:C,onClose:q,children:a.jsxs("div",{className:"aqmx-sheet-panel",children:[a.jsxs("div",{className:"aqmx-explorer-chrome",children:[a.jsx("div",{ref:M,className:"aqmx-sheet-notice-slot"}),a.jsx("button",{ref:I,type:"button",className:"aqmx-explorer-close","aria-label":s.hideExplorer,title:s.hideExplorer,"data-testid":"markdown-explorer-sheet-close",onClick:()=>m(!1),children:a.jsx(Me,{"aria-hidden":"true"})})]}),a.jsx("div",{className:"aqmx-sheet-body",children:a.jsx(qe,{value:u,children:a.jsx(b.SheetAccessFailuresContext,{value:i,children:a.jsx(xt,{value:y,children:e})})})}),a.jsx(b.LiveRegion,{holds:u,deferWhileFullscreenIn:null,testId:"markdown-explorer-sheet-announcer"})]})})]})},bt=n.createContext(null),_e="aqmx-explorer",Et="aqmx-content",Ie='[role="tree"] [role="treeitem"]',Pn=`${Ie}[tabindex="0"]`,qn="[data-directory-tree-tab-stop]",Mn=(e,t)=>{for(const r of e.querySelectorAll(`[data-panel-id="${_e}"] ${Ie}`))if(r.getAttribute(ae)===t)return r;return null},tt=(e,t)=>({inlineSize:e>0?e:null,rootFontPixels:t>0?t:_.ASSUMED_ROOT_FONT_PIXELS}),_n=(e,t)=>{const[r,l]=n.useState(()=>tt(0,0));return n.useLayoutEffect(()=>{const c=e.current,i=t.current;if(c===null||i===null)throw new Error("[markdown-explorer] the split frame is not mounted");const o={frame:c.getBoundingClientRect().width,rem:i.getBoundingClientRect().width},s=()=>{const f=tt(o.frame,o.rem);l(d=>d.inlineSize===f.inlineSize&&d.rootFontPixels===f.rootFontPixels?d:f)};s();const p=new ResizeObserver(f=>{for(const d of f){const[u]=d.borderBoxSize;u!==void 0&&(d.target===c&&(o.frame=u.inlineSize),d.target===i&&(o.rem=u.inlineSize))}s()});return p.observe(c),p.observe(i),()=>p.disconnect()},[e,t]),r},vt=e=>`aqmx-split-handle-${e}`,In=(e,{frameRef:t,sheetToggleRef:r,railToggleRef:l,closeButtonRef:c,handleId:i})=>{const o=n.useRef(!1),s=n.useRef(null),p=n.useRef(!1);n.useLayoutEffect(()=>{const d=t.current;if(d===null)throw new Error("[markdown-explorer] the split frame is not mounted");const u=w=>{const g=w.target instanceof Element?w.target:null;o.current=g!==null&&g.closest(`[data-panel-id="${Et}"]`)===null,!p.current&&(s.current=g?.closest(`${Ie}[${ae}]`)?.getAttribute(ae)??null)},m=w=>{w.relatedTarget instanceof Node&&!d.contains(w.relatedTarget)&&(o.current=!1)};return d.addEventListener("focusin",u),d.addEventListener("focusout",m),()=>{d.removeEventListener("focusin",u),d.removeEventListener("focusout",m)}},[t]);const f=n.useRef(e);n.useLayoutEffect(()=>{const d=f.current;if(d===e)return;f.current=e;const u=t.current;if(u===null||!o.current)return;const m=w=>{const{activeElement:g,body:v}=u.ownerDocument;if(g!==null&&g!==v)return;const y=w.find(T=>T!==null);if(y!=null){p.current=!0;try{y.focus()}finally{p.current=!1}}};if(e==="sheet"){m([r.current]);return}if(e==="rail"){m([l.current]);return}if(d==="rail"){m([c.current]);return}queueMicrotask(()=>{if(f.current!==e||!o.current)return;const w=s.current,g=`[data-panel-id="${_e}"]`;m([w===null?null:Mn(u,w),u.querySelector(`${g} ${Pn}`),u.querySelector(`${g} ${qn}`),u.querySelector(`[data-resize-handle-id="${i}"]`)])})},[e,t,r,l,c,i])},Dn=e=>e==="tree"?"treeExplorerHidden":"multiExplorerHidden",Hn=({view:e,explorer:t,content:r,contentCoversPage:l=!1,sheetDismissals:c=0,onDraggingChange:i})=>{const{viewSettings:o}=b.useExplorer(),s=n.useRef(null),[p,f]=n.useState(null),d=n.useRef(null),u=n.useRef(null),m=n.useRef(null),w=n.useRef(null),{inlineSize:g,rootFontPixels:v}=_n(s,d),y=Dn(e),T=b.useViewSetting(L=>L[y]===!0),A=g!==null&&g<_.explorerSheetBelowPixels(v),R=A?"sheet":T?"rail":"split";In(R,{frameRef:s,sheetToggleRef:u,railToggleRef:m,closeButtonRef:w,handleId:vt(e)});const I=n.useCallback(()=>o.update({[y]:!0}),[o,y]),M=n.useCallback(()=>o.update({[y]:!1}),[o,y]),[k,j]=n.useState(!1),P=n.useMemo(()=>A?{lane:!l,onBar:j}:null,[A,l]),[S]=n.useState(()=>new Map),[C]=n.useState(b.createSheetAccessFailures),q=A&&p!==null?C:null;return a.jsx(at,{value:S,children:a.jsxs("div",{ref:s,className:"aqmx-split-frame","data-aqmx-explorer-mode":R,"data-aqmx-measured":g===null?"false":"true","data-aqmx-content-covers-page":l?"true":"false",children:[a.jsx("span",{ref:d,className:"aqmx-rem-probe","aria-hidden":"true","data-aqmx-rem-probe":""}),A?a.jsx(Fn,{explorer:t,toggleRef:u,covered:l,merged:k,onNoticeSlotChange:f,accessFailures:C,dismissals:c}):null,a.jsxs("div",{className:"aqmx-split-row",children:[R==="rail"?a.jsx(Bn,{toggleRef:m,covered:l,onOpen:M}):null,a.jsx(bt,{value:A?p:null,children:a.jsx(b.AccessFailureRelayContext,{value:q,children:a.jsx(b.SheetBarContext,{value:P,children:a.jsx(Zn,{view:e,mode:R,explorer:t,content:r,contentCoversPage:l,onDraggingChange:i,explorerMinPixels:_.explorerMinPixels(v),closeButtonRef:w,onHide:I})})})})]})]})})},Bn=({toggleRef:e,covered:t,onOpen:r})=>{const{labels:l}=b.useExplorer();return a.jsx("div",{className:"aqmx-split-rail",inert:t,"data-testid":"markdown-explorer-rail",children:a.jsx("button",{ref:e,type:"button",className:"aqmx-explorer-toggle","aria-expanded":!1,"aria-label":l.showExplorer,title:l.showExplorer,"data-testid":"markdown-explorer-rail-toggle",onClick:r,children:a.jsx(gt,{"aria-hidden":"true"})})})},Zn=({view:e,mode:t,explorer:r,content:l,contentCoversPage:c,onDraggingChange:i,explorerMinPixels:o,closeButtonRef:s,onHide:p})=>{const{viewSettings:f,labels:d}=b.useExplorer(),u=n.useMemo(()=>Xe.toPanelGroupLabels(d),[d]),w=b.useViewSetting(S=>e==="tree"?S.treeExplorer:S.multiExplorer)??(e==="tree"?_.EXPLORER_DEFAULT_PERCENT:_.EXPLORER_MULTI_DEFAULT_PERCENT),g=n.useRef(!1),[v,y]=n.useState(!1),T=n.useRef(!1),A=n.useRef(i);n.useLayoutEffect(()=>{A.current=i},[i]);const R=Xe.useSplitPersistence(n.useCallback(S=>{if(S.length!==2)return;const[C=0,q=0]=S,L=C+q;if(L<=0||C<=0)return;const D=Math.min(_.EXPLORER_MAX_PERCENT,C/L*100);f.update(e==="tree"?{treeExplorer:D}:{multiExplorer:D})},[f,e]));n.useEffect(()=>()=>{g.current&&A.current?.(!1)},[]);const I=_.COARSE_TARGET_PIXELS,M=t==="split",k=n.useCallback(()=>{T.current=!1,y(!1),p()},[p]),j=n.useCallback((S,C)=>{const[q=0,L=0]=S;S.length===2&&L>0&&(T.current=q<=0,y(T.current)),R.layoutChanged(S,C),T.current&&C.source==="keyboard"&&k()},[R,k]),P=n.useCallback(S=>{g.current=S,i?.(S),R.draggingChanged(S),!S&&T.current&&k()},[i,R,k]);return a.jsxs(ke.PanelGroup,{id:`aqmx-split-${e}`,direction:"horizontal",onLayout:j,labels:u,className:"aqmx-split","data-aqmx-split":e,children:[M?a.jsxs(ke.Panel,{id:_e,defaultSize:{value:w,unit:"percentage"},minSize:{value:o,unit:"pixels"},maxSize:{value:_.EXPLORER_MAX_PERCENT,unit:"percentage"},collapsible:{from:"end"},pixelAdjustPriority:1,inert:c,className:"aqmx-split-explorer",children:[a.jsx("div",{className:"aqmx-explorer-chrome",children:a.jsx("button",{ref:s,type:"button",className:"aqmx-explorer-close","aria-label":d.hideExplorer,title:d.hideExplorer,"data-testid":"markdown-explorer-split-close",onClick:k,children:a.jsx(Me,{"aria-hidden":"true"})})}),a.jsx(qe,{value:!v,children:r})]}):null,M?a.jsx(ke.PanelResizeHandle,{id:vt(e),thickness:I,indicator:{visible:!0,thickness:_.SPLIT_HANDLE_PIXELS.gripThickness,length:_.SPLIT_HANDLE_PIXELS.gripLength,barThickness:_.SPLIT_HANDLE_PIXELS.barThickness,barLength:_.SPLIT_HANDLE_PIXELS.barLength},title:d.resizeExplorer,"aria-label":d.resizeExplorer,onDragging:P,inert:c,className:"aqmx-split-handle"}):null,a.jsx(ke.Panel,{id:Et,defaultSize:{value:M?100-w:100,unit:"percentage"},contentOverflow:"hidden",className:"aqmx-split-content",...c?{style:{isolation:"auto"}}:{},children:l})]})};exports.EMPTY_SELECTION=Ce;exports.ExplorerPane=An;exports.ExplorerSplit=Hn;exports.SheetNoticeSlotContext=bt;
|