@prokodo/ui 0.1.5 → 0.1.6

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