clankie 0.2.4 → 0.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,125 @@
1
+ import{c as Qe,j as f,B as Et,X as dg,f as mn,m as hn,M as Oa,r as m,N as fg,O as pg,Q as hg,R as Xs,T as Qs,U as qr,V as el,W as tl,Y as nl,Z as rl,p as go,_ as mg,$ as gg,C as kn,s as Sn,w as Yn,a0 as L,a1 as Ma,a2 as ru,a3 as vg,a4 as xg,a5 as bg,a6 as yg,a7 as wg,a8 as kg,a9 as Sg,aa as Cg,ab as _g,ac as Eg,ad as Tg,ae as Pg,af as Ng,J as Ir,ag as ou,ah as Ig,F as ol,ai as Ag,aj as Rg,ak as jg,al as Og,am as Mg,an as Dg,ao as $g,ap as zg,aq as Lg,K as Fg,q as Bg,A as Vg,L as Ug,H as Zg}from"./main-B0Vr8WJj.js";import{L as iu}from"./loader-circle-DnJ0LVzz.js";const Hg=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Gg=Qe("activity",Hg);const Wg=[["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"}]],qg=Qe("bot",Wg);const Kg=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],il=Qe("check",Kg);const Jg=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],au=Qe("chevron-down",Jg);const Yg=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]],su=Qe("clock-3",Yg);const Xg=[["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"}]],Qg=Qe("file-pen-line",Xg);const ev=[["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"}]],tv=Qe("file-plus-corner",ev);const nv=[["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"}]],rv=Qe("file-text",nv);const ov=[["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"}]],lu=Qe("file",ov);const iv=[["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"}]],av=Qe("folder-open",iv);const sv=[["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"}]],lv=Qe("folder-tree",sv);const cv=[["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"}]],uv=Qe("paperclip",cv);const dv=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],fv=Qe("search",dv);const pv=[["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"}]],hv=Qe("send",pv);const mv=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],gv=Qe("terminal",mv);const vv=[["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"}]],xv=Qe("user",vv);function bv({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:mn("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(lu,{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:yv(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(dg,{className:"h-3 w-3"}),f.jsxs("span",{className:"sr-only",children:["Remove ",n.file.name]})]})]},n.id)})})}function yv(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 bi(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 wv(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 kv(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 Sv(){const{sessionId:e,model:t,availableModels:n,thinkingLevel:r,isStreaming:o}=hn(Oa,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}=wv(n);return g.sort((x,y)=>x.name.localeCompare(y.name)),{latestModels:g,olderModels:b,shouldShowSubmenu:b.length>0}},[n]),d=m.useMemo(()=>kv(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),gg(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),mg(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(rl,{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:Cv(g)})]})]},`${g.provider}/${g.id}`)};return f.jsxs(fg,{open:i,onOpenChange:a,children:[f.jsxs(pg,{type:"button",disabled:o||!e,className:mn("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(au,{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(hg,{align:"end",className:"w-80",children:[f.jsx(Xs,{children:f.jsx(Qs,{children:"Select Model"})}),f.jsx(qr,{}),f.jsx("div",{className:"max-h-96 overflow-y-auto",children:s.map(v)}),c&&f.jsxs(f.Fragment,{children:[f.jsx(qr,{}),f.jsxs(el,{children:[f.jsx(tl,{children:f.jsx("span",{children:"Other models"})}),f.jsx(nl,{className:"w-80 max-h-96 overflow-y-auto",children:Array.from(d.entries()).sort(([g],[b])=>bi(g).localeCompare(bi(b))).map(([g,b])=>f.jsxs("div",{children:[f.jsx(Xs,{children:f.jsx(Qs,{className:"sticky top-0 bg-popover z-10",children:bi(g)})}),b.map(v),f.jsx(qr,{className:"my-1"})]},g))})]})]}),f.jsx(qr,{}),f.jsxs(el,{children:[f.jsx(tl,{children:f.jsx("span",{children:"Thinking Level"})}),f.jsx(nl,{children:h.map(g=>f.jsxs(rl,{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 Cv(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}`}function _v(e){return(e.result??e.partialResult)?.content?.find(r=>r?.type==="text")?.text??""}function Ev({execution:e,expanded:t,onToggleExpand:n}){const r=_v(e),o=String(e.args?.command??"");return f.jsxs(kn,{className:"bg-zinc-950 border-zinc-800 text-zinc-100",children:[f.jsx(Sn,{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(gv,{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(iu,{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(Yn,{className:"py-2 px-3",children:f.jsx("pre",{className:"text-xs whitespace-pre-wrap overflow-x-auto",children:r||"(no output)"})})]})}function Tv({execution:e,expanded:t,onToggleExpand:n}){const o=e.result?.details?.diff??"",i=String(e.args?.path??"");return f.jsxs(kn,{children:[f.jsx(Sn,{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(Qg,{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(Yn,{className:"py-2 px-3",children:f.jsx("pre",{className:"text-xs whitespace-pre-wrap overflow-x-auto",children:o||"Edit applied"})})]})}function Pv(e){return(e.result??e.partialResult)?.content?.find(r=>r?.type==="text")?.text??""}function Nv({execution:e,expanded:t,onToggleExpand:n}){const r=Pv(e),o=String(e.args?.pattern??"*");return f.jsxs(kn,{children:[f.jsx(Sn,{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(lv,{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(Yn,{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 Un extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class cu extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const uu={};function qt(e){return uu}function du(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 Qi(e,t){return typeof t=="bigint"?t.toString():t}function Da(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function $a(e){return e==null}function za(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function Iv(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 sl=Symbol("evaluating");function ve(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==sl)return r===void 0&&(r=sl,r=n()),r},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function Cn(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Yt(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function ll(e){return JSON.stringify(e)}function Av(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const fu="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function vo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Rv=Da(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Gn(e){if(vo(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(vo(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function pu(e){return Gn(e)?{...e}:Array.isArray(e)?[...e]:e}const jv=new Set(["string","number","symbol"]);function Wn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Xt(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 Ov(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const Mv={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 Dv(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=Yt(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 Cn(this,"shape",a),a},checks:[]});return Xt(e,i)}function $v(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=Yt(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 Cn(this,"shape",a),a},checks:[]});return Xt(e,i)}function zv(e,t){if(!Gn(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=Yt(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t};return Cn(this,"shape",i),i}});return Xt(e,o)}function Lv(e,t){if(!Gn(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Yt(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return Cn(this,"shape",r),r}});return Xt(e,n)}function Fv(e,t){const n=Yt(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return Cn(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return Xt(e,n)}function Bv(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=Yt(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 Cn(this,"shape",l),l},checks:[]});return Xt(t,a)}function Vv(e,t,n){const r=Yt(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 Cn(this,"shape",i),i}});return Xt(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 Kr(e){return typeof e=="string"?e:e?.message}function Kt(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const o=Kr(e.inst?._zod.def?.error?.(e))??Kr(t?.error?.(e))??Kr(n.customError?.(e))??Kr(n.localeError?.(e))??"Invalid input";r.message=o}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function La(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function wr(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const hu=(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,Qi,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},mu=M("$ZodError",hu),gu=M("$ZodError",hu,{Parent:Error});function Uv(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 Zv(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 Fa=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 Un;if(a.issues.length){const s=new(o?.Err??e)(a.issues.map(l=>Kt(l,i,qt())));throw fu(s,o?.callee),s}return a.value},Ba=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=>Kt(l,i,qt())));throw fu(s,o?.callee),s}return a.value},Mo=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 Un;return i.issues.length?{success:!1,error:new(e??mu)(i.issues.map(a=>Kt(a,o,qt())))}:{success:!0,data:i.value}},Hv=Mo(gu),Do=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=>Kt(a,o,qt())))}:{success:!0,data:i.value}},Gv=Do(gu),Wv=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Fa(e)(t,n,o)},qv=e=>(t,n,r)=>Fa(e)(t,n,r),Kv=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Ba(e)(t,n,o)},Jv=e=>async(t,n,r)=>Ba(e)(t,n,r),Yv=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Mo(e)(t,n,o)},Xv=e=>(t,n,r)=>Mo(e)(t,n,r),Qv=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Do(e)(t,n,o)},ex=e=>async(t,n,r)=>Do(e)(t,n,r),tx=/^[cC][^\s-]{8,}$/,nx=/^[0-9a-z]+$/,rx=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ox=/^[0-9a-vA-V]{20}$/,ix=/^[A-Za-z0-9]{27}$/,ax=/^[a-zA-Z0-9_-]{21}$/,sx=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,lx=/^([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})$/,cl=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)$/,cx=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,ux="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function dx(){return new RegExp(ux,"u")}const fx=/^(?:(?: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])$/,px=/^(([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}|:))$/,hx=/^((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])$/,mx=/^(([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])$/,gx=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,vu=/^[A-Za-z0-9_-]*$/,vx=/^\+[1-9]\d{6,14}$/,xu="(?:(?:\\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])))",xx=new RegExp(`^${xu}$`);function bu(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 bx(e){return new RegExp(`^${bu(e)}$`)}function yx(e){const t=bu({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(`^${xu}T(?:${r})$`)}const wx=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},kx=/^-?\d+$/,yu=/^-?\d+(?:\.\d+)?$/,Sx=/^(?:true|false)$/i,Cx=/^null$/i,_x=/^[^A-Z]*$/,Ex=/^[^a-z]*$/,st=M("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),wu={number:"number",bigint:"bigint",object:"date"},ku=M("$ZodCheckLessThan",(e,t)=>{st.init(e,t);const n=wu[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})}}),Su=M("$ZodCheckGreaterThan",(e,t)=>{st.init(e,t);const n=wu[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})}}),Tx=M("$ZodCheckMultipleOf",(e,t)=>{st.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):Iv(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})}}),Px=M("$ZodCheckNumberFormat",(e,t)=>{st.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[o,i]=Mv[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=kx)}),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})}}),Nx=M("$ZodCheckMaxLength",(e,t)=>{var n;st.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!$a(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=La(o);r.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Ix=M("$ZodCheckMinLength",(e,t)=>{var n;st.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!$a(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=La(o);r.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Ax=M("$ZodCheckLengthEquals",(e,t)=>{var n;st.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!$a(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=La(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})}}),$o=M("$ZodCheckStringFormat",(e,t)=>{var n,r;st.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=()=>{})}),Rx=M("$ZodCheckRegex",(e,t)=>{$o.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})}}),jx=M("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=_x),$o.init(e,t)}),Ox=M("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Ex),$o.init(e,t)}),Mx=M("$ZodCheckIncludes",(e,t)=>{st.init(e,t);const n=Wn(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})}}),Dx=M("$ZodCheckStartsWith",(e,t)=>{st.init(e,t);const n=new RegExp(`^${Wn(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})}}),$x=M("$ZodCheckEndsWith",(e,t)=>{st.init(e,t);const n=new RegExp(`.*${Wn(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})}}),zx=M("$ZodCheckOverwrite",(e,t)=>{st.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class Lx{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(`
2
+ `).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(`
3
+ `))}}const Fx={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=Fx;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 Un;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 Un;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 Un;return l.then(c=>o(c,r,s))}return o(l,r,s)}}ve(e,"~standard",()=>({validate:o=>{try{const i=Hv(e,o);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return Gv(e,o).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),Va=M("$ZodString",(e,t)=>{_e.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??wx(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)=>{$o.init(e,t),Va.init(e,t)}),Bx=M("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=lx),Ne.init(e,t)}),Vx=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=cl(r))}else t.pattern??(t.pattern=cl());Ne.init(e,t)}),Ux=M("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=cx),Ne.init(e,t)}),Zx=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})}}}),Hx=M("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=dx()),Ne.init(e,t)}),Gx=M("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=ax),Ne.init(e,t)}),Wx=M("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=tx),Ne.init(e,t)}),qx=M("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=nx),Ne.init(e,t)}),Kx=M("$ZodULID",(e,t)=>{t.pattern??(t.pattern=rx),Ne.init(e,t)}),Jx=M("$ZodXID",(e,t)=>{t.pattern??(t.pattern=ox),Ne.init(e,t)}),Yx=M("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=ix),Ne.init(e,t)}),Xx=M("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=yx(t)),Ne.init(e,t)}),Qx=M("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=xx),Ne.init(e,t)}),eb=M("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=bx(t)),Ne.init(e,t)}),tb=M("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=sx),Ne.init(e,t)}),nb=M("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=fx),Ne.init(e,t),e._zod.bag.format="ipv4"}),rb=M("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=px),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})}}}),ob=M("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=hx),Ne.init(e,t)}),ib=M("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=mx),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 Cu(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const ab=M("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=gx),Ne.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{Cu(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function sb(e){if(!vu.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return Cu(n)}const lb=M("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=vu),Ne.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{sb(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),cb=M("$ZodE164",(e,t)=>{t.pattern??(t.pattern=vx),Ne.init(e,t)});function ub(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 db=M("$ZodJWT",(e,t)=>{Ne.init(e,t),e._zod.check=n=>{ub(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),_u=M("$ZodNumber",(e,t)=>{_e.init(e,t),e._zod.pattern=e._zod.bag.pattern??yu,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}}),fb=M("$ZodNumberFormat",(e,t)=>{Px.init(e,t),_u.init(e,t)}),pb=M("$ZodBoolean",(e,t)=>{_e.init(e,t),e._zod.pattern=Sx,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}}),hb=M("$ZodNull",(e,t)=>{_e.init(e,t),e._zod.pattern=Cx,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}}),mb=M("$ZodAny",(e,t)=>{_e.init(e,t),e._zod.parse=n=>n}),gb=M("$ZodUnknown",(e,t)=>{_e.init(e,t),e._zod.parse=n=>n}),vb=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 ul(e,t,n){e.issues.length&&t.issues.push(...Bn(n,e.issues)),t.value[n]=e.value}const xb=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=>ul(c,n,a))):ul(l,n,a)}return i.length?Promise.all(i).then(()=>n):n}});function xo(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 Eu(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=Ov(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Tu(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=>xo(h,n,u,t,d))):xo(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 bb=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=Da(()=>Eu(t));ve(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=vo,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=>xo(b,s,p,c,v))):xo(g,s,p,c,v)}return i?Tu(d,c,s,l,r.value,e):d.length?Promise.all(d).then(()=>s):s}}),yb=M("$ZodObjectJIT",(e,t)=>{bb.init(e,t);const n=e._zod.parse,r=Da(()=>Eu(t)),o=p=>{const h=new Lx(["shape","payload","ctx"]),v=r.value,g=w=>{const S=ll(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=ll(w),T=p[w]?._zod?.optout==="optional";h.write(`const ${S} = ${g(w)};`),T?h.write(`
4
+ if (${S}.issues.length) {
5
+ if (${P} in input) {
6
+ payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
7
+ ...iss,
8
+ path: iss.path ? [${P}, ...iss.path] : [${P}]
9
+ })));
10
+ }
11
+ }
12
+
13
+ if (${S}.value === undefined) {
14
+ if (${P} in input) {
15
+ newResult[${P}] = undefined;
16
+ }
17
+ } else {
18
+ newResult[${P}] = ${S}.value;
19
+ }
20
+
21
+ `):h.write(`
22
+ if (${S}.issues.length) {
23
+ payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
24
+ ...iss,
25
+ path: iss.path ? [${P}, ...iss.path] : [${P}]
26
+ })));
27
+ }
28
+
29
+ if (${S}.value === undefined) {
30
+ if (${P} in input) {
31
+ newResult[${P}] = undefined;
32
+ }
33
+ } else {
34
+ newResult[${P}] = ${S}.value;
35
+ }
36
+
37
+ `)}h.write("payload.value = newResult;"),h.write("return payload;");const y=h.compile();return(w,S)=>y(p,w,S)};let i;const a=vo,s=!uu.jitless,c=s&&Rv.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?Tu([],v,p,h,u,e):p):n(p,h):(p.issues.push({expected:"object",code:"invalid_type",input:v,inst:e}),p)}});function dl(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=>Kt(a,r,qt())))}),t)}const wb=M("$ZodUnion",(e,t)=>{_e.init(e,t),ve(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),ve(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),ve(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),ve(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=>za(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=>dl(l,o,e,i)):dl(s,o,e,i)}}),kb=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])=>fl(n,l,c)):fl(n,i,a)}});function ea(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(Gn(e)&&Gn(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=ea(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=ea(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 fl(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=ea(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 Sb=M("$ZodRecord",(e,t)=>{_e.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!Gn(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"&&yu.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=>Kt(u,r,qt())),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}}),Cb=M("$ZodEnum",(e,t)=>{_e.init(e,t);const n=du(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(o=>jv.has(typeof o)).map(o=>typeof o=="string"?Wn(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}}),_b=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"?Wn(r):r?Wn(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}}),Eb=M("$ZodTransform",(e,t)=>{_e.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new cu(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 Un;return n.value=o,n}});function pl(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const Pu=M("$ZodOptional",(e,t)=>{_e.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ve(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ve(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${za(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=>pl(i,n.value)):pl(o,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),Tb=M("$ZodExactOptional",(e,t)=>{Pu.init(e,t),ve(e._zod,"values",()=>t.innerType._zod.values),ve(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),Pb=M("$ZodNullable",(e,t)=>{_e.init(e,t),ve(e._zod,"optin",()=>t.innerType._zod.optin),ve(e._zod,"optout",()=>t.innerType._zod.optout),ve(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${za(n.source)}|null)$`):void 0}),ve(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)}),Nb=M("$ZodDefault",(e,t)=>{_e.init(e,t),e._zod.optin="optional",ve(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=>hl(i,t)):hl(o,t)}});function hl(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Ib=M("$ZodPrefault",(e,t)=>{_e.init(e,t),e._zod.optin="optional",ve(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))}),Ab=M("$ZodNonOptional",(e,t)=>{_e.init(e,t),ve(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=>ml(i,e)):ml(o,e)}});function ml(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 Rb=M("$ZodCatch",(e,t)=>{_e.init(e,t),ve(e._zod,"optin",()=>t.innerType._zod.optin),ve(e._zod,"optout",()=>t.innerType._zod.optout),ve(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=>Kt(a,r,qt()))},input:n.value}),n.issues=[]),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(i=>Kt(i,r,qt()))},input:n.value}),n.issues=[]),n)}}),jb=M("$ZodPipe",(e,t)=>{_e.init(e,t),ve(e._zod,"values",()=>t.in._zod.values),ve(e._zod,"optin",()=>t.in._zod.optin),ve(e._zod,"optout",()=>t.out._zod.optout),ve(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=>Jr(a,t.in,r)):Jr(i,t.in,r)}const o=t.in._zod.run(n,r);return o instanceof Promise?o.then(i=>Jr(i,t.out,r)):Jr(o,t.out,r)}});function Jr(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Ob=M("$ZodReadonly",(e,t)=>{_e.init(e,t),ve(e._zod,"propValues",()=>t.innerType._zod.propValues),ve(e._zod,"values",()=>t.innerType._zod.values),ve(e._zod,"optin",()=>t.innerType?._zod?.optin),ve(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(gl):gl(o)}});function gl(e){return e.value=Object.freeze(e.value),e}const Mb=M("$ZodLazy",(e,t)=>{_e.init(e,t),ve(e._zod,"innerType",()=>t.getter()),ve(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),ve(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),ve(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),ve(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(n,r)=>e._zod.innerType._zod.run(n,r)}),Db=M("$ZodCustom",(e,t)=>{st.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=>vl(i,n,r,e));vl(o,n,r,e)}});function vl(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(wr(o))}}var xl;class $b{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 zb(){return new $b}(xl=globalThis).__zod_globalRegistry??(xl.__zod_globalRegistry=zb());const fr=globalThis.__zod_globalRegistry;function Lb(e,t){return new e({type:"string",...ee(t)})}function Fb(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ee(t)})}function bl(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ee(t)})}function Bb(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ee(t)})}function Vb(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ee(t)})}function Ub(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ee(t)})}function Zb(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ee(t)})}function Hb(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ee(t)})}function Gb(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ee(t)})}function Wb(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ee(t)})}function qb(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ee(t)})}function Kb(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ee(t)})}function Jb(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ee(t)})}function Yb(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ee(t)})}function Xb(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ee(t)})}function Qb(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ee(t)})}function ey(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ee(t)})}function ty(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ee(t)})}function ny(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ee(t)})}function ry(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ee(t)})}function oy(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ee(t)})}function iy(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ee(t)})}function ay(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ee(t)})}function sy(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ee(t)})}function ly(e,t){return new e({type:"string",format:"date",check:"string_format",...ee(t)})}function cy(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ee(t)})}function uy(e,t){return new e({type:"string",format:"duration",check:"string_format",...ee(t)})}function dy(e,t){return new e({type:"number",checks:[],...ee(t)})}function fy(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ee(t)})}function py(e,t){return new e({type:"boolean",...ee(t)})}function hy(e,t){return new e({type:"null",...ee(t)})}function my(e){return new e({type:"any"})}function gy(e){return new e({type:"unknown"})}function vy(e,t){return new e({type:"never",...ee(t)})}function yl(e,t){return new ku({check:"less_than",...ee(t),value:e,inclusive:!1})}function yi(e,t){return new ku({check:"less_than",...ee(t),value:e,inclusive:!0})}function wl(e,t){return new Su({check:"greater_than",...ee(t),value:e,inclusive:!1})}function wi(e,t){return new Su({check:"greater_than",...ee(t),value:e,inclusive:!0})}function kl(e,t){return new Tx({check:"multiple_of",...ee(t),value:e})}function Nu(e,t){return new Nx({check:"max_length",...ee(t),maximum:e})}function bo(e,t){return new Ix({check:"min_length",...ee(t),minimum:e})}function Iu(e,t){return new Ax({check:"length_equals",...ee(t),length:e})}function xy(e,t){return new Rx({check:"string_format",format:"regex",...ee(t),pattern:e})}function by(e){return new jx({check:"string_format",format:"lowercase",...ee(e)})}function yy(e){return new Ox({check:"string_format",format:"uppercase",...ee(e)})}function wy(e,t){return new Mx({check:"string_format",format:"includes",...ee(t),includes:e})}function ky(e,t){return new Dx({check:"string_format",format:"starts_with",...ee(t),prefix:e})}function Sy(e,t){return new $x({check:"string_format",format:"ends_with",...ee(t),suffix:e})}function Xn(e){return new zx({check:"overwrite",tx:e})}function Cy(e){return Xn(t=>t.normalize(e))}function _y(){return Xn(e=>e.trim())}function Ey(){return Xn(e=>e.toLowerCase())}function Ty(){return Xn(e=>e.toUpperCase())}function Py(){return Xn(e=>Av(e))}function Ny(e,t,n){return new e({type:"array",element:t,...ee(n)})}function Iy(e,t,n){return new e({type:"custom",check:"custom",fn:t,...ee(n)})}function Ay(e){const t=Ry(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(wr(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(wr(o))}},e(n.value,n)));return t}function Ry(e,t){const n=new st({check:"custom",...ee(t)});return n._zod.check=e,n}function Au(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??fr,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"&&nt(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 Ru(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>
38
+
39
+ 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 ju(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:yo(t,"input",e.processors),output:yo(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function nt(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 nt(r.element,n);if(r.type==="set")return nt(r.valueType,n);if(r.type==="lazy")return nt(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 nt(r.innerType,n);if(r.type==="intersection")return nt(r.left,n)||nt(r.right,n);if(r.type==="record"||r.type==="map")return nt(r.keyType,n)||nt(r.valueType,n);if(r.type==="pipe")return nt(r.in,n)||nt(r.out,n);if(r.type==="object"){for(const o in r.shape)if(nt(r.shape[o],n))return!0;return!1}if(r.type==="union"){for(const o of r.options)if(nt(o,n))return!0;return!1}if(r.type==="tuple"){for(const o of r.items)if(nt(o,n))return!0;return!!(r.rest&&nt(r.rest,n))}return!1}const jy=(e,t={})=>n=>{const r=Au({...n,processors:t});return Oe(e,r),Ru(r,e),ju(r,e)},yo=(e,t,n={})=>r=>{const{libraryOptions:o,target:i}=r??{},a=Au({...o??{},target:i,io:t,processors:n});return Oe(e,a),Ru(a,e),ju(a,e)},Oy={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},My=(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=Oy[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}))])}},Dy=(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)},$y=(e,t,n,r)=>{n.type="boolean"},zy=(e,t,n,r)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},Ly=(e,t,n,r)=>{n.not={}},Fy=(e,t,n,r)=>{},By=(e,t,n,r)=>{},Vy=(e,t,n,r)=>{const o=e._zod.def,i=du(o.entries);i.every(a=>typeof a=="number")&&(n.type="number"),i.every(a=>typeof a=="string")&&(n.type="string"),n.enum=i},Uy=(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},Zy=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Hy=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Gy=(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"]})},Wy=(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)},qy=(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},Ky=(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},Jy=(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)}},Yy=(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"}]},Xy=(e,t,n,r)=>{const o=e._zod.def;Oe(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType},Qy=(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))},ew=(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)))},tw=(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},nw=(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},rw=(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},Ou=(e,t,n,r)=>{const o=e._zod.def;Oe(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType},ow=(e,t,n,r)=>{const o=e._zod.innerType;Oe(o,t,r);const i=t.seen.get(e);i.ref=o},iw=M("ZodISODateTime",(e,t)=>{Xx.init(e,t),je.init(e,t)});function aw(e){return sy(iw,e)}const sw=M("ZodISODate",(e,t)=>{Qx.init(e,t),je.init(e,t)});function lw(e){return ly(sw,e)}const cw=M("ZodISOTime",(e,t)=>{eb.init(e,t),je.init(e,t)});function uw(e){return cy(cw,e)}const dw=M("ZodISODuration",(e,t)=>{tb.init(e,t),je.init(e,t)});function fw(e){return uy(dw,e)}const pw=(e,t)=>{mu.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>Zv(e,n)},flatten:{value:n=>Uv(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Qi,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Qi,2)}},isEmpty:{get(){return e.issues.length===0}}})},xt=M("ZodError",pw,{Parent:Error}),hw=Fa(xt),mw=Ba(xt),gw=Mo(xt),vw=Do(xt),xw=Wv(xt),bw=qv(xt),yw=Kv(xt),ww=Jv(xt),kw=Yv(xt),Sw=Xv(xt),Cw=Qv(xt),_w=ex(xt),Ee=M("ZodType",(e,t)=>(_e.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:yo(e,"input"),output:yo(e,"output")}}),e.toJSONSchema=jy(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Yt(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)=>Xt(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>hw(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>gw(e,n,r),e.parseAsync=async(n,r)=>mw(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>vw(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>xw(e,n,r),e.decode=(n,r)=>bw(e,n,r),e.encodeAsync=async(n,r)=>yw(e,n,r),e.decodeAsync=async(n,r)=>ww(e,n,r),e.safeEncode=(n,r)=>kw(e,n,r),e.safeDecode=(n,r)=>Sw(e,n,r),e.safeEncodeAsync=async(n,r)=>Cw(e,n,r),e.safeDecodeAsync=async(n,r)=>_w(e,n,r),e.refine=(n,r)=>e.check(C0(n,r)),e.superRefine=n=>e.check(_0(n)),e.overwrite=n=>e.check(Xn(n)),e.optional=()=>_l(e),e.exactOptional=()=>c0(e),e.nullable=()=>El(e),e.nullish=()=>_l(El(e)),e.nonoptional=n=>m0(e,n),e.array=()=>Ue(e),e.or=n=>Dt([e,n]),e.and=n=>r0(e,n),e.transform=n=>Tl(e,s0(n)),e.default=n=>f0(e,n),e.prefault=n=>h0(e,n),e.catch=n=>v0(e,n),e.pipe=n=>Tl(e,n),e.readonly=()=>y0(e),e.describe=n=>{const r=e.clone();return fr.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return fr.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return fr.get(e);const r=e.clone();return fr.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),Mu=M("_ZodString",(e,t)=>{Va.init(e,t),Ee.init(e,t),e._zod.processJSONSchema=(r,o,i)=>My(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(xy(...r)),e.includes=(...r)=>e.check(wy(...r)),e.startsWith=(...r)=>e.check(ky(...r)),e.endsWith=(...r)=>e.check(Sy(...r)),e.min=(...r)=>e.check(bo(...r)),e.max=(...r)=>e.check(Nu(...r)),e.length=(...r)=>e.check(Iu(...r)),e.nonempty=(...r)=>e.check(bo(1,...r)),e.lowercase=r=>e.check(by(r)),e.uppercase=r=>e.check(yy(r)),e.trim=()=>e.check(_y()),e.normalize=(...r)=>e.check(Cy(...r)),e.toLowerCase=()=>e.check(Ey()),e.toUpperCase=()=>e.check(Ty()),e.slugify=()=>e.check(Py())}),Ew=M("ZodString",(e,t)=>{Va.init(e,t),Mu.init(e,t),e.email=n=>e.check(Fb(Tw,n)),e.url=n=>e.check(Hb(Pw,n)),e.jwt=n=>e.check(ay(Uw,n)),e.emoji=n=>e.check(Gb(Nw,n)),e.guid=n=>e.check(bl(Sl,n)),e.uuid=n=>e.check(Bb(Yr,n)),e.uuidv4=n=>e.check(Vb(Yr,n)),e.uuidv6=n=>e.check(Ub(Yr,n)),e.uuidv7=n=>e.check(Zb(Yr,n)),e.nanoid=n=>e.check(Wb(Iw,n)),e.guid=n=>e.check(bl(Sl,n)),e.cuid=n=>e.check(qb(Aw,n)),e.cuid2=n=>e.check(Kb(Rw,n)),e.ulid=n=>e.check(Jb(jw,n)),e.base64=n=>e.check(ry(Fw,n)),e.base64url=n=>e.check(oy(Bw,n)),e.xid=n=>e.check(Yb(Ow,n)),e.ksuid=n=>e.check(Xb(Mw,n)),e.ipv4=n=>e.check(Qb(Dw,n)),e.ipv6=n=>e.check(ey($w,n)),e.cidrv4=n=>e.check(ty(zw,n)),e.cidrv6=n=>e.check(ny(Lw,n)),e.e164=n=>e.check(iy(Vw,n)),e.datetime=n=>e.check(aw(n)),e.date=n=>e.check(lw(n)),e.time=n=>e.check(uw(n)),e.duration=n=>e.check(fw(n))});function z(e){return Lb(Ew,e)}const je=M("ZodStringFormat",(e,t)=>{Ne.init(e,t),Mu.init(e,t)}),Tw=M("ZodEmail",(e,t)=>{Ux.init(e,t),je.init(e,t)}),Sl=M("ZodGUID",(e,t)=>{Bx.init(e,t),je.init(e,t)}),Yr=M("ZodUUID",(e,t)=>{Vx.init(e,t),je.init(e,t)}),Pw=M("ZodURL",(e,t)=>{Zx.init(e,t),je.init(e,t)}),Nw=M("ZodEmoji",(e,t)=>{Hx.init(e,t),je.init(e,t)}),Iw=M("ZodNanoID",(e,t)=>{Gx.init(e,t),je.init(e,t)}),Aw=M("ZodCUID",(e,t)=>{Wx.init(e,t),je.init(e,t)}),Rw=M("ZodCUID2",(e,t)=>{qx.init(e,t),je.init(e,t)}),jw=M("ZodULID",(e,t)=>{Kx.init(e,t),je.init(e,t)}),Ow=M("ZodXID",(e,t)=>{Jx.init(e,t),je.init(e,t)}),Mw=M("ZodKSUID",(e,t)=>{Yx.init(e,t),je.init(e,t)}),Dw=M("ZodIPv4",(e,t)=>{nb.init(e,t),je.init(e,t)}),$w=M("ZodIPv6",(e,t)=>{rb.init(e,t),je.init(e,t)}),zw=M("ZodCIDRv4",(e,t)=>{ob.init(e,t),je.init(e,t)}),Lw=M("ZodCIDRv6",(e,t)=>{ib.init(e,t),je.init(e,t)}),Fw=M("ZodBase64",(e,t)=>{ab.init(e,t),je.init(e,t)}),Bw=M("ZodBase64URL",(e,t)=>{lb.init(e,t),je.init(e,t)}),Vw=M("ZodE164",(e,t)=>{cb.init(e,t),je.init(e,t)}),Uw=M("ZodJWT",(e,t)=>{db.init(e,t),je.init(e,t)}),Du=M("ZodNumber",(e,t)=>{_u.init(e,t),Ee.init(e,t),e._zod.processJSONSchema=(r,o,i)=>Dy(e,r,o),e.gt=(r,o)=>e.check(wl(r,o)),e.gte=(r,o)=>e.check(wi(r,o)),e.min=(r,o)=>e.check(wi(r,o)),e.lt=(r,o)=>e.check(yl(r,o)),e.lte=(r,o)=>e.check(yi(r,o)),e.max=(r,o)=>e.check(yi(r,o)),e.int=r=>e.check(Cl(r)),e.safe=r=>e.check(Cl(r)),e.positive=r=>e.check(wl(0,r)),e.nonnegative=r=>e.check(wi(0,r)),e.negative=r=>e.check(yl(0,r)),e.nonpositive=r=>e.check(yi(0,r)),e.multipleOf=(r,o)=>e.check(kl(r,o)),e.step=(r,o)=>e.check(kl(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 dy(Du,e)}const Zw=M("ZodNumberFormat",(e,t)=>{fb.init(e,t),Du.init(e,t)});function Cl(e){return fy(Zw,e)}const Hw=M("ZodBoolean",(e,t)=>{pb.init(e,t),Ee.init(e,t),e._zod.processJSONSchema=(n,r,o)=>$y(e,n,r)});function mt(e){return py(Hw,e)}const Gw=M("ZodNull",(e,t)=>{hb.init(e,t),Ee.init(e,t),e._zod.processJSONSchema=(n,r,o)=>zy(e,n,r)});function Ww(e){return hy(Gw,e)}const qw=M("ZodAny",(e,t)=>{mb.init(e,t),Ee.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Fy()});function Kw(){return my(qw)}const Jw=M("ZodUnknown",(e,t)=>{gb.init(e,t),Ee.init(e,t),e._zod.processJSONSchema=(n,r,o)=>By()});function Mt(){return gy(Jw)}const Yw=M("ZodNever",(e,t)=>{vb.init(e,t),Ee.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ly(e,n,r)});function Xw(e){return vy(Yw,e)}const Qw=M("ZodArray",(e,t)=>{xb.init(e,t),Ee.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Gy(e,n,r,o),e.element=t.element,e.min=(n,r)=>e.check(bo(n,r)),e.nonempty=n=>e.check(bo(1,n)),e.max=(n,r)=>e.check(Nu(n,r)),e.length=(n,r)=>e.check(Iu(n,r)),e.unwrap=()=>e.element});function Ue(e,t){return Ny(Qw,e,t)}const e0=M("ZodObject",(e,t)=>{yb.init(e,t),Ee.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Wy(e,n,r,o),ve(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:Mt()}),e.loose=()=>e.clone({...e._zod.def,catchall:Mt()}),e.strict=()=>e.clone({...e._zod.def,catchall:Xw()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>zv(e,n),e.safeExtend=n=>Lv(e,n),e.merge=n=>Fv(e,n),e.pick=n=>Dv(e,n),e.omit=n=>$v(e,n),e.partial=(...n)=>Bv($u,e,n[0]),e.required=(...n)=>Vv(zu,e,n[0])});function X(e,t){const n={type:"object",shape:e??{},...ee(t)};return new e0(n)}const t0=M("ZodUnion",(e,t)=>{wb.init(e,t),Ee.init(e,t),e._zod.processJSONSchema=(n,r,o)=>qy(e,n,r,o),e.options=t.options});function Dt(e,t){return new t0({type:"union",options:e,...ee(t)})}const n0=M("ZodIntersection",(e,t)=>{kb.init(e,t),Ee.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ky(e,n,r,o)});function r0(e,t){return new n0({type:"intersection",left:e,right:t})}const o0=M("ZodRecord",(e,t)=>{Sb.init(e,t),Ee.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Jy(e,n,r,o),e.keyType=t.keyType,e.valueType=t.valueType});function Gt(e,t,n){return new o0({type:"record",keyType:e,valueType:t,...ee(n)})}const ta=M("ZodEnum",(e,t)=>{Cb.init(e,t),Ee.init(e,t),e._zod.processJSONSchema=(r,o,i)=>Vy(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 ta({...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 ta({...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 ta({type:"enum",entries:n,...ee(t)})}const i0=M("ZodLiteral",(e,t)=>{_b.init(e,t),Ee.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Uy(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 Ua(e,t){return new i0({type:"literal",values:Array.isArray(e)?e:[e],...ee(t)})}const a0=M("ZodTransform",(e,t)=>{Eb.init(e,t),Ee.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Hy(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new cu(e.constructor.name);n.addIssue=i=>{if(typeof i=="string")n.issues.push(wr(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(wr(a))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(i=>(n.value=i,n)):(n.value=o,n)}});function s0(e){return new a0({type:"transform",transform:e})}const $u=M("ZodOptional",(e,t)=>{Pu.init(e,t),Ee.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ou(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function _l(e){return new $u({type:"optional",innerType:e})}const l0=M("ZodExactOptional",(e,t)=>{Tb.init(e,t),Ee.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ou(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function c0(e){return new l0({type:"optional",innerType:e})}const u0=M("ZodNullable",(e,t)=>{Pb.init(e,t),Ee.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Yy(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function El(e){return new u0({type:"nullable",innerType:e})}const d0=M("ZodDefault",(e,t)=>{Nb.init(e,t),Ee.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Qy(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function f0(e,t){return new d0({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():pu(t)}})}const p0=M("ZodPrefault",(e,t)=>{Ib.init(e,t),Ee.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ew(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function h0(e,t){return new p0({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():pu(t)}})}const zu=M("ZodNonOptional",(e,t)=>{Ab.init(e,t),Ee.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Xy(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function m0(e,t){return new zu({type:"nonoptional",innerType:e,...ee(t)})}const g0=M("ZodCatch",(e,t)=>{Rb.init(e,t),Ee.init(e,t),e._zod.processJSONSchema=(n,r,o)=>tw(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function v0(e,t){return new g0({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const x0=M("ZodPipe",(e,t)=>{jb.init(e,t),Ee.init(e,t),e._zod.processJSONSchema=(n,r,o)=>nw(e,n,r,o),e.in=t.in,e.out=t.out});function Tl(e,t){return new x0({type:"pipe",in:e,out:t})}const b0=M("ZodReadonly",(e,t)=>{Ob.init(e,t),Ee.init(e,t),e._zod.processJSONSchema=(n,r,o)=>rw(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function y0(e){return new b0({type:"readonly",innerType:e})}const w0=M("ZodLazy",(e,t)=>{Mb.init(e,t),Ee.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ow(e,n,r,o),e.unwrap=()=>e._zod.def.getter()});function k0(e){return new w0({type:"lazy",getter:e})}const S0=M("ZodCustom",(e,t)=>{Db.init(e,t),Ee.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Zy(e,n)});function C0(e,t={}){return Iy(S0,e,t)}function _0(e){return Ay(e)}var Lu=Dt([z(),Ye(),mt(),Ww(),X({$state:z()})]);Dt([z(),X({$state:z()})]);Dt([Ye(),X({$state:z()})]);Dt([mt(),X({$state:z()})]);function E0(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function T0(e){return(e.startsWith("/")?e.slice(1).split("/"):e.split("/")).map(E0)}function St(e,t){if(!t||t==="/")return e;const n=T0(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 Xr=Dt([Ye(),X({$state:z()})]),Za={eq:Mt().optional(),neq:Mt().optional(),gt:Xr.optional(),gte:Xr.optional(),lt:Xr.optional(),lte:Xr.optional(),not:Ua(!0).optional()},P0=X({$state:z(),...Za}),N0=X({$item:z(),...Za}),I0=X({$index:Ua(!0),...Za}),Pl=Dt([P0,N0,I0]),na=k0(()=>Dt([mt(),Pl,Ue(Pl),X({$and:Ue(na)}),X({$or:Ue(na)})]));function Nn(e,t){return typeof e=="object"&&e!==null&&"$state"in e&&typeof e.$state=="string"?St(t.stateModel,e.$state):e}function A0(e){return"$item"in e}function R0(e){return"$index"in e}function j0(e,t){return R0(e)?t.repeatIndex:A0(e)?t.repeatItem===void 0?void 0:e.$item===""?t.repeatItem:St(t.repeatItem,e.$item):St(t.stateModel,e.$state)}function Nl(e,t){const n=j0(e,t);let r;if(e.eq!==void 0){const o=Nn(e.eq,t);r=n===o}else if(e.neq!==void 0){const o=Nn(e.neq,t);r=n!==o}else if(e.gt!==void 0){const o=Nn(e.gt,t);r=typeof n=="number"&&typeof o=="number"?n>o:!1}else if(e.gte!==void 0){const o=Nn(e.gte,t);r=typeof n=="number"&&typeof o=="number"?n>=o:!1}else if(e.lt!==void 0){const o=Nn(e.lt,t);r=typeof n=="number"&&typeof o=="number"?n<o:!1}else if(e.lte!==void 0){const o=Nn(e.lte,t);r=typeof n=="number"&&typeof o=="number"?n<=o:!1}else r=!!n;return e.not===!0?!r:r}function O0(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&"$and"in e}function M0(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&"$or"in e}function wo(e,t){return e===void 0?!0:typeof e=="boolean"?e:Array.isArray(e)?e.every(n=>Nl(n,t)):O0(e)?e.$and.every(n=>wo(n,t)):M0(e)?e.$or.some(n=>wo(n,t)):Nl(e,t)}function D0(e){return typeof e=="object"&&e!==null&&"$state"in e&&typeof e.$state=="string"}function Fu(e){return typeof e=="object"&&e!==null&&"$item"in e&&typeof e.$item=="string"}function Bu(e){return typeof e=="object"&&e!==null&&"$index"in e&&e.$index===!0}function Vu(e){return typeof e=="object"&&e!==null&&"$bindState"in e&&typeof e.$bindState=="string"}function Uu(e){return typeof e=="object"&&e!==null&&"$bindItem"in e&&typeof e.$bindItem=="string"}function $0(e){return typeof e=="object"&&e!==null&&"$cond"in e&&"$then"in e&&"$else"in e}function z0(e){return typeof e=="object"&&e!==null&&"$computed"in e&&typeof e.$computed=="string"}function L0(e){return typeof e=="object"&&e!==null&&"$template"in e&&typeof e.$template=="string"}var F0=100,ki=new Set,B0=100,Si=new Set;function Ha(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(D0(e))return St(t.stateModel,e.$state);if(Fu(e))return t.repeatItem===void 0?void 0:e.$item===""?t.repeatItem:St(t.repeatItem,e.$item);if(Bu(e))return t.repeatIndex;if(Vu(e))return St(t.stateModel,e.$bindState);if(Uu(e)){const n=Ha(e.$bindItem,t);return n===void 0?void 0:St(t.stateModel,n)}if($0(e)){const n=wo(e.$cond,t);return Vn(n?e.$then:e.$else,t)}if(z0(e)){const n=t.functions?.[e.$computed];if(!n){ki.has(e.$computed)||(ki.size<F0&&ki.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(L0(e))return e.$template.replace(/\$\{([^}]+)\}/g,(n,r)=>{let o=r;o.startsWith("/")||(Si.has(o)||(Si.size<B0&&Si.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 V0(e,t){const n={};for(const[r,o]of Object.entries(e))n[r]=Vn(o,t);return n}function U0(e,t){let n;for(const[r,o]of Object.entries(e))if(Vu(o))n||(n={}),n[r]=o.$bindState;else if(Uu(o)){const i=Ha(o.$bindItem,t);i!==void 0&&(n||(n={}),n[r]=i)}return n}function Il(e,t){return Fu(e)?Ha(e.$item,t):Bu(e)?t.repeatIndex:Vn(e,t)}var Z0=X({title:z(),message:z(),confirmLabel:z().optional(),cancelLabel:z().optional(),variant:Ie(["default","danger"]).optional()}),H0=Dt([X({navigate:z()}),X({set:Gt(z(),Mt())}),X({action:z()})]),G0=Dt([X({set:Gt(z(),Mt())}),X({action:z()})]);X({action:z(),params:Gt(z(),Lu).optional(),confirm:Z0.optional(),onSuccess:H0.optional(),onError:G0.optional(),preventDefault:mt().optional()});var W0=X({type:z(),args:Gt(z(),Lu).optional(),message:z()});X({checks:Ue(W0).optional(),validateOn:Ie(["change","blur","submit"]).optional(),enabled:na.optional()});function q0(){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 K0(e,t){const n=q0();return{definition:e(n),promptTemplate:t?.promptTemplate,defaultRules:t?.defaultRules,builtInActions:t?.builtInActions,createCatalog(o){return J0(this,o)}}}function J0(e,t){const n=t.components,r=t.actions,o=n?Object.keys(n):[],i=r?Object.keys(r):[],a=Y0(e.definition,t);return{schema:e,data:t,componentNames:o,actionNames:i,prompt(s={}){return ek(this,s)},jsonSchema(){return zn(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 Y0(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 Kw();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 Gt(z(),n)}case"ref":{const n=e.inner,r=X0(n,t);return r.length===0?z():r.length===1?Ua(r[0]):Ie(r)}case"propsOf":{const n=e.inner,r=Q0(n,t);return r.length===0?Gt(z(),Mt()):r.length===1?r[0]:Gt(z(),Mt())}default:return Mt()}}function X0(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 Q0(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 ek(e,t){if(e.schema.promptTemplate){const N={catalog:e.data,componentNames:e.componentNames,actionNames:e.actionNames,options:t,formatZodType:pn};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?Al(d):{},h=u?Al(u):{},v=u?.props?tk(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(`
40
+ `);i.push(`${b}
41
+
42
+ 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,I]of Object.entries(x)){const j=I.props?pn(I.props):"{}",O=I.slots&&I.slots.length>0?" [accepts children]":"",B=I.events&&I.events.length>0?` [events: ${I.events.join(", ")}]`:"",W=I.description?` - ${I.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,I]of Object.entries(y))i.push(`- ${N}${I.description?`: ${I.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?pn(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 A=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[...A,...R,...r].forEach((N,I)=>{i.push(`${I+1}. ${N}`)}),i.join(`
43
+ `)}function Al(e){return e.example&&Object.keys(e.example).length>0?e.example:e.props?Zu(e.props):{}}function Zu(e){if(!e||!e._def)return{};const t=e._def,n=gn(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=gn(a);s==="ZodOptional"||s==="optional"||s==="ZodNullable"||s==="nullable"||(o[i]=ra(a))}return o}function ra(e){if(!e||!e._def)return"...";const t=e._def;switch(gn(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?ra(r):null}case"ZodArray":case"array":return[];case"ZodObject":case"object":return Zu(e);case"ZodUnion":case"union":{const r=t.options;return r&&r.length>0?ra(r[0]):"..."}default:return"..."}}function tk(e){if(!e||!e._def)return null;const t=e._def,n=gn(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=gn(i);if(!(a==="ZodOptional"||a==="optional"||a==="ZodNullable"||a==="nullable")&&(a==="ZodString"||a==="string"))return o}return null}function gn(e){if(!e||!e._def)return"";const t=e._def;return t.typeName??t.type??""}function pn(e){if(!e||!e._def)return"unknown";const t=e._def;switch(gn(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<${pn(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=gn(a);return`${i}${s==="ZodOptional"||s==="ZodNullable"||s==="optional"||s==="nullable"?"?":""}: ${pn(a)}`}).join(", ")} }`:"object"}case"ZodOptional":case"optional":case"ZodNullable":case"nullable":{const r=t.innerType??t.wrapped;return r?pn(r):"unknown"}case"ZodUnion":case"union":{const r=t.options;return r?r.map(o=>pn(o)).join(" | "):"unknown"}default:return"unknown"}}function zn(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?zn(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]=zn(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?zn(r):!0}}case"ZodOptional":case"ZodNullable":{const r=t.innerType;return r?zn(r):{}}case"ZodUnion":{const r=t.options;return r?{anyOf:r.map(zn)}:{}}case"ZodAny":return{};default:return{}}}function nk(e,t){return e.createCatalog(t)}var rk=K0(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."]}),ok=m.createContext(null);function zo(){const e=m.useContext(ok);if(!e)throw new Error("useStateStore must be used within a StateProvider");return e}function Rl(e){const{state:t,set:n}=zo(),r=St(t,e),o=m.useCallback(i=>n(e,i),[e,n]);return[r,o]}var ik=m.createContext(null);function ak(){const e=m.useContext(ik);if(!e)throw new Error("useVisibility must be used within a VisibilityProvider");return e}var sk=m.createContext(null);function lk(){const e=m.useContext(sk);if(!e)throw new Error("useValidation must be used within a ValidationProvider");return e}function In(e,t){const{fieldStates:n,validate:r,touch:o,clear:i,registerField:a}=lk();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 ck=m.createContext(null);function uk(){const e=m.useContext(ck);if(!e)throw new Error("useActions must be used within an ActionProvider");return e}var Hu=m.createContext(null);function dk({item:e,index:t,basePath:n,children:r}){return f.jsx(Hu.Provider,{value:{item:e,index:t,basePath:n},children:r})}function fk(){return m.useContext(Hu)}var pk=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}},hk={},mk=L.createContext(hk);function gk(){return L.useContext(mk)}var vk=L.memo(function e({element:t,spec:n,registry:r,loading:o,fallback:i}){const a=fk(),{ctx:s}=ak(),{execute:l}=uk(),{getSnapshot:c,state:d}=zo(),u=gk(),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:wo(t.visible,p),v=t.on,g=m.useCallback(async N=>{const I=v?.[N];if(!I)return;const j=Array.isArray(I)?I:[I];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]=Il(Y,O);await l({...$,params:B})}},[v,l,p,c]),b=m.useCallback(N=>{const I=v?.[N];if(!I)return{emit:()=>{},shouldPreventDefault:!1,bound:!1};const $=(Array.isArray(I)?I:[I]).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 I=w.current;if(I){const j=Object.keys(N);if(j.length===Object.keys(I).length&&j.every($=>N[$]===I[$]))return I}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 I=y.current;if(y.current=S,I===null)return;let j=!1;return(async()=>{for(const $ of N){if(j)break;if(S[$]!==I[$]){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]=Il(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=U0(P,p),T=V0(P,p),A=T!==t.props?{...t,props:T}:t,R=r[A.type]??i;if(!R)return console.warn(`No renderer for component type: ${A.type}`),null;const E=A.repeat?f.jsx(xk,{element:A,spec:n,registry:r,loading:o,fallback:i}):A.children?.map(N=>{const I=n.elements[N];return I?f.jsx(e,{element:I,spec:n,registry:r,loading:o,fallback:i},N):(o||console.warn(`[json-render] Missing element "${N}" referenced as child of "${A.type}". This element will not render.`),null)});return f.jsx(pk,{elementType:A.type,children:f.jsx(R,{element:A,emit:g,on:b,bindings:C,loading:o,children:E})})});function xk({element:e,spec:t,registry:n,loading:r,fallback:o}){const{state:i}=zo(),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(dk,{item:c,index:d,basePath:`${s}/${d}`,children:e.children?.map(p=>{const h=t.elements[p];return h?f.jsx(vk,{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 bk(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}=zo(),r=m.useCallback(o=>{t&&n(t,o)},[t,n]);return[e,r]}var An=Ue(X({type:z(),message:z(),args:Gt(z(),Mt()).optional()})).nullable(),Rn=Ie(["change","blur","submit"]).nullable(),yk={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:An,validateOn:Rn}),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:An,validateOn:Rn}),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:An,validateOn:Rn}),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:An,validateOn:Rn}),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:An,validateOn:Rn}),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:An,validateOn:Rn}),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 jl(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Lo(...e){return t=>{let n=!1;const r=e.map(o=>{const i=jl(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():jl(e[o],null)}}}}function ae(...e){return m.useCallback(Lo(...e),e)}function Jt(e){const t=wk(e),n=m.forwardRef((r,o)=>{const{children:i,...a}=r,s=m.Children.toArray(i),l=s.find(Sk);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 Gu=Jt("Slot");function wk(e){const t=m.forwardRef((n,r)=>{const{children:o,...i}=n;if(m.isValidElement(o)){const a=_k(o),s=Ck(i,o.props);return o.type!==m.Fragment&&(s.ref=r?Lo(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 Wu=Symbol("radix.slottable");function kk(e){const t=({children:n})=>f.jsx(f.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Wu,t}function Sk(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Wu}function Ck(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 _k(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 Ek=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],J=Ek.reduce((e,t)=>{const n=Jt(`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 qu(e,t){e&&Ma.flushSync(()=>e.dispatchEvent(t))}var Ku=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"}),Tk="VisuallyHidden",Ju=m.forwardRef((e,t)=>f.jsx(J.span,{...e,ref:t,style:{...Ku,...e.style}}));Ju.displayName=Tk;var Pk=Ju;function Nk(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,Ik(o,...t)]}function Ik(...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 Ar(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=Jt(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=Jt(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:()=>{},Ak=ru[" useInsertionEffect ".trim().toString()]||Le;function Ze({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,a]=Rk({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=jk(d)?d(e):d;u!==e&&a.current?.(u)}else i(d)},[s,e,i,a]);return[l,c]}function Rk({defaultProp:e,onChange:t}){const[n,r]=m.useState(e),o=m.useRef(n),i=m.useRef(t);return Ak(()=>{i.current=t},[t]),m.useEffect(()=>{o.current!==n&&(i.current?.(n),o.current=n)},[n,o]),[n,r,i]}function jk(e){return typeof e=="function"}function Ok(e,t){return m.useReducer((n,r)=>t[n][r]??n,e)}var et=e=>{const{present:t,children:n}=e,r=Mk(t),o=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),i=ae(r.ref,Dk(o));return typeof n=="function"||r.isPresent?m.cloneElement(o,{ref:i}):null};et.displayName="Presence";function Mk(e){const[t,n]=m.useState(),r=m.useRef(null),o=m.useRef(e),i=m.useRef("none"),a=e?"mounted":"unmounted",[s,l]=Ok(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const c=Qr(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=Qr(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=Qr(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=Qr(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 Qr(e){return e?.animationName||"none"}function Dk(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 $k=ru[" useId ".trim().toString()]||(()=>{}),zk=0;function at(e){const[t,n]=m.useState($k());return Le(()=>{n(r=>r??String(zk++))},[e]),e||(t?`radix-${t}`:"")}var Fo="Collapsible",[Lk,Yu]=Fe(Fo),[Fk,Ga]=Lk(Fo),Xu=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:Fo});return f.jsx(Fk,{scope:n,disabled:i,contentId:at(),open:l,onOpenToggle:m.useCallback(()=>c(d=>!d),[c]),children:f.jsx(J.div,{"data-state":Ja(l),"data-disabled":i?"":void 0,...s,ref:t})})});Xu.displayName=Fo;var Qu="CollapsibleTrigger",Wa=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=Ga(Qu,n);return f.jsx(J.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":Ja(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...r,ref:t,onClick:Z(e.onClick,o.onOpenToggle)})});Wa.displayName=Qu;var qa="CollapsibleContent",Ka=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Ga(qa,e.__scopeCollapsible);return f.jsx(et,{present:n||o.open,children:({present:i})=>f.jsx(Bk,{...r,ref:t,present:i})})});Ka.displayName=qa;var Bk=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...i}=e,a=Ga(qa,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":Ja(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 Ja(e){return e?"open":"closed"}var ed=Xu,Vk=Wa,Uk=Ka,Zk=m.createContext(void 0);function Qt(e){const t=m.useContext(Zk);return e||t||"ltr"}var Pt="Accordion",Hk=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[Ya,Gk,Wk]=Ar(Pt),[Bo]=Fe(Pt,[Wk,Yu]),Xa=Yu(),td=L.forwardRef((e,t)=>{const{type:n,...r}=e,o=r,i=r;return f.jsx(Ya.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?f.jsx(Yk,{...i,ref:t}):f.jsx(Jk,{...o,ref:t})})});td.displayName=Pt;var[nd,qk]=Bo(Pt),[rd,Kk]=Bo(Pt,{collapsible:!1}),Jk=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(nd,{scope:e.__scopeAccordion,value:L.useMemo(()=>s?[s]:[],[s]),onItemOpen:l,onItemClose:L.useCallback(()=>i&&l(""),[i,l]),children:f.jsx(rd,{scope:e.__scopeAccordion,collapsible:i,children:f.jsx(od,{...a,ref:t})})})}),Yk=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(nd,{scope:e.__scopeAccordion,value:a,onItemOpen:l,onItemClose:c,children:f.jsx(rd,{scope:e.__scopeAccordion,collapsible:!0,children:f.jsx(od,{...i,ref:t})})})}),[Xk,Vo]=Bo(Pt),od=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=Gk(n),u=Qt(o)==="ltr",p=Z(e.onKeyDown,h=>{if(!Hk.includes(h.key))return;const v=h.target,g=c().filter(A=>!A.ref.current?.disabled),b=g.findIndex(A=>A.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(Xk,{scope:n,disabled:r,direction:o,orientation:i,children:f.jsx(Ya.Slot,{scope:n,children:f.jsx(J.div,{...a,"data-orientation":i,ref:l,onKeyDown:r?void 0:p})})})}),ko="AccordionItem",[Qk,Qa]=Bo(ko),id=L.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...o}=e,i=Vo(ko,n),a=qk(ko,n),s=Xa(n),l=at(),c=r&&a.value.includes(r)||!1,d=i.disabled||e.disabled;return f.jsx(Qk,{scope:n,open:c,disabled:d,triggerId:l,children:f.jsx(ed,{"data-orientation":i.orientation,"data-state":dd(c),...s,...o,ref:t,disabled:d,open:c,onOpenChange:u=>{u?a.onItemOpen(r):a.onItemClose(r)}})})});id.displayName=ko;var ad="AccordionHeader",sd=L.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Vo(Pt,n),i=Qa(ad,n);return f.jsx(J.h3,{"data-orientation":o.orientation,"data-state":dd(i.open),"data-disabled":i.disabled?"":void 0,...r,ref:t})});sd.displayName=ad;var oa="AccordionTrigger",ld=L.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Vo(Pt,n),i=Qa(oa,n),a=Kk(oa,n),s=Xa(n);return f.jsx(Ya.ItemSlot,{scope:n,children:f.jsx(Vk,{"aria-disabled":i.open&&!a.collapsible||void 0,"data-orientation":o.orientation,id:i.triggerId,...s,...r,ref:t})})});ld.displayName=oa;var cd="AccordionContent",ud=L.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Vo(Pt,n),i=Qa(cd,n),a=Xa(n);return f.jsx(Uk,{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}})});ud.displayName=cd;function dd(e){return e?"open":"closed"}var eS=td,tS=id,nS=sd,rS=ld,oS=ud;function Tt(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>t.current?.(...n),[])}function iS(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 aS="DismissableLayer",ia="dismissableLayer.update",sS="dismissableLayer.pointerDownOutside",lS="dismissableLayer.focusOutside",Ol,fd=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Qn=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:a,onDismiss:s,...l}=e,c=m.useContext(fd),[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=dS(T=>{const A=T.target,R=[...c.branches].some(E=>E.contains(A));!S||R||(o?.(T),a?.(T),T.defaultPrevented||s?.())},p),C=fS(T=>{const A=T.target;[...c.branches].some(E=>E.contains(A))||(i?.(T),a?.(T),T.defaultPrevented||s?.())},p);return iS(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&&(Ol=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),Ml(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Ol)}},[d,p,n,c]),m.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),Ml())},[d,c]),m.useEffect(()=>{const T=()=>h({});return document.addEventListener(ia,T),()=>document.removeEventListener(ia,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)})});Qn.displayName=aS;var cS="DismissableLayerBranch",uS=m.forwardRef((e,t)=>{const n=m.useContext(fd),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})});uS.displayName=cS;function dS(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(){pd(sS,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 fS(e,t=globalThis?.document){const n=Tt(e),r=m.useRef(!1);return m.useEffect(()=>{const o=i=>{i.target&&!r.current&&pd(lS,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 Ml(){const e=new CustomEvent(ia);document.dispatchEvent(e)}function pd(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?qu(o,i):o.dispatchEvent(i)}var Ci="focusScope.autoFocusOnMount",_i="focusScope.autoFocusOnUnmount",Dl={bubbles:!1,cancelable:!0},pS="FocusScope",Rr=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:Ht(u.current,{select:!0})},b=function(w){if(h.paused||!s)return;const S=w.relatedTarget;S!==null&&(s.contains(S)||Ht(u.current,{select:!0}))},x=function(w){if(document.activeElement===document.body)for(const P of w)P.removedNodes.length>0&&Ht(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){zl.add(h);const g=document.activeElement;if(!s.contains(g)){const x=new CustomEvent(Ci,Dl);s.addEventListener(Ci,c),s.dispatchEvent(x),x.defaultPrevented||(hS(bS(hd(s)),{select:!0}),document.activeElement===g&&Ht(s))}return()=>{s.removeEventListener(Ci,c),setTimeout(()=>{const x=new CustomEvent(_i,Dl);s.addEventListener(_i,d),s.dispatchEvent(x),x.defaultPrevented||Ht(g??document.body,{select:!0}),s.removeEventListener(_i,d),zl.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]=mS(y);w&&S?!g.shiftKey&&x===S?(g.preventDefault(),n&&Ht(w,{select:!0})):g.shiftKey&&x===w&&(g.preventDefault(),n&&Ht(S,{select:!0})):x===y&&g.preventDefault()}},[n,r,h.paused]);return f.jsx(J.div,{tabIndex:-1,...a,ref:p,onKeyDown:v})});Rr.displayName=pS;function hS(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Ht(r,{select:t}),document.activeElement!==n)return}function mS(e){const t=hd(e),n=$l(t,e),r=$l(t.reverse(),e);return[n,r]}function hd(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 $l(e,t){for(const n of e)if(!gS(n,{upTo:t}))return n}function gS(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 vS(e){return e instanceof HTMLInputElement&&"select"in e}function Ht(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&vS(e)&&t&&e.select()}}var zl=xS();function xS(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Ll(e,t),e.unshift(t)},remove(t){e=Ll(e,t),e[0]?.resume()}}}function Ll(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function bS(e){return e.filter(t=>t.tagName!=="A")}var yS="Portal",er=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?vg.createPortal(f.jsx(J.div,{...r,ref:t}),a):null});er.displayName=yS;var Ei=0;function Uo(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Fl()),document.body.insertAdjacentElement("beforeend",e[1]??Fl()),Ei++,()=>{Ei===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Ei--}},[])}function Fl(){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 md(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 wS(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",kS="with-scroll-bars-hidden",SS="--removed-body-scroll-bar-size";function Ti(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function CS(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 _S=typeof window<"u"?m.useLayoutEffect:m.useEffect,Bl=new WeakMap;function ES(e,t){var n=CS(null,function(r){return e.forEach(function(o){return Ti(o,r)})});return _S(function(){var r=Bl.get(n);if(r){var o=new Set(r),i=new Set(e),a=n.current;o.forEach(function(s){i.has(s)||Ti(s,null)}),i.forEach(function(s){o.has(s)||Ti(s,a)})}Bl.set(n,e)},[e]),n}function TS(e){return e}function PS(e,t){t===void 0&&(t=TS);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 NS(e){e===void 0&&(e={});var t=PS(null);return t.options=Ot({async:!0,ssr:!1},e),t}var gd=function(e){var t=e.sideCar,n=md(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))};gd.isSideCarExport=!0;function IS(e,t){return e.useMedium(t),gd}var vd=NS(),Pi=function(){},Zo=m.forwardRef(function(e,t){var n=m.useRef(null),r=m.useState({onScrollCapture:Pi,onWheelCapture:Pi,onTouchMoveCapture:Pi}),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=md(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),P=p,C=ES([n,t]),T=Ot(Ot({},S),o);return m.createElement(m.Fragment,null,d&&m.createElement(P,{sideCar:vd,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))});Zo.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Zo.classNames={fullWidth:ho,zeroRight:po};var AS=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function RS(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=AS();return t&&e.setAttribute("nonce",t),e}function jS(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function OS(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var MS=function(){var e=0,t=null;return{add:function(n){e==0&&(t=RS())&&(jS(t,n),OS(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},DS=function(){var e=MS();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},xd=function(){var e=DS(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},$S={left:0,top:0,right:0,gap:0},Ni=function(e){return parseInt(e||"",10)||0},zS=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[Ni(n),Ni(r),Ni(o)]},LS=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return $S;var t=zS(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])}},FS=xd(),Zn="data-scroll-locked",BS=function(e,t,n,r){var o=e.left,i=e.top,a=e.right,s=e.gap;return n===void 0&&(n="margin"),`
44
+ .`.concat(kS,` {
45
+ overflow: hidden `).concat(r,`;
46
+ padding-right: `).concat(s,"px ").concat(r,`;
47
+ }
48
+ body[`).concat(Zn,`] {
49
+ overflow: hidden `).concat(r,`;
50
+ overscroll-behavior: contain;
51
+ `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
52
+ padding-left: `.concat(o,`px;
53
+ padding-top: `).concat(i,`px;
54
+ padding-right: `).concat(a,`px;
55
+ margin-left:0;
56
+ margin-top:0;
57
+ margin-right: `).concat(s,"px ").concat(r,`;
58
+ `),n==="padding"&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),`
59
+ }
60
+
61
+ .`).concat(po,` {
62
+ right: `).concat(s,"px ").concat(r,`;
63
+ }
64
+
65
+ .`).concat(ho,` {
66
+ margin-right: `).concat(s,"px ").concat(r,`;
67
+ }
68
+
69
+ .`).concat(po," .").concat(po,` {
70
+ right: 0 `).concat(r,`;
71
+ }
72
+
73
+ .`).concat(ho," .").concat(ho,` {
74
+ margin-right: 0 `).concat(r,`;
75
+ }
76
+
77
+ body[`).concat(Zn,`] {
78
+ `).concat(SS,": ").concat(s,`px;
79
+ }
80
+ `)},Vl=function(){var e=parseInt(document.body.getAttribute(Zn)||"0",10);return isFinite(e)?e:0},VS=function(){m.useEffect(function(){return document.body.setAttribute(Zn,(Vl()+1).toString()),function(){var e=Vl()-1;e<=0?document.body.removeAttribute(Zn):document.body.setAttribute(Zn,e.toString())}},[])},US=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;VS();var i=m.useMemo(function(){return LS(o)},[o]);return m.createElement(FS,{styles:BS(i,!t,o,n?"":"!important")})},aa=!1;if(typeof window<"u")try{var eo=Object.defineProperty({},"passive",{get:function(){return aa=!0,!0}});window.addEventListener("test",eo,eo),window.removeEventListener("test",eo,eo)}catch{aa=!1}var jn=aa?{passive:!1}:!1,ZS=function(e){return e.tagName==="TEXTAREA"},bd=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!ZS(e)&&n[t]==="visible")},HS=function(e){return bd(e,"overflowY")},GS=function(e){return bd(e,"overflowX")},Ul=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=yd(e,r);if(o){var i=wd(e,r),a=i[1],s=i[2];if(a>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},WS=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},qS=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},yd=function(e,t){return e==="v"?HS(t):GS(t)},wd=function(e,t){return e==="v"?WS(t):qS(t)},KS=function(e,t){return e==="h"&&t==="rtl"?-1:1},JS=function(e,t,n,r,o){var i=KS(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=wd(e,s),v=h[0],g=h[1],b=h[2],x=g-b-i*v;(v||x)&&yd(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},to=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Zl=function(e){return[e.deltaX,e.deltaY]},Hl=function(e){return e&&"current"in e?e.current:e},YS=function(e,t){return e[0]===t[0]&&e[1]===t[1]},XS=function(e){return`
81
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
82
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
83
+ `)},QS=0,On=[];function eC(e){var t=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),o=m.useState(QS++)[0],i=m.useState(xd)[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=wS([e.lockRef.current],(e.shards||[]).map(Hl),!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=to(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 A=window.getSelection(),R=A&&A.anchorNode,E=R?R===C||R.contains(C):!1;if(E)return!1;var N=Ul(T,C);if(!N)return!0;if(N?P=T:(P=T==="v"?"h":"v",N=Ul(T,C)),!N)return!1;if(!r.current&&"changedTouches"in g&&(w||S)&&(r.current=P),!P)return!0;var I=r.current||P;return JS(I,b,g,I==="h"?w:S)},[]),l=m.useCallback(function(g){var b=g;if(!(!On.length||On[On.length-1]!==i)){var x="deltaY"in b?Zl(b):to(b),y=t.current.filter(function(P){return P.name===b.type&&(P.target===b.target||b.target===P.shadowParent)&&YS(P.delta,x)})[0];if(y&&y.should){b.cancelable&&b.preventDefault();return}if(!y){var w=(a.current.shards||[]).map(Hl).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:tC(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=to(g),r.current=void 0},[]),u=m.useCallback(function(g){c(g.type,Zl(g),g.target,s(g,e.lockRef.current))},[]),p=m.useCallback(function(g){c(g.type,to(g),g.target,s(g,e.lockRef.current))},[]);m.useEffect(function(){return On.push(i),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:p}),document.addEventListener("wheel",l,jn),document.addEventListener("touchmove",l,jn),document.addEventListener("touchstart",d,jn),function(){On=On.filter(function(g){return g!==i}),document.removeEventListener("wheel",l,jn),document.removeEventListener("touchmove",l,jn),document.removeEventListener("touchstart",d,jn)}},[]);var h=e.removeScrollBar,v=e.inert;return m.createElement(m.Fragment,null,v?m.createElement(i,{styles:XS(o)}):null,h?m.createElement(US,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function tC(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const nC=IS(vd,eC);var jr=m.forwardRef(function(e,t){return m.createElement(Zo,Ot({},e,{ref:t,sideCar:nC}))});jr.classNames=Zo.classNames;var rC=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Mn=new WeakMap,no=new WeakMap,ro={},Ii=0,kd=function(e){return e&&(e.host||kd(e.parentNode))},oC=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=kd(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})},iC=function(e,t,n,r){var o=oC(t,Array.isArray(e)?e:[e]);ro[n]||(ro[n]=new WeakMap);var i=ro[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=(Mn.get(p)||0)+1,b=(i.get(p)||0)+1;Mn.set(p,g),i.set(p,b),a.push(p),g===1&&v&&no.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(),Ii++,function(){a.forEach(function(u){var p=Mn.get(u)-1,h=i.get(u)-1;Mn.set(u,p),i.set(u,h),p||(no.has(u)||u.removeAttribute(r),no.delete(u)),h||u.removeAttribute(n)}),Ii--,Ii||(Mn=new WeakMap,Mn=new WeakMap,no=new WeakMap,ro={})}},Ho=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=rC(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),iC(r,o,n,"aria-hidden")):function(){return null}},Go="Dialog",[Sd]=Fe(Go),[aC,Nt]=Sd(Go),Cd=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:Go});return f.jsx(aC,{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})};Cd.displayName=Go;var _d="DialogTrigger",sC=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Nt(_d,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":ns(o.open),...r,ref:i,onClick:Z(e.onClick,o.onOpenToggle)})});sC.displayName=_d;var es="DialogPortal",[lC,Ed]=Sd(es,{forceMount:void 0}),Td=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=Nt(es,t);return f.jsx(lC,{scope:t,forceMount:n,children:m.Children.map(r,a=>f.jsx(et,{present:n||i.open,children:f.jsx(er,{asChild:!0,container:o,children:a})}))})};Td.displayName=es;var So="DialogOverlay",Pd=m.forwardRef((e,t)=>{const n=Ed(So,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Nt(So,e.__scopeDialog);return i.modal?f.jsx(et,{present:r||i.open,children:f.jsx(uC,{...o,ref:t})}):null});Pd.displayName=So;var cC=Jt("DialogOverlay.RemoveScroll"),uC=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Nt(So,n);return f.jsx(jr,{as:cC,allowPinchZoom:!0,shards:[o.contentRef],children:f.jsx(J.div,{"data-state":ns(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),vn="DialogContent",Nd=m.forwardRef((e,t)=>{const n=Ed(vn,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Nt(vn,e.__scopeDialog);return f.jsx(et,{present:r||i.open,children:i.modal?f.jsx(dC,{...o,ref:t}):f.jsx(fC,{...o,ref:t})})});Nd.displayName=vn;var dC=m.forwardRef((e,t)=>{const n=Nt(vn,e.__scopeDialog),r=m.useRef(null),o=ae(t,n.contentRef,r);return m.useEffect(()=>{const i=r.current;if(i)return Ho(i)},[]),f.jsx(Id,{...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())})}),fC=m.forwardRef((e,t)=>{const n=Nt(vn,e.__scopeDialog),r=m.useRef(!1),o=m.useRef(!1);return f.jsx(Id,{...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()}})}),Id=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...a}=e,s=Nt(vn,n),l=m.useRef(null),c=ae(t,l);return Uo(),f.jsxs(f.Fragment,{children:[f.jsx(Rr,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:f.jsx(Qn,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":ns(s.open),...a,ref:c,onDismiss:()=>s.onOpenChange(!1)})}),f.jsxs(f.Fragment,{children:[f.jsx(pC,{titleId:s.titleId}),f.jsx(mC,{contentRef:l,descriptionId:s.descriptionId})]})]})}),ts="DialogTitle",Ad=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Nt(ts,n);return f.jsx(J.h2,{id:o.titleId,...r,ref:t})});Ad.displayName=ts;var Rd="DialogDescription",jd=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Nt(Rd,n);return f.jsx(J.p,{id:o.descriptionId,...r,ref:t})});jd.displayName=Rd;var Od="DialogClose",Md=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Nt(Od,n);return f.jsx(J.button,{type:"button",...r,ref:t,onClick:Z(e.onClick,()=>o.onOpenChange(!1))})});Md.displayName=Od;function ns(e){return e?"open":"closed"}var Dd="DialogTitleWarning",[D$,$d]=Nk(Dd,{contentName:vn,titleName:ts,docsSlug:"dialog"}),pC=({titleId:e})=>{const t=$d(Dd),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
84
+
85
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
86
+
87
+ 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},hC="DialogDescriptionWarning",mC=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${$d(hC).contentName}}.`;return m.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},zd=Cd,Ld=Td,Fd=Pd,Bd=Nd,Vd=Ad,Ud=jd,gC=Md;function vC(){return xg.useSyncExternalStore(xC,()=>!0,()=>!1)}function xC(){return()=>{}}var rs="Avatar",[bC]=Fe(rs),[yC,Zd]=bC(rs),Hd=m.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[o,i]=m.useState("idle");return f.jsx(yC,{scope:n,imageLoadingStatus:o,onImageLoadingStatusChange:i,children:f.jsx(J.span,{...r,ref:t})})});Hd.displayName=rs;var Gd="AvatarImage",Wd=m.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:o=()=>{},...i}=e,a=Zd(Gd,n),s=wC(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});Wd.displayName=Gd;var qd="AvatarFallback",Kd=m.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...o}=e,i=Zd(qd,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});Kd.displayName=qd;function Gl(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function wC(e,{referrerPolicy:t,crossOrigin:n}){const r=vC(),o=m.useRef(null),i=r?(o.current||(o.current=new window.Image),o.current):null,[a,s]=m.useState(()=>Gl(i,e));return Le(()=>{s(Gl(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 kC=Hd,SC=Wd,CC=Kd;function Or(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 Mr(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 Wo="Checkbox",[_C]=Fe(Wo),[EC,os]=_C(Wo);function TC(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:Wo}),[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:Wt(o)?!1:o,isFormControl:w,bubbleInput:b,setBubbleInput:x};return f.jsx(EC,{scope:t,...S,children:PC(u)?u(S):r})}var Jd="CheckboxTrigger",Yd=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}=os(Jd,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":Wt(l)?"mixed":l,"aria-required":c,"data-state":rf(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=>Wt(y)?!0:!y),v&&h&&(p.current=x.isPropagationStopped(),p.current||x.stopPropagation())})})});Yd.displayName=Jd;var Xd=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(TC,{__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(Yd,{...u,ref:t,__scopeCheckbox:n}),p&&f.jsx(nf,{__scopeCheckbox:n})]})})});Xd.displayName=Wo;var Qd="CheckboxIndicator",ef=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,i=os(Qd,n);return f.jsx(et,{present:r||Wt(i.checked)||i.checked===!0,children:f.jsx(J.span,{"data-state":rf(i.checked),"data-disabled":i.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});ef.displayName=Qd;var tf="CheckboxBubbleInput",nf=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}=os(tf,e),v=ae(n,h),g=Or(i),b=Mr(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=Wt(i),P.call(y,Wt(i)?!1:i),y.dispatchEvent(T)}},[p,g,i,o]);const x=m.useRef(Wt(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%)"}})});nf.displayName=tf;function PC(e){return typeof e=="function"}function Wt(e){return e==="indeterminate"}function rf(e){return Wt(e)?"indeterminate":e?"checked":"unchecked"}var NC="Arrow",of=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"})})});of.displayName=NC;var IC=of,is="Popper",[af,en]=Fe(is),[AC,sf]=af(is),lf=e=>{const{__scopePopper:t,children:n}=e,[r,o]=m.useState(null);return f.jsx(AC,{scope:t,anchor:r,onAnchorChange:o,children:n})};lf.displayName=is;var cf="PopperAnchor",uf=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=sf(cf,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})});uf.displayName=cf;var as="PopperContent",[RC,jC]=af(as),df=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=sf(as,n),[x,y]=m.useState(null),w=ae(t,U=>y(U)),[S,P]=m.useState(null),C=Mr(S),T=C?.width??0,A=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],I=N.length>0,j={padding:E,boundary:N.filter(MC),altBoundary:I},{refs:$,floatingStyles:O,placement:B,isPositioned:W,middlewareData:Y}=bg({strategy:"fixed",placement:R,whileElementsMounted:(...U)=>Tg(...U,{animationFrame:h==="always"}),elements:{reference:b.anchor},middleware:[yg({mainAxis:o+A,alignmentAxis:a}),l&&wg({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?kg():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}),DC({arrowWidth:T,arrowHeight:A}),p&&Eg({strategy:"referenceHidden",...j})]}),[V,k]=hf(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(RC,{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"}})})})});df.displayName=as;var ff="PopperArrow",OC={top:"bottom",right:"left",bottom:"top",left:"right"},pf=m.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=jC(ff,r),a=OC[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(IC,{...o,ref:n,style:{...o.style,display:"block"}})})});pf.displayName=ff;function MC(e){return e!==null}var DC=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]=hf(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 hf(e){const[t,n="center"]=e.split("-");return[t,n]}var qo=lf,Dr=uf,Ko=df,Jo=pf,Ai="rovingFocusGroup.onEntryFocus",$C={bubbles:!1,cancelable:!0},$r="RovingFocusGroup",[sa,mf,zC]=Ar($r),[LC,tn]=Fe($r,[zC]),[FC,BC]=LC($r),gf=m.forwardRef((e,t)=>f.jsx(sa.Provider,{scope:e.__scopeRovingFocusGroup,children:f.jsx(sa.Slot,{scope:e.__scopeRovingFocusGroup,children:f.jsx(VC,{...e,ref:t})})}));gf.displayName=$r;var VC=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=Qt(i),[g,b]=Ze({prop:a,defaultProp:s??null,onChange:l,caller:$r}),[x,y]=m.useState(!1),w=Tt(c),S=mf(n),P=m.useRef(!1),[C,T]=m.useState(0);return m.useEffect(()=>{const A=p.current;if(A)return A.addEventListener(Ai,w),()=>A.removeEventListener(Ai,w)},[w]),f.jsx(FC,{scope:n,orientation:r,dir:v,loop:o,currentTabStopId:g,onItemFocus:m.useCallback(A=>b(A),[b]),onItemShiftTab:m.useCallback(()=>y(!0),[]),onFocusableItemAdd:m.useCallback(()=>T(A=>A+1),[]),onFocusableItemRemove:m.useCallback(()=>T(A=>A-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,A=>{const R=!P.current;if(A.target===A.currentTarget&&R&&!x){const E=new CustomEvent(Ai,$C);if(A.currentTarget.dispatchEvent(E),!E.defaultPrevented){const N=S().filter(B=>B.focusable),I=N.find(B=>B.active),j=N.find(B=>B.id===g),O=[I,j,...N].filter(Boolean).map(B=>B.ref.current);bf(O,d)}}P.current=!1}),onBlur:Z(e.onBlur,()=>y(!1))})})}),vf="RovingFocusGroupItem",xf=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=BC(vf,n),u=d.currentTabStopId===c,p=mf(n),{onFocusableItemAdd:h,onFocusableItemRemove:v,currentTabStopId:g}=d;return m.useEffect(()=>{if(r)return h(),()=>v()},[r,h,v]),f.jsx(sa.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=HC(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?GC(w,S+1):w.slice(S+1)}setTimeout(()=>bf(w))}}),children:typeof a=="function"?a({isCurrentTabStop:u,hasTabStop:g!=null}):a})})});xf.displayName=vf;var UC={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function ZC(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function HC(e,t,n){const r=ZC(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return UC[r]}function bf(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function GC(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Yo=gf,Xo=xf,la=["Enter"," "],WC=["ArrowDown","PageUp","Home"],yf=["ArrowUp","PageDown","End"],qC=[...WC,...yf],KC={ltr:[...la,"ArrowRight"],rtl:[...la,"ArrowLeft"]},JC={ltr:["ArrowLeft"],rtl:["ArrowRight"]},zr="Menu",[kr,YC,XC]=Ar(zr),[_n,wf]=Fe(zr,[XC,en,tn]),Qo=en(),kf=tn(),[QC,En]=_n(zr),[e1,Lr]=_n(zr),Sf=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:a=!0}=e,s=Qo(t),[l,c]=m.useState(null),d=m.useRef(!1),u=Tt(i),p=Qt(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(QC,{scope:t,open:n,onOpenChange:u,content:l,onContentChange:c,children:f.jsx(e1,{scope:t,onClose:m.useCallback(()=>u(!1),[u]),isUsingKeyboardRef:d,dir:p,modal:a,children:r})})})};Sf.displayName=zr;var t1="MenuAnchor",ss=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Qo(n);return f.jsx(Dr,{...o,...r,ref:t})});ss.displayName=t1;var ls="MenuPortal",[n1,Cf]=_n(ls,{forceMount:void 0}),_f=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=En(ls,t);return f.jsx(n1,{scope:t,forceMount:n,children:f.jsx(et,{present:n||i.open,children:f.jsx(er,{asChild:!0,container:o,children:r})})})};_f.displayName=ls;var vt="MenuContent",[r1,cs]=_n(vt),Ef=m.forwardRef((e,t)=>{const n=Cf(vt,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=En(vt,e.__scopeMenu),a=Lr(vt,e.__scopeMenu);return f.jsx(kr.Provider,{scope:e.__scopeMenu,children:f.jsx(et,{present:r||i.open,children:f.jsx(kr.Slot,{scope:e.__scopeMenu,children:a.modal?f.jsx(o1,{...o,ref:t}):f.jsx(i1,{...o,ref:t})})})})}),o1=m.forwardRef((e,t)=>{const n=En(vt,e.__scopeMenu),r=m.useRef(null),o=ae(t,r);return m.useEffect(()=>{const i=r.current;if(i)return Ho(i)},[]),f.jsx(us,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Z(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),i1=m.forwardRef((e,t)=>{const n=En(vt,e.__scopeMenu);return f.jsx(us,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),a1=Jt("MenuContent.ScrollLock"),us=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=En(vt,n),x=Lr(vt,n),y=Qo(n),w=kf(n),S=YC(n),[P,C]=m.useState(null),T=m.useRef(null),A=ae(t,T,b.onContentChange),R=m.useRef(0),E=m.useRef(""),N=m.useRef(0),I=m.useRef(null),j=m.useRef("right"),$=m.useRef(0),O=v?jr:m.Fragment,B=v?{as:a1,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=x1(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),[]),Uo();const Y=m.useCallback(V=>j.current===I.current?.side&&y1(V,I.current?.area),[]);return f.jsx(r1,{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=>{I.current=V},[]),children:f.jsx(O,{...B,children:f.jsx(Rr,{asChild:!0,trapped:o,onMountAutoFocus:Z(i,V=>{V.preventDefault(),T.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:f.jsx(Qn,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:u,onInteractOutside:p,onDismiss:h,children:f.jsx(Yo,{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(Ko,{role:"menu","aria-orientation":"vertical","data-state":Vf(b.open),"data-radix-menu-content":"",dir:x.dir,...y,...g,ref:A,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||!qC.includes(V.key))return;V.preventDefault();const ce=S().filter(U=>!U.disabled).map(U=>U.ref.current);yf.includes(V.key)&&ce.reverse(),g1(ce)}),onBlur:Z(e.onBlur,V=>{V.currentTarget.contains(V.target)||(window.clearTimeout(R.current),E.current="")}),onPointerMove:Z(e.onPointerMove,Sr(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}}))})})})})})})});Ef.displayName=vt;var s1="MenuGroup",ds=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return f.jsx(J.div,{role:"group",...r,ref:t})});ds.displayName=s1;var l1="MenuLabel",Tf=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return f.jsx(J.div,{...r,ref:t})});Tf.displayName=l1;var Co="MenuItem",Wl="menu.itemSelect",ei=m.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=m.useRef(null),a=Lr(Co,e.__scopeMenu),s=cs(Co,e.__scopeMenu),l=ae(t,i),c=m.useRef(!1),d=()=>{const u=i.current;if(!n&&u){const p=new CustomEvent(Wl,{bubbles:!0,cancelable:!0});u.addEventListener(Wl,h=>r?.(h),{once:!0}),qu(u,p),p.defaultPrevented?c.current=!1:a.onClose()}};return f.jsx(Pf,{...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===" "||la.includes(u.key)&&(u.currentTarget.click(),u.preventDefault())})})});ei.displayName=Co;var Pf=m.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,a=cs(Co,n),s=kf(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(kr.ItemSlot,{scope:n,disabled:r,textValue:o??p,children:f.jsx(Xo,{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,Sr(v=>{r?a.onItemLeave(v):(a.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Z(e.onPointerLeave,Sr(v=>a.onItemLeave(v))),onFocus:Z(e.onFocus,()=>u(!0)),onBlur:Z(e.onBlur,()=>u(!1))})})})}),c1="MenuCheckboxItem",Nf=m.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return f.jsx(Of,{scope:e.__scopeMenu,checked:n,children:f.jsx(ei,{role:"menuitemcheckbox","aria-checked":_o(n)?"mixed":n,...o,ref:t,"data-state":ps(n),onSelect:Z(o.onSelect,()=>r?.(_o(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Nf.displayName=c1;var If="MenuRadioGroup",[u1,d1]=_n(If,{value:void 0,onValueChange:()=>{}}),Af=m.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,i=Tt(r);return f.jsx(u1,{scope:e.__scopeMenu,value:n,onValueChange:i,children:f.jsx(ds,{...o,ref:t})})});Af.displayName=If;var Rf="MenuRadioItem",jf=m.forwardRef((e,t)=>{const{value:n,...r}=e,o=d1(Rf,e.__scopeMenu),i=n===o.value;return f.jsx(Of,{scope:e.__scopeMenu,checked:i,children:f.jsx(ei,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":ps(i),onSelect:Z(r.onSelect,()=>o.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});jf.displayName=Rf;var fs="MenuItemIndicator",[Of,f1]=_n(fs,{checked:!1}),Mf=m.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=f1(fs,n);return f.jsx(et,{present:r||_o(i.checked)||i.checked===!0,children:f.jsx(J.span,{...o,ref:t,"data-state":ps(i.checked)})})});Mf.displayName=fs;var p1="MenuSeparator",Df=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return f.jsx(J.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});Df.displayName=p1;var h1="MenuArrow",$f=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Qo(n);return f.jsx(Jo,{...o,...r,ref:t})});$f.displayName=h1;var m1="MenuSub",[$$,zf]=_n(m1),pr="MenuSubTrigger",Lf=m.forwardRef((e,t)=>{const n=En(pr,e.__scopeMenu),r=Lr(pr,e.__scopeMenu),o=zf(pr,e.__scopeMenu),i=cs(pr,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(ss,{asChild:!0,...c,children:f.jsx(Pf,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":Vf(n.open),...e,ref:Lo(t,o.onTriggerChange),onClick:u=>{e.onClick?.(u),!(e.disabled||u.defaultPrevented)&&(u.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Z(e.onPointerMove,Sr(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,Sr(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===" "||KC[r.dir].includes(u.key)&&(n.onOpenChange(!0),n.content?.focus(),u.preventDefault())})})})});Lf.displayName=pr;var Ff="MenuSubContent",Bf=m.forwardRef((e,t)=>{const n=Cf(vt,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=En(vt,e.__scopeMenu),a=Lr(vt,e.__scopeMenu),s=zf(Ff,e.__scopeMenu),l=m.useRef(null),c=ae(t,l);return f.jsx(kr.Provider,{scope:e.__scopeMenu,children:f.jsx(et,{present:r||i.open,children:f.jsx(kr.Slot,{scope:e.__scopeMenu,children:f.jsx(us,{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=JC[a.dir].includes(d.key);u&&p&&(i.onOpenChange(!1),s.trigger?.focus(),d.preventDefault())})})})})})});Bf.displayName=Ff;function Vf(e){return e?"open":"closed"}function _o(e){return e==="indeterminate"}function ps(e){return _o(e)?"indeterminate":e?"checked":"unchecked"}function g1(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function v1(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function x1(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=v1(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 b1(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 y1(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return b1(n,t)}function Sr(e){return t=>t.pointerType==="mouse"?e(t):void 0}var w1=Sf,k1=ss,S1=_f,C1=Ef,_1=ds,E1=Tf,T1=ei,P1=Nf,N1=Af,I1=jf,A1=Mf,R1=Df,j1=$f,O1=Lf,M1=Bf,ti="DropdownMenu",[D1]=Fe(ti,[wf]),ot=wf(),[$1,Uf]=D1(ti),Zf=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:ti});return f.jsx($1,{scope:t,triggerId:at(),triggerRef:c,contentId:at(),open:d,onOpenChange:u,onOpenToggle:m.useCallback(()=>u(p=>!p),[u]),modal:s,children:f.jsx(w1,{...l,open:d,onOpenChange:u,dir:r,modal:s,children:n})})};Zf.displayName=ti;var Hf="DropdownMenuTrigger",Gf=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=Uf(Hf,n),a=ot(n);return f.jsx(k1,{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:Lo(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())})})})});Gf.displayName=Hf;var z1="DropdownMenuPortal",Wf=e=>{const{__scopeDropdownMenu:t,...n}=e,r=ot(t);return f.jsx(S1,{...r,...n})};Wf.displayName=z1;var qf="DropdownMenuContent",Kf=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Uf(qf,n),i=ot(n),a=m.useRef(!1);return f.jsx(C1,{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)"}})});Kf.displayName=qf;var L1="DropdownMenuGroup",F1=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return f.jsx(_1,{...o,...r,ref:t})});F1.displayName=L1;var B1="DropdownMenuLabel",V1=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return f.jsx(E1,{...o,...r,ref:t})});V1.displayName=B1;var U1="DropdownMenuItem",Jf=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return f.jsx(T1,{...o,...r,ref:t})});Jf.displayName=U1;var Z1="DropdownMenuCheckboxItem",H1=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return f.jsx(P1,{...o,...r,ref:t})});H1.displayName=Z1;var G1="DropdownMenuRadioGroup",W1=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return f.jsx(N1,{...o,...r,ref:t})});W1.displayName=G1;var q1="DropdownMenuRadioItem",K1=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return f.jsx(I1,{...o,...r,ref:t})});K1.displayName=q1;var J1="DropdownMenuItemIndicator",Y1=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return f.jsx(A1,{...o,...r,ref:t})});Y1.displayName=J1;var X1="DropdownMenuSeparator",Q1=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return f.jsx(R1,{...o,...r,ref:t})});Q1.displayName=X1;var e_="DropdownMenuArrow",t_=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return f.jsx(j1,{...o,...r,ref:t})});t_.displayName=e_;var n_="DropdownMenuSubTrigger",r_=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return f.jsx(O1,{...o,...r,ref:t})});r_.displayName=n_;var o_="DropdownMenuSubContent",i_=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return f.jsx(M1,{...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)"}})});i_.displayName=o_;var a_=Zf,s_=Gf,l_=Wf,c_=Kf,u_=Jf,d_="Label",Yf=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())}}));Yf.displayName=d_;var f_=Yf;function Eo(e,[t,n]){return Math.min(n,Math.max(t,e))}var ni="Popover",[Xf]=Fe(ni,[en]),Fr=en(),[p_,nn]=Xf(ni),Qf=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:a=!1}=e,s=Fr(t),l=m.useRef(null),[c,d]=m.useState(!1),[u,p]=Ze({prop:r,defaultProp:o??!1,onChange:i,caller:ni});return f.jsx(qo,{...s,children:f.jsx(p_,{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})})};Qf.displayName=ni;var ep="PopoverAnchor",h_=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=nn(ep,n),i=Fr(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:s}=o;return m.useEffect(()=>(a(),()=>s()),[a,s]),f.jsx(Dr,{...i,...r,ref:t})});h_.displayName=ep;var tp="PopoverTrigger",np=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=nn(tp,n),i=Fr(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":sp(o.open),...r,ref:a,onClick:Z(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?s:f.jsx(Dr,{asChild:!0,...i,children:s})});np.displayName=tp;var hs="PopoverPortal",[m_,g_]=Xf(hs,{forceMount:void 0}),rp=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,i=nn(hs,t);return f.jsx(m_,{scope:t,forceMount:n,children:f.jsx(et,{present:n||i.open,children:f.jsx(er,{asChild:!0,container:o,children:r})})})};rp.displayName=hs;var qn="PopoverContent",op=m.forwardRef((e,t)=>{const n=g_(qn,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,i=nn(qn,e.__scopePopover);return f.jsx(et,{present:r||i.open,children:i.modal?f.jsx(x_,{...o,ref:t}):f.jsx(b_,{...o,ref:t})})});op.displayName=qn;var v_=Jt("PopoverContent.RemoveScroll"),x_=m.forwardRef((e,t)=>{const n=nn(qn,e.__scopePopover),r=m.useRef(null),o=ae(t,r),i=m.useRef(!1);return m.useEffect(()=>{const a=r.current;if(a)return Ho(a)},[]),f.jsx(jr,{as:v_,allowPinchZoom:!0,children:f.jsx(ip,{...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})})})}),b_=m.forwardRef((e,t)=>{const n=nn(qn,e.__scopePopover),r=m.useRef(!1),o=m.useRef(!1);return f.jsx(ip,{...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()}})}),ip=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=nn(qn,n),h=Fr(n);return Uo(),f.jsx(Rr,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:f.jsx(Qn,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:d,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>p.onOpenChange(!1),children:f.jsx(Ko,{"data-state":sp(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)"}})})})}),ap="PopoverClose",y_=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=nn(ap,n);return f.jsx(J.button,{type:"button",...r,ref:t,onClick:Z(e.onClick,()=>o.onOpenChange(!1))})});y_.displayName=ap;var w_="PopoverArrow",k_=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Fr(n);return f.jsx(Jo,{...o,...r,ref:t})});k_.displayName=w_;function sp(e){return e?"open":"closed"}var S_=Qf,C_=np,__=rp,E_=op,ms="Progress",gs=100,[T_]=Fe(ms),[P_,N_]=T_(ms),lp=m.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:o,getValueLabel:i=I_,...a}=e;(o||o===0)&&!ql(o)&&console.error(A_(`${o}`,"Progress"));const s=ql(o)?o:gs;r!==null&&!Kl(r,s)&&console.error(R_(`${r}`,"Progress"));const l=Kl(r,s)?r:null,c=To(l)?i(l,s):void 0;return f.jsx(P_,{scope:n,value:l,max:s,children:f.jsx(J.div,{"aria-valuemax":s,"aria-valuemin":0,"aria-valuenow":To(l)?l:void 0,"aria-valuetext":c,role:"progressbar","data-state":dp(l,s),"data-value":l??void 0,"data-max":s,...a,ref:t})})});lp.displayName=ms;var cp="ProgressIndicator",up=m.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,o=N_(cp,n);return f.jsx(J.div,{"data-state":dp(o.value,o.max),"data-value":o.value??void 0,"data-max":o.max,...r,ref:t})});up.displayName=cp;function I_(e,t){return`${Math.round(e/t*100)}%`}function dp(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function To(e){return typeof e=="number"}function ql(e){return To(e)&&!isNaN(e)&&e>0}function Kl(e,t){return To(e)&&!isNaN(e)&&e<=t&&e>=0}function A_(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${gs}\`.`}function R_(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
88
+ - a positive number
89
+ - less than the value passed to \`max\` (or ${gs} if no \`max\` prop is set)
90
+ - \`null\` or \`undefined\` if the progress is indeterminate.
91
+
92
+ Defaulting to \`null\`.`}var j_=lp,O_=up,vs="Radio",[M_,fp]=Fe(vs),[D_,$_]=M_(vs),pp=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(D_,{scope:n,checked:o,disabled:a,children:[f.jsx(J.button,{type:"button",role:"radio","aria-checked":o,"data-state":vp(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(gp,{control:u,bubbles:!v.current,name:r,value:s,checked:o,required:i,disabled:a,form:c,style:{transform:"translateX(-100%)"}})]})});pp.displayName=vs;var hp="RadioIndicator",mp=m.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...o}=e,i=$_(hp,n);return f.jsx(et,{present:r||i.checked,children:f.jsx(J.span,{"data-state":vp(i.checked),"data-disabled":i.disabled?"":void 0,...o,ref:t})})});mp.displayName=hp;var z_="RadioBubbleInput",gp=m.forwardRef(({__scopeRadio:e,control:t,checked:n,bubbles:r=!0,...o},i)=>{const a=m.useRef(null),s=ae(a,i),l=Or(n),c=Mr(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}})});gp.displayName=z_;function vp(e){return e?"checked":"unchecked"}var L_=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],ri="RadioGroup",[F_]=Fe(ri,[tn,fp]),xp=tn(),bp=fp(),[B_,V_]=F_(ri),yp=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=xp(n),v=Qt(c),[g,b]=Ze({prop:i,defaultProp:o??null,onChange:u,caller:ri});return f.jsx(B_,{scope:n,name:r,required:a,disabled:s,value:g,onValueChange:b,children:f.jsx(Yo,{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})})})});yp.displayName=ri;var wp="RadioGroupItem",kp=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...o}=e,i=V_(wp,n),a=i.disabled||r,s=xp(n),l=bp(n),c=m.useRef(null),d=ae(t,c),u=i.value===o.value,p=m.useRef(!1);return m.useEffect(()=>{const h=g=>{L_.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(Xo,{asChild:!0,...s,focusable:!a,active:u,children:f.jsx(pp,{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()})})})});kp.displayName=wp;var U_="RadioGroupIndicator",Sp=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,o=bp(n);return f.jsx(mp,{...o,...r,ref:t})});Sp.displayName=U_;var Z_=yp,H_=kp,G_=Sp,W_=[" ","Enter","ArrowUp","ArrowDown"],q_=[" ","Enter"],xn="Select",[oi,ii,K_]=Ar(xn),[tr]=Fe(xn,[K_,en]),ai=en(),[J_,rn]=tr(xn),[Y_,X_]=tr(xn),Cp=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=ai(t),[b,x]=m.useState(null),[y,w]=m.useState(null),[S,P]=m.useState(!1),C=Qt(c),[T,A]=Ze({prop:r,defaultProp:o??!1,onChange:i,caller:xn}),[R,E]=Ze({prop:a,defaultProp:s,onChange:l,caller:xn}),N=m.useRef(null),I=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(J_,{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:A,dir:C,triggerPointerDownPosRef:N,disabled:p,children:[f.jsx(oi.Provider,{scope:t,children:f.jsx(Y_,{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})}),I?f.jsxs(Gp,{"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]})})};Cp.displayName=xn;var _p="SelectTrigger",Ep=m.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=ai(n),a=rn(_p,n),s=a.disabled||r,l=ae(t,a.onTriggerChange),c=ii(n),d=m.useRef("touch"),[u,p,h]=qp(g=>{const b=c().filter(w=>!w.disabled),x=b.find(w=>w.value===a.value),y=Kp(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(Dr,{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":Wp(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===" ")&&W_.includes(g.key)&&(v(),g.preventDefault())})})})});Ep.displayName=_p;var Tp="SelectValue",Pp=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:a="",...s}=e,l=rn(Tp,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:Wp(l.value)?f.jsx(f.Fragment,{children:a}):i})});Pp.displayName=Tp;var Q_="SelectIcon",Np=m.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return f.jsx(J.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});Np.displayName=Q_;var eE="SelectPortal",Ip=e=>f.jsx(er,{asChild:!0,...e});Ip.displayName=eE;var bn="SelectContent",Ap=m.forwardRef((e,t)=>{const n=rn(bn,e.__scopeSelect),[r,o]=m.useState();if(Le(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?Ma.createPortal(f.jsx(Rp,{scope:e.__scopeSelect,children:f.jsx(oi.Slot,{scope:e.__scopeSelect,children:f.jsx("div",{children:e.children})})}),i):null}return f.jsx(jp,{...e,ref:t})});Ap.displayName=bn;var kt=10,[Rp,on]=tr(bn),tE="SelectContentImpl",nE=Jt("SelectContent.RemoveScroll"),jp=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=rn(bn,n),[w,S]=m.useState(null),[P,C]=m.useState(null),T=ae(t,U=>S(U)),[A,R]=m.useState(null),[E,N]=m.useState(null),I=ii(n),[j,$]=m.useState(!1),O=m.useRef(!1);m.useEffect(()=>{if(w)return Ho(w)},[w]),Uo();const B=m.useCallback(U=>{const[te,...me]=I().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},[I,P]),W=m.useCallback(()=>B([A,w]),[B,A,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]=qp(U=>{const te=I().filter(Q=>!Q.disabled),me=te.find(Q=>Q.ref.current===document.activeElement),ie=Kp(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"?ca:Op,ce=ke===ca?{side:s,sideOffset:l,align:c,alignOffset:d,arrowPadding:u,collisionBoundary:p,collisionPadding:h,sticky:v,hideWhenDetached:g,avoidCollisions:b}:{};return f.jsx(Rp,{scope:n,content:w,viewport:P,onViewportChange:C,itemRefCallback:be,selectedItem:A,onItemLeave:_,itemTextRefCallback:fe,focusSelectedItem:W,selectedItemText:E,position:r,isPositioned:j,searchRef:k,children:f.jsx(jr,{as:nE,allowPinchZoom:!0,children:f.jsx(Rr,{asChild:!0,trapped:y.open,onMountAutoFocus:U=>{U.preventDefault()},onUnmountAutoFocus:Z(o,U=>{y.trigger?.focus({preventScroll:!0}),U.preventDefault()}),children:f.jsx(Qn,{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=I().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()}})})})})})})});jp.displayName=tE;var rE="SelectItemAlignedPosition",Op=m.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=rn(bn,n),a=on(bn,n),[s,l]=m.useState(null),[c,d]=m.useState(null),u=ae(t,T=>d(T)),p=ii(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(),A=c.getBoundingClientRect(),R=i.valueNode.getBoundingClientRect(),E=x.getBoundingClientRect();if(i.dir!=="rtl"){const Q=E.left-A.left,G=R.left-Q,se=T.left-G,K=T.width+se,Te=Math.max(K,A.width),Me=window.innerWidth-kt,De=Eo(G,[kt,Math.max(kt,Me-Te)]);s.style.minWidth=K+"px",s.style.left=De+"px"}else{const Q=A.right-E.right,G=window.innerWidth-R.right-Q,se=window.innerWidth-T.right-G,K=T.width+se,Te=Math.max(K,A.width),Me=window.innerWidth-kt,De=Eo(G,[kt,Math.max(kt,Me-Te)]);s.style.minWidth=K+"px",s.style.right=De+"px"}const N=p(),I=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=I-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=I+"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(iE,{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}})})})});Op.displayName=rE;var oE="SelectPopperPosition",ca=m.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=kt,...i}=e,a=ai(n);return f.jsx(Ko,{...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)"}})});ca.displayName=oE;var[iE,xs]=tr(bn,{}),ua="SelectViewport",Mp=m.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,i=on(ua,n),a=xs(ua,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(oi.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})})})]})});Mp.displayName=ua;var Dp="SelectGroup",[aE,sE]=tr(Dp),lE=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=at();return f.jsx(aE,{scope:n,id:o,children:f.jsx(J.div,{role:"group","aria-labelledby":o,...r,ref:t})})});lE.displayName=Dp;var $p="SelectLabel",cE=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=sE($p,n);return f.jsx(J.div,{id:o.id,...r,ref:t})});cE.displayName=$p;var Po="SelectItem",[uE,zp]=tr(Po),Lp=m.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...a}=e,s=rn(Po,n),l=on(Po,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(uE,{scope:n,value:r,disabled:o,textId:g,isSelected:c,onItemTextChange:m.useCallback(y=>{u(w=>w||(y?.textContent??"").trim())},[]),children:f.jsx(oi.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===" "||(q_.includes(y.key)&&x(),y.key===" "&&y.preventDefault())})})})})});Lp.displayName=Po;var hr="SelectItemText",Fp=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,a=rn(hr,n),s=on(hr,n),l=zp(hr,n),c=X_(hr,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?Ma.createPortal(i.children,a.valueNode):null]})});Fp.displayName=hr;var Bp="SelectItemIndicator",Vp=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return zp(Bp,n).isSelected?f.jsx(J.span,{"aria-hidden":!0,...r,ref:t}):null});Vp.displayName=Bp;var da="SelectScrollUpButton",Up=m.forwardRef((e,t)=>{const n=on(da,e.__scopeSelect),r=xs(da,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(Hp,{...e,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop-l.offsetHeight)}}):null});Up.displayName=da;var fa="SelectScrollDownButton",Zp=m.forwardRef((e,t)=>{const n=on(fa,e.__scopeSelect),r=xs(fa,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(Hp,{...e,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop+l.offsetHeight)}}):null});Zp.displayName=fa;var Hp=m.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=on("SelectScrollButton",n),a=m.useRef(null),s=ii(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()})})}),dE="SelectSeparator",fE=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return f.jsx(J.div,{"aria-hidden":!0,...r,ref:t})});fE.displayName=dE;var pa="SelectArrow",pE=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=ai(n),i=rn(pa,n),a=on(pa,n);return i.open&&a.position==="popper"?f.jsx(Jo,{...o,...r,ref:t}):null});pE.displayName=pa;var hE="SelectBubbleInput",Gp=m.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=m.useRef(null),i=ae(r,o),a=Or(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:{...Ku,...n.style},ref:i,defaultValue:t})});Gp.displayName=hE;function Wp(e){return e===""||e===void 0}function qp(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 Kp(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=mE(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 mE(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var gE=Cp,vE=Ep,xE=Pp,bE=Np,yE=Ip,wE=Ap,kE=Mp,SE=Lp,CE=Fp,_E=Vp,EE=Up,TE=Zp,PE="Separator",Jl="horizontal",NE=["horizontal","vertical"],Jp=m.forwardRef((e,t)=>{const{decorative:n,orientation:r=Jl,...o}=e,i=IE(r)?r:Jl,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})});Jp.displayName=PE;function IE(e){return NE.includes(e)}var AE=Jp,Yp=["PageUp","PageDown"],Xp=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Qp={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},nr="Slider",[ha,RE,jE]=Ar(nr),[eh]=Fe(nr,[jE]),[OE,si]=eh(nr),th=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"?ME:DE,[S=[],P]=Ze({prop:d,defaultProp:c,onChange:N=>{[...b.current][x.current]?.focus(),u(N)}}),C=m.useRef(S);function T(N){const I=BE(S,N);E(N,I)}function A(N){E(N,x.current)}function R(){const N=C.current[x.current];S[x.current]!==N&&p(S)}function E(N,I,{commit:j}={commit:!1}){const $=HE(i),O=GE(Math.round((N-r)/i)*i+r,$),B=Eo(O,[r,o]);P((W=[])=>{const Y=LE(W,B,I);if(ZE(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(OE,{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(ha.Provider,{scope:e.__scopeSlider,children:f.jsx(ha.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:A,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:I})=>{if(!s){const O=Yp.includes(N.key)||N.shiftKey&&Xp.includes(N.key)?10:1,B=x.current,W=S[B],Y=i*O*I;E(W+Y,B,{commit:!0})}}})})})})});th.displayName=nr;var[nh,rh]=eh(nr,{startEdge:"left",endEdge:"right",size:"width",direction:1}),ME=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=Qt(o),b=g==="ltr",x=b&&!i||!b&&i;function y(w){const S=v.current||u.getBoundingClientRect(),P=[0,S.width],T=bs(P,x?[n,r]:[r,n]);return v.current=S,T(w-S.left)}return f.jsx(nh,{scope:e.__scopeSlider,startEdge:x?"left":"right",endEdge:x?"right":"left",direction:x?1:-1,size:"width",children:f.jsx(oh,{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=Qp[x?"from-left":"from-right"].includes(w.key);c?.({event:w,direction:P?-1:1})}})})}),DE=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=bs(x,h?[r,n]:[n,r]);return p.current=b,w(g-b.top)}return f.jsx(nh,{scope:e.__scopeSlider,startEdge:h?"bottom":"top",endEdge:h?"top":"bottom",size:"height",direction:h?1:-1,children:f.jsx(oh,{"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=Qp[h?"from-bottom":"from-top"].includes(g.key);l?.({event:g,direction:x?-1:1})}})})}),oh=m.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:o,onSlideEnd:i,onHomeKeyDown:a,onEndKeyDown:s,onStepKeyDown:l,...c}=e,d=si(nr,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()):Yp.concat(Xp).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))})})}),ih="SliderTrack",ah=m.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,o=si(ih,n);return f.jsx(J.span,{"data-disabled":o.disabled?"":void 0,"data-orientation":o.orientation,...r,ref:t})});ah.displayName=ih;var ma="SliderRange",sh=m.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,o=si(ma,n),i=rh(ma,n),a=m.useRef(null),s=ae(t,a),l=o.values.length,c=o.values.map(p=>uh(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+"%"}})});sh.displayName=ma;var ga="SliderThumb",lh=m.forwardRef((e,t)=>{const n=RE(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($E,{...e,ref:i,index:a})}),$E=m.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:o,...i}=e,a=si(ga,n),s=rh(ga,n),[l,c]=m.useState(null),d=ae(t,y=>c(y)),u=l?a.form||!!l.closest("form"):!0,p=Mr(l),h=a.values[r],v=h===void 0?0:uh(h,a.min,a.max),g=FE(r,a.values.length),b=p?.[s.size],x=b?VE(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(ha.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(ch,{name:o??(a.name?a.name+(a.values.length>1?"[]":""):void 0),form:a.form,value:h},r)]})});lh.displayName=ga;var zE="RadioBubbleInput",ch=m.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const o=m.useRef(null),i=ae(o,r),a=Or(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})});ch.displayName=zE;function LE(e=[],t,n){const r=[...e];return r[n]=t,r.sort((o,i)=>o-i)}function uh(e,t,n){const i=100/(n-t)*(e-t);return Eo(i,[0,100])}function FE(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function BE(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 VE(e,t,n){const r=e/2,i=bs([0,50],[0,r]);return(r-i(t)*n)*n}function UE(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function ZE(e,t){if(t>0){const n=UE(e);return Math.min(...n)>=t}return!0}function bs(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 HE(e){return(String(e).split(".")[1]||"").length}function GE(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var WE=th,qE=ah,KE=sh,JE=lh,li="Switch",[YE]=Fe(li),[XE,QE]=YE(li),dh=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:li});return f.jsxs(XE,{scope:n,checked:x,disabled:s,children:[f.jsx(J.button,{type:"button",role:"switch","aria-checked":x,"aria-required":a,"data-state":mh(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(hh,{control:p,bubbles:!g.current,name:r,value:l,checked:x,required:a,disabled:s,form:d,style:{transform:"translateX(-100%)"}})]})});dh.displayName=li;var fh="SwitchThumb",ph=m.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=QE(fh,n);return f.jsx(J.span,{"data-state":mh(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:t})});ph.displayName=fh;var eT="SwitchBubbleInput",hh=m.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...o},i)=>{const a=m.useRef(null),s=ae(a,i),l=Or(n),c=Mr(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}})});hh.displayName=eT;function mh(e){return e?"checked":"unchecked"}var tT=dh,nT=ph,ci="Tabs",[rT]=Fe(ci,[tn]),gh=tn(),[oT,ys]=rT(ci),vh=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:a="horizontal",dir:s,activationMode:l="automatic",...c}=e,d=Qt(s),[u,p]=Ze({prop:r,onChange:o,defaultProp:i??"",caller:ci});return f.jsx(oT,{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})})});vh.displayName=ci;var xh="TabsList",bh=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=ys(xh,n),a=gh(n);return f.jsx(Yo,{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})})});bh.displayName=xh;var yh="TabsTrigger",wh=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,a=ys(yh,n),s=gh(n),l=Sh(a.baseId,r),c=Ch(a.baseId,r),d=r===a.value;return f.jsx(Xo,{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)})})})});wh.displayName=yh;var kh="TabsContent",iT=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...a}=e,s=ys(kh,n),l=Sh(s.baseId,r),c=Ch(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})})});iT.displayName=kh;function Sh(e,t){return`${e}-trigger-${t}`}function Ch(e,t){return`${e}-content-${t}`}var aT=vh,sT=bh,lT=wh,_h="Toggle",ws=m.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r,onPressedChange:o,...i}=e,[a,s]=Ze({prop:n,onChange:o,defaultProp:r??!1,caller:_h});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)})})});ws.displayName=_h;var cT=ws,an="ToggleGroup",[Eh]=Fe(an,[tn]),Th=tn(),ks=L.forwardRef((e,t)=>{const{type:n,...r}=e;if(n==="single"){const o=r;return f.jsx(uT,{...o,ref:t})}if(n==="multiple"){const o=r;return f.jsx(dT,{...o,ref:t})}throw new Error(`Missing prop \`type\` expected on \`${an}\``)});ks.displayName=an;var[Ph,Nh]=Eh(an),uT=L.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...i}=e,[a,s]=Ze({prop:n,defaultProp:r??"",onChange:o,caller:an});return f.jsx(Ph,{scope:e.__scopeToggleGroup,type:"single",value:L.useMemo(()=>a?[a]:[],[a]),onItemActivate:s,onItemDeactivate:L.useCallback(()=>s(""),[s]),children:f.jsx(Ih,{...i,ref:t})})}),dT=L.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...i}=e,[a,s]=Ze({prop:n,defaultProp:r??[],onChange:o,caller:an}),l=L.useCallback(d=>s((u=[])=>[...u,d]),[s]),c=L.useCallback(d=>s((u=[])=>u.filter(p=>p!==d)),[s]);return f.jsx(Ph,{scope:e.__scopeToggleGroup,type:"multiple",value:a,onItemActivate:l,onItemDeactivate:c,children:f.jsx(Ih,{...i,ref:t})})});ks.displayName=an;var[fT,pT]=Eh(an),Ih=L.forwardRef((e,t)=>{const{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:o=!0,orientation:i,dir:a,loop:s=!0,...l}=e,c=Th(n),d=Qt(a),u={role:"group",dir:d,...l};return f.jsx(fT,{scope:n,rovingFocus:o,disabled:r,children:o?f.jsx(Yo,{asChild:!0,...c,orientation:i,dir:d,loop:s,children:f.jsx(J.div,{...u,ref:t})}):f.jsx(J.div,{...u,ref:t})})}),No="ToggleGroupItem",Ah=L.forwardRef((e,t)=>{const n=Nh(No,e.__scopeToggleGroup),r=pT(No,e.__scopeToggleGroup),o=Th(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(Xo,{asChild:!0,...o,focusable:!a,active:i,ref:l,children:f.jsx(Yl,{...s,ref:t})}):f.jsx(Yl,{...s,ref:t})});Ah.displayName=No;var Yl=L.forwardRef((e,t)=>{const{__scopeToggleGroup:n,value:r,...o}=e,i=Nh(No,n),a={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},s=i.type==="single"?a:void 0;return f.jsx(ws,{...s,...o,ref:t,onPressedChange:l=>{l?i.onItemActivate(r):i.onItemDeactivate(r)}})}),hT=ks,mT=Ah,[ui]=Fe("Tooltip",[en]),di=en(),Rh="TooltipProvider",gT=700,va="tooltip.open",[vT,Ss]=ui(Rh),jh=e=>{const{__scopeTooltip:t,delayDuration:n=gT,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(vT,{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})};jh.displayName=Rh;var Cr="Tooltip",[xT,Br]=ui(Cr),Oh=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:i,disableHoverableContent:a,delayDuration:s}=e,l=Ss(Cr,e.__scopeTooltip),c=di(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(va))):l.onClose(),i?.(T)},caller:Cr}),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(xT,{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})})};Oh.displayName=Cr;var xa="TooltipTrigger",Mh=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Br(xa,n),i=Ss(xa,n),a=di(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(Dr,{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)})})});Mh.displayName=xa;var Cs="TooltipPortal",[bT,yT]=ui(Cs,{forceMount:void 0}),Dh=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,i=Br(Cs,t);return f.jsx(bT,{scope:t,forceMount:n,children:f.jsx(et,{present:n||i.open,children:f.jsx(er,{asChild:!0,container:o,children:r})})})};Dh.displayName=Cs;var Kn="TooltipContent",$h=m.forwardRef((e,t)=>{const n=yT(Kn,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,a=Br(Kn,e.__scopeTooltip);return f.jsx(et,{present:r||a.open,children:a.disableHoverableContent?f.jsx(zh,{side:o,...i,ref:t}):f.jsx(wT,{side:o,...i,ref:t})})}),wT=m.forwardRef((e,t)=>{const n=Br(Kn,e.__scopeTooltip),r=Ss(Kn,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=_T(x,b.getBoundingClientRect()),w=ET(x,y),S=TT(g.getBoundingClientRect()),P=NT([...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=!PT(x,a);y?p():w&&(p(),c())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[l,d,a,c,p]),f.jsx(zh,{...e,ref:i})}),[kT,ST]=ui(Cr,{isInside:!1}),CT=kk("TooltipContent"),zh=m.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:a,...s}=e,l=Br(Kn,n),c=di(n),{onClose:d}=l;return m.useEffect(()=>(document.addEventListener(va,d),()=>document.removeEventListener(va,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(Qn,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:u=>u.preventDefault(),onDismiss:d,children:f.jsxs(Ko,{"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(CT,{children:r}),f.jsx(kT,{scope:n,isInside:!0,children:f.jsx(Pk,{id:l.contentId,role:"tooltip",children:o||r})})]})})});$h.displayName=Kn;var Lh="TooltipArrow",Fh=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=di(n);return ST(Lh,n).isInside?null:f.jsx(Jo,{...o,...r,ref:t})});Fh.displayName=Lh;function _T(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 ET(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 TT(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 PT(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 NT(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),IT(t)}function IT(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 AT=jh,RT=Oh,jT=Mh,OT=Dh,MT=$h,DT=Fh;const Bh=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();const $T=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const zT=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());const Xl=e=>{const t=zT(e);return t.charAt(0).toUpperCase()+t.slice(1)};var LT={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 FT=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const BT=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,...LT,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Bh("lucide",o),...!i&&!FT(s)&&{"aria-hidden":"true"},...s},[...a.map(([c,d])=>m.createElement(c,d)),...Array.isArray(i)?i:[i]]));const $t=(e,t)=>{const n=m.forwardRef(({className:r,...o},i)=>m.createElement(BT,{ref:i,iconNode:t,className:Bh(`lucide-${$T(Xl(e))}`,`lucide-${e}`,r),...o}));return n.displayName=Xl(e),n};const VT=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],UT=$t("arrow-left",VT);const ZT=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],HT=$t("arrow-right",ZT);const GT=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Vh=$t("check",GT);const WT=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],_s=$t("chevron-down",WT);const qT=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],KT=$t("chevron-left",qT);const JT=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],YT=$t("chevron-right",JT);const XT=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],QT=$t("chevron-up",XT);const eP=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],tP=$t("circle",eP);const nP=[["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"}]],rP=$t("ellipsis",nP);const oP=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],iP=$t("x",oP);function aP(e){return Object.prototype.toString.call(e)==="[object Object]"}function Ql(e){return aP(e)||Array.isArray(e)}function sP(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function Es(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}`:!Ql(s)||!Ql(l)?s===l:Es(s,l)})}function ec(e){return e.concat().sort((t,n)=>t.name>n.name?1:-1).map(t=>t.options)}function lP(e,t){if(e.length!==t.length)return!1;const n=ec(e),r=ec(t);return n.every((o,i)=>{const a=r[i];return Es(o,a)})}function Ts(e){return typeof e=="number"}function ba(e){return typeof e=="string"}function fi(e){return typeof e=="boolean"}function tc(e){return Object.prototype.toString.call(e)==="[object Object]"}function Re(e){return Math.abs(e)}function Ps(e){return Math.sign(e)}function gr(e,t){return Re(e-t)}function cP(e,t){if(e===0||t===0||Re(e)<=Re(t))return 0;const n=gr(Re(e),Re(t));return Re(n/e)}function uP(e){return Math.round(e*100)/100}function _r(e){return Er(e).map(Number)}function Ct(e){return e[Vr(e)]}function Vr(e){return Math.max(0,e.length-1)}function Ns(e,t){return t===Vr(e)}function nc(e,t=0){return Array.from(Array(e),(n,r)=>t+r)}function Er(e){return Object.keys(e)}function Uh(e,t){return[e,t].reduce((n,r)=>(Er(r).forEach(o=>{const i=n[o],a=r[o],s=tc(i)&&tc(a);n[o]=s?Uh(i,a):a}),n),{})}function ya(e,t){return typeof t.MouseEvent<"u"&&e instanceof t.MouseEvent}function dP(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 ba(e)?n[e](l):e(t,l,c)}return{measure:a}}function Tr(){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 fP(e,t,n,r){const o=Tr(),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 pP(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 yn(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 Zh(e,t,n){const{constrain:r}=yn(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 Zh(e,s(),n)}const u={get:s,set:l,add:c,clone:d};return u}function hP(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=Tr(),A=Tr(),R=yn(50,225).constrain(h.measure(20)),E={mouse:300,touch:400},N={mouse:500,touch:600},I=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){(fi(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(),A.clear()}function be(){const G=V?n:t;A.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(Ps(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=ya(G,r);V=se,Y=v&&se&&!G.buttons&&j,j=gr(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(!ya(G,r)&&G.touches.length>=2)return te(G);const K=i.readPoint(G),Te=i.readPoint(G,w),Me=gr(K,$),De=gr(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=cP(Te,Me),bt=I-10*De,ct=x+De/50;W=!1,B=!1,A.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 mP(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(ya(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 gP(){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 vP(e){function t(r){return e*(r/100)}return{measure:t}}function xP(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=>{(fi(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 bP(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 A=0;return T?(a=0,n.set(r),e.set(r),A=C):(n.set(e),a+=C/l,a*=c,d+=a,e.add(a),A=d-u),s=Ps(A),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 yP(e,t,n,r,o){const i=o.measure(10),a=o.measure(50),s=yn(.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 wP(e,t,n,r,o){const i=yn(-t+e,0),a=u(),s=d(),l=p();function c(v,g){return gr(v,g)<=1}function d(){const v=a[0],g=Ct(a),b=a.lastIndexOf(v),x=a.indexOf(g)+1;return yn(b,x)}function u(){return n.map((v,g)=>{const{min:b,max:x}=i,y=i.constrain(v),w=!g,S=Ns(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 kP(e,t,n){const r=t[0],o=n?r-e:Ct(t);return{limit:yn(o,r)}}function SP(e,t,n,r){const i=t.min+.1,a=t.max+.1,{reachedMin:s,reachedMax:l}=yn(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 CP(e){const{max:t,length:n}=e;function r(i){const a=i-t;return n?a/-n:0}return{get:r}}function _P(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=>Ct(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 EP(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=Ns(b,g);if(x){const w=Ct(b[0])+1;return nc(w)}if(y){const w=Vr(i)-Ct(b)[0]+1;return nc(w,Ct(b)[0])}return v})}return{slideRegistry:c}}function TP(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=>Ps(y)===g);return x.length?l(x):Ct(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 PP(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 NP(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));Ts(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=>{(fi(s)||s(h,x))&&v(b)},l)})}function u(h){h.code==="Tab"&&(c=new Date().getTime())}return{init:d}}function mr(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 Ts(l)?l:l.get()}return{get:n,set:r,add:o,subtract:i}}function Hh(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=uP(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 IP(e,t,n,r,o,i,a,s,l){const d=_r(o),u=_r(o).reverse(),p=x().concat(y());function h(T,A){return T.reduce((R,E)=>R-o[E],A)}function v(T,A){return T.reduce((R,E)=>h(R,A)>0?R.concat([E]):R,[])}function g(T){return i.map((A,R)=>({start:A-r[R]+.5+T,end:A+t-.5+T}))}function b(T,A,R){const E=g(A);return T.map(N=>{const I=R?0:-n,j=R?n:0,$=R?"end":"start",O=E[N][$];return{index:N,loopPoint:O,slideLocation:mr(-1),translate:Hh(e,l[N]),target:()=>s.get()>O?I:j}})}function x(){const T=a[0],A=v(u,T);return b(A,n,!1)}function y(){const T=t-a[0]-1,A=v(d,T);return b(A,-n,!0)}function w(){return p.every(({index:T})=>{const A=d.filter(R=>R!==T);return h(A,t)<=.1})}function S(){p.forEach(T=>{const{target:A,translate:R,slideLocation:E}=T,N=A();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 AP(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||(fi(n)||n(l,d))&&c(d)}),r.observe(e,{childList:!0})}function a(){r&&r.disconnect(),o=!0}return{init:i,destroy:a}}function RP(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 Er(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 jP(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(Ct(r));return parseFloat(y.getPropertyValue(`margin-${l}`))}function b(){return n.map((y,w,S)=>{const P=!w,C=Ns(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 OP(e,t,n,r,o,i,a,s,l){const{startEdge:c,endEdge:d,direction:u}=e,p=Ts(n);function h(x,y){return _r(x).filter(w=>w%y===0).map(w=>x.slice(w,w+y))}function v(x){return x.length?_r(x).reduce((y,w,S)=>{const P=Ct(y)||0,C=P===0,T=w===Vr(x),A=o[c]-i[P][c],R=o[c]-i[w][d],E=!r&&C?u(a):0,N=!r&&T?u(s):0,I=Re(R-N-(A+E));return S&&I>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 MP(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,A=gP(),R=A.measure(t),E=n.map(A.measure),N=pP(l,c),I=N.measureSize(R),j=vP(I),$=dP(s,I),O=!u&&!!y,B=u||!!y,{slideSizes:W,slideSizesWithGaps:Y,startGap:V,endGap:k}=jP(N,R,E,n,B,o),le=OP(N,I,b,u,R,E,V,k,T),{snaps:be,snapsAligned:_}=_P(N,$,R,E,le),fe=-Ct(be)+Ct(Y),{snapsContained:ke,scrollContainLimit:ce}=wP(I,fe,_,y,T),U=O?ke:_,{limit:te}=kP(fe,U,u),me=Zh(Vr(U),d,u),ie=me.clone(),Q=_r(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:Lt,scrollLooper:Ft,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+Lt.get()*(1-ge);qe.set(dt),we&&(Ft.loop(pe.direction()),Ke.loop()),Ge.to(qe.get()),wt&&oe.emit("settle"),Ve||oe.emit("scroll")},K=fP(r,o,()=>G(ue),pe=>se(ue,pe)),Te=.68,Me=U[me.get()],De=mr(Me),bt=mr(Me),ct=mr(Me),He=mr(Me),It=bP(De,ct,bt,He,p,Te),ln=TP(u,U,fe,te,He),yt=PP(K,me,ie,It,ln,He,a),Pn=CP(te),cn=Tr(),D=RP(t,n,a,g),{slideRegistry:H}=EP(O,y,U,ce,le,Q),re=NP(e,n,H,yt,It,cn,a,C),ue={ownerDocument:r,ownerWindow:o,eventHandler:a,containerRect:R,slideRects:E,animation:K,axis:N,dragHandler:hP(N,e,r,o,He,mP(N,o),De,K,yt,It,ln,me,a,j,h,v,x,Te,P),eventStore:cn,percentOfView:j,index:me,indexPrevious:ie,limit:te,location:De,offsetLocation:ct,previousLocation:bt,options:i,resizeHandler:xP(t,a,o,n,N,w,A),scrollBody:It,scrollBounds:yP(te,ct,He,It,j),scrollLooper:SP(fe,te,ct,[De,ct,bt,He]),scrollProgress:Pn,scrollSnapList:U.map(Pn.get),scrollSnaps:U,scrollTarget:ln,scrollTo:yt,slideLooper:IP(N,I,fe,W,Y,be,U,ct,n),slideFocus:re,slidesHandler:AP(t,a,S),slidesInView:D,slideIndexes:Q,slideRegistry:H,slidesToScroll:le,target:He,translate:Hh(N,t)};return ue}function DP(){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 $P={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 zP(e){function t(i,a){return Uh(i,a||{})}function n(i){const a=i.breakpoints||{},s=Er(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=>Er(a.breakpoints||{})).reduce((a,s)=>a.concat(s),[]).map(e.matchMedia)}return{mergeOptions:t,optionsAtMedia:n,optionsMediaQueries:r}}function LP(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 Io(e,t,n){const r=e.ownerDocument,o=r.defaultView,i=zP(o),a=LP(i),s=Tr(),l=DP(),{mergeOptions:c,optionsAtMedia:d,optionsMediaQueries:u}=i,{on:p,off:h,emit:v}=l,g=N;let b=!1,x,y=c($P,Io.globalOptions),w=c(y),S=[],P,C,T;function A(){const{container:Q,slides:G}=w;C=(ba(Q)?e.querySelector(Q):Q)||e.children[0];const K=ba(G)?C.querySelectorAll(G):G;T=[].slice.call(K||C.children)}function R(Q){const G=MP(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,A(),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();I(),E(c({startIndex:se},Q),G),l.emit("reInit")}function I(){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(),I(),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}Io.globalOptions=void 0;function Is(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(()=>{Es(n.current,e)||(n.current=e,l())},[e,l]),m.useEffect(()=>{lP(r.current,t)||(r.current=t,l())},[t,l]),m.useEffect(()=>{if(sP()&&a){Io.globalOptions=Is.globalOptions;const c=Io(a,n.current,r.current);return i(c),()=>c.destroy()}else i(void 0)},[a,i]),[s,o]}Is.globalOptions=void 0;function FP(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 Gh=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}),Ur=()=>{const e=L.useContext(Gh);if(!e)throw new Error("useDrawerContext must be used within a Drawer.Root");return e};FP(`[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(
93
+ [data-state=closed]
94
+ ){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 BP(){const e=navigator.userAgent;return typeof window<"u"&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))}function VP(){return As(/^Mac/)}function UP(){return As(/^iPhone/)}function rc(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function ZP(){return As(/^iPad/)||VP()&&navigator.maxTouchPoints>1}function Wh(){return UP()||ZP()}function As(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.platform):void 0}const HP=24,GP=typeof window<"u"?m.useLayoutEffect:m.useEffect;function oc(...e){return(...t)=>{for(let n of e)typeof n=="function"&&n(...t)}}const Ri=typeof document<"u"&&window.visualViewport;function ic(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function qh(e){for(ic(e)&&(e=e.parentElement);e&&!ic(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const WP=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let oo=0,ji;function qP(e={}){let{isDisabled:t}=e;GP(()=>{if(!t)return oo++,oo===1&&Wh()&&(ji=KP()),()=>{oo--,oo===0&&ji?.()}},[t])}function KP(){let e,t=0,n=u=>{e=qh(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;wa(p)&&p!==document.activeElement&&(u.preventDefault(),p.style.transform="translateY(-2000px)",p.focus(),requestAnimationFrame(()=>{p.style.transform=""}))},i=u=>{let p=u.target;wa(p)&&(p.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{p.style.transform="",Ri&&(Ri.height<window.innerHeight?requestAnimationFrame(()=>{ac(p)}):Ri.addEventListener("resize",()=>ac(p),{once:!0}))}))},a=()=>{window.scrollTo(0,0)},s=window.pageXOffset,l=window.pageYOffset,c=oc(JP(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let d=oc(ar(document,"touchstart",n,{passive:!1,capture:!0}),ar(document,"touchmove",r,{passive:!1,capture:!0}),ar(document,"touchend",o,{passive:!1,capture:!0}),ar(document,"focus",i,!0),ar(window,"scroll",a));return()=>{c(),d(),window.scrollTo(s,l)}}function JP(e,t,n){let r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}function ar(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function ac(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let n=qh(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+HP;i>a&&(n.scrollTop+=o-r)}e=n.parentElement}}function wa(e){return e instanceof HTMLInputElement&&!WP.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function YP(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function XP(...e){return t=>e.forEach(n=>YP(n,t))}function Kh(...e){return m.useCallback(XP(...e),e)}const Jh=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&&Jh.set(e,r)}function QP(e,t){if(!e||!(e instanceof HTMLElement))return;let n=Jh.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 io(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 eN(e){return 8*(Math.log(e+1)-2)}function Oi(e,t){if(!e)return()=>{};const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}function tN(...e){return(...t)=>{for(const n of e)typeof n=="function"&&n(...t)}}const Ae={DURATION:.5,EASE:[.32,.72,0,1]},Yh=.4,nN=.25,rN=100,Xh=8,dn=16,ka=26,Mi="vaul-dragging";function Qh(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 oN({defaultProp:e,onChange:t}){const n=L.useState(e),[r]=n,o=L.useRef(r),i=Qh(t);return L.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}function em({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=oN({defaultProp:t,onChange:n}),i=e!==void 0,a=i?e:r,s=Qh(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 iN({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:n,drawerRef:r,overlayRef:o,fadeFromIndex:i,onSnapPointChange:a,direction:s="bottom",container:l,snapToSequentialPoint:c}){const[d,u]=em({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(A=>A===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 A;return(A=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 I=E?N:p?R*T.width:0;return p?s==="right"?T.width-I:-T.width+I:I}))!=null?A:[]},[n,p,l]),y=L.useMemo(()=>g!==null?x?.[g]:null,[x,g]),w=L.useCallback(T=>{var A;const R=(A=x?.findIndex(E=>E===T))!=null?A: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 A=(T=n?.findIndex(R=>R===e||R===d))!=null?T:-1;x&&A!==-1&&typeof x[A]=="number"&&w(x[A])}},[d,e,n,x,w]);function S({draggedDistance:T,closeDrawer:A,velocity:R,dismissible:E}){if(i===void 0)return;const N=s==="bottom"||s==="right"?(y??0)-T:(y??0)+T,I=g===i-1,j=g===0,$=T>0;if(I&&Be(o.current,{transition:`opacity ${Ae.DURATION}s cubic-bezier(${Ae.EASE.join(",")})`}),!c&&R>2&&!$){E?A():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>Yh&&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&&A(),g===null)return;w(x[g+W]);return}w(O)}function P({draggedDistance:T}){if(y===null)return;const A=s==="bottom"||s==="right"?y-T:y+T;(s==="bottom"||s==="right")&&A<x[x.length-1]||(s==="top"||s==="left")&&A>x[x.length-1]||Be(r.current,{transform:ze(s)?`translate3d(0, ${A}px, 0)`:`translate3d(${A}px, 0, 0)`})}function C(T,A){if(!n||typeof g!="number"||!x||i===void 0)return null;const R=g===i-1;if(g>=i&&A)return 0;if(R&&!A)return 1;if(!b&&!R)return null;const N=R?g+1:g-1,I=R?x[N]-x[N-1]:x[N+1]-x[N],j=T/Math.abs(I);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 aN=()=>()=>{};function sN(){const{direction:e,isOpen:t,shouldScaleBackground:n,setBackgroundColorOnScale:r,noBodyStyles:o}=Ur(),i=L.useRef(null),a=m.useMemo(()=>document.body.style.backgroundColor,[]);function s(){return(window.innerWidth-ka)/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;tN(r&&!o?Oi(document.body,{background:"black"}):aN,Oi(l,{transformOrigin:ze(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${Ae.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Ae.EASE.join(",")})`}));const c=Oi(l,{borderRadius:`${Xh}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 sr=null;function lN({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(rc()&&sr===null&&e&&!i){sr={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(rc()&&sr!==null&&!i){const u=-parseInt(document.body.style.top,10),p=-parseInt(document.body.style.left,10);Object.assign(document.body.style,sr),window.requestAnimationFrame(()=>{if(o&&a!==window.location.href){s(window.location.href);return}window.scrollTo(p,u)}),sr=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 cN({open:e,onOpenChange:t,children:n,onDrag:r,onRelease:o,snapPoints:i,shouldScaleBackground:a=!1,setBackgroundColorOnScale:s=!0,closeThreshold:l=nN,scrollLockTimeout:c=rN,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:A=!1,repositionInputs:R=!0,onAnimationEnd:E,container:N,autoFocus:I=!1}){var j,$;const[O=!1,B]=em({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:ln,snapPointsOffset:yt,onDrag:Pn,shouldFade:cn,getPercentageDragged:D}=iN({snapPoints:i,activeSnapPointProp:h,setActiveSnapPointProp:v,drawerRef:K,fadeFromIndex:p,overlayRef:_,onSnapPointChange:bt,direction:S,container:N,snapToSequentialPoint:T});qP({isDisabled:!O||V||!b||le||!W||!R||!C});const{restorePositionSetting:H}=lN({isOpen:O,modal:b,nested:y??!1,hasBeenOpened:W,preventScrollRestoration:A,noBodyStyles:w});function re(){return(window.innerWidth-ka)/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,Wh()&&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?io(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 un=D(Je,ge);if(un!==null&&(dt=un),Pe&&dt>=1||!te.current&&!pe(oe.target,ge))return;if(K.current.classList.add(Mi),te.current=!0,Be(K.current,{transition:"none"}),Be(_.current,{transition:"none"}),i&&Pn({draggedDistance:we}),ge&&!i){const Rt=eN(we),Wr=Math.min(Rt*-1,0)*ye;Be(K.current,{transform:ze(S)?`translate3d(0, ${Wr}px, 0)`:`translate3d(${Wr}px, 0, 0)`});return}const Ut=1-dt;if((cn||p&&He===p-1)&&(r?.(oe,dt),Be(_.current,{opacity:`${Ut}`,transition:"none"},!0)),Ve&&_.current&&a){const Rt=Math.min(re()+dt*(1-re()),1),Wr=8-dt*8,Ys=Math.max(0,14-dt*14);Be(Ve,{borderRadius:`${Wr}px`,transform:ze(S)?`scale(${Rt}) translate3d(0, ${Ys}px, 0)`:`scale(${Rt}) translate3d(${Ys}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(wa(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 un=K.current.getBoundingClientRect().top;if(Math.abs(se.current-Ve)>60&&(Q.current=!Q.current),i&&i.length>0&&yt&&He){const Ut=yt[He]||0;Ve+=Ut}if(se.current=Ve,wt>Pe||Q.current){const Ut=K.current.getBoundingClientRect().height;let Rt=Ut;Ut>Pe&&(Rt=Pe-(dt?un:ka)),g?K.current.style.height=`${Ut-Math.max(Ve,0)}px`:K.current.style.height=`${Math.max(Rt,Pe-un)}px`}else BP()||(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){Lt(),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=io(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:`${Xh}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 Lt(){!V||!K.current||(K.current.classList.remove(Mi),te.current=!1,k(!1),ce.current=new Date)}function Ft(oe){if(!V||!K.current)return;K.current.classList.remove(Mi),te.current=!1,k(!1),ce.current=new Date;const ye=io(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){ln({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>Yh){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),un=S==="left"||S==="right";if(Math.abs(ye)>=(un?dt:Ve)*l){We(),o?.(oe,!1);return}o?.(oe,!0),qe()}L.useEffect(()=>(O&&(Be(document.documentElement,{scrollBehavior:"auto"}),fe.current=new Date),()=>{QP(document.documentElement,"scrollBehavior")}),[O]);function Ke(oe){const ye=oe?(window.innerWidth-dn)/window.innerWidth:1,we=oe?-dn: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=io(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-dn)/window.innerWidth,ge=we+ye*(1-we),Pe=-dn+ye*dn;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-dn)/we:1,Pe=ye?-dn: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(zd,{defaultOpen:P,onOpenChange:oe=>{!d&&!oe||(oe?Y(!0):We(!0),B(oe))},open:O},L.createElement(Gh.Provider,{value:{activeSnapPoint:ct,snapPoints:i,setActiveSnapPoint:It,drawerRef:K,overlayRef:_,onOpenChange:t,onPress:ue,onRelease:Ft,onDrag:Ge,dismissible:d,shouldAnimate:G,handleOnly:u,isOpen:O,isDragging:V,shouldFade:cn,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:I}},n))}const tm=L.forwardRef(function({...e},t){const{overlayRef:n,snapPoints:r,onRelease:o,shouldFade:i,isOpen:a,modal:s,shouldAnimate:l}=Ur(),c=Kh(t,n),d=r&&r.length>0;if(!s)return null;const u=L.useCallback(p=>o(p),[o]);return L.createElement(Fd,{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})});tm.displayName="Drawer.Overlay";const nm=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}=Ur(),[S,P]=L.useState(!1),C=Kh(o,i),T=L.useRef(null),A=L.useRef(null),R=L.useRef(!1),E=g&&g.length>0;sN();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 I(j){T.current=null,R.current=!1,s(j)}return L.createElement(Bd,{"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(A.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),I(A.current)},onContextMenu:j=>{r.onContextMenu==null||r.onContextMenu.call(r,j),A.current&&I(A.current)}})});nm.displayName="Drawer.Content";const uN=250,dN=120,fN=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}=Ur(),v=L.useRef(null),g=L.useRef(!1);function b(){if(g.current){w();return}window.setTimeout(()=>{x()},dN)}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},uN)}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))});fN.displayName="Drawer.Handle";function pN(e){const t=Ur(),{container:n=t.container,...r}=e;return L.createElement(Ld,{container:n,...r})}const rr={Root:cN,Content:nm,Overlay:tm,Portal:pN,Title:Vd,Description:Ud};function q(...e){return Pg(Ng(e))}var rm=Ir("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 vr({className:e,variant:t="default",size:n="default",asChild:r=!1,...o}){const i=r?Gu:"button";return f.jsx(i,{"data-slot":"button","data-variant":t,"data-size":n,className:q(rm({variant:t,size:n,className:e})),...o})}function hN({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 mN({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 gN({className:e,...t}){return f.jsx("div",{"data-slot":"card-title",className:q("leading-none font-semibold",e),...t})}function vN({className:e,...t}){return f.jsx("div",{"data-slot":"card-description",className:q("text-muted-foreground text-sm",e),...t})}function xN({className:e,...t}){return f.jsx("div",{"data-slot":"card-content",className:q("px-6",e),...t})}function bN({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 Bt({className:e,...t}){return f.jsx(f_,{"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 yN({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 wN({className:e,...t}){return f.jsx(Xd,{"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(ef,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none",children:f.jsx(Vh,{className:"size-3.5"})})})}function kN({className:e,size:t="default",...n}){return f.jsx(tT,{"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(nT,{"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 SN({className:e,value:t,...n}){return f.jsx(j_,{"data-slot":"progress",className:q("bg-primary/20 relative h-2 w-full overflow-hidden rounded-full",e),...n,children:f.jsx(O_,{"data-slot":"progress-indicator",className:"bg-primary h-full w-full flex-1 transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})})}function CN({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return f.jsx(AE,{"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 _N=Ir("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 EN({className:e,variant:t,...n}){return f.jsx("div",{"data-slot":"alert",role:"alert",className:q(_N({variant:t}),e),...n})}function TN({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 PN({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 NN({...e}){return f.jsx(zd,{"data-slot":"dialog",...e})}function IN({...e}){return f.jsx(Ld,{"data-slot":"dialog-portal",...e})}function AN({className:e,...t}){return f.jsx(Fd,{"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 RN({className:e,children:t,showCloseButton:n=!0,...r}){return f.jsxs(IN,{"data-slot":"dialog-portal",children:[f.jsx(AN,{}),f.jsxs(Bd,{"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(gC,{"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(iP,{}),f.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function jN({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 ON({className:e,...t}){return f.jsx(Vd,{"data-slot":"dialog-title",className:q("text-lg leading-none font-semibold",e),...t})}function MN({className:e,...t}){return f.jsx(Ud,{"data-slot":"dialog-description",className:q("text-muted-foreground text-sm",e),...t})}function sc({...e}){return f.jsx(eS,{"data-slot":"accordion",...e})}function DN({className:e,...t}){return f.jsx(tS,{"data-slot":"accordion-item",className:q("border-b last:border-b-0",e),...t})}function $N({className:e,children:t,...n}){return f.jsx(nS,{className:"flex",children:f.jsxs(rS,{"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(_s,{className:"text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200"})]})})}function zN({className:e,children:t,...n}){return f.jsx(oS,{"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 LN({className:e,...t}){return f.jsx(kC,{"data-slot":"avatar",className:q("relative flex size-10 shrink-0 overflow-hidden rounded-full",e),...t})}function FN({className:e,...t}){return f.jsx(SC,{"data-slot":"avatar-image",className:q("aspect-square size-full",e),...t})}function BN({className:e,...t}){return f.jsx(CC,{"data-slot":"avatar-fallback",className:q("bg-muted flex size-full items-center justify-center rounded-full",e),...t})}var VN=Ir("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 UN({className:e,variant:t="default",asChild:n=!1,...r}){const o=n?Gu:"span";return f.jsx(o,{"data-slot":"badge","data-variant":t,className:q(VN({variant:t}),e),...r})}function ZN({className:e,...t}){return f.jsx(Z_,{"data-slot":"radio-group",className:q("grid gap-3",e),...t})}function HN({className:e,...t}){return f.jsx(H_,{"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(G_,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:f.jsx(tP,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})})})}function GN({...e}){return f.jsx(gE,{"data-slot":"select",...e})}function WN({...e}){return f.jsx(xE,{"data-slot":"select-value",...e})}function qN({className:e,size:t="default",children:n,...r}){return f.jsxs(vE,{"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(bE,{asChild:!0,children:f.jsx(_s,{className:"size-4 opacity-50"})})]})}function KN({className:e,children:t,position:n="item-aligned",align:r="center",...o}){return f.jsx(yE,{children:f.jsxs(wE,{"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(YN,{}),f.jsx(kE,{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(XN,{})]})})}function JN({className:e,children:t,...n}){return f.jsxs(SE,{"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(_E,{children:f.jsx(Vh,{className:"size-4"})})}),f.jsx(CE,{children:t})]})}function YN({className:e,...t}){return f.jsx(EE,{"data-slot":"select-scroll-up-button",className:q("flex cursor-default items-center justify-center py-1",e),...t,children:f.jsx(QT,{className:"size-4"})})}function XN({className:e,...t}){return f.jsx(TE,{"data-slot":"select-scroll-down-button",className:q("flex cursor-default items-center justify-center py-1",e),...t,children:f.jsx(_s,{className:"size-4"})})}var om=m.createContext(null);function pi(){const e=m.useContext(om);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}function QN({orientation:e="horizontal",opts:t,setApi:n,plugins:r,className:o,children:i,...a}){const[s,l]=Is({...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(om.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 eI({className:e,...t}){const{carouselRef:n,orientation:r}=pi();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 tI({className:e,...t}){const{orientation:n}=pi();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 nI({className:e,variant:t="outline",size:n="icon",...r}){const{orientation:o,scrollPrev:i,canScrollPrev:a}=pi();return f.jsxs(vr,{"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(UT,{}),f.jsx("span",{className:"sr-only",children:"Previous slide"})]})}function rI({className:e,variant:t="outline",size:n="icon",...r}){const{orientation:o,scrollNext:i,canScrollNext:a}=pi();return f.jsxs(vr,{"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(HT,{}),f.jsx("span",{className:"sr-only",children:"Next slide"})]})}function oI({...e}){return f.jsx(ed,{"data-slot":"collapsible",...e})}function iI({...e}){return f.jsx(Wa,{"data-slot":"collapsible-trigger",...e})}function aI({...e}){return f.jsx(Ka,{"data-slot":"collapsible-content",...e})}function sI({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 lI({className:e,...t}){return f.jsx("thead",{"data-slot":"table-header",className:q("[&_tr]:border-b",e),...t})}function cI({className:e,...t}){return f.jsx("tbody",{"data-slot":"table-body",className:q("[&_tr:last-child]:border-0",e),...t})}function lc({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 uI({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 dI({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 fI({className:e,...t}){return f.jsx("caption",{"data-slot":"table-caption",className:q("text-muted-foreground mt-4 text-sm",e),...t})}function pI({...e}){return f.jsx(rr.Root,{"data-slot":"drawer",...e})}function hI({...e}){return f.jsx(rr.Portal,{"data-slot":"drawer-portal",...e})}function mI({className:e,...t}){return f.jsx(rr.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 gI({className:e,children:t,...n}){return f.jsxs(hI,{"data-slot":"drawer-portal",children:[f.jsx(mI,{}),f.jsxs(rr.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 vI({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 xI({className:e,...t}){return f.jsx(rr.Title,{"data-slot":"drawer-title",className:q("text-foreground font-semibold",e),...t})}function bI({className:e,...t}){return f.jsx(rr.Description,{"data-slot":"drawer-description",className:q("text-muted-foreground text-sm",e),...t})}function yI({...e}){return f.jsx(a_,{"data-slot":"dropdown-menu",...e})}function wI({...e}){return f.jsx(s_,{"data-slot":"dropdown-menu-trigger",...e})}function kI({className:e,sideOffset:t=4,...n}){return f.jsx(l_,{children:f.jsx(c_,{"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 SI({className:e,inset:t,variant:n="default",...r}){return f.jsx(u_,{"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 CI({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 _I({className:e,...t}){return f.jsx("ul",{"data-slot":"pagination-content",className:q("flex flex-row items-center gap-1",e),...t})}function ao({...e}){return f.jsx("li",{"data-slot":"pagination-item",...e})}function Rs({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(rm({variant:t?"outline":"ghost",size:n}),e),...r})}function EI({className:e,...t}){return f.jsxs(Rs,{"aria-label":"Go to previous page",size:"default",className:q("gap-1 px-2.5 sm:pl-2.5",e),...t,children:[f.jsx(KT,{}),f.jsx("span",{className:"hidden sm:block",children:"Previous"})]})}function TI({className:e,...t}){return f.jsxs(Rs,{"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(YT,{})]})}function PI({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(rP,{className:"size-4"}),f.jsx("span",{className:"sr-only",children:"More pages"})]})}function NI({...e}){return f.jsx(S_,{"data-slot":"popover",...e})}function II({...e}){return f.jsx(C_,{"data-slot":"popover-trigger",...e})}function AI({className:e,align:t="center",sideOffset:n=4,...r}){return f.jsx(__,{children:f.jsx(E_,{"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 RI({className:e,...t}){return f.jsx("div",{"data-slot":"skeleton",className:q("bg-accent animate-pulse rounded-md",e),...t})}function jI({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(WE,{"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(qE,{"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(KE,{"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(JE,{"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 OI({className:e,orientation:t="horizontal",...n}){return f.jsx(aT,{"data-slot":"tabs","data-orientation":t,orientation:t,className:q("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",e),...n})}var MI=Ir("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 DI({className:e,variant:t="default",...n}){return f.jsx(sT,{"data-slot":"tabs-list","data-variant":t,className:q(MI({variant:t}),e),...n})}function $I({className:e,...t}){return f.jsx(lT,{"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 im=Ir("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 zI({className:e,variant:t,size:n,...r}){return f.jsx(cT,{"data-slot":"toggle",className:q(im({variant:t,size:n,className:e})),...r})}var am=m.createContext({size:"default",variant:"default",spacing:0});function cc({className:e,variant:t,size:n,spacing:r=0,children:o,...i}){return f.jsx(hT,{"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(am.Provider,{value:{variant:t,size:n,spacing:r},children:o})})}function uc({className:e,children:t,variant:n,size:r,...o}){const i=m.useContext(am);return f.jsx(mT,{"data-slot":"toggle-group-item","data-variant":i.variant||n,"data-size":i.size||r,"data-spacing":i.spacing,className:q(im({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 LI({delayDuration:e=0,...t}){return f.jsx(AT,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function FI({...e}){return f.jsx(RT,{"data-slot":"tooltip",...e})}function BI({...e}){return f.jsx(jT,{"data-slot":"tooltip-trigger",...e})}function VI({className:e,sideOffset:t=0,children:n,...r}){return f.jsx(OT,{children:f.jsxs(MT,{"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(DT,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}function UI(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 ZI={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(hN,{className:q(n,r),children:[(e.title||e.description)&&f.jsxs(mN,{children:[e.title&&f.jsx(gN,{children:e.title}),e.description&&f.jsx(vN,{children:e.description})]}),f.jsx(xN,{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(CN,{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(OI,{value:d,onValueChange:p=>{u(p),r("change")},children:[f.jsx(DI,{children:o.map(p=>f.jsx($I,{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(DN,{value:`item-${i}`,children:[f.jsx($N,{children:o.title}),f.jsx(zN,{children:o.content})]},i));return n?f.jsx(sc,{type:"multiple",className:"w-full",children:r}):f.jsx(sc,{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(oI,{open:n,onOpenChange:r,className:"w-full",children:[f.jsx(iI,{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(aI,{className:"pt-2",children:t})]})},Dialog:({props:e,children:t})=>{const[n,r]=Rl(e.openPath??"");return f.jsx(NN,{open:n??!1,onOpenChange:o=>r(o),children:f.jsxs(RN,{children:[f.jsxs(jN,{children:[f.jsx(ON,{children:e.title}),e.description&&f.jsx(MN,{children:e.description})]}),t]})})},Drawer:({props:e,children:t})=>{const[n,r]=Rl(e.openPath??"");return f.jsx(pI,{open:n??!1,onOpenChange:o=>r(o),children:f.jsxs(gI,{children:[f.jsxs(vI,{children:[f.jsx(xI,{children:e.title}),e.description&&f.jsx(bI,{children:e.description})]}),f.jsx("div",{className:"p-4",children:t})]})})},Carousel:({props:e})=>{const t=e.items??[];return f.jsxs(QN,{className:"w-full",children:[f.jsx(eI,{children:t.map((n,r)=>f.jsx(tI,{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(nI,{}),f.jsx(rI,{})]})},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(sI,{children:[e.caption&&f.jsx(fI,{children:e.caption}),f.jsx(lI,{children:f.jsx(lc,{children:t.map(r=>f.jsx(uI,{children:r},r))})}),f.jsx(cI,{children:n.map((r,o)=>f.jsx(lc,{children:r.map((i,a)=>f.jsx(dI,{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(LN,{className:r,children:[e.src&&f.jsx(FN,{src:e.src,alt:t}),f.jsx(BN,{children:n})]})},Badge:({props:e})=>f.jsx(UN,{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(EN,{variant:t,className:n,children:[f.jsx(TN,{children:e.title}),e.message&&f.jsx(PN,{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(Bt,{className:"text-sm text-muted-foreground",children:e.label}),f.jsx(SN,{value:t})]})},Skeleton:({props:e})=>f.jsx(RI,{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(LI,{children:f.jsxs(FI,{children:[f.jsx(BI,{asChild:!0,children:f.jsx("span",{className:"text-sm underline decoration-dotted cursor-help",children:e.text})}),f.jsx(VI,{children:f.jsx("p",{children:e.content})})]})}),Popover:({props:e})=>f.jsxs(NI,{children:[f.jsx(II,{asChild:!0,children:f.jsx(vr,{variant:"outline",className:"text-sm",children:e.trigger})}),f.jsx(AI,{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}=In(t?.value??"",u?{checks:e.checks??[],validateOn:d}:void 0);return f.jsxs("div",{className:"space-y-2",children:[e.label&&f.jsx(Bt,{htmlFor:e.name??void 0,children:e.label}),f.jsx(bN,{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}=In(t?.value??"",d?{checks:e.checks??[],validateOn:c}:void 0);return f.jsxs("div",{className:"space-y-2",children:[e.label&&f.jsx(Bt,{htmlFor:e.name??void 0,children:e.label}),f.jsx(yN,{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}=In(t?.value??"",h?{checks:e.checks??[],validateOn:p}:void 0);return f.jsxs("div",{className:"space-y-2",children:[f.jsx(Bt,{children:e.label}),f.jsxs(GN,{value:l,onValueChange:b=>{c(b),h&&p==="change"&&g(),n("change")},children:[f.jsx(qN,{className:"w-full",children:f.jsx(WN,{placeholder:e.placeholder??"Select..."})}),f.jsx(KN,{children:u.map((b,x)=>f.jsx(JN,{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}=In(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(wN,{id:e.name??void 0,checked:l,onCheckedChange:v=>{c(v===!0),u&&d==="change"&&h(),n("change")}}),f.jsx(Bt,{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}=In(t?.value??"",h?{checks:e.checks??[],validateOn:p}:void 0);return f.jsxs("div",{className:"space-y-2",children:[e.label&&f.jsx(Bt,{children:e.label}),f.jsx(ZN,{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(HN,{value:b||`option-${x}`,id:`${e.name}-${x}-${b}`}),f.jsx(Bt,{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}=In(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(Bt,{htmlFor:e.name??void 0,className:"cursor-pointer",children:e.label}),f.jsx(kN,{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(Bt,{className:"text-sm",children:e.label}),f.jsx("span",{className:"text-sm text-muted-foreground",children:l})]}),f.jsx(jI,{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(vr,{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(yI,{children:[f.jsx(wI,{asChild:!0,children:f.jsx(vr,{variant:"outline",children:e.label})}),f.jsx(kI,{children:r.map(i=>f.jsx(SI,{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(zI,{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(cc,{type:"multiple",value:p,onValueChange:h=>{u(h.join(",")),n("change")},children:o.map(h=>f.jsx(uc,{value:h.value,children:h.label},h.value))})}return f.jsx(cc,{type:"single",value:d,onValueChange:p=>{p&&(u(p),n("change"))},children:o.map(p=>f.jsx(uc,{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=UI(i,a);return f.jsx(CI,{children:f.jsxs(_I,{children:[f.jsx(ao,{children:f.jsx(EI,{href:"#",onClick:l=>{l.preventDefault(),i>1&&(o(i-1),n("change"))}})}),s.map((l,c)=>l==="ellipsis"?f.jsx(ao,{children:f.jsx(PI,{})},`ellipsis-${c}`):f.jsx(ao,{children:f.jsx(Rs,{href:"#",isActive:l===i,onClick:d=>{d.preventDefault(),o(l),n("change")},children:l})},l)),f.jsx(ao,{children:f.jsx(TI,{href:"#",onClick:l=>{l.preventDefault(),i<a&&(o(i+1),n("change"))}})})]})})}};const HI=nk(rk,{components:yk,actions:{}});bk(HI,{components:ZI});function GI(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const WI=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,qI=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,KI={};function dc(e,t){return(KI.jsx?qI:WI).test(e)}const JI=/[ \t\n\f\r]/g;function YI(e){return typeof e=="object"?e.type==="text"?fc(e.value):!1:fc(e)}function fc(e){return e.replace(JI,"")===""}class Zr{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Zr.prototype.normal={};Zr.prototype.property={};Zr.prototype.space=void 0;function sm(e,t){const n={},r={};for(const o of e)Object.assign(n,o.property),Object.assign(r,o.normal);return new Zr(n,r,t)}function Sa(e){return e.toLowerCase()}class lt{constructor(t,n){this.attribute=n,this.property=t}}lt.prototype.attribute="";lt.prototype.booleanish=!1;lt.prototype.boolean=!1;lt.prototype.commaOrSpaceSeparated=!1;lt.prototype.commaSeparated=!1;lt.prototype.defined=!1;lt.prototype.mustUseProperty=!1;lt.prototype.number=!1;lt.prototype.overloadedBoolean=!1;lt.prototype.property="";lt.prototype.spaceSeparated=!1;lt.prototype.space=void 0;let XI=0;const de=Tn(),$e=Tn(),Ca=Tn(),F=Tn(),Ce=Tn(),Hn=Tn(),pt=Tn();function Tn(){return 2**++XI}const _a=Object.freeze(Object.defineProperty({__proto__:null,boolean:de,booleanish:$e,commaOrSpaceSeparated:pt,commaSeparated:Hn,number:F,overloadedBoolean:Ca,spaceSeparated:Ce},Symbol.toStringTag,{value:"Module"})),Di=Object.keys(_a);class js extends lt{constructor(t,n,r,o){let i=-1;if(super(t,n),pc(this,"space",o),typeof r=="number")for(;++i<Di.length;){const a=Di[i];pc(this,Di[i],(r&_a[a])===_a[a])}}}js.prototype.defined=!0;function pc(e,t,n){n&&(e[t]=n)}function or(e){const t={},n={};for(const[r,o]of Object.entries(e.properties)){const i=new js(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[Sa(r)]=r,n[Sa(i.attribute)]=r}return new Zr(t,n,e.space)}const lm=or({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 cm(e,t){return t in e?e[t]:t}function um(e,t){return cm(e,t.toLowerCase())}const QI=or({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Hn,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|Hn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:de,defer:de,dir:null,dirName:null,disabled:de,download:Ca,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:Ca,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:um}),eA=or({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:Hn,g2:Hn,glyphName:Hn,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:cm}),dm=or({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()}}),fm=or({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:um}),pm=or({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),tA={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"},nA=/[A-Z]/g,hc=/-[a-z]/g,rA=/^data[-\w.:]+$/i;function oA(e,t){const n=Sa(t);let r=t,o=lt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&rA.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(hc,aA);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!hc.test(i)){let a=i.replace(nA,iA);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}o=js}return new o(r,t)}function iA(e){return"-"+e.toLowerCase()}function aA(e){return e.charAt(1).toUpperCase()}const sA=sm([lm,QI,dm,fm,pm],"html"),Os=sm([lm,eA,dm,fm,pm],"svg");function lA(e){return e.join(" ").trim()}var Dn={},$i,mc;function cA(){if(mc)return $i;mc=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=`
95
+ `,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 A($){var O=$.exec(b);if(O){var B=O[0];return S(B),b=b.slice(B.length),O}}function R(){A(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 I(){var $=P(),O=A(r);if(O){if(N(),!A(o))return T("property missing ':'");var B=A(i),W=$({type:h,property:g(O[0].replace(e,u)),value:B?g(B[0].replace(e,u)):u});return A(a),W}}function j(){var $=[];E($);for(var O;O=I();)O!==!1&&($.push(O),E($));return $}return R(),j()}function g(b){return b?b.replace(s,u):u}return $i=v,$i}var gc;function uA(){if(gc)return Dn;gc=1;var e=Dn&&Dn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Dn,"__esModule",{value:!0}),Dn.default=n;const t=e(cA());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 Dn}var lr={},vc;function dA(){if(vc)return lr;vc=1,Object.defineProperty(lr,"__esModule",{value:!0}),lr.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 lr.camelCase=l,lr}var cr,xc;function fA(){if(xc)return cr;xc=1;var e=cr&&cr.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(uA()),n=dA();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,cr=r,cr}var pA=fA();const hA=ou(pA),hm=mm("end"),Ms=mm("start");function mm(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 mA(e){const t=Ms(e),n=hm(e);if(t&&n)return{start:t,end:n}}function xr(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?bc(e.position):"start"in e||"end"in e?bc(e):"line"in e||"column"in e?Ea(e):""}function Ea(e){return yc(e&&e.line)+":"+yc(e&&e.column)}function bc(e){return Ea(e&&e.start)+"-"+Ea(e&&e.end)}function yc(e){return e&&typeof e=="number"?e:1}class tt 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=xr(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}}tt.prototype.file="";tt.prototype.name="";tt.prototype.reason="";tt.prototype.message="";tt.prototype.stack="";tt.prototype.column=void 0;tt.prototype.line=void 0;tt.prototype.ancestors=void 0;tt.prototype.cause=void 0;tt.prototype.fatal=void 0;tt.prototype.place=void 0;tt.prototype.ruleId=void 0;tt.prototype.source=void 0;const Ds={}.hasOwnProperty,gA=new Map,vA=/[A-Z]/g,xA=new Set(["table","tbody","thead","tfoot","tr"]),bA=new Set(["td","th"]),gm="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function yA(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=PA(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=TA(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"?Os:sA,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=vm(o,e,void 0);return i&&typeof i!="string"?i:o.create(e,o.Fragment,{children:i||void 0},void 0)}function vm(e,t,n){if(t.type==="element")return wA(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return kA(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return CA(e,t,n);if(t.type==="mdxjsEsm")return SA(e,t);if(t.type==="root")return _A(e,t,n);if(t.type==="text")return EA(e,t)}function wA(e,t,n){const r=e.schema;let o=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(o=Os,e.schema=o),e.ancestors.push(t);const i=bm(e,t.tagName,!1),a=NA(e,t);let s=zs(e,t);return xA.has(t.tagName)&&(s=s.filter(function(l){return typeof l=="string"?!YI(l):!0})),xm(e,a,i,t),$s(a,s),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}function kA(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)}Pr(e,t.position)}function SA(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Pr(e,t.position)}function CA(e,t,n){const r=e.schema;let o=r;t.name==="svg"&&r.space==="html"&&(o=Os,e.schema=o),e.ancestors.push(t);const i=t.name===null?e.Fragment:bm(e,t.name,!0),a=IA(e,t),s=zs(e,t);return xm(e,a,i,t),$s(a,s),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}function _A(e,t,n){const r={};return $s(r,zs(e,t)),e.create(t,e.Fragment,r,n)}function EA(e,t){return t.value}function xm(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function $s(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function TA(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 PA(e,t){return n;function n(r,o,i,a){const s=Array.isArray(i.children),l=Ms(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 NA(e,t){const n={};let r,o;for(o in t.properties)if(o!=="children"&&Ds.call(t.properties,o)){const i=AA(e,o,t.properties[o]);if(i){const[a,s]=i;e.tableCellAlignToStyle&&a==="align"&&typeof s=="string"&&bA.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 IA(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 Pr(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 Pr(e,t.position);else i=r.value===null?!0:r.value;n[o]=i}return n}function zs(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:gA;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=vm(e,i,a);s!==void 0&&n.push(s)}return n}function AA(e,t,n){const r=oA(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?GI(n):lA(n)),r.property==="style"){let o=typeof n=="object"?n:RA(e,String(n));return e.stylePropertyNameCase==="css"&&(o=jA(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&r.space?tA[r.property]||r.property:r.attribute,n]}}function RA(e,t){try{return hA(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,o=new tt("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=gm+"#cannot-parse-style-attribute",o}}function bm(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=dc(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=dc(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const o=r.value;return Ds.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(r);Pr(e)}function Pr(e,t){const n=new tt("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=gm+"#cannot-handle-mdx-estrees-without-createevaluater",n}function jA(e){const t={};let n;for(n in e)Ds.call(e,n)&&(t[OA(n)]=e[n]);return t}function OA(e){let t=e.replace(vA,MA);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function MA(e){return"-"+e.toLowerCase()}const zi={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"]},DA={};function Ls(e,t){const n=DA,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return ym(e,r,o)}function ym(e,t,n){if($A(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 wc(e.children,t,n)}return Array.isArray(e)?wc(e,t,n):""}function wc(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=ym(e[o],t,n);return r.join("")}function $A(e){return!!(e&&typeof e=="object")}const kc=document.createElement("i");function Fs(e){const t="&"+e+";";kc.innerHTML=t;const n=kc.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 Sc={}.hasOwnProperty;function wm(e){const t={};let n=-1;for(;++n<e.length;)zA(t,e[n]);return t}function zA(e,t){let n;for(n in t){const o=(Sc.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let a;if(i)for(a in i){Sc.call(o,a)||(o[a]=[]);const s=i[a];LA(o[a],Array.isArray(s)?s:s?[s]:[])}}}function LA(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 km(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 _t(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const rt=sn(/[A-Za-z]/),Xe=sn(/[\dA-Za-z]/),FA=sn(/[#-'*+\--9=?A-Z^-~]/);function Ao(e){return e!==null&&(e<32||e===127)}const Ta=sn(/\d/),BA=sn(/[\dA-Fa-f]/),VA=sn(/[!-/:-@[-`{-~]/);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 hi=sn(new RegExp("\\p{P}|\\p{S}","u")),wn=sn(/\s/);function sn(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function ir(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 xe(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 UA={tokenize:ZA};function ZA(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"),xe(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 HA={tokenize:GA},Cc={tokenize:WA};function GA(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(Cc,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(Cc,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 A=T,R,E;for(;A--;)if(t.events[A][0]==="exit"&&t.events[A][1].type==="chunkFlow"){if(R){E=t.events[A][1].end;break}R=!0}for(x(r),C=T;C<t.events.length;)t.events[C][1].end={...E},C++;ht(t.events,A+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 WA(e,t,n){return xe(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Jn(e){if(e===null||Se(e)||wn(e))return 1;if(hi(e))return 2}function mi(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 Pa={name:"attention",resolveAll:qA,tokenize:KA};function qA(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};_c(u,-l),_c(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,mi(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 KA(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=Jn(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=Jn(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 _c(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const JA={name:"autolink",tokenize:YA};function YA(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 rt(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||Ao(h)?n(h):(e.consume(h),l)}function c(h){return h===64?(e.consume(h),d):FA(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 Hr={partial:!0,tokenize:XA};function XA(e,t,n){return r;function r(i){return he(i)?xe(e,o,"linePrefix")(i):o(i)}function o(i){return i===null||ne(i)?t(i):n(i)}}const Sm={continuation:{tokenize:eR},exit:tR,name:"blockQuote",tokenize:QA};function QA(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 eR(e,t,n){const r=this;return o;function o(a){return he(a)?xe(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):i(a)}function i(a){return e.attempt(Sm,t,n)(a)}}function tR(e){e.exit("blockQuote")}const Cm={name:"characterEscape",tokenize:nR};function nR(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 VA(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const _m={name:"characterReference",tokenize:rR};function rR(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=BA,d):(e.enter("characterReferenceValue"),i=7,a=Ta,d(u))}function d(u){if(u===59&&o){const p=e.exit("characterReferenceValue");return a===Xe&&!Fs(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 Ec={partial:!0,tokenize:iR},Tc={concrete:!0,name:"codeFenced",tokenize:oR};function oR(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)?xe(e,u,"whitespace")(C):u(C))}function u(C){return C===null||ne(C)?(e.exit("codeFencedFence"),r.interrupt?t(C):e.check(Ec,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"),xe(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)?xe(e,y,"linePrefix",i+1)(C):y(C)}function y(C){return C===null||ne(C)?e.check(Ec,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,A){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)?xe(C,I,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):I(O)}function I(O){return O===s?(C.enter("codeFencedFenceSequence"),j(O)):A(O)}function j(O){return O===s?(R++,C.consume(O),j):R>=a?(C.exit("codeFencedFenceSequence"),he(O)?xe(C,$,"whitespace")(O):$(O)):A(O)}function $(O){return O===null||ne(O)?(C.exit("codeFencedFence"),T(O)):A(O)}}}function iR(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 Li={name:"codeIndented",tokenize:sR},aR={partial:!0,tokenize:lR};function sR(e,t,n){const r=this;return o;function o(c){return e.enter("codeIndented"),xe(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(aR,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 lR(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):xe(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 cR={name:"codeText",previous:dR,resolve:uR,tokenize:fR};function uR(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 dR(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function fR(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 pR{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&&ur(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),ur(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),ur(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);ur(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);ur(this.left,n.reverse())}}}function ur(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 Em(e){const t={};let n=-1,r,o,i,a,s,l,c;const d=new pR(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,hR(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 hR(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 mR={resolve:vR,tokenize:xR},gR={partial:!0,tokenize:bR};function vR(e){return Em(e),e}function xR(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(gR,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 bR(e,t,n){const r=this;return o;function o(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),xe(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 Tm(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||Ao(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||Ao(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 Pm(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 Nm(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"),xe(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 br(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)?xe(e,r,n?"linePrefix":"lineSuffix")(o):t(o)}}const yR={name:"definition",tokenize:kR},wR={partial:!0,tokenize:SR};function kR(e,t,n){const r=this;let o;return i;function i(h){return e.enter("definition"),a(h)}function a(h){return Pm.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function s(h){return o=_t(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)?br(e,c)(h):c(h)}function c(h){return Tm(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function d(h){return e.attempt(wR,u,u)(h)}function u(h){return he(h)?xe(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 SR(e,t,n){return r;function r(s){return Se(s)?br(e,o)(s):n(s)}function o(s){return Nm(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function i(s){return he(s)?xe(e,a,"whitespace")(s):a(s)}function a(s){return s===null||ne(s)?t(s):n(s)}}const CR={name:"hardBreakEscape",tokenize:_R};function _R(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 ER={name:"headingAtx",resolve:TR,tokenize:PR};function TR(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 PR(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)?xe(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 NR=["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"],Pc=["pre","script","style","textarea"],IR={concrete:!0,name:"htmlFlow",resolveTo:jR,tokenize:OR},AR={partial:!0,tokenize:DR},RR={partial:!0,tokenize:MR};function jR(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 OR(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):rt(_)?(e.consume(_),a=String.fromCharCode(_),b):n(_)}function p(_){return _===45?(e.consume(_),o=2,h):_===91?(e.consume(_),o=5,s=0,v):rt(_)?(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:I:v):n(_)}function g(_){return rt(_)?(e.consume(_),a=String.fromCharCode(_),b):n(_)}function b(_){if(_===null||_===47||_===62||Se(_)){const fe=_===47,ke=a.toLowerCase();return!fe&&!i&&Pc.includes(ke)?(o=1,r.interrupt?t(_):I(_)):NR.includes(a.toLowerCase())?(o=6,fe?(e.consume(_),x):r.interrupt?t(_):I(_)):(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:I):n(_)}function y(_){return he(_)?(e.consume(_),y):E(_)}function w(_){return _===47?(e.consume(_),E):_===58||_===95||rt(_)?(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):A(_)}function T(_){return _===l?(e.consume(_),l=null,R):_===null||ne(_)?n(_):(e.consume(_),T)}function A(_){return _===null||_===34||_===39||_===47||_===60||_===61||_===62||_===96||Se(_)?P(_):(e.consume(_),A)}function R(_){return _===47||_===62||he(_)?w(_):n(_)}function E(_){return _===62?(e.consume(_),N):n(_)}function N(_){return _===null||ne(_)?I(_):he(_)?(e.consume(_),N):n(_)}function I(_){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(AR,be,j)(_)):_===null||ne(_)?(e.exit("htmlFlowData"),j(_)):(e.consume(_),I)}function j(_){return e.check(RR,$,be)(_)}function $(_){return e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),O}function O(_){return _===null||ne(_)?j(_):(e.enter("htmlFlowData"),I(_))}function B(_){return _===45?(e.consume(_),k):I(_)}function W(_){return _===47?(e.consume(_),a="",Y):I(_)}function Y(_){if(_===62){const fe=a.toLowerCase();return Pc.includes(fe)?(e.consume(_),le):I(_)}return rt(_)&&a.length<8?(e.consume(_),a+=String.fromCharCode(_),Y):I(_)}function V(_){return _===93?(e.consume(_),k):I(_)}function k(_){return _===62?(e.consume(_),le):_===45&&o===2?(e.consume(_),k):I(_)}function le(_){return _===null||ne(_)?(e.exit("htmlFlowData"),be(_)):(e.consume(_),le)}function be(_){return e.exit("htmlFlow"),t(_)}}function MR(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 DR(e,t,n){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Hr,t,n)}}const $R={name:"htmlText",tokenize:zR};function zR(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):rt(k)?(e.consume(k),A):n(k)}function c(k){return k===45?(e.consume(k),d):k===91?(e.consume(k),i=0,v):rt(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 rt(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 A(k){return k===45||Xe(k)?(e.consume(k),A):k===47||k===62||Se(k)?R(k):n(k)}function R(k){return k===47?(e.consume(k),B):k===58||k===95||rt(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),I):ne(k)?(a=N,W(k)):he(k)?(e.consume(k),N):R(k)}function I(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=I,W(k)):he(k)?(e.consume(k),I):(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)?xe(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 Bs={name:"labelEnd",resolveAll:VR,resolveTo:UR,tokenize:ZR},LR={tokenize:HR},FR={tokenize:GR},BR={tokenize:WR};function VR(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 UR(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,mi(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 ZR(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(_t(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(LR,d,a?d:u)(p):p===91?e.attempt(FR,d,a?c:u)(p):a?d(p):u(p)}function c(p){return e.attempt(BR,d,u)(p)}function d(p){return t(p)}function u(p){return i._balanced=!0,n(p)}}function HR(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)?br(e,i)(u):i(u)}function i(u){return u===41?d(u):Tm(e,a,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(u)}function a(u){return Se(u)?br(e,l)(u):d(u)}function s(u){return n(u)}function l(u){return u===34||u===39||u===40?Nm(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(u):d(u)}function c(u){return Se(u)?br(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 GR(e,t,n){const r=this;return o;function o(s){return Pm.call(r,e,i,a,"reference","referenceMarker","referenceString")(s)}function i(s){return r.parser.defined.includes(_t(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(s):n(s)}function a(s){return n(s)}}function WR(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 qR={name:"labelStartImage",resolveAll:Bs.resolveAll,tokenize:KR};function KR(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 JR={name:"labelStartLink",resolveAll:Bs.resolveAll,tokenize:YR};function YR(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 Fi={name:"lineEnding",tokenize:XR};function XR(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),xe(e,t,"linePrefix")}}const mo={name:"thematicBreak",tokenize:QR};function QR(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)?xe(e,s,"whitespace")(c):s(c))}}const it={continuation:{tokenize:rj},exit:ij,name:"list",tokenize:nj},ej={partial:!0,tokenize:aj},tj={partial:!0,tokenize:oj};function nj(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:Ta(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(mo,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 Ta(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(Hr,r.interrupt?n:d,e.attempt(ej,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 rj(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Hr,o,i);function o(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,xe(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(tj,t,a)(s))}function a(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,xe(e,e.attempt(it,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function oj(e,t,n){const r=this;return xe(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 ij(e){e.exit(this.containerState.type)}function aj(e,t,n){const r=this;return xe(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 Nc={name:"setextUnderline",resolveTo:sj,tokenize:lj};function sj(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 lj(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)?xe(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||ne(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const cj={tokenize:uj};function uj(e){const t=this,n=e.attempt(Hr,r,e.attempt(this.parser.constructs.flowInitial,o,xe(e,e.attempt(this.parser.constructs.flow,o,e.attempt(mR,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 dj={resolveAll:Am()},fj=Im("string"),pj=Im("text");function Im(e){return{resolveAll:Am(e==="text"?hj: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 Am(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 hj(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 mj={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:Sm},gj={91:yR},vj={[-2]:Li,[-1]:Li,32:Li},xj={35:ER,42:mo,45:[Nc,mo],60:IR,61:Nc,95:mo,96:Tc,126:Tc},bj={38:_m,92:Cm},yj={[-5]:Fi,[-4]:Fi,[-3]:Fi,33:qR,38:_m,42:Pa,60:[JA,$R],91:JR,92:[CR,Cm],93:Bs,95:Pa,96:cR},wj={null:[Pa,dj]},kj={null:[42,95]},Sj={null:[]},Cj=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:kj,contentInitial:gj,disable:Sj,document:mj,flow:xj,flowInitial:vj,insideSpan:wj,string:bj,text:yj},Symbol.toStringTag,{value:"Module"}));function _j(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?[]:(A(t,0),c.events=mi(i,c.events,c),c.events)}function p(N,I){return Tj(h(N),I)}function h(N){return Ej(a,N)}function v(){const{_bufferIndex:N,_index:I,line:j,column:$,offset:O}=r;return{_bufferIndex:N,_index:I,line:j,column:$,offset:O}}function g(N){o[N.line]=N.column,E()}function b(){let N;for(;r._index<a.length;){const I=a[r._index];if(typeof I=="string")for(N=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===N&&r._bufferIndex<I.length;)x(I.charCodeAt(r._bufferIndex));else x(I)}}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,I){const j=I||{};return j.type=N,j.start=v(),c.events.push(["enter",j,c]),s.push(j),j}function S(N){const I=s.pop();return I.end=v(),c.events.push(["exit",I,c]),I}function P(N,I){A(N,I.from)}function C(N,I){I.restore()}function T(N,I){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(I?Object.assign(Object.create(c),I):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 A(N,I){N.resolveAll&&!i.includes(N)&&i.push(N),N.resolve&&ht(c.events,I,c.events.length-I,N.resolve(c.events.slice(I),c)),N.resolveTo&&(c.events=N.resolveTo(c.events,c))}function R(){const N=v(),I=c.previous,j=c.currentConstruct,$=c.events.length,O=Array.from(s);return{from:$,restore:B};function B(){r=N,c.previous=I,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 Ej(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 Tj(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=`
96
+ `;break}case-3:{a=`\r
97
+ `;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 Pj(e){const r={constructs:wm([Cj,...(e||{}).extensions||[]]),content:o(UA),defined:[],document:o(HA),flow:o(cj),lazy:{},string:o(fj),text:o(pj)};return r;function o(i){return a;function a(s){return _j(r,i,s)}}}function Nj(e){for(;!Em(e););return e}const Ic=/[\0\t\n\r]/g;function Ij(){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(Ic.lastIndex=u,c=Ic.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 Aj=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Rj(e){return e.replace(Aj,jj)}function jj(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),i=o===120||o===88;return km(n.slice(i?2:1),i?16:10)}return Fs(n)||e}const Rm={}.hasOwnProperty;function Oj(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),Mj(n)(Nj(Pj(n).document().write(Ij()(e,t,!0))))}function Mj(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(ln),reference:_,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:i(Te),strong:i(yt),thematicBreak:i(cn)},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(I),hardBreakTrailing:l(I),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(A),setextHeadingLineSequence:T,setextHeadingText:C,strong:l(),thematicBreak:l()}};jm(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]];Rm.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]||Ac).call(re,void 0,Ge[0])}for(H.position={start:Zt(D.length>0?D[0][1].start:{line:1,column:1,offset:0}),end:Zt(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,Lt,Ft;for(;++ue<=re;){const Ke=D[ue];switch(Ke[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ke[0]==="enter"?pe++:pe--,Ft=void 0;break}case"lineEndingBlank":{Ke[0]==="enter"&&(We&&!Ft&&!pe&&!Lt&&(Lt=ue),Ft=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ft=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}Lt&&(!qe||Lt<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++,Lt=void 0,Ft=!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:Zt(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]||Ac).call(this,D,ue[0]));else throw new Error("Cannot close `"+D.type+"` ("+xr({start:D.start,end:D.end})+"): it’s not open");re.position.end=Zt(D.end)}function d(){return Ls(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=_t(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 A(){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:Zt(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=Zt(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=Zt(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 I(){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=Rj(H),re.identifier=_t(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=_t(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=km(H,re==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ue=Fs(H);const pe=this.stack[this.stack.length-1];pe.value+=ue}function U(D){const H=this.stack.pop();H.position.end=Zt(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 ln(){return{type:"paragraph",children:[]}}function yt(){return{type:"strong",children:[]}}function Pn(){return{type:"text",value:""}}function cn(){return{type:"thematicBreak"}}}function Zt(e){return{line:e.line,column:e.column,offset:e.offset}}function jm(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?jm(e,r):Dj(e,r)}}function Dj(e,t){let n;for(n in t)if(Rm.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 Ac(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+xr({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+xr({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+xr({start:t.start,end:t.end})+") is still open")}function $j(e){const t=this;t.parser=n;function n(r){return Oj(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function zj(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 Lj(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
98
+ `}]}function Fj(e,t){const n=t.value?t.value+`
99
+ `:"",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 Bj(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Vj(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Uj(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),o=ir(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 Zj(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 Hj(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Om(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 Gj(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Om(e,t);const o={src:ir(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 Wj(e,t){const n={src:ir(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 qj(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 Kj(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Om(e,t);const o={href:ir(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 Jj(e,t){const n={href:ir(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 Yj(e,t,n){const r=e.all(t),o=n?Xj(n):Mm(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:`
100
+ `}),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:`
101
+ `});const c={type:"element",tagName:"li",properties:i,children:a};return e.patch(t,c),e.applyData(t,c)}function Xj(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=Mm(n[r])}return t}function Mm(e){const t=e.spread;return t??e.children.length>1}function Qj(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 eO(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function tO(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function nO(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function rO(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=Ms(t.children[1]),l=hm(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 oO(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 iO(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Rc=9,jc=32;function aO(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),o=0;const i=[];for(;r;)i.push(Oc(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return i.push(Oc(t.slice(o),o>0,!1)),i.join("")}function Oc(e,t,n){let r=0,o=e.length;if(t){let i=e.codePointAt(r);for(;i===Rc||i===jc;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(o-1);for(;i===Rc||i===jc;)o--,i=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}function sO(e,t){const n={type:"text",value:aO(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function lO(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const cO={blockquote:zj,break:Lj,code:Fj,delete:Bj,emphasis:Vj,footnoteReference:Uj,heading:Zj,html:Hj,imageReference:Gj,image:Wj,inlineCode:qj,linkReference:Kj,link:Jj,listItem:Yj,list:Qj,paragraph:eO,root:tO,strong:nO,table:rO,tableCell:iO,tableRow:oO,text:sO,thematicBreak:lO,toml:so,yaml:so,definition:so,footnoteDefinition:so};function so(){}const Dm=-1,gi=0,yr=1,Ro=2,Vs=3,Us=4,Zs=5,Hs=6,$m=7,zm=8,Mc=typeof self=="object"?self:globalThis,uO=(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 gi:case Dm:return n(a,o);case yr:{const s=n([],o);for(const l of a)s.push(r(l));return s}case Ro:{const s=n({},o);for(const[l,c]of a)s[r(l)]=r(c);return s}case Vs:return n(new Date(a),o);case Us:{const{source:s,flags:l}=a;return n(new RegExp(s,l),o)}case Zs:{const s=n(new Map,o);for(const[l,c]of a)s.set(r(l),r(c));return s}case Hs:{const s=n(new Set,o);for(const l of a)s.add(r(l));return s}case $m:{const{name:s,message:l}=a;return n(new Mc[s](l),o)}case zm: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 Mc[i](a),o)};return r},Dc=e=>uO(new Map,e)(0),$n="",{toString:dO}={},{keys:fO}=Object,dr=e=>{const t=typeof e;if(t!=="object"||!e)return[gi,t];const n=dO.call(e).slice(8,-1);switch(n){case"Array":return[yr,$n];case"Object":return[Ro,$n];case"Date":return[Vs,$n];case"RegExp":return[Us,$n];case"Map":return[Zs,$n];case"Set":return[Hs,$n];case"DataView":return[yr,n]}return n.includes("Array")?[yr,n]:n.includes("Error")?[$m,n]:[Ro,n]},lo=([e,t])=>e===gi&&(t==="function"||t==="symbol"),pO=(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]=dr(a);switch(s){case gi:{let d=a;switch(l){case"bigint":s=zm,d=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);d=null;break;case"undefined":return o([Dm],a)}return o([s,d],a)}case yr:{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 Ro:{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 fO(a))(e||!lo(dr(a[p])))&&d.push([i(p),i(a[p])]);return u}case Vs:return o([s,a.toISOString()],a);case Us:{const{source:d,flags:u}=a;return o([s,{source:d,flags:u}],a)}case Zs:{const d=[],u=o([s,d],a);for(const[p,h]of a)(e||!(lo(dr(p))||lo(dr(h))))&&d.push([i(p),i(h)]);return u}case Hs:{const d=[],u=o([s,d],a);for(const p of a)(e||!lo(dr(p)))&&d.push(i(p));return u}}const{message:c}=a;return o([s,{name:l,message:c}],a)};return i},$c=(e,{json:t,lossy:n}={})=>{const r=[];return pO(!(t||n),!!t,new Map,r)(e),r},jo=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Dc($c(e,t)):structuredClone(e):(e,t)=>Dc($c(e,t));function hO(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 mO(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function gO(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||hO,r=e.options.footnoteBackLabel||mO,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=ir(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:{...jo(a),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
102
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:`
103
+ `}]}}const vi=(function(e){if(e==null)return yO;if(typeof e=="function")return xi(e);if(typeof e=="object")return Array.isArray(e)?vO(e):xO(e);if(typeof e=="string")return bO(e);throw new Error("Expected function, string, or object as test")});function vO(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=vi(e[n]);return xi(r);function r(...o){let i=-1;for(;++i<t.length;)if(t[i].apply(this,o))return!0;return!1}}function xO(e){const t=e;return xi(n);function n(r){const o=r;let i;for(i in e)if(o[i]!==t[i])return!1;return!0}}function bO(e){return xi(t);function t(n){return n&&n.type===e}}function xi(e){return t;function t(n,r,o){return!!(wO(n)&&e.call(this,n,typeof r=="number"?r:void 0,o||void 0))}}function yO(){return!0}function wO(e){return e!==null&&typeof e=="object"&&"type"in e}const Lm=[],kO=!0,Na=!1,SO="skip";function Fm(e,t,n,r){let o;typeof t=="function"&&typeof n!="function"?(r=n,n=t):o=t;const i=vi(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=Lm,v,g,b;if((!t||i(l,c,d[d.length-1]||void 0))&&(h=CO(n(l,d)),h[0]===Na))return h;if("children"in l&&l.children){const x=l;if(x.children&&h[0]!==SO)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]===Na)return v;g=typeof v[1]=="number"?v[1]:g+a}}return h}}}function CO(e){return Array.isArray(e)?e:typeof e=="number"?[kO,e]:e==null?Lm:[e]}function Gs(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),Fm(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 Ia={}.hasOwnProperty,_O={};function EO(e,t){const n=t||_O,r=new Map,o=new Map,i=new Map,a={...cO,...n.handlers},s={all:c,applyData:PO,definitionById:r,footnoteById:o,footnoteCounts:i,footnoteOrder:[],handlers:a,one:l,options:n,patch:TO,wrap:IO};return Gs(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(Ia.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=jo(b);return x.children=s.all(d),x}return jo(d)}return(s.options.unknownHandler||NO)(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=zc(v.value)),!Array.isArray(v)&&v.type==="element")){const g=v.children[0];g&&g.type==="text"&&(g.value=zc(g.value))}Array.isArray(v)?u.push(...v):u.push(v)}}}return u}}function TO(e,t){e.position&&(t.position=mA(e))}function PO(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,jo(i)),"children"in n&&n.children&&o!==null&&o!==void 0&&(n.children=o)}return n}function NO(e,t){const n=t.data||{},r="value"in t&&!(Ia.call(n,"hProperties")||Ia.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 IO(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
104
+ `});++r<e.length;)r&&n.push({type:"text",value:`
105
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
106
+ `}),n}function zc(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Lc(e,t){const n=EO(e,t),r=n.one(e,void 0),o=gO(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&i.children.push({type:"text",value:`
107
+ `},o),i}function AO(e,t){return e&&"run"in e?async function(n,r){const o=Lc(n,{file:r,...t});await e.run(o,r)}:function(n,r){return Lc(n,{file:r,...e||t})}}function Fc(e){if(e)throw e}var Bi,Bc;function RO(){if(Bc)return Bi;Bc=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 Bi=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},Bi}var jO=RO();const Vi=ou(jO);function Aa(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 OO(){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?MO(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 MO(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:DO,dirname:$O,extname:zO,join:LO,sep:"/"};function DO(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Gr(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 $O(e){if(Gr(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 zO(e){Gr(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 LO(...e){let t=-1,n;for(;++t<e.length;)Gr(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":FO(n)}function FO(e){Gr(e);const t=e.codePointAt(0)===47;let n=BO(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function BO(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 Gr(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const VO={cwd:UO};function UO(){return"/"}function Ra(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function ZO(e){if(typeof e=="string")e=new URL(e);else if(!Ra(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 HO(e)}function HO(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 Ui=["history","path","basename","stem","extname","dirname"];class Bm{constructor(t){let n;t?Ra(t)?n={path:t}:typeof t=="string"||GO(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":VO.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Ui.length;){const i=Ui[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)Ui.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?jt.basename(this.path):void 0}set basename(t){Hi(t,"basename"),Zi(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){Vc(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(Zi(t,"extname"),Vc(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){Ra(t)&&(t=ZO(t)),Hi(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){Hi(t,"stem"),Zi(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 tt(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 Zi(e,t){if(e&&e.includes(jt.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+jt.sep+"`")}function Hi(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Vc(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function GO(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const WO=(function(e){const r=this.constructor.prototype,o=r[e],i=function(){return o.apply(i,arguments)};return Object.setPrototypeOf(i,r),i}),qO={}.hasOwnProperty;class Ws extends WO{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=OO()}copy(){const t=new Ws;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Vi(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(qi("data",this.frozen),this.namespace[t]=n,this):qO.call(this.namespace,t)&&this.namespace[t]||void 0:t?(qi("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=co(t),r=this.parser||this.Parser;return Gi("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Gi("process",this.parser||this.Parser),Wi("process",this.compiler||this.Compiler),n?o(void 0,n):new Promise(o);function o(i,a){const s=co(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);YO(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(),Gi("processSync",this.parser||this.Parser),Wi("processSync",this.compiler||this.Compiler),this.process(t,o),Zc("processSync","process",n),r;function o(i,a){n=!0,Fc(i),r=a}}run(t,n,r){Uc(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=co(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),Zc("runSync","run",r),o;function i(a,s){Fc(a),o=s,r=!0}}stringify(t,n){this.freeze();const r=co(n),o=this.compiler||this.Compiler;return Wi("stringify",o),Uc(t),o(t,r)}use(t,...n){const r=this.attachers,o=this.namespace;if(qi("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=Vi(!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];Aa(g)&&Aa(h)&&(h=Vi(!0,g,h)),r[p]=[c,h,...v]}}}}const KO=new Ws().freeze();function Gi(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Wi(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function qi(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 Uc(e){if(!Aa(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Zc(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function co(e){return JO(e)?e:new Bm(e)}function JO(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function YO(e){return typeof e=="string"||XO(e)}function XO(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const QO="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Hc=[],Gc={allowDangerousHtml:!0},eM=/^(https?|ircs?|mailto|xmpp)$/i,tM=[{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 nM(e){const t=rM(e),n=oM(e);return iM(t.runSync(t.parse(n),n),e)}function rM(e){const t=e.rehypePlugins||Hc,n=e.remarkPlugins||Hc,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Gc}:Gc;return KO().use($j).use(n).use(AO,r).use(t)}function oM(e){const t=e.children||"",n=new Bm;return typeof t=="string"&&(n.value=t),n}function iM(e,t){const n=t.allowedElements,r=t.allowElement,o=t.components,i=t.disallowedElements,a=t.skipHtml,s=t.unwrapDisallowed,l=t.urlTransform||aM;for(const d of tM)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+QO+d.id,void 0);return Gs(e,c),yA(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 zi)if(Object.hasOwn(zi,h)&&Object.hasOwn(d.properties,h)){const v=d.properties[h],g=zi[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 aM(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||eM.test(e.slice(0,t))?e:""}function Wc(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 sM(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function lM(e,t,n){const o=vi((n||{}).ignore||[]),i=cM(t);let a=-1;for(;++a<i.length;)Fm(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 cM(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([uM(o[0]),dM(o[1])])}return t}function uM(e){return typeof e=="string"?new RegExp(sM(e),"g"):e}function dM(e){return typeof e=="function"?e:function(){return e}}const Ki="phrasing",Ji=["autolink","link","image","label"];function fM(){return{transforms:[bM],enter:{literalAutolink:hM,literalAutolinkEmail:Yi,literalAutolinkHttp:Yi,literalAutolinkWww:Yi},exit:{literalAutolink:xM,literalAutolinkEmail:vM,literalAutolinkHttp:mM,literalAutolinkWww:gM}}}function pM(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Ki,notInConstruct:Ji},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Ki,notInConstruct:Ji},{character:":",before:"[ps]",after:"\\/",inConstruct:Ki,notInConstruct:Ji}]}}function hM(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Yi(e){this.config.enter.autolinkProtocol.call(this,e)}function mM(e){this.config.exit.autolinkProtocol.call(this,e)}function gM(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 vM(e){this.config.exit.autolinkEmail.call(this,e)}function xM(e){this.exit(e)}function bM(e){lM(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,yM],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),wM]],{ignore:["link","linkReference"]})}function yM(e,t,n,r,o){let i="";if(!Vm(o)||(/^w/i.test(t)&&(n=t+n,t="",i="http://"),!kM(n)))return!1;const a=SM(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 wM(e,t,n,r){return!Vm(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function kM(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 SM(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=Wc(e,"(");let i=Wc(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 Vm(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||wn(n)||hi(n))&&(!t||n!==47)}Um.peek=RM;function CM(){this.buffer()}function _M(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function EM(){this.buffer()}function TM(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function PM(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=_t(this.sliceSerialize(e)).toLowerCase(),n.label=t}function NM(e){this.exit(e)}function IM(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=_t(this.sliceSerialize(e)).toLowerCase(),n.label=t}function AM(e){this.exit(e)}function RM(){return"["}function Um(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 jM(){return{enter:{gfmFootnoteCallString:CM,gfmFootnoteCall:_M,gfmFootnoteDefinitionLabelString:EM,gfmFootnoteDefinition:TM},exit:{gfmFootnoteCallString:PM,gfmFootnoteCall:NM,gfmFootnoteDefinitionLabelString:IM,gfmFootnoteDefinition:AM}}}function OM(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Um},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?`
108
+ `:" ")+i.indentLines(i.containerFlow(r,s.current()),t?Zm:MM))),c(),l}}function MM(e,t,n){return t===0?e:Zm(e,t,n)}function Zm(e,t,n){return(n?"":" ")+e}const DM=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Hm.peek=BM;function $M(){return{canContainEols:["delete"],enter:{strikethrough:LM},exit:{strikethrough:FM}}}function zM(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:DM}],handlers:{delete:Hm}}}function LM(e){this.enter({type:"delete",children:[]},e)}function FM(e){this.exit(e)}function Hm(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 BM(){return"~"}function VM(e){return e.length}function UM(e,t){const n=t||{},r=(n.align||[]).concat(),o=n.stringLength||VM,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=ZM(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]=qc(r[u]);else{const g=qc(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(`
109
+ `)}function ZM(e){return e==null?"":String(e)}function qc(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 HM(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()),GM);return o(),a}function GM(e,t,n){return">"+(n?"":" ")+e}function WM(e,t){return Kc(e,t.inConstruct,!0)&&!Kc(e,t.notInConstruct,!1)}function Kc(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 Jc(e,t,n,r){let o=-1;for(;++o<n.unsafe.length;)if(n.unsafe[o].character===`
110
+ `&&WM(n.stack,n.unsafe[o]))return/[ \t]/.test(r.before)?"":" ";return`\\
111
+ `}function qM(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 KM(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 JM(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 YM(e,t,n,r){const o=JM(n),i=e.value||"",a=o==="`"?"GraveAccent":"Tilde";if(KM(e,n)){const u=n.enter("codeIndented"),p=n.indentLines(i,XM);return u(),p}const s=n.createTracker(r),l=o.repeat(Math.max(qM(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:`
112
+ `,encode:["`"],...s.current()})),u()}return d+=s.move(`
113
+ `),i&&(d+=s.move(i+`
114
+ `)),d+=s.move(l),c(),d}function XM(e,t,n){return(n?"":" ")+e}function qs(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 QM(e,t,n,r){const o=qs(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?" ":`
115
+ `,...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 eD(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 Nr(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Oo(e,t,n){const r=Jn(e),o=Jn(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}}Gm.peek=tD;function Gm(e,t,n,r){const o=eD(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=Oo(r.before.charCodeAt(r.before.length-1),c,o);d.inside&&(l=Nr(c)+l.slice(1));const u=l.charCodeAt(l.length-1),p=Oo(r.after.charCodeAt(0),u,o);p.inside&&(l=l.slice(0,-1)+Nr(u));const h=a.move(o);return i(),n.attentionEncodeSurroundingInfo={after:p.outside,before:d.outside},s+l+h}function tD(e,t,n){return n.options.emphasis||"*"}function nD(e,t){let n=!1;return Gs(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Na}),!!((!e.depth||e.depth<3)&&Ls(e)&&(t.options.setext||n))}function rD(e,t,n,r){const o=Math.max(Math.min(6,e.depth||1),1),i=n.createTracker(r);if(nD(e,n)){const d=n.enter("headingSetext"),u=n.enter("phrasing"),p=n.containerPhrasing(e,{...i.current(),before:`
116
+ `,after:`
117
+ `});return u(),d(),p+`
118
+ `+(o===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(`
119
+ `))+1))}const a="#".repeat(o),s=n.enter("headingAtx"),l=n.enter("phrasing");i.move(a+" ");let c=n.containerPhrasing(e,{before:"# ",after:`
120
+ `,...i.current()});return/^[\t ]/.test(c)&&(c=Nr(c.charCodeAt(0))+c.slice(1)),c=c?a+" "+c:a,n.options.closeAtx&&(c+=" "+a),l(),s(),c}Wm.peek=oD;function Wm(e){return e.value||""}function oD(){return"<"}qm.peek=iD;function qm(e,t,n,r){const o=qs(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 iD(){return"!"}Km.peek=aD;function Km(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 aD(){return"!"}Jm.peek=sD;function Jm(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 sD(){return"`"}function Ym(e,t){const n=Ls(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))}Xm.peek=lD;function Xm(e,t,n,r){const o=qs(n),i=o==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let s,l;if(Ym(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 lD(e,t,n){return Ym(e,n)?"<":"["}Qm.peek=cD;function Qm(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 cD(){return"["}function Ks(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 uD(e){const t=Ks(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 dD(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 eg(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 fD(e,t,n,r){const o=n.enter("list"),i=n.bulletCurrent;let a=e.ordered?dD(n):Ks(n);const s=e.ordered?a==="."?")":".":uD(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),eg(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 pD(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 hD(e,t,n,r){const o=pD(n);let i=n.bulletCurrent||Ks(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 mD(e,t,n,r){const o=n.enter("paragraph"),i=n.enter("phrasing"),a=n.containerPhrasing(e,r);return i(),o(),a}const gD=vi(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function vD(e,t,n,r){return(e.children.some(function(a){return gD(a)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function xD(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}tg.peek=bD;function tg(e,t,n,r){const o=xD(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=Oo(r.before.charCodeAt(r.before.length-1),c,o);d.inside&&(l=Nr(c)+l.slice(1));const u=l.charCodeAt(l.length-1),p=Oo(r.after.charCodeAt(0),u,o);p.inside&&(l=l.slice(0,-1)+Nr(u));const h=a.move(o+o);return i(),n.attentionEncodeSurroundingInfo={after:p.outside,before:d.outside},s+l+h}function bD(e,t,n){return n.options.strong||"*"}function yD(e,t,n,r){return n.safe(e.value,r)}function wD(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 kD(e,t,n){const r=(eg(n)+(n.options.ruleSpaces?" ":"")).repeat(wD(n));return n.options.ruleSpaces?r.slice(0,-1):r}const ng={blockquote:HM,break:Jc,code:YM,definition:QM,emphasis:Gm,hardBreak:Jc,heading:rD,html:Wm,image:qm,imageReference:Km,inlineCode:Jm,link:Xm,linkReference:Qm,list:fD,listItem:hD,paragraph:mD,root:vD,strong:tg,text:yD,thematicBreak:kD};function SD(){return{enter:{table:CD,tableData:Yc,tableHeader:Yc,tableRow:ED},exit:{codeText:TD,table:_D,tableData:Xi,tableHeader:Xi,tableRow:Xi}}}function CD(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 _D(e){this.exit(e),this.data.inTable=void 0}function ED(e){this.enter({type:"tableRow",children:[]},e)}function Xi(e){this.exit(e)}function Yc(e){this.enter({type:"tableCell",children:[]},e)}function TD(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,PD));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function PD(e,t){return t==="|"?t:e}function ND(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,o=t.stringLength,i=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
121
+ `,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(`
122
+ `))}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 UM(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=ng.inlineCode(h,v,g);return g.stack.includes("tableCell")&&(b=b.replace(/\|/g,"\\$&")),b}}function ID(){return{exit:{taskListCheckValueChecked:Xc,taskListCheckValueUnchecked:Xc,paragraph:RD}}}function AD(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:jD}}}function Xc(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function RD(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 jD(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=ng.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 OD(){return[fM(),jM(),$M(),SD(),ID()]}function MD(e){return{extensions:[pM(),OM(e),zM(),ND(e),AD()]}}const DD={tokenize:VD,partial:!0},rg={tokenize:UD,partial:!0},og={tokenize:ZD,partial:!0},ig={tokenize:HD,partial:!0},$D={tokenize:GD,partial:!0},ag={name:"wwwAutolink",tokenize:FD,previous:lg},sg={name:"protocolAutolink",tokenize:BD,previous:cg},Vt={name:"emailAutolink",tokenize:LD,previous:ug},zt={};function zD(){return{text:zt}}let fn=48;for(;fn<123;)zt[fn]=Vt,fn++,fn===58?fn=65:fn===91&&(fn=97);zt[43]=Vt;zt[45]=Vt;zt[46]=Vt;zt[95]=Vt;zt[72]=[Vt,sg];zt[104]=[Vt,sg];zt[87]=[Vt,ag];zt[119]=[Vt,ag];function LD(e,t,n){const r=this;let o,i;return a;function a(u){return!ja(u)||!ug.call(r,r.previous)||Js(r.events)?n(u):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),s(u))}function s(u){return ja(u)?(e.consume(u),s):u===64?(e.consume(u),l):n(u)}function l(u){return u===46?e.check($D,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&&rt(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(u)):n(u)}}function FD(e,t,n){const r=this;return o;function o(a){return a!==87&&a!==119||!lg.call(r,r.previous)||Js(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(DD,e.attempt(rg,e.attempt(og,i),n),n)(a))}function i(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function BD(e,t,n){const r=this;let o="",i=!1;return a;function a(u){return(u===72||u===104)&&cg.call(r,r.previous)&&!Js(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(u),e.consume(u),s):n(u)}function s(u){if(rt(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||Ao(u)||Se(u)||wn(u)||hi(u)?n(u):e.attempt(rg,e.attempt(og,d),n)(u)}function d(u){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(u)}}function VD(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 UD(e,t,n){let r,o,i;return a;function a(c){return c===46||c===95?e.check(ig,l,s)(c):c===null||Se(c)||wn(c)||c!==45&&hi(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 ZD(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(ig,t,i)(a):a===null||Se(a)||wn(a)?t(a):(e.consume(a),o)}function i(a){return a===41&&r++,e.consume(a),o}}function HD(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)||wn(s)?t(s):n(s)}function o(s){return s===null||s===40||s===91||Se(s)||wn(s)?t(s):r(s)}function i(s){return rt(s)?a(s):n(s)}function a(s){return s===59?(e.consume(s),r):rt(s)?(e.consume(s),a):n(s)}}function GD(e,t,n){return r;function r(i){return e.consume(i),o}function o(i){return Xe(i)?n(i):t(i)}}function lg(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Se(e)}function cg(e){return!rt(e)}function ug(e){return!(e===47||ja(e))}function ja(e){return e===43||e===45||e===46||e===95||Xe(e)}function Js(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 WD={tokenize:t$,partial:!0};function qD(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:XD,continuation:{tokenize:QD},exit:e$}},text:{91:{name:"gfmFootnoteCall",tokenize:YD},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:KD,resolveTo:JD}}}}function KD(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=_t(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 JD(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 YD(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(_t(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 XD(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=_t(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),xe(e,h,"gfmFootnoteDefinitionWhitespace")):n(v)}function h(v){return t(v)}}function QD(e,t,n){return e.check(Hr,t,e.attempt(WD,t,n))}function e$(e){e.exit("gfmFootnoteDefinition")}function t$(e,t,n){const r=this;return xe(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 n$(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,mi(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=Jn(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=Jn(v);return b._open=!x||x===2&&!!g,b._close=!g||g===2&&!!x,s(v)}}}class r${constructor(){this.map=[]}add(t,n,r){o$(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 o$(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 i$(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 a$(){return{flow:{null:{name:"table",tokenize:s$,resolveAll:l$}}}}function s$(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 I=N>-1?r.events[N][1].type:null,j=I==="tableHead"||I==="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)?xe(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)?xe(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)?xe(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)?xe(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)?xe(e,T,"whitespace")(E):(e.enter("data"),A(E))}function A(E){return E===null||E===124||Se(E)?(e.exit("data"),T(E)):(e.consume(E),E===92?R:A)}function R(E){return E===92||E===124?(e.consume(E),A):A(E)}}function l$(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 r$;for(;++n<e.length;){const h=e[n],v=h[1];h[0]==="enter"?v.type==="tableHead"?(s=!1,l!==0&&(Qc(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=uo(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=uo(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=uo(p,t,i,o,n,u)):a[1]!==0&&(u=uo(p,t,a,o,n,u)),o=0):o&&(v.type==="data"||v.type==="tableDelimiterMarker"||v.type==="tableDelimiterFiller")&&(a[3]=n)}for(l!==0&&Qc(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=i$(t.events,n))}return e}function uo(e,t,n,r,o,i){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",s="tableContent";n[0]!==0&&(i.end=Object.assign({},Ln(t.events,n[0])),e.add(n[0],0,[["exit",i,t]]));const l=Ln(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=Ln(t.events,n[2]),d=Ln(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({},Ln(t.events,o)),e.add(o,0,[["exit",i,t]]),i=void 0),i}function Qc(e,t,n,r,o){const i=[],a=Ln(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 Ln(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const c$={name:"tasklistCheck",tokenize:d$};function u$(){return{text:{91:c$}}}function d$(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:f$},t,n)(l):n(l)}}function f$(e,t,n){return xe(e,r,"whitespace");function r(o){return o===null?n(o):t(o)}}function p$(e){return wm([zD(),qD(),n$(e),a$(),u$()])}const h$={};function m$(e){const t=this,n=e||h$,r=t.data(),o=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);o.push(p$(n)),i.push(OD()),a.push(MD(n))}function g$(e){return(e.result??e.partialResult)?.content?.find(r=>r?.type==="text")?.text??""}function v$({execution:e,expanded:t,onToggleExpand:n}){const r=g$(e),o=String(e.args?.pattern??"");return f.jsxs(kn,{children:[f.jsx(Sn,{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(fv,{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(Yn,{className:"py-2 px-3",children:f.jsx("pre",{className:"text-xs whitespace-pre-wrap overflow-x-auto",children:r||"(no matches)"})})]})}function x$(e){return(e.result??e.partialResult)?.content?.find(r=>r?.type==="text")?.text??""}function b$({execution:e,expanded:t,onToggleExpand:n}){const r=x$(e),o=String(e.args?.path??".");return f.jsxs(kn,{children:[f.jsx(Sn,{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-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(Yn,{className:"py-2 px-3",children:f.jsx("pre",{className:"text-xs whitespace-pre-wrap overflow-x-auto",children:r||"(empty directory)"})})]})}function y$(e){return(e.result??e.partialResult)?.content?.find(r=>r?.type==="text")?.text??""}function w$({execution:e,expanded:t,onToggleExpand:n}){const r=y$(e),o=String(e.args?.path??"");return f.jsxs(kn,{children:[f.jsx(Sn,{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(rv,{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(Yn,{className:"py-2 px-3",children:f.jsx("pre",{className:"text-xs whitespace-pre-wrap overflow-x-auto",children:r||"(empty)"})})]})}function k$({execution:e}){const t=String(e.args?.path??"");return f.jsx(kn,{children:f.jsx(Sn,{className:"py-2 px-3",children:f.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[f.jsx(tv,{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 S$={bash:Ev,read:w$,write:k$,edit:Tv,grep:v$,find:Nv,ls:b$};function C$(e){return Object.hasOwn(S$,e)}function _$(e){return e==="error"?"destructive":e==="running"?"secondary":"outline"}function E$(e){const t=e.result??e.partialResult,n=t?.content?.find(r=>"type"in r&&r.type==="text"&&"text"in r&&typeof r.text=="string");return n?.text?n.text:t?.details?JSON.stringify(t.details,null,2):e.status==="running"?"Running…":"No output"}function eu(e){return new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function T$({disabled:e}){const[t,n]=m.useState(!1),r=hn(Ig,a=>a.executionOrder.map(s=>a.executions[s]).filter(s=>!!s).filter(s=>C$(s.toolName))),o=r.filter(a=>a.status==="running").length,i=m.useMemo(()=>[...r].sort((a,s)=>s.startTime-a.startTime),[r]);return f.jsxs(f.Fragment,{children:[f.jsxs(Et,{type:"button",variant:"outline",size:"sm",disabled:e,onClick:()=>n(!0),className:"gap-2",children:[f.jsx(Gg,{className:"h-4 w-4"}),"Tool activity",f.jsx(ol,{variant:o>0?"secondary":"outline",children:o>0?`${o} running`:r.length})]}),f.jsx(Ag,{open:t,onOpenChange:n,children:f.jsxs(Rg,{side:"right",className:"w-full sm:max-w-xl",children:[f.jsxs(jg,{children:[f.jsx(Og,{children:"Tool activity"}),f.jsx(Mg,{children:"Built-in tool calls from this session."})]}),f.jsx("div",{className:"flex-1 overflow-y-auto px-4 pb-4",children:i.length===0?f.jsx("div",{className:"rounded-md border border-dashed border-border p-4 text-sm text-muted-foreground",children:"No built-in tool calls yet."}):f.jsx("div",{className:"space-y-3",children:i.map(a=>f.jsxs("details",{className:"rounded-md border border-border bg-card",children:[f.jsxs("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-3 px-3 py-2",children:[f.jsxs("div",{className:"min-w-0",children:[f.jsx("p",{className:"truncate text-sm font-medium",children:a.toolName}),f.jsx("p",{className:"text-xs text-muted-foreground",children:eu(a.startTime)})]}),f.jsx(ol,{variant:_$(a.status),children:a.status})]}),f.jsxs("div",{className:"space-y-2 border-t border-border px-3 py-2",children:[f.jsxs("div",{children:[f.jsx("p",{className:"mb-1 text-xs font-medium text-muted-foreground",children:"Args"}),f.jsx("pre",{className:"max-h-32 overflow-auto whitespace-pre-wrap rounded bg-muted p-2 text-xs",children:JSON.stringify(a.args,null,2)})]}),f.jsxs("div",{children:[f.jsx("p",{className:"mb-1 text-xs font-medium text-muted-foreground",children:"Result"}),f.jsx("pre",{className:mn("max-h-52 overflow-auto whitespace-pre-wrap rounded bg-muted p-2 text-xs",a.status==="error"&&"border border-destructive/30"),children:E$(a)})]}),a.endTime&&f.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[f.jsx(su,{className:"h-3 w-3"}),"Completed at ",eu(a.endTime)]})]})]},a.toolCallId))})})]})})]})}const tu=10*1024*1024,nu=20*1024*1024;function P$(){const{sessionId:e,isStreaming:t}=hn(Oa,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 A=new FileReader;A.onload=()=>{const E=A.result.split(",")[1];C(E)},A.onerror=T,A.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),A=C.reduce((R,E)=>R+E.size,0);if(T+A>nu){alert(`Total attachment size cannot exceed ${nu/1024/1024}MB`);return}for(const R of C){if(R.size>tu){alert(`File "${R.name}" is too large. Maximum size is ${tu/1024/1024}MB`);continue}try{const E=await d(R),N=await u(R),I={id:`${Date.now()}-${Math.random().toString(36).slice(2)}`,file:R,preview:N,base64:E,mimeType:R.type};i(j=>[...j,I])}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 A of Array.from(C))if(A.kind==="file"){const R=A.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.map(I=>({type:I.mimeType.startsWith("image/")?"image":"file",name:I.file.name,mimeType:I.mimeType,previewUrl:I.preview})),A=C.filter(I=>I.mimeType.startsWith("image/")).map(I=>({type:"image",data:I.base64,mimeType:I.mimeType})),R=C.filter(I=>!I.mimeType.startsWith("image/")),E=go.getClient();if(!E){console.error("No client available");return}let N=P;try{for(const j of R)try{const $=await E.uploadAttachment(e,j.file.name,j.base64,j.mimeType);N+=`
123
+ [Attached: ${$.fileName}]`}catch($){console.error(`Failed to upload ${j.file.name}:`,$)}const I=N.replace(/(?:^|\n)\[Attached: [^\]]+\]/g,"").replace(/\n{3,}/g,`
124
+
125
+ `).trim();$g(I,T),await E.prompt(e,N,A.length>0?A:void 0)}catch(I){console.error("Failed to send message:",I)}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(bv,{attachments:o,onRemove:y}),f.jsxs("div",{className:"relative",children:[f.jsx(Dg,{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(uv,{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(T$,{disabled:!e}),f.jsx(Sv,{}),f.jsxs(Et,{onClick:w,disabled:!n.trim()&&o.length===0||!e||t,size:"icon",children:[f.jsx(hv,{className:"h-4 w-4"}),f.jsx("span",{className:"sr-only",children:"Send message"})]})]})]})]})})}function N$(e){const t=e.trim().replace(/\s+/g," ");return t?t.length<=50?t:`${t.slice(0,50)}…`:"Assistant response"}function I$({message:e}){const[t,n]=m.useState(!1),r=e.thinkingContent??e.persistedThinkingContent??"",o=r.length>0;return f.jsxs(f.Fragment,{children:[o&&f.jsxs("div",{className:"mb-3",children:[f.jsxs("button",{className:"flex w-full items-center justify-between rounded-md border border-border bg-background/60 px-3 py-2 text-left text-sm",onClick:()=>n(i=>!i),type:"button",children:[f.jsx("span",{className:"font-medium text-foreground",children:N$(e.content)}),f.jsx(au,{className:mn("h-4 w-4 text-muted-foreground transition-transform",t&&"rotate-180")})]}),t&&f.jsx("div",{className:"mt-2 space-y-3 rounded-md border border-border bg-background/40 p-3",children:f.jsxs("div",{className:"space-y-1.5 text-xs",children:[f.jsxs("div",{className:"flex items-center gap-1.5 text-muted-foreground",children:[f.jsx(su,{className:"h-3.5 w-3.5"}),f.jsx("span",{className:"font-medium",children:e.isThinking?"Thinking...":"Thinking"}),e.isThinking&&f.jsx(iu,{className:"h-3 w-3 animate-spin"})]}),f.jsx("p",{className:"whitespace-pre-wrap italic text-muted-foreground",children:r})]})})]}),f.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none",children:f.jsx(nM,{remarkPlugins:[m$],children:e.content||"..."})})]})}function A$({attachments:e}){return!e||e.length===0?null:f.jsx("div",{className:"mb-2 flex flex-wrap gap-2",children:e.map((t,n)=>{const r=`${t.type}-${t.name??"unnamed"}-${n}`;return t.type==="image"&&t.previewUrl?f.jsx("a",{href:t.previewUrl,target:"_blank",rel:"noreferrer",className:"block",children:f.jsx("img",{src:t.previewUrl,alt:t.name??"Attached image",className:"h-20 w-20 rounded-md border border-primary-foreground/25 object-cover transition-opacity hover:opacity-90"})},r):f.jsxs("div",{className:mn("inline-flex max-w-full items-center gap-2 rounded-md border px-2 py-1","border-primary-foreground/25 bg-primary-foreground/10 text-primary-foreground"),children:[f.jsx(lu,{className:"h-3.5 w-3.5 shrink-0"}),f.jsx("span",{className:"truncate text-xs font-medium",children:t.name??"Attached file"})]},r)})})}function R$({message:e}){const t=e.role==="user";return f.jsxs("div",{className:mn("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(qg,{className:"h-4 w-4"})}),f.jsxs("div",{className:mn("max-w-[80%] rounded-lg px-4 py-2",t?"bg-primary text-primary-foreground":"bg-muted"),children:[t?f.jsxs(f.Fragment,{children:[f.jsx(A$,{attachments:e.attachments}),e.content?f.jsx("p",{className:"whitespace-pre-wrap",children:e.content}):null]}):f.jsx(I$,{message:e}),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(xv,{className:"h-4 w-4"})})]})}function j$(){const{messages:e}=hn(zg,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(R$,{message:n},n.id)),f.jsx("div",{ref:t})]})}function z$(){const{sessionId:e}=Lg.useParams(),t=Fg(),{status:n}=hn(Bg,i=>({status:i.status})),{sessionId:r}=hn(Oa,i=>({sessionId:i.sessionId}));hn(Vg,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(j$,{}),f.jsx(P$,{})]}):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(Ug,{to:"/settings",children:f.jsxs(Et,{children:[f.jsx(Zg,{className:"mr-2 h-4 w-4"}),"Go to Settings"]})})]})})}export{z$ as component};