@webskill/sdk 0.20.0 → 0.22.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 (139) hide show
  1. package/dist/abnfDiagram-O67JEVCF-DtYFjfqO.js +109 -0
  2. package/dist/agent.d.ts +3 -3
  3. package/dist/agent.js +1171 -73
  4. package/dist/{approval-Bbh_Apwg.js → approval-DWQlDPbY.js} +527 -29
  5. package/dist/arc-8U_6NQWm.js +130 -0
  6. package/dist/architecture-7GRP2DOG-RTw1wpAq.js +4 -0
  7. package/dist/architectureDiagram-NJMV4G6O-XmmXrJAK.js +7473 -0
  8. package/dist/array-DQfpQNY8.js +8 -0
  9. package/dist/blockDiagram-BEXU5L5S-D4yjnCD1.js +2582 -0
  10. package/dist/browser.d.ts +1129 -48
  11. package/dist/browser.js +3562 -278
  12. package/dist/c4Diagram-YGBWAQC7-BLmA_JSd.js +3668 -0
  13. package/dist/channel-CZxxLrG7.js +9 -0
  14. package/dist/chunk-2Q5K7J3B-Ck03gkFR.js +21 -0
  15. package/dist/chunk-3FUC2YCW-tr6jmbQf.js +530 -0
  16. package/dist/chunk-5DYCD2WN-Bt97YGTd.js +58 -0
  17. package/dist/chunk-5VM5RSS4-BBxa48HL.js +21 -0
  18. package/dist/chunk-6AEJRKK7-JXK89I-O.js +14 -0
  19. package/dist/chunk-742MDFTN-CPmgCGwC.js +466 -0
  20. package/dist/chunk-7INBJB4K-C9jq9o66.js +6552 -0
  21. package/dist/chunk-7M6MHVWA-BrKCWcR1.js +4894 -0
  22. package/dist/chunk-7PRAP22T-BHED6GVs.js +95 -0
  23. package/dist/chunk-DUW6YSOI-DoZj78PO.js +19 -0
  24. package/dist/chunk-FOHPRMQF-Dkbp819z.js +27189 -0
  25. package/dist/chunk-GNY47TPC-Bpvq1T49.js +87 -0
  26. package/dist/chunk-GTNCS2PH-CLmh4I2c.js +686 -0
  27. package/dist/chunk-GWA4HPMP-B6vN3fkL.js +95 -0
  28. package/dist/chunk-J5ZVWO5B-Bi_Pcobw.js +26 -0
  29. package/dist/chunk-JWPE2WC7-D1rC79GS.js +12 -0
  30. package/dist/chunk-LNGE3PJU-D5OIoe3Z.js +2582 -0
  31. package/dist/chunk-MBY4JIJT-C34L7a4f.js +2276 -0
  32. package/dist/chunk-NETBCI7D-Cg84k8N8.js +321 -0
  33. package/dist/chunk-O7XYJQB3-B6K0KOSL.js +8846 -0
  34. package/dist/chunk-UA2S7LBM-DxHM29_K.js +612 -0
  35. package/dist/chunk-WEXAMYUT-Ba6jFWhB.js +33 -0
  36. package/dist/chunk-XXDRQBXY-DPbSy4kg.js +12 -0
  37. package/dist/chunk-Y2CYZVJY-U3QOMqrW.js +15 -0
  38. package/dist/chunk-Z7XXMR3K-oLg1h8F3.js +1038 -0
  39. package/dist/chunk-ZIGJFQKS-DqEFBuHR.js +2215 -0
  40. package/dist/classDiagram-v2-NBCMYWYE-BqnOWIUt.js +3845 -0
  41. package/dist/cose-bilkent-JH36ORCC-C0dTAHVK.js +4270 -0
  42. package/dist/cynefin-OW5HDTMX-B2QvgEQj.js +4 -0
  43. package/dist/cynefinDiagram-VND7K2PF-yAWc6Z3W.js +479 -0
  44. package/dist/cytoscape.esm-C64mRh9B.js +28325 -0
  45. package/dist/dagre-6A5THRUB-D0w2W27v.js +4816 -0
  46. package/dist/defaultLocale-B_EoOkSF.js +249 -0
  47. package/dist/diagram-22UHCM2B-DvgzhUzP.js +6115 -0
  48. package/dist/diagram-3UASUU5V-DWgUB-ef.js +795 -0
  49. package/dist/diagram-ATOU4E4O-P1olqwIs.js +553 -0
  50. package/dist/diagram-CDSNMT55-BUlZuLUe.js +402 -0
  51. package/dist/diagram-MLGK6HIB-6w5qmkGt.js +186 -0
  52. package/dist/diagram-MPIPVDR6-DEFiSo8o.js +289 -0
  53. package/dist/dist-UajCDt3n.js +92 -0
  54. package/dist/ebnfDiagram-ZINNZB2B-CI8liCfR.js +123 -0
  55. package/dist/elk-276RUBZZ-3SvW6OAK.js +90034 -0
  56. package/dist/erDiagram-OPXOYQCR-CPTbKhwP.js +2301 -0
  57. package/dist/{eventTypes-CwciaqCU.js → eventTypes-DcTQXSV1.js} +7 -1
  58. package/dist/eventmodeling-NTZA5JFV-BlyuqGp0.js +4 -0
  59. package/dist/flowDiagram-KWPJA3E3-CcUJ6HbV.js +18 -0
  60. package/dist/ganttDiagram-FUAMR5RP-31UjY0KK.js +3939 -0
  61. package/dist/geometry-wx5ZTYzi.js +715 -0
  62. package/dist/gitGraph-4MIJSDKK-ChdVlrk7.js +4 -0
  63. package/dist/gitGraphDiagram-X574FWY7-DKuxJymB.js +1153 -0
  64. package/dist/governance.d.ts +9 -3
  65. package/dist/governance.js +1 -1
  66. package/dist/graphlib-tk9gQYuN.js +4194 -0
  67. package/dist/{index-ad11wflI.d.ts → index-BiO9_XRk.d.ts} +2 -2
  68. package/dist/{index-DQ3-6GFu.d.ts → index-CjwdZQOS.d.ts} +945 -8
  69. package/dist/{index-BDyXe-a5.d.ts → index-YPd8ZSEa.d.ts} +413 -7
  70. package/dist/index.d.ts +4 -4
  71. package/dist/index.js +47 -41
  72. package/dist/info-A6RAGUB7-CxRAt9S9.js +4 -0
  73. package/dist/infoDiagram-VRGFBTTK-pRspGfjZ.js +25 -0
  74. package/dist/init-CMOIWdg-.js +16 -0
  75. package/dist/ishikawaDiagram-OU5B5YK6-DKerAPAg.js +975 -0
  76. package/dist/journeyDiagram-ZHPQQLJL-C4MK-YO5.js +1227 -0
  77. package/dist/kanban-definition-PNTS6WVX-BqsZpMXx.js +1244 -0
  78. package/dist/katex-BcRRvyh_.js +26465 -0
  79. package/dist/kind-Dc8x0HWz.js +110 -0
  80. package/dist/line-LgV8iVMV.js +48 -0
  81. package/dist/linear-BWKR0Tqd.js +393 -0
  82. package/dist/linkedDocument-CIuh_Yp0.js +416 -0
  83. package/dist/mcp.d.ts +2 -2
  84. package/dist/{memoryArtifactStore-D6dLeY55.js → memoryArtifactStore-Bs7glPqm.js} +14 -0
  85. package/dist/mermaid-parser.core-pYR5siSx.js +754 -0
  86. package/dist/mermaid.core-DMtwGCHy.js +1756 -0
  87. package/dist/mindmap-definition-NLK3R4M7-CXbD-myG.js +1312 -0
  88. package/dist/node.d.ts +8 -3
  89. package/dist/node.js +79 -4
  90. package/dist/{openUiLibrary-b0i7F_oZ.js → openUiLibrary-B7j3rLrm.js} +1 -1
  91. package/dist/{openUiSpecLang-CLXJEeRU.js → openUiSpecLang-BSYYnjay.js} +1 -1
  92. package/dist/ordinal-CxA6GHQS.js +84 -0
  93. package/dist/packet-AYTQ26CC-BOm08cxl.js +4 -0
  94. package/dist/path-C27Z2Bjv.js +106 -0
  95. package/dist/pegDiagram-GJSIUBJH-BLGJOewQ.js +115 -0
  96. package/dist/pie-WAS4IAKB-Dvg7glpk.js +4 -0
  97. package/dist/pieDiagram-5QR66LMP-laoaV_PB.js +298 -0
  98. package/dist/processSandboxEntry.js +5 -0
  99. package/dist/quadrantDiagram-O4NWA36T-Db_wFBkT.js +2236 -0
  100. package/dist/radar-RG4KPBEZ-BZDaTu06.js +4 -0
  101. package/dist/railroad-74A4TZTK-C-UhjkOy.js +4 -0
  102. package/dist/railroad-abnf-HS5TGJTU-dUKVA4OS.js +4 -0
  103. package/dist/railroad-ebnf-LZEXJU2U-DzQumk18.js +4 -0
  104. package/dist/railroad-peg-WCYAUIDC-B3vvTWed.js +4 -0
  105. package/dist/railroadDiagram-XR7U4H2S-BY0sTM4X.js +89 -0
  106. package/dist/requirementDiagram-PLB6GJNP-3rkQfEhs.js +2474 -0
  107. package/dist/rough.cjs-AmDd_NQk.js +1395 -0
  108. package/dist/sandboxWorkerEntry.js +5 -0
  109. package/dist/sankeyDiagram-IPEJSGJF-CGAJhyG2.js +3578 -0
  110. package/dist/sequenceDiagram-PO4LG4MO-9FJjFX06.js +5522 -0
  111. package/dist/sizeCapture-INFHLROL-D8PWxdOn.js +56 -0
  112. package/dist/{skillVersionStore-B24Jjjry-v2CCU0Xo.d.ts → skillVersionStore-B24Jjjry-BY1H7Krp.d.ts} +1 -1
  113. package/dist/src-NkhI3UMl.js +2653 -0
  114. package/dist/stateDiagram-v2-GCMORJYK-B0O3wc1-.js +2715 -0
  115. package/dist/swimlanes-2SLR337P-D4EOnrpu.js +6637 -0
  116. package/dist/swimlanesDiagram-TC7HE7FX-BUx29EJ9.js +30 -0
  117. package/dist/testing.d.ts +2 -1
  118. package/dist/testing.js +1 -1
  119. package/dist/timeline-definition-EJHVYXUP-CrgiiB4C.js +1513 -0
  120. package/dist/treeView-Q6P3EWNA-C1by-Gzc.js +4 -0
  121. package/dist/treemap-WGGIJYW6-mC2NZ6ad.js +4 -0
  122. package/dist/{types-Btpdd1y--BcxQ10Fa.d.ts → types-CpDRZ0rA-BM5FI9oN.d.ts} +111 -9
  123. package/dist/ui-react.d.ts +3 -3
  124. package/dist/ui-react.js +3718 -77
  125. package/dist/ui-vue.d.ts +1 -1
  126. package/dist/ui.d.ts +3 -3
  127. package/dist/ui.js +2 -2
  128. package/dist/untrustedText-BIaRvPZK.js +16 -0
  129. package/dist/usecaseDiagram-POWQR4AR-BUt_TQOY.js +14397 -0
  130. package/dist/vennDiagram-UO4OBE2U-CwXr0wjA.js +2808 -0
  131. package/dist/wardley-WFR3VGLG-CVSYjq_S.js +4 -0
  132. package/dist/wardleyDiagram-VNRHLVJA-Cpfd47dQ.js +874 -0
  133. package/dist/{webSkillApi-CsvA69qk.js → webSkillApi-Dy-Zjv0y.js} +1 -1
  134. package/dist/{webskillLitCatalog-W06npwej.js → webskillLitCatalog-D5BCiMCU.js} +1 -1
  135. package/dist/xychartDiagram-PMCCYNJV-e1TeVoc6.js +2704 -0
  136. package/package.json +6 -5
  137. package/dist/kind-DxgS8LM-.js +0 -77
  138. package/dist/linkedDocument-xNXF-z8n.js +0 -94
  139. package/dist/types-DOJI5YC3.js +0 -90
@@ -0,0 +1,2276 @@
1
+ import { n as __name } from "./chunk-Y2CYZVJY-U3QOMqrW.js";
2
+ import { m as log, p as select_default } from "./src-NkhI3UMl.js";
3
+ import { A as hasKatex, F as renderKatexSanitized, b as getConfig, s as common_default, z as sanitizeText } from "./chunk-O7XYJQB3-B6K0KOSL.js";
4
+ import { a as decodeEntities } from "./chunk-ZIGJFQKS-DqEFBuHR.js";
5
+ import { n as isIconAvailable, t as getIconSVG } from "./chunk-742MDFTN-CPmgCGwC.js";
6
+
7
+ //#region ../../node_modules/.pnpm/marked@16.4.2/node_modules/marked/lib/marked.esm.js
8
+ /**
9
+ * marked v16.4.2 - a markdown parser
10
+ * Copyright (c) 2018-2025, MarkedJS. (MIT License)
11
+ * Copyright (c) 2011-2018, Christopher Jeffrey. (MIT License)
12
+ * https://github.com/markedjs/marked
13
+ */
14
+ /**
15
+ * DO NOT EDIT THIS FILE
16
+ * The code in this file is generated from files in ./src/
17
+ */
18
+ function L() {
19
+ return {
20
+ async: !1,
21
+ breaks: !1,
22
+ extensions: null,
23
+ gfm: !0,
24
+ hooks: null,
25
+ pedantic: !1,
26
+ renderer: null,
27
+ silent: !1,
28
+ tokenizer: null,
29
+ walkTokens: null
30
+ };
31
+ }
32
+ var T = L();
33
+ function G(l) {
34
+ T = l;
35
+ }
36
+ var E = { exec: () => null };
37
+ function d(l, e = "") {
38
+ let t = typeof l == "string" ? l : l.source, n = {
39
+ replace: (r, i) => {
40
+ let s = typeof i == "string" ? i : i.source;
41
+ return s = s.replace(m.caret, "$1"), t = t.replace(r, s), n;
42
+ },
43
+ getRegex: () => new RegExp(t, e)
44
+ };
45
+ return n;
46
+ }
47
+ var be = (() => {
48
+ try {
49
+ return true;
50
+ } catch {
51
+ return !1;
52
+ }
53
+ })();
54
+ var m = {
55
+ codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm,
56
+ outputLinkReplace: /\\([\[\]])/g,
57
+ indentCodeCompensation: /^(\s+)(?:```)/,
58
+ beginningSpace: /^\s+/,
59
+ endingHash: /#$/,
60
+ startingSpaceChar: /^ /,
61
+ endingSpaceChar: / $/,
62
+ nonSpaceChar: /[^ ]/,
63
+ newLineCharGlobal: /\n/g,
64
+ tabCharGlobal: /\t/g,
65
+ multipleSpaceGlobal: /\s+/g,
66
+ blankLine: /^[ \t]*$/,
67
+ doubleBlankLine: /\n[ \t]*\n[ \t]*$/,
68
+ blockquoteStart: /^ {0,3}>/,
69
+ blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g,
70
+ blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm,
71
+ listReplaceTabs: /^\t+/,
72
+ listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g,
73
+ listIsTask: /^\[[ xX]\] /,
74
+ listReplaceTask: /^\[[ xX]\] +/,
75
+ anyLine: /\n.*\n/,
76
+ hrefBrackets: /^<(.*)>$/,
77
+ tableDelimiter: /[:|]/,
78
+ tableAlignChars: /^\||\| *$/g,
79
+ tableRowBlankLine: /\n[ \t]*$/,
80
+ tableAlignRight: /^ *-+: *$/,
81
+ tableAlignCenter: /^ *:-+: *$/,
82
+ tableAlignLeft: /^ *:-+ *$/,
83
+ startATag: /^<a /i,
84
+ endATag: /^<\/a>/i,
85
+ startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i,
86
+ endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i,
87
+ startAngleBracket: /^</,
88
+ endAngleBracket: />$/,
89
+ pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/,
90
+ unicodeAlphaNumeric: /[\p{L}\p{N}]/u,
91
+ escapeTest: /[&<>"']/,
92
+ escapeReplace: /[&<>"']/g,
93
+ escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,
94
+ escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,
95
+ unescapeTest: /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,
96
+ caret: /(^|[^\[])\^/g,
97
+ percentDecode: /%25/g,
98
+ findPipe: /\|/g,
99
+ splitPipe: / \|/,
100
+ slashPipe: /\\\|/g,
101
+ carriageReturn: /\r\n|\r/g,
102
+ spaceLine: /^ +$/gm,
103
+ notSpaceStart: /^\S*/,
104
+ endingNewline: /\n$/,
105
+ listItemRegex: (l) => new RegExp(`^( {0,3}${l})((?:[ ][^\\n]*)?(?:\\n|$))`),
106
+ nextBulletRegex: (l) => new RegExp(`^ {0,${Math.min(3, l - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),
107
+ hrRegex: (l) => new RegExp(`^ {0,${Math.min(3, l - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),
108
+ fencesBeginRegex: (l) => new RegExp(`^ {0,${Math.min(3, l - 1)}}(?:\`\`\`|~~~)`),
109
+ headingBeginRegex: (l) => new RegExp(`^ {0,${Math.min(3, l - 1)}}#`),
110
+ htmlBeginRegex: (l) => new RegExp(`^ {0,${Math.min(3, l - 1)}}<(?:[a-z].*>|!--)`, "i")
111
+ };
112
+ var Re = /^(?:[ \t]*(?:\n|$))+/;
113
+ var Te = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/;
114
+ var Oe = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/;
115
+ var I = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/;
116
+ var we = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/;
117
+ var F = /(?:[*+-]|\d{1,9}[.)])/;
118
+ var ie = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/;
119
+ var oe = d(ie).replace(/bull/g, F).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();
120
+ var ye = d(ie).replace(/bull/g, F).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();
121
+ var j = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/;
122
+ var Pe = /^[^\n]+/;
123
+ var Q = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/;
124
+ var Se = d(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", Q).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex();
125
+ var $e = d(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, F).getRegex();
126
+ var 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";
127
+ var U = /<!--(?:-?>|[\s\S]*?(?:-->|$))/;
128
+ var _e = d("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", U).replace("tag", v).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
129
+ var ae = d(j).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();
130
+ var K = {
131
+ blockquote: d(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", ae).getRegex(),
132
+ code: Te,
133
+ def: Se,
134
+ fences: Oe,
135
+ heading: we,
136
+ hr: I,
137
+ html: _e,
138
+ lheading: oe,
139
+ list: $e,
140
+ newline: Re,
141
+ paragraph: ae,
142
+ table: E,
143
+ text: Pe
144
+ };
145
+ var re = d("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex();
146
+ var Me = {
147
+ ...K,
148
+ lheading: ye,
149
+ table: re,
150
+ paragraph: d(j).replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", re).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()
151
+ };
152
+ var ze = {
153
+ ...K,
154
+ html: d(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", U).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(),
155
+ def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
156
+ heading: /^(#{1,6})(.*)(?:\n+|$)/,
157
+ fences: E,
158
+ lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
159
+ paragraph: d(j).replace("hr", I).replace("heading", ` *#{1,6} *[^
160
+ ]`).replace("lheading", oe).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
161
+ };
162
+ var Ae = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/;
163
+ var Ee = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/;
164
+ var le = /^( {2,}|\\)\n(?!\s*$)/;
165
+ var Ie = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/;
166
+ var D = /[\p{P}\p{S}]/u;
167
+ var W = /[\s\p{P}\p{S}]/u;
168
+ var ue = /[^\s\p{P}\p{S}]/u;
169
+ var Ce = d(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, W).getRegex();
170
+ var pe = /(?!~)[\p{P}\p{S}]/u;
171
+ var Be = /(?!~)[\s\p{P}\p{S}]/u;
172
+ var qe = /(?:[^\s\p{P}\p{S}]|~)/u;
173
+ var ve = d(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", be ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex();
174
+ var ce = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/;
175
+ var De = d(ce, "u").replace(/punct/g, D).getRegex();
176
+ var He = d(ce, "u").replace(/punct/g, pe).getRegex();
177
+ var he = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)";
178
+ var Ze = d(he, "gu").replace(/notPunctSpace/g, ue).replace(/punctSpace/g, W).replace(/punct/g, D).getRegex();
179
+ var Ge = d(he, "gu").replace(/notPunctSpace/g, qe).replace(/punctSpace/g, Be).replace(/punct/g, pe).getRegex();
180
+ var Ne = d("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, ue).replace(/punctSpace/g, W).replace(/punct/g, D).getRegex();
181
+ var Fe = d(/\\(punct)/, "gu").replace(/punct/g, D).getRegex();
182
+ var je = d(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex();
183
+ var Qe = d(U).replace("(?:-->|$)", "-->").getRegex();
184
+ var Ue = d("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", Qe).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex();
185
+ var q = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/;
186
+ var Ke = d(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", q).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex();
187
+ var de = d(/^!?\[(label)\]\[(ref)\]/).replace("label", q).replace("ref", Q).getRegex();
188
+ var ke = d(/^!?\[(ref)\](?:\[\])?/).replace("ref", Q).getRegex();
189
+ var We = d("reflink|nolink(?!\\()", "g").replace("reflink", de).replace("nolink", ke).getRegex();
190
+ var se = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/;
191
+ var X = {
192
+ _backpedal: E,
193
+ anyPunctuation: Fe,
194
+ autolink: je,
195
+ blockSkip: ve,
196
+ br: le,
197
+ code: Ee,
198
+ del: E,
199
+ emStrongLDelim: De,
200
+ emStrongRDelimAst: Ze,
201
+ emStrongRDelimUnd: Ne,
202
+ escape: Ae,
203
+ link: Ke,
204
+ nolink: ke,
205
+ punctuation: Ce,
206
+ reflink: de,
207
+ reflinkSearch: We,
208
+ tag: Ue,
209
+ text: Ie,
210
+ url: E
211
+ };
212
+ var Xe = {
213
+ ...X,
214
+ link: d(/^!?\[(label)\]\((.*?)\)/).replace("label", q).getRegex(),
215
+ reflink: d(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", q).getRegex()
216
+ };
217
+ var N = {
218
+ ...X,
219
+ emStrongRDelimAst: Ge,
220
+ emStrongLDelim: He,
221
+ url: d(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", se).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
222
+ _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
223
+ del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
224
+ text: d(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", se).getRegex()
225
+ };
226
+ var Je = {
227
+ ...N,
228
+ br: d(le).replace("{2,}", "*").getRegex(),
229
+ text: d(N.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
230
+ };
231
+ var C = {
232
+ normal: K,
233
+ gfm: Me,
234
+ pedantic: ze
235
+ };
236
+ var M = {
237
+ normal: X,
238
+ gfm: N,
239
+ breaks: Je,
240
+ pedantic: Xe
241
+ };
242
+ var Ve = {
243
+ "&": "&amp;",
244
+ "<": "&lt;",
245
+ ">": "&gt;",
246
+ "\"": "&quot;",
247
+ "'": "&#39;"
248
+ };
249
+ var ge = (l) => Ve[l];
250
+ function w(l, e) {
251
+ if (e) {
252
+ if (m.escapeTest.test(l)) return l.replace(m.escapeReplace, ge);
253
+ } else if (m.escapeTestNoEncode.test(l)) return l.replace(m.escapeReplaceNoEncode, ge);
254
+ return l;
255
+ }
256
+ function J(l) {
257
+ try {
258
+ l = encodeURI(l).replace(m.percentDecode, "%");
259
+ } catch {
260
+ return null;
261
+ }
262
+ return l;
263
+ }
264
+ function V(l, e) {
265
+ let n = l.replace(m.findPipe, (i, s, a) => {
266
+ let o = !1, p = s;
267
+ for (; --p >= 0 && a[p] === "\\";) o = !o;
268
+ return o ? "|" : " |";
269
+ }).split(m.splitPipe), r = 0;
270
+ if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), e) if (n.length > e) n.splice(e);
271
+ else for (; n.length < e;) n.push("");
272
+ for (; r < n.length; r++) n[r] = n[r].trim().replace(m.slashPipe, "|");
273
+ return n;
274
+ }
275
+ function z(l, e, t) {
276
+ let n = l.length;
277
+ if (n === 0) return "";
278
+ let r = 0;
279
+ for (; r < n;) {
280
+ let i = l.charAt(n - r - 1);
281
+ if (i === e && !t) r++;
282
+ else if (i !== e && t) r++;
283
+ else break;
284
+ }
285
+ return l.slice(0, n - r);
286
+ }
287
+ function fe(l, e) {
288
+ if (l.indexOf(e[1]) === -1) return -1;
289
+ let t = 0;
290
+ for (let n = 0; n < l.length; n++) if (l[n] === "\\") n++;
291
+ else if (l[n] === e[0]) t++;
292
+ else if (l[n] === e[1] && (t--, t < 0)) return n;
293
+ return t > 0 ? -2 : -1;
294
+ }
295
+ function me(l, e, t, n, r) {
296
+ let i = e.href, s = e.title || null, a = l[1].replace(r.other.outputLinkReplace, "$1");
297
+ n.state.inLink = !0;
298
+ let o = {
299
+ type: l[0].charAt(0) === "!" ? "image" : "link",
300
+ raw: t,
301
+ href: i,
302
+ title: s,
303
+ text: a,
304
+ tokens: n.inlineTokens(a)
305
+ };
306
+ return n.state.inLink = !1, o;
307
+ }
308
+ function Ye(l, e, t) {
309
+ let n = l.match(t.other.indentCodeCompensation);
310
+ if (n === null) return e;
311
+ let r = n[1];
312
+ return e.split(`
313
+ `).map((i) => {
314
+ let s = i.match(t.other.beginningSpace);
315
+ if (s === null) return i;
316
+ let [a] = s;
317
+ return a.length >= r.length ? i.slice(r.length) : i;
318
+ }).join(`
319
+ `);
320
+ }
321
+ var y = class {
322
+ options;
323
+ rules;
324
+ lexer;
325
+ constructor(e) {
326
+ this.options = e || T;
327
+ }
328
+ space(e) {
329
+ let t = this.rules.block.newline.exec(e);
330
+ if (t && t[0].length > 0) return {
331
+ type: "space",
332
+ raw: t[0]
333
+ };
334
+ }
335
+ code(e) {
336
+ let t = this.rules.block.code.exec(e);
337
+ if (t) {
338
+ let n = t[0].replace(this.rules.other.codeRemoveIndent, "");
339
+ return {
340
+ type: "code",
341
+ raw: t[0],
342
+ codeBlockStyle: "indented",
343
+ text: this.options.pedantic ? n : z(n, `
344
+ `)
345
+ };
346
+ }
347
+ }
348
+ fences(e) {
349
+ let t = this.rules.block.fences.exec(e);
350
+ if (t) {
351
+ let n = t[0], r = Ye(n, t[3] || "", this.rules);
352
+ return {
353
+ type: "code",
354
+ raw: n,
355
+ lang: t[2] ? t[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t[2],
356
+ text: r
357
+ };
358
+ }
359
+ }
360
+ heading(e) {
361
+ let t = this.rules.block.heading.exec(e);
362
+ if (t) {
363
+ let n = t[2].trim();
364
+ if (this.rules.other.endingHash.test(n)) {
365
+ let r = z(n, "#");
366
+ (this.options.pedantic || !r || this.rules.other.endingSpaceChar.test(r)) && (n = r.trim());
367
+ }
368
+ return {
369
+ type: "heading",
370
+ raw: t[0],
371
+ depth: t[1].length,
372
+ text: n,
373
+ tokens: this.lexer.inline(n)
374
+ };
375
+ }
376
+ }
377
+ hr(e) {
378
+ let t = this.rules.block.hr.exec(e);
379
+ if (t) return {
380
+ type: "hr",
381
+ raw: z(t[0], `
382
+ `)
383
+ };
384
+ }
385
+ blockquote(e) {
386
+ let t = this.rules.block.blockquote.exec(e);
387
+ if (t) {
388
+ let n = z(t[0], `
389
+ `).split(`
390
+ `), r = "", i = "", s = [];
391
+ for (; n.length > 0;) {
392
+ let a = !1, o = [], p;
393
+ for (p = 0; p < n.length; p++) if (this.rules.other.blockquoteStart.test(n[p])) o.push(n[p]), a = !0;
394
+ else if (!a) o.push(n[p]);
395
+ else break;
396
+ n = n.slice(p);
397
+ let u = o.join(`
398
+ `), c = u.replace(this.rules.other.blockquoteSetextReplace, `
399
+ $1`).replace(this.rules.other.blockquoteSetextReplace2, "");
400
+ r = r ? `${r}
401
+ ${u}` : u, i = i ? `${i}
402
+ ${c}` : c;
403
+ let g = this.lexer.state.top;
404
+ if (this.lexer.state.top = !0, this.lexer.blockTokens(c, s, !0), this.lexer.state.top = g, n.length === 0) break;
405
+ let h = s.at(-1);
406
+ if (h?.type === "code") break;
407
+ if (h?.type === "blockquote") {
408
+ let R = h, f = R.raw + `
409
+ ` + n.join(`
410
+ `), O = this.blockquote(f);
411
+ 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;
412
+ break;
413
+ } else if (h?.type === "list") {
414
+ let R = h, f = R.raw + `
415
+ ` + n.join(`
416
+ `), O = this.list(f);
417
+ 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(`
418
+ `);
419
+ continue;
420
+ }
421
+ }
422
+ return {
423
+ type: "blockquote",
424
+ raw: r,
425
+ tokens: s,
426
+ text: i
427
+ };
428
+ }
429
+ }
430
+ list(e) {
431
+ let t = this.rules.block.list.exec(e);
432
+ if (t) {
433
+ let n = t[1].trim(), r = n.length > 1, i = {
434
+ type: "list",
435
+ raw: "",
436
+ ordered: r,
437
+ start: r ? +n.slice(0, -1) : "",
438
+ loose: !1,
439
+ items: []
440
+ };
441
+ n = r ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = r ? n : "[*+-]");
442
+ let s = this.rules.other.listItemRegex(n), a = !1;
443
+ for (; e;) {
444
+ let p = !1, u = "", c = "";
445
+ if (!(t = s.exec(e)) || this.rules.block.hr.test(e)) break;
446
+ u = t[0], e = e.substring(u.length);
447
+ let g = t[2].split(`
448
+ `, 1)[0].replace(this.rules.other.listReplaceTabs, (H) => " ".repeat(3 * H.length)), h = e.split(`
449
+ `, 1)[0], R = !g.trim(), f = 0;
450
+ 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) && (u += h + `
451
+ `, e = e.substring(h.length + 1), p = !0), !p) {
452
+ let H = this.rules.other.nextBulletRegex(f), ee = this.rules.other.hrRegex(f), te = this.rules.other.fencesBeginRegex(f), ne = this.rules.other.headingBeginRegex(f), xe = this.rules.other.htmlBeginRegex(f);
453
+ for (; e;) {
454
+ let Z = e.split(`
455
+ `, 1)[0], A;
456
+ if (h = Z, this.options.pedantic ? (h = h.replace(this.rules.other.listReplaceNesting, " "), A = h) : A = h.replace(this.rules.other.tabCharGlobal, " "), te.test(h) || ne.test(h) || xe.test(h) || H.test(h) || ee.test(h)) break;
457
+ if (A.search(this.rules.other.nonSpaceChar) >= f || !h.trim()) c += `
458
+ ` + A.slice(f);
459
+ else {
460
+ if (R || g.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || te.test(g) || ne.test(g) || ee.test(g)) break;
461
+ c += `
462
+ ` + h;
463
+ }
464
+ !R && !h.trim() && (R = !0), u += Z + `
465
+ `, e = e.substring(Z.length + 1), g = A.slice(f);
466
+ }
467
+ }
468
+ i.loose || (a ? i.loose = !0 : this.rules.other.doubleBlankLine.test(u) && (a = !0));
469
+ let O = null, Y;
470
+ this.options.gfm && (O = this.rules.other.listIsTask.exec(c), O && (Y = O[0] !== "[ ] ", c = c.replace(this.rules.other.listReplaceTask, ""))), i.items.push({
471
+ type: "list_item",
472
+ raw: u,
473
+ task: !!O,
474
+ checked: Y,
475
+ loose: !1,
476
+ text: c,
477
+ tokens: []
478
+ }), i.raw += u;
479
+ }
480
+ let o = i.items.at(-1);
481
+ if (o) o.raw = o.raw.trimEnd(), o.text = o.text.trimEnd();
482
+ else return;
483
+ i.raw = i.raw.trimEnd();
484
+ for (let p = 0; p < i.items.length; p++) if (this.lexer.state.top = !1, i.items[p].tokens = this.lexer.blockTokens(i.items[p].text, []), !i.loose) {
485
+ let u = i.items[p].tokens.filter((g) => g.type === "space");
486
+ i.loose = u.length > 0 && u.some((g) => this.rules.other.anyLine.test(g.raw));
487
+ }
488
+ if (i.loose) for (let p = 0; p < i.items.length; p++) i.items[p].loose = !0;
489
+ return i;
490
+ }
491
+ }
492
+ html(e) {
493
+ let t = this.rules.block.html.exec(e);
494
+ if (t) return {
495
+ type: "html",
496
+ block: !0,
497
+ raw: t[0],
498
+ pre: t[1] === "pre" || t[1] === "script" || t[1] === "style",
499
+ text: t[0]
500
+ };
501
+ }
502
+ def(e) {
503
+ let t = this.rules.block.def.exec(e);
504
+ if (t) {
505
+ 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];
506
+ return {
507
+ type: "def",
508
+ tag: n,
509
+ raw: t[0],
510
+ href: r,
511
+ title: i
512
+ };
513
+ }
514
+ }
515
+ table(e) {
516
+ let t = this.rules.block.table.exec(e);
517
+ if (!t || !this.rules.other.tableDelimiter.test(t[2])) return;
518
+ let n = V(t[1]), r = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), i = t[3]?.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split(`
519
+ `) : [], s = {
520
+ type: "table",
521
+ raw: t[0],
522
+ header: [],
523
+ align: [],
524
+ rows: []
525
+ };
526
+ if (n.length === r.length) {
527
+ 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);
528
+ for (let a = 0; a < n.length; a++) s.header.push({
529
+ text: n[a],
530
+ tokens: this.lexer.inline(n[a]),
531
+ header: !0,
532
+ align: s.align[a]
533
+ });
534
+ for (let a of i) s.rows.push(V(a, s.header.length).map((o, p) => ({
535
+ text: o,
536
+ tokens: this.lexer.inline(o),
537
+ header: !1,
538
+ align: s.align[p]
539
+ })));
540
+ return s;
541
+ }
542
+ }
543
+ lheading(e) {
544
+ let t = this.rules.block.lheading.exec(e);
545
+ if (t) return {
546
+ type: "heading",
547
+ raw: t[0],
548
+ depth: t[2].charAt(0) === "=" ? 1 : 2,
549
+ text: t[1],
550
+ tokens: this.lexer.inline(t[1])
551
+ };
552
+ }
553
+ paragraph(e) {
554
+ let t = this.rules.block.paragraph.exec(e);
555
+ if (t) {
556
+ let n = t[1].charAt(t[1].length - 1) === `
557
+ ` ? t[1].slice(0, -1) : t[1];
558
+ return {
559
+ type: "paragraph",
560
+ raw: t[0],
561
+ text: n,
562
+ tokens: this.lexer.inline(n)
563
+ };
564
+ }
565
+ }
566
+ text(e) {
567
+ let t = this.rules.block.text.exec(e);
568
+ if (t) return {
569
+ type: "text",
570
+ raw: t[0],
571
+ text: t[0],
572
+ tokens: this.lexer.inline(t[0])
573
+ };
574
+ }
575
+ escape(e) {
576
+ let t = this.rules.inline.escape.exec(e);
577
+ if (t) return {
578
+ type: "escape",
579
+ raw: t[0],
580
+ text: t[1]
581
+ };
582
+ }
583
+ tag(e) {
584
+ let t = this.rules.inline.tag.exec(e);
585
+ if (t) return !this.lexer.state.inLink && this.rules.other.startATag.test(t[0]) ? this.lexer.state.inLink = !0 : this.lexer.state.inLink && this.rules.other.endATag.test(t[0]) && (this.lexer.state.inLink = !1), !this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(t[0]) ? this.lexer.state.inRawBlock = !0 : this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(t[0]) && (this.lexer.state.inRawBlock = !1), {
586
+ type: "html",
587
+ raw: t[0],
588
+ inLink: this.lexer.state.inLink,
589
+ inRawBlock: this.lexer.state.inRawBlock,
590
+ block: !1,
591
+ text: t[0]
592
+ };
593
+ }
594
+ link(e) {
595
+ let t = this.rules.inline.link.exec(e);
596
+ if (t) {
597
+ let n = t[2].trim();
598
+ if (!this.options.pedantic && this.rules.other.startAngleBracket.test(n)) {
599
+ if (!this.rules.other.endAngleBracket.test(n)) return;
600
+ let s = z(n.slice(0, -1), "\\");
601
+ if ((n.length - s.length) % 2 === 0) return;
602
+ } else {
603
+ let s = fe(t[2], "()");
604
+ if (s === -2) return;
605
+ if (s > -1) {
606
+ let o = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + s;
607
+ t[2] = t[2].substring(0, s), t[0] = t[0].substring(0, o).trim(), t[3] = "";
608
+ }
609
+ }
610
+ let r = t[2], i = "";
611
+ if (this.options.pedantic) {
612
+ let s = this.rules.other.pedanticHrefTitle.exec(r);
613
+ s && (r = s[1], i = s[3]);
614
+ } else i = t[3] ? t[3].slice(1, -1) : "";
615
+ 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)), me(t, {
616
+ href: r && r.replace(this.rules.inline.anyPunctuation, "$1"),
617
+ title: i && i.replace(this.rules.inline.anyPunctuation, "$1")
618
+ }, t[0], this.lexer, this.rules);
619
+ }
620
+ }
621
+ reflink(e, t) {
622
+ let n;
623
+ if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) {
624
+ let i = t[(n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " ").toLowerCase()];
625
+ if (!i) {
626
+ let s = n[0].charAt(0);
627
+ return {
628
+ type: "text",
629
+ raw: s,
630
+ text: s
631
+ };
632
+ }
633
+ return me(n, i, n[0], this.lexer, this.rules);
634
+ }
635
+ }
636
+ emStrong(e, t, n = "") {
637
+ let r = this.rules.inline.emStrongLDelim.exec(e);
638
+ if (!r || r[3] && n.match(this.rules.other.unicodeAlphaNumeric)) return;
639
+ if (!(r[1] || r[2] || "") || !n || this.rules.inline.punctuation.exec(n)) {
640
+ let s = [...r[0]].length - 1, a, o, p = s, u = 0, c = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
641
+ for (c.lastIndex = 0, t = t.slice(-1 * e.length + s); (r = c.exec(t)) != null;) {
642
+ if (a = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !a) continue;
643
+ if (o = [...a].length, r[3] || r[4]) {
644
+ p += o;
645
+ continue;
646
+ } else if ((r[5] || r[6]) && s % 3 && !((s + o) % 3)) {
647
+ u += o;
648
+ continue;
649
+ }
650
+ if (p -= o, p > 0) continue;
651
+ o = Math.min(o, o + p + u);
652
+ let g = [...r[0]][0].length, h = e.slice(0, s + r.index + g + o);
653
+ if (Math.min(s, o) % 2) {
654
+ let f = h.slice(1, -1);
655
+ return {
656
+ type: "em",
657
+ raw: h,
658
+ text: f,
659
+ tokens: this.lexer.inlineTokens(f)
660
+ };
661
+ }
662
+ let R = h.slice(2, -2);
663
+ return {
664
+ type: "strong",
665
+ raw: h,
666
+ text: R,
667
+ tokens: this.lexer.inlineTokens(R)
668
+ };
669
+ }
670
+ }
671
+ }
672
+ codespan(e) {
673
+ let t = this.rules.inline.code.exec(e);
674
+ if (t) {
675
+ 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);
676
+ return r && i && (n = n.substring(1, n.length - 1)), {
677
+ type: "codespan",
678
+ raw: t[0],
679
+ text: n
680
+ };
681
+ }
682
+ }
683
+ br(e) {
684
+ let t = this.rules.inline.br.exec(e);
685
+ if (t) return {
686
+ type: "br",
687
+ raw: t[0]
688
+ };
689
+ }
690
+ del(e) {
691
+ let t = this.rules.inline.del.exec(e);
692
+ if (t) return {
693
+ type: "del",
694
+ raw: t[0],
695
+ text: t[2],
696
+ tokens: this.lexer.inlineTokens(t[2])
697
+ };
698
+ }
699
+ autolink(e) {
700
+ let t = this.rules.inline.autolink.exec(e);
701
+ if (t) {
702
+ let n, r;
703
+ return t[2] === "@" ? (n = t[1], r = "mailto:" + n) : (n = t[1], r = n), {
704
+ type: "link",
705
+ raw: t[0],
706
+ text: n,
707
+ href: r,
708
+ tokens: [{
709
+ type: "text",
710
+ raw: n,
711
+ text: n
712
+ }]
713
+ };
714
+ }
715
+ }
716
+ url(e) {
717
+ let t;
718
+ if (t = this.rules.inline.url.exec(e)) {
719
+ let n, r;
720
+ if (t[2] === "@") n = t[0], r = "mailto:" + n;
721
+ else {
722
+ let i;
723
+ do
724
+ i = t[0], t[0] = this.rules.inline._backpedal.exec(t[0])?.[0] ?? "";
725
+ while (i !== t[0]);
726
+ n = t[0], t[1] === "www." ? r = "http://" + t[0] : r = t[0];
727
+ }
728
+ return {
729
+ type: "link",
730
+ raw: t[0],
731
+ text: n,
732
+ href: r,
733
+ tokens: [{
734
+ type: "text",
735
+ raw: n,
736
+ text: n
737
+ }]
738
+ };
739
+ }
740
+ }
741
+ inlineText(e) {
742
+ let t = this.rules.inline.text.exec(e);
743
+ if (t) {
744
+ let n = this.lexer.state.inRawBlock;
745
+ return {
746
+ type: "text",
747
+ raw: t[0],
748
+ text: t[0],
749
+ escaped: n
750
+ };
751
+ }
752
+ }
753
+ };
754
+ var x = class l {
755
+ tokens;
756
+ options;
757
+ state;
758
+ tokenizer;
759
+ inlineQueue;
760
+ constructor(e) {
761
+ this.tokens = [], this.tokens.links = 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 = {
762
+ inLink: !1,
763
+ inRawBlock: !1,
764
+ top: !0
765
+ };
766
+ let t = {
767
+ other: m,
768
+ block: C.normal,
769
+ inline: M.normal
770
+ };
771
+ this.options.pedantic ? (t.block = C.pedantic, t.inline = M.pedantic) : this.options.gfm && (t.block = C.gfm, this.options.breaks ? t.inline = M.breaks : t.inline = M.gfm), this.tokenizer.rules = t;
772
+ }
773
+ static get rules() {
774
+ return {
775
+ block: C,
776
+ inline: M
777
+ };
778
+ }
779
+ static lex(e, t) {
780
+ return new l(t).lex(e);
781
+ }
782
+ static lexInline(e, t) {
783
+ return new l(t).inlineTokens(e);
784
+ }
785
+ lex(e) {
786
+ e = e.replace(m.carriageReturn, `
787
+ `), this.blockTokens(e, this.tokens);
788
+ for (let t = 0; t < this.inlineQueue.length; t++) {
789
+ let n = this.inlineQueue[t];
790
+ this.inlineTokens(n.src, n.tokens);
791
+ }
792
+ return this.inlineQueue = [], this.tokens;
793
+ }
794
+ blockTokens(e, t = [], n = !1) {
795
+ for (this.options.pedantic && (e = e.replace(m.tabCharGlobal, " ").replace(m.spaceLine, "")); e;) {
796
+ let r;
797
+ if (this.options.extensions?.block?.some((s) => (r = s.call({ lexer: this }, e, t)) ? (e = e.substring(r.raw.length), t.push(r), !0) : !1)) continue;
798
+ if (r = this.tokenizer.space(e)) {
799
+ e = e.substring(r.raw.length);
800
+ let s = t.at(-1);
801
+ r.raw.length === 1 && s !== void 0 ? s.raw += `
802
+ ` : t.push(r);
803
+ continue;
804
+ }
805
+ if (r = this.tokenizer.code(e)) {
806
+ e = e.substring(r.raw.length);
807
+ let s = t.at(-1);
808
+ s?.type === "paragraph" || s?.type === "text" ? (s.raw += (s.raw.endsWith(`
809
+ `) ? "" : `
810
+ `) + r.raw, s.text += `
811
+ ` + r.text, this.inlineQueue.at(-1).src = s.text) : t.push(r);
812
+ continue;
813
+ }
814
+ if (r = this.tokenizer.fences(e)) {
815
+ e = e.substring(r.raw.length), t.push(r);
816
+ continue;
817
+ }
818
+ if (r = this.tokenizer.heading(e)) {
819
+ e = e.substring(r.raw.length), t.push(r);
820
+ continue;
821
+ }
822
+ if (r = this.tokenizer.hr(e)) {
823
+ e = e.substring(r.raw.length), t.push(r);
824
+ continue;
825
+ }
826
+ if (r = this.tokenizer.blockquote(e)) {
827
+ e = e.substring(r.raw.length), t.push(r);
828
+ continue;
829
+ }
830
+ if (r = this.tokenizer.list(e)) {
831
+ e = e.substring(r.raw.length), t.push(r);
832
+ continue;
833
+ }
834
+ if (r = this.tokenizer.html(e)) {
835
+ e = e.substring(r.raw.length), t.push(r);
836
+ continue;
837
+ }
838
+ if (r = this.tokenizer.def(e)) {
839
+ e = e.substring(r.raw.length);
840
+ let s = t.at(-1);
841
+ s?.type === "paragraph" || s?.type === "text" ? (s.raw += (s.raw.endsWith(`
842
+ `) ? "" : `
843
+ `) + r.raw, s.text += `
844
+ ` + r.raw, this.inlineQueue.at(-1).src = s.text) : this.tokens.links[r.tag] || (this.tokens.links[r.tag] = {
845
+ href: r.href,
846
+ title: r.title
847
+ }, t.push(r));
848
+ continue;
849
+ }
850
+ if (r = this.tokenizer.table(e)) {
851
+ e = e.substring(r.raw.length), t.push(r);
852
+ continue;
853
+ }
854
+ if (r = this.tokenizer.lheading(e)) {
855
+ e = e.substring(r.raw.length), t.push(r);
856
+ continue;
857
+ }
858
+ let i = e;
859
+ if (this.options.extensions?.startBlock) {
860
+ let s = Infinity, a = e.slice(1), o;
861
+ this.options.extensions.startBlock.forEach((p) => {
862
+ o = p.call({ lexer: this }, a), typeof o == "number" && o >= 0 && (s = Math.min(s, o));
863
+ }), s < Infinity && s >= 0 && (i = e.substring(0, s + 1));
864
+ }
865
+ if (this.state.top && (r = this.tokenizer.paragraph(i))) {
866
+ let s = t.at(-1);
867
+ n && s?.type === "paragraph" ? (s.raw += (s.raw.endsWith(`
868
+ `) ? "" : `
869
+ `) + r.raw, s.text += `
870
+ ` + 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);
871
+ continue;
872
+ }
873
+ if (r = this.tokenizer.text(e)) {
874
+ e = e.substring(r.raw.length);
875
+ let s = t.at(-1);
876
+ s?.type === "text" ? (s.raw += (s.raw.endsWith(`
877
+ `) ? "" : `
878
+ `) + r.raw, s.text += `
879
+ ` + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = s.text) : t.push(r);
880
+ continue;
881
+ }
882
+ if (e) {
883
+ let s = "Infinite loop on byte: " + e.charCodeAt(0);
884
+ if (this.options.silent) {
885
+ console.error(s);
886
+ break;
887
+ } else throw new Error(s);
888
+ }
889
+ }
890
+ return this.state.top = !0, t;
891
+ }
892
+ inline(e, t = []) {
893
+ return this.inlineQueue.push({
894
+ src: e,
895
+ tokens: t
896
+ }), t;
897
+ }
898
+ inlineTokens(e, t = []) {
899
+ let n = e, r = null;
900
+ if (this.tokens.links) {
901
+ let o = Object.keys(this.tokens.links);
902
+ 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));
903
+ }
904
+ for (; (r = this.tokenizer.rules.inline.anyPunctuation.exec(n)) != null;) n = n.slice(0, r.index) + "++" + n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
905
+ let i;
906
+ 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);
907
+ n = this.options.hooks?.emStrongMask?.call({ lexer: this }, n) ?? n;
908
+ let s = !1, a = "";
909
+ for (; e;) {
910
+ s || (a = ""), s = !1;
911
+ let o;
912
+ if (this.options.extensions?.inline?.some((u) => (o = u.call({ lexer: this }, e, t)) ? (e = e.substring(o.raw.length), t.push(o), !0) : !1)) continue;
913
+ if (o = this.tokenizer.escape(e)) {
914
+ e = e.substring(o.raw.length), t.push(o);
915
+ continue;
916
+ }
917
+ if (o = this.tokenizer.tag(e)) {
918
+ e = e.substring(o.raw.length), t.push(o);
919
+ continue;
920
+ }
921
+ if (o = this.tokenizer.link(e)) {
922
+ e = e.substring(o.raw.length), t.push(o);
923
+ continue;
924
+ }
925
+ if (o = this.tokenizer.reflink(e, this.tokens.links)) {
926
+ e = e.substring(o.raw.length);
927
+ let u = t.at(-1);
928
+ o.type === "text" && u?.type === "text" ? (u.raw += o.raw, u.text += o.text) : t.push(o);
929
+ continue;
930
+ }
931
+ if (o = this.tokenizer.emStrong(e, n, a)) {
932
+ e = e.substring(o.raw.length), t.push(o);
933
+ continue;
934
+ }
935
+ if (o = this.tokenizer.codespan(e)) {
936
+ e = e.substring(o.raw.length), t.push(o);
937
+ continue;
938
+ }
939
+ if (o = this.tokenizer.br(e)) {
940
+ e = e.substring(o.raw.length), t.push(o);
941
+ continue;
942
+ }
943
+ if (o = this.tokenizer.del(e)) {
944
+ e = e.substring(o.raw.length), t.push(o);
945
+ continue;
946
+ }
947
+ if (o = this.tokenizer.autolink(e)) {
948
+ e = e.substring(o.raw.length), t.push(o);
949
+ continue;
950
+ }
951
+ if (!this.state.inLink && (o = this.tokenizer.url(e))) {
952
+ e = e.substring(o.raw.length), t.push(o);
953
+ continue;
954
+ }
955
+ let p = e;
956
+ if (this.options.extensions?.startInline) {
957
+ let u = Infinity, c = e.slice(1), g;
958
+ this.options.extensions.startInline.forEach((h) => {
959
+ g = h.call({ lexer: this }, c), typeof g == "number" && g >= 0 && (u = Math.min(u, g));
960
+ }), u < Infinity && u >= 0 && (p = e.substring(0, u + 1));
961
+ }
962
+ if (o = this.tokenizer.inlineText(p)) {
963
+ e = e.substring(o.raw.length), o.raw.slice(-1) !== "_" && (a = o.raw.slice(-1)), s = !0;
964
+ let u = t.at(-1);
965
+ u?.type === "text" ? (u.raw += o.raw, u.text += o.text) : t.push(o);
966
+ continue;
967
+ }
968
+ if (e) {
969
+ let u = "Infinite loop on byte: " + e.charCodeAt(0);
970
+ if (this.options.silent) {
971
+ console.error(u);
972
+ break;
973
+ } else throw new Error(u);
974
+ }
975
+ }
976
+ return t;
977
+ }
978
+ };
979
+ var P = class {
980
+ options;
981
+ parser;
982
+ constructor(e) {
983
+ this.options = e || T;
984
+ }
985
+ space(e) {
986
+ return "";
987
+ }
988
+ code({ text: e, lang: t, escaped: n }) {
989
+ let r = (t || "").match(m.notSpaceStart)?.[0], i = e.replace(m.endingNewline, "") + `
990
+ `;
991
+ return r ? "<pre><code class=\"language-" + w(r) + "\">" + (n ? i : w(i, !0)) + `</code></pre>
992
+ ` : "<pre><code>" + (n ? i : w(i, !0)) + `</code></pre>
993
+ `;
994
+ }
995
+ blockquote({ tokens: e }) {
996
+ return `<blockquote>
997
+ ${this.parser.parse(e)}</blockquote>
998
+ `;
999
+ }
1000
+ html({ text: e }) {
1001
+ return e;
1002
+ }
1003
+ def(e) {
1004
+ return "";
1005
+ }
1006
+ heading({ tokens: e, depth: t }) {
1007
+ return `<h${t}>${this.parser.parseInline(e)}</h${t}>
1008
+ `;
1009
+ }
1010
+ hr(e) {
1011
+ return `<hr>
1012
+ `;
1013
+ }
1014
+ list(e) {
1015
+ let t = e.ordered, n = e.start, r = "";
1016
+ for (let a = 0; a < e.items.length; a++) {
1017
+ let o = e.items[a];
1018
+ r += this.listitem(o);
1019
+ }
1020
+ let i = t ? "ol" : "ul", s = t && n !== 1 ? " start=\"" + n + "\"" : "";
1021
+ return "<" + i + s + `>
1022
+ ` + r + "</" + i + `>
1023
+ `;
1024
+ }
1025
+ listitem(e) {
1026
+ let t = "";
1027
+ if (e.task) {
1028
+ let n = this.checkbox({ checked: !!e.checked });
1029
+ e.loose ? e.tokens[0]?.type === "paragraph" ? (e.tokens[0].text = n + " " + e.tokens[0].text, e.tokens[0].tokens && e.tokens[0].tokens.length > 0 && e.tokens[0].tokens[0].type === "text" && (e.tokens[0].tokens[0].text = n + " " + w(e.tokens[0].tokens[0].text), e.tokens[0].tokens[0].escaped = !0)) : e.tokens.unshift({
1030
+ type: "text",
1031
+ raw: n + " ",
1032
+ text: n + " ",
1033
+ escaped: !0
1034
+ }) : t += n + " ";
1035
+ }
1036
+ return t += this.parser.parse(e.tokens, !!e.loose), `<li>${t}</li>
1037
+ `;
1038
+ }
1039
+ checkbox({ checked: e }) {
1040
+ return "<input " + (e ? "checked=\"\" " : "") + "disabled=\"\" type=\"checkbox\">";
1041
+ }
1042
+ paragraph({ tokens: e }) {
1043
+ return `<p>${this.parser.parseInline(e)}</p>
1044
+ `;
1045
+ }
1046
+ table(e) {
1047
+ let t = "", n = "";
1048
+ for (let i = 0; i < e.header.length; i++) n += this.tablecell(e.header[i]);
1049
+ t += this.tablerow({ text: n });
1050
+ let r = "";
1051
+ for (let i = 0; i < e.rows.length; i++) {
1052
+ let s = e.rows[i];
1053
+ n = "";
1054
+ for (let a = 0; a < s.length; a++) n += this.tablecell(s[a]);
1055
+ r += this.tablerow({ text: n });
1056
+ }
1057
+ return r && (r = `<tbody>${r}</tbody>`), `<table>
1058
+ <thead>
1059
+ ` + t + `</thead>
1060
+ ` + r + `</table>
1061
+ `;
1062
+ }
1063
+ tablerow({ text: e }) {
1064
+ return `<tr>
1065
+ ${e}</tr>
1066
+ `;
1067
+ }
1068
+ tablecell(e) {
1069
+ let t = this.parser.parseInline(e.tokens), n = e.header ? "th" : "td";
1070
+ return (e.align ? `<${n} align="${e.align}">` : `<${n}>`) + t + `</${n}>
1071
+ `;
1072
+ }
1073
+ strong({ tokens: e }) {
1074
+ return `<strong>${this.parser.parseInline(e)}</strong>`;
1075
+ }
1076
+ em({ tokens: e }) {
1077
+ return `<em>${this.parser.parseInline(e)}</em>`;
1078
+ }
1079
+ codespan({ text: e }) {
1080
+ return `<code>${w(e, !0)}</code>`;
1081
+ }
1082
+ br(e) {
1083
+ return "<br>";
1084
+ }
1085
+ del({ tokens: e }) {
1086
+ return `<del>${this.parser.parseInline(e)}</del>`;
1087
+ }
1088
+ link({ href: e, title: t, tokens: n }) {
1089
+ let r = this.parser.parseInline(n), i = J(e);
1090
+ if (i === null) return r;
1091
+ e = i;
1092
+ let s = "<a href=\"" + e + "\"";
1093
+ return t && (s += " title=\"" + w(t) + "\""), s += ">" + r + "</a>", s;
1094
+ }
1095
+ image({ href: e, title: t, text: n, tokens: r }) {
1096
+ r && (n = this.parser.parseInline(r, this.parser.textRenderer));
1097
+ let i = J(e);
1098
+ if (i === null) return w(n);
1099
+ e = i;
1100
+ let s = `<img src="${e}" alt="${n}"`;
1101
+ return t && (s += ` title="${w(t)}"`), s += ">", s;
1102
+ }
1103
+ text(e) {
1104
+ return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : w(e.text);
1105
+ }
1106
+ };
1107
+ var $ = class {
1108
+ strong({ text: e }) {
1109
+ return e;
1110
+ }
1111
+ em({ text: e }) {
1112
+ return e;
1113
+ }
1114
+ codespan({ text: e }) {
1115
+ return e;
1116
+ }
1117
+ del({ text: e }) {
1118
+ return e;
1119
+ }
1120
+ html({ text: e }) {
1121
+ return e;
1122
+ }
1123
+ text({ text: e }) {
1124
+ return e;
1125
+ }
1126
+ link({ text: e }) {
1127
+ return "" + e;
1128
+ }
1129
+ image({ text: e }) {
1130
+ return "" + e;
1131
+ }
1132
+ br() {
1133
+ return "";
1134
+ }
1135
+ };
1136
+ var b = class l {
1137
+ options;
1138
+ renderer;
1139
+ textRenderer;
1140
+ constructor(e) {
1141
+ 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 $();
1142
+ }
1143
+ static parse(e, t) {
1144
+ return new l(t).parse(e);
1145
+ }
1146
+ static parseInline(e, t) {
1147
+ return new l(t).parseInline(e);
1148
+ }
1149
+ parse(e, t = !0) {
1150
+ let n = "";
1151
+ for (let r = 0; r < e.length; r++) {
1152
+ let i = e[r];
1153
+ if (this.options.extensions?.renderers?.[i.type]) {
1154
+ let a = i, o = this.options.extensions.renderers[a.type].call({ parser: this }, a);
1155
+ if (o !== !1 || ![
1156
+ "space",
1157
+ "hr",
1158
+ "heading",
1159
+ "code",
1160
+ "table",
1161
+ "blockquote",
1162
+ "list",
1163
+ "html",
1164
+ "def",
1165
+ "paragraph",
1166
+ "text"
1167
+ ].includes(a.type)) {
1168
+ n += o || "";
1169
+ continue;
1170
+ }
1171
+ }
1172
+ let s = i;
1173
+ switch (s.type) {
1174
+ case "space":
1175
+ n += this.renderer.space(s);
1176
+ continue;
1177
+ case "hr":
1178
+ n += this.renderer.hr(s);
1179
+ continue;
1180
+ case "heading":
1181
+ n += this.renderer.heading(s);
1182
+ continue;
1183
+ case "code":
1184
+ n += this.renderer.code(s);
1185
+ continue;
1186
+ case "table":
1187
+ n += this.renderer.table(s);
1188
+ continue;
1189
+ case "blockquote":
1190
+ n += this.renderer.blockquote(s);
1191
+ continue;
1192
+ case "list":
1193
+ n += this.renderer.list(s);
1194
+ continue;
1195
+ case "html":
1196
+ n += this.renderer.html(s);
1197
+ continue;
1198
+ case "def":
1199
+ n += this.renderer.def(s);
1200
+ continue;
1201
+ case "paragraph":
1202
+ n += this.renderer.paragraph(s);
1203
+ continue;
1204
+ case "text": {
1205
+ let a = s, o = this.renderer.text(a);
1206
+ for (; r + 1 < e.length && e[r + 1].type === "text";) a = e[++r], o += `
1207
+ ` + this.renderer.text(a);
1208
+ t ? n += this.renderer.paragraph({
1209
+ type: "paragraph",
1210
+ raw: o,
1211
+ text: o,
1212
+ tokens: [{
1213
+ type: "text",
1214
+ raw: o,
1215
+ text: o,
1216
+ escaped: !0
1217
+ }]
1218
+ }) : n += o;
1219
+ continue;
1220
+ }
1221
+ default: {
1222
+ let a = "Token with \"" + s.type + "\" type was not found.";
1223
+ if (this.options.silent) return console.error(a), "";
1224
+ throw new Error(a);
1225
+ }
1226
+ }
1227
+ }
1228
+ return n;
1229
+ }
1230
+ parseInline(e, t = this.renderer) {
1231
+ let n = "";
1232
+ for (let r = 0; r < e.length; r++) {
1233
+ let i = e[r];
1234
+ if (this.options.extensions?.renderers?.[i.type]) {
1235
+ let a = this.options.extensions.renderers[i.type].call({ parser: this }, i);
1236
+ if (a !== !1 || ![
1237
+ "escape",
1238
+ "html",
1239
+ "link",
1240
+ "image",
1241
+ "strong",
1242
+ "em",
1243
+ "codespan",
1244
+ "br",
1245
+ "del",
1246
+ "text"
1247
+ ].includes(i.type)) {
1248
+ n += a || "";
1249
+ continue;
1250
+ }
1251
+ }
1252
+ let s = i;
1253
+ switch (s.type) {
1254
+ case "escape":
1255
+ n += t.text(s);
1256
+ break;
1257
+ case "html":
1258
+ n += t.html(s);
1259
+ break;
1260
+ case "link":
1261
+ n += t.link(s);
1262
+ break;
1263
+ case "image":
1264
+ n += t.image(s);
1265
+ break;
1266
+ case "strong":
1267
+ n += t.strong(s);
1268
+ break;
1269
+ case "em":
1270
+ n += t.em(s);
1271
+ break;
1272
+ case "codespan":
1273
+ n += t.codespan(s);
1274
+ break;
1275
+ case "br":
1276
+ n += t.br(s);
1277
+ break;
1278
+ case "del":
1279
+ n += t.del(s);
1280
+ break;
1281
+ case "text":
1282
+ n += t.text(s);
1283
+ break;
1284
+ default: {
1285
+ let a = "Token with \"" + s.type + "\" type was not found.";
1286
+ if (this.options.silent) return console.error(a), "";
1287
+ throw new Error(a);
1288
+ }
1289
+ }
1290
+ }
1291
+ return n;
1292
+ }
1293
+ };
1294
+ var S = class {
1295
+ options;
1296
+ block;
1297
+ constructor(e) {
1298
+ this.options = e || T;
1299
+ }
1300
+ static passThroughHooks = /* @__PURE__ */ new Set([
1301
+ "preprocess",
1302
+ "postprocess",
1303
+ "processAllTokens",
1304
+ "emStrongMask"
1305
+ ]);
1306
+ static passThroughHooksRespectAsync = /* @__PURE__ */ new Set([
1307
+ "preprocess",
1308
+ "postprocess",
1309
+ "processAllTokens"
1310
+ ]);
1311
+ preprocess(e) {
1312
+ return e;
1313
+ }
1314
+ postprocess(e) {
1315
+ return e;
1316
+ }
1317
+ processAllTokens(e) {
1318
+ return e;
1319
+ }
1320
+ emStrongMask(e) {
1321
+ return e;
1322
+ }
1323
+ provideLexer() {
1324
+ return this.block ? x.lex : x.lexInline;
1325
+ }
1326
+ provideParser() {
1327
+ return this.block ? b.parse : b.parseInline;
1328
+ }
1329
+ };
1330
+ var B = class {
1331
+ defaults = L();
1332
+ options = this.setOptions;
1333
+ parse = this.parseMarkdown(!0);
1334
+ parseInline = this.parseMarkdown(!1);
1335
+ Parser = b;
1336
+ Renderer = P;
1337
+ TextRenderer = $;
1338
+ Lexer = x;
1339
+ Tokenizer = y;
1340
+ Hooks = S;
1341
+ constructor(...e) {
1342
+ this.use(...e);
1343
+ }
1344
+ walkTokens(e, t) {
1345
+ let n = [];
1346
+ for (let r of e) switch (n = n.concat(t.call(this, r)), r.type) {
1347
+ case "table": {
1348
+ let i = r;
1349
+ for (let s of i.header) n = n.concat(this.walkTokens(s.tokens, t));
1350
+ for (let s of i.rows) for (let a of s) n = n.concat(this.walkTokens(a.tokens, t));
1351
+ break;
1352
+ }
1353
+ case "list": {
1354
+ let i = r;
1355
+ n = n.concat(this.walkTokens(i.items, t));
1356
+ break;
1357
+ }
1358
+ default: {
1359
+ let i = r;
1360
+ this.defaults.extensions?.childTokens?.[i.type] ? this.defaults.extensions.childTokens[i.type].forEach((s) => {
1361
+ let a = i[s].flat(Infinity);
1362
+ n = n.concat(this.walkTokens(a, t));
1363
+ }) : i.tokens && (n = n.concat(this.walkTokens(i.tokens, t)));
1364
+ }
1365
+ }
1366
+ return n;
1367
+ }
1368
+ use(...e) {
1369
+ let t = this.defaults.extensions || {
1370
+ renderers: {},
1371
+ childTokens: {}
1372
+ };
1373
+ return e.forEach((n) => {
1374
+ let r = { ...n };
1375
+ if (r.async = this.defaults.async || r.async || !1, n.extensions && (n.extensions.forEach((i) => {
1376
+ if (!i.name) throw new Error("extension name required");
1377
+ if ("renderer" in i) {
1378
+ let s = t.renderers[i.name];
1379
+ s ? t.renderers[i.name] = function(...a) {
1380
+ let o = i.renderer.apply(this, a);
1381
+ return o === !1 && (o = s.apply(this, a)), o;
1382
+ } : t.renderers[i.name] = i.renderer;
1383
+ }
1384
+ if ("tokenizer" in i) {
1385
+ if (!i.level || i.level !== "block" && i.level !== "inline") throw new Error("extension level must be 'block' or 'inline'");
1386
+ let s = t[i.level];
1387
+ 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]));
1388
+ }
1389
+ "childTokens" in i && i.childTokens && (t.childTokens[i.name] = i.childTokens);
1390
+ }), r.extensions = t), n.renderer) {
1391
+ let i = this.defaults.renderer || new P(this.defaults);
1392
+ for (let s in n.renderer) {
1393
+ if (!(s in i)) throw new Error(`renderer '${s}' does not exist`);
1394
+ if (["options", "parser"].includes(s)) continue;
1395
+ let a = s, o = n.renderer[a], p = i[a];
1396
+ i[a] = (...u) => {
1397
+ let c = o.apply(i, u);
1398
+ return c === !1 && (c = p.apply(i, u)), c || "";
1399
+ };
1400
+ }
1401
+ r.renderer = i;
1402
+ }
1403
+ if (n.tokenizer) {
1404
+ let i = this.defaults.tokenizer || new y(this.defaults);
1405
+ for (let s in n.tokenizer) {
1406
+ if (!(s in i)) throw new Error(`tokenizer '${s}' does not exist`);
1407
+ if ([
1408
+ "options",
1409
+ "rules",
1410
+ "lexer"
1411
+ ].includes(s)) continue;
1412
+ let a = s, o = n.tokenizer[a], p = i[a];
1413
+ i[a] = (...u) => {
1414
+ let c = o.apply(i, u);
1415
+ return c === !1 && (c = p.apply(i, u)), c;
1416
+ };
1417
+ }
1418
+ r.tokenizer = i;
1419
+ }
1420
+ if (n.hooks) {
1421
+ let i = this.defaults.hooks || new S();
1422
+ for (let s in n.hooks) {
1423
+ if (!(s in i)) throw new Error(`hook '${s}' does not exist`);
1424
+ if (["options", "block"].includes(s)) continue;
1425
+ let a = s, o = n.hooks[a], p = i[a];
1426
+ S.passThroughHooks.has(s) ? i[a] = (u) => {
1427
+ if (this.defaults.async && S.passThroughHooksRespectAsync.has(s)) return (async () => {
1428
+ let g = await o.call(i, u);
1429
+ return p.call(i, g);
1430
+ })();
1431
+ let c = o.call(i, u);
1432
+ return p.call(i, c);
1433
+ } : i[a] = (...u) => {
1434
+ if (this.defaults.async) return (async () => {
1435
+ let g = await o.apply(i, u);
1436
+ return g === !1 && (g = await p.apply(i, u)), g;
1437
+ })();
1438
+ let c = o.apply(i, u);
1439
+ return c === !1 && (c = p.apply(i, u)), c;
1440
+ };
1441
+ }
1442
+ r.hooks = i;
1443
+ }
1444
+ if (n.walkTokens) {
1445
+ let i = this.defaults.walkTokens, s = n.walkTokens;
1446
+ r.walkTokens = function(a) {
1447
+ let o = [];
1448
+ return o.push(s.call(this, a)), i && (o = o.concat(i.call(this, a))), o;
1449
+ };
1450
+ }
1451
+ this.defaults = {
1452
+ ...this.defaults,
1453
+ ...r
1454
+ };
1455
+ }), this;
1456
+ }
1457
+ setOptions(e) {
1458
+ return this.defaults = {
1459
+ ...this.defaults,
1460
+ ...e
1461
+ }, this;
1462
+ }
1463
+ lexer(e, t) {
1464
+ return x.lex(e, t ?? this.defaults);
1465
+ }
1466
+ parser(e, t) {
1467
+ return b.parse(e, t ?? this.defaults);
1468
+ }
1469
+ parseMarkdown(e) {
1470
+ return (n, r) => {
1471
+ let i = { ...r }, s = {
1472
+ ...this.defaults,
1473
+ ...i
1474
+ }, a = this.onError(!!s.silent, !!s.async);
1475
+ if (this.defaults.async === !0 && i.async === !1) return a(/* @__PURE__ */ 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."));
1476
+ if (typeof n > "u" || n === null) return a(/* @__PURE__ */ new Error("marked(): input parameter is undefined or null"));
1477
+ if (typeof n != "string") return a(/* @__PURE__ */ new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected"));
1478
+ if (s.hooks && (s.hooks.options = s, s.hooks.block = e), s.async) return (async () => {
1479
+ let o = s.hooks ? await s.hooks.preprocess(n) : n, u = await (s.hooks ? await s.hooks.provideLexer() : e ? x.lex : x.lexInline)(o, s), c = s.hooks ? await s.hooks.processAllTokens(u) : u;
1480
+ s.walkTokens && await Promise.all(this.walkTokens(c, s.walkTokens));
1481
+ let h = await (s.hooks ? await s.hooks.provideParser() : e ? b.parse : b.parseInline)(c, s);
1482
+ return s.hooks ? await s.hooks.postprocess(h) : h;
1483
+ })().catch(a);
1484
+ try {
1485
+ s.hooks && (n = s.hooks.preprocess(n));
1486
+ let p = (s.hooks ? s.hooks.provideLexer() : e ? x.lex : x.lexInline)(n, s);
1487
+ s.hooks && (p = s.hooks.processAllTokens(p)), s.walkTokens && this.walkTokens(p, s.walkTokens);
1488
+ let c = (s.hooks ? s.hooks.provideParser() : e ? b.parse : b.parseInline)(p, s);
1489
+ return s.hooks && (c = s.hooks.postprocess(c)), c;
1490
+ } catch (o) {
1491
+ return a(o);
1492
+ }
1493
+ };
1494
+ }
1495
+ onError(e, t) {
1496
+ return (n) => {
1497
+ if (n.message += `
1498
+ Please report this to https://github.com/markedjs/marked.`, e) {
1499
+ let r = "<p>An error occurred:</p><pre>" + w(n.message + "", !0) + "</pre>";
1500
+ return t ? Promise.resolve(r) : r;
1501
+ }
1502
+ if (t) return Promise.reject(n);
1503
+ throw n;
1504
+ };
1505
+ }
1506
+ };
1507
+ var _ = new B();
1508
+ function k(l, e) {
1509
+ return _.parse(l, e);
1510
+ }
1511
+ k.options = k.setOptions = function(l) {
1512
+ return _.setOptions(l), k.defaults = _.defaults, G(k.defaults), k;
1513
+ };
1514
+ k.getDefaults = L;
1515
+ k.defaults = T;
1516
+ k.use = function(...l) {
1517
+ return _.use(...l), k.defaults = _.defaults, G(k.defaults), k;
1518
+ };
1519
+ k.walkTokens = function(l, e) {
1520
+ return _.walkTokens(l, e);
1521
+ };
1522
+ k.parseInline = _.parseInline;
1523
+ k.Parser = b;
1524
+ k.parser = b.parse;
1525
+ k.Renderer = P;
1526
+ k.TextRenderer = $;
1527
+ k.Lexer = x;
1528
+ k.lexer = x.lex;
1529
+ k.Tokenizer = y;
1530
+ k.Hooks = S;
1531
+ k.parse = k;
1532
+ var Zt = k.options;
1533
+ var Gt = k.setOptions;
1534
+ var Nt = k.use;
1535
+ var Ft = k.walkTokens;
1536
+ var jt = k.parseInline;
1537
+ var Ut = b.parse;
1538
+ var Kt = x.lex;
1539
+
1540
+ //#endregion
1541
+ //#region ../../node_modules/.pnpm/ts-dedent@2.3.0/node_modules/ts-dedent/esm/index.js
1542
+ function dedent(templ) {
1543
+ var values = [];
1544
+ for (var _i = 1; _i < arguments.length; _i++) values[_i - 1] = arguments[_i];
1545
+ var strings = Array.from(typeof templ === "string" ? [templ] : templ);
1546
+ strings[strings.length - 1] = strings[strings.length - 1].replace(/\r?\n([\t ]*)$/, "");
1547
+ var indentLengths = strings.reduce(function(arr, str) {
1548
+ var matches = str.match(/\n([\t ]+|(?!\s).)/g);
1549
+ if (matches) return arr.concat(matches.map(function(match) {
1550
+ var _a, _b;
1551
+ return (_b = (_a = match.match(/[\t ]/g)) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;
1552
+ }));
1553
+ return arr;
1554
+ }, []);
1555
+ if (indentLengths.length) {
1556
+ var pattern_1 = new RegExp("\n[ ]{".concat(Math.min.apply(Math, indentLengths), "}"), "g");
1557
+ strings = strings.map(function(str) {
1558
+ return str.replace(pattern_1, "\n");
1559
+ });
1560
+ }
1561
+ strings[0] = strings[0].replace(/^\r?\n/, "");
1562
+ var string = strings[0];
1563
+ values.forEach(function(value, i) {
1564
+ var endentations = string.match(/(?:^|\n)( *)$/);
1565
+ var endentation = endentations ? endentations[1] : "";
1566
+ var indentedValue = value;
1567
+ if (typeof value === "string" && value.includes("\n")) indentedValue = String(value).split("\n").map(function(str, i) {
1568
+ return i === 0 ? str : "".concat(endentation).concat(str);
1569
+ }).join("\n");
1570
+ string += indentedValue + strings[i + 1];
1571
+ });
1572
+ return string;
1573
+ }
1574
+
1575
+ //#endregion
1576
+ //#region ../../node_modules/.pnpm/mermaid@12.0.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-MBY4JIJT.mjs
1577
+ var hasPerformance = typeof performance !== "undefined" && typeof performance.now === "function";
1578
+ var now = /* @__PURE__ */ __name(() => hasPerformance ? performance.now() : 0, "now");
1579
+ var MEASURE_PREFIX = "🧜 ";
1580
+ var DEVTOOLS_TRACK = "Mermaid render";
1581
+ var DEVTOOLS_TRACK_GROUP = "Mermaid";
1582
+ var PHASE_COLORS = {
1583
+ parse: "tertiary",
1584
+ prepare: "secondary",
1585
+ measure: "primary",
1586
+ layout: "primary-dark",
1587
+ layoutCore: "error",
1588
+ draw: "primary-light",
1589
+ paint: "secondary-dark",
1590
+ serialize: "tertiary-dark",
1591
+ render: "primary-light"
1592
+ };
1593
+ (class {
1594
+ constructor() {
1595
+ /** Runtime toggle. Off by default even in profiling builds. */
1596
+ this.enabled = false;
1597
+ /** Log a summary to the console automatically when each root span closes. */
1598
+ this.autoPrint = true;
1599
+ /** Completed render trees, oldest first, capped at {@link maxRecords}. */
1600
+ this.records = [];
1601
+ this.maxRecords = 200;
1602
+ this.roots = [];
1603
+ this.stack = [];
1604
+ this.buckets = {};
1605
+ }
1606
+ static {
1607
+ __name(this, "Profiler");
1608
+ }
1609
+ enable() {
1610
+ this.enabled = true;
1611
+ return this;
1612
+ }
1613
+ disable() {
1614
+ this.enabled = false;
1615
+ return this;
1616
+ }
1617
+ /** Begin a new top-level measurement (one per diagram render). */
1618
+ start(label) {
1619
+ if (!this.enabled) return;
1620
+ this.roots = [];
1621
+ this.stack = [];
1622
+ this.buckets = {};
1623
+ this.begin(label);
1624
+ }
1625
+ /**
1626
+ * Accumulate the wall-clock of a synchronous sub-operation into a named bucket,
1627
+ * summed over every call within the render — for hot operations that run too
1628
+ * often to be individual tree spans (e.g. per-node `getBBox`). Returns the
1629
+ * function's result. No-op (just calls `fn`) unless enabled.
1630
+ */
1631
+ tickSync(name, fn) {
1632
+ if (!this.enabled) return fn();
1633
+ const t0 = now();
1634
+ try {
1635
+ return fn();
1636
+ } finally {
1637
+ this.buckets[name] = (this.buckets[name] ?? 0) + (now() - t0);
1638
+ }
1639
+ }
1640
+ /**
1641
+ * Async variant of {@link tickSync}. WARNING: only meaningful for operations
1642
+ * that run one-at-a-time. Do NOT use it for calls awaited concurrently (e.g.
1643
+ * `Promise.all(nodes.map(...))`) — their wall-clocks overlap and the summed
1644
+ * bucket balloons far past the real elapsed time. For concurrent CPU
1645
+ * attribution use a DevTools CPU profile instead.
1646
+ */
1647
+ async tick(name, fn) {
1648
+ if (!this.enabled) return fn();
1649
+ const t0 = now();
1650
+ try {
1651
+ return await fn();
1652
+ } finally {
1653
+ this.buckets[name] = (this.buckets[name] ?? 0) + (now() - t0);
1654
+ }
1655
+ }
1656
+ /** End the current top-level measurement and optionally print a summary. */
1657
+ stop() {
1658
+ if (!this.enabled) return;
1659
+ while (this.stack.length > 0) this.end();
1660
+ const root = this.roots.at(-1);
1661
+ const label = this.runLabel ?? root?.name;
1662
+ if (root) {
1663
+ this.records.push({
1664
+ label: label ?? root.name,
1665
+ tree: root,
1666
+ buckets: { ...this.buckets }
1667
+ });
1668
+ if (this.records.length > this.maxRecords) this.records.splice(0, this.records.length - this.maxRecords);
1669
+ if (this.autoPrint) this.printSummary(root, label);
1670
+ }
1671
+ this.runLabel = void 0;
1672
+ return root;
1673
+ }
1674
+ /** Open a child span. Pair with {@link end}. No-op unless enabled. */
1675
+ begin(name) {
1676
+ if (!this.enabled) return;
1677
+ const span = {
1678
+ name,
1679
+ start: now(),
1680
+ duration: -1,
1681
+ children: []
1682
+ };
1683
+ const parent = this.stack.at(-1);
1684
+ if (parent) parent.children.push(span);
1685
+ else this.roots.push(span);
1686
+ this.stack.push(span);
1687
+ if (hasPerformance && typeof performance.mark === "function") try {
1688
+ performance.mark(`${MEASURE_PREFIX}${name} \u25B6`);
1689
+ } catch {}
1690
+ }
1691
+ /** Close the most recently opened span. No-op unless enabled. */
1692
+ end() {
1693
+ if (!this.enabled) return;
1694
+ const span = this.stack.pop();
1695
+ if (!span) return;
1696
+ const end = now();
1697
+ span.duration = end - span.start;
1698
+ if (hasPerformance && typeof performance.measure === "function") try {
1699
+ performance.measure(`${MEASURE_PREFIX}${span.name}`, {
1700
+ start: span.start,
1701
+ end,
1702
+ detail: { devtools: {
1703
+ dataType: "track-entry",
1704
+ track: DEVTOOLS_TRACK,
1705
+ trackGroup: DEVTOOLS_TRACK_GROUP,
1706
+ color: PHASE_COLORS[span.name] ?? "primary",
1707
+ tooltipText: `${span.name} \u2014 ${span.duration.toFixed(1)} ms`
1708
+ } }
1709
+ });
1710
+ } catch {}
1711
+ }
1712
+ /**
1713
+ * Measure an async phase. Returns the wrapped function's result and rethrows
1714
+ * any error after closing the span, so instrumentation never swallows
1715
+ * failures or leaks an open span. No measurement overhead unless enabled.
1716
+ */
1717
+ async span(name, fn) {
1718
+ if (!this.enabled) return fn();
1719
+ this.begin(name);
1720
+ try {
1721
+ return await fn();
1722
+ } finally {
1723
+ this.end();
1724
+ }
1725
+ }
1726
+ /** The most recent completed render tree, or `undefined`. */
1727
+ report() {
1728
+ return this.records.at(-1)?.tree ?? this.roots.at(-1);
1729
+ }
1730
+ /** Drop all collected records and any in-progress spans. */
1731
+ clear() {
1732
+ this.records.length = 0;
1733
+ this.roots = [];
1734
+ this.stack = [];
1735
+ this.runLabel = void 0;
1736
+ }
1737
+ reset() {
1738
+ this.roots = [];
1739
+ this.stack = [];
1740
+ }
1741
+ printSummary(root = this.report(), label) {
1742
+ if (!root) return;
1743
+ const total = root.duration;
1744
+ const heading = label && label !== root.name ? `${root.name} [${label}]` : root.name;
1745
+ const lines = ["ms % phase"];
1746
+ const walk = /* @__PURE__ */ __name((span, depth) => {
1747
+ const indent = " ".repeat(depth);
1748
+ const ms = span.duration.toFixed(1).padStart(8);
1749
+ const pct = total > 0 ? `${(span.duration / total * 100).toFixed(0).padStart(3)}%` : " -";
1750
+ lines.push(`${ms} ${pct} ${indent}${span.name}`);
1751
+ for (const child of span.children) walk(child, depth + 1);
1752
+ if (span.children.length > 0) {
1753
+ const childTotal = span.children.reduce((sum, c) => sum + c.duration, 0);
1754
+ const self = span.duration - childTotal;
1755
+ if (self > .5) {
1756
+ const selfMs = self.toFixed(1).padStart(8);
1757
+ lines.push(`${selfMs} ${indent} (self)`);
1758
+ }
1759
+ }
1760
+ }, "walk");
1761
+ walk(root, 0);
1762
+ const bucketNames = Object.keys(this.buckets);
1763
+ if (bucketNames.length > 0) {
1764
+ lines.push("—— buckets (summed) ——");
1765
+ for (const name of bucketNames) lines.push(`${this.buckets[name].toFixed(1).padStart(8)} ${name}`);
1766
+ }
1767
+ console.log(`${MEASURE_PREFIX}mermaid render profile \xB7 ${heading}
1768
+ ${lines.join("\n")}`);
1769
+ }
1770
+ });
1771
+ globalThis.injected ??= {
1772
+ includeLargeFeatures: true,
1773
+ profiling: false,
1774
+ version: "0.0.0"
1775
+ };
1776
+ function preprocessMarkdown(markdown, { markdownAutoWrap }) {
1777
+ const withoutExtraSpaces = dedent(markdown.replace(/<br\/>/g, "\n").replace(/\n{2,}/g, "\n"));
1778
+ if (markdownAutoWrap === false) {}
1779
+ return withoutExtraSpaces;
1780
+ }
1781
+ __name(preprocessMarkdown, "preprocessMarkdown");
1782
+ function nonMarkdownToLines(nonMarkdownText) {
1783
+ return nonMarkdownText.split(/\\n|\n|<br\s*\/?>/gi).map((line) => line.trim().match(/<[^>]+>|[^\s<>]+/g)?.map((word) => ({
1784
+ content: word,
1785
+ type: "normal"
1786
+ })) ?? []);
1787
+ }
1788
+ __name(nonMarkdownToLines, "nonMarkdownToLines");
1789
+ function markdownToLines(markdown, config = {}) {
1790
+ const preprocessedMarkdown = preprocessMarkdown(markdown, config);
1791
+ const nodes = k.lexer(preprocessedMarkdown);
1792
+ const lines = [[]];
1793
+ let currentLine = 0;
1794
+ function processNode(node, parentType = "normal") {
1795
+ if (node.type === "text") node.text.split("\n").forEach((textLine, index) => {
1796
+ if (index !== 0) {
1797
+ currentLine++;
1798
+ lines.push([]);
1799
+ }
1800
+ textLine.split(" ").forEach((word) => {
1801
+ word = word.replace(/&#39;/g, `'`);
1802
+ if (word) lines[currentLine].push({
1803
+ content: word,
1804
+ type: parentType
1805
+ });
1806
+ });
1807
+ });
1808
+ else if (node.type === "strong" || node.type === "em") node.tokens.forEach((contentNode) => {
1809
+ processNode(contentNode, node.type);
1810
+ });
1811
+ else if (node.type === "html") lines[currentLine].push({
1812
+ content: node.text,
1813
+ type: "normal"
1814
+ });
1815
+ }
1816
+ __name(processNode, "processNode");
1817
+ nodes.forEach((treeNode) => {
1818
+ if (treeNode.type === "paragraph") treeNode.tokens?.forEach((contentNode) => {
1819
+ processNode(contentNode);
1820
+ });
1821
+ else if (treeNode.type === "html") lines[currentLine].push({
1822
+ content: treeNode.text,
1823
+ type: "normal"
1824
+ });
1825
+ else lines[currentLine].push({
1826
+ content: treeNode.raw,
1827
+ type: "normal"
1828
+ });
1829
+ });
1830
+ return lines;
1831
+ }
1832
+ __name(markdownToLines, "markdownToLines");
1833
+ function nonMarkdownToHTML(text) {
1834
+ if (!text) return "";
1835
+ return `<p>${text.replace(/\\n|\n/g, "<br />")}</p>`;
1836
+ }
1837
+ __name(nonMarkdownToHTML, "nonMarkdownToHTML");
1838
+ function markdownToHTML(markdown, { markdownAutoWrap } = {}) {
1839
+ const nodes = k.lexer(markdown);
1840
+ function output(node) {
1841
+ if (node.type === "text") {
1842
+ if (markdownAutoWrap === false) return node.text.replace(/\n */g, "<br/>").replace(/ /g, "&nbsp;");
1843
+ return node.text.replace(/\n */g, "<br/>");
1844
+ } else if (node.type === "strong") return `<strong>${node.tokens?.map(output).join("")}</strong>`;
1845
+ else if (node.type === "em") return `<em>${node.tokens?.map(output).join("")}</em>`;
1846
+ else if (node.type === "paragraph") return `<p>${node.tokens?.map(output).join("")}</p>`;
1847
+ else if (node.type === "space") return "";
1848
+ else if (node.type === "html") return `${node.text}`;
1849
+ else if (node.type === "escape") return node.text;
1850
+ log.warn(`Unsupported markdown: ${node.type}`);
1851
+ return node.raw;
1852
+ }
1853
+ __name(output, "output");
1854
+ return nodes.map(output).join("");
1855
+ }
1856
+ __name(markdownToHTML, "markdownToHTML");
1857
+ var fastdom_default = (function(win) {
1858
+ "use strict";
1859
+ var raf = win.requestAnimationFrame || win.webkitRequestAnimationFrame || win.mozRequestAnimationFrame || win.msRequestAnimationFrame || function(cb) {
1860
+ return setTimeout(cb, 16);
1861
+ };
1862
+ function FastDom() {
1863
+ var self = this;
1864
+ self.reads = [];
1865
+ self.writes = [];
1866
+ self.raf = raf.bind(win);
1867
+ }
1868
+ __name(FastDom, "FastDom");
1869
+ FastDom.prototype = {
1870
+ constructor: FastDom,
1871
+ /**
1872
+ * We run this inside a try catch
1873
+ * so that if any jobs error, we
1874
+ * are able to recover and continue
1875
+ * to flush the batch until it's empty.
1876
+ *
1877
+ * @param {Array} tasks
1878
+ */
1879
+ runTasks: /* @__PURE__ */ __name(function(tasks) {
1880
+ var task;
1881
+ while (task = tasks.shift()) task();
1882
+ }, "runTasks"),
1883
+ /**
1884
+ * Adds a job to the read batch and
1885
+ * schedules a new frame if need be.
1886
+ *
1887
+ * @param {Function} fn
1888
+ * @param {Object} ctx the context to be bound to `fn` (optional).
1889
+ * @public
1890
+ */
1891
+ measure: /* @__PURE__ */ __name(function(fn, ctx) {
1892
+ var task = !ctx ? fn : fn.bind(ctx);
1893
+ this.reads.push(task);
1894
+ scheduleFlush(this);
1895
+ return task;
1896
+ }, "measure"),
1897
+ /**
1898
+ * Adds a job to the
1899
+ * write batch and schedules
1900
+ * a new frame if need be.
1901
+ *
1902
+ * @param {Function} fn
1903
+ * @param {Object} ctx the context to be bound to `fn` (optional).
1904
+ * @public
1905
+ */
1906
+ mutate: /* @__PURE__ */ __name(function(fn, ctx) {
1907
+ var task = !ctx ? fn : fn.bind(ctx);
1908
+ this.writes.push(task);
1909
+ scheduleFlush(this);
1910
+ return task;
1911
+ }, "mutate"),
1912
+ /**
1913
+ * Clears a scheduled 'read' or 'write' task.
1914
+ *
1915
+ * @param {Object} task
1916
+ * @return {Boolean} success
1917
+ * @public
1918
+ */
1919
+ clear: /* @__PURE__ */ __name(function(task) {
1920
+ return remove(this.reads, task) || remove(this.writes, task);
1921
+ }, "clear"),
1922
+ /**
1923
+ * Extend this FastDom with some
1924
+ * custom functionality.
1925
+ *
1926
+ * Because fastdom must *always* be a
1927
+ * singleton, we're actually extending
1928
+ * the fastdom instance. This means tasks
1929
+ * scheduled by an extension still enter
1930
+ * fastdom's global task queue.
1931
+ *
1932
+ * The 'super' instance can be accessed
1933
+ * from `this.fastdom`.
1934
+ *
1935
+ * @example
1936
+ *
1937
+ * var myFastdom = fastdom.extend({
1938
+ * initialize: function() {
1939
+ * // runs on creation
1940
+ * },
1941
+ *
1942
+ * // override a method
1943
+ * measure: function(fn) {
1944
+ * // do extra stuff ...
1945
+ *
1946
+ * // then call the original
1947
+ * return this.fastdom.measure(fn);
1948
+ * },
1949
+ *
1950
+ * ...
1951
+ * });
1952
+ *
1953
+ * @param {Object} props properties to mixin
1954
+ * @return {FastDom}
1955
+ */
1956
+ extend: /* @__PURE__ */ __name(function(props) {
1957
+ if (typeof props != "object") throw new Error("expected object");
1958
+ var child = Object.create(this);
1959
+ mixin(child, props);
1960
+ child.fastdom = this;
1961
+ if (child.initialize) child.initialize();
1962
+ return child;
1963
+ }, "extend"),
1964
+ catch: null
1965
+ };
1966
+ function scheduleFlush(fastdom2) {
1967
+ if (!fastdom2.scheduled) {
1968
+ fastdom2.scheduled = true;
1969
+ fastdom2.raf(flush.bind(null, fastdom2));
1970
+ }
1971
+ }
1972
+ __name(scheduleFlush, "scheduleFlush");
1973
+ function flush(fastdom2) {
1974
+ var writes = fastdom2.writes;
1975
+ var reads = fastdom2.reads;
1976
+ var error;
1977
+ try {
1978
+ reads.length;
1979
+ fastdom2.runTasks(reads);
1980
+ writes.length;
1981
+ fastdom2.runTasks(writes);
1982
+ } catch (e) {
1983
+ error = e;
1984
+ }
1985
+ fastdom2.scheduled = false;
1986
+ if (reads.length || writes.length) scheduleFlush(fastdom2);
1987
+ if (error) {
1988
+ error.message;
1989
+ if (fastdom2.catch) fastdom2.catch(error);
1990
+ else throw error;
1991
+ }
1992
+ }
1993
+ __name(flush, "flush");
1994
+ function remove(array, item) {
1995
+ var index = array.indexOf(item);
1996
+ return !!~index && !!array.splice(index, 1);
1997
+ }
1998
+ __name(remove, "remove");
1999
+ function mixin(target, source) {
2000
+ for (var key in source) if (source.hasOwnProperty(key)) target[key] = source[key];
2001
+ }
2002
+ __name(mixin, "mixin");
2003
+ return win.fastdom = win.fastdom || new FastDom();
2004
+ })(typeof window !== "undefined" ? window : globalThis);
2005
+ var exports = {
2006
+ initialize: /* @__PURE__ */ __name(function() {
2007
+ this._tasks = /* @__PURE__ */ new Map();
2008
+ }, "initialize"),
2009
+ mutate: /* @__PURE__ */ __name(function(fn, ctx) {
2010
+ return create(this, "mutate", fn, ctx);
2011
+ }, "mutate"),
2012
+ measure: /* @__PURE__ */ __name(function(fn, ctx) {
2013
+ return create(this, "measure", fn, ctx);
2014
+ }, "measure"),
2015
+ clear: /* @__PURE__ */ __name(function(promise) {
2016
+ var tasks = this._tasks;
2017
+ var task = tasks.get(promise);
2018
+ this.fastdom.clear(task);
2019
+ tasks.delete(promise);
2020
+ }, "clear")
2021
+ };
2022
+ function create(promised, type, fn, ctx) {
2023
+ var tasks = promised._tasks;
2024
+ var fastdom2 = promised.fastdom;
2025
+ var task;
2026
+ var promise = new Promise(function(resolve, reject) {
2027
+ task = fastdom2[type](function() {
2028
+ tasks.delete(promise);
2029
+ try {
2030
+ resolve(ctx ? fn.call(ctx) : fn());
2031
+ } catch (e) {
2032
+ reject(e);
2033
+ }
2034
+ }, ctx);
2035
+ });
2036
+ tasks.set(promise, task);
2037
+ return promise;
2038
+ }
2039
+ __name(create, "create");
2040
+ var { initialize, mutate, measure, clear } = exports;
2041
+ var fastdom_promised_default = exports;
2042
+ var fastdom_default2 = fastdom_default.extend({
2043
+ /**
2044
+ * `requestAnimationFrame` is too slow compared to `queueMicrotask`.
2045
+ */
2046
+ raf(cb) {
2047
+ if (typeof queueMicrotask === "function") queueMicrotask(cb);
2048
+ else setTimeout(cb, 0);
2049
+ } }).extend(fastdom_promised_default);
2050
+ function splitTextToChars(text) {
2051
+ if (Intl.Segmenter) return [...new Intl.Segmenter().segment(text)].map((s) => s.segment);
2052
+ return [...text];
2053
+ }
2054
+ __name(splitTextToChars, "splitTextToChars");
2055
+ function splitWordToFitWidth(checkFit, word) {
2056
+ return splitWordToFitWidthRecursion(checkFit, [], splitTextToChars(word.content), word.type);
2057
+ }
2058
+ __name(splitWordToFitWidth, "splitWordToFitWidth");
2059
+ function splitWordToFitWidthRecursion(checkFit, usedChars, remainingChars, type) {
2060
+ if (remainingChars.length === 0) return [{
2061
+ content: usedChars.join(""),
2062
+ type
2063
+ }, {
2064
+ content: "",
2065
+ type
2066
+ }];
2067
+ const [nextChar, ...rest] = remainingChars;
2068
+ const newWord = [...usedChars, nextChar];
2069
+ if (checkFit([{
2070
+ content: newWord.join(""),
2071
+ type
2072
+ }])) return splitWordToFitWidthRecursion(checkFit, newWord, rest, type);
2073
+ if (usedChars.length === 0 && nextChar) {
2074
+ usedChars.push(nextChar);
2075
+ remainingChars.shift();
2076
+ }
2077
+ return [{
2078
+ content: usedChars.join(""),
2079
+ type
2080
+ }, {
2081
+ content: remainingChars.join(""),
2082
+ type
2083
+ }];
2084
+ }
2085
+ __name(splitWordToFitWidthRecursion, "splitWordToFitWidthRecursion");
2086
+ function splitLineToFitWidth(line, checkFit) {
2087
+ if (line.some(({ content }) => content.includes("\n"))) throw new Error("splitLineToFitWidth does not support newlines in the line");
2088
+ return splitLineToFitWidthRecursion(line, checkFit);
2089
+ }
2090
+ __name(splitLineToFitWidth, "splitLineToFitWidth");
2091
+ function splitLineToFitWidthRecursion(words, checkFit, lines = [], newLine = []) {
2092
+ if (words.length === 0) {
2093
+ if (newLine.length > 0) lines.push(newLine);
2094
+ return lines.length > 0 ? lines : [];
2095
+ }
2096
+ let joiner = "";
2097
+ if (words[0].content === " ") {
2098
+ joiner = " ";
2099
+ words.shift();
2100
+ }
2101
+ const nextWord = words.shift() ?? {
2102
+ content: " ",
2103
+ type: "normal"
2104
+ };
2105
+ const lineWithNextWord = [...newLine];
2106
+ if (joiner !== "") lineWithNextWord.push({
2107
+ content: joiner,
2108
+ type: "normal"
2109
+ });
2110
+ lineWithNextWord.push(nextWord);
2111
+ if (checkFit(lineWithNextWord)) return splitLineToFitWidthRecursion(words, checkFit, lines, lineWithNextWord);
2112
+ if (newLine.length > 0) {
2113
+ lines.push(newLine);
2114
+ words.unshift(nextWord);
2115
+ } else if (nextWord.content) {
2116
+ const [line, rest] = splitWordToFitWidth(checkFit, nextWord);
2117
+ lines.push([line]);
2118
+ if (rest.content) words.unshift(rest);
2119
+ }
2120
+ return splitLineToFitWidthRecursion(words, checkFit, lines);
2121
+ }
2122
+ __name(splitLineToFitWidthRecursion, "splitLineToFitWidthRecursion");
2123
+ function applyStyle(dom, styleFn) {
2124
+ if (styleFn) dom.attr("style", styleFn);
2125
+ }
2126
+ __name(applyStyle, "applyStyle");
2127
+ var maxSafeSizeForWidth = 16384;
2128
+ async function addHtmlSpan(element, node, width, classes, addBackground = false, config = getConfig(), minWidth = 0) {
2129
+ const fo = element.append("foreignObject");
2130
+ fo.attr("width", `${Math.min(10 * width, maxSafeSizeForWidth)}px`);
2131
+ fo.attr("height", `${Math.min(10 * width, maxSafeSizeForWidth)}px`);
2132
+ const div = fo.append("xhtml:div");
2133
+ const sanitizedLabel = hasKatex(node.label) ? await renderKatexSanitized(node.label.replace(common_default.lineBreakRegex, "\n"), config) : sanitizeText(node.label, config);
2134
+ const labelClass = node.isNode ? "nodeLabel" : "edgeLabel";
2135
+ const span = div.append("span");
2136
+ span.html(sanitizedLabel);
2137
+ applyStyle(span, node.labelStyle);
2138
+ span.attr("class", `${labelClass} ${classes}`);
2139
+ applyStyle(div, node.labelStyle);
2140
+ div.style("display", "table-cell");
2141
+ div.style("white-space", "nowrap");
2142
+ div.style("line-height", "1.5");
2143
+ if (width !== Number.POSITIVE_INFINITY) {
2144
+ div.style("max-width", width + "px");
2145
+ div.style("text-align", "center");
2146
+ }
2147
+ div.attr("xmlns", "http://www.w3.org/1999/xhtml");
2148
+ if (addBackground) div.attr("class", "labelBkg");
2149
+ const bbox = await fastdom_default2.measure(() => div.node().getBoundingClientRect());
2150
+ if (bbox.width === width) {
2151
+ div.style("display", "table");
2152
+ div.style("white-space", "break-spaces");
2153
+ div.style("width", width + "px");
2154
+ } else if (bbox.width < minWidth) {
2155
+ div.style("display", "table");
2156
+ div.style("width", minWidth + "px");
2157
+ div.style("text-align", "center");
2158
+ }
2159
+ return fo.node();
2160
+ }
2161
+ __name(addHtmlSpan, "addHtmlSpan");
2162
+ function createTspan(textElement, lineIndex, lineHeight, centerText = false) {
2163
+ const tspan = textElement.append("tspan").attr("class", "text-outer-tspan").attr("x", 0).attr("y", lineIndex * lineHeight - .1 + "em").attr("dy", lineHeight + "em");
2164
+ if (centerText) tspan.attr("text-anchor", "middle");
2165
+ return tspan;
2166
+ }
2167
+ __name(createTspan, "createTspan");
2168
+ function computeWidthOfText(parentNode, lineHeight, line) {
2169
+ const testElement = parentNode.append("text");
2170
+ const testSpan = createTspan(testElement, 1, lineHeight);
2171
+ updateTextContentAndStyles(testSpan, line);
2172
+ const textLength = testSpan.node().getComputedTextLength();
2173
+ testElement.remove();
2174
+ return textLength;
2175
+ }
2176
+ __name(computeWidthOfText, "computeWidthOfText");
2177
+ function computeDimensionOfText(parentNode, lineHeight, text) {
2178
+ const testElement = parentNode.append("text");
2179
+ const testSpan = createTspan(testElement, 1, lineHeight);
2180
+ updateTextContentAndStyles(testSpan, [{
2181
+ content: text,
2182
+ type: "normal"
2183
+ }]);
2184
+ const textDimension = testSpan.node()?.getBoundingClientRect();
2185
+ if (textDimension) testElement.remove();
2186
+ return textDimension;
2187
+ }
2188
+ __name(computeDimensionOfText, "computeDimensionOfText");
2189
+ function createFormattedText(width, g, structuredText, addBackground = false, centerText = false) {
2190
+ const lineHeight = 1.1;
2191
+ const labelGroup = g.append("g");
2192
+ const bkg = labelGroup.insert("rect").attr("class", "background").attr("style", "stroke: none");
2193
+ const textElement = labelGroup.append("text").attr("y", "-10.1");
2194
+ if (centerText) textElement.attr("text-anchor", "middle");
2195
+ let lineIndex = 0;
2196
+ for (const line of structuredText) {
2197
+ const checkWidth = /* @__PURE__ */ __name((line2) => computeWidthOfText(labelGroup, lineHeight, line2) <= width, "checkWidth");
2198
+ const linesUnderWidth = checkWidth(line) ? [line] : splitLineToFitWidth(line, checkWidth);
2199
+ for (const preparedLine of linesUnderWidth) {
2200
+ updateTextContentAndStyles(createTspan(textElement, lineIndex, lineHeight, centerText), preparedLine);
2201
+ lineIndex++;
2202
+ }
2203
+ }
2204
+ if (addBackground) {
2205
+ const bbox = textElement.node().getBBox();
2206
+ const padding = 2;
2207
+ bkg.attr("x", bbox.x - padding).attr("y", bbox.y - padding).attr("width", bbox.width + 2 * padding).attr("height", bbox.height + 2 * padding);
2208
+ return labelGroup.node();
2209
+ } else return textElement.node();
2210
+ }
2211
+ __name(createFormattedText, "createFormattedText");
2212
+ function decodeHTMLEntities(text) {
2213
+ return text.replace(/&(amp|lt|gt);/g, (match, entity) => {
2214
+ switch (entity) {
2215
+ case "amp": return "&";
2216
+ case "lt": return "<";
2217
+ case "gt": return ">";
2218
+ default: return match;
2219
+ }
2220
+ });
2221
+ }
2222
+ __name(decodeHTMLEntities, "decodeHTMLEntities");
2223
+ function updateTextContentAndStyles(tspan, wrappedLine) {
2224
+ tspan.text("");
2225
+ wrappedLine.forEach((word, index) => {
2226
+ const innerTspan = tspan.append("tspan").attr("font-style", word.type === "em" ? "italic" : "normal").attr("class", "text-inner-tspan").attr("font-weight", word.type === "strong" ? "bold" : "normal");
2227
+ if (index === 0) innerTspan.text(decodeHTMLEntities(word.content));
2228
+ else innerTspan.text(" " + decodeHTMLEntities(word.content));
2229
+ });
2230
+ }
2231
+ __name(updateTextContentAndStyles, "updateTextContentAndStyles");
2232
+ async function replaceIconSubstring(text, config = {}) {
2233
+ const pendingReplacements = [];
2234
+ text.replace(/(fa[bklrs]?):fa-([\w-]+)/g, (fullMatch, prefix, iconName) => {
2235
+ pendingReplacements.push((async () => {
2236
+ const registeredIconName = `${prefix}:${iconName}`;
2237
+ if (await isIconAvailable(registeredIconName)) return await getIconSVG(registeredIconName, void 0, { class: "label-icon" });
2238
+ else return `<i class='${sanitizeText(fullMatch, config).replace(":", " ")}'></i>`;
2239
+ })());
2240
+ return fullMatch;
2241
+ });
2242
+ const replacements = await Promise.all(pendingReplacements);
2243
+ return text.replace(/(fa[bklrs]?):fa-([\w-]+)/g, () => replacements.shift() ?? "");
2244
+ }
2245
+ __name(replaceIconSubstring, "replaceIconSubstring");
2246
+ var createText = /* @__PURE__ */ __name(async (el, text = "", { style = "", isTitle = false, classes = "", useHtmlLabels = true, markdown = true, isNode = true, width = 200, minWidth = 0, addSvgBackground = false } = {}, config) => {
2247
+ log.debug("XYZ createText", text, style, isTitle, classes, useHtmlLabels, isNode, "addSvgBackground: ", addSvgBackground);
2248
+ if (useHtmlLabels) {
2249
+ const decodedReplacedText = await replaceIconSubstring(decodeEntities(markdown ? markdownToHTML(text, config) : nonMarkdownToHTML(text)), config);
2250
+ const inputForKatex = text.replace(/\\\\/g, "\\");
2251
+ return await addHtmlSpan(el, {
2252
+ isNode,
2253
+ label: hasKatex(text) ? inputForKatex : decodedReplacedText,
2254
+ labelStyle: style.replace("fill:", "color:")
2255
+ }, width, classes, addSvgBackground, config, minWidth);
2256
+ } else {
2257
+ const sanitizeBR = decodeEntities(text.replace(/<br\s*\/?>/g, "<br/>"));
2258
+ const svgLabel = createFormattedText(width, el, markdown ? markdownToLines(sanitizeBR.replace("<br>", "<br/>"), config) : nonMarkdownToLines(sanitizeBR), text ? addSvgBackground : false, !isNode);
2259
+ if (isNode) {
2260
+ if (/stroke:/.exec(style)) style = style.replace("stroke:", "lineColor:");
2261
+ const nodeLabelTextStyle = style.replace(/stroke:[^;]+;?/g, "").replace(/stroke-width:[^;]+;?/g, "").replace(/fill:[^;]+;?/g, "").replace(/color:/g, "fill:");
2262
+ select_default(svgLabel).attr("style", nodeLabelTextStyle);
2263
+ } else {
2264
+ const edgeLabelRectStyle = style.replace(/stroke:[^;]+;?/g, "").replace(/stroke-width:[^;]+;?/g, "").replace(/fill:[^;]+;?/g, "").replace(/background:/g, "fill:");
2265
+ select_default(svgLabel).select("rect").attr("style", edgeLabelRectStyle.replace(/background:/g, "fill:"));
2266
+ const edgeLabelTextStyle = style.replace(/stroke:[^;]+;?/g, "").replace(/stroke-width:[^;]+;?/g, "").replace(/fill:[^;]+;?/g, "").replace(/color:/g, "fill:");
2267
+ select_default(svgLabel).select("text").attr("style", edgeLabelTextStyle);
2268
+ }
2269
+ if (isTitle) select_default(svgLabel).selectAll("tspan.text-outer-tspan").classed("title-row", true);
2270
+ else select_default(svgLabel).selectAll("tspan.text-outer-tspan").classed("row", true);
2271
+ return svgLabel;
2272
+ }
2273
+ }, "createText");
2274
+
2275
+ //#endregion
2276
+ export { dedent as a, markdownToLines as i, createText as n, fastdom_default2 as r, computeDimensionOfText as t };