PageSourceSearch

https://glama.ai/client/Markdown-j5XeYVQz.js

js glama.ai collected 2026-10-02 05:59:57 UTC 57,752 bytes, 84 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["Mermaid-CDSNvPJU.js","rolldown-runtime-C0FnF6B9.js","react-BwCorr0Z.js","core-BXImQz-A.js","Banner-BzukFc8g.js","form-Cf-5h8fG.js","highlighter-ZCqfOAE9.js","markdown-sfvZGjgB.js","highlighter-CDnpSv-o.js"])))=>i.map(i=>d[i]);
2import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{Cn as t,Fn as n,J as r,Zt as i}from"./react-BwCorr0Z.js";import{Or as a,gn as o}from"./core-BXImQz-A.js";import{S as s}from"./form-Cf-5h8fG.js";import{t as c}from"./captureMessage-m-fkLx_2.js";import{t as l}from"./formatSlug-DAkmfAf5.js";import{t as u}from"./SyntaxHighlighter-5OqpegM_.js";var d=r(),f=[/^#{1,6}\s+/m,/\*/,/_/,/\[/,/^\s*[*+-]\s+/m,/^\s*\d+\.\s+/m,/`/,/>/,/^[*_-]{3,}$/m,/\|/,/~/,/:/,/ {2}\n/],p=e=>{if(!e)return!1;for(let t of f)if(t.test(e))return!0;return!1},m=String.raw`\[memory:([a-z0-9]+)\]`,ee=({text:e})=>{let t=new RegExp(m,`giu`);return e.matchAll(t)};function h(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var g=h();function te(e){g=e}var _={exec:()=>null};function v(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function y(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(b.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var ne=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}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,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,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[	 ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:v(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ 	][^\\n]*)?(?:\\n|$))`)),hrRegex:v(e=>RegExp(`^ {0,${e}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:v(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:v(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:v(e=>RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`,`i`)),blockquoteBeginRegex:v(e=>RegExp(`^ {0,${e}}>`))},re=/^(?:[ \t]*(?:\n|$))+/,ie=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,ae=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,x=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,oe=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,S=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,se=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ce=y(se).replace(/bull/g,S).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}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),le=y(se).replace(/bull/g,S).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}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),C=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,ue=/^[^\n]+/,w=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,de=y(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,w).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),fe=y(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,S).getRegex(),T=`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`,E=/<!--(?:-?>|[\s\S]*?(?:-->
vendor: 6,020 bytes, lines 2-3
2|$))/,pe=y(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\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`,E).replace(`tag`,T).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),me=e=>y(C).replace(`hr`,x).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,e).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,T).getRegex(),he=me(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),ge=me(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),D={blockquote:y(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,ge).getRegex(),code:ie,def:de,fences:ae,heading:oe,hr:x,html:pe,lheading:ce,list:fe,newline:re,paragraph:he,table:_,text:ue},_e=y(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,x).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3}	)[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,T).getRegex(),ve={...D,lheading:le,table:_e,paragraph:y(C).replace(`hr`,x).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,_e).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,T).getRegex()},ye={...D,html:y(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,E).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:_,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:y(C).replace(`hr`,x).replace(`heading`,` *#{1,6} *[^
3]`).replace(`lheading`,ce).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},be=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,xe=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Se=/^( {2,}|\\)\n(?!\s*$)/,Ce=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,O=/[\p{P}\p{S}]/u,k=/[\s\p{P}\p{S}]/u,A=/[^\s\p{P}\p{S}]/u,we=y(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,k).getRegex(),Te=/[\p{Pi}\p{Ps}"']/u,j=/(?!~)[\p{P}\p{S}]/u,Ee=/(?!~)[\s\p{P}\p{S}]/u,De=/(?:[^\s\p{P}\p{S}]|~)/u,Oe=y(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,ne?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),ke=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Ae=y(ke,`u`).replace(/punct/g,O).getRegex(),je=y(ke,`u`).replace(/punct/g,j).getRegex(),Me=y(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,`u`).replace(/openQuote/g,Te).replace(/punct/g,O).getRegex(),Ne=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,Pe=y(Ne,`gu`).replace(/notPunctSpace/g,A).replace(/punctSpace/g,k).replace(/punct/g,O).getRegex(),Fe=y(Ne,`gu`).replace(/notPunctSpace/g,De).replace(/punctSpace/g,Ee).replace(/punct/g,j).getRegex(),Ie=y(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,A).replace(/punctSpace/g,k).replace(/punct/g,O).getRegex(),Le=y(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,A).replace(/punctSpace/g,k).replace(/punct/g,O).getRegex(),Re=y(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,A).replace(/punctSpace/g,k).replace(/punct/g,O).getRegex(),ze=y(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,O).getRegex(),Be=y(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,A).replace(/punctSpace/g,k).replace(/punct/g,O).getRegex(),Ve=y(/\\(punct)/,`gu`).replace(/punct/g,O).getRegex(),He=y(/^<(scheme:[^\s\x00-\x1f<>]*|email)>
3/).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(),Ue=y(E).replace(`(?:-->|$)`,`-->`).getRegex(),We=y(`^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`,Ue).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),M=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Ge=y(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,M).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ke=y(/^!?\[(label)\]\[(ref)\]/).replace(`label`,M).replace(`ref`,w).getRegex(),qe=y(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,w).getRegex(),Je=y(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,Ke).replace(`nolink`,qe).getRegex(),Ye=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,N={_backpedal:_,anyPunctuation:Ve,autolink:He,blockSkip:Oe,br:Se,code:xe,del:_,delLDelim:_,delRDelim:_,emStrongLDelim:Ae,emStrongRDelimAst:Pe,emStrongRDelimUnd:Le,escape:be,link:Ge,nolink:qe,punctuation:we,reflink:Ke,reflinkSearch:Je,tag:We,text:Ce,url:_},Xe={...N,emStrongLDelim:Me,emStrongRDelimAst:Ie,emStrongRDelimUnd:Re,link:y(/^!?\[(label)\]\((.*?)\)/).replace(`label`,M).getRegex(),reflink:y(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,M).getRegex()},P={...N,emStrongRDelimAst:Fe,emStrongLDelim:je,delLDelim:ze,delRDelim:Be,url:y(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,Ye).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:y(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,Ye).getRegex()},Ze={...P,br:y(Se).replace(`{2,}`,`*`).getRegex(),text:y(P.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},F={normal:D,gfm:ve,pedantic:ye},I={normal:N,gfm:P,breaks:Ze,pedantic:Xe},Qe={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},$e=e=>Qe[e];function L(e,t){if(t){if(b.escapeTest.test(e))return e.replace(b.escapeReplace,$e)}else if(b.escapeTestNoEncode.test(e))return e.replace(b.escapeReplaceNoEncode,$e);return e}function et(e){try{e=encodeURI(e).replace(b.percentDecode,`%`)}catch{return null}return e}function tt(e,t){let n=e.replace(b.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(b.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(b.slashPipe,`|`);return n}function R(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function z(e){let t=e.split(`
4`),n=t.length-1;for(;n>=0&&b.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
5`)}function nt(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function rt(e,t=0){let n=t,r=``;for(let t of e)if(t===`	`){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function it(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`),c=e[0].charAt(0)===`!`;r.state.inLink=!0;let l=r.state.linkEmitted,u=r.state.inRawBlock;r.state.linkEmitted=!1;let d=r.inlineTokens(s),f=r.state.linkEmitted;if(r.state.linkEmitted=l,r.state.inLink=!1,!c){if(f){r.state.inRawBlock=u;return}r.state.linkEmitted=!0}return{type:c?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:d}}function at(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
6`).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e}).join(`
7`)}var B=class{options;rules;lexer;constructor(e){this.options=e||g}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:z(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=at(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=R(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:R(t[0],`
8`),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:R(t[0],`
9`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=R(t[0],`
10`).split(`
11`),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o=0;for(;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
12`),c=s.replace(this.rules.other.blockquoteSetextReplace,`
13    $1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
14${s}`:s,r=r?`${r}
15${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`)break;
vendor: 15,481 bytes, lines 15-47
15if(u?.type===`blockquote`){let t=u,a=e.join(`
16`),o=t.raw+`
17`+a.replace(this.rules.other.blockquoteSetextReplace2,``),s=this.blockquote(o);i[i.length-1]=s,n=`${n}
18${a}`,r=r.substring(0,r.length-t.text.length)+s.text;break}if(u?.type===`list`){let t=u,a=t.raw+`
19`+e.join(`
20`),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
21`);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=rt(t[2].split(`
22`,1)[0],t[1].length),l=e.split(`
23`,1)[0],u=!c.trim(),d=0;if(this.options.pedantic?(d=2,s=c.trimStart()):u?d=t[1].length+1:(d=c.search(this.rules.other.nonSpaceChar),d=d>4?1:d,s=c.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(l)&&(r+=l+`
24`,e=e.substring(l.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),a=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d),f=this.rules.other.blockquoteBeginRegex(d);for(;e;){let p=e.split(`
25`,1)[0],m;if(l=p,this.options.pedantic?(l=l.replace(this.rules.other.listReplaceNesting,`  `),m=l):m=l.replace(this.rules.other.tabCharGlobal,`    `),i.test(l)||a.test(l)||o.test(l)||f.test(l)||t.test(l)||n.test(l))break;if(m.search(this.rules.other.nonSpaceChar)>=d||!l.trim())s+=`
26`+m.slice(d);else{if(u||c.replace(this.rules.other.tabCharGlobal,`    `).search(this.rules.other.nonSpaceChar)>=4||i.test(c)||a.test(c)||n.test(c))break;s+=`
27`+l}u=!l.trim(),r+=p+`
28`,e=e.substring(p.length+1),c=m.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items)if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}for(let e of i.items){let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=z(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:R(t[0],`
29`),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=tt(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
30`):[],a={type:`table`,raw:R(t[0],`
31`),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(tt(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:R(t[0],`
32`),depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
33`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=R(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=nt(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),it(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return it(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,a,o,s=i,c=0,l=r[0][0],u=n===l,d=l===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(r=d.exec(t))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(o=[...a].length,r[3]||r[4]){s+=o;continue}if(r[5]||r[6]){if(i%3&&!((i+o)%3)){c+=o;continue}if(u)break}if(s-=o,s>0)continue;o=Math.min(o,o+s+c);let t=[...r[0]][0].length,n=e.slice(0,i+r.index+t+o);if(Math.min(i,o)%2){let e=n.slice(1,-1);return{type:`em`,raw:n,text:e,tokens:this.lexer.inlineTokens(e)}}let l=n.slice(2,-2);return{type:`strong`,raw:n,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:t[0],escaped:e}}}},V=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||g,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,linkEmitted:!1,top:!0};let t={other:b,block:F.normal,inline:I.normal};this.options.pedantic?(t.block=F.pedantic,t.inline=I.pedantic):this.options.gfm&&(t.block=F.gfm,t.inline=this.options.breaks?I.breaks:I.gfm),this.tokenizer.rules=t}static get rules(){return{block:F,inline:I}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(b.carriageReturn,`
34`),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(b.tabCharGlobal,`    `).replace(b.spaceLine,``));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(n=>(i=n.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let n=t.at(-1);i.raw.length===1&&n!==void 0?n.raw+=`
35`:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
36`)?``:`
37`)+i.raw,n.text+=`
38`+i.text,this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.list(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.html(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
39`)?``:`
40`)+i.raw,n.text+=`
41`+i.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},t.push(i));continue}if(i=this.tokenizer.table(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.lheading(e)){e=e.substring(i.raw.length),t.push(i);continue}let a=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(this.state.top&&(i=this.tokenizer.paragraph(a))){let r=t.at(-1);n&&r?.type===`paragraph`?(r.raw+=(r.raw.endsWith(`
42`)?``:`
43`)+i.raw,r.text+=`
44`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(i),n=a.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
45`)?``:`
46`)+i.raw,n.text+=`
47`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes(`[`))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&e.charAt(n.index-1)!==`!`)return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf(`[`);if(e.charAt(0)!==`!`&&Object.hasOwn(this.tokens.links,e.slice(n+1,-1))&&!(n>1&&this.linkInText(e.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=e;if(this.tokens.links&&e.includes(`[`)){let e=this.tokenizer.rules.inline.reflinkSearch,t=n=>{let r=n.lastIndexOf(`[`);if(!Object.hasOwn(this.tokens.links,n.slice(r+1,-1)))return n;if(r>1&&n.charAt(0)!==`!`){let i=n.slice(1,r-1);if(this.linkInText(i))return`[`+i.replace(e,t)+`][`+`a`.repeat(n.length-r-2)+`]`}return`[`+`a`.repeat(n.length-2)+`]`};n=n.replace(e,t)}n=n.replace(this.tokenizer.rules.inline.anyPunctuation,e=>`+`.repeat(e.length)),n=n.replace(this.tokenizer.rules.inline.blockSkip,(e,t,n)=>{let r=n?n.length:0;return e.slice(0,r)+`[`+`a`.repeat(e.length-r-2)+`]`}),n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let r=!1,i=``,a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=``),r=!1;let o;if(this.options.extensions?.inline?.some(n=>(o=n.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);let n=t.at(-1);o.type===`text`&&n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(o=this.tokenizer.emStrong(e,n,i)){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,n,i)){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 s=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;
vendor: 6,056 bytes, lines 47-65
47this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(s)){e=e.substring(o.raw.length),o.raw.slice(-1)!==`_`&&(i=o.raw.slice(-1)),r=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},H=class{options;parser;constructor(e){this.options=e||g}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(b.notSpaceStart)?.[0],i=e.replace(b.endingNewline,``)+`
48`;return r?`<pre><code class="language-`+L(r)+`">`+(n?i:L(i,!0))+`</code></pre>
49`:`<pre><code>`+(n?i:L(i,!0))+`</code></pre>
50`}blockquote({tokens:e}){return`<blockquote>
51${this.parser.parse(e)}</blockquote>
52`}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
53`}hr(e){return`<hr>
54`}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
55`+r+`</`+i+`>
56`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
57`}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
58`}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
59<thead>
60`+t+`</thead>
61`+r+`</table>
62`}tablerow({text:e}){return`<tr>
63${e}</tr>
64`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
65`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${L(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=et(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+L(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=et(e);if(i===null)return L(n);e=i;let a=`<img src="${e}" alt="${L(n)}"`;return t&&(a+=` title="${L(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:L(e.text)}},U=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},W=class e{options;renderer;textRenderer;constructor(e){this.options=e||g,this.options.renderer=this.options.renderer||new H,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new U}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`checkbox`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`checkbox`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},G=class{options;block;constructor(e){this.options=e||g}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?V.lex:V.lexInline}provideParser(e=this.block){return e?W.parse:W.parseInline}},ot=class{defaults=h();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=W;Renderer=H;TextRenderer=U;Lexer=V;Tokenizer=B;Hooks=G;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;
vendor: 4,744 bytes, lines 65-66
65for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new H(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new B(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new G;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=G.passThroughHooks.has(n)?e=>{if(this.defaults.async&&G.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return V.lex(e,t??this.defaults)}parser(e,t){return W.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(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 a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?V.lex:V.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?W.parse:W.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?V.lex:V.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?W.parse:W.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
66Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+L(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}},K=new ot;function q(e,t){return K.parse(e,t)}q.options=q.setOptions=function(e){return K.setOptions(e),q.defaults=K.defaults,te(q.defaults),q},q.getDefaults=h,q.defaults=g;function st(...e){return K.use(...e),q.defaults=K.defaults,te(q.defaults),q}q.use=st,q.walkTokens=function(e,t){return K.walkTokens(e,t)}
66,q.parseInline=K.parseInline,q.Parser=W,q.parser=W.parse,q.Renderer=H,q.TextRenderer=U,q.Lexer=V,q.lexer=V.lex,q.Tokenizer=B,q.Hooks=G,q.parse=q,q.options,q.setOptions,q.walkTokens,q.parseInline,W.parse,V.lex;var ct=/:(\w+)\[([^\]]+)\]\{uid="([^"]+)"\}/gu,lt=/(\w+)="([^"]+)"/gu,ut=/<span data-id="([^"]+)" data-label="([^"]+)" data-type="mention"><\/span>/u,dt=/^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]/u,ft=/^\[\^([^\]]+)\]/u,pt=/^ {0,3}\[\^([^\]]+)\]:[ \t]*([^\n]*)(?:\n|$)/u,mt={level:`inline`,name:`footnoteReference`,renderer:()=>``,start(e){let t=e.indexOf(`[^`);return t<0?void 0:t},tokenizer(e){let t=ft.exec(e);if(t)return{identifier:t[1],raw:t[0],type:`footnoteReference`}}},ht={level:`block`,name:`footnoteDefinition`,renderer:()=>``,start(e){let t=/^ {0,3}\[\^[^\]]+\]:/mu.exec(e);return t?t.index:void 0},tokenizer(e){let t=pt.exec(e);if(t)return{identifier:t[1],raw:t[0],tokens:this.lexer.inlineTokens(t[2].trim()),type:`footnoteDefinition`}}},gt=new ot({gfm:!0});gt.use({extensions:[mt,ht]});var _t={type:`bold`},vt={type:`italic`},yt={type:`strike`},bt={type:`code`},xt=(e,t)=>e?(e.push(t),e):[t],St=e=>{if(!e.includes(`uid=`))return null;let t=[],n=0,r;for(ct.lastIndex=0;r=ct.exec(e);){let[i,a,o,s]=r;r.index>n&&t.push({text:e.slice(n,r.index),type:`text`}),t.push({attrs:{id:`${a}:${s}`,label:o},type:`mention`}),n=r.index+i.length}return t.length===0?null:(n<e.length&&t.push({text:e.slice(n),type:`text`}),t)},Ct=e=>{let t=[],n=0;for(let r of ee({text:e})){let[i,a]=r,o=r.index??0;a&&(o>n&&t.push({text:e.slice(n,o),type:`text`}),t.push({attrs:{uid:a},type:`projectMemoryReference`}),n=o+i.length)}return t.length===0?null:(n<e.length&&t.push({text:e.slice(n),type:`text`}),t)},wt=(e,t)=>{let n=St(e)??[{text:e,type:`text`}];if(t?.insideLink)return n;let r=[];for(let e of n)e.type===`text`&&e.text.includes(`[memory:`)?r.push(...Ct(e.text)??[e]):r.push(e);return r},Tt=e=>{if(!e||e.length===0)return``;let t=``;for(let n of e)t+=n.tokens?Tt(n.tokens):n.text||``;return t},Et=e=>{if(!e)return null;let t=e.match(ut);return t?{attrs:{id:t[1],label:t[2]},type:`mention`}:null},Dt=e=>{let t=e.lang||``,n=t.search(/\s/u),r=n===-1?t||null:t.slice(0,n),i=n===-1?``:t.slice(n+1),a={language:r||null};if(i){lt.lastIndex=0;let e;for(;e=lt.exec(i);)a[e[1]]=e[2]}let o=e.text||``;return{attrs:a,content:o?[{text:o,type:`text`}]:void 0,type:`codeBlock`}},Ot=e=>{let t=new Map;for(let n of e)n.type===`footnoteDefinition`&&!t.has(n.identifier)&&t.set(n.identifier,n.tokens);let n=(e,t)=>{for(let n of e)n.type===`text`&&(n.marks=xt(n.marks,t));return e},r=(e,r)=>{switch(e.type){case`br`:return{type:`hardBreak`};case`checkbox`:return null;case`codespan`:return{marks:[bt],text:e.text||``,type:`text`};case`del`:return n(i(e.tokens,r),yt);case`em`:return n(i(e.tokens,r),vt);case`escape`:return{text:e.text||``,type:`text`};case`footnoteReference`:return t.has(e.identifier)?{attrs:{id:e.identifier,label:e.identifier},type:`footnoteReference`}:{text:`[^${e.identifier}]`,type:`text`};case`html`:return Et(e.text);case`image`:return{attrs:{alt:Tt(e.tokens)||null,src:e.href||``,title:e.title||null},type:`image`};case`link`:{let t=i(e.tokens,{...r,insideLink:!0}),n={attrs:{class:null,href:e.href||``,rel:`noopener noreferrer nofollow`,target:`_blank`},type:`link`};for(let e of t)e.type===`text`&&(e.marks=xt(e.marks,n));return t}case`strong`:return n(i(e.tokens,r),_t);case`text`:return wt(e.text||``,r);default:return c({extra:{token:e},level:`warning`,message:`convertMarkdownToTiptap: unknown marked inline token type`}),null}},i=(e,t)=>{if(!e||e.length===0)return[];let n=[];for(let i of e){let e=r(i,t);e!==null&&(Array.isArray(e)?n.push(...e):n.push(e))}return n},a=e=>{let t=i(e.tokens);return{attrs:{colspan:1,colwidth:null,rowspan:1},content:t.length>0?[{content:t,type:`paragraph`}]:[],type:`tableCell`}},o=e=>{let t=[{content:(e.header||[]).map(a),type:`tableRow`}];for(let n of e.rows||[])t.push({content:n.map(a),type:`tableRow`});return{content:t,type:`table`}},s=e=>{let t=e.tokens||[];if(t.length===0)return{content:[{content:[],type:`paragraph`}],type:`listItem`};let n=[];for(let e of t)if(e.type===`text`)n.push({content:i(e.tokens??[{text:e.text,type:`text`}]),type:`paragraph`});else if(e.type!==`space`){let t=u(e);t&&(Array.isArray(t)?n.push(...t):n.push(t))}return n.length===0&&n.push({content:[],type:`paragraph`}),{content:n,type:`listItem`}},l=e=>{let t=e.tokens||[],n=t[0],r=n?.tokens?.[0];if(n?.type===`paragraph`&&r?.type===`text`){let e=dt.exec(r.text);if(e){let i=r.text.replace(dt,``).trim(),a=t;a=i?[{...n,tokens:[{...r,text:i},...n.tokens.slice(1)]},...t.slice(1)]:n.tokens.length===1?t.slice(1):[{...n,tokens:n.tokens.slice(1)},...t.slice(1)];let o=d(a);return{attrs:{type:e[1]},content:o.length>0?o:[{content:[],type:`paragraph`}],type:`admonition`}}}return{content:d(t),type:`blockquote`}},u=e=>{switch(e.type){case`blockquote`:return l(e);case`checkbox`:return null;case`code`:return Dt(e);case`def`:return null;case`footnoteDefinition`:return null;case`heading`:return{attrs:{level:e.depth||1},content:i(e.tokens),type:`heading`};case`hr`:return{type:`horizontalRule`};case`html`:return Et(e.text);case`list`:return e.ordered?{attrs:{start:e.start||1},content:(e.items||[]).map(s),type:`orderedList`}:{content:(e.items||[]).map(s),type:`bulletList`};case`paragraph`:return{content:i(e.tokens),type:`paragraph`};case`space`:return null;case`table`:return o(e);case`text`:return{content:i(e.tokens??[{text:e.text,type:`text`}]),type:`paragraph`};default:return c({extra:{token:e},level:`warning`,message:`convertMarkdownToTiptap: unknown marked block token type`}),null}},d=e=>{if(!e||e.length===0)return[];let t=[];for(let n of e){let e=u(n);e!==null&&(Array.isArray(e)?t.push(...e):t.push(e))}return t},f=d(e),p=[];for(let e of f)p.push(e),e.type===`horizontalRule`&&p.push({type:`paragraph`});return p.length===1&&p[0].type===`codeBlock`&&p[0].content?.[0]?.text?.includes(`loaderFactories`)&&p.push({type:`paragraph`}),t.size>0&&p.push({attrs:{items:Array.from(t.entries()).map(([e,t])=>({content:[{content:i(t),type:`paragraph`}],id:e}))},type:`footnoteDefinition`}),{content:p,type:`doc`}},J=e=>p(e)?Ot(gt.lexer(e)):{content:e.trim().split(`
67
68`).filter(e=>e.trim().length>0).map(e=>({content:[{text:e,type:`text`}],type:`paragraph`})),type:`doc`},Y=e(t(),1),{createElement:X,Fragment:Z,isValidElement:kt}=Y.default,At=e=>{let t=0,n=(e,n)=>{if(!n||n.length===0)return e;let r=e;for(let e=n.length-1;e>=0;e--){let i=n[e],a=String(t++),o=i.type;if(o===`bold`)r=X(`strong`,{key:a},r);else if(o===`code`)r=X(`code`,{key:a},r);else if(o===`italic`)r=X(`em`,{key:a},r);else if(o===`link`){let e=i.attrs;r=X(`a`,{href:e?.href||`#`,key:a,rel:e?.rel,target:e?.target},r)}else o===`strike`?r=X(`del`,{key:a},r):c({extra:{mark:i},level:`warning`,message:`convertTiptapToReact: unknown mark type`})}return r},r=e=>{if(!e||e.length===0)return[];let n=e.length,r=Array(n);for(let a=0;a<n;a++){let n=i(e[a]);kt(n)&&n.key?r[a]=n:n===null?r[a]=null:r[a]=X(Z,{key:String(t++)},n)}return r},i=i=>{let o=i.type;if(o===`text`)return n(i.text||``,i.marks);let u=String(t++),d=null,f=()=>(d===null&&(d=i.content?r(i.content):[]),d);if(e?.onNode){let t=e.onNode({get children(){return f()},key:u,node:i}
68);if(t!==null)return t}let p=i.content&&i.content.length>0;if(o===`paragraph`)return X(`p`,{key:u},p?f():null);if(o===`heading`){let e=Math.min(Math.max(1,i.attrs?.level||1),6),t=i.content?.[0]?.text||``;return X(`h${e}`,{id:t?`user-content-${l(t)}`:void 0,key:u},p?f():null)}if(o===`bulletList`)return X(`ul`,{key:u},p?f():null);if(o===`orderedList`){let e=i.attrs?.start;return X(`ol`,{key:u,...e&&e!==1&&{start:e}},p?f():null)}if(o===`listItem`)return X(`li`,{key:u},p?f():null);if(o===`blockquote`)return X(`blockquote`,{key:u},p?f():null);if(o===`codeBlock`){let e=i.content,t=``;if(e?.length){let n=[];for(let t=0,r=e.length;t<r;t++){let r=e[t];r.type===`text`&&r.text&&n.push(r.text)}t=n.join(``)}return X(`pre`,{"data-language":i.attrs?.language,key:u},X(`code`,null,t))}if(o===`hardBreak`)return X(`br`,{key:u});if(o===`horizontalRule`)return X(`hr`,{key:u});if(o===`image`){let e=i.attrs||{};return X(`img`,{alt:e.alt||``,key:u,src:e.src||``,title:e.title})}if(o===`table`)return X(`div`,{className:`table-wrapper`},X(`table`,{key:u},X(`tbody`,null,p?f():null)));if(o===`tableRow`)return X(`tr`,{key:u},p?f():null);if(o===`tableCell`){let e=i.attrs||{},t=e.colspan,n=e.rowspan;return X(`td`,{key:u,...t&&t!==1&&{colSpan:t},...n&&n!==1&&{rowSpan:n}},p?f():null)}if(o===`doc`)return X(Z,null,i.content&&r(i.content),i.children&&r(i.children));if(o===`admonition`){let e=i.attrs?.type||`NOTE`;return X(`div`,{className:`admonition admonition-${e.toLowerCase()}`,"data-admonition":``,"data-type":e,key:u},X(`div`,{className:`admonition-title`},e),X(`div`,{className:`admonition-content`},f()))}if(o===`footnoteDefinition`){let e=i.attrs?.items||[];return e.length===0?null:X(`div`,{className:`footnotes`,key:u},X(`ol`,null,e.map((e,t)=>X(`li`,{id:`fn-${e.id}`,key:e.id||t},e.content&&r(e.content),` `,X(`a`,{"aria-label":`Back to reference`,href:`#fnref-${e.id}`},`↩`)))))}if(o===`footnoteReference`){let e=i.attrs||{},t=e.id||``,n=e.label||t;return X(`sup`,{key:u},X(`a`,{href:`#fn-${t}`,id:`fnref-${t}`},n))}if(o===`projectMemoryReference`){let e=i.attrs||{},t=typeof e.projectUid==`string`?e.projectUid:null,n=typeof e.uid==`string`?e.uid:``,r={className:`mention mention-memory`,"data-memory-uid":n,"data-type":`projectMemoryReference`,key:u,title:n.length>0?`[memory:${n}]`:void 0};return t?X(`a`,{...r,href:a(`/projects/:uid/memories`,{params:{uid:t}})},X(s,{name:`brain`,size:12}),X(`span`,{className:`label`},`Memory`)):X(`span`,r,X(s,{name:`brain`,size:12}),X(`span`,{className:`label`},`Memory`))}if(o===`mention`){let e=i.attrs||{},t=e.id||``,n=e.label||``,[r,o]=t.split(`:`);return r===`agent`?X(`a`,{className:`mention mention-${r}`,"data-id":o,"data-label":n,"data-mention-suggestion-character":`@`,"data-type":`mention`,href:a(`/settings/agents/:uid`,{params:{uid:o}}),key:u,target:`_blank`},X(`span`,{className:`type`},r),X(`span`,{className:`label`},n)):r===`mcp`?X(`a`,{className:`mention mention-${r}`,"data-id":o,"data-label":n,"data-mention-suggestion-character":`@`,"data-type":`mention`,href:a(`/settings/mcp/connectors/:uid`,{params:{uid:o}}),key:u,target:`_blank`},X(`span`,{className:`type`},r),X(`span`,{className:`label`},n)):X(`span`,{className:`mention mention-${r}`,"data-id":o,"data-label":n,"data-mention-suggestion-character":`@`,"data-type":`mention`,key:u},X(`span`,{className:`type`},r),X(`span`,{className:`label`},n))}return c({extra:{node:i},level:`warning`,message:`convertTiptapToReact: unknown node type`}),null},o=i(e.content);return kt(o)?o:X(Z,null,o)},jt=({markdown:e})=>{let t=e.split(`
69`),n=[],r=[],i=!1,a=!1,o=!1,s=!1;for(let e=0;e<t.length;e++){let c=t[e],l=t[e+1],u=c.trim();if(c.startsWith("```")){if(i){r.push(c),n.push(r.join(`
70`)),r=[],i=!1;continue}r.length>0&&(n.push(r.join(`
71`)),r=[]),i=!0}if(i){r.push(c);continue}let d=/^#{1,6}\s/u.test(c),f=/^\s*[*+-]\s|^\s*\d+\.\s/u.test(c),p=c.startsWith(`|`)||/^\s*\|/u.test(c),m=c.startsWith(`>`),ee=/^[*_-]{3,}$/u.test(u),h=u===``;if(ee){r.length>0&&(n.push(r.join(`
72`)),r=[]),n.push(c);continue}if(d){r.length>0&&(n.push(r.join(`
73`)),r=[]),n.push(c);continue}if(p){a||=(r.length>0&&(n.push(r.join(`
74`)),r=[]),!0),r.push(c),l?.startsWith(`|`)||(n.push(r.join(`
75`)),r=[],a=!1);continue}if(f){o||=(r.length>0&&(n.push(r.join(`
76`)),r=[]),!0),r.push(c),l&&(/^\s*[*+-]\s/u.test(l)||/^\s*\d+\.\s/u.test(l)||/^\s{2,}\S/u.test(l))||(n.push(r.join(`
77`)),r=[],o=!1);continue}if(o&&/^\s{2,}\S/u.test(c)){r.push(c),l&&(/^\s*[*+-]\s/u.test(l)||/^\s*\d+\.\s/u.test(l)||/^\s{2,}\S/u.test(l))||(n.push(r.join(`
78`)),r=[],o=!1);continue}if(m){s||=(r.length>0&&(n.push(r.join(`
79`)),r=[]),!0),r.push(c),l?.startsWith(`>`)||(n.push(r.join(`
80`)),r=[],s=!1);continue}if(h){r.length>0&&(n.push(r.join(`
81`)),r=[]);continue}r.push(c),(l===void 0||l.trim()===``||/^#{1,6}\s/u.test(l)||/^[*+-]\s|\d+\.\s/u.test(l)||l.startsWith(`|`)||l.startsWith(`>`)||l.startsWith("```"))&&r.length>0&&(n.push(r.join(`
82`)),r=[])}r.length>0&&n.push(r.join(`
83`));let c=n.filter(e=>e.length>0);return c.length>0?c:[``]},Q=n(),Mt=(0,Y.lazy)(async()=>await i(()=>import(`./Mermaid-CDSNvPJU.js`).then(e=>({default:e.Mermaid})),__vite__mapDeps([0,1,2,3,4,5,6,7,8]))),Nt=e=>{let t=(0,d.c)(9),{key:n,node:r}=e;if(r.type===`codeBlock`){let e=r.attrs?.language||`plaintext`,i=r.content?.[0]?.text||``;if(e===`mermaid`){let e;t[0]===i?e=t[1]:(e=(0,Q.jsx)(Mt,{graphText:i}),t[0]=i,t[1]=e);let r;return t[2]!==n||t[3]!==e?(r=(0,Q.jsx)(Y.Suspense,{fallback:null,children:e},n),t[2]=n,t[3]=e,t[4]=r):r=t[4],r}let a;
83return t[5]!==i||t[6]!==n||t[7]!==e?(a=(0,Q.jsx)(u,{code:i,copyButton:!0,lang:e,lazy:!0},n),t[5]=i,t[6]=n,t[7]=e,t[8]=a):a=t[8],a}return null},$=(0,Y.memo)(e=>{let t=(0,d.c)(3),{chunk:n,transformTiptapNodes:r}=e,i;if(t[0]!==n||t[1]!==r){let e=J(n);i=At({content:r?.(e)||e,onNode:Nt}),t[0]=n,t[1]=r,t[2]=i}else i=t[2];return i},(e,t)=>e.chunk===t.chunk&&e.transformTiptapNodes===t.transformTiptapNodes),Pt=(0,Y.memo)(e=>{let t=(0,d.c)(9),{markdown:n,transformTiptapNodes:r}=e,i;t[0]===n?i=t[1]:(i=jt({markdown:n}),t[0]=n,t[1]=i);let a=(0,Y.useDeferredValue)(i),o;if(t[2]!==a||t[3]!==r){let e;t[5]===r?e=t[6]:(e=(e,t)=>(0,Q.jsx)($,{chunk:e,transformTiptapNodes:r},t),t[5]=r,t[6]=e),o=a.map(e),t[2]=a,t[3]=r,t[4]=o}else o=t[4];let s;return t[7]===o?s=t[8]:(s=(0,Q.jsx)(Q.Fragment,{children:o}),t[7]=o,t[8]=s),s},(e,t)=>e.markdown===t.markdown&&e.transformTiptapNodes===t.transformTiptapNodes),Ft=(0,Y.memo)(e=>{let t=(0,d.c)(9),{children:n,chunked:r,transformTiptapNodes:i}=e;if(!o()){let e;return t[0]!==n||t[1]!==i?(e=(0,Q.jsx)($,{chunk:n,transformTiptapNodes:i}),t[0]=n,t[1]=i,t[2]=e):e=t[2],e}if(r){let e;return t[3]!==n||t[4]!==i?(e=(0,Q.jsx)(Pt,{markdown:n,transformTiptapNodes:i}),t[3]=n,t[4]=i,t[5]=e):e=t[5],e}let a;return t[6]!==n||t[7]!==i?(a=(0,Q.jsx)($,{chunk:n,transformTiptapNodes:i}),t[6]=n,t[7]=i,t[8]=a):a=t[8],a});export{At as n,J as r,Ft as t};
84//# sourceMappingURL=Markdown-j5XeYVQz.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.