@arcgis/coding-components 5.0.0-next.50 → 5.0.0-next.52

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 (86) hide show
  1. package/dist/addons.js +1 -1
  2. package/dist/cdn/{6Y5OA6RA.js → 2ANR75WD.js} +2 -2
  3. package/dist/cdn/{PYDQLQZO.js → 2NSWS3E6.js} +2 -2
  4. package/dist/cdn/{IZBYAGUQ.js → 34XKO42T.js} +2 -2
  5. package/dist/cdn/{C52JGS5N.js → 4TKOXPBP.js} +2 -2
  6. package/dist/cdn/{5QWAKCLT.js → AOZVFKJZ.js} +2 -2
  7. package/dist/cdn/{RLNZT7YU.js → AUOZCMWG.js} +2 -2
  8. package/dist/cdn/B3FZWYA3.js +62 -0
  9. package/dist/cdn/{MN5COMH5.js → BJ6G4YA4.js} +2 -2
  10. package/dist/cdn/{3RHG7CIL.js → BKA6JHS3.js} +2 -2
  11. package/dist/cdn/{EPIFY2VR.js → C4G77O7M.js} +1 -1
  12. package/dist/cdn/{YTCWMXES.js → DPIGZKZ4.js} +1 -1
  13. package/dist/cdn/{3Y733UJR.js → EKBWE65U.js} +2 -2
  14. package/dist/cdn/{NB77OUMQ.js → ENKHDUXX.js} +2 -2
  15. package/dist/cdn/{WUMWVZZK.js → ES5FFL4T.js} +2 -2
  16. package/dist/cdn/{4VWE222D.js → EV3KYXV2.js} +2 -2
  17. package/dist/cdn/{X7F5D4VA.js → EWP2WEXJ.js} +2 -2
  18. package/dist/cdn/{3RBWQ2PI.js → F3TG34KM.js} +2 -2
  19. package/dist/cdn/{36UZPGBN.js → FHLXZDXN.js} +2 -2
  20. package/dist/cdn/{SCPIXD46.js → FSQSMRF5.js} +2 -2
  21. package/dist/cdn/{CIBOSZ2V.js → FZ3YBRNI.js} +1 -1
  22. package/dist/cdn/{NV5GKSO6.js → G2T3CKTT.js} +2 -2
  23. package/dist/cdn/{DA5KZLMN.js → G6OAX536.js} +2 -2
  24. package/dist/cdn/{K7PG5U6W.js → IDBH3J5F.js} +2 -2
  25. package/dist/cdn/{EYFVKHVP.js → K2W6DDTF.js} +2 -2
  26. package/dist/cdn/{MHL5RKE5.js → KXUBR3Y6.js} +2 -2
  27. package/dist/cdn/{A3FAAF3H.js → LXAESJKL.js} +1 -1
  28. package/dist/cdn/{A7FTFLV4.js → MCKWWJFY.js} +2 -2
  29. package/dist/cdn/MDQGQHRK.js +4 -0
  30. package/dist/cdn/{NER3F7V3.js → MRPHM37J.js} +2 -2
  31. package/dist/cdn/{KZIT4ISV.js → OOQNKTI7.js} +2 -2
  32. package/dist/cdn/{OBWP5GHD.js → OSLSZWKC.js} +1 -1
  33. package/dist/cdn/{YGUYBGIM.js → PCIB4KX3.js} +2 -2
  34. package/dist/cdn/{QS2KFOBK.js → PKJ54DLX.js} +2 -2
  35. package/dist/cdn/{WN4IIZPY.js → PKPOCAOX.js} +2 -2
  36. package/dist/cdn/{PBECRFLR.js → RUQD4WS6.js} +2 -2
  37. package/dist/cdn/{EDQJ4DZR.js → SHF7N7BO.js} +2 -2
  38. package/dist/cdn/{5YNQ2D5S.js → SRRTRUDA.js} +3 -3
  39. package/dist/cdn/{FMBQAZAN.js → STXNCQ2Y.js} +1 -1
  40. package/dist/cdn/{TQZF5WEI.js → TDTEXT7R.js} +2 -2
  41. package/dist/cdn/{AXGPWMOK.js → VILMT6SI.js} +2 -2
  42. package/dist/cdn/{FW224ELU.js → W5SP2FOM.js} +2 -2
  43. package/dist/cdn/{CPWYWNOP.js → WFT7M2TR.js} +2 -2
  44. package/dist/cdn/{NKT5UZFP.js → WUQDHFLU.js} +2 -2
  45. package/dist/cdn/{63KQIV5V.js → X6IPOHYM.js} +2 -2
  46. package/dist/cdn/{H7Z7Q333.js → XSI7CHOD.js} +1 -1
  47. package/dist/cdn/{YNOGYZHA.js → ZLBM5PVQ.js} +2 -2
  48. package/dist/cdn/{HEJ2D2QU.js → ZQHED3MJ.js} +2 -2
  49. package/dist/cdn/assets/code-editor/sql-expr.worker.js +2 -2
  50. package/dist/cdn/index.js +2 -2
  51. package/dist/chunks/arcade-contribution.js +1 -1
  52. package/dist/chunks/arcade-defaults.js +1 -1
  53. package/dist/chunks/arcade-executor.js +1 -1
  54. package/dist/chunks/arcade-mode.js +1 -1
  55. package/dist/chunks/arcade-service-accessors.js +1 -1
  56. package/dist/chunks/colorize.js +1 -1
  57. package/dist/chunks/editor.js +1 -1
  58. package/dist/chunks/fields.js +1 -1
  59. package/dist/chunks/language-defaults-base.js +1 -1
  60. package/dist/chunks/markdown.js +527 -505
  61. package/dist/chunks/monaco-importer.js +1 -1
  62. package/dist/chunks/runtime.js +1 -1
  63. package/dist/chunks/sql-expr-defaults.js +1 -1
  64. package/dist/chunks/sql-expr-mode.js +1 -1
  65. package/dist/chunks/sql-expr-service-accessors.js +1 -1
  66. package/dist/chunks/useT9n.js +1 -1
  67. package/dist/chunks/utilities.js +1 -1
  68. package/dist/components/arcgis-arcade-coding-assistant/customElement.js +1 -1
  69. package/dist/components/arcgis-arcade-editor/customElement.js +1 -1
  70. package/dist/components/arcgis-arcade-results/customElement.js +1 -1
  71. package/dist/components/arcgis-arcade-suggestions/customElement.js +1 -1
  72. package/dist/components/arcgis-code-editor/customElement.js +1 -1
  73. package/dist/components/arcgis-code-viewer/customElement.js +1 -1
  74. package/dist/components/arcgis-editor-variables/customElement.js +1 -1
  75. package/dist/components/arcgis-language-api-panel/customElement.js +1 -1
  76. package/dist/components/arcgis-sql-expression-editor/customElement.js +1 -1
  77. package/dist/components/arcgis-sql-expression-fields/customElement.js +1 -1
  78. package/dist/docs/api.json +2 -2
  79. package/dist/docs/docs.json +2 -2
  80. package/dist/docs/web-types.json +1 -1
  81. package/dist/index.js +1 -1
  82. package/dist/loader.js +1 -1
  83. package/dist/monacoStyles.js +1 -1
  84. package/package.json +5 -5
  85. package/dist/cdn/FHDL6XJJ.js +0 -63
  86. package/dist/cdn/O5JPV76R.js +0 -4
@@ -1,158 +1,164 @@
1
1
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
2
2
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
3
- v5.0.0-next.50 */
3
+ v5.0.0-next.52 */
4
4
  function H() {
5
5
  return { async: !1, breaks: !1, extensions: null, gfm: !0, hooks: null, pedantic: !1, renderer: null, silent: !1, tokenizer: null, walkTokens: null };
6
6
  }
7
7
  var R = H();
8
- function ie(r) {
9
- R = r;
8
+ function le(n) {
9
+ R = n;
10
10
  }
11
11
  var _ = { exec: () => null };
12
- function p(r, e = "") {
13
- let n = typeof r == "string" ? r : r.source, s = { replace: (t, i) => {
12
+ function p(n, e = "") {
13
+ let r = typeof n == "string" ? n : n.source, s = { replace: (t, i) => {
14
14
  let l = typeof i == "string" ? i : i.source;
15
- return l = l.replace(x.caret, "$1"), n = n.replace(t, l), s;
16
- }, getRegex: () => new RegExp(n, e) };
15
+ return l = l.replace(x.caret, "$1"), r = r.replace(t, l), s;
16
+ }, getRegex: () => new RegExp(r, e) };
17
17
  return s;
18
18
  }
19
- 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") }, be = /^(?:[ \t]*(?:\n|$))+/, we = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, me = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, P = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, ye = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, Q = /(?:[*+-]|\d{1,9}[.)])/, ae = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, oe = p(ae).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(), $e = p(ae).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(), N = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Re = /^[^\n]+/, j = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Se = p(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", j).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Te = p(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, Q).getRegex(), B = "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]*?(?:-->|$))/, ze = p("^ {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", B).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), ce = p(N).replace("hr", P).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", B).getRegex(), Ae = p(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", ce).getRegex(), F = { blockquote: Ae, code: we, def: Se, fences: me, heading: ye, hr: P, html: ze, lheading: oe, list: Te, newline: be, paragraph: ce, table: _, text: Re }, ee = p("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", P).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", B).getRegex(), _e = { ...F, lheading: $e, table: ee, paragraph: p(N).replace("hr", P).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", B).getRegex() }, Pe = { ...F, html: p(`^ *(?: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: _, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: p(N).replace("hr", P).replace("heading", ` *#{1,6} *[^
20
- ]`).replace("lheading", oe).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Ie = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Le = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, he = /^( {2,}|\\)\n(?!\s*$)/, qe = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, C = /[\p{P}\p{S}]/u, W = /[\s\p{P}\p{S}]/u, pe = /[^\s\p{P}\p{S}]/u, ve = p(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, W).getRegex(), ue = /(?!~)[\p{P}\p{S}]/u, Be = /(?!~)[\s\p{P}\p{S}]/u, Ce = /(?:[^\s\p{P}\p{S}]|~)/u, Ee = p(/link|code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<!`)(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("code", /(?<!`)(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), ge = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, Ze = p(ge, "u").replace(/punct/g, C).getRegex(), Me = p(ge, "u").replace(/punct/g, ue).getRegex(), ke = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", De = p(ke, "gu").replace(/notPunctSpace/g, pe).replace(/punctSpace/g, W).replace(/punct/g, C).getRegex(), Oe = p(ke, "gu").replace(/notPunctSpace/g, Ce).replace(/punctSpace/g, Be).replace(/punct/g, ue).getRegex(), He = p("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, pe).replace(/punctSpace/g, W).replace(/punct/g, C).getRegex(), Qe = p(/\\(punct)/, "gu").replace(/punct/g, C).getRegex(), Ne = p(/^<(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 = p(G).replace("(?:-->|$)", "-->").getRegex(), Ge = p("^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(), L = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/, Fe = p(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", L).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), fe = p(/^!?\[(label)\]\[(ref)\]/).replace("label", L).replace("ref", j).getRegex(), de = p(/^!?\[(ref)\](?:\[\])?/).replace("ref", j).getRegex(), We = p("reflink|nolink(?!\\()", "g").replace("reflink", fe).replace("nolink", de).getRegex(), te = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, X = { _backpedal: _, anyPunctuation: Qe, autolink: Ne, blockSkip: Ee, br: he, code: Le, del: _, emStrongLDelim: Ze, emStrongRDelimAst: De, emStrongRDelimUnd: He, escape: Ie, link: Fe, nolink: de, punctuation: ve, reflink: fe, reflinkSearch: We, tag: Ge, text: qe, url: _ }, Xe = { ...X, link: p(/^!?\[(label)\]\((.*?)\)/).replace("label", L).getRegex(), reflink: p(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", L).getRegex() }, M = { ...X, emStrongRDelimAst: Oe, emStrongLDelim: Me, url: p(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", te).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: p(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", te).getRegex() }, Ue = { ...M, br: p(he).replace("{2,}", "*").getRegex(), text: p(M.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, I = { normal: F, gfm: _e, pedantic: Pe }, T = { normal: X, gfm: M, breaks: Ue, pedantic: Xe }, Je = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }, re = (r) => Je[r];
21
- function y(r, e) {
19
+ var xe = (() => {
20
+ try {
21
+ return !!new RegExp("(?<=1)(?<!1)");
22
+ } catch {
23
+ return !1;
24
+ }
25
+ })(), 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]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, unescapeTest: /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (n) => new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: (n) => new RegExp(`^ {0,${Math.min(3, n - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), hrRegex: (n) => new RegExp(`^ {0,${Math.min(3, n - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), fencesBeginRegex: (n) => new RegExp(`^ {0,${Math.min(3, n - 1)}}(?:\`\`\`|~~~)`), headingBeginRegex: (n) => new RegExp(`^ {0,${Math.min(3, n - 1)}}#`), htmlBeginRegex: (n) => new RegExp(`^ {0,${Math.min(3, n - 1)}}<(?:[a-z].*>|!--)`, "i") }, be = /^(?:[ \t]*(?:\n|$))+/, we = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, me = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, P = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, ye = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, Q = /(?:[*+-]|\d{1,9}[.)])/, ie = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, ae = p(ie).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(), $e = p(ie).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(), N = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Re = /^[^\n]+/, j = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Se = p(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", j).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Te = p(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, Q).getRegex(), v = "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]*?(?:-->|$))/, ze = p("^ {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", v).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), oe = p(N).replace("hr", P).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex(), Ae = p(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", oe).getRegex(), X = { blockquote: Ae, code: we, def: Se, fences: me, heading: ye, hr: P, html: ze, lheading: ae, list: Te, newline: be, paragraph: oe, table: _, text: Re }, Y = p("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", P).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex(), _e = { ...X, lheading: $e, table: Y, paragraph: p(N).replace("hr", P).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Y).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", v).getRegex() }, Pe = { ...X, html: p(`^ *(?: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: _, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: p(N).replace("hr", P).replace("heading", ` *#{1,6} *[^
26
+ ]`).replace("lheading", ae).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Ie = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Le = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, ce = /^( {2,}|\\)\n(?!\s*$)/, Ce = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, B = /[\p{P}\p{S}]/u, F = /[\s\p{P}\p{S}]/u, he = /[^\s\p{P}\p{S}]/u, qe = p(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, F).getRegex(), pe = /(?!~)[\p{P}\p{S}]/u, ve = /(?!~)[\s\p{P}\p{S}]/u, Be = /(?:[^\s\p{P}\p{S}]|~)/u, Ee = p(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", xe ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), ue = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, Ze = p(ue, "u").replace(/punct/g, B).getRegex(), Me = p(ue, "u").replace(/punct/g, pe).getRegex(), ge = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", De = p(ge, "gu").replace(/notPunctSpace/g, he).replace(/punctSpace/g, F).replace(/punct/g, B).getRegex(), Oe = p(ge, "gu").replace(/notPunctSpace/g, Be).replace(/punctSpace/g, ve).replace(/punct/g, pe).getRegex(), He = p("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, he).replace(/punctSpace/g, F).replace(/punct/g, B).getRegex(), Qe = p(/\\(punct)/, "gu").replace(/punct/g, B).getRegex(), Ne = p(/^<(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 = p(G).replace("(?:-->|$)", "-->").getRegex(), Ge = p("^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(), L = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/, Xe = p(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", L).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), ke = p(/^!?\[(label)\]\[(ref)\]/).replace("label", L).replace("ref", j).getRegex(), fe = p(/^!?\[(ref)\](?:\[\])?/).replace("ref", j).getRegex(), Fe = p("reflink|nolink(?!\\()", "g").replace("reflink", ke).replace("nolink", fe).getRegex(), ee = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, W = { _backpedal: _, anyPunctuation: Qe, autolink: Ne, blockSkip: Ee, br: ce, code: Le, del: _, emStrongLDelim: Ze, emStrongRDelimAst: De, emStrongRDelimUnd: He, escape: Ie, link: Xe, nolink: fe, punctuation: qe, reflink: ke, reflinkSearch: Fe, tag: Ge, text: Ce, url: _ }, We = { ...W, link: p(/^!?\[(label)\]\((.*?)\)/).replace("label", L).getRegex(), reflink: p(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", L).getRegex() }, M = { ...W, emStrongRDelimAst: Oe, emStrongLDelim: Me, url: p(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", ee).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: p(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", ee).getRegex() }, Ue = { ...M, br: p(ce).replace("{2,}", "*").getRegex(), text: p(M.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, I = { normal: X, gfm: _e, pedantic: Pe }, T = { normal: W, gfm: M, breaks: Ue, pedantic: We }, Je = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }, te = (n) => Je[n];
27
+ function y(n, e) {
22
28
  if (e) {
23
- if (x.escapeTest.test(r)) return r.replace(x.escapeReplace, re);
24
- } else if (x.escapeTestNoEncode.test(r)) return r.replace(x.escapeReplaceNoEncode, re);
25
- return r;
29
+ if (x.escapeTest.test(n)) return n.replace(x.escapeReplace, te);
30
+ } else if (x.escapeTestNoEncode.test(n)) return n.replace(x.escapeReplaceNoEncode, te);
31
+ return n;
26
32
  }
27
- function ne(r) {
33
+ function re(n) {
28
34
  try {
29
- r = encodeURI(r).replace(x.percentDecode, "%");
35
+ n = encodeURI(n).replace(x.percentDecode, "%");
30
36
  } catch {
31
37
  return null;
32
38
  }
33
- return r;
39
+ return n;
34
40
  }
35
- function se(r, e) {
36
- let n = r.replace(x.findPipe, (i, l, a) => {
37
- let o = !1, c = l;
38
- for (; --c >= 0 && a[c] === "\\"; ) o = !o;
39
- return o ? "|" : " |";
40
- }), s = n.split(x.splitPipe), t = 0;
41
+ function ne(n, e) {
42
+ let r = n.replace(x.findPipe, (i, l, o) => {
43
+ let a = !1, h = l;
44
+ for (; --h >= 0 && o[h] === "\\"; ) a = !a;
45
+ return a ? "|" : " |";
46
+ }), s = r.split(x.splitPipe), t = 0;
41
47
  if (s[0].trim() || s.shift(), s.length > 0 && !s.at(-1)?.trim() && s.pop(), e) if (s.length > e) s.splice(e);
42
48
  else for (; s.length < e; ) s.push("");
43
49
  for (; t < s.length; t++) s[t] = s[t].trim().replace(x.slashPipe, "|");
44
50
  return s;
45
51
  }
46
- function z(r, e, n) {
47
- let s = r.length;
52
+ function z(n, e, r) {
53
+ let s = n.length;
48
54
  if (s === 0) return "";
49
55
  let t = 0;
50
- for (; t < s && r.charAt(s - t - 1) === e; )
56
+ for (; t < s && n.charAt(s - t - 1) === e; )
51
57
  t++;
52
- return r.slice(0, s - t);
58
+ return n.slice(0, s - t);
53
59
  }
54
- function Ke(r, e) {
55
- if (r.indexOf(e[1]) === -1) return -1;
56
- let n = 0;
57
- for (let s = 0; s < r.length; s++) if (r[s] === "\\") s++;
58
- else if (r[s] === e[0]) n++;
59
- else if (r[s] === e[1] && (n--, n < 0)) return s;
60
- return n > 0 ? -2 : -1;
60
+ function Ke(n, e) {
61
+ if (n.indexOf(e[1]) === -1) return -1;
62
+ let r = 0;
63
+ for (let s = 0; s < n.length; s++) if (n[s] === "\\") s++;
64
+ else if (n[s] === e[0]) r++;
65
+ else if (n[s] === e[1] && (r--, r < 0)) return s;
66
+ return r > 0 ? -2 : -1;
61
67
  }
62
- function le(r, e, n, s, t) {
63
- let i = e.href, l = e.title || null, a = r[1].replace(t.other.outputLinkReplace, "$1");
68
+ function se(n, e, r, s, t) {
69
+ let i = e.href, l = e.title || null, o = n[1].replace(t.other.outputLinkReplace, "$1");
64
70
  s.state.inLink = !0;
65
- let o = { type: r[0].charAt(0) === "!" ? "image" : "link", raw: n, href: i, title: l, text: a, tokens: s.inlineTokens(a) };
66
- return s.state.inLink = !1, o;
71
+ let a = { type: n[0].charAt(0) === "!" ? "image" : "link", raw: r, href: i, title: l, text: o, tokens: s.inlineTokens(o) };
72
+ return s.state.inLink = !1, a;
67
73
  }
68
- function Ve(r, e, n) {
69
- let s = r.match(n.other.indentCodeCompensation);
74
+ function Ve(n, e, r) {
75
+ let s = n.match(r.other.indentCodeCompensation);
70
76
  if (s === null) return e;
71
77
  let t = s[1];
72
78
  return e.split(`
73
79
  `).map((i) => {
74
- let l = i.match(n.other.beginningSpace);
80
+ let l = i.match(r.other.beginningSpace);
75
81
  if (l === null) return i;
76
- let [a] = l;
77
- return a.length >= t.length ? i.slice(t.length) : i;
82
+ let [o] = l;
83
+ return o.length >= t.length ? i.slice(t.length) : i;
78
84
  }).join(`
79
85
  `);
80
86
  }
81
- var q = class {
87
+ var C = class {
82
88
  options;
83
89
  rules;
84
90
  lexer;
85
- constructor(r) {
86
- this.options = r || R;
91
+ constructor(n) {
92
+ this.options = n || R;
87
93
  }
88
- space(r) {
89
- let e = this.rules.block.newline.exec(r);
94
+ space(n) {
95
+ let e = this.rules.block.newline.exec(n);
90
96
  if (e && e[0].length > 0) return { type: "space", raw: e[0] };
91
97
  }
92
- code(r) {
93
- let e = this.rules.block.code.exec(r);
98
+ code(n) {
99
+ let e = this.rules.block.code.exec(n);
94
100
  if (e) {
95
- let n = e[0].replace(this.rules.other.codeRemoveIndent, "");
96
- return { type: "code", raw: e[0], codeBlockStyle: "indented", text: this.options.pedantic ? n : z(n, `
101
+ let r = e[0].replace(this.rules.other.codeRemoveIndent, "");
102
+ return { type: "code", raw: e[0], codeBlockStyle: "indented", text: this.options.pedantic ? r : z(r, `
97
103
  `) };
98
104
  }
99
105
  }
100
- fences(r) {
101
- let e = this.rules.block.fences.exec(r);
106
+ fences(n) {
107
+ let e = this.rules.block.fences.exec(n);
102
108
  if (e) {
103
- let n = e[0], s = Ve(n, e[3] || "", this.rules);
104
- return { type: "code", raw: n, lang: e[2] ? e[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : e[2], text: s };
109
+ let r = e[0], s = Ve(r, e[3] || "", this.rules);
110
+ return { type: "code", raw: r, lang: e[2] ? e[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : e[2], text: s };
105
111
  }
106
112
  }
107
- heading(r) {
108
- let e = this.rules.block.heading.exec(r);
113
+ heading(n) {
114
+ let e = this.rules.block.heading.exec(n);
109
115
  if (e) {
110
- let n = e[2].trim();
111
- if (this.rules.other.endingHash.test(n)) {
112
- let s = z(n, "#");
113
- (this.options.pedantic || !s || this.rules.other.endingSpaceChar.test(s)) && (n = s.trim());
116
+ let r = e[2].trim();
117
+ if (this.rules.other.endingHash.test(r)) {
118
+ let s = z(r, "#");
119
+ (this.options.pedantic || !s || this.rules.other.endingSpaceChar.test(s)) && (r = s.trim());
114
120
  }
115
- return { type: "heading", raw: e[0], depth: e[1].length, text: n, tokens: this.lexer.inline(n) };
121
+ return { type: "heading", raw: e[0], depth: e[1].length, text: r, tokens: this.lexer.inline(r) };
116
122
  }
117
123
  }
118
- hr(r) {
119
- let e = this.rules.block.hr.exec(r);
124
+ hr(n) {
125
+ let e = this.rules.block.hr.exec(n);
120
126
  if (e) return { type: "hr", raw: z(e[0], `
121
127
  `) };
122
128
  }
123
- blockquote(r) {
124
- let e = this.rules.block.blockquote.exec(r);
129
+ blockquote(n) {
130
+ let e = this.rules.block.blockquote.exec(n);
125
131
  if (e) {
126
- let n = z(e[0], `
132
+ let r = z(e[0], `
127
133
  `).split(`
128
134
  `), s = "", t = "", i = [];
129
- for (; n.length > 0; ) {
130
- let l = !1, a = [], o;
131
- for (o = 0; o < n.length; o++) if (this.rules.other.blockquoteStart.test(n[o])) a.push(n[o]), l = !0;
132
- else if (!l) a.push(n[o]);
135
+ for (; r.length > 0; ) {
136
+ let l = !1, o = [], a;
137
+ for (a = 0; a < r.length; a++) if (this.rules.other.blockquoteStart.test(r[a])) o.push(r[a]), l = !0;
138
+ else if (!l) o.push(r[a]);
133
139
  else break;
134
- n = n.slice(o);
135
- let c = a.join(`
136
- `), h = c.replace(this.rules.other.blockquoteSetextReplace, `
140
+ r = r.slice(a);
141
+ let h = o.join(`
142
+ `), c = h.replace(this.rules.other.blockquoteSetextReplace, `
137
143
  $1`).replace(this.rules.other.blockquoteSetextReplace2, "");
138
144
  s = s ? `${s}
139
- ${c}` : c, t = t ? `${t}
140
- ${h}` : h;
141
- let u = this.lexer.state.top;
142
- if (this.lexer.state.top = !0, this.lexer.blockTokens(h, i, !0), this.lexer.state.top = u, n.length === 0) break;
143
- let k = i.at(-1);
144
- if (k?.type === "code") break;
145
- if (k?.type === "blockquote") {
146
- let d = k, f = d.raw + `
147
- ` + n.join(`
145
+ ${h}` : h, t = t ? `${t}
146
+ ${c}` : c;
147
+ let k = this.lexer.state.top;
148
+ if (this.lexer.state.top = !0, this.lexer.blockTokens(c, i, !0), this.lexer.state.top = k, r.length === 0) break;
149
+ let u = i.at(-1);
150
+ if (u?.type === "code") break;
151
+ if (u?.type === "blockquote") {
152
+ let d = u, f = d.raw + `
153
+ ` + r.join(`
148
154
  `), b = this.blockquote(f);
149
155
  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;
150
156
  break;
151
- } else if (k?.type === "list") {
152
- let d = k, f = d.raw + `
153
- ` + n.join(`
157
+ } else if (u?.type === "list") {
158
+ let d = u, f = d.raw + `
159
+ ` + r.join(`
154
160
  `), b = this.list(f);
155
- i[i.length - 1] = b, s = s.substring(0, s.length - k.raw.length) + b.raw, t = t.substring(0, t.length - d.raw.length) + b.raw, n = f.substring(i.at(-1).raw.length).split(`
161
+ i[i.length - 1] = b, s = s.substring(0, s.length - u.raw.length) + b.raw, t = t.substring(0, t.length - d.raw.length) + b.raw, r = f.substring(i.at(-1).raw.length).split(`
156
162
  `);
157
163
  continue;
158
164
  }
@@ -160,108 +166,120 @@ ${h}` : h;
160
166
  return { type: "blockquote", raw: s, tokens: i, text: t };
161
167
  }
162
168
  }
163
- list(r) {
164
- let e = this.rules.block.list.exec(r);
169
+ list(n) {
170
+ let e = this.rules.block.list.exec(n);
165
171
  if (e) {
166
- let n = e[1].trim(), s = n.length > 1, t = { type: "list", raw: "", ordered: s, start: s ? +n.slice(0, -1) : "", loose: !1, items: [] };
167
- n = s ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = s ? n : "[*+-]");
168
- let i = this.rules.other.listItemRegex(n), l = !1;
169
- for (; r; ) {
170
- let o = !1, c = "", h = "";
171
- if (!(e = i.exec(r)) || this.rules.block.hr.test(r)) break;
172
- c = e[0], r = r.substring(c.length);
173
- let u = e[2].split(`
174
- `, 1)[0].replace(this.rules.other.listReplaceTabs, (E) => " ".repeat(3 * E.length)), k = r.split(`
175
- `, 1)[0], d = !u.trim(), f = 0;
176
- if (this.options.pedantic ? (f = 2, h = u.trimStart()) : d ? f = e[1].length + 1 : (f = e[2].search(this.rules.other.nonSpaceChar), f = f > 4 ? 1 : f, h = u.slice(f), f += e[1].length), d && this.rules.other.blankLine.test(k) && (c += k + `
177
- `, r = r.substring(k.length + 1), o = !0), !o) {
178
- let E = this.rules.other.nextBulletRegex(f), K = this.rules.other.hrRegex(f), V = this.rules.other.fencesBeginRegex(f), Y = this.rules.other.headingBeginRegex(f), xe = this.rules.other.htmlBeginRegex(f);
179
- for (; r; ) {
180
- let Z = r.split(`
172
+ let r = e[1].trim(), s = r.length > 1, t = { type: "list", raw: "", ordered: s, start: s ? +r.slice(0, -1) : "", loose: !1, items: [] };
173
+ r = s ? `\\d{1,9}\\${r.slice(-1)}` : `\\${r}`, this.options.pedantic && (r = s ? r : "[*+-]");
174
+ let i = this.rules.other.listItemRegex(r), l = !1;
175
+ for (; n; ) {
176
+ let a = !1, h = "", c = "";
177
+ if (!(e = i.exec(n)) || this.rules.block.hr.test(n)) break;
178
+ h = e[0], n = n.substring(h.length);
179
+ let k = e[2].split(`
180
+ `, 1)[0].replace(this.rules.other.listReplaceTabs, (E) => " ".repeat(3 * E.length)), u = n.split(`
181
+ `, 1)[0], d = !k.trim(), f = 0;
182
+ if (this.options.pedantic ? (f = 2, c = k.trimStart()) : d ? f = e[1].length + 1 : (f = e[2].search(this.rules.other.nonSpaceChar), f = f > 4 ? 1 : f, c = k.slice(f), f += e[1].length), d && this.rules.other.blankLine.test(u) && (h += u + `
183
+ `, n = n.substring(u.length + 1), a = !0), !a) {
184
+ let E = this.rules.other.nextBulletRegex(f), J = this.rules.other.hrRegex(f), K = this.rules.other.fencesBeginRegex(f), V = this.rules.other.headingBeginRegex(f), de = this.rules.other.htmlBeginRegex(f);
185
+ for (; n; ) {
186
+ let Z = n.split(`
181
187
  `, 1)[0], S;
182
- if (k = Z, this.options.pedantic ? (k = k.replace(this.rules.other.listReplaceNesting, " "), S = k) : S = k.replace(this.rules.other.tabCharGlobal, " "), V.test(k) || Y.test(k) || xe.test(k) || E.test(k) || K.test(k)) break;
183
- if (S.search(this.rules.other.nonSpaceChar) >= f || !k.trim()) h += `
188
+ if (u = Z, this.options.pedantic ? (u = u.replace(this.rules.other.listReplaceNesting, " "), S = u) : S = u.replace(this.rules.other.tabCharGlobal, " "), K.test(u) || V.test(u) || de.test(u) || E.test(u) || J.test(u)) break;
189
+ if (S.search(this.rules.other.nonSpaceChar) >= f || !u.trim()) c += `
184
190
  ` + S.slice(f);
185
191
  else {
186
- if (d || u.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || V.test(u) || Y.test(u) || K.test(u)) break;
187
- h += `
188
- ` + k;
192
+ if (d || k.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || K.test(k) || V.test(k) || J.test(k)) break;
193
+ c += `
194
+ ` + u;
189
195
  }
190
- !d && !k.trim() && (d = !0), c += Z + `
191
- `, r = r.substring(Z.length + 1), u = S.slice(f);
196
+ !d && !u.trim() && (d = !0), h += Z + `
197
+ `, n = n.substring(Z.length + 1), k = S.slice(f);
192
198
  }
193
199
  }
194
- t.loose || (l ? t.loose = !0 : this.rules.other.doubleBlankLine.test(c) && (l = !0));
195
- let b = null, J;
196
- this.options.gfm && (b = this.rules.other.listIsTask.exec(h), b && (J = b[0] !== "[ ] ", h = h.replace(this.rules.other.listReplaceTask, ""))), t.items.push({ type: "list_item", raw: c, task: !!b, checked: J, loose: !1, text: h, tokens: [] }), t.raw += c;
200
+ t.loose || (l ? t.loose = !0 : this.rules.other.doubleBlankLine.test(h) && (l = !0));
201
+ let b = null;
202
+ this.options.gfm && (b = this.rules.other.listIsTask.exec(c), b && (c = c.replace(this.rules.other.listReplaceTask, ""))), t.items.push({ type: "list_item", raw: h, task: !!b, loose: !1, text: c, tokens: [] }), t.raw += h;
197
203
  }
198
- let a = t.items.at(-1);
199
- if (a) a.raw = a.raw.trimEnd(), a.text = a.text.trimEnd();
204
+ let o = t.items.at(-1);
205
+ if (o) o.raw = o.raw.trimEnd(), o.text = o.text.trimEnd();
200
206
  else return;
201
207
  t.raw = t.raw.trimEnd();
202
- 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) {
203
- let c = t.items[o].tokens.filter((u) => u.type === "space"), h = c.length > 0 && c.some((u) => this.rules.other.anyLine.test(u.raw));
204
- t.loose = h;
208
+ for (let a of t.items) {
209
+ if (this.lexer.state.top = !1, a.tokens = this.lexer.blockTokens(a.text, []), a.task) {
210
+ let h = this.rules.other.listTaskCheckbox.exec(a.raw);
211
+ if (h) {
212
+ let c = { type: "checkbox", raw: h[0] + " ", checked: h[0] !== "[ ]" };
213
+ a.checked = c.checked, t.loose ? a.tokens[0] && ["paragraph", "text"].includes(a.tokens[0].type) && "tokens" in a.tokens[0] && a.tokens[0].tokens ? (a.tokens[0].raw = c.raw + a.tokens[0].raw, a.tokens[0].text = c.raw + a.tokens[0].text, a.tokens[0].tokens.unshift(c)) : a.tokens.unshift({ type: "paragraph", raw: c.raw, text: c.raw, tokens: [c] }) : a.tokens.unshift(c);
214
+ }
215
+ }
216
+ if (!t.loose) {
217
+ let h = a.tokens.filter((k) => k.type === "space"), c = h.length > 0 && h.some((k) => this.rules.other.anyLine.test(k.raw));
218
+ t.loose = c;
219
+ }
220
+ }
221
+ if (t.loose) for (let a of t.items) {
222
+ a.loose = !0;
223
+ for (let h of a.tokens) h.type === "text" && (h.type = "paragraph");
205
224
  }
206
- if (t.loose) for (let o = 0; o < t.items.length; o++) t.items[o].loose = !0;
207
225
  return t;
208
226
  }
209
227
  }
210
- html(r) {
211
- let e = this.rules.block.html.exec(r);
228
+ html(n) {
229
+ let e = this.rules.block.html.exec(n);
212
230
  if (e) return { type: "html", block: !0, raw: e[0], pre: e[1] === "pre" || e[1] === "script" || e[1] === "style", text: e[0] };
213
231
  }
214
- def(r) {
215
- let e = this.rules.block.def.exec(r);
232
+ def(n) {
233
+ let e = this.rules.block.def.exec(n);
216
234
  if (e) {
217
- 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];
218
- return { type: "def", tag: n, raw: e[0], href: s, title: t };
235
+ let r = e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "), s = e[2] ? e[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", t = e[3] ? e[3].substring(1, e[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : e[3];
236
+ return { type: "def", tag: r, raw: e[0], href: s, title: t };
219
237
  }
220
238
  }
221
- table(r) {
222
- let e = this.rules.block.table.exec(r);
239
+ table(n) {
240
+ let e = this.rules.block.table.exec(n);
223
241
  if (!e || !this.rules.other.tableDelimiter.test(e[2])) return;
224
- let n = se(e[1]), s = e[2].replace(this.rules.other.tableAlignChars, "").split("|"), t = e[3]?.trim() ? e[3].replace(this.rules.other.tableRowBlankLine, "").split(`
242
+ let r = ne(e[1]), s = e[2].replace(this.rules.other.tableAlignChars, "").split("|"), t = e[3]?.trim() ? e[3].replace(this.rules.other.tableRowBlankLine, "").split(`
225
243
  `) : [], i = { type: "table", raw: e[0], header: [], align: [], rows: [] };
226
- if (n.length === s.length) {
244
+ if (r.length === s.length) {
227
245
  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);
228
- 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] });
229
- for (let l of t) i.rows.push(se(l, i.header.length).map((a, o) => ({ text: a, tokens: this.lexer.inline(a), header: !1, align: i.align[o] })));
246
+ for (let l = 0; l < r.length; l++) i.header.push({ text: r[l], tokens: this.lexer.inline(r[l]), header: !0, align: i.align[l] });
247
+ for (let l of t) i.rows.push(ne(l, i.header.length).map((o, a) => ({ text: o, tokens: this.lexer.inline(o), header: !1, align: i.align[a] })));
230
248
  return i;
231
249
  }
232
250
  }
233
- lheading(r) {
234
- let e = this.rules.block.lheading.exec(r);
251
+ lheading(n) {
252
+ let e = this.rules.block.lheading.exec(n);
235
253
  if (e) return { type: "heading", raw: e[0], depth: e[2].charAt(0) === "=" ? 1 : 2, text: e[1], tokens: this.lexer.inline(e[1]) };
236
254
  }
237
- paragraph(r) {
238
- let e = this.rules.block.paragraph.exec(r);
255
+ paragraph(n) {
256
+ let e = this.rules.block.paragraph.exec(n);
239
257
  if (e) {
240
- let n = e[1].charAt(e[1].length - 1) === `
258
+ let r = e[1].charAt(e[1].length - 1) === `
241
259
  ` ? e[1].slice(0, -1) : e[1];
242
- return { type: "paragraph", raw: e[0], text: n, tokens: this.lexer.inline(n) };
260
+ return { type: "paragraph", raw: e[0], text: r, tokens: this.lexer.inline(r) };
243
261
  }
244
262
  }
245
- text(r) {
246
- let e = this.rules.block.text.exec(r);
263
+ text(n) {
264
+ let e = this.rules.block.text.exec(n);
247
265
  if (e) return { type: "text", raw: e[0], text: e[0], tokens: this.lexer.inline(e[0]) };
248
266
  }
249
- escape(r) {
250
- let e = this.rules.inline.escape.exec(r);
267
+ escape(n) {
268
+ let e = this.rules.inline.escape.exec(n);
251
269
  if (e) return { type: "escape", raw: e[0], text: e[1] };
252
270
  }
253
- tag(r) {
254
- let e = this.rules.inline.tag.exec(r);
271
+ tag(n) {
272
+ let e = this.rules.inline.tag.exec(n);
255
273
  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] };
256
274
  }
257
- link(r) {
258
- let e = this.rules.inline.link.exec(r);
275
+ link(n) {
276
+ let e = this.rules.inline.link.exec(n);
259
277
  if (e) {
260
- let n = e[2].trim();
261
- if (!this.options.pedantic && this.rules.other.startAngleBracket.test(n)) {
262
- if (!this.rules.other.endAngleBracket.test(n)) return;
263
- let i = z(n.slice(0, -1), "\\");
264
- if ((n.length - i.length) % 2 === 0) return;
278
+ let r = e[2].trim();
279
+ if (!this.options.pedantic && this.rules.other.startAngleBracket.test(r)) {
280
+ if (!this.rules.other.endAngleBracket.test(r)) return;
281
+ let i = z(r.slice(0, -1), "\\");
282
+ if ((r.length - i.length) % 2 === 0) return;
265
283
  } else {
266
284
  let i = Ke(e[2], "()");
267
285
  if (i === -2) return;
@@ -275,87 +293,87 @@ ${h}` : h;
275
293
  let i = this.rules.other.pedanticHrefTitle.exec(s);
276
294
  i && (s = i[1], t = i[3]);
277
295
  } else t = e[3] ? e[3].slice(1, -1) : "";
278
- 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)), le(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);
296
+ return s = s.trim(), this.rules.other.startAngleBracket.test(s) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(r) ? s = s.slice(1) : s = s.slice(1, -1)), 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);
279
297
  }
280
298
  }
281
- reflink(r, e) {
282
- let n;
283
- if ((n = this.rules.inline.reflink.exec(r)) || (n = this.rules.inline.nolink.exec(r))) {
284
- let s = (n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "), t = e[s.toLowerCase()];
299
+ reflink(n, e) {
300
+ let r;
301
+ if ((r = this.rules.inline.reflink.exec(n)) || (r = this.rules.inline.nolink.exec(n))) {
302
+ let s = (r[2] || r[1]).replace(this.rules.other.multipleSpaceGlobal, " "), t = e[s.toLowerCase()];
285
303
  if (!t) {
286
- let i = n[0].charAt(0);
304
+ let i = r[0].charAt(0);
287
305
  return { type: "text", raw: i, text: i };
288
306
  }
289
- return le(n, t, n[0], this.lexer, this.rules);
307
+ return se(r, t, r[0], this.lexer, this.rules);
290
308
  }
291
309
  }
292
- emStrong(r, e, n = "") {
293
- let s = this.rules.inline.emStrongLDelim.exec(r);
294
- if (!(!s || s[3] && n.match(this.rules.other.unicodeAlphaNumeric)) && (!(s[1] || s[2]) || !n || this.rules.inline.punctuation.exec(n))) {
295
- let t = [...s[0]].length - 1, i, l, a = t, o = 0, c = s[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
296
- for (c.lastIndex = 0, e = e.slice(-1 * r.length + t); (s = c.exec(e)) != null; ) {
310
+ emStrong(n, e, r = "") {
311
+ let s = this.rules.inline.emStrongLDelim.exec(n);
312
+ if (!(!s || s[3] && r.match(this.rules.other.unicodeAlphaNumeric)) && (!(s[1] || s[2]) || !r || this.rules.inline.punctuation.exec(r))) {
313
+ let t = [...s[0]].length - 1, i, l, o = t, a = 0, h = s[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
314
+ for (h.lastIndex = 0, e = e.slice(-1 * n.length + t); (s = h.exec(e)) != null; ) {
297
315
  if (i = s[1] || s[2] || s[3] || s[4] || s[5] || s[6], !i) continue;
298
316
  if (l = [...i].length, s[3] || s[4]) {
299
- a += l;
317
+ o += l;
300
318
  continue;
301
319
  } else if ((s[5] || s[6]) && t % 3 && !((t + l) % 3)) {
302
- o += l;
320
+ a += l;
303
321
  continue;
304
322
  }
305
- if (a -= l, a > 0) continue;
306
- l = Math.min(l, l + a + o);
307
- let h = [...s[0]][0].length, u = r.slice(0, t + s.index + h + l);
323
+ if (o -= l, o > 0) continue;
324
+ l = Math.min(l, l + o + a);
325
+ let c = [...s[0]][0].length, k = n.slice(0, t + s.index + c + l);
308
326
  if (Math.min(t, l) % 2) {
309
- let d = u.slice(1, -1);
310
- return { type: "em", raw: u, text: d, tokens: this.lexer.inlineTokens(d) };
327
+ let d = k.slice(1, -1);
328
+ return { type: "em", raw: k, text: d, tokens: this.lexer.inlineTokens(d) };
311
329
  }
312
- let k = u.slice(2, -2);
313
- return { type: "strong", raw: u, text: k, tokens: this.lexer.inlineTokens(k) };
330
+ let u = k.slice(2, -2);
331
+ return { type: "strong", raw: k, text: u, tokens: this.lexer.inlineTokens(u) };
314
332
  }
315
333
  }
316
334
  }
317
- codespan(r) {
318
- let e = this.rules.inline.code.exec(r);
335
+ codespan(n) {
336
+ let e = this.rules.inline.code.exec(n);
319
337
  if (e) {
320
- 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);
321
- return s && t && (n = n.substring(1, n.length - 1)), { type: "codespan", raw: e[0], text: n };
338
+ let r = e[2].replace(this.rules.other.newLineCharGlobal, " "), s = this.rules.other.nonSpaceChar.test(r), t = this.rules.other.startingSpaceChar.test(r) && this.rules.other.endingSpaceChar.test(r);
339
+ return s && t && (r = r.substring(1, r.length - 1)), { type: "codespan", raw: e[0], text: r };
322
340
  }
323
341
  }
324
- br(r) {
325
- let e = this.rules.inline.br.exec(r);
342
+ br(n) {
343
+ let e = this.rules.inline.br.exec(n);
326
344
  if (e) return { type: "br", raw: e[0] };
327
345
  }
328
- del(r) {
329
- let e = this.rules.inline.del.exec(r);
346
+ del(n) {
347
+ let e = this.rules.inline.del.exec(n);
330
348
  if (e) return { type: "del", raw: e[0], text: e[2], tokens: this.lexer.inlineTokens(e[2]) };
331
349
  }
332
- autolink(r) {
333
- let e = this.rules.inline.autolink.exec(r);
350
+ autolink(n) {
351
+ let e = this.rules.inline.autolink.exec(n);
334
352
  if (e) {
335
- let n, s;
336
- 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 }] };
353
+ let r, s;
354
+ return e[2] === "@" ? (r = e[1], s = "mailto:" + r) : (r = e[1], s = r), { type: "link", raw: e[0], text: r, href: s, tokens: [{ type: "text", raw: r, text: r }] };
337
355
  }
338
356
  }
339
- url(r) {
357
+ url(n) {
340
358
  let e;
341
- if (e = this.rules.inline.url.exec(r)) {
342
- let n, s;
343
- if (e[2] === "@") n = e[0], s = "mailto:" + n;
359
+ if (e = this.rules.inline.url.exec(n)) {
360
+ let r, s;
361
+ if (e[2] === "@") r = e[0], s = "mailto:" + r;
344
362
  else {
345
363
  let t;
346
364
  do
347
365
  t = e[0], e[0] = this.rules.inline._backpedal.exec(e[0])?.[0] ?? "";
348
366
  while (t !== e[0]);
349
- n = e[0], e[1] === "www." ? s = "http://" + e[0] : s = e[0];
367
+ r = e[0], e[1] === "www." ? s = "http://" + e[0] : s = e[0];
350
368
  }
351
- return { type: "link", raw: e[0], text: n, href: s, tokens: [{ type: "text", raw: n, text: n }] };
369
+ return { type: "link", raw: e[0], text: r, href: s, tokens: [{ type: "text", raw: r, text: r }] };
352
370
  }
353
371
  }
354
- inlineText(r) {
355
- let e = this.rules.inline.text.exec(r);
372
+ inlineText(n) {
373
+ let e = this.rules.inline.text.exec(n);
356
374
  if (e) {
357
- let n = this.lexer.state.inRawBlock;
358
- return { type: "text", raw: e[0], text: e[0], escaped: n };
375
+ let r = this.lexer.state.inRawBlock;
376
+ return { type: "text", raw: e[0], text: e[0], escaped: r };
359
377
  }
360
378
  }
361
379
  }, w = class D {
@@ -365,111 +383,111 @@ ${h}` : h;
365
383
  tokenizer;
366
384
  inlineQueue;
367
385
  constructor(e) {
368
- this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || R, this.options.tokenizer = this.options.tokenizer || new q(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 };
369
- let n = { other: x, block: I.normal, inline: T.normal };
370
- this.options.pedantic ? (n.block = I.pedantic, n.inline = T.pedantic) : this.options.gfm && (n.block = I.gfm, this.options.breaks ? n.inline = T.breaks : n.inline = T.gfm), this.tokenizer.rules = n;
386
+ this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || R, this.options.tokenizer = this.options.tokenizer || new C(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 };
387
+ let r = { other: x, block: I.normal, inline: T.normal };
388
+ this.options.pedantic ? (r.block = I.pedantic, r.inline = T.pedantic) : this.options.gfm && (r.block = I.gfm, this.options.breaks ? r.inline = T.breaks : r.inline = T.gfm), this.tokenizer.rules = r;
371
389
  }
372
390
  static get rules() {
373
391
  return { block: I, inline: T };
374
392
  }
375
- static lex(e, n) {
376
- return new D(n).lex(e);
393
+ static lex(e, r) {
394
+ return new D(r).lex(e);
377
395
  }
378
- static lexInline(e, n) {
379
- return new D(n).inlineTokens(e);
396
+ static lexInline(e, r) {
397
+ return new D(r).inlineTokens(e);
380
398
  }
381
399
  lex(e) {
382
400
  e = e.replace(x.carriageReturn, `
383
401
  `), this.blockTokens(e, this.tokens);
384
- for (let n = 0; n < this.inlineQueue.length; n++) {
385
- let s = this.inlineQueue[n];
402
+ for (let r = 0; r < this.inlineQueue.length; r++) {
403
+ let s = this.inlineQueue[r];
386
404
  this.inlineTokens(s.src, s.tokens);
387
405
  }
388
406
  return this.inlineQueue = [], this.tokens;
389
407
  }
390
- blockTokens(e, n = [], s = !1) {
408
+ blockTokens(e, r = [], s = !1) {
391
409
  for (this.options.pedantic && (e = e.replace(x.tabCharGlobal, " ").replace(x.spaceLine, "")); e; ) {
392
410
  let t;
393
- 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;
411
+ if (this.options.extensions?.block?.some((l) => (t = l.call({ lexer: this }, e, r)) ? (e = e.substring(t.raw.length), r.push(t), !0) : !1)) continue;
394
412
  if (t = this.tokenizer.space(e)) {
395
413
  e = e.substring(t.raw.length);
396
- let l = n.at(-1);
414
+ let l = r.at(-1);
397
415
  t.raw.length === 1 && l !== void 0 ? l.raw += `
398
- ` : n.push(t);
416
+ ` : r.push(t);
399
417
  continue;
400
418
  }
401
419
  if (t = this.tokenizer.code(e)) {
402
420
  e = e.substring(t.raw.length);
403
- let l = n.at(-1);
421
+ let l = r.at(-1);
404
422
  l?.type === "paragraph" || l?.type === "text" ? (l.raw += (l.raw.endsWith(`
405
423
  `) ? "" : `
406
424
  `) + t.raw, l.text += `
407
- ` + t.text, this.inlineQueue.at(-1).src = l.text) : n.push(t);
425
+ ` + t.text, this.inlineQueue.at(-1).src = l.text) : r.push(t);
408
426
  continue;
409
427
  }
410
428
  if (t = this.tokenizer.fences(e)) {
411
- e = e.substring(t.raw.length), n.push(t);
429
+ e = e.substring(t.raw.length), r.push(t);
412
430
  continue;
413
431
  }
414
432
  if (t = this.tokenizer.heading(e)) {
415
- e = e.substring(t.raw.length), n.push(t);
433
+ e = e.substring(t.raw.length), r.push(t);
416
434
  continue;
417
435
  }
418
436
  if (t = this.tokenizer.hr(e)) {
419
- e = e.substring(t.raw.length), n.push(t);
437
+ e = e.substring(t.raw.length), r.push(t);
420
438
  continue;
421
439
  }
422
440
  if (t = this.tokenizer.blockquote(e)) {
423
- e = e.substring(t.raw.length), n.push(t);
441
+ e = e.substring(t.raw.length), r.push(t);
424
442
  continue;
425
443
  }
426
444
  if (t = this.tokenizer.list(e)) {
427
- e = e.substring(t.raw.length), n.push(t);
445
+ e = e.substring(t.raw.length), r.push(t);
428
446
  continue;
429
447
  }
430
448
  if (t = this.tokenizer.html(e)) {
431
- e = e.substring(t.raw.length), n.push(t);
449
+ e = e.substring(t.raw.length), r.push(t);
432
450
  continue;
433
451
  }
434
452
  if (t = this.tokenizer.def(e)) {
435
453
  e = e.substring(t.raw.length);
436
- let l = n.at(-1);
454
+ let l = r.at(-1);
437
455
  l?.type === "paragraph" || l?.type === "text" ? (l.raw += (l.raw.endsWith(`
438
456
  `) ? "" : `
439
457
  `) + t.raw, l.text += `
440
- ` + 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 }, n.push(t));
458
+ ` + t.raw, this.inlineQueue.at(-1).src = l.text) : this.tokens.links[t.tag] || (this.tokens.links[t.tag] = { href: t.href, title: t.title }, r.push(t));
441
459
  continue;
442
460
  }
443
461
  if (t = this.tokenizer.table(e)) {
444
- e = e.substring(t.raw.length), n.push(t);
462
+ e = e.substring(t.raw.length), r.push(t);
445
463
  continue;
446
464
  }
447
465
  if (t = this.tokenizer.lheading(e)) {
448
- e = e.substring(t.raw.length), n.push(t);
466
+ e = e.substring(t.raw.length), r.push(t);
449
467
  continue;
450
468
  }
451
469
  let i = e;
452
470
  if (this.options.extensions?.startBlock) {
453
- let l = 1 / 0, a = e.slice(1), o;
454
- this.options.extensions.startBlock.forEach((c) => {
455
- o = c.call({ lexer: this }, a), typeof o == "number" && o >= 0 && (l = Math.min(l, o));
471
+ let l = 1 / 0, o = e.slice(1), a;
472
+ this.options.extensions.startBlock.forEach((h) => {
473
+ a = h.call({ lexer: this }, o), typeof a == "number" && a >= 0 && (l = Math.min(l, a));
456
474
  }), l < 1 / 0 && l >= 0 && (i = e.substring(0, l + 1));
457
475
  }
458
476
  if (this.state.top && (t = this.tokenizer.paragraph(i))) {
459
- let l = n.at(-1);
477
+ let l = r.at(-1);
460
478
  s && l?.type === "paragraph" ? (l.raw += (l.raw.endsWith(`
461
479
  `) ? "" : `
462
480
  `) + t.raw, l.text += `
463
- ` + 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);
481
+ ` + t.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = l.text) : r.push(t), s = i.length !== e.length, e = e.substring(t.raw.length);
464
482
  continue;
465
483
  }
466
484
  if (t = this.tokenizer.text(e)) {
467
485
  e = e.substring(t.raw.length);
468
- let l = n.at(-1);
486
+ let l = r.at(-1);
469
487
  l?.type === "text" ? (l.raw += (l.raw.endsWith(`
470
488
  `) ? "" : `
471
489
  `) + t.raw, l.text += `
472
- ` + t.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = l.text) : n.push(t);
490
+ ` + t.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = l.text) : r.push(t);
473
491
  continue;
474
492
  }
475
493
  if (e) {
@@ -480,78 +498,79 @@ ${h}` : h;
480
498
  } else throw new Error(l);
481
499
  }
482
500
  }
483
- return this.state.top = !0, n;
501
+ return this.state.top = !0, r;
484
502
  }
485
- inline(e, n = []) {
486
- return this.inlineQueue.push({ src: e, tokens: n }), n;
503
+ inline(e, r = []) {
504
+ return this.inlineQueue.push({ src: e, tokens: r }), r;
487
505
  }
488
- inlineTokens(e, n = []) {
506
+ inlineTokens(e, r = []) {
489
507
  let s = e, t = null;
490
508
  if (this.tokens.links) {
491
509
  let a = Object.keys(this.tokens.links);
492
510
  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));
493
511
  }
494
512
  for (; (t = this.tokenizer.rules.inline.anyPunctuation.exec(s)) != null; ) s = s.slice(0, t.index) + "++" + s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
495
- 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);
513
+ let i;
514
+ for (; (t = this.tokenizer.rules.inline.blockSkip.exec(s)) != null; ) i = t[2] ? t[2].length : 0, s = s.slice(0, t.index + i) + "[" + "a".repeat(t[0].length - i - 2) + "]" + s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
496
515
  s = this.options.hooks?.emStrongMask?.call({ lexer: this }, s) ?? s;
497
- let i = !1, l = "";
516
+ let l = !1, o = "";
498
517
  for (; e; ) {
499
- i || (l = ""), i = !1;
518
+ l || (o = ""), l = !1;
500
519
  let a;
501
- 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;
520
+ if (this.options.extensions?.inline?.some((c) => (a = c.call({ lexer: this }, e, r)) ? (e = e.substring(a.raw.length), r.push(a), !0) : !1)) continue;
502
521
  if (a = this.tokenizer.escape(e)) {
503
- e = e.substring(a.raw.length), n.push(a);
522
+ e = e.substring(a.raw.length), r.push(a);
504
523
  continue;
505
524
  }
506
525
  if (a = this.tokenizer.tag(e)) {
507
- e = e.substring(a.raw.length), n.push(a);
526
+ e = e.substring(a.raw.length), r.push(a);
508
527
  continue;
509
528
  }
510
529
  if (a = this.tokenizer.link(e)) {
511
- e = e.substring(a.raw.length), n.push(a);
530
+ e = e.substring(a.raw.length), r.push(a);
512
531
  continue;
513
532
  }
514
533
  if (a = this.tokenizer.reflink(e, this.tokens.links)) {
515
534
  e = e.substring(a.raw.length);
516
- let c = n.at(-1);
517
- a.type === "text" && c?.type === "text" ? (c.raw += a.raw, c.text += a.text) : n.push(a);
535
+ let c = r.at(-1);
536
+ a.type === "text" && c?.type === "text" ? (c.raw += a.raw, c.text += a.text) : r.push(a);
518
537
  continue;
519
538
  }
520
- if (a = this.tokenizer.emStrong(e, s, l)) {
521
- e = e.substring(a.raw.length), n.push(a);
539
+ if (a = this.tokenizer.emStrong(e, s, o)) {
540
+ e = e.substring(a.raw.length), r.push(a);
522
541
  continue;
523
542
  }
524
543
  if (a = this.tokenizer.codespan(e)) {
525
- e = e.substring(a.raw.length), n.push(a);
544
+ e = e.substring(a.raw.length), r.push(a);
526
545
  continue;
527
546
  }
528
547
  if (a = this.tokenizer.br(e)) {
529
- e = e.substring(a.raw.length), n.push(a);
548
+ e = e.substring(a.raw.length), r.push(a);
530
549
  continue;
531
550
  }
532
551
  if (a = this.tokenizer.del(e)) {
533
- e = e.substring(a.raw.length), n.push(a);
552
+ e = e.substring(a.raw.length), r.push(a);
534
553
  continue;
535
554
  }
536
555
  if (a = this.tokenizer.autolink(e)) {
537
- e = e.substring(a.raw.length), n.push(a);
556
+ e = e.substring(a.raw.length), r.push(a);
538
557
  continue;
539
558
  }
540
559
  if (!this.state.inLink && (a = this.tokenizer.url(e))) {
541
- e = e.substring(a.raw.length), n.push(a);
560
+ e = e.substring(a.raw.length), r.push(a);
542
561
  continue;
543
562
  }
544
- let o = e;
563
+ let h = e;
545
564
  if (this.options.extensions?.startInline) {
546
- let c = 1 / 0, h = e.slice(1), u;
547
- this.options.extensions.startInline.forEach((k) => {
548
- u = k.call({ lexer: this }, h), typeof u == "number" && u >= 0 && (c = Math.min(c, u));
549
- }), c < 1 / 0 && c >= 0 && (o = e.substring(0, c + 1));
565
+ let c = 1 / 0, k = e.slice(1), u;
566
+ this.options.extensions.startInline.forEach((d) => {
567
+ u = d.call({ lexer: this }, k), typeof u == "number" && u >= 0 && (c = Math.min(c, u));
568
+ }), c < 1 / 0 && c >= 0 && (h = e.substring(0, c + 1));
550
569
  }
551
- if (a = this.tokenizer.inlineText(o)) {
552
- e = e.substring(a.raw.length), a.raw.slice(-1) !== "_" && (l = a.raw.slice(-1)), i = !0;
553
- let c = n.at(-1);
554
- c?.type === "text" ? (c.raw += a.raw, c.text += a.text) : n.push(a);
570
+ if (a = this.tokenizer.inlineText(h)) {
571
+ e = e.substring(a.raw.length), a.raw.slice(-1) !== "_" && (o = a.raw.slice(-1)), l = !0;
572
+ let c = r.at(-1);
573
+ c?.type === "text" ? (c.raw += a.raw, c.text += a.text) : r.push(a);
555
574
  continue;
556
575
  }
557
576
  if (e) {
@@ -562,80 +581,75 @@ ${h}` : h;
562
581
  } else throw new Error(c);
563
582
  }
564
583
  }
565
- return n;
584
+ return r;
566
585
  }
567
- }, v = class {
586
+ }, q = class {
568
587
  options;
569
588
  parser;
570
- constructor(r) {
571
- this.options = r || R;
589
+ constructor(n) {
590
+ this.options = n || R;
572
591
  }
573
- space(r) {
592
+ space(n) {
574
593
  return "";
575
594
  }
576
- code({ text: r, lang: e, escaped: n }) {
577
- let s = (e || "").match(x.notSpaceStart)?.[0], t = r.replace(x.endingNewline, "") + `
595
+ code({ text: n, lang: e, escaped: r }) {
596
+ let s = (e || "").match(x.notSpaceStart)?.[0], t = n.replace(x.endingNewline, "") + `
578
597
  `;
579
- return s ? '<pre><code class="language-' + y(s) + '">' + (n ? t : y(t, !0)) + `</code></pre>
580
- ` : "<pre><code>" + (n ? t : y(t, !0)) + `</code></pre>
598
+ return s ? '<pre><code class="language-' + y(s) + '">' + (r ? t : y(t, !0)) + `</code></pre>
599
+ ` : "<pre><code>" + (r ? t : y(t, !0)) + `</code></pre>
581
600
  `;
582
601
  }
583
- blockquote({ tokens: r }) {
602
+ blockquote({ tokens: n }) {
584
603
  return `<blockquote>
585
- ${this.parser.parse(r)}</blockquote>
604
+ ${this.parser.parse(n)}</blockquote>
586
605
  `;
587
606
  }
588
- html({ text: r }) {
589
- return r;
607
+ html({ text: n }) {
608
+ return n;
590
609
  }
591
- def(r) {
610
+ def(n) {
592
611
  return "";
593
612
  }
594
- heading({ tokens: r, depth: e }) {
595
- return `<h${e}>${this.parser.parseInline(r)}</h${e}>
613
+ heading({ tokens: n, depth: e }) {
614
+ return `<h${e}>${this.parser.parseInline(n)}</h${e}>
596
615
  `;
597
616
  }
598
- hr(r) {
617
+ hr(n) {
599
618
  return `<hr>
600
619
  `;
601
620
  }
602
- list(r) {
603
- let e = r.ordered, n = r.start, s = "";
604
- for (let l = 0; l < r.items.length; l++) {
605
- let a = r.items[l];
606
- s += this.listitem(a);
621
+ list(n) {
622
+ let e = n.ordered, r = n.start, s = "";
623
+ for (let l = 0; l < n.items.length; l++) {
624
+ let o = n.items[l];
625
+ s += this.listitem(o);
607
626
  }
608
- let t = e ? "ol" : "ul", i = e && n !== 1 ? ' start="' + n + '"' : "";
627
+ let t = e ? "ol" : "ul", i = e && r !== 1 ? ' start="' + r + '"' : "";
609
628
  return "<" + t + i + `>
610
629
  ` + s + "</" + t + `>
611
630
  `;
612
631
  }
613
- listitem(r) {
614
- let e = "";
615
- if (r.task) {
616
- let n = this.checkbox({ checked: !!r.checked });
617
- 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 + " " + y(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 + " ";
618
- }
619
- return e += this.parser.parse(r.tokens, !!r.loose), `<li>${e}</li>
632
+ listitem(n) {
633
+ return `<li>${this.parser.parse(n.tokens)}</li>
620
634
  `;
621
635
  }
622
- checkbox({ checked: r }) {
623
- return "<input " + (r ? 'checked="" ' : "") + 'disabled="" type="checkbox">';
636
+ checkbox({ checked: n }) {
637
+ return "<input " + (n ? 'checked="" ' : "") + 'disabled="" type="checkbox"> ';
624
638
  }
625
- paragraph({ tokens: r }) {
626
- return `<p>${this.parser.parseInline(r)}</p>
639
+ paragraph({ tokens: n }) {
640
+ return `<p>${this.parser.parseInline(n)}</p>
627
641
  `;
628
642
  }
629
- table(r) {
630
- let e = "", n = "";
631
- for (let t = 0; t < r.header.length; t++) n += this.tablecell(r.header[t]);
632
- e += this.tablerow({ text: n });
643
+ table(n) {
644
+ let e = "", r = "";
645
+ for (let t = 0; t < n.header.length; t++) r += this.tablecell(n.header[t]);
646
+ e += this.tablerow({ text: r });
633
647
  let s = "";
634
- for (let t = 0; t < r.rows.length; t++) {
635
- let i = r.rows[t];
636
- n = "";
637
- for (let l = 0; l < i.length; l++) n += this.tablecell(i[l]);
638
- s += this.tablerow({ text: n });
648
+ for (let t = 0; t < n.rows.length; t++) {
649
+ let i = n.rows[t];
650
+ r = "";
651
+ for (let l = 0; l < i.length; l++) r += this.tablecell(i[l]);
652
+ s += this.tablerow({ text: r });
639
653
  }
640
654
  return s && (s = `<tbody>${s}</tbody>`), `<table>
641
655
  <thead>
@@ -643,216 +657,224 @@ ${this.parser.parse(r)}</blockquote>
643
657
  ` + s + `</table>
644
658
  `;
645
659
  }
646
- tablerow({ text: r }) {
660
+ tablerow({ text: n }) {
647
661
  return `<tr>
648
- ${r}</tr>
662
+ ${n}</tr>
649
663
  `;
650
664
  }
651
- tablecell(r) {
652
- let e = this.parser.parseInline(r.tokens), n = r.header ? "th" : "td";
653
- return (r.align ? `<${n} align="${r.align}">` : `<${n}>`) + e + `</${n}>
665
+ tablecell(n) {
666
+ let e = this.parser.parseInline(n.tokens), r = n.header ? "th" : "td";
667
+ return (n.align ? `<${r} align="${n.align}">` : `<${r}>`) + e + `</${r}>
654
668
  `;
655
669
  }
656
- strong({ tokens: r }) {
657
- return `<strong>${this.parser.parseInline(r)}</strong>`;
670
+ strong({ tokens: n }) {
671
+ return `<strong>${this.parser.parseInline(n)}</strong>`;
658
672
  }
659
- em({ tokens: r }) {
660
- return `<em>${this.parser.parseInline(r)}</em>`;
673
+ em({ tokens: n }) {
674
+ return `<em>${this.parser.parseInline(n)}</em>`;
661
675
  }
662
- codespan({ text: r }) {
663
- return `<code>${y(r, !0)}</code>`;
676
+ codespan({ text: n }) {
677
+ return `<code>${y(n, !0)}</code>`;
664
678
  }
665
- br(r) {
679
+ br(n) {
666
680
  return "<br>";
667
681
  }
668
- del({ tokens: r }) {
669
- return `<del>${this.parser.parseInline(r)}</del>`;
682
+ del({ tokens: n }) {
683
+ return `<del>${this.parser.parseInline(n)}</del>`;
670
684
  }
671
- link({ href: r, title: e, tokens: n }) {
672
- let s = this.parser.parseInline(n), t = ne(r);
685
+ link({ href: n, title: e, tokens: r }) {
686
+ let s = this.parser.parseInline(r), t = re(n);
673
687
  if (t === null) return s;
674
- r = t;
675
- let i = '<a href="' + r + '"';
688
+ n = t;
689
+ let i = '<a href="' + n + '"';
676
690
  return e && (i += ' title="' + y(e) + '"'), i += ">" + s + "</a>", i;
677
691
  }
678
- image({ href: r, title: e, text: n, tokens: s }) {
679
- s && (n = this.parser.parseInline(s, this.parser.textRenderer));
680
- let t = ne(r);
681
- if (t === null) return y(n);
682
- r = t;
683
- let i = `<img src="${r}" alt="${n}"`;
692
+ image({ href: n, title: e, text: r, tokens: s }) {
693
+ s && (r = this.parser.parseInline(s, this.parser.textRenderer));
694
+ let t = re(n);
695
+ if (t === null) return y(r);
696
+ n = t;
697
+ let i = `<img src="${n}" alt="${r}"`;
684
698
  return e && (i += ` title="${y(e)}"`), i += ">", i;
685
699
  }
686
- text(r) {
687
- return "tokens" in r && r.tokens ? this.parser.parseInline(r.tokens) : "escaped" in r && r.escaped ? r.text : y(r.text);
700
+ text(n) {
701
+ return "tokens" in n && n.tokens ? this.parser.parseInline(n.tokens) : "escaped" in n && n.escaped ? n.text : y(n.text);
688
702
  }
689
703
  }, U = class {
690
- strong({ text: r }) {
691
- return r;
704
+ strong({ text: n }) {
705
+ return n;
692
706
  }
693
- em({ text: r }) {
694
- return r;
707
+ em({ text: n }) {
708
+ return n;
695
709
  }
696
- codespan({ text: r }) {
697
- return r;
710
+ codespan({ text: n }) {
711
+ return n;
698
712
  }
699
- del({ text: r }) {
700
- return r;
713
+ del({ text: n }) {
714
+ return n;
701
715
  }
702
- html({ text: r }) {
703
- return r;
716
+ html({ text: n }) {
717
+ return n;
704
718
  }
705
- text({ text: r }) {
706
- return r;
719
+ text({ text: n }) {
720
+ return n;
707
721
  }
708
- link({ text: r }) {
709
- return "" + r;
722
+ link({ text: n }) {
723
+ return "" + n;
710
724
  }
711
- image({ text: r }) {
712
- return "" + r;
725
+ image({ text: n }) {
726
+ return "" + n;
713
727
  }
714
728
  br() {
715
729
  return "";
716
730
  }
731
+ checkbox({ raw: n }) {
732
+ return n;
733
+ }
717
734
  }, m = class O {
718
735
  options;
719
736
  renderer;
720
737
  textRenderer;
721
738
  constructor(e) {
722
- this.options = e || R, this.options.renderer = this.options.renderer || new v(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new U();
723
- }
724
- static parse(e, n) {
725
- return new O(n).parse(e);
726
- }
727
- static parseInline(e, n) {
728
- return new O(n).parseInline(e);
729
- }
730
- parse(e, n = !0) {
731
- let s = "";
732
- for (let t = 0; t < e.length; t++) {
733
- let i = e[t];
734
- if (this.options.extensions?.renderers?.[i.type]) {
735
- let a = i, o = this.options.extensions.renderers[a.type].call({ parser: this }, a);
736
- if (o !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "def", "paragraph", "text"].includes(a.type)) {
737
- s += o || "";
739
+ this.options = e || R, this.options.renderer = this.options.renderer || new q(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new U();
740
+ }
741
+ static parse(e, r) {
742
+ return new O(r).parse(e);
743
+ }
744
+ static parseInline(e, r) {
745
+ return new O(r).parseInline(e);
746
+ }
747
+ parse(e) {
748
+ let r = "";
749
+ for (let s = 0; s < e.length; s++) {
750
+ let t = e[s];
751
+ if (this.options.extensions?.renderers?.[t.type]) {
752
+ let l = t, o = this.options.extensions.renderers[l.type].call({ parser: this }, l);
753
+ if (o !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "def", "paragraph", "text"].includes(l.type)) {
754
+ r += o || "";
738
755
  continue;
739
756
  }
740
757
  }
741
- let l = i;
742
- switch (l.type) {
758
+ let i = t;
759
+ switch (i.type) {
743
760
  case "space": {
744
- s += this.renderer.space(l);
745
- continue;
761
+ r += this.renderer.space(i);
762
+ break;
746
763
  }
747
764
  case "hr": {
748
- s += this.renderer.hr(l);
749
- continue;
765
+ r += this.renderer.hr(i);
766
+ break;
750
767
  }
751
768
  case "heading": {
752
- s += this.renderer.heading(l);
753
- continue;
769
+ r += this.renderer.heading(i);
770
+ break;
754
771
  }
755
772
  case "code": {
756
- s += this.renderer.code(l);
757
- continue;
773
+ r += this.renderer.code(i);
774
+ break;
758
775
  }
759
776
  case "table": {
760
- s += this.renderer.table(l);
761
- continue;
777
+ r += this.renderer.table(i);
778
+ break;
762
779
  }
763
780
  case "blockquote": {
764
- s += this.renderer.blockquote(l);
765
- continue;
781
+ r += this.renderer.blockquote(i);
782
+ break;
766
783
  }
767
784
  case "list": {
768
- s += this.renderer.list(l);
769
- continue;
785
+ r += this.renderer.list(i);
786
+ break;
787
+ }
788
+ case "checkbox": {
789
+ r += this.renderer.checkbox(i);
790
+ break;
770
791
  }
771
792
  case "html": {
772
- s += this.renderer.html(l);
773
- continue;
793
+ r += this.renderer.html(i);
794
+ break;
774
795
  }
775
796
  case "def": {
776
- s += this.renderer.def(l);
777
- continue;
797
+ r += this.renderer.def(i);
798
+ break;
778
799
  }
779
800
  case "paragraph": {
780
- s += this.renderer.paragraph(l);
781
- continue;
801
+ r += this.renderer.paragraph(i);
802
+ break;
782
803
  }
783
804
  case "text": {
784
- let a = l, o = this.renderer.text(a);
785
- for (; t + 1 < e.length && e[t + 1].type === "text"; ) a = e[++t], o += `
786
- ` + this.renderer.text(a);
787
- n ? s += this.renderer.paragraph({ type: "paragraph", raw: o, text: o, tokens: [{ type: "text", raw: o, text: o, escaped: !0 }] }) : s += o;
788
- continue;
805
+ r += this.renderer.text(i);
806
+ break;
789
807
  }
790
808
  default: {
791
- let a = 'Token with "' + l.type + '" type was not found.';
792
- if (this.options.silent) return console.error(a), "";
793
- throw new Error(a);
809
+ let l = 'Token with "' + i.type + '" type was not found.';
810
+ if (this.options.silent) return console.error(l), "";
811
+ throw new Error(l);
794
812
  }
795
813
  }
796
814
  }
797
- return s;
815
+ return r;
798
816
  }
799
- parseInline(e, n = this.renderer) {
817
+ parseInline(e, r = this.renderer) {
800
818
  let s = "";
801
819
  for (let t = 0; t < e.length; t++) {
802
820
  let i = e[t];
803
821
  if (this.options.extensions?.renderers?.[i.type]) {
804
- let a = this.options.extensions.renderers[i.type].call({ parser: this }, i);
805
- if (a !== !1 || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(i.type)) {
806
- s += a || "";
822
+ let o = this.options.extensions.renderers[i.type].call({ parser: this }, i);
823
+ if (o !== !1 || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(i.type)) {
824
+ s += o || "";
807
825
  continue;
808
826
  }
809
827
  }
810
828
  let l = i;
811
829
  switch (l.type) {
812
830
  case "escape": {
813
- s += n.text(l);
831
+ s += r.text(l);
814
832
  break;
815
833
  }
816
834
  case "html": {
817
- s += n.html(l);
835
+ s += r.html(l);
818
836
  break;
819
837
  }
820
838
  case "link": {
821
- s += n.link(l);
839
+ s += r.link(l);
822
840
  break;
823
841
  }
824
842
  case "image": {
825
- s += n.image(l);
843
+ s += r.image(l);
844
+ break;
845
+ }
846
+ case "checkbox": {
847
+ s += r.checkbox(l);
826
848
  break;
827
849
  }
828
850
  case "strong": {
829
- s += n.strong(l);
851
+ s += r.strong(l);
830
852
  break;
831
853
  }
832
854
  case "em": {
833
- s += n.em(l);
855
+ s += r.em(l);
834
856
  break;
835
857
  }
836
858
  case "codespan": {
837
- s += n.codespan(l);
859
+ s += r.codespan(l);
838
860
  break;
839
861
  }
840
862
  case "br": {
841
- s += n.br(l);
863
+ s += r.br(l);
842
864
  break;
843
865
  }
844
866
  case "del": {
845
- s += n.del(l);
867
+ s += r.del(l);
846
868
  break;
847
869
  }
848
870
  case "text": {
849
- s += n.text(l);
871
+ s += r.text(l);
850
872
  break;
851
873
  }
852
874
  default: {
853
- let a = 'Token with "' + l.type + '" type was not found.';
854
- if (this.options.silent) return console.error(a), "";
855
- throw new Error(a);
875
+ let o = 'Token with "' + l.type + '" type was not found.';
876
+ if (this.options.silent) return console.error(o), "";
877
+ throw new Error(o);
856
878
  }
857
879
  }
858
880
  }
@@ -861,22 +883,22 @@ ${r}</tr>
861
883
  }, A = class {
862
884
  options;
863
885
  block;
864
- constructor(r) {
865
- this.options = r || R;
886
+ constructor(n) {
887
+ this.options = n || R;
866
888
  }
867
889
  static passThroughHooks = /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"]);
868
890
  static passThroughHooksRespectAsync = /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"]);
869
- preprocess(r) {
870
- return r;
891
+ preprocess(n) {
892
+ return n;
871
893
  }
872
- postprocess(r) {
873
- return r;
894
+ postprocess(n) {
895
+ return n;
874
896
  }
875
- processAllTokens(r) {
876
- return r;
897
+ processAllTokens(n) {
898
+ return n;
877
899
  }
878
- emStrongMask(r) {
879
- return r;
900
+ emStrongMask(n) {
901
+ return n;
880
902
  }
881
903
  provideLexer() {
882
904
  return this.block ? w.lex : w.lexInline;
@@ -890,49 +912,49 @@ ${r}</tr>
890
912
  parse = this.parseMarkdown(!0);
891
913
  parseInline = this.parseMarkdown(!1);
892
914
  Parser = m;
893
- Renderer = v;
915
+ Renderer = q;
894
916
  TextRenderer = U;
895
917
  Lexer = w;
896
- Tokenizer = q;
918
+ Tokenizer = C;
897
919
  Hooks = A;
898
- constructor(...r) {
899
- this.use(...r);
920
+ constructor(...n) {
921
+ this.use(...n);
900
922
  }
901
- walkTokens(r, e) {
902
- let n = [];
903
- for (let s of r) switch (n = n.concat(e.call(this, s)), s.type) {
923
+ walkTokens(n, e) {
924
+ let r = [];
925
+ for (let s of n) switch (r = r.concat(e.call(this, s)), s.type) {
904
926
  case "table": {
905
927
  let t = s;
906
- for (let i of t.header) n = n.concat(this.walkTokens(i.tokens, e));
907
- for (let i of t.rows) for (let l of i) n = n.concat(this.walkTokens(l.tokens, e));
928
+ for (let i of t.header) r = r.concat(this.walkTokens(i.tokens, e));
929
+ for (let i of t.rows) for (let l of i) r = r.concat(this.walkTokens(l.tokens, e));
908
930
  break;
909
931
  }
910
932
  case "list": {
911
933
  let t = s;
912
- n = n.concat(this.walkTokens(t.items, e));
934
+ r = r.concat(this.walkTokens(t.items, e));
913
935
  break;
914
936
  }
915
937
  default: {
916
938
  let t = s;
917
939
  this.defaults.extensions?.childTokens?.[t.type] ? this.defaults.extensions.childTokens[t.type].forEach((i) => {
918
940
  let l = t[i].flat(1 / 0);
919
- n = n.concat(this.walkTokens(l, e));
920
- }) : t.tokens && (n = n.concat(this.walkTokens(t.tokens, e)));
941
+ r = r.concat(this.walkTokens(l, e));
942
+ }) : t.tokens && (r = r.concat(this.walkTokens(t.tokens, e)));
921
943
  }
922
944
  }
923
- return n;
945
+ return r;
924
946
  }
925
- use(...r) {
947
+ use(...n) {
926
948
  let e = this.defaults.extensions || { renderers: {}, childTokens: {} };
927
- return r.forEach((n) => {
928
- let s = { ...n };
929
- if (s.async = this.defaults.async || s.async || !1, n.extensions && (n.extensions.forEach((t) => {
949
+ return n.forEach((r) => {
950
+ let s = { ...r };
951
+ if (s.async = this.defaults.async || s.async || !1, r.extensions && (r.extensions.forEach((t) => {
930
952
  if (!t.name) throw new Error("extension name required");
931
953
  if ("renderer" in t) {
932
954
  let i = e.renderers[t.name];
933
955
  i ? e.renderers[t.name] = function(...l) {
934
- let a = t.renderer.apply(this, l);
935
- return a === !1 && (a = i.apply(this, l)), a;
956
+ let o = t.renderer.apply(this, l);
957
+ return o === !1 && (o = i.apply(this, l)), o;
936
958
  } : e.renderers[t.name] = t.renderer;
937
959
  }
938
960
  if ("tokenizer" in t) {
@@ -941,132 +963,132 @@ ${r}</tr>
941
963
  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]));
942
964
  }
943
965
  "childTokens" in t && t.childTokens && (e.childTokens[t.name] = t.childTokens);
944
- }), s.extensions = e), n.renderer) {
945
- let t = this.defaults.renderer || new v(this.defaults);
946
- for (let i in n.renderer) {
966
+ }), s.extensions = e), r.renderer) {
967
+ let t = this.defaults.renderer || new q(this.defaults);
968
+ for (let i in r.renderer) {
947
969
  if (!(i in t)) throw new Error(`renderer '${i}' does not exist`);
948
970
  if (["options", "parser"].includes(i)) continue;
949
- let l = i, a = n.renderer[l], o = t[l];
950
- t[l] = (...c) => {
951
- let h = a.apply(t, c);
952
- return h === !1 && (h = o.apply(t, c)), h || "";
971
+ let l = i, o = r.renderer[l], a = t[l];
972
+ t[l] = (...h) => {
973
+ let c = o.apply(t, h);
974
+ return c === !1 && (c = a.apply(t, h)), c || "";
953
975
  };
954
976
  }
955
977
  s.renderer = t;
956
978
  }
957
- if (n.tokenizer) {
958
- let t = this.defaults.tokenizer || new q(this.defaults);
959
- for (let i in n.tokenizer) {
979
+ if (r.tokenizer) {
980
+ let t = this.defaults.tokenizer || new C(this.defaults);
981
+ for (let i in r.tokenizer) {
960
982
  if (!(i in t)) throw new Error(`tokenizer '${i}' does not exist`);
961
983
  if (["options", "rules", "lexer"].includes(i)) continue;
962
- let l = i, a = n.tokenizer[l], o = t[l];
963
- t[l] = (...c) => {
964
- let h = a.apply(t, c);
965
- return h === !1 && (h = o.apply(t, c)), h;
984
+ let l = i, o = r.tokenizer[l], a = t[l];
985
+ t[l] = (...h) => {
986
+ let c = o.apply(t, h);
987
+ return c === !1 && (c = a.apply(t, h)), c;
966
988
  };
967
989
  }
968
990
  s.tokenizer = t;
969
991
  }
970
- if (n.hooks) {
992
+ if (r.hooks) {
971
993
  let t = this.defaults.hooks || new A();
972
- for (let i in n.hooks) {
994
+ for (let i in r.hooks) {
973
995
  if (!(i in t)) throw new Error(`hook '${i}' does not exist`);
974
996
  if (["options", "block"].includes(i)) continue;
975
- let l = i, a = n.hooks[l], o = t[l];
976
- A.passThroughHooks.has(i) ? t[l] = (c) => {
997
+ let l = i, o = r.hooks[l], a = t[l];
998
+ A.passThroughHooks.has(i) ? t[l] = (h) => {
977
999
  if (this.defaults.async && A.passThroughHooksRespectAsync.has(i)) return (async () => {
978
- let u = await a.call(t, c);
979
- return o.call(t, u);
1000
+ let k = await o.call(t, h);
1001
+ return a.call(t, k);
980
1002
  })();
981
- let h = a.call(t, c);
982
- return o.call(t, h);
983
- } : t[l] = (...c) => {
1003
+ let c = o.call(t, h);
1004
+ return a.call(t, c);
1005
+ } : t[l] = (...h) => {
984
1006
  if (this.defaults.async) return (async () => {
985
- let u = await a.apply(t, c);
986
- return u === !1 && (u = await o.apply(t, c)), u;
1007
+ let k = await o.apply(t, h);
1008
+ return k === !1 && (k = await a.apply(t, h)), k;
987
1009
  })();
988
- let h = a.apply(t, c);
989
- return h === !1 && (h = o.apply(t, c)), h;
1010
+ let c = o.apply(t, h);
1011
+ return c === !1 && (c = a.apply(t, h)), c;
990
1012
  };
991
1013
  }
992
1014
  s.hooks = t;
993
1015
  }
994
- if (n.walkTokens) {
995
- let t = this.defaults.walkTokens, i = n.walkTokens;
1016
+ if (r.walkTokens) {
1017
+ let t = this.defaults.walkTokens, i = r.walkTokens;
996
1018
  s.walkTokens = function(l) {
997
- let a = [];
998
- return a.push(i.call(this, l)), t && (a = a.concat(t.call(this, l))), a;
1019
+ let o = [];
1020
+ return o.push(i.call(this, l)), t && (o = o.concat(t.call(this, l))), o;
999
1021
  };
1000
1022
  }
1001
1023
  this.defaults = { ...this.defaults, ...s };
1002
1024
  }), this;
1003
1025
  }
1004
- setOptions(r) {
1005
- return this.defaults = { ...this.defaults, ...r }, this;
1026
+ setOptions(n) {
1027
+ return this.defaults = { ...this.defaults, ...n }, this;
1006
1028
  }
1007
- lexer(r, e) {
1008
- return w.lex(r, e ?? this.defaults);
1029
+ lexer(n, e) {
1030
+ return w.lex(n, e ?? this.defaults);
1009
1031
  }
1010
- parser(r, e) {
1011
- return m.parse(r, e ?? this.defaults);
1032
+ parser(n, e) {
1033
+ return m.parse(n, e ?? this.defaults);
1012
1034
  }
1013
- parseMarkdown(r) {
1014
- return (e, n) => {
1015
- let s = { ...n }, t = { ...this.defaults, ...s }, i = this.onError(!!t.silent, !!t.async);
1035
+ parseMarkdown(n) {
1036
+ return (e, r) => {
1037
+ let s = { ...r }, t = { ...this.defaults, ...s }, i = this.onError(!!t.silent, !!t.async);
1016
1038
  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."));
1017
1039
  if (typeof e > "u" || e === null) return i(new Error("marked(): input parameter is undefined or null"));
1018
1040
  if (typeof e != "string") return i(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(e) + ", string expected"));
1019
- if (t.hooks && (t.hooks.options = t, t.hooks.block = r), t.async) return (async () => {
1020
- let l = t.hooks ? await t.hooks.preprocess(e) : e, a = await (t.hooks ? await t.hooks.provideLexer() : r ? w.lex : w.lexInline)(l, t), o = t.hooks ? await t.hooks.processAllTokens(a) : a;
1021
- t.walkTokens && await Promise.all(this.walkTokens(o, t.walkTokens));
1022
- let c = await (t.hooks ? await t.hooks.provideParser() : r ? m.parse : m.parseInline)(o, t);
1023
- return t.hooks ? await t.hooks.postprocess(c) : c;
1041
+ if (t.hooks && (t.hooks.options = t, t.hooks.block = n), t.async) return (async () => {
1042
+ let l = t.hooks ? await t.hooks.preprocess(e) : e, o = await (t.hooks ? await t.hooks.provideLexer() : n ? w.lex : w.lexInline)(l, t), a = t.hooks ? await t.hooks.processAllTokens(o) : o;
1043
+ t.walkTokens && await Promise.all(this.walkTokens(a, t.walkTokens));
1044
+ let h = await (t.hooks ? await t.hooks.provideParser() : n ? m.parse : m.parseInline)(a, t);
1045
+ return t.hooks ? await t.hooks.postprocess(h) : h;
1024
1046
  })().catch(i);
1025
1047
  try {
1026
1048
  t.hooks && (e = t.hooks.preprocess(e));
1027
- let l = (t.hooks ? t.hooks.provideLexer() : r ? w.lex : w.lexInline)(e, t);
1049
+ let l = (t.hooks ? t.hooks.provideLexer() : n ? w.lex : w.lexInline)(e, t);
1028
1050
  t.hooks && (l = t.hooks.processAllTokens(l)), t.walkTokens && this.walkTokens(l, t.walkTokens);
1029
- let a = (t.hooks ? t.hooks.provideParser() : r ? m.parse : m.parseInline)(l, t);
1030
- return t.hooks && (a = t.hooks.postprocess(a)), a;
1051
+ let o = (t.hooks ? t.hooks.provideParser() : n ? m.parse : m.parseInline)(l, t);
1052
+ return t.hooks && (o = t.hooks.postprocess(o)), o;
1031
1053
  } catch (l) {
1032
1054
  return i(l);
1033
1055
  }
1034
1056
  };
1035
1057
  }
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>" + y(n.message + "", !0) + "</pre>";
1058
+ onError(n, e) {
1059
+ return (r) => {
1060
+ if (r.message += `
1061
+ Please report this to https://github.com/markedjs/marked.`, n) {
1062
+ let s = "<p>An error occurred:</p><pre>" + y(r.message + "", !0) + "</pre>";
1041
1063
  return e ? Promise.resolve(s) : s;
1042
1064
  }
1043
- if (e) return Promise.reject(n);
1044
- throw n;
1065
+ if (e) return Promise.reject(r);
1066
+ throw r;
1045
1067
  };
1046
1068
  }
1047
1069
  }, $ = new Ye();
1048
- function g(r, e) {
1049
- return $.parse(r, e);
1070
+ function g(n, e) {
1071
+ return $.parse(n, e);
1050
1072
  }
1051
- g.options = g.setOptions = function(r) {
1052
- return $.setOptions(r), g.defaults = $.defaults, ie(g.defaults), g;
1073
+ g.options = g.setOptions = function(n) {
1074
+ return $.setOptions(n), g.defaults = $.defaults, le(g.defaults), g;
1053
1075
  };
1054
1076
  g.getDefaults = H;
1055
1077
  g.defaults = R;
1056
- g.use = function(...r) {
1057
- return $.use(...r), g.defaults = $.defaults, ie(g.defaults), g;
1078
+ g.use = function(...n) {
1079
+ return $.use(...n), g.defaults = $.defaults, le(g.defaults), g;
1058
1080
  };
1059
- g.walkTokens = function(r, e) {
1060
- return $.walkTokens(r, e);
1081
+ g.walkTokens = function(n, e) {
1082
+ return $.walkTokens(n, e);
1061
1083
  };
1062
1084
  g.parseInline = $.parseInline;
1063
1085
  g.Parser = m;
1064
1086
  g.parser = m.parse;
1065
- g.Renderer = v;
1087
+ g.Renderer = q;
1066
1088
  g.TextRenderer = U;
1067
1089
  g.Lexer = w;
1068
1090
  g.lexer = w.lex;
1069
- g.Tokenizer = q;
1091
+ g.Tokenizer = C;
1070
1092
  g.Hooks = A;
1071
1093
  g.parse = g;
1072
1094
  g.options;
@@ -1081,17 +1103,17 @@ g.use({
1081
1103
  breaks: !0,
1082
1104
  async: !1,
1083
1105
  renderer: {
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>`;
1106
+ link({ href: n, title: e, tokens: r }) {
1107
+ const s = this.parser.parseInline(r);
1108
+ return `<calcite-link href="${n}" title="${e ?? s}" target="Arcade Help">${s}</calcite-link>`;
1087
1109
  },
1088
- code({ lang: r, text: e }) {
1089
- return `<arcgis-code-viewer language="${r === "sql" ? "arcgis-sql-expression" : r}">${e}</arcgis-code-viewer>`;
1110
+ code({ lang: n, text: e }) {
1111
+ return `<arcgis-code-viewer language="${n === "sql" ? "arcgis-sql-expression" : n}">${e}</arcgis-code-viewer>`;
1090
1112
  }
1091
1113
  }
1092
1114
  });
1093
- function et(r) {
1094
- return r == null ? "" : g.parse(typeof r == "string" ? r : r.value, { async: !1 });
1115
+ function et(n) {
1116
+ return n == null ? "" : g.parse(typeof n == "string" ? n : n.value, { async: !1 });
1095
1117
  }
1096
1118
  export {
1097
1119
  et as c