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

`)!==-1,n$=b6.test(y9),R$=R6.test(y9),YZ=a$||n$||Z.inHTML&&R$,GZ=n0.length>=2&&n0.charCodeAt(0)===L&&n0.charCodeAt(n0.length-1)===L&&!a$;GZ&&!n$&&!R$?i9=[{type:_.text,text:y9}]:YZ||R$?(Z.inline=!1,i9=P9(n0,Z,Q)):(Z.inline=!0,i9=C0(y9,0,y9.length,Z,Q))}Z.inline=ZZ,Z.inHTML=JZ,Z.c=QZ}}var s$=!1;if(q===6&&B0!==-1&&!Z.inHTML&&!H9){var w$=n0,KZ=/<[a-zA-Z][^>]*>/.test(w$),VZ=/\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$);KZ&&!VZ&&(s$=!0)}var qZ=!$9&&(Z.inHTML||q===7||H9||!Z9||s$);if(qZ){var o0,t$=!1;if(B0!==-1&&Q9){var e$=!1;if(Z.inHTML&&J0<h.length){for(var F$=J0;F$<h.length&&h.charCodeAt(F$)!==L;)F$++;var y$=h.slice(J0,F$).trim();e$=y$.length>1&&y$.charCodeAt(0)===$0&&y$.charCodeAt(1)!==D0}o0=e$?h.slice(m.end-Y):n0,t$=!0}else(q===7||Z.inHTML)&&B0!==-1?(o0=h.slice(m.end-Y),o0.charCodeAt(0)===L&&(o0=o0.slice(1))):Q9?o0=$.slice(Y,a0):H9?o0=j0:(o0=h.slice(m.end-Y),o0.charCodeAt(0)===L&&(o0=o0.slice(1)));var $6={type:_.htmlBlock,tag:s,attrs:_9(m.attrs,s,Q),f:m.whitespaceBeforeAttrs+m.rawAttrs,children:i9,a:o0,text:o0,d:!0,b:!1,endPos:a0,e:q===6};return t$&&($6.l=!0),{node:$6,end:R0}}return{node:{type:_.htmlBlock,tag:s,attrs:_9(m.attrs,s,Q),f:m.whitespaceBeforeAttrs+m.rawAttrs,children:i9,a:$9?"":n0,text:n0,d:!1,b:!1,endPos:a0,e:q===6},end:R0}}var W$=j0.match(/^<(\/?)([a-zA-Z][a-zA-Z0-9-]*)/),UZ=W$?W$[2]:"div",Z6=W$?W$[1]==="/":!1,k$=j0;if(Z6){var J6=j0.indexOf(">");J6!==-1&&(k$=j0.slice(J6+1))}return{node:{type:_.htmlBlock,tag:UZ,attrs:{},children:[],a:k$,text:k$,d:!0,b:Z6,endPos:k,e:q===6},end:X0}}var S0=I9($,Y);if(!S0)return null;var k9=S0.tag,L$=k9.toLowerCase(),Q6=k9.charCodeAt(0),z$=Q6>=p&&Q6<=l;if(!z$&&!_$.has(L$)&&!U$.has(L$)&&!L$.includes("-"))return null;if(S0.isClosing)return{node:{type:_.htmlSelfClosing,tag:k9,attrs:{},a:$.slice(Y,S0.end),b:!0,endPos:S0.end},end:S0.end};var IJ=!0,h9=c$($,S0.end,k9),Q$=[];if(h9!==-1){var FZ=I$,O$=$.slice(S0.end,FZ),X$=O$.trim();if(X$){var WZ=O$.indexOf(`

`)!==-1,zZ=b6.test(X$),OZ=R6.test(X$),HZ=Z.inline,DZ=Z.inHTML,jZ=Z.c;Z.inHTML=!0,Z.c=(Z.c||0)+1,WZ||zZ||OZ?(Z.inline=!1,Q$=P9(O$,Z,Q)):(Z.inline=!0,Q$=C0(X$,0,X$.length,Z,Q)),Z.inline=HZ,Z.inHTML=DZ,Z.c=jZ}var BZ=Q0($,h9),MZ=$.slice(h9,BZ).trim(),S$=MZ?h9:a($,h9),X6=z$?$.slice(Y,h9):$.slice(Y,S$),AZ=z$?h9:S$;return{node:{type:_.htmlBlock,tag:k9,attrs:_9(S0.attrs,k9,Q),f:S0.whitespaceBeforeAttrs+S0.rawAttrs,children:Q$,a:X6,text:z$?O$:X6,d:!0,b:!1,endPos:AZ,e:!1},end:S$}}var a9=k6($,S0.end),vZ=a9<$.length?a($,a9):a9,E$=$.slice(S0.end,a9);if(E$.trim()){var{inline:_Z,inHTML:IZ,c:PZ}=Z;Z.inline=!1,Z.inHTML=!0,Z.c=(Z.c||0)+1,Q$=P9(E$,Z,Q),Z.inline=_Z,Z.inHTML=IZ,Z.c=PZ}var NZ=$.slice(S0.end,a9);return{node:{type:_.htmlBlock,tag:k9,attrs:_9(S0.attrs,k9,Q),f:S0.whitespaceBeforeAttrs+S0.rawAttrs,children:Q$,a:NZ,text:E$,d:!0,b:!1,endPos:a9,e:!1},end:vZ}}function tZ($,J){if($.charCodeAt(J)!==$0)return 0;var Z=J+1,Q=$.length;if($.charCodeAt(Z)===E0&&$.charCodeAt(Z+1)===u&&$.charCodeAt(Z+2)===u)return 2;if($.charCodeAt(Z)===n9)return 3;if($.charCodeAt(Z)===E0){var X=$.charCodeAt(Z+1);if(X>=p&&X<=l)return 4;if($.slice(Z+1,Z+8)==="[CDATA[")return 5}for(var Y=$.charCodeAt(Z)===D0,K=Y?Z+1:Z,V=K;V<Q;){var q=$.charCodeAt(V);if(q>=p&&q<=l||q>=K0&&q<=U0||q>=r&&q<=i||q===u)V++;else break}if(V===K)return 0;var G=$.slice(K,V);if(U$.has(G.toLowerCase())){if(Y)return 0;var U=$.charCodeAt(V);return U===I||U===N||U===c||U===L||V>=Q?1:0}if(_$.has(G.toLowerCase())){if(Y){for(var F=V;F<Q&&($.charCodeAt(F)===I||$.charCodeAt(F)===N);)F++;return F<Q&&$.charCodeAt(F)===c?6:0}var O=V<Q?$.charCodeAt(V):-1;return O===I||O===N||O===c||O===L||O===D0||O===-1?6:0}if(Y){for(var W=V;W<Q&&($.charCodeAt(W)===I||$.charCodeAt(W)===N);)W++;if(W<Q&&$.charCodeAt(W)===c){var D=Q0($,J),B=$.slice(W+1,D).trim();if(B==="")return 7}}else{var z=Q0($,J),j=I9($,J);if(j&&j.end<=z){var H=$.slice(j.end,z).trim();if(H==="")return 7}}return 0}function S6($,J,Z){for(var Q=0,X=$.length;Q<X&&($.charCodeAt(Q)===I||$.charCodeAt(Q)===N);)Q++;for(;X>Q&&($.charCodeAt(X-1)===I||$.charCodeAt(X-1)===N);)X--;Q<X&&$.charCodeAt(Q)===P0&&Q++,X>Q&&$.charCodeAt(X-1)===P0&&(X-2<Q||$.charCodeAt(X-2)!==_0)&&X--;for(var Y=[],K=Q,V=!1,q=[],G=Q;G<X;){var U=$.charCodeAt(G);if(U===_0&&G+1<X){$.charCodeAt(G+1)===P0?(V||(V=!0,q=[]),q.push($.slice(K,G)),q.push("|"),G+=2,K=G):G+=2;continue}if(U===n){for(var F=0;G<X&&$.charCodeAt(G)===n;)F++,G++;for(var O=!1;G<X&&!O;){for(var z=0;G<X&&$.charCodeAt(G)===n;)z++,G++;z===F?O=!0:z===0&&G++}continue}if(U===P0){var j=V?(q.push($.slice(K,G)),q.join("")):$.slice(K,G);Y.push(j.trim()),G++,K=G,V=!1,q=[];continue}G++}var H=V?(q.push($.slice(K,X)),q.join("")):$.slice(K,X);return Y.push(H.trim()),Y.map(function(W){var D=W.indexOf("\\|")!==-1?W.replace(/\\\|/g,"|"):W;return C0(D,0,D.length,J,Z)})}function E6($,J,Z,Q){let X=Q0($,J);var Y=$.indexOf("|",J);if(Y<0||Y>=X)return null;let K=a($,X);if(K>=$.length)return null;let V=Q0($,K);if(!C6($,K,V))return null;let q=$.slice(J,X),G=$.slice(K,V);for(var U=[],F=0,O=G.length;F<O&&(G.charCodeAt(F)===I||G.charCodeAt(F)===N);)F++;for(F<O&&G.charCodeAt(F)===P0&&F++;F<O;){for(;F<O&&(G.charCodeAt(F)===I||G.charCodeAt(F)===N);)F++;if(F>=O||G.charCodeAt(F)===P0)break;var z=G.charCodeAt(F)===x0;for(z&&F++;F<O&&G.charCodeAt(F)===u;)F++;var j=F<O&&G.charCodeAt(F)===x0;for(j&&F++,U.push(z&&j?"center":j?"right":z?"left":null);F<O&&(G.charCodeAt(F)===I||G.charCodeAt(F)===N);)F++;F<O&&G.charCodeAt(F)===P0&&F++}let H=S6(q,Z,Q);if(U.length!==H.length)return null;let W=[],D=a($,V);for(;D<$.length;){let E=Q0($,D),S=$.slice(D,E);if(c0($,D,E))break;if(v0($,D,E),Z0<4){var B=$.charCodeAt(D+e);if(B===c||B===G9||(B===u||B===H0||B===q0)&&f9($,D))break;if(B===n||B===A0){for(var v=D+e,T=0;v<E&&$.charCodeAt(v)===B;)T++,v++;if(T>=3)break}}W.push(S6(S,Z,Q)),D=a($,E)}if((Q.streaming||Q.optimizeForStreaming)&&W.length===0)return null;for(var P=H.length,M=0;M<W.length;M++)if(W[M].length<P)for(;W[M].length<P;)W[M].push([]);else W[M].length>P&&(W[M].length=P);return{node:{type:_.table,header:H,cells:W,align:U},end:D}}function eZ($,J,Z){var Q=Q0($,J);if(v0($,J,Q),Z0>3)return null;var X=J+e;if($.charCodeAt(X)!==z0)return null;if(X+1<$.length&&$.charCodeAt(X+1)===r0){var Y=$J($,X,Z);return Y||null}Z.refs||(Z.refs={});var K=m6($,X,Z.refs);return K===null?null:{node:{type:_.refCollection},end:K}}function $J($,J,Z){var Q=$.length;if($.charCodeAt(J)!==z0||J+1>=Q||$.charCodeAt(J+1)!==r0)return null;for(var X=J+2,Y=X;X<Q&&$.charCodeAt(X)!==u0;){if($.charCodeAt(X)===L)return null;X++}if(X>=Q)return null;var K=("^"+$.slice(Y,X)).toLowerCase();if(X++,X>=Q||$.charCodeAt(X)!==x0)return null;for(X++;X<Q&&($.charCodeAt(X)===I||$.charCodeAt(X)===N);)X++;if(X<Q&&$.charCodeAt(X)===L)for(X++;X<Q&&($.charCodeAt(X)===I||$.charCodeAt(X)===N);)X++;var V=$.indexOf(`
`,X);V<0&&(V=Q);for(var q=$.slice(X,V).trim(),G=V<Q?V+1:Q;G<Q;){var U=Q0($,G);if(v0($,G,U),Z0>=2&&!c0($,G,U))q+=`
`+$.slice(G,U),G=a($,U);else if(c0($,G,U)){var F=a($,U);if(F<Q){var O=Q0($,F);if(v0($,F,O),Z0>=2){q+=`
`,G=a($,U);continue}}break}else break}return Z.refs[K]||(Z.refs[K]={target:q,title:void 0}),{node:{type:_.footnote},end:G}}function ZJ($,J,Z,Q){let X=J,Y=0,K=0,V=-1;for(;X<$.length;){let w=V>=0?V:Q0($,X);if(V=-1,c0($,X,w))break;if(v0($,X,w),Z0<4&&K>0&&!Z.g){let g=$.charCodeAt(X+e);if(g===T0||g===u){let C=X+e;for(;C<w&&$.charCodeAt(C)===g;)C++;for(;C<w&&($.charCodeAt(C)===I||$.charCodeAt(C)===N);)C++;if(C>=w){Y=g===T0?1:2,X=a($,w);break}}}K=w;let y=a($,w);if(y<$.length){if($.charCodeAt(y)===s9){var q=Q0($,y);X=a($,q),K=q;continue}let g=Q0($,y);if(V=g,v0($,y,g),Z0<4){let C=$.charCodeAt(y+e);if(C===c){X=y;break}if(C===G9&&c6($,y,Z,Q)){X=y;break}if(C===n||C===A0){for(var G=y+e,U=0;G<g&&$.charCodeAt(G)===C;)U++,G++;if(U>=3){X=y;break}}if(C===$0){var F=y+e+1,O=F<g?$.charCodeAt(F):0,z=O===E0||O===n9;if(!z&&O===D0){for(var j=F+1,H=j;H<g&&($.charCodeAt(H)>=p&&$.charCodeAt(H)<=l||$.charCodeAt(H)>=K0&&$.charCodeAt(H)<=U0||$.charCodeAt(H)>=r&&$.charCodeAt(H)<=i||$.charCodeAt(H)===u);)H++;H>j&&(z=_$.has($.slice(j,H).toLowerCase()))}else if(!z){for(var W=F;W<g&&($.charCodeAt(W)>=p&&$.charCodeAt(W)<=l||$.charCodeAt(W)>=K0&&$.charCodeAt(W)<=U0||$.charCodeAt(W)>=r&&$.charCodeAt(W)<=i||$.charCodeAt(W)===u);)W++;if(W>F){var D=$.slice(F,W).toLowerCase();z=_$.has(D)||U$.has(D)}}if(z&&o6($,y,Z,Q)){X=y;break}}if(C===u||C===H0||C===M9){let f=y+e+1;if(f<g&&($.charCodeAt(f)===I||$.charCodeAt(f)===N)){var B=q$($,f,g);if(B<g&&!f9($,y)){X=y;break}}}if(C>=r&&C<=i){let f=y+e;for(;f<g&&$.charCodeAt(f)>=r&&$.charCodeAt(f)<=i;)f++;if(f<g&&($.charCodeAt(f)===p0||$.charCodeAt(f)===t0)&&f-(y+e)===1&&$.charCodeAt(y+e)===49){var v=f+1;if(v<g&&($.charCodeAt(v)===I||$.charCodeAt(v)===N)){var T=q$($,v,g);if(T<g){X=y;break}}}}if(C===P0){let f=a($,g);if(f<$.length){let k=Q0($,f);if(C6($,f,k)){X=y;break}}}if((C===u||C===H0||C===q0)&&f9($,y)){if(C!==u){X=y;break}let f=0,k=y+e;for(;k<g&&$.charCodeAt(k)===u;)f++,k++;for(;k<g&&($.charCodeAt(k)===I||$.charCodeAt(k)===N);)k++;if(k<g){X=y;break}}}}X=a($,w)}for(var P=Y?K:X;P>J&&($.charCodeAt(P-1)===L||$.charCodeAt(P-1)===D9||$.charCodeAt(P-1)===I||$.charCodeAt(P-1)===N);)P--;for(var M=J;M<P&&($.charCodeAt(M)===I||$.charCodeAt(M)===N);)M++;if(M>=P)return null;for(var E=!1,S=M;S<P;S++)if($.charCodeAt(S)===s9){E=!0;break}var R=E?$.slice(M,P).replace(/\u001E/g,""):$.slice(M,P);if(!R)return null;let b=JJ(R,0,R.length,Z,Q);if(Y){let y=(Q?.slugify||d0)(R);return{node:{type:_.heading,level:Y,children:b,id:y},end:X}}return{node:{type:_.paragraph,children:b},end:X}}function JJ($,J,Z,Q,X){var Y=$.indexOf(`
`,J);if(Y<0||Y>=Z)return C0($,J,Z,Q,X);for(var K="",V=J,q=J;q<Z;){var G=$.charCodeAt(q);if(G===n){var U=N$($,q,Z);if(U>q){for(var F=!1,O=q;O<U;O++)if($.charCodeAt(O)===L){F=!0;break}F&&(K+=$.slice(V,q),K+=$.slice(q,U).replace(/\n/g," "),V=U),q=U;continue}}if(G===$0){var z=r6($,q,Z);if(z>q){q=z;continue}}if(G===L){var j=!1,H=0;if(q>J&&$.charCodeAt(q-1)===_0)j=!0,H=1;else{for(var W=0,D=q-1;D>=J&&$.charCodeAt(D)===I;)W++,D--;W>=2&&(j=!0,H=W)}if(j)K+=$.slice(V,q-H),K+="";else{for(var B=q;B>V&&$.charCodeAt(B-1)===I;)B--;K+=$.slice(V,B)+`
`}for(q++;q<Z&&$.charCodeAt(q)===I;)q++;V=q;continue}q++}return V<Z&&(K+=$.slice(V,Z)),C0(K,0,K.length,Q,X)}function QJ($,J,Z){if($.charCodeAt(J)!==n)return null;let Q=N9($,J,Z,96),X=J+Q;for(;X<Z;){let Y=$.indexOf("`",X);if(Y<0||Y>=Z)return null;let K=N9($,Y,Z,96);if(K===Q){let V=$.slice(J+Q,Y);return V=V.replace(/\n/g," "),V.length>0&&V[0]===" "&&V[V.length-1]===" "&&V.trim().length>0&&(V=V.slice(1,-1)),{node:{type:_.codeInline,text:V},end:Y+K}}X=Y+K}return null}function N$($,J,Z){if($.charCodeAt(J)!==n)return J;let Q=N9($,J,Z,96),X=J+Q;for(;X<Z;){let Y=$.indexOf("`",X);if(Y<0||Y>=Z)return J;let K=N9($,Y,Z,96);if(K===Q)return Y+K;X=Y+K}return J}function r6($,J,Z){if($.charCodeAt(J)!==$0)return J;if(J+1<Z&&$.charCodeAt(J+1)===D0){let G=J+2;for(;G<Z&&$.charCodeAt(G)!==c;)G++;return G<Z?G+1:J}if(J+3<Z&&$.charCodeAt(J+1)===E0&&$.charCodeAt(J+2)===u&&$.charCodeAt(J+3)===u){let G=$.indexOf("-->",J+4);return G>=0?G+3:J}let Q=J+1,X=Q;for(;Q<Z;){let G=$.charCodeAt(Q);if(G>=p&&G<=l||G>=K0&&G<=U0||G>=r&&G<=i||G===u)Q++;else break}if(Q===X)return J;let Y=$.slice(X,Q).toLowerCase(),K=!1;for(;Q<Z;){let G=$.charCodeAt(Q);if(G===c){Q++;break}if(G===D0&&Q+1<Z&&$.charCodeAt(Q+1)===c){Q+=2,K=!0;break}if(G===B9||G===L9){var V=G;for(Q++;Q<Z&&$.charCodeAt(Q)!==V;)Q++;Q<Z&&Q++;continue}if(G===L)return J;Q++}if(K||c9(Y))return Q;let q=1;for(;Q<Z&&q>0;)if($.charCodeAt(Q)===$0)if(Q+1<Z&&$.charCodeAt(Q+1)===D0){let G=Q+2,U=G;for(;U<Z&&($.charCodeAt(U)>=p&&$.charCodeAt(U)<=l||$.charCodeAt(U)>=K0&&$.charCodeAt(U)<=U0);)U++;if($.slice(G,U).toLowerCase()===Y){for(;U<Z&&$.charCodeAt(U)!==c;)U++;if(U<Z&&U++,q--,q===0)return U}Q=U}else{let G=Q+1,U=G;for(;U<Z&&($.charCodeAt(U)>=p&&$.charCodeAt(U)<=l||$.charCodeAt(U)>=K0&&$.charCodeAt(U)<=U0);)U++;$.slice(G,U).toLowerCase()===Y&&q++,Q++}else Q++;return Q}function XJ($,J,Z,Q,X){if($.charCodeAt(J)!==A0||J+1>=Z||$.charCodeAt(J+1)!==A0)return null;let Y=J+2;for(;Y+1<Z;){let K=$.charCodeAt(Y);if(K===n){let V=N$($,Y,Z);if(V>Y){Y=V;continue}}if(K===A0&&$.charCodeAt(Y+1)===A0){let V=$.slice(J+2,Y),q=C0(V,0,V.length,Q,X);return{node:{type:_.textFormatted,tag:"del",children:q},end:Y+2}}K===_0&&Y+1<Z&&Y++,Y++}return null}function YJ($,J,Z,Q,X){if($.charCodeAt(J)!==T0||J+1>=Z||$.charCodeAt(J+1)!==T0)return null;let Y=J+2;for(;Y+1<Z;){let K=$.charCodeAt(Y);if(K===n){let V=N$($,Y,Z);if(V>Y){Y=V;continue}}if(K===T0&&$.charCodeAt(Y+1)===T0&&Y>J+2){let V=$.slice(J+2,Y),q=C0(V,0,V.length,Q,X);return{node:{type:_.textFormatted,tag:"mark",children:q},end:Y+2}}K===_0&&Y+1<Z&&Y++,Y++}return null}function x6($,J,Z){return $<t9?!!(r$($)&d9):v6.test(J[Z])}function g6($,J,Z){return $<t9?!!(r$($)&A9):_6.test(J[Z])}function GJ($,J,Z){var Q=$.charCodeAt(J);if(Q!==H0&&Q!==q0)return null;var X=N9($,J,Z,Q);if(X===0)return null;var Y=J>0?$.charCodeAt(J-1):32,K=J+X<Z?$.charCodeAt(J+X):32,V=g6(Y,$,J-1),q=g6(K,$,J+X),G=J>0?x6(Y,$,J-1):!1,U=J+X<Z?x6(K,$,J+X):!1,F=!q&&(!U||V||G),O=!V&&(!G||q||U),z,j;return Q===H0?(z=F,j=O):(z=F&&(!O||G),j=O&&(!F||U)),{len:X,canOpen:z,canClose:j}}function KJ($,J,Z,Q){if(J.length!==0){for(var X=[],Y=0;Y<12;Y++)X[Y]=-1;for(var K=0;K<J.length;){var V=J[K];if(!V.active||!V.canClose){K++;continue}for(var q=V.ch===H0?0:1,G=q*6+V.len%3*2+(V.canOpen?1:0),U=X[G]!==void 0?X[G]:-1,F=-1,O=K-1;O>U;O--){var z=J[O];if(!(!z.active||z.ch!==V.ch||!z.canOpen)&&!((V.canOpen||z.canClose)&&(z.len+V.len)%3===0&&z.len%3!==0)){F=O;break}}if(F<0){X[G]=K-1,!V.canOpen&&(V.active=!1),K++;continue}var j=J[F],H=j.len>=2&&V.len>=2,W=H?2:1;j.len-=W,V.len-=W;var D=$[j.idx],B=$[V.idx];D.text=D.text.slice(0,D.text.length-W),B.text=B.text.slice(W);var v=j.idx+1,T=V.idx,P=$.slice(v,T),M={type:_.textFormatted,tag:H?"strong":"em",children:P};$.splice(v,T-v,M);for(var E=T-v-1,S=0;S<J.length;S++)J[S].idx>j.idx&&(J[S].idx-=E);for(var R=F+1;R<K;R++)J[R].active=!1;if(j.len===0&&(j.active=!1,D.text==="")){$.splice(j.idx,1);for(var b=0;b<J.length;b++)J[b].idx>j.idx?J[b].idx--:J[b].idx===j.idx&&(J[b].idx=-1)}if(V.len===0){V.active=!1;var w=V.idx;if(B.text===""){$.splice(w,1);for(var y=0;y<J.length;y++)J[y].idx>w?J[y].idx--:J[y].idx===w&&(J[y].idx=-1)}}else continue;K++}for(var g=0,C=0;C<$.length;C++){var f=$[C];if(f.type===_.text){var k=f;if(k.text==="")continue;if(g>0&&$[g-1].type===_.text){$[g-1].text+=k.text;continue}}$[g++]=f}$.length=g}}function T6($,J,Z,Q,X){let Y=$.charCodeAt(J)===E0,K=Y?J+1:J;if($.charCodeAt(K)!==z0)return null;var V=$.indexOf("]",K+1);if(V<0||V>=Z)return null;for(var q=K+1,G=-1,U=1;q<Z&&U>0;){var F=$.charCodeAt(q);if(F===_0&&q+1<Z){q+=2;continue}if(F===n){var O=N$($,q,Z);if(O>q){q=O;continue}}if(F===$0){var z=i6($,q,Z);if(z){q=z.end;continue}var j=r6($,q,Z);if(j>q){q=j;continue}}F===z0?U++:F===u0&&U--,q++}if(U!==0)return null;var H=q-1,W=$.slice(K+1,H),D=q<Z?$.charCodeAt(q):0,B=!1;if(D===s0){var v=!0;for(q++;q<Z&&($.charCodeAt(q)===I||$.charCodeAt(q)===L);)q++;var T="",P=q;if(q<Z&&$.charCodeAt(q)===$0){for(q++,P=q;P<Z&&$.charCodeAt(P)!==c;){if($.charCodeAt(P)===_0&&P+1<Z){P+=2;continue}if($.charCodeAt(P)===L){v=!1;break}P++}v&&(P>=Z||$.charCodeAt(P)!==c)&&(v=!1),v&&(T=$.slice(q,P),P++)}else if(v){for(var M=0;P<Z;){var E=$.charCodeAt(P);if(E===_0&&P+1<Z){P+=2;continue}if(E===s0)M++;else if(E===t0){if(M===0)break;M--}else if(E===I||E===L)break;P++}T=$.slice(q,P)}if(v){for(q=P;q<Z&&($.charCodeAt(q)===I||$.charCodeAt(q)===L);)q++;var S;if(q<Z){var R=$.charCodeAt(q);if(R===B9||R===L9||R===s0){var b=R===s0?41:R;q++;for(var w=q;q<Z&&$.charCodeAt(q)!==b;)$.charCodeAt(q)===_0&&q+1<Z&&q++,q++;q>=Z?v=!1:(S=$.slice(w,q),q++)}}if(v){for(;q<Z&&($.charCodeAt(q)===I||$.charCodeAt(q)===L);)q++;(q>=Z||$.charCodeAt(q)!==t0)&&(v=!1)}}if(v){q++,T=Z$(T),S!==void 0&&(S=M$(Z$(S)));var y=X?.sanitizer||x9,g=y(T,Y?"img":"a",Y?"src":"href"),C=g===null?null:T;if(Y){var f=C0(W,0,W.length,Q,X),k=P$(f);return{node:{type:_.image,target:C,alt:k,title:S},end:q}}else{var j0=Q.inAnchor;Q.inAnchor=!0;var X0=j0?[{type:_.text,text:W}]:C0(W,0,W.length,Q,X);return Q.inAnchor=j0,!Q.inAnchor&&l$(X0)?null:{node:{type:_.link,target:C,title:S,children:X0},end:q}}}else q=H+1,B=!0}var m="",s=q;if(!B&&D===z0){var k0=q+1;s=k0;for(var l0=!1;s<Z&&$.charCodeAt(s)!==u0;){if($.charCodeAt(s)===_0&&s+1<Z){s+=2;continue}if($.charCodeAt(s)===z0){l0=!0;break}s++}if(l0||s>=Z)return null;var m0=$.slice(k0,s);if(m0.trim())m=A$(m0);else{if(y6(W))return null;m=A$(W)}s=s+1}else{if(y6(W))return null;m=A$(W)}var O0=Q.refs[m];if(!O0)return null;if(Y)return{node:{type:_.image,target:O0.target,alt:P$(C0(W,0,W.length,Q,X)),title:O0.title},end:s};var h=Q.inAnchor;Q.inAnchor=!0;var X0=h?[{type:_.text,text:W}]:C0(W,0,W.length,Q,X);return Q.inAnchor=h,!Q.inAnchor&&l$(X0)?null:{node:{type:_.link,target:O0.target,title:O0.title,children:X0},end:s}}function i6($,J,Z){if($.charCodeAt(J)!==$0)return null;for(var Q=J+1;Q<Z;){var X=$.charCodeAt(Q);if(X===c)break;if(X===I||X===L||X===D9||X===$0)return null;Q++}if(Q>=Z||$.charCodeAt(Q)!==c)return null;var Y=$.slice(J+1,Q),K=Y.match(/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^\x00-\x20]*)$/);return K?{node:{type:_.link,target:Y,title:void 0,children:[{type:_.text,text:Y}]},end:Q+1}:Y.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(Y)?{node:{type:_.link,target:"mailto:"+Y,title:void 0,children:[{type:_.text,text:Y}]},end:Q+1}:null}function VJ($,J,Z,Q){if($.charCodeAt(J)!==z0||J+1>=Z||$.charCodeAt(J+1)!==r0)return null;let X=J+2;for(;X<Z&&$.charCodeAt(X)!==u0&&$.charCodeAt(X)!==L;)X++;if(X>=Z||$.charCodeAt(X)!==u0)return null;let Y=$.slice(J+2,X);return Y?{node:{type:_.footnoteReference,target:"#"+d0(Y),text:Y},end:X+1}:null}function qJ($,J,Z,Q){if(Q.disableBareUrls)return null;var X="",Y=!1,K=$.charCodeAt(J);if(K===m9||K===72?J+8<=Z&&$.charCodeAt(J+1)===u9&&$.charCodeAt(J+2)===u9&&$.charCodeAt(J+3)===H$&&($.charCodeAt(J+4)===T$&&$.charCodeAt(J+5)===x0&&$.charCodeAt(J+6)===D0&&$.charCodeAt(J+7)===D0?X="https://":$.charCodeAt(J+4)===x0&&$.charCodeAt(J+5)===D0&&$.charCodeAt(J+6)===D0&&(X="http://")):K===j9||K===70?J+6<=Z&&$.charCodeAt(J+1)===u9&&$.charCodeAt(J+2)===H$&&$.charCodeAt(J+3)===x0&&$.charCodeAt(J+4)===D0&&$.charCodeAt(J+5)===D0&&(X="ftp://"):(K===F9||K===87)&&J+4<=Z&&$.charCodeAt(J+1)===F9&&$.charCodeAt(J+2)===F9&&$.charCodeAt(J+3)===p0&&(X="www.",Y=!0),!X)return null;let V=J+X.length;for(;V<Z;){let M=$.charCodeAt(V);if(M===I||M===L||M===N||M===D9||M===$0||M===c)break;V++}for(var q=0,G=0,U=J;U<V;U++){var F=$.charCodeAt(U);F===s0?q++:F===t0&&G++}let O=V;for(;O>J+X.length;){let M=$.charCodeAt(O-1);if(M===p0||M===F6||M===x0||M===E0||M===n9||M===t0||M===H0||M===q0||M===A0){if(M===t0){if(q>=G)break;G--}O--}else if(M===f$){for(var z=O-2;z>J&&($.charCodeAt(z)>=p&&$.charCodeAt(z)<=l||$.charCodeAt(z)>=K0&&$.charCodeAt(z)<=U0||$.charCodeAt(z)>=r&&$.charCodeAt(z)<=i);)z--;z>=J&&$.charCodeAt(z)===x$?O=z:O--}else break}if(O<=J+X.length)return null;var j=J+(Y?4:X.length),H=$.indexOf("/",j);if((H<0||H>O)&&(H=O),Y&&$.indexOf(".",j)===-1)return null;for(var W=-1,D=-1,B=H-1;B>=j;B--)if($.charCodeAt(B)===p0)if(W<0)W=B;else{D=B;break}for(var v=D>=0?D+1:j,B=v;B<H;B++)if($.charCodeAt(B)===q0)return null;var T=$.slice(J,O),P=Y?"http://"+T:T;return{node:{type:_.link,target:P,title:void 0,children:[{type:_.text,text:T}]},end:O}}function UJ($,J,Z,Q){if(Q.disableBareUrls)return null;for(var X=J,Y=X;X<Z;){var K=$.charCodeAt(X);if(K>=p&&K<=l||K>=K0&&K<=U0||K>=r&&K<=i||K===p0||K===E0||K===G9||K===36||K===G$||K===x$||K===L9||K===H0||K===M9||K===D0||K===T0||K===n9||K===r0||K===q0||K===n||K===S9||K===P0||K===D$||K===A0||K===u)X++;else break}if(X===Y||X>=Z||$.charCodeAt(X)!==K$)return null;X++;for(var V=X,q=-1,G=X;X<Z;){var K=$.charCodeAt(X);if(K>=p&&K<=l||K>=K0&&K<=U0||K>=r&&K<=i)X++;else if((K===u||K===q0)&&X>V)X++;else if(K===p0){if(X===V)break;var U=$.charCodeAt(X-1);if(U===u||U===q0||X-G>63)break;if(X+1<Z){var F=$.charCodeAt(X+1);if(F>=p&&F<=l||F>=K0&&F<=U0||F>=r&&F<=i)q=X,G=X+1,X++;else break}else break}else break}if(X-G>63||q<0)return null;var O=$.charCodeAt(X-1);if(!(O>=p&&O<=l||O>=K0&&O<=U0||O>=r&&O<=i)||X<=q+1)return null;for(var z=-1,j=q-1;j>=V;j--)if($.charCodeAt(j)===p0){z=j;break}for(var H=z>=0?z+1:V,j=H;j<X;j++)if($.charCodeAt(j)===q0)return null;var W=$.slice(J,X);return{node:{type:_.link,target:"mailto:"+W,title:void 0,children:[{type:_.text,text:W}]},end:X}}function l$($){for(var J=0;J<$.length;J++)if($[J].type===_.link||"children"in $[J]&&Array.isArray($[J].children)&&l$($[J].children))return!0;return!1}function P$($){for(var J="",Z=0;Z<$.length;Z++){var Q=$[Z];Q.type===_.text?J+=Q.text:Q.type===_.breakLine?J+=" ":Q.type===_.codeInline?J+=Q.text:"children"in Q&&Array.isArray(Q.children)?J+=P$(Q.children):Q.type===_.image?J+=Q.alt||"":Q.type===_.link&&(J+=P$(Q.children))}return J}function l9($){let J=$.includes("&")?M$($):$;return{type:_.text,text:J}}function FJ($,J,Z,Q,X){if($.charCodeAt(J)!==$0)return null;var Y=J+1;if(Y>=Z)return null;var K=$.charCodeAt(Y);if(K===E0&&Y+1<Z&&$.charCodeAt(Y+1)===u&&Y+2<Z&&$.charCodeAt(Y+2)===u){var V=Y+3;if(V<Z&&$.charCodeAt(V)===c)return{node:{type:_.htmlComment,text:"",h:!0},end:V+1};if(V+1<Z&&$.charCodeAt(V)===u&&$.charCodeAt(V+1)===c)return{node:{type:_.htmlComment,text:"-",h:!0},end:V+2};var q=$.indexOf("-->",V);return q!==-1&&q<=Z-3?{node:{type:_.htmlComment,text:$.slice(J+4,q),h:!1},end:q+3}:null}if(K===n9){var G=$.indexOf("?>",Y+1);return G!==-1&&G<Z?{node:{type:_.htmlSelfClosing,tag:"?",attrs:{},a:$.slice(J,G+2),b:!1},end:G+2}:null}if(K===E0&&Y+1<Z){var U=$.charCodeAt(Y+1);if(U===z0&&$.slice(Y+1,Y+8)==="[CDATA["){var F=$.indexOf("]]>",Y+8);return F!==-1&&F<Z?{node:{type:_.htmlSelfClosing,tag:"![CDATA[",attrs:{},a:$.slice(J,F+3),b:!1},end:F+3}:null}if(U>=p&&U<=l){var O=$.indexOf(">",Y+2);return O!==-1&&O<Z?{node:{type:_.htmlSelfClosing,tag:"!"+$.slice(Y+1,O),attrs:{},a:$.slice(J,O+1),b:!1},end:O+1}:null}}if(K===D0){var z=Y+1;if(z>=Z)return null;var j=$.charCodeAt(z);if(!(j>=p&&j<=l||j>=K0&&j<=U0))return null;for(z++;z<Z;){var H=$.charCodeAt(z);if(H>=p&&H<=l||H>=K0&&H<=U0||H>=r&&H<=i||H===u)z++;else break}for(;z<Z&&($.charCodeAt(z)===I||$.charCodeAt(z)===N||$.charCodeAt(z)===L);)z++;if(z<Z&&$.charCodeAt(z)===c){var W=$.slice(Y+1,z).trim();return{node:{type:_.htmlSelfClosing,tag:W,attrs:{},a:$.slice(J,z+1),b:!0},end:z+1}}return null}if(!(K>=p&&K<=l||K>=K0&&K<=U0))return null;var D=I9($,J);if(!D)return null;var B=D.tag,v=B.toLowerCase(),T=D.selfClosing;if(T||c9(B))return{node:{type:_.htmlSelfClosing,tag:B,attrs:_9(D.attrs,B,X),a:$.slice(J,D.end),b:!1},end:D.end};var P=U$.has(v),M=c$($.slice(0,Z),D.end,B);if(M===-1)return{node:{type:_.htmlSelfClosing,tag:B,attrs:_9(D.attrs,B,X),a:$.slice(J,D.end),b:!1},end:D.end};var E=sZ($,"</"+v,M),S=$.slice(D.end,E),R=[];if(P)S.trim()&&(R=[{type:_.text,text:S}]);else{var b=S.trim();if(b){var{inAnchor:w,inline:y}=Q;v==="a"&&(Q.inAnchor=!0);var g=b.indexOf(`

`)!==-1||/^#{1,6}\s/.test(b);g?(Q.inline=!1,R=P9(b,Q,X)):R=C0(b,0,b.length,Q,X),Q.inAnchor=w,Q.inline=y}}return{node:{type:_.htmlBlock,tag:B,attrs:_9(D.attrs,B,X),f:D.rawAttrs,children:R,a:void 0,text:S,d:!1,b:!1,endPos:M,e:!1},end:M}}var WJ=200,$$=0;function C0($,J,Z,Q,X){if($$++,$$>WJ)return $$--,[{type:_.text,text:$.slice(J,Z)}];let Y=Q;if(X.streaming||X.optimizeForStreaming){let $9=function(G0,x){for(var y0=1,W0=x+1;W0<G0.length;W0++){var V9=G0.charCodeAt(W0);if(V9===z0)y0++;else if(V9===u0&&(y0--,y0===0))return W0}return-1},A=$.slice(J,Z),o=A;for(var K=0,V=0,q=0,G=0,U=0,F=-1,O=-1,z=-1,j=-1,H=-1,W=0;W<A.length;W++){var D=A.charCodeAt(W);D===H0?W+1<A.length&&A.charCodeAt(W+1)===H0?(K++,F=W,W++):(V++,O=W):D===q0?W+1<A.length&&A.charCodeAt(W+1)===q0?(q++,z=W,W++):(G++,j=W):D===A0&&W+1<A.length&&A.charCodeAt(W+1)===A0&&(U++,H=W,W++)}var B=[];U%2===1&&H>=0&&B.push([H,2]),q%2===1&&z>=0&&B.push([z,2]),G%2===1&&j>=0&&B.push([j,1]),K%2===1&&F>=0&&B.push([F,2]),V%2===1&&O>=0&&B.push([O,1]),B.sort(function(G0,x){return x[0]-G0[0]});for(var v=0;v<B.length;v++){var T=B[v][0],P=B[v][1];A=A.slice(0,T)+A.slice(T+P)}let N0=0,b0=-1;for(let G0=0;G0<A.length;G0++)A.charCodeAt(G0)===n&&(N0++,b0=G0);if(N0%2===1&&b0!==-1){let G0=!1,x=-1,y0=0;for(;y0<A.length;)A.charCodeAt(y0)===n&&(G0?(G0=!1,x=-1):(x=y0,G0=!0)),y0++;G0&&x!==-1&&(A=A.slice(0,x))}for(var M=!0;M;){M=!1;for(var E=-1,S=-1,R=-1,b=!1,w=0;w<A.length;w++){var y=A.charCodeAt(w);if(y===z0&&(w===0||A.charCodeAt(w-1)!==_0)){var g=w>0&&A.charCodeAt(w-1)===E0,C=g?w-1:w,f=$9(A,w);if(f===-1)E=C,b=g,S=w+1,R=A.length;else{var k=f+1;if(k>=A.length)E=C,b=g,S=w+1,R=f;else if(A.charCodeAt(k)===s0){var j0=A.indexOf(")",k+1);j0===-1?(E=C,b=g,S=w+1,R=f,w=A.length):w=j0}else if(A.charCodeAt(k)===z0){var X0=A.indexOf("]",k+1);X0===-1?(E=C,b=g,S=w+1,R=f,w=A.length):w=X0}else w=f}}}if(E>=0){var m=b?"":A.slice(S,R);A=A.slice(0,E)+m,M=!0}}let L0=A.match(/<([A-Z][A-Za-z0-9]*)(?:\s[^>]*)?>([^<]*)$/);if(L0&&L0.index!==void 0){var s=L0[0].length-L0[2].length,k0=s>=2&&L0[0].charCodeAt(s-2)===D0;if(!k0){for(var l0=!1,m0=0,O0=0;O0<L0.index;O0++)A.charCodeAt(O0)===n&&m0++;if(l0=m0%2===1,!l0){let G0=L0[1];T9(A,"</"+G0,0)===-1&&(A=A.replace(/<[A-Z][A-Za-z0-9]*(?:\s[^>]*)?>([^<]*)$/,"$1"))}}}A!==o&&($=$.slice(0,J)+A,Z=J+A.length)}let h=[];var B0=[];let J0=J;var V0=X.disableAutoLink||X.disableBareUrls||Y.inAnchor?-1:$.indexOf("@",J);for(V0>=Z&&(V0=-1);J<Z;){let A=$.charCodeAt(J),o=null;if(A===n){if(o=QJ($,J,Z),!o){var K9=N9($,J,Z,n);J+=K9-1}}else if(A===H0||A===q0){var Y0=GJ($,J,Z);if(Y0){if(Y0.canOpen||Y0.canClose){J>J0&&h.push(l9($.slice(J0,J)));var M0=$.slice(J,J+Y0.len),I0=l9(M0);B0.push({idx:h.length,ch:A,len:Y0.len,canOpen:Y0.canOpen,canClose:Y0.canClose,active:!0}),h.push(I0),J+=Y0.len,J0=J;continue}J+=Y0.len-1}}else if(A===A0)o=XJ($,J,Z,Y,X);else if(A===T0)o=YJ($,J,Z,Y,X);else if(A===z0)J+1<Z&&$.charCodeAt(J+1)===r0&&(o=VJ($,J,Z,Y)),o||(o=T6($,J,Z,Y,X));else if(A===E0&&J+1<Z&&$.charCodeAt(J+1)===z0)o=T6($,J,Z,Y,X);else if(A===$0)o=i6($,J,Z),!o&&!X.disableParsingRawHTML&&!X.ignoreHTMLBlocks&&(o=FJ($,J,Z,Y,X));else if((A===m9||A===F9||A===j9)&&!Y.inAnchor&&!X.disableAutoLink&&(J===0||$.charCodeAt(J-1)!==$0)){var t=J+1<Z?$.charCodeAt(J+1):0;(A===m9&&t===u9||A===j9&&t===u9||A===F9&&t===F9)&&(o=qJ($,J,Z,X))}if(!o&&V0>=0&&V0-J<=64&&!Y.inAnchor&&!X.disableAutoLink&&!X.disableBareUrls&&(A>=p&&A<=l||A>=K0&&A<=U0||A>=r&&A<=i)&&(o=UJ($,J,Z,X),!o&&J>=V0&&(V0=$.indexOf("@",J+1),V0>=Z&&(V0=-1))),A===j$){J>J0&&h.push(l9($.slice(J0,J))),h.push({type:_.breakLine}),J++,J0=J;continue}if(o)J>J0&&h.push(l9($.slice(J0,J))),h.push(o.node),J=o.end,J0=J;else{if(A===_0&&J+1<Z){let N0=$.charCodeAt(J+1);if(r$(N0)&d9){J>J0&&h.push(l9($.slice(J0,J))),h.push(l9($[J+1])),J+=2,J0=J;continue}}if(J++,V0<0||V0-J>64)for(;J<Z;){var F0=$.charCodeAt(J);if(F0<t9&&!f6[F0])J++;else break}}}if(Z>J0){let A=$.slice(J0,Z);A&&h.push(l9(A))}return B0.length>0&&KJ(h,B0,Q,X),$$--,h}var zJ=500;function P9($,J,Z){var Q=J.i||0;if(Q>zJ)return[{type:_.text,text:$}];J.i=Q+1;let X=J;if((Z.streaming||Z.optimizeForStreaming)&&!J.j){var Y=$.length;Y>0&&$.charCodeAt(Y-1)===L&&Y--;for(var K=Y;K>0&&$.charCodeAt(K-1)!==L;)K--;if(K>0&&$.charCodeAt(K)===P0){for(var V=!0,q=K;q<Y;q++){var G=$.charCodeAt(q);if(G!==I&&G!==N&&G!==u&&G!==x0&&G!==P0){V=!1;break}}if(V){for(var U=K-1;U>0&&$.charCodeAt(U-1)!==L;)U--;$.charCodeAt(U)===P0&&($=$.slice(0,U).trimEnd())}}var F=$.trim(),O=F.lastIndexOf(`
`),z=O===-1?F:F.slice(O+1);if(z.length>0&&z.charCodeAt(0)===P0){for(var j=!1,H=!1,W=1;W<z.length;W++){var D=z.charCodeAt(W);D===P0&&(j=!0),D===u&&(H=!0)}j&&H&&($=O===-1?"":$.slice(0,$.lastIndexOf(z)).trimEnd())}for(var B=-1,v=-1,T=-1,P=$.length-1;P>=0;P--)if($.charCodeAt(P)===$0){var M=P+1<$.length?$.charCodeAt(P+1):0;if(M>=p&&M<=l||M>=K0&&M<=U0){for(var E=P+2;E<$.length;){var S=$.charCodeAt(E);if(S>=p&&S<=l||S>=K0&&S<=U0||S>=r&&S<=i)E++;else break}for(var R=E;R<$.length&&$.charCodeAt(R)!==c;)R++;if(R<$.length&&$.charCodeAt(R-1)!==D0){for(var b=!1,w=R+1;w<$.length;w++)if($.charCodeAt(w)===$0){b=!0;break}b||(B=P,v=E,T=R+1)}}break}if(B>=0){for(var y=0,g=0;g<B;g++)$.charCodeAt(g)===n&&y++;if(y%2===0){var C=$.slice(B+1,v);T9($,"</"+C,0)===-1&&($=$.slice(0,B)+$.slice(T))}}for(var f=$.length;f>0&&$.charCodeAt(f-1)===L;)f--;if(f>0){for(var k=f;k>0&&$.charCodeAt(k-1)!==L;)k--;for(var j0=k,X0=0;j0<f&&$.charCodeAt(j0)===I&&X0<3;)j0++,X0++;if(k>0&&j0<f&&oZ($,j0,f)){for(var m=k-1,s=m;s>0&&$.charCodeAt(s-1)!==L;)s--;c0($,s,m)||($=$.slice(0,k).trimEnd())}}var k0=$.length;if(k0>0){for(var l0=$.lastIndexOf(`
`),m0=l0===-1?0:l0+1,O0=k0,h=m0,B0=0;h<O0&&$.charCodeAt(h)===I&&B0<3;)h++,B0++;if(h<O0){var J0=$.charCodeAt(h),V0=!1;if(J0===H0||J0===u||J0===M9){var K9=h+1;if(K9>=O0||$.charCodeAt(K9)===I||$.charCodeAt(K9)===N){for(var Y0=K9;Y0<O0&&($.charCodeAt(Y0)===I||$.charCodeAt(Y0)===N);)Y0++;Y0>=O0&&(V0=!0)}}else if(J0>=r&&J0<=i){for(var M0=h;M0<O0&&$.charCodeAt(M0)>=r&&$.charCodeAt(M0)<=i;)M0++;if(M0<O0&&($.charCodeAt(M0)===p0||$.charCodeAt(M0)===t0)){var I0=M0+1;if(I0>=O0||$.charCodeAt(I0)===I||$.charCodeAt(I0)===N){for(var t=I0;t<O0&&($.charCodeAt(t)===I||$.charCodeAt(t)===N);)t++;t>=O0&&(V0=!0)}}}V0&&($=$.slice(0,m0).trimEnd())}}}if(J.inline)return C0($,0,$.length,J,Z);let F0=[],A=0,o=$.length;if(A===0&&!Z.disableFrontmatter&&$.startsWith("---")){let x=B6($);if(x&&x.hasValidYaml){if(Z.preserveFrontmatter!==!1){let y0=$.slice(0,x.endPos).trimEnd();F0.push({type:_.frontmatter,text:y0})}A=x.endPos}}for(;A<o;){for(var N0=$.indexOf(`
`,A),b0=N0<0?o:N0;A<o&&c0($,A,b0);)A=b0<o?b0+1:b0,A<o&&(N0=$.indexOf(`
`,A),b0=N0<0?o:N0);if(A>=o)break;$.charCodeAt(A),v0($,A,b0);let x=null;if(u6=$,p6=A,d6=b0,$.charCodeAt(A)!==s9&&Z0>=4&&!J.inHTML)x=iZ($,A);else if($.charCodeAt(A)!==s9){let y0=A+e,W0=$.charCodeAt(y0);W0===G9?x=c6($,A,J,Z):W0===c?x=aZ($,A,J,Z):W0===n||W0===A0?x=rZ($,A,J):W0===u||W0===H0||W0===q0?(x=f9($,A),!x&&(x=L6($,A,J,Z))):W0===M9||W0>=r&&W0<=i?x=L6($,A,J,Z):W0===$0?x=o6($,A,J,Z):W0===P0?x=E6($,A,J,Z):W0===z0&&(x=eZ($,A,J))}if(!x){for(var $9=!1,L0=A;L0<b0;L0++)if($.charCodeAt(L0)===P0){$9=!0;break}$9&&(x=E6($,A,J,Z))}if(x||(x=ZJ($,A,J,Z)),x)x.node.type!==_.refCollection&&F0.push(x.node),A=x.end;else{var G0=$.indexOf(`
`,A);A=G0<0?o:G0+1}}return J.i=Q,F0}function a6($,J){$$=0,$.charCodeAt(0)===65279&&($=$.slice(1)),$=m$($);let Z={inline:!1,inAnchor:!1,inHTML:!1,inList:!1,inBlockQuote:!1,refs:{}},Q={...J,slugify:J?.slugify?Y=>J.slugify(Y,d0):d0,sanitizer:J?.sanitizer||x9,tagfilter:J?.tagfilter!==!1};Z.j=h6($,Z.refs,Q);let X=P9($,Z,Q);return Z.refs&&Object.keys(Z.refs).length>0?[{type:_.refCollection,refs:Z.refs},...X]:X}function mJ($,J,Z,Q){var X=I9($,J);return X?{tagName:X.tag,tagLower:X.tag.toLowerCase(),attrs:X.rawAttrs,whitespaceBeforeAttrs:X.whitespaceBeforeAttrs,isSelfClosing:X.selfClosing,hasSpaceBeforeSlash:X.hasSpaceBeforeSlash,isClosing:X.isClosing,hasNewline:X.whitespaceBeforeAttrs.includes(`
`)||X.rawAttrs.includes(`
`),endPos:X.end}:null}function b$($,J,Z){$$=0,$=m$($),!J.refs&&(J.refs={}),J.j=h6($,J.refs,Z);let Q=P9($,J,Z);return J.refs&&Object.keys(J.refs).length>0?[{type:_.refCollection,refs:J.refs},...Q]:Q}var HJ=/^\n+/,i$=W9.createContext(void 0);function DJ($,J,Z,Q,X,Y,K,V){let q=V.styles||{};switch($.type){case _.blockQuote:{let G=$;return Q(d.View,{key:Z.key,style:q.blockquote},J(G.children,Z))}case _.breakLine:return`
`;case _.breakThematic:return Q(d.View,{key:Z.key,style:q.thematicBreak});case _.frontmatter:if(V.preserveFrontmatter){let G=$;return Q(d.Text,{key:Z.key,style:q.codeBlock},G.text)}return null;case _.codeBlock:{let G=$;return Q(d.View,{key:Z.key,style:q.codeBlock},Q(d.Text,{style:q.codeInline},G.text))}case _.codeInline:{let G=$;return Q(d.Text,{key:Z.key,style:q.codeInline},G.text)}case _.footnoteReference:{let G=$,U=X(G.target,"a","href");return U?Q(d.Text,{key:Z.key,onPress:()=>{V.onLinkPress?V.onLinkPress(U,G.text):d.Linking.openURL(U).catch(()=>{})},style:q.link},Q(d.Text,{style:{fontWeight:"bold"}},G.text)):null}case _.gfmTask:{let G=$;return Q(d.Text,{key:Z.key,style:q.gfmTask},G.completed?"[x]":"[ ]")}case _.heading:{let G=$,U=`heading${G.level}`,F=q[U];return Q(d.Text,{key:Z.key,style:F},J(G.children,Z))}case _.htmlBlock:{let G=$;if(V.tagfilter&&u$(G.tag)){let U=typeof G.a=="string"?G.a:`<${G.tag}>`;return Q(d.Text,{key:Z.key},U)}if(G.a&&G.d){let O=function(D){return(D.type===_.htmlSelfClosing||D.type===_.htmlBlock)&&D.b?[]:D.type===_.paragraph?D.children?.flatMap(O)||[]:D.type===_.text?D.text?.trim()?[D]:[]:D.type===_.htmlBlock&&D.children?[{...D,children:D.children?.flatMap(O)}]:[D]},U=G.tag.toLowerCase();if(o$(U)){let D=G.a.replace(new RegExp("\\s*</"+U+">\\s*$","i"),"");return V.tagfilter&&(D=p$(D)),Q(G.tag,{key:Z.key,...E9(G.attrs||{})},D)}if(/<\/?pre\b/i.test(G.a)){let D=V.tagfilter?p$(G.a):G.a;return Q(d.Text,{key:Z.key,style:q.codeBlock},D)}if(G.children&&G.children.length>0)return Q(G.tag,{key:Z.key,...E9(G.attrs||{})},J(G.children.flatMap(O),Z));let z=G.a.replace(/>\s+</g,"><").replace(/\n+/g," ").trim();if(new RegExp(`^<${G.tag}(\\s[^>]*)?>(\\s*</${G.tag}>)?$`,"i").test(z))return Q(G.tag,{key:Z.key,...E9(G.attrs||{})});let W=b$(z,{inline:!1,refs:K,inHTML:!1},{slugify:D=>Y(D,d0),sanitizer:(D,B,v)=>X(D,B,v),tagfilter:!0});return Q(G.tag,{key:Z.key,...E9(G.attrs||{})},J(W.flatMap(O),Z))}return c9(G.tag)?Q(G.tag,{key:Z.key,...E9(G.attrs||{})}):Q(G.tag,{key:Z.key,...E9(G.attrs||{})},G.children?J(G.children,Z):"")}case _.htmlSelfClosing:{let G=$;if(V.tagfilter&&u$(G.tag)){let U=typeof G.a=="string"?G.a:`<${G.tag} />`;return Q(d.Text,{key:Z.key},U)}return Q(G.tag,{key:Z.key,...E9(G.attrs||{})})}case _.image:{let G=$,U=X(G.target,"img","src");return U?Q("img",{key:Z.key,source:{uri:U},accessibilityLabel:G.alt||void 0,style:q.image}):null}case _.link:{let G=$,U={textDecorationLine:"underline"},F=q.link?[U,q.link]:U,O={key:Z.key,style:F};if(G.target!=null){let z=I6(G.target);O.onPress=()=>{V.onLinkPress?V.onLinkPress(z,G.title):d.Linking.openURL(z).catch(()=>{})},V.onLinkLongPress&&(O.onLongPress=()=>V.onLinkLongPress(z,G.title))}return Q("a",O,J(G.children,Z))}case _.table:{let G=$;return Q(d.View,{key:Z.key,style:q.table},Q(d.View,{style:q.tableHeader},Q(d.View,{style:{flexDirection:"row"}},G.header.map(function(F,O){return Q(d.View,{key:O,style:[q.tableHeaderCell,G.align[O]!=null?{alignItems:G.align[O]==="center"?"center":G.align[O]==="right"?"flex-end":"flex-start"}:{}]},J(F,Z))}))),G.cells.length>0?Q(d.View,{},G.cells.map(function(F,O){return Q(d.View,{key:O,style:{flexDirection:"row"}},F.map(function(j,H){return Q(d.View,{key:H,style:[q.tableCell,G.align[H]!=null?{alignItems:G.align[H]==="center"?"center":G.align[H]==="right"?"flex-end":"flex-start"}:{}]},J(j,Z))}))})):null)}case _.text:return $.text;case _.textFormatted:{let G=$,F={em:{fontStyle:"italic"},strong:{fontWeight:"bold"},del:{textDecorationLine:"line-through"}}[G.tag],O=q[G.tag]||F;return Q(d.Text,{key:Z.key,style:O},J(G.children,Z))}case _.orderedList:case _.unorderedList:{let G=$,U=$.type===_.orderedList,F=U?q.listOrdered:q.listUnordered;return Q(d.View,{key:Z.key,style:F},G.items.map((O,z)=>{let j=U&&"start"in G&&G.start!=null?G.start+z:z+1,H=U?`${j}.`:"\u2022",W=U?q.listItemNumber:q.listItemBullet;return Q(d.View,{key:z,style:{flexDirection:"row"}},Q(d.Text,{style:W},H+" "),Q(d.View,{style:q.listItem},J(O,Z)))}))}case _.paragraph:return Q("p",{key:Z.key,style:q.paragraph},J($.children,Z));case _.ref:return null;default:return null}}var jJ=($,J,Z,Q,X,Y)=>{let K=(G,U,F)=>{let O=(j,H)=>{let W=Array.isArray(j)?j:[j];return U(W,H||F)},z=()=>DJ(G,O,F,J,Z,Q,X,Y);return $?$(z,G,U,F):z()},V=G=>G.map(U=>"text"in U?U.text:""),q=(G,U={})=>{let F=Array.isArray(G)?G:[G],O=(U.renderDepth||0)+1;if(O>2500)return V(F);U.renderDepth=O;let z=U.key,j=[],H=!1;for(let W=0;W<F.length;W++){U.key=W;let D=K(F[W],q,U),B=typeof D=="string";if(B&&H)j[j.length-1]+=D;else if(D!==null)if(Array.isArray(D))for(let v=0;v<D.length;v++)j.push(D[v]);else j.push(D);H=B}return U.key=z,U.renderDepth=O-1,j.length===1?j[0]:j};return q},BJ=($,J)=>{if(!J||typeof $!="string")return $;let Z=e9(J,$,void 0);return Z?typeof Z=="function"||typeof Z=="object"&&Z!==null&&"render"in Z?Z:e9(J,`${$}.component`,$):$},MJ=$=>{let J=$.toLowerCase();return J==="img"?d.Image:J==="div"||J==="section"||J==="article"||J==="aside"||J==="header"||J==="footer"||J==="main"||J==="nav"||J==="figure"||J==="figcaption"||J==="blockquote"||J==="ul"||J==="ol"||J==="li"||J==="table"||J==="thead"||J==="tbody"||J==="tr"||J==="th"||J==="td"||o$(J)?d.View:d.Text};function n6($,J){let Z={...J||{}};Z.overrides=Z.overrides||{};let Q=Z.slugify||d0,X=Z.sanitizer||x9,Y=Z.createElement||W9.createElement;function K(H,W,...D){if(typeof H!="string")return Y(H,W,...D);let B=e9(Z.overrides||{},`${H}.props`,{}),v=BJ(H,Z.overrides||{}),T={...W,...B,style:W.style||B.style||void 0};if(typeof v=="function"||typeof v=="object"&&v!==null)return Y(v,T,...D);let P=MJ(v);return Y(P,T,...D)}let V={slugify:H=>Q(H,d0),sanitizer:(H,W,D)=>X(H,W,D),tagfilter:Z.tagfilter!==!1,disableAutoLink:Z.disableAutoLink,disableParsingRawHTML:Z.disableParsingRawHTML,enforceAtxHeadings:Z.enforceAtxHeadings},q=$[0]&&$[0].type===_.refCollection?$[0].refs:{},G=jJ(Z.renderRule,K,(H,W,D)=>X(H,W,D),Q,q,Z),U=G($,{inline:Z.forceInline,refs:q}),F=Array.isArray(U)?U:[U],O=[];for(let H in q)H.charCodeAt(0)===r0&&O.push({identifier:H,footnote:q[H].target});if(O.length&&F.push(Y(d.View,{key:"footer"},O.map(function(W){let D=W.identifier.charCodeAt(0)===r0?W.identifier.slice(1):W.identifier,B=b$(W.footnote,{inline:!0,refs:q},V),v=G(B,{inline:!0,refs:q}),T=typeof v=="string"?Y(d.Text,{},v):v;return Y(d.View,{key:W.identifier},Y(d.Text,{},D+": "),T)}))),Z.wrapper===null)return F;let z=Z.wrapper||(Z.forceInline?d.Text:d.View),j;if(F.length>1||Z.forceWrapper)j=F;else if(F.length===1){let H=F[0];return typeof H=="string"?Y(d.Text,{key:"outer",...Z.wrapperProps},H):H}else return null;return Y(z,{key:"outer",...Z.wrapperProps},j)}function s6($="",J={}){let Z={...J||{}};Z.overrides=Z.overrides||{};let Q=Z.slugify||d0,X=Z.sanitizer||x9;function Y(q){let G=Z.forceInline||!Z.forceBlock&&!M6.test(q),U={slugify:z=>Q(z,d0),sanitizer:(z,j,H)=>X(z,j,H),tagfilter:Z.tagfilter!==!1,disableAutoLink:Z.disableAutoLink,disableParsingRawHTML:Z.disableParsingRawHTML,enforceAtxHeadings:Z.enforceAtxHeadings},F=q;if(!G){let z=F.length;for(;z>0&&(F[z-1]===`
`||F[z-1]==="\r");)z--;F=F.slice(0,z),F=`${F.replace(HJ,"")}

`}let O=b$(G?q:F,{inline:G,refs:K},U);return n6(O,{...Z,forceInline:G})}let K={};return Y($)}var AJ=({options:$,children:J})=>W9.createElement(i$.Provider,{value:$},J),t6=({children:$,options:J,...Z})=>{let Q=W9.useContext(i$),X=W9.useMemo(()=>{var V=Object.assign({},Q,J);return V.styles=Object.assign({},Q?.styles,J?.styles),V.overrides=Object.assign({},Q?.overrides,J?.overrides),V.wrapperProps=Object.assign({},Q?.wrapperProps,J?.wrapperProps,Z),V},[Q,J,Z]),Y=$??"";return W9.useMemo(()=>s6(Y,X),[Y,X])},_J=t6;
