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