var zZ={blockQuote:0,breakLine:1,breakThematic:2,codeBlock:3,codeInline:4,footnote:5,footnoteReference:6,frontmatter:7,gfmTask:8,heading:9,htmlBlock:10,htmlComment:11,htmlSelfClosing:12,image:13,link:14,orderedList:15,paragraph:16,ref:17,refCollection:18,table:19,text:20,textFormatted:21,unorderedList:22},v=zZ;import{decodeEntity as WZ}from"markdown-to-jsx/entities";var I=32,P=9,W9=13,g=10,a=96,A0=126,z0=91,K9=94,d=62,Q9=35,$$=37,u=45,E0=61,v0=92,O0=42,K0=95,e=60,Z$=64,m0=93,S0=33,w$=38,g0=58,R$=70,O9=102,E9=104,U9=119,T9=116,U$=112,y$=115,n$=160,s$=12,t$=44,k$=59,r9=63,u0=46,H0=47,R9=39,H9=34,D9=43,N0=124,y9=123,q$=125,i0=40,a0=41,o9=30,F$=31,o=48,l=57,p=65,c=90,Y0=97,U0=122,l9=128,r0=32;function Y6($){if(!Z6($,"---"))return null;let Z=3;for(;Z<$.length&&($[Z]===" "||$[Z]==="	");)Z++;if(Z<$.length&&$[Z]==="\r"&&Z++,Z>=$.length||$[Z]!==`
`)return null;Z++;let J=!1;for(;Z<$.length;){let Q=Z;for(;Z<$.length&&$[Z]!==`
`&&$[Z]!=="\r";)Z++;if(Z>=$.length)break;let V=Z;if($[Z]==="\r"&&Z++,Z<$.length&&$[Z]===`
`&&Z++,Z6($,"---",Q))return{endPos:Z,hasValidYaml:J};if(!J){let X=jZ($,Q,V);if(X<V){let Y=$.charCodeAt(X);if(Y>=Y0&&Y<=U0||Y>=p&&Y<=c||Y>=o&&Y<=l||Y===K0){for(X++;X<V&&(Y=$.charCodeAt(X),Y>=Y0&&Y<=U0||Y>=p&&Y<=c||Y>=o&&Y<=l||Y===K0||Y===u||Y===u0);)X++;X<V&&$.charCodeAt(X)===g0&&(X++,X>=V?J=!0:(Y=$.charCodeAt(X),(Y===I||Y===P)&&(J=!0)))}}}}return null}var OZ=/&([a-zA-Z0-9]+|#[0-9]{1,7}|#x[0-9a-fA-F]{1,6});/gi,HZ={class:"className",for:"htmlFor",allowfullscreen:"allowFullScreen",allowtransparency:"allowTransparency",autocomplete:"autoComplete",autofocus:"autoFocus",autoplay:"autoPlay",cellpadding:"cellPadding",cellspacing:"cellSpacing",charset:"charSet",classid:"classId",colspan:"colSpan",contenteditable:"contentEditable",contextmenu:"contextMenu",crossorigin:"crossOrigin",enctype:"encType",formaction:"formAction",formenctype:"formEncType",formmethod:"formMethod",formnovalidate:"formNoValidate",formtarget:"formTarget",frameborder:"frameBorder",hreflang:"hrefLang",inputmode:"inputMode",keyparams:"keyParams",keytype:"keyType",marginheight:"marginHeight",marginwidth:"marginWidth",maxlength:"maxLength",mediagroup:"mediaGroup",minlength:"minLength",novalidate:"noValidate",radiogroup:"radioGroup",readonly:"readOnly",rowspan:"rowSpan",spellcheck:"spellCheck",srcdoc:"srcDoc",srclang:"srcLang",srcset:"srcSet",tabindex:"tabIndex",usemap:"useMap",viewbox:"viewBox"};function AJ($){var Z={};for(var J in $){var Q=J.toLowerCase(),V=HZ[Q];if(V)Z[V]=$[J];else{var X=J.indexOf(":");X!==-1?Z[J.slice(0,X)+J[X+1].toUpperCase()+J.slice(X+2)]=$[J]:Z[J]=$[J]}}return Z}var jJ=/(\n|^[-*]\s|^#|^ {2,}|^-{2,}|^>\s|^<(div|p|h[1-6]|ul|ol|li|blockquote|pre|table|thead|tbody|tr|td|th|dl|dt|dd|hr|address|article|aside|details|dialog|figure|figcaption|footer|form|header|main|menu|nav|section|summary|textarea|fieldset|legend|center|dir|hgroup|marquee|search|output|template)\b)/i;function W$($){return $.indexOf("&")===-1?$:$.replace(OZ,(Z,J)=>{var Q=WZ(J);if(Q)return Q;if(J[0]==="#"){var V=J[1]==="x"||J[1]==="X"?parseInt(J.slice(2),16):parseInt(J.slice(1),10);return V===0||V>=55296&&V<=57343||V>1114111?"\uFFFD":V<=65535?String.fromCharCode(V):String.fromCharCode(55296+(V-65536>>10),56320+(V-65536&1023))}return Z})}var $6=/(javascript|vbscript|data(?!:image)):/i;function L$($){if($6.test($))return null;if($.indexOf("%")===-1)return $;try{let Z=decodeURIComponent($).replace(/[^A-Za-z0-9/:]/g,"");if($6.test(Z))return null}catch{return null}return $}var x0={},T0,w0;for(T0=[192,193,194,195,196,197,224,225,226,227,228,229,230,198],w0=0;w0<T0.length;w0++)x0[T0[w0]]="a";for(x0[231]=x0[199]="c",x0[240]=x0[208]="d",T0=[200,201,202,203,233,232,234,235],w0=0;w0<T0.length;w0++)x0[T0[w0]]="e";for(T0=[207,239,206,238,205,237,204,236],w0=0;w0<T0.length;w0++)x0[T0[w0]]="i";for(x0[209]=x0[241]="n",T0=[248,216,339,338,213,245,212,244,211,243,210,242],w0=0;w0<T0.length;w0++)x0[T0[w0]]="o";for(T0=[220,252,219,251,218,250,217,249],w0=0;w0<T0.length;w0++)x0[T0[w0]]="u";x0[376]=x0[255]=x0[221]=x0[253]="y";function i9($){for(var Z="",J=-1,Q=$.length,V=0;V<Q;V++){var X=$.charCodeAt(V);if(X>=Y0&&X<=U0||X>=o&&X<=l){J<0&&(J=V);continue}if(X>=p&&X<=c){J>=0&&(Z+=$.slice(J,V),J=-1),Z+=String.fromCharCode(X+r0);continue}if(X===I||X===u){J>=0&&(Z+=$.slice(J,V),J=-1),Z+="-";continue}J>=0&&(Z+=$.slice(J,V),J=-1);var Y=x0[X];Y&&(Z+=Y)}return J>=0&&(Z+=$.slice(J)),Z}function Z6($,Z,J){return $.startsWith(Z,J)}var J6=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr","circle","ellipse","line","path","polygon","polyline","rect","use","stop","animate","set"]);function C9($){let Z=$.toLowerCase();if(J6.has(Z))return!0;let J=Z.indexOf(":");return J!==-1?(Z=Z.slice(J+1),J6.has(Z)):!1}var B9=1,Q6=2,f9=4,V6=8,DZ=16,n0=32,M9=64,X6=1,BZ=2,MZ=3,AZ=4,G6=(function(){var $=new Uint8Array(128),Z;for($[P]=B9,$[g]=B9|Q6,$[s$]=B9,$[W9]=B9|Q6,$[I]=B9,Z=S0;Z<=H0;Z++)$[Z]=f9;for(Z=g0;Z<=Z$;Z++)$[Z]=f9;for(Z=z0;Z<=a;Z++)$[Z]=f9;for(Z=y9;Z<=A0;Z++)$[Z]=f9;for(Z=o;Z<=l;Z++)$[Z]=DZ;for(Z=p;Z<=c;Z++)$[Z]=V6;for(Z=Y0;Z<=U0;Z++)$[Z]=V6;return $})(),vJ=(function(){let $=new Uint8Array(128);return $[v0]=BZ,$[z0]=AZ,$[O0]=$[K0]=$[A0]=$[E0]=MZ,$[a]=$[e]=$[Z$]=$[m0]=$[g]=$[I]=$[S0]=X6,$[O9]=$[E9]=$[U9]=X6,$})(),K6=/[\p{P}\p{S}]/u,U6=/\p{Zs}/u,h9=[];function S$($){var Z=$.indexOf("\r"),J=$.indexOf("\0");if(Z===-1&&J===-1)return $;var Q=$.length;h9.length=0;var V=0,X=0;for(Z===-1?X=J:J===-1?X=Z:X=Z<J?Z:J;X<Q;X++){var Y=$.charCodeAt(X);Y===W9?(V<X&&h9.push($.slice(V,X)),X+1<Q&&$.charCodeAt(X+1)===g&&X++,h9.push(`
`),V=X+1):Y===0&&(V<X&&h9.push($.slice(V,X)),h9.push("\uFFFD"),V=X+1)}return V<Q&&h9.push($.slice(V)),h9.join("")}function jZ($,Z,J){let Q=J??$.length;for(;Z<Q&&($[Z]===" "||$[Z]==="	");)Z++;return Z}function _J($){if(!$)return!1;for(var Z in $)return!0;return!1}function q6($,Z,J){for(var Q=$,V=Z.split("."),X=0;X<V.length&&(Q=Q?.[V[X]],Q!==void 0);)X++;return Q||J}function NJ($){for(var Z=!1,J=0;J<$.length;J++){var Q=$.charCodeAt(J);if(Q<=I||Q===H9||Q===$$||Q===e||Q===d||Q===z0||Q===v0||Q===m0||Q===K9||Q===a||Q>=123){Z=!0;break}}if(!Z)return $;for(var V="",J=0;J<$.length;J++){var Q=$.charCodeAt(J);if(Q===$$&&J+2<$.length){var X=$.charCodeAt(J+1),Y=$.charCodeAt(J+2);if((X>=o&&X<=l||X>=p&&X<=R$||X>=Y0&&X<=O9)&&(Y>=o&&Y<=l||Y>=p&&Y<=R$||Y>=Y0&&Y<=O9)){V+=$[J]+$[J+1]+$[J+2],J+=2;continue}}V+=encodeURI($[J])}return V}function IJ(...$){return $.filter(Boolean).join(" ")}function g$($,Z){if(!Z)return $;let J=q6(Z,$,void 0);return typeof J=="string"?J:typeof J=="object"&&J.component?J.component:$}function x$($,Z){if(!Z)return{};let J=q6(Z,$,void 0);return typeof J=="object"&&J.props?J.props:{}}var vZ=new Set(["title","textarea","style","xmp","iframe","noembed","noframes","script","plaintext"]),z$=/<(\/?)(title|textarea|style|xmp|iframe|noembed|noframes|script|plaintext)(\s|>|\/)/gi;function PJ($){return vZ.has($.toLowerCase())}function bJ($){return z$.lastIndex=0,z$.test($)}function wJ($){return z$.lastIndex=0,$.replace(z$,function(Z,J,Q,V){return"&lt;"+J+Q+V})}var gJ=/^<([a-zA-Z][a-zA-Z0-9-]*)\s[^>]*>/,xJ=/^<[A-Z]/,E$=["script","pre","style","textarea"],V$=new Set(E$),NZ=/<(?:pre|script|style|textarea)\b/i,F6=/<(?:pre|script|style|textarea)\b/iy,z6=/^(\s{0,3}#[#\s]|\s{0,3}[-*+]\s|\s{0,3}\d+\.\s|\s{0,3}>\s|\s{0,3}```)/m,W6=/^<([a-z][^ >/\n\r]*) ?([^>]*?)>/im,N6=new Uint8Array(128);(function(){for(var $=[a,O0,K0,A0,E0,z0,S0,e,v0,F$,E9,U9,O9],Z=0;Z<$.length;Z++)N6[$[Z]]=1})();var O6=/([a-zA-Z_][a-zA-Z0-9_-]*)=(?:"([^"]*)"|'([^']*)')/g;function EJ($){return V$.has($)}function TJ($){return NZ.test($)}function I6($,Z,J){for(var Q=Z,V=J;Q<V&&($.charCodeAt(Q)===I||$.charCodeAt(Q)===P);)Q++;if(Q>=V)return!1;$.charCodeAt(Q)===N0&&Q++;for(var X=0;Q<V;){for(;Q<V&&($.charCodeAt(Q)===I||$.charCodeAt(Q)===P);)Q++;if(Q>=V)break;if($.charCodeAt(Q)===N0&&X>0){for(var Y=Q+1;Y<V&&($.charCodeAt(Y)===I||$.charCodeAt(Y)===P);)Y++;if(Y>=V)return!0}if($.charCodeAt(Q)===g0&&Q++,Q>=V||$.charCodeAt(Q)!==u)return!1;for(;Q<V&&$.charCodeAt(Q)===u;)Q++;for(Q<V&&$.charCodeAt(Q)===g0&&Q++,X++;Q<V&&($.charCodeAt(Q)===I||$.charCodeAt(Q)===P);)Q++;if(Q<V)if($.charCodeAt(Q)===N0)Q++;else return!1}return X>0}function j9($,Z){if($.charCodeAt(Z)!==e)return null;let J=Z+1,Q=$.length,V=!1;$.charCodeAt(J)===H0&&(J++,V=!0);let X=J,Y=$.charCodeAt(J);if(!(Y>=Y0&&Y<=U0||Y>=p&&Y<=c))return null;for(;J<Q&&($.charCodeAt(J)>=Y0&&$.charCodeAt(J)<=U0||$.charCodeAt(J)>=p&&$.charCodeAt(J)<=c||$.charCodeAt(J)>=o&&$.charCodeAt(J)<=l||$.charCodeAt(J)===u);)J++;let G=$.slice(X,J);if(!G)return null;let K=J;for(;J<Q&&($.charCodeAt(J)===I||$.charCodeAt(J)===P||$.charCodeAt(J)===g);)J++;let U=$.slice(K,J);if(J===K&&J<Q){var q=$.charCodeAt(J);if(q!==d&&q!==H0)return null}let F=J,O={},W=!1;for(;J<Q;){let k=$.charCodeAt(J);if(k===d){let x=$.slice(F,J);return{tag:G,attrs:O,selfClosing:!1,end:J+1,rawAttrs:x,whitespaceBeforeAttrs:U,isClosing:V,hasSpaceBeforeSlash:W}}if(k===I||k===P||k===g){J++;continue}if(k===H0&&J+1<Q&&$.charCodeAt(J+1)===d){let x=$.slice(F,J);return W=J>F&&$.charCodeAt(J-1)===I,{tag:G,attrs:O,selfClosing:!0,end:J+2,rawAttrs:x,whitespaceBeforeAttrs:U,isClosing:V,hasSpaceBeforeSlash:W}}var M=J,D=$.charCodeAt(J);if(!(D>=Y0&&D<=U0||D>=p&&D<=c||D===K0||D===g0))return null;for(J++;J<Q;){var z=$.charCodeAt(J);if(z>=Y0&&z<=U0||z>=p&&z<=c||z>=o&&z<=l||z===K0||z===u0||z===g0||z===u)J++;else break}for(var j=$.slice(M,J);J<Q&&($.charCodeAt(J)===I||$.charCodeAt(J)===P);)J++;if($.charCodeAt(J)!==E0){O[j]="";continue}for(J++;J<Q&&($.charCodeAt(J)===I||$.charCodeAt(J)===P);)J++;var B=$.charCodeAt(J);if(B===H9||B===R9){J++;for(var N=J;J<Q&&$.charCodeAt(J)!==B;)J++;if(J>=Q)return null;if(O[j]=$.slice(N,J),J++,J<Q){var R=$.charCodeAt(J);if(R!==I&&R!==P&&R!==g&&R!==d&&R!==H0)return null}}else if(B===y9){var _=1,N=J;for(J++;J<Q&&_>0;){var z=$.charCodeAt(J);z===y9?_++:z===q$&&_--,J++}O[j]=$.slice(N,J)}else{for(var N=J;J<Q;){var H=$.charCodeAt(J);if(H===I||H===P||H===d||H===g||H===H9||H===R9||H===E0||H===e||H===a)break;J++}if(J===N)return null;O[j]=$.slice(N,J)}}return null}function P6($,Z,J){if(!J.streaming&&!J.optimizeForStreaming&&$.indexOf("[")===-1)return!1;for(var Q=0,V=$.length,X=!1,Y=!1;Q<V;){for(var G=$.indexOf(`
`,Q),K=G<0?V:G,U=Q,q=0;U<K&&q<4;)if($.charCodeAt(U)===I)q++,U++;else if($.charCodeAt(U)===P)q+=4,U++;else break;if(U>=K){X=!1,Q=G<0?V:G+1;continue}if(q<4){var F=$.charCodeAt(U);if(F===a||F===A0){for(var O=F,W=0,M=U;M<K&&$.charCodeAt(M)===O;)W++,M++;if(W>=3){var D=!0;if(O===a){for(var z=M;z<K;z++)if($.charCodeAt(z)===a){D=!1;break}}if(D){X=!1;for(var j=G<0?V:G+1;j<V;){for(var B=j,N=0;B<V&&N<4;){var R=$.charCodeAt(B);if(R===I)N++,B++;else if(R===P)N+=4,B++;else break}if(N<4&&B<V&&$.charCodeAt(B)===O){for(var _=0;B<V&&$.charCodeAt(B)===O;)_++,B++;if(_>=W){for(;B<V&&($.charCodeAt(B)===I||$.charCodeAt(B)===P);)B++;if(B>=V||$.charCodeAt(B)===g){Q=B>=V?V:B+1;break}}}for(;j<V&&$.charCodeAt(j)!==g;)j++;j<V&&j++}j>=V&&(Q=V,Y=!0);continue}}}}for(var H=U;H<K&&$.charCodeAt(H)===d;){H++,H<K&&$.charCodeAt(H)===I&&H++;for(var k=0;H<K&&k<4;)if($.charCodeAt(H)===I)k++,H++;else if($.charCodeAt(H)===P)k+=4,H++;else break;if(k>=4)break;X=!1}if(!X&&q<4&&H<K&&$.charCodeAt(H)===z0&&!(H+1<V&&$.charCodeAt(H+1)===K9)){var x=b6($,H,Z);if(x){Q=x,X=!1;continue}}var w=$.charCodeAt(U);if(w===Q9&&q<4)X=!1;else if(q<4&&(w===u||w===O0||w===K0)){for(var b=U,y=0;b<K;){var L=$.charCodeAt(b);if(L===w)y++;else if(L!==I&&L!==P)break;b++}X=!(y>=3&&b>=K)}else X=!0;Q=G<0?V:G+1}return Y}function b6($,Z,J){let Q=$.length;if($.charCodeAt(Z)!==z0)return null;let V=Z+1<Q&&$.charCodeAt(Z+1)===K9,X=Z+1;for(;X<Q;){var Y=$.charCodeAt(X);if(Y===m0){X++;break}if(Y===z0)return null;Y===v0&&X+1<Q&&X++,X++}if(X>Q||$.charCodeAt(X-1)!==m0)return null;let G=$.slice(Z+1,X-1);if(G.length>999)return null;let K=O$(G);if(!K||X>=Q||$.charCodeAt(X)!==g0)return null;X++;let U=!1;for(;X<Q;){let T=$.charCodeAt(X);if(T===I||T===P)X++;else if(T===g&&!U)U=!0,X++;else break}if(V){let T=$.indexOf(`
`,X),f=T<0?Q:T,h=$.slice(X,f).trim();return J[K]={target:h,title:void 0},T<0?Q:T+1}var q;if(X<Q&&$.charCodeAt(X)===e){X++;for(var F=X;X<Q&&$.charCodeAt(X)!==d&&$.charCodeAt(X)!==g;)$.charCodeAt(X)===v0&&X+1<Q&&X++,X++;if(X>=Q||$.charCodeAt(X)!==d)return null;q=$.slice(F,X),X++;for(var O=$.indexOf(`
`,X),W=O<0?Q:O,M=X;M<W&&($.charCodeAt(M)===I||$.charCodeAt(M)===P);)M++;if(M<W){if(M===X)return null;var D=$.charCodeAt(M);if(D!==H9&&D!==R9&&D!==i0)return null}}else{for(var F=X,z=0;X<Q;){var Y=$.charCodeAt(X);if(Y===i0)z++;else if(Y===a0){if(z===0)break;z--}else{if(Y===I||Y===P||Y===g)break;Y===v0&&X+1<Q&&X++}X++}if(q=$.slice(F,X),!q)return null}for(;X<Q&&($.charCodeAt(X)===I||$.charCodeAt(X)===P);)X++;var j=$.indexOf(`
`,X),B=j<0?Q:j,N,R=!1,_=X,H=X;if(X===B&&X<Q)for(H=X+1;H<Q&&($.charCodeAt(H)===I||$.charCodeAt(H)===P);)H++;if(H<Q){var k=$.charCodeAt(H);if(k===H9||k===R9||k===i0){for(var x=k===i0?41:k,w=H+1,b=w;w<Q;){var y=$.charCodeAt(w);if(y===x){for(var L=w+1;L<Q&&($.charCodeAt(L)===I||$.charCodeAt(L)===P);)L++;(L>=Q||$.charCodeAt(L)===g)&&(N=$.slice(b,w),R=!0,_=L<Q?L+1:Q);break}if(y===v0&&w+1<Q){w+=2;continue}if(y===g&&w+1<Q&&$.charCodeAt(w+1)===g)break;w++}if(!R&&H===X)return null}}if(R)return J[K]||(J[K]={target:n9(q),title:N!==void 0?W$(n9(N)):N}),_;for(;X<B&&($.charCodeAt(X)===I||$.charCodeAt(X)===P);)X++;return X<B?null:(J[K]||(J[K]={target:n9(q),title:N}),j<0?Q:j+1)}var f0=new Uint8Array(G6);for(f0[F$]=B9,f0[Q9]|=n0,f0[d]|=n0,f0[u]|=n0|M9,f0[D9]|=n0,f0[O0]|=n0|M9,f0[K0]|=n0|M9,f0[a]|=n0|M9,f0[A0]|=n0|M9,f0[e]|=n0|M9,f0[z0]|=M9,f0[S0]|=M9,f0[N0]|=n0,J$=o;J$<=l;J$++)f0[J$]|=n0;var J$;function H6($){if($.indexOf("[")<0&&$.indexOf("]")<0)return!1;for(var Z=0;Z<$.length;Z++){if($.charCodeAt(Z)===v0){Z++;continue}if($.charCodeAt(Z)===z0||$.charCodeAt(Z)===m0)return!0}return!1}function O$($){var Z=$.replace(/\s+/g," ").trim();return Z.indexOf("\u1E9E")!==-1?Z.replace(/\u1E9E/g,"ss").toLowerCase():Z.toLowerCase()}function f$($){return $<l9?f0[$]:$===n$?B9:0}function n9($){return $.replace(/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,"$1")}var w6=null,R6=-1,y6=-1;function J0($,Z){if(Z===R6&&$===w6)return y6;var J=$.indexOf(`
`,Z);return J<0?$.length:J}function i($,Z){let J=J0($,Z);return J<$.length?J+1:J}function Q$($,Z,J){for(;Z<J;){let Q=$.charCodeAt(Z);if(Q!==I&&Q!==P)break;Z++}return Z}function D6($,Z){let J=i($,Z);for(;J<$.length;){let Q=J0($,J);if(p0($,J,Q))return J;J=i($,J)}return $.length}function _9($,Z,J,Q){let V=0;for(;Z+V<J&&$.charCodeAt(Z+V)===Q;)V++;return V}var $0=0,t=0;function j0($,Z,J){for($0=0,t=0;Z+t<J;){let Q=$.charCodeAt(Z+t);if(Q===P)$0+=4-$0%4;else if(Q===I)$0++;else break;t++}}function p0($,Z,J){return Q$($,Z,J)>=J}function k6($,Z,J,Q){let V=J0($,Z);if(j0($,Z,V),$0>3)return null;let X=Z+t;if($.charCodeAt(X)!==Q9)return null;let Y=_9($,X,V,35);if(Y<1||Y>6||(X+=Y,X<V&&$.charCodeAt(X)!==I&&$.charCodeAt(X)!==P))return null;X=Q$($,X,V);for(var G=V;G>X&&$.charCodeAt(G-1)===I;)G--;for(var K=G;G>X&&$.charCodeAt(G-1)===Q9;)G--;if(G<K)if(G===X||$.charCodeAt(G-1)===I)for(;G>X&&$.charCodeAt(G-1)===I;)G--;else G=K;let U=$.slice(X,G),q=h0(U,0,U.length,J,Q),O=(Q?.slugify||i9)(U);return{node:{type:v.heading,level:Y,children:q,id:O},end:i($,V)}}function IZ($,Z,J){var Q=$.charCodeAt(Z);if(Q!==E0&&Q!==u)return!1;for(var V=Z;V<J&&$.charCodeAt(V)===Q;)V++;for(;V<J&&($.charCodeAt(V)===I||$.charCodeAt(V)===P);)V++;return V>=J}function S9($,Z){let J=J0($,Z);if(j0($,Z,J),$0>3)return null;let Q=Z+t,V=$.charCodeAt(Q);if(V!==u&&V!==O0&&V!==K0)return null;let X=0;for(;Q<J;){let Y=$.charCodeAt(Q);if(Y===V)X++;else if(Y!==I&&Y!==P)return null;Q++}return X<3?null:{node:{type:v.breakThematic},end:i($,J)}}function PZ($,Z,J){let Q=J0($,Z);if(j0($,Z,Q),$0>3)return null;let V=$0,X=t,Y=Z+t,G=$.charCodeAt(Y);if(G!==a&&G!==A0)return null;let K=_9($,Y,Q,G);if(K<3)return null;Y+=K;let U=Q$($,Y,Q),q=Q;if(G===a){for(let w=U;w<Q;w++)if($.charCodeAt(w)===a)return null}for(;q>U&&($.charCodeAt(q-1)===I||$.charCodeAt(q-1)===P);)q--;let F=$.slice(U,q),O="",W="",M=F.indexOf(" ");M===-1?O=F:(O=F.slice(0,M),W=F.slice(M+1).trim()),O=n9(O);var D=void 0;if(W){O6.lastIndex=0;for(var z;(z=O6.exec(W))!==null;)D||(D={}),D[z[1]]=z[2]!==void 0?z[2]:z[3]}let j=i($,Q),B=j,N=$.length;for(;B<$.length;){let w=J0($,B);if(j0($,B,w),$0<4){let b=B+t;var R=_9($,b,w,G);if(R>=K){let y=b+R;if(p0($,y,w)){N=i($,w);break}}}B=i($,w)}var _;if(V===0)_=B>j&&$.charCodeAt(B-1)===g?$.slice(j,B-1):$.slice(j,B);else{_="";for(var H=j;H<B;){var k=J0($,H);j0($,H,k);var x=Math.min(t,V);_+=$.slice(H+x,k)+`
`,H=i($,k)}_.length>0&&_.charCodeAt(_.length-1)===g&&(_=_.slice(0,-1))}return{node:{type:v.codeBlock,lang:O||void 0,text:_,infoString:W||void 0,attrs:D},end:N}}function bZ($,Z){let J=J0($,Z);if(j0($,Z,J),$0<4)return null;let Q="",V=Z;for(;V<$.length;){let W=J0($,V);if(j0($,V,W),p0($,V,W)){for(var X=0,Y=i($,W);Y<$.length;){var G=J0($,Y);if(p0($,Y,G)){X++,Y=i($,G);continue}if(j0($,Y,G),$0>=4){for(var K=0;K<=X;K++)Q+=`
`;V=Y;break}break}if(V!==Y)break;continue}if($0<4)break;let M=0,D=0;var U=0;for(let z=V;z<W&&D<4;z++){if($.charCodeAt(z)===P){var q=4-D%4;D+q>4&&(U=D+q-4),D+=q}else D++;M++}var F="";if(U>0)for(var O=0;O<U;O++)F+=" ";F+=$.slice(V+M,W),Q+=F+`
`,V=i($,W)}for(;Q.length>0&&Q.charCodeAt(Q.length-1)===g;)Q=Q.slice(0,-1);for(;Q.length>0&&Q.charCodeAt(Q.length-1)===g;)Q=Q.slice(0,-1);return Q?{node:{type:v.codeBlock,lang:void 0,text:Q,infoString:void 0,attrs:void 0},end:V}:null}function wZ($,Z,J,Q){let V=J0($,Z);if(j0($,Z,V),$0>3)return null;let X=Z+t;if($.charCodeAt(X)!==d)return null;let Y="",G=Z,K,U=!1,q=!1,F=!1;for(;G<$.length;){let S=J0($,G);j0($,G,S);let D0=G+t;if($.charCodeAt(D0)===d){let Q0=D0+1;var O=$0+1,W=!1;if(Q0<S){var M=$.charCodeAt(Q0);M===I?(Q0++,O++,W=!0):M===P&&(W=!0)}for(var D="",z=!1,j=Q0;j<S;j++)if($.charCodeAt(j)===P){z=!0;break}if(z){var B=O;if(W&&Q0<S&&$.charCodeAt(Q0)===P){for(var N=4-B%4,R=0;R<N-1;R++)D+=" ";B+=N,Q0++}for(var _=Q0;_<S;_++)if($.charCodeAt(_)===P){for(var H=4-B%4,k=0;k<H;k++)D+=" ";B+=H}else D+=$[_],B++}else D=$.slice(Q0,S);if(!Y&&!K){let m=D.match(/^\[!([A-Za-z]+)\]\s*$/);if(m){K=m[1].toUpperCase(),G=i($,S);continue}}Y+=D+`
`;var x=D.trimStart();x.startsWith("```")||x.startsWith("~~~")?F=!F:D.startsWith("    ")||D.startsWith("	")?F=!0:x.length>0&&!F&&(F=!1),q=x.length>0,G=i($,S)}else if(Y&&!p0($,G,S)&&q){if($0<4){var w=G+t,b=w<S?$.charCodeAt(w):0;if(b===Q9||b===d||b===a||b===A0||b===e||(b===u||b===O0||b===K0)&&S9($,G)||(b===u||b===O0||b===D9)&&w+1<S&&($.charCodeAt(w+1)===I||$.charCodeAt(w+1)===P))break;if(b>=o&&b<=l){for(var y=w;y<S&&$.charCodeAt(y)>=o&&$.charCodeAt(y)<=l;)y++;if(y<S&&($.charCodeAt(y)===u0||$.charCodeAt(y)===a0))break}}if(F)break;Y+=$.slice(G,S)+`
`,U=!0,G=i($,S)}else break}if(!Y&&!K)return null;var{inBlockQuote:L,g:T}=J;J.inBlockQuote=!0,U&&(J.g=!0);let f=v9(Y||"",J,Q);return J.inBlockQuote=L,J.g=T,{node:{type:v.blockQuote,children:f,alert:K||void 0},end:G}}function L6($,Z,J){for(var Q=0,V=Z;V<J;V++)$.charCodeAt(V)===P?Q+=4-Q%4:Q++;return Q}function k9($,Z,J){if(j0($,Z,J),$0>3)return null;var Q=Z+t;if(Q>=J)return null;var V=$.charCodeAt(Q),X=$0,Y=Q;if(V===u||V===O0||V===D9){if(Y=Q+1,Y<J&&$.charCodeAt(Y)!==I&&$.charCodeAt(Y)!==P&&$.charCodeAt(Y)!==g)return null}else if(V>=o&&V<=l){for(var G=Q;G<J&&G-Q<9;){var K=$.charCodeAt(G);if(K<o||K>l)break;G++}if(G>Q&&G<J){var U=$.charCodeAt(G);if(U===u0||U===a0){if(Y=G+1,Y<J&&$.charCodeAt(Y)!==I&&$.charCodeAt(Y)!==P&&$.charCodeAt(Y)!==g)return null}else return null}else return null}else return null;var q=Y,F=L6($,Z,Y),O=0,W=q,M=F;if(q>=J)return{ordered:V>=o&&V<=l,marker:V>=o&&V<=l?$[G]:$[Q],start:V>=o&&V<=l?parseInt($.slice(Q,G),10):void 0,contentStart:q,contentCol:F+1,markerCol:X,isEmpty:!0};for(;W<J&&($.charCodeAt(W)===I||$.charCodeAt(W)===P);){if($.charCodeAt(W)===P){var D=4-M%4;M+=D}else M++;W++,O++}var z=W>=J,j=M-F;return z||j>4?(M=F+1,W=q+1,O=1):O===0&&(M=F+1,W=q,O=1),{ordered:V>=o&&V<=l,marker:V>=o&&V<=l?$[G]:$[Q],start:V>=o&&V<=l?parseInt($.slice(Q,G),10):void 0,contentStart:W,contentCol:M,markerCol:X,isEmpty:z}}var H$=0;function RZ($,Z,J,Q){var V=0,X=Z;for(H$=0;X<J&&V<Q;){var Y=$.charCodeAt(X);if(Y===P){var G=4-V%4;if(V+G>Q){H$=V+G-Q,X++,V=Q;break}V+=G}else if(Y===I)V++;else break;X++}return X}function B6($,Z,J,Q){var V=J0($,Z),X=k9($,Z,V);if(!X)return null;var Y=[],G=Z,K=X.contentCol,U="",q=X.isEmpty,F=!1,O=!1;if(!X.isEmpty){for(var W=!1,M=X.contentStart;M<V;M++)if($.charCodeAt(M)===P){W=!0;break}if(W){var D="",z=L6($,Z,X.contentStart),j=z-X.contentCol;if(j>0)for(var B=0;B<j;B++)D+=" ";for(var N=X.contentStart;N<V;N++)if($.charCodeAt(N)===P){for(var R=4-z%4,_=0;_<R;_++)D+=" ";z+=R}else D+=$[N],z++;U=D+`
`}else U=$.slice(X.contentStart,V)+`
`}for(G=i($,V);G<$.length;){var H=J0($,G);j0($,G,H);var k=$.charCodeAt(G+t);if($0<K&&(k===u||k===O0||k===K0)&&$0<=3&&S9($,G))break;var x=k9($,G,H);if(x&&x.ordered===X.ordered&&x.marker===X.marker&&x.markerCol<K){Y.push({contentCol:K,raw:U,hasBlankAfter:F,isEmpty:q}),F&&(O=!0),K=x.contentCol,q=x.isEmpty,F=!1,U=x.isEmpty?"":$.slice(x.contentStart,H)+`
`,G=i($,H);continue}if(p0($,G,H)){U+=`
`,G=i($,H);for(var w=!1,b=0;b<U.length;b++){var y=U.charCodeAt(b);if(y!==g&&y!==W9&&y!==I&&y!==P){w=!0;break}}if(q&&!w)if(G<$.length){var L=J0($,G),T=k9($,G,L);if(!T||T.ordered!==X.ordered||T.marker!==X.marker)break;F=!0}else break;if(G<$.length){var f=J0($,G);j0($,G,f);var h=$.charCodeAt(G+t);if((h===u||h===O0||h===K0)&&$0<=3&&S9($,G))break;var S=k9($,G,f);if(S&&S.ordered===X.ordered&&S.marker===X.marker&&S.markerCol<K){F=!0;continue}if(!p0($,G,f)&&$0<K)break}continue}if($0>=K){var D0=RZ($,G,H,K);if(H$>0){for(var Q0="",m=K,n=0;n<H$;n++)Q0+=" ",m++;for(var y0=D0;y0<H;y0++)if($.charCodeAt(y0)===P){for(var d0=4-m%4,C0=0;C0<d0;C0++)Q0+=" ";m+=d0}else Q0+=$[y0],m++;U+=Q0+`
`}else U+=$.slice(D0,H)+`
`;G=i($,H);continue}for(var W0=!1,C=0;C<U.length;C++){var B0=U.charCodeAt(C);if(B0!==g&&B0!==W9&&B0!==I&&B0!==P){W0=!0;break}}if(!F&&W0&&!q){var Z0=G+t,G0=$.charCodeAt(Z0),V9=G0===Q9||G0===d||G0===e||G0===a||G0===A0||(G0===u||G0===O0||G0===K0||G0===D9)&&(S9($,G)!==null||k9($,G,H)!==null)||G0>=o&&G0<=l&&k9($,G,H)!==null;if(!V9){U+=""+$.slice(Z0,H)+`
`,G=i($,H);continue}}break}if(Y.push({contentCol:K,raw:U,hasBlankAfter:F,isEmpty:q}),Y.length===0)return null;var V0=O;if(!V0)for(var M0=0;M0<Y.length;M0++){if(Y[M0].hasBlankAfter&&M0<Y.length-1){V0=!0;break}if(!Y[M0].isEmpty){for(var _0=Y[M0].raw,s=_0.length,q0=0,A=!1,r=!1,I0=!1,P0=!1,s0=0,k0=0,X0=-1;q0<s;){var E=_0.indexOf(`
`,q0);if(E<0&&(E=s),P0){j0(_0,q0,E);for(var R0=_0.slice(q0+t,E),F0=0;F0<R0.length&&R0.charCodeAt(F0)===s0;)F0++;F0>=k0&&R0.slice(F0).trim()===""&&(P0=!1),q0=E<s?E+1:s;continue}if(p0(_0,q0,E)){X0>=0?I0=!0:A&&(r=!0),q0=E<s?E+1:s;continue}if(j0(_0,q0,E),X0>=0){if($0>=X0){q0=E<s?E+1:s;continue}var X9=k9(_0,q0,E);if(X9&&X9.markerCol<X0&&X9.contentCol<=X0){q0=E<s?E+1:s;continue}if(X9){q0=E<s?E+1:s;continue}X0=-1,I0&&(r=!0,I0=!1)}var u9=_0.slice(q0+t,E),N9=u9.charCodeAt(0);if((N9===a||N9===A0)&&$0<=3){for(var q9=0;q9<u9.length&&u9.charCodeAt(q9)===N9;)q9++;if(q9>=3){if(r&&A){V0=!0;break}P0=!0,s0=N9,k0=q9,A=!0,q0=E<s?E+1:s;continue}}var Y9=$0<=3?k9(_0,q0,E):null;if(Y9&&A){if(r){V0=!0;break}X0=Y9.contentCol,I0=!1,q0=E<s?E+1:s,A=!0;continue}if(r){V0=!0;break}A=!0,q0=E<s?E+1:s}if(V0)break}}for(var F9=[],g9=0;g9<Y.length;g9++){for(var s9=Y[g9],z9=s9.raw,t0=z9.length;t0>0&&z9.charCodeAt(t0-1)===g;)t0--;var e0=t0<z9.length?z9.slice(0,t0):z9,$9=null;if(e0.length>=3&&e0.charCodeAt(0)===z0){var o0=e0[1];(o0===" "||o0==="x"||o0==="X")&&e0.charCodeAt(2)===m0&&($9={type:v.gfmTask,completed:o0==="x"||o0==="X"},e0=e0.slice(3))}var b0;if(s9.isEmpty&&e0.trim()==="")b0=[];else if(V0){var I9=J.inList;J.inList=!0,b0=v9(e0,J,Q),J.inList=I9}else{var G9=J.inList;if(J.inList=!0,b0=v9(e0,J,Q),J.inList=G9,b0.length===1&&b0[0].type===v.paragraph)b0=b0[0].children;else{for(var Z9=[],P9=0;P9<b0.length;P9++)if(b0[P9].type===v.paragraph)for(var p9=b0[P9].children,J9=0;J9<p9.length;J9++)Z9.push(p9[J9]);else Z9.push(b0[P9]);b0=Z9}}$9?F9.push([$9,{type:v.text,text:" "},...b0]):F9.push(b0)}return{node:{type:X.ordered?v.orderedList:v.unorderedList,start:X.ordered?X.start:void 0,items:F9},end:G}}var D$=new Set(["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"]);function A9($,Z,J){let Q={};for(let[Y,G]of Object.entries($)){let K=Y,U=Y.toLowerCase();if(U==="style"&&typeof G=="string"){let q={},F=[],O=0,W=0;for(let D=0;D<G.length;D++){let z=G.charCodeAt(D);z===i0?O++:z===a0?O--:z===k$&&O===0&&(F.push(G.slice(W,D)),W=D+1)}W<G.length&&F.push(G.slice(W));let M=!1;F.forEach(D=>{let z=D.indexOf(":");if(z===-1)return;let j=D.slice(0,z).trim(),B=D.slice(z+1).trim();if(j&&B){if(/url\s*\(\s*(javascript|vbscript|data:(?!image\/))/i.test(B)){M=!0;return}let N=j.indexOf("-")!==-1?j.replace(/-([a-z])/g,(R,_)=>_.toUpperCase()):j;q[N]=B}}),!M&&Object.keys(q).length>0&&(Q[K]=q)}else if((U==="href"||U==="src")&&J?.sanitizer){let q=J.sanitizer(G,Z,U);q!==null&&(Q[K]=q)}else if(G==="")Q[K]=!0;else if(G.length>=2&&G.charCodeAt(0)===y9&&G.charCodeAt(G.length-1)===q$){var V=G.slice(1,-1);if(V.length>0){var X=V.charCodeAt(0);if(X===z0||X===y9)try{Q[K]=JSON.parse(V);continue}catch{}}if(V==="true"){Q[K]=!0;continue}if(V==="false"){Q[K]=!1;continue}if(J?.evalUnserializableExpressions)try{Q[K]=(0,eval)("("+V+")");continue}catch{}Q[K]=V}else Q[K]=G}return Q}function L9($,Z,J){let Q=Z.length;if(Q===0)return J;var V=Z.charCodeAt(0),X=V>=p&&V<=c||V>=Y0&&V<=U0;if(!X){for(var Y=String.fromCharCode(V),G=$.length-Q,K=J;K<=G;){var U=$.indexOf(Y,K);if(U===-1||U>G)return-1;for(var q=!0,F=1;F<Q;F++){var O=$.charCodeAt(U+F),W=Z.charCodeAt(F);if(O>=p&&O<=c&&(O+=r0),W>=p&&W<=c&&(W+=r0),O!==W){q=!1;break}}if(q)return U;K=U+1}return-1}V>=p&&V<=c&&(V+=r0);for(let D=J;D<=$.length-Q;D++){var M=$.charCodeAt(D);if(M>=p&&M<=c&&(M+=r0),M!==V)continue;let z=!0;for(let j=1;j<Q;j++){let B=$.charCodeAt(D+j),N=Z.charCodeAt(j);if(B>=p&&B<=c&&(B+=r0),N>=p&&N<=c&&(N+=r0),B!==N){z=!1;break}}if(z)return D}return-1}function yZ($,Z,J){let Q=Z.length;var V=Z.charCodeAt(0);V>=p&&V<=c&&(V+=r0);for(let Y=Math.min(J,$.length-Q);Y>=0;Y--){var X=$.charCodeAt(Y);if(X>=p&&X<=c&&(X+=r0),X!==V)continue;let G=!0;for(let K=1;K<Q;K++){let U=$.charCodeAt(Y+K),q=Z.charCodeAt(K);if(U>=p&&U<=c&&(U+=r0),q>=p&&q<=c&&(q+=r0),U!==q){G=!1;break}}if(G)return Y}return-1}var B$=-1;function T$($,Z,J){let Q=J.toLowerCase(),V="<"+Q,X="</"+Q,Y=1,G=Z,K=$.length;for(B$=-1;G<K&&Y>0;){let F=L9($,V,G),O=L9($,X,G);if(O===-1)return-1;if(F!==-1&&F<O){let W=j9($,F);W?(W.tag.toLowerCase()===Q&&!W.isClosing&&!W.selfClosing&&!C9(W.tag)&&Y++,G=W.end):G=F+1}else{var U=O+X.length,q=U<K?$.charCodeAt(U):62;if((q===d||q===I||q===P||q===g)&&(Y--,Y===0)){B$=O;let W=O+X.length;for(;W<K&&$.charCodeAt(W)!==d;)W++;return W+1}G=O+1}}return-1}function S6($,Z,J,Q){if(Q.ignoreHTMLBlocks||Q.disableParsingRawHTML)return null;var V=J0($,Z);if(j0($,Z,V),$0>3&&!J.inHTML)return null;var X=Z+t;if($.charCodeAt(X)!==e)return null;var Y=$.indexOf(">",X+1);if(Y!==-1&&Y<V){var G=$.slice(X+1,Y);if(/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(G)||/^[^\s@]+@[^\s@]+$/.test(G))return null}var K=kZ($,X);if(K>=1&&K<=5){var U=$.length;if(K===1){for(var q=$.length,F=0;F<E$.length;F++){var O=L9($,"</"+E$[F]+">",X);O>=0&&O<q&&(q=O)}if(q<$.length){var W=$.indexOf(">",q);U=W>=0?i($,W+1):$.length}}else{var M=K===2?"-->":K===3?"?>":K===4?">":"]]>",D=$.indexOf(M,X);D>=0&&(U=i($,D+M.length))}var z=$.slice(X,U);if(K>=2)return{node:{type:v.htmlComment,text:z,h:!1,raw:!0,endPos:U},end:U};var j="div",B=z.match(/^<\/?([a-zA-Z][a-zA-Z0-9-]*)/);B&&(j=B[1]);var N=j9($,X),R={},_;N&&!N.isClosing&&(R=A9(N.attrs,j,Q),_=N.whitespaceBeforeAttrs+N.rawAttrs);var H=[],k=j.toLowerCase(),x="</"+k,w=L9(z,x,0),b=z,y="";if(N&&N.isClosing)for(b=z.slice(N.end-X);b.length>0&&b.charCodeAt(b.length-1)===g;)b=b.slice(0,-1);else if(N&&!N.isClosing){var L=N.end-X;if(w!==-1)for(b=z.slice(L),b.charCodeAt(0)===g&&(b=b.slice(1));b.length>0&&b.charCodeAt(b.length-1)===g;)b=b.slice(0,-1);else for(b=z;b.length>0&&b.charCodeAt(b.length-1)===g;)b=b.slice(0,-1);if(w!==-1){var T=z.slice(L,w);y=T.trim()}}var f=N?N.isClosing:!1;return{node:{type:v.htmlBlock,tag:j,attrs:R,f:_,children:H,a:b,text:y,d:!0,b:f,endPos:U,e:!0},end:U}}if(K===6||K===7){var h=D6($,Z),S=h<$.length?h:$.length,D0=$.slice(X,S),Q0=h<$.length?i($,h):$.length,m=j9($,X);if(m){var n=m.tag,y0=n.toLowerCase(),d0=m.isClosing;if(d0){var C0=$.slice(m.end,S);return{node:{type:v.htmlBlock,tag:n,attrs:{},children:[],a:C0,text:C0,d:!0,b:!0,endPos:S,e:K===6},end:Q0}}if(m.selfClosing||C9(n))return{node:{type:v.htmlBlock,tag:n,attrs:A9(m.attrs,n,Q),f:m.whitespaceBeforeAttrs+m.rawAttrs,children:[],a:"",text:"",d:!1,b:!1,endPos:m.end,e:K===6},end:m.end<$.length&&$.charCodeAt(m.end)===g?m.end+1:m.end};var W0=J.c||0,C=$.slice(X,S),B0=-1,Z0=-1;if(W0<10){for(var G0="</"+y0,V9=m.end-X,V0=1,M0=V9;M0<C.length&&V0>0;){var _0=L9(C,"<"+y0,M0),s=L9(C,G0,M0);if(s===-1)break;if(_0!==-1&&_0<s){var q0=_0+y0.length+1;if(q0<C.length){var A=C.charCodeAt(q0);(A===I||A===P||A===g||A===d||A===H0)&&V0++}M0=_0+1}else{var r=s+G0.length;if(r<C.length){var I0=C.charCodeAt(r);if((I0===d||I0===I||I0===P||I0===g)&&(V0--,V0===0)){B0=s;for(var P0=r;P0<C.length&&C.charCodeAt(P0)!==d;)P0++;Z0=P0+1;break}}else if(V0--,V0===0){B0=s,Z0=C.length;break}M0=s+1}}var s0=!1;if(B0===-1&&K===6&&!m.isClosing){var k0=T$($,m.end,y0);if(k0!==-1){for(var X0=B$,E=m.end,R0=!1,F0=!1,X9=!1,u9=0,N9=!1,q9=!1,Y9=E;Y9<X0;){var F9=$.charCodeAt(Y9);if(F9===g)q9&&(R0=!0),N9||u9++,q9=!0,Y9++;else if(F9===I||F9===P)Y9++;else{if(!N9&&(N9=!0,u9>=2&&F9===e)){X9=!0;break}if(q9=!1,F9===e){var g9=$.charCodeAt(Y9+1)|32;if((g9===U$||g9===y$||g9===T9)&&(F6.lastIndex=Y9,F6.test($))){F0=!0;break}}Y9++}}if(R0&&!X9&&!F0){var s9=J0($,k0);S=s9,Q0=i($,s9),C=$.slice(X,S),D0=$.slice(X,S),B0=X0-X,Z0=k0-X,s0=!0}}}}var z9=m.rawAttrs.indexOf(`
`)!==-1||m.whitespaceBeforeAttrs.indexOf(`
`)!==-1,t0=!1;if(B0!==-1){var e0=C.slice(Z0).trim();t0=e0.length===0}var $9=!1,o0=S,b0=Q0;if(B0!==-1){var I9=X+Z0,G9=J0($,I9-1);if(I9<G9){for(var Z9=I9;Z9<G9&&($.charCodeAt(Z9)===I||$.charCodeAt(Z9)===P);)Z9++;if(Z9<G9&&$.charCodeAt(Z9)===e){var P9=j9($,Z9);P9&&!P9.isClosing&&($9=!0,o0=I9,b0=I9,t0=!0)}}if(!$9){var p9=i($,G9);if(p9<S){for(var J9=p9;J9<S&&($.charCodeAt(J9)===I||$.charCodeAt(J9)===P);)J9++;if(J9<S&&$.charCodeAt(J9)===e){var C6=j9($,J9);C6&&($9=!0,o0=G9,b0=p9,t0=!0)}}}if(!$9&&J.inHTML){$9=!0,o0=G9,b0=i($,G9);var m6=$.slice(I9,G9).trim();t0=m6.length===0}}var d9=[],l0="";if(B0!==-1){l0=C.slice(m.end-X,B0);var b9=l0.trim();if(b9){var{inline:u6,inHTML:p6,c:d6}=J;J.inHTML=!0,J.c=W0+1;var c6=y0==="p";if(c6)J.inline=!0,d9=h0(b9,0,b9.length,J,Q);else{var m$=l0.indexOf(`

`)!==-1,u$=z6.test(b9),j$=W6.test(b9),r6=m$||u$||J.inHTML&&j$,o6=l0.length>=2&&l0.charCodeAt(0)===g&&l0.charCodeAt(l0.length-1)===g&&!m$;o6&&!u$&&!j$?d9=[{type:v.text,text:b9}]:r6||j$?(J.inline=!1,d9=v9(l0,J,Q)):(J.inline=!0,d9=h0(b9,0,b9.length,J,Q))}J.inline=u6,J.inHTML=p6,J.c=d6}}var p$=!1;if(K===6&&B0!==-1&&!J.inHTML&&!z9){var v$=l0,l6=/<[a-zA-Z][^>]*>/.test(v$),i6=/\n\n/.test(v$)||/^(\s{0,3}#[#\s]|\s{0,3}[-*+]\s|\s{0,3}\d+\.\s|\s{0,3}>\s|\s{0,3}```)/m.test(v$);l6&&!i6&&(p$=!0)}var a6=!s0&&(J.inHTML||K===7||z9||!t0||p$);if(a6){var c0,d$=!1;if(B0!==-1&&$9){var c$=!1;if(J.inHTML&&Z0<C.length){for(var X$=Z0;X$<C.length&&C.charCodeAt(X$)!==g;)X$++;var _$=C.slice(Z0,X$).trim();c$=_$.length>1&&_$.charCodeAt(0)===e&&_$.charCodeAt(1)!==H0}c0=c$?C.slice(m.end-X):l0,d$=!0}else(K===7||J.inHTML)&&B0!==-1?(c0=C.slice(m.end-X),c0.charCodeAt(0)===g&&(c0=c0.slice(1))):$9?c0=$.slice(X,o0):z9?c0=D0:(c0=C.slice(m.end-X),c0.charCodeAt(0)===g&&(c0=c0.slice(1)));var r$={type:v.htmlBlock,tag:n,attrs:A9(m.attrs,n,Q),f:m.whitespaceBeforeAttrs+m.rawAttrs,children:d9,a:c0,text:c0,d:!0,b:!1,endPos:o0,e:K===6};return d$&&(r$.k=!0),{node:r$,end:b0}}return{node:{type:v.htmlBlock,tag:n,attrs:A9(m.attrs,n,Q),f:m.whitespaceBeforeAttrs+m.rawAttrs,children:d9,a:s0?"":l0,text:l0,d:!1,b:!1,endPos:o0,e:K===6},end:b0}}var Y$=D0.match(/^<(\/?)([a-zA-Z][a-zA-Z0-9-]*)/),n6=Y$?Y$[2]:"div",o$=Y$?Y$[1]==="/":!1,N$=D0;if(o$){var l$=D0.indexOf(">");l$!==-1&&(N$=D0.slice(l$+1))}return{node:{type:v.htmlBlock,tag:n6,attrs:{},children:[],a:N$,text:N$,d:!0,b:o$,endPos:S,e:K===6},end:Q0}}var L0=j9($,X);if(!L0)return null;var w9=L0.tag,I$=w9.toLowerCase(),i$=w9.charCodeAt(0),G$=i$>=p&&i$<=c;if(!G$&&!D$.has(I$)&&!V$.has(I$)&&!I$.includes("-"))return null;if(L0.isClosing)return{node:{type:v.htmlSelfClosing,tag:w9,attrs:{},a:$.slice(X,L0.end),b:!0,endPos:L0.end},end:L0.end};var HJ=!0,x9=T$($,L0.end,w9),t9=[];if(x9!==-1){var s6=B$,K$=$.slice(L0.end,s6),e9=K$.trim();if(e9){var t6=K$.indexOf(`

`)!==-1,e6=z6.test(e9),$Z=W6.test(e9),ZZ=J.inline,JZ=J.inHTML,QZ=J.c;J.inHTML=!0,J.c=(J.c||0)+1,t6||e6||$Z?(J.inline=!1,t9=v9(K$,J,Q)):(J.inline=!0,t9=h0(e9,0,e9.length,J,Q)),J.inline=ZZ,J.inHTML=JZ,J.c=QZ}var VZ=J0($,x9),XZ=$.slice(x9,VZ).trim(),P$=XZ?x9:i($,x9),a$=G$?$.slice(X,x9):$.slice(X,P$),YZ=G$?x9:P$;return{node:{type:v.htmlBlock,tag:w9,attrs:A9(L0.attrs,w9,Q),f:L0.whitespaceBeforeAttrs+L0.rawAttrs,children:t9,a:a$,text:G$?K$:a$,d:!0,b:!1,endPos:YZ,e:!1},end:P$}}var c9=D6($,L0.end),GZ=c9<$.length?i($,c9):c9,b$=$.slice(L0.end,c9);if(b$.trim()){var{inline:KZ,inHTML:UZ,c:qZ}=J;J.inline=!1,J.inHTML=!0,J.c=(J.c||0)+1,t9=v9(b$,J,Q),J.inline=KZ,J.inHTML=UZ,J.c=qZ}var FZ=$.slice(L0.end,c9);return{node:{type:v.htmlBlock,tag:w9,attrs:A9(L0.attrs,w9,Q),f:L0.whitespaceBeforeAttrs+L0.rawAttrs,children:t9,a:FZ,text:b$,d:!0,b:!1,endPos:c9,e:!1},end:GZ}}function kZ($,Z){if($.charCodeAt(Z)!==e)return 0;var J=Z+1,Q=$.length;if($.charCodeAt(J)===S0&&$.charCodeAt(J+1)===u&&$.charCodeAt(J+2)===u)return 2;if($.charCodeAt(J)===r9)return 3;if($.charCodeAt(J)===S0){var V=$.charCodeAt(J+1);if(V>=p&&V<=c)return 4;if($.slice(J+1,J+8)==="[CDATA[")return 5}for(var X=$.charCodeAt(J)===H0,Y=X?J+1:J,G=Y;G<Q;){var K=$.charCodeAt(G);if(K>=p&&K<=c||K>=Y0&&K<=U0||K>=o&&K<=l||K===u)G++;else break}if(G===Y)return 0;var U=$.slice(Y,G);if(V$.has(U.toLowerCase())){if(X)return 0;var q=$.charCodeAt(G);return q===I||q===P||q===d||q===g||G>=Q?1:0}if(D$.has(U.toLowerCase())){if(X){for(var F=G;F<Q&&($.charCodeAt(F)===I||$.charCodeAt(F)===P);)F++;return F<Q&&$.charCodeAt(F)===d?6:0}var O=G<Q?$.charCodeAt(G):-1;return O===I||O===P||O===d||O===g||O===H0||O===-1?6:0}if(X){for(var z=G;z<Q&&($.charCodeAt(z)===I||$.charCodeAt(z)===P);)z++;if(z<Q&&$.charCodeAt(z)===d){var j=J0($,Z),B=$.slice(z+1,j).trim();if(B==="")return 7}}else{var W=J0($,Z),M=j9($,Z);if(M&&M.end<=W){var D=$.slice(M.end,W).trim();if(D==="")return 7}}return 0}function M6($,Z,J){for(var Q=0,V=$.length;Q<V&&($.charCodeAt(Q)===I||$.charCodeAt(Q)===P);)Q++;for(;V>Q&&($.charCodeAt(V-1)===I||$.charCodeAt(V-1)===P);)V--;Q<V&&$.charCodeAt(Q)===N0&&Q++,V>Q&&$.charCodeAt(V-1)===N0&&(V-2<Q||$.charCodeAt(V-2)!==v0)&&V--;for(var X=[],Y=Q,G=!1,K=[],U=Q;U<V;){var q=$.charCodeAt(U);if(q===v0&&U+1<V){$.charCodeAt(U+1)===N0?(G||(G=!0,K=[]),K.push($.slice(Y,U)),K.push("|"),U+=2,Y=U):U+=2;continue}if(q===a){for(var F=0;U<V&&$.charCodeAt(U)===a;)F++,U++;for(var O=!1;U<V&&!O;){for(var W=0;U<V&&$.charCodeAt(U)===a;)W++,U++;W===F?O=!0:W===0&&U++}continue}if(q===N0){var M=G?(K.push($.slice(Y,U)),K.join("")):$.slice(Y,U);X.push(M.trim()),U++,Y=U,G=!1,K=[];continue}U++}var D=G?(K.push($.slice(Y,V)),K.join("")):$.slice(Y,V);return X.push(D.trim()),X.map(function(z){var j=z.indexOf("\\|")!==-1?z.replace(/\\\|/g,"|"):z;return h0(j,0,j.length,Z,J)})}function A6($,Z,J,Q){let V=J0($,Z);var X=$.indexOf("|",Z);if(X<0||X>=V)return null;let Y=i($,V);if(Y>=$.length)return null;let G=J0($,Y);if(!I6($,Y,G))return null;let K=$.slice(Z,V),U=$.slice(Y,G);for(var q=[],F=0,O=U.length;F<O&&(U.charCodeAt(F)===I||U.charCodeAt(F)===P);)F++;for(F<O&&U.charCodeAt(F)===N0&&F++;F<O;){for(;F<O&&(U.charCodeAt(F)===I||U.charCodeAt(F)===P);)F++;if(F>=O||U.charCodeAt(F)===N0)break;var W=U.charCodeAt(F)===g0;for(W&&F++;F<O&&U.charCodeAt(F)===u;)F++;var M=F<O&&U.charCodeAt(F)===g0;for(M&&F++,q.push(W&&M?"center":M?"right":W?"left":null);F<O&&(U.charCodeAt(F)===I||U.charCodeAt(F)===P);)F++;F<O&&U.charCodeAt(F)===N0&&F++}let D=M6(K,J,Q);if(q.length!==D.length)return null;let z=[],j=i($,G);for(;j<$.length;){let k=J0($,j),x=$.slice(j,k);if(p0($,j,k))break;if(j0($,j,k),$0<4){var B=$.charCodeAt(j+t);if(B===d||B===Q9||(B===u||B===O0||B===K0)&&S9($,j))break;if(B===a||B===A0){for(var N=j+t,R=0;N<k&&$.charCodeAt(N)===B;)R++,N++;if(R>=3)break}}z.push(M6(x,J,Q)),j=i($,k)}if((Q.streaming||Q.optimizeForStreaming)&&z.length===0)return null;for(var _=D.length,H=0;H<z.length;H++)if(z[H].length<_)for(;z[H].length<_;)z[H].push([]);else z[H].length>_&&(z[H].length=_);return{node:{type:v.table,header:D,cells:z,align:q},end:j}}function LZ($,Z,J){var Q=J0($,Z);if(j0($,Z,Q),$0>3)return null;var V=Z+t;if($.charCodeAt(V)!==z0)return null;if(V+1<$.length&&$.charCodeAt(V+1)===K9){var X=SZ($,V,J);return X||null}J.refs||(J.refs={});var Y=b6($,V,J.refs);return Y===null?null:{node:{type:v.refCollection},end:Y}}function SZ($,Z,J){var Q=$.length;if($.charCodeAt(Z)!==z0||Z+1>=Q||$.charCodeAt(Z+1)!==K9)return null;for(var V=Z+2,X=V;V<Q&&$.charCodeAt(V)!==m0;){if($.charCodeAt(V)===g)return null;V++}if(V>=Q)return null;var Y=("^"+$.slice(X,V)).toLowerCase();if(V++,V>=Q||$.charCodeAt(V)!==g0)return null;for(V++;V<Q&&($.charCodeAt(V)===I||$.charCodeAt(V)===P);)V++;if(V<Q&&$.charCodeAt(V)===g)for(V++;V<Q&&($.charCodeAt(V)===I||$.charCodeAt(V)===P);)V++;var G=$.indexOf(`
`,V);G<0&&(G=Q);for(var K=$.slice(V,G).trim(),U=G<Q?G+1:Q;U<Q;){var q=J0($,U);if(j0($,U,q),$0>=2&&!p0($,U,q))K+=`
`+$.slice(U,q),U=i($,q);else if(p0($,U,q)){var F=i($,q);if(F<Q){var O=J0($,F);if(j0($,F,O),$0>=2){K+=`
`,U=i($,q);continue}}break}else break}return J.refs[Y]||(J.refs[Y]={target:K,title:void 0}),{node:{type:v.footnote},end:U}}function gZ($,Z,J,Q){let V=Z,X=0,Y=0,G=-1;for(;V<$.length;){let y=G>=0?G:J0($,V);if(G=-1,p0($,V,y))break;if(j0($,V,y),$0<4&&Y>0&&!J.g){let T=$.charCodeAt(V+t);if(T===E0||T===u){let f=V+t;for(;f<y&&$.charCodeAt(f)===T;)f++;for(;f<y&&($.charCodeAt(f)===I||$.charCodeAt(f)===P);)f++;if(f>=y){X=T===E0?1:2,V=i($,y);break}}}Y=y;let L=i($,y);if(L<$.length){if($.charCodeAt(L)===o9){var K=J0($,L);V=i($,K),Y=K;continue}let T=J0($,L);if(G=T,j0($,L,T),$0<4){let f=$.charCodeAt(L+t);if(f===d){V=L;break}if(f===Q9&&k6($,L,J,Q)){V=L;break}if(f===a||f===A0){for(var U=L+t,q=0;U<T&&$.charCodeAt(U)===f;)q++,U++;if(q>=3){V=L;break}}if(f===e){var F=L+t+1,O=F<T?$.charCodeAt(F):0,W=O===S0||O===r9;if(!W&&O===H0){for(var M=F+1,D=M;D<T&&($.charCodeAt(D)>=p&&$.charCodeAt(D)<=c||$.charCodeAt(D)>=Y0&&$.charCodeAt(D)<=U0||$.charCodeAt(D)>=o&&$.charCodeAt(D)<=l||$.charCodeAt(D)===u);)D++;D>M&&(W=D$.has($.slice(M,D).toLowerCase()))}else if(!W){for(var z=F;z<T&&($.charCodeAt(z)>=p&&$.charCodeAt(z)<=c||$.charCodeAt(z)>=Y0&&$.charCodeAt(z)<=U0||$.charCodeAt(z)>=o&&$.charCodeAt(z)<=l||$.charCodeAt(z)===u);)z++;if(z>F){var j=$.slice(F,z).toLowerCase();W=D$.has(j)||V$.has(j)}}if(W&&S6($,L,J,Q)){V=L;break}}if(f===u||f===O0||f===D9){let h=L+t+1;if(h<T&&($.charCodeAt(h)===I||$.charCodeAt(h)===P)){var B=Q$($,h,T);if(B<T&&!S9($,L)){V=L;break}}}if(f>=o&&f<=l){let h=L+t;for(;h<T&&$.charCodeAt(h)>=o&&$.charCodeAt(h)<=l;)h++;if(h<T&&($.charCodeAt(h)===u0||$.charCodeAt(h)===a0)&&h-(L+t)===1&&$.charCodeAt(L+t)===49){var N=h+1;if(N<T&&($.charCodeAt(N)===I||$.charCodeAt(N)===P)){var R=Q$($,N,T);if(R<T){V=L;break}}}}if(f===N0){let h=i($,T);if(h<$.length){let S=J0($,h);if(I6($,h,S)){V=L;break}}}if((f===u||f===O0||f===K0)&&S9($,L)){if(f!==u){V=L;break}let h=0,S=L+t;for(;S<T&&$.charCodeAt(S)===u;)h++,S++;for(;S<T&&($.charCodeAt(S)===I||$.charCodeAt(S)===P);)S++;if(S<T){V=L;break}}}}V=i($,y)}for(var _=X?Y:V;_>Z&&($.charCodeAt(_-1)===g||$.charCodeAt(_-1)===W9||$.charCodeAt(_-1)===I||$.charCodeAt(_-1)===P);)_--;for(var H=Z;H<_&&($.charCodeAt(H)===I||$.charCodeAt(H)===P);)H++;if(H>=_)return null;for(var k=!1,x=H;x<_;x++)if($.charCodeAt(x)===o9){k=!0;break}var w=k?$.slice(H,_).replace(/\u001E/g,""):$.slice(H,_);if(!w)return null;let b=xZ(w,0,w.length,J,Q);if(X){let L=(Q?.slugify||i9)(w);return{node:{type:v.heading,level:X,children:b,id:L},end:V}}return{node:{type:v.paragraph,children:b},end:V}}function xZ($,Z,J,Q,V){var X=$.indexOf(`
`,Z);if(X<0||X>=J)return h0($,Z,J,Q,V);for(var Y="",G=Z,K=Z;K<J;){var U=$.charCodeAt(K);if(U===a){var q=A$($,K,J);if(q>K){for(var F=!1,O=K;O<q;O++)if($.charCodeAt(O)===g){F=!0;break}F&&(Y+=$.slice(G,K),Y+=$.slice(K,q).replace(/\n/g," "),G=q),K=q;continue}}if(U===e){var W=g6($,K,J);if(W>K){K=W;continue}}if(U===g){var M=!1,D=0;if(K>Z&&$.charCodeAt(K-1)===v0)M=!0,D=1;else{for(var z=0,j=K-1;j>=Z&&$.charCodeAt(j)===I;)z++,j--;z>=2&&(M=!0,D=z)}if(M)Y+=$.slice(G,K-D),Y+="";else{for(var B=K;B>G&&$.charCodeAt(B-1)===I;)B--;Y+=$.slice(G,B)+`
`}for(K++;K<J&&$.charCodeAt(K)===I;)K++;G=K;continue}K++}return G<J&&(Y+=$.slice(G,J)),h0(Y,0,Y.length,Q,V)}function EZ($,Z,J){if($.charCodeAt(Z)!==a)return null;let Q=_9($,Z,J,96),V=Z+Q;for(;V<J;){let X=$.indexOf("`",V);if(X<0||X>=J)return null;let Y=_9($,X,J,96);if(Y===Q){let G=$.slice(Z+Q,X);return G=G.replace(/\n/g," "),G.length>0&&G[0]===" "&&G[G.length-1]===" "&&G.trim().length>0&&(G=G.slice(1,-1)),{node:{type:v.codeInline,text:G},end:X+Y}}V=X+Y}return null}function A$($,Z,J){if($.charCodeAt(Z)!==a)return Z;let Q=_9($,Z,J,96),V=Z+Q;for(;V<J;){let X=$.indexOf("`",V);if(X<0||X>=J)return Z;let Y=_9($,X,J,96);if(Y===Q)return X+Y;V=X+Y}return Z}function g6($,Z,J){if($.charCodeAt(Z)!==e)return Z;if(Z+1<J&&$.charCodeAt(Z+1)===H0){let U=Z+2;for(;U<J&&$.charCodeAt(U)!==d;)U++;return U<J?U+1:Z}if(Z+3<J&&$.charCodeAt(Z+1)===S0&&$.charCodeAt(Z+2)===u&&$.charCodeAt(Z+3)===u){let U=$.indexOf("-->",Z+4);return U>=0?U+3:Z}let Q=Z+1,V=Q;for(;Q<J;){let U=$.charCodeAt(Q);if(U>=p&&U<=c||U>=Y0&&U<=U0||U>=o&&U<=l||U===u)Q++;else break}if(Q===V)return Z;let X=$.slice(V,Q).toLowerCase(),Y=!1;for(;Q<J;){let U=$.charCodeAt(Q);if(U===d){Q++;break}if(U===H0&&Q+1<J&&$.charCodeAt(Q+1)===d){Q+=2,Y=!0;break}if(U===H9||U===R9){var G=U;for(Q++;Q<J&&$.charCodeAt(Q)!==G;)Q++;Q<J&&Q++;continue}if(U===g)return Z;Q++}if(Y||C9(X))return Q;let K=1;for(;Q<J&&K>0;)if($.charCodeAt(Q)===e)if(Q+1<J&&$.charCodeAt(Q+1)===H0){let U=Q+2,q=U;for(;q<J&&($.charCodeAt(q)>=p&&$.charCodeAt(q)<=c||$.charCodeAt(q)>=Y0&&$.charCodeAt(q)<=U0);)q++;if($.slice(U,q).toLowerCase()===X){for(;q<J&&$.charCodeAt(q)!==d;)q++;if(q<J&&q++,K--,K===0)return q}Q=q}else{let U=Q+1,q=U;for(;q<J&&($.charCodeAt(q)>=p&&$.charCodeAt(q)<=c||$.charCodeAt(q)>=Y0&&$.charCodeAt(q)<=U0);)q++;$.slice(U,q).toLowerCase()===X&&K++,Q++}else Q++;return Q}function TZ($,Z,J,Q,V){if($.charCodeAt(Z)!==A0||Z+1>=J||$.charCodeAt(Z+1)!==A0)return null;let X=Z+2;for(;X+1<J;){let Y=$.charCodeAt(X);if(Y===a){let G=A$($,X,J);if(G>X){X=G;continue}}if(Y===A0&&$.charCodeAt(X+1)===A0){let G=$.slice(Z+2,X),K=h0(G,0,G.length,Q,V);return{node:{type:v.textFormatted,tag:"del",children:K},end:X+2}}Y===v0&&X+1<J&&X++,X++}return null}function hZ($,Z,J,Q,V){if($.charCodeAt(Z)!==E0||Z+1>=J||$.charCodeAt(Z+1)!==E0)return null;let X=Z+2;for(;X+1<J;){let Y=$.charCodeAt(X);if(Y===a){let G=A$($,X,J);if(G>X){X=G;continue}}if(Y===E0&&$.charCodeAt(X+1)===E0&&X>Z+2){let G=$.slice(Z+2,X),K=h0(G,0,G.length,Q,V);return{node:{type:v.textFormatted,tag:"mark",children:K},end:X+2}}Y===v0&&X+1<J&&X++,X++}return null}function j6($,Z,J){return $<l9?!!(f$($)&f9):K6.test(Z[J])}function v6($,Z,J){return $<l9?!!(f$($)&B9):U6.test(Z[J])}function fZ($,Z,J){var Q=$.charCodeAt(Z);if(Q!==O0&&Q!==K0)return null;var V=_9($,Z,J,Q);if(V===0)return null;var X=Z>0?$.charCodeAt(Z-1):32,Y=Z+V<J?$.charCodeAt(Z+V):32,G=v6(X,$,Z-1),K=v6(Y,$,Z+V),U=Z>0?j6(X,$,Z-1):!1,q=Z+V<J?j6(Y,$,Z+V):!1,F=!K&&(!q||G||U),O=!G&&(!U||K||q),W,M;return Q===O0?(W=F,M=O):(W=F&&(!O||U),M=O&&(!F||q)),{len:V,canOpen:W,canClose:M}}function CZ($,Z,J,Q){if(Z.length!==0){for(var V=[],X=0;X<12;X++)V[X]=-1;for(var Y=0;Y<Z.length;){var G=Z[Y];if(!G.active||!G.canClose){Y++;continue}for(var K=G.ch===O0?0:1,U=K*6+G.len%3*2+(G.canOpen?1:0),q=V[U]!==void 0?V[U]:-1,F=-1,O=Y-1;O>q;O--){var W=Z[O];if(!(!W.active||W.ch!==G.ch||!W.canOpen)&&!((G.canOpen||W.canClose)&&(W.len+G.len)%3===0&&W.len%3!==0)){F=O;break}}if(F<0){V[U]=Y-1,!G.canOpen&&(G.active=!1),Y++;continue}var M=Z[F],D=M.len>=2&&G.len>=2,z=D?2:1;M.len-=z,G.len-=z;var j=$[M.idx],B=$[G.idx];j.text=j.text.slice(0,j.text.length-z),B.text=B.text.slice(z);var N=M.idx+1,R=G.idx,_=$.slice(N,R),H={type:v.textFormatted,tag:D?"strong":"em",children:_};$.splice(N,R-N,H);for(var k=R-N-1,x=0;x<Z.length;x++)Z[x].idx>M.idx&&(Z[x].idx-=k);for(var w=F+1;w<Y;w++)Z[w].active=!1;if(M.len===0&&(M.active=!1,j.text==="")){$.splice(M.idx,1);for(var b=0;b<Z.length;b++)Z[b].idx>M.idx?Z[b].idx--:Z[b].idx===M.idx&&(Z[b].idx=-1)}if(G.len===0){G.active=!1;var y=G.idx;if(B.text===""){$.splice(y,1);for(var L=0;L<Z.length;L++)Z[L].idx>y?Z[L].idx--:Z[L].idx===y&&(Z[L].idx=-1)}}else continue;Y++}for(var T=0,f=0;f<$.length;f++){var h=$[f];if(h.type===v.text){var S=h;if(S.text==="")continue;if(T>0&&$[T-1].type===v.text){$[T-1].text+=S.text;continue}}$[T++]=h}$.length=T}}function _6($,Z,J,Q,V){let X=$.charCodeAt(Z)===S0,Y=X?Z+1:Z;if($.charCodeAt(Y)!==z0)return null;var G=$.indexOf("]",Y+1);if(G<0||G>=J)return null;for(var K=Y+1,U=-1,q=1;K<J&&q>0;){var F=$.charCodeAt(K);if(F===v0&&K+1<J){K+=2;continue}if(F===a){var O=A$($,K,J);if(O>K){K=O;continue}}if(F===e){var W=x6($,K,J);if(W){K=W.end;continue}var M=g6($,K,J);if(M>K){K=M;continue}}F===z0?q++:F===m0&&q--,K++}if(q!==0)return null;var D=K-1,z=$.slice(Y+1,D),j=K<J?$.charCodeAt(K):0,B=!1;if(j===i0){var N=!0;for(K++;K<J&&($.charCodeAt(K)===I||$.charCodeAt(K)===g);)K++;var R="",_=K;if(K<J&&$.charCodeAt(K)===e){for(K++,_=K;_<J&&$.charCodeAt(_)!==d;){if($.charCodeAt(_)===v0&&_+1<J){_+=2;continue}if($.charCodeAt(_)===g){N=!1;break}_++}N&&(_>=J||$.charCodeAt(_)!==d)&&(N=!1),N&&(R=$.slice(K,_),_++)}else if(N){for(var H=0;_<J;){var k=$.charCodeAt(_);if(k===v0&&_+1<J){_+=2;continue}if(k===i0)H++;else if(k===a0){if(H===0)break;H--}else if(k===I||k===g)break;_++}R=$.slice(K,_)}if(N){for(K=_;K<J&&($.charCodeAt(K)===I||$.charCodeAt(K)===g);)K++;var x;if(K<J){var w=$.charCodeAt(K);if(w===H9||w===R9||w===i0){var b=w===i0?41:w;K++;for(var y=K;K<J&&$.charCodeAt(K)!==b;)$.charCodeAt(K)===v0&&K+1<J&&K++,K++;K>=J?N=!1:(x=$.slice(y,K),K++)}}if(N){for(;K<J&&($.charCodeAt(K)===I||$.charCodeAt(K)===g);)K++;(K>=J||$.charCodeAt(K)!==a0)&&(N=!1)}}if(N){K++,R=n9(R),x!==void 0&&(x=W$(n9(x)));var L=V?.sanitizer||L$,T=L(R,X?"img":"a",X?"src":"href"),f=T===null?null:R;if(X){var h=h0(z,0,z.length,Q,V),S=M$(h);return{node:{type:v.image,target:f,alt:S,title:x},end:K}}else{var D0=Q.inAnchor;Q.inAnchor=!0;var Q0=D0?[{type:v.text,text:z}]:h0(z,0,z.length,Q,V);return Q.inAnchor=D0,!Q.inAnchor&&h$(Q0)?null:{node:{type:v.link,target:f,title:x,children:Q0},end:K}}}else K=D+1,B=!0}var m="",n=K;if(!B&&j===z0){var y0=K+1;n=y0;for(var d0=!1;n<J&&$.charCodeAt(n)!==m0;){if($.charCodeAt(n)===v0&&n+1<J){n+=2;continue}if($.charCodeAt(n)===z0){d0=!0;break}n++}if(d0||n>=J)return null;var C0=$.slice(y0,n);if(C0.trim())m=O$(C0);else{if(H6(z))return null;m=O$(z)}n=n+1}else{if(H6(z))return null;m=O$(z)}var W0=Q.refs[m];if(!W0)return null;if(X)return{node:{type:v.image,target:W0.target,alt:M$(h0(z,0,z.length,Q,V)),title:W0.title},end:n};var C=Q.inAnchor;Q.inAnchor=!0;var Q0=C?[{type:v.text,text:z}]:h0(z,0,z.length,Q,V);return Q.inAnchor=C,!Q.inAnchor&&h$(Q0)?null:{node:{type:v.link,target:W0.target,title:W0.title,children:Q0},end:n}}function x6($,Z,J){if($.charCodeAt(Z)!==e)return null;for(var Q=Z+1;Q<J;){var V=$.charCodeAt(Q);if(V===d)break;if(V===I||V===g||V===W9||V===e)return null;Q++}if(Q>=J||$.charCodeAt(Q)!==d)return null;var X=$.slice(Z+1,Q),Y=X.match(/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^\x00-\x20]*)$/);return Y?{node:{type:v.link,target:X,title:void 0,children:[{type:v.text,text:X}]},end:Q+1}:X.indexOf("@")!==-1&&/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(X)?{node:{type:v.link,target:"mailto:"+X,title:void 0,children:[{type:v.text,text:X}]},end:Q+1}:null}function mZ($,Z,J,Q){if($.charCodeAt(Z)!==z0||Z+1>=J||$.charCodeAt(Z+1)!==K9)return null;let V=Z+2;for(;V<J&&$.charCodeAt(V)!==m0&&$.charCodeAt(V)!==g;)V++;if(V>=J||$.charCodeAt(V)!==m0)return null;let X=$.slice(Z+2,V);return X?{node:{type:v.footnoteReference,target:"#"+i9(X),text:X},end:V+1}:null}function uZ($,Z,J,Q){if(Q.disableBareUrls)return null;var V="",X=!1,Y=$.charCodeAt(Z);if(Y===E9||Y===72?Z+8<=J&&$.charCodeAt(Z+1)===T9&&$.charCodeAt(Z+2)===T9&&$.charCodeAt(Z+3)===U$&&($.charCodeAt(Z+4)===y$&&$.charCodeAt(Z+5)===g0&&$.charCodeAt(Z+6)===H0&&$.charCodeAt(Z+7)===H0?V="https://":$.charCodeAt(Z+4)===g0&&$.charCodeAt(Z+5)===H0&&$.charCodeAt(Z+6)===H0&&(V="http://")):Y===O9||Y===70?Z+6<=J&&$.charCodeAt(Z+1)===T9&&$.charCodeAt(Z+2)===U$&&$.charCodeAt(Z+3)===g0&&$.charCodeAt(Z+4)===H0&&$.charCodeAt(Z+5)===H0&&(V="ftp://"):(Y===U9||Y===87)&&Z+4<=J&&$.charCodeAt(Z+1)===U9&&$.charCodeAt(Z+2)===U9&&$.charCodeAt(Z+3)===u0&&(V="www.",X=!0),!V)return null;let G=Z+V.length;for(;G<J;){let H=$.charCodeAt(G);if(H===I||H===g||H===P||H===W9||H===e||H===d)break;G++}for(var K=0,U=0,q=Z;q<G;q++){var F=$.charCodeAt(q);F===i0?K++:F===a0&&U++}let O=G;for(;O>Z+V.length;){let H=$.charCodeAt(O-1);if(H===u0||H===t$||H===g0||H===S0||H===r9||H===a0||H===O0||H===K0||H===A0){if(H===a0){if(K>=U)break;U--}O--}else if(H===k$){for(var W=O-2;W>Z&&($.charCodeAt(W)>=p&&$.charCodeAt(W)<=c||$.charCodeAt(W)>=Y0&&$.charCodeAt(W)<=U0||$.charCodeAt(W)>=o&&$.charCodeAt(W)<=l);)W--;W>=Z&&$.charCodeAt(W)===w$?O=W:O--}else break}if(O<=Z+V.length)return null;var M=Z+(X?4:V.length),D=$.indexOf("/",M);if((D<0||D>O)&&(D=O),X&&$.indexOf(".",M)===-1)return null;for(var z=-1,j=-1,B=D-1;B>=M;B--)if($.charCodeAt(B)===u0)if(z<0)z=B;else{j=B;break}for(var N=j>=0?j+1:M,B=N;B<D;B++)if($.charCodeAt(B)===K0)return null;var R=$.slice(Z,O),_=X?"http://"+R:R;return{node:{type:v.link,target:_,title:void 0,children:[{type:v.text,text:R}]},end:O}}function pZ($,Z,J,Q){if(Q.disableBareUrls)return null;for(var V=Z,X=V;V<J;){var Y=$.charCodeAt(V);if(Y>=p&&Y<=c||Y>=Y0&&Y<=U0||Y>=o&&Y<=l||Y===u0||Y===S0||Y===Q9||Y===36||Y===$$||Y===w$||Y===R9||Y===O0||Y===D9||Y===H0||Y===E0||Y===r9||Y===K9||Y===K0||Y===a||Y===y9||Y===N0||Y===q$||Y===A0||Y===u)V++;else break}if(V===X||V>=J||$.charCodeAt(V)!==Z$)return null;V++;for(var G=V,K=-1,U=V;V<J;){var Y=$.charCodeAt(V);if(Y>=p&&Y<=c||Y>=Y0&&Y<=U0||Y>=o&&Y<=l)V++;else if((Y===u||Y===K0)&&V>G)V++;else if(Y===u0){if(V===G)break;var q=$.charCodeAt(V-1);if(q===u||q===K0||V-U>63)break;if(V+1<J){var F=$.charCodeAt(V+1);if(F>=p&&F<=c||F>=Y0&&F<=U0||F>=o&&F<=l)K=V,U=V+1,V++;else break}else break}else break}if(V-U>63||K<0)return null;var O=$.charCodeAt(V-1);if(!(O>=p&&O<=c||O>=Y0&&O<=U0||O>=o&&O<=l)||V<=K+1)return null;for(var W=-1,M=K-1;M>=G;M--)if($.charCodeAt(M)===u0){W=M;break}for(var D=W>=0?W+1:G,M=D;M<V;M++)if($.charCodeAt(M)===K0)return null;var z=$.slice(Z,V);return{node:{type:v.link,target:"mailto:"+z,title:void 0,children:[{type:v.text,text:z}]},end:V}}function h$($){for(var Z=0;Z<$.length;Z++)if($[Z].type===v.link||"children"in $[Z]&&Array.isArray($[Z].children)&&h$($[Z].children))return!0;return!1}function M$($){for(var Z="",J=0;J<$.length;J++){var Q=$[J];Q.type===v.text?Z+=Q.text:Q.type===v.breakLine?Z+=" ":Q.type===v.codeInline?Z+=Q.text:"children"in Q&&Array.isArray(Q.children)?Z+=M$(Q.children):Q.type===v.image?Z+=Q.alt||"":Q.type===v.link&&(Z+=M$(Q.children))}return Z}function m9($){let Z=$.includes("&")?W$($):$;return{type:v.text,text:Z}}function dZ($,Z,J,Q,V){if($.charCodeAt(Z)!==e)return null;var X=Z+1;if(X>=J)return null;var Y=$.charCodeAt(X);if(Y===S0&&X+1<J&&$.charCodeAt(X+1)===u&&X+2<J&&$.charCodeAt(X+2)===u){var G=X+3;if(G<J&&$.charCodeAt(G)===d)return{node:{type:v.htmlComment,text:"",h:!0},end:G+1};if(G+1<J&&$.charCodeAt(G)===u&&$.charCodeAt(G+1)===d)return{node:{type:v.htmlComment,text:"-",h:!0},end:G+2};var K=$.indexOf("-->",G);return K!==-1&&K<=J-3?{node:{type:v.htmlComment,text:$.slice(Z+4,K),h:!1},end:K+3}:null}if(Y===r9){var U=$.indexOf("?>",X+1);return U!==-1&&U<J?{node:{type:v.htmlSelfClosing,tag:"?",attrs:{},a:$.slice(Z,U+2),b:!1},end:U+2}:null}if(Y===S0&&X+1<J){var q=$.charCodeAt(X+1);if(q===z0&&$.slice(X+1,X+8)==="[CDATA["){var F=$.indexOf("]]>",X+8);return F!==-1&&F<J?{node:{type:v.htmlSelfClosing,tag:"![CDATA[",attrs:{},a:$.slice(Z,F+3),b:!1},end:F+3}:null}if(q>=p&&q<=c){var O=$.indexOf(">",X+2);return O!==-1&&O<J?{node:{type:v.htmlSelfClosing,tag:"!"+$.slice(X+1,O),attrs:{},a:$.slice(Z,O+1),b:!1},end:O+1}:null}}if(Y===H0){var W=X+1;if(W>=J)return null;var M=$.charCodeAt(W);if(!(M>=p&&M<=c||M>=Y0&&M<=U0))return null;for(W++;W<J;){var D=$.charCodeAt(W);if(D>=p&&D<=c||D>=Y0&&D<=U0||D>=o&&D<=l||D===u)W++;else break}for(;W<J&&($.charCodeAt(W)===I||$.charCodeAt(W)===P||$.charCodeAt(W)===g);)W++;if(W<J&&$.charCodeAt(W)===d){var z=$.slice(X+1,W).trim();return{node:{type:v.htmlSelfClosing,tag:z,attrs:{},a:$.slice(Z,W+1),b:!0},end:W+1}}return null}if(!(Y>=p&&Y<=c||Y>=Y0&&Y<=U0))return null;var j=j9($,Z);if(!j)return null;var B=j.tag,N=B.toLowerCase(),R=j.selfClosing;if(R||C9(B))return{node:{type:v.htmlSelfClosing,tag:B,attrs:A9(j.attrs,B,V),a:$.slice(Z,j.end),b:!1},end:j.end};var _=V$.has(N),H=T$($.slice(0,J),j.end,B);if(H===-1)return{node:{type:v.htmlSelfClosing,tag:B,attrs:A9(j.attrs,B,V),a:$.slice(Z,j.end),b:!1},end:j.end};var k=yZ($,"</"+N,H),x=$.slice(j.end,k),w=[];if(_)x.trim()&&(w=[{type:v.text,text:x}]);else{var b=x.trim();if(b){var{inAnchor:y,inline:L}=Q;N==="a"&&(Q.inAnchor=!0);var T=b.indexOf(`

`)!==-1||/^#{1,6}\s/.test(b);T?(Q.inline=!1,w=v9(b,Q,V)):w=h0(b,0,b.length,Q,V),Q.inAnchor=y,Q.inline=L}}return{node:{type:v.htmlBlock,tag:B,attrs:A9(j.attrs,B,V),f:j.rawAttrs,children:w,a:void 0,text:x,d:!1,b:!1,endPos:H,e:!1},end:H}}var cZ=200,a9=0;function h0($,Z,J,Q,V){if(a9++,a9>cZ)return a9--,[{type:v.text,text:$.slice(Z,J)}];let X=Q;if(V.streaming||V.optimizeForStreaming){let s0=function(X0,E){for(var R0=1,F0=E+1;F0<X0.length;F0++){var X9=X0.charCodeAt(F0);if(X9===z0)R0++;else if(X9===m0&&(R0--,R0===0))return F0}return-1},A=$.slice(Z,J),r=A;for(var Y=0,G=0,K=0,U=0,q=0,F=-1,O=-1,W=-1,M=-1,D=-1,z=0;z<A.length;z++){var j=A.charCodeAt(z);j===O0?z+1<A.length&&A.charCodeAt(z+1)===O0?(Y++,F=z,z++):(G++,O=z):j===K0?z+1<A.length&&A.charCodeAt(z+1)===K0?(K++,W=z,z++):(U++,M=z):j===A0&&z+1<A.length&&A.charCodeAt(z+1)===A0&&(q++,D=z,z++)}var B=[];q%2===1&&D>=0&&B.push([D,2]),K%2===1&&W>=0&&B.push([W,2]),U%2===1&&M>=0&&B.push([M,1]),Y%2===1&&F>=0&&B.push([F,2]),G%2===1&&O>=0&&B.push([O,1]),B.sort(function(X0,E){return E[0]-X0[0]});for(var N=0;N<B.length;N++){var R=B[N][0],_=B[N][1];A=A.slice(0,R)+A.slice(R+_)}let I0=0,P0=-1;for(let X0=0;X0<A.length;X0++)A.charCodeAt(X0)===a&&(I0++,P0=X0);if(I0%2===1&&P0!==-1){let X0=!1,E=-1,R0=0;for(;R0<A.length;)A.charCodeAt(R0)===a&&(X0?(X0=!1,E=-1):(E=R0,X0=!0)),R0++;X0&&E!==-1&&(A=A.slice(0,E))}for(var H=!0;H;){H=!1;for(var k=-1,x=-1,w=-1,b=!1,y=0;y<A.length;y++){var L=A.charCodeAt(y);if(L===z0&&(y===0||A.charCodeAt(y-1)!==v0)){var T=y>0&&A.charCodeAt(y-1)===S0,f=T?y-1:y,h=s0(A,y);if(h===-1)k=f,b=T,x=y+1,w=A.length;else{var S=h+1;if(S>=A.length)k=f,b=T,x=y+1,w=h;else if(A.charCodeAt(S)===i0){var D0=A.indexOf(")",S+1);D0===-1?(k=f,b=T,x=y+1,w=h,y=A.length):y=D0}else if(A.charCodeAt(S)===z0){var Q0=A.indexOf("]",S+1);Q0===-1?(k=f,b=T,x=y+1,w=h,y=A.length):y=Q0}else y=h}}}if(k>=0){var m=b?"":A.slice(x,w);A=A.slice(0,k)+m,H=!0}}let k0=A.match(/<([A-Z][A-Za-z0-9]*)(?:\s[^>]*)?>([^<]*)$/);if(k0&&k0.index!==void 0){var n=k0[0].length-k0[2].length,y0=n>=2&&k0[0].charCodeAt(n-2)===H0;if(!y0){for(var d0=!1,C0=0,W0=0;W0<k0.index;W0++)A.charCodeAt(W0)===a&&C0++;if(d0=C0%2===1,!d0){let X0=k0[1];L9(A,"</"+X0,0)===-1&&(A=A.replace(/<[A-Z][A-Za-z0-9]*(?:\s[^>]*)?>([^<]*)$/,"$1"))}}}A!==r&&($=$.slice(0,Z)+A,J=Z+A.length)}let C=[];var B0=[];let Z0=Z;var G0=V.disableAutoLink||V.disableBareUrls||X.inAnchor?-1:$.indexOf("@",Z);for(G0>=J&&(G0=-1);Z<J;){let A=$.charCodeAt(Z),r=null;if(A===a){if(r=EZ($,Z,J),!r){var V9=_9($,Z,J,a);Z+=V9-1}}else if(A===O0||A===K0){var V0=fZ($,Z,J);if(V0){if(V0.canOpen||V0.canClose){Z>Z0&&C.push(m9($.slice(Z0,Z)));var M0=$.slice(Z,Z+V0.len),_0=m9(M0);B0.push({idx:C.length,ch:A,len:V0.len,canOpen:V0.canOpen,canClose:V0.canClose,active:!0}),C.push(_0),Z+=V0.len,Z0=Z;continue}Z+=V0.len-1}}else if(A===A0)r=TZ($,Z,J,X,V);else if(A===E0)r=hZ($,Z,J,X,V);else if(A===z0)Z+1<J&&$.charCodeAt(Z+1)===K9&&(r=mZ($,Z,J,X)),r||(r=_6($,Z,J,X,V));else if(A===S0&&Z+1<J&&$.charCodeAt(Z+1)===z0)r=_6($,Z,J,X,V);else if(A===e)r=x6($,Z,J),!r&&!V.disableParsingRawHTML&&!V.ignoreHTMLBlocks&&(r=dZ($,Z,J,X,V));else if((A===E9||A===U9||A===O9)&&!X.inAnchor&&!V.disableAutoLink&&(Z===0||$.charCodeAt(Z-1)!==e)){var s=Z+1<J?$.charCodeAt(Z+1):0;(A===E9&&s===T9||A===O9&&s===T9||A===U9&&s===U9)&&(r=uZ($,Z,J,V))}if(!r&&G0>=0&&G0-Z<=64&&!X.inAnchor&&!V.disableAutoLink&&!V.disableBareUrls&&(A>=p&&A<=c||A>=Y0&&A<=U0||A>=o&&A<=l)&&(r=pZ($,Z,J,V),!r&&Z>=G0&&(G0=$.indexOf("@",Z+1),G0>=J&&(G0=-1))),A===F$){Z>Z0&&C.push(m9($.slice(Z0,Z))),C.push({type:v.breakLine}),Z++,Z0=Z;continue}if(r)Z>Z0&&C.push(m9($.slice(Z0,Z))),C.push(r.node),Z=r.end,Z0=Z;else{if(A===v0&&Z+1<J){let I0=$.charCodeAt(Z+1);if(f$(I0)&f9){Z>Z0&&C.push(m9($.slice(Z0,Z))),C.push(m9($[Z+1])),Z+=2,Z0=Z;continue}}if(Z++,G0<0||G0-Z>64)for(;Z<J;){var q0=$.charCodeAt(Z);if(q0<l9&&!N6[q0])Z++;else break}}}if(J>Z0){let A=$.slice(Z0,J);A&&C.push(m9(A))}return B0.length>0&&CZ(C,B0,Q,V),a9--,C}var rZ=500;function v9($,Z,J){var Q=Z.i||0;if(Q>rZ)return[{type:v.text,text:$}];Z.i=Q+1;let V=Z;if((J.streaming||J.optimizeForStreaming)&&!Z.j){var X=$.length;X>0&&$.charCodeAt(X-1)===g&&X--;for(var Y=X;Y>0&&$.charCodeAt(Y-1)!==g;)Y--;if(Y>0&&$.charCodeAt(Y)===N0){for(var G=!0,K=Y;K<X;K++){var U=$.charCodeAt(K);if(U!==I&&U!==P&&U!==u&&U!==g0&&U!==N0){G=!1;break}}if(G){for(var q=Y-1;q>0&&$.charCodeAt(q-1)!==g;)q--;$.charCodeAt(q)===N0&&($=$.slice(0,q).trimEnd())}}var F=$.trim(),O=F.lastIndexOf(`
`),W=O===-1?F:F.slice(O+1);if(W.length>0&&W.charCodeAt(0)===N0){for(var M=!1,D=!1,z=1;z<W.length;z++){var j=W.charCodeAt(z);j===N0&&(M=!0),j===u&&(D=!0)}M&&D&&($=O===-1?"":$.slice(0,$.lastIndexOf(W)).trimEnd())}for(var B=-1,N=-1,R=-1,_=$.length-1;_>=0;_--)if($.charCodeAt(_)===e){var H=_+1<$.length?$.charCodeAt(_+1):0;if(H>=p&&H<=c||H>=Y0&&H<=U0){for(var k=_+2;k<$.length;){var x=$.charCodeAt(k);if(x>=p&&x<=c||x>=Y0&&x<=U0||x>=o&&x<=l)k++;else break}for(var w=k;w<$.length&&$.charCodeAt(w)!==d;)w++;if(w<$.length&&$.charCodeAt(w-1)!==H0){for(var b=!1,y=w+1;y<$.length;y++)if($.charCodeAt(y)===e){b=!0;break}b||(B=_,N=k,R=w+1)}}break}if(B>=0){for(var L=0,T=0;T<B;T++)$.charCodeAt(T)===a&&L++;if(L%2===0){var f=$.slice(B+1,N);L9($,"</"+f,0)===-1&&($=$.slice(0,B)+$.slice(R))}}for(var h=$.length;h>0&&$.charCodeAt(h-1)===g;)h--;if(h>0){for(var S=h;S>0&&$.charCodeAt(S-1)!==g;)S--;for(var D0=S,Q0=0;D0<h&&$.charCodeAt(D0)===I&&Q0<3;)D0++,Q0++;if(S>0&&D0<h&&IZ($,D0,h)){for(var m=S-1,n=m;n>0&&$.charCodeAt(n-1)!==g;)n--;p0($,n,m)||($=$.slice(0,S).trimEnd())}}var y0=$.length;if(y0>0){for(var d0=$.lastIndexOf(`
`),C0=d0===-1?0:d0+1,W0=y0,C=C0,B0=0;C<W0&&$.charCodeAt(C)===I&&B0<3;)C++,B0++;if(C<W0){var Z0=$.charCodeAt(C),G0=!1;if(Z0===O0||Z0===u||Z0===D9){var V9=C+1;if(V9>=W0||$.charCodeAt(V9)===I||$.charCodeAt(V9)===P){for(var V0=V9;V0<W0&&($.charCodeAt(V0)===I||$.charCodeAt(V0)===P);)V0++;V0>=W0&&(G0=!0)}}else if(Z0>=o&&Z0<=l){for(var M0=C;M0<W0&&$.charCodeAt(M0)>=o&&$.charCodeAt(M0)<=l;)M0++;if(M0<W0&&($.charCodeAt(M0)===u0||$.charCodeAt(M0)===a0)){var _0=M0+1;if(_0>=W0||$.charCodeAt(_0)===I||$.charCodeAt(_0)===P){for(var s=_0;s<W0&&($.charCodeAt(s)===I||$.charCodeAt(s)===P);)s++;s>=W0&&(G0=!0)}}}G0&&($=$.slice(0,C0).trimEnd())}}}if(Z.inline)return h0($,0,$.length,Z,J);let q0=[],A=0,r=$.length;if(A===0&&!J.disableFrontmatter&&$.startsWith("---")){let E=Y6($);if(E&&E.hasValidYaml){if(J.preserveFrontmatter!==!1){let R0=$.slice(0,E.endPos).trimEnd();q0.push({type:v.frontmatter,text:R0})}A=E.endPos}}for(;A<r;){for(var I0=$.indexOf(`
`,A),P0=I0<0?r:I0;A<r&&p0($,A,P0);)A=P0<r?P0+1:P0,A<r&&(I0=$.indexOf(`
`,A),P0=I0<0?r:I0);if(A>=r)break;$.charCodeAt(A),j0($,A,P0);let E=null;if(w6=$,R6=A,y6=P0,$.charCodeAt(A)!==o9&&$0>=4&&!Z.inHTML)E=bZ($,A);else if($.charCodeAt(A)!==o9){let R0=A+t,F0=$.charCodeAt(R0);F0===Q9?E=k6($,A,Z,J):F0===d?E=wZ($,A,Z,J):F0===a||F0===A0?E=PZ($,A,Z):F0===u||F0===O0||F0===K0?(E=S9($,A),!E&&(E=B6($,A,Z,J))):F0===D9||F0>=o&&F0<=l?E=B6($,A,Z,J):F0===e?E=S6($,A,Z,J):F0===N0?E=A6($,A,Z,J):F0===z0&&(E=LZ($,A,Z))}if(!E){for(var s0=!1,k0=A;k0<P0;k0++)if($.charCodeAt(k0)===N0){s0=!0;break}s0&&(E=A6($,A,Z,J))}if(E||(E=gZ($,A,Z,J)),E)E.node.type!==v.refCollection&&q0.push(E.node),A=E.end;else{var X0=$.indexOf(`
`,A);A=X0<0?r:X0+1}}return Z.i=Q,q0}function C$($,Z){a9=0,$.charCodeAt(0)===65279&&($=$.slice(1)),$=S$($);let J={inline:!1,inAnchor:!1,inHTML:!1,inList:!1,inBlockQuote:!1,refs:{}},Q={...Z,slugify:Z?.slugify?X=>Z.slugify(X,i9):i9,sanitizer:Z?.sanitizer||L$,tagfilter:Z?.tagfilter!==!1};J.j=P6($,J.refs,Q);let V=v9($,J,Q);return J.refs&&Object.keys(J.refs).length>0?[{type:v.refCollection,refs:J.refs},...V]:V}function hJ($,Z,J,Q){var V=j9($,Z);return V?{tagName:V.tag,tagLower:V.tag.toLowerCase(),attrs:V.rawAttrs,whitespaceBeforeAttrs:V.whitespaceBeforeAttrs,isSelfClosing:V.selfClosing,hasSpaceBeforeSlash:V.hasSpaceBeforeSlash,isClosing:V.isClosing,hasNewline:V.whitespaceBeforeAttrs.includes(`
`)||V.rawAttrs.includes(`
`),endPos:V.end}:null}function fJ($,Z,J){a9=0,$=S$($),!Z.refs&&(Z.refs={}),Z.j=P6($,Z.refs,J);let Q=v9($,Z,J);return Z.refs&&Object.keys(Z.refs).length>0?[{type:v.refCollection,refs:Z.refs},...Q]:Q}function dJ($,Z){let J=C$($,Z);return E6(J,Z)}function E6($,Z){let J=Array.isArray($)?$:[$];for(var Q=Z?.overrides||{},V={},X=[],Y=!1,G=0;G<J.length;G++){var K=J[G];K.type===v.refCollection&&!Y?(V=K.refs||{},Y=!0,X.push(K)):K.type!==v.footnote&&K.type!==v.ref&&(K.type!==v.frontmatter||Z?.preserveFrontmatter!==!1)&&X.push(K)}function U(R){return R.type===v.ref||R.type===v.footnote||R.type===v.frontmatter&&Z?.preserveFrontmatter===!1?"":oZ(R,W)}function q(R,_={}){return!R||typeof R!="object"?"":Z?.renderRule?Z.renderRule(()=>U(R),R,O,_):U(R)}var F={};function O(R){for(var _="",H=0;H<R.length;H++)_+=q(R[H],F);return _}let W={options:Z||{},references:new Map,referenceIndex:1,overrides:Q,renderChild:q};for(var M=0,D="",z=0;z<X.length;z++){var j=X[z];z>0&&(D+=`

`);var B=j.type===v.refCollection?void 0:M++;D+=q(j,{key:B,refs:V})}var N=D;if(W.options.useReferenceLinks&&W.references.size>0){let R=Array.from(W.references.entries()).map(([_,{url:H,title:k}])=>k?`[${_}]: ${H} "${k}"`:`[${_}]: ${H}`).join(`
`);return N+`

`+R}return N}var cJ=E6;function oZ($,Z){switch($.type){case v.text:return lZ($);case v.paragraph:return iZ($,Z);case v.heading:return aZ($,Z);case v.breakThematic:return nZ($);case v.breakLine:return sZ($);case v.codeBlock:return tZ($);case v.codeInline:return T6($);case v.textFormatted:return eZ($,Z);case v.link:return $J($,Z);case v.image:return ZJ($,Z);case v.orderedList:return JJ($,Z);case v.unorderedList:return QJ($,Z);case v.blockQuote:return VJ($,Z);case v.table:return XJ($,Z);case v.htmlBlock:return YJ($,Z);case v.htmlSelfClosing:return GJ($,Z);case v.htmlComment:return KJ($);case v.footnote:return UJ($);case v.footnoteReference:return qJ($);case v.frontmatter:return FJ($);case v.gfmTask:return zJ($);case v.ref:return WJ($);case v.refCollection:return OJ($);default:return""}}function lZ($){return $.text}function iZ($,Z){for(var J="",Q=0;Q<$.children.length;Q++)J+=Z.renderChild($.children[Q],{});return J}function aZ($,Z){for(var J="",Q=0;Q<$.children.length;Q++)J+=Z.renderChild($.children[Q],{});return Z.options.useSetextHeaders&&($.level===1||$.level===2)?`${J}
${($.level===1?"=":"-").repeat(J.length)}`:`${"#".repeat($.level)}${Z.options.enforceAtxHeadings!==!1?" ":""}${J}`}function nZ($){return"---"}function sZ($){return`  
`}function tZ($){return`${$.lang?`\`\`\`${$.lang}
`:"```\n"}${$.text}
\`\`\``}function T6($){return $.text.indexOf("`")!==-1?`\`\`${$.text}\`\``:`\`${$.text}\``}function eZ($,Z){for(var J="",Q=0;Q<$.children.length;Q++)J+=Z.renderChild($.children[Q],{});switch($.tag){case"em":case"i":return`*${J}*`;case"strong":case"b":return`**${J}**`;case"del":case"s":return`~~${J}~~`;case"code":return T6({type:v.codeInline,text:J});default:return J}}function $J($,Z){for(var J="",Q=0;Q<$.children.length;Q++)J+=Z.renderChild($.children[Q],{});let V=$.target||"",X=$.title;if(Z.options.useReferenceLinks){let Y=h6(V,Z);return Z.references.has(Y)||Z.references.set(Y,{url:V,title:X}),`[${J}][${Y}]`}return X?`[${J}](${V} "${X}")`:`[${J}](${V})`}function ZJ($,Z){let J=$.alt||"",Q=$.target,V=$.title;if(Z.options.useReferenceLinks){let X=h6(Q,Z);return Z.references.has(X)||Z.references.set(X,{url:Q,title:V}),`![${J}][${X}]`}return V?`![${J}](${Q} "${V}")`:`![${J}](${Q})`}function JJ($,Z){for(var J=$.start||1,Q="",V=0;V<$.items.length;V++){for(var X="",Y=$.items[V],G=0;G<Y.length;G++)X+=Z.renderChild(Y[G],{});V>0&&(Q+=`
`),Q+=J+V+". "+X.replace(/\n/g,`
    `)}return Q}function QJ($,Z){for(var J="",Q=0;Q<$.items.length;Q++){for(var V="",X=$.items[Q],Y=0;Y<X.length;Y++)V+=Z.renderChild(X[Y],{});Q>0&&(J+=`
`),J+="- "+V.replace(/\n/g,`
  `)}return J}function VJ($,Z){for(var J="",Q=0;Q<$.children.length;Q++)Q>0&&(J+=`

`),J+=Z.renderChild($.children[Q],{});for(var V="",X=0,Y=0;Y<=J.length;Y++)if(Y===J.length||J.charCodeAt(Y)===10){var G=J.slice(X,Y);V&&(V+=`
`),V+=G.trim()?"> "+G:">",X=Y+1}return V}function XJ($,Z){for(var J="",Q=0;Q<$.header.length;Q++){Q>0&&(J+=" | ");for(var V=$.header[Q],X=0;X<V.length;X++)J+=Z.renderChild(V[X],{})}var Y="";if($.align.length>0)for(var G=0;G<$.align.length;G++){G>0&&(Y+="|");var K=$.align[G];Y+=K==="left"?":---":K==="right"?"---:":K==="center"?":---:":"---"}else for(var U=0;U<$.header.length;U++)U>0&&(Y+="|"),Y+="---";for(var q="",F=0;F<$.cells.length;F++){F>0&&(q+=`
`);for(var O=$.cells[F],W=0;W<O.length;W++){W>0&&(q+=" | ");for(var M=O[W],D=0;D<M.length;D++)q+=Z.renderChild(M[D],{})}}return J+`
`+Y+`
`+q}function YJ($,Z){let J=$.tag||"div",Q=g$(J,Z.overrides),V=x$(J,Z.overrides),X={...$.attrs||{},...V},Y=f6(X),G=C9(Q);if($.d&&($.a||$.text)){let q=$.a||$.text;return`<${Q}${Y}>${q}`}if($.text)return`<${Q}${Y}>${$.text}`;let K=$.children?`
${$.children.map(q=>Z.renderChild(q,{})).join(`
`)}
`:"",U=G?"":`</${Q}>`;return`<${Q}${Y}>${K}${U}`}function GJ($,Z){let J=$.tag||"div",Q=g$(J,Z.overrides),V=x$(J,Z.overrides),X={...$.attrs||{},...V},Y=f6(X);return`<${Q}${Y} />`}function KJ($){return`<!--${$.text}-->`}function UJ($){return""}function qJ($){return`[^${$.text}]`}function FJ($){return`---
${$.text}
---`}function zJ($){return $.completed?"[x]":"[ ]"}function WJ($){return""}function OJ($){return Object.entries($.refs).map(([Z,{target:J,title:Q}])=>Q?`[${Z}]: ${J} "${Q}"`:`[${Z}]: ${J}`).join(`
`)}function h6($,Z){return`ref${Z.referenceIndex++}`}function f6($){return Object.entries($||{}).map(([Z,J])=>{let Q=Z==="className"?"class":Z;return typeof J=="boolean"?J?` ${Q}`:"":` ${Q}="${String(J).replace(/"/g,"&quot;")}"`}).join("")}export{C$ as parser,cJ as markdown,dJ as compiler,E6 as astToMarkdown,v as RuleType};
