@schmitech/chatbot-widget 0.5.2 → 0.5.4

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