@smarter.sh/ui-chat 0.8.0 → 0.9.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/README.md +328 -107
  2. package/dist/embed/katex/fonts/KaTeX_AMS-Regular.woff2 +0 -0
  3. package/dist/embed/katex/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
  4. package/dist/embed/katex/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
  5. package/dist/embed/katex/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
  6. package/dist/embed/katex/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
  7. package/dist/embed/katex/fonts/KaTeX_Main-Bold.woff2 +0 -0
  8. package/dist/embed/katex/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
  9. package/dist/embed/katex/fonts/KaTeX_Main-Italic.woff2 +0 -0
  10. package/dist/embed/katex/fonts/KaTeX_Main-Regular.woff2 +0 -0
  11. package/dist/embed/katex/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
  12. package/dist/embed/katex/fonts/KaTeX_Math-Italic.woff2 +0 -0
  13. package/dist/embed/katex/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
  14. package/dist/embed/katex/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
  15. package/dist/embed/katex/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
  16. package/dist/embed/katex/fonts/KaTeX_Script-Regular.woff2 +0 -0
  17. package/dist/embed/katex/fonts/KaTeX_Size1-Regular.woff2 +0 -0
  18. package/dist/embed/katex/fonts/KaTeX_Size2-Regular.woff2 +0 -0
  19. package/dist/embed/katex/fonts/KaTeX_Size3-Regular.woff2 +0 -0
  20. package/dist/embed/katex/fonts/KaTeX_Size4-Regular.woff2 +0 -0
  21. package/dist/embed/katex/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
  22. package/dist/embed/mermaid/abnfDiagram-VCTEODGH-1SbERmPs.js +89 -0
  23. package/dist/embed/mermaid/arc-VicTtbbz.js +82 -0
  24. package/dist/embed/mermaid/architecture-7GRP2DOG-D0nnNZ3B.js +2 -0
  25. package/dist/embed/mermaid/architectureDiagram-5GKGNRK7-CQABdiy9.js +4138 -0
  26. package/dist/embed/mermaid/array-CApNbSU9.js +6 -0
  27. package/dist/embed/mermaid/blockDiagram-I7D4REHJ-CtjOz0Jt.js +1911 -0
  28. package/dist/embed/mermaid/c4Diagram-7LVT6UL2-_qBudB6C.js +3010 -0
  29. package/dist/embed/mermaid/channel-BXMcYHk2.js +5 -0
  30. package/dist/embed/mermaid/chunk-2E4U76K2-CBll2dEU.js +346 -0
  31. package/dist/embed/mermaid/chunk-2Q5K7J3B-kzxEEeTu.js +15 -0
  32. package/dist/embed/mermaid/chunk-4HAMMTFA-Dhz0SVnN.js +4188 -0
  33. package/dist/embed/mermaid/chunk-5VM5RSS4-Cr17nBXp.js +5 -0
  34. package/dist/embed/mermaid/chunk-75Z2AOVW-BsWtLgfj.js +1330 -0
  35. package/dist/embed/mermaid/chunk-CLGD4ZFX-Bkjwlxy9.js +14 -0
  36. package/dist/embed/mermaid/chunk-DU6HZSFF-1zIarP1Q.js +3900 -0
  37. package/dist/embed/mermaid/chunk-F27PBJKO-CiOL12VY.js +61 -0
  38. package/dist/embed/mermaid/chunk-FOHPRMQF-DS9zEyR5.js +21447 -0
  39. package/dist/embed/mermaid/chunk-GMAD6QVW-Dc0gE_3Q.js +1804 -0
  40. package/dist/embed/mermaid/chunk-GVQU2GXP-CWFtOgtb.js +37 -0
  41. package/dist/embed/mermaid/chunk-IMKFNOWR-CLyTlLwx.js +2042 -0
  42. package/dist/embed/mermaid/chunk-JWPE2WC7-Ccb0QaC8.js +8 -0
  43. package/dist/embed/mermaid/chunk-L3NEJ4N5-DnkSrVO8.js +245 -0
  44. package/dist/embed/mermaid/chunk-LNGE3PJU-ByFTjlja.js +1517 -0
  45. package/dist/embed/mermaid/chunk-OSK3NFVY-B57tZZIG.js +672 -0
  46. package/dist/embed/mermaid/chunk-P2QGCYS3-BUVAOFF-.js +67 -0
  47. package/dist/embed/mermaid/chunk-POPQ4Y6H-BsUdeJ_J.js +26 -0
  48. package/dist/embed/mermaid/chunk-PWAF6VOD-Cb-w19aO.js +275 -0
  49. package/dist/embed/mermaid/chunk-SHT3W25Y-znBBpcIu.js +4183 -0
  50. package/dist/embed/mermaid/chunk-SVP7TREG-DrHUM-6R.js +490 -0
  51. package/dist/embed/mermaid/chunk-TICWLB2K-xlGqZZYJ.js +3357 -0
  52. package/dist/embed/mermaid/chunk-TLUHSLCS-COwDpXBa.js +59 -0
  53. package/dist/embed/mermaid/chunk-XXDRQBXY-pOp8MAr9.js +9 -0
  54. package/dist/embed/mermaid/chunk-Y2CYZVJY-i11wjrBe.js +12 -0
  55. package/dist/embed/mermaid/classDiagram-ZZMXUADV-C8BeuQnA.js +30 -0
  56. package/dist/embed/mermaid/classDiagram-v2-VYDZK3BY-B3jylZLr.js +30 -0
  57. package/dist/embed/mermaid/cose-bilkent-JH36ORCC-DFvJxZ7v.js +2240 -0
  58. package/dist/embed/mermaid/cynefin-OW5HDTMX-B6YJOAMM.js +2 -0
  59. package/dist/embed/mermaid/cynefinDiagram-5FMLGOSQ-CCm5IQBE.js +355 -0
  60. package/dist/embed/mermaid/cytoscape.esm-BstmGtAB.js +18047 -0
  61. package/dist/embed/mermaid/dagre-BwzzJJA_.js +1932 -0
  62. package/dist/embed/mermaid/dagre-GXQ25YYZ-B3d3iNF-.js +423 -0
  63. package/dist/embed/mermaid/defaultLocale-N-0uLSyg.js +198 -0
  64. package/dist/embed/mermaid/diagram-S7CK7UJ4-BeA5UJrt.js +293 -0
  65. package/dist/embed/mermaid/diagram-UQ7AKVKN-DK0uHb-2.js +214 -0
  66. package/dist/embed/mermaid/diagram-VSXAHHWV-D5JXip1B.js +432 -0
  67. package/dist/embed/mermaid/diagram-VX7I27RA-B1VysvG9.js +527 -0
  68. package/dist/embed/mermaid/diagram-Z3DM3KII-ZGUJaFq-.js +134 -0
  69. package/dist/embed/mermaid/dist-DRRwZ4Yi.js +59 -0
  70. package/dist/embed/mermaid/ebnfDiagram-PWID7BFC-BOahZhWx.js +100 -0
  71. package/dist/embed/mermaid/erDiagram-RLTQ6QDP-7cGpGRQo.js +1966 -0
  72. package/dist/embed/mermaid/eventmodeling-NTZA5JFV-C3kU50Cz.js +2 -0
  73. package/dist/embed/mermaid/flowDiagram-HODETNUW-D-eJN2AO.js +16 -0
  74. package/dist/embed/mermaid/ganttDiagram-EL5Y4UJY-s6Kx4KlU.js +3072 -0
  75. package/dist/embed/mermaid/gitGraph-4MIJSDKK-CqdlGRFk.js +2 -0
  76. package/dist/embed/mermaid/gitGraphDiagram-WWUBYQGX-Blwdy0b7.js +733 -0
  77. package/dist/embed/mermaid/graphlib-XW-Jr8pF.js +1267 -0
  78. package/dist/embed/mermaid/info-A6RAGUB7-2pwra5F3.js +2 -0
  79. package/dist/embed/mermaid/infoDiagram-27XIBGKW-CstzbQPb.js +20 -0
  80. package/dist/embed/mermaid/init-CsQUQz36.js +13 -0
  81. package/dist/embed/mermaid/ishikawaDiagram-5VMMS53U-C6y_w0kd.js +717 -0
  82. package/dist/embed/mermaid/journeyDiagram-3NMN7TZE-BHVux_z1.js +884 -0
  83. package/dist/embed/mermaid/kanban-definition-UXKFOSKX-Cgj-7IHi.js +976 -0
  84. package/dist/embed/mermaid/katex-DmPOayaq.js +21968 -0
  85. package/dist/embed/mermaid/line-brkWVSn0.js +34 -0
  86. package/dist/embed/mermaid/linear-CiZWLcTr.js +287 -0
  87. package/dist/embed/mermaid/mermaid-parser.core-BjLg_By9.js +632 -0
  88. package/dist/embed/mermaid/mermaid.js +1092 -0
  89. package/dist/embed/mermaid/mindmap-definition-YA3MSWOX-DRc-FzI_.js +1006 -0
  90. package/dist/embed/mermaid/ordinal-BubEveRk.js +65 -0
  91. package/dist/embed/mermaid/packet-AYTQ26CC-C3h9OoFk.js +2 -0
  92. package/dist/embed/mermaid/path-CnWkkRiY.js +84 -0
  93. package/dist/embed/mermaid/pegDiagram-XKGWAZYB-Cw-aYwaF.js +94 -0
  94. package/dist/embed/mermaid/pie-WAS4IAKB-CaECYpHT.js +2 -0
  95. package/dist/embed/mermaid/pieDiagram-E7YTZNPT-DoguGyzq.js +203 -0
  96. package/dist/embed/mermaid/quadrantDiagram-AXDQQJYC-Cu4dMFZL.js +2001 -0
  97. package/dist/embed/mermaid/radar-RG4KPBEZ-CoS7pnd_.js +2 -0
  98. package/dist/embed/mermaid/railroad-74A4TZTK-BjHa6MAk.js +2 -0
  99. package/dist/embed/mermaid/railroad-abnf-HS5TGJTU-Bm2YWqjG.js +2 -0
  100. package/dist/embed/mermaid/railroad-ebnf-LZEXJU2U-C7mPpgM3.js +2 -0
  101. package/dist/embed/mermaid/railroad-peg-WCYAUIDC-Cyp07M5x.js +2 -0
  102. package/dist/embed/mermaid/railroadDiagram-O6MQD6OU-DDX-9GRQ.js +76 -0
  103. package/dist/embed/mermaid/requirementDiagram-BXWQKSXE-z8PPo06M.js +2224 -0
  104. package/dist/embed/mermaid/rough.esm-DXYGHN3m.js +1361 -0
  105. package/dist/embed/mermaid/sankeyDiagram-P5KCCOFB-CeD0II3M.js +972 -0
  106. package/dist/embed/mermaid/sequenceDiagram-WJ2MYXX4-Cs-Wxyvw.js +4156 -0
  107. package/dist/embed/mermaid/sizeCapture-INFHLROL-DujrpAYz.js +46 -0
  108. package/dist/embed/mermaid/src-DbyMbLVK.js +2141 -0
  109. package/dist/embed/mermaid/stateDiagram-D77RDMKH-CqWtgHSc.js +220 -0
  110. package/dist/embed/mermaid/stateDiagram-v2-MP3YSRHH-CPideWIU.js +30 -0
  111. package/dist/embed/mermaid/swimlanes-42K2YHIH-MutR4uV4.js +4957 -0
  112. package/dist/embed/mermaid/swimlanesDiagram-VR7AAH4N-BC_o7pti.js +31 -0
  113. package/dist/embed/mermaid/timeline-definition-24CTP7MA-rZfNRFiT.js +1069 -0
  114. package/dist/embed/mermaid/treeView-Q6P3EWNA-C94eS7gV.js +2 -0
  115. package/dist/embed/mermaid/treemap-WGGIJYW6-DnrVJ1h3.js +2 -0
  116. package/dist/embed/mermaid/vennDiagram-4TSXK5OY-KwMHebDQ.js +1880 -0
  117. package/dist/embed/mermaid/wardley-WFR3VGLG-DRDACyIN.js +2 -0
  118. package/dist/embed/mermaid/wardleyDiagram-VM6X3IG4-C-Fm7GGB.js +645 -0
  119. package/dist/embed/mermaid/xychartDiagram-S5SC5T6Z-DZX43ay9.js +2210 -0
  120. package/dist/embed.js +903 -0
  121. package/dist/embed.js.map +1 -0
  122. package/dist/smarter-chat-library.es.js +2722 -2805
  123. package/dist/smarter-chat-library.es.js.map +1 -1
  124. package/dist/smarter-chat-library.umd.js +56 -56
  125. package/dist/smarter-chat-library.umd.js.map +1 -1
  126. package/dist/types/src/components/SmarterChat/Component.d.ts +1 -1
  127. package/dist/types/src/embed/EmbedApp.d.ts +10 -0
  128. package/dist/types/src/embed/assets.d.ts +7 -0
  129. package/dist/types/src/embed/autoMount.d.ts +18 -0
  130. package/dist/types/src/embed/css.d.ts +15 -0
  131. package/dist/types/src/embed/element.d.ts +19 -0
  132. package/dist/types/src/embed/index.d.ts +17 -0
  133. package/dist/types/src/embed/mermaid.d.ts +2 -0
  134. package/dist/types/src/embed/mermaidImport.d.ts +1 -0
  135. package/dist/types/src/embed/options.d.ts +69 -0
  136. package/dist/types/src/lib/cookie.d.ts +4 -3
  137. package/dist/types/src/lib/mermaidImport.d.ts +8 -0
  138. package/dist/types/src/types.d.ts +7 -0
  139. package/package.json +10 -4
@@ -0,0 +1,1804 @@
1
+ import { _ as e, m as t, p as n, v as r } from "./src-DbyMbLVK.js";
2
+ import { n as i } from "./chunk-Y2CYZVJY-i11wjrBe.js";
3
+ import { A as a, F as o, b as s, s as c, z as l } from "./chunk-DU6HZSFF-1zIarP1Q.js";
4
+ import { a as u } from "./chunk-75Z2AOVW-BsWtLgfj.js";
5
+ import { n as d, t as f } from "./chunk-PWAF6VOD-Cb-w19aO.js";
6
+ //#region node_modules/fastdom/fastdom.js
7
+ var p = /* @__PURE__ */ e(((e, t, n) => {
8
+ (function(e) {
9
+ var n = e.requestAnimationFrame || e.webkitRequestAnimationFrame || e.mozRequestAnimationFrame || e.msRequestAnimationFrame || function(e) {
10
+ return setTimeout(e, 16);
11
+ };
12
+ function r() {
13
+ var t = this;
14
+ t.reads = [], t.writes = [], t.raf = n.bind(e);
15
+ }
16
+ r.prototype = {
17
+ constructor: r,
18
+ runTasks: function(e) {
19
+ for (var t; t = e.shift();) t();
20
+ },
21
+ measure: function(e, t) {
22
+ var n = t ? e.bind(t) : e;
23
+ return this.reads.push(n), i(this), n;
24
+ },
25
+ mutate: function(e, t) {
26
+ var n = t ? e.bind(t) : e;
27
+ return this.writes.push(n), i(this), n;
28
+ },
29
+ clear: function(e) {
30
+ return o(this.reads, e) || o(this.writes, e);
31
+ },
32
+ extend: function(e) {
33
+ if (typeof e != "object") throw Error("expected object");
34
+ var t = Object.create(this);
35
+ return s(t, e), t.fastdom = this, t.initialize && t.initialize(), t;
36
+ },
37
+ catch: null
38
+ };
39
+ function i(e) {
40
+ e.scheduled || (e.scheduled = !0, e.raf(a.bind(null, e)));
41
+ }
42
+ function a(e) {
43
+ var t = e.writes, n = e.reads, r;
44
+ try {
45
+ n.length, e.runTasks(n), t.length, e.runTasks(t);
46
+ } catch (e) {
47
+ r = e;
48
+ }
49
+ if (e.scheduled = !1, (n.length || t.length) && i(e), r) {
50
+ if (r.message, e.catch) e.catch(r);
51
+ else throw r;
52
+ }
53
+ }
54
+ function o(e, t) {
55
+ var n = e.indexOf(t);
56
+ return !!~n && !!e.splice(n, 1);
57
+ }
58
+ function s(e, t) {
59
+ for (var n in t) t.hasOwnProperty(n) && (e[n] = t[n]);
60
+ }
61
+ var c = e.fastdom = e.fastdom || new r();
62
+ typeof define == "function" ? define(function() {
63
+ return c;
64
+ }) : typeof t == "object" && (t.exports = c);
65
+ })(typeof window < "u" ? window : n === void 0 ? globalThis : n);
66
+ })), m = /* @__PURE__ */ e(((e, t) => {
67
+ (function() {
68
+ var e = {
69
+ initialize: function() {
70
+ this._tasks = /* @__PURE__ */ new Map();
71
+ },
72
+ mutate: function(e, t) {
73
+ return n(this, "mutate", e, t);
74
+ },
75
+ measure: function(e, t) {
76
+ return n(this, "measure", e, t);
77
+ },
78
+ clear: function(e) {
79
+ var t = this._tasks, n = t.get(e);
80
+ this.fastdom.clear(n), t.delete(e);
81
+ }
82
+ };
83
+ function n(e, t, n, r) {
84
+ var i = e._tasks, a = e.fastdom, o, s = new Promise(function(e, c) {
85
+ o = a[t](function() {
86
+ i.delete(s);
87
+ try {
88
+ e(r ? n.call(r) : n());
89
+ } catch (e) {
90
+ c(e);
91
+ }
92
+ }, r);
93
+ });
94
+ return i.set(s, o), s;
95
+ }
96
+ (typeof define)[0] == "f" ? define(function() {
97
+ return e;
98
+ }) : (typeof t)[0] == "o" ? t.exports = e : window.fastdomPromised = e;
99
+ })();
100
+ })), h = /* @__PURE__ */ r(p(), 1), ee = /* @__PURE__ */ r(m(), 1);
101
+ function g() {
102
+ return {
103
+ async: !1,
104
+ breaks: !1,
105
+ extensions: null,
106
+ gfm: !0,
107
+ hooks: null,
108
+ pedantic: !1,
109
+ renderer: null,
110
+ silent: !1,
111
+ tokenizer: null,
112
+ walkTokens: null
113
+ };
114
+ }
115
+ var _ = g();
116
+ function te(e) {
117
+ _ = e;
118
+ }
119
+ var v = { exec: () => null };
120
+ function y(e, t = "") {
121
+ let n = typeof e == "string" ? e : e.source, r = {
122
+ replace: (e, t) => {
123
+ let i = typeof t == "string" ? t : t.source;
124
+ return i = i.replace(b.caret, "$1"), n = n.replace(e, i), r;
125
+ },
126
+ getRegex: () => new RegExp(n, t)
127
+ };
128
+ return r;
129
+ }
130
+ var ne = (() => {
131
+ try {
132
+ return !0;
133
+ } catch {
134
+ return !1;
135
+ }
136
+ })(), b = {
137
+ codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm,
138
+ outputLinkReplace: /\\([\[\]])/g,
139
+ indentCodeCompensation: /^(\s+)(?:```)/,
140
+ beginningSpace: /^\s+/,
141
+ endingHash: /#$/,
142
+ startingSpaceChar: /^ /,
143
+ endingSpaceChar: / $/,
144
+ nonSpaceChar: /[^ ]/,
145
+ newLineCharGlobal: /\n/g,
146
+ tabCharGlobal: /\t/g,
147
+ multipleSpaceGlobal: /\s+/g,
148
+ blankLine: /^[ \t]*$/,
149
+ doubleBlankLine: /\n[ \t]*\n[ \t]*$/,
150
+ blockquoteStart: /^ {0,3}>/,
151
+ blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g,
152
+ blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm,
153
+ listReplaceTabs: /^\t+/,
154
+ listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g,
155
+ listIsTask: /^\[[ xX]\] /,
156
+ listReplaceTask: /^\[[ xX]\] +/,
157
+ anyLine: /\n.*\n/,
158
+ hrefBrackets: /^<(.*)>$/,
159
+ tableDelimiter: /[:|]/,
160
+ tableAlignChars: /^\||\| *$/g,
161
+ tableRowBlankLine: /\n[ \t]*$/,
162
+ tableAlignRight: /^ *-+: *$/,
163
+ tableAlignCenter: /^ *:-+: *$/,
164
+ tableAlignLeft: /^ *:-+ *$/,
165
+ startATag: /^<a /i,
166
+ endATag: /^<\/a>/i,
167
+ startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i,
168
+ endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i,
169
+ startAngleBracket: /^</,
170
+ endAngleBracket: />$/,
171
+ pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/,
172
+ unicodeAlphaNumeric: /[\p{L}\p{N}]/u,
173
+ escapeTest: /[&<>"']/,
174
+ escapeReplace: /[&<>"']/g,
175
+ escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,
176
+ escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,
177
+ unescapeTest: /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,
178
+ caret: /(^|[^\[])\^/g,
179
+ percentDecode: /%25/g,
180
+ findPipe: /\|/g,
181
+ splitPipe: / \|/,
182
+ slashPipe: /\\\|/g,
183
+ carriageReturn: /\r\n|\r/g,
184
+ spaceLine: /^ +$/gm,
185
+ notSpaceStart: /^\S*/,
186
+ endingNewline: /\n$/,
187
+ listItemRegex: (e) => RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),
188
+ nextBulletRegex: (e) => RegExp(`^ {0,${Math.min(3, e - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),
189
+ hrRegex: (e) => RegExp(`^ {0,${Math.min(3, e - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),
190
+ fencesBeginRegex: (e) => RegExp(`^ {0,${Math.min(3, e - 1)}}(?:\`\`\`|~~~)`),
191
+ headingBeginRegex: (e) => RegExp(`^ {0,${Math.min(3, e - 1)}}#`),
192
+ htmlBeginRegex: (e) => RegExp(`^ {0,${Math.min(3, e - 1)}}<(?:[a-z].*>|!--)`, "i")
193
+ }, re = /^(?:[ \t]*(?:\n|$))+/, ie = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, ae = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, x = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, oe = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, S = /(?:[*+-]|\d{1,9}[.)])/, se = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, ce = y(se).replace(/bull/g, S).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(), le = y(se).replace(/bull/g, S).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(), C = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, ue = /^[^\n]+/, w = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, de = y(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", w).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), fe = y(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, S).getRegex(), T = "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", E = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, pe = y("^ {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", E).replace("tag", T).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), me = y(C).replace("hr", x).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", T).getRegex(), D = {
194
+ blockquote: y(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", me).getRegex(),
195
+ code: ie,
196
+ def: de,
197
+ fences: ae,
198
+ heading: oe,
199
+ hr: x,
200
+ html: pe,
201
+ lheading: ce,
202
+ list: fe,
203
+ newline: re,
204
+ paragraph: me,
205
+ table: v,
206
+ text: ue
207
+ }, he = y("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", x).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", T).getRegex(), ge = {
208
+ ...D,
209
+ lheading: le,
210
+ table: he,
211
+ paragraph: y(C).replace("hr", x).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", he).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", T).getRegex()
212
+ }, _e = {
213
+ ...D,
214
+ html: y("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", E).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(),
215
+ def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
216
+ heading: /^(#{1,6})(.*)(?:\n+|$)/,
217
+ fences: v,
218
+ lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
219
+ paragraph: y(C).replace("hr", x).replace("heading", " *#{1,6} *[^\n]").replace("lheading", ce).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
220
+ }, ve = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, ye = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, be = /^( {2,}|\\)\n(?!\s*$)/, xe = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, O = /[\p{P}\p{S}]/u, k = /[\s\p{P}\p{S}]/u, Se = /[^\s\p{P}\p{S}]/u, Ce = y(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, k).getRegex(), we = /(?!~)[\p{P}\p{S}]/u, Te = /(?!~)[\s\p{P}\p{S}]/u, Ee = /(?:[^\s\p{P}\p{S}]|~)/u, De = y(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", ne ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), Oe = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, ke = y(Oe, "u").replace(/punct/g, O).getRegex(), Ae = y(Oe, "u").replace(/punct/g, we).getRegex(), je = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Me = y(je, "gu").replace(/notPunctSpace/g, Se).replace(/punctSpace/g, k).replace(/punct/g, O).getRegex(), Ne = y(je, "gu").replace(/notPunctSpace/g, Ee).replace(/punctSpace/g, Te).replace(/punct/g, we).getRegex(), Pe = y("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, Se).replace(/punctSpace/g, k).replace(/punct/g, O).getRegex(), Fe = y(/\\(punct)/, "gu").replace(/punct/g, O).getRegex(), Ie = y(/^<(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(), Le = y(E).replace("(?:-->|$)", "-->").getRegex(), Re = y("^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", Le).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), A = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/, ze = y(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", A).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), Be = y(/^!?\[(label)\]\[(ref)\]/).replace("label", A).replace("ref", w).getRegex(), Ve = y(/^!?\[(ref)\](?:\[\])?/).replace("ref", w).getRegex(), He = y("reflink|nolink(?!\\()", "g").replace("reflink", Be).replace("nolink", Ve).getRegex(), Ue = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, j = {
221
+ _backpedal: v,
222
+ anyPunctuation: Fe,
223
+ autolink: Ie,
224
+ blockSkip: De,
225
+ br: be,
226
+ code: ye,
227
+ del: v,
228
+ emStrongLDelim: ke,
229
+ emStrongRDelimAst: Me,
230
+ emStrongRDelimUnd: Pe,
231
+ escape: ve,
232
+ link: ze,
233
+ nolink: Ve,
234
+ punctuation: Ce,
235
+ reflink: Be,
236
+ reflinkSearch: He,
237
+ tag: Re,
238
+ text: xe,
239
+ url: v
240
+ }, We = {
241
+ ...j,
242
+ link: y(/^!?\[(label)\]\((.*?)\)/).replace("label", A).getRegex(),
243
+ reflink: y(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", A).getRegex()
244
+ }, M = {
245
+ ...j,
246
+ emStrongRDelimAst: Ne,
247
+ emStrongLDelim: Ae,
248
+ url: y(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", Ue).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
249
+ _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
250
+ del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
251
+ text: y(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", Ue).getRegex()
252
+ }, Ge = {
253
+ ...M,
254
+ br: y(be).replace("{2,}", "*").getRegex(),
255
+ text: y(M.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
256
+ }, N = {
257
+ normal: D,
258
+ gfm: ge,
259
+ pedantic: _e
260
+ }, P = {
261
+ normal: j,
262
+ gfm: M,
263
+ breaks: Ge,
264
+ pedantic: We
265
+ }, Ke = {
266
+ "&": "&amp;",
267
+ "<": "&lt;",
268
+ ">": "&gt;",
269
+ "\"": "&quot;",
270
+ "'": "&#39;"
271
+ }, qe = (e) => Ke[e];
272
+ function F(e, t) {
273
+ if (t) {
274
+ if (b.escapeTest.test(e)) return e.replace(b.escapeReplace, qe);
275
+ } else if (b.escapeTestNoEncode.test(e)) return e.replace(b.escapeReplaceNoEncode, qe);
276
+ return e;
277
+ }
278
+ function Je(e) {
279
+ try {
280
+ e = encodeURI(e).replace(b.percentDecode, "%");
281
+ } catch {
282
+ return null;
283
+ }
284
+ return e;
285
+ }
286
+ function Ye(e, t) {
287
+ let n = e.replace(b.findPipe, (e, t, n) => {
288
+ let r = !1, i = t;
289
+ for (; --i >= 0 && n[i] === "\\";) r = !r;
290
+ return r ? "|" : " |";
291
+ }).split(b.splitPipe), r = 0;
292
+ if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), t) {
293
+ if (n.length > t) n.splice(t);
294
+ else for (; n.length < t;) n.push("");
295
+ }
296
+ for (; r < n.length; r++) n[r] = n[r].trim().replace(b.slashPipe, "|");
297
+ return n;
298
+ }
299
+ function I(e, t, n) {
300
+ let r = e.length;
301
+ if (r === 0) return "";
302
+ let i = 0;
303
+ for (; i < r;) {
304
+ let a = e.charAt(r - i - 1);
305
+ if (a === t && !n) i++;
306
+ else if (a !== t && n) i++;
307
+ else break;
308
+ }
309
+ return e.slice(0, r - i);
310
+ }
311
+ function Xe(e, t) {
312
+ if (e.indexOf(t[1]) === -1) return -1;
313
+ let n = 0;
314
+ for (let r = 0; r < e.length; r++) if (e[r] === "\\") r++;
315
+ else if (e[r] === t[0]) n++;
316
+ else if (e[r] === t[1] && (n--, n < 0)) return r;
317
+ return n > 0 ? -2 : -1;
318
+ }
319
+ function Ze(e, t, n, r, i) {
320
+ let a = t.href, o = t.title || null, s = e[1].replace(i.other.outputLinkReplace, "$1");
321
+ r.state.inLink = !0;
322
+ let c = {
323
+ type: e[0].charAt(0) === "!" ? "image" : "link",
324
+ raw: n,
325
+ href: a,
326
+ title: o,
327
+ text: s,
328
+ tokens: r.inlineTokens(s)
329
+ };
330
+ return r.state.inLink = !1, c;
331
+ }
332
+ function Qe(e, t, n) {
333
+ let r = e.match(n.other.indentCodeCompensation);
334
+ if (r === null) return t;
335
+ let i = r[1];
336
+ return t.split("\n").map((e) => {
337
+ let t = e.match(n.other.beginningSpace);
338
+ if (t === null) return e;
339
+ let [r] = t;
340
+ return r.length >= i.length ? e.slice(i.length) : e;
341
+ }).join("\n");
342
+ }
343
+ var L = class {
344
+ options;
345
+ rules;
346
+ lexer;
347
+ constructor(e) {
348
+ this.options = e || _;
349
+ }
350
+ space(e) {
351
+ let t = this.rules.block.newline.exec(e);
352
+ if (t && t[0].length > 0) return {
353
+ type: "space",
354
+ raw: t[0]
355
+ };
356
+ }
357
+ code(e) {
358
+ let t = this.rules.block.code.exec(e);
359
+ if (t) {
360
+ let e = t[0].replace(this.rules.other.codeRemoveIndent, "");
361
+ return {
362
+ type: "code",
363
+ raw: t[0],
364
+ codeBlockStyle: "indented",
365
+ text: this.options.pedantic ? e : I(e, "\n")
366
+ };
367
+ }
368
+ }
369
+ fences(e) {
370
+ let t = this.rules.block.fences.exec(e);
371
+ if (t) {
372
+ let e = t[0], n = Qe(e, t[3] || "", this.rules);
373
+ return {
374
+ type: "code",
375
+ raw: e,
376
+ lang: t[2] ? t[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t[2],
377
+ text: n
378
+ };
379
+ }
380
+ }
381
+ heading(e) {
382
+ let t = this.rules.block.heading.exec(e);
383
+ if (t) {
384
+ let e = t[2].trim();
385
+ if (this.rules.other.endingHash.test(e)) {
386
+ let t = I(e, "#");
387
+ (this.options.pedantic || !t || this.rules.other.endingSpaceChar.test(t)) && (e = t.trim());
388
+ }
389
+ return {
390
+ type: "heading",
391
+ raw: t[0],
392
+ depth: t[1].length,
393
+ text: e,
394
+ tokens: this.lexer.inline(e)
395
+ };
396
+ }
397
+ }
398
+ hr(e) {
399
+ let t = this.rules.block.hr.exec(e);
400
+ if (t) return {
401
+ type: "hr",
402
+ raw: I(t[0], "\n")
403
+ };
404
+ }
405
+ blockquote(e) {
406
+ let t = this.rules.block.blockquote.exec(e);
407
+ if (t) {
408
+ let e = I(t[0], "\n").split("\n"), n = "", r = "", i = [];
409
+ for (; e.length > 0;) {
410
+ let t = !1, a = [], o = 0;
411
+ for (; o < e.length; o++) if (this.rules.other.blockquoteStart.test(e[o])) a.push(e[o]), t = !0;
412
+ else if (!t) a.push(e[o]);
413
+ else break;
414
+ e = e.slice(o);
415
+ let s = a.join("\n"), c = s.replace(this.rules.other.blockquoteSetextReplace, "\n $1").replace(this.rules.other.blockquoteSetextReplace2, "");
416
+ n = n ? `${n}
417
+ ${s}` : s, r = r ? `${r}
418
+ ${c}` : c;
419
+ let l = this.lexer.state.top;
420
+ if (this.lexer.state.top = !0, this.lexer.blockTokens(c, i, !0), this.lexer.state.top = l, e.length === 0) break;
421
+ let u = i.at(-1);
422
+ if (u?.type === "code") break;
423
+ if (u?.type === "blockquote") {
424
+ let t = u, a = t.raw + "\n" + e.join("\n"), o = this.blockquote(a);
425
+ i[i.length - 1] = o, n = n.substring(0, n.length - t.raw.length) + o.raw, r = r.substring(0, r.length - t.text.length) + o.text;
426
+ break;
427
+ }
428
+ if (u?.type === "list") {
429
+ let t = u, a = t.raw + "\n" + e.join("\n"), o = this.list(a);
430
+ i[i.length - 1] = o, n = n.substring(0, n.length - u.raw.length) + o.raw, r = r.substring(0, r.length - t.raw.length) + o.raw, e = a.substring(i.at(-1).raw.length).split("\n");
431
+ }
432
+ }
433
+ return {
434
+ type: "blockquote",
435
+ raw: n,
436
+ tokens: i,
437
+ text: r
438
+ };
439
+ }
440
+ }
441
+ list(e) {
442
+ let t = this.rules.block.list.exec(e);
443
+ if (t) {
444
+ let n = t[1].trim(), r = n.length > 1, i = {
445
+ type: "list",
446
+ raw: "",
447
+ ordered: r,
448
+ start: r ? +n.slice(0, -1) : "",
449
+ loose: !1,
450
+ items: []
451
+ };
452
+ n = r ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = r ? n : "[*+-]");
453
+ let a = this.rules.other.listItemRegex(n), o = !1;
454
+ for (; e;) {
455
+ let n = !1, r = "", s = "";
456
+ if (!(t = a.exec(e)) || this.rules.block.hr.test(e)) break;
457
+ r = t[0], e = e.substring(r.length);
458
+ let c = t[2].split("\n", 1)[0].replace(this.rules.other.listReplaceTabs, (e) => " ".repeat(3 * e.length)), l = e.split("\n", 1)[0], u = !c.trim(), d = 0;
459
+ if (this.options.pedantic ? (d = 2, s = c.trimStart()) : u ? d = t[1].length + 1 : (d = t[2].search(this.rules.other.nonSpaceChar), d = d > 4 ? 1 : d, s = c.slice(d), d += t[1].length), u && this.rules.other.blankLine.test(l) && (r += l + "\n", e = e.substring(l.length + 1), n = !0), !n) {
460
+ let t = this.rules.other.nextBulletRegex(d), n = this.rules.other.hrRegex(d), i = this.rules.other.fencesBeginRegex(d), a = this.rules.other.headingBeginRegex(d), o = this.rules.other.htmlBeginRegex(d);
461
+ for (; e;) {
462
+ let f = e.split("\n", 1)[0], p;
463
+ if (l = f, this.options.pedantic ? (l = l.replace(this.rules.other.listReplaceNesting, " "), p = l) : p = l.replace(this.rules.other.tabCharGlobal, " "), i.test(l) || a.test(l) || o.test(l) || t.test(l) || n.test(l)) break;
464
+ if (p.search(this.rules.other.nonSpaceChar) >= d || !l.trim()) s += "\n" + p.slice(d);
465
+ else {
466
+ if (u || c.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || i.test(c) || a.test(c) || n.test(c)) break;
467
+ s += "\n" + l;
468
+ }
469
+ !u && !l.trim() && (u = !0), r += f + "\n", e = e.substring(f.length + 1), c = p.slice(d);
470
+ }
471
+ }
472
+ i.loose || (o ? i.loose = !0 : this.rules.other.doubleBlankLine.test(r) && (o = !0));
473
+ let f = null, p;
474
+ this.options.gfm && (f = this.rules.other.listIsTask.exec(s), f && (p = f[0] !== "[ ] ", s = s.replace(this.rules.other.listReplaceTask, ""))), i.items.push({
475
+ type: "list_item",
476
+ raw: r,
477
+ task: !!f,
478
+ checked: p,
479
+ loose: !1,
480
+ text: s,
481
+ tokens: []
482
+ }), i.raw += r;
483
+ }
484
+ let s = i.items.at(-1);
485
+ if (s) s.raw = s.raw.trimEnd(), s.text = s.text.trimEnd();
486
+ else return;
487
+ i.raw = i.raw.trimEnd();
488
+ for (let e = 0; e < i.items.length; e++) if (this.lexer.state.top = !1, i.items[e].tokens = this.lexer.blockTokens(i.items[e].text, []), !i.loose) {
489
+ let t = i.items[e].tokens.filter((e) => e.type === "space");
490
+ i.loose = t.length > 0 && t.some((e) => this.rules.other.anyLine.test(e.raw));
491
+ }
492
+ if (i.loose) for (let e = 0; e < i.items.length; e++) i.items[e].loose = !0;
493
+ return i;
494
+ }
495
+ }
496
+ html(e) {
497
+ let t = this.rules.block.html.exec(e);
498
+ if (t) return {
499
+ type: "html",
500
+ block: !0,
501
+ raw: t[0],
502
+ pre: t[1] === "pre" || t[1] === "script" || t[1] === "style",
503
+ text: t[0]
504
+ };
505
+ }
506
+ def(e) {
507
+ let t = this.rules.block.def.exec(e);
508
+ if (t) {
509
+ let e = t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "), n = t[2] ? t[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", r = t[3] ? t[3].substring(1, t[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : t[3];
510
+ return {
511
+ type: "def",
512
+ tag: e,
513
+ raw: t[0],
514
+ href: n,
515
+ title: r
516
+ };
517
+ }
518
+ }
519
+ table(e) {
520
+ let t = this.rules.block.table.exec(e);
521
+ if (!t || !this.rules.other.tableDelimiter.test(t[2])) return;
522
+ let n = Ye(t[1]), r = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), i = t[3]?.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split("\n") : [], a = {
523
+ type: "table",
524
+ raw: t[0],
525
+ header: [],
526
+ align: [],
527
+ rows: []
528
+ };
529
+ if (n.length === r.length) {
530
+ for (let e of r) this.rules.other.tableAlignRight.test(e) ? a.align.push("right") : this.rules.other.tableAlignCenter.test(e) ? a.align.push("center") : this.rules.other.tableAlignLeft.test(e) ? a.align.push("left") : a.align.push(null);
531
+ for (let e = 0; e < n.length; e++) a.header.push({
532
+ text: n[e],
533
+ tokens: this.lexer.inline(n[e]),
534
+ header: !0,
535
+ align: a.align[e]
536
+ });
537
+ for (let e of i) a.rows.push(Ye(e, a.header.length).map((e, t) => ({
538
+ text: e,
539
+ tokens: this.lexer.inline(e),
540
+ header: !1,
541
+ align: a.align[t]
542
+ })));
543
+ return a;
544
+ }
545
+ }
546
+ lheading(e) {
547
+ let t = this.rules.block.lheading.exec(e);
548
+ if (t) return {
549
+ type: "heading",
550
+ raw: t[0],
551
+ depth: t[2].charAt(0) === "=" ? 1 : 2,
552
+ text: t[1],
553
+ tokens: this.lexer.inline(t[1])
554
+ };
555
+ }
556
+ paragraph(e) {
557
+ let t = this.rules.block.paragraph.exec(e);
558
+ if (t) {
559
+ let e = t[1].charAt(t[1].length - 1) === "\n" ? t[1].slice(0, -1) : t[1];
560
+ return {
561
+ type: "paragraph",
562
+ raw: t[0],
563
+ text: e,
564
+ tokens: this.lexer.inline(e)
565
+ };
566
+ }
567
+ }
568
+ text(e) {
569
+ let t = this.rules.block.text.exec(e);
570
+ if (t) return {
571
+ type: "text",
572
+ raw: t[0],
573
+ text: t[0],
574
+ tokens: this.lexer.inline(t[0])
575
+ };
576
+ }
577
+ escape(e) {
578
+ let t = this.rules.inline.escape.exec(e);
579
+ if (t) return {
580
+ type: "escape",
581
+ raw: t[0],
582
+ text: t[1]
583
+ };
584
+ }
585
+ tag(e) {
586
+ let t = this.rules.inline.tag.exec(e);
587
+ 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), {
588
+ type: "html",
589
+ raw: t[0],
590
+ inLink: this.lexer.state.inLink,
591
+ inRawBlock: this.lexer.state.inRawBlock,
592
+ block: !1,
593
+ text: t[0]
594
+ };
595
+ }
596
+ link(e) {
597
+ let t = this.rules.inline.link.exec(e);
598
+ if (t) {
599
+ let e = t[2].trim();
600
+ if (!this.options.pedantic && this.rules.other.startAngleBracket.test(e)) {
601
+ if (!this.rules.other.endAngleBracket.test(e)) return;
602
+ let t = I(e.slice(0, -1), "\\");
603
+ if ((e.length - t.length) % 2 == 0) return;
604
+ } else {
605
+ let e = Xe(t[2], "()");
606
+ if (e === -2) return;
607
+ if (e > -1) {
608
+ let n = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + e;
609
+ t[2] = t[2].substring(0, e), t[0] = t[0].substring(0, n).trim(), t[3] = "";
610
+ }
611
+ }
612
+ let n = t[2], r = "";
613
+ if (this.options.pedantic) {
614
+ let e = this.rules.other.pedanticHrefTitle.exec(n);
615
+ e && (n = e[1], r = e[3]);
616
+ } else r = t[3] ? t[3].slice(1, -1) : "";
617
+ return n = n.trim(), this.rules.other.startAngleBracket.test(n) && (n = this.options.pedantic && !this.rules.other.endAngleBracket.test(e) ? n.slice(1) : n.slice(1, -1)), Ze(t, {
618
+ href: n && n.replace(this.rules.inline.anyPunctuation, "$1"),
619
+ title: r && r.replace(this.rules.inline.anyPunctuation, "$1")
620
+ }, t[0], this.lexer, this.rules);
621
+ }
622
+ }
623
+ reflink(e, t) {
624
+ let n;
625
+ if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) {
626
+ let e = t[(n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " ").toLowerCase()];
627
+ if (!e) {
628
+ let e = n[0].charAt(0);
629
+ return {
630
+ type: "text",
631
+ raw: e,
632
+ text: e
633
+ };
634
+ }
635
+ return Ze(n, e, n[0], this.lexer, this.rules);
636
+ }
637
+ }
638
+ emStrong(e, t, n = "") {
639
+ let r = this.rules.inline.emStrongLDelim.exec(e);
640
+ if (!(!r || r[3] && n.match(this.rules.other.unicodeAlphaNumeric)) && (!(r[1] || r[2]) || !n || this.rules.inline.punctuation.exec(n))) {
641
+ let n = [...r[0]].length - 1, i, a, o = n, s = 0, c = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
642
+ for (c.lastIndex = 0, t = t.slice(-1 * e.length + n); (r = c.exec(t)) != null;) {
643
+ if (i = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !i) continue;
644
+ if (a = [...i].length, r[3] || r[4]) {
645
+ o += a;
646
+ continue;
647
+ }
648
+ if ((r[5] || r[6]) && n % 3 && !((n + a) % 3)) {
649
+ s += a;
650
+ continue;
651
+ }
652
+ if (o -= a, o > 0) continue;
653
+ a = Math.min(a, a + o + s);
654
+ let t = [...r[0]][0].length, c = e.slice(0, n + r.index + t + a);
655
+ if (Math.min(n, a) % 2) {
656
+ let e = c.slice(1, -1);
657
+ return {
658
+ type: "em",
659
+ raw: c,
660
+ text: e,
661
+ tokens: this.lexer.inlineTokens(e)
662
+ };
663
+ }
664
+ let l = c.slice(2, -2);
665
+ return {
666
+ type: "strong",
667
+ raw: c,
668
+ text: l,
669
+ tokens: this.lexer.inlineTokens(l)
670
+ };
671
+ }
672
+ }
673
+ }
674
+ codespan(e) {
675
+ let t = this.rules.inline.code.exec(e);
676
+ if (t) {
677
+ let e = t[2].replace(this.rules.other.newLineCharGlobal, " "), n = this.rules.other.nonSpaceChar.test(e), r = this.rules.other.startingSpaceChar.test(e) && this.rules.other.endingSpaceChar.test(e);
678
+ return n && r && (e = e.substring(1, e.length - 1)), {
679
+ type: "codespan",
680
+ raw: t[0],
681
+ text: e
682
+ };
683
+ }
684
+ }
685
+ br(e) {
686
+ let t = this.rules.inline.br.exec(e);
687
+ if (t) return {
688
+ type: "br",
689
+ raw: t[0]
690
+ };
691
+ }
692
+ del(e) {
693
+ let t = this.rules.inline.del.exec(e);
694
+ if (t) return {
695
+ type: "del",
696
+ raw: t[0],
697
+ text: t[2],
698
+ tokens: this.lexer.inlineTokens(t[2])
699
+ };
700
+ }
701
+ autolink(e) {
702
+ let t = this.rules.inline.autolink.exec(e);
703
+ if (t) {
704
+ let e, n;
705
+ return t[2] === "@" ? (e = t[1], n = "mailto:" + e) : (e = t[1], n = e), {
706
+ type: "link",
707
+ raw: t[0],
708
+ text: e,
709
+ href: n,
710
+ tokens: [{
711
+ type: "text",
712
+ raw: e,
713
+ text: e
714
+ }]
715
+ };
716
+ }
717
+ }
718
+ url(e) {
719
+ let t;
720
+ if (t = this.rules.inline.url.exec(e)) {
721
+ let e, n;
722
+ if (t[2] === "@") e = t[0], n = "mailto:" + e;
723
+ else {
724
+ let r;
725
+ do
726
+ r = t[0], t[0] = this.rules.inline._backpedal.exec(t[0])?.[0] ?? "";
727
+ while (r !== t[0]);
728
+ e = t[0], n = t[1] === "www." ? "http://" + t[0] : t[0];
729
+ }
730
+ return {
731
+ type: "link",
732
+ raw: t[0],
733
+ text: e,
734
+ href: n,
735
+ tokens: [{
736
+ type: "text",
737
+ raw: e,
738
+ text: e
739
+ }]
740
+ };
741
+ }
742
+ }
743
+ inlineText(e) {
744
+ let t = this.rules.inline.text.exec(e);
745
+ if (t) {
746
+ let e = this.lexer.state.inRawBlock;
747
+ return {
748
+ type: "text",
749
+ raw: t[0],
750
+ text: t[0],
751
+ escaped: e
752
+ };
753
+ }
754
+ }
755
+ }, R = class e {
756
+ tokens;
757
+ options;
758
+ state;
759
+ tokenizer;
760
+ inlineQueue;
761
+ constructor(e) {
762
+ this.tokens = [], this.tokens.links = Object.create(null), this.options = e || _, this.options.tokenizer = this.options.tokenizer || new L(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
763
+ inLink: !1,
764
+ inRawBlock: !1,
765
+ top: !0
766
+ };
767
+ let t = {
768
+ other: b,
769
+ block: N.normal,
770
+ inline: P.normal
771
+ };
772
+ this.options.pedantic ? (t.block = N.pedantic, t.inline = P.pedantic) : this.options.gfm && (t.block = N.gfm, t.inline = this.options.breaks ? P.breaks : P.gfm), this.tokenizer.rules = t;
773
+ }
774
+ static get rules() {
775
+ return {
776
+ block: N,
777
+ inline: P
778
+ };
779
+ }
780
+ static lex(t, n) {
781
+ return new e(n).lex(t);
782
+ }
783
+ static lexInline(t, n) {
784
+ return new e(n).inlineTokens(t);
785
+ }
786
+ lex(e) {
787
+ e = e.replace(b.carriageReturn, "\n"), this.blockTokens(e, this.tokens);
788
+ for (let e = 0; e < this.inlineQueue.length; e++) {
789
+ let t = this.inlineQueue[e];
790
+ this.inlineTokens(t.src, t.tokens);
791
+ }
792
+ return this.inlineQueue = [], this.tokens;
793
+ }
794
+ blockTokens(e, t = [], n = !1) {
795
+ for (this.options.pedantic && (e = e.replace(b.tabCharGlobal, " ").replace(b.spaceLine, "")); e;) {
796
+ let r;
797
+ if (this.options.extensions?.block?.some((n) => (r = n.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 n = t.at(-1);
801
+ r.raw.length === 1 && n !== void 0 ? n.raw += "\n" : t.push(r);
802
+ continue;
803
+ }
804
+ if (r = this.tokenizer.code(e)) {
805
+ e = e.substring(r.raw.length);
806
+ let n = t.at(-1);
807
+ n?.type === "paragraph" || n?.type === "text" ? (n.raw += (n.raw.endsWith("\n") ? "" : "\n") + r.raw, n.text += "\n" + r.text, this.inlineQueue.at(-1).src = n.text) : t.push(r);
808
+ continue;
809
+ }
810
+ if ((r = this.tokenizer.fences(e)) || (r = this.tokenizer.heading(e)) || (r = this.tokenizer.hr(e)) || (r = this.tokenizer.blockquote(e)) || (r = this.tokenizer.list(e)) || (r = this.tokenizer.html(e))) {
811
+ e = e.substring(r.raw.length), t.push(r);
812
+ continue;
813
+ }
814
+ if (r = this.tokenizer.def(e)) {
815
+ e = e.substring(r.raw.length);
816
+ let n = t.at(-1);
817
+ n?.type === "paragraph" || n?.type === "text" ? (n.raw += (n.raw.endsWith("\n") ? "" : "\n") + r.raw, n.text += "\n" + r.raw, this.inlineQueue.at(-1).src = n.text) : this.tokens.links[r.tag] || (this.tokens.links[r.tag] = {
818
+ href: r.href,
819
+ title: r.title
820
+ }, t.push(r));
821
+ continue;
822
+ }
823
+ if ((r = this.tokenizer.table(e)) || (r = this.tokenizer.lheading(e))) {
824
+ e = e.substring(r.raw.length), t.push(r);
825
+ continue;
826
+ }
827
+ let i = e;
828
+ if (this.options.extensions?.startBlock) {
829
+ let t = 1 / 0, n = e.slice(1), r;
830
+ this.options.extensions.startBlock.forEach((e) => {
831
+ r = e.call({ lexer: this }, n), typeof r == "number" && r >= 0 && (t = Math.min(t, r));
832
+ }), t < 1 / 0 && t >= 0 && (i = e.substring(0, t + 1));
833
+ }
834
+ if (this.state.top && (r = this.tokenizer.paragraph(i))) {
835
+ let a = t.at(-1);
836
+ n && a?.type === "paragraph" ? (a.raw += (a.raw.endsWith("\n") ? "" : "\n") + r.raw, a.text += "\n" + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = a.text) : t.push(r), n = i.length !== e.length, e = e.substring(r.raw.length);
837
+ } else if (r = this.tokenizer.text(e)) {
838
+ e = e.substring(r.raw.length);
839
+ let n = t.at(-1);
840
+ n?.type === "text" ? (n.raw += (n.raw.endsWith("\n") ? "" : "\n") + r.raw, n.text += "\n" + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = n.text) : t.push(r);
841
+ } else if (e) {
842
+ let t = "Infinite loop on byte: " + e.charCodeAt(0);
843
+ if (this.options.silent) {
844
+ console.error(t);
845
+ break;
846
+ }
847
+ throw Error(t);
848
+ }
849
+ }
850
+ return this.state.top = !0, t;
851
+ }
852
+ inline(e, t = []) {
853
+ return this.inlineQueue.push({
854
+ src: e,
855
+ tokens: t
856
+ }), t;
857
+ }
858
+ inlineTokens(e, t = []) {
859
+ let n = e, r = null;
860
+ if (this.tokens.links) {
861
+ let e = Object.keys(this.tokens.links);
862
+ if (e.length > 0) for (; (r = this.tokenizer.rules.inline.reflinkSearch.exec(n)) != null;) e.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));
863
+ }
864
+ for (; (r = this.tokenizer.rules.inline.anyPunctuation.exec(n)) != null;) n = n.slice(0, r.index) + "++" + n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
865
+ let i;
866
+ 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);
867
+ n = this.options.hooks?.emStrongMask?.call({ lexer: this }, n) ?? n;
868
+ let a = !1, o = "";
869
+ for (; e;) {
870
+ a || (o = ""), a = !1;
871
+ let r;
872
+ if (this.options.extensions?.inline?.some((n) => (r = n.call({ lexer: this }, e, t)) ? (e = e.substring(r.raw.length), t.push(r), !0) : !1)) continue;
873
+ if ((r = this.tokenizer.escape(e)) || (r = this.tokenizer.tag(e)) || (r = this.tokenizer.link(e))) {
874
+ e = e.substring(r.raw.length), t.push(r);
875
+ continue;
876
+ }
877
+ if (r = this.tokenizer.reflink(e, this.tokens.links)) {
878
+ e = e.substring(r.raw.length);
879
+ let n = t.at(-1);
880
+ r.type === "text" && n?.type === "text" ? (n.raw += r.raw, n.text += r.text) : t.push(r);
881
+ continue;
882
+ }
883
+ if ((r = this.tokenizer.emStrong(e, n, o)) || (r = this.tokenizer.codespan(e)) || (r = this.tokenizer.br(e)) || (r = this.tokenizer.del(e)) || (r = this.tokenizer.autolink(e)) || !this.state.inLink && (r = this.tokenizer.url(e))) {
884
+ e = e.substring(r.raw.length), t.push(r);
885
+ continue;
886
+ }
887
+ let i = e;
888
+ if (this.options.extensions?.startInline) {
889
+ let t = 1 / 0, n = e.slice(1), r;
890
+ this.options.extensions.startInline.forEach((e) => {
891
+ r = e.call({ lexer: this }, n), typeof r == "number" && r >= 0 && (t = Math.min(t, r));
892
+ }), t < 1 / 0 && t >= 0 && (i = e.substring(0, t + 1));
893
+ }
894
+ if (r = this.tokenizer.inlineText(i)) {
895
+ e = e.substring(r.raw.length), r.raw.slice(-1) !== "_" && (o = r.raw.slice(-1)), a = !0;
896
+ let n = t.at(-1);
897
+ n?.type === "text" ? (n.raw += r.raw, n.text += r.text) : t.push(r);
898
+ } else if (e) {
899
+ let t = "Infinite loop on byte: " + e.charCodeAt(0);
900
+ if (this.options.silent) {
901
+ console.error(t);
902
+ break;
903
+ }
904
+ throw Error(t);
905
+ }
906
+ }
907
+ return t;
908
+ }
909
+ }, z = class {
910
+ options;
911
+ parser;
912
+ constructor(e) {
913
+ this.options = e || _;
914
+ }
915
+ space(e) {
916
+ return "";
917
+ }
918
+ code({ text: e, lang: t, escaped: n }) {
919
+ let r = (t || "").match(b.notSpaceStart)?.[0], i = e.replace(b.endingNewline, "") + "\n";
920
+ return r ? "<pre><code class=\"language-" + F(r) + "\">" + (n ? i : F(i, !0)) + "</code></pre>\n" : "<pre><code>" + (n ? i : F(i, !0)) + "</code></pre>\n";
921
+ }
922
+ blockquote({ tokens: e }) {
923
+ return `<blockquote>
924
+ ${this.parser.parse(e)}</blockquote>
925
+ `;
926
+ }
927
+ html({ text: e }) {
928
+ return e;
929
+ }
930
+ def(e) {
931
+ return "";
932
+ }
933
+ heading({ tokens: e, depth: t }) {
934
+ return `<h${t}>${this.parser.parseInline(e)}</h${t}>
935
+ `;
936
+ }
937
+ hr(e) {
938
+ return "<hr>\n";
939
+ }
940
+ list(e) {
941
+ let t = e.ordered, n = e.start, r = "";
942
+ for (let t = 0; t < e.items.length; t++) {
943
+ let n = e.items[t];
944
+ r += this.listitem(n);
945
+ }
946
+ let i = t ? "ol" : "ul", a = t && n !== 1 ? " start=\"" + n + "\"" : "";
947
+ return "<" + i + a + ">\n" + r + "</" + i + ">\n";
948
+ }
949
+ listitem(e) {
950
+ let t = "";
951
+ if (e.task) {
952
+ let n = this.checkbox({ checked: !!e.checked });
953
+ 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 + " " + F(e.tokens[0].tokens[0].text), e.tokens[0].tokens[0].escaped = !0)) : e.tokens.unshift({
954
+ type: "text",
955
+ raw: n + " ",
956
+ text: n + " ",
957
+ escaped: !0
958
+ }) : t += n + " ";
959
+ }
960
+ return t += this.parser.parse(e.tokens, !!e.loose), `<li>${t}</li>
961
+ `;
962
+ }
963
+ checkbox({ checked: e }) {
964
+ return "<input " + (e ? "checked=\"\" " : "") + "disabled=\"\" type=\"checkbox\">";
965
+ }
966
+ paragraph({ tokens: e }) {
967
+ return `<p>${this.parser.parseInline(e)}</p>
968
+ `;
969
+ }
970
+ table(e) {
971
+ let t = "", n = "";
972
+ for (let t = 0; t < e.header.length; t++) n += this.tablecell(e.header[t]);
973
+ t += this.tablerow({ text: n });
974
+ let r = "";
975
+ for (let t = 0; t < e.rows.length; t++) {
976
+ let i = e.rows[t];
977
+ n = "";
978
+ for (let e = 0; e < i.length; e++) n += this.tablecell(i[e]);
979
+ r += this.tablerow({ text: n });
980
+ }
981
+ return r &&= `<tbody>${r}</tbody>`, "<table>\n<thead>\n" + t + "</thead>\n" + r + "</table>\n";
982
+ }
983
+ tablerow({ text: e }) {
984
+ return `<tr>
985
+ ${e}</tr>
986
+ `;
987
+ }
988
+ tablecell(e) {
989
+ let t = this.parser.parseInline(e.tokens), n = e.header ? "th" : "td";
990
+ return (e.align ? `<${n} align="${e.align}">` : `<${n}>`) + t + `</${n}>
991
+ `;
992
+ }
993
+ strong({ tokens: e }) {
994
+ return `<strong>${this.parser.parseInline(e)}</strong>`;
995
+ }
996
+ em({ tokens: e }) {
997
+ return `<em>${this.parser.parseInline(e)}</em>`;
998
+ }
999
+ codespan({ text: e }) {
1000
+ return `<code>${F(e, !0)}</code>`;
1001
+ }
1002
+ br(e) {
1003
+ return "<br>";
1004
+ }
1005
+ del({ tokens: e }) {
1006
+ return `<del>${this.parser.parseInline(e)}</del>`;
1007
+ }
1008
+ link({ href: e, title: t, tokens: n }) {
1009
+ let r = this.parser.parseInline(n), i = Je(e);
1010
+ if (i === null) return r;
1011
+ e = i;
1012
+ let a = "<a href=\"" + e + "\"";
1013
+ return t && (a += " title=\"" + F(t) + "\""), a += ">" + r + "</a>", a;
1014
+ }
1015
+ image({ href: e, title: t, text: n, tokens: r }) {
1016
+ r && (n = this.parser.parseInline(r, this.parser.textRenderer));
1017
+ let i = Je(e);
1018
+ if (i === null) return F(n);
1019
+ e = i;
1020
+ let a = `<img src="${e}" alt="${n}"`;
1021
+ return t && (a += ` title="${F(t)}"`), a += ">", a;
1022
+ }
1023
+ text(e) {
1024
+ return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : F(e.text);
1025
+ }
1026
+ }, B = class {
1027
+ strong({ text: e }) {
1028
+ return e;
1029
+ }
1030
+ em({ text: e }) {
1031
+ return e;
1032
+ }
1033
+ codespan({ text: e }) {
1034
+ return e;
1035
+ }
1036
+ del({ text: e }) {
1037
+ return e;
1038
+ }
1039
+ html({ text: e }) {
1040
+ return e;
1041
+ }
1042
+ text({ text: e }) {
1043
+ return e;
1044
+ }
1045
+ link({ text: e }) {
1046
+ return "" + e;
1047
+ }
1048
+ image({ text: e }) {
1049
+ return "" + e;
1050
+ }
1051
+ br() {
1052
+ return "";
1053
+ }
1054
+ }, V = class e {
1055
+ options;
1056
+ renderer;
1057
+ textRenderer;
1058
+ constructor(e) {
1059
+ this.options = e || _, this.options.renderer = this.options.renderer || new z(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new B();
1060
+ }
1061
+ static parse(t, n) {
1062
+ return new e(n).parse(t);
1063
+ }
1064
+ static parseInline(t, n) {
1065
+ return new e(n).parseInline(t);
1066
+ }
1067
+ parse(e, t = !0) {
1068
+ let n = "";
1069
+ for (let r = 0; r < e.length; r++) {
1070
+ let i = e[r];
1071
+ if (this.options.extensions?.renderers?.[i.type]) {
1072
+ let e = i, t = this.options.extensions.renderers[e.type].call({ parser: this }, e);
1073
+ if (t !== !1 || ![
1074
+ "space",
1075
+ "hr",
1076
+ "heading",
1077
+ "code",
1078
+ "table",
1079
+ "blockquote",
1080
+ "list",
1081
+ "html",
1082
+ "def",
1083
+ "paragraph",
1084
+ "text"
1085
+ ].includes(e.type)) {
1086
+ n += t || "";
1087
+ continue;
1088
+ }
1089
+ }
1090
+ let a = i;
1091
+ switch (a.type) {
1092
+ case "space":
1093
+ n += this.renderer.space(a);
1094
+ continue;
1095
+ case "hr":
1096
+ n += this.renderer.hr(a);
1097
+ continue;
1098
+ case "heading":
1099
+ n += this.renderer.heading(a);
1100
+ continue;
1101
+ case "code":
1102
+ n += this.renderer.code(a);
1103
+ continue;
1104
+ case "table":
1105
+ n += this.renderer.table(a);
1106
+ continue;
1107
+ case "blockquote":
1108
+ n += this.renderer.blockquote(a);
1109
+ continue;
1110
+ case "list":
1111
+ n += this.renderer.list(a);
1112
+ continue;
1113
+ case "html":
1114
+ n += this.renderer.html(a);
1115
+ continue;
1116
+ case "def":
1117
+ n += this.renderer.def(a);
1118
+ continue;
1119
+ case "paragraph":
1120
+ n += this.renderer.paragraph(a);
1121
+ continue;
1122
+ case "text": {
1123
+ let i = a, o = this.renderer.text(i);
1124
+ for (; r + 1 < e.length && e[r + 1].type === "text";) i = e[++r], o += "\n" + this.renderer.text(i);
1125
+ n += t ? this.renderer.paragraph({
1126
+ type: "paragraph",
1127
+ raw: o,
1128
+ text: o,
1129
+ tokens: [{
1130
+ type: "text",
1131
+ raw: o,
1132
+ text: o,
1133
+ escaped: !0
1134
+ }]
1135
+ }) : o;
1136
+ continue;
1137
+ }
1138
+ default: {
1139
+ let e = "Token with \"" + a.type + "\" type was not found.";
1140
+ if (this.options.silent) return console.error(e), "";
1141
+ throw Error(e);
1142
+ }
1143
+ }
1144
+ }
1145
+ return n;
1146
+ }
1147
+ parseInline(e, t = this.renderer) {
1148
+ let n = "";
1149
+ for (let r = 0; r < e.length; r++) {
1150
+ let i = e[r];
1151
+ if (this.options.extensions?.renderers?.[i.type]) {
1152
+ let e = this.options.extensions.renderers[i.type].call({ parser: this }, i);
1153
+ if (e !== !1 || ![
1154
+ "escape",
1155
+ "html",
1156
+ "link",
1157
+ "image",
1158
+ "strong",
1159
+ "em",
1160
+ "codespan",
1161
+ "br",
1162
+ "del",
1163
+ "text"
1164
+ ].includes(i.type)) {
1165
+ n += e || "";
1166
+ continue;
1167
+ }
1168
+ }
1169
+ let a = i;
1170
+ switch (a.type) {
1171
+ case "escape":
1172
+ n += t.text(a);
1173
+ break;
1174
+ case "html":
1175
+ n += t.html(a);
1176
+ break;
1177
+ case "link":
1178
+ n += t.link(a);
1179
+ break;
1180
+ case "image":
1181
+ n += t.image(a);
1182
+ break;
1183
+ case "strong":
1184
+ n += t.strong(a);
1185
+ break;
1186
+ case "em":
1187
+ n += t.em(a);
1188
+ break;
1189
+ case "codespan":
1190
+ n += t.codespan(a);
1191
+ break;
1192
+ case "br":
1193
+ n += t.br(a);
1194
+ break;
1195
+ case "del":
1196
+ n += t.del(a);
1197
+ break;
1198
+ case "text":
1199
+ n += t.text(a);
1200
+ break;
1201
+ default: {
1202
+ let e = "Token with \"" + a.type + "\" type was not found.";
1203
+ if (this.options.silent) return console.error(e), "";
1204
+ throw Error(e);
1205
+ }
1206
+ }
1207
+ }
1208
+ return n;
1209
+ }
1210
+ }, H = class {
1211
+ options;
1212
+ block;
1213
+ constructor(e) {
1214
+ this.options = e || _;
1215
+ }
1216
+ static passThroughHooks = /* @__PURE__ */ new Set([
1217
+ "preprocess",
1218
+ "postprocess",
1219
+ "processAllTokens",
1220
+ "emStrongMask"
1221
+ ]);
1222
+ static passThroughHooksRespectAsync = /* @__PURE__ */ new Set([
1223
+ "preprocess",
1224
+ "postprocess",
1225
+ "processAllTokens"
1226
+ ]);
1227
+ preprocess(e) {
1228
+ return e;
1229
+ }
1230
+ postprocess(e) {
1231
+ return e;
1232
+ }
1233
+ processAllTokens(e) {
1234
+ return e;
1235
+ }
1236
+ emStrongMask(e) {
1237
+ return e;
1238
+ }
1239
+ provideLexer() {
1240
+ return this.block ? R.lex : R.lexInline;
1241
+ }
1242
+ provideParser() {
1243
+ return this.block ? V.parse : V.parseInline;
1244
+ }
1245
+ }, U = new class {
1246
+ defaults = g();
1247
+ options = this.setOptions;
1248
+ parse = this.parseMarkdown(!0);
1249
+ parseInline = this.parseMarkdown(!1);
1250
+ Parser = V;
1251
+ Renderer = z;
1252
+ TextRenderer = B;
1253
+ Lexer = R;
1254
+ Tokenizer = L;
1255
+ Hooks = H;
1256
+ constructor(...e) {
1257
+ this.use(...e);
1258
+ }
1259
+ walkTokens(e, t) {
1260
+ let n = [];
1261
+ for (let r of e) switch (n = n.concat(t.call(this, r)), r.type) {
1262
+ case "table": {
1263
+ let e = r;
1264
+ for (let r of e.header) n = n.concat(this.walkTokens(r.tokens, t));
1265
+ for (let r of e.rows) for (let e of r) n = n.concat(this.walkTokens(e.tokens, t));
1266
+ break;
1267
+ }
1268
+ case "list": {
1269
+ let e = r;
1270
+ n = n.concat(this.walkTokens(e.items, t));
1271
+ break;
1272
+ }
1273
+ default: {
1274
+ let e = r;
1275
+ this.defaults.extensions?.childTokens?.[e.type] ? this.defaults.extensions.childTokens[e.type].forEach((r) => {
1276
+ let i = e[r].flat(1 / 0);
1277
+ n = n.concat(this.walkTokens(i, t));
1278
+ }) : e.tokens && (n = n.concat(this.walkTokens(e.tokens, t)));
1279
+ }
1280
+ }
1281
+ return n;
1282
+ }
1283
+ use(...e) {
1284
+ let t = this.defaults.extensions || {
1285
+ renderers: {},
1286
+ childTokens: {}
1287
+ };
1288
+ return e.forEach((e) => {
1289
+ let n = { ...e };
1290
+ if (n.async = this.defaults.async || n.async || !1, e.extensions && (e.extensions.forEach((e) => {
1291
+ if (!e.name) throw Error("extension name required");
1292
+ if ("renderer" in e) {
1293
+ let n = t.renderers[e.name];
1294
+ n ? t.renderers[e.name] = function(...t) {
1295
+ let r = e.renderer.apply(this, t);
1296
+ return r === !1 && (r = n.apply(this, t)), r;
1297
+ } : t.renderers[e.name] = e.renderer;
1298
+ }
1299
+ if ("tokenizer" in e) {
1300
+ if (!e.level || e.level !== "block" && e.level !== "inline") throw Error("extension level must be 'block' or 'inline'");
1301
+ let n = t[e.level];
1302
+ n ? n.unshift(e.tokenizer) : t[e.level] = [e.tokenizer], e.start && (e.level === "block" ? t.startBlock ? t.startBlock.push(e.start) : t.startBlock = [e.start] : e.level === "inline" && (t.startInline ? t.startInline.push(e.start) : t.startInline = [e.start]));
1303
+ }
1304
+ "childTokens" in e && e.childTokens && (t.childTokens[e.name] = e.childTokens);
1305
+ }), n.extensions = t), e.renderer) {
1306
+ let t = this.defaults.renderer || new z(this.defaults);
1307
+ for (let n in e.renderer) {
1308
+ if (!(n in t)) throw Error(`renderer '${n}' does not exist`);
1309
+ if (["options", "parser"].includes(n)) continue;
1310
+ let r = n, i = e.renderer[r], a = t[r];
1311
+ t[r] = (...e) => {
1312
+ let n = i.apply(t, e);
1313
+ return n === !1 && (n = a.apply(t, e)), n || "";
1314
+ };
1315
+ }
1316
+ n.renderer = t;
1317
+ }
1318
+ if (e.tokenizer) {
1319
+ let t = this.defaults.tokenizer || new L(this.defaults);
1320
+ for (let n in e.tokenizer) {
1321
+ if (!(n in t)) throw Error(`tokenizer '${n}' does not exist`);
1322
+ if ([
1323
+ "options",
1324
+ "rules",
1325
+ "lexer"
1326
+ ].includes(n)) continue;
1327
+ let r = n, i = e.tokenizer[r], a = t[r];
1328
+ t[r] = (...e) => {
1329
+ let n = i.apply(t, e);
1330
+ return n === !1 && (n = a.apply(t, e)), n;
1331
+ };
1332
+ }
1333
+ n.tokenizer = t;
1334
+ }
1335
+ if (e.hooks) {
1336
+ let t = this.defaults.hooks || new H();
1337
+ for (let n in e.hooks) {
1338
+ if (!(n in t)) throw Error(`hook '${n}' does not exist`);
1339
+ if (["options", "block"].includes(n)) continue;
1340
+ let r = n, i = e.hooks[r], a = t[r];
1341
+ t[r] = H.passThroughHooks.has(n) ? (e) => {
1342
+ if (this.defaults.async && H.passThroughHooksRespectAsync.has(n)) return (async () => {
1343
+ let n = await i.call(t, e);
1344
+ return a.call(t, n);
1345
+ })();
1346
+ let r = i.call(t, e);
1347
+ return a.call(t, r);
1348
+ } : (...e) => {
1349
+ if (this.defaults.async) return (async () => {
1350
+ let n = await i.apply(t, e);
1351
+ return n === !1 && (n = await a.apply(t, e)), n;
1352
+ })();
1353
+ let n = i.apply(t, e);
1354
+ return n === !1 && (n = a.apply(t, e)), n;
1355
+ };
1356
+ }
1357
+ n.hooks = t;
1358
+ }
1359
+ if (e.walkTokens) {
1360
+ let t = this.defaults.walkTokens, r = e.walkTokens;
1361
+ n.walkTokens = function(e) {
1362
+ let n = [];
1363
+ return n.push(r.call(this, e)), t && (n = n.concat(t.call(this, e))), n;
1364
+ };
1365
+ }
1366
+ this.defaults = {
1367
+ ...this.defaults,
1368
+ ...n
1369
+ };
1370
+ }), this;
1371
+ }
1372
+ setOptions(e) {
1373
+ return this.defaults = {
1374
+ ...this.defaults,
1375
+ ...e
1376
+ }, this;
1377
+ }
1378
+ lexer(e, t) {
1379
+ return R.lex(e, t ?? this.defaults);
1380
+ }
1381
+ parser(e, t) {
1382
+ return V.parse(e, t ?? this.defaults);
1383
+ }
1384
+ parseMarkdown(e) {
1385
+ return (t, n) => {
1386
+ let r = { ...n }, i = {
1387
+ ...this.defaults,
1388
+ ...r
1389
+ }, a = this.onError(!!i.silent, !!i.async);
1390
+ if (this.defaults.async === !0 && r.async === !1) return a(/* @__PURE__ */ Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
1391
+ if (typeof t > "u" || t === null) return a(/* @__PURE__ */ Error("marked(): input parameter is undefined or null"));
1392
+ if (typeof t != "string") return a(/* @__PURE__ */ Error("marked(): input parameter is of type " + Object.prototype.toString.call(t) + ", string expected"));
1393
+ if (i.hooks && (i.hooks.options = i, i.hooks.block = e), i.async) return (async () => {
1394
+ let n = i.hooks ? await i.hooks.preprocess(t) : t, r = await (i.hooks ? await i.hooks.provideLexer() : e ? R.lex : R.lexInline)(n, i), a = i.hooks ? await i.hooks.processAllTokens(r) : r;
1395
+ i.walkTokens && await Promise.all(this.walkTokens(a, i.walkTokens));
1396
+ let o = await (i.hooks ? await i.hooks.provideParser() : e ? V.parse : V.parseInline)(a, i);
1397
+ return i.hooks ? await i.hooks.postprocess(o) : o;
1398
+ })().catch(a);
1399
+ try {
1400
+ i.hooks && (t = i.hooks.preprocess(t));
1401
+ let n = (i.hooks ? i.hooks.provideLexer() : e ? R.lex : R.lexInline)(t, i);
1402
+ i.hooks && (n = i.hooks.processAllTokens(n)), i.walkTokens && this.walkTokens(n, i.walkTokens);
1403
+ let r = (i.hooks ? i.hooks.provideParser() : e ? V.parse : V.parseInline)(n, i);
1404
+ return i.hooks && (r = i.hooks.postprocess(r)), r;
1405
+ } catch (e) {
1406
+ return a(e);
1407
+ }
1408
+ };
1409
+ }
1410
+ onError(e, t) {
1411
+ return (n) => {
1412
+ if (n.message += "\nPlease report this to https://github.com/markedjs/marked.", e) {
1413
+ let e = "<p>An error occurred:</p><pre>" + F(n.message + "", !0) + "</pre>";
1414
+ return t ? Promise.resolve(e) : e;
1415
+ }
1416
+ if (t) return Promise.reject(n);
1417
+ throw n;
1418
+ };
1419
+ }
1420
+ }();
1421
+ function W(e, t) {
1422
+ return U.parse(e, t);
1423
+ }
1424
+ W.options = W.setOptions = function(e) {
1425
+ return U.setOptions(e), W.defaults = U.defaults, te(W.defaults), W;
1426
+ }, W.getDefaults = g, W.defaults = _, W.use = function(...e) {
1427
+ return U.use(...e), W.defaults = U.defaults, te(W.defaults), W;
1428
+ }, W.walkTokens = function(e, t) {
1429
+ return U.walkTokens(e, t);
1430
+ }, W.parseInline = U.parseInline, W.Parser = V, W.parser = V.parse, W.Renderer = z, W.TextRenderer = B, W.Lexer = R, W.lexer = R.lex, W.Tokenizer = L, W.Hooks = H, W.parse = W, W.options, W.setOptions, W.use, W.walkTokens, W.parseInline, V.parse, R.lex;
1431
+ //#endregion
1432
+ //#region node_modules/ts-dedent/esm/index.js
1433
+ function $e(e) {
1434
+ var t = [...arguments].slice(1), n = Array.from(typeof e == "string" ? [e] : e);
1435
+ n[n.length - 1] = n[n.length - 1].replace(/\r?\n([\t ]*)$/, "");
1436
+ var r = n.reduce(function(e, t) {
1437
+ var n = t.match(/\n([\t ]+|(?!\s).)/g);
1438
+ return n ? e.concat(n.map(function(e) {
1439
+ return e.match(/[\t ]/g)?.length ?? 0;
1440
+ })) : e;
1441
+ }, []);
1442
+ if (r.length) {
1443
+ var i = RegExp(`
1444
+ [ ]{${Math.min.apply(Math, r)}}`, "g");
1445
+ n = n.map(function(e) {
1446
+ return e.replace(i, "\n");
1447
+ });
1448
+ }
1449
+ n[0] = n[0].replace(/^\r?\n/, "");
1450
+ var a = n[0];
1451
+ return t.forEach(function(e, t) {
1452
+ var r = a.match(/(?:^|\n)( *)$/), i = r ? r[1] : "", o = e;
1453
+ typeof e == "string" && e.includes("\n") && (o = String(e).split("\n").map(function(e, t) {
1454
+ return t === 0 ? e : `${i}${e}`;
1455
+ }).join("\n")), a += o + n[t + 1];
1456
+ }), a;
1457
+ }
1458
+ //#endregion
1459
+ //#region node_modules/mermaid/dist/chunks/mermaid.core/chunk-GMAD6QVW.mjs
1460
+ var G = typeof performance < "u" && typeof performance.now == "function", K = /* @__PURE__ */ i(() => G ? performance.now() : 0, "now"), q = "🧜 ", et = "Mermaid render", tt = "Mermaid", nt = {
1461
+ parse: "tertiary",
1462
+ prepare: "secondary",
1463
+ measure: "primary",
1464
+ layout: "primary-dark",
1465
+ layoutCore: "error",
1466
+ draw: "primary-light",
1467
+ paint: "secondary-dark",
1468
+ serialize: "tertiary-dark",
1469
+ render: "primary-light"
1470
+ };
1471
+ (class {
1472
+ constructor() {
1473
+ this.enabled = !1, this.autoPrint = !0, this.records = [], this.maxRecords = 200, this.roots = [], this.stack = [], this.buckets = {};
1474
+ }
1475
+ static {
1476
+ i(this, "Profiler");
1477
+ }
1478
+ enable() {
1479
+ return this.enabled = !0, this;
1480
+ }
1481
+ disable() {
1482
+ return this.enabled = !1, this;
1483
+ }
1484
+ start(e) {
1485
+ this.enabled && (this.roots = [], this.stack = [], this.buckets = {}, this.begin(e));
1486
+ }
1487
+ tickSync(e, t) {
1488
+ if (!this.enabled) return t();
1489
+ let n = K();
1490
+ try {
1491
+ return t();
1492
+ } finally {
1493
+ this.buckets[e] = (this.buckets[e] ?? 0) + (K() - n);
1494
+ }
1495
+ }
1496
+ async tick(e, t) {
1497
+ if (!this.enabled) return t();
1498
+ let n = K();
1499
+ try {
1500
+ return await t();
1501
+ } finally {
1502
+ this.buckets[e] = (this.buckets[e] ?? 0) + (K() - n);
1503
+ }
1504
+ }
1505
+ stop() {
1506
+ if (!this.enabled) return;
1507
+ for (; this.stack.length > 0;) this.end();
1508
+ let e = this.roots.at(-1), t = this.runLabel ?? e?.name;
1509
+ return e && (this.records.push({
1510
+ label: t ?? e.name,
1511
+ tree: e,
1512
+ buckets: { ...this.buckets }
1513
+ }), this.records.length > this.maxRecords && this.records.splice(0, this.records.length - this.maxRecords), this.autoPrint && this.printSummary(e, t)), this.runLabel = void 0, e;
1514
+ }
1515
+ begin(e) {
1516
+ if (!this.enabled) return;
1517
+ let t = {
1518
+ name: e,
1519
+ start: K(),
1520
+ duration: -1,
1521
+ children: []
1522
+ }, n = this.stack.at(-1);
1523
+ if (n ? n.children.push(t) : this.roots.push(t), this.stack.push(t), G && typeof performance.mark == "function") try {
1524
+ performance.mark(`${q}${e} \u25B6`);
1525
+ } catch {}
1526
+ }
1527
+ end() {
1528
+ if (!this.enabled) return;
1529
+ let e = this.stack.pop();
1530
+ if (!e) return;
1531
+ let t = K();
1532
+ if (e.duration = t - e.start, G && typeof performance.measure == "function") try {
1533
+ performance.measure(`${q}${e.name}`, {
1534
+ start: e.start,
1535
+ end: t,
1536
+ detail: { devtools: {
1537
+ dataType: "track-entry",
1538
+ track: et,
1539
+ trackGroup: tt,
1540
+ color: nt[e.name] ?? "primary",
1541
+ tooltipText: `${e.name} \u2014 ${e.duration.toFixed(1)} ms`
1542
+ } }
1543
+ });
1544
+ } catch {}
1545
+ }
1546
+ async span(e, t) {
1547
+ if (!this.enabled) return t();
1548
+ this.begin(e);
1549
+ try {
1550
+ return await t();
1551
+ } finally {
1552
+ this.end();
1553
+ }
1554
+ }
1555
+ report() {
1556
+ return this.records.at(-1)?.tree ?? this.roots.at(-1);
1557
+ }
1558
+ clear() {
1559
+ this.records.length = 0, this.roots = [], this.stack = [], this.runLabel = void 0;
1560
+ }
1561
+ reset() {
1562
+ this.roots = [], this.stack = [];
1563
+ }
1564
+ printSummary(e = this.report(), t) {
1565
+ if (!e) return;
1566
+ let n = e.duration, r = t && t !== e.name ? `${e.name} [${t}]` : e.name, a = ["ms % phase"], o = /* @__PURE__ */ i((e, t) => {
1567
+ let r = " ".repeat(t), i = e.duration.toFixed(1).padStart(8), s = n > 0 ? `${(e.duration / n * 100).toFixed(0).padStart(3)}%` : " -";
1568
+ a.push(`${i} ${s} ${r}${e.name}`);
1569
+ for (let n of e.children) o(n, t + 1);
1570
+ if (e.children.length > 0) {
1571
+ let t = e.children.reduce((e, t) => e + t.duration, 0), n = e.duration - t;
1572
+ if (n > .5) {
1573
+ let e = n.toFixed(1).padStart(8);
1574
+ a.push(`${e} ${r} (self)`);
1575
+ }
1576
+ }
1577
+ }, "walk");
1578
+ o(e, 0);
1579
+ let s = Object.keys(this.buckets);
1580
+ if (s.length > 0) {
1581
+ a.push("—— buckets (summed) ——");
1582
+ for (let e of s) a.push(`${this.buckets[e].toFixed(1).padStart(8)} ${e}`);
1583
+ }
1584
+ console.log(`${q}mermaid render profile \xB7 ${r}
1585
+ ${a.join("\n")}`);
1586
+ }
1587
+ }), globalThis.injected ??= {
1588
+ includeLargeFeatures: !0,
1589
+ profiling: !1,
1590
+ version: "0.0.0"
1591
+ };
1592
+ var rt = h.default.extend({ raf(e) {
1593
+ typeof queueMicrotask == "function" ? queueMicrotask(e) : setTimeout(e, 0);
1594
+ } }).extend(ee.default);
1595
+ function it(e, { markdownAutoWrap: t }) {
1596
+ return $e(e.replace(/<br\/>/g, "\n").replace(/\n{2,}/g, "\n"));
1597
+ }
1598
+ i(it, "preprocessMarkdown");
1599
+ function at(e) {
1600
+ return e.split(/\\n|\n|<br\s*\/?>/gi).map((e) => e.trim().match(/<[^>]+>|[^\s<>]+/g)?.map((e) => ({
1601
+ content: e,
1602
+ type: "normal"
1603
+ })) ?? []);
1604
+ }
1605
+ i(at, "nonMarkdownToLines");
1606
+ function ot(e, t = {}) {
1607
+ let n = it(e, t), r = W.lexer(n), a = [[]], o = 0;
1608
+ function s(e, t = "normal") {
1609
+ e.type === "text" ? e.text.split("\n").forEach((e, n) => {
1610
+ n !== 0 && (o++, a.push([])), e.split(" ").forEach((e) => {
1611
+ e = e.replace(/&#39;/g, "'"), e && a[o].push({
1612
+ content: e,
1613
+ type: t
1614
+ });
1615
+ });
1616
+ }) : e.type === "strong" || e.type === "em" ? e.tokens.forEach((t) => {
1617
+ s(t, e.type);
1618
+ }) : e.type === "html" && a[o].push({
1619
+ content: e.text,
1620
+ type: "normal"
1621
+ });
1622
+ }
1623
+ return i(s, "processNode"), r.forEach((e) => {
1624
+ e.type === "paragraph" ? e.tokens?.forEach((e) => {
1625
+ s(e);
1626
+ }) : e.type === "html" ? a[o].push({
1627
+ content: e.text,
1628
+ type: "normal"
1629
+ }) : a[o].push({
1630
+ content: e.raw,
1631
+ type: "normal"
1632
+ });
1633
+ }), a;
1634
+ }
1635
+ i(ot, "markdownToLines");
1636
+ function st(e) {
1637
+ return e ? `<p>${e.replace(/\\n|\n/g, "<br />")}</p>` : "";
1638
+ }
1639
+ i(st, "nonMarkdownToHTML");
1640
+ function ct(e, { markdownAutoWrap: n } = {}) {
1641
+ let r = W.lexer(e);
1642
+ function a(e) {
1643
+ return e.type === "text" ? n === !1 ? e.text.replace(/\n */g, "<br/>").replace(/ /g, "&nbsp;") : e.text.replace(/\n */g, "<br/>") : e.type === "strong" ? `<strong>${e.tokens?.map(a).join("")}</strong>` : e.type === "em" ? `<em>${e.tokens?.map(a).join("")}</em>` : e.type === "paragraph" ? `<p>${e.tokens?.map(a).join("")}</p>` : e.type === "space" ? "" : e.type === "html" ? `${e.text}` : e.type === "escape" ? e.text : (t.warn(`Unsupported markdown: ${e.type}`), e.raw);
1644
+ }
1645
+ return i(a, "output"), r.map(a).join("");
1646
+ }
1647
+ i(ct, "markdownToHTML");
1648
+ function lt(e) {
1649
+ return Intl.Segmenter ? [...new Intl.Segmenter().segment(e)].map((e) => e.segment) : [...e];
1650
+ }
1651
+ i(lt, "splitTextToChars");
1652
+ function ut(e, t) {
1653
+ return J(e, [], lt(t.content), t.type);
1654
+ }
1655
+ i(ut, "splitWordToFitWidth");
1656
+ function J(e, t, n, r) {
1657
+ if (n.length === 0) return [{
1658
+ content: t.join(""),
1659
+ type: r
1660
+ }, {
1661
+ content: "",
1662
+ type: r
1663
+ }];
1664
+ let [i, ...a] = n, o = [...t, i];
1665
+ return e([{
1666
+ content: o.join(""),
1667
+ type: r
1668
+ }]) ? J(e, o, a, r) : (t.length === 0 && i && (t.push(i), n.shift()), [{
1669
+ content: t.join(""),
1670
+ type: r
1671
+ }, {
1672
+ content: n.join(""),
1673
+ type: r
1674
+ }]);
1675
+ }
1676
+ i(J, "splitWordToFitWidthRecursion");
1677
+ function dt(e, t) {
1678
+ if (e.some(({ content: e }) => e.includes("\n"))) throw Error("splitLineToFitWidth does not support newlines in the line");
1679
+ return Y(e, t);
1680
+ }
1681
+ i(dt, "splitLineToFitWidth");
1682
+ function Y(e, t, n = [], r = []) {
1683
+ if (e.length === 0) return r.length > 0 && n.push(r), n.length > 0 ? n : [];
1684
+ let i = "";
1685
+ e[0].content === " " && (i = " ", e.shift());
1686
+ let a = e.shift() ?? {
1687
+ content: " ",
1688
+ type: "normal"
1689
+ }, o = [...r];
1690
+ if (i !== "" && o.push({
1691
+ content: i,
1692
+ type: "normal"
1693
+ }), o.push(a), t(o)) return Y(e, t, n, o);
1694
+ if (r.length > 0) n.push(r), e.unshift(a);
1695
+ else if (a.content) {
1696
+ let [r, i] = ut(t, a);
1697
+ n.push([r]), i.content && e.unshift(i);
1698
+ }
1699
+ return Y(e, t, n);
1700
+ }
1701
+ i(Y, "splitLineToFitWidthRecursion");
1702
+ function X(e, t) {
1703
+ t && e.attr("style", t);
1704
+ }
1705
+ i(X, "applyStyle");
1706
+ var ft = 16384;
1707
+ async function pt(e, t, n, r, i = !1, u = s()) {
1708
+ let d = e.append("foreignObject");
1709
+ d.attr("width", `${Math.min(10 * n, ft)}px`), d.attr("height", `${Math.min(10 * n, ft)}px`);
1710
+ let f = d.append("xhtml:div"), p = a(t.label) ? await o(t.label.replace(c.lineBreakRegex, "\n"), u) : l(t.label, u), m = t.isNode ? "nodeLabel" : "edgeLabel", h = f.append("span");
1711
+ return h.html(p), X(h, t.labelStyle), h.attr("class", `${m} ${r}`), X(f, t.labelStyle), f.style("display", "table-cell"), f.style("white-space", "nowrap"), f.style("line-height", "1.5"), n !== Infinity && (f.style("max-width", n + "px"), f.style("text-align", "center")), f.attr("xmlns", "http://www.w3.org/1999/xhtml"), i && f.attr("class", "labelBkg"), (await rt.measure(() => f.node().getBoundingClientRect())).width === n && (f.style("display", "table"), f.style("white-space", "break-spaces"), f.style("width", n + "px")), d.node();
1712
+ }
1713
+ i(pt, "addHtmlSpan");
1714
+ function Z(e, t, n, r = !1) {
1715
+ let i = e.append("tspan").attr("class", "text-outer-tspan").attr("x", 0).attr("y", t * n - .1 + "em").attr("dy", n + "em");
1716
+ return r && i.attr("text-anchor", "middle"), i;
1717
+ }
1718
+ i(Z, "createTspan");
1719
+ function mt(e, t, n) {
1720
+ let r = e.append("text"), i = Z(r, 1, t);
1721
+ $(i, n);
1722
+ let a = i.node().getComputedTextLength();
1723
+ return r.remove(), a;
1724
+ }
1725
+ i(mt, "computeWidthOfText");
1726
+ function ht(e, t, n) {
1727
+ let r = e.append("text"), i = Z(r, 1, t);
1728
+ $(i, [{
1729
+ content: n,
1730
+ type: "normal"
1731
+ }]);
1732
+ let a = i.node()?.getBoundingClientRect();
1733
+ return a && r.remove(), a;
1734
+ }
1735
+ i(ht, "computeDimensionOfText");
1736
+ function gt(e, t, n, r = !1, a = !1) {
1737
+ let o = 1.1, s = t.append("g"), c = s.insert("rect").attr("class", "background").attr("style", "stroke: none"), l = s.append("text").attr("y", "-10.1");
1738
+ a && l.attr("text-anchor", "middle");
1739
+ let u = 0;
1740
+ for (let t of n) {
1741
+ let n = /* @__PURE__ */ i((t) => mt(s, o, t) <= e, "checkWidth"), r = n(t) ? [t] : dt(t, n);
1742
+ for (let e of r) $(Z(l, u, o, a), e), u++;
1743
+ }
1744
+ if (r) {
1745
+ let e = l.node().getBBox();
1746
+ return c.attr("x", e.x - 2).attr("y", e.y - 2).attr("width", e.width + 4).attr("height", e.height + 4), s.node();
1747
+ }
1748
+ return l.node();
1749
+ }
1750
+ i(gt, "createFormattedText");
1751
+ function Q(e) {
1752
+ return e.replace(/&(amp|lt|gt);/g, (e, t) => {
1753
+ switch (t) {
1754
+ case "amp": return "&";
1755
+ case "lt": return "<";
1756
+ case "gt": return ">";
1757
+ default: return e;
1758
+ }
1759
+ });
1760
+ }
1761
+ i(Q, "decodeHTMLEntities");
1762
+ function $(e, t) {
1763
+ e.text(""), t.forEach((t, n) => {
1764
+ let r = e.append("tspan").attr("font-style", t.type === "em" ? "italic" : "normal").attr("class", "text-inner-tspan").attr("font-weight", t.type === "strong" ? "bold" : "normal");
1765
+ n === 0 ? r.text(Q(t.content)) : r.text(" " + Q(t.content));
1766
+ });
1767
+ }
1768
+ i($, "updateTextContentAndStyles");
1769
+ async function _t(e, t = {}) {
1770
+ let n = [];
1771
+ e.replace(/(fa[bklrs]?):fa-([\w-]+)/g, (e, r, i) => (n.push((async () => {
1772
+ let n = `${r}:${i}`;
1773
+ return await d(n) ? await f(n, void 0, { class: "label-icon" }) : `<i class='${l(e, t).replace(":", " ")}'></i>`;
1774
+ })()), e));
1775
+ let r = await Promise.all(n);
1776
+ return e.replace(/(fa[bklrs]?):fa-([\w-]+)/g, () => r.shift() ?? "");
1777
+ }
1778
+ i(_t, "replaceIconSubstring");
1779
+ var vt = /* @__PURE__ */ i(async (e, r = "", { style: i = "", isTitle: o = !1, classes: s = "", useHtmlLabels: c = !0, markdown: l = !0, isNode: d = !0, width: f = 200, addSvgBackground: p = !1 } = {}, m) => {
1780
+ if (t.debug("XYZ createText", r, i, o, s, c, d, "addSvgBackground: ", p), c) {
1781
+ let t = l ? ct(r, m) : st(r), n = await _t(u(t), m), o = r.replace(/\\\\/g, "\\");
1782
+ return await pt(e, {
1783
+ isNode: d,
1784
+ label: a(r) ? o : n,
1785
+ labelStyle: i.replace("fill:", "color:")
1786
+ }, f, s, p, m);
1787
+ }
1788
+ {
1789
+ let t = u(r.replace(/<br\s*\/?>/g, "<br/>")), a = gt(f, e, l ? ot(t.replace("<br>", "<br/>"), m) : at(t), r ? p : !1, !d);
1790
+ if (d) {
1791
+ /stroke:/.exec(i) && (i = i.replace("stroke:", "lineColor:"));
1792
+ let e = i.replace(/stroke:[^;]+;?/g, "").replace(/stroke-width:[^;]+;?/g, "").replace(/fill:[^;]+;?/g, "").replace(/color:/g, "fill:");
1793
+ n(a).attr("style", e);
1794
+ } else {
1795
+ let e = i.replace(/stroke:[^;]+;?/g, "").replace(/stroke-width:[^;]+;?/g, "").replace(/fill:[^;]+;?/g, "").replace(/background:/g, "fill:");
1796
+ n(a).select("rect").attr("style", e.replace(/background:/g, "fill:"));
1797
+ let t = i.replace(/stroke:[^;]+;?/g, "").replace(/stroke-width:[^;]+;?/g, "").replace(/fill:[^;]+;?/g, "").replace(/color:/g, "fill:");
1798
+ n(a).select("text").attr("style", t);
1799
+ }
1800
+ return o ? n(a).selectAll("tspan.text-outer-tspan").classed("title-row", !0) : n(a).selectAll("tspan.text-outer-tspan").classed("row", !0), a;
1801
+ }
1802
+ }, "createText");
1803
+ //#endregion
1804
+ export { $e as i, vt as n, rt as r, ht as t };