@gui-chat-plugin/markdown 0.0.1 → 0.0.2

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/vue.cjs CHANGED
@@ -1,59 +1,62 @@
1
- "use strict";var _e=Object.defineProperty;var Te=(n,e,t)=>e in n?_e(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var m=(n,e,t)=>Te(n,typeof e!="symbol"?e+"":e,t);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const _=require("./core.cjs"),d=require("vue");function Q(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var $=Q();function pe(n){$=n}var E={exec:()=>null};function f(n,e=""){let t=typeof n=="string"?n:n.source;const r={replace:(s,i)=>{let c=typeof i=="string"?i:i.source;return c=c.replace(w.caret,"$1"),t=t.replace(s,c),r},getRegex:()=>new RegExp(t,e)};return r}var w={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}#`),htmlBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}<(?:[a-z].*>|!--)`,"i")},ze=/^(?:[ \t]*(?:\n|$))+/,Ae=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Ee=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,C=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Ce=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,U=/(?:[*+-]|\d{1,9}[.)])/,he=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ue=f(he).replace(/bull/g,U).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Le=f(he).replace(/bull/g,U).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),F=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Pe=/^[^\n]+/,X=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Ie=f(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",X).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Be=f(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,U).getRegex(),M="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",W=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ne=f("^ {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",W).replace("tag",M).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),de=f(F).replace("hr",C).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",M).getRegex(),Me=f(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",de).getRegex(),Y={blockquote:Me,code:Ae,def:Ie,fences:Ee,heading:Ce,hr:C,html:Ne,lheading:ue,list:Be,newline:ze,paragraph:de,table:E,text:Pe},ie=f("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",C).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\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",M).getRegex(),qe={...Y,lheading:Le,table:ie,paragraph:f(F).replace("hr",C).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ie).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",M).getRegex()},De={...Y,html:f(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",W).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:E,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:f(F).replace("hr",C).replace("heading",` *#{1,6} *[^
2
- ]`).replace("lheading",ue).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Oe=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Ze=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ge=/^( {2,}|\\)\n(?!\s*$)/,Ve=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,q=/[\p{P}\p{S}]/u,J=/[\s\p{P}\p{S}]/u,fe=/[^\s\p{P}\p{S}]/u,je=f(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,J).getRegex(),ke=/(?!~)[\p{P}\p{S}]/u,Ge=/(?!~)[\s\p{P}\p{S}]/u,He=/(?:[^\s\p{P}\p{S}]|~)/u,Qe=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,me=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Ue=f(me,"u").replace(/punct/g,q).getRegex(),Fe=f(me,"u").replace(/punct/g,ke).getRegex(),be="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Xe=f(be,"gu").replace(/notPunctSpace/g,fe).replace(/punctSpace/g,J).replace(/punct/g,q).getRegex(),We=f(be,"gu").replace(/notPunctSpace/g,He).replace(/punctSpace/g,Ge).replace(/punct/g,ke).getRegex(),Ye=f("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,fe).replace(/punctSpace/g,J).replace(/punct/g,q).getRegex(),Je=f(/\\(punct)/,"gu").replace(/punct/g,q).getRegex(),Ke=f(/^<(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(),et=f(W).replace("(?:-->|$)","-->").getRegex(),tt=f("^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",et).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),I=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,nt=f(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",I).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),xe=f(/^!?\[(label)\]\[(ref)\]/).replace("label",I).replace("ref",X).getRegex(),we=f(/^!?\[(ref)\](?:\[\])?/).replace("ref",X).getRegex(),rt=f("reflink|nolink(?!\\()","g").replace("reflink",xe).replace("nolink",we).getRegex(),K={_backpedal:E,anyPunctuation:Je,autolink:Ke,blockSkip:Qe,br:ge,code:Ze,del:E,emStrongLDelim:Ue,emStrongRDelimAst:Xe,emStrongRDelimUnd:Ye,escape:Oe,link:nt,nolink:we,punctuation:je,reflink:xe,reflinkSearch:rt,tag:tt,text:Ve,url:E},st={...K,link:f(/^!?\[(label)\]\((.*?)\)/).replace("label",I).getRegex(),reflink:f(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",I).getRegex()},V={...K,emStrongRDelimAst:We,emStrongLDelim:Fe,url:f(/^((?: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~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},it={...V,br:f(ge).replace("{2,}","*").getRegex(),text:f(V.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},L={normal:Y,gfm:qe,pedantic:De},z={normal:K,gfm:V,breaks:it,pedantic:st},lt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},le=n=>lt[n];function y(n,e){if(e){if(w.escapeTest.test(n))return n.replace(w.escapeReplace,le)}else if(w.escapeTestNoEncode.test(n))return n.replace(w.escapeReplaceNoEncode,le);return n}function ae(n){try{n=encodeURI(n).replace(w.percentDecode,"%")}catch{return null}return n}function oe(n,e){var i;const t=n.replace(w.findPipe,(c,l,p)=>{let a=!1,o=l;for(;--o>=0&&p[o]==="\\";)a=!a;return a?"|":" |"}),r=t.split(w.splitPipe);let s=0;if(r[0].trim()||r.shift(),r.length>0&&!((i=r.at(-1))!=null&&i.trim())&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;s<r.length;s++)r[s]=r[s].trim().replace(w.slashPipe,"|");return r}function A(n,e,t){const r=n.length;if(r===0)return"";let s=0;for(;s<r&&n.charAt(r-s-1)===e;)s++;return n.slice(0,r-s)}function at(n,e){if(n.indexOf(e[1])===-1)return-1;let t=0;for(let r=0;r<n.length;r++)if(n[r]==="\\")r++;else if(n[r]===e[0])t++;else if(n[r]===e[1]&&(t--,t<0))return r;return t>0?-2:-1}function ce(n,e,t,r,s){const i=e.href,c=e.title||null,l=n[1].replace(s.other.outputLinkReplace,"$1");r.state.inLink=!0;const p={type:n[0].charAt(0)==="!"?"image":"link",raw:t,href:i,title:c,text:l,tokens:r.inlineTokens(l)};return r.state.inLink=!1,p}function ot(n,e,t){const r=n.match(t.other.indentCodeCompensation);if(r===null)return e;const s=r[1];return e.split(`
3
- `).map(i=>{const c=i.match(t.other.beginningSpace);if(c===null)return i;const[l]=c;return l.length>=s.length?i.slice(s.length):i}).join(`
4
- `)}var B=class{constructor(n){m(this,"options");m(this,"rules");m(this,"lexer");this.options=n||$}space(n){const e=this.rules.block.newline.exec(n);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(n){const e=this.rules.block.code.exec(n);if(e){const t=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:A(t,`
5
- `)}}}fences(n){const e=this.rules.block.fences.exec(n);if(e){const t=e[0],r=ot(t,e[3]||"",this.rules);return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:r}}}heading(n){const e=this.rules.block.heading.exec(n);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){const r=A(t,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(t=r.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(n){const e=this.rules.block.hr.exec(n);if(e)return{type:"hr",raw:A(e[0],`
6
- `)}}blockquote(n){const e=this.rules.block.blockquote.exec(n);if(e){let t=A(e[0],`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const T=require("./core.cjs"),p=require("vue");function j(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var S=j();function ae(s){S=s}var E={exec:()=>null};function g(s,e=""){let r=typeof s=="string"?s:s.source,n={replace:(t,i)=>{let l=typeof i=="string"?i:i.source;return l=l.replace(b.caret,"$1"),r=r.replace(t,l),n},getRegex:()=>new RegExp(r,e)};return n}var $e=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),b={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:s=>new RegExp(`^( {0,3}${s})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}#`),htmlBeginRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}<(?:[a-z].*>|!--)`,"i")},Se=/^(?:[ \t]*(?:\n|$))+/,Te=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,_e=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,P=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ze=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Q=/(?:[*+-]|\d{1,9}[.)])/,oe=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ce=g(oe).replace(/bull/g,Q).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Ae=g(oe).replace(/bull/g,Q).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),H=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,ve=/^[^\n]+/,G=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Ee=g(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",G).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Pe=g(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Q).getRegex(),N="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",U=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ie=g("^ {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",U).replace("tag",N).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),he=g(H).replace("hr",P).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",N).getRegex(),Ce=g(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",he).getRegex(),F={blockquote:Ce,code:Te,def:Ee,fences:_e,heading:ze,hr:P,html:Ie,lheading:ce,list:Pe,newline:Se,paragraph:he,table:E,text:ve},te=g("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",P).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\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",N).getRegex(),Le={...F,lheading:Ae,table:te,paragraph:g(H).replace("hr",P).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",te).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",N).getRegex()},Be={...F,html:g(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",U).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:E,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:g(H).replace("hr",P).replace("heading",` *#{1,6} *[^
2
+ ]`).replace("lheading",ce).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Ne=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,qe=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,pe=/^( {2,}|\\)\n(?!\s*$)/,Me=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,q=/[\p{P}\p{S}]/u,X=/[\s\p{P}\p{S}]/u,ue=/[^\s\p{P}\p{S}]/u,Oe=g(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,X).getRegex(),de=/(?!~)[\p{P}\p{S}]/u,De=/(?!~)[\s\p{P}\p{S}]/u,Ze=/(?:[^\s\p{P}\p{S}]|~)/u,Ve=g(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",$e?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),ge=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,je=g(ge,"u").replace(/punct/g,q).getRegex(),Qe=g(ge,"u").replace(/punct/g,de).getRegex(),ke="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",He=g(ke,"gu").replace(/notPunctSpace/g,ue).replace(/punctSpace/g,X).replace(/punct/g,q).getRegex(),Ge=g(ke,"gu").replace(/notPunctSpace/g,Ze).replace(/punctSpace/g,De).replace(/punct/g,de).getRegex(),Ue=g("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ue).replace(/punctSpace/g,X).replace(/punct/g,q).getRegex(),Fe=g(/\\(punct)/,"gu").replace(/punct/g,q).getRegex(),Xe=g(/^<(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(),We=g(U).replace("(?:-->|$)","-->").getRegex(),Ye=g("^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",We).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),C=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,Je=g(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",C).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),fe=g(/^!?\[(label)\]\[(ref)\]/).replace("label",C).replace("ref",G).getRegex(),xe=g(/^!?\[(ref)\](?:\[\])?/).replace("ref",G).getRegex(),Ke=g("reflink|nolink(?!\\()","g").replace("reflink",fe).replace("nolink",xe).getRegex(),re=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,W={_backpedal:E,anyPunctuation:Fe,autolink:Xe,blockSkip:Ve,br:pe,code:qe,del:E,emStrongLDelim:je,emStrongRDelimAst:He,emStrongRDelimUnd:Ue,escape:Ne,link:Je,nolink:xe,punctuation:Oe,reflink:fe,reflinkSearch:Ke,tag:Ye,text:Me,url:E},et={...W,link:g(/^!?\[(label)\]\((.*?)\)/).replace("label",C).getRegex(),reflink:g(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",C).getRegex()},O={...W,emStrongRDelimAst:Ge,emStrongLDelim:Qe,url:g(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",re).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\S]|[^\s~\\]))\1(?=[^~]|$)/,text:g(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",re).getRegex()},tt={...O,br:g(pe).replace("{2,}","*").getRegex(),text:g(O.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},I={normal:F,gfm:Le,pedantic:Be},z={normal:W,gfm:O,breaks:tt,pedantic:et},rt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},se=s=>rt[s];function R(s,e){if(e){if(b.escapeTest.test(s))return s.replace(b.escapeReplace,se)}else if(b.escapeTestNoEncode.test(s))return s.replace(b.escapeReplaceNoEncode,se);return s}function ne(s){try{s=encodeURI(s).replace(b.percentDecode,"%")}catch{return null}return s}function le(s,e){let r=s.replace(b.findPipe,(i,l,c)=>{let a=!1,h=l;for(;--h>=0&&c[h]==="\\";)a=!a;return a?"|":" |"}),n=r.split(b.splitPipe),t=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;t<n.length;t++)n[t]=n[t].trim().replace(b.slashPipe,"|");return n}function A(s,e,r){let n=s.length;if(n===0)return"";let t=0;for(;t<n&&s.charAt(n-t-1)===e;)t++;return s.slice(0,n-t)}function st(s,e){if(s.indexOf(e[1])===-1)return-1;let r=0;for(let n=0;n<s.length;n++)if(s[n]==="\\")n++;else if(s[n]===e[0])r++;else if(s[n]===e[1]&&(r--,r<0))return n;return r>0?-2:-1}function ie(s,e,r,n,t){let i=e.href,l=e.title||null,c=s[1].replace(t.other.outputLinkReplace,"$1");n.state.inLink=!0;let a={type:s[0].charAt(0)==="!"?"image":"link",raw:r,href:i,title:l,text:c,tokens:n.inlineTokens(c)};return n.state.inLink=!1,a}function nt(s,e,r){let n=s.match(r.other.indentCodeCompensation);if(n===null)return e;let t=n[1];return e.split(`
3
+ `).map(i=>{let l=i.match(r.other.beginningSpace);if(l===null)return i;let[c]=l;return c.length>=t.length?i.slice(t.length):i}).join(`
4
+ `)}var L=class{options;rules;lexer;constructor(s){this.options=s||S}space(s){let e=this.rules.block.newline.exec(s);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(s){let e=this.rules.block.code.exec(s);if(e){let r=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?r:A(r,`
5
+ `)}}}fences(s){let e=this.rules.block.fences.exec(s);if(e){let r=e[0],n=nt(r,e[3]||"",this.rules);return{type:"code",raw:r,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:n}}}heading(s){let e=this.rules.block.heading.exec(s);if(e){let r=e[2].trim();if(this.rules.other.endingHash.test(r)){let n=A(r,"#");(this.options.pedantic||!n||this.rules.other.endingSpaceChar.test(n))&&(r=n.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(s){let e=this.rules.block.hr.exec(s);if(e)return{type:"hr",raw:A(e[0],`
6
+ `)}}blockquote(s){let e=this.rules.block.blockquote.exec(s);if(e){let r=A(e[0],`
7
7
  `).split(`
8
- `),r="",s="";const i=[];for(;t.length>0;){let c=!1;const l=[];let p;for(p=0;p<t.length;p++)if(this.rules.other.blockquoteStart.test(t[p]))l.push(t[p]),c=!0;else if(!c)l.push(t[p]);else break;t=t.slice(p);const a=l.join(`
9
- `),o=a.replace(this.rules.other.blockquoteSetextReplace,`
10
- $1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
11
- ${a}`:a,s=s?`${s}
12
- ${o}`:o;const u=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(o,i,!0),this.lexer.state.top=u,t.length===0)break;const h=i.at(-1);if((h==null?void 0:h.type)==="code")break;if((h==null?void 0:h.type)==="blockquote"){const b=h,g=b.raw+`
13
- `+t.join(`
14
- `),x=this.blockquote(g);i[i.length-1]=x,r=r.substring(0,r.length-b.raw.length)+x.raw,s=s.substring(0,s.length-b.text.length)+x.text;break}else if((h==null?void 0:h.type)==="list"){const b=h,g=b.raw+`
15
- `+t.join(`
16
- `),x=this.list(g);i[i.length-1]=x,r=r.substring(0,r.length-h.raw.length)+x.raw,s=s.substring(0,s.length-b.raw.length)+x.raw,t=g.substring(i.at(-1).raw.length).split(`
17
- `);continue}}return{type:"blockquote",raw:r,tokens:i,text:s}}}list(n){let e=this.rules.block.list.exec(n);if(e){let t=e[1].trim();const r=t.length>1,s={type:"list",raw:"",ordered:r,start:r?+t.slice(0,-1):"",loose:!1,items:[]};t=r?`\\d{1,9}\\${t.slice(-1)}`:`\\${t}`,this.options.pedantic&&(t=r?t:"[*+-]");const i=this.rules.other.listItemRegex(t);let c=!1;for(;n;){let p=!1,a="",o="";if(!(e=i.exec(n))||this.rules.block.hr.test(n))break;a=e[0],n=n.substring(a.length);let u=e[2].split(`
18
- `,1)[0].replace(this.rules.other.listReplaceTabs,D=>" ".repeat(3*D.length)),h=n.split(`
19
- `,1)[0],b=!u.trim(),g=0;if(this.options.pedantic?(g=2,o=u.trimStart()):b?g=e[1].length+1:(g=e[2].search(this.rules.other.nonSpaceChar),g=g>4?1:g,o=u.slice(g),g+=e[1].length),b&&this.rules.other.blankLine.test(h)&&(a+=h+`
20
- `,n=n.substring(h.length+1),p=!0),!p){const D=this.rules.other.nextBulletRegex(g),ne=this.rules.other.hrRegex(g),re=this.rules.other.fencesBeginRegex(g),se=this.rules.other.headingBeginRegex(g),$e=this.rules.other.htmlBeginRegex(g);for(;n;){const O=n.split(`
21
- `,1)[0];let T;if(h=O,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting," "),T=h):T=h.replace(this.rules.other.tabCharGlobal," "),re.test(h)||se.test(h)||$e.test(h)||D.test(h)||ne.test(h))break;if(T.search(this.rules.other.nonSpaceChar)>=g||!h.trim())o+=`
22
- `+T.slice(g);else{if(b||u.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||re.test(u)||se.test(u)||ne.test(u))break;o+=`
23
- `+h}!b&&!h.trim()&&(b=!0),a+=O+`
24
- `,n=n.substring(O.length+1),u=T.slice(g)}}s.loose||(c?s.loose=!0:this.rules.other.doubleBlankLine.test(a)&&(c=!0));let x=null,te;this.options.gfm&&(x=this.rules.other.listIsTask.exec(o),x&&(te=x[0]!=="[ ] ",o=o.replace(this.rules.other.listReplaceTask,""))),s.items.push({type:"list_item",raw:a,task:!!x,checked:te,loose:!1,text:o,tokens:[]}),s.raw+=a}const l=s.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let p=0;p<s.items.length;p++)if(this.lexer.state.top=!1,s.items[p].tokens=this.lexer.blockTokens(s.items[p].text,[]),!s.loose){const a=s.items[p].tokens.filter(u=>u.type==="space"),o=a.length>0&&a.some(u=>this.rules.other.anyLine.test(u.raw));s.loose=o}if(s.loose)for(let p=0;p<s.items.length;p++)s.items[p].loose=!0;return s}}html(n){const e=this.rules.block.html.exec(n);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(n){const e=this.rules.block.def.exec(n);if(e){const t=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:e[0],href:r,title:s}}}table(n){var c;const e=this.rules.block.table.exec(n);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;const t=oe(e[1]),r=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=(c=e[3])!=null&&c.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
25
- `):[],i={type:"table",raw:e[0],header:[],align:[],rows:[]};if(t.length===r.length){for(const l of r)this.rules.other.tableAlignRight.test(l)?i.align.push("right"):this.rules.other.tableAlignCenter.test(l)?i.align.push("center"):this.rules.other.tableAlignLeft.test(l)?i.align.push("left"):i.align.push(null);for(let l=0;l<t.length;l++)i.header.push({text:t[l],tokens:this.lexer.inline(t[l]),header:!0,align:i.align[l]});for(const l of s)i.rows.push(oe(l,i.header.length).map((p,a)=>({text:p,tokens:this.lexer.inline(p),header:!1,align:i.align[a]})));return i}}lheading(n){const e=this.rules.block.lheading.exec(n);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(n){const e=this.rules.block.paragraph.exec(n);if(e){const t=e[1].charAt(e[1].length-1)===`
26
- `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(n){const e=this.rules.block.text.exec(n);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(n){const e=this.rules.inline.escape.exec(n);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(n){const e=this.rules.inline.tag.exec(n);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(n){const e=this.rules.inline.link.exec(n);if(e){const t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;const i=A(t.slice(0,-1),"\\");if((t.length-i.length)%2===0)return}else{const i=at(e[2],"()");if(i===-2)return;if(i>-1){const l=(e[0].indexOf("!")===0?5:4)+e[1].length+i;e[2]=e[2].substring(0,i),e[0]=e[0].substring(0,l).trim(),e[3]=""}}let r=e[2],s="";if(this.options.pedantic){const i=this.rules.other.pedanticHrefTitle.exec(r);i&&(r=i[1],s=i[3])}else s=e[3]?e[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?r=r.slice(1):r=r.slice(1,-1)),ce(e,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(n,e){let t;if((t=this.rules.inline.reflink.exec(n))||(t=this.rules.inline.nolink.exec(n))){const r=(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=e[r.toLowerCase()];if(!s){const i=t[0].charAt(0);return{type:"text",raw:i,text:i}}return ce(t,s,t[0],this.lexer,this.rules)}}emStrong(n,e,t=""){let r=this.rules.inline.emStrongLDelim.exec(n);if(!r||r[3]&&t.match(this.rules.other.unicodeAlphaNumeric))return;if(!(r[1]||r[2]||"")||!t||this.rules.inline.punctuation.exec(t)){const i=[...r[0]].length-1;let c,l,p=i,a=0;const o=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(o.lastIndex=0,e=e.slice(-1*n.length+i);(r=o.exec(e))!=null;){if(c=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!c)continue;if(l=[...c].length,r[3]||r[4]){p+=l;continue}else if((r[5]||r[6])&&i%3&&!((i+l)%3)){a+=l;continue}if(p-=l,p>0)continue;l=Math.min(l,l+p+a);const u=[...r[0]][0].length,h=n.slice(0,i+r.index+u+l);if(Math.min(i,l)%2){const g=h.slice(1,-1);return{type:"em",raw:h,text:g,tokens:this.lexer.inlineTokens(g)}}const b=h.slice(2,-2);return{type:"strong",raw:h,text:b,tokens:this.lexer.inlineTokens(b)}}}}codespan(n){const e=this.rules.inline.code.exec(n);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," ");const r=this.rules.other.nonSpaceChar.test(t),s=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return r&&s&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(n){const e=this.rules.inline.br.exec(n);if(e)return{type:"br",raw:e[0]}}del(n){const e=this.rules.inline.del.exec(n);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(n){const e=this.rules.inline.autolink.exec(n);if(e){let t,r;return e[2]==="@"?(t=e[1],r="mailto:"+t):(t=e[1],r=t),{type:"link",raw:e[0],text:t,href:r,tokens:[{type:"text",raw:t,text:t}]}}}url(n){var t;let e;if(e=this.rules.inline.url.exec(n)){let r,s;if(e[2]==="@")r=e[0],s="mailto:"+r;else{let i;do i=e[0],e[0]=((t=this.rules.inline._backpedal.exec(e[0]))==null?void 0:t[0])??"";while(i!==e[0]);r=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(n){const e=this.rules.inline.text.exec(n);if(e){const t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},v=class j{constructor(e){m(this,"tokens");m(this,"options");m(this,"state");m(this,"tokenizer");m(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||$,this.options.tokenizer=this.options.tokenizer||new B,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={other:w,block:L.normal,inline:z.normal};this.options.pedantic?(t.block=L.pedantic,t.inline=z.pedantic):this.options.gfm&&(t.block=L.gfm,this.options.breaks?t.inline=z.breaks:t.inline=z.gfm),this.tokenizer.rules=t}static get rules(){return{block:L,inline:z}}static lex(e,t){return new j(t).lex(e)}static lexInline(e,t){return new j(t).inlineTokens(e)}lex(e){e=e.replace(w.carriageReturn,`
27
- `),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){const r=this.inlineQueue[t];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],r=!1){var s,i,c;for(this.options.pedantic&&(e=e.replace(w.tabCharGlobal," ").replace(w.spaceLine,""));e;){let l;if((i=(s=this.options.extensions)==null?void 0:s.block)!=null&&i.some(a=>(l=a.call({lexer:this},e,t))?(e=e.substring(l.raw.length),t.push(l),!0):!1))continue;if(l=this.tokenizer.space(e)){e=e.substring(l.raw.length);const a=t.at(-1);l.raw.length===1&&a!==void 0?a.raw+=`
28
- `:t.push(l);continue}if(l=this.tokenizer.code(e)){e=e.substring(l.raw.length);const a=t.at(-1);(a==null?void 0:a.type)==="paragraph"||(a==null?void 0:a.type)==="text"?(a.raw+=`
29
- `+l.raw,a.text+=`
30
- `+l.text,this.inlineQueue.at(-1).src=a.text):t.push(l);continue}if(l=this.tokenizer.fences(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.heading(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.hr(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.blockquote(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.list(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.html(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.def(e)){e=e.substring(l.raw.length);const a=t.at(-1);(a==null?void 0:a.type)==="paragraph"||(a==null?void 0:a.type)==="text"?(a.raw+=`
31
- `+l.raw,a.text+=`
32
- `+l.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[l.tag]||(this.tokens.links[l.tag]={href:l.href,title:l.title});continue}if(l=this.tokenizer.table(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.lheading(e)){e=e.substring(l.raw.length),t.push(l);continue}let p=e;if((c=this.options.extensions)!=null&&c.startBlock){let a=1/0;const o=e.slice(1);let u;this.options.extensions.startBlock.forEach(h=>{u=h.call({lexer:this},o),typeof u=="number"&&u>=0&&(a=Math.min(a,u))}),a<1/0&&a>=0&&(p=e.substring(0,a+1))}if(this.state.top&&(l=this.tokenizer.paragraph(p))){const a=t.at(-1);r&&(a==null?void 0:a.type)==="paragraph"?(a.raw+=`
33
- `+l.raw,a.text+=`
34
- `+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(l),r=p.length!==e.length,e=e.substring(l.raw.length);continue}if(l=this.tokenizer.text(e)){e=e.substring(l.raw.length);const a=t.at(-1);(a==null?void 0:a.type)==="text"?(a.raw+=`
35
- `+l.raw,a.text+=`
36
- `+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(l);continue}if(e){const a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){var l,p,a;let r=e,s=null;if(this.tokens.links){const o=Object.keys(this.tokens.links);if(o.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)o.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,s.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(s=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let i=!1,c="";for(;e;){i||(c=""),i=!1;let o;if((p=(l=this.options.extensions)==null?void 0:l.inline)!=null&&p.some(h=>(o=h.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);const h=t.at(-1);o.type==="text"&&(h==null?void 0:h.type)==="text"?(h.raw+=o.raw,h.text+=o.text):t.push(o);continue}if(o=this.tokenizer.emStrong(e,r,c)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.del(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),t.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let u=e;if((a=this.options.extensions)!=null&&a.startInline){let h=1/0;const b=e.slice(1);let g;this.options.extensions.startInline.forEach(x=>{g=x.call({lexer:this},b),typeof g=="number"&&g>=0&&(h=Math.min(h,g))}),h<1/0&&h>=0&&(u=e.substring(0,h+1))}if(o=this.tokenizer.inlineText(u)){e=e.substring(o.raw.length),o.raw.slice(-1)!=="_"&&(c=o.raw.slice(-1)),i=!0;const h=t.at(-1);(h==null?void 0:h.type)==="text"?(h.raw+=o.raw,h.text+=o.text):t.push(o);continue}if(e){const h="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return t}},N=class{constructor(n){m(this,"options");m(this,"parser");this.options=n||$}space(n){return""}code({text:n,lang:e,escaped:t}){var i;const r=(i=(e||"").match(w.notSpaceStart))==null?void 0:i[0],s=n.replace(w.endingNewline,"")+`
37
- `;return r?'<pre><code class="language-'+y(r)+'">'+(t?s:y(s,!0))+`</code></pre>
38
- `:"<pre><code>"+(t?s:y(s,!0))+`</code></pre>
39
- `}blockquote({tokens:n}){return`<blockquote>
40
- ${this.parser.parse(n)}</blockquote>
41
- `}html({text:n}){return n}heading({tokens:n,depth:e}){return`<h${e}>${this.parser.parseInline(n)}</h${e}>
42
- `}hr(n){return`<hr>
43
- `}list(n){const e=n.ordered,t=n.start;let r="";for(let c=0;c<n.items.length;c++){const l=n.items[c];r+=this.listitem(l)}const s=e?"ol":"ul",i=e&&t!==1?' start="'+t+'"':"";return"<"+s+i+`>
44
- `+r+"</"+s+`>
45
- `}listitem(n){var t;let e="";if(n.task){const r=this.checkbox({checked:!!n.checked});n.loose?((t=n.tokens[0])==null?void 0:t.type)==="paragraph"?(n.tokens[0].text=r+" "+n.tokens[0].text,n.tokens[0].tokens&&n.tokens[0].tokens.length>0&&n.tokens[0].tokens[0].type==="text"&&(n.tokens[0].tokens[0].text=r+" "+y(n.tokens[0].tokens[0].text),n.tokens[0].tokens[0].escaped=!0)):n.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):e+=r+" "}return e+=this.parser.parse(n.tokens,!!n.loose),`<li>${e}</li>
46
- `}checkbox({checked:n}){return"<input "+(n?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:n}){return`<p>${this.parser.parseInline(n)}</p>
47
- `}table(n){let e="",t="";for(let s=0;s<n.header.length;s++)t+=this.tablecell(n.header[s]);e+=this.tablerow({text:t});let r="";for(let s=0;s<n.rows.length;s++){const i=n.rows[s];t="";for(let c=0;c<i.length;c++)t+=this.tablecell(i[c]);r+=this.tablerow({text:t})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
8
+ `),n="",t="",i=[];for(;r.length>0;){let l=!1,c=[],a;for(a=0;a<r.length;a++)if(this.rules.other.blockquoteStart.test(r[a]))c.push(r[a]),l=!0;else if(!l)c.push(r[a]);else break;r=r.slice(a);let h=c.join(`
9
+ `),o=h.replace(this.rules.other.blockquoteSetextReplace,`
10
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}
11
+ ${h}`:h,t=t?`${t}
12
+ ${o}`:o;let u=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(o,i,!0),this.lexer.state.top=u,r.length===0)break;let d=i.at(-1);if(d?.type==="code")break;if(d?.type==="blockquote"){let x=d,f=x.raw+`
13
+ `+r.join(`
14
+ `),m=this.blockquote(f);i[i.length-1]=m,n=n.substring(0,n.length-x.raw.length)+m.raw,t=t.substring(0,t.length-x.text.length)+m.text;break}else if(d?.type==="list"){let x=d,f=x.raw+`
15
+ `+r.join(`
16
+ `),m=this.list(f);i[i.length-1]=m,n=n.substring(0,n.length-d.raw.length)+m.raw,t=t.substring(0,t.length-x.raw.length)+m.raw,r=f.substring(i.at(-1).raw.length).split(`
17
+ `);continue}}return{type:"blockquote",raw:n,tokens:i,text:t}}}list(s){let e=this.rules.block.list.exec(s);if(e){let r=e[1].trim(),n=r.length>1,t={type:"list",raw:"",ordered:n,start:n?+r.slice(0,-1):"",loose:!1,items:[]};r=n?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=n?r:"[*+-]");let i=this.rules.other.listItemRegex(r),l=!1;for(;s;){let a=!1,h="",o="";if(!(e=i.exec(s))||this.rules.block.hr.test(s))break;h=e[0],s=s.substring(h.length);let u=e[2].split(`
18
+ `,1)[0].replace(this.rules.other.listReplaceTabs,m=>" ".repeat(3*m.length)),d=s.split(`
19
+ `,1)[0],x=!u.trim(),f=0;if(this.options.pedantic?(f=2,o=u.trimStart()):x?f=e[1].length+1:(f=e[2].search(this.rules.other.nonSpaceChar),f=f>4?1:f,o=u.slice(f),f+=e[1].length),x&&this.rules.other.blankLine.test(d)&&(h+=d+`
20
+ `,s=s.substring(d.length+1),a=!0),!a){let m=this.rules.other.nextBulletRegex(f),J=this.rules.other.hrRegex(f),K=this.rules.other.fencesBeginRegex(f),ee=this.rules.other.headingBeginRegex(f),Re=this.rules.other.htmlBeginRegex(f);for(;s;){let M=s.split(`
21
+ `,1)[0],_;if(d=M,this.options.pedantic?(d=d.replace(this.rules.other.listReplaceNesting," "),_=d):_=d.replace(this.rules.other.tabCharGlobal," "),K.test(d)||ee.test(d)||Re.test(d)||m.test(d)||J.test(d))break;if(_.search(this.rules.other.nonSpaceChar)>=f||!d.trim())o+=`
22
+ `+_.slice(f);else{if(x||u.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||K.test(u)||ee.test(u)||J.test(u))break;o+=`
23
+ `+d}!x&&!d.trim()&&(x=!0),h+=M+`
24
+ `,s=s.substring(M.length+1),u=_.slice(f)}}t.loose||(l?t.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(l=!0)),t.items.push({type:"list_item",raw:h,task:!!this.options.gfm&&this.rules.other.listIsTask.test(o),loose:!1,text:o,tokens:[]}),t.raw+=h}let c=t.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;t.raw=t.raw.trimEnd();for(let a of t.items){if(this.lexer.state.top=!1,a.tokens=this.lexer.blockTokens(a.text,[]),a.task){if(a.text=a.text.replace(this.rules.other.listReplaceTask,""),a.tokens[0]?.type==="text"||a.tokens[0]?.type==="paragraph"){a.tokens[0].raw=a.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),a.tokens[0].text=a.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let o=this.lexer.inlineQueue.length-1;o>=0;o--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[o].src)){this.lexer.inlineQueue[o].src=this.lexer.inlineQueue[o].src.replace(this.rules.other.listReplaceTask,"");break}}let h=this.rules.other.listTaskCheckbox.exec(a.raw);if(h){let o={type:"checkbox",raw:h[0]+" ",checked:h[0]!=="[ ]"};a.checked=o.checked,t.loose?a.tokens[0]&&["paragraph","text"].includes(a.tokens[0].type)&&"tokens"in a.tokens[0]&&a.tokens[0].tokens?(a.tokens[0].raw=o.raw+a.tokens[0].raw,a.tokens[0].text=o.raw+a.tokens[0].text,a.tokens[0].tokens.unshift(o)):a.tokens.unshift({type:"paragraph",raw:o.raw,text:o.raw,tokens:[o]}):a.tokens.unshift(o)}}if(!t.loose){let h=a.tokens.filter(u=>u.type==="space"),o=h.length>0&&h.some(u=>this.rules.other.anyLine.test(u.raw));t.loose=o}}if(t.loose)for(let a of t.items){a.loose=!0;for(let h of a.tokens)h.type==="text"&&(h.type="paragraph")}return t}}html(s){let e=this.rules.block.html.exec(s);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(s){let e=this.rules.block.def.exec(s);if(e){let r=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",t=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:r,raw:e[0],href:n,title:t}}}table(s){let e=this.rules.block.table.exec(s);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let r=le(e[1]),n=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),t=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
25
+ `):[],i={type:"table",raw:e[0],header:[],align:[],rows:[]};if(r.length===n.length){for(let l of n)this.rules.other.tableAlignRight.test(l)?i.align.push("right"):this.rules.other.tableAlignCenter.test(l)?i.align.push("center"):this.rules.other.tableAlignLeft.test(l)?i.align.push("left"):i.align.push(null);for(let l=0;l<r.length;l++)i.header.push({text:r[l],tokens:this.lexer.inline(r[l]),header:!0,align:i.align[l]});for(let l of t)i.rows.push(le(l,i.header.length).map((c,a)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:i.align[a]})));return i}}lheading(s){let e=this.rules.block.lheading.exec(s);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(s){let e=this.rules.block.paragraph.exec(s);if(e){let r=e[1].charAt(e[1].length-1)===`
26
+ `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:r,tokens:this.lexer.inline(r)}}}text(s){let e=this.rules.block.text.exec(s);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(s){let e=this.rules.inline.escape.exec(s);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(s){let e=this.rules.inline.tag.exec(s);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(s){let e=this.rules.inline.link.exec(s);if(e){let r=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let i=A(r.slice(0,-1),"\\");if((r.length-i.length)%2===0)return}else{let i=st(e[2],"()");if(i===-2)return;if(i>-1){let l=(e[0].indexOf("!")===0?5:4)+e[1].length+i;e[2]=e[2].substring(0,i),e[0]=e[0].substring(0,l).trim(),e[3]=""}}let n=e[2],t="";if(this.options.pedantic){let i=this.rules.other.pedanticHrefTitle.exec(n);i&&(n=i[1],t=i[3])}else t=e[3]?e[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?n=n.slice(1):n=n.slice(1,-1)),ie(e,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:t&&t.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(s,e){let r;if((r=this.rules.inline.reflink.exec(s))||(r=this.rules.inline.nolink.exec(s))){let n=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),t=e[n.toLowerCase()];if(!t){let i=r[0].charAt(0);return{type:"text",raw:i,text:i}}return ie(r,t,r[0],this.lexer,this.rules)}}emStrong(s,e,r=""){let n=this.rules.inline.emStrongLDelim.exec(s);if(!(!n||n[3]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(n[1]||n[2])||!r||this.rules.inline.punctuation.exec(r))){let t=[...n[0]].length-1,i,l,c=t,a=0,h=n[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,e=e.slice(-1*s.length+t);(n=h.exec(e))!=null;){if(i=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!i)continue;if(l=[...i].length,n[3]||n[4]){c+=l;continue}else if((n[5]||n[6])&&t%3&&!((t+l)%3)){a+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c+a);let o=[...n[0]][0].length,u=s.slice(0,t+n.index+o+l);if(Math.min(t,l)%2){let x=u.slice(1,-1);return{type:"em",raw:u,text:x,tokens:this.lexer.inlineTokens(x)}}let d=u.slice(2,-2);return{type:"strong",raw:u,text:d,tokens:this.lexer.inlineTokens(d)}}}}codespan(s){let e=this.rules.inline.code.exec(s);if(e){let r=e[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(r),t=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return n&&t&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:e[0],text:r}}}br(s){let e=this.rules.inline.br.exec(s);if(e)return{type:"br",raw:e[0]}}del(s){let e=this.rules.inline.del.exec(s);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(s){let e=this.rules.inline.autolink.exec(s);if(e){let r,n;return e[2]==="@"?(r=e[1],n="mailto:"+r):(r=e[1],n=r),{type:"link",raw:e[0],text:r,href:n,tokens:[{type:"text",raw:r,text:r}]}}}url(s){let e;if(e=this.rules.inline.url.exec(s)){let r,n;if(e[2]==="@")r=e[0],n="mailto:"+r;else{let t;do t=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(t!==e[0]);r=e[0],e[1]==="www."?n="http://"+e[0]:n=e[0]}return{type:"link",raw:e[0],text:r,href:n,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(s){let e=this.rules.inline.text.exec(s);if(e){let r=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:r}}}},w=class D{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||S,this.options.tokenizer=this.options.tokenizer||new L,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 r={other:b,block:I.normal,inline:z.normal};this.options.pedantic?(r.block=I.pedantic,r.inline=z.pedantic):this.options.gfm&&(r.block=I.gfm,this.options.breaks?r.inline=z.breaks:r.inline=z.gfm),this.tokenizer.rules=r}static get rules(){return{block:I,inline:z}}static lex(e,r){return new D(r).lex(e)}static lexInline(e,r){return new D(r).inlineTokens(e)}lex(e){e=e.replace(b.carriageReturn,`
27
+ `),this.blockTokens(e,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let n=this.inlineQueue[r];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,r=[],n=!1){for(this.options.pedantic&&(e=e.replace(b.tabCharGlobal," ").replace(b.spaceLine,""));e;){let t;if(this.options.extensions?.block?.some(l=>(t=l.call({lexer:this},e,r))?(e=e.substring(t.raw.length),r.push(t),!0):!1))continue;if(t=this.tokenizer.space(e)){e=e.substring(t.raw.length);let l=r.at(-1);t.raw.length===1&&l!==void 0?l.raw+=`
28
+ `:r.push(t);continue}if(t=this.tokenizer.code(e)){e=e.substring(t.raw.length);let l=r.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(`
29
+ `)?"":`
30
+ `)+t.raw,l.text+=`
31
+ `+t.text,this.inlineQueue.at(-1).src=l.text):r.push(t);continue}if(t=this.tokenizer.fences(e)){e=e.substring(t.raw.length),r.push(t);continue}if(t=this.tokenizer.heading(e)){e=e.substring(t.raw.length),r.push(t);continue}if(t=this.tokenizer.hr(e)){e=e.substring(t.raw.length),r.push(t);continue}if(t=this.tokenizer.blockquote(e)){e=e.substring(t.raw.length),r.push(t);continue}if(t=this.tokenizer.list(e)){e=e.substring(t.raw.length),r.push(t);continue}if(t=this.tokenizer.html(e)){e=e.substring(t.raw.length),r.push(t);continue}if(t=this.tokenizer.def(e)){e=e.substring(t.raw.length);let l=r.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(`
32
+ `)?"":`
33
+ `)+t.raw,l.text+=`
34
+ `+t.raw,this.inlineQueue.at(-1).src=l.text):this.tokens.links[t.tag]||(this.tokens.links[t.tag]={href:t.href,title:t.title},r.push(t));continue}if(t=this.tokenizer.table(e)){e=e.substring(t.raw.length),r.push(t);continue}if(t=this.tokenizer.lheading(e)){e=e.substring(t.raw.length),r.push(t);continue}let i=e;if(this.options.extensions?.startBlock){let l=1/0,c=e.slice(1),a;this.options.extensions.startBlock.forEach(h=>{a=h.call({lexer:this},c),typeof a=="number"&&a>=0&&(l=Math.min(l,a))}),l<1/0&&l>=0&&(i=e.substring(0,l+1))}if(this.state.top&&(t=this.tokenizer.paragraph(i))){let l=r.at(-1);n&&l?.type==="paragraph"?(l.raw+=(l.raw.endsWith(`
35
+ `)?"":`
36
+ `)+t.raw,l.text+=`
37
+ `+t.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):r.push(t),n=i.length!==e.length,e=e.substring(t.raw.length);continue}if(t=this.tokenizer.text(e)){e=e.substring(t.raw.length);let l=r.at(-1);l?.type==="text"?(l.raw+=(l.raw.endsWith(`
38
+ `)?"":`
39
+ `)+t.raw,l.text+=`
40
+ `+t.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):r.push(t);continue}if(e){let l="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){let n=e,t=null;if(this.tokens.links){let a=Object.keys(this.tokens.links);if(a.length>0)for(;(t=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)a.includes(t[0].slice(t[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,t.index)+"["+"a".repeat(t[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(t=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,t.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(t=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)i=t[2]?t[2].length:0,n=n.slice(0,t.index+i)+"["+"a".repeat(t[0].length-i-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let l=!1,c="";for(;e;){l||(c=""),l=!1;let a;if(this.options.extensions?.inline?.some(o=>(a=o.call({lexer:this},e,r))?(e=e.substring(a.raw.length),r.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);let o=r.at(-1);a.type==="text"&&o?.type==="text"?(o.raw+=a.raw,o.text+=a.text):r.push(a);continue}if(a=this.tokenizer.emStrong(e,n,c)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.del(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),r.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),r.push(a);continue}let h=e;if(this.options.extensions?.startInline){let o=1/0,u=e.slice(1),d;this.options.extensions.startInline.forEach(x=>{d=x.call({lexer:this},u),typeof d=="number"&&d>=0&&(o=Math.min(o,d))}),o<1/0&&o>=0&&(h=e.substring(0,o+1))}if(a=this.tokenizer.inlineText(h)){e=e.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(c=a.raw.slice(-1)),l=!0;let o=r.at(-1);o?.type==="text"?(o.raw+=a.raw,o.text+=a.text):r.push(a);continue}if(e){let o="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(o);break}else throw new Error(o)}}return r}},B=class{options;parser;constructor(s){this.options=s||S}space(s){return""}code({text:s,lang:e,escaped:r}){let n=(e||"").match(b.notSpaceStart)?.[0],t=s.replace(b.endingNewline,"")+`
41
+ `;return n?'<pre><code class="language-'+R(n)+'">'+(r?t:R(t,!0))+`</code></pre>
42
+ `:"<pre><code>"+(r?t:R(t,!0))+`</code></pre>
43
+ `}blockquote({tokens:s}){return`<blockquote>
44
+ ${this.parser.parse(s)}</blockquote>
45
+ `}html({text:s}){return s}def(s){return""}heading({tokens:s,depth:e}){return`<h${e}>${this.parser.parseInline(s)}</h${e}>
46
+ `}hr(s){return`<hr>
47
+ `}list(s){let e=s.ordered,r=s.start,n="";for(let l=0;l<s.items.length;l++){let c=s.items[l];n+=this.listitem(c)}let t=e?"ol":"ul",i=e&&r!==1?' start="'+r+'"':"";return"<"+t+i+`>
48
+ `+n+"</"+t+`>
49
+ `}listitem(s){return`<li>${this.parser.parse(s.tokens)}</li>
50
+ `}checkbox({checked:s}){return"<input "+(s?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:s}){return`<p>${this.parser.parseInline(s)}</p>
51
+ `}table(s){let e="",r="";for(let t=0;t<s.header.length;t++)r+=this.tablecell(s.header[t]);e+=this.tablerow({text:r});let n="";for(let t=0;t<s.rows.length;t++){let i=s.rows[t];r="";for(let l=0;l<i.length;l++)r+=this.tablecell(i[l]);n+=this.tablerow({text:r})}return n&&(n=`<tbody>${n}</tbody>`),`<table>
48
52
  <thead>
49
53
  `+e+`</thead>
50
- `+r+`</table>
51
- `}tablerow({text:n}){return`<tr>
52
- ${n}</tr>
53
- `}tablecell(n){const e=this.parser.parseInline(n.tokens),t=n.header?"th":"td";return(n.align?`<${t} align="${n.align}">`:`<${t}>`)+e+`</${t}>
54
- `}strong({tokens:n}){return`<strong>${this.parser.parseInline(n)}</strong>`}em({tokens:n}){return`<em>${this.parser.parseInline(n)}</em>`}codespan({text:n}){return`<code>${y(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:e,tokens:t}){const r=this.parser.parseInline(t),s=ae(n);if(s===null)return r;n=s;let i='<a href="'+n+'"';return e&&(i+=' title="'+y(e)+'"'),i+=">"+r+"</a>",i}image({href:n,title:e,text:t,tokens:r}){r&&(t=this.parser.parseInline(r,this.parser.textRenderer));const s=ae(n);if(s===null)return y(t);n=s;let i=`<img src="${n}" alt="${t}"`;return e&&(i+=` title="${y(e)}"`),i+=">",i}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:y(n.text)}},ee=class{strong({text:n}){return n}em({text:n}){return n}codespan({text:n}){return n}del({text:n}){return n}html({text:n}){return n}text({text:n}){return n}link({text:n}){return""+n}image({text:n}){return""+n}br(){return""}},R=class G{constructor(e){m(this,"options");m(this,"renderer");m(this,"textRenderer");this.options=e||$,this.options.renderer=this.options.renderer||new N,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ee}static parse(e,t){return new G(t).parse(e)}static parseInline(e,t){return new G(t).parseInline(e)}parse(e,t=!0){var s,i;let r="";for(let c=0;c<e.length;c++){const l=e[c];if((i=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&i[l.type]){const a=l,o=this.options.extensions.renderers[a.type].call({parser:this},a);if(o!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(a.type)){r+=o||"";continue}}const p=l;switch(p.type){case"space":{r+=this.renderer.space(p);continue}case"hr":{r+=this.renderer.hr(p);continue}case"heading":{r+=this.renderer.heading(p);continue}case"code":{r+=this.renderer.code(p);continue}case"table":{r+=this.renderer.table(p);continue}case"blockquote":{r+=this.renderer.blockquote(p);continue}case"list":{r+=this.renderer.list(p);continue}case"html":{r+=this.renderer.html(p);continue}case"paragraph":{r+=this.renderer.paragraph(p);continue}case"text":{let a=p,o=this.renderer.text(a);for(;c+1<e.length&&e[c+1].type==="text";)a=e[++c],o+=`
55
- `+this.renderer.text(a);t?r+=this.renderer.paragraph({type:"paragraph",raw:o,text:o,tokens:[{type:"text",raw:o,text:o,escaped:!0}]}):r+=o;continue}default:{const a='Token with "'+p.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return r}parseInline(e,t=this.renderer){var s,i;let r="";for(let c=0;c<e.length;c++){const l=e[c];if((i=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&i[l.type]){const a=this.options.extensions.renderers[l.type].call({parser:this},l);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(l.type)){r+=a||"";continue}}const p=l;switch(p.type){case"escape":{r+=t.text(p);break}case"html":{r+=t.html(p);break}case"link":{r+=t.link(p);break}case"image":{r+=t.image(p);break}case"strong":{r+=t.strong(p);break}case"em":{r+=t.em(p);break}case"codespan":{r+=t.codespan(p);break}case"br":{r+=t.br(p);break}case"del":{r+=t.del(p);break}case"text":{r+=t.text(p);break}default:{const a='Token with "'+p.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return r}},Z,P=(Z=class{constructor(n){m(this,"options");m(this,"block");this.options=n||$}preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}provideLexer(){return this.block?v.lex:v.lexInline}provideParser(){return this.block?R.parse:R.parseInline}},m(Z,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),Z),ct=class{constructor(...n){m(this,"defaults",Q());m(this,"options",this.setOptions);m(this,"parse",this.parseMarkdown(!0));m(this,"parseInline",this.parseMarkdown(!1));m(this,"Parser",R);m(this,"Renderer",N);m(this,"TextRenderer",ee);m(this,"Lexer",v);m(this,"Tokenizer",B);m(this,"Hooks",P);this.use(...n)}walkTokens(n,e){var r,s;let t=[];for(const i of n)switch(t=t.concat(e.call(this,i)),i.type){case"table":{const c=i;for(const l of c.header)t=t.concat(this.walkTokens(l.tokens,e));for(const l of c.rows)for(const p of l)t=t.concat(this.walkTokens(p.tokens,e));break}case"list":{const c=i;t=t.concat(this.walkTokens(c.items,e));break}default:{const c=i;(s=(r=this.defaults.extensions)==null?void 0:r.childTokens)!=null&&s[c.type]?this.defaults.extensions.childTokens[c.type].forEach(l=>{const p=c[l].flat(1/0);t=t.concat(this.walkTokens(p,e))}):c.tokens&&(t=t.concat(this.walkTokens(c.tokens,e)))}}return t}use(...n){const e=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(t=>{const r={...t};if(r.async=this.defaults.async||r.async||!1,t.extensions&&(t.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){const i=e.renderers[s.name];i?e.renderers[s.name]=function(...c){let l=s.renderer.apply(this,c);return l===!1&&(l=i.apply(this,c)),l}:e.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const i=e[s.level];i?i.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]))}"childTokens"in s&&s.childTokens&&(e.childTokens[s.name]=s.childTokens)}),r.extensions=e),t.renderer){const s=this.defaults.renderer||new N(this.defaults);for(const i in t.renderer){if(!(i in s))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;const c=i,l=t.renderer[c],p=s[c];s[c]=(...a)=>{let o=l.apply(s,a);return o===!1&&(o=p.apply(s,a)),o||""}}r.renderer=s}if(t.tokenizer){const s=this.defaults.tokenizer||new B(this.defaults);for(const i in t.tokenizer){if(!(i in s))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;const c=i,l=t.tokenizer[c],p=s[c];s[c]=(...a)=>{let o=l.apply(s,a);return o===!1&&(o=p.apply(s,a)),o}}r.tokenizer=s}if(t.hooks){const s=this.defaults.hooks||new P;for(const i in t.hooks){if(!(i in s))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;const c=i,l=t.hooks[c],p=s[c];P.passThroughHooks.has(i)?s[c]=a=>{if(this.defaults.async)return Promise.resolve(l.call(s,a)).then(u=>p.call(s,u));const o=l.call(s,a);return p.call(s,o)}:s[c]=(...a)=>{let o=l.apply(s,a);return o===!1&&(o=p.apply(s,a)),o}}r.hooks=s}if(t.walkTokens){const s=this.defaults.walkTokens,i=t.walkTokens;r.walkTokens=function(c){let l=[];return l.push(i.call(this,c)),s&&(l=l.concat(s.call(this,c))),l}}this.defaults={...this.defaults,...r}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,e){return v.lex(n,e??this.defaults)}parser(n,e){return R.parse(n,e??this.defaults)}parseMarkdown(n){return(t,r)=>{const s={...r},i={...this.defaults,...s},c=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&s.async===!1)return c(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return c(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return c(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));i.hooks&&(i.hooks.options=i,i.hooks.block=n);const l=i.hooks?i.hooks.provideLexer():n?v.lex:v.lexInline,p=i.hooks?i.hooks.provideParser():n?R.parse:R.parseInline;if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(t):t).then(a=>l(a,i)).then(a=>i.hooks?i.hooks.processAllTokens(a):a).then(a=>i.walkTokens?Promise.all(this.walkTokens(a,i.walkTokens)).then(()=>a):a).then(a=>p(a,i)).then(a=>i.hooks?i.hooks.postprocess(a):a).catch(c);try{i.hooks&&(t=i.hooks.preprocess(t));let a=l(t,i);i.hooks&&(a=i.hooks.processAllTokens(a)),i.walkTokens&&this.walkTokens(a,i.walkTokens);let o=p(a,i);return i.hooks&&(o=i.hooks.postprocess(o)),o}catch(a){return c(a)}}}onError(n,e){return t=>{if(t.message+=`
56
- Please report this to https://github.com/markedjs/marked.`,n){const r="<p>An error occurred:</p><pre>"+y(t.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(t);throw t}}},S=new ct;function k(n,e){return S.parse(n,e)}k.options=k.setOptions=function(n){return S.setOptions(n),k.defaults=S.defaults,pe(k.defaults),k};k.getDefaults=Q;k.defaults=$;k.use=function(...n){return S.use(...n),k.defaults=S.defaults,pe(k.defaults),k};k.walkTokens=function(n,e){return S.walkTokens(n,e)};k.parseInline=S.parseInline;k.Parser=R;k.parser=R.parse;k.Renderer=N;k.TextRenderer=ee;k.Lexer=v;k.lexer=v.lex;k.Tokenizer=B;k.Hooks=P;k.parse=k;k.options;k.setOptions;k.use;k.walkTokens;k.parseInline;R.parse;v.lex;const pt={class:"markdown-container"},ht={key:0,class:"min-h-full p-8 flex items-center justify-center"},ut={class:"markdown-content-wrapper"},dt={class:"p-4"},gt={class:"header-row"},ft={class:"document-title"},kt=["innerHTML"],mt={class:"markdown-source"},bt=["disabled"],xt=d.defineComponent({__name:"View",props:{selectedResult:{}},emits:["updateResult"],setup(n,{emit:e}){var a;const t=n,r=e,s=d.ref(((a=t.selectedResult.data)==null?void 0:a.markdown)||""),i=d.computed(()=>{var o;return s.value!==((o=t.selectedResult.data)==null?void 0:o.markdown)}),c=d.computed(()=>{var o;return(o=t.selectedResult.data)!=null&&o.markdown?k(t.selectedResult.data.markdown):(console.error("No markdown data in result:",t.selectedResult),"")});d.watch(()=>{var o,u;return(u=(o=t.selectedResult)==null?void 0:o.viewState)==null?void 0:u.scrollToAnchor},o=>{o&&d.nextTick(()=>{const u=document.getElementById(o);u?u.scrollIntoView({behavior:"smooth",block:"start"}):console.warn(`Anchor element with id "${o}" not found`)})});const l=()=>{var g,x;if(!((x=(g=t.selectedResult)==null?void 0:g.data)!=null&&x.markdown))return;const o=new Blob([t.selectedResult.data.markdown],{type:"text/markdown"}),u=URL.createObjectURL(o),h=document.createElement("a");h.href=u;const b=t.selectedResult.title?`${t.selectedResult.title.replace(/[^a-z0-9]/gi,"_").toLowerCase()}.md`:"document.md";h.download=b,document.body.appendChild(h),h.click(),document.body.removeChild(h),URL.revokeObjectURL(u)};function p(){const o={...t.selectedResult,data:{...t.selectedResult.data,markdown:s.value,pdfPath:void 0}};r("updateResult",o)}return d.watch(()=>{var o;return(o=t.selectedResult.data)==null?void 0:o.markdown},o=>{s.value=o||""}),(o,u)=>{var h;return d.openBlock(),d.createElementBlock("div",pt,[(h=n.selectedResult.data)!=null&&h.markdown?(d.openBlock(),d.createElementBlock(d.Fragment,{key:1},[d.createElementVNode("div",ut,[d.createElementVNode("div",dt,[d.createElementVNode("div",gt,[d.createElementVNode("h1",ft,d.toDisplayString(n.selectedResult.title||"Document"),1),d.createElementVNode("div",{class:"button-group"},[d.createElementVNode("button",{onClick:l,class:"download-btn download-btn-green"},[...u[2]||(u[2]=[d.createElementVNode("span",{class:"material-icons"},"download",-1),d.createTextVNode(" MD ",-1)])])])]),d.createElementVNode("div",{class:"markdown-content prose prose-slate max-w-none",innerHTML:c.value},null,8,kt)])]),d.createElementVNode("details",mt,[u[3]||(u[3]=d.createElementVNode("summary",null,"Edit Markdown Source",-1)),d.withDirectives(d.createElementVNode("textarea",{"onUpdate:modelValue":u[0]||(u[0]=b=>s.value=b),class:"markdown-editor",spellcheck:"false"},null,512),[[d.vModelText,s.value]]),d.createElementVNode("button",{onClick:p,class:"apply-btn",disabled:!i.value}," Apply Changes ",8,bt)])],64)):(d.openBlock(),d.createElementBlock("div",ht,[...u[1]||(u[1]=[d.createElementVNode("div",{class:"text-gray-500"},"No markdown content available",-1)])]))])}}}),wt=(n,e)=>{const t=n.__vccOpts||n;for(const[r,s]of e)t[r]=s;return t},ye=wt(xt,[["__scopeId","data-v-7bea9557"]]),yt={class:"text-center p-4 bg-purple-100 rounded"},vt={class:"text-sm text-gray-800 mt-1 font-medium truncate"},ve=d.defineComponent({__name:"Preview",props:{result:{}},setup(n){const e=n,t=d.computed(()=>{var r;if(e.result.title)return e.result.title;if((r=e.result.data)!=null&&r.markdown){const s=e.result.data.markdown.match(/^#\s+(.+)$/m);if(s)return s[1]}return"Markdown Document"});return(r,s)=>(d.openBlock(),d.createElementBlock("div",yt,[s[0]||(s[0]=d.createElementVNode("div",{class:"text-purple-600 font-medium"},"Document",-1)),d.createElementVNode("div",vt,d.toDisplayString(t.value),1)]))}}),H="presentDocument",Re=`Use the ${H} tool to create structured documents with text and embedded images. This tool is ideal for:
54
+ `+n+`</table>
55
+ `}tablerow({text:s}){return`<tr>
56
+ ${s}</tr>
57
+ `}tablecell(s){let e=this.parser.parseInline(s.tokens),r=s.header?"th":"td";return(s.align?`<${r} align="${s.align}">`:`<${r}>`)+e+`</${r}>
58
+ `}strong({tokens:s}){return`<strong>${this.parser.parseInline(s)}</strong>`}em({tokens:s}){return`<em>${this.parser.parseInline(s)}</em>`}codespan({text:s}){return`<code>${R(s,!0)}</code>`}br(s){return"<br>"}del({tokens:s}){return`<del>${this.parser.parseInline(s)}</del>`}link({href:s,title:e,tokens:r}){let n=this.parser.parseInline(r),t=ne(s);if(t===null)return n;s=t;let i='<a href="'+s+'"';return e&&(i+=' title="'+R(e)+'"'),i+=">"+n+"</a>",i}image({href:s,title:e,text:r,tokens:n}){n&&(r=this.parser.parseInline(n,this.parser.textRenderer));let t=ne(s);if(t===null)return R(r);s=t;let i=`<img src="${s}" alt="${r}"`;return e&&(i+=` title="${R(e)}"`),i+=">",i}text(s){return"tokens"in s&&s.tokens?this.parser.parseInline(s.tokens):"escaped"in s&&s.escaped?s.text:R(s.text)}},Y=class{strong({text:s}){return s}em({text:s}){return s}codespan({text:s}){return s}del({text:s}){return s}html({text:s}){return s}text({text:s}){return s}link({text:s}){return""+s}image({text:s}){return""+s}br(){return""}checkbox({raw:s}){return s}},y=class Z{options;renderer;textRenderer;constructor(e){this.options=e||S,this.options.renderer=this.options.renderer||new B,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Y}static parse(e,r){return new Z(r).parse(e)}static parseInline(e,r){return new Z(r).parseInline(e)}parse(e){let r="";for(let n=0;n<e.length;n++){let t=e[n];if(this.options.extensions?.renderers?.[t.type]){let l=t,c=this.options.extensions.renderers[l.type].call({parser:this},l);if(c!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(l.type)){r+=c||"";continue}}let i=t;switch(i.type){case"space":{r+=this.renderer.space(i);break}case"hr":{r+=this.renderer.hr(i);break}case"heading":{r+=this.renderer.heading(i);break}case"code":{r+=this.renderer.code(i);break}case"table":{r+=this.renderer.table(i);break}case"blockquote":{r+=this.renderer.blockquote(i);break}case"list":{r+=this.renderer.list(i);break}case"checkbox":{r+=this.renderer.checkbox(i);break}case"html":{r+=this.renderer.html(i);break}case"def":{r+=this.renderer.def(i);break}case"paragraph":{r+=this.renderer.paragraph(i);break}case"text":{r+=this.renderer.text(i);break}default:{let l='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return r}parseInline(e,r=this.renderer){let n="";for(let t=0;t<e.length;t++){let i=e[t];if(this.options.extensions?.renderers?.[i.type]){let c=this.options.extensions.renderers[i.type].call({parser:this},i);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){n+=c||"";continue}}let l=i;switch(l.type){case"escape":{n+=r.text(l);break}case"html":{n+=r.html(l);break}case"link":{n+=r.link(l);break}case"image":{n+=r.image(l);break}case"checkbox":{n+=r.checkbox(l);break}case"strong":{n+=r.strong(l);break}case"em":{n+=r.em(l);break}case"codespan":{n+=r.codespan(l);break}case"br":{n+=r.br(l);break}case"del":{n+=r.del(l);break}case"text":{n+=r.text(l);break}default:{let c='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return n}},v=class{options;block;constructor(s){this.options=s||S}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(s){return s}postprocess(s){return s}processAllTokens(s){return s}emStrongMask(s){return s}provideLexer(){return this.block?w.lex:w.lexInline}provideParser(){return this.block?y.parse:y.parseInline}},lt=class{defaults=j();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=y;Renderer=B;TextRenderer=Y;Lexer=w;Tokenizer=L;Hooks=v;constructor(...s){this.use(...s)}walkTokens(s,e){let r=[];for(let n of s)switch(r=r.concat(e.call(this,n)),n.type){case"table":{let t=n;for(let i of t.header)r=r.concat(this.walkTokens(i.tokens,e));for(let i of t.rows)for(let l of i)r=r.concat(this.walkTokens(l.tokens,e));break}case"list":{let t=n;r=r.concat(this.walkTokens(t.items,e));break}default:{let t=n;this.defaults.extensions?.childTokens?.[t.type]?this.defaults.extensions.childTokens[t.type].forEach(i=>{let l=t[i].flat(1/0);r=r.concat(this.walkTokens(l,e))}):t.tokens&&(r=r.concat(this.walkTokens(t.tokens,e)))}}return r}use(...s){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return s.forEach(r=>{let n={...r};if(n.async=this.defaults.async||n.async||!1,r.extensions&&(r.extensions.forEach(t=>{if(!t.name)throw new Error("extension name required");if("renderer"in t){let i=e.renderers[t.name];i?e.renderers[t.name]=function(...l){let c=t.renderer.apply(this,l);return c===!1&&(c=i.apply(this,l)),c}:e.renderers[t.name]=t.renderer}if("tokenizer"in t){if(!t.level||t.level!=="block"&&t.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=e[t.level];i?i.unshift(t.tokenizer):e[t.level]=[t.tokenizer],t.start&&(t.level==="block"?e.startBlock?e.startBlock.push(t.start):e.startBlock=[t.start]:t.level==="inline"&&(e.startInline?e.startInline.push(t.start):e.startInline=[t.start]))}"childTokens"in t&&t.childTokens&&(e.childTokens[t.name]=t.childTokens)}),n.extensions=e),r.renderer){let t=this.defaults.renderer||new B(this.defaults);for(let i in r.renderer){if(!(i in t))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let l=i,c=r.renderer[l],a=t[l];t[l]=(...h)=>{let o=c.apply(t,h);return o===!1&&(o=a.apply(t,h)),o||""}}n.renderer=t}if(r.tokenizer){let t=this.defaults.tokenizer||new L(this.defaults);for(let i in r.tokenizer){if(!(i in t))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let l=i,c=r.tokenizer[l],a=t[l];t[l]=(...h)=>{let o=c.apply(t,h);return o===!1&&(o=a.apply(t,h)),o}}n.tokenizer=t}if(r.hooks){let t=this.defaults.hooks||new v;for(let i in r.hooks){if(!(i in t))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let l=i,c=r.hooks[l],a=t[l];v.passThroughHooks.has(i)?t[l]=h=>{if(this.defaults.async&&v.passThroughHooksRespectAsync.has(i))return(async()=>{let u=await c.call(t,h);return a.call(t,u)})();let o=c.call(t,h);return a.call(t,o)}:t[l]=(...h)=>{if(this.defaults.async)return(async()=>{let u=await c.apply(t,h);return u===!1&&(u=await a.apply(t,h)),u})();let o=c.apply(t,h);return o===!1&&(o=a.apply(t,h)),o}}n.hooks=t}if(r.walkTokens){let t=this.defaults.walkTokens,i=r.walkTokens;n.walkTokens=function(l){let c=[];return c.push(i.call(this,l)),t&&(c=c.concat(t.call(this,l))),c}}this.defaults={...this.defaults,...n}}),this}setOptions(s){return this.defaults={...this.defaults,...s},this}lexer(s,e){return w.lex(s,e??this.defaults)}parser(s,e){return y.parse(s,e??this.defaults)}parseMarkdown(s){return(e,r)=>{let n={...r},t={...this.defaults,...n},i=this.onError(!!t.silent,!!t.async);if(this.defaults.async===!0&&n.async===!1)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(t.hooks&&(t.hooks.options=t,t.hooks.block=s),t.async)return(async()=>{let l=t.hooks?await t.hooks.preprocess(e):e,c=await(t.hooks?await t.hooks.provideLexer():s?w.lex:w.lexInline)(l,t),a=t.hooks?await t.hooks.processAllTokens(c):c;t.walkTokens&&await Promise.all(this.walkTokens(a,t.walkTokens));let h=await(t.hooks?await t.hooks.provideParser():s?y.parse:y.parseInline)(a,t);return t.hooks?await t.hooks.postprocess(h):h})().catch(i);try{t.hooks&&(e=t.hooks.preprocess(e));let l=(t.hooks?t.hooks.provideLexer():s?w.lex:w.lexInline)(e,t);t.hooks&&(l=t.hooks.processAllTokens(l)),t.walkTokens&&this.walkTokens(l,t.walkTokens);let c=(t.hooks?t.hooks.provideParser():s?y.parse:y.parseInline)(l,t);return t.hooks&&(c=t.hooks.postprocess(c)),c}catch(l){return i(l)}}}onError(s,e){return r=>{if(r.message+=`
59
+ Please report this to https://github.com/markedjs/marked.`,s){let n="<p>An error occurred:</p><pre>"+R(r.message+"",!0)+"</pre>";return e?Promise.resolve(n):n}if(e)return Promise.reject(r);throw r}}},$=new lt;function k(s,e){return $.parse(s,e)}k.options=k.setOptions=function(s){return $.setOptions(s),k.defaults=$.defaults,ae(k.defaults),k};k.getDefaults=j;k.defaults=S;k.use=function(...s){return $.use(...s),k.defaults=$.defaults,ae(k.defaults),k};k.walkTokens=function(s,e){return $.walkTokens(s,e)};k.parseInline=$.parseInline;k.Parser=y;k.parser=y.parse;k.Renderer=B;k.TextRenderer=Y;k.Lexer=w;k.lexer=w.lex;k.Tokenizer=L;k.Hooks=v;k.parse=k;k.options;k.setOptions;k.use;k.walkTokens;k.parseInline;y.parse;w.lex;const it={class:"markdown-container"},at={key:0,class:"min-h-full p-8 flex items-center justify-center"},ot={class:"markdown-content-wrapper"},ct={class:"p-4"},ht={class:"header-row"},pt={class:"document-title"},ut=["innerHTML"],dt={class:"markdown-source"},gt=["disabled"],kt=p.defineComponent({__name:"View",props:{selectedResult:{}},emits:["updateResult"],setup(s,{emit:e}){const r=s,n=e,t=p.ref(r.selectedResult.data?.markdown||""),i=p.computed(()=>t.value!==r.selectedResult.data?.markdown),l=p.computed(()=>r.selectedResult.data?.markdown?k(r.selectedResult.data.markdown):(console.error("No markdown data in result:",r.selectedResult),""));p.watch(()=>r.selectedResult?.viewState?.scrollToAnchor,h=>{h&&p.nextTick(()=>{const o=document.getElementById(h);o?o.scrollIntoView({behavior:"smooth",block:"start"}):console.warn(`Anchor element with id "${h}" not found`)})});const c=()=>{if(!r.selectedResult?.data?.markdown)return;const h=new Blob([r.selectedResult.data.markdown],{type:"text/markdown"}),o=URL.createObjectURL(h),u=document.createElement("a");u.href=o;const d=r.selectedResult.title?`${r.selectedResult.title.replace(/[^a-z0-9]/gi,"_").toLowerCase()}.md`:"document.md";u.download=d,document.body.appendChild(u),u.click(),document.body.removeChild(u),URL.revokeObjectURL(o)};function a(){const h={...r.selectedResult,data:{...r.selectedResult.data,markdown:t.value,pdfPath:void 0}};n("updateResult",h)}return p.watch(()=>r.selectedResult.data?.markdown,h=>{t.value=h||""}),(h,o)=>(p.openBlock(),p.createElementBlock("div",it,[s.selectedResult.data?.markdown?(p.openBlock(),p.createElementBlock(p.Fragment,{key:1},[p.createElementVNode("div",ot,[p.createElementVNode("div",ct,[p.createElementVNode("div",ht,[p.createElementVNode("h1",pt,p.toDisplayString(s.selectedResult.title||"Document"),1),p.createElementVNode("div",{class:"button-group"},[p.createElementVNode("button",{onClick:c,class:"download-btn download-btn-green"},[...o[2]||(o[2]=[p.createElementVNode("span",{class:"material-icons"},"download",-1),p.createTextVNode(" MD ",-1)])])])]),p.createElementVNode("div",{class:"markdown-content prose prose-slate max-w-none",innerHTML:l.value},null,8,ut)])]),p.createElementVNode("details",dt,[o[3]||(o[3]=p.createElementVNode("summary",null,"Edit Markdown Source",-1)),p.withDirectives(p.createElementVNode("textarea",{"onUpdate:modelValue":o[0]||(o[0]=u=>t.value=u),class:"markdown-editor",spellcheck:"false"},null,512),[[p.vModelText,t.value]]),p.createElementVNode("button",{onClick:a,class:"apply-btn",disabled:!i.value}," Apply Changes ",8,gt)])],64)):(p.openBlock(),p.createElementBlock("div",at,[...o[1]||(o[1]=[p.createElementVNode("div",{class:"text-gray-500"},"No markdown content available",-1)])]))]))}}),ft=(s,e)=>{const r=s.__vccOpts||s;for(const[n,t]of e)r[n]=t;return r},be=ft(kt,[["__scopeId","data-v-7bea9557"]]),xt={class:"text-center p-4 bg-purple-100 rounded"},bt={class:"text-sm text-gray-800 mt-1 font-medium truncate"},me=p.defineComponent({__name:"Preview",props:{result:{}},setup(s){const e=s,r=p.computed(()=>{if(e.result.title)return e.result.title;if(e.result.data?.markdown){const n=e.result.data.markdown.match(/^#\s+(.+)$/m);if(n)return n[1]}return"Markdown Document"});return(n,t)=>(p.openBlock(),p.createElementBlock("div",xt,[t[0]||(t[0]=p.createElementVNode("div",{class:"text-purple-600 font-medium"},"Document",-1)),p.createElementVNode("div",bt,p.toDisplayString(r.value),1)]))}}),V="presentDocument",we=`Use the ${V} tool to create structured documents with text and embedded images. This tool is ideal for:
57
60
  - Guides, tutorials, and how-to content ("create a guide about...", "explain how to...")
58
61
  - Educational content (lessons, explanations, timelines, concept visualizations)
59
62
  - Reports and presentations (business reports, data analysis, infographics)
@@ -64,6 +67,6 @@ Please report this to https://github.com/markedjs/marked.`,n){const r="<p>An err
64
67
  - Product presentations or lookbooks
65
68
  - Any content that combines written information with supporting visuals
66
69
 
67
- IMPORTANT: Use this tool instead of just generating standalone images when the user wants informational or educational content with visuals. This creates a cohesive document with formatted text (markdown) AND images embedded at appropriate locations. For example, if asked to "create a guide about photosynthesis with a diagram", use ${H} to create a full guide with explanatory text and the diagram embedded, rather than just generating the diagram image alone.
70
+ IMPORTANT: Use this tool instead of just generating standalone images when the user wants informational or educational content with visuals. This creates a cohesive document with formatted text (markdown) AND images embedded at appropriate locations. For example, if asked to "create a guide about photosynthesis with a diagram", use ${V} to create a full guide with explanatory text and the diagram embedded, rather than just generating the diagram image alone.
68
71
 
69
- Format embedded images as: ![Detailed image prompt](__too_be_replaced_image_path__)`,Se={..._.pluginCore,viewComponent:ye,previewComponent:ve,samples:_.samples,systemPrompt:Re},Rt={plugin:Se};exports.TOOL_DEFINITION=_.TOOL_DEFINITION;exports.executeMarkdown=_.executeMarkdown;exports.pluginCore=_.pluginCore;exports.samples=_.samples;exports.Preview=ve;exports.SYSTEM_PROMPT=Re;exports.TOOL_NAME=H;exports.View=ye;exports.default=Rt;exports.plugin=Se;
72
+ Format embedded images as: ![Detailed image prompt](__too_be_replaced_image_path__)`,ye={...T.pluginCore,viewComponent:be,previewComponent:me,samples:T.samples,systemPrompt:we},mt={plugin:ye};exports.TOOL_DEFINITION=T.TOOL_DEFINITION;exports.executeMarkdown=T.executeMarkdown;exports.pluginCore=T.pluginCore;exports.samples=T.samples;exports.Preview=me;exports.SYSTEM_PROMPT=we;exports.TOOL_NAME=V;exports.View=be;exports.default=mt;exports.plugin=ye;