lowcoder-comps 0.0.14 → 0.0.16

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.
package/38d6cf93.js ADDED
@@ -0,0 +1,2827 @@
1
+ import { l as nt, av as At, aN as zt } from "./c7fbe06d.js";
2
+ const It = {};
3
+ function Tt(n, r) {
4
+ const t = r || It, e = typeof t.includeImageAlt == "boolean" ? t.includeImageAlt : !0, i = typeof t.includeHtml == "boolean" ? t.includeHtml : !0;
5
+ return tt(n, e, i);
6
+ }
7
+ function tt(n, r, t) {
8
+ if (Bt(n)) {
9
+ if ("value" in n)
10
+ return n.type === "html" && !t ? "" : n.value;
11
+ if (r && "alt" in n && n.alt)
12
+ return n.alt;
13
+ if ("children" in n)
14
+ return qn(n.children, r, t);
15
+ }
16
+ return Array.isArray(n) ? qn(n, r, t) : "";
17
+ }
18
+ function qn(n, r, t) {
19
+ const e = [];
20
+ let i = -1;
21
+ for (; ++i < n.length; )
22
+ e[i] = tt(n[i], r, t);
23
+ return e.join("");
24
+ }
25
+ function Bt(n) {
26
+ return !!(n && typeof n == "object");
27
+ }
28
+ function en(n, r, t, e) {
29
+ const i = n.length;
30
+ let l = 0, u;
31
+ if (r < 0 ? r = -r > i ? 0 : i + r : r = r > i ? i : r, t = t > 0 ? t : 0, e.length < 1e4)
32
+ u = Array.from(e), u.unshift(r, t), [].splice.apply(n, u);
33
+ else
34
+ for (t && [].splice.apply(n, [r, t]); l < e.length; )
35
+ u = e.slice(l, l + 1e4), u.unshift(r, 0), [].splice.apply(n, u), l += 1e4, r += 1e4;
36
+ }
37
+ function Z(n, r) {
38
+ return n.length > 0 ? (en(n, n.length, 0, r), n) : r;
39
+ }
40
+ const Hn = {}.hasOwnProperty;
41
+ function Lt(n) {
42
+ const r = {};
43
+ let t = -1;
44
+ for (; ++t < n.length; )
45
+ Ot(r, n[t]);
46
+ return r;
47
+ }
48
+ function Ot(n, r) {
49
+ let t;
50
+ for (t in r) {
51
+ const i = (Hn.call(n, t) ? n[t] : void 0) || (n[t] = {}), l = r[t];
52
+ let u;
53
+ for (u in l) {
54
+ Hn.call(i, u) || (i[u] = []);
55
+ const a = l[u];
56
+ Dt(
57
+ // @ts-expect-error Looks like a list.
58
+ i[u],
59
+ Array.isArray(a) ? a : a ? [a] : []
60
+ );
61
+ }
62
+ }
63
+ }
64
+ function Dt(n, r) {
65
+ let t = -1;
66
+ const e = [];
67
+ for (; ++t < r.length; )
68
+ (r[t].add === "after" ? n : e).push(r[t]);
69
+ en(n, 0, 0, e);
70
+ }
71
+ const Pt = /[!-/:-@[-`{-~\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/, tn = sn(/[A-Za-z]/), An = sn(/\d/), _t = sn(/[\dA-Fa-f]/), v = sn(/[\dA-Za-z]/), Mt = sn(/[!-/:-@[-`{-~]/), Nn = sn(/[#-'*+\--9=?A-Z^-~]/);
72
+ function zn(n) {
73
+ return (
74
+ // Special whitespace codes (which have negative values), C0 and Control
75
+ // character DEL
76
+ n !== null && (n < 32 || n === 127)
77
+ );
78
+ }
79
+ function Y(n) {
80
+ return n !== null && (n < 0 || n === 32);
81
+ }
82
+ function C(n) {
83
+ return n !== null && n < -2;
84
+ }
85
+ function q(n) {
86
+ return n === -2 || n === -1 || n === 32;
87
+ }
88
+ const Rt = sn(/\s/), jt = sn(Pt);
89
+ function sn(n) {
90
+ return r;
91
+ function r(t) {
92
+ return t !== null && n.test(String.fromCharCode(t));
93
+ }
94
+ }
95
+ function B(n, r, t, e) {
96
+ const i = e ? e - 1 : Number.POSITIVE_INFINITY;
97
+ let l = 0;
98
+ return u;
99
+ function u(c) {
100
+ return q(c) ? (n.enter(t), a(c)) : r(c);
101
+ }
102
+ function a(c) {
103
+ return q(c) && l++ < i ? (n.consume(c), a) : (n.exit(t), r(c));
104
+ }
105
+ }
106
+ const qt = {
107
+ tokenize: Ht
108
+ };
109
+ function Ht(n) {
110
+ const r = n.attempt(
111
+ this.parser.constructs.contentInitial,
112
+ e,
113
+ i
114
+ );
115
+ let t;
116
+ return r;
117
+ function e(a) {
118
+ if (a === null) {
119
+ n.consume(a);
120
+ return;
121
+ }
122
+ return n.enter("lineEnding"), n.consume(a), n.exit("lineEnding"), B(n, r, "linePrefix");
123
+ }
124
+ function i(a) {
125
+ return n.enter("paragraph"), l(a);
126
+ }
127
+ function l(a) {
128
+ const c = n.enter("chunkText", {
129
+ contentType: "text",
130
+ previous: t
131
+ });
132
+ return t && (t.next = c), t = c, u(a);
133
+ }
134
+ function u(a) {
135
+ if (a === null) {
136
+ n.exit("chunkText"), n.exit("paragraph"), n.consume(a);
137
+ return;
138
+ }
139
+ return C(a) ? (n.consume(a), n.exit("chunkText"), l) : (n.consume(a), u);
140
+ }
141
+ }
142
+ const Nt = {
143
+ tokenize: Vt
144
+ }, Vn = {
145
+ tokenize: Qt
146
+ };
147
+ function Vt(n) {
148
+ const r = this, t = [];
149
+ let e = 0, i, l, u;
150
+ return a;
151
+ function a(F) {
152
+ if (e < t.length) {
153
+ const O = t[e];
154
+ return r.containerState = O[1], n.attempt(
155
+ O[0].continuation,
156
+ c,
157
+ p
158
+ )(F);
159
+ }
160
+ return p(F);
161
+ }
162
+ function c(F) {
163
+ if (e++, r.containerState._closeFlow) {
164
+ r.containerState._closeFlow = void 0, i && _();
165
+ const O = r.events.length;
166
+ let D = O, d;
167
+ for (; D--; )
168
+ if (r.events[D][0] === "exit" && r.events[D][1].type === "chunkFlow") {
169
+ d = r.events[D][1].end;
170
+ break;
171
+ }
172
+ y(e);
173
+ let P = O;
174
+ for (; P < r.events.length; )
175
+ r.events[P][1].end = Object.assign({}, d), P++;
176
+ return en(
177
+ r.events,
178
+ D + 1,
179
+ 0,
180
+ r.events.slice(O)
181
+ ), r.events.length = P, p(F);
182
+ }
183
+ return a(F);
184
+ }
185
+ function p(F) {
186
+ if (e === t.length) {
187
+ if (!i)
188
+ return g(F);
189
+ if (i.currentConstruct && i.currentConstruct.concrete)
190
+ return k(F);
191
+ r.interrupt = !!(i.currentConstruct && !i._gfmTableDynamicInterruptHack);
192
+ }
193
+ return r.containerState = {}, n.check(
194
+ Vn,
195
+ h,
196
+ x
197
+ )(F);
198
+ }
199
+ function h(F) {
200
+ return i && _(), y(e), g(F);
201
+ }
202
+ function x(F) {
203
+ return r.parser.lazy[r.now().line] = e !== t.length, u = r.now().offset, k(F);
204
+ }
205
+ function g(F) {
206
+ return r.containerState = {}, n.attempt(
207
+ Vn,
208
+ f,
209
+ k
210
+ )(F);
211
+ }
212
+ function f(F) {
213
+ return e++, t.push([r.currentConstruct, r.containerState]), g(F);
214
+ }
215
+ function k(F) {
216
+ if (F === null) {
217
+ i && _(), y(0), n.consume(F);
218
+ return;
219
+ }
220
+ return i = i || r.parser.flow(r.now()), n.enter("chunkFlow", {
221
+ contentType: "flow",
222
+ previous: l,
223
+ _tokenizer: i
224
+ }), A(F);
225
+ }
226
+ function A(F) {
227
+ if (F === null) {
228
+ L(n.exit("chunkFlow"), !0), y(0), n.consume(F);
229
+ return;
230
+ }
231
+ return C(F) ? (n.consume(F), L(n.exit("chunkFlow")), e = 0, r.interrupt = void 0, a) : (n.consume(F), A);
232
+ }
233
+ function L(F, O) {
234
+ const D = r.sliceStream(F);
235
+ if (O && D.push(null), F.previous = l, l && (l.next = F), l = F, i.defineSkip(F.start), i.write(D), r.parser.lazy[F.start.line]) {
236
+ let d = i.events.length;
237
+ for (; d--; )
238
+ if (
239
+ // The token starts before the line ending…
240
+ i.events[d][1].start.offset < u && // …and either is not ended yet…
241
+ (!i.events[d][1].end || // …or ends after it.
242
+ i.events[d][1].end.offset > u)
243
+ )
244
+ return;
245
+ const P = r.events.length;
246
+ let R = P, j, V;
247
+ for (; R--; )
248
+ if (r.events[R][0] === "exit" && r.events[R][1].type === "chunkFlow") {
249
+ if (j) {
250
+ V = r.events[R][1].end;
251
+ break;
252
+ }
253
+ j = !0;
254
+ }
255
+ for (y(e), d = P; d < r.events.length; )
256
+ r.events[d][1].end = Object.assign({}, V), d++;
257
+ en(
258
+ r.events,
259
+ R + 1,
260
+ 0,
261
+ r.events.slice(P)
262
+ ), r.events.length = d;
263
+ }
264
+ }
265
+ function y(F) {
266
+ let O = t.length;
267
+ for (; O-- > F; ) {
268
+ const D = t[O];
269
+ r.containerState = D[1], D[0].exit.call(r, n);
270
+ }
271
+ t.length = F;
272
+ }
273
+ function _() {
274
+ i.write([null]), l = void 0, i = void 0, r.containerState._closeFlow = void 0;
275
+ }
276
+ }
277
+ function Qt(n, r, t) {
278
+ return B(
279
+ n,
280
+ n.attempt(this.parser.constructs.document, r, t),
281
+ "linePrefix",
282
+ this.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4
283
+ );
284
+ }
285
+ function Qn(n) {
286
+ if (n === null || Y(n) || Rt(n))
287
+ return 1;
288
+ if (jt(n))
289
+ return 2;
290
+ }
291
+ function Bn(n, r, t) {
292
+ const e = [];
293
+ let i = -1;
294
+ for (; ++i < n.length; ) {
295
+ const l = n[i].resolveAll;
296
+ l && !e.includes(l) && (r = l(r, t), e.push(l));
297
+ }
298
+ return r;
299
+ }
300
+ const In = {
301
+ name: "attention",
302
+ tokenize: Wt,
303
+ resolveAll: Ut
304
+ };
305
+ function Ut(n, r) {
306
+ let t = -1, e, i, l, u, a, c, p, h;
307
+ for (; ++t < n.length; )
308
+ if (n[t][0] === "enter" && n[t][1].type === "attentionSequence" && n[t][1]._close) {
309
+ for (e = t; e--; )
310
+ if (n[e][0] === "exit" && n[e][1].type === "attentionSequence" && n[e][1]._open && // If the markers are the same:
311
+ r.sliceSerialize(n[e][1]).charCodeAt(0) === r.sliceSerialize(n[t][1]).charCodeAt(0)) {
312
+ if ((n[e][1]._close || n[t][1]._open) && (n[t][1].end.offset - n[t][1].start.offset) % 3 && !((n[e][1].end.offset - n[e][1].start.offset + n[t][1].end.offset - n[t][1].start.offset) % 3))
313
+ continue;
314
+ c = n[e][1].end.offset - n[e][1].start.offset > 1 && n[t][1].end.offset - n[t][1].start.offset > 1 ? 2 : 1;
315
+ const x = Object.assign({}, n[e][1].end), g = Object.assign({}, n[t][1].start);
316
+ Un(x, -c), Un(g, c), u = {
317
+ type: c > 1 ? "strongSequence" : "emphasisSequence",
318
+ start: x,
319
+ end: Object.assign({}, n[e][1].end)
320
+ }, a = {
321
+ type: c > 1 ? "strongSequence" : "emphasisSequence",
322
+ start: Object.assign({}, n[t][1].start),
323
+ end: g
324
+ }, l = {
325
+ type: c > 1 ? "strongText" : "emphasisText",
326
+ start: Object.assign({}, n[e][1].end),
327
+ end: Object.assign({}, n[t][1].start)
328
+ }, i = {
329
+ type: c > 1 ? "strong" : "emphasis",
330
+ start: Object.assign({}, u.start),
331
+ end: Object.assign({}, a.end)
332
+ }, n[e][1].end = Object.assign({}, u.start), n[t][1].start = Object.assign({}, a.end), p = [], n[e][1].end.offset - n[e][1].start.offset && (p = Z(p, [
333
+ ["enter", n[e][1], r],
334
+ ["exit", n[e][1], r]
335
+ ])), p = Z(p, [
336
+ ["enter", i, r],
337
+ ["enter", u, r],
338
+ ["exit", u, r],
339
+ ["enter", l, r]
340
+ ]), p = Z(
341
+ p,
342
+ Bn(
343
+ r.parser.constructs.insideSpan.null,
344
+ n.slice(e + 1, t),
345
+ r
346
+ )
347
+ ), p = Z(p, [
348
+ ["exit", l, r],
349
+ ["enter", a, r],
350
+ ["exit", a, r],
351
+ ["exit", i, r]
352
+ ]), n[t][1].end.offset - n[t][1].start.offset ? (h = 2, p = Z(p, [
353
+ ["enter", n[t][1], r],
354
+ ["exit", n[t][1], r]
355
+ ])) : h = 0, en(n, e - 1, t - e + 3, p), t = e + p.length - h - 2;
356
+ break;
357
+ }
358
+ }
359
+ for (t = -1; ++t < n.length; )
360
+ n[t][1].type === "attentionSequence" && (n[t][1].type = "data");
361
+ return n;
362
+ }
363
+ function Wt(n, r) {
364
+ const t = this.parser.constructs.attentionMarkers.null, e = this.previous, i = Qn(e);
365
+ let l;
366
+ return u;
367
+ function u(c) {
368
+ return n.enter("attentionSequence"), l = c, a(c);
369
+ }
370
+ function a(c) {
371
+ if (c === l)
372
+ return n.consume(c), a;
373
+ const p = n.exit("attentionSequence"), h = Qn(c), x = !h || h === 2 && i || t.includes(c), g = !i || i === 2 && h || t.includes(e);
374
+ return p._open = !!(l === 42 ? x : x && (i || !g)), p._close = !!(l === 42 ? g : g && (h || !x)), r(c);
375
+ }
376
+ }
377
+ function Un(n, r) {
378
+ n.column += r, n.offset += r, n._bufferIndex += r;
379
+ }
380
+ const $t = {
381
+ name: "autolink",
382
+ tokenize: Zt
383
+ };
384
+ function Zt(n, r, t) {
385
+ let e = 1;
386
+ return i;
387
+ function i(k) {
388
+ return n.enter("autolink"), n.enter("autolinkMarker"), n.consume(k), n.exit("autolinkMarker"), n.enter("autolinkProtocol"), l;
389
+ }
390
+ function l(k) {
391
+ return tn(k) ? (n.consume(k), u) : Nn(k) ? p(k) : t(k);
392
+ }
393
+ function u(k) {
394
+ return k === 43 || k === 45 || k === 46 || v(k) ? a(k) : p(k);
395
+ }
396
+ function a(k) {
397
+ return k === 58 ? (n.consume(k), c) : (k === 43 || k === 45 || k === 46 || v(k)) && e++ < 32 ? (n.consume(k), a) : p(k);
398
+ }
399
+ function c(k) {
400
+ return k === 62 ? (n.exit("autolinkProtocol"), f(k)) : k === null || k === 32 || k === 60 || zn(k) ? t(k) : (n.consume(k), c);
401
+ }
402
+ function p(k) {
403
+ return k === 64 ? (n.consume(k), e = 0, h) : Nn(k) ? (n.consume(k), p) : t(k);
404
+ }
405
+ function h(k) {
406
+ return v(k) ? x(k) : t(k);
407
+ }
408
+ function x(k) {
409
+ return k === 46 ? (n.consume(k), e = 0, h) : k === 62 ? (n.exit("autolinkProtocol").type = "autolinkEmail", f(k)) : g(k);
410
+ }
411
+ function g(k) {
412
+ return (k === 45 || v(k)) && e++ < 63 ? (n.consume(k), k === 45 ? g : x) : t(k);
413
+ }
414
+ function f(k) {
415
+ return n.enter("autolinkMarker"), n.consume(k), n.exit("autolinkMarker"), n.exit("autolink"), r;
416
+ }
417
+ }
418
+ const Sn = {
419
+ tokenize: Yt,
420
+ partial: !0
421
+ };
422
+ function Yt(n, r, t) {
423
+ return B(n, e, "linePrefix");
424
+ function e(i) {
425
+ return i === null || C(i) ? r(i) : t(i);
426
+ }
427
+ }
428
+ const et = {
429
+ name: "blockQuote",
430
+ tokenize: Gt,
431
+ continuation: {
432
+ tokenize: Jt
433
+ },
434
+ exit: Kt
435
+ };
436
+ function Gt(n, r, t) {
437
+ const e = this;
438
+ return i;
439
+ function i(u) {
440
+ if (u === 62) {
441
+ const a = e.containerState;
442
+ return a.open || (n.enter("blockQuote", {
443
+ _container: !0
444
+ }), a.open = !0), n.enter("blockQuotePrefix"), n.enter("blockQuoteMarker"), n.consume(u), n.exit("blockQuoteMarker"), l;
445
+ }
446
+ return t(u);
447
+ }
448
+ function l(u) {
449
+ return q(u) ? (n.enter("blockQuotePrefixWhitespace"), n.consume(u), n.exit("blockQuotePrefixWhitespace"), n.exit("blockQuotePrefix"), r) : (n.exit("blockQuotePrefix"), r(u));
450
+ }
451
+ }
452
+ function Jt(n, r, t) {
453
+ return B(
454
+ n,
455
+ n.attempt(et, r, t),
456
+ "linePrefix",
457
+ this.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4
458
+ );
459
+ }
460
+ function Kt(n) {
461
+ n.exit("blockQuote");
462
+ }
463
+ const rt = {
464
+ name: "characterEscape",
465
+ tokenize: Xt
466
+ };
467
+ function Xt(n, r, t) {
468
+ return e;
469
+ function e(l) {
470
+ return n.enter("characterEscape"), n.enter("escapeMarker"), n.consume(l), n.exit("escapeMarker"), i;
471
+ }
472
+ function i(l) {
473
+ return Mt(l) ? (n.enter("characterEscapeValue"), n.consume(l), n.exit("characterEscapeValue"), n.exit("characterEscape"), r) : t(l);
474
+ }
475
+ }
476
+ const Wn = document.createElement("i");
477
+ function Ln(n) {
478
+ const r = "&" + n + ";";
479
+ Wn.innerHTML = r;
480
+ const t = Wn.textContent;
481
+ return t.charCodeAt(t.length - 1) === 59 && n !== "semi" || t === r ? !1 : t;
482
+ }
483
+ const it = {
484
+ name: "characterReference",
485
+ tokenize: vt
486
+ };
487
+ function vt(n, r, t) {
488
+ const e = this;
489
+ let i = 0, l, u;
490
+ return a;
491
+ function a(x) {
492
+ return n.enter("characterReference"), n.enter("characterReferenceMarker"), n.consume(x), n.exit("characterReferenceMarker"), c;
493
+ }
494
+ function c(x) {
495
+ return x === 35 ? (n.enter("characterReferenceMarkerNumeric"), n.consume(x), n.exit("characterReferenceMarkerNumeric"), p) : (n.enter("characterReferenceValue"), l = 31, u = v, h(x));
496
+ }
497
+ function p(x) {
498
+ return x === 88 || x === 120 ? (n.enter("characterReferenceMarkerHexadecimal"), n.consume(x), n.exit("characterReferenceMarkerHexadecimal"), n.enter("characterReferenceValue"), l = 6, u = _t, h) : (n.enter("characterReferenceValue"), l = 7, u = An, h(x));
499
+ }
500
+ function h(x) {
501
+ let g;
502
+ return x === 59 && i ? (g = n.exit("characterReferenceValue"), u === v && !Ln(e.sliceSerialize(g)) ? t(x) : (n.enter("characterReferenceMarker"), n.consume(x), n.exit("characterReferenceMarker"), n.exit("characterReference"), r)) : u(x) && i++ < l ? (n.consume(x), h) : t(x);
503
+ }
504
+ }
505
+ const $n = {
506
+ name: "codeFenced",
507
+ tokenize: ne,
508
+ concrete: !0
509
+ };
510
+ function ne(n, r, t) {
511
+ const e = this, i = {
512
+ tokenize: D,
513
+ partial: !0
514
+ }, l = {
515
+ tokenize: O,
516
+ partial: !0
517
+ }, u = this.events[this.events.length - 1], a = u && u[1].type === "linePrefix" ? u[2].sliceSerialize(u[1], !0).length : 0;
518
+ let c = 0, p;
519
+ return h;
520
+ function h(d) {
521
+ return n.enter("codeFenced"), n.enter("codeFencedFence"), n.enter("codeFencedFenceSequence"), p = d, x(d);
522
+ }
523
+ function x(d) {
524
+ return d === p ? (n.consume(d), c++, x) : (n.exit("codeFencedFenceSequence"), c < 3 ? t(d) : B(n, g, "whitespace")(d));
525
+ }
526
+ function g(d) {
527
+ return d === null || C(d) ? L(d) : (n.enter("codeFencedFenceInfo"), n.enter("chunkString", {
528
+ contentType: "string"
529
+ }), f(d));
530
+ }
531
+ function f(d) {
532
+ return d === null || Y(d) ? (n.exit("chunkString"), n.exit("codeFencedFenceInfo"), B(n, k, "whitespace")(d)) : d === 96 && d === p ? t(d) : (n.consume(d), f);
533
+ }
534
+ function k(d) {
535
+ return d === null || C(d) ? L(d) : (n.enter("codeFencedFenceMeta"), n.enter("chunkString", {
536
+ contentType: "string"
537
+ }), A(d));
538
+ }
539
+ function A(d) {
540
+ return d === null || C(d) ? (n.exit("chunkString"), n.exit("codeFencedFenceMeta"), L(d)) : d === 96 && d === p ? t(d) : (n.consume(d), A);
541
+ }
542
+ function L(d) {
543
+ return n.exit("codeFencedFence"), e.interrupt ? r(d) : y(d);
544
+ }
545
+ function y(d) {
546
+ return d === null ? F(d) : C(d) ? n.attempt(
547
+ l,
548
+ n.attempt(
549
+ i,
550
+ F,
551
+ a ? B(
552
+ n,
553
+ y,
554
+ "linePrefix",
555
+ a + 1
556
+ ) : y
557
+ ),
558
+ F
559
+ )(d) : (n.enter("codeFlowValue"), _(d));
560
+ }
561
+ function _(d) {
562
+ return d === null || C(d) ? (n.exit("codeFlowValue"), y(d)) : (n.consume(d), _);
563
+ }
564
+ function F(d) {
565
+ return n.exit("codeFenced"), r(d);
566
+ }
567
+ function O(d, P, R) {
568
+ const j = this;
569
+ return V;
570
+ function V(w) {
571
+ return d.enter("lineEnding"), d.consume(w), d.exit("lineEnding"), S;
572
+ }
573
+ function S(w) {
574
+ return j.parser.lazy[j.now().line] ? R(w) : P(w);
575
+ }
576
+ }
577
+ function D(d, P, R) {
578
+ let j = 0;
579
+ return B(
580
+ d,
581
+ V,
582
+ "linePrefix",
583
+ this.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4
584
+ );
585
+ function V(z) {
586
+ return d.enter("codeFencedFence"), d.enter("codeFencedFenceSequence"), S(z);
587
+ }
588
+ function S(z) {
589
+ return z === p ? (d.consume(z), j++, S) : j < c ? R(z) : (d.exit("codeFencedFenceSequence"), B(d, w, "whitespace")(z));
590
+ }
591
+ function w(z) {
592
+ return z === null || C(z) ? (d.exit("codeFencedFence"), P(z)) : R(z);
593
+ }
594
+ }
595
+ }
596
+ const En = {
597
+ name: "codeIndented",
598
+ tokenize: ee
599
+ }, te = {
600
+ tokenize: re,
601
+ partial: !0
602
+ };
603
+ function ee(n, r, t) {
604
+ const e = this;
605
+ return i;
606
+ function i(p) {
607
+ return n.enter("codeIndented"), B(n, l, "linePrefix", 4 + 1)(p);
608
+ }
609
+ function l(p) {
610
+ const h = e.events[e.events.length - 1];
611
+ return h && h[1].type === "linePrefix" && h[2].sliceSerialize(h[1], !0).length >= 4 ? u(p) : t(p);
612
+ }
613
+ function u(p) {
614
+ return p === null ? c(p) : C(p) ? n.attempt(te, u, c)(p) : (n.enter("codeFlowValue"), a(p));
615
+ }
616
+ function a(p) {
617
+ return p === null || C(p) ? (n.exit("codeFlowValue"), u(p)) : (n.consume(p), a);
618
+ }
619
+ function c(p) {
620
+ return n.exit("codeIndented"), r(p);
621
+ }
622
+ }
623
+ function re(n, r, t) {
624
+ const e = this;
625
+ return i;
626
+ function i(u) {
627
+ return e.parser.lazy[e.now().line] ? t(u) : C(u) ? (n.enter("lineEnding"), n.consume(u), n.exit("lineEnding"), i) : B(n, l, "linePrefix", 4 + 1)(u);
628
+ }
629
+ function l(u) {
630
+ const a = e.events[e.events.length - 1];
631
+ return a && a[1].type === "linePrefix" && a[2].sliceSerialize(a[1], !0).length >= 4 ? r(u) : C(u) ? i(u) : t(u);
632
+ }
633
+ }
634
+ const ie = {
635
+ name: "codeText",
636
+ tokenize: ae,
637
+ resolve: ue,
638
+ previous: le
639
+ };
640
+ function ue(n) {
641
+ let r = n.length - 4, t = 3, e, i;
642
+ if ((n[t][1].type === "lineEnding" || n[t][1].type === "space") && (n[r][1].type === "lineEnding" || n[r][1].type === "space")) {
643
+ for (e = t; ++e < r; )
644
+ if (n[e][1].type === "codeTextData") {
645
+ n[t][1].type = "codeTextPadding", n[r][1].type = "codeTextPadding", t += 2, r -= 2;
646
+ break;
647
+ }
648
+ }
649
+ for (e = t - 1, r++; ++e <= r; )
650
+ i === void 0 ? e !== r && n[e][1].type !== "lineEnding" && (i = e) : (e === r || n[e][1].type === "lineEnding") && (n[i][1].type = "codeTextData", e !== i + 2 && (n[i][1].end = n[e - 1][1].end, n.splice(i + 2, e - i - 2), r -= e - i - 2, e = i + 2), i = void 0);
651
+ return n;
652
+ }
653
+ function le(n) {
654
+ return n !== 96 || this.events[this.events.length - 1][1].type === "characterEscape";
655
+ }
656
+ function ae(n, r, t) {
657
+ let e = 0, i, l;
658
+ return u;
659
+ function u(x) {
660
+ return n.enter("codeText"), n.enter("codeTextSequence"), a(x);
661
+ }
662
+ function a(x) {
663
+ return x === 96 ? (n.consume(x), e++, a) : (n.exit("codeTextSequence"), c(x));
664
+ }
665
+ function c(x) {
666
+ return x === null ? t(x) : x === 96 ? (l = n.enter("codeTextSequence"), i = 0, h(x)) : x === 32 ? (n.enter("space"), n.consume(x), n.exit("space"), c) : C(x) ? (n.enter("lineEnding"), n.consume(x), n.exit("lineEnding"), c) : (n.enter("codeTextData"), p(x));
667
+ }
668
+ function p(x) {
669
+ return x === null || x === 32 || x === 96 || C(x) ? (n.exit("codeTextData"), c(x)) : (n.consume(x), p);
670
+ }
671
+ function h(x) {
672
+ return x === 96 ? (n.consume(x), i++, h) : i === e ? (n.exit("codeTextSequence"), n.exit("codeText"), r(x)) : (l.type = "codeTextData", p(x));
673
+ }
674
+ }
675
+ function ut(n) {
676
+ const r = {};
677
+ let t = -1, e, i, l, u, a, c, p;
678
+ for (; ++t < n.length; ) {
679
+ for (; t in r; )
680
+ t = r[t];
681
+ if (e = n[t], t && e[1].type === "chunkFlow" && n[t - 1][1].type === "listItemPrefix" && (c = e[1]._tokenizer.events, l = 0, l < c.length && c[l][1].type === "lineEndingBlank" && (l += 2), l < c.length && c[l][1].type === "content"))
682
+ for (; ++l < c.length && c[l][1].type !== "content"; )
683
+ c[l][1].type === "chunkText" && (c[l][1]._isInFirstContentOfListItem = !0, l++);
684
+ if (e[0] === "enter")
685
+ e[1].contentType && (Object.assign(r, oe(n, t)), t = r[t], p = !0);
686
+ else if (e[1]._container) {
687
+ for (l = t, i = void 0; l-- && (u = n[l], u[1].type === "lineEnding" || u[1].type === "lineEndingBlank"); )
688
+ u[0] === "enter" && (i && (n[i][1].type = "lineEndingBlank"), u[1].type = "lineEnding", i = l);
689
+ i && (e[1].end = Object.assign({}, n[i][1].start), a = n.slice(i, t), a.unshift(e), en(n, i, t - i + 1, a));
690
+ }
691
+ }
692
+ return !p;
693
+ }
694
+ function oe(n, r) {
695
+ const t = n[r][1], e = n[r][2];
696
+ let i = r - 1;
697
+ const l = [], u = t._tokenizer || e.parser[t.contentType](t.start), a = u.events, c = [], p = {};
698
+ let h, x, g = -1, f = t, k = 0, A = 0;
699
+ const L = [A];
700
+ for (; f; ) {
701
+ for (; n[++i][1] !== f; )
702
+ ;
703
+ l.push(i), f._tokenizer || (h = e.sliceStream(f), f.next || h.push(null), x && u.defineSkip(f.start), f._isInFirstContentOfListItem && (u._gfmTasklistFirstContentOfListItem = !0), u.write(h), f._isInFirstContentOfListItem && (u._gfmTasklistFirstContentOfListItem = void 0)), x = f, f = f.next;
704
+ }
705
+ for (f = t; ++g < a.length; )
706
+ // Find a void token that includes a break.
707
+ a[g][0] === "exit" && a[g - 1][0] === "enter" && a[g][1].type === a[g - 1][1].type && a[g][1].start.line !== a[g][1].end.line && (A = g + 1, L.push(A), f._tokenizer = void 0, f.previous = void 0, f = f.next);
708
+ for (u.events = [], f ? (f._tokenizer = void 0, f.previous = void 0) : L.pop(), g = L.length; g--; ) {
709
+ const y = a.slice(L[g], L[g + 1]), _ = l.pop();
710
+ c.unshift([_, _ + y.length - 1]), en(n, _, 2, y);
711
+ }
712
+ for (g = -1; ++g < c.length; )
713
+ p[k + c[g][0]] = k + c[g][1], k += c[g][1] - c[g][0] - 1;
714
+ return p;
715
+ }
716
+ const se = {
717
+ tokenize: pe,
718
+ resolve: he
719
+ }, ce = {
720
+ tokenize: me,
721
+ partial: !0
722
+ };
723
+ function he(n) {
724
+ return ut(n), n;
725
+ }
726
+ function pe(n, r) {
727
+ let t;
728
+ return e;
729
+ function e(a) {
730
+ return n.enter("content"), t = n.enter("chunkContent", {
731
+ contentType: "content"
732
+ }), i(a);
733
+ }
734
+ function i(a) {
735
+ return a === null ? l(a) : C(a) ? n.check(
736
+ ce,
737
+ u,
738
+ l
739
+ )(a) : (n.consume(a), i);
740
+ }
741
+ function l(a) {
742
+ return n.exit("chunkContent"), n.exit("content"), r(a);
743
+ }
744
+ function u(a) {
745
+ return n.consume(a), n.exit("chunkContent"), t.next = n.enter("chunkContent", {
746
+ contentType: "content",
747
+ previous: t
748
+ }), t = t.next, i;
749
+ }
750
+ }
751
+ function me(n, r, t) {
752
+ const e = this;
753
+ return i;
754
+ function i(u) {
755
+ return n.exit("chunkContent"), n.enter("lineEnding"), n.consume(u), n.exit("lineEnding"), B(n, l, "linePrefix");
756
+ }
757
+ function l(u) {
758
+ if (u === null || C(u))
759
+ return t(u);
760
+ const a = e.events[e.events.length - 1];
761
+ return !e.parser.constructs.disable.null.includes("codeIndented") && a && a[1].type === "linePrefix" && a[2].sliceSerialize(a[1], !0).length >= 4 ? r(u) : n.interrupt(e.parser.constructs.flow, t, r)(u);
762
+ }
763
+ }
764
+ function lt(n, r, t, e, i, l, u, a, c) {
765
+ const p = c || Number.POSITIVE_INFINITY;
766
+ let h = 0;
767
+ return x;
768
+ function x(y) {
769
+ return y === 60 ? (n.enter(e), n.enter(i), n.enter(l), n.consume(y), n.exit(l), g) : y === null || y === 41 || zn(y) ? t(y) : (n.enter(e), n.enter(u), n.enter(a), n.enter("chunkString", {
770
+ contentType: "string"
771
+ }), A(y));
772
+ }
773
+ function g(y) {
774
+ return y === 62 ? (n.enter(l), n.consume(y), n.exit(l), n.exit(i), n.exit(e), r) : (n.enter(a), n.enter("chunkString", {
775
+ contentType: "string"
776
+ }), f(y));
777
+ }
778
+ function f(y) {
779
+ return y === 62 ? (n.exit("chunkString"), n.exit(a), g(y)) : y === null || y === 60 || C(y) ? t(y) : (n.consume(y), y === 92 ? k : f);
780
+ }
781
+ function k(y) {
782
+ return y === 60 || y === 62 || y === 92 ? (n.consume(y), f) : f(y);
783
+ }
784
+ function A(y) {
785
+ return y === 40 ? ++h > p ? t(y) : (n.consume(y), A) : y === 41 ? h-- ? (n.consume(y), A) : (n.exit("chunkString"), n.exit(a), n.exit(u), n.exit(e), r(y)) : y === null || Y(y) ? h ? t(y) : (n.exit("chunkString"), n.exit(a), n.exit(u), n.exit(e), r(y)) : zn(y) ? t(y) : (n.consume(y), y === 92 ? L : A);
786
+ }
787
+ function L(y) {
788
+ return y === 40 || y === 41 || y === 92 ? (n.consume(y), A) : A(y);
789
+ }
790
+ }
791
+ function at(n, r, t, e, i, l) {
792
+ const u = this;
793
+ let a = 0, c;
794
+ return p;
795
+ function p(f) {
796
+ return n.enter(e), n.enter(i), n.consume(f), n.exit(i), n.enter(l), h;
797
+ }
798
+ function h(f) {
799
+ return f === null || f === 91 || f === 93 && !c || /* To do: remove in the future once we’ve switched from
800
+ * `micromark-extension-footnote` to `micromark-extension-gfm-footnote`,
801
+ * which doesn’t need this */
802
+ /* Hidden footnotes hook */
803
+ /* c8 ignore next 3 */
804
+ f === 94 && !a && "_hiddenFootnoteSupport" in u.parser.constructs || a > 999 ? t(f) : f === 93 ? (n.exit(l), n.enter(i), n.consume(f), n.exit(i), n.exit(e), r) : C(f) ? (n.enter("lineEnding"), n.consume(f), n.exit("lineEnding"), h) : (n.enter("chunkString", {
805
+ contentType: "string"
806
+ }), x(f));
807
+ }
808
+ function x(f) {
809
+ return f === null || f === 91 || f === 93 || C(f) || a++ > 999 ? (n.exit("chunkString"), h(f)) : (n.consume(f), c = c || !q(f), f === 92 ? g : x);
810
+ }
811
+ function g(f) {
812
+ return f === 91 || f === 92 || f === 93 ? (n.consume(f), a++, x) : x(f);
813
+ }
814
+ }
815
+ function ot(n, r, t, e, i, l) {
816
+ let u;
817
+ return a;
818
+ function a(g) {
819
+ return n.enter(e), n.enter(i), n.consume(g), n.exit(i), u = g === 40 ? 41 : g, c;
820
+ }
821
+ function c(g) {
822
+ return g === u ? (n.enter(i), n.consume(g), n.exit(i), n.exit(e), r) : (n.enter(l), p(g));
823
+ }
824
+ function p(g) {
825
+ return g === u ? (n.exit(l), c(u)) : g === null ? t(g) : C(g) ? (n.enter("lineEnding"), n.consume(g), n.exit("lineEnding"), B(n, p, "linePrefix")) : (n.enter("chunkString", {
826
+ contentType: "string"
827
+ }), h(g));
828
+ }
829
+ function h(g) {
830
+ return g === u || g === null || C(g) ? (n.exit("chunkString"), p(g)) : (n.consume(g), g === 92 ? x : h);
831
+ }
832
+ function x(g) {
833
+ return g === u || g === 92 ? (n.consume(g), h) : h(g);
834
+ }
835
+ }
836
+ function dn(n, r) {
837
+ let t;
838
+ return e;
839
+ function e(i) {
840
+ return C(i) ? (n.enter("lineEnding"), n.consume(i), n.exit("lineEnding"), t = !0, e) : q(i) ? B(
841
+ n,
842
+ e,
843
+ t ? "linePrefix" : "lineSuffix"
844
+ )(i) : r(i);
845
+ }
846
+ }
847
+ function fn(n) {
848
+ return n.replace(/[\t\n\r ]+/g, " ").replace(/^ | $/g, "").toLowerCase().toUpperCase();
849
+ }
850
+ const fe = {
851
+ name: "definition",
852
+ tokenize: ge
853
+ }, xe = {
854
+ tokenize: ke,
855
+ partial: !0
856
+ };
857
+ function ge(n, r, t) {
858
+ const e = this;
859
+ let i;
860
+ return l;
861
+ function l(c) {
862
+ return n.enter("definition"), at.call(
863
+ e,
864
+ n,
865
+ u,
866
+ t,
867
+ "definitionLabel",
868
+ "definitionLabelMarker",
869
+ "definitionLabelString"
870
+ )(c);
871
+ }
872
+ function u(c) {
873
+ return i = fn(
874
+ e.sliceSerialize(e.events[e.events.length - 1][1]).slice(1, -1)
875
+ ), c === 58 ? (n.enter("definitionMarker"), n.consume(c), n.exit("definitionMarker"), dn(
876
+ n,
877
+ lt(
878
+ n,
879
+ n.attempt(
880
+ xe,
881
+ B(n, a, "whitespace"),
882
+ B(n, a, "whitespace")
883
+ ),
884
+ t,
885
+ "definitionDestination",
886
+ "definitionDestinationLiteral",
887
+ "definitionDestinationLiteralMarker",
888
+ "definitionDestinationRaw",
889
+ "definitionDestinationString"
890
+ )
891
+ )) : t(c);
892
+ }
893
+ function a(c) {
894
+ return c === null || C(c) ? (n.exit("definition"), e.parser.defined.includes(i) || e.parser.defined.push(i), r(c)) : t(c);
895
+ }
896
+ }
897
+ function ke(n, r, t) {
898
+ return e;
899
+ function e(u) {
900
+ return Y(u) ? dn(n, i)(u) : t(u);
901
+ }
902
+ function i(u) {
903
+ return u === 34 || u === 39 || u === 40 ? ot(
904
+ n,
905
+ B(n, l, "whitespace"),
906
+ t,
907
+ "definitionTitle",
908
+ "definitionTitleMarker",
909
+ "definitionTitleString"
910
+ )(u) : t(u);
911
+ }
912
+ function l(u) {
913
+ return u === null || C(u) ? r(u) : t(u);
914
+ }
915
+ }
916
+ const de = {
917
+ name: "hardBreakEscape",
918
+ tokenize: be
919
+ };
920
+ function be(n, r, t) {
921
+ return e;
922
+ function e(l) {
923
+ return n.enter("hardBreakEscape"), n.enter("escapeMarker"), n.consume(l), i;
924
+ }
925
+ function i(l) {
926
+ return C(l) ? (n.exit("escapeMarker"), n.exit("hardBreakEscape"), r(l)) : t(l);
927
+ }
928
+ }
929
+ const ye = {
930
+ name: "headingAtx",
931
+ tokenize: Fe,
932
+ resolve: Se
933
+ };
934
+ function Se(n, r) {
935
+ let t = n.length - 2, e = 3, i, l;
936
+ return n[e][1].type === "whitespace" && (e += 2), t - 2 > e && n[t][1].type === "whitespace" && (t -= 2), n[t][1].type === "atxHeadingSequence" && (e === t - 1 || t - 4 > e && n[t - 2][1].type === "whitespace") && (t -= e + 1 === t ? 2 : 4), t > e && (i = {
937
+ type: "atxHeadingText",
938
+ start: n[e][1].start,
939
+ end: n[t][1].end
940
+ }, l = {
941
+ type: "chunkText",
942
+ start: n[e][1].start,
943
+ end: n[t][1].end,
944
+ // @ts-expect-error Constants are fine to assign.
945
+ contentType: "text"
946
+ }, en(n, e, t - e + 1, [
947
+ ["enter", i, r],
948
+ ["enter", l, r],
949
+ ["exit", l, r],
950
+ ["exit", i, r]
951
+ ])), n;
952
+ }
953
+ function Fe(n, r, t) {
954
+ const e = this;
955
+ let i = 0;
956
+ return l;
957
+ function l(h) {
958
+ return n.enter("atxHeading"), n.enter("atxHeadingSequence"), u(h);
959
+ }
960
+ function u(h) {
961
+ return h === 35 && i++ < 6 ? (n.consume(h), u) : h === null || Y(h) ? (n.exit("atxHeadingSequence"), e.interrupt ? r(h) : a(h)) : t(h);
962
+ }
963
+ function a(h) {
964
+ return h === 35 ? (n.enter("atxHeadingSequence"), c(h)) : h === null || C(h) ? (n.exit("atxHeading"), r(h)) : q(h) ? B(n, a, "whitespace")(h) : (n.enter("atxHeadingText"), p(h));
965
+ }
966
+ function c(h) {
967
+ return h === 35 ? (n.consume(h), c) : (n.exit("atxHeadingSequence"), a(h));
968
+ }
969
+ function p(h) {
970
+ return h === null || h === 35 || Y(h) ? (n.exit("atxHeadingText"), a(h)) : (n.consume(h), p);
971
+ }
972
+ }
973
+ const we = [
974
+ "address",
975
+ "article",
976
+ "aside",
977
+ "base",
978
+ "basefont",
979
+ "blockquote",
980
+ "body",
981
+ "caption",
982
+ "center",
983
+ "col",
984
+ "colgroup",
985
+ "dd",
986
+ "details",
987
+ "dialog",
988
+ "dir",
989
+ "div",
990
+ "dl",
991
+ "dt",
992
+ "fieldset",
993
+ "figcaption",
994
+ "figure",
995
+ "footer",
996
+ "form",
997
+ "frame",
998
+ "frameset",
999
+ "h1",
1000
+ "h2",
1001
+ "h3",
1002
+ "h4",
1003
+ "h5",
1004
+ "h6",
1005
+ "head",
1006
+ "header",
1007
+ "hr",
1008
+ "html",
1009
+ "iframe",
1010
+ "legend",
1011
+ "li",
1012
+ "link",
1013
+ "main",
1014
+ "menu",
1015
+ "menuitem",
1016
+ "nav",
1017
+ "noframes",
1018
+ "ol",
1019
+ "optgroup",
1020
+ "option",
1021
+ "p",
1022
+ "param",
1023
+ "section",
1024
+ "summary",
1025
+ "table",
1026
+ "tbody",
1027
+ "td",
1028
+ "tfoot",
1029
+ "th",
1030
+ "thead",
1031
+ "title",
1032
+ "tr",
1033
+ "track",
1034
+ "ul"
1035
+ ], Zn = ["pre", "script", "style", "textarea"], Ee = {
1036
+ name: "htmlFlow",
1037
+ tokenize: ze,
1038
+ resolveTo: Ae,
1039
+ concrete: !0
1040
+ }, Ce = {
1041
+ tokenize: Ie,
1042
+ partial: !0
1043
+ };
1044
+ function Ae(n) {
1045
+ let r = n.length;
1046
+ for (; r-- && !(n[r][0] === "enter" && n[r][1].type === "htmlFlow"); )
1047
+ ;
1048
+ return r > 1 && n[r - 2][1].type === "linePrefix" && (n[r][1].start = n[r - 2][1].start, n[r + 1][1].start = n[r - 2][1].start, n.splice(r - 2, 2)), n;
1049
+ }
1050
+ function ze(n, r, t) {
1051
+ const e = this;
1052
+ let i, l, u, a, c;
1053
+ return p;
1054
+ function p(o) {
1055
+ return n.enter("htmlFlow"), n.enter("htmlFlowData"), n.consume(o), h;
1056
+ }
1057
+ function h(o) {
1058
+ return o === 33 ? (n.consume(o), x) : o === 47 ? (n.consume(o), k) : o === 63 ? (n.consume(o), i = 3, e.interrupt ? r : W) : tn(o) ? (n.consume(o), u = String.fromCharCode(o), l = !0, A) : t(o);
1059
+ }
1060
+ function x(o) {
1061
+ return o === 45 ? (n.consume(o), i = 2, g) : o === 91 ? (n.consume(o), i = 5, u = "CDATA[", a = 0, f) : tn(o) ? (n.consume(o), i = 4, e.interrupt ? r : W) : t(o);
1062
+ }
1063
+ function g(o) {
1064
+ return o === 45 ? (n.consume(o), e.interrupt ? r : W) : t(o);
1065
+ }
1066
+ function f(o) {
1067
+ return o === u.charCodeAt(a++) ? (n.consume(o), a === u.length ? e.interrupt ? r : S : f) : t(o);
1068
+ }
1069
+ function k(o) {
1070
+ return tn(o) ? (n.consume(o), u = String.fromCharCode(o), A) : t(o);
1071
+ }
1072
+ function A(o) {
1073
+ return o === null || o === 47 || o === 62 || Y(o) ? o !== 47 && l && Zn.includes(u.toLowerCase()) ? (i = 1, e.interrupt ? r(o) : S(o)) : we.includes(u.toLowerCase()) ? (i = 6, o === 47 ? (n.consume(o), L) : e.interrupt ? r(o) : S(o)) : (i = 7, e.interrupt && !e.parser.lazy[e.now().line] ? t(o) : l ? _(o) : y(o)) : o === 45 || v(o) ? (n.consume(o), u += String.fromCharCode(o), A) : t(o);
1074
+ }
1075
+ function L(o) {
1076
+ return o === 62 ? (n.consume(o), e.interrupt ? r : S) : t(o);
1077
+ }
1078
+ function y(o) {
1079
+ return q(o) ? (n.consume(o), y) : j(o);
1080
+ }
1081
+ function _(o) {
1082
+ return o === 47 ? (n.consume(o), j) : o === 58 || o === 95 || tn(o) ? (n.consume(o), F) : q(o) ? (n.consume(o), _) : j(o);
1083
+ }
1084
+ function F(o) {
1085
+ return o === 45 || o === 46 || o === 58 || o === 95 || v(o) ? (n.consume(o), F) : O(o);
1086
+ }
1087
+ function O(o) {
1088
+ return o === 61 ? (n.consume(o), D) : q(o) ? (n.consume(o), O) : _(o);
1089
+ }
1090
+ function D(o) {
1091
+ return o === null || o === 60 || o === 61 || o === 62 || o === 96 ? t(o) : o === 34 || o === 39 ? (n.consume(o), c = o, d) : q(o) ? (n.consume(o), D) : (c = null, P(o));
1092
+ }
1093
+ function d(o) {
1094
+ return o === null || C(o) ? t(o) : o === c ? (n.consume(o), R) : (n.consume(o), d);
1095
+ }
1096
+ function P(o) {
1097
+ return o === null || o === 34 || o === 39 || o === 60 || o === 61 || o === 62 || o === 96 || Y(o) ? O(o) : (n.consume(o), P);
1098
+ }
1099
+ function R(o) {
1100
+ return o === 47 || o === 62 || q(o) ? _(o) : t(o);
1101
+ }
1102
+ function j(o) {
1103
+ return o === 62 ? (n.consume(o), V) : t(o);
1104
+ }
1105
+ function V(o) {
1106
+ return q(o) ? (n.consume(o), V) : o === null || C(o) ? S(o) : t(o);
1107
+ }
1108
+ function S(o) {
1109
+ return o === 45 && i === 2 ? (n.consume(o), G) : o === 60 && i === 1 ? (n.consume(o), nn) : o === 62 && i === 4 ? (n.consume(o), H) : o === 63 && i === 3 ? (n.consume(o), W) : o === 93 && i === 5 ? (n.consume(o), Q) : C(o) && (i === 6 || i === 7) ? n.check(
1110
+ Ce,
1111
+ H,
1112
+ w
1113
+ )(o) : o === null || C(o) ? w(o) : (n.consume(o), S);
1114
+ }
1115
+ function w(o) {
1116
+ return n.exit("htmlFlowData"), z(o);
1117
+ }
1118
+ function z(o) {
1119
+ return o === null ? s(o) : C(o) ? n.attempt(
1120
+ {
1121
+ tokenize: U,
1122
+ partial: !0
1123
+ },
1124
+ z,
1125
+ s
1126
+ )(o) : (n.enter("htmlFlowData"), S(o));
1127
+ }
1128
+ function U(o, cn, xn) {
1129
+ return hn;
1130
+ function hn(K) {
1131
+ return o.enter("lineEnding"), o.consume(K), o.exit("lineEnding"), N;
1132
+ }
1133
+ function N(K) {
1134
+ return e.parser.lazy[e.now().line] ? xn(K) : cn(K);
1135
+ }
1136
+ }
1137
+ function G(o) {
1138
+ return o === 45 ? (n.consume(o), W) : S(o);
1139
+ }
1140
+ function nn(o) {
1141
+ return o === 47 ? (n.consume(o), u = "", J) : S(o);
1142
+ }
1143
+ function J(o) {
1144
+ return o === 62 && Zn.includes(u.toLowerCase()) ? (n.consume(o), H) : tn(o) && u.length < 8 ? (n.consume(o), u += String.fromCharCode(o), J) : S(o);
1145
+ }
1146
+ function Q(o) {
1147
+ return o === 93 ? (n.consume(o), W) : S(o);
1148
+ }
1149
+ function W(o) {
1150
+ return o === 62 ? (n.consume(o), H) : o === 45 && i === 2 ? (n.consume(o), W) : S(o);
1151
+ }
1152
+ function H(o) {
1153
+ return o === null || C(o) ? (n.exit("htmlFlowData"), s(o)) : (n.consume(o), H);
1154
+ }
1155
+ function s(o) {
1156
+ return n.exit("htmlFlow"), r(o);
1157
+ }
1158
+ }
1159
+ function Ie(n, r, t) {
1160
+ return e;
1161
+ function e(i) {
1162
+ return n.exit("htmlFlowData"), n.enter("lineEndingBlank"), n.consume(i), n.exit("lineEndingBlank"), n.attempt(Sn, r, t);
1163
+ }
1164
+ }
1165
+ const Te = {
1166
+ name: "htmlText",
1167
+ tokenize: Be
1168
+ };
1169
+ function Be(n, r, t) {
1170
+ const e = this;
1171
+ let i, l, u, a;
1172
+ return c;
1173
+ function c(s) {
1174
+ return n.enter("htmlText"), n.enter("htmlTextData"), n.consume(s), p;
1175
+ }
1176
+ function p(s) {
1177
+ return s === 33 ? (n.consume(s), h) : s === 47 ? (n.consume(s), P) : s === 63 ? (n.consume(s), D) : tn(s) ? (n.consume(s), V) : t(s);
1178
+ }
1179
+ function h(s) {
1180
+ return s === 45 ? (n.consume(s), x) : s === 91 ? (n.consume(s), l = "CDATA[", u = 0, L) : tn(s) ? (n.consume(s), O) : t(s);
1181
+ }
1182
+ function x(s) {
1183
+ return s === 45 ? (n.consume(s), g) : t(s);
1184
+ }
1185
+ function g(s) {
1186
+ return s === null || s === 62 ? t(s) : s === 45 ? (n.consume(s), f) : k(s);
1187
+ }
1188
+ function f(s) {
1189
+ return s === null || s === 62 ? t(s) : k(s);
1190
+ }
1191
+ function k(s) {
1192
+ return s === null ? t(s) : s === 45 ? (n.consume(s), A) : C(s) ? (a = k, Q(s)) : (n.consume(s), k);
1193
+ }
1194
+ function A(s) {
1195
+ return s === 45 ? (n.consume(s), H) : k(s);
1196
+ }
1197
+ function L(s) {
1198
+ return s === l.charCodeAt(u++) ? (n.consume(s), u === l.length ? y : L) : t(s);
1199
+ }
1200
+ function y(s) {
1201
+ return s === null ? t(s) : s === 93 ? (n.consume(s), _) : C(s) ? (a = y, Q(s)) : (n.consume(s), y);
1202
+ }
1203
+ function _(s) {
1204
+ return s === 93 ? (n.consume(s), F) : y(s);
1205
+ }
1206
+ function F(s) {
1207
+ return s === 62 ? H(s) : s === 93 ? (n.consume(s), F) : y(s);
1208
+ }
1209
+ function O(s) {
1210
+ return s === null || s === 62 ? H(s) : C(s) ? (a = O, Q(s)) : (n.consume(s), O);
1211
+ }
1212
+ function D(s) {
1213
+ return s === null ? t(s) : s === 63 ? (n.consume(s), d) : C(s) ? (a = D, Q(s)) : (n.consume(s), D);
1214
+ }
1215
+ function d(s) {
1216
+ return s === 62 ? H(s) : D(s);
1217
+ }
1218
+ function P(s) {
1219
+ return tn(s) ? (n.consume(s), R) : t(s);
1220
+ }
1221
+ function R(s) {
1222
+ return s === 45 || v(s) ? (n.consume(s), R) : j(s);
1223
+ }
1224
+ function j(s) {
1225
+ return C(s) ? (a = j, Q(s)) : q(s) ? (n.consume(s), j) : H(s);
1226
+ }
1227
+ function V(s) {
1228
+ return s === 45 || v(s) ? (n.consume(s), V) : s === 47 || s === 62 || Y(s) ? S(s) : t(s);
1229
+ }
1230
+ function S(s) {
1231
+ return s === 47 ? (n.consume(s), H) : s === 58 || s === 95 || tn(s) ? (n.consume(s), w) : C(s) ? (a = S, Q(s)) : q(s) ? (n.consume(s), S) : H(s);
1232
+ }
1233
+ function w(s) {
1234
+ return s === 45 || s === 46 || s === 58 || s === 95 || v(s) ? (n.consume(s), w) : z(s);
1235
+ }
1236
+ function z(s) {
1237
+ return s === 61 ? (n.consume(s), U) : C(s) ? (a = z, Q(s)) : q(s) ? (n.consume(s), z) : S(s);
1238
+ }
1239
+ function U(s) {
1240
+ return s === null || s === 60 || s === 61 || s === 62 || s === 96 ? t(s) : s === 34 || s === 39 ? (n.consume(s), i = s, G) : C(s) ? (a = U, Q(s)) : q(s) ? (n.consume(s), U) : (n.consume(s), i = void 0, J);
1241
+ }
1242
+ function G(s) {
1243
+ return s === i ? (n.consume(s), nn) : s === null ? t(s) : C(s) ? (a = G, Q(s)) : (n.consume(s), G);
1244
+ }
1245
+ function nn(s) {
1246
+ return s === 62 || s === 47 || Y(s) ? S(s) : t(s);
1247
+ }
1248
+ function J(s) {
1249
+ return s === null || s === 34 || s === 39 || s === 60 || s === 61 || s === 96 ? t(s) : s === 62 || Y(s) ? S(s) : (n.consume(s), J);
1250
+ }
1251
+ function Q(s) {
1252
+ return n.exit("htmlTextData"), n.enter("lineEnding"), n.consume(s), n.exit("lineEnding"), B(
1253
+ n,
1254
+ W,
1255
+ "linePrefix",
1256
+ e.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4
1257
+ );
1258
+ }
1259
+ function W(s) {
1260
+ return n.enter("htmlTextData"), a(s);
1261
+ }
1262
+ function H(s) {
1263
+ return s === 62 ? (n.consume(s), n.exit("htmlTextData"), n.exit("htmlText"), r) : t(s);
1264
+ }
1265
+ }
1266
+ const On = {
1267
+ name: "labelEnd",
1268
+ tokenize: Me,
1269
+ resolveTo: _e,
1270
+ resolveAll: Pe
1271
+ }, Le = {
1272
+ tokenize: Re
1273
+ }, Oe = {
1274
+ tokenize: je
1275
+ }, De = {
1276
+ tokenize: qe
1277
+ };
1278
+ function Pe(n) {
1279
+ let r = -1, t;
1280
+ for (; ++r < n.length; )
1281
+ t = n[r][1], (t.type === "labelImage" || t.type === "labelLink" || t.type === "labelEnd") && (n.splice(r + 1, t.type === "labelImage" ? 4 : 2), t.type = "data", r++);
1282
+ return n;
1283
+ }
1284
+ function _e(n, r) {
1285
+ let t = n.length, e = 0, i, l, u, a;
1286
+ for (; t--; )
1287
+ if (i = n[t][1], l) {
1288
+ if (i.type === "link" || i.type === "labelLink" && i._inactive)
1289
+ break;
1290
+ n[t][0] === "enter" && i.type === "labelLink" && (i._inactive = !0);
1291
+ } else if (u) {
1292
+ if (n[t][0] === "enter" && (i.type === "labelImage" || i.type === "labelLink") && !i._balanced && (l = t, i.type !== "labelLink")) {
1293
+ e = 2;
1294
+ break;
1295
+ }
1296
+ } else
1297
+ i.type === "labelEnd" && (u = t);
1298
+ const c = {
1299
+ type: n[l][1].type === "labelLink" ? "link" : "image",
1300
+ start: Object.assign({}, n[l][1].start),
1301
+ end: Object.assign({}, n[n.length - 1][1].end)
1302
+ }, p = {
1303
+ type: "label",
1304
+ start: Object.assign({}, n[l][1].start),
1305
+ end: Object.assign({}, n[u][1].end)
1306
+ }, h = {
1307
+ type: "labelText",
1308
+ start: Object.assign({}, n[l + e + 2][1].end),
1309
+ end: Object.assign({}, n[u - 2][1].start)
1310
+ };
1311
+ return a = [
1312
+ ["enter", c, r],
1313
+ ["enter", p, r]
1314
+ ], a = Z(a, n.slice(l + 1, l + e + 3)), a = Z(a, [["enter", h, r]]), a = Z(
1315
+ a,
1316
+ Bn(
1317
+ r.parser.constructs.insideSpan.null,
1318
+ n.slice(l + e + 4, u - 3),
1319
+ r
1320
+ )
1321
+ ), a = Z(a, [
1322
+ ["exit", h, r],
1323
+ n[u - 2],
1324
+ n[u - 1],
1325
+ ["exit", p, r]
1326
+ ]), a = Z(a, n.slice(u + 1)), a = Z(a, [["exit", c, r]]), en(n, l, n.length, a), n;
1327
+ }
1328
+ function Me(n, r, t) {
1329
+ const e = this;
1330
+ let i = e.events.length, l, u;
1331
+ for (; i--; )
1332
+ if ((e.events[i][1].type === "labelImage" || e.events[i][1].type === "labelLink") && !e.events[i][1]._balanced) {
1333
+ l = e.events[i][1];
1334
+ break;
1335
+ }
1336
+ return a;
1337
+ function a(h) {
1338
+ return l ? l._inactive ? p(h) : (u = e.parser.defined.includes(
1339
+ fn(
1340
+ e.sliceSerialize({
1341
+ start: l.end,
1342
+ end: e.now()
1343
+ })
1344
+ )
1345
+ ), n.enter("labelEnd"), n.enter("labelMarker"), n.consume(h), n.exit("labelMarker"), n.exit("labelEnd"), c) : t(h);
1346
+ }
1347
+ function c(h) {
1348
+ return h === 40 ? n.attempt(
1349
+ Le,
1350
+ r,
1351
+ u ? r : p
1352
+ )(h) : h === 91 ? n.attempt(
1353
+ Oe,
1354
+ r,
1355
+ u ? n.attempt(De, r, p) : p
1356
+ )(h) : u ? r(h) : p(h);
1357
+ }
1358
+ function p(h) {
1359
+ return l._balanced = !0, t(h);
1360
+ }
1361
+ }
1362
+ function Re(n, r, t) {
1363
+ return e;
1364
+ function e(c) {
1365
+ return n.enter("resource"), n.enter("resourceMarker"), n.consume(c), n.exit("resourceMarker"), dn(n, i);
1366
+ }
1367
+ function i(c) {
1368
+ return c === 41 ? a(c) : lt(
1369
+ n,
1370
+ l,
1371
+ t,
1372
+ "resourceDestination",
1373
+ "resourceDestinationLiteral",
1374
+ "resourceDestinationLiteralMarker",
1375
+ "resourceDestinationRaw",
1376
+ "resourceDestinationString",
1377
+ 32
1378
+ )(c);
1379
+ }
1380
+ function l(c) {
1381
+ return Y(c) ? dn(n, u)(c) : a(c);
1382
+ }
1383
+ function u(c) {
1384
+ return c === 34 || c === 39 || c === 40 ? ot(
1385
+ n,
1386
+ dn(n, a),
1387
+ t,
1388
+ "resourceTitle",
1389
+ "resourceTitleMarker",
1390
+ "resourceTitleString"
1391
+ )(c) : a(c);
1392
+ }
1393
+ function a(c) {
1394
+ return c === 41 ? (n.enter("resourceMarker"), n.consume(c), n.exit("resourceMarker"), n.exit("resource"), r) : t(c);
1395
+ }
1396
+ }
1397
+ function je(n, r, t) {
1398
+ const e = this;
1399
+ return i;
1400
+ function i(u) {
1401
+ return at.call(
1402
+ e,
1403
+ n,
1404
+ l,
1405
+ t,
1406
+ "reference",
1407
+ "referenceMarker",
1408
+ "referenceString"
1409
+ )(u);
1410
+ }
1411
+ function l(u) {
1412
+ return e.parser.defined.includes(
1413
+ fn(
1414
+ e.sliceSerialize(e.events[e.events.length - 1][1]).slice(1, -1)
1415
+ )
1416
+ ) ? r(u) : t(u);
1417
+ }
1418
+ }
1419
+ function qe(n, r, t) {
1420
+ return e;
1421
+ function e(l) {
1422
+ return n.enter("reference"), n.enter("referenceMarker"), n.consume(l), n.exit("referenceMarker"), i;
1423
+ }
1424
+ function i(l) {
1425
+ return l === 93 ? (n.enter("referenceMarker"), n.consume(l), n.exit("referenceMarker"), n.exit("reference"), r) : t(l);
1426
+ }
1427
+ }
1428
+ const He = {
1429
+ name: "labelStartImage",
1430
+ tokenize: Ne,
1431
+ resolveAll: On.resolveAll
1432
+ };
1433
+ function Ne(n, r, t) {
1434
+ const e = this;
1435
+ return i;
1436
+ function i(a) {
1437
+ return n.enter("labelImage"), n.enter("labelImageMarker"), n.consume(a), n.exit("labelImageMarker"), l;
1438
+ }
1439
+ function l(a) {
1440
+ return a === 91 ? (n.enter("labelMarker"), n.consume(a), n.exit("labelMarker"), n.exit("labelImage"), u) : t(a);
1441
+ }
1442
+ function u(a) {
1443
+ return a === 94 && "_hiddenFootnoteSupport" in e.parser.constructs ? t(a) : r(a);
1444
+ }
1445
+ }
1446
+ const Ve = {
1447
+ name: "labelStartLink",
1448
+ tokenize: Qe,
1449
+ resolveAll: On.resolveAll
1450
+ };
1451
+ function Qe(n, r, t) {
1452
+ const e = this;
1453
+ return i;
1454
+ function i(u) {
1455
+ return n.enter("labelLink"), n.enter("labelMarker"), n.consume(u), n.exit("labelMarker"), n.exit("labelLink"), l;
1456
+ }
1457
+ function l(u) {
1458
+ return u === 94 && "_hiddenFootnoteSupport" in e.parser.constructs ? t(u) : r(u);
1459
+ }
1460
+ }
1461
+ const Cn = {
1462
+ name: "lineEnding",
1463
+ tokenize: Ue
1464
+ };
1465
+ function Ue(n, r) {
1466
+ return t;
1467
+ function t(e) {
1468
+ return n.enter("lineEnding"), n.consume(e), n.exit("lineEnding"), B(n, r, "linePrefix");
1469
+ }
1470
+ }
1471
+ const bn = {
1472
+ name: "thematicBreak",
1473
+ tokenize: We
1474
+ };
1475
+ function We(n, r, t) {
1476
+ let e = 0, i;
1477
+ return l;
1478
+ function l(c) {
1479
+ return n.enter("thematicBreak"), i = c, u(c);
1480
+ }
1481
+ function u(c) {
1482
+ return c === i ? (n.enter("thematicBreakSequence"), a(c)) : q(c) ? B(n, u, "whitespace")(c) : e < 3 || c !== null && !C(c) ? t(c) : (n.exit("thematicBreak"), r(c));
1483
+ }
1484
+ function a(c) {
1485
+ return c === i ? (n.consume(c), e++, a) : (n.exit("thematicBreakSequence"), u(c));
1486
+ }
1487
+ }
1488
+ const $ = {
1489
+ name: "list",
1490
+ tokenize: Ye,
1491
+ continuation: {
1492
+ tokenize: Ge
1493
+ },
1494
+ exit: Ke
1495
+ }, $e = {
1496
+ tokenize: Xe,
1497
+ partial: !0
1498
+ }, Ze = {
1499
+ tokenize: Je,
1500
+ partial: !0
1501
+ };
1502
+ function Ye(n, r, t) {
1503
+ const e = this, i = e.events[e.events.length - 1];
1504
+ let l = i && i[1].type === "linePrefix" ? i[2].sliceSerialize(i[1], !0).length : 0, u = 0;
1505
+ return a;
1506
+ function a(f) {
1507
+ const k = e.containerState.type || (f === 42 || f === 43 || f === 45 ? "listUnordered" : "listOrdered");
1508
+ if (k === "listUnordered" ? !e.containerState.marker || f === e.containerState.marker : An(f)) {
1509
+ if (e.containerState.type || (e.containerState.type = k, n.enter(k, {
1510
+ _container: !0
1511
+ })), k === "listUnordered")
1512
+ return n.enter("listItemPrefix"), f === 42 || f === 45 ? n.check(bn, t, p)(f) : p(f);
1513
+ if (!e.interrupt || f === 49)
1514
+ return n.enter("listItemPrefix"), n.enter("listItemValue"), c(f);
1515
+ }
1516
+ return t(f);
1517
+ }
1518
+ function c(f) {
1519
+ return An(f) && ++u < 10 ? (n.consume(f), c) : (!e.interrupt || u < 2) && (e.containerState.marker ? f === e.containerState.marker : f === 41 || f === 46) ? (n.exit("listItemValue"), p(f)) : t(f);
1520
+ }
1521
+ function p(f) {
1522
+ return n.enter("listItemMarker"), n.consume(f), n.exit("listItemMarker"), e.containerState.marker = e.containerState.marker || f, n.check(
1523
+ Sn,
1524
+ // Can’t be empty when interrupting.
1525
+ e.interrupt ? t : h,
1526
+ n.attempt(
1527
+ $e,
1528
+ g,
1529
+ x
1530
+ )
1531
+ );
1532
+ }
1533
+ function h(f) {
1534
+ return e.containerState.initialBlankLine = !0, l++, g(f);
1535
+ }
1536
+ function x(f) {
1537
+ return q(f) ? (n.enter("listItemPrefixWhitespace"), n.consume(f), n.exit("listItemPrefixWhitespace"), g) : t(f);
1538
+ }
1539
+ function g(f) {
1540
+ return e.containerState.size = l + e.sliceSerialize(n.exit("listItemPrefix"), !0).length, r(f);
1541
+ }
1542
+ }
1543
+ function Ge(n, r, t) {
1544
+ const e = this;
1545
+ return e.containerState._closeFlow = void 0, n.check(Sn, i, l);
1546
+ function i(a) {
1547
+ return e.containerState.furtherBlankLines = e.containerState.furtherBlankLines || e.containerState.initialBlankLine, B(
1548
+ n,
1549
+ r,
1550
+ "listItemIndent",
1551
+ e.containerState.size + 1
1552
+ )(a);
1553
+ }
1554
+ function l(a) {
1555
+ return e.containerState.furtherBlankLines || !q(a) ? (e.containerState.furtherBlankLines = void 0, e.containerState.initialBlankLine = void 0, u(a)) : (e.containerState.furtherBlankLines = void 0, e.containerState.initialBlankLine = void 0, n.attempt(Ze, r, u)(a));
1556
+ }
1557
+ function u(a) {
1558
+ return e.containerState._closeFlow = !0, e.interrupt = void 0, B(
1559
+ n,
1560
+ n.attempt($, r, t),
1561
+ "linePrefix",
1562
+ e.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4
1563
+ )(a);
1564
+ }
1565
+ }
1566
+ function Je(n, r, t) {
1567
+ const e = this;
1568
+ return B(
1569
+ n,
1570
+ i,
1571
+ "listItemIndent",
1572
+ e.containerState.size + 1
1573
+ );
1574
+ function i(l) {
1575
+ const u = e.events[e.events.length - 1];
1576
+ return u && u[1].type === "listItemIndent" && u[2].sliceSerialize(u[1], !0).length === e.containerState.size ? r(l) : t(l);
1577
+ }
1578
+ }
1579
+ function Ke(n) {
1580
+ n.exit(this.containerState.type);
1581
+ }
1582
+ function Xe(n, r, t) {
1583
+ const e = this;
1584
+ return B(
1585
+ n,
1586
+ i,
1587
+ "listItemPrefixWhitespace",
1588
+ e.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4 + 1
1589
+ );
1590
+ function i(l) {
1591
+ const u = e.events[e.events.length - 1];
1592
+ return !q(l) && u && u[1].type === "listItemPrefixWhitespace" ? r(l) : t(l);
1593
+ }
1594
+ }
1595
+ const Yn = {
1596
+ name: "setextUnderline",
1597
+ tokenize: nr,
1598
+ resolveTo: ve
1599
+ };
1600
+ function ve(n, r) {
1601
+ let t = n.length, e, i, l;
1602
+ for (; t--; )
1603
+ if (n[t][0] === "enter") {
1604
+ if (n[t][1].type === "content") {
1605
+ e = t;
1606
+ break;
1607
+ }
1608
+ n[t][1].type === "paragraph" && (i = t);
1609
+ } else
1610
+ n[t][1].type === "content" && n.splice(t, 1), !l && n[t][1].type === "definition" && (l = t);
1611
+ const u = {
1612
+ type: "setextHeading",
1613
+ start: Object.assign({}, n[i][1].start),
1614
+ end: Object.assign({}, n[n.length - 1][1].end)
1615
+ };
1616
+ return n[i][1].type = "setextHeadingText", l ? (n.splice(i, 0, ["enter", u, r]), n.splice(l + 1, 0, ["exit", n[e][1], r]), n[e][1].end = Object.assign({}, n[l][1].end)) : n[e][1] = u, n.push(["exit", u, r]), n;
1617
+ }
1618
+ function nr(n, r, t) {
1619
+ const e = this;
1620
+ let i = e.events.length, l, u;
1621
+ for (; i--; )
1622
+ if (e.events[i][1].type !== "lineEnding" && e.events[i][1].type !== "linePrefix" && e.events[i][1].type !== "content") {
1623
+ u = e.events[i][1].type === "paragraph";
1624
+ break;
1625
+ }
1626
+ return a;
1627
+ function a(h) {
1628
+ return !e.parser.lazy[e.now().line] && (e.interrupt || u) ? (n.enter("setextHeadingLine"), n.enter("setextHeadingLineSequence"), l = h, c(h)) : t(h);
1629
+ }
1630
+ function c(h) {
1631
+ return h === l ? (n.consume(h), c) : (n.exit("setextHeadingLineSequence"), B(n, p, "lineSuffix")(h));
1632
+ }
1633
+ function p(h) {
1634
+ return h === null || C(h) ? (n.exit("setextHeadingLine"), r(h)) : t(h);
1635
+ }
1636
+ }
1637
+ const tr = {
1638
+ tokenize: er
1639
+ };
1640
+ function er(n) {
1641
+ const r = this, t = n.attempt(
1642
+ // Try to parse a blank line.
1643
+ Sn,
1644
+ e,
1645
+ // Try to parse initial flow (essentially, only code).
1646
+ n.attempt(
1647
+ this.parser.constructs.flowInitial,
1648
+ i,
1649
+ B(
1650
+ n,
1651
+ n.attempt(
1652
+ this.parser.constructs.flow,
1653
+ i,
1654
+ n.attempt(se, i)
1655
+ ),
1656
+ "linePrefix"
1657
+ )
1658
+ )
1659
+ );
1660
+ return t;
1661
+ function e(l) {
1662
+ if (l === null) {
1663
+ n.consume(l);
1664
+ return;
1665
+ }
1666
+ return n.enter("lineEndingBlank"), n.consume(l), n.exit("lineEndingBlank"), r.currentConstruct = void 0, t;
1667
+ }
1668
+ function i(l) {
1669
+ if (l === null) {
1670
+ n.consume(l);
1671
+ return;
1672
+ }
1673
+ return n.enter("lineEnding"), n.consume(l), n.exit("lineEnding"), r.currentConstruct = void 0, t;
1674
+ }
1675
+ }
1676
+ const rr = {
1677
+ resolveAll: ct()
1678
+ }, ir = st("string"), ur = st("text");
1679
+ function st(n) {
1680
+ return {
1681
+ tokenize: r,
1682
+ resolveAll: ct(
1683
+ n === "text" ? lr : void 0
1684
+ )
1685
+ };
1686
+ function r(t) {
1687
+ const e = this, i = this.parser.constructs[n], l = t.attempt(i, u, a);
1688
+ return u;
1689
+ function u(h) {
1690
+ return p(h) ? l(h) : a(h);
1691
+ }
1692
+ function a(h) {
1693
+ if (h === null) {
1694
+ t.consume(h);
1695
+ return;
1696
+ }
1697
+ return t.enter("data"), t.consume(h), c;
1698
+ }
1699
+ function c(h) {
1700
+ return p(h) ? (t.exit("data"), l(h)) : (t.consume(h), c);
1701
+ }
1702
+ function p(h) {
1703
+ if (h === null)
1704
+ return !0;
1705
+ const x = i[h];
1706
+ let g = -1;
1707
+ if (x)
1708
+ for (; ++g < x.length; ) {
1709
+ const f = x[g];
1710
+ if (!f.previous || f.previous.call(e, e.previous))
1711
+ return !0;
1712
+ }
1713
+ return !1;
1714
+ }
1715
+ }
1716
+ }
1717
+ function ct(n) {
1718
+ return r;
1719
+ function r(t, e) {
1720
+ let i = -1, l;
1721
+ for (; ++i <= t.length; )
1722
+ l === void 0 ? t[i] && t[i][1].type === "data" && (l = i, i++) : (!t[i] || t[i][1].type !== "data") && (i !== l + 2 && (t[l][1].end = t[i - 1][1].end, t.splice(l + 2, i - l - 2), i = l + 2), l = void 0);
1723
+ return n ? n(t, e) : t;
1724
+ }
1725
+ }
1726
+ function lr(n, r) {
1727
+ let t = 0;
1728
+ for (; ++t <= n.length; )
1729
+ if ((t === n.length || n[t][1].type === "lineEnding") && n[t - 1][1].type === "data") {
1730
+ const e = n[t - 1][1], i = r.sliceStream(e);
1731
+ let l = i.length, u = -1, a = 0, c;
1732
+ for (; l--; ) {
1733
+ const p = i[l];
1734
+ if (typeof p == "string") {
1735
+ for (u = p.length; p.charCodeAt(u - 1) === 32; )
1736
+ a++, u--;
1737
+ if (u)
1738
+ break;
1739
+ u = -1;
1740
+ } else if (p === -2)
1741
+ c = !0, a++;
1742
+ else if (p !== -1) {
1743
+ l++;
1744
+ break;
1745
+ }
1746
+ }
1747
+ if (a) {
1748
+ const p = {
1749
+ type: t === n.length || c || a < 2 ? "lineSuffix" : "hardBreakTrailing",
1750
+ start: {
1751
+ line: e.end.line,
1752
+ column: e.end.column - a,
1753
+ offset: e.end.offset - a,
1754
+ _index: e.start._index + l,
1755
+ _bufferIndex: l ? u : e.start._bufferIndex + u
1756
+ },
1757
+ end: Object.assign({}, e.end)
1758
+ };
1759
+ e.end = Object.assign({}, p.start), e.start.offset === e.end.offset ? Object.assign(e, p) : (n.splice(
1760
+ t,
1761
+ 0,
1762
+ ["enter", p, r],
1763
+ ["exit", p, r]
1764
+ ), t += 2);
1765
+ }
1766
+ t++;
1767
+ }
1768
+ return n;
1769
+ }
1770
+ function ar(n, r, t) {
1771
+ let e = Object.assign(
1772
+ t ? Object.assign({}, t) : {
1773
+ line: 1,
1774
+ column: 1,
1775
+ offset: 0
1776
+ },
1777
+ {
1778
+ _index: 0,
1779
+ _bufferIndex: -1
1780
+ }
1781
+ );
1782
+ const i = {}, l = [];
1783
+ let u = [], a = [];
1784
+ const c = {
1785
+ consume: _,
1786
+ enter: F,
1787
+ exit: O,
1788
+ attempt: P(D),
1789
+ check: P(d),
1790
+ interrupt: P(d, {
1791
+ interrupt: !0
1792
+ })
1793
+ }, p = {
1794
+ previous: null,
1795
+ code: null,
1796
+ containerState: {},
1797
+ events: [],
1798
+ parser: n,
1799
+ sliceStream: f,
1800
+ sliceSerialize: g,
1801
+ now: k,
1802
+ defineSkip: A,
1803
+ write: x
1804
+ };
1805
+ let h = r.tokenize.call(p, c);
1806
+ return r.resolveAll && l.push(r), p;
1807
+ function x(S) {
1808
+ return u = Z(u, S), L(), u[u.length - 1] !== null ? [] : (R(r, 0), p.events = Bn(l, p.events, p), p.events);
1809
+ }
1810
+ function g(S, w) {
1811
+ return sr(f(S), w);
1812
+ }
1813
+ function f(S) {
1814
+ return or(u, S);
1815
+ }
1816
+ function k() {
1817
+ return Object.assign({}, e);
1818
+ }
1819
+ function A(S) {
1820
+ i[S.line] = S.column, V();
1821
+ }
1822
+ function L() {
1823
+ let S;
1824
+ for (; e._index < u.length; ) {
1825
+ const w = u[e._index];
1826
+ if (typeof w == "string")
1827
+ for (S = e._index, e._bufferIndex < 0 && (e._bufferIndex = 0); e._index === S && e._bufferIndex < w.length; )
1828
+ y(w.charCodeAt(e._bufferIndex));
1829
+ else
1830
+ y(w);
1831
+ }
1832
+ }
1833
+ function y(S) {
1834
+ h = h(S);
1835
+ }
1836
+ function _(S) {
1837
+ C(S) ? (e.line++, e.column = 1, e.offset += S === -3 ? 2 : 1, V()) : S !== -1 && (e.column++, e.offset++), e._bufferIndex < 0 ? e._index++ : (e._bufferIndex++, e._bufferIndex === u[e._index].length && (e._bufferIndex = -1, e._index++)), p.previous = S;
1838
+ }
1839
+ function F(S, w) {
1840
+ const z = w || {};
1841
+ return z.type = S, z.start = k(), p.events.push(["enter", z, p]), a.push(z), z;
1842
+ }
1843
+ function O(S) {
1844
+ const w = a.pop();
1845
+ return w.end = k(), p.events.push(["exit", w, p]), w;
1846
+ }
1847
+ function D(S, w) {
1848
+ R(S, w.from);
1849
+ }
1850
+ function d(S, w) {
1851
+ w.restore();
1852
+ }
1853
+ function P(S, w) {
1854
+ return z;
1855
+ function z(U, G, nn) {
1856
+ let J, Q, W, H;
1857
+ return Array.isArray(U) ? (
1858
+ /* c8 ignore next 1 */
1859
+ o(U)
1860
+ ) : "tokenize" in U ? o([U]) : s(U);
1861
+ function s(N) {
1862
+ return K;
1863
+ function K(ln) {
1864
+ const pn = ln !== null && N[ln], mn = ln !== null && N.null, Fn = [
1865
+ // To do: add more extension tests.
1866
+ /* c8 ignore next 2 */
1867
+ ...Array.isArray(pn) ? pn : pn ? [pn] : [],
1868
+ ...Array.isArray(mn) ? mn : mn ? [mn] : []
1869
+ ];
1870
+ return o(Fn)(ln);
1871
+ }
1872
+ }
1873
+ function o(N) {
1874
+ return J = N, Q = 0, N.length === 0 ? nn : cn(N[Q]);
1875
+ }
1876
+ function cn(N) {
1877
+ return K;
1878
+ function K(ln) {
1879
+ return H = j(), W = N, N.partial || (p.currentConstruct = N), N.name && p.parser.constructs.disable.null.includes(N.name) ? hn() : N.tokenize.call(
1880
+ // If we do have fields, create an object w/ `context` as its
1881
+ // prototype.
1882
+ // This allows a “live binding”, which is needed for `interrupt`.
1883
+ w ? Object.assign(Object.create(p), w) : p,
1884
+ c,
1885
+ xn,
1886
+ hn
1887
+ )(ln);
1888
+ }
1889
+ }
1890
+ function xn(N) {
1891
+ return S(W, H), G;
1892
+ }
1893
+ function hn(N) {
1894
+ return H.restore(), ++Q < J.length ? cn(J[Q]) : nn;
1895
+ }
1896
+ }
1897
+ }
1898
+ function R(S, w) {
1899
+ S.resolveAll && !l.includes(S) && l.push(S), S.resolve && en(
1900
+ p.events,
1901
+ w,
1902
+ p.events.length - w,
1903
+ S.resolve(p.events.slice(w), p)
1904
+ ), S.resolveTo && (p.events = S.resolveTo(p.events, p));
1905
+ }
1906
+ function j() {
1907
+ const S = k(), w = p.previous, z = p.currentConstruct, U = p.events.length, G = Array.from(a);
1908
+ return {
1909
+ restore: nn,
1910
+ from: U
1911
+ };
1912
+ function nn() {
1913
+ e = S, p.previous = w, p.currentConstruct = z, p.events.length = U, a = G, V();
1914
+ }
1915
+ }
1916
+ function V() {
1917
+ e.line in i && e.column < 2 && (e.column = i[e.line], e.offset += i[e.line] - 1);
1918
+ }
1919
+ }
1920
+ function or(n, r) {
1921
+ const t = r.start._index, e = r.start._bufferIndex, i = r.end._index, l = r.end._bufferIndex;
1922
+ let u;
1923
+ return t === i ? u = [n[t].slice(e, l)] : (u = n.slice(t, i), e > -1 && (u[0] = u[0].slice(e)), l > 0 && u.push(n[i].slice(0, l))), u;
1924
+ }
1925
+ function sr(n, r) {
1926
+ let t = -1;
1927
+ const e = [];
1928
+ let i;
1929
+ for (; ++t < n.length; ) {
1930
+ const l = n[t];
1931
+ let u;
1932
+ if (typeof l == "string")
1933
+ u = l;
1934
+ else
1935
+ switch (l) {
1936
+ case -5: {
1937
+ u = "\r";
1938
+ break;
1939
+ }
1940
+ case -4: {
1941
+ u = `
1942
+ `;
1943
+ break;
1944
+ }
1945
+ case -3: {
1946
+ u = `\r
1947
+ `;
1948
+ break;
1949
+ }
1950
+ case -2: {
1951
+ u = r ? " " : " ";
1952
+ break;
1953
+ }
1954
+ case -1: {
1955
+ if (!r && i)
1956
+ continue;
1957
+ u = " ";
1958
+ break;
1959
+ }
1960
+ default:
1961
+ u = String.fromCharCode(l);
1962
+ }
1963
+ i = l === -2, e.push(u);
1964
+ }
1965
+ return e.join("");
1966
+ }
1967
+ const cr = {
1968
+ [42]: $,
1969
+ [43]: $,
1970
+ [45]: $,
1971
+ [48]: $,
1972
+ [49]: $,
1973
+ [50]: $,
1974
+ [51]: $,
1975
+ [52]: $,
1976
+ [53]: $,
1977
+ [54]: $,
1978
+ [55]: $,
1979
+ [56]: $,
1980
+ [57]: $,
1981
+ [62]: et
1982
+ }, hr = {
1983
+ [91]: fe
1984
+ }, pr = {
1985
+ [-2]: En,
1986
+ [-1]: En,
1987
+ [32]: En
1988
+ }, mr = {
1989
+ [35]: ye,
1990
+ [42]: bn,
1991
+ [45]: [Yn, bn],
1992
+ [60]: Ee,
1993
+ [61]: Yn,
1994
+ [95]: bn,
1995
+ [96]: $n,
1996
+ [126]: $n
1997
+ }, fr = {
1998
+ [38]: it,
1999
+ [92]: rt
2000
+ }, xr = {
2001
+ [-5]: Cn,
2002
+ [-4]: Cn,
2003
+ [-3]: Cn,
2004
+ [33]: He,
2005
+ [38]: it,
2006
+ [42]: In,
2007
+ [60]: [$t, Te],
2008
+ [91]: Ve,
2009
+ [92]: [de, rt],
2010
+ [93]: On,
2011
+ [95]: In,
2012
+ [96]: ie
2013
+ }, gr = {
2014
+ null: [In, rr]
2015
+ }, kr = {
2016
+ null: [42, 95]
2017
+ }, dr = {
2018
+ null: []
2019
+ }, br = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2020
+ __proto__: null,
2021
+ attentionMarkers: kr,
2022
+ contentInitial: hr,
2023
+ disable: dr,
2024
+ document: cr,
2025
+ flow: mr,
2026
+ flowInitial: pr,
2027
+ insideSpan: gr,
2028
+ string: fr,
2029
+ text: xr
2030
+ }, Symbol.toStringTag, { value: "Module" }));
2031
+ function yr(n = {}) {
2032
+ const r = Lt(
2033
+ // @ts-expect-error Same as above.
2034
+ [br].concat(n.extensions || [])
2035
+ ), t = {
2036
+ defined: [],
2037
+ lazy: {},
2038
+ constructs: r,
2039
+ content: e(qt),
2040
+ document: e(Nt),
2041
+ flow: e(tr),
2042
+ string: e(ir),
2043
+ text: e(ur)
2044
+ };
2045
+ return t;
2046
+ function e(i) {
2047
+ return l;
2048
+ function l(u) {
2049
+ return ar(t, i, u);
2050
+ }
2051
+ }
2052
+ }
2053
+ const Gn = /[\0\t\n\r]/g;
2054
+ function Sr() {
2055
+ let n = 1, r = "", t = !0, e;
2056
+ return i;
2057
+ function i(l, u, a) {
2058
+ const c = [];
2059
+ let p, h, x, g, f;
2060
+ for (l = r + l.toString(u), x = 0, r = "", t && (l.charCodeAt(0) === 65279 && x++, t = void 0); x < l.length; ) {
2061
+ if (Gn.lastIndex = x, p = Gn.exec(l), g = p && p.index !== void 0 ? p.index : l.length, f = l.charCodeAt(g), !p) {
2062
+ r = l.slice(x);
2063
+ break;
2064
+ }
2065
+ if (f === 10 && x === g && e)
2066
+ c.push(-3), e = void 0;
2067
+ else
2068
+ switch (e && (c.push(-5), e = void 0), x < g && (c.push(l.slice(x, g)), n += g - x), f) {
2069
+ case 0: {
2070
+ c.push(65533), n++;
2071
+ break;
2072
+ }
2073
+ case 9: {
2074
+ for (h = Math.ceil(n / 4) * 4, c.push(-2); n++ < h; )
2075
+ c.push(-1);
2076
+ break;
2077
+ }
2078
+ case 10: {
2079
+ c.push(-4), n = 1;
2080
+ break;
2081
+ }
2082
+ default:
2083
+ e = !0, n = 1;
2084
+ }
2085
+ x = g + 1;
2086
+ }
2087
+ return a && (e && c.push(-5), r && c.push(r), c.push(null)), c;
2088
+ }
2089
+ }
2090
+ function Fr(n) {
2091
+ for (; !ut(n); )
2092
+ ;
2093
+ return n;
2094
+ }
2095
+ function ht(n, r) {
2096
+ const t = Number.parseInt(n, r);
2097
+ return (
2098
+ // C0 except for HT, LF, FF, CR, space
2099
+ t < 9 || t === 11 || t > 13 && t < 32 || // Control character (DEL) of the basic block and C1 controls.
2100
+ t > 126 && t < 160 || // Lone high surrogates and low surrogates.
2101
+ t > 55295 && t < 57344 || // Noncharacters.
2102
+ t > 64975 && t < 65008 || (t & 65535) === 65535 || (t & 65535) === 65534 || // Out of range
2103
+ t > 1114111 ? "�" : String.fromCharCode(t)
2104
+ );
2105
+ }
2106
+ const wr = /\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;
2107
+ function Er(n) {
2108
+ return n.replace(wr, Cr);
2109
+ }
2110
+ function Cr(n, r, t) {
2111
+ if (r)
2112
+ return r;
2113
+ if (t.charCodeAt(0) === 35) {
2114
+ const i = t.charCodeAt(1), l = i === 120 || i === 88;
2115
+ return ht(t.slice(l ? 2 : 1), l ? 16 : 10);
2116
+ }
2117
+ return Ln(t) || n;
2118
+ }
2119
+ function yn(n) {
2120
+ return !n || typeof n != "object" ? "" : "position" in n || "type" in n ? Jn(n.position) : "start" in n || "end" in n ? Jn(n) : "line" in n || "column" in n ? Tn(n) : "";
2121
+ }
2122
+ function Tn(n) {
2123
+ return Kn(n && n.line) + ":" + Kn(n && n.column);
2124
+ }
2125
+ function Jn(n) {
2126
+ return Tn(n && n.start) + "-" + Tn(n && n.end);
2127
+ }
2128
+ function Kn(n) {
2129
+ return n && typeof n == "number" ? n : 1;
2130
+ }
2131
+ const pt = {}.hasOwnProperty, mt = (
2132
+ /**
2133
+ * @type {(
2134
+ * ((value: Value, encoding: Encoding, options?: Options | null | undefined) => Root) &
2135
+ * ((value: Value, options?: Options | null | undefined) => Root)
2136
+ * )}
2137
+ */
2138
+ /**
2139
+ * @param {Value} value
2140
+ * @param {Encoding | Options | null | undefined} [encoding]
2141
+ * @param {Options | null | undefined} [options]
2142
+ * @returns {Root}
2143
+ */
2144
+ function(n, r, t) {
2145
+ return typeof r != "string" && (t = r, r = void 0), Ar(t)(
2146
+ Fr(
2147
+ // @ts-expect-error: micromark types need to accept `null`.
2148
+ yr(t).document().write(Sr()(n, r, !0))
2149
+ )
2150
+ );
2151
+ }
2152
+ );
2153
+ function Ar(n) {
2154
+ const r = {
2155
+ transforms: [],
2156
+ canContainEols: ["emphasis", "fragment", "heading", "paragraph", "strong"],
2157
+ enter: {
2158
+ autolink: a(Rn),
2159
+ autolinkProtocol: S,
2160
+ autolinkEmail: S,
2161
+ atxHeading: a(Pn),
2162
+ blockQuote: a(Fn),
2163
+ characterEscape: S,
2164
+ characterReference: S,
2165
+ codeFenced: a(Dn),
2166
+ codeFencedFenceInfo: c,
2167
+ codeFencedFenceMeta: c,
2168
+ codeIndented: a(Dn, c),
2169
+ codeText: a(kt, c),
2170
+ codeTextData: S,
2171
+ data: S,
2172
+ codeFlowValue: S,
2173
+ definition: a(dt),
2174
+ definitionDestinationString: c,
2175
+ definitionLabelString: c,
2176
+ definitionTitleString: c,
2177
+ emphasis: a(bt),
2178
+ hardBreakEscape: a(_n),
2179
+ hardBreakTrailing: a(_n),
2180
+ htmlFlow: a(Mn, c),
2181
+ htmlFlowData: S,
2182
+ htmlText: a(Mn, c),
2183
+ htmlTextData: S,
2184
+ image: a(yt),
2185
+ label: c,
2186
+ link: a(Rn),
2187
+ listItem: a(St),
2188
+ listItemValue: k,
2189
+ listOrdered: a(jn, f),
2190
+ listUnordered: a(jn),
2191
+ paragraph: a(Ft),
2192
+ reference: hn,
2193
+ referenceString: c,
2194
+ resourceDestinationString: c,
2195
+ resourceTitleString: c,
2196
+ setextHeading: a(Pn),
2197
+ strong: a(wt),
2198
+ thematicBreak: a(Ct)
2199
+ },
2200
+ exit: {
2201
+ atxHeading: h(),
2202
+ atxHeadingSequence: P,
2203
+ autolink: h(),
2204
+ autolinkEmail: mn,
2205
+ autolinkProtocol: pn,
2206
+ blockQuote: h(),
2207
+ characterEscapeValue: w,
2208
+ characterReferenceMarkerHexadecimal: K,
2209
+ characterReferenceMarkerNumeric: K,
2210
+ characterReferenceValue: ln,
2211
+ codeFenced: h(_),
2212
+ codeFencedFence: y,
2213
+ codeFencedFenceInfo: A,
2214
+ codeFencedFenceMeta: L,
2215
+ codeFlowValue: w,
2216
+ codeIndented: h(F),
2217
+ codeText: h(J),
2218
+ codeTextData: w,
2219
+ data: w,
2220
+ definition: h(),
2221
+ definitionDestinationString: d,
2222
+ definitionLabelString: O,
2223
+ definitionTitleString: D,
2224
+ emphasis: h(),
2225
+ hardBreakEscape: h(U),
2226
+ hardBreakTrailing: h(U),
2227
+ htmlFlow: h(G),
2228
+ htmlFlowData: w,
2229
+ htmlText: h(nn),
2230
+ htmlTextData: w,
2231
+ image: h(W),
2232
+ label: s,
2233
+ labelText: H,
2234
+ lineEnding: z,
2235
+ link: h(Q),
2236
+ listItem: h(),
2237
+ listOrdered: h(),
2238
+ listUnordered: h(),
2239
+ paragraph: h(),
2240
+ referenceString: N,
2241
+ resourceDestinationString: o,
2242
+ resourceTitleString: cn,
2243
+ resource: xn,
2244
+ setextHeading: h(V),
2245
+ setextHeadingLineSequence: j,
2246
+ setextHeadingText: R,
2247
+ strong: h(),
2248
+ thematicBreak: h()
2249
+ }
2250
+ };
2251
+ ft(r, (n || {}).mdastExtensions || []);
2252
+ const t = {};
2253
+ return e;
2254
+ function e(m) {
2255
+ let b = {
2256
+ type: "root",
2257
+ children: []
2258
+ };
2259
+ const E = {
2260
+ stack: [b],
2261
+ tokenStack: [],
2262
+ config: r,
2263
+ enter: p,
2264
+ exit: x,
2265
+ buffer: c,
2266
+ resume: g,
2267
+ setData: l,
2268
+ getData: u
2269
+ }, I = [];
2270
+ let T = -1;
2271
+ for (; ++T < m.length; )
2272
+ if (m[T][1].type === "listOrdered" || m[T][1].type === "listUnordered")
2273
+ if (m[T][0] === "enter")
2274
+ I.push(T);
2275
+ else {
2276
+ const X = I.pop();
2277
+ T = i(m, X, T);
2278
+ }
2279
+ for (T = -1; ++T < m.length; ) {
2280
+ const X = r[m[T][0]];
2281
+ pt.call(X, m[T][1].type) && X[m[T][1].type].call(
2282
+ Object.assign(
2283
+ {
2284
+ sliceSerialize: m[T][2].sliceSerialize
2285
+ },
2286
+ E
2287
+ ),
2288
+ m[T][1]
2289
+ );
2290
+ }
2291
+ if (E.tokenStack.length > 0) {
2292
+ const X = E.tokenStack[E.tokenStack.length - 1];
2293
+ (X[1] || Xn).call(E, void 0, X[0]);
2294
+ }
2295
+ for (b.position = {
2296
+ start: on(
2297
+ m.length > 0 ? m[0][1].start : {
2298
+ line: 1,
2299
+ column: 1,
2300
+ offset: 0
2301
+ }
2302
+ ),
2303
+ end: on(
2304
+ m.length > 0 ? m[m.length - 2][1].end : {
2305
+ line: 1,
2306
+ column: 1,
2307
+ offset: 0
2308
+ }
2309
+ )
2310
+ }, T = -1; ++T < r.transforms.length; )
2311
+ b = r.transforms[T](b) || b;
2312
+ return b;
2313
+ }
2314
+ function i(m, b, E) {
2315
+ let I = b - 1, T = -1, X = !1, an, rn, gn, kn;
2316
+ for (; ++I <= E; ) {
2317
+ const M = m[I];
2318
+ if (M[1].type === "listUnordered" || M[1].type === "listOrdered" || M[1].type === "blockQuote" ? (M[0] === "enter" ? T++ : T--, kn = void 0) : M[1].type === "lineEndingBlank" ? M[0] === "enter" && (an && !kn && !T && !gn && (gn = I), kn = void 0) : M[1].type === "linePrefix" || M[1].type === "listItemValue" || M[1].type === "listItemMarker" || M[1].type === "listItemPrefix" || M[1].type === "listItemPrefixWhitespace" || (kn = void 0), !T && M[0] === "enter" && M[1].type === "listItemPrefix" || T === -1 && M[0] === "exit" && (M[1].type === "listUnordered" || M[1].type === "listOrdered")) {
2319
+ if (an) {
2320
+ let wn = I;
2321
+ for (rn = void 0; wn--; ) {
2322
+ const un = m[wn];
2323
+ if (un[1].type === "lineEnding" || un[1].type === "lineEndingBlank") {
2324
+ if (un[0] === "exit")
2325
+ continue;
2326
+ rn && (m[rn][1].type = "lineEndingBlank", X = !0), un[1].type = "lineEnding", rn = wn;
2327
+ } else if (!(un[1].type === "linePrefix" || un[1].type === "blockQuotePrefix" || un[1].type === "blockQuotePrefixWhitespace" || un[1].type === "blockQuoteMarker" || un[1].type === "listItemIndent"))
2328
+ break;
2329
+ }
2330
+ gn && (!rn || gn < rn) && (an._spread = !0), an.end = Object.assign(
2331
+ {},
2332
+ rn ? m[rn][1].start : M[1].end
2333
+ ), m.splice(rn || I, 0, ["exit", an, M[2]]), I++, E++;
2334
+ }
2335
+ M[1].type === "listItemPrefix" && (an = {
2336
+ type: "listItem",
2337
+ // @ts-expect-error Patched
2338
+ _spread: !1,
2339
+ start: Object.assign({}, M[1].start)
2340
+ }, m.splice(I, 0, ["enter", an, M[2]]), I++, E++, gn = void 0, kn = !0);
2341
+ }
2342
+ }
2343
+ return m[b][1]._spread = X, E;
2344
+ }
2345
+ function l(m, b) {
2346
+ t[m] = b;
2347
+ }
2348
+ function u(m) {
2349
+ return t[m];
2350
+ }
2351
+ function a(m, b) {
2352
+ return E;
2353
+ function E(I) {
2354
+ p.call(this, m(I), I), b && b.call(this, I);
2355
+ }
2356
+ }
2357
+ function c() {
2358
+ this.stack.push({
2359
+ type: "fragment",
2360
+ children: []
2361
+ });
2362
+ }
2363
+ function p(m, b, E) {
2364
+ return this.stack[this.stack.length - 1].children.push(m), this.stack.push(m), this.tokenStack.push([b, E]), m.position = {
2365
+ start: on(b.start)
2366
+ }, m;
2367
+ }
2368
+ function h(m) {
2369
+ return b;
2370
+ function b(E) {
2371
+ m && m.call(this, E), x.call(this, E);
2372
+ }
2373
+ }
2374
+ function x(m, b) {
2375
+ const E = this.stack.pop(), I = this.tokenStack.pop();
2376
+ if (I)
2377
+ I[0].type !== m.type && (b ? b.call(this, m, I[0]) : (I[1] || Xn).call(this, m, I[0]));
2378
+ else
2379
+ throw new Error(
2380
+ "Cannot close `" + m.type + "` (" + yn({
2381
+ start: m.start,
2382
+ end: m.end
2383
+ }) + "): it’s not open"
2384
+ );
2385
+ return E.position.end = on(m.end), E;
2386
+ }
2387
+ function g() {
2388
+ return Tt(this.stack.pop());
2389
+ }
2390
+ function f() {
2391
+ l("expectingFirstListItemValue", !0);
2392
+ }
2393
+ function k(m) {
2394
+ if (u("expectingFirstListItemValue")) {
2395
+ const b = this.stack[this.stack.length - 2];
2396
+ b.start = Number.parseInt(this.sliceSerialize(m), 10), l("expectingFirstListItemValue");
2397
+ }
2398
+ }
2399
+ function A() {
2400
+ const m = this.resume(), b = this.stack[this.stack.length - 1];
2401
+ b.lang = m;
2402
+ }
2403
+ function L() {
2404
+ const m = this.resume(), b = this.stack[this.stack.length - 1];
2405
+ b.meta = m;
2406
+ }
2407
+ function y() {
2408
+ u("flowCodeInside") || (this.buffer(), l("flowCodeInside", !0));
2409
+ }
2410
+ function _() {
2411
+ const m = this.resume(), b = this.stack[this.stack.length - 1];
2412
+ b.value = m.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g, ""), l("flowCodeInside");
2413
+ }
2414
+ function F() {
2415
+ const m = this.resume(), b = this.stack[this.stack.length - 1];
2416
+ b.value = m.replace(/(\r?\n|\r)$/g, "");
2417
+ }
2418
+ function O(m) {
2419
+ const b = this.resume(), E = this.stack[this.stack.length - 1];
2420
+ E.label = b, E.identifier = fn(
2421
+ this.sliceSerialize(m)
2422
+ ).toLowerCase();
2423
+ }
2424
+ function D() {
2425
+ const m = this.resume(), b = this.stack[this.stack.length - 1];
2426
+ b.title = m;
2427
+ }
2428
+ function d() {
2429
+ const m = this.resume(), b = this.stack[this.stack.length - 1];
2430
+ b.url = m;
2431
+ }
2432
+ function P(m) {
2433
+ const b = this.stack[this.stack.length - 1];
2434
+ if (!b.depth) {
2435
+ const E = this.sliceSerialize(m).length;
2436
+ b.depth = E;
2437
+ }
2438
+ }
2439
+ function R() {
2440
+ l("setextHeadingSlurpLineEnding", !0);
2441
+ }
2442
+ function j(m) {
2443
+ const b = this.stack[this.stack.length - 1];
2444
+ b.depth = this.sliceSerialize(m).charCodeAt(0) === 61 ? 1 : 2;
2445
+ }
2446
+ function V() {
2447
+ l("setextHeadingSlurpLineEnding");
2448
+ }
2449
+ function S(m) {
2450
+ const b = this.stack[this.stack.length - 1];
2451
+ let E = b.children[b.children.length - 1];
2452
+ (!E || E.type !== "text") && (E = Et(), E.position = {
2453
+ start: on(m.start)
2454
+ }, b.children.push(E)), this.stack.push(E);
2455
+ }
2456
+ function w(m) {
2457
+ const b = this.stack.pop();
2458
+ b.value += this.sliceSerialize(m), b.position.end = on(m.end);
2459
+ }
2460
+ function z(m) {
2461
+ const b = this.stack[this.stack.length - 1];
2462
+ if (u("atHardBreak")) {
2463
+ const E = b.children[b.children.length - 1];
2464
+ E.position.end = on(m.end), l("atHardBreak");
2465
+ return;
2466
+ }
2467
+ !u("setextHeadingSlurpLineEnding") && r.canContainEols.includes(b.type) && (S.call(this, m), w.call(this, m));
2468
+ }
2469
+ function U() {
2470
+ l("atHardBreak", !0);
2471
+ }
2472
+ function G() {
2473
+ const m = this.resume(), b = this.stack[this.stack.length - 1];
2474
+ b.value = m;
2475
+ }
2476
+ function nn() {
2477
+ const m = this.resume(), b = this.stack[this.stack.length - 1];
2478
+ b.value = m;
2479
+ }
2480
+ function J() {
2481
+ const m = this.resume(), b = this.stack[this.stack.length - 1];
2482
+ b.value = m;
2483
+ }
2484
+ function Q() {
2485
+ const m = this.stack[this.stack.length - 1];
2486
+ if (u("inReference")) {
2487
+ const b = u("referenceType") || "shortcut";
2488
+ m.type += "Reference", m.referenceType = b, delete m.url, delete m.title;
2489
+ } else
2490
+ delete m.identifier, delete m.label;
2491
+ l("referenceType");
2492
+ }
2493
+ function W() {
2494
+ const m = this.stack[this.stack.length - 1];
2495
+ if (u("inReference")) {
2496
+ const b = u("referenceType") || "shortcut";
2497
+ m.type += "Reference", m.referenceType = b, delete m.url, delete m.title;
2498
+ } else
2499
+ delete m.identifier, delete m.label;
2500
+ l("referenceType");
2501
+ }
2502
+ function H(m) {
2503
+ const b = this.sliceSerialize(m), E = this.stack[this.stack.length - 2];
2504
+ E.label = Er(b), E.identifier = fn(b).toLowerCase();
2505
+ }
2506
+ function s() {
2507
+ const m = this.stack[this.stack.length - 1], b = this.resume(), E = this.stack[this.stack.length - 1];
2508
+ if (l("inReference", !0), E.type === "link") {
2509
+ const I = m.children;
2510
+ E.children = I;
2511
+ } else
2512
+ E.alt = b;
2513
+ }
2514
+ function o() {
2515
+ const m = this.resume(), b = this.stack[this.stack.length - 1];
2516
+ b.url = m;
2517
+ }
2518
+ function cn() {
2519
+ const m = this.resume(), b = this.stack[this.stack.length - 1];
2520
+ b.title = m;
2521
+ }
2522
+ function xn() {
2523
+ l("inReference");
2524
+ }
2525
+ function hn() {
2526
+ l("referenceType", "collapsed");
2527
+ }
2528
+ function N(m) {
2529
+ const b = this.resume(), E = this.stack[this.stack.length - 1];
2530
+ E.label = b, E.identifier = fn(
2531
+ this.sliceSerialize(m)
2532
+ ).toLowerCase(), l("referenceType", "full");
2533
+ }
2534
+ function K(m) {
2535
+ l("characterReferenceType", m.type);
2536
+ }
2537
+ function ln(m) {
2538
+ const b = this.sliceSerialize(m), E = u("characterReferenceType");
2539
+ let I;
2540
+ E ? (I = ht(
2541
+ b,
2542
+ E === "characterReferenceMarkerNumeric" ? 10 : 16
2543
+ ), l("characterReferenceType")) : I = Ln(b);
2544
+ const T = this.stack.pop();
2545
+ T.value += I, T.position.end = on(m.end);
2546
+ }
2547
+ function pn(m) {
2548
+ w.call(this, m);
2549
+ const b = this.stack[this.stack.length - 1];
2550
+ b.url = this.sliceSerialize(m);
2551
+ }
2552
+ function mn(m) {
2553
+ w.call(this, m);
2554
+ const b = this.stack[this.stack.length - 1];
2555
+ b.url = "mailto:" + this.sliceSerialize(m);
2556
+ }
2557
+ function Fn() {
2558
+ return {
2559
+ type: "blockquote",
2560
+ children: []
2561
+ };
2562
+ }
2563
+ function Dn() {
2564
+ return {
2565
+ type: "code",
2566
+ lang: null,
2567
+ meta: null,
2568
+ value: ""
2569
+ };
2570
+ }
2571
+ function kt() {
2572
+ return {
2573
+ type: "inlineCode",
2574
+ value: ""
2575
+ };
2576
+ }
2577
+ function dt() {
2578
+ return {
2579
+ type: "definition",
2580
+ identifier: "",
2581
+ label: null,
2582
+ title: null,
2583
+ url: ""
2584
+ };
2585
+ }
2586
+ function bt() {
2587
+ return {
2588
+ type: "emphasis",
2589
+ children: []
2590
+ };
2591
+ }
2592
+ function Pn() {
2593
+ return {
2594
+ type: "heading",
2595
+ depth: void 0,
2596
+ children: []
2597
+ };
2598
+ }
2599
+ function _n() {
2600
+ return {
2601
+ type: "break"
2602
+ };
2603
+ }
2604
+ function Mn() {
2605
+ return {
2606
+ type: "html",
2607
+ value: ""
2608
+ };
2609
+ }
2610
+ function yt() {
2611
+ return {
2612
+ type: "image",
2613
+ title: null,
2614
+ url: "",
2615
+ alt: null
2616
+ };
2617
+ }
2618
+ function Rn() {
2619
+ return {
2620
+ type: "link",
2621
+ title: null,
2622
+ url: "",
2623
+ children: []
2624
+ };
2625
+ }
2626
+ function jn(m) {
2627
+ return {
2628
+ type: "list",
2629
+ ordered: m.type === "listOrdered",
2630
+ start: null,
2631
+ // @ts-expect-error Patched.
2632
+ spread: m._spread,
2633
+ children: []
2634
+ };
2635
+ }
2636
+ function St(m) {
2637
+ return {
2638
+ type: "listItem",
2639
+ // @ts-expect-error Patched.
2640
+ spread: m._spread,
2641
+ checked: null,
2642
+ children: []
2643
+ };
2644
+ }
2645
+ function Ft() {
2646
+ return {
2647
+ type: "paragraph",
2648
+ children: []
2649
+ };
2650
+ }
2651
+ function wt() {
2652
+ return {
2653
+ type: "strong",
2654
+ children: []
2655
+ };
2656
+ }
2657
+ function Et() {
2658
+ return {
2659
+ type: "text",
2660
+ value: ""
2661
+ };
2662
+ }
2663
+ function Ct() {
2664
+ return {
2665
+ type: "thematicBreak"
2666
+ };
2667
+ }
2668
+ }
2669
+ function on(n) {
2670
+ return {
2671
+ line: n.line,
2672
+ column: n.column,
2673
+ offset: n.offset
2674
+ };
2675
+ }
2676
+ function ft(n, r) {
2677
+ let t = -1;
2678
+ for (; ++t < r.length; ) {
2679
+ const e = r[t];
2680
+ Array.isArray(e) ? ft(n, e) : zr(n, e);
2681
+ }
2682
+ }
2683
+ function zr(n, r) {
2684
+ let t;
2685
+ for (t in r)
2686
+ if (pt.call(r, t)) {
2687
+ if (t === "canContainEols") {
2688
+ const e = r[t];
2689
+ e && n[t].push(...e);
2690
+ } else if (t === "transforms") {
2691
+ const e = r[t];
2692
+ e && n[t].push(...e);
2693
+ } else if (t === "enter" || t === "exit") {
2694
+ const e = r[t];
2695
+ e && Object.assign(n[t], e);
2696
+ }
2697
+ }
2698
+ }
2699
+ function Xn(n, r) {
2700
+ throw n ? new Error(
2701
+ "Cannot close `" + n.type + "` (" + yn({
2702
+ start: n.start,
2703
+ end: n.end
2704
+ }) + "): a different token (`" + r.type + "`, " + yn({
2705
+ start: r.start,
2706
+ end: r.end
2707
+ }) + ") is open"
2708
+ ) : new Error(
2709
+ "Cannot close document, a token (`" + r.type + "`, " + yn({
2710
+ start: r.start,
2711
+ end: r.end
2712
+ }) + ") is still open"
2713
+ );
2714
+ }
2715
+ function Ir(n) {
2716
+ const r = n.replace(/\n{2,}/g, `
2717
+ `);
2718
+ return zt(r);
2719
+ }
2720
+ function Tr(n) {
2721
+ const r = Ir(n), { children: t } = mt(r), e = [[]];
2722
+ let i = 0;
2723
+ function l(u, a = "normal") {
2724
+ u.type === "text" ? u.value.split(`
2725
+ `).forEach((p, h) => {
2726
+ h !== 0 && (i++, e.push([])), p.split(" ").forEach((x) => {
2727
+ x && e[i].push({ content: x, type: a });
2728
+ });
2729
+ }) : (u.type === "strong" || u.type === "emphasis") && u.children.forEach((c) => {
2730
+ l(c, u.type);
2731
+ });
2732
+ }
2733
+ return t.forEach((u) => {
2734
+ u.type === "paragraph" && u.children.forEach((a) => {
2735
+ l(a);
2736
+ });
2737
+ }), e;
2738
+ }
2739
+ function Br(n) {
2740
+ const { children: r } = mt(n);
2741
+ function t(e) {
2742
+ return e.type === "text" ? e.value.replace(/\n/g, "<br/>") : e.type === "strong" ? `<strong>${e.children.map(t).join("")}</strong>` : e.type === "emphasis" ? `<em>${e.children.map(t).join("")}</em>` : e.type === "paragraph" ? `<p>${e.children.map(t).join("")}</p>` : `Unsupported markdown: ${e.type}`;
2743
+ }
2744
+ return r.map(t).join("");
2745
+ }
2746
+ function Lr(n, r) {
2747
+ r && n.attr("style", r);
2748
+ }
2749
+ function Or(n, r, t, e, i = !1) {
2750
+ const l = n.append("foreignObject"), u = l.append("xhtml:div"), a = r.label, c = r.isNode ? "nodeLabel" : "edgeLabel";
2751
+ u.html(
2752
+ `
2753
+ <span class="${c} ${e}" ` + (r.labelStyle ? 'style="' + r.labelStyle + '"' : "") + ">" + a + "</span>"
2754
+ ), Lr(u, r.labelStyle), u.style("display", "table-cell"), u.style("white-space", "nowrap"), u.style("max-width", t + "px"), u.attr("xmlns", "http://www.w3.org/1999/xhtml"), i && u.attr("class", "labelBkg");
2755
+ let p = u.node().getBoundingClientRect();
2756
+ return p.width === t && (u.style("display", "table"), u.style("white-space", "break-spaces"), u.style("width", t + "px"), p = u.node().getBoundingClientRect()), l.style("width", p.width), l.style("height", p.height), l.node();
2757
+ }
2758
+ function xt(n, r, t) {
2759
+ return n.append("tspan").attr("class", "text-outer-tspan").attr("x", 0).attr("y", r * t - 0.1 + "em").attr("dy", t + "em");
2760
+ }
2761
+ function vn(n, r, t) {
2762
+ const e = n.append("text"), i = xt(e, 1, r);
2763
+ gt(i, [{ content: t, type: "normal" }]);
2764
+ const l = i.node().getComputedTextLength();
2765
+ return e.remove(), l;
2766
+ }
2767
+ function Dr(n, r, t, e = !1) {
2768
+ const l = r.append("g");
2769
+ let u = l.insert("rect").attr("class", "background");
2770
+ const a = l.append("text").attr("y", "-10.1");
2771
+ let c = 0;
2772
+ if (t.forEach((p) => {
2773
+ let h = p.map((A) => A.content).join(" "), x = "", g = [], f = 0;
2774
+ if (vn(l, 1.1, h) <= n)
2775
+ g.push(h);
2776
+ else {
2777
+ for (let A = 0; A <= h.length; A++)
2778
+ if (x = h.slice(f, A), nt.info(x, f, A), vn(l, 1.1, x) > n) {
2779
+ const y = h.slice(f, A).lastIndexOf(" ");
2780
+ y > -1 && (A = f + y + 1), g.push(h.slice(f, A).trim()), f = A, x = null;
2781
+ }
2782
+ x != null && g.push(x);
2783
+ }
2784
+ const k = g.map((A) => ({ content: A, type: p.type }));
2785
+ for (const A of k) {
2786
+ let L = xt(a, c, 1.1);
2787
+ gt(L, [A]), c++;
2788
+ }
2789
+ }), e) {
2790
+ const p = a.node().getBBox(), h = 2;
2791
+ return u.attr("x", -h).attr("y", -h).attr("width", p.width + 2 * h).attr("height", p.height + 2 * h), l.node();
2792
+ } else
2793
+ return a.node();
2794
+ }
2795
+ function gt(n, r) {
2796
+ n.text(""), r.forEach((t, e) => {
2797
+ const i = n.append("tspan").attr("font-style", t.type === "em" ? "italic" : "normal").attr("class", "text-inner-tspan").attr("font-weight", t.type === "strong" ? "bold" : "normal");
2798
+ e === 0 ? i.text(t.content) : i.text(" " + t.content);
2799
+ });
2800
+ }
2801
+ const _r = (n, r = "", {
2802
+ style: t = "",
2803
+ isTitle: e = !1,
2804
+ classes: i = "",
2805
+ useHtmlLabels: l = !0,
2806
+ isNode: u = !0,
2807
+ width: a,
2808
+ addSvgBackground: c = !1
2809
+ } = {}) => {
2810
+ if (nt.info("createText", r, t, e, i, l, u, c), l) {
2811
+ const p = Br(r), h = {
2812
+ isNode: u,
2813
+ label: At(p).replace(
2814
+ /fa[blrs]?:fa-[\w-]+/g,
2815
+ (g) => `<i class='${g.replace(":", " ")}'></i>`
2816
+ ),
2817
+ labelStyle: t.replace("fill:", "color:")
2818
+ };
2819
+ return Or(n, h, a, i, c);
2820
+ } else {
2821
+ const p = Tr(r);
2822
+ return Dr(a, n, p, c);
2823
+ }
2824
+ };
2825
+ export {
2826
+ _r as c
2827
+ };