clankie 0.2.3 → 0.2.5

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.
@@ -0,0 +1,123 @@
1
+ import{c as rt,j as f,B as Et,X as ug,f as mo,m as vn,M as Ma,r as m,N as dg,O as fg,Q as pg,R as Qs,T as el,U as Wr,V as tl,W as nl,Y as rl,Z as ol,p as go,_ as hg,$ as mg,a0 as gg,a1 as vg,a2 as nu,C as Mt,s as Dt,w as Zt,a3 as L,a4 as Da,a5 as ru,a6 as xg,a7 as bg,a8 as yg,a9 as wg,aa as kg,ab as Sg,ac as Cg,ad as _g,ae as Eg,af as Tg,ag as Pg,ah as Ng,ai as Ig,J as Nr,aj as Ag,ak as Rg,al as jg,am as Og,K as Mg,q as Dg,A as $g,L as zg,H as Lg}from"./main-BKnxVDO_.js";import{L as ou}from"./loader-circle-D0gKqnL5.js";const Fg=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],Bg=rt("bot",Fg);const Vg=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],il=rt("check",Vg);const Ug=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Zg=rt("chevron-down",Ug);const Hg=[["path",{d:"M14.364 13.634a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506l4.013-4.009a1 1 0 0 0-3.004-3.004z",key:"ukzhwg"}],["path",{d:"M14.487 7.858A1 1 0 0 1 14 7V2",key:"1klhew"}],["path",{d:"M20 19.645V20a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l2.516 2.516",key:"rxaxab"}],["path",{d:"M8 18h1",key:"13wk12"}]],Gg=rt("file-pen-line",Hg);const Wg=[["path",{d:"M11.35 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5.35",key:"17jvcc"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M14 19h6",key:"bvotb8"}],["path",{d:"M17 16v6",key:"18yu1i"}]],qg=rt("file-plus-corner",Wg);const Kg=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Jg=rt("file-text",Kg);const Yg=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],Xg=rt("file",Yg);const Qg=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],ev=rt("folder-open",Qg);const tv=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],nv=rt("folder-tree",tv);const rv=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],ov=rt("paperclip",rv);const iv=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],av=rt("search",iv);const sv=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],lv=rt("send",sv);const cv=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],uv=rt("terminal",cv);const dv=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],fv=rt("user",dv);const pv=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],bi=rt("wrench",pv);function hv({attachments:e,onRemove:t}){return e.length===0?null:f.jsx("div",{className:"flex flex-wrap gap-2 pb-2",children:e.map(n=>{const r=n.mimeType.startsWith("image/");return f.jsxs("div",{className:mo("group relative flex items-center gap-2 rounded-lg border border-border bg-muted px-3 py-2","hover:bg-muted/80 transition-colors"),children:[r&&n.preview?f.jsx("div",{className:"relative h-12 w-12 shrink-0 overflow-hidden rounded",children:f.jsx("img",{src:n.preview,alt:n.file.name,className:"h-full w-full object-cover"})}):f.jsx("div",{className:"flex h-12 w-12 shrink-0 items-center justify-center rounded bg-background",children:f.jsx(Xg,{className:"h-6 w-6 text-muted-foreground"})}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("p",{className:"text-sm font-medium truncate",children:n.file.name}),f.jsx("p",{className:"text-xs text-muted-foreground",children:mv(n.file.size)})]}),f.jsxs(Et,{type:"button",variant:"ghost",size:"icon-xs",onClick:()=>t(n.id),className:"shrink-0",title:"Remove attachment",children:[f.jsx(ug,{className:"h-3 w-3"}),f.jsxs("span",{className:"sr-only",children:["Remove ",n.file.name]})]})]},n.id)})})}function mv(e){if(e===0)return"0 B";const t=1024,n=["B","KB","MB","GB"],r=Math.floor(Math.log(e)/Math.log(t));return`${Math.round(e/t**r*100)/100} ${n[r]}`}function yi(e){return{anthropic:"Anthropic",openai:"OpenAI",google:"Google","amazon-bedrock":"Amazon Bedrock",openrouter:"OpenRouter","vercel-ai-gateway":"Vercel AI Gateway",xai:"xAI",mistral:"Mistral",groq:"Groq",huggingface:"Hugging Face","google-vertex":"Google Vertex AI","google-antigravity":"Google Antigravity","google-gemini-cli":"Google Gemini CLI","azure-openai-responses":"Azure OpenAI","github-copilot":"GitHub Copilot",cerebras:"Cerebras",opencode:"OpenCode",zai:"Z.ai",minimax:"MiniMax","minimax-cn":"MiniMax (CN)","kimi-coding":"Kimi"}[e]||e.split("-").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" ")}function al(e){const t=e.replace(/\s+\((EU|US|Global|latest|free|exacto|thinking|Antigravity)\)$/i,"").trim(),n=t.match(/\s+([\d.]+)$/);if(n){const r=n[1],o=parseFloat(r);if(!isNaN(o))return{family:t.substring(0,t.length-n[0].length).trim(),version:o}}return{family:t,version:null}}function gv(e){const t=new Map;for(const o of e){const{family:i}=al(o.name);t.has(i)||t.set(i,[]),t.get(i).push(o)}const n=[],r=[];for(const[o,i]of t){if(i.length===1){n.push(i[0]);continue}const a=i.map(c=>({model:c,...al(c.name)})),s=a.filter(c=>c.version===null),l=a.filter(c=>c.version!==null);if(l.length===0)n.push(...i);else{const c=Math.max(...l.map(p=>p.version)),d=l.filter(p=>p.version===c),u=l.filter(p=>p.version!==c);n.push(...d.map(p=>p.model)),n.push(...s.map(p=>p.model)),r.push(...u.map(p=>p.model))}}return{latest:n,older:r}}function vv(e){const t=new Map;for(const n of e)t.has(n.provider)||t.set(n.provider,[]),t.get(n.provider).push(n);for(const[n,r]of t)r.sort((o,i)=>o.name.localeCompare(i.name));return t}function xv(){const{sessionId:e,model:t,availableModels:n,thinkingLevel:r,isStreaming:o}=vn(Ma,g=>({sessionId:g.sessionId,model:g.model,availableModels:g.availableModels,thinkingLevel:g.thinkingLevel,isStreaming:g.isStreaming})),[i,a]=m.useState(!1),{latestModels:s,olderModels:l,shouldShowSubmenu:c}=m.useMemo(()=>{if(n.length===0)return{latestModels:[],olderModels:[],shouldShowSubmenu:!1};if(n.length<=10)return{latestModels:[...n].sort((y,w)=>y.name.localeCompare(w.name)),olderModels:[],shouldShowSubmenu:!1};const{latest:g,older:b}=gv(n);return g.sort((x,y)=>x.name.localeCompare(y.name)),{latestModels:g,olderModels:b,shouldShowSubmenu:b.length>0}},[n]),d=m.useMemo(()=>vv(l),[l]),u=async(g,b)=>{if(!e){console.log("[ModelSelector] No sessionId");return}console.log("[ModelSelector] Changing model:",{provider:g,modelId:b,sessionId:e});const x=go.getClient();if(x)try{const y=await x.setModel(e,g,b);console.log("[ModelSelector] Model changed successfully:",y),mg(y),a(!1)}catch(y){console.error("[ModelSelector] Failed to set model:",y)}else console.error("[ModelSelector] No client available")},p=async g=>{if(!e)return;const b=go.getClient();if(b)try{await b.setThinkingLevel(e,g),hg(g)}catch(x){console.error("Failed to set thinking level:",x)}},h=[{value:"off",label:"Off"},{value:"minimal",label:"Minimal"},{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"},{value:"xhigh",label:"XHigh"}];if(!t)return null;const v=g=>{const b=t.provider===g.provider&&t.id===g.id;return f.jsxs(ol,{onClick:()=>u(g.provider,g.id),className:"flex items-start gap-2 py-2",children:[f.jsx("div",{className:"flex h-5 w-5 items-center justify-center shrink-0",children:b&&f.jsx(il,{className:"h-4 w-4"})}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("div",{className:"font-medium",children:g.name}),f.jsx("div",{className:"text-xs text-muted-foreground line-clamp-2",children:bv(g)})]})]},`${g.provider}/${g.id}`)};return f.jsxs(dg,{open:i,onOpenChange:a,children:[f.jsxs(fg,{type:"button",disabled:o||!e,className:mo("flex flex-col items-start gap-0.5 rounded-lg border border-border bg-background px-3 py-1.5 text-sm transition-colors","hover:bg-muted disabled:cursor-not-allowed disabled:opacity-50","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"),children:[f.jsxs("div",{className:"flex items-center gap-1.5 w-full",children:[f.jsx("span",{className:"font-medium",children:t.name}),f.jsx(Zg,{className:"h-4 w-4 text-muted-foreground ml-auto"})]}),r!=="medium"&&f.jsxs("span",{className:"text-xs text-muted-foreground",children:["thinking: ",r]})]}),f.jsxs(pg,{align:"end",className:"w-80",children:[f.jsx(Qs,{children:f.jsx(el,{children:"Select Model"})}),f.jsx(Wr,{}),f.jsx("div",{className:"max-h-96 overflow-y-auto",children:s.map(v)}),c&&f.jsxs(f.Fragment,{children:[f.jsx(Wr,{}),f.jsxs(tl,{children:[f.jsx(nl,{children:f.jsx("span",{children:"Other models"})}),f.jsx(rl,{className:"w-80 max-h-96 overflow-y-auto",children:Array.from(d.entries()).sort(([g],[b])=>yi(g).localeCompare(yi(b))).map(([g,b])=>f.jsxs("div",{children:[f.jsx(Qs,{children:f.jsx(el,{className:"sticky top-0 bg-popover z-10",children:yi(g)})}),b.map(v),f.jsx(Wr,{className:"my-1"})]},g))})]})]}),f.jsx(Wr,{}),f.jsxs(tl,{children:[f.jsx(nl,{children:f.jsx("span",{children:"Thinking Level"})}),f.jsx(rl,{children:h.map(g=>f.jsxs(ol,{onClick:()=>p(g.value),className:"flex items-center gap-2",children:[f.jsx("div",{className:"flex h-5 w-5 items-center justify-center shrink-0",children:r===g.value&&f.jsx(il,{className:"h-4 w-4"})}),f.jsx("span",{children:g.label})]},g.value))})]})]})]})}function bv(e){const t=e.name.toLowerCase();return t.includes("opus")?"Most capable for ambitious work":t.includes("sonnet")?"Most efficient for everyday tasks":t.includes("haiku")?"Fastest for quick answers":t.includes("gpt-4")?"Advanced reasoning and analysis":t.includes("gpt-3.5")?"Fast and efficient":t.includes("gemini")?"Google's multimodal AI":t.includes("claude")?"Anthropic's AI assistant":`${e.provider}/${e.id}`}const sl=10*1024*1024,ll=20*1024*1024;function yv(){const{sessionId:e,isStreaming:t}=vn(Ma,P=>({sessionId:P.sessionId,isStreaming:P.isStreaming})),[n,r]=m.useState(""),[o,i]=m.useState([]),[a,s]=m.useState(!1),l=m.useRef(null),c=m.useRef(null),d=m.useCallback(P=>new Promise((C,T)=>{const I=new FileReader;I.onload=()=>{const E=I.result.split(",")[1];C(E)},I.onerror=T,I.readAsDataURL(P)}),[]),u=m.useCallback(P=>P.type.startsWith("image/")?new Promise(C=>{const T=new FileReader;T.onload=()=>C(T.result),T.onerror=()=>C(void 0),T.readAsDataURL(P)}):Promise.resolve(void 0),[]),p=m.useCallback(async P=>{const C=Array.from(P),T=o.reduce((R,E)=>R+E.file.size,0),I=C.reduce((R,E)=>R+E.size,0);if(T+I>ll){alert(`Total attachment size cannot exceed ${ll/1024/1024}MB`);return}for(const R of C){if(R.size>sl){alert(`File "${R.name}" is too large. Maximum size is ${sl/1024/1024}MB`);continue}try{const E=await d(R),N=await u(R),A={id:`${Date.now()}-${Math.random().toString(36).slice(2)}`,file:R,preview:N,base64:E,mimeType:R.type};i(j=>[...j,A])}catch(E){console.error(`Failed to process file "${R.name}":`,E),alert(`Failed to process file "${R.name}"`)}}},[o,d,u]),h=m.useCallback(P=>{const C=P.target.files;C&&C.length>0&&p(C),c.current&&(c.current.value="")},[p]),v=m.useCallback(P=>{P.preventDefault(),P.stopPropagation(),s(!0)},[]),g=m.useCallback(P=>{P.preventDefault(),P.stopPropagation(),s(!1)},[]),b=m.useCallback(P=>{P.preventDefault(),P.stopPropagation(),s(!1);const C=P.dataTransfer.files;C.length>0&&p(C)},[p]),x=m.useCallback(P=>{const C=P.clipboardData.items,T=[];for(const I of Array.from(C))if(I.kind==="file"){const R=I.getAsFile();R&&T.push(R)}T.length>0&&(P.preventDefault(),p(T))},[p]),y=m.useCallback(P=>{i(C=>C.filter(T=>T.id!==P))},[]),w=async()=>{if(!n.trim()&&o.length===0||!e||t)return;const P=n.trim(),C=[...o];r(""),i([]);const T=C.filter(N=>N.mimeType.startsWith("image/")).map(N=>({type:"image",data:N.base64,mimeType:N.mimeType})),I=C.filter(N=>!N.mimeType.startsWith("image/")),R=go.getClient();if(!R){console.error("No client available");return}let E=P;try{for(const N of I)try{const A=await R.uploadAttachment(e,N.file.name,N.base64,N.mimeType);E+=`
2
+ [Attached: ${A.fileName}]`}catch(A){console.error(`Failed to upload ${N.file.name}:`,A)}vg(E||"[Image attachments]"),await R.prompt(e,E,T.length>0?T:void 0)}catch(N){console.error("Failed to send message:",N)}l.current?.focus()},S=P=>{P.key==="Enter"&&(P.ctrlKey||P.metaKey)&&(P.preventDefault(),w())};return f.jsx("div",{className:"border-t border-border bg-card p-4",onDragOver:v,onDragLeave:g,onDrop:b,children:f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsx(hv,{attachments:o,onRemove:y}),f.jsxs("div",{className:"relative",children:[f.jsx(gg,{ref:l,id:"chat-input",name:"message",value:n,onChange:P=>r(P.target.value),onKeyDown:S,onPaste:x,placeholder:"Send a message... (Ctrl+Enter to send)",className:"min-h-[80px] resize-none",disabled:!e||t}),a&&f.jsx("div",{className:"absolute inset-0 flex items-center justify-center rounded-lg border-2 border-dashed border-primary bg-background/80 backdrop-blur-sm",children:f.jsx("p",{className:"text-sm font-medium text-primary",children:"Drop files here"})})]}),f.jsxs("div",{className:"flex items-center justify-between gap-2",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("input",{ref:c,type:"file",multiple:!0,onChange:h,className:"hidden",accept:"image/*,application/pdf,text/*"}),f.jsxs(Et,{type:"button",variant:"ghost",size:"icon-sm",disabled:!e||t,onClick:()=>c.current?.click(),title:"Attach files",children:[f.jsx(ov,{className:"h-4 w-4"}),f.jsx("span",{className:"sr-only",children:"Attach files"})]}),f.jsxs("p",{className:"text-xs text-muted-foreground",children:[f.jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5",children:"Ctrl+Enter"})," ","to send"]})]}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(xv,{}),f.jsxs(Et,{onClick:w,disabled:!n.trim()&&o.length===0||!e||t,size:"icon",children:[f.jsx(lv,{className:"h-4 w-4"}),f.jsx("span",{className:"sr-only",children:"Send message"})]})]})]})]})})}function wv(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const kv=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Sv=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Cv={};function cl(e,t){return(Cv.jsx?Sv:kv).test(e)}const _v=/[ \t\n\f\r]/g;function Ev(e){return typeof e=="object"?e.type==="text"?ul(e.value):!1:ul(e)}function ul(e){return e.replace(_v,"")===""}class Ir{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Ir.prototype.normal={};Ir.prototype.property={};Ir.prototype.space=void 0;function iu(e,t){const n={},r={};for(const o of e)Object.assign(n,o.property),Object.assign(r,o.normal);return new Ir(n,r,t)}function ea(e){return e.toLowerCase()}class st{constructor(t,n){this.attribute=n,this.property=t}}st.prototype.attribute="";st.prototype.booleanish=!1;st.prototype.boolean=!1;st.prototype.commaOrSpaceSeparated=!1;st.prototype.commaSeparated=!1;st.prototype.defined=!1;st.prototype.mustUseProperty=!1;st.prototype.number=!1;st.prototype.overloadedBoolean=!1;st.prototype.property="";st.prototype.spaceSeparated=!1;st.prototype.space=void 0;let Tv=0;const de=Cn(),$e=Cn(),ta=Cn(),F=Cn(),Ce=Cn(),Un=Cn(),pt=Cn();function Cn(){return 2**++Tv}const na=Object.freeze(Object.defineProperty({__proto__:null,boolean:de,booleanish:$e,commaOrSpaceSeparated:pt,commaSeparated:Un,number:F,overloadedBoolean:ta,spaceSeparated:Ce},Symbol.toStringTag,{value:"Module"})),wi=Object.keys(na);class $a extends st{constructor(t,n,r,o){let i=-1;if(super(t,n),dl(this,"space",o),typeof r=="number")for(;++i<wi.length;){const a=wi[i];dl(this,wi[i],(r&na[a])===na[a])}}}$a.prototype.defined=!0;function dl(e,t,n){n&&(e[t]=n)}function Yn(e){const t={},n={};for(const[r,o]of Object.entries(e.properties)){const i=new $a(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[ea(r)]=r,n[ea(i.attribute)]=r}return new Ir(t,n,e.space)}const au=Yn({properties:{ariaActiveDescendant:null,ariaAtomic:$e,ariaAutoComplete:null,ariaBusy:$e,ariaChecked:$e,ariaColCount:F,ariaColIndex:F,ariaColSpan:F,ariaControls:Ce,ariaCurrent:null,ariaDescribedBy:Ce,ariaDetails:null,ariaDisabled:$e,ariaDropEffect:Ce,ariaErrorMessage:null,ariaExpanded:$e,ariaFlowTo:Ce,ariaGrabbed:$e,ariaHasPopup:null,ariaHidden:$e,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ce,ariaLevel:F,ariaLive:null,ariaModal:$e,ariaMultiLine:$e,ariaMultiSelectable:$e,ariaOrientation:null,ariaOwns:Ce,ariaPlaceholder:null,ariaPosInSet:F,ariaPressed:$e,ariaReadOnly:$e,ariaRelevant:null,ariaRequired:$e,ariaRoleDescription:Ce,ariaRowCount:F,ariaRowIndex:F,ariaRowSpan:F,ariaSelected:$e,ariaSetSize:F,ariaSort:null,ariaValueMax:F,ariaValueMin:F,ariaValueNow:F,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function su(e,t){return t in e?e[t]:t}function lu(e,t){return su(e,t.toLowerCase())}const Pv=Yn({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Un,acceptCharset:Ce,accessKey:Ce,action:null,allow:null,allowFullScreen:de,allowPaymentRequest:de,allowUserMedia:de,alt:null,as:null,async:de,autoCapitalize:null,autoComplete:Ce,autoFocus:de,autoPlay:de,blocking:Ce,capture:null,charSet:null,checked:de,cite:null,className:Ce,cols:F,colSpan:null,content:null,contentEditable:$e,controls:de,controlsList:Ce,coords:F|Un,crossOrigin:null,data:null,dateTime:null,decoding:null,default:de,defer:de,dir:null,dirName:null,disabled:de,download:ta,draggable:$e,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:de,formTarget:null,headers:Ce,height:F,hidden:ta,high:F,href:null,hrefLang:null,htmlFor:Ce,httpEquiv:Ce,id:null,imageSizes:null,imageSrcSet:null,inert:de,inputMode:null,integrity:null,is:null,isMap:de,itemId:null,itemProp:Ce,itemRef:Ce,itemScope:de,itemType:Ce,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:de,low:F,manifest:null,max:null,maxLength:F,media:null,method:null,min:null,minLength:F,multiple:de,muted:de,name:null,nonce:null,noModule:de,noValidate:de,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:de,optimum:F,pattern:null,ping:Ce,placeholder:null,playsInline:de,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:de,referrerPolicy:null,rel:Ce,required:de,reversed:de,rows:F,rowSpan:F,sandbox:Ce,scope:null,scoped:de,seamless:de,selected:de,shadowRootClonable:de,shadowRootDelegatesFocus:de,shadowRootMode:null,shape:null,size:F,sizes:null,slot:null,span:F,spellCheck:$e,src:null,srcDoc:null,srcLang:null,srcSet:null,start:F,step:null,style:null,tabIndex:F,target:null,title:null,translate:null,type:null,typeMustMatch:de,useMap:null,value:$e,width:F,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ce,axis:null,background:null,bgColor:null,border:F,borderColor:null,bottomMargin:F,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:de,declare:de,event:null,face:null,frame:null,frameBorder:null,hSpace:F,leftMargin:F,link:null,longDesc:null,lowSrc:null,marginHeight:F,marginWidth:F,noResize:de,noHref:de,noShade:de,noWrap:de,object:null,profile:null,prompt:null,rev:null,rightMargin:F,rules:null,scheme:null,scrolling:$e,standby:null,summary:null,text:null,topMargin:F,valueType:null,version:null,vAlign:null,vLink:null,vSpace:F,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:de,disableRemotePlayback:de,prefix:null,property:null,results:F,security:null,unselectable:null},space:"html",transform:lu}),Nv=Yn({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:pt,accentHeight:F,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:F,amplitude:F,arabicForm:null,ascent:F,attributeName:null,attributeType:null,azimuth:F,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:F,by:null,calcMode:null,capHeight:F,className:Ce,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:F,diffuseConstant:F,direction:null,display:null,dur:null,divisor:F,dominantBaseline:null,download:de,dx:null,dy:null,edgeMode:null,editable:null,elevation:F,enableBackground:null,end:null,event:null,exponent:F,externalResourcesRequired:null,fill:null,fillOpacity:F,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:Un,g2:Un,glyphName:Un,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:F,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:F,horizOriginX:F,horizOriginY:F,id:null,ideographic:F,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:F,k:F,k1:F,k2:F,k3:F,k4:F,kernelMatrix:pt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:F,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:F,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:F,overlineThickness:F,paintOrder:null,panose1:null,path:null,pathLength:F,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ce,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:F,pointsAtY:F,pointsAtZ:F,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:pt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:pt,rev:pt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:pt,requiredFeatures:pt,requiredFonts:pt,requiredFormats:pt,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:F,specularExponent:F,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:F,strikethroughThickness:F,string:null,stroke:null,strokeDashArray:pt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:F,strokeOpacity:F,strokeWidth:null,style:null,surfaceScale:F,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:pt,tabIndex:F,tableValues:null,target:null,targetX:F,targetY:F,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:pt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:F,underlineThickness:F,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:F,values:null,vAlphabetic:F,vMathematical:F,vectorEffect:null,vHanging:F,vIdeographic:F,version:null,vertAdvY:F,vertOriginX:F,vertOriginY:F,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:F,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:su}),cu=Yn({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),uu=Yn({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:lu}),du=Yn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Iv={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"},Av=/[A-Z]/g,fl=/-[a-z]/g,Rv=/^data[-\w.:]+$/i;function jv(e,t){const n=ea(t);let r=t,o=st;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Rv.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(fl,Mv);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!fl.test(i)){let a=i.replace(Av,Ov);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}o=$a}return new o(r,t)}function Ov(e){return"-"+e.toLowerCase()}function Mv(e){return e.charAt(1).toUpperCase()}const Dv=iu([au,Pv,cu,uu,du],"html"),za=iu([au,Nv,cu,uu,du],"svg");function $v(e){return e.join(" ").trim()}var Nn={},ki,pl;function zv(){if(pl)return ki;pl=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,s=/^\s+|\s+$/g,l=`
3
+ `,c="/",d="*",u="",p="comment",h="declaration";function v(b,x){if(typeof b!="string")throw new TypeError("First argument must be a string");if(!b)return[];x=x||{};var y=1,w=1;function S($){var O=$.match(t);O&&(y+=O.length);var B=$.lastIndexOf(l);w=~B?$.length-B:w+$.length}function P(){var $={line:y,column:w};return function(O){return O.position=new C($),R(),O}}function C($){this.start=$,this.end={line:y,column:w},this.source=x.source}C.prototype.content=b;function T($){var O=new Error(x.source+":"+y+":"+w+": "+$);if(O.reason=$,O.filename=x.source,O.line=y,O.column=w,O.source=b,!x.silent)throw O}function I($){var O=$.exec(b);if(O){var B=O[0];return S(B),b=b.slice(B.length),O}}function R(){I(n)}function E($){var O;for($=$||[];O=N();)O!==!1&&$.push(O);return $}function N(){var $=P();if(!(c!=b.charAt(0)||d!=b.charAt(1))){for(var O=2;u!=b.charAt(O)&&(d!=b.charAt(O)||c!=b.charAt(O+1));)++O;if(O+=2,u===b.charAt(O-1))return T("End of comment missing");var B=b.slice(2,O-2);return w+=2,S(B),b=b.slice(O),w+=2,$({type:p,comment:B})}}function A(){var $=P(),O=I(r);if(O){if(N(),!I(o))return T("property missing ':'");var B=I(i),W=$({type:h,property:g(O[0].replace(e,u)),value:B?g(B[0].replace(e,u)):u});return I(a),W}}function j(){var $=[];E($);for(var O;O=A();)O!==!1&&($.push(O),E($));return $}return R(),j()}function g(b){return b?b.replace(s,u):u}return ki=v,ki}var hl;function Lv(){if(hl)return Nn;hl=1;var e=Nn&&Nn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Nn,"__esModule",{value:!0}),Nn.default=n;const t=e(zv());function n(r,o){let i=null;if(!r||typeof r!="string")return i;const a=(0,t.default)(r),s=typeof o=="function";return a.forEach(l=>{if(l.type!=="declaration")return;const{property:c,value:d}=l;s?o(c,d,l):d&&(i=i||{},i[c]=d)}),i}return Nn}var ir={},ml;function Fv(){if(ml)return ir;ml=1,Object.defineProperty(ir,"__esModule",{value:!0}),ir.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,i=function(c){return!c||n.test(c)||e.test(c)},a=function(c,d){return d.toUpperCase()},s=function(c,d){return"".concat(d,"-")},l=function(c,d){return d===void 0&&(d={}),i(c)?c:(c=c.toLowerCase(),d.reactCompat?c=c.replace(o,s):c=c.replace(r,s),c.replace(t,a))};return ir.camelCase=l,ir}var ar,gl;function Bv(){if(gl)return ar;gl=1;var e=ar&&ar.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(Lv()),n=Fv();function r(o,i){var a={};return!o||typeof o!="string"||(0,t.default)(o,function(s,l){s&&l&&(a[(0,n.camelCase)(s,i)]=l)}),a}return r.default=r,ar=r,ar}var Vv=Bv();const Uv=nu(Vv),fu=pu("end"),La=pu("start");function pu(e){return t;function t(n){const r=n&&n.position&&n.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 Zv(e){const t=La(e),n=fu(e);if(t&&n)return{start:t,end:n}}function mr(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?vl(e.position):"start"in e||"end"in e?vl(e):"line"in e||"column"in e?ra(e):""}function ra(e){return xl(e&&e.line)+":"+xl(e&&e.column)}function vl(e){return ra(e&&e.start)+"-"+ra(e&&e.end)}function xl(e){return e&&typeof e=="number"?e:1}class Qe extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let o="",i={},a=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof t=="string"?o=t:!i.cause&&t&&(a=!0,o=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?i.ruleId=r:(i.source=r.slice(0,l),i.ruleId=r.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){const l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}const s=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=s?s.line:void 0,this.name=mr(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Qe.prototype.file="";Qe.prototype.name="";Qe.prototype.reason="";Qe.prototype.message="";Qe.prototype.stack="";Qe.prototype.column=void 0;Qe.prototype.line=void 0;Qe.prototype.ancestors=void 0;Qe.prototype.cause=void 0;Qe.prototype.fatal=void 0;Qe.prototype.place=void 0;Qe.prototype.ruleId=void 0;Qe.prototype.source=void 0;const Fa={}.hasOwnProperty,Hv=new Map,Gv=/[A-Z]/g,Wv=new Set(["table","tbody","thead","tfoot","tr"]),qv=new Set(["td","th"]),hu="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Kv(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=rx(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=nx(n,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?za:Dv,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=mu(o,e,void 0);return i&&typeof i!="string"?i:o.create(e,o.Fragment,{children:i||void 0},void 0)}function mu(e,t,n){if(t.type==="element")return Jv(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Yv(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Qv(e,t,n);if(t.type==="mdxjsEsm")return Xv(e,t);if(t.type==="root")return ex(e,t,n);if(t.type==="text")return tx(e,t)}function Jv(e,t,n){const r=e.schema;let o=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(o=za,e.schema=o),e.ancestors.push(t);const i=vu(e,t.tagName,!1),a=ox(e,t);let s=Va(e,t);return Wv.has(t.tagName)&&(s=s.filter(function(l){return typeof l=="string"?!Ev(l):!0})),gu(e,a,i,t),Ba(a,s),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}function Yv(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}yr(e,t.position)}function Xv(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);yr(e,t.position)}function Qv(e,t,n){const r=e.schema;let o=r;t.name==="svg"&&r.space==="html"&&(o=za,e.schema=o),e.ancestors.push(t);const i=t.name===null?e.Fragment:vu(e,t.name,!0),a=ix(e,t),s=Va(e,t);return gu(e,a,i,t),Ba(a,s),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}function ex(e,t,n){const r={};return Ba(r,Va(e,t)),e.create(t,e.Fragment,r,n)}function tx(e,t){return t.value}function gu(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Ba(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function nx(e,t,n){return r;function r(o,i,a,s){const c=Array.isArray(a.children)?n:t;return s?c(i,a,s):c(i,a)}}function rx(e,t){return n;function n(r,o,i,a){const s=Array.isArray(i.children),l=La(r);return t(o,i,a,s,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function ox(e,t){const n={};let r,o;for(o in t.properties)if(o!=="children"&&Fa.call(t.properties,o)){const i=ax(e,o,t.properties[o]);if(i){const[a,s]=i;e.tableCellAlignToStyle&&a==="align"&&typeof s=="string"&&qv.has(t.tagName)?r=s:n[a]=s}}if(r){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function ix(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const a=i.expression;a.type;const s=a.properties[0];s.type,Object.assign(n,e.evaluater.evaluateExpression(s.argument))}else yr(e,t.position);else{const o=r.name;let i;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,i=e.evaluater.evaluateExpression(s.expression)}else yr(e,t.position);else i=r.value===null?!0:r.value;n[o]=i}return n}function Va(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:Hv;for(;++r<t.children.length;){const i=t.children[r];let a;if(e.passKeys){const l=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(l){const c=o.get(l)||0;a=l+"-"+c,o.set(l,c+1)}}const s=mu(e,i,a);s!==void 0&&n.push(s)}return n}function ax(e,t,n){const r=jv(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?wv(n):$v(n)),r.property==="style"){let o=typeof n=="object"?n:sx(e,String(n));return e.stylePropertyNameCase==="css"&&(o=lx(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&r.space?Iv[r.property]||r.property:r.attribute,n]}}function sx(e,t){try{return Uv(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,o=new Qe("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=hu+"#cannot-parse-style-attribute",o}}function vu(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const o=t.split(".");let i=-1,a;for(;++i<o.length;){const s=cl(o[i])?{type:"Identifier",name:o[i]}:{type:"Literal",value:o[i]};a=a?{type:"MemberExpression",object:a,property:s,computed:!!(i&&s.type==="Literal"),optional:!1}:s}r=a}else r=cl(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const o=r.value;return Fa.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(r);yr(e)}function yr(e,t){const n=new Qe("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=hu+"#cannot-handle-mdx-estrees-without-createevaluater",n}function lx(e){const t={};let n;for(n in e)Fa.call(e,n)&&(t[cx(n)]=e[n]);return t}function cx(e){let t=e.replace(Gv,ux);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function ux(e){return"-"+e.toLowerCase()}const Si={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"]},dx={};function Ua(e,t){const n=dx,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return xu(e,r,o)}function xu(e,t,n){if(fx(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return bl(e.children,t,n)}return Array.isArray(e)?bl(e,t,n):""}function bl(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=xu(e[o],t,n);return r.join("")}function fx(e){return!!(e&&typeof e=="object")}const yl=document.createElement("i");function Za(e){const t="&"+e+";";yl.innerHTML=t;const n=yl.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function ht(e,t,n,r){const o=e.length;let i=0,a;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);i<r.length;)a=r.slice(i,i+1e4),a.unshift(t,0),e.splice(...a),i+=1e4,t+=1e4}function gt(e,t){return e.length>0?(ht(e,e.length,0,t),e):t}const wl={}.hasOwnProperty;function bu(e){const t={};let n=-1;for(;++n<e.length;)px(t,e[n]);return t}function px(e,t){let n;for(n in t){const o=(wl.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let a;if(i)for(a in i){wl.call(o,a)||(o[a]=[]);const s=i[a];hx(o[a],Array.isArray(s)?s:s?[s]:[])}}}function hx(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);ht(e,0,0,r)}function yu(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Ct(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const nt=en(/[A-Za-z]/),Xe=en(/[\dA-Za-z]/),mx=en(/[#-'*+\--9=?A-Z^-~]/);function vo(e){return e!==null&&(e<32||e===127)}const oa=en(/\d/),gx=en(/[\dA-Fa-f]/),vx=en(/[!-/:-@[-`{-~]/);function ne(e){return e!==null&&e<-2}function Se(e){return e!==null&&(e<0||e===32)}function he(e){return e===-2||e===-1||e===32}const Mo=en(new RegExp("\\p{P}|\\p{S}","u")),xn=en(/\s/);function en(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Xn(e){const t=[];let n=-1,r=0,o=0;for(;++n<e.length;){const i=e.charCodeAt(n);let a="";if(i===37&&Xe(e.charCodeAt(n+1))&&Xe(e.charCodeAt(n+2)))o=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(a=String.fromCharCode(i));else if(i>55295&&i<57344){const s=e.charCodeAt(n+1);i<56320&&s>56319&&s<57344?(a=String.fromCharCode(i,s),o=1):a="�"}else a=String.fromCharCode(i);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+o+1,a=""),o&&(n+=o,o=0)}return t.join("")+e.slice(r)}function ve(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let i=0;return a;function a(l){return he(l)?(e.enter(n),s(l)):t(l)}function s(l){return he(l)&&i++<o?(e.consume(l),s):(e.exit(n),t(l))}}const xx={tokenize:bx};function bx(e){const t=e.attempt(this.parser.constructs.contentInitial,r,o);let n;return t;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),ve(e,t,"linePrefix")}function o(s){return e.enter("paragraph"),i(s)}function i(s){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,a(s)}function a(s){if(s===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(s);return}return ne(s)?(e.consume(s),e.exit("chunkText"),i):(e.consume(s),a)}}const yx={tokenize:wx},kl={tokenize:kx};function wx(e){const t=this,n=[];let r=0,o,i,a;return s;function s(w){if(r<n.length){const S=n[r];return t.containerState=S[1],e.attempt(S[0].continuation,l,c)(w)}return c(w)}function l(w){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&y();const S=t.events.length;let P=S,C;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){C=t.events[P][1].end;break}x(r);let T=S;for(;T<t.events.length;)t.events[T][1].end={...C},T++;return ht(t.events,P+1,0,t.events.slice(S)),t.events.length=T,c(w)}return s(w)}function c(w){if(r===n.length){if(!o)return p(w);if(o.currentConstruct&&o.currentConstruct.concrete)return v(w);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(kl,d,u)(w)}function d(w){return o&&y(),x(r),p(w)}function u(w){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,v(w)}function p(w){return t.containerState={},e.attempt(kl,h,v)(w)}function h(w){return r++,n.push([t.currentConstruct,t.containerState]),p(w)}function v(w){if(w===null){o&&y(),x(0),e.consume(w);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:i}),g(w)}function g(w){if(w===null){b(e.exit("chunkFlow"),!0),x(0),e.consume(w);return}return ne(w)?(e.consume(w),b(e.exit("chunkFlow")),r=0,t.interrupt=void 0,s):(e.consume(w),g)}function b(w,S){const P=t.sliceStream(w);if(S&&P.push(null),w.previous=i,i&&(i.next=w),i=w,o.defineSkip(w.start),o.write(P),t.parser.lazy[w.start.line]){let C=o.events.length;for(;C--;)if(o.events[C][1].start.offset<a&&(!o.events[C][1].end||o.events[C][1].end.offset>a))return;const T=t.events.length;let I=T,R,E;for(;I--;)if(t.events[I][0]==="exit"&&t.events[I][1].type==="chunkFlow"){if(R){E=t.events[I][1].end;break}R=!0}for(x(r),C=T;C<t.events.length;)t.events[C][1].end={...E},C++;ht(t.events,I+1,0,t.events.slice(T)),t.events.length=C}}function x(w){let S=n.length;for(;S-- >w;){const P=n[S];t.containerState=P[1],P[0].exit.call(t,e)}n.length=w}function y(){o.write([null]),i=void 0,o=void 0,t.containerState._closeFlow=void 0}}function kx(e,t,n){return ve(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Gn(e){if(e===null||Se(e)||xn(e))return 1;if(Mo(e))return 2}function Do(e,t,n){const r=[];let o=-1;for(;++o<e.length;){const i=e[o].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}const ia={name:"attention",resolveAll:Sx,tokenize:Cx};function Sx(e,t){let n=-1,r,o,i,a,s,l,c,d;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const u={...e[r][1].end},p={...e[n][1].start};Sl(u,-l),Sl(p,l),a={type:l>1?"strongSequence":"emphasisSequence",start:u,end:{...e[r][1].end}},s={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},i={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},o={type:l>1?"strong":"emphasis",start:{...a.start},end:{...s.end}},e[r][1].end={...a.start},e[n][1].start={...s.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=gt(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=gt(c,[["enter",o,t],["enter",a,t],["exit",a,t],["enter",i,t]]),c=gt(c,Do(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=gt(c,[["exit",i,t],["enter",s,t],["exit",s,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,c=gt(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,ht(e,r-1,n-r+3,c),n=r+c.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Cx(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=Gn(r);let i;return a;function a(l){return i=l,e.enter("attentionSequence"),s(l)}function s(l){if(l===i)return e.consume(l),s;const c=e.exit("attentionSequence"),d=Gn(l),u=!d||d===2&&o||n.includes(l),p=!o||o===2&&d||n.includes(r);return c._open=!!(i===42?u:u&&(o||!p)),c._close=!!(i===42?p:p&&(d||!u)),t(l)}}function Sl(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const _x={name:"autolink",tokenize:Ex};function Ex(e,t,n){let r=0;return o;function o(h){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(h){return nt(h)?(e.consume(h),a):h===64?n(h):c(h)}function a(h){return h===43||h===45||h===46||Xe(h)?(r=1,s(h)):c(h)}function s(h){return h===58?(e.consume(h),r=0,l):(h===43||h===45||h===46||Xe(h))&&r++<32?(e.consume(h),s):(r=0,c(h))}function l(h){return h===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):h===null||h===32||h===60||vo(h)?n(h):(e.consume(h),l)}function c(h){return h===64?(e.consume(h),d):mx(h)?(e.consume(h),c):n(h)}function d(h){return Xe(h)?u(h):n(h)}function u(h){return h===46?(e.consume(h),r=0,d):h===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):p(h)}function p(h){if((h===45||Xe(h))&&r++<63){const v=h===45?p:u;return e.consume(h),v}return n(h)}}const Ar={partial:!0,tokenize:Tx};function Tx(e,t,n){return r;function r(i){return he(i)?ve(e,o,"linePrefix")(i):o(i)}function o(i){return i===null||ne(i)?t(i):n(i)}}const wu={continuation:{tokenize:Nx},exit:Ix,name:"blockQuote",tokenize:Px};function Px(e,t,n){const r=this;return o;function o(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"),i}return n(a)}function i(a){return he(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function Nx(e,t,n){const r=this;return o;function o(a){return he(a)?ve(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):i(a)}function i(a){return e.attempt(wu,t,n)(a)}}function Ix(e){e.exit("blockQuote")}const ku={name:"characterEscape",tokenize:Ax};function Ax(e,t,n){return r;function r(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),o}function o(i){return vx(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const Su={name:"characterReference",tokenize:Rx};function Rx(e,t,n){const r=this;let o=0,i,a;return s;function s(u){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(u),e.exit("characterReferenceMarker"),l}function l(u){return u===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(u),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),i=31,a=Xe,d(u))}function c(u){return u===88||u===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(u),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,a=gx,d):(e.enter("characterReferenceValue"),i=7,a=oa,d(u))}function d(u){if(u===59&&o){const p=e.exit("characterReferenceValue");return a===Xe&&!Za(r.sliceSerialize(p))?n(u):(e.enter("characterReferenceMarker"),e.consume(u),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(u)&&o++<i?(e.consume(u),d):n(u)}}const Cl={partial:!0,tokenize:Ox},_l={concrete:!0,name:"codeFenced",tokenize:jx};function jx(e,t,n){const r=this,o={partial:!0,tokenize:P};let i=0,a=0,s;return l;function l(C){return c(C)}function c(C){const T=r.events[r.events.length-1];return i=T&&T[1].type==="linePrefix"?T[2].sliceSerialize(T[1],!0).length:0,s=C,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(C)}function d(C){return C===s?(a++,e.consume(C),d):a<3?n(C):(e.exit("codeFencedFenceSequence"),he(C)?ve(e,u,"whitespace")(C):u(C))}function u(C){return C===null||ne(C)?(e.exit("codeFencedFence"),r.interrupt?t(C):e.check(Cl,g,S)(C)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(C))}function p(C){return C===null||ne(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),u(C)):he(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ve(e,h,"whitespace")(C)):C===96&&C===s?n(C):(e.consume(C),p)}function h(C){return C===null||ne(C)?u(C):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),v(C))}function v(C){return C===null||ne(C)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),u(C)):C===96&&C===s?n(C):(e.consume(C),v)}function g(C){return e.attempt(o,S,b)(C)}function b(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),x}function x(C){return i>0&&he(C)?ve(e,y,"linePrefix",i+1)(C):y(C)}function y(C){return C===null||ne(C)?e.check(Cl,g,S)(C):(e.enter("codeFlowValue"),w(C))}function w(C){return C===null||ne(C)?(e.exit("codeFlowValue"),y(C)):(e.consume(C),w)}function S(C){return e.exit("codeFenced"),t(C)}function P(C,T,I){let R=0;return E;function E(O){return C.enter("lineEnding"),C.consume(O),C.exit("lineEnding"),N}function N(O){return C.enter("codeFencedFence"),he(O)?ve(C,A,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):A(O)}function A(O){return O===s?(C.enter("codeFencedFenceSequence"),j(O)):I(O)}function j(O){return O===s?(R++,C.consume(O),j):R>=a?(C.exit("codeFencedFenceSequence"),he(O)?ve(C,$,"whitespace")(O):$(O)):I(O)}function $(O){return O===null||ne(O)?(C.exit("codeFencedFence"),T(O)):I(O)}}}function Ox(e,t,n){const r=this;return o;function o(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i)}function i(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const Ci={name:"codeIndented",tokenize:Dx},Mx={partial:!0,tokenize:$x};function Dx(e,t,n){const r=this;return o;function o(c){return e.enter("codeIndented"),ve(e,i,"linePrefix",5)(c)}function i(c){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?a(c):n(c)}function a(c){return c===null?l(c):ne(c)?e.attempt(Mx,a,l)(c):(e.enter("codeFlowValue"),s(c))}function s(c){return c===null||ne(c)?(e.exit("codeFlowValue"),a(c)):(e.consume(c),s)}function l(c){return e.exit("codeIndented"),t(c)}}function $x(e,t,n){const r=this;return o;function o(a){return r.parser.lazy[r.now().line]?n(a):ne(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o):ve(e,i,"linePrefix",5)(a)}function i(a){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(a):ne(a)?o(a):n(a)}}const zx={name:"codeText",previous:Fx,resolve:Lx,tokenize:Bx};function Lx(e){let t=e.length-4,n=3,r,o;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)o===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(o=r):(r===t||e[r][1].type==="lineEnding")&&(e[o][1].type="codeTextData",r!==o+2&&(e[o][1].end=e[r-1][1].end,e.splice(o+2,r-o-2),t-=r-o-2,r=o+2),o=void 0);return e}function Fx(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Bx(e,t,n){let r=0,o,i;return a;function a(u){return e.enter("codeText"),e.enter("codeTextSequence"),s(u)}function s(u){return u===96?(e.consume(u),r++,s):(e.exit("codeTextSequence"),l(u))}function l(u){return u===null?n(u):u===32?(e.enter("space"),e.consume(u),e.exit("space"),l):u===96?(i=e.enter("codeTextSequence"),o=0,d(u)):ne(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(u))}function c(u){return u===null||u===32||u===96||ne(u)?(e.exit("codeTextData"),l(u)):(e.consume(u),c)}function d(u){return u===96?(e.consume(u),o++,d):o===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(u)):(i.type="codeTextData",c(u))}}class Vx{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const o=n||0;this.setCursor(Math.trunc(t));const i=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return r&&sr(this.left,r),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),sr(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),sr(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);sr(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);sr(this.left,n.reverse())}}}function sr(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Cu(e){const t={};let n=-1,r,o,i,a,s,l,c;const d=new Vx(e);for(;++n<d.length;){for(;n in t;)n=t[n];if(r=d.get(n),n&&r[1].type==="chunkFlow"&&d.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,i=0,i<l.length&&l[i][1].type==="lineEndingBlank"&&(i+=2),i<l.length&&l[i][1].type==="content"))for(;++i<l.length&&l[i][1].type!=="content";)l[i][1].type==="chunkText"&&(l[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,Ux(d,n)),n=t[n],c=!0);else if(r[1]._container){for(i=n,o=void 0;i--;)if(a=d.get(i),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(o&&(d.get(o)[1].type="lineEndingBlank"),a[1].type="lineEnding",o=i);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;o&&(r[1].end={...d.get(o)[1].start},s=d.slice(o,n),s.unshift(r),d.splice(o,n-o+1,s))}}return ht(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!c}function Ux(e,t){const n=e.get(t)[1],r=e.get(t)[2];let o=t-1;const i=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const s=a.events,l=[],c={};let d,u,p=-1,h=n,v=0,g=0;const b=[g];for(;h;){for(;e.get(++o)[1]!==h;);i.push(o),h._tokenizer||(d=r.sliceStream(h),h.next||d.push(null),u&&a.defineSkip(h.start),h._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(d),h._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),u=h,h=h.next}for(h=n;++p<s.length;)s[p][0]==="exit"&&s[p-1][0]==="enter"&&s[p][1].type===s[p-1][1].type&&s[p][1].start.line!==s[p][1].end.line&&(g=p+1,b.push(g),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(a.events=[],h?(h._tokenizer=void 0,h.previous=void 0):b.pop(),p=b.length;p--;){const x=s.slice(b[p],b[p+1]),y=i.pop();l.push([y,y+x.length-1]),e.splice(y,2,x)}for(l.reverse(),p=-1;++p<l.length;)c[v+l[p][0]]=v+l[p][1],v+=l[p][1]-l[p][0]-1;return c}const Zx={resolve:Gx,tokenize:Wx},Hx={partial:!0,tokenize:qx};function Gx(e){return Cu(e),e}function Wx(e,t){let n;return r;function r(s){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),o(s)}function o(s){return s===null?i(s):ne(s)?e.check(Hx,a,i)(s):(e.consume(s),o)}function i(s){return e.exit("chunkContent"),e.exit("content"),t(s)}function a(s){return e.consume(s),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,o}}function qx(e,t,n){const r=this;return o;function o(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),ve(e,i,"linePrefix")}function i(a){if(a===null||ne(a))return n(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?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function _u(e,t,n,r,o,i,a,s,l){const c=l||Number.POSITIVE_INFINITY;let d=0;return u;function u(x){return x===60?(e.enter(r),e.enter(o),e.enter(i),e.consume(x),e.exit(i),p):x===null||x===32||x===41||vo(x)?n(x):(e.enter(r),e.enter(a),e.enter(s),e.enter("chunkString",{contentType:"string"}),g(x))}function p(x){return x===62?(e.enter(i),e.consume(x),e.exit(i),e.exit(o),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),h(x))}function h(x){return x===62?(e.exit("chunkString"),e.exit(s),p(x)):x===null||x===60||ne(x)?n(x):(e.consume(x),x===92?v:h)}function v(x){return x===60||x===62||x===92?(e.consume(x),h):h(x)}function g(x){return!d&&(x===null||x===41||Se(x))?(e.exit("chunkString"),e.exit(s),e.exit(a),e.exit(r),t(x)):d<c&&x===40?(e.consume(x),d++,g):x===41?(e.consume(x),d--,g):x===null||x===32||x===40||vo(x)?n(x):(e.consume(x),x===92?b:g)}function b(x){return x===40||x===41||x===92?(e.consume(x),g):g(x)}}function Eu(e,t,n,r,o,i){const a=this;let s=0,l;return c;function c(h){return e.enter(r),e.enter(o),e.consume(h),e.exit(o),e.enter(i),d}function d(h){return s>999||h===null||h===91||h===93&&!l||h===94&&!s&&"_hiddenFootnoteSupport"in a.parser.constructs?n(h):h===93?(e.exit(i),e.enter(o),e.consume(h),e.exit(o),e.exit(r),t):ne(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),u(h))}function u(h){return h===null||h===91||h===93||ne(h)||s++>999?(e.exit("chunkString"),d(h)):(e.consume(h),l||(l=!he(h)),h===92?p:u)}function p(h){return h===91||h===92||h===93?(e.consume(h),s++,u):u(h)}}function Tu(e,t,n,r,o,i){let a;return s;function s(p){return p===34||p===39||p===40?(e.enter(r),e.enter(o),e.consume(p),e.exit(o),a=p===40?41:p,l):n(p)}function l(p){return p===a?(e.enter(o),e.consume(p),e.exit(o),e.exit(r),t):(e.enter(i),c(p))}function c(p){return p===a?(e.exit(i),l(a)):p===null?n(p):ne(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),ve(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===a||p===null||ne(p)?(e.exit("chunkString"),c(p)):(e.consume(p),p===92?u:d)}function u(p){return p===a||p===92?(e.consume(p),d):d(p)}}function gr(e,t){let n;return r;function r(o){return ne(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r):he(o)?ve(e,r,n?"linePrefix":"lineSuffix")(o):t(o)}}const Kx={name:"definition",tokenize:Yx},Jx={partial:!0,tokenize:Xx};function Yx(e,t,n){const r=this;let o;return i;function i(h){return e.enter("definition"),a(h)}function a(h){return Eu.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function s(h){return o=Ct(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),l):n(h)}function l(h){return Se(h)?gr(e,c)(h):c(h)}function c(h){return _u(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function d(h){return e.attempt(Jx,u,u)(h)}function u(h){return he(h)?ve(e,p,"whitespace")(h):p(h)}function p(h){return h===null||ne(h)?(e.exit("definition"),r.parser.defined.push(o),t(h)):n(h)}}function Xx(e,t,n){return r;function r(s){return Se(s)?gr(e,o)(s):n(s)}function o(s){return Tu(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function i(s){return he(s)?ve(e,a,"whitespace")(s):a(s)}function a(s){return s===null||ne(s)?t(s):n(s)}}const Qx={name:"hardBreakEscape",tokenize:eb};function eb(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),o}function o(i){return ne(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const tb={name:"headingAtx",resolve:nb,tokenize:rb};function nb(e,t){let n=e.length-2,r=3,o,i;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(o={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},i={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},ht(e,r,n-r+1,[["enter",o,t],["enter",i,t],["exit",i,t],["exit",o,t]])),e}function rb(e,t,n){let r=0;return o;function o(d){return e.enter("atxHeading"),i(d)}function i(d){return e.enter("atxHeadingSequence"),a(d)}function a(d){return d===35&&r++<6?(e.consume(d),a):d===null||Se(d)?(e.exit("atxHeadingSequence"),s(d)):n(d)}function s(d){return d===35?(e.enter("atxHeadingSequence"),l(d)):d===null||ne(d)?(e.exit("atxHeading"),t(d)):he(d)?ve(e,s,"whitespace")(d):(e.enter("atxHeadingText"),c(d))}function l(d){return d===35?(e.consume(d),l):(e.exit("atxHeadingSequence"),s(d))}function c(d){return d===null||d===35||Se(d)?(e.exit("atxHeadingText"),s(d)):(e.consume(d),c)}}const ob=["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"],El=["pre","script","style","textarea"],ib={concrete:!0,name:"htmlFlow",resolveTo:lb,tokenize:cb},ab={partial:!0,tokenize:db},sb={partial:!0,tokenize:ub};function lb(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function cb(e,t,n){const r=this;let o,i,a,s,l;return c;function c(_){return d(_)}function d(_){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(_),u}function u(_){return _===33?(e.consume(_),p):_===47?(e.consume(_),i=!0,g):_===63?(e.consume(_),o=3,r.interrupt?t:k):nt(_)?(e.consume(_),a=String.fromCharCode(_),b):n(_)}function p(_){return _===45?(e.consume(_),o=2,h):_===91?(e.consume(_),o=5,s=0,v):nt(_)?(e.consume(_),o=4,r.interrupt?t:k):n(_)}function h(_){return _===45?(e.consume(_),r.interrupt?t:k):n(_)}function v(_){const fe="CDATA[";return _===fe.charCodeAt(s++)?(e.consume(_),s===fe.length?r.interrupt?t:A:v):n(_)}function g(_){return nt(_)?(e.consume(_),a=String.fromCharCode(_),b):n(_)}function b(_){if(_===null||_===47||_===62||Se(_)){const fe=_===47,ke=a.toLowerCase();return!fe&&!i&&El.includes(ke)?(o=1,r.interrupt?t(_):A(_)):ob.includes(a.toLowerCase())?(o=6,fe?(e.consume(_),x):r.interrupt?t(_):A(_)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(_):i?y(_):w(_))}return _===45||Xe(_)?(e.consume(_),a+=String.fromCharCode(_),b):n(_)}function x(_){return _===62?(e.consume(_),r.interrupt?t:A):n(_)}function y(_){return he(_)?(e.consume(_),y):E(_)}function w(_){return _===47?(e.consume(_),E):_===58||_===95||nt(_)?(e.consume(_),S):he(_)?(e.consume(_),w):E(_)}function S(_){return _===45||_===46||_===58||_===95||Xe(_)?(e.consume(_),S):P(_)}function P(_){return _===61?(e.consume(_),C):he(_)?(e.consume(_),P):w(_)}function C(_){return _===null||_===60||_===61||_===62||_===96?n(_):_===34||_===39?(e.consume(_),l=_,T):he(_)?(e.consume(_),C):I(_)}function T(_){return _===l?(e.consume(_),l=null,R):_===null||ne(_)?n(_):(e.consume(_),T)}function I(_){return _===null||_===34||_===39||_===47||_===60||_===61||_===62||_===96||Se(_)?P(_):(e.consume(_),I)}function R(_){return _===47||_===62||he(_)?w(_):n(_)}function E(_){return _===62?(e.consume(_),N):n(_)}function N(_){return _===null||ne(_)?A(_):he(_)?(e.consume(_),N):n(_)}function A(_){return _===45&&o===2?(e.consume(_),B):_===60&&o===1?(e.consume(_),W):_===62&&o===4?(e.consume(_),le):_===63&&o===3?(e.consume(_),k):_===93&&o===5?(e.consume(_),V):ne(_)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(ab,be,j)(_)):_===null||ne(_)?(e.exit("htmlFlowData"),j(_)):(e.consume(_),A)}function j(_){return e.check(sb,$,be)(_)}function $(_){return e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),O}function O(_){return _===null||ne(_)?j(_):(e.enter("htmlFlowData"),A(_))}function B(_){return _===45?(e.consume(_),k):A(_)}function W(_){return _===47?(e.consume(_),a="",Y):A(_)}function Y(_){if(_===62){const fe=a.toLowerCase();return El.includes(fe)?(e.consume(_),le):A(_)}return nt(_)&&a.length<8?(e.consume(_),a+=String.fromCharCode(_),Y):A(_)}function V(_){return _===93?(e.consume(_),k):A(_)}function k(_){return _===62?(e.consume(_),le):_===45&&o===2?(e.consume(_),k):A(_)}function le(_){return _===null||ne(_)?(e.exit("htmlFlowData"),be(_)):(e.consume(_),le)}function be(_){return e.exit("htmlFlow"),t(_)}}function ub(e,t,n){const r=this;return o;function o(a){return ne(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):n(a)}function i(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function db(e,t,n){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Ar,t,n)}}const fb={name:"htmlText",tokenize:pb};function pb(e,t,n){const r=this;let o,i,a;return s;function s(k){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(k),l}function l(k){return k===33?(e.consume(k),c):k===47?(e.consume(k),P):k===63?(e.consume(k),w):nt(k)?(e.consume(k),I):n(k)}function c(k){return k===45?(e.consume(k),d):k===91?(e.consume(k),i=0,v):nt(k)?(e.consume(k),y):n(k)}function d(k){return k===45?(e.consume(k),h):n(k)}function u(k){return k===null?n(k):k===45?(e.consume(k),p):ne(k)?(a=u,W(k)):(e.consume(k),u)}function p(k){return k===45?(e.consume(k),h):u(k)}function h(k){return k===62?B(k):k===45?p(k):u(k)}function v(k){const le="CDATA[";return k===le.charCodeAt(i++)?(e.consume(k),i===le.length?g:v):n(k)}function g(k){return k===null?n(k):k===93?(e.consume(k),b):ne(k)?(a=g,W(k)):(e.consume(k),g)}function b(k){return k===93?(e.consume(k),x):g(k)}function x(k){return k===62?B(k):k===93?(e.consume(k),x):g(k)}function y(k){return k===null||k===62?B(k):ne(k)?(a=y,W(k)):(e.consume(k),y)}function w(k){return k===null?n(k):k===63?(e.consume(k),S):ne(k)?(a=w,W(k)):(e.consume(k),w)}function S(k){return k===62?B(k):w(k)}function P(k){return nt(k)?(e.consume(k),C):n(k)}function C(k){return k===45||Xe(k)?(e.consume(k),C):T(k)}function T(k){return ne(k)?(a=T,W(k)):he(k)?(e.consume(k),T):B(k)}function I(k){return k===45||Xe(k)?(e.consume(k),I):k===47||k===62||Se(k)?R(k):n(k)}function R(k){return k===47?(e.consume(k),B):k===58||k===95||nt(k)?(e.consume(k),E):ne(k)?(a=R,W(k)):he(k)?(e.consume(k),R):B(k)}function E(k){return k===45||k===46||k===58||k===95||Xe(k)?(e.consume(k),E):N(k)}function N(k){return k===61?(e.consume(k),A):ne(k)?(a=N,W(k)):he(k)?(e.consume(k),N):R(k)}function A(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(e.consume(k),o=k,j):ne(k)?(a=A,W(k)):he(k)?(e.consume(k),A):(e.consume(k),$)}function j(k){return k===o?(e.consume(k),o=void 0,O):k===null?n(k):ne(k)?(a=j,W(k)):(e.consume(k),j)}function $(k){return k===null||k===34||k===39||k===60||k===61||k===96?n(k):k===47||k===62||Se(k)?R(k):(e.consume(k),$)}function O(k){return k===47||k===62||Se(k)?R(k):n(k)}function B(k){return k===62?(e.consume(k),e.exit("htmlTextData"),e.exit("htmlText"),t):n(k)}function W(k){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),Y}function Y(k){return he(k)?ve(e,V,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):V(k)}function V(k){return e.enter("htmlTextData"),a(k)}}const Ha={name:"labelEnd",resolveAll:vb,resolveTo:xb,tokenize:bb},hb={tokenize:yb},mb={tokenize:wb},gb={tokenize:kb};function vb(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const o=r.type==="labelImage"?4:2;r.type="data",t+=o}}return e.length!==n.length&&ht(e,0,e.length,n),e}function xb(e,t){let n=e.length,r=0,o,i,a,s;for(;n--;)if(o=e[n][1],i){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[n][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(a){if(e[n][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(i=n,o.type!=="labelLink")){r=2;break}}else o.type==="labelEnd"&&(a=n);const l={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[i][1].start},end:{...e[a][1].end}},d={type:"labelText",start:{...e[i+r+2][1].end},end:{...e[a-2][1].start}};return s=[["enter",l,t],["enter",c,t]],s=gt(s,e.slice(i+1,i+r+3)),s=gt(s,[["enter",d,t]]),s=gt(s,Do(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),s=gt(s,[["exit",d,t],e[a-2],e[a-1],["exit",c,t]]),s=gt(s,e.slice(a+1)),s=gt(s,[["exit",l,t]]),ht(e,i,e.length,s),e}function bb(e,t,n){const r=this;let o=r.events.length,i,a;for(;o--;)if((r.events[o][1].type==="labelImage"||r.events[o][1].type==="labelLink")&&!r.events[o][1]._balanced){i=r.events[o][1];break}return s;function s(p){return i?i._inactive?u(p):(a=r.parser.defined.includes(Ct(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),l):n(p)}function l(p){return p===40?e.attempt(hb,d,a?d:u)(p):p===91?e.attempt(mb,d,a?c:u)(p):a?d(p):u(p)}function c(p){return e.attempt(gb,d,u)(p)}function d(p){return t(p)}function u(p){return i._balanced=!0,n(p)}}function yb(e,t,n){return r;function r(u){return e.enter("resource"),e.enter("resourceMarker"),e.consume(u),e.exit("resourceMarker"),o}function o(u){return Se(u)?gr(e,i)(u):i(u)}function i(u){return u===41?d(u):_u(e,a,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(u)}function a(u){return Se(u)?gr(e,l)(u):d(u)}function s(u){return n(u)}function l(u){return u===34||u===39||u===40?Tu(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(u):d(u)}function c(u){return Se(u)?gr(e,d)(u):d(u)}function d(u){return u===41?(e.enter("resourceMarker"),e.consume(u),e.exit("resourceMarker"),e.exit("resource"),t):n(u)}}function wb(e,t,n){const r=this;return o;function o(s){return Eu.call(r,e,i,a,"reference","referenceMarker","referenceString")(s)}function i(s){return r.parser.defined.includes(Ct(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(s):n(s)}function a(s){return n(s)}}function kb(e,t,n){return r;function r(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),o}function o(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):n(i)}}const Sb={name:"labelStartImage",resolveAll:Ha.resolveAll,tokenize:Cb};function Cb(e,t,n){const r=this;return o;function o(s){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(s),e.exit("labelImageMarker"),i}function i(s){return s===91?(e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelImage"),a):n(s)}function a(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const _b={name:"labelStartLink",resolveAll:Ha.resolveAll,tokenize:Eb};function Eb(e,t,n){const r=this;return o;function o(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),i}function i(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const _i={name:"lineEnding",tokenize:Tb};function Tb(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),ve(e,t,"linePrefix")}}const uo={name:"thematicBreak",tokenize:Pb};function Pb(e,t,n){let r=0,o;return i;function i(c){return e.enter("thematicBreak"),a(c)}function a(c){return o=c,s(c)}function s(c){return c===o?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||ne(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===o?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),he(c)?ve(e,s,"whitespace")(c):s(c))}}const it={continuation:{tokenize:Rb},exit:Ob,name:"list",tokenize:Ab},Nb={partial:!0,tokenize:Mb},Ib={partial:!0,tokenize:jb};function Ab(e,t,n){const r=this,o=r.events[r.events.length-1];let i=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,a=0;return s;function s(h){const v=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(v==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:oa(h)){if(r.containerState.type||(r.containerState.type=v,e.enter(v,{_container:!0})),v==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(uo,n,c)(h):c(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(h)}return n(h)}function l(h){return oa(h)&&++a<10?(e.consume(h),l):(!r.interrupt||a<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),c(h)):n(h)}function c(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(Ar,r.interrupt?n:d,e.attempt(Nb,p,u))}function d(h){return r.containerState.initialBlankLine=!0,i++,p(h)}function u(h){return he(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),p):n(h)}function p(h){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function Rb(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Ar,o,i);function o(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ve(e,t,"listItemIndent",r.containerState.size+1)(s)}function i(s){return r.containerState.furtherBlankLines||!he(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(Ib,t,a)(s))}function a(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,ve(e,e.attempt(it,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function jb(e,t,n){const r=this;return ve(e,o,"listItemIndent",r.containerState.size+1);function o(i){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(i):n(i)}}function Ob(e){e.exit(this.containerState.type)}function Mb(e,t,n){const r=this;return ve(e,o,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(i){const a=r.events[r.events.length-1];return!he(i)&&a&&a[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const Tl={name:"setextUnderline",resolveTo:Db,tokenize:$b};function Db(e,t){let n=e.length,r,o,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(o=n)}else e[n][1].type==="content"&&e.splice(n,1),!i&&e[n][1].type==="definition"&&(i=n);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",i?(e.splice(o,0,["enter",a,t]),e.splice(i+1,0,["exit",e[r][1],t]),e[r][1].end={...e[i][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function $b(e,t,n){const r=this;let o;return i;function i(c){let d=r.events.length,u;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){u=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||u)?(e.enter("setextHeadingLine"),o=c,a(c)):n(c)}function a(c){return e.enter("setextHeadingLineSequence"),s(c)}function s(c){return c===o?(e.consume(c),s):(e.exit("setextHeadingLineSequence"),he(c)?ve(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||ne(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const zb={tokenize:Lb};function Lb(e){const t=this,n=e.attempt(Ar,r,e.attempt(this.parser.constructs.flowInitial,o,ve(e,e.attempt(this.parser.constructs.flow,o,e.attempt(Zx,o)),"linePrefix")));return n;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function o(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Fb={resolveAll:Nu()},Bb=Pu("string"),Vb=Pu("text");function Pu(e){return{resolveAll:Nu(e==="text"?Ub:void 0),tokenize:t};function t(n){const r=this,o=this.parser.constructs[e],i=n.attempt(o,a,s);return a;function a(d){return c(d)?i(d):s(d)}function s(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),l}function l(d){return c(d)?(n.exit("data"),i(d)):(n.consume(d),l)}function c(d){if(d===null)return!0;const u=o[d];let p=-1;if(u)for(;++p<u.length;){const h=u[p];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function Nu(e){return t;function t(n,r){let o=-1,i;for(;++o<=n.length;)i===void 0?n[o]&&n[o][1].type==="data"&&(i=o,o++):(!n[o]||n[o][1].type!=="data")&&(o!==i+2&&(n[i][1].end=n[o-1][1].end,n.splice(i+2,o-i-2),o=i+2),i=void 0);return e?e(n,r):n}}function Ub(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],o=t.sliceStream(r);let i=o.length,a=-1,s=0,l;for(;i--;){const c=o[i];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){i++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){const c={type:n===e.length||l||s<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?a:r.start._bufferIndex+a,_index:r.start._index+i,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(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const Zb={42:it,43:it,45:it,48:it,49:it,50:it,51:it,52:it,53:it,54:it,55:it,56:it,57:it,62:wu},Hb={91:Kx},Gb={[-2]:Ci,[-1]:Ci,32:Ci},Wb={35:tb,42:uo,45:[Tl,uo],60:ib,61:Tl,95:uo,96:_l,126:_l},qb={38:Su,92:ku},Kb={[-5]:_i,[-4]:_i,[-3]:_i,33:Sb,38:Su,42:ia,60:[_x,fb],91:_b,92:[Qx,ku],93:Ha,95:ia,96:zx},Jb={null:[ia,Fb]},Yb={null:[42,95]},Xb={null:[]},Qb=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Yb,contentInitial:Hb,disable:Xb,document:Zb,flow:Wb,flowInitial:Gb,insideSpan:Jb,string:qb,text:Kb},Symbol.toStringTag,{value:"Module"}));function ey(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const o={},i=[];let a=[],s=[];const l={attempt:T(P),check:T(C),consume:y,enter:w,exit:S,interrupt:T(C,{interrupt:!0})},c={code:null,containerState:{},defineSkip:g,events:[],now:v,parser:e,previous:null,sliceSerialize:p,sliceStream:h,write:u};let d=t.tokenize.call(c,l);return t.resolveAll&&i.push(t),c;function u(N){return a=gt(a,N),b(),a[a.length-1]!==null?[]:(I(t,0),c.events=Do(i,c.events,c),c.events)}function p(N,A){return ny(h(N),A)}function h(N){return ty(a,N)}function v(){const{_bufferIndex:N,_index:A,line:j,column:$,offset:O}=r;return{_bufferIndex:N,_index:A,line:j,column:$,offset:O}}function g(N){o[N.line]=N.column,E()}function b(){let N;for(;r._index<a.length;){const A=a[r._index];if(typeof A=="string")for(N=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===N&&r._bufferIndex<A.length;)x(A.charCodeAt(r._bufferIndex));else x(A)}}function x(N){d=d(N)}function y(N){ne(N)?(r.line++,r.column=1,r.offset+=N===-3?2:1,E()):N!==-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=N}function w(N,A){const j=A||{};return j.type=N,j.start=v(),c.events.push(["enter",j,c]),s.push(j),j}function S(N){const A=s.pop();return A.end=v(),c.events.push(["exit",A,c]),A}function P(N,A){I(N,A.from)}function C(N,A){A.restore()}function T(N,A){return j;function j($,O,B){let W,Y,V,k;return Array.isArray($)?be($):"tokenize"in $?be([$]):le($);function le(ce){return U;function U(te){const me=te!==null&&ce[te],ie=te!==null&&ce.null,Q=[...Array.isArray(me)?me:me?[me]:[],...Array.isArray(ie)?ie:ie?[ie]:[]];return be(Q)(te)}}function be(ce){return W=ce,Y=0,ce.length===0?B:_(ce[Y])}function _(ce){return U;function U(te){return k=R(),V=ce,ce.partial||(c.currentConstruct=ce),ce.name&&c.parser.constructs.disable.null.includes(ce.name)?ke():ce.tokenize.call(A?Object.assign(Object.create(c),A):c,l,fe,ke)(te)}}function fe(ce){return N(V,k),O}function ke(ce){return k.restore(),++Y<W.length?_(W[Y]):B}}}function I(N,A){N.resolveAll&&!i.includes(N)&&i.push(N),N.resolve&&ht(c.events,A,c.events.length-A,N.resolve(c.events.slice(A),c)),N.resolveTo&&(c.events=N.resolveTo(c.events,c))}function R(){const N=v(),A=c.previous,j=c.currentConstruct,$=c.events.length,O=Array.from(s);return{from:$,restore:B};function B(){r=N,c.previous=A,c.currentConstruct=j,c.events.length=$,s=O,E()}}function E(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}function ty(e,t){const n=t.start._index,r=t.start._bufferIndex,o=t.end._index,i=t.end._bufferIndex;let a;if(n===o)a=[e[n].slice(r,i)];else{if(a=e.slice(n,o),r>-1){const s=a[0];typeof s=="string"?a[0]=s.slice(r):a.shift()}i>0&&a.push(e[o].slice(0,i))}return a}function ny(e,t){let n=-1;const r=[];let o;for(;++n<e.length;){const i=e[n];let a;if(typeof i=="string")a=i;else switch(i){case-5:{a="\r";break}case-4:{a=`
4
+ `;break}case-3:{a=`\r
5
+ `;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&o)continue;a=" ";break}default:a=String.fromCharCode(i)}o=i===-2,r.push(a)}return r.join("")}function ry(e){const r={constructs:bu([Qb,...(e||{}).extensions||[]]),content:o(xx),defined:[],document:o(yx),flow:o(zb),lazy:{},string:o(Bb),text:o(Vb)};return r;function o(i){return a;function a(s){return ey(r,i,s)}}}function oy(e){for(;!Cu(e););return e}const Pl=/[\0\t\n\r]/g;function iy(){let e=1,t="",n=!0,r;return o;function o(i,a,s){const l=[];let c,d,u,p,h;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t="",n&&(i.charCodeAt(0)===65279&&u++,n=void 0);u<i.length;){if(Pl.lastIndex=u,c=Pl.exec(i),p=c&&c.index!==void 0?c.index:i.length,h=i.charCodeAt(p),!c){t=i.slice(u);break}if(h===10&&u===p&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),u<p&&(l.push(i.slice(u,p)),e+=p-u),h){case 0:{l.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,l.push(-2);e++<d;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}u=p+1}return s&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const ay=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function sy(e){return e.replace(ay,ly)}function ly(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),i=o===120||o===88;return yu(n.slice(i?2:1),i?16:10)}return Za(n)||e}const Iu={}.hasOwnProperty;function cy(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),uy(n)(oy(ry(n).document().write(iy()(e,t,!0))))}function uy(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(ct),autolinkProtocol:R,autolinkEmail:R,atxHeading:i(Te),blockQuote:i(ie),characterEscape:R,characterReference:R,codeFenced:i(Q),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:i(Q,a),codeText:i(G,a),codeTextData:R,data:R,codeFlowValue:R,definition:i(se),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:i(K),hardBreakEscape:i(Me),hardBreakTrailing:i(Me),htmlFlow:i(De,a),htmlFlowData:R,htmlText:i(De,a),htmlTextData:R,image:i(bt),label:a,link:i(ct),listItem:i(It),listItemValue:p,listOrdered:i(He,u),listUnordered:i(He),paragraph:i(dn),reference:_,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:i(Te),strong:i(yt),thematicBreak:i(fn)},exit:{atxHeading:l(),atxHeadingSequence:P,autolink:l(),autolinkEmail:me,autolinkProtocol:te,blockQuote:l(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:ke,characterReferenceMarkerNumeric:ke,characterReferenceValue:ce,characterReference:U,codeFenced:l(b),codeFencedFence:g,codeFencedFenceInfo:h,codeFencedFenceMeta:v,codeFlowValue:E,codeIndented:l(x),codeText:l(O),codeTextData:E,data:E,definition:l(),definitionDestinationString:S,definitionLabelString:y,definitionTitleString:w,emphasis:l(),hardBreakEscape:l(A),hardBreakTrailing:l(A),htmlFlow:l(j),htmlFlowData:E,htmlText:l($),htmlTextData:E,image:l(W),label:V,labelText:Y,lineEnding:N,link:l(B),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:fe,resourceDestinationString:k,resourceTitleString:le,resource:be,setextHeading:l(I),setextHeadingLineSequence:T,setextHeadingText:C,strong:l(),thematicBreak:l()}};Au(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(D){let H={type:"root",children:[]};const re={stack:[H],tokenStack:[],config:t,enter:s,exit:c,buffer:a,resume:d,data:n},ue=[];let pe=-1;for(;++pe<D.length;)if(D[pe][1].type==="listOrdered"||D[pe][1].type==="listUnordered")if(D[pe][0]==="enter")ue.push(pe);else{const Ge=ue.pop();pe=o(D,Ge,pe)}for(pe=-1;++pe<D.length;){const Ge=t[D[pe][0]];Iu.call(Ge,D[pe][1].type)&&Ge[D[pe][1].type].call(Object.assign({sliceSerialize:D[pe][2].sliceSerialize},re),D[pe][1])}if(re.tokenStack.length>0){const Ge=re.tokenStack[re.tokenStack.length-1];(Ge[1]||Nl).call(re,void 0,Ge[0])}for(H.position={start:Wt(D.length>0?D[0][1].start:{line:1,column:1,offset:0}),end:Wt(D.length>0?D[D.length-2][1].end:{line:1,column:1,offset:0})},pe=-1;++pe<t.transforms.length;)H=t.transforms[pe](H)||H;return H}function o(D,H,re){let ue=H-1,pe=-1,Ge=!1,We,qe,Bt,Vt;for(;++ue<=re;){const Ke=D[ue];switch(Ke[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ke[0]==="enter"?pe++:pe--,Vt=void 0;break}case"lineEndingBlank":{Ke[0]==="enter"&&(We&&!Vt&&!pe&&!Bt&&(Bt=ue),Vt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Vt=void 0}if(!pe&&Ke[0]==="enter"&&Ke[1].type==="listItemPrefix"||pe===-1&&Ke[0]==="exit"&&(Ke[1].type==="listUnordered"||Ke[1].type==="listOrdered")){if(We){let At=ue;for(qe=void 0;At--;){const ut=D[At];if(ut[1].type==="lineEnding"||ut[1].type==="lineEndingBlank"){if(ut[0]==="exit")continue;qe&&(D[qe][1].type="lineEndingBlank",Ge=!0),ut[1].type="lineEnding",qe=At}else if(!(ut[1].type==="linePrefix"||ut[1].type==="blockQuotePrefix"||ut[1].type==="blockQuotePrefixWhitespace"||ut[1].type==="blockQuoteMarker"||ut[1].type==="listItemIndent"))break}Bt&&(!qe||Bt<qe)&&(We._spread=!0),We.end=Object.assign({},qe?D[qe][1].start:Ke[1].end),D.splice(qe||ue,0,["exit",We,Ke[2]]),ue++,re++}if(Ke[1].type==="listItemPrefix"){const At={type:"listItem",_spread:!1,start:Object.assign({},Ke[1].start),end:void 0};We=At,D.splice(ue,0,["enter",At,Ke[2]]),ue++,re++,Bt=void 0,Vt=!0}}}return D[H][1]._spread=Ge,re}function i(D,H){return re;function re(ue){s.call(this,D(ue),ue),H&&H.call(this,ue)}}function a(){this.stack.push({type:"fragment",children:[]})}function s(D,H,re){this.stack[this.stack.length-1].children.push(D),this.stack.push(D),this.tokenStack.push([H,re||void 0]),D.position={start:Wt(H.start),end:void 0}}function l(D){return H;function H(re){D&&D.call(this,re),c.call(this,re)}}function c(D,H){const re=this.stack.pop(),ue=this.tokenStack.pop();if(ue)ue[0].type!==D.type&&(H?H.call(this,D,ue[0]):(ue[1]||Nl).call(this,D,ue[0]));else throw new Error("Cannot close `"+D.type+"` ("+mr({start:D.start,end:D.end})+"): it’s not open");re.position.end=Wt(D.end)}function d(){return Ua(this.stack.pop())}function u(){this.data.expectingFirstListItemValue=!0}function p(D){if(this.data.expectingFirstListItemValue){const H=this.stack[this.stack.length-2];H.start=Number.parseInt(this.sliceSerialize(D),10),this.data.expectingFirstListItemValue=void 0}}function h(){const D=this.resume(),H=this.stack[this.stack.length-1];H.lang=D}function v(){const D=this.resume(),H=this.stack[this.stack.length-1];H.meta=D}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const D=this.resume(),H=this.stack[this.stack.length-1];H.value=D.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function x(){const D=this.resume(),H=this.stack[this.stack.length-1];H.value=D.replace(/(\r?\n|\r)$/g,"")}function y(D){const H=this.resume(),re=this.stack[this.stack.length-1];re.label=H,re.identifier=Ct(this.sliceSerialize(D)).toLowerCase()}function w(){const D=this.resume(),H=this.stack[this.stack.length-1];H.title=D}function S(){const D=this.resume(),H=this.stack[this.stack.length-1];H.url=D}function P(D){const H=this.stack[this.stack.length-1];if(!H.depth){const re=this.sliceSerialize(D).length;H.depth=re}}function C(){this.data.setextHeadingSlurpLineEnding=!0}function T(D){const H=this.stack[this.stack.length-1];H.depth=this.sliceSerialize(D).codePointAt(0)===61?1:2}function I(){this.data.setextHeadingSlurpLineEnding=void 0}function R(D){const re=this.stack[this.stack.length-1].children;let ue=re[re.length-1];(!ue||ue.type!=="text")&&(ue=Pn(),ue.position={start:Wt(D.start),end:void 0},re.push(ue)),this.stack.push(ue)}function E(D){const H=this.stack.pop();H.value+=this.sliceSerialize(D),H.position.end=Wt(D.end)}function N(D){const H=this.stack[this.stack.length-1];if(this.data.atHardBreak){const re=H.children[H.children.length-1];re.position.end=Wt(D.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(H.type)&&(R.call(this,D),E.call(this,D))}function A(){this.data.atHardBreak=!0}function j(){const D=this.resume(),H=this.stack[this.stack.length-1];H.value=D}function $(){const D=this.resume(),H=this.stack[this.stack.length-1];H.value=D}function O(){const D=this.resume(),H=this.stack[this.stack.length-1];H.value=D}function B(){const D=this.stack[this.stack.length-1];if(this.data.inReference){const H=this.data.referenceType||"shortcut";D.type+="Reference",D.referenceType=H,delete D.url,delete D.title}else delete D.identifier,delete D.label;this.data.referenceType=void 0}function W(){const D=this.stack[this.stack.length-1];if(this.data.inReference){const H=this.data.referenceType||"shortcut";D.type+="Reference",D.referenceType=H,delete D.url,delete D.title}else delete D.identifier,delete D.label;this.data.referenceType=void 0}function Y(D){const H=this.sliceSerialize(D),re=this.stack[this.stack.length-2];re.label=sy(H),re.identifier=Ct(H).toLowerCase()}function V(){const D=this.stack[this.stack.length-1],H=this.resume(),re=this.stack[this.stack.length-1];if(this.data.inReference=!0,re.type==="link"){const ue=D.children;re.children=ue}else re.alt=H}function k(){const D=this.resume(),H=this.stack[this.stack.length-1];H.url=D}function le(){const D=this.resume(),H=this.stack[this.stack.length-1];H.title=D}function be(){this.data.inReference=void 0}function _(){this.data.referenceType="collapsed"}function fe(D){const H=this.resume(),re=this.stack[this.stack.length-1];re.label=H,re.identifier=Ct(this.sliceSerialize(D)).toLowerCase(),this.data.referenceType="full"}function ke(D){this.data.characterReferenceType=D.type}function ce(D){const H=this.sliceSerialize(D),re=this.data.characterReferenceType;let ue;re?(ue=yu(H,re==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ue=Za(H);const pe=this.stack[this.stack.length-1];pe.value+=ue}function U(D){const H=this.stack.pop();H.position.end=Wt(D.end)}function te(D){E.call(this,D);const H=this.stack[this.stack.length-1];H.url=this.sliceSerialize(D)}function me(D){E.call(this,D);const H=this.stack[this.stack.length-1];H.url="mailto:"+this.sliceSerialize(D)}function ie(){return{type:"blockquote",children:[]}}function Q(){return{type:"code",lang:null,meta:null,value:""}}function G(){return{type:"inlineCode",value:""}}function se(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function K(){return{type:"emphasis",children:[]}}function Te(){return{type:"heading",depth:0,children:[]}}function Me(){return{type:"break"}}function De(){return{type:"html",value:""}}function bt(){return{type:"image",title:null,url:"",alt:null}}function ct(){return{type:"link",title:null,url:"",children:[]}}function He(D){return{type:"list",ordered:D.type==="listOrdered",start:null,spread:D._spread,children:[]}}function It(D){return{type:"listItem",spread:D._spread,checked:null,children:[]}}function dn(){return{type:"paragraph",children:[]}}function yt(){return{type:"strong",children:[]}}function Pn(){return{type:"text",value:""}}function fn(){return{type:"thematicBreak"}}}function Wt(e){return{line:e.line,column:e.column,offset:e.offset}}function Au(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Au(e,r):dy(e,r)}}function dy(e,t){let n;for(n in t)if(Iu.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Nl(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+mr({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+mr({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+mr({start:t.start,end:t.end})+") is still open")}function fy(e){const t=this;t.parser=n;function n(r){return cy(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function py(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function hy(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
6
+ `}]}function my(e,t){const n=t.value?t.value+`
7
+ `:"",r={},o=t.lang?t.lang.split(/\s+/):[];o.length>0&&(r.className=["language-"+o[0]]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function gy(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function vy(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function xy(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),o=Xn(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let a,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=i+1,s+=1,e.footnoteCounts.set(r,s);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+o,id:n+"fnref-"+o+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)}function by(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function yy(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Ru(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const o=e.all(t),i=o[0];i&&i.type==="text"?i.value="["+i.value:o.unshift({type:"text",value:"["});const a=o[o.length-1];return a&&a.type==="text"?a.value+=r:o.push({type:"text",value:r}),o}function wy(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Ru(e,t);const o={src:Xn(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(o.title=r.title);const i={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,i),e.applyData(t,i)}function ky(e,t){const n={src:Xn(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Sy(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Cy(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Ru(e,t);const o={href:Xn(r.url||"")};r.title!==null&&r.title!==void 0&&(o.title=r.title);const i={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function _y(e,t){const n={href:Xn(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Ey(e,t,n){const r=e.all(t),o=n?Ty(n):ju(t),i={},a=[];if(typeof t.checked=="boolean"){const d=r[0];let u;d&&d.type==="element"&&d.tagName==="p"?u=d:(u={type:"element",tagName:"p",properties:{},children:[]},r.unshift(u)),u.children.length>0&&u.children.unshift({type:"text",value:" "}),u.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let s=-1;for(;++s<r.length;){const d=r[s];(o||s!==0||d.type!=="element"||d.tagName!=="p")&&a.push({type:"text",value:`
8
+ `}),d.type==="element"&&d.tagName==="p"&&!o?a.push(...d.children):a.push(d)}const l=r[r.length-1];l&&(o||l.type!=="element"||l.tagName!=="p")&&a.push({type:"text",value:`
9
+ `});const c={type:"element",tagName:"li",properties:i,children:a};return e.patch(t,c),e.applyData(t,c)}function Ty(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=ju(n[r])}return t}function ju(e){const t=e.spread;return t??e.children.length>1}function Py(e,t){const n={},r=e.all(t);let o=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++o<r.length;){const a=r[o];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const i={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)}function Ny(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Iy(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Ay(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ry(e,t){const n=e.all(t),r=n.shift(),o=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],a),o.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},s=La(t.children[1]),l=fu(t.children[t.children.length-1]);s&&l&&(a.position={start:s,end:l}),o.push(a)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,i),e.applyData(t,i)}function jy(e,t,n){const r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,s=a?a.length:t.children.length;let l=-1;const c=[];for(;++l<s;){const u=t.children[l],p={},h=a?a[l]:void 0;h&&(p.align=h);let v={type:"element",tagName:i,properties:p,children:[]};u&&(v.children=e.all(u),e.patch(u,v),v=e.applyData(u,v)),c.push(v)}const d={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,d),e.applyData(t,d)}function Oy(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Il=9,Al=32;function My(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),o=0;const i=[];for(;r;)i.push(Rl(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return i.push(Rl(t.slice(o),o>0,!1)),i.join("")}function Rl(e,t,n){let r=0,o=e.length;if(t){let i=e.codePointAt(r);for(;i===Il||i===Al;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(o-1);for(;i===Il||i===Al;)o--,i=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}function Dy(e,t){const n={type:"text",value:My(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function $y(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const zy={blockquote:py,break:hy,code:my,delete:gy,emphasis:vy,footnoteReference:xy,heading:by,html:yy,imageReference:wy,image:ky,inlineCode:Sy,linkReference:Cy,link:_y,listItem:Ey,list:Py,paragraph:Ny,root:Iy,strong:Ay,table:Ry,tableCell:Oy,tableRow:jy,text:Dy,thematicBreak:$y,toml:qr,yaml:qr,definition:qr,footnoteDefinition:qr};function qr(){}const Ou=-1,$o=0,vr=1,xo=2,Ga=3,Wa=4,qa=5,Ka=6,Mu=7,Du=8,jl=typeof self=="object"?self:globalThis,Ly=(e,t)=>{const n=(o,i)=>(e.set(i,o),o),r=o=>{if(e.has(o))return e.get(o);const[i,a]=t[o];switch(i){case $o:case Ou:return n(a,o);case vr:{const s=n([],o);for(const l of a)s.push(r(l));return s}case xo:{const s=n({},o);for(const[l,c]of a)s[r(l)]=r(c);return s}case Ga:return n(new Date(a),o);case Wa:{const{source:s,flags:l}=a;return n(new RegExp(s,l),o)}case qa:{const s=n(new Map,o);for(const[l,c]of a)s.set(r(l),r(c));return s}case Ka:{const s=n(new Set,o);for(const l of a)s.add(r(l));return s}case Mu:{const{name:s,message:l}=a;return n(new jl[s](l),o)}case Du:return n(BigInt(a),o);case"BigInt":return n(Object(BigInt(a)),o);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:s}=new Uint8Array(a);return n(new DataView(s),a)}}return n(new jl[i](a),o)};return r},Ol=e=>Ly(new Map,e)(0),In="",{toString:Fy}={},{keys:By}=Object,lr=e=>{const t=typeof e;if(t!=="object"||!e)return[$o,t];const n=Fy.call(e).slice(8,-1);switch(n){case"Array":return[vr,In];case"Object":return[xo,In];case"Date":return[Ga,In];case"RegExp":return[Wa,In];case"Map":return[qa,In];case"Set":return[Ka,In];case"DataView":return[vr,n]}return n.includes("Array")?[vr,n]:n.includes("Error")?[Mu,n]:[xo,n]},Kr=([e,t])=>e===$o&&(t==="function"||t==="symbol"),Vy=(e,t,n,r)=>{const o=(a,s)=>{const l=r.push(a)-1;return n.set(s,l),l},i=a=>{if(n.has(a))return n.get(a);let[s,l]=lr(a);switch(s){case $o:{let d=a;switch(l){case"bigint":s=Du,d=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);d=null;break;case"undefined":return o([Ou],a)}return o([s,d],a)}case vr:{if(l){let p=a;return l==="DataView"?p=new Uint8Array(a.buffer):l==="ArrayBuffer"&&(p=new Uint8Array(a)),o([l,[...p]],a)}const d=[],u=o([s,d],a);for(const p of a)d.push(i(p));return u}case xo:{if(l)switch(l){case"BigInt":return o([l,a.toString()],a);case"Boolean":case"Number":case"String":return o([l,a.valueOf()],a)}if(t&&"toJSON"in a)return i(a.toJSON());const d=[],u=o([s,d],a);for(const p of By(a))(e||!Kr(lr(a[p])))&&d.push([i(p),i(a[p])]);return u}case Ga:return o([s,a.toISOString()],a);case Wa:{const{source:d,flags:u}=a;return o([s,{source:d,flags:u}],a)}case qa:{const d=[],u=o([s,d],a);for(const[p,h]of a)(e||!(Kr(lr(p))||Kr(lr(h))))&&d.push([i(p),i(h)]);return u}case Ka:{const d=[],u=o([s,d],a);for(const p of a)(e||!Kr(lr(p)))&&d.push(i(p));return u}}const{message:c}=a;return o([s,{name:l,message:c}],a)};return i},Ml=(e,{json:t,lossy:n}={})=>{const r=[];return Vy(!(t||n),!!t,new Map,r)(e),r},bo=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Ol(Ml(e,t)):structuredClone(e):(e,t)=>Ol(Ml(e,t));function Uy(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function Zy(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Hy(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Uy,r=e.options.footnoteBackLabel||Zy,o=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[];let l=-1;for(;++l<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[l]);if(!c)continue;const d=e.all(c),u=String(c.identifier).toUpperCase(),p=Xn(u.toLowerCase());let h=0;const v=[],g=e.footnoteCounts.get(u);for(;g!==void 0&&++h<=g;){v.length>0&&v.push({type:"text",value:" "});let y=typeof n=="string"?n:n(l,h);typeof y=="string"&&(y={type:"text",value:y}),v.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+p+(h>1?"-"+h:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,h),className:["data-footnote-backref"]},children:Array.isArray(y)?y:[y]})}const b=d[d.length-1];if(b&&b.type==="element"&&b.tagName==="p"){const y=b.children[b.children.length-1];y&&y.type==="text"?y.value+=" ":b.children.push({type:"text",value:" "}),b.children.push(...v)}else d.push(...v);const x={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(d,!0)};e.patch(c,x),s.push(x)}if(s.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...bo(a),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
10
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:`
11
+ `}]}}const zo=(function(e){if(e==null)return Ky;if(typeof e=="function")return Lo(e);if(typeof e=="object")return Array.isArray(e)?Gy(e):Wy(e);if(typeof e=="string")return qy(e);throw new Error("Expected function, string, or object as test")});function Gy(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=zo(e[n]);return Lo(r);function r(...o){let i=-1;for(;++i<t.length;)if(t[i].apply(this,o))return!0;return!1}}function Wy(e){const t=e;return Lo(n);function n(r){const o=r;let i;for(i in e)if(o[i]!==t[i])return!1;return!0}}function qy(e){return Lo(t);function t(n){return n&&n.type===e}}function Lo(e){return t;function t(n,r,o){return!!(Jy(n)&&e.call(this,n,typeof r=="number"?r:void 0,o||void 0))}}function Ky(){return!0}function Jy(e){return e!==null&&typeof e=="object"&&"type"in e}const $u=[],Yy=!0,aa=!1,Xy="skip";function zu(e,t,n,r){let o;typeof t=="function"&&typeof n!="function"?(r=n,n=t):o=t;const i=zo(o),a=r?-1:1;s(e,void 0,[])();function s(l,c,d){const u=l&&typeof l=="object"?l:{};if(typeof u.type=="string"){const h=typeof u.tagName=="string"?u.tagName:typeof u.name=="string"?u.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(l.type+(h?"<"+h+">":""))+")"})}return p;function p(){let h=$u,v,g,b;if((!t||i(l,c,d[d.length-1]||void 0))&&(h=Qy(n(l,d)),h[0]===aa))return h;if("children"in l&&l.children){const x=l;if(x.children&&h[0]!==Xy)for(g=(r?x.children.length:-1)+a,b=d.concat(x);g>-1&&g<x.children.length;){const y=x.children[g];if(v=s(y,g,b)(),v[0]===aa)return v;g=typeof v[1]=="number"?v[1]:g+a}}return h}}}function Qy(e){return Array.isArray(e)?e:typeof e=="number"?[Yy,e]:e==null?$u:[e]}function Ja(e,t,n,r){let o,i,a;typeof t=="function"&&typeof n!="function"?(i=void 0,a=t,o=n):(i=t,a=n,o=r),zu(e,i,s,o);function s(l,c){const d=c[c.length-1],u=d?d.children.indexOf(l):void 0;return a(l,u,d)}}const sa={}.hasOwnProperty,ew={};function tw(e,t){const n=t||ew,r=new Map,o=new Map,i=new Map,a={...zy,...n.handlers},s={all:c,applyData:rw,definitionById:r,footnoteById:o,footnoteCounts:i,footnoteOrder:[],handlers:a,one:l,options:n,patch:nw,wrap:iw};return Ja(e,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const u=d.type==="definition"?r:o,p=String(d.identifier).toUpperCase();u.has(p)||u.set(p,d)}}),s;function l(d,u){const p=d.type,h=s.handlers[p];if(sa.call(s.handlers,p)&&h)return h(s,d,u);if(s.options.passThrough&&s.options.passThrough.includes(p)){if("children"in d){const{children:g,...b}=d,x=bo(b);return x.children=s.all(d),x}return bo(d)}return(s.options.unknownHandler||ow)(s,d,u)}function c(d){const u=[];if("children"in d){const p=d.children;let h=-1;for(;++h<p.length;){const v=s.one(p[h],d);if(v){if(h&&p[h-1].type==="break"&&(!Array.isArray(v)&&v.type==="text"&&(v.value=Dl(v.value)),!Array.isArray(v)&&v.type==="element")){const g=v.children[0];g&&g.type==="text"&&(g.value=Dl(g.value))}Array.isArray(v)?u.push(...v):u.push(v)}}}return u}}function nw(e,t){e.position&&(t.position=Zv(e))}function rw(e,t){let n=t;if(e&&e.data){const r=e.data.hName,o=e.data.hChildren,i=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const a="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:a}}n.type==="element"&&i&&Object.assign(n.properties,bo(i)),"children"in n&&n.children&&o!==null&&o!==void 0&&(n.children=o)}return n}function ow(e,t){const n=t.data||{},r="value"in t&&!(sa.call(n,"hProperties")||sa.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function iw(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
12
+ `});++r<e.length;)r&&n.push({type:"text",value:`
13
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
14
+ `}),n}function Dl(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function $l(e,t){const n=tw(e,t),r=n.one(e,void 0),o=Hy(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&i.children.push({type:"text",value:`
15
+ `},o),i}function aw(e,t){return e&&"run"in e?async function(n,r){const o=$l(n,{file:r,...t});await e.run(o,r)}:function(n,r){return $l(n,{file:r,...e||t})}}function zl(e){if(e)throw e}var Ei,Ll;function sw(){if(Ll)return Ei;Ll=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=function(c){return typeof Array.isArray=="function"?Array.isArray(c):t.call(c)==="[object Array]"},i=function(c){if(!c||t.call(c)!=="[object Object]")return!1;var d=e.call(c,"constructor"),u=c.constructor&&c.constructor.prototype&&e.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!d&&!u)return!1;var p;for(p in c);return typeof p>"u"||e.call(c,p)},a=function(c,d){n&&d.name==="__proto__"?n(c,d.name,{enumerable:!0,configurable:!0,value:d.newValue,writable:!0}):c[d.name]=d.newValue},s=function(c,d){if(d==="__proto__")if(e.call(c,d)){if(r)return r(c,d).value}else return;return c[d]};return Ei=function l(){var c,d,u,p,h,v,g=arguments[0],b=1,x=arguments.length,y=!1;for(typeof g=="boolean"&&(y=g,g=arguments[1]||{},b=2),(g==null||typeof g!="object"&&typeof g!="function")&&(g={});b<x;++b)if(c=arguments[b],c!=null)for(d in c)u=s(g,d),p=s(c,d),g!==p&&(y&&p&&(i(p)||(h=o(p)))?(h?(h=!1,v=u&&o(u)?u:[]):v=u&&i(u)?u:{},a(g,{name:d,newValue:l(y,v,p)})):typeof p<"u"&&a(g,{name:d,newValue:p}));return g},Ei}var lw=sw();const Ti=nu(lw);function la(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function cw(){const e=[],t={run:n,use:r};return t;function n(...o){let i=-1;const a=o.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);s(null,...o);function s(l,...c){const d=e[++i];let u=-1;if(l){a(l);return}for(;++u<o.length;)(c[u]===null||c[u]===void 0)&&(c[u]=o[u]);o=c,d?uw(d,s)(...c):a(null,...c)}}function r(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function uw(e,t){let n;return r;function r(...a){const s=e.length>a.length;let l;s&&a.push(o);try{l=e.apply(this,a)}catch(c){const d=c;if(s&&n)throw d;return o(d)}s||(l&&l.then&&typeof l.then=="function"?l.then(i,o):l instanceof Error?o(l):i(l))}function o(a,...s){n||(n=!0,t(a,...s))}function i(a){o(null,a)}}const jt={basename:dw,dirname:fw,extname:pw,join:hw,sep:"/"};function dw(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Rr(e);let n=0,r=-1,o=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(i){n=o+1;break}}else r<0&&(i=!0,r=o+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,s=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(i){n=o+1;break}}else a<0&&(i=!0,a=o+1),s>-1&&(e.codePointAt(o)===t.codePointAt(s--)?s<0&&(r=o):(s=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function fw(e){if(Rr(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function pw(e){Rr(e);let t=e.length,n=-1,r=0,o=-1,i=0,a;for(;t--;){const s=e.codePointAt(t);if(s===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),s===46?o<0?o=t:i!==1&&(i=1):o>-1&&(i=-1)}return o<0||n<0||i===0||i===1&&o===n-1&&o===r+1?"":e.slice(o,n)}function hw(...e){let t=-1,n;for(;++t<e.length;)Rr(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":mw(n)}function mw(e){Rr(e);const t=e.codePointAt(0)===47;let n=gw(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function gw(e,t){let n="",r=0,o=-1,i=0,a=-1,s,l;for(;++a<=e.length;){if(a<e.length)s=e.codePointAt(a);else{if(s===47)break;s=47}if(s===47){if(!(o===a-1||i===1))if(o!==a-1&&i===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),o=a,i=0;continue}}else if(n.length>0){n="",r=0,o=a,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(o+1,a):n=e.slice(o+1,a),r=a-o-1;o=a,i=0}else s===46&&i>-1?i++:i=-1}return n}function Rr(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const vw={cwd:xw};function xw(){return"/"}function ca(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function bw(e){if(typeof e=="string")e=new URL(e);else if(!ca(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return yw(e)}function yw(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(t)}const Pi=["history","path","basename","stem","extname","dirname"];class Lu{constructor(t){let n;t?ca(t)?n={path:t}:typeof t=="string"||ww(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":vw.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Pi.length;){const i=Pi[r];i in n&&n[i]!==void 0&&n[i]!==null&&(this[i]=i==="history"?[...n[i]]:n[i])}let o;for(o in n)Pi.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?jt.basename(this.path):void 0}set basename(t){Ii(t,"basename"),Ni(t,"basename"),this.path=jt.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?jt.dirname(this.path):void 0}set dirname(t){Fl(this.basename,"dirname"),this.path=jt.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?jt.extname(this.path):void 0}set extname(t){if(Ni(t,"extname"),Fl(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=jt.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){ca(t)&&(t=bw(t)),Ii(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?jt.basename(this.path,this.extname):void 0}set stem(t){Ii(t,"stem"),Ni(t,"stem"),this.path=jt.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const o=this.message(t,n,r);throw o.fatal=!0,o}info(t,n,r){const o=this.message(t,n,r);return o.fatal=void 0,o}message(t,n,r){const o=new Qe(t,n,r);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Ni(e,t){if(e&&e.includes(jt.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+jt.sep+"`")}function Ii(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Fl(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function ww(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const kw=(function(e){const r=this.constructor.prototype,o=r[e],i=function(){return o.apply(i,arguments)};return Object.setPrototypeOf(i,r),i}),Sw={}.hasOwnProperty;class Ya extends kw{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=cw()}copy(){const t=new Ya;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Ti(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(ji("data",this.frozen),this.namespace[t]=n,this):Sw.call(this.namespace,t)&&this.namespace[t]||void 0:t?(ji("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const o=n.call(t,...r);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Jr(t),r=this.parser||this.Parser;return Ai("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Ai("process",this.parser||this.Parser),Ri("process",this.compiler||this.Compiler),n?o(void 0,n):new Promise(o);function o(i,a){const s=Jr(t),l=r.parse(s);r.run(l,s,function(d,u,p){if(d||!u||!p)return c(d);const h=u,v=r.stringify(h,p);Ew(v)?p.value=v:p.result=v,c(d,p)});function c(d,u){d||!u?a(d):i?i(u):n(void 0,u)}}}processSync(t){let n=!1,r;return this.freeze(),Ai("processSync",this.parser||this.Parser),Ri("processSync",this.compiler||this.Compiler),this.process(t,o),Vl("processSync","process",n),r;function o(i,a){n=!0,zl(i),r=a}}run(t,n,r){Bl(t),this.freeze();const o=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?i(void 0,r):new Promise(i);function i(a,s){const l=Jr(n);o.run(t,l,c);function c(d,u,p){const h=u||t;d?s(d):a?a(h):r(void 0,h,p)}}}runSync(t,n){let r=!1,o;return this.run(t,n,i),Vl("runSync","run",r),o;function i(a,s){zl(a),o=s,r=!0}}stringify(t,n){this.freeze();const r=Jr(n),o=this.compiler||this.Compiler;return Ri("stringify",o),Bl(t),o(t,r)}use(t,...n){const r=this.attachers,o=this.namespace;if(ji("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?s(t):a(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function i(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[d,...u]=c;l(d,u)}else a(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function a(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");s(c.plugins),c.settings&&(o.settings=Ti(!0,o.settings,c.settings))}function s(c){let d=-1;if(c!=null)if(Array.isArray(c))for(;++d<c.length;){const u=c[d];i(u)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,d){let u=-1,p=-1;for(;++u<r.length;)if(r[u][0]===c){p=u;break}if(p===-1)r.push([c,...d]);else if(d.length>0){let[h,...v]=d;const g=r[p][1];la(g)&&la(h)&&(h=Ti(!0,g,h)),r[p]=[c,h,...v]}}}}const Cw=new Ya().freeze();function Ai(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Ri(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function ji(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Bl(e){if(!la(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Vl(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Jr(e){return _w(e)?e:new Lu(e)}function _w(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Ew(e){return typeof e=="string"||Tw(e)}function Tw(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Pw="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Ul=[],Zl={allowDangerousHtml:!0},Nw=/^(https?|ircs?|mailto|xmpp)$/i,Iw=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Fu(e){const t=Aw(e),n=Rw(e);return jw(t.runSync(t.parse(n),n),e)}function Aw(e){const t=e.rehypePlugins||Ul,n=e.remarkPlugins||Ul,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Zl}:Zl;return Cw().use(fy).use(n).use(aw,r).use(t)}function Rw(e){const t=e.children||"",n=new Lu;return typeof t=="string"&&(n.value=t),n}function jw(e,t){const n=t.allowedElements,r=t.allowElement,o=t.components,i=t.disallowedElements,a=t.skipHtml,s=t.unwrapDisallowed,l=t.urlTransform||Ow;for(const d of Iw)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+Pw+d.id,void 0);return Ja(e,c),Kv(e,{Fragment:f.Fragment,components:o,ignoreInvalidStyle:!0,jsx:f.jsx,jsxs:f.jsxs,passKeys:!0,passNode:!0});function c(d,u,p){if(d.type==="raw"&&p&&typeof u=="number")return a?p.children.splice(u,1):p.children[u]={type:"text",value:d.value},u;if(d.type==="element"){let h;for(h in Si)if(Object.hasOwn(Si,h)&&Object.hasOwn(d.properties,h)){const v=d.properties[h],g=Si[h];(g===null||g.includes(d.tagName))&&(d.properties[h]=l(String(v||""),h,d))}}if(d.type==="element"){let h=n?!n.includes(d.tagName):i?i.includes(d.tagName):!1;if(!h&&r&&typeof u=="number"&&(h=!r(d,u,p)),h&&p&&typeof u=="number")return s&&d.children?p.children.splice(u,1,...d.children):p.children.splice(u,1),u}}}function Ow(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||n!==-1&&t>n||r!==-1&&t>r||Nw.test(e.slice(0,t))?e:""}function Hl(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,o=n.indexOf(t);for(;o!==-1;)r++,o=n.indexOf(t,o+t.length);return r}function Mw(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Dw(e,t,n){const o=zo((n||{}).ignore||[]),i=$w(t);let a=-1;for(;++a<i.length;)zu(e,"text",s);function s(c,d){let u=-1,p;for(;++u<d.length;){const h=d[u],v=p?p.children:void 0;if(o(h,v?v.indexOf(h):void 0,p))return;p=h}if(p)return l(c,d)}function l(c,d){const u=d[d.length-1],p=i[a][0],h=i[a][1];let v=0;const b=u.children.indexOf(c);let x=!1,y=[];p.lastIndex=0;let w=p.exec(c.value);for(;w;){const S=w.index,P={index:w.index,input:w.input,stack:[...d,c]};let C=h(...w,P);if(typeof C=="string"&&(C=C.length>0?{type:"text",value:C}:void 0),C===!1?p.lastIndex=S+1:(v!==S&&y.push({type:"text",value:c.value.slice(v,S)}),Array.isArray(C)?y.push(...C):C&&y.push(C),v=S+w[0].length,x=!0),!p.global)break;w=p.exec(c.value)}return x?(v<c.value.length&&y.push({type:"text",value:c.value.slice(v)}),u.children.splice(b,1,...y)):y=[c],b+y.length}}function $w(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const o=n[r];t.push([zw(o[0]),Lw(o[1])])}return t}function zw(e){return typeof e=="string"?new RegExp(Mw(e),"g"):e}function Lw(e){return typeof e=="function"?e:function(){return e}}const Oi="phrasing",Mi=["autolink","link","image","label"];function Fw(){return{transforms:[Ww],enter:{literalAutolink:Vw,literalAutolinkEmail:Di,literalAutolinkHttp:Di,literalAutolinkWww:Di},exit:{literalAutolink:Gw,literalAutolinkEmail:Hw,literalAutolinkHttp:Uw,literalAutolinkWww:Zw}}}function Bw(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Oi,notInConstruct:Mi},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Oi,notInConstruct:Mi},{character:":",before:"[ps]",after:"\\/",inConstruct:Oi,notInConstruct:Mi}]}}function Vw(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Di(e){this.config.enter.autolinkProtocol.call(this,e)}function Uw(e){this.config.exit.autolinkProtocol.call(this,e)}function Zw(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function Hw(e){this.config.exit.autolinkEmail.call(this,e)}function Gw(e){this.exit(e)}function Ww(e){Dw(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,qw],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Kw]],{ignore:["link","linkReference"]})}function qw(e,t,n,r,o){let i="";if(!Bu(o)||(/^w/i.test(t)&&(n=t+n,t="",i="http://"),!Jw(n)))return!1;const a=Yw(n+r);if(!a[0])return!1;const s={type:"link",title:null,url:i+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[s,{type:"text",value:a[1]}]:s}function Kw(e,t,n,r){return!Bu(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function Jw(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function Yw(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const o=Hl(e,"(");let i=Hl(e,")");for(;r!==-1&&o>i;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),i++;return[e,n]}function Bu(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||xn(n)||Mo(n))&&(!t||n!==47)}Vu.peek=a0;function Xw(){this.buffer()}function Qw(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function e0(){this.buffer()}function t0(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function n0(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ct(this.sliceSerialize(e)).toLowerCase(),n.label=t}function r0(e){this.exit(e)}function o0(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ct(this.sliceSerialize(e)).toLowerCase(),n.label=t}function i0(e){this.exit(e)}function a0(){return"["}function Vu(e,t,n,r){const o=n.createTracker(r);let i=o.move("[^");const a=n.enter("footnoteReference"),s=n.enter("reference");return i+=o.move(n.safe(n.associationId(e),{after:"]",before:i})),s(),a(),i+=o.move("]"),i}function s0(){return{enter:{gfmFootnoteCallString:Xw,gfmFootnoteCall:Qw,gfmFootnoteDefinitionLabelString:e0,gfmFootnoteDefinition:t0},exit:{gfmFootnoteCallString:n0,gfmFootnoteCall:r0,gfmFootnoteDefinitionLabelString:o0,gfmFootnoteDefinition:i0}}}function l0(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Vu},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,o,i,a){const s=i.createTracker(a);let l=s.move("[^");const c=i.enter("footnoteDefinition"),d=i.enter("label");return l+=s.move(i.safe(i.associationId(r),{before:l,after:"]"})),d(),l+=s.move("]:"),r.children&&r.children.length>0&&(s.shift(4),l+=s.move((t?`
16
+ `:" ")+i.indentLines(i.containerFlow(r,s.current()),t?Uu:c0))),c(),l}}function c0(e,t,n){return t===0?e:Uu(e,t,n)}function Uu(e,t,n){return(n?"":" ")+e}const u0=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Zu.peek=m0;function d0(){return{canContainEols:["delete"],enter:{strikethrough:p0},exit:{strikethrough:h0}}}function f0(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:u0}],handlers:{delete:Zu}}}function p0(e){this.enter({type:"delete",children:[]},e)}function h0(e){this.exit(e)}function Zu(e,t,n,r){const o=n.createTracker(r),i=n.enter("strikethrough");let a=o.move("~~");return a+=n.containerPhrasing(e,{...o.current(),before:a,after:"~"}),a+=o.move("~~"),i(),a}function m0(){return"~"}function g0(e){return e.length}function v0(e,t){const n=t||{},r=(n.align||[]).concat(),o=n.stringLength||g0,i=[],a=[],s=[],l=[];let c=0,d=-1;for(;++d<e.length;){const g=[],b=[];let x=-1;for(e[d].length>c&&(c=e[d].length);++x<e[d].length;){const y=x0(e[d][x]);if(n.alignDelimiters!==!1){const w=o(y);b[x]=w,(l[x]===void 0||w>l[x])&&(l[x]=w)}g.push(y)}a[d]=g,s[d]=b}let u=-1;if(typeof r=="object"&&"length"in r)for(;++u<c;)i[u]=Gl(r[u]);else{const g=Gl(r);for(;++u<c;)i[u]=g}u=-1;const p=[],h=[];for(;++u<c;){const g=i[u];let b="",x="";g===99?(b=":",x=":"):g===108?b=":":g===114&&(x=":");let y=n.alignDelimiters===!1?1:Math.max(1,l[u]-b.length-x.length);const w=b+"-".repeat(y)+x;n.alignDelimiters!==!1&&(y=b.length+y+x.length,y>l[u]&&(l[u]=y),h[u]=y),p[u]=w}a.splice(1,0,p),s.splice(1,0,h),d=-1;const v=[];for(;++d<a.length;){const g=a[d],b=s[d];u=-1;const x=[];for(;++u<c;){const y=g[u]||"";let w="",S="";if(n.alignDelimiters!==!1){const P=l[u]-(b[u]||0),C=i[u];C===114?w=" ".repeat(P):C===99?P%2?(w=" ".repeat(P/2+.5),S=" ".repeat(P/2-.5)):(w=" ".repeat(P/2),S=w):S=" ".repeat(P)}n.delimiterStart!==!1&&!u&&x.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&y==="")&&(n.delimiterStart!==!1||u)&&x.push(" "),n.alignDelimiters!==!1&&x.push(w),x.push(y),n.alignDelimiters!==!1&&x.push(S),n.padding!==!1&&x.push(" "),(n.delimiterEnd!==!1||u!==c-1)&&x.push("|")}v.push(n.delimiterEnd===!1?x.join("").replace(/ +$/,""):x.join(""))}return v.join(`
17
+ `)}function x0(e){return e==null?"":String(e)}function Gl(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function b0(e,t,n,r){const o=n.enter("blockquote"),i=n.createTracker(r);i.move("> "),i.shift(2);const a=n.indentLines(n.containerFlow(e,i.current()),y0);return o(),a}function y0(e,t,n){return">"+(n?"":" ")+e}function w0(e,t){return Wl(e,t.inConstruct,!0)&&!Wl(e,t.notInConstruct,!1)}function Wl(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function ql(e,t,n,r){let o=-1;for(;++o<n.unsafe.length;)if(n.unsafe[o].character===`
18
+ `&&w0(n.stack,n.unsafe[o]))return/[ \t]/.test(r.before)?"":" ";return`\\
19
+ `}function k0(e,t){const n=String(e);let r=n.indexOf(t),o=r,i=0,a=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===o?++i>a&&(a=i):i=1,o=r+t.length,r=n.indexOf(t,o);return a}function S0(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function C0(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function _0(e,t,n,r){const o=C0(n),i=e.value||"",a=o==="`"?"GraveAccent":"Tilde";if(S0(e,n)){const u=n.enter("codeIndented"),p=n.indentLines(i,E0);return u(),p}const s=n.createTracker(r),l=o.repeat(Math.max(k0(i,o)+1,3)),c=n.enter("codeFenced");let d=s.move(l);if(e.lang){const u=n.enter(`codeFencedLang${a}`);d+=s.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...s.current()})),u()}if(e.lang&&e.meta){const u=n.enter(`codeFencedMeta${a}`);d+=s.move(" "),d+=s.move(n.safe(e.meta,{before:d,after:`
20
+ `,encode:["`"],...s.current()})),u()}return d+=s.move(`
21
+ `),i&&(d+=s.move(i+`
22
+ `)),d+=s.move(l),c(),d}function E0(e,t,n){return(n?"":" ")+e}function Xa(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function T0(e,t,n,r){const o=Xa(n),i=o==='"'?"Quote":"Apostrophe",a=n.enter("definition");let s=n.enter("label");const l=n.createTracker(r);let c=l.move("[");return c+=l.move(n.safe(n.associationId(e),{before:c,after:"]",...l.current()})),c+=l.move("]: "),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(s=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":`
23
+ `,...l.current()}))),s(),e.title&&(s=n.enter(`title${i}`),c+=l.move(" "+o),c+=l.move(n.safe(e.title,{before:c,after:o,...l.current()})),c+=l.move(o),s()),a(),c}function P0(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function wr(e){return"&#x"+e.toString(16).toUpperCase()+";"}function yo(e,t,n){const r=Gn(e),o=Gn(t);return r===void 0?o===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Hu.peek=N0;function Hu(e,t,n,r){const o=P0(n),i=n.enter("emphasis"),a=n.createTracker(r),s=a.move(o);let l=a.move(n.containerPhrasing(e,{after:o,before:s,...a.current()}));const c=l.charCodeAt(0),d=yo(r.before.charCodeAt(r.before.length-1),c,o);d.inside&&(l=wr(c)+l.slice(1));const u=l.charCodeAt(l.length-1),p=yo(r.after.charCodeAt(0),u,o);p.inside&&(l=l.slice(0,-1)+wr(u));const h=a.move(o);return i(),n.attentionEncodeSurroundingInfo={after:p.outside,before:d.outside},s+l+h}function N0(e,t,n){return n.options.emphasis||"*"}function I0(e,t){let n=!1;return Ja(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,aa}),!!((!e.depth||e.depth<3)&&Ua(e)&&(t.options.setext||n))}function A0(e,t,n,r){const o=Math.max(Math.min(6,e.depth||1),1),i=n.createTracker(r);if(I0(e,n)){const d=n.enter("headingSetext"),u=n.enter("phrasing"),p=n.containerPhrasing(e,{...i.current(),before:`
24
+ `,after:`
25
+ `});return u(),d(),p+`
26
+ `+(o===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(`
27
+ `))+1))}const a="#".repeat(o),s=n.enter("headingAtx"),l=n.enter("phrasing");i.move(a+" ");let c=n.containerPhrasing(e,{before:"# ",after:`
28
+ `,...i.current()});return/^[\t ]/.test(c)&&(c=wr(c.charCodeAt(0))+c.slice(1)),c=c?a+" "+c:a,n.options.closeAtx&&(c+=" "+a),l(),s(),c}Gu.peek=R0;function Gu(e){return e.value||""}function R0(){return"<"}Wu.peek=j0;function Wu(e,t,n,r){const o=Xa(n),i=o==='"'?"Quote":"Apostrophe",a=n.enter("image");let s=n.enter("label");const l=n.createTracker(r);let c=l.move("![");return c+=l.move(n.safe(e.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(s=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":")",...l.current()}))),s(),e.title&&(s=n.enter(`title${i}`),c+=l.move(" "+o),c+=l.move(n.safe(e.title,{before:c,after:o,...l.current()})),c+=l.move(o),s()),c+=l.move(")"),a(),c}function j0(){return"!"}qu.peek=O0;function qu(e,t,n,r){const o=e.referenceType,i=n.enter("imageReference");let a=n.enter("label");const s=n.createTracker(r);let l=s.move("![");const c=n.safe(e.alt,{before:l,after:"]",...s.current()});l+=s.move(c+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const u=n.safe(n.associationId(e),{before:l,after:"]",...s.current()});return a(),n.stack=d,i(),o==="full"||!c||c!==u?l+=s.move(u+"]"):o==="shortcut"?l=l.slice(0,-1):l+=s.move("]"),l}function O0(){return"!"}Ku.peek=M0;function Ku(e,t,n){let r=e.value||"",o="`",i=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(r);)o+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i<n.unsafe.length;){const a=n.unsafe[i],s=n.compilePattern(a);let l;if(a.atBreak)for(;l=s.exec(r);){let c=l.index;r.charCodeAt(c)===10&&r.charCodeAt(c-1)===13&&c--,r=r.slice(0,c)+" "+r.slice(l.index+1)}}return o+r+o}function M0(){return"`"}function Ju(e,t){const n=Ua(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Yu.peek=D0;function Yu(e,t,n,r){const o=Xa(n),i=o==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let s,l;if(Ju(e,n)){const d=n.stack;n.stack=[],s=n.enter("autolink");let u=a.move("<");return u+=a.move(n.containerPhrasing(e,{before:u,after:">",...a.current()})),u+=a.move(">"),s(),n.stack=d,u}s=n.enter("link"),l=n.enter("label");let c=a.move("[");return c+=a.move(n.containerPhrasing(e,{before:c,after:"](",...a.current()})),c+=a.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=a.move("<"),c+=a.move(n.safe(e.url,{before:c,after:">",...a.current()})),c+=a.move(">")):(l=n.enter("destinationRaw"),c+=a.move(n.safe(e.url,{before:c,after:e.title?" ":")",...a.current()}))),l(),e.title&&(l=n.enter(`title${i}`),c+=a.move(" "+o),c+=a.move(n.safe(e.title,{before:c,after:o,...a.current()})),c+=a.move(o),l()),c+=a.move(")"),s(),c}function D0(e,t,n){return Ju(e,n)?"<":"["}Xu.peek=$0;function Xu(e,t,n,r){const o=e.referenceType,i=n.enter("linkReference");let a=n.enter("label");const s=n.createTracker(r);let l=s.move("[");const c=n.containerPhrasing(e,{before:l,after:"]",...s.current()});l+=s.move(c+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const u=n.safe(n.associationId(e),{before:l,after:"]",...s.current()});return a(),n.stack=d,i(),o==="full"||!c||c!==u?l+=s.move(u+"]"):o==="shortcut"?l=l.slice(0,-1):l+=s.move("]"),l}function $0(){return"["}function Qa(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function z0(e){const t=Qa(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function L0(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Qu(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function F0(e,t,n,r){const o=n.enter("list"),i=n.bulletCurrent;let a=e.ordered?L0(n):Qa(n);const s=e.ordered?a==="."?")":".":z0(n);let l=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const d=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&d&&(!d.children||!d.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(l=!0),Qu(n)===a&&d){let u=-1;for(;++u<e.children.length;){const p=e.children[u];if(p&&p.type==="listItem"&&p.children&&p.children[0]&&p.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(a=s),n.bulletCurrent=a;const c=n.containerFlow(e,r);return n.bulletLastUsed=a,n.bulletCurrent=i,o(),c}function B0(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function V0(e,t,n,r){const o=B0(n);let i=n.bulletCurrent||Qa(n);t&&t.type==="list"&&t.ordered&&(i=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+i);let a=i.length+1;(o==="tab"||o==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const s=n.createTracker(r);s.move(i+" ".repeat(a-i.length)),s.shift(a);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,s.current()),d);return l(),c;function d(u,p,h){return p?(h?"":" ".repeat(a))+u:(h?i:i+" ".repeat(a-i.length))+u}}function U0(e,t,n,r){const o=n.enter("paragraph"),i=n.enter("phrasing"),a=n.containerPhrasing(e,r);return i(),o(),a}const Z0=zo(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function H0(e,t,n,r){return(e.children.some(function(a){return Z0(a)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function G0(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}ed.peek=W0;function ed(e,t,n,r){const o=G0(n),i=n.enter("strong"),a=n.createTracker(r),s=a.move(o+o);let l=a.move(n.containerPhrasing(e,{after:o,before:s,...a.current()}));const c=l.charCodeAt(0),d=yo(r.before.charCodeAt(r.before.length-1),c,o);d.inside&&(l=wr(c)+l.slice(1));const u=l.charCodeAt(l.length-1),p=yo(r.after.charCodeAt(0),u,o);p.inside&&(l=l.slice(0,-1)+wr(u));const h=a.move(o+o);return i(),n.attentionEncodeSurroundingInfo={after:p.outside,before:d.outside},s+l+h}function W0(e,t,n){return n.options.strong||"*"}function q0(e,t,n,r){return n.safe(e.value,r)}function K0(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function J0(e,t,n){const r=(Qu(n)+(n.options.ruleSpaces?" ":"")).repeat(K0(n));return n.options.ruleSpaces?r.slice(0,-1):r}const td={blockquote:b0,break:ql,code:_0,definition:T0,emphasis:Hu,hardBreak:ql,heading:A0,html:Gu,image:Wu,imageReference:qu,inlineCode:Ku,link:Yu,linkReference:Xu,list:F0,listItem:V0,paragraph:U0,root:H0,strong:ed,text:q0,thematicBreak:J0};function Y0(){return{enter:{table:X0,tableData:Kl,tableHeader:Kl,tableRow:ek},exit:{codeText:tk,table:Q0,tableData:$i,tableHeader:$i,tableRow:$i}}}function X0(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function Q0(e){this.exit(e),this.data.inTable=void 0}function ek(e){this.enter({type:"tableRow",children:[]},e)}function $i(e){this.exit(e)}function Kl(e){this.enter({type:"tableCell",children:[]},e)}function tk(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,nk));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function nk(e,t){return t==="|"?t:e}function rk(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,o=t.stringLength,i=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
29
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:a,tableCell:l,tableRow:s}};function a(h,v,g,b){return c(d(h,g,b),h.align)}function s(h,v,g,b){const x=u(h,g,b),y=c([x]);return y.slice(0,y.indexOf(`
30
+ `))}function l(h,v,g,b){const x=g.enter("tableCell"),y=g.enter("phrasing"),w=g.containerPhrasing(h,{...b,before:i,after:i});return y(),x(),w}function c(h,v){return v0(h,{align:v,alignDelimiters:r,padding:n,stringLength:o})}function d(h,v,g){const b=h.children;let x=-1;const y=[],w=v.enter("table");for(;++x<b.length;)y[x]=u(b[x],v,g);return w(),y}function u(h,v,g){const b=h.children;let x=-1;const y=[],w=v.enter("tableRow");for(;++x<b.length;)y[x]=l(b[x],h,v,g);return w(),y}function p(h,v,g){let b=td.inlineCode(h,v,g);return g.stack.includes("tableCell")&&(b=b.replace(/\|/g,"\\$&")),b}}function ok(){return{exit:{taskListCheckValueChecked:Jl,taskListCheckValueUnchecked:Jl,paragraph:ak}}}function ik(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:sk}}}function Jl(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function ak(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const o=t.children;let i=-1,a;for(;++i<o.length;){const s=o[i];if(s.type==="paragraph"){a=s;break}}a===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function sk(e,t,n,r){const o=e.children[0],i=typeof e.checked=="boolean"&&o&&o.type==="paragraph",a="["+(e.checked?"x":" ")+"] ",s=n.createTracker(r);i&&s.move(a);let l=td.listItem(e,t,n,{...r,...s.current()});return i&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),l;function c(d){return d+a}}function lk(){return[Fw(),s0(),d0(),Y0(),ok()]}function ck(e){return{extensions:[Bw(),l0(e),f0(),rk(e),ik()]}}const uk={tokenize:gk,partial:!0},nd={tokenize:vk,partial:!0},rd={tokenize:xk,partial:!0},od={tokenize:bk,partial:!0},dk={tokenize:yk,partial:!0},id={name:"wwwAutolink",tokenize:hk,previous:sd},ad={name:"protocolAutolink",tokenize:mk,previous:ld},Ht={name:"emailAutolink",tokenize:pk,previous:cd},zt={};function fk(){return{text:zt}}let hn=48;for(;hn<123;)zt[hn]=Ht,hn++,hn===58?hn=65:hn===91&&(hn=97);zt[43]=Ht;zt[45]=Ht;zt[46]=Ht;zt[95]=Ht;zt[72]=[Ht,ad];zt[104]=[Ht,ad];zt[87]=[Ht,id];zt[119]=[Ht,id];function pk(e,t,n){const r=this;let o,i;return a;function a(u){return!ua(u)||!cd.call(r,r.previous)||es(r.events)?n(u):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),s(u))}function s(u){return ua(u)?(e.consume(u),s):u===64?(e.consume(u),l):n(u)}function l(u){return u===46?e.check(dk,d,c)(u):u===45||u===95||Xe(u)?(i=!0,e.consume(u),l):d(u)}function c(u){return e.consume(u),o=!0,l}function d(u){return i&&o&&nt(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(u)):n(u)}}function hk(e,t,n){const r=this;return o;function o(a){return a!==87&&a!==119||!sd.call(r,r.previous)||es(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(uk,e.attempt(nd,e.attempt(rd,i),n),n)(a))}function i(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function mk(e,t,n){const r=this;let o="",i=!1;return a;function a(u){return(u===72||u===104)&&ld.call(r,r.previous)&&!es(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(u),e.consume(u),s):n(u)}function s(u){if(nt(u)&&o.length<5)return o+=String.fromCodePoint(u),e.consume(u),s;if(u===58){const p=o.toLowerCase();if(p==="http"||p==="https")return e.consume(u),l}return n(u)}function l(u){return u===47?(e.consume(u),i?c:(i=!0,l)):n(u)}function c(u){return u===null||vo(u)||Se(u)||xn(u)||Mo(u)?n(u):e.attempt(nd,e.attempt(rd,d),n)(u)}function d(u){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(u)}}function gk(e,t,n){let r=0;return o;function o(a){return(a===87||a===119)&&r<3?(r++,e.consume(a),o):a===46&&r===3?(e.consume(a),i):n(a)}function i(a){return a===null?n(a):t(a)}}function vk(e,t,n){let r,o,i;return a;function a(c){return c===46||c===95?e.check(od,l,s)(c):c===null||Se(c)||xn(c)||c!==45&&Mo(c)?l(c):(i=!0,e.consume(c),a)}function s(c){return c===95?r=!0:(o=r,r=void 0),e.consume(c),a}function l(c){return o||r||!i?n(c):t(c)}}function xk(e,t){let n=0,r=0;return o;function o(a){return a===40?(n++,e.consume(a),o):a===41&&r<n?i(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?e.check(od,t,i)(a):a===null||Se(a)||xn(a)?t(a):(e.consume(a),o)}function i(a){return a===41&&r++,e.consume(a),o}}function bk(e,t,n){return r;function r(s){return s===33||s===34||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===63||s===95||s===126?(e.consume(s),r):s===38?(e.consume(s),i):s===93?(e.consume(s),o):s===60||s===null||Se(s)||xn(s)?t(s):n(s)}function o(s){return s===null||s===40||s===91||Se(s)||xn(s)?t(s):r(s)}function i(s){return nt(s)?a(s):n(s)}function a(s){return s===59?(e.consume(s),r):nt(s)?(e.consume(s),a):n(s)}}function yk(e,t,n){return r;function r(i){return e.consume(i),o}function o(i){return Xe(i)?n(i):t(i)}}function sd(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Se(e)}function ld(e){return!nt(e)}function cd(e){return!(e===47||ua(e))}function ua(e){return e===43||e===45||e===46||e===95||Xe(e)}function es(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const wk={tokenize:Nk,partial:!0};function kk(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Ek,continuation:{tokenize:Tk},exit:Pk}},text:{91:{name:"gfmFootnoteCall",tokenize:_k},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Sk,resolveTo:Ck}}}}function Sk(e,t,n){const r=this;let o=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;o--;){const l=r.events[o][1];if(l.type==="labelImage"){a=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return s;function s(l){if(!a||!a._balanced)return n(l);const c=Ct(r.sliceSerialize({start:a.end,end:r.now()}));return c.codePointAt(0)!==94||!i.includes(c.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function Ck(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},s=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",o,t],["exit",o,t],["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...s),e}function _k(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,a;return s;function s(u){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),l}function l(u){return u!==94?n(u):(e.enter("gfmFootnoteCallMarker"),e.consume(u),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(u){if(i>999||u===93&&!a||u===null||u===91||Se(u))return n(u);if(u===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return o.includes(Ct(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(u)}return Se(u)||(a=!0),i++,e.consume(u),u===92?d:c}function d(u){return u===91||u===92||u===93?(e.consume(u),i++,c):c(u)}}function Ek(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a=0,s;return l;function l(v){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(v),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(v){return v===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(v),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(v)}function d(v){if(a>999||v===93&&!s||v===null||v===91||Se(v))return n(v);if(v===93){e.exit("chunkString");const g=e.exit("gfmFootnoteDefinitionLabelString");return i=Ct(r.sliceSerialize(g)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(v),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return Se(v)||(s=!0),a++,e.consume(v),v===92?u:d}function u(v){return v===91||v===92||v===93?(e.consume(v),a++,d):d(v)}function p(v){return v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),o.includes(i)||o.push(i),ve(e,h,"gfmFootnoteDefinitionWhitespace")):n(v)}function h(v){return t(v)}}function Tk(e,t,n){return e.check(Ar,t,e.attempt(wk,t,n))}function Pk(e){e.exit("gfmFootnoteDefinition")}function Nk(e,t,n){const r=this;return ve(e,o,"gfmFootnoteDefinitionIndent",5);function o(i){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(i):n(i)}}function Ik(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:i,resolveAll:o};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function o(a,s){let l=-1;for(;++l<a.length;)if(a[l][0]==="enter"&&a[l][1].type==="strikethroughSequenceTemporary"&&a[l][1]._close){let c=l;for(;c--;)if(a[c][0]==="exit"&&a[c][1].type==="strikethroughSequenceTemporary"&&a[c][1]._open&&a[l][1].end.offset-a[l][1].start.offset===a[c][1].end.offset-a[c][1].start.offset){a[l][1].type="strikethroughSequence",a[c][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},a[c][1].start),end:Object.assign({},a[l][1].end)},u={type:"strikethroughText",start:Object.assign({},a[c][1].end),end:Object.assign({},a[l][1].start)},p=[["enter",d,s],["enter",a[c][1],s],["exit",a[c][1],s],["enter",u,s]],h=s.parser.constructs.insideSpan.null;h&&ht(p,p.length,0,Do(h,a.slice(c+1,l),s)),ht(p,p.length,0,[["exit",u,s],["enter",a[l][1],s],["exit",a[l][1],s],["exit",d,s]]),ht(a,c-1,l-c+3,p),l=c+p.length-2;break}}for(l=-1;++l<a.length;)a[l][1].type==="strikethroughSequenceTemporary"&&(a[l][1].type="data");return a}function i(a,s,l){const c=this.previous,d=this.events;let u=0;return p;function p(v){return c===126&&d[d.length-1][1].type!=="characterEscape"?l(v):(a.enter("strikethroughSequenceTemporary"),h(v))}function h(v){const g=Gn(c);if(v===126)return u>1?l(v):(a.consume(v),u++,h);if(u<2&&!n)return l(v);const b=a.exit("strikethroughSequenceTemporary"),x=Gn(v);return b._open=!x||x===2&&!!g,b._close=!g||g===2&&!!x,s(v)}}}class Ak{constructor(){this.map=[]}add(t,n,r){Rk(this,t,n,r)}consume(t){if(this.map.sort(function(i,a){return i[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let o=r.pop();for(;o;){for(const i of o)t.push(i);o=r.pop()}this.map.length=0}}function Rk(e,t,n,r){let o=0;if(!(n===0&&r.length===0)){for(;o<e.map.length;){if(e.map[o][0]===t){e.map[o][1]+=n,e.map[o][2].push(...r);return}o+=1}e.map.push([t,n,r])}}function jk(e,t){let n=!1;const r=[];for(;t<e.length;){const o=e[t];if(n){if(o[0]==="enter")o[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const i=r.length-1;r[i]=r[i]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function Ok(){return{flow:{null:{name:"table",tokenize:Mk,resolveAll:Dk}}}}function Mk(e,t,n){const r=this;let o=0,i=0,a;return s;function s(E){let N=r.events.length-1;for(;N>-1;){const $=r.events[N][1].type;if($==="lineEnding"||$==="linePrefix")N--;else break}const A=N>-1?r.events[N][1].type:null,j=A==="tableHead"||A==="tableRow"?C:l;return j===C&&r.parser.lazy[r.now().line]?n(E):j(E)}function l(E){return e.enter("tableHead"),e.enter("tableRow"),c(E)}function c(E){return E===124||(a=!0,i+=1),d(E)}function d(E){return E===null?n(E):ne(E)?i>1?(i=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),h):n(E):he(E)?ve(e,d,"whitespace")(E):(i+=1,a&&(a=!1,o+=1),E===124?(e.enter("tableCellDivider"),e.consume(E),e.exit("tableCellDivider"),a=!0,d):(e.enter("data"),u(E)))}function u(E){return E===null||E===124||Se(E)?(e.exit("data"),d(E)):(e.consume(E),E===92?p:u)}function p(E){return E===92||E===124?(e.consume(E),u):u(E)}function h(E){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(E):(e.enter("tableDelimiterRow"),a=!1,he(E)?ve(e,v,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(E):v(E))}function v(E){return E===45||E===58?b(E):E===124?(a=!0,e.enter("tableCellDivider"),e.consume(E),e.exit("tableCellDivider"),g):P(E)}function g(E){return he(E)?ve(e,b,"whitespace")(E):b(E)}function b(E){return E===58?(i+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(E),e.exit("tableDelimiterMarker"),x):E===45?(i+=1,x(E)):E===null||ne(E)?S(E):P(E)}function x(E){return E===45?(e.enter("tableDelimiterFiller"),y(E)):P(E)}function y(E){return E===45?(e.consume(E),y):E===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(E),e.exit("tableDelimiterMarker"),w):(e.exit("tableDelimiterFiller"),w(E))}function w(E){return he(E)?ve(e,S,"whitespace")(E):S(E)}function S(E){return E===124?v(E):E===null||ne(E)?!a||o!==i?P(E):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(E)):P(E)}function P(E){return n(E)}function C(E){return e.enter("tableRow"),T(E)}function T(E){return E===124?(e.enter("tableCellDivider"),e.consume(E),e.exit("tableCellDivider"),T):E===null||ne(E)?(e.exit("tableRow"),t(E)):he(E)?ve(e,T,"whitespace")(E):(e.enter("data"),I(E))}function I(E){return E===null||E===124||Se(E)?(e.exit("data"),T(E)):(e.consume(E),E===92?R:I)}function R(E){return E===92||E===124?(e.consume(E),I):I(E)}}function Dk(e,t){let n=-1,r=!0,o=0,i=[0,0,0,0],a=[0,0,0,0],s=!1,l=0,c,d,u;const p=new Ak;for(;++n<e.length;){const h=e[n],v=h[1];h[0]==="enter"?v.type==="tableHead"?(s=!1,l!==0&&(Yl(p,t,l,c,d),d=void 0,l=0),c={type:"table",start:Object.assign({},v.start),end:Object.assign({},v.end)},p.add(n,0,[["enter",c,t]])):v.type==="tableRow"||v.type==="tableDelimiterRow"?(r=!0,u=void 0,i=[0,0,0,0],a=[0,n+1,0,0],s&&(s=!1,d={type:"tableBody",start:Object.assign({},v.start),end:Object.assign({},v.end)},p.add(n,0,[["enter",d,t]])),o=v.type==="tableDelimiterRow"?2:d?3:1):o&&(v.type==="data"||v.type==="tableDelimiterMarker"||v.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(i[1]!==0&&(a[0]=a[1],u=Yr(p,t,i,o,void 0,u),i=[0,0,0,0]),a[2]=n)):v.type==="tableCellDivider"&&(r?r=!1:(i[1]!==0&&(a[0]=a[1],u=Yr(p,t,i,o,void 0,u)),i=a,a=[i[1],n,0,0])):v.type==="tableHead"?(s=!0,l=n):v.type==="tableRow"||v.type==="tableDelimiterRow"?(l=n,i[1]!==0?(a[0]=a[1],u=Yr(p,t,i,o,n,u)):a[1]!==0&&(u=Yr(p,t,a,o,n,u)),o=0):o&&(v.type==="data"||v.type==="tableDelimiterMarker"||v.type==="tableDelimiterFiller")&&(a[3]=n)}for(l!==0&&Yl(p,t,l,c,d),p.consume(t.events),n=-1;++n<t.events.length;){const h=t.events[n];h[0]==="enter"&&h[1].type==="table"&&(h[1]._align=jk(t.events,n))}return e}function Yr(e,t,n,r,o,i){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",s="tableContent";n[0]!==0&&(i.end=Object.assign({},zn(t.events,n[0])),e.add(n[0],0,[["exit",i,t]]));const l=zn(t.events,n[1]);if(i={type:a,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",i,t]]),n[2]!==0){const c=zn(t.events,n[2]),d=zn(t.events,n[3]),u={type:s,start:Object.assign({},c),end:Object.assign({},d)};if(e.add(n[2],0,[["enter",u,t]]),r!==2){const p=t.events[n[2]],h=t.events[n[3]];if(p[1].end=Object.assign({},h[1].end),p[1].type="chunkText",p[1].contentType="text",n[3]>n[2]+1){const v=n[2]+1,g=n[3]-n[2]-1;e.add(v,g,[])}}e.add(n[3]+1,0,[["exit",u,t]])}return o!==void 0&&(i.end=Object.assign({},zn(t.events,o)),e.add(o,0,[["exit",i,t]]),i=void 0),i}function Yl(e,t,n,r,o){const i=[],a=zn(t.events,n);o&&(o.end=Object.assign({},a),i.push(["exit",o,t])),r.end=Object.assign({},a),i.push(["exit",r,t]),e.add(n+1,0,i)}function zn(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const $k={name:"tasklistCheck",tokenize:Lk};function zk(){return{text:{91:$k}}}function Lk(e,t,n){const r=this;return o;function o(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),i)}function i(l){return Se(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),a):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),a):n(l)}function a(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),s):n(l)}function s(l){return ne(l)?t(l):he(l)?e.check({tokenize:Fk},t,n)(l):n(l)}}function Fk(e,t,n){return ve(e,r,"whitespace");function r(o){return o===null?n(o):t(o)}}function Bk(e){return bu([fk(),kk(),Ik(e),Ok(),zk()])}const Vk={};function ud(e){const t=this,n=e||Vk,r=t.data(),o=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);o.push(Bk(n)),i.push(lk()),a.push(ck(n))}function Uk(e){return(e.result??e.partialResult)?.content?.find(r=>r?.type==="text")?.text??""}function Zk({execution:e,expanded:t,onToggleExpand:n}){const r=Uk(e),o=String(e.args?.command??"");return f.jsxs(Mt,{className:"bg-zinc-950 border-zinc-800 text-zinc-100",children:[f.jsx(Dt,{className:"py-2 px-3",children:f.jsxs("div",{className:"flex items-center justify-between gap-2",children:[f.jsxs("div",{className:"flex items-center gap-2 min-w-0 font-mono text-xs",children:[f.jsx(uv,{className:"h-3.5 w-3.5 text-emerald-400 shrink-0"}),f.jsx("span",{className:"text-zinc-500",children:"$"}),f.jsx("span",{className:"truncate",children:o}),e.status==="running"&&f.jsx(ou,{className:"h-3 w-3 animate-spin text-zinc-500"})]}),f.jsx(Et,{variant:"ghost",size:"sm",onClick:n,children:t?"Hide":"Show"})]})}),t&&f.jsx(Zt,{className:"py-2 px-3",children:f.jsx("pre",{className:"text-xs whitespace-pre-wrap overflow-x-auto",children:r||"(no output)"})})]})}function Hk({execution:e,expanded:t,onToggleExpand:n}){const o=e.result?.details?.diff??"",i=String(e.args?.path??"");return f.jsxs(Mt,{children:[f.jsx(Dt,{className:"py-2 px-3",children:f.jsxs("div",{className:"flex items-center justify-between gap-2",children:[f.jsxs("div",{className:"flex items-center gap-2 min-w-0 text-xs",children:[f.jsx(Gg,{className:"h-3.5 w-3.5 shrink-0 text-amber-500"}),f.jsxs("span",{className:"font-mono truncate",children:["edit ",i]})]}),f.jsx(Et,{variant:"ghost",size:"sm",onClick:n,children:t?"Hide":"Show"})]})}),t&&f.jsx(Zt,{className:"py-2 px-3",children:f.jsx("pre",{className:"text-xs whitespace-pre-wrap overflow-x-auto",children:o||"Edit applied"})})]})}function Gk(e){return(e.result??e.partialResult)?.content?.find(r=>r?.type==="text")?.text??""}function Wk({execution:e,expanded:t,onToggleExpand:n}){const r=Gk(e),o=String(e.args?.pattern??"*");return f.jsxs(Mt,{children:[f.jsx(Dt,{className:"py-2 px-3",children:f.jsxs("div",{className:"flex items-center justify-between gap-2 text-xs",children:[f.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[f.jsx(nv,{className:"h-3.5 w-3.5 text-cyan-500"}),f.jsxs("span",{className:"font-mono truncate",children:["find ",o]})]}),f.jsx(Et,{variant:"ghost",size:"sm",onClick:n,children:t?"Hide":"Show"})]})}),t&&f.jsx(Zt,{className:"py-2 px-3",children:f.jsx("pre",{className:"text-xs whitespace-pre-wrap overflow-x-auto",children:r||"(no files)"})})]})}function M(e,t,n){function r(s,l){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:l,constr:a,traits:new Set},enumerable:!1}),s._zod.traits.has(e))return;s._zod.traits.add(e),t(s,l);const c=a.prototype,d=Object.keys(c);for(let u=0;u<d.length;u++){const p=d[u];p in s||(s[p]=c[p].bind(s))}}const o=n?.Parent??Object;class i extends o{}Object.defineProperty(i,"name",{value:e});function a(s){var l;const c=n?.Parent?new i:this;r(c,s),(l=c._zod).deferred??(l.deferred=[]);for(const d of c._zod.deferred)d();return c}return Object.defineProperty(a,"init",{value:r}),Object.defineProperty(a,Symbol.hasInstance,{value:s=>n?.Parent&&s instanceof n.Parent?!0:s?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}class Zn extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class dd extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const fd={};function Yt(e){return fd}function pd(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,o])=>t.indexOf(+r)===-1).map(([r,o])=>o)}function da(e,t){return typeof t=="bigint"?t.toString():t}function ts(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function ns(e){return e==null}function rs(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function qk(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let o=(r.split(".")[1]||"").length;if(o===0&&/\d?e-\d?/.test(r)){const l=r.match(/\d?e-(\d?)/);l?.[1]&&(o=Number.parseInt(l[1]))}const i=n>o?n:o,a=Number.parseInt(e.toFixed(i).replace(".","")),s=Number.parseInt(t.toFixed(i).replace(".",""));return a%s/10**i}const Xl=Symbol("evaluating");function xe(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Xl)return r===void 0&&(r=Xl,r=n()),r},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function _n(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function tn(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function Ql(e){return JSON.stringify(e)}function Kk(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const hd="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function wo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Jk=ts(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Wn(e){if(wo(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(wo(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function md(e){return Wn(e)?{...e}:Array.isArray(e)?[...e]:e}const Yk=new Set(["string","number","symbol"]);function qn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function nn(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function ee(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Xk(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const Qk={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function eS(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const i=tn(e._zod.def,{get shape(){const a={};for(const s in t){if(!(s in n.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&(a[s]=n.shape[s])}return _n(this,"shape",a),a},checks:[]});return nn(e,i)}function tS(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const i=tn(e._zod.def,{get shape(){const a={...e._zod.def.shape};for(const s in t){if(!(s in n.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&delete a[s]}return _n(this,"shape",a),a},checks:[]});return nn(e,i)}function nS(e,t){if(!Wn(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const i=e._zod.def.shape;for(const a in t)if(Object.getOwnPropertyDescriptor(i,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=tn(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t};return _n(this,"shape",i),i}});return nn(e,o)}function rS(e,t){if(!Wn(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=tn(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return _n(this,"shape",r),r}});return nn(e,n)}function oS(e,t){const n=tn(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return _n(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return nn(e,n)}function iS(e,t,n){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const a=tn(t._zod.def,{get shape(){const s=t._zod.def.shape,l={...s};if(n)for(const c in n){if(!(c in s))throw new Error(`Unrecognized key: "${c}"`);n[c]&&(l[c]=e?new e({type:"optional",innerType:s[c]}):s[c])}else for(const c in s)l[c]=e?new e({type:"optional",innerType:s[c]}):s[c];return _n(this,"shape",l),l},checks:[]});return nn(t,a)}function aS(e,t,n){const r=tn(t._zod.def,{get shape(){const o=t._zod.def.shape,i={...o};if(n)for(const a in n){if(!(a in i))throw new Error(`Unrecognized key: "${a}"`);n[a]&&(i[a]=new e({type:"nonoptional",innerType:o[a]}))}else for(const a in o)i[a]=new e({type:"nonoptional",innerType:o[a]});return _n(this,"shape",i),i}});return nn(t,r)}function Fn(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Bn(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function Xr(e){return typeof e=="string"?e:e?.message}function Xt(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const o=Xr(e.inst?._zod.def?.error?.(e))??Xr(t?.error?.(e))??Xr(n.customError?.(e))??Xr(n.localeError?.(e))??"Invalid input";r.message=o}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function os(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function kr(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const gd=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,da,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},vd=M("$ZodError",gd),xd=M("$ZodError",gd,{Parent:Error});function sS(e,t=n=>n.message){const n={},r=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}function lS(e,t=n=>n.message){const n={_errors:[]},r=o=>{for(const i of o.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(a=>r({issues:a}));else if(i.code==="invalid_key")r({issues:i.issues});else if(i.code==="invalid_element")r({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let a=n,s=0;for(;s<i.path.length;){const l=i.path[s];s===i.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(t(i))):a[l]=a[l]||{_errors:[]},a=a[l],s++}}};return r(e),n}const is=e=>(t,n,r,o)=>{const i=r?Object.assign(r,{async:!1}):{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new Zn;if(a.issues.length){const s=new(o?.Err??e)(a.issues.map(l=>Xt(l,i,Yt())));throw hd(s,o?.callee),s}return a.value},as=e=>async(t,n,r,o)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise&&(a=await a),a.issues.length){const s=new(o?.Err??e)(a.issues.map(l=>Xt(l,i,Yt())));throw hd(s,o?.callee),s}return a.value},Fo=e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},o);if(i instanceof Promise)throw new Zn;return i.issues.length?{success:!1,error:new(e??vd)(i.issues.map(a=>Xt(a,o,Yt())))}:{success:!0,data:i.value}},cS=Fo(xd),Bo=e=>async(t,n,r)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(a=>Xt(a,o,Yt())))}:{success:!0,data:i.value}},uS=Bo(xd),dS=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return is(e)(t,n,o)},fS=e=>(t,n,r)=>is(e)(t,n,r),pS=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return as(e)(t,n,o)},hS=e=>async(t,n,r)=>as(e)(t,n,r),mS=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Fo(e)(t,n,o)},gS=e=>(t,n,r)=>Fo(e)(t,n,r),vS=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Bo(e)(t,n,o)},xS=e=>async(t,n,r)=>Bo(e)(t,n,r),bS=/^[cC][^\s-]{8,}$/,yS=/^[0-9a-z]+$/,wS=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,kS=/^[0-9a-vA-V]{20}$/,SS=/^[A-Za-z0-9]{27}$/,CS=/^[a-zA-Z0-9_-]{21}$/,_S=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ES=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,ec=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,TS=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,PS="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function NS(){return new RegExp(PS,"u")}const IS=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,AS=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,RS=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,jS=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,OS=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,bd=/^[A-Za-z0-9_-]*$/,MS=/^\+[1-9]\d{6,14}$/,yd="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",DS=new RegExp(`^${yd}$`);function wd(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function $S(e){return new RegExp(`^${wd(e)}$`)}function zS(e){const t=wd({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${yd}T(?:${r})$`)}const LS=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},FS=/^-?\d+$/,kd=/^-?\d+(?:\.\d+)?$/,BS=/^(?:true|false)$/i,VS=/^null$/i,US=/^[^A-Z]*$/,ZS=/^[^a-z]*$/,lt=M("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Sd={number:"number",bigint:"bigint",object:"date"},Cd=M("$ZodCheckLessThan",(e,t)=>{lt.init(e,t);const n=Sd[typeof t.value];e._zod.onattach.push(r=>{const o=r._zod.bag,i=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),_d=M("$ZodCheckGreaterThan",(e,t)=>{lt.init(e,t);const n=Sd[typeof t.value];e._zod.onattach.push(r=>{const o=r._zod.bag,i=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),HS=M("$ZodCheckMultipleOf",(e,t)=>{lt.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):qk(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),GS=M("$ZodCheckNumberFormat",(e,t)=>{lt.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[o,i]=Qk[t.format];e._zod.onattach.push(a=>{const s=a._zod.bag;s.format=t.format,s.minimum=o,s.maximum=i,n&&(s.pattern=FS)}),e._zod.check=a=>{const s=a.value;if(n){if(!Number.isInteger(s)){a.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<o&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),s>i&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),WS=M("$ZodCheckMaxLength",(e,t)=>{var n;lt.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!ns(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const o=r.value;if(o.length<=t.maximum)return;const a=os(o);r.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),qS=M("$ZodCheckMinLength",(e,t)=>{var n;lt.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!ns(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const o=r.value;if(o.length>=t.minimum)return;const a=os(o);r.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),KS=M("$ZodCheckLengthEquals",(e,t)=>{var n;lt.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!ns(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=r=>{const o=r.value,i=o.length;if(i===t.length)return;const a=os(o),s=i>t.length;r.issues.push({origin:a,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Vo=M("$ZodCheckStringFormat",(e,t)=>{var n,r;lt.init(e,t),e._zod.onattach.push(o=>{const i=o._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),JS=M("$ZodCheckRegex",(e,t)=>{Vo.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),YS=M("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=US),Vo.init(e,t)}),XS=M("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=ZS),Vo.init(e,t)}),QS=M("$ZodCheckIncludes",(e,t)=>{lt.init(e,t);const n=qn(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(o=>{const i=o._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),eC=M("$ZodCheckStartsWith",(e,t)=>{lt.init(e,t);const n=new RegExp(`^${qn(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),tC=M("$ZodCheckEndsWith",(e,t)=>{lt.init(e,t);const n=new RegExp(`.*${qn(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),nC=M("$ZodCheckOverwrite",(e,t)=>{lt.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class rC{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
31
+ `).filter(a=>a),o=Math.min(...r.map(a=>a.length-a.trimStart().length)),i=r.map(a=>a.slice(o)).map(a=>" ".repeat(this.indent*2)+a);for(const a of i)this.content.push(a)}compile(){const t=Function,n=this?.args,o=[...(this?.content??[""]).map(i=>` ${i}`)];return new t(...n,o.join(`
32
+ `))}}const oC={major:4,minor:3,patch:6},_e=M("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=oC;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const o of r)for(const i of o._zod.onattach)i(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const o=(a,s,l)=>{let c=Fn(a),d;for(const u of s){if(u._zod.def.when){if(!u._zod.def.when(a))continue}else if(c)continue;const p=a.issues.length,h=u._zod.check(a);if(h instanceof Promise&&l?.async===!1)throw new Zn;if(d||h instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await h,a.issues.length!==p&&(c||(c=Fn(a,p)))});else{if(a.issues.length===p)continue;c||(c=Fn(a,p))}}return d?d.then(()=>a):a},i=(a,s,l)=>{if(Fn(a))return a.aborted=!0,a;const c=o(s,r,l);if(c instanceof Promise){if(l.async===!1)throw new Zn;return c.then(d=>e._zod.parse(d,l))}return e._zod.parse(c,l)};e._zod.run=(a,s)=>{if(s.skipChecks)return e._zod.parse(a,s);if(s.direction==="backward"){const c=e._zod.parse({value:a.value,issues:[]},{...s,skipChecks:!0});return c instanceof Promise?c.then(d=>i(d,a,s)):i(c,a,s)}const l=e._zod.parse(a,s);if(l instanceof Promise){if(s.async===!1)throw new Zn;return l.then(c=>o(c,r,s))}return o(l,r,s)}}xe(e,"~standard",()=>({validate:o=>{try{const i=cS(e,o);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return uS(e,o).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),ss=M("$ZodString",(e,t)=>{_e.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??LS(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),Ne=M("$ZodStringFormat",(e,t)=>{Vo.init(e,t),ss.init(e,t)}),iC=M("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=ES),Ne.init(e,t)}),aC=M("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=ec(r))}else t.pattern??(t.pattern=ec());Ne.init(e,t)}),sC=M("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=TS),Ne.init(e,t)}),lC=M("$ZodURL",(e,t)=>{Ne.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),o=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=o.href:n.value=r;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),cC=M("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=NS()),Ne.init(e,t)}),uC=M("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=CS),Ne.init(e,t)}),dC=M("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=bS),Ne.init(e,t)}),fC=M("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=yS),Ne.init(e,t)}),pC=M("$ZodULID",(e,t)=>{t.pattern??(t.pattern=wS),Ne.init(e,t)}),hC=M("$ZodXID",(e,t)=>{t.pattern??(t.pattern=kS),Ne.init(e,t)}),mC=M("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=SS),Ne.init(e,t)}),gC=M("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=zS(t)),Ne.init(e,t)}),vC=M("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=DS),Ne.init(e,t)}),xC=M("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=$S(t)),Ne.init(e,t)}),bC=M("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=_S),Ne.init(e,t)}),yC=M("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=IS),Ne.init(e,t),e._zod.bag.format="ipv4"}),wC=M("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=AS),Ne.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),kC=M("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=RS),Ne.init(e,t)}),SC=M("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=jS),Ne.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[o,i]=r;if(!i)throw new Error;const a=Number(i);if(`${a}`!==i)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${o}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function Ed(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const CC=M("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=OS),Ne.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{Ed(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function _C(e){if(!bd.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return Ed(n)}const EC=M("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=bd),Ne.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{_C(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),TC=M("$ZodE164",(e,t)=>{t.pattern??(t.pattern=MS),Ne.init(e,t)});function PC(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const o=JSON.parse(atob(r));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const NC=M("$ZodJWT",(e,t)=>{Ne.init(e,t),e._zod.check=n=>{PC(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Td=M("$ZodNumber",(e,t)=>{_e.init(e,t),e._zod.pattern=e._zod.bag.pattern??kd,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const o=n.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return n;const i=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),n}}),IC=M("$ZodNumberFormat",(e,t)=>{GS.init(e,t),Td.init(e,t)}),AC=M("$ZodBoolean",(e,t)=>{_e.init(e,t),e._zod.pattern=BS,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}const o=n.value;return typeof o=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}}),RC=M("$ZodNull",(e,t)=>{_e.init(e,t),e._zod.pattern=VS,e._zod.values=new Set([null]),e._zod.parse=(n,r)=>{const o=n.value;return o===null||n.issues.push({expected:"null",code:"invalid_type",input:o,inst:e}),n}}),jC=M("$ZodAny",(e,t)=>{_e.init(e,t),e._zod.parse=n=>n}),OC=M("$ZodUnknown",(e,t)=>{_e.init(e,t),e._zod.parse=n=>n}),MC=M("$ZodNever",(e,t)=>{_e.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function tc(e,t,n){e.issues.length&&t.issues.push(...Bn(n,e.issues)),t.value[n]=e.value}const DC=M("$ZodArray",(e,t)=>{_e.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const i=[];for(let a=0;a<o.length;a++){const s=o[a],l=t.element._zod.run({value:s,issues:[]},r);l instanceof Promise?i.push(l.then(c=>tc(c,n,a))):tc(l,n,a)}return i.length?Promise.all(i).then(()=>n):n}});function ko(e,t,n,r,o){if(e.issues.length){if(o&&!(n in r))return;t.issues.push(...Bn(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function Pd(e){const t=Object.keys(e.shape);for(const r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);const n=Xk(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Nd(e,t,n,r,o,i){const a=[],s=o.keySet,l=o.catchall._zod,c=l.def.type,d=l.optout==="optional";for(const u in t){if(s.has(u))continue;if(c==="never"){a.push(u);continue}const p=l.run({value:t[u],issues:[]},r);p instanceof Promise?e.push(p.then(h=>ko(h,n,u,t,d))):ko(p,n,u,t,d)}return a.length&&n.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:i}),e.length?Promise.all(e).then(()=>n):n}const $C=M("$ZodObject",(e,t)=>{if(_e.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const s=t.shape;Object.defineProperty(t,"shape",{get:()=>{const l={...s};return Object.defineProperty(t,"shape",{value:l}),l}})}const r=ts(()=>Pd(t));xe(e._zod,"propValues",()=>{const s=t.shape,l={};for(const c in s){const d=s[c]._zod;if(d.values){l[c]??(l[c]=new Set);for(const u of d.values)l[c].add(u)}}return l});const o=wo,i=t.catchall;let a;e._zod.parse=(s,l)=>{a??(a=r.value);const c=s.value;if(!o(c))return s.issues.push({expected:"object",code:"invalid_type",input:c,inst:e}),s;s.value={};const d=[],u=a.shape;for(const p of a.keys){const h=u[p],v=h._zod.optout==="optional",g=h._zod.run({value:c[p],issues:[]},l);g instanceof Promise?d.push(g.then(b=>ko(b,s,p,c,v))):ko(g,s,p,c,v)}return i?Nd(d,c,s,l,r.value,e):d.length?Promise.all(d).then(()=>s):s}}),zC=M("$ZodObjectJIT",(e,t)=>{$C.init(e,t);const n=e._zod.parse,r=ts(()=>Pd(t)),o=p=>{const h=new rC(["shape","payload","ctx"]),v=r.value,g=w=>{const S=Ql(w);return`shape[${S}]._zod.run({ value: input[${S}], issues: [] }, ctx)`};h.write("const input = payload.value;");const b=Object.create(null);let x=0;for(const w of v.keys)b[w]=`key_${x++}`;h.write("const newResult = {};");for(const w of v.keys){const S=b[w],P=Ql(w),T=p[w]?._zod?.optout==="optional";h.write(`const ${S} = ${g(w)};`),T?h.write(`
33
+ if (${S}.issues.length) {
34
+ if (${P} in input) {
35
+ payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
36
+ ...iss,
37
+ path: iss.path ? [${P}, ...iss.path] : [${P}]
38
+ })));
39
+ }
40
+ }
41
+
42
+ if (${S}.value === undefined) {
43
+ if (${P} in input) {
44
+ newResult[${P}] = undefined;
45
+ }
46
+ } else {
47
+ newResult[${P}] = ${S}.value;
48
+ }
49
+
50
+ `):h.write(`
51
+ if (${S}.issues.length) {
52
+ payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
53
+ ...iss,
54
+ path: iss.path ? [${P}, ...iss.path] : [${P}]
55
+ })));
56
+ }
57
+
58
+ if (${S}.value === undefined) {
59
+ if (${P} in input) {
60
+ newResult[${P}] = undefined;
61
+ }
62
+ } else {
63
+ newResult[${P}] = ${S}.value;
64
+ }
65
+
66
+ `)}h.write("payload.value = newResult;"),h.write("return payload;");const y=h.compile();return(w,S)=>y(p,w,S)};let i;const a=wo,s=!fd.jitless,c=s&&Jk.value,d=t.catchall;let u;e._zod.parse=(p,h)=>{u??(u=r.value);const v=p.value;return a(v)?s&&c&&h?.async===!1&&h.jitless!==!0?(i||(i=o(t.shape)),p=i(p,h),d?Nd([],v,p,h,u,e):p):n(p,h):(p.issues.push({expected:"object",code:"invalid_type",input:v,inst:e}),p)}});function nc(e,t,n,r){for(const i of e)if(i.issues.length===0)return t.value=i.value,t;const o=e.filter(i=>!Fn(i));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(i=>i.issues.map(a=>Xt(a,r,Yt())))}),t)}const LC=M("$ZodUnion",(e,t)=>{_e.init(e,t),xe(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),xe(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),xe(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),xe(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${o.map(i=>rs(i.source)).join("|")})$`)}});const n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(o,i)=>{if(n)return r(o,i);let a=!1;const s=[];for(const l of t.options){const c=l._zod.run({value:o.value,issues:[]},i);if(c instanceof Promise)s.push(c),a=!0;else{if(c.issues.length===0)return c;s.push(c)}}return a?Promise.all(s).then(l=>nc(l,o,e,i)):nc(s,o,e,i)}}),FC=M("$ZodIntersection",(e,t)=>{_e.init(e,t),e._zod.parse=(n,r)=>{const o=n.value,i=t.left._zod.run({value:o,issues:[]},r),a=t.right._zod.run({value:o,issues:[]},r);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([l,c])=>rc(n,l,c)):rc(n,i,a)}});function fa(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Wn(e)&&Wn(t)){const n=Object.keys(t),r=Object.keys(e).filter(i=>n.indexOf(i)!==-1),o={...e,...t};for(const i of r){const a=fa(e[i],t[i]);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};o[i]=a.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const o=e[r],i=t[r],a=fa(o,i);if(!a.valid)return{valid:!1,mergeErrorPath:[r,...a.mergeErrorPath]};n.push(a.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function rc(e,t,n){const r=new Map;let o;for(const s of t.issues)if(s.code==="unrecognized_keys"){o??(o=s);for(const l of s.keys)r.has(l)||r.set(l,{}),r.get(l).l=!0}else e.issues.push(s);for(const s of n.issues)if(s.code==="unrecognized_keys")for(const l of s.keys)r.has(l)||r.set(l,{}),r.get(l).r=!0;else e.issues.push(s);const i=[...r].filter(([,s])=>s.l&&s.r).map(([s])=>s);if(i.length&&o&&e.issues.push({...o,keys:i}),Fn(e))return e;const a=fa(t.value,n.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}const BC=M("$ZodRecord",(e,t)=>{_e.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!Wn(o))return n.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),n;const i=[],a=t.keyType._zod.values;if(a){n.value={};const s=new Set;for(const c of a)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){s.add(typeof c=="number"?c.toString():c);const d=t.valueType._zod.run({value:o[c],issues:[]},r);d instanceof Promise?i.push(d.then(u=>{u.issues.length&&n.issues.push(...Bn(c,u.issues)),n.value[c]=u.value})):(d.issues.length&&n.issues.push(...Bn(c,d.issues)),n.value[c]=d.value)}let l;for(const c in o)s.has(c)||(l=l??[],l.push(c));l&&l.length>0&&n.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:l})}else{n.value={};for(const s of Reflect.ownKeys(o)){if(s==="__proto__")continue;let l=t.keyType._zod.run({value:s,issues:[]},r);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof s=="string"&&kd.test(s)&&l.issues.length){const u=t.keyType._zod.run({value:Number(s),issues:[]},r);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");u.issues.length===0&&(l=u)}if(l.issues.length){t.mode==="loose"?n.value[s]=o[s]:n.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(u=>Xt(u,r,Yt())),input:s,path:[s],inst:e});continue}const d=t.valueType._zod.run({value:o[s],issues:[]},r);d instanceof Promise?i.push(d.then(u=>{u.issues.length&&n.issues.push(...Bn(s,u.issues)),n.value[l.value]=u.value})):(d.issues.length&&n.issues.push(...Bn(s,d.issues)),n.value[l.value]=d.value)}}return i.length?Promise.all(i).then(()=>n):n}}),VC=M("$ZodEnum",(e,t)=>{_e.init(e,t);const n=pd(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(o=>Yk.has(typeof o)).map(o=>typeof o=="string"?qn(o):o.toString()).join("|")})$`),e._zod.parse=(o,i)=>{const a=o.value;return r.has(a)||o.issues.push({code:"invalid_value",values:n,input:a,inst:e}),o}}),UC=M("$ZodLiteral",(e,t)=>{if(_e.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?qn(r):r?qn(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,o)=>{const i=r.value;return n.has(i)||r.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),r}}),ZC=M("$ZodTransform",(e,t)=>{_e.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new dd(e.constructor.name);const o=t.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(a=>(n.value=a,n));if(o instanceof Promise)throw new Zn;return n.value=o,n}});function oc(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const Id=M("$ZodOptional",(e,t)=>{_e.init(e,t),e._zod.optin="optional",e._zod.optout="optional",xe(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),xe(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${rs(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>oc(i,n.value)):oc(o,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),HC=M("$ZodExactOptional",(e,t)=>{Id.init(e,t),xe(e._zod,"values",()=>t.innerType._zod.values),xe(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),GC=M("$ZodNullable",(e,t)=>{_e.init(e,t),xe(e._zod,"optin",()=>t.innerType._zod.optin),xe(e._zod,"optout",()=>t.innerType._zod.optout),xe(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${rs(n.source)}|null)$`):void 0}),xe(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),WC=M("$ZodDefault",(e,t)=>{_e.init(e,t),e._zod.optin="optional",xe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>ic(i,t)):ic(o,t)}});function ic(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const qC=M("$ZodPrefault",(e,t)=>{_e.init(e,t),e._zod.optin="optional",xe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),KC=M("$ZodNonOptional",(e,t)=>{_e.init(e,t),xe(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>ac(i,e)):ac(o,e)}});function ac(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const JC=M("$ZodCatch",(e,t)=>{_e.init(e,t),xe(e._zod,"optin",()=>t.innerType._zod.optin),xe(e._zod,"optout",()=>t.innerType._zod.optout),xe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(a=>Xt(a,r,Yt()))},input:n.value}),n.issues=[]),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(i=>Xt(i,r,Yt()))},input:n.value}),n.issues=[]),n)}}),YC=M("$ZodPipe",(e,t)=>{_e.init(e,t),xe(e._zod,"values",()=>t.in._zod.values),xe(e._zod,"optin",()=>t.in._zod.optin),xe(e._zod,"optout",()=>t.out._zod.optout),xe(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const i=t.out._zod.run(n,r);return i instanceof Promise?i.then(a=>Qr(a,t.in,r)):Qr(i,t.in,r)}const o=t.in._zod.run(n,r);return o instanceof Promise?o.then(i=>Qr(i,t.out,r)):Qr(o,t.out,r)}});function Qr(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const XC=M("$ZodReadonly",(e,t)=>{_e.init(e,t),xe(e._zod,"propValues",()=>t.innerType._zod.propValues),xe(e._zod,"values",()=>t.innerType._zod.values),xe(e._zod,"optin",()=>t.innerType?._zod?.optin),xe(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(sc):sc(o)}});function sc(e){return e.value=Object.freeze(e.value),e}const QC=M("$ZodLazy",(e,t)=>{_e.init(e,t),xe(e._zod,"innerType",()=>t.getter()),xe(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),xe(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),xe(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),xe(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(n,r)=>e._zod.innerType._zod.run(n,r)}),e1=M("$ZodCustom",(e,t)=>{lt.init(e,t),_e.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(i=>lc(i,n,r,e));lc(o,n,r,e)}});function lc(e,t,n,r){if(!e){const o={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(o.params=r._zod.def.params),t.issues.push(kr(o))}}var cc;class t1{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const o={...r,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function n1(){return new t1}(cc=globalThis).__zod_globalRegistry??(cc.__zod_globalRegistry=n1());const dr=globalThis.__zod_globalRegistry;function r1(e,t){return new e({type:"string",...ee(t)})}function o1(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ee(t)})}function uc(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ee(t)})}function i1(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ee(t)})}function a1(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ee(t)})}function s1(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ee(t)})}function l1(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ee(t)})}function c1(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ee(t)})}function u1(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ee(t)})}function d1(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ee(t)})}function f1(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ee(t)})}function p1(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ee(t)})}function h1(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ee(t)})}function m1(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ee(t)})}function g1(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ee(t)})}function v1(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ee(t)})}function x1(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ee(t)})}function b1(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ee(t)})}function y1(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ee(t)})}function w1(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ee(t)})}function k1(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ee(t)})}function S1(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ee(t)})}function C1(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ee(t)})}function _1(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ee(t)})}function E1(e,t){return new e({type:"string",format:"date",check:"string_format",...ee(t)})}function T1(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ee(t)})}function P1(e,t){return new e({type:"string",format:"duration",check:"string_format",...ee(t)})}function N1(e,t){return new e({type:"number",checks:[],...ee(t)})}function I1(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ee(t)})}function A1(e,t){return new e({type:"boolean",...ee(t)})}function R1(e,t){return new e({type:"null",...ee(t)})}function j1(e){return new e({type:"any"})}function O1(e){return new e({type:"unknown"})}function M1(e,t){return new e({type:"never",...ee(t)})}function dc(e,t){return new Cd({check:"less_than",...ee(t),value:e,inclusive:!1})}function zi(e,t){return new Cd({check:"less_than",...ee(t),value:e,inclusive:!0})}function fc(e,t){return new _d({check:"greater_than",...ee(t),value:e,inclusive:!1})}function Li(e,t){return new _d({check:"greater_than",...ee(t),value:e,inclusive:!0})}function pc(e,t){return new HS({check:"multiple_of",...ee(t),value:e})}function Ad(e,t){return new WS({check:"max_length",...ee(t),maximum:e})}function So(e,t){return new qS({check:"min_length",...ee(t),minimum:e})}function Rd(e,t){return new KS({check:"length_equals",...ee(t),length:e})}function D1(e,t){return new JS({check:"string_format",format:"regex",...ee(t),pattern:e})}function $1(e){return new YS({check:"string_format",format:"lowercase",...ee(e)})}function z1(e){return new XS({check:"string_format",format:"uppercase",...ee(e)})}function L1(e,t){return new QS({check:"string_format",format:"includes",...ee(t),includes:e})}function F1(e,t){return new eC({check:"string_format",format:"starts_with",...ee(t),prefix:e})}function B1(e,t){return new tC({check:"string_format",format:"ends_with",...ee(t),suffix:e})}function Qn(e){return new nC({check:"overwrite",tx:e})}function V1(e){return Qn(t=>t.normalize(e))}function U1(){return Qn(e=>e.trim())}function Z1(){return Qn(e=>e.toLowerCase())}function H1(){return Qn(e=>e.toUpperCase())}function G1(){return Qn(e=>Kk(e))}function W1(e,t,n){return new e({type:"array",element:t,...ee(n)})}function q1(e,t,n){return new e({type:"custom",check:"custom",fn:t,...ee(n)})}function K1(e){const t=J1(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(kr(r,n.value,t._zod.def));else{const o=r;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),n.issues.push(kr(o))}},e(n.value,n)));return t}function J1(e,t){const n=new lt({check:"custom",...ee(t)});return n._zod.check=e,n}function jd(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??dr,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Oe(e,t,n={path:[],schemaPath:[]}){var r;const o=e._zod.def,i=t.seen.get(e);if(i)return i.count++,n.schemaPath.includes(e)&&(i.cycle=n.path),i.schema;const a={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,a);const s=e._zod.toJSONSchema?.();if(s)a.schema=s;else{const d={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,d);else{const p=a.schema,h=t.processors[o.type];if(!h)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);h(e,t,p,d)}const u=e._zod.parent;u&&(a.ref||(a.ref=u),Oe(u,t,d),t.seen.get(u).isParent=!0)}const l=t.metadataRegistry.get(e);return l&&Object.assign(a.schema,l),t.io==="input"&&tt(e)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&a.schema._prefault&&((r=a.schema).default??(r.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function Od(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const a of e.seen.entries()){const s=e.metadataRegistry.get(a[0])?.id;if(s){const l=r.get(s);if(l&&l!==a[0])throw new Error(`Duplicate schema id "${s}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(s,a[0])}}const o=a=>{const s=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const u=e.external.registry.get(a[0])?.id,p=e.external.uri??(v=>v);if(u)return{ref:p(u)};const h=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=h,{defId:h,ref:`${p("__shared")}#/${s}/${h}`}}if(a[1]===n)return{ref:"#"};const c=`#/${s}/`,d=a[1].schema.id??`__schema${e.counter++}`;return{defId:d,ref:c+d}},i=a=>{if(a[1].schema.$ref)return;const s=a[1],{ref:l,defId:c}=o(a);s.def={...s.schema},c&&(s.defId=c);const d=s.schema;for(const u in d)delete d[u];d.$ref=l};if(e.cycles==="throw")for(const a of e.seen.entries()){const s=a[1];if(s.cycle)throw new Error(`Cycle detected: #/${s.cycle?.join("/")}/<root>
67
+
68
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const a of e.seen.entries()){const s=a[1];if(t===a[0]){i(a);continue}if(e.external){const c=e.external.registry.get(a[0])?.id;if(t!==a[0]&&c){i(a);continue}}if(e.metadataRegistry.get(a[0])?.id){i(a);continue}if(s.cycle){i(a);continue}if(s.count>1&&e.reused==="ref"){i(a);continue}}}function Md(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=a=>{const s=e.seen.get(a);if(s.ref===null)return;const l=s.def??s.schema,c={...l},d=s.ref;if(s.ref=null,d){r(d);const p=e.seen.get(d),h=p.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(h)):Object.assign(l,h),Object.assign(l,c),a._zod.parent===d)for(const g in l)g==="$ref"||g==="allOf"||g in c||delete l[g];if(h.$ref&&p.def)for(const g in l)g==="$ref"||g==="allOf"||g in p.def&&JSON.stringify(l[g])===JSON.stringify(p.def[g])&&delete l[g]}const u=a._zod.parent;if(u&&u!==d){r(u);const p=e.seen.get(u);if(p?.schema.$ref&&(l.$ref=p.schema.$ref,p.def))for(const h in l)h==="$ref"||h==="allOf"||h in p.def&&JSON.stringify(l[h])===JSON.stringify(p.def[h])&&delete l[h]}e.override({zodSchema:a,jsonSchema:l,path:s.path??[]})};for(const a of[...e.seen.entries()].reverse())r(a[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(a)}Object.assign(o,n.def??n.schema);const i=e.external?.defs??{};for(const a of e.seen.entries()){const s=a[1];s.def&&s.defId&&(i[s.defId]=s.def)}e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?o.$defs=i:o.definitions=i);try{const a=JSON.parse(JSON.stringify(o));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:Co(t,"input",e.processors),output:Co(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function tt(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return tt(r.element,n);if(r.type==="set")return tt(r.valueType,n);if(r.type==="lazy")return tt(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return tt(r.innerType,n);if(r.type==="intersection")return tt(r.left,n)||tt(r.right,n);if(r.type==="record"||r.type==="map")return tt(r.keyType,n)||tt(r.valueType,n);if(r.type==="pipe")return tt(r.in,n)||tt(r.out,n);if(r.type==="object"){for(const o in r.shape)if(tt(r.shape[o],n))return!0;return!1}if(r.type==="union"){for(const o of r.options)if(tt(o,n))return!0;return!1}if(r.type==="tuple"){for(const o of r.items)if(tt(o,n))return!0;return!!(r.rest&&tt(r.rest,n))}return!1}const Y1=(e,t={})=>n=>{const r=jd({...n,processors:t});return Oe(e,r),Od(r,e),Md(r,e)},Co=(e,t,n={})=>r=>{const{libraryOptions:o,target:i}=r??{},a=jd({...o??{},target:i,io:t,processors:n});return Oe(e,a),Od(a,e),Md(a,e)},X1={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Q1=(e,t,n,r)=>{const o=n;o.type="string";const{minimum:i,maximum:a,format:s,patterns:l,contentEncoding:c}=e._zod.bag;if(typeof i=="number"&&(o.minLength=i),typeof a=="number"&&(o.maxLength=a),s&&(o.format=X1[s]??s,o.format===""&&delete o.format,s==="time"&&delete o.format),c&&(o.contentEncoding=c),l&&l.size>0){const d=[...l];d.length===1?o.pattern=d[0].source:d.length>1&&(o.allOf=[...d.map(u=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:u.source}))])}},e_=(e,t,n,r)=>{const o=n,{minimum:i,maximum:a,format:s,multipleOf:l,exclusiveMaximum:c,exclusiveMinimum:d}=e._zod.bag;typeof s=="string"&&s.includes("int")?o.type="integer":o.type="number",typeof d=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.minimum=d,o.exclusiveMinimum=!0):o.exclusiveMinimum=d),typeof i=="number"&&(o.minimum=i,typeof d=="number"&&t.target!=="draft-04"&&(d>=i?delete o.minimum:delete o.exclusiveMinimum)),typeof c=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.maximum=c,o.exclusiveMaximum=!0):o.exclusiveMaximum=c),typeof a=="number"&&(o.maximum=a,typeof c=="number"&&t.target!=="draft-04"&&(c<=a?delete o.maximum:delete o.exclusiveMaximum)),typeof l=="number"&&(o.multipleOf=l)},t_=(e,t,n,r)=>{n.type="boolean"},n_=(e,t,n,r)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},r_=(e,t,n,r)=>{n.not={}},o_=(e,t,n,r)=>{},i_=(e,t,n,r)=>{},a_=(e,t,n,r)=>{const o=e._zod.def,i=pd(o.entries);i.every(a=>typeof a=="number")&&(n.type="number"),i.every(a=>typeof a=="string")&&(n.type="string"),n.enum=i},s_=(e,t,n,r)=>{const o=e._zod.def,i=[];for(const a of o.values)if(a===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(a))}else i.push(a);if(i.length!==0)if(i.length===1){const a=i[0];n.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[a]:n.const=a}else i.every(a=>typeof a=="number")&&(n.type="number"),i.every(a=>typeof a=="string")&&(n.type="string"),i.every(a=>typeof a=="boolean")&&(n.type="boolean"),i.every(a=>a===null)&&(n.type="null"),n.enum=i},l_=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},c_=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},u_=(e,t,n,r)=>{const o=n,i=e._zod.def,{minimum:a,maximum:s}=e._zod.bag;typeof a=="number"&&(o.minItems=a),typeof s=="number"&&(o.maxItems=s),o.type="array",o.items=Oe(i.element,t,{...r,path:[...r.path,"items"]})},d_=(e,t,n,r)=>{const o=n,i=e._zod.def;o.type="object",o.properties={};const a=i.shape;for(const c in a)o.properties[c]=Oe(a[c],t,{...r,path:[...r.path,"properties",c]});const s=new Set(Object.keys(a)),l=new Set([...s].filter(c=>{const d=i.shape[c]._zod;return t.io==="input"?d.optin===void 0:d.optout===void 0}));l.size>0&&(o.required=Array.from(l)),i.catchall?._zod.def.type==="never"?o.additionalProperties=!1:i.catchall?i.catchall&&(o.additionalProperties=Oe(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},f_=(e,t,n,r)=>{const o=e._zod.def,i=o.inclusive===!1,a=o.options.map((s,l)=>Oe(s,t,{...r,path:[...r.path,i?"oneOf":"anyOf",l]}));i?n.oneOf=a:n.anyOf=a},p_=(e,t,n,r)=>{const o=e._zod.def,i=Oe(o.left,t,{...r,path:[...r.path,"allOf",0]}),a=Oe(o.right,t,{...r,path:[...r.path,"allOf",1]}),s=c=>"allOf"in c&&Object.keys(c).length===1,l=[...s(i)?i.allOf:[i],...s(a)?a.allOf:[a]];n.allOf=l},h_=(e,t,n,r)=>{const o=n,i=e._zod.def;o.type="object";const a=i.keyType,l=a._zod.bag?.patterns;if(i.mode==="loose"&&l&&l.size>0){const d=Oe(i.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});o.patternProperties={};for(const u of l)o.patternProperties[u.source]=d}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(o.propertyNames=Oe(i.keyType,t,{...r,path:[...r.path,"propertyNames"]})),o.additionalProperties=Oe(i.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const c=a._zod.values;if(c){const d=[...c].filter(u=>typeof u=="string"||typeof u=="number");d.length>0&&(o.required=d)}},m_=(e,t,n,r)=>{const o=e._zod.def,i=Oe(o.innerType,t,r),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=o.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]},g_=(e,t,n,r)=>{const o=e._zod.def;Oe(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType},v_=(e,t,n,r)=>{const o=e._zod.def;Oe(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))},x_=(e,t,n,r)=>{const o=e._zod.def;Oe(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},b_=(e,t,n,r)=>{const o=e._zod.def;Oe(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType;let a;try{a=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=a},y_=(e,t,n,r)=>{const o=e._zod.def,i=t.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;Oe(i,t,r);const a=t.seen.get(e);a.ref=i},w_=(e,t,n,r)=>{const o=e._zod.def;Oe(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType,n.readOnly=!0},Dd=(e,t,n,r)=>{const o=e._zod.def;Oe(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType},k_=(e,t,n,r)=>{const o=e._zod.innerType;Oe(o,t,r);const i=t.seen.get(e);i.ref=o},S_=M("ZodISODateTime",(e,t)=>{gC.init(e,t),je.init(e,t)});function C_(e){return _1(S_,e)}const __=M("ZodISODate",(e,t)=>{vC.init(e,t),je.init(e,t)});function E_(e){return E1(__,e)}const T_=M("ZodISOTime",(e,t)=>{xC.init(e,t),je.init(e,t)});function P_(e){return T1(T_,e)}const N_=M("ZodISODuration",(e,t)=>{bC.init(e,t),je.init(e,t)});function I_(e){return P1(N_,e)}const A_=(e,t)=>{vd.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>lS(e,n)},flatten:{value:n=>sS(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,da,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,da,2)}},isEmpty:{get(){return e.issues.length===0}}})},xt=M("ZodError",A_,{Parent:Error}),R_=is(xt),j_=as(xt),O_=Fo(xt),M_=Bo(xt),D_=dS(xt),$_=fS(xt),z_=pS(xt),L_=hS(xt),F_=mS(xt),B_=gS(xt),V_=vS(xt),U_=xS(xt),Ee=M("ZodType",(e,t)=>(_e.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Co(e,"input"),output:Co(e,"output")}}),e.toJSONSchema=Y1(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(tn(t,{checks:[...t.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),e.with=e.check,e.clone=(n,r)=>nn(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>R_(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>O_(e,n,r),e.parseAsync=async(n,r)=>j_(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>M_(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>D_(e,n,r),e.decode=(n,r)=>$_(e,n,r),e.encodeAsync=async(n,r)=>z_(e,n,r),e.decodeAsync=async(n,r)=>L_(e,n,r),e.safeEncode=(n,r)=>F_(e,n,r),e.safeDecode=(n,r)=>B_(e,n,r),e.safeEncodeAsync=async(n,r)=>V_(e,n,r),e.safeDecodeAsync=async(n,r)=>U_(e,n,r),e.refine=(n,r)=>e.check(VE(n,r)),e.superRefine=n=>e.check(UE(n)),e.overwrite=n=>e.check(Qn(n)),e.optional=()=>gc(e),e.exactOptional=()=>TE(e),e.nullable=()=>vc(e),e.nullish=()=>gc(vc(e)),e.nonoptional=n=>jE(e,n),e.array=()=>Ue(e),e.or=n=>Lt([e,n]),e.and=n=>wE(e,n),e.transform=n=>xc(e,_E(n)),e.default=n=>IE(e,n),e.prefault=n=>RE(e,n),e.catch=n=>ME(e,n),e.pipe=n=>xc(e,n),e.readonly=()=>zE(e),e.describe=n=>{const r=e.clone();return dr.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return dr.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return dr.get(e);const r=e.clone();return dr.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),$d=M("_ZodString",(e,t)=>{ss.init(e,t),Ee.init(e,t),e._zod.processJSONSchema=(r,o,i)=>Q1(e,r,o);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...r)=>e.check(D1(...r)),e.includes=(...r)=>e.check(L1(...r)),e.startsWith=(...r)=>e.check(F1(...r)),e.endsWith=(...r)=>e.check(B1(...r)),e.min=(...r)=>e.check(So(...r)),e.max=(...r)=>e.check(Ad(...r)),e.length=(...r)=>e.check(Rd(...r)),e.nonempty=(...r)=>e.check(So(1,...r)),e.lowercase=r=>e.check($1(r)),e.uppercase=r=>e.check(z1(r)),e.trim=()=>e.check(U1()),e.normalize=(...r)=>e.check(V1(...r)),e.toLowerCase=()=>e.check(Z1()),e.toUpperCase=()=>e.check(H1()),e.slugify=()=>e.check(G1())}),Z_=M("ZodString",(e,t)=>{ss.init(e,t),$d.init(e,t),e.email=n=>e.check(o1(H_,n)),e.url=n=>e.check(c1(G_,n)),e.jwt=n=>e.check(C1(sE,n)),e.emoji=n=>e.check(u1(W_,n)),e.guid=n=>e.check(uc(hc,n)),e.uuid=n=>e.check(i1(eo,n)),e.uuidv4=n=>e.check(a1(eo,n)),e.uuidv6=n=>e.check(s1(eo,n)),e.uuidv7=n=>e.check(l1(eo,n)),e.nanoid=n=>e.check(d1(q_,n)),e.guid=n=>e.check(uc(hc,n)),e.cuid=n=>e.check(f1(K_,n)),e.cuid2=n=>e.check(p1(J_,n)),e.ulid=n=>e.check(h1(Y_,n)),e.base64=n=>e.check(w1(oE,n)),e.base64url=n=>e.check(k1(iE,n)),e.xid=n=>e.check(m1(X_,n)),e.ksuid=n=>e.check(g1(Q_,n)),e.ipv4=n=>e.check(v1(eE,n)),e.ipv6=n=>e.check(x1(tE,n)),e.cidrv4=n=>e.check(b1(nE,n)),e.cidrv6=n=>e.check(y1(rE,n)),e.e164=n=>e.check(S1(aE,n)),e.datetime=n=>e.check(C_(n)),e.date=n=>e.check(E_(n)),e.time=n=>e.check(P_(n)),e.duration=n=>e.check(I_(n))});function z(e){return r1(Z_,e)}const je=M("ZodStringFormat",(e,t)=>{Ne.init(e,t),$d.init(e,t)}),H_=M("ZodEmail",(e,t)=>{sC.init(e,t),je.init(e,t)}),hc=M("ZodGUID",(e,t)=>{iC.init(e,t),je.init(e,t)}),eo=M("ZodUUID",(e,t)=>{aC.init(e,t),je.init(e,t)}),G_=M("ZodURL",(e,t)=>{lC.init(e,t),je.init(e,t)}),W_=M("ZodEmoji",(e,t)=>{cC.init(e,t),je.init(e,t)}),q_=M("ZodNanoID",(e,t)=>{uC.init(e,t),je.init(e,t)}),K_=M("ZodCUID",(e,t)=>{dC.init(e,t),je.init(e,t)}),J_=M("ZodCUID2",(e,t)=>{fC.init(e,t),je.init(e,t)}),Y_=M("ZodULID",(e,t)=>{pC.init(e,t),je.init(e,t)}),X_=M("ZodXID",(e,t)=>{hC.init(e,t),je.init(e,t)}),Q_=M("ZodKSUID",(e,t)=>{mC.init(e,t),je.init(e,t)}),eE=M("ZodIPv4",(e,t)=>{yC.init(e,t),je.init(e,t)}),tE=M("ZodIPv6",(e,t)=>{wC.init(e,t),je.init(e,t)}),nE=M("ZodCIDRv4",(e,t)=>{kC.init(e,t),je.init(e,t)}),rE=M("ZodCIDRv6",(e,t)=>{SC.init(e,t),je.init(e,t)}),oE=M("ZodBase64",(e,t)=>{CC.init(e,t),je.init(e,t)}),iE=M("ZodBase64URL",(e,t)=>{EC.init(e,t),je.init(e,t)}),aE=M("ZodE164",(e,t)=>{TC.init(e,t),je.init(e,t)}),sE=M("ZodJWT",(e,t)=>{NC.init(e,t),je.init(e,t)}),zd=M("ZodNumber",(e,t)=>{Td.init(e,t),Ee.init(e,t),e._zod.processJSONSchema=(r,o,i)=>e_(e,r,o),e.gt=(r,o)=>e.check(fc(r,o)),e.gte=(r,o)=>e.check(Li(r,o)),e.min=(r,o)=>e.check(Li(r,o)),e.lt=(r,o)=>e.check(dc(r,o)),e.lte=(r,o)=>e.check(zi(r,o)),e.max=(r,o)=>e.check(zi(r,o)),e.int=r=>e.check(mc(r)),e.safe=r=>e.check(mc(r)),e.positive=r=>e.check(fc(0,r)),e.nonnegative=r=>e.check(Li(0,r)),e.negative=r=>e.check(dc(0,r)),e.nonpositive=r=>e.check(zi(0,r)),e.multipleOf=(r,o)=>e.check(pc(r,o)),e.step=(r,o)=>e.check(pc(r,o)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Ye(e){return N1(zd,e)}const lE=M("ZodNumberFormat",(e,t)=>{IC.init(e,t),zd.init(e,t)});function mc(e){return I1(lE,e)}const cE=M("ZodBoolean",(e,t)=>{AC.init(e,t),Ee.init(e,t),e._zod.processJSONSchema=(n,r,o)=>t_(e,n,r)});function mt(e){return A1(cE,e)}const uE=M("ZodNull",(e,t)=>{RC.init(e,t),Ee.init(e,t),e._zod.processJSONSchema=(n,r,o)=>n_(e,n,r)});function dE(e){return R1(uE,e)}const fE=M("ZodAny",(e,t)=>{jC.init(e,t),Ee.init(e,t),e._zod.processJSONSchema=(n,r,o)=>o_()});function pE(){return j1(fE)}const hE=M("ZodUnknown",(e,t)=>{OC.init(e,t),Ee.init(e,t),e._zod.processJSONSchema=(n,r,o)=>i_()});function $t(){return O1(hE)}const mE=M("ZodNever",(e,t)=>{MC.init(e,t),Ee.init(e,t),e._zod.processJSONSchema=(n,r,o)=>r_(e,n,r)});function gE(e){return M1(mE,e)}const vE=M("ZodArray",(e,t)=>{DC.init(e,t),Ee.init(e,t),e._zod.processJSONSchema=(n,r,o)=>u_(e,n,r,o),e.element=t.element,e.min=(n,r)=>e.check(So(n,r)),e.nonempty=n=>e.check(So(1,n)),e.max=(n,r)=>e.check(Ad(n,r)),e.length=(n,r)=>e.check(Rd(n,r)),e.unwrap=()=>e.element});function Ue(e,t){return W1(vE,e,t)}const xE=M("ZodObject",(e,t)=>{zC.init(e,t),Ee.init(e,t),e._zod.processJSONSchema=(n,r,o)=>d_(e,n,r,o),xe(e,"shape",()=>t.shape),e.keyof=()=>Ie(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:$t()}),e.loose=()=>e.clone({...e._zod.def,catchall:$t()}),e.strict=()=>e.clone({...e._zod.def,catchall:gE()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>nS(e,n),e.safeExtend=n=>rS(e,n),e.merge=n=>oS(e,n),e.pick=n=>eS(e,n),e.omit=n=>tS(e,n),e.partial=(...n)=>iS(Ld,e,n[0]),e.required=(...n)=>aS(Fd,e,n[0])});function X(e,t){const n={type:"object",shape:e??{},...ee(t)};return new xE(n)}const bE=M("ZodUnion",(e,t)=>{LC.init(e,t),Ee.init(e,t),e._zod.processJSONSchema=(n,r,o)=>f_(e,n,r,o),e.options=t.options});function Lt(e,t){return new bE({type:"union",options:e,...ee(t)})}const yE=M("ZodIntersection",(e,t)=>{FC.init(e,t),Ee.init(e,t),e._zod.processJSONSchema=(n,r,o)=>p_(e,n,r,o)});function wE(e,t){return new yE({type:"intersection",left:e,right:t})}const kE=M("ZodRecord",(e,t)=>{BC.init(e,t),Ee.init(e,t),e._zod.processJSONSchema=(n,r,o)=>h_(e,n,r,o),e.keyType=t.keyType,e.valueType=t.valueType});function Kt(e,t,n){return new kE({type:"record",keyType:e,valueType:t,...ee(n)})}const pa=M("ZodEnum",(e,t)=>{VC.init(e,t),Ee.init(e,t),e._zod.processJSONSchema=(r,o,i)=>a_(e,r,o),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,o)=>{const i={};for(const a of r)if(n.has(a))i[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new pa({...t,checks:[],...ee(o),entries:i})},e.exclude=(r,o)=>{const i={...t.entries};for(const a of r)if(n.has(a))delete i[a];else throw new Error(`Key ${a} not found in enum`);return new pa({...t,checks:[],...ee(o),entries:i})}});function Ie(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new pa({type:"enum",entries:n,...ee(t)})}const SE=M("ZodLiteral",(e,t)=>{UC.init(e,t),Ee.init(e,t),e._zod.processJSONSchema=(n,r,o)=>s_(e,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function ls(e,t){return new SE({type:"literal",values:Array.isArray(e)?e:[e],...ee(t)})}const CE=M("ZodTransform",(e,t)=>{ZC.init(e,t),Ee.init(e,t),e._zod.processJSONSchema=(n,r,o)=>c_(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new dd(e.constructor.name);n.addIssue=i=>{if(typeof i=="string")n.issues.push(kr(i,n.value,t));else{const a=i;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=n.value),a.inst??(a.inst=e),n.issues.push(kr(a))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(i=>(n.value=i,n)):(n.value=o,n)}});function _E(e){return new CE({type:"transform",transform:e})}const Ld=M("ZodOptional",(e,t)=>{Id.init(e,t),Ee.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Dd(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function gc(e){return new Ld({type:"optional",innerType:e})}const EE=M("ZodExactOptional",(e,t)=>{HC.init(e,t),Ee.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Dd(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function TE(e){return new EE({type:"optional",innerType:e})}const PE=M("ZodNullable",(e,t)=>{GC.init(e,t),Ee.init(e,t),e._zod.processJSONSchema=(n,r,o)=>m_(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function vc(e){return new PE({type:"nullable",innerType:e})}const NE=M("ZodDefault",(e,t)=>{WC.init(e,t),Ee.init(e,t),e._zod.processJSONSchema=(n,r,o)=>v_(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function IE(e,t){return new NE({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():md(t)}})}const AE=M("ZodPrefault",(e,t)=>{qC.init(e,t),Ee.init(e,t),e._zod.processJSONSchema=(n,r,o)=>x_(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function RE(e,t){return new AE({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():md(t)}})}const Fd=M("ZodNonOptional",(e,t)=>{KC.init(e,t),Ee.init(e,t),e._zod.processJSONSchema=(n,r,o)=>g_(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function jE(e,t){return new Fd({type:"nonoptional",innerType:e,...ee(t)})}const OE=M("ZodCatch",(e,t)=>{JC.init(e,t),Ee.init(e,t),e._zod.processJSONSchema=(n,r,o)=>b_(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function ME(e,t){return new OE({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const DE=M("ZodPipe",(e,t)=>{YC.init(e,t),Ee.init(e,t),e._zod.processJSONSchema=(n,r,o)=>y_(e,n,r,o),e.in=t.in,e.out=t.out});function xc(e,t){return new DE({type:"pipe",in:e,out:t})}const $E=M("ZodReadonly",(e,t)=>{XC.init(e,t),Ee.init(e,t),e._zod.processJSONSchema=(n,r,o)=>w_(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function zE(e){return new $E({type:"readonly",innerType:e})}const LE=M("ZodLazy",(e,t)=>{QC.init(e,t),Ee.init(e,t),e._zod.processJSONSchema=(n,r,o)=>k_(e,n,r,o),e.unwrap=()=>e._zod.def.getter()});function FE(e){return new LE({type:"lazy",getter:e})}const BE=M("ZodCustom",(e,t)=>{e1.init(e,t),Ee.init(e,t),e._zod.processJSONSchema=(n,r,o)=>l_(e,n)});function VE(e,t={}){return q1(BE,e,t)}function UE(e){return K1(e)}var Bd=Lt([z(),Ye(),mt(),dE(),X({$state:z()})]);Lt([z(),X({$state:z()})]);Lt([Ye(),X({$state:z()})]);Lt([mt(),X({$state:z()})]);function ZE(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function HE(e){return(e.startsWith("/")?e.slice(1).split("/"):e.split("/")).map(ZE)}function St(e,t){if(!t||t==="/")return e;const n=HE(t);let r=e;for(const o of n){if(r==null)return;if(Array.isArray(r)){const i=parseInt(o,10);r=r[i]}else if(typeof r=="object")r=r[o];else return}return r}var to=Lt([Ye(),X({$state:z()})]),cs={eq:$t().optional(),neq:$t().optional(),gt:to.optional(),gte:to.optional(),lt:to.optional(),lte:to.optional(),not:ls(!0).optional()},GE=X({$state:z(),...cs}),WE=X({$item:z(),...cs}),qE=X({$index:ls(!0),...cs}),bc=Lt([GE,WE,qE]),ha=FE(()=>Lt([mt(),bc,Ue(bc),X({$and:Ue(ha)}),X({$or:Ue(ha)})]));function An(e,t){return typeof e=="object"&&e!==null&&"$state"in e&&typeof e.$state=="string"?St(t.stateModel,e.$state):e}function KE(e){return"$item"in e}function JE(e){return"$index"in e}function YE(e,t){return JE(e)?t.repeatIndex:KE(e)?t.repeatItem===void 0?void 0:e.$item===""?t.repeatItem:St(t.repeatItem,e.$item):St(t.stateModel,e.$state)}function yc(e,t){const n=YE(e,t);let r;if(e.eq!==void 0){const o=An(e.eq,t);r=n===o}else if(e.neq!==void 0){const o=An(e.neq,t);r=n!==o}else if(e.gt!==void 0){const o=An(e.gt,t);r=typeof n=="number"&&typeof o=="number"?n>o:!1}else if(e.gte!==void 0){const o=An(e.gte,t);r=typeof n=="number"&&typeof o=="number"?n>=o:!1}else if(e.lt!==void 0){const o=An(e.lt,t);r=typeof n=="number"&&typeof o=="number"?n<o:!1}else if(e.lte!==void 0){const o=An(e.lte,t);r=typeof n=="number"&&typeof o=="number"?n<=o:!1}else r=!!n;return e.not===!0?!r:r}function XE(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&"$and"in e}function QE(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&"$or"in e}function _o(e,t){return e===void 0?!0:typeof e=="boolean"?e:Array.isArray(e)?e.every(n=>yc(n,t)):XE(e)?e.$and.every(n=>_o(n,t)):QE(e)?e.$or.some(n=>_o(n,t)):yc(e,t)}function eT(e){return typeof e=="object"&&e!==null&&"$state"in e&&typeof e.$state=="string"}function Vd(e){return typeof e=="object"&&e!==null&&"$item"in e&&typeof e.$item=="string"}function Ud(e){return typeof e=="object"&&e!==null&&"$index"in e&&e.$index===!0}function Zd(e){return typeof e=="object"&&e!==null&&"$bindState"in e&&typeof e.$bindState=="string"}function Hd(e){return typeof e=="object"&&e!==null&&"$bindItem"in e&&typeof e.$bindItem=="string"}function tT(e){return typeof e=="object"&&e!==null&&"$cond"in e&&"$then"in e&&"$else"in e}function nT(e){return typeof e=="object"&&e!==null&&"$computed"in e&&typeof e.$computed=="string"}function rT(e){return typeof e=="object"&&e!==null&&"$template"in e&&typeof e.$template=="string"}var oT=100,Fi=new Set,iT=100,Bi=new Set;function us(e,t){if(t.repeatBasePath==null){console.warn(`$bindItem used outside repeat scope: "${e}"`);return}return e===""?t.repeatBasePath:t.repeatBasePath+"/"+e}function Vn(e,t){if(e==null)return e;if(eT(e))return St(t.stateModel,e.$state);if(Vd(e))return t.repeatItem===void 0?void 0:e.$item===""?t.repeatItem:St(t.repeatItem,e.$item);if(Ud(e))return t.repeatIndex;if(Zd(e))return St(t.stateModel,e.$bindState);if(Hd(e)){const n=us(e.$bindItem,t);return n===void 0?void 0:St(t.stateModel,n)}if(tT(e)){const n=_o(e.$cond,t);return Vn(n?e.$then:e.$else,t)}if(nT(e)){const n=t.functions?.[e.$computed];if(!n){Fi.has(e.$computed)||(Fi.size<oT&&Fi.add(e.$computed),console.warn(`Unknown $computed function: "${e.$computed}"`));return}const r={};if(e.args)for(const[o,i]of Object.entries(e.args))r[o]=Vn(i,t);return n(r)}if(rT(e))return e.$template.replace(/\$\{([^}]+)\}/g,(n,r)=>{let o=r;o.startsWith("/")||(Bi.has(o)||(Bi.size<iT&&Bi.add(o),console.warn(`$template path "${o}" should be a JSON Pointer starting with "/". Automatically resolving as "/${o}".`)),o="/"+o);const i=St(t.stateModel,o);return i!=null?String(i):""});if(Array.isArray(e))return e.map(n=>Vn(n,t));if(typeof e=="object"){const n={};for(const[r,o]of Object.entries(e))n[r]=Vn(o,t);return n}return e}function aT(e,t){const n={};for(const[r,o]of Object.entries(e))n[r]=Vn(o,t);return n}function sT(e,t){let n;for(const[r,o]of Object.entries(e))if(Zd(o))n||(n={}),n[r]=o.$bindState;else if(Hd(o)){const i=us(o.$bindItem,t);i!==void 0&&(n||(n={}),n[r]=i)}return n}function wc(e,t){return Vd(e)?us(e.$item,t):Ud(e)?t.repeatIndex:Vn(e,t)}var lT=X({title:z(),message:z(),confirmLabel:z().optional(),cancelLabel:z().optional(),variant:Ie(["default","danger"]).optional()}),cT=Lt([X({navigate:z()}),X({set:Kt(z(),$t())}),X({action:z()})]),uT=Lt([X({set:Kt(z(),$t())}),X({action:z()})]);X({action:z(),params:Kt(z(),Bd).optional(),confirm:lT.optional(),onSuccess:cT.optional(),onError:uT.optional(),preventDefault:mt().optional()});var dT=X({type:z(),args:Kt(z(),Bd).optional(),message:z()});X({checks:Ue(dT).optional(),validateOn:Ie(["change","blur","submit"]).optional(),enabled:ha.optional()});function fT(){return{string:()=>({kind:"string"}),number:()=>({kind:"number"}),boolean:()=>({kind:"boolean"}),array:e=>({kind:"array",inner:e}),object:e=>({kind:"object",inner:e}),record:e=>({kind:"record",inner:e}),any:()=>({kind:"any"}),zod:()=>({kind:"zod"}),ref:e=>({kind:"ref",inner:e}),propsOf:e=>({kind:"propsOf",inner:e}),map:e=>({kind:"map",inner:e}),optional:()=>({optional:!0})}}function pT(e,t){const n=fT();return{definition:e(n),promptTemplate:t?.promptTemplate,defaultRules:t?.defaultRules,builtInActions:t?.builtInActions,createCatalog(o){return hT(this,o)}}}function hT(e,t){const n=t.components,r=t.actions,o=n?Object.keys(n):[],i=r?Object.keys(r):[],a=mT(e.definition,t);return{schema:e,data:t,componentNames:o,actionNames:i,prompt(s={}){return xT(this,s)},jsonSchema(){return Ln(a)},validate(s){const l=a.safeParse(s);return l.success?{success:!0,data:l.data}:{success:!1,error:l.error}},zodSchema(){return a},get _specType(){throw new Error("_specType is only for type inference")}}}function mT(e,t){return fo(e.spec,t)}function fo(e,t){switch(e.kind){case"string":return z();case"number":return Ye();case"boolean":return mt();case"any":return pE();case"array":{const n=fo(e.inner,t);return Ue(n)}case"object":{const n=e.inner,r={};for(const[o,i]of Object.entries(n)){let a=fo(i,t);i.optional&&(a=a.optional()),r[o]=a}return X(r)}case"record":{const n=fo(e.inner,t);return Kt(z(),n)}case"ref":{const n=e.inner,r=gT(n,t);return r.length===0?z():r.length===1?ls(r[0]):Ie(r)}case"propsOf":{const n=e.inner,r=vT(n,t);return r.length===0?Kt(z(),$t()):r.length===1?r[0]:Kt(z(),$t())}default:return $t()}}function gT(e,t){const n=e.split(".");let r={catalog:t};for(const o of n)if(r&&typeof r=="object")r=r[o];else return[];return r&&typeof r=="object"?Object.keys(r):[]}function vT(e,t){const n=e.split(".");let r={catalog:t};for(const o of n)if(r&&typeof r=="object")r=r[o];else return[];return r&&typeof r=="object"?Object.values(r).map(o=>o.props).filter(o=>o!==void 0):[]}function xT(e,t){if(e.schema.promptTemplate){const N={catalog:e.data,componentNames:e.componentNames,actionNames:e.actionNames,options:t,formatZodType:gn};return e.schema.promptTemplate(N)}const{system:n="You are a UI generator that outputs JSON.",customRules:r=[],mode:o="generate"}=t,i=[];i.push(n),i.push(""),o==="chat"?(i.push("OUTPUT FORMAT (text + JSONL, RFC 6902 JSON Patch):"),i.push("You respond conversationally. When generating UI, first write a brief explanation (1-3 sentences), then output JSONL patch lines wrapped in a ```spec code fence."),i.push("The JSONL lines use RFC 6902 JSON Patch operations to build a UI tree. Always wrap them in a ```spec fence block:"),i.push(" ```spec"),i.push(' {"op":"add","path":"/root","value":"main"}'),i.push(' {"op":"add","path":"/elements/main","value":{"type":"Card","props":{"title":"Hello"},"children":[]}}'),i.push(" ```"),i.push("If the user's message does not require a UI (e.g. a greeting or clarifying question), respond with text only — no JSONL.")):(i.push("OUTPUT FORMAT (JSONL, RFC 6902 JSON Patch):"),i.push("Output JSONL (one JSON object per line) using RFC 6902 JSON Patch operations to build a UI tree.")),i.push("Each line is a JSON patch operation (add, remove, replace). Start with /root, then stream /elements and /state patches interleaved so the UI fills in progressively as it streams."),i.push(""),i.push("Example output (each line is a separate JSON object):"),i.push("");const a=e.data.components,s=e.componentNames,l=s[0]||"Component",c=s.length>1?s[1]:l,d=a?.[l],u=a?.[c],p=d?kc(d):{},h=u?kc(u):{},v=u?.props?bT(u.props):null,g=v?{...h,[v]:{$item:"title"}}:h,b=[JSON.stringify({op:"add",path:"/root",value:"main"}),JSON.stringify({op:"add",path:"/elements/main",value:{type:l,props:p,children:["child-1","list"]}}),JSON.stringify({op:"add",path:"/elements/child-1",value:{type:c,props:h,children:[]}}),JSON.stringify({op:"add",path:"/elements/list",value:{type:l,props:p,repeat:{statePath:"/items",key:"id"},children:["item"]}}),JSON.stringify({op:"add",path:"/elements/item",value:{type:c,props:g,children:[]}}),JSON.stringify({op:"add",path:"/state/items",value:[]}),JSON.stringify({op:"add",path:"/state/items/0",value:{id:"1",title:"First Item"}}),JSON.stringify({op:"add",path:"/state/items/1",value:{id:"2",title:"Second Item"}})].join(`
69
+ `);i.push(`${b}
70
+
71
+ Note: state patches appear right after the elements that use them, so the UI fills in as it streams. ONLY use component types from the AVAILABLE COMPONENTS list below.`),i.push(""),i.push("INITIAL STATE:"),i.push("Specs include a /state field to seed the state model. Components with { $bindState } or { $bindItem } read from and write to this state, and $state expressions read from it."),i.push("CRITICAL: You MUST include state patches whenever your UI displays data via $state, $bindState, $bindItem, $item, or $index expressions, or uses repeat to iterate over arrays. Without state, these references resolve to nothing and repeat lists render zero items."),i.push("Output state patches right after the elements that reference them, so the UI fills in progressively as it streams."),i.push("Stream state progressively - output one patch per array item instead of one giant blob:"),i.push(' For arrays: {"op":"add","path":"/state/posts/0","value":{"id":"1","title":"First Post",...}} then /state/posts/1, /state/posts/2, etc.'),i.push(' For scalars: {"op":"add","path":"/state/newTodoText","value":""}'),i.push(' Initialize the array first if needed: {"op":"add","path":"/state/posts","value":[]}'),i.push('When content comes from the state model, use { "$state": "/some/path" } dynamic props to display it instead of hardcoding the same value in both state and props. The state model is the single source of truth.'),i.push("Include realistic sample data in state. For blogs: 3-4 posts with titles, excerpts, authors, dates. For product lists: 3-5 items with names, prices, descriptions. Never leave arrays empty."),i.push(""),i.push("DYNAMIC LISTS (repeat field):"),i.push('Any element can have a top-level "repeat" field to render its children once per item in a state array: { "repeat": { "statePath": "/arrayPath", "key": "id" } }.'),i.push('The element itself renders once (as the container), and its children are expanded once per array item. "statePath" is the state array path. "key" is an optional field name on each item for stable React keys.'),i.push(`Example: ${JSON.stringify({type:l,props:p,repeat:{statePath:"/todos",key:"id"},children:["todo-item"]})}`),i.push('Inside children of a repeated element, use { "$item": "field" } to read a field from the current item, and { "$index": true } to get the current array index. For two-way binding to an item field use { "$bindItem": "completed" } on the appropriate prop.'),i.push("ALWAYS use the repeat field for lists backed by state arrays. NEVER hardcode individual elements for each array item."),i.push('IMPORTANT: "repeat" is a top-level field on the element (sibling of type/props/children), NOT inside props.'),i.push(""),i.push("ARRAY STATE ACTIONS:"),i.push('Use action "pushState" to append items to arrays. Params: { statePath: "/arrayPath", value: { ...item }, clearStatePath: "/inputPath" }.'),i.push('Values inside pushState can contain { "$state": "/statePath" } references to read current state (e.g. the text from an input field).'),i.push('Use "$id" inside a pushState value to auto-generate a unique ID.'),i.push('Example: on: { "press": { "action": "pushState", "params": { "statePath": "/todos", "value": { "id": "$id", "title": { "$state": "/newTodoText" }, "completed": false }, "clearStatePath": "/newTodoText" } } }'),i.push(`Use action "removeState" to remove items from arrays by index. Params: { statePath: "/arrayPath", index: N }. Inside a repeated element's children, use { "$index": true } for the current item index. Action params support the same expressions as props: { "$item": "field" } resolves to the absolute state path, { "$index": true } resolves to the index number, and { "$state": "/path" } reads a value from state.`),i.push("For lists where users can add/remove items (todos, carts, etc.), use pushState and removeState instead of hardcoding with setState."),i.push(""),i.push('IMPORTANT: State paths use RFC 6901 JSON Pointer syntax (e.g. "/todos/0/title"). Do NOT use JavaScript-style dot notation (e.g. "/todos.length" is WRONG). To generate unique IDs for new items, use "$id" instead of trying to read array length.'),i.push("");const x=a;if(x){i.push(`AVAILABLE COMPONENTS (${e.componentNames.length}):`),i.push("");for(const[N,A]of Object.entries(x)){const j=A.props?gn(A.props):"{}",O=A.slots&&A.slots.length>0?" [accepts children]":"",B=A.events&&A.events.length>0?` [events: ${A.events.join(", ")}]`:"",W=A.description?` - ${A.description}`:"";i.push(`- ${N}: ${j}${W}${O}${B}`)}i.push("")}const y=e.data.actions,w=e.schema.builtInActions??[],S=y&&e.actionNames.length>0,P=w.length>0;if(S||P){i.push("AVAILABLE ACTIONS:"),i.push("");for(const N of w)i.push(`- ${N.name}: ${N.description} [built-in]`);if(S)for(const[N,A]of Object.entries(y))i.push(`- ${N}${A.description?`: ${A.description}`:""}`);i.push("")}i.push("EVENTS (the `on` field):"),i.push("Elements can have an optional `on` field to bind events to actions. The `on` field is a top-level field on the element (sibling of type/props/children), NOT inside props."),i.push('Each key in `on` is an event name (from the component\'s supported events), and the value is an action binding: `{ "action": "<actionName>", "params": { ... } }`.'),i.push(""),i.push("Example:"),i.push(` ${JSON.stringify({type:l,props:p,on:{press:{action:"setState",params:{statePath:"/saved",value:!0}}},children:[]})}`),i.push(""),i.push('Action params can use dynamic references to read from state: { "$state": "/statePath" }.'),i.push("IMPORTANT: Do NOT put action/actionParams inside props. Always use the `on` field for event bindings."),i.push(""),i.push("VISIBILITY CONDITIONS:"),i.push("Elements can have an optional `visible` field to conditionally show/hide based on state. IMPORTANT: `visible` is a top-level field on the element object (sibling of type/props/children), NOT inside props."),i.push(`Correct: ${JSON.stringify({type:l,props:p,visible:{$state:"/activeTab",eq:"home"},children:["..."]})}`),i.push('- `{ "$state": "/path" }` - visible when state at path is truthy'),i.push('- `{ "$state": "/path", "not": true }` - visible when state at path is falsy'),i.push('- `{ "$state": "/path", "eq": "value" }` - visible when state equals value'),i.push('- `{ "$state": "/path", "neq": "value" }` - visible when state does not equal value'),i.push('- `{ "$state": "/path", "gt": N }` / `gte` / `lt` / `lte` - numeric comparisons'),i.push("- Use ONE operator per condition (eq, neq, gt, gte, lt, lte). Do not combine multiple operators."),i.push('- Any condition can add `"not": true` to invert its result'),i.push("- `[condition, condition]` - all conditions must be true (implicit AND)"),i.push('- `{ "$and": [condition, condition] }` - explicit AND (use when nesting inside $or)'),i.push('- `{ "$or": [condition, condition] }` - at least one must be true (OR)'),i.push("- `true` / `false` - always visible/hidden"),i.push(""),i.push("Use a component with on.press bound to setState to update state and drive visibility."),i.push(`Example: A ${l} with on: { "press": { "action": "setState", "params": { "statePath": "/activeTab", "value": "home" } } } sets state, then a container with visible: { "$state": "/activeTab", "eq": "home" } shows only when that tab is active.`),i.push(""),i.push('For tab patterns where the first/default tab should be visible when no tab is selected yet, use $or to handle both cases: visible: { "$or": [{ "$state": "/activeTab", "eq": "home" }, { "$state": "/activeTab", "not": true }] }. This ensures the first tab is visible both when explicitly selected AND when /activeTab is not yet set.'),i.push(""),i.push("DYNAMIC PROPS:"),i.push("Any prop value can be a dynamic expression that resolves based on state. Three forms are supported:"),i.push(""),i.push('1. Read-only state: `{ "$state": "/statePath" }` - resolves to the value at that state path (one-way read).'),i.push(' Example: `"color": { "$state": "/theme/primary" }` reads the color from state.'),i.push(""),i.push('2. Two-way binding: `{ "$bindState": "/statePath" }` - resolves to the value at the state path AND enables write-back. Use on form input props (value, checked, pressed, etc.).'),i.push(' Example: `"value": { "$bindState": "/form/email" }` binds the input value to /form/email.'),i.push(' Inside repeat scopes: `"checked": { "$bindItem": "completed" }` binds to the current item\'s completed field.'),i.push(""),i.push('3. Conditional: `{ "$cond": <condition>, "$then": <value>, "$else": <value> }` - evaluates the condition (same syntax as visibility conditions) and picks the matching value.'),i.push(' Example: `"color": { "$cond": { "$state": "/activeTab", "eq": "home" }, "$then": "#007AFF", "$else": "#8E8E93" }`'),i.push(""),i.push("Use $bindState for form inputs (text fields, checkboxes, selects, sliders, etc.) and $state for read-only data display. Inside repeat scopes, use $bindItem for form inputs bound to the current item. Use dynamic props instead of duplicating elements with opposing visible conditions when only prop values differ."),i.push(""),i.push('4. Template: `{ "$template": "Hello, ${/name}!" }` - interpolates `${/path}` references in the string with values from the state model.'),i.push(' Example: `"label": { "$template": "Items: ${/cart/count} | Total: ${/cart/total}" }` renders "Items: 3 | Total: 42.00" when /cart/count is 3 and /cart/total is 42.00.'),i.push("");const C=e.data.functions;if(C&&Object.keys(C).length>0){i.push('5. Computed: `{ "$computed": "<functionName>", "args": { "key": <expression> } }` - calls a registered function with resolved args and returns the result.'),i.push(' Example: `"value": { "$computed": "fullName", "args": { "first": { "$state": "/form/firstName" }, "last": { "$state": "/form/lastName" } } }`'),i.push(" Available functions:");for(const N of Object.keys(C))i.push(` - ${N}`);i.push("")}a&&Object.entries(a).some(([,N])=>N.props?gn(N.props).includes("checks"):!1)&&(i.push("VALIDATION:"),i.push("Form components that accept a `checks` prop support client-side validation."),i.push('Each check is an object: { "type": "<name>", "message": "...", "args": { ... } }'),i.push(""),i.push("Built-in validation types:"),i.push(" - required — value must be non-empty"),i.push(" - email — valid email format"),i.push(' - minLength — minimum string length (args: { "min": N })'),i.push(' - maxLength — maximum string length (args: { "max": N })'),i.push(' - pattern — match a regex (args: { "pattern": "regex" })'),i.push(' - min — minimum numeric value (args: { "min": N })'),i.push(' - max — maximum numeric value (args: { "max": N })'),i.push(" - numeric — value must be a number"),i.push(" - url — valid URL format"),i.push(' - matches — must equal another field (args: { "other": { "$state": "/path" } })'),i.push(' - equalTo — alias for matches (args: { "other": { "$state": "/path" } })'),i.push(' - lessThan — value must be less than another field (args: { "other": { "$state": "/path" } })'),i.push(' - greaterThan — value must be greater than another field (args: { "other": { "$state": "/path" } })'),i.push(' - requiredIf — required only when another field is truthy (args: { "field": { "$state": "/path" } })'),i.push(""),i.push("Example:"),i.push(' "checks": [{ "type": "required", "message": "Email is required" }, { "type": "email", "message": "Invalid email" }]'),i.push(""),i.push("IMPORTANT: When using checks, the component must also have a { $bindState } or { $bindItem } on its value/checked prop for two-way binding."),i.push("Always include validation checks on form inputs for a good user experience (e.g. required, email, minLength)."),i.push("")),(S||P)&&(i.push("STATE WATCHERS:"),i.push("Elements can have an optional `watch` field to react to state changes and trigger actions. The `watch` field is a top-level field on the element (sibling of type/props/children), NOT inside props."),i.push("Maps state paths (JSON Pointers) to action bindings. When the value at a watched path changes, the bound actions fire automatically."),i.push(""),i.push("Example (cascading select — country changes trigger city loading):"),i.push(` ${JSON.stringify({type:"Select",props:{value:{$bindState:"/form/country"},options:["US","Canada","UK"]},watch:{"/form/country":{action:"loadCities",params:{country:{$state:"/form/country"}}}},children:[]})}`),i.push(""),i.push("Use `watch` for cascading dependencies where changing one field should trigger side effects (loading data, resetting dependent fields, computing derived values)."),i.push("IMPORTANT: `watch` is a top-level field on the element (sibling of type/props/children), NOT inside props. Watchers only fire when the value changes, not on initial render."),i.push("")),i.push("RULES:");const I=o==="chat"?["When generating UI, wrap all JSONL patches in a ```spec code fence - one JSON object per line inside the fence","Write a brief conversational response before any JSONL output",'First set root: {"op":"add","path":"/root","value":"<root-key>"}','Then add each element: {"op":"add","path":"/elements/<key>","value":{...}}',"Output /state patches right after the elements that use them, one per array item for progressive loading. REQUIRED whenever using $state, $bindState, $bindItem, $item, $index, or repeat.","ONLY use components listed above","Each element value needs: type, props, children (array of child keys)","Use unique keys for the element map entries (e.g., 'header', 'metric-1', 'chart-revenue')"]:["Output ONLY JSONL patches - one JSON object per line, no markdown, no code fences",'First set root: {"op":"add","path":"/root","value":"<root-key>"}','Then add each element: {"op":"add","path":"/elements/<key>","value":{...}}',"Output /state patches right after the elements that use them, one per array item for progressive loading. REQUIRED whenever using $state, $bindState, $bindItem, $item, $index, or repeat.","ONLY use components listed above","Each element value needs: type, props, children (array of child keys)","Use unique keys for the element map entries (e.g., 'header', 'metric-1', 'chart-revenue')"],R=e.schema.defaultRules??[];return[...I,...R,...r].forEach((N,A)=>{i.push(`${A+1}. ${N}`)}),i.join(`
72
+ `)}function kc(e){return e.example&&Object.keys(e.example).length>0?e.example:e.props?Gd(e.props):{}}function Gd(e){if(!e||!e._def)return{};const t=e._def,n=bn(e);if(n!=="ZodObject"&&n!=="object")return{};const r=typeof t.shape=="function"?t.shape():t.shape;if(!r)return{};const o={};for(const[i,a]of Object.entries(r)){const s=bn(a);s==="ZodOptional"||s==="optional"||s==="ZodNullable"||s==="nullable"||(o[i]=ma(a))}return o}function ma(e){if(!e||!e._def)return"...";const t=e._def;switch(bn(e)){case"ZodString":case"string":return"example";case"ZodNumber":case"number":return 0;case"ZodBoolean":case"boolean":return!0;case"ZodLiteral":case"literal":return t.value;case"ZodEnum":case"enum":{if(Array.isArray(t.values)&&t.values.length>0)return t.values[0];if(t.entries&&typeof t.entries=="object"){const r=Object.values(t.entries);return r.length>0?r[0]:"example"}return"example"}case"ZodOptional":case"optional":case"ZodNullable":case"nullable":case"ZodDefault":case"default":{const r=t.innerType??t.wrapped;return r?ma(r):null}case"ZodArray":case"array":return[];case"ZodObject":case"object":return Gd(e);case"ZodUnion":case"union":{const r=t.options;return r&&r.length>0?ma(r[0]):"..."}default:return"..."}}function bT(e){if(!e||!e._def)return null;const t=e._def,n=bn(e);if(n!=="ZodObject"&&n!=="object")return null;const r=typeof t.shape=="function"?t.shape():t.shape;if(!r)return null;for(const[o,i]of Object.entries(r)){const a=bn(i);if(!(a==="ZodOptional"||a==="optional"||a==="ZodNullable"||a==="nullable")&&(a==="ZodString"||a==="string"))return o}return null}function bn(e){if(!e||!e._def)return"";const t=e._def;return t.typeName??t.type??""}function gn(e){if(!e||!e._def)return"unknown";const t=e._def;switch(bn(e)){case"ZodString":case"string":return"string";case"ZodNumber":case"number":return"number";case"ZodBoolean":case"boolean":return"boolean";case"ZodLiteral":case"literal":return JSON.stringify(t.value);case"ZodEnum":case"enum":{let r;if(Array.isArray(t.values))r=t.values;else if(t.entries&&typeof t.entries=="object")r=Object.values(t.entries);else return"enum";return r.map(o=>`"${o}"`).join(" | ")}case"ZodArray":case"array":{const r=typeof t.element=="object"?t.element:typeof t.type=="object"?t.type:void 0;return r?`Array<${gn(r)}>`:"Array<unknown>"}case"ZodObject":case"object":{const r=typeof t.shape=="function"?t.shape():t.shape;return r?`{ ${Object.entries(r).map(([i,a])=>{const s=bn(a);return`${i}${s==="ZodOptional"||s==="ZodNullable"||s==="optional"||s==="nullable"?"?":""}: ${gn(a)}`}).join(", ")} }`:"object"}case"ZodOptional":case"optional":case"ZodNullable":case"nullable":{const r=t.innerType??t.wrapped;return r?gn(r):"unknown"}case"ZodUnion":case"union":{const r=t.options;return r?r.map(o=>gn(o)).join(" | "):"unknown"}default:return"unknown"}}function Ln(e){const t=e._def;switch(t.typeName??""){case"ZodString":return{type:"string"};case"ZodNumber":return{type:"number"};case"ZodBoolean":return{type:"boolean"};case"ZodLiteral":return{const:t.value};case"ZodEnum":return{enum:t.values};case"ZodArray":{const r=t.type;return{type:"array",items:r?Ln(r):{}}}case"ZodObject":{const r=t.shape?.();if(!r)return{type:"object"};const o={},i=[];for(const[a,s]of Object.entries(r)){o[a]=Ln(s);const l=s._def;l.typeName!=="ZodOptional"&&l.typeName!=="ZodNullable"&&i.push(a)}return{type:"object",properties:o,required:i.length>0?i:void 0,additionalProperties:!1}}case"ZodRecord":{const r=t.valueType;return{type:"object",additionalProperties:r?Ln(r):!0}}case"ZodOptional":case"ZodNullable":{const r=t.innerType;return r?Ln(r):{}}case"ZodUnion":{const r=t.options;return r?{anyOf:r.map(Ln)}:{}}case"ZodAny":return{};default:return{}}}function yT(e,t){return e.createCatalog(t)}var wT=pT(e=>({spec:e.object({root:e.string(),elements:e.record(e.object({type:e.ref("catalog.components"),props:e.propsOf("catalog.components"),children:e.array(e.string()),visible:e.any()}))}),catalog:e.object({components:e.map({props:e.zod(),slots:e.array(e.string()),description:e.string(),example:e.any()}),actions:e.map({params:e.zod(),description:e.string()})})}),{builtInActions:[{name:"setState",description:"Update a value in the state model at the given statePath. Params: { statePath: string, value: any }"},{name:"pushState",description:'Append an item to an array in state. Params: { statePath: string, value: any, clearStatePath?: string }. Value can contain {"$state":"/path"} refs and "$id" for auto IDs.'},{name:"removeState",description:"Remove an item from an array in state by index. Params: { statePath: string, index: number }"},{name:"validateForm",description:"Validate all registered form fields and write the result to state. Params: { statePath?: string }. Defaults to /formValidation. Result: { valid: boolean, errors: Record<string, string[]> }."}],defaultRules:["CRITICAL INTEGRITY CHECK: Before outputting ANY element that references children, you MUST have already output (or will output) each child as its own element. If an element has children: ['a', 'b'], then elements 'a' and 'b' MUST exist. A missing child element causes that entire branch of the UI to be invisible.","SELF-CHECK: After generating all elements, mentally walk the tree from root. Every key in every children array must resolve to a defined element. If you find a gap, output the missing element immediately.",'CRITICAL: The "visible" field goes on the ELEMENT object, NOT inside "props". Correct: {"type":"<ComponentName>","props":{},"visible":{"$state":"/tab","eq":"home"},"children":[...]}.','CRITICAL: The "on" field goes on the ELEMENT object, NOT inside "props". Use on.press, on.change, on.submit etc. NEVER put action/actionParams inside props.',"When the user asks for a UI that displays data (e.g. blog posts, products, users), ALWAYS include a state field with realistic sample data. The state field is a top-level field on the spec (sibling of root/elements).",'When building repeating content backed by a state array (e.g. posts, products, items), use the "repeat" field on a container element. Example: { "type": "<ContainerComponent>", "props": {}, "repeat": { "statePath": "/posts", "key": "id" }, "children": ["post-card"] }. Replace <ContainerComponent> with an appropriate component from the AVAILABLE COMPONENTS list. Inside repeated children, use { "$item": "field" } to read a field from the current item, and { "$index": true } for the current array index. For two-way binding to an item field use { "$bindItem": "completed" }. Do NOT hardcode individual elements for each array item.',"Design with visual hierarchy: use container components to group content, heading components for section titles, proper spacing, and status indicators. ONLY use components from the AVAILABLE COMPONENTS list.","For data-rich UIs, use multi-column layout components if available. For forms and single-column content, use vertical layout components. ONLY use components from the AVAILABLE COMPONENTS list.","Always include realistic, professional-looking sample data. For blogs include 3-4 posts with varied titles, authors, dates, categories. For products include names, prices, images. Never leave data empty."]}),kT=m.createContext(null);function Uo(){const e=m.useContext(kT);if(!e)throw new Error("useStateStore must be used within a StateProvider");return e}function Sc(e){const{state:t,set:n}=Uo(),r=St(t,e),o=m.useCallback(i=>n(e,i),[e,n]);return[r,o]}var ST=m.createContext(null);function CT(){const e=m.useContext(ST);if(!e)throw new Error("useVisibility must be used within a VisibilityProvider");return e}var _T=m.createContext(null);function ET(){const e=m.useContext(_T);if(!e)throw new Error("useValidation must be used within a ValidationProvider");return e}function Rn(e,t){const{fieldStates:n,validate:r,touch:o,clear:i,registerField:a}=ET();L.useEffect(()=>{e&&t&&a(e,t)},[e,t,a]);const s=n[e]??{touched:!1,validated:!1,result:null},l=m.useCallback(()=>r(e,t??{checks:[]}),[e,t,r]),c=m.useCallback(()=>o(e),[e,o]),d=m.useCallback(()=>i(e),[e,i]);return{state:s,validate:l,touch:c,clear:d,errors:s.result?.errors??[],isValid:s.result?.valid??!0}}var TT=m.createContext(null);function PT(){const e=m.useContext(TT);if(!e)throw new Error("useActions must be used within an ActionProvider");return e}var Wd=m.createContext(null);function NT({item:e,index:t,basePath:n,children:r}){return f.jsx(Wd.Provider,{value:{item:e,index:t,basePath:n},children:r})}function IT(){return m.useContext(Wd)}var AT=class extends L.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){console.error(`[json-render] Rendering error in <${this.props.elementType}>:`,e,t.componentStack)}render(){return this.state.hasError?null:this.props.children}},RT={},jT=L.createContext(RT);function OT(){return L.useContext(jT)}var qd=L.memo(function e({element:t,spec:n,registry:r,loading:o,fallback:i}){const a=IT(),{ctx:s}=CT(),{execute:l}=PT(),{getSnapshot:c,state:d}=Uo(),u=OT(),p=m.useMemo(()=>{const N=a?{...s,repeatItem:a.item,repeatIndex:a.index,repeatBasePath:a.basePath}:{...s};return N.functions=u,N},[s,a,u]),h=t.visible===void 0?!0:_o(t.visible,p),v=t.on,g=m.useCallback(async N=>{const A=v?.[N];if(!A)return;const j=Array.isArray(A)?A:[A];for(const $ of j){if(!$.params){await l($);continue}const O={...p,stateModel:c()},B={};for(const[W,Y]of Object.entries($.params))B[W]=wc(Y,O);await l({...$,params:B})}},[v,l,p,c]),b=m.useCallback(N=>{const A=v?.[N];if(!A)return{emit:()=>{},shouldPreventDefault:!1,bound:!1};const $=(Array.isArray(A)?A:[A]).some(O=>O.preventDefault);return{emit:()=>g(N),shouldPreventDefault:$,bound:!0}},[v,g]),x=t.watch,y=m.useRef(null),w=m.useRef(void 0),S=m.useMemo(()=>{if(!x)return;const N={};for(const j of Object.keys(x))N[j]=St(d,j);const A=w.current;if(A){const j=Object.keys(N);if(j.length===Object.keys(A).length&&j.every($=>N[$]===A[$]))return A}return w.current=N,N},[x,d]);if(m.useEffect(()=>{if(!x||!S)return;const N=Object.keys(x);if(N.length===0)return;const A=y.current;if(y.current=S,A===null)return;let j=!1;return(async()=>{for(const $ of N){if(j)break;if(S[$]!==A[$]){const O=x[$];if(!O)continue;const B=Array.isArray(O)?O:[O];for(const W of B){if(j)break;if(!W.params){if(await l(W),j)break;continue}const Y={...p,stateModel:c()},V={};for(const[k,le]of Object.entries(W.params))V[k]=wc(le,Y);if(await l({...W,params:V}),j)break}}}})().catch(console.error),()=>{j=!0}},[x,S,l,p,c]),!h)return null;const P=t.props,C=sT(P,p),T=aT(P,p),I=T!==t.props?{...t,props:T}:t,R=r[I.type]??i;if(!R)return console.warn(`No renderer for component type: ${I.type}`),null;const E=I.repeat?f.jsx(MT,{element:I,spec:n,registry:r,loading:o,fallback:i}):I.children?.map(N=>{const A=n.elements[N];return A?f.jsx(e,{element:A,spec:n,registry:r,loading:o,fallback:i},N):(o||console.warn(`[json-render] Missing element "${N}" referenced as child of "${I.type}". This element will not render.`),null)});return f.jsx(AT,{elementType:I.type,children:f.jsx(R,{element:I,emit:g,on:b,bindings:C,loading:o,children:E})})});function MT({element:e,spec:t,registry:n,loading:r,fallback:o}){const{state:i}=Uo(),a=e.repeat,s=a.statePath,l=St(i,s)??[];return f.jsx(f.Fragment,{children:l.map((c,d)=>{const u=a.key&&typeof c=="object"&&c!==null?String(c[a.key]??d):String(d);return f.jsx(NT,{item:c,index:d,basePath:`${s}/${d}`,children:e.children?.map(p=>{const h=t.elements[p];return h?f.jsx(qd,{element:h,spec:t,registry:n,loading:r,fallback:o},p):(r||console.warn(`[json-render] Missing element "${p}" referenced as child of "${e.type}" (repeat). This element will not render.`),null)})},u)})})}function DT({spec:e,registry:t,loading:n,fallback:r}){if(!e||!e.root)return null;const o=e.elements[e.root];return o?f.jsx(qd,{element:o,spec:e,registry:t,loading:n,fallback:r}):null}function $T(e,t){const n={};if(t.components)for(const[a,s]of Object.entries(t.components))n[a]=({element:l,children:c,emit:d,on:u,bindings:p,loading:h})=>s({props:l.props,children:c,emit:d,on:u,bindings:p,loading:h});const r=t.actions?Object.entries(t.actions):[];return{registry:n,handlers:(a,s)=>{const l={};for(const[c,d]of r)l[c]=async u=>{const p=a(),h=s();p&&await d(u,p,h)};return l},executeAction:async(a,s,l,c={})=>{const d=r.find(([u])=>u===a);d?await d[1](s,l,c):console.warn(`Unknown action: ${a}`)}}}function ft(e,t){const{set:n}=Uo(),r=m.useCallback(o=>{t&&n(t,o)},[t,n]);return[e,r]}var jn=Ue(X({type:z(),message:z(),args:Kt(z(),$t()).optional()})).nullable(),On=Ie(["change","blur","submit"]).nullable(),zT={Card:{props:X({title:z().nullable(),description:z().nullable(),maxWidth:Ie(["sm","md","lg","full"]).nullable(),centered:mt().nullable()}),slots:["default"],description:"Container card for content sections. Use for forms/content boxes, NOT for page headers.",example:{title:"Overview",description:"Your account summary"}},Stack:{props:X({direction:Ie(["horizontal","vertical"]).nullable(),gap:Ie(["none","sm","md","lg"]).nullable(),align:Ie(["start","center","end","stretch"]).nullable(),justify:Ie(["start","center","end","between","around"]).nullable()}),slots:["default"],description:"Flex container for layouts",example:{direction:"vertical",gap:"md"}},Grid:{props:X({columns:Ye().nullable(),gap:Ie(["sm","md","lg"]).nullable()}),slots:["default"],description:"Grid layout (1-6 columns)",example:{columns:3,gap:"md"}},Separator:{props:X({orientation:Ie(["horizontal","vertical"]).nullable()}),description:"Visual separator line"},Tabs:{props:X({tabs:Ue(X({label:z(),value:z()})),defaultValue:z().nullable(),value:z().nullable()}),slots:["default"],events:["change"],description:"Tab navigation. Use { $bindState } on value for active tab binding."},Accordion:{props:X({items:Ue(X({title:z(),content:z()})),type:Ie(["single","multiple"]).nullable()}),description:"Collapsible sections. Items as [{title, content}]. Type 'single' (default) or 'multiple'."},Collapsible:{props:X({title:z(),defaultOpen:mt().nullable()}),slots:["default"],description:"Collapsible section with trigger. Children render inside."},Dialog:{props:X({title:z(),description:z().nullable(),openPath:z()}),slots:["default"],description:"Modal dialog. Set openPath to a boolean state path. Use setState to toggle."},Drawer:{props:X({title:z(),description:z().nullable(),openPath:z()}),slots:["default"],description:"Bottom sheet drawer. Set openPath to a boolean state path. Use setState to toggle."},Carousel:{props:X({items:Ue(X({title:z().nullable(),description:z().nullable()}))}),description:"Horizontally scrollable carousel of cards."},Table:{props:X({columns:Ue(z()),rows:Ue(Ue(z())),caption:z().nullable()}),description:'Data table. columns: header labels. rows: 2D array of cell strings, e.g. [["Alice","admin"],["Bob","user"]].',example:{columns:["Name","Role"],rows:[["Alice","Admin"],["Bob","User"]]}},Heading:{props:X({text:z(),level:Ie(["h1","h2","h3","h4"]).nullable()}),description:"Heading text (h1-h4)",example:{text:"Welcome",level:"h1"}},Text:{props:X({text:z(),variant:Ie(["body","caption","muted","lead","code"]).nullable()}),description:"Paragraph text",example:{text:"Hello, world!"}},Image:{props:X({src:z().nullable(),alt:z(),width:Ye().nullable(),height:Ye().nullable()}),description:"Image component. Renders an img tag when src is provided, otherwise a placeholder."},Avatar:{props:X({src:z().nullable(),name:z(),size:Ie(["sm","md","lg"]).nullable()}),description:"User avatar with fallback initials",example:{name:"Jane Doe",size:"md"}},Badge:{props:X({text:z(),variant:Ie(["default","secondary","destructive","outline"]).nullable()}),description:"Status badge",example:{text:"Active",variant:"default"}},Alert:{props:X({title:z(),message:z().nullable(),type:Ie(["info","success","warning","error"]).nullable()}),description:"Alert banner",example:{title:"Note",message:"Your changes have been saved.",type:"success"}},Progress:{props:X({value:Ye(),max:Ye().nullable(),label:z().nullable()}),description:"Progress bar (value 0-100)",example:{value:65,max:100,label:"Upload progress"}},Skeleton:{props:X({width:z().nullable(),height:z().nullable(),rounded:mt().nullable()}),description:"Loading placeholder skeleton"},Spinner:{props:X({size:Ie(["sm","md","lg"]).nullable(),label:z().nullable()}),description:"Loading spinner indicator"},Tooltip:{props:X({content:z(),text:z()}),description:"Hover tooltip. Shows content on hover over text."},Popover:{props:X({trigger:z(),content:z()}),description:"Popover that appears on click of trigger."},Input:{props:X({label:z(),name:z(),type:Ie(["text","email","password","number"]).nullable(),placeholder:z().nullable(),value:z().nullable(),checks:jn,validateOn:On}),events:["submit","focus","blur"],description:"Text input field. Use { $bindState } on value for two-way binding. Use checks for validation (e.g. required, email, minLength). validateOn controls timing (default: blur).",example:{label:"Email",name:"email",type:"email",placeholder:"you@example.com"}},Textarea:{props:X({label:z(),name:z(),placeholder:z().nullable(),rows:Ye().nullable(),value:z().nullable(),checks:jn,validateOn:On}),description:"Multi-line text input. Use { $bindState } on value for binding. Use checks for validation. validateOn controls timing (default: blur)."},Select:{props:X({label:z(),name:z(),options:Ue(z()),placeholder:z().nullable(),value:z().nullable(),checks:jn,validateOn:On}),events:["change"],description:"Dropdown select input. Use { $bindState } on value for binding. Use checks for validation. validateOn controls timing (default: change)."},Checkbox:{props:X({label:z(),name:z(),checked:mt().nullable(),checks:jn,validateOn:On}),events:["change"],description:"Checkbox input. Use { $bindState } on checked for binding. Use checks for validation. validateOn controls timing (default: change)."},Radio:{props:X({label:z(),name:z(),options:Ue(z()),value:z().nullable(),checks:jn,validateOn:On}),events:["change"],description:"Radio button group. Use { $bindState } on value for binding. Use checks for validation. validateOn controls timing (default: change)."},Switch:{props:X({label:z(),name:z(),checked:mt().nullable(),checks:jn,validateOn:On}),events:["change"],description:"Toggle switch. Use { $bindState } on checked for binding. Use checks for validation. validateOn controls timing (default: change)."},Slider:{props:X({label:z().nullable(),min:Ye().nullable(),max:Ye().nullable(),step:Ye().nullable(),value:Ye().nullable()}),events:["change"],description:"Range slider input. Use { $bindState } on value for binding."},Button:{props:X({label:z(),variant:Ie(["primary","secondary","danger"]).nullable(),disabled:mt().nullable()}),events:["press"],description:"Clickable button. Bind on.press for handler.",example:{label:"Submit",variant:"primary"}},Link:{props:X({label:z(),href:z()}),events:["press"],description:"Anchor link. Bind on.press for click handler."},DropdownMenu:{props:X({label:z(),items:Ue(X({label:z(),value:z()})),value:z().nullable()}),events:["select"],description:"Dropdown menu with trigger button and selectable items. Use { $bindState } on value for selected item binding."},Toggle:{props:X({label:z(),pressed:mt().nullable(),variant:Ie(["default","outline"]).nullable()}),events:["change"],description:"Toggle button. Use { $bindState } on pressed for state binding."},ToggleGroup:{props:X({items:Ue(X({label:z(),value:z()})),type:Ie(["single","multiple"]).nullable(),value:z().nullable()}),events:["change"],description:"Group of toggle buttons. Type 'single' (default) or 'multiple'. Use { $bindState } on value."},ButtonGroup:{props:X({buttons:Ue(X({label:z(),value:z()})),selected:z().nullable()}),events:["change"],description:"Segmented button group. Use { $bindState } on selected for selected value."},Pagination:{props:X({totalPages:Ye(),page:Ye().nullable()}),events:["change"],description:"Page navigation. Use { $bindState } on page for current page number."}};function Cc(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Zo(...e){return t=>{let n=!1;const r=e.map(o=>{const i=Cc(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():Cc(e[o],null)}}}}function ae(...e){return m.useCallback(Zo(...e),e)}function Qt(e){const t=LT(e),n=m.forwardRef((r,o)=>{const{children:i,...a}=r,s=m.Children.toArray(i),l=s.find(BT);if(l){const c=l.props.children,d=s.map(u=>u===l?m.Children.count(c)>1?m.Children.only(null):m.isValidElement(c)?c.props.children:null:u);return f.jsx(t,{...a,ref:o,children:m.isValidElement(c)?m.cloneElement(c,void 0,d):null})}return f.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}var Kd=Qt("Slot");function LT(e){const t=m.forwardRef((n,r)=>{const{children:o,...i}=n;if(m.isValidElement(o)){const a=UT(o),s=VT(i,o.props);return o.type!==m.Fragment&&(s.ref=r?Zo(r,a):a),m.cloneElement(o,s)}return m.Children.count(o)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Jd=Symbol("radix.slottable");function FT(e){const t=({children:n})=>f.jsx(f.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Jd,t}function BT(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Jd}function VT(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{const l=i(...s);return o(...s),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function UT(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ZT=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],J=ZT.reduce((e,t)=>{const n=Qt(`Primitive.${t}`),r=m.forwardRef((o,i)=>{const{asChild:a,...s}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),f.jsx(l,{...s,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Yd(e,t){e&&Da.flushSync(()=>e.dispatchEvent(t))}var Xd=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),HT="VisuallyHidden",Qd=m.forwardRef((e,t)=>f.jsx(J.span,{...e,ref:t,style:{...Xd,...e.style}}));Qd.displayName=HT;var GT=Qd;function WT(e,t){const n=m.createContext(t),r=i=>{const{children:a,...s}=i,l=m.useMemo(()=>s,Object.values(s));return f.jsx(n.Provider,{value:l,children:a})};r.displayName=e+"Provider";function o(i){const a=m.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function Fe(e,t=[]){let n=[];function r(i,a){const s=m.createContext(a),l=n.length;n=[...n,a];const c=u=>{const{scope:p,children:h,...v}=u,g=p?.[e]?.[l]||s,b=m.useMemo(()=>v,Object.values(v));return f.jsx(g.Provider,{value:b,children:h})};c.displayName=i+"Provider";function d(u,p){const h=p?.[e]?.[l]||s,v=m.useContext(h);if(v)return v;if(a!==void 0)return a;throw new Error(`\`${u}\` must be used within \`${i}\``)}return[c,d]}const o=()=>{const i=n.map(a=>m.createContext(a));return function(s){const l=s?.[e]||i;return m.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return o.scopeName=e,[r,qT(o,...t)]}function qT(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const a=r.reduce((s,{useScope:l,scopeName:c})=>{const u=l(i)[`__scope${c}`];return{...s,...u}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function jr(e){const t=e+"CollectionProvider",[n,r]=Fe(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=g=>{const{scope:b,children:x}=g,y=L.useRef(null),w=L.useRef(new Map).current;return f.jsx(o,{scope:b,itemMap:w,collectionRef:y,children:x})};a.displayName=t;const s=e+"CollectionSlot",l=Qt(s),c=L.forwardRef((g,b)=>{const{scope:x,children:y}=g,w=i(s,x),S=ae(b,w.collectionRef);return f.jsx(l,{ref:S,children:y})});c.displayName=s;const d=e+"CollectionItemSlot",u="data-radix-collection-item",p=Qt(d),h=L.forwardRef((g,b)=>{const{scope:x,children:y,...w}=g,S=L.useRef(null),P=ae(b,S),C=i(d,x);return L.useEffect(()=>(C.itemMap.set(S,{ref:S,...w}),()=>{C.itemMap.delete(S)})),f.jsx(p,{[u]:"",ref:P,children:y})});h.displayName=d;function v(g){const b=i(e+"CollectionConsumer",g);return L.useCallback(()=>{const y=b.collectionRef.current;if(!y)return[];const w=Array.from(y.querySelectorAll(`[${u}]`));return Array.from(b.itemMap.values()).sort((C,T)=>w.indexOf(C.ref.current)-w.indexOf(T.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:a,Slot:c,ItemSlot:h},v,r]}function Z(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}var Le=globalThis?.document?m.useLayoutEffect:()=>{},KT=ru[" useInsertionEffect ".trim().toString()]||Le;function Ze({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,a]=JT({defaultProp:t,onChange:n}),s=e!==void 0,l=s?e:o;{const d=m.useRef(e!==void 0);m.useEffect(()=>{const u=d.current;u!==s&&console.warn(`${r} is changing from ${u?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=s},[s,r])}const c=m.useCallback(d=>{if(s){const u=YT(d)?d(e):d;u!==e&&a.current?.(u)}else i(d)},[s,e,i,a]);return[l,c]}function JT({defaultProp:e,onChange:t}){const[n,r]=m.useState(e),o=m.useRef(n),i=m.useRef(t);return KT(()=>{i.current=t},[t]),m.useEffect(()=>{o.current!==n&&(i.current?.(n),o.current=n)},[n,o]),[n,r,i]}function YT(e){return typeof e=="function"}function XT(e,t){return m.useReducer((n,r)=>t[n][r]??n,e)}var et=e=>{const{present:t,children:n}=e,r=QT(t),o=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),i=ae(r.ref,eP(o));return typeof n=="function"||r.isPresent?m.cloneElement(o,{ref:i}):null};et.displayName="Presence";function QT(e){const[t,n]=m.useState(),r=m.useRef(null),o=m.useRef(e),i=m.useRef("none"),a=e?"mounted":"unmounted",[s,l]=XT(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const c=no(r.current);i.current=s==="mounted"?c:"none"},[s]),Le(()=>{const c=r.current,d=o.current;if(d!==e){const p=i.current,h=no(c);e?l("MOUNT"):h==="none"||c?.display==="none"?l("UNMOUNT"):l(d&&p!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Le(()=>{if(t){let c;const d=t.ownerDocument.defaultView??window,u=h=>{const g=no(r.current).includes(CSS.escape(h.animationName));if(h.target===t&&g&&(l("ANIMATION_END"),!o.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",c=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},p=h=>{h.target===t&&(i.current=no(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{d.clearTimeout(c),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:m.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function no(e){return e?.animationName||"none"}function eP(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var tP=ru[" useId ".trim().toString()]||(()=>{}),nP=0;function at(e){const[t,n]=m.useState(tP());return Le(()=>{n(r=>r??String(nP++))},[e]),e||(t?`radix-${t}`:"")}var Ho="Collapsible",[rP,ef]=Fe(Ho),[oP,ds]=rP(Ho),tf=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:i,onOpenChange:a,...s}=e,[l,c]=Ze({prop:r,defaultProp:o??!1,onChange:a,caller:Ho});return f.jsx(oP,{scope:n,disabled:i,contentId:at(),open:l,onOpenToggle:m.useCallback(()=>c(d=>!d),[c]),children:f.jsx(J.div,{"data-state":ms(l),"data-disabled":i?"":void 0,...s,ref:t})})});tf.displayName=Ho;var nf="CollapsibleTrigger",fs=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=ds(nf,n);return f.jsx(J.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":ms(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...r,ref:t,onClick:Z(e.onClick,o.onOpenToggle)})});fs.displayName=nf;var ps="CollapsibleContent",hs=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ds(ps,e.__scopeCollapsible);return f.jsx(et,{present:n||o.open,children:({present:i})=>f.jsx(iP,{...r,ref:t,present:i})})});hs.displayName=ps;var iP=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...i}=e,a=ds(ps,n),[s,l]=m.useState(r),c=m.useRef(null),d=ae(t,c),u=m.useRef(0),p=u.current,h=m.useRef(0),v=h.current,g=a.open||s,b=m.useRef(g),x=m.useRef(void 0);return m.useEffect(()=>{const y=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(y)},[]),Le(()=>{const y=c.current;if(y){x.current=x.current||{transitionDuration:y.style.transitionDuration,animationName:y.style.animationName},y.style.transitionDuration="0s",y.style.animationName="none";const w=y.getBoundingClientRect();u.current=w.height,h.current=w.width,b.current||(y.style.transitionDuration=x.current.transitionDuration,y.style.animationName=x.current.animationName),l(r)}},[a.open,r]),f.jsx(J.div,{"data-state":ms(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!g,...i,ref:d,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...e.style},children:g&&o})});function ms(e){return e?"open":"closed"}var rf=tf,aP=fs,sP=hs,lP=m.createContext(void 0);function rn(e){const t=m.useContext(lP);return e||t||"ltr"}var Pt="Accordion",cP=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[gs,uP,dP]=jr(Pt),[Go]=Fe(Pt,[dP,ef]),vs=ef(),of=L.forwardRef((e,t)=>{const{type:n,...r}=e,o=r,i=r;return f.jsx(gs.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?f.jsx(mP,{...i,ref:t}):f.jsx(hP,{...o,ref:t})})});of.displayName=Pt;var[af,fP]=Go(Pt),[sf,pP]=Go(Pt,{collapsible:!1}),hP=L.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},collapsible:i=!1,...a}=e,[s,l]=Ze({prop:n,defaultProp:r??"",onChange:o,caller:Pt});return f.jsx(af,{scope:e.__scopeAccordion,value:L.useMemo(()=>s?[s]:[],[s]),onItemOpen:l,onItemClose:L.useCallback(()=>i&&l(""),[i,l]),children:f.jsx(sf,{scope:e.__scopeAccordion,collapsible:i,children:f.jsx(lf,{...a,ref:t})})})}),mP=L.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...i}=e,[a,s]=Ze({prop:n,defaultProp:r??[],onChange:o,caller:Pt}),l=L.useCallback(d=>s((u=[])=>[...u,d]),[s]),c=L.useCallback(d=>s((u=[])=>u.filter(p=>p!==d)),[s]);return f.jsx(af,{scope:e.__scopeAccordion,value:a,onItemOpen:l,onItemClose:c,children:f.jsx(sf,{scope:e.__scopeAccordion,collapsible:!0,children:f.jsx(lf,{...i,ref:t})})})}),[gP,Wo]=Go(Pt),lf=L.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:o,orientation:i="vertical",...a}=e,s=L.useRef(null),l=ae(s,t),c=uP(n),u=rn(o)==="ltr",p=Z(e.onKeyDown,h=>{if(!cP.includes(h.key))return;const v=h.target,g=c().filter(I=>!I.ref.current?.disabled),b=g.findIndex(I=>I.ref.current===v),x=g.length;if(b===-1)return;h.preventDefault();let y=b;const w=0,S=x-1,P=()=>{y=b+1,y>S&&(y=w)},C=()=>{y=b-1,y<w&&(y=S)};switch(h.key){case"Home":y=w;break;case"End":y=S;break;case"ArrowRight":i==="horizontal"&&(u?P():C());break;case"ArrowDown":i==="vertical"&&P();break;case"ArrowLeft":i==="horizontal"&&(u?C():P());break;case"ArrowUp":i==="vertical"&&C();break}const T=y%x;g[T].ref.current?.focus()});return f.jsx(gP,{scope:n,disabled:r,direction:o,orientation:i,children:f.jsx(gs.Slot,{scope:n,children:f.jsx(J.div,{...a,"data-orientation":i,ref:l,onKeyDown:r?void 0:p})})})}),Eo="AccordionItem",[vP,xs]=Go(Eo),cf=L.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...o}=e,i=Wo(Eo,n),a=fP(Eo,n),s=vs(n),l=at(),c=r&&a.value.includes(r)||!1,d=i.disabled||e.disabled;return f.jsx(vP,{scope:n,open:c,disabled:d,triggerId:l,children:f.jsx(rf,{"data-orientation":i.orientation,"data-state":mf(c),...s,...o,ref:t,disabled:d,open:c,onOpenChange:u=>{u?a.onItemOpen(r):a.onItemClose(r)}})})});cf.displayName=Eo;var uf="AccordionHeader",df=L.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Wo(Pt,n),i=xs(uf,n);return f.jsx(J.h3,{"data-orientation":o.orientation,"data-state":mf(i.open),"data-disabled":i.disabled?"":void 0,...r,ref:t})});df.displayName=uf;var ga="AccordionTrigger",ff=L.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Wo(Pt,n),i=xs(ga,n),a=pP(ga,n),s=vs(n);return f.jsx(gs.ItemSlot,{scope:n,children:f.jsx(aP,{"aria-disabled":i.open&&!a.collapsible||void 0,"data-orientation":o.orientation,id:i.triggerId,...s,...r,ref:t})})});ff.displayName=ga;var pf="AccordionContent",hf=L.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Wo(Pt,n),i=xs(pf,n),a=vs(n);return f.jsx(sP,{role:"region","aria-labelledby":i.triggerId,"data-orientation":o.orientation,...a,...r,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});hf.displayName=pf;function mf(e){return e?"open":"closed"}var xP=of,bP=cf,yP=df,wP=ff,kP=hf;function Tt(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>t.current?.(...n),[])}function SP(e,t=globalThis?.document){const n=Tt(e);m.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var CP="DismissableLayer",va="dismissableLayer.update",_P="dismissableLayer.pointerDownOutside",EP="dismissableLayer.focusOutside",_c,gf=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),er=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:a,onDismiss:s,...l}=e,c=m.useContext(gf),[d,u]=m.useState(null),p=d?.ownerDocument??globalThis?.document,[,h]=m.useState({}),v=ae(t,T=>u(T)),g=Array.from(c.layers),[b]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),x=g.indexOf(b),y=d?g.indexOf(d):-1,w=c.layersWithOutsidePointerEventsDisabled.size>0,S=y>=x,P=NP(T=>{const I=T.target,R=[...c.branches].some(E=>E.contains(I));!S||R||(o?.(T),a?.(T),T.defaultPrevented||s?.())},p),C=IP(T=>{const I=T.target;[...c.branches].some(E=>E.contains(I))||(i?.(T),a?.(T),T.defaultPrevented||s?.())},p);return SP(T=>{y===c.layers.size-1&&(r?.(T),!T.defaultPrevented&&s&&(T.preventDefault(),s()))},p),m.useEffect(()=>{if(d)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(_c=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),Ec(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=_c)}},[d,p,n,c]),m.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),Ec())},[d,c]),m.useEffect(()=>{const T=()=>h({});return document.addEventListener(va,T),()=>document.removeEventListener(va,T)},[]),f.jsx(J.div,{...l,ref:v,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:Z(e.onFocusCapture,C.onFocusCapture),onBlurCapture:Z(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:Z(e.onPointerDownCapture,P.onPointerDownCapture)})});er.displayName=CP;var TP="DismissableLayerBranch",PP=m.forwardRef((e,t)=>{const n=m.useContext(gf),r=m.useRef(null),o=ae(t,r);return m.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),f.jsx(J.div,{...e,ref:o})});PP.displayName=TP;function NP(e,t=globalThis?.document){const n=Tt(e),r=m.useRef(!1),o=m.useRef(()=>{});return m.useEffect(()=>{const i=s=>{if(s.target&&!r.current){let l=function(){vf(_P,n,c,{discrete:!0})};const c={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function IP(e,t=globalThis?.document){const n=Tt(e),r=m.useRef(!1);return m.useEffect(()=>{const o=i=>{i.target&&!r.current&&vf(EP,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Ec(){const e=new CustomEvent(va);document.dispatchEvent(e)}function vf(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Yd(o,i):o.dispatchEvent(i)}var Vi="focusScope.autoFocusOnMount",Ui="focusScope.autoFocusOnUnmount",Tc={bubbles:!1,cancelable:!0},AP="FocusScope",Or=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...a}=e,[s,l]=m.useState(null),c=Tt(o),d=Tt(i),u=m.useRef(null),p=ae(t,g=>l(g)),h=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let g=function(w){if(h.paused||!s)return;const S=w.target;s.contains(S)?u.current=S:qt(u.current,{select:!0})},b=function(w){if(h.paused||!s)return;const S=w.relatedTarget;S!==null&&(s.contains(S)||qt(u.current,{select:!0}))},x=function(w){if(document.activeElement===document.body)for(const P of w)P.removedNodes.length>0&&qt(s)};document.addEventListener("focusin",g),document.addEventListener("focusout",b);const y=new MutationObserver(x);return s&&y.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",b),y.disconnect()}}},[r,s,h.paused]),m.useEffect(()=>{if(s){Nc.add(h);const g=document.activeElement;if(!s.contains(g)){const x=new CustomEvent(Vi,Tc);s.addEventListener(Vi,c),s.dispatchEvent(x),x.defaultPrevented||(RP($P(xf(s)),{select:!0}),document.activeElement===g&&qt(s))}return()=>{s.removeEventListener(Vi,c),setTimeout(()=>{const x=new CustomEvent(Ui,Tc);s.addEventListener(Ui,d),s.dispatchEvent(x),x.defaultPrevented||qt(g??document.body,{select:!0}),s.removeEventListener(Ui,d),Nc.remove(h)},0)}}},[s,c,d,h]);const v=m.useCallback(g=>{if(!n&&!r||h.paused)return;const b=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,x=document.activeElement;if(b&&x){const y=g.currentTarget,[w,S]=jP(y);w&&S?!g.shiftKey&&x===S?(g.preventDefault(),n&&qt(w,{select:!0})):g.shiftKey&&x===w&&(g.preventDefault(),n&&qt(S,{select:!0})):x===y&&g.preventDefault()}},[n,r,h.paused]);return f.jsx(J.div,{tabIndex:-1,...a,ref:p,onKeyDown:v})});Or.displayName=AP;function RP(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(qt(r,{select:t}),document.activeElement!==n)return}function jP(e){const t=xf(e),n=Pc(t,e),r=Pc(t.reverse(),e);return[n,r]}function xf(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Pc(e,t){for(const n of e)if(!OP(n,{upTo:t}))return n}function OP(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function MP(e){return e instanceof HTMLInputElement&&"select"in e}function qt(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&MP(e)&&t&&e.select()}}var Nc=DP();function DP(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Ic(e,t),e.unshift(t)},remove(t){e=Ic(e,t),e[0]?.resume()}}}function Ic(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function $P(e){return e.filter(t=>t.tagName!=="A")}var zP="Portal",tr=m.forwardRef((e,t)=>{const{container:n,...r}=e,[o,i]=m.useState(!1);Le(()=>i(!0),[]);const a=n||o&&globalThis?.document?.body;return a?xg.createPortal(f.jsx(J.div,{...r,ref:t}),a):null});tr.displayName=zP;var Zi=0;function qo(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Ac()),document.body.insertAdjacentElement("beforeend",e[1]??Ac()),Zi++,()=>{Zi===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Zi--}},[])}function Ac(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Ot=function(){return Ot=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Ot.apply(this,arguments)};function bf(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function LP(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var po="right-scroll-bar-position",ho="width-before-scroll-bar",FP="with-scroll-bars-hidden",BP="--removed-body-scroll-bar-size";function Hi(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function VP(e,t){var n=m.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var UP=typeof window<"u"?m.useLayoutEffect:m.useEffect,Rc=new WeakMap;function ZP(e,t){var n=VP(null,function(r){return e.forEach(function(o){return Hi(o,r)})});return UP(function(){var r=Rc.get(n);if(r){var o=new Set(r),i=new Set(e),a=n.current;o.forEach(function(s){i.has(s)||Hi(s,null)}),i.forEach(function(s){o.has(s)||Hi(s,a)})}Rc.set(n,e)},[e]),n}function HP(e){return e}function GP(e,t){t===void 0&&(t=HP);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var a=t(i,r);return n.push(a),function(){n=n.filter(function(s){return s!==a})}},assignSyncMedium:function(i){for(r=!0;n.length;){var a=n;n=[],a.forEach(i)}n={push:function(s){return i(s)},filter:function(){return n}}},assignMedium:function(i){r=!0;var a=[];if(n.length){var s=n;n=[],s.forEach(i),a=n}var l=function(){var d=a;a=[],d.forEach(i)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(d){a.push(d),c()},filter:function(d){return a=a.filter(d),n}}}};return o}function WP(e){e===void 0&&(e={});var t=GP(null);return t.options=Ot({async:!0,ssr:!1},e),t}var yf=function(e){var t=e.sideCar,n=bf(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return m.createElement(r,Ot({},n))};yf.isSideCarExport=!0;function qP(e,t){return e.useMedium(t),yf}var wf=WP(),Gi=function(){},Ko=m.forwardRef(function(e,t){var n=m.useRef(null),r=m.useState({onScrollCapture:Gi,onWheelCapture:Gi,onTouchMoveCapture:Gi}),o=r[0],i=r[1],a=e.forwardProps,s=e.children,l=e.className,c=e.removeScrollBar,d=e.enabled,u=e.shards,p=e.sideCar,h=e.noRelative,v=e.noIsolation,g=e.inert,b=e.allowPinchZoom,x=e.as,y=x===void 0?"div":x,w=e.gapMode,S=bf(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),P=p,C=ZP([n,t]),T=Ot(Ot({},S),o);return m.createElement(m.Fragment,null,d&&m.createElement(P,{sideCar:wf,removeScrollBar:c,shards:u,noRelative:h,noIsolation:v,inert:g,setCallbacks:i,allowPinchZoom:!!b,lockRef:n,gapMode:w}),a?m.cloneElement(m.Children.only(s),Ot(Ot({},T),{ref:C})):m.createElement(y,Ot({},T,{className:l,ref:C}),s))});Ko.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ko.classNames={fullWidth:ho,zeroRight:po};var KP=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function JP(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=KP();return t&&e.setAttribute("nonce",t),e}function YP(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function XP(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var QP=function(){var e=0,t=null;return{add:function(n){e==0&&(t=JP())&&(YP(t,n),XP(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},eN=function(){var e=QP();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},kf=function(){var e=eN(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},tN={left:0,top:0,right:0,gap:0},Wi=function(e){return parseInt(e||"",10)||0},nN=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Wi(n),Wi(r),Wi(o)]},rN=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return tN;var t=nN(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},oN=kf(),Hn="data-scroll-locked",iN=function(e,t,n,r){var o=e.left,i=e.top,a=e.right,s=e.gap;return n===void 0&&(n="margin"),`
73
+ .`.concat(FP,` {
74
+ overflow: hidden `).concat(r,`;
75
+ padding-right: `).concat(s,"px ").concat(r,`;
76
+ }
77
+ body[`).concat(Hn,`] {
78
+ overflow: hidden `).concat(r,`;
79
+ overscroll-behavior: contain;
80
+ `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
81
+ padding-left: `.concat(o,`px;
82
+ padding-top: `).concat(i,`px;
83
+ padding-right: `).concat(a,`px;
84
+ margin-left:0;
85
+ margin-top:0;
86
+ margin-right: `).concat(s,"px ").concat(r,`;
87
+ `),n==="padding"&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),`
88
+ }
89
+
90
+ .`).concat(po,` {
91
+ right: `).concat(s,"px ").concat(r,`;
92
+ }
93
+
94
+ .`).concat(ho,` {
95
+ margin-right: `).concat(s,"px ").concat(r,`;
96
+ }
97
+
98
+ .`).concat(po," .").concat(po,` {
99
+ right: 0 `).concat(r,`;
100
+ }
101
+
102
+ .`).concat(ho," .").concat(ho,` {
103
+ margin-right: 0 `).concat(r,`;
104
+ }
105
+
106
+ body[`).concat(Hn,`] {
107
+ `).concat(BP,": ").concat(s,`px;
108
+ }
109
+ `)},jc=function(){var e=parseInt(document.body.getAttribute(Hn)||"0",10);return isFinite(e)?e:0},aN=function(){m.useEffect(function(){return document.body.setAttribute(Hn,(jc()+1).toString()),function(){var e=jc()-1;e<=0?document.body.removeAttribute(Hn):document.body.setAttribute(Hn,e.toString())}},[])},sN=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;aN();var i=m.useMemo(function(){return rN(o)},[o]);return m.createElement(oN,{styles:iN(i,!t,o,n?"":"!important")})},xa=!1;if(typeof window<"u")try{var ro=Object.defineProperty({},"passive",{get:function(){return xa=!0,!0}});window.addEventListener("test",ro,ro),window.removeEventListener("test",ro,ro)}catch{xa=!1}var Mn=xa?{passive:!1}:!1,lN=function(e){return e.tagName==="TEXTAREA"},Sf=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!lN(e)&&n[t]==="visible")},cN=function(e){return Sf(e,"overflowY")},uN=function(e){return Sf(e,"overflowX")},Oc=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Cf(e,r);if(o){var i=_f(e,r),a=i[1],s=i[2];if(a>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},dN=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},fN=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Cf=function(e,t){return e==="v"?cN(t):uN(t)},_f=function(e,t){return e==="v"?dN(t):fN(t)},pN=function(e,t){return e==="h"&&t==="rtl"?-1:1},hN=function(e,t,n,r,o){var i=pN(e,window.getComputedStyle(t).direction),a=i*r,s=n.target,l=t.contains(s),c=!1,d=a>0,u=0,p=0;do{if(!s)break;var h=_f(e,s),v=h[0],g=h[1],b=h[2],x=g-b-i*v;(v||x)&&Cf(e,s)&&(u+=x,p+=v);var y=s.parentNode;s=y&&y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?y.host:y}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(d&&Math.abs(u)<1||!d&&Math.abs(p)<1)&&(c=!0),c},oo=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Mc=function(e){return[e.deltaX,e.deltaY]},Dc=function(e){return e&&"current"in e?e.current:e},mN=function(e,t){return e[0]===t[0]&&e[1]===t[1]},gN=function(e){return`
110
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
111
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
112
+ `)},vN=0,Dn=[];function xN(e){var t=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),o=m.useState(vN++)[0],i=m.useState(kf)[0],a=m.useRef(e);m.useEffect(function(){a.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var g=LP([e.lockRef.current],(e.shards||[]).map(Dc),!0).filter(Boolean);return g.forEach(function(b){return b.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),g.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var s=m.useCallback(function(g,b){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!a.current.allowPinchZoom;var x=oo(g),y=n.current,w="deltaX"in g?g.deltaX:y[0]-x[0],S="deltaY"in g?g.deltaY:y[1]-x[1],P,C=g.target,T=Math.abs(w)>Math.abs(S)?"h":"v";if("touches"in g&&T==="h"&&C.type==="range")return!1;var I=window.getSelection(),R=I&&I.anchorNode,E=R?R===C||R.contains(C):!1;if(E)return!1;var N=Oc(T,C);if(!N)return!0;if(N?P=T:(P=T==="v"?"h":"v",N=Oc(T,C)),!N)return!1;if(!r.current&&"changedTouches"in g&&(w||S)&&(r.current=P),!P)return!0;var A=r.current||P;return hN(A,b,g,A==="h"?w:S)},[]),l=m.useCallback(function(g){var b=g;if(!(!Dn.length||Dn[Dn.length-1]!==i)){var x="deltaY"in b?Mc(b):oo(b),y=t.current.filter(function(P){return P.name===b.type&&(P.target===b.target||b.target===P.shadowParent)&&mN(P.delta,x)})[0];if(y&&y.should){b.cancelable&&b.preventDefault();return}if(!y){var w=(a.current.shards||[]).map(Dc).filter(Boolean).filter(function(P){return P.contains(b.target)}),S=w.length>0?s(b,w[0]):!a.current.noIsolation;S&&b.cancelable&&b.preventDefault()}}},[]),c=m.useCallback(function(g,b,x,y){var w={name:g,delta:b,target:x,should:y,shadowParent:bN(x)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(S){return S!==w})},1)},[]),d=m.useCallback(function(g){n.current=oo(g),r.current=void 0},[]),u=m.useCallback(function(g){c(g.type,Mc(g),g.target,s(g,e.lockRef.current))},[]),p=m.useCallback(function(g){c(g.type,oo(g),g.target,s(g,e.lockRef.current))},[]);m.useEffect(function(){return Dn.push(i),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:p}),document.addEventListener("wheel",l,Mn),document.addEventListener("touchmove",l,Mn),document.addEventListener("touchstart",d,Mn),function(){Dn=Dn.filter(function(g){return g!==i}),document.removeEventListener("wheel",l,Mn),document.removeEventListener("touchmove",l,Mn),document.removeEventListener("touchstart",d,Mn)}},[]);var h=e.removeScrollBar,v=e.inert;return m.createElement(m.Fragment,null,v?m.createElement(i,{styles:gN(o)}):null,h?m.createElement(sN,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function bN(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const yN=qP(wf,xN);var Mr=m.forwardRef(function(e,t){return m.createElement(Ko,Ot({},e,{ref:t,sideCar:yN}))});Mr.classNames=Ko.classNames;var wN=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},$n=new WeakMap,io=new WeakMap,ao={},qi=0,Ef=function(e){return e&&(e.host||Ef(e.parentNode))},kN=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Ef(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},SN=function(e,t,n,r){var o=kN(t,Array.isArray(e)?e:[e]);ao[n]||(ao[n]=new WeakMap);var i=ao[n],a=[],s=new Set,l=new Set(o),c=function(u){!u||s.has(u)||(s.add(u),c(u.parentNode))};o.forEach(c);var d=function(u){!u||l.has(u)||Array.prototype.forEach.call(u.children,function(p){if(s.has(p))d(p);else try{var h=p.getAttribute(r),v=h!==null&&h!=="false",g=($n.get(p)||0)+1,b=(i.get(p)||0)+1;$n.set(p,g),i.set(p,b),a.push(p),g===1&&v&&io.set(p,!0),b===1&&p.setAttribute(n,"true"),v||p.setAttribute(r,"true")}catch(x){console.error("aria-hidden: cannot operate on ",p,x)}})};return d(t),s.clear(),qi++,function(){a.forEach(function(u){var p=$n.get(u)-1,h=i.get(u)-1;$n.set(u,p),i.set(u,h),p||(io.has(u)||u.removeAttribute(r),io.delete(u)),h||u.removeAttribute(n)}),qi--,qi||($n=new WeakMap,$n=new WeakMap,io=new WeakMap,ao={})}},Jo=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=wN(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),SN(r,o,n,"aria-hidden")):function(){return null}},Yo="Dialog",[Tf]=Fe(Yo),[CN,Nt]=Tf(Yo),Pf=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:a=!0}=e,s=m.useRef(null),l=m.useRef(null),[c,d]=Ze({prop:r,defaultProp:o??!1,onChange:i,caller:Yo});return f.jsx(CN,{scope:t,triggerRef:s,contentRef:l,contentId:at(),titleId:at(),descriptionId:at(),open:c,onOpenChange:d,onOpenToggle:m.useCallback(()=>d(u=>!u),[d]),modal:a,children:n})};Pf.displayName=Yo;var Nf="DialogTrigger",_N=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Nt(Nf,n),i=ae(t,o.triggerRef);return f.jsx(J.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":ws(o.open),...r,ref:i,onClick:Z(e.onClick,o.onOpenToggle)})});_N.displayName=Nf;var bs="DialogPortal",[EN,If]=Tf(bs,{forceMount:void 0}),Af=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=Nt(bs,t);return f.jsx(EN,{scope:t,forceMount:n,children:m.Children.map(r,a=>f.jsx(et,{present:n||i.open,children:f.jsx(tr,{asChild:!0,container:o,children:a})}))})};Af.displayName=bs;var To="DialogOverlay",Rf=m.forwardRef((e,t)=>{const n=If(To,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Nt(To,e.__scopeDialog);return i.modal?f.jsx(et,{present:r||i.open,children:f.jsx(PN,{...o,ref:t})}):null});Rf.displayName=To;var TN=Qt("DialogOverlay.RemoveScroll"),PN=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Nt(To,n);return f.jsx(Mr,{as:TN,allowPinchZoom:!0,shards:[o.contentRef],children:f.jsx(J.div,{"data-state":ws(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),yn="DialogContent",jf=m.forwardRef((e,t)=>{const n=If(yn,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Nt(yn,e.__scopeDialog);return f.jsx(et,{present:r||i.open,children:i.modal?f.jsx(NN,{...o,ref:t}):f.jsx(IN,{...o,ref:t})})});jf.displayName=yn;var NN=m.forwardRef((e,t)=>{const n=Nt(yn,e.__scopeDialog),r=m.useRef(null),o=ae(t,n.contentRef,r);return m.useEffect(()=>{const i=r.current;if(i)return Jo(i)},[]),f.jsx(Of,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Z(e.onCloseAutoFocus,i=>{i.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Z(e.onPointerDownOutside,i=>{const a=i.detail.originalEvent,s=a.button===0&&a.ctrlKey===!0;(a.button===2||s)&&i.preventDefault()}),onFocusOutside:Z(e.onFocusOutside,i=>i.preventDefault())})}),IN=m.forwardRef((e,t)=>{const n=Nt(yn,e.__scopeDialog),r=m.useRef(!1),o=m.useRef(!1);return f.jsx(Of,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(r.current||n.triggerRef.current?.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const a=i.target;n.triggerRef.current?.contains(a)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),Of=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...a}=e,s=Nt(yn,n),l=m.useRef(null),c=ae(t,l);return qo(),f.jsxs(f.Fragment,{children:[f.jsx(Or,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:f.jsx(er,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":ws(s.open),...a,ref:c,onDismiss:()=>s.onOpenChange(!1)})}),f.jsxs(f.Fragment,{children:[f.jsx(AN,{titleId:s.titleId}),f.jsx(jN,{contentRef:l,descriptionId:s.descriptionId})]})]})}),ys="DialogTitle",Mf=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Nt(ys,n);return f.jsx(J.h2,{id:o.titleId,...r,ref:t})});Mf.displayName=ys;var Df="DialogDescription",$f=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Nt(Df,n);return f.jsx(J.p,{id:o.descriptionId,...r,ref:t})});$f.displayName=Df;var zf="DialogClose",Lf=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Nt(zf,n);return f.jsx(J.button,{type:"button",...r,ref:t,onClick:Z(e.onClick,()=>o.onOpenChange(!1))})});Lf.displayName=zf;function ws(e){return e?"open":"closed"}var Ff="DialogTitleWarning",[N$,Bf]=WT(Ff,{contentName:yn,titleName:ys,docsSlug:"dialog"}),AN=({titleId:e})=>{const t=Bf(Ff),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
113
+
114
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
115
+
116
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return m.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},RN="DialogDescriptionWarning",jN=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Bf(RN).contentName}}.`;return m.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Vf=Pf,Uf=Af,Zf=Rf,Hf=jf,Gf=Mf,Wf=$f,ON=Lf;function MN(){return bg.useSyncExternalStore(DN,()=>!0,()=>!1)}function DN(){return()=>{}}var ks="Avatar",[$N]=Fe(ks),[zN,qf]=$N(ks),Kf=m.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[o,i]=m.useState("idle");return f.jsx(zN,{scope:n,imageLoadingStatus:o,onImageLoadingStatusChange:i,children:f.jsx(J.span,{...r,ref:t})})});Kf.displayName=ks;var Jf="AvatarImage",Yf=m.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:o=()=>{},...i}=e,a=qf(Jf,n),s=LN(r,i),l=Tt(c=>{o(c),a.onImageLoadingStatusChange(c)});return Le(()=>{s!=="idle"&&l(s)},[s,l]),s==="loaded"?f.jsx(J.img,{...i,ref:t,src:r}):null});Yf.displayName=Jf;var Xf="AvatarFallback",Qf=m.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...o}=e,i=qf(Xf,n),[a,s]=m.useState(r===void 0);return m.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>s(!0),r);return()=>window.clearTimeout(l)}},[r]),a&&i.imageLoadingStatus!=="loaded"?f.jsx(J.span,{...o,ref:t}):null});Qf.displayName=Xf;function $c(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function LN(e,{referrerPolicy:t,crossOrigin:n}){const r=MN(),o=m.useRef(null),i=r?(o.current||(o.current=new window.Image),o.current):null,[a,s]=m.useState(()=>$c(i,e));return Le(()=>{s($c(i,e))},[i,e]),Le(()=>{const l=u=>()=>{s(u)};if(!i)return;const c=l("loaded"),d=l("error");return i.addEventListener("load",c),i.addEventListener("error",d),t&&(i.referrerPolicy=t),typeof n=="string"&&(i.crossOrigin=n),()=>{i.removeEventListener("load",c),i.removeEventListener("error",d)}},[i,n,t]),a}var FN=Kf,BN=Yf,VN=Qf;function Dr(e){const t=m.useRef({value:e,previous:e});return m.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function $r(e){const[t,n]=m.useState(void 0);return Le(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let a,s;if("borderBoxSize"in i){const l=i.borderBoxSize,c=Array.isArray(l)?l[0]:l;a=c.inlineSize,s=c.blockSize}else a=e.offsetWidth,s=e.offsetHeight;n({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Xo="Checkbox",[UN]=Fe(Xo),[ZN,Ss]=UN(Xo);function HN(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:o,disabled:i,form:a,name:s,onCheckedChange:l,required:c,value:d="on",internal_do_not_use_render:u}=e,[p,h]=Ze({prop:n,defaultProp:o??!1,onChange:l,caller:Xo}),[v,g]=m.useState(null),[b,x]=m.useState(null),y=m.useRef(!1),w=v?!!a||!!v.closest("form"):!0,S={checked:p,disabled:i,setChecked:h,control:v,setControl:g,name:s,form:a,value:d,hasConsumerStoppedPropagationRef:y,required:c,defaultChecked:Jt(o)?!1:o,isFormControl:w,bubbleInput:b,setBubbleInput:x};return f.jsx(ZN,{scope:t,...S,children:GN(u)?u(S):r})}var ep="CheckboxTrigger",tp=m.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},o)=>{const{control:i,value:a,disabled:s,checked:l,required:c,setControl:d,setChecked:u,hasConsumerStoppedPropagationRef:p,isFormControl:h,bubbleInput:v}=Ss(ep,e),g=ae(o,d),b=m.useRef(l);return m.useEffect(()=>{const x=i?.form;if(x){const y=()=>u(b.current);return x.addEventListener("reset",y),()=>x.removeEventListener("reset",y)}},[i,u]),f.jsx(J.button,{type:"button",role:"checkbox","aria-checked":Jt(l)?"mixed":l,"aria-required":c,"data-state":sp(l),"data-disabled":s?"":void 0,disabled:s,value:a,...r,ref:g,onKeyDown:Z(t,x=>{x.key==="Enter"&&x.preventDefault()}),onClick:Z(n,x=>{u(y=>Jt(y)?!0:!y),v&&h&&(p.current=x.isPropagationStopped(),p.current||x.stopPropagation())})})});tp.displayName=ep;var np=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:i,required:a,disabled:s,value:l,onCheckedChange:c,form:d,...u}=e;return f.jsx(HN,{__scopeCheckbox:n,checked:o,defaultChecked:i,disabled:s,required:a,onCheckedChange:c,name:r,form:d,value:l,internal_do_not_use_render:({isFormControl:p})=>f.jsxs(f.Fragment,{children:[f.jsx(tp,{...u,ref:t,__scopeCheckbox:n}),p&&f.jsx(ap,{__scopeCheckbox:n})]})})});np.displayName=Xo;var rp="CheckboxIndicator",op=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,i=Ss(rp,n);return f.jsx(et,{present:r||Jt(i.checked)||i.checked===!0,children:f.jsx(J.span,{"data-state":sp(i.checked),"data-disabled":i.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});op.displayName=rp;var ip="CheckboxBubbleInput",ap=m.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:o,checked:i,defaultChecked:a,required:s,disabled:l,name:c,value:d,form:u,bubbleInput:p,setBubbleInput:h}=Ss(ip,e),v=ae(n,h),g=Dr(i),b=$r(r);m.useEffect(()=>{const y=p;if(!y)return;const w=window.HTMLInputElement.prototype,P=Object.getOwnPropertyDescriptor(w,"checked").set,C=!o.current;if(g!==i&&P){const T=new Event("click",{bubbles:C});y.indeterminate=Jt(i),P.call(y,Jt(i)?!1:i),y.dispatchEvent(T)}},[p,g,i,o]);const x=m.useRef(Jt(i)?!1:i);return f.jsx(J.input,{type:"checkbox","aria-hidden":!0,defaultChecked:a??x.current,required:s,disabled:l,name:c,value:d,form:u,...t,tabIndex:-1,ref:v,style:{...t.style,...b,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});ap.displayName=ip;function GN(e){return typeof e=="function"}function Jt(e){return e==="indeterminate"}function sp(e){return Jt(e)?"indeterminate":e?"checked":"unchecked"}var WN="Arrow",lp=m.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return f.jsx(J.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:f.jsx("polygon",{points:"0,0 30,0 15,10"})})});lp.displayName=WN;var qN=lp,Cs="Popper",[cp,on]=Fe(Cs),[KN,up]=cp(Cs),dp=e=>{const{__scopePopper:t,children:n}=e,[r,o]=m.useState(null);return f.jsx(KN,{scope:t,anchor:r,onAnchorChange:o,children:n})};dp.displayName=Cs;var fp="PopperAnchor",pp=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=up(fp,n),a=m.useRef(null),s=ae(t,a),l=m.useRef(null);return m.useEffect(()=>{const c=l.current;l.current=r?.current||a.current,c!==l.current&&i.onAnchorChange(l.current)}),r?null:f.jsx(J.div,{...o,ref:s})});pp.displayName=fp;var _s="PopperContent",[JN,YN]=cp(_s),hp=m.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:a=0,arrowPadding:s=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:d=0,sticky:u="partial",hideWhenDetached:p=!1,updatePositionStrategy:h="optimized",onPlaced:v,...g}=e,b=up(_s,n),[x,y]=m.useState(null),w=ae(t,U=>y(U)),[S,P]=m.useState(null),C=$r(S),T=C?.width??0,I=C?.height??0,R=r+(i!=="center"?"-"+i:""),E=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},N=Array.isArray(c)?c:[c],A=N.length>0,j={padding:E,boundary:N.filter(QN),altBoundary:A},{refs:$,floatingStyles:O,placement:B,isPositioned:W,middlewareData:Y}=yg({strategy:"fixed",placement:R,whileElementsMounted:(...U)=>Tg(...U,{animationFrame:h==="always"}),elements:{reference:b.anchor},middleware:[wg({mainAxis:o+I,alignmentAxis:a}),l&&kg({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?Pg():void 0,...j}),l&&Sg({...j}),Cg({...j,apply:({elements:U,rects:te,availableWidth:me,availableHeight:ie})=>{const{width:Q,height:G}=te.reference,se=U.floating.style;se.setProperty("--radix-popper-available-width",`${me}px`),se.setProperty("--radix-popper-available-height",`${ie}px`),se.setProperty("--radix-popper-anchor-width",`${Q}px`),se.setProperty("--radix-popper-anchor-height",`${G}px`)}}),S&&_g({element:S,padding:s}),eI({arrowWidth:T,arrowHeight:I}),p&&Eg({strategy:"referenceHidden",...j})]}),[V,k]=vp(B),le=Tt(v);Le(()=>{W&&le?.()},[W,le]);const be=Y.arrow?.x,_=Y.arrow?.y,fe=Y.arrow?.centerOffset!==0,[ke,ce]=m.useState();return Le(()=>{x&&ce(window.getComputedStyle(x).zIndex)},[x]),f.jsx("div",{ref:$.setFloating,"data-radix-popper-content-wrapper":"",style:{...O,transform:W?O.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ke,"--radix-popper-transform-origin":[Y.transformOrigin?.x,Y.transformOrigin?.y].join(" "),...Y.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:f.jsx(JN,{scope:n,placedSide:V,onArrowChange:P,arrowX:be,arrowY:_,shouldHideArrow:fe,children:f.jsx(J.div,{"data-side":V,"data-align":k,...g,ref:w,style:{...g.style,animation:W?void 0:"none"}})})})});hp.displayName=_s;var mp="PopperArrow",XN={top:"bottom",right:"left",bottom:"top",left:"right"},gp=m.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=YN(mp,r),a=XN[i.placedSide];return f.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:f.jsx(qN,{...o,ref:n,style:{...o.style,display:"block"}})})});gp.displayName=mp;function QN(e){return e!==null}var eI=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,a=o.arrow?.centerOffset!==0,s=a?0:e.arrowWidth,l=a?0:e.arrowHeight,[c,d]=vp(n),u={start:"0%",center:"50%",end:"100%"}[d],p=(o.arrow?.x??0)+s/2,h=(o.arrow?.y??0)+l/2;let v="",g="";return c==="bottom"?(v=a?u:`${p}px`,g=`${-l}px`):c==="top"?(v=a?u:`${p}px`,g=`${r.floating.height+l}px`):c==="right"?(v=`${-l}px`,g=a?u:`${h}px`):c==="left"&&(v=`${r.floating.width+l}px`,g=a?u:`${h}px`),{data:{x:v,y:g}}}});function vp(e){const[t,n="center"]=e.split("-");return[t,n]}var Qo=dp,zr=pp,ei=hp,ti=gp,Ki="rovingFocusGroup.onEntryFocus",tI={bubbles:!1,cancelable:!0},Lr="RovingFocusGroup",[ba,xp,nI]=jr(Lr),[rI,an]=Fe(Lr,[nI]),[oI,iI]=rI(Lr),bp=m.forwardRef((e,t)=>f.jsx(ba.Provider,{scope:e.__scopeRovingFocusGroup,children:f.jsx(ba.Slot,{scope:e.__scopeRovingFocusGroup,children:f.jsx(aI,{...e,ref:t})})}));bp.displayName=Lr;var aI=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:d=!1,...u}=e,p=m.useRef(null),h=ae(t,p),v=rn(i),[g,b]=Ze({prop:a,defaultProp:s??null,onChange:l,caller:Lr}),[x,y]=m.useState(!1),w=Tt(c),S=xp(n),P=m.useRef(!1),[C,T]=m.useState(0);return m.useEffect(()=>{const I=p.current;if(I)return I.addEventListener(Ki,w),()=>I.removeEventListener(Ki,w)},[w]),f.jsx(oI,{scope:n,orientation:r,dir:v,loop:o,currentTabStopId:g,onItemFocus:m.useCallback(I=>b(I),[b]),onItemShiftTab:m.useCallback(()=>y(!0),[]),onFocusableItemAdd:m.useCallback(()=>T(I=>I+1),[]),onFocusableItemRemove:m.useCallback(()=>T(I=>I-1),[]),children:f.jsx(J.div,{tabIndex:x||C===0?-1:0,"data-orientation":r,...u,ref:h,style:{outline:"none",...e.style},onMouseDown:Z(e.onMouseDown,()=>{P.current=!0}),onFocus:Z(e.onFocus,I=>{const R=!P.current;if(I.target===I.currentTarget&&R&&!x){const E=new CustomEvent(Ki,tI);if(I.currentTarget.dispatchEvent(E),!E.defaultPrevented){const N=S().filter(B=>B.focusable),A=N.find(B=>B.active),j=N.find(B=>B.id===g),O=[A,j,...N].filter(Boolean).map(B=>B.ref.current);kp(O,d)}}P.current=!1}),onBlur:Z(e.onBlur,()=>y(!1))})})}),yp="RovingFocusGroupItem",wp=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,children:a,...s}=e,l=at(),c=i||l,d=iI(yp,n),u=d.currentTabStopId===c,p=xp(n),{onFocusableItemAdd:h,onFocusableItemRemove:v,currentTabStopId:g}=d;return m.useEffect(()=>{if(r)return h(),()=>v()},[r,h,v]),f.jsx(ba.ItemSlot,{scope:n,id:c,focusable:r,active:o,children:f.jsx(J.span,{tabIndex:u?0:-1,"data-orientation":d.orientation,...s,ref:t,onMouseDown:Z(e.onMouseDown,b=>{r?d.onItemFocus(c):b.preventDefault()}),onFocus:Z(e.onFocus,()=>d.onItemFocus(c)),onKeyDown:Z(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){d.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const x=cI(b,d.orientation,d.dir);if(x!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let w=p().filter(S=>S.focusable).map(S=>S.ref.current);if(x==="last")w.reverse();else if(x==="prev"||x==="next"){x==="prev"&&w.reverse();const S=w.indexOf(b.currentTarget);w=d.loop?uI(w,S+1):w.slice(S+1)}setTimeout(()=>kp(w))}}),children:typeof a=="function"?a({isCurrentTabStop:u,hasTabStop:g!=null}):a})})});wp.displayName=yp;var sI={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function lI(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function cI(e,t,n){const r=lI(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return sI[r]}function kp(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function uI(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var ni=bp,ri=wp,ya=["Enter"," "],dI=["ArrowDown","PageUp","Home"],Sp=["ArrowUp","PageDown","End"],fI=[...dI,...Sp],pI={ltr:[...ya,"ArrowRight"],rtl:[...ya,"ArrowLeft"]},hI={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Fr="Menu",[Sr,mI,gI]=jr(Fr),[En,Cp]=Fe(Fr,[gI,on,an]),oi=on(),_p=an(),[vI,Tn]=En(Fr),[xI,Br]=En(Fr),Ep=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:a=!0}=e,s=oi(t),[l,c]=m.useState(null),d=m.useRef(!1),u=Tt(i),p=rn(o);return m.useEffect(()=>{const h=()=>{d.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>d.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),f.jsx(Qo,{...s,children:f.jsx(vI,{scope:t,open:n,onOpenChange:u,content:l,onContentChange:c,children:f.jsx(xI,{scope:t,onClose:m.useCallback(()=>u(!1),[u]),isUsingKeyboardRef:d,dir:p,modal:a,children:r})})})};Ep.displayName=Fr;var bI="MenuAnchor",Es=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=oi(n);return f.jsx(zr,{...o,...r,ref:t})});Es.displayName=bI;var Ts="MenuPortal",[yI,Tp]=En(Ts,{forceMount:void 0}),Pp=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=Tn(Ts,t);return f.jsx(yI,{scope:t,forceMount:n,children:f.jsx(et,{present:n||i.open,children:f.jsx(tr,{asChild:!0,container:o,children:r})})})};Pp.displayName=Ts;var vt="MenuContent",[wI,Ps]=En(vt),Np=m.forwardRef((e,t)=>{const n=Tp(vt,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Tn(vt,e.__scopeMenu),a=Br(vt,e.__scopeMenu);return f.jsx(Sr.Provider,{scope:e.__scopeMenu,children:f.jsx(et,{present:r||i.open,children:f.jsx(Sr.Slot,{scope:e.__scopeMenu,children:a.modal?f.jsx(kI,{...o,ref:t}):f.jsx(SI,{...o,ref:t})})})})}),kI=m.forwardRef((e,t)=>{const n=Tn(vt,e.__scopeMenu),r=m.useRef(null),o=ae(t,r);return m.useEffect(()=>{const i=r.current;if(i)return Jo(i)},[]),f.jsx(Ns,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Z(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),SI=m.forwardRef((e,t)=>{const n=Tn(vt,e.__scopeMenu);return f.jsx(Ns,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),CI=Qt("MenuContent.ScrollLock"),Ns=m.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:u,onInteractOutside:p,onDismiss:h,disableOutsideScroll:v,...g}=e,b=Tn(vt,n),x=Br(vt,n),y=oi(n),w=_p(n),S=mI(n),[P,C]=m.useState(null),T=m.useRef(null),I=ae(t,T,b.onContentChange),R=m.useRef(0),E=m.useRef(""),N=m.useRef(0),A=m.useRef(null),j=m.useRef("right"),$=m.useRef(0),O=v?Mr:m.Fragment,B=v?{as:CI,allowPinchZoom:!0}:void 0,W=V=>{const k=E.current+V,le=S().filter(U=>!U.disabled),be=document.activeElement,_=le.find(U=>U.ref.current===be)?.textValue,fe=le.map(U=>U.textValue),ke=DI(fe,k,_),ce=le.find(U=>U.textValue===ke)?.ref.current;(function U(te){E.current=te,window.clearTimeout(R.current),te!==""&&(R.current=window.setTimeout(()=>U(""),1e3))})(k),ce&&setTimeout(()=>ce.focus())};m.useEffect(()=>()=>window.clearTimeout(R.current),[]),qo();const Y=m.useCallback(V=>j.current===A.current?.side&&zI(V,A.current?.area),[]);return f.jsx(wI,{scope:n,searchRef:E,onItemEnter:m.useCallback(V=>{Y(V)&&V.preventDefault()},[Y]),onItemLeave:m.useCallback(V=>{Y(V)||(T.current?.focus(),C(null))},[Y]),onTriggerLeave:m.useCallback(V=>{Y(V)&&V.preventDefault()},[Y]),pointerGraceTimerRef:N,onPointerGraceIntentChange:m.useCallback(V=>{A.current=V},[]),children:f.jsx(O,{...B,children:f.jsx(Or,{asChild:!0,trapped:o,onMountAutoFocus:Z(i,V=>{V.preventDefault(),T.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:f.jsx(er,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:u,onInteractOutside:p,onDismiss:h,children:f.jsx(ni,{asChild:!0,...w,dir:x.dir,orientation:"vertical",loop:r,currentTabStopId:P,onCurrentTabStopIdChange:C,onEntryFocus:Z(l,V=>{x.isUsingKeyboardRef.current||V.preventDefault()}),preventScrollOnEntryFocus:!0,children:f.jsx(ei,{role:"menu","aria-orientation":"vertical","data-state":Hp(b.open),"data-radix-menu-content":"",dir:x.dir,...y,...g,ref:I,style:{outline:"none",...g.style},onKeyDown:Z(g.onKeyDown,V=>{const le=V.target.closest("[data-radix-menu-content]")===V.currentTarget,be=V.ctrlKey||V.altKey||V.metaKey,_=V.key.length===1;le&&(V.key==="Tab"&&V.preventDefault(),!be&&_&&W(V.key));const fe=T.current;if(V.target!==fe||!fI.includes(V.key))return;V.preventDefault();const ce=S().filter(U=>!U.disabled).map(U=>U.ref.current);Sp.includes(V.key)&&ce.reverse(),OI(ce)}),onBlur:Z(e.onBlur,V=>{V.currentTarget.contains(V.target)||(window.clearTimeout(R.current),E.current="")}),onPointerMove:Z(e.onPointerMove,Cr(V=>{const k=V.target,le=$.current!==V.clientX;if(V.currentTarget.contains(k)&&le){const be=V.clientX>$.current?"right":"left";j.current=be,$.current=V.clientX}}))})})})})})})});Np.displayName=vt;var _I="MenuGroup",Is=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return f.jsx(J.div,{role:"group",...r,ref:t})});Is.displayName=_I;var EI="MenuLabel",Ip=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return f.jsx(J.div,{...r,ref:t})});Ip.displayName=EI;var Po="MenuItem",zc="menu.itemSelect",ii=m.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=m.useRef(null),a=Br(Po,e.__scopeMenu),s=Ps(Po,e.__scopeMenu),l=ae(t,i),c=m.useRef(!1),d=()=>{const u=i.current;if(!n&&u){const p=new CustomEvent(zc,{bubbles:!0,cancelable:!0});u.addEventListener(zc,h=>r?.(h),{once:!0}),Yd(u,p),p.defaultPrevented?c.current=!1:a.onClose()}};return f.jsx(Ap,{...o,ref:l,disabled:n,onClick:Z(e.onClick,d),onPointerDown:u=>{e.onPointerDown?.(u),c.current=!0},onPointerUp:Z(e.onPointerUp,u=>{c.current||u.currentTarget?.click()}),onKeyDown:Z(e.onKeyDown,u=>{const p=s.searchRef.current!=="";n||p&&u.key===" "||ya.includes(u.key)&&(u.currentTarget.click(),u.preventDefault())})})});ii.displayName=Po;var Ap=m.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,a=Ps(Po,n),s=_p(n),l=m.useRef(null),c=ae(t,l),[d,u]=m.useState(!1),[p,h]=m.useState("");return m.useEffect(()=>{const v=l.current;v&&h((v.textContent??"").trim())},[i.children]),f.jsx(Sr.ItemSlot,{scope:n,disabled:r,textValue:o??p,children:f.jsx(ri,{asChild:!0,...s,focusable:!r,children:f.jsx(J.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:c,onPointerMove:Z(e.onPointerMove,Cr(v=>{r?a.onItemLeave(v):(a.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Z(e.onPointerLeave,Cr(v=>a.onItemLeave(v))),onFocus:Z(e.onFocus,()=>u(!0)),onBlur:Z(e.onBlur,()=>u(!1))})})})}),TI="MenuCheckboxItem",Rp=m.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return f.jsx($p,{scope:e.__scopeMenu,checked:n,children:f.jsx(ii,{role:"menuitemcheckbox","aria-checked":No(n)?"mixed":n,...o,ref:t,"data-state":Rs(n),onSelect:Z(o.onSelect,()=>r?.(No(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Rp.displayName=TI;var jp="MenuRadioGroup",[PI,NI]=En(jp,{value:void 0,onValueChange:()=>{}}),Op=m.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,i=Tt(r);return f.jsx(PI,{scope:e.__scopeMenu,value:n,onValueChange:i,children:f.jsx(Is,{...o,ref:t})})});Op.displayName=jp;var Mp="MenuRadioItem",Dp=m.forwardRef((e,t)=>{const{value:n,...r}=e,o=NI(Mp,e.__scopeMenu),i=n===o.value;return f.jsx($p,{scope:e.__scopeMenu,checked:i,children:f.jsx(ii,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":Rs(i),onSelect:Z(r.onSelect,()=>o.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});Dp.displayName=Mp;var As="MenuItemIndicator",[$p,II]=En(As,{checked:!1}),zp=m.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=II(As,n);return f.jsx(et,{present:r||No(i.checked)||i.checked===!0,children:f.jsx(J.span,{...o,ref:t,"data-state":Rs(i.checked)})})});zp.displayName=As;var AI="MenuSeparator",Lp=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return f.jsx(J.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});Lp.displayName=AI;var RI="MenuArrow",Fp=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=oi(n);return f.jsx(ti,{...o,...r,ref:t})});Fp.displayName=RI;var jI="MenuSub",[I$,Bp]=En(jI),fr="MenuSubTrigger",Vp=m.forwardRef((e,t)=>{const n=Tn(fr,e.__scopeMenu),r=Br(fr,e.__scopeMenu),o=Bp(fr,e.__scopeMenu),i=Ps(fr,e.__scopeMenu),a=m.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:l}=i,c={__scopeMenu:e.__scopeMenu},d=m.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return m.useEffect(()=>d,[d]),m.useEffect(()=>{const u=s.current;return()=>{window.clearTimeout(u),l(null)}},[s,l]),f.jsx(Es,{asChild:!0,...c,children:f.jsx(Ap,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":Hp(n.open),...e,ref:Zo(t,o.onTriggerChange),onClick:u=>{e.onClick?.(u),!(e.disabled||u.defaultPrevented)&&(u.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Z(e.onPointerMove,Cr(u=>{i.onItemEnter(u),!u.defaultPrevented&&!e.disabled&&!n.open&&!a.current&&(i.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:Z(e.onPointerLeave,Cr(u=>{d();const p=n.content?.getBoundingClientRect();if(p){const h=n.content?.dataset.side,v=h==="right",g=v?-5:5,b=p[v?"left":"right"],x=p[v?"right":"left"];i.onPointerGraceIntentChange({area:[{x:u.clientX+g,y:u.clientY},{x:b,y:p.top},{x,y:p.top},{x,y:p.bottom},{x:b,y:p.bottom}],side:h}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(u),u.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:Z(e.onKeyDown,u=>{const p=i.searchRef.current!=="";e.disabled||p&&u.key===" "||pI[r.dir].includes(u.key)&&(n.onOpenChange(!0),n.content?.focus(),u.preventDefault())})})})});Vp.displayName=fr;var Up="MenuSubContent",Zp=m.forwardRef((e,t)=>{const n=Tp(vt,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Tn(vt,e.__scopeMenu),a=Br(vt,e.__scopeMenu),s=Bp(Up,e.__scopeMenu),l=m.useRef(null),c=ae(t,l);return f.jsx(Sr.Provider,{scope:e.__scopeMenu,children:f.jsx(et,{present:r||i.open,children:f.jsx(Sr.Slot,{scope:e.__scopeMenu,children:f.jsx(Ns,{id:s.contentId,"aria-labelledby":s.triggerId,...o,ref:c,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{a.isUsingKeyboardRef.current&&l.current?.focus(),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:Z(e.onFocusOutside,d=>{d.target!==s.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:Z(e.onEscapeKeyDown,d=>{a.onClose(),d.preventDefault()}),onKeyDown:Z(e.onKeyDown,d=>{const u=d.currentTarget.contains(d.target),p=hI[a.dir].includes(d.key);u&&p&&(i.onOpenChange(!1),s.trigger?.focus(),d.preventDefault())})})})})})});Zp.displayName=Up;function Hp(e){return e?"open":"closed"}function No(e){return e==="indeterminate"}function Rs(e){return No(e)?"indeterminate":e?"checked":"unchecked"}function OI(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function MI(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function DI(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let a=MI(e,Math.max(i,0));o.length===1&&(a=a.filter(c=>c!==n));const l=a.find(c=>c.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function $I(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,a=t.length-1;i<t.length;a=i++){const s=t[i],l=t[a],c=s.x,d=s.y,u=l.x,p=l.y;d>r!=p>r&&n<(u-c)*(r-d)/(p-d)+c&&(o=!o)}return o}function zI(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return $I(n,t)}function Cr(e){return t=>t.pointerType==="mouse"?e(t):void 0}var LI=Ep,FI=Es,BI=Pp,VI=Np,UI=Is,ZI=Ip,HI=ii,GI=Rp,WI=Op,qI=Dp,KI=zp,JI=Lp,YI=Fp,XI=Vp,QI=Zp,ai="DropdownMenu",[eA]=Fe(ai,[Cp]),ot=Cp(),[tA,Gp]=eA(ai),Wp=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:a,modal:s=!0}=e,l=ot(t),c=m.useRef(null),[d,u]=Ze({prop:o,defaultProp:i??!1,onChange:a,caller:ai});return f.jsx(tA,{scope:t,triggerId:at(),triggerRef:c,contentId:at(),open:d,onOpenChange:u,onOpenToggle:m.useCallback(()=>u(p=>!p),[u]),modal:s,children:f.jsx(LI,{...l,open:d,onOpenChange:u,dir:r,modal:s,children:n})})};Wp.displayName=ai;var qp="DropdownMenuTrigger",Kp=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=Gp(qp,n),a=ot(n);return f.jsx(FI,{asChild:!0,...a,children:f.jsx(J.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:Zo(t,i.triggerRef),onPointerDown:Z(e.onPointerDown,s=>{!r&&s.button===0&&s.ctrlKey===!1&&(i.onOpenToggle(),i.open||s.preventDefault())}),onKeyDown:Z(e.onKeyDown,s=>{r||(["Enter"," "].includes(s.key)&&i.onOpenToggle(),s.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(s.key)&&s.preventDefault())})})})});Kp.displayName=qp;var nA="DropdownMenuPortal",Jp=e=>{const{__scopeDropdownMenu:t,...n}=e,r=ot(t);return f.jsx(BI,{...r,...n})};Jp.displayName=nA;var Yp="DropdownMenuContent",Xp=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Gp(Yp,n),i=ot(n),a=m.useRef(!1);return f.jsx(VI,{id:o.contentId,"aria-labelledby":o.triggerId,...i,...r,ref:t,onCloseAutoFocus:Z(e.onCloseAutoFocus,s=>{a.current||o.triggerRef.current?.focus(),a.current=!1,s.preventDefault()}),onInteractOutside:Z(e.onInteractOutside,s=>{const l=s.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;(!o.modal||d)&&(a.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Xp.displayName=Yp;var rA="DropdownMenuGroup",oA=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return f.jsx(UI,{...o,...r,ref:t})});oA.displayName=rA;var iA="DropdownMenuLabel",aA=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return f.jsx(ZI,{...o,...r,ref:t})});aA.displayName=iA;var sA="DropdownMenuItem",Qp=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return f.jsx(HI,{...o,...r,ref:t})});Qp.displayName=sA;var lA="DropdownMenuCheckboxItem",cA=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return f.jsx(GI,{...o,...r,ref:t})});cA.displayName=lA;var uA="DropdownMenuRadioGroup",dA=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return f.jsx(WI,{...o,...r,ref:t})});dA.displayName=uA;var fA="DropdownMenuRadioItem",pA=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return f.jsx(qI,{...o,...r,ref:t})});pA.displayName=fA;var hA="DropdownMenuItemIndicator",mA=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return f.jsx(KI,{...o,...r,ref:t})});mA.displayName=hA;var gA="DropdownMenuSeparator",vA=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return f.jsx(JI,{...o,...r,ref:t})});vA.displayName=gA;var xA="DropdownMenuArrow",bA=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return f.jsx(YI,{...o,...r,ref:t})});bA.displayName=xA;var yA="DropdownMenuSubTrigger",wA=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return f.jsx(XI,{...o,...r,ref:t})});wA.displayName=yA;var kA="DropdownMenuSubContent",SA=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return f.jsx(QI,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});SA.displayName=kA;var CA=Wp,_A=Kp,EA=Jp,TA=Xp,PA=Qp,NA="Label",eh=m.forwardRef((e,t)=>f.jsx(J.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));eh.displayName=NA;var IA=eh;function Io(e,[t,n]){return Math.min(n,Math.max(t,e))}var si="Popover",[th]=Fe(si,[on]),Vr=on(),[AA,sn]=th(si),nh=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:a=!1}=e,s=Vr(t),l=m.useRef(null),[c,d]=m.useState(!1),[u,p]=Ze({prop:r,defaultProp:o??!1,onChange:i,caller:si});return f.jsx(Qo,{...s,children:f.jsx(AA,{scope:t,contentId:at(),triggerRef:l,open:u,onOpenChange:p,onOpenToggle:m.useCallback(()=>p(h=>!h),[p]),hasCustomAnchor:c,onCustomAnchorAdd:m.useCallback(()=>d(!0),[]),onCustomAnchorRemove:m.useCallback(()=>d(!1),[]),modal:a,children:n})})};nh.displayName=si;var rh="PopoverAnchor",RA=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=sn(rh,n),i=Vr(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:s}=o;return m.useEffect(()=>(a(),()=>s()),[a,s]),f.jsx(zr,{...i,...r,ref:t})});RA.displayName=rh;var oh="PopoverTrigger",ih=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=sn(oh,n),i=Vr(n),a=ae(t,o.triggerRef),s=f.jsx(J.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":uh(o.open),...r,ref:a,onClick:Z(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?s:f.jsx(zr,{asChild:!0,...i,children:s})});ih.displayName=oh;var js="PopoverPortal",[jA,OA]=th(js,{forceMount:void 0}),ah=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,i=sn(js,t);return f.jsx(jA,{scope:t,forceMount:n,children:f.jsx(et,{present:n||i.open,children:f.jsx(tr,{asChild:!0,container:o,children:r})})})};ah.displayName=js;var Kn="PopoverContent",sh=m.forwardRef((e,t)=>{const n=OA(Kn,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,i=sn(Kn,e.__scopePopover);return f.jsx(et,{present:r||i.open,children:i.modal?f.jsx(DA,{...o,ref:t}):f.jsx($A,{...o,ref:t})})});sh.displayName=Kn;var MA=Qt("PopoverContent.RemoveScroll"),DA=m.forwardRef((e,t)=>{const n=sn(Kn,e.__scopePopover),r=m.useRef(null),o=ae(t,r),i=m.useRef(!1);return m.useEffect(()=>{const a=r.current;if(a)return Jo(a)},[]),f.jsx(Mr,{as:MA,allowPinchZoom:!0,children:f.jsx(lh,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Z(e.onCloseAutoFocus,a=>{a.preventDefault(),i.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Z(e.onPointerDownOutside,a=>{const s=a.detail.originalEvent,l=s.button===0&&s.ctrlKey===!0,c=s.button===2||l;i.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:Z(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),$A=m.forwardRef((e,t)=>{const n=sn(Kn,e.__scopePopover),r=m.useRef(!1),o=m.useRef(!1);return f.jsx(lh,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(r.current||n.triggerRef.current?.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const a=i.target;n.triggerRef.current?.contains(a)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),lh=m.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:d,...u}=e,p=sn(Kn,n),h=Vr(n);return qo(),f.jsx(Or,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:f.jsx(er,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:d,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>p.onOpenChange(!1),children:f.jsx(ei,{"data-state":uh(p.open),role:"dialog",id:p.contentId,...h,...u,ref:t,style:{...u.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),ch="PopoverClose",zA=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=sn(ch,n);return f.jsx(J.button,{type:"button",...r,ref:t,onClick:Z(e.onClick,()=>o.onOpenChange(!1))})});zA.displayName=ch;var LA="PopoverArrow",FA=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Vr(n);return f.jsx(ti,{...o,...r,ref:t})});FA.displayName=LA;function uh(e){return e?"open":"closed"}var BA=nh,VA=ih,UA=ah,ZA=sh,Os="Progress",Ms=100,[HA]=Fe(Os),[GA,WA]=HA(Os),dh=m.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:o,getValueLabel:i=qA,...a}=e;(o||o===0)&&!Lc(o)&&console.error(KA(`${o}`,"Progress"));const s=Lc(o)?o:Ms;r!==null&&!Fc(r,s)&&console.error(JA(`${r}`,"Progress"));const l=Fc(r,s)?r:null,c=Ao(l)?i(l,s):void 0;return f.jsx(GA,{scope:n,value:l,max:s,children:f.jsx(J.div,{"aria-valuemax":s,"aria-valuemin":0,"aria-valuenow":Ao(l)?l:void 0,"aria-valuetext":c,role:"progressbar","data-state":hh(l,s),"data-value":l??void 0,"data-max":s,...a,ref:t})})});dh.displayName=Os;var fh="ProgressIndicator",ph=m.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,o=WA(fh,n);return f.jsx(J.div,{"data-state":hh(o.value,o.max),"data-value":o.value??void 0,"data-max":o.max,...r,ref:t})});ph.displayName=fh;function qA(e,t){return`${Math.round(e/t*100)}%`}function hh(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Ao(e){return typeof e=="number"}function Lc(e){return Ao(e)&&!isNaN(e)&&e>0}function Fc(e,t){return Ao(e)&&!isNaN(e)&&e<=t&&e>=0}function KA(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Ms}\`.`}function JA(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
117
+ - a positive number
118
+ - less than the value passed to \`max\` (or ${Ms} if no \`max\` prop is set)
119
+ - \`null\` or \`undefined\` if the progress is indeterminate.
120
+
121
+ Defaulting to \`null\`.`}var YA=dh,XA=ph,Ds="Radio",[QA,mh]=Fe(Ds),[eR,tR]=QA(Ds),gh=m.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:o=!1,required:i,disabled:a,value:s="on",onCheck:l,form:c,...d}=e,[u,p]=m.useState(null),h=ae(t,b=>p(b)),v=m.useRef(!1),g=u?c||!!u.closest("form"):!0;return f.jsxs(eR,{scope:n,checked:o,disabled:a,children:[f.jsx(J.button,{type:"button",role:"radio","aria-checked":o,"data-state":yh(o),"data-disabled":a?"":void 0,disabled:a,value:s,...d,ref:h,onClick:Z(e.onClick,b=>{o||l?.(),g&&(v.current=b.isPropagationStopped(),v.current||b.stopPropagation())})}),g&&f.jsx(bh,{control:u,bubbles:!v.current,name:r,value:s,checked:o,required:i,disabled:a,form:c,style:{transform:"translateX(-100%)"}})]})});gh.displayName=Ds;var vh="RadioIndicator",xh=m.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...o}=e,i=tR(vh,n);return f.jsx(et,{present:r||i.checked,children:f.jsx(J.span,{"data-state":yh(i.checked),"data-disabled":i.disabled?"":void 0,...o,ref:t})})});xh.displayName=vh;var nR="RadioBubbleInput",bh=m.forwardRef(({__scopeRadio:e,control:t,checked:n,bubbles:r=!0,...o},i)=>{const a=m.useRef(null),s=ae(a,i),l=Dr(n),c=$r(t);return m.useEffect(()=>{const d=a.current;if(!d)return;const u=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(u,"checked").set;if(l!==n&&h){const v=new Event("click",{bubbles:r});h.call(d,n),d.dispatchEvent(v)}},[l,n,r]),f.jsx(J.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:s,style:{...o.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});bh.displayName=nR;function yh(e){return e?"checked":"unchecked"}var rR=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],li="RadioGroup",[oR]=Fe(li,[an,mh]),wh=an(),kh=mh(),[iR,aR]=oR(li),Sh=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:o,value:i,required:a=!1,disabled:s=!1,orientation:l,dir:c,loop:d=!0,onValueChange:u,...p}=e,h=wh(n),v=rn(c),[g,b]=Ze({prop:i,defaultProp:o??null,onChange:u,caller:li});return f.jsx(iR,{scope:n,name:r,required:a,disabled:s,value:g,onValueChange:b,children:f.jsx(ni,{asChild:!0,...h,orientation:l,dir:v,loop:d,children:f.jsx(J.div,{role:"radiogroup","aria-required":a,"aria-orientation":l,"data-disabled":s?"":void 0,dir:v,...p,ref:t})})})});Sh.displayName=li;var Ch="RadioGroupItem",_h=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...o}=e,i=aR(Ch,n),a=i.disabled||r,s=wh(n),l=kh(n),c=m.useRef(null),d=ae(t,c),u=i.value===o.value,p=m.useRef(!1);return m.useEffect(()=>{const h=g=>{rR.includes(g.key)&&(p.current=!0)},v=()=>p.current=!1;return document.addEventListener("keydown",h),document.addEventListener("keyup",v),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",v)}},[]),f.jsx(ri,{asChild:!0,...s,focusable:!a,active:u,children:f.jsx(gh,{disabled:a,required:i.required,checked:u,...l,...o,name:i.name,ref:d,onCheck:()=>i.onValueChange(o.value),onKeyDown:Z(h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:Z(o.onFocus,()=>{p.current&&c.current?.click()})})})});_h.displayName=Ch;var sR="RadioGroupIndicator",Eh=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,o=kh(n);return f.jsx(xh,{...o,...r,ref:t})});Eh.displayName=sR;var lR=Sh,cR=_h,uR=Eh,dR=[" ","Enter","ArrowUp","ArrowDown"],fR=[" ","Enter"],wn="Select",[ci,ui,pR]=jr(wn),[nr]=Fe(wn,[pR,on]),di=on(),[hR,ln]=nr(wn),[mR,gR]=nr(wn),Th=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:a,defaultValue:s,onValueChange:l,dir:c,name:d,autoComplete:u,disabled:p,required:h,form:v}=e,g=di(t),[b,x]=m.useState(null),[y,w]=m.useState(null),[S,P]=m.useState(!1),C=rn(c),[T,I]=Ze({prop:r,defaultProp:o??!1,onChange:i,caller:wn}),[R,E]=Ze({prop:a,defaultProp:s,onChange:l,caller:wn}),N=m.useRef(null),A=b?v||!!b.closest("form"):!0,[j,$]=m.useState(new Set),O=Array.from(j).map(B=>B.props.value).join(";");return f.jsx(Qo,{...g,children:f.jsxs(hR,{required:h,scope:t,trigger:b,onTriggerChange:x,valueNode:y,onValueNodeChange:w,valueNodeHasChildren:S,onValueNodeHasChildrenChange:P,contentId:at(),value:R,onValueChange:E,open:T,onOpenChange:I,dir:C,triggerPointerDownPosRef:N,disabled:p,children:[f.jsx(ci.Provider,{scope:t,children:f.jsx(mR,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback(B=>{$(W=>new Set(W).add(B))},[]),onNativeOptionRemove:m.useCallback(B=>{$(W=>{const Y=new Set(W);return Y.delete(B),Y})},[]),children:n})}),A?f.jsxs(Kh,{"aria-hidden":!0,required:h,tabIndex:-1,name:d,autoComplete:u,value:R,onChange:B=>E(B.target.value),disabled:p,form:v,children:[R===void 0?f.jsx("option",{value:""}):null,Array.from(j)]},O):null]})})};Th.displayName=wn;var Ph="SelectTrigger",Nh=m.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=di(n),a=ln(Ph,n),s=a.disabled||r,l=ae(t,a.onTriggerChange),c=ui(n),d=m.useRef("touch"),[u,p,h]=Yh(g=>{const b=c().filter(w=>!w.disabled),x=b.find(w=>w.value===a.value),y=Xh(b,g,x);y!==void 0&&a.onValueChange(y.value)}),v=g=>{s||(a.onOpenChange(!0),h()),g&&(a.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})};return f.jsx(zr,{asChild:!0,...i,children:f.jsx(J.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":Jh(a.value)?"":void 0,...o,ref:l,onClick:Z(o.onClick,g=>{g.currentTarget.focus(),d.current!=="mouse"&&v(g)}),onPointerDown:Z(o.onPointerDown,g=>{d.current=g.pointerType;const b=g.target;b.hasPointerCapture(g.pointerId)&&b.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(v(g),g.preventDefault())}),onKeyDown:Z(o.onKeyDown,g=>{const b=u.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&p(g.key),!(b&&g.key===" ")&&dR.includes(g.key)&&(v(),g.preventDefault())})})})});Nh.displayName=Ph;var Ih="SelectValue",Ah=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:a="",...s}=e,l=ln(Ih,n),{onValueNodeHasChildrenChange:c}=l,d=i!==void 0,u=ae(t,l.onValueNodeChange);return Le(()=>{c(d)},[c,d]),f.jsx(J.span,{...s,ref:u,style:{pointerEvents:"none"},children:Jh(l.value)?f.jsx(f.Fragment,{children:a}):i})});Ah.displayName=Ih;var vR="SelectIcon",Rh=m.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return f.jsx(J.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});Rh.displayName=vR;var xR="SelectPortal",jh=e=>f.jsx(tr,{asChild:!0,...e});jh.displayName=xR;var kn="SelectContent",Oh=m.forwardRef((e,t)=>{const n=ln(kn,e.__scopeSelect),[r,o]=m.useState();if(Le(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?Da.createPortal(f.jsx(Mh,{scope:e.__scopeSelect,children:f.jsx(ci.Slot,{scope:e.__scopeSelect,children:f.jsx("div",{children:e.children})})}),i):null}return f.jsx(Dh,{...e,ref:t})});Oh.displayName=kn;var kt=10,[Mh,cn]=nr(kn),bR="SelectContentImpl",yR=Qt("SelectContent.RemoveScroll"),Dh=m.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:a,side:s,sideOffset:l,align:c,alignOffset:d,arrowPadding:u,collisionBoundary:p,collisionPadding:h,sticky:v,hideWhenDetached:g,avoidCollisions:b,...x}=e,y=ln(kn,n),[w,S]=m.useState(null),[P,C]=m.useState(null),T=ae(t,U=>S(U)),[I,R]=m.useState(null),[E,N]=m.useState(null),A=ui(n),[j,$]=m.useState(!1),O=m.useRef(!1);m.useEffect(()=>{if(w)return Jo(w)},[w]),qo();const B=m.useCallback(U=>{const[te,...me]=A().map(G=>G.ref.current),[ie]=me.slice(-1),Q=document.activeElement;for(const G of U)if(G===Q||(G?.scrollIntoView({block:"nearest"}),G===te&&P&&(P.scrollTop=0),G===ie&&P&&(P.scrollTop=P.scrollHeight),G?.focus(),document.activeElement!==Q))return},[A,P]),W=m.useCallback(()=>B([I,w]),[B,I,w]);m.useEffect(()=>{j&&W()},[j,W]);const{onOpenChange:Y,triggerPointerDownPosRef:V}=y;m.useEffect(()=>{if(w){let U={x:0,y:0};const te=ie=>{U={x:Math.abs(Math.round(ie.pageX)-(V.current?.x??0)),y:Math.abs(Math.round(ie.pageY)-(V.current?.y??0))}},me=ie=>{U.x<=10&&U.y<=10?ie.preventDefault():w.contains(ie.target)||Y(!1),document.removeEventListener("pointermove",te),V.current=null};return V.current!==null&&(document.addEventListener("pointermove",te),document.addEventListener("pointerup",me,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",te),document.removeEventListener("pointerup",me,{capture:!0})}}},[w,Y,V]),m.useEffect(()=>{const U=()=>Y(!1);return window.addEventListener("blur",U),window.addEventListener("resize",U),()=>{window.removeEventListener("blur",U),window.removeEventListener("resize",U)}},[Y]);const[k,le]=Yh(U=>{const te=A().filter(Q=>!Q.disabled),me=te.find(Q=>Q.ref.current===document.activeElement),ie=Xh(te,U,me);ie&&setTimeout(()=>ie.ref.current.focus())}),be=m.useCallback((U,te,me)=>{const ie=!O.current&&!me;(y.value!==void 0&&y.value===te||ie)&&(R(U),ie&&(O.current=!0))},[y.value]),_=m.useCallback(()=>w?.focus(),[w]),fe=m.useCallback((U,te,me)=>{const ie=!O.current&&!me;(y.value!==void 0&&y.value===te||ie)&&N(U)},[y.value]),ke=r==="popper"?wa:$h,ce=ke===wa?{side:s,sideOffset:l,align:c,alignOffset:d,arrowPadding:u,collisionBoundary:p,collisionPadding:h,sticky:v,hideWhenDetached:g,avoidCollisions:b}:{};return f.jsx(Mh,{scope:n,content:w,viewport:P,onViewportChange:C,itemRefCallback:be,selectedItem:I,onItemLeave:_,itemTextRefCallback:fe,focusSelectedItem:W,selectedItemText:E,position:r,isPositioned:j,searchRef:k,children:f.jsx(Mr,{as:yR,allowPinchZoom:!0,children:f.jsx(Or,{asChild:!0,trapped:y.open,onMountAutoFocus:U=>{U.preventDefault()},onUnmountAutoFocus:Z(o,U=>{y.trigger?.focus({preventScroll:!0}),U.preventDefault()}),children:f.jsx(er,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:U=>U.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:f.jsx(ke,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:U=>U.preventDefault(),...x,...ce,onPlaced:()=>$(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:Z(x.onKeyDown,U=>{const te=U.ctrlKey||U.altKey||U.metaKey;if(U.key==="Tab"&&U.preventDefault(),!te&&U.key.length===1&&le(U.key),["ArrowUp","ArrowDown","Home","End"].includes(U.key)){let ie=A().filter(Q=>!Q.disabled).map(Q=>Q.ref.current);if(["ArrowUp","End"].includes(U.key)&&(ie=ie.slice().reverse()),["ArrowUp","ArrowDown"].includes(U.key)){const Q=U.target,G=ie.indexOf(Q);ie=ie.slice(G+1)}setTimeout(()=>B(ie)),U.preventDefault()}})})})})})})});Dh.displayName=bR;var wR="SelectItemAlignedPosition",$h=m.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=ln(kn,n),a=cn(kn,n),[s,l]=m.useState(null),[c,d]=m.useState(null),u=ae(t,T=>d(T)),p=ui(n),h=m.useRef(!1),v=m.useRef(!0),{viewport:g,selectedItem:b,selectedItemText:x,focusSelectedItem:y}=a,w=m.useCallback(()=>{if(i.trigger&&i.valueNode&&s&&c&&g&&b&&x){const T=i.trigger.getBoundingClientRect(),I=c.getBoundingClientRect(),R=i.valueNode.getBoundingClientRect(),E=x.getBoundingClientRect();if(i.dir!=="rtl"){const Q=E.left-I.left,G=R.left-Q,se=T.left-G,K=T.width+se,Te=Math.max(K,I.width),Me=window.innerWidth-kt,De=Io(G,[kt,Math.max(kt,Me-Te)]);s.style.minWidth=K+"px",s.style.left=De+"px"}else{const Q=I.right-E.right,G=window.innerWidth-R.right-Q,se=window.innerWidth-T.right-G,K=T.width+se,Te=Math.max(K,I.width),Me=window.innerWidth-kt,De=Io(G,[kt,Math.max(kt,Me-Te)]);s.style.minWidth=K+"px",s.style.right=De+"px"}const N=p(),A=window.innerHeight-kt*2,j=g.scrollHeight,$=window.getComputedStyle(c),O=parseInt($.borderTopWidth,10),B=parseInt($.paddingTop,10),W=parseInt($.borderBottomWidth,10),Y=parseInt($.paddingBottom,10),V=O+B+j+Y+W,k=Math.min(b.offsetHeight*5,V),le=window.getComputedStyle(g),be=parseInt(le.paddingTop,10),_=parseInt(le.paddingBottom,10),fe=T.top+T.height/2-kt,ke=A-fe,ce=b.offsetHeight/2,U=b.offsetTop+ce,te=O+B+U,me=V-te;if(te<=fe){const Q=N.length>0&&b===N[N.length-1].ref.current;s.style.bottom="0px";const G=c.clientHeight-g.offsetTop-g.offsetHeight,se=Math.max(ke,ce+(Q?_:0)+G+W),K=te+se;s.style.height=K+"px"}else{const Q=N.length>0&&b===N[0].ref.current;s.style.top="0px";const se=Math.max(fe,O+g.offsetTop+(Q?be:0)+ce)+me;s.style.height=se+"px",g.scrollTop=te-fe+g.offsetTop}s.style.margin=`${kt}px 0`,s.style.minHeight=k+"px",s.style.maxHeight=A+"px",r?.(),requestAnimationFrame(()=>h.current=!0)}},[p,i.trigger,i.valueNode,s,c,g,b,x,i.dir,r]);Le(()=>w(),[w]);const[S,P]=m.useState();Le(()=>{c&&P(window.getComputedStyle(c).zIndex)},[c]);const C=m.useCallback(T=>{T&&v.current===!0&&(w(),y?.(),v.current=!1)},[w,y]);return f.jsx(SR,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:h,onScrollButtonChange:C,children:f.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:f.jsx(J.div,{...o,ref:u,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});$h.displayName=wR;var kR="SelectPopperPosition",wa=m.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=kt,...i}=e,a=di(n);return f.jsx(ei,{...a,...i,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});wa.displayName=kR;var[SR,$s]=nr(kn,{}),ka="SelectViewport",zh=m.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,i=cn(ka,n),a=$s(ka,n),s=ae(t,i.onViewportChange),l=m.useRef(0);return f.jsxs(f.Fragment,{children:[f.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),f.jsx(ci.Slot,{scope:n,children:f.jsx(J.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:Z(o.onScroll,c=>{const d=c.currentTarget,{contentWrapper:u,shouldExpandOnScrollRef:p}=a;if(p?.current&&u){const h=Math.abs(l.current-d.scrollTop);if(h>0){const v=window.innerHeight-kt*2,g=parseFloat(u.style.minHeight),b=parseFloat(u.style.height),x=Math.max(g,b);if(x<v){const y=x+h,w=Math.min(v,y),S=y-w;u.style.height=w+"px",u.style.bottom==="0px"&&(d.scrollTop=S>0?S:0,u.style.justifyContent="flex-end")}}}l.current=d.scrollTop})})})]})});zh.displayName=ka;var Lh="SelectGroup",[CR,_R]=nr(Lh),ER=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=at();return f.jsx(CR,{scope:n,id:o,children:f.jsx(J.div,{role:"group","aria-labelledby":o,...r,ref:t})})});ER.displayName=Lh;var Fh="SelectLabel",TR=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=_R(Fh,n);return f.jsx(J.div,{id:o.id,...r,ref:t})});TR.displayName=Fh;var Ro="SelectItem",[PR,Bh]=nr(Ro),Vh=m.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...a}=e,s=ln(Ro,n),l=cn(Ro,n),c=s.value===r,[d,u]=m.useState(i??""),[p,h]=m.useState(!1),v=ae(t,y=>l.itemRefCallback?.(y,r,o)),g=at(),b=m.useRef("touch"),x=()=>{o||(s.onValueChange(r),s.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return f.jsx(PR,{scope:n,value:r,disabled:o,textId:g,isSelected:c,onItemTextChange:m.useCallback(y=>{u(w=>w||(y?.textContent??"").trim())},[]),children:f.jsx(ci.ItemSlot,{scope:n,value:r,disabled:o,textValue:d,children:f.jsx(J.div,{role:"option","aria-labelledby":g,"data-highlighted":p?"":void 0,"aria-selected":c&&p,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...a,ref:v,onFocus:Z(a.onFocus,()=>h(!0)),onBlur:Z(a.onBlur,()=>h(!1)),onClick:Z(a.onClick,()=>{b.current!=="mouse"&&x()}),onPointerUp:Z(a.onPointerUp,()=>{b.current==="mouse"&&x()}),onPointerDown:Z(a.onPointerDown,y=>{b.current=y.pointerType}),onPointerMove:Z(a.onPointerMove,y=>{b.current=y.pointerType,o?l.onItemLeave?.():b.current==="mouse"&&y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Z(a.onPointerLeave,y=>{y.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:Z(a.onKeyDown,y=>{l.searchRef?.current!==""&&y.key===" "||(fR.includes(y.key)&&x(),y.key===" "&&y.preventDefault())})})})})});Vh.displayName=Ro;var pr="SelectItemText",Uh=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,a=ln(pr,n),s=cn(pr,n),l=Bh(pr,n),c=gR(pr,n),[d,u]=m.useState(null),p=ae(t,x=>u(x),l.onItemTextChange,x=>s.itemTextRefCallback?.(x,l.value,l.disabled)),h=d?.textContent,v=m.useMemo(()=>f.jsx("option",{value:l.value,disabled:l.disabled,children:h},l.value),[l.disabled,l.value,h]),{onNativeOptionAdd:g,onNativeOptionRemove:b}=c;return Le(()=>(g(v),()=>b(v)),[g,b,v]),f.jsxs(f.Fragment,{children:[f.jsx(J.span,{id:l.textId,...i,ref:p}),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren?Da.createPortal(i.children,a.valueNode):null]})});Uh.displayName=pr;var Zh="SelectItemIndicator",Hh=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Bh(Zh,n).isSelected?f.jsx(J.span,{"aria-hidden":!0,...r,ref:t}):null});Hh.displayName=Zh;var Sa="SelectScrollUpButton",Gh=m.forwardRef((e,t)=>{const n=cn(Sa,e.__scopeSelect),r=$s(Sa,e.__scopeSelect),[o,i]=m.useState(!1),a=ae(t,r.onScrollButtonChange);return Le(()=>{if(n.viewport&&n.isPositioned){let s=function(){const c=l.scrollTop>0;i(c)};const l=n.viewport;return s(),l.addEventListener("scroll",s),()=>l.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),o?f.jsx(qh,{...e,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop-l.offsetHeight)}}):null});Gh.displayName=Sa;var Ca="SelectScrollDownButton",Wh=m.forwardRef((e,t)=>{const n=cn(Ca,e.__scopeSelect),r=$s(Ca,e.__scopeSelect),[o,i]=m.useState(!1),a=ae(t,r.onScrollButtonChange);return Le(()=>{if(n.viewport&&n.isPositioned){let s=function(){const c=l.scrollHeight-l.clientHeight,d=Math.ceil(l.scrollTop)<c;i(d)};const l=n.viewport;return s(),l.addEventListener("scroll",s),()=>l.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),o?f.jsx(qh,{...e,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop+l.offsetHeight)}}):null});Wh.displayName=Ca;var qh=m.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=cn("SelectScrollButton",n),a=m.useRef(null),s=ui(n),l=m.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return m.useEffect(()=>()=>l(),[l]),Le(()=>{s().find(d=>d.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[s]),f.jsx(J.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:Z(o.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:Z(o.onPointerMove,()=>{i.onItemLeave?.(),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:Z(o.onPointerLeave,()=>{l()})})}),NR="SelectSeparator",IR=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return f.jsx(J.div,{"aria-hidden":!0,...r,ref:t})});IR.displayName=NR;var _a="SelectArrow",AR=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=di(n),i=ln(_a,n),a=cn(_a,n);return i.open&&a.position==="popper"?f.jsx(ti,{...o,...r,ref:t}):null});AR.displayName=_a;var RR="SelectBubbleInput",Kh=m.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=m.useRef(null),i=ae(r,o),a=Dr(t);return m.useEffect(()=>{const s=o.current;if(!s)return;const l=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==t&&d){const u=new Event("change",{bubbles:!0});d.call(s,t),s.dispatchEvent(u)}},[a,t]),f.jsx(J.select,{...n,style:{...Xd,...n.style},ref:i,defaultValue:t})});Kh.displayName=RR;function Jh(e){return e===""||e===void 0}function Yh(e){const t=Tt(e),n=m.useRef(""),r=m.useRef(0),o=m.useCallback(a=>{const s=n.current+a;t(s),(function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))})(s)},[t]),i=m.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function Xh(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let a=jR(e,Math.max(i,0));o.length===1&&(a=a.filter(c=>c!==n));const l=a.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function jR(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var OR=Th,MR=Nh,DR=Ah,$R=Rh,zR=jh,LR=Oh,FR=zh,BR=Vh,VR=Uh,UR=Hh,ZR=Gh,HR=Wh,GR="Separator",Bc="horizontal",WR=["horizontal","vertical"],Qh=m.forwardRef((e,t)=>{const{decorative:n,orientation:r=Bc,...o}=e,i=qR(r)?r:Bc,s=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return f.jsx(J.div,{"data-orientation":i,...s,...o,ref:t})});Qh.displayName=GR;function qR(e){return WR.includes(e)}var KR=Qh,em=["PageUp","PageDown"],tm=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],nm={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},rr="Slider",[Ea,JR,YR]=jr(rr),[rm]=Fe(rr,[YR]),[XR,fi]=rm(rr),om=m.forwardRef((e,t)=>{const{name:n,min:r=0,max:o=100,step:i=1,orientation:a="horizontal",disabled:s=!1,minStepsBetweenThumbs:l=0,defaultValue:c=[r],value:d,onValueChange:u=()=>{},onValueCommit:p=()=>{},inverted:h=!1,form:v,...g}=e,b=m.useRef(new Set),x=m.useRef(0),w=a==="horizontal"?QR:ej,[S=[],P]=Ze({prop:d,defaultProp:c,onChange:N=>{[...b.current][x.current]?.focus(),u(N)}}),C=m.useRef(S);function T(N){const A=ij(S,N);E(N,A)}function I(N){E(N,x.current)}function R(){const N=C.current[x.current];S[x.current]!==N&&p(S)}function E(N,A,{commit:j}={commit:!1}){const $=cj(i),O=uj(Math.round((N-r)/i)*i+r,$),B=Io(O,[r,o]);P((W=[])=>{const Y=rj(W,B,A);if(lj(Y,l*i)){x.current=Y.indexOf(B);const V=String(Y)!==String(W);return V&&j&&p(Y),V?Y:W}else return W})}return f.jsx(XR,{scope:e.__scopeSlider,name:n,disabled:s,min:r,max:o,valueIndexToChangeRef:x,thumbs:b.current,values:S,orientation:a,form:v,children:f.jsx(Ea.Provider,{scope:e.__scopeSlider,children:f.jsx(Ea.Slot,{scope:e.__scopeSlider,children:f.jsx(w,{"aria-disabled":s,"data-disabled":s?"":void 0,...g,ref:t,onPointerDown:Z(g.onPointerDown,()=>{s||(C.current=S)}),min:r,max:o,inverted:h,onSlideStart:s?void 0:T,onSlideMove:s?void 0:I,onSlideEnd:s?void 0:R,onHomeKeyDown:()=>!s&&E(r,0,{commit:!0}),onEndKeyDown:()=>!s&&E(o,S.length-1,{commit:!0}),onStepKeyDown:({event:N,direction:A})=>{if(!s){const O=em.includes(N.key)||N.shiftKey&&tm.includes(N.key)?10:1,B=x.current,W=S[B],Y=i*O*A;E(W+Y,B,{commit:!0})}}})})})})});om.displayName=rr;var[im,am]=rm(rr,{startEdge:"left",endEdge:"right",size:"width",direction:1}),QR=m.forwardRef((e,t)=>{const{min:n,max:r,dir:o,inverted:i,onSlideStart:a,onSlideMove:s,onSlideEnd:l,onStepKeyDown:c,...d}=e,[u,p]=m.useState(null),h=ae(t,w=>p(w)),v=m.useRef(void 0),g=rn(o),b=g==="ltr",x=b&&!i||!b&&i;function y(w){const S=v.current||u.getBoundingClientRect(),P=[0,S.width],T=zs(P,x?[n,r]:[r,n]);return v.current=S,T(w-S.left)}return f.jsx(im,{scope:e.__scopeSlider,startEdge:x?"left":"right",endEdge:x?"right":"left",direction:x?1:-1,size:"width",children:f.jsx(sm,{dir:g,"data-orientation":"horizontal",...d,ref:h,style:{...d.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:w=>{const S=y(w.clientX);a?.(S)},onSlideMove:w=>{const S=y(w.clientX);s?.(S)},onSlideEnd:()=>{v.current=void 0,l?.()},onStepKeyDown:w=>{const P=nm[x?"from-left":"from-right"].includes(w.key);c?.({event:w,direction:P?-1:1})}})})}),ej=m.forwardRef((e,t)=>{const{min:n,max:r,inverted:o,onSlideStart:i,onSlideMove:a,onSlideEnd:s,onStepKeyDown:l,...c}=e,d=m.useRef(null),u=ae(t,d),p=m.useRef(void 0),h=!o;function v(g){const b=p.current||d.current.getBoundingClientRect(),x=[0,b.height],w=zs(x,h?[r,n]:[n,r]);return p.current=b,w(g-b.top)}return f.jsx(im,{scope:e.__scopeSlider,startEdge:h?"bottom":"top",endEdge:h?"top":"bottom",size:"height",direction:h?1:-1,children:f.jsx(sm,{"data-orientation":"vertical",...c,ref:u,style:{...c.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:g=>{const b=v(g.clientY);i?.(b)},onSlideMove:g=>{const b=v(g.clientY);a?.(b)},onSlideEnd:()=>{p.current=void 0,s?.()},onStepKeyDown:g=>{const x=nm[h?"from-bottom":"from-top"].includes(g.key);l?.({event:g,direction:x?-1:1})}})})}),sm=m.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:o,onSlideEnd:i,onHomeKeyDown:a,onEndKeyDown:s,onStepKeyDown:l,...c}=e,d=fi(rr,n);return f.jsx(J.span,{...c,ref:t,onKeyDown:Z(e.onKeyDown,u=>{u.key==="Home"?(a(u),u.preventDefault()):u.key==="End"?(s(u),u.preventDefault()):em.concat(tm).includes(u.key)&&(l(u),u.preventDefault())}),onPointerDown:Z(e.onPointerDown,u=>{const p=u.target;p.setPointerCapture(u.pointerId),u.preventDefault(),d.thumbs.has(p)?p.focus():r(u)}),onPointerMove:Z(e.onPointerMove,u=>{u.target.hasPointerCapture(u.pointerId)&&o(u)}),onPointerUp:Z(e.onPointerUp,u=>{const p=u.target;p.hasPointerCapture(u.pointerId)&&(p.releasePointerCapture(u.pointerId),i(u))})})}),lm="SliderTrack",cm=m.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,o=fi(lm,n);return f.jsx(J.span,{"data-disabled":o.disabled?"":void 0,"data-orientation":o.orientation,...r,ref:t})});cm.displayName=lm;var Ta="SliderRange",um=m.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,o=fi(Ta,n),i=am(Ta,n),a=m.useRef(null),s=ae(t,a),l=o.values.length,c=o.values.map(p=>pm(p,o.min,o.max)),d=l>1?Math.min(...c):0,u=100-Math.max(...c);return f.jsx(J.span,{"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,...r,ref:s,style:{...e.style,[i.startEdge]:d+"%",[i.endEdge]:u+"%"}})});um.displayName=Ta;var Pa="SliderThumb",dm=m.forwardRef((e,t)=>{const n=JR(e.__scopeSlider),[r,o]=m.useState(null),i=ae(t,s=>o(s)),a=m.useMemo(()=>r?n().findIndex(s=>s.ref.current===r):-1,[n,r]);return f.jsx(tj,{...e,ref:i,index:a})}),tj=m.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:o,...i}=e,a=fi(Pa,n),s=am(Pa,n),[l,c]=m.useState(null),d=ae(t,y=>c(y)),u=l?a.form||!!l.closest("form"):!0,p=$r(l),h=a.values[r],v=h===void 0?0:pm(h,a.min,a.max),g=oj(r,a.values.length),b=p?.[s.size],x=b?aj(b,v,s.direction):0;return m.useEffect(()=>{if(l)return a.thumbs.add(l),()=>{a.thumbs.delete(l)}},[l,a.thumbs]),f.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[s.startEdge]:`calc(${v}% + ${x}px)`},children:[f.jsx(Ea.ItemSlot,{scope:e.__scopeSlider,children:f.jsx(J.span,{role:"slider","aria-label":e["aria-label"]||g,"aria-valuemin":a.min,"aria-valuenow":h,"aria-valuemax":a.max,"aria-orientation":a.orientation,"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,tabIndex:a.disabled?void 0:0,...i,ref:d,style:h===void 0?{display:"none"}:e.style,onFocus:Z(e.onFocus,()=>{a.valueIndexToChangeRef.current=r})})}),u&&f.jsx(fm,{name:o??(a.name?a.name+(a.values.length>1?"[]":""):void 0),form:a.form,value:h},r)]})});dm.displayName=Pa;var nj="RadioBubbleInput",fm=m.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const o=m.useRef(null),i=ae(o,r),a=Dr(t);return m.useEffect(()=>{const s=o.current;if(!s)return;const l=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==t&&d){const u=new Event("input",{bubbles:!0});d.call(s,t),s.dispatchEvent(u)}},[a,t]),f.jsx(J.input,{style:{display:"none"},...n,ref:i,defaultValue:t})});fm.displayName=nj;function rj(e=[],t,n){const r=[...e];return r[n]=t,r.sort((o,i)=>o-i)}function pm(e,t,n){const i=100/(n-t)*(e-t);return Io(i,[0,100])}function oj(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function ij(e,t){if(e.length===1)return 0;const n=e.map(o=>Math.abs(o-t)),r=Math.min(...n);return n.indexOf(r)}function aj(e,t,n){const r=e/2,i=zs([0,50],[0,r]);return(r-i(t)*n)*n}function sj(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function lj(e,t){if(t>0){const n=sj(e);return Math.min(...n)>=t}return!0}function zs(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function cj(e){return(String(e).split(".")[1]||"").length}function uj(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var dj=om,fj=cm,pj=um,hj=dm,pi="Switch",[mj]=Fe(pi),[gj,vj]=mj(pi),hm=m.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:i,required:a,disabled:s,value:l="on",onCheckedChange:c,form:d,...u}=e,[p,h]=m.useState(null),v=ae(t,w=>h(w)),g=m.useRef(!1),b=p?d||!!p.closest("form"):!0,[x,y]=Ze({prop:o,defaultProp:i??!1,onChange:c,caller:pi});return f.jsxs(gj,{scope:n,checked:x,disabled:s,children:[f.jsx(J.button,{type:"button",role:"switch","aria-checked":x,"aria-required":a,"data-state":xm(x),"data-disabled":s?"":void 0,disabled:s,value:l,...u,ref:v,onClick:Z(e.onClick,w=>{y(S=>!S),b&&(g.current=w.isPropagationStopped(),g.current||w.stopPropagation())})}),b&&f.jsx(vm,{control:p,bubbles:!g.current,name:r,value:l,checked:x,required:a,disabled:s,form:d,style:{transform:"translateX(-100%)"}})]})});hm.displayName=pi;var mm="SwitchThumb",gm=m.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=vj(mm,n);return f.jsx(J.span,{"data-state":xm(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:t})});gm.displayName=mm;var xj="SwitchBubbleInput",vm=m.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...o},i)=>{const a=m.useRef(null),s=ae(a,i),l=Dr(n),c=$r(t);return m.useEffect(()=>{const d=a.current;if(!d)return;const u=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(u,"checked").set;if(l!==n&&h){const v=new Event("click",{bubbles:r});h.call(d,n),d.dispatchEvent(v)}},[l,n,r]),f.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:s,style:{...o.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});vm.displayName=xj;function xm(e){return e?"checked":"unchecked"}var bj=hm,yj=gm,hi="Tabs",[wj]=Fe(hi,[an]),bm=an(),[kj,Ls]=wj(hi),ym=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:a="horizontal",dir:s,activationMode:l="automatic",...c}=e,d=rn(s),[u,p]=Ze({prop:r,onChange:o,defaultProp:i??"",caller:hi});return f.jsx(kj,{scope:n,baseId:at(),value:u,onValueChange:p,orientation:a,dir:d,activationMode:l,children:f.jsx(J.div,{dir:d,"data-orientation":a,...c,ref:t})})});ym.displayName=hi;var wm="TabsList",km=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=Ls(wm,n),a=bm(n);return f.jsx(ni,{asChild:!0,...a,orientation:i.orientation,dir:i.dir,loop:r,children:f.jsx(J.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})});km.displayName=wm;var Sm="TabsTrigger",Cm=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,a=Ls(Sm,n),s=bm(n),l=Em(a.baseId,r),c=Tm(a.baseId,r),d=r===a.value;return f.jsx(ri,{asChild:!0,...s,focusable:!o,active:d,children:f.jsx(J.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":c,"data-state":d?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l,...i,ref:t,onMouseDown:Z(e.onMouseDown,u=>{!o&&u.button===0&&u.ctrlKey===!1?a.onValueChange(r):u.preventDefault()}),onKeyDown:Z(e.onKeyDown,u=>{[" ","Enter"].includes(u.key)&&a.onValueChange(r)}),onFocus:Z(e.onFocus,()=>{const u=a.activationMode!=="manual";!d&&!o&&u&&a.onValueChange(r)})})})});Cm.displayName=Sm;var _m="TabsContent",Sj=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...a}=e,s=Ls(_m,n),l=Em(s.baseId,r),c=Tm(s.baseId,r),d=r===s.value,u=m.useRef(d);return m.useEffect(()=>{const p=requestAnimationFrame(()=>u.current=!1);return()=>cancelAnimationFrame(p)},[]),f.jsx(et,{present:o||d,children:({present:p})=>f.jsx(J.div,{"data-state":d?"active":"inactive","data-orientation":s.orientation,role:"tabpanel","aria-labelledby":l,hidden:!p,id:c,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:u.current?"0s":void 0},children:p&&i})})});Sj.displayName=_m;function Em(e,t){return`${e}-trigger-${t}`}function Tm(e,t){return`${e}-content-${t}`}var Cj=ym,_j=km,Ej=Cm,Pm="Toggle",Fs=m.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r,onPressedChange:o,...i}=e,[a,s]=Ze({prop:n,onChange:o,defaultProp:r??!1,caller:Pm});return f.jsx(J.button,{type:"button","aria-pressed":a,"data-state":a?"on":"off","data-disabled":e.disabled?"":void 0,...i,ref:t,onClick:Z(e.onClick,()=>{e.disabled||s(!a)})})});Fs.displayName=Pm;var Tj=Fs,un="ToggleGroup",[Nm]=Fe(un,[an]),Im=an(),Bs=L.forwardRef((e,t)=>{const{type:n,...r}=e;if(n==="single"){const o=r;return f.jsx(Pj,{...o,ref:t})}if(n==="multiple"){const o=r;return f.jsx(Nj,{...o,ref:t})}throw new Error(`Missing prop \`type\` expected on \`${un}\``)});Bs.displayName=un;var[Am,Rm]=Nm(un),Pj=L.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...i}=e,[a,s]=Ze({prop:n,defaultProp:r??"",onChange:o,caller:un});return f.jsx(Am,{scope:e.__scopeToggleGroup,type:"single",value:L.useMemo(()=>a?[a]:[],[a]),onItemActivate:s,onItemDeactivate:L.useCallback(()=>s(""),[s]),children:f.jsx(jm,{...i,ref:t})})}),Nj=L.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...i}=e,[a,s]=Ze({prop:n,defaultProp:r??[],onChange:o,caller:un}),l=L.useCallback(d=>s((u=[])=>[...u,d]),[s]),c=L.useCallback(d=>s((u=[])=>u.filter(p=>p!==d)),[s]);return f.jsx(Am,{scope:e.__scopeToggleGroup,type:"multiple",value:a,onItemActivate:l,onItemDeactivate:c,children:f.jsx(jm,{...i,ref:t})})});Bs.displayName=un;var[Ij,Aj]=Nm(un),jm=L.forwardRef((e,t)=>{const{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:o=!0,orientation:i,dir:a,loop:s=!0,...l}=e,c=Im(n),d=rn(a),u={role:"group",dir:d,...l};return f.jsx(Ij,{scope:n,rovingFocus:o,disabled:r,children:o?f.jsx(ni,{asChild:!0,...c,orientation:i,dir:d,loop:s,children:f.jsx(J.div,{...u,ref:t})}):f.jsx(J.div,{...u,ref:t})})}),jo="ToggleGroupItem",Om=L.forwardRef((e,t)=>{const n=Rm(jo,e.__scopeToggleGroup),r=Aj(jo,e.__scopeToggleGroup),o=Im(e.__scopeToggleGroup),i=n.value.includes(e.value),a=r.disabled||e.disabled,s={...e,pressed:i,disabled:a},l=L.useRef(null);return r.rovingFocus?f.jsx(ri,{asChild:!0,...o,focusable:!a,active:i,ref:l,children:f.jsx(Vc,{...s,ref:t})}):f.jsx(Vc,{...s,ref:t})});Om.displayName=jo;var Vc=L.forwardRef((e,t)=>{const{__scopeToggleGroup:n,value:r,...o}=e,i=Rm(jo,n),a={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},s=i.type==="single"?a:void 0;return f.jsx(Fs,{...s,...o,ref:t,onPressedChange:l=>{l?i.onItemActivate(r):i.onItemDeactivate(r)}})}),Rj=Bs,jj=Om,[mi]=Fe("Tooltip",[on]),gi=on(),Mm="TooltipProvider",Oj=700,Na="tooltip.open",[Mj,Vs]=mi(Mm),Dm=e=>{const{__scopeTooltip:t,delayDuration:n=Oj,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,a=m.useRef(!0),s=m.useRef(!1),l=m.useRef(0);return m.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),f.jsx(Mj,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:m.useCallback(()=>{window.clearTimeout(l.current),a.current=!1},[]),onClose:m.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>a.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:m.useCallback(c=>{s.current=c},[]),disableHoverableContent:o,children:i})};Dm.displayName=Mm;var _r="Tooltip",[Dj,Ur]=mi(_r),$m=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:i,disableHoverableContent:a,delayDuration:s}=e,l=Vs(_r,e.__scopeTooltip),c=gi(t),[d,u]=m.useState(null),p=at(),h=m.useRef(0),v=a??l.disableHoverableContent,g=s??l.delayDuration,b=m.useRef(!1),[x,y]=Ze({prop:r,defaultProp:o??!1,onChange:T=>{T?(l.onOpen(),document.dispatchEvent(new CustomEvent(Na))):l.onClose(),i?.(T)},caller:_r}),w=m.useMemo(()=>x?b.current?"delayed-open":"instant-open":"closed",[x]),S=m.useCallback(()=>{window.clearTimeout(h.current),h.current=0,b.current=!1,y(!0)},[y]),P=m.useCallback(()=>{window.clearTimeout(h.current),h.current=0,y(!1)},[y]),C=m.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{b.current=!0,y(!0),h.current=0},g)},[g,y]);return m.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),f.jsx(Qo,{...c,children:f.jsx(Dj,{scope:t,contentId:p,open:x,stateAttribute:w,trigger:d,onTriggerChange:u,onTriggerEnter:m.useCallback(()=>{l.isOpenDelayedRef.current?C():S()},[l.isOpenDelayedRef,C,S]),onTriggerLeave:m.useCallback(()=>{v?P():(window.clearTimeout(h.current),h.current=0)},[P,v]),onOpen:S,onClose:P,disableHoverableContent:v,children:n})})};$m.displayName=_r;var Ia="TooltipTrigger",zm=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Ur(Ia,n),i=Vs(Ia,n),a=gi(n),s=m.useRef(null),l=ae(t,s,o.onTriggerChange),c=m.useRef(!1),d=m.useRef(!1),u=m.useCallback(()=>c.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",u),[u]),f.jsx(zr,{asChild:!0,...a,children:f.jsx(J.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:Z(e.onPointerMove,p=>{p.pointerType!=="touch"&&!d.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:Z(e.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:Z(e.onPointerDown,()=>{o.open&&o.onClose(),c.current=!0,document.addEventListener("pointerup",u,{once:!0})}),onFocus:Z(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:Z(e.onBlur,o.onClose),onClick:Z(e.onClick,o.onClose)})})});zm.displayName=Ia;var Us="TooltipPortal",[$j,zj]=mi(Us,{forceMount:void 0}),Lm=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,i=Ur(Us,t);return f.jsx($j,{scope:t,forceMount:n,children:f.jsx(et,{present:n||i.open,children:f.jsx(tr,{asChild:!0,container:o,children:r})})})};Lm.displayName=Us;var Jn="TooltipContent",Fm=m.forwardRef((e,t)=>{const n=zj(Jn,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,a=Ur(Jn,e.__scopeTooltip);return f.jsx(et,{present:r||a.open,children:a.disableHoverableContent?f.jsx(Bm,{side:o,...i,ref:t}):f.jsx(Lj,{side:o,...i,ref:t})})}),Lj=m.forwardRef((e,t)=>{const n=Ur(Jn,e.__scopeTooltip),r=Vs(Jn,e.__scopeTooltip),o=m.useRef(null),i=ae(t,o),[a,s]=m.useState(null),{trigger:l,onClose:c}=n,d=o.current,{onPointerInTransitChange:u}=r,p=m.useCallback(()=>{s(null),u(!1)},[u]),h=m.useCallback((v,g)=>{const b=v.currentTarget,x={x:v.clientX,y:v.clientY},y=Uj(x,b.getBoundingClientRect()),w=Zj(x,y),S=Hj(g.getBoundingClientRect()),P=Wj([...w,...S]);s(P),u(!0)},[u]);return m.useEffect(()=>()=>p(),[p]),m.useEffect(()=>{if(l&&d){const v=b=>h(b,d),g=b=>h(b,l);return l.addEventListener("pointerleave",v),d.addEventListener("pointerleave",g),()=>{l.removeEventListener("pointerleave",v),d.removeEventListener("pointerleave",g)}}},[l,d,h,p]),m.useEffect(()=>{if(a){const v=g=>{const b=g.target,x={x:g.clientX,y:g.clientY},y=l?.contains(b)||d?.contains(b),w=!Gj(x,a);y?p():w&&(p(),c())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[l,d,a,c,p]),f.jsx(Bm,{...e,ref:i})}),[Fj,Bj]=mi(_r,{isInside:!1}),Vj=FT("TooltipContent"),Bm=m.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:a,...s}=e,l=Ur(Jn,n),c=gi(n),{onClose:d}=l;return m.useEffect(()=>(document.addEventListener(Na,d),()=>document.removeEventListener(Na,d)),[d]),m.useEffect(()=>{if(l.trigger){const u=p=>{p.target?.contains(l.trigger)&&d()};return window.addEventListener("scroll",u,{capture:!0}),()=>window.removeEventListener("scroll",u,{capture:!0})}},[l.trigger,d]),f.jsx(er,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:u=>u.preventDefault(),onDismiss:d,children:f.jsxs(ei,{"data-state":l.stateAttribute,...c,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[f.jsx(Vj,{children:r}),f.jsx(Fj,{scope:n,isInside:!0,children:f.jsx(GT,{id:l.contentId,role:"tooltip",children:o||r})})]})})});Fm.displayName=Jn;var Vm="TooltipArrow",Um=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=gi(n);return Bj(Vm,n).isInside?null:f.jsx(ti,{...o,...r,ref:t})});Um.displayName=Vm;function Uj(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Zj(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Hj(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function Gj(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,a=t.length-1;i<t.length;a=i++){const s=t[i],l=t[a],c=s.x,d=s.y,u=l.x,p=l.y;d>r!=p>r&&n<(u-c)*(r-d)/(p-d)+c&&(o=!o)}return o}function Wj(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),qj(t)}function qj(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const i=t[t.length-1],a=t[t.length-2];if((i.x-a.x)*(o.y-a.y)>=(i.y-a.y)*(o.x-a.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const i=n[n.length-1],a=n[n.length-2];if((i.x-a.x)*(o.y-a.y)>=(i.y-a.y)*(o.x-a.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Kj=Dm,Jj=$m,Yj=zm,Xj=Lm,Qj=Fm,eO=Um;const Zm=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();const tO=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const nO=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());const Uc=e=>{const t=nO(e);return t.charAt(0).toUpperCase()+t.slice(1)};var rO={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const oO=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const iO=m.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:a,...s},l)=>m.createElement("svg",{ref:l,...rO,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Zm("lucide",o),...!i&&!oO(s)&&{"aria-hidden":"true"},...s},[...a.map(([c,d])=>m.createElement(c,d)),...Array.isArray(i)?i:[i]]));const Ft=(e,t)=>{const n=m.forwardRef(({className:r,...o},i)=>m.createElement(iO,{ref:i,iconNode:t,className:Zm(`lucide-${tO(Uc(e))}`,`lucide-${e}`,r),...o}));return n.displayName=Uc(e),n};const aO=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],sO=Ft("arrow-left",aO);const lO=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],cO=Ft("arrow-right",lO);const uO=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Hm=Ft("check",uO);const dO=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Zs=Ft("chevron-down",dO);const fO=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],pO=Ft("chevron-left",fO);const hO=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],mO=Ft("chevron-right",hO);const gO=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],vO=Ft("chevron-up",gO);const xO=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],bO=Ft("circle",xO);const yO=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],wO=Ft("ellipsis",yO);const kO=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],SO=Ft("x",kO);function CO(e){return Object.prototype.toString.call(e)==="[object Object]"}function Zc(e){return CO(e)||Array.isArray(e)}function _O(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function Hs(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;const o=JSON.stringify(Object.keys(e.breakpoints||{})),i=JSON.stringify(Object.keys(t.breakpoints||{}));return o!==i?!1:n.every(a=>{const s=e[a],l=t[a];return typeof s=="function"?`${s}`==`${l}`:!Zc(s)||!Zc(l)?s===l:Hs(s,l)})}function Hc(e){return e.concat().sort((t,n)=>t.name>n.name?1:-1).map(t=>t.options)}function EO(e,t){if(e.length!==t.length)return!1;const n=Hc(e),r=Hc(t);return n.every((o,i)=>{const a=r[i];return Hs(o,a)})}function Gs(e){return typeof e=="number"}function Aa(e){return typeof e=="string"}function vi(e){return typeof e=="boolean"}function Gc(e){return Object.prototype.toString.call(e)==="[object Object]"}function Re(e){return Math.abs(e)}function Ws(e){return Math.sign(e)}function xr(e,t){return Re(e-t)}function TO(e,t){if(e===0||t===0||Re(e)<=Re(t))return 0;const n=xr(Re(e),Re(t));return Re(n/e)}function PO(e){return Math.round(e*100)/100}function Er(e){return Tr(e).map(Number)}function _t(e){return e[Zr(e)]}function Zr(e){return Math.max(0,e.length-1)}function qs(e,t){return t===Zr(e)}function Wc(e,t=0){return Array.from(Array(e),(n,r)=>t+r)}function Tr(e){return Object.keys(e)}function Gm(e,t){return[e,t].reduce((n,r)=>(Tr(r).forEach(o=>{const i=n[o],a=r[o],s=Gc(i)&&Gc(a);n[o]=s?Gm(i,a):a}),n),{})}function Ra(e,t){return typeof t.MouseEvent<"u"&&e instanceof t.MouseEvent}function NO(e,t){const n={start:r,center:o,end:i};function r(){return 0}function o(l){return i(l)/2}function i(l){return t-l}function a(l,c){return Aa(e)?n[e](l):e(t,l,c)}return{measure:a}}function Pr(){let e=[];function t(o,i,a,s={passive:!0}){let l;if("addEventListener"in o)o.addEventListener(i,a,s),l=()=>o.removeEventListener(i,a,s);else{const c=o;c.addListener(a),l=()=>c.removeListener(a)}return e.push(l),r}function n(){e=e.filter(o=>o())}const r={add:t,clear:n};return r}function IO(e,t,n,r){const o=Pr(),i=1e3/60;let a=null,s=0,l=0;function c(){o.add(e,"visibilitychange",()=>{e.hidden&&v()})}function d(){h(),o.clear()}function u(b){if(!l)return;a||(a=b,n(),n());const x=b-a;for(a=b,s+=x;s>=i;)n(),s-=i;const y=s/i;r(y),l&&(l=t.requestAnimationFrame(u))}function p(){l||(l=t.requestAnimationFrame(u))}function h(){t.cancelAnimationFrame(l),a=null,s=0,l=0}function v(){a=null,s=0}return{init:c,destroy:d,start:p,stop:h,update:n,render:r}}function AO(e,t){const n=t==="rtl",r=e==="y",o=r?"y":"x",i=r?"x":"y",a=!r&&n?-1:1,s=d(),l=u();function c(v){const{height:g,width:b}=v;return r?g:b}function d(){return r?"top":n?"right":"left"}function u(){return r?"bottom":n?"left":"right"}function p(v){return v*a}return{scroll:o,cross:i,startEdge:s,endEdge:l,measureSize:c,direction:p}}function Sn(e=0,t=0){const n=Re(e-t);function r(c){return c<e}function o(c){return c>t}function i(c){return r(c)||o(c)}function a(c){return i(c)?r(c)?e:t:c}function s(c){return n?c-n*Math.ceil((c-t)/n):c}return{length:n,max:t,min:e,constrain:a,reachedAny:i,reachedMax:o,reachedMin:r,removeOffset:s}}function Wm(e,t,n){const{constrain:r}=Sn(0,e),o=e+1;let i=a(t);function a(p){return n?Re((o+p)%o):r(p)}function s(){return i}function l(p){return i=a(p),u}function c(p){return d().set(s()+p)}function d(){return Wm(e,s(),n)}const u={get:s,set:l,add:c,clone:d};return u}function RO(e,t,n,r,o,i,a,s,l,c,d,u,p,h,v,g,b,x,y){const{cross:w,direction:S}=e,P=["INPUT","SELECT","TEXTAREA"],C={passive:!1},T=Pr(),I=Pr(),R=Sn(50,225).constrain(h.measure(20)),E={mouse:300,touch:400},N={mouse:500,touch:600},A=v?43:25;let j=!1,$=0,O=0,B=!1,W=!1,Y=!1,V=!1;function k(G){if(!y)return;function se(Te){(vi(y)||y(G,Te))&&ce(Te)}const K=t;T.add(K,"dragstart",Te=>Te.preventDefault(),C).add(K,"touchmove",()=>{},C).add(K,"touchend",()=>{}).add(K,"touchstart",se).add(K,"mousedown",se).add(K,"touchcancel",te).add(K,"contextmenu",te).add(K,"click",me,!0)}function le(){T.clear(),I.clear()}function be(){const G=V?n:t;I.add(G,"touchmove",U,C).add(G,"touchend",te).add(G,"mousemove",U,C).add(G,"mouseup",te)}function _(G){const se=G.nodeName||"";return P.includes(se)}function fe(){return(v?N:E)[V?"mouse":"touch"]}function ke(G,se){const K=u.add(Ws(G)*-1),Te=d.byDistance(G,!v).distance;return v||Re(G)<R?Te:b&&se?Te*.5:d.byIndex(K.get(),0).distance}function ce(G){const se=Ra(G,r);V=se,Y=v&&se&&!G.buttons&&j,j=xr(o.get(),a.get())>=2,!(se&&G.button!==0)&&(_(G.target)||(B=!0,i.pointerDown(G),c.useFriction(0).useDuration(0),o.set(a),be(),$=i.readPoint(G),O=i.readPoint(G,w),p.emit("pointerDown")))}function U(G){if(!Ra(G,r)&&G.touches.length>=2)return te(G);const K=i.readPoint(G),Te=i.readPoint(G,w),Me=xr(K,$),De=xr(Te,O);if(!W&&!V&&(!G.cancelable||(W=Me>De,!W)))return te(G);const bt=i.pointerMove(G);Me>g&&(Y=!0),c.useFriction(.3).useDuration(.75),s.start(),o.add(S(bt)),G.preventDefault()}function te(G){const K=d.byDistance(0,!1).index!==u.get(),Te=i.pointerUp(G)*fe(),Me=ke(S(Te),K),De=TO(Te,Me),bt=A-10*De,ct=x+De/50;W=!1,B=!1,I.clear(),c.useDuration(bt).useFriction(ct),l.distance(Me,!v),V=!1,p.emit("pointerUp")}function me(G){Y&&(G.stopPropagation(),G.preventDefault(),Y=!1)}function ie(){return B}return{init:k,destroy:le,pointerDown:ie}}function jO(e,t){let r,o;function i(u){return u.timeStamp}function a(u,p){const v=`client${(p||e.scroll)==="x"?"X":"Y"}`;return(Ra(u,t)?u:u.touches[0])[v]}function s(u){return r=u,o=u,a(u)}function l(u){const p=a(u)-a(o),h=i(u)-i(r)>170;return o=u,h&&(r=u),p}function c(u){if(!r||!o)return 0;const p=a(o)-a(r),h=i(u)-i(r),v=i(u)-i(o)>170,g=p/h;return h&&!v&&Re(g)>.1?g:0}return{pointerDown:s,pointerMove:l,pointerUp:c,readPoint:a}}function OO(){function e(n){const{offsetTop:r,offsetLeft:o,offsetWidth:i,offsetHeight:a}=n;return{top:r,right:o+i,bottom:r+a,left:o,width:i,height:a}}return{measure:e}}function MO(e){function t(r){return e*(r/100)}return{measure:t}}function DO(e,t,n,r,o,i,a){const s=[e].concat(r);let l,c,d=[],u=!1;function p(b){return o.measureSize(a.measure(b))}function h(b){if(!i)return;c=p(e),d=r.map(p);function x(y){for(const w of y){if(u)return;const S=w.target===e,P=r.indexOf(w.target),C=S?c:d[P],T=p(S?e:r[P]);if(Re(T-C)>=.5){b.reInit(),t.emit("resize");break}}}l=new ResizeObserver(y=>{(vi(i)||i(b,y))&&x(y)}),n.requestAnimationFrame(()=>{s.forEach(y=>l.observe(y))})}function v(){u=!0,l&&l.disconnect()}return{init:h,destroy:v}}function $O(e,t,n,r,o,i){let a=0,s=0,l=o,c=i,d=e.get(),u=0;function p(){const C=r.get()-e.get(),T=!l;let I=0;return T?(a=0,n.set(r),e.set(r),I=C):(n.set(e),a+=C/l,a*=c,d+=a,e.add(a),I=d-u),s=Ws(I),u=d,P}function h(){const C=r.get()-t.get();return Re(C)<.001}function v(){return l}function g(){return s}function b(){return a}function x(){return w(o)}function y(){return S(i)}function w(C){return l=C,P}function S(C){return c=C,P}const P={direction:g,duration:v,velocity:b,seek:p,settled:h,useBaseFriction:y,useBaseDuration:x,useFriction:S,useDuration:w};return P}function zO(e,t,n,r,o){const i=o.measure(10),a=o.measure(50),s=Sn(.1,.99);let l=!1;function c(){return!(l||!e.reachedAny(n.get())||!e.reachedAny(t.get()))}function d(h){if(!c())return;const v=e.reachedMin(t.get())?"min":"max",g=Re(e[v]-t.get()),b=n.get()-t.get(),x=s.constrain(g/a);n.subtract(b*x),!h&&Re(b)<i&&(n.set(e.constrain(n.get())),r.useDuration(25).useBaseFriction())}function u(h){l=!h}return{shouldConstrain:c,constrain:d,toggleActive:u}}function LO(e,t,n,r,o){const i=Sn(-t+e,0),a=u(),s=d(),l=p();function c(v,g){return xr(v,g)<=1}function d(){const v=a[0],g=_t(a),b=a.lastIndexOf(v),x=a.indexOf(g)+1;return Sn(b,x)}function u(){return n.map((v,g)=>{const{min:b,max:x}=i,y=i.constrain(v),w=!g,S=qs(n,g);return w?x:S||c(b,y)?b:c(x,y)?x:y}).map(v=>parseFloat(v.toFixed(3)))}function p(){if(t<=e+o)return[i.max];if(r==="keepSnaps")return a;const{min:v,max:g}=s;return a.slice(v,g)}return{snapsContained:l,scrollContainLimit:s}}function FO(e,t,n){const r=t[0],o=n?r-e:_t(t);return{limit:Sn(o,r)}}function BO(e,t,n,r){const i=t.min+.1,a=t.max+.1,{reachedMin:s,reachedMax:l}=Sn(i,a);function c(p){return p===1?l(n.get()):p===-1?s(n.get()):!1}function d(p){if(!c(p))return;const h=e*(p*-1);r.forEach(v=>v.add(h))}return{loop:d}}function VO(e){const{max:t,length:n}=e;function r(i){const a=i-t;return n?a/-n:0}return{get:r}}function UO(e,t,n,r,o){const{startEdge:i,endEdge:a}=e,{groupSlides:s}=o,l=u().map(t.measure),c=p(),d=h();function u(){return s(r).map(g=>_t(g)[a]-g[0][i]).map(Re)}function p(){return r.map(g=>n[i]-g[i]).map(g=>-Re(g))}function h(){return s(c).map(g=>g[0]).map((g,b)=>g+l[b])}return{snaps:c,snapsAligned:d}}function ZO(e,t,n,r,o,i){const{groupSlides:a}=o,{min:s,max:l}=r,c=d();function d(){const p=a(i),h=!e||t==="keepSnaps";return n.length===1?[i]:h?p:p.slice(s,l).map((v,g,b)=>{const x=!g,y=qs(b,g);if(x){const w=_t(b[0])+1;return Wc(w)}if(y){const w=Zr(i)-_t(b)[0]+1;return Wc(w,_t(b)[0])}return v})}return{slideRegistry:c}}function HO(e,t,n,r,o){const{reachedAny:i,removeOffset:a,constrain:s}=r;function l(v){return v.concat().sort((g,b)=>Re(g)-Re(b))[0]}function c(v){const g=e?a(v):s(v),b=t.map((y,w)=>({diff:d(y-g,0),index:w})).sort((y,w)=>Re(y.diff)-Re(w.diff)),{index:x}=b[0];return{index:x,distance:g}}function d(v,g){const b=[v,v+n,v-n];if(!e)return v;if(!g)return l(b);const x=b.filter(y=>Ws(y)===g);return x.length?l(x):_t(b)-n}function u(v,g){const b=t[v]-o.get(),x=d(b,g);return{index:v,distance:x}}function p(v,g){const b=o.get()+v,{index:x,distance:y}=c(b),w=!e&&i(b);if(!g||w)return{index:x,distance:v};const S=t[x]-y,P=v+d(S,0);return{index:x,distance:P}}return{byDistance:p,byIndex:u,shortcut:d}}function GO(e,t,n,r,o,i,a){function s(u){const p=u.distance,h=u.index!==t.get();i.add(p),p&&(r.duration()?e.start():(e.update(),e.render(1),e.update())),h&&(n.set(t.get()),t.set(u.index),a.emit("select"))}function l(u,p){const h=o.byDistance(u,p);s(h)}function c(u,p){const h=t.clone().set(u),v=o.byIndex(h.get(),p);s(v)}return{distance:l,index:c}}function WO(e,t,n,r,o,i,a,s){const l={passive:!0,capture:!0};let c=0;function d(h){if(!s)return;function v(g){if(new Date().getTime()-c>10)return;a.emit("slideFocusStart"),e.scrollLeft=0;const y=n.findIndex(w=>w.includes(g));Gs(y)&&(o.useDuration(0),r.index(y,0),a.emit("slideFocus"))}i.add(document,"keydown",u,!1),t.forEach((g,b)=>{i.add(g,"focus",x=>{(vi(s)||s(h,x))&&v(b)},l)})}function u(h){h.code==="Tab"&&(c=new Date().getTime())}return{init:d}}function hr(e){let t=e;function n(){return t}function r(l){t=a(l)}function o(l){t+=a(l)}function i(l){t-=a(l)}function a(l){return Gs(l)?l:l.get()}return{get:n,set:r,add:o,subtract:i}}function qm(e,t){const n=e.scroll==="x"?a:s,r=t.style;let o=null,i=!1;function a(p){return`translate3d(${p}px,0px,0px)`}function s(p){return`translate3d(0px,${p}px,0px)`}function l(p){if(i)return;const h=PO(e.direction(p));h!==o&&(r.transform=n(h),o=h)}function c(p){i=!p}function d(){i||(r.transform="",t.getAttribute("style")||t.removeAttribute("style"))}return{clear:d,to:l,toggleActive:c}}function qO(e,t,n,r,o,i,a,s,l){const d=Er(o),u=Er(o).reverse(),p=x().concat(y());function h(T,I){return T.reduce((R,E)=>R-o[E],I)}function v(T,I){return T.reduce((R,E)=>h(R,I)>0?R.concat([E]):R,[])}function g(T){return i.map((I,R)=>({start:I-r[R]+.5+T,end:I+t-.5+T}))}function b(T,I,R){const E=g(I);return T.map(N=>{const A=R?0:-n,j=R?n:0,$=R?"end":"start",O=E[N][$];return{index:N,loopPoint:O,slideLocation:hr(-1),translate:qm(e,l[N]),target:()=>s.get()>O?A:j}})}function x(){const T=a[0],I=v(u,T);return b(I,n,!1)}function y(){const T=t-a[0]-1,I=v(d,T);return b(I,-n,!0)}function w(){return p.every(({index:T})=>{const I=d.filter(R=>R!==T);return h(I,t)<=.1})}function S(){p.forEach(T=>{const{target:I,translate:R,slideLocation:E}=T,N=I();N!==E.get()&&(R.to(N),E.set(N))})}function P(){p.forEach(T=>T.translate.clear())}return{canLoop:w,clear:P,loop:S,loopPoints:p}}function KO(e,t,n){let r,o=!1;function i(l){if(!n)return;function c(d){for(const u of d)if(u.type==="childList"){l.reInit(),t.emit("slidesChanged");break}}r=new MutationObserver(d=>{o||(vi(n)||n(l,d))&&c(d)}),r.observe(e,{childList:!0})}function a(){r&&r.disconnect(),o=!0}return{init:i,destroy:a}}function JO(e,t,n,r){const o={};let i=null,a=null,s,l=!1;function c(){s=new IntersectionObserver(v=>{l||(v.forEach(g=>{const b=t.indexOf(g.target);o[b]=g}),i=null,a=null,n.emit("slidesInView"))},{root:e.parentElement,threshold:r}),t.forEach(v=>s.observe(v))}function d(){s&&s.disconnect(),l=!0}function u(v){return Tr(o).reduce((g,b)=>{const x=parseInt(b),{isIntersecting:y}=o[x];return(v&&y||!v&&!y)&&g.push(x),g},[])}function p(v=!0){if(v&&i)return i;if(!v&&a)return a;const g=u(v);return v&&(i=g),v||(a=g),g}return{init:c,destroy:d,get:p}}function YO(e,t,n,r,o,i){const{measureSize:a,startEdge:s,endEdge:l}=e,c=n[0]&&o,d=v(),u=g(),p=n.map(a),h=b();function v(){if(!c)return 0;const y=n[0];return Re(t[s]-y[s])}function g(){if(!c)return 0;const y=i.getComputedStyle(_t(r));return parseFloat(y.getPropertyValue(`margin-${l}`))}function b(){return n.map((y,w,S)=>{const P=!w,C=qs(S,w);return P?p[w]+d:C?p[w]+u:S[w+1][s]-y[s]}).map(Re)}return{slideSizes:p,slideSizesWithGaps:h,startGap:d,endGap:u}}function XO(e,t,n,r,o,i,a,s,l){const{startEdge:c,endEdge:d,direction:u}=e,p=Gs(n);function h(x,y){return Er(x).filter(w=>w%y===0).map(w=>x.slice(w,w+y))}function v(x){return x.length?Er(x).reduce((y,w,S)=>{const P=_t(y)||0,C=P===0,T=w===Zr(x),I=o[c]-i[P][c],R=o[c]-i[w][d],E=!r&&C?u(a):0,N=!r&&T?u(s):0,A=Re(R-N-(I+E));return S&&A>t+l&&y.push(w),T&&y.push(x.length),y},[]).map((y,w,S)=>{const P=Math.max(S[w-1]||0);return x.slice(P,y)}):[]}function g(x){return p?h(x,n):v(x)}return{groupSlides:g}}function QO(e,t,n,r,o,i,a){const{align:s,axis:l,direction:c,startIndex:d,loop:u,duration:p,dragFree:h,dragThreshold:v,inViewThreshold:g,slidesToScroll:b,skipSnaps:x,containScroll:y,watchResize:w,watchSlides:S,watchDrag:P,watchFocus:C}=i,T=2,I=OO(),R=I.measure(t),E=n.map(I.measure),N=AO(l,c),A=N.measureSize(R),j=MO(A),$=NO(s,A),O=!u&&!!y,B=u||!!y,{slideSizes:W,slideSizesWithGaps:Y,startGap:V,endGap:k}=YO(N,R,E,n,B,o),le=XO(N,A,b,u,R,E,V,k,T),{snaps:be,snapsAligned:_}=UO(N,$,R,E,le),fe=-_t(be)+_t(Y),{snapsContained:ke,scrollContainLimit:ce}=LO(A,fe,_,y,T),U=O?ke:_,{limit:te}=FO(fe,U,u),me=Wm(Zr(U),d,u),ie=me.clone(),Q=Er(n),G=({dragHandler:pe,scrollBody:Ge,scrollBounds:We,options:{loop:qe}})=>{qe||We.constrain(pe.pointerDown()),Ge.seek()},se=({scrollBody:pe,translate:Ge,location:We,offsetLocation:qe,previousLocation:Bt,scrollLooper:Vt,slideLooper:Ke,dragHandler:At,animation:ut,eventHandler:oe,scrollBounds:ye,options:{loop:we}},ge)=>{const Pe=pe.settled(),Je=!ye.shouldConstrain(),Ve=we?Pe:Pe&&Je,wt=Ve&&!At.pointerDown();wt&&ut.stop();const dt=We.get()*ge+Bt.get()*(1-ge);qe.set(dt),we&&(Vt.loop(pe.direction()),Ke.loop()),Ge.to(qe.get()),wt&&oe.emit("settle"),Ve||oe.emit("scroll")},K=IO(r,o,()=>G(ue),pe=>se(ue,pe)),Te=.68,Me=U[me.get()],De=hr(Me),bt=hr(Me),ct=hr(Me),He=hr(Me),It=$O(De,ct,bt,He,p,Te),dn=HO(u,U,fe,te,He),yt=GO(K,me,ie,It,dn,He,a),Pn=VO(te),fn=Pr(),D=JO(t,n,a,g),{slideRegistry:H}=ZO(O,y,U,ce,le,Q),re=WO(e,n,H,yt,It,fn,a,C),ue={ownerDocument:r,ownerWindow:o,eventHandler:a,containerRect:R,slideRects:E,animation:K,axis:N,dragHandler:RO(N,e,r,o,He,jO(N,o),De,K,yt,It,dn,me,a,j,h,v,x,Te,P),eventStore:fn,percentOfView:j,index:me,indexPrevious:ie,limit:te,location:De,offsetLocation:ct,previousLocation:bt,options:i,resizeHandler:DO(t,a,o,n,N,w,I),scrollBody:It,scrollBounds:zO(te,ct,He,It,j),scrollLooper:BO(fe,te,ct,[De,ct,bt,He]),scrollProgress:Pn,scrollSnapList:U.map(Pn.get),scrollSnaps:U,scrollTarget:dn,scrollTo:yt,slideLooper:qO(N,A,fe,W,Y,be,U,ct,n),slideFocus:re,slidesHandler:KO(t,a,S),slidesInView:D,slideIndexes:Q,slideRegistry:H,slidesToScroll:le,target:He,translate:qm(N,t)};return ue}function eM(){let e={},t;function n(c){t=c}function r(c){return e[c]||[]}function o(c){return r(c).forEach(d=>d(t,c)),l}function i(c,d){return e[c]=r(c).concat([d]),l}function a(c,d){return e[c]=r(c).filter(u=>u!==d),l}function s(){e={}}const l={init:n,emit:o,off:a,on:i,clear:s};return l}const tM={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function nM(e){function t(i,a){return Gm(i,a||{})}function n(i){const a=i.breakpoints||{},s=Tr(a).filter(l=>e.matchMedia(l).matches).map(l=>a[l]).reduce((l,c)=>t(l,c),{});return t(i,s)}function r(i){return i.map(a=>Tr(a.breakpoints||{})).reduce((a,s)=>a.concat(s),[]).map(e.matchMedia)}return{mergeOptions:t,optionsAtMedia:n,optionsMediaQueries:r}}function rM(e){let t=[];function n(i,a){return t=a.filter(({options:s})=>e.optionsAtMedia(s).active!==!1),t.forEach(s=>s.init(i,e)),a.reduce((s,l)=>Object.assign(s,{[l.name]:l}),{})}function r(){t=t.filter(i=>i.destroy())}return{init:n,destroy:r}}function Oo(e,t,n){const r=e.ownerDocument,o=r.defaultView,i=nM(o),a=rM(i),s=Pr(),l=eM(),{mergeOptions:c,optionsAtMedia:d,optionsMediaQueries:u}=i,{on:p,off:h,emit:v}=l,g=N;let b=!1,x,y=c(tM,Oo.globalOptions),w=c(y),S=[],P,C,T;function I(){const{container:Q,slides:G}=w;C=(Aa(Q)?e.querySelector(Q):Q)||e.children[0];const K=Aa(G)?C.querySelectorAll(G):G;T=[].slice.call(K||C.children)}function R(Q){const G=QO(e,C,T,r,o,Q,l);if(Q.loop&&!G.slideLooper.canLoop()){const se=Object.assign({},Q,{loop:!1});return R(se)}return G}function E(Q,G){b||(y=c(y,Q),w=d(y),S=G||S,I(),x=R(w),u([y,...S.map(({options:se})=>se)]).forEach(se=>s.add(se,"change",N)),w.active&&(x.translate.to(x.location.get()),x.animation.init(),x.slidesInView.init(),x.slideFocus.init(ie),x.eventHandler.init(ie),x.resizeHandler.init(ie),x.slidesHandler.init(ie),x.options.loop&&x.slideLooper.loop(),C.offsetParent&&T.length&&x.dragHandler.init(ie),P=a.init(ie,S)))}function N(Q,G){const se=le();A(),E(c({startIndex:se},Q),G),l.emit("reInit")}function A(){x.dragHandler.destroy(),x.eventStore.clear(),x.translate.clear(),x.slideLooper.clear(),x.resizeHandler.destroy(),x.slidesHandler.destroy(),x.slidesInView.destroy(),x.animation.destroy(),a.destroy(),s.clear()}function j(){b||(b=!0,s.clear(),A(),l.emit("destroy"),l.clear())}function $(Q,G,se){!w.active||b||(x.scrollBody.useBaseFriction().useDuration(G===!0?0:w.duration),x.scrollTo.index(Q,se||0))}function O(Q){const G=x.index.add(1).get();$(G,Q,-1)}function B(Q){const G=x.index.add(-1).get();$(G,Q,1)}function W(){return x.index.add(1).get()!==le()}function Y(){return x.index.add(-1).get()!==le()}function V(){return x.scrollSnapList}function k(){return x.scrollProgress.get(x.offsetLocation.get())}function le(){return x.index.get()}function be(){return x.indexPrevious.get()}function _(){return x.slidesInView.get()}function fe(){return x.slidesInView.get(!1)}function ke(){return P}function ce(){return x}function U(){return e}function te(){return C}function me(){return T}const ie={canScrollNext:W,canScrollPrev:Y,containerNode:te,internalEngine:ce,destroy:j,off:h,on:p,emit:v,plugins:ke,previousScrollSnap:be,reInit:g,rootNode:U,scrollNext:O,scrollPrev:B,scrollProgress:k,scrollSnapList:V,scrollTo:$,selectedScrollSnap:le,slideNodes:me,slidesInView:_,slidesNotInView:fe};return E(t,n),setTimeout(()=>l.emit("init"),0),ie}Oo.globalOptions=void 0;function Ks(e={},t=[]){const n=m.useRef(e),r=m.useRef(t),[o,i]=m.useState(),[a,s]=m.useState(),l=m.useCallback(()=>{o&&o.reInit(n.current,r.current)},[o]);return m.useEffect(()=>{Hs(n.current,e)||(n.current=e,l())},[e,l]),m.useEffect(()=>{EO(r.current,t)||(r.current=t,l())},[t,l]),m.useEffect(()=>{if(_O()&&a){Oo.globalOptions=Ks.globalOptions;const c=Oo(a,n.current,r.current);return i(c),()=>c.destroy()}else i(void 0)},[a,i]),[s,o]}Ks.globalOptions=void 0;function oM(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const Km=L.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldAnimate:{current:!0},shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),Hr=()=>{const e=L.useContext(Km);if(!e)throw new Error("useDrawerContext must be used within a Drawer.Root");return e};oM(`[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(
122
+ [data-state=closed]
123
+ ){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}`);function iM(){const e=navigator.userAgent;return typeof window<"u"&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))}function aM(){return Js(/^Mac/)}function sM(){return Js(/^iPhone/)}function qc(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function lM(){return Js(/^iPad/)||aM()&&navigator.maxTouchPoints>1}function Jm(){return sM()||lM()}function Js(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.platform):void 0}const cM=24,uM=typeof window<"u"?m.useLayoutEffect:m.useEffect;function Kc(...e){return(...t)=>{for(let n of e)typeof n=="function"&&n(...t)}}const Ji=typeof document<"u"&&window.visualViewport;function Jc(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function Ym(e){for(Jc(e)&&(e=e.parentElement);e&&!Jc(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const dM=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let so=0,Yi;function fM(e={}){let{isDisabled:t}=e;uM(()=>{if(!t)return so++,so===1&&Jm()&&(Yi=pM()),()=>{so--,so===0&&Yi?.()}},[t])}function pM(){let e,t=0,n=u=>{e=Ym(u.target),!(e===document.documentElement&&e===document.body)&&(t=u.changedTouches[0].pageY)},r=u=>{if(!e||e===document.documentElement||e===document.body){u.preventDefault();return}let p=u.changedTouches[0].pageY,h=e.scrollTop,v=e.scrollHeight-e.clientHeight;v!==0&&((h<=0&&p>t||h>=v&&p<t)&&u.preventDefault(),t=p)},o=u=>{let p=u.target;ja(p)&&p!==document.activeElement&&(u.preventDefault(),p.style.transform="translateY(-2000px)",p.focus(),requestAnimationFrame(()=>{p.style.transform=""}))},i=u=>{let p=u.target;ja(p)&&(p.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{p.style.transform="",Ji&&(Ji.height<window.innerHeight?requestAnimationFrame(()=>{Yc(p)}):Ji.addEventListener("resize",()=>Yc(p),{once:!0}))}))},a=()=>{window.scrollTo(0,0)},s=window.pageXOffset,l=window.pageYOffset,c=Kc(hM(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let d=Kc(cr(document,"touchstart",n,{passive:!1,capture:!0}),cr(document,"touchmove",r,{passive:!1,capture:!0}),cr(document,"touchend",o,{passive:!1,capture:!0}),cr(document,"focus",i,!0),cr(window,"scroll",a));return()=>{c(),d(),window.scrollTo(s,l)}}function hM(e,t,n){let r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}function cr(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Yc(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let n=Ym(e);if(n!==document.documentElement&&n!==document.body&&n!==e){let r=n.getBoundingClientRect().top,o=e.getBoundingClientRect().top,i=e.getBoundingClientRect().bottom;const a=n.getBoundingClientRect().bottom+cM;i>a&&(n.scrollTop+=o-r)}e=n.parentElement}}function ja(e){return e instanceof HTMLInputElement&&!dM.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function mM(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function gM(...e){return t=>e.forEach(n=>mM(n,t))}function Xm(...e){return m.useCallback(gM(...e),e)}const Qm=new WeakMap;function Be(e,t,n=!1){if(!e||!(e instanceof HTMLElement))return;let r={};Object.entries(t).forEach(([o,i])=>{if(o.startsWith("--")){e.style.setProperty(o,i);return}r[o]=e.style[o],e.style[o]=i}),!n&&Qm.set(e,r)}function vM(e,t){if(!e||!(e instanceof HTMLElement))return;let n=Qm.get(e);n&&(e.style[t]=n[t])}const ze=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function lo(e,t){if(!e)return null;const n=window.getComputedStyle(e),r=n.transform||n.webkitTransform||n.mozTransform;let o=r.match(/^matrix3d\((.+)\)$/);return o?parseFloat(o[1].split(", ")[ze(t)?13:12]):(o=r.match(/^matrix\((.+)\)$/),o?parseFloat(o[1].split(", ")[ze(t)?5:4]):null)}function xM(e){return 8*(Math.log(e+1)-2)}function Xi(e,t){if(!e)return()=>{};const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}function bM(...e){return(...t)=>{for(const n of e)typeof n=="function"&&n(...t)}}const Ae={DURATION:.5,EASE:[.32,.72,0,1]},eg=.4,yM=.25,wM=100,tg=8,mn=16,Oa=26,Qi="vaul-dragging";function ng(e){const t=L.useRef(e);return L.useEffect(()=>{t.current=e}),L.useMemo(()=>(...n)=>t.current==null?void 0:t.current.call(t,...n),[])}function kM({defaultProp:e,onChange:t}){const n=L.useState(e),[r]=n,o=L.useRef(r),i=ng(t);return L.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}function rg({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=kM({defaultProp:t,onChange:n}),i=e!==void 0,a=i?e:r,s=ng(n),l=L.useCallback(c=>{if(i){const u=typeof c=="function"?c(e):c;u!==e&&s(u)}else o(c)},[i,e,o,s]);return[a,l]}function SM({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:n,drawerRef:r,overlayRef:o,fadeFromIndex:i,onSnapPointChange:a,direction:s="bottom",container:l,snapToSequentialPoint:c}){const[d,u]=rg({prop:e,defaultProp:n?.[0],onChange:t}),[p,h]=L.useState(typeof window<"u"?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);L.useEffect(()=>{function T(){h({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",T),()=>window.removeEventListener("resize",T)},[]);const v=L.useMemo(()=>d===n?.[n.length-1]||null,[n,d]),g=L.useMemo(()=>{var T;return(T=n?.findIndex(I=>I===d))!=null?T:null},[n,d]),b=n&&n.length>0&&(i||i===0)&&!Number.isNaN(i)&&n[i]===d||!n,x=L.useMemo(()=>{const T=l?{width:l.getBoundingClientRect().width,height:l.getBoundingClientRect().height}:typeof window<"u"?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var I;return(I=n?.map(R=>{const E=typeof R=="string";let N=0;if(E&&(N=parseInt(R,10)),ze(s)){const j=E?N:p?R*T.height:0;return p?s==="bottom"?T.height-j:-T.height+j:j}const A=E?N:p?R*T.width:0;return p?s==="right"?T.width-A:-T.width+A:A}))!=null?I:[]},[n,p,l]),y=L.useMemo(()=>g!==null?x?.[g]:null,[x,g]),w=L.useCallback(T=>{var I;const R=(I=x?.findIndex(E=>E===T))!=null?I:null;a(R),Be(r.current,{transition:`transform ${Ae.DURATION}s cubic-bezier(${Ae.EASE.join(",")})`,transform:ze(s)?`translate3d(0, ${T}px, 0)`:`translate3d(${T}px, 0, 0)`}),x&&R!==x.length-1&&i!==void 0&&R!==i&&R<i?Be(o.current,{transition:`opacity ${Ae.DURATION}s cubic-bezier(${Ae.EASE.join(",")})`,opacity:"0"}):Be(o.current,{transition:`opacity ${Ae.DURATION}s cubic-bezier(${Ae.EASE.join(",")})`,opacity:"1"}),u(n?.[Math.max(R,0)])},[r.current,n,x,i,o,u]);L.useEffect(()=>{if(d||e){var T;const I=(T=n?.findIndex(R=>R===e||R===d))!=null?T:-1;x&&I!==-1&&typeof x[I]=="number"&&w(x[I])}},[d,e,n,x,w]);function S({draggedDistance:T,closeDrawer:I,velocity:R,dismissible:E}){if(i===void 0)return;const N=s==="bottom"||s==="right"?(y??0)-T:(y??0)+T,A=g===i-1,j=g===0,$=T>0;if(A&&Be(o.current,{transition:`opacity ${Ae.DURATION}s cubic-bezier(${Ae.EASE.join(",")})`}),!c&&R>2&&!$){E?I():w(x[0]);return}if(!c&&R>2&&$&&x&&n){w(x[n.length-1]);return}const O=x?.reduce((W,Y)=>typeof W!="number"||typeof Y!="number"?W:Math.abs(Y-N)<Math.abs(W-N)?Y:W),B=ze(s)?window.innerHeight:window.innerWidth;if(R>eg&&Math.abs(T)<B*.4){const W=$?1:-1;if(W>0&&v&&n){w(x[n.length-1]);return}if(j&&W<0&&E&&I(),g===null)return;w(x[g+W]);return}w(O)}function P({draggedDistance:T}){if(y===null)return;const I=s==="bottom"||s==="right"?y-T:y+T;(s==="bottom"||s==="right")&&I<x[x.length-1]||(s==="top"||s==="left")&&I>x[x.length-1]||Be(r.current,{transform:ze(s)?`translate3d(0, ${I}px, 0)`:`translate3d(${I}px, 0, 0)`})}function C(T,I){if(!n||typeof g!="number"||!x||i===void 0)return null;const R=g===i-1;if(g>=i&&I)return 0;if(R&&!I)return 1;if(!b&&!R)return null;const N=R?g+1:g-1,A=R?x[N]-x[N-1]:x[N+1]-x[N],j=T/Math.abs(A);return R?1-j:j}return{isLastSnapPoint:v,activeSnapPoint:d,shouldFade:b,getPercentageDragged:C,setActiveSnapPoint:u,activeSnapPointIndex:g,onRelease:S,onDrag:P,snapPointsOffset:x}}const CM=()=>()=>{};function _M(){const{direction:e,isOpen:t,shouldScaleBackground:n,setBackgroundColorOnScale:r,noBodyStyles:o}=Hr(),i=L.useRef(null),a=m.useMemo(()=>document.body.style.backgroundColor,[]);function s(){return(window.innerWidth-Oa)/window.innerWidth}L.useEffect(()=>{if(t&&n){i.current&&clearTimeout(i.current);const l=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!l)return;bM(r&&!o?Xi(document.body,{background:"black"}):CM,Xi(l,{transformOrigin:ze(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${Ae.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Ae.EASE.join(",")})`}));const c=Xi(l,{borderRadius:`${tg}px`,overflow:"hidden",...ze(e)?{transform:`scale(${s()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${s()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{c(),i.current=window.setTimeout(()=>{a?document.body.style.background=a:document.body.style.removeProperty("background")},Ae.DURATION*1e3)}}},[t,n,a])}let ur=null;function EM({isOpen:e,modal:t,nested:n,hasBeenOpened:r,preventScrollRestoration:o,noBodyStyles:i}){const[a,s]=L.useState(()=>typeof window<"u"?window.location.href:""),l=L.useRef(0),c=L.useCallback(()=>{if(qc()&&ur===null&&e&&!i){ur={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};const{scrollX:u,innerHeight:p}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:`${-l.current}px`,left:`${-u}px`,right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{const h=p-window.innerHeight;h&&l.current>=p&&(document.body.style.top=`${-(l.current+h)}px`)}),300)}},[e]),d=L.useCallback(()=>{if(qc()&&ur!==null&&!i){const u=-parseInt(document.body.style.top,10),p=-parseInt(document.body.style.left,10);Object.assign(document.body.style,ur),window.requestAnimationFrame(()=>{if(o&&a!==window.location.href){s(window.location.href);return}window.scrollTo(p,u)}),ur=null}},[a]);return L.useEffect(()=>{function u(){l.current=window.scrollY}return u(),window.addEventListener("scroll",u),()=>{window.removeEventListener("scroll",u)}},[]),L.useEffect(()=>{if(t)return()=>{typeof document>"u"||document.querySelector("[data-vaul-drawer]")||d()}},[t,d]),L.useEffect(()=>{n||!r||(e?(!window.matchMedia("(display-mode: standalone)").matches&&c(),t||window.setTimeout(()=>{d()},500)):d())},[e,r,a,t,n,c,d]),{restorePositionSetting:d}}function TM({open:e,onOpenChange:t,children:n,onDrag:r,onRelease:o,snapPoints:i,shouldScaleBackground:a=!1,setBackgroundColorOnScale:s=!0,closeThreshold:l=yM,scrollLockTimeout:c=wM,dismissible:d=!0,handleOnly:u=!1,fadeFromIndex:p=i&&i.length-1,activeSnapPoint:h,setActiveSnapPoint:v,fixed:g,modal:b=!0,onClose:x,nested:y,noBodyStyles:w=!1,direction:S="bottom",defaultOpen:P=!1,disablePreventScroll:C=!0,snapToSequentialPoint:T=!1,preventScrollRestoration:I=!1,repositionInputs:R=!0,onAnimationEnd:E,container:N,autoFocus:A=!1}){var j,$;const[O=!1,B]=rg({defaultProp:P,prop:e,onChange:oe=>{t?.(oe),!oe&&!y&&H(),setTimeout(()=>{E?.(oe)},Ae.DURATION*1e3),oe&&!b&&typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),oe||(document.body.style.pointerEvents="auto")}}),[W,Y]=L.useState(!1),[V,k]=L.useState(!1),[le,be]=L.useState(!1),_=L.useRef(null),fe=L.useRef(null),ke=L.useRef(null),ce=L.useRef(null),U=L.useRef(null),te=L.useRef(!1),me=L.useRef(null),ie=L.useRef(0),Q=L.useRef(!1),G=L.useRef(!P),se=L.useRef(0),K=L.useRef(null),Te=L.useRef(((j=K.current)==null?void 0:j.getBoundingClientRect().height)||0),Me=L.useRef((($=K.current)==null?void 0:$.getBoundingClientRect().width)||0),De=L.useRef(0),bt=L.useCallback(oe=>{i&&oe===yt.length-1&&(fe.current=new Date)},[]),{activeSnapPoint:ct,activeSnapPointIndex:He,setActiveSnapPoint:It,onRelease:dn,snapPointsOffset:yt,onDrag:Pn,shouldFade:fn,getPercentageDragged:D}=SM({snapPoints:i,activeSnapPointProp:h,setActiveSnapPointProp:v,drawerRef:K,fadeFromIndex:p,overlayRef:_,onSnapPointChange:bt,direction:S,container:N,snapToSequentialPoint:T});fM({isDisabled:!O||V||!b||le||!W||!R||!C});const{restorePositionSetting:H}=EM({isOpen:O,modal:b,nested:y??!1,hasBeenOpened:W,preventScrollRestoration:I,noBodyStyles:w});function re(){return(window.innerWidth-Oa)/window.innerWidth}function ue(oe){var ye,we;!d&&!i||K.current&&!K.current.contains(oe.target)||(Te.current=((ye=K.current)==null?void 0:ye.getBoundingClientRect().height)||0,Me.current=((we=K.current)==null?void 0:we.getBoundingClientRect().width)||0,k(!0),ke.current=new Date,Jm()&&window.addEventListener("touchend",()=>te.current=!1,{once:!0}),oe.target.setPointerCapture(oe.pointerId),ie.current=ze(S)?oe.pageY:oe.pageX)}function pe(oe,ye){var we;let ge=oe;const Pe=(we=window.getSelection())==null?void 0:we.toString(),Je=K.current?lo(K.current,S):null,Ve=new Date;if(ge.tagName==="SELECT"||ge.hasAttribute("data-vaul-no-drag")||ge.closest("[data-vaul-no-drag]"))return!1;if(S==="right"||S==="left")return!0;if(fe.current&&Ve.getTime()-fe.current.getTime()<500)return!1;if(Je!==null&&(S==="bottom"?Je>0:Je<0))return!0;if(Pe&&Pe.length>0)return!1;if(U.current&&Ve.getTime()-U.current.getTime()<c&&Je===0||ye)return U.current=Ve,!1;for(;ge;){if(ge.scrollHeight>ge.clientHeight){if(ge.scrollTop!==0)return U.current=new Date,!1;if(ge.getAttribute("role")==="dialog")return!0}ge=ge.parentNode}return!0}function Ge(oe){if(K.current&&V){const ye=S==="bottom"||S==="right"?1:-1,we=(ie.current-(ze(S)?oe.pageY:oe.pageX))*ye,ge=we>0,Pe=i&&!d&&!ge;if(Pe&&He===0)return;const Je=Math.abs(we),Ve=document.querySelector("[data-vaul-drawer-wrapper]"),wt=S==="bottom"||S==="top"?Te.current:Me.current;let dt=Je/wt;const pn=D(Je,ge);if(pn!==null&&(dt=pn),Pe&&dt>=1||!te.current&&!pe(oe.target,ge))return;if(K.current.classList.add(Qi),te.current=!0,Be(K.current,{transition:"none"}),Be(_.current,{transition:"none"}),i&&Pn({draggedDistance:we}),ge&&!i){const Rt=xM(we),Gr=Math.min(Rt*-1,0)*ye;Be(K.current,{transform:ze(S)?`translate3d(0, ${Gr}px, 0)`:`translate3d(${Gr}px, 0, 0)`});return}const Gt=1-dt;if((fn||p&&He===p-1)&&(r?.(oe,dt),Be(_.current,{opacity:`${Gt}`,transition:"none"},!0)),Ve&&_.current&&a){const Rt=Math.min(re()+dt*(1-re()),1),Gr=8-dt*8,Xs=Math.max(0,14-dt*14);Be(Ve,{borderRadius:`${Gr}px`,transform:ze(S)?`scale(${Rt}) translate3d(0, ${Xs}px, 0)`:`scale(${Rt}) translate3d(${Xs}px, 0, 0)`,transition:"none"},!0)}if(!i){const Rt=Je*ye;Be(K.current,{transform:ze(S)?`translate3d(0, ${Rt}px, 0)`:`translate3d(${Rt}px, 0, 0)`})}}}L.useEffect(()=>{window.requestAnimationFrame(()=>{G.current=!0})},[]),L.useEffect(()=>{var oe;function ye(){if(!K.current||!R)return;const we=document.activeElement;if(ja(we)||Q.current){var ge;const Pe=((ge=window.visualViewport)==null?void 0:ge.height)||0,Je=window.innerHeight;let Ve=Je-Pe;const wt=K.current.getBoundingClientRect().height||0,dt=wt>Je*.8;De.current||(De.current=wt);const pn=K.current.getBoundingClientRect().top;if(Math.abs(se.current-Ve)>60&&(Q.current=!Q.current),i&&i.length>0&&yt&&He){const Gt=yt[He]||0;Ve+=Gt}if(se.current=Ve,wt>Pe||Q.current){const Gt=K.current.getBoundingClientRect().height;let Rt=Gt;Gt>Pe&&(Rt=Pe-(dt?pn:Oa)),g?K.current.style.height=`${Gt-Math.max(Ve,0)}px`:K.current.style.height=`${Math.max(Rt,Pe-pn)}px`}else iM()||(K.current.style.height=`${De.current}px`);i&&i.length>0&&!Q.current?K.current.style.bottom="0px":K.current.style.bottom=`${Math.max(Ve,0)}px`}}return(oe=window.visualViewport)==null||oe.addEventListener("resize",ye),()=>{var we;return(we=window.visualViewport)==null?void 0:we.removeEventListener("resize",ye)}},[He,i,yt]);function We(oe){Bt(),x?.(),oe||B(!1),setTimeout(()=>{i&&It(i[0])},Ae.DURATION*1e3)}function qe(){if(!K.current)return;const oe=document.querySelector("[data-vaul-drawer-wrapper]"),ye=lo(K.current,S);Be(K.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${Ae.DURATION}s cubic-bezier(${Ae.EASE.join(",")})`}),Be(_.current,{transition:`opacity ${Ae.DURATION}s cubic-bezier(${Ae.EASE.join(",")})`,opacity:"1"}),a&&ye&&ye>0&&O&&Be(oe,{borderRadius:`${tg}px`,overflow:"hidden",...ze(S)?{transform:`scale(${re()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${re()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${Ae.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Ae.EASE.join(",")})`},!0)}function Bt(){!V||!K.current||(K.current.classList.remove(Qi),te.current=!1,k(!1),ce.current=new Date)}function Vt(oe){if(!V||!K.current)return;K.current.classList.remove(Qi),te.current=!1,k(!1),ce.current=new Date;const ye=lo(K.current,S);if(!oe||!pe(oe.target,!1)||!ye||Number.isNaN(ye)||ke.current===null)return;const we=ce.current.getTime()-ke.current.getTime(),ge=ie.current-(ze(S)?oe.pageY:oe.pageX),Pe=Math.abs(ge)/we;if(Pe>.05&&(be(!0),setTimeout(()=>{be(!1)},200)),i){dn({draggedDistance:ge*(S==="bottom"||S==="right"?1:-1),closeDrawer:We,velocity:Pe,dismissible:d}),o?.(oe,!0);return}if(S==="bottom"||S==="right"?ge>0:ge<0){qe(),o?.(oe,!0);return}if(Pe>eg){We(),o?.(oe,!1);return}var Je;const Ve=Math.min((Je=K.current.getBoundingClientRect().height)!=null?Je:0,window.innerHeight);var wt;const dt=Math.min((wt=K.current.getBoundingClientRect().width)!=null?wt:0,window.innerWidth),pn=S==="left"||S==="right";if(Math.abs(ye)>=(pn?dt:Ve)*l){We(),o?.(oe,!1);return}o?.(oe,!0),qe()}L.useEffect(()=>(O&&(Be(document.documentElement,{scrollBehavior:"auto"}),fe.current=new Date),()=>{vM(document.documentElement,"scrollBehavior")}),[O]);function Ke(oe){const ye=oe?(window.innerWidth-mn)/window.innerWidth:1,we=oe?-mn:0;me.current&&window.clearTimeout(me.current),Be(K.current,{transition:`transform ${Ae.DURATION}s cubic-bezier(${Ae.EASE.join(",")})`,transform:ze(S)?`scale(${ye}) translate3d(0, ${we}px, 0)`:`scale(${ye}) translate3d(${we}px, 0, 0)`}),!oe&&K.current&&(me.current=setTimeout(()=>{const ge=lo(K.current,S);Be(K.current,{transition:"none",transform:ze(S)?`translate3d(0, ${ge}px, 0)`:`translate3d(${ge}px, 0, 0)`})},500))}function At(oe,ye){if(ye<0)return;const we=(window.innerWidth-mn)/window.innerWidth,ge=we+ye*(1-we),Pe=-mn+ye*mn;Be(K.current,{transform:ze(S)?`scale(${ge}) translate3d(0, ${Pe}px, 0)`:`scale(${ge}) translate3d(${Pe}px, 0, 0)`,transition:"none"})}function ut(oe,ye){const we=ze(S)?window.innerHeight:window.innerWidth,ge=ye?(we-mn)/we:1,Pe=ye?-mn:0;ye&&Be(K.current,{transition:`transform ${Ae.DURATION}s cubic-bezier(${Ae.EASE.join(",")})`,transform:ze(S)?`scale(${ge}) translate3d(0, ${Pe}px, 0)`:`scale(${ge}) translate3d(${Pe}px, 0, 0)`})}return L.useEffect(()=>{b||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[b]),L.createElement(Vf,{defaultOpen:P,onOpenChange:oe=>{!d&&!oe||(oe?Y(!0):We(!0),B(oe))},open:O},L.createElement(Km.Provider,{value:{activeSnapPoint:ct,snapPoints:i,setActiveSnapPoint:It,drawerRef:K,overlayRef:_,onOpenChange:t,onPress:ue,onRelease:Vt,onDrag:Ge,dismissible:d,shouldAnimate:G,handleOnly:u,isOpen:O,isDragging:V,shouldFade:fn,closeDrawer:We,onNestedDrag:At,onNestedOpenChange:Ke,onNestedRelease:ut,keyboardIsOpen:Q,modal:b,snapPointsOffset:yt,activeSnapPointIndex:He,direction:S,shouldScaleBackground:a,setBackgroundColorOnScale:s,noBodyStyles:w,container:N,autoFocus:A}},n))}const og=L.forwardRef(function({...e},t){const{overlayRef:n,snapPoints:r,onRelease:o,shouldFade:i,isOpen:a,modal:s,shouldAnimate:l}=Hr(),c=Xm(t,n),d=r&&r.length>0;if(!s)return null;const u=L.useCallback(p=>o(p),[o]);return L.createElement(Zf,{onMouseUp:u,ref:c,"data-vaul-overlay":"","data-vaul-snap-points":a&&d?"true":"false","data-vaul-snap-points-overlay":a&&i?"true":"false","data-vaul-animate":l?.current?"true":"false",...e})});og.displayName="Drawer.Overlay";const ig=L.forwardRef(function({onPointerDownOutside:e,style:t,onOpenAutoFocus:n,...r},o){const{drawerRef:i,onPress:a,onRelease:s,onDrag:l,keyboardIsOpen:c,snapPointsOffset:d,activeSnapPointIndex:u,modal:p,isOpen:h,direction:v,snapPoints:g,container:b,handleOnly:x,shouldAnimate:y,autoFocus:w}=Hr(),[S,P]=L.useState(!1),C=Xm(o,i),T=L.useRef(null),I=L.useRef(null),R=L.useRef(!1),E=g&&g.length>0;_M();const N=(j,$,O=0)=>{if(R.current)return!0;const B=Math.abs(j.y),W=Math.abs(j.x),Y=W>B,V=["bottom","right"].includes($)?1:-1;if($==="left"||$==="right"){if(!(j.x*V<0)&&W>=0&&W<=O)return Y}else if(!(j.y*V<0)&&B>=0&&B<=O)return!Y;return R.current=!0,!0};L.useEffect(()=>{E&&window.requestAnimationFrame(()=>{P(!0)})},[]);function A(j){T.current=null,R.current=!1,s(j)}return L.createElement(Hf,{"data-vaul-drawer-direction":v,"data-vaul-drawer":"","data-vaul-delayed-snap-points":S?"true":"false","data-vaul-snap-points":h&&E?"true":"false","data-vaul-custom-container":b?"true":"false","data-vaul-animate":y?.current?"true":"false",...r,ref:C,style:d&&d.length>0?{"--snap-point-height":`${d[u??0]}px`,...t}:t,onPointerDown:j=>{x||(r.onPointerDown==null||r.onPointerDown.call(r,j),T.current={x:j.pageX,y:j.pageY},a(j))},onOpenAutoFocus:j=>{n?.(j),w||j.preventDefault()},onPointerDownOutside:j=>{if(e?.(j),!p||j.defaultPrevented){j.preventDefault();return}c.current&&(c.current=!1)},onFocusOutside:j=>{if(!p){j.preventDefault();return}},onPointerMove:j=>{if(I.current=j,x||(r.onPointerMove==null||r.onPointerMove.call(r,j),!T.current))return;const $=j.pageY-T.current.y,O=j.pageX-T.current.x,B=j.pointerType==="touch"?10:2;N({x:O,y:$},v,B)?l(j):(Math.abs(O)>B||Math.abs($)>B)&&(T.current=null)},onPointerUp:j=>{r.onPointerUp==null||r.onPointerUp.call(r,j),T.current=null,R.current=!1,s(j)},onPointerOut:j=>{r.onPointerOut==null||r.onPointerOut.call(r,j),A(I.current)},onContextMenu:j=>{r.onContextMenu==null||r.onContextMenu.call(r,j),I.current&&A(I.current)}})});ig.displayName="Drawer.Content";const PM=250,NM=120,IM=L.forwardRef(function({preventCycle:e=!1,children:t,...n},r){const{closeDrawer:o,isDragging:i,snapPoints:a,activeSnapPoint:s,setActiveSnapPoint:l,dismissible:c,handleOnly:d,isOpen:u,onPress:p,onDrag:h}=Hr(),v=L.useRef(null),g=L.useRef(!1);function b(){if(g.current){w();return}window.setTimeout(()=>{x()},NM)}function x(){if(i||e||g.current){w();return}if(w(),!a||a.length===0){c||o();return}if(s===a[a.length-1]&&c){o();return}const P=a.findIndex(T=>T===s);if(P===-1)return;const C=a[P+1];l(C)}function y(){v.current=window.setTimeout(()=>{g.current=!0},PM)}function w(){v.current&&window.clearTimeout(v.current),g.current=!1}return L.createElement("div",{onClick:b,onPointerCancel:w,onPointerDown:S=>{d&&p(S),y()},onPointerMove:S=>{d&&h(S)},ref:r,"data-vaul-drawer-visible":u?"true":"false","data-vaul-handle":"","aria-hidden":"true",...n},L.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},t))});IM.displayName="Drawer.Handle";function AM(e){const t=Hr(),{container:n=t.container,...r}=e;return L.createElement(Uf,{container:n,...r})}const or={Root:TM,Content:ig,Overlay:og,Portal:AM,Title:Gf,Description:Wf};function q(...e){return Ng(Ig(e))}var ag=Nr("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function br({className:e,variant:t="default",size:n="default",asChild:r=!1,...o}){const i=r?Kd:"button";return f.jsx(i,{"data-slot":"button","data-variant":t,"data-size":n,className:q(ag({variant:t,size:n,className:e})),...o})}function RM({className:e,...t}){return f.jsx("div",{"data-slot":"card",className:q("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function jM({className:e,...t}){return f.jsx("div",{"data-slot":"card-header",className:q("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function OM({className:e,...t}){return f.jsx("div",{"data-slot":"card-title",className:q("leading-none font-semibold",e),...t})}function MM({className:e,...t}){return f.jsx("div",{"data-slot":"card-description",className:q("text-muted-foreground text-sm",e),...t})}function DM({className:e,...t}){return f.jsx("div",{"data-slot":"card-content",className:q("px-6",e),...t})}function $M({className:e,type:t,...n}){return f.jsx("input",{type:t,"data-slot":"input",className:q("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...n})}function Ut({className:e,...t}){return f.jsx(IA,{"data-slot":"label",className:q("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}function zM({className:e,...t}){return f.jsx("textarea",{"data-slot":"textarea",className:q("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...t})}function LM({className:e,...t}){return f.jsx(np,{"data-slot":"checkbox",className:q("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:f.jsx(op,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none",children:f.jsx(Hm,{className:"size-3.5"})})})}function FM({className:e,size:t="default",...n}){return f.jsx(bj,{"data-slot":"switch","data-size":t,className:q("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 group/switch inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6",e),...n,children:f.jsx(yj,{"data-slot":"switch-thumb",className:q("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block rounded-full ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}function BM({className:e,value:t,...n}){return f.jsx(YA,{"data-slot":"progress",className:q("bg-primary/20 relative h-2 w-full overflow-hidden rounded-full",e),...n,children:f.jsx(XA,{"data-slot":"progress-indicator",className:"bg-primary h-full w-full flex-1 transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})})}function VM({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return f.jsx(KR,{"data-slot":"separator",decorative:n,orientation:t,className:q("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...r})}var UM=Nr("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"}},defaultVariants:{variant:"default"}});function ZM({className:e,variant:t,...n}){return f.jsx("div",{"data-slot":"alert",role:"alert",className:q(UM({variant:t}),e),...n})}function HM({className:e,...t}){return f.jsx("div",{"data-slot":"alert-title",className:q("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...t})}function GM({className:e,...t}){return f.jsx("div",{"data-slot":"alert-description",className:q("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",e),...t})}function WM({...e}){return f.jsx(Vf,{"data-slot":"dialog",...e})}function qM({...e}){return f.jsx(Uf,{"data-slot":"dialog-portal",...e})}function KM({className:e,...t}){return f.jsx(Zf,{"data-slot":"dialog-overlay",className:q("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function JM({className:e,children:t,showCloseButton:n=!0,...r}){return f.jsxs(qM,{"data-slot":"dialog-portal",children:[f.jsx(KM,{}),f.jsxs(Hf,{"data-slot":"dialog-content",className:q("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 outline-none sm:max-w-lg",e),...r,children:[t,n&&f.jsxs(ON,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[f.jsx(SO,{}),f.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function YM({className:e,...t}){return f.jsx("div",{"data-slot":"dialog-header",className:q("flex flex-col gap-2 text-center sm:text-left",e),...t})}function XM({className:e,...t}){return f.jsx(Gf,{"data-slot":"dialog-title",className:q("text-lg leading-none font-semibold",e),...t})}function QM({className:e,...t}){return f.jsx(Wf,{"data-slot":"dialog-description",className:q("text-muted-foreground text-sm",e),...t})}function Xc({...e}){return f.jsx(xP,{"data-slot":"accordion",...e})}function eD({className:e,...t}){return f.jsx(bP,{"data-slot":"accordion-item",className:q("border-b last:border-b-0",e),...t})}function tD({className:e,children:t,...n}){return f.jsx(yP,{className:"flex",children:f.jsxs(wP,{"data-slot":"accordion-trigger",className:q("focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",e),...n,children:[t,f.jsx(Zs,{className:"text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200"})]})})}function nD({className:e,children:t,...n}){return f.jsx(kP,{"data-slot":"accordion-content",className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",...n,children:f.jsx("div",{className:q("pt-0 pb-4",e),children:t})})}function rD({className:e,...t}){return f.jsx(FN,{"data-slot":"avatar",className:q("relative flex size-10 shrink-0 overflow-hidden rounded-full",e),...t})}function oD({className:e,...t}){return f.jsx(BN,{"data-slot":"avatar-image",className:q("aspect-square size-full",e),...t})}function iD({className:e,...t}){return f.jsx(VN,{"data-slot":"avatar-fallback",className:q("bg-muted flex size-full items-center justify-center rounded-full",e),...t})}var aD=Nr("inline-flex items-center justify-center rounded-full border border-transparent px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function sD({className:e,variant:t="default",asChild:n=!1,...r}){const o=n?Kd:"span";return f.jsx(o,{"data-slot":"badge","data-variant":t,className:q(aD({variant:t}),e),...r})}function lD({className:e,...t}){return f.jsx(lR,{"data-slot":"radio-group",className:q("grid gap-3",e),...t})}function cD({className:e,...t}){return f.jsx(cR,{"data-slot":"radio-group-item",className:q("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:f.jsx(uR,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:f.jsx(bO,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})})})}function uD({...e}){return f.jsx(OR,{"data-slot":"select",...e})}function dD({...e}){return f.jsx(DR,{"data-slot":"select-value",...e})}function fD({className:e,size:t="default",children:n,...r}){return f.jsxs(MR,{"data-slot":"select-trigger","data-size":t,className:q("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[n,f.jsx($R,{asChild:!0,children:f.jsx(Zs,{className:"size-4 opacity-50"})})]})}function pD({className:e,children:t,position:n="item-aligned",align:r="center",...o}){return f.jsx(zR,{children:f.jsxs(LR,{"data-slot":"select-content",className:q("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,align:r,...o,children:[f.jsx(mD,{}),f.jsx(FR,{className:q("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),f.jsx(gD,{})]})})}function hD({className:e,children:t,...n}){return f.jsxs(BR,{"data-slot":"select-item",className:q("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[f.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:f.jsx(UR,{children:f.jsx(Hm,{className:"size-4"})})}),f.jsx(VR,{children:t})]})}function mD({className:e,...t}){return f.jsx(ZR,{"data-slot":"select-scroll-up-button",className:q("flex cursor-default items-center justify-center py-1",e),...t,children:f.jsx(vO,{className:"size-4"})})}function gD({className:e,...t}){return f.jsx(HR,{"data-slot":"select-scroll-down-button",className:q("flex cursor-default items-center justify-center py-1",e),...t,children:f.jsx(Zs,{className:"size-4"})})}var sg=m.createContext(null);function xi(){const e=m.useContext(sg);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}function vD({orientation:e="horizontal",opts:t,setApi:n,plugins:r,className:o,children:i,...a}){const[s,l]=Ks({...t,axis:e==="horizontal"?"x":"y"},r),[c,d]=m.useState(!1),[u,p]=m.useState(!1),h=m.useCallback(x=>{x&&(d(x.canScrollPrev()),p(x.canScrollNext()))},[]),v=m.useCallback(()=>{l?.scrollPrev()},[l]),g=m.useCallback(()=>{l?.scrollNext()},[l]),b=m.useCallback(x=>{x.key==="ArrowLeft"?(x.preventDefault(),v()):x.key==="ArrowRight"&&(x.preventDefault(),g())},[v,g]);return m.useEffect(()=>{!l||!n||n(l)},[l,n]),m.useEffect(()=>{if(l)return h(l),l.on("reInit",h),l.on("select",h),()=>{l?.off("select",h)}},[l,h]),f.jsx(sg.Provider,{value:{carouselRef:s,api:l,opts:t,orientation:e||(t?.axis==="y"?"vertical":"horizontal"),scrollPrev:v,scrollNext:g,canScrollPrev:c,canScrollNext:u},children:f.jsx("div",{onKeyDownCapture:b,className:q("relative",o),role:"region","aria-roledescription":"carousel","data-slot":"carousel",...a,children:i})})}function xD({className:e,...t}){const{carouselRef:n,orientation:r}=xi();return f.jsx("div",{ref:n,className:"overflow-hidden","data-slot":"carousel-content",children:f.jsx("div",{className:q("flex",r==="horizontal"?"-ml-4":"-mt-4 flex-col",e),...t})})}function bD({className:e,...t}){const{orientation:n}=xi();return f.jsx("div",{role:"group","aria-roledescription":"slide","data-slot":"carousel-item",className:q("min-w-0 shrink-0 grow-0 basis-full",n==="horizontal"?"pl-4":"pt-4",e),...t})}function yD({className:e,variant:t="outline",size:n="icon",...r}){const{orientation:o,scrollPrev:i,canScrollPrev:a}=xi();return f.jsxs(br,{"data-slot":"carousel-previous",variant:t,size:n,className:q("absolute size-8 rounded-full",o==="horizontal"?"top-1/2 -left-12 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",e),disabled:!a,onClick:i,...r,children:[f.jsx(sO,{}),f.jsx("span",{className:"sr-only",children:"Previous slide"})]})}function wD({className:e,variant:t="outline",size:n="icon",...r}){const{orientation:o,scrollNext:i,canScrollNext:a}=xi();return f.jsxs(br,{"data-slot":"carousel-next",variant:t,size:n,className:q("absolute size-8 rounded-full",o==="horizontal"?"top-1/2 -right-12 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",e),disabled:!a,onClick:i,...r,children:[f.jsx(cO,{}),f.jsx("span",{className:"sr-only",children:"Next slide"})]})}function kD({...e}){return f.jsx(rf,{"data-slot":"collapsible",...e})}function SD({...e}){return f.jsx(fs,{"data-slot":"collapsible-trigger",...e})}function CD({...e}){return f.jsx(hs,{"data-slot":"collapsible-content",...e})}function _D({className:e,...t}){return f.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:f.jsx("table",{"data-slot":"table",className:q("w-full caption-bottom text-sm",e),...t})})}function ED({className:e,...t}){return f.jsx("thead",{"data-slot":"table-header",className:q("[&_tr]:border-b",e),...t})}function TD({className:e,...t}){return f.jsx("tbody",{"data-slot":"table-body",className:q("[&_tr:last-child]:border-0",e),...t})}function Qc({className:e,...t}){return f.jsx("tr",{"data-slot":"table-row",className:q("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function PD({className:e,...t}){return f.jsx("th",{"data-slot":"table-head",className:q("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function ND({className:e,...t}){return f.jsx("td",{"data-slot":"table-cell",className:q("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function ID({className:e,...t}){return f.jsx("caption",{"data-slot":"table-caption",className:q("text-muted-foreground mt-4 text-sm",e),...t})}function AD({...e}){return f.jsx(or.Root,{"data-slot":"drawer",...e})}function RD({...e}){return f.jsx(or.Portal,{"data-slot":"drawer-portal",...e})}function jD({className:e,...t}){return f.jsx(or.Overlay,{"data-slot":"drawer-overlay",className:q("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function OD({className:e,children:t,...n}){return f.jsxs(RD,{"data-slot":"drawer-portal",children:[f.jsx(jD,{}),f.jsxs(or.Content,{"data-slot":"drawer-content",className:q("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",e),...n,children:[f.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),t]})]})}function MD({className:e,...t}){return f.jsx("div",{"data-slot":"drawer-header",className:q("flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left",e),...t})}function DD({className:e,...t}){return f.jsx(or.Title,{"data-slot":"drawer-title",className:q("text-foreground font-semibold",e),...t})}function $D({className:e,...t}){return f.jsx(or.Description,{"data-slot":"drawer-description",className:q("text-muted-foreground text-sm",e),...t})}function zD({...e}){return f.jsx(CA,{"data-slot":"dropdown-menu",...e})}function LD({...e}){return f.jsx(_A,{"data-slot":"dropdown-menu-trigger",...e})}function FD({className:e,sideOffset:t=4,...n}){return f.jsx(EA,{children:f.jsx(TA,{"data-slot":"dropdown-menu-content",sideOffset:t,className:q("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...n})})}function BD({className:e,inset:t,variant:n="default",...r}){return f.jsx(PA,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:q("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r})}function VD({className:e,...t}){return f.jsx("nav",{role:"navigation","aria-label":"pagination","data-slot":"pagination",className:q("mx-auto flex w-full justify-center",e),...t})}function UD({className:e,...t}){return f.jsx("ul",{"data-slot":"pagination-content",className:q("flex flex-row items-center gap-1",e),...t})}function co({...e}){return f.jsx("li",{"data-slot":"pagination-item",...e})}function Ys({className:e,isActive:t,size:n="icon",...r}){return f.jsx("a",{"aria-current":t?"page":void 0,"data-slot":"pagination-link","data-active":t,className:q(ag({variant:t?"outline":"ghost",size:n}),e),...r})}function ZD({className:e,...t}){return f.jsxs(Ys,{"aria-label":"Go to previous page",size:"default",className:q("gap-1 px-2.5 sm:pl-2.5",e),...t,children:[f.jsx(pO,{}),f.jsx("span",{className:"hidden sm:block",children:"Previous"})]})}function HD({className:e,...t}){return f.jsxs(Ys,{"aria-label":"Go to next page",size:"default",className:q("gap-1 px-2.5 sm:pr-2.5",e),...t,children:[f.jsx("span",{className:"hidden sm:block",children:"Next"}),f.jsx(mO,{})]})}function GD({className:e,...t}){return f.jsxs("span",{"aria-hidden":!0,"data-slot":"pagination-ellipsis",className:q("flex size-9 items-center justify-center",e),...t,children:[f.jsx(wO,{className:"size-4"}),f.jsx("span",{className:"sr-only",children:"More pages"})]})}function WD({...e}){return f.jsx(BA,{"data-slot":"popover",...e})}function qD({...e}){return f.jsx(VA,{"data-slot":"popover-trigger",...e})}function KD({className:e,align:t="center",sideOffset:n=4,...r}){return f.jsx(UA,{children:f.jsx(ZA,{"data-slot":"popover-content",align:t,sideOffset:n,className:q("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...r})})}function JD({className:e,...t}){return f.jsx("div",{"data-slot":"skeleton",className:q("bg-accent animate-pulse rounded-md",e),...t})}function YD({className:e,defaultValue:t,value:n,min:r=0,max:o=100,...i}){const a=m.useMemo(()=>Array.isArray(n)?n:Array.isArray(t)?t:[r,o],[n,t,r,o]);return f.jsxs(dj,{"data-slot":"slider",defaultValue:t,value:n,min:r,max:o,className:q("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",e),...i,children:[f.jsx(fj,{"data-slot":"slider-track",className:q("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:f.jsx(pj,{"data-slot":"slider-range",className:q("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:a.length},(s,l)=>f.jsx(hj,{"data-slot":"slider-thumb",className:"border-primary ring-ring/50 block size-4 shrink-0 rounded-full border bg-white shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},l))]})}function XD({className:e,orientation:t="horizontal",...n}){return f.jsx(Cj,{"data-slot":"tabs","data-orientation":t,orientation:t,className:q("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",e),...n})}var QD=Nr("rounded-lg p-[3px] group-data-[orientation=horizontal]/tabs:h-9 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function e$({className:e,variant:t="default",...n}){return f.jsx(_j,{"data-slot":"tabs-list","data-variant":t,className:q(QD({variant:t}),e),...n})}function t$({className:e,...t}){return f.jsx(Ej,{"data-slot":"tabs-trigger",className:q("focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent","data-[state=active]:bg-background dark:data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 data-[state=active]:text-foreground","after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",e),...t})}var lg=Nr("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}});function n$({className:e,variant:t,size:n,...r}){return f.jsx(Tj,{"data-slot":"toggle",className:q(lg({variant:t,size:n,className:e})),...r})}var cg=m.createContext({size:"default",variant:"default",spacing:0});function eu({className:e,variant:t,size:n,spacing:r=0,children:o,...i}){return f.jsx(Rj,{"data-slot":"toggle-group","data-variant":t,"data-size":n,"data-spacing":r,style:{"--gap":r},className:q("group/toggle-group flex w-fit items-center gap-[--spacing(var(--gap))] rounded-md data-[spacing=default]:data-[variant=outline]:shadow-xs",e),...i,children:f.jsx(cg.Provider,{value:{variant:t,size:n,spacing:r},children:o})})}function tu({className:e,children:t,variant:n,size:r,...o}){const i=m.useContext(cg);return f.jsx(jj,{"data-slot":"toggle-group-item","data-variant":i.variant||n,"data-size":i.size||r,"data-spacing":i.spacing,className:q(lg({variant:i.variant||n,size:i.size||r}),"w-auto min-w-0 shrink-0 px-3 focus:z-10 focus-visible:z-10","data-[spacing=0]:rounded-none data-[spacing=0]:shadow-none data-[spacing=0]:first:rounded-l-md data-[spacing=0]:last:rounded-r-md data-[spacing=0]:data-[variant=outline]:border-l-0 data-[spacing=0]:data-[variant=outline]:first:border-l",e),...o,children:t})}function r$({delayDuration:e=0,...t}){return f.jsx(Kj,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function o$({...e}){return f.jsx(Jj,{"data-slot":"tooltip",...e})}function i$({...e}){return f.jsx(Yj,{"data-slot":"tooltip-trigger",...e})}function a$({className:e,sideOffset:t=0,children:n,...r}){return f.jsx(Xj,{children:f.jsxs(Qj,{"data-slot":"tooltip-content",sideOffset:t,className:q("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...r,children:[n,f.jsx(eO,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}function s$(e,t){if(t<=7)return Array.from({length:t},(i,a)=>a+1);const n=[];n.push(1),e>3&&n.push("ellipsis");const r=Math.max(2,e-1),o=Math.min(t-1,e+1);for(let i=r;i<=o;i++)n.push(i);return e<t-2&&n.push("ellipsis"),n.push(t),n}var l$={Card:({props:e,children:t})=>{const n=e.maxWidth==="sm"?"max-w-xs sm:min-w-[280px]":e.maxWidth==="md"?"max-w-sm sm:min-w-[320px]":e.maxWidth==="lg"?"max-w-md sm:min-w-[360px]":"w-full",r=e.centered?"mx-auto":"";return f.jsxs(RM,{className:q(n,r),children:[(e.title||e.description)&&f.jsxs(jM,{children:[e.title&&f.jsx(OM,{children:e.title}),e.description&&f.jsx(MM,{children:e.description})]}),f.jsx(DM,{className:"flex flex-col gap-3",children:t})]})},Stack:({props:e,children:t})=>{const n=e.direction==="horizontal",r={none:"gap-0",sm:"gap-2",md:"gap-3",lg:"gap-4"},o={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch"},i={start:"",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around"},a=r[e.gap??"md"]??"gap-3",s=o[e.align??"start"]??"items-start",l=i[e.justify??""]??"";return f.jsx("div",{className:`flex ${n?"flex-row flex-wrap":"flex-col"} ${a} ${s} ${l}`,children:t})},Grid:({props:e,children:t})=>{const n={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6"},r={sm:"gap-2",md:"gap-3",lg:"gap-4"},o=Math.max(1,Math.min(6,e.columns??1)),i=n[o]??"grid-cols-1",a=r[e.gap??"md"]??"gap-3";return f.jsx("div",{className:`grid ${i} ${a}`,children:t})},Separator:({props:e})=>f.jsx(VM,{orientation:e.orientation??"horizontal",className:e.orientation==="vertical"?"h-full mx-2":"my-3"}),Tabs:({props:e,children:t,bindings:n,emit:r})=>{const o=e.tabs??[],[i,a]=ft(e.value,n?.value),[s,l]=m.useState(e.defaultValue??o[0]?.value??""),c=!!n?.value,d=c?i??o[0]?.value??"":s,u=c?a:l;return f.jsxs(XD,{value:d,onValueChange:p=>{u(p),r("change")},children:[f.jsx(e$,{children:o.map(p=>f.jsx(t$,{value:p.value,children:p.label},p.value))}),t]})},Accordion:({props:e})=>{const t=e.items??[],n=e.type==="multiple",r=t.map((o,i)=>f.jsxs(eD,{value:`item-${i}`,children:[f.jsx(tD,{children:o.title}),f.jsx(nD,{children:o.content})]},i));return n?f.jsx(Xc,{type:"multiple",className:"w-full",children:r}):f.jsx(Xc,{type:"single",collapsible:!0,className:"w-full",children:r})},Collapsible:({props:e,children:t})=>{const[n,r]=m.useState(e.defaultOpen??!1);return f.jsxs(kD,{open:n,onOpenChange:r,className:"w-full",children:[f.jsx(SD,{asChild:!0,children:f.jsxs("button",{className:"flex w-full items-center justify-between rounded-md border border-border px-4 py-2 text-sm font-medium hover:bg-muted transition-colors",children:[e.title,f.jsx("svg",{className:`h-4 w-4 transition-transform ${n?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]})}),f.jsx(CD,{className:"pt-2",children:t})]})},Dialog:({props:e,children:t})=>{const[n,r]=Sc(e.openPath??"");return f.jsx(WM,{open:n??!1,onOpenChange:o=>r(o),children:f.jsxs(JM,{children:[f.jsxs(YM,{children:[f.jsx(XM,{children:e.title}),e.description&&f.jsx(QM,{children:e.description})]}),t]})})},Drawer:({props:e,children:t})=>{const[n,r]=Sc(e.openPath??"");return f.jsx(AD,{open:n??!1,onOpenChange:o=>r(o),children:f.jsxs(OD,{children:[f.jsxs(MD,{children:[f.jsx(DD,{children:e.title}),e.description&&f.jsx($D,{children:e.description})]}),f.jsx("div",{className:"p-4",children:t})]})})},Carousel:({props:e})=>{const t=e.items??[];return f.jsxs(vD,{className:"w-full",children:[f.jsx(xD,{children:t.map((n,r)=>f.jsx(bD,{className:"basis-3/4 md:basis-1/2 lg:basis-1/3",children:f.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card h-full",children:[n.title&&f.jsx("h4",{className:"font-semibold text-sm mb-1",children:n.title}),n.description&&f.jsx("p",{className:"text-sm text-muted-foreground",children:n.description})]})},r))}),f.jsx(yD,{}),f.jsx(wD,{})]})},Table:({props:e})=>{const t=e.columns??[],n=(e.rows??[]).map(r=>r.map(String));return f.jsx("div",{className:"rounded-md border border-border overflow-hidden",children:f.jsxs(_D,{children:[e.caption&&f.jsx(ID,{children:e.caption}),f.jsx(ED,{children:f.jsx(Qc,{children:t.map(r=>f.jsx(PD,{children:r},r))})}),f.jsx(TD,{children:n.map((r,o)=>f.jsx(Qc,{children:r.map((i,a)=>f.jsx(ND,{children:i},a))},o))})]})})},Heading:({props:e})=>{const t=e.level??"h2",n=t==="h1"?"text-2xl font-bold":t==="h3"?"text-base font-semibold":t==="h4"?"text-sm font-semibold":"text-lg font-semibold";return t==="h1"?f.jsx("h1",{className:`${n} text-left`,children:e.text}):t==="h3"?f.jsx("h3",{className:`${n} text-left`,children:e.text}):t==="h4"?f.jsx("h4",{className:`${n} text-left`,children:e.text}):f.jsx("h2",{className:`${n} text-left`,children:e.text})},Text:({props:e})=>{const t=e.variant==="caption"?"text-xs":e.variant==="muted"?"text-sm text-muted-foreground":e.variant==="lead"?"text-xl text-muted-foreground":e.variant==="code"?"font-mono text-sm bg-muted px-1.5 py-0.5 rounded":"text-sm";return e.variant==="code"?f.jsx("code",{className:`${t} text-left`,children:e.text}):f.jsx("p",{className:`${t} text-left`,children:e.text})},Image:({props:e})=>e.src?f.jsx("img",{src:e.src,alt:e.alt??"",width:e.width??void 0,height:e.height??void 0,className:"rounded max-w-full"}):f.jsx("div",{className:"bg-muted border border-border rounded flex items-center justify-center text-xs text-muted-foreground",style:{width:e.width??80,height:e.height??60},children:e.alt||"img"}),Avatar:({props:e})=>{const t=e.name||"?",n=t.split(" ").map(o=>o[0]).join("").slice(0,2).toUpperCase(),r=e.size==="lg"?"h-12 w-12":e.size==="sm"?"h-8 w-8":"h-10 w-10";return f.jsxs(rD,{className:r,children:[e.src&&f.jsx(oD,{src:e.src,alt:t}),f.jsx(iD,{children:n})]})},Badge:({props:e})=>f.jsx(sD,{variant:e.variant??"default",children:e.text}),Alert:({props:e})=>{const t=e.type==="error"?"destructive":"default",n=e.type==="success"?"border-green-200 bg-green-50 text-green-900 dark:border-green-800 dark:bg-green-950 dark:text-green-100":e.type==="warning"?"border-yellow-200 bg-yellow-50 text-yellow-900 dark:border-yellow-800 dark:bg-yellow-950 dark:text-yellow-100":e.type==="info"?"border-blue-200 bg-blue-50 text-blue-900 dark:border-blue-800 dark:bg-blue-950 dark:text-blue-100":"";return f.jsxs(ZM,{variant:t,className:n,children:[f.jsx(HM,{children:e.title}),e.message&&f.jsx(GM,{children:e.message})]})},Progress:({props:e})=>{const t=Math.min(100,Math.max(0,e.value||0));return f.jsxs("div",{className:"space-y-2",children:[e.label&&f.jsx(Ut,{className:"text-sm text-muted-foreground",children:e.label}),f.jsx(BM,{value:t})]})},Skeleton:({props:e})=>f.jsx(JD,{className:e.rounded?"rounded-full":"rounded-md",style:{width:e.width??"100%",height:e.height??"1.25rem"}}),Spinner:({props:e})=>{const t=e.size==="lg"?"h-8 w-8":e.size==="sm"?"h-4 w-4":"h-6 w-6";return f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsxs("svg",{className:`${t} animate-spin text-muted-foreground`,viewBox:"0 0 24 24",fill:"none",children:[f.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),f.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),e.label&&f.jsx("span",{className:"text-sm text-muted-foreground",children:e.label})]})},Tooltip:({props:e})=>f.jsx(r$,{children:f.jsxs(o$,{children:[f.jsx(i$,{asChild:!0,children:f.jsx("span",{className:"text-sm underline decoration-dotted cursor-help",children:e.text})}),f.jsx(a$,{children:f.jsx("p",{children:e.content})})]})}),Popover:({props:e})=>f.jsxs(WD,{children:[f.jsx(qD,{asChild:!0,children:f.jsx(br,{variant:"outline",className:"text-sm",children:e.trigger})}),f.jsx(KD,{className:"w-64",children:f.jsx("p",{className:"text-sm",children:e.content})})]}),Input:({props:e,bindings:t,emit:n})=>{const[r,o]=ft(e.value,t?.value),[i,a]=m.useState(""),s=!!t?.value,l=s?r??"":i,c=s?o:a,d=e.validateOn??"blur",u=!!(t?.value&&e.checks?.length),{errors:p,validate:h}=Rn(t?.value??"",u?{checks:e.checks??[],validateOn:d}:void 0);return f.jsxs("div",{className:"space-y-2",children:[e.label&&f.jsx(Ut,{htmlFor:e.name??void 0,children:e.label}),f.jsx($M,{id:e.name??void 0,name:e.name??void 0,type:e.type??"text",placeholder:e.placeholder??"",value:l,onChange:v=>{c(v.target.value),u&&d==="change"&&h()},onKeyDown:v=>{v.key==="Enter"&&n("submit")},onFocus:()=>n("focus"),onBlur:()=>{u&&d==="blur"&&h(),n("blur")}}),p.length>0&&f.jsx("p",{className:"text-sm text-destructive",children:p[0]})]})},Textarea:({props:e,bindings:t})=>{const[n,r]=ft(e.value,t?.value),[o,i]=m.useState(""),a=!!t?.value,s=a?n??"":o,l=a?r:i,c=e.validateOn??"blur",d=!!(t?.value&&e.checks?.length),{errors:u,validate:p}=Rn(t?.value??"",d?{checks:e.checks??[],validateOn:c}:void 0);return f.jsxs("div",{className:"space-y-2",children:[e.label&&f.jsx(Ut,{htmlFor:e.name??void 0,children:e.label}),f.jsx(zM,{id:e.name??void 0,name:e.name??void 0,placeholder:e.placeholder??"",rows:e.rows??3,value:s,onChange:h=>{l(h.target.value),d&&c==="change"&&p()},onBlur:()=>{d&&c==="blur"&&p()}}),u.length>0&&f.jsx("p",{className:"text-sm text-destructive",children:u[0]})]})},Select:({props:e,bindings:t,emit:n})=>{const[r,o]=ft(e.value,t?.value),[i,a]=m.useState(""),s=!!t?.value,l=s?r??"":i,c=s?o:a,u=(e.options??[]).map(b=>typeof b=="string"?b:String(b??"")),p=e.validateOn??"change",h=!!(t?.value&&e.checks?.length),{errors:v,validate:g}=Rn(t?.value??"",h?{checks:e.checks??[],validateOn:p}:void 0);return f.jsxs("div",{className:"space-y-2",children:[f.jsx(Ut,{children:e.label}),f.jsxs(uD,{value:l,onValueChange:b=>{c(b),h&&p==="change"&&g(),n("change")},children:[f.jsx(fD,{className:"w-full",children:f.jsx(dD,{placeholder:e.placeholder??"Select..."})}),f.jsx(pD,{children:u.map((b,x)=>f.jsx(hD,{value:b||`option-${x}`,children:b},`${x}-${b}`))})]}),v.length>0&&f.jsx("p",{className:"text-sm text-destructive",children:v[0]})]})},Checkbox:({props:e,bindings:t,emit:n})=>{const[r,o]=ft(e.checked,t?.checked),[i,a]=m.useState(!!e.checked),s=!!t?.checked,l=s?r??!1:i,c=s?o:a,d=e.validateOn??"change",u=!!(t?.checked&&e.checks?.length),{errors:p,validate:h}=Rn(t?.checked??"",u?{checks:e.checks??[],validateOn:d}:void 0);return f.jsxs("div",{className:"space-y-1",children:[f.jsxs("div",{className:"flex items-center space-x-2",children:[f.jsx(LM,{id:e.name??void 0,checked:l,onCheckedChange:v=>{c(v===!0),u&&d==="change"&&h(),n("change")}}),f.jsx(Ut,{htmlFor:e.name??void 0,className:"cursor-pointer",children:e.label})]}),p.length>0&&f.jsx("p",{className:"text-sm text-destructive",children:p[0]})]})},Radio:({props:e,bindings:t,emit:n})=>{const o=(e.options??[]).map(b=>typeof b=="string"?b:String(b??"")),[i,a]=ft(e.value,t?.value),[s,l]=m.useState(o[0]??""),c=!!t?.value,d=c?i??"":s,u=c?a:l,p=e.validateOn??"change",h=!!(t?.value&&e.checks?.length),{errors:v,validate:g}=Rn(t?.value??"",h?{checks:e.checks??[],validateOn:p}:void 0);return f.jsxs("div",{className:"space-y-2",children:[e.label&&f.jsx(Ut,{children:e.label}),f.jsx(lD,{value:d,onValueChange:b=>{u(b),h&&p==="change"&&g(),n("change")},children:o.map((b,x)=>f.jsxs("div",{className:"flex items-center space-x-2",children:[f.jsx(cD,{value:b||`option-${x}`,id:`${e.name}-${x}-${b}`}),f.jsx(Ut,{htmlFor:`${e.name}-${x}-${b}`,className:"cursor-pointer",children:b})]},`${x}-${b}`))}),v.length>0&&f.jsx("p",{className:"text-sm text-destructive",children:v[0]})]})},Switch:({props:e,bindings:t,emit:n})=>{const[r,o]=ft(e.checked,t?.checked),[i,a]=m.useState(!!e.checked),s=!!t?.checked,l=s?r??!1:i,c=s?o:a,d=e.validateOn??"change",u=!!(t?.checked&&e.checks?.length),{errors:p,validate:h}=Rn(t?.checked??"",u?{checks:e.checks??[],validateOn:d}:void 0);return f.jsxs("div",{className:"space-y-1",children:[f.jsxs("div",{className:"flex items-center justify-between space-x-2",children:[f.jsx(Ut,{htmlFor:e.name??void 0,className:"cursor-pointer",children:e.label}),f.jsx(FM,{id:e.name??void 0,checked:l,onCheckedChange:v=>{c(v),u&&d==="change"&&h(),n("change")}})]}),p.length>0&&f.jsx("p",{className:"text-sm text-destructive",children:p[0]})]})},Slider:({props:e,bindings:t,emit:n})=>{const[r,o]=ft(e.value,t?.value),[i,a]=m.useState(e.min??0),s=!!t?.value,l=s?r??e.min??0:i,c=s?o:a;return f.jsxs("div",{className:"space-y-2",children:[e.label&&f.jsxs("div",{className:"flex justify-between",children:[f.jsx(Ut,{className:"text-sm",children:e.label}),f.jsx("span",{className:"text-sm text-muted-foreground",children:l})]}),f.jsx(YD,{value:[l],min:e.min??0,max:e.max??100,step:e.step??1,onValueChange:d=>{c(d[0]??0),n("change")}})]})},Button:({props:e,emit:t})=>{const n=e.variant==="danger"?"destructive":e.variant==="secondary"?"secondary":"default";return f.jsx(br,{variant:n,disabled:e.disabled??!1,onClick:()=>t("press"),children:e.label})},Link:({props:e,on:t})=>f.jsx("a",{href:e.href??"#",className:"text-primary underline-offset-4 hover:underline text-sm font-medium",onClick:n=>{const r=t("press");r.shouldPreventDefault&&n.preventDefault(),r.emit()},children:e.label}),DropdownMenu:({props:e,bindings:t,emit:n})=>{const r=e.items??[],[,o]=ft(e.value,t?.value);return f.jsxs(zD,{children:[f.jsx(LD,{asChild:!0,children:f.jsx(br,{variant:"outline",children:e.label})}),f.jsx(FD,{children:r.map(i=>f.jsx(BD,{onClick:()=>{o(i.value),n("select")},children:i.label},i.value))})]})},Toggle:({props:e,bindings:t,emit:n})=>{const[r,o]=ft(e.pressed,t?.pressed),[i,a]=m.useState(e.pressed??!1),s=!!t?.pressed,l=s?r??!1:i,c=s?o:a;return f.jsx(n$,{variant:e.variant??"default",pressed:l,onPressedChange:d=>{c(d),n("change")},children:e.label})},ToggleGroup:({props:e,bindings:t,emit:n})=>{const r=e.type??"single",o=e.items??[],[i,a]=ft(e.value,t?.value),[s,l]=m.useState(o[0]?.value??""),c=!!t?.value,d=c?i??"":s,u=c?a:l;if(r==="multiple"){const p=d?d.split(",").filter(Boolean):[];return f.jsx(eu,{type:"multiple",value:p,onValueChange:h=>{u(h.join(",")),n("change")},children:o.map(h=>f.jsx(tu,{value:h.value,children:h.label},h.value))})}return f.jsx(eu,{type:"single",value:d,onValueChange:p=>{p&&(u(p),n("change"))},children:o.map(p=>f.jsx(tu,{value:p.value,children:p.label},p.value))})},ButtonGroup:({props:e,bindings:t,emit:n})=>{const r=e.buttons??[],[o,i]=ft(e.selected,t?.selected),[a,s]=m.useState(r[0]?.value??""),l=!!t?.selected,c=l?o??"":a,d=l?i:s;return f.jsx("div",{className:"inline-flex rounded-md border border-border",children:r.map((u,p)=>f.jsx("button",{className:`px-3 py-1.5 text-sm transition-colors ${c===u.value?"bg-primary text-primary-foreground":"bg-background hover:bg-muted"} ${p>0?"border-l border-border":""} ${p===0?"rounded-l-md":""} ${p===r.length-1?"rounded-r-md":""}`,onClick:()=>{d(u.value),n("change")},children:u.label},u.value))})},Pagination:({props:e,bindings:t,emit:n})=>{const[r,o]=ft(e.page,t?.page),i=r??1,a=e.totalPages??1,s=s$(i,a);return f.jsx(VD,{children:f.jsxs(UD,{children:[f.jsx(co,{children:f.jsx(ZD,{href:"#",onClick:l=>{l.preventDefault(),i>1&&(o(i-1),n("change"))}})}),s.map((l,c)=>l==="ellipsis"?f.jsx(co,{children:f.jsx(GD,{})},`ellipsis-${c}`):f.jsx(co,{children:f.jsx(Ys,{href:"#",isActive:l===i,onClick:d=>{d.preventDefault(),o(l),n("change")},children:l})},l)),f.jsx(co,{children:f.jsx(HD,{href:"#",onClick:l=>{l.preventDefault(),i<a&&(o(i+1),n("change"))}})})]})})}};const c$=yT(wT,{components:zT,actions:{}}),{registry:u$}=$T(c$,{components:l$});function d$({spec:e}){return f.jsx(DT,{spec:e,registry:u$})}function f$(e){return typeof e=="string"?e:JSON.stringify(e,null,2)}function p$({hint:e,data:t}){const n=f$(t);if(e.type==="markdown")return f.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none",children:f.jsx(Fu,{remarkPlugins:[ud],children:n})});if(e.type==="json")return f.jsx("pre",{className:"text-xs whitespace-pre-wrap",children:n});if(e.type==="list")try{const r=Array.isArray(t)?t:JSON.parse(n);if(!Array.isArray(r))throw new Error("not an array");return e.ordered?f.jsx("ol",{className:"list-decimal pl-5 text-sm space-y-1",children:r.map((o,i)=>f.jsx("li",{children:String(o)},i))}):f.jsx("ul",{className:"list-disc pl-5 text-sm space-y-1",children:r.map((o,i)=>f.jsx("li",{children:String(o)},i))})}catch{return f.jsx("pre",{className:"text-xs whitespace-pre-wrap",children:n})}return f.jsx("pre",{className:"text-xs whitespace-pre-wrap",children:n})}function h$({execution:e,expanded:t,onToggleExpand:n}){const r=e.result?.details??e.partialResult?.details??{},o=r.renderHint;if(o){const a=r.data??r.content??r;return f.jsxs(Mt,{children:[f.jsx(Dt,{className:"py-2 px-3",children:f.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono",children:[f.jsx(bi,{className:"h-3.5 w-3.5"}),e.toolName]})}),f.jsx(Zt,{className:"py-2 px-3",children:f.jsx(p$,{hint:o,data:a})})]})}const i=r.uiSpec;return i?f.jsxs(Mt,{children:[f.jsx(Dt,{className:"py-2 px-3",children:f.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono",children:[f.jsx(bi,{className:"h-3.5 w-3.5"}),e.toolName]})}),f.jsx(Zt,{className:"py-2 px-3",children:f.jsx(d$,{spec:i})})]}):f.jsxs(Mt,{children:[f.jsx(Dt,{className:"py-2 px-3",children:f.jsxs("div",{className:"flex items-center justify-between gap-2 text-xs",children:[f.jsxs("div",{className:"flex items-center gap-2 min-w-0 font-mono",children:[f.jsx(bi,{className:"h-3.5 w-3.5"}),f.jsx("span",{className:"truncate",children:e.toolName})]}),f.jsx(Et,{variant:"ghost",size:"sm",onClick:n,children:t?"Hide":"Show"})]})}),t&&f.jsxs(Zt,{className:"py-2 px-3 space-y-2",children:[f.jsxs("div",{children:[f.jsx("p",{className:"text-[11px] text-muted-foreground mb-1",children:"args"}),f.jsx("pre",{className:"text-xs whitespace-pre-wrap overflow-x-auto",children:JSON.stringify(e.args,null,2)})]}),f.jsxs("div",{children:[f.jsx("p",{className:"text-[11px] text-muted-foreground mb-1",children:"result"}),f.jsx("pre",{className:"text-xs whitespace-pre-wrap overflow-x-auto",children:JSON.stringify(e.result??e.partialResult,null,2)})]})]})]})}function m$(e){return(e.result??e.partialResult)?.content?.find(r=>r?.type==="text")?.text??""}function g$({execution:e,expanded:t,onToggleExpand:n}){const r=m$(e),o=String(e.args?.pattern??"");return f.jsxs(Mt,{children:[f.jsx(Dt,{className:"py-2 px-3",children:f.jsxs("div",{className:"flex items-center justify-between gap-2 text-xs",children:[f.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[f.jsx(av,{className:"h-3.5 w-3.5 text-violet-500"}),f.jsxs("span",{className:"font-mono truncate",children:["grep ",o]})]}),f.jsx(Et,{variant:"ghost",size:"sm",onClick:n,children:t?"Hide":"Show"})]})}),t&&f.jsx(Zt,{className:"py-2 px-3",children:f.jsx("pre",{className:"text-xs whitespace-pre-wrap overflow-x-auto",children:r||"(no matches)"})})]})}function v$(e){return(e.result??e.partialResult)?.content?.find(r=>r?.type==="text")?.text??""}function x$({execution:e,expanded:t,onToggleExpand:n}){const r=v$(e),o=String(e.args?.path??".");return f.jsxs(Mt,{children:[f.jsx(Dt,{className:"py-2 px-3",children:f.jsxs("div",{className:"flex items-center justify-between gap-2 text-xs",children:[f.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[f.jsx(ev,{className:"h-3.5 w-3.5 text-indigo-500"}),f.jsxs("span",{className:"font-mono truncate",children:["ls ",o]})]}),f.jsx(Et,{variant:"ghost",size:"sm",onClick:n,children:t?"Hide":"Show"})]})}),t&&f.jsx(Zt,{className:"py-2 px-3",children:f.jsx("pre",{className:"text-xs whitespace-pre-wrap overflow-x-auto",children:r||"(empty directory)"})})]})}function b$(e){return(e.result??e.partialResult)?.content?.find(r=>r?.type==="text")?.text??""}function y$({execution:e,expanded:t,onToggleExpand:n}){const r=b$(e),o=String(e.args?.path??"");return f.jsxs(Mt,{children:[f.jsx(Dt,{className:"py-2 px-3",children:f.jsxs("div",{className:"flex items-center justify-between gap-2",children:[f.jsxs("div",{className:"flex items-center gap-2 min-w-0 text-xs",children:[f.jsx(Jg,{className:"h-3.5 w-3.5 shrink-0 text-blue-500"}),f.jsxs("span",{className:"font-mono truncate",children:["read ",o]})]}),f.jsx(Et,{variant:"ghost",size:"sm",onClick:n,children:t?"Hide":"Show"})]})}),t&&f.jsx(Zt,{className:"py-2 px-3",children:f.jsx("pre",{className:"text-xs whitespace-pre-wrap overflow-x-auto",children:r||"(empty)"})})]})}function w$({execution:e}){const t=String(e.args?.path??"");return f.jsx(Mt,{children:f.jsx(Dt,{className:"py-2 px-3",children:f.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[f.jsx(qg,{className:"h-3.5 w-3.5 text-emerald-500"}),f.jsxs("span",{className:"font-mono truncate",children:["write ",t]}),f.jsx("span",{className:"text-muted-foreground ml-auto",children:e.status==="error"?"failed":"done"})]})})})}const k$={bash:Zk,read:y$,write:w$,edit:Hk,grep:g$,find:Wk,ls:x$};function S$({execution:e}){const[t,n]=m.useState(e.status!=="completed"),r=k$[e.toolName]??h$;return f.jsx(r,{execution:e,expanded:t,onToggleExpand:()=>n(o=>!o)})}function C$({messageId:e}){const t=vn(Rg,n=>Ag(e,n));return t.length===0?null:f.jsx("div",{className:"space-y-2 mb-2",children:t.map(n=>f.jsx(S$,{execution:n},n.toolCallId))})}function _$({message:e}){const t=e.role==="user";return f.jsxs("div",{className:mo("flex gap-3",t&&"justify-end"),children:[!t&&f.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-primary text-primary-foreground",children:f.jsx(Bg,{className:"h-4 w-4"})}),f.jsxs("div",{className:mo("max-w-[80%] rounded-lg px-4 py-2",t?"bg-primary text-primary-foreground":"bg-muted"),children:[e.isThinking&&e.thinkingContent&&f.jsxs("div",{className:"mb-2 rounded border border-border bg-background/50 p-2 text-xs",children:[f.jsxs("div",{className:"flex items-center gap-1.5 text-muted-foreground mb-1",children:[f.jsx(ou,{className:"h-3 w-3 animate-spin"}),f.jsx("span",{className:"font-medium",children:"Thinking..."})]}),f.jsx("p",{className:"text-muted-foreground italic",children:e.thinkingContent})]}),t?f.jsx("p",{className:"whitespace-pre-wrap",children:e.content}):f.jsxs(f.Fragment,{children:[f.jsx(C$,{messageId:e.id}),f.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none",children:f.jsx(Fu,{remarkPlugins:[ud],children:e.content||"..."})})]}),e.isStreaming&&!t&&f.jsx("span",{className:"inline-block h-3 w-1 animate-pulse bg-current ml-1"})]}),t&&f.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-secondary text-secondary-foreground",children:f.jsx(fv,{className:"h-4 w-4"})})]})}function E$(){const{messages:e}=vn(jg,n=>({messages:n.messages})),t=m.useRef(null);return m.useEffect(()=>{t.current?.scrollIntoView({behavior:"smooth"})},[e]),e.length===0?f.jsx("div",{className:"flex h-full items-center justify-center p-8",children:f.jsxs("div",{className:"text-center space-y-2",children:[f.jsx("p",{className:"text-lg font-medium",children:"Start a conversation"}),f.jsx("p",{className:"text-sm text-muted-foreground",children:"Send a message to begin chatting with clankie"})]})}):f.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4",children:[e.map(n=>f.jsx(_$,{message:n},n.id)),f.jsx("div",{ref:t})]})}function A$(){const{sessionId:e}=Og.useParams(),t=Mg(),{status:n}=vn(Dg,i=>({status:i.status})),{sessionId:r}=vn(Ma,i=>({sessionId:i.sessionId}));vn($g,i=>i);const o=n==="connected";return m.useEffect(()=>{if(o){if(r===e){console.log(`[session-page] Already on session ${e}, no switch needed`);return}console.log(`[session-page] URL sessionId changed to ${e}, switching...`),go.switchSession(e).catch(i=>{console.error(`[session-page] Failed to load session ${e}:`,i),t({to:"/"})})}},[e,o,r,t]),o?r!==e?f.jsx("div",{className:"flex h-full items-center justify-center",children:f.jsxs("div",{className:"text-center space-y-2",children:[f.jsx("div",{className:"inline-block h-8 w-8 animate-spin rounded-full border-4 border-primary border-r-transparent"}),f.jsxs("p",{className:"text-sm text-muted-foreground",children:["Loading session ",e,"..."]})]})}):f.jsxs("div",{className:"flex h-full flex-col",children:[f.jsx(E$,{}),f.jsx(yv,{})]}):f.jsx("div",{className:"flex h-full items-center justify-center",children:f.jsxs("div",{className:"text-center space-y-4",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsx("h2",{className:"text-2xl font-semibold",children:"Not Connected"}),f.jsx("p",{className:"text-muted-foreground",children:"Configure your connection to get started"})]}),f.jsx(zg,{to:"/settings",children:f.jsxs(Et,{children:[f.jsx(Lg,{className:"mr-2 h-4 w-4"}),"Go to Settings"]})})]})})}export{A$ as component};