@gui-chat-plugin/markdown 0.0.2 → 0.0.3

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.js CHANGED
@@ -1,20 +1,20 @@
1
- import { samples as Se, pluginCore as Te } from "./core.js";
2
- import { TOOL_DEFINITION as Mt, executeMarkdown as Dt } from "./core.js";
3
- import { defineComponent as he, ref as _e, computed as O, watch as re, nextTick as ze, createElementBlock as C, openBlock as L, createElementVNode as x, Fragment as Ae, toDisplayString as pe, createTextVNode as ve, withDirectives as Pe, vModelText as Ie } from "vue";
4
- function H() {
1
+ import { samples as Te, pluginCore as _e } from "./core.js";
2
+ import { TOOL_DEFINITION as Qt, executeMarkdown as jt } from "./core.js";
3
+ import { defineComponent as pe, ref as ze, computed as N, watch as ne, nextTick as Ae, openBlock as C, createElementBlock as E, createElementVNode as x, Fragment as ve, toDisplayString as ue, createTextVNode as Pe, withDirectives as Ie, vModelText as Le } from "vue";
4
+ function G() {
5
5
  return { async: !1, breaks: !1, extensions: null, gfm: !0, hooks: null, pedantic: !1, renderer: null, silent: !1, tokenizer: null, walkTokens: null };
6
6
  }
7
- var S = H();
8
- function ue(s) {
9
- S = s;
7
+ var T = G();
8
+ function de(n) {
9
+ T = n;
10
10
  }
11
- var v = { exec: () => null };
12
- function d(s, e = "") {
13
- let r = typeof s == "string" ? s : s.source, n = { replace: (t, i) => {
11
+ var $ = { exec: () => null };
12
+ function d(n, e = "") {
13
+ let r = typeof n == "string" ? n : n.source, s = { replace: (t, i) => {
14
14
  let l = typeof i == "string" ? i : i.source;
15
- return l = l.replace(b.caret, "$1"), r = r.replace(t, l), n;
15
+ return l = l.replace(b.caret, "$1"), r = r.replace(t, l), s;
16
16
  }, getRegex: () => new RegExp(r, e) };
17
- return n;
17
+ return s;
18
18
  }
19
19
  var Ce = (() => {
20
20
  try {
@@ -22,59 +22,67 @@ var Ce = (() => {
22
22
  } catch {
23
23
  return !1;
24
24
  }
25
- })(), 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") }, Le = /^(?:[ \t]*(?:\n|$))+/, Ee = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Be = /^ {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+|$)/, qe = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, G = /(?:[*+-]|\d{1,9}[.)])/, de = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, ge = d(de).replace(/bull/g, G).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(), Me = d(de).replace(/bull/g, G).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(), U = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, De = /^[^\n]+/, F = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Ze = d(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", F).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Oe = d(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, G).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", V = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Ne = d("^ {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", V).replace("tag", M).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), ke = d(U).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", M).getRegex(), Qe = d(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", ke).getRegex(), X = { blockquote: Qe, code: Ee, def: Ze, fences: Be, heading: qe, hr: P, html: Ne, lheading: ge, list: Oe, newline: Le, paragraph: ke, table: v, text: De }, se = d("^ *([^\\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", M).getRegex(), je = { ...X, lheading: Me, table: se, paragraph: d(U).replace("hr", P).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", se).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() }, He = { ...X, html: d(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", V).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: v, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: d(U).replace("hr", P).replace("heading", ` *#{1,6} *[^
26
- ]`).replace("lheading", ge).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Ge = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Ue = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, fe = /^( {2,}|\\)\n(?!\s*$)/, Fe = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, D = /[\p{P}\p{S}]/u, W = /[\s\p{P}\p{S}]/u, xe = /[^\s\p{P}\p{S}]/u, Ve = d(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, W).getRegex(), be = /(?!~)[\p{P}\p{S}]/u, Xe = /(?!~)[\s\p{P}\p{S}]/u, We = /(?:[^\s\p{P}\p{S}]|~)/u, Je = d(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", Ce ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), me = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, Ke = d(me, "u").replace(/punct/g, D).getRegex(), Ye = d(me, "u").replace(/punct/g, be).getRegex(), we = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", et = d(we, "gu").replace(/notPunctSpace/g, xe).replace(/punctSpace/g, W).replace(/punct/g, D).getRegex(), tt = d(we, "gu").replace(/notPunctSpace/g, We).replace(/punctSpace/g, Xe).replace(/punct/g, be).getRegex(), rt = d("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, xe).replace(/punctSpace/g, W).replace(/punct/g, D).getRegex(), st = d(/\\(punct)/, "gu").replace(/punct/g, D).getRegex(), nt = d(/^<(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(), lt = d(V).replace("(?:-->|$)", "-->").getRegex(), it = d("^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", lt).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), E = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/, at = d(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", E).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), ye = d(/^!?\[(label)\]\[(ref)\]/).replace("label", E).replace("ref", F).getRegex(), Re = d(/^!?\[(ref)\](?:\[\])?/).replace("ref", F).getRegex(), ot = d("reflink|nolink(?!\\()", "g").replace("reflink", ye).replace("nolink", Re).getRegex(), ne = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, J = { _backpedal: v, anyPunctuation: st, autolink: nt, blockSkip: Je, br: fe, code: Ue, del: v, emStrongLDelim: Ke, emStrongRDelimAst: et, emStrongRDelimUnd: rt, escape: Ge, link: at, nolink: Re, punctuation: Ve, reflink: ye, reflinkSearch: ot, tag: it, text: Fe, url: v }, ct = { ...J, link: d(/^!?\[(label)\]\((.*?)\)/).replace("label", E).getRegex(), reflink: d(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", E).getRegex() }, N = { ...J, emStrongRDelimAst: tt, emStrongLDelim: Ye, url: d(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", ne).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: d(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", ne).getRegex() }, ht = { ...N, br: d(fe).replace("{2,}", "*").getRegex(), text: d(N.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, I = { normal: X, gfm: je, pedantic: He }, _ = { normal: J, gfm: N, breaks: ht, pedantic: ct }, pt = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }, le = (s) => pt[s];
27
- function R(s, e) {
25
+ })(), 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: (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"), blockquoteBeginRegex: (n) => new RegExp(`^ {0,${Math.min(3, n - 1)}}>`) }, Ee = /^(?:[ \t]*(?:\n|$))+/, Be = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, qe = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, I = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, De = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, U = / {0,3}(?:[*+-]|\d{1,9}[.)])/, ge = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, ke = d(ge).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(), Me = d(ge).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]+)*)/, Ze = /^[^\n]+/, V = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Oe = d(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", V).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Ne = d(/^(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", X = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Qe = d("^ {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", X).replace("tag", M).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), fe = d(F).replace("hr", I).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[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", M).getRegex(), je = d(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", fe).getRegex(), W = { blockquote: je, code: Be, def: Oe, fences: qe, heading: De, hr: I, html: Qe, lheading: ke, list: Ne, newline: Ee, paragraph: fe, table: $, text: Ze }, se = d("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", I).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[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", M).getRegex(), He = { ...W, lheading: Me, table: se, paragraph: d(F).replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", se).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", M).getRegex() }, Ge = { ...W, html: d(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", X).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: d(F).replace("hr", I).replace("heading", ` *#{1,6} *[^
26
+ ]`).replace("lheading", ke).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Ue = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Fe = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, xe = /^( {2,}|\\)\n(?!\s*$)/, Ve = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, _ = /[\p{P}\p{S}]/u, Z = /[\s\p{P}\p{S}]/u, Y = /[^\s\p{P}\p{S}]/u, Xe = d(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Z).getRegex(), be = /(?!~)[\p{P}\p{S}]/u, We = /(?!~)[\s\p{P}\p{S}]/u, Ye = /(?:[^\s\p{P}\p{S}]|~)/u, Je = d(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", Ce ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), me = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, Ke = d(me, "u").replace(/punct/g, _).getRegex(), et = d(me, "u").replace(/punct/g, be).getRegex(), we = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", tt = d(we, "gu").replace(/notPunctSpace/g, Y).replace(/punctSpace/g, Z).replace(/punct/g, _).getRegex(), rt = d(we, "gu").replace(/notPunctSpace/g, Ye).replace(/punctSpace/g, We).replace(/punct/g, be).getRegex(), nt = d("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, Y).replace(/punctSpace/g, Z).replace(/punct/g, _).getRegex(), st = d(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, _).getRegex(), lt = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", it = d(lt, "gu").replace(/notPunctSpace/g, Y).replace(/punctSpace/g, Z).replace(/punct/g, _).getRegex(), at = d(/\\(punct)/, "gu").replace(/punct/g, _).getRegex(), ot = d(/^<(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(), ct = d(X).replace("(?:-->|$)", "-->").getRegex(), ht = d("^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", ct).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), B = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, pt = d(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", B).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), ye = d(/^!?\[(label)\]\[(ref)\]/).replace("label", B).replace("ref", V).getRegex(), Re = d(/^!?\[(ref)\](?:\[\])?/).replace("ref", V).getRegex(), ut = d("reflink|nolink(?!\\()", "g").replace("reflink", ye).replace("nolink", Re).getRegex(), le = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, J = { _backpedal: $, anyPunctuation: at, autolink: ot, blockSkip: Je, br: xe, code: Fe, del: $, delLDelim: $, delRDelim: $, emStrongLDelim: Ke, emStrongRDelimAst: tt, emStrongRDelimUnd: nt, escape: Ue, link: pt, nolink: Re, punctuation: Xe, reflink: ye, reflinkSearch: ut, tag: ht, text: Ve, url: $ }, dt = { ...J, link: d(/^!?\[(label)\]\((.*?)\)/).replace("label", B).getRegex(), reflink: d(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", B).getRegex() }, Q = { ...J, emStrongRDelimAst: rt, emStrongLDelim: et, delLDelim: st, delRDelim: it, url: d(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", le).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: d(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", le).getRegex() }, gt = { ...Q, br: d(xe).replace("{2,}", "*").getRegex(), text: d(Q.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, L = { normal: W, gfm: He, pedantic: Ge }, A = { normal: J, gfm: Q, breaks: gt, pedantic: dt }, kt = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }, ie = (n) => kt[n];
27
+ function y(n, e) {
28
28
  if (e) {
29
- if (b.escapeTest.test(s)) return s.replace(b.escapeReplace, le);
30
- } else if (b.escapeTestNoEncode.test(s)) return s.replace(b.escapeReplaceNoEncode, le);
31
- return s;
29
+ if (b.escapeTest.test(n)) return n.replace(b.escapeReplace, ie);
30
+ } else if (b.escapeTestNoEncode.test(n)) return n.replace(b.escapeReplaceNoEncode, ie);
31
+ return n;
32
32
  }
33
- function ie(s) {
33
+ function ae(n) {
34
34
  try {
35
- s = encodeURI(s).replace(b.percentDecode, "%");
35
+ n = encodeURI(n).replace(b.percentDecode, "%");
36
36
  } catch {
37
37
  return null;
38
38
  }
39
- return s;
39
+ return n;
40
40
  }
41
- function ae(s, e) {
42
- let r = s.replace(b.findPipe, (i, l, c) => {
41
+ function oe(n, e) {
42
+ let r = n.replace(b.findPipe, (i, l, c) => {
43
43
  let a = !1, h = l;
44
44
  for (; --h >= 0 && c[h] === "\\"; ) a = !a;
45
45
  return a ? "|" : " |";
46
- }), n = r.split(b.splitPipe), t = 0;
47
- if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), e) if (n.length > e) n.splice(e);
48
- else for (; n.length < e; ) n.push("");
49
- for (; t < n.length; t++) n[t] = n[t].trim().replace(b.slashPipe, "|");
50
- return n;
46
+ }), s = r.split(b.splitPipe), t = 0;
47
+ if (s[0].trim() || s.shift(), s.length > 0 && !s.at(-1)?.trim() && s.pop(), e) if (s.length > e) s.splice(e);
48
+ else for (; s.length < e; ) s.push("");
49
+ for (; t < s.length; t++) s[t] = s[t].trim().replace(b.slashPipe, "|");
50
+ return s;
51
51
  }
52
- function z(s, e, r) {
53
- let n = s.length;
54
- if (n === 0) return "";
52
+ function v(n, e, r) {
53
+ let s = n.length;
54
+ if (s === 0) return "";
55
55
  let t = 0;
56
- for (; t < n && s.charAt(n - t - 1) === e; )
56
+ for (; t < s && n.charAt(s - t - 1) === e; )
57
57
  t++;
58
- return s.slice(0, n - t);
58
+ return n.slice(0, s - t);
59
59
  }
60
- function ut(s, e) {
61
- if (s.indexOf(e[1]) === -1) return -1;
60
+ function ft(n, e) {
61
+ if (n.indexOf(e[1]) === -1) return -1;
62
62
  let r = 0;
63
- for (let n = 0; n < s.length; n++) if (s[n] === "\\") n++;
64
- else if (s[n] === e[0]) r++;
65
- else if (s[n] === e[1] && (r--, r < 0)) return n;
63
+ for (let s = 0; s < n.length; s++) if (n[s] === "\\") s++;
64
+ else if (n[s] === e[0]) r++;
65
+ else if (n[s] === e[1] && (r--, r < 0)) return s;
66
66
  return r > 0 ? -2 : -1;
67
67
  }
68
- function oe(s, e, r, n, t) {
69
- let i = e.href, l = e.title || null, c = s[1].replace(t.other.outputLinkReplace, "$1");
70
- n.state.inLink = !0;
71
- let a = { type: s[0].charAt(0) === "!" ? "image" : "link", raw: r, href: i, title: l, text: c, tokens: n.inlineTokens(c) };
72
- return n.state.inLink = !1, a;
68
+ function xt(n, e = 0) {
69
+ let r = e, s = "";
70
+ for (let t of n) if (t === " ") {
71
+ let i = 4 - r % 4;
72
+ s += " ".repeat(i), r += i;
73
+ } else s += t, r++;
74
+ return s;
73
75
  }
74
- function dt(s, e, r) {
75
- let n = s.match(r.other.indentCodeCompensation);
76
- if (n === null) return e;
77
- let t = n[1];
76
+ function ce(n, e, r, s, t) {
77
+ let i = e.href, l = e.title || null, c = n[1].replace(t.other.outputLinkReplace, "$1");
78
+ s.state.inLink = !0;
79
+ let a = { type: n[0].charAt(0) === "!" ? "image" : "link", raw: r, href: i, title: l, text: c, tokens: s.inlineTokens(c) };
80
+ return s.state.inLink = !1, a;
81
+ }
82
+ function bt(n, e, r) {
83
+ let s = n.match(r.other.indentCodeCompensation);
84
+ if (s === null) return e;
85
+ let t = s[1];
78
86
  return e.split(`
79
87
  `).map((i) => {
80
88
  let l = i.match(r.other.beginningSpace);
@@ -84,54 +92,54 @@ function dt(s, e, r) {
84
92
  }).join(`
85
93
  `);
86
94
  }
87
- var B = class {
95
+ var q = class {
88
96
  options;
89
97
  rules;
90
98
  lexer;
91
- constructor(s) {
92
- this.options = s || S;
99
+ constructor(n) {
100
+ this.options = n || T;
93
101
  }
94
- space(s) {
95
- let e = this.rules.block.newline.exec(s);
102
+ space(n) {
103
+ let e = this.rules.block.newline.exec(n);
96
104
  if (e && e[0].length > 0) return { type: "space", raw: e[0] };
97
105
  }
98
- code(s) {
99
- let e = this.rules.block.code.exec(s);
106
+ code(n) {
107
+ let e = this.rules.block.code.exec(n);
100
108
  if (e) {
101
109
  let r = e[0].replace(this.rules.other.codeRemoveIndent, "");
102
- return { type: "code", raw: e[0], codeBlockStyle: "indented", text: this.options.pedantic ? r : z(r, `
110
+ return { type: "code", raw: e[0], codeBlockStyle: "indented", text: this.options.pedantic ? r : v(r, `
103
111
  `) };
104
112
  }
105
113
  }
106
- fences(s) {
107
- let e = this.rules.block.fences.exec(s);
114
+ fences(n) {
115
+ let e = this.rules.block.fences.exec(n);
108
116
  if (e) {
109
- let r = e[0], n = dt(r, e[3] || "", this.rules);
110
- return { type: "code", raw: r, lang: e[2] ? e[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : e[2], text: n };
117
+ let r = e[0], s = bt(r, e[3] || "", this.rules);
118
+ return { type: "code", raw: r, lang: e[2] ? e[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : e[2], text: s };
111
119
  }
112
120
  }
113
- heading(s) {
114
- let e = this.rules.block.heading.exec(s);
121
+ heading(n) {
122
+ let e = this.rules.block.heading.exec(n);
115
123
  if (e) {
116
124
  let r = e[2].trim();
117
125
  if (this.rules.other.endingHash.test(r)) {
118
- let n = z(r, "#");
119
- (this.options.pedantic || !n || this.rules.other.endingSpaceChar.test(n)) && (r = n.trim());
126
+ let s = v(r, "#");
127
+ (this.options.pedantic || !s || this.rules.other.endingSpaceChar.test(s)) && (r = s.trim());
120
128
  }
121
129
  return { type: "heading", raw: e[0], depth: e[1].length, text: r, tokens: this.lexer.inline(r) };
122
130
  }
123
131
  }
124
- hr(s) {
125
- let e = this.rules.block.hr.exec(s);
126
- if (e) return { type: "hr", raw: z(e[0], `
132
+ hr(n) {
133
+ let e = this.rules.block.hr.exec(n);
134
+ if (e) return { type: "hr", raw: v(e[0], `
127
135
  `) };
128
136
  }
129
- blockquote(s) {
130
- let e = this.rules.block.blockquote.exec(s);
137
+ blockquote(n) {
138
+ let e = this.rules.block.blockquote.exec(n);
131
139
  if (e) {
132
- let r = z(e[0], `
140
+ let r = v(e[0], `
133
141
  `).split(`
134
- `), n = "", t = "", i = [];
142
+ `), s = "", t = "", i = [];
135
143
  for (; r.length > 0; ) {
136
144
  let l = !1, c = [], a;
137
145
  for (a = 0; a < r.length; a++) if (this.rules.other.blockquoteStart.test(r[a])) c.push(r[a]), l = !0;
@@ -141,7 +149,7 @@ var B = class {
141
149
  let h = c.join(`
142
150
  `), o = h.replace(this.rules.other.blockquoteSetextReplace, `
143
151
  $1`).replace(this.rules.other.blockquoteSetextReplace2, "");
144
- n = n ? `${n}
152
+ s = s ? `${s}
145
153
  ${h}` : h, t = t ? `${t}
146
154
  ${o}` : o;
147
155
  let p = this.lexer.state.top;
@@ -151,50 +159,50 @@ ${o}` : o;
151
159
  if (u?.type === "blockquote") {
152
160
  let f = u, k = f.raw + `
153
161
  ` + r.join(`
154
- `), m = this.blockquote(k);
155
- i[i.length - 1] = m, n = n.substring(0, n.length - f.raw.length) + m.raw, t = t.substring(0, t.length - f.text.length) + m.text;
162
+ `), R = this.blockquote(k);
163
+ i[i.length - 1] = R, s = s.substring(0, s.length - f.raw.length) + R.raw, t = t.substring(0, t.length - f.text.length) + R.text;
156
164
  break;
157
165
  } else if (u?.type === "list") {
158
166
  let f = u, k = f.raw + `
159
167
  ` + r.join(`
160
- `), m = this.list(k);
161
- i[i.length - 1] = m, n = n.substring(0, n.length - u.raw.length) + m.raw, t = t.substring(0, t.length - f.raw.length) + m.raw, r = k.substring(i.at(-1).raw.length).split(`
168
+ `), R = this.list(k);
169
+ i[i.length - 1] = R, s = s.substring(0, s.length - u.raw.length) + R.raw, t = t.substring(0, t.length - f.raw.length) + R.raw, r = k.substring(i.at(-1).raw.length).split(`
162
170
  `);
163
171
  continue;
164
172
  }
165
173
  }
166
- return { type: "blockquote", raw: n, tokens: i, text: t };
174
+ return { type: "blockquote", raw: s, tokens: i, text: t };
167
175
  }
168
176
  }
169
- list(s) {
170
- let e = this.rules.block.list.exec(s);
177
+ list(n) {
178
+ let e = this.rules.block.list.exec(n);
171
179
  if (e) {
172
- let r = e[1].trim(), n = r.length > 1, t = { type: "list", raw: "", ordered: n, start: n ? +r.slice(0, -1) : "", loose: !1, items: [] };
173
- r = n ? `\\d{1,9}\\${r.slice(-1)}` : `\\${r}`, this.options.pedantic && (r = n ? r : "[*+-]");
180
+ let r = e[1].trim(), s = r.length > 1, t = { type: "list", raw: "", ordered: s, start: s ? +r.slice(0, -1) : "", loose: !1, items: [] };
181
+ r = s ? `\\d{1,9}\\${r.slice(-1)}` : `\\${r}`, this.options.pedantic && (r = s ? r : "[*+-]");
174
182
  let i = this.rules.other.listItemRegex(r), l = !1;
175
- for (; s; ) {
183
+ for (; n; ) {
176
184
  let a = !1, h = "", o = "";
177
- if (!(e = i.exec(s)) || this.rules.block.hr.test(s)) break;
178
- h = e[0], s = s.substring(h.length);
179
- let p = e[2].split(`
180
- `, 1)[0].replace(this.rules.other.listReplaceTabs, (m) => " ".repeat(3 * m.length)), u = s.split(`
185
+ if (!(e = i.exec(n)) || this.rules.block.hr.test(n)) break;
186
+ h = e[0], n = n.substring(h.length);
187
+ let p = xt(e[2].split(`
188
+ `, 1)[0], e[1].length), u = n.split(`
181
189
  `, 1)[0], f = !p.trim(), k = 0;
182
- if (this.options.pedantic ? (k = 2, o = p.trimStart()) : f ? k = e[1].length + 1 : (k = e[2].search(this.rules.other.nonSpaceChar), k = k > 4 ? 1 : k, o = p.slice(k), k += e[1].length), f && this.rules.other.blankLine.test(u) && (h += u + `
183
- `, s = s.substring(u.length + 1), a = !0), !a) {
184
- let m = this.rules.other.nextBulletRegex(k), Y = this.rules.other.hrRegex(k), ee = this.rules.other.fencesBeginRegex(k), te = this.rules.other.headingBeginRegex(k), $e = this.rules.other.htmlBeginRegex(k);
185
- for (; s; ) {
186
- let Z = s.split(`
187
- `, 1)[0], T;
188
- if (u = Z, this.options.pedantic ? (u = u.replace(this.rules.other.listReplaceNesting, " "), T = u) : T = u.replace(this.rules.other.tabCharGlobal, " "), ee.test(u) || te.test(u) || $e.test(u) || m.test(u) || Y.test(u)) break;
189
- if (T.search(this.rules.other.nonSpaceChar) >= k || !u.trim()) o += `
190
- ` + T.slice(k);
190
+ if (this.options.pedantic ? (k = 2, o = p.trimStart()) : f ? k = e[1].length + 1 : (k = p.search(this.rules.other.nonSpaceChar), k = k > 4 ? 1 : k, o = p.slice(k), k += e[1].length), f && this.rules.other.blankLine.test(u) && (h += u + `
191
+ `, n = n.substring(u.length + 1), a = !0), !a) {
192
+ let R = this.rules.other.nextBulletRegex(k), ee = this.rules.other.hrRegex(k), te = this.rules.other.fencesBeginRegex(k), re = this.rules.other.headingBeginRegex(k), $e = this.rules.other.htmlBeginRegex(k), Se = this.rules.other.blockquoteBeginRegex(k);
193
+ for (; n; ) {
194
+ let O = n.split(`
195
+ `, 1)[0], z;
196
+ if (u = O, this.options.pedantic ? (u = u.replace(this.rules.other.listReplaceNesting, " "), z = u) : z = u.replace(this.rules.other.tabCharGlobal, " "), te.test(u) || re.test(u) || $e.test(u) || Se.test(u) || R.test(u) || ee.test(u)) break;
197
+ if (z.search(this.rules.other.nonSpaceChar) >= k || !u.trim()) o += `
198
+ ` + z.slice(k);
191
199
  else {
192
- if (f || p.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || ee.test(p) || te.test(p) || Y.test(p)) break;
200
+ if (f || p.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || te.test(p) || re.test(p) || ee.test(p)) break;
193
201
  o += `
194
202
  ` + u;
195
203
  }
196
- !f && !u.trim() && (f = !0), h += Z + `
197
- `, s = s.substring(Z.length + 1), p = T.slice(k);
204
+ f = !u.trim(), h += O + `
205
+ `, n = n.substring(O.length + 1), p = z.slice(k);
198
206
  }
199
207
  }
200
208
  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;
@@ -230,104 +238,107 @@ ${o}` : o;
230
238
  return t;
231
239
  }
232
240
  }
233
- html(s) {
234
- let e = this.rules.block.html.exec(s);
241
+ html(n) {
242
+ let e = this.rules.block.html.exec(n);
235
243
  if (e) return { type: "html", block: !0, raw: e[0], pre: e[1] === "pre" || e[1] === "script" || e[1] === "style", text: e[0] };
236
244
  }
237
- def(s) {
238
- let e = this.rules.block.def.exec(s);
245
+ def(n) {
246
+ let e = this.rules.block.def.exec(n);
239
247
  if (e) {
240
- 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];
241
- return { type: "def", tag: r, raw: e[0], href: n, title: t };
248
+ let r = e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "), s = 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];
249
+ return { type: "def", tag: r, raw: e[0], href: s, title: t };
242
250
  }
243
251
  }
244
- table(s) {
245
- let e = this.rules.block.table.exec(s);
252
+ table(n) {
253
+ let e = this.rules.block.table.exec(n);
246
254
  if (!e || !this.rules.other.tableDelimiter.test(e[2])) return;
247
- let r = ae(e[1]), n = e[2].replace(this.rules.other.tableAlignChars, "").split("|"), t = e[3]?.trim() ? e[3].replace(this.rules.other.tableRowBlankLine, "").split(`
255
+ let r = oe(e[1]), s = e[2].replace(this.rules.other.tableAlignChars, "").split("|"), t = e[3]?.trim() ? e[3].replace(this.rules.other.tableRowBlankLine, "").split(`
248
256
  `) : [], i = { type: "table", raw: e[0], header: [], align: [], rows: [] };
249
- if (r.length === n.length) {
250
- 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);
257
+ if (r.length === s.length) {
258
+ for (let l of s) 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);
251
259
  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] });
252
- for (let l of t) i.rows.push(ae(l, i.header.length).map((c, a) => ({ text: c, tokens: this.lexer.inline(c), header: !1, align: i.align[a] })));
260
+ for (let l of t) i.rows.push(oe(l, i.header.length).map((c, a) => ({ text: c, tokens: this.lexer.inline(c), header: !1, align: i.align[a] })));
253
261
  return i;
254
262
  }
255
263
  }
256
- lheading(s) {
257
- let e = this.rules.block.lheading.exec(s);
258
- if (e) return { type: "heading", raw: e[0], depth: e[2].charAt(0) === "=" ? 1 : 2, text: e[1], tokens: this.lexer.inline(e[1]) };
264
+ lheading(n) {
265
+ let e = this.rules.block.lheading.exec(n);
266
+ if (e) {
267
+ let r = e[1].trim();
268
+ return { type: "heading", raw: e[0], depth: e[2].charAt(0) === "=" ? 1 : 2, text: r, tokens: this.lexer.inline(r) };
269
+ }
259
270
  }
260
- paragraph(s) {
261
- let e = this.rules.block.paragraph.exec(s);
271
+ paragraph(n) {
272
+ let e = this.rules.block.paragraph.exec(n);
262
273
  if (e) {
263
274
  let r = e[1].charAt(e[1].length - 1) === `
264
275
  ` ? e[1].slice(0, -1) : e[1];
265
276
  return { type: "paragraph", raw: e[0], text: r, tokens: this.lexer.inline(r) };
266
277
  }
267
278
  }
268
- text(s) {
269
- let e = this.rules.block.text.exec(s);
279
+ text(n) {
280
+ let e = this.rules.block.text.exec(n);
270
281
  if (e) return { type: "text", raw: e[0], text: e[0], tokens: this.lexer.inline(e[0]) };
271
282
  }
272
- escape(s) {
273
- let e = this.rules.inline.escape.exec(s);
283
+ escape(n) {
284
+ let e = this.rules.inline.escape.exec(n);
274
285
  if (e) return { type: "escape", raw: e[0], text: e[1] };
275
286
  }
276
- tag(s) {
277
- let e = this.rules.inline.tag.exec(s);
287
+ tag(n) {
288
+ let e = this.rules.inline.tag.exec(n);
278
289
  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] };
279
290
  }
280
- link(s) {
281
- let e = this.rules.inline.link.exec(s);
291
+ link(n) {
292
+ let e = this.rules.inline.link.exec(n);
282
293
  if (e) {
283
294
  let r = e[2].trim();
284
295
  if (!this.options.pedantic && this.rules.other.startAngleBracket.test(r)) {
285
296
  if (!this.rules.other.endAngleBracket.test(r)) return;
286
- let i = z(r.slice(0, -1), "\\");
297
+ let i = v(r.slice(0, -1), "\\");
287
298
  if ((r.length - i.length) % 2 === 0) return;
288
299
  } else {
289
- let i = ut(e[2], "()");
300
+ let i = ft(e[2], "()");
290
301
  if (i === -2) return;
291
302
  if (i > -1) {
292
303
  let l = (e[0].indexOf("!") === 0 ? 5 : 4) + e[1].length + i;
293
304
  e[2] = e[2].substring(0, i), e[0] = e[0].substring(0, l).trim(), e[3] = "";
294
305
  }
295
306
  }
296
- let n = e[2], t = "";
307
+ let s = e[2], t = "";
297
308
  if (this.options.pedantic) {
298
- let i = this.rules.other.pedanticHrefTitle.exec(n);
299
- i && (n = i[1], t = i[3]);
309
+ let i = this.rules.other.pedanticHrefTitle.exec(s);
310
+ i && (s = i[1], t = i[3]);
300
311
  } else t = e[3] ? e[3].slice(1, -1) : "";
301
- 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)), oe(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);
312
+ return s = s.trim(), this.rules.other.startAngleBracket.test(s) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(r) ? s = s.slice(1) : s = s.slice(1, -1)), ce(e, { href: s && s.replace(this.rules.inline.anyPunctuation, "$1"), title: t && t.replace(this.rules.inline.anyPunctuation, "$1") }, e[0], this.lexer, this.rules);
302
313
  }
303
314
  }
304
- reflink(s, e) {
315
+ reflink(n, e) {
305
316
  let r;
306
- if ((r = this.rules.inline.reflink.exec(s)) || (r = this.rules.inline.nolink.exec(s))) {
307
- let n = (r[2] || r[1]).replace(this.rules.other.multipleSpaceGlobal, " "), t = e[n.toLowerCase()];
317
+ if ((r = this.rules.inline.reflink.exec(n)) || (r = this.rules.inline.nolink.exec(n))) {
318
+ let s = (r[2] || r[1]).replace(this.rules.other.multipleSpaceGlobal, " "), t = e[s.toLowerCase()];
308
319
  if (!t) {
309
320
  let i = r[0].charAt(0);
310
321
  return { type: "text", raw: i, text: i };
311
322
  }
312
- return oe(r, t, r[0], this.lexer, this.rules);
323
+ return ce(r, t, r[0], this.lexer, this.rules);
313
324
  }
314
325
  }
315
- emStrong(s, e, r = "") {
316
- let n = this.rules.inline.emStrongLDelim.exec(s);
317
- if (!(!n || n[3] && r.match(this.rules.other.unicodeAlphaNumeric)) && (!(n[1] || n[2]) || !r || this.rules.inline.punctuation.exec(r))) {
318
- let t = [...n[0]].length - 1, i, l, c = t, a = 0, h = n[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
319
- for (h.lastIndex = 0, e = e.slice(-1 * s.length + t); (n = h.exec(e)) != null; ) {
320
- if (i = n[1] || n[2] || n[3] || n[4] || n[5] || n[6], !i) continue;
321
- if (l = [...i].length, n[3] || n[4]) {
326
+ emStrong(n, e, r = "") {
327
+ let s = this.rules.inline.emStrongLDelim.exec(n);
328
+ if (!(!s || !s[1] && !s[2] && !s[3] && !s[4] || s[4] && r.match(this.rules.other.unicodeAlphaNumeric)) && (!(s[1] || s[3]) || !r || this.rules.inline.punctuation.exec(r))) {
329
+ let t = [...s[0]].length - 1, i, l, c = t, a = 0, h = s[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
330
+ for (h.lastIndex = 0, e = e.slice(-1 * n.length + t); (s = h.exec(e)) != null; ) {
331
+ if (i = s[1] || s[2] || s[3] || s[4] || s[5] || s[6], !i) continue;
332
+ if (l = [...i].length, s[3] || s[4]) {
322
333
  c += l;
323
334
  continue;
324
- } else if ((n[5] || n[6]) && t % 3 && !((t + l) % 3)) {
335
+ } else if ((s[5] || s[6]) && t % 3 && !((t + l) % 3)) {
325
336
  a += l;
326
337
  continue;
327
338
  }
328
339
  if (c -= l, c > 0) continue;
329
340
  l = Math.min(l, l + c + a);
330
- let o = [...n[0]][0].length, p = s.slice(0, t + n.index + o + l);
341
+ let o = [...s[0]][0].length, p = n.slice(0, t + s.index + o + l);
331
342
  if (Math.min(t, l) % 2) {
332
343
  let f = p.slice(1, -1);
333
344
  return { type: "em", raw: p, text: f, tokens: this.lexer.inlineTokens(f) };
@@ -337,81 +348,94 @@ ${o}` : o;
337
348
  }
338
349
  }
339
350
  }
340
- codespan(s) {
341
- let e = this.rules.inline.code.exec(s);
351
+ codespan(n) {
352
+ let e = this.rules.inline.code.exec(n);
342
353
  if (e) {
343
- 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);
344
- return n && t && (r = r.substring(1, r.length - 1)), { type: "codespan", raw: e[0], text: r };
354
+ let r = e[2].replace(this.rules.other.newLineCharGlobal, " "), s = this.rules.other.nonSpaceChar.test(r), t = this.rules.other.startingSpaceChar.test(r) && this.rules.other.endingSpaceChar.test(r);
355
+ return s && t && (r = r.substring(1, r.length - 1)), { type: "codespan", raw: e[0], text: r };
345
356
  }
346
357
  }
347
- br(s) {
348
- let e = this.rules.inline.br.exec(s);
358
+ br(n) {
359
+ let e = this.rules.inline.br.exec(n);
349
360
  if (e) return { type: "br", raw: e[0] };
350
361
  }
351
- del(s) {
352
- let e = this.rules.inline.del.exec(s);
353
- if (e) return { type: "del", raw: e[0], text: e[2], tokens: this.lexer.inlineTokens(e[2]) };
362
+ del(n, e, r = "") {
363
+ let s = this.rules.inline.delLDelim.exec(n);
364
+ if (s && (!s[1] || !r || this.rules.inline.punctuation.exec(r))) {
365
+ let t = [...s[0]].length - 1, i, l, c = t, a = this.rules.inline.delRDelim;
366
+ for (a.lastIndex = 0, e = e.slice(-1 * n.length + t); (s = a.exec(e)) != null; ) {
367
+ if (i = s[1] || s[2] || s[3] || s[4] || s[5] || s[6], !i || (l = [...i].length, l !== t)) continue;
368
+ if (s[3] || s[4]) {
369
+ c += l;
370
+ continue;
371
+ }
372
+ if (c -= l, c > 0) continue;
373
+ l = Math.min(l, l + c);
374
+ let h = [...s[0]][0].length, o = n.slice(0, t + s.index + h + l), p = o.slice(t, -t);
375
+ return { type: "del", raw: o, text: p, tokens: this.lexer.inlineTokens(p) };
376
+ }
377
+ }
354
378
  }
355
- autolink(s) {
356
- let e = this.rules.inline.autolink.exec(s);
379
+ autolink(n) {
380
+ let e = this.rules.inline.autolink.exec(n);
357
381
  if (e) {
358
- let r, n;
359
- 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 }] };
382
+ let r, s;
383
+ return e[2] === "@" ? (r = e[1], s = "mailto:" + r) : (r = e[1], s = r), { type: "link", raw: e[0], text: r, href: s, tokens: [{ type: "text", raw: r, text: r }] };
360
384
  }
361
385
  }
362
- url(s) {
386
+ url(n) {
363
387
  let e;
364
- if (e = this.rules.inline.url.exec(s)) {
365
- let r, n;
366
- if (e[2] === "@") r = e[0], n = "mailto:" + r;
388
+ if (e = this.rules.inline.url.exec(n)) {
389
+ let r, s;
390
+ if (e[2] === "@") r = e[0], s = "mailto:" + r;
367
391
  else {
368
392
  let t;
369
393
  do
370
394
  t = e[0], e[0] = this.rules.inline._backpedal.exec(e[0])?.[0] ?? "";
371
395
  while (t !== e[0]);
372
- r = e[0], e[1] === "www." ? n = "http://" + e[0] : n = e[0];
396
+ r = e[0], e[1] === "www." ? s = "http://" + e[0] : s = e[0];
373
397
  }
374
- return { type: "link", raw: e[0], text: r, href: n, tokens: [{ type: "text", raw: r, text: r }] };
398
+ return { type: "link", raw: e[0], text: r, href: s, tokens: [{ type: "text", raw: r, text: r }] };
375
399
  }
376
400
  }
377
- inlineText(s) {
378
- let e = this.rules.inline.text.exec(s);
401
+ inlineText(n) {
402
+ let e = this.rules.inline.text.exec(n);
379
403
  if (e) {
380
404
  let r = this.lexer.state.inRawBlock;
381
405
  return { type: "text", raw: e[0], text: e[0], escaped: r };
382
406
  }
383
407
  }
384
- }, w = class Q {
408
+ }, m = class j {
385
409
  tokens;
386
410
  options;
387
411
  state;
388
412
  inlineQueue;
389
413
  tokenizer;
390
414
  constructor(e) {
391
- this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || S, 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 };
392
- let r = { other: b, block: I.normal, inline: _.normal };
393
- this.options.pedantic ? (r.block = I.pedantic, r.inline = _.pedantic) : this.options.gfm && (r.block = I.gfm, this.options.breaks ? r.inline = _.breaks : r.inline = _.gfm), this.tokenizer.rules = r;
415
+ this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || T, this.options.tokenizer = this.options.tokenizer || new q(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 };
416
+ let r = { other: b, block: L.normal, inline: A.normal };
417
+ this.options.pedantic ? (r.block = L.pedantic, r.inline = A.pedantic) : this.options.gfm && (r.block = L.gfm, this.options.breaks ? r.inline = A.breaks : r.inline = A.gfm), this.tokenizer.rules = r;
394
418
  }
395
419
  static get rules() {
396
- return { block: I, inline: _ };
420
+ return { block: L, inline: A };
397
421
  }
398
422
  static lex(e, r) {
399
- return new Q(r).lex(e);
423
+ return new j(r).lex(e);
400
424
  }
401
425
  static lexInline(e, r) {
402
- return new Q(r).inlineTokens(e);
426
+ return new j(r).inlineTokens(e);
403
427
  }
404
428
  lex(e) {
405
429
  e = e.replace(b.carriageReturn, `
406
430
  `), this.blockTokens(e, this.tokens);
407
431
  for (let r = 0; r < this.inlineQueue.length; r++) {
408
- let n = this.inlineQueue[r];
409
- this.inlineTokens(n.src, n.tokens);
432
+ let s = this.inlineQueue[r];
433
+ this.inlineTokens(s.src, s.tokens);
410
434
  }
411
435
  return this.inlineQueue = [], this.tokens;
412
436
  }
413
- blockTokens(e, r = [], n = !1) {
414
- for (this.options.pedantic && (e = e.replace(b.tabCharGlobal, " ").replace(b.spaceLine, "")); e; ) {
437
+ blockTokens(e, r = [], s = !1) {
438
+ for (this.tokenizer.lexer = this, this.options.pedantic && (e = e.replace(b.tabCharGlobal, " ").replace(b.spaceLine, "")); e; ) {
415
439
  let t;
416
440
  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;
417
441
  if (t = this.tokenizer.space(e)) {
@@ -480,10 +504,10 @@ ${o}` : o;
480
504
  }
481
505
  if (this.state.top && (t = this.tokenizer.paragraph(i))) {
482
506
  let l = r.at(-1);
483
- n && l?.type === "paragraph" ? (l.raw += (l.raw.endsWith(`
507
+ s && l?.type === "paragraph" ? (l.raw += (l.raw.endsWith(`
484
508
  `) ? "" : `
485
509
  `) + t.raw, l.text += `
486
- ` + 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);
510
+ ` + t.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = l.text) : r.push(t), s = i.length !== e.length, e = e.substring(t.raw.length);
487
511
  continue;
488
512
  }
489
513
  if (t = this.tokenizer.text(e)) {
@@ -509,15 +533,16 @@ ${o}` : o;
509
533
  return this.inlineQueue.push({ src: e, tokens: r }), r;
510
534
  }
511
535
  inlineTokens(e, r = []) {
512
- let n = e, t = null;
536
+ this.tokenizer.lexer = this;
537
+ let s = e, t = null;
513
538
  if (this.tokens.links) {
514
539
  let a = Object.keys(this.tokens.links);
515
- 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));
540
+ if (a.length > 0) for (; (t = this.tokenizer.rules.inline.reflinkSearch.exec(s)) != null; ) a.includes(t[0].slice(t[0].lastIndexOf("[") + 1, -1)) && (s = s.slice(0, t.index) + "[" + "a".repeat(t[0].length - 2) + "]" + s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
516
541
  }
517
- for (; (t = this.tokenizer.rules.inline.anyPunctuation.exec(n)) != null; ) n = n.slice(0, t.index) + "++" + n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
542
+ for (; (t = this.tokenizer.rules.inline.anyPunctuation.exec(s)) != null; ) s = s.slice(0, t.index) + "++" + s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
518
543
  let i;
519
- 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);
520
- n = this.options.hooks?.emStrongMask?.call({ lexer: this }, n) ?? n;
544
+ for (; (t = this.tokenizer.rules.inline.blockSkip.exec(s)) != null; ) i = t[2] ? t[2].length : 0, s = s.slice(0, t.index + i) + "[" + "a".repeat(t[0].length - i - 2) + "]" + s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
545
+ s = this.options.hooks?.emStrongMask?.call({ lexer: this }, s) ?? s;
521
546
  let l = !1, c = "";
522
547
  for (; e; ) {
523
548
  l || (c = ""), l = !1;
@@ -541,7 +566,7 @@ ${o}` : o;
541
566
  a.type === "text" && o?.type === "text" ? (o.raw += a.raw, o.text += a.text) : r.push(a);
542
567
  continue;
543
568
  }
544
- if (a = this.tokenizer.emStrong(e, n, c)) {
569
+ if (a = this.tokenizer.emStrong(e, s, c)) {
545
570
  e = e.substring(a.raw.length), r.push(a);
546
571
  continue;
547
572
  }
@@ -553,7 +578,7 @@ ${o}` : o;
553
578
  e = e.substring(a.raw.length), r.push(a);
554
579
  continue;
555
580
  }
556
- if (a = this.tokenizer.del(e)) {
581
+ if (a = this.tokenizer.del(e, s, c)) {
557
582
  e = e.substring(a.raw.length), r.push(a);
558
583
  continue;
559
584
  }
@@ -588,171 +613,172 @@ ${o}` : o;
588
613
  }
589
614
  return r;
590
615
  }
591
- }, q = class {
616
+ }, D = class {
592
617
  options;
593
618
  parser;
594
- constructor(s) {
595
- this.options = s || S;
619
+ constructor(n) {
620
+ this.options = n || T;
596
621
  }
597
- space(s) {
622
+ space(n) {
598
623
  return "";
599
624
  }
600
- code({ text: s, lang: e, escaped: r }) {
601
- let n = (e || "").match(b.notSpaceStart)?.[0], t = s.replace(b.endingNewline, "") + `
625
+ code({ text: n, lang: e, escaped: r }) {
626
+ let s = (e || "").match(b.notSpaceStart)?.[0], t = n.replace(b.endingNewline, "") + `
602
627
  `;
603
- return n ? '<pre><code class="language-' + R(n) + '">' + (r ? t : R(t, !0)) + `</code></pre>
604
- ` : "<pre><code>" + (r ? t : R(t, !0)) + `</code></pre>
628
+ return s ? '<pre><code class="language-' + y(s) + '">' + (r ? t : y(t, !0)) + `</code></pre>
629
+ ` : "<pre><code>" + (r ? t : y(t, !0)) + `</code></pre>
605
630
  `;
606
631
  }
607
- blockquote({ tokens: s }) {
632
+ blockquote({ tokens: n }) {
608
633
  return `<blockquote>
609
- ${this.parser.parse(s)}</blockquote>
634
+ ${this.parser.parse(n)}</blockquote>
610
635
  `;
611
636
  }
612
- html({ text: s }) {
613
- return s;
637
+ html({ text: n }) {
638
+ return n;
614
639
  }
615
- def(s) {
640
+ def(n) {
616
641
  return "";
617
642
  }
618
- heading({ tokens: s, depth: e }) {
619
- return `<h${e}>${this.parser.parseInline(s)}</h${e}>
643
+ heading({ tokens: n, depth: e }) {
644
+ return `<h${e}>${this.parser.parseInline(n)}</h${e}>
620
645
  `;
621
646
  }
622
- hr(s) {
647
+ hr(n) {
623
648
  return `<hr>
624
649
  `;
625
650
  }
626
- list(s) {
627
- let e = s.ordered, r = s.start, n = "";
628
- for (let l = 0; l < s.items.length; l++) {
629
- let c = s.items[l];
630
- n += this.listitem(c);
651
+ list(n) {
652
+ let e = n.ordered, r = n.start, s = "";
653
+ for (let l = 0; l < n.items.length; l++) {
654
+ let c = n.items[l];
655
+ s += this.listitem(c);
631
656
  }
632
657
  let t = e ? "ol" : "ul", i = e && r !== 1 ? ' start="' + r + '"' : "";
633
658
  return "<" + t + i + `>
634
- ` + n + "</" + t + `>
659
+ ` + s + "</" + t + `>
635
660
  `;
636
661
  }
637
- listitem(s) {
638
- return `<li>${this.parser.parse(s.tokens)}</li>
662
+ listitem(n) {
663
+ return `<li>${this.parser.parse(n.tokens)}</li>
639
664
  `;
640
665
  }
641
- checkbox({ checked: s }) {
642
- return "<input " + (s ? 'checked="" ' : "") + 'disabled="" type="checkbox"> ';
666
+ checkbox({ checked: n }) {
667
+ return "<input " + (n ? 'checked="" ' : "") + 'disabled="" type="checkbox"> ';
643
668
  }
644
- paragraph({ tokens: s }) {
645
- return `<p>${this.parser.parseInline(s)}</p>
669
+ paragraph({ tokens: n }) {
670
+ return `<p>${this.parser.parseInline(n)}</p>
646
671
  `;
647
672
  }
648
- table(s) {
673
+ table(n) {
649
674
  let e = "", r = "";
650
- for (let t = 0; t < s.header.length; t++) r += this.tablecell(s.header[t]);
675
+ for (let t = 0; t < n.header.length; t++) r += this.tablecell(n.header[t]);
651
676
  e += this.tablerow({ text: r });
652
- let n = "";
653
- for (let t = 0; t < s.rows.length; t++) {
654
- let i = s.rows[t];
677
+ let s = "";
678
+ for (let t = 0; t < n.rows.length; t++) {
679
+ let i = n.rows[t];
655
680
  r = "";
656
681
  for (let l = 0; l < i.length; l++) r += this.tablecell(i[l]);
657
- n += this.tablerow({ text: r });
682
+ s += this.tablerow({ text: r });
658
683
  }
659
- return n && (n = `<tbody>${n}</tbody>`), `<table>
684
+ return s && (s = `<tbody>${s}</tbody>`), `<table>
660
685
  <thead>
661
686
  ` + e + `</thead>
662
- ` + n + `</table>
687
+ ` + s + `</table>
663
688
  `;
664
689
  }
665
- tablerow({ text: s }) {
690
+ tablerow({ text: n }) {
666
691
  return `<tr>
667
- ${s}</tr>
692
+ ${n}</tr>
668
693
  `;
669
694
  }
670
- tablecell(s) {
671
- let e = this.parser.parseInline(s.tokens), r = s.header ? "th" : "td";
672
- return (s.align ? `<${r} align="${s.align}">` : `<${r}>`) + e + `</${r}>
695
+ tablecell(n) {
696
+ let e = this.parser.parseInline(n.tokens), r = n.header ? "th" : "td";
697
+ return (n.align ? `<${r} align="${n.align}">` : `<${r}>`) + e + `</${r}>
673
698
  `;
674
699
  }
675
- strong({ tokens: s }) {
676
- return `<strong>${this.parser.parseInline(s)}</strong>`;
700
+ strong({ tokens: n }) {
701
+ return `<strong>${this.parser.parseInline(n)}</strong>`;
677
702
  }
678
- em({ tokens: s }) {
679
- return `<em>${this.parser.parseInline(s)}</em>`;
703
+ em({ tokens: n }) {
704
+ return `<em>${this.parser.parseInline(n)}</em>`;
680
705
  }
681
- codespan({ text: s }) {
682
- return `<code>${R(s, !0)}</code>`;
706
+ codespan({ text: n }) {
707
+ return `<code>${y(n, !0)}</code>`;
683
708
  }
684
- br(s) {
709
+ br(n) {
685
710
  return "<br>";
686
711
  }
687
- del({ tokens: s }) {
688
- return `<del>${this.parser.parseInline(s)}</del>`;
712
+ del({ tokens: n }) {
713
+ return `<del>${this.parser.parseInline(n)}</del>`;
689
714
  }
690
- link({ href: s, title: e, tokens: r }) {
691
- let n = this.parser.parseInline(r), t = ie(s);
692
- if (t === null) return n;
693
- s = t;
694
- let i = '<a href="' + s + '"';
695
- return e && (i += ' title="' + R(e) + '"'), i += ">" + n + "</a>", i;
715
+ link({ href: n, title: e, tokens: r }) {
716
+ let s = this.parser.parseInline(r), t = ae(n);
717
+ if (t === null) return s;
718
+ n = t;
719
+ let i = '<a href="' + n + '"';
720
+ return e && (i += ' title="' + y(e) + '"'), i += ">" + s + "</a>", i;
696
721
  }
697
- image({ href: s, title: e, text: r, tokens: n }) {
698
- n && (r = this.parser.parseInline(n, this.parser.textRenderer));
699
- let t = ie(s);
700
- if (t === null) return R(r);
701
- s = t;
702
- let i = `<img src="${s}" alt="${r}"`;
703
- return e && (i += ` title="${R(e)}"`), i += ">", i;
722
+ image({ href: n, title: e, text: r, tokens: s }) {
723
+ s && (r = this.parser.parseInline(s, this.parser.textRenderer));
724
+ let t = ae(n);
725
+ if (t === null) return y(r);
726
+ n = t;
727
+ let i = `<img src="${n}" alt="${y(r)}"`;
728
+ return e && (i += ` title="${y(e)}"`), i += ">", i;
704
729
  }
705
- text(s) {
706
- return "tokens" in s && s.tokens ? this.parser.parseInline(s.tokens) : "escaped" in s && s.escaped ? s.text : R(s.text);
730
+ text(n) {
731
+ return "tokens" in n && n.tokens ? this.parser.parseInline(n.tokens) : "escaped" in n && n.escaped ? n.text : y(n.text);
707
732
  }
708
733
  }, K = class {
709
- strong({ text: s }) {
710
- return s;
734
+ strong({ text: n }) {
735
+ return n;
711
736
  }
712
- em({ text: s }) {
713
- return s;
737
+ em({ text: n }) {
738
+ return n;
714
739
  }
715
- codespan({ text: s }) {
716
- return s;
740
+ codespan({ text: n }) {
741
+ return n;
717
742
  }
718
- del({ text: s }) {
719
- return s;
743
+ del({ text: n }) {
744
+ return n;
720
745
  }
721
- html({ text: s }) {
722
- return s;
746
+ html({ text: n }) {
747
+ return n;
723
748
  }
724
- text({ text: s }) {
725
- return s;
749
+ text({ text: n }) {
750
+ return n;
726
751
  }
727
- link({ text: s }) {
728
- return "" + s;
752
+ link({ text: n }) {
753
+ return "" + n;
729
754
  }
730
- image({ text: s }) {
731
- return "" + s;
755
+ image({ text: n }) {
756
+ return "" + n;
732
757
  }
733
758
  br() {
734
759
  return "";
735
760
  }
736
- checkbox({ raw: s }) {
737
- return s;
761
+ checkbox({ raw: n }) {
762
+ return n;
738
763
  }
739
- }, y = class j {
764
+ }, w = class H {
740
765
  options;
741
766
  renderer;
742
767
  textRenderer;
743
768
  constructor(e) {
744
- this.options = e || S, this.options.renderer = this.options.renderer || new q(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new K();
769
+ this.options = e || T, this.options.renderer = this.options.renderer || new D(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new K();
745
770
  }
746
771
  static parse(e, r) {
747
- return new j(r).parse(e);
772
+ return new H(r).parse(e);
748
773
  }
749
774
  static parseInline(e, r) {
750
- return new j(r).parseInline(e);
775
+ return new H(r).parseInline(e);
751
776
  }
752
777
  parse(e) {
778
+ this.renderer.parser = this;
753
779
  let r = "";
754
- for (let n = 0; n < e.length; n++) {
755
- let t = e[n];
780
+ for (let s = 0; s < e.length; s++) {
781
+ let t = e[s];
756
782
  if (this.options.extensions?.renderers?.[t.type]) {
757
783
  let l = t, c = this.options.extensions.renderers[l.type].call({ parser: this }, l);
758
784
  if (c !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "def", "paragraph", "text"].includes(l.type)) {
@@ -820,60 +846,61 @@ ${s}</tr>
820
846
  return r;
821
847
  }
822
848
  parseInline(e, r = this.renderer) {
823
- let n = "";
849
+ this.renderer.parser = this;
850
+ let s = "";
824
851
  for (let t = 0; t < e.length; t++) {
825
852
  let i = e[t];
826
853
  if (this.options.extensions?.renderers?.[i.type]) {
827
854
  let c = this.options.extensions.renderers[i.type].call({ parser: this }, i);
828
855
  if (c !== !1 || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(i.type)) {
829
- n += c || "";
856
+ s += c || "";
830
857
  continue;
831
858
  }
832
859
  }
833
860
  let l = i;
834
861
  switch (l.type) {
835
862
  case "escape": {
836
- n += r.text(l);
863
+ s += r.text(l);
837
864
  break;
838
865
  }
839
866
  case "html": {
840
- n += r.html(l);
867
+ s += r.html(l);
841
868
  break;
842
869
  }
843
870
  case "link": {
844
- n += r.link(l);
871
+ s += r.link(l);
845
872
  break;
846
873
  }
847
874
  case "image": {
848
- n += r.image(l);
875
+ s += r.image(l);
849
876
  break;
850
877
  }
851
878
  case "checkbox": {
852
- n += r.checkbox(l);
879
+ s += r.checkbox(l);
853
880
  break;
854
881
  }
855
882
  case "strong": {
856
- n += r.strong(l);
883
+ s += r.strong(l);
857
884
  break;
858
885
  }
859
886
  case "em": {
860
- n += r.em(l);
887
+ s += r.em(l);
861
888
  break;
862
889
  }
863
890
  case "codespan": {
864
- n += r.codespan(l);
891
+ s += r.codespan(l);
865
892
  break;
866
893
  }
867
894
  case "br": {
868
- n += r.br(l);
895
+ s += r.br(l);
869
896
  break;
870
897
  }
871
898
  case "del": {
872
- n += r.del(l);
899
+ s += r.del(l);
873
900
  break;
874
901
  }
875
902
  case "text": {
876
- n += r.text(l);
903
+ s += r.text(l);
877
904
  break;
878
905
  }
879
906
  default: {
@@ -883,64 +910,64 @@ ${s}</tr>
883
910
  }
884
911
  }
885
912
  }
886
- return n;
913
+ return s;
887
914
  }
888
- }, A = class {
915
+ }, P = class {
889
916
  options;
890
917
  block;
891
- constructor(s) {
892
- this.options = s || S;
918
+ constructor(n) {
919
+ this.options = n || T;
893
920
  }
894
921
  static passThroughHooks = /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"]);
895
922
  static passThroughHooksRespectAsync = /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"]);
896
- preprocess(s) {
897
- return s;
923
+ preprocess(n) {
924
+ return n;
898
925
  }
899
- postprocess(s) {
900
- return s;
926
+ postprocess(n) {
927
+ return n;
901
928
  }
902
- processAllTokens(s) {
903
- return s;
929
+ processAllTokens(n) {
930
+ return n;
904
931
  }
905
- emStrongMask(s) {
906
- return s;
932
+ emStrongMask(n) {
933
+ return n;
907
934
  }
908
935
  provideLexer() {
909
- return this.block ? w.lex : w.lexInline;
936
+ return this.block ? m.lex : m.lexInline;
910
937
  }
911
938
  provideParser() {
912
- return this.block ? y.parse : y.parseInline;
939
+ return this.block ? w.parse : w.parseInline;
913
940
  }
914
- }, gt = class {
915
- defaults = H();
941
+ }, mt = class {
942
+ defaults = G();
916
943
  options = this.setOptions;
917
944
  parse = this.parseMarkdown(!0);
918
945
  parseInline = this.parseMarkdown(!1);
919
- Parser = y;
920
- Renderer = q;
946
+ Parser = w;
947
+ Renderer = D;
921
948
  TextRenderer = K;
922
- Lexer = w;
923
- Tokenizer = B;
924
- Hooks = A;
925
- constructor(...s) {
926
- this.use(...s);
949
+ Lexer = m;
950
+ Tokenizer = q;
951
+ Hooks = P;
952
+ constructor(...n) {
953
+ this.use(...n);
927
954
  }
928
- walkTokens(s, e) {
955
+ walkTokens(n, e) {
929
956
  let r = [];
930
- for (let n of s) switch (r = r.concat(e.call(this, n)), n.type) {
957
+ for (let s of n) switch (r = r.concat(e.call(this, s)), s.type) {
931
958
  case "table": {
932
- let t = n;
959
+ let t = s;
933
960
  for (let i of t.header) r = r.concat(this.walkTokens(i.tokens, e));
934
961
  for (let i of t.rows) for (let l of i) r = r.concat(this.walkTokens(l.tokens, e));
935
962
  break;
936
963
  }
937
964
  case "list": {
938
- let t = n;
965
+ let t = s;
939
966
  r = r.concat(this.walkTokens(t.items, e));
940
967
  break;
941
968
  }
942
969
  default: {
943
- let t = n;
970
+ let t = s;
944
971
  this.defaults.extensions?.childTokens?.[t.type] ? this.defaults.extensions.childTokens[t.type].forEach((i) => {
945
972
  let l = t[i].flat(1 / 0);
946
973
  r = r.concat(this.walkTokens(l, e));
@@ -949,11 +976,11 @@ ${s}</tr>
949
976
  }
950
977
  return r;
951
978
  }
952
- use(...s) {
979
+ use(...n) {
953
980
  let e = this.defaults.extensions || { renderers: {}, childTokens: {} };
954
- return s.forEach((r) => {
955
- let n = { ...r };
956
- if (n.async = this.defaults.async || n.async || !1, r.extensions && (r.extensions.forEach((t) => {
981
+ return n.forEach((r) => {
982
+ let s = { ...r };
983
+ if (s.async = this.defaults.async || s.async || !1, r.extensions && (r.extensions.forEach((t) => {
957
984
  if (!t.name) throw new Error("extension name required");
958
985
  if ("renderer" in t) {
959
986
  let i = e.renderers[t.name];
@@ -968,8 +995,8 @@ ${s}</tr>
968
995
  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]));
969
996
  }
970
997
  "childTokens" in t && t.childTokens && (e.childTokens[t.name] = t.childTokens);
971
- }), n.extensions = e), r.renderer) {
972
- let t = this.defaults.renderer || new q(this.defaults);
998
+ }), s.extensions = e), r.renderer) {
999
+ let t = this.defaults.renderer || new D(this.defaults);
973
1000
  for (let i in r.renderer) {
974
1001
  if (!(i in t)) throw new Error(`renderer '${i}' does not exist`);
975
1002
  if (["options", "parser"].includes(i)) continue;
@@ -979,10 +1006,10 @@ ${s}</tr>
979
1006
  return o === !1 && (o = a.apply(t, h)), o || "";
980
1007
  };
981
1008
  }
982
- n.renderer = t;
1009
+ s.renderer = t;
983
1010
  }
984
1011
  if (r.tokenizer) {
985
- let t = this.defaults.tokenizer || new B(this.defaults);
1012
+ let t = this.defaults.tokenizer || new q(this.defaults);
986
1013
  for (let i in r.tokenizer) {
987
1014
  if (!(i in t)) throw new Error(`tokenizer '${i}' does not exist`);
988
1015
  if (["options", "rules", "lexer"].includes(i)) continue;
@@ -992,16 +1019,16 @@ ${s}</tr>
992
1019
  return o === !1 && (o = a.apply(t, h)), o;
993
1020
  };
994
1021
  }
995
- n.tokenizer = t;
1022
+ s.tokenizer = t;
996
1023
  }
997
1024
  if (r.hooks) {
998
- let t = this.defaults.hooks || new A();
1025
+ let t = this.defaults.hooks || new P();
999
1026
  for (let i in r.hooks) {
1000
1027
  if (!(i in t)) throw new Error(`hook '${i}' does not exist`);
1001
1028
  if (["options", "block"].includes(i)) continue;
1002
1029
  let l = i, c = r.hooks[l], a = t[l];
1003
- A.passThroughHooks.has(i) ? t[l] = (h) => {
1004
- if (this.defaults.async && A.passThroughHooksRespectAsync.has(i)) return (async () => {
1030
+ P.passThroughHooks.has(i) ? t[l] = (h) => {
1031
+ if (this.defaults.async && P.passThroughHooksRespectAsync.has(i)) return (async () => {
1005
1032
  let p = await c.call(t, h);
1006
1033
  return a.call(t, p);
1007
1034
  })();
@@ -1016,108 +1043,108 @@ ${s}</tr>
1016
1043
  return o === !1 && (o = a.apply(t, h)), o;
1017
1044
  };
1018
1045
  }
1019
- n.hooks = t;
1046
+ s.hooks = t;
1020
1047
  }
1021
1048
  if (r.walkTokens) {
1022
1049
  let t = this.defaults.walkTokens, i = r.walkTokens;
1023
- n.walkTokens = function(l) {
1050
+ s.walkTokens = function(l) {
1024
1051
  let c = [];
1025
1052
  return c.push(i.call(this, l)), t && (c = c.concat(t.call(this, l))), c;
1026
1053
  };
1027
1054
  }
1028
- this.defaults = { ...this.defaults, ...n };
1055
+ this.defaults = { ...this.defaults, ...s };
1029
1056
  }), this;
1030
1057
  }
1031
- setOptions(s) {
1032
- return this.defaults = { ...this.defaults, ...s }, this;
1058
+ setOptions(n) {
1059
+ return this.defaults = { ...this.defaults, ...n }, this;
1033
1060
  }
1034
- lexer(s, e) {
1035
- return w.lex(s, e ?? this.defaults);
1061
+ lexer(n, e) {
1062
+ return m.lex(n, e ?? this.defaults);
1036
1063
  }
1037
- parser(s, e) {
1038
- return y.parse(s, e ?? this.defaults);
1064
+ parser(n, e) {
1065
+ return w.parse(n, e ?? this.defaults);
1039
1066
  }
1040
- parseMarkdown(s) {
1067
+ parseMarkdown(n) {
1041
1068
  return (e, r) => {
1042
- let n = { ...r }, t = { ...this.defaults, ...n }, i = this.onError(!!t.silent, !!t.async);
1043
- 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."));
1069
+ let s = { ...r }, t = { ...this.defaults, ...s }, i = this.onError(!!t.silent, !!t.async);
1070
+ if (this.defaults.async === !0 && s.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."));
1044
1071
  if (typeof e > "u" || e === null) return i(new Error("marked(): input parameter is undefined or null"));
1045
1072
  if (typeof e != "string") return i(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(e) + ", string expected"));
1046
- if (t.hooks && (t.hooks.options = t, t.hooks.block = s), t.async) return (async () => {
1047
- 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;
1073
+ if (t.hooks && (t.hooks.options = t, t.hooks.block = n), t.async) return (async () => {
1074
+ let l = t.hooks ? await t.hooks.preprocess(e) : e, c = await (t.hooks ? await t.hooks.provideLexer() : n ? m.lex : m.lexInline)(l, t), a = t.hooks ? await t.hooks.processAllTokens(c) : c;
1048
1075
  t.walkTokens && await Promise.all(this.walkTokens(a, t.walkTokens));
1049
- let h = await (t.hooks ? await t.hooks.provideParser() : s ? y.parse : y.parseInline)(a, t);
1076
+ let h = await (t.hooks ? await t.hooks.provideParser() : n ? w.parse : w.parseInline)(a, t);
1050
1077
  return t.hooks ? await t.hooks.postprocess(h) : h;
1051
1078
  })().catch(i);
1052
1079
  try {
1053
1080
  t.hooks && (e = t.hooks.preprocess(e));
1054
- let l = (t.hooks ? t.hooks.provideLexer() : s ? w.lex : w.lexInline)(e, t);
1081
+ let l = (t.hooks ? t.hooks.provideLexer() : n ? m.lex : m.lexInline)(e, t);
1055
1082
  t.hooks && (l = t.hooks.processAllTokens(l)), t.walkTokens && this.walkTokens(l, t.walkTokens);
1056
- let c = (t.hooks ? t.hooks.provideParser() : s ? y.parse : y.parseInline)(l, t);
1083
+ let c = (t.hooks ? t.hooks.provideParser() : n ? w.parse : w.parseInline)(l, t);
1057
1084
  return t.hooks && (c = t.hooks.postprocess(c)), c;
1058
1085
  } catch (l) {
1059
1086
  return i(l);
1060
1087
  }
1061
1088
  };
1062
1089
  }
1063
- onError(s, e) {
1090
+ onError(n, e) {
1064
1091
  return (r) => {
1065
1092
  if (r.message += `
1066
- Please report this to https://github.com/markedjs/marked.`, s) {
1067
- let n = "<p>An error occurred:</p><pre>" + R(r.message + "", !0) + "</pre>";
1068
- return e ? Promise.resolve(n) : n;
1093
+ Please report this to https://github.com/markedjs/marked.`, n) {
1094
+ let s = "<p>An error occurred:</p><pre>" + y(r.message + "", !0) + "</pre>";
1095
+ return e ? Promise.resolve(s) : s;
1069
1096
  }
1070
1097
  if (e) return Promise.reject(r);
1071
1098
  throw r;
1072
1099
  };
1073
1100
  }
1074
- }, $ = new gt();
1075
- function g(s, e) {
1076
- return $.parse(s, e);
1101
+ }, S = new mt();
1102
+ function g(n, e) {
1103
+ return S.parse(n, e);
1077
1104
  }
1078
- g.options = g.setOptions = function(s) {
1079
- return $.setOptions(s), g.defaults = $.defaults, ue(g.defaults), g;
1105
+ g.options = g.setOptions = function(n) {
1106
+ return S.setOptions(n), g.defaults = S.defaults, de(g.defaults), g;
1080
1107
  };
1081
- g.getDefaults = H;
1082
- g.defaults = S;
1083
- g.use = function(...s) {
1084
- return $.use(...s), g.defaults = $.defaults, ue(g.defaults), g;
1108
+ g.getDefaults = G;
1109
+ g.defaults = T;
1110
+ g.use = function(...n) {
1111
+ return S.use(...n), g.defaults = S.defaults, de(g.defaults), g;
1085
1112
  };
1086
- g.walkTokens = function(s, e) {
1087
- return $.walkTokens(s, e);
1113
+ g.walkTokens = function(n, e) {
1114
+ return S.walkTokens(n, e);
1088
1115
  };
1089
- g.parseInline = $.parseInline;
1090
- g.Parser = y;
1091
- g.parser = y.parse;
1092
- g.Renderer = q;
1116
+ g.parseInline = S.parseInline;
1117
+ g.Parser = w;
1118
+ g.parser = w.parse;
1119
+ g.Renderer = D;
1093
1120
  g.TextRenderer = K;
1094
- g.Lexer = w;
1095
- g.lexer = w.lex;
1096
- g.Tokenizer = B;
1097
- g.Hooks = A;
1121
+ g.Lexer = m;
1122
+ g.lexer = m.lex;
1123
+ g.Tokenizer = q;
1124
+ g.Hooks = P;
1098
1125
  g.parse = g;
1099
1126
  g.options;
1100
1127
  g.setOptions;
1101
1128
  g.use;
1102
1129
  g.walkTokens;
1103
1130
  g.parseInline;
1104
- y.parse;
1105
- w.lex;
1106
- const kt = { class: "markdown-container" }, ft = {
1131
+ w.parse;
1132
+ m.lex;
1133
+ const wt = { class: "markdown-container" }, yt = {
1107
1134
  key: 0,
1108
1135
  class: "min-h-full p-8 flex items-center justify-center"
1109
- }, xt = { class: "markdown-content-wrapper" }, bt = { class: "p-4" }, mt = { class: "header-row" }, wt = { class: "document-title" }, yt = ["innerHTML"], Rt = { class: "markdown-source" }, $t = ["disabled"], St = /* @__PURE__ */ he({
1136
+ }, Rt = { class: "markdown-content-wrapper" }, $t = { class: "p-4" }, St = { class: "header-row" }, Tt = { class: "document-title" }, _t = ["innerHTML"], zt = { class: "markdown-source" }, At = ["disabled"], vt = /* @__PURE__ */ pe({
1110
1137
  __name: "View",
1111
1138
  props: {
1112
1139
  selectedResult: {}
1113
1140
  },
1114
1141
  emits: ["updateResult"],
1115
- setup(s, { emit: e }) {
1116
- const r = s, n = e, t = _e(r.selectedResult.data?.markdown || ""), i = O(() => t.value !== r.selectedResult.data?.markdown), l = O(() => r.selectedResult.data?.markdown ? g(r.selectedResult.data.markdown) : (console.error("No markdown data in result:", r.selectedResult), ""));
1117
- re(
1142
+ setup(n, { emit: e }) {
1143
+ const r = n, s = e, t = ze(r.selectedResult.data?.markdown || ""), i = N(() => t.value !== r.selectedResult.data?.markdown), l = N(() => r.selectedResult.data?.markdown ? g(r.selectedResult.data.markdown) : (console.error("No markdown data in result:", r.selectedResult), ""));
1144
+ ne(
1118
1145
  () => r.selectedResult?.viewState?.scrollToAnchor,
1119
1146
  (h) => {
1120
- h && ze(() => {
1147
+ h && Ae(() => {
1121
1148
  const o = document.getElementById(h);
1122
1149
  o ? o.scrollIntoView({ behavior: "smooth", block: "start" }) : console.warn(`Anchor element with id "${h}" not found`);
1123
1150
  });
@@ -1142,82 +1169,82 @@ const kt = { class: "markdown-container" }, ft = {
1142
1169
  pdfPath: void 0
1143
1170
  }
1144
1171
  };
1145
- n("updateResult", h);
1172
+ s("updateResult", h);
1146
1173
  }
1147
- return re(
1174
+ return ne(
1148
1175
  () => r.selectedResult.data?.markdown,
1149
1176
  (h) => {
1150
1177
  t.value = h || "";
1151
1178
  }
1152
- ), (h, o) => (L(), C("div", kt, [
1153
- s.selectedResult.data?.markdown ? (L(), C(Ae, { key: 1 }, [
1154
- x("div", xt, [
1155
- x("div", bt, [
1156
- x("div", mt, [
1157
- x("h1", wt, pe(s.selectedResult.title || "Document"), 1),
1179
+ ), (h, o) => (C(), E("div", wt, [
1180
+ n.selectedResult.data?.markdown ? (C(), E(ve, { key: 1 }, [
1181
+ x("div", Rt, [
1182
+ x("div", $t, [
1183
+ x("div", St, [
1184
+ x("h1", Tt, ue(n.selectedResult.title || "Document"), 1),
1158
1185
  x("div", { class: "button-group" }, [
1159
1186
  x("button", {
1160
1187
  onClick: c,
1161
1188
  class: "download-btn download-btn-green"
1162
1189
  }, [...o[2] || (o[2] = [
1163
1190
  x("span", { class: "material-icons" }, "download", -1),
1164
- ve(" MD ", -1)
1191
+ Pe(" MD ", -1)
1165
1192
  ])])
1166
1193
  ])
1167
1194
  ]),
1168
1195
  x("div", {
1169
1196
  class: "markdown-content prose prose-slate max-w-none",
1170
1197
  innerHTML: l.value
1171
- }, null, 8, yt)
1198
+ }, null, 8, _t)
1172
1199
  ])
1173
1200
  ]),
1174
- x("details", Rt, [
1201
+ x("details", zt, [
1175
1202
  o[3] || (o[3] = x("summary", null, "Edit Markdown Source", -1)),
1176
- Pe(x("textarea", {
1203
+ Ie(x("textarea", {
1177
1204
  "onUpdate:modelValue": o[0] || (o[0] = (p) => t.value = p),
1178
1205
  class: "markdown-editor",
1179
1206
  spellcheck: "false"
1180
1207
  }, null, 512), [
1181
- [Ie, t.value]
1208
+ [Le, t.value]
1182
1209
  ]),
1183
1210
  x("button", {
1184
1211
  onClick: a,
1185
1212
  class: "apply-btn",
1186
1213
  disabled: !i.value
1187
- }, " Apply Changes ", 8, $t)
1214
+ }, " Apply Changes ", 8, At)
1188
1215
  ])
1189
- ], 64)) : (L(), C("div", ft, [...o[1] || (o[1] = [
1216
+ ], 64)) : (C(), E("div", yt, [...o[1] || (o[1] = [
1190
1217
  x("div", { class: "text-gray-500" }, "No markdown content available", -1)
1191
1218
  ])]))
1192
1219
  ]));
1193
1220
  }
1194
- }), Tt = (s, e) => {
1195
- const r = s.__vccOpts || s;
1196
- for (const [n, t] of e)
1197
- r[n] = t;
1221
+ }), Pt = (n, e) => {
1222
+ const r = n.__vccOpts || n;
1223
+ for (const [s, t] of e)
1224
+ r[s] = t;
1198
1225
  return r;
1199
- }, _t = /* @__PURE__ */ Tt(St, [["__scopeId", "data-v-7bea9557"]]), zt = { class: "text-center p-4 bg-purple-100 rounded" }, At = { class: "text-sm text-gray-800 mt-1 font-medium truncate" }, vt = /* @__PURE__ */ he({
1226
+ }, It = /* @__PURE__ */ Pt(vt, [["__scopeId", "data-v-7bea9557"]]), Lt = { class: "text-center p-4 bg-purple-100 rounded" }, Ct = { class: "text-sm text-gray-800 mt-1 font-medium truncate" }, Et = /* @__PURE__ */ pe({
1200
1227
  __name: "Preview",
1201
1228
  props: {
1202
1229
  result: {}
1203
1230
  },
1204
- setup(s) {
1205
- const e = s, r = O(() => {
1231
+ setup(n) {
1232
+ const e = n, r = N(() => {
1206
1233
  if (e.result.title)
1207
1234
  return e.result.title;
1208
1235
  if (e.result.data?.markdown) {
1209
- const n = e.result.data.markdown.match(/^#\s+(.+)$/m);
1210
- if (n)
1211
- return n[1];
1236
+ const s = e.result.data.markdown.match(/^#\s+(.+)$/m);
1237
+ if (s)
1238
+ return s[1];
1212
1239
  }
1213
1240
  return "Markdown Document";
1214
1241
  });
1215
- return (n, t) => (L(), C("div", zt, [
1242
+ return (s, t) => (C(), E("div", Lt, [
1216
1243
  t[0] || (t[0] = x("div", { class: "text-purple-600 font-medium" }, "Document", -1)),
1217
- x("div", At, pe(r.value), 1)
1244
+ x("div", Ct, ue(r.value), 1)
1218
1245
  ]));
1219
1246
  }
1220
- }), ce = "presentDocument", Pt = `Use the ${ce} tool to create structured documents with text and embedded images. This tool is ideal for:
1247
+ }), he = "presentDocument", Bt = `Use the ${he} tool to create structured documents with text and embedded images. This tool is ideal for:
1221
1248
  - Guides, tutorials, and how-to content ("create a guide about...", "explain how to...")
1222
1249
  - Educational content (lessons, explanations, timelines, concept visualizations)
1223
1250
  - Reports and presentations (business reports, data analysis, infographics)
@@ -1228,24 +1255,24 @@ const kt = { class: "markdown-container" }, ft = {
1228
1255
  - Product presentations or lookbooks
1229
1256
  - Any content that combines written information with supporting visuals
1230
1257
 
1231
- 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 ${ce} to create a full guide with explanatory text and the diagram embedded, rather than just generating the diagram image alone.
1258
+ 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 ${he} to create a full guide with explanatory text and the diagram embedded, rather than just generating the diagram image alone.
1232
1259
 
1233
- Format embedded images as: ![Detailed image prompt](__too_be_replaced_image_path__)`, It = {
1234
- ...Te,
1235
- viewComponent: _t,
1236
- previewComponent: vt,
1237
- samples: Se,
1238
- systemPrompt: Pt
1239
- }, Et = { plugin: It };
1260
+ Format embedded images as: ![Detailed image prompt](__too_be_replaced_image_path__)`, qt = {
1261
+ ..._e,
1262
+ viewComponent: It,
1263
+ previewComponent: Et,
1264
+ samples: Te,
1265
+ systemPrompt: Bt
1266
+ }, Zt = { plugin: qt };
1240
1267
  export {
1241
- vt as Preview,
1242
- Pt as SYSTEM_PROMPT,
1243
- Mt as TOOL_DEFINITION,
1244
- ce as TOOL_NAME,
1245
- _t as View,
1246
- Et as default,
1247
- Dt as executeMarkdown,
1248
- It as plugin,
1249
- Te as pluginCore,
1250
- Se as samples
1268
+ Et as Preview,
1269
+ Bt as SYSTEM_PROMPT,
1270
+ Qt as TOOL_DEFINITION,
1271
+ he as TOOL_NAME,
1272
+ It as View,
1273
+ Zt as default,
1274
+ jt as executeMarkdown,
1275
+ qt as plugin,
1276
+ _e as pluginCore,
1277
+ Te as samples
1251
1278
  };