import*as o0 from"react";var N=32,w=9,D9=13,T=10,s=96,A0=126,H0=91,a0=94,c=62,J9=35,G$=37,p=45,C0=61,v0=92,B0=42,U0=95,e=60,K$=64,p0=93,E0=33,g$=38,T0=58,x$=70,B9=102,m9=104,W9=119,h9=116,O$=112,E$=115,G6=160,K6=12,q6=44,T$=59,a9=63,d0=46,j0=47,L9=39,j9=34,M9=43,b0=124,S9=123,D$=125,e0=40,$9=41,n9=30,B$=31,r=48,i=57,d=65,l=90,J0=97,F0=122,s9=128,n0=32,RZ={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=RZ;import{decodeEntity as yZ}from"markdown-to-jsx/entities";function H6($){if(!U6($,"---"))return null;let Q=3;for(;Q<$.length&&($[Q]===" "||$[Q]==="	");)Q++;if(Q<$.length&&$[Q]==="\r"&&Q++,Q>=$.length||$[Q]!==`
`)return null;Q++;let Z=!1;for(;Q<$.length;){let V=Q;for(;Q<$.length&&$[Q]!==`
`&&$[Q]!=="\r";)Q++;if(Q>=$.length)break;let Y=Q;if($[Q]==="\r"&&Q++,Q<$.length&&$[Q]===`
`&&Q++,U6($,"---",V))return{endPos:Q,hasValidYaml:Z};if(!Z){let G=TZ($,V,Y);if(G<Y){let K=$.charCodeAt(G);if(K>=J0&&K<=F0||K>=d&&K<=l||K>=r&&K<=i||K===U0){for(G++;G<Y&&(K=$.charCodeAt(G),K>=J0&&K<=F0||K>=d&&K<=l||K>=r&&K<=i||K===U0||K===p||K===d0);)G++;G<Y&&$.charCodeAt(G)===T0&&(G++,G>=Y?Z=!0:(K=$.charCodeAt(G),(K===N||K===w)&&(Z=!0)))}}}}return null}var kZ=/&([a-zA-Z0-9]+|#[0-9]{1,7}|#x[0-9a-fA-F]{1,6});/gi,LZ={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 c0($){var Q={};for(var Z in $){var V=Z.toLowerCase(),Y=LZ[V];if(Y)Q[Y]=$[Z];else{var G=Z.indexOf(":");G!==-1?Q[Z.slice(0,G)+Z[G+1].toUpperCase()+Z.slice(G+2)]=$[Z]:Q[Z]=$[Z]}}return Q}var O6=/(\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 t9($){return $.indexOf("&")===-1?$:$.replace(kZ,(Q,Z)=>{var V=yZ(Z);if(V)return V;if(Z[0]==="#"){var Y=Z[1]==="x"||Z[1]==="X"?parseInt(Z.slice(2),16):parseInt(Z.slice(1),10);return Y===0||Y>=55296&&Y<=57343||Y>1114111?"\uFFFD":Y<=65535?String.fromCharCode(Y):String.fromCharCode(55296+(Y-65536>>10),56320+(Y-65536&1023))}return Q})}var J6=/(javascript|vbscript|data(?!:image)):/i;function g9($){if(J6.test($))return null;if($.indexOf("%")===-1)return $;try{let Q=decodeURIComponent($).replace(/[^A-Za-z0-9/:]/g,"");if(J6.test(Q))return null}catch{return null}return $}var f0={},m0,k0;for(m0=[192,193,194,195,196,197,224,225,226,227,228,229,230,198],k0=0;k0<m0.length;k0++)f0[m0[k0]]="a";for(f0[231]=f0[199]="c",f0[240]=f0[208]="d",m0=[200,201,202,203,233,232,234,235],k0=0;k0<m0.length;k0++)f0[m0[k0]]="e";for(m0=[207,239,206,238,205,237,204,236],k0=0;k0<m0.length;k0++)f0[m0[k0]]="i";for(f0[209]=f0[241]="n",m0=[248,216,339,338,213,245,212,244,211,243,210,242],k0=0;k0<m0.length;k0++)f0[m0[k0]]="o";for(m0=[220,252,219,251,218,250,217,249],k0=0;k0<m0.length;k0++)f0[m0[k0]]="u";f0[376]=f0[255]=f0[221]=f0[253]="y";function g0($){for(var Q="",Z=-1,V=$.length,Y=0;Y<V;Y++){var G=$.charCodeAt(Y);if(G>=J0&&G<=F0||G>=r&&G<=i){Z<0&&(Z=Y);continue}if(G>=d&&G<=l){Z>=0&&(Q+=$.slice(Z,Y),Z=-1),Q+=String.fromCharCode(G+n0);continue}if(G===N||G===p){Z>=0&&(Q+=$.slice(Z,Y),Z=-1),Q+="-";continue}Z>=0&&(Q+=$.slice(Z,Y),Z=-1);var K=f0[G];K&&(Q+=K)}return Z>=0&&(Q+=$.slice(Z)),Q}function U6($,Q,Z){return $.startsWith(Q,Z)}var F6=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 d9($){let Q=$.toLowerCase();if(F6.has(Q))return!0;let Z=Q.indexOf(":");return Z!==-1?(Q=Q.slice(Z+1),F6.has(Q)):!1}var A9=1,X6=2,p9=4,W6=8,SZ=16,Z9=32,_9=64,z6=1,gZ=2,xZ=3,EZ=4,D6=(function(){var $=new Uint8Array(128),Q;for($[w]=A9,$[T]=A9|X6,$[K6]=A9,$[D9]=A9|X6,$[N]=A9,Q=E0;Q<=j0;Q++)$[Q]=p9;for(Q=T0;Q<=K$;Q++)$[Q]=p9;for(Q=H0;Q<=s;Q++)$[Q]=p9;for(Q=S9;Q<=A0;Q++)$[Q]=p9;for(Q=r;Q<=i;Q++)$[Q]=SZ;for(Q=d;Q<=l;Q++)$[Q]=W6;for(Q=J0;Q<=F0;Q++)$[Q]=W6;return $})(),D5=(function(){let $=new Uint8Array(128);return $[v0]=gZ,$[H0]=EZ,$[B0]=$[U0]=$[A0]=$[C0]=xZ,$[s]=$[e]=$[K$]=$[p0]=$[T]=$[N]=$[E0]=z6,$[B9]=$[m9]=$[W9]=z6,$})(),B6=/[\p{P}\p{S}]/u,j6=/\p{Zs}/u,u9=[];function C$($){var Q=$.indexOf("\r"),Z=$.indexOf("\0");if(Q===-1&&Z===-1)return $;var V=$.length;u9.length=0;var Y=0,G=0;for(Q===-1?G=Z:Z===-1?G=Q:G=Q<Z?Q:Z;G<V;G++){var K=$.charCodeAt(G);K===D9?(Y<G&&u9.push($.slice(Y,G)),G+1<V&&$.charCodeAt(G+1)===T&&G++,u9.push(`
`),Y=G+1):K===0&&(Y<G&&u9.push($.slice(Y,G)),u9.push("\uFFFD"),Y=G+1)}return Y<V&&u9.push($.slice(Y)),u9.join("")}function TZ($,Q,Z){let V=Z??$.length;for(;Q<V&&($[Q]===" "||$[Q]==="	");)Q++;return Q}function B5($){if(!$)return!1;for(var Q in $)return!0;return!1}function e9($,Q,Z){for(var V=$,Y=Q.split("."),G=0;G<Y.length&&(V=V?.[Y[G]],V!==void 0);)G++;return V||Z}function M6($){for(var Q=!1,Z=0;Z<$.length;Z++){var V=$.charCodeAt(Z);if(V<=N||V===j9||V===G$||V===e||V===c||V===H0||V===v0||V===p0||V===a0||V===s||V>=123){Q=!0;break}}if(!Q)return $;for(var Y="",Z=0;Z<$.length;Z++){var V=$.charCodeAt(Z);if(V===G$&&Z+2<$.length){var G=$.charCodeAt(Z+1),K=$.charCodeAt(Z+2);if((G>=r&&G<=i||G>=d&&G<=x$||G>=J0&&G<=B9)&&(K>=r&&K<=i||K>=d&&K<=x$||K>=J0&&K<=B9)){Y+=$[Z]+$[Z+1]+$[Z+2],Z+=2;continue}}Y+=encodeURI($[Z])}return Y}function A6(...$){return $.filter(Boolean).join(" ")}function j5($,Q){if(!Q)return $;let Z=e9(Q,$,void 0);return typeof Z=="string"?Z:typeof Z=="object"&&Z.component?Z.component:$}function M5($,Q){if(!Q)return{};let Z=e9(Q,$,void 0);return typeof Z=="object"&&Z.props?Z.props:{}}var fZ=new Set(["title","textarea","style","xmp","iframe","noembed","noframes","script","plaintext"]),j$=/<(\/?)(title|textarea|style|xmp|iframe|noembed|noframes|script|plaintext)(\s|>|\/)/gi;function m$($){return fZ.has($.toLowerCase())}function _6($){return j$.lastIndex=0,j$.test($)}function h$($){return j$.lastIndex=0,$.replace(j$,function(Q,Z,V,Y){return"&lt;"+Z+V+Y})}var E6=/^<([a-zA-Z][a-zA-Z0-9-]*)\s[^>]*>/,T6=/^<[A-Z]/,u$=["script","pre","style","textarea"],U$=new Set(u$),CZ=/<(?:pre|script|style|textarea)\b/i,I6=/<(?:pre|script|style|textarea)\b/iy,N6=/^(\s{0,3}#[#\s]|\s{0,3}[-*+]\s|\s{0,3}\d+\.\s|\s{0,3}>\s|\s{0,3}```)/m,b6=/^<([a-z][^ >/\n\r]*) ?([^>]*?)>/im,f6=new Uint8Array(128);(function(){for(var $=[s,B0,U0,A0,C0,H0,E0,e,v0,B$,m9,W9,B9],Q=0;Q<$.length;Q++)f6[$[Q]]=1})();var P6=/([a-zA-Z_][a-zA-Z0-9_-]*)=(?:"([^"]*)"|'([^']*)')/g;function C6($){return U$.has($)}function m6($){return CZ.test($)}function h6($,Q,Z){for(var V=Q,Y=Z;V<Y&&($.charCodeAt(V)===N||$.charCodeAt(V)===w);)V++;if(V>=Y)return!1;$.charCodeAt(V)===b0&&V++;for(var G=0;V<Y;){for(;V<Y&&($.charCodeAt(V)===N||$.charCodeAt(V)===w);)V++;if(V>=Y)break;if($.charCodeAt(V)===b0&&G>0){for(var K=V+1;K<Y&&($.charCodeAt(K)===N||$.charCodeAt(K)===w);)K++;if(K>=Y)return!0}if($.charCodeAt(V)===T0&&V++,V>=Y||$.charCodeAt(V)!==p)return!1;for(;V<Y&&$.charCodeAt(V)===p;)V++;for(V<Y&&$.charCodeAt(V)===T0&&V++,G++;V<Y&&($.charCodeAt(V)===N||$.charCodeAt(V)===w);)V++;if(V<Y)if($.charCodeAt(V)===b0)V++;else return!1}return G>0}function I9($,Q){if($.charCodeAt(Q)!==e)return null;let Z=Q+1,V=$.length,Y=!1;$.charCodeAt(Z)===j0&&(Z++,Y=!0);let G=Z,K=$.charCodeAt(Z);if(!(K>=J0&&K<=F0||K>=d&&K<=l))return null;for(;Z<V&&($.charCodeAt(Z)>=J0&&$.charCodeAt(Z)<=F0||$.charCodeAt(Z)>=d&&$.charCodeAt(Z)<=l||$.charCodeAt(Z)>=r&&$.charCodeAt(Z)<=i||$.charCodeAt(Z)===p);)Z++;let J=$.slice(G,Z);if(!J)return null;let q=Z;for(;Z<V&&($.charCodeAt(Z)===N||$.charCodeAt(Z)===w||$.charCodeAt(Z)===T);)Z++;let U=$.slice(q,Z);if(Z===q&&Z<V){var W=$.charCodeAt(Z);if(W!==c&&W!==j0)return null}let X=Z,H={},z=!1;for(;Z<V;){let S=$.charCodeAt(Z);if(S===c){let L=$.slice(X,Z);return{tag:J,attrs:H,selfClosing:!1,end:Z+1,rawAttrs:L,whitespaceBeforeAttrs:U,isClosing:Y,hasSpaceBeforeSlash:z}}if(S===N||S===w||S===T){Z++;continue}if(S===j0&&Z+1<V&&$.charCodeAt(Z+1)===c){let L=$.slice(X,Z);return z=Z>X&&$.charCodeAt(Z-1)===N,{tag:J,attrs:H,selfClosing:!0,end:Z+2,rawAttrs:L,whitespaceBeforeAttrs:U,isClosing:Y,hasSpaceBeforeSlash:z}}var B=Z,j=$.charCodeAt(Z);if(!(j>=J0&&j<=F0||j>=d&&j<=l||j===U0||j===T0))return null;for(Z++;Z<V;){var F=$.charCodeAt(Z);if(F>=J0&&F<=F0||F>=d&&F<=l||F>=r&&F<=i||F===U0||F===d0||F===T0||F===p)Z++;else break}for(var A=$.slice(B,Z);Z<V&&($.charCodeAt(Z)===N||$.charCodeAt(Z)===w);)Z++;if($.charCodeAt(Z)!==C0){H[A]="";continue}for(Z++;Z<V&&($.charCodeAt(Z)===N||$.charCodeAt(Z)===w);)Z++;var D=$.charCodeAt(Z);if(D===j9||D===L9){Z++;for(var M=Z;Z<V&&$.charCodeAt(Z)!==D;)Z++;if(Z>=V)return null;if(H[A]=$.slice(M,Z),Z++,Z<V){var y=$.charCodeAt(Z);if(y!==N&&y!==w&&y!==T&&y!==c&&y!==j0)return null}}else if(D===S9){var I=1,M=Z;for(Z++;Z<V&&I>0;){var F=$.charCodeAt(Z);F===S9?I++:F===D$&&I--,Z++}H[A]=$.slice(M,Z)}else{for(var M=Z;Z<V;){var O=$.charCodeAt(Z);if(O===N||O===w||O===c||O===T||O===j9||O===L9||O===C0||O===e||O===s)break;Z++}if(Z===M)return null;H[A]=$.slice(M,Z)}}return null}function u6($,Q,Z){if(!Z.streaming&&!Z.optimizeForStreaming&&$.indexOf("[")===-1)return!1;for(var V=0,Y=$.length,G=!1,K=!1;V<Y;){for(var J=$.indexOf(`
`,V),q=J<0?Y:J,U=V,W=0;U<q&&W<4;)if($.charCodeAt(U)===N)W++,U++;else if($.charCodeAt(U)===w)W+=4,U++;else break;if(U>=q){G=!1,V=J<0?Y:J+1;continue}if(W<4){var X=$.charCodeAt(U);if(X===s||X===A0){for(var H=X,z=0,B=U;B<q&&$.charCodeAt(B)===H;)z++,B++;if(z>=3){var j=!0;if(H===s){for(var F=B;F<q;F++)if($.charCodeAt(F)===s){j=!1;break}}if(j){G=!1;for(var A=J<0?Y:J+1;A<Y;){for(var D=A,M=0;D<Y&&M<4;){var y=$.charCodeAt(D);if(y===N)M++,D++;else if(y===w)M+=4,D++;else break}if(M<4&&D<Y&&$.charCodeAt(D)===H){for(var I=0;D<Y&&$.charCodeAt(D)===H;)I++,D++;if(I>=z){for(;D<Y&&($.charCodeAt(D)===N||$.charCodeAt(D)===w);)D++;if(D>=Y||$.charCodeAt(D)===T){V=D>=Y?Y:D+1;break}}}for(;A<Y&&$.charCodeAt(A)!==T;)A++;A<Y&&A++}A>=Y&&(V=Y,K=!0);continue}}}}for(var O=U;O<q&&$.charCodeAt(O)===c;){O++,O<q&&$.charCodeAt(O)===N&&O++;for(var S=0;O<q&&S<4;)if($.charCodeAt(O)===N)S++,O++;else if($.charCodeAt(O)===w)S+=4,O++;else break;if(S>=4)break;G=!1}if(!G&&W<4&&O<q&&$.charCodeAt(O)===H0&&!(O+1<Y&&$.charCodeAt(O+1)===a0)){var L=p6($,O,Q);if(L){V=L,G=!1;continue}}var R=$.charCodeAt(U);if(R===J9&&W<4)G=!1;else if(W<4&&(R===p||R===B0||R===U0)){for(var b=U,k=0;b<q;){var g=$.charCodeAt(b);if(g===R)k++;else if(g!==N&&g!==w)break;b++}G=!(k>=3&&b>=q)}else G=!0;V=J<0?Y:J+1}return K}function p6($,Q,Z){let V=$.length;if($.charCodeAt(Q)!==H0)return null;let Y=Q+1<V&&$.charCodeAt(Q+1)===a0,G=Q+1;for(;G<V;){var K=$.charCodeAt(G);if(K===p0){G++;break}if(K===H0)return null;K===v0&&G+1<V&&G++,G++}if(G>V||$.charCodeAt(G-1)!==p0)return null;let J=$.slice(Q+1,G-1);if(J.length>999)return null;let q=M$(J);if(!q||G>=V||$.charCodeAt(G)!==T0)return null;G++;let U=!1;for(;G<V;){let E=$.charCodeAt(G);if(E===N||E===w)G++;else if(E===T&&!U)U=!0,G++;else break}if(Y){let E=$.indexOf(`
`,G),h=E<0?V:E,C=$.slice(G,h).trim();return Z[q]={target:C,title:void 0},E<0?V:E+1}var W;if(G<V&&$.charCodeAt(G)===e){G++;for(var X=G;G<V&&$.charCodeAt(G)!==c&&$.charCodeAt(G)!==T;)$.charCodeAt(G)===v0&&G+1<V&&G++,G++;if(G>=V||$.charCodeAt(G)!==c)return null;W=$.slice(X,G),G++;for(var H=$.indexOf(`
`,G),z=H<0?V:H,B=G;B<z&&($.charCodeAt(B)===N||$.charCodeAt(B)===w);)B++;if(B<z){if(B===G)return null;var j=$.charCodeAt(B);if(j!==j9&&j!==L9&&j!==e0)return null}}else{for(var X=G,F=0;G<V;){var K=$.charCodeAt(G);if(K===e0)F++;else if(K===$9){if(F===0)break;F--}else{if(K===N||K===w||K===T)break;K===v0&&G+1<V&&G++}G++}if(W=$.slice(X,G),!W)return null}for(;G<V&&($.charCodeAt(G)===N||$.charCodeAt(G)===w);)G++;var A=$.indexOf(`
`,G),D=A<0?V:A,M,y=!1,I=G,O=G;if(G===D&&G<V)for(O=G+1;O<V&&($.charCodeAt(O)===N||$.charCodeAt(O)===w);)O++;if(O<V){var S=$.charCodeAt(O);if(S===j9||S===L9||S===e0){for(var L=S===e0?41:S,R=O+1,b=R;R<V;){var k=$.charCodeAt(R);if(k===L){for(var g=R+1;g<V&&($.charCodeAt(g)===N||$.charCodeAt(g)===w);)g++;(g>=V||$.charCodeAt(g)===T)&&(M=$.slice(b,R),y=!0,I=g<V?g+1:V);break}if(k===v0&&R+1<V){R+=2;continue}if(k===T&&R+1<V&&$.charCodeAt(R+1)===T)break;R++}if(!y&&O===G)return null}}if(y)return Z[q]||(Z[q]={target:Z$(W),title:M!==void 0?t9(Z$(M)):M}),I;for(;G<D&&($.charCodeAt(G)===N||$.charCodeAt(G)===w);)G++;return G<D?null:(Z[q]||(Z[q]={target:Z$(W),title:M}),A<0?V:A+1)}var u0=new Uint8Array(D6);for(u0[B$]=A9,u0[J9]|=Z9,u0[c]|=Z9,u0[p]|=Z9|_9,u0[M9]|=Z9,u0[B0]|=Z9|_9,u0[U0]|=Z9|_9,u0[s]|=Z9|_9,u0[A0]|=Z9|_9,u0[e]|=Z9|_9,u0[H0]|=_9,u0[E0]|=_9,u0[b0]|=Z9,q$=r;q$<=i;q$++)u0[q$]|=Z9;var q$;function w6($){if($.indexOf("[")<0&&$.indexOf("]")<0)return!1;for(var Q=0;Q<$.length;Q++){if($.charCodeAt(Q)===v0){Q++;continue}if($.charCodeAt(Q)===H0||$.charCodeAt(Q)===p0)return!0}return!1}function M$($){var Q=$.replace(/\s+/g," ").trim();return Q.indexOf("\u1E9E")!==-1?Q.replace(/\u1E9E/g,"ss").toLowerCase():Q.toLowerCase()}function c$($){return $<s9?u0[$]:$===G6?A9:0}function Z$($){return $.replace(/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,"$1")}var d6=null,c6=-1,l6=-1;function G0($,Q){if(Q===c6&&$===d6)return l6;var Z=$.indexOf(`
`,Q);return Z<0?$.length:Z}function a($,Q){let Z=G0($,Q);return Z<$.length?Z+1:Z}function J$($,Q,Z){for(;Q<Z;){let V=$.charCodeAt(Q);if(V!==N&&V!==w)break;Q++}return Q}function R6($,Q){let Z=a($,Q);for(;Z<$.length;){let V=G0($,Z);if(l0($,Z,V))return Z;Z=a($,Z)}return $.length}function b9($,Q,Z,V){let Y=0;for(;Q+Y<Z&&$.charCodeAt(Q+Y)===V;)Y++;return Y}var Y0=0,Q0=0;function _0($,Q,Z){for(Y0=0,Q0=0;Q+Q0<Z;){let V=$.charCodeAt(Q+Q0);if(V===w)Y0+=4-Y0%4;else if(V===N)Y0++;else break;Q0++}}function l0($,Q,Z){return J$($,Q,Z)>=Z}function o6($,Q,Z,V){let Y=G0($,Q);if(_0($,Q,Y),Y0>3)return null;let G=Q+Q0;if($.charCodeAt(G)!==J9)return null;let K=b9($,G,Y,35);if(K<1||K>6||(G+=K,G<Y&&$.charCodeAt(G)!==N&&$.charCodeAt(G)!==w))return null;G=J$($,G,Y);for(var J=Y;J>G&&$.charCodeAt(J-1)===N;)J--;for(var q=J;J>G&&$.charCodeAt(J-1)===J9;)J--;if(J<q)if(J===G||$.charCodeAt(J-1)===N)for(;J>G&&$.charCodeAt(J-1)===N;)J--;else J=q;let U=$.slice(G,J),W=h0(U,0,U.length,Z,V),H=(V?.slugify||g0)(U);return{node:{type:v.heading,level:K,children:W,id:H},end:a($,Y)}}function mZ($,Q,Z){var V=$.charCodeAt(Q);if(V!==C0&&V!==p)return!1;for(var Y=Q;Y<Z&&$.charCodeAt(Y)===V;)Y++;for(;Y<Z&&($.charCodeAt(Y)===N||$.charCodeAt(Y)===w);)Y++;return Y>=Z}function T9($,Q){let Z=G0($,Q);if(_0($,Q,Z),Y0>3)return null;let V=Q+Q0,Y=$.charCodeAt(V);if(Y!==p&&Y!==B0&&Y!==U0)return null;let G=0;for(;V<Z;){let K=$.charCodeAt(V);if(K===Y)G++;else if(K!==N&&K!==w)return null;V++}return G<3?null:{node:{type:v.breakThematic},end:a($,Z)}}function hZ($,Q,Z){let V=G0($,Q);if(_0($,Q,V),Y0>3)return null;let Y=Y0,G=Q0,K=Q+Q0,J=$.charCodeAt(K);if(J!==s&&J!==A0)return null;let q=b9($,K,V,J);if(q<3)return null;K+=q;let U=J$($,K,V),W=V;if(J===s){for(let R=U;R<V;R++)if($.charCodeAt(R)===s)return null}for(;W>U&&($.charCodeAt(W-1)===N||$.charCodeAt(W-1)===w);)W--;let X=$.slice(U,W),H="",z="",B=X.indexOf(" ");B===-1?H=X:(H=X.slice(0,B),z=X.slice(B+1).trim()),H=Z$(H);var j=void 0;if(z){P6.lastIndex=0;for(var F;(F=P6.exec(z))!==null;)j||(j={}),j[F[1]]=F[2]!==void 0?F[2]:F[3]}let A=a($,V),D=A,M=$.length;for(;D<$.length;){let R=G0($,D);if(_0($,D,R),Y0<4){let b=D+Q0;var y=b9($,b,R,J);if(y>=q){let k=b+y;if(l0($,k,R)){M=a($,R);break}}}D=a($,R)}var I;if(Y===0)I=D>A&&$.charCodeAt(D-1)===T?$.slice(A,D-1):$.slice(A,D);else{I="";for(var O=A;O<D;){var S=G0($,O);_0($,O,S);var L=Math.min(Q0,Y);I+=$.slice(O+L,S)+`
`,O=a($,S)}I.length>0&&I.charCodeAt(I.length-1)===T&&(I=I.slice(0,-1))}return{node:{type:v.codeBlock,lang:H||void 0,text:I,infoString:z||void 0,attrs:j},end:M}}function uZ($,Q){let Z=G0($,Q);if(_0($,Q,Z),Y0<4)return null;let V="",Y=Q;for(;Y<$.length;){let z=G0($,Y);if(_0($,Y,z),l0($,Y,z)){for(var G=0,K=a($,z);K<$.length;){var J=G0($,K);if(l0($,K,J)){G++,K=a($,J);continue}if(_0($,K,J),Y0>=4){for(var q=0;q<=G;q++)V+=`
`;Y=K;break}break}if(Y!==K)break;continue}if(Y0<4)break;let B=0,j=0;var U=0;for(let F=Y;F<z&&j<4;F++){if($.charCodeAt(F)===w){var W=4-j%4;j+W>4&&(U=j+W-4),j+=W}else j++;B++}var X="";if(U>0)for(var H=0;H<U;H++)X+=" ";X+=$.slice(Y+B,z),V+=X+`
`,Y=a($,z)}for(;V.length>0&&V.charCodeAt(V.length-1)===T;)V=V.slice(0,-1);for(;V.length>0&&V.charCodeAt(V.length-1)===T;)V=V.slice(0,-1);return V?{node:{type:v.codeBlock,lang:void 0,text:V,infoString:void 0,attrs:void 0},end:Y}:null}function pZ($,Q,Z,V){let Y=G0($,Q);if(_0($,Q,Y),Y0>3)return null;let G=Q+Q0;if($.charCodeAt(G)!==c)return null;let K="",J=Q,q,U=!1,W=!1,X=!1;for(;J<$.length;){let x=G0($,J);_0($,J,x);let X0=J+Q0;if($.charCodeAt(X0)===c){let V0=X0+1;var H=Y0+1,z=!1;if(V0<x){var B=$.charCodeAt(V0);B===N?(V0++,H++,z=!0):B===w&&(z=!0)}for(var j="",F=!1,A=V0;A<x;A++)if($.charCodeAt(A)===w){F=!0;break}if(F){var D=H;if(z&&V0<x&&$.charCodeAt(V0)===w){for(var M=4-D%4,y=0;y<M-1;y++)j+=" ";D+=M,V0++}for(var I=V0;I<x;I++)if($.charCodeAt(I)===w){for(var O=4-D%4,S=0;S<O;S++)j+=" ";D+=O}else j+=$[I],D++}else j=$.slice(V0,x);if(!K&&!q){let P=j.match(/^\[!([A-Za-z]+)\]\s*$/);if(P){q=P[1].toUpperCase(),J=a($,x);continue}}K+=j+`
`;var L=j.trimStart();L.startsWith("```")||L.startsWith("~~~")?X=!X:j.startsWith("    ")||j.startsWith("	")?X=!0:L.length>0&&!X&&(X=!1),W=L.length>0,J=a($,x)}else if(K&&!l0($,J,x)&&W){if(Y0<4){var R=J+Q0,b=R<x?$.charCodeAt(R):0;if(b===J9||b===c||b===s||b===A0||b===e||(b===p||b===B0||b===U0)&&T9($,J)||(b===p||b===B0||b===M9)&&R+1<x&&($.charCodeAt(R+1)===N||$.charCodeAt(R+1)===w))break;if(b>=r&&b<=i){for(var k=R;k<x&&$.charCodeAt(k)>=r&&$.charCodeAt(k)<=i;)k++;if(k<x&&($.charCodeAt(k)===d0||$.charCodeAt(k)===$9))break}}if(X)break;K+=$.slice(J,x)+`
`,U=!0,J=a($,x)}else break}if(!K&&!q)return null;var{inBlockQuote:g,g:E}=Z;Z.inBlockQuote=!0,U&&(Z.g=!0);let h=N9(K||"",Z,V);return Z.inBlockQuote=g,Z.g=E,{node:{type:v.blockQuote,children:h,alert:q||void 0},end:J}}function r6($,Q,Z){for(var V=0,Y=Q;Y<Z;Y++)$.charCodeAt(Y)===w?V+=4-V%4:V++;return V}function x9($,Q,Z){if(_0($,Q,Z),Y0>3)return null;var V=Q+Q0;if(V>=Z)return null;var Y=$.charCodeAt(V),G=Y0,K=V;if(Y===p||Y===B0||Y===M9){if(K=V+1,K<Z&&$.charCodeAt(K)!==N&&$.charCodeAt(K)!==w&&$.charCodeAt(K)!==T)return null}else if(Y>=r&&Y<=i){for(var J=V;J<Z&&J-V<9;){var q=$.charCodeAt(J);if(q<r||q>i)break;J++}if(J>V&&J<Z){var U=$.charCodeAt(J);if(U===d0||U===$9){if(K=J+1,K<Z&&$.charCodeAt(K)!==N&&$.charCodeAt(K)!==w&&$.charCodeAt(K)!==T)return null}else return null}else return null}else return null;var W=K,X=r6($,Q,K),H=0,z=W,B=X;if(W>=Z)return{ordered:Y>=r&&Y<=i,marker:Y>=r&&Y<=i?$[J]:$[V],start:Y>=r&&Y<=i?parseInt($.slice(V,J),10):void 0,contentStart:W,contentCol:X+1,markerCol:G,isEmpty:!0};for(;z<Z&&($.charCodeAt(z)===N||$.charCodeAt(z)===w);){if($.charCodeAt(z)===w){var j=4-B%4;B+=j}else B++;z++,H++}var F=z>=Z,A=B-X;return F||A>4?(B=X+1,z=W+1,H=1):H===0&&(B=X+1,z=W,H=1),{ordered:Y>=r&&Y<=i,marker:Y>=r&&Y<=i?$[J]:$[V],start:Y>=r&&Y<=i?parseInt($.slice(V,J),10):void 0,contentStart:z,contentCol:B,markerCol:G,isEmpty:F}}var A$=0;function dZ($,Q,Z,V){var Y=0,G=Q;for(A$=0;G<Z&&Y<V;){var K=$.charCodeAt(G);if(K===w){var J=4-Y%4;if(Y+J>V){A$=Y+J-V,G++,Y=V;break}Y+=J}else if(K===N)Y++;else break;G++}return G}function y6($,Q,Z,V){var Y=G0($,Q),G=x9($,Q,Y);if(!G)return null;var K=[],J=Q,q=G.contentCol,U="",W=G.isEmpty,X=!1,H=!1;if(!G.isEmpty){for(var z=!1,B=G.contentStart;B<Y;B++)if($.charCodeAt(B)===w){z=!0;break}if(z){var j="",F=r6($,Q,G.contentStart),A=F-G.contentCol;if(A>0)for(var D=0;D<A;D++)j+=" ";for(var M=G.contentStart;M<Y;M++)if($.charCodeAt(M)===w){for(var y=4-F%4,I=0;I<y;I++)j+=" ";F+=y}else j+=$[M],F++;U=j+`
`}else U=$.slice(G.contentStart,Y)+`
`}for(J=a($,Y);J<$.length;){var O=G0($,J);_0($,J,O);var S=$.charCodeAt(J+Q0);if(Y0<q&&(S===p||S===B0||S===U0)&&Y0<=3&&T9($,J))break;var L=x9($,J,O);if(L&&L.ordered===G.ordered&&L.marker===G.marker&&L.markerCol<q){K.push({contentCol:q,raw:U,hasBlankAfter:X,isEmpty:W}),X&&(H=!0),q=L.contentCol,W=L.isEmpty,X=!1,U=L.isEmpty?"":$.slice(L.contentStart,O)+`
`,J=a($,O);continue}if(l0($,J,O)){U+=`
`,J=a($,O);for(var R=!1,b=0;b<U.length;b++){var k=U.charCodeAt(b);if(k!==T&&k!==D9&&k!==N&&k!==w){R=!0;break}}if(W&&!R)if(J<$.length){var g=G0($,J),E=x9($,J,g);if(!E||E.ordered!==G.ordered||E.marker!==G.marker)break;X=!0}else break;if(J<$.length){var h=G0($,J);_0($,J,h);var C=$.charCodeAt(J+Q0);if((C===p||C===B0||C===U0)&&Y0<=3&&T9($,J))break;var x=x9($,J,h);if(x&&x.ordered===G.ordered&&x.marker===G.marker&&x.markerCol<q){X=!0;continue}if(!l0($,J,h)&&Y0<q)break}continue}if(Y0>=q){var X0=dZ($,J,O,q);if(A$>0){for(var V0="",P=q,u=0;u<A$;u++)V0+=" ",P++;for(var O0=X0;O0<O;O0++)if($.charCodeAt(O0)===w){for(var I0=4-P%4,P0=0;P0<I0;P0++)V0+=" ";P+=I0}else V0+=$[O0],P++;U+=V0+`
`}else U+=$.slice(X0,O)+`
`;J=a($,O);continue}for(var $0=!1,m=0;m<U.length;m++){var D0=U.charCodeAt(m);if(D0!==T&&D0!==D9&&D0!==N&&D0!==w){$0=!0;break}}if(!X&&$0&&!W){var n=J+Q0,Z0=$.charCodeAt(n),r0=Z0===J9||Z0===c||Z0===e||Z0===s||Z0===A0||(Z0===p||Z0===B0||Z0===U0||Z0===M9)&&(T9($,J)!==null||x9($,J,O)!==null)||Z0>=r&&Z0<=i&&x9($,J,O)!==null;if(!r0){U+=""+$.slice(n,O)+`
`,J=a($,O);continue}}break}if(K.push({contentCol:q,raw:U,hasBlankAfter:X,isEmpty:W}),K.length===0)return null;var K0=H;if(!K0)for(var M0=0;M0<K.length;M0++){if(K[M0].hasBlankAfter&&M0<K.length-1){K0=!0;break}if(!K[M0].isEmpty){for(var N0=K[M0].raw,t=N0.length,W0=0,_=!1,o=!1,w0=!1,R0=!1,Q9=0,S0=0,q0=-1;W0<t;){var f=N0.indexOf(`
`,W0);if(f<0&&(f=t),R0){_0(N0,W0,f);for(var L0=N0.slice(W0+Q0,f),z0=0;z0<L0.length&&L0.charCodeAt(z0)===Q9;)z0++;z0>=S0&&L0.slice(z0).trim()===""&&(R0=!1),W0=f<t?f+1:t;continue}if(l0(N0,W0,f)){q0>=0?w0=!0:_&&(o=!0),W0=f<t?f+1:t;continue}if(_0(N0,W0,f),q0>=0){if(Y0>=q0){W0=f<t?f+1:t;continue}var U9=x9(N0,W0,f);if(U9&&U9.markerCol<q0&&U9.contentCol<=q0){W0=f<t?f+1:t;continue}if(U9){W0=f<t?f+1:t;continue}q0=-1,w0&&(o=!0,w0=!1)}var l9=N0.slice(W0+Q0,f),P9=l9.charCodeAt(0);if((P9===s||P9===A0)&&Y0<=3){for(var z9=0;z9<l9.length&&l9.charCodeAt(z9)===P9;)z9++;if(z9>=3){if(o&&_){K0=!0;break}R0=!0,Q9=P9,S0=z9,_=!0,W0=f<t?f+1:t;continue}}var F9=Y0<=3?x9(N0,W0,f):null;if(F9&&_){if(o){K0=!0;break}q0=F9.contentCol,w0=!1,W0=f<t?f+1:t,_=!0;continue}if(o){K0=!0;break}_=!0,W0=f<t?f+1:t}if(K0)break}}for(var H9=[],f9=0;f9<K.length;f9++){for(var Q$=K[f9],O9=Q$.raw,V9=O9.length;V9>0&&O9.charCodeAt(V9-1)===T;)V9--;var Y9=V9<O9.length?O9.slice(0,V9):O9,G9=null;if(Y9.length>=3&&Y9.charCodeAt(0)===H0){var s0=Y9[1];(s0===" "||s0==="x"||s0==="X")&&Y9.charCodeAt(2)===p0&&(G9={type:v.gfmTask,completed:s0==="x"||s0==="X"},Y9=Y9.slice(3))}var y0;if(Q$.isEmpty&&Y9.trim()==="")y0=[];else if(K0){var w9=Z.inList;Z.inList=!0,y0=N9(Y9,Z,V),Z.inList=w9}else{var X9=Z.inList;if(Z.inList=!0,y0=N9(Y9,Z,V),Z.inList=X9,y0.length===1&&y0[0].type===v.paragraph)y0=y0[0].children;else{for(var K9=[],R9=0;R9<y0.length;R9++)if(y0[R9].type===v.paragraph)for(var o9=y0[R9].children,q9=0;q9<o9.length;q9++)K9.push(o9[q9]);else K9.push(y0[R9]);y0=K9}}G9?H9.push([G9,{type:v.text,text:" "},...y0]):H9.push(y0)}return{node:{type:G.ordered?v.orderedList:v.unorderedList,start:G.ordered?G.start:void 0,items:H9},end:J}}var _$=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 v9($,Q,Z){let V={};for(let[K,J]of Object.entries($)){let q=K,U=K.toLowerCase();if(U==="style"&&typeof J=="string"){let W={},X=[],H=0,z=0;for(let j=0;j<J.length;j++){let F=J.charCodeAt(j);F===e0?H++:F===$9?H--:F===T$&&H===0&&(X.push(J.slice(z,j)),z=j+1)}z<J.length&&X.push(J.slice(z));let B=!1;X.forEach(j=>{let F=j.indexOf(":");if(F===-1)return;let A=j.slice(0,F).trim(),D=j.slice(F+1).trim();if(A&&D){if(/url\s*\(\s*(javascript|vbscript|data:(?!image\/))/i.test(D)){B=!0;return}let M=A.indexOf("-")!==-1?A.replace(/-([a-z])/g,(y,I)=>I.toUpperCase()):A;W[M]=D}}),!B&&Object.keys(W).length>0&&(V[q]=W)}else if((U==="href"||U==="src")&&Z?.sanitizer){let W=Z.sanitizer(J,Q,U);W!==null&&(V[q]=W)}else if(J==="")V[q]=!0;else if(J.length>=2&&J.charCodeAt(0)===S9&&J.charCodeAt(J.length-1)===D$){var Y=J.slice(1,-1);if(Y.length>0){var G=Y.charCodeAt(0);if(G===H0||G===S9)try{V[q]=JSON.parse(Y);continue}catch{}}if(Y==="true"){V[q]=!0;continue}if(Y==="false"){V[q]=!1;continue}if(Z?.evalUnserializableExpressions)try{V[q]=(0,eval)("("+Y+")");continue}catch{}V[q]=Y}else V[q]=J}return V}function E9($,Q,Z){let V=Q.length;if(V===0)return Z;var Y=Q.charCodeAt(0),G=Y>=d&&Y<=l||Y>=J0&&Y<=F0;if(!G){for(var K=String.fromCharCode(Y),J=$.length-V,q=Z;q<=J;){var U=$.indexOf(K,q);if(U===-1||U>J)return-1;for(var W=!0,X=1;X<V;X++){var H=$.charCodeAt(U+X),z=Q.charCodeAt(X);if(H>=d&&H<=l&&(H+=n0),z>=d&&z<=l&&(z+=n0),H!==z){W=!1;break}}if(W)return U;q=U+1}return-1}Y>=d&&Y<=l&&(Y+=n0);for(let j=Z;j<=$.length-V;j++){var B=$.charCodeAt(j);if(B>=d&&B<=l&&(B+=n0),B!==Y)continue;let F=!0;for(let A=1;A<V;A++){let D=$.charCodeAt(j+A),M=Q.charCodeAt(A);if(D>=d&&D<=l&&(D+=n0),M>=d&&M<=l&&(M+=n0),D!==M){F=!1;break}}if(F)return j}return-1}function cZ($,Q,Z){let V=Q.length;var Y=Q.charCodeAt(0);Y>=d&&Y<=l&&(Y+=n0);for(let K=Math.min(Z,$.length-V);K>=0;K--){var G=$.charCodeAt(K);if(G>=d&&G<=l&&(G+=n0),G!==Y)continue;let J=!0;for(let q=1;q<V;q++){let U=$.charCodeAt(K+q),W=Q.charCodeAt(q);if(U>=d&&U<=l&&(U+=n0),W>=d&&W<=l&&(W+=n0),U!==W){J=!1;break}}if(J)return K}return-1}var v$=-1;function p$($,Q,Z){let V=Z.toLowerCase(),Y="<"+V,G="</"+V,K=1,J=Q,q=$.length;for(v$=-1;J<q&&K>0;){let X=E9($,Y,J),H=E9($,G,J);if(H===-1)return-1;if(X!==-1&&X<H){let z=I9($,X);z?(z.tag.toLowerCase()===V&&!z.isClosing&&!z.selfClosing&&!d9(z.tag)&&K++,J=z.end):J=X+1}else{var U=H+G.length,W=U<q?$.charCodeAt(U):62;if((W===c||W===N||W===w||W===T)&&(K--,K===0)){v$=H;let z=H+G.length;for(;z<q&&$.charCodeAt(z)!==c;)z++;return z+1}J=H+1}}return-1}function i6($,Q,Z,V){if(V.ignoreHTMLBlocks||V.disableParsingRawHTML)return null;var Y=G0($,Q);if(_0($,Q,Y),Y0>3&&!Z.inHTML)return null;var G=Q+Q0;if($.charCodeAt(G)!==e)return null;var K=$.indexOf(">",G+1);if(K!==-1&&K<Y){var J=$.slice(G+1,K);if(/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(J)||/^[^\s@]+@[^\s@]+$/.test(J))return null}var q=lZ($,G);if(q>=1&&q<=5){var U=$.length;if(q===1){for(var W=$.length,X=0;X<u$.length;X++){var H=E9($,"</"+u$[X]+">",G);H>=0&&H<W&&(W=H)}if(W<$.length){var z=$.indexOf(">",W);U=z>=0?a($,z+1):$.length}}else{var B=q===2?"-->":q===3?"?>":q===4?">":"]]>",j=$.indexOf(B,G);j>=0&&(U=a($,j+B.length))}var F=$.slice(G,U);if(q>=2)return{node:{type:v.htmlComment,text:F,h:!1,raw:!0,endPos:U},end:U};var A="div",D=F.match(/^<\/?([a-zA-Z][a-zA-Z0-9-]*)/);D&&(A=D[1]);var M=I9($,G),y={},I;M&&!M.isClosing&&(y=v9(M.attrs,A,V),I=M.whitespaceBeforeAttrs+M.rawAttrs);var O=[],S=A.toLowerCase(),L="</"+S,R=E9(F,L,0),b=F,k="";if(M&&M.isClosing)for(b=F.slice(M.end-G);b.length>0&&b.charCodeAt(b.length-1)===T;)b=b.slice(0,-1);else if(M&&!M.isClosing){var g=M.end-G;if(R!==-1)for(b=F.slice(g),b.charCodeAt(0)===T&&(b=b.slice(1));b.length>0&&b.charCodeAt(b.length-1)===T;)b=b.slice(0,-1);else for(b=F;b.length>0&&b.charCodeAt(b.length-1)===T;)b=b.slice(0,-1);if(R!==-1){var E=F.slice(g,R);k=E.trim()}}var h=M?M.isClosing:!1;return{node:{type:v.htmlBlock,tag:A,attrs:y,f:I,children:O,a:b,text:k,c:!0,b:h,endPos:U,e:!0},end:U}}if(q===6||q===7){var C=R6($,Q),x=C<$.length?C:$.length,X0=$.slice(G,x),V0=C<$.length?a($,C):$.length,P=I9($,G);if(P){var u=P.tag,O0=u.toLowerCase(),I0=P.isClosing;if(I0){var P0=$.slice(P.end,x);return{node:{type:v.htmlBlock,tag:u,attrs:{},children:[],a:P0,text:P0,c:!0,b:!0,endPos:x,e:q===6},end:V0}}if(P.selfClosing||d9(u))return{node:{type:v.htmlBlock,tag:u,attrs:v9(P.attrs,u,V),f:P.whitespaceBeforeAttrs+P.rawAttrs,children:[],a:"",text:"",c:!1,b:!1,endPos:P.end,e:q===6},end:P.end<$.length&&$.charCodeAt(P.end)===T?P.end+1:P.end};var $0=Z.d||0,m=$.slice(G,x),D0=-1,n=-1;if($0<10){for(var Z0="</"+O0,r0=P.end-G,K0=1,M0=r0;M0<m.length&&K0>0;){var N0=E9(m,"<"+O0,M0),t=E9(m,Z0,M0);if(t===-1)break;if(N0!==-1&&N0<t){var W0=N0+O0.length+1;if(W0<m.length){var _=m.charCodeAt(W0);(_===N||_===w||_===T||_===c||_===j0)&&K0++}M0=N0+1}else{var o=t+Z0.length;if(o<m.length){var w0=m.charCodeAt(o);if((w0===c||w0===N||w0===w||w0===T)&&(K0--,K0===0)){D0=t;for(var R0=o;R0<m.length&&m.charCodeAt(R0)!==c;)R0++;n=R0+1;break}}else if(K0--,K0===0){D0=t,n=m.length;break}M0=t+1}}var Q9=!1;if(D0===-1&&q===6&&!P.isClosing){var S0=p$($,P.end,O0);if(S0!==-1){for(var q0=v$,f=P.end,L0=!1,z0=!1,U9=!1,l9=0,P9=!1,z9=!1,F9=f;F9<q0;){var H9=$.charCodeAt(F9);if(H9===T)z9&&(L0=!0),P9||l9++,z9=!0,F9++;else if(H9===N||H9===w)F9++;else{if(!P9&&(P9=!0,l9>=2&&H9===e)){U9=!0;break}if(z9=!1,H9===e){var f9=$.charCodeAt(F9+1)|32;if((f9===O$||f9===E$||f9===h9)&&(I6.lastIndex=F9,I6.test($))){z0=!0;break}}F9++}}if(L0&&!U9&&!z0){var Q$=G0($,S0);x=Q$,V0=a($,Q$),m=$.slice(G,x),X0=$.slice(G,x),D0=q0-G,n=S0-G,Q9=!0}}}}var O9=P.rawAttrs.indexOf(`
`)!==-1||P.whitespaceBeforeAttrs.indexOf(`
`)!==-1,V9=!1;if(D0!==-1){var Y9=m.slice(n).trim();V9=Y9.length===0}var G9=!1,s0=x,y0=V0;if(D0!==-1){var w9=G+n,X9=G0($,w9-1);if(w9<X9){for(var K9=w9;K9<X9&&($.charCodeAt(K9)===N||$.charCodeAt(K9)===w);)K9++;if(K9<X9&&$.charCodeAt(K9)===e){var R9=I9($,K9);R9&&!R9.isClosing&&(G9=!0,s0=w9,y0=w9,V9=!0)}}if(!G9){var o9=a($,X9);if(o9<x){for(var q9=o9;q9<x&&($.charCodeAt(q9)===N||$.charCodeAt(q9)===w);)q9++;if(q9<x&&$.charCodeAt(q9)===e){var ZZ=I9($,q9);ZZ&&(G9=!0,s0=X9,y0=o9,V9=!0)}}}if(!G9&&Z.inHTML){G9=!0,s0=X9,y0=a($,X9);var QZ=$.slice(w9,X9).trim();V9=QZ.length===0}}var r9=[],t0="";if(D0!==-1){t0=m.slice(P.end-G,D0);var y9=t0.trim();if(y9){var{inline:VZ,inHTML:YZ,d:GZ}=Z;Z.inHTML=!0,Z.d=$0+1;var KZ=O0==="p";if(KZ)Z.inline=!0,r9=h0(y9,0,y9.length,Z,V);else{var a$=t0.indexOf(`

`)!==-1,n$=N6.test(y9),P$=b6.test(y9),qZ=a$||n$||Z.inHTML&&P$,JZ=t0.length>=2&&t0.charCodeAt(0)===T&&t0.charCodeAt(t0.length-1)===T&&!a$;JZ&&!n$&&!P$?r9=[{type:v.text,text:y9}]:qZ||P$?(Z.inline=!1,r9=N9(t0,Z,V)):(Z.inline=!0,r9=h0(y9,0,y9.length,Z,V))}Z.inline=VZ,Z.inHTML=YZ,Z.d=GZ}}var s$=!1;if(q===6&&D0!==-1&&!Z.inHTML&&!O9){var w$=t0,UZ=/<[a-zA-Z][^>]*>/.test(w$),FZ=/\n\n/.test(w$)||/^(\s{0,3}#[#\s]|\s{0,3}[-*+]\s|\s{0,3}\d+\.\s|\s{0,3}>\s|\s{0,3}```)/m.test(w$);UZ&&!FZ&&(s$=!0)}var XZ=!Q9&&(Z.inHTML||q===7||O9||!V9||s$);if(XZ){var i0,t$=!1;if(D0!==-1&&G9){var e$=!1;if(Z.inHTML&&n<m.length){for(var X$=n;X$<m.length&&m.charCodeAt(X$)!==T;)X$++;var R$=m.slice(n,X$).trim();e$=R$.length>1&&R$.charCodeAt(0)===e&&R$.charCodeAt(1)!==j0}i0=e$?m.slice(P.end-G):t0,t$=!0}else(q===7||Z.inHTML)&&D0!==-1?(i0=m.slice(P.end-G),i0.charCodeAt(0)===T&&(i0=i0.slice(1))):G9?i0=$.slice(G,s0):O9?i0=X0:(i0=m.slice(P.end-G),i0.charCodeAt(0)===T&&(i0=i0.slice(1)));var $6={type:v.htmlBlock,tag:u,attrs:v9(P.attrs,u,V),f:P.whitespaceBeforeAttrs+P.rawAttrs,children:r9,a:i0,text:i0,c:!0,b:!1,endPos:s0,e:q===6};return t$&&($6.k=!0),{node:$6,end:y0}}return{node:{type:v.htmlBlock,tag:u,attrs:v9(P.attrs,u,V),f:P.whitespaceBeforeAttrs+P.rawAttrs,children:r9,a:Q9?"":t0,text:t0,c:!1,b:!1,endPos:s0,e:q===6},end:y0}}var W$=X0.match(/^<(\/?)([a-zA-Z][a-zA-Z0-9-]*)/),WZ=W$?W$[2]:"div",Z6=W$?W$[1]==="/":!1,y$=X0;if(Z6){var Q6=X0.indexOf(">");Q6!==-1&&(y$=X0.slice(Q6+1))}return{node:{type:v.htmlBlock,tag:WZ,attrs:{},children:[],a:y$,text:y$,c:!0,b:Z6,endPos:x,e:q===6},end:V0}}var x0=I9($,G);if(!x0)return null;var k9=x0.tag,k$=k9.toLowerCase(),V6=k9.charCodeAt(0),z$=V6>=d&&V6<=l;if(!z$&&!_$.has(k$)&&!U$.has(k$)&&!k$.includes("-"))return null;if(x0.isClosing)return{node:{type:v.htmlSelfClosing,tag:k9,attrs:{},a:$.slice(G,x0.end),b:!0,endPos:x0.end},end:x0.end};var W5=!0,C9=p$($,x0.end,k9),V$=[];if(C9!==-1){var zZ=v$,H$=$.slice(x0.end,zZ),Y$=H$.trim();if(Y$){var HZ=H$.indexOf(`

`)!==-1,OZ=N6.test(Y$),DZ=b6.test(Y$),BZ=Z.inline,jZ=Z.inHTML,MZ=Z.d;Z.inHTML=!0,Z.d=(Z.d||0)+1,HZ||OZ||DZ?(Z.inline=!1,V$=N9(H$,Z,V)):(Z.inline=!0,V$=h0(Y$,0,Y$.length,Z,V)),Z.inline=BZ,Z.inHTML=jZ,Z.d=MZ}var AZ=G0($,C9),_Z=$.slice(C9,AZ).trim(),L$=_Z?C9:a($,C9),Y6=z$?$.slice(G,C9):$.slice(G,L$),vZ=z$?C9:L$;return{node:{type:v.htmlBlock,tag:k9,attrs:v9(x0.attrs,k9,V),f:x0.whitespaceBeforeAttrs+x0.rawAttrs,children:V$,a:Y6,text:z$?H$:Y6,c:!0,b:!1,endPos:vZ,e:!1},end:L$}}var i9=R6($,x0.end),IZ=i9<$.length?a($,i9):i9,S$=$.slice(x0.end,i9);if(S$.trim()){var{inline:NZ,inHTML:bZ,d:PZ}=Z;Z.inline=!1,Z.inHTML=!0,Z.d=(Z.d||0)+1,V$=N9(S$,Z,V),Z.inline=NZ,Z.inHTML=bZ,Z.d=PZ}var wZ=$.slice(x0.end,i9);return{node:{type:v.htmlBlock,tag:k9,attrs:v9(x0.attrs,k9,V),f:x0.whitespaceBeforeAttrs+x0.rawAttrs,children:V$,a:wZ,text:S$,c:!0,b:!1,endPos:i9,e:!1},end:IZ}}function lZ($,Q){if($.charCodeAt(Q)!==e)return 0;var Z=Q+1,V=$.length;if($.charCodeAt(Z)===E0&&$.charCodeAt(Z+1)===p&&$.charCodeAt(Z+2)===p)return 2;if($.charCodeAt(Z)===a9)return 3;if($.charCodeAt(Z)===E0){var Y=$.charCodeAt(Z+1);if(Y>=d&&Y<=l)return 4;if($.slice(Z+1,Z+8)==="[CDATA[")return 5}for(var G=$.charCodeAt(Z)===j0,K=G?Z+1:Z,J=K;J<V;){var q=$.charCodeAt(J);if(q>=d&&q<=l||q>=J0&&q<=F0||q>=r&&q<=i||q===p)J++;else break}if(J===K)return 0;var U=$.slice(K,J);if(U$.has(U.toLowerCase())){if(G)return 0;var W=$.charCodeAt(J);return W===N||W===w||W===c||W===T||J>=V?1:0}if(_$.has(U.toLowerCase())){if(G){for(var X=J;X<V&&($.charCodeAt(X)===N||$.charCodeAt(X)===w);)X++;return X<V&&$.charCodeAt(X)===c?6:0}var H=J<V?$.charCodeAt(J):-1;return H===N||H===w||H===c||H===T||H===j0||H===-1?6:0}if(G){for(var F=J;F<V&&($.charCodeAt(F)===N||$.charCodeAt(F)===w);)F++;if(F<V&&$.charCodeAt(F)===c){var A=G0($,Q),D=$.slice(F+1,A).trim();if(D==="")return 7}}else{var z=G0($,Q),B=I9($,Q);if(B&&B.end<=z){var j=$.slice(B.end,z).trim();if(j==="")return 7}}return 0}function k6($,Q,Z){for(var V=0,Y=$.length;V<Y&&($.charCodeAt(V)===N||$.charCodeAt(V)===w);)V++;for(;Y>V&&($.charCodeAt(Y-1)===N||$.charCodeAt(Y-1)===w);)Y--;V<Y&&$.charCodeAt(V)===b0&&V++,Y>V&&$.charCodeAt(Y-1)===b0&&(Y-2<V||$.charCodeAt(Y-2)!==v0)&&Y--;for(var G=[],K=V,J=!1,q=[],U=V;U<Y;){var W=$.charCodeAt(U);if(W===v0&&U+1<Y){$.charCodeAt(U+1)===b0?(J||(J=!0,q=[]),q.push($.slice(K,U)),q.push("|"),U+=2,K=U):U+=2;continue}if(W===s){for(var X=0;U<Y&&$.charCodeAt(U)===s;)X++,U++;for(var H=!1;U<Y&&!H;){for(var z=0;U<Y&&$.charCodeAt(U)===s;)z++,U++;z===X?H=!0:z===0&&U++}continue}if(W===b0){var B=J?(q.push($.slice(K,U)),q.join("")):$.slice(K,U);G.push(B.trim()),U++,K=U,J=!1,q=[];continue}U++}var j=J?(q.push($.slice(K,Y)),q.join("")):$.slice(K,Y);return G.push(j.trim()),G.map(function(F){var A=F.indexOf("\\|")!==-1?F.replace(/\\\|/g,"|"):F;return h0(A,0,A.length,Q,Z)})}function L6($,Q,Z,V){let Y=G0($,Q);var G=$.indexOf("|",Q);if(G<0||G>=Y)return null;let K=a($,Y);if(K>=$.length)return null;let J=G0($,K);if(!h6($,K,J))return null;let q=$.slice(Q,Y),U=$.slice(K,J);for(var W=[],X=0,H=U.length;X<H&&(U.charCodeAt(X)===N||U.charCodeAt(X)===w);)X++;for(X<H&&U.charCodeAt(X)===b0&&X++;X<H;){for(;X<H&&(U.charCodeAt(X)===N||U.charCodeAt(X)===w);)X++;if(X>=H||U.charCodeAt(X)===b0)break;var z=U.charCodeAt(X)===T0;for(z&&X++;X<H&&U.charCodeAt(X)===p;)X++;var B=X<H&&U.charCodeAt(X)===T0;for(B&&X++,W.push(z&&B?"center":B?"right":z?"left":null);X<H&&(U.charCodeAt(X)===N||U.charCodeAt(X)===w);)X++;X<H&&U.charCodeAt(X)===b0&&X++}let j=k6(q,Z,V);if(W.length!==j.length)return null;let F=[],A=a($,J);for(;A<$.length;){let S=G0($,A),L=$.slice(A,S);if(l0($,A,S))break;if(_0($,A,S),Y0<4){var D=$.charCodeAt(A+Q0);if(D===c||D===J9||(D===p||D===B0||D===U0)&&T9($,A))break;if(D===s||D===A0){for(var M=A+Q0,y=0;M<S&&$.charCodeAt(M)===D;)y++,M++;if(y>=3)break}}F.push(k6(L,Z,V)),A=a($,S)}if((V.streaming||V.optimizeForStreaming)&&F.length===0)return null;for(var I=j.length,O=0;O<F.length;O++)if(F[O].length<I)for(;F[O].length<I;)F[O].push([]);else F[O].length>I&&(F[O].length=I);return{node:{type:v.table,header:j,cells:F,align:W},end:A}}function oZ($,Q,Z){var V=G0($,Q);if(_0($,Q,V),Y0>3)return null;var Y=Q+Q0;if($.charCodeAt(Y)!==H0)return null;if(Y+1<$.length&&$.charCodeAt(Y+1)===a0){var G=rZ($,Y,Z);return G||null}Z.refs||(Z.refs={});var K=p6($,Y,Z.refs);return K===null?null:{node:{type:v.refCollection},end:K}}function rZ($,Q,Z){var V=$.length;if($.charCodeAt(Q)!==H0||Q+1>=V||$.charCodeAt(Q+1)!==a0)return null;for(var Y=Q+2,G=Y;Y<V&&$.charCodeAt(Y)!==p0;){if($.charCodeAt(Y)===T)return null;Y++}if(Y>=V)return null;var K=("^"+$.slice(G,Y)).toLowerCase();if(Y++,Y>=V||$.charCodeAt(Y)!==T0)return null;for(Y++;Y<V&&($.charCodeAt(Y)===N||$.charCodeAt(Y)===w);)Y++;if(Y<V&&$.charCodeAt(Y)===T)for(Y++;Y<V&&($.charCodeAt(Y)===N||$.charCodeAt(Y)===w);)Y++;var J=$.indexOf(`
`,Y);J<0&&(J=V);for(var q=$.slice(Y,J).trim(),U=J<V?J+1:V;U<V;){var W=G0($,U);if(_0($,U,W),Y0>=2&&!l0($,U,W))q+=`
`+$.slice(U,W),U=a($,W);else if(l0($,U,W)){var X=a($,W);if(X<V){var H=G0($,X);if(_0($,X,H),Y0>=2){q+=`
`,U=a($,W);continue}}break}else break}return Z.refs[K]||(Z.refs[K]={target:q,title:void 0}),{node:{type:v.footnote},end:U}}function iZ($,Q,Z,V){let Y=Q,G=0,K=0,J=-1;for(;Y<$.length;){let k=J>=0?J:G0($,Y);if(J=-1,l0($,Y,k))break;if(_0($,Y,k),Y0<4&&K>0&&!Z.g){let E=$.charCodeAt(Y+Q0);if(E===C0||E===p){let h=Y+Q0;for(;h<k&&$.charCodeAt(h)===E;)h++;for(;h<k&&($.charCodeAt(h)===N||$.charCodeAt(h)===w);)h++;if(h>=k){G=E===C0?1:2,Y=a($,k);break}}}K=k;let g=a($,k);if(g<$.length){if($.charCodeAt(g)===n9){var q=G0($,g);Y=a($,q),K=q;continue}let E=G0($,g);if(J=E,_0($,g,E),Y0<4){let h=$.charCodeAt(g+Q0);if(h===c){Y=g;break}if(h===J9&&o6($,g,Z,V)){Y=g;break}if(h===s||h===A0){for(var U=g+Q0,W=0;U<E&&$.charCodeAt(U)===h;)W++,U++;if(W>=3){Y=g;break}}if(h===e){var X=g+Q0+1,H=X<E?$.charCodeAt(X):0,z=H===E0||H===a9;if(!z&&H===j0){for(var B=X+1,j=B;j<E&&($.charCodeAt(j)>=d&&$.charCodeAt(j)<=l||$.charCodeAt(j)>=J0&&$.charCodeAt(j)<=F0||$.charCodeAt(j)>=r&&$.charCodeAt(j)<=i||$.charCodeAt(j)===p);)j++;j>B&&(z=_$.has($.slice(B,j).toLowerCase()))}else if(!z){for(var F=X;F<E&&($.charCodeAt(F)>=d&&$.charCodeAt(F)<=l||$.charCodeAt(F)>=J0&&$.charCodeAt(F)<=F0||$.charCodeAt(F)>=r&&$.charCodeAt(F)<=i||$.charCodeAt(F)===p);)F++;if(F>X){var A=$.slice(X,F).toLowerCase();z=_$.has(A)||U$.has(A)}}if(z&&i6($,g,Z,V)){Y=g;break}}if(h===p||h===B0||h===M9){let C=g+Q0+1;if(C<E&&($.charCodeAt(C)===N||$.charCodeAt(C)===w)){var D=J$($,C,E);if(D<E&&!T9($,g)){Y=g;break}}}if(h>=r&&h<=i){let C=g+Q0;for(;C<E&&$.charCodeAt(C)>=r&&$.charCodeAt(C)<=i;)C++;if(C<E&&($.charCodeAt(C)===d0||$.charCodeAt(C)===$9)&&C-(g+Q0)===1&&$.charCodeAt(g+Q0)===49){var M=C+1;if(M<E&&($.charCodeAt(M)===N||$.charCodeAt(M)===w)){var y=J$($,M,E);if(y<E){Y=g;break}}}}if(h===b0){let C=a($,E);if(C<$.length){let x=G0($,C);if(h6($,C,x)){Y=g;break}}}if((h===p||h===B0||h===U0)&&T9($,g)){if(h!==p){Y=g;break}let C=0,x=g+Q0;for(;x<E&&$.charCodeAt(x)===p;)C++,x++;for(;x<E&&($.charCodeAt(x)===N||$.charCodeAt(x)===w);)x++;if(x<E){Y=g;break}}}}Y=a($,k)}for(var I=G?K:Y;I>Q&&($.charCodeAt(I-1)===T||$.charCodeAt(I-1)===D9||$.charCodeAt(I-1)===N||$.charCodeAt(I-1)===w);)I--;for(var O=Q;O<I&&($.charCodeAt(O)===N||$.charCodeAt(O)===w);)O++;if(O>=I)return null;for(var S=!1,L=O;L<I;L++)if($.charCodeAt(L)===n9){S=!0;break}var R=S?$.slice(O,I).replace(/\u001E/g,""):$.slice(O,I);if(!R)return null;let b=aZ(R,0,R.length,Z,V);if(G){let g=(V?.slugify||g0)(R);return{node:{type:v.heading,level:G,children:b,id:g},end:Y}}return{node:{type:v.paragraph,children:b},end:Y}}function aZ($,Q,Z,V,Y){var G=$.indexOf(`
`,Q);if(G<0||G>=Z)return h0($,Q,Z,V,Y);for(var K="",J=Q,q=Q;q<Z;){var U=$.charCodeAt(q);if(U===s){var W=N$($,q,Z);if(W>q){for(var X=!1,H=q;H<W;H++)if($.charCodeAt(H)===T){X=!0;break}X&&(K+=$.slice(J,q),K+=$.slice(q,W).replace(/\n/g," "),J=W),q=W;continue}}if(U===e){var z=a6($,q,Z);if(z>q){q=z;continue}}if(U===T){var B=!1,j=0;if(q>Q&&$.charCodeAt(q-1)===v0)B=!0,j=1;else{for(var F=0,A=q-1;A>=Q&&$.charCodeAt(A)===N;)F++,A--;F>=2&&(B=!0,j=F)}if(B)K+=$.slice(J,q-j),K+="";else{for(var D=q;D>J&&$.charCodeAt(D-1)===N;)D--;K+=$.slice(J,D)+`
`}for(q++;q<Z&&$.charCodeAt(q)===N;)q++;J=q;continue}q++}return J<Z&&(K+=$.slice(J,Z)),h0(K,0,K.length,V,Y)}function nZ($,Q,Z){if($.charCodeAt(Q)!==s)return null;let V=b9($,Q,Z,96),Y=Q+V;for(;Y<Z;){let G=$.indexOf("`",Y);if(G<0||G>=Z)return null;let K=b9($,G,Z,96);if(K===V){let J=$.slice(Q+V,G);return J=J.replace(/\n/g," "),J.length>0&&J[0]===" "&&J[J.length-1]===" "&&J.trim().length>0&&(J=J.slice(1,-1)),{node:{type:v.codeInline,text:J},end:G+K}}Y=G+K}return null}function N$($,Q,Z){if($.charCodeAt(Q)!==s)return Q;let V=b9($,Q,Z,96),Y=Q+V;for(;Y<Z;){let G=$.indexOf("`",Y);if(G<0||G>=Z)return Q;let K=b9($,G,Z,96);if(K===V)return G+K;Y=G+K}return Q}function a6($,Q,Z){if($.charCodeAt(Q)!==e)return Q;if(Q+1<Z&&$.charCodeAt(Q+1)===j0){let U=Q+2;for(;U<Z&&$.charCodeAt(U)!==c;)U++;return U<Z?U+1:Q}if(Q+3<Z&&$.charCodeAt(Q+1)===E0&&$.charCodeAt(Q+2)===p&&$.charCodeAt(Q+3)===p){let U=$.indexOf("-->",Q+4);return U>=0?U+3:Q}let V=Q+1,Y=V;for(;V<Z;){let U=$.charCodeAt(V);if(U>=d&&U<=l||U>=J0&&U<=F0||U>=r&&U<=i||U===p)V++;else break}if(V===Y)return Q;let G=$.slice(Y,V).toLowerCase(),K=!1;for(;V<Z;){let U=$.charCodeAt(V);if(U===c){V++;break}if(U===j0&&V+1<Z&&$.charCodeAt(V+1)===c){V+=2,K=!0;break}if(U===j9||U===L9){var J=U;for(V++;V<Z&&$.charCodeAt(V)!==J;)V++;V<Z&&V++;continue}if(U===T)return Q;V++}if(K||d9(G))return V;let q=1;for(;V<Z&&q>0;)if($.charCodeAt(V)===e)if(V+1<Z&&$.charCodeAt(V+1)===j0){let U=V+2,W=U;for(;W<Z&&($.charCodeAt(W)>=d&&$.charCodeAt(W)<=l||$.charCodeAt(W)>=J0&&$.charCodeAt(W)<=F0);)W++;if($.slice(U,W).toLowerCase()===G){for(;W<Z&&$.charCodeAt(W)!==c;)W++;if(W<Z&&W++,q--,q===0)return W}V=W}else{let U=V+1,W=U;for(;W<Z&&($.charCodeAt(W)>=d&&$.charCodeAt(W)<=l||$.charCodeAt(W)>=J0&&$.charCodeAt(W)<=F0);)W++;$.slice(U,W).toLowerCase()===G&&q++,V++}else V++;return V}function sZ($,Q,Z,V,Y){if($.charCodeAt(Q)!==A0||Q+1>=Z||$.charCodeAt(Q+1)!==A0)return null;let G=Q+2;for(;G+1<Z;){let K=$.charCodeAt(G);if(K===s){let J=N$($,G,Z);if(J>G){G=J;continue}}if(K===A0&&$.charCodeAt(G+1)===A0){let J=$.slice(Q+2,G),q=h0(J,0,J.length,V,Y);return{node:{type:v.textFormatted,tag:"del",children:q},end:G+2}}K===v0&&G+1<Z&&G++,G++}return null}function tZ($,Q,Z,V,Y){if($.charCodeAt(Q)!==C0||Q+1>=Z||$.charCodeAt(Q+1)!==C0)return null;let G=Q+2;for(;G+1<Z;){let K=$.charCodeAt(G);if(K===s){let J=N$($,G,Z);if(J>G){G=J;continue}}if(K===C0&&$.charCodeAt(G+1)===C0&&G>Q+2){let J=$.slice(Q+2,G),q=h0(J,0,J.length,V,Y);return{node:{type:v.textFormatted,tag:"mark",children:q},end:G+2}}K===v0&&G+1<Z&&G++,G++}return null}function S6($,Q,Z){return $<s9?!!(c$($)&p9):B6.test(Q[Z])}function g6($,Q,Z){return $<s9?!!(c$($)&A9):j6.test(Q[Z])}function eZ($,Q,Z){var V=$.charCodeAt(Q);if(V!==B0&&V!==U0)return null;var Y=b9($,Q,Z,V);if(Y===0)return null;var G=Q>0?$.charCodeAt(Q-1):32,K=Q+Y<Z?$.charCodeAt(Q+Y):32,J=g6(G,$,Q-1),q=g6(K,$,Q+Y),U=Q>0?S6(G,$,Q-1):!1,W=Q+Y<Z?S6(K,$,Q+Y):!1,X=!q&&(!W||J||U),H=!J&&(!U||q||W),z,B;return V===B0?(z=X,B=H):(z=X&&(!H||U),B=H&&(!X||W)),{len:Y,canOpen:z,canClose:B}}function $5($,Q,Z,V){if(Q.length!==0){for(var Y=[],G=0;G<12;G++)Y[G]=-1;for(var K=0;K<Q.length;){var J=Q[K];if(!J.active||!J.canClose){K++;continue}for(var q=J.ch===B0?0:1,U=q*6+J.len%3*2+(J.canOpen?1:0),W=Y[U]!==void 0?Y[U]:-1,X=-1,H=K-1;H>W;H--){var z=Q[H];if(!(!z.active||z.ch!==J.ch||!z.canOpen)&&!((J.canOpen||z.canClose)&&(z.len+J.len)%3===0&&z.len%3!==0)){X=H;break}}if(X<0){Y[U]=K-1,!J.canOpen&&(J.active=!1),K++;continue}var B=Q[X],j=B.len>=2&&J.len>=2,F=j?2:1;B.len-=F,J.len-=F;var A=$[B.idx],D=$[J.idx];A.text=A.text.slice(0,A.text.length-F),D.text=D.text.slice(F);var M=B.idx+1,y=J.idx,I=$.slice(M,y),O={type:v.textFormatted,tag:j?"strong":"em",children:I};$.splice(M,y-M,O);for(var S=y-M-1,L=0;L<Q.length;L++)Q[L].idx>B.idx&&(Q[L].idx-=S);for(var R=X+1;R<K;R++)Q[R].active=!1;if(B.len===0&&(B.active=!1,A.text==="")){$.splice(B.idx,1);for(var b=0;b<Q.length;b++)Q[b].idx>B.idx?Q[b].idx--:Q[b].idx===B.idx&&(Q[b].idx=-1)}if(J.len===0){J.active=!1;var k=J.idx;if(D.text===""){$.splice(k,1);for(var g=0;g<Q.length;g++)Q[g].idx>k?Q[g].idx--:Q[g].idx===k&&(Q[g].idx=-1)}}else continue;K++}for(var E=0,h=0;h<$.length;h++){var C=$[h];if(C.type===v.text){var x=C;if(x.text==="")continue;if(E>0&&$[E-1].type===v.text){$[E-1].text+=x.text;continue}}$[E++]=C}$.length=E}}function x6($,Q,Z,V,Y){let G=$.charCodeAt(Q)===E0,K=G?Q+1:Q;if($.charCodeAt(K)!==H0)return null;var J=$.indexOf("]",K+1);if(J<0||J>=Z)return null;for(var q=K+1,U=-1,W=1;q<Z&&W>0;){var X=$.charCodeAt(q);if(X===v0&&q+1<Z){q+=2;continue}if(X===s){var H=N$($,q,Z);if(H>q){q=H;continue}}if(X===e){var z=n6($,q,Z);if(z){q=z.end;continue}var B=a6($,q,Z);if(B>q){q=B;continue}}X===H0?W++:X===p0&&W--,q++}if(W!==0)return null;var j=q-1,F=$.slice(K+1,j),A=q<Z?$.charCodeAt(q):0,D=!1;if(A===e0){var M=!0;for(q++;q<Z&&($.charCodeAt(q)===N||$.charCodeAt(q)===T);)q++;var y="",I=q;if(q<Z&&$.charCodeAt(q)===e){for(q++,I=q;I<Z&&$.charCodeAt(I)!==c;){if($.charCodeAt(I)===v0&&I+1<Z){I+=2;continue}if($.charCodeAt(I)===T){M=!1;break}I++}M&&(I>=Z||$.charCodeAt(I)!==c)&&(M=!1),M&&(y=$.slice(q,I),I++)}else if(M){for(var O=0;I<Z;){var S=$.charCodeAt(I);if(S===v0&&I+1<Z){I+=2;continue}if(S===e0)O++;else if(S===$9){if(O===0)break;O--}else if(S===N||S===T)break;I++}y=$.slice(q,I)}if(M){for(q=I;q<Z&&($.charCodeAt(q)===N||$.charCodeAt(q)===T);)q++;var L;if(q<Z){var R=$.charCodeAt(q);if(R===j9||R===L9||R===e0){var b=R===e0?41:R;q++;for(var k=q;q<Z&&$.charCodeAt(q)!==b;)$.charCodeAt(q)===v0&&q+1<Z&&q++,q++;q>=Z?M=!1:(L=$.slice(k,q),q++)}}if(M){for(;q<Z&&($.charCodeAt(q)===N||$.charCodeAt(q)===T);)q++;(q>=Z||$.charCodeAt(q)!==$9)&&(M=!1)}}if(M){q++,y=Z$(y),L!==void 0&&(L=t9(Z$(L)));var g=Y?.sanitizer||g9,E=g(y,G?"img":"a",G?"src":"href"),h=E===null?null:y;if(G){var C=h0(F,0,F.length,V,Y),x=I$(C);return{node:{type:v.image,target:h,alt:x,title:L},end:q}}else{var X0=V.inAnchor;V.inAnchor=!0;var V0=X0?[{type:v.text,text:F}]:h0(F,0,F.length,V,Y);return V.inAnchor=X0,!V.inAnchor&&d$(V0)?null:{node:{type:v.link,target:h,title:L,children:V0},end:q}}}else q=j+1,D=!0}var P="",u=q;if(!D&&A===H0){var O0=q+1;u=O0;for(var I0=!1;u<Z&&$.charCodeAt(u)!==p0;){if($.charCodeAt(u)===v0&&u+1<Z){u+=2;continue}if($.charCodeAt(u)===H0){I0=!0;break}u++}if(I0||u>=Z)return null;var P0=$.slice(O0,u);if(P0.trim())P=M$(P0);else{if(w6(F))return null;P=M$(F)}u=u+1}else{if(w6(F))return null;P=M$(F)}var $0=V.refs[P];if(!$0)return null;if(G)return{node:{type:v.image,target:$0.target,alt:I$(h0(F,0,F.length,V,Y)),title:$0.title},end:u};var m=V.inAnchor;V.inAnchor=!0;var V0=m?[{type:v.text,text:F}]:h0(F,0,F.length,V,Y);return V.inAnchor=m,!V.inAnchor&&d$(V0)?null:{node:{type:v.link,target:$0.target,title:$0.title,children:V0},end:u}}function n6($,Q,Z){if($.charCodeAt(Q)!==e)return null;for(var V=Q+1;V<Z;){var Y=$.charCodeAt(V);if(Y===c)break;if(Y===N||Y===T||Y===D9||Y===e)return null;V++}if(V>=Z||$.charCodeAt(V)!==c)return null;var G=$.slice(Q+1,V),K=G.match(/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^\x00-\x20]*)$/);return K?{node:{type:v.link,target:G,title:void 0,children:[{type:v.text,text:G}]},end:V+1}:G.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(G)?{node:{type:v.link,target:"mailto:"+G,title:void 0,children:[{type:v.text,text:G}]},end:V+1}:null}function Z5($,Q,Z,V){if($.charCodeAt(Q)!==H0||Q+1>=Z||$.charCodeAt(Q+1)!==a0)return null;let Y=Q+2;for(;Y<Z&&$.charCodeAt(Y)!==p0&&$.charCodeAt(Y)!==T;)Y++;if(Y>=Z||$.charCodeAt(Y)!==p0)return null;let G=$.slice(Q+2,Y);return G?{node:{type:v.footnoteReference,target:"#"+g0(G),text:G},end:Y+1}:null}function Q5($,Q,Z,V){if(V.disableBareUrls)return null;var Y="",G=!1,K=$.charCodeAt(Q);if(K===m9||K===72?Q+8<=Z&&$.charCodeAt(Q+1)===h9&&$.charCodeAt(Q+2)===h9&&$.charCodeAt(Q+3)===O$&&($.charCodeAt(Q+4)===E$&&$.charCodeAt(Q+5)===T0&&$.charCodeAt(Q+6)===j0&&$.charCodeAt(Q+7)===j0?Y="https://":$.charCodeAt(Q+4)===T0&&$.charCodeAt(Q+5)===j0&&$.charCodeAt(Q+6)===j0&&(Y="http://")):K===B9||K===70?Q+6<=Z&&$.charCodeAt(Q+1)===h9&&$.charCodeAt(Q+2)===O$&&$.charCodeAt(Q+3)===T0&&$.charCodeAt(Q+4)===j0&&$.charCodeAt(Q+5)===j0&&(Y="ftp://"):(K===W9||K===87)&&Q+4<=Z&&$.charCodeAt(Q+1)===W9&&$.charCodeAt(Q+2)===W9&&$.charCodeAt(Q+3)===d0&&(Y="www.",G=!0),!Y)return null;let J=Q+Y.length;for(;J<Z;){let O=$.charCodeAt(J);if(O===N||O===T||O===w||O===D9||O===e||O===c)break;J++}for(var q=0,U=0,W=Q;W<J;W++){var X=$.charCodeAt(W);X===e0?q++:X===$9&&U++}let H=J;for(;H>Q+Y.length;){let O=$.charCodeAt(H-1);if(O===d0||O===q6||O===T0||O===E0||O===a9||O===$9||O===B0||O===U0||O===A0){if(O===$9){if(q>=U)break;U--}H--}else if(O===T$){for(var z=H-2;z>Q&&($.charCodeAt(z)>=d&&$.charCodeAt(z)<=l||$.charCodeAt(z)>=J0&&$.charCodeAt(z)<=F0||$.charCodeAt(z)>=r&&$.charCodeAt(z)<=i);)z--;z>=Q&&$.charCodeAt(z)===g$?H=z:H--}else break}if(H<=Q+Y.length)return null;var B=Q+(G?4:Y.length),j=$.indexOf("/",B);if((j<0||j>H)&&(j=H),G&&$.indexOf(".",B)===-1)return null;for(var F=-1,A=-1,D=j-1;D>=B;D--)if($.charCodeAt(D)===d0)if(F<0)F=D;else{A=D;break}for(var M=A>=0?A+1:B,D=M;D<j;D++)if($.charCodeAt(D)===U0)return null;var y=$.slice(Q,H),I=G?"http://"+y:y;return{node:{type:v.link,target:I,title:void 0,children:[{type:v.text,text:y}]},end:H}}function V5($,Q,Z,V){if(V.disableBareUrls)return null;for(var Y=Q,G=Y;Y<Z;){var K=$.charCodeAt(Y);if(K>=d&&K<=l||K>=J0&&K<=F0||K>=r&&K<=i||K===d0||K===E0||K===J9||K===36||K===G$||K===g$||K===L9||K===B0||K===M9||K===j0||K===C0||K===a9||K===a0||K===U0||K===s||K===S9||K===b0||K===D$||K===A0||K===p)Y++;else break}if(Y===G||Y>=Z||$.charCodeAt(Y)!==K$)return null;Y++;for(var J=Y,q=-1,U=Y;Y<Z;){var K=$.charCodeAt(Y);if(K>=d&&K<=l||K>=J0&&K<=F0||K>=r&&K<=i)Y++;else if((K===p||K===U0)&&Y>J)Y++;else if(K===d0){if(Y===J)break;var W=$.charCodeAt(Y-1);if(W===p||W===U0||Y-U>63)break;if(Y+1<Z){var X=$.charCodeAt(Y+1);if(X>=d&&X<=l||X>=J0&&X<=F0||X>=r&&X<=i)q=Y,U=Y+1,Y++;else break}else break}else break}if(Y-U>63||q<0)return null;var H=$.charCodeAt(Y-1);if(!(H>=d&&H<=l||H>=J0&&H<=F0||H>=r&&H<=i)||Y<=q+1)return null;for(var z=-1,B=q-1;B>=J;B--)if($.charCodeAt(B)===d0){z=B;break}for(var j=z>=0?z+1:J,B=j;B<Y;B++)if($.charCodeAt(B)===U0)return null;var F=$.slice(Q,Y);return{node:{type:v.link,target:"mailto:"+F,title:void 0,children:[{type:v.text,text:F}]},end:Y}}function d$($){for(var Q=0;Q<$.length;Q++)if($[Q].type===v.link||"children"in $[Q]&&Array.isArray($[Q].children)&&d$($[Q].children))return!0;return!1}function I$($){for(var Q="",Z=0;Z<$.length;Z++){var V=$[Z];V.type===v.text?Q+=V.text:V.type===v.breakLine?Q+=" ":V.type===v.codeInline?Q+=V.text:"children"in V&&Array.isArray(V.children)?Q+=I$(V.children):V.type===v.image?Q+=V.alt||"":V.type===v.link&&(Q+=I$(V.children))}return Q}function c9($){let Q=$.includes("&")?t9($):$;return{type:v.text,text:Q}}function Y5($,Q,Z,V,Y){if($.charCodeAt(Q)!==e)return null;var G=Q+1;if(G>=Z)return null;var K=$.charCodeAt(G);if(K===E0&&G+1<Z&&$.charCodeAt(G+1)===p&&G+2<Z&&$.charCodeAt(G+2)===p){var J=G+3;if(J<Z&&$.charCodeAt(J)===c)return{node:{type:v.htmlComment,text:"",h:!0},end:J+1};if(J+1<Z&&$.charCodeAt(J)===p&&$.charCodeAt(J+1)===c)return{node:{type:v.htmlComment,text:"-",h:!0},end:J+2};var q=$.indexOf("-->",J);return q!==-1&&q<=Z-3?{node:{type:v.htmlComment,text:$.slice(Q+4,q),h:!1},end:q+3}:null}if(K===a9){var U=$.indexOf("?>",G+1);return U!==-1&&U<Z?{node:{type:v.htmlSelfClosing,tag:"?",attrs:{},a:$.slice(Q,U+2),b:!1},end:U+2}:null}if(K===E0&&G+1<Z){var W=$.charCodeAt(G+1);if(W===H0&&$.slice(G+1,G+8)==="[CDATA["){var X=$.indexOf("]]>",G+8);return X!==-1&&X<Z?{node:{type:v.htmlSelfClosing,tag:"![CDATA[",attrs:{},a:$.slice(Q,X+3),b:!1},end:X+3}:null}if(W>=d&&W<=l){var H=$.indexOf(">",G+2);return H!==-1&&H<Z?{node:{type:v.htmlSelfClosing,tag:"!"+$.slice(G+1,H),attrs:{},a:$.slice(Q,H+1),b:!1},end:H+1}:null}}if(K===j0){var z=G+1;if(z>=Z)return null;var B=$.charCodeAt(z);if(!(B>=d&&B<=l||B>=J0&&B<=F0))return null;for(z++;z<Z;){var j=$.charCodeAt(z);if(j>=d&&j<=l||j>=J0&&j<=F0||j>=r&&j<=i||j===p)z++;else break}for(;z<Z&&($.charCodeAt(z)===N||$.charCodeAt(z)===w||$.charCodeAt(z)===T);)z++;if(z<Z&&$.charCodeAt(z)===c){var F=$.slice(G+1,z).trim();return{node:{type:v.htmlSelfClosing,tag:F,attrs:{},a:$.slice(Q,z+1),b:!0},end:z+1}}return null}if(!(K>=d&&K<=l||K>=J0&&K<=F0))return null;var A=I9($,Q);if(!A)return null;var D=A.tag,M=D.toLowerCase(),y=A.selfClosing;if(y||d9(D))return{node:{type:v.htmlSelfClosing,tag:D,attrs:v9(A.attrs,D,Y),a:$.slice(Q,A.end),b:!1},end:A.end};var I=U$.has(M),O=p$($.slice(0,Z),A.end,D);if(O===-1)return{node:{type:v.htmlSelfClosing,tag:D,attrs:v9(A.attrs,D,Y),a:$.slice(Q,A.end),b:!1},end:A.end};var S=cZ($,"</"+M,O),L=$.slice(A.end,S),R=[];if(I)L.trim()&&(R=[{type:v.text,text:L}]);else{var b=L.trim();if(b){var{inAnchor:k,inline:g}=V;M==="a"&&(V.inAnchor=!0);var E=b.indexOf(`

`)!==-1||/^#{1,6}\s/.test(b);E?(V.inline=!1,R=N9(b,V,Y)):R=h0(b,0,b.length,V,Y),V.inAnchor=k,V.inline=g}}return{node:{type:v.htmlBlock,tag:D,attrs:v9(A.attrs,D,Y),f:A.rawAttrs,children:R,a:void 0,text:L,c:!1,b:!1,endPos:O,e:!1},end:O}}var G5=200,$$=0;function h0($,Q,Z,V,Y){if($$++,$$>G5)return $$--,[{type:v.text,text:$.slice(Q,Z)}];let G=V;if(Y.streaming||Y.optimizeForStreaming){let Q9=function(q0,f){for(var L0=1,z0=f+1;z0<q0.length;z0++){var U9=q0.charCodeAt(z0);if(U9===H0)L0++;else if(U9===p0&&(L0--,L0===0))return z0}return-1},_=$.slice(Q,Z),o=_;for(var K=0,J=0,q=0,U=0,W=0,X=-1,H=-1,z=-1,B=-1,j=-1,F=0;F<_.length;F++){var A=_.charCodeAt(F);A===B0?F+1<_.length&&_.charCodeAt(F+1)===B0?(K++,X=F,F++):(J++,H=F):A===U0?F+1<_.length&&_.charCodeAt(F+1)===U0?(q++,z=F,F++):(U++,B=F):A===A0&&F+1<_.length&&_.charCodeAt(F+1)===A0&&(W++,j=F,F++)}var D=[];W%2===1&&j>=0&&D.push([j,2]),q%2===1&&z>=0&&D.push([z,2]),U%2===1&&B>=0&&D.push([B,1]),K%2===1&&X>=0&&D.push([X,2]),J%2===1&&H>=0&&D.push([H,1]),D.sort(function(q0,f){return f[0]-q0[0]});for(var M=0;M<D.length;M++){var y=D[M][0],I=D[M][1];_=_.slice(0,y)+_.slice(y+I)}let w0=0,R0=-1;for(let q0=0;q0<_.length;q0++)_.charCodeAt(q0)===s&&(w0++,R0=q0);if(w0%2===1&&R0!==-1){let q0=!1,f=-1,L0=0;for(;L0<_.length;)_.charCodeAt(L0)===s&&(q0?(q0=!1,f=-1):(f=L0,q0=!0)),L0++;q0&&f!==-1&&(_=_.slice(0,f))}for(var O=!0;O;){O=!1;for(var S=-1,L=-1,R=-1,b=!1,k=0;k<_.length;k++){var g=_.charCodeAt(k);if(g===H0&&(k===0||_.charCodeAt(k-1)!==v0)){var E=k>0&&_.charCodeAt(k-1)===E0,h=E?k-1:k,C=Q9(_,k);if(C===-1)S=h,b=E,L=k+1,R=_.length;else{var x=C+1;if(x>=_.length)S=h,b=E,L=k+1,R=C;else if(_.charCodeAt(x)===e0){var X0=_.indexOf(")",x+1);X0===-1?(S=h,b=E,L=k+1,R=C,k=_.length):k=X0}else if(_.charCodeAt(x)===H0){var V0=_.indexOf("]",x+1);V0===-1?(S=h,b=E,L=k+1,R=C,k=_.length):k=V0}else k=C}}}if(S>=0){var P=b?"":_.slice(L,R);_=_.slice(0,S)+P,O=!0}}let S0=_.match(/<([A-Z][A-Za-z0-9]*)(?:\s[^>]*)?>([^<]*)$/);if(S0&&S0.index!==void 0){var u=S0[0].length-S0[2].length,O0=u>=2&&S0[0].charCodeAt(u-2)===j0;if(!O0){for(var I0=!1,P0=0,$0=0;$0<S0.index;$0++)_.charCodeAt($0)===s&&P0++;if(I0=P0%2===1,!I0){let q0=S0[1];E9(_,"</"+q0,0)===-1&&(_=_.replace(/<[A-Z][A-Za-z0-9]*(?:\s[^>]*)?>([^<]*)$/,"$1"))}}}_!==o&&($=$.slice(0,Q)+_,Z=Q+_.length)}let m=[];var D0=[];let n=Q;var Z0=Y.disableAutoLink||Y.disableBareUrls||G.inAnchor?-1:$.indexOf("@",Q);for(Z0>=Z&&(Z0=-1);Q<Z;){let _=$.charCodeAt(Q),o=null;if(_===s){if(o=nZ($,Q,Z),!o){var r0=b9($,Q,Z,s);Q+=r0-1}}else if(_===B0||_===U0){var K0=eZ($,Q,Z);if(K0){if(K0.canOpen||K0.canClose){Q>n&&m.push(c9($.slice(n,Q)));var M0=$.slice(Q,Q+K0.len),N0=c9(M0);D0.push({idx:m.length,ch:_,len:K0.len,canOpen:K0.canOpen,canClose:K0.canClose,active:!0}),m.push(N0),Q+=K0.len,n=Q;continue}Q+=K0.len-1}}else if(_===A0)o=sZ($,Q,Z,G,Y);else if(_===C0)o=tZ($,Q,Z,G,Y);else if(_===H0)Q+1<Z&&$.charCodeAt(Q+1)===a0&&(o=Z5($,Q,Z,G)),o||(o=x6($,Q,Z,G,Y));else if(_===E0&&Q+1<Z&&$.charCodeAt(Q+1)===H0)o=x6($,Q,Z,G,Y);else if(_===e)o=n6($,Q,Z),!o&&!Y.disableParsingRawHTML&&!Y.ignoreHTMLBlocks&&(o=Y5($,Q,Z,G,Y));else if((_===m9||_===W9||_===B9)&&!G.inAnchor&&!Y.disableAutoLink&&(Q===0||$.charCodeAt(Q-1)!==e)){var t=Q+1<Z?$.charCodeAt(Q+1):0;(_===m9&&t===h9||_===B9&&t===h9||_===W9&&t===W9)&&(o=Q5($,Q,Z,Y))}if(!o&&Z0>=0&&Z0-Q<=64&&!G.inAnchor&&!Y.disableAutoLink&&!Y.disableBareUrls&&(_>=d&&_<=l||_>=J0&&_<=F0||_>=r&&_<=i)&&(o=V5($,Q,Z,Y),!o&&Q>=Z0&&(Z0=$.indexOf("@",Q+1),Z0>=Z&&(Z0=-1))),_===B$){Q>n&&m.push(c9($.slice(n,Q))),m.push({type:v.breakLine}),Q++,n=Q;continue}if(o)Q>n&&m.push(c9($.slice(n,Q))),m.push(o.node),Q=o.end,n=Q;else{if(_===v0&&Q+1<Z){let w0=$.charCodeAt(Q+1);if(c$(w0)&p9){Q>n&&m.push(c9($.slice(n,Q))),m.push(c9($[Q+1])),Q+=2,n=Q;continue}}if(Q++,Z0<0||Z0-Q>64)for(;Q<Z;){var W0=$.charCodeAt(Q);if(W0<s9&&!f6[W0])Q++;else break}}}if(Z>n){let _=$.slice(n,Z);_&&m.push(c9(_))}return D0.length>0&&$5(m,D0,V,Y),$$--,m}var K5=500;function N9($,Q,Z){var V=Q.i||0;if(V>K5)return[{type:v.text,text:$}];Q.i=V+1;let Y=Q;if((Z.streaming||Z.optimizeForStreaming)&&!Q.j){var G=$.length;G>0&&$.charCodeAt(G-1)===T&&G--;for(var K=G;K>0&&$.charCodeAt(K-1)!==T;)K--;if(K>0&&$.charCodeAt(K)===b0){for(var J=!0,q=K;q<G;q++){var U=$.charCodeAt(q);if(U!==N&&U!==w&&U!==p&&U!==T0&&U!==b0){J=!1;break}}if(J){for(var W=K-1;W>0&&$.charCodeAt(W-1)!==T;)W--;$.charCodeAt(W)===b0&&($=$.slice(0,W).trimEnd())}}var X=$.trim(),H=X.lastIndexOf(`
`),z=H===-1?X:X.slice(H+1);if(z.length>0&&z.charCodeAt(0)===b0){for(var B=!1,j=!1,F=1;F<z.length;F++){var A=z.charCodeAt(F);A===b0&&(B=!0),A===p&&(j=!0)}B&&j&&($=H===-1?"":$.slice(0,$.lastIndexOf(z)).trimEnd())}for(var D=-1,M=-1,y=-1,I=$.length-1;I>=0;I--)if($.charCodeAt(I)===e){var O=I+1<$.length?$.charCodeAt(I+1):0;if(O>=d&&O<=l||O>=J0&&O<=F0){for(var S=I+2;S<$.length;){var L=$.charCodeAt(S);if(L>=d&&L<=l||L>=J0&&L<=F0||L>=r&&L<=i)S++;else break}for(var R=S;R<$.length&&$.charCodeAt(R)!==c;)R++;if(R<$.length&&$.charCodeAt(R-1)!==j0){for(var b=!1,k=R+1;k<$.length;k++)if($.charCodeAt(k)===e){b=!0;break}b||(D=I,M=S,y=R+1)}}break}if(D>=0){for(var g=0,E=0;E<D;E++)$.charCodeAt(E)===s&&g++;if(g%2===0){var h=$.slice(D+1,M);E9($,"</"+h,0)===-1&&($=$.slice(0,D)+$.slice(y))}}for(var C=$.length;C>0&&$.charCodeAt(C-1)===T;)C--;if(C>0){for(var x=C;x>0&&$.charCodeAt(x-1)!==T;)x--;for(var X0=x,V0=0;X0<C&&$.charCodeAt(X0)===N&&V0<3;)X0++,V0++;if(x>0&&X0<C&&mZ($,X0,C)){for(var P=x-1,u=P;u>0&&$.charCodeAt(u-1)!==T;)u--;l0($,u,P)||($=$.slice(0,x).trimEnd())}}var O0=$.length;if(O0>0){for(var I0=$.lastIndexOf(`
`),P0=I0===-1?0:I0+1,$0=O0,m=P0,D0=0;m<$0&&$.charCodeAt(m)===N&&D0<3;)m++,D0++;if(m<$0){var n=$.charCodeAt(m),Z0=!1;if(n===B0||n===p||n===M9){var r0=m+1;if(r0>=$0||$.charCodeAt(r0)===N||$.charCodeAt(r0)===w){for(var K0=r0;K0<$0&&($.charCodeAt(K0)===N||$.charCodeAt(K0)===w);)K0++;K0>=$0&&(Z0=!0)}}else if(n>=r&&n<=i){for(var M0=m;M0<$0&&$.charCodeAt(M0)>=r&&$.charCodeAt(M0)<=i;)M0++;if(M0<$0&&($.charCodeAt(M0)===d0||$.charCodeAt(M0)===$9)){var N0=M0+1;if(N0>=$0||$.charCodeAt(N0)===N||$.charCodeAt(N0)===w){for(var t=N0;t<$0&&($.charCodeAt(t)===N||$.charCodeAt(t)===w);)t++;t>=$0&&(Z0=!0)}}}Z0&&($=$.slice(0,P0).trimEnd())}}}if(Q.inline)return h0($,0,$.length,Q,Z);let W0=[],_=0,o=$.length;if(_===0&&!Z.disableFrontmatter&&$.startsWith("---")){let f=H6($);if(f&&f.hasValidYaml){if(Z.preserveFrontmatter!==!1){let L0=$.slice(0,f.endPos).trimEnd();W0.push({type:v.frontmatter,text:L0})}_=f.endPos}}for(;_<o;){for(var w0=$.indexOf(`
`,_),R0=w0<0?o:w0;_<o&&l0($,_,R0);)_=R0<o?R0+1:R0,_<o&&(w0=$.indexOf(`
`,_),R0=w0<0?o:w0);if(_>=o)break;$.charCodeAt(_),_0($,_,R0);let f=null;if(d6=$,c6=_,l6=R0,$.charCodeAt(_)!==n9&&Y0>=4&&!Q.inHTML)f=uZ($,_);else if($.charCodeAt(_)!==n9){let L0=_+Q0,z0=$.charCodeAt(L0);z0===J9?f=o6($,_,Q,Z):z0===c?f=pZ($,_,Q,Z):z0===s||z0===A0?f=hZ($,_,Q):z0===p||z0===B0||z0===U0?(f=T9($,_),!f&&(f=y6($,_,Q,Z))):z0===M9||z0>=r&&z0<=i?f=y6($,_,Q,Z):z0===e?f=i6($,_,Q,Z):z0===b0?f=L6($,_,Q,Z):z0===H0&&(f=oZ($,_,Q))}if(!f){for(var Q9=!1,S0=_;S0<R0;S0++)if($.charCodeAt(S0)===b0){Q9=!0;break}Q9&&(f=L6($,_,Q,Z))}if(f||(f=iZ($,_,Q,Z)),f)f.node.type!==v.refCollection&&W0.push(f.node),_=f.end;else{var q0=$.indexOf(`
`,_);_=q0<0?o:q0+1}}return Q.i=V,W0}function s6($,Q){$$=0,$.charCodeAt(0)===65279&&($=$.slice(1)),$=C$($);let Z={inline:!1,inAnchor:!1,inHTML:!1,inList:!1,inBlockQuote:!1,refs:{}},V={...Q,slugify:Q?.slugify?G=>Q.slugify(G,g0):g0,sanitizer:Q?.sanitizer||g9,tagfilter:Q?.tagfilter!==!1};Z.j=u6($,Z.refs,V);let Y=N9($,Z,V);return Z.refs&&Object.keys(Z.refs).length>0?[{type:v.refCollection,refs:Z.refs},...Y]:Y}function t6($,Q,Z,V){var Y=I9($,Q);return Y?{tagName:Y.tag,tagLower:Y.tag.toLowerCase(),attrs:Y.rawAttrs,whitespaceBeforeAttrs:Y.whitespaceBeforeAttrs,isSelfClosing:Y.selfClosing,hasSpaceBeforeSlash:Y.hasSpaceBeforeSlash,isClosing:Y.isClosing,hasNewline:Y.whitespaceBeforeAttrs.includes(`
`)||Y.rawAttrs.includes(`
`),endPos:Y.end}:null}function b$($,Q,Z){$$=0,$=C$($),!Q.refs&&(Q.refs={}),Q.j=u6($,Q.refs,Z);let V=N9($,Q,Z);return Q.refs&&Object.keys(Q.refs).length>0?[{type:v.refCollection,refs:Q.refs},...V]:V}var J5=/^\n+/,l$;try{l$=o0.createElement("div").$$typeof}catch{l$=Symbol.for("react.transitional.element")}function o$($,Q,Z){return{$$typeof:l$,type:$,key:Z!=null?""+Z:null,ref:null,props:Q,_owner:null,_store:{},_debugStack:null,_debugTask:null}}var r$=typeof o0.createContext<"u"?o0.createContext(void 0):void 0;function e6($,Q,Z,V,Y,G,K,J,q){switch($.type){case v.blockQuote:{let F={key:Z.key};return $.alert&&(F.className="markdown-alert-"+G($.alert.toLowerCase(),g0),$.children.unshift({attrs:{},children:[{type:v.text,text:$.alert}],c:!0,type:v.htmlBlock,tag:"header"})),V("blockquote",F,Q($.children,Z))}case v.breakLine:return V("br",{key:Z.key});case v.breakThematic:return V("hr",{key:Z.key});case v.frontmatter:return J.preserveFrontmatter?V("pre",{key:Z.key},$.text):null;case v.codeBlock:let j=$.lang?t9($.lang):"";return V("pre",{key:Z.key},V("code",{...c0($.attrs||{}),className:j?`language-${j} lang-${j}`:""},$.text));case v.codeInline:return V("code",{key:Z.key},$.text);case v.footnoteReference:return V("a",{key:Z.key,href:Y($.target,"a","href")||void 0},V("sup",{key:Z.key},$.text));case v.gfmTask:return V("input",{checked:$.completed,key:Z.key,readOnly:!0,type:"checkbox"});case v.heading:return V(`h${$.level}`,{id:$.id,key:Z.key},Q($.children,Z));case v.htmlBlock:{let F=$;if(J.tagfilter&&m$(F.tag)){var U="";if(F.attrs)for(var W in F.attrs){var X=F.attrs[W];X===!0?U+=" "+W:X!=null&&X!==!1&&(U+=" "+W+'="'+String(X)+'"')}return V("span",{key:Z.key},"<"+F.tag+U+">")}if(F.a&&F.c){let b=function(P){if((P.type===v.htmlSelfClosing||P.type===v.htmlBlock)&&P.b)return[];if(P.type===v.paragraph){let u=P.children;return u?u.flatMap(b):[]}return P.type===v.text?P.text?.trim()?[P]:[]:P.type===v.htmlBlock&&P.children?[{...P,children:P.children?.flatMap(b)}]:[P]},g=function(P){for(var u=0;u<P.length;u++)P[u].type===v.htmlBlock&&(P[u].c=!1),"children"in P[u]&&P[u].children&&g(P[u].children)},V0=function(P,u){for(var O0=0;O0<P.length;O0++){var I0=P[O0];if(I0.type===v.paragraph&&I0.children)for(var P0=I0.children,$0=0;$0<P0.length;$0++){var m=P0[$0];if(m.type===v.htmlSelfClosing&&m.b&&m.tag.toLowerCase()===u){var D0=P.slice(0,O0);$0>0&&D0.push({type:v.paragraph,children:P0.slice(0,$0)});var n=[];if($0+1<P0.length){var Z0=P0.slice($0+1);Z0=Z0.filter(function(r0){return!(r0.type===v.htmlSelfClosing&&r0.b)}),Z0.length>0&&(n=Z0)}return n=n.concat(P.slice(O0+1)),{found:!0,beforeClose:D0,afterClose:n}}}if((I0.type===v.htmlSelfClosing||I0.type===v.htmlBlock)&&I0.b&&I0.tag.toLowerCase()===u)return{found:!0,beforeClose:P.slice(0,O0),afterClose:P.slice(O0+1)}}return{found:!1,beforeClose:P,afterClose:[]}},A=F.tag.toLowerCase(),D=C6(A),M=F.children&&F.children.length>0,y=/<[a-z][^>]{0,100}>/i.test(F.a);if(D){let P=F.a.replace(new RegExp("\\s*</"+A+">\\s*$","i"),"");return J.tagfilter&&(P=h$(P)),y?q($.tag,{key:Z.key,...c0($.attrs||{}),dangerouslySetInnerHTML:{__html:P}}):q($.tag,{key:Z.key,...c0($.attrs||{})},P)}let I=new RegExp(`^<${F.tag}(\\s|>)`,"i").test(F.a);if(M&&!I&&J.tagfilter&&_6(F.a))return q($.tag,{key:Z.key,...c0($.attrs||{})},Q(F.children,Z));if(m6(F.a)){let P=J.tagfilter?h$(F.a):F.a;return q($.tag,{key:Z.key,...c0($.attrs||{}),dangerouslySetInnerHTML:{__html:P}})}let S={slugify:P=>G(P,g0),sanitizer:Y,tagfilter:!0},L=F.a.replace(/>\s+</g,"><").replace(/\n+/g," ").trim();if(new RegExp(`^<${F.tag}(\\s[^>]*)?>(\\s*</${F.tag}>)?$`,"i").test(L))return F.children&&F.children.length>0?q($.tag,{key:Z.key,...c0($.attrs||{})},Q(F.children,Z)):q($.tag,{key:Z.key,...c0($.attrs||{})});let k=b$(L,{inline:!1,refs:K,inHTML:!1},S);g(k);let E=F.tag.toLowerCase(),h="</"+E+">",C=new RegExp(`^<${F.tag}(\\s|>)`,"i").test(L),x=L.toLowerCase().trimEnd().endsWith(h),X0=C&&x;if(X0&&M)return q($.tag,{key:Z.key,...c0($.attrs||{})},Q(F.children,Z));if(X0)return Q(k.flatMap(b),Z);var H=V0(k,E);if(H.found&&H.afterClose.length>0){var z=H.beforeClose.flatMap(b),B=H.afterClose.flatMap(b);return o$(o0.Fragment,{children:[q($.tag,{key:Z.key,...c0($.attrs||{})},Q(z,Z)),Q(B,Z)]},null)}return q($.tag,{key:Z.key,...c0($.attrs||{})},Q(k.flatMap(b),Z))}return d9($.tag)?q($.tag,{key:Z.key,...c0($.attrs||{})}):q($.tag,{key:Z.key,...c0($.attrs||{})},$.children?Q($.children,Z):"")}case v.htmlSelfClosing:{let F=$;if(J.tagfilter&&m$(F.tag)){var U="";if(F.attrs)for(var W in F.attrs){var X=F.attrs[W];X===!0?U+=" "+W:X!=null&&X!==!1&&(U+=" "+W+'="'+String(X)+'"')}return V("span",{key:Z.key},"<"+F.tag+U+" />")}return q($.tag,{key:Z.key,...c0($.attrs||{})})}case v.image:{let F=$.target!=null?Y($.target,"img","src"):null;return V("img",{key:Z.key,alt:$.alt&&$.alt.length>0?$.alt:void 0,title:$.title||void 0,src:F||void 0})}case v.link:{let F={key:Z.key};return $.target!=null&&(F.href=M6($.target)),$.title&&(F.title=$.title),V("a",F,Q($.children,Z))}case v.table:{let F=$;return V("table",{key:Z.key},V("thead",{key:"thead"},V("tr",null,F.header.map(function(D,M){return V("th",{key:M,style:F.align[M]==null?{}:{textAlign:F.align[M]}},Q(D,Z))}))),F.cells.length>0&&V("tbody",{key:"tbody"},F.cells.map(function(D,M){return V("tr",{key:M},D.map(function(I,O){return V("td",{key:O,style:F.align[O]==null?{}:{textAlign:F.align[O]}},Q(I,Z))}))})))}case v.text:return $.text;case v.textFormatted:return V($.tag,{key:Z.key},Q($.children,Z));case v.orderedList:case v.unorderedList:{let F=$.type===v.orderedList?"ol":"ul";return V(F,{key:Z.key,start:$.type===v.orderedList?$.start:void 0},$.items.map(function(D,M){return V("li",{key:M},Q(D,Z))}))}case v.paragraph:return V("p",{key:Z.key},Q($.children,Z));case v.ref:return null;default:return null}}var U5=($,Q,Z,V,Y,G,K)=>{var J=U=>U.map(function(W){return"text"in W?W.text:""}),q=(U,W={})=>{var X=(W.renderDepth||0)+1;if(X>2500)return J(U);W.renderDepth=X;for(var H=W.key,z=[],B=!1,j=0;j<U.length;j++){W.key=j;var F;if($){var A=e6.bind(null,U[j],q,W,Q,Z,V,Y,G,K);F=$(A,U[j],q,W)}else F=e6(U[j],q,W,Q,Z,V,Y,G,K);var D=typeof F=="string";if(D&&B)z[z.length-1]+=F;else if(F!==null)if(Array.isArray(F))for(var M=0;M<F.length;M++)z.push(F[M]);else z.push(F);B=D}return W.key=H,W.renderDepth=X-1,z};return q},F5=($,Q)=>{let Z=e9(Q,$,void 0);return Z?typeof Z=="function"||typeof Z=="object"&&"render"in Z?Z:e9(Q,`${$}.component`,$):$};function X5($,Q){let Z={...Q||{}};Z.overrides=Z.overrides||{};let V=Z.slugify||g0,Y=Z.sanitizer||g9,G=Z.createElement,K=Z.overrides&&Object.keys(Z.overrides).length>0,J=M=>F$(M,{...Z,wrapper:null});function q(M){for(var y in M){var I=M[y];if(typeof I=="string"&&I.length>0&&I.charCodeAt(0)===e&&(E6.test(I)||T6.test(I)||t6(I,0))){var O=J(I.trim());M[y]=y==="innerHTML"&&Array.isArray(O)?O[0]:O}}}function U(M,y,...I){var O=y||{},S=M;if(K){var L=e9(Z.overrides,M+".props",{});S=F5(M,Z.overrides),O={...O,...L,className:A6(O.className,L.className)||void 0}}if(!G){var R=O.key;return R!=null&&delete O.key,I.length===1?O.children=I[0]:I.length>1&&(O.children=I),o$(S,O,R)}return G(S,O,...I)}function W(M,y,...I){return y&&q(y),U(M,y,...I)}let X={...Z,slugify:Z.slugify?M=>Z.slugify(M,g0):g0,sanitizer:Y,tagfilter:Z.tagfilter!==!1},H=$[0]&&$[0].type===v.refCollection?$[0].refs:{},z=U5(Z.renderRule,U,Y,V,H,Z,W),B=z($,{inline:Z.forceInline,refs:H}),j=[];for(let M in H)M.charCodeAt(0)===a0&&j.push({identifier:M,footnote:H[M].target});if(j.length&&B.push(U("footer",{key:"footer"},j.map(function(y){let I=y.identifier.charCodeAt(0)===a0?y.identifier.slice(1):y.identifier,O=b$(y.footnote,{inline:!0,refs:H},X);return U("div",{id:V(I,g0),key:y.identifier},I+": ",z(O,{inline:!0,refs:H}))}))),Z.wrapper===null)return B;let F=Z.wrapper||(Z.forceInline?"span":"div"),A;if(B.length>1||Z.forceWrapper)A=B;else return B.length===1?B[0]:null;var D=Z.wrapperProps?{...Z.wrapperProps}:{};return D.children=A,o$(F,D,"outer")}function F$($="",Q={}){let Z={...Q||{}};Z.overrides=Z.overrides||{};let V=Z.slugify||g0,Y=Z.sanitizer||g9;function G(q){let U=Z.forceInline||!Z.forceBlock&&!O6.test(q),W={...Z,slugify:Z.slugify?B=>Z.slugify(B,g0):g0,sanitizer:Y,tagfilter:Z.tagfilter!==!1},X=q;if(!U){let B=X.length;for(;B>0&&(X[B-1]===`
`||X[B-1]==="\r");)B--;X=X.slice(0,B),X=`${X.replace(J5,"")}

`}if(Z.optimizeForStreaming){var H=X.lastIndexOf("<");H!==-1&&X.indexOf(">",H)===-1&&(X=X.slice(0,H)),H=q.lastIndexOf("<"),H!==-1&&q.indexOf(">",H)===-1&&(q=q.slice(0,H))}let z=b$(U?q:X,{inline:U,refs:K},W);return X5(z,{...W,forceInline:U})}let K={};return G($)}var R5=({options:$,children:Q})=>r$?o0.createElement(r$.Provider,{value:$},Q):Q,i$=({children:$,options:Q,...Z})=>{if(!(typeof o0.useContext<"u")){let q={...Q,overrides:{...Q?.overrides},wrapperProps:{...Q?.wrapperProps,...Z}};return F$($??"",q)}let Y=o0.useContext(r$),G=o0.useMemo(()=>({...Y,...Q,overrides:{...Y?.overrides,...Q?.overrides},wrapperProps:{...Y?.wrapperProps,...Q?.wrapperProps,...Z}}),[Y,Q,Z]),K=$??"";return o0.useMemo(()=>F$(K,G),[K,G])},$Z=i$,x5=i$,E5=F$,h5=$Z;export{g0 as slugify,g9 as sanitizer,s6 as parser,h5 as default,E5 as compiler,v as RuleType,x5 as Markdown};
