@mathcrowd/mmarked 1.7.3 → 1.7.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -1,2 +1,2 @@
1
- import e from"crypto";import t from"buffer";import n from"highlight.js";import s from"highlight.js/lib/languages/javascript";import r from"highlight.js/lib/languages/python";import i from"highlight.js/lib/languages/latex";import o from"highlight.js/lib/languages/json";import{TeX as l}from"mathjax-full/js/input/tex.js";import{SVG as a}from"mathjax-full/js/output/svg.js";import{AllPackages as c}from"mathjax-full/js/input/tex/AllPackages.js";import{liteAdaptor as h}from"mathjax-full/js/adaptors/liteAdaptor.js";import{RegisterHTMLHandler as p}from"mathjax-full/js/handlers/html.js";import{mathjax as u}from"mathjax-full/js/mathjax.js";function f(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let g={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function k(e){g=e}const d=/[&<>"']/,x=new RegExp(d.source,"g"),m=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,b=new RegExp(m.source,"g"),w={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},y=e=>w[e];function $(e,t){if(t){if(d.test(e))return e.replace(x,y)}else if(m.test(e))return e.replace(b,y);return e}const v=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;const z=/(^|[^\[])\^/g;function A(e,t){let n="string"==typeof e?e:e.source;t=t||"";const s={replace:(e,t)=>{let r="string"==typeof t?t:t.source;return r=r.replace(z,"$1"),n=n.replace(e,r),s},getRegex:()=>new RegExp(n,t)};return s}function _(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return null}return e}const R={exec:()=>null};function T(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let s=!1,r=t;for(;--r>=0&&"\\"===n[r];)s=!s;return s?"|":" |"})).split(/ \|/);let s=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;s<n.length;s++)n[s]=n[s].trim().replace(/\\\|/g,"|");return n}function S(e,t,n){const s=e.length;if(0===s)return"";let r=0;for(;r<s;){const i=e.charAt(s-r-1);if(i!==t||n){if(i===t||!n)break;r++}else r++}return e.slice(0,s-r)}function E(e,t,n,s){const r=t.href,i=t.title?$(t.title):null,o=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){s.state.inLink=!0;const e={type:"link",raw:n,href:r,title:i,text:o,tokens:s.inlineTokens(o)};return s.state.inLink=!1,e}return{type:"image",raw:n,href:r,title:i,text:$(o)}}class I{options;rules;lexer;constructor(e){this.options=e||g}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:S(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const s=n[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=s.length?e.slice(s.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=S(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:S(t[0],"\n")}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let e=S(t[0],"\n").split("\n"),n="",s="";const r=[];for(;e.length>0;){let t=!1;const i=[];let o;for(o=0;o<e.length;o++)if(/^ {0,3}>/.test(e[o]))i.push(e[o]),t=!0;else{if(t)break;i.push(e[o])}e=e.slice(o);const l=i.join("\n"),a=l.replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,"\n $1").replace(/^ {0,3}>[ \t]?/gm,"");n=n?`${n}\n${l}`:l,s=s?`${s}\n${a}`:a;const c=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(a,r,!0),this.lexer.state.top=c,0===e.length)break;const h=r[r.length-1];if("code"===h?.type)break;if("blockquote"===h?.type){const t=h,i=t.raw+"\n"+e.join("\n"),o=this.blockquote(i);r[r.length-1]=o,n=n.substring(0,n.length-t.raw.length)+o.raw,s=s.substring(0,s.length-t.text.length)+o.text;break}if("list"!==h?.type);else{const t=h,i=t.raw+"\n"+e.join("\n"),o=this.list(i);r[r.length-1]=o,n=n.substring(0,n.length-h.raw.length)+o.raw,s=s.substring(0,s.length-t.raw.length)+o.raw,e=i.substring(r[r.length-1].raw.length).split("\n")}}return{type:"blockquote",raw:n,tokens:r,text:s}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const s=n.length>1,r={type:"list",raw:"",ordered:s,start:s?+n.slice(0,-1):"",loose:!1,items:[]};n=s?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=s?n:"[*+-]");const i=new RegExp(`^( {0,3}${n})((?:[\t ][^\\n]*)?(?:\\n|$))`);let o=!1;for(;e;){let n=!1,s="",l="";if(!(t=i.exec(e)))break;if(this.rules.block.hr.test(e))break;s=t[0],e=e.substring(s.length);let a=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),c=e.split("\n",1)[0],h=!a.trim(),p=0;if(this.options.pedantic?(p=2,l=a.trimStart()):h?p=t[1].length+1:(p=t[2].search(/[^ ]/),p=p>4?1:p,l=a.slice(p),p+=t[1].length),h&&/^ *$/.test(c)&&(s+=c+"\n",e=e.substring(c.length+1),n=!0),!n){const t=new RegExp(`^ {0,${Math.min(3,p-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),n=new RegExp(`^ {0,${Math.min(3,p-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),r=new RegExp(`^ {0,${Math.min(3,p-1)}}(?:\`\`\`|~~~)`),i=new RegExp(`^ {0,${Math.min(3,p-1)}}#`);for(;e;){const o=e.split("\n",1)[0];if(c=o,this.options.pedantic&&(c=c.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),r.test(c))break;if(i.test(c))break;if(t.test(c))break;if(n.test(e))break;if(c.search(/[^ ]/)>=p||!c.trim())l+="\n"+c.slice(p);else{if(h)break;if(a.search(/[^ ]/)>=4)break;if(r.test(a))break;if(i.test(a))break;if(n.test(a))break;l+="\n"+c}h||c.trim()||(h=!0),s+=o+"\n",e=e.substring(o.length+1),a=c.slice(p)}}r.loose||(o?r.loose=!0:/\n *\n *$/.test(s)&&(o=!0));let u,f=null;this.options.gfm&&(f=/^\[[ xX]\] /.exec(l),f&&(u="[ ] "!==f[0],l=l.replace(/^\[[ xX]\] +/,""))),r.items.push({type:"list_item",raw:s,task:!!f,checked:u,loose:!1,text:l,tokens:[]}),r.raw+=s}r.items[r.items.length-1].raw=r.items[r.items.length-1].raw.trimEnd(),r.items[r.items.length-1].text=r.items[r.items.length-1].text.trimEnd(),r.raw=r.raw.trimEnd();for(let e=0;e<r.items.length;e++)if(this.lexer.state.top=!1,r.items[e].tokens=this.lexer.blockTokens(r.items[e].text,[]),!r.loose){const t=r.items[e].tokens.filter((e=>"space"===e.type)),n=t.length>0&&t.some((e=>/\n.*\n/.test(e.raw)));r.loose=n}if(r.loose)for(let e=0;e<r.items.length;e++)r.items[e].loose=!0;return r}}html(e){const t=this.rules.block.html.exec(e);if(t){return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}}def(e){const t=this.rules.block.def.exec(e);if(t){const e=t[1].toLowerCase().replace(/\s+/g," "),n=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:s}}}table(e){const t=this.rules.block.table.exec(e);if(!t)return;if(!/[:|]/.test(t[2]))return;const n=T(t[1]),s=t[2].replace(/^\||\| *$/g,"").split("|"),r=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[],i={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===s.length){for(const e of s)/^ *-+: *$/.test(e)?i.align.push("right"):/^ *:-+: *$/.test(e)?i.align.push("center"):/^ *:-+ *$/.test(e)?i.align.push("left"):i.align.push(null);for(let e=0;e<n.length;e++)i.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:i.align[e]});for(const e of r)i.rows.push(T(e,i.header.length).map(((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:i.align[t]}))));return i}}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){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:$(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.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){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;const t=S(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let s=0;s<e.length;s++)if("\\"===e[s])s++;else if(e[s]===t[0])n++;else if(e[s]===t[1]&&(n--,n<0))return s;return-1}(t[2],"()");if(e>-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],s="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],s=e[3])}else s=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^</.test(n)&&(n=this.options.pedantic&&!/>$/.test(e)?n.slice(1):n.slice(1,-1)),E(t,{href:n?n.replace(this.rules.inline.anyPunctuation,"$1"):n,title:s?s.replace(this.rules.inline.anyPunctuation,"$1"):s},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const e=t[(n[2]||n[1]).replace(/\s+/g," ").toLowerCase()];if(!e){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return E(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let s=this.rules.inline.emStrongLDelim.exec(e);if(!s)return;if(s[3]&&n.match(/[\p{L}\p{N}]/u))return;if(!(s[1]||s[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const n=[...s[0]].length-1;let r,i,o=n,l=0;const a="*"===s[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(a.lastIndex=0,t=t.slice(-1*e.length+n);null!=(s=a.exec(t));){if(r=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!r)continue;if(i=[...r].length,s[3]||s[4]){o+=i;continue}if((s[5]||s[6])&&n%3&&!((n+i)%3)){l+=i;continue}if(o-=i,o>0)continue;i=Math.min(i,i+o+l);const t=[...s[0]][0].length,a=e.slice(0,n+s.index+t+i);if(Math.min(n,i)%2){const e=a.slice(1,-1);return{type:"em",raw:a,text:e,tokens:this.lexer.inlineTokens(e)}}const c=a.slice(2,-2);return{type:"strong",raw:a,text:c,tokens:this.lexer.inlineTokens(c)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),s=/^ /.test(e)&&/ $/.test(e);return n&&s&&(e=e.substring(1,e.length-1)),e=$(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=$(t[1]),n="mailto:"+e):(e=$(t[1]),n=e),{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if("@"===t[2])e=$(t[0]),n="mailto:"+e;else{let s;do{s=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??""}while(s!==t[0]);e=$(t[0]),n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let e;return e=this.lexer.state.inRawBlock?t[0]:$(t[0]),{type:"text",raw:t[0],text:e}}}}const j=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,O=/(?:[*+-]|\d{1,9}[.)])/,L=A(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,O).replace(/blockCode/g,/ {4}/).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(),M=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,B=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Z=A(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",B).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),D=A(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,O).getRegex(),q="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",P=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,N=A("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",P).replace("tag",q).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),C=A(M).replace("hr",j).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","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",q).getRegex(),Q={blockquote:A(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",C).getRegex(),code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,def:Z,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:j,html:N,lheading:L,list:D,newline:/^(?: *(?:\n|$))+/,paragraph:C,table:R,text:/^[^\n]+/},U=A("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",j).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",q).getRegex(),F={...Q,table:U,paragraph:A(M).replace("hr",j).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",U).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",q).getRegex()},J={...Q,html:A("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",P).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:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:R,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:A(M).replace("hr",j).replace("heading"," *#{1,6} *[^\n]").replace("lheading",L).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},H=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,W=/^( {2,}|\\)\n(?!\s*$)/,X="\\p{P}\\p{S}",K=A(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,X).getRegex(),V=A(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,X).getRegex(),Y=A("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,X).getRegex(),G=A("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,X).getRegex(),ee=A(/\\([punct])/,"gu").replace(/punct/g,X).getRegex(),te=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(),ne=A(P).replace("(?:--\x3e|$)","--\x3e").getRegex(),se=A("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",ne).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),re=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ie=A(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",re).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),oe=A(/^!?\[(label)\]\[(ref)\]/).replace("label",re).replace("ref",B).getRegex(),le=A(/^!?\[(ref)\](?:\[\])?/).replace("ref",B).getRegex(),ae={_backpedal:R,anyPunctuation:ee,autolink:te,blockSkip:/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,br:W,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:R,emStrongLDelim:V,emStrongRDelimAst:Y,emStrongRDelimUnd:G,escape:H,link:ie,nolink:le,punctuation:K,reflink:oe,reflinkSearch:A("reflink|nolink(?!\\()","g").replace("reflink",oe).replace("nolink",le).getRegex(),tag:se,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:R},ce={...ae,link:A(/^!?\[(label)\]\((.*?)\)/).replace("label",re).getRegex(),reflink:A(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",re).getRegex()},he={...ae,escape:A(H).replace("])","~|])").getRegex(),url:A(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},pe={...he,br:A(W).replace("{2,}","*").getRegex(),text:A(he.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},ue={normal:Q,gfm:F,pedantic:J},fe={normal:ae,gfm:he,breaks:pe,pedantic:ce};class ge{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||g,this.options.tokenizer=this.options.tokenizer||new I,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:ue.normal,inline:fe.normal};this.options.pedantic?(t.block=ue.pedantic,t.inline=fe.pedantic):this.options.gfm&&(t.block=ue.gfm,this.options.breaks?t.inline=fe.breaks:t.inline=fe.gfm),this.tokenizer.rules=t}static get rules(){return{block:ue,inline:fe}}static lex(e,t){return new ge(t).lex(e)}static lexInline(e,t){return new ge(t).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,"\n"),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){const t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){let s,r,i;for(e=this.options.pedantic?e.replace(/\t/g," ").replace(/^ +$/gm,""):e.replace(/^( *)(\t+)/gm,((e,t,n)=>t+" ".repeat(n.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((n=>!!(s=n.call({lexer:this},e,t))&&(e=e.substring(s.raw.length),t.push(s),!0)))))if(s=this.tokenizer.space(e))e=e.substring(s.raw.length),1===s.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(s);else if(s=this.tokenizer.code(e))e=e.substring(s.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?t.push(s):(r.raw+="\n"+s.raw,r.text+="\n"+s.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(s=this.tokenizer.fences(e))e=e.substring(s.raw.length),t.push(s);else if(s=this.tokenizer.heading(e))e=e.substring(s.raw.length),t.push(s);else if(s=this.tokenizer.hr(e))e=e.substring(s.raw.length),t.push(s);else if(s=this.tokenizer.blockquote(e))e=e.substring(s.raw.length),t.push(s);else if(s=this.tokenizer.list(e))e=e.substring(s.raw.length),t.push(s);else if(s=this.tokenizer.html(e))e=e.substring(s.raw.length),t.push(s);else if(s=this.tokenizer.def(e))e=e.substring(s.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?this.tokens.links[s.tag]||(this.tokens.links[s.tag]={href:s.href,title:s.title}):(r.raw+="\n"+s.raw,r.text+="\n"+s.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(s=this.tokenizer.table(e))e=e.substring(s.raw.length),t.push(s);else if(s=this.tokenizer.lheading(e))e=e.substring(s.raw.length),t.push(s);else{if(i=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let s;this.options.extensions.startBlock.forEach((e=>{s=e.call({lexer:this},n),"number"==typeof s&&s>=0&&(t=Math.min(t,s))})),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(this.state.top&&(s=this.tokenizer.paragraph(i)))r=t[t.length-1],n&&"paragraph"===r?.type?(r.raw+="\n"+s.raw,r.text+="\n"+s.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(s),n=i.length!==e.length,e=e.substring(s.raw.length);else if(s=this.tokenizer.text(e))e=e.substring(s.raw.length),r=t[t.length-1],r&&"text"===r.type?(r.raw+="\n"+s.raw,r.text+="\n"+s.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(s);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent)break;throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,s,r,i,o,l,a=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(i=this.tokenizer.rules.inline.reflinkSearch.exec(a));)e.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(i=this.tokenizer.rules.inline.blockSkip.exec(a));)a=a.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(i=this.tokenizer.rules.inline.anyPunctuation.exec(a));)a=a.slice(0,i.index)+"++"+a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(o||(l=""),o=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((s=>!!(n=s.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),s=t[t.length-1],s&&"text"===n.type&&"text"===s.type?(s.raw+=n.raw,s.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),s=t[t.length-1],s&&"text"===n.type&&"text"===s.type?(s.raw+=n.raw,s.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,a,l))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e))){if(r=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let s;this.options.extensions.startInline.forEach((e=>{s=e.call({lexer:this},n),"number"==typeof s&&s>=0&&(t=Math.min(t,s))})),t<1/0&&t>=0&&(r=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(r))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(l=n.raw.slice(-1)),o=!0,s=t[t.length-1],s&&"text"===s.type?(s.raw+=n.raw,s.text+=n.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent)break;throw new Error(t)}}else e=e.substring(n.raw.length),t.push(n);return t}}class ke{options;parser;constructor(e){this.options=e||g}space(e){return""}code({text:e,lang:t,escaped:n}){const s=(t||"").match(/^\S*/)?.[0],r=e.replace(/\n$/,"")+"\n";return s?'<pre><code class="language-'+$(s)+'">'+(n?r:$(r,!0))+"</code></pre>\n":"<pre><code>"+(n?r:$(r,!0))+"</code></pre>\n"}blockquote({tokens:e}){return`<blockquote>\n${this.parser.parse(e)}</blockquote>\n`}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>\n`}hr(e){return"<hr>\n"}list(e){const t=e.ordered,n=e.start;let s="";for(let t=0;t<e.items.length;t++){const n=e.items[t];s+=this.listitem(n)}const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+s+"</"+r+">\n"}listitem(e){let t="";if(e.task){const n=this.checkbox({checked:!!e.checked});e.loose?e.tokens.length>0&&"paragraph"===e.tokens[0].type?(e.tokens[0].text=n+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&"text"===e.tokens[0].tokens[0].type&&(e.tokens[0].tokens[0].text=n+" "+e.tokens[0].tokens[0].text)):e.tokens.unshift({type:"text",raw:n+" ",text:n+" "}):t+=n+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>\n`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>\n`}table(e){let t="",n="";for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let s="";for(let t=0;t<e.rows.length;t++){const r=e.rows[t];n="";for(let e=0;e<r.length;e++)n+=this.tablecell(r[e]);s+=this.tablerow({text:n})}return s&&(s=`<tbody>${s}</tbody>`),"<table>\n<thead>\n"+t+"</thead>\n"+s+"</table>\n"}tablerow({text:e}){return`<tr>\n${e}</tr>\n`}tablecell(e){const t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>\n`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${e}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){const s=this.parser.parseInline(n),r=_(e);if(null===r)return s;let i='<a href="'+(e=r)+'"';return t&&(i+=' title="'+t+'"'),i+=">"+s+"</a>",i}image({href:e,title:t,text:n}){const s=_(e);if(null===s)return n;let r=`<img src="${e=s}" alt="${n}"`;return t&&(r+=` title="${t}"`),r+=">",r}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):e.text}}class de{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}}class xe{options;renderer;textRenderer;constructor(e){this.options=e||g,this.options.renderer=this.options.renderer||new ke,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new de}static parse(e,t){return new xe(t).parse(e)}static parseInline(e,t){return new xe(t).parseInline(e)}parse(e,t=!0){let n="";for(let s=0;s<e.length;s++){const r=e[s];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[r.type]){const e=r,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(!1!==t||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(e.type)){n+=t||"";continue}}const i=r;switch(i.type){case"space":n+=this.renderer.space(i);continue;case"hr":n+=this.renderer.hr(i);continue;case"heading":n+=this.renderer.heading(i);continue;case"code":n+=this.renderer.code(i);continue;case"table":n+=this.renderer.table(i);continue;case"blockquote":n+=this.renderer.blockquote(i);continue;case"list":n+=this.renderer.list(i);continue;case"html":n+=this.renderer.html(i);continue;case"paragraph":n+=this.renderer.paragraph(i);continue;case"text":{let r=i,o=this.renderer.text(r);for(;s+1<e.length&&"text"===e[s+1].type;)r=e[++s],o+="\n"+this.renderer.text(r);n+=t?this.renderer.paragraph({type:"paragraph",raw:o,text:o,tokens:[{type:"text",raw:o,text:o}]}):o;continue}default:{const e='Token with "'+i.type+'" type was not found.';if(this.options.silent)return"";throw new Error(e)}}}return n}parseInline(e,t){t=t||this.renderer;let n="";for(let s=0;s<e.length;s++){const r=e[s];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[r.type]){const e=this.options.extensions.renderers[r.type].call({parser:this},r);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(r.type)){n+=e||"";continue}}const i=r;switch(i.type){case"escape":case"text":n+=t.text(i);break;case"html":n+=t.html(i);break;case"link":n+=t.link(i);break;case"image":n+=t.image(i);break;case"strong":n+=t.strong(i);break;case"em":n+=t.em(i);break;case"codespan":n+=t.codespan(i);break;case"br":n+=t.br(i);break;case"del":n+=t.del(i);break;default:{const e='Token with "'+i.type+'" type was not found.';if(this.options.silent)return"";throw new Error(e)}}}return n}}class me{options;constructor(e){this.options=e||g}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}}class be{defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};options=this.setOptions;parse=this.#e(ge.lex,xe.parse);parseInline=this.#e(ge.lexInline,xe.parseInline);Parser=xe;Renderer=ke;TextRenderer=de;Lexer=ge;Tokenizer=I;Hooks=me;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(const s of e)switch(n=n.concat(t.call(this,s)),s.type){case"table":{const e=s;for(const s of e.header)n=n.concat(this.walkTokens(s.tokens,t));for(const s of e.rows)for(const e of s)n=n.concat(this.walkTokens(e.tokens,t));break}case"list":{const e=s;n=n.concat(this.walkTokens(e.items,t));break}default:{const e=s;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach((s=>{const r=e[s].flat(1/0);n=n.concat(this.walkTokens(r,t))})):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach((e=>{const n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let s=e.renderer.apply(this,t);return!1===s&&(s=n.apply(this,t)),s}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");const n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){const t=this.defaults.renderer||new ke(this.defaults);for(const n in e.renderer){if(!(n in t))throw new Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;const s=n;let r=e.renderer[s];const i=t[s];t[s]=(...n)=>{e.useNewRenderer||(r=this.#t(r,s,t));let o=r.apply(t,n);return!1===o&&(o=i.apply(t,n)),o||""}}n.renderer=t}if(e.tokenizer){const t=this.defaults.tokenizer||new I(this.defaults);for(const n in e.tokenizer){if(!(n in t))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;const s=n,r=e.tokenizer[s],i=t[s];t[s]=(...e)=>{let n=r.apply(t,e);return!1===n&&(n=i.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){const t=this.defaults.hooks||new me;for(const n in e.hooks){if(!(n in t))throw new Error(`hook '${n}' does not exist`);if("options"===n)continue;const s=n,r=e.hooks[s],i=t[s];me.passThroughHooks.has(n)?t[s]=e=>{if(this.defaults.async)return Promise.resolve(r.call(t,e)).then((e=>i.call(t,e)));const n=r.call(t,e);return i.call(t,n)}:t[s]=(...e)=>{let n=r.apply(t,e);return!1===n&&(n=i.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){const t=this.defaults.walkTokens,s=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(s.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}})),this}#t(e,t,n){switch(t){case"heading":return function(s){return s.type&&s.type===t?e.call(this,n.parser.parseInline(s.tokens),s.depth,function(e){return e.replace(v,((e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}(n.parser.parseInline(s.tokens,n.parser.textRenderer))):e.apply(this,arguments)};case"code":return function(n){return n.type&&n.type===t?e.call(this,n.text,n.lang,!!n.escaped):e.apply(this,arguments)};case"table":return function(n){if(!n.type||n.type!==t)return e.apply(this,arguments);let s="",r="";for(let e=0;e<n.header.length;e++)r+=this.tablecell({text:n.header[e].text,tokens:n.header[e].tokens,header:!0,align:n.align[e]});s+=this.tablerow({text:r});let i="";for(let e=0;e<n.rows.length;e++){const t=n.rows[e];r="";for(let e=0;e<t.length;e++)r+=this.tablecell({text:t[e].text,tokens:t[e].tokens,header:!1,align:n.align[e]});i+=this.tablerow({text:r})}return e.call(this,s,i)};case"blockquote":return function(n){if(!n.type||n.type!==t)return e.apply(this,arguments);const s=this.parser.parse(n.tokens);return e.call(this,s)};case"list":return function(n){if(!n.type||n.type!==t)return e.apply(this,arguments);const s=n.ordered,r=n.start,i=n.loose;let o="";for(let e=0;e<n.items.length;e++){const t=n.items[e],s=t.checked,r=t.task;let l="";if(t.task){const e=this.checkbox({checked:!!s});i?t.tokens.length>0&&"paragraph"===t.tokens[0].type?(t.tokens[0].text=e+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&"text"===t.tokens[0].tokens[0].type&&(t.tokens[0].tokens[0].text=e+" "+t.tokens[0].tokens[0].text)):t.tokens.unshift({type:"text",text:e+" "}):l+=e+" "}l+=this.parser.parse(t.tokens,i),o+=this.listitem({type:"list_item",raw:l,text:l,task:r,checked:!!s,loose:i,tokens:t.tokens})}return e.call(this,o,s,r)};case"html":return function(n){return n.type&&n.type===t?e.call(this,n.text,n.block):e.apply(this,arguments)};case"paragraph":case"strong":case"em":case"del":return function(n){return n.type&&n.type===t?e.call(this,this.parser.parseInline(n.tokens)):e.apply(this,arguments)};case"escape":case"codespan":case"text":return function(n){return n.type&&n.type===t?e.call(this,n.text):e.apply(this,arguments)};case"link":return function(n){return n.type&&n.type===t?e.call(this,n.href,n.title,this.parser.parseInline(n.tokens)):e.apply(this,arguments)};case"image":return function(n){return n.type&&n.type===t?e.call(this,n.href,n.title,n.text):e.apply(this,arguments)}}return e}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return ge.lex(e,t??this.defaults)}parser(e,t){return xe.parse(e,t??this.defaults)}#e(e,t){return(n,s)=>{const r={...s},i={...this.defaults,...r};!0===this.defaults.async&&!1===r.async&&(i.silent,i.async=!0);const o=this.#n(!!i.silent,!!i.async);if(null==n)return o(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof n)return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(i.hooks&&(i.hooks.options=i),i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(n):n).then((t=>e(t,i))).then((e=>i.hooks?i.hooks.processAllTokens(e):e)).then((e=>i.walkTokens?Promise.all(this.walkTokens(e,i.walkTokens)).then((()=>e)):e)).then((e=>t(e,i))).then((e=>i.hooks?i.hooks.postprocess(e):e)).catch(o);try{i.hooks&&(n=i.hooks.preprocess(n));let s=e(n,i);i.hooks&&(s=i.hooks.processAllTokens(s)),i.walkTokens&&this.walkTokens(s,i.walkTokens);let r=t(s,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return o(e)}}}#n(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="<p>An error occurred:</p><pre>"+$(n.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}}const we=new be;function ye(e,t){return we.parse(e,t)}function $e(e){return e.replace(/\s*<\s*/g," \\lt ").replace(/\s*>\s*/g," \\gt ")}ye.options=ye.setOptions=function(e){return we.setOptions(e),ye.defaults=we.defaults,k(ye.defaults),ye},ye.getDefaults=f,ye.defaults=g,ye.use=function(...e){return we.use(...e),ye.defaults=we.defaults,k(ye.defaults),ye},ye.walkTokens=function(e,t){return we.walkTokens(e,t)},ye.parseInline=we.parseInline,ye.Parser=xe,ye.parser=xe.parse,ye.Renderer=ke,ye.TextRenderer=de,ye.Lexer=ge,ye.lexer=ge.lex,ye.Tokenizer=I,ye.Hooks=me,ye.parse=ye,ye.options,ye.setOptions,ye.use,ye.walkTokens,ye.parseInline,xe.parse,ge.lex;const ve={name:"inlineMath",level:"inline",start:e=>e.indexOf("$"),tokenizer(e){const t=/^\$(?:[^$]|\\\$)+\$(?!\$)/.exec(e);if(t)return{type:"inlineMath",raw:t[0],text:t[0]}},renderer:e=>$e(e.text)},ze={name:"inlineMath2",level:"inline",start:e=>e.indexOf("\\("),tokenizer(e){const t=e.match(/^\\\(.*?\\\)/);if(t)return{type:"inlineMath2",raw:t[0],text:t[0]}},renderer:e=>$e(e.text)},Ae={name:"blockMath",level:"block",start:e=>e.indexOf("$$"),tokenizer(e){const t=e.match(/^\${2}(?:[^$]|\\\$|\$[^$])+\${2}(?!\$)/);if(t)return{type:"blockMath",raw:t[0],text:t[0].trim()}},renderer:e=>`<p class="paragraph">${$e(e.text)}</p>\n`},_e={name:"blockMath2",level:"block",start:e=>e.indexOf("\\["),tokenizer(e){const t=e.match(/^\\\[(?:[^$]|\\\$)+\\\]/);if(t)return{type:"blockMath2",raw:t[0],text:t[0].trim()}},renderer:e=>`<p class="paragraph">${$e(e.text)}</p>\n`};var Re,Te="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Se={exports:{}};Re=Se,function(){var n="input is invalid type",s="object"==typeof window,r=s?window:{};r.JS_MD5_NO_WINDOW&&(s=!1);var i=!s&&"object"==typeof self,o=!r.JS_MD5_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;o?r=Te:i&&(r=self);var l,a=!r.JS_MD5_NO_COMMON_JS&&Re.exports,c=!r.JS_MD5_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,h="0123456789abcdef".split(""),p=[128,32768,8388608,-2147483648],u=[0,8,16,24],f=["hex","array","digest","buffer","arrayBuffer","base64"],g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),k=[];if(c){var d=new ArrayBuffer(68);l=new Uint8Array(d),k=new Uint32Array(d)}var x=Array.isArray;!r.JS_MD5_NO_NODE_JS&&x||(x=function(e){return"[object Array]"===Object.prototype.toString.call(e)});var m=ArrayBuffer.isView;!c||!r.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW&&m||(m=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var b=function(e){var t=typeof e;if("string"===t)return[e,!0];if("object"!==t||null===e)throw new Error(n);if(c&&e.constructor===ArrayBuffer)return[new Uint8Array(e),!1];if(!x(e)&&!m(e))throw new Error(n);return[e,!1]},w=function(e){return function(t){return new v(!0).update(t)[e]()}},y=function(s){var i,o=e,l=t.Buffer;return i=l.from&&!r.JS_MD5_NO_BUFFER_FROM?l.from:function(e){return new l(e)},function(e){if("string"==typeof e)return o.createHash("md5").update(e,"utf8").digest("hex");if(null==e)throw new Error(n);return e.constructor===ArrayBuffer&&(e=new Uint8Array(e)),x(e)||m(e)||e.constructor===l?o.createHash("md5").update(i(e)).digest("hex"):s(e)}},$=function(e){return function(t,n){return new z(t,!0).update(n)[e]()}};function v(e){if(e)k[0]=k[16]=k[1]=k[2]=k[3]=k[4]=k[5]=k[6]=k[7]=k[8]=k[9]=k[10]=k[11]=k[12]=k[13]=k[14]=k[15]=0,this.blocks=k,this.buffer8=l;else if(c){var t=new ArrayBuffer(68);this.buffer8=new Uint8Array(t),this.blocks=new Uint32Array(t)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}function z(e,t){var n,s=b(e);if(e=s[0],s[1]){var r,i=[],o=e.length,l=0;for(n=0;n<o;++n)(r=e.charCodeAt(n))<128?i[l++]=r:r<2048?(i[l++]=192|r>>>6,i[l++]=128|63&r):r<55296||r>=57344?(i[l++]=224|r>>>12,i[l++]=128|r>>>6&63,i[l++]=128|63&r):(r=65536+((1023&r)<<10|1023&e.charCodeAt(++n)),i[l++]=240|r>>>18,i[l++]=128|r>>>12&63,i[l++]=128|r>>>6&63,i[l++]=128|63&r);e=i}e.length>64&&(e=new v(!0).update(e).array());var a=[],c=[];for(n=0;n<64;++n){var h=e[n]||0;a[n]=92^h,c[n]=54^h}v.call(this,t),this.update(c),this.oKeyPad=a,this.inner=!0,this.sharedMemory=t}v.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var t=b(e);e=t[0];for(var n,s,r=t[1],i=0,o=e.length,l=this.blocks,a=this.buffer8;i<o;){if(this.hashed&&(this.hashed=!1,l[0]=l[16],l[16]=l[1]=l[2]=l[3]=l[4]=l[5]=l[6]=l[7]=l[8]=l[9]=l[10]=l[11]=l[12]=l[13]=l[14]=l[15]=0),r)if(c)for(s=this.start;i<o&&s<64;++i)(n=e.charCodeAt(i))<128?a[s++]=n:n<2048?(a[s++]=192|n>>>6,a[s++]=128|63&n):n<55296||n>=57344?(a[s++]=224|n>>>12,a[s++]=128|n>>>6&63,a[s++]=128|63&n):(n=65536+((1023&n)<<10|1023&e.charCodeAt(++i)),a[s++]=240|n>>>18,a[s++]=128|n>>>12&63,a[s++]=128|n>>>6&63,a[s++]=128|63&n);else for(s=this.start;i<o&&s<64;++i)(n=e.charCodeAt(i))<128?l[s>>>2]|=n<<u[3&s++]:n<2048?(l[s>>>2]|=(192|n>>>6)<<u[3&s++],l[s>>>2]|=(128|63&n)<<u[3&s++]):n<55296||n>=57344?(l[s>>>2]|=(224|n>>>12)<<u[3&s++],l[s>>>2]|=(128|n>>>6&63)<<u[3&s++],l[s>>>2]|=(128|63&n)<<u[3&s++]):(n=65536+((1023&n)<<10|1023&e.charCodeAt(++i)),l[s>>>2]|=(240|n>>>18)<<u[3&s++],l[s>>>2]|=(128|n>>>12&63)<<u[3&s++],l[s>>>2]|=(128|n>>>6&63)<<u[3&s++],l[s>>>2]|=(128|63&n)<<u[3&s++]);else if(c)for(s=this.start;i<o&&s<64;++i)a[s++]=e[i];else for(s=this.start;i<o&&s<64;++i)l[s>>>2]|=e[i]<<u[3&s++];this.lastByteIndex=s,this.bytes+=s-this.start,s>=64?(this.start=s-64,this.hash(),this.hashed=!0):this.start=s}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this},v.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[t>>>2]|=p[3&t],t>=56&&(this.hashed||this.hash(),e[0]=e[16],e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.bytes<<3,e[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},v.prototype.hash=function(){var e,t,n,s,r,i,o=this.blocks;this.first?t=((t=((e=((e=o[0]-680876937)<<7|e>>>25)-271733879<<0)^(n=((n=(-271733879^(s=((s=(-1732584194^2004318071&e)+o[1]-117830708)<<12|s>>>20)+e<<0)&(-271733879^e))+o[2]-1126478375)<<17|n>>>15)+s<<0)&(s^e))+o[3]-1316259209)<<22|t>>>10)+n<<0:(e=this.h0,t=this.h1,n=this.h2,t=((t+=((e=((e+=((s=this.h3)^t&(n^s))+o[0]-680876936)<<7|e>>>25)+t<<0)^(n=((n+=(t^(s=((s+=(n^e&(t^n))+o[1]-389564586)<<12|s>>>20)+e<<0)&(e^t))+o[2]+606105819)<<17|n>>>15)+s<<0)&(s^e))+o[3]-1044525330)<<22|t>>>10)+n<<0),t=((t+=((e=((e+=(s^t&(n^s))+o[4]-176418897)<<7|e>>>25)+t<<0)^(n=((n+=(t^(s=((s+=(n^e&(t^n))+o[5]+1200080426)<<12|s>>>20)+e<<0)&(e^t))+o[6]-1473231341)<<17|n>>>15)+s<<0)&(s^e))+o[7]-45705983)<<22|t>>>10)+n<<0,t=((t+=((e=((e+=(s^t&(n^s))+o[8]+1770035416)<<7|e>>>25)+t<<0)^(n=((n+=(t^(s=((s+=(n^e&(t^n))+o[9]-1958414417)<<12|s>>>20)+e<<0)&(e^t))+o[10]-42063)<<17|n>>>15)+s<<0)&(s^e))+o[11]-1990404162)<<22|t>>>10)+n<<0,t=((t+=((e=((e+=(s^t&(n^s))+o[12]+1804603682)<<7|e>>>25)+t<<0)^(n=((n+=(t^(s=((s+=(n^e&(t^n))+o[13]-40341101)<<12|s>>>20)+e<<0)&(e^t))+o[14]-1502002290)<<17|n>>>15)+s<<0)&(s^e))+o[15]+1236535329)<<22|t>>>10)+n<<0,t=((t+=((s=((s+=(t^n&((e=((e+=(n^s&(t^n))+o[1]-165796510)<<5|e>>>27)+t<<0)^t))+o[6]-1069501632)<<9|s>>>23)+e<<0)^e&((n=((n+=(e^t&(s^e))+o[11]+643717713)<<14|n>>>18)+s<<0)^s))+o[0]-373897302)<<20|t>>>12)+n<<0,t=((t+=((s=((s+=(t^n&((e=((e+=(n^s&(t^n))+o[5]-701558691)<<5|e>>>27)+t<<0)^t))+o[10]+38016083)<<9|s>>>23)+e<<0)^e&((n=((n+=(e^t&(s^e))+o[15]-660478335)<<14|n>>>18)+s<<0)^s))+o[4]-405537848)<<20|t>>>12)+n<<0,t=((t+=((s=((s+=(t^n&((e=((e+=(n^s&(t^n))+o[9]+568446438)<<5|e>>>27)+t<<0)^t))+o[14]-1019803690)<<9|s>>>23)+e<<0)^e&((n=((n+=(e^t&(s^e))+o[3]-187363961)<<14|n>>>18)+s<<0)^s))+o[8]+1163531501)<<20|t>>>12)+n<<0,t=((t+=((s=((s+=(t^n&((e=((e+=(n^s&(t^n))+o[13]-1444681467)<<5|e>>>27)+t<<0)^t))+o[2]-51403784)<<9|s>>>23)+e<<0)^e&((n=((n+=(e^t&(s^e))+o[7]+1735328473)<<14|n>>>18)+s<<0)^s))+o[12]-1926607734)<<20|t>>>12)+n<<0,t=((t+=((i=(s=((s+=((r=t^n)^(e=((e+=(r^s)+o[5]-378558)<<4|e>>>28)+t<<0))+o[8]-2022574463)<<11|s>>>21)+e<<0)^e)^(n=((n+=(i^t)+o[11]+1839030562)<<16|n>>>16)+s<<0))+o[14]-35309556)<<23|t>>>9)+n<<0,t=((t+=((i=(s=((s+=((r=t^n)^(e=((e+=(r^s)+o[1]-1530992060)<<4|e>>>28)+t<<0))+o[4]+1272893353)<<11|s>>>21)+e<<0)^e)^(n=((n+=(i^t)+o[7]-155497632)<<16|n>>>16)+s<<0))+o[10]-1094730640)<<23|t>>>9)+n<<0,t=((t+=((i=(s=((s+=((r=t^n)^(e=((e+=(r^s)+o[13]+681279174)<<4|e>>>28)+t<<0))+o[0]-358537222)<<11|s>>>21)+e<<0)^e)^(n=((n+=(i^t)+o[3]-722521979)<<16|n>>>16)+s<<0))+o[6]+76029189)<<23|t>>>9)+n<<0,t=((t+=((i=(s=((s+=((r=t^n)^(e=((e+=(r^s)+o[9]-640364487)<<4|e>>>28)+t<<0))+o[12]-421815835)<<11|s>>>21)+e<<0)^e)^(n=((n+=(i^t)+o[15]+530742520)<<16|n>>>16)+s<<0))+o[2]-995338651)<<23|t>>>9)+n<<0,t=((t+=((s=((s+=(t^((e=((e+=(n^(t|~s))+o[0]-198630844)<<6|e>>>26)+t<<0)|~n))+o[7]+1126891415)<<10|s>>>22)+e<<0)^((n=((n+=(e^(s|~t))+o[14]-1416354905)<<15|n>>>17)+s<<0)|~e))+o[5]-57434055)<<21|t>>>11)+n<<0,t=((t+=((s=((s+=(t^((e=((e+=(n^(t|~s))+o[12]+1700485571)<<6|e>>>26)+t<<0)|~n))+o[3]-1894986606)<<10|s>>>22)+e<<0)^((n=((n+=(e^(s|~t))+o[10]-1051523)<<15|n>>>17)+s<<0)|~e))+o[1]-2054922799)<<21|t>>>11)+n<<0,t=((t+=((s=((s+=(t^((e=((e+=(n^(t|~s))+o[8]+1873313359)<<6|e>>>26)+t<<0)|~n))+o[15]-30611744)<<10|s>>>22)+e<<0)^((n=((n+=(e^(s|~t))+o[6]-1560198380)<<15|n>>>17)+s<<0)|~e))+o[13]+1309151649)<<21|t>>>11)+n<<0,t=((t+=((s=((s+=(t^((e=((e+=(n^(t|~s))+o[4]-145523070)<<6|e>>>26)+t<<0)|~n))+o[11]-1120210379)<<10|s>>>22)+e<<0)^((n=((n+=(e^(s|~t))+o[2]+718787259)<<15|n>>>17)+s<<0)|~e))+o[9]-343485551)<<21|t>>>11)+n<<0,this.first?(this.h0=e+1732584193<<0,this.h1=t-271733879<<0,this.h2=n-1732584194<<0,this.h3=s+271733878<<0,this.first=!1):(this.h0=this.h0+e<<0,this.h1=this.h1+t<<0,this.h2=this.h2+n<<0,this.h3=this.h3+s<<0)},v.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,s=this.h3;return h[e>>>4&15]+h[15&e]+h[e>>>12&15]+h[e>>>8&15]+h[e>>>20&15]+h[e>>>16&15]+h[e>>>28&15]+h[e>>>24&15]+h[t>>>4&15]+h[15&t]+h[t>>>12&15]+h[t>>>8&15]+h[t>>>20&15]+h[t>>>16&15]+h[t>>>28&15]+h[t>>>24&15]+h[n>>>4&15]+h[15&n]+h[n>>>12&15]+h[n>>>8&15]+h[n>>>20&15]+h[n>>>16&15]+h[n>>>28&15]+h[n>>>24&15]+h[s>>>4&15]+h[15&s]+h[s>>>12&15]+h[s>>>8&15]+h[s>>>20&15]+h[s>>>16&15]+h[s>>>28&15]+h[s>>>24&15]},v.prototype.toString=v.prototype.hex,v.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,s=this.h3;return[255&e,e>>>8&255,e>>>16&255,e>>>24&255,255&t,t>>>8&255,t>>>16&255,t>>>24&255,255&n,n>>>8&255,n>>>16&255,n>>>24&255,255&s,s>>>8&255,s>>>16&255,s>>>24&255]},v.prototype.array=v.prototype.digest,v.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(16),t=new Uint32Array(e);return t[0]=this.h0,t[1]=this.h1,t[2]=this.h2,t[3]=this.h3,e},v.prototype.buffer=v.prototype.arrayBuffer,v.prototype.base64=function(){for(var e,t,n,s="",r=this.array(),i=0;i<15;)e=r[i++],t=r[i++],n=r[i++],s+=g[e>>>2]+g[63&(e<<4|t>>>4)]+g[63&(t<<2|n>>>6)]+g[63&n];return e=r[i],s+=g[e>>>2]+g[e<<4&63]+"=="},z.prototype=new v,z.prototype.finalize=function(){if(v.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();v.call(this,this.sharedMemory),this.update(this.oKeyPad),this.update(e),v.prototype.finalize.call(this)}};var A=function(){var e=w("hex");o&&(e=y(e)),e.create=function(){return new v},e.update=function(t){return e.create().update(t)};for(var t=0;t<f.length;++t){var n=f[t];e[n]=w(n)}return e}();A.md5=A,A.md5.hmac=function(){var e=$("hex");e.create=function(e){return new z(e)},e.update=function(t,n){return e.create(t).update(n)};for(var t=0;t<f.length;++t){var n=f[t];e[n]=$(n)}return e}(),a?Re.exports=A:r.md5=A}();var Ee=Se.exports;function Ie(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return null}return e}const je={exec:()=>null},Oe=e=>/^[a-z][\w-]*$/i.test(e)?e:"c"+Ee.md5(e);function Le(e){const t=e.match(/^(.*?)(?:\s*=(\d*)(?:x(\d+))?)?$/);if(t){const e=t[1].trim(),n=t[2]?parseInt(t[2],10):null,s=t[3]?parseInt(t[3],10):null;return{text:0===e.length?null:e,width:n,height:s}}return{text:null,width:null,height:null}}const Me=e=>(e.tokenizer.rules.inline.br=je,e.tokenizer.rules.inline.emStrongLDelim=/^\*+(?:([!"#$%&'()+\-.,/:;<=>?@[\]`{|}~_])|[^\s*])/,e),Be={paragraph({tokens:e}){if(1===e.length&&"image"===e[0].type){const t=e[0];if(null===Ie(t.href))return t.text;let n="<figure>";if(n+=De(t),t.title){const{text:e}=Le(t.title);e&&(n+=`<figcaption>${e}</figcaption>`)}return n+="</figure>",n}return`<p class="paragraph">${this.parser.parseInline(e)}</p>\n`},list(e){const t=e.ordered,n=e.start;let s="";for(let t=0;t<e.items.length;t++){const n=e.items[t];s+=this.listitem(n)}const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+' class="md-list">\n'+s+"</"+r+">\n"},listitem(e){let t="";return t+=this.parser.parse(e.tokens,!!e.loose),`<li class="md-list-item">${t}</li>\n`}},Ze={image:e=>De(e)},De=e=>{const t=Ie(e.href);if(null===t)return e.text;let n=`<img src="${t}" alt="${e.text}"`;if(e.title){const{text:t,width:s,height:r}=Le(e.title);t&&(n+=` title="${t}"`),(s||r)&&(n+=' style="',s&&(n+="width:"+s+"px;"),r&&(n+="height:"+r+"px;"),n+='"')}return n+=">",n},qe=e=>{const t=new Date,n=new be;n.use({extensions:[ve,ze]}),Me(new n.Lexer);const s=n.Lexer.lexInline(e,n.defaults);return{parsed:n.parseInline(e),lexed:s,time:(new Date).getTime()-t.getTime()}};function Pe(e){return(e||"").match(/\S*/)[0]}function Ne(e){return t=>{"string"==typeof t&&t!==e.text&&(e.escaped=!0,e.text=t)}}const Ce=/[&<>"']/,Qe=new RegExp(Ce.source,"g"),Ue=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Fe=new RegExp(Ue.source,"g"),Je={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},He=e=>Je[e];function We(e,t){if(t){if(Ce.test(e))return e.replace(Qe,He)}else if(Ue.test(e))return e.replace(Fe,He);return e}n.registerLanguage("javascript",s),n.registerLanguage("python",r),n.registerLanguage("latex",i),n.registerLanguage("json",o);const Xe=new be(function(e){if("function"==typeof e&&(e={highlight:e}),!e||"function"!=typeof e.highlight)throw new Error("Must provide highlight function");return"string"!=typeof e.langPrefix&&(e.langPrefix="language-"),{async:!!e.async,walkTokens(t){if("code"!==t.type)return;const n=Pe(t.lang);if(e.async)return Promise.resolve(e.highlight(t.text,n,t.lang||"")).then(Ne(t));const s=e.highlight(t.text,n,t.lang||"");if(s instanceof Promise)throw new Error("markedHighlight is not set to async but the highlight function is async. Set the async option to true on markedHighlight to await the async highlight function.");Ne(t)(s)},useNewRenderer:!0,renderer:{code(t,n,s){"object"==typeof t&&(s=t.escaped,n=t.lang,t=t.text);const r=Pe(n),i=r?` class="${e.langPrefix}${We(r)}"`:"";return t=t.replace(/\n$/,""),`<pre><code${i}>${s?t:We(t,!0)}\n</code></pre>`}}}}({highlight(e,t){const s=n.getLanguage(t)?t:"plaintext";return n.highlight(e,{language:s}).value}})),Ke={name:"footnoteRef",level:"inline",start:e=>e.indexOf("[^"),tokenizer:e=>{const t=/^\[\^([^\]]+)\]/.exec(e);if(t){const e=t[1].trim();return{type:"footnoteRef",raw:t[0],id:e,tokens:[]}}},renderer:e=>`<span class="footnote-ref" id="footnote-ref-${e.id}"><sup><a href="#footnote-${e.id}">[${e.number}]</a></sup></span>`},Ve={name:"footnoteDef",level:"block",start:e=>e.indexOf("[^"),tokenizer:e=>{const t=/^\[\^(.+?)\]: ([\s\S]*?)(?:\n+|$)/.exec(e);if(t){const e=t[1].trim(),n=t[2].trim();return{type:"footnoteDef",raw:t[0],id:e,text:n,tokens:[]}}},renderer:e=>`<li class="footnote-def" key="${e.number}" id="footnote-${e.id}">${Xe.parseInline(e.text)} <a href="#footnote-ref-${e.id}"> ⬅ </a></li>`},Ye=e=>{const t={};let n=1;return function e(s){s.forEach((s=>{"footnoteRef"===s.type&&(s.id in t||(t[s.id]=n,n++),s.number=t[s.id]),"list"===s.type&&s.items.forEach((t=>{t.tokens&&t.tokens.length>0&&e(t.tokens)})),s.tokens&&s.tokens.length>0&&e(s.tokens)}))}(e),function e(s){s.forEach((s=>{"footnoteDef"===s.type&&(s.id in t||(t[s.id]=n,n++),s.number=t[s.id]),s.tokens&&s.tokens.length>0&&e(s.tokens)}))}(e),e};var Ge;!function(e){e.Theorem="theorem",e.Lemma="lemma",e.Corollary="corollary",e.Axiom="axiom",e.Definition="definition",e.Example="example"}(Ge||(Ge={}));const et={[Ge.Theorem]:"定理",[Ge.Lemma]:"引理",[Ge.Corollary]:"推论",[Ge.Axiom]:"公理",[Ge.Definition]:"定义",[Ge.Example]:"例"},tt={name:"theoremLikeRef",level:"inline",start:e=>e.indexOf("[~"),tokenizer:e=>{const t=/^\[~([^\]]+)\]/.exec(e);if(t){const e=t[1].trim();return{type:"theoremLikeRef",raw:t[0],id:e,tokens:[]}}},renderer:e=>`<a id="theorem-like-ref-${e.id}" href="#theorem-like-${e.id}">${(e.typeName+" "+e.number).trimEnd()}</a>`},nt={name:"theoremLikeDef",level:"block",start:e=>e.indexOf("```["),tokenizer(e){var t,n,s,r,i,o;const l=/^ {0,3}(`{3,}(?=\[[^\n\]]*\](?:\n|$)))\[([^\],]*),([^\],]*)(?:,([^\],]+))?\]\n([\s\S]*?)(?:\n|$)(?: {0,3}\1 *(?=\n|$)|$)/.exec(e);if(l){const e=null===(t=l[2])||void 0===t?void 0:t.trim().replace(/\*$/,""),a=null===(n=l[2])||void 0===n?void 0:n.trim().endsWith("*"),c=null===(s=l[3])||void 0===s?void 0:s.trim(),h=null===(r=l[4])||void 0===r?void 0:r.trim(),p=null===(i=l[5])||void 0===i?void 0:i.trim();return{type:"theoremLikeDef",raw:l[0],id:c,name:h,text:p,ttype:e,typeName:null!==(o=et[e])&&void 0!==o?o:e,tokens:[],unnumbered:a}}},renderer:e=>`<section class="theorem-like ${Oe(e.ttype)}" id="theorem-like-${e.id}">\n <p class="title"><b>${e.typeName}</b>${e.unnumbered?"":" "+e.number}${e.name?" ( <em>"+e.name+"</em> )":""}\n </p>\n <section class="content">\n ${Xe.parse(e.text)}\n </section> \n</section>`};var st;!function(e){e.PROOF="proof",e.SOLUTION="solution"}(st||(st={}));const rt={[st.PROOF]:"证明",[st.SOLUTION]:"解答"},it={name:"solution",level:"block",start:e=>e.indexOf("~~~["),tokenizer:e=>{var t;const n=/^ {0,3}(~{3,}(?=\[[^\n\]]*\](?:\n|$)))\[([^\],]*)\]\n([\s\S]*?)(?:\n|$)(?: {0,3}\1~* *(?=\n|$)|$)/.exec(e);if(n){const e=n[2].trim(),s=n[3].trim();return{type:"solution",raw:n[0],stype:e,typeName:null!==(t=rt[e])&&void 0!==t?t:e,text:s,tokens:[]}}},renderer:e=>`<details class="solution ${Oe(e.stype)}"><summary>${e.typeName}</summary>\n <section class="content">\n ${Xe.parse(e.text)}\n </section></details>`};var ot;!function(e){e.Warn="warn",e.Success="success",e.Error="error",e.Info="info"}(ot||(ot={}));const lt={name:"alert",level:"block",start:e=>e.indexOf("!!!["),tokenizer(e){var t,n,s,r;const i=/^ {0,3}(!{3,}(?=\[[^\n\]]*\](?:\n|$)))\[([^\],]*)(?:,([^\],]*))?(?:,([^\],]+))?\]\n([\s\S]*?)(?:\n|$)(?: {0,3}\1 *(?=\n|$)|$)/.exec(e);if(i){const e=null===(t=i[2])||void 0===t?void 0:t.trim(),o=null===(n=i[3])||void 0===n?void 0:n.trim(),l=null===(s=i[4])||void 0===s?void 0:s.trim(),a=null===(r=i[5])||void 0===r?void 0:r.trim();return{type:"alert",raw:i[0],title:o,icon:l,text:a,ttype:e,tokens:[]}}},renderer(e){let t="";if("true"===e.icon)switch(e.ttype){case ot.Warn:e.icon='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1em 1em" width="1em" height="1em"><path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575ZM8 5a.75.75 0 0 0-.75.75v2.5a.75.75 0 0 0 1.5 0v-2.5A.75.75 0 0 0 8 5Zm1 6a1 1 0 1 0-2 0 1 1 0 0 0 2 0Z"></path></svg>';break;case ot.Success:e.icon='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1em 1em" width="1em" height="1em"><path d="M8 16A8 8 0 1 1 8 0a8 8 0 0 1 0 16Zm3.78-9.72a.751.751 0 0 0-.018-1.042.751.751 0 0 0-1.042-.018L6.75 9.19 5.28 7.72a.751.751 0 0 0-1.042.018.751.751 0 0 0-.018 1.042l2 2a.75.75 0 0 0 1.06 0Z"></path></svg>';break;case ot.Error:e.icon='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1em 1em" width="1em" height="1em"><path d="M2.343 13.657A8 8 0 1 1 13.658 2.343 8 8 0 0 1 2.343 13.657ZM6.03 4.97a.751.751 0 0 0-1.042.018.751.751 0 0 0-.018 1.042L6.94 8 4.97 9.97a.749.749 0 0 0 .326 1.275.749.749 0 0 0 .734-.215L8 9.06l1.97 1.97a.749.749 0 0 0 1.275-.326.749.749 0 0 0-.215-.734L9.06 8l1.97-1.97a.749.749 0 0 0-.326-1.275.749.749 0 0 0-.734.215L8 6.94Z"></path></svg>';break;case ot.Info:e.icon='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1em 1em" width="1em" height="1em"><path d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path></svg>'}const n=void 0!==e.icon?`<span class="icon">${e.icon}</span> `:"";return t+=`<section class="alert ${e.ttype}">`,e.title&&(t+=`<p class="heading">${n}<span class='title'>${e.title}</span></p>`),t+=`<p class="content paragraph">${e.title?"":n}${e.text}</p>`,t+="</section>",t}},at=e=>{const t={renderer:Object.assign(Object.assign({},Be),Ze),useNewRenderer:!0,gfm:!0,extensions:[ve,ze,Ae,_e,Ke,Ve,nt,tt,it,lt],hooks:{preprocess:e=>e,processAllTokens:e=>(e=>{const t={[Ge.Theorem]:0,[Ge.Lemma]:0,[Ge.Corollary]:0,[Ge.Axiom]:0,[Ge.Definition]:0,[Ge.Example]:0},n={};return function e(s){s.forEach((s=>{"theoremLikeDef"===s.type&&(s.ttype in t?t[s.ttype]=t[s.ttype]+1:t[s.ttype]=1,s.number=s.unnumbered?"":t[s.ttype],n[s.id]={typeName:s.typeName,number:s.number}),s.tokens&&s.tokens.length>0&&e(s.tokens)}))}(e),function e(t){t.forEach((t=>{"theoremLikeRef"===t.type&&t.id in n&&(t.number=n[t.id].number,t.typeName=n[t.id].typeName),"list"===t.type&&t.items.forEach((t=>{t.tokens&&t.tokens.length>0&&e(t.tokens)})),t.tokens&&t.tokens.length>0&&e(t.tokens)}))}(e),e})(Ye(e)),postprocess:e=>(e=>{const t=[];return e=e.replaceAll(/<li class="footnote-def" key="(\d+)".*?<\/li>/g,((e,n)=>(t.push({key:parseInt(n),content:e}),""))),t.sort(((e,t)=>e.key-t.key)),e=e.replaceAll(/<ol class="footnote-list">.*?<\/ol>/g,(()=>"")),t.length>0&&(e+=`<ol class="footnote-list">${t.map((e=>e.content)).join("")}</ol>`),e})(e)}};Xe.use(t);const n=new Date;var s;(s=Me(new Xe.Lexer)).tokenizer.rules.block.lheading=je,s.tokenizer.rules.block.code=je,s.tokenizer.rules.block.fences=/^ {0,3}(`{3,}(?=[^`\n[]*(?:\n|$)))([^\n]*)(?:\n|$)([\s\S]*?)(?:\n|$)(?: {0,3}\1`* *(?=\n|$)|$)/;const r=Ye(Xe.lexer(e));return{parsed:Xe.parse(e),lexed:r,time:(new Date).getTime()-n.getTime()}},ct=e=>{try{const t=h({fontSize:13});p(t);const n=new l({packages:c,inlineMath:[["$","$"],["\\(","\\)"]],displayMath:[["$$","$$"],["\\[","\\]"]],macros:{parallelogram:"\\unicode{x25B1}"}}),s=new a({fontCache:"none"}),r=u.document(e,{InputJax:n,OutputJax:s});return r.render(),t.innerHTML(t.body(r.document))}catch(t){return e}};export{at as renderMarkdown,qe as renderMarkdownCompact,ct as tex2svg};
1
+ import e from"crypto";import t from"buffer";import n from"highlight.js";import r from"highlight.js/lib/languages/javascript";import s from"highlight.js/lib/languages/python";import i from"highlight.js/lib/languages/latex";import o from"highlight.js/lib/languages/json";import{TeX as l}from"mathjax-full/js/input/tex.js";import{SVG as a}from"mathjax-full/js/output/svg.js";import{AllPackages as c}from"mathjax-full/js/input/tex/AllPackages.js";import{liteAdaptor as h}from"mathjax-full/js/adaptors/liteAdaptor.js";import{RegisterHTMLHandler as p}from"mathjax-full/js/handlers/html.js";import{mathjax as u}from"mathjax-full/js/mathjax.js";function f(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let g={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function k(e){g=e}const d=/[&<>"']/,x=new RegExp(d.source,"g"),m=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,b=new RegExp(m.source,"g"),y={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},w=e=>y[e];function $(e,t){if(t){if(d.test(e))return e.replace(x,w)}else if(m.test(e))return e.replace(b,w);return e}const z=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;const v=/(^|[^\[])\^/g;function _(e,t){let n="string"==typeof e?e:e.source;t=t||"";const r={replace:(e,t)=>{let s="string"==typeof t?t:t.source;return s=s.replace(v,"$1"),n=n.replace(e,s),r},getRegex:()=>new RegExp(n,t)};return r}function A(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return null}return e}const R={exec:()=>null};function T(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let r=!1,s=t;for(;--s>=0&&"\\"===n[s];)r=!r;return r?"|":" |"})).split(/ \|/);let r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,"|");return n}function S(e,t,n){const r=e.length;if(0===r)return"";let s=0;for(;s<r;){const i=e.charAt(r-s-1);if(i!==t||n){if(i===t||!n)break;s++}else s++}return e.slice(0,r-s)}function E(e,t,n,r){const s=t.href,i=t.title?$(t.title):null,o=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){r.state.inLink=!0;const e={type:"link",raw:n,href:s,title:i,text:o,tokens:r.inlineTokens(o)};return r.state.inLink=!1,e}return{type:"image",raw:n,href:s,title:i,text:$(o)}}class I{options;rules;lexer;constructor(e){this.options=e||g}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:S(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const r=n[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=r.length?e.slice(r.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=S(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:S(t[0],"\n")}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let e=S(t[0],"\n").split("\n"),n="",r="";const s=[];for(;e.length>0;){let t=!1;const i=[];let o;for(o=0;o<e.length;o++)if(/^ {0,3}>/.test(e[o]))i.push(e[o]),t=!0;else{if(t)break;i.push(e[o])}e=e.slice(o);const l=i.join("\n"),a=l.replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,"\n $1").replace(/^ {0,3}>[ \t]?/gm,"");n=n?`${n}\n${l}`:l,r=r?`${r}\n${a}`:a;const c=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(a,s,!0),this.lexer.state.top=c,0===e.length)break;const h=s[s.length-1];if("code"===h?.type)break;if("blockquote"===h?.type){const t=h,i=t.raw+"\n"+e.join("\n"),o=this.blockquote(i);s[s.length-1]=o,n=n.substring(0,n.length-t.raw.length)+o.raw,r=r.substring(0,r.length-t.text.length)+o.text;break}if("list"!==h?.type);else{const t=h,i=t.raw+"\n"+e.join("\n"),o=this.list(i);s[s.length-1]=o,n=n.substring(0,n.length-h.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=i.substring(s[s.length-1].raw.length).split("\n")}}return{type:"blockquote",raw:n,tokens:s,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const r=n.length>1,s={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");const i=new RegExp(`^( {0,3}${n})((?:[\t ][^\\n]*)?(?:\\n|$))`);let o=!1;for(;e;){let n=!1,r="",l="";if(!(t=i.exec(e)))break;if(this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let a=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),c=e.split("\n",1)[0],h=!a.trim(),p=0;if(this.options.pedantic?(p=2,l=a.trimStart()):h?p=t[1].length+1:(p=t[2].search(/[^ ]/),p=p>4?1:p,l=a.slice(p),p+=t[1].length),h&&/^ *$/.test(c)&&(r+=c+"\n",e=e.substring(c.length+1),n=!0),!n){const t=new RegExp(`^ {0,${Math.min(3,p-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),n=new RegExp(`^ {0,${Math.min(3,p-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),s=new RegExp(`^ {0,${Math.min(3,p-1)}}(?:\`\`\`|~~~)`),i=new RegExp(`^ {0,${Math.min(3,p-1)}}#`);for(;e;){const o=e.split("\n",1)[0];if(c=o,this.options.pedantic&&(c=c.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),s.test(c))break;if(i.test(c))break;if(t.test(c))break;if(n.test(e))break;if(c.search(/[^ ]/)>=p||!c.trim())l+="\n"+c.slice(p);else{if(h)break;if(a.search(/[^ ]/)>=4)break;if(s.test(a))break;if(i.test(a))break;if(n.test(a))break;l+="\n"+c}h||c.trim()||(h=!0),r+=o+"\n",e=e.substring(o.length+1),a=c.slice(p)}}s.loose||(o?s.loose=!0:/\n *\n *$/.test(r)&&(o=!0));let u,f=null;this.options.gfm&&(f=/^\[[ xX]\] /.exec(l),f&&(u="[ ] "!==f[0],l=l.replace(/^\[[ xX]\] +/,""))),s.items.push({type:"list_item",raw:r,task:!!f,checked:u,loose:!1,text:l,tokens:[]}),s.raw+=r}s.items[s.items.length-1].raw=s.items[s.items.length-1].raw.trimEnd(),s.items[s.items.length-1].text=s.items[s.items.length-1].text.trimEnd(),s.raw=s.raw.trimEnd();for(let e=0;e<s.items.length;e++)if(this.lexer.state.top=!1,s.items[e].tokens=this.lexer.blockTokens(s.items[e].text,[]),!s.loose){const t=s.items[e].tokens.filter((e=>"space"===e.type)),n=t.length>0&&t.some((e=>/\n.*\n/.test(e.raw)));s.loose=n}if(s.loose)for(let e=0;e<s.items.length;e++)s.items[e].loose=!0;return s}}html(e){const t=this.rules.block.html.exec(e);if(t){return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}}def(e){const t=this.rules.block.def.exec(e);if(t){const e=t[1].toLowerCase().replace(/\s+/g," "),n=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){const t=this.rules.block.table.exec(e);if(!t)return;if(!/[:|]/.test(t[2]))return;const n=T(t[1]),r=t[2].replace(/^\||\| *$/g,"").split("|"),s=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[],i={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(const e of r)/^ *-+: *$/.test(e)?i.align.push("right"):/^ *:-+: *$/.test(e)?i.align.push("center"):/^ *:-+ *$/.test(e)?i.align.push("left"):i.align.push(null);for(let e=0;e<n.length;e++)i.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:i.align[e]});for(const e of s)i.rows.push(T(e,i.header.length).map(((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:i.align[t]}))));return i}}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){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:$(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.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){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;const t=S(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let r=0;r<e.length;r++)if("\\"===e[r])r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return-1}(t[2],"()");if(e>-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^</.test(n)&&(n=this.options.pedantic&&!/>$/.test(e)?n.slice(1):n.slice(1,-1)),E(t,{href:n?n.replace(this.rules.inline.anyPunctuation,"$1"):n,title:r?r.replace(this.rules.inline.anyPunctuation,"$1"):r},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const e=t[(n[2]||n[1]).replace(/\s+/g," ").toLowerCase()];if(!e){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return E(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r)return;if(r[3]&&n.match(/[\p{L}\p{N}]/u))return;if(!(r[1]||r[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const n=[...r[0]].length-1;let s,i,o=n,l=0;const a="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(a.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=a.exec(t));){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s)continue;if(i=[...s].length,r[3]||r[4]){o+=i;continue}if((r[5]||r[6])&&n%3&&!((n+i)%3)){l+=i;continue}if(o-=i,o>0)continue;i=Math.min(i,i+o+l);const t=[...r[0]][0].length,a=e.slice(0,n+r.index+t+i);if(Math.min(n,i)%2){const e=a.slice(1,-1);return{type:"em",raw:a,text:e,tokens:this.lexer.inlineTokens(e)}}const c=a.slice(2,-2);return{type:"strong",raw:a,text:c,tokens:this.lexer.inlineTokens(c)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=$(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=$(t[1]),n="mailto:"+e):(e=$(t[1]),n=e),{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if("@"===t[2])e=$(t[0]),n="mailto:"+e;else{let r;do{r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??""}while(r!==t[0]);e=$(t[0]),n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let e;return e=this.lexer.state.inRawBlock?t[0]:$(t[0]),{type:"text",raw:t[0],text:e}}}}const j=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,O=/(?:[*+-]|\d{1,9}[.)])/,L=_(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,O).replace(/blockCode/g,/ {4}/).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(),B=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,M=/(?!\s*\])(?:\\.|[^\[\]\\])+/,D=_(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",M).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),q=_(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,O).getRegex(),P="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",N=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,C=_("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",N).replace("tag",P).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Z=_(B).replace("hr",j).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","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",P).getRegex(),Q={blockquote:_(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Z).getRegex(),code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,def:D,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:j,html:C,lheading:L,list:q,newline:/^(?: *(?:\n|$))+/,paragraph:Z,table:R,text:/^[^\n]+/},U=_("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",j).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",P).getRegex(),F={...Q,table:U,paragraph:_(B).replace("hr",j).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",U).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",P).getRegex()},J={...Q,html:_("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",N).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:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:R,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:_(B).replace("hr",j).replace("heading"," *#{1,6} *[^\n]").replace("lheading",L).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},H=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,W=/^( {2,}|\\)\n(?!\s*$)/,X="\\p{P}\\p{S}",K=_(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,X).getRegex(),V=_(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,X).getRegex(),Y=_("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,X).getRegex(),G=_("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,X).getRegex(),ee=_(/\\([punct])/,"gu").replace(/punct/g,X).getRegex(),te=_(/^<(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(),ne=_(N).replace("(?:--\x3e|$)","--\x3e").getRegex(),re=_("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",ne).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),se=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ie=_(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",se).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),oe=_(/^!?\[(label)\]\[(ref)\]/).replace("label",se).replace("ref",M).getRegex(),le=_(/^!?\[(ref)\](?:\[\])?/).replace("ref",M).getRegex(),ae={_backpedal:R,anyPunctuation:ee,autolink:te,blockSkip:/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,br:W,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:R,emStrongLDelim:V,emStrongRDelimAst:Y,emStrongRDelimUnd:G,escape:H,link:ie,nolink:le,punctuation:K,reflink:oe,reflinkSearch:_("reflink|nolink(?!\\()","g").replace("reflink",oe).replace("nolink",le).getRegex(),tag:re,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:R},ce={...ae,link:_(/^!?\[(label)\]\((.*?)\)/).replace("label",se).getRegex(),reflink:_(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",se).getRegex()},he={...ae,escape:_(H).replace("])","~|])").getRegex(),url:_(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},pe={...he,br:_(W).replace("{2,}","*").getRegex(),text:_(he.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},ue={normal:Q,gfm:F,pedantic:J},fe={normal:ae,gfm:he,breaks:pe,pedantic:ce};class ge{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||g,this.options.tokenizer=this.options.tokenizer||new I,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:ue.normal,inline:fe.normal};this.options.pedantic?(t.block=ue.pedantic,t.inline=fe.pedantic):this.options.gfm&&(t.block=ue.gfm,this.options.breaks?t.inline=fe.breaks:t.inline=fe.gfm),this.tokenizer.rules=t}static get rules(){return{block:ue,inline:fe}}static lex(e,t){return new ge(t).lex(e)}static lexInline(e,t){return new ge(t).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,"\n"),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){const t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){let r,s,i;for(e=this.options.pedantic?e.replace(/\t/g," ").replace(/^ +$/gm,""):e.replace(/^( *)(\t+)/gm,((e,t,n)=>t+" ".repeat(n.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((n=>!!(r=n.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0)))))if(r=this.tokenizer.space(e))e=e.substring(r.raw.length),1===r.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(r);else if(r=this.tokenizer.code(e))e=e.substring(r.raw.length),s=t[t.length-1],!s||"paragraph"!==s.type&&"text"!==s.type?t.push(r):(s.raw+="\n"+r.raw,s.text+="\n"+r.text,this.inlineQueue[this.inlineQueue.length-1].src=s.text);else if(r=this.tokenizer.fences(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.heading(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.hr(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.blockquote(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.list(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.html(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.def(e))e=e.substring(r.raw.length),s=t[t.length-1],!s||"paragraph"!==s.type&&"text"!==s.type?this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title}):(s.raw+="\n"+r.raw,s.text+="\n"+r.raw,this.inlineQueue[this.inlineQueue.length-1].src=s.text);else if(r=this.tokenizer.table(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.lheading(e))e=e.substring(r.raw.length),t.push(r);else{if(i=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach((e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i)))s=t[t.length-1],n&&"paragraph"===s?.type?(s.raw+="\n"+r.raw,s.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(r),n=i.length!==e.length,e=e.substring(r.raw.length);else if(r=this.tokenizer.text(e))e=e.substring(r.raw.length),s=t[t.length-1],s&&"text"===s.type?(s.raw+="\n"+r.raw,s.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(r);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent)break;throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,r,s,i,o,l,a=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(i=this.tokenizer.rules.inline.reflinkSearch.exec(a));)e.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(i=this.tokenizer.rules.inline.blockSkip.exec(a));)a=a.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(i=this.tokenizer.rules.inline.anyPunctuation.exec(a));)a=a.slice(0,i.index)+"++"+a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(o||(l=""),o=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,a,l))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e))){if(s=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach((e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(s))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(l=n.raw.slice(-1)),o=!0,r=t[t.length-1],r&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent)break;throw new Error(t)}}else e=e.substring(n.raw.length),t.push(n);return t}}class ke{options;parser;constructor(e){this.options=e||g}space(e){return""}code({text:e,lang:t,escaped:n}){const r=(t||"").match(/^\S*/)?.[0],s=e.replace(/\n$/,"")+"\n";return r?'<pre><code class="language-'+$(r)+'">'+(n?s:$(s,!0))+"</code></pre>\n":"<pre><code>"+(n?s:$(s,!0))+"</code></pre>\n"}blockquote({tokens:e}){return`<blockquote>\n${this.parser.parse(e)}</blockquote>\n`}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>\n`}hr(e){return"<hr>\n"}list(e){const t=e.ordered,n=e.start;let r="";for(let t=0;t<e.items.length;t++){const n=e.items[t];r+=this.listitem(n)}const s=t?"ol":"ul";return"<"+s+(t&&1!==n?' start="'+n+'"':"")+">\n"+r+"</"+s+">\n"}listitem(e){let t="";if(e.task){const n=this.checkbox({checked:!!e.checked});e.loose?e.tokens.length>0&&"paragraph"===e.tokens[0].type?(e.tokens[0].text=n+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&"text"===e.tokens[0].tokens[0].type&&(e.tokens[0].tokens[0].text=n+" "+e.tokens[0].tokens[0].text)):e.tokens.unshift({type:"text",raw:n+" ",text:n+" "}):t+=n+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>\n`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>\n`}table(e){let t="",n="";for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r="";for(let t=0;t<e.rows.length;t++){const s=e.rows[t];n="";for(let e=0;e<s.length;e++)n+=this.tablecell(s[e]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),"<table>\n<thead>\n"+t+"</thead>\n"+r+"</table>\n"}tablerow({text:e}){return`<tr>\n${e}</tr>\n`}tablecell(e){const t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>\n`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${e}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){const r=this.parser.parseInline(n),s=A(e);if(null===s)return r;let i='<a href="'+(e=s)+'"';return t&&(i+=' title="'+t+'"'),i+=">"+r+"</a>",i}image({href:e,title:t,text:n}){const r=A(e);if(null===r)return n;let s=`<img src="${e=r}" alt="${n}"`;return t&&(s+=` title="${t}"`),s+=">",s}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):e.text}}class de{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}}class xe{options;renderer;textRenderer;constructor(e){this.options=e||g,this.options.renderer=this.options.renderer||new ke,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new de}static parse(e,t){return new xe(t).parse(e)}static parseInline(e,t){return new xe(t).parseInline(e)}parse(e,t=!0){let n="";for(let r=0;r<e.length;r++){const s=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[s.type]){const e=s,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(!1!==t||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(e.type)){n+=t||"";continue}}const i=s;switch(i.type){case"space":n+=this.renderer.space(i);continue;case"hr":n+=this.renderer.hr(i);continue;case"heading":n+=this.renderer.heading(i);continue;case"code":n+=this.renderer.code(i);continue;case"table":n+=this.renderer.table(i);continue;case"blockquote":n+=this.renderer.blockquote(i);continue;case"list":n+=this.renderer.list(i);continue;case"html":n+=this.renderer.html(i);continue;case"paragraph":n+=this.renderer.paragraph(i);continue;case"text":{let s=i,o=this.renderer.text(s);for(;r+1<e.length&&"text"===e[r+1].type;)s=e[++r],o+="\n"+this.renderer.text(s);n+=t?this.renderer.paragraph({type:"paragraph",raw:o,text:o,tokens:[{type:"text",raw:o,text:o}]}):o;continue}default:{const e='Token with "'+i.type+'" type was not found.';if(this.options.silent)return"";throw new Error(e)}}}return n}parseInline(e,t){t=t||this.renderer;let n="";for(let r=0;r<e.length;r++){const s=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[s.type]){const e=this.options.extensions.renderers[s.type].call({parser:this},s);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){n+=e||"";continue}}const i=s;switch(i.type){case"escape":case"text":n+=t.text(i);break;case"html":n+=t.html(i);break;case"link":n+=t.link(i);break;case"image":n+=t.image(i);break;case"strong":n+=t.strong(i);break;case"em":n+=t.em(i);break;case"codespan":n+=t.codespan(i);break;case"br":n+=t.br(i);break;case"del":n+=t.del(i);break;default:{const e='Token with "'+i.type+'" type was not found.';if(this.options.silent)return"";throw new Error(e)}}}return n}}class me{options;constructor(e){this.options=e||g}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}}class be{defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};options=this.setOptions;parse=this.#e(ge.lex,xe.parse);parseInline=this.#e(ge.lexInline,xe.parseInline);Parser=xe;Renderer=ke;TextRenderer=de;Lexer=ge;Tokenizer=I;Hooks=me;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(const r of e)switch(n=n.concat(t.call(this,r)),r.type){case"table":{const e=r;for(const r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(const r of e.rows)for(const e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case"list":{const e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{const e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach((r=>{const s=e[r].flat(1/0);n=n.concat(this.walkTokens(s,t))})):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach((e=>{const n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),r}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");const n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){const t=this.defaults.renderer||new ke(this.defaults);for(const n in e.renderer){if(!(n in t))throw new Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;const r=n;let s=e.renderer[r];const i=t[r];t[r]=(...n)=>{e.useNewRenderer||(s=this.#t(s,r,t));let o=s.apply(t,n);return!1===o&&(o=i.apply(t,n)),o||""}}n.renderer=t}if(e.tokenizer){const t=this.defaults.tokenizer||new I(this.defaults);for(const n in e.tokenizer){if(!(n in t))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;const r=n,s=e.tokenizer[r],i=t[r];t[r]=(...e)=>{let n=s.apply(t,e);return!1===n&&(n=i.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){const t=this.defaults.hooks||new me;for(const n in e.hooks){if(!(n in t))throw new Error(`hook '${n}' does not exist`);if("options"===n)continue;const r=n,s=e.hooks[r],i=t[r];me.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async)return Promise.resolve(s.call(t,e)).then((e=>i.call(t,e)));const n=s.call(t,e);return i.call(t,n)}:t[r]=(...e)=>{let n=s.apply(t,e);return!1===n&&(n=i.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){const t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}})),this}#t(e,t,n){switch(t){case"heading":return function(r){return r.type&&r.type===t?e.call(this,n.parser.parseInline(r.tokens),r.depth,function(e){return e.replace(z,((e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}(n.parser.parseInline(r.tokens,n.parser.textRenderer))):e.apply(this,arguments)};case"code":return function(n){return n.type&&n.type===t?e.call(this,n.text,n.lang,!!n.escaped):e.apply(this,arguments)};case"table":return function(n){if(!n.type||n.type!==t)return e.apply(this,arguments);let r="",s="";for(let e=0;e<n.header.length;e++)s+=this.tablecell({text:n.header[e].text,tokens:n.header[e].tokens,header:!0,align:n.align[e]});r+=this.tablerow({text:s});let i="";for(let e=0;e<n.rows.length;e++){const t=n.rows[e];s="";for(let e=0;e<t.length;e++)s+=this.tablecell({text:t[e].text,tokens:t[e].tokens,header:!1,align:n.align[e]});i+=this.tablerow({text:s})}return e.call(this,r,i)};case"blockquote":return function(n){if(!n.type||n.type!==t)return e.apply(this,arguments);const r=this.parser.parse(n.tokens);return e.call(this,r)};case"list":return function(n){if(!n.type||n.type!==t)return e.apply(this,arguments);const r=n.ordered,s=n.start,i=n.loose;let o="";for(let e=0;e<n.items.length;e++){const t=n.items[e],r=t.checked,s=t.task;let l="";if(t.task){const e=this.checkbox({checked:!!r});i?t.tokens.length>0&&"paragraph"===t.tokens[0].type?(t.tokens[0].text=e+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&"text"===t.tokens[0].tokens[0].type&&(t.tokens[0].tokens[0].text=e+" "+t.tokens[0].tokens[0].text)):t.tokens.unshift({type:"text",text:e+" "}):l+=e+" "}l+=this.parser.parse(t.tokens,i),o+=this.listitem({type:"list_item",raw:l,text:l,task:s,checked:!!r,loose:i,tokens:t.tokens})}return e.call(this,o,r,s)};case"html":return function(n){return n.type&&n.type===t?e.call(this,n.text,n.block):e.apply(this,arguments)};case"paragraph":case"strong":case"em":case"del":return function(n){return n.type&&n.type===t?e.call(this,this.parser.parseInline(n.tokens)):e.apply(this,arguments)};case"escape":case"codespan":case"text":return function(n){return n.type&&n.type===t?e.call(this,n.text):e.apply(this,arguments)};case"link":return function(n){return n.type&&n.type===t?e.call(this,n.href,n.title,this.parser.parseInline(n.tokens)):e.apply(this,arguments)};case"image":return function(n){return n.type&&n.type===t?e.call(this,n.href,n.title,n.text):e.apply(this,arguments)}}return e}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return ge.lex(e,t??this.defaults)}parser(e,t){return xe.parse(e,t??this.defaults)}#e(e,t){return(n,r)=>{const s={...r},i={...this.defaults,...s};!0===this.defaults.async&&!1===s.async&&(i.silent,i.async=!0);const o=this.#n(!!i.silent,!!i.async);if(null==n)return o(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof n)return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(i.hooks&&(i.hooks.options=i),i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(n):n).then((t=>e(t,i))).then((e=>i.hooks?i.hooks.processAllTokens(e):e)).then((e=>i.walkTokens?Promise.all(this.walkTokens(e,i.walkTokens)).then((()=>e)):e)).then((e=>t(e,i))).then((e=>i.hooks?i.hooks.postprocess(e):e)).catch(o);try{i.hooks&&(n=i.hooks.preprocess(n));let r=e(n,i);i.hooks&&(r=i.hooks.processAllTokens(r)),i.walkTokens&&this.walkTokens(r,i.walkTokens);let s=t(r,i);return i.hooks&&(s=i.hooks.postprocess(s)),s}catch(e){return o(e)}}}#n(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="<p>An error occurred:</p><pre>"+$(n.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}}const ye=new be;function we(e,t){return ye.parse(e,t)}function $e(e){return e.replace(/\s*<\s*/g," \\lt ").replace(/\s*>\s*/g," \\gt ")}we.options=we.setOptions=function(e){return ye.setOptions(e),we.defaults=ye.defaults,k(we.defaults),we},we.getDefaults=f,we.defaults=g,we.use=function(...e){return ye.use(...e),we.defaults=ye.defaults,k(we.defaults),we},we.walkTokens=function(e,t){return ye.walkTokens(e,t)},we.parseInline=ye.parseInline,we.Parser=xe,we.parser=xe.parse,we.Renderer=ke,we.TextRenderer=de,we.Lexer=ge,we.lexer=ge.lex,we.Tokenizer=I,we.Hooks=me,we.parse=we,we.options,we.setOptions,we.use,we.walkTokens,we.parseInline,xe.parse,ge.lex;const ze={name:"inlineMath",level:"inline",start:e=>e.indexOf("$"),tokenizer(e){const t=/^\$(?:[^$]|\\\$)+\$(?!\$)/.exec(e);if(t)return{type:"inlineMath",raw:t[0],text:t[0]}},renderer:e=>$e(e.text)},ve={name:"inlineMath2",level:"inline",start:e=>e.indexOf("\\("),tokenizer(e){const t=e.match(/^\\\(.*?\\\)/);if(t)return{type:"inlineMath2",raw:t[0],text:t[0]}},renderer:e=>$e(e.text)},_e={name:"blockMath",level:"block",start:e=>e.indexOf("$$"),tokenizer(e){const t=e.match(/^\${2}(?:[^$]|\\\$|\$[^$])+\${2}(?!\$)/);if(t)return{type:"blockMath",raw:t[0],text:t[0].trim()}},renderer:e=>`<p class="paragraph">${$e(e.text)}</p>\n`},Ae={name:"blockMath2",level:"block",start:e=>e.indexOf("\\["),tokenizer(e){const t=e.match(/^\\\[(?:[^$]|\\\$)+\\\]/);if(t)return{type:"blockMath2",raw:t[0],text:t[0].trim()}},renderer:e=>`<p class="paragraph">${$e(e.text)}</p>\n`};var Re,Te="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Se={exports:{}};Re=Se,function(){var n="input is invalid type",r="object"==typeof window,s=r?window:{};s.JS_MD5_NO_WINDOW&&(r=!1);var i=!r&&"object"==typeof self,o=!s.JS_MD5_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;o?s=Te:i&&(s=self);var l,a=!s.JS_MD5_NO_COMMON_JS&&Re.exports,c=!s.JS_MD5_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,h="0123456789abcdef".split(""),p=[128,32768,8388608,-2147483648],u=[0,8,16,24],f=["hex","array","digest","buffer","arrayBuffer","base64"],g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),k=[];if(c){var d=new ArrayBuffer(68);l=new Uint8Array(d),k=new Uint32Array(d)}var x=Array.isArray;!s.JS_MD5_NO_NODE_JS&&x||(x=function(e){return"[object Array]"===Object.prototype.toString.call(e)});var m=ArrayBuffer.isView;!c||!s.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW&&m||(m=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var b=function(e){var t=typeof e;if("string"===t)return[e,!0];if("object"!==t||null===e)throw new Error(n);if(c&&e.constructor===ArrayBuffer)return[new Uint8Array(e),!1];if(!x(e)&&!m(e))throw new Error(n);return[e,!1]},y=function(e){return function(t){return new z(!0).update(t)[e]()}},w=function(r){var i,o=e,l=t.Buffer;return i=l.from&&!s.JS_MD5_NO_BUFFER_FROM?l.from:function(e){return new l(e)},function(e){if("string"==typeof e)return o.createHash("md5").update(e,"utf8").digest("hex");if(null==e)throw new Error(n);return e.constructor===ArrayBuffer&&(e=new Uint8Array(e)),x(e)||m(e)||e.constructor===l?o.createHash("md5").update(i(e)).digest("hex"):r(e)}},$=function(e){return function(t,n){return new v(t,!0).update(n)[e]()}};function z(e){if(e)k[0]=k[16]=k[1]=k[2]=k[3]=k[4]=k[5]=k[6]=k[7]=k[8]=k[9]=k[10]=k[11]=k[12]=k[13]=k[14]=k[15]=0,this.blocks=k,this.buffer8=l;else if(c){var t=new ArrayBuffer(68);this.buffer8=new Uint8Array(t),this.blocks=new Uint32Array(t)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}function v(e,t){var n,r=b(e);if(e=r[0],r[1]){var s,i=[],o=e.length,l=0;for(n=0;n<o;++n)(s=e.charCodeAt(n))<128?i[l++]=s:s<2048?(i[l++]=192|s>>>6,i[l++]=128|63&s):s<55296||s>=57344?(i[l++]=224|s>>>12,i[l++]=128|s>>>6&63,i[l++]=128|63&s):(s=65536+((1023&s)<<10|1023&e.charCodeAt(++n)),i[l++]=240|s>>>18,i[l++]=128|s>>>12&63,i[l++]=128|s>>>6&63,i[l++]=128|63&s);e=i}e.length>64&&(e=new z(!0).update(e).array());var a=[],c=[];for(n=0;n<64;++n){var h=e[n]||0;a[n]=92^h,c[n]=54^h}z.call(this,t),this.update(c),this.oKeyPad=a,this.inner=!0,this.sharedMemory=t}z.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var t=b(e);e=t[0];for(var n,r,s=t[1],i=0,o=e.length,l=this.blocks,a=this.buffer8;i<o;){if(this.hashed&&(this.hashed=!1,l[0]=l[16],l[16]=l[1]=l[2]=l[3]=l[4]=l[5]=l[6]=l[7]=l[8]=l[9]=l[10]=l[11]=l[12]=l[13]=l[14]=l[15]=0),s)if(c)for(r=this.start;i<o&&r<64;++i)(n=e.charCodeAt(i))<128?a[r++]=n:n<2048?(a[r++]=192|n>>>6,a[r++]=128|63&n):n<55296||n>=57344?(a[r++]=224|n>>>12,a[r++]=128|n>>>6&63,a[r++]=128|63&n):(n=65536+((1023&n)<<10|1023&e.charCodeAt(++i)),a[r++]=240|n>>>18,a[r++]=128|n>>>12&63,a[r++]=128|n>>>6&63,a[r++]=128|63&n);else for(r=this.start;i<o&&r<64;++i)(n=e.charCodeAt(i))<128?l[r>>>2]|=n<<u[3&r++]:n<2048?(l[r>>>2]|=(192|n>>>6)<<u[3&r++],l[r>>>2]|=(128|63&n)<<u[3&r++]):n<55296||n>=57344?(l[r>>>2]|=(224|n>>>12)<<u[3&r++],l[r>>>2]|=(128|n>>>6&63)<<u[3&r++],l[r>>>2]|=(128|63&n)<<u[3&r++]):(n=65536+((1023&n)<<10|1023&e.charCodeAt(++i)),l[r>>>2]|=(240|n>>>18)<<u[3&r++],l[r>>>2]|=(128|n>>>12&63)<<u[3&r++],l[r>>>2]|=(128|n>>>6&63)<<u[3&r++],l[r>>>2]|=(128|63&n)<<u[3&r++]);else if(c)for(r=this.start;i<o&&r<64;++i)a[r++]=e[i];else for(r=this.start;i<o&&r<64;++i)l[r>>>2]|=e[i]<<u[3&r++];this.lastByteIndex=r,this.bytes+=r-this.start,r>=64?(this.start=r-64,this.hash(),this.hashed=!0):this.start=r}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this},z.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[t>>>2]|=p[3&t],t>=56&&(this.hashed||this.hash(),e[0]=e[16],e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.bytes<<3,e[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},z.prototype.hash=function(){var e,t,n,r,s,i,o=this.blocks;this.first?t=((t=((e=((e=o[0]-680876937)<<7|e>>>25)-271733879<<0)^(n=((n=(-271733879^(r=((r=(-1732584194^2004318071&e)+o[1]-117830708)<<12|r>>>20)+e<<0)&(-271733879^e))+o[2]-1126478375)<<17|n>>>15)+r<<0)&(r^e))+o[3]-1316259209)<<22|t>>>10)+n<<0:(e=this.h0,t=this.h1,n=this.h2,t=((t+=((e=((e+=((r=this.h3)^t&(n^r))+o[0]-680876936)<<7|e>>>25)+t<<0)^(n=((n+=(t^(r=((r+=(n^e&(t^n))+o[1]-389564586)<<12|r>>>20)+e<<0)&(e^t))+o[2]+606105819)<<17|n>>>15)+r<<0)&(r^e))+o[3]-1044525330)<<22|t>>>10)+n<<0),t=((t+=((e=((e+=(r^t&(n^r))+o[4]-176418897)<<7|e>>>25)+t<<0)^(n=((n+=(t^(r=((r+=(n^e&(t^n))+o[5]+1200080426)<<12|r>>>20)+e<<0)&(e^t))+o[6]-1473231341)<<17|n>>>15)+r<<0)&(r^e))+o[7]-45705983)<<22|t>>>10)+n<<0,t=((t+=((e=((e+=(r^t&(n^r))+o[8]+1770035416)<<7|e>>>25)+t<<0)^(n=((n+=(t^(r=((r+=(n^e&(t^n))+o[9]-1958414417)<<12|r>>>20)+e<<0)&(e^t))+o[10]-42063)<<17|n>>>15)+r<<0)&(r^e))+o[11]-1990404162)<<22|t>>>10)+n<<0,t=((t+=((e=((e+=(r^t&(n^r))+o[12]+1804603682)<<7|e>>>25)+t<<0)^(n=((n+=(t^(r=((r+=(n^e&(t^n))+o[13]-40341101)<<12|r>>>20)+e<<0)&(e^t))+o[14]-1502002290)<<17|n>>>15)+r<<0)&(r^e))+o[15]+1236535329)<<22|t>>>10)+n<<0,t=((t+=((r=((r+=(t^n&((e=((e+=(n^r&(t^n))+o[1]-165796510)<<5|e>>>27)+t<<0)^t))+o[6]-1069501632)<<9|r>>>23)+e<<0)^e&((n=((n+=(e^t&(r^e))+o[11]+643717713)<<14|n>>>18)+r<<0)^r))+o[0]-373897302)<<20|t>>>12)+n<<0,t=((t+=((r=((r+=(t^n&((e=((e+=(n^r&(t^n))+o[5]-701558691)<<5|e>>>27)+t<<0)^t))+o[10]+38016083)<<9|r>>>23)+e<<0)^e&((n=((n+=(e^t&(r^e))+o[15]-660478335)<<14|n>>>18)+r<<0)^r))+o[4]-405537848)<<20|t>>>12)+n<<0,t=((t+=((r=((r+=(t^n&((e=((e+=(n^r&(t^n))+o[9]+568446438)<<5|e>>>27)+t<<0)^t))+o[14]-1019803690)<<9|r>>>23)+e<<0)^e&((n=((n+=(e^t&(r^e))+o[3]-187363961)<<14|n>>>18)+r<<0)^r))+o[8]+1163531501)<<20|t>>>12)+n<<0,t=((t+=((r=((r+=(t^n&((e=((e+=(n^r&(t^n))+o[13]-1444681467)<<5|e>>>27)+t<<0)^t))+o[2]-51403784)<<9|r>>>23)+e<<0)^e&((n=((n+=(e^t&(r^e))+o[7]+1735328473)<<14|n>>>18)+r<<0)^r))+o[12]-1926607734)<<20|t>>>12)+n<<0,t=((t+=((i=(r=((r+=((s=t^n)^(e=((e+=(s^r)+o[5]-378558)<<4|e>>>28)+t<<0))+o[8]-2022574463)<<11|r>>>21)+e<<0)^e)^(n=((n+=(i^t)+o[11]+1839030562)<<16|n>>>16)+r<<0))+o[14]-35309556)<<23|t>>>9)+n<<0,t=((t+=((i=(r=((r+=((s=t^n)^(e=((e+=(s^r)+o[1]-1530992060)<<4|e>>>28)+t<<0))+o[4]+1272893353)<<11|r>>>21)+e<<0)^e)^(n=((n+=(i^t)+o[7]-155497632)<<16|n>>>16)+r<<0))+o[10]-1094730640)<<23|t>>>9)+n<<0,t=((t+=((i=(r=((r+=((s=t^n)^(e=((e+=(s^r)+o[13]+681279174)<<4|e>>>28)+t<<0))+o[0]-358537222)<<11|r>>>21)+e<<0)^e)^(n=((n+=(i^t)+o[3]-722521979)<<16|n>>>16)+r<<0))+o[6]+76029189)<<23|t>>>9)+n<<0,t=((t+=((i=(r=((r+=((s=t^n)^(e=((e+=(s^r)+o[9]-640364487)<<4|e>>>28)+t<<0))+o[12]-421815835)<<11|r>>>21)+e<<0)^e)^(n=((n+=(i^t)+o[15]+530742520)<<16|n>>>16)+r<<0))+o[2]-995338651)<<23|t>>>9)+n<<0,t=((t+=((r=((r+=(t^((e=((e+=(n^(t|~r))+o[0]-198630844)<<6|e>>>26)+t<<0)|~n))+o[7]+1126891415)<<10|r>>>22)+e<<0)^((n=((n+=(e^(r|~t))+o[14]-1416354905)<<15|n>>>17)+r<<0)|~e))+o[5]-57434055)<<21|t>>>11)+n<<0,t=((t+=((r=((r+=(t^((e=((e+=(n^(t|~r))+o[12]+1700485571)<<6|e>>>26)+t<<0)|~n))+o[3]-1894986606)<<10|r>>>22)+e<<0)^((n=((n+=(e^(r|~t))+o[10]-1051523)<<15|n>>>17)+r<<0)|~e))+o[1]-2054922799)<<21|t>>>11)+n<<0,t=((t+=((r=((r+=(t^((e=((e+=(n^(t|~r))+o[8]+1873313359)<<6|e>>>26)+t<<0)|~n))+o[15]-30611744)<<10|r>>>22)+e<<0)^((n=((n+=(e^(r|~t))+o[6]-1560198380)<<15|n>>>17)+r<<0)|~e))+o[13]+1309151649)<<21|t>>>11)+n<<0,t=((t+=((r=((r+=(t^((e=((e+=(n^(t|~r))+o[4]-145523070)<<6|e>>>26)+t<<0)|~n))+o[11]-1120210379)<<10|r>>>22)+e<<0)^((n=((n+=(e^(r|~t))+o[2]+718787259)<<15|n>>>17)+r<<0)|~e))+o[9]-343485551)<<21|t>>>11)+n<<0,this.first?(this.h0=e+1732584193<<0,this.h1=t-271733879<<0,this.h2=n-1732584194<<0,this.h3=r+271733878<<0,this.first=!1):(this.h0=this.h0+e<<0,this.h1=this.h1+t<<0,this.h2=this.h2+n<<0,this.h3=this.h3+r<<0)},z.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,r=this.h3;return h[e>>>4&15]+h[15&e]+h[e>>>12&15]+h[e>>>8&15]+h[e>>>20&15]+h[e>>>16&15]+h[e>>>28&15]+h[e>>>24&15]+h[t>>>4&15]+h[15&t]+h[t>>>12&15]+h[t>>>8&15]+h[t>>>20&15]+h[t>>>16&15]+h[t>>>28&15]+h[t>>>24&15]+h[n>>>4&15]+h[15&n]+h[n>>>12&15]+h[n>>>8&15]+h[n>>>20&15]+h[n>>>16&15]+h[n>>>28&15]+h[n>>>24&15]+h[r>>>4&15]+h[15&r]+h[r>>>12&15]+h[r>>>8&15]+h[r>>>20&15]+h[r>>>16&15]+h[r>>>28&15]+h[r>>>24&15]},z.prototype.toString=z.prototype.hex,z.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,r=this.h3;return[255&e,e>>>8&255,e>>>16&255,e>>>24&255,255&t,t>>>8&255,t>>>16&255,t>>>24&255,255&n,n>>>8&255,n>>>16&255,n>>>24&255,255&r,r>>>8&255,r>>>16&255,r>>>24&255]},z.prototype.array=z.prototype.digest,z.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(16),t=new Uint32Array(e);return t[0]=this.h0,t[1]=this.h1,t[2]=this.h2,t[3]=this.h3,e},z.prototype.buffer=z.prototype.arrayBuffer,z.prototype.base64=function(){for(var e,t,n,r="",s=this.array(),i=0;i<15;)e=s[i++],t=s[i++],n=s[i++],r+=g[e>>>2]+g[63&(e<<4|t>>>4)]+g[63&(t<<2|n>>>6)]+g[63&n];return e=s[i],r+=g[e>>>2]+g[e<<4&63]+"=="},v.prototype=new z,v.prototype.finalize=function(){if(z.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();z.call(this,this.sharedMemory),this.update(this.oKeyPad),this.update(e),z.prototype.finalize.call(this)}};var _=function(){var e=y("hex");o&&(e=w(e)),e.create=function(){return new z},e.update=function(t){return e.create().update(t)};for(var t=0;t<f.length;++t){var n=f[t];e[n]=y(n)}return e}();_.md5=_,_.md5.hmac=function(){var e=$("hex");e.create=function(e){return new v(e)},e.update=function(t,n){return e.create(t).update(n)};for(var t=0;t<f.length;++t){var n=f[t];e[n]=$(n)}return e}(),a?Re.exports=_:s.md5=_}();var Ee=Se.exports;function Ie(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return null}return e}const je={exec:()=>null},Oe=e=>/^[a-z][\w-]*$/i.test(e)?e:"c"+Ee.md5(e);function Le(e){const t=e.match(/^(.*?)(?:\s*=(\d*)(?:x(\d+))?)?$/);if(t){const e=t[1].trim(),n=t[2]?parseInt(t[2],10):null,r=t[3]?parseInt(t[3],10):null;return{text:0===e.length?null:e,width:n,height:r}}return{text:null,width:null,height:null}}const Be=e=>(e.tokenizer.rules.inline.br=je,e.tokenizer.rules.inline.emStrongLDelim=/^\*+(?:([!"#$%&'()+\-.,/:;<=>?@[\]`{|}~_])|[^\s*])/,e),Me={paragraph({tokens:e}){if(1===e.length&&"image"===e[0].type){const t=e[0];if(null===Ie(t.href))return t.text;let n="<figure>";if(n+=qe(t),t.title){const{text:e}=Le(t.title);e&&(n+=`<figcaption>${e}</figcaption>`)}return n+="</figure>",n}return`<p class="paragraph">${this.parser.parseInline(e)}</p>\n`},list(e){const t=e.ordered,n=e.start;let r="";for(let t=0;t<e.items.length;t++){const n=e.items[t];r+=this.listitem(n)}const s=t?"ol":"ul";return"<"+s+(t&&1!==n?' start="'+n+'"':"")+' class="md-list">\n'+r+"</"+s+">\n"},listitem(e){let t="";return t+=this.parser.parse(e.tokens,!!e.loose),`<li class="md-list-item">${t}</li>\n`}},De={image:e=>qe(e)},qe=e=>{const t=Ie(e.href);if(null===t)return e.text;let n=`<img src="${t}" alt="${e.text}"`;if(e.title){const{text:t,width:r,height:s}=Le(e.title);t&&(n+=` title="${t}"`),(r||s)&&(n+=' style="',r&&(n+="width:"+r+"px;"),s&&(n+="height:"+s+"px;"),n+='"')}return n+=">",n},Pe=e=>{const t=new Date,n=new be;n.use({extensions:[ze,ve]}),Be(new n.Lexer);const r=n.Lexer.lexInline(e,n.defaults);return{parsed:n.parseInline(e),lexed:r,time:(new Date).getTime()-t.getTime()}};function Ne(e){return(e||"").match(/\S*/)[0]}function Ce(e){return t=>{"string"==typeof t&&t!==e.text&&(e.escaped=!0,e.text=t)}}const Ze=/[&<>"']/,Qe=new RegExp(Ze.source,"g"),Ue=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Fe=new RegExp(Ue.source,"g"),Je={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},He=e=>Je[e];function We(e,t){if(t){if(Ze.test(e))return e.replace(Qe,He)}else if(Ue.test(e))return e.replace(Fe,He);return e}n.registerLanguage("javascript",r),n.registerLanguage("python",s),n.registerLanguage("latex",i),n.registerLanguage("json",o);const Xe=new be(function(e){if("function"==typeof e&&(e={highlight:e}),!e||"function"!=typeof e.highlight)throw new Error("Must provide highlight function");return"string"!=typeof e.langPrefix&&(e.langPrefix="language-"),{async:!!e.async,walkTokens(t){if("code"!==t.type)return;const n=Ne(t.lang);if(e.async)return Promise.resolve(e.highlight(t.text,n,t.lang||"")).then(Ce(t));const r=e.highlight(t.text,n,t.lang||"");if(r instanceof Promise)throw new Error("markedHighlight is not set to async but the highlight function is async. Set the async option to true on markedHighlight to await the async highlight function.");Ce(t)(r)},useNewRenderer:!0,renderer:{code(t,n,r){"object"==typeof t&&(r=t.escaped,n=t.lang,t=t.text);const s=Ne(n),i=s?` class="${e.langPrefix}${We(s)}"`:"";return t=t.replace(/\n$/,""),`<pre><code${i}>${r?t:We(t,!0)}\n</code></pre>`}}}}({highlight(e,t){const r=n.getLanguage(t)?t:"plaintext";return n.highlight(e,{language:r}).value}})),Ke={name:"footnoteRef",level:"inline",start:e=>e.indexOf("[^"),tokenizer:e=>{const t=/^\[\^([^\]]+)\]/.exec(e);if(t){const e=t[1].trim();return{type:"footnoteRef",raw:t[0],id:e,tokens:[]}}},renderer:e=>`<span class="footnote-ref" id="footnote-ref-${e.id}"><sup><a href="#footnote-${e.id}">[${e.number}]</a></sup></span>`},Ve={name:"footnoteDef",level:"block",start:e=>e.indexOf("[^"),tokenizer:e=>{const t=/^\[\^(.+?)\]: ([\s\S]*?)(?:\n+|$)/.exec(e);if(t){const e=t[1].trim(),n=t[2].trim();return{type:"footnoteDef",raw:t[0],id:e,text:n,tokens:[]}}},renderer:e=>`<li class="footnote-def" key="${e.number}" id="footnote-${e.id}">${Xe.parseInline(e.text)} <a href="#footnote-ref-${e.id}"> ⬅ </a></li>`},Ye=e=>{const t={};let n=1;return function e(r){r.forEach((r=>{"footnoteRef"===r.type&&(r.id in t||(t[r.id]=n,n++),r.number=t[r.id]),"list"===r.type&&r.items.forEach((t=>{t.tokens&&t.tokens.length>0&&e(t.tokens)})),r.tokens&&r.tokens.length>0&&e(r.tokens)}))}(e),function e(r){r.forEach((r=>{"footnoteDef"===r.type&&(r.id in t||(t[r.id]=n,n++),r.number=t[r.id]),r.tokens&&r.tokens.length>0&&e(r.tokens)}))}(e),e};var Ge;!function(e){e.Theorem="theorem",e.Lemma="lemma",e.Corollary="corollary",e.Axiom="axiom",e.Definition="definition",e.Example="example"}(Ge||(Ge={}));const et={[Ge.Theorem]:"定理",[Ge.Lemma]:"引理",[Ge.Corollary]:"推论",[Ge.Axiom]:"公理",[Ge.Definition]:"定义",[Ge.Example]:"例"},tt={name:"theoremLikeRef",level:"inline",start:e=>e.indexOf("[~"),tokenizer:e=>{const t=/^\[~([^\]]+)\]/.exec(e);if(t){const e=t[1].trim();return{type:"theoremLikeRef",raw:t[0],id:e,tokens:[]}}},renderer:e=>`<a id="theorem-like-ref-${e.id}" href="#theorem-like-${e.id}">${(e.typeName+" "+e.number).trimEnd()}</a>`},nt={name:"theoremLikeDef",level:"block",start:e=>e.indexOf("```["),tokenizer(e){var t,n,r,s,i,o;const l=/^ {0,3}(`{3,}(?=\[[^\n\]]*\](?:\n|$)))\[([^\],]*),([^\],]*)(?:,([^\],]+))?\]\n([\s\S]*?)(?:\n|$)(?: {0,3}\1 *(?=\n|$)|$)/.exec(e);if(l){const e=null===(t=l[2])||void 0===t?void 0:t.trim().replace(/\*$/,""),a=null===(n=l[2])||void 0===n?void 0:n.trim().endsWith("*"),c=null===(r=l[3])||void 0===r?void 0:r.trim(),h=null===(s=l[4])||void 0===s?void 0:s.trim(),p=null===(i=l[5])||void 0===i?void 0:i.trim();return{type:"theoremLikeDef",raw:l[0],id:c,name:h,text:p,ttype:e,typeName:null!==(o=et[e])&&void 0!==o?o:e,tokens:[],unnumbered:a}}},renderer:e=>`<section class="theorem-like ${Oe(e.ttype)}" id="theorem-like-${e.id}">\n <p class="title"><b>${e.typeName}</b>${e.unnumbered?"":" "+e.number}${e.name?" ( <em>"+e.name+"</em> )":""}\n </p>\n <section class="content">\n ${Xe.parse(e.text)}\n </section> \n</section>`};var rt;!function(e){e.PROOF="proof",e.SOLUTION="solution"}(rt||(rt={}));const st={[rt.PROOF]:"证明",[rt.SOLUTION]:"解答"},it={name:"solution",level:"block",start:e=>e.indexOf("~~~["),tokenizer:e=>{var t;const n=/^ {0,3}(~{3,}(?=\[[^\n\]]*\](?:\n|$)))\[([^\],]*)\]\n([\s\S]*?)(?:\n|$)(?: {0,3}\1~* *(?=\n|$)|$)/.exec(e);if(n){const e=n[2].trim(),r=n[3].trim();return{type:"solution",raw:n[0],stype:e,typeName:null!==(t=st[e])&&void 0!==t?t:e,text:r,tokens:[]}}},renderer:e=>`<details class="solution ${Oe(e.stype)}"><summary>${e.typeName}</summary>\n <section class="content">\n ${Xe.parse(e.text)}\n </section></details>`};var ot;!function(e){e.Warn="warn",e.Success="success",e.Error="error",e.Info="info"}(ot||(ot={}));const lt={name:"alert",level:"block",start:e=>e.indexOf("!!!["),tokenizer(e){var t,n,r,s;const i=/^ {0,3}(!{3,}(?=\[[^\n\]]*\](?:\n|$)))\[([^\],]*)(?:,([^\],]*))?(?:,([^\],]+))?\]\n([\s\S]*?)(?:\n|$)(?: {0,3}\1 *(?=\n|$)|$)/.exec(e);if(i){const e=null===(t=i[2])||void 0===t?void 0:t.trim(),o=null===(n=i[3])||void 0===n?void 0:n.trim(),l=null===(r=i[4])||void 0===r?void 0:r.trim(),a=null===(s=i[5])||void 0===s?void 0:s.trim();return{type:"alert",raw:i[0],title:o,icon:l,text:a,ttype:e,tokens:[]}}},renderer(e){let t="";if("true"===e.icon)switch(e.ttype){case ot.Warn:e.icon="⚠️";break;case ot.Success:e.icon="🎉";break;case ot.Error:e.icon="⛔";break;case ot.Info:e.icon="ℹ️"}const n=void 0!==e.icon?`<span class="icon">${e.icon}</span> `:"";return t+=`<section class="alert ${e.ttype}">`,e.title&&(t+=`<p class="heading">${n}<span class='title'>${e.title}</span></p>`),t+=`<p class="content paragraph">${e.title?"":n}${Xe.parseInline(e.text)}</p>`,t+="</section>",t}},at=e=>{const t={renderer:Object.assign(Object.assign({},Me),De),useNewRenderer:!0,gfm:!0,extensions:[ze,ve,_e,Ae,Ke,Ve,nt,tt,it,lt],hooks:{preprocess:e=>e,processAllTokens:e=>(e=>{const t={[Ge.Theorem]:0,[Ge.Lemma]:0,[Ge.Corollary]:0,[Ge.Axiom]:0,[Ge.Definition]:0,[Ge.Example]:0},n={};return function e(r){r.forEach((r=>{"theoremLikeDef"===r.type&&(r.ttype in t?t[r.ttype]=t[r.ttype]+1:t[r.ttype]=1,r.number=r.unnumbered?"":t[r.ttype],n[r.id]={typeName:r.typeName,number:r.number}),r.tokens&&r.tokens.length>0&&e(r.tokens)}))}(e),function e(t){t.forEach((t=>{"theoremLikeRef"===t.type&&t.id in n&&(t.number=n[t.id].number,t.typeName=n[t.id].typeName),"list"===t.type&&t.items.forEach((t=>{t.tokens&&t.tokens.length>0&&e(t.tokens)})),t.tokens&&t.tokens.length>0&&e(t.tokens)}))}(e),e})(Ye(e)),postprocess:e=>(e=>{const t=[];return e=e.replaceAll(/<li class="footnote-def" key="(\d+)".*?<\/li>/g,((e,n)=>(t.push({key:parseInt(n),content:e}),""))),t.sort(((e,t)=>e.key-t.key)),e=e.replaceAll(/<ol class="footnote-list">.*?<\/ol>/g,(()=>"")),t.length>0&&(e+=`<ol class="footnote-list">${t.map((e=>e.content)).join("")}</ol>`),e})(e)}};Xe.use(t);const n=new Date;var r;(r=Be(new Xe.Lexer)).tokenizer.rules.block.lheading=je,r.tokenizer.rules.block.code=je,r.tokenizer.rules.block.fences=/^ {0,3}(`{3,}(?=[^`\n[]*(?:\n|$)))([^\n]*)(?:\n|$)([\s\S]*?)(?:\n|$)(?: {0,3}\1`* *(?=\n|$)|$)/;const s=Ye(Xe.lexer(e));return{parsed:Xe.parse(e),lexed:s,time:(new Date).getTime()-n.getTime()}},ct=e=>{try{const t=h({fontSize:13});p(t);const n=new l({packages:c,inlineMath:[["$","$"],["\\(","\\)"]],displayMath:[["$$","$$"],["\\[","\\]"]],macros:{parallelogram:"\\unicode{x25B1}"}}),r=new a({fontCache:"none"}),s=u.document(e,{InputJax:n,OutputJax:r});return s.render(),t.innerHTML(t.body(s.document))}catch(t){return e}};export{at as renderMarkdown,Pe as renderMarkdownCompact,ct as tex2svg};
2
2
  //# sourceMappingURL=index.esm.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mathcrowd/mmarked",
3
- "version": "1.7.3",
3
+ "version": "1.7.5",
4
4
  "description": "A customized markdown parser/renderer with tex2svg.",
5
5
  "types": "dist/index.d.ts",
6
6
  "module": "dist/index.esm.js",