!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).marked={})}(this,function(n){"use strict";function e(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function t(e){n.defaults=e}n.defaults=e();const s=/[&<>"']/,Q=new RegExp(s.source,"g"),r=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,B=new RegExp(r.source,"g"),M={"&":"&","<":"<",">":">",'"':""","'":"'"},i=e=>M[e];function l(e,t){if(t){if(s.test(e))return e.replace(Q,i)}else if(r.test(e))return e.replace(B,i);return e}const O=/(^|[^\[])\^/g;function a(e,t){let s="string"==typeof e?e:e.source;t=t||"";const r={replace:(e,t)=>{let n="string"==typeof t?t:t.source;return n=n.replace(O,"$1"),s=s.replace(e,n),r},getRegex:()=>new RegExp(s,t)};return r}function o(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch{return null}return e}var c={exec:()=>null};function h(e,t){const n=e.replace(/\|/g,(e,t,n)=>{let s=!1,r=t;for(;0<=--r&&"\\"===n[r];)s=!s;return s?"|":" |"}),s=n.split(/ \|/);let r=0;if(s[0].trim()||s.shift(),0t)s.splice(t);else for(;s.length{var t=e.match(/^\s+/);if(null===t)return e;var[t]=t;return t.length>=n.length?e.slice(n.length):e}).join("\n")}(e=t[0],t[3]||""),{type:"code",raw:e,lang:t[2]&&t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"),text:n}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const n=u(e,"#");!this.options.pedantic&&n&&!/ $/.test(n)||(e=n.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){e=this.rules.block.hr.exec(e);if(e)return{type:"hr",raw:u(e[0],"\n")}}blockquote(e){e=this.rules.block.blockquote.exec(e);if(e){let n=u(e[0],"\n").split("\n"),s="",r="";const o=[];for(;0/.test(n[t]))c.push(n[t]),e=!0;else{if(e)break;c.push(n[t])}n=n.slice(t);const h=c.join("\n");var i=h.replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,"\n $1").replace(/^ {0,3}>[ \t]?/gm,""),l=(s=s?s+` `+h:h,r=r?r+` `+i:i,this.lexer.state.top);if(this.lexer.state.top=!0,this.lexer.blockTokens(i,o,!0),this.lexer.state.top=l,0===n.length)break;i=o[o.length-1];if("code"===i?.type)break;if("blockquote"===i?.type){var l=i,a=l.raw+"\n"+n.join("\n"),a=this.blockquote(a);o[o.length-1]=a,s=s.substring(0,s.length-l.raw.length)+a.raw,r=r.substring(0,r.length-l.text.length)+a.text;break}if("list"===i?.type){l=i;const p=l.raw+"\n"+n.join("\n");a=this.list(p);o[o.length-1]=a,s=s.substring(0,s.length-i.raw.length)+a.raw,r=r.substring(0,r.length-l.raw.length)+a.raw,n=p.substring(o[o.length-1].raw.length).split("\n")}}return{type:"blockquote",raw:s,tokens:o,text:r}}}list(h){let p=this.rules.block.list.exec(h);if(p){let e=p[1].trim();var t=1" ".repeat(3*e.length)),r=h.split("\n",1)[0],i=!s.trim(),l=0;if(this.options.pedantic?(l=2,n=s.trimStart()):i?l=p[1].length+1:(l=4<(l=p[2].search(/[^ ]/))?1:l,n=s.slice(l),l+=p[1].length),i&&/^[ \t]*$/.test(r)&&(t+=r+"\n",h=h.substring(r.length+1),e=!0),!e){const f=new RegExp(`^ {0,${Math.min(3,l-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),d=new RegExp(`^ {0,${Math.min(3,l-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),x=new RegExp(`^ {0,${Math.min(3,l-1)}}(?:\`\`\`|~~~)`),b=new RegExp(`^ {0,${Math.min(3,l-1)}}#`),w=new RegExp(`^ {0,${Math.min(3,l-1)}}<[a-z].*>`,"i");for(;h;){var u=h.split("\n",1)[0];let e;if(r=u,e=this.options.pedantic?r=r.replace(/^ {1,4}(?=( {4})*[^ ])/g," "):r.replace(/\t/g," "),x.test(r))break;if(b.test(r))break;if(w.test(r))break;if(f.test(r))break;if(d.test(r))break;if(e.search(/[^ ]/)>=l||!r.trim())n+="\n"+e.slice(l);else{if(i)break;if(4<=s.replace(/\t/g," ").search(/[^ ]/))break;if(x.test(s))break;if(b.test(s))break;if(d.test(s))break;n+="\n"+r}i||r.trim()||(i=!0),t+=u+"\n",h=h.substring(u.length+1),s=e.slice(l)}}k.loose||(c?k.loose=!0:/\n[ \t]*\n[ \t]*$/.test(t)&&(c=!0));let a=null,o;this.options.gfm&&(a=/^\[[ xX]\] /.exec(n))&&(o="[ ] "!==a[0],n=n.replace(/^\[[ xX]\] +/,"")),k.items.push({type:"list_item",raw:t,task:!!a,checked:o,loose:!1,text:n,tokens:[]}),k.raw+=t}k.items[k.items.length-1].raw=k.items[k.items.length-1].raw.trimEnd(),k.items[k.items.length-1].text=k.items[k.items.length-1].text.trimEnd(),k.raw=k.raw.trimEnd();for(let e=0;e"space"===e.type);var n=0/\n.*\n/.test(e.raw));k.loose=n}if(k.loose)for(let e=0;e$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=t[3]&&t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"),{type:"def",tag:e,raw:t[0],href:n,title:s}}table(e){const t=this.rules.block.table.exec(e);if(t&&/[:|]/.test(t[2])){var n=h(t[1]),e=t[2].replace(/^\||\| *$/g,"").split("|"),s=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[];const r={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===e.length){for(const i of e)/^ *-+: *$/.test(i)?r.align.push("right"):/^ *:-+: *$/.test(i)?r.align.push("center"):/^ *:-+ *$/.test(i)?r.align.push("left"):r.align.push(null);for(let e=0;e({text:e,tokens:this.lexer.inline(e),header:!1,align:r.align[t]})));return r}}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t)return e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1],{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}text(e){e=this.rules.block.text.exec(e);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(e){e=this.rules.inline.escape.exec(e);if(e)return{type:"escape",raw:e[0],text:l(e[1])}}tag(e){e=this.rules.inline.tag.exec(e);if(e)return!this.lexer.state.inLink&&/^/i.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(n){const s=this.rules.inline.link.exec(n);if(s){const i=s[2].trim();if(!this.options.pedantic&&/^$/.test(i))return;n=u(i.slice(0,-1),"\\");if((i.length-n.length)%2==0)return}else{var r,n=function(t,n){if(-1===t.indexOf(n[1]))return-1;let s=0;for(let e=0;e$/.test(i)?e.slice(1):e.slice(1,-1)),j(s,{href:e&&e.replace(this.rules.inline.anyPunctuation,"$1"),title:t&&t.replace(this.rules.inline.anyPunctuation,"$1")},s[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const s=(n[2]||n[1]).replace(/\s+/g," ");e=t[s.toLowerCase()];return e?j(n,e,n[0],this.lexer):{type:"text",raw:t=n[0].charAt(0),text:t}}}emStrong(r,i,e=""){let l=this.rules.inline.emStrongLDelim.exec(r);if(l&&((!l[3]||!e.match(/[\p{L}\p{N}]/u))&&(!(l[1]||l[2]||"")||!e||this.rules.inline.punctuation.exec(e)))){var a=[...l[0]].length-1;let e,t,n=a,s=0;const c="*"===l[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,i=i.slice(-1*r.length+a);null!=(l=c.exec(i));)if(e=l[1]||l[2]||l[3]||l[4]||l[5]||l[6])if(t=[...e].length,l[3]||l[4])n+=t;else if((l[5]||l[6])&&a%3&&!((a+t)%3))s+=t;else if(!(0<(n-=t))){t=Math.min(t,t+n+s);var o=[...l[0]][0].length;const h=r.slice(0,a+l.index+o+t);if(Math.min(a,t)%2)return o=h.slice(1,-1),{type:"em",raw:h,text:o,tokens:this.lexer.inlineTokens(o)};o=h.slice(2,-2);return{type:"strong",raw:h,text:o,tokens:this.lexer.inlineTokens(o)}}}}codespan(t){const n=this.rules.inline.code.exec(t);if(n){let e=n[2].replace(/\n/g," ");var t=/[^ ]/.test(e),s=/^ /.test(e)&&/ $/.test(e);return e=l(e=t&&s?e.substring(1,e.length-1):e,!0),{type:"codespan",raw:n[0],text:e}}}br(e){e=this.rules.inline.br.exec(e);if(e)return{type:"br",raw:e[0]}}del(e){e=this.rules.inline.del.exec(e);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(n){n=this.rules.inline.autolink.exec(n);if(n){let e,t;return t="@"===n[2]?"mailto:"+(e=l(n[1])):e=l(n[1]),{type:"link",raw:n[0],text:e,href:t,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let n;if(n=this.rules.inline.url.exec(e)){let e,t;if("@"===n[2])e=l(n[0]),t="mailto:"+e;else{for(var s;s=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])?.[0]??"",s!==n[0];);e=l(n[0]),t="www."===n[1]?"http://"+n[0]:n[0]}return{type:"link",raw:n[0],text:e,href:t,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(t){t=this.rules.inline.text.exec(t);if(t){let e;return e=this.lexer.state.inRawBlock?t[0]:l(t[0]),{type:"text",raw:t[0],text:e}}}}var p=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,k=/(?:[*+-]|\d{1,9}[.)])/,g=a(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,k).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),f=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,d=/(?!\s*\])(?:\\.|[^\[\]\\])+/,x=a(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",d).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),k=a(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,k).getRegex(),b="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",w=/|$))/,y=a("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))","i").replace("comment",w).replace("tag",b).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),$=a(f).replace("hr",p).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",b).getRegex(),x={blockquote:a(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",$).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:x,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:p,html:y,lheading:g,list:k,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:$,table:c,text:/^[^\n]+/},y=a("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",p).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}\t)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",b).getRegex(),k={...x,table:y,paragraph:a(f).replace("hr",p).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",y).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",b).getRegex()},$={...x,html:a("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",w).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:c,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:a(f).replace("hr",p).replace("heading"," *#{1,6} *[^\n]").replace("lheading",g).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},y=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,b=/^( {2,}|\\)\n(?!\s*$)/,f="\\p{P}\\p{S}",p=a(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,f).getRegex(),g=a(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,f).getRegex(),D=a("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,f).getRegex(),z=a("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,f).getRegex(),f=a(/\\([punct])/,"gu").replace(/punct/g,f).getRegex(),C=a(/^<(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(),w=a(w).replace("(?:--\x3e|$)","--\x3e").getRegex(),w=a("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",w).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),v=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,R=a(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",v).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),T=a(/^!?\[(label)\]\[(ref)\]/).replace("label",v).replace("ref",d).getRegex(),d=a(/^!?\[(ref)\](?:\[\])?/).replace("ref",d).getRegex(),f={_backpedal:c,anyPunctuation:f,autolink:C,blockSkip:/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,br:b,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:c,emStrongLDelim:g,emStrongRDelimAst:D,emStrongRDelimUnd:z,escape:y,link:R,nolink:d,punctuation:p,reflink:T,reflinkSearch:a("reflink|nolink(?!\\()","g").replace("reflink",T).replace("nolink",d).getRegex(),tag:w,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\!!(n=e.call({lexer:this},s,t))&&(s=s.substring(n.raw.length),t.push(n),!0))))if(n=this.tokenizer.space(s))s=s.substring(n.raw.length),1===n.raw.length&&0{"number"==typeof(n=e.call({lexer:this},a))&&0<=n&&(t=Math.min(t,n))}),t<1/0&&0<=t&&(i=s.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(i)))r=t[t.length-1],e&&"paragraph"===r?.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n),e=i.length!==s.length,s=s.substring(n.raw.length);else if(n=this.tokenizer.text(s))s=s.substring(n.raw.length),(r=t[t.length-1])&&"text"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n);else if(s){var l="Infinite loop on byte: "+s.charCodeAt(0);if(this.options.silent){console.error(l);break}throw new Error(l)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(s,t=[]){let n,e,r,i=s,l,a,o;if(this.tokens.links){const h=Object.keys(this.tokens.links);if(0!!(n=e.call({lexer:this},s,t))&&(s=s.substring(n.raw.length),t.push(n),!0))))if(n=this.tokenizer.escape(s))s=s.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(s))s=s.substring(n.raw.length),(e=t[t.length-1])&&"text"===n.type&&"text"===e.type?(e.raw+=n.raw,e.text+=n.text):t.push(n);else if(n=this.tokenizer.link(s))s=s.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(s,this.tokens.links))s=s.substring(n.raw.length),(e=t[t.length-1])&&"text"===n.type&&"text"===e.type?(e.raw+=n.raw,e.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(s,i,o))s=s.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(s))s=s.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(s))s=s.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(s))s=s.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(s))s=s.substring(n.raw.length),t.push(n);else if(!this.state.inLink&&(n=this.tokenizer.url(s)))s=s.substring(n.raw.length),t.push(n);else{if(r=s,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const p=s.slice(1);let n;this.options.extensions.startInline.forEach(e=>{"number"==typeof(n=e.call({lexer:this},p))&&0<=n&&(t=Math.min(t,n))}),t<1/0&&0<=t&&(r=s.substring(0,t+1))}if(n=this.tokenizer.inlineText(r))s=s.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(o=n.raw.slice(-1)),a=!0,(e=t[t.length-1])&&"text"===e.type?(e.raw+=n.raw,e.text+=n.text):t.push(n);else if(s){var c="Infinite loop on byte: "+s.charCodeAt(0);if(this.options.silent){console.error(c);break}throw new Error(c)}}return t}}class I{options;parser;constructor(e){this.options=e||n.defaults}space(e){return""}code({text:e,lang:t,escaped:n}){t=(t||"").match(/^\S*/)?.[0],e=e.replace(/\n$/,"")+"\n";return t?'
'+(n?e:l(e,!0))+"
\n":"
"+(n?e:l(e,!0))+"
\n"}blockquote({tokens:e}){return`
${this.parser.parse(e)}
`}html({text:e}){return e}heading({tokens:e,depth:t}){return`${this.parser.parseInline(e)} `}hr(e){return"
\n"}list(t){var e=t.ordered,n=t.start;let s="";for(let e=0;e\n"+s+"\n"}listitem(e){let t="";var n;return e.task&&(n=this.checkbox({checked:!!e.checked}),e.loose?0${t+=this.parser.parse(e.tokens,!!e.loose)} `}checkbox({checked:e}){return"'}paragraph({tokens:e}){return`

${this.parser.parseInline(e)}

`}table(t){var e="";let n="";for(let e=0;e\n\n"+e+"\n"+(s=s&&`${s}`)+"\n"}tablerow({text:e}){return` ${e} `}tablecell(e){var 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`${e}`}br(e){return"
"}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:t,tokens:n}){var n=this.parser.parseInline(n),s=o(e);if(null===s)return n;let r='
"}image({href:e,title:t,text:n}){var s=o(e);if(null===s)return n;let r=`${n}{e=o[e].flat(1/0);n=n.concat(this.walkTokens(e,t))}):o.tokens&&(n=n.concat(this.walkTokens(o.tokens,t)))}}return n}use(...e){const w=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{const t={...e};if(t.async=this.defaults.async||t.async||!1,e.extensions&&(e.extensions.forEach(n=>{if(!n.name)throw new Error("extension name required");if("renderer"in n){const s=w.renderers[n.name];s?w.renderers[n.name]=function(...e){let t=n.renderer.apply(this,e);return t=!1===t?s.apply(this,e):t}:w.renderers[n.name]=n.renderer}if("tokenizer"in n){if(!n.level||"block"!==n.level&&"inline"!==n.level)throw new Error("extension level must be 'block' or 'inline'");const e=w[n.level];e?e.unshift(n.tokenizer):w[n.level]=[n.tokenizer],n.start&&("block"===n.level?w.startBlock?w.startBlock.push(n.start):w.startBlock=[n.start]:"inline"===n.level&&(w.startInline?w.startInline.push(n.start):w.startInline=[n.start]))}"childTokens"in n&&n.childTokens&&(w.childTokens[n.name]=n.childTokens)}),t.extensions=w),e.renderer){const i=this.defaults.renderer||new I(this.defaults);for(const l in e.renderer){if(!(l in i))throw new Error(`renderer '${l}' does not exist`);if(!["options","parser"].includes(l)){var n=l;const a=e.renderer[n],o=i[n];i[n]=(...e)=>{let t=a.apply(i,e);return(t=!1===t?o.apply(i,e):t)||""}}}t.renderer=i}if(e.tokenizer){const c=this.defaults.tokenizer||new m(this.defaults);for(const h in e.tokenizer){if(!(h in c))throw new Error(`tokenizer '${h}' does not exist`);if(!["options","rules","lexer"].includes(h)){var s=h;const p=e.tokenizer[s],u=c[s];c[s]=(...e)=>{let t=p.apply(c,e);return t=!1===t?u.apply(c,e):t}}}t.tokenizer=c}if(e.hooks){const k=this.defaults.hooks||new Z;for(const g in e.hooks){if(!(g in k))throw new Error(`hook '${g}' does not exist`);if(!["options","block"].includes(g)){var r=g;const f=e.hooks[r],d=k[r];Z.passThroughHooks.has(g)?k[r]=e=>{if(this.defaults.async)return Promise.resolve(f.call(k,e)).then(e=>d.call(k,e));e=f.call(k,e);return d.call(k,e)}:k[r]=(...e)=>{let t=f.apply(k,e);return t=!1===t?d.apply(k,e):t}}}t.hooks=k}if(e.walkTokens){const x=this.defaults.walkTokens,b=e.walkTokens;t.walkTokens=function(e){let t=[];return t.push(b.call(this,e)),t=x?t.concat(x.call(this,e)):t}}this.defaults={...this.defaults,...t}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return S.lex(e,t??this.defaults)}parser(e,t){return q.parse(e,t??this.defaults)}parseMarkdown(l){return(n,e)=>{e={...e};const s={...this.defaults,...e},t=this.onError(!!s.silent,!!s.async);if(!0===this.defaults.async&&!1===e.async)return t(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(null==n)return t(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof n)return t(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));s.hooks&&((s.hooks.options=s).hooks.block=l);const r=s.hooks?s.hooks.provideLexer():l?S.lex:S.lexInline,i=s.hooks?s.hooks.provideParser():l?q.parse:q.parseInline;if(s.async)return Promise.resolve(s.hooks?s.hooks.preprocess(n):n).then(e=>r(e,s)).then(e=>s.hooks?s.hooks.processAllTokens(e):e).then(e=>s.walkTokens?Promise.all(this.walkTokens(e,s.walkTokens)).then(()=>e):e).then(e=>i(e,s)).then(e=>s.hooks?s.hooks.postprocess(e):e).catch(t);try{s.hooks&&(n=s.hooks.preprocess(n));let e=r(n,s),t=(s.hooks&&(e=s.hooks.processAllTokens(e)),s.walkTokens&&this.walkTokens(e,s.walkTokens),i(e,s));return t=s.hooks?s.hooks.postprocess(t):t}catch(e){return t(e)}}}onError(n,s){return e=>{var t;if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",n)return t="

An error occurred:

"+l(e.message+"",!0)+"
",s?Promise.resolve(t):t;if(s)return Promise.reject(e);throw e}}}const P=new H;function L(e,t){return P.parse(e,t)}L.options=L.setOptions=function(e){return P.setOptions(e),t(L.defaults=P.defaults),L},L.getDefaults=e,L.defaults=n.defaults,L.use=function(...e){return P.use(...e),t(L.defaults=P.defaults),L},L.walkTokens=function(e,t){return P.walkTokens(e,t)},L.parseInline=P.parseInline,L.Parser=q,L.parser=q.parse,L.Renderer=I,L.TextRenderer=E,L.Lexer=S,L.lexer=S.lex,L.Tokenizer=m,L.Hooks=Z;z=(L.parse=L).options,R=L.setOptions,p=L.use,T=L.walkTokens,d=L.parseInline,w=L,c=q.parse,v=S.lex;n.Hooks=Z,n.Lexer=S,n.Marked=H,n.Parser=q,n.Renderer=I,n.TextRenderer=E,n.Tokenizer=m,n.getDefaults=e,n.lexer=v,n.marked=L,n.options=z,n.parse=w,n.parseInline=d,n.parser=c,n.setOptions=R,n.use=p,n.walkTokens=T});