diff --git "a/assets/MethodDetailView-744eEYiY.js" "b/assets/MethodDetailView-744eEYiY.js" new file mode 100644--- /dev/null +++ "b/assets/MethodDetailView-744eEYiY.js" @@ -0,0 +1,35 @@ +import{j as x,M as at,N as Mr,G as ol,r as yt,L as al,K as sl}from"./index-BweDl4mr.js";import{u as Sn}from"./adminAuth-BZDv4UsB.js";import{u as ul}from"./useInfiniteQuery-CUoz5Tw7.js";import{M as cl,P as fl}from"./components-COmxvfIt.js";import{k as Cn}from"./LatexTitle-B-M2HH9Z.js";import{a as kt}from"./api-Ca8jnqEE.js";import{a as hl}from"./transform-C_ONUuGe.js";import{u as pl}from"./useIntersectionObserver-D5E-YGat.js";import{S as bt,A as ml,a as dl}from"./alert-CHLQVC_X.js";const k={pink:"#F8D7D9",pinkS:"#D9B0B3",yellow:"#FBEFC2",yellowS:"#C9B97D",orange:"#F8D7B3",orangeS:"#C99466",blue:"#CDE2EE",blueS:"#7FA4BA",purple:"#D4D2EA",purpleS:"#8E8AC0",green:"#CCE2C5",greenS:"#7DA475",ink:"#1A1814",faint:"#8E8678"},_=({x:e,y:t,w:n,h:r,fill:i,stroke:o,label:l,fontSize:a=10,multiline:s})=>x.jsxs("g",{children:[x.jsx("rect",{x:e,y:t,width:n,height:r,rx:"3",ry:"3",fill:i,stroke:o,strokeWidth:"1"}),s?x.jsxs(x.Fragment,{children:[x.jsx("text",{x:e+n/2,y:t+r/2-2,fontSize:a,fontFamily:"var(--sans)",fill:k.ink,textAnchor:"middle",dominantBaseline:"middle",children:s[0]}),x.jsx("text",{x:e+n/2,y:t+r/2+a-1,fontSize:a,fontFamily:"var(--sans)",fill:k.ink,textAnchor:"middle",dominantBaseline:"middle",children:s[1]})]}):x.jsx("text",{x:e+n/2,y:t+r/2,fontSize:a,fontFamily:"var(--sans)",fill:k.ink,textAnchor:"middle",dominantBaseline:"middle",children:l})]}),gl=()=>x.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[x.jsx("text",{x:"180",y:"14",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:k.faint,textAnchor:"middle",children:"Output Probabilities"}),x.jsx("path",{d:"M180 22 L180 32",stroke:k.ink,strokeWidth:"1.2"}),x.jsx(_,{x:150,y:32,w:60,h:20,fill:k.green,stroke:k.greenS,label:"Softmax"}),x.jsx("path",{d:"M180 52 L180 62",stroke:k.ink,strokeWidth:"1.2"}),x.jsx(_,{x:150,y:62,w:60,h:20,fill:k.purple,stroke:k.purpleS,label:"Linear"}),x.jsx("path",{d:"M180 82 L180 92",stroke:k.ink,strokeWidth:"1.2"}),x.jsx("rect",{x:"50",y:"170",width:"120",height:"120",rx:"4",fill:"#EFEBE0",stroke:k.faint,strokeWidth:"1",strokeDasharray:"3 2"}),x.jsx("text",{x:"20",y:"232",fontSize:"11",fontFamily:"var(--serif)",fill:k.faint,children:"N×"}),x.jsx(_,{x:70,y:180,w:80,h:18,fill:k.yellow,stroke:k.yellowS,label:"Add & Norm"}),x.jsx(_,{x:70,y:200,w:80,h:28,fill:k.blue,stroke:k.blueS,multiline:["Feed","Forward"]}),x.jsx(_,{x:70,y:236,w:80,h:18,fill:k.yellow,stroke:k.yellowS,label:"Add & Norm"}),x.jsx(_,{x:70,y:256,w:80,h:28,fill:k.orange,stroke:k.orangeS,multiline:["Multi-Head","Attention"]}),x.jsx("rect",{x:"190",y:"92",width:"120",height:"200",rx:"4",fill:"#EFEBE0",stroke:k.faint,strokeWidth:"1",strokeDasharray:"3 2"}),x.jsx("text",{x:"320",y:"195",fontSize:"11",fontFamily:"var(--serif)",fill:k.faint,children:"N×"}),x.jsx(_,{x:210,y:102,w:80,h:18,fill:k.yellow,stroke:k.yellowS,label:"Add & Norm"}),x.jsx(_,{x:210,y:122,w:80,h:28,fill:k.blue,stroke:k.blueS,multiline:["Feed","Forward"]}),x.jsx(_,{x:210,y:158,w:80,h:18,fill:k.yellow,stroke:k.yellowS,label:"Add & Norm"}),x.jsx(_,{x:210,y:178,w:80,h:28,fill:k.orange,stroke:k.orangeS,multiline:["Multi-Head","Attention"]}),x.jsx(_,{x:210,y:216,w:80,h:18,fill:k.yellow,stroke:k.yellowS,label:"Add & Norm"}),x.jsx(_,{x:210,y:236,w:80,h:28,fill:k.orange,stroke:k.orangeS,multiline:["Masked MH","Attention"]}),x.jsx("path",{d:"M150 220 L195 192",stroke:k.ink,strokeWidth:"1.2",fill:"none"}),x.jsx("path",{d:"M150 220 L195 200",stroke:k.ink,strokeWidth:"1.2",fill:"none"}),x.jsx(_,{x:70,y:340,w:80,h:26,fill:k.pink,stroke:k.pinkS,multiline:["Input","Embedding"]}),x.jsx(_,{x:210,y:340,w:80,h:26,fill:k.pink,stroke:k.pinkS,multiline:["Output","Embedding"]}),x.jsx("text",{x:"110",y:"395",fontSize:"11",fontFamily:"var(--serif)",fill:k.ink,textAnchor:"middle",children:"Inputs"}),x.jsx("text",{x:"250",y:"395",fontSize:"9",fontFamily:"var(--serif)",fontStyle:"italic",fill:k.faint,textAnchor:"middle",children:"Outputs (shifted right)"})]}),En=()=>x.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[x.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:k.faint,textAnchor:"middle",children:"Scaled Dot-Product Attention"}),x.jsx(_,{x:140,y:40,w:80,h:26,fill:k.yellow,stroke:k.yellowS,label:"MatMul",fontSize:11}),x.jsx("path",{d:"M180 66 L180 80",stroke:k.ink}),x.jsx(_,{x:140,y:80,w:80,h:26,fill:k.green,stroke:k.greenS,label:"SoftMax",fontSize:11}),x.jsx("path",{d:"M180 106 L180 120",stroke:k.ink}),x.jsx(_,{x:140,y:120,w:80,h:26,fill:k.purple,stroke:k.purpleS,label:"Mask (opt.)",fontSize:11}),x.jsx("path",{d:"M180 146 L180 160",stroke:k.ink}),x.jsx(_,{x:140,y:160,w:80,h:26,fill:k.blue,stroke:k.blueS,label:"Scale ÷√dₖ",fontSize:11}),x.jsx("path",{d:"M180 186 L180 200",stroke:k.ink}),x.jsx(_,{x:140,y:200,w:80,h:26,fill:k.yellow,stroke:k.yellowS,label:"MatMul",fontSize:11}),x.jsx("path",{d:"M156 226 L120 270",stroke:k.ink}),x.jsx("path",{d:"M180 226 L180 270",stroke:k.ink}),x.jsx("path",{d:"M204 226 L240 270",stroke:k.ink}),x.jsx(_,{x:100,y:270,w:40,h:24,fill:k.pink,stroke:k.pinkS,label:"Q",fontSize:13}),x.jsx(_,{x:160,y:270,w:40,h:24,fill:k.pink,stroke:k.pinkS,label:"K",fontSize:13}),x.jsx(_,{x:220,y:270,w:40,h:24,fill:k.pink,stroke:k.pinkS,label:"V",fontSize:13}),x.jsxs("text",{x:"180",y:"330",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:k.ink,textAnchor:"middle",children:["softmax(QK",x.jsx("tspan",{fontSize:"9",baselineShift:"super",children:"⊤"})," / √d) V"]})]}),xl=()=>x.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2,3].map(e=>{const t=30+e*75,n=60-e*8,r=240-e*30;return x.jsx("g",{children:x.jsx("rect",{x:t,y:(420-r)/2,width:n,height:r,rx:"2",fill:[k.blue,k.green,k.orange,k.purple][e],stroke:[k.blueS,k.greenS,k.orangeS,k.purpleS][e],strokeWidth:"1"})},e)}),x.jsx("text",{x:"60",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:k.faint,textAnchor:"middle",children:"conv"}),x.jsx("text",{x:"135",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:k.faint,textAnchor:"middle",children:"conv"}),x.jsx("text",{x:"210",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:k.faint,textAnchor:"middle",children:"conv"}),x.jsx("text",{x:"285",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:k.faint,textAnchor:"middle",children:"fc"})]}),An=()=>x.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2,3].map(e=>{const n=60+e*80,r=100-e*12,i=50-e*6;return x.jsx("rect",{x:50,y:n,width:r,height:i,rx:"2",fill:k.blue,stroke:k.blueS,strokeWidth:"1"},`e${e}`)}),x.jsx("rect",{x:"155",y:"320",width:"50",height:"40",rx:"2",fill:k.purple,stroke:k.purpleS}),[0,1,2,3].map(e=>{const n=60+e*80,r=100-e*12,i=50-e*6;return x.jsx("rect",{x:210,y:n,width:r,height:i,rx:"2",fill:k.green,stroke:k.greenS,strokeWidth:"1"},`d${e}`)}),[0,1,2,3].map(e=>{const t=60+e*80+(50-e*6)/2,n=50+(100-e*12);return x.jsx("path",{d:`M${n} ${t} L210 ${t}`,stroke:k.faint,strokeDasharray:"4 3"},`s${e}`)}),x.jsx("text",{x:"100",y:"40",fontSize:"10",fontFamily:"var(--mono)",fill:k.faint,textAnchor:"middle",children:"encoder"}),x.jsx("text",{x:"260",y:"40",fontSize:"10",fontFamily:"var(--mono)",fill:k.faint,textAnchor:"middle",children:"decoder"}),x.jsx("text",{x:"180",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:k.faint,textAnchor:"middle",children:"skip connections preserve high-res features"})]}),Fn=()=>x.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2].map(e=>[0,1,2].map(t=>x.jsx("rect",{x:20+t*40,y:40+e*40,width:"38",height:"38",fill:["#F8D7D9","#FBEFC2","#CDE2EE","#CCE2C5","#D4D2EA","#F8D7B3","#F8D7D9","#FBEFC2","#CDE2EE"][e*3+t],stroke:k.faint},`${e}-${t}`))),x.jsx("rect",{x:"40",y:"245",width:"280",height:"120",rx:"4",fill:"#EFEBE0",stroke:k.faint,strokeDasharray:"3 2"}),x.jsx(_,{x:70,y:258,w:220,h:20,fill:k.yellow,stroke:k.yellowS,label:"Norm"}),x.jsx(_,{x:70,y:282,w:220,h:28,fill:k.orange,stroke:k.orangeS,label:"Multi-Head Attention"}),x.jsx(_,{x:70,y:314,w:220,h:20,fill:k.yellow,stroke:k.yellowS,label:"Norm"}),x.jsx(_,{x:70,y:338,w:220,h:20,fill:k.blue,stroke:k.blueS,label:"MLP"}),x.jsx("text",{x:"180",y:"385",fontSize:"10",fontFamily:"var(--mono)",fill:k.faint,textAnchor:"middle",children:"Transformer Encoder · L×"})]}),In=()=>x.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[x.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:k.faint,textAnchor:"middle",children:"Sparse routing of tokens to k of N experts"}),x.jsx(_,{x:140,y:40,w:80,h:28,fill:k.pink,stroke:k.pinkS,label:"Token x",fontSize:11}),x.jsx(_,{x:120,y:90,w:120,h:30,fill:k.yellow,stroke:k.yellowS,label:"Router (softmax)",fontSize:11}),[0,1,2,3,4].map(e=>{const t=50+e*65,n=e===1||e===3;return x.jsxs("g",{children:[x.jsx("rect",{x:t,y:185,width:"50",height:"60",rx:"3",fill:n?k.green:"#F2EFE8",stroke:n?k.greenS:k.faint,strokeWidth:"1"}),x.jsx("text",{x:t+25,y:210,fontSize:"10",fontFamily:"var(--mono)",fill:k.ink,textAnchor:"middle",children:"FFN"}),x.jsxs("text",{x:t+25,y:228,fontSize:"9",fontFamily:"var(--mono)",fill:k.faint,textAnchor:"middle",children:["E",e+1]})]},e)}),x.jsx(_,{x:140,y:325,w:80,h:28,fill:k.purple,stroke:k.purpleS,label:"Output y",fontSize:11})]}),Tn=()=>x.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[x.jsx("text",{x:"180",y:"50",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:k.faint,textAnchor:"middle",children:"Reverse process: pure noise → sample"}),[0,1,2,3,4,5].map(e=>{const t=25+e*56,n=(5-e)/5;return x.jsxs("g",{children:[x.jsx("rect",{x:t,y:90,width:50,height:50,rx:"3",fill:`oklch(${.85-n*.1} 0.04 250)`,stroke:k.faint}),n<.4&&x.jsx("circle",{cx:t+25,cy:115,r:12-n*16,fill:k.orange,opacity:1-n*1.5})]},e)}),x.jsx("rect",{x:"60",y:"240",width:"240",height:"120",rx:"4",fill:"#FFF9EE",stroke:k.faint}),x.jsx("text",{x:"180",y:"260",fontSize:"11",fontFamily:"var(--mono)",fill:k.faint,textAnchor:"middle",children:"TRAINING OBJECTIVE"}),x.jsx("text",{x:"180",y:"295",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:k.ink,textAnchor:"middle",children:"L = E[‖ε − ε_θ(x_t, t)‖²]"})]}),yl=()=>x.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[x.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:k.faint,textAnchor:"middle",children:"Generator vs. Discriminator"}),x.jsx("circle",{cx:"50",cy:"120",r:"22",fill:k.purple,stroke:k.purpleS}),x.jsx("text",{x:"50",y:"125",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:k.ink,textAnchor:"middle",children:"z"}),x.jsx("rect",{x:"110",y:"92",width:"80",height:"56",rx:"3",fill:k.blue,stroke:k.blueS}),x.jsx("text",{x:"150",y:"124",fontSize:"14",fontFamily:"var(--mono)",fill:k.ink,textAnchor:"middle",children:"G"}),x.jsx("rect",{x:"225",y:"100",width:"40",height:"40",rx:"3",fill:k.orange,stroke:k.orangeS}),x.jsx("rect",{x:"225",y:"195",width:"40",height:"40",rx:"3",fill:k.green,stroke:k.greenS}),x.jsx("rect",{x:"290",y:"140",width:"50",height:"50",rx:"3",fill:k.pink,stroke:k.pinkS}),x.jsx("text",{x:"315",y:"170",fontSize:"14",fontFamily:"var(--mono)",fill:k.ink,textAnchor:"middle",children:"D"})]}),kl=()=>x.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[x.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:k.faint,textAnchor:"middle",children:"Variational Autoencoder"}),x.jsx("rect",{x:"30",y:"100",width:"40",height:"40",rx:"3",fill:k.green,stroke:k.greenS}),x.jsx("rect",{x:"100",y:"92",width:"60",height:"56",rx:"3",fill:k.blue,stroke:k.blueS}),x.jsx("text",{x:"130",y:"124",fontSize:"11",fontFamily:"var(--mono)",fill:k.ink,textAnchor:"middle",children:"Encoder"}),x.jsx("circle",{cx:"270",cy:"120",r:"14",fill:k.purple,stroke:k.purpleS}),x.jsx("text",{x:"270",y:"124",fontSize:"13",fontFamily:"var(--serif)",fontStyle:"italic",fill:k.ink,textAnchor:"middle",children:"z"}),x.jsx("rect",{x:"100",y:"200",width:"60",height:"56",rx:"3",fill:k.orange,stroke:k.orangeS}),x.jsx("text",{x:"130",y:"232",fontSize:"11",fontFamily:"var(--mono)",fill:k.ink,textAnchor:"middle",children:"Decoder"}),x.jsx("rect",{x:"30",y:"210",width:"40",height:"40",rx:"3",fill:k.pink,stroke:k.pinkS})]}),bl=()=>x.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[x.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:k.faint,textAnchor:"middle",children:"Three-stage post-training pipeline"}),x.jsx(_,{x:40,y:45,w:280,h:36,fill:k.green,stroke:k.greenS,label:"Supervised fine-tuning on demonstrations",fontSize:11}),x.jsx(_,{x:40,y:105,w:120,h:36,fill:k.blue,stroke:k.blueS,label:"Pairwise preferences",fontSize:10}),x.jsx(_,{x:200,y:105,w:120,h:36,fill:k.yellow,stroke:k.yellowS,label:"Reward model rθ",fontSize:11}),x.jsx(_,{x:40,y:165,w:100,h:40,fill:k.pink,stroke:k.pinkS,label:"Policy πφ (LLM)",fontSize:11}),x.jsx(_,{x:180,y:165,w:70,h:40,fill:k.orange,stroke:k.orangeS,label:"Sample y",fontSize:10}),x.jsx(_,{x:250,y:220,w:70,h:40,fill:k.yellow,stroke:k.yellowS,label:"rθ(y)",fontSize:11})]}),wl={transformer:gl,attention:En,"self-attention":En,cnn:xl,"u-net":An,unet:An,vit:Fn,"vision-transformer":Fn,"mixture-of-experts":In,moe:In,diffusion:Tn,ddpm:Tn,gan:yl,vae:kl,rlhf:bl},Sl=({method:e})=>x.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",children:[x.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:k.faint,textAnchor:"middle",children:e.name||"method"}),x.jsx(_,{x:80,y:70,w:200,h:50,fill:k.blue,stroke:k.blueS,label:"Input",fontSize:12}),x.jsx("path",{d:"M180 120 L180 150",stroke:k.ink}),x.jsx(_,{x:80,y:150,w:200,h:70,fill:k.orange,stroke:k.orangeS,label:e.name||"transform",fontSize:13}),x.jsx("path",{d:"M180 220 L180 250",stroke:k.ink}),x.jsx(_,{x:80,y:250,w:200,h:50,fill:k.purple,stroke:k.purpleS,label:"Output",fontSize:12})]}),Cl=({method:e})=>{const t=(e.slug||"").toLowerCase(),n=wl[t];return n?x.jsx(n,{}):e.image_url?x.jsx("img",{src:e.image_url,alt:`${e.name} schematic`,style:{width:"100%",height:"100%",objectFit:"contain",display:"block"}}):x.jsx(Sl,{method:e})};function vn(e){const t=[],n=String(e||"");let r=n.indexOf(","),i=0,o=!1;for(;!o;){r===-1&&(r=n.length,o=!0);const l=n.slice(i,r).trim();(l||!o)&&t.push(l),i=r+1,r=n.indexOf(",",i)}return t}function El(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Al=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Fl=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Il={};function zn(e,t){return(Il.jsx?Fl:Al).test(e)}const Tl=/[ \t\n\f\r]/g;function vl(e){return typeof e=="object"?e.type==="text"?Pn(e.value):!1:Pn(e)}function Pn(e){return e.replace(Tl,"")===""}class Xe{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Xe.prototype.normal={};Xe.prototype.property={};Xe.prototype.space=void 0;function Nr(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Xe(n,r,t)}function Ge(e){return e.toLowerCase()}class re{constructor(t,n){this.attribute=n,this.property=t}}re.prototype.attribute="";re.prototype.booleanish=!1;re.prototype.boolean=!1;re.prototype.commaOrSpaceSeparated=!1;re.prototype.commaSeparated=!1;re.prototype.defined=!1;re.prototype.mustUseProperty=!1;re.prototype.number=!1;re.prototype.overloadedBoolean=!1;re.prototype.property="";re.prototype.spaceSeparated=!1;re.prototype.space=void 0;let zl=0;const N=Te(),Y=Te(),_t=Te(),F=Te(),G=Te(),Me=Te(),le=Te();function Te(){return 2**++zl}const Ot=Object.freeze(Object.defineProperty({__proto__:null,boolean:N,booleanish:Y,commaOrSpaceSeparated:le,commaSeparated:Me,number:F,overloadedBoolean:_t,spaceSeparated:G},Symbol.toStringTag,{value:"Module"})),wt=Object.keys(Ot);class Xt extends re{constructor(t,n,r,i){let o=-1;if(super(t,n),Dn(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&Ml.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(jn,_l);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!jn.test(o)){let l=o.replace(Ll,Nl);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=Xt}return new i(r,t)}function Nl(e){return"-"+e.toLowerCase()}function _l(e){return e.charAt(1).toUpperCase()}const Vr=Nr([_r,Pl,Br,$r,Hr],"html"),ht=Nr([_r,Dl,Br,$r,Hr],"svg");function Ln(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function Ol(e){return e.join(" ").trim()}var Kt={},Mn=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Rl=/\n/g,Bl=/^\s*/,$l=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Hl=/^:\s*/,ql=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Vl=/^[;\s]*/,Ul=/^\s+|\s+$/g,Wl=` +`,Nn="/",_n="*",Fe="",Gl="comment",Ql="declaration";function Yl(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(m){var y=m.match(Rl);y&&(n+=y.length);var A=m.lastIndexOf(Wl);r=~A?m.length-A:r+m.length}function o(){var m={line:n,column:r};return function(y){return y.position=new l(m),u(),y}}function l(m){this.start=m,this.end={line:n,column:r},this.source=t.source}l.prototype.content=e;function a(m){var y=new Error(t.source+":"+n+":"+r+": "+m);if(y.reason=m,y.filename=t.source,y.line=n,y.column=r,y.source=e,!t.silent)throw y}function s(m){var y=m.exec(e);if(y){var A=y[0];return i(A),e=e.slice(A.length),y}}function u(){s(Bl)}function f(m){var y;for(m=m||[];y=c();)y!==!1&&m.push(y);return m}function c(){var m=o();if(!(Nn!=e.charAt(0)||_n!=e.charAt(1))){for(var y=2;Fe!=e.charAt(y)&&(_n!=e.charAt(y)||Nn!=e.charAt(y+1));)++y;if(y+=2,Fe===e.charAt(y-1))return a("End of comment missing");var A=e.slice(2,y-2);return r+=2,i(A),e=e.slice(y),r+=2,m({type:Gl,comment:A})}}function p(){var m=o(),y=s($l);if(y){if(c(),!s(Hl))return a("property missing ':'");var A=s(ql),b=m({type:Ql,property:On(y[0].replace(Mn,Fe)),value:A?On(A[0].replace(Mn,Fe)):Fe});return s(Vl),b}}function h(){var m=[];f(m);for(var y;y=p();)y!==!1&&(m.push(y),f(m));return m}return u(),h()}function On(e){return e?e.replace(Ul,Fe):Fe}var Xl=Yl,Kl=at&&at.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Kt,"__esModule",{value:!0});Kt.default=Zl;const Jl=Kl(Xl);function Zl(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,Jl.default)(e),i=typeof t=="function";return r.forEach(o=>{if(o.type!=="declaration")return;const{property:l,value:a}=o;i?t(l,a,o):a&&(n=n||{},n[l]=a)}),n}var pt={};Object.defineProperty(pt,"__esModule",{value:!0});pt.camelCase=void 0;var eo=/^--[a-zA-Z0-9_-]+$/,to=/-([a-z])/g,no=/^[^-]+$/,ro=/^-(webkit|moz|ms|o|khtml)-/,io=/^-(ms)-/,lo=function(e){return!e||no.test(e)||eo.test(e)},oo=function(e,t){return t.toUpperCase()},Rn=function(e,t){return"".concat(t,"-")},ao=function(e,t){return t===void 0&&(t={}),lo(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(io,Rn):e=e.replace(ro,Rn),e.replace(to,oo))};pt.camelCase=ao;var so=at&&at.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},uo=so(Kt),co=pt;function Rt(e,t){var n={};return!e||typeof e!="string"||(0,uo.default)(e,function(r,i){r&&i&&(n[(0,co.camelCase)(r,t)]=i)}),n}Rt.default=Rt;var fo=Rt;const ho=Mr(fo),Ur=Wr("end"),Jt=Wr("start");function Wr(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 po(e){const t=Jt(e),n=Ur(e);if(t&&n)return{start:t,end:n}}function Ve(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Bn(e.position):"start"in e||"end"in e?Bn(e):"line"in e||"column"in e?Bt(e):""}function Bt(e){return $n(e&&e.line)+":"+$n(e&&e.column)}function Bn(e){return Bt(e&&e.start)+"-"+Bt(e&&e.end)}function $n(e){return e&&typeof e=="number"?e:1}class ee extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},l=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(l=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const s=r.indexOf(":");s===-1?o.ruleId=r:(o.source=r.slice(0,s),o.ruleId=r.slice(s+1))}if(!o.place&&o.ancestors&&o.ancestors){const s=o.ancestors[o.ancestors.length-1];s&&(o.place=s.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=Ve(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}ee.prototype.file="";ee.prototype.name="";ee.prototype.reason="";ee.prototype.message="";ee.prototype.stack="";ee.prototype.column=void 0;ee.prototype.line=void 0;ee.prototype.ancestors=void 0;ee.prototype.cause=void 0;ee.prototype.fatal=void 0;ee.prototype.place=void 0;ee.prototype.ruleId=void 0;ee.prototype.source=void 0;const Zt={}.hasOwnProperty,mo=new Map,go=/[A-Z]/g,xo=new Set(["table","tbody","thead","tfoot","tr"]),yo=new Set(["td","th"]),Gr="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function ko(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=Io(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=Fo(n,t.jsx,t.jsxs)}const i={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"?ht:Vr,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=Qr(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function Qr(e,t,n){if(t.type==="element")return bo(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return wo(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Co(e,t,n);if(t.type==="mdxjsEsm")return So(e,t);if(t.type==="root")return Eo(e,t,n);if(t.type==="text")return Ao(e,t)}function bo(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=ht,e.schema=i),e.ancestors.push(t);const o=Xr(e,t.tagName,!1),l=To(e,t);let a=tn(e,t);return xo.has(t.tagName)&&(a=a.filter(function(s){return typeof s=="string"?!vl(s):!0})),Yr(e,l,o,t),en(l,a),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function wo(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)}Qe(e,t.position)}function So(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Qe(e,t.position)}function Co(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=ht,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:Xr(e,t.name,!0),l=vo(e,t),a=tn(e,t);return Yr(e,l,o,t),en(l,a),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function Eo(e,t,n){const r={};return en(r,tn(e,t)),e.create(t,e.Fragment,r,n)}function Ao(e,t){return t.value}function Yr(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function en(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Fo(e,t,n){return r;function r(i,o,l,a){const u=Array.isArray(l.children)?n:t;return a?u(o,l,a):u(o,l)}}function Io(e,t){return n;function n(r,i,o,l){const a=Array.isArray(o.children),s=Jt(r);return t(i,o,l,a,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function To(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Zt.call(t.properties,i)){const o=zo(e,i,t.properties[i]);if(o){const[l,a]=o;e.tableCellAlignToStyle&&l==="align"&&typeof a=="string"&&yo.has(t.tagName)?r=a:n[l]=a}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function vo(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const l=o.expression;l.type;const a=l.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Qe(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,o=e.evaluater.evaluateExpression(a.expression)}else Qe(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function tn(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:mo;for(;++ri?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);o0?(oe(e,e.length,0,t),e):t}const Vn={}.hasOwnProperty;function Jr(e){const t={};let n=-1;for(;++n13&&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 he(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const te=Se(/[A-Za-z]/),Z=Se(/[\dA-Za-z]/),Ro=Se(/[#-'*+\--9=?A-Z^-~]/);function st(e){return e!==null&&(e<32||e===127)}const $t=Se(/\d/),Bo=Se(/[\dA-Fa-f]/),$o=Se(/[!-/:-@[-`{-~]/);function v(e){return e!==null&&e<-2}function W(e){return e!==null&&(e<0||e===32)}function R(e){return e===-2||e===-1||e===32}const mt=Se(new RegExp("\\p{P}|\\p{S}","u")),Ie=Se(/\s/);function Se(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Oe(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&o<57344){const a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(l=String.fromCharCode(o,a),i=1):l="�"}else l=String.fromCharCode(o);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+i+1,l=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function O(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(s){return R(s)?(e.enter(n),a(s)):t(s)}function a(s){return R(s)&&o++l))return;const B=t.events.length;let q=B,M,w;for(;q--;)if(t.events[q][0]==="exit"&&t.events[q][1].type==="chunkFlow"){if(M){w=t.events[q][1].end;break}M=!0}for(b(r),E=B;EI;){const L=n[j];t.containerState=L[1],L[0].exit.call(t,e)}n.length=I}function S(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Wo(e,t,n){return O(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ne(e){if(e===null||W(e)||Ie(e))return 1;if(mt(e))return 2}function dt(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const c={...e[r][1].end},p={...e[n][1].start};Wn(c,-s),Wn(p,s),l={type:s>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},a={type:s>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},o={type:s>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:s>1?"strong":"emphasis",start:{...l.start},end:{...a.end}},e[r][1].end={...l.start},e[n][1].start={...a.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=ae(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=ae(u,[["enter",i,t],["enter",l,t],["exit",l,t],["enter",o,t]]),u=ae(u,dt(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=ae(u,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,u=ae(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,oe(e,r-1,n-r+3,u),n=r+u.length-f-2;break}}for(n=-1;++n0&&R(E)?O(e,S,"linePrefix",o+1)(E):S(E)}function S(E){return E===null||v(E)?e.check(Gn,y,j)(E):(e.enter("codeFlowValue"),I(E))}function I(E){return E===null||v(E)?(e.exit("codeFlowValue"),S(E)):(e.consume(E),I)}function j(E){return e.exit("codeFenced"),t(E)}function L(E,B,q){let M=0;return w;function w(H){return E.enter("lineEnding"),E.consume(H),E.exit("lineEnding"),z}function z(H){return E.enter("codeFencedFence"),R(H)?O(E,P,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H):P(H)}function P(H){return H===a?(E.enter("codeFencedFenceSequence"),V(H)):q(H)}function V(H){return H===a?(M++,E.consume(H),V):M>=l?(E.exit("codeFencedFenceSequence"),R(H)?O(E,Q,"whitespace")(H):Q(H)):q(H)}function Q(H){return H===null||v(H)?(E.exit("codeFencedFence"),B(H)):q(H)}}}function ia(e,t,n){const r=this;return i;function i(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const Ct={name:"codeIndented",tokenize:oa},la={partial:!0,tokenize:aa};function oa(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),O(e,o,"linePrefix",5)(u)}function o(u){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?l(u):n(u)}function l(u){return u===null?s(u):v(u)?e.attempt(la,l,s)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||v(u)?(e.exit("codeFlowValue"),l(u)):(e.consume(u),a)}function s(u){return e.exit("codeIndented"),t(u)}}function aa(e,t,n){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?n(l):v(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):O(e,o,"linePrefix",5)(l)}function o(l){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(l):v(l)?i(l):n(l)}}const sa={name:"codeText",previous:ca,resolve:ua,tokenize:fa};function ua(e){let t=e.length-4,n=3,r,i;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=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 tthis.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 i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&He(this.left,r),o.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),He(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),He(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=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function ii(e,t,n,r,i,o,l,a,s){const u=s||Number.POSITIVE_INFINITY;let f=0;return c;function c(b){return b===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(b),e.exit(o),p):b===null||b===32||b===41||st(b)?n(b):(e.enter(r),e.enter(l),e.enter(a),e.enter("chunkString",{contentType:"string"}),y(b))}function p(b){return b===62?(e.enter(o),e.consume(b),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),h(b))}function h(b){return b===62?(e.exit("chunkString"),e.exit(a),p(b)):b===null||b===60||v(b)?n(b):(e.consume(b),b===92?m:h)}function m(b){return b===60||b===62||b===92?(e.consume(b),h):h(b)}function y(b){return!f&&(b===null||b===41||W(b))?(e.exit("chunkString"),e.exit(a),e.exit(l),e.exit(r),t(b)):f999||h===null||h===91||h===93&&!s||h===94&&!a&&"_hiddenFootnoteSupport"in l.parser.constructs?n(h):h===93?(e.exit(o),e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):v(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),c(h))}function c(h){return h===null||h===91||h===93||v(h)||a++>999?(e.exit("chunkString"),f(h)):(e.consume(h),s||(s=!R(h)),h===92?p:c)}function p(h){return h===91||h===92||h===93?(e.consume(h),a++,c):c(h)}}function oi(e,t,n,r,i,o){let l;return a;function a(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),l=p===40?41:p,s):n(p)}function s(p){return p===l?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):(e.enter(o),u(p))}function u(p){return p===l?(e.exit(o),s(l)):p===null?n(p):v(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),O(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===l||p===null||v(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?c:f)}function c(p){return p===l||p===92?(e.consume(p),f):f(p)}}function Ue(e,t){let n;return r;function r(i){return v(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):R(i)?O(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const ka={name:"definition",tokenize:wa},ba={partial:!0,tokenize:Sa};function wa(e,t,n){const r=this;let i;return o;function o(h){return e.enter("definition"),l(h)}function l(h){return li.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function a(h){return i=he(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),s):n(h)}function s(h){return W(h)?Ue(e,u)(h):u(h)}function u(h){return ii(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function f(h){return e.attempt(ba,c,c)(h)}function c(h){return R(h)?O(e,p,"whitespace")(h):p(h)}function p(h){return h===null||v(h)?(e.exit("definition"),r.parser.defined.push(i),t(h)):n(h)}}function Sa(e,t,n){return r;function r(a){return W(a)?Ue(e,i)(a):n(a)}function i(a){return oi(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return R(a)?O(e,l,"whitespace")(a):l(a)}function l(a){return a===null||v(a)?t(a):n(a)}}const Ca={name:"hardBreakEscape",tokenize:Ea};function Ea(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return v(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const Aa={name:"headingAtx",resolve:Fa,tokenize:Ia};function Fa(e,t){let n=e.length-2,r=3,i,o;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&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},oe(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function Ia(e,t,n){let r=0;return i;function i(f){return e.enter("atxHeading"),o(f)}function o(f){return e.enter("atxHeadingSequence"),l(f)}function l(f){return f===35&&r++<6?(e.consume(f),l):f===null||W(f)?(e.exit("atxHeadingSequence"),a(f)):n(f)}function a(f){return f===35?(e.enter("atxHeadingSequence"),s(f)):f===null||v(f)?(e.exit("atxHeading"),t(f)):R(f)?O(e,a,"whitespace")(f):(e.enter("atxHeadingText"),u(f))}function s(f){return f===35?(e.consume(f),s):(e.exit("atxHeadingSequence"),a(f))}function u(f){return f===null||f===35||W(f)?(e.exit("atxHeadingText"),a(f)):(e.consume(f),u)}}const Ta=["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"],Yn=["pre","script","style","textarea"],va={concrete:!0,name:"htmlFlow",resolveTo:Da,tokenize:ja},za={partial:!0,tokenize:Ma},Pa={partial:!0,tokenize:La};function Da(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 ja(e,t,n){const r=this;let i,o,l,a,s;return u;function u(g){return f(g)}function f(g){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(g),c}function c(g){return g===33?(e.consume(g),p):g===47?(e.consume(g),o=!0,y):g===63?(e.consume(g),i=3,r.interrupt?t:d):te(g)?(e.consume(g),l=String.fromCharCode(g),A):n(g)}function p(g){return g===45?(e.consume(g),i=2,h):g===91?(e.consume(g),i=5,a=0,m):te(g)?(e.consume(g),i=4,r.interrupt?t:d):n(g)}function h(g){return g===45?(e.consume(g),r.interrupt?t:d):n(g)}function m(g){const ce="CDATA[";return g===ce.charCodeAt(a++)?(e.consume(g),a===ce.length?r.interrupt?t:P:m):n(g)}function y(g){return te(g)?(e.consume(g),l=String.fromCharCode(g),A):n(g)}function A(g){if(g===null||g===47||g===62||W(g)){const ce=g===47,Ce=l.toLowerCase();return!ce&&!o&&Yn.includes(Ce)?(i=1,r.interrupt?t(g):P(g)):Ta.includes(l.toLowerCase())?(i=6,ce?(e.consume(g),b):r.interrupt?t(g):P(g)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(g):o?S(g):I(g))}return g===45||Z(g)?(e.consume(g),l+=String.fromCharCode(g),A):n(g)}function b(g){return g===62?(e.consume(g),r.interrupt?t:P):n(g)}function S(g){return R(g)?(e.consume(g),S):w(g)}function I(g){return g===47?(e.consume(g),w):g===58||g===95||te(g)?(e.consume(g),j):R(g)?(e.consume(g),I):w(g)}function j(g){return g===45||g===46||g===58||g===95||Z(g)?(e.consume(g),j):L(g)}function L(g){return g===61?(e.consume(g),E):R(g)?(e.consume(g),L):I(g)}function E(g){return g===null||g===60||g===61||g===62||g===96?n(g):g===34||g===39?(e.consume(g),s=g,B):R(g)?(e.consume(g),E):q(g)}function B(g){return g===s?(e.consume(g),s=null,M):g===null||v(g)?n(g):(e.consume(g),B)}function q(g){return g===null||g===34||g===39||g===47||g===60||g===61||g===62||g===96||W(g)?L(g):(e.consume(g),q)}function M(g){return g===47||g===62||R(g)?I(g):n(g)}function w(g){return g===62?(e.consume(g),z):n(g)}function z(g){return g===null||v(g)?P(g):R(g)?(e.consume(g),z):n(g)}function P(g){return g===45&&i===2?(e.consume(g),J):g===60&&i===1?(e.consume(g),X):g===62&&i===4?(e.consume(g),ue):g===63&&i===3?(e.consume(g),d):g===93&&i===5?(e.consume(g),de):v(g)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(za,ge,V)(g)):g===null||v(g)?(e.exit("htmlFlowData"),V(g)):(e.consume(g),P)}function V(g){return e.check(Pa,Q,ge)(g)}function Q(g){return e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),H}function H(g){return g===null||v(g)?V(g):(e.enter("htmlFlowData"),P(g))}function J(g){return g===45?(e.consume(g),d):P(g)}function X(g){return g===47?(e.consume(g),l="",se):P(g)}function se(g){if(g===62){const ce=l.toLowerCase();return Yn.includes(ce)?(e.consume(g),ue):P(g)}return te(g)&&l.length<8?(e.consume(g),l+=String.fromCharCode(g),se):P(g)}function de(g){return g===93?(e.consume(g),d):P(g)}function d(g){return g===62?(e.consume(g),ue):g===45&&i===2?(e.consume(g),d):P(g)}function ue(g){return g===null||v(g)?(e.exit("htmlFlowData"),ge(g)):(e.consume(g),ue)}function ge(g){return e.exit("htmlFlow"),t(g)}}function La(e,t,n){const r=this;return i;function i(l){return v(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):n(l)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function Ma(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Ke,t,n)}}const Na={name:"htmlText",tokenize:_a};function _a(e,t,n){const r=this;let i,o,l;return a;function a(d){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(d),s}function s(d){return d===33?(e.consume(d),u):d===47?(e.consume(d),L):d===63?(e.consume(d),I):te(d)?(e.consume(d),q):n(d)}function u(d){return d===45?(e.consume(d),f):d===91?(e.consume(d),o=0,m):te(d)?(e.consume(d),S):n(d)}function f(d){return d===45?(e.consume(d),h):n(d)}function c(d){return d===null?n(d):d===45?(e.consume(d),p):v(d)?(l=c,X(d)):(e.consume(d),c)}function p(d){return d===45?(e.consume(d),h):c(d)}function h(d){return d===62?J(d):d===45?p(d):c(d)}function m(d){const ue="CDATA[";return d===ue.charCodeAt(o++)?(e.consume(d),o===ue.length?y:m):n(d)}function y(d){return d===null?n(d):d===93?(e.consume(d),A):v(d)?(l=y,X(d)):(e.consume(d),y)}function A(d){return d===93?(e.consume(d),b):y(d)}function b(d){return d===62?J(d):d===93?(e.consume(d),b):y(d)}function S(d){return d===null||d===62?J(d):v(d)?(l=S,X(d)):(e.consume(d),S)}function I(d){return d===null?n(d):d===63?(e.consume(d),j):v(d)?(l=I,X(d)):(e.consume(d),I)}function j(d){return d===62?J(d):I(d)}function L(d){return te(d)?(e.consume(d),E):n(d)}function E(d){return d===45||Z(d)?(e.consume(d),E):B(d)}function B(d){return v(d)?(l=B,X(d)):R(d)?(e.consume(d),B):J(d)}function q(d){return d===45||Z(d)?(e.consume(d),q):d===47||d===62||W(d)?M(d):n(d)}function M(d){return d===47?(e.consume(d),J):d===58||d===95||te(d)?(e.consume(d),w):v(d)?(l=M,X(d)):R(d)?(e.consume(d),M):J(d)}function w(d){return d===45||d===46||d===58||d===95||Z(d)?(e.consume(d),w):z(d)}function z(d){return d===61?(e.consume(d),P):v(d)?(l=z,X(d)):R(d)?(e.consume(d),z):M(d)}function P(d){return d===null||d===60||d===61||d===62||d===96?n(d):d===34||d===39?(e.consume(d),i=d,V):v(d)?(l=P,X(d)):R(d)?(e.consume(d),P):(e.consume(d),Q)}function V(d){return d===i?(e.consume(d),i=void 0,H):d===null?n(d):v(d)?(l=V,X(d)):(e.consume(d),V)}function Q(d){return d===null||d===34||d===39||d===60||d===61||d===96?n(d):d===47||d===62||W(d)?M(d):(e.consume(d),Q)}function H(d){return d===47||d===62||W(d)?M(d):n(d)}function J(d){return d===62?(e.consume(d),e.exit("htmlTextData"),e.exit("htmlText"),t):n(d)}function X(d){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),se}function se(d){return R(d)?O(e,de,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d):de(d)}function de(d){return e.enter("htmlTextData"),l(d)}}const ln={name:"labelEnd",resolveAll:$a,resolveTo:Ha,tokenize:qa},Oa={tokenize:Va},Ra={tokenize:Ua},Ba={tokenize:Wa};function $a(e){let t=-1;const n=[];for(;++t=3&&(u===null||v(u))?(e.exit("thematicBreak"),t(u)):n(u)}function s(u){return u===i?(e.consume(u),r++,s):(e.exit("thematicBreakSequence"),R(u)?O(e,a,"whitespace")(u):a(u))}}const ne={continuation:{tokenize:ns},exit:is,name:"list",tokenize:ts},Za={partial:!0,tokenize:ls},es={partial:!0,tokenize:rs};function ts(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return a;function a(h){const m=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:$t(h)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(lt,n,u)(h):u(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),s(h)}return n(h)}function s(h){return $t(h)&&++l<10?(e.consume(h),s):(!r.interrupt||l<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),u(h)):n(h)}function u(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(Ke,r.interrupt?n:f,e.attempt(Za,p,c))}function f(h){return r.containerState.initialBlankLine=!0,o++,p(h)}function c(h){return R(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),p):n(h)}function p(h){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function ns(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Ke,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,O(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!R(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(es,t,l)(a))}function l(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,O(e,e.attempt(ne,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function rs(e,t,n){const r=this;return O(e,i,"listItemIndent",r.containerState.size+1);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(o):n(o)}}function is(e){e.exit(this.containerState.type)}function ls(e,t,n){const r=this;return O(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const l=r.events[r.events.length-1];return!R(o)&&l&&l[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Xn={name:"setextUnderline",resolveTo:os,tokenize:as};function os(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",l,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function as(e,t,n){const r=this;let i;return o;function o(u){let f=r.events.length,c;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){c=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(e.enter("setextHeadingLine"),i=u,l(u)):n(u)}function l(u){return e.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===i?(e.consume(u),a):(e.exit("setextHeadingLineSequence"),R(u)?O(e,s,"lineSuffix")(u):s(u))}function s(u){return u===null||v(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const ss={tokenize:us};function us(e){const t=this,n=e.attempt(Ke,r,e.attempt(this.parser.constructs.flowInitial,i,O(e,e.attempt(this.parser.constructs.flow,i,e.attempt(ma,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const cs={resolveAll:si()},fs=ai("string"),hs=ai("text");function ai(e){return{resolveAll:si(e==="text"?ps:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,l,a);return l;function l(f){return u(f)?o(f):a(f)}function a(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),s}function s(f){return u(f)?(n.exit("data"),o(f)):(n.consume(f),s)}function u(f){if(f===null)return!0;const c=i[f];let p=-1;if(c)for(;++p-1){const a=l[0];typeof a=="string"?l[0]=a.slice(r):l.shift()}o>0&&l.push(e[i].slice(0,o))}return l}function Fs(e,t){let n=-1;const r=[];let i;for(;++n0){const fe=D.tokenStack[D.tokenStack.length-1];(fe[1]||Jn).call(D,void 0,fe[0])}for(T.position={start:we(C.length>0?C[0][1].start:{line:1,column:1,offset:0}),end:we(C.length>0?C[C.length-2][1].end:{line:1,column:1,offset:0})},U=-1;++U0&&(r.className=["language-"+i[0]]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function Bs(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function $s(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Hs(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Oe(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let l,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=o+1,a+=1,e.footnoteCounts.set(r,a);const s={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,s);const u={type:"element",tagName:"sup",properties:{},children:[s]};return e.patch(t,u),e.applyData(t,u)}function qs(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 Vs(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function fi(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 i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const l=i[i.length-1];return l&&l.type==="text"?l.value+=r:i.push({type:"text",value:r}),i}function Us(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return fi(e,t);const i={src:Oe(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function Ws(e,t){const n={src:Oe(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 Gs(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 Qs(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return fi(e,t);const i={href:Oe(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function Ys(e,t){const n={href:Oe(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 Xs(e,t,n){const r=e.all(t),i=n?Ks(n):hi(t),o={},l=[];if(typeof t.checked=="boolean"){const f=r[0];let c;f&&f.type==="element"&&f.tagName==="p"?c=f:(c={type:"element",tagName:"p",properties:{},children:[]},r.unshift(c)),c.children.length>0&&c.children.unshift({type:"text",value:" "}),c.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let a=-1;for(;++a1}function Js(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=Jt(t.children[1]),s=Ur(t.children[t.children.length-1]);a&&s&&(l.position={start:a,end:s}),i.push(l)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function ru(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,a=l?l.length:t.children.length;let s=-1;const u=[];for(;++s0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(tr(t.slice(i),i>0,!1)),o.join("")}function tr(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===Zn||o===er;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===Zn||o===er;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function ou(e,t){const n={type:"text",value:lu(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function au(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const su={blockquote:_s,break:Os,code:Rs,delete:Bs,emphasis:$s,footnoteReference:Hs,heading:qs,html:Vs,imageReference:Us,image:Ws,inlineCode:Gs,linkReference:Qs,link:Ys,listItem:Xs,list:Js,paragraph:Zs,root:eu,strong:tu,table:nu,tableCell:iu,tableRow:ru,text:ou,thematicBreak:au,toml:tt,yaml:tt,definition:tt,footnoteDefinition:tt};function tt(){}const pi=-1,gt=0,We=1,ut=2,on=3,an=4,sn=5,un=6,mi=7,di=8,nr=typeof self=="object"?self:globalThis,uu=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,l]=t[i];switch(o){case gt:case pi:return n(l,i);case We:{const a=n([],i);for(const s of l)a.push(r(s));return a}case ut:{const a=n({},i);for(const[s,u]of l)a[r(s)]=r(u);return a}case on:return n(new Date(l),i);case an:{const{source:a,flags:s}=l;return n(new RegExp(a,s),i)}case sn:{const a=n(new Map,i);for(const[s,u]of l)a.set(r(s),r(u));return a}case un:{const a=n(new Set,i);for(const s of l)a.add(r(s));return a}case mi:{const{name:a,message:s}=l;return n(new nr[a](s),i)}case di:return n(BigInt(l),i);case"BigInt":return n(Object(BigInt(l)),i);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:a}=new Uint8Array(l);return n(new DataView(a),l)}}return n(new nr[o](l),i)};return r},rr=e=>uu(new Map,e)(0),je="",{toString:cu}={},{keys:fu}=Object,qe=e=>{const t=typeof e;if(t!=="object"||!e)return[gt,t];const n=cu.call(e).slice(8,-1);switch(n){case"Array":return[We,je];case"Object":return[ut,je];case"Date":return[on,je];case"RegExp":return[an,je];case"Map":return[sn,je];case"Set":return[un,je];case"DataView":return[We,n]}return n.includes("Array")?[We,n]:n.includes("Error")?[mi,n]:[ut,n]},nt=([e,t])=>e===gt&&(t==="function"||t==="symbol"),hu=(e,t,n,r)=>{const i=(l,a)=>{const s=r.push(l)-1;return n.set(a,s),s},o=l=>{if(n.has(l))return n.get(l);let[a,s]=qe(l);switch(a){case gt:{let f=l;switch(s){case"bigint":a=di,f=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+s);f=null;break;case"undefined":return i([pi],l)}return i([a,f],l)}case We:{if(s){let p=l;return s==="DataView"?p=new Uint8Array(l.buffer):s==="ArrayBuffer"&&(p=new Uint8Array(l)),i([s,[...p]],l)}const f=[],c=i([a,f],l);for(const p of l)f.push(o(p));return c}case ut:{if(s)switch(s){case"BigInt":return i([s,l.toString()],l);case"Boolean":case"Number":case"String":return i([s,l.valueOf()],l)}if(t&&"toJSON"in l)return o(l.toJSON());const f=[],c=i([a,f],l);for(const p of fu(l))(e||!nt(qe(l[p])))&&f.push([o(p),o(l[p])]);return c}case on:return i([a,l.toISOString()],l);case an:{const{source:f,flags:c}=l;return i([a,{source:f,flags:c}],l)}case sn:{const f=[],c=i([a,f],l);for(const[p,h]of l)(e||!(nt(qe(p))||nt(qe(h))))&&f.push([o(p),o(h)]);return c}case un:{const f=[],c=i([a,f],l);for(const p of l)(e||!nt(qe(p)))&&f.push(o(p));return c}}const{message:u}=l;return i([a,{name:s,message:u}],l)};return o},ir=(e,{json:t,lossy:n}={})=>{const r=[];return hu(!(t||n),!!t,new Map,r)(e),r},ct=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?rr(ir(e,t)):structuredClone(e):(e,t)=>rr(ir(e,t));function pu(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 mu(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function du(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||pu,r=e.options.footnoteBackLabel||mu,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let s=-1;for(;++s0&&m.push({type:"text",value:" "});let S=typeof n=="string"?n:n(s,h);typeof S=="string"&&(S={type:"text",value:S}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+p+(h>1?"-"+h:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(s,h),className:["data-footnote-backref"]},children:Array.isArray(S)?S:[S]})}const A=f[f.length-1];if(A&&A.type==="element"&&A.tagName==="p"){const S=A.children[A.children.length-1];S&&S.type==="text"?S.value+=" ":A.children.push({type:"text",value:" "}),A.children.push(...m)}else f.push(...m);const b={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(f,!0)};e.patch(u,b),a.push(b)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...ct(l),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` +`},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:` +`}]}}const Je=function(e){if(e==null)return ku;if(typeof e=="function")return xt(e);if(typeof e=="object")return Array.isArray(e)?gu(e):xu(e);if(typeof e=="string")return yu(e);throw new Error("Expected function, string, or object as test")};function gu(e){const t=[];let n=-1;for(;++n":""))+")"})}return p;function p(){let h=gi,m,y,A;if((!t||o(s,u,f[f.length-1]||void 0))&&(h=Su(n(s,f)),h[0]===qt))return h;if("children"in s&&s.children){const b=s;if(b.children&&h[0]!==xi)for(y=(r?b.children.length:-1)+l,A=f.concat(b);y>-1&&y0&&n.push({type:"text",value:` +`}),n}function lr(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function or(e,t){const n=Eu(e,t),r=n.one(e,void 0),i=du(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:` +`},i),o}function vu(e,t){return e&&"run"in e?async function(n,r){const i=or(n,{file:r,...t});await e.run(i,r)}:function(n,r){return or(n,{file:r,...e||t})}}function ar(e){if(e)throw e}var ot=Object.prototype.hasOwnProperty,yi=Object.prototype.toString,sr=Object.defineProperty,ur=Object.getOwnPropertyDescriptor,cr=function(t){return typeof Array.isArray=="function"?Array.isArray(t):yi.call(t)==="[object Array]"},fr=function(t){if(!t||yi.call(t)!=="[object Object]")return!1;var n=ot.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&ot.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||ot.call(t,i)},hr=function(t,n){sr&&n.name==="__proto__"?sr(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},pr=function(t,n){if(n==="__proto__")if(ot.call(t,n)){if(ur)return ur(t,n).value}else return;return t[n]},zu=function e(){var t,n,r,i,o,l,a=arguments[0],s=1,u=arguments.length,f=!1;for(typeof a=="boolean"&&(f=a,a=arguments[1]||{},s=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});sl.length;let s;a&&l.push(i);try{s=e.apply(this,l)}catch(u){const f=u;if(a&&n)throw f;return i(f)}a||(s&&s.then&&typeof s.then=="function"?s.then(o,i):s instanceof Error?i(s):o(s))}function i(l,...a){n||(n=!0,t(l,...a))}function o(l){i(null,l)}}const pe={basename:ju,dirname:Lu,extname:Mu,join:Nu,sep:"/"};function ju(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Ze(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else l<0&&(o=!0,l=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function Lu(e){if(Ze(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 Mu(e){Ze(e);let t=e.length,n=-1,r=0,i=-1,o=0,l;for(;t--;){const a=e.codePointAt(t);if(a===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),a===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function Nu(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Ou(e,t){let n="",r=0,i=-1,o=0,l=-1,a,s;for(;++l<=e.length;){if(l2){if(s=n.lastIndexOf("/"),s!==n.length-1){s<0?(n="",r=0):(n=n.slice(0,s),r=n.length-1-n.lastIndexOf("/")),i=l,o=0;continue}}else if(n.length>0){n="",r=0,i=l,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,l):n=e.slice(i+1,l),r=l-i-1;i=l,o=0}else a===46&&o>-1?o++:o=-1}return n}function Ze(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Ru={cwd:Bu};function Bu(){return"/"}function Wt(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function $u(e){if(typeof e=="string")e=new URL(e);else if(!Wt(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 Hu(e)}function Hu(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(;++n0){let[h,...m]=f;const y=r[p][1];Ut(y)&&Ut(h)&&(h=At(!0,y,h)),r[p]=[u,h,...m]}}}}const Wu=new hn().freeze();function vt(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function zt(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Pt(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 dr(e){if(!Ut(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function gr(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function rt(e){return Gu(e)?e:new ki(e)}function Gu(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Qu(e){return typeof e=="string"||Yu(e)}function Yu(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Xu="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",xr=[],yr={allowDangerousHtml:!0},Ku=/^(https?|ircs?|mailto|xmpp)$/i,Ju=[{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 Zu(e){const t=ec(e),n=tc(e);return nc(t.runSync(t.parse(n),n),e)}function ec(e){const t=e.rehypePlugins||xr,n=e.remarkPlugins||xr,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...yr}:yr;return Wu().use(Ns).use(n).use(vu,r).use(t)}function tc(e){const t=e.children||"",n=new ki;return typeof t=="string"&&(n.value=t),n}function nc(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,o=t.disallowedElements,l=t.skipHtml,a=t.unwrapDisallowed,s=t.urlTransform||rc;for(const f of Ju)Object.hasOwn(t,f.from)&&(""+f.from+(f.to?"use `"+f.to+"` instead":"remove it")+Xu+f.id,void 0);return fn(e,u),ko(e,{Fragment:x.Fragment,components:i,ignoreInvalidStyle:!0,jsx:x.jsx,jsxs:x.jsxs,passKeys:!0,passNode:!0});function u(f,c,p){if(f.type==="raw"&&p&&typeof c=="number")return l?p.children.splice(c,1):p.children[c]={type:"text",value:f.value},c;if(f.type==="element"){let h;for(h in St)if(Object.hasOwn(St,h)&&Object.hasOwn(f.properties,h)){const m=f.properties[h],y=St[h];(y===null||y.includes(f.tagName))&&(f.properties[h]=s(String(m||""),h,f))}}if(f.type==="element"){let h=n?!n.includes(f.tagName):o?o.includes(f.tagName):!1;if(!h&&r&&typeof c=="number"&&(h=!r(f,c,p)),h&&p&&typeof c=="number")return a&&f.children?p.children.splice(c,1,...f.children):p.children.splice(c,1),c}}}function rc(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||Ku.test(e.slice(0,t))?e:""}function kr(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function ic(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function lc(e,t,n){const i=Je((n||{}).ignore||[]),o=oc(t);let l=-1;for(;++l0?{type:"text",value:E}:void 0),E===!1?p.lastIndex=j+1:(m!==j&&S.push({type:"text",value:u.value.slice(m,j)}),Array.isArray(E)?S.push(...E):E&&S.push(E),m=j+I[0].length,b=!0),!p.global)break;I=p.exec(u.value)}return b?(m?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=kr(e,"(");let o=kr(e,")");for(;r!==-1&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function bi(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Ie(n)||mt(n))&&(!t||n!==47)}wi.peek=vc;function wc(){this.buffer()}function Sc(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Cc(){this.buffer()}function Ec(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Ac(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=he(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Fc(e){this.exit(e)}function Ic(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=he(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Tc(e){this.exit(e)}function vc(){return"["}function wi(e,t,n,r){const i=n.createTracker(r);let o=i.move("[^");const l=n.enter("footnoteReference"),a=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{after:"]",before:o})),a(),l(),o+=i.move("]"),o}function zc(){return{enter:{gfmFootnoteCallString:wc,gfmFootnoteCall:Sc,gfmFootnoteDefinitionLabelString:Cc,gfmFootnoteDefinition:Ec},exit:{gfmFootnoteCallString:Ac,gfmFootnoteCall:Fc,gfmFootnoteDefinitionLabelString:Ic,gfmFootnoteDefinition:Tc}}}function Pc(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:wi},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,o,l){const a=o.createTracker(l);let s=a.move("[^");const u=o.enter("footnoteDefinition"),f=o.enter("label");return s+=a.move(o.safe(o.associationId(r),{before:s,after:"]"})),f(),s+=a.move("]:"),r.children&&r.children.length>0&&(a.shift(4),s+=a.move((t?` +`:" ")+o.indentLines(o.containerFlow(r,a.current()),t?Si:Dc))),u(),s}}function Dc(e,t,n){return t===0?e:Si(e,t,n)}function Si(e,t,n){return(n?"":" ")+e}const jc=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Ci.peek=Oc;function Lc(){return{canContainEols:["delete"],enter:{strikethrough:Nc},exit:{strikethrough:_c}}}function Mc(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:jc}],handlers:{delete:Ci}}}function Nc(e){this.enter({type:"delete",children:[]},e)}function _c(e){this.exit(e)}function Ci(e,t,n,r){const i=n.createTracker(r),o=n.enter("strikethrough");let l=i.move("~~");return l+=n.containerPhrasing(e,{...i.current(),before:l,after:"~"}),l+=i.move("~~"),o(),l}function Oc(){return"~"}function Rc(e){return e.length}function Bc(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Rc,o=[],l=[],a=[],s=[];let u=0,f=-1;for(;++fu&&(u=e[f].length);++bs[b])&&(s[b]=I)}y.push(S)}l[f]=y,a[f]=A}let c=-1;if(typeof r=="object"&&"length"in r)for(;++cs[c]&&(s[c]=S),h[c]=S),p[c]=I}l.splice(1,0,p),a.splice(1,0,h),f=-1;const m=[];for(;++f "),o.shift(2);const l=n.indentLines(n.containerFlow(e,o.current()),qc);return i(),l}function qc(e,t,n){return">"+(n?"":" ")+e}function Vc(e,t){return wr(e,t.inConstruct,!0)&&!wr(e,t.notInConstruct,!1)}function wr(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++rl&&(l=o):o=1,i=r+t.length,r=n.indexOf(t,i);return l}function Uc(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 Wc(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 Gc(e,t,n,r){const i=Wc(n),o=e.value||"",l=i==="`"?"GraveAccent":"Tilde";if(Uc(e,n)){const c=n.enter("codeIndented"),p=n.indentLines(o,Qc);return c(),p}const a=n.createTracker(r),s=i.repeat(Math.max(Ei(o,i)+1,3)),u=n.enter("codeFenced");let f=a.move(s);if(e.lang){const c=n.enter(`codeFencedLang${l}`);f+=a.move(n.safe(e.lang,{before:f,after:" ",encode:["`"],...a.current()})),c()}if(e.lang&&e.meta){const c=n.enter(`codeFencedMeta${l}`);f+=a.move(" "),f+=a.move(n.safe(e.meta,{before:f,after:` +`,encode:["`"],...a.current()})),c()}return f+=a.move(` +`),o&&(f+=a.move(o+` +`)),f+=a.move(s),u(),f}function Qc(e,t,n){return(n?"":" ")+e}function pn(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 Yc(e,t,n,r){const i=pn(n),o=i==='"'?"Quote":"Apostrophe",l=n.enter("definition");let a=n.enter("label");const s=n.createTracker(r);let u=s.move("[");return u+=s.move(n.safe(n.associationId(e),{before:u,after:"]",...s.current()})),u+=s.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),u+=s.move("<"),u+=s.move(n.safe(e.url,{before:u,after:">",...s.current()})),u+=s.move(">")):(a=n.enter("destinationRaw"),u+=s.move(n.safe(e.url,{before:u,after:e.title?" ":` +`,...s.current()}))),a(),e.title&&(a=n.enter(`title${o}`),u+=s.move(" "+i),u+=s.move(n.safe(e.title,{before:u,after:i,...s.current()})),u+=s.move(i),a()),l(),u}function Xc(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 Ye(e){return"&#x"+e.toString(16).toUpperCase()+";"}function ft(e,t,n){const r=Ne(e),i=Ne(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Ai.peek=Kc;function Ai(e,t,n,r){const i=Xc(n),o=n.enter("emphasis"),l=n.createTracker(r),a=l.move(i);let s=l.move(n.containerPhrasing(e,{after:i,before:a,...l.current()}));const u=s.charCodeAt(0),f=ft(r.before.charCodeAt(r.before.length-1),u,i);f.inside&&(s=Ye(u)+s.slice(1));const c=s.charCodeAt(s.length-1),p=ft(r.after.charCodeAt(0),c,i);p.inside&&(s=s.slice(0,-1)+Ye(c));const h=l.move(i);return o(),n.attentionEncodeSurroundingInfo={after:p.outside,before:f.outside},a+s+h}function Kc(e,t,n){return n.options.emphasis||"*"}function Jc(e,t){let n=!1;return fn(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,qt}),!!((!e.depth||e.depth<3)&&nn(e)&&(t.options.setext||n))}function Zc(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(Jc(e,n)){const f=n.enter("headingSetext"),c=n.enter("phrasing"),p=n.containerPhrasing(e,{...o.current(),before:` +`,after:` +`});return c(),f(),p+` +`+(i===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(` +`))+1))}const l="#".repeat(i),a=n.enter("headingAtx"),s=n.enter("phrasing");o.move(l+" ");let u=n.containerPhrasing(e,{before:"# ",after:` +`,...o.current()});return/^[\t ]/.test(u)&&(u=Ye(u.charCodeAt(0))+u.slice(1)),u=u?l+" "+u:l,n.options.closeAtx&&(u+=" "+l),s(),a(),u}Fi.peek=ef;function Fi(e){return e.value||""}function ef(){return"<"}Ii.peek=tf;function Ii(e,t,n,r){const i=pn(n),o=i==='"'?"Quote":"Apostrophe",l=n.enter("image");let a=n.enter("label");const s=n.createTracker(r);let u=s.move("![");return u+=s.move(n.safe(e.alt,{before:u,after:"]",...s.current()})),u+=s.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),u+=s.move("<"),u+=s.move(n.safe(e.url,{before:u,after:">",...s.current()})),u+=s.move(">")):(a=n.enter("destinationRaw"),u+=s.move(n.safe(e.url,{before:u,after:e.title?" ":")",...s.current()}))),a(),e.title&&(a=n.enter(`title${o}`),u+=s.move(" "+i),u+=s.move(n.safe(e.title,{before:u,after:i,...s.current()})),u+=s.move(i),a()),u+=s.move(")"),l(),u}function tf(){return"!"}Ti.peek=nf;function Ti(e,t,n,r){const i=e.referenceType,o=n.enter("imageReference");let l=n.enter("label");const a=n.createTracker(r);let s=a.move("![");const u=n.safe(e.alt,{before:s,after:"]",...a.current()});s+=a.move(u+"]["),l();const f=n.stack;n.stack=[],l=n.enter("reference");const c=n.safe(n.associationId(e),{before:s,after:"]",...a.current()});return l(),n.stack=f,o(),i==="full"||!u||u!==c?s+=a.move(c+"]"):i==="shortcut"?s=s.slice(0,-1):s+=a.move("]"),s}function nf(){return"!"}vi.peek=rf;function vi(e,t,n){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o\u007F]/.test(e.url))}Pi.peek=lf;function Pi(e,t,n,r){const i=pn(n),o=i==='"'?"Quote":"Apostrophe",l=n.createTracker(r);let a,s;if(zi(e,n)){const f=n.stack;n.stack=[],a=n.enter("autolink");let c=l.move("<");return c+=l.move(n.containerPhrasing(e,{before:c,after:">",...l.current()})),c+=l.move(">"),a(),n.stack=f,c}a=n.enter("link"),s=n.enter("label");let u=l.move("[");return u+=l.move(n.containerPhrasing(e,{before:u,after:"](",...l.current()})),u+=l.move("]("),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(s=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}))),s(),e.title&&(s=n.enter(`title${o}`),u+=l.move(" "+i),u+=l.move(n.safe(e.title,{before:u,after:i,...l.current()})),u+=l.move(i),s()),u+=l.move(")"),a(),u}function lf(e,t,n){return zi(e,n)?"<":"["}Di.peek=of;function Di(e,t,n,r){const i=e.referenceType,o=n.enter("linkReference");let l=n.enter("label");const a=n.createTracker(r);let s=a.move("[");const u=n.containerPhrasing(e,{before:s,after:"]",...a.current()});s+=a.move(u+"]["),l();const f=n.stack;n.stack=[],l=n.enter("reference");const c=n.safe(n.associationId(e),{before:s,after:"]",...a.current()});return l(),n.stack=f,o(),i==="full"||!u||u!==c?s+=a.move(c+"]"):i==="shortcut"?s=s.slice(0,-1):s+=a.move("]"),s}function of(){return"["}function mn(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 af(e){const t=mn(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 sf(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 ji(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 uf(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let l=e.ordered?sf(n):mn(n);const a=e.ordered?l==="."?")":".":af(n);let s=t&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!e.ordered){const f=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&f&&(!f.children||!f.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&&(s=!0),ji(n)===l&&f){let c=-1;for(;++c-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let l=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(l=Math.ceil(l/4)*4);const a=n.createTracker(r);a.move(o+" ".repeat(l-o.length)),a.shift(l);const s=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,a.current()),f);return s(),u;function f(c,p,h){return p?(h?"":" ".repeat(l))+c:(h?o:o+" ".repeat(l-o.length))+c}}function hf(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),l=n.containerPhrasing(e,r);return o(),i(),l}const pf=Je(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function mf(e,t,n,r){return(e.children.some(function(l){return pf(l)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function df(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Li.peek=gf;function Li(e,t,n,r){const i=df(n),o=n.enter("strong"),l=n.createTracker(r),a=l.move(i+i);let s=l.move(n.containerPhrasing(e,{after:i,before:a,...l.current()}));const u=s.charCodeAt(0),f=ft(r.before.charCodeAt(r.before.length-1),u,i);f.inside&&(s=Ye(u)+s.slice(1));const c=s.charCodeAt(s.length-1),p=ft(r.after.charCodeAt(0),c,i);p.inside&&(s=s.slice(0,-1)+Ye(c));const h=l.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:p.outside,before:f.outside},a+s+h}function gf(e,t,n){return n.options.strong||"*"}function xf(e,t,n,r){return n.safe(e.value,r)}function yf(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 kf(e,t,n){const r=(ji(n)+(n.options.ruleSpaces?" ":"")).repeat(yf(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Mi={blockquote:Hc,break:Sr,code:Gc,definition:Yc,emphasis:Ai,hardBreak:Sr,heading:Zc,html:Fi,image:Ii,imageReference:Ti,inlineCode:vi,link:Pi,linkReference:Di,list:uf,listItem:ff,paragraph:hf,root:mf,strong:Li,text:xf,thematicBreak:kf};function bf(){return{enter:{table:wf,tableData:Cr,tableHeader:Cr,tableRow:Cf},exit:{codeText:Ef,table:Sf,tableData:Mt,tableHeader:Mt,tableRow:Mt}}}function wf(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 Sf(e){this.exit(e),this.data.inTable=void 0}function Cf(e){this.enter({type:"tableRow",children:[]},e)}function Mt(e){this.exit(e)}function Cr(e){this.enter({type:"tableCell",children:[]},e)}function Ef(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Af));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Af(e,t){return t==="|"?t:e}function Ff(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` +`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:l,tableCell:s,tableRow:a}};function l(h,m,y,A){return u(f(h,y,A),h.align)}function a(h,m,y,A){const b=c(h,y,A),S=u([b]);return S.slice(0,S.indexOf(` +`))}function s(h,m,y,A){const b=y.enter("tableCell"),S=y.enter("phrasing"),I=y.containerPhrasing(h,{...A,before:o,after:o});return S(),b(),I}function u(h,m){return Bc(h,{align:m,alignDelimiters:r,padding:n,stringLength:i})}function f(h,m,y){const A=h.children;let b=-1;const S=[],I=m.enter("table");for(;++b0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const Vf={tokenize:Jf,partial:!0};function Uf(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Yf,continuation:{tokenize:Xf},exit:Kf}},text:{91:{name:"gfmFootnoteCall",tokenize:Qf},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Wf,resolveTo:Gf}}}}function Wf(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;i--;){const s=r.events[i][1];if(s.type==="labelImage"){l=s;break}if(s.type==="gfmFootnoteCall"||s.type==="labelLink"||s.type==="label"||s.type==="image"||s.type==="link")break}return a;function a(s){if(!l||!l._balanced)return n(s);const u=he(r.sliceSerialize({start:l.end,end:r.now()}));return u.codePointAt(0)!==94||!o.includes(u.slice(1))?n(s):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(s),e.exit("gfmFootnoteCallLabelMarker"),t(s))}}function Gf(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)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},a=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",l,t],["exit",l,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...a),e}function Qf(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,l;return a;function a(c){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),s}function s(c){return c!==94?n(c):(e.enter("gfmFootnoteCallMarker"),e.consume(c),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(c){if(o>999||c===93&&!l||c===null||c===91||W(c))return n(c);if(c===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return i.includes(he(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(c)}return W(c)||(l=!0),o++,e.consume(c),c===92?f:u}function f(c){return c===91||c===92||c===93?(e.consume(c),o++,u):u(c)}}function Yf(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,l=0,a;return s;function s(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",f):n(m)}function f(m){if(l>999||m===93&&!a||m===null||m===91||W(m))return n(m);if(m===93){e.exit("chunkString");const y=e.exit("gfmFootnoteDefinitionLabelString");return o=he(r.sliceSerialize(y)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return W(m)||(a=!0),l++,e.consume(m),m===92?c:f}function c(m){return m===91||m===92||m===93?(e.consume(m),l++,f):f(m)}function p(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),i.includes(o)||i.push(o),O(e,h,"gfmFootnoteDefinitionWhitespace")):n(m)}function h(m){return t(m)}}function Xf(e,t,n){return e.check(Ke,t,e.attempt(Vf,t,n))}function Kf(e){e.exit("gfmFootnoteDefinition")}function Jf(e,t,n){const r=this;return O(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(o):n(o)}}function Zf(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(l,a){let s=-1;for(;++s1?s(m):(l.consume(m),c++,h);if(c<2&&!n)return s(m);const A=l.exit("strikethroughSequenceTemporary"),b=Ne(m);return A._open=!b||b===2&&!!y,A._close=!y||y===2&&!!b,a(m)}}}class eh{constructor(){this.map=[]}add(t,n,r){th(this,t,n,r)}consume(t){if(this.map.sort(function(o,l){return o[0]-l[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 i=r.pop();for(;i;){for(const o of i)t.push(o);i=r.pop()}this.map.length=0}}function th(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i-1;){const Q=r.events[z][1].type;if(Q==="lineEnding"||Q==="linePrefix")z--;else break}const P=z>-1?r.events[z][1].type:null,V=P==="tableHead"||P==="tableRow"?E:s;return V===E&&r.parser.lazy[r.now().line]?n(w):V(w)}function s(w){return e.enter("tableHead"),e.enter("tableRow"),u(w)}function u(w){return w===124||(l=!0,o+=1),f(w)}function f(w){return w===null?n(w):v(w)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),h):n(w):R(w)?O(e,f,"whitespace")(w):(o+=1,l&&(l=!1,i+=1),w===124?(e.enter("tableCellDivider"),e.consume(w),e.exit("tableCellDivider"),l=!0,f):(e.enter("data"),c(w)))}function c(w){return w===null||w===124||W(w)?(e.exit("data"),f(w)):(e.consume(w),w===92?p:c)}function p(w){return w===92||w===124?(e.consume(w),c):c(w)}function h(w){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(w):(e.enter("tableDelimiterRow"),l=!1,R(w)?O(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(w):m(w))}function m(w){return w===45||w===58?A(w):w===124?(l=!0,e.enter("tableCellDivider"),e.consume(w),e.exit("tableCellDivider"),y):L(w)}function y(w){return R(w)?O(e,A,"whitespace")(w):A(w)}function A(w){return w===58?(o+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(w),e.exit("tableDelimiterMarker"),b):w===45?(o+=1,b(w)):w===null||v(w)?j(w):L(w)}function b(w){return w===45?(e.enter("tableDelimiterFiller"),S(w)):L(w)}function S(w){return w===45?(e.consume(w),S):w===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(w),e.exit("tableDelimiterMarker"),I):(e.exit("tableDelimiterFiller"),I(w))}function I(w){return R(w)?O(e,j,"whitespace")(w):j(w)}function j(w){return w===124?m(w):w===null||v(w)?!l||i!==o?L(w):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(w)):L(w)}function L(w){return n(w)}function E(w){return e.enter("tableRow"),B(w)}function B(w){return w===124?(e.enter("tableCellDivider"),e.consume(w),e.exit("tableCellDivider"),B):w===null||v(w)?(e.exit("tableRow"),t(w)):R(w)?O(e,B,"whitespace")(w):(e.enter("data"),q(w))}function q(w){return w===null||w===124||W(w)?(e.exit("data"),B(w)):(e.consume(w),w===92?M:q)}function M(w){return w===92||w===124?(e.consume(w),q):q(w)}}function lh(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],l=[0,0,0,0],a=!1,s=0,u,f,c;const p=new eh;for(;++nn[2]+1){const m=n[2]+1,y=n[3]-n[2]-1;e.add(m,y,[])}}e.add(n[3]+1,0,[["exit",c,t]])}return i!==void 0&&(o.end=Object.assign({},Le(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function Ar(e,t,n,r,i){const o=[],l=Le(t.events,n);i&&(i.end=Object.assign({},l),o.push(["exit",i,t])),r.end=Object.assign({},l),o.push(["exit",r,t]),e.add(n+1,0,o)}function Le(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const oh={name:"tasklistCheck",tokenize:sh};function ah(){return{text:{91:oh}}}function sh(e,t,n){const r=this;return i;function i(s){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(s):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(s),e.exit("taskListCheckMarker"),o)}function o(s){return W(s)?(e.enter("taskListCheckValueUnchecked"),e.consume(s),e.exit("taskListCheckValueUnchecked"),l):s===88||s===120?(e.enter("taskListCheckValueChecked"),e.consume(s),e.exit("taskListCheckValueChecked"),l):n(s)}function l(s){return s===93?(e.enter("taskListCheckMarker"),e.consume(s),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(s)}function a(s){return v(s)?t(s):R(s)?e.check({tokenize:uh},t,n)(s):n(s)}}function uh(e,t,n){return O(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function ch(e){return Jr([Mf(),Uf(),Zf(e),rh(),ah()])}const fh={};function hh(e){const t=this,n=e||fh,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(ch(n)),o.push(Pf()),l.push(Df(n))}function ph(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:o},exit:{mathFlow:i,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:a,mathText:l,mathTextData:a}};function e(s){const u={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[u]}},s)}function t(){this.buffer()}function n(){const s=this.resume(),u=this.stack[this.stack.length-1];u.type,u.meta=s}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(s){const u=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),f=this.stack[this.stack.length-1];f.type,this.exit(s),f.value=u;const c=f.data.hChildren[0];c.type,c.tagName,c.children.push({type:"text",value:u}),this.data.mathFlowInside=void 0}function o(s){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},s),this.buffer()}function l(s){const u=this.resume(),f=this.stack[this.stack.length-1];f.type,this.exit(s),f.value=u,f.data.hChildren.push({type:"text",value:u})}function a(s){this.config.enter.data.call(this,s),this.config.exit.data.call(this,s)}}function mh(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),r.peek=i,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:` +`,inConstruct:"mathFlowMeta"},{character:"$",after:t?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:n,inlineMath:r}};function n(o,l,a,s){const u=o.value||"",f=a.createTracker(s),c="$".repeat(Math.max(Ei(u,"$")+1,2)),p=a.enter("mathFlow");let h=f.move(c);if(o.meta){const m=a.enter("mathFlowMeta");h+=f.move(a.safe(o.meta,{after:` +`,before:h,encode:["$"],...f.current()})),m()}return h+=f.move(` +`),u&&(h+=f.move(u+` +`)),h+=f.move(c),p(),h}function r(o,l,a){let s=o.value||"",u=1;for(t||u++;new RegExp("(^|[^$])"+"\\$".repeat(u)+"([^$]|$)").test(s);)u++;const f="$".repeat(u);/[^ \r\n]/.test(s)&&(/^[ \r\n]/.test(s)&&/[ \r\n]$/.test(s)||/^\$|\$$/.test(s))&&(s=" "+s+" ");let c=-1;for(;++cu&&(u=f):f&&(u!==void 0&&u>-1&&s.push(` +`.repeat(u)||" "),u=-1,s.push(f))}return s.join("")}function Qi(e,t,n){return e.type==="element"?Gh(e,t,n):e.type==="text"?n.whitespace==="normal"?Yi(e,n):Qh(e):[]}function Gh(e,t,n){const r=Xi(e,n),i=e.children||[];let o=-1,l=[];if(Uh(e))return l;let a,s;for(Yt(e)||Lr(e)&&zr(t,e,Lr)?s=` +`:Vh(e)?(a=2,s=2):Gi(e)&&(a=1,s=1);++ox.jsx("div",{className:t,children:x.jsx(Zu,{remarkPlugins:[hh,Ch],rehypePlugins:[tp],components:{a:({href:n,children:r,...i})=>x.jsx("a",{href:n,target:"_blank",rel:"noopener noreferrer",...i,children:r})},children:e})}),rp=[["new","newest"],["cited","most cited"]],pp=()=>{var c,p,h,m;const{methodSlug:e}=ol(),[t,n]=yt.useState("new"),r=Sn({queryKey:["method",e],queryFn:()=>kt.getMethod(e),enabled:!!e,staleTime:10*60*1e3}),i=t==="cited"?"citation_count":"date_published",o=ul({queryKey:["method-papers-infinite",e,i],queryFn:({pageParam:y=1})=>kt.getMethodPapers(e,{page:y,page_size:20,order_by:i,order_dir:"desc",include_resources:!0}),getNextPageParam:y=>y.next_page,initialPageParam:1,enabled:!!e,staleTime:5*60*1e3,placeholderData:sl}),l=Sn({queryKey:["methods-by-area",(c=r.data)==null?void 0:c.area_id,(p=r.data)==null?void 0:p.id],queryFn:()=>kt.getMethods({area_id:r.data.area_id,exclude_id:r.data.id,ordering:"-paper_count",page_size:8}),enabled:!!((h=r.data)!=null&&h.area_id),staleTime:10*60*1e3,select:y=>y.results}),a=yt.useMemo(()=>{var A;return(((A=o.data)==null?void 0:A.pages.flatMap(b=>b.results))||[]).map(hl)},[o.data]),{targetRef:s,isIntersecting:u}=pl({rootMargin:"200px"});if(yt.useEffect(()=>{u&&o.hasNextPage&&!o.isFetchingNextPage&&o.fetchNextPage()},[u,o.hasNextPage,o.isFetchingNextPage]),r.isLoading)return x.jsxs("div",{className:"page",children:[x.jsx(bt,{className:"h-12 w-1/2 mb-4"}),x.jsx(bt,{className:"h-64 w-full"})]});if(r.error||!r.data)return x.jsx("div",{className:"page",children:x.jsx(ml,{variant:"destructive",children:x.jsx(dl,{children:"Method not found."})})});const f=r.data;return x.jsxs("div",{className:"page",children:[x.jsxs("div",{className:"breadcrumb",children:[x.jsx(al,{to:"/methods",children:"Methods"}),x.jsx("span",{className:"sep",children:"/"}),x.jsx("span",{style:{color:"var(--ink)"},children:f.name})]}),x.jsxs("div",{className:"tag-hero method-hero-grid",children:[x.jsxs("div",{children:[x.jsx("div",{className:"tag-hero-eyebrow",children:"METHOD"}),x.jsx("h1",{className:"tag-hero-title",style:{fontFamily:"var(--mono)",fontSize:48,letterSpacing:"-0.01em"},children:f.name}),f.full_name&&f.full_name!==f.name&&x.jsx("div",{style:{fontFamily:"var(--serif)",fontSize:16,fontStyle:"italic",color:"var(--ink-soft)",marginTop:8},children:f.full_name}),f.description&&x.jsx(np,{className:"method-description",text:f.description}),f.source_url&&f.source_title&&x.jsxs("div",{className:"method-source",children:[x.jsx("span",{className:"method-source-label",children:"Source"}),x.jsxs("a",{className:"method-source-link",href:f.source_url,target:"_blank",rel:"noopener noreferrer",children:[x.jsx("span",{className:"method-source-title",children:f.source_title}),f.introduced_year&&x.jsx("span",{className:"method-source-meta",children:f.introduced_year})]})]}),x.jsxs("div",{className:"tag-hero-meta",children:[x.jsxs("div",{className:"stat",children:[x.jsx("span",{className:"label",children:"Papers using"}),x.jsx("span",{className:"value",children:(f.paper_count??0).toLocaleString()})]}),f.introduced_year!=null&&x.jsxs("div",{className:"stat",children:[x.jsx("span",{className:"label",children:"Introduced"}),x.jsx("span",{className:"value",children:f.introduced_year})]})]})]}),x.jsxs("figure",{className:"method-figure-card",children:[x.jsx("div",{className:"method-figure-svg",children:x.jsx(Cl,{method:f})}),x.jsxs("figcaption",{children:["Figure · schematic of ",f.name,f.image_credit&&x.jsxs(x.Fragment,{children:[x.jsx("br",{}),x.jsx("span",{style:{fontSize:10,fontFamily:"var(--mono)",color:"var(--ink-faint)"},children:f.image_credit})]})]})]})]}),(((m=l.data)==null?void 0:m.length)??0)>0&&x.jsxs("div",{className:"filter-row",children:[x.jsx("span",{className:"label",children:"Related methods"}),l.data.map(y=>x.jsx(cl,{method:{slug:y.slug,name:y.name}},y.id))]}),x.jsxs("div",{className:"sort-bar",children:[x.jsx("div",{className:"sort-options",children:rp.map(([y,A])=>x.jsx("button",{className:`sort-btn ${t===y?"active":""}`,onClick:()=>n(y),children:A},y))}),x.jsxs("div",{className:"results-count",children:[a.length," papers using ",f.name]})]}),o.isLoading?x.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((y,A)=>x.jsx(bt,{className:"h-40 w-full"},A))}):a.length===0?x.jsx("div",{className:"no-results",children:"No papers tagged with this method yet."}):x.jsxs(x.Fragment,{children:[x.jsx("div",{className:"paper-list",children:a.map((y,A)=>x.jsx(fl,{paper:y,rank:A+1},y.id))}),x.jsx("div",{ref:s,style:{height:1}}),o.isFetchingNextPage&&x.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{pp as default};