@openparachute/notes-ui 0.1.7 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/.parachute/info +1 -1
  2. package/dist/assets/{Activity-bT-4Y6Hc.js → Activity-1x_gPzIq.js} +1 -1
  3. package/dist/assets/{AddVault-D-ahv-KW.js → AddVault-BFUfH1A-.js} +1 -1
  4. package/dist/assets/Calendar-DKvWPoOn.js +1 -0
  5. package/dist/assets/{Import-CZCd6DVe.js → Import-gYrPbftC.js} +4 -4
  6. package/dist/assets/NoteEditor-BNTbbQiq.js +1 -0
  7. package/dist/assets/NoteNew-DCWZJOnG.js +9 -0
  8. package/dist/assets/{NoteRenderer-B-t3iR2x.js → NoteRenderer-D2nj176-.js} +1 -1
  9. package/dist/assets/NoteView-CyhpDII4.js +3 -0
  10. package/dist/assets/OAuthCallback-C1TfZ2M_.js +1 -0
  11. package/dist/assets/PinArchiveButtons-BuU8vG74.js +1 -0
  12. package/dist/assets/Settings-CZVcMAE6.js +1 -0
  13. package/dist/assets/Tags-DWFKRTXQ.js +1 -0
  14. package/dist/assets/VaultGraph-C8wDjZmL.js +3 -0
  15. package/dist/assets/{Vaults-BfdAmD22.js → Vaults-CqhMGcCD.js} +1 -1
  16. package/dist/assets/{attachment-upload-DELsFKqW.js → attachment-upload-BMjVTZmk.js} +1 -1
  17. package/dist/assets/index-BdyNnuNw.js +70 -0
  18. package/dist/assets/index-C9Y7w-_L.css +1 -0
  19. package/dist/assets/{react-force-graph-2d-BD6TQ9hX.js → react-force-graph-2d-DF72c1gy.js} +1 -1
  20. package/dist/assets/{useAttachmentUploader-TbRdZxIB.js → useAttachmentUploader-DO981Zm0.js} +13 -13
  21. package/dist/index.html +2 -2
  22. package/dist/sw.js +1 -1
  23. package/package.json +2 -2
  24. package/dist/assets/Calendar-CYvQrwCA.js +0 -1
  25. package/dist/assets/NoteEditor-DejkUizg.js +0 -1
  26. package/dist/assets/NoteNew-BgEB8Ff1.js +0 -9
  27. package/dist/assets/NoteView-B0i46Tpn.js +0 -3
  28. package/dist/assets/OAuthCallback-C-st38Zr.js +0 -1
  29. package/dist/assets/PinArchiveButtons-BEmrCa2u.js +0 -1
  30. package/dist/assets/Settings-C04VDzuq.js +0 -1
  31. package/dist/assets/Tags-BcEIUux1.js +0 -1
  32. package/dist/assets/Today-Cz-OTXJ7.js +0 -1
  33. package/dist/assets/VaultGraph-D42L0Y2e.js +0 -3
  34. package/dist/assets/dates-BGZoWpL2.js +0 -1
  35. package/dist/assets/index--Z5j3NQq.css +0 -1
  36. package/dist/assets/index-DQ3LtJxh.js +0 -67
@@ -0,0 +1 @@
1
+ import{M as d,x as e,ap as D,a5 as V,V as C,i as _,ad as z,at as O,aa as q,N as K,L as R,a9 as W,aq as Y,h as H,Q as P,g as Q,C as Z}from"./index-BdyNnuNw.js";import{A as G}from"./attachment-upload-BMjVTZmk.js";import{u as J,C as X,A as ee,a as te}from"./useAttachmentUploader-DO981Zm0.js";import{P as ne,D as se}from"./PinArchiveButtons-BuU8vG74.js";import{b as re,N as ae}from"./NoteRenderer-D2nj176-.js";const oe=250;function de({noteId:t,attachment:s}){const[l,a]=d.useState(!1),o=ce(s);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:s,label:o,onClose:()=>a(!1)}):null]})}function ie({noteId:t,attachment:s,label:l,onClose:a}){const o=D(i=>i.push),m=V(),[n,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(()=>{!n||m.isPending||(p(null),m.mutate({noteId:t,attachmentId:s.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")}}))},[n,s.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:!n||m.isPending,className:"btn btn-danger-solid btn-touch",children:m.isPending?"Removing…":"Remove"})]})]})})}function ce(t){if(t.filename)return t.filename;if(t.path){const s=t.path.split("/").pop();return s||t.path}return t.id}function ye(){const{id:t}=z(),s=t?decodeURIComponent(t):void 0,l=O(o=>o.getActiveVault()),a=q(s);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:s?`/n/${encodeURIComponent(s)}`:"/",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:s??""})]}):e.jsx(K,{to:"/",replace:!0})}function S(t){return{content:t.content??"",path:t.path??"",tags:[...t.tags??[]]}}function le({note:t}){const s=W(),l=D(r=>r.push),a=d.useMemo(()=>re(t),[t]),[o,m]=d.useState(()=>S(t)),[n,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=Y(t.id),k=d.useRef(t),E=d.useRef(null),j=J({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=n.content!==o.content||n.path!==o.path||!pe(n.tags,o.tags),A=d.useCallback(()=>{if(!u||v.isPending)return;const r={};n.content!==o.content&&(r.content=n.content),n.path!==o.path&&(r.path=n.path);const c=be(o.tags,n.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&&s(`/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,n,u,v,s,t.id]),$=d.useCallback(()=>{u&&confirm("Discard all edits and revert to last saved version?")&&(h(o),b(null),g(null))},[o,u]),T=d.useCallback(()=>{u&&!confirm("Discard unsaved changes?")||s(`/n/${encodeURIComponent(t.id)}`)},[u,s,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 B=n.path!==o.path,M=r=>{const c=Z(r);c&&(n.tags.includes(c)||(h(f=>({...f,tags:[...f.tags,c]})),p("")))},U=r=>{h(c=>({...c,tags:c.tags.filter(f=>f!==r)}))},F=n.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 ",P(t.updatedAt)]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(ne,{note:t}),e.jsx(se,{note:t}),e.jsx("span",{className:"mx-1 h-5 w-px bg-border","aria-hidden":"true"}),e.jsx("button",{type:"button",onClick:$,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:T,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-[--color-on-accent] 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(Q,{tags:n.tags,input:w,onInputChange:p,onAdd:M,onRemove:U}),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:"Title"}),e.jsx("input",{type:"text",value:n.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)"})]}),B?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-[--color-on-accent]":"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:n.content,onChange:r=>h(c=>({...c,content:r})),onSave:A,onCancel:T,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:n.path,content:F},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:s,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}),s.length>0?e.jsx("ul",{className:"mt-3 space-y-1 text-sm",children:s.map(n=>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:n.path??n.id,children:n.filename??n.path??n.id}),e.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[n.mimeType?e.jsx("span",{className:"text-fg-dim",children:n.mimeType}):null,e.jsx(de,{noteId:t,attachment:n})]})]},n.id))}):null]})}function ue({conflict:t,onReload:s,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 ${P(t.currentUpdatedAt)}.`:""]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx("button",{type:"button",onClick:s,className:"rounded-md bg-accent px-3 py-1.5 text-sm font-medium text-[--color-on-accent] 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:"/all",className:"text-sm text-accent hover:underline",children:"Back to all notes"})]})}function fe({error:t}){const s=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:s?"Session expired":"Could not load note"}),e.jsx("p",{className:"mb-4 text-sm text-fg-muted",children:t.message}),s?e.jsx(R,{to:"/add",className:"inline-block rounded-md bg-accent px-4 py-2 text-sm font-medium text-[--color-on-accent] hover:bg-accent-hover",children:"Reconnect vault"}):null]})}function pe(t,s){if(t.length!==s.length)return!1;const l=new Set(t);for(const a of s)if(!l.has(a))return!1;return!0}function be(t,s){const l=new Set(t),a=new Set(s),o=s.filter(n=>!l.has(n)),m=t.filter(n=>!a.has(n));return{add:o,remove:m}}export{ye as NoteEditor};
@@ -0,0 +1,9 @@
1
+ import{C as Y,M as d,at as ee,a9 as te,ap as re,a4 as ne,a7 as se,ak as ae,am as oe,a1 as ie,x as r,N as ce,V as de,A as le,B as ue,s as me,r as U,n as pe,L as fe,g as ge}from"./index-BdyNnuNw.js";import{A as he}from"./attachment-upload-BMjVTZmk.js";import{u as xe,C as be,A as ve,a as ye}from"./useAttachmentUploader-DO981Zm0.js";import{b as we,N as ke}from"./NoteRenderer-D2nj176-.js";const je=/(?:^|\s)#([a-zA-Z][\w-]*)/g;function z(e){const t=new Set;for(const i of e.matchAll(je)){const o=Y(i[1]??"");o&&t.add(o)}return[...t]}const Ne=["audio/webm;codecs=opus","audio/mp4","audio/ogg;codecs=opus"];function Re(e=Ne){if(typeof MediaRecorder>"u")return null;for(const t of e)if(MediaRecorder.isTypeSupported(t))return t;return null}function Se(e){return e.startsWith("audio/webm")?"webm":e.startsWith("audio/mp4")?"m4a":e.startsWith("audio/ogg")?"ogg":e.startsWith("audio/wav")?"wav":"bin"}function Ae(e){const t=e.now??(()=>Date.now()),i=e.MediaRecorderCtor??MediaRecorder,o=new i(e.stream,{mimeType:e.mimeType}),c=[];let n="idle",m=0,p=0;o.ondataavailable=g=>{g.data&&g.data.size>0&&c.push(g.data)};const f=()=>{for(const g of e.stream.getTracks())g.stop()};return{get state(){return n},get mimeType(){return e.mimeType},start(){if(n!=="idle")throw new Error(`Cannot start from ${n}`);o.start(),m=t(),n="recording"},pause(){n==="recording"&&(o.pause(),p+=t()-m,n="paused")},resume(){n==="paused"&&(o.resume(),m=t(),n="recording")},async stop(){if(n==="idle"||n==="stopped")throw new Error(`Cannot stop from ${n}`);n==="recording"&&(p+=t()-m);const g=new Promise(u=>{o.onstop=async()=>{const s=await Ce(c);u({data:s,mimeType:e.mimeType,durationMs:p})}});return o.stop(),n="stopped",f(),g},cancel(){if(n==="recording"||n==="paused")try{o.stop()}catch{}n="stopped",c.length=0,f()}}}async function Ee(e){const t=e;return typeof t.arrayBuffer=="function"?t.arrayBuffer():new Promise((i,o)=>{const c=new FileReader;c.onload=()=>i(c.result),c.onerror=()=>o(c.error??new Error("FileReader error")),c.readAsArrayBuffer(e)})}async function Ce(e){if(e.length===0)return new ArrayBuffer(0);const t=await Promise.all(e.map(n=>Ee(n))),i=t.reduce((n,m)=>n+m.byteLength,0),o=new Uint8Array(i);let c=0;for(const n of t)o.set(new Uint8Array(n),c),c+=n.byteLength;return o.buffer}async function Te(){var e;if(typeof navigator>"u"||!((e=navigator.mediaDevices)!=null&&e.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 i=new Error(t instanceof Error?t.message:"Microphone permission denied."),o=t instanceof DOMException?t.name:"";throw i.kind=o==="NotFoundError"||o==="OverconstrainedError"?"no-device":"permission-denied",i}}function Me(e,t=new Date){return`memo-${t.toISOString().replace(/[:.]/g,"-").replace(/Z$/,"")}.${Se(e)}`}function De(e=new Date){const t=e.getFullYear(),i=String(e.getMonth()+1).padStart(2,"0"),o=String(e.getDate()).padStart(2,"0"),c=String(e.getHours()).padStart(2,"0"),n=String(e.getMinutes()).padStart(2,"0"),m=String(e.getSeconds()).padStart(2,"0");return`Notes/${t}/${i}-${o}/${c}-${n}-${m}`}function $e(){const[e,t]=d.useState({kind:"idle"}),[i,o]=d.useState(0),c=d.useRef(null),n=d.useRef(null);d.useEffect(()=>{if(e.kind!=="recording")return;const u=setInterval(()=>o(Date.now()-e.startedAt),250);return()=>clearInterval(u)},[e]),d.useEffect(()=>()=>{n.current&&URL.revokeObjectURL(n.current)},[]);const m=d.useCallback(async()=>{if(!(e.kind==="recording"||e.kind==="requesting")){t({kind:"requesting"});try{const u=Re();if(!u){t({kind:"denied",message:"This browser can't record audio in a format we can save."});return}const s=await Te(),x=Ae({stream:s,mimeType:u});c.current=x,x.start(),o(0),t({kind:"recording",startedAt:Date.now()})}catch(u){const s=u,x=s.kind==="permission-denied"?"Microphone access was denied. Update your browser's site settings to record.":s.kind==="no-device"?"No microphone was found on this device.":s instanceof Error?s.message:"Microphone is not available in this browser.";t({kind:"denied",message:x})}}},[e]),p=d.useCallback(async()=>{const u=c.current;if(!(!u||e.kind!=="recording"))try{const s=await u.stop();c.current=null;const x=new Blob([s.data],{type:s.mimeType}),A=URL.createObjectURL(x);n.current&&URL.revokeObjectURL(n.current),n.current=A,t({kind:"have-audio",data:s.data,mimeType:s.mimeType,url:A,durationMs:s.durationMs})}catch(s){console.warn(s instanceof Error?`Recording failed: ${s.message}`:"Recording failed."),t({kind:"idle"})}},[e]),f=d.useCallback(()=>{n.current&&(URL.revokeObjectURL(n.current),n.current=null),t({kind:"idle"}),o(0)},[]),g=d.useCallback(()=>{f()},[f]);return d.useEffect(()=>{if(e.kind!=="recording")return;const u=()=>{p()};return window.addEventListener("pointerup",u),window.addEventListener("pointercancel",u),()=>{window.removeEventListener("pointerup",u),window.removeEventListener("pointercancel",u)}},[e,p]),{phase:e,elapsedMs:i,startRecording:m,stopRecording:p,discardAudio:f,reset:g}}const Ie={content:"",path:"",tags:[]};function Be(){const e=ee(a=>a.getActiveVault()),t=te(),i=re(a=>a.push),o=ne(),c=se(),{db:n,blobStore:m,engine:p}=ae(),{roles:f}=oe((e==null?void 0:e.id)??null),g=ie(),u=d.useRef(De()),[s,x]=d.useState(()=>({...Ie,path:u.current})),[A,_]=d.useState(""),[B,N]=d.useState(null),[E,Z]=d.useState([]),[G,q]=d.useState(!1),I=d.useRef(null),v=$e(),y=xe({noteId:null,onInsert:a=>{I.current?I.current.insertAtCursor(a):x(l=>({...l,content:`${l.content}${a}`}))},onStaged:a=>Z(l=>[...l,a]),onError:a=>i(a,"error")});if(!e)return r.jsx(ce,{to:"/",replace:!0});const C=v.phase.kind==="have-audio",T=s.content.trim().length>0,M=s.content.length>0||s.path!==u.current||s.tags.length>0||C,R=s.path.trim().length>0&&(T||C),w=o.isPending||G,O=d.useCallback(()=>{if(!R||w)return;const a=s.tags,l=z(s.content),b=Array.from(new Set([...a,...l].filter(h=>h.length>0))),D={content:s.content,path:s.path.trim()};b.length&&(D.tags=b),N(null),o.mutate(D,{onSuccess:async h=>{for(const k of E)try{await c.mutateAsync({noteId:h.id,path:k.path,mimeType:k.mimeType})}catch($){const S=$ instanceof Error?$.message:"Link failed";i(`Failed to attach ${k.filename}: ${S}`,"error")}i(`Created ${h.path??h.id}`,"success"),t(`/n/${encodeURIComponent(h.id)}`)},onError:h=>{h instanceof de?N("Session expired. Reconnect to save."):N(h instanceof Error?`${h.message} — if the path is taken, try a different one.`:"Create failed")}})},[s,R,c,o,t,w,i,E]),V=d.useCallback(async()=>{if(!R||w||v.phase.kind!=="have-audio")return;if(!n||!m){i("Sync queue not ready — try again in a moment.","error");return}N(null),q(!0);const a=v.phase,l=s.path.trim(),b=s.tags,D=z(s.content),h=Array.from(new Set([f.captureVoice,...b,...D].filter(j=>j.length>0)));T&&h.push(f.captureText);const k=Array.from(new Set(h)),$=new Date,S=Me(a.mimeType,$),L=le(),P=ue(),X=T?`${s.content.trim()}
2
+
3
+ _Transcript pending._
4
+
5
+ ![[${S}]]
6
+ `:`_Transcript pending._
7
+
8
+ ![[${S}]]
9
+ `;g&&me(e.id,g);try{await m.put(L,a.data,a.mimeType,e.id),await U(n,{kind:"create-note",localId:P,payload:{content:X,path:l,...k.length?{tags:k}:{}}},{vaultId:e.id}),await U(n,{kind:"upload-attachment",blobId:L,filename:S,mimeType:a.mimeType},{vaultId:e.id}),await U(n,{kind:"link-attachment",noteId:P,pathRef:pe(L),mimeType:a.mimeType,transcribe:!0},{vaultId:e.id}),p==null||p.runOnce(),i("Captured — syncing audio.","success"),v.discardAudio(),t(`/n/${encodeURIComponent(P)}`)}catch(j){i(j instanceof Error?`Capture failed: ${j.message}`:"Capture failed.","error"),N(j instanceof Error?j.message:"Capture failed")}finally{q(!1)}},[e,m,g,n,s,p,T,R,t,w,i,f.captureText,f.captureVoice,v]),W=d.useCallback(()=>{C?V():O()},[C,O,V]),H=d.useCallback(()=>{M&&!confirm("Discard this draft?")||(v.discardAudio(),t("/"))},[M,t,v]);d.useEffect(()=>{if(!M)return;const a=l=>{l.preventDefault(),l.returnValue=""};return window.addEventListener("beforeunload",a),()=>window.removeEventListener("beforeunload",a)},[M]);const J=a=>{const l=Y(a);!l||s.tags.includes(l)||(x(b=>({...b,tags:[...b.tags,l]})),_(""))},K=a=>{x(l=>({...l,tags:l.tags.filter(b=>b!==a)}))},Q=we({id:"__new__",createdAt:new Date().toISOString()});return r.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-5 md:px-6 md:py-8",children:[r.jsx("nav",{className:"mb-4 text-sm text-fg-dim",children:r.jsx(fe,{to:"/all",className:"hover:text-accent",children:"← All notes"})}),r.jsxs("article",{children:[r.jsxs("header",{className:"mb-4 border-b border-border pb-4",children:[r.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[r.jsx("div",{className:"flex items-center gap-2 text-sm",children:r.jsx("span",{className:"text-xs uppercase tracking-wider text-fg-dim",children:"New note"})}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{type:"button",onClick:H,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"}),r.jsx("button",{type:"button",onClick:W,disabled:!R||w,className:"min-h-11 rounded-md bg-accent px-4 py-1.5 text-sm font-medium text-[--color-on-accent] hover:bg-accent-hover disabled:opacity-40",title:"Create (⌘S)",children:w?"Creating…":"Create"})]})]}),r.jsxs("div",{className:"mt-3 flex flex-col gap-2",children:[r.jsxs("label",{className:"flex items-baseline gap-3 text-sm",children:[r.jsx("span",{className:"shrink-0 text-xs uppercase tracking-wider text-fg-dim",children:"Title"}),r.jsx("input",{type:"text",value:s.path,onChange:a=>x(l=>({...l,path:a.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"})]}),r.jsx(ge,{tags:s.tags,input:A,onInputChange:_,onAdd:J,onRemove:K})]})]}),B?r.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:B}):null,r.jsx(Le,{voice:v}),r.jsxs("div",{className:"grid min-h-[60vh] gap-4 lg:grid-cols-2",children:[r.jsx(he,{onDropFiles:y.start,className:"min-w-0 rounded-md border border-border bg-card",hint:"Images, audio, webm video",children:r.jsx(be,{ref:I,value:s.content,onChange:a=>x(l=>({...l,content:a})),onSave:W,onCancel:H,onPasteFile:a=>(y.start(a),!0)})}),r.jsx("div",{className:"min-w-0 overflow-auto rounded-md border border-border bg-card p-4",children:s.content.trim()?r.jsx(ke,{note:{path:s.path,content:s.content},resolve:Q}):r.jsx("p",{className:"text-sm text-fg-dim",children:"Preview appears here as you type."})})]}),r.jsxs("section",{className:"mt-6 border-t border-border pt-4",children:[r.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[r.jsx("h2",{className:"font-serif text-lg",children:"Attachments"}),r.jsx(ve,{onPickFiles:y.start})]}),r.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."," ",r.jsx("a",{href:"https://github.com/ParachuteComputer/parachute-vault/issues/127",target:"_blank",rel:"noreferrer",className:"underline",children:"PDF + mp4 coming"}),"."]}),r.jsx(ye,{uploads:y.uploads,onCancel:y.cancel,onDismiss:y.dismiss}),E.length>0?r.jsx("ul",{className:"mt-3 space-y-1 text-sm",children:E.map(a=>r.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:[r.jsx("span",{className:"truncate",children:a.filename}),r.jsx("span",{className:"shrink-0 text-fg-dim",children:"staged"})]},a.path))}):null]})]})]})}function Le({voice:e}){const{phase:t,elapsedMs:i,startRecording:o,stopRecording:c,discardAudio:n}=e,m=t.kind==="recording",p=t.kind==="requesting";return t.kind==="have-audio"?r.jsxs("div",{className:"mb-4 flex flex-col gap-2 rounded-md border border-accent/30 bg-accent/5 p-3",children:[r.jsxs("div",{className:"flex items-center justify-between gap-3",children:[r.jsxs("span",{className:"text-sm text-fg-muted",children:["🎙 Recorded ",F(t.durationMs)]}),r.jsx("button",{type:"button",onClick:n,className:"text-xs text-fg-dim hover:text-red-400",children:"Discard"})]}),r.jsx("audio",{controls:!0,src:t.url,className:"w-full",children:r.jsx("track",{kind:"captions"})}),r.jsx("p",{className:"text-xs text-fg-dim",children:"Transcript will be appended once your vault processes it. Save to commit."})]}):r.jsxs("div",{className:"mb-4 flex flex-wrap items-center justify-between gap-3 rounded-md border border-border bg-card/60 p-3",children:[r.jsx("div",{className:"text-xs text-fg-dim",children:m?"Recording — release or click Stop to finish.":p?"Requesting microphone…":"Add a voice memo to this note. Audio gets transcribed and appended."}),m?r.jsxs("button",{type:"button",onPointerDown:f=>{f.preventDefault(),c()},onClick:()=>void c(),"aria-label":`Recording — ${F(i)} — stop`,"aria-pressed":"true",className:"flex min-h-11 items-center gap-2 rounded-full border border-red-500/40 bg-red-500/10 px-4 py-2 text-sm font-medium text-red-400",children:[r.jsx("span",{"aria-hidden":"true",className:"animate-pulse",children:"🎙"}),r.jsxs("span",{children:["Stop ",F(i)]})]}):r.jsxs("button",{type:"button",onPointerDown:f=>{f.preventDefault(),o()},onClick:()=>void o(),"aria-label":"Record voice memo",disabled:p,className:"flex min-h-11 items-center gap-2 rounded-full border border-accent/30 bg-accent/10 px-4 py-2 text-sm font-medium text-accent hover:bg-accent/15 disabled:opacity-40",children:[r.jsx("span",{"aria-hidden":"true",children:"🎙"}),r.jsx("span",{children:p?"Requesting…":"Record"})]}),t.kind==="denied"?r.jsx("p",{className:"basis-full rounded-md border border-red-500/30 bg-red-500/5 px-3 py-2 text-xs text-red-400",children:t.message}):null]})}function F(e){const t=Math.floor(e/1e3),i=Math.floor(t/60),o=t%60;return`${String(i).padStart(2,"0")}:${String(o).padStart(2,"0")}`}export{Be as NoteNew};
@@ -1,4 +1,4 @@
1
- import{t as fr,v as H,B as gn,K as es,L as Wr}from"./index-DQ3LtJxh.js";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 Xi(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 ee=yn(),xe=yn(),tr=yn(),A=yn(),be=yn(),In=yn(),Ue=yn();function yn(){return 2**++ss}const rr=Object.freeze(Object.defineProperty({__proto__:null,boolean:ee,booleanish:xe,commaOrSpaceSeparated:Ue,commaSeparated:In,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:In,acceptCharset:be,accessKey:be,action:null,allow:null,allowFullScreen:ee,allowPaymentRequest:ee,allowUserMedia:ee,alt:null,as:null,async:ee,autoCapitalize:null,autoComplete:be,autoFocus:ee,autoPlay:ee,blocking:be,capture:null,charSet:null,checked:ee,cite:null,className:be,cols:A,colSpan:null,content:null,contentEditable:xe,controls:ee,controlsList:be,coords:A|In,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ee,defer:ee,dir:null,dirName:null,disabled:ee,download:tr,draggable:xe,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ee,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:ee,inputMode:null,integrity:null,is:null,isMap:ee,itemId:null,itemProp:be,itemRef:be,itemScope:ee,itemType:be,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ee,low:A,manifest:null,max:null,maxLength:A,media:null,method:null,min:null,minLength:A,multiple:ee,muted:ee,name:null,nonce:null,noModule:ee,noValidate:ee,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:ee,optimum:A,pattern:null,ping:be,placeholder:null,playsInline:ee,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ee,referrerPolicy:null,rel:be,required:ee,reversed:ee,rows:A,rowSpan:A,sandbox:be,scope:null,scoped:ee,seamless:ee,selected:ee,shadowRootClonable:ee,shadowRootDelegatesFocus:ee,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:ee,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:ee,declare:ee,event:null,face:null,frame:null,frameBorder:null,hSpace:A,leftMargin:A,link:null,longDesc:null,lowSrc:null,marginHeight:A,marginWidth:A,noResize:ee,noHref:ee,noShade:ee,noWrap:ee,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:ee,disableRemotePlayback:ee,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:ee,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:In,g2:In,glyphName:In,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,jr=/-[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(jr,ms);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=n.slice(4);if(!jr.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 ms(e){return e.charAt(1).toUpperCase()}const hs=Xi([Qi,ls,na,ta,ra],"html"),mr=Xi([Qi,cs,na,ta,ra],"svg");function bs(e){return e.join(" ").trim()}var Nn={},Pt,Xr;function Es(){if(Xr)return Pt;Xr=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{v as fr,x as H,M as gn,a1 as es,L as Wr}from"./index-BdyNnuNw.js";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 Xi(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 ee=yn(),xe=yn(),tr=yn(),A=yn(),be=yn(),In=yn(),Ue=yn();function yn(){return 2**++ss}const rr=Object.freeze(Object.defineProperty({__proto__:null,boolean:ee,booleanish:xe,commaOrSpaceSeparated:Ue,commaSeparated:In,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:In,acceptCharset:be,accessKey:be,action:null,allow:null,allowFullScreen:ee,allowPaymentRequest:ee,allowUserMedia:ee,alt:null,as:null,async:ee,autoCapitalize:null,autoComplete:be,autoFocus:ee,autoPlay:ee,blocking:be,capture:null,charSet:null,checked:ee,cite:null,className:be,cols:A,colSpan:null,content:null,contentEditable:xe,controls:ee,controlsList:be,coords:A|In,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ee,defer:ee,dir:null,dirName:null,disabled:ee,download:tr,draggable:xe,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ee,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:ee,inputMode:null,integrity:null,is:null,isMap:ee,itemId:null,itemProp:be,itemRef:be,itemScope:ee,itemType:be,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ee,low:A,manifest:null,max:null,maxLength:A,media:null,method:null,min:null,minLength:A,multiple:ee,muted:ee,name:null,nonce:null,noModule:ee,noValidate:ee,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:ee,optimum:A,pattern:null,ping:be,placeholder:null,playsInline:ee,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ee,referrerPolicy:null,rel:be,required:ee,reversed:ee,rows:A,rowSpan:A,sandbox:be,scope:null,scoped:ee,seamless:ee,selected:ee,shadowRootClonable:ee,shadowRootDelegatesFocus:ee,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:ee,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:ee,declare:ee,event:null,face:null,frame:null,frameBorder:null,hSpace:A,leftMargin:A,link:null,longDesc:null,lowSrc:null,marginHeight:A,marginWidth:A,noResize:ee,noHref:ee,noShade:ee,noWrap:ee,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:ee,disableRemotePlayback:ee,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:ee,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:In,g2:In,glyphName:In,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,jr=/-[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(jr,ms);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=n.slice(4);if(!jr.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 ms(e){return e.charAt(1).toUpperCase()}const hs=Xi([Qi,ls,na,ta,ra],"html"),mr=Xi([Qi,cs,na,ta,ra],"svg");function bs(e){return e.join(" ").trim()}var Nn={},Pt,Xr;function Es(){if(Xr)return Pt;Xr=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 S=1,w=1;function I(L){var v=L.match(n);v&&(S+=v.length);var Z=L.lastIndexOf(l);w=~Z?L.length-Z:w+L.length}function R(){var L={line:S,column:w};return function(v){return v.position=new k(L),G(),v}}function k(L){this.start=L,this.end={line:S,column:w},this.source=E.source}k.prototype.content=y;function U(L){var v=new Error(E.source+":"+S+":"+w+": "+L);if(v.reason=L,v.filename=E.source,v.line=S,v.column=w,v.source=y,!E.silent)throw v}function $(L){var v=L.exec(y);if(v){var Z=v[0];return I(Z),y=y.slice(Z.length),v}}function G(){$(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 Z=y.slice(2,v-2);return w+=2,I(Z),y=y.slice(v),w+=2,L({type:f,comment:Z})}}function B(){var L=R(),v=$(r);if(v){if(P(),!$(i))return U("property missing ':'");var Z=$(o),se=L({type:p,property:_(v[0].replace(e,d)),value:Z?_(Z[0].replace(e,d)):d});return $(a),se}}function J(){var L=[];x(L);for(var v;v=B();)v!==!1&&(L.push(v),x(L));return L}return G(),J()}function _(y){return y?y.replace(s,d):d}return Pt=g,Pt}var Qr;function _s(){if(Qr)return Nn;Qr=1;var e=Nn&&Nn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Nn,"__esModule",{value:!0}),Nn.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 Nn}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"),hr=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=hr(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"?mr:hs,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 Is(e,n,t);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return Os(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 Is(e,n,t){const r=e.schema;let i=r;n.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=mr,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 Os(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=mr,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=hr(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=mn(/[A-Za-z]/),Ae=mn(/[\dA-Za-z]/),Zs=mn(/[#-'*+\--9=?A-Z^-~]/);function ht(e){return e!==null&&(e<32||e===127)}const ar=mn(/\d/),js=mn(/[\dA-Fa-f]/),Xs=mn(/[!-/:-@[-`{-~]/);function W(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=mn(new RegExp("\\p{P}|\\p{S}","u")),_n=mn(/\s/);function mn(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 W(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 I=t[r];return n.containerState=I[1],e.attempt(I[0].continuation,l,c)(w)}return c(w)}function l(w){if(r++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,i&&S();const I=n.events.length;let R=I,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=I;for(;U<n.events.length;)n.events[U][1].end={...k},U++;return $e(n.events,R+1,0,n.events.slice(I)),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&&S(),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&&S(),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 W(w)?(e.consume(w),y(e.exit("chunkFlow")),r=0,n.interrupt=void 0,s):(e.consume(w),_)}function y(w,I){const R=n.sliceStream(w);if(I&&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,G,x;for(;$--;)if(n.events[$][0]==="exit"&&n.events[$][1].type==="chunkFlow"){if(G){x=n.events[$][1].end;break}G=!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 I=t.length;for(;I-- >w;){const R=t[I];n.containerState=R[1],R[0].exit.call(n,e)}t.length=w}function S(){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 On(e){if(e===null||ge(e)||_n(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=On(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=On(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||ht(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 jn={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||W(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 Xs(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):t(o)}}const ma={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=js,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||W(k)?(e.exit("codeFencedFence"),r.interrupt?n(k):e.check(li,_,I)(k)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(k))}function f(k){return k===null||W(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||W(k)?d(k):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(k))}function g(k){return k===null||W(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,I,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,S,"linePrefix",o+1)(k):S(k)}function S(k){return k===null||W(k)?e.check(li,_,I)(k):(e.enter("codeFlowValue"),w(k))}function w(k){return k===null||W(k)?(e.exit("codeFlowValue"),S(k)):(e.consume(k),w)}function I(k){return e.exit("codeFenced"),n(k)}function R(k,U,$){let G=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"),J(v)):$(v)}function J(v){return v===s?(G++,k.consume(v),J):G>=a?(k.exit("codeFencedFenceSequence"),re(v)?ae(k,L,"whitespace")(v):L(v)):$(v)}function L(v){return v===null||W(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:hl},ml={partial:!0,tokenize:bl};function hl(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):W(c)?e.attempt(ml,a,l)(c):(e.enter("codeFlowValue"),s(c))}function s(c){return c===null||W(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):W(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):W(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)):W(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||W(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 ha(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]),S=o.pop();l.push([S,S+E.length-1]),e.splice(S,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 ha(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):W(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||W(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||ht(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||W(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||ht(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):W(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||W(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):W(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||W(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 W(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:Ol},Il={partial:!0,tokenize:Rl};function Ol(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(Il,d,d)(p)}function d(p){return re(p)?ae(e,f,"whitespace")(p):f(p)}function f(p){return p===null||W(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||W(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 W(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||W(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:m):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:m):t(b)}function p(b){return b===45?(e.consume(b),r.interrupt?n:m):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?S(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 S(b){return re(b)?(e.consume(b),S):x(b)}function w(b){return b===47?(e.consume(b),x):b===58||b===95||Re(b)?(e.consume(b),I):re(b)?(e.consume(b),w):x(b)}function I(b){return b===45||b===46||b===58||b===95||Ae(b)?(e.consume(b),I):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,G):b===null||W(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 G(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||W(b)?B(b):re(b)?(e.consume(b),P):t(b)}function B(b){return b===45&&i===2?(e.consume(b),Z):b===60&&i===1?(e.consume(b),se):b===62&&i===4?(e.consume(b),ue):b===63&&i===3?(e.consume(b),m):b===93&&i===5?(e.consume(b),pe):W(b)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Ul,fe,J)(b)):b===null||W(b)?(e.exit("htmlFlowData"),J(b)):(e.consume(b),B)}function J(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||W(b)?J(b):(e.enter("htmlFlowData"),B(b))}function Z(b){return b===45?(e.consume(b),m):B(b)}function se(b){return b===47?(e.consume(b),a="",j):B(b)}function j(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),j):B(b)}function pe(b){return b===93?(e.consume(b),m):B(b)}function m(b){return b===62?(e.consume(b),ue):b===45&&i===2?(e.consume(b),m):B(b)}function ue(b){return b===null||W(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 W(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(jn,n,t)}}const Wl={name:"htmlText",tokenize:Vl};function Vl(e,n,t){const r=this;let i,o,a;return s;function s(m){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(m),l}function l(m){return m===33?(e.consume(m),c):m===47?(e.consume(m),R):m===63?(e.consume(m),w):Re(m)?(e.consume(m),$):t(m)}function c(m){return m===45?(e.consume(m),u):m===91?(e.consume(m),o=0,g):Re(m)?(e.consume(m),S):t(m)}function u(m){return m===45?(e.consume(m),p):t(m)}function d(m){return m===null?t(m):m===45?(e.consume(m),f):W(m)?(a=d,se(m)):(e.consume(m),d)}function f(m){return m===45?(e.consume(m),p):d(m)}function p(m){return m===62?Z(m):m===45?f(m):d(m)}function g(m){const ue="CDATA[";return m===ue.charCodeAt(o++)?(e.consume(m),o===ue.length?_:g):t(m)}function _(m){return m===null?t(m):m===93?(e.consume(m),y):W(m)?(a=_,se(m)):(e.consume(m),_)}function y(m){return m===93?(e.consume(m),E):_(m)}function E(m){return m===62?Z(m):m===93?(e.consume(m),E):_(m)}function S(m){return m===null||m===62?Z(m):W(m)?(a=S,se(m)):(e.consume(m),S)}function w(m){return m===null?t(m):m===63?(e.consume(m),I):W(m)?(a=w,se(m)):(e.consume(m),w)}function I(m){return m===62?Z(m):w(m)}function R(m){return Re(m)?(e.consume(m),k):t(m)}function k(m){return m===45||Ae(m)?(e.consume(m),k):U(m)}function U(m){return W(m)?(a=U,se(m)):re(m)?(e.consume(m),U):Z(m)}function $(m){return m===45||Ae(m)?(e.consume(m),$):m===47||m===62||ge(m)?G(m):t(m)}function G(m){return m===47?(e.consume(m),Z):m===58||m===95||Re(m)?(e.consume(m),x):W(m)?(a=G,se(m)):re(m)?(e.consume(m),G):Z(m)}function x(m){return m===45||m===46||m===58||m===95||Ae(m)?(e.consume(m),x):P(m)}function P(m){return m===61?(e.consume(m),B):W(m)?(a=P,se(m)):re(m)?(e.consume(m),P):G(m)}function B(m){return m===null||m===60||m===61||m===62||m===96?t(m):m===34||m===39?(e.consume(m),i=m,J):W(m)?(a=B,se(m)):re(m)?(e.consume(m),B):(e.consume(m),L)}function J(m){return m===i?(e.consume(m),i=void 0,v):m===null?t(m):W(m)?(a=J,se(m)):(e.consume(m),J)}function L(m){return m===null||m===34||m===39||m===60||m===61||m===96?t(m):m===47||m===62||ge(m)?G(m):(e.consume(m),L)}function v(m){return m===47||m===62||ge(m)?G(m):t(m)}function Z(m){return m===62?(e.consume(m),e.exit("htmlTextData"),e.exit("htmlText"),n):t(m)}function se(m){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),j}function j(m){return re(m)?ae(e,pe,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m):pe(m)}function pe(m){return e.enter("htmlTextData"),a(m)}}const xr={name:"labelEnd",resolveAll:Xl,resolveTo:Ql,tokenize:Jl},Yl={tokenize:ec},Zl={tokenize:nc},jl={tokenize:tc};function Xl(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(jl,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 mt={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||W(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:mc},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(mt,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(jn,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(jn,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 mc(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:hc,tokenize:bc};function hc(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||W(c)?(e.exit("setextHeadingLine"),n(c)):t(c)}}const Ec={tokenize:_c};function _c(e){const n=this,t=e.attempt(jn,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:mt,45:[di,mt],60:zl,61:di,95:mt,96:ci,126:ci},vc={38:ma,92:ga},Cc={[-5]:zt,[-4]:zt,[-3]:zt,33:rc,38:ma,42:or,60:[al,Wl],91:ac,92:[Ml,ga],93:xr,95:or,96:El},Ic={null:[or,yc]},Oc={null:[42,95]},Rc={null:[]},Mc=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Oc,contentInitial:Nc,disable:Rc,document:Sc,flow:Ac,flowInitial:Tc,insideSpan:Ic,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:S,enter:w,exit:I,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:J,column:L,offset:v}=r;return{_bufferIndex:P,_index:B,line:J,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 S(P){W(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 J=B||{};return J.type=P,J.start=g(),c.events.push(["enter",J,c]),s.push(J),J}function I(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 J;function J(L,v,Z){let se,j,pe,m;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,j=0,Ee.length===0?Z:b(Ee[j])}function b(Ee){return Je;function Je(De){return m=G(),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,m),v}function He(Ee){return m.restore(),++j<se.length?b(se[j]):Z}}}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 G(){const P=g(),B=c.previous,J=c.currentConstruct,L=c.events.length,v=Array.from(s);return{from:L,restore:Z};function Z(){r=P,c.previous=B,c.currentConstruct=J,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(;!ha(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(wn),autolinkProtocol:G,autolinkEmail:G,atxHeading:o(xn),blockQuote:o(Pe),characterEscape:G,characterReference:G,codeFenced:o(ln),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:o(ln,a),codeText:o(Ln,a),codeTextData:G,data:G,codeFlowValue:G,definition:o(Dn),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:o(Pn),hardBreakEscape:o(oe),hardBreakTrailing:o(oe),htmlFlow:o(nn,a),htmlFlowData:G,htmlText:o(nn,a),htmlTextData:G,image:o(tn),label:a,link:o(wn),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(xn),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:I,definitionLabelString:S,definitionTitleString:w,emphasis:l(),hardBreakEscape:l(B),hardBreakTrailing:l(B),htmlFlow:l(J),htmlFlowData:x,htmlText:l(L),htmlTextData:x,image:l(se),label:pe,labelText:j,lineEnding:P,link:l(Z),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:Ce,resourceDestinationString:m,resourceTitleString:ue,resource:fe,setextHeading:l($),setextHeadingLineSequence:U,setextHeadingText:k,strong:l(),thematicBreak:l()}};wa(n,(e||{}).mdastExtensions||[]);const t={};return r;function r(N){let O={type:"root",children:[]};const V={stack:[O],tokenStack:[],config:n,enter:s,exit:c,buffer:a,resume:u,data:t},te=[];let le=-1;for(;++le<N.length;)if(N[le][1].type==="listOrdered"||N[le][1].type==="listUnordered")if(N[le][0]==="enter")te.push(le);else{const Be=te.pop();le=i(N,Be,le)}for(le=-1;++le<N.length;){const Be=n[N[le][0]];xa.call(Be,N[le][1].type)&&Be[N[le][1].type].call(Object.assign({sliceSerialize:N[le][2].sliceSerialize},V),N[le][1])}if(V.tokenStack.length>0){const Be=V.tokenStack[V.tokenStack.length-1];(Be[1]||fi).call(V,void 0,Be[0])}for(O.position={start:fn(N.length>0?N[0][1].start:{line:1,column:1,offset:0}),end:fn(N.length>0?N[N.length-2][1].end:{line:1,column:1,offset:0})},le=-1;++le<n.transforms.length;)O=n.transforms[le](O)||O;return O}function i(N,O,V){let te=O-1,le=-1,Be=!1,an,Ke,cn,hn;for(;++te<=V;){const Ie=N[te];switch(Ie[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ie[0]==="enter"?le++:le--,hn=void 0;break}case"lineEndingBlank":{Ie[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&&Ie[0]==="enter"&&Ie[1].type==="listItemPrefix"||le===-1&&Ie[0]==="exit"&&(Ie[1].type==="listUnordered"||Ie[1].type==="listOrdered")){if(an){let un=te;for(Ke=void 0;un--;){const Fe=N[un];if(Fe[1].type==="lineEnding"||Fe[1].type==="lineEndingBlank"){if(Fe[0]==="exit")continue;Ke&&(N[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?N[Ke][1].start:Ie[1].end),N.splice(Ke||te,0,["exit",an,Ie[2]]),te++,V++}if(Ie[1].type==="listItemPrefix"){const un={type:"listItem",_spread:!1,start:Object.assign({},Ie[1].start),end:void 0};an=un,N.splice(te,0,["enter",un,Ie[2]]),te++,V++,cn=void 0,hn=!0}}}return N[O][1]._spread=Be,V}function o(N,O){return V;function V(te){s.call(this,N(te),te),O&&O.call(this,te)}}function a(){this.stack.push({type:"fragment",children:[]})}function s(N,O,V){this.stack[this.stack.length-1].children.push(N),this.stack.push(N),this.tokenStack.push([O,V||void 0]),N.position={start:fn(O.start),end:void 0}}function l(N){return O;function O(V){N&&N.call(this,V),c.call(this,V)}}function c(N,O){const V=this.stack.pop(),te=this.tokenStack.pop();if(te)te[0].type!==N.type&&(O?O.call(this,N,te[0]):(te[1]||fi).call(this,N,te[0]));else throw new Error("Cannot close `"+N.type+"` ("+Kn({start:N.start,end:N.end})+"): it’s not open");V.position.end=fn(N.end)}function u(){return yr(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(N){if(this.data.expectingFirstListItemValue){const O=this.stack[this.stack.length-2];O.start=Number.parseInt(this.sliceSerialize(N),10),this.data.expectingFirstListItemValue=void 0}}function p(){const N=this.resume(),O=this.stack[this.stack.length-1];O.lang=N}function g(){const N=this.resume(),O=this.stack[this.stack.length-1];O.meta=N}function _(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const N=this.resume(),O=this.stack[this.stack.length-1];O.value=N.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function E(){const N=this.resume(),O=this.stack[this.stack.length-1];O.value=N.replace(/(\r?\n|\r)$/g,"")}function S(N){const O=this.resume(),V=this.stack[this.stack.length-1];V.label=O,V.identifier=Ve(this.sliceSerialize(N)).toLowerCase()}function w(){const N=this.resume(),O=this.stack[this.stack.length-1];O.title=N}function I(){const N=this.resume(),O=this.stack[this.stack.length-1];O.url=N}function R(N){const O=this.stack[this.stack.length-1];if(!O.depth){const V=this.sliceSerialize(N).length;O.depth=V}}function k(){this.data.setextHeadingSlurpLineEnding=!0}function U(N){const O=this.stack[this.stack.length-1];O.depth=this.sliceSerialize(N).codePointAt(0)===61?1:2}function $(){this.data.setextHeadingSlurpLineEnding=void 0}function G(N){const V=this.stack[this.stack.length-1].children;let te=V[V.length-1];(!te||te.type!=="text")&&(te=rn(),te.position={start:fn(N.start),end:void 0},V.push(te)),this.stack.push(te)}function x(N){const O=this.stack.pop();O.value+=this.sliceSerialize(N),O.position.end=fn(N.end)}function P(N){const O=this.stack[this.stack.length-1];if(this.data.atHardBreak){const V=O.children[O.children.length-1];V.position.end=fn(N.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(O.type)&&(G.call(this,N),x.call(this,N))}function B(){this.data.atHardBreak=!0}function J(){const N=this.resume(),O=this.stack[this.stack.length-1];O.value=N}function L(){const N=this.resume(),O=this.stack[this.stack.length-1];O.value=N}function v(){const N=this.resume(),O=this.stack[this.stack.length-1];O.value=N}function Z(){const N=this.stack[this.stack.length-1];if(this.data.inReference){const O=this.data.referenceType||"shortcut";N.type+="Reference",N.referenceType=O,delete N.url,delete N.title}else delete N.identifier,delete N.label;this.data.referenceType=void 0}function se(){const N=this.stack[this.stack.length-1];if(this.data.inReference){const O=this.data.referenceType||"shortcut";N.type+="Reference",N.referenceType=O,delete N.url,delete N.title}else delete N.identifier,delete N.label;this.data.referenceType=void 0}function j(N){const O=this.sliceSerialize(N),V=this.stack[this.stack.length-2];V.label=$c(O),V.identifier=Ve(O).toLowerCase()}function pe(){const N=this.stack[this.stack.length-1],O=this.resume(),V=this.stack[this.stack.length-1];if(this.data.inReference=!0,V.type==="link"){const te=N.children;V.children=te}else V.alt=O}function m(){const N=this.resume(),O=this.stack[this.stack.length-1];O.url=N}function ue(){const N=this.resume(),O=this.stack[this.stack.length-1];O.title=N}function fe(){this.data.inReference=void 0}function b(){this.data.referenceType="collapsed"}function Ce(N){const O=this.resume(),V=this.stack[this.stack.length-1];V.label=O,V.identifier=Ve(this.sliceSerialize(N)).toLowerCase(),this.data.referenceType="full"}function He(N){this.data.characterReferenceType=N.type}function Ee(N){const O=this.sliceSerialize(N),V=this.data.characterReferenceType;let te;V?(te=pa(O,V==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):te=kr(O);const le=this.stack[this.stack.length-1];le.value+=te}function Je(N){const O=this.stack.pop();O.position.end=fn(N.end)}function De(N){x.call(this,N);const O=this.stack[this.stack.length-1];O.url=this.sliceSerialize(N)}function en(N){x.call(this,N);const O=this.stack[this.stack.length-1];O.url="mailto:"+this.sliceSerialize(N)}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 xn(){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 wn(){return{type:"link",title:null,url:"",children:[]}}function Bn(N){return{type:"list",ordered:N.type==="listOrdered",start:null,spread:N._spread,children:[]}}function At(N){return{type:"listItem",spread:N._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:`
@@ -0,0 +1,3 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./react-force-graph-2d-DF72c1gy.js","./index-BdyNnuNw.js","./index-C9Y7w-_L.css"])))=>i.map(i=>d[i]);
2
+ import{M as u,a1 as y,x as t,a9 as k,_ as I,ad as E,at as R,aa as A,K as C,N as L,L as p,e as f,a as S,E as M,y as _,J as D,Y as T,V as U,Q as N}from"./index-BdyNnuNw.js";import{P as $,D as B}from"./PinArchiveButtons-BuU8vG74.js";import{b as P,N as V}from"./NoteRenderer-D2nj176-.js";const F=1,z=3,G=1;function H(e,s){const a=new Map,n=new Map;for(const c of s.values())for(const r of c.links??[]){if(r.sourceId===r.targetId||!s.has(r.sourceId)||!s.has(r.targetId))continue;const i=`${r.sourceId}|${r.targetId}|${r.relationship}`;a.has(i)||(a.set(i,{source:r.sourceId,target:r.targetId,relationship:r.relationship}),n.set(r.sourceId,(n.get(r.sourceId)??0)+1),n.set(r.targetId,(n.get(r.targetId)??0)+1))}return{nodes:[...s.values()].map(c=>{var r;return{id:c.id,path:c.path,tags:c.tags,summary:typeof((r=c.metadata)==null?void 0:r.summary)=="string"?c.metadata.summary:void 0,isAnchor:c.id===e,linkCount:n.get(c.id)??0}}),edges:[...a.values()]}}async function O(e,s,a,n){const o=new Map;o.set(e.id,e);let c=[e];for(let r=1;r<=s;r++){const i=new Set;for(const l of c)for(const x of l.links??[]){const m=x.sourceId===l.id?x.targetId:x.sourceId;m!==l.id&&(o.has(m)||i.add(m))}if(i.size===0)break;const d=await Promise.all([...i].map(l=>a(l).catch(()=>null)));if(n!=null&&n.cancelled)return o;const h=[];for(const l of d)l&&!o.has(l.id)&&(o.set(l.id,l),h.push(l));c=h}return o}function K(e,s,a){const[n,o]=u.useState(null),[c,r]=u.useState(!1);return u.useEffect(()=>{if(!e||!s){o(null),r(!1);return}const i={cancelled:!1};return r(!0),O(s,a,d=>e.getNote(d,{includeLinks:!0}),i).then(d=>{i.cancelled||(o(H(s.id,d)),r(!1))}).catch(()=>{i.cancelled||r(!1)}),()=>{i.cancelled=!0}},[e,s,a]),{data:n,isLoading:c}}const W=u.lazy(()=>I(()=>import("./react-force-graph-2d-DF72c1gy.js"),__vite__mapDeps([0,1,2]),import.meta.url));function J({anchor:e}){const[s,a]=u.useState(!0),[n,o]=u.useState(G),c=y(),{data:r,isLoading:i}=K(c,s?e:void 0,n);return t.jsxs("section",{className:"mt-10 border-t border-border pt-6",children:[t.jsxs("header",{className:"mb-4 flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsxs("button",{type:"button",onClick:()=>a(d=>!d),"aria-expanded":s,className:"font-serif text-xl text-fg hover:text-accent",children:[s?"▾":"▸"," Neighborhood"]}),s&&r?t.jsxs("span",{className:"text-xs text-fg-dim",children:[r.nodes.length," ",r.nodes.length===1?"note":"notes"]}):null]}),s?t.jsx(Q,{depth:n,onChange:o}):null]}),s?t.jsx(X,{data:r,isLoading:i}):null]})}function Q({depth:e,onChange:s}){const a=[];for(let n=F;n<=z;n++)a.push(n);return t.jsxs("fieldset",{className:"flex items-center gap-1 text-xs text-fg-dim",children:[t.jsx("legend",{className:"mr-1 inline-block",children:"Hops"}),a.map(n=>t.jsx("button",{type:"button","aria-pressed":n===e,onClick:()=>s(n),className:n===e?"rounded border border-accent bg-accent/10 px-2 py-0.5 text-accent":"rounded border border-border bg-card px-2 py-0.5 hover:text-accent",children:n},n))]})}function X({data:e,isLoading:s}){return!e&&s?t.jsx(w,{}):e?e.nodes.length<=1?t.jsx("div",{className:"rounded-md border border-border bg-card p-6 text-center text-sm text-fg-dim",children:"This note has no neighbors yet."}):t.jsx(Y,{data:e}):null}function w(){return t.jsx("div",{"aria-busy":"true",className:"h-[24rem] w-full animate-pulse rounded-md border border-border bg-card"})}function Y({data:e}){const s=k(),a=u.useRef(null),[n,o]=u.useState({w:600,h:384});u.useEffect(()=>{const r=a.current;if(!r)return;const i=()=>{const h=r.getBoundingClientRect();o({w:Math.max(320,Math.floor(h.width)),h:384})};i();const d=new ResizeObserver(i);return d.observe(r),()=>d.disconnect()},[]);const c=u.useMemo(()=>({nodes:e.nodes.map(r=>({...r})),links:e.edges.map(r=>({source:r.source,target:r.target,rel:r.relationship}))}),[e]);return t.jsx("div",{ref:a,"data-testid":"neighborhood-graph-canvas",className:"overflow-hidden rounded-md border border-border bg-card",children:t.jsx(u.Suspense,{fallback:t.jsx(w,{}),children:t.jsx(W,{graphData:c,width:n.w,height:n.h,nodeLabel:r=>q(r),nodeVal:r=>{const i=r;return i.isAnchor?8:3+Math.min(i.linkCount,8)},nodeColor:r=>r.isAnchor?"#c9b170":"#8a9a7a",linkColor:()=>"rgba(160, 160, 160, 0.4)",linkDirectionalArrowLength:3,linkDirectionalArrowRelPos:1,cooldownTicks:80,onNodeClick:r=>{s(`/n/${encodeURIComponent(r.id)}`)}})})})}function q(e){const s=[e.path??e.id];return e.tags&&e.tags.length>0&&s.push(`tags: ${e.tags.join(", ")}`),e.summary&&s.push(e.summary),s.join(`
3
+ `)}const Z="_Transcript pending._",ee="_Transcription unavailable._";function te({content:e}){const s=e.includes(Z),a=!s&&e.includes(ee);return s?t.jsxs("output",{"aria-live":"polite",className:"mb-4 inline-flex items-center gap-2 rounded-md border border-sky-500/30 bg-sky-500/5 px-3 py-1.5 text-xs text-sky-300",children:[t.jsx("span",{"aria-hidden":!0,className:"inline-block h-2 w-2 animate-pulse rounded-full bg-sky-400"}),"Transcribing…"]}):a?t.jsx("output",{className:"mb-4 inline-flex items-center gap-2 rounded-md border border-amber-500/30 bg-amber-500/5 px-3 py-1.5 text-xs text-amber-200",children:"Transcription unavailable — open the audio below and add a note by hand."}):null}function fe(){const{id:e}=E(),s=e?decodeURIComponent(e):void 0,a=R(o=>o.getActiveVault()),n=A(s);return u.useEffect(()=>{a&&s&&C(a.id,s)},[a,s]),a?t.jsxs("div",{className:"page",children:[t.jsx("nav",{className:"mb-6 text-sm text-fg-dim",children:t.jsx(p,{to:"/all",className:"hover:text-accent",children:"← All notes"})}),n.isPending?t.jsx(ce,{}):n.isError?t.jsx(ue,{error:n.error,retry:()=>n.refetch()}):n.data?t.jsx(se,{note:n.data}):t.jsx(de,{id:s??""})]}):t.jsx(L,{to:"/",replace:!0})}function se({note:e}){var h;const s=u.useMemo(()=>P(e),[e]),a=e.path??e.id,n=_(e.content),o=n??(e.path?D(e.path):e.id),c=u.useMemo(()=>n?{...e,content:T(e.content??"")}:e,[e,n]),r=typeof((h=e.metadata)==null?void 0:h.summary)=="string"?e.metadata.summary:null,i=u.useMemo(()=>(e.links??[]).filter(l=>l.targetId===e.id&&l.sourceId!==e.id&&l.sourceNote),[e]),d=u.useMemo(()=>{const l=new Set,x=[];for(const m of e.links??[])m.sourceId!==e.id||m.targetId===e.id||m.targetNote&&(l.has(m.targetId)||(l.add(m.targetId),x.push(m)));return x},[e]);return t.jsxs("article",{className:"grid gap-10 lg:grid-cols-[minmax(0,1fr)_18rem]",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsxs("header",{className:"mb-6 border-b border-border pb-4",children:[t.jsx("h1",{className:"page-title",children:o}),e.tags&&e.tags.length>0?t.jsx(ae,{tags:e.tags}):null,t.jsx("p",{className:"note-id mt-2",children:a}),r?t.jsx("p",{className:"mt-3 text-fg-muted",children:r}):null,t.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[t.jsx(p,{to:`/n/${encodeURIComponent(e.id)}/edit`,className:"btn btn-secondary btn-touch",children:"Edit"}),t.jsx($,{note:e,keyboard:!0}),t.jsx(B,{note:e})]})]}),t.jsx(te,{content:e.content??""}),t.jsx(V,{note:c,resolve:s}),e.attachments&&e.attachments.length>0?t.jsxs("section",{className:"mt-10 border-t border-border pt-6",children:[t.jsx("h2",{className:"mb-3 font-serif text-xl",children:"Attachments"}),t.jsx("div",{className:"space-y-6",children:e.attachments.map(l=>t.jsx(ne,{attachment:l},l.id))})]}):null,t.jsx(J,{anchor:e})]}),t.jsxs("aside",{className:"space-y-6 text-sm lg:sticky lg:top-24 lg:self-start",children:[t.jsx(re,{note:e}),d.length>0?t.jsx(v,{title:"Outbound",links:d,peer:"target"}):null,i.length>0?t.jsx(v,{title:"Inbound",links:i,peer:"source"}):null]})]})}function re({note:e}){const s=e.createdAt,a=e.updatedAt,n=Object.entries(e.metadata??{}).filter(([o])=>o!=="summary");return t.jsxs("section",{className:"card p-4",children:[t.jsx("h2",{className:"eyebrow mb-2",children:"Metadata"}),t.jsxs("dl",{className:"space-y-1.5 text-sm",children:[e.path?t.jsx(g,{label:"Title",value:t.jsx("span",{className:"font-mono text-xs break-all",children:e.path})}):null,t.jsx(g,{label:"ID",value:t.jsx("span",{className:"font-mono text-xs break-all",children:e.id})}),t.jsx(g,{label:"Created",value:t.jsx("time",{title:s,children:N(s)})}),a?t.jsx(g,{label:"Updated",value:t.jsx("time",{title:a,children:N(a)})}):null,n.map(([o,c])=>t.jsx(g,{label:o,value:t.jsx("span",{className:"break-all text-fg-muted",children:String(c)})},o))]})]})}function g({label:e,value:s}){return t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsx("dt",{className:"eyebrow",children:e}),t.jsx("dd",{children:s})]})}function ae({tags:e}){return t.jsx("div",{className:"mt-3 flex flex-wrap gap-1.5","aria-label":"Tags",children:e.map(s=>t.jsxs(p,{to:`/all?tag=${encodeURIComponent(s)}`,className:"chip chip-tag focus-ring max-w-full break-all font-medium",children:["#",s]},s))})}function v({title:e,links:s,peer:a}){return t.jsxs("section",{className:"card p-4",children:[t.jsxs("h2",{className:"eyebrow mb-2",children:[e," (",s.length,")"]}),t.jsx("ul",{className:"space-y-1.5",children:s.map(n=>{var i;const o=a==="source"?n.sourceNote:n.targetNote;if(!o)return null;const c=o.path??o.id,r=typeof((i=o.metadata)==null?void 0:i.summary)=="string"?o.metadata.summary:null;return t.jsx("li",{children:t.jsxs(p,{to:`/n/${encodeURIComponent(o.id)}`,className:"block rounded px-1 py-0.5 hover:bg-bg/50",children:[t.jsx("div",{className:"truncate font-mono text-xs text-fg-muted hover:text-accent",children:c}),r?t.jsx("div",{className:"mt-0.5 line-clamp-2 text-xs text-fg-dim",children:r}):null]})},`${n.sourceId}->${n.targetId}:${n.relationship}`)})})]})}function ne({attachment:e}){const s=(e.mimeType??"").toLowerCase(),a=e.filename??e.id;return t.jsxs("figure",{className:"card p-3",children:[t.jsxs("figcaption",{className:"mb-2 flex items-baseline justify-between gap-3",children:[t.jsx("span",{className:"truncate font-mono text-xs text-fg-muted",children:a}),typeof e.size=="number"?t.jsx("span",{className:"shrink-0 text-xs text-fg-dim",children:le(e.size)}):null]}),t.jsx(oe,{attachment:e,mime:s,filename:a})]})}function oe({attachment:e,mime:s,filename:a}){const n=y(),[o,c]=u.useState(null),[r,i]=u.useState(null),d=ie(s,a),h=d!=="other",l=e.url;if(u.useEffect(()=>{if(!h||!l||!n)return;let m=!1,b=null;return i(null),n.fetchAttachmentBlob(l).then(j=>{m||(b=URL.createObjectURL(j),c(b))}).catch(j=>{m||i(j instanceof Error?j.message:"Failed to load attachment")}),()=>{m=!0,b&&URL.revokeObjectURL(b)}},[h,l,n]),!l)return t.jsx("p",{className:"text-sm text-fg-dim",children:"(no URL)"});if(r)return t.jsx("p",{className:"text-sm text-[--color-danger]",children:r});if(h&&!o)return t.jsx(f,{className:"h-32 w-full"});const x=o??l;return d==="image"?t.jsx("img",{src:x,alt:a,className:"max-h-[32rem] rounded"}):d==="audio"?t.jsx("audio",{controls:!0,src:x,className:"w-full"}):d==="video"?t.jsx("video",{controls:!0,src:x,className:"w-full rounded"}):d==="pdf"?t.jsxs(t.Fragment,{children:[t.jsx("iframe",{src:x,title:a,className:"h-[40rem] w-full rounded border border-border"}),t.jsxs("a",{href:x,download:a,className:"mt-2 inline-block text-sm text-accent hover:underline",children:["Download ",a]})]}):t.jsxs("a",{href:x,download:a,className:"text-sm text-accent hover:underline",children:["Download ",a]})}function ie(e,s){if(e.startsWith("image/"))return"image";if(e.startsWith("audio/"))return"audio";if(e.startsWith("video/"))return"video";if(e==="application/pdf")return"pdf";const a=s.toLowerCase().split(".").pop()??"";return["png","jpg","jpeg","gif","webp","svg"].includes(a)?"image":["mp3","wav","ogg","m4a","flac"].includes(a)?"audio":["mp4","webm","mov"].includes(a)?"video":a==="pdf"?"pdf":"other"}function le(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${(e/(1024*1024*1024)).toFixed(2)} GB`}function ce(){return t.jsxs("div",{className:"grid gap-10 lg:grid-cols-[minmax(0,1fr)_18rem]","aria-busy":"true",children:[t.jsxs("div",{className:"min-w-0 space-y-3",children:[t.jsx(f,{className:"h-3 w-32"}),t.jsx(f,{className:"h-8 w-2/3"}),t.jsx(f,{className:"h-4 w-full"}),t.jsx("div",{className:"mt-6 space-y-2",children:[0,1,2,3,4,5].map(e=>t.jsx(f,{className:"h-3",width:`${70+e*13%25}%`},e))})]}),t.jsxs("div",{className:"space-y-4",children:[t.jsx(f,{className:"h-32"}),t.jsx(f,{className:"h-24"})]})]})}function de({id:e}){return t.jsx(M,{title:t.jsx("span",{className:"font-serif text-xl text-fg",children:"Note not found"}),description:t.jsxs(t.Fragment,{children:["No note with id ",t.jsx("span",{className:"font-mono",children:e})," in this vault."]}),action:t.jsx(p,{to:"/all",className:"text-sm text-accent hover:underline",children:"Back to all notes"})})}function ue({error:e,retry:s}){const a=e instanceof U;return t.jsx(S,{title:a?"Session expired":"Could not load note",message:e.message,retry:a?void 0:s,action:a?t.jsx(p,{to:"/add",className:"btn btn-primary",children:"Reconnect vault"}):void 0})}export{fe as NoteView};
@@ -0,0 +1 @@
1
+ import{aj as j,a9 as N,at as w,M as l,p as E,X as V,U as R,a3 as S,c as U,x as t}from"./index-BdyNnuNw.js";import{s as C}from"./url-QSQwrjSV.js";function A(){const[a]=j(),s=N(),d=w(c=>c.addVault),[n,o]=l.useState({kind:"working"}),u=l.useRef(!1);return l.useEffect(()=>{if(u.current)return;u.current=!0;const c=a.get("code"),p=a.get("state"),x=a.get("error");if(x){o({kind:"error",message:`Vault returned: ${x}`});return}if(!c||!p){o({kind:"error",message:"Missing code or state in callback URL."});return}(async()=>{var m,g,h,v;try{const{pending:e,token:r}=await E(c,p),f=r.vault?`vault:${r.vault}`:void 0,k=(f?(g=(m=r.services)==null?void 0:m[f])==null?void 0:g.url:void 0)??((v=(h=r.services)==null?void 0:h.vault)==null?void 0:v.url)??e.issuerUrl,i=d({url:k,name:r.vault??e.issuer,issuer:e.issuer,tokenEndpoint:e.tokenEndpoint,clientId:e.clientId,scope:r.scope},V(r));r.services&&R(i,r.services);const b=S.getState();b.clearHalt(i),e.priorHaltedVaultId&&e.priorHaltedVaultId!==i&&b.clearHalt(e.priorHaltedVaultId);const y=C(e.redirect)??"/";s(y,{replace:!0})}catch(e){if(e instanceof U){o({kind:"pending-approval",approveUrl:e.approveUrl});return}o({kind:"error",message:e.message})}})()},[a,s,d]),n.kind==="working"?t.jsxs("div",{className:"mx-auto max-w-xl px-6 py-24 text-center",children:[t.jsx("h1",{className:"mb-3 font-serif text-3xl",children:"Connecting…"}),t.jsx("p",{className:"text-fg-muted",children:"Exchanging the authorization code with your vault."})]}):n.kind==="pending-approval"?t.jsxs("div",{className:"mx-auto max-w-xl px-6 py-24 text-center",children:[t.jsx("h1",{className:"mb-3 font-serif text-3xl",children:"Waiting for hub approval"}),t.jsx("p",{className:"mb-8 text-fg-muted",children:"Your hub admin needs to approve this app before sign-in can complete. Open the approval page in your hub, approve, then try again."}),t.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-3",children:[t.jsx("a",{href:n.approveUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-block rounded-md bg-accent px-4 py-2 text-sm text-[--color-on-accent] hover:bg-accent-hover",children:"Open approval page"}),t.jsx("button",{type:"button",onClick:()=>s("/add",{replace:!0}),className:"inline-block rounded-md border border-border bg-card px-4 py-2 text-sm text-fg-muted hover:text-accent",children:"Retry now"})]})]}):t.jsxs("div",{className:"mx-auto max-w-xl px-6 py-24 text-center",children:[t.jsx("h1",{className:"mb-3 font-serif text-3xl text-red-400",children:"Connection failed"}),t.jsx("p",{className:"mb-8 text-fg-muted",children:n.message}),t.jsx("button",{type:"button",onClick:()=>s("/add",{replace:!0}),className:"rounded-md bg-accent px-4 py-2 text-sm text-[--color-on-accent] hover:bg-accent-hover",children:"Try again"})]})}export{A as OAuthCallback};
@@ -0,0 +1 @@
1
+ import{M as c,x as t,a9 as v,ap as g,a6 as j,V as y,at as w,am as E,aq as N}from"./index-BdyNnuNw.js";function P({note:a,className:i,label:l="Delete"}){const[r,o]=c.useState(!1);return t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>o(!0),className:i??"min-h-11 rounded-md border border-red-500/40 bg-transparent px-3 py-1.5 text-sm text-red-400 hover:bg-red-500/10",title:"Delete this note",children:l}),r?t.jsx(k,{note:a,onClose:()=>o(!1)}):null]})}function k({note:a,onClose:i}){const l=v(),r=g(e=>e.push),o=j(),d=a.path??a.id,[m,p]=c.useState(""),[u,b]=c.useState(null),x=c.useRef(null),s=m===d&&!o.isPending;c.useEffect(()=>{var e;(e=x.current)==null||e.focus()},[]),c.useEffect(()=>{const e=f=>{f.key==="Escape"&&i()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[i]);const n=c.useCallback(()=>{s&&(b(null),o.mutate(a.id,{onSuccess:()=>{r(`Deleted ${d}`,"success"),l("/")},onError:e=>{e instanceof y?b("Session expired. Reconnect to delete."):b(e instanceof Error?e.message:"Delete failed")}}))},[s,d,o,l,a.id,r]);return t.jsx("dialog",{open:!0,"aria-labelledby":"confirm-delete-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:e=>{e.target===e.currentTarget&&i()},children:t.jsxs("div",{className:"w-full max-w-md rounded-md border border-border bg-card p-6 shadow-xl",children:[t.jsx("h2",{id:"confirm-delete-title",className:"mb-2 font-serif text-xl text-red-400",children:"Delete this note?"}),t.jsx("p",{className:"mb-3 text-sm text-fg-muted",children:"This permanently removes the note, its tags, and its links. This cannot be undone."}),t.jsxs("p",{className:"mb-3 text-sm text-fg-muted",children:["Type"," ",t.jsx("span",{className:"rounded bg-bg/60 px-1 py-0.5 font-mono text-xs text-fg",children:d})," ","to confirm:"]}),t.jsx("input",{ref:x,type:"text",value:m,onChange:e=>p(e.target.value),onKeyDown:e=>{e.key==="Enter"&&s&&n()},"aria-label":"Type note path to confirm",className:"mb-3 w-full rounded-md border border-border bg-bg/40 px-2.5 py-1.5 font-mono text-sm text-fg focus:border-red-400 focus:outline-none",placeholder:d,autoComplete:"off",spellCheck:!1}),u?t.jsx("p",{role:"alert",className:"mb-3 text-sm text-red-400",children:u}):null,t.jsxs("div",{className:"flex justify-end gap-2",children:[t.jsx("button",{type:"button",onClick:i,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"}),t.jsx("button",{type:"button",onClick:n,disabled:!s,className:"btn btn-danger-solid btn-touch",children:o.isPending?"Deleting…":"Delete permanently"})]})]})})}function C({note:a,keyboard:i=!1}){var b,x;const l=w(s=>s.getActiveVault()),{roles:r}=E((l==null?void 0:l.id)??null),o=g(s=>s.push),d=N(a.id),m=((b=a.tags)==null?void 0:b.includes(r.pinned))??!1,p=((x=a.tags)==null?void 0:x.includes(r.archived))??!1,u=c.useCallback(s=>{var f;if(d.isPending)return;const n=r[s],e=((f=a.tags)==null?void 0:f.includes(n))??!1;d.mutate({tags:e?{remove:[n]}:{add:[n]}},{onSuccess:()=>{o(s==="pinned"?e?"Unpinned":"Pinned":e?"Unarchived":"Archived","success")},onError:h=>{h instanceof y?o("Session expired. Reconnect.","error"):o(h instanceof Error?h.message:"Update failed","error")}})},[d,a.tags,o,r]);return c.useEffect(()=>{if(!i)return;const s=n=>{if(n.defaultPrevented)return;const e=n.target;if(e){const f=e.tagName;if(f==="INPUT"||f==="TEXTAREA"||e.isContentEditable)return}n.metaKey||n.ctrlKey||n.altKey||(n.key==="p"||n.key==="P"?(n.preventDefault(),u("pinned")):(n.key==="a"||n.key==="A")&&(n.preventDefault(),u("archived")))};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[i,u]),t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>u("pinned"),disabled:d.isPending,"aria-pressed":m,title:m?`Unpin (${r.pinned})`:`Pin as #${r.pinned} (P)`,className:m?"min-h-11 rounded-md border border-accent/60 bg-accent/10 px-3 py-1.5 text-sm text-accent hover:bg-accent/20 disabled:opacity-40":"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:m?"★ Pinned":"☆ Pin"}),t.jsx("button",{type:"button",onClick:()=>u("archived"),disabled:d.isPending,"aria-pressed":p,title:p?`Unarchive (${r.archived})`:`Archive as #${r.archived} (A)`,className:p?"min-h-11 rounded-md border border-amber-500/40 bg-amber-500/10 px-3 py-1.5 text-sm text-amber-500 hover:bg-amber-500/20 disabled:opacity-40":"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:p?"Archived":"Archive"})]})}export{P as D,C as P};
@@ -0,0 +1 @@
1
+ import{at as k,x as e,N as E,L as S,ah as j,ai as A,a1 as C,ap as w,M as o,O as R,f as D,Z as L,ae as _,P as z,am as P,an as V,T as v,D as N,w as O,t as I,au as M,l as F}from"./index-BdyNnuNw.js";function Q(){const t=k(s=>s.getActiveVault());return t?e.jsxs("div",{className:"page-prose",children:[e.jsxs("header",{className:"mb-8",children:[e.jsx("nav",{className:"mb-3 text-sm text-fg-dim",children:e.jsx(S,{to:"/",className:"hover:text-accent",children:"← Home"})}),e.jsx("h1",{className:"font-serif text-2xl tracking-tight md:text-3xl",children:"Settings"}),e.jsxs("p",{className:"mt-1 text-sm text-fg-muted",children:["Configuring ",e.jsx("span",{className:"text-fg",children:t.name}),"."]})]}),e.jsx(B,{vaultId:t.id}),e.jsx($,{}),e.jsx(U,{}),e.jsx(Z,{vaultId:t.id}),e.jsx(q,{vaultId:t.id}),e.jsx(Y,{})]}):e.jsx(E,{to:"/",replace:!0})}function $(){return e.jsxs("section",{className:"card mb-8 p-4",children:[e.jsx("h2",{className:"font-serif text-lg",children:"Import notes"}),e.jsx("p",{className:"mt-1 text-sm text-fg-muted",children:"Bring in an Obsidian vault zip or a folder of markdown files. Parsed in your browser; previewed before any note lands in the vault."}),e.jsx("div",{className:"mt-3",children:e.jsx(S,{to:"/import",className:"btn btn-primary btn-touch",children:"Open importer"})})]})}function B({vaultId:t}){const s=j(l=>l.byVault[t]??null),i=j(l=>l.refresh),n=j(l=>l.set),h=A(l=>l.clearDismissed),c=C(),d=w(l=>l.push),[x,u]=o.useState(!1),f=async()=>{c&&await i(t,c)},g=async()=>{var l;if(c){u(!0);try{await I(t,c);const m=(l=s==null?void 0:s.result)==null?void 0:l.rows.map(T=>({...T,status:"ok",differences:[]}));m&&n(t,{ok:!0,missing:[],misaligned:[],rows:m}),h(t),d("Schema updated.","success")}catch(m){d(m instanceof Error?`Schema fix failed: ${m.message}`:"Schema fix failed.","error")}finally{u(!1)}}},p=(s==null?void 0:s.loading)??!s,a=(s==null?void 0:s.result)??null,r=(s==null?void 0:s.error)??null;return e.jsxs("section",{className:"card mt-6 space-y-4 rounded-xl p-6",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"font-serif text-xl text-fg",children:"Vault schema"}),e.jsxs("p",{className:"mt-1 text-xs text-fg-dim",children:["Notes declares three tags it uses to classify captures: ",e.jsx("code",{children:"capture"}),","," ",e.jsx("code",{children:"capture/text"}),", ",e.jsx("code",{children:"capture/voice"}),". This panel confirms the active vault has them set up; one click writes any missing or misaligned rows. Doesn't touch your Tag Role choices below."]})]}),e.jsx("button",{type:"button",onClick:()=>void f(),disabled:p||!c,className:"focus-ring shrink-0 text-xs text-fg-dim hover:text-accent disabled:cursor-not-allowed disabled:opacity-60",children:p?"Checking…":"Refresh"})]}),r?e.jsxs("p",{className:"rounded-md border border-[--color-danger-border] bg-[--color-danger-soft] px-3 py-2 text-xs text-[--color-danger]",children:["Audit failed: ",r]}):null,!a&&!r?e.jsx("p",{className:"text-xs text-fg-dim",children:"Loading audit…"}):null,a?e.jsxs(e.Fragment,{children:[e.jsx(H,{ok:a.ok}),e.jsx("ul",{className:"space-y-2",children:a.rows.map(l=>e.jsx(G,{row:l},l.name))}),a.ok?null:e.jsx("button",{type:"button",onClick:()=>void g(),disabled:x||!c,className:"btn btn-primary btn-sm btn-touch",children:x?"Setting up…":"Set up missing tags"})]}):null]})}function H({ok:t}){return e.jsxs("p",{className:`inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-xs ${t?"bg-[--color-positive-soft] text-[--color-positive]":"bg-[--color-warning-soft] text-[--color-warning]"}`,children:[e.jsx("span",{"aria-hidden":!0,className:`h-1.5 w-1.5 rounded-full ${t?"bg-[--color-positive]":"bg-[--color-warning]"}`}),t?"Matches Notes' schema":"Needs setup"]})}function G({row:t}){const s=t.status==="ok"?"ok":t.status==="missing"?"missing":"misaligned",i=t.status==="ok"?"text-[--color-positive]":"text-[--color-warning]";return e.jsxs("li",{className:"rounded-md border border-border bg-bg/40 px-3 py-2 text-xs",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("code",{className:"font-mono text-sm text-fg",children:t.name}),e.jsx("span",{className:`text-xs ${i}`,children:s})]}),t.status==="misaligned"?e.jsxs("p",{className:"mt-1 text-fg-dim",children:["Differs in: ",t.differences.join(", ")]}):null,e.jsx("p",{className:"mt-1 text-fg-dim",children:t.expected.description}),t.expected.parent_names?e.jsxs("p",{className:"text-fg-dim",children:["Parent: ",e.jsx("code",{className:"font-mono",children:t.expected.parent_names.join(", ")})]}):null]})}function U(){const[t,s]=o.useState(()=>R()),i=n=>{s(n),M(n),F(n)};return e.jsxs("section",{className:"card mt-6 space-y-4 rounded-xl p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"font-serif text-xl text-fg",children:"Text size"}),e.jsx("p",{className:"mt-1 text-xs text-fg-dim",children:"Affects the editor and rendered notes on this device. Your markdown isn't changed."})]}),e.jsxs("fieldset",{className:"space-y-2",children:[e.jsx("legend",{className:"sr-only",children:"View text size"}),D.map(n=>e.jsxs("label",{className:"flex items-start gap-2 text-sm",children:[e.jsx("input",{type:"radio",name:"text-size",value:n,checked:t===n,onChange:()=>i(n),className:"mt-1 accent-accent"}),e.jsx("span",{className:"text-fg",children:L(n)})]},n))]})]})}function Y(){const[t,s]=o.useState(!1);return o.useEffect(()=>{s(O())},[]),t?e.jsx("section",{className:"card mt-6 p-4 text-sm",children:e.jsxs("p",{className:"text-fg-muted",children:[e.jsx("span",{className:"mr-2 inline-block rounded-full bg-[--color-positive-soft] px-2 py-0.5 text-xs font-medium text-[--color-positive]",children:"Installed"}),"Parachute Notes is running as an installed app on this device."]})}):null}const y={auto:{title:"Auto",help:"Show the tree only when the vault has enough folders to make it worth the space."},always:{title:"Always",help:"Always show the tree, even on a tag-flat vault."},never:{title:"Never",help:"Hide the tree. The path-prefix text input still works."}};function Z({vaultId:t}){const{mode:s,setMode:i}=_(t);return e.jsxs("section",{className:"card mt-6 space-y-4 rounded-xl p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"font-serif text-xl text-fg",children:"Folder tree (Notes sidebar)"}),e.jsx("p",{className:"mt-1 text-xs text-fg-dim",children:"Controls the collapsible folder tree on the notes list page. Auto-detect renders the tree when the vault has at least five top-level folders or twenty notes in folders."})]}),e.jsxs("fieldset",{className:"space-y-2",children:[e.jsx("legend",{className:"sr-only",children:"Path tree visibility"}),z.map(n=>e.jsxs("label",{className:"flex items-start gap-2 text-sm",children:[e.jsx("input",{type:"radio",name:"path-tree-mode",value:n,checked:s===n,onChange:()=>i(n),className:"mt-1 accent-accent"}),e.jsxs("span",{children:[e.jsx("span",{className:"text-fg",children:y[n].title}),e.jsx("span",{className:"ml-2 text-xs text-fg-dim",children:y[n].help})]})]},n))]})]})}const b={pinned:{title:"Pinned",help:"Tag for notes you want at the top of views."},archived:{title:"Archived",help:"Tag for notes you've moved out of the way."},captureVoice:{title:"Voice capture",help:"Default tag for new voice memos."},captureText:{title:"Text capture",help:"Default tag for quick typed notes."},view:{title:"Saved view",help:"Tag the saved-view notes carry. Used to list them in the notes sidebar."}};function q({vaultId:t}){const{roles:s,setRoles:i}=P(t),n=V(),h=w(a=>a.push),c=o.useId(),[d,x]=o.useState(s);o.useEffect(()=>x(s),[s]);const u=o.useMemo(()=>{const a=(n.data??[]).map(r=>r.name);return[...new Set(a)].sort((r,l)=>r.localeCompare(l))},[n.data]),f=v.some(a=>d[a].trim()!==s[a]),g=()=>{i(d),h("Tag roles saved.","success")},p=()=>{i(null),x(N),h("Tag roles reset to defaults.","success")};return e.jsxs("section",{className:"card mt-6 space-y-4 rounded-xl p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"font-serif text-xl text-fg",children:"Tag roles"}),e.jsx("p",{className:"mt-1 text-xs text-fg-dim",children:"Point each role at whatever tag your vault already uses. Changes apply to future notes only — existing notes keep their current tags."})]}),e.jsx("datalist",{id:c,children:u.map(a=>e.jsx("option",{value:a},a))}),e.jsx("div",{className:"space-y-3",children:v.map(a=>e.jsxs("label",{className:"block text-sm",children:[e.jsxs("span",{className:"mb-1 flex items-baseline justify-between gap-2",children:[e.jsx("span",{className:"text-fg-muted",children:b[a].title}),e.jsxs("span",{className:"text-xs text-fg-dim",children:["default: #",N[a]]})]}),e.jsx("input",{type:"text",value:d[a],onChange:r=>x(l=>({...l,[a]:r.target.value})),list:c,placeholder:N[a],"aria-label":`${b[a].title} tag role`,spellCheck:!1,autoCapitalize:"none",autoCorrect:"off",className:"input input-on-bg"}),e.jsx("span",{className:"mt-1 block text-xs text-fg-dim",children:b[a].help})]},a))}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3 pt-2",children:[e.jsx("button",{type:"button",onClick:g,disabled:!f,className:"btn btn-primary btn-lg",children:"Save"}),e.jsx("button",{type:"button",onClick:p,className:"focus-ring text-sm text-fg-muted hover:text-accent",children:"Reset to defaults"})]})]})}export{Q as Settings};
@@ -0,0 +1 @@
1
+ import{ap as _,M as c,j as z,V as M,x as e,al as U,ar as W,at as q,ao as B,ak as H,af as Y,ag as Z,a8 as G,N as J,L as F}from"./index-BdyNnuNw.js";const I=t=>Object.values(t).reduce((n,l)=>n+l,0);function O({mode:t,sources:n,tagOptions:l,onClose:o,onRun:f,onRunMerge:i,pending:m,offline:d}){const b=_(a=>a.push),h=c.useId(),[j,N]=c.useState(t==="rename"?n[0]??"":""),[v,x]=c.useState(null),[p,T]=c.useState(null),[C,E]=c.useState(!1),w=c.useRef(null);c.useEffect(()=>{var a,s;(a=w.current)==null||a.focus(),(s=w.current)==null||s.select()},[]),c.useEffect(()=>{const a=s=>{s.key==="Escape"&&o()};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[o]);const k=j.trim().replace(/^#/,""),S=!m&&!d&&!C&&k.length>0&&!(t==="rename"&&k===n[0]),r=c.useCallback(async()=>{if(S){x(null),T(null);try{const a=await f(k);if("renamed"in a)b(`Renamed on ${a.renamed} note${a.renamed===1?"":"s"}.`,"success");else{const s=I(a.merged);b(`Merged into #${a.target} on ${s} note${s===1?"":"s"}.`,"success")}o()}catch(a){if(a instanceof z&&t==="rename"&&i){T(a.target);return}a instanceof M?x("Session expired. Reconnect to retry."):x(a instanceof Error?a.message:"Operation failed.")}}},[S,k,t,o,f,i,b]),g=c.useCallback(async()=>{if(!(!p||!i)){x(null),E(!0);try{const a=await i(p),s=I(a.merged);b(`Merged into #${a.target} on ${s} note${s===1?"":"s"}.`,"success"),o()}catch(a){a instanceof M?x("Session expired. Reconnect to retry."):x(a instanceof Error?a.message:"Merge failed."),E(!1)}}},[p,o,i,b]),y=t==="rename"?"Rename tag":`Merge ${n.length} tags`;return e.jsx("dialog",{open:!0,"aria-labelledby":"tag-op-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:a=>{a.target===a.currentTarget&&o()},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:"tag-op-title",className:"mb-2 font-serif text-xl text-fg",children:y}),e.jsxs("p",{className:"mb-3 text-sm text-fg-muted",children:[t==="rename"?e.jsxs(e.Fragment,{children:["Rename ",e.jsx($,{children:n[0]})," on every note that carries it. Notes that already have the new tag will end up with one copy."]}):e.jsxs(e.Fragment,{children:["Combine"," ",n.map((a,s)=>e.jsxs("span",{children:[e.jsx($,{children:a}),s<n.length-1?", ":""]},a))," ","into one tag. The originals are removed."]})," ","Changes apply atomically on the vault."]}),e.jsxs("label",{className:"mb-3 block text-sm",children:[e.jsx("span",{className:"mb-1 block text-fg-muted",children:t==="rename"?"New tag name":"Target tag"}),e.jsx("input",{ref:w,type:"text",value:j,onChange:a=>{N(a.target.value),p&&T(null)},onKeyDown:a=>{a.key==="Enter"&&S&&r()},list:h,"aria-label":t==="rename"?"New tag name":"Merge target tag",spellCheck:!1,autoCapitalize:"none",autoCorrect:"off",className:"w-full rounded-md border border-border bg-bg/40 px-2.5 py-1.5 font-mono text-sm text-fg focus:border-accent focus:outline-none",autoComplete:"off"}),e.jsx("datalist",{id:h,children:l.map(a=>e.jsx("option",{value:a},a))})]}),d?e.jsx("p",{className:"mb-3 text-sm text-amber-300",children:"Offline — tag operations need a live vault connection."}):null,p?e.jsxs("div",{role:"alert",className:"mb-3 rounded-md border border-amber-500/40 bg-amber-500/5 p-3 text-sm",children:[e.jsxs("p",{className:"mb-2 text-amber-300",children:["A tag named ",e.jsx($,{children:p})," already exists."]}),e.jsxs("p",{className:"mb-3 text-fg-muted",children:["Merge ",e.jsx($,{children:n[0]})," into ",e.jsx($,{children:p})," instead? Notes that carry both end up with one copy."]}),e.jsx("button",{type:"button",onClick:()=>void g(),disabled:C,className:"rounded-md bg-accent px-3 py-1.5 text-xs font-medium text-[--color-on-accent] hover:bg-accent-hover disabled:opacity-40",children:C?"Merging…":`Merge into #${p}`})]}):null,v?e.jsx("p",{role:"alert",className:"mb-3 text-sm text-red-400",children:v}):null,e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx("button",{type:"button",onClick:o,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:()=>void r(),disabled:!S,className:"min-h-11 rounded-md bg-accent px-4 py-1.5 text-sm font-medium text-[--color-on-accent] hover:bg-accent-hover disabled:opacity-40",children:m?t==="rename"?"Renaming…":"Merging…":t==="rename"?"Rename":"Merge"})]})]})})}function $({children:t}){return e.jsxs("span",{className:"rounded bg-bg/60 px-1 py-0.5 font-mono text-xs text-fg",children:["#",t]})}const Q=["string","number","boolean","date"];let D=0;function K(){return D+=1,`row-${D}`}function X(t){return t?Object.entries(t).map(([n,l])=>({rowId:K(),name:n,type:l.type||"string"})):[]}function ee({tagName:t,onClose:n}){var S;const l=U(t),o=W(),[f,i]=c.useState(""),[m,d]=c.useState([]),[b,h]=c.useState(""),[j,N]=c.useState(!1),[v,x]=c.useState(null);c.useEffect(()=>{if(j||l.isPending)return;const r=l.data;r&&(i(r.description??""),d(X(r.fields)),h((r.parent_names??[]).join(", "))),N(!0)},[j,l.isPending,l.data]);const p=((S=l.data)==null?void 0:S.fields)??null,T=!te(p,L(m)),C=(r,g)=>{d(y=>y.map(a=>a.rowId===r?{...a,...g}:a))},E=()=>{d(r=>[...r,{rowId:K(),name:"",type:"string"}])},w=r=>{d(g=>g.filter(y=>y.rowId!==r))},k=async()=>{x(null);const r=m.map(u=>({...u,name:u.name.trim()}));if(r.filter(u=>u.name.length===0).length>0){x("Field names can't be blank. Remove the empty row or fill it in.");return}const y=new Set;for(const u of r){if(y.has(u.name)){x(`Duplicate field name "${u.name}". Each field needs a unique key.`);return}y.add(u.name)}const a=r.length>0?L(r):null,s=p!=null&&Object.keys(p).some(u=>!r.find(V=>V.name===u)),R=b.split(",").map(u=>u.trim()).filter(u=>u.length>0),A={description:f.trim()||null,parent_names:R.length>0?R:null};try{s?(await o.mutateAsync({name:t,payload:{...A,fields:null}}),a&&await o.mutateAsync({name:t,payload:{...A,fields:a}})):await o.mutateAsync({name:t,payload:{...A,fields:a}}),n()}catch(u){if(u instanceof M){x("Session expired. Reconnect to save.");return}x(u instanceof Error?u.message:"Save failed")}};return e.jsx("dialog",{open:!0,"aria-modal":"true","aria-label":`Edit schema for #${t}`,className:"fixed inset-0 z-50 m-0 h-dvh w-screen max-h-none max-w-none overflow-y-auto bg-black/60 p-4 md:p-8",onKeyDown:r=>{r.key==="Escape"&&(r.preventDefault(),n())},children:e.jsxs("div",{className:"mx-auto max-w-xl rounded-lg border border-border bg-card p-5 text-fg md:p-6",children:[e.jsxs("header",{className:"mb-4 flex items-baseline justify-between gap-3",children:[e.jsxs("h2",{className:"font-serif text-lg",children:["Schema for ",e.jsxs("span",{className:"font-mono",children:["#",t]})]}),e.jsx("button",{type:"button",onClick:n,className:"text-sm text-fg-muted hover:text-accent","aria-label":"Close schema editor",children:"Close"})]}),l.isPending?e.jsx("p",{className:"text-sm text-fg-dim","aria-busy":"true",children:"Loading schema…"}):l.isError?e.jsxs("p",{role:"alert",className:"text-sm text-red-400",children:["Could not load schema: ",l.error.message]}):e.jsxs(e.Fragment,{children:[e.jsxs("label",{className:"mb-4 block",children:[e.jsx("span",{className:"mb-1 block text-xs uppercase tracking-wider text-fg-dim",children:"Description"}),e.jsx("input",{type:"text",value:f,onChange:r=>i(r.target.value),placeholder:"What does this tag mean? Who uses it?","aria-label":"Tag description",className:"w-full rounded-md border border-border bg-bg px-2.5 py-1.5 text-sm text-fg focus:border-accent focus:outline-none"})]}),e.jsxs("fieldset",{className:"mb-4",children:[e.jsx("legend",{className:"mb-2 text-xs uppercase tracking-wider text-fg-dim",children:"Fields"}),m.length===0?e.jsx("p",{className:"mb-2 text-xs text-fg-dim",children:"No fields declared yet. Add one to give notes carrying this tag a structured shape."}):e.jsx("ul",{className:"mb-2 space-y-2","aria-label":"Schema fields",children:m.map(r=>e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"text",value:r.name,onChange:g=>C(r.rowId,{name:g.target.value}),placeholder:"field_name","aria-label":"Field name",className:"flex-1 rounded-md border border-border bg-bg px-2 py-1 font-mono text-xs text-fg focus:border-accent focus:outline-none"}),e.jsx("select",{value:r.type,onChange:g=>C(r.rowId,{type:g.target.value}),"aria-label":`Type for ${r.name||"new field"}`,className:"rounded-md border border-border bg-bg px-2 py-1 text-xs text-fg focus:border-accent focus:outline-none",children:Q.map(g=>e.jsx("option",{value:g,children:g},g))}),e.jsx("button",{type:"button",onClick:()=>w(r.rowId),"aria-label":`Remove field ${r.name||"new"}`,className:"text-fg-dim hover:text-red-400",children:"×"})]},r.rowId))}),e.jsx("button",{type:"button",onClick:E,className:"text-xs text-accent hover:text-accent-hover",children:"+ Add field"})]}),e.jsxs("label",{className:"mb-4 block",children:[e.jsx("span",{className:"mb-1 block text-xs uppercase tracking-wider text-fg-dim",children:"Parent tags"}),e.jsx("input",{type:"text",value:b,onChange:r=>h(r.target.value),placeholder:"comma-separated (e.g. project, area)","aria-label":"Parent tags",className:"w-full rounded-md border border-border bg-bg px-2.5 py-1.5 font-mono text-xs text-fg focus:border-accent focus:outline-none"}),e.jsx("p",{className:"mt-1 text-xs text-fg-dim",children:"Vault treats parents as a hierarchical relationship — children inherit semantics. Comma-separated; leave blank for a top-level tag."})]}),T?e.jsxs("div",{role:"alert",className:"mb-4 rounded-md border border-amber-500/30 bg-amber-500/5 p-3 text-xs text-amber-300",children:[e.jsx("strong",{className:"block font-medium",children:"Heads up."})," Editing this tag's schema doesn't retroactively update notes already tagged with"," ",e.jsxs("span",{className:"font-mono",children:["#",t]}),". The new schema applies to notes you create or update from here on. Existing notes keep their current shape until you edit them."]}):null,v?e.jsx("p",{role:"alert",className:"mb-3 text-sm text-red-400",children:v}):null,e.jsxs("footer",{className:"flex items-center justify-end gap-2",children:[e.jsx("button",{type:"button",onClick:n,className:"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:k,disabled:o.isPending,className:"rounded-md bg-accent px-4 py-1.5 text-sm font-medium text-[--color-on-accent] hover:bg-accent-hover disabled:opacity-40",children:o.isPending?"Saving…":"Save schema"})]})]})]})})}function L(t){const n={};for(const l of t){const o=l.name.trim();o&&(n[o]={type:l.type})}return n}function te(t,n){const l=t?Object.keys(t):[],o=n?Object.keys(n):[];if(l.length!==o.length)return!1;for(const f of l)if(!n||!n[f]||t[f].type!==n[f].type)return!1;return!0}function ce(){const t=q(s=>s.getActiveVault()),n=B(),{isOnline:l}=H(),{isPinned:o,togglePin:f}=Y((t==null?void 0:t.id)??null),[i,m]=c.useState(""),[d,b]=c.useState("count"),[h,j]=c.useState(new Set),[N,v]=c.useState(null),[x,p]=c.useState(!1),[T,C]=c.useState(null),E=Z(),w=G(),k=c.useMemo(()=>ne(n.data??[],i,d),[n.data,i,d]),S=c.useMemo(()=>(n.data??[]).map(s=>s.name),[n.data]),r=s=>{j(R=>{const P=new Set(R);return P.has(s)?P.delete(s):P.add(s),P})},g=()=>j(new Set);if(!t)return e.jsx(J,{to:"/",replace:!0});const y=h.size,a=!l;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-5 flex flex-wrap items-baseline justify-between gap-x-4 gap-y-3 md:mb-6",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs uppercase tracking-wider text-fg-dim",children:t.name}),e.jsx("h1",{className:"font-serif text-2xl tracking-tight md:text-3xl",children:"Tags"})]}),e.jsxs("button",{type:"button",onClick:()=>b(s=>s==="count"?"alpha":"count"),className:"text-sm text-fg-muted hover:text-accent","aria-label":"Toggle tag sort",children:["Sort: ",d==="count"?"most used":"A–Z"]})]}),e.jsx("input",{type:"search",placeholder:"Filter tags…",value:i,onChange:s=>m(s.target.value),"aria-label":"Filter tags",className:"mb-4 w-full rounded-md border border-border bg-card px-3 py-2 text-sm text-fg focus:border-accent focus:outline-none"}),y>0?e.jsxs("div",{className:"mb-4 flex flex-wrap items-center gap-3 rounded-md border border-accent/30 bg-accent/5 px-3 py-2 text-sm","aria-label":"Tag selection actions",children:[e.jsxs("span",{className:"text-fg-muted",children:[y," selected: ",Array.from(h).join(", ")]}),e.jsx("button",{type:"button",onClick:()=>p(!0),disabled:y<2||a,className:"rounded-md bg-accent px-3 py-1 text-xs font-medium text-[--color-on-accent] hover:bg-accent-hover disabled:opacity-40",children:"Merge into…"}),e.jsx("button",{type:"button",onClick:g,className:"text-xs text-fg-muted hover:text-accent",children:"Clear"})]}):null,n.isPending?e.jsx(se,{}):n.isError?e.jsx(re,{error:n.error}):k.length===0?e.jsx(le,{filtering:i.trim().length>0,hasAny:(n.data??[]).length>0}):e.jsx("ul",{className:"divide-y divide-border rounded-md border border-border bg-card","aria-label":"Tag list",children:k.map(s=>e.jsx(ae,{tag:s,selected:h.has(s.name),onToggle:()=>r(s.name),onRename:()=>v(s.name),onEditSchema:()=>C(s.name),pinned:o(s.name),onTogglePin:()=>f(s.name),offline:a},s.name))}),n.data&&n.data.length>0?e.jsxs("p",{className:"mt-6 text-xs text-fg-dim",children:[k.length," / ",n.data.length," tag",n.data.length===1?"":"s"]}):null,N!==null?e.jsx(O,{mode:"rename",sources:[N],tagOptions:S,onClose:()=>v(null),pending:E.isPending||w.isPending,offline:a,onRun:s=>E.mutateAsync({oldName:N,newName:s}),onRunMerge:s=>w.mutateAsync({sources:[N],target:s})}):null,x?e.jsx(O,{mode:"merge",sources:Array.from(h),tagOptions:S,onClose:()=>p(!1),pending:w.isPending,offline:a,onRun:async s=>{const R=await w.mutateAsync({sources:Array.from(h),target:s});return g(),R}}):null,T!==null?e.jsx(ee,{tagName:T,onClose:()=>C(null)}):null]})}function ae({tag:t,selected:n,onToggle:l,onRename:o,onEditSchema:f,pinned:i,onTogglePin:m,offline:d}){const b=t.fields?Object.keys(t.fields):[],h=t.parent_names??[],j=!!t.description||b.length>0||h.length>0;return e.jsxs("li",{className:"flex flex-col gap-1 px-3 py-2 text-sm",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("input",{type:"checkbox",checked:n,onChange:l,"aria-label":`Select tag ${t.name}`,className:"accent-accent"}),e.jsxs(F,{to:`/all?tag=${encodeURIComponent(t.name)}`,className:"flex flex-1 items-baseline gap-2 text-fg hover:text-accent focus-visible:outline-2 focus-visible:outline-accent",children:[e.jsxs("span",{className:"font-mono",children:["#",t.name]}),e.jsx("span",{className:"text-xs text-fg-dim",children:t.count??0})]}),e.jsx("button",{type:"button",onClick:m,className:i?"text-xs font-medium text-accent hover:text-accent-hover":"text-xs text-fg-muted hover:text-accent","aria-label":i?`Unpin tag ${t.name}`:`Pin tag ${t.name}`,"aria-pressed":i,title:i?"Pinned to home strip — click to unpin":"Pin to home strip",children:i?"★ Pinned":"☆ Pin"}),e.jsx("button",{type:"button",onClick:f,disabled:d,className:"text-xs text-fg-muted hover:text-accent disabled:opacity-40","aria-label":`Edit schema for tag ${t.name}`,children:j?"Schema":"+ Schema"}),e.jsx("button",{type:"button",onClick:o,disabled:d,className:"text-xs text-fg-muted hover:text-accent disabled:opacity-40","aria-label":`Rename tag ${t.name}`,children:"Rename"})]}),j?e.jsxs("dl",{className:"ml-7 flex flex-wrap items-baseline gap-x-3 gap-y-1 text-xs text-fg-dim","aria-label":`Schema for ${t.name}`,children:[t.description?e.jsxs("div",{className:"flex w-full items-baseline gap-1.5",children:[e.jsx("dt",{className:"sr-only",children:"Description"}),e.jsx("dd",{className:"italic",children:t.description})]}):null,b.length>0?e.jsxs("div",{className:"flex items-baseline gap-1.5",children:[e.jsx("dt",{className:"uppercase tracking-wider",children:"Fields"}),e.jsx("dd",{className:"font-mono text-fg-muted",children:b.map(N=>{var v,x;return`${N}: ${((x=(v=t.fields)==null?void 0:v[N])==null?void 0:x.type)??"?"}`}).join(", ")})]}):null,h.length>0?e.jsxs("div",{className:"flex items-baseline gap-1.5",children:[e.jsx("dt",{className:"uppercase tracking-wider",children:"Parents"}),e.jsx("dd",{className:"font-mono text-fg-muted",children:h.join(", ")})]}):null]}):null]})}function ne(t,n,l){const o=n.trim().toLowerCase(),i=[...o?t.filter(m=>m.name.toLowerCase().includes(o)):t];return l==="alpha"?i.sort((m,d)=>m.name.localeCompare(d.name)):i.sort((m,d)=>(d.count??0)-(m.count??0)||m.name.localeCompare(d.name)),i}function se(){return e.jsx("div",{className:"divide-y divide-border rounded-md border border-border bg-card","aria-busy":"true",children:[0,1,2,3,4].map(t=>e.jsx("div",{className:"h-10 animate-pulse bg-card/60"},t))})}function re({error:t}){const n=t instanceof M;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 tags"}),e.jsx("p",{className:"mb-4 text-sm text-fg-muted",children:t.message}),n?e.jsx(F,{to:"/add",className:"inline-block rounded-md bg-accent px-4 py-2 text-sm font-medium text-[--color-on-accent] hover:bg-accent-hover",children:"Reconnect vault"}):null]})}function le({filtering:t,hasAny:n}){return t&&n?e.jsx("div",{className:"rounded-md border border-border bg-card p-10 text-center",children:e.jsx("p",{className:"text-fg-muted",children:"No tags match your filter."})}):e.jsxs("div",{className:"rounded-md border border-border bg-card p-10 text-center",children:[e.jsx("p",{className:"mb-3 text-fg-muted",children:"No tags in this vault yet."}),e.jsx(F,{to:"/new",className:"inline-block rounded-md bg-accent px-4 py-2 text-sm font-medium text-[--color-on-accent] hover:bg-accent-hover",children:"Create a note"})]})}export{ce as Tags};
@@ -0,0 +1,3 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./react-force-graph-2d-DF72c1gy.js","./index-BdyNnuNw.js","./index-C9Y7w-_L.css"])))=>i.map(i=>d[i]);
2
+ import{at as N,a2 as w,M as f,x as s,N as k,L as v,a9 as C,V as M,_ as I}from"./index-BdyNnuNw.js";const S={search:"",tags:[]};function T(e){const t=new Map;for(const l of e)t.set(l.id,l);const a=new Map,o=new Map;for(const l of e)for(const n of l.links??[]){if(n.sourceId===n.targetId||!t.has(n.sourceId)||!t.has(n.targetId))continue;const c=`${n.sourceId}|${n.targetId}|${n.relationship}`;a.has(c)||(a.set(c,{source:n.sourceId,target:n.targetId,relationship:n.relationship}),o.set(n.sourceId,(o.get(n.sourceId)??0)+1),o.set(n.targetId,(o.get(n.targetId)??0)+1))}return{nodes:e.map(l=>{var c;const n=l.tags??[];return{id:l.id,path:l.path,title:A(l),tags:n,topTag:n[0],degree:o.get(l.id)??0,summary:typeof((c=l.metadata)==null?void 0:c.summary)=="string"?l.metadata.summary:void 0}}),edges:[...a.values()]}}function A(e){return e.path?(e.path.split("/").pop()??e.path).replace(/\.md$/i,""):e.id}function R(e,t){const a=t.search.trim().toLowerCase();return!(a&&![e.path??"",e.title,e.id].join(" ").toLowerCase().includes(a)||t.tags.length>0&&!t.tags.some(d=>e.tags.includes(d)))}function E(e){const t=new Map;for(const a of e)for(const o of a.tags)t.set(o,(t.get(o)??0)+1);return[...t.entries()].sort((a,o)=>o[1]-a[1]||a[0].localeCompare(o[0])).map(([a])=>a)}function _(e){if(!e)return"#8a9a7a";let t=0;for(let o=0;o<e.length;o++)t=t*31+e.charCodeAt(o)&16777215;return`hsl(${t%360}, 40%, 55%)`}const F=f.lazy(()=>I(()=>import("./react-force-graph-2d-DF72c1gy.js"),__vite__mapDeps([0,1,2]),import.meta.url)),L=20;function O(){const e=N(c=>c.getActiveVault()),t=w(),[a,o]=f.useState(S),d=f.useMemo(()=>t.data?T(t.data):null,[t.data]),l=f.useMemo(()=>d?E(d.nodes):[],[d]),n=f.useMemo(()=>d?new Set(d.nodes.filter(c=>R(c,a)).map(c=>c.id)):new Set,[d,a]);return e?s.jsxs("div",{className:"flex h-[calc(100dvh-5rem)] flex-col",children:[s.jsx("div",{className:"border-b border-border bg-card/40 px-6 py-3",children:s.jsxs("div",{className:"mx-auto flex max-w-6xl flex-wrap items-center gap-4",children:[s.jsx("input",{type:"search",value:a.search,onChange:c=>o(m=>({...m,search:c.target.value})),placeholder:"Search nodes…","aria-label":"Search graph nodes",className:"min-w-48 rounded-md border border-border bg-card px-3 py-1.5 text-sm text-fg focus:border-accent focus:outline-none"}),s.jsx($,{allTags:l,selected:a.tags,onChange:c=>o(m=>({...m,tags:c}))}),d?s.jsxs("span",{className:"text-xs text-fg-dim",children:[n.size," / ",d.nodes.length," notes"]}):null]})}),s.jsx("div",{className:"min-h-0 flex-1",children:s.jsx(P,{query:t,graph:d,matched:n})})]}):s.jsx(k,{to:"/",replace:!0})}function P({query:e,graph:t,matched:a}){return e.isPending?s.jsx(y,{message:"Loading vault…"}):e.isError?s.jsx(B,{error:e.error}):!t||t.nodes.length===0?s.jsx("div",{className:"flex h-full items-center justify-center p-10",children:s.jsxs("div",{className:"max-w-sm rounded-md border border-border bg-card p-8 text-center",children:[s.jsx("p",{className:"mb-2 font-serif text-xl",children:"No notes yet"}),s.jsx("p",{className:"mb-4 text-sm text-fg-muted",children:"This vault is empty. Start by creating the first note."}),s.jsx(v,{to:"/new",className:"inline-block rounded-md bg-accent px-4 py-2 text-sm font-medium text-[--color-on-accent] hover:bg-accent-hover",children:"Create a note"})]})}):s.jsx(z,{graph:t,matched:a})}function $({allTags:e,selected:t,onChange:a}){const o=e.slice(0,L);if(o.length===0)return null;const d=l=>a(t.includes(l)?t.filter(n=>n!==l):[...t,l]);return s.jsxs("fieldset",{"aria-label":"Filter by tag",className:"flex flex-wrap items-center gap-1 text-xs text-fg-dim",children:[s.jsx("legend",{className:"mr-1 inline-block",children:"Tags"}),o.map(l=>{const n=t.includes(l);return s.jsx("button",{type:"button","aria-pressed":n,onClick:()=>d(l),className:n?"max-w-full break-all rounded-full border border-accent bg-accent/10 px-2 py-0.5 text-accent":"max-w-full break-all rounded-full border border-border bg-card px-2 py-0.5 hover:text-accent",children:l},l)}),t.length>0?s.jsx("button",{type:"button",onClick:()=>a([]),className:"ml-1 text-xs text-fg-dim hover:text-accent",children:"Clear"}):null]})}function y({message:e}){return s.jsx("div",{"aria-busy":"true",className:"flex h-full animate-pulse items-center justify-center bg-card/30 text-sm text-fg-dim",children:e})}function z({graph:e,matched:t}){const a=C(),o=f.useRef(null),d=f.useRef(null),[l,n]=f.useState({w:800,h:600});f.useEffect(()=>{const r=o.current;if(!r)return;const i=()=>{const u=r.getBoundingClientRect();n({w:Math.max(320,Math.floor(u.width)),h:Math.max(320,Math.floor(u.height))})};i();const h=new ResizeObserver(i);return h.observe(r),()=>h.disconnect()},[]);const c=()=>{var r,i;(i=(r=d.current)==null?void 0:r.zoomToFit)==null||i.call(r,400,40)},m=f.useMemo(()=>({nodes:e.nodes.map(r=>({...r})),links:e.edges.map(r=>({source:r.source,target:r.target,rel:r.relationship}))}),[e]),g=t.size!==e.nodes.length,j=r=>!g||t.has(r)?1:.15;return s.jsxs("div",{ref:o,"data-testid":"vault-graph-canvas",className:"relative h-full w-full touch-none",children:[s.jsx(f.Suspense,{fallback:s.jsx(y,{message:"Rendering graph…"}),children:s.jsx(F,{ref:d,graphData:m,width:l.w,height:l.h,backgroundColor:"rgba(0,0,0,0)",nodeLabel:r=>V(r),nodeRelSize:5,nodeVal:r=>2+Math.min(r.degree,12),nodeColor:r=>{const i=r,h=_(i.topTag);return g&&!t.has(i.id)?G(h):h},nodePointerAreaPaint:(r,i,h)=>{const u=r;if(u.x==null||u.y==null)return;const x=2+Math.min(u.degree,12),p=Math.max(Math.sqrt(x)*5,10);h.fillStyle=i,h.beginPath(),h.arc(u.x,u.y,p,0,2*Math.PI),h.fill()},linkColor:r=>{const i=r,h=b(i.source),u=b(i.target);return g&&(!t.has(h)||!t.has(u))?"rgba(160, 160, 160, 0.08)":"rgba(160, 160, 160, 0.35)"},linkDirectionalArrowLength:2.5,linkDirectionalArrowRelPos:1,cooldownTicks:100,onEngineStop:()=>c(),nodeCanvasObjectMode:()=>"after",nodeCanvasObject:(r,i,h)=>{const u=r;if(u.x==null||u.y==null||j(u.id)<.5)return;const p=10/h;i.font=`${p}px sans-serif`,i.fillStyle="rgba(220, 220, 220, 0.8)",i.textAlign="left",i.textBaseline="middle",i.fillText(u.title,u.x+6,u.y)},onNodeClick:r=>{a(`/n/${encodeURIComponent(r.id)}`)}})}),s.jsx("button",{type:"button",onClick:c,className:"absolute right-3 bottom-3 rounded-md border border-border bg-card/90 px-3 py-1.5 text-xs text-fg-muted shadow-sm backdrop-blur hover:text-accent",children:"Fit to screen"})]})}function V(e){const t=[e.path??e.id,`${e.degree} link${e.degree===1?"":"s"}`];return e.tags.length>0&&t.push(`tags: ${e.tags.join(", ")}`),e.summary&&t.push(e.summary),t.join(`
3
+ `)}function G(e){return e.startsWith("hsl(")?e.replace("hsl(","hsla(").replace(")",", 0.2)"):e}function b(e){return typeof e=="string"?e:e&&typeof e=="object"&&"id"in e?String(e.id):""}function B({error:e}){const t=e instanceof M;return s.jsx("div",{className:"flex h-full items-center justify-center p-10",children:s.jsxs("div",{className:"max-w-md rounded-md border border-red-500/30 bg-red-500/5 p-6",children:[s.jsx("p",{className:"mb-2 font-medium text-red-400",children:t?"Session expired":"Could not load vault"}),s.jsx("p",{className:"mb-4 text-sm text-fg-muted",children:e.message}),t?s.jsx(v,{to:"/add",className:"inline-block rounded-md bg-accent px-4 py-2 text-sm font-medium text-[--color-on-accent] hover:bg-accent-hover",children:"Reconnect vault"}):null]})})}export{O as VaultGraph};
@@ -1 +1 @@
1
- import{ai as r,v as e,L as i}from"./index-DQ3LtJxh.js";function m(c){let s;try{s=new URL(c)}catch{return!1}const a=s.pathname.split("/").filter(Boolean);return!(a.length>=2&&a[0]==="vault")}function u(){const c=r(t=>t.vaults),s=r(t=>t.activeVaultId),a=r(t=>t.removeVault),o=r(t=>t.setActiveVault),l=Object.values(c).sort((t,n)=>t.name.localeCompare(n.name));return e.jsxs("div",{className:"mx-auto max-w-3xl px-6 py-16",children:[e.jsxs("div",{className:"mb-8 flex items-center justify-between",children:[e.jsx("h1",{className:"font-serif text-4xl tracking-tight",children:"Vaults"}),e.jsx(i,{to:"/add",className:"rounded-md bg-accent px-4 py-2 text-sm font-medium text-[--color-on-accent] hover:bg-accent-hover",children:"Add vault"})]}),l.length===0?e.jsx("p",{className:"text-fg-muted",children:"No vaults connected yet."}):e.jsx("ul",{className:"space-y-3",children:l.map(t=>{const n=t.id===s,d=m(t.url);return e.jsxs("li",{className:"rounded-lg border border-border bg-card p-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"font-serif text-lg text-fg",children:t.name}),n?e.jsx("span",{className:"rounded bg-accent/10 px-2 py-0.5 text-xs text-accent",children:"active"}):null,e.jsx("span",{className:"rounded border border-border px-2 py-0.5 text-xs text-fg-dim",children:t.scope}),d?e.jsx("span",{className:"rounded border border-amber-500/40 bg-amber-500/10 px-2 py-0.5 text-xs text-amber-500",children:"needs reconnect"}):null]}),e.jsx("p",{className:"mt-1 truncate font-mono text-xs text-fg-muted",children:t.url})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-4 text-sm",children:[n?null:e.jsx("button",{type:"button",onClick:()=>o(t.id),className:"text-fg-muted hover:text-accent",children:"Make active"}),e.jsx("button",{type:"button",onClick:()=>{confirm(`Remove ${t.name}? The access token will be deleted.`)&&a(t.id)},className:"text-red-400 hover:text-red-300",children:"Remove"})]})]}),d?e.jsxs("p",{className:"mt-3 rounded border border-amber-500/30 bg-amber-500/5 px-3 py-2 text-xs text-amber-500",children:["Vault now serves under ",e.jsx("code",{children:"/vault/<name>/"}),". This stored URL is from the older scheme and won't reach the new endpoints. Remove this entry and"," ",e.jsx(i,{to:"/add",className:"underline",children:"add it again"})," ","— discovery will pick the right URL automatically."]}):null]},t.id)})})]})}export{u as Vaults};
1
+ import{at as r,x as e,L as i}from"./index-BdyNnuNw.js";function m(c){let s;try{s=new URL(c)}catch{return!1}const a=s.pathname.split("/").filter(Boolean);return!(a.length>=2&&a[0]==="vault")}function u(){const c=r(t=>t.vaults),s=r(t=>t.activeVaultId),a=r(t=>t.removeVault),o=r(t=>t.setActiveVault),l=Object.values(c).sort((t,n)=>t.name.localeCompare(n.name));return e.jsxs("div",{className:"mx-auto max-w-3xl px-6 py-16",children:[e.jsxs("div",{className:"mb-8 flex items-center justify-between",children:[e.jsx("h1",{className:"font-serif text-4xl tracking-tight",children:"Vaults"}),e.jsx(i,{to:"/add",className:"rounded-md bg-accent px-4 py-2 text-sm font-medium text-[--color-on-accent] hover:bg-accent-hover",children:"Add vault"})]}),l.length===0?e.jsx("p",{className:"text-fg-muted",children:"No vaults connected yet."}):e.jsx("ul",{className:"space-y-3",children:l.map(t=>{const n=t.id===s,d=m(t.url);return e.jsxs("li",{className:"rounded-lg border border-border bg-card p-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"font-serif text-lg text-fg",children:t.name}),n?e.jsx("span",{className:"rounded bg-accent/10 px-2 py-0.5 text-xs text-accent",children:"active"}):null,e.jsx("span",{className:"rounded border border-border px-2 py-0.5 text-xs text-fg-dim",children:t.scope}),d?e.jsx("span",{className:"rounded border border-amber-500/40 bg-amber-500/10 px-2 py-0.5 text-xs text-amber-500",children:"needs reconnect"}):null]}),e.jsx("p",{className:"mt-1 truncate font-mono text-xs text-fg-muted",children:t.url})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-4 text-sm",children:[n?null:e.jsx("button",{type:"button",onClick:()=>o(t.id),className:"text-fg-muted hover:text-accent",children:"Make active"}),e.jsx("button",{type:"button",onClick:()=>{confirm(`Remove ${t.name}? The access token will be deleted.`)&&a(t.id)},className:"text-red-400 hover:text-red-300",children:"Remove"})]})]}),d?e.jsxs("p",{className:"mt-3 rounded border border-amber-500/30 bg-amber-500/5 px-3 py-2 text-xs text-amber-500",children:["Vault now serves under ",e.jsx("code",{children:"/vault/<name>/"}),". This stored URL is from the older scheme and won't reach the new endpoints. Remove this entry and"," ",e.jsx(i,{to:"/add",className:"underline",children:"add it again"})," ","— discovery will pick the right URL automatically."]}):null]},t.id)})})]})}export{u as Vaults};
@@ -1,2 +1,2 @@
1
- import{B as n,v as i,d as h,S as v}from"./index-DQ3LtJxh.js";function E({onDropFiles:e,children:t,className:a,hint:s}){const[c,u]=n.useState(!1),o=n.useRef(0),d=n.useCallback(r=>{l(r.dataTransfer)&&(r.preventDefault(),o.current+=1,u(!0))},[]),m=n.useCallback(r=>{l(r.dataTransfer)&&(r.preventDefault(),o.current=Math.max(0,o.current-1),o.current===0&&u(!1))},[]),p=n.useCallback(r=>{l(r.dataTransfer)&&(r.preventDefault(),r.dataTransfer.dropEffect="copy")},[]),x=n.useCallback(r=>{if(!l(r.dataTransfer))return;r.preventDefault(),u(!1),o.current=0;const f=Array.from(r.dataTransfer.files);f.length>0&&e(f)},[e]);return i.jsxs("div",{className:`relative ${a??""}`,onDragEnter:d,onDragLeave:m,onDragOver:p,onDrop:x,children:[t,c?i.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 z-20 flex items-center justify-center rounded-md border-2 border-dashed border-accent bg-accent/10 text-sm text-accent",children:i.jsxs("div",{className:"rounded-md bg-bg/80 px-4 py-2 font-medium shadow",children:["Drop to attach",s?i.jsxs("span",{className:"ml-2 text-fg-dim",children:["— ",s]}):null]})}):null]})}function l(e){if(!e)return!1;const t=e.types;for(let a=0;a<t.length;a++)if(t[a]==="Files")return!0;return!1}function $(e){const t=e.lastIndexOf(".");return t>=0?e.slice(t+1).toLowerCase():""}function g(e){return`${(e/(1024*1024)).toFixed(1)} MB`}function T(e){if(e.size>h)return`${e.name} is too large (${g(e.size)}). Max: 100 MB.`;const t=$(e.name);return v.has(t)?null:`${e.name}: .${t||"?"} is not in the vault allowlist.`}function D(e,t,a={}){const s=`/api/storage/${e.path}`,c=a.newline===!1?"":`
1
+ import{M as n,x as i,d as h,S as v}from"./index-BdyNnuNw.js";function E({onDropFiles:e,children:t,className:a,hint:s}){const[c,u]=n.useState(!1),o=n.useRef(0),d=n.useCallback(r=>{l(r.dataTransfer)&&(r.preventDefault(),o.current+=1,u(!0))},[]),m=n.useCallback(r=>{l(r.dataTransfer)&&(r.preventDefault(),o.current=Math.max(0,o.current-1),o.current===0&&u(!1))},[]),p=n.useCallback(r=>{l(r.dataTransfer)&&(r.preventDefault(),r.dataTransfer.dropEffect="copy")},[]),x=n.useCallback(r=>{if(!l(r.dataTransfer))return;r.preventDefault(),u(!1),o.current=0;const f=Array.from(r.dataTransfer.files);f.length>0&&e(f)},[e]);return i.jsxs("div",{className:`relative ${a??""}`,onDragEnter:d,onDragLeave:m,onDragOver:p,onDrop:x,children:[t,c?i.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 z-20 flex items-center justify-center rounded-md border-2 border-dashed border-accent bg-accent/10 text-sm text-accent",children:i.jsxs("div",{className:"rounded-md bg-bg/80 px-4 py-2 font-medium shadow",children:["Drop to attach",s?i.jsxs("span",{className:"ml-2 text-fg-dim",children:["— ",s]}):null]})}):null]})}function l(e){if(!e)return!1;const t=e.types;for(let a=0;a<t.length;a++)if(t[a]==="Files")return!0;return!1}function $(e){const t=e.lastIndexOf(".");return t>=0?e.slice(t+1).toLowerCase():""}function g(e){return`${(e/(1024*1024)).toFixed(1)} MB`}function T(e){if(e.size>h)return`${e.name} is too large (${g(e.size)}). Max: 100 MB.`;const t=$(e.name);return v.has(t)?null:`${e.name}: .${t||"?"} is not in the vault allowlist.`}function D(e,t,a={}){const s=`/api/storage/${e.path}`,c=a.newline===!1?"":`
2
2
  `;return e.mimeType.startsWith("image/")?`![${t}](${s})${c}`:`[${t}](${s})${c}`}export{E as A,$ as f,D as m,T as v};