/** * marked v18.4.0 - a markdown parser * Copyright (c) 2018-2026, MarkedJS. (MIT License) * Copyright (c) 2011-2018, Christopher Jeffrey. (MIT License) * https://github.com/markedjs/marked */ /** * DO NOT EDIT THIS FILE * The code in this file is generated from files in ./src/ */ function G(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var $=G();function ge(l){$=l}var N={exec:()=>null};function j(l){let e=[];return t=>{let n=Math.max(0,Math.min(3,t-1)),r=e[n];return r||(r=l(n),e[n]=r),r}}function h(l,e=""){let t=typeof l=="string"?l:l.source,n={replace:(r,s)=>{let o=typeof s=="string"?s:s.source;return o=o.replace(b.caret,"$1"),t=t.replace(r,o),n},getRegex:()=>new RegExp(t,e)};return n}var ze=((l="")=>{try{return!!new RegExp("(?<=1)(?/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+)[ \t]*)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,blockquoteMarkerWhitespace:/^( {0,3}>)(\t[ \t]*)/gm,blockquoteFenceOpen:/^ {0,3}(`{3,}(?=[^`]*$)|~{3,})/,blockquoteFenceClose:/^ {0,3}(`{3,}|~{3,})[ \t]*$/,blockquoteListItemStart:/^ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|$)/,nestedBlockMarker:/^ {0,3}(?:(?:[*+-]|\d{1,9}[.)])(?: |$)|> ?)/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\][ \t]+\S/,listReplaceTask:/^\[[ xX]\][ \t]+/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableHeader:new RegExp(Me+"(?:\\n|$)"),tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/,numericCharacterReferenceOrAmpersand:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:l=>new RegExp(`^( {0,3}${l})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:j(l=>new RegExp(`^ {0,${l}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:j(l=>new RegExp(`^ {0,${l}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:j(l=>new RegExp(`^ {0,${l}}(?:\`{3,}(?=[^\`\\n]*(?:\\n|$))|~~~)`)),headingBeginRegex:j(l=>new RegExp(`^ {0,${l}}#{1,6}(?:\\s|$)`)),pedanticHeadingBeginRegex:j(l=>new RegExp(`^ {0,${l}}#`)),htmlBeginRegex:j(l=>new RegExp(`^ {0,${l}}(?:)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|new RegExp(`^ {0,${l}}>`)),nestedContainerMarkers:/^(?: {0,3}(?:(?:[*+-]|\d{1,9}[.)])[ \t]+|>[ \t]?))+/},Ye=/^(?:[ \t]*(?:\n|$))+/,et=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,tt=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}(?:(?=`)\1`*|(?=~)\1~*)[ \t]*(?=\n|$)|$)/,ee=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,nt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,fe=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,me="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",te=h(" {0,3}(?:)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/\|table/g,"").replace(/html/g,te).getRegex(),rt=h(Be).replace(/bull/g,fe).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}(?=[^`\n]*(?:\n|$))|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).replace(/html/g,te).getRegex(),xe=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,st=/^[^\n]+/,be=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\\n]|\n(?![ \t]*\n))+/,it=h(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<(?:\\.|[^\n<>\\])*>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",be).replace("title",/(?:"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\\n]|\n(?!\n))*'|\((?:\\[\s\S]|[^()\\])*\))/).getRegex(),ot=h(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,fe).getRegex(),Re=/|$))/,at=h("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|[^\\n]*\\n*|$)|[^\\n]*\\n*|$)||$)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*?[ \\t]*/?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Re).replace("tag",me).replace("attribute",/[ \t]+[a-zA-Z:_][\w.:-]*(?:[ \t]*=[ \t]*"[^"\n]*"|[ \t]*=[ \t]*'[^'\n]*'|[ \t]*=[ \t]*[^\s"'=<>`]+)?/).getRegex(),qe=l=>h(xe).replace("hr",ee).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list",l).replace("html",te).getRegex(),lt=qe(b.listInterruptsParagraph),ut=qe(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),Le=/ {0,3}> ?(?:(?!blank)(paragraph)|[^\n]*)(?:\n|$)/,pt=h(/^(first)(?:next)*/).replace("first",h(Le).replace("blank",/[ \t]*(?:\n|$)| {4}/).getRegex()).replace("next",h(Le).replace("blank",/[ \t]*(?:\n|$)/).getRegex()).replace(/paragraph/g,ut).getRegex(),Oe={blockquote:pt,code:et,def:it,fences:tt,heading:nt,hr:ee,html:at,lheading:De,list:ot,newline:Ye,paragraph:lt,table:N,text:st},ct=h(Me+"(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ee).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|0{0,8}1[.)])[ \\t]").replace("html",te).getRegex(),ht={...Oe,lheading:rt,table:ct,paragraph:h(xe).replace("hr",ee).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",b.tableHeader).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list",b.listInterruptsParagraph).replace("html",te).getRegex()},dt={...Oe,html:h(`^ *(?:comment(?: *\\n|\\s*$)|<(tag)[\\s\\S]+?(?: *\\n{2,}|\\s*$)|\\s]*)*?/?>(?: *\\n{2,}|\\s*$))`).replace("comment",Re).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:N,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:h(xe).replace("hr",ee).replace("heading",` *#{1,6} *[^ ]`).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").replace("lheading",De).getRegex()},gt=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,kt=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,He=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,ft=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",ze?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Ze=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Tt=h(Ze,"u").replace(/punct/g,E).getRegex(),wt=h(Ze,"u").replace(/punct/g,ve).getRegex(),Pt=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,yt=h(Pt,"u").replace(/openQuote/g,xt).replace(/punct/g,E).getRegex(),je="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",St=h(je,"gu").replace(/notPunctSpace/g,ne).replace(/punctSpace/g,Q).replace(/punct/g,E).getRegex(),_t=h(je,"gu").replace(/notPunctSpace/g,Rt).replace(/punctSpace/g,bt).replace(/punct/g,ve).getRegex(),$t="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",Ct=h($t,"gu").replace(/notPunctSpace/g,ne).replace(/punctSpace/g,Q).replace(/punct/g,E).getRegex(),It=h("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ne).replace(/punctSpace/g,Q).replace(/punct/g,E).getRegex(),Lt="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",At=h(Lt,"gu").replace(/notPunctSpace/g,ne).replace(/punctSpace/g,Q).replace(/punct/g,E).getRegex(),Et=h(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,E).getRegex(),zt="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Mt=h(zt,"gu").replace(/notPunctSpace/g,ne).replace(/punctSpace/g,Q).replace(/punct/g,E).getRegex(),Bt=h(/\\(punct)/,"gu").replace(/punct/g,E).getRegex(),Dt=h(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/,"gu").replace(/punct/g,E).getRegex(),qt=h(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[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])?)+(?![-_])/).getRegex(),Ht=h(Re).replace("(?:-->|$)","-->").getRegex(),vt=h("^comment|^|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",Ht).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ne=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,le=h(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets",Ne).getRegex(),ue=/\\[^ \t\n\x00-\x1f]|\\(?=[ \t\n])|[^ \t\n\x00-\x1f\\()]/,Zt=h(/\((?:char)*\)/).replace("char",ue).getRegex(),jt=h(/\((?:char|p1)*\)/).replace("char",ue).replace("p1",Zt).getRegex(),Nt=h(/\((?:char|p2)*\)/).replace("char",ue).replace("p2",jt).getRegex(),Ft=h(/(?!<)(?:char|p3)+/).replace("char",ue).replace("p3",Nt).getRegex(),Gt=h(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label",le).replace("href",h(/<(?:\\.|[^\n<>\\])*>|bareHref|(?=\))/).replace("bareHref",Ft).getRegex()).replace("title",/"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\])*'|\((?:\\[\s\S]|[^)\\])*\)/).getRegex(),Qt=h(/^!?\[(label)\]\[(ref)\]/).replace("label",le).replace("ref",be).getRegex(),Wt=h(/^!?\[(ref)\](?:\[\])?/).replace("ref",be).getRegex(),Ae=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,Ut=h(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets",Ne).getRegex(),Kt=h("reflink|nolink(?!\\()","g").replace("reflink",h(/^!?\[(label)\]\[(ref)\]/).replace("label",Ut).replace("ref",Ae).getRegex()).replace("nolink",h(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ae).getRegex()).getRegex(),Ee=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Xt=/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/,Vt=h(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,Xt).getRegex(),Te={_backpedal:N,anyPunctuation:Bt,anyPunctuationOutsideCode:Dt,autolink:qt,blockSkip:Ot,br:He,code:kt,del:N,delLDelim:N,delRDelim:N,emStrongLDelim:Tt,emStrongRDelimAst:St,emStrongRDelimUnd:It,escape:gt,link:Gt,nolink:Wt,punctuation:mt,reflink:Qt,reflinkSearch:Kt,tag:vt,text:ft,url:N},Jt={...Te,emStrongLDelim:yt,emStrongRDelimAst:Ct,emStrongRDelimUnd:At,link:h(/^!?\[(label)\]\((.*?)\)/).replace("label",le).getRegex(),reflink:h(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",le).getRegex()},ke={...Te,emStrongRDelimAst:_t,emStrongLDelim:wt,delLDelim:Et,delRDelim:Mt,url:h(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol",Vt).replace("protocol",Ee).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:h(/^(?:[A-Za-z0-9.+-]+(?=@)|[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},Fe=l=>en[l];function P(l,e){if(e){if(b.escapeTest.test(l))return l.replace(b.escapeReplace,Fe)}else if(b.escapeTestNoEncode.test(l))return l.replace(b.escapeReplaceNoEncode,Fe);return l}function Qe(l){return b.numericCharacterReference.test(l)?l.replace(b.numericCharacterReferenceOrAmpersand,(e,t,n)=>{if(t===void 0&&n===void 0)return"&";let r=t===void 0?Number.parseInt(n,16):Number.parseInt(t,10);return r===0||r>1114111||r>=55296&&r<=57343?"\uFFFD":r===38?"&":String.fromCodePoint(r)}):l}function we(l){try{l=encodeURI(l).replace(b.percentDecode,"%")}catch{return null}return l}function pe(l,e){let t=l.replace(b.findPipe,(s,o,i)=>{let a=!1,p=o;for(;--p>=0&&i[p]==="\\";)a=!a;return a?"|":" |"}),n=t.split(b.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length=0&&b.blankLine.test(e[t]);)t--;return e.length-t<=2?l:e.slice(0,t+1).join(` `)}function K(l,e=!1){let t=e?b.multipleSpaceGlobal:b.multipleSpaceTabGlobal;return l.trim().replace(t," ").toLowerCase().toUpperCase().toLowerCase()}function ye(l,e){if(l.indexOf(e[0])===-1&&l.indexOf(e[1])===-1)return-1;let t=0;for(let n=0;n0?-2:-1}var U=new WeakMap;function Se(l){let e={"*":-1,_:-1},t=-1,n=l.length;for(let r=0;r{if(t)return n;let{depth:r,expanded:s,keptIndent:o,content:i}=tn(n,e?.depth??1/0);if(e?.depth!==r&&(e=void 0),e){let p=b.blockquoteFenceClose.exec(i)?.[1];return!p||p[0]!==e.marker[0]||p.length"||d-s>3)break;o+=" ".repeat(d-n)+">",r++,t=u+1,n=d+1,s=l[t]===" "||l[t]===" "?n+1:n}if(r===0)return{depth:r,expanded:l,keptIndent:l,content:l};let i="",a="";for(;(l[t]===" "||l[t]===" ")&&n1?" ".repeat(u):l[t],n+=u,t++}let p=l.slice(t);return{depth:r,expanded:o+i+p,keptIndent:o+a+p,content:" ".repeat(Math.max(0,n-s))+p}}function Ge(l,e){return l===" "?4-e%4:1}function nn(l,e){let t="";for(let n=0;n{let i=o.match(t.other.beginningSpace);if(i===null)return o;let[a]=i,p=a.indexOf(" ");if(p!==-1&&pe.length-r)return!0;r+=o[0].length-1}}return!1}var C=class{options;rules;lexer;constructor(e){this.options=e||$}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let n=this.options.pedantic?t[0]:Pe(t[0]),r=n.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n,codeBlockStyle:"indented",text:r}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],r=rn(n,t[3]||"",this.rules,this.lexer.state.top&&!this.lexer.state.inBlockquote);t[3]!==void 0&&(r===""||r.endsWith(` `))&&(r+=` `);let s=t[2];if(s){let o=0,i=s.length;for(;oo&&(s[i-1]===" "||s[i-1]===" ");)i--;s=s.slice(o,i).replace(this.rules.inline.anyPunctuation,"$1")}return{type:"code",raw:n,lang:s,text:r}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){let r=z(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceTabChar.test(r))&&(n=r.trim())}return{type:"heading",raw:z(t[0],` `),depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:z(t[0],` `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=z(t[0],` `).split(` `),r="",s="",o=[];for(;n.length>0;){let i=!1,a=[],p;for(p=0;pm.startsWith(" ")?f+" "+m.slice(1):f+X(m,f.length)).replace(this.rules.other.blockquoteSetextReplace,` $1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r} ${u}`:u,s=s?`${s} ${k}`:k;let g=this.lexer.state.top,c=this.lexer.state.inBlockquote,R=this.lexer.state.lastToken;if(this.lexer.state.top=!0,this.lexer.state.inBlockquote=!0,this.lexer.blockTokens(k,o,!0),this.lexer.state.top=g,this.lexer.state.inBlockquote=c,n.length===0)break;let x=o.at(-1);if(x?.type==="code"||x?.type==="heading"||x?.type==="hr"||x?.type==="html"||x?.type==="table")break;if(x?.type==="blockquote"){let w=x,f=n.join(` `),m=w.raw+` `+f.replace(this.rules.other.blockquoteSetextReplace2,"");this.lexer.state.inBlockquote=!0,this.lexer.state.lastToken=o.at(-2);let _=this.blockquote(m);this.lexer.state.inBlockquote=c,this.lexer.state.lastToken=R,o[o.length-1]=_;let T=m.substring(_.raw.length).replace(/^\n/,""),H=T?T.split(` `).length:0,D=H?n.slice(0,-H):n;if(D.length>0&&(r=`${r} ${D.join(` `)}`),s=s.substring(0,s.length-w.text.length)+_.text,n=n.slice(D.length),n.length>0&&this.rules.other.blockquoteStart.test(n[0]))continue;break}else if(x?.type==="list"){let w=x,f=w.raw+` `+n.join(` `);this.lexer.state.inBlockquote=!0,this.lexer.state.lastToken=o.at(-2);let m=this.list(f);this.lexer.state.top=g,this.lexer.state.inBlockquote=c,this.lexer.state.lastToken=R,o[o.length-1]=m;let _=m.raw.length>w.raw.length?f.slice(w.raw.length+1,m.raw.length).split(` `).length:0;if(_>0){let T=n.slice(0,_).join(` `);r=`${r} ${T}`,s=`${s} ${T}`}if(n=n.slice(_),n.length>0&&!this.rules.other.blockquoteStart.test(n[0]))break;continue}}return{type:"blockquote",raw:r,tokens:o,text:s}}}list(e){let t=this.rules.block.list.exec(e);if(t){if(!this.options.pedantic&&this.lexer.state.lastToken?.type==="text"&&!this.rules.other.listInterruptsParagraph.test(e))return;let n=e,r=()=>n.length-e.length,s=t[1].trim(),o=s.length>1,i={type:"list",raw:"",ordered:o,start:o?+s.slice(0,-1):"",loose:!1,items:[]};s=o?`\\d{1,9}\\${s.slice(-1)}`:`\\${s}`,this.options.pedantic&&(s=o?s:"[*+-]");let a=this.rules.other.listItemRegex(s),p=!1;for(;e;){let g=!1,c="";if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;let R=r();e=e.substring(t[0].length);let x=t[2].split(` `,1)[0],w=t[1].length,f=this.options.pedantic?X(x,w):x.replace(this.rules.other.leadingSpaceTab,D=>X(D,w)),m=e.split(` `,1)[0],_=!f.trim(),T=0;if(this.options.pedantic?(T=2,c=f.trimStart()):_?T=w+1:(T=f.search(this.rules.other.nonSpaceChar),T=T>4?1:T,c=f.slice(T),f=c,T+=w),_&&this.rules.other.blankLine.test(m)&&(e=e.substring(m.length+1),g=!0),!g){let D=this.rules.other.nextBulletRegex(T),V=this.rules.other.hrRegex(T),ie=this.rules.other.fencesBeginRegex(T),Z=this.options.pedantic?this.rules.other.pedanticHeadingBeginRegex(T):this.rules.other.headingBeginRegex(T),J=this.rules.other.htmlBeginRegex(T),oe=this.rules.other.blockquoteBeginRegex(T),ae=!1;for(;e;){let $e=e.split(` `,1)[0],L;if(m=$e,this.options.pedantic?(m=m.replace(this.rules.other.listReplaceNesting," "),L=m):L=m.replace(this.rules.other.leadingSpaceTab,I=>X(I)),ie.test(m)||Z.test(m)||J.test(m)||oe.test(m)||D.test(m)||V.test(m))break;if(L.search(this.rules.other.nonSpaceChar)>=T||!m.trim())c+=` `+L.slice(T),ae=!1;else{if(_)break;let I=f;if(!this.options.pedantic&&!c.includes(` `)&&!f.includes(" ")){let A;for(;!V.test(I)&&(A=this.rules.other.nestedBlockMarker.exec(I));)I=I.slice(A[0].length);if(!I.trim())break}if(I.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||ie.test(I)||Z.test(I)||J.test(I)||V.test(I))break;if(!this.options.pedantic&&!ae){let A=f.replace(this.rules.other.nestedContainerMarkers,"");if(this.rules.block.fences.test(A)||this.rules.block.heading.test(A)||this.rules.block.hr.test(A))break}let Ce=!this.options.pedantic&&/^ {0,3}(?:=+|-+) *$/.test(m)&&this.rules.block.lheading.test(`${f} ${m}`)?` ${L.replace(/^ {0,3}/,"")}`:m,de=!this.options.pedantic&&!ae&&L.startsWith(" ")?this.rules.block.list.exec(f):null;if(de?.[2]){let A=de[1].length,Ie=de[2].replace(this.rules.other.leadingSpaceTab,Je=>X(Je,A)),Y=Ie.search(this.rules.other.nonSpaceChar);Y>0&&Y<=4&&!this.rules.other.nestedBlockMarker.test(Ie.slice(Y))&&L.search(this.rules.other.nonSpaceChar)>=A+Y&&this.rules.other.listInterruptsParagraph.test(L.slice(A+Y))&&(Ce=` ${L}`)}c+=` `+Ce,ae=!0}_=!m.trim(),e=e.substring($e.length+1),f=L.slice(T)}}let H=n.slice(R,r());i.loose||(p?i.loose=!0:this.rules.other.doubleBlankLine.test(H)&&(p=!0)),i.items.push({type:"list_item",raw:H,task:!!this.options.gfm&&this.rules.other.listIsTask.test(c),loose:!1,text:c,tokens:[]})}let u=i.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;i.raw=n.slice(0,r()).trimEnd();let d=[],k=this.lexer.state.top;for(let g of i.items)if(this.lexer.state.top=!1,d.push(this.lexer.inlineQueue.length),g.tokens=this.lexer.blockTokens(g.text,[]),!i.loose){let c=g.tokens.filter(x=>x.type==="space"),R=c.length>0&&c.some(x=>this.rules.other.anyLine.test(x.raw));i.loose=R}this.lexer.state.top=k;for(let g=0;g({text:a,tokens:this.lexer.inline(a),header:!1,align:o.align[p]})));return o}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let n=t[1].trim();return{type:"heading",raw:z(t[0],` `),depth:t[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let n=t[1].charAt(t[1].length-1)===` `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let t=this.rules.block.text.exec(e);if(t){let n=t[0],r=t[0],s=this.rules.other.textIndentedContinuation.exec(e.slice(n.length));return s&&(n+=s[0],r+=s[0].replace(this.rules.other.codeRemoveIndent,"")),{type:"text",raw:n,text:r,tokens:this.lexer.inline(r)}}}escape(e){if(e.charCodeAt(0)!==92)return;let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){if(e.charCodeAt(0)!==60)return;let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){if(this.lexer.state.linkParenPossible===!1)return;let t=e.charCodeAt(0);if(t!==91&&t!==33)return;let n=this.rules.inline.link.exec(e);if(n){let r=n[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&Ve(e,n[1],r,this.rules))return;let s=n[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(s)){if(!this.rules.other.endAngleBracket.test(s))return;let p=z(s.slice(0,-1),"\\");if((s.length-p.length)%2===0)return}else{let p=ye(n[2],"()");if(p===-2)return;if(p>-1){let d=(n[0].indexOf("!")===0?5:4)+n[1].length+p;n[2]=n[2].substring(0,p),n[0]=n[0].substring(0,d).trim(),n[3]=""}}let o=z(n[0].slice(0,-1),"\\");if((n[0].length-o.length)%2===0)return;let i=n[2],a="";if(this.options.pedantic){let p=this.rules.other.pedanticHrefTitle.exec(i);p&&(i=p[1],a=p[3])}else a=n[3]?n[3].slice(1,-1):"";return this.options.pedantic&&(i=i.trim()),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(s)?i=i.slice(1):i=i.slice(1,-1)),Xe(n,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},n[0],this.lexer,this.rules)}}reflink(e,t){let n=e.charCodeAt(0);if(n!==91&&n!==33)return;let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){let s=r[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&Ve(e,r[1],s,this.rules))return;let o=t[K(r[2]||r[1],this.options.pedantic)];if(!o){let i=r[0].charAt(0);return{type:"text",raw:i,text:i}}return Xe(r,o,r[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r||!r[1]&&!r[2]&&!r[3]&&!r[4])return;let s=r[0][0],o=n===s,i=t.length-e.length,a=i;for(;!this.options.pedantic&&a>0&&t[a-1]===s;)a--;let p=[...t.slice(Math.max(0,a-2),a)].at(-1)??"",u=p==="*"||p==="_"||!!this.rules.inline.punctuation.exec(p);aD);){if(c=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!c)continue;R=[...c].length;let V=R>x-g;if(r[3]||r[4]){x+=R;continue}else if((r[5]||r[6]||m&&V)&&f%3&&!((f+R)%3)){if(o&&(r[5]||r[6]))break;w+=R;continue}if(x-=R,x>0)continue;R=Math.min(R,R+x+w);let ie=[...r[0]][0].length,Z=e.slice(0,g+r.index+ie+R);if(Math.min(g,R)%2){let oe=Z.slice(1,-1);return{type:"em",raw:Z,text:oe,tokens:this.lexer.inlineTokens(oe)}}let J=Z.slice(2,-2);return{type:"strong",raw:Z,text:J,tokens:this.lexer.inlineTokens(J)}}}}codespan(e){if(e.charCodeAt(0)!==96)return;let t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),s=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&s&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){let t=e.charCodeAt(0);if(t!==32&&t!==92&&t!==10)return;let n=this.rules.inline.br.exec(e);if(n)return{type:"br",raw:n[0]}}del(e,t,n=""){if(e.charCodeAt(0)!==126)return;let r=this.rules.inline.delLDelim.exec(e);if(!r)return;if(!(r[1]||"")||!n||this.rules.inline.punctuation.exec(n)){let o=[...r[0]].length-1,i,a,p=o,u=this.rules.inline.delRDelim,d=he(this,t),k=t.length-e.length+o;if(dg);){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==o))continue;if(r[3]||r[4]){p+=a;continue}if(p-=a,p>0)continue;a=Math.min(a,a+p);let c=[...r[0]][0].length,R=e.slice(0,o+r.index+c+a),x=R.slice(o,-o);return{type:"del",raw:R,text:x,tokens:this.lexer.inlineTokens(x)}}}}autolink(e){if(e.charCodeAt(0)!==60)return;let t=this.rules.inline.autolink.exec(e);if(t){let n,r;return t[2]==="@"?(n=t[1],r="mailto:"+n):(n=t[1],r=n),{type:"link",raw:t[0],text:n,href:r,autolink:!0,tokens:[{type:"text",raw:n,text:n}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let n,r;if(t[2]==="@")n=t[0],r="mailto:"+n;else{let s;do s=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(s!==t[0]);n=t[0],t[1]==="www."?r="http://"+t[0]:r=t[0]}return{type:"link",raw:t[0],text:n,href:r,autolink:!0,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:n?t[0]:Qe(t[0]),escaped:n}}}};var y=class l{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||$,this.options.tokenizer=this.options.tokenizer||new C,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0,inBlockquote:!1};let t={other:b,block:re.normal,inline:W.normal};this.options.pedantic?(t.block=re.pedantic,t.inline=W.pedantic):this.options.gfm&&(t.block=re.gfm,this.options.breaks?t.inline=W.breaks:t.inline=W.gfm),this.tokenizer.rules=t}static get rules(){return{block:re,inline:W}}static lex(e,t){return new l(t).lex(e)}static lexInline(e,t){let n=new l(t);return e.includes("\r")&&(e=e.replace(b.carriageReturn,` `)),n.inlineTokens(e)}lex(e){e=e.replace(b.carriageReturn,` `),this.blockTokens(e,this.tokens);for(let t=0;t(a=u.call({lexer:this},e,t))?(e=e.substring(a.raw.length),t.push(a),!0):!1))continue;if(a=this.tokenizer.space(e)){e=e.substring(a.raw.length);let u=t.at(-1);a.raw.length===1&&u!==void 0?u.raw+=` `:t.push(a);continue}if(a=this.tokenizer.code(e)){e=e.substring(a.raw.length);let u=t.at(-1);u?.type==="paragraph"||u?.type==="text"?(u.raw+=(u.raw.endsWith(` `)?"":` `)+a.raw,u.text+=` `+a.text,this.inlineQueue.at(-1).src=u.text):t.push(a);continue}if(a=this.tokenizer.fences(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.heading(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.hr(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.blockquote(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.list(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.html(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.def(e)){e=e.substring(a.raw.length);let u=t.at(-1);u?.type==="paragraph"||u?.type==="text"?(u.raw+=(u.raw.endsWith(` `)?"":` `)+a.raw,u.text+=` `+a.raw,this.inlineQueue.at(-1).src=u.text):(this.tokens.links[a.tag]||(this.tokens.links[a.tag]={href:a.href,title:a.title}),t.push(a));continue}if(a=this.tokenizer.table(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.lheading(e)){e=e.substring(a.raw.length),t.push(a);continue}let p=e;if(this.options.extensions?.startBlock){let u=1/0,d=e.slice(1),k;this.options.extensions.startBlock.forEach(g=>{k=g.call({lexer:this},d),typeof k=="number"&&k>=0&&(u=Math.min(u,k))}),u<1/0&&u>=0&&(p=e.substring(0,u+1))}if(this.state.top&&(a=this.tokenizer.paragraph(p))){let u=t.at(-1);(n||u===o&&i)&&u?.type==="paragraph"?(u.raw+=(u.raw.endsWith(` `)?"":` `)+a.raw,u.text+=` `+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text,o=u):(t.push(a),o=a),n=p.length!==e.length,e=e.substring(a.raw.length);continue}if(a=this.tokenizer.text(e)){e=e.substring(a.raw.length);let u=t.at(-1);u?.type==="text"?(u.raw+=(u.raw.endsWith(` `)?"":` `)+a.raw,u.text+=` `+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):t.push(a);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,this.state.lastToken=r,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes("["))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&e.charAt(n.index-1)!=="!")return!0;for(let n of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let r=n[0],s=r.lastIndexOf("[");if(!(r.charAt(0)==="!"||!Object.hasOwn(this.tokens.links,K(r.slice(s+1,-1),this.options.pedantic)))&&!(s>1&&this.linkInText(r.slice(1,s-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=this.state.linkParenPossible;this.state.linkParenPossible=e.includes(")");try{return this.#t(e,t)}finally{this.state.linkParenPossible=n}}#t(e,t){let n=e.includes("*")||e.includes("_")||e.includes("~"),r=n||this.options.hooks?.emStrongMask||this.tokenizer.emStrong!==C.prototype.emStrong||this.tokenizer.del!==C.prototype.del?this.#r(e):e;if(!n)return this.#e(e,r,t);We(this.tokenizer,r);try{return this.#e(e,r,t)}finally{Ue(this.tokenizer)}}#e(e,t,n){let r=!1,s="",o=1/0;for(;e;){if(e.length(i=u.call({lexer:this},e,n))?(e=e.substring(i.raw.length),n.push(i),!0):!1))continue;if(i=this.tokenizer.escape(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.tag(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.link(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(i.raw.length);let u=n.at(-1);i.type==="text"&&u?.type==="text"?(u.raw+=i.raw,u.text+=i.text):n.push(i);continue}let a=e[0];if(a==="*"||a==="_"){let u=t.length-e.length;if(ce(this.tokenizer,t,a)<=u){let k=1;for(;k{k=g.call({lexer:this},d),typeof k=="number"&&k>=0&&(u=Math.min(u,k))}),u<1/0&&u>=0&&(p=e.substring(0,u+1))}if(i=this.tokenizer.inlineText(p)){e=e.substring(i.raw.length),i.raw.slice(-1)!=="_"&&(s=i.raw.slice(-1)),r=!0;let u=n.at(-1);u?.type==="text"?(u.raw+=i.raw,u.text+=i.text):n.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return n}#n(e){let{blockSkip:t,tag:n,autolink:r}=this.tokenizer.rules.inline,s="",o=0,i;for(t.lastIndex=0;i=t.exec(e);){let a=i.index+(i[2]?i[2].length:0),p=i.index+i[0].length;if(e.charAt(a)==="<"){let u=e.slice(a),d=n.exec(u)||r.exec(u);if(!d){t.lastIndex=a+1;continue}p=a+d[0].length,t.lastIndex=p}s+=e.slice(o,a)+"["+"a".repeat(p-a-2)+"]",o=p}return s+e.slice(o)}#r(e){let t=e;if(this.tokens.links&&e.includes("[")){let n=this.tokenizer.rules.inline.reflinkSearch,r=s=>{let o=s.lastIndexOf("[");if(!Object.hasOwn(this.tokens.links,K(s.slice(o+1,-1),this.options.pedantic)))return s;if(o>1&&s.charAt(0)!=="!"){let i=s.slice(1,o-1);if(this.linkInText(i))return"["+i.replace(n,r)+"]["+"a".repeat(s.length-o-2)+"]"}return"["+"a".repeat(s.length-2)+"]"};t=t.replace(n,r)}return t=t.replace(this.tokenizer.rules.inline.anyPunctuationOutsideCode,(n,r,s)=>s?"+".repeat(n.length):r?r+n.slice(r.length,-r.length).replace(/`/g,"+")+r:n),t=this.#n(t),t=this.options.hooks?.emStrongMask?.call({lexer:this},t)??t,t}infiniteLoopError(e){let t="Infinite loop on byte: "+e;if(this.options.silent)console.error(t);else throw new Error(t)}};function _e(l,e=!1){let t;for(let n=0;n'+(n?s:P(s,!0))+` `:"
"+(n?s:P(s,!0))+`
`}blockquote({tokens:e}){return`
${this.parser.parse(e)}
`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`${this.parser.parseInline(e)} `}hr(e){return`
`}list(e){let t=e.ordered,n=e.start,r="";for(let i=0;i `+r+" `}listitem(e){return`
  • ${this.parser.parse(e.tokens)}
  • `}checkbox({checked:e}){return" '}paragraph({tokens:e}){return`

    ${this.parser.parseInline(e)}

    `}table(e){let t="",n="";for(let s=0;s${r}`),` `+t+` `+r+`
    `}tablerow({text:e}){return` ${e} `}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+` `}strong({tokens:e}){return`${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${P(e,!0)}`}br(e){return"
    "}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:t,text:n,tokens:r,autolink:s}){let o=s?P(n,!0):this.parser.parseInline(r),i=we(e);if(i===null)return o;e=P(i,s);let a='
    ",a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(_e(r),this.parser.textRenderer));let s=we(e);if(s===null)return P(n);e=s;let o=`${P(n)}{if(s[o]){let i=s[o].flat(1/0);v(n,this.walkTokens(i,t))}}):s.tokens&&v(n,this.walkTokens(s.tokens,t))}}return n}use(...e){let t=this.defaults.extensions||{renderers:Object.create(null),childTokens:Object.create(null)};return e.forEach(n=>{let r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s&&s.renderer){let o=s.renderer,i=t.renderers[s.name];i?t.renderers[s.name]=function(...a){let p=o.apply(this,a);return p===!1&&(p=i.apply(this,a)),p}:t.renderers[s.name]=o}if("tokenizer"in s&&s.tokenizer){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let o=t[s.level];o?o.unshift(s.tokenizer):t[s.level]=[s.tokenizer],s.start&&(s.level==="block"?t.startBlock?t.startBlock.push(s.start):t.startBlock=[s.start]:s.level==="inline"&&(t.startInline?t.startInline.push(s.start):t.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(t.childTokens[s.name]=s.childTokens)}),r.extensions=t),n.renderer){let s=this.defaults.renderer||new M(this.defaults);for(let o in n.renderer){if(!(o in s))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let i=o,a=n.renderer[i];if(a===void 0)continue;let p=s[i];s[i]=(...u)=>{let d=a.apply(s,u);return d===!1&&(d=p.apply(s,u)),d===!1?"":d??""}}r.renderer=s}if(n.tokenizer){let s=this.defaults.tokenizer||new C(this.defaults);for(let o in n.tokenizer){if(!(o in s))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let i=o,a=n.tokenizer[i];if(a===void 0)continue;let p=s[i];s[i]=(...u)=>{let d=a.apply(s,u);return d===!1&&(d=p.apply(s,u)),d}}r.tokenizer=s}if(n.hooks){let s=this.defaults.hooks||new B;for(let o in n.hooks){if(!(o in s))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;let i=o,a=n.hooks[i];if(a===void 0)continue;let p=s[i];B.passThroughHooks.has(o)?s[i]=u=>{if(s.options.async&&B.passThroughHooksRespectAsync.has(o))return(async()=>{let k=await a.call(s,u);return p.call(s,k)})();let d=a.call(s,u);return p.call(s,d)}:s[i]=(...u)=>{if(s.options.async)return(async()=>{let k=await a.apply(s,u);return k===!1&&(k=await p.apply(s,u)),k})();let d=a.apply(s,u);return d===!1&&(d=p.apply(s,u)),d}}r.hooks=s}if(n.walkTokens){let s=this.defaults.walkTokens,o=n.walkTokens;r.walkTokens=function(i){let a=[];return v(a,o.call(this,i)),s&&v(a,s.call(this,i)),a}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return y.lex(e,t??this.defaults)}parser(e,t){return S.parse(e,t??this.defaults)}parseMarkdown(e){return(n,r)=>{let s={...r},o={...this.defaults,...s},i=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&s.async===!1)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(o.hooks&&(o.hooks.options=o,o.hooks.block=e),o.async)return(async()=>{let a=o.hooks?await o.hooks.preprocess(n):n,u=await(o.hooks?await o.hooks.provideLexer(e):e?y.lex:y.lexInline)(a,o),d=o.hooks?await o.hooks.processAllTokens(u):u;o.walkTokens&&await Promise.all(this.walkTokens(d,o.walkTokens));let g=await(o.hooks?await o.hooks.provideParser(e):e?S.parse:S.parseInline)(d,o);return o.hooks?await o.hooks.postprocess(g):g})().catch(i);try{o.hooks&&(n=o.hooks.preprocess(n));let p=(o.hooks?o.hooks.provideLexer(e):e?y.lex:y.lexInline)(n,o);o.hooks&&(p=o.hooks.processAllTokens(p)),o.walkTokens&&this.walkTokens(p,o.walkTokens);let d=(o.hooks?o.hooks.provideParser(e):e?S.parse:S.parseInline)(p,o);return o.hooks&&(d=o.hooks.postprocess(d)),d}catch(a){return i(a)}}}onError(e,t){return n=>{let r=n instanceof Error?n:new Error(String(n));if(r.message+=` Please report this to https://github.com/markedjs/marked.`,e){let s="

    An error occurred:

    "+P(r.message+"",!0)+"
    ";return t?Promise.resolve(s):s}if(t)return Promise.reject(r);throw r}}};var F=new se;function O(l,e){return F.parse(l,e)}function sn(l,e){return F.parseInline(l,e)}O.options=O.setOptions=function(l){return F.setOptions(l),O.defaults=F.defaults,ge(O.defaults),O};O.getDefaults=G;O.defaults=$;function on(...l){return F.use(...l),O.defaults=F.defaults,ge(O.defaults),O}O.use=on;O.walkTokens=function(l,e){return F.walkTokens(l,e)};O.parseInline=sn;O.Parser=S;O.parser=S.parse;O.Renderer=M;O.TextRenderer=q;O.Lexer=y;O.lexer=y.lex;O.Tokenizer=C;O.Hooks=B;O.parse=O;var Xn=O.options,Vn=O.setOptions,Jn=O.walkTokens,Yn=O.parseInline,er=O,tr=S.parse,nr=y.lex;export{B as Hooks,y as Lexer,se as Marked,S as Parser,M as Renderer,q as TextRenderer,C as Tokenizer,$ as defaults,G as getDefaults,nr as lexer,O as marked,Xn as options,er as parse,Yn as parseInline,tr as parser,Vn as setOptions,on as use,Jn as walkTokens};