wecool-chat 0.9.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/README.ja.md +78 -20
  3. package/README.md +145 -23
  4. package/dist/CopyIndicator-RR3hSsBA.js +51 -0
  5. package/dist/MarkdownBody-EIz0jnQy.js +14910 -0
  6. package/dist/VoiceControls-A7N4uPTo.js +146 -0
  7. package/dist/VoiceRuntime-DrYjNkZK.js +459 -0
  8. package/dist/blank-line-CUDmZ-mX.js +143 -0
  9. package/dist/{browser-D1aZQhQL.js → browser-M7mS-hAN.js} +5 -5
  10. package/dist/clsx-Cf23UI1w.js +16 -0
  11. package/dist/core/client.d.ts +11 -3
  12. package/dist/core/client.d.ts.map +1 -1
  13. package/dist/core/error-reporter.d.ts +1 -1
  14. package/dist/core/error-reporter.d.ts.map +1 -1
  15. package/dist/core/i18n/messages.d.ts +77 -1
  16. package/dist/core/i18n/messages.d.ts.map +1 -1
  17. package/dist/core/tool-runner.d.ts.map +1 -1
  18. package/dist/core/types.d.ts +23 -1
  19. package/dist/core/types.d.ts.map +1 -1
  20. package/dist/createLucideIcon-C7wGkK-Q.js +43 -0
  21. package/dist/default-sNAxTmdF.js +8 -0
  22. package/dist/index.css +2 -2
  23. package/dist/index.js +5181 -4871
  24. package/dist/jsx-runtime-Cyy0mp0f.js +328 -0
  25. package/dist/lib-DG_DjiCr.js +15 -0
  26. package/dist/{messages-CveZLPSJ.js → messages-FvtWi3lI.js} +99 -27
  27. package/dist/plugins/qrcode.js +2 -2
  28. package/dist/remark-gfm-Bzy1u34W.js +1962 -0
  29. package/dist/remark-parse-BnwSmQr-.js +2486 -0
  30. package/dist/stable-prefix-BHsGj4tL.js +21 -0
  31. package/dist/ui/components/ChatFooter.d.ts +16 -2
  32. package/dist/ui/components/ChatFooter.d.ts.map +1 -1
  33. package/dist/ui/components/ChatHeader.d.ts +9 -2
  34. package/dist/ui/components/ChatHeader.d.ts.map +1 -1
  35. package/dist/ui/components/ChatHeaderMenu.d.ts +23 -2
  36. package/dist/ui/components/ChatHeaderMenu.d.ts.map +1 -1
  37. package/dist/ui/components/ChatPanel.d.ts +13 -3
  38. package/dist/ui/components/ChatPanel.d.ts.map +1 -1
  39. package/dist/ui/components/ChatWidget.d.ts.map +1 -1
  40. package/dist/ui/components/CommandConfirmationCard.d.ts +7 -1
  41. package/dist/ui/components/CommandConfirmationCard.d.ts.map +1 -1
  42. package/dist/ui/components/CommandOverlays.d.ts +13 -1
  43. package/dist/ui/components/CommandOverlays.d.ts.map +1 -1
  44. package/dist/ui/components/FooterActions.d.ts +18 -0
  45. package/dist/ui/components/FooterActions.d.ts.map +1 -0
  46. package/dist/ui/components/MessageList.d.ts +7 -1
  47. package/dist/ui/components/MessageList.d.ts.map +1 -1
  48. package/dist/ui/components/MessageRow.d.ts +7 -1
  49. package/dist/ui/components/MessageRow.d.ts.map +1 -1
  50. package/dist/ui/components/MessageRowActions.d.ts +9 -3
  51. package/dist/ui/components/MessageRowActions.d.ts.map +1 -1
  52. package/dist/ui/components/MicButton.d.ts +11 -0
  53. package/dist/ui/components/MicButton.d.ts.map +1 -0
  54. package/dist/ui/components/VoiceControls.d.ts +22 -0
  55. package/dist/ui/components/VoiceControls.d.ts.map +1 -0
  56. package/dist/ui/components/VoiceLoopStatusBar.d.ts +17 -0
  57. package/dist/ui/components/VoiceLoopStatusBar.d.ts.map +1 -0
  58. package/dist/ui/components/VoiceLoopToggle.d.ts +15 -0
  59. package/dist/ui/components/VoiceLoopToggle.d.ts.map +1 -0
  60. package/dist/ui/components/VoiceRuntime.d.ts +16 -0
  61. package/dist/ui/components/VoiceRuntime.d.ts.map +1 -0
  62. package/dist/ui/components/lazy-voice.d.ts +19 -0
  63. package/dist/ui/components/lazy-voice.d.ts.map +1 -0
  64. package/dist/ui/hooks/use-command-execution.d.ts +23 -1
  65. package/dist/ui/hooks/use-command-execution.d.ts.map +1 -1
  66. package/dist/ui/hooks/use-message-history.d.ts +14 -0
  67. package/dist/ui/hooks/use-message-history.d.ts.map +1 -1
  68. package/dist/ui/hooks/use-mic-button.d.ts +29 -0
  69. package/dist/ui/hooks/use-mic-button.d.ts.map +1 -0
  70. package/dist/ui/hooks/use-send-message.d.ts.map +1 -1
  71. package/dist/ui/hooks/use-speak-message.d.ts +26 -0
  72. package/dist/ui/hooks/use-speak-message.d.ts.map +1 -0
  73. package/dist/ui/hooks/use-visitor-id.d.ts +15 -3
  74. package/dist/ui/hooks/use-visitor-id.d.ts.map +1 -1
  75. package/dist/ui/hooks/use-voice-input.d.ts +38 -0
  76. package/dist/ui/hooks/use-voice-input.d.ts.map +1 -0
  77. package/dist/ui/hooks/use-voice-loop-speech.d.ts +38 -0
  78. package/dist/ui/hooks/use-voice-loop-speech.d.ts.map +1 -0
  79. package/dist/ui/hooks/use-voice-loop.d.ts +12 -0
  80. package/dist/ui/hooks/use-voice-loop.d.ts.map +1 -0
  81. package/dist/ui/hooks/use-voice-runtime-snapshot.d.ts +19 -0
  82. package/dist/ui/hooks/use-voice-runtime-snapshot.d.ts.map +1 -0
  83. package/dist/ui/hooks/use-voice-runtime.d.ts +29 -0
  84. package/dist/ui/hooks/use-voice-runtime.d.ts.map +1 -0
  85. package/dist/ui/hooks/useChatStream.d.ts +5 -0
  86. package/dist/ui/hooks/useChatStream.d.ts.map +1 -1
  87. package/dist/ui/hooks/useConversationList.d.ts +7 -0
  88. package/dist/ui/hooks/useConversationList.d.ts.map +1 -1
  89. package/dist/ui/utils/speech-text.d.ts +29 -0
  90. package/dist/ui/utils/speech-text.d.ts.map +1 -0
  91. package/dist/ui/utils/voice-locale.d.ts +3 -0
  92. package/dist/ui/utils/voice-locale.d.ts.map +1 -0
  93. package/dist/ui/utils/voice-loop-cue.d.ts +23 -0
  94. package/dist/ui/utils/voice-loop-cue.d.ts.map +1 -0
  95. package/dist/ui/utils/voice-loop-status.d.ts +17 -0
  96. package/dist/ui/utils/voice-loop-status.d.ts.map +1 -0
  97. package/dist/ui/utils/voice-loop-types.d.ts +40 -0
  98. package/dist/ui/utils/voice-loop-types.d.ts.map +1 -0
  99. package/dist/ui/utils/voice-runtime.d.ts +38 -0
  100. package/dist/ui/utils/voice-runtime.d.ts.map +1 -0
  101. package/dist/ui/utils/voice-support.d.ts +9 -0
  102. package/dist/ui/utils/voice-support.d.ts.map +1 -0
  103. package/dist/unified-DctkAd9P.js +518 -0
  104. package/dist/use-voice-input-LtJJz-zQ.js +102 -0
  105. package/dist/version.d.ts +17 -0
  106. package/dist/version.d.ts.map +1 -0
  107. package/dist/voice-runtime-F5NxN_0m.js +11 -0
  108. package/dist/voice-support-BeOiOzcn.js +9 -0
  109. package/package.json +27 -25
  110. package/dist/CopyIndicator-D50ixqNB.js +0 -407
  111. package/dist/MarkdownBody-eopKrDot.js +0 -19983
@@ -0,0 +1,2486 @@
1
+ import { i as Yn } from "./messages-FvtWi3lI.js";
2
+ import { _ as w, a as $, c as Nn, d as J, f as gt, g as xt, h as kt, i as dt, l as fn, m as Cn, n as L, o as on, p as En, r as Fn, s as St, t as In, u as K, v as Y, y as v } from "./blank-line-CUDmZ-mX.js";
3
+ import { t as bn } from "./lib-DG_DjiCr.js";
4
+ var Dn = document.createElement("i");
5
+ function vn(n) {
6
+ const r = "&" + n + ";";
7
+ Dn.innerHTML = r;
8
+ const t = Dn.textContent;
9
+ return t.charCodeAt(t.length - 1) === 59 && n !== "semi" || t === r ? !1 : t;
10
+ }
11
+ function $n(n, r) {
12
+ const t = Number.parseInt(n, r);
13
+ return t < 9 || t === 11 || t > 13 && t < 32 || t > 126 && t < 160 || t > 55295 && t < 57344 || t > 64975 && t < 65008 || (t & 65535) === 65535 || (t & 65535) === 65534 || t > 1114111 ? "�" : String.fromCodePoint(t);
14
+ }
15
+ var bt = /\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;
16
+ function yt(n) {
17
+ return n.replace(bt, It);
18
+ }
19
+ function It(n, r, t) {
20
+ if (r) return r;
21
+ if (t.charCodeAt(0) === 35) {
22
+ const e = t.charCodeAt(1), a = e === 120 || e === 88;
23
+ return $n(t.slice(a ? 2 : 1), a ? 16 : 10);
24
+ }
25
+ return vn(t) || n;
26
+ }
27
+ var Tn = {
28
+ name: "attention",
29
+ resolveAll: wt,
30
+ tokenize: zt
31
+ };
32
+ function wt(n, r) {
33
+ let t = -1, e, a, i, u, s, f, c, m;
34
+ for (; ++t < n.length; ) if (n[t][0] === "enter" && n[t][1].type === "attentionSequence" && n[t][1]._close) {
35
+ for (e = t; e--; ) if (n[e][0] === "exit" && n[e][1].type === "attentionSequence" && n[e][1]._open && r.sliceSerialize(n[e][1]).charCodeAt(0) === r.sliceSerialize(n[t][1]).charCodeAt(0)) {
36
+ if ((n[e][1]._close || n[t][1]._open) && (n[t][1].end.offset - n[t][1].start.offset) % 3 && !((n[e][1].end.offset - n[e][1].start.offset + n[t][1].end.offset - n[t][1].start.offset) % 3)) continue;
37
+ f = n[e][1].end.offset - n[e][1].start.offset > 1 && n[t][1].end.offset - n[t][1].start.offset > 1 ? 2 : 1;
38
+ const p = { ...n[e][1].end }, g = { ...n[t][1].start };
39
+ Rn(p, -f), Rn(g, f), u = {
40
+ type: f > 1 ? "strongSequence" : "emphasisSequence",
41
+ start: p,
42
+ end: { ...n[e][1].end }
43
+ }, s = {
44
+ type: f > 1 ? "strongSequence" : "emphasisSequence",
45
+ start: { ...n[t][1].start },
46
+ end: g
47
+ }, i = {
48
+ type: f > 1 ? "strongText" : "emphasisText",
49
+ start: { ...n[e][1].end },
50
+ end: { ...n[t][1].start }
51
+ }, a = {
52
+ type: f > 1 ? "strong" : "emphasis",
53
+ start: { ...u.start },
54
+ end: { ...s.end }
55
+ }, n[e][1].end = { ...u.start }, n[t][1].start = { ...s.end }, c = [], n[e][1].end.offset - n[e][1].start.offset && (c = $(c, [[
56
+ "enter",
57
+ n[e][1],
58
+ r
59
+ ], [
60
+ "exit",
61
+ n[e][1],
62
+ r
63
+ ]])), c = $(c, [
64
+ [
65
+ "enter",
66
+ a,
67
+ r
68
+ ],
69
+ [
70
+ "enter",
71
+ u,
72
+ r
73
+ ],
74
+ [
75
+ "exit",
76
+ u,
77
+ r
78
+ ],
79
+ [
80
+ "enter",
81
+ i,
82
+ r
83
+ ]
84
+ ]), c = $(c, Fn(r.parser.constructs.insideSpan.null, n.slice(e + 1, t), r)), c = $(c, [
85
+ [
86
+ "exit",
87
+ i,
88
+ r
89
+ ],
90
+ [
91
+ "enter",
92
+ s,
93
+ r
94
+ ],
95
+ [
96
+ "exit",
97
+ s,
98
+ r
99
+ ],
100
+ [
101
+ "exit",
102
+ a,
103
+ r
104
+ ]
105
+ ]), n[t][1].end.offset - n[t][1].start.offset ? (m = 2, c = $(c, [[
106
+ "enter",
107
+ n[t][1],
108
+ r
109
+ ], [
110
+ "exit",
111
+ n[t][1],
112
+ r
113
+ ]])) : m = 0, on(n, e - 1, t - e + 3, c), t = e + c.length - m - 2;
114
+ break;
115
+ }
116
+ }
117
+ for (t = -1; ++t < n.length; ) n[t][1].type === "attentionSequence" && (n[t][1].type = "data");
118
+ return n;
119
+ }
120
+ function zt(n, r) {
121
+ const t = this.parser.constructs.attentionMarkers.null, e = this.previous, a = Nn(e);
122
+ let i;
123
+ return u;
124
+ function u(f) {
125
+ return i = f, n.enter("attentionSequence"), s(f);
126
+ }
127
+ function s(f) {
128
+ if (f === i)
129
+ return n.consume(f), s;
130
+ const c = n.exit("attentionSequence"), m = Nn(f), p = !m || m === 2 && a || t.includes(f), g = !a || a === 2 && m || t.includes(e);
131
+ return c._open = !!(i === 42 ? p : p && (a || !g)), c._close = !!(i === 42 ? g : g && (m || !p)), r(f);
132
+ }
133
+ }
134
+ function Rn(n, r) {
135
+ n.column += r, n.offset += r, n._bufferIndex += r;
136
+ }
137
+ var Ct = {
138
+ name: "autolink",
139
+ tokenize: Et
140
+ };
141
+ function Et(n, r, t) {
142
+ let e = 0;
143
+ return a;
144
+ function a(h) {
145
+ return n.enter("autolink"), n.enter("autolinkMarker"), n.consume(h), n.exit("autolinkMarker"), n.enter("autolinkProtocol"), i;
146
+ }
147
+ function i(h) {
148
+ return K(h) ? (n.consume(h), u) : h === 64 ? t(h) : c(h);
149
+ }
150
+ function u(h) {
151
+ return h === 43 || h === 45 || h === 46 || J(h) ? (e = 1, s(h)) : c(h);
152
+ }
153
+ function s(h) {
154
+ return h === 58 ? (n.consume(h), e = 0, f) : (h === 43 || h === 45 || h === 46 || J(h)) && e++ < 32 ? (n.consume(h), s) : (e = 0, c(h));
155
+ }
156
+ function f(h) {
157
+ return h === 62 ? (n.exit("autolinkProtocol"), n.enter("autolinkMarker"), n.consume(h), n.exit("autolinkMarker"), n.exit("autolink"), r) : h === null || h === 32 || h === 60 || En(h) ? t(h) : (n.consume(h), f);
158
+ }
159
+ function c(h) {
160
+ return h === 64 ? (n.consume(h), m) : gt(h) ? (n.consume(h), c) : t(h);
161
+ }
162
+ function m(h) {
163
+ return J(h) ? p(h) : t(h);
164
+ }
165
+ function p(h) {
166
+ return h === 46 ? (n.consume(h), e = 0, m) : h === 62 ? (n.exit("autolinkProtocol").type = "autolinkEmail", n.enter("autolinkMarker"), n.consume(h), n.exit("autolinkMarker"), n.exit("autolink"), r) : g(h);
167
+ }
168
+ function g(h) {
169
+ if ((h === 45 || J(h)) && e++ < 63) {
170
+ const E = h === 45 ? g : p;
171
+ return n.consume(h), E;
172
+ }
173
+ return t(h);
174
+ }
175
+ }
176
+ var Gn = {
177
+ continuation: { tokenize: Ft },
178
+ exit: vt,
179
+ name: "blockQuote",
180
+ tokenize: Tt
181
+ };
182
+ function Tt(n, r, t) {
183
+ const e = this;
184
+ return a;
185
+ function a(u) {
186
+ if (u === 62) {
187
+ const s = e.containerState;
188
+ return s.open || (n.enter("blockQuote", { _container: !0 }), s.open = !0), n.enter("blockQuotePrefix"), n.enter("blockQuoteMarker"), n.consume(u), n.exit("blockQuoteMarker"), i;
189
+ }
190
+ return t(u);
191
+ }
192
+ function i(u) {
193
+ return v(u) ? (n.enter("blockQuotePrefixWhitespace"), n.consume(u), n.exit("blockQuotePrefixWhitespace"), n.exit("blockQuotePrefix"), r) : (n.exit("blockQuotePrefix"), r(u));
194
+ }
195
+ }
196
+ function Ft(n, r, t) {
197
+ const e = this;
198
+ return a;
199
+ function a(u) {
200
+ return v(u) ? L(n, i, "linePrefix", e.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(u) : i(u);
201
+ }
202
+ function i(u) {
203
+ return n.attempt(Gn, r, t)(u);
204
+ }
205
+ }
206
+ function vt(n) {
207
+ n.exit("blockQuote");
208
+ }
209
+ var Jn = {
210
+ name: "characterEscape",
211
+ tokenize: Bt
212
+ };
213
+ function Bt(n, r, t) {
214
+ return e;
215
+ function e(i) {
216
+ return n.enter("characterEscape"), n.enter("escapeMarker"), n.consume(i), n.exit("escapeMarker"), a;
217
+ }
218
+ function a(i) {
219
+ return xt(i) ? (n.enter("characterEscapeValue"), n.consume(i), n.exit("characterEscapeValue"), n.exit("characterEscape"), r) : t(i);
220
+ }
221
+ }
222
+ var Kn = {
223
+ name: "characterReference",
224
+ tokenize: At
225
+ };
226
+ function At(n, r, t) {
227
+ const e = this;
228
+ let a = 0, i, u;
229
+ return s;
230
+ function s(p) {
231
+ return n.enter("characterReference"), n.enter("characterReferenceMarker"), n.consume(p), n.exit("characterReferenceMarker"), f;
232
+ }
233
+ function f(p) {
234
+ return p === 35 ? (n.enter("characterReferenceMarkerNumeric"), n.consume(p), n.exit("characterReferenceMarkerNumeric"), c) : (n.enter("characterReferenceValue"), i = 31, u = J, m(p));
235
+ }
236
+ function c(p) {
237
+ return p === 88 || p === 120 ? (n.enter("characterReferenceMarkerHexadecimal"), n.consume(p), n.exit("characterReferenceMarkerHexadecimal"), n.enter("characterReferenceValue"), i = 6, u = kt, m) : (n.enter("characterReferenceValue"), i = 7, u = Cn, m(p));
238
+ }
239
+ function m(p) {
240
+ if (p === 59 && a) {
241
+ const g = n.exit("characterReferenceValue");
242
+ return u === J && !vn(e.sliceSerialize(g)) ? t(p) : (n.enter("characterReferenceMarker"), n.consume(p), n.exit("characterReferenceMarker"), n.exit("characterReference"), r);
243
+ }
244
+ return u(p) && a++ < i ? (n.consume(p), m) : t(p);
245
+ }
246
+ }
247
+ var qn = {
248
+ partial: !0,
249
+ tokenize: Pt
250
+ }, Hn = {
251
+ concrete: !0,
252
+ name: "codeFenced",
253
+ tokenize: _t
254
+ };
255
+ function _t(n, r, t) {
256
+ const e = this, a = {
257
+ partial: !0,
258
+ tokenize: N
259
+ };
260
+ let i = 0, u = 0, s;
261
+ return f;
262
+ function f(k) {
263
+ return c(k);
264
+ }
265
+ function c(k) {
266
+ const F = e.events[e.events.length - 1];
267
+ return i = F && F[1].type === "linePrefix" ? F[2].sliceSerialize(F[1], !0).length : 0, s = k, n.enter("codeFenced"), n.enter("codeFencedFence"), n.enter("codeFencedFenceSequence"), m(k);
268
+ }
269
+ function m(k) {
270
+ return k === s ? (u++, n.consume(k), m) : u < 3 ? t(k) : (n.exit("codeFencedFenceSequence"), v(k) ? L(n, p, "whitespace")(k) : p(k));
271
+ }
272
+ function p(k) {
273
+ return k === null || w(k) ? (n.exit("codeFencedFence"), e.interrupt ? r(k) : n.check(qn, T, M)(k)) : (n.enter("codeFencedFenceInfo"), n.enter("chunkString", { contentType: "string" }), g(k));
274
+ }
275
+ function g(k) {
276
+ return k === null || w(k) ? (n.exit("chunkString"), n.exit("codeFencedFenceInfo"), p(k)) : v(k) ? (n.exit("chunkString"), n.exit("codeFencedFenceInfo"), L(n, h, "whitespace")(k)) : k === 96 && k === s ? t(k) : (n.consume(k), g);
277
+ }
278
+ function h(k) {
279
+ return k === null || w(k) ? p(k) : (n.enter("codeFencedFenceMeta"), n.enter("chunkString", { contentType: "string" }), E(k));
280
+ }
281
+ function E(k) {
282
+ return k === null || w(k) ? (n.exit("chunkString"), n.exit("codeFencedFenceMeta"), p(k)) : k === 96 && k === s ? t(k) : (n.consume(k), E);
283
+ }
284
+ function T(k) {
285
+ return n.attempt(a, M, D)(k);
286
+ }
287
+ function D(k) {
288
+ return n.enter("lineEnding"), n.consume(k), n.exit("lineEnding"), S;
289
+ }
290
+ function S(k) {
291
+ return i > 0 && v(k) ? L(n, R, "linePrefix", i + 1)(k) : R(k);
292
+ }
293
+ function R(k) {
294
+ return k === null || w(k) ? n.check(qn, T, M)(k) : (n.enter("codeFlowValue"), b(k));
295
+ }
296
+ function b(k) {
297
+ return k === null || w(k) ? (n.exit("codeFlowValue"), R(k)) : (n.consume(k), b);
298
+ }
299
+ function M(k) {
300
+ return n.exit("codeFenced"), r(k);
301
+ }
302
+ function N(k, F, q) {
303
+ let B = 0;
304
+ return A;
305
+ function A(C) {
306
+ return k.enter("lineEnding"), k.consume(C), k.exit("lineEnding"), I;
307
+ }
308
+ function I(C) {
309
+ return k.enter("codeFencedFence"), v(C) ? L(k, y, "linePrefix", e.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(C) : y(C);
310
+ }
311
+ function y(C) {
312
+ return C === s ? (k.enter("codeFencedFenceSequence"), O(C)) : q(C);
313
+ }
314
+ function O(C) {
315
+ return C === s ? (B++, k.consume(C), O) : B >= u ? (k.exit("codeFencedFenceSequence"), v(C) ? L(k, H, "whitespace")(C) : H(C)) : q(C);
316
+ }
317
+ function H(C) {
318
+ return C === null || w(C) ? (k.exit("codeFencedFence"), F(C)) : q(C);
319
+ }
320
+ }
321
+ }
322
+ function Pt(n, r, t) {
323
+ const e = this;
324
+ return a;
325
+ function a(u) {
326
+ return u === null ? t(u) : (n.enter("lineEnding"), n.consume(u), n.exit("lineEnding"), i);
327
+ }
328
+ function i(u) {
329
+ return e.parser.lazy[e.now().line] ? t(u) : r(u);
330
+ }
331
+ }
332
+ var wn = {
333
+ name: "codeIndented",
334
+ tokenize: Mt
335
+ }, Lt = {
336
+ partial: !0,
337
+ tokenize: Ot
338
+ };
339
+ function Mt(n, r, t) {
340
+ const e = this;
341
+ return a;
342
+ function a(c) {
343
+ return n.enter("codeIndented"), L(n, i, "linePrefix", 5)(c);
344
+ }
345
+ function i(c) {
346
+ const m = e.events[e.events.length - 1];
347
+ return m && m[1].type === "linePrefix" && m[2].sliceSerialize(m[1], !0).length >= 4 ? u(c) : t(c);
348
+ }
349
+ function u(c) {
350
+ return c === null ? f(c) : w(c) ? n.attempt(Lt, u, f)(c) : (n.enter("codeFlowValue"), s(c));
351
+ }
352
+ function s(c) {
353
+ return c === null || w(c) ? (n.exit("codeFlowValue"), u(c)) : (n.consume(c), s);
354
+ }
355
+ function f(c) {
356
+ return n.exit("codeIndented"), r(c);
357
+ }
358
+ }
359
+ function Ot(n, r, t) {
360
+ const e = this;
361
+ return a;
362
+ function a(u) {
363
+ return e.parser.lazy[e.now().line] ? t(u) : w(u) ? (n.enter("lineEnding"), n.consume(u), n.exit("lineEnding"), a) : L(n, i, "linePrefix", 5)(u);
364
+ }
365
+ function i(u) {
366
+ const s = e.events[e.events.length - 1];
367
+ return s && s[1].type === "linePrefix" && s[2].sliceSerialize(s[1], !0).length >= 4 ? r(u) : w(u) ? a(u) : t(u);
368
+ }
369
+ }
370
+ var Nt = {
371
+ name: "codeText",
372
+ previous: Rt,
373
+ resolve: Dt,
374
+ tokenize: qt
375
+ };
376
+ function Dt(n) {
377
+ let r = n.length - 4, t = 3, e, a;
378
+ if ((n[t][1].type === "lineEnding" || n[t][1].type === "space") && (n[r][1].type === "lineEnding" || n[r][1].type === "space")) {
379
+ for (e = t; ++e < r; ) if (n[e][1].type === "codeTextData") {
380
+ n[t][1].type = "codeTextPadding", n[r][1].type = "codeTextPadding", t += 2, r -= 2;
381
+ break;
382
+ }
383
+ }
384
+ for (e = t - 1, r++; ++e <= r; ) a === void 0 ? e !== r && n[e][1].type !== "lineEnding" && (a = e) : (e === r || n[e][1].type === "lineEnding") && (n[a][1].type = "codeTextData", e !== a + 2 && (n[a][1].end = n[e - 1][1].end, n.splice(a + 2, e - a - 2), r -= e - a - 2, e = a + 2), a = void 0);
385
+ return n;
386
+ }
387
+ function Rt(n) {
388
+ return n !== 96 || this.events[this.events.length - 1][1].type === "characterEscape";
389
+ }
390
+ function qt(n, r, t) {
391
+ let e = 0, a, i;
392
+ return u;
393
+ function u(p) {
394
+ return n.enter("codeText"), n.enter("codeTextSequence"), s(p);
395
+ }
396
+ function s(p) {
397
+ return p === 96 ? (n.consume(p), e++, s) : (n.exit("codeTextSequence"), f(p));
398
+ }
399
+ function f(p) {
400
+ return p === null ? t(p) : p === 32 ? (n.enter("space"), n.consume(p), n.exit("space"), f) : p === 96 ? (i = n.enter("codeTextSequence"), a = 0, m(p)) : w(p) ? (n.enter("lineEnding"), n.consume(p), n.exit("lineEnding"), f) : (n.enter("codeTextData"), c(p));
401
+ }
402
+ function c(p) {
403
+ return p === null || p === 32 || p === 96 || w(p) ? (n.exit("codeTextData"), f(p)) : (n.consume(p), c);
404
+ }
405
+ function m(p) {
406
+ return p === 96 ? (n.consume(p), a++, m) : a === e ? (n.exit("codeTextSequence"), n.exit("codeText"), r(p)) : (i.type = "codeTextData", c(p));
407
+ }
408
+ }
409
+ var Ht = class {
410
+ constructor(n) {
411
+ this.left = n ? [...n] : [], this.right = [];
412
+ }
413
+ get(n) {
414
+ if (n < 0 || n >= this.left.length + this.right.length) throw new RangeError("Cannot access index `" + n + "` in a splice buffer of size `" + (this.left.length + this.right.length) + "`");
415
+ return n < this.left.length ? this.left[n] : this.right[this.right.length - n + this.left.length - 1];
416
+ }
417
+ get length() {
418
+ return this.left.length + this.right.length;
419
+ }
420
+ shift() {
421
+ return this.setCursor(0), this.right.pop();
422
+ }
423
+ slice(n, r) {
424
+ const t = r ?? Number.POSITIVE_INFINITY;
425
+ return t < this.left.length ? this.left.slice(n, t) : n > this.left.length ? this.right.slice(this.right.length - t + this.left.length, this.right.length - n + this.left.length).reverse() : this.left.slice(n).concat(this.right.slice(this.right.length - t + this.left.length).reverse());
426
+ }
427
+ splice(n, r, t) {
428
+ const e = r || 0;
429
+ this.setCursor(Math.trunc(n));
430
+ const a = this.right.splice(this.right.length - e, Number.POSITIVE_INFINITY);
431
+ return t && dn(this.left, t), a.reverse();
432
+ }
433
+ pop() {
434
+ return this.setCursor(Number.POSITIVE_INFINITY), this.left.pop();
435
+ }
436
+ push(n) {
437
+ this.setCursor(Number.POSITIVE_INFINITY), this.left.push(n);
438
+ }
439
+ pushMany(n) {
440
+ this.setCursor(Number.POSITIVE_INFINITY), dn(this.left, n);
441
+ }
442
+ unshift(n) {
443
+ this.setCursor(0), this.right.push(n);
444
+ }
445
+ unshiftMany(n) {
446
+ this.setCursor(0), dn(this.right, n.reverse());
447
+ }
448
+ setCursor(n) {
449
+ if (!(n === this.left.length || n > this.left.length && this.right.length === 0 || n < 0 && this.left.length === 0))
450
+ if (n < this.left.length) {
451
+ const r = this.left.splice(n, Number.POSITIVE_INFINITY);
452
+ dn(this.right, r.reverse());
453
+ } else {
454
+ const r = this.right.splice(this.left.length + this.right.length - n, Number.POSITIVE_INFINITY);
455
+ dn(this.left, r.reverse());
456
+ }
457
+ }
458
+ };
459
+ function dn(n, r) {
460
+ let t = 0;
461
+ if (r.length < 1e4) n.push(...r);
462
+ else for (; t < r.length; )
463
+ n.push(...r.slice(t, t + 1e4)), t += 1e4;
464
+ }
465
+ function Xn(n) {
466
+ const r = {};
467
+ let t = -1, e, a, i, u, s, f, c;
468
+ const m = new Ht(n);
469
+ for (; ++t < m.length; ) {
470
+ for (; t in r; ) t = r[t];
471
+ if (e = m.get(t), t && e[1].type === "chunkFlow" && m.get(t - 1)[1].type === "listItemPrefix" && (f = e[1]._tokenizer.events, i = 0, i < f.length && f[i][1].type === "lineEndingBlank" && (i += 2), i < f.length && f[i][1].type === "content"))
472
+ for (; ++i < f.length && f[i][1].type !== "content"; )
473
+ f[i][1].type === "chunkText" && (f[i][1]._isInFirstContentOfListItem = !0, i++);
474
+ if (e[0] === "enter")
475
+ e[1].contentType && (Object.assign(r, Vt(m, t)), t = r[t], c = !0);
476
+ else if (e[1]._container) {
477
+ for (i = t, a = void 0; i--; )
478
+ if (u = m.get(i), u[1].type === "lineEnding" || u[1].type === "lineEndingBlank")
479
+ u[0] === "enter" && (a && (m.get(a)[1].type = "lineEndingBlank"), u[1].type = "lineEnding", a = i);
480
+ else if (!(u[1].type === "linePrefix" || u[1].type === "listItemIndent"))
481
+ break;
482
+ a && (e[1].end = { ...m.get(a)[1].start }, s = m.slice(a, t), s.unshift(e), m.splice(a, t - a + 1, s));
483
+ }
484
+ }
485
+ return on(n, 0, Number.POSITIVE_INFINITY, m.slice(0)), !c;
486
+ }
487
+ function Vt(n, r) {
488
+ const t = n.get(r)[1], e = n.get(r)[2];
489
+ let a = r - 1;
490
+ const i = [];
491
+ let u = t._tokenizer;
492
+ u || (u = e.parser[t.contentType](t.start), t._contentTypeTextTrailing && (u._contentTypeTextTrailing = !0));
493
+ const s = u.events, f = [], c = {};
494
+ let m, p, g = -1, h = t, E = 0, T = 0;
495
+ const D = [T];
496
+ for (; h; ) {
497
+ for (; n.get(++a)[1] !== h; ) ;
498
+ i.push(a), h._tokenizer || (m = e.sliceStream(h), h.next || m.push(null), p && u.defineSkip(h.start), h._isInFirstContentOfListItem && (u._gfmTasklistFirstContentOfListItem = !0), u.write(m), h._isInFirstContentOfListItem && (u._gfmTasklistFirstContentOfListItem = void 0)), p = h, h = h.next;
499
+ }
500
+ for (h = t; ++g < s.length; ) s[g][0] === "exit" && s[g - 1][0] === "enter" && s[g][1].type === s[g - 1][1].type && s[g][1].start.line !== s[g][1].end.line && (T = g + 1, D.push(T), h._tokenizer = void 0, h.previous = void 0, h = h.next);
501
+ for (u.events = [], h ? (h._tokenizer = void 0, h.previous = void 0) : D.pop(), g = D.length; g--; ) {
502
+ const S = s.slice(D[g], D[g + 1]), R = i.pop();
503
+ f.push([R, R + S.length - 1]), n.splice(R, 2, S);
504
+ }
505
+ for (f.reverse(), g = -1; ++g < f.length; )
506
+ c[E + f[g][0]] = E + f[g][1], E += f[g][1] - f[g][0] - 1;
507
+ return c;
508
+ }
509
+ var Qt = {
510
+ resolve: jt,
511
+ tokenize: Wt
512
+ }, Ut = {
513
+ partial: !0,
514
+ tokenize: Yt
515
+ };
516
+ function jt(n) {
517
+ return Xn(n), n;
518
+ }
519
+ function Wt(n, r) {
520
+ let t;
521
+ return e;
522
+ function e(s) {
523
+ return n.enter("content"), t = n.enter("chunkContent", { contentType: "content" }), a(s);
524
+ }
525
+ function a(s) {
526
+ return s === null ? i(s) : w(s) ? n.check(Ut, u, i)(s) : (n.consume(s), a);
527
+ }
528
+ function i(s) {
529
+ return n.exit("chunkContent"), n.exit("content"), r(s);
530
+ }
531
+ function u(s) {
532
+ return n.consume(s), n.exit("chunkContent"), t.next = n.enter("chunkContent", {
533
+ contentType: "content",
534
+ previous: t
535
+ }), t = t.next, a;
536
+ }
537
+ }
538
+ function Yt(n, r, t) {
539
+ const e = this;
540
+ return a;
541
+ function a(u) {
542
+ return n.exit("chunkContent"), n.enter("lineEnding"), n.consume(u), n.exit("lineEnding"), L(n, i, "linePrefix");
543
+ }
544
+ function i(u) {
545
+ if (u === null || w(u)) return t(u);
546
+ const s = e.events[e.events.length - 1];
547
+ return !e.parser.constructs.disable.null.includes("codeIndented") && s && s[1].type === "linePrefix" && s[2].sliceSerialize(s[1], !0).length >= 4 ? r(u) : n.interrupt(e.parser.constructs.flow, t, r)(u);
548
+ }
549
+ }
550
+ function Zn(n, r, t, e, a, i, u, s, f) {
551
+ const c = f || Number.POSITIVE_INFINITY;
552
+ let m = 0;
553
+ return p;
554
+ function p(S) {
555
+ return S === 60 ? (n.enter(e), n.enter(a), n.enter(i), n.consume(S), n.exit(i), g) : S === null || S === 32 || S === 41 || En(S) ? t(S) : (n.enter(e), n.enter(u), n.enter(s), n.enter("chunkString", { contentType: "string" }), T(S));
556
+ }
557
+ function g(S) {
558
+ return S === 62 ? (n.enter(i), n.consume(S), n.exit(i), n.exit(a), n.exit(e), r) : (n.enter(s), n.enter("chunkString", { contentType: "string" }), h(S));
559
+ }
560
+ function h(S) {
561
+ return S === 62 ? (n.exit("chunkString"), n.exit(s), g(S)) : S === null || S === 60 || w(S) ? t(S) : (n.consume(S), S === 92 ? E : h);
562
+ }
563
+ function E(S) {
564
+ return S === 60 || S === 62 || S === 92 ? (n.consume(S), h) : h(S);
565
+ }
566
+ function T(S) {
567
+ return !m && (S === null || S === 41 || Y(S)) ? (n.exit("chunkString"), n.exit(s), n.exit(u), n.exit(e), r(S)) : m < c && S === 40 ? (n.consume(S), m++, T) : S === 41 ? (n.consume(S), m--, T) : S === null || S === 32 || S === 40 || En(S) ? t(S) : (n.consume(S), S === 92 ? D : T);
568
+ }
569
+ function D(S) {
570
+ return S === 40 || S === 41 || S === 92 ? (n.consume(S), T) : T(S);
571
+ }
572
+ }
573
+ function nt(n, r, t, e, a, i) {
574
+ const u = this;
575
+ let s = 0, f;
576
+ return c;
577
+ function c(h) {
578
+ return n.enter(e), n.enter(a), n.consume(h), n.exit(a), n.enter(i), m;
579
+ }
580
+ function m(h) {
581
+ return s > 999 || h === null || h === 91 || h === 93 && !f || /* c8 ignore next 3 */
582
+ h === 94 && !s && "_hiddenFootnoteSupport" in u.parser.constructs ? t(h) : h === 93 ? (n.exit(i), n.enter(a), n.consume(h), n.exit(a), n.exit(e), r) : w(h) ? (n.enter("lineEnding"), n.consume(h), n.exit("lineEnding"), m) : (n.enter("chunkString", { contentType: "string" }), p(h));
583
+ }
584
+ function p(h) {
585
+ return h === null || h === 91 || h === 93 || w(h) || s++ > 999 ? (n.exit("chunkString"), m(h)) : (n.consume(h), f || (f = !v(h)), h === 92 ? g : p);
586
+ }
587
+ function g(h) {
588
+ return h === 91 || h === 92 || h === 93 ? (n.consume(h), s++, p) : p(h);
589
+ }
590
+ }
591
+ function tt(n, r, t, e, a, i) {
592
+ let u;
593
+ return s;
594
+ function s(g) {
595
+ return g === 34 || g === 39 || g === 40 ? (n.enter(e), n.enter(a), n.consume(g), n.exit(a), u = g === 40 ? 41 : g, f) : t(g);
596
+ }
597
+ function f(g) {
598
+ return g === u ? (n.enter(a), n.consume(g), n.exit(a), n.exit(e), r) : (n.enter(i), c(g));
599
+ }
600
+ function c(g) {
601
+ return g === u ? (n.exit(i), f(u)) : g === null ? t(g) : w(g) ? (n.enter("lineEnding"), n.consume(g), n.exit("lineEnding"), L(n, c, "linePrefix")) : (n.enter("chunkString", { contentType: "string" }), m(g));
602
+ }
603
+ function m(g) {
604
+ return g === u || g === null || w(g) ? (n.exit("chunkString"), c(g)) : (n.consume(g), g === 92 ? p : m);
605
+ }
606
+ function p(g) {
607
+ return g === u || g === 92 ? (n.consume(g), m) : m(g);
608
+ }
609
+ }
610
+ function Sn(n, r) {
611
+ let t;
612
+ return e;
613
+ function e(a) {
614
+ return w(a) ? (n.enter("lineEnding"), n.consume(a), n.exit("lineEnding"), t = !0, e) : v(a) ? L(n, e, t ? "linePrefix" : "lineSuffix")(a) : r(a);
615
+ }
616
+ }
617
+ var $t = {
618
+ name: "definition",
619
+ tokenize: Jt
620
+ }, Gt = {
621
+ partial: !0,
622
+ tokenize: Kt
623
+ };
624
+ function Jt(n, r, t) {
625
+ const e = this;
626
+ let a;
627
+ return i;
628
+ function i(h) {
629
+ return n.enter("definition"), u(h);
630
+ }
631
+ function u(h) {
632
+ return nt.call(e, n, s, t, "definitionLabel", "definitionLabelMarker", "definitionLabelString")(h);
633
+ }
634
+ function s(h) {
635
+ return a = fn(e.sliceSerialize(e.events[e.events.length - 1][1]).slice(1, -1)), h === 58 ? (n.enter("definitionMarker"), n.consume(h), n.exit("definitionMarker"), f) : t(h);
636
+ }
637
+ function f(h) {
638
+ return Y(h) ? Sn(n, c)(h) : c(h);
639
+ }
640
+ function c(h) {
641
+ return Zn(n, m, t, "definitionDestination", "definitionDestinationLiteral", "definitionDestinationLiteralMarker", "definitionDestinationRaw", "definitionDestinationString")(h);
642
+ }
643
+ function m(h) {
644
+ return n.attempt(Gt, p, p)(h);
645
+ }
646
+ function p(h) {
647
+ return v(h) ? L(n, g, "whitespace")(h) : g(h);
648
+ }
649
+ function g(h) {
650
+ return h === null || w(h) ? (n.exit("definition"), e.parser.defined.push(a), r(h)) : t(h);
651
+ }
652
+ }
653
+ function Kt(n, r, t) {
654
+ return e;
655
+ function e(s) {
656
+ return Y(s) ? Sn(n, a)(s) : t(s);
657
+ }
658
+ function a(s) {
659
+ return tt(n, i, t, "definitionTitle", "definitionTitleMarker", "definitionTitleString")(s);
660
+ }
661
+ function i(s) {
662
+ return v(s) ? L(n, u, "whitespace")(s) : u(s);
663
+ }
664
+ function u(s) {
665
+ return s === null || w(s) ? r(s) : t(s);
666
+ }
667
+ }
668
+ var Xt = {
669
+ name: "hardBreakEscape",
670
+ tokenize: Zt
671
+ };
672
+ function Zt(n, r, t) {
673
+ return e;
674
+ function e(i) {
675
+ return n.enter("hardBreakEscape"), n.consume(i), a;
676
+ }
677
+ function a(i) {
678
+ return w(i) ? (n.exit("hardBreakEscape"), r(i)) : t(i);
679
+ }
680
+ }
681
+ var ne = {
682
+ name: "headingAtx",
683
+ resolve: te,
684
+ tokenize: ee
685
+ };
686
+ function te(n, r) {
687
+ let t = n.length - 2, e = 3, a, i;
688
+ return n[e][1].type === "whitespace" && (e += 2), t - 2 > e && n[t][1].type === "whitespace" && (t -= 2), n[t][1].type === "atxHeadingSequence" && (e === t - 1 || t - 4 > e && n[t - 2][1].type === "whitespace") && (t -= e + 1 === t ? 2 : 4), t > e && (a = {
689
+ type: "atxHeadingText",
690
+ start: n[e][1].start,
691
+ end: n[t][1].end
692
+ }, i = {
693
+ type: "chunkText",
694
+ start: n[e][1].start,
695
+ end: n[t][1].end,
696
+ contentType: "text"
697
+ }, on(n, e, t - e + 1, [
698
+ [
699
+ "enter",
700
+ a,
701
+ r
702
+ ],
703
+ [
704
+ "enter",
705
+ i,
706
+ r
707
+ ],
708
+ [
709
+ "exit",
710
+ i,
711
+ r
712
+ ],
713
+ [
714
+ "exit",
715
+ a,
716
+ r
717
+ ]
718
+ ])), n;
719
+ }
720
+ function ee(n, r, t) {
721
+ let e = 0;
722
+ return a;
723
+ function a(m) {
724
+ return n.enter("atxHeading"), i(m);
725
+ }
726
+ function i(m) {
727
+ return n.enter("atxHeadingSequence"), u(m);
728
+ }
729
+ function u(m) {
730
+ return m === 35 && e++ < 6 ? (n.consume(m), u) : m === null || Y(m) ? (n.exit("atxHeadingSequence"), s(m)) : t(m);
731
+ }
732
+ function s(m) {
733
+ return m === 35 ? (n.enter("atxHeadingSequence"), f(m)) : m === null || w(m) ? (n.exit("atxHeading"), r(m)) : v(m) ? L(n, s, "whitespace")(m) : (n.enter("atxHeadingText"), c(m));
734
+ }
735
+ function f(m) {
736
+ return m === 35 ? (n.consume(m), f) : (n.exit("atxHeadingSequence"), s(m));
737
+ }
738
+ function c(m) {
739
+ return m === null || m === 35 || Y(m) ? (n.exit("atxHeadingText"), s(m)) : (n.consume(m), c);
740
+ }
741
+ }
742
+ var re = [
743
+ "address",
744
+ "article",
745
+ "aside",
746
+ "base",
747
+ "basefont",
748
+ "blockquote",
749
+ "body",
750
+ "caption",
751
+ "center",
752
+ "col",
753
+ "colgroup",
754
+ "dd",
755
+ "details",
756
+ "dialog",
757
+ "dir",
758
+ "div",
759
+ "dl",
760
+ "dt",
761
+ "fieldset",
762
+ "figcaption",
763
+ "figure",
764
+ "footer",
765
+ "form",
766
+ "frame",
767
+ "frameset",
768
+ "h1",
769
+ "h2",
770
+ "h3",
771
+ "h4",
772
+ "h5",
773
+ "h6",
774
+ "head",
775
+ "header",
776
+ "hr",
777
+ "html",
778
+ "iframe",
779
+ "legend",
780
+ "li",
781
+ "link",
782
+ "main",
783
+ "menu",
784
+ "menuitem",
785
+ "nav",
786
+ "noframes",
787
+ "ol",
788
+ "optgroup",
789
+ "option",
790
+ "p",
791
+ "param",
792
+ "search",
793
+ "section",
794
+ "summary",
795
+ "table",
796
+ "tbody",
797
+ "td",
798
+ "tfoot",
799
+ "th",
800
+ "thead",
801
+ "title",
802
+ "tr",
803
+ "track",
804
+ "ul"
805
+ ], Vn = [
806
+ "pre",
807
+ "script",
808
+ "style",
809
+ "textarea"
810
+ ], ie = {
811
+ concrete: !0,
812
+ name: "htmlFlow",
813
+ resolveTo: le,
814
+ tokenize: oe
815
+ }, ue = {
816
+ partial: !0,
817
+ tokenize: he
818
+ }, ae = {
819
+ partial: !0,
820
+ tokenize: se
821
+ };
822
+ function le(n) {
823
+ let r = n.length;
824
+ for (; r-- && !(n[r][0] === "enter" && n[r][1].type === "htmlFlow"); ) ;
825
+ return r > 1 && n[r - 2][1].type === "linePrefix" && (n[r][1].start = n[r - 2][1].start, n[r + 1][1].start = n[r - 2][1].start, n.splice(r - 2, 2)), n;
826
+ }
827
+ function oe(n, r, t) {
828
+ const e = this;
829
+ let a, i, u, s, f;
830
+ return c;
831
+ function c(o) {
832
+ return m(o);
833
+ }
834
+ function m(o) {
835
+ return n.enter("htmlFlow"), n.enter("htmlFlowData"), n.consume(o), p;
836
+ }
837
+ function p(o) {
838
+ return o === 33 ? (n.consume(o), g) : o === 47 ? (n.consume(o), i = !0, T) : o === 63 ? (n.consume(o), a = 3, e.interrupt ? r : l) : K(o) ? (n.consume(o), u = String.fromCharCode(o), D) : t(o);
839
+ }
840
+ function g(o) {
841
+ return o === 45 ? (n.consume(o), a = 2, h) : o === 91 ? (n.consume(o), a = 5, s = 0, E) : K(o) ? (n.consume(o), a = 4, e.interrupt ? r : l) : t(o);
842
+ }
843
+ function h(o) {
844
+ return o === 45 ? (n.consume(o), e.interrupt ? r : l) : t(o);
845
+ }
846
+ function E(o) {
847
+ return o === "CDATA[".charCodeAt(s++) ? (n.consume(o), s === 6 ? e.interrupt ? r : y : E) : t(o);
848
+ }
849
+ function T(o) {
850
+ return K(o) ? (n.consume(o), u = String.fromCharCode(o), D) : t(o);
851
+ }
852
+ function D(o) {
853
+ if (o === null || o === 47 || o === 62 || Y(o)) {
854
+ const un = o === 47, sn = u.toLowerCase();
855
+ return !un && !i && Vn.includes(sn) ? (a = 1, e.interrupt ? r(o) : y(o)) : re.includes(u.toLowerCase()) ? (a = 6, un ? (n.consume(o), S) : e.interrupt ? r(o) : y(o)) : (a = 7, e.interrupt && !e.parser.lazy[e.now().line] ? t(o) : i ? R(o) : b(o));
856
+ }
857
+ return o === 45 || J(o) ? (n.consume(o), u += String.fromCharCode(o), D) : t(o);
858
+ }
859
+ function S(o) {
860
+ return o === 62 ? (n.consume(o), e.interrupt ? r : y) : t(o);
861
+ }
862
+ function R(o) {
863
+ return v(o) ? (n.consume(o), R) : A(o);
864
+ }
865
+ function b(o) {
866
+ return o === 47 ? (n.consume(o), A) : o === 58 || o === 95 || K(o) ? (n.consume(o), M) : v(o) ? (n.consume(o), b) : A(o);
867
+ }
868
+ function M(o) {
869
+ return o === 45 || o === 46 || o === 58 || o === 95 || J(o) ? (n.consume(o), M) : N(o);
870
+ }
871
+ function N(o) {
872
+ return o === 61 ? (n.consume(o), k) : v(o) ? (n.consume(o), N) : b(o);
873
+ }
874
+ function k(o) {
875
+ return o === null || o === 60 || o === 61 || o === 62 || o === 96 ? t(o) : o === 34 || o === 39 ? (n.consume(o), f = o, F) : v(o) ? (n.consume(o), k) : q(o);
876
+ }
877
+ function F(o) {
878
+ return o === f ? (n.consume(o), f = null, B) : o === null || w(o) ? t(o) : (n.consume(o), F);
879
+ }
880
+ function q(o) {
881
+ return o === null || o === 34 || o === 39 || o === 47 || o === 60 || o === 61 || o === 62 || o === 96 || Y(o) ? N(o) : (n.consume(o), q);
882
+ }
883
+ function B(o) {
884
+ return o === 47 || o === 62 || v(o) ? b(o) : t(o);
885
+ }
886
+ function A(o) {
887
+ return o === 62 ? (n.consume(o), I) : t(o);
888
+ }
889
+ function I(o) {
890
+ return o === null || w(o) ? y(o) : v(o) ? (n.consume(o), I) : t(o);
891
+ }
892
+ function y(o) {
893
+ return o === 45 && a === 2 ? (n.consume(o), U) : o === 60 && a === 1 ? (n.consume(o), V) : o === 62 && a === 4 ? (n.consume(o), rn) : o === 63 && a === 3 ? (n.consume(o), l) : o === 93 && a === 5 ? (n.consume(o), X) : w(o) && (a === 6 || a === 7) ? (n.exit("htmlFlowData"), n.check(ue, Z, O)(o)) : o === null || w(o) ? (n.exit("htmlFlowData"), O(o)) : (n.consume(o), y);
894
+ }
895
+ function O(o) {
896
+ return n.check(ae, H, Z)(o);
897
+ }
898
+ function H(o) {
899
+ return n.enter("lineEnding"), n.consume(o), n.exit("lineEnding"), C;
900
+ }
901
+ function C(o) {
902
+ return o === null || w(o) ? O(o) : (n.enter("htmlFlowData"), y(o));
903
+ }
904
+ function U(o) {
905
+ return o === 45 ? (n.consume(o), l) : y(o);
906
+ }
907
+ function V(o) {
908
+ return o === 47 ? (n.consume(o), u = "", G) : y(o);
909
+ }
910
+ function G(o) {
911
+ if (o === 62) {
912
+ const un = u.toLowerCase();
913
+ return Vn.includes(un) ? (n.consume(o), rn) : y(o);
914
+ }
915
+ return K(o) && u.length < 8 ? (n.consume(o), u += String.fromCharCode(o), G) : y(o);
916
+ }
917
+ function X(o) {
918
+ return o === 93 ? (n.consume(o), l) : y(o);
919
+ }
920
+ function l(o) {
921
+ return o === 62 ? (n.consume(o), rn) : o === 45 && a === 2 ? (n.consume(o), l) : y(o);
922
+ }
923
+ function rn(o) {
924
+ return o === null || w(o) ? (n.exit("htmlFlowData"), Z(o)) : (n.consume(o), rn);
925
+ }
926
+ function Z(o) {
927
+ return n.exit("htmlFlow"), r(o);
928
+ }
929
+ }
930
+ function se(n, r, t) {
931
+ const e = this;
932
+ return a;
933
+ function a(u) {
934
+ return w(u) ? (n.enter("lineEnding"), n.consume(u), n.exit("lineEnding"), i) : t(u);
935
+ }
936
+ function i(u) {
937
+ return e.parser.lazy[e.now().line] ? t(u) : r(u);
938
+ }
939
+ }
940
+ function he(n, r, t) {
941
+ return e;
942
+ function e(a) {
943
+ return n.enter("lineEnding"), n.consume(a), n.exit("lineEnding"), n.attempt(In, r, t);
944
+ }
945
+ }
946
+ var ce = {
947
+ name: "htmlText",
948
+ tokenize: pe
949
+ };
950
+ function pe(n, r, t) {
951
+ const e = this;
952
+ let a, i, u;
953
+ return s;
954
+ function s(l) {
955
+ return n.enter("htmlText"), n.enter("htmlTextData"), n.consume(l), f;
956
+ }
957
+ function f(l) {
958
+ return l === 33 ? (n.consume(l), c) : l === 47 ? (n.consume(l), N) : l === 63 ? (n.consume(l), b) : K(l) ? (n.consume(l), q) : t(l);
959
+ }
960
+ function c(l) {
961
+ return l === 45 ? (n.consume(l), m) : l === 91 ? (n.consume(l), i = 0, E) : K(l) ? (n.consume(l), R) : t(l);
962
+ }
963
+ function m(l) {
964
+ return l === 45 ? (n.consume(l), h) : t(l);
965
+ }
966
+ function p(l) {
967
+ return l === null ? t(l) : l === 45 ? (n.consume(l), g) : w(l) ? (u = p, V(l)) : (n.consume(l), p);
968
+ }
969
+ function g(l) {
970
+ return l === 45 ? (n.consume(l), h) : p(l);
971
+ }
972
+ function h(l) {
973
+ return l === 62 ? U(l) : l === 45 ? g(l) : p(l);
974
+ }
975
+ function E(l) {
976
+ return l === "CDATA[".charCodeAt(i++) ? (n.consume(l), i === 6 ? T : E) : t(l);
977
+ }
978
+ function T(l) {
979
+ return l === null ? t(l) : l === 93 ? (n.consume(l), D) : w(l) ? (u = T, V(l)) : (n.consume(l), T);
980
+ }
981
+ function D(l) {
982
+ return l === 93 ? (n.consume(l), S) : T(l);
983
+ }
984
+ function S(l) {
985
+ return l === 62 ? U(l) : l === 93 ? (n.consume(l), S) : T(l);
986
+ }
987
+ function R(l) {
988
+ return l === null || l === 62 ? U(l) : w(l) ? (u = R, V(l)) : (n.consume(l), R);
989
+ }
990
+ function b(l) {
991
+ return l === null ? t(l) : l === 63 ? (n.consume(l), M) : w(l) ? (u = b, V(l)) : (n.consume(l), b);
992
+ }
993
+ function M(l) {
994
+ return l === 62 ? U(l) : b(l);
995
+ }
996
+ function N(l) {
997
+ return K(l) ? (n.consume(l), k) : t(l);
998
+ }
999
+ function k(l) {
1000
+ return l === 45 || J(l) ? (n.consume(l), k) : F(l);
1001
+ }
1002
+ function F(l) {
1003
+ return w(l) ? (u = F, V(l)) : v(l) ? (n.consume(l), F) : U(l);
1004
+ }
1005
+ function q(l) {
1006
+ return l === 45 || J(l) ? (n.consume(l), q) : l === 47 || l === 62 || Y(l) ? B(l) : t(l);
1007
+ }
1008
+ function B(l) {
1009
+ return l === 47 ? (n.consume(l), U) : l === 58 || l === 95 || K(l) ? (n.consume(l), A) : w(l) ? (u = B, V(l)) : v(l) ? (n.consume(l), B) : U(l);
1010
+ }
1011
+ function A(l) {
1012
+ return l === 45 || l === 46 || l === 58 || l === 95 || J(l) ? (n.consume(l), A) : I(l);
1013
+ }
1014
+ function I(l) {
1015
+ return l === 61 ? (n.consume(l), y) : w(l) ? (u = I, V(l)) : v(l) ? (n.consume(l), I) : B(l);
1016
+ }
1017
+ function y(l) {
1018
+ return l === null || l === 60 || l === 61 || l === 62 || l === 96 ? t(l) : l === 34 || l === 39 ? (n.consume(l), a = l, O) : w(l) ? (u = y, V(l)) : v(l) ? (n.consume(l), y) : (n.consume(l), H);
1019
+ }
1020
+ function O(l) {
1021
+ return l === a ? (n.consume(l), a = void 0, C) : l === null ? t(l) : w(l) ? (u = O, V(l)) : (n.consume(l), O);
1022
+ }
1023
+ function H(l) {
1024
+ return l === null || l === 34 || l === 39 || l === 60 || l === 61 || l === 96 ? t(l) : l === 47 || l === 62 || Y(l) ? B(l) : (n.consume(l), H);
1025
+ }
1026
+ function C(l) {
1027
+ return l === 47 || l === 62 || Y(l) ? B(l) : t(l);
1028
+ }
1029
+ function U(l) {
1030
+ return l === 62 ? (n.consume(l), n.exit("htmlTextData"), n.exit("htmlText"), r) : t(l);
1031
+ }
1032
+ function V(l) {
1033
+ return n.exit("htmlTextData"), n.enter("lineEnding"), n.consume(l), n.exit("lineEnding"), G;
1034
+ }
1035
+ function G(l) {
1036
+ return v(l) ? L(n, X, "linePrefix", e.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(l) : X(l);
1037
+ }
1038
+ function X(l) {
1039
+ return n.enter("htmlTextData"), u(l);
1040
+ }
1041
+ }
1042
+ var Bn = {
1043
+ name: "labelEnd",
1044
+ resolveAll: xe,
1045
+ resolveTo: ke,
1046
+ tokenize: de
1047
+ }, me = { tokenize: Se }, fe = { tokenize: be }, ge = { tokenize: ye };
1048
+ function xe(n) {
1049
+ let r = -1;
1050
+ const t = [];
1051
+ for (; ++r < n.length; ) {
1052
+ const e = n[r][1];
1053
+ if (t.push(n[r]), e.type === "labelImage" || e.type === "labelLink" || e.type === "labelEnd") {
1054
+ const a = e.type === "labelImage" ? 4 : 2;
1055
+ e.type = "data", r += a;
1056
+ }
1057
+ }
1058
+ return n.length !== t.length && on(n, 0, n.length, t), n;
1059
+ }
1060
+ function ke(n, r) {
1061
+ let t = n.length, e = 0, a, i, u, s;
1062
+ for (; t--; )
1063
+ if (a = n[t][1], i) {
1064
+ if (a.type === "link" || a.type === "labelLink" && a._inactive) break;
1065
+ n[t][0] === "enter" && a.type === "labelLink" && (a._inactive = !0);
1066
+ } else if (u) {
1067
+ if (n[t][0] === "enter" && (a.type === "labelImage" || a.type === "labelLink") && !a._balanced && (i = t, a.type !== "labelLink")) {
1068
+ e = 2;
1069
+ break;
1070
+ }
1071
+ } else a.type === "labelEnd" && (u = t);
1072
+ const f = {
1073
+ type: n[i][1].type === "labelLink" ? "link" : "image",
1074
+ start: { ...n[i][1].start },
1075
+ end: { ...n[n.length - 1][1].end }
1076
+ }, c = {
1077
+ type: "label",
1078
+ start: { ...n[i][1].start },
1079
+ end: { ...n[u][1].end }
1080
+ }, m = {
1081
+ type: "labelText",
1082
+ start: { ...n[i + e + 2][1].end },
1083
+ end: { ...n[u - 2][1].start }
1084
+ };
1085
+ return s = [[
1086
+ "enter",
1087
+ f,
1088
+ r
1089
+ ], [
1090
+ "enter",
1091
+ c,
1092
+ r
1093
+ ]], s = $(s, n.slice(i + 1, i + e + 3)), s = $(s, [[
1094
+ "enter",
1095
+ m,
1096
+ r
1097
+ ]]), s = $(s, Fn(r.parser.constructs.insideSpan.null, n.slice(i + e + 4, u - 3), r)), s = $(s, [
1098
+ [
1099
+ "exit",
1100
+ m,
1101
+ r
1102
+ ],
1103
+ n[u - 2],
1104
+ n[u - 1],
1105
+ [
1106
+ "exit",
1107
+ c,
1108
+ r
1109
+ ]
1110
+ ]), s = $(s, n.slice(u + 1)), s = $(s, [[
1111
+ "exit",
1112
+ f,
1113
+ r
1114
+ ]]), on(n, i, n.length, s), n;
1115
+ }
1116
+ function de(n, r, t) {
1117
+ const e = this;
1118
+ let a = e.events.length, i, u;
1119
+ for (; a--; ) if ((e.events[a][1].type === "labelImage" || e.events[a][1].type === "labelLink") && !e.events[a][1]._balanced) {
1120
+ i = e.events[a][1];
1121
+ break;
1122
+ }
1123
+ return s;
1124
+ function s(g) {
1125
+ return i ? i._inactive ? p(g) : (u = e.parser.defined.includes(fn(e.sliceSerialize({
1126
+ start: i.end,
1127
+ end: e.now()
1128
+ }))), n.enter("labelEnd"), n.enter("labelMarker"), n.consume(g), n.exit("labelMarker"), n.exit("labelEnd"), f) : t(g);
1129
+ }
1130
+ function f(g) {
1131
+ return g === 40 ? n.attempt(me, m, u ? m : p)(g) : g === 91 ? n.attempt(fe, m, u ? c : p)(g) : u ? m(g) : p(g);
1132
+ }
1133
+ function c(g) {
1134
+ return n.attempt(ge, m, p)(g);
1135
+ }
1136
+ function m(g) {
1137
+ return r(g);
1138
+ }
1139
+ function p(g) {
1140
+ return i._balanced = !0, t(g);
1141
+ }
1142
+ }
1143
+ function Se(n, r, t) {
1144
+ return e;
1145
+ function e(p) {
1146
+ return n.enter("resource"), n.enter("resourceMarker"), n.consume(p), n.exit("resourceMarker"), a;
1147
+ }
1148
+ function a(p) {
1149
+ return Y(p) ? Sn(n, i)(p) : i(p);
1150
+ }
1151
+ function i(p) {
1152
+ return p === 41 ? m(p) : Zn(n, u, s, "resourceDestination", "resourceDestinationLiteral", "resourceDestinationLiteralMarker", "resourceDestinationRaw", "resourceDestinationString", 32)(p);
1153
+ }
1154
+ function u(p) {
1155
+ return Y(p) ? Sn(n, f)(p) : m(p);
1156
+ }
1157
+ function s(p) {
1158
+ return t(p);
1159
+ }
1160
+ function f(p) {
1161
+ return p === 34 || p === 39 || p === 40 ? tt(n, c, t, "resourceTitle", "resourceTitleMarker", "resourceTitleString")(p) : m(p);
1162
+ }
1163
+ function c(p) {
1164
+ return Y(p) ? Sn(n, m)(p) : m(p);
1165
+ }
1166
+ function m(p) {
1167
+ return p === 41 ? (n.enter("resourceMarker"), n.consume(p), n.exit("resourceMarker"), n.exit("resource"), r) : t(p);
1168
+ }
1169
+ }
1170
+ function be(n, r, t) {
1171
+ const e = this;
1172
+ return a;
1173
+ function a(s) {
1174
+ return nt.call(e, n, i, u, "reference", "referenceMarker", "referenceString")(s);
1175
+ }
1176
+ function i(s) {
1177
+ return e.parser.defined.includes(fn(e.sliceSerialize(e.events[e.events.length - 1][1]).slice(1, -1))) ? r(s) : t(s);
1178
+ }
1179
+ function u(s) {
1180
+ return t(s);
1181
+ }
1182
+ }
1183
+ function ye(n, r, t) {
1184
+ return e;
1185
+ function e(i) {
1186
+ return n.enter("reference"), n.enter("referenceMarker"), n.consume(i), n.exit("referenceMarker"), a;
1187
+ }
1188
+ function a(i) {
1189
+ return i === 93 ? (n.enter("referenceMarker"), n.consume(i), n.exit("referenceMarker"), n.exit("reference"), r) : t(i);
1190
+ }
1191
+ }
1192
+ var Ie = {
1193
+ name: "labelStartImage",
1194
+ resolveAll: Bn.resolveAll,
1195
+ tokenize: we
1196
+ };
1197
+ function we(n, r, t) {
1198
+ const e = this;
1199
+ return a;
1200
+ function a(s) {
1201
+ return n.enter("labelImage"), n.enter("labelImageMarker"), n.consume(s), n.exit("labelImageMarker"), i;
1202
+ }
1203
+ function i(s) {
1204
+ return s === 91 ? (n.enter("labelMarker"), n.consume(s), n.exit("labelMarker"), n.exit("labelImage"), u) : t(s);
1205
+ }
1206
+ function u(s) {
1207
+ return s === 94 && "_hiddenFootnoteSupport" in e.parser.constructs ? t(s) : r(s);
1208
+ }
1209
+ }
1210
+ var ze = {
1211
+ name: "labelStartLink",
1212
+ resolveAll: Bn.resolveAll,
1213
+ tokenize: Ce
1214
+ };
1215
+ function Ce(n, r, t) {
1216
+ const e = this;
1217
+ return a;
1218
+ function a(u) {
1219
+ return n.enter("labelLink"), n.enter("labelMarker"), n.consume(u), n.exit("labelMarker"), n.exit("labelLink"), i;
1220
+ }
1221
+ function i(u) {
1222
+ return u === 94 && "_hiddenFootnoteSupport" in e.parser.constructs ? t(u) : r(u);
1223
+ }
1224
+ }
1225
+ var zn = {
1226
+ name: "lineEnding",
1227
+ tokenize: Ee
1228
+ };
1229
+ function Ee(n, r) {
1230
+ return t;
1231
+ function t(e) {
1232
+ return n.enter("lineEnding"), n.consume(e), n.exit("lineEnding"), L(n, r, "linePrefix");
1233
+ }
1234
+ }
1235
+ var yn = {
1236
+ name: "thematicBreak",
1237
+ tokenize: Te
1238
+ };
1239
+ function Te(n, r, t) {
1240
+ let e = 0, a;
1241
+ return i;
1242
+ function i(c) {
1243
+ return n.enter("thematicBreak"), u(c);
1244
+ }
1245
+ function u(c) {
1246
+ return a = c, s(c);
1247
+ }
1248
+ function s(c) {
1249
+ return c === a ? (n.enter("thematicBreakSequence"), f(c)) : e >= 3 && (c === null || w(c)) ? (n.exit("thematicBreak"), r(c)) : t(c);
1250
+ }
1251
+ function f(c) {
1252
+ return c === a ? (n.consume(c), e++, f) : (n.exit("thematicBreakSequence"), v(c) ? L(n, s, "whitespace")(c) : s(c));
1253
+ }
1254
+ }
1255
+ var j = {
1256
+ continuation: { tokenize: Ae },
1257
+ exit: Pe,
1258
+ name: "list",
1259
+ tokenize: Be
1260
+ }, Fe = {
1261
+ partial: !0,
1262
+ tokenize: Le
1263
+ }, ve = {
1264
+ partial: !0,
1265
+ tokenize: _e
1266
+ };
1267
+ function Be(n, r, t) {
1268
+ const e = this, a = e.events[e.events.length - 1];
1269
+ let i = a && a[1].type === "linePrefix" ? a[2].sliceSerialize(a[1], !0).length : 0, u = 0;
1270
+ return s;
1271
+ function s(h) {
1272
+ const E = e.containerState.type || (h === 42 || h === 43 || h === 45 ? "listUnordered" : "listOrdered");
1273
+ if (E === "listUnordered" ? !e.containerState.marker || h === e.containerState.marker : Cn(h)) {
1274
+ if (e.containerState.type || (e.containerState.type = E, n.enter(E, { _container: !0 })), E === "listUnordered")
1275
+ return n.enter("listItemPrefix"), h === 42 || h === 45 ? n.check(yn, t, c)(h) : c(h);
1276
+ if (!e.interrupt || h === 49)
1277
+ return n.enter("listItemPrefix"), n.enter("listItemValue"), f(h);
1278
+ }
1279
+ return t(h);
1280
+ }
1281
+ function f(h) {
1282
+ return Cn(h) && ++u < 10 ? (n.consume(h), f) : (!e.interrupt || u < 2) && (e.containerState.marker ? h === e.containerState.marker : h === 41 || h === 46) ? (n.exit("listItemValue"), c(h)) : t(h);
1283
+ }
1284
+ function c(h) {
1285
+ return n.enter("listItemMarker"), n.consume(h), n.exit("listItemMarker"), e.containerState.marker = e.containerState.marker || h, n.check(In, e.interrupt ? t : m, n.attempt(Fe, g, p));
1286
+ }
1287
+ function m(h) {
1288
+ return e.containerState.initialBlankLine = !0, i++, g(h);
1289
+ }
1290
+ function p(h) {
1291
+ return v(h) ? (n.enter("listItemPrefixWhitespace"), n.consume(h), n.exit("listItemPrefixWhitespace"), g) : t(h);
1292
+ }
1293
+ function g(h) {
1294
+ return e.containerState.size = i + e.sliceSerialize(n.exit("listItemPrefix"), !0).length, r(h);
1295
+ }
1296
+ }
1297
+ function Ae(n, r, t) {
1298
+ const e = this;
1299
+ return e.containerState._closeFlow = void 0, n.check(In, a, i);
1300
+ function a(s) {
1301
+ return e.containerState.furtherBlankLines = e.containerState.furtherBlankLines || e.containerState.initialBlankLine, L(n, r, "listItemIndent", e.containerState.size + 1)(s);
1302
+ }
1303
+ function i(s) {
1304
+ return e.containerState.furtherBlankLines || !v(s) ? (e.containerState.furtherBlankLines = void 0, e.containerState.initialBlankLine = void 0, u(s)) : (e.containerState.furtherBlankLines = void 0, e.containerState.initialBlankLine = void 0, n.attempt(ve, r, u)(s));
1305
+ }
1306
+ function u(s) {
1307
+ return e.containerState._closeFlow = !0, e.interrupt = void 0, L(n, n.attempt(j, r, t), "linePrefix", e.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(s);
1308
+ }
1309
+ }
1310
+ function _e(n, r, t) {
1311
+ const e = this;
1312
+ return L(n, a, "listItemIndent", e.containerState.size + 1);
1313
+ function a(i) {
1314
+ const u = e.events[e.events.length - 1];
1315
+ return u && u[1].type === "listItemIndent" && u[2].sliceSerialize(u[1], !0).length === e.containerState.size ? r(i) : t(i);
1316
+ }
1317
+ }
1318
+ function Pe(n) {
1319
+ n.exit(this.containerState.type);
1320
+ }
1321
+ function Le(n, r, t) {
1322
+ const e = this;
1323
+ return L(n, a, "listItemPrefixWhitespace", e.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 5);
1324
+ function a(i) {
1325
+ const u = e.events[e.events.length - 1];
1326
+ return !v(i) && u && u[1].type === "listItemPrefixWhitespace" ? r(i) : t(i);
1327
+ }
1328
+ }
1329
+ var Qn = {
1330
+ name: "setextUnderline",
1331
+ resolveTo: Me,
1332
+ tokenize: Oe
1333
+ };
1334
+ function Me(n, r) {
1335
+ let t = n.length, e, a, i;
1336
+ for (; t--; ) if (n[t][0] === "enter") {
1337
+ if (n[t][1].type === "content") {
1338
+ e = t;
1339
+ break;
1340
+ }
1341
+ n[t][1].type === "paragraph" && (a = t);
1342
+ } else
1343
+ n[t][1].type === "content" && n.splice(t, 1), !i && n[t][1].type === "definition" && (i = t);
1344
+ const u = {
1345
+ type: "setextHeading",
1346
+ start: { ...n[e][1].start },
1347
+ end: { ...n[n.length - 1][1].end }
1348
+ };
1349
+ return n[a][1].type = "setextHeadingText", i ? (n.splice(a, 0, [
1350
+ "enter",
1351
+ u,
1352
+ r
1353
+ ]), n.splice(i + 1, 0, [
1354
+ "exit",
1355
+ n[e][1],
1356
+ r
1357
+ ]), n[e][1].end = { ...n[i][1].end }) : n[e][1] = u, n.push([
1358
+ "exit",
1359
+ u,
1360
+ r
1361
+ ]), n;
1362
+ }
1363
+ function Oe(n, r, t) {
1364
+ const e = this;
1365
+ let a;
1366
+ return i;
1367
+ function i(c) {
1368
+ let m = e.events.length, p;
1369
+ for (; m--; ) if (e.events[m][1].type !== "lineEnding" && e.events[m][1].type !== "linePrefix" && e.events[m][1].type !== "content") {
1370
+ p = e.events[m][1].type === "paragraph";
1371
+ break;
1372
+ }
1373
+ return !e.parser.lazy[e.now().line] && (e.interrupt || p) ? (n.enter("setextHeadingLine"), a = c, u(c)) : t(c);
1374
+ }
1375
+ function u(c) {
1376
+ return n.enter("setextHeadingLineSequence"), s(c);
1377
+ }
1378
+ function s(c) {
1379
+ return c === a ? (n.consume(c), s) : (n.exit("setextHeadingLineSequence"), v(c) ? L(n, f, "lineSuffix")(c) : f(c));
1380
+ }
1381
+ function f(c) {
1382
+ return c === null || w(c) ? (n.exit("setextHeadingLine"), r(c)) : t(c);
1383
+ }
1384
+ }
1385
+ var Ne = { tokenize: De };
1386
+ function De(n) {
1387
+ const r = n.attempt(this.parser.constructs.contentInitial, e, a);
1388
+ let t;
1389
+ return r;
1390
+ function e(s) {
1391
+ if (s === null) {
1392
+ n.consume(s);
1393
+ return;
1394
+ }
1395
+ return n.enter("lineEnding"), n.consume(s), n.exit("lineEnding"), L(n, r, "linePrefix");
1396
+ }
1397
+ function a(s) {
1398
+ return n.enter("paragraph"), i(s);
1399
+ }
1400
+ function i(s) {
1401
+ const f = n.enter("chunkText", {
1402
+ contentType: "text",
1403
+ previous: t
1404
+ });
1405
+ return t && (t.next = f), t = f, u(s);
1406
+ }
1407
+ function u(s) {
1408
+ if (s === null) {
1409
+ n.exit("chunkText"), n.exit("paragraph"), n.consume(s);
1410
+ return;
1411
+ }
1412
+ return w(s) ? (n.consume(s), n.exit("chunkText"), i) : (n.consume(s), u);
1413
+ }
1414
+ }
1415
+ var Re = { tokenize: qe }, Un = { tokenize: He };
1416
+ function qe(n) {
1417
+ const r = this, t = [];
1418
+ let e = 0, a, i, u;
1419
+ return s;
1420
+ function s(b) {
1421
+ if (e < t.length) {
1422
+ const M = t[e];
1423
+ return r.containerState = M[1], n.attempt(M[0].continuation, f, c)(b);
1424
+ }
1425
+ return c(b);
1426
+ }
1427
+ function f(b) {
1428
+ if (e++, r.containerState._closeFlow) {
1429
+ r.containerState._closeFlow = void 0, a && R();
1430
+ const M = r.events.length;
1431
+ let N = M, k;
1432
+ for (; N--; ) if (r.events[N][0] === "exit" && r.events[N][1].type === "chunkFlow") {
1433
+ k = r.events[N][1].end;
1434
+ break;
1435
+ }
1436
+ S(e);
1437
+ let F = M;
1438
+ for (; F < r.events.length; )
1439
+ r.events[F][1].end = { ...k }, F++;
1440
+ return on(r.events, N + 1, 0, r.events.slice(M)), r.events.length = F, c(b);
1441
+ }
1442
+ return s(b);
1443
+ }
1444
+ function c(b) {
1445
+ if (e === t.length) {
1446
+ if (!a) return g(b);
1447
+ if (a.currentConstruct && a.currentConstruct.concrete) return E(b);
1448
+ r.interrupt = !!(a.currentConstruct && !a._gfmTableDynamicInterruptHack);
1449
+ }
1450
+ return r.containerState = {}, n.check(Un, m, p)(b);
1451
+ }
1452
+ function m(b) {
1453
+ return a && R(), S(e), g(b);
1454
+ }
1455
+ function p(b) {
1456
+ return r.parser.lazy[r.now().line] = e !== t.length, u = r.now().offset, E(b);
1457
+ }
1458
+ function g(b) {
1459
+ return r.containerState = {}, n.attempt(Un, h, E)(b);
1460
+ }
1461
+ function h(b) {
1462
+ return e++, t.push([r.currentConstruct, r.containerState]), g(b);
1463
+ }
1464
+ function E(b) {
1465
+ if (b === null) {
1466
+ a && R(), S(0), n.consume(b);
1467
+ return;
1468
+ }
1469
+ return a = a || r.parser.flow(r.now()), n.enter("chunkFlow", {
1470
+ _tokenizer: a,
1471
+ contentType: "flow",
1472
+ previous: i
1473
+ }), T(b);
1474
+ }
1475
+ function T(b) {
1476
+ if (b === null) {
1477
+ D(n.exit("chunkFlow"), !0), S(0), n.consume(b);
1478
+ return;
1479
+ }
1480
+ return w(b) ? (n.consume(b), D(n.exit("chunkFlow")), e = 0, r.interrupt = void 0, s) : (n.consume(b), T);
1481
+ }
1482
+ function D(b, M) {
1483
+ const N = r.sliceStream(b);
1484
+ if (M && N.push(null), b.previous = i, i && (i.next = b), i = b, a.defineSkip(b.start), a.write(N), r.parser.lazy[b.start.line]) {
1485
+ let k = a.events.length;
1486
+ for (; k--; ) if (a.events[k][1].start.offset < u && (!a.events[k][1].end || a.events[k][1].end.offset > u)) return;
1487
+ const F = r.events.length;
1488
+ let q = F, B, A;
1489
+ for (; q--; ) if (r.events[q][0] === "exit" && r.events[q][1].type === "chunkFlow") {
1490
+ if (B) {
1491
+ A = r.events[q][1].end;
1492
+ break;
1493
+ }
1494
+ B = !0;
1495
+ }
1496
+ for (S(e), k = F; k < r.events.length; )
1497
+ r.events[k][1].end = { ...A }, k++;
1498
+ on(r.events, q + 1, 0, r.events.slice(F)), r.events.length = k;
1499
+ }
1500
+ }
1501
+ function S(b) {
1502
+ let M = t.length;
1503
+ for (; M-- > b; ) {
1504
+ const N = t[M];
1505
+ r.containerState = N[1], N[0].exit.call(r, n);
1506
+ }
1507
+ t.length = b;
1508
+ }
1509
+ function R() {
1510
+ a.write([null]), i = void 0, a = void 0, r.containerState._closeFlow = void 0;
1511
+ }
1512
+ }
1513
+ function He(n, r, t) {
1514
+ return L(n, n.attempt(this.parser.constructs.document, r, t), "linePrefix", this.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4);
1515
+ }
1516
+ var Ve = { tokenize: Qe };
1517
+ function Qe(n) {
1518
+ const r = this, t = n.attempt(In, e, n.attempt(this.parser.constructs.flowInitial, a, L(n, n.attempt(this.parser.constructs.flow, a, n.attempt(Qt, a)), "linePrefix")));
1519
+ return t;
1520
+ function e(i) {
1521
+ if (i === null) {
1522
+ n.consume(i);
1523
+ return;
1524
+ }
1525
+ return n.enter("lineEndingBlank"), n.consume(i), n.exit("lineEndingBlank"), r.currentConstruct = void 0, t;
1526
+ }
1527
+ function a(i) {
1528
+ if (i === null) {
1529
+ n.consume(i);
1530
+ return;
1531
+ }
1532
+ return n.enter("lineEnding"), n.consume(i), n.exit("lineEnding"), r.currentConstruct = void 0, t;
1533
+ }
1534
+ }
1535
+ var Ue = { resolveAll: rt() }, je = et("string"), We = et("text");
1536
+ function et(n) {
1537
+ return {
1538
+ resolveAll: rt(n === "text" ? Ye : void 0),
1539
+ tokenize: r
1540
+ };
1541
+ function r(t) {
1542
+ const e = this, a = this.parser.constructs[n], i = t.attempt(a, u, s);
1543
+ return u;
1544
+ function u(m) {
1545
+ return c(m) ? i(m) : s(m);
1546
+ }
1547
+ function s(m) {
1548
+ if (m === null) {
1549
+ t.consume(m);
1550
+ return;
1551
+ }
1552
+ return t.enter("data"), t.consume(m), f;
1553
+ }
1554
+ function f(m) {
1555
+ return c(m) ? (t.exit("data"), i(m)) : (t.consume(m), f);
1556
+ }
1557
+ function c(m) {
1558
+ if (m === null) return !0;
1559
+ const p = a[m];
1560
+ let g = -1;
1561
+ if (p) for (; ++g < p.length; ) {
1562
+ const h = p[g];
1563
+ if (!h.previous || h.previous.call(e, e.previous)) return !0;
1564
+ }
1565
+ return !1;
1566
+ }
1567
+ }
1568
+ }
1569
+ function rt(n) {
1570
+ return r;
1571
+ function r(t, e) {
1572
+ let a = -1, i;
1573
+ for (; ++a <= t.length; ) i === void 0 ? t[a] && t[a][1].type === "data" && (i = a, a++) : (!t[a] || t[a][1].type !== "data") && (a !== i + 2 && (t[i][1].end = t[a - 1][1].end, t.splice(i + 2, a - i - 2), a = i + 2), i = void 0);
1574
+ return n ? n(t, e) : t;
1575
+ }
1576
+ }
1577
+ function Ye(n, r) {
1578
+ let t = 0;
1579
+ for (; ++t <= n.length; ) if ((t === n.length || n[t][1].type === "lineEnding") && n[t - 1][1].type === "data") {
1580
+ const e = n[t - 1][1], a = r.sliceStream(e);
1581
+ let i = a.length, u = -1, s = 0, f;
1582
+ for (; i--; ) {
1583
+ const c = a[i];
1584
+ if (typeof c == "string") {
1585
+ for (u = c.length; c.charCodeAt(u - 1) === 32; )
1586
+ s++, u--;
1587
+ if (u) break;
1588
+ u = -1;
1589
+ } else if (c === -2)
1590
+ f = !0, s++;
1591
+ else if (c !== -1) {
1592
+ i++;
1593
+ break;
1594
+ }
1595
+ }
1596
+ if (r._contentTypeTextTrailing && t === n.length && (s = 0), s) {
1597
+ const c = {
1598
+ type: t === n.length || f || s < 2 ? "lineSuffix" : "hardBreakTrailing",
1599
+ start: {
1600
+ _bufferIndex: i ? u : e.start._bufferIndex + u,
1601
+ _index: e.start._index + i,
1602
+ line: e.end.line,
1603
+ column: e.end.column - s,
1604
+ offset: e.end.offset - s
1605
+ },
1606
+ end: { ...e.end }
1607
+ };
1608
+ e.end = { ...c.start }, e.start.offset === e.end.offset ? Object.assign(e, c) : (n.splice(t, 0, [
1609
+ "enter",
1610
+ c,
1611
+ r
1612
+ ], [
1613
+ "exit",
1614
+ c,
1615
+ r
1616
+ ]), t += 2);
1617
+ }
1618
+ t++;
1619
+ }
1620
+ return n;
1621
+ }
1622
+ var $e = /* @__PURE__ */ Yn({
1623
+ attentionMarkers: () => er,
1624
+ contentInitial: () => Je,
1625
+ disable: () => rr,
1626
+ document: () => Ge,
1627
+ flow: () => Xe,
1628
+ flowInitial: () => Ke,
1629
+ insideSpan: () => tr,
1630
+ string: () => Ze,
1631
+ text: () => nr
1632
+ }), Ge = {
1633
+ 42: j,
1634
+ 43: j,
1635
+ 45: j,
1636
+ 48: j,
1637
+ 49: j,
1638
+ 50: j,
1639
+ 51: j,
1640
+ 52: j,
1641
+ 53: j,
1642
+ 54: j,
1643
+ 55: j,
1644
+ 56: j,
1645
+ 57: j,
1646
+ 62: Gn
1647
+ }, Je = { 91: $t }, Ke = {
1648
+ [-2]: wn,
1649
+ [-1]: wn,
1650
+ 32: wn
1651
+ }, Xe = {
1652
+ 35: ne,
1653
+ 42: yn,
1654
+ 45: [Qn, yn],
1655
+ 60: ie,
1656
+ 61: Qn,
1657
+ 95: yn,
1658
+ 96: Hn,
1659
+ 126: Hn
1660
+ }, Ze = {
1661
+ 38: Kn,
1662
+ 92: Jn
1663
+ }, nr = {
1664
+ [-5]: zn,
1665
+ [-4]: zn,
1666
+ [-3]: zn,
1667
+ 33: Ie,
1668
+ 38: Kn,
1669
+ 42: Tn,
1670
+ 60: [Ct, ce],
1671
+ 91: ze,
1672
+ 92: [Xt, Jn],
1673
+ 93: Bn,
1674
+ 95: Tn,
1675
+ 96: Nt
1676
+ }, tr = { null: [Tn, Ue] }, er = { null: [42, 95] }, rr = { null: [] };
1677
+ function ir(n, r, t) {
1678
+ let e = {
1679
+ _bufferIndex: -1,
1680
+ _index: 0,
1681
+ line: t && t.line || 1,
1682
+ column: t && t.column || 1,
1683
+ offset: t && t.offset || 0
1684
+ };
1685
+ const a = {}, i = [];
1686
+ let u = [], s = [];
1687
+ const f = {
1688
+ attempt: F(N),
1689
+ check: F(k),
1690
+ consume: R,
1691
+ enter: b,
1692
+ exit: M,
1693
+ interrupt: F(k, { interrupt: !0 })
1694
+ }, c = {
1695
+ code: null,
1696
+ containerState: {},
1697
+ defineSkip: T,
1698
+ events: [],
1699
+ now: E,
1700
+ parser: n,
1701
+ previous: null,
1702
+ sliceSerialize: g,
1703
+ sliceStream: h,
1704
+ write: p
1705
+ };
1706
+ let m = r.tokenize.call(c, f);
1707
+ return r.resolveAll && i.push(r), c;
1708
+ function p(I) {
1709
+ return u = $(u, I), D(), u[u.length - 1] !== null ? [] : (q(r, 0), c.events = Fn(i, c.events, c), c.events);
1710
+ }
1711
+ function g(I, y) {
1712
+ return ar(h(I), y);
1713
+ }
1714
+ function h(I) {
1715
+ return ur(u, I);
1716
+ }
1717
+ function E() {
1718
+ const { _bufferIndex: I, _index: y, line: O, column: H, offset: C } = e;
1719
+ return {
1720
+ _bufferIndex: I,
1721
+ _index: y,
1722
+ line: O,
1723
+ column: H,
1724
+ offset: C
1725
+ };
1726
+ }
1727
+ function T(I) {
1728
+ a[I.line] = I.column, A();
1729
+ }
1730
+ function D() {
1731
+ let I;
1732
+ for (; e._index < u.length; ) {
1733
+ const y = u[e._index];
1734
+ if (typeof y == "string")
1735
+ for (I = e._index, e._bufferIndex < 0 && (e._bufferIndex = 0); e._index === I && e._bufferIndex < y.length; ) S(y.charCodeAt(e._bufferIndex));
1736
+ else S(y);
1737
+ }
1738
+ }
1739
+ function S(I) {
1740
+ m = m(I);
1741
+ }
1742
+ function R(I) {
1743
+ w(I) ? (e.line++, e.column = 1, e.offset += I === -3 ? 2 : 1, A()) : I !== -1 && (e.column++, e.offset++), e._bufferIndex < 0 ? e._index++ : (e._bufferIndex++, e._bufferIndex === u[e._index].length && (e._bufferIndex = -1, e._index++)), c.previous = I;
1744
+ }
1745
+ function b(I, y) {
1746
+ const O = y || {};
1747
+ return O.type = I, O.start = E(), c.events.push([
1748
+ "enter",
1749
+ O,
1750
+ c
1751
+ ]), s.push(O), O;
1752
+ }
1753
+ function M(I) {
1754
+ const y = s.pop();
1755
+ return y.end = E(), c.events.push([
1756
+ "exit",
1757
+ y,
1758
+ c
1759
+ ]), y;
1760
+ }
1761
+ function N(I, y) {
1762
+ q(I, y.from);
1763
+ }
1764
+ function k(I, y) {
1765
+ y.restore();
1766
+ }
1767
+ function F(I, y) {
1768
+ return O;
1769
+ function O(H, C, U) {
1770
+ let V, G, X, l;
1771
+ return Array.isArray(H) ? Z(H) : "tokenize" in H ? Z([H]) : rn(H);
1772
+ function rn(Q) {
1773
+ return gn;
1774
+ function gn(nn) {
1775
+ const hn = nn !== null && Q[nn], cn = nn !== null && Q.null;
1776
+ return Z([...Array.isArray(hn) ? hn : hn ? [hn] : [], ...Array.isArray(cn) ? cn : cn ? [cn] : []])(nn);
1777
+ }
1778
+ }
1779
+ function Z(Q) {
1780
+ return V = Q, G = 0, Q.length === 0 ? U : o(Q[G]);
1781
+ }
1782
+ function o(Q) {
1783
+ return gn;
1784
+ function gn(nn) {
1785
+ return l = B(), X = Q, Q.partial || (c.currentConstruct = Q), Q.name && c.parser.constructs.disable.null.includes(Q.name) ? sn(nn) : Q.tokenize.call(y ? Object.assign(Object.create(c), y) : c, f, un, sn)(nn);
1786
+ }
1787
+ }
1788
+ function un(Q) {
1789
+ return I(X, l), C;
1790
+ }
1791
+ function sn(Q) {
1792
+ return l.restore(), ++G < V.length ? o(V[G]) : U;
1793
+ }
1794
+ }
1795
+ }
1796
+ function q(I, y) {
1797
+ I.resolveAll && !i.includes(I) && i.push(I), I.resolve && on(c.events, y, c.events.length - y, I.resolve(c.events.slice(y), c)), I.resolveTo && (c.events = I.resolveTo(c.events, c));
1798
+ }
1799
+ function B() {
1800
+ const I = E(), y = c.previous, O = c.currentConstruct, H = c.events.length, C = Array.from(s);
1801
+ return {
1802
+ from: H,
1803
+ restore: U
1804
+ };
1805
+ function U() {
1806
+ e = I, c.previous = y, c.currentConstruct = O, c.events.length = H, s = C, A();
1807
+ }
1808
+ }
1809
+ function A() {
1810
+ e.line in a && e.column < 2 && (e.column = a[e.line], e.offset += a[e.line] - 1);
1811
+ }
1812
+ }
1813
+ function ur(n, r) {
1814
+ const t = r.start._index, e = r.start._bufferIndex, a = r.end._index, i = r.end._bufferIndex;
1815
+ let u;
1816
+ if (t === a) u = [n[t].slice(e, i)];
1817
+ else {
1818
+ if (u = n.slice(t, a), e > -1) {
1819
+ const s = u[0];
1820
+ typeof s == "string" ? u[0] = s.slice(e) : u.shift();
1821
+ }
1822
+ i > 0 && u.push(n[a].slice(0, i));
1823
+ }
1824
+ return u;
1825
+ }
1826
+ function ar(n, r) {
1827
+ let t = -1;
1828
+ const e = [];
1829
+ let a;
1830
+ for (; ++t < n.length; ) {
1831
+ const i = n[t];
1832
+ let u;
1833
+ if (typeof i == "string") u = i;
1834
+ else switch (i) {
1835
+ case -5:
1836
+ u = "\r";
1837
+ break;
1838
+ case -4:
1839
+ u = `
1840
+ `;
1841
+ break;
1842
+ case -3:
1843
+ u = `\r
1844
+ `;
1845
+ break;
1846
+ case -2:
1847
+ u = r ? " " : " ";
1848
+ break;
1849
+ case -1:
1850
+ if (!r && a) continue;
1851
+ u = " ";
1852
+ break;
1853
+ default:
1854
+ u = String.fromCharCode(i);
1855
+ }
1856
+ a = i === -2, e.push(u);
1857
+ }
1858
+ return e.join("");
1859
+ }
1860
+ function lr(n) {
1861
+ const r = {
1862
+ constructs: dt([$e, ...(n || {}).extensions || []]),
1863
+ content: t(Ne),
1864
+ defined: [],
1865
+ document: t(Re),
1866
+ flow: t(Ve),
1867
+ lazy: {},
1868
+ string: t(je),
1869
+ text: t(We)
1870
+ };
1871
+ return r;
1872
+ function t(e) {
1873
+ return a;
1874
+ function a(i) {
1875
+ return ir(r, e, i);
1876
+ }
1877
+ }
1878
+ }
1879
+ function or(n) {
1880
+ for (; !Xn(n); ) ;
1881
+ return n;
1882
+ }
1883
+ var jn = /[\0\t\n\r]/g;
1884
+ function sr() {
1885
+ let n = 1, r = "", t = !0, e;
1886
+ return a;
1887
+ function a(i, u, s) {
1888
+ const f = [];
1889
+ let c, m, p, g, h;
1890
+ for (i = r + (typeof i == "string" ? i.toString() : new TextDecoder(u || void 0).decode(i)), p = 0, r = "", t && (i.charCodeAt(0) === 65279 && p++, t = void 0); p < i.length; ) {
1891
+ if (jn.lastIndex = p, c = jn.exec(i), g = c && c.index !== void 0 ? c.index : i.length, h = i.charCodeAt(g), !c) {
1892
+ r = i.slice(p);
1893
+ break;
1894
+ }
1895
+ if (h === 10 && p === g && e)
1896
+ f.push(-3), e = void 0;
1897
+ else
1898
+ switch (e && (f.push(-5), e = void 0), p < g && (f.push(i.slice(p, g)), n += g - p), h) {
1899
+ case 0:
1900
+ f.push(65533), n++;
1901
+ break;
1902
+ case 9:
1903
+ for (m = Math.ceil(n / 4) * 4, f.push(-2); n++ < m; ) f.push(-1);
1904
+ break;
1905
+ case 10:
1906
+ f.push(-4), n = 1;
1907
+ break;
1908
+ default:
1909
+ e = !0, n = 1;
1910
+ }
1911
+ p = g + 1;
1912
+ }
1913
+ return s && (e && f.push(-5), r && f.push(r), f.push(null)), f;
1914
+ }
1915
+ }
1916
+ var it = {}.hasOwnProperty;
1917
+ function hr(n, r, t) {
1918
+ return r && typeof r == "object" && (t = r, r = void 0), cr(t)(or(lr(t).document().write(sr()(n, r, !0))));
1919
+ }
1920
+ function cr(n) {
1921
+ const r = {
1922
+ transforms: [],
1923
+ canContainEols: [
1924
+ "emphasis",
1925
+ "fragment",
1926
+ "heading",
1927
+ "paragraph",
1928
+ "strong"
1929
+ ],
1930
+ enter: {
1931
+ autolink: i(Mn),
1932
+ autolinkProtocol: B,
1933
+ autolinkEmail: B,
1934
+ atxHeading: i(_n),
1935
+ blockQuote: i(cn),
1936
+ characterEscape: B,
1937
+ characterReference: B,
1938
+ codeFenced: i(An),
1939
+ codeFencedFenceInfo: u,
1940
+ codeFencedFenceMeta: u,
1941
+ codeIndented: i(An, u),
1942
+ codeText: i(at, u),
1943
+ codeTextData: B,
1944
+ data: B,
1945
+ codeFlowValue: B,
1946
+ definition: i(lt),
1947
+ definitionDestinationString: u,
1948
+ definitionLabelString: u,
1949
+ definitionTitleString: u,
1950
+ emphasis: i(ot),
1951
+ hardBreakEscape: i(Pn),
1952
+ hardBreakTrailing: i(Pn),
1953
+ htmlFlow: i(Ln, u),
1954
+ htmlFlowData: B,
1955
+ htmlText: i(Ln, u),
1956
+ htmlTextData: B,
1957
+ image: i(st),
1958
+ label: u,
1959
+ link: i(Mn),
1960
+ listItem: i(ht),
1961
+ listItemValue: g,
1962
+ listOrdered: i(On, p),
1963
+ listUnordered: i(On),
1964
+ paragraph: i(ct),
1965
+ reference: o,
1966
+ referenceString: u,
1967
+ resourceDestinationString: u,
1968
+ resourceTitleString: u,
1969
+ setextHeading: i(_n),
1970
+ strong: i(pt),
1971
+ thematicBreak: i(ft)
1972
+ },
1973
+ exit: {
1974
+ atxHeading: f(),
1975
+ atxHeadingSequence: N,
1976
+ autolink: f(),
1977
+ autolinkEmail: hn,
1978
+ autolinkProtocol: nn,
1979
+ blockQuote: f(),
1980
+ characterEscapeValue: A,
1981
+ characterReferenceMarkerHexadecimal: sn,
1982
+ characterReferenceMarkerNumeric: sn,
1983
+ characterReferenceValue: Q,
1984
+ characterReference: gn,
1985
+ codeFenced: f(D),
1986
+ codeFencedFence: T,
1987
+ codeFencedFenceInfo: h,
1988
+ codeFencedFenceMeta: E,
1989
+ codeFlowValue: A,
1990
+ codeIndented: f(S),
1991
+ codeText: f(C),
1992
+ codeTextData: A,
1993
+ data: A,
1994
+ definition: f(),
1995
+ definitionDestinationString: M,
1996
+ definitionLabelString: R,
1997
+ definitionTitleString: b,
1998
+ emphasis: f(),
1999
+ hardBreakEscape: f(y),
2000
+ hardBreakTrailing: f(y),
2001
+ htmlFlow: f(O),
2002
+ htmlFlowData: A,
2003
+ htmlText: f(H),
2004
+ htmlTextData: A,
2005
+ image: f(V),
2006
+ label: X,
2007
+ labelText: G,
2008
+ lineEnding: I,
2009
+ link: f(U),
2010
+ listItem: f(),
2011
+ listOrdered: f(),
2012
+ listUnordered: f(),
2013
+ paragraph: f(),
2014
+ referenceString: un,
2015
+ resourceDestinationString: l,
2016
+ resourceTitleString: rn,
2017
+ resource: Z,
2018
+ setextHeading: f(q),
2019
+ setextHeadingLineSequence: F,
2020
+ setextHeadingText: k,
2021
+ strong: f(),
2022
+ thematicBreak: f()
2023
+ }
2024
+ };
2025
+ ut(r, (n || {}).mdastExtensions || []);
2026
+ const t = {};
2027
+ return e;
2028
+ function e(x) {
2029
+ let d = {
2030
+ type: "root",
2031
+ children: []
2032
+ };
2033
+ const z = {
2034
+ stack: [d],
2035
+ tokenStack: [],
2036
+ config: r,
2037
+ enter: s,
2038
+ exit: c,
2039
+ buffer: u,
2040
+ resume: m,
2041
+ data: t
2042
+ }, _ = [];
2043
+ let P = -1;
2044
+ for (; ++P < x.length; ) (x[P][1].type === "listOrdered" || x[P][1].type === "listUnordered") && (x[P][0] === "enter" ? _.push(P) : P = a(x, _.pop(), P));
2045
+ for (P = -1; ++P < x.length; ) {
2046
+ const an = r[x[P][0]];
2047
+ it.call(an, x[P][1].type) && an[x[P][1].type].call(Object.assign({ sliceSerialize: x[P][2].sliceSerialize }, z), x[P][1]);
2048
+ }
2049
+ if (z.tokenStack.length > 0) {
2050
+ const an = z.tokenStack[z.tokenStack.length - 1];
2051
+ (an[1] || Wn).call(z, void 0, an[0]);
2052
+ }
2053
+ for (d.position = {
2054
+ start: ln(x.length > 0 ? x[0][1].start : {
2055
+ line: 1,
2056
+ column: 1,
2057
+ offset: 0
2058
+ }),
2059
+ end: ln(x.length > 0 ? x[x.length - 2][1].end : {
2060
+ line: 1,
2061
+ column: 1,
2062
+ offset: 0
2063
+ })
2064
+ }, P = -1; ++P < r.transforms.length; ) d = r.transforms[P](d) || d;
2065
+ return d;
2066
+ }
2067
+ function a(x, d, z) {
2068
+ let _ = d - 1, P = -1, an = !1, pn, tn, xn, kn;
2069
+ for (; ++_ <= z; ) {
2070
+ const W = x[_];
2071
+ switch (W[1].type) {
2072
+ case "listUnordered":
2073
+ case "listOrdered":
2074
+ case "blockQuote":
2075
+ W[0] === "enter" ? P++ : P--, kn = void 0;
2076
+ break;
2077
+ case "lineEndingBlank":
2078
+ W[0] === "enter" && (pn && !kn && !P && !xn && (xn = _), kn = void 0);
2079
+ break;
2080
+ case "linePrefix":
2081
+ case "listItemValue":
2082
+ case "listItemMarker":
2083
+ case "listItemPrefix":
2084
+ case "listItemPrefixWhitespace":
2085
+ break;
2086
+ default:
2087
+ kn = void 0;
2088
+ }
2089
+ if (!P && W[0] === "enter" && W[1].type === "listItemPrefix" || P === -1 && W[0] === "exit" && (W[1].type === "listUnordered" || W[1].type === "listOrdered")) {
2090
+ if (pn) {
2091
+ let mn = _;
2092
+ for (tn = void 0; mn--; ) {
2093
+ const en = x[mn];
2094
+ if (en[1].type === "lineEnding" || en[1].type === "lineEndingBlank") {
2095
+ if (en[0] === "exit") continue;
2096
+ tn && (x[tn][1].type = "lineEndingBlank", an = !0), en[1].type = "lineEnding", tn = mn;
2097
+ } else if (!(en[1].type === "linePrefix" || en[1].type === "blockQuotePrefix" || en[1].type === "blockQuotePrefixWhitespace" || en[1].type === "blockQuoteMarker" || en[1].type === "listItemIndent"))
2098
+ break;
2099
+ }
2100
+ xn && (!tn || xn < tn) && (pn._spread = !0), pn.end = Object.assign({}, tn ? x[tn][1].start : W[1].end), x.splice(tn || _, 0, [
2101
+ "exit",
2102
+ pn,
2103
+ W[2]
2104
+ ]), _++, z++;
2105
+ }
2106
+ if (W[1].type === "listItemPrefix") {
2107
+ const mn = {
2108
+ type: "listItem",
2109
+ _spread: !1,
2110
+ start: Object.assign({}, W[1].start),
2111
+ end: void 0
2112
+ };
2113
+ pn = mn, x.splice(_, 0, [
2114
+ "enter",
2115
+ mn,
2116
+ W[2]
2117
+ ]), _++, z++, xn = void 0, kn = !0;
2118
+ }
2119
+ }
2120
+ }
2121
+ return x[d][1]._spread = an, z;
2122
+ }
2123
+ function i(x, d) {
2124
+ return z;
2125
+ function z(_) {
2126
+ s.call(this, x(_), _), d && d.call(this, _);
2127
+ }
2128
+ }
2129
+ function u() {
2130
+ this.stack.push({
2131
+ type: "fragment",
2132
+ children: []
2133
+ });
2134
+ }
2135
+ function s(x, d, z) {
2136
+ this.stack[this.stack.length - 1].children.push(x), this.stack.push(x), this.tokenStack.push([d, z || void 0]), x.position = {
2137
+ start: ln(d.start),
2138
+ end: void 0
2139
+ };
2140
+ }
2141
+ function f(x) {
2142
+ return d;
2143
+ function d(z) {
2144
+ x && x.call(this, z), c.call(this, z);
2145
+ }
2146
+ }
2147
+ function c(x, d) {
2148
+ const z = this.stack.pop(), _ = this.tokenStack.pop();
2149
+ if (_) _[0].type !== x.type && (d ? d.call(this, x, _[0]) : (_[1] || Wn).call(this, x, _[0]));
2150
+ else throw new Error("Cannot close `" + x.type + "` (" + bn({
2151
+ start: x.start,
2152
+ end: x.end
2153
+ }) + "): it’s not open");
2154
+ z.position.end = ln(x.end);
2155
+ }
2156
+ function m() {
2157
+ return St(this.stack.pop());
2158
+ }
2159
+ function p() {
2160
+ this.data.expectingFirstListItemValue = !0;
2161
+ }
2162
+ function g(x) {
2163
+ if (this.data.expectingFirstListItemValue) {
2164
+ const d = this.stack[this.stack.length - 2];
2165
+ d.start = Number.parseInt(this.sliceSerialize(x), 10), this.data.expectingFirstListItemValue = void 0;
2166
+ }
2167
+ }
2168
+ function h() {
2169
+ const x = this.resume(), d = this.stack[this.stack.length - 1];
2170
+ d.lang = x;
2171
+ }
2172
+ function E() {
2173
+ const x = this.resume(), d = this.stack[this.stack.length - 1];
2174
+ d.meta = x;
2175
+ }
2176
+ function T() {
2177
+ this.data.flowCodeInside || (this.buffer(), this.data.flowCodeInside = !0);
2178
+ }
2179
+ function D() {
2180
+ const x = this.resume(), d = this.stack[this.stack.length - 1];
2181
+ d.value = x.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g, ""), this.data.flowCodeInside = void 0;
2182
+ }
2183
+ function S() {
2184
+ const x = this.resume(), d = this.stack[this.stack.length - 1];
2185
+ d.value = x.replace(/(\r?\n|\r)$/g, "");
2186
+ }
2187
+ function R(x) {
2188
+ const d = this.resume(), z = this.stack[this.stack.length - 1];
2189
+ z.label = d, z.identifier = fn(this.sliceSerialize(x)).toLowerCase();
2190
+ }
2191
+ function b() {
2192
+ const x = this.resume(), d = this.stack[this.stack.length - 1];
2193
+ d.title = x;
2194
+ }
2195
+ function M() {
2196
+ const x = this.resume(), d = this.stack[this.stack.length - 1];
2197
+ d.url = x;
2198
+ }
2199
+ function N(x) {
2200
+ const d = this.stack[this.stack.length - 1];
2201
+ d.depth || (d.depth = this.sliceSerialize(x).length);
2202
+ }
2203
+ function k() {
2204
+ this.data.setextHeadingSlurpLineEnding = !0;
2205
+ }
2206
+ function F(x) {
2207
+ const d = this.stack[this.stack.length - 1];
2208
+ d.depth = this.sliceSerialize(x).codePointAt(0) === 61 ? 1 : 2;
2209
+ }
2210
+ function q() {
2211
+ this.data.setextHeadingSlurpLineEnding = void 0;
2212
+ }
2213
+ function B(x) {
2214
+ const d = this.stack[this.stack.length - 1].children;
2215
+ let z = d[d.length - 1];
2216
+ (!z || z.type !== "text") && (z = mt(), z.position = {
2217
+ start: ln(x.start),
2218
+ end: void 0
2219
+ }, d.push(z)), this.stack.push(z);
2220
+ }
2221
+ function A(x) {
2222
+ const d = this.stack.pop();
2223
+ d.value += this.sliceSerialize(x), d.position.end = ln(x.end);
2224
+ }
2225
+ function I(x) {
2226
+ const d = this.stack[this.stack.length - 1];
2227
+ if (this.data.atHardBreak) {
2228
+ const z = d.children[d.children.length - 1];
2229
+ z.position.end = ln(x.end), this.data.atHardBreak = void 0;
2230
+ return;
2231
+ }
2232
+ !this.data.setextHeadingSlurpLineEnding && r.canContainEols.includes(d.type) && (B.call(this, x), A.call(this, x));
2233
+ }
2234
+ function y() {
2235
+ this.data.atHardBreak = !0;
2236
+ }
2237
+ function O() {
2238
+ const x = this.resume(), d = this.stack[this.stack.length - 1];
2239
+ d.value = x;
2240
+ }
2241
+ function H() {
2242
+ const x = this.resume(), d = this.stack[this.stack.length - 1];
2243
+ d.value = x;
2244
+ }
2245
+ function C() {
2246
+ const x = this.resume(), d = this.stack[this.stack.length - 1];
2247
+ d.value = x;
2248
+ }
2249
+ function U() {
2250
+ const x = this.stack[this.stack.length - 1];
2251
+ if (this.data.inReference) {
2252
+ const d = this.data.referenceType || "shortcut";
2253
+ x.type += "Reference", x.referenceType = d, delete x.url, delete x.title;
2254
+ } else
2255
+ delete x.identifier, delete x.label;
2256
+ this.data.referenceType = void 0;
2257
+ }
2258
+ function V() {
2259
+ const x = this.stack[this.stack.length - 1];
2260
+ if (this.data.inReference) {
2261
+ const d = this.data.referenceType || "shortcut";
2262
+ x.type += "Reference", x.referenceType = d, delete x.url, delete x.title;
2263
+ } else
2264
+ delete x.identifier, delete x.label;
2265
+ this.data.referenceType = void 0;
2266
+ }
2267
+ function G(x) {
2268
+ const d = this.sliceSerialize(x), z = this.stack[this.stack.length - 2];
2269
+ z.label = yt(d), z.identifier = fn(d).toLowerCase();
2270
+ }
2271
+ function X() {
2272
+ const x = this.stack[this.stack.length - 1], d = this.resume(), z = this.stack[this.stack.length - 1];
2273
+ this.data.inReference = !0, z.type === "link" ? z.children = x.children : z.alt = d;
2274
+ }
2275
+ function l() {
2276
+ const x = this.resume(), d = this.stack[this.stack.length - 1];
2277
+ d.url = x;
2278
+ }
2279
+ function rn() {
2280
+ const x = this.resume(), d = this.stack[this.stack.length - 1];
2281
+ d.title = x;
2282
+ }
2283
+ function Z() {
2284
+ this.data.inReference = void 0;
2285
+ }
2286
+ function o() {
2287
+ this.data.referenceType = "collapsed";
2288
+ }
2289
+ function un(x) {
2290
+ const d = this.resume(), z = this.stack[this.stack.length - 1];
2291
+ z.label = d, z.identifier = fn(this.sliceSerialize(x)).toLowerCase(), this.data.referenceType = "full";
2292
+ }
2293
+ function sn(x) {
2294
+ this.data.characterReferenceType = x.type;
2295
+ }
2296
+ function Q(x) {
2297
+ const d = this.sliceSerialize(x), z = this.data.characterReferenceType;
2298
+ let _;
2299
+ z ? (_ = $n(d, z === "characterReferenceMarkerNumeric" ? 10 : 16), this.data.characterReferenceType = void 0) : _ = vn(d);
2300
+ const P = this.stack[this.stack.length - 1];
2301
+ P.value += _;
2302
+ }
2303
+ function gn(x) {
2304
+ const d = this.stack.pop();
2305
+ d.position.end = ln(x.end);
2306
+ }
2307
+ function nn(x) {
2308
+ A.call(this, x);
2309
+ const d = this.stack[this.stack.length - 1];
2310
+ d.url = this.sliceSerialize(x);
2311
+ }
2312
+ function hn(x) {
2313
+ A.call(this, x);
2314
+ const d = this.stack[this.stack.length - 1];
2315
+ d.url = "mailto:" + this.sliceSerialize(x);
2316
+ }
2317
+ function cn() {
2318
+ return {
2319
+ type: "blockquote",
2320
+ children: []
2321
+ };
2322
+ }
2323
+ function An() {
2324
+ return {
2325
+ type: "code",
2326
+ lang: null,
2327
+ meta: null,
2328
+ value: ""
2329
+ };
2330
+ }
2331
+ function at() {
2332
+ return {
2333
+ type: "inlineCode",
2334
+ value: ""
2335
+ };
2336
+ }
2337
+ function lt() {
2338
+ return {
2339
+ type: "definition",
2340
+ identifier: "",
2341
+ label: null,
2342
+ title: null,
2343
+ url: ""
2344
+ };
2345
+ }
2346
+ function ot() {
2347
+ return {
2348
+ type: "emphasis",
2349
+ children: []
2350
+ };
2351
+ }
2352
+ function _n() {
2353
+ return {
2354
+ type: "heading",
2355
+ depth: 0,
2356
+ children: []
2357
+ };
2358
+ }
2359
+ function Pn() {
2360
+ return { type: "break" };
2361
+ }
2362
+ function Ln() {
2363
+ return {
2364
+ type: "html",
2365
+ value: ""
2366
+ };
2367
+ }
2368
+ function st() {
2369
+ return {
2370
+ type: "image",
2371
+ title: null,
2372
+ url: "",
2373
+ alt: null
2374
+ };
2375
+ }
2376
+ function Mn() {
2377
+ return {
2378
+ type: "link",
2379
+ title: null,
2380
+ url: "",
2381
+ children: []
2382
+ };
2383
+ }
2384
+ function On(x) {
2385
+ return {
2386
+ type: "list",
2387
+ ordered: x.type === "listOrdered",
2388
+ start: null,
2389
+ spread: x._spread,
2390
+ children: []
2391
+ };
2392
+ }
2393
+ function ht(x) {
2394
+ return {
2395
+ type: "listItem",
2396
+ spread: x._spread,
2397
+ checked: null,
2398
+ children: []
2399
+ };
2400
+ }
2401
+ function ct() {
2402
+ return {
2403
+ type: "paragraph",
2404
+ children: []
2405
+ };
2406
+ }
2407
+ function pt() {
2408
+ return {
2409
+ type: "strong",
2410
+ children: []
2411
+ };
2412
+ }
2413
+ function mt() {
2414
+ return {
2415
+ type: "text",
2416
+ value: ""
2417
+ };
2418
+ }
2419
+ function ft() {
2420
+ return { type: "thematicBreak" };
2421
+ }
2422
+ }
2423
+ function ln(n) {
2424
+ return {
2425
+ line: n.line,
2426
+ column: n.column,
2427
+ offset: n.offset
2428
+ };
2429
+ }
2430
+ function ut(n, r) {
2431
+ let t = -1;
2432
+ for (; ++t < r.length; ) {
2433
+ const e = r[t];
2434
+ Array.isArray(e) ? ut(n, e) : pr(n, e);
2435
+ }
2436
+ }
2437
+ function pr(n, r) {
2438
+ let t;
2439
+ for (t in r) if (it.call(r, t)) switch (t) {
2440
+ case "canContainEols": {
2441
+ const e = r[t];
2442
+ e && n[t].push(...e);
2443
+ break;
2444
+ }
2445
+ case "transforms": {
2446
+ const e = r[t];
2447
+ e && n[t].push(...e);
2448
+ break;
2449
+ }
2450
+ case "enter":
2451
+ case "exit": {
2452
+ const e = r[t];
2453
+ e && Object.assign(n[t], e);
2454
+ break;
2455
+ }
2456
+ }
2457
+ }
2458
+ function Wn(n, r) {
2459
+ throw n ? new Error("Cannot close `" + n.type + "` (" + bn({
2460
+ start: n.start,
2461
+ end: n.end
2462
+ }) + "): a different token (`" + r.type + "`, " + bn({
2463
+ start: r.start,
2464
+ end: r.end
2465
+ }) + ") is open") : new Error("Cannot close document, a token (`" + r.type + "`, " + bn({
2466
+ start: r.start,
2467
+ end: r.end
2468
+ }) + ") is still open");
2469
+ }
2470
+ function mr(n) {
2471
+ const r = this;
2472
+ r.parser = t;
2473
+ function t(e) {
2474
+ return hr(e, {
2475
+ ...r.data("settings"),
2476
+ ...n,
2477
+ extensions: r.data("micromarkExtensions") || [],
2478
+ mdastExtensions: r.data("fromMarkdownExtensions") || []
2479
+ });
2480
+ }
2481
+ }
2482
+ var kr = /* @__PURE__ */ Yn({ default: () => mr });
2483
+ export {
2484
+ mr as n,
2485
+ kr as t
2486
+ };