@openparachute/notes-ui 0.1.0-rc.5 → 0.1.1
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 +57 -1
- package/dist/.parachute/info +1 -1
- package/dist/assets/{Activity-B6k-9wWy.js → Activity-DCz02G45.js} +1 -1
- package/dist/assets/{AddVault-DA_s9Ua2.js → AddVault-KGZOIx2j.js} +1 -1
- package/dist/assets/{Calendar-Dgd0dTEM.js → Calendar-CgYUCaSZ.js} +1 -1
- package/dist/assets/{Capture-C_s94G98.js → Capture-YgzRoZZX.js} +1 -1
- package/dist/assets/{NoteEditor-CxoH85Is.js → NoteEditor-DNYo0bPT.js} +1 -1
- package/dist/assets/{NoteNew-CTTJ_2cU.js → NoteNew-BWuLHfJV.js} +1 -1
- package/dist/assets/{NoteRenderer-cz03kLyS.js → NoteRenderer-CWW2zAJs.js} +1 -1
- package/dist/assets/{NoteView-B8BN-Dm4.js → NoteView-DR9WYC4s.js} +2 -2
- package/dist/assets/{OAuthCallback-CHpF2exs.js → OAuthCallback-5pCjuCLO.js} +1 -1
- package/dist/assets/{PinArchiveButtons-DogtDLiB.js → PinArchiveButtons-BO3QwhOp.js} +1 -1
- package/dist/assets/{Settings-DpNYPt6E.js → Settings-D8q_-oSw.js} +1 -1
- package/dist/assets/{Tags-C2seZlc0.js → Tags-BQjXsHYG.js} +1 -1
- package/dist/assets/{Today-Co3rl2Tl.js → Today-BZ5ksWIi.js} +1 -1
- package/dist/assets/VaultGraph-mQzbyY3l.js +3 -0
- package/dist/assets/{Vaults-GFmUZ3tT.js → Vaults-EaMq5ivX.js} +1 -1
- package/dist/assets/{index-BDPMEkxL.js → index-BF1NxtUe.js} +13 -13
- package/dist/assets/{react-force-graph-2d-CokIfB0T.js → react-force-graph-2d-CtvMkQ0a.js} +1 -1
- package/dist/assets/{useAttachmentUploader-CRSqlwYK.js → useAttachmentUploader-Du2IiCzJ.js} +1 -1
- package/dist/index.html +3 -3
- package/dist/sw.js +1 -1
- package/meta.json +1 -0
- package/package.json +1 -1
- package/dist/assets/VaultGraph-9bEHl7fl.js +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,63 @@
|
|
|
1
1
|
# Changelog — @openparachute/notes-ui
|
|
2
2
|
|
|
3
|
-
## [0.1.
|
|
3
|
+
## [0.1.1] - 2026-05-23
|
|
4
4
|
|
|
5
|
+
- **Fix: runtime mount detection — same built bundle works at any
|
|
6
|
+
mount path.** The 0.1.0 bundle baked `/notes/` into asset URLs and
|
|
7
|
+
the React Router basename at Vite build time, so parachute-app
|
|
8
|
+
installs (which mount UIs at `/app/<slug>/`) loaded the bundle but
|
|
9
|
+
immediately broke:
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
<Router basename="/notes"> is not able to match the URL "/app/notes"
|
|
13
|
+
because it does not start with the basename
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
OAuth also 401'd because the DCR client registered with the wrong
|
|
17
|
+
redirect URI (`/notes/oauth/callback` instead of the live
|
|
18
|
+
`/app/notes/oauth/callback`).
|
|
19
|
+
|
|
20
|
+
The fix:
|
|
21
|
+
- Vite `base: ""` emits **relative** asset URLs (`./assets/...`,
|
|
22
|
+
`./manifest.webmanifest`) in the built `index.html`. Browser
|
|
23
|
+
resolves them against the document URL, so assets load from any
|
|
24
|
+
mount.
|
|
25
|
+
- New `src/lib/base-url.ts` exports `detectMountBase()` — reads
|
|
26
|
+
`window.location.pathname` at runtime to identify the mount
|
|
27
|
+
prefix. Recognises `/app/<slug>` (parachute-app's
|
|
28
|
+
single-segment slug grammar, matching `meta-schema`'s
|
|
29
|
+
PATH_PATTERN) and `/notes` (legacy notes-daemon mount), and
|
|
30
|
+
falls back to `/notes` for unrecognised paths.
|
|
31
|
+
- `BrowserRouter`'s `basename` and `oauth.basePathPrefix()` both
|
|
32
|
+
switch from `import.meta.env.BASE_URL` to `detectMountBase()`,
|
|
33
|
+
so router matching and the OAuth callback URL track the live
|
|
34
|
+
mount automatically.
|
|
35
|
+
|
|
36
|
+
Same `dist/` now works at `/notes/` (legacy daemon), `/app/notes/`
|
|
37
|
+
(parachute-app default), `/app/<custom-slug>/` (renamed install),
|
|
38
|
+
and any deep route under each.
|
|
39
|
+
|
|
40
|
+
- **Amendment: meta-tag fast-path before regex fallback.** Adds meta-tag
|
|
41
|
+
fast-path to mount detection. Apps read `<meta name="parachute-mount">`
|
|
42
|
+
first; regex fallback handles the interim until parachute-app injects
|
|
43
|
+
the meta tag (tracked at parachute-app#21). Forward-compatible: when the canonical
|
|
44
|
+
injection ships, no code change required in notes-ui.
|
|
45
|
+
|
|
46
|
+
- **PWA install limitation (known, deferred to Phase 2).** The PWA
|
|
47
|
+
manifest's `start_url`/`scope` and the service worker's
|
|
48
|
+
`navigateFallback` are fixed at Vite build time — the spec doesn't
|
|
49
|
+
support runtime values without server-side rewriting. The default
|
|
50
|
+
build keeps `/notes/` as the PWA mount; operators who install
|
|
51
|
+
Notes at a non-default mount and want PWA "Add to Home Screen" to
|
|
52
|
+
open the right path must build with `VITE_BASE_PATH=/app/<slug>`.
|
|
53
|
+
In-browser use (no PWA install) works at any mount from a single
|
|
54
|
+
build. A future parachute-app manifest-rewrite hook would lift
|
|
55
|
+
this — tracked separately.
|
|
56
|
+
|
|
57
|
+
## [0.1.0] - 2026-05-23
|
|
58
|
+
|
|
59
|
+
- **First stable release; promoted from rc.5.** Tagged `@latest` for
|
|
60
|
+
parachute-app bootstrap's bare-spec resolution.
|
|
5
61
|
- **Fix: ship `meta.json` so parachute-app bootstrap can install.**
|
|
6
62
|
parachute-app's auto-bootstrap path validates `@openparachute/notes-
|
|
7
63
|
ui`'s tarball against its [meta-schema][meta-schema] and requires
|
package/dist/.parachute/info
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aa as h,W as g,x as l,r as e,N as f,L as m,z as b,V as y}from"./index-
|
|
1
|
+
import{aa as h,W as g,x as l,r as e,N as f,L as m,z as b,V as y}from"./index-BF1NxtUe.js";const p=1440*60*1e3,j=5e3;function N(n,r=30,s=new Date){const d=s.getTime()-r*p,a=[];for(const t of n){const c=t.path??t.id,o=Date.parse(t.createdAt);if(Number.isFinite(o)&&o>=d&&a.push({id:`${t.id}:created`,noteId:t.id,noteName:c,kind:"created",at:t.createdAt,preview:t.preview,tags:t.tags}),t.updatedAt){const i=Date.parse(t.updatedAt);Number.isFinite(i)&&i>=d&&Number.isFinite(o)&&i-o>j&&a.push({id:`${t.id}:updated`,noteId:t.id,noteName:c,kind:"updated",at:t.updatedAt,preview:t.preview,tags:t.tags})}}return a.sort((t,c)=>Date.parse(c.at)-Date.parse(t.at)),a}const v=["today","yesterday","thisWeek","older"],k={today:"Today",yesterday:"Yesterday",thisWeek:"This week",older:"Older"};function w(n,r=new Date){const s=Date.parse(n);if(!Number.isFinite(s))return null;const d=u(r),a=u(new Date(s)),t=Math.round((d.getTime()-a.getTime())/p);return t<0||t===0?"today":t===1?"yesterday":t<7?"thisWeek":"older"}function u(n){return new Date(n.getFullYear(),n.getMonth(),n.getDate())}function D(n,r=new Date){const s={today:[],yesterday:[],thisWeek:[],older:[]};for(const d of n){const a=w(d.at,r);a&&s[a].push(d)}return s}const x=50;function F(){const n=h(i=>i.getActiveVault()),r=g(),[s,d]=l.useState(x),a=l.useMemo(()=>r.data?N(r.data):[],[r.data]),t=l.useMemo(()=>a.slice(0,s),[a,s]),c=l.useMemo(()=>D(t),[t]),o=a.length-t.length;return n?e.jsxs("div",{className:"mx-auto max-w-3xl px-4 py-6 md:px-6 md:py-10",children:[e.jsxs("header",{className:"mb-5 md:mb-6",children:[e.jsx("p",{className:"text-xs uppercase tracking-wider text-fg-dim",children:"Activity"}),e.jsx("h1",{className:"font-serif text-2xl tracking-tight md:text-3xl",children:"Recent changes"}),e.jsx("p",{className:"mt-1 text-sm text-fg-muted",children:"Last 30 days, newest first. Deletions aren't tracked yet."})]}),r.isPending?e.jsx(T,{}):r.isError?e.jsx(B,{error:r.error}):a.length===0?e.jsx(S,{}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"space-y-8",children:v.map(i=>c[i].length>0?e.jsx(E,{title:k[i],events:c[i]},i):null)}),o>0?e.jsx("div",{className:"mt-8 flex justify-center",children:e.jsxs("button",{type:"button",onClick:()=>d(i=>i+x),className:"rounded-md border border-border bg-card px-4 py-2 text-sm text-fg-muted hover:text-accent",children:["Load more (",o," remaining)"]})}):null]})]}):e.jsx(f,{to:"/",replace:!0})}function E({title:n,events:r}){return e.jsxs("section",{children:[e.jsxs("h2",{className:"mb-2 text-xs uppercase tracking-wider text-fg-dim",children:[n," (",r.length,")"]}),e.jsx("ol",{className:"divide-y divide-border rounded-md border border-border bg-card",children:r.map(s=>e.jsx("li",{children:e.jsxs(m,{to:`/n/${encodeURIComponent(s.noteId)}`,className:"block px-4 py-3 hover:bg-bg/60 focus:bg-bg/60 focus:outline-none",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-4",children:[e.jsxs("div",{className:"flex min-w-0 items-baseline gap-2",children:[e.jsx(A,{kind:s.kind}),e.jsx("span",{className:"truncate font-mono text-sm text-fg",children:s.noteName})]}),e.jsx("span",{className:"shrink-0 text-xs text-fg-dim",children:b(s.at)})]}),s.preview?e.jsx("p",{className:"mt-1 truncate text-sm text-fg-muted",children:s.preview}):null,s.tags&&s.tags.length>0?e.jsx("div",{className:"mt-2 flex flex-wrap gap-1",children:s.tags.map(d=>e.jsxs("span",{className:"rounded-md bg-border/40 px-1.5 py-0.5 text-xs text-fg-dim",children:["#",d]},d))}):null]})},s.id))})]})}function A({kind:n}){return n==="created"?e.jsx("span",{className:"shrink-0 rounded-md bg-accent/10 px-1.5 py-0.5 text-xs text-accent",children:"Created"}):e.jsx("span",{className:"shrink-0 rounded-md bg-border/40 px-1.5 py-0.5 text-xs text-fg-muted",children:"Edited"})}function S(){return e.jsxs("div",{className:"rounded-md border border-border bg-card p-10 text-center",children:[e.jsx("p",{className:"mb-4 text-fg-muted",children:"No activity in the last 30 days."}),e.jsx(m,{to:"/capture",className:"inline-block rounded-md bg-accent px-4 py-2 text-sm font-medium text-white hover:bg-accent-hover",children:"Open capture"})]})}function T(){return e.jsx("div",{className:"space-y-3","aria-busy":"true",children:[0,1,2,3,4].map(n=>e.jsx("div",{className:"h-16 animate-pulse rounded-md bg-border/30"},n))})}function B({error:n}){const r=n instanceof y;return e.jsxs("div",{className:"rounded-md border border-red-500/30 bg-red-500/5 p-6",children:[e.jsx("p",{className:"mb-2 font-medium text-red-400",children:r?"Session expired":"Could not load activity"}),e.jsx("p",{className:"mb-4 text-sm text-fg-muted",children:n.message}),r?e.jsx(m,{to:"/add",className:"inline-block rounded-md bg-accent px-4 py-2 text-sm font-medium text-white hover:bg-accent-hover",children:"Reconnect vault"}):null]})}export{F as Activity};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a3 as v,x as t,X as j,r as e,I as y,v as w,j as N,a as S}from"./index-
|
|
1
|
+
import{a3 as v,x as t,X as j,r as e,I as y,v as w,j as N,a as S}from"./index-BF1NxtUe.js";function R(){const[b]=v(),u=b.get("url")??"",[a,c]=t.useState(u),[i,l]=t.useState(null),[g,d]=t.useState(!1),[o,m]=t.useState(!1),x=t.useRef(null),h=t.useRef(u.length>0),n=j();t.useEffect(()=>{var s;(s=x.current)==null||s.focus()},[]),t.useEffect(()=>{h.current||n.status==="found"&&n.origin&&a===""&&(c(n.origin),h.current=!0)},[n.status,n.origin,a]);async function p(s){s.preventDefault(),l(null),d(!1);let f;try{f=w(a)}catch(r){l(r.message);return}m(!0);try{const{authorizeUrl:r}=await N(f);window.location.assign(r)}catch(r){r instanceof S?d(!0):l(r.message),m(!1)}}return e.jsxs("div",{className:"mx-auto max-w-xl px-6 py-16",children:[e.jsx("h1",{className:"mb-2 font-serif text-4xl tracking-tight",children:"Connect a vault"}),e.jsx("p",{className:"mb-8 text-fg-muted",children:"Paste your Parachute hub URL. You'll be taken to its consent page to authorize Parachute Notes."}),e.jsxs("form",{onSubmit:p,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"vault-url",className:"mb-1.5 block text-sm font-medium text-fg",children:"Hub URL"}),e.jsx("input",{id:"vault-url",ref:x,type:"url",required:!0,placeholder:"http://localhost:1939",value:a,onChange:s=>c(s.target.value),disabled:o,className:"w-full rounded-md border border-border bg-card px-3 py-2 font-mono text-sm text-fg focus:border-accent focus:outline-none"}),e.jsxs("p",{className:"mt-1.5 text-xs text-fg-dim",children:["For a local install the hub lives at ",e.jsx("code",{children:"http://localhost:1939"}),". A standalone vault URL (e.g. ",e.jsx("code",{children:"https://host/vault/default"}),") also works — Notes will OAuth against whichever issuer answers."]})]}),g?e.jsx(y,{}):null,i?e.jsx("div",{className:"rounded-md border border-red-400/30 bg-red-400/5 px-3 py-2 text-sm text-red-400",children:i}):null,e.jsx("button",{type:"submit",disabled:o||!a,className:"w-full rounded-md bg-accent px-4 py-2.5 text-sm font-medium text-white hover:bg-accent-hover disabled:cursor-not-allowed disabled:opacity-60",children:o?"Starting OAuth…":"Continue"})]})]})}export{R as AddVault};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aa as k,a3 as E,W as A,x as y,r as e,N as K,L as d,V as S}from"./index-
|
|
1
|
+
import{aa as k,a3 as E,W as A,x as y,r as e,N as K,L as d,V as S}from"./index-BF1NxtUe.js";import{d as f,c as j,e as P,m as T,t as V,s as N,p as i,a as C}from"./dates-BGZoWpL2.js";const _=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],x=5;function Y(){const a=k(t=>t.getActiveVault()),[o]=E(),l=o.get("month"),r=f(l)??f(j()),s=A(),h=P(),v=y.useMemo(()=>T(r.year,r.month),[r.year,r.month]),$=y.useMemo(()=>{const t=new Map;if(!s.data)return t;for(const n of s.data){const c=V(n.createdAt);c&&t.set(c,(t.get(c)??0)+1)}return t},[s.data]);if(!a)return e.jsx(K,{to:"/",replace:!0});const u=N(r.year,r.month,-1),p=N(r.year,r.month,1),b=`${u.year}-${i(u.month)}`,g=`${p.year}-${i(p.month)}`,M=j(),w=`${r.year}-${i(r.month)}`===M;return e.jsxs("div",{className:"mx-auto max-w-4xl px-4 py-6 md:px-6 md:py-10",children:[e.jsxs("header",{className:"mb-6 flex flex-wrap items-baseline justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs uppercase tracking-wider text-fg-dim",children:"Calendar"}),e.jsx("h1",{className:"font-serif text-3xl tracking-tight",children:C(r.year,r.month)})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[e.jsxs(d,{to:`/calendar?month=${b}`,className:"rounded-md border border-border bg-card px-3 py-1.5 text-fg-muted hover:text-accent","aria-label":"Previous month",children:["← ",b]}),w?null:e.jsx(d,{to:"/calendar",className:"rounded-md border border-border bg-card px-3 py-1.5 text-fg-muted hover:text-accent",children:"This month"}),e.jsxs(d,{to:`/calendar?month=${g}`,className:"rounded-md border border-border bg-card px-3 py-1.5 text-fg-muted hover:text-accent","aria-label":"Next month",children:[g," →"]}),e.jsx(d,{to:`/today?date=${h}`,className:"rounded-md border border-border bg-card px-3 py-1.5 text-fg-muted hover:text-accent",children:"Today"})]})]}),s.isError?e.jsx(L,{error:s.error}):e.jsxs("div",{className:"rounded-md border border-border bg-card","aria-busy":s.isPending,children:[e.jsx("div",{className:"grid grid-cols-7 border-b border-border text-xs uppercase tracking-wider text-fg-dim",children:_.map(t=>e.jsx("div",{className:"px-2 py-2 text-center",children:t},t))}),e.jsx("div",{className:"grid grid-cols-7",children:v.map(t=>{const n=`${t.getFullYear()}-${i(t.getMonth()+1)}-${i(t.getDate())}`,c=t.getMonth()+1===r.month,m=$.get(n)??0,D=n===h;return e.jsxs(d,{to:`/today?date=${n}`,className:`flex min-h-20 flex-col border-b border-r border-border p-1.5 text-xs hover:bg-bg/60 focus:bg-bg/60 focus:outline-none ${c?"":"opacity-40"}`,"aria-label":`${n} — ${m} notes`,children:[e.jsx("span",{className:`mb-1 inline-flex h-6 w-6 items-center justify-center rounded-full ${D?"bg-accent text-white":"text-fg"}`,children:t.getDate()}),m>0?e.jsx(F,{count:m}):e.jsx("span",{className:"sr-only",children:"no notes"})]},n)})})]}),e.jsx("p",{className:"mt-3 text-xs text-fg-dim",children:"Each dot is a note created on that day. Click any day to open /today."})]})}function F({count:a}){const o=Math.min(a,x),l=a>x?a-x:0;return e.jsxs("span",{className:"flex flex-wrap items-center gap-0.5",children:[Array.from({length:o}).map((r,s)=>e.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-accent","aria-hidden":"true"},s)),l>0?e.jsxs("span",{className:"ml-0.5 text-[10px] text-fg-dim",children:["+",l]}):null]})}function L({error:a}){const o=a instanceof S;return e.jsxs("div",{className:"rounded-md border border-red-500/30 bg-red-500/5 p-6",children:[e.jsx("p",{className:"mb-2 font-medium text-red-400",children:o?"Session expired":"Could not load notes"}),e.jsx("p",{className:"mb-4 text-sm text-fg-muted",children:a.message}),o?e.jsx(d,{to:"/add",className:"inline-block rounded-md bg-accent px-4 py-2 text-sm font-medium text-white hover:bg-accent-hover",children:"Reconnect vault"}):null]})}export{Y as Calendar};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aa as xe,a7 as be,a4 as ye,a5 as ve,E as we,x as i,t as Y,n as ke,s as Te,m as S,k as Re,r as a,N as Se,z as je,e as Ne,u as oe,L as Ee}from"./index-
|
|
1
|
+
import{aa as xe,a7 as be,a4 as ye,a5 as ve,E as we,x as i,t as Y,n as ke,s as Te,m as S,k as Re,r as a,N as Se,z as je,e as Ne,u as oe,L as Ee}from"./index-BF1NxtUe.js";const Ie=["audio/webm;codecs=opus","audio/mp4","audio/ogg;codecs=opus"];function Ce(r=Ie){if(typeof MediaRecorder>"u")return null;for(const t of r)if(MediaRecorder.isTypeSupported(t))return t;return null}function Me(r){return r.startsWith("audio/webm")?"webm":r.startsWith("audio/mp4")?"m4a":r.startsWith("audio/ogg")?"ogg":r.startsWith("audio/wav")?"wav":"bin"}function Ae(r){const t=r.now??(()=>Date.now()),d=r.MediaRecorderCtor??MediaRecorder,n=new d(r.stream,{mimeType:r.mimeType}),l=[];let s="idle",m=0,A=0;n.ondataavailable=k=>{k.data&&k.data.size>0&&l.push(k.data)};const p=()=>{for(const k of r.stream.getTracks())k.stop()};return{get state(){return s},get mimeType(){return r.mimeType},start(){if(s!=="idle")throw new Error(`Cannot start from ${s}`);n.start(),m=t(),s="recording"},pause(){s==="recording"&&(n.pause(),A+=t()-m,s="paused")},resume(){s==="paused"&&(n.resume(),m=t(),s="recording")},async stop(){if(s==="idle"||s==="stopped")throw new Error(`Cannot stop from ${s}`);s==="recording"&&(A+=t()-m);const k=new Promise(x=>{n.onstop=async()=>{const L=await $e(l);x({data:L,mimeType:r.mimeType,durationMs:A})}});return n.stop(),s="stopped",p(),k},cancel(){if(s==="recording"||s==="paused")try{n.stop()}catch{}s="stopped",l.length=0,p()}}}async function De(r){const t=r;return typeof t.arrayBuffer=="function"?t.arrayBuffer():new Promise((d,n)=>{const l=new FileReader;l.onload=()=>d(l.result),l.onerror=()=>n(l.error??new Error("FileReader error")),l.readAsArrayBuffer(r)})}async function $e(r){if(r.length===0)return new ArrayBuffer(0);const t=await Promise.all(r.map(s=>De(s))),d=t.reduce((s,m)=>s+m.byteLength,0),n=new Uint8Array(d);let l=0;for(const s of t)n.set(new Uint8Array(s),l),l+=s.byteLength;return n.buffer}async function Oe(){var r;if(typeof navigator>"u"||!((r=navigator.mediaDevices)!=null&&r.getUserMedia)){const t=new Error("Microphone is not available in this browser.");throw t.kind="unavailable",t}try{return await navigator.mediaDevices.getUserMedia({audio:!0})}catch(t){const d=new Error(t instanceof Error?t.message:"Microphone permission denied."),n=t instanceof DOMException?t.name:"";throw d.kind=n==="NotFoundError"||n==="OverconstrainedError"?"no-device":"permission-denied",d}}function Le(r,t=new Date){return`memo-${t.toISOString().replace(/[:.]/g,"-").replace(/Z$/,"")}.${Me(r)}`}function se(r=new Date){const t=r.getFullYear(),d=String(r.getMonth()+1).padStart(2,"0"),n=String(r.getDate()).padStart(2,"0"),l=String(r.getHours()).padStart(2,"0"),s=String(r.getMinutes()).padStart(2,"0"),m=String(r.getSeconds()).padStart(2,"0");return`Notes/${t}/${d}-${n}/${l}-${s}-${m}`}const Pe=/(?:^|\s)#([a-zA-Z][\w-]*)/g;function Z(r){const t=new Set;for(const d of r.matchAll(Pe)){const n=oe(d[1]??"");n&&t.add(n)}return[...t]}function G(r){const t=Math.floor(r/1e3),d=Math.floor(t/60),n=t%60;return`${String(d).padStart(2,"0")}:${String(n).padStart(2,"0")}`}function Fe({moreFieldsOpenDefault:r=!1}={}){const t=xe(e=>e.getActiveVault()),d=be(e=>e.push),{db:n,blobStore:l,engine:s}=ye(),{roles:m}=ve((t==null?void 0:t.id)??null),A=we(),[p,k]=i.useState(""),[x,L]=i.useState([]),[ie,F]=i.useState(""),[ce,de]=i.useState(r),D=i.useRef(se()),J=i.useRef(!1),[j,Q]=i.useState(()=>D.current),le=i.useCallback(e=>{J.current=e.trim()!==""&&e!==D.current,Q(e)},[]),[N,ue]=i.useState(""),[c,b]=i.useState({kind:"idle"}),[me,B]=i.useState(0),$=i.useRef(null),[q,X]=i.useState(null),[pe,fe]=i.useState(0),V=i.useRef(null),E=i.useRef(null),W=i.useRef(null),P=i.useRef(!1);i.useEffect(()=>{if(c.kind!=="recording")return;const e=setInterval(()=>B(Date.now()-c.startedAt),250);return()=>clearInterval(e)},[c]),i.useEffect(()=>()=>{E.current&&URL.revokeObjectURL(E.current)},[]),i.useEffect(()=>{var e;(e=W.current)==null||e.focus()},[]);const ge=i.useCallback(async()=>{if(!(c.kind==="recording"||c.kind==="requesting")){b({kind:"requesting"});try{const e=Ce();if(!e){b({kind:"denied",message:"This browser can't record audio in a format we can save."});return}const o=await Oe(),u=Ae({stream:o,mimeType:e});V.current=u,u.start(),B(0),b({kind:"recording",startedAt:Date.now()})}catch(e){const o=e,u=o.kind==="permission-denied"?"Microphone access was denied. Update your browser's site settings to record.":o.kind==="no-device"?"No microphone was found on this device.":o instanceof Error?o.message:"Microphone is not available in this browser.";b({kind:"denied",message:u})}}},[c]),ee=i.useCallback(async()=>{const e=V.current;if(!(!e||c.kind!=="recording"))try{const o=await e.stop();V.current=null;const u=new Blob([o.data],{type:o.mimeType}),y=URL.createObjectURL(u);E.current&&URL.revokeObjectURL(E.current),E.current=y,b({kind:"have-audio",data:o.data,mimeType:o.mimeType,url:y,durationMs:o.durationMs})}catch(o){d(o instanceof Error?`Recording failed: ${o.message}`:"Recording failed.","error"),b({kind:"idle"})}},[c,d]);i.useEffect(()=>{if(c.kind!=="recording")return;const e=()=>{ee()};return window.addEventListener("pointerup",e),window.addEventListener("pointercancel",e),()=>{window.removeEventListener("pointerup",e),window.removeEventListener("pointercancel",e)}},[c,ee]);const _=i.useCallback(()=>{E.current&&(URL.revokeObjectURL(E.current),E.current=null),b({kind:"idle"}),B(0)},[]),te=i.useCallback(()=>{var e;if($.current=null,X(null),k(""),L([]),F(""),!J.current){const o=se();D.current=o,Q(o)}_(),(e=W.current)==null||e.focus()},[_]),U=c.kind==="have-audio",T=p.trim().length>0,H=(T||U)&&c.kind!=="saving",z=i.useCallback(async()=>{if(!H||!n||!t)return;if(U&&!l){d("Sync queue not ready — try again in a moment.","error");return}const e=c.kind==="have-audio"?c:null;P.current=!0,b({kind:"saving"});const o=x.filter(g=>g.length>0),u=Z(p),y=[];T&&y.push(m.captureText),e&&y.push(m.captureVoice);const v=Array.from(new Set([...y,...o,...u].filter(g=>g.length>0))),f=$.current,w=(f==null?void 0:f.localId)??Y(),I=j.trim()||D.current,C=N.trim(),h=C?{summary:C}:void 0;A&&ke(t.id,A);try{if(e){const g=new Date,O=Le(e.mimeType,g),M=Te(),R=T?`${p.trim()}
|
|
2
2
|
|
|
3
3
|
_Transcript pending._
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{x as d,r as e,a7 as D,J as V,V as C,g as _,Y as z,aa as O,U as Y,N as K,L as R,Q as W,a8 as q,f as H,z as T,e as J,u as Q}from"./index-BDPMEkxL.js";import{u as Z,A as G,C as X,a as ee,b as te}from"./useAttachmentUploader-CRSqlwYK.js";import{P as se,D as ne}from"./PinArchiveButtons-DogtDLiB.js";import{b as re,N as ae}from"./NoteRenderer-cz03kLyS.js";const oe=250;function de({noteId:t,attachment:n}){const[l,a]=d.useState(!1),o=ce(n);return e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:()=>a(!0),"aria-label":`Remove attachment ${o}`,className:"shrink-0 rounded border border-transparent px-1.5 py-0.5 text-fg-dim hover:border-red-500/40 hover:text-red-400",children:"✕"}),l?e.jsx(ie,{noteId:t,attachment:n,label:o,onClose:()=>a(!1)}):null]})}function ie({noteId:t,attachment:n,label:l,onClose:a}){const o=D(i=>i.push),m=V(),[s,h]=d.useState(!1),[w,p]=d.useState(null),N=d.useRef(null);d.useEffect(()=>{const i=setTimeout(()=>h(!0),oe);return()=>clearTimeout(i)},[]),d.useEffect(()=>{var i;(i=N.current)==null||i.focus()},[]),d.useEffect(()=>{const i=g=>{g.key==="Escape"&&a()};return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[a]);const b=d.useCallback(()=>{!s||m.isPending||(p(null),m.mutate({noteId:t,attachmentId:n.id},{onSuccess:()=>{o(`Removed ${l}`,"success"),a()},onError:i=>{if(i instanceof C){p("Session expired. Reconnect to remove attachments.");return}if(i instanceof _){o(`Already removed ${l}`,"info"),a();return}p(i instanceof Error?i.message:"Remove failed")}}))},[s,n.id,l,m,t,a,o]);return e.jsx("dialog",{open:!0,"aria-labelledby":"confirm-remove-attachment-title",className:"fixed inset-0 z-40 m-0 flex h-full max-h-full w-full max-w-full items-center justify-center bg-black/60 p-4",onMouseDown:i=>{i.target===i.currentTarget&&a()},children:e.jsxs("div",{className:"w-full max-w-md rounded-md border border-border bg-card p-6 shadow-xl",children:[e.jsx("h2",{id:"confirm-remove-attachment-title",className:"mb-2 font-serif text-lg text-red-400",children:"Remove attachment?"}),e.jsxs("p",{className:"mb-3 text-sm text-fg-muted",children:[e.jsx("span",{className:"rounded bg-bg/60 px-1 py-0.5 font-mono text-xs text-fg",children:l})," ","will be detached from this note. If no other note references the file, it will also be deleted from storage. Markdown referencing it will show a broken link until you update it."]}),w?e.jsx("p",{role:"alert",className:"mb-3 text-sm text-red-400",children:w}):null,e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx("button",{ref:N,type:"button",onClick:a,className:"min-h-11 rounded-md border border-border bg-card px-3 py-1.5 text-sm text-fg-muted hover:text-fg",children:"Cancel"}),e.jsx("button",{type:"button",onClick:b,disabled:!s||m.isPending,className:"min-h-11 rounded-md bg-red-500 px-4 py-1.5 text-sm font-medium text-white hover:bg-red-600 disabled:opacity-40",children:m.isPending?"Removing…":"Remove"})]})]})})}function ce(t){if(t.filename)return t.filename;if(t.path){const n=t.path.split("/").pop();return n||t.path}return t.id}function we(){const{id:t}=z(),n=t?decodeURIComponent(t):void 0,l=O(o=>o.getActiveVault()),a=Y(n);return l?e.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-5 md:px-6 md:py-8",children:[e.jsx("nav",{className:"mb-4 text-sm text-fg-dim",children:e.jsx(R,{to:n?`/n/${encodeURIComponent(n)}`:"/",className:"hover:text-accent",children:"← Back to note"})}),a.isPending?e.jsx(xe,{}):a.isError?e.jsx(fe,{error:a.error}):a.data?e.jsx(le,{note:a.data}):e.jsx(he,{id:n??""})]}):e.jsx(K,{to:"/",replace:!0})}function S(t){return{content:t.content??"",path:t.path??"",tags:[...t.tags??[]]}}function le({note:t}){const n=W(),l=D(r=>r.push),a=d.useMemo(()=>re(t),[t]),[o,m]=d.useState(()=>S(t)),[s,h]=d.useState(()=>S(t)),[w,p]=d.useState(""),[N,b]=d.useState(null),[i,g]=d.useState(null),[y,L]=d.useState("edit"),v=q(t.id),k=d.useRef(t),E=d.useRef(null),j=Z({noteId:t.id,onInsert:r=>{E.current?E.current.insertAtCursor(r):h(c=>({...c,content:`${c.content}${r}`}))},onLinked:()=>{l("Attachment added","success")},onError:r=>l(r,"error")});d.useEffect(()=>{k.current=t},[t]);const u=s.content!==o.content||s.path!==o.path||!pe(s.tags,o.tags),A=d.useCallback(()=>{if(!u||v.isPending)return;const r={};s.content!==o.content&&(r.content=s.content),s.path!==o.path&&(r.path=s.path);const c=be(o.tags,s.tags);(c.add.length||c.remove.length)&&(r.tags=c);const f=k.current.updatedAt??k.current.createdAt;f&&(r.if_updated_at=f),g(null),b(null),v.mutate(r,{onSuccess:x=>{m(S(x)),h(S(x)),k.current=x,x.id!==t.id&&n(`/n/${encodeURIComponent(x.id)}/edit`,{replace:!0})},onError:x=>{x instanceof H?b(x):x instanceof C?g("Session expired. Reconnect to save."):g(x instanceof Error?x.message:"Save failed")}})},[o,s,u,v,n,t.id]),U=d.useCallback(()=>{u&&confirm("Discard all edits and revert to last saved version?")&&(h(o),b(null),g(null))},[o,u]),P=d.useCallback(()=>{u&&!confirm("Discard unsaved changes?")||n(`/n/${encodeURIComponent(t.id)}`)},[u,n,t.id]);d.useEffect(()=>{if(!u)return;const r=c=>{c.preventDefault(),c.returnValue=""};return window.addEventListener("beforeunload",r),()=>window.removeEventListener("beforeunload",r)},[u]);const $=s.path!==o.path,B=r=>{const c=Q(r);c&&(s.tags.includes(c)||(h(f=>({...f,tags:[...f.tags,c]})),p("")))},F=r=>{h(c=>({...c,tags:c.tags.filter(f=>f!==r)}))},M=s.content;return e.jsxs("article",{children:[e.jsxs("header",{className:"mb-4 border-b border-border pb-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx("span",{className:"text-xs uppercase tracking-wider text-fg-dim",children:"Editing"}),u?e.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-accent","aria-label":"unsaved changes",children:[e.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-accent"}),"unsaved"]}):e.jsxs("span",{className:"text-xs text-fg-dim",children:["saved ",T(t.updatedAt)]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(se,{note:t}),e.jsx(ne,{note:t}),e.jsx("span",{className:"mx-1 h-5 w-px bg-border","aria-hidden":"true"}),e.jsx("button",{type:"button",onClick:U,disabled:!u||v.isPending,className:"min-h-11 rounded-md border border-border bg-card px-3 py-1.5 text-sm text-fg-muted hover:text-accent disabled:opacity-40",children:"Revert"}),e.jsx("button",{type:"button",onClick:P,className:"min-h-11 rounded-md border border-border bg-card px-3 py-1.5 text-sm text-fg-muted hover:text-accent",children:"Cancel"}),e.jsx("button",{type:"button",onClick:A,disabled:!u||v.isPending,className:"min-h-11 rounded-md bg-accent px-4 py-1.5 text-sm font-medium text-white hover:bg-accent-hover disabled:opacity-40",title:"Save (⌘S)",children:v.isPending?"Saving…":"Save"})]})]}),e.jsxs("div",{className:"mt-3 flex flex-col gap-2",children:[e.jsx(J,{tags:s.tags,input:w,onInputChange:p,onAdd:B,onRemove:F}),e.jsxs("label",{className:"flex items-baseline gap-3 text-sm",children:[e.jsx("span",{className:"shrink-0 text-xs uppercase tracking-wider text-fg-dim",children:"Path"}),e.jsx("input",{type:"text",value:s.path,onChange:r=>h(c=>({...c,path:r.target.value})),className:"flex-1 rounded-md border border-border bg-card px-2.5 py-1 font-mono text-sm text-fg focus:border-accent focus:outline-none","aria-label":"Note path",placeholder:"(no path)"})]}),$?e.jsx("p",{className:"text-xs text-accent",children:"Renaming moves the note — its id may change."}):null]})]}),N?e.jsx(ue,{conflict:N,onReload:()=>{window.location.reload()},onDismiss:()=>b(null)}):null,i?e.jsx("div",{className:"mb-4 rounded-md border border-red-500/30 bg-red-500/5 p-3 text-sm text-red-400",children:i}):null,e.jsx("div",{role:"tablist","aria-label":"Editor view",className:"mb-3 inline-flex rounded-md border border-border bg-card p-0.5 text-sm lg:hidden",children:["edit","preview"].map(r=>e.jsx("button",{type:"button",role:"tab","aria-selected":y===r,onClick:()=>L(r),className:`rounded px-3 py-1.5 capitalize ${y===r?"bg-accent text-white":"text-fg-muted hover:text-accent"}`,children:r},r))}),e.jsxs("div",{className:"grid min-h-[60vh] gap-4 lg:grid-cols-2",children:[e.jsx(G,{onDropFiles:j.start,className:`min-w-0 rounded-md border border-border bg-card ${y==="edit"?"":"hidden lg:block"}`,hint:I,children:e.jsx(X,{ref:E,value:s.content,onChange:r=>h(c=>({...c,content:r})),onSave:A,onCancel:P,onPasteFile:r=>(j.start(r),!0)})}),e.jsx("div",{className:`min-w-0 overflow-auto rounded-md border border-border bg-card p-4 ${y==="preview"?"":"hidden lg:block"}`,children:e.jsx(ae,{note:{path:s.path,content:M},resolve:a})})]}),e.jsx(me,{noteId:t.id,attachments:t.attachments??[],uploads:j.uploads,onPickFiles:j.start,onCancel:j.cancel,onDismiss:j.dismiss})]})}const I=e.jsxs(e.Fragment,{children:["Images, audio, webm video."," ",e.jsx("a",{href:"https://github.com/ParachuteComputer/parachute-vault/issues/127",target:"_blank",rel:"noreferrer",className:"underline",children:"PDF + mp4 coming"})]});function me({noteId:t,attachments:n,uploads:l,onPickFiles:a,onCancel:o,onDismiss:m}){return e.jsxs("section",{className:"mt-6 border-t border-border pt-4",children:[e.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[e.jsx("h2",{className:"font-serif text-lg",children:"Attachments"}),e.jsx(ee,{onPickFiles:a})]}),e.jsxs("p",{className:"mb-3 text-xs text-fg-dim",children:["Drop or paste files into the editor. Max 100 MB each. ",I,"."]}),e.jsx(te,{uploads:l,onCancel:o,onDismiss:m}),n.length>0?e.jsx("ul",{className:"mt-3 space-y-1 text-sm",children:n.map(s=>e.jsxs("li",{className:"flex items-center justify-between gap-2 rounded border border-border bg-card/50 px-3 py-1.5 font-mono text-xs",children:[e.jsx("span",{className:"truncate",title:s.path??s.id,children:s.filename??s.path??s.id}),e.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[s.mimeType?e.jsx("span",{className:"text-fg-dim",children:s.mimeType}):null,e.jsx(de,{noteId:t,attachment:s})]})]},s.id))}):null]})}function ue({conflict:t,onReload:n,onDismiss:l}){return e.jsxs("div",{className:"mb-4 rounded-md border border-amber-500/40 bg-amber-500/10 p-4",children:[e.jsx("p",{className:"mb-1 font-medium text-amber-500",children:"This note was edited elsewhere."}),e.jsxs("p",{className:"mb-3 text-sm text-fg-muted",children:["Your save was rejected to avoid overwriting the other edit.",t.currentUpdatedAt?` Latest update ${T(t.currentUpdatedAt)}.`:""]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx("button",{type:"button",onClick:n,className:"rounded-md bg-accent px-3 py-1.5 text-sm font-medium text-white hover:bg-accent-hover",children:"Reload latest (discard my edits)"}),e.jsx("button",{type:"button",onClick:l,className:"rounded-md border border-border px-3 py-1.5 text-sm text-fg-muted hover:text-fg",children:"Keep editing"})]})]})}function xe(){return e.jsxs("div",{className:"grid min-h-[60vh] gap-4 lg:grid-cols-2","aria-busy":"true",children:[e.jsx("div",{className:"animate-pulse rounded-md border border-border bg-card"}),e.jsx("div",{className:"animate-pulse rounded-md border border-border bg-card"})]})}function he({id:t}){return e.jsxs("div",{className:"rounded-md border border-border bg-card p-10 text-center",children:[e.jsx("p",{className:"mb-2 font-serif text-xl",children:"Note not found"}),e.jsxs("p",{className:"mb-4 text-sm text-fg-muted",children:["No note with id ",e.jsx("span",{className:"font-mono",children:t})," in this vault."]}),e.jsx(R,{to:"/",className:"text-sm text-accent hover:underline",children:"Back to all notes"})]})}function fe({error:t}){const n=t instanceof C;return e.jsxs("div",{className:"rounded-md border border-red-500/30 bg-red-500/5 p-6",children:[e.jsx("p",{className:"mb-2 font-medium text-red-400",children:n?"Session expired":"Could not load note"}),e.jsx("p",{className:"mb-4 text-sm text-fg-muted",children:t.message}),n?e.jsx(R,{to:"/add",className:"inline-block rounded-md bg-accent px-4 py-2 text-sm font-medium text-white hover:bg-accent-hover",children:"Reconnect vault"}):null]})}function pe(t,n){if(t.length!==n.length)return!1;const l=new Set(t);for(const a of n)if(!l.has(a))return!1;return!0}function be(t,n){const l=new Set(t),a=new Set(n),o=n.filter(s=>!l.has(s)),m=t.filter(s=>!a.has(s));return{add:o,remove:m}}export{we as NoteEditor};
|
|
1
|
+
import{x as d,r as e,a7 as D,J as V,V as C,g as _,Y as z,aa as O,U as Y,N as K,L as R,Q as W,a8 as q,f as H,z as T,e as J,u as Q}from"./index-BF1NxtUe.js";import{u as Z,A as G,C as X,a as ee,b as te}from"./useAttachmentUploader-Du2IiCzJ.js";import{P as se,D as ne}from"./PinArchiveButtons-BO3QwhOp.js";import{b as re,N as ae}from"./NoteRenderer-CWW2zAJs.js";const oe=250;function de({noteId:t,attachment:n}){const[l,a]=d.useState(!1),o=ce(n);return e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:()=>a(!0),"aria-label":`Remove attachment ${o}`,className:"shrink-0 rounded border border-transparent px-1.5 py-0.5 text-fg-dim hover:border-red-500/40 hover:text-red-400",children:"✕"}),l?e.jsx(ie,{noteId:t,attachment:n,label:o,onClose:()=>a(!1)}):null]})}function ie({noteId:t,attachment:n,label:l,onClose:a}){const o=D(i=>i.push),m=V(),[s,h]=d.useState(!1),[w,p]=d.useState(null),N=d.useRef(null);d.useEffect(()=>{const i=setTimeout(()=>h(!0),oe);return()=>clearTimeout(i)},[]),d.useEffect(()=>{var i;(i=N.current)==null||i.focus()},[]),d.useEffect(()=>{const i=g=>{g.key==="Escape"&&a()};return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[a]);const b=d.useCallback(()=>{!s||m.isPending||(p(null),m.mutate({noteId:t,attachmentId:n.id},{onSuccess:()=>{o(`Removed ${l}`,"success"),a()},onError:i=>{if(i instanceof C){p("Session expired. Reconnect to remove attachments.");return}if(i instanceof _){o(`Already removed ${l}`,"info"),a();return}p(i instanceof Error?i.message:"Remove failed")}}))},[s,n.id,l,m,t,a,o]);return e.jsx("dialog",{open:!0,"aria-labelledby":"confirm-remove-attachment-title",className:"fixed inset-0 z-40 m-0 flex h-full max-h-full w-full max-w-full items-center justify-center bg-black/60 p-4",onMouseDown:i=>{i.target===i.currentTarget&&a()},children:e.jsxs("div",{className:"w-full max-w-md rounded-md border border-border bg-card p-6 shadow-xl",children:[e.jsx("h2",{id:"confirm-remove-attachment-title",className:"mb-2 font-serif text-lg text-red-400",children:"Remove attachment?"}),e.jsxs("p",{className:"mb-3 text-sm text-fg-muted",children:[e.jsx("span",{className:"rounded bg-bg/60 px-1 py-0.5 font-mono text-xs text-fg",children:l})," ","will be detached from this note. If no other note references the file, it will also be deleted from storage. Markdown referencing it will show a broken link until you update it."]}),w?e.jsx("p",{role:"alert",className:"mb-3 text-sm text-red-400",children:w}):null,e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx("button",{ref:N,type:"button",onClick:a,className:"min-h-11 rounded-md border border-border bg-card px-3 py-1.5 text-sm text-fg-muted hover:text-fg",children:"Cancel"}),e.jsx("button",{type:"button",onClick:b,disabled:!s||m.isPending,className:"min-h-11 rounded-md bg-red-500 px-4 py-1.5 text-sm font-medium text-white hover:bg-red-600 disabled:opacity-40",children:m.isPending?"Removing…":"Remove"})]})]})})}function ce(t){if(t.filename)return t.filename;if(t.path){const n=t.path.split("/").pop();return n||t.path}return t.id}function we(){const{id:t}=z(),n=t?decodeURIComponent(t):void 0,l=O(o=>o.getActiveVault()),a=Y(n);return l?e.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-5 md:px-6 md:py-8",children:[e.jsx("nav",{className:"mb-4 text-sm text-fg-dim",children:e.jsx(R,{to:n?`/n/${encodeURIComponent(n)}`:"/",className:"hover:text-accent",children:"← Back to note"})}),a.isPending?e.jsx(xe,{}):a.isError?e.jsx(fe,{error:a.error}):a.data?e.jsx(le,{note:a.data}):e.jsx(he,{id:n??""})]}):e.jsx(K,{to:"/",replace:!0})}function S(t){return{content:t.content??"",path:t.path??"",tags:[...t.tags??[]]}}function le({note:t}){const n=W(),l=D(r=>r.push),a=d.useMemo(()=>re(t),[t]),[o,m]=d.useState(()=>S(t)),[s,h]=d.useState(()=>S(t)),[w,p]=d.useState(""),[N,b]=d.useState(null),[i,g]=d.useState(null),[y,L]=d.useState("edit"),v=q(t.id),k=d.useRef(t),E=d.useRef(null),j=Z({noteId:t.id,onInsert:r=>{E.current?E.current.insertAtCursor(r):h(c=>({...c,content:`${c.content}${r}`}))},onLinked:()=>{l("Attachment added","success")},onError:r=>l(r,"error")});d.useEffect(()=>{k.current=t},[t]);const u=s.content!==o.content||s.path!==o.path||!pe(s.tags,o.tags),A=d.useCallback(()=>{if(!u||v.isPending)return;const r={};s.content!==o.content&&(r.content=s.content),s.path!==o.path&&(r.path=s.path);const c=be(o.tags,s.tags);(c.add.length||c.remove.length)&&(r.tags=c);const f=k.current.updatedAt??k.current.createdAt;f&&(r.if_updated_at=f),g(null),b(null),v.mutate(r,{onSuccess:x=>{m(S(x)),h(S(x)),k.current=x,x.id!==t.id&&n(`/n/${encodeURIComponent(x.id)}/edit`,{replace:!0})},onError:x=>{x instanceof H?b(x):x instanceof C?g("Session expired. Reconnect to save."):g(x instanceof Error?x.message:"Save failed")}})},[o,s,u,v,n,t.id]),U=d.useCallback(()=>{u&&confirm("Discard all edits and revert to last saved version?")&&(h(o),b(null),g(null))},[o,u]),P=d.useCallback(()=>{u&&!confirm("Discard unsaved changes?")||n(`/n/${encodeURIComponent(t.id)}`)},[u,n,t.id]);d.useEffect(()=>{if(!u)return;const r=c=>{c.preventDefault(),c.returnValue=""};return window.addEventListener("beforeunload",r),()=>window.removeEventListener("beforeunload",r)},[u]);const $=s.path!==o.path,B=r=>{const c=Q(r);c&&(s.tags.includes(c)||(h(f=>({...f,tags:[...f.tags,c]})),p("")))},F=r=>{h(c=>({...c,tags:c.tags.filter(f=>f!==r)}))},M=s.content;return e.jsxs("article",{children:[e.jsxs("header",{className:"mb-4 border-b border-border pb-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx("span",{className:"text-xs uppercase tracking-wider text-fg-dim",children:"Editing"}),u?e.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-accent","aria-label":"unsaved changes",children:[e.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-accent"}),"unsaved"]}):e.jsxs("span",{className:"text-xs text-fg-dim",children:["saved ",T(t.updatedAt)]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(se,{note:t}),e.jsx(ne,{note:t}),e.jsx("span",{className:"mx-1 h-5 w-px bg-border","aria-hidden":"true"}),e.jsx("button",{type:"button",onClick:U,disabled:!u||v.isPending,className:"min-h-11 rounded-md border border-border bg-card px-3 py-1.5 text-sm text-fg-muted hover:text-accent disabled:opacity-40",children:"Revert"}),e.jsx("button",{type:"button",onClick:P,className:"min-h-11 rounded-md border border-border bg-card px-3 py-1.5 text-sm text-fg-muted hover:text-accent",children:"Cancel"}),e.jsx("button",{type:"button",onClick:A,disabled:!u||v.isPending,className:"min-h-11 rounded-md bg-accent px-4 py-1.5 text-sm font-medium text-white hover:bg-accent-hover disabled:opacity-40",title:"Save (⌘S)",children:v.isPending?"Saving…":"Save"})]})]}),e.jsxs("div",{className:"mt-3 flex flex-col gap-2",children:[e.jsx(J,{tags:s.tags,input:w,onInputChange:p,onAdd:B,onRemove:F}),e.jsxs("label",{className:"flex items-baseline gap-3 text-sm",children:[e.jsx("span",{className:"shrink-0 text-xs uppercase tracking-wider text-fg-dim",children:"Path"}),e.jsx("input",{type:"text",value:s.path,onChange:r=>h(c=>({...c,path:r.target.value})),className:"flex-1 rounded-md border border-border bg-card px-2.5 py-1 font-mono text-sm text-fg focus:border-accent focus:outline-none","aria-label":"Note path",placeholder:"(no path)"})]}),$?e.jsx("p",{className:"text-xs text-accent",children:"Renaming moves the note — its id may change."}):null]})]}),N?e.jsx(ue,{conflict:N,onReload:()=>{window.location.reload()},onDismiss:()=>b(null)}):null,i?e.jsx("div",{className:"mb-4 rounded-md border border-red-500/30 bg-red-500/5 p-3 text-sm text-red-400",children:i}):null,e.jsx("div",{role:"tablist","aria-label":"Editor view",className:"mb-3 inline-flex rounded-md border border-border bg-card p-0.5 text-sm lg:hidden",children:["edit","preview"].map(r=>e.jsx("button",{type:"button",role:"tab","aria-selected":y===r,onClick:()=>L(r),className:`rounded px-3 py-1.5 capitalize ${y===r?"bg-accent text-white":"text-fg-muted hover:text-accent"}`,children:r},r))}),e.jsxs("div",{className:"grid min-h-[60vh] gap-4 lg:grid-cols-2",children:[e.jsx(G,{onDropFiles:j.start,className:`min-w-0 rounded-md border border-border bg-card ${y==="edit"?"":"hidden lg:block"}`,hint:I,children:e.jsx(X,{ref:E,value:s.content,onChange:r=>h(c=>({...c,content:r})),onSave:A,onCancel:P,onPasteFile:r=>(j.start(r),!0)})}),e.jsx("div",{className:`min-w-0 overflow-auto rounded-md border border-border bg-card p-4 ${y==="preview"?"":"hidden lg:block"}`,children:e.jsx(ae,{note:{path:s.path,content:M},resolve:a})})]}),e.jsx(me,{noteId:t.id,attachments:t.attachments??[],uploads:j.uploads,onPickFiles:j.start,onCancel:j.cancel,onDismiss:j.dismiss})]})}const I=e.jsxs(e.Fragment,{children:["Images, audio, webm video."," ",e.jsx("a",{href:"https://github.com/ParachuteComputer/parachute-vault/issues/127",target:"_blank",rel:"noreferrer",className:"underline",children:"PDF + mp4 coming"})]});function me({noteId:t,attachments:n,uploads:l,onPickFiles:a,onCancel:o,onDismiss:m}){return e.jsxs("section",{className:"mt-6 border-t border-border pt-4",children:[e.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[e.jsx("h2",{className:"font-serif text-lg",children:"Attachments"}),e.jsx(ee,{onPickFiles:a})]}),e.jsxs("p",{className:"mb-3 text-xs text-fg-dim",children:["Drop or paste files into the editor. Max 100 MB each. ",I,"."]}),e.jsx(te,{uploads:l,onCancel:o,onDismiss:m}),n.length>0?e.jsx("ul",{className:"mt-3 space-y-1 text-sm",children:n.map(s=>e.jsxs("li",{className:"flex items-center justify-between gap-2 rounded border border-border bg-card/50 px-3 py-1.5 font-mono text-xs",children:[e.jsx("span",{className:"truncate",title:s.path??s.id,children:s.filename??s.path??s.id}),e.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[s.mimeType?e.jsx("span",{className:"text-fg-dim",children:s.mimeType}):null,e.jsx(de,{noteId:t,attachment:s})]})]},s.id))}):null]})}function ue({conflict:t,onReload:n,onDismiss:l}){return e.jsxs("div",{className:"mb-4 rounded-md border border-amber-500/40 bg-amber-500/10 p-4",children:[e.jsx("p",{className:"mb-1 font-medium text-amber-500",children:"This note was edited elsewhere."}),e.jsxs("p",{className:"mb-3 text-sm text-fg-muted",children:["Your save was rejected to avoid overwriting the other edit.",t.currentUpdatedAt?` Latest update ${T(t.currentUpdatedAt)}.`:""]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx("button",{type:"button",onClick:n,className:"rounded-md bg-accent px-3 py-1.5 text-sm font-medium text-white hover:bg-accent-hover",children:"Reload latest (discard my edits)"}),e.jsx("button",{type:"button",onClick:l,className:"rounded-md border border-border px-3 py-1.5 text-sm text-fg-muted hover:text-fg",children:"Keep editing"})]})]})}function xe(){return e.jsxs("div",{className:"grid min-h-[60vh] gap-4 lg:grid-cols-2","aria-busy":"true",children:[e.jsx("div",{className:"animate-pulse rounded-md border border-border bg-card"}),e.jsx("div",{className:"animate-pulse rounded-md border border-border bg-card"})]})}function he({id:t}){return e.jsxs("div",{className:"rounded-md border border-border bg-card p-10 text-center",children:[e.jsx("p",{className:"mb-2 font-serif text-xl",children:"Note not found"}),e.jsxs("p",{className:"mb-4 text-sm text-fg-muted",children:["No note with id ",e.jsx("span",{className:"font-mono",children:t})," in this vault."]}),e.jsx(R,{to:"/",className:"text-sm text-accent hover:underline",children:"Back to all notes"})]})}function fe({error:t}){const n=t instanceof C;return e.jsxs("div",{className:"rounded-md border border-red-500/30 bg-red-500/5 p-6",children:[e.jsx("p",{className:"mb-2 font-medium text-red-400",children:n?"Session expired":"Could not load note"}),e.jsx("p",{className:"mb-4 text-sm text-fg-muted",children:t.message}),n?e.jsx(R,{to:"/add",className:"inline-block rounded-md bg-accent px-4 py-2 text-sm font-medium text-white hover:bg-accent-hover",children:"Reconnect vault"}):null]})}function pe(t,n){if(t.length!==n.length)return!1;const l=new Set(t);for(const a of n)if(!l.has(a))return!1;return!0}function be(t,n){const l=new Set(t),a=new Set(n),o=n.filter(s=>!l.has(s)),m=t.filter(s=>!a.has(s));return{add:o,remove:m}}export{we as NoteEditor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aa as P,Q as T,a7 as I,H as R,M as L,x as n,r as e,N as V,V as $,L as F,e as M,u as _}from"./index-
|
|
1
|
+
import{aa as P,Q as T,a7 as I,H as R,M as L,x as n,r as e,N as V,V as $,L as F,e as M,u as _}from"./index-BF1NxtUe.js";import{u as U,A as B,C as z,a as H,b as O}from"./useAttachmentUploader-Du2IiCzJ.js";import{b as Q,N as W}from"./NoteRenderer-CWW2zAJs.js";const Y={content:"",path:"",tags:[],summary:""};function J(){const w=P(t=>t.getActiveVault()),l=T(),d=I(t=>t.push),c=R(),f=L(),[a,o]=n.useState(Y),[C,b]=n.useState(""),[v,x]=n.useState(null),[m,k]=n.useState([]),p=n.useRef(null),i=U({noteId:null,onInsert:t=>{p.current?p.current.insertAtCursor(t):o(s=>({...s,content:`${s.content}${t}`}))},onStaged:t=>k(s=>[...s,t]),onError:t=>d(t,"error")});if(!w)return e.jsx(V,{to:"/",replace:!0});const u=a.content.length>0||a.path.length>0||a.tags.length>0||a.summary.length>0,h=a.content.trim().length>0&&a.path.trim().length>0,j=n.useCallback(()=>{if(!h||c.isPending)return;const t={content:a.content,path:a.path.trim()};a.tags.length&&(t.tags=a.tags);const s=a.summary.trim();s&&(t.metadata={summary:s}),x(null),c.mutate(t,{onSuccess:async r=>{for(const g of m)try{await f.mutateAsync({noteId:r.id,path:g.path,mimeType:g.mimeType})}catch(y){const D=y instanceof Error?y.message:"Link failed";d(`Failed to attach ${g.filename}: ${D}`,"error")}d(`Created ${r.path??r.id}`,"success"),l(`/n/${encodeURIComponent(r.id)}`)},onError:r=>{r instanceof $?x("Session expired. Reconnect to save."):x(r instanceof Error?`${r.message} — if the path is taken, try a different one.`:"Create failed")}})},[a,h,f,c,l,d,m]),N=n.useCallback(()=>{u&&!confirm("Discard this draft?")||l("/")},[u,l]);n.useEffect(()=>{if(!u)return;const t=s=>{s.preventDefault(),s.returnValue=""};return window.addEventListener("beforeunload",t),()=>window.removeEventListener("beforeunload",t)},[u]);const A=t=>{const s=_(t);!s||a.tags.includes(s)||(o(r=>({...r,tags:[...r.tags,s]})),b(""))},E=t=>{o(s=>({...s,tags:s.tags.filter(r=>r!==t)}))},S=Q({id:"__new__",createdAt:new Date().toISOString()});return e.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-5 md:px-6 md:py-8",children:[e.jsx("nav",{className:"mb-4 text-sm text-fg-dim",children:e.jsx(F,{to:"/",className:"hover:text-accent",children:"← All notes"})}),e.jsxs("article",{children:[e.jsxs("header",{className:"mb-4 border-b border-border pb-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsx("div",{className:"flex items-center gap-2 text-sm",children:e.jsx("span",{className:"text-xs uppercase tracking-wider text-fg-dim",children:"New note"})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{type:"button",onClick:N,className:"min-h-11 rounded-md border border-border bg-card px-3 py-1.5 text-sm text-fg-muted hover:text-accent",children:"Cancel"}),e.jsx("button",{type:"button",onClick:j,disabled:!h||c.isPending,className:"min-h-11 rounded-md bg-accent px-4 py-1.5 text-sm font-medium text-white hover:bg-accent-hover disabled:opacity-40",title:"Create (⌘S)",children:c.isPending?"Creating…":"Create"})]})]}),e.jsxs("div",{className:"mt-3 flex flex-col gap-2",children:[e.jsxs("label",{className:"flex items-baseline gap-3 text-sm",children:[e.jsx("span",{className:"shrink-0 text-xs uppercase tracking-wider text-fg-dim",children:"Path"}),e.jsx("input",{type:"text",value:a.path,onChange:t=>o(s=>({...s,path:t.target.value})),className:"flex-1 rounded-md border border-border bg-card px-2.5 py-1 font-mono text-sm text-fg focus:border-accent focus:outline-none","aria-label":"Note path",placeholder:"e.g. Projects/README"})]}),e.jsxs("label",{className:"flex items-baseline gap-3 text-sm",children:[e.jsx("span",{className:"shrink-0 text-xs uppercase tracking-wider text-fg-dim",children:"Summary"}),e.jsx("input",{type:"text",value:a.summary,onChange:t=>o(s=>({...s,summary:t.target.value})),className:"flex-1 rounded-md border border-border bg-card px-2.5 py-1 text-sm text-fg focus:border-accent focus:outline-none","aria-label":"Note summary",placeholder:"(optional one-line description)"})]}),e.jsx(M,{tags:a.tags,input:C,onInputChange:b,onAdd:A,onRemove:E})]})]}),v?e.jsx("div",{role:"alert",className:"mb-4 rounded-md border border-red-500/30 bg-red-500/5 p-3 text-sm text-red-400",children:v}):null,e.jsxs("div",{className:"grid min-h-[60vh] gap-4 lg:grid-cols-2",children:[e.jsx(B,{onDropFiles:i.start,className:"min-w-0 rounded-md border border-border bg-card",hint:"Images, audio, webm video",children:e.jsx(z,{ref:p,value:a.content,onChange:t=>o(s=>({...s,content:t})),onSave:j,onCancel:N,onPasteFile:t=>(i.start(t),!0)})}),e.jsx("div",{className:"min-w-0 overflow-auto rounded-md border border-border bg-card p-4",children:a.content.trim()?e.jsx(W,{note:{path:a.path,content:a.content},resolve:S}):e.jsx("p",{className:"text-sm text-fg-dim",children:"Preview appears here as you type."})})]}),e.jsxs("section",{className:"mt-6 border-t border-border pt-4",children:[e.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[e.jsx("h2",{className:"font-serif text-lg",children:"Attachments"}),e.jsx(H,{onPickFiles:i.start})]}),e.jsxs("p",{className:"mb-3 text-xs text-fg-dim",children:["Drop or paste files into the editor. Attachments link to the note when you save. Max 100 MB each. Images, audio, webm video."," ",e.jsx("a",{href:"https://github.com/ParachuteComputer/parachute-vault/issues/127",target:"_blank",rel:"noreferrer",className:"underline",children:"PDF + mp4 coming"}),"."]}),e.jsx(O,{uploads:i.uploads,onCancel:i.cancel,onDismiss:i.dismiss}),m.length>0?e.jsx("ul",{className:"mt-3 space-y-1 text-sm",children:m.map(t=>e.jsxs("li",{className:"flex items-center justify-between gap-2 rounded border border-border bg-card/50 px-3 py-1.5 font-mono text-xs text-fg-muted",children:[e.jsx("span",{className:"truncate",children:t.filename}),e.jsx("span",{className:"shrink-0 text-fg-dim",children:"staged"})]},t.path))}):null]})]})]})}export{J as NoteNew};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{p as fr,r as ne,E as jo,x as Cn,L as Wr}from"./index-BDPMEkxL.js";const Qo=/\[\[([^\]|]+)(?:\|([^\]]+))?\]\]/g;function Jo(e,n){var i,o;const t=[];let r=0;for(const a of e.matchAll(Qo)){const s=a.index??0;s>r&&t.push({type:"text",value:e.slice(r,s)});const l=((i=a[1])==null?void 0:i.trim())??"",c=(((o=a[2])==null?void 0:o.trim())||l).trim(),u=n(l),d=u?`/n/${encodeURIComponent(u.id)}`:`/n/${encodeURIComponent(l)}`;t.push({type:"link",url:d,title:null,children:[{type:"text",value:c}],data:{hProperties:{className:u?"wikilink wikilink-resolved":"wikilink wikilink-unresolved","data-wikilink-target":l,"data-wikilink-resolved":u?"true":"false"}}}),r=s+a[0].length}return r===0?[{type:"text",value:e}]:(r<e.length&&t.push({type:"text",value:e.slice(r)}),t)}function Xi(e,n){const t=[];for(const r of e.children){if(r.type==="text"){const i=Jo(r.value,n);t.push(...i);continue}if(r.type==="code"||r.type==="inlineCode"){t.push(r);continue}"children"in r&&Array.isArray(r.children)&&Xi(r,n),t.push(r)}e.children=t}const es=({resolve:e})=>n=>{Xi(n,e)};function ns(e,n){const t={};return(e[e.length-1]===""?[...e,""]:e).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const ts=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,rs=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,is={};function Vr(e,n){return(is.jsx?rs:ts).test(e)}const as=/[ \t\n\f\r]/g;function os(e){return typeof e=="object"?e.type==="text"?Yr(e.value):!1:Yr(e)}function Yr(e){return e.replace(as,"")===""}class Zn{constructor(n,t,r){this.normal=t,this.property=n,r&&(this.space=r)}}Zn.prototype.normal={};Zn.prototype.property={};Zn.prototype.space=void 0;function ji(e,n){const t={},r={};for(const i of e)Object.assign(t,i.property),Object.assign(r,i.normal);return new Zn(t,r,n)}function nr(e){return e.toLowerCase()}class Le{constructor(n,t){this.attribute=t,this.property=n}}Le.prototype.attribute="";Le.prototype.booleanish=!1;Le.prototype.boolean=!1;Le.prototype.commaOrSpaceSeparated=!1;Le.prototype.commaSeparated=!1;Le.prototype.defined=!1;Le.prototype.mustUseProperty=!1;Le.prototype.number=!1;Le.prototype.overloadedBoolean=!1;Le.prototype.property="";Le.prototype.spaceSeparated=!1;Le.prototype.space=void 0;let ss=0;const J=_n(),xe=_n(),tr=_n(),A=_n(),be=_n(),On=_n(),Ue=_n();function _n(){return 2**++ss}const rr=Object.freeze(Object.defineProperty({__proto__:null,boolean:J,booleanish:xe,commaOrSpaceSeparated:Ue,commaSeparated:On,number:A,overloadedBoolean:tr,spaceSeparated:be},Symbol.toStringTag,{value:"Module"})),Dt=Object.keys(rr);class gr extends Le{constructor(n,t,r,i){let o=-1;if(super(n,t),Zr(this,"space",i),typeof r=="number")for(;++o<Dt.length;){const a=Dt[o];Zr(this,Dt[o],(r&rr[a])===rr[a])}}}gr.prototype.defined=!0;function Zr(e,n,t){t&&(e[n]=t)}function Rn(e){const n={},t={};for(const[r,i]of Object.entries(e.properties)){const o=new gr(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),n[r]=o,t[nr(r)]=r,t[nr(o.attribute)]=r}return new Zn(n,t,e.space)}const Qi=Rn({properties:{ariaActiveDescendant:null,ariaAtomic:xe,ariaAutoComplete:null,ariaBusy:xe,ariaChecked:xe,ariaColCount:A,ariaColIndex:A,ariaColSpan:A,ariaControls:be,ariaCurrent:null,ariaDescribedBy:be,ariaDetails:null,ariaDisabled:xe,ariaDropEffect:be,ariaErrorMessage:null,ariaExpanded:xe,ariaFlowTo:be,ariaGrabbed:xe,ariaHasPopup:null,ariaHidden:xe,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:be,ariaLevel:A,ariaLive:null,ariaModal:xe,ariaMultiLine:xe,ariaMultiSelectable:xe,ariaOrientation:null,ariaOwns:be,ariaPlaceholder:null,ariaPosInSet:A,ariaPressed:xe,ariaReadOnly:xe,ariaRelevant:null,ariaRequired:xe,ariaRoleDescription:be,ariaRowCount:A,ariaRowIndex:A,ariaRowSpan:A,ariaSelected:xe,ariaSetSize:A,ariaSort:null,ariaValueMax:A,ariaValueMin:A,ariaValueNow:A,ariaValueText:null,role:null},transform(e,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()}});function Ji(e,n){return n in e?e[n]:n}function ea(e,n){return Ji(e,n.toLowerCase())}const ls=Rn({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:On,acceptCharset:be,accessKey:be,action:null,allow:null,allowFullScreen:J,allowPaymentRequest:J,allowUserMedia:J,alt:null,as:null,async:J,autoCapitalize:null,autoComplete:be,autoFocus:J,autoPlay:J,blocking:be,capture:null,charSet:null,checked:J,cite:null,className:be,cols:A,colSpan:null,content:null,contentEditable:xe,controls:J,controlsList:be,coords:A|On,crossOrigin:null,data:null,dateTime:null,decoding:null,default:J,defer:J,dir:null,dirName:null,disabled:J,download:tr,draggable:xe,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:J,formTarget:null,headers:be,height:A,hidden:tr,high:A,href:null,hrefLang:null,htmlFor:be,httpEquiv:be,id:null,imageSizes:null,imageSrcSet:null,inert:J,inputMode:null,integrity:null,is:null,isMap:J,itemId:null,itemProp:be,itemRef:be,itemScope:J,itemType:be,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:J,low:A,manifest:null,max:null,maxLength:A,media:null,method:null,min:null,minLength:A,multiple:J,muted:J,name:null,nonce:null,noModule:J,noValidate:J,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:J,optimum:A,pattern:null,ping:be,placeholder:null,playsInline:J,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:J,referrerPolicy:null,rel:be,required:J,reversed:J,rows:A,rowSpan:A,sandbox:be,scope:null,scoped:J,seamless:J,selected:J,shadowRootClonable:J,shadowRootDelegatesFocus:J,shadowRootMode:null,shape:null,size:A,sizes:null,slot:null,span:A,spellCheck:xe,src:null,srcDoc:null,srcLang:null,srcSet:null,start:A,step:null,style:null,tabIndex:A,target:null,title:null,translate:null,type:null,typeMustMatch:J,useMap:null,value:xe,width:A,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:be,axis:null,background:null,bgColor:null,border:A,borderColor:null,bottomMargin:A,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:J,declare:J,event:null,face:null,frame:null,frameBorder:null,hSpace:A,leftMargin:A,link:null,longDesc:null,lowSrc:null,marginHeight:A,marginWidth:A,noResize:J,noHref:J,noShade:J,noWrap:J,object:null,profile:null,prompt:null,rev:null,rightMargin:A,rules:null,scheme:null,scrolling:xe,standby:null,summary:null,text:null,topMargin:A,valueType:null,version:null,vAlign:null,vLink:null,vSpace:A,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:J,disableRemotePlayback:J,prefix:null,property:null,results:A,security:null,unselectable:null},space:"html",transform:ea}),cs=Rn({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Ue,accentHeight:A,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:A,amplitude:A,arabicForm:null,ascent:A,attributeName:null,attributeType:null,azimuth:A,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:A,by:null,calcMode:null,capHeight:A,className:be,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:A,diffuseConstant:A,direction:null,display:null,dur:null,divisor:A,dominantBaseline:null,download:J,dx:null,dy:null,edgeMode:null,editable:null,elevation:A,enableBackground:null,end:null,event:null,exponent:A,externalResourcesRequired:null,fill:null,fillOpacity:A,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:On,g2:On,glyphName:On,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:A,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:A,horizOriginX:A,horizOriginY:A,id:null,ideographic:A,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:A,k:A,k1:A,k2:A,k3:A,k4:A,kernelMatrix:Ue,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:A,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:A,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:A,overlineThickness:A,paintOrder:null,panose1:null,path:null,pathLength:A,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:be,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:A,pointsAtY:A,pointsAtZ:A,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ue,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ue,rev:Ue,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ue,requiredFeatures:Ue,requiredFonts:Ue,requiredFormats:Ue,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:A,specularExponent:A,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:A,strikethroughThickness:A,string:null,stroke:null,strokeDashArray:Ue,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:A,strokeOpacity:A,strokeWidth:null,style:null,surfaceScale:A,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ue,tabIndex:A,tableValues:null,target:null,targetX:A,targetY:A,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ue,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:A,underlineThickness:A,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:A,values:null,vAlphabetic:A,vMathematical:A,vectorEffect:null,vHanging:A,vIdeographic:A,version:null,vertAdvY:A,vertOriginX:A,vertOriginY:A,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:A,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Ji}),na=Rn({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,n){return"xlink:"+n.slice(5).toLowerCase()}}),ta=Rn({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:ea}),ra=Rn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),us={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},ds=/[A-Z]/g,Xr=/-[a-z]/g,ps=/^data[-\w.:]+$/i;function fs(e,n){const t=nr(n);let r=n,i=Le;if(t in e.normal)return e.property[e.normal[t]];if(t.length>4&&t.slice(0,4)==="data"&&ps.test(n)){if(n.charAt(4)==="-"){const o=n.slice(5).replace(Xr,hs);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=n.slice(4);if(!Xr.test(o)){let a=o.replace(ds,gs);a.charAt(0)!=="-"&&(a="-"+a),n="data"+a}}i=gr}return new i(r,n)}function gs(e){return"-"+e.toLowerCase()}function hs(e){return e.charAt(1).toUpperCase()}const ms=ji([Qi,ls,na,ta,ra],"html"),hr=ji([Qi,cs,na,ta,ra],"svg");function bs(e){return e.join(" ").trim()}var Sn={},Pt,jr;function Es(){if(jr)return Pt;jr=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,t=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,s=/^\s+|\s+$/g,l=`
|
|
1
|
+
import{p as fr,r as ne,E as jo,x as Cn,L as Wr}from"./index-BF1NxtUe.js";const Qo=/\[\[([^\]|]+)(?:\|([^\]]+))?\]\]/g;function Jo(e,n){var i,o;const t=[];let r=0;for(const a of e.matchAll(Qo)){const s=a.index??0;s>r&&t.push({type:"text",value:e.slice(r,s)});const l=((i=a[1])==null?void 0:i.trim())??"",c=(((o=a[2])==null?void 0:o.trim())||l).trim(),u=n(l),d=u?`/n/${encodeURIComponent(u.id)}`:`/n/${encodeURIComponent(l)}`;t.push({type:"link",url:d,title:null,children:[{type:"text",value:c}],data:{hProperties:{className:u?"wikilink wikilink-resolved":"wikilink wikilink-unresolved","data-wikilink-target":l,"data-wikilink-resolved":u?"true":"false"}}}),r=s+a[0].length}return r===0?[{type:"text",value:e}]:(r<e.length&&t.push({type:"text",value:e.slice(r)}),t)}function Xi(e,n){const t=[];for(const r of e.children){if(r.type==="text"){const i=Jo(r.value,n);t.push(...i);continue}if(r.type==="code"||r.type==="inlineCode"){t.push(r);continue}"children"in r&&Array.isArray(r.children)&&Xi(r,n),t.push(r)}e.children=t}const es=({resolve:e})=>n=>{Xi(n,e)};function ns(e,n){const t={};return(e[e.length-1]===""?[...e,""]:e).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const ts=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,rs=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,is={};function Vr(e,n){return(is.jsx?rs:ts).test(e)}const as=/[ \t\n\f\r]/g;function os(e){return typeof e=="object"?e.type==="text"?Yr(e.value):!1:Yr(e)}function Yr(e){return e.replace(as,"")===""}class Zn{constructor(n,t,r){this.normal=t,this.property=n,r&&(this.space=r)}}Zn.prototype.normal={};Zn.prototype.property={};Zn.prototype.space=void 0;function ji(e,n){const t={},r={};for(const i of e)Object.assign(t,i.property),Object.assign(r,i.normal);return new Zn(t,r,n)}function nr(e){return e.toLowerCase()}class Le{constructor(n,t){this.attribute=t,this.property=n}}Le.prototype.attribute="";Le.prototype.booleanish=!1;Le.prototype.boolean=!1;Le.prototype.commaOrSpaceSeparated=!1;Le.prototype.commaSeparated=!1;Le.prototype.defined=!1;Le.prototype.mustUseProperty=!1;Le.prototype.number=!1;Le.prototype.overloadedBoolean=!1;Le.prototype.property="";Le.prototype.spaceSeparated=!1;Le.prototype.space=void 0;let ss=0;const J=_n(),xe=_n(),tr=_n(),A=_n(),be=_n(),On=_n(),Ue=_n();function _n(){return 2**++ss}const rr=Object.freeze(Object.defineProperty({__proto__:null,boolean:J,booleanish:xe,commaOrSpaceSeparated:Ue,commaSeparated:On,number:A,overloadedBoolean:tr,spaceSeparated:be},Symbol.toStringTag,{value:"Module"})),Dt=Object.keys(rr);class gr extends Le{constructor(n,t,r,i){let o=-1;if(super(n,t),Zr(this,"space",i),typeof r=="number")for(;++o<Dt.length;){const a=Dt[o];Zr(this,Dt[o],(r&rr[a])===rr[a])}}}gr.prototype.defined=!0;function Zr(e,n,t){t&&(e[n]=t)}function Rn(e){const n={},t={};for(const[r,i]of Object.entries(e.properties)){const o=new gr(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),n[r]=o,t[nr(r)]=r,t[nr(o.attribute)]=r}return new Zn(n,t,e.space)}const Qi=Rn({properties:{ariaActiveDescendant:null,ariaAtomic:xe,ariaAutoComplete:null,ariaBusy:xe,ariaChecked:xe,ariaColCount:A,ariaColIndex:A,ariaColSpan:A,ariaControls:be,ariaCurrent:null,ariaDescribedBy:be,ariaDetails:null,ariaDisabled:xe,ariaDropEffect:be,ariaErrorMessage:null,ariaExpanded:xe,ariaFlowTo:be,ariaGrabbed:xe,ariaHasPopup:null,ariaHidden:xe,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:be,ariaLevel:A,ariaLive:null,ariaModal:xe,ariaMultiLine:xe,ariaMultiSelectable:xe,ariaOrientation:null,ariaOwns:be,ariaPlaceholder:null,ariaPosInSet:A,ariaPressed:xe,ariaReadOnly:xe,ariaRelevant:null,ariaRequired:xe,ariaRoleDescription:be,ariaRowCount:A,ariaRowIndex:A,ariaRowSpan:A,ariaSelected:xe,ariaSetSize:A,ariaSort:null,ariaValueMax:A,ariaValueMin:A,ariaValueNow:A,ariaValueText:null,role:null},transform(e,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()}});function Ji(e,n){return n in e?e[n]:n}function ea(e,n){return Ji(e,n.toLowerCase())}const ls=Rn({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:On,acceptCharset:be,accessKey:be,action:null,allow:null,allowFullScreen:J,allowPaymentRequest:J,allowUserMedia:J,alt:null,as:null,async:J,autoCapitalize:null,autoComplete:be,autoFocus:J,autoPlay:J,blocking:be,capture:null,charSet:null,checked:J,cite:null,className:be,cols:A,colSpan:null,content:null,contentEditable:xe,controls:J,controlsList:be,coords:A|On,crossOrigin:null,data:null,dateTime:null,decoding:null,default:J,defer:J,dir:null,dirName:null,disabled:J,download:tr,draggable:xe,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:J,formTarget:null,headers:be,height:A,hidden:tr,high:A,href:null,hrefLang:null,htmlFor:be,httpEquiv:be,id:null,imageSizes:null,imageSrcSet:null,inert:J,inputMode:null,integrity:null,is:null,isMap:J,itemId:null,itemProp:be,itemRef:be,itemScope:J,itemType:be,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:J,low:A,manifest:null,max:null,maxLength:A,media:null,method:null,min:null,minLength:A,multiple:J,muted:J,name:null,nonce:null,noModule:J,noValidate:J,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:J,optimum:A,pattern:null,ping:be,placeholder:null,playsInline:J,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:J,referrerPolicy:null,rel:be,required:J,reversed:J,rows:A,rowSpan:A,sandbox:be,scope:null,scoped:J,seamless:J,selected:J,shadowRootClonable:J,shadowRootDelegatesFocus:J,shadowRootMode:null,shape:null,size:A,sizes:null,slot:null,span:A,spellCheck:xe,src:null,srcDoc:null,srcLang:null,srcSet:null,start:A,step:null,style:null,tabIndex:A,target:null,title:null,translate:null,type:null,typeMustMatch:J,useMap:null,value:xe,width:A,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:be,axis:null,background:null,bgColor:null,border:A,borderColor:null,bottomMargin:A,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:J,declare:J,event:null,face:null,frame:null,frameBorder:null,hSpace:A,leftMargin:A,link:null,longDesc:null,lowSrc:null,marginHeight:A,marginWidth:A,noResize:J,noHref:J,noShade:J,noWrap:J,object:null,profile:null,prompt:null,rev:null,rightMargin:A,rules:null,scheme:null,scrolling:xe,standby:null,summary:null,text:null,topMargin:A,valueType:null,version:null,vAlign:null,vLink:null,vSpace:A,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:J,disableRemotePlayback:J,prefix:null,property:null,results:A,security:null,unselectable:null},space:"html",transform:ea}),cs=Rn({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Ue,accentHeight:A,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:A,amplitude:A,arabicForm:null,ascent:A,attributeName:null,attributeType:null,azimuth:A,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:A,by:null,calcMode:null,capHeight:A,className:be,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:A,diffuseConstant:A,direction:null,display:null,dur:null,divisor:A,dominantBaseline:null,download:J,dx:null,dy:null,edgeMode:null,editable:null,elevation:A,enableBackground:null,end:null,event:null,exponent:A,externalResourcesRequired:null,fill:null,fillOpacity:A,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:On,g2:On,glyphName:On,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:A,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:A,horizOriginX:A,horizOriginY:A,id:null,ideographic:A,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:A,k:A,k1:A,k2:A,k3:A,k4:A,kernelMatrix:Ue,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:A,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:A,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:A,overlineThickness:A,paintOrder:null,panose1:null,path:null,pathLength:A,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:be,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:A,pointsAtY:A,pointsAtZ:A,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ue,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ue,rev:Ue,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ue,requiredFeatures:Ue,requiredFonts:Ue,requiredFormats:Ue,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:A,specularExponent:A,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:A,strikethroughThickness:A,string:null,stroke:null,strokeDashArray:Ue,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:A,strokeOpacity:A,strokeWidth:null,style:null,surfaceScale:A,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ue,tabIndex:A,tableValues:null,target:null,targetX:A,targetY:A,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ue,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:A,underlineThickness:A,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:A,values:null,vAlphabetic:A,vMathematical:A,vectorEffect:null,vHanging:A,vIdeographic:A,version:null,vertAdvY:A,vertOriginX:A,vertOriginY:A,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:A,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Ji}),na=Rn({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,n){return"xlink:"+n.slice(5).toLowerCase()}}),ta=Rn({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:ea}),ra=Rn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),us={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},ds=/[A-Z]/g,Xr=/-[a-z]/g,ps=/^data[-\w.:]+$/i;function fs(e,n){const t=nr(n);let r=n,i=Le;if(t in e.normal)return e.property[e.normal[t]];if(t.length>4&&t.slice(0,4)==="data"&&ps.test(n)){if(n.charAt(4)==="-"){const o=n.slice(5).replace(Xr,hs);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=n.slice(4);if(!Xr.test(o)){let a=o.replace(ds,gs);a.charAt(0)!=="-"&&(a="-"+a),n="data"+a}}i=gr}return new i(r,n)}function gs(e){return"-"+e.toLowerCase()}function hs(e){return e.charAt(1).toUpperCase()}const ms=ji([Qi,ls,na,ta,ra],"html"),hr=ji([Qi,cs,na,ta,ra],"svg");function bs(e){return e.join(" ").trim()}var Sn={},Pt,jr;function Es(){if(jr)return Pt;jr=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,t=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,s=/^\s+|\s+$/g,l=`
|
|
2
2
|
`,c="/",u="*",d="",f="comment",p="declaration";function g(y,E){if(typeof y!="string")throw new TypeError("First argument must be a string");if(!y)return[];E=E||{};var N=1,w=1;function O(L){var v=L.match(n);v&&(N+=v.length);var Y=L.lastIndexOf(l);w=~Y?L.length-Y:w+L.length}function R(){var L={line:N,column:w};return function(v){return v.position=new k(L),H(),v}}function k(L){this.start=L,this.end={line:N,column:w},this.source=E.source}k.prototype.content=y;function U(L){var v=new Error(E.source+":"+N+":"+w+": "+L);if(v.reason=L,v.filename=E.source,v.line=N,v.column=w,v.source=y,!E.silent)throw v}function $(L){var v=L.exec(y);if(v){var Y=v[0];return O(Y),y=y.slice(Y.length),v}}function H(){$(t)}function x(L){var v;for(L=L||[];v=P();)v!==!1&&L.push(v);return L}function P(){var L=R();if(!(c!=y.charAt(0)||u!=y.charAt(1))){for(var v=2;d!=y.charAt(v)&&(u!=y.charAt(v)||c!=y.charAt(v+1));)++v;if(v+=2,d===y.charAt(v-1))return U("End of comment missing");var Y=y.slice(2,v-2);return w+=2,O(Y),y=y.slice(v),w+=2,L({type:f,comment:Y})}}function B(){var L=R(),v=$(r);if(v){if(P(),!$(i))return U("property missing ':'");var Y=$(o),se=L({type:p,property:_(v[0].replace(e,d)),value:Y?_(Y[0].replace(e,d)):d});return $(a),se}}function Q(){var L=[];x(L);for(var v;v=B();)v!==!1&&(L.push(v),x(L));return L}return H(),Q()}function _(y){return y?y.replace(s,d):d}return Pt=g,Pt}var Qr;function _s(){if(Qr)return Sn;Qr=1;var e=Sn&&Sn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Sn,"__esModule",{value:!0}),Sn.default=t;const n=e(Es());function t(r,i){let o=null;if(!r||typeof r!="string")return o;const a=(0,n.default)(r),s=typeof i=="function";return a.forEach(l=>{if(l.type!=="declaration")return;const{property:c,value:u}=l;s?i(c,u,l):u&&(o=o||{},o[c]=u)}),o}return Sn}var zn={},Jr;function ys(){if(Jr)return zn;Jr=1,Object.defineProperty(zn,"__esModule",{value:!0}),zn.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,t=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,o=function(c){return!c||t.test(c)||e.test(c)},a=function(c,u){return u.toUpperCase()},s=function(c,u){return"".concat(u,"-")},l=function(c,u){return u===void 0&&(u={}),o(c)?c:(c=c.toLowerCase(),u.reactCompat?c=c.replace(i,s):c=c.replace(r,s),c.replace(n,a))};return zn.camelCase=l,zn}var Un,ei;function ks(){if(ei)return Un;ei=1;var e=Un&&Un.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},n=e(_s()),t=ys();function r(i,o){var a={};return!i||typeof i!="string"||(0,n.default)(i,function(s,l){s&&l&&(a[(0,t.camelCase)(s,o)]=l)}),a}return r.default=r,Un=r,Un}var xs=ks();const ws=fr(xs),ia=aa("end"),mr=aa("start");function aa(e){return n;function n(t){const r=t&&t.position&&t.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Ss(e){const n=mr(e),t=ia(e);if(n&&t)return{start:n,end:t}}function Kn(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?ni(e.position):"start"in e||"end"in e?ni(e):"line"in e||"column"in e?ir(e):""}function ir(e){return ti(e&&e.line)+":"+ti(e&&e.column)}function ni(e){return ir(e&&e.start)+"-"+ir(e&&e.end)}function ti(e){return e&&typeof e=="number"?e:1}class ve extends Error{constructor(n,t,r){super(),typeof t=="string"&&(r=t,t=void 0);let i="",o={},a=!1;if(t&&("line"in t&&"column"in t?o={place:t}:"start"in t&&"end"in t?o={place:t}:"type"in t?o={ancestors:[t],place:t.position}:o={...t}),typeof n=="string"?i=n:!o.cause&&n&&(a=!0,i=n.message,o.cause=n),!o.ruleId&&!o.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?o.ruleId=r:(o.source=r.slice(0,l),o.ruleId=r.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){const l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}const s=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=s?s.line:void 0,this.name=Kn(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=a&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}ve.prototype.file="";ve.prototype.name="";ve.prototype.reason="";ve.prototype.message="";ve.prototype.stack="";ve.prototype.column=void 0;ve.prototype.line=void 0;ve.prototype.ancestors=void 0;ve.prototype.cause=void 0;ve.prototype.fatal=void 0;ve.prototype.place=void 0;ve.prototype.ruleId=void 0;ve.prototype.source=void 0;const br={}.hasOwnProperty,Ns=new Map,Ts=/[A-Z]/g,As=new Set(["table","tbody","thead","tfoot","tr"]),vs=new Set(["td","th"]),oa="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Cs(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const t=n.filePath||void 0;let r;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Bs(t,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Ps(t,n.jsx,n.jsxs)}const i={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:r,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:t,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?hr:ms,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},o=sa(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function sa(e,n,t){if(n.type==="element")return Os(e,n,t);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return Is(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return Ms(e,n,t);if(n.type==="mdxjsEsm")return Rs(e,n);if(n.type==="root")return Ls(e,n,t);if(n.type==="text")return Ds(e,n)}function Os(e,n,t){const r=e.schema;let i=r;n.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=hr,e.schema=i),e.ancestors.push(n);const o=ca(e,n.tagName,!1),a=Fs(e,n);let s=_r(e,n);return As.has(n.tagName)&&(s=s.filter(function(l){return typeof l=="string"?!os(l):!0})),la(e,a,o,n),Er(a,s),e.ancestors.pop(),e.schema=r,e.create(n,o,a,t)}function Is(e,n){if(n.data&&n.data.estree&&e.evaluater){const r=n.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Vn(e,n.position)}function Rs(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);Vn(e,n.position)}function Ms(e,n,t){const r=e.schema;let i=r;n.name==="svg"&&r.space==="html"&&(i=hr,e.schema=i),e.ancestors.push(n);const o=n.name===null?e.Fragment:ca(e,n.name,!0),a=zs(e,n),s=_r(e,n);return la(e,a,o,n),Er(a,s),e.ancestors.pop(),e.schema=r,e.create(n,o,a,t)}function Ls(e,n,t){const r={};return Er(r,_r(e,n)),e.create(n,e.Fragment,r,t)}function Ds(e,n){return n.value}function la(e,n,t,r){typeof t!="string"&&t!==e.Fragment&&e.passNode&&(n.node=r)}function Er(e,n){if(n.length>0){const t=n.length>1?n:n[0];t&&(e.children=t)}}function Ps(e,n,t){return r;function r(i,o,a,s){const c=Array.isArray(a.children)?t:n;return s?c(o,a,s):c(o,a)}}function Bs(e,n){return t;function t(r,i,o,a){const s=Array.isArray(o.children),l=mr(r);return n(i,o,a,s,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function Fs(e,n){const t={};let r,i;for(i in n.properties)if(i!=="children"&&br.call(n.properties,i)){const o=Us(e,i,n.properties[i]);if(o){const[a,s]=o;e.tableCellAlignToStyle&&a==="align"&&typeof s=="string"&&vs.has(n.tagName)?r=s:t[a]=s}}if(r){const o=t.style||(t.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return t}function zs(e,n){const t={};for(const r of n.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const a=o.expression;a.type;const s=a.properties[0];s.type,Object.assign(t,e.evaluater.evaluateExpression(s.argument))}else Vn(e,n.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const s=r.value.data.estree.body[0];s.type,o=e.evaluater.evaluateExpression(s.expression)}else Vn(e,n.position);else o=r.value===null?!0:r.value;t[i]=o}return t}function _r(e,n){const t=[];let r=-1;const i=e.passKeys?new Map:Ns;for(;++r<n.children.length;){const o=n.children[r];let a;if(e.passKeys){const l=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(l){const c=i.get(l)||0;a=l+"-"+c,i.set(l,c+1)}}const s=sa(e,o,a);s!==void 0&&t.push(s)}return t}function Us(e,n,t){const r=fs(e.schema,n);if(!(t==null||typeof t=="number"&&Number.isNaN(t))){if(Array.isArray(t)&&(t=r.commaSeparated?ns(t):bs(t)),r.property==="style"){let i=typeof t=="object"?t:$s(e,String(t));return e.stylePropertyNameCase==="css"&&(i=Hs(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?us[r.property]||r.property:r.attribute,t]}}function $s(e,n){try{return ws(n,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};const r=t,i=new ve("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=oa+"#cannot-parse-style-attribute",i}}function ca(e,n,t){let r;if(!t)r={type:"Literal",value:n};else if(n.includes(".")){const i=n.split(".");let o=-1,a;for(;++o<i.length;){const s=Vr(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};a=a?{type:"MemberExpression",object:a,property:s,computed:!!(o&&s.type==="Literal"),optional:!1}:s}r=a}else r=Vr(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};if(r.type==="Literal"){const i=r.value;return br.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Vn(e)}function Vn(e,n){const t=new ve("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:n,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw t.file=e.filePath||void 0,t.url=oa+"#cannot-handle-mdx-estrees-without-createevaluater",t}function Hs(e){const n={};let t;for(t in e)br.call(e,t)&&(n[Gs(t)]=e[t]);return n}function Gs(e){let n=e.replace(Ts,Ks);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function Ks(e){return"-"+e.toLowerCase()}const Bt={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},qs={};function yr(e,n){const t=qs,r=typeof t.includeImageAlt=="boolean"?t.includeImageAlt:!0,i=typeof t.includeHtml=="boolean"?t.includeHtml:!0;return ua(e,r,i)}function ua(e,n,t){if(Ws(e)){if("value"in e)return e.type==="html"&&!t?"":e.value;if(n&&"alt"in e&&e.alt)return e.alt;if("children"in e)return ri(e.children,n,t)}return Array.isArray(e)?ri(e,n,t):""}function ri(e,n,t){const r=[];let i=-1;for(;++i<e.length;)r[i]=ua(e[i],n,t);return r.join("")}function Ws(e){return!!(e&&typeof e=="object")}const ii=document.createElement("i");function kr(e){const n="&"+e+";";ii.innerHTML=n;const t=ii.textContent;return t.charCodeAt(t.length-1)===59&&e!=="semi"||t===n?!1:t}function $e(e,n,t,r){const i=e.length;let o=0,a;if(n<0?n=-n>i?0:i+n:n=n>i?i:n,t=t>0?t:0,r.length<1e4)a=Array.from(r),a.unshift(n,t),e.splice(...a);else for(t&&e.splice(n,t);o<r.length;)a=r.slice(o,o+1e4),a.unshift(n,0),e.splice(...a),o+=1e4,n+=1e4}function Ge(e,n){return e.length>0?($e(e,e.length,0,n),e):n}const ai={}.hasOwnProperty;function da(e){const n={};let t=-1;for(;++t<e.length;)Vs(n,e[t]);return n}function Vs(e,n){let t;for(t in n){const i=(ai.call(e,t)?e[t]:void 0)||(e[t]={}),o=n[t];let a;if(o)for(a in o){ai.call(i,a)||(i[a]=[]);const s=o[a];Ys(i[a],Array.isArray(s)?s:s?[s]:[])}}}function Ys(e,n){let t=-1;const r=[];for(;++t<n.length;)(n[t].add==="after"?e:r).push(n[t]);$e(e,0,0,r)}function pa(e,n){const t=Number.parseInt(e,n);return t<9||t===11||t>13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"�":String.fromCodePoint(t)}function Ve(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Re=gn(/[A-Za-z]/),Ae=gn(/[\dA-Za-z]/),Zs=gn(/[#-'*+\--9=?A-Z^-~]/);function mt(e){return e!==null&&(e<32||e===127)}const ar=gn(/\d/),Xs=gn(/[\dA-Fa-f]/),js=gn(/[!-/:-@[-`{-~]/);function q(e){return e!==null&&e<-2}function ge(e){return e!==null&&(e<0||e===32)}function re(e){return e===-2||e===-1||e===32}const xt=gn(new RegExp("\\p{P}|\\p{S}","u")),En=gn(/\s/);function gn(e){return n;function n(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Mn(e){const n=[];let t=-1,r=0,i=0;for(;++t<e.length;){const o=e.charCodeAt(t);let a="";if(o===37&&Ae(e.charCodeAt(t+1))&&Ae(e.charCodeAt(t+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(a=String.fromCharCode(o));else if(o>55295&&o<57344){const s=e.charCodeAt(t+1);o<56320&&s>56319&&s<57344?(a=String.fromCharCode(o,s),i=1):a="�"}else a=String.fromCharCode(o);a&&(n.push(e.slice(r,t),encodeURIComponent(a)),r=t+i+1,a=""),i&&(t+=i,i=0)}return n.join("")+e.slice(r)}function ae(e,n,t,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return a;function a(l){return re(l)?(e.enter(t),s(l)):n(l)}function s(l){return re(l)&&o++<i?(e.consume(l),s):(e.exit(t),n(l))}}const Qs={tokenize:Js};function Js(e){const n=e.attempt(this.parser.constructs.contentInitial,r,i);let t;return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),ae(e,n,"linePrefix")}function i(s){return e.enter("paragraph"),o(s)}function o(s){const l=e.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=l),t=l,a(s)}function a(s){if(s===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(s);return}return q(s)?(e.consume(s),e.exit("chunkText"),o):(e.consume(s),a)}}const el={tokenize:nl},oi={tokenize:tl};function nl(e){const n=this,t=[];let r=0,i,o,a;return s;function s(w){if(r<t.length){const O=t[r];return n.containerState=O[1],e.attempt(O[0].continuation,l,c)(w)}return c(w)}function l(w){if(r++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,i&&N();const O=n.events.length;let R=O,k;for(;R--;)if(n.events[R][0]==="exit"&&n.events[R][1].type==="chunkFlow"){k=n.events[R][1].end;break}E(r);let U=O;for(;U<n.events.length;)n.events[U][1].end={...k},U++;return $e(n.events,R+1,0,n.events.slice(O)),n.events.length=U,c(w)}return s(w)}function c(w){if(r===t.length){if(!i)return f(w);if(i.currentConstruct&&i.currentConstruct.concrete)return g(w);n.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(oi,u,d)(w)}function u(w){return i&&N(),E(r),f(w)}function d(w){return n.parser.lazy[n.now().line]=r!==t.length,a=n.now().offset,g(w)}function f(w){return n.containerState={},e.attempt(oi,p,g)(w)}function p(w){return r++,t.push([n.currentConstruct,n.containerState]),f(w)}function g(w){if(w===null){i&&N(),E(0),e.consume(w);return}return i=i||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),_(w)}function _(w){if(w===null){y(e.exit("chunkFlow"),!0),E(0),e.consume(w);return}return q(w)?(e.consume(w),y(e.exit("chunkFlow")),r=0,n.interrupt=void 0,s):(e.consume(w),_)}function y(w,O){const R=n.sliceStream(w);if(O&&R.push(null),w.previous=o,o&&(o.next=w),o=w,i.defineSkip(w.start),i.write(R),n.parser.lazy[w.start.line]){let k=i.events.length;for(;k--;)if(i.events[k][1].start.offset<a&&(!i.events[k][1].end||i.events[k][1].end.offset>a))return;const U=n.events.length;let $=U,H,x;for(;$--;)if(n.events[$][0]==="exit"&&n.events[$][1].type==="chunkFlow"){if(H){x=n.events[$][1].end;break}H=!0}for(E(r),k=U;k<n.events.length;)n.events[k][1].end={...x},k++;$e(n.events,$+1,0,n.events.slice(U)),n.events.length=k}}function E(w){let O=t.length;for(;O-- >w;){const R=t[O];n.containerState=R[1],R[0].exit.call(n,e)}t.length=w}function N(){i.write([null]),o=void 0,i=void 0,n.containerState._closeFlow=void 0}}function tl(e,n,t){return ae(e,e.attempt(this.parser.constructs.document,n,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function In(e){if(e===null||ge(e)||En(e))return 1;if(xt(e))return 2}function wt(e,n,t){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(n=o(n,t),r.push(o))}return n}const or={name:"attention",resolveAll:rl,tokenize:il};function rl(e,n){let t=-1,r,i,o,a,s,l,c,u;for(;++t<e.length;)if(e[t][0]==="enter"&&e[t][1].type==="attentionSequence"&&e[t][1]._close){for(r=t;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&n.sliceSerialize(e[r][1]).charCodeAt(0)===n.sliceSerialize(e[t][1]).charCodeAt(0)){if((e[r][1]._close||e[t][1]._open)&&(e[t][1].end.offset-e[t][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[t][1].end.offset-e[t][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[t][1].end.offset-e[t][1].start.offset>1?2:1;const d={...e[r][1].end},f={...e[t][1].start};si(d,-l),si(f,l),a={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},s={type:l>1?"strongSequence":"emphasisSequence",start:{...e[t][1].start},end:f},o={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[t][1].start}},i={type:l>1?"strong":"emphasis",start:{...a.start},end:{...s.end}},e[r][1].end={...a.start},e[t][1].start={...s.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=Ge(c,[["enter",e[r][1],n],["exit",e[r][1],n]])),c=Ge(c,[["enter",i,n],["enter",a,n],["exit",a,n],["enter",o,n]]),c=Ge(c,wt(n.parser.constructs.insideSpan.null,e.slice(r+1,t),n)),c=Ge(c,[["exit",o,n],["enter",s,n],["exit",s,n],["exit",i,n]]),e[t][1].end.offset-e[t][1].start.offset?(u=2,c=Ge(c,[["enter",e[t][1],n],["exit",e[t][1],n]])):u=0,$e(e,r-1,t-r+3,c),t=r+c.length-u-2;break}}for(t=-1;++t<e.length;)e[t][1].type==="attentionSequence"&&(e[t][1].type="data");return e}function il(e,n){const t=this.parser.constructs.attentionMarkers.null,r=this.previous,i=In(r);let o;return a;function a(l){return o=l,e.enter("attentionSequence"),s(l)}function s(l){if(l===o)return e.consume(l),s;const c=e.exit("attentionSequence"),u=In(l),d=!u||u===2&&i||t.includes(l),f=!i||i===2&&u||t.includes(r);return c._open=!!(o===42?d:d&&(i||!f)),c._close=!!(o===42?f:f&&(u||!d)),n(l)}}function si(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const al={name:"autolink",tokenize:ol};function ol(e,n,t){let r=0;return i;function i(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(p){return Re(p)?(e.consume(p),a):p===64?t(p):c(p)}function a(p){return p===43||p===45||p===46||Ae(p)?(r=1,s(p)):c(p)}function s(p){return p===58?(e.consume(p),r=0,l):(p===43||p===45||p===46||Ae(p))&&r++<32?(e.consume(p),s):(r=0,c(p))}function l(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),n):p===null||p===32||p===60||mt(p)?t(p):(e.consume(p),l)}function c(p){return p===64?(e.consume(p),u):Zs(p)?(e.consume(p),c):t(p)}function u(p){return Ae(p)?d(p):t(p)}function d(p){return p===46?(e.consume(p),r=0,u):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),n):f(p)}function f(p){if((p===45||Ae(p))&&r++<63){const g=p===45?f:d;return e.consume(p),g}return t(p)}}const Xn={partial:!0,tokenize:sl};function sl(e,n,t){return r;function r(o){return re(o)?ae(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||q(o)?n(o):t(o)}}const fa={continuation:{tokenize:cl},exit:ul,name:"blockQuote",tokenize:ll};function ll(e,n,t){const r=this;return i;function i(a){if(a===62){const s=r.containerState;return s.open||(e.enter("blockQuote",{_container:!0}),s.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),o}return t(a)}function o(a){return re(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(a))}}function cl(e,n,t){const r=this;return i;function i(a){return re(a)?ae(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):o(a)}function o(a){return e.attempt(fa,n,t)(a)}}function ul(e){e.exit("blockQuote")}const ga={name:"characterEscape",tokenize:dl};function dl(e,n,t){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return js(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):t(o)}}const ha={name:"characterReference",tokenize:pl};function pl(e,n,t){const r=this;let i=0,o,a;return s;function s(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),l}function l(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),o=31,a=Ae,u(d))}function c(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,a=Xs,u):(e.enter("characterReferenceValue"),o=7,a=ar,u(d))}function u(d){if(d===59&&i){const f=e.exit("characterReferenceValue");return a===Ae&&!kr(r.sliceSerialize(f))?t(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return a(d)&&i++<o?(e.consume(d),u):t(d)}}const li={partial:!0,tokenize:gl},ci={concrete:!0,name:"codeFenced",tokenize:fl};function fl(e,n,t){const r=this,i={partial:!0,tokenize:R};let o=0,a=0,s;return l;function l(k){return c(k)}function c(k){const U=r.events[r.events.length-1];return o=U&&U[1].type==="linePrefix"?U[2].sliceSerialize(U[1],!0).length:0,s=k,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(k)}function u(k){return k===s?(a++,e.consume(k),u):a<3?t(k):(e.exit("codeFencedFenceSequence"),re(k)?ae(e,d,"whitespace")(k):d(k))}function d(k){return k===null||q(k)?(e.exit("codeFencedFence"),r.interrupt?n(k):e.check(li,_,O)(k)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(k))}function f(k){return k===null||q(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(k)):re(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ae(e,p,"whitespace")(k)):k===96&&k===s?t(k):(e.consume(k),f)}function p(k){return k===null||q(k)?d(k):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(k))}function g(k){return k===null||q(k)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(k)):k===96&&k===s?t(k):(e.consume(k),g)}function _(k){return e.attempt(i,O,y)(k)}function y(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),E}function E(k){return o>0&&re(k)?ae(e,N,"linePrefix",o+1)(k):N(k)}function N(k){return k===null||q(k)?e.check(li,_,O)(k):(e.enter("codeFlowValue"),w(k))}function w(k){return k===null||q(k)?(e.exit("codeFlowValue"),N(k)):(e.consume(k),w)}function O(k){return e.exit("codeFenced"),n(k)}function R(k,U,$){let H=0;return x;function x(v){return k.enter("lineEnding"),k.consume(v),k.exit("lineEnding"),P}function P(v){return k.enter("codeFencedFence"),re(v)?ae(k,B,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(v):B(v)}function B(v){return v===s?(k.enter("codeFencedFenceSequence"),Q(v)):$(v)}function Q(v){return v===s?(H++,k.consume(v),Q):H>=a?(k.exit("codeFencedFenceSequence"),re(v)?ae(k,L,"whitespace")(v):L(v)):$(v)}function L(v){return v===null||q(v)?(k.exit("codeFencedFence"),U(v)):$(v)}}}function gl(e,n,t){const r=this;return i;function i(a){return a===null?t(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o)}function o(a){return r.parser.lazy[r.now().line]?t(a):n(a)}}const Ft={name:"codeIndented",tokenize:ml},hl={partial:!0,tokenize:bl};function ml(e,n,t){const r=this;return i;function i(c){return e.enter("codeIndented"),ae(e,o,"linePrefix",5)(c)}function o(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?a(c):t(c)}function a(c){return c===null?l(c):q(c)?e.attempt(hl,a,l)(c):(e.enter("codeFlowValue"),s(c))}function s(c){return c===null||q(c)?(e.exit("codeFlowValue"),a(c)):(e.consume(c),s)}function l(c){return e.exit("codeIndented"),n(c)}}function bl(e,n,t){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?t(a):q(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):ae(e,o,"linePrefix",5)(a)}function o(a){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?n(a):q(a)?i(a):t(a)}}const El={name:"codeText",previous:yl,resolve:_l,tokenize:kl};function _l(e){let n=e.length-4,t=3,r,i;if((e[t][1].type==="lineEnding"||e[t][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(r=t;++r<n;)if(e[r][1].type==="codeTextData"){e[t][1].type="codeTextPadding",e[n][1].type="codeTextPadding",t+=2,n-=2;break}}for(r=t-1,n++;++r<=n;)i===void 0?r!==n&&e[r][1].type!=="lineEnding"&&(i=r):(r===n||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),n-=r-i-2,r=i+2),i=void 0);return e}function yl(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function kl(e,n,t){let r=0,i,o;return a;function a(d){return e.enter("codeText"),e.enter("codeTextSequence"),s(d)}function s(d){return d===96?(e.consume(d),r++,s):(e.exit("codeTextSequence"),l(d))}function l(d){return d===null?t(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),l):d===96?(o=e.enter("codeTextSequence"),i=0,u(d)):q(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(d))}function c(d){return d===null||d===32||d===96||q(d)?(e.exit("codeTextData"),l(d)):(e.consume(d),c)}function u(d){return d===96?(e.consume(d),i++,u):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),n(d)):(o.type="codeTextData",c(d))}}class xl{constructor(n){this.left=n?[...n]:[],this.right=[]}get(n){if(n<0||n>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return n<this.left.length?this.left[n]:this.right[this.right.length-n+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(n,t){const r=t??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(n,r):n>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(n,t,r){const i=t||0;this.setCursor(Math.trunc(n));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&$n(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),$n(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),$n(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n<this.left.length){const t=this.left.splice(n,Number.POSITIVE_INFINITY);$n(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);$n(this.left,t.reverse())}}}function $n(e,n){let t=0;if(n.length<1e4)e.push(...n);else for(;t<n.length;)e.push(...n.slice(t,t+1e4)),t+=1e4}function ma(e){const n={};let t=-1,r,i,o,a,s,l,c;const u=new xl(e);for(;++t<u.length;){for(;t in n;)t=n[t];if(r=u.get(t),t&&r[1].type==="chunkFlow"&&u.get(t-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,o=0,o<l.length&&l[o][1].type==="lineEndingBlank"&&(o+=2),o<l.length&&l[o][1].type==="content"))for(;++o<l.length&&l[o][1].type!=="content";)l[o][1].type==="chunkText"&&(l[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(n,wl(u,t)),t=n[t],c=!0);else if(r[1]._container){for(o=t,i=void 0;o--;)if(a=u.get(o),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(u.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=o);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,t),s.unshift(r),u.splice(i,t-i+1,s))}}return $e(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function wl(e,n){const t=e.get(n)[1],r=e.get(n)[2];let i=n-1;const o=[];let a=t._tokenizer;a||(a=r.parser[t.contentType](t.start),t._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const s=a.events,l=[],c={};let u,d,f=-1,p=t,g=0,_=0;const y=[_];for(;p;){for(;e.get(++i)[1]!==p;);o.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&a.defineSkip(p.start),p._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(u),p._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=t;++f<s.length;)s[f][0]==="exit"&&s[f-1][0]==="enter"&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(_=f+1,y.push(_),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(a.events=[],p?(p._tokenizer=void 0,p.previous=void 0):y.pop(),f=y.length;f--;){const E=s.slice(y[f],y[f+1]),N=o.pop();l.push([N,N+E.length-1]),e.splice(N,2,E)}for(l.reverse(),f=-1;++f<l.length;)c[g+l[f][0]]=g+l[f][1],g+=l[f][1]-l[f][0]-1;return c}const Sl={resolve:Tl,tokenize:Al},Nl={partial:!0,tokenize:vl};function Tl(e){return ma(e),e}function Al(e,n){let t;return r;function r(s){return e.enter("content"),t=e.enter("chunkContent",{contentType:"content"}),i(s)}function i(s){return s===null?o(s):q(s)?e.check(Nl,a,o)(s):(e.consume(s),i)}function o(s){return e.exit("chunkContent"),e.exit("content"),n(s)}function a(s){return e.consume(s),e.exit("chunkContent"),t.next=e.enter("chunkContent",{contentType:"content",previous:t}),t=t.next,i}}function vl(e,n,t){const r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),ae(e,o,"linePrefix")}function o(a){if(a===null||q(a))return t(a);const s=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?n(a):e.interrupt(r.parser.constructs.flow,t,n)(a)}}function ba(e,n,t,r,i,o,a,s,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return d;function d(E){return E===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(E),e.exit(o),f):E===null||E===32||E===41||mt(E)?t(E):(e.enter(r),e.enter(a),e.enter(s),e.enter("chunkString",{contentType:"string"}),_(E))}function f(E){return E===62?(e.enter(o),e.consume(E),e.exit(o),e.exit(i),e.exit(r),n):(e.enter(s),e.enter("chunkString",{contentType:"string"}),p(E))}function p(E){return E===62?(e.exit("chunkString"),e.exit(s),f(E)):E===null||E===60||q(E)?t(E):(e.consume(E),E===92?g:p)}function g(E){return E===60||E===62||E===92?(e.consume(E),p):p(E)}function _(E){return!u&&(E===null||E===41||ge(E))?(e.exit("chunkString"),e.exit(s),e.exit(a),e.exit(r),n(E)):u<c&&E===40?(e.consume(E),u++,_):E===41?(e.consume(E),u--,_):E===null||E===32||E===40||mt(E)?t(E):(e.consume(E),E===92?y:_)}function y(E){return E===40||E===41||E===92?(e.consume(E),_):_(E)}}function Ea(e,n,t,r,i,o){const a=this;let s=0,l;return c;function c(p){return e.enter(r),e.enter(i),e.consume(p),e.exit(i),e.enter(o),u}function u(p){return s>999||p===null||p===91||p===93&&!l||p===94&&!s&&"_hiddenFootnoteSupport"in a.parser.constructs?t(p):p===93?(e.exit(o),e.enter(i),e.consume(p),e.exit(i),e.exit(r),n):q(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===null||p===91||p===93||q(p)||s++>999?(e.exit("chunkString"),u(p)):(e.consume(p),l||(l=!re(p)),p===92?f:d)}function f(p){return p===91||p===92||p===93?(e.consume(p),s++,d):d(p)}}function _a(e,n,t,r,i,o){let a;return s;function s(f){return f===34||f===39||f===40?(e.enter(r),e.enter(i),e.consume(f),e.exit(i),a=f===40?41:f,l):t(f)}function l(f){return f===a?(e.enter(i),e.consume(f),e.exit(i),e.exit(r),n):(e.enter(o),c(f))}function c(f){return f===a?(e.exit(o),l(a)):f===null?t(f):q(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),ae(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(f))}function u(f){return f===a||f===null||q(f)?(e.exit("chunkString"),c(f)):(e.consume(f),f===92?d:u)}function d(f){return f===a||f===92?(e.consume(f),u):u(f)}}function qn(e,n){let t;return r;function r(i){return q(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t=!0,r):re(i)?ae(e,r,t?"linePrefix":"lineSuffix")(i):n(i)}}const Cl={name:"definition",tokenize:Il},Ol={partial:!0,tokenize:Rl};function Il(e,n,t){const r=this;let i;return o;function o(p){return e.enter("definition"),a(p)}function a(p){return Ea.call(r,e,s,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function s(p){return i=Ve(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),l):t(p)}function l(p){return ge(p)?qn(e,c)(p):c(p)}function c(p){return ba(e,u,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function u(p){return e.attempt(Ol,d,d)(p)}function d(p){return re(p)?ae(e,f,"whitespace")(p):f(p)}function f(p){return p===null||q(p)?(e.exit("definition"),r.parser.defined.push(i),n(p)):t(p)}}function Rl(e,n,t){return r;function r(s){return ge(s)?qn(e,i)(s):t(s)}function i(s){return _a(e,o,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function o(s){return re(s)?ae(e,a,"whitespace")(s):a(s)}function a(s){return s===null||q(s)?n(s):t(s)}}const Ml={name:"hardBreakEscape",tokenize:Ll};function Ll(e,n,t){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return q(o)?(e.exit("hardBreakEscape"),n(o)):t(o)}}const Dl={name:"headingAtx",resolve:Pl,tokenize:Bl};function Pl(e,n){let t=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),t-2>r&&e[t][1].type==="whitespace"&&(t-=2),e[t][1].type==="atxHeadingSequence"&&(r===t-1||t-4>r&&e[t-2][1].type==="whitespace")&&(t-=r+1===t?2:4),t>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[t][1].end},o={type:"chunkText",start:e[r][1].start,end:e[t][1].end,contentType:"text"},$e(e,r,t-r+1,[["enter",i,n],["enter",o,n],["exit",o,n],["exit",i,n]])),e}function Bl(e,n,t){let r=0;return i;function i(u){return e.enter("atxHeading"),o(u)}function o(u){return e.enter("atxHeadingSequence"),a(u)}function a(u){return u===35&&r++<6?(e.consume(u),a):u===null||ge(u)?(e.exit("atxHeadingSequence"),s(u)):t(u)}function s(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||q(u)?(e.exit("atxHeading"),n(u)):re(u)?ae(e,s,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function l(u){return u===35?(e.consume(u),l):(e.exit("atxHeadingSequence"),s(u))}function c(u){return u===null||u===35||ge(u)?(e.exit("atxHeadingText"),s(u)):(e.consume(u),c)}}const Fl=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],ui=["pre","script","style","textarea"],zl={concrete:!0,name:"htmlFlow",resolveTo:Hl,tokenize:Gl},Ul={partial:!0,tokenize:ql},$l={partial:!0,tokenize:Kl};function Hl(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function Gl(e,n,t){const r=this;let i,o,a,s,l;return c;function c(b){return u(b)}function u(b){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(b),d}function d(b){return b===33?(e.consume(b),f):b===47?(e.consume(b),o=!0,_):b===63?(e.consume(b),i=3,r.interrupt?n:h):Re(b)?(e.consume(b),a=String.fromCharCode(b),y):t(b)}function f(b){return b===45?(e.consume(b),i=2,p):b===91?(e.consume(b),i=5,s=0,g):Re(b)?(e.consume(b),i=4,r.interrupt?n:h):t(b)}function p(b){return b===45?(e.consume(b),r.interrupt?n:h):t(b)}function g(b){const Ce="CDATA[";return b===Ce.charCodeAt(s++)?(e.consume(b),s===Ce.length?r.interrupt?n:B:g):t(b)}function _(b){return Re(b)?(e.consume(b),a=String.fromCharCode(b),y):t(b)}function y(b){if(b===null||b===47||b===62||ge(b)){const Ce=b===47,He=a.toLowerCase();return!Ce&&!o&&ui.includes(He)?(i=1,r.interrupt?n(b):B(b)):Fl.includes(a.toLowerCase())?(i=6,Ce?(e.consume(b),E):r.interrupt?n(b):B(b)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(b):o?N(b):w(b))}return b===45||Ae(b)?(e.consume(b),a+=String.fromCharCode(b),y):t(b)}function E(b){return b===62?(e.consume(b),r.interrupt?n:B):t(b)}function N(b){return re(b)?(e.consume(b),N):x(b)}function w(b){return b===47?(e.consume(b),x):b===58||b===95||Re(b)?(e.consume(b),O):re(b)?(e.consume(b),w):x(b)}function O(b){return b===45||b===46||b===58||b===95||Ae(b)?(e.consume(b),O):R(b)}function R(b){return b===61?(e.consume(b),k):re(b)?(e.consume(b),R):w(b)}function k(b){return b===null||b===60||b===61||b===62||b===96?t(b):b===34||b===39?(e.consume(b),l=b,U):re(b)?(e.consume(b),k):$(b)}function U(b){return b===l?(e.consume(b),l=null,H):b===null||q(b)?t(b):(e.consume(b),U)}function $(b){return b===null||b===34||b===39||b===47||b===60||b===61||b===62||b===96||ge(b)?R(b):(e.consume(b),$)}function H(b){return b===47||b===62||re(b)?w(b):t(b)}function x(b){return b===62?(e.consume(b),P):t(b)}function P(b){return b===null||q(b)?B(b):re(b)?(e.consume(b),P):t(b)}function B(b){return b===45&&i===2?(e.consume(b),Y):b===60&&i===1?(e.consume(b),se):b===62&&i===4?(e.consume(b),ue):b===63&&i===3?(e.consume(b),h):b===93&&i===5?(e.consume(b),pe):q(b)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Ul,fe,Q)(b)):b===null||q(b)?(e.exit("htmlFlowData"),Q(b)):(e.consume(b),B)}function Q(b){return e.check($l,L,fe)(b)}function L(b){return e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),v}function v(b){return b===null||q(b)?Q(b):(e.enter("htmlFlowData"),B(b))}function Y(b){return b===45?(e.consume(b),h):B(b)}function se(b){return b===47?(e.consume(b),a="",Z):B(b)}function Z(b){if(b===62){const Ce=a.toLowerCase();return ui.includes(Ce)?(e.consume(b),ue):B(b)}return Re(b)&&a.length<8?(e.consume(b),a+=String.fromCharCode(b),Z):B(b)}function pe(b){return b===93?(e.consume(b),h):B(b)}function h(b){return b===62?(e.consume(b),ue):b===45&&i===2?(e.consume(b),h):B(b)}function ue(b){return b===null||q(b)?(e.exit("htmlFlowData"),fe(b)):(e.consume(b),ue)}function fe(b){return e.exit("htmlFlow"),n(b)}}function Kl(e,n,t){const r=this;return i;function i(a){return q(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o):t(a)}function o(a){return r.parser.lazy[r.now().line]?t(a):n(a)}}function ql(e,n,t){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Xn,n,t)}}const Wl={name:"htmlText",tokenize:Vl};function Vl(e,n,t){const r=this;let i,o,a;return s;function s(h){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(h),l}function l(h){return h===33?(e.consume(h),c):h===47?(e.consume(h),R):h===63?(e.consume(h),w):Re(h)?(e.consume(h),$):t(h)}function c(h){return h===45?(e.consume(h),u):h===91?(e.consume(h),o=0,g):Re(h)?(e.consume(h),N):t(h)}function u(h){return h===45?(e.consume(h),p):t(h)}function d(h){return h===null?t(h):h===45?(e.consume(h),f):q(h)?(a=d,se(h)):(e.consume(h),d)}function f(h){return h===45?(e.consume(h),p):d(h)}function p(h){return h===62?Y(h):h===45?f(h):d(h)}function g(h){const ue="CDATA[";return h===ue.charCodeAt(o++)?(e.consume(h),o===ue.length?_:g):t(h)}function _(h){return h===null?t(h):h===93?(e.consume(h),y):q(h)?(a=_,se(h)):(e.consume(h),_)}function y(h){return h===93?(e.consume(h),E):_(h)}function E(h){return h===62?Y(h):h===93?(e.consume(h),E):_(h)}function N(h){return h===null||h===62?Y(h):q(h)?(a=N,se(h)):(e.consume(h),N)}function w(h){return h===null?t(h):h===63?(e.consume(h),O):q(h)?(a=w,se(h)):(e.consume(h),w)}function O(h){return h===62?Y(h):w(h)}function R(h){return Re(h)?(e.consume(h),k):t(h)}function k(h){return h===45||Ae(h)?(e.consume(h),k):U(h)}function U(h){return q(h)?(a=U,se(h)):re(h)?(e.consume(h),U):Y(h)}function $(h){return h===45||Ae(h)?(e.consume(h),$):h===47||h===62||ge(h)?H(h):t(h)}function H(h){return h===47?(e.consume(h),Y):h===58||h===95||Re(h)?(e.consume(h),x):q(h)?(a=H,se(h)):re(h)?(e.consume(h),H):Y(h)}function x(h){return h===45||h===46||h===58||h===95||Ae(h)?(e.consume(h),x):P(h)}function P(h){return h===61?(e.consume(h),B):q(h)?(a=P,se(h)):re(h)?(e.consume(h),P):H(h)}function B(h){return h===null||h===60||h===61||h===62||h===96?t(h):h===34||h===39?(e.consume(h),i=h,Q):q(h)?(a=B,se(h)):re(h)?(e.consume(h),B):(e.consume(h),L)}function Q(h){return h===i?(e.consume(h),i=void 0,v):h===null?t(h):q(h)?(a=Q,se(h)):(e.consume(h),Q)}function L(h){return h===null||h===34||h===39||h===60||h===61||h===96?t(h):h===47||h===62||ge(h)?H(h):(e.consume(h),L)}function v(h){return h===47||h===62||ge(h)?H(h):t(h)}function Y(h){return h===62?(e.consume(h),e.exit("htmlTextData"),e.exit("htmlText"),n):t(h)}function se(h){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),Z}function Z(h){return re(h)?ae(e,pe,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(h):pe(h)}function pe(h){return e.enter("htmlTextData"),a(h)}}const xr={name:"labelEnd",resolveAll:jl,resolveTo:Ql,tokenize:Jl},Yl={tokenize:ec},Zl={tokenize:nc},Xl={tokenize:tc};function jl(e){let n=-1;const t=[];for(;++n<e.length;){const r=e[n][1];if(t.push(e[n]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",n+=i}}return e.length!==t.length&&$e(e,0,e.length,t),e}function Ql(e,n){let t=e.length,r=0,i,o,a,s;for(;t--;)if(i=e[t][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[t][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(a){if(e[t][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=t,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(a=t);const l={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[o][1].start},end:{...e[a][1].end}},u={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[a-2][1].start}};return s=[["enter",l,n],["enter",c,n]],s=Ge(s,e.slice(o+1,o+r+3)),s=Ge(s,[["enter",u,n]]),s=Ge(s,wt(n.parser.constructs.insideSpan.null,e.slice(o+r+4,a-3),n)),s=Ge(s,[["exit",u,n],e[a-2],e[a-1],["exit",c,n]]),s=Ge(s,e.slice(a+1)),s=Ge(s,[["exit",l,n]]),$e(e,o,e.length,s),e}function Jl(e,n,t){const r=this;let i=r.events.length,o,a;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return s;function s(f){return o?o._inactive?d(f):(a=r.parser.defined.includes(Ve(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelEnd"),l):t(f)}function l(f){return f===40?e.attempt(Yl,u,a?u:d)(f):f===91?e.attempt(Zl,u,a?c:d)(f):a?u(f):d(f)}function c(f){return e.attempt(Xl,u,d)(f)}function u(f){return n(f)}function d(f){return o._balanced=!0,t(f)}}function ec(e,n,t){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),i}function i(d){return ge(d)?qn(e,o)(d):o(d)}function o(d){return d===41?u(d):ba(e,a,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function a(d){return ge(d)?qn(e,l)(d):u(d)}function s(d){return t(d)}function l(d){return d===34||d===39||d===40?_a(e,c,t,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):u(d)}function c(d){return ge(d)?qn(e,u)(d):u(d)}function u(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),n):t(d)}}function nc(e,n,t){const r=this;return i;function i(s){return Ea.call(r,e,o,a,"reference","referenceMarker","referenceString")(s)}function o(s){return r.parser.defined.includes(Ve(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?n(s):t(s)}function a(s){return t(s)}}function tc(e,n,t){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),n):t(o)}}const rc={name:"labelStartImage",resolveAll:xr.resolveAll,tokenize:ic};function ic(e,n,t){const r=this;return i;function i(s){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(s),e.exit("labelImageMarker"),o}function o(s){return s===91?(e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelImage"),a):t(s)}function a(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(s):n(s)}}const ac={name:"labelStartLink",resolveAll:xr.resolveAll,tokenize:oc};function oc(e,n,t){const r=this;return i;function i(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),o}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(a):n(a)}}const zt={name:"lineEnding",tokenize:sc};function sc(e,n){return t;function t(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),ae(e,n,"linePrefix")}}const ht={name:"thematicBreak",tokenize:lc};function lc(e,n,t){let r=0,i;return o;function o(c){return e.enter("thematicBreak"),a(c)}function a(c){return i=c,s(c)}function s(c){return c===i?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||q(c))?(e.exit("thematicBreak"),n(c)):t(c)}function l(c){return c===i?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),re(c)?ae(e,s,"whitespace")(c):s(c))}}const Me={continuation:{tokenize:pc},exit:gc,name:"list",tokenize:dc},cc={partial:!0,tokenize:hc},uc={partial:!0,tokenize:fc};function dc(e,n,t){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return s;function s(p){const g=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:ar(p)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(ht,t,c)(p):c(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(p)}return t(p)}function l(p){return ar(p)&&++a<10?(e.consume(p),l):(!r.interrupt||a<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),c(p)):t(p)}function c(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(Xn,r.interrupt?t:u,e.attempt(cc,f,d))}function u(p){return r.containerState.initialBlankLine=!0,o++,f(p)}function d(p){return re(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),f):t(p)}function f(p){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(p)}}function pc(e,n,t){const r=this;return r.containerState._closeFlow=void 0,e.check(Xn,i,o);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ae(e,n,"listItemIndent",r.containerState.size+1)(s)}function o(s){return r.containerState.furtherBlankLines||!re(s)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(s)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(uc,n,a)(s))}function a(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,ae(e,e.attempt(Me,n,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function fc(e,n,t){const r=this;return ae(e,i,"listItemIndent",r.containerState.size+1);function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?n(o):t(o)}}function gc(e){e.exit(this.containerState.type)}function hc(e,n,t){const r=this;return ae(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const a=r.events[r.events.length-1];return!re(o)&&a&&a[1].type==="listItemPrefixWhitespace"?n(o):t(o)}}const di={name:"setextUnderline",resolveTo:mc,tokenize:bc};function mc(e,n){let t=e.length,r,i,o;for(;t--;)if(e[t][0]==="enter"){if(e[t][1].type==="content"){r=t;break}e[t][1].type==="paragraph"&&(i=t)}else e[t][1].type==="content"&&e.splice(t,1),!o&&e[t][1].type==="definition"&&(o=t);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",a,n]),e.splice(o+1,0,["exit",e[r][1],n]),e[r][1].end={...e[o][1].end}):e[r][1]=a,e.push(["exit",a,n]),e}function bc(e,n,t){const r=this;let i;return o;function o(c){let u=r.events.length,d;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){d=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),i=c,a(c)):t(c)}function a(c){return e.enter("setextHeadingLineSequence"),s(c)}function s(c){return c===i?(e.consume(c),s):(e.exit("setextHeadingLineSequence"),re(c)?ae(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||q(c)?(e.exit("setextHeadingLine"),n(c)):t(c)}}const Ec={tokenize:_c};function _c(e){const n=this,t=e.attempt(Xn,r,e.attempt(this.parser.constructs.flowInitial,i,ae(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Sl,i)),"linePrefix")));return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),n.currentConstruct=void 0,t}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n.currentConstruct=void 0,t}}const yc={resolveAll:ka()},kc=ya("string"),xc=ya("text");function ya(e){return{resolveAll:ka(e==="text"?wc:void 0),tokenize:n};function n(t){const r=this,i=this.parser.constructs[e],o=t.attempt(i,a,s);return a;function a(u){return c(u)?o(u):s(u)}function s(u){if(u===null){t.consume(u);return}return t.enter("data"),t.consume(u),l}function l(u){return c(u)?(t.exit("data"),o(u)):(t.consume(u),l)}function c(u){if(u===null)return!0;const d=i[u];let f=-1;if(d)for(;++f<d.length;){const p=d[f];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function ka(e){return n;function n(t,r){let i=-1,o;for(;++i<=t.length;)o===void 0?t[i]&&t[i][1].type==="data"&&(o=i,i++):(!t[i]||t[i][1].type!=="data")&&(i!==o+2&&(t[o][1].end=t[i-1][1].end,t.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(t,r):t}}function wc(e,n){let t=0;for(;++t<=e.length;)if((t===e.length||e[t][1].type==="lineEnding")&&e[t-1][1].type==="data"){const r=e[t-1][1],i=n.sliceStream(r);let o=i.length,a=-1,s=0,l;for(;o--;){const c=i[o];if(typeof c=="string"){for(a=c.length;c.charCodeAt(a-1)===32;)s++,a--;if(a)break;a=-1}else if(c===-2)l=!0,s++;else if(c!==-1){o++;break}}if(n._contentTypeTextTrailing&&t===e.length&&(s=0),s){const c={type:t===e.length||l||s<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?a:r.start._bufferIndex+a,_index:r.start._index+o,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(t,0,["enter",c,n],["exit",c,n]),t+=2)}t++}return e}const Sc={42:Me,43:Me,45:Me,48:Me,49:Me,50:Me,51:Me,52:Me,53:Me,54:Me,55:Me,56:Me,57:Me,62:fa},Nc={91:Cl},Tc={[-2]:Ft,[-1]:Ft,32:Ft},Ac={35:Dl,42:ht,45:[di,ht],60:zl,61:di,95:ht,96:ci,126:ci},vc={38:ha,92:ga},Cc={[-5]:zt,[-4]:zt,[-3]:zt,33:rc,38:ha,42:or,60:[al,Wl],91:ac,92:[Ml,ga],93:xr,95:or,96:El},Oc={null:[or,yc]},Ic={null:[42,95]},Rc={null:[]},Mc=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Ic,contentInitial:Nc,disable:Rc,document:Sc,flow:Ac,flowInitial:Tc,insideSpan:Oc,string:vc,text:Cc},Symbol.toStringTag,{value:"Module"}));function Lc(e,n,t){let r={_bufferIndex:-1,_index:0,line:t&&t.line||1,column:t&&t.column||1,offset:t&&t.offset||0};const i={},o=[];let a=[],s=[];const l={attempt:U(R),check:U(k),consume:N,enter:w,exit:O,interrupt:U(k,{interrupt:!0})},c={code:null,containerState:{},defineSkip:_,events:[],now:g,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d};let u=n.tokenize.call(c,l);return n.resolveAll&&o.push(n),c;function d(P){return a=Ge(a,P),y(),a[a.length-1]!==null?[]:($(n,0),c.events=wt(o,c.events,c),c.events)}function f(P,B){return Pc(p(P),B)}function p(P){return Dc(a,P)}function g(){const{_bufferIndex:P,_index:B,line:Q,column:L,offset:v}=r;return{_bufferIndex:P,_index:B,line:Q,column:L,offset:v}}function _(P){i[P.line]=P.column,x()}function y(){let P;for(;r._index<a.length;){const B=a[r._index];if(typeof B=="string")for(P=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===P&&r._bufferIndex<B.length;)E(B.charCodeAt(r._bufferIndex));else E(B)}}function E(P){u=u(P)}function N(P){q(P)?(r.line++,r.column=1,r.offset+=P===-3?2:1,x()):P!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=P}function w(P,B){const Q=B||{};return Q.type=P,Q.start=g(),c.events.push(["enter",Q,c]),s.push(Q),Q}function O(P){const B=s.pop();return B.end=g(),c.events.push(["exit",B,c]),B}function R(P,B){$(P,B.from)}function k(P,B){B.restore()}function U(P,B){return Q;function Q(L,v,Y){let se,Z,pe,h;return Array.isArray(L)?fe(L):"tokenize"in L?fe([L]):ue(L);function ue(Ee){return Je;function Je(De){const en=De!==null&&Ee[De],Pe=De!==null&&Ee.null,ln=[...Array.isArray(en)?en:en?[en]:[],...Array.isArray(Pe)?Pe:Pe?[Pe]:[]];return fe(ln)(De)}}function fe(Ee){return se=Ee,Z=0,Ee.length===0?Y:b(Ee[Z])}function b(Ee){return Je;function Je(De){return h=H(),pe=Ee,Ee.partial||(c.currentConstruct=Ee),Ee.name&&c.parser.constructs.disable.null.includes(Ee.name)?He():Ee.tokenize.call(B?Object.assign(Object.create(c),B):c,l,Ce,He)(De)}}function Ce(Ee){return P(pe,h),v}function He(Ee){return h.restore(),++Z<se.length?b(se[Z]):Y}}}function $(P,B){P.resolveAll&&!o.includes(P)&&o.push(P),P.resolve&&$e(c.events,B,c.events.length-B,P.resolve(c.events.slice(B),c)),P.resolveTo&&(c.events=P.resolveTo(c.events,c))}function H(){const P=g(),B=c.previous,Q=c.currentConstruct,L=c.events.length,v=Array.from(s);return{from:L,restore:Y};function Y(){r=P,c.previous=B,c.currentConstruct=Q,c.events.length=L,s=v,x()}}function x(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Dc(e,n){const t=n.start._index,r=n.start._bufferIndex,i=n.end._index,o=n.end._bufferIndex;let a;if(t===i)a=[e[t].slice(r,o)];else{if(a=e.slice(t,i),r>-1){const s=a[0];typeof s=="string"?a[0]=s.slice(r):a.shift()}o>0&&a.push(e[i].slice(0,o))}return a}function Pc(e,n){let t=-1;const r=[];let i;for(;++t<e.length;){const o=e[t];let a;if(typeof o=="string")a=o;else switch(o){case-5:{a="\r";break}case-4:{a=`
|
|
3
3
|
`;break}case-3:{a=`\r
|
|
4
4
|
`;break}case-2:{a=n?" ":" ";break}case-1:{if(!n&&i)continue;a=" ";break}default:a=String.fromCharCode(o)}i=o===-2,r.push(a)}return r.join("")}function Bc(e){const r={constructs:da([Mc,...(e||{}).extensions||[]]),content:i(Qs),defined:[],document:i(el),flow:i(Ec),lazy:{},string:i(kc),text:i(xc)};return r;function i(o){return a;function a(s){return Lc(r,o,s)}}}function Fc(e){for(;!ma(e););return e}const pi=/[\0\t\n\r]/g;function zc(){let e=1,n="",t=!0,r;return i;function i(o,a,s){const l=[];let c,u,d,f,p;for(o=n+(typeof o=="string"?o.toString():new TextDecoder(a||void 0).decode(o)),d=0,n="",t&&(o.charCodeAt(0)===65279&&d++,t=void 0);d<o.length;){if(pi.lastIndex=d,c=pi.exec(o),f=c&&c.index!==void 0?c.index:o.length,p=o.charCodeAt(f),!c){n=o.slice(d);break}if(p===10&&d===f&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),d<f&&(l.push(o.slice(d,f)),e+=f-d),p){case 0:{l.push(65533),e++;break}case 9:{for(u=Math.ceil(e/4)*4,l.push(-2);e++<u;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}d=f+1}return s&&(r&&l.push(-5),n&&l.push(n),l.push(null)),l}}const Uc=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function $c(e){return e.replace(Uc,Hc)}function Hc(e,n,t){if(n)return n;if(t.charCodeAt(0)===35){const i=t.charCodeAt(1),o=i===120||i===88;return pa(t.slice(o?2:1),o?16:10)}return kr(t)||e}const xa={}.hasOwnProperty;function Gc(e,n,t){return n&&typeof n=="object"&&(t=n,n=void 0),Kc(t)(Fc(Bc(t).document().write(zc()(e,n,!0))))}function Kc(e){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(xn),autolinkProtocol:H,autolinkEmail:H,atxHeading:o(kn),blockQuote:o(Pe),characterEscape:H,characterReference:H,codeFenced:o(ln),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:o(ln,a),codeText:o(Ln,a),codeTextData:H,data:H,codeFlowValue:H,definition:o(Dn),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:o(Pn),hardBreakEscape:o(oe),hardBreakTrailing:o(oe),htmlFlow:o(nn,a),htmlFlowData:H,htmlText:o(nn,a),htmlTextData:H,image:o(tn),label:a,link:o(xn),listItem:o(At),listItemValue:f,listOrdered:o(Bn,d),listUnordered:o(Bn),paragraph:o(vt),reference:b,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:o(kn),strong:o(Jn),thematicBreak:o(et)},exit:{atxHeading:l(),atxHeadingSequence:R,autolink:l(),autolinkEmail:en,autolinkProtocol:De,blockQuote:l(),characterEscapeValue:x,characterReferenceMarkerHexadecimal:He,characterReferenceMarkerNumeric:He,characterReferenceValue:Ee,characterReference:Je,codeFenced:l(y),codeFencedFence:_,codeFencedFenceInfo:p,codeFencedFenceMeta:g,codeFlowValue:x,codeIndented:l(E),codeText:l(v),codeTextData:x,data:x,definition:l(),definitionDestinationString:O,definitionLabelString:N,definitionTitleString:w,emphasis:l(),hardBreakEscape:l(B),hardBreakTrailing:l(B),htmlFlow:l(Q),htmlFlowData:x,htmlText:l(L),htmlTextData:x,image:l(se),label:pe,labelText:Z,lineEnding:P,link:l(Y),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:Ce,resourceDestinationString:h,resourceTitleString:ue,resource:fe,setextHeading:l($),setextHeadingLineSequence:U,setextHeadingText:k,strong:l(),thematicBreak:l()}};wa(n,(e||{}).mdastExtensions||[]);const t={};return r;function r(S){let I={type:"root",children:[]};const W={stack:[I],tokenStack:[],config:n,enter:s,exit:c,buffer:a,resume:u,data:t},te=[];let le=-1;for(;++le<S.length;)if(S[le][1].type==="listOrdered"||S[le][1].type==="listUnordered")if(S[le][0]==="enter")te.push(le);else{const Be=te.pop();le=i(S,Be,le)}for(le=-1;++le<S.length;){const Be=n[S[le][0]];xa.call(Be,S[le][1].type)&&Be[S[le][1].type].call(Object.assign({sliceSerialize:S[le][2].sliceSerialize},W),S[le][1])}if(W.tokenStack.length>0){const Be=W.tokenStack[W.tokenStack.length-1];(Be[1]||fi).call(W,void 0,Be[0])}for(I.position={start:fn(S.length>0?S[0][1].start:{line:1,column:1,offset:0}),end:fn(S.length>0?S[S.length-2][1].end:{line:1,column:1,offset:0})},le=-1;++le<n.transforms.length;)I=n.transforms[le](I)||I;return I}function i(S,I,W){let te=I-1,le=-1,Be=!1,an,Ke,cn,hn;for(;++te<=W;){const Oe=S[te];switch(Oe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Oe[0]==="enter"?le++:le--,hn=void 0;break}case"lineEndingBlank":{Oe[0]==="enter"&&(an&&!hn&&!le&&!cn&&(cn=te),hn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:hn=void 0}if(!le&&Oe[0]==="enter"&&Oe[1].type==="listItemPrefix"||le===-1&&Oe[0]==="exit"&&(Oe[1].type==="listUnordered"||Oe[1].type==="listOrdered")){if(an){let un=te;for(Ke=void 0;un--;){const Fe=S[un];if(Fe[1].type==="lineEnding"||Fe[1].type==="lineEndingBlank"){if(Fe[0]==="exit")continue;Ke&&(S[Ke][1].type="lineEndingBlank",Be=!0),Fe[1].type="lineEnding",Ke=un}else if(!(Fe[1].type==="linePrefix"||Fe[1].type==="blockQuotePrefix"||Fe[1].type==="blockQuotePrefixWhitespace"||Fe[1].type==="blockQuoteMarker"||Fe[1].type==="listItemIndent"))break}cn&&(!Ke||cn<Ke)&&(an._spread=!0),an.end=Object.assign({},Ke?S[Ke][1].start:Oe[1].end),S.splice(Ke||te,0,["exit",an,Oe[2]]),te++,W++}if(Oe[1].type==="listItemPrefix"){const un={type:"listItem",_spread:!1,start:Object.assign({},Oe[1].start),end:void 0};an=un,S.splice(te,0,["enter",un,Oe[2]]),te++,W++,cn=void 0,hn=!0}}}return S[I][1]._spread=Be,W}function o(S,I){return W;function W(te){s.call(this,S(te),te),I&&I.call(this,te)}}function a(){this.stack.push({type:"fragment",children:[]})}function s(S,I,W){this.stack[this.stack.length-1].children.push(S),this.stack.push(S),this.tokenStack.push([I,W||void 0]),S.position={start:fn(I.start),end:void 0}}function l(S){return I;function I(W){S&&S.call(this,W),c.call(this,W)}}function c(S,I){const W=this.stack.pop(),te=this.tokenStack.pop();if(te)te[0].type!==S.type&&(I?I.call(this,S,te[0]):(te[1]||fi).call(this,S,te[0]));else throw new Error("Cannot close `"+S.type+"` ("+Kn({start:S.start,end:S.end})+"): it’s not open");W.position.end=fn(S.end)}function u(){return yr(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(S){if(this.data.expectingFirstListItemValue){const I=this.stack[this.stack.length-2];I.start=Number.parseInt(this.sliceSerialize(S),10),this.data.expectingFirstListItemValue=void 0}}function p(){const S=this.resume(),I=this.stack[this.stack.length-1];I.lang=S}function g(){const S=this.resume(),I=this.stack[this.stack.length-1];I.meta=S}function _(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const S=this.resume(),I=this.stack[this.stack.length-1];I.value=S.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function E(){const S=this.resume(),I=this.stack[this.stack.length-1];I.value=S.replace(/(\r?\n|\r)$/g,"")}function N(S){const I=this.resume(),W=this.stack[this.stack.length-1];W.label=I,W.identifier=Ve(this.sliceSerialize(S)).toLowerCase()}function w(){const S=this.resume(),I=this.stack[this.stack.length-1];I.title=S}function O(){const S=this.resume(),I=this.stack[this.stack.length-1];I.url=S}function R(S){const I=this.stack[this.stack.length-1];if(!I.depth){const W=this.sliceSerialize(S).length;I.depth=W}}function k(){this.data.setextHeadingSlurpLineEnding=!0}function U(S){const I=this.stack[this.stack.length-1];I.depth=this.sliceSerialize(S).codePointAt(0)===61?1:2}function $(){this.data.setextHeadingSlurpLineEnding=void 0}function H(S){const W=this.stack[this.stack.length-1].children;let te=W[W.length-1];(!te||te.type!=="text")&&(te=rn(),te.position={start:fn(S.start),end:void 0},W.push(te)),this.stack.push(te)}function x(S){const I=this.stack.pop();I.value+=this.sliceSerialize(S),I.position.end=fn(S.end)}function P(S){const I=this.stack[this.stack.length-1];if(this.data.atHardBreak){const W=I.children[I.children.length-1];W.position.end=fn(S.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(I.type)&&(H.call(this,S),x.call(this,S))}function B(){this.data.atHardBreak=!0}function Q(){const S=this.resume(),I=this.stack[this.stack.length-1];I.value=S}function L(){const S=this.resume(),I=this.stack[this.stack.length-1];I.value=S}function v(){const S=this.resume(),I=this.stack[this.stack.length-1];I.value=S}function Y(){const S=this.stack[this.stack.length-1];if(this.data.inReference){const I=this.data.referenceType||"shortcut";S.type+="Reference",S.referenceType=I,delete S.url,delete S.title}else delete S.identifier,delete S.label;this.data.referenceType=void 0}function se(){const S=this.stack[this.stack.length-1];if(this.data.inReference){const I=this.data.referenceType||"shortcut";S.type+="Reference",S.referenceType=I,delete S.url,delete S.title}else delete S.identifier,delete S.label;this.data.referenceType=void 0}function Z(S){const I=this.sliceSerialize(S),W=this.stack[this.stack.length-2];W.label=$c(I),W.identifier=Ve(I).toLowerCase()}function pe(){const S=this.stack[this.stack.length-1],I=this.resume(),W=this.stack[this.stack.length-1];if(this.data.inReference=!0,W.type==="link"){const te=S.children;W.children=te}else W.alt=I}function h(){const S=this.resume(),I=this.stack[this.stack.length-1];I.url=S}function ue(){const S=this.resume(),I=this.stack[this.stack.length-1];I.title=S}function fe(){this.data.inReference=void 0}function b(){this.data.referenceType="collapsed"}function Ce(S){const I=this.resume(),W=this.stack[this.stack.length-1];W.label=I,W.identifier=Ve(this.sliceSerialize(S)).toLowerCase(),this.data.referenceType="full"}function He(S){this.data.characterReferenceType=S.type}function Ee(S){const I=this.sliceSerialize(S),W=this.data.characterReferenceType;let te;W?(te=pa(I,W==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):te=kr(I);const le=this.stack[this.stack.length-1];le.value+=te}function Je(S){const I=this.stack.pop();I.position.end=fn(S.end)}function De(S){x.call(this,S);const I=this.stack[this.stack.length-1];I.url=this.sliceSerialize(S)}function en(S){x.call(this,S);const I=this.stack[this.stack.length-1];I.url="mailto:"+this.sliceSerialize(S)}function Pe(){return{type:"blockquote",children:[]}}function ln(){return{type:"code",lang:null,meta:null,value:""}}function Ln(){return{type:"inlineCode",value:""}}function Dn(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Pn(){return{type:"emphasis",children:[]}}function kn(){return{type:"heading",depth:0,children:[]}}function oe(){return{type:"break"}}function nn(){return{type:"html",value:""}}function tn(){return{type:"image",title:null,url:"",alt:null}}function xn(){return{type:"link",title:null,url:"",children:[]}}function Bn(S){return{type:"list",ordered:S.type==="listOrdered",start:null,spread:S._spread,children:[]}}function At(S){return{type:"listItem",spread:S._spread,checked:null,children:[]}}function vt(){return{type:"paragraph",children:[]}}function Jn(){return{type:"strong",children:[]}}function rn(){return{type:"text",value:""}}function et(){return{type:"thematicBreak"}}}function fn(e){return{line:e.line,column:e.column,offset:e.offset}}function wa(e,n){let t=-1;for(;++t<n.length;){const r=n[t];Array.isArray(r)?wa(e,r):qc(e,r)}}function qc(e,n){let t;for(t in n)if(xa.call(n,t))switch(t){case"canContainEols":{const r=n[t];r&&e[t].push(...r);break}case"transforms":{const r=n[t];r&&e[t].push(...r);break}case"enter":case"exit":{const r=n[t];r&&Object.assign(e[t],r);break}}}function fi(e,n){throw e?new Error("Cannot close `"+e.type+"` ("+Kn({start:e.start,end:e.end})+"): a different token (`"+n.type+"`, "+Kn({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+Kn({start:n.start,end:n.end})+") is still open")}function Wc(e){const n=this;n.parser=t;function t(r){return Gc(r,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function Vc(e,n){const t={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(n),!0)};return e.patch(n,t),e.applyData(n,t)}function Yc(e,n){const t={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,t),[e.applyData(n,t),{type:"text",value:`
|