@vizel/core 0.0.1-alpha.5 → 1.0.0

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