@arcgis/coding-components 4.34.0-next.42 → 4.34.0-next.44

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.
Files changed (76) hide show
  1. package/dist/addons.js +1 -1
  2. package/dist/cdn/{GXZEN7EB.js → 25EUNV4K.js} +2 -2
  3. package/dist/cdn/{3W2HLY2N.js → 2MSZMSKD.js} +2 -2
  4. package/dist/cdn/{NKO563WS.js → 2QSZUO2L.js} +2 -2
  5. package/dist/cdn/{WD7NHEVK.js → 3RWZD2R2.js} +4 -4
  6. package/dist/cdn/{TY3UDXGS.js → 4NA2DUK2.js} +1 -1
  7. package/dist/cdn/{H5CGXE52.js → A2S3YU56.js} +2 -2
  8. package/dist/cdn/{GXREAHEZ.js → B53PHVFE.js} +1 -1
  9. package/dist/cdn/{SIA6JI7R.js → BGBJKYC2.js} +2 -2
  10. package/dist/cdn/CBLCXG35.js +59 -0
  11. package/dist/cdn/{3M6VCOQX.js → DGSUEUIT.js} +2 -2
  12. package/dist/cdn/{P4DRD3VQ.js → DNUOUF7H.js} +2 -2
  13. package/dist/cdn/{LEWBUKEH.js → DSYNTA65.js} +2 -2
  14. package/dist/cdn/{EMLQOEQU.js → E22BLEDP.js} +1 -1
  15. package/dist/cdn/{T7SOSCIX.js → E4PWHVIO.js} +2 -2
  16. package/dist/cdn/{PSPPJLTI.js → EO32LFP5.js} +2 -2
  17. package/dist/cdn/{NQGJTRTQ.js → FYH4ZSFQ.js} +2 -2
  18. package/dist/cdn/{XRUOBQQK.js → GP3OX3OM.js} +2 -2
  19. package/dist/cdn/{GPANK3UN.js → HF3W6FLS.js} +2 -2
  20. package/dist/cdn/{CDTTMKWZ.js → HU2Z6AJR.js} +2 -2
  21. package/dist/cdn/{JVJBZ4YF.js → IKHMRKUT.js} +2 -2
  22. package/dist/cdn/{V6ORZ6F3.js → IQ7PH6YZ.js} +2 -2
  23. package/dist/cdn/{IWL4673Z.js → J353EUFM.js} +1 -1
  24. package/dist/cdn/{SXHVZN4J.js → JOOEUUU5.js} +2 -2
  25. package/dist/cdn/{ZNQ4Q3HH.js → KJO2HDSZ.js} +2 -2
  26. package/dist/cdn/{OJUHWPR6.js → LCR633X3.js} +2 -2
  27. package/dist/cdn/{THL5KWJE.js → MBNHYKD4.js} +2 -2
  28. package/dist/cdn/{OIAESFK5.js → MPG2CQSV.js} +2 -2
  29. package/dist/cdn/{SSGBHNOZ.js → MQX57ZL2.js} +2 -2
  30. package/dist/cdn/{YR7QR2DQ.js → OK3HJRPK.js} +2 -2
  31. package/dist/cdn/{DPVOUGAA.js → PVTNB7QQ.js} +1 -1
  32. package/dist/cdn/{V3HDVOEB.js → QKWGZ3OM.js} +2 -2
  33. package/dist/cdn/{YBYAF6CQ.js → RDZHNXS6.js} +2 -2
  34. package/dist/cdn/{ZCEYV3UG.js → S4N25LSU.js} +2 -2
  35. package/dist/cdn/{BTPZYDNC.js → S7AYEY2E.js} +2 -2
  36. package/dist/cdn/{ZGKWBYWX.js → UJ34RXHP.js} +2 -2
  37. package/dist/cdn/{YIGAXJ6U.js → UJQ2IBQA.js} +2 -2
  38. package/dist/cdn/{J2P6G25H.js → UJRR47KM.js} +2 -2
  39. package/dist/cdn/{HYHVNHHS.js → VKOUIFRD.js} +2 -2
  40. package/dist/cdn/{LKAGV3SK.js → VXJUF3BS.js} +2 -2
  41. package/dist/cdn/{KVHZWVBD.js → YBU7II4B.js} +2 -2
  42. package/dist/cdn/{GWMKTKYJ.js → ZHREXA64.js} +2 -2
  43. package/dist/cdn/assets/code-editor/sql-expr.worker.js +74485 -75534
  44. package/dist/cdn/index.js +2 -2
  45. package/dist/chunks/arcade-defaults.js +1 -1
  46. package/dist/chunks/arcade-executor.js +1 -1
  47. package/dist/chunks/arcade-mode.js +1 -1
  48. package/dist/chunks/arcade-service-accessors.js +1 -1
  49. package/dist/chunks/editor.js +1 -1
  50. package/dist/chunks/fields.js +1 -1
  51. package/dist/chunks/language-defaults-base.js +1 -1
  52. package/dist/chunks/markdown.js +858 -1383
  53. package/dist/chunks/monaco-importer.js +1 -1
  54. package/dist/chunks/runtime.js +1 -1
  55. package/dist/chunks/setup-monaco.js +1 -1
  56. package/dist/chunks/sql-expr-contribution.js +1 -1
  57. package/dist/chunks/sql-expr-defaults.js +1 -1
  58. package/dist/chunks/sql-expr-mode.js +1 -1
  59. package/dist/chunks/useT9n.js +1 -1
  60. package/dist/components/arcgis-arcade-coding-assistant/customElement.js +21 -29
  61. package/dist/components/arcgis-arcade-coding-assistant/types.d.ts +4 -2
  62. package/dist/components/arcgis-arcade-editor/customElement.js +1 -1
  63. package/dist/components/arcgis-arcade-results/customElement.js +1 -1
  64. package/dist/components/arcgis-arcade-suggestions/customElement.js +1 -1
  65. package/dist/components/arcgis-code-editor/customElement.js +1 -1
  66. package/dist/components/arcgis-editor-variables/customElement.js +1 -1
  67. package/dist/components/arcgis-language-api-panel/customElement.js +1 -1
  68. package/dist/components/arcgis-sql-expression-editor/customElement.js +1 -1
  69. package/dist/components/arcgis-sql-expression-fields/customElement.js +1 -1
  70. package/dist/docs/api.json +2 -2
  71. package/dist/docs/docs.json +2 -2
  72. package/dist/docs/web-types.json +1 -1
  73. package/dist/index.js +1 -1
  74. package/dist/loader.js +1 -1
  75. package/package.json +5 -5
  76. package/dist/cdn/ZXURQNBL.js +0 -49
@@ -1,1624 +1,1099 @@
1
- import { i as ee } from "./monaco-importer.js";
2
- import { StandaloneServices as W } from "monaco-editor/esm/vs/editor/standalone/browser/standaloneServices.js";
3
- import { IStandaloneThemeService as G } from "monaco-editor/esm/vs/editor/standalone/common/standaloneTheme.js";
4
- import { generateTokensCSSForColorMap as te } from "monaco-editor/esm/vs/editor/common/languages/supports/tokenization.js";
1
+ import { i as me } from "./monaco-importer.js";
2
+ import { StandaloneServices as le } from "monaco-editor/esm/vs/editor/standalone/browser/standaloneServices.js";
3
+ import { IStandaloneThemeService as ie } from "monaco-editor/esm/vs/editor/standalone/common/standaloneTheme.js";
4
+ import { generateTokensCSSForColorMap as we } from "monaco-editor/esm/vs/editor/common/languages/supports/tokenization.js";
5
5
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
6
6
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
7
- v4.34.0-next.42 */
8
- async function ne(l, t) {
9
- return await (await ee()).colorize(l, t, { tabSize: 2 });
7
+ v4.34.0-next.44 */
8
+ async function ye(r, e) {
9
+ return await (await me()).colorize(r, e, { tabSize: 2 });
10
10
  }
11
- async function ze(l, t) {
12
- if (!l)
11
+ async function ct(r, e) {
12
+ if (!r)
13
13
  return;
14
14
  const n = Array.from(
15
- l.querySelectorAll("code.language-arcade, code.language-sql"),
16
- async (e) => await ie(e, e.textContent, t)
15
+ r.querySelectorAll("code.language-arcade, code.language-sql"),
16
+ async (s) => await $e(s, s.textContent, e)
17
17
  );
18
18
  await Promise.all(n);
19
19
  }
20
- async function ie(l, t, n) {
21
- !l || l.tagName !== "CODE" || (l.innerHTML = await ne(t ?? "", n));
20
+ async function $e(r, e, n) {
21
+ !r || r.tagName !== "CODE" || (r.innerHTML = await ye(e ?? "", n));
22
22
  }
23
- function Se() {
24
- const t = W.get(G).getColorTheme();
25
- return te(t.tokenTheme.getColorMap());
23
+ function ht() {
24
+ const e = le.get(ie).getColorTheme();
25
+ return we(e.tokenTheme.getColorMap());
26
26
  }
27
- function Te(l) {
28
- return W.get(G).onDidColorThemeChange(() => l());
27
+ function pt(r) {
28
+ return le.get(ie).onDidColorThemeChange(() => r());
29
29
  }
30
- function M() {
31
- return {
32
- async: !1,
33
- baseUrl: null,
34
- breaks: !1,
35
- extensions: null,
36
- gfm: !0,
37
- headerIds: !0,
38
- headerPrefix: "",
39
- highlight: null,
40
- hooks: null,
41
- langPrefix: "language-",
42
- mangle: !0,
43
- pedantic: !1,
44
- renderer: null,
45
- sanitize: !1,
46
- sanitizer: null,
47
- silent: !1,
48
- smartypants: !1,
49
- tokenizer: null,
50
- walkTokens: null,
51
- xhtml: !1
52
- };
30
+ function O() {
31
+ return { async: !1, breaks: !1, extensions: null, gfm: !0, hooks: null, pedantic: !1, renderer: null, silent: !1, tokenizer: null, walkTokens: null };
53
32
  }
54
- let A = M();
55
- function V(l) {
56
- A = l;
33
+ var S = O();
34
+ function ae(r) {
35
+ S = r;
57
36
  }
58
- const J = /[&<>"']/, se = new RegExp(J.source, "g"), K = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, re = new RegExp(K.source, "g"), le = {
59
- "&": "&amp;",
60
- "<": "&lt;",
61
- ">": "&gt;",
62
- '"': "&quot;",
63
- "'": "&#39;"
64
- }, Q = (l) => le[l];
65
- function b(l, t) {
66
- if (t) {
67
- if (J.test(l))
68
- return l.replace(se, Q);
69
- } else if (K.test(l))
70
- return l.replace(re, Q);
71
- return l;
37
+ var A = { exec: () => null };
38
+ function u(r, e = "") {
39
+ let n = typeof r == "string" ? r : r.source, s = { replace: (t, i) => {
40
+ let l = typeof i == "string" ? i : i.source;
41
+ return l = l.replace(x.caret, "$1"), n = n.replace(t, l), s;
42
+ }, getRegex: () => new RegExp(n, e) };
43
+ return s;
72
44
  }
73
- const ae = /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;
74
- function Y(l) {
75
- return l.replace(ae, (t, n) => (n = n.toLowerCase(), n === "colon" ? ":" : n.charAt(0) === "#" ? n.charAt(1) === "x" ? String.fromCharCode(parseInt(n.substring(2), 16)) : String.fromCharCode(+n.substring(1)) : ""));
45
+ var x = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceTabs: /^\t+/, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] /, listReplaceTask: /^\[[ xX]\] +/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, unescapeTest: /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (r) => new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: (r) => new RegExp(`^ {0,${Math.min(3, r - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), hrRegex: (r) => new RegExp(`^ {0,${Math.min(3, r - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), fencesBeginRegex: (r) => new RegExp(`^ {0,${Math.min(3, r - 1)}}(?:\`\`\`|~~~)`), headingBeginRegex: (r) => new RegExp(`^ {0,${Math.min(3, r - 1)}}#`), htmlBeginRegex: (r) => new RegExp(`^ {0,${Math.min(3, r - 1)}}<(?:[a-z].*>|!--)`, "i") }, Se = /^(?:[ \t]*(?:\n|$))+/, Re = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, ze = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, _ = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Te = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, Q = /(?:[*+-]|\d{1,9}[.)])/, oe = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, ce = u(oe).replace(/bull/g, Q).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), Ae = u(oe).replace(/bull/g, Q).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), j = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, _e = /^[^\n]+/, H = /(?!\s*\])(?:\\.|[^\[\]\\])+/, Ce = u(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", H).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Pe = u(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, Q).getRegex(), E = "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", G = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Ie = u("^ {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", G).replace("tag", E).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), he = u(j).replace("hr", _).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", E).getRegex(), ve = u(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", he).getRegex(), F = { blockquote: ve, code: Re, def: Ce, fences: ze, heading: Te, hr: _, html: Ie, lheading: ce, list: Pe, newline: Se, paragraph: he, table: A, text: _e }, ee = u("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", _).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", E).getRegex(), Le = { ...F, lheading: Ae, table: ee, paragraph: u(j).replace("hr", _).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", ee).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", E).getRegex() }, Ee = { ...F, html: u(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", G).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: A, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: u(j).replace("hr", _).replace("heading", ` *#{1,6} *[^
46
+ ]`).replace("lheading", ce).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, qe = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Be = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, pe = /^( {2,}|\\)\n(?!\s*$)/, Ze = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, q = /[\p{P}\p{S}]/u, X = /[\s\p{P}\p{S}]/u, ue = /[^\s\p{P}\p{S}]/u, De = u(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, X).getRegex(), ge = /(?!~)[\p{P}\p{S}]/u, Me = /(?!~)[\s\p{P}\p{S}]/u, Ne = /(?:[^\s\p{P}\p{S}]|~)/u, Oe = /\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g, ke = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, Qe = u(ke, "u").replace(/punct/g, q).getRegex(), je = u(ke, "u").replace(/punct/g, ge).getRegex(), fe = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", He = u(fe, "gu").replace(/notPunctSpace/g, ue).replace(/punctSpace/g, X).replace(/punct/g, q).getRegex(), Ge = u(fe, "gu").replace(/notPunctSpace/g, Ne).replace(/punctSpace/g, Me).replace(/punct/g, ge).getRegex(), Fe = u("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, ue).replace(/punctSpace/g, X).replace(/punct/g, q).getRegex(), Xe = u(/\\(punct)/, "gu").replace(/punct/g, q).getRegex(), Ue = u(/^<(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(), Je = u(G).replace("(?:-->|$)", "-->").getRegex(), Ke = u("^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", Je).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), I = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, We = u(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", I).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), de = u(/^!?\[(label)\]\[(ref)\]/).replace("label", I).replace("ref", H).getRegex(), xe = u(/^!?\[(ref)\](?:\[\])?/).replace("ref", H).getRegex(), Ve = u("reflink|nolink(?!\\()", "g").replace("reflink", de).replace("nolink", xe).getRegex(), U = { _backpedal: A, anyPunctuation: Xe, autolink: Ue, blockSkip: Oe, br: pe, code: Be, del: A, emStrongLDelim: Qe, emStrongRDelimAst: He, emStrongRDelimUnd: Fe, escape: qe, link: We, nolink: xe, punctuation: De, reflink: de, reflinkSearch: Ve, tag: Ke, text: Ze, url: A }, Ye = { ...U, link: u(/^!?\[(label)\]\((.*?)\)/).replace("label", I).getRegex(), reflink: u(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", I).getRegex() }, D = { ...U, emStrongRDelimAst: Ge, emStrongLDelim: je, url: u(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, "i").replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/, text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/ }, et = { ...D, br: u(pe).replace("{2,}", "*").getRegex(), text: u(D.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, C = { normal: F, gfm: Le, pedantic: Ee }, z = { normal: U, gfm: D, breaks: et, pedantic: Ye }, tt = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }, te = (r) => tt[r];
47
+ function m(r, e) {
48
+ if (e) {
49
+ if (x.escapeTest.test(r)) return r.replace(x.escapeReplace, te);
50
+ } else if (x.escapeTestNoEncode.test(r)) return r.replace(x.escapeReplaceNoEncode, te);
51
+ return r;
76
52
  }
77
- const oe = /(^|[^\[])\^/g;
78
- function m(l, t) {
79
- l = typeof l == "string" ? l : l.source, t = t || "";
80
- const n = {
81
- replace: (e, i) => (i = i.source || i, i = i.replace(oe, "$1"), l = l.replace(e, i), n),
82
- getRegex: () => new RegExp(l, t)
83
- };
84
- return n;
85
- }
86
- const he = /[^\w:]/g, ce = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;
87
- function N(l, t, n) {
88
- if (l) {
89
- let e;
90
- try {
91
- e = decodeURIComponent(Y(n)).replace(he, "").toLowerCase();
92
- } catch {
93
- return null;
94
- }
95
- if (e.indexOf("javascript:") === 0 || e.indexOf("vbscript:") === 0 || e.indexOf("data:") === 0)
96
- return null;
97
- }
98
- t && !ce.test(n) && (n = ge(t, n));
53
+ function re(r) {
99
54
  try {
100
- n = encodeURI(n).replace(/%25/g, "%");
55
+ r = encodeURI(r).replace(x.percentDecode, "%");
101
56
  } catch {
102
57
  return null;
103
58
  }
104
- return n;
59
+ return r;
105
60
  }
106
- const L = {}, ue = /^[^:]+:\/*[^/]*$/, pe = /^([^:]+:)[\s\S]*$/, fe = /^([^:]+:\/*[^/]*)[\s\S]*$/;
107
- function ge(l, t) {
108
- L[" " + l] || (ue.test(l) ? L[" " + l] = l + "/" : L[" " + l] = P(l, "/", !0)), l = L[" " + l];
109
- const n = l.indexOf(":") === -1;
110
- return t.substring(0, 2) === "//" ? n ? t : l.replace(pe, "$1") + t : t.charAt(0) === "/" ? n ? t : l.replace(fe, "$1") + t : l + t;
111
- }
112
- const D = { exec: function() {
113
- } };
114
- function H(l, t) {
115
- const n = l.replace(/\|/g, (s, r, a) => {
116
- let o = !1, p = r;
117
- for (; --p >= 0 && a[p] === "\\"; ) o = !o;
61
+ function ne(r, e) {
62
+ let n = r.replace(x.findPipe, (i, l, a) => {
63
+ let o = !1, c = l;
64
+ for (; --c >= 0 && a[c] === "\\"; ) o = !o;
118
65
  return o ? "|" : " |";
119
- }), e = n.split(/ \|/);
120
- let i = 0;
121
- if (e[0].trim() || e.shift(), e.length > 0 && !e[e.length - 1].trim() && e.pop(), e.length > t)
122
- e.splice(t);
123
- else
124
- for (; e.length < t; ) e.push("");
125
- for (; i < e.length; i++)
126
- e[i] = e[i].trim().replace(/\\\|/g, "|");
127
- return e;
66
+ }), s = n.split(x.splitPipe), t = 0;
67
+ if (s[0].trim() || s.shift(), s.length > 0 && !s.at(-1)?.trim() && s.pop(), e) if (s.length > e) s.splice(e);
68
+ else for (; s.length < e; ) s.push("");
69
+ for (; t < s.length; t++) s[t] = s[t].trim().replace(x.slashPipe, "|");
70
+ return s;
128
71
  }
129
- function P(l, t, n) {
130
- const e = l.length;
131
- if (e === 0)
132
- return "";
133
- let i = 0;
134
- for (; i < e; ) {
135
- const s = l.charAt(e - i - 1);
136
- if (s === t && !n)
137
- i++;
138
- else if (s !== t && n)
139
- i++;
140
- else
141
- break;
142
- }
143
- return l.slice(0, e - i);
72
+ function T(r, e, n) {
73
+ let s = r.length;
74
+ if (s === 0) return "";
75
+ let t = 0;
76
+ for (; t < s && r.charAt(s - t - 1) === e; )
77
+ t++;
78
+ return r.slice(0, s - t);
144
79
  }
145
- function de(l, t) {
146
- if (l.indexOf(t[1]) === -1)
147
- return -1;
148
- const n = l.length;
149
- let e = 0, i = 0;
150
- for (; i < n; i++)
151
- if (l[i] === "\\")
152
- i++;
153
- else if (l[i] === t[0])
154
- e++;
155
- else if (l[i] === t[1] && (e--, e < 0))
156
- return i;
157
- return -1;
80
+ function rt(r, e) {
81
+ if (r.indexOf(e[1]) === -1) return -1;
82
+ let n = 0;
83
+ for (let s = 0; s < r.length; s++) if (r[s] === "\\") s++;
84
+ else if (r[s] === e[0]) n++;
85
+ else if (r[s] === e[1] && (n--, n < 0)) return s;
86
+ return n > 0 ? -2 : -1;
158
87
  }
159
- function ke(l, t) {
160
- !l || l.silent || (t && console.warn("marked(): callback is deprecated since version 5.0.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/using_pro#async"), (l.sanitize || l.sanitizer) && console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options"), (l.highlight || l.langPrefix !== "language-") && console.warn("marked(): highlight and langPrefix parameters are deprecated since version 5.0.0, should not be used and will be removed in the future. Instead use https://www.npmjs.com/package/marked-highlight."), l.mangle && console.warn("marked(): mangle parameter is enabled by default, but is deprecated since version 5.0.0, and will be removed in the future. To clear this warning, install https://www.npmjs.com/package/marked-mangle, or disable by setting `{mangle: false}`."), l.baseUrl && console.warn("marked(): baseUrl parameter is deprecated since version 5.0.0, should not be used and will be removed in the future. Instead use https://www.npmjs.com/package/marked-base-url."), l.smartypants && console.warn("marked(): smartypants parameter is deprecated since version 5.0.0, should not be used and will be removed in the future. Instead use https://www.npmjs.com/package/marked-smartypants."), l.xhtml && console.warn("marked(): xhtml parameter is deprecated since version 5.0.0, should not be used and will be removed in the future. Instead use https://www.npmjs.com/package/marked-xhtml."), (l.headerIds || l.headerPrefix) && console.warn("marked(): headerIds and headerPrefix parameters enabled by default, but are deprecated since version 5.0.0, and will be removed in the future. To clear this warning, install https://www.npmjs.com/package/marked-gfm-heading-id, or disable by setting `{headerIds: false}`."));
88
+ function se(r, e, n, s, t) {
89
+ let i = e.href, l = e.title || null, a = r[1].replace(t.other.outputLinkReplace, "$1");
90
+ s.state.inLink = !0;
91
+ let o = { type: r[0].charAt(0) === "!" ? "image" : "link", raw: n, href: i, title: l, text: a, tokens: s.inlineTokens(a) };
92
+ return s.state.inLink = !1, o;
161
93
  }
162
- function F(l, t, n, e) {
163
- const i = t.href, s = t.title ? b(t.title) : null, r = l[1].replace(/\\([\[\]])/g, "$1");
164
- if (l[0].charAt(0) !== "!") {
165
- e.state.inLink = !0;
166
- const a = {
167
- type: "link",
168
- raw: n,
169
- href: i,
170
- title: s,
171
- text: r,
172
- tokens: e.inlineTokens(r)
173
- };
174
- return e.state.inLink = !1, a;
175
- }
176
- return {
177
- type: "image",
178
- raw: n,
179
- href: i,
180
- title: s,
181
- text: b(r)
182
- };
183
- }
184
- function me(l, t) {
185
- const n = l.match(/^(\s+)(?:```)/);
186
- if (n === null)
187
- return t;
188
- const e = n[1];
189
- return t.split(`
94
+ function nt(r, e, n) {
95
+ let s = r.match(n.other.indentCodeCompensation);
96
+ if (s === null) return e;
97
+ let t = s[1];
98
+ return e.split(`
190
99
  `).map((i) => {
191
- const s = i.match(/^\s+/);
192
- if (s === null)
193
- return i;
194
- const [r] = s;
195
- return r.length >= e.length ? i.slice(e.length) : i;
100
+ let l = i.match(n.other.beginningSpace);
101
+ if (l === null) return i;
102
+ let [a] = l;
103
+ return a.length >= t.length ? i.slice(t.length) : i;
196
104
  }).join(`
197
105
  `);
198
106
  }
199
- class Z {
200
- constructor(t) {
201
- this.options = t || A;
202
- }
203
- space(t) {
204
- const n = this.rules.block.newline.exec(t);
205
- if (n && n[0].length > 0)
206
- return {
207
- type: "space",
208
- raw: n[0]
209
- };
210
- }
211
- code(t) {
212
- const n = this.rules.block.code.exec(t);
213
- if (n) {
214
- const e = n[0].replace(/^ {1,4}/gm, "");
215
- return {
216
- type: "code",
217
- raw: n[0],
218
- codeBlockStyle: "indented",
219
- text: this.options.pedantic ? e : P(e, `
220
- `)
221
- };
107
+ var v = class {
108
+ options;
109
+ rules;
110
+ lexer;
111
+ constructor(r) {
112
+ this.options = r || S;
113
+ }
114
+ space(r) {
115
+ let e = this.rules.block.newline.exec(r);
116
+ if (e && e[0].length > 0) return { type: "space", raw: e[0] };
117
+ }
118
+ code(r) {
119
+ let e = this.rules.block.code.exec(r);
120
+ if (e) {
121
+ let n = e[0].replace(this.rules.other.codeRemoveIndent, "");
122
+ return { type: "code", raw: e[0], codeBlockStyle: "indented", text: this.options.pedantic ? n : T(n, `
123
+ `) };
222
124
  }
223
125
  }
224
- fences(t) {
225
- const n = this.rules.block.fences.exec(t);
226
- if (n) {
227
- const e = n[0], i = me(e, n[3] || "");
228
- return {
229
- type: "code",
230
- raw: e,
231
- lang: n[2] ? n[2].trim().replace(this.rules.inline._escapes, "$1") : n[2],
232
- text: i
233
- };
126
+ fences(r) {
127
+ let e = this.rules.block.fences.exec(r);
128
+ if (e) {
129
+ let n = e[0], s = nt(n, e[3] || "", this.rules);
130
+ return { type: "code", raw: n, lang: e[2] ? e[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : e[2], text: s };
234
131
  }
235
132
  }
236
- heading(t) {
237
- const n = this.rules.block.heading.exec(t);
238
- if (n) {
239
- let e = n[2].trim();
240
- if (/#$/.test(e)) {
241
- const i = P(e, "#");
242
- (this.options.pedantic || !i || / $/.test(i)) && (e = i.trim());
133
+ heading(r) {
134
+ let e = this.rules.block.heading.exec(r);
135
+ if (e) {
136
+ let n = e[2].trim();
137
+ if (this.rules.other.endingHash.test(n)) {
138
+ let s = T(n, "#");
139
+ (this.options.pedantic || !s || this.rules.other.endingSpaceChar.test(s)) && (n = s.trim());
243
140
  }
244
- return {
245
- type: "heading",
246
- raw: n[0],
247
- depth: n[1].length,
248
- text: e,
249
- tokens: this.lexer.inline(e)
250
- };
141
+ return { type: "heading", raw: e[0], depth: e[1].length, text: n, tokens: this.lexer.inline(n) };
251
142
  }
252
143
  }
253
- hr(t) {
254
- const n = this.rules.block.hr.exec(t);
255
- if (n)
256
- return {
257
- type: "hr",
258
- raw: n[0]
259
- };
260
- }
261
- blockquote(t) {
262
- const n = this.rules.block.blockquote.exec(t);
263
- if (n) {
264
- const e = n[0].replace(/^ *>[ \t]?/gm, ""), i = this.lexer.state.top;
265
- this.lexer.state.top = !0;
266
- const s = this.lexer.blockTokens(e);
267
- return this.lexer.state.top = i, {
268
- type: "blockquote",
269
- raw: n[0],
270
- tokens: s,
271
- text: e
272
- };
144
+ hr(r) {
145
+ let e = this.rules.block.hr.exec(r);
146
+ if (e) return { type: "hr", raw: T(e[0], `
147
+ `) };
148
+ }
149
+ blockquote(r) {
150
+ let e = this.rules.block.blockquote.exec(r);
151
+ if (e) {
152
+ let n = T(e[0], `
153
+ `).split(`
154
+ `), s = "", t = "", i = [];
155
+ for (; n.length > 0; ) {
156
+ let l = !1, a = [], o;
157
+ for (o = 0; o < n.length; o++) if (this.rules.other.blockquoteStart.test(n[o])) a.push(n[o]), l = !0;
158
+ else if (!l) a.push(n[o]);
159
+ else break;
160
+ n = n.slice(o);
161
+ let c = a.join(`
162
+ `), h = c.replace(this.rules.other.blockquoteSetextReplace, `
163
+ $1`).replace(this.rules.other.blockquoteSetextReplace2, "");
164
+ s = s ? `${s}
165
+ ${c}` : c, t = t ? `${t}
166
+ ${h}` : h;
167
+ let k = this.lexer.state.top;
168
+ if (this.lexer.state.top = !0, this.lexer.blockTokens(h, i, !0), this.lexer.state.top = k, n.length === 0) break;
169
+ let g = i.at(-1);
170
+ if (g?.type === "code") break;
171
+ if (g?.type === "blockquote") {
172
+ let d = g, f = d.raw + `
173
+ ` + n.join(`
174
+ `), b = this.blockquote(f);
175
+ i[i.length - 1] = b, s = s.substring(0, s.length - d.raw.length) + b.raw, t = t.substring(0, t.length - d.text.length) + b.text;
176
+ break;
177
+ } else if (g?.type === "list") {
178
+ let d = g, f = d.raw + `
179
+ ` + n.join(`
180
+ `), b = this.list(f);
181
+ i[i.length - 1] = b, s = s.substring(0, s.length - g.raw.length) + b.raw, t = t.substring(0, t.length - d.raw.length) + b.raw, n = f.substring(i.at(-1).raw.length).split(`
182
+ `);
183
+ continue;
184
+ }
185
+ }
186
+ return { type: "blockquote", raw: s, tokens: i, text: t };
273
187
  }
274
188
  }
275
- list(t) {
276
- let n = this.rules.block.list.exec(t);
277
- if (n) {
278
- let e, i, s, r, a, o, p, f, k, g, c, y, _ = n[1].trim();
279
- const I = _.length > 1, x = {
280
- type: "list",
281
- raw: "",
282
- ordered: I,
283
- start: I ? +_.slice(0, -1) : "",
284
- loose: !1,
285
- items: []
286
- };
287
- _ = I ? `\\d{1,9}\\${_.slice(-1)}` : `\\${_}`, this.options.pedantic && (_ = I ? _ : "[*+-]");
288
- const w = new RegExp(`^( {0,3}${_})((?:[ ][^\\n]*)?(?:\\n|$))`);
289
- for (; t && (y = !1, !(!(n = w.exec(t)) || this.rules.block.hr.test(t))); ) {
290
- if (e = n[0], t = t.substring(e.length), f = n[2].split(`
291
- `, 1)[0].replace(/^\t+/, (R) => " ".repeat(3 * R.length)), k = t.split(`
292
- `, 1)[0], this.options.pedantic ? (r = 2, c = f.trimLeft()) : (r = n[2].search(/[^ ]/), r = r > 4 ? 1 : r, c = f.slice(r), r += n[1].length), o = !1, !f && /^ *$/.test(k) && (e += k + `
293
- `, t = t.substring(k.length + 1), y = !0), !y) {
294
- const R = new RegExp(`^ {0,${Math.min(3, r - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), $ = new RegExp(`^ {0,${Math.min(3, r - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), z = new RegExp(`^ {0,${Math.min(3, r - 1)}}(?:\`\`\`|~~~)`), E = new RegExp(`^ {0,${Math.min(3, r - 1)}}#`);
295
- for (; t && (g = t.split(`
296
- `, 1)[0], k = g, this.options.pedantic && (k = k.replace(/^ {1,4}(?=( {4})*[^ ])/g, " ")), !(z.test(k) || E.test(k) || R.test(k) || $.test(t))); ) {
297
- if (k.search(/[^ ]/) >= r || !k.trim())
298
- c += `
299
- ` + k.slice(r);
189
+ list(r) {
190
+ let e = this.rules.block.list.exec(r);
191
+ if (e) {
192
+ let n = e[1].trim(), s = n.length > 1, t = { type: "list", raw: "", ordered: s, start: s ? +n.slice(0, -1) : "", loose: !1, items: [] };
193
+ n = s ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = s ? n : "[*+-]");
194
+ let i = this.rules.other.listItemRegex(n), l = !1;
195
+ for (; r; ) {
196
+ let o = !1, c = "", h = "";
197
+ if (!(e = i.exec(r)) || this.rules.block.hr.test(r)) break;
198
+ c = e[0], r = r.substring(c.length);
199
+ let k = e[2].split(`
200
+ `, 1)[0].replace(this.rules.other.listReplaceTabs, (B) => " ".repeat(3 * B.length)), g = r.split(`
201
+ `, 1)[0], d = !k.trim(), f = 0;
202
+ if (this.options.pedantic ? (f = 2, h = k.trimStart()) : d ? f = e[1].length + 1 : (f = e[2].search(this.rules.other.nonSpaceChar), f = f > 4 ? 1 : f, h = k.slice(f), f += e[1].length), d && this.rules.other.blankLine.test(g) && (c += g + `
203
+ `, r = r.substring(g.length + 1), o = !0), !o) {
204
+ let B = this.rules.other.nextBulletRegex(f), W = this.rules.other.hrRegex(f), V = this.rules.other.fencesBeginRegex(f), Y = this.rules.other.headingBeginRegex(f), be = this.rules.other.htmlBeginRegex(f);
205
+ for (; r; ) {
206
+ let Z = r.split(`
207
+ `, 1)[0], R;
208
+ if (g = Z, this.options.pedantic ? (g = g.replace(this.rules.other.listReplaceNesting, " "), R = g) : R = g.replace(this.rules.other.tabCharGlobal, " "), V.test(g) || Y.test(g) || be.test(g) || B.test(g) || W.test(g)) break;
209
+ if (R.search(this.rules.other.nonSpaceChar) >= f || !g.trim()) h += `
210
+ ` + R.slice(f);
300
211
  else {
301
- if (o || f.search(/[^ ]/) >= 4 || z.test(f) || E.test(f) || $.test(f))
302
- break;
303
- c += `
304
- ` + k;
212
+ if (d || k.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || V.test(k) || Y.test(k) || W.test(k)) break;
213
+ h += `
214
+ ` + g;
305
215
  }
306
- !o && !k.trim() && (o = !0), e += g + `
307
- `, t = t.substring(g.length + 1), f = k.slice(r);
216
+ !d && !g.trim() && (d = !0), c += Z + `
217
+ `, r = r.substring(Z.length + 1), k = R.slice(f);
308
218
  }
309
219
  }
310
- x.loose || (p ? x.loose = !0 : /\n *\n *$/.test(e) && (p = !0)), this.options.gfm && (i = /^\[[ xX]\] /.exec(c), i && (s = i[0] !== "[ ] ", c = c.replace(/^\[[ xX]\] +/, ""))), x.items.push({
311
- type: "list_item",
312
- raw: e,
313
- task: !!i,
314
- checked: s,
315
- loose: !1,
316
- text: c
317
- }), x.raw += e;
220
+ t.loose || (l ? t.loose = !0 : this.rules.other.doubleBlankLine.test(c) && (l = !0));
221
+ let b = null, K;
222
+ this.options.gfm && (b = this.rules.other.listIsTask.exec(h), b && (K = b[0] !== "[ ] ", h = h.replace(this.rules.other.listReplaceTask, ""))), t.items.push({ type: "list_item", raw: c, task: !!b, checked: K, loose: !1, text: h, tokens: [] }), t.raw += c;
318
223
  }
319
- x.items[x.items.length - 1].raw = e.trimRight(), x.items[x.items.length - 1].text = c.trimRight(), x.raw = x.raw.trimRight();
320
- const v = x.items.length;
321
- for (a = 0; a < v; a++)
322
- if (this.lexer.state.top = !1, x.items[a].tokens = this.lexer.blockTokens(x.items[a].text, []), !x.loose) {
323
- const R = x.items[a].tokens.filter((z) => z.type === "space"), $ = R.length > 0 && R.some((z) => /\n.*\n/.test(z.raw));
324
- x.loose = $;
325
- }
326
- if (x.loose)
327
- for (a = 0; a < v; a++)
328
- x.items[a].loose = !0;
329
- return x;
330
- }
331
- }
332
- html(t) {
333
- const n = this.rules.block.html.exec(t);
334
- if (n) {
335
- const e = {
336
- type: "html",
337
- block: !0,
338
- raw: n[0],
339
- pre: !this.options.sanitizer && (n[1] === "pre" || n[1] === "script" || n[1] === "style"),
340
- text: n[0]
341
- };
342
- if (this.options.sanitize) {
343
- const i = this.options.sanitizer ? this.options.sanitizer(n[0]) : b(n[0]);
344
- e.type = "paragraph", e.text = i, e.tokens = this.lexer.inline(i);
224
+ let a = t.items.at(-1);
225
+ if (a) a.raw = a.raw.trimEnd(), a.text = a.text.trimEnd();
226
+ else return;
227
+ t.raw = t.raw.trimEnd();
228
+ for (let o = 0; o < t.items.length; o++) if (this.lexer.state.top = !1, t.items[o].tokens = this.lexer.blockTokens(t.items[o].text, []), !t.loose) {
229
+ let c = t.items[o].tokens.filter((k) => k.type === "space"), h = c.length > 0 && c.some((k) => this.rules.other.anyLine.test(k.raw));
230
+ t.loose = h;
345
231
  }
346
- return e;
232
+ if (t.loose) for (let o = 0; o < t.items.length; o++) t.items[o].loose = !0;
233
+ return t;
347
234
  }
348
235
  }
349
- def(t) {
350
- const n = this.rules.block.def.exec(t);
351
- if (n) {
352
- const e = n[1].toLowerCase().replace(/\s+/g, " "), i = n[2] ? n[2].replace(/^<(.*)>$/, "$1").replace(this.rules.inline._escapes, "$1") : "", s = n[3] ? n[3].substring(1, n[3].length - 1).replace(this.rules.inline._escapes, "$1") : n[3];
353
- return {
354
- type: "def",
355
- tag: e,
356
- raw: n[0],
357
- href: i,
358
- title: s
359
- };
236
+ html(r) {
237
+ let e = this.rules.block.html.exec(r);
238
+ if (e) return { type: "html", block: !0, raw: e[0], pre: e[1] === "pre" || e[1] === "script" || e[1] === "style", text: e[0] };
239
+ }
240
+ def(r) {
241
+ let e = this.rules.block.def.exec(r);
242
+ if (e) {
243
+ let n = 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];
244
+ return { type: "def", tag: n, raw: e[0], href: s, title: t };
360
245
  }
361
246
  }
362
- table(t) {
363
- const n = this.rules.block.table.exec(t);
364
- if (n) {
365
- const e = {
366
- type: "table",
367
- header: H(n[1]).map((i) => ({ text: i })),
368
- align: n[2].replace(/^ *|\| *$/g, "").split(/ *\| */),
369
- rows: n[3] && n[3].trim() ? n[3].replace(/\n[ \t]*$/, "").split(`
370
- `) : []
371
- };
372
- if (e.header.length === e.align.length) {
373
- e.raw = n[0];
374
- let i = e.align.length, s, r, a, o;
375
- for (s = 0; s < i; s++)
376
- /^ *-+: *$/.test(e.align[s]) ? e.align[s] = "right" : /^ *:-+: *$/.test(e.align[s]) ? e.align[s] = "center" : /^ *:-+ *$/.test(e.align[s]) ? e.align[s] = "left" : e.align[s] = null;
377
- for (i = e.rows.length, s = 0; s < i; s++)
378
- e.rows[s] = H(e.rows[s], e.header.length).map((p) => ({ text: p }));
379
- for (i = e.header.length, r = 0; r < i; r++)
380
- e.header[r].tokens = this.lexer.inline(e.header[r].text);
381
- for (i = e.rows.length, r = 0; r < i; r++)
382
- for (o = e.rows[r], a = 0; a < o.length; a++)
383
- o[a].tokens = this.lexer.inline(o[a].text);
384
- return e;
385
- }
247
+ table(r) {
248
+ let e = this.rules.block.table.exec(r);
249
+ if (!e || !this.rules.other.tableDelimiter.test(e[2])) return;
250
+ let n = ne(e[1]), s = e[2].replace(this.rules.other.tableAlignChars, "").split("|"), t = e[3]?.trim() ? e[3].replace(this.rules.other.tableRowBlankLine, "").split(`
251
+ `) : [], i = { type: "table", raw: e[0], header: [], align: [], rows: [] };
252
+ if (n.length === s.length) {
253
+ 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);
254
+ for (let l = 0; l < n.length; l++) i.header.push({ text: n[l], tokens: this.lexer.inline(n[l]), header: !0, align: i.align[l] });
255
+ for (let l of t) i.rows.push(ne(l, i.header.length).map((a, o) => ({ text: a, tokens: this.lexer.inline(a), header: !1, align: i.align[o] })));
256
+ return i;
386
257
  }
387
258
  }
388
- lheading(t) {
389
- const n = this.rules.block.lheading.exec(t);
390
- if (n)
391
- return {
392
- type: "heading",
393
- raw: n[0],
394
- depth: n[2].charAt(0) === "=" ? 1 : 2,
395
- text: n[1],
396
- tokens: this.lexer.inline(n[1])
397
- };
398
- }
399
- paragraph(t) {
400
- const n = this.rules.block.paragraph.exec(t);
401
- if (n) {
402
- const e = n[1].charAt(n[1].length - 1) === `
403
- ` ? n[1].slice(0, -1) : n[1];
404
- return {
405
- type: "paragraph",
406
- raw: n[0],
407
- text: e,
408
- tokens: this.lexer.inline(e)
409
- };
259
+ lheading(r) {
260
+ let e = this.rules.block.lheading.exec(r);
261
+ if (e) return { type: "heading", raw: e[0], depth: e[2].charAt(0) === "=" ? 1 : 2, text: e[1], tokens: this.lexer.inline(e[1]) };
262
+ }
263
+ paragraph(r) {
264
+ let e = this.rules.block.paragraph.exec(r);
265
+ if (e) {
266
+ let n = e[1].charAt(e[1].length - 1) === `
267
+ ` ? e[1].slice(0, -1) : e[1];
268
+ return { type: "paragraph", raw: e[0], text: n, tokens: this.lexer.inline(n) };
410
269
  }
411
270
  }
412
- text(t) {
413
- const n = this.rules.block.text.exec(t);
414
- if (n)
415
- return {
416
- type: "text",
417
- raw: n[0],
418
- text: n[0],
419
- tokens: this.lexer.inline(n[0])
420
- };
421
- }
422
- escape(t) {
423
- const n = this.rules.inline.escape.exec(t);
424
- if (n)
425
- return {
426
- type: "escape",
427
- raw: n[0],
428
- text: b(n[1])
429
- };
430
- }
431
- tag(t) {
432
- const n = this.rules.inline.tag.exec(t);
433
- if (n)
434
- return !this.lexer.state.inLink && /^<a /i.test(n[0]) ? this.lexer.state.inLink = !0 : this.lexer.state.inLink && /^<\/a>/i.test(n[0]) && (this.lexer.state.inLink = !1), !this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(n[0]) ? this.lexer.state.inRawBlock = !0 : this.lexer.state.inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(n[0]) && (this.lexer.state.inRawBlock = !1), {
435
- type: this.options.sanitize ? "text" : "html",
436
- raw: n[0],
437
- inLink: this.lexer.state.inLink,
438
- inRawBlock: this.lexer.state.inRawBlock,
439
- block: !1,
440
- text: this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(n[0]) : b(n[0]) : n[0]
441
- };
442
- }
443
- link(t) {
444
- const n = this.rules.inline.link.exec(t);
445
- if (n) {
446
- const e = n[2].trim();
447
- if (!this.options.pedantic && /^</.test(e)) {
448
- if (!/>$/.test(e))
449
- return;
450
- const r = P(e.slice(0, -1), "\\");
451
- if ((e.length - r.length) % 2 === 0)
452
- return;
271
+ text(r) {
272
+ let e = this.rules.block.text.exec(r);
273
+ if (e) return { type: "text", raw: e[0], text: e[0], tokens: this.lexer.inline(e[0]) };
274
+ }
275
+ escape(r) {
276
+ let e = this.rules.inline.escape.exec(r);
277
+ if (e) return { type: "escape", raw: e[0], text: e[1] };
278
+ }
279
+ tag(r) {
280
+ let e = this.rules.inline.tag.exec(r);
281
+ 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] };
282
+ }
283
+ link(r) {
284
+ let e = this.rules.inline.link.exec(r);
285
+ if (e) {
286
+ let n = e[2].trim();
287
+ if (!this.options.pedantic && this.rules.other.startAngleBracket.test(n)) {
288
+ if (!this.rules.other.endAngleBracket.test(n)) return;
289
+ let i = T(n.slice(0, -1), "\\");
290
+ if ((n.length - i.length) % 2 === 0) return;
453
291
  } else {
454
- const r = de(n[2], "()");
455
- if (r > -1) {
456
- const o = (n[0].indexOf("!") === 0 ? 5 : 4) + n[1].length + r;
457
- n[2] = n[2].substring(0, r), n[0] = n[0].substring(0, o).trim(), n[3] = "";
292
+ let i = rt(e[2], "()");
293
+ if (i === -2) return;
294
+ if (i > -1) {
295
+ let l = (e[0].indexOf("!") === 0 ? 5 : 4) + e[1].length + i;
296
+ e[2] = e[2].substring(0, i), e[0] = e[0].substring(0, l).trim(), e[3] = "";
458
297
  }
459
298
  }
460
- let i = n[2], s = "";
299
+ let s = e[2], t = "";
461
300
  if (this.options.pedantic) {
462
- const r = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i);
463
- r && (i = r[1], s = r[3]);
464
- } else
465
- s = n[3] ? n[3].slice(1, -1) : "";
466
- return i = i.trim(), /^</.test(i) && (this.options.pedantic && !/>$/.test(e) ? i = i.slice(1) : i = i.slice(1, -1)), F(n, {
467
- href: i && i.replace(this.rules.inline._escapes, "$1"),
468
- title: s && s.replace(this.rules.inline._escapes, "$1")
469
- }, n[0], this.lexer);
301
+ let i = this.rules.other.pedanticHrefTitle.exec(s);
302
+ i && (s = i[1], t = i[3]);
303
+ } else t = e[3] ? e[3].slice(1, -1) : "";
304
+ return s = s.trim(), this.rules.other.startAngleBracket.test(s) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? s = s.slice(1) : s = s.slice(1, -1)), se(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);
470
305
  }
471
306
  }
472
- reflink(t, n) {
473
- let e;
474
- if ((e = this.rules.inline.reflink.exec(t)) || (e = this.rules.inline.nolink.exec(t))) {
475
- let i = (e[2] || e[1]).replace(/\s+/g, " ");
476
- if (i = n[i.toLowerCase()], !i) {
477
- const s = e[0].charAt(0);
478
- return {
479
- type: "text",
480
- raw: s,
481
- text: s
482
- };
307
+ reflink(r, e) {
308
+ let n;
309
+ if ((n = this.rules.inline.reflink.exec(r)) || (n = this.rules.inline.nolink.exec(r))) {
310
+ let s = (n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "), t = e[s.toLowerCase()];
311
+ if (!t) {
312
+ let i = n[0].charAt(0);
313
+ return { type: "text", raw: i, text: i };
483
314
  }
484
- return F(e, i, e[0], this.lexer);
315
+ return se(n, t, n[0], this.lexer, this.rules);
485
316
  }
486
317
  }
487
- emStrong(t, n, e = "") {
488
- let i = this.rules.inline.emStrong.lDelim.exec(t);
489
- if (!i || i[3] && e.match(/[\p{L}\p{N}]/u)) return;
490
- if (!(i[1] || i[2] || "") || !e || this.rules.inline.punctuation.exec(e)) {
491
- const r = i[0].length - 1;
492
- let a, o, p = r, f = 0;
493
- const k = i[0][0] === "*" ? this.rules.inline.emStrong.rDelimAst : this.rules.inline.emStrong.rDelimUnd;
494
- for (k.lastIndex = 0, n = n.slice(-1 * t.length + r); (i = k.exec(n)) != null; ) {
495
- if (a = i[1] || i[2] || i[3] || i[4] || i[5] || i[6], !a) continue;
496
- if (o = a.length, i[3] || i[4]) {
497
- p += o;
318
+ emStrong(r, e, n = "") {
319
+ let s = this.rules.inline.emStrongLDelim.exec(r);
320
+ if (!(!s || s[3] && n.match(this.rules.other.unicodeAlphaNumeric)) && (!(s[1] || s[2]) || !n || this.rules.inline.punctuation.exec(n))) {
321
+ let t = [...s[0]].length - 1, i, l, a = t, o = 0, c = s[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
322
+ for (c.lastIndex = 0, e = e.slice(-1 * r.length + t); (s = c.exec(e)) != null; ) {
323
+ if (i = s[1] || s[2] || s[3] || s[4] || s[5] || s[6], !i) continue;
324
+ if (l = [...i].length, s[3] || s[4]) {
325
+ a += l;
498
326
  continue;
499
- } else if ((i[5] || i[6]) && r % 3 && !((r + o) % 3)) {
500
- f += o;
327
+ } else if ((s[5] || s[6]) && t % 3 && !((t + l) % 3)) {
328
+ o += l;
501
329
  continue;
502
330
  }
503
- if (p -= o, p > 0) continue;
504
- o = Math.min(o, o + p + f);
505
- const g = t.slice(0, r + i.index + o + 1);
506
- if (Math.min(r, o) % 2) {
507
- const y = g.slice(1, -1);
508
- return {
509
- type: "em",
510
- raw: g,
511
- text: y,
512
- tokens: this.lexer.inlineTokens(y)
513
- };
331
+ if (a -= l, a > 0) continue;
332
+ l = Math.min(l, l + a + o);
333
+ let h = [...s[0]][0].length, k = r.slice(0, t + s.index + h + l);
334
+ if (Math.min(t, l) % 2) {
335
+ let d = k.slice(1, -1);
336
+ return { type: "em", raw: k, text: d, tokens: this.lexer.inlineTokens(d) };
514
337
  }
515
- const c = g.slice(2, -2);
516
- return {
517
- type: "strong",
518
- raw: g,
519
- text: c,
520
- tokens: this.lexer.inlineTokens(c)
521
- };
338
+ let g = k.slice(2, -2);
339
+ return { type: "strong", raw: k, text: g, tokens: this.lexer.inlineTokens(g) };
522
340
  }
523
341
  }
524
342
  }
525
- codespan(t) {
526
- const n = this.rules.inline.code.exec(t);
527
- if (n) {
528
- let e = n[2].replace(/\n/g, " ");
529
- const i = /[^ ]/.test(e), s = /^ /.test(e) && / $/.test(e);
530
- return i && s && (e = e.substring(1, e.length - 1)), e = b(e, !0), {
531
- type: "codespan",
532
- raw: n[0],
533
- text: e
534
- };
343
+ codespan(r) {
344
+ let e = this.rules.inline.code.exec(r);
345
+ if (e) {
346
+ let n = e[2].replace(this.rules.other.newLineCharGlobal, " "), s = this.rules.other.nonSpaceChar.test(n), t = this.rules.other.startingSpaceChar.test(n) && this.rules.other.endingSpaceChar.test(n);
347
+ return s && t && (n = n.substring(1, n.length - 1)), { type: "codespan", raw: e[0], text: n };
535
348
  }
536
349
  }
537
- br(t) {
538
- const n = this.rules.inline.br.exec(t);
539
- if (n)
540
- return {
541
- type: "br",
542
- raw: n[0]
543
- };
544
- }
545
- del(t) {
546
- const n = this.rules.inline.del.exec(t);
547
- if (n)
548
- return {
549
- type: "del",
550
- raw: n[0],
551
- text: n[2],
552
- tokens: this.lexer.inlineTokens(n[2])
553
- };
554
- }
555
- autolink(t, n) {
556
- const e = this.rules.inline.autolink.exec(t);
350
+ br(r) {
351
+ let e = this.rules.inline.br.exec(r);
352
+ if (e) return { type: "br", raw: e[0] };
353
+ }
354
+ del(r) {
355
+ let e = this.rules.inline.del.exec(r);
356
+ if (e) return { type: "del", raw: e[0], text: e[2], tokens: this.lexer.inlineTokens(e[2]) };
357
+ }
358
+ autolink(r) {
359
+ let e = this.rules.inline.autolink.exec(r);
557
360
  if (e) {
558
- let i, s;
559
- return e[2] === "@" ? (i = b(this.options.mangle ? n(e[1]) : e[1]), s = "mailto:" + i) : (i = b(e[1]), s = i), {
560
- type: "link",
561
- raw: e[0],
562
- text: i,
563
- href: s,
564
- tokens: [
565
- {
566
- type: "text",
567
- raw: i,
568
- text: i
569
- }
570
- ]
571
- };
361
+ let n, s;
362
+ return e[2] === "@" ? (n = e[1], s = "mailto:" + n) : (n = e[1], s = n), { type: "link", raw: e[0], text: n, href: s, tokens: [{ type: "text", raw: n, text: n }] };
572
363
  }
573
364
  }
574
- url(t, n) {
365
+ url(r) {
575
366
  let e;
576
- if (e = this.rules.inline.url.exec(t)) {
577
- let i, s;
578
- if (e[2] === "@")
579
- i = b(this.options.mangle ? n(e[0]) : e[0]), s = "mailto:" + i;
367
+ if (e = this.rules.inline.url.exec(r)) {
368
+ let n, s;
369
+ if (e[2] === "@") n = e[0], s = "mailto:" + n;
580
370
  else {
581
- let r;
371
+ let t;
582
372
  do
583
- r = e[0], e[0] = this.rules.inline._backpedal.exec(e[0])[0];
584
- while (r !== e[0]);
585
- i = b(e[0]), e[1] === "www." ? s = "http://" + e[0] : s = e[0];
373
+ t = e[0], e[0] = this.rules.inline._backpedal.exec(e[0])?.[0] ?? "";
374
+ while (t !== e[0]);
375
+ n = e[0], e[1] === "www." ? s = "http://" + e[0] : s = e[0];
586
376
  }
587
- return {
588
- type: "link",
589
- raw: e[0],
590
- text: i,
591
- href: s,
592
- tokens: [
593
- {
594
- type: "text",
595
- raw: i,
596
- text: i
597
- }
598
- ]
599
- };
377
+ return { type: "link", raw: e[0], text: n, href: s, tokens: [{ type: "text", raw: n, text: n }] };
600
378
  }
601
379
  }
602
- inlineText(t, n) {
603
- const e = this.rules.inline.text.exec(t);
380
+ inlineText(r) {
381
+ let e = this.rules.inline.text.exec(r);
604
382
  if (e) {
605
- let i;
606
- return this.lexer.state.inRawBlock ? i = this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(e[0]) : b(e[0]) : e[0] : i = b(this.options.smartypants ? n(e[0]) : e[0]), {
607
- type: "text",
608
- raw: e[0],
609
- text: i
610
- };
383
+ let n = this.lexer.state.inRawBlock;
384
+ return { type: "text", raw: e[0], text: e[0], escaped: n };
611
385
  }
612
386
  }
613
- }
614
- const u = {
615
- newline: /^(?: *(?:\n|$))+/,
616
- code: /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,
617
- fences: /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,
618
- hr: /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,
619
- heading: /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,
620
- blockquote: /^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,
621
- list: /^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,
622
- html: "^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",
623
- def: /^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,
624
- table: D,
625
- lheading: /^((?:(?!^bull ).|\n(?!\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
626
- // regex template, placeholders will be replaced according to different paragraph
627
- // interruption rules of commonmark and the original markdown spec:
628
- _paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,
629
- text: /^[^\n]+/
630
- };
631
- u._label = /(?!\s*\])(?:\\.|[^\[\]\\])+/;
632
- u._title = /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;
633
- u.def = m(u.def).replace("label", u._label).replace("title", u._title).getRegex();
634
- u.bullet = /(?:[*+-]|\d{1,9}[.)])/;
635
- u.listItemStart = m(/^( *)(bull) */).replace("bull", u.bullet).getRegex();
636
- u.list = m(u.list).replace(/bull/g, u.bullet).replace("hr", "\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def", "\\n+(?=" + u.def.source + ")").getRegex();
637
- u._tag = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";
638
- u._comment = /<!--(?!-?>)[\s\S]*?(?:-->|$)/;
639
- u.html = m(u.html, "i").replace("comment", u._comment).replace("tag", u._tag).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
640
- u.lheading = m(u.lheading).replace(/bull/g, u.bullet).getRegex();
641
- u.paragraph = m(u._paragraph).replace("hr", u.hr).replace("heading", " {0,3}#{1,6} ").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", u._tag).getRegex();
642
- u.blockquote = m(u.blockquote).replace("paragraph", u.paragraph).getRegex();
643
- u.normal = { ...u };
644
- u.gfm = {
645
- ...u.normal,
646
- table: "^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"
647
- // Cells
648
- };
649
- u.gfm.table = m(u.gfm.table).replace("hr", u.hr).replace("heading", " {0,3}#{1,6} ").replace("blockquote", " {0,3}>").replace("code", " {4}[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", u._tag).getRegex();
650
- u.gfm.paragraph = m(u._paragraph).replace("hr", u.hr).replace("heading", " {0,3}#{1,6} ").replace("|lheading", "").replace("table", u.gfm.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", u._tag).getRegex();
651
- u.pedantic = {
652
- ...u.normal,
653
- html: m(
654
- `^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`
655
- ).replace("comment", u._comment).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
656
- def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
657
- heading: /^(#{1,6})(.*)(?:\n+|$)/,
658
- fences: D,
659
- // fences not supported
660
- lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
661
- paragraph: m(u.normal._paragraph).replace("hr", u.hr).replace("heading", ` *#{1,6} *[^
662
- ]`).replace("lheading", u.lheading).replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").getRegex()
663
- };
664
- const h = {
665
- escape: /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,
666
- autolink: /^<(scheme:[^\s\x00-\x1f<>]*|email)>/,
667
- url: D,
668
- tag: "^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",
669
- // CDATA section
670
- link: /^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,
671
- reflink: /^!?\[(label)\]\[(ref)\]/,
672
- nolink: /^!?\[(ref)\](?:\[\])?/,
673
- reflinkSearch: "reflink|nolink(?!\\()",
674
- emStrong: {
675
- lDelim: /^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,
676
- // (1) and (2) can only be a Right Delimiter. (3) and (4) can only be Left. (5) and (6) can be either Left or Right.
677
- // | Skip orphan inside strong | Consume to delim | (1) #*** | (2) a***#, a*** | (3) #***a, ***a | (4) ***# | (5) #***# | (6) a***a
678
- rDelimAst: /^[^_*]*?__[^_*]*?\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\*)[punct](\*+)(?=[\s]|$)|[^punct\s](\*+)(?!\*)(?=[punct\s]|$)|(?!\*)[punct\s](\*+)(?=[^punct\s])|[\s](\*+)(?!\*)(?=[punct])|(?!\*)[punct](\*+)(?!\*)(?=[punct])|[^punct\s](\*+)(?=[^punct\s])/,
679
- rDelimUnd: /^[^_*]*?\*\*[^_*]*?_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\s]|$)|[^punct\s](_+)(?!_)(?=[punct\s]|$)|(?!_)[punct\s](_+)(?=[^punct\s])|[\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])/
680
- // ^- Not allowed for _
681
- },
682
- code: /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,
683
- br: /^( {2,}|\\)\n(?!\s*$)/,
684
- del: D,
685
- text: /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,
686
- punctuation: /^((?![*_])[\spunctuation])/
687
- };
688
- h._punctuation = "\\p{P}$+<=>`^|~";
689
- h.punctuation = m(h.punctuation, "u").replace(/punctuation/g, h._punctuation).getRegex();
690
- h.blockSkip = /\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g;
691
- h.anyPunctuation = /\\[punct]/g;
692
- h._escapes = /\\([punct])/g;
693
- h._comment = m(u._comment).replace("(?:-->|$)", "-->").getRegex();
694
- h.emStrong.lDelim = m(h.emStrong.lDelim, "u").replace(/punct/g, h._punctuation).getRegex();
695
- h.emStrong.rDelimAst = m(h.emStrong.rDelimAst, "gu").replace(/punct/g, h._punctuation).getRegex();
696
- h.emStrong.rDelimUnd = m(h.emStrong.rDelimUnd, "gu").replace(/punct/g, h._punctuation).getRegex();
697
- h.anyPunctuation = m(h.anyPunctuation, "gu").replace(/punct/g, h._punctuation).getRegex();
698
- h._escapes = m(h._escapes, "gu").replace(/punct/g, h._punctuation).getRegex();
699
- h._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;
700
- h._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])?)+(?![-_])/;
701
- h.autolink = m(h.autolink).replace("scheme", h._scheme).replace("email", h._email).getRegex();
702
- h._attribute = /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;
703
- h.tag = m(h.tag).replace("comment", h._comment).replace("attribute", h._attribute).getRegex();
704
- h._label = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;
705
- h._href = /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;
706
- h._title = /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;
707
- h.link = m(h.link).replace("label", h._label).replace("href", h._href).replace("title", h._title).getRegex();
708
- h.reflink = m(h.reflink).replace("label", h._label).replace("ref", u._label).getRegex();
709
- h.nolink = m(h.nolink).replace("ref", u._label).getRegex();
710
- h.reflinkSearch = m(h.reflinkSearch, "g").replace("reflink", h.reflink).replace("nolink", h.nolink).getRegex();
711
- h.normal = { ...h };
712
- h.pedantic = {
713
- ...h.normal,
714
- strong: {
715
- start: /^__|\*\*/,
716
- middle: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,
717
- endAst: /\*\*(?!\*)/g,
718
- endUnd: /__(?!_)/g
719
- },
720
- em: {
721
- start: /^_|\*/,
722
- middle: /^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,
723
- endAst: /\*(?!\*)/g,
724
- endUnd: /_(?!_)/g
725
- },
726
- link: m(/^!?\[(label)\]\((.*?)\)/).replace("label", h._label).getRegex(),
727
- reflink: m(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", h._label).getRegex()
728
- };
729
- h.gfm = {
730
- ...h.normal,
731
- escape: m(h.escape).replace("])", "~|])").getRegex(),
732
- _extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,
733
- url: /^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,
734
- _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
735
- del: /^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,
736
- text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/
737
- };
738
- h.gfm.url = m(h.gfm.url, "i").replace("email", h.gfm._extended_email).getRegex();
739
- h.breaks = {
740
- ...h.gfm,
741
- br: m(h.br).replace("{2,}", "*").getRegex(),
742
- text: m(h.gfm.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
743
- };
744
- function xe(l) {
745
- return l.replace(/---/g, "—").replace(/--/g, "–").replace(/(^|[-\u2014/(\[{"\s])'/g, "$1‘").replace(/'/g, "’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g, "$1“").replace(/"/g, "”").replace(/\.{3}/g, "…");
746
- }
747
- function X(l) {
748
- let t = "", n, e;
749
- const i = l.length;
750
- for (n = 0; n < i; n++)
751
- e = l.charCodeAt(n), Math.random() > 0.5 && (e = "x" + e.toString(16)), t += "&#" + e + ";";
752
- return t;
753
- }
754
- class S {
755
- constructor(t) {
756
- this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = t || A, this.options.tokenizer = this.options.tokenizer || new Z(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
757
- inLink: !1,
758
- inRawBlock: !1,
759
- top: !0
760
- };
761
- const n = {
762
- block: u.normal,
763
- inline: h.normal
764
- };
765
- this.options.pedantic ? (n.block = u.pedantic, n.inline = h.pedantic) : this.options.gfm && (n.block = u.gfm, this.options.breaks ? n.inline = h.breaks : n.inline = h.gfm), this.tokenizer.rules = n;
387
+ }, w = class M {
388
+ tokens;
389
+ options;
390
+ state;
391
+ tokenizer;
392
+ inlineQueue;
393
+ constructor(e) {
394
+ this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || S, this.options.tokenizer = this.options.tokenizer || new v(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 };
395
+ let n = { other: x, block: C.normal, inline: z.normal };
396
+ this.options.pedantic ? (n.block = C.pedantic, n.inline = z.pedantic) : this.options.gfm && (n.block = C.gfm, this.options.breaks ? n.inline = z.breaks : n.inline = z.gfm), this.tokenizer.rules = n;
766
397
  }
767
- /**
768
- * Expose Rules
769
- */
770
398
  static get rules() {
771
- return {
772
- block: u,
773
- inline: h
774
- };
399
+ return { block: C, inline: z };
775
400
  }
776
- /**
777
- * Static Lex Method
778
- */
779
- static lex(t, n) {
780
- return new S(n).lex(t);
781
- }
782
- /**
783
- * Static Lex Inline Method
784
- */
785
- static lexInline(t, n) {
786
- return new S(n).inlineTokens(t);
787
- }
788
- /**
789
- * Preprocessing
790
- */
791
- lex(t) {
792
- t = t.replace(/\r\n|\r/g, `
793
- `), this.blockTokens(t, this.tokens);
794
- let n;
795
- for (; n = this.inlineQueue.shift(); )
796
- this.inlineTokens(n.src, n.tokens);
797
- return this.tokens;
798
- }
799
- /**
800
- * Lexing
801
- */
802
- blockTokens(t, n = []) {
803
- this.options.pedantic ? t = t.replace(/\t/g, " ").replace(/^ +$/gm, "") : t = t.replace(/^( *)(\t+)/gm, (a, o, p) => o + " ".repeat(p.length));
804
- let e, i, s, r;
805
- for (; t; )
806
- if (!(this.options.extensions && this.options.extensions.block && this.options.extensions.block.some((a) => (e = a.call({ lexer: this }, t, n)) ? (t = t.substring(e.raw.length), n.push(e), !0) : !1))) {
807
- if (e = this.tokenizer.space(t)) {
808
- t = t.substring(e.raw.length), e.raw.length === 1 && n.length > 0 ? n[n.length - 1].raw += `
809
- ` : n.push(e);
810
- continue;
811
- }
812
- if (e = this.tokenizer.code(t)) {
813
- t = t.substring(e.raw.length), i = n[n.length - 1], i && (i.type === "paragraph" || i.type === "text") ? (i.raw += `
814
- ` + e.raw, i.text += `
815
- ` + e.text, this.inlineQueue[this.inlineQueue.length - 1].src = i.text) : n.push(e);
816
- continue;
817
- }
818
- if (e = this.tokenizer.fences(t)) {
819
- t = t.substring(e.raw.length), n.push(e);
820
- continue;
821
- }
822
- if (e = this.tokenizer.heading(t)) {
823
- t = t.substring(e.raw.length), n.push(e);
824
- continue;
825
- }
826
- if (e = this.tokenizer.hr(t)) {
827
- t = t.substring(e.raw.length), n.push(e);
828
- continue;
829
- }
830
- if (e = this.tokenizer.blockquote(t)) {
831
- t = t.substring(e.raw.length), n.push(e);
832
- continue;
833
- }
834
- if (e = this.tokenizer.list(t)) {
835
- t = t.substring(e.raw.length), n.push(e);
836
- continue;
837
- }
838
- if (e = this.tokenizer.html(t)) {
839
- t = t.substring(e.raw.length), n.push(e);
840
- continue;
841
- }
842
- if (e = this.tokenizer.def(t)) {
843
- t = t.substring(e.raw.length), i = n[n.length - 1], i && (i.type === "paragraph" || i.type === "text") ? (i.raw += `
844
- ` + e.raw, i.text += `
845
- ` + e.raw, this.inlineQueue[this.inlineQueue.length - 1].src = i.text) : this.tokens.links[e.tag] || (this.tokens.links[e.tag] = {
846
- href: e.href,
847
- title: e.title
848
- });
849
- continue;
850
- }
851
- if (e = this.tokenizer.table(t)) {
852
- t = t.substring(e.raw.length), n.push(e);
853
- continue;
854
- }
855
- if (e = this.tokenizer.lheading(t)) {
856
- t = t.substring(e.raw.length), n.push(e);
857
- continue;
858
- }
859
- if (s = t, this.options.extensions && this.options.extensions.startBlock) {
860
- let a = 1 / 0;
861
- const o = t.slice(1);
862
- let p;
863
- this.options.extensions.startBlock.forEach(function(f) {
864
- p = f.call({ lexer: this }, o), typeof p == "number" && p >= 0 && (a = Math.min(a, p));
865
- }), a < 1 / 0 && a >= 0 && (s = t.substring(0, a + 1));
866
- }
867
- if (this.state.top && (e = this.tokenizer.paragraph(s))) {
868
- i = n[n.length - 1], r && i.type === "paragraph" ? (i.raw += `
869
- ` + e.raw, i.text += `
870
- ` + e.text, this.inlineQueue.pop(), this.inlineQueue[this.inlineQueue.length - 1].src = i.text) : n.push(e), r = s.length !== t.length, t = t.substring(e.raw.length);
871
- continue;
872
- }
873
- if (e = this.tokenizer.text(t)) {
874
- t = t.substring(e.raw.length), i = n[n.length - 1], i && i.type === "text" ? (i.raw += `
875
- ` + e.raw, i.text += `
876
- ` + e.text, this.inlineQueue.pop(), this.inlineQueue[this.inlineQueue.length - 1].src = i.text) : n.push(e);
877
- continue;
878
- }
879
- if (t) {
880
- const a = "Infinite loop on byte: " + t.charCodeAt(0);
881
- if (this.options.silent) {
882
- console.error(a);
883
- break;
884
- } else
885
- throw new Error(a);
886
- }
401
+ static lex(e, n) {
402
+ return new M(n).lex(e);
403
+ }
404
+ static lexInline(e, n) {
405
+ return new M(n).inlineTokens(e);
406
+ }
407
+ lex(e) {
408
+ e = e.replace(x.carriageReturn, `
409
+ `), this.blockTokens(e, this.tokens);
410
+ for (let n = 0; n < this.inlineQueue.length; n++) {
411
+ let s = this.inlineQueue[n];
412
+ this.inlineTokens(s.src, s.tokens);
413
+ }
414
+ return this.inlineQueue = [], this.tokens;
415
+ }
416
+ blockTokens(e, n = [], s = !1) {
417
+ for (this.options.pedantic && (e = e.replace(x.tabCharGlobal, " ").replace(x.spaceLine, "")); e; ) {
418
+ let t;
419
+ if (this.options.extensions?.block?.some((l) => (t = l.call({ lexer: this }, e, n)) ? (e = e.substring(t.raw.length), n.push(t), !0) : !1)) continue;
420
+ if (t = this.tokenizer.space(e)) {
421
+ e = e.substring(t.raw.length);
422
+ let l = n.at(-1);
423
+ t.raw.length === 1 && l !== void 0 ? l.raw += `
424
+ ` : n.push(t);
425
+ continue;
426
+ }
427
+ if (t = this.tokenizer.code(e)) {
428
+ e = e.substring(t.raw.length);
429
+ let l = n.at(-1);
430
+ l?.type === "paragraph" || l?.type === "text" ? (l.raw += `
431
+ ` + t.raw, l.text += `
432
+ ` + t.text, this.inlineQueue.at(-1).src = l.text) : n.push(t);
433
+ continue;
434
+ }
435
+ if (t = this.tokenizer.fences(e)) {
436
+ e = e.substring(t.raw.length), n.push(t);
437
+ continue;
438
+ }
439
+ if (t = this.tokenizer.heading(e)) {
440
+ e = e.substring(t.raw.length), n.push(t);
441
+ continue;
442
+ }
443
+ if (t = this.tokenizer.hr(e)) {
444
+ e = e.substring(t.raw.length), n.push(t);
445
+ continue;
446
+ }
447
+ if (t = this.tokenizer.blockquote(e)) {
448
+ e = e.substring(t.raw.length), n.push(t);
449
+ continue;
450
+ }
451
+ if (t = this.tokenizer.list(e)) {
452
+ e = e.substring(t.raw.length), n.push(t);
453
+ continue;
454
+ }
455
+ if (t = this.tokenizer.html(e)) {
456
+ e = e.substring(t.raw.length), n.push(t);
457
+ continue;
458
+ }
459
+ if (t = this.tokenizer.def(e)) {
460
+ e = e.substring(t.raw.length);
461
+ let l = n.at(-1);
462
+ l?.type === "paragraph" || l?.type === "text" ? (l.raw += `
463
+ ` + t.raw, l.text += `
464
+ ` + t.raw, this.inlineQueue.at(-1).src = l.text) : this.tokens.links[t.tag] || (this.tokens.links[t.tag] = { href: t.href, title: t.title });
465
+ continue;
466
+ }
467
+ if (t = this.tokenizer.table(e)) {
468
+ e = e.substring(t.raw.length), n.push(t);
469
+ continue;
470
+ }
471
+ if (t = this.tokenizer.lheading(e)) {
472
+ e = e.substring(t.raw.length), n.push(t);
473
+ continue;
474
+ }
475
+ let i = e;
476
+ if (this.options.extensions?.startBlock) {
477
+ let l = 1 / 0, a = e.slice(1), o;
478
+ this.options.extensions.startBlock.forEach((c) => {
479
+ o = c.call({ lexer: this }, a), typeof o == "number" && o >= 0 && (l = Math.min(l, o));
480
+ }), l < 1 / 0 && l >= 0 && (i = e.substring(0, l + 1));
481
+ }
482
+ if (this.state.top && (t = this.tokenizer.paragraph(i))) {
483
+ let l = n.at(-1);
484
+ s && l?.type === "paragraph" ? (l.raw += `
485
+ ` + t.raw, l.text += `
486
+ ` + t.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = l.text) : n.push(t), s = i.length !== e.length, e = e.substring(t.raw.length);
487
+ continue;
488
+ }
489
+ if (t = this.tokenizer.text(e)) {
490
+ e = e.substring(t.raw.length);
491
+ let l = n.at(-1);
492
+ l?.type === "text" ? (l.raw += `
493
+ ` + t.raw, l.text += `
494
+ ` + t.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = l.text) : n.push(t);
495
+ continue;
887
496
  }
497
+ if (e) {
498
+ let l = "Infinite loop on byte: " + e.charCodeAt(0);
499
+ if (this.options.silent) {
500
+ console.error(l);
501
+ break;
502
+ } else throw new Error(l);
503
+ }
504
+ }
888
505
  return this.state.top = !0, n;
889
506
  }
890
- inline(t, n = []) {
891
- return this.inlineQueue.push({ src: t, tokens: n }), n;
507
+ inline(e, n = []) {
508
+ return this.inlineQueue.push({ src: e, tokens: n }), n;
892
509
  }
893
- /**
894
- * Lexing/Compiling
895
- */
896
- inlineTokens(t, n = []) {
897
- let e, i, s, r = t, a, o, p;
510
+ inlineTokens(e, n = []) {
511
+ let s = e, t = null;
898
512
  if (this.tokens.links) {
899
- const f = Object.keys(this.tokens.links);
900
- if (f.length > 0)
901
- for (; (a = this.tokenizer.rules.inline.reflinkSearch.exec(r)) != null; )
902
- f.includes(a[0].slice(a[0].lastIndexOf("[") + 1, -1)) && (r = r.slice(0, a.index) + "[" + "a".repeat(a[0].length - 2) + "]" + r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
513
+ let a = Object.keys(this.tokens.links);
514
+ 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));
903
515
  }
904
- for (; (a = this.tokenizer.rules.inline.blockSkip.exec(r)) != null; )
905
- r = r.slice(0, a.index) + "[" + "a".repeat(a[0].length - 2) + "]" + r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
906
- for (; (a = this.tokenizer.rules.inline.anyPunctuation.exec(r)) != null; )
907
- r = r.slice(0, a.index) + "++" + r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
908
- for (; t; )
909
- if (o || (p = ""), o = !1, !(this.options.extensions && this.options.extensions.inline && this.options.extensions.inline.some((f) => (e = f.call({ lexer: this }, t, n)) ? (t = t.substring(e.raw.length), n.push(e), !0) : !1))) {
910
- if (e = this.tokenizer.escape(t)) {
911
- t = t.substring(e.raw.length), n.push(e);
912
- continue;
913
- }
914
- if (e = this.tokenizer.tag(t)) {
915
- t = t.substring(e.raw.length), i = n[n.length - 1], i && e.type === "text" && i.type === "text" ? (i.raw += e.raw, i.text += e.text) : n.push(e);
916
- continue;
917
- }
918
- if (e = this.tokenizer.link(t)) {
919
- t = t.substring(e.raw.length), n.push(e);
920
- continue;
921
- }
922
- if (e = this.tokenizer.reflink(t, this.tokens.links)) {
923
- t = t.substring(e.raw.length), i = n[n.length - 1], i && e.type === "text" && i.type === "text" ? (i.raw += e.raw, i.text += e.text) : n.push(e);
924
- continue;
925
- }
926
- if (e = this.tokenizer.emStrong(t, r, p)) {
927
- t = t.substring(e.raw.length), n.push(e);
928
- continue;
929
- }
930
- if (e = this.tokenizer.codespan(t)) {
931
- t = t.substring(e.raw.length), n.push(e);
932
- continue;
933
- }
934
- if (e = this.tokenizer.br(t)) {
935
- t = t.substring(e.raw.length), n.push(e);
936
- continue;
937
- }
938
- if (e = this.tokenizer.del(t)) {
939
- t = t.substring(e.raw.length), n.push(e);
940
- continue;
941
- }
942
- if (e = this.tokenizer.autolink(t, X)) {
943
- t = t.substring(e.raw.length), n.push(e);
944
- continue;
945
- }
946
- if (!this.state.inLink && (e = this.tokenizer.url(t, X))) {
947
- t = t.substring(e.raw.length), n.push(e);
948
- continue;
949
- }
950
- if (s = t, this.options.extensions && this.options.extensions.startInline) {
951
- let f = 1 / 0;
952
- const k = t.slice(1);
953
- let g;
954
- this.options.extensions.startInline.forEach(function(c) {
955
- g = c.call({ lexer: this }, k), typeof g == "number" && g >= 0 && (f = Math.min(f, g));
956
- }), f < 1 / 0 && f >= 0 && (s = t.substring(0, f + 1));
957
- }
958
- if (e = this.tokenizer.inlineText(s, xe)) {
959
- t = t.substring(e.raw.length), e.raw.slice(-1) !== "_" && (p = e.raw.slice(-1)), o = !0, i = n[n.length - 1], i && i.type === "text" ? (i.raw += e.raw, i.text += e.text) : n.push(e);
960
- continue;
961
- }
962
- if (t) {
963
- const f = "Infinite loop on byte: " + t.charCodeAt(0);
964
- if (this.options.silent) {
965
- console.error(f);
966
- break;
967
- } else
968
- throw new Error(f);
969
- }
516
+ for (; (t = this.tokenizer.rules.inline.anyPunctuation.exec(s)) != null; ) s = s.slice(0, t.index) + "++" + s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
517
+ for (; (t = this.tokenizer.rules.inline.blockSkip.exec(s)) != null; ) s = s.slice(0, t.index) + "[" + "a".repeat(t[0].length - 2) + "]" + s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
518
+ let i = !1, l = "";
519
+ for (; e; ) {
520
+ i || (l = ""), i = !1;
521
+ let a;
522
+ if (this.options.extensions?.inline?.some((c) => (a = c.call({ lexer: this }, e, n)) ? (e = e.substring(a.raw.length), n.push(a), !0) : !1)) continue;
523
+ if (a = this.tokenizer.escape(e)) {
524
+ e = e.substring(a.raw.length), n.push(a);
525
+ continue;
970
526
  }
527
+ if (a = this.tokenizer.tag(e)) {
528
+ e = e.substring(a.raw.length), n.push(a);
529
+ continue;
530
+ }
531
+ if (a = this.tokenizer.link(e)) {
532
+ e = e.substring(a.raw.length), n.push(a);
533
+ continue;
534
+ }
535
+ if (a = this.tokenizer.reflink(e, this.tokens.links)) {
536
+ e = e.substring(a.raw.length);
537
+ let c = n.at(-1);
538
+ a.type === "text" && c?.type === "text" ? (c.raw += a.raw, c.text += a.text) : n.push(a);
539
+ continue;
540
+ }
541
+ if (a = this.tokenizer.emStrong(e, s, l)) {
542
+ e = e.substring(a.raw.length), n.push(a);
543
+ continue;
544
+ }
545
+ if (a = this.tokenizer.codespan(e)) {
546
+ e = e.substring(a.raw.length), n.push(a);
547
+ continue;
548
+ }
549
+ if (a = this.tokenizer.br(e)) {
550
+ e = e.substring(a.raw.length), n.push(a);
551
+ continue;
552
+ }
553
+ if (a = this.tokenizer.del(e)) {
554
+ e = e.substring(a.raw.length), n.push(a);
555
+ continue;
556
+ }
557
+ if (a = this.tokenizer.autolink(e)) {
558
+ e = e.substring(a.raw.length), n.push(a);
559
+ continue;
560
+ }
561
+ if (!this.state.inLink && (a = this.tokenizer.url(e))) {
562
+ e = e.substring(a.raw.length), n.push(a);
563
+ continue;
564
+ }
565
+ let o = e;
566
+ if (this.options.extensions?.startInline) {
567
+ let c = 1 / 0, h = e.slice(1), k;
568
+ this.options.extensions.startInline.forEach((g) => {
569
+ k = g.call({ lexer: this }, h), typeof k == "number" && k >= 0 && (c = Math.min(c, k));
570
+ }), c < 1 / 0 && c >= 0 && (o = e.substring(0, c + 1));
571
+ }
572
+ if (a = this.tokenizer.inlineText(o)) {
573
+ e = e.substring(a.raw.length), a.raw.slice(-1) !== "_" && (l = a.raw.slice(-1)), i = !0;
574
+ let c = n.at(-1);
575
+ c?.type === "text" ? (c.raw += a.raw, c.text += a.text) : n.push(a);
576
+ continue;
577
+ }
578
+ if (e) {
579
+ let c = "Infinite loop on byte: " + e.charCodeAt(0);
580
+ if (this.options.silent) {
581
+ console.error(c);
582
+ break;
583
+ } else throw new Error(c);
584
+ }
585
+ }
971
586
  return n;
972
587
  }
973
- }
974
- class B {
975
- constructor(t) {
976
- this.options = t || A;
977
- }
978
- code(t, n, e) {
979
- const i = (n || "").match(/\S*/)[0];
980
- if (this.options.highlight) {
981
- const s = this.options.highlight(t, i);
982
- s != null && s !== t && (e = !0, t = s);
983
- }
984
- return t = t.replace(/\n$/, "") + `
985
- `, i ? '<pre><code class="' + this.options.langPrefix + b(i) + '">' + (e ? t : b(t, !0)) + `</code></pre>
986
- ` : "<pre><code>" + (e ? t : b(t, !0)) + `</code></pre>
588
+ }, L = class {
589
+ options;
590
+ parser;
591
+ constructor(r) {
592
+ this.options = r || S;
593
+ }
594
+ space(r) {
595
+ return "";
596
+ }
597
+ code({ text: r, lang: e, escaped: n }) {
598
+ let s = (e || "").match(x.notSpaceStart)?.[0], t = r.replace(x.endingNewline, "") + `
599
+ `;
600
+ return s ? '<pre><code class="language-' + m(s) + '">' + (n ? t : m(t, !0)) + `</code></pre>
601
+ ` : "<pre><code>" + (n ? t : m(t, !0)) + `</code></pre>
987
602
  `;
988
603
  }
989
- /**
990
- * @param {string} quote
991
- */
992
- blockquote(t) {
604
+ blockquote({ tokens: r }) {
993
605
  return `<blockquote>
994
- ${t}</blockquote>
606
+ ${this.parser.parse(r)}</blockquote>
995
607
  `;
996
608
  }
997
- html(t, n) {
998
- return t;
999
- }
1000
- /**
1001
- * @param {string} text
1002
- * @param {string} level
1003
- * @param {string} raw
1004
- * @param {any} slugger
1005
- */
1006
- heading(t, n, e, i) {
1007
- if (this.options.headerIds) {
1008
- const s = this.options.headerPrefix + i.slug(e);
1009
- return `<h${n} id="${s}">${t}</h${n}>
1010
- `;
1011
- }
1012
- return `<h${n}>${t}</h${n}>
609
+ html({ text: r }) {
610
+ return r;
611
+ }
612
+ heading({ tokens: r, depth: e }) {
613
+ return `<h${e}>${this.parser.parseInline(r)}</h${e}>
1013
614
  `;
1014
615
  }
1015
- hr() {
1016
- return this.options.xhtml ? `<hr/>
1017
- ` : `<hr>
616
+ hr(r) {
617
+ return `<hr>
1018
618
  `;
1019
619
  }
1020
- list(t, n, e) {
1021
- const i = n ? "ol" : "ul", s = n && e !== 1 ? ' start="' + e + '"' : "";
1022
- return "<" + i + s + `>
1023
- ` + t + "</" + i + `>
620
+ list(r) {
621
+ let e = r.ordered, n = r.start, s = "";
622
+ for (let l = 0; l < r.items.length; l++) {
623
+ let a = r.items[l];
624
+ s += this.listitem(a);
625
+ }
626
+ let t = e ? "ol" : "ul", i = e && n !== 1 ? ' start="' + n + '"' : "";
627
+ return "<" + t + i + `>
628
+ ` + s + "</" + t + `>
1024
629
  `;
1025
630
  }
1026
- /**
1027
- * @param {string} text
1028
- */
1029
- listitem(t) {
1030
- return `<li>${t}</li>
631
+ listitem(r) {
632
+ let e = "";
633
+ if (r.task) {
634
+ let n = this.checkbox({ checked: !!r.checked });
635
+ r.loose ? r.tokens[0]?.type === "paragraph" ? (r.tokens[0].text = n + " " + r.tokens[0].text, r.tokens[0].tokens && r.tokens[0].tokens.length > 0 && r.tokens[0].tokens[0].type === "text" && (r.tokens[0].tokens[0].text = n + " " + m(r.tokens[0].tokens[0].text), r.tokens[0].tokens[0].escaped = !0)) : r.tokens.unshift({ type: "text", raw: n + " ", text: n + " ", escaped: !0 }) : e += n + " ";
636
+ }
637
+ return e += this.parser.parse(r.tokens, !!r.loose), `<li>${e}</li>
1031
638
  `;
1032
639
  }
1033
- checkbox(t) {
1034
- return "<input " + (t ? 'checked="" ' : "") + 'disabled="" type="checkbox"' + (this.options.xhtml ? " /" : "") + "> ";
640
+ checkbox({ checked: r }) {
641
+ return "<input " + (r ? 'checked="" ' : "") + 'disabled="" type="checkbox">';
1035
642
  }
1036
- /**
1037
- * @param {string} text
1038
- */
1039
- paragraph(t) {
1040
- return `<p>${t}</p>
643
+ paragraph({ tokens: r }) {
644
+ return `<p>${this.parser.parseInline(r)}</p>
1041
645
  `;
1042
646
  }
1043
- /**
1044
- * @param {string} header
1045
- * @param {string} body
1046
- */
1047
- table(t, n) {
1048
- return n && (n = `<tbody>${n}</tbody>`), `<table>
647
+ table(r) {
648
+ let e = "", n = "";
649
+ for (let t = 0; t < r.header.length; t++) n += this.tablecell(r.header[t]);
650
+ e += this.tablerow({ text: n });
651
+ let s = "";
652
+ for (let t = 0; t < r.rows.length; t++) {
653
+ let i = r.rows[t];
654
+ n = "";
655
+ for (let l = 0; l < i.length; l++) n += this.tablecell(i[l]);
656
+ s += this.tablerow({ text: n });
657
+ }
658
+ return s && (s = `<tbody>${s}</tbody>`), `<table>
1049
659
  <thead>
1050
- ` + t + `</thead>
1051
- ` + n + `</table>
660
+ ` + e + `</thead>
661
+ ` + s + `</table>
1052
662
  `;
1053
663
  }
1054
- /**
1055
- * @param {string} content
1056
- */
1057
- tablerow(t) {
664
+ tablerow({ text: r }) {
1058
665
  return `<tr>
1059
- ${t}</tr>
666
+ ${r}</tr>
1060
667
  `;
1061
668
  }
1062
- tablecell(t, n) {
1063
- const e = n.header ? "th" : "td";
1064
- return (n.align ? `<${e} align="${n.align}">` : `<${e}>`) + t + `</${e}>
669
+ tablecell(r) {
670
+ let e = this.parser.parseInline(r.tokens), n = r.header ? "th" : "td";
671
+ return (r.align ? `<${n} align="${r.align}">` : `<${n}>`) + e + `</${n}>
1065
672
  `;
1066
673
  }
1067
- /**
1068
- * span level renderer
1069
- * @param {string} text
1070
- */
1071
- strong(t) {
1072
- return `<strong>${t}</strong>`;
1073
- }
1074
- /**
1075
- * @param {string} text
1076
- */
1077
- em(t) {
1078
- return `<em>${t}</em>`;
1079
- }
1080
- /**
1081
- * @param {string} text
1082
- */
1083
- codespan(t) {
1084
- return `<code>${t}</code>`;
674
+ strong({ tokens: r }) {
675
+ return `<strong>${this.parser.parseInline(r)}</strong>`;
1085
676
  }
1086
- br() {
1087
- return this.options.xhtml ? "<br/>" : "<br>";
1088
- }
1089
- /**
1090
- * @param {string} text
1091
- */
1092
- del(t) {
1093
- return `<del>${t}</del>`;
1094
- }
1095
- /**
1096
- * @param {string} href
1097
- * @param {string} title
1098
- * @param {string} text
1099
- */
1100
- link(t, n, e) {
1101
- if (t = N(this.options.sanitize, this.options.baseUrl, t), t === null)
1102
- return e;
1103
- let i = '<a href="' + t + '"';
1104
- return n && (i += ' title="' + n + '"'), i += ">" + e + "</a>", i;
1105
- }
1106
- /**
1107
- * @param {string} href
1108
- * @param {string} title
1109
- * @param {string} text
1110
- */
1111
- image(t, n, e) {
1112
- if (t = N(this.options.sanitize, this.options.baseUrl, t), t === null)
1113
- return e;
1114
- let i = `<img src="${t}" alt="${e}"`;
1115
- return n && (i += ` title="${n}"`), i += this.options.xhtml ? "/>" : ">", i;
1116
- }
1117
- text(t) {
1118
- return t;
677
+ em({ tokens: r }) {
678
+ return `<em>${this.parser.parseInline(r)}</em>`;
1119
679
  }
1120
- }
1121
- class O {
1122
- // no need for block level renderers
1123
- strong(t) {
1124
- return t;
680
+ codespan({ text: r }) {
681
+ return `<code>${m(r, !0)}</code>`;
682
+ }
683
+ br(r) {
684
+ return "<br>";
685
+ }
686
+ del({ tokens: r }) {
687
+ return `<del>${this.parser.parseInline(r)}</del>`;
688
+ }
689
+ link({ href: r, title: e, tokens: n }) {
690
+ let s = this.parser.parseInline(n), t = re(r);
691
+ if (t === null) return s;
692
+ r = t;
693
+ let i = '<a href="' + r + '"';
694
+ return e && (i += ' title="' + m(e) + '"'), i += ">" + s + "</a>", i;
695
+ }
696
+ image({ href: r, title: e, text: n, tokens: s }) {
697
+ s && (n = this.parser.parseInline(s, this.parser.textRenderer));
698
+ let t = re(r);
699
+ if (t === null) return m(n);
700
+ r = t;
701
+ let i = `<img src="${r}" alt="${n}"`;
702
+ return e && (i += ` title="${m(e)}"`), i += ">", i;
703
+ }
704
+ text(r) {
705
+ return "tokens" in r && r.tokens ? this.parser.parseInline(r.tokens) : "escaped" in r && r.escaped ? r.text : m(r.text);
1125
706
  }
1126
- em(t) {
1127
- return t;
707
+ }, J = class {
708
+ strong({ text: r }) {
709
+ return r;
1128
710
  }
1129
- codespan(t) {
1130
- return t;
711
+ em({ text: r }) {
712
+ return r;
1131
713
  }
1132
- del(t) {
1133
- return t;
714
+ codespan({ text: r }) {
715
+ return r;
1134
716
  }
1135
- html(t) {
1136
- return t;
717
+ del({ text: r }) {
718
+ return r;
1137
719
  }
1138
- text(t) {
1139
- return t;
720
+ html({ text: r }) {
721
+ return r;
1140
722
  }
1141
- link(t, n, e) {
1142
- return "" + e;
723
+ text({ text: r }) {
724
+ return r;
1143
725
  }
1144
- image(t, n, e) {
1145
- return "" + e;
726
+ link({ text: r }) {
727
+ return "" + r;
728
+ }
729
+ image({ text: r }) {
730
+ return "" + r;
1146
731
  }
1147
732
  br() {
1148
733
  return "";
1149
734
  }
1150
- }
1151
- class j {
1152
- constructor() {
1153
- this.seen = {};
1154
- }
1155
- /**
1156
- * @param {string} value
1157
- */
1158
- serialize(t) {
1159
- return t.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig, "").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g, "").replace(/\s/g, "-");
1160
- }
1161
- /**
1162
- * Finds the next safe (unique) slug to use
1163
- * @param {string} originalSlug
1164
- * @param {boolean} isDryRun
1165
- */
1166
- getNextSafeSlug(t, n) {
1167
- let e = t, i = 0;
1168
- if (this.seen.hasOwnProperty(e)) {
1169
- i = this.seen[t];
1170
- do
1171
- i++, e = t + "-" + i;
1172
- while (this.seen.hasOwnProperty(e));
1173
- }
1174
- return n || (this.seen[t] = i, this.seen[e] = 0), e;
1175
- }
1176
- /**
1177
- * Convert string to unique id
1178
- * @param {object} [options]
1179
- * @param {boolean} [options.dryrun] Generates the next unique slug without
1180
- * updating the internal accumulator.
1181
- */
1182
- slug(t, n = {}) {
1183
- const e = this.serialize(t);
1184
- return this.getNextSafeSlug(e, n.dryrun);
1185
- }
1186
- }
1187
- class T {
1188
- constructor(t) {
1189
- this.options = t || A, this.options.renderer = this.options.renderer || new B(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.textRenderer = new O(), this.slugger = new j();
1190
- }
1191
- /**
1192
- * Static Parse Method
1193
- */
1194
- static parse(t, n) {
1195
- return new T(n).parse(t);
1196
- }
1197
- /**
1198
- * Static Parse Inline Method
1199
- */
1200
- static parseInline(t, n) {
1201
- return new T(n).parseInline(t);
1202
- }
1203
- /**
1204
- * Parse Loop
1205
- */
1206
- parse(t, n = !0) {
1207
- let e = "", i, s, r, a, o, p, f, k, g, c, y, _, I, x, w, v, R, $, z;
1208
- const E = t.length;
1209
- for (i = 0; i < E; i++) {
1210
- if (c = t[i], this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[c.type] && (z = this.options.extensions.renderers[c.type].call({ parser: this }, c), z !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "paragraph", "text"].includes(c.type))) {
1211
- e += z || "";
1212
- continue;
735
+ }, y = class N {
736
+ options;
737
+ renderer;
738
+ textRenderer;
739
+ constructor(e) {
740
+ this.options = e || S, this.options.renderer = this.options.renderer || new L(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new J();
741
+ }
742
+ static parse(e, n) {
743
+ return new N(n).parse(e);
744
+ }
745
+ static parseInline(e, n) {
746
+ return new N(n).parseInline(e);
747
+ }
748
+ parse(e, n = !0) {
749
+ let s = "";
750
+ for (let t = 0; t < e.length; t++) {
751
+ let i = e[t];
752
+ if (this.options.extensions?.renderers?.[i.type]) {
753
+ let a = i, o = this.options.extensions.renderers[a.type].call({ parser: this }, a);
754
+ if (o !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "paragraph", "text"].includes(a.type)) {
755
+ s += o || "";
756
+ continue;
757
+ }
1213
758
  }
1214
- switch (c.type) {
1215
- case "space":
759
+ let l = i;
760
+ switch (l.type) {
761
+ case "space": {
762
+ s += this.renderer.space(l);
1216
763
  continue;
764
+ }
1217
765
  case "hr": {
1218
- e += this.renderer.hr();
766
+ s += this.renderer.hr(l);
1219
767
  continue;
1220
768
  }
1221
769
  case "heading": {
1222
- e += this.renderer.heading(
1223
- this.parseInline(c.tokens),
1224
- c.depth,
1225
- Y(this.parseInline(c.tokens, this.textRenderer)),
1226
- this.slugger
1227
- );
770
+ s += this.renderer.heading(l);
1228
771
  continue;
1229
772
  }
1230
773
  case "code": {
1231
- e += this.renderer.code(
1232
- c.text,
1233
- c.lang,
1234
- c.escaped
1235
- );
774
+ s += this.renderer.code(l);
1236
775
  continue;
1237
776
  }
1238
777
  case "table": {
1239
- for (k = "", f = "", a = c.header.length, s = 0; s < a; s++)
1240
- f += this.renderer.tablecell(
1241
- this.parseInline(c.header[s].tokens),
1242
- { header: !0, align: c.align[s] }
1243
- );
1244
- for (k += this.renderer.tablerow(f), g = "", a = c.rows.length, s = 0; s < a; s++) {
1245
- for (p = c.rows[s], f = "", o = p.length, r = 0; r < o; r++)
1246
- f += this.renderer.tablecell(
1247
- this.parseInline(p[r].tokens),
1248
- { header: !1, align: c.align[r] }
1249
- );
1250
- g += this.renderer.tablerow(f);
1251
- }
1252
- e += this.renderer.table(k, g);
778
+ s += this.renderer.table(l);
1253
779
  continue;
1254
780
  }
1255
781
  case "blockquote": {
1256
- g = this.parse(c.tokens), e += this.renderer.blockquote(g);
782
+ s += this.renderer.blockquote(l);
1257
783
  continue;
1258
784
  }
1259
785
  case "list": {
1260
- for (y = c.ordered, _ = c.start, I = c.loose, a = c.items.length, g = "", s = 0; s < a; s++)
1261
- w = c.items[s], v = w.checked, R = w.task, x = "", w.task && ($ = this.renderer.checkbox(v), I ? w.tokens.length > 0 && w.tokens[0].type === "paragraph" ? (w.tokens[0].text = $ + " " + w.tokens[0].text, w.tokens[0].tokens && w.tokens[0].tokens.length > 0 && w.tokens[0].tokens[0].type === "text" && (w.tokens[0].tokens[0].text = $ + " " + w.tokens[0].tokens[0].text)) : w.tokens.unshift({
1262
- type: "text",
1263
- text: $
1264
- }) : x += $), x += this.parse(w.tokens, I), g += this.renderer.listitem(x, R, v);
1265
- e += this.renderer.list(g, y, _);
786
+ s += this.renderer.list(l);
1266
787
  continue;
1267
788
  }
1268
789
  case "html": {
1269
- e += this.renderer.html(c.text, c.block);
790
+ s += this.renderer.html(l);
1270
791
  continue;
1271
792
  }
1272
793
  case "paragraph": {
1273
- e += this.renderer.paragraph(this.parseInline(c.tokens));
794
+ s += this.renderer.paragraph(l);
1274
795
  continue;
1275
796
  }
1276
797
  case "text": {
1277
- for (g = c.tokens ? this.parseInline(c.tokens) : c.text; i + 1 < E && t[i + 1].type === "text"; )
1278
- c = t[++i], g += `
1279
- ` + (c.tokens ? this.parseInline(c.tokens) : c.text);
1280
- e += n ? this.renderer.paragraph(g) : g;
798
+ let a = l, o = this.renderer.text(a);
799
+ for (; t + 1 < e.length && e[t + 1].type === "text"; ) a = e[++t], o += `
800
+ ` + this.renderer.text(a);
801
+ n ? s += this.renderer.paragraph({ type: "paragraph", raw: o, text: o, tokens: [{ type: "text", raw: o, text: o, escaped: !0 }] }) : s += o;
1281
802
  continue;
1282
803
  }
1283
804
  default: {
1284
- const U = 'Token with "' + c.type + '" type was not found.';
1285
- if (this.options.silent) {
1286
- console.error(U);
1287
- return;
1288
- } else
1289
- throw new Error(U);
805
+ let a = 'Token with "' + l.type + '" type was not found.';
806
+ if (this.options.silent) return console.error(a), "";
807
+ throw new Error(a);
1290
808
  }
1291
809
  }
1292
810
  }
1293
- return e;
1294
- }
1295
- /**
1296
- * Parse Inline Tokens
1297
- */
1298
- parseInline(t, n) {
1299
- n = n || this.renderer;
1300
- let e = "", i, s, r;
1301
- const a = t.length;
1302
- for (i = 0; i < a; i++) {
1303
- if (s = t[i], this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[s.type] && (r = this.options.extensions.renderers[s.type].call({ parser: this }, s), r !== !1 || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(s.type))) {
1304
- e += r || "";
1305
- continue;
811
+ return s;
812
+ }
813
+ parseInline(e, n = this.renderer) {
814
+ let s = "";
815
+ for (let t = 0; t < e.length; t++) {
816
+ let i = e[t];
817
+ if (this.options.extensions?.renderers?.[i.type]) {
818
+ let a = this.options.extensions.renderers[i.type].call({ parser: this }, i);
819
+ if (a !== !1 || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(i.type)) {
820
+ s += a || "";
821
+ continue;
822
+ }
1306
823
  }
1307
- switch (s.type) {
824
+ let l = i;
825
+ switch (l.type) {
1308
826
  case "escape": {
1309
- e += n.text(s.text);
827
+ s += n.text(l);
1310
828
  break;
1311
829
  }
1312
830
  case "html": {
1313
- e += n.html(s.text);
831
+ s += n.html(l);
1314
832
  break;
1315
833
  }
1316
834
  case "link": {
1317
- e += n.link(s.href, s.title, this.parseInline(s.tokens, n));
835
+ s += n.link(l);
1318
836
  break;
1319
837
  }
1320
838
  case "image": {
1321
- e += n.image(s.href, s.title, s.text);
839
+ s += n.image(l);
1322
840
  break;
1323
841
  }
1324
842
  case "strong": {
1325
- e += n.strong(this.parseInline(s.tokens, n));
843
+ s += n.strong(l);
1326
844
  break;
1327
845
  }
1328
846
  case "em": {
1329
- e += n.em(this.parseInline(s.tokens, n));
847
+ s += n.em(l);
1330
848
  break;
1331
849
  }
1332
850
  case "codespan": {
1333
- e += n.codespan(s.text);
851
+ s += n.codespan(l);
1334
852
  break;
1335
853
  }
1336
854
  case "br": {
1337
- e += n.br();
855
+ s += n.br(l);
1338
856
  break;
1339
857
  }
1340
858
  case "del": {
1341
- e += n.del(this.parseInline(s.tokens, n));
859
+ s += n.del(l);
1342
860
  break;
1343
861
  }
1344
862
  case "text": {
1345
- e += n.text(s.text);
863
+ s += n.text(l);
1346
864
  break;
1347
865
  }
1348
866
  default: {
1349
- const o = 'Token with "' + s.type + '" type was not found.';
1350
- if (this.options.silent) {
1351
- console.error(o);
1352
- return;
1353
- } else
1354
- throw new Error(o);
867
+ let a = 'Token with "' + l.type + '" type was not found.';
868
+ if (this.options.silent) return console.error(a), "";
869
+ throw new Error(a);
1355
870
  }
1356
871
  }
1357
872
  }
1358
- return e;
873
+ return s;
1359
874
  }
1360
- }
1361
- class q {
1362
- constructor(t) {
1363
- this.options = t || A;
1364
- }
1365
- static passThroughHooks = /* @__PURE__ */ new Set([
1366
- "preprocess",
1367
- "postprocess"
1368
- ]);
1369
- /**
1370
- * Process markdown before marked
1371
- */
1372
- preprocess(t) {
1373
- return t;
1374
- }
1375
- /**
1376
- * Process HTML after marked is finished
1377
- */
1378
- postprocess(t) {
1379
- return t;
875
+ }, P = class {
876
+ options;
877
+ block;
878
+ constructor(r) {
879
+ this.options = r || S;
1380
880
  }
1381
- }
1382
- class we {
1383
- defaults = M();
881
+ static passThroughHooks = /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"]);
882
+ preprocess(r) {
883
+ return r;
884
+ }
885
+ postprocess(r) {
886
+ return r;
887
+ }
888
+ processAllTokens(r) {
889
+ return r;
890
+ }
891
+ provideLexer() {
892
+ return this.block ? w.lex : w.lexInline;
893
+ }
894
+ provideParser() {
895
+ return this.block ? y.parse : y.parseInline;
896
+ }
897
+ }, st = class {
898
+ defaults = O();
1384
899
  options = this.setOptions;
1385
- parse = this.#e(S.lex, T.parse);
1386
- parseInline = this.#e(S.lexInline, T.parseInline);
1387
- Parser = T;
1388
- parser = T.parse;
1389
- Renderer = B;
1390
- TextRenderer = O;
1391
- Lexer = S;
1392
- lexer = S.lex;
1393
- Tokenizer = Z;
1394
- Slugger = j;
1395
- Hooks = q;
1396
- constructor(...t) {
1397
- this.use(...t);
1398
- }
1399
- walkTokens(t, n) {
1400
- let e = [];
1401
- for (const i of t)
1402
- switch (e = e.concat(n.call(this, i)), i.type) {
1403
- case "table": {
1404
- for (const s of i.header)
1405
- e = e.concat(this.walkTokens(s.tokens, n));
1406
- for (const s of i.rows)
1407
- for (const r of s)
1408
- e = e.concat(this.walkTokens(r.tokens, n));
1409
- break;
1410
- }
1411
- case "list": {
1412
- e = e.concat(this.walkTokens(i.items, n));
1413
- break;
1414
- }
1415
- default:
1416
- this.defaults.extensions && this.defaults.extensions.childTokens && this.defaults.extensions.childTokens[i.type] ? this.defaults.extensions.childTokens[i.type].forEach((s) => {
1417
- e = e.concat(this.walkTokens(i[s], n));
1418
- }) : i.tokens && (e = e.concat(this.walkTokens(i.tokens, n)));
900
+ parse = this.parseMarkdown(!0);
901
+ parseInline = this.parseMarkdown(!1);
902
+ Parser = y;
903
+ Renderer = L;
904
+ TextRenderer = J;
905
+ Lexer = w;
906
+ Tokenizer = v;
907
+ Hooks = P;
908
+ constructor(...r) {
909
+ this.use(...r);
910
+ }
911
+ walkTokens(r, e) {
912
+ let n = [];
913
+ for (let s of r) switch (n = n.concat(e.call(this, s)), s.type) {
914
+ case "table": {
915
+ let t = s;
916
+ for (let i of t.header) n = n.concat(this.walkTokens(i.tokens, e));
917
+ for (let i of t.rows) for (let l of i) n = n.concat(this.walkTokens(l.tokens, e));
918
+ break;
919
+ }
920
+ case "list": {
921
+ let t = s;
922
+ n = n.concat(this.walkTokens(t.items, e));
923
+ break;
924
+ }
925
+ default: {
926
+ let t = s;
927
+ this.defaults.extensions?.childTokens?.[t.type] ? this.defaults.extensions.childTokens[t.type].forEach((i) => {
928
+ let l = t[i].flat(1 / 0);
929
+ n = n.concat(this.walkTokens(l, e));
930
+ }) : t.tokens && (n = n.concat(this.walkTokens(t.tokens, e)));
1419
931
  }
1420
- return e;
1421
- }
1422
- use(...t) {
1423
- const n = this.defaults.extensions || { renderers: {}, childTokens: {} };
1424
- return t.forEach((e) => {
1425
- const i = { ...e };
1426
- if (i.async = this.defaults.async || i.async || !1, e.extensions && (e.extensions.forEach((s) => {
1427
- if (!s.name)
1428
- throw new Error("extension name required");
1429
- if (s.renderer) {
1430
- const r = n.renderers[s.name];
1431
- r ? n.renderers[s.name] = function(...a) {
1432
- let o = s.renderer.apply(this, a);
1433
- return o === !1 && (o = r.apply(this, a)), o;
1434
- } : n.renderers[s.name] = s.renderer;
932
+ }
933
+ return n;
934
+ }
935
+ use(...r) {
936
+ let e = this.defaults.extensions || { renderers: {}, childTokens: {} };
937
+ return r.forEach((n) => {
938
+ let s = { ...n };
939
+ if (s.async = this.defaults.async || s.async || !1, n.extensions && (n.extensions.forEach((t) => {
940
+ if (!t.name) throw new Error("extension name required");
941
+ if ("renderer" in t) {
942
+ let i = e.renderers[t.name];
943
+ i ? e.renderers[t.name] = function(...l) {
944
+ let a = t.renderer.apply(this, l);
945
+ return a === !1 && (a = i.apply(this, l)), a;
946
+ } : e.renderers[t.name] = t.renderer;
1435
947
  }
1436
- if (s.tokenizer) {
1437
- if (!s.level || s.level !== "block" && s.level !== "inline")
1438
- throw new Error("extension level must be 'block' or 'inline'");
1439
- n[s.level] ? n[s.level].unshift(s.tokenizer) : n[s.level] = [s.tokenizer], s.start && (s.level === "block" ? n.startBlock ? n.startBlock.push(s.start) : n.startBlock = [s.start] : s.level === "inline" && (n.startInline ? n.startInline.push(s.start) : n.startInline = [s.start]));
948
+ if ("tokenizer" in t) {
949
+ if (!t.level || t.level !== "block" && t.level !== "inline") throw new Error("extension level must be 'block' or 'inline'");
950
+ let i = e[t.level];
951
+ 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]));
1440
952
  }
1441
- s.childTokens && (n.childTokens[s.name] = s.childTokens);
1442
- }), i.extensions = n), e.renderer) {
1443
- const s = this.defaults.renderer || new B(this.defaults);
1444
- for (const r in e.renderer) {
1445
- const a = s[r];
1446
- s[r] = (...o) => {
1447
- let p = e.renderer[r].apply(s, o);
1448
- return p === !1 && (p = a.apply(s, o)), p;
953
+ "childTokens" in t && t.childTokens && (e.childTokens[t.name] = t.childTokens);
954
+ }), s.extensions = e), n.renderer) {
955
+ let t = this.defaults.renderer || new L(this.defaults);
956
+ for (let i in n.renderer) {
957
+ if (!(i in t)) throw new Error(`renderer '${i}' does not exist`);
958
+ if (["options", "parser"].includes(i)) continue;
959
+ let l = i, a = n.renderer[l], o = t[l];
960
+ t[l] = (...c) => {
961
+ let h = a.apply(t, c);
962
+ return h === !1 && (h = o.apply(t, c)), h || "";
1449
963
  };
1450
964
  }
1451
- i.renderer = s;
965
+ s.renderer = t;
1452
966
  }
1453
- if (e.tokenizer) {
1454
- const s = this.defaults.tokenizer || new Z(this.defaults);
1455
- for (const r in e.tokenizer) {
1456
- const a = s[r];
1457
- s[r] = (...o) => {
1458
- let p = e.tokenizer[r].apply(s, o);
1459
- return p === !1 && (p = a.apply(s, o)), p;
967
+ if (n.tokenizer) {
968
+ let t = this.defaults.tokenizer || new v(this.defaults);
969
+ for (let i in n.tokenizer) {
970
+ if (!(i in t)) throw new Error(`tokenizer '${i}' does not exist`);
971
+ if (["options", "rules", "lexer"].includes(i)) continue;
972
+ let l = i, a = n.tokenizer[l], o = t[l];
973
+ t[l] = (...c) => {
974
+ let h = a.apply(t, c);
975
+ return h === !1 && (h = o.apply(t, c)), h;
1460
976
  };
1461
977
  }
1462
- i.tokenizer = s;
978
+ s.tokenizer = t;
1463
979
  }
1464
- if (e.hooks) {
1465
- const s = this.defaults.hooks || new q();
1466
- for (const r in e.hooks) {
1467
- const a = s[r];
1468
- q.passThroughHooks.has(r) ? s[r] = (o) => {
1469
- if (this.defaults.async)
1470
- return Promise.resolve(e.hooks[r].call(s, o)).then((f) => a.call(s, f));
1471
- const p = e.hooks[r].call(s, o);
1472
- return a.call(s, p);
1473
- } : s[r] = (...o) => {
1474
- let p = e.hooks[r].apply(s, o);
1475
- return p === !1 && (p = a.apply(s, o)), p;
980
+ if (n.hooks) {
981
+ let t = this.defaults.hooks || new P();
982
+ for (let i in n.hooks) {
983
+ if (!(i in t)) throw new Error(`hook '${i}' does not exist`);
984
+ if (["options", "block"].includes(i)) continue;
985
+ let l = i, a = n.hooks[l], o = t[l];
986
+ P.passThroughHooks.has(i) ? t[l] = (c) => {
987
+ if (this.defaults.async) return Promise.resolve(a.call(t, c)).then((k) => o.call(t, k));
988
+ let h = a.call(t, c);
989
+ return o.call(t, h);
990
+ } : t[l] = (...c) => {
991
+ let h = a.apply(t, c);
992
+ return h === !1 && (h = o.apply(t, c)), h;
1476
993
  };
1477
994
  }
1478
- i.hooks = s;
995
+ s.hooks = t;
1479
996
  }
1480
- if (e.walkTokens) {
1481
- const s = this.defaults.walkTokens;
1482
- i.walkTokens = function(r) {
997
+ if (n.walkTokens) {
998
+ let t = this.defaults.walkTokens, i = n.walkTokens;
999
+ s.walkTokens = function(l) {
1483
1000
  let a = [];
1484
- return a.push(e.walkTokens.call(this, r)), s && (a = a.concat(s.call(this, r))), a;
1001
+ return a.push(i.call(this, l)), t && (a = a.concat(t.call(this, l))), a;
1485
1002
  };
1486
1003
  }
1487
- this.defaults = { ...this.defaults, ...i };
1004
+ this.defaults = { ...this.defaults, ...s };
1488
1005
  }), this;
1489
1006
  }
1490
- setOptions(t) {
1491
- return this.defaults = { ...this.defaults, ...t }, this;
1492
- }
1493
- #e(t, n) {
1494
- return (e, i, s) => {
1495
- typeof i == "function" && (s = i, i = null);
1496
- const r = { ...i };
1497
- i = { ...this.defaults, ...r };
1498
- const a = this.#t(i.silent, i.async, s);
1499
- if (typeof e > "u" || e === null)
1500
- return a(new Error("marked(): input parameter is undefined or null"));
1501
- if (typeof e != "string")
1502
- return a(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(e) + ", string expected"));
1503
- if (ke(i, s), i.hooks && (i.hooks.options = i), s) {
1504
- const o = i.highlight;
1505
- let p;
1506
- try {
1507
- i.hooks && (e = i.hooks.preprocess(e)), p = t(e, i);
1508
- } catch (g) {
1509
- return a(g);
1510
- }
1511
- const f = (g) => {
1512
- let c;
1513
- if (!g)
1514
- try {
1515
- i.walkTokens && this.walkTokens(p, i.walkTokens), c = n(p, i), i.hooks && (c = i.hooks.postprocess(c));
1516
- } catch (y) {
1517
- g = y;
1518
- }
1519
- return i.highlight = o, g ? a(g) : s(null, c);
1520
- };
1521
- if (!o || o.length < 3 || (delete i.highlight, !p.length)) return f();
1522
- let k = 0;
1523
- this.walkTokens(p, (g) => {
1524
- g.type === "code" && (k++, setTimeout(() => {
1525
- o(g.text, g.lang, (c, y) => {
1526
- if (c)
1527
- return f(c);
1528
- y != null && y !== g.text && (g.text = y, g.escaped = !0), k--, k === 0 && f();
1529
- });
1530
- }, 0));
1531
- }), k === 0 && f();
1532
- return;
1533
- }
1534
- if (i.async)
1535
- return Promise.resolve(i.hooks ? i.hooks.preprocess(e) : e).then((o) => t(o, i)).then((o) => i.walkTokens ? Promise.all(this.walkTokens(o, i.walkTokens)).then(() => o) : o).then((o) => n(o, i)).then((o) => i.hooks ? i.hooks.postprocess(o) : o).catch(a);
1007
+ setOptions(r) {
1008
+ return this.defaults = { ...this.defaults, ...r }, this;
1009
+ }
1010
+ lexer(r, e) {
1011
+ return w.lex(r, e ?? this.defaults);
1012
+ }
1013
+ parser(r, e) {
1014
+ return y.parse(r, e ?? this.defaults);
1015
+ }
1016
+ parseMarkdown(r) {
1017
+ return (e, n) => {
1018
+ let s = { ...n }, t = { ...this.defaults, ...s }, i = this.onError(!!t.silent, !!t.async);
1019
+ 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."));
1020
+ if (typeof e > "u" || e === null) return i(new Error("marked(): input parameter is undefined or null"));
1021
+ if (typeof e != "string") return i(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(e) + ", string expected"));
1022
+ t.hooks && (t.hooks.options = t, t.hooks.block = r);
1023
+ let l = t.hooks ? t.hooks.provideLexer() : r ? w.lex : w.lexInline, a = t.hooks ? t.hooks.provideParser() : r ? y.parse : y.parseInline;
1024
+ if (t.async) return Promise.resolve(t.hooks ? t.hooks.preprocess(e) : e).then((o) => l(o, t)).then((o) => t.hooks ? t.hooks.processAllTokens(o) : o).then((o) => t.walkTokens ? Promise.all(this.walkTokens(o, t.walkTokens)).then(() => o) : o).then((o) => a(o, t)).then((o) => t.hooks ? t.hooks.postprocess(o) : o).catch(i);
1536
1025
  try {
1537
- i.hooks && (e = i.hooks.preprocess(e));
1538
- const o = t(e, i);
1539
- i.walkTokens && this.walkTokens(o, i.walkTokens);
1540
- let p = n(o, i);
1541
- return i.hooks && (p = i.hooks.postprocess(p)), p;
1026
+ t.hooks && (e = t.hooks.preprocess(e));
1027
+ let o = l(e, t);
1028
+ t.hooks && (o = t.hooks.processAllTokens(o)), t.walkTokens && this.walkTokens(o, t.walkTokens);
1029
+ let c = a(o, t);
1030
+ return t.hooks && (c = t.hooks.postprocess(c)), c;
1542
1031
  } catch (o) {
1543
- return a(o);
1032
+ return i(o);
1544
1033
  }
1545
1034
  };
1546
1035
  }
1547
- #t(t, n, e) {
1548
- return (i) => {
1549
- if (i.message += `
1550
- Please report this to https://github.com/markedjs/marked.`, t) {
1551
- const s = "<p>An error occurred:</p><pre>" + b(i.message + "", !0) + "</pre>";
1552
- if (n)
1553
- return Promise.resolve(s);
1554
- if (e) {
1555
- e(null, s);
1556
- return;
1557
- }
1558
- return s;
1036
+ onError(r, e) {
1037
+ return (n) => {
1038
+ if (n.message += `
1039
+ Please report this to https://github.com/markedjs/marked.`, r) {
1040
+ let s = "<p>An error occurred:</p><pre>" + m(n.message + "", !0) + "</pre>";
1041
+ return e ? Promise.resolve(s) : s;
1559
1042
  }
1560
- if (n)
1561
- return Promise.reject(i);
1562
- if (e) {
1563
- e(i);
1564
- return;
1565
- }
1566
- throw i;
1043
+ if (e) return Promise.reject(n);
1044
+ throw n;
1567
1045
  };
1568
1046
  }
1047
+ }, $ = new st();
1048
+ function p(r, e) {
1049
+ return $.parse(r, e);
1569
1050
  }
1570
- const C = new we(A);
1571
- function d(l, t, n) {
1572
- return C.parse(l, t, n);
1573
- }
1574
- d.options = d.setOptions = function(l) {
1575
- return C.setOptions(l), d.defaults = C.defaults, V(d.defaults), d;
1051
+ p.options = p.setOptions = function(r) {
1052
+ return $.setOptions(r), p.defaults = $.defaults, ae(p.defaults), p;
1576
1053
  };
1577
- d.getDefaults = M;
1578
- d.defaults = A;
1579
- d.use = function(...l) {
1580
- return C.use(...l), d.defaults = C.defaults, V(d.defaults), d;
1054
+ p.getDefaults = O;
1055
+ p.defaults = S;
1056
+ p.use = function(...r) {
1057
+ return $.use(...r), p.defaults = $.defaults, ae(p.defaults), p;
1581
1058
  };
1582
- d.walkTokens = function(l, t) {
1583
- return C.walkTokens(l, t);
1059
+ p.walkTokens = function(r, e) {
1060
+ return $.walkTokens(r, e);
1584
1061
  };
1585
- d.parseInline = C.parseInline;
1586
- d.Parser = T;
1587
- d.parser = T.parse;
1588
- d.Renderer = B;
1589
- d.TextRenderer = O;
1590
- d.Lexer = S;
1591
- d.lexer = S.lex;
1592
- d.Tokenizer = Z;
1593
- d.Slugger = j;
1594
- d.Hooks = q;
1595
- d.parse = d;
1596
- d.options;
1597
- d.setOptions;
1598
- d.use;
1599
- d.walkTokens;
1600
- d.parseInline;
1601
- T.parse;
1602
- S.lex;
1603
- d.use({
1062
+ p.parseInline = $.parseInline;
1063
+ p.Parser = y;
1064
+ p.parser = y.parse;
1065
+ p.Renderer = L;
1066
+ p.TextRenderer = J;
1067
+ p.Lexer = w;
1068
+ p.lexer = w.lex;
1069
+ p.Tokenizer = v;
1070
+ p.Hooks = P;
1071
+ p.parse = p;
1072
+ p.options;
1073
+ p.setOptions;
1074
+ p.use;
1075
+ p.walkTokens;
1076
+ p.parseInline;
1077
+ y.parse;
1078
+ w.lex;
1079
+ p.use({
1604
1080
  gfm: !0,
1605
1081
  breaks: !0,
1606
1082
  async: !1,
1607
- mangle: !1,
1608
- headerIds: !1,
1609
1083
  renderer: {
1610
- link(l, t, n) {
1611
- return `<calcite-link href="${l}" title="${t ?? n}" target="Arcade Help">${n}</calcite-link>`;
1084
+ link({ href: r, title: e, tokens: n }) {
1085
+ const s = this.parser.parseInline(n);
1086
+ return `<calcite-link href="${r}" title="${e ?? s}" target="Arcade Help">${s}</calcite-link>`;
1612
1087
  }
1613
1088
  }
1614
1089
  });
1615
- function Re(l) {
1616
- return l == null ? "" : d.parse(typeof l == "string" ? l : l.value);
1090
+ function ut(r) {
1091
+ return r == null ? "" : p.parse(typeof r == "string" ? r : r.value, { async: !1 });
1617
1092
  }
1618
1093
  export {
1619
- ze as a,
1620
- ie as b,
1621
- Re as c,
1622
- Se as g,
1623
- Te as o
1094
+ ct as a,
1095
+ $e as b,
1096
+ ut as c,
1097
+ ht as g,
1098
+ pt as o
1624
1099
  };