-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.min.js
54 lines (54 loc) · 45.7 KB
/
index.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
var S={},x=function(){let o=/\blang(?:uage)?-([\w-]+)\b/i,t=0;var e=S.Prism={manual:S.Prism&&S.Prism.manual,disableWorkerMessageHandler:S.Prism&&S.Prism.disableWorkerMessageHandler,util:{encode(i){return i instanceof n?new n(i.type,e.util.encode(i.content),i.alias):e.util.type(i)==="Array"?i.map(e.util.encode):i.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type(i){return Object.prototype.toString.call(i).match(/\[object (\w+)\]/)[1]},objId(i){return i.__id||Object.defineProperty(i,"__id",{value:++t}),i.__id},clone(i,s){var l=e.util.type(i);switch(s=s||{},l){case"Object":if(s[e.util.objId(i)])return s[e.util.objId(i)];var r={};s[e.util.objId(i)]=r;for(var a in i)i.hasOwnProperty(a)&&(r[a]=e.util.clone(i[a],s));return r;case"Array":if(s[e.util.objId(i)])return s[e.util.objId(i)];var r=[];return s[e.util.objId(i)]=r,i.forEach(function(u,g){r[g]=e.util.clone(u,s)}),r}return i}},languages:{extend(i,s){var l=e.util.clone(e.languages[i]);for(var r in s)l[r]=s[r];return l},insertBefore(i,s,l,r){r=r||e.languages;var a=r[i];if(arguments.length==2){l=arguments[1];for(var u in l)l.hasOwnProperty(u)&&(a[u]=l[u]);return a}var g={};for(var p in a)if(a.hasOwnProperty(p)){if(p==s)for(var u in l)l.hasOwnProperty(u)&&(g[u]=l[u]);g[p]=a[p]}return e.languages.DFS(e.languages,function(m,h){h===r[i]&&m!=i&&(this[m]=g)}),r[i]=g},DFS(i,s,l,r){r=r||{};for(var a in i)i.hasOwnProperty(a)&&(s.call(i,a,i[a],l||a),e.util.type(i[a])==="Object"&&!r[e.util.objId(i[a])]?(r[e.util.objId(i[a])]=!0,e.languages.DFS(i[a],s,null,r)):e.util.type(i[a])==="Array"&&!r[e.util.objId(i[a])]&&(r[e.util.objId(i[a])]=!0,e.languages.DFS(i[a],s,a,r)))}},plugins:{},highlightAll(i,s){e.highlightAllUnder(document,i,s)},highlightAllUnder(i,s,l){var r={callback:l,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};e.hooks.run("before-highlightall",r);for(var a=r.elements||i.querySelectorAll(r.selector),u=0,g;g=a[u++];)e.highlightElement(g,s===!0,r.callback)},highlightElement(i,s,l){for(var r,a,u=i;u&&!o.test(u.className);)u=u.parentNode;u&&(r=(u.className.match(o)||[,""])[1].toLowerCase(),a=e.languages[r]),i.className=i.className.replace(o,"").replace(/\s+/g," ")+" language-"+r,i.parentNode&&(u=i.parentNode,/pre/i.test(u.nodeName)&&(u.className=u.className.replace(o,"").replace(/\s+/g," ")+" language-"+r));var g=i.textContent,p={element:i,language:r,grammar:a,code:g};if(e.hooks.run("before-sanity-check",p),!p.code||!p.grammar){p.code&&(e.hooks.run("before-highlight",p),p.element.textContent=p.code,e.hooks.run("after-highlight",p)),e.hooks.run("complete",p);return}if(e.hooks.run("before-highlight",p),s&&S.Worker){var m=new Worker(e.filename);m.onmessage=function(h){p.highlightedCode=h.data,e.hooks.run("before-insert",p),p.element.innerHTML=p.highlightedCode,l&&l.call(p.element),e.hooks.run("after-highlight",p),e.hooks.run("complete",p)},m.postMessage(JSON.stringify({language:p.language,code:p.code,immediateClose:!0}))}else p.highlightedCode=e.highlight(p.code,p.grammar,p.language),e.hooks.run("before-insert",p),p.element.innerHTML=p.highlightedCode,l&&l.call(i),e.hooks.run("after-highlight",p),e.hooks.run("complete",p)},highlight(i,s,l){var r={code:i,grammar:s,language:l};return e.hooks.run("before-tokenize",r),r.tokens=e.tokenize(r.code,r.grammar),e.hooks.run("after-tokenize",r),n.stringify(e.util.encode(r.tokens),r.language)},matchGrammar(i,s,l,r,a,u,g){var p=e.Token;for(var m in l)if(!(!l.hasOwnProperty(m)||!l[m])){if(m==g)return;var h=l[m];h=e.util.type(h)==="Array"?h:[h];for(var $=0;$<h.length;++$){var k=h[$],j=k.inside,R=!!k.lookbehind,w=!!k.greedy,F=0,D=k.alias;if(w&&!k.pattern.global){var E=k.pattern.toString().match(/[imuy]*$/)[0];k.pattern=RegExp(k.pattern.source,E+"g")}k=k.pattern||k;for(var z=r,A=a;z<s.length;A+=s[z].length,++z){var C=s[z];if(s.length>i.length)return;if(!(C instanceof p)){if(w&&z!=s.length-1){k.lastIndex=A;var _=k.exec(i);if(!_)break;for(var Z=_.index+(R?_[1].length:0),V=_.index+_[0].length,L=z,B=A,ue=s.length;L<ue&&(B<V||!s[L].type&&!s[L-1].greedy);++L)B+=s[L].length,Z>=B&&(++z,A=B);if(s[z]instanceof p)continue;G=L-z,C=i.slice(A,B),_.index-=A}else{k.lastIndex=0;var _=k.exec(C),G=1}if(!_){if(u)break;continue}R&&(F=_[1]?_[1].length:0);var Z=_.index+F,_=_[0].slice(F),V=Z+_.length,W=C.slice(0,Z),K=C.slice(V),q=[z,G];W&&(++z,A+=W.length,q.push(W));var ce=new p(m,j?e.tokenize(_,j):_,D,_,w);if(q.push(ce),K&&q.push(K),Array.prototype.splice.apply(s,q),G!=1&&e.matchGrammar(i,s,l,z,A,!0,m),u)break}}}}},tokenize(i,s,l){var r=[i],a=s.rest;if(a){for(var u in a)s[u]=a[u];delete s.rest}return e.matchGrammar(i,r,s,0,0,!1),r},hooks:{all:{},add(i,s){var l=e.hooks.all;l[i]=l[i]||[],l[i].push(s)},run(i,s){var l=e.hooks.all[i];if(!(!l||!l.length))for(var r=0,a;a=l[r++];)a(s)}}},n=e.Token=function(i,s,l,r,a){this.type=i,this.content=s,this.alias=l,this.length=(r||"").length|0,this.greedy=!!a};return n.stringify=function(i,s,l){if(typeof i=="string")return i;if(e.util.type(i)==="Array")return i.map(u=>n.stringify(u,s,i)).join("");let r={type:i.type,content:n.stringify(i.content,s,l),tag:"span",classes:["token",i.type],attributes:{},language:s,parent:l};if(i.alias){let u=e.util.type(i.alias)==="Array"?i.alias:[i.alias];Array.prototype.push.apply(r.classes,u)}e.hooks.run("wrap",r);let a=Object.keys(r.attributes).map(u=>u+'="'+(r.attributes[u]||"").replace(/"/g,""")+'"').join(" ");return`<${r.tag} class="${r.classes.join(" ")}"${a?" "+a:""}>${r.content}</${r.tag}>`},S.document||S.addEventListener&&(e.disableWorkerMessageHandler||S.addEventListener("message",i=>{var s=JSON.parse(i.data),l=s.language,r=s.code,a=s.immediateClose;S.postMessage(e.highlight(r,e.languages[l],l)),a&&S.close()},!1)),S.Prism}();typeof module!="undefined"&&module.exports&&(module.exports=x);typeof global!="undefined"&&(global.Prism=x);x.languages.markup={comment:/<!--[\s\S]*?-->/,prolog:/<\?[\s\S]+?\?>/,doctype:/<!DOCTYPE[\s\S]+?>/i,cdata:/<!\[CDATA\[[\s\S]*?]]>/i,tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/i,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+)/i,inside:{punctuation:[/^=/,{pattern:/(^|[^\\])["']/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/&#?[\da-z]{1,8};/i};x.languages.markup.tag.inside["attr-value"].inside.entity=x.languages.markup.entity;x.hooks.add("wrap",o=>{o.type==="entity"&&(o.attributes.title=o.content.replace(/&/,"&"))});x.languages.xml=x.languages.markup;x.languages.html=x.languages.markup;x.languages.mathml=x.languages.markup;x.languages.svg=x.languages.markup;x.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-]+?.*?(?:;|(?=\s*\{))/i,inside:{rule:/@[\w-]+/}},url:/url\((?:(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,selector:/[^{}\s][^{};]*?(?=\s*\{)/,string:{pattern:/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},property:/[-_a-z\xA0-\uFFFF][-\w\xA0-\uFFFF]*(?=\s*:)/i,important:/\B!important\b/i,function:/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:]/};x.languages.css.atrule.inside.rest=x.languages.css;x.languages.markup&&(x.languages.insertBefore("markup","tag",{style:{pattern:/(<style[\s\S]*?>)[\s\S]*?(?=<\/style>)/i,lookbehind:!0,inside:x.languages.css,alias:"language-css",greedy:!0}}),x.languages.insertBefore("inside","attr-value",{"style-attr":{pattern:/\s*style=("|')(?:\\[\s\S]|(?!\1)[^\\])*\1/i,inside:{"attr-name":{pattern:/^\s*style/i,inside:x.languages.markup.tag.inside},punctuation:/^\s*=\s*['"]|['"]\s*$/,"attr-value":{pattern:/.+/i,inside:x.languages.css}},alias:"language-css"}},x.languages.markup.tag));x.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,boolean:/\b(?:true|false)\b/,function:/[a-z0-9_]+(?=\()/i,number:/\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/};x.languages.javascript=x.languages.extend("clike",{keyword:/\b(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield)\b/,number:/\b(?:0[xX][\dA-Fa-f]+|0[bB][01]+|0[oO][0-7]+|NaN|Infinity)\b|(?:\b\d+\.?\d*|\B\.\d+)(?:[Ee][+-]?\d+)?/,function:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*\()/i,operator:/-[-=]?|\+[+=]?|!=?=?|<<?=?|>>?>?=?|=(?:==?|>)?|&[&=]?|\|[|=]?|\*\*?=?|\/=?|~|\^=?|%=?|\?|\.{3}/});x.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s])\s*)\/(\[[^\]\r\n]+]|\\.|[^/\\\[\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})\]]))/,lookbehind:!0,greedy:!0},"function-variable":{pattern:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=\s*(?:function\b|(?:\([^()]*\)|[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/i,alias:"function"},constant:/\b[A-Z][A-Z\d_]*\b/});x.languages.insertBefore("javascript","string",{"template-string":{pattern:/`(?:\\[\s\S]|\${[^}]+}|[^\\`])*`/,greedy:!0,inside:{interpolation:{pattern:/\${[^}]+}/,inside:{"interpolation-punctuation":{pattern:/^\${|}$/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}}});x.languages.javascript["template-string"].inside.interpolation.inside.rest=x.languages.javascript;x.languages.markup&&x.languages.insertBefore("markup","tag",{script:{pattern:/(<script[\s\S]*?>)[\s\S]*?(?=<\/script>)/i,lookbehind:!0,inside:x.languages.javascript,alias:"language-javascript",greedy:!0}});x.languages.js=x.languages.javascript;var X=x;function ee(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}var P=ee();function he(o){P=o}var pe=/[&<>"']/,ge=/[&<>"']/g,fe=/[<>"']|&(?!#?\w+;)/,de=/[<>"']|&(?!#?\w+;)/g,me={"&":"&","<":"<",">":">",'"':""","'":"'"},te=o=>me[o];function y(o,t){if(t){if(pe.test(o))return o.replace(ge,te)}else if(fe.test(o))return o.replace(de,te);return o}var ke=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function ne(o){return o.replace(ke,(t,e)=>(e=e.toLowerCase(),e==="colon"?":":e.charAt(0)==="#"?e.charAt(1)==="x"?String.fromCharCode(parseInt(e.substring(2),16)):String.fromCharCode(+e.substring(1)):""))}var xe=/(^|[^\[])\^/g;function b(o,t){o=o.source||o,t=t||"";let e={replace:(n,i)=>(i=i.source||i,i=i.replace(xe,"$1"),o=o.replace(n,i),e),getRegex:()=>new RegExp(o,t)};return e}var be=/[^\w:]/g,we=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function ie(o,t,e){if(o){let n;try{n=decodeURIComponent(ne(e)).replace(be,"").toLowerCase()}catch(i){return null}if(n.indexOf("javascript:")===0||n.indexOf("vbscript:")===0||n.indexOf("data:")===0)return null}t&&!we.test(e)&&(e=ye(t,e));try{e=encodeURI(e).replace(/%25/g,"%")}catch(n){return null}return e}var N={},_e=/^[^:]+:\/*[^/]*$/,ze=/^([^:]+:)[\s\S]*$/,Se=/^([^:]+:\/*[^/]*)[\s\S]*$/;function ye(o,t){N[" "+o]||(_e.test(o)?N[" "+o]=o+"/":N[" "+o]=U(o,"/",!0)),o=N[" "+o];let e=o.indexOf(":")===-1;return t.substring(0,2)==="//"?e?t:o.replace(ze,"$1")+t:t.charAt(0)==="/"?e?t:o.replace(Se,"$1")+t:o+t}var M={exec:function(){}};function T(o){let t=1,e,n;for(;t<arguments.length;t++){e=arguments[t];for(n in e)Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n])}return o}function se(o,t){let e=o.replace(/\|/g,(s,l,r)=>{let a=!1,u=l;for(;--u>=0&&r[u]==="\\";)a=!a;return a?"|":" |"}),n=e.split(/ \|/),i=0;if(n[0].trim()||n.shift(),n[n.length-1].trim()||n.pop(),n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;i<n.length;i++)n[i]=n[i].trim().replace(/\\\|/g,"|");return n}function U(o,t,e){let n=o.length;if(n===0)return"";let i=0;for(;i<n;){let s=o.charAt(n-i-1);if(s===t&&!e)i++;else if(s!==t&&e)i++;else break}return o.substr(0,n-i)}function $e(o,t){if(o.indexOf(t[1])===-1)return-1;let e=o.length,n=0,i=0;for(;i<e;i++)if(o[i]==="\\")i++;else if(o[i]===t[0])n++;else if(o[i]===t[1]&&(n--,n<0))return i;return-1}function re(o){o&&o.sanitize&&!o.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function le(o,t){if(t<1)return"";let e="";for(;t>1;)t&1&&(e+=o),t>>=1,o+=o;return e+o}function ae(o,t,e,n){let i=t.href,s=t.title?y(t.title):null,l=o[1].replace(/\\([\[\]])/g,"$1");if(o[0].charAt(0)!=="!"){n.state.inLink=!0;let r={type:"link",raw:e,href:i,title:s,text:l,tokens:n.inlineTokens(l,[])};return n.state.inLink=!1,r}else return{type:"image",raw:e,href:i,title:s,text:y(l)}}function Ae(o,t){let e=o.match(/^(\s+)(?:```)/);if(e===null)return t;let n=e[1];return t.split(`
`).map(i=>{let s=i.match(/^\s+/);if(s===null)return i;let[l]=s;return l.length>=n.length?i.slice(n.length):i}).join(`
`)}var Q=class{constructor(t){this.options=t||P}space(t){let e=this.rules.block.newline.exec(t);if(e)return e[0].length>1?{type:"space",raw:e[0]}:{raw:`
`}}code(t){let e=this.rules.block.code.exec(t);if(e){let n=e[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:U(n,`
`)}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let n=e[0],i=Ae(n,e[3]||"");return{type:"code",raw:n,lang:e[2]?e[2].trim():e[2],text:i}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(/#$/.test(n)){let s=U(n,"#");(this.options.pedantic||!s||/ $/.test(s))&&(n=s.trim())}let i={type:"heading",raw:e[0],depth:e[1].length,text:n,tokens:[]};return this.lexer.inline(i.text,i.tokens),i}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:e[0]}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let n=e[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:e[0],tokens:this.lexer.blockTokens(n,[]),text:n}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n,i,s,l,r,a,u,g,p,m,h=e[1].trim(),$=h.length>1,k={type:"list",raw:"",ordered:$,start:$?+h.slice(0,-1):"",loose:!1,items:[]};h=$?`\\d{1,9}\\${h.slice(-1)}`:`\\${h}`,this.options.pedantic&&(h=$?h:"[*+-]");let j=new RegExp(`^( {0,3}${h})((?: [^\\n]*| *)(?:\\n[^\\n]*)*(?:\\n|$))`);for(;t&&!(this.rules.block.hr.test(t)||!(e=j.exec(t)));){p=e[2].split(`
`),this.options.pedantic?(l=2,m=p[0].trimLeft()):(l=e[2].search(/[^ ]/),l=e[1].length+(l>4?1:l),m=p[0].slice(l-e[1].length)),a=!1,n=e[0],!p[0]&&/^ *$/.test(p[1])&&(n=e[1]+p.slice(0,2).join(`
`)+`
`,k.loose=!0,p=[]);let w=new RegExp(`^ {0,${Math.min(3,l-1)}}(?:[*+-]|\\d{1,9}[.)])`);for(r=1;r<p.length;r++){if(g=p[r],this.options.pedantic&&(g=g.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),w.test(g)){n=e[1]+p.slice(0,r).join(`
`)+`
`;break}if(!a){g.trim()||(a=!0),g.search(/[^ ]/)>=l?m+=`
`+g.slice(l):m+=`
`+g;continue}if(g.search(/[^ ]/)>=l||!g.trim()){m+=`
`+g.slice(l);continue}else{n=e[1]+p.slice(0,r).join(`
`)+`
`;break}}k.loose||(u?k.loose=!0:/\n *\n *$/.test(n)&&(u=!0)),this.options.gfm&&(i=/^\[[ xX]\] /.exec(m),i&&(s=i[0]!=="[ ] ",m=m.replace(/^\[[ xX]\] +/,""))),k.items.push({type:"list_item",raw:n,task:!!i,checked:s,loose:!1,text:m}),k.raw+=n,t=t.slice(n.length)}k.items[k.items.length-1].raw=n.trimRight(),k.items[k.items.length-1].text=m.trimRight(),k.raw=k.raw.trimRight();let R=k.items.length;for(r=0;r<R;r++)this.lexer.state.top=!1,k.items[r].tokens=this.lexer.blockTokens(k.items[r].text,[]),k.items[r].tokens.some(w=>w.type==="space")&&(k.loose=!0,k.items[r].loose=!0);return k}}html(t){let e=this.rules.block.html.exec(t);if(e){let n={type:"html",raw:e[0],pre:!this.options.sanitizer&&(e[1]==="pre"||e[1]==="script"||e[1]==="style"),text:e[0]};return this.options.sanitize&&(n.type="paragraph",n.text=this.options.sanitizer?this.options.sanitizer(e[0]):y(e[0]),n.tokens=[],this.lexer.inline(n.text,n.tokens)),n}}def(t){let e=this.rules.block.def.exec(t);if(e){e[3]&&(e[3]=e[3].substring(1,e[3].length-1));let n=e[1].toLowerCase().replace(/\s+/g," ");return{type:"def",tag:n,raw:e[0],href:e[2],title:e[3]}}}table(t){let e=this.rules.block.table.exec(t);if(e){let n={type:"table",header:se(e[1]).map(i=>({text:i})),align:e[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:e[3]?e[3].replace(/\n$/,"").split(`
`):[]};if(n.header.length===n.align.length){n.raw=e[0];let i=n.align.length,s,l,r,a;for(s=0;s<i;s++)/^ *-+: *$/.test(n.align[s])?n.align[s]="right":/^ *:-+: *$/.test(n.align[s])?n.align[s]="center":/^ *:-+ *$/.test(n.align[s])?n.align[s]="left":n.align[s]=null;for(i=n.rows.length,s=0;s<i;s++)n.rows[s]=se(n.rows[s],n.header.length).map(u=>({text:u}));for(i=n.header.length,l=0;l<i;l++)n.header[l].tokens=[],this.lexer.inlineTokens(n.header[l].text,n.header[l].tokens);for(i=n.rows.length,l=0;l<i;l++)for(a=n.rows[l],r=0;r<a.length;r++)a[r].tokens=[],this.lexer.inlineTokens(a[r].text,a[r].tokens);return n}}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e){let n={type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:[]};return this.lexer.inline(n.text,n.tokens),n}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let n={type:"paragraph",raw:e[0],text:e[1].charAt(e[1].length-1)===`
`?e[1].slice(0,-1):e[1],tokens:[]};return this.lexer.inline(n.text,n.tokens),n}}text(t){let e=this.rules.block.text.exec(t);if(e){let n={type:"text",raw:e[0],text:e[0],tokens:[]};return this.lexer.inline(n.text,n.tokens),n}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:y(e[1])}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&/^<a /i.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(e[0]):y(e[0]):e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let n=e[2].trim();if(!this.options.pedantic&&/^</.test(n)){if(!/>$/.test(n))return;let l=U(n.slice(0,-1),"\\");if((n.length-l.length)%2==0)return}else{let l=$e(e[2],"()");if(l>-1){let a=(e[0].indexOf("!")===0?5:4)+e[1].length+l;e[2]=e[2].substring(0,l),e[0]=e[0].substring(0,a).trim(),e[3]=""}}let i=e[2],s="";if(this.options.pedantic){let l=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i);l&&(i=l[1],s=l[3])}else s=e[3]?e[3].slice(1,-1):"";return i=i.trim(),/^</.test(i)&&(this.options.pedantic&&!/>$/.test(n)?i=i.slice(1):i=i.slice(1,-1)),ae(e,{href:i&&i.replace(this.rules.inline._escapes,"$1"),title:s&&s.replace(this.rules.inline._escapes,"$1")},e[0],this.lexer)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let i=(n[2]||n[1]).replace(/\s+/g," ");if(i=e[i.toLowerCase()],!i||!i.href){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return ae(n,i,n[0],this.lexer)}}emStrong(t,e,n=""){let i=this.rules.inline.emStrong.lDelim.exec(t);if(!i||i[3]&&n.match(/[\p{L}\p{N}]/u))return;let s=i[1]||i[2]||"";if(!s||s&&(n===""||this.rules.inline.punctuation.exec(n))){let l=i[0].length-1,r,a,u=l,g=0,p=i[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(p.lastIndex=0,e=e.slice(-1*t.length+l);(i=p.exec(e))!=null;){if(r=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!r)continue;if(a=r.length,i[3]||i[4]){u+=a;continue}else if((i[5]||i[6])&&l%3&&!((l+a)%3)){g+=a;continue}if(u-=a,u>0)continue;if(a=Math.min(a,a+u+g),Math.min(l,a)%2){let h=t.slice(1,l+i.index+a);return{type:"em",raw:t.slice(0,l+i.index+a+1),text:h,tokens:this.lexer.inlineTokens(h,[])}}let m=t.slice(2,l+i.index+a-1);return{type:"strong",raw:t.slice(0,l+i.index+a+1),text:m,tokens:this.lexer.inlineTokens(m,[])}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let n=e[2].replace(/\n/g," "),i=/[^ ]/.test(n),s=/^ /.test(n)&&/ $/.test(n);return i&&s&&(n=n.substring(1,n.length-1)),n=y(n,!0),{type:"codespan",raw:e[0],text:n}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t){let e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2],[])}}autolink(t,e){let n=this.rules.inline.autolink.exec(t);if(n){let i,s;return n[2]==="@"?(i=y(this.options.mangle?e(n[1]):n[1]),s="mailto:"+i):(i=y(n[1]),s=i),{type:"link",raw:n[0],text:i,href:s,tokens:[{type:"text",raw:i,text:i}]}}}url(t,e){let n;if(n=this.rules.inline.url.exec(t)){let i,s;if(n[2]==="@")i=y(this.options.mangle?e(n[0]):n[0]),s="mailto:"+i;else{let l;do l=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0];while(l!==n[0]);i=y(n[0]),n[1]==="www."?s="http://"+i:s=i}return{type:"link",raw:n[0],text:i,href:s,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(t,e){let n=this.rules.inline.text.exec(t);if(n){let i;return this.lexer.state.inRawBlock?i=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):y(n[0]):n[0]:i=y(this.options.smartypants?e(n[0]):n[0]),{type:"text",raw:n[0],text:i}}}},d={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)( [^\n]+?)?(?:\n|$)/,html:"^ {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|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:M,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/};d._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/;d._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;d.def=b(d.def).replace("label",d._label).replace("title",d._title).getRegex();d.bullet=/(?:[*+-]|\d{1,9}[.)])/;d.listItemStart=b(/^( *)(bull) */).replace("bull",d.bullet).getRegex();d.list=b(d.list).replace(/bull/g,d.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+d.def.source+")").getRegex();d._tag="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|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";d._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/;d.html=b(d.html,"i").replace("comment",d._comment).replace("tag",d._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();d.paragraph=b(d._paragraph).replace("hr",d.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").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",d._tag).getRegex();d.blockquote=b(d.blockquote).replace("paragraph",d.paragraph).getRegex();d.normal=T({},d);d.gfm=T({},d.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"});d.gfm.table=b(d.gfm.table).replace("hr",d.hr).replace("heading"," {0,3}#{1,6} ").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",d._tag).getRegex();d.pedantic=T({},d.normal,{html:b(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",d._comment).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:M,paragraph:b(d.normal._paragraph).replace("hr",d.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",d.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var c={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:M,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^[^_*]*?\_\_[^_*]*?\*[^_*]*?(?=\_\_)|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?\_[^_*]*?(?=\*\*)|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:M,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};c._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~";c.punctuation=b(c.punctuation).replace(/punctuation/g,c._punctuation).getRegex();c.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;c.escapedEmSt=/\\\*|\\_/g;c._comment=b(d._comment).replace("(?:-->|$)","-->").getRegex();c.emStrong.lDelim=b(c.emStrong.lDelim).replace(/punct/g,c._punctuation).getRegex();c.emStrong.rDelimAst=b(c.emStrong.rDelimAst,"g").replace(/punct/g,c._punctuation).getRegex();c.emStrong.rDelimUnd=b(c.emStrong.rDelimUnd,"g").replace(/punct/g,c._punctuation).getRegex();c._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;c._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;c._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])?)+(?![-_])/;c.autolink=b(c.autolink).replace("scheme",c._scheme).replace("email",c._email).getRegex();c._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;c.tag=b(c.tag).replace("comment",c._comment).replace("attribute",c._attribute).getRegex();c._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;c._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;c._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;c.link=b(c.link).replace("label",c._label).replace("href",c._href).replace("title",c._title).getRegex();c.reflink=b(c.reflink).replace("label",c._label).getRegex();c.reflinkSearch=b(c.reflinkSearch,"g").replace("reflink",c.reflink).replace("nolink",c.nolink).getRegex();c.normal=T({},c);c.pedantic=T({},c.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:b(/^!?\[(label)\]\((.*?)\)/).replace("label",c._label).getRegex(),reflink:b(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",c._label).getRegex()});c.gfm=T({},c.normal,{escape:b(c.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_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.!#$%&'*+\/=?_`{\|}~-]+@)))/});c.gfm.url=b(c.gfm.url,"i").replace("email",c.gfm._extended_email).getRegex();c.breaks=T({},c.gfm,{br:b(c.br).replace("{2,}","*").getRegex(),text:b(c.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});function Te(o){return o.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function oe(o){let t="",e,n,i=o.length;for(e=0;e<i;e++)n=o.charCodeAt(e),Math.random()>.5&&(n="x"+n.toString(16)),t+="&#"+n+";";return t}var v=class{constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||P,this.options.tokenizer=this.options.tokenizer||new Q,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let e={block:d.normal,inline:c.normal};this.options.pedantic?(e.block=d.pedantic,e.inline=c.pedantic):this.options.gfm&&(e.block=d.gfm,this.options.breaks?e.inline=c.breaks:e.inline=c.gfm),this.tokenizer.rules=e}static get rules(){return{block:d,inline:c}}static lex(t,e){return new v(e).lex(t)}static lexInline(t,e){return new v(e).inlineTokens(t)}lex(t){t=t.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(t,this.tokens);let e;for(;e=this.inlineQueue.shift();)this.inlineTokens(e.src,e.tokens);return this.tokens}blockTokens(t,e=[]){this.options.pedantic&&(t=t.replace(/^ +$/gm,""));let n,i,s,l;for(;t;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(r=>(n=r.call({lexer:this},t,e))?(t=t.substring(n.raw.length),e.push(n),!0):!1))){if(n=this.tokenizer.space(t)){t=t.substring(n.raw.length),n.type&&e.push(n);continue}if(n=this.tokenizer.code(t)){t=t.substring(n.raw.length),i=e[e.length-1],i&&(i.type==="paragraph"||i.type==="text")?(i.raw+=`
`+n.raw,i.text+=`
`+n.text,this.inlineQueue[this.inlineQueue.length-1].src=i.text):e.push(n);continue}if(n=this.tokenizer.fences(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.heading(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.hr(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.blockquote(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.list(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.html(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.def(t)){t=t.substring(n.raw.length),i=e[e.length-1],i&&(i.type==="paragraph"||i.type==="text")?(i.raw+=`
`+n.raw,i.text+=`
`+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=i.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title});continue}if(n=this.tokenizer.table(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.lheading(t)){t=t.substring(n.raw.length),e.push(n);continue}if(s=t,this.options.extensions&&this.options.extensions.startBlock){let r=Infinity,a=t.slice(1),u;this.options.extensions.startBlock.forEach(function(g){u=g.call({lexer:this},a),typeof u=="number"&&u>=0&&(r=Math.min(r,u))}),r<Infinity&&r>=0&&(s=t.substring(0,r+1))}if(this.state.top&&(n=this.tokenizer.paragraph(s))){i=e[e.length-1],l&&i.type==="paragraph"?(i.raw+=`
`+n.raw,i.text+=`
`+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):e.push(n),l=s.length!==t.length,t=t.substring(n.raw.length);continue}if(n=this.tokenizer.text(t)){t=t.substring(n.raw.length),i=e[e.length-1],i&&i.type==="text"?(i.raw+=`
`+n.raw,i.text+=`
`+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):e.push(n);continue}if(t){let r="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(r);break}else throw new Error(r)}}return this.state.top=!0,e}inline(t,e){this.inlineQueue.push({src:t,tokens:e})}inlineTokens(t,e=[]){let n,i,s,l=t,r,a,u;if(this.tokens.links){let g=Object.keys(this.tokens.links);if(g.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(l))!=null;)g.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,r.index)+"["+le("a",r[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.blockSkip.exec(l))!=null;)l=l.slice(0,r.index)+"["+le("a",r[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(r=this.tokenizer.rules.inline.escapedEmSt.exec(l))!=null;)l=l.slice(0,r.index)+"++"+l.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;t;)if(a||(u=""),a=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(g=>(n=g.call({lexer:this},t,e))?(t=t.substring(n.raw.length),e.push(n),!0):!1))){if(n=this.tokenizer.escape(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.tag(t)){t=t.substring(n.raw.length),i=e[e.length-1],i&&n.type==="text"&&i.type==="text"?(i.raw+=n.raw,i.text+=n.text):e.push(n);continue}if(n=this.tokenizer.link(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(n.raw.length),i=e[e.length-1],i&&n.type==="text"&&i.type==="text"?(i.raw+=n.raw,i.text+=n.text):e.push(n);continue}if(n=this.tokenizer.emStrong(t,l,u)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.codespan(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.br(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.del(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.autolink(t,oe)){t=t.substring(n.raw.length),e.push(n);continue}if(!this.state.inLink&&(n=this.tokenizer.url(t,oe))){t=t.substring(n.raw.length),e.push(n);continue}if(s=t,this.options.extensions&&this.options.extensions.startInline){let g=Infinity,p=t.slice(1),m;this.options.extensions.startInline.forEach(function(h){m=h.call({lexer:this},p),typeof m=="number"&&m>=0&&(g=Math.min(g,m))}),g<Infinity&&g>=0&&(s=t.substring(0,g+1))}if(n=this.tokenizer.inlineText(s,Te)){t=t.substring(n.raw.length),n.raw.slice(-1)!=="_"&&(u=n.raw.slice(-1)),a=!0,i=e[e.length-1],i&&i.type==="text"?(i.raw+=n.raw,i.text+=n.text):e.push(n);continue}if(t){let g="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(g);break}else throw new Error(g)}}return e}},H=class{constructor(t){this.options=t||P}code(t,e,n){let i=(e||"").match(/\S*/)[0];if(this.options.highlight){let s=this.options.highlight(t,i);s!=null&&s!==t&&(n=!0,t=s)}return t=t.replace(/\n$/,"")+`
`,i?'<pre><code class="'+this.options.langPrefix+y(i,!0)+'">'+(n?t:y(t,!0))+`</code></pre>
`:"<pre><code>"+(n?t:y(t,!0))+`</code></pre>
`}blockquote(t){return`<blockquote>
`+t+`</blockquote>
`}html(t){return t}heading(t,e,n,i){return this.options.headerIds?"<h"+e+' id="'+this.options.headerPrefix+i.slug(n)+'">'+t+"</h"+e+`>
`:"<h"+e+">"+t+"</h"+e+`>
`}hr(){return this.options.xhtml?`<hr/>
`:`<hr>
`}list(t,e,n){let i=e?"ol":"ul",s=e&&n!==1?' start="'+n+'"':"";return"<"+i+s+`>
`+t+"</"+i+`>
`}listitem(t){return"<li>"+t+`</li>
`}checkbox(t){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "}paragraph(t){return"<p>"+t+`</p>
`}table(t,e){return e&&(e="<tbody>"+e+"</tbody>"),`<table>
<thead>
`+t+`</thead>
`+e+`</table>
`}tablerow(t){return`<tr>
`+t+`</tr>
`}tablecell(t,e){let n=e.header?"th":"td";return(e.align?"<"+n+' align="'+e.align+'">':"<"+n+">")+t+"</"+n+`>
`}strong(t){return"<strong>"+t+"</strong>"}em(t){return"<em>"+t+"</em>"}codespan(t){return"<code>"+t+"</code>"}br(){return this.options.xhtml?"<br/>":"<br>"}del(t){return"<del>"+t+"</del>"}link(t,e,n){if(t=ie(this.options.sanitize,this.options.baseUrl,t),t===null)return n;let i='<a href="'+y(t)+'"';return e&&(i+=' title="'+e+'"'),i+=">"+n+"</a>",i}image(t,e,n){if(t=ie(this.options.sanitize,this.options.baseUrl,t),t===null)return n;let i='<img src="'+t+'" alt="'+n+'"';return e&&(i+=' title="'+e+'"'),i+=this.options.xhtml?"/>":">",i}text(t){return t}},J=class{strong(t){return t}em(t){return t}codespan(t){return t}del(t){return t}html(t){return t}text(t){return t}link(t,e,n){return""+n}image(t,e,n){return""+n}br(){return""}},Y=class{constructor(){this.seen={}}serialize(t){return t.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(t,e){let n=t,i=0;if(this.seen.hasOwnProperty(n)){i=this.seen[t];do i++,n=t+"-"+i;while(this.seen.hasOwnProperty(n))}return e||(this.seen[t]=i,this.seen[n]=0),n}slug(t,e={}){let n=this.serialize(t);return this.getNextSafeSlug(n,e.dryrun)}},I=class{constructor(t){this.options=t||P,this.options.renderer=this.options.renderer||new H,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new J,this.slugger=new Y}static parse(t,e){return new I(e).parse(t)}static parseInline(t,e){return new I(e).parseInline(t)}parse(t,e=!0){let n="",i,s,l,r,a,u,g,p,m,h,$,k,j,R,w,F,D,E,z,A=t.length;for(i=0;i<A;i++){if(h=t[i],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[h.type]&&(z=this.options.extensions.renderers[h.type].call({parser:this},h),z!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(h.type))){n+=z||"";continue}switch(h.type){case"space":continue;case"hr":{n+=this.renderer.hr();continue}case"heading":{n+=this.renderer.heading(this.parseInline(h.tokens),h.depth,ne(this.parseInline(h.tokens,this.textRenderer)),this.slugger);continue}case"code":{n+=this.renderer.code(h.text,h.lang,h.escaped);continue}case"table":{for(p="",g="",r=h.header.length,s=0;s<r;s++)g+=this.renderer.tablecell(this.parseInline(h.header[s].tokens),{header:!0,align:h.align[s]});for(p+=this.renderer.tablerow(g),m="",r=h.rows.length,s=0;s<r;s++){for(u=h.rows[s],g="",a=u.length,l=0;l<a;l++)g+=this.renderer.tablecell(this.parseInline(u[l].tokens),{header:!1,align:h.align[l]});m+=this.renderer.tablerow(g)}n+=this.renderer.table(p,m);continue}case"blockquote":{m=this.parse(h.tokens),n+=this.renderer.blockquote(m);continue}case"list":{for($=h.ordered,k=h.start,j=h.loose,r=h.items.length,m="",s=0;s<r;s++)w=h.items[s],F=w.checked,D=w.task,R="",w.task&&(E=this.renderer.checkbox(F),j?w.tokens.length>0&&w.tokens[0].type==="paragraph"?(w.tokens[0].text=E+" "+w.tokens[0].text,w.tokens[0].tokens&&w.tokens[0].tokens.length>0&&w.tokens[0].tokens[0].type==="text"&&(w.tokens[0].tokens[0].text=E+" "+w.tokens[0].tokens[0].text)):w.tokens.unshift({type:"text",text:E}):R+=E),R+=this.parse(w.tokens,j),m+=this.renderer.listitem(R,D,F);n+=this.renderer.list(m,$,k);continue}case"html":{n+=this.renderer.html(h.text);continue}case"paragraph":{n+=this.renderer.paragraph(this.parseInline(h.tokens));continue}case"text":{for(m=h.tokens?this.parseInline(h.tokens):h.text;i+1<A&&t[i+1].type==="text";)h=t[++i],m+=`
`+(h.tokens?this.parseInline(h.tokens):h.text);n+=e?this.renderer.paragraph(m):m;continue}default:{let C='Token with "'+h.type+'" type was not found.';if(this.options.silent){console.error(C);return}else throw new Error(C)}}}return n}parseInline(t,e){e=e||this.renderer;let n="",i,s,l,r=t.length;for(i=0;i<r;i++){if(s=t[i],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[s.type]&&(l=this.options.extensions.renderers[s.type].call({parser:this},s),l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type))){n+=l||"";continue}switch(s.type){case"escape":{n+=e.text(s.text);break}case"html":{n+=e.html(s.text);break}case"link":{n+=e.link(s.href,s.title,this.parseInline(s.tokens,e));break}case"image":{n+=e.image(s.href,s.title,s.text);break}case"strong":{n+=e.strong(this.parseInline(s.tokens,e));break}case"em":{n+=e.em(this.parseInline(s.tokens,e));break}case"codespan":{n+=e.codespan(s.text);break}case"br":{n+=e.br();break}case"del":{n+=e.del(this.parseInline(s.tokens,e));break}case"text":{n+=e.text(s.text);break}default:{let a='Token with "'+s.type+'" type was not found.';if(this.options.silent){console.error(a);return}else throw new Error(a)}}}return n}};function f(o,t,e){if(typeof o=="undefined"||o===null)throw new Error("marked(): input parameter is undefined or null");if(typeof o!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(o)+", string expected");if(typeof t=="function"&&(e=t,t=null),t=T({},f.defaults,t||{}),re(t),e){let n=t.highlight,i;try{i=v.lex(o,t)}catch(r){return e(r)}let s=function(r){let a;if(!r)try{t.walkTokens&&f.walkTokens(i,t.walkTokens),a=I.parse(i,t)}catch(u){r=u}return t.highlight=n,r?e(r):e(null,a)};if(!n||n.length<3||(delete t.highlight,!i.length))return s();let l=0;f.walkTokens(i,function(r){r.type==="code"&&(l++,setTimeout(()=>{n(r.text,r.lang,function(a,u){if(a)return s(a);u!=null&&u!==r.text&&(r.text=u,r.escaped=!0),l--,l===0&&s()})},0))}),l===0&&s();return}try{let n=v.lex(o,t);return t.walkTokens&&f.walkTokens(n,t.walkTokens),I.parse(n,t)}catch(n){if(n.message+=`
Please report this to https://github.com/markedjs/marked.`,t.silent)return"<p>An error occurred:</p><pre>"+y(n.message+"",!0)+"</pre>";throw n}}f.options=f.setOptions=function(o){return T(f.defaults,o),he(f.defaults),f};f.getDefaults=ee;f.defaults=P;f.use=function(...o){let t=T({},...o),e=f.defaults.extensions||{renderers:{},childTokens:{}},n;o.forEach(i=>{if(i.extensions&&(n=!0,i.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if(s.renderer){let l=e.renderers?e.renderers[s.name]:null;l?e.renderers[s.name]=function(...r){let a=s.renderer.apply(this,r);return a===!1&&(a=l.apply(this,r)),a}:e.renderers[s.name]=s.renderer}if(s.tokenizer){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");e[s.level]?e[s.level].unshift(s.tokenizer):e[s.level]=[s.tokenizer],s.start&&(s.level==="block"?e.startBlock?e.startBlock.push(s.start):e.startBlock=[s.start]:s.level==="inline"&&(e.startInline?e.startInline.push(s.start):e.startInline=[s.start]))}s.childTokens&&(e.childTokens[s.name]=s.childTokens)})),i.renderer){let s=f.defaults.renderer||new H;for(let l in i.renderer){let r=s[l];s[l]=(...a)=>{let u=i.renderer[l].apply(s,a);return u===!1&&(u=r.apply(s,a)),u}}t.renderer=s}if(i.tokenizer){let s=f.defaults.tokenizer||new Q;for(let l in i.tokenizer){let r=s[l];s[l]=(...a)=>{let u=i.tokenizer[l].apply(s,a);return u===!1&&(u=r.apply(s,a)),u}}t.tokenizer=s}if(i.walkTokens){let s=f.defaults.walkTokens;t.walkTokens=function(l){i.walkTokens.call(this,l),s&&s.call(this,l)}}n&&(t.extensions=e),f.setOptions(t)})};f.walkTokens=function(o,t){for(let e of o)switch(t.call(f,e),e.type){case"table":{for(let n of e.header)f.walkTokens(n.tokens,t);for(let n of e.rows)for(let i of n)f.walkTokens(i.tokens,t);break}case"list":{f.walkTokens(e.items,t);break}default:f.defaults.extensions&&f.defaults.extensions.childTokens&&f.defaults.extensions.childTokens[e.type]?f.defaults.extensions.childTokens[e.type].forEach(function(n){f.walkTokens(e[n],t)}):e.tokens&&f.walkTokens(e.tokens,t)}};f.parseInline=function(o,t){if(typeof o=="undefined"||o===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof o!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(o)+", string expected");t=T({},f.defaults,t||{}),re(t);try{let e=v.lexInline(o,t);return t.walkTokens&&f.walkTokens(e,t.walkTokens),I.parseInline(e,t)}catch(e){if(e.message+=`
Please report this to https://github.com/markedjs/marked.`,t.silent)return"<p>An error occurred:</p><pre>"+y(e.message+"",!0)+"</pre>";throw e}};f.Parser=I;f.parser=I.parse;f.Renderer=H;f.TextRenderer=J;f.Lexer=v;f.lexer=v.lex;f.Tokenizer=Q;f.Slugger=Y;f.parse=f;var Re=f.options,je=f.setOptions,Ce=f.use,Fe=f.walkTokens,Ee=f.parseInline;var Oe=I.parse,Le=v.lex;self.Prism=X;var O=class extends HTMLElement{static get observedAttributes(){return["src"]}attributeChangedCallback(t,e,n){e!==n&&(this[t]=n)}get src(){return this.getAttribute("src")}set src(t){this.setAttribute("src",t),this.setSrc(t)}get value(){return this.__value}set value(t){this.__value=t,this.setValue()}constructor(){super();this.__value=""}async connectedCallback(){this.style.display="block";let t=this.getElementsByTagName("script")[0];if(t){if(t.getAttribute("type")==="wc-content"){let e=O.dedentText(t.innerHTML);e=e.replace(/<(\/?script)(.*?)>/g,"<$1$2>"),this.value=e}}else this.textContent&&(this.__value=this.textContent,this.setValue())}async setSrc(t){this.__value=await this.fetchSrc(t),this.setValue()}async fetchSrc(t){return(await fetch(t)).text()}setValue(){let t=this.__value;t=O.prepare(t),t=O.toHtml(t),this.innerHTML=t,this.hasAttribute("highlight")&&O.highlight(this)}static prepare(t){return t.split(`
`).map(e=>(e=e.replace("<","<"),e.replace(">",">"))).join(`
`)}static toHtml(t){return f(t)}static highlight(t){X.highlightAllUnder(t)}static dedentText(t){let e=t.split(`
`);e[0]===""&&e.splice(0,1);let n=e[0],i=0,l=n[0]===" "?" ":" ";for(;n[i]===l;)i+=1;let r=[];for(let a of e){let u=a;for(let g=0;g<i&&u[0]===l;g++)u=u.substring(1);r.push(u)}return r[r.length-1]===""&&r.splice(r.length-1,1),r.join(`
`)}};customElements.define("wc-markdown",O);export{O as WCMarkdown};