@veracity/ai 0.0.1

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 (57) hide show
  1. package/dist/ChatCompletionSSE.d.ts +35 -0
  2. package/dist/ChatCompletionSSE.d.ts.map +1 -0
  3. package/dist/Markdown.d.ts +2 -0
  4. package/dist/Markdown.d.ts.map +1 -0
  5. package/dist/SmoothChatCompletionSSE.d.ts +23 -0
  6. package/dist/SmoothChatCompletionSSE.d.ts.map +1 -0
  7. package/dist/components/AIChat/index.d.ts +26 -0
  8. package/dist/components/AIChat/index.d.ts.map +1 -0
  9. package/dist/components/AIChatBubble.d.ts +7 -0
  10. package/dist/components/AIChatBubble.d.ts.map +1 -0
  11. package/dist/components/AIChatMessage.d.ts +22 -0
  12. package/dist/components/AIChatMessage.d.ts.map +1 -0
  13. package/dist/components/AIChatToolCall.d.ts +26 -0
  14. package/dist/components/AIChatToolCall.d.ts.map +1 -0
  15. package/dist/components/AIChatToolCallGroup.d.ts +20 -0
  16. package/dist/components/AIChatToolCallGroup.d.ts.map +1 -0
  17. package/dist/components/Avatar.d.ts +23 -0
  18. package/dist/components/Avatar.d.ts.map +1 -0
  19. package/dist/components/HighlightCode/index.d.ts +11 -0
  20. package/dist/components/HighlightCode/index.d.ts.map +1 -0
  21. package/dist/components/VeracityAvatar.d.ts +3 -0
  22. package/dist/components/VeracityAvatar.d.ts.map +1 -0
  23. package/dist/components/VeracityLogoSquare.d.ts +3 -0
  24. package/dist/components/VeracityLogoSquare.d.ts.map +1 -0
  25. package/dist/components/icons/Check.d.ts +3 -0
  26. package/dist/components/icons/Check.d.ts.map +1 -0
  27. package/dist/components/icons/ExclamationCircle.d.ts +3 -0
  28. package/dist/components/icons/ExclamationCircle.d.ts.map +1 -0
  29. package/dist/components/icons/IconProps.d.ts +12 -0
  30. package/dist/components/icons/IconProps.d.ts.map +1 -0
  31. package/dist/components/icons/InfoCircle.d.ts +3 -0
  32. package/dist/components/icons/InfoCircle.d.ts.map +1 -0
  33. package/dist/components/icons/QuestionCircle.d.ts +3 -0
  34. package/dist/components/icons/QuestionCircle.d.ts.map +1 -0
  35. package/dist/components/icons/Spinner.d.ts +13 -0
  36. package/dist/components/icons/Spinner.d.ts.map +1 -0
  37. package/dist/core-Diwflo5W.js +1077 -0
  38. package/dist/csharp-Cigc7XMa.js +371 -0
  39. package/dist/css-B-yPI1XM.js +719 -0
  40. package/dist/dtos.d.ts +18 -0
  41. package/dist/dtos.d.ts.map +1 -0
  42. package/dist/enums.d.ts +30 -0
  43. package/dist/enums.d.ts.map +1 -0
  44. package/dist/index.d.ts +3 -0
  45. package/dist/index.d.ts.map +1 -0
  46. package/dist/javascript-CDslspYb.js +654 -0
  47. package/dist/python-CzH_tl5q.js +397 -0
  48. package/dist/typescript-Bx5cZccb.js +728 -0
  49. package/dist/utils/CancellationToken.d.ts +16 -0
  50. package/dist/utils/CancellationToken.d.ts.map +1 -0
  51. package/dist/utils/OperationCancelledError.d.ts +5 -0
  52. package/dist/utils/OperationCancelledError.d.ts.map +1 -0
  53. package/dist/utils/createSVGElement.d.ts +2 -0
  54. package/dist/utils/createSVGElement.d.ts.map +1 -0
  55. package/dist/veracity-ai.es.js +4173 -0
  56. package/dist/veracity-ai.umd.js +5 -0
  57. package/package.json +36 -0
@@ -0,0 +1,4173 @@
1
+ var Zt = Object.defineProperty;
2
+ var $t = (e, n, t) => n in e ? Zt(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t;
3
+ var I = (e, n, t) => ($t(e, typeof n != "symbol" ? n + "" : n, t), t);
4
+ function R(e, n, ...t) {
5
+ switch (typeof e) {
6
+ case "string": {
7
+ const r = document.createElement(e);
8
+ xe(r, n);
9
+ for (const i of t)
10
+ Yt(r, i);
11
+ return r;
12
+ }
13
+ case "function":
14
+ return e(n || {}, t);
15
+ }
16
+ throw new Error(`Unable to create element of type '${typeof e}'`);
17
+ }
18
+ function xe(e, n) {
19
+ if (n)
20
+ for (const t in n) {
21
+ const r = n[t];
22
+ t in e ? e[t] = r : t in e.style ? e.style[t] = r : e.setAttribute(t, r);
23
+ }
24
+ }
25
+ function Jt(e) {
26
+ if (e instanceof Node)
27
+ return e;
28
+ if (e) {
29
+ if (String(e) === "[object Object]")
30
+ debugger;
31
+ return document.createTextNode(e);
32
+ } else
33
+ return document.createComment(` ${e} `);
34
+ }
35
+ function Yt(e, n) {
36
+ const t = Jt(n);
37
+ e.appendChild(t);
38
+ }
39
+ function St({ as: e = "div", size: n = "avatar-lg", id: t, ...r }, i) {
40
+ const s = /* @__PURE__ */ R(e, { ...r }, i);
41
+ return e === "button" && !("type" in r) && (s.type = "button"), s.classList.add("avatar"), n && s.classList.add(n), t && s.classList.add(...on(t)), s;
42
+ }
43
+ const Xt = [
44
+ "bg-Land-Green-95",
45
+ "text-Land-Green-30"
46
+ ], Kt = [
47
+ "bg-Sunflower-85",
48
+ "text-Sunflower-20"
49
+ ], en = [
50
+ "bg-Energy-Red-95",
51
+ "text-Energy-Red-45"
52
+ ], tn = [
53
+ "bg-Sea-Blue-Main-28",
54
+ "text-Sky-Blue-95"
55
+ ], nn = [
56
+ "bg-Lavender-90",
57
+ "text-Lavender-50"
58
+ ], rn = [
59
+ "bg-Eucalyptus-85",
60
+ "text-Eucalyptus-20"
61
+ ], sn = [
62
+ "bg-Terracotta-85",
63
+ "text-Terracotta-20"
64
+ ], Ke = [
65
+ Xt,
66
+ Kt,
67
+ en,
68
+ tn,
69
+ nn,
70
+ rn,
71
+ sn
72
+ ];
73
+ function on(e) {
74
+ const n = an(e);
75
+ return Ke[Math.floor(Math.abs(n % Ke.length))];
76
+ }
77
+ function an(e) {
78
+ let n = 0;
79
+ for (let t = 0; t < e.length; t++)
80
+ n = e.charCodeAt(t) + ((n << 5) - n);
81
+ return n;
82
+ }
83
+ function J(e) {
84
+ return document.createElementNS("http://www.w3.org/2000/svg", e);
85
+ }
86
+ function ln({ size: e = "48", ...n }) {
87
+ const t = J("svg");
88
+ t.setAttribute("viewBox", "0 0 48 48"), t.setAttribute("fill", "currentColor"), t.setAttribute("width", e), t.setAttribute("height", e), xe(t, n);
89
+ let r = J("path");
90
+ return r.setAttribute("d", "M33.4942 11.8621H39.9088L27.3731 36.1775H20.9585L33.4942 11.8621Z"), t.appendChild(r), r = J("path"), r.setAttribute("d", "M22.4844 27.0056L19.3817 33.1261L8.0625 11.9116H14.3083L22.4844 27.0056Z"), t.appendChild(r), t.classList.add("icon"), t;
91
+ }
92
+ function un(e) {
93
+ const n = R(
94
+ St,
95
+ e,
96
+ /* @__PURE__ */ R(ln, { size: "100%", class: "relative top-[3%]" })
97
+ );
98
+ return n.classList.add("bg-Dark-Blue-Main-18", "text-White"), n;
99
+ }
100
+ var He = /* @__PURE__ */ ((e) => (e.ExtraSmall = "20", e.Small = "24", e.Medium = "32", e.Large = "40", e.ExtraLarge = "48", e.ExtraExtraLarge = "60", e.ExtraExtraExtraLarge = "80", e.ExtraExtraExtraExtraLarge = "120", e))(He || {});
101
+ function Et({
102
+ size: e = "80",
103
+ ...n
104
+ }) {
105
+ const t = J("svg");
106
+ t.setAttribute("viewBox", "0 0 80 80"), t.setAttribute("fill", "none"), t.setAttribute("width", e), t.setAttribute("height", e), xe(t, n), t.setAttribute(
107
+ "class",
108
+ (t.getAttribute("class") ?? "") + " animate-spin"
109
+ );
110
+ const r = J("path");
111
+ r.setAttribute(
112
+ "d",
113
+ "M40 6.15385C21.3073 6.15385 6.15385 21.3073 6.15385 40C6.15385 58.6927 21.3073 73.8462 40 73.8462C58.6927 73.8462 73.8462 58.6927 73.8462 40C73.8462 21.3073 58.6927 6.15385 40 6.15385ZM0 40C0 17.9086 17.9086 0 40 0C62.0914 0 80 17.9086 80 40C80 62.0914 62.0914 80 40 80C17.9086 80 0 62.0914 0 40Z"
114
+ ), r.setAttribute("fill", "#99BEFF"), t.appendChild(r);
115
+ const i = J("path");
116
+ return i.setAttribute(
117
+ "d",
118
+ "M36.9229 3.07692C36.9229 1.37759 38.3004 0 39.9998 0C45.2526 0 50.4541 1.03463 55.3071 3.04482C60.1601 5.05501 64.5697 8.00138 68.284 11.7157C71.9984 15.4301 74.9448 19.8396 76.955 24.6927C78.9651 29.5457 79.9998 34.7471 79.9998 40C79.9998 41.6993 78.6222 43.0769 76.9228 43.0769C75.2235 43.0769 73.8459 41.6993 73.8459 40C73.8459 35.5553 72.9705 31.154 71.2695 27.0476C69.5686 22.9412 67.0755 19.2101 63.9326 16.0672C60.7897 12.9242 57.0585 10.4312 52.9521 8.73023C48.8457 7.0293 44.4445 6.15385 39.9998 6.15385C38.3004 6.15385 36.9229 4.77626 36.9229 3.07692Z"
119
+ ), i.setAttribute("fill", "#003591"), t.appendChild(i), t;
120
+ }
121
+ const hn = {};
122
+ function cn(e, n) {
123
+ const t = n || hn, r = typeof t.includeImageAlt == "boolean" ? t.includeImageAlt : !0, i = typeof t.includeHtml == "boolean" ? t.includeHtml : !0;
124
+ return At(e, r, i);
125
+ }
126
+ function At(e, n, t) {
127
+ if (pn(e)) {
128
+ if ("value" in e)
129
+ return e.type === "html" && !t ? "" : e.value;
130
+ if (n && "alt" in e && e.alt)
131
+ return e.alt;
132
+ if ("children" in e)
133
+ return et(e.children, n, t);
134
+ }
135
+ return Array.isArray(e) ? et(e, n, t) : "";
136
+ }
137
+ function et(e, n, t) {
138
+ const r = [];
139
+ let i = -1;
140
+ for (; ++i < e.length; )
141
+ r[i] = At(e[i], n, t);
142
+ return r.join("");
143
+ }
144
+ function pn(e) {
145
+ return !!(e && typeof e == "object");
146
+ }
147
+ const tt = document.createElement("i");
148
+ function Ve(e) {
149
+ const n = "&" + e + ";";
150
+ tt.innerHTML = n;
151
+ const t = tt.textContent;
152
+ return t.charCodeAt(t.length - 1) === 59 && e !== "semi" || t === n ? !1 : t;
153
+ }
154
+ function ae(e, n, t, r) {
155
+ const i = e.length;
156
+ let s = 0, o;
157
+ if (n < 0 ? n = -n > i ? 0 : i + n : n = n > i ? i : n, t = t > 0 ? t : 0, r.length < 1e4)
158
+ o = Array.from(r), o.unshift(n, t), e.splice(...o);
159
+ else
160
+ for (t && e.splice(n, t); s < r.length; )
161
+ o = r.slice(s, s + 1e4), o.unshift(n, 0), e.splice(...o), s += 1e4, n += 1e4;
162
+ }
163
+ function K(e, n) {
164
+ return e.length > 0 ? (ae(e, e.length, 0, n), e) : n;
165
+ }
166
+ const nt = {}.hasOwnProperty;
167
+ function dn(e) {
168
+ const n = {};
169
+ let t = -1;
170
+ for (; ++t < e.length; )
171
+ mn(n, e[t]);
172
+ return n;
173
+ }
174
+ function mn(e, n) {
175
+ let t;
176
+ for (t in n) {
177
+ const i = (nt.call(e, t) ? e[t] : void 0) || (e[t] = {}), s = n[t];
178
+ let o;
179
+ if (s)
180
+ for (o in s) {
181
+ nt.call(i, o) || (i[o] = []);
182
+ const a = s[o];
183
+ gn(
184
+ // @ts-expect-error Looks like a list.
185
+ i[o],
186
+ Array.isArray(a) ? a : a ? [a] : []
187
+ );
188
+ }
189
+ }
190
+ }
191
+ function gn(e, n) {
192
+ let t = -1;
193
+ const r = [];
194
+ for (; ++t < n.length; )
195
+ (n[t].add === "after" ? e : r).push(n[t]);
196
+ ae(e, 0, 0, r);
197
+ }
198
+ function It(e, n) {
199
+ const t = Number.parseInt(e, n);
200
+ return (
201
+ // C0 except for HT, LF, FF, CR, space.
202
+ t < 9 || t === 11 || t > 13 && t < 32 || // Control character (DEL) of C0, and C1 controls.
203
+ t > 126 && t < 160 || // Lone high surrogates and low surrogates.
204
+ t > 55295 && t < 57344 || // Noncharacters.
205
+ t > 64975 && t < 65008 || /* eslint-disable no-bitwise */
206
+ (t & 65535) === 65535 || (t & 65535) === 65534 || /* eslint-enable no-bitwise */
207
+ // Out of range
208
+ t > 1114111 ? "�" : String.fromCodePoint(t)
209
+ );
210
+ }
211
+ function Se(e) {
212
+ return e.replace(/[\t\n\r ]+/g, " ").replace(/^ | $/g, "").toLowerCase().toUpperCase();
213
+ }
214
+ const se = ge(/[A-Za-z]/), ie = ge(/[\dA-Za-z]/), fn = ge(/[#-'*+\--9=?A-Z^-~]/);
215
+ function Ne(e) {
216
+ return (
217
+ // Special whitespace codes (which have negative values), C0 and Control
218
+ // character DEL
219
+ e !== null && (e < 32 || e === 127)
220
+ );
221
+ }
222
+ const Oe = ge(/\d/), wn = ge(/[\dA-Fa-f]/), bn = ge(/[!-/:-@[-`{-~]/);
223
+ function A(e) {
224
+ return e !== null && e < -2;
225
+ }
226
+ function Z(e) {
227
+ return e !== null && (e < 0 || e === 32);
228
+ }
229
+ function _(e) {
230
+ return e === -2 || e === -1 || e === 32;
231
+ }
232
+ const xn = ge(new RegExp("\\p{P}|\\p{S}", "u")), yn = ge(/\s/);
233
+ function ge(e) {
234
+ return n;
235
+ function n(t) {
236
+ return t !== null && t > -1 && e.test(String.fromCharCode(t));
237
+ }
238
+ }
239
+ function M(e, n, t, r) {
240
+ const i = r ? r - 1 : Number.POSITIVE_INFINITY;
241
+ let s = 0;
242
+ return o;
243
+ function o(p) {
244
+ return _(p) ? (e.enter(t), a(p)) : n(p);
245
+ }
246
+ function a(p) {
247
+ return _(p) && s++ < i ? (e.consume(p), a) : (e.exit(t), n(p));
248
+ }
249
+ }
250
+ const kn = {
251
+ tokenize: Cn
252
+ };
253
+ function Cn(e) {
254
+ const n = e.attempt(
255
+ this.parser.constructs.contentInitial,
256
+ r,
257
+ i
258
+ );
259
+ let t;
260
+ return n;
261
+ function r(a) {
262
+ if (a === null) {
263
+ e.consume(a);
264
+ return;
265
+ }
266
+ return e.enter("lineEnding"), e.consume(a), e.exit("lineEnding"), M(e, n, "linePrefix");
267
+ }
268
+ function i(a) {
269
+ return e.enter("paragraph"), s(a);
270
+ }
271
+ function s(a) {
272
+ const p = e.enter("chunkText", {
273
+ contentType: "text",
274
+ previous: t
275
+ });
276
+ return t && (t.next = p), t = p, o(a);
277
+ }
278
+ function o(a) {
279
+ if (a === null) {
280
+ e.exit("chunkText"), e.exit("paragraph"), e.consume(a);
281
+ return;
282
+ }
283
+ return A(a) ? (e.consume(a), e.exit("chunkText"), s) : (e.consume(a), o);
284
+ }
285
+ }
286
+ const Sn = {
287
+ tokenize: En
288
+ }, rt = {
289
+ tokenize: An
290
+ };
291
+ function En(e) {
292
+ const n = this, t = [];
293
+ let r = 0, i, s, o;
294
+ return a;
295
+ function a(C) {
296
+ if (r < t.length) {
297
+ const N = t[r];
298
+ return n.containerState = N[1], e.attempt(
299
+ N[0].continuation,
300
+ p,
301
+ h
302
+ )(C);
303
+ }
304
+ return h(C);
305
+ }
306
+ function p(C) {
307
+ if (r++, n.containerState._closeFlow) {
308
+ n.containerState._closeFlow = void 0, i && G();
309
+ const N = n.events.length;
310
+ let D = N, b;
311
+ for (; D--; )
312
+ if (n.events[D][0] === "exit" && n.events[D][1].type === "chunkFlow") {
313
+ b = n.events[D][1].end;
314
+ break;
315
+ }
316
+ y(r);
317
+ let z = N;
318
+ for (; z < n.events.length; )
319
+ n.events[z][1].end = Object.assign({}, b), z++;
320
+ return ae(
321
+ n.events,
322
+ D + 1,
323
+ 0,
324
+ n.events.slice(N)
325
+ ), n.events.length = z, h(C);
326
+ }
327
+ return a(C);
328
+ }
329
+ function h(C) {
330
+ if (r === t.length) {
331
+ if (!i)
332
+ return g(C);
333
+ if (i.currentConstruct && i.currentConstruct.concrete)
334
+ return k(C);
335
+ n.interrupt = !!(i.currentConstruct && !i._gfmTableDynamicInterruptHack);
336
+ }
337
+ return n.containerState = {}, e.check(
338
+ rt,
339
+ m,
340
+ d
341
+ )(C);
342
+ }
343
+ function m(C) {
344
+ return i && G(), y(r), g(C);
345
+ }
346
+ function d(C) {
347
+ return n.parser.lazy[n.now().line] = r !== t.length, o = n.now().offset, k(C);
348
+ }
349
+ function g(C) {
350
+ return n.containerState = {}, e.attempt(
351
+ rt,
352
+ c,
353
+ k
354
+ )(C);
355
+ }
356
+ function c(C) {
357
+ return r++, t.push([n.currentConstruct, n.containerState]), g(C);
358
+ }
359
+ function k(C) {
360
+ if (C === null) {
361
+ i && G(), y(0), e.consume(C);
362
+ return;
363
+ }
364
+ return i = i || n.parser.flow(n.now()), e.enter("chunkFlow", {
365
+ contentType: "flow",
366
+ previous: s,
367
+ _tokenizer: i
368
+ }), T(C);
369
+ }
370
+ function T(C) {
371
+ if (C === null) {
372
+ j(e.exit("chunkFlow"), !0), y(0), e.consume(C);
373
+ return;
374
+ }
375
+ return A(C) ? (e.consume(C), j(e.exit("chunkFlow")), r = 0, n.interrupt = void 0, a) : (e.consume(C), T);
376
+ }
377
+ function j(C, N) {
378
+ const D = n.sliceStream(C);
379
+ if (N && D.push(null), C.previous = s, s && (s.next = C), s = C, i.defineSkip(C.start), i.write(D), n.parser.lazy[C.start.line]) {
380
+ let b = i.events.length;
381
+ for (; b--; )
382
+ if (
383
+ // The token starts before the line ending…
384
+ i.events[b][1].start.offset < o && // …and either is not ended yet…
385
+ (!i.events[b][1].end || // …or ends after it.
386
+ i.events[b][1].end.offset > o)
387
+ )
388
+ return;
389
+ const z = n.events.length;
390
+ let U = z, F, f;
391
+ for (; U--; )
392
+ if (n.events[U][0] === "exit" && n.events[U][1].type === "chunkFlow") {
393
+ if (F) {
394
+ f = n.events[U][1].end;
395
+ break;
396
+ }
397
+ F = !0;
398
+ }
399
+ for (y(r), b = z; b < n.events.length; )
400
+ n.events[b][1].end = Object.assign({}, f), b++;
401
+ ae(
402
+ n.events,
403
+ U + 1,
404
+ 0,
405
+ n.events.slice(z)
406
+ ), n.events.length = b;
407
+ }
408
+ }
409
+ function y(C) {
410
+ let N = t.length;
411
+ for (; N-- > C; ) {
412
+ const D = t[N];
413
+ n.containerState = D[1], D[0].exit.call(n, e);
414
+ }
415
+ t.length = C;
416
+ }
417
+ function G() {
418
+ i.write([null]), s = void 0, i = void 0, n.containerState._closeFlow = void 0;
419
+ }
420
+ }
421
+ function An(e, n, t) {
422
+ return M(
423
+ e,
424
+ e.attempt(this.parser.constructs.document, n, t),
425
+ "linePrefix",
426
+ this.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4
427
+ );
428
+ }
429
+ function it(e) {
430
+ if (e === null || Z(e) || yn(e))
431
+ return 1;
432
+ if (xn(e))
433
+ return 2;
434
+ }
435
+ function We(e, n, t) {
436
+ const r = [];
437
+ let i = -1;
438
+ for (; ++i < e.length; ) {
439
+ const s = e[i].resolveAll;
440
+ s && !r.includes(s) && (n = s(n, t), r.push(s));
441
+ }
442
+ return n;
443
+ }
444
+ const Pe = {
445
+ name: "attention",
446
+ tokenize: vn,
447
+ resolveAll: In
448
+ };
449
+ function In(e, n) {
450
+ let t = -1, r, i, s, o, a, p, h, m;
451
+ for (; ++t < e.length; )
452
+ if (e[t][0] === "enter" && e[t][1].type === "attentionSequence" && e[t][1]._close) {
453
+ for (r = t; r--; )
454
+ if (e[r][0] === "exit" && e[r][1].type === "attentionSequence" && e[r][1]._open && // If the markers are the same:
455
+ n.sliceSerialize(e[r][1]).charCodeAt(0) === n.sliceSerialize(e[t][1]).charCodeAt(0)) {
456
+ if ((e[r][1]._close || e[t][1]._open) && (e[t][1].end.offset - e[t][1].start.offset) % 3 && !((e[r][1].end.offset - e[r][1].start.offset + e[t][1].end.offset - e[t][1].start.offset) % 3))
457
+ continue;
458
+ p = e[r][1].end.offset - e[r][1].start.offset > 1 && e[t][1].end.offset - e[t][1].start.offset > 1 ? 2 : 1;
459
+ const d = Object.assign({}, e[r][1].end), g = Object.assign({}, e[t][1].start);
460
+ st(d, -p), st(g, p), o = {
461
+ type: p > 1 ? "strongSequence" : "emphasisSequence",
462
+ start: d,
463
+ end: Object.assign({}, e[r][1].end)
464
+ }, a = {
465
+ type: p > 1 ? "strongSequence" : "emphasisSequence",
466
+ start: Object.assign({}, e[t][1].start),
467
+ end: g
468
+ }, s = {
469
+ type: p > 1 ? "strongText" : "emphasisText",
470
+ start: Object.assign({}, e[r][1].end),
471
+ end: Object.assign({}, e[t][1].start)
472
+ }, i = {
473
+ type: p > 1 ? "strong" : "emphasis",
474
+ start: Object.assign({}, o.start),
475
+ end: Object.assign({}, a.end)
476
+ }, e[r][1].end = Object.assign({}, o.start), e[t][1].start = Object.assign({}, a.end), h = [], e[r][1].end.offset - e[r][1].start.offset && (h = K(h, [
477
+ ["enter", e[r][1], n],
478
+ ["exit", e[r][1], n]
479
+ ])), h = K(h, [
480
+ ["enter", i, n],
481
+ ["enter", o, n],
482
+ ["exit", o, n],
483
+ ["enter", s, n]
484
+ ]), h = K(
485
+ h,
486
+ We(
487
+ n.parser.constructs.insideSpan.null,
488
+ e.slice(r + 1, t),
489
+ n
490
+ )
491
+ ), h = K(h, [
492
+ ["exit", s, n],
493
+ ["enter", a, n],
494
+ ["exit", a, n],
495
+ ["exit", i, n]
496
+ ]), e[t][1].end.offset - e[t][1].start.offset ? (m = 2, h = K(h, [
497
+ ["enter", e[t][1], n],
498
+ ["exit", e[t][1], n]
499
+ ])) : m = 0, ae(e, r - 1, t - r + 3, h), t = r + h.length - m - 2;
500
+ break;
501
+ }
502
+ }
503
+ for (t = -1; ++t < e.length; )
504
+ e[t][1].type === "attentionSequence" && (e[t][1].type = "data");
505
+ return e;
506
+ }
507
+ function vn(e, n) {
508
+ const t = this.parser.constructs.attentionMarkers.null, r = this.previous, i = it(r);
509
+ let s;
510
+ return o;
511
+ function o(p) {
512
+ return s = p, e.enter("attentionSequence"), a(p);
513
+ }
514
+ function a(p) {
515
+ if (p === s)
516
+ return e.consume(p), a;
517
+ const h = e.exit("attentionSequence"), m = it(p), d = !m || m === 2 && i || t.includes(p), g = !i || i === 2 && m || t.includes(r);
518
+ return h._open = !!(s === 42 ? d : d && (i || !g)), h._close = !!(s === 42 ? g : g && (m || !d)), n(p);
519
+ }
520
+ }
521
+ function st(e, n) {
522
+ e.column += n, e.offset += n, e._bufferIndex += n;
523
+ }
524
+ const _n = {
525
+ name: "autolink",
526
+ tokenize: Ln
527
+ };
528
+ function Ln(e, n, t) {
529
+ let r = 0;
530
+ return i;
531
+ function i(c) {
532
+ return e.enter("autolink"), e.enter("autolinkMarker"), e.consume(c), e.exit("autolinkMarker"), e.enter("autolinkProtocol"), s;
533
+ }
534
+ function s(c) {
535
+ return se(c) ? (e.consume(c), o) : h(c);
536
+ }
537
+ function o(c) {
538
+ return c === 43 || c === 45 || c === 46 || ie(c) ? (r = 1, a(c)) : h(c);
539
+ }
540
+ function a(c) {
541
+ return c === 58 ? (e.consume(c), r = 0, p) : (c === 43 || c === 45 || c === 46 || ie(c)) && r++ < 32 ? (e.consume(c), a) : (r = 0, h(c));
542
+ }
543
+ function p(c) {
544
+ return c === 62 ? (e.exit("autolinkProtocol"), e.enter("autolinkMarker"), e.consume(c), e.exit("autolinkMarker"), e.exit("autolink"), n) : c === null || c === 32 || c === 60 || Ne(c) ? t(c) : (e.consume(c), p);
545
+ }
546
+ function h(c) {
547
+ return c === 64 ? (e.consume(c), m) : fn(c) ? (e.consume(c), h) : t(c);
548
+ }
549
+ function m(c) {
550
+ return ie(c) ? d(c) : t(c);
551
+ }
552
+ function d(c) {
553
+ return c === 46 ? (e.consume(c), r = 0, m) : c === 62 ? (e.exit("autolinkProtocol").type = "autolinkEmail", e.enter("autolinkMarker"), e.consume(c), e.exit("autolinkMarker"), e.exit("autolink"), n) : g(c);
554
+ }
555
+ function g(c) {
556
+ if ((c === 45 || ie(c)) && r++ < 63) {
557
+ const k = c === 45 ? g : d;
558
+ return e.consume(c), k;
559
+ }
560
+ return t(c);
561
+ }
562
+ }
563
+ const Be = {
564
+ tokenize: zn,
565
+ partial: !0
566
+ };
567
+ function zn(e, n, t) {
568
+ return r;
569
+ function r(s) {
570
+ return _(s) ? M(e, i, "linePrefix")(s) : i(s);
571
+ }
572
+ function i(s) {
573
+ return s === null || A(s) ? n(s) : t(s);
574
+ }
575
+ }
576
+ const vt = {
577
+ name: "blockQuote",
578
+ tokenize: Bn,
579
+ continuation: {
580
+ tokenize: Tn
581
+ },
582
+ exit: Mn
583
+ };
584
+ function Bn(e, n, t) {
585
+ const r = this;
586
+ return i;
587
+ function i(o) {
588
+ if (o === 62) {
589
+ const a = r.containerState;
590
+ return a.open || (e.enter("blockQuote", {
591
+ _container: !0
592
+ }), a.open = !0), e.enter("blockQuotePrefix"), e.enter("blockQuoteMarker"), e.consume(o), e.exit("blockQuoteMarker"), s;
593
+ }
594
+ return t(o);
595
+ }
596
+ function s(o) {
597
+ return _(o) ? (e.enter("blockQuotePrefixWhitespace"), e.consume(o), e.exit("blockQuotePrefixWhitespace"), e.exit("blockQuotePrefix"), n) : (e.exit("blockQuotePrefix"), n(o));
598
+ }
599
+ }
600
+ function Tn(e, n, t) {
601
+ const r = this;
602
+ return i;
603
+ function i(o) {
604
+ return _(o) ? M(
605
+ e,
606
+ s,
607
+ "linePrefix",
608
+ r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4
609
+ )(o) : s(o);
610
+ }
611
+ function s(o) {
612
+ return e.attempt(vt, n, t)(o);
613
+ }
614
+ }
615
+ function Mn(e) {
616
+ e.exit("blockQuote");
617
+ }
618
+ const _t = {
619
+ name: "characterEscape",
620
+ tokenize: Dn
621
+ };
622
+ function Dn(e, n, t) {
623
+ return r;
624
+ function r(s) {
625
+ return e.enter("characterEscape"), e.enter("escapeMarker"), e.consume(s), e.exit("escapeMarker"), i;
626
+ }
627
+ function i(s) {
628
+ return bn(s) ? (e.enter("characterEscapeValue"), e.consume(s), e.exit("characterEscapeValue"), e.exit("characterEscape"), n) : t(s);
629
+ }
630
+ }
631
+ const Lt = {
632
+ name: "characterReference",
633
+ tokenize: Fn
634
+ };
635
+ function Fn(e, n, t) {
636
+ const r = this;
637
+ let i = 0, s, o;
638
+ return a;
639
+ function a(d) {
640
+ return e.enter("characterReference"), e.enter("characterReferenceMarker"), e.consume(d), e.exit("characterReferenceMarker"), p;
641
+ }
642
+ function p(d) {
643
+ return d === 35 ? (e.enter("characterReferenceMarkerNumeric"), e.consume(d), e.exit("characterReferenceMarkerNumeric"), h) : (e.enter("characterReferenceValue"), s = 31, o = ie, m(d));
644
+ }
645
+ function h(d) {
646
+ return d === 88 || d === 120 ? (e.enter("characterReferenceMarkerHexadecimal"), e.consume(d), e.exit("characterReferenceMarkerHexadecimal"), e.enter("characterReferenceValue"), s = 6, o = wn, m) : (e.enter("characterReferenceValue"), s = 7, o = Oe, m(d));
647
+ }
648
+ function m(d) {
649
+ if (d === 59 && i) {
650
+ const g = e.exit("characterReferenceValue");
651
+ return o === ie && !Ve(r.sliceSerialize(g)) ? t(d) : (e.enter("characterReferenceMarker"), e.consume(d), e.exit("characterReferenceMarker"), e.exit("characterReference"), n);
652
+ }
653
+ return o(d) && i++ < s ? (e.consume(d), m) : t(d);
654
+ }
655
+ }
656
+ const ot = {
657
+ tokenize: Nn,
658
+ partial: !0
659
+ }, at = {
660
+ name: "codeFenced",
661
+ tokenize: Rn,
662
+ concrete: !0
663
+ };
664
+ function Rn(e, n, t) {
665
+ const r = this, i = {
666
+ tokenize: D,
667
+ partial: !0
668
+ };
669
+ let s = 0, o = 0, a;
670
+ return p;
671
+ function p(b) {
672
+ return h(b);
673
+ }
674
+ function h(b) {
675
+ const z = r.events[r.events.length - 1];
676
+ return s = z && z[1].type === "linePrefix" ? z[2].sliceSerialize(z[1], !0).length : 0, a = b, e.enter("codeFenced"), e.enter("codeFencedFence"), e.enter("codeFencedFenceSequence"), m(b);
677
+ }
678
+ function m(b) {
679
+ return b === a ? (o++, e.consume(b), m) : o < 3 ? t(b) : (e.exit("codeFencedFenceSequence"), _(b) ? M(e, d, "whitespace")(b) : d(b));
680
+ }
681
+ function d(b) {
682
+ return b === null || A(b) ? (e.exit("codeFencedFence"), r.interrupt ? n(b) : e.check(ot, T, N)(b)) : (e.enter("codeFencedFenceInfo"), e.enter("chunkString", {
683
+ contentType: "string"
684
+ }), g(b));
685
+ }
686
+ function g(b) {
687
+ return b === null || A(b) ? (e.exit("chunkString"), e.exit("codeFencedFenceInfo"), d(b)) : _(b) ? (e.exit("chunkString"), e.exit("codeFencedFenceInfo"), M(e, c, "whitespace")(b)) : b === 96 && b === a ? t(b) : (e.consume(b), g);
688
+ }
689
+ function c(b) {
690
+ return b === null || A(b) ? d(b) : (e.enter("codeFencedFenceMeta"), e.enter("chunkString", {
691
+ contentType: "string"
692
+ }), k(b));
693
+ }
694
+ function k(b) {
695
+ return b === null || A(b) ? (e.exit("chunkString"), e.exit("codeFencedFenceMeta"), d(b)) : b === 96 && b === a ? t(b) : (e.consume(b), k);
696
+ }
697
+ function T(b) {
698
+ return e.attempt(i, N, j)(b);
699
+ }
700
+ function j(b) {
701
+ return e.enter("lineEnding"), e.consume(b), e.exit("lineEnding"), y;
702
+ }
703
+ function y(b) {
704
+ return s > 0 && _(b) ? M(
705
+ e,
706
+ G,
707
+ "linePrefix",
708
+ s + 1
709
+ )(b) : G(b);
710
+ }
711
+ function G(b) {
712
+ return b === null || A(b) ? e.check(ot, T, N)(b) : (e.enter("codeFlowValue"), C(b));
713
+ }
714
+ function C(b) {
715
+ return b === null || A(b) ? (e.exit("codeFlowValue"), G(b)) : (e.consume(b), C);
716
+ }
717
+ function N(b) {
718
+ return e.exit("codeFenced"), n(b);
719
+ }
720
+ function D(b, z, U) {
721
+ let F = 0;
722
+ return f;
723
+ function f(B) {
724
+ return b.enter("lineEnding"), b.consume(B), b.exit("lineEnding"), S;
725
+ }
726
+ function S(B) {
727
+ return b.enter("codeFencedFence"), _(B) ? M(
728
+ b,
729
+ E,
730
+ "linePrefix",
731
+ r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4
732
+ )(B) : E(B);
733
+ }
734
+ function E(B) {
735
+ return B === a ? (b.enter("codeFencedFenceSequence"), P(B)) : U(B);
736
+ }
737
+ function P(B) {
738
+ return B === a ? (F++, b.consume(B), P) : F >= o ? (b.exit("codeFencedFenceSequence"), _(B) ? M(b, H, "whitespace")(B) : H(B)) : U(B);
739
+ }
740
+ function H(B) {
741
+ return B === null || A(B) ? (b.exit("codeFencedFence"), z(B)) : U(B);
742
+ }
743
+ }
744
+ }
745
+ function Nn(e, n, t) {
746
+ const r = this;
747
+ return i;
748
+ function i(o) {
749
+ return o === null ? t(o) : (e.enter("lineEnding"), e.consume(o), e.exit("lineEnding"), s);
750
+ }
751
+ function s(o) {
752
+ return r.parser.lazy[r.now().line] ? t(o) : n(o);
753
+ }
754
+ }
755
+ const Me = {
756
+ name: "codeIndented",
757
+ tokenize: Pn
758
+ }, On = {
759
+ tokenize: jn,
760
+ partial: !0
761
+ };
762
+ function Pn(e, n, t) {
763
+ const r = this;
764
+ return i;
765
+ function i(h) {
766
+ return e.enter("codeIndented"), M(e, s, "linePrefix", 5)(h);
767
+ }
768
+ function s(h) {
769
+ const m = r.events[r.events.length - 1];
770
+ return m && m[1].type === "linePrefix" && m[2].sliceSerialize(m[1], !0).length >= 4 ? o(h) : t(h);
771
+ }
772
+ function o(h) {
773
+ return h === null ? p(h) : A(h) ? e.attempt(On, o, p)(h) : (e.enter("codeFlowValue"), a(h));
774
+ }
775
+ function a(h) {
776
+ return h === null || A(h) ? (e.exit("codeFlowValue"), o(h)) : (e.consume(h), a);
777
+ }
778
+ function p(h) {
779
+ return e.exit("codeIndented"), n(h);
780
+ }
781
+ }
782
+ function jn(e, n, t) {
783
+ const r = this;
784
+ return i;
785
+ function i(o) {
786
+ return r.parser.lazy[r.now().line] ? t(o) : A(o) ? (e.enter("lineEnding"), e.consume(o), e.exit("lineEnding"), i) : M(e, s, "linePrefix", 5)(o);
787
+ }
788
+ function s(o) {
789
+ const a = r.events[r.events.length - 1];
790
+ return a && a[1].type === "linePrefix" && a[2].sliceSerialize(a[1], !0).length >= 4 ? n(o) : A(o) ? i(o) : t(o);
791
+ }
792
+ }
793
+ const qn = {
794
+ name: "codeText",
795
+ tokenize: Hn,
796
+ resolve: Gn,
797
+ previous: Un
798
+ };
799
+ function Gn(e) {
800
+ let n = e.length - 4, t = 3, r, i;
801
+ if ((e[t][1].type === "lineEnding" || e[t][1].type === "space") && (e[n][1].type === "lineEnding" || e[n][1].type === "space")) {
802
+ for (r = t; ++r < n; )
803
+ if (e[r][1].type === "codeTextData") {
804
+ e[t][1].type = "codeTextPadding", e[n][1].type = "codeTextPadding", t += 2, n -= 2;
805
+ break;
806
+ }
807
+ }
808
+ for (r = t - 1, n++; ++r <= n; )
809
+ i === void 0 ? r !== n && e[r][1].type !== "lineEnding" && (i = r) : (r === n || e[r][1].type === "lineEnding") && (e[i][1].type = "codeTextData", r !== i + 2 && (e[i][1].end = e[r - 1][1].end, e.splice(i + 2, r - i - 2), n -= r - i - 2, r = i + 2), i = void 0);
810
+ return e;
811
+ }
812
+ function Un(e) {
813
+ return e !== 96 || this.events[this.events.length - 1][1].type === "characterEscape";
814
+ }
815
+ function Hn(e, n, t) {
816
+ let r = 0, i, s;
817
+ return o;
818
+ function o(d) {
819
+ return e.enter("codeText"), e.enter("codeTextSequence"), a(d);
820
+ }
821
+ function a(d) {
822
+ return d === 96 ? (e.consume(d), r++, a) : (e.exit("codeTextSequence"), p(d));
823
+ }
824
+ function p(d) {
825
+ return d === null ? t(d) : d === 32 ? (e.enter("space"), e.consume(d), e.exit("space"), p) : d === 96 ? (s = e.enter("codeTextSequence"), i = 0, m(d)) : A(d) ? (e.enter("lineEnding"), e.consume(d), e.exit("lineEnding"), p) : (e.enter("codeTextData"), h(d));
826
+ }
827
+ function h(d) {
828
+ return d === null || d === 32 || d === 96 || A(d) ? (e.exit("codeTextData"), p(d)) : (e.consume(d), h);
829
+ }
830
+ function m(d) {
831
+ return d === 96 ? (e.consume(d), i++, m) : i === r ? (e.exit("codeTextSequence"), e.exit("codeText"), n(d)) : (s.type = "codeTextData", h(d));
832
+ }
833
+ }
834
+ function zt(e) {
835
+ const n = {};
836
+ let t = -1, r, i, s, o, a, p, h;
837
+ for (; ++t < e.length; ) {
838
+ for (; t in n; )
839
+ t = n[t];
840
+ if (r = e[t], t && r[1].type === "chunkFlow" && e[t - 1][1].type === "listItemPrefix" && (p = r[1]._tokenizer.events, s = 0, s < p.length && p[s][1].type === "lineEndingBlank" && (s += 2), s < p.length && p[s][1].type === "content"))
841
+ for (; ++s < p.length && p[s][1].type !== "content"; )
842
+ p[s][1].type === "chunkText" && (p[s][1]._isInFirstContentOfListItem = !0, s++);
843
+ if (r[0] === "enter")
844
+ r[1].contentType && (Object.assign(n, Vn(e, t)), t = n[t], h = !0);
845
+ else if (r[1]._container) {
846
+ for (s = t, i = void 0; s-- && (o = e[s], o[1].type === "lineEnding" || o[1].type === "lineEndingBlank"); )
847
+ o[0] === "enter" && (i && (e[i][1].type = "lineEndingBlank"), o[1].type = "lineEnding", i = s);
848
+ i && (r[1].end = Object.assign({}, e[i][1].start), a = e.slice(i, t), a.unshift(r), ae(e, i, t - i + 1, a));
849
+ }
850
+ }
851
+ return !h;
852
+ }
853
+ function Vn(e, n) {
854
+ const t = e[n][1], r = e[n][2];
855
+ let i = n - 1;
856
+ const s = [], o = t._tokenizer || r.parser[t.contentType](t.start), a = o.events, p = [], h = {};
857
+ let m, d, g = -1, c = t, k = 0, T = 0;
858
+ const j = [T];
859
+ for (; c; ) {
860
+ for (; e[++i][1] !== c; )
861
+ ;
862
+ s.push(i), c._tokenizer || (m = r.sliceStream(c), c.next || m.push(null), d && o.defineSkip(c.start), c._isInFirstContentOfListItem && (o._gfmTasklistFirstContentOfListItem = !0), o.write(m), c._isInFirstContentOfListItem && (o._gfmTasklistFirstContentOfListItem = void 0)), d = c, c = c.next;
863
+ }
864
+ for (c = t; ++g < a.length; )
865
+ // Find a void token that includes a break.
866
+ a[g][0] === "exit" && a[g - 1][0] === "enter" && a[g][1].type === a[g - 1][1].type && a[g][1].start.line !== a[g][1].end.line && (T = g + 1, j.push(T), c._tokenizer = void 0, c.previous = void 0, c = c.next);
867
+ for (o.events = [], c ? (c._tokenizer = void 0, c.previous = void 0) : j.pop(), g = j.length; g--; ) {
868
+ const y = a.slice(j[g], j[g + 1]), G = s.pop();
869
+ p.unshift([G, G + y.length - 1]), ae(e, G, 2, y);
870
+ }
871
+ for (g = -1; ++g < p.length; )
872
+ h[k + p[g][0]] = k + p[g][1], k += p[g][1] - p[g][0] - 1;
873
+ return h;
874
+ }
875
+ const Wn = {
876
+ tokenize: $n,
877
+ resolve: Zn
878
+ }, Qn = {
879
+ tokenize: Jn,
880
+ partial: !0
881
+ };
882
+ function Zn(e) {
883
+ return zt(e), e;
884
+ }
885
+ function $n(e, n) {
886
+ let t;
887
+ return r;
888
+ function r(a) {
889
+ return e.enter("content"), t = e.enter("chunkContent", {
890
+ contentType: "content"
891
+ }), i(a);
892
+ }
893
+ function i(a) {
894
+ return a === null ? s(a) : A(a) ? e.check(
895
+ Qn,
896
+ o,
897
+ s
898
+ )(a) : (e.consume(a), i);
899
+ }
900
+ function s(a) {
901
+ return e.exit("chunkContent"), e.exit("content"), n(a);
902
+ }
903
+ function o(a) {
904
+ return e.consume(a), e.exit("chunkContent"), t.next = e.enter("chunkContent", {
905
+ contentType: "content",
906
+ previous: t
907
+ }), t = t.next, i;
908
+ }
909
+ }
910
+ function Jn(e, n, t) {
911
+ const r = this;
912
+ return i;
913
+ function i(o) {
914
+ return e.exit("chunkContent"), e.enter("lineEnding"), e.consume(o), e.exit("lineEnding"), M(e, s, "linePrefix");
915
+ }
916
+ function s(o) {
917
+ if (o === null || A(o))
918
+ return t(o);
919
+ const a = r.events[r.events.length - 1];
920
+ return !r.parser.constructs.disable.null.includes("codeIndented") && a && a[1].type === "linePrefix" && a[2].sliceSerialize(a[1], !0).length >= 4 ? n(o) : e.interrupt(r.parser.constructs.flow, t, n)(o);
921
+ }
922
+ }
923
+ function Bt(e, n, t, r, i, s, o, a, p) {
924
+ const h = p || Number.POSITIVE_INFINITY;
925
+ let m = 0;
926
+ return d;
927
+ function d(y) {
928
+ return y === 60 ? (e.enter(r), e.enter(i), e.enter(s), e.consume(y), e.exit(s), g) : y === null || y === 32 || y === 41 || Ne(y) ? t(y) : (e.enter(r), e.enter(o), e.enter(a), e.enter("chunkString", {
929
+ contentType: "string"
930
+ }), T(y));
931
+ }
932
+ function g(y) {
933
+ return y === 62 ? (e.enter(s), e.consume(y), e.exit(s), e.exit(i), e.exit(r), n) : (e.enter(a), e.enter("chunkString", {
934
+ contentType: "string"
935
+ }), c(y));
936
+ }
937
+ function c(y) {
938
+ return y === 62 ? (e.exit("chunkString"), e.exit(a), g(y)) : y === null || y === 60 || A(y) ? t(y) : (e.consume(y), y === 92 ? k : c);
939
+ }
940
+ function k(y) {
941
+ return y === 60 || y === 62 || y === 92 ? (e.consume(y), c) : c(y);
942
+ }
943
+ function T(y) {
944
+ return !m && (y === null || y === 41 || Z(y)) ? (e.exit("chunkString"), e.exit(a), e.exit(o), e.exit(r), n(y)) : m < h && y === 40 ? (e.consume(y), m++, T) : y === 41 ? (e.consume(y), m--, T) : y === null || y === 32 || y === 40 || Ne(y) ? t(y) : (e.consume(y), y === 92 ? j : T);
945
+ }
946
+ function j(y) {
947
+ return y === 40 || y === 41 || y === 92 ? (e.consume(y), T) : T(y);
948
+ }
949
+ }
950
+ function Tt(e, n, t, r, i, s) {
951
+ const o = this;
952
+ let a = 0, p;
953
+ return h;
954
+ function h(c) {
955
+ return e.enter(r), e.enter(i), e.consume(c), e.exit(i), e.enter(s), m;
956
+ }
957
+ function m(c) {
958
+ return a > 999 || c === null || c === 91 || c === 93 && !p || // To do: remove in the future once we’ve switched from
959
+ // `micromark-extension-footnote` to `micromark-extension-gfm-footnote`,
960
+ // which doesn’t need this.
961
+ // Hidden footnotes hook.
962
+ /* c8 ignore next 3 */
963
+ c === 94 && !a && "_hiddenFootnoteSupport" in o.parser.constructs ? t(c) : c === 93 ? (e.exit(s), e.enter(i), e.consume(c), e.exit(i), e.exit(r), n) : A(c) ? (e.enter("lineEnding"), e.consume(c), e.exit("lineEnding"), m) : (e.enter("chunkString", {
964
+ contentType: "string"
965
+ }), d(c));
966
+ }
967
+ function d(c) {
968
+ return c === null || c === 91 || c === 93 || A(c) || a++ > 999 ? (e.exit("chunkString"), m(c)) : (e.consume(c), p || (p = !_(c)), c === 92 ? g : d);
969
+ }
970
+ function g(c) {
971
+ return c === 91 || c === 92 || c === 93 ? (e.consume(c), a++, d) : d(c);
972
+ }
973
+ }
974
+ function Mt(e, n, t, r, i, s) {
975
+ let o;
976
+ return a;
977
+ function a(g) {
978
+ return g === 34 || g === 39 || g === 40 ? (e.enter(r), e.enter(i), e.consume(g), e.exit(i), o = g === 40 ? 41 : g, p) : t(g);
979
+ }
980
+ function p(g) {
981
+ return g === o ? (e.enter(i), e.consume(g), e.exit(i), e.exit(r), n) : (e.enter(s), h(g));
982
+ }
983
+ function h(g) {
984
+ return g === o ? (e.exit(s), p(o)) : g === null ? t(g) : A(g) ? (e.enter("lineEnding"), e.consume(g), e.exit("lineEnding"), M(e, h, "linePrefix")) : (e.enter("chunkString", {
985
+ contentType: "string"
986
+ }), m(g));
987
+ }
988
+ function m(g) {
989
+ return g === o || g === null || A(g) ? (e.exit("chunkString"), h(g)) : (e.consume(g), g === 92 ? d : m);
990
+ }
991
+ function d(g) {
992
+ return g === o || g === 92 ? (e.consume(g), m) : m(g);
993
+ }
994
+ }
995
+ function ve(e, n) {
996
+ let t;
997
+ return r;
998
+ function r(i) {
999
+ return A(i) ? (e.enter("lineEnding"), e.consume(i), e.exit("lineEnding"), t = !0, r) : _(i) ? M(
1000
+ e,
1001
+ r,
1002
+ t ? "linePrefix" : "lineSuffix"
1003
+ )(i) : n(i);
1004
+ }
1005
+ }
1006
+ const Yn = {
1007
+ name: "definition",
1008
+ tokenize: Kn
1009
+ }, Xn = {
1010
+ tokenize: er,
1011
+ partial: !0
1012
+ };
1013
+ function Kn(e, n, t) {
1014
+ const r = this;
1015
+ let i;
1016
+ return s;
1017
+ function s(c) {
1018
+ return e.enter("definition"), o(c);
1019
+ }
1020
+ function o(c) {
1021
+ return Tt.call(
1022
+ r,
1023
+ e,
1024
+ a,
1025
+ // Note: we don’t need to reset the way `markdown-rs` does.
1026
+ t,
1027
+ "definitionLabel",
1028
+ "definitionLabelMarker",
1029
+ "definitionLabelString"
1030
+ )(c);
1031
+ }
1032
+ function a(c) {
1033
+ return i = Se(
1034
+ r.sliceSerialize(r.events[r.events.length - 1][1]).slice(1, -1)
1035
+ ), c === 58 ? (e.enter("definitionMarker"), e.consume(c), e.exit("definitionMarker"), p) : t(c);
1036
+ }
1037
+ function p(c) {
1038
+ return Z(c) ? ve(e, h)(c) : h(c);
1039
+ }
1040
+ function h(c) {
1041
+ return Bt(
1042
+ e,
1043
+ m,
1044
+ // Note: we don’t need to reset the way `markdown-rs` does.
1045
+ t,
1046
+ "definitionDestination",
1047
+ "definitionDestinationLiteral",
1048
+ "definitionDestinationLiteralMarker",
1049
+ "definitionDestinationRaw",
1050
+ "definitionDestinationString"
1051
+ )(c);
1052
+ }
1053
+ function m(c) {
1054
+ return e.attempt(Xn, d, d)(c);
1055
+ }
1056
+ function d(c) {
1057
+ return _(c) ? M(e, g, "whitespace")(c) : g(c);
1058
+ }
1059
+ function g(c) {
1060
+ return c === null || A(c) ? (e.exit("definition"), r.parser.defined.push(i), n(c)) : t(c);
1061
+ }
1062
+ }
1063
+ function er(e, n, t) {
1064
+ return r;
1065
+ function r(a) {
1066
+ return Z(a) ? ve(e, i)(a) : t(a);
1067
+ }
1068
+ function i(a) {
1069
+ return Mt(
1070
+ e,
1071
+ s,
1072
+ t,
1073
+ "definitionTitle",
1074
+ "definitionTitleMarker",
1075
+ "definitionTitleString"
1076
+ )(a);
1077
+ }
1078
+ function s(a) {
1079
+ return _(a) ? M(e, o, "whitespace")(a) : o(a);
1080
+ }
1081
+ function o(a) {
1082
+ return a === null || A(a) ? n(a) : t(a);
1083
+ }
1084
+ }
1085
+ const tr = {
1086
+ name: "hardBreakEscape",
1087
+ tokenize: nr
1088
+ };
1089
+ function nr(e, n, t) {
1090
+ return r;
1091
+ function r(s) {
1092
+ return e.enter("hardBreakEscape"), e.consume(s), i;
1093
+ }
1094
+ function i(s) {
1095
+ return A(s) ? (e.exit("hardBreakEscape"), n(s)) : t(s);
1096
+ }
1097
+ }
1098
+ const rr = {
1099
+ name: "headingAtx",
1100
+ tokenize: sr,
1101
+ resolve: ir
1102
+ };
1103
+ function ir(e, n) {
1104
+ let t = e.length - 2, r = 3, i, s;
1105
+ return e[r][1].type === "whitespace" && (r += 2), t - 2 > r && e[t][1].type === "whitespace" && (t -= 2), e[t][1].type === "atxHeadingSequence" && (r === t - 1 || t - 4 > r && e[t - 2][1].type === "whitespace") && (t -= r + 1 === t ? 2 : 4), t > r && (i = {
1106
+ type: "atxHeadingText",
1107
+ start: e[r][1].start,
1108
+ end: e[t][1].end
1109
+ }, s = {
1110
+ type: "chunkText",
1111
+ start: e[r][1].start,
1112
+ end: e[t][1].end,
1113
+ contentType: "text"
1114
+ }, ae(e, r, t - r + 1, [
1115
+ ["enter", i, n],
1116
+ ["enter", s, n],
1117
+ ["exit", s, n],
1118
+ ["exit", i, n]
1119
+ ])), e;
1120
+ }
1121
+ function sr(e, n, t) {
1122
+ let r = 0;
1123
+ return i;
1124
+ function i(m) {
1125
+ return e.enter("atxHeading"), s(m);
1126
+ }
1127
+ function s(m) {
1128
+ return e.enter("atxHeadingSequence"), o(m);
1129
+ }
1130
+ function o(m) {
1131
+ return m === 35 && r++ < 6 ? (e.consume(m), o) : m === null || Z(m) ? (e.exit("atxHeadingSequence"), a(m)) : t(m);
1132
+ }
1133
+ function a(m) {
1134
+ return m === 35 ? (e.enter("atxHeadingSequence"), p(m)) : m === null || A(m) ? (e.exit("atxHeading"), n(m)) : _(m) ? M(e, a, "whitespace")(m) : (e.enter("atxHeadingText"), h(m));
1135
+ }
1136
+ function p(m) {
1137
+ return m === 35 ? (e.consume(m), p) : (e.exit("atxHeadingSequence"), a(m));
1138
+ }
1139
+ function h(m) {
1140
+ return m === null || m === 35 || Z(m) ? (e.exit("atxHeadingText"), a(m)) : (e.consume(m), h);
1141
+ }
1142
+ }
1143
+ const or = [
1144
+ "address",
1145
+ "article",
1146
+ "aside",
1147
+ "base",
1148
+ "basefont",
1149
+ "blockquote",
1150
+ "body",
1151
+ "caption",
1152
+ "center",
1153
+ "col",
1154
+ "colgroup",
1155
+ "dd",
1156
+ "details",
1157
+ "dialog",
1158
+ "dir",
1159
+ "div",
1160
+ "dl",
1161
+ "dt",
1162
+ "fieldset",
1163
+ "figcaption",
1164
+ "figure",
1165
+ "footer",
1166
+ "form",
1167
+ "frame",
1168
+ "frameset",
1169
+ "h1",
1170
+ "h2",
1171
+ "h3",
1172
+ "h4",
1173
+ "h5",
1174
+ "h6",
1175
+ "head",
1176
+ "header",
1177
+ "hr",
1178
+ "html",
1179
+ "iframe",
1180
+ "legend",
1181
+ "li",
1182
+ "link",
1183
+ "main",
1184
+ "menu",
1185
+ "menuitem",
1186
+ "nav",
1187
+ "noframes",
1188
+ "ol",
1189
+ "optgroup",
1190
+ "option",
1191
+ "p",
1192
+ "param",
1193
+ "search",
1194
+ "section",
1195
+ "summary",
1196
+ "table",
1197
+ "tbody",
1198
+ "td",
1199
+ "tfoot",
1200
+ "th",
1201
+ "thead",
1202
+ "title",
1203
+ "tr",
1204
+ "track",
1205
+ "ul"
1206
+ ], lt = ["pre", "script", "style", "textarea"], ar = {
1207
+ name: "htmlFlow",
1208
+ tokenize: cr,
1209
+ resolveTo: hr,
1210
+ concrete: !0
1211
+ }, lr = {
1212
+ tokenize: dr,
1213
+ partial: !0
1214
+ }, ur = {
1215
+ tokenize: pr,
1216
+ partial: !0
1217
+ };
1218
+ function hr(e) {
1219
+ let n = e.length;
1220
+ for (; n-- && !(e[n][0] === "enter" && e[n][1].type === "htmlFlow"); )
1221
+ ;
1222
+ return n > 1 && e[n - 2][1].type === "linePrefix" && (e[n][1].start = e[n - 2][1].start, e[n + 1][1].start = e[n - 2][1].start, e.splice(n - 2, 2)), e;
1223
+ }
1224
+ function cr(e, n, t) {
1225
+ const r = this;
1226
+ let i, s, o, a, p;
1227
+ return h;
1228
+ function h(u) {
1229
+ return m(u);
1230
+ }
1231
+ function m(u) {
1232
+ return e.enter("htmlFlow"), e.enter("htmlFlowData"), e.consume(u), d;
1233
+ }
1234
+ function d(u) {
1235
+ return u === 33 ? (e.consume(u), g) : u === 47 ? (e.consume(u), s = !0, T) : u === 63 ? (e.consume(u), i = 3, r.interrupt ? n : l) : se(u) ? (e.consume(u), o = String.fromCharCode(u), j) : t(u);
1236
+ }
1237
+ function g(u) {
1238
+ return u === 45 ? (e.consume(u), i = 2, c) : u === 91 ? (e.consume(u), i = 5, a = 0, k) : se(u) ? (e.consume(u), i = 4, r.interrupt ? n : l) : t(u);
1239
+ }
1240
+ function c(u) {
1241
+ return u === 45 ? (e.consume(u), r.interrupt ? n : l) : t(u);
1242
+ }
1243
+ function k(u) {
1244
+ const ne = "CDATA[";
1245
+ return u === ne.charCodeAt(a++) ? (e.consume(u), a === ne.length ? r.interrupt ? n : E : k) : t(u);
1246
+ }
1247
+ function T(u) {
1248
+ return se(u) ? (e.consume(u), o = String.fromCharCode(u), j) : t(u);
1249
+ }
1250
+ function j(u) {
1251
+ if (u === null || u === 47 || u === 62 || Z(u)) {
1252
+ const ne = u === 47, fe = o.toLowerCase();
1253
+ return !ne && !s && lt.includes(fe) ? (i = 1, r.interrupt ? n(u) : E(u)) : or.includes(o.toLowerCase()) ? (i = 6, ne ? (e.consume(u), y) : r.interrupt ? n(u) : E(u)) : (i = 7, r.interrupt && !r.parser.lazy[r.now().line] ? t(u) : s ? G(u) : C(u));
1254
+ }
1255
+ return u === 45 || ie(u) ? (e.consume(u), o += String.fromCharCode(u), j) : t(u);
1256
+ }
1257
+ function y(u) {
1258
+ return u === 62 ? (e.consume(u), r.interrupt ? n : E) : t(u);
1259
+ }
1260
+ function G(u) {
1261
+ return _(u) ? (e.consume(u), G) : f(u);
1262
+ }
1263
+ function C(u) {
1264
+ return u === 47 ? (e.consume(u), f) : u === 58 || u === 95 || se(u) ? (e.consume(u), N) : _(u) ? (e.consume(u), C) : f(u);
1265
+ }
1266
+ function N(u) {
1267
+ return u === 45 || u === 46 || u === 58 || u === 95 || ie(u) ? (e.consume(u), N) : D(u);
1268
+ }
1269
+ function D(u) {
1270
+ return u === 61 ? (e.consume(u), b) : _(u) ? (e.consume(u), D) : C(u);
1271
+ }
1272
+ function b(u) {
1273
+ return u === null || u === 60 || u === 61 || u === 62 || u === 96 ? t(u) : u === 34 || u === 39 ? (e.consume(u), p = u, z) : _(u) ? (e.consume(u), b) : U(u);
1274
+ }
1275
+ function z(u) {
1276
+ return u === p ? (e.consume(u), p = null, F) : u === null || A(u) ? t(u) : (e.consume(u), z);
1277
+ }
1278
+ function U(u) {
1279
+ return u === null || u === 34 || u === 39 || u === 47 || u === 60 || u === 61 || u === 62 || u === 96 || Z(u) ? D(u) : (e.consume(u), U);
1280
+ }
1281
+ function F(u) {
1282
+ return u === 47 || u === 62 || _(u) ? C(u) : t(u);
1283
+ }
1284
+ function f(u) {
1285
+ return u === 62 ? (e.consume(u), S) : t(u);
1286
+ }
1287
+ function S(u) {
1288
+ return u === null || A(u) ? E(u) : _(u) ? (e.consume(u), S) : t(u);
1289
+ }
1290
+ function E(u) {
1291
+ return u === 45 && i === 2 ? (e.consume(u), Q) : u === 60 && i === 1 ? (e.consume(u), V) : u === 62 && i === 4 ? (e.consume(u), te) : u === 63 && i === 3 ? (e.consume(u), l) : u === 93 && i === 5 ? (e.consume(u), le) : A(u) && (i === 6 || i === 7) ? (e.exit("htmlFlowData"), e.check(
1292
+ lr,
1293
+ ue,
1294
+ P
1295
+ )(u)) : u === null || A(u) ? (e.exit("htmlFlowData"), P(u)) : (e.consume(u), E);
1296
+ }
1297
+ function P(u) {
1298
+ return e.check(
1299
+ ur,
1300
+ H,
1301
+ ue
1302
+ )(u);
1303
+ }
1304
+ function H(u) {
1305
+ return e.enter("lineEnding"), e.consume(u), e.exit("lineEnding"), B;
1306
+ }
1307
+ function B(u) {
1308
+ return u === null || A(u) ? P(u) : (e.enter("htmlFlowData"), E(u));
1309
+ }
1310
+ function Q(u) {
1311
+ return u === 45 ? (e.consume(u), l) : E(u);
1312
+ }
1313
+ function V(u) {
1314
+ return u === 47 ? (e.consume(u), o = "", ee) : E(u);
1315
+ }
1316
+ function ee(u) {
1317
+ if (u === 62) {
1318
+ const ne = o.toLowerCase();
1319
+ return lt.includes(ne) ? (e.consume(u), te) : E(u);
1320
+ }
1321
+ return se(u) && o.length < 8 ? (e.consume(u), o += String.fromCharCode(u), ee) : E(u);
1322
+ }
1323
+ function le(u) {
1324
+ return u === 93 ? (e.consume(u), l) : E(u);
1325
+ }
1326
+ function l(u) {
1327
+ return u === 62 ? (e.consume(u), te) : u === 45 && i === 2 ? (e.consume(u), l) : E(u);
1328
+ }
1329
+ function te(u) {
1330
+ return u === null || A(u) ? (e.exit("htmlFlowData"), ue(u)) : (e.consume(u), te);
1331
+ }
1332
+ function ue(u) {
1333
+ return e.exit("htmlFlow"), n(u);
1334
+ }
1335
+ }
1336
+ function pr(e, n, t) {
1337
+ const r = this;
1338
+ return i;
1339
+ function i(o) {
1340
+ return A(o) ? (e.enter("lineEnding"), e.consume(o), e.exit("lineEnding"), s) : t(o);
1341
+ }
1342
+ function s(o) {
1343
+ return r.parser.lazy[r.now().line] ? t(o) : n(o);
1344
+ }
1345
+ }
1346
+ function dr(e, n, t) {
1347
+ return r;
1348
+ function r(i) {
1349
+ return e.enter("lineEnding"), e.consume(i), e.exit("lineEnding"), e.attempt(Be, n, t);
1350
+ }
1351
+ }
1352
+ const mr = {
1353
+ name: "htmlText",
1354
+ tokenize: gr
1355
+ };
1356
+ function gr(e, n, t) {
1357
+ const r = this;
1358
+ let i, s, o;
1359
+ return a;
1360
+ function a(l) {
1361
+ return e.enter("htmlText"), e.enter("htmlTextData"), e.consume(l), p;
1362
+ }
1363
+ function p(l) {
1364
+ return l === 33 ? (e.consume(l), h) : l === 47 ? (e.consume(l), D) : l === 63 ? (e.consume(l), C) : se(l) ? (e.consume(l), U) : t(l);
1365
+ }
1366
+ function h(l) {
1367
+ return l === 45 ? (e.consume(l), m) : l === 91 ? (e.consume(l), s = 0, k) : se(l) ? (e.consume(l), G) : t(l);
1368
+ }
1369
+ function m(l) {
1370
+ return l === 45 ? (e.consume(l), c) : t(l);
1371
+ }
1372
+ function d(l) {
1373
+ return l === null ? t(l) : l === 45 ? (e.consume(l), g) : A(l) ? (o = d, V(l)) : (e.consume(l), d);
1374
+ }
1375
+ function g(l) {
1376
+ return l === 45 ? (e.consume(l), c) : d(l);
1377
+ }
1378
+ function c(l) {
1379
+ return l === 62 ? Q(l) : l === 45 ? g(l) : d(l);
1380
+ }
1381
+ function k(l) {
1382
+ const te = "CDATA[";
1383
+ return l === te.charCodeAt(s++) ? (e.consume(l), s === te.length ? T : k) : t(l);
1384
+ }
1385
+ function T(l) {
1386
+ return l === null ? t(l) : l === 93 ? (e.consume(l), j) : A(l) ? (o = T, V(l)) : (e.consume(l), T);
1387
+ }
1388
+ function j(l) {
1389
+ return l === 93 ? (e.consume(l), y) : T(l);
1390
+ }
1391
+ function y(l) {
1392
+ return l === 62 ? Q(l) : l === 93 ? (e.consume(l), y) : T(l);
1393
+ }
1394
+ function G(l) {
1395
+ return l === null || l === 62 ? Q(l) : A(l) ? (o = G, V(l)) : (e.consume(l), G);
1396
+ }
1397
+ function C(l) {
1398
+ return l === null ? t(l) : l === 63 ? (e.consume(l), N) : A(l) ? (o = C, V(l)) : (e.consume(l), C);
1399
+ }
1400
+ function N(l) {
1401
+ return l === 62 ? Q(l) : C(l);
1402
+ }
1403
+ function D(l) {
1404
+ return se(l) ? (e.consume(l), b) : t(l);
1405
+ }
1406
+ function b(l) {
1407
+ return l === 45 || ie(l) ? (e.consume(l), b) : z(l);
1408
+ }
1409
+ function z(l) {
1410
+ return A(l) ? (o = z, V(l)) : _(l) ? (e.consume(l), z) : Q(l);
1411
+ }
1412
+ function U(l) {
1413
+ return l === 45 || ie(l) ? (e.consume(l), U) : l === 47 || l === 62 || Z(l) ? F(l) : t(l);
1414
+ }
1415
+ function F(l) {
1416
+ return l === 47 ? (e.consume(l), Q) : l === 58 || l === 95 || se(l) ? (e.consume(l), f) : A(l) ? (o = F, V(l)) : _(l) ? (e.consume(l), F) : Q(l);
1417
+ }
1418
+ function f(l) {
1419
+ return l === 45 || l === 46 || l === 58 || l === 95 || ie(l) ? (e.consume(l), f) : S(l);
1420
+ }
1421
+ function S(l) {
1422
+ return l === 61 ? (e.consume(l), E) : A(l) ? (o = S, V(l)) : _(l) ? (e.consume(l), S) : F(l);
1423
+ }
1424
+ function E(l) {
1425
+ return l === null || l === 60 || l === 61 || l === 62 || l === 96 ? t(l) : l === 34 || l === 39 ? (e.consume(l), i = l, P) : A(l) ? (o = E, V(l)) : _(l) ? (e.consume(l), E) : (e.consume(l), H);
1426
+ }
1427
+ function P(l) {
1428
+ return l === i ? (e.consume(l), i = void 0, B) : l === null ? t(l) : A(l) ? (o = P, V(l)) : (e.consume(l), P);
1429
+ }
1430
+ function H(l) {
1431
+ return l === null || l === 34 || l === 39 || l === 60 || l === 61 || l === 96 ? t(l) : l === 47 || l === 62 || Z(l) ? F(l) : (e.consume(l), H);
1432
+ }
1433
+ function B(l) {
1434
+ return l === 47 || l === 62 || Z(l) ? F(l) : t(l);
1435
+ }
1436
+ function Q(l) {
1437
+ return l === 62 ? (e.consume(l), e.exit("htmlTextData"), e.exit("htmlText"), n) : t(l);
1438
+ }
1439
+ function V(l) {
1440
+ return e.exit("htmlTextData"), e.enter("lineEnding"), e.consume(l), e.exit("lineEnding"), ee;
1441
+ }
1442
+ function ee(l) {
1443
+ return _(l) ? M(
1444
+ e,
1445
+ le,
1446
+ "linePrefix",
1447
+ r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4
1448
+ )(l) : le(l);
1449
+ }
1450
+ function le(l) {
1451
+ return e.enter("htmlTextData"), o(l);
1452
+ }
1453
+ }
1454
+ const Qe = {
1455
+ name: "labelEnd",
1456
+ tokenize: kr,
1457
+ resolveTo: yr,
1458
+ resolveAll: xr
1459
+ }, fr = {
1460
+ tokenize: Cr
1461
+ }, wr = {
1462
+ tokenize: Sr
1463
+ }, br = {
1464
+ tokenize: Er
1465
+ };
1466
+ function xr(e) {
1467
+ let n = -1;
1468
+ for (; ++n < e.length; ) {
1469
+ const t = e[n][1];
1470
+ (t.type === "labelImage" || t.type === "labelLink" || t.type === "labelEnd") && (e.splice(n + 1, t.type === "labelImage" ? 4 : 2), t.type = "data", n++);
1471
+ }
1472
+ return e;
1473
+ }
1474
+ function yr(e, n) {
1475
+ let t = e.length, r = 0, i, s, o, a;
1476
+ for (; t--; )
1477
+ if (i = e[t][1], s) {
1478
+ if (i.type === "link" || i.type === "labelLink" && i._inactive)
1479
+ break;
1480
+ e[t][0] === "enter" && i.type === "labelLink" && (i._inactive = !0);
1481
+ } else if (o) {
1482
+ if (e[t][0] === "enter" && (i.type === "labelImage" || i.type === "labelLink") && !i._balanced && (s = t, i.type !== "labelLink")) {
1483
+ r = 2;
1484
+ break;
1485
+ }
1486
+ } else
1487
+ i.type === "labelEnd" && (o = t);
1488
+ const p = {
1489
+ type: e[s][1].type === "labelLink" ? "link" : "image",
1490
+ start: Object.assign({}, e[s][1].start),
1491
+ end: Object.assign({}, e[e.length - 1][1].end)
1492
+ }, h = {
1493
+ type: "label",
1494
+ start: Object.assign({}, e[s][1].start),
1495
+ end: Object.assign({}, e[o][1].end)
1496
+ }, m = {
1497
+ type: "labelText",
1498
+ start: Object.assign({}, e[s + r + 2][1].end),
1499
+ end: Object.assign({}, e[o - 2][1].start)
1500
+ };
1501
+ return a = [
1502
+ ["enter", p, n],
1503
+ ["enter", h, n]
1504
+ ], a = K(a, e.slice(s + 1, s + r + 3)), a = K(a, [["enter", m, n]]), a = K(
1505
+ a,
1506
+ We(
1507
+ n.parser.constructs.insideSpan.null,
1508
+ e.slice(s + r + 4, o - 3),
1509
+ n
1510
+ )
1511
+ ), a = K(a, [
1512
+ ["exit", m, n],
1513
+ e[o - 2],
1514
+ e[o - 1],
1515
+ ["exit", h, n]
1516
+ ]), a = K(a, e.slice(o + 1)), a = K(a, [["exit", p, n]]), ae(e, s, e.length, a), e;
1517
+ }
1518
+ function kr(e, n, t) {
1519
+ const r = this;
1520
+ let i = r.events.length, s, o;
1521
+ for (; i--; )
1522
+ if ((r.events[i][1].type === "labelImage" || r.events[i][1].type === "labelLink") && !r.events[i][1]._balanced) {
1523
+ s = r.events[i][1];
1524
+ break;
1525
+ }
1526
+ return a;
1527
+ function a(g) {
1528
+ return s ? s._inactive ? d(g) : (o = r.parser.defined.includes(
1529
+ Se(
1530
+ r.sliceSerialize({
1531
+ start: s.end,
1532
+ end: r.now()
1533
+ })
1534
+ )
1535
+ ), e.enter("labelEnd"), e.enter("labelMarker"), e.consume(g), e.exit("labelMarker"), e.exit("labelEnd"), p) : t(g);
1536
+ }
1537
+ function p(g) {
1538
+ return g === 40 ? e.attempt(
1539
+ fr,
1540
+ m,
1541
+ o ? m : d
1542
+ )(g) : g === 91 ? e.attempt(
1543
+ wr,
1544
+ m,
1545
+ o ? h : d
1546
+ )(g) : o ? m(g) : d(g);
1547
+ }
1548
+ function h(g) {
1549
+ return e.attempt(
1550
+ br,
1551
+ m,
1552
+ d
1553
+ )(g);
1554
+ }
1555
+ function m(g) {
1556
+ return n(g);
1557
+ }
1558
+ function d(g) {
1559
+ return s._balanced = !0, t(g);
1560
+ }
1561
+ }
1562
+ function Cr(e, n, t) {
1563
+ return r;
1564
+ function r(d) {
1565
+ return e.enter("resource"), e.enter("resourceMarker"), e.consume(d), e.exit("resourceMarker"), i;
1566
+ }
1567
+ function i(d) {
1568
+ return Z(d) ? ve(e, s)(d) : s(d);
1569
+ }
1570
+ function s(d) {
1571
+ return d === 41 ? m(d) : Bt(
1572
+ e,
1573
+ o,
1574
+ a,
1575
+ "resourceDestination",
1576
+ "resourceDestinationLiteral",
1577
+ "resourceDestinationLiteralMarker",
1578
+ "resourceDestinationRaw",
1579
+ "resourceDestinationString",
1580
+ 32
1581
+ )(d);
1582
+ }
1583
+ function o(d) {
1584
+ return Z(d) ? ve(e, p)(d) : m(d);
1585
+ }
1586
+ function a(d) {
1587
+ return t(d);
1588
+ }
1589
+ function p(d) {
1590
+ return d === 34 || d === 39 || d === 40 ? Mt(
1591
+ e,
1592
+ h,
1593
+ t,
1594
+ "resourceTitle",
1595
+ "resourceTitleMarker",
1596
+ "resourceTitleString"
1597
+ )(d) : m(d);
1598
+ }
1599
+ function h(d) {
1600
+ return Z(d) ? ve(e, m)(d) : m(d);
1601
+ }
1602
+ function m(d) {
1603
+ return d === 41 ? (e.enter("resourceMarker"), e.consume(d), e.exit("resourceMarker"), e.exit("resource"), n) : t(d);
1604
+ }
1605
+ }
1606
+ function Sr(e, n, t) {
1607
+ const r = this;
1608
+ return i;
1609
+ function i(a) {
1610
+ return Tt.call(
1611
+ r,
1612
+ e,
1613
+ s,
1614
+ o,
1615
+ "reference",
1616
+ "referenceMarker",
1617
+ "referenceString"
1618
+ )(a);
1619
+ }
1620
+ function s(a) {
1621
+ return r.parser.defined.includes(
1622
+ Se(
1623
+ r.sliceSerialize(r.events[r.events.length - 1][1]).slice(1, -1)
1624
+ )
1625
+ ) ? n(a) : t(a);
1626
+ }
1627
+ function o(a) {
1628
+ return t(a);
1629
+ }
1630
+ }
1631
+ function Er(e, n, t) {
1632
+ return r;
1633
+ function r(s) {
1634
+ return e.enter("reference"), e.enter("referenceMarker"), e.consume(s), e.exit("referenceMarker"), i;
1635
+ }
1636
+ function i(s) {
1637
+ return s === 93 ? (e.enter("referenceMarker"), e.consume(s), e.exit("referenceMarker"), e.exit("reference"), n) : t(s);
1638
+ }
1639
+ }
1640
+ const Ar = {
1641
+ name: "labelStartImage",
1642
+ tokenize: Ir,
1643
+ resolveAll: Qe.resolveAll
1644
+ };
1645
+ function Ir(e, n, t) {
1646
+ const r = this;
1647
+ return i;
1648
+ function i(a) {
1649
+ return e.enter("labelImage"), e.enter("labelImageMarker"), e.consume(a), e.exit("labelImageMarker"), s;
1650
+ }
1651
+ function s(a) {
1652
+ return a === 91 ? (e.enter("labelMarker"), e.consume(a), e.exit("labelMarker"), e.exit("labelImage"), o) : t(a);
1653
+ }
1654
+ function o(a) {
1655
+ return a === 94 && "_hiddenFootnoteSupport" in r.parser.constructs ? t(a) : n(a);
1656
+ }
1657
+ }
1658
+ const vr = {
1659
+ name: "labelStartLink",
1660
+ tokenize: _r,
1661
+ resolveAll: Qe.resolveAll
1662
+ };
1663
+ function _r(e, n, t) {
1664
+ const r = this;
1665
+ return i;
1666
+ function i(o) {
1667
+ return e.enter("labelLink"), e.enter("labelMarker"), e.consume(o), e.exit("labelMarker"), e.exit("labelLink"), s;
1668
+ }
1669
+ function s(o) {
1670
+ return o === 94 && "_hiddenFootnoteSupport" in r.parser.constructs ? t(o) : n(o);
1671
+ }
1672
+ }
1673
+ const De = {
1674
+ name: "lineEnding",
1675
+ tokenize: Lr
1676
+ };
1677
+ function Lr(e, n) {
1678
+ return t;
1679
+ function t(r) {
1680
+ return e.enter("lineEnding"), e.consume(r), e.exit("lineEnding"), M(e, n, "linePrefix");
1681
+ }
1682
+ }
1683
+ const Le = {
1684
+ name: "thematicBreak",
1685
+ tokenize: zr
1686
+ };
1687
+ function zr(e, n, t) {
1688
+ let r = 0, i;
1689
+ return s;
1690
+ function s(h) {
1691
+ return e.enter("thematicBreak"), o(h);
1692
+ }
1693
+ function o(h) {
1694
+ return i = h, a(h);
1695
+ }
1696
+ function a(h) {
1697
+ return h === i ? (e.enter("thematicBreakSequence"), p(h)) : r >= 3 && (h === null || A(h)) ? (e.exit("thematicBreak"), n(h)) : t(h);
1698
+ }
1699
+ function p(h) {
1700
+ return h === i ? (e.consume(h), r++, p) : (e.exit("thematicBreakSequence"), _(h) ? M(e, a, "whitespace")(h) : a(h));
1701
+ }
1702
+ }
1703
+ const $ = {
1704
+ name: "list",
1705
+ tokenize: Mr,
1706
+ continuation: {
1707
+ tokenize: Dr
1708
+ },
1709
+ exit: Rr
1710
+ }, Br = {
1711
+ tokenize: Nr,
1712
+ partial: !0
1713
+ }, Tr = {
1714
+ tokenize: Fr,
1715
+ partial: !0
1716
+ };
1717
+ function Mr(e, n, t) {
1718
+ const r = this, i = r.events[r.events.length - 1];
1719
+ let s = i && i[1].type === "linePrefix" ? i[2].sliceSerialize(i[1], !0).length : 0, o = 0;
1720
+ return a;
1721
+ function a(c) {
1722
+ const k = r.containerState.type || (c === 42 || c === 43 || c === 45 ? "listUnordered" : "listOrdered");
1723
+ if (k === "listUnordered" ? !r.containerState.marker || c === r.containerState.marker : Oe(c)) {
1724
+ if (r.containerState.type || (r.containerState.type = k, e.enter(k, {
1725
+ _container: !0
1726
+ })), k === "listUnordered")
1727
+ return e.enter("listItemPrefix"), c === 42 || c === 45 ? e.check(Le, t, h)(c) : h(c);
1728
+ if (!r.interrupt || c === 49)
1729
+ return e.enter("listItemPrefix"), e.enter("listItemValue"), p(c);
1730
+ }
1731
+ return t(c);
1732
+ }
1733
+ function p(c) {
1734
+ return Oe(c) && ++o < 10 ? (e.consume(c), p) : (!r.interrupt || o < 2) && (r.containerState.marker ? c === r.containerState.marker : c === 41 || c === 46) ? (e.exit("listItemValue"), h(c)) : t(c);
1735
+ }
1736
+ function h(c) {
1737
+ return e.enter("listItemMarker"), e.consume(c), e.exit("listItemMarker"), r.containerState.marker = r.containerState.marker || c, e.check(
1738
+ Be,
1739
+ // Can’t be empty when interrupting.
1740
+ r.interrupt ? t : m,
1741
+ e.attempt(
1742
+ Br,
1743
+ g,
1744
+ d
1745
+ )
1746
+ );
1747
+ }
1748
+ function m(c) {
1749
+ return r.containerState.initialBlankLine = !0, s++, g(c);
1750
+ }
1751
+ function d(c) {
1752
+ return _(c) ? (e.enter("listItemPrefixWhitespace"), e.consume(c), e.exit("listItemPrefixWhitespace"), g) : t(c);
1753
+ }
1754
+ function g(c) {
1755
+ return r.containerState.size = s + r.sliceSerialize(e.exit("listItemPrefix"), !0).length, n(c);
1756
+ }
1757
+ }
1758
+ function Dr(e, n, t) {
1759
+ const r = this;
1760
+ return r.containerState._closeFlow = void 0, e.check(Be, i, s);
1761
+ function i(a) {
1762
+ return r.containerState.furtherBlankLines = r.containerState.furtherBlankLines || r.containerState.initialBlankLine, M(
1763
+ e,
1764
+ n,
1765
+ "listItemIndent",
1766
+ r.containerState.size + 1
1767
+ )(a);
1768
+ }
1769
+ function s(a) {
1770
+ return r.containerState.furtherBlankLines || !_(a) ? (r.containerState.furtherBlankLines = void 0, r.containerState.initialBlankLine = void 0, o(a)) : (r.containerState.furtherBlankLines = void 0, r.containerState.initialBlankLine = void 0, e.attempt(Tr, n, o)(a));
1771
+ }
1772
+ function o(a) {
1773
+ return r.containerState._closeFlow = !0, r.interrupt = void 0, M(
1774
+ e,
1775
+ e.attempt($, n, t),
1776
+ "linePrefix",
1777
+ r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4
1778
+ )(a);
1779
+ }
1780
+ }
1781
+ function Fr(e, n, t) {
1782
+ const r = this;
1783
+ return M(
1784
+ e,
1785
+ i,
1786
+ "listItemIndent",
1787
+ r.containerState.size + 1
1788
+ );
1789
+ function i(s) {
1790
+ const o = r.events[r.events.length - 1];
1791
+ return o && o[1].type === "listItemIndent" && o[2].sliceSerialize(o[1], !0).length === r.containerState.size ? n(s) : t(s);
1792
+ }
1793
+ }
1794
+ function Rr(e) {
1795
+ e.exit(this.containerState.type);
1796
+ }
1797
+ function Nr(e, n, t) {
1798
+ const r = this;
1799
+ return M(
1800
+ e,
1801
+ i,
1802
+ "listItemPrefixWhitespace",
1803
+ r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 5
1804
+ );
1805
+ function i(s) {
1806
+ const o = r.events[r.events.length - 1];
1807
+ return !_(s) && o && o[1].type === "listItemPrefixWhitespace" ? n(s) : t(s);
1808
+ }
1809
+ }
1810
+ const ut = {
1811
+ name: "setextUnderline",
1812
+ tokenize: Pr,
1813
+ resolveTo: Or
1814
+ };
1815
+ function Or(e, n) {
1816
+ let t = e.length, r, i, s;
1817
+ for (; t--; )
1818
+ if (e[t][0] === "enter") {
1819
+ if (e[t][1].type === "content") {
1820
+ r = t;
1821
+ break;
1822
+ }
1823
+ e[t][1].type === "paragraph" && (i = t);
1824
+ } else
1825
+ e[t][1].type === "content" && e.splice(t, 1), !s && e[t][1].type === "definition" && (s = t);
1826
+ const o = {
1827
+ type: "setextHeading",
1828
+ start: Object.assign({}, e[i][1].start),
1829
+ end: Object.assign({}, e[e.length - 1][1].end)
1830
+ };
1831
+ return e[i][1].type = "setextHeadingText", s ? (e.splice(i, 0, ["enter", o, n]), e.splice(s + 1, 0, ["exit", e[r][1], n]), e[r][1].end = Object.assign({}, e[s][1].end)) : e[r][1] = o, e.push(["exit", o, n]), e;
1832
+ }
1833
+ function Pr(e, n, t) {
1834
+ const r = this;
1835
+ let i;
1836
+ return s;
1837
+ function s(h) {
1838
+ let m = r.events.length, d;
1839
+ for (; m--; )
1840
+ if (r.events[m][1].type !== "lineEnding" && r.events[m][1].type !== "linePrefix" && r.events[m][1].type !== "content") {
1841
+ d = r.events[m][1].type === "paragraph";
1842
+ break;
1843
+ }
1844
+ return !r.parser.lazy[r.now().line] && (r.interrupt || d) ? (e.enter("setextHeadingLine"), i = h, o(h)) : t(h);
1845
+ }
1846
+ function o(h) {
1847
+ return e.enter("setextHeadingLineSequence"), a(h);
1848
+ }
1849
+ function a(h) {
1850
+ return h === i ? (e.consume(h), a) : (e.exit("setextHeadingLineSequence"), _(h) ? M(e, p, "lineSuffix")(h) : p(h));
1851
+ }
1852
+ function p(h) {
1853
+ return h === null || A(h) ? (e.exit("setextHeadingLine"), n(h)) : t(h);
1854
+ }
1855
+ }
1856
+ const jr = {
1857
+ tokenize: qr
1858
+ };
1859
+ function qr(e) {
1860
+ const n = this, t = e.attempt(
1861
+ // Try to parse a blank line.
1862
+ Be,
1863
+ r,
1864
+ // Try to parse initial flow (essentially, only code).
1865
+ e.attempt(
1866
+ this.parser.constructs.flowInitial,
1867
+ i,
1868
+ M(
1869
+ e,
1870
+ e.attempt(
1871
+ this.parser.constructs.flow,
1872
+ i,
1873
+ e.attempt(Wn, i)
1874
+ ),
1875
+ "linePrefix"
1876
+ )
1877
+ )
1878
+ );
1879
+ return t;
1880
+ function r(s) {
1881
+ if (s === null) {
1882
+ e.consume(s);
1883
+ return;
1884
+ }
1885
+ return e.enter("lineEndingBlank"), e.consume(s), e.exit("lineEndingBlank"), n.currentConstruct = void 0, t;
1886
+ }
1887
+ function i(s) {
1888
+ if (s === null) {
1889
+ e.consume(s);
1890
+ return;
1891
+ }
1892
+ return e.enter("lineEnding"), e.consume(s), e.exit("lineEnding"), n.currentConstruct = void 0, t;
1893
+ }
1894
+ }
1895
+ const Gr = {
1896
+ resolveAll: Ft()
1897
+ }, Ur = Dt("string"), Hr = Dt("text");
1898
+ function Dt(e) {
1899
+ return {
1900
+ tokenize: n,
1901
+ resolveAll: Ft(
1902
+ e === "text" ? Vr : void 0
1903
+ )
1904
+ };
1905
+ function n(t) {
1906
+ const r = this, i = this.parser.constructs[e], s = t.attempt(i, o, a);
1907
+ return o;
1908
+ function o(m) {
1909
+ return h(m) ? s(m) : a(m);
1910
+ }
1911
+ function a(m) {
1912
+ if (m === null) {
1913
+ t.consume(m);
1914
+ return;
1915
+ }
1916
+ return t.enter("data"), t.consume(m), p;
1917
+ }
1918
+ function p(m) {
1919
+ return h(m) ? (t.exit("data"), s(m)) : (t.consume(m), p);
1920
+ }
1921
+ function h(m) {
1922
+ if (m === null)
1923
+ return !0;
1924
+ const d = i[m];
1925
+ let g = -1;
1926
+ if (d)
1927
+ for (; ++g < d.length; ) {
1928
+ const c = d[g];
1929
+ if (!c.previous || c.previous.call(r, r.previous))
1930
+ return !0;
1931
+ }
1932
+ return !1;
1933
+ }
1934
+ }
1935
+ }
1936
+ function Ft(e) {
1937
+ return n;
1938
+ function n(t, r) {
1939
+ let i = -1, s;
1940
+ for (; ++i <= t.length; )
1941
+ s === void 0 ? t[i] && t[i][1].type === "data" && (s = i, i++) : (!t[i] || t[i][1].type !== "data") && (i !== s + 2 && (t[s][1].end = t[i - 1][1].end, t.splice(s + 2, i - s - 2), i = s + 2), s = void 0);
1942
+ return e ? e(t, r) : t;
1943
+ }
1944
+ }
1945
+ function Vr(e, n) {
1946
+ let t = 0;
1947
+ for (; ++t <= e.length; )
1948
+ if ((t === e.length || e[t][1].type === "lineEnding") && e[t - 1][1].type === "data") {
1949
+ const r = e[t - 1][1], i = n.sliceStream(r);
1950
+ let s = i.length, o = -1, a = 0, p;
1951
+ for (; s--; ) {
1952
+ const h = i[s];
1953
+ if (typeof h == "string") {
1954
+ for (o = h.length; h.charCodeAt(o - 1) === 32; )
1955
+ a++, o--;
1956
+ if (o)
1957
+ break;
1958
+ o = -1;
1959
+ } else if (h === -2)
1960
+ p = !0, a++;
1961
+ else if (h !== -1) {
1962
+ s++;
1963
+ break;
1964
+ }
1965
+ }
1966
+ if (a) {
1967
+ const h = {
1968
+ type: t === e.length || p || a < 2 ? "lineSuffix" : "hardBreakTrailing",
1969
+ start: {
1970
+ line: r.end.line,
1971
+ column: r.end.column - a,
1972
+ offset: r.end.offset - a,
1973
+ _index: r.start._index + s,
1974
+ _bufferIndex: s ? o : r.start._bufferIndex + o
1975
+ },
1976
+ end: Object.assign({}, r.end)
1977
+ };
1978
+ r.end = Object.assign({}, h.start), r.start.offset === r.end.offset ? Object.assign(r, h) : (e.splice(
1979
+ t,
1980
+ 0,
1981
+ ["enter", h, n],
1982
+ ["exit", h, n]
1983
+ ), t += 2);
1984
+ }
1985
+ t++;
1986
+ }
1987
+ return e;
1988
+ }
1989
+ function Wr(e, n, t) {
1990
+ let r = Object.assign(
1991
+ t ? Object.assign({}, t) : {
1992
+ line: 1,
1993
+ column: 1,
1994
+ offset: 0
1995
+ },
1996
+ {
1997
+ _index: 0,
1998
+ _bufferIndex: -1
1999
+ }
2000
+ );
2001
+ const i = {}, s = [];
2002
+ let o = [], a = [];
2003
+ const p = {
2004
+ consume: G,
2005
+ enter: C,
2006
+ exit: N,
2007
+ attempt: z(D),
2008
+ check: z(b),
2009
+ interrupt: z(b, {
2010
+ interrupt: !0
2011
+ })
2012
+ }, h = {
2013
+ previous: null,
2014
+ code: null,
2015
+ containerState: {},
2016
+ events: [],
2017
+ parser: e,
2018
+ sliceStream: c,
2019
+ sliceSerialize: g,
2020
+ now: k,
2021
+ defineSkip: T,
2022
+ write: d
2023
+ };
2024
+ let m = n.tokenize.call(h, p);
2025
+ return n.resolveAll && s.push(n), h;
2026
+ function d(S) {
2027
+ return o = K(o, S), j(), o[o.length - 1] !== null ? [] : (U(n, 0), h.events = We(s, h.events, h), h.events);
2028
+ }
2029
+ function g(S, E) {
2030
+ return Zr(c(S), E);
2031
+ }
2032
+ function c(S) {
2033
+ return Qr(o, S);
2034
+ }
2035
+ function k() {
2036
+ const { line: S, column: E, offset: P, _index: H, _bufferIndex: B } = r;
2037
+ return {
2038
+ line: S,
2039
+ column: E,
2040
+ offset: P,
2041
+ _index: H,
2042
+ _bufferIndex: B
2043
+ };
2044
+ }
2045
+ function T(S) {
2046
+ i[S.line] = S.column, f();
2047
+ }
2048
+ function j() {
2049
+ let S;
2050
+ for (; r._index < o.length; ) {
2051
+ const E = o[r._index];
2052
+ if (typeof E == "string")
2053
+ for (S = r._index, r._bufferIndex < 0 && (r._bufferIndex = 0); r._index === S && r._bufferIndex < E.length; )
2054
+ y(E.charCodeAt(r._bufferIndex));
2055
+ else
2056
+ y(E);
2057
+ }
2058
+ }
2059
+ function y(S) {
2060
+ m = m(S);
2061
+ }
2062
+ function G(S) {
2063
+ A(S) ? (r.line++, r.column = 1, r.offset += S === -3 ? 2 : 1, f()) : S !== -1 && (r.column++, r.offset++), r._bufferIndex < 0 ? r._index++ : (r._bufferIndex++, r._bufferIndex === o[r._index].length && (r._bufferIndex = -1, r._index++)), h.previous = S;
2064
+ }
2065
+ function C(S, E) {
2066
+ const P = E || {};
2067
+ return P.type = S, P.start = k(), h.events.push(["enter", P, h]), a.push(P), P;
2068
+ }
2069
+ function N(S) {
2070
+ const E = a.pop();
2071
+ return E.end = k(), h.events.push(["exit", E, h]), E;
2072
+ }
2073
+ function D(S, E) {
2074
+ U(S, E.from);
2075
+ }
2076
+ function b(S, E) {
2077
+ E.restore();
2078
+ }
2079
+ function z(S, E) {
2080
+ return P;
2081
+ function P(H, B, Q) {
2082
+ let V, ee, le, l;
2083
+ return Array.isArray(H) ? ue(H) : "tokenize" in H ? (
2084
+ // @ts-expect-error Looks like a construct.
2085
+ ue([H])
2086
+ ) : te(H);
2087
+ function te(W) {
2088
+ return Ee;
2089
+ function Ee(de) {
2090
+ const ye = de !== null && W[de], we = de !== null && W.null, Te = [
2091
+ // To do: add more extension tests.
2092
+ /* c8 ignore next 2 */
2093
+ ...Array.isArray(ye) ? ye : ye ? [ye] : [],
2094
+ ...Array.isArray(we) ? we : we ? [we] : []
2095
+ ];
2096
+ return ue(Te)(de);
2097
+ }
2098
+ }
2099
+ function ue(W) {
2100
+ return V = W, ee = 0, W.length === 0 ? Q : u(W[ee]);
2101
+ }
2102
+ function u(W) {
2103
+ return Ee;
2104
+ function Ee(de) {
2105
+ return l = F(), le = W, W.partial || (h.currentConstruct = W), W.name && h.parser.constructs.disable.null.includes(W.name) ? fe() : W.tokenize.call(
2106
+ // If we do have fields, create an object w/ `context` as its
2107
+ // prototype.
2108
+ // This allows a “live binding”, which is needed for `interrupt`.
2109
+ E ? Object.assign(Object.create(h), E) : h,
2110
+ p,
2111
+ ne,
2112
+ fe
2113
+ )(de);
2114
+ }
2115
+ }
2116
+ function ne(W) {
2117
+ return S(le, l), B;
2118
+ }
2119
+ function fe(W) {
2120
+ return l.restore(), ++ee < V.length ? u(V[ee]) : Q;
2121
+ }
2122
+ }
2123
+ }
2124
+ function U(S, E) {
2125
+ S.resolveAll && !s.includes(S) && s.push(S), S.resolve && ae(
2126
+ h.events,
2127
+ E,
2128
+ h.events.length - E,
2129
+ S.resolve(h.events.slice(E), h)
2130
+ ), S.resolveTo && (h.events = S.resolveTo(h.events, h));
2131
+ }
2132
+ function F() {
2133
+ const S = k(), E = h.previous, P = h.currentConstruct, H = h.events.length, B = Array.from(a);
2134
+ return {
2135
+ restore: Q,
2136
+ from: H
2137
+ };
2138
+ function Q() {
2139
+ r = S, h.previous = E, h.currentConstruct = P, h.events.length = H, a = B, f();
2140
+ }
2141
+ }
2142
+ function f() {
2143
+ r.line in i && r.column < 2 && (r.column = i[r.line], r.offset += i[r.line] - 1);
2144
+ }
2145
+ }
2146
+ function Qr(e, n) {
2147
+ const t = n.start._index, r = n.start._bufferIndex, i = n.end._index, s = n.end._bufferIndex;
2148
+ let o;
2149
+ if (t === i)
2150
+ o = [e[t].slice(r, s)];
2151
+ else {
2152
+ if (o = e.slice(t, i), r > -1) {
2153
+ const a = o[0];
2154
+ typeof a == "string" ? o[0] = a.slice(r) : o.shift();
2155
+ }
2156
+ s > 0 && o.push(e[i].slice(0, s));
2157
+ }
2158
+ return o;
2159
+ }
2160
+ function Zr(e, n) {
2161
+ let t = -1;
2162
+ const r = [];
2163
+ let i;
2164
+ for (; ++t < e.length; ) {
2165
+ const s = e[t];
2166
+ let o;
2167
+ if (typeof s == "string")
2168
+ o = s;
2169
+ else
2170
+ switch (s) {
2171
+ case -5: {
2172
+ o = "\r";
2173
+ break;
2174
+ }
2175
+ case -4: {
2176
+ o = `
2177
+ `;
2178
+ break;
2179
+ }
2180
+ case -3: {
2181
+ o = `\r
2182
+ `;
2183
+ break;
2184
+ }
2185
+ case -2: {
2186
+ o = n ? " " : " ";
2187
+ break;
2188
+ }
2189
+ case -1: {
2190
+ if (!n && i)
2191
+ continue;
2192
+ o = " ";
2193
+ break;
2194
+ }
2195
+ default:
2196
+ o = String.fromCharCode(s);
2197
+ }
2198
+ i = s === -2, r.push(o);
2199
+ }
2200
+ return r.join("");
2201
+ }
2202
+ const $r = {
2203
+ 42: $,
2204
+ 43: $,
2205
+ 45: $,
2206
+ 48: $,
2207
+ 49: $,
2208
+ 50: $,
2209
+ 51: $,
2210
+ 52: $,
2211
+ 53: $,
2212
+ 54: $,
2213
+ 55: $,
2214
+ 56: $,
2215
+ 57: $,
2216
+ 62: vt
2217
+ }, Jr = {
2218
+ 91: Yn
2219
+ }, Yr = {
2220
+ [-2]: Me,
2221
+ [-1]: Me,
2222
+ 32: Me
2223
+ }, Xr = {
2224
+ 35: rr,
2225
+ 42: Le,
2226
+ 45: [ut, Le],
2227
+ 60: ar,
2228
+ 61: ut,
2229
+ 95: Le,
2230
+ 96: at,
2231
+ 126: at
2232
+ }, Kr = {
2233
+ 38: Lt,
2234
+ 92: _t
2235
+ }, ei = {
2236
+ [-5]: De,
2237
+ [-4]: De,
2238
+ [-3]: De,
2239
+ 33: Ar,
2240
+ 38: Lt,
2241
+ 42: Pe,
2242
+ 60: [_n, mr],
2243
+ 91: vr,
2244
+ 92: [tr, _t],
2245
+ 93: Qe,
2246
+ 95: Pe,
2247
+ 96: qn
2248
+ }, ti = {
2249
+ null: [Pe, Gr]
2250
+ }, ni = {
2251
+ null: [42, 95]
2252
+ }, ri = {
2253
+ null: []
2254
+ }, ii = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2255
+ __proto__: null,
2256
+ attentionMarkers: ni,
2257
+ contentInitial: Jr,
2258
+ disable: ri,
2259
+ document: $r,
2260
+ flow: Xr,
2261
+ flowInitial: Yr,
2262
+ insideSpan: ti,
2263
+ string: Kr,
2264
+ text: ei
2265
+ }, Symbol.toStringTag, { value: "Module" }));
2266
+ function si(e) {
2267
+ const t = (
2268
+ /** @type {FullNormalizedExtension} */
2269
+ dn([ii, ...(e || {}).extensions || []])
2270
+ ), r = {
2271
+ defined: [],
2272
+ lazy: {},
2273
+ constructs: t,
2274
+ content: i(kn),
2275
+ document: i(Sn),
2276
+ flow: i(jr),
2277
+ string: i(Ur),
2278
+ text: i(Hr)
2279
+ };
2280
+ return r;
2281
+ function i(s) {
2282
+ return o;
2283
+ function o(a) {
2284
+ return Wr(r, s, a);
2285
+ }
2286
+ }
2287
+ }
2288
+ function oi(e) {
2289
+ for (; !zt(e); )
2290
+ ;
2291
+ return e;
2292
+ }
2293
+ const ht = /[\0\t\n\r]/g;
2294
+ function ai() {
2295
+ let e = 1, n = "", t = !0, r;
2296
+ return i;
2297
+ function i(s, o, a) {
2298
+ const p = [];
2299
+ let h, m, d, g, c;
2300
+ for (s = n + (typeof s == "string" ? s.toString() : new TextDecoder(o || void 0).decode(s)), d = 0, n = "", t && (s.charCodeAt(0) === 65279 && d++, t = void 0); d < s.length; ) {
2301
+ if (ht.lastIndex = d, h = ht.exec(s), g = h && h.index !== void 0 ? h.index : s.length, c = s.charCodeAt(g), !h) {
2302
+ n = s.slice(d);
2303
+ break;
2304
+ }
2305
+ if (c === 10 && d === g && r)
2306
+ p.push(-3), r = void 0;
2307
+ else
2308
+ switch (r && (p.push(-5), r = void 0), d < g && (p.push(s.slice(d, g)), e += g - d), c) {
2309
+ case 0: {
2310
+ p.push(65533), e++;
2311
+ break;
2312
+ }
2313
+ case 9: {
2314
+ for (m = Math.ceil(e / 4) * 4, p.push(-2); e++ < m; )
2315
+ p.push(-1);
2316
+ break;
2317
+ }
2318
+ case 10: {
2319
+ p.push(-4), e = 1;
2320
+ break;
2321
+ }
2322
+ default:
2323
+ r = !0, e = 1;
2324
+ }
2325
+ d = g + 1;
2326
+ }
2327
+ return a && (r && p.push(-5), n && p.push(n), p.push(null)), p;
2328
+ }
2329
+ }
2330
+ const li = /\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;
2331
+ function ui(e) {
2332
+ return e.replace(li, hi);
2333
+ }
2334
+ function hi(e, n, t) {
2335
+ if (n)
2336
+ return n;
2337
+ if (t.charCodeAt(0) === 35) {
2338
+ const i = t.charCodeAt(1), s = i === 120 || i === 88;
2339
+ return It(t.slice(s ? 2 : 1), s ? 16 : 10);
2340
+ }
2341
+ return Ve(t) || e;
2342
+ }
2343
+ function ze(e) {
2344
+ return !e || typeof e != "object" ? "" : "position" in e || "type" in e ? ct(e.position) : "start" in e || "end" in e ? ct(e) : "line" in e || "column" in e ? je(e) : "";
2345
+ }
2346
+ function je(e) {
2347
+ return pt(e && e.line) + ":" + pt(e && e.column);
2348
+ }
2349
+ function ct(e) {
2350
+ return je(e && e.start) + "-" + je(e && e.end);
2351
+ }
2352
+ function pt(e) {
2353
+ return e && typeof e == "number" ? e : 1;
2354
+ }
2355
+ const Rt = {}.hasOwnProperty;
2356
+ function ci(e, n, t) {
2357
+ return typeof n != "string" && (t = n, n = void 0), pi(t)(
2358
+ oi(
2359
+ si(t).document().write(ai()(e, n, !0))
2360
+ )
2361
+ );
2362
+ }
2363
+ function pi(e) {
2364
+ const n = {
2365
+ transforms: [],
2366
+ canContainEols: ["emphasis", "fragment", "heading", "paragraph", "strong"],
2367
+ enter: {
2368
+ autolink: s(Ye),
2369
+ autolinkProtocol: F,
2370
+ autolinkEmail: F,
2371
+ atxHeading: s(Ze),
2372
+ blockQuote: s(ye),
2373
+ characterEscape: F,
2374
+ characterReference: F,
2375
+ codeFenced: s(we),
2376
+ codeFencedFenceInfo: o,
2377
+ codeFencedFenceMeta: o,
2378
+ codeIndented: s(we, o),
2379
+ codeText: s(Te, o),
2380
+ codeTextData: F,
2381
+ data: F,
2382
+ codeFlowValue: F,
2383
+ definition: s(jt),
2384
+ definitionDestinationString: o,
2385
+ definitionLabelString: o,
2386
+ definitionTitleString: o,
2387
+ emphasis: s(qt),
2388
+ hardBreakEscape: s($e),
2389
+ hardBreakTrailing: s($e),
2390
+ htmlFlow: s(Je, o),
2391
+ htmlFlowData: F,
2392
+ htmlText: s(Je, o),
2393
+ htmlTextData: F,
2394
+ image: s(Gt),
2395
+ label: o,
2396
+ link: s(Ye),
2397
+ listItem: s(Ut),
2398
+ listItemValue: g,
2399
+ listOrdered: s(Xe, d),
2400
+ listUnordered: s(Xe),
2401
+ paragraph: s(Ht),
2402
+ reference: u,
2403
+ referenceString: o,
2404
+ resourceDestinationString: o,
2405
+ resourceTitleString: o,
2406
+ setextHeading: s(Ze),
2407
+ strong: s(Vt),
2408
+ thematicBreak: s(Qt)
2409
+ },
2410
+ exit: {
2411
+ atxHeading: p(),
2412
+ atxHeadingSequence: D,
2413
+ autolink: p(),
2414
+ autolinkEmail: de,
2415
+ autolinkProtocol: Ee,
2416
+ blockQuote: p(),
2417
+ characterEscapeValue: f,
2418
+ characterReferenceMarkerHexadecimal: fe,
2419
+ characterReferenceMarkerNumeric: fe,
2420
+ characterReferenceValue: W,
2421
+ codeFenced: p(j),
2422
+ codeFencedFence: T,
2423
+ codeFencedFenceInfo: c,
2424
+ codeFencedFenceMeta: k,
2425
+ codeFlowValue: f,
2426
+ codeIndented: p(y),
2427
+ codeText: p(B),
2428
+ codeTextData: f,
2429
+ data: f,
2430
+ definition: p(),
2431
+ definitionDestinationString: N,
2432
+ definitionLabelString: G,
2433
+ definitionTitleString: C,
2434
+ emphasis: p(),
2435
+ hardBreakEscape: p(E),
2436
+ hardBreakTrailing: p(E),
2437
+ htmlFlow: p(P),
2438
+ htmlFlowData: f,
2439
+ htmlText: p(H),
2440
+ htmlTextData: f,
2441
+ image: p(V),
2442
+ label: le,
2443
+ labelText: ee,
2444
+ lineEnding: S,
2445
+ link: p(Q),
2446
+ listItem: p(),
2447
+ listOrdered: p(),
2448
+ listUnordered: p(),
2449
+ paragraph: p(),
2450
+ referenceString: ne,
2451
+ resourceDestinationString: l,
2452
+ resourceTitleString: te,
2453
+ resource: ue,
2454
+ setextHeading: p(U),
2455
+ setextHeadingLineSequence: z,
2456
+ setextHeadingText: b,
2457
+ strong: p(),
2458
+ thematicBreak: p()
2459
+ }
2460
+ };
2461
+ Nt(n, (e || {}).mdastExtensions || []);
2462
+ const t = {};
2463
+ return r;
2464
+ function r(w) {
2465
+ let x = {
2466
+ type: "root",
2467
+ children: []
2468
+ };
2469
+ const v = {
2470
+ stack: [x],
2471
+ tokenStack: [],
2472
+ config: n,
2473
+ enter: a,
2474
+ exit: h,
2475
+ buffer: o,
2476
+ resume: m,
2477
+ data: t
2478
+ }, L = [];
2479
+ let O = -1;
2480
+ for (; ++O < w.length; )
2481
+ if (w[O][1].type === "listOrdered" || w[O][1].type === "listUnordered")
2482
+ if (w[O][0] === "enter")
2483
+ L.push(O);
2484
+ else {
2485
+ const re = L.pop();
2486
+ O = i(w, re, O);
2487
+ }
2488
+ for (O = -1; ++O < w.length; ) {
2489
+ const re = n[w[O][0]];
2490
+ Rt.call(re, w[O][1].type) && re[w[O][1].type].call(
2491
+ Object.assign(
2492
+ {
2493
+ sliceSerialize: w[O][2].sliceSerialize
2494
+ },
2495
+ v
2496
+ ),
2497
+ w[O][1]
2498
+ );
2499
+ }
2500
+ if (v.tokenStack.length > 0) {
2501
+ const re = v.tokenStack[v.tokenStack.length - 1];
2502
+ (re[1] || dt).call(v, void 0, re[0]);
2503
+ }
2504
+ for (x.position = {
2505
+ start: me(
2506
+ w.length > 0 ? w[0][1].start : {
2507
+ line: 1,
2508
+ column: 1,
2509
+ offset: 0
2510
+ }
2511
+ ),
2512
+ end: me(
2513
+ w.length > 0 ? w[w.length - 2][1].end : {
2514
+ line: 1,
2515
+ column: 1,
2516
+ offset: 0
2517
+ }
2518
+ )
2519
+ }, O = -1; ++O < n.transforms.length; )
2520
+ x = n.transforms[O](x) || x;
2521
+ return x;
2522
+ }
2523
+ function i(w, x, v) {
2524
+ let L = x - 1, O = -1, re = !1, be, he, Ae, Ie;
2525
+ for (; ++L <= v; ) {
2526
+ const Y = w[L];
2527
+ switch (Y[1].type) {
2528
+ case "listUnordered":
2529
+ case "listOrdered":
2530
+ case "blockQuote": {
2531
+ Y[0] === "enter" ? O++ : O--, Ie = void 0;
2532
+ break;
2533
+ }
2534
+ case "lineEndingBlank": {
2535
+ Y[0] === "enter" && (be && !Ie && !O && !Ae && (Ae = L), Ie = void 0);
2536
+ break;
2537
+ }
2538
+ case "linePrefix":
2539
+ case "listItemValue":
2540
+ case "listItemMarker":
2541
+ case "listItemPrefix":
2542
+ case "listItemPrefixWhitespace":
2543
+ break;
2544
+ default:
2545
+ Ie = void 0;
2546
+ }
2547
+ if (!O && Y[0] === "enter" && Y[1].type === "listItemPrefix" || O === -1 && Y[0] === "exit" && (Y[1].type === "listUnordered" || Y[1].type === "listOrdered")) {
2548
+ if (be) {
2549
+ let ke = L;
2550
+ for (he = void 0; ke--; ) {
2551
+ const ce = w[ke];
2552
+ if (ce[1].type === "lineEnding" || ce[1].type === "lineEndingBlank") {
2553
+ if (ce[0] === "exit")
2554
+ continue;
2555
+ he && (w[he][1].type = "lineEndingBlank", re = !0), ce[1].type = "lineEnding", he = ke;
2556
+ } else if (!(ce[1].type === "linePrefix" || ce[1].type === "blockQuotePrefix" || ce[1].type === "blockQuotePrefixWhitespace" || ce[1].type === "blockQuoteMarker" || ce[1].type === "listItemIndent"))
2557
+ break;
2558
+ }
2559
+ Ae && (!he || Ae < he) && (be._spread = !0), be.end = Object.assign(
2560
+ {},
2561
+ he ? w[he][1].start : Y[1].end
2562
+ ), w.splice(he || L, 0, ["exit", be, Y[2]]), L++, v++;
2563
+ }
2564
+ if (Y[1].type === "listItemPrefix") {
2565
+ const ke = {
2566
+ type: "listItem",
2567
+ _spread: !1,
2568
+ start: Object.assign({}, Y[1].start),
2569
+ // @ts-expect-error: we’ll add `end` in a second.
2570
+ end: void 0
2571
+ };
2572
+ be = ke, w.splice(L, 0, ["enter", ke, Y[2]]), L++, v++, Ae = void 0, Ie = !0;
2573
+ }
2574
+ }
2575
+ }
2576
+ return w[x][1]._spread = re, v;
2577
+ }
2578
+ function s(w, x) {
2579
+ return v;
2580
+ function v(L) {
2581
+ a.call(this, w(L), L), x && x.call(this, L);
2582
+ }
2583
+ }
2584
+ function o() {
2585
+ this.stack.push({
2586
+ type: "fragment",
2587
+ children: []
2588
+ });
2589
+ }
2590
+ function a(w, x, v) {
2591
+ this.stack[this.stack.length - 1].children.push(w), this.stack.push(w), this.tokenStack.push([x, v]), w.position = {
2592
+ start: me(x.start),
2593
+ // @ts-expect-error: `end` will be patched later.
2594
+ end: void 0
2595
+ };
2596
+ }
2597
+ function p(w) {
2598
+ return x;
2599
+ function x(v) {
2600
+ w && w.call(this, v), h.call(this, v);
2601
+ }
2602
+ }
2603
+ function h(w, x) {
2604
+ const v = this.stack.pop(), L = this.tokenStack.pop();
2605
+ if (L)
2606
+ L[0].type !== w.type && (x ? x.call(this, w, L[0]) : (L[1] || dt).call(this, w, L[0]));
2607
+ else
2608
+ throw new Error(
2609
+ "Cannot close `" + w.type + "` (" + ze({
2610
+ start: w.start,
2611
+ end: w.end
2612
+ }) + "): it’s not open"
2613
+ );
2614
+ v.position.end = me(w.end);
2615
+ }
2616
+ function m() {
2617
+ return cn(this.stack.pop());
2618
+ }
2619
+ function d() {
2620
+ this.data.expectingFirstListItemValue = !0;
2621
+ }
2622
+ function g(w) {
2623
+ if (this.data.expectingFirstListItemValue) {
2624
+ const x = this.stack[this.stack.length - 2];
2625
+ x.start = Number.parseInt(this.sliceSerialize(w), 10), this.data.expectingFirstListItemValue = void 0;
2626
+ }
2627
+ }
2628
+ function c() {
2629
+ const w = this.resume(), x = this.stack[this.stack.length - 1];
2630
+ x.lang = w;
2631
+ }
2632
+ function k() {
2633
+ const w = this.resume(), x = this.stack[this.stack.length - 1];
2634
+ x.meta = w;
2635
+ }
2636
+ function T() {
2637
+ this.data.flowCodeInside || (this.buffer(), this.data.flowCodeInside = !0);
2638
+ }
2639
+ function j() {
2640
+ const w = this.resume(), x = this.stack[this.stack.length - 1];
2641
+ x.value = w.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g, ""), this.data.flowCodeInside = void 0;
2642
+ }
2643
+ function y() {
2644
+ const w = this.resume(), x = this.stack[this.stack.length - 1];
2645
+ x.value = w.replace(/(\r?\n|\r)$/g, "");
2646
+ }
2647
+ function G(w) {
2648
+ const x = this.resume(), v = this.stack[this.stack.length - 1];
2649
+ v.label = x, v.identifier = Se(
2650
+ this.sliceSerialize(w)
2651
+ ).toLowerCase();
2652
+ }
2653
+ function C() {
2654
+ const w = this.resume(), x = this.stack[this.stack.length - 1];
2655
+ x.title = w;
2656
+ }
2657
+ function N() {
2658
+ const w = this.resume(), x = this.stack[this.stack.length - 1];
2659
+ x.url = w;
2660
+ }
2661
+ function D(w) {
2662
+ const x = this.stack[this.stack.length - 1];
2663
+ if (!x.depth) {
2664
+ const v = this.sliceSerialize(w).length;
2665
+ x.depth = v;
2666
+ }
2667
+ }
2668
+ function b() {
2669
+ this.data.setextHeadingSlurpLineEnding = !0;
2670
+ }
2671
+ function z(w) {
2672
+ const x = this.stack[this.stack.length - 1];
2673
+ x.depth = this.sliceSerialize(w).codePointAt(0) === 61 ? 1 : 2;
2674
+ }
2675
+ function U() {
2676
+ this.data.setextHeadingSlurpLineEnding = void 0;
2677
+ }
2678
+ function F(w) {
2679
+ const v = this.stack[this.stack.length - 1].children;
2680
+ let L = v[v.length - 1];
2681
+ (!L || L.type !== "text") && (L = Wt(), L.position = {
2682
+ start: me(w.start),
2683
+ // @ts-expect-error: we’ll add `end` later.
2684
+ end: void 0
2685
+ }, v.push(L)), this.stack.push(L);
2686
+ }
2687
+ function f(w) {
2688
+ const x = this.stack.pop();
2689
+ x.value += this.sliceSerialize(w), x.position.end = me(w.end);
2690
+ }
2691
+ function S(w) {
2692
+ const x = this.stack[this.stack.length - 1];
2693
+ if (this.data.atHardBreak) {
2694
+ const v = x.children[x.children.length - 1];
2695
+ v.position.end = me(w.end), this.data.atHardBreak = void 0;
2696
+ return;
2697
+ }
2698
+ !this.data.setextHeadingSlurpLineEnding && n.canContainEols.includes(x.type) && (F.call(this, w), f.call(this, w));
2699
+ }
2700
+ function E() {
2701
+ this.data.atHardBreak = !0;
2702
+ }
2703
+ function P() {
2704
+ const w = this.resume(), x = this.stack[this.stack.length - 1];
2705
+ x.value = w;
2706
+ }
2707
+ function H() {
2708
+ const w = this.resume(), x = this.stack[this.stack.length - 1];
2709
+ x.value = w;
2710
+ }
2711
+ function B() {
2712
+ const w = this.resume(), x = this.stack[this.stack.length - 1];
2713
+ x.value = w;
2714
+ }
2715
+ function Q() {
2716
+ const w = this.stack[this.stack.length - 1];
2717
+ if (this.data.inReference) {
2718
+ const x = this.data.referenceType || "shortcut";
2719
+ w.type += "Reference", w.referenceType = x, delete w.url, delete w.title;
2720
+ } else
2721
+ delete w.identifier, delete w.label;
2722
+ this.data.referenceType = void 0;
2723
+ }
2724
+ function V() {
2725
+ const w = this.stack[this.stack.length - 1];
2726
+ if (this.data.inReference) {
2727
+ const x = this.data.referenceType || "shortcut";
2728
+ w.type += "Reference", w.referenceType = x, delete w.url, delete w.title;
2729
+ } else
2730
+ delete w.identifier, delete w.label;
2731
+ this.data.referenceType = void 0;
2732
+ }
2733
+ function ee(w) {
2734
+ const x = this.sliceSerialize(w), v = this.stack[this.stack.length - 2];
2735
+ v.label = ui(x), v.identifier = Se(x).toLowerCase();
2736
+ }
2737
+ function le() {
2738
+ const w = this.stack[this.stack.length - 1], x = this.resume(), v = this.stack[this.stack.length - 1];
2739
+ if (this.data.inReference = !0, v.type === "link") {
2740
+ const L = w.children;
2741
+ v.children = L;
2742
+ } else
2743
+ v.alt = x;
2744
+ }
2745
+ function l() {
2746
+ const w = this.resume(), x = this.stack[this.stack.length - 1];
2747
+ x.url = w;
2748
+ }
2749
+ function te() {
2750
+ const w = this.resume(), x = this.stack[this.stack.length - 1];
2751
+ x.title = w;
2752
+ }
2753
+ function ue() {
2754
+ this.data.inReference = void 0;
2755
+ }
2756
+ function u() {
2757
+ this.data.referenceType = "collapsed";
2758
+ }
2759
+ function ne(w) {
2760
+ const x = this.resume(), v = this.stack[this.stack.length - 1];
2761
+ v.label = x, v.identifier = Se(
2762
+ this.sliceSerialize(w)
2763
+ ).toLowerCase(), this.data.referenceType = "full";
2764
+ }
2765
+ function fe(w) {
2766
+ this.data.characterReferenceType = w.type;
2767
+ }
2768
+ function W(w) {
2769
+ const x = this.sliceSerialize(w), v = this.data.characterReferenceType;
2770
+ let L;
2771
+ v ? (L = It(
2772
+ x,
2773
+ v === "characterReferenceMarkerNumeric" ? 10 : 16
2774
+ ), this.data.characterReferenceType = void 0) : L = Ve(x);
2775
+ const O = this.stack.pop();
2776
+ O.value += L, O.position.end = me(w.end);
2777
+ }
2778
+ function Ee(w) {
2779
+ f.call(this, w);
2780
+ const x = this.stack[this.stack.length - 1];
2781
+ x.url = this.sliceSerialize(w);
2782
+ }
2783
+ function de(w) {
2784
+ f.call(this, w);
2785
+ const x = this.stack[this.stack.length - 1];
2786
+ x.url = "mailto:" + this.sliceSerialize(w);
2787
+ }
2788
+ function ye() {
2789
+ return {
2790
+ type: "blockquote",
2791
+ children: []
2792
+ };
2793
+ }
2794
+ function we() {
2795
+ return {
2796
+ type: "code",
2797
+ lang: null,
2798
+ meta: null,
2799
+ value: ""
2800
+ };
2801
+ }
2802
+ function Te() {
2803
+ return {
2804
+ type: "inlineCode",
2805
+ value: ""
2806
+ };
2807
+ }
2808
+ function jt() {
2809
+ return {
2810
+ type: "definition",
2811
+ identifier: "",
2812
+ label: null,
2813
+ title: null,
2814
+ url: ""
2815
+ };
2816
+ }
2817
+ function qt() {
2818
+ return {
2819
+ type: "emphasis",
2820
+ children: []
2821
+ };
2822
+ }
2823
+ function Ze() {
2824
+ return {
2825
+ type: "heading",
2826
+ // @ts-expect-error `depth` will be set later.
2827
+ depth: 0,
2828
+ children: []
2829
+ };
2830
+ }
2831
+ function $e() {
2832
+ return {
2833
+ type: "break"
2834
+ };
2835
+ }
2836
+ function Je() {
2837
+ return {
2838
+ type: "html",
2839
+ value: ""
2840
+ };
2841
+ }
2842
+ function Gt() {
2843
+ return {
2844
+ type: "image",
2845
+ title: null,
2846
+ url: "",
2847
+ alt: null
2848
+ };
2849
+ }
2850
+ function Ye() {
2851
+ return {
2852
+ type: "link",
2853
+ title: null,
2854
+ url: "",
2855
+ children: []
2856
+ };
2857
+ }
2858
+ function Xe(w) {
2859
+ return {
2860
+ type: "list",
2861
+ ordered: w.type === "listOrdered",
2862
+ start: null,
2863
+ spread: w._spread,
2864
+ children: []
2865
+ };
2866
+ }
2867
+ function Ut(w) {
2868
+ return {
2869
+ type: "listItem",
2870
+ spread: w._spread,
2871
+ checked: null,
2872
+ children: []
2873
+ };
2874
+ }
2875
+ function Ht() {
2876
+ return {
2877
+ type: "paragraph",
2878
+ children: []
2879
+ };
2880
+ }
2881
+ function Vt() {
2882
+ return {
2883
+ type: "strong",
2884
+ children: []
2885
+ };
2886
+ }
2887
+ function Wt() {
2888
+ return {
2889
+ type: "text",
2890
+ value: ""
2891
+ };
2892
+ }
2893
+ function Qt() {
2894
+ return {
2895
+ type: "thematicBreak"
2896
+ };
2897
+ }
2898
+ }
2899
+ function me(e) {
2900
+ return {
2901
+ line: e.line,
2902
+ column: e.column,
2903
+ offset: e.offset
2904
+ };
2905
+ }
2906
+ function Nt(e, n) {
2907
+ let t = -1;
2908
+ for (; ++t < n.length; ) {
2909
+ const r = n[t];
2910
+ Array.isArray(r) ? Nt(e, r) : di(e, r);
2911
+ }
2912
+ }
2913
+ function di(e, n) {
2914
+ let t;
2915
+ for (t in n)
2916
+ if (Rt.call(n, t))
2917
+ switch (t) {
2918
+ case "canContainEols": {
2919
+ const r = n[t];
2920
+ r && e[t].push(...r);
2921
+ break;
2922
+ }
2923
+ case "transforms": {
2924
+ const r = n[t];
2925
+ r && e[t].push(...r);
2926
+ break;
2927
+ }
2928
+ case "enter":
2929
+ case "exit": {
2930
+ const r = n[t];
2931
+ r && Object.assign(e[t], r);
2932
+ break;
2933
+ }
2934
+ }
2935
+ }
2936
+ function dt(e, n) {
2937
+ throw e ? new Error(
2938
+ "Cannot close `" + e.type + "` (" + ze({
2939
+ start: e.start,
2940
+ end: e.end
2941
+ }) + "): a different token (`" + n.type + "`, " + ze({
2942
+ start: n.start,
2943
+ end: n.end
2944
+ }) + ") is open"
2945
+ ) : new Error(
2946
+ "Cannot close document, a token (`" + n.type + "`, " + ze({
2947
+ start: n.start,
2948
+ end: n.end
2949
+ }) + ") is still open"
2950
+ );
2951
+ }
2952
+ class mi {
2953
+ /**
2954
+ * Create a new edit map.
2955
+ */
2956
+ constructor() {
2957
+ this.map = [];
2958
+ }
2959
+ /**
2960
+ * Create an edit: a remove and/or add at a certain place.
2961
+ *
2962
+ * @param {number} index
2963
+ * @param {number} remove
2964
+ * @param {Array<Event>} add
2965
+ * @returns {undefined}
2966
+ */
2967
+ add(n, t, r) {
2968
+ gi(this, n, t, r);
2969
+ }
2970
+ // To do: add this when moving to `micromark`.
2971
+ // /**
2972
+ // * Create an edit: but insert `add` before existing additions.
2973
+ // *
2974
+ // * @param {number} index
2975
+ // * @param {number} remove
2976
+ // * @param {Array<Event>} add
2977
+ // * @returns {undefined}
2978
+ // */
2979
+ // addBefore(index, remove, add) {
2980
+ // addImpl(this, index, remove, add, true)
2981
+ // }
2982
+ /**
2983
+ * Done, change the events.
2984
+ *
2985
+ * @param {Array<Event>} events
2986
+ * @returns {undefined}
2987
+ */
2988
+ consume(n) {
2989
+ if (this.map.sort(function(s, o) {
2990
+ return s[0] - o[0];
2991
+ }), this.map.length === 0)
2992
+ return;
2993
+ let t = this.map.length;
2994
+ const r = [];
2995
+ for (; t > 0; )
2996
+ t -= 1, r.push(
2997
+ n.slice(this.map[t][0] + this.map[t][1]),
2998
+ this.map[t][2]
2999
+ ), n.length = this.map[t][0];
3000
+ r.push([...n]), n.length = 0;
3001
+ let i = r.pop();
3002
+ for (; i; )
3003
+ n.push(...i), i = r.pop();
3004
+ this.map.length = 0;
3005
+ }
3006
+ }
3007
+ function gi(e, n, t, r) {
3008
+ let i = 0;
3009
+ if (!(t === 0 && r.length === 0)) {
3010
+ for (; i < e.map.length; ) {
3011
+ if (e.map[i][0] === n) {
3012
+ e.map[i][1] += t, e.map[i][2].push(...r);
3013
+ return;
3014
+ }
3015
+ i += 1;
3016
+ }
3017
+ e.map.push([n, t, r]);
3018
+ }
3019
+ }
3020
+ function fi(e, n) {
3021
+ let t = !1;
3022
+ const r = [];
3023
+ for (; n < e.length; ) {
3024
+ const i = e[n];
3025
+ if (t) {
3026
+ if (i[0] === "enter")
3027
+ i[1].type === "tableContent" && r.push(
3028
+ e[n + 1][1].type === "tableDelimiterMarker" ? "left" : "none"
3029
+ );
3030
+ else if (i[1].type === "tableContent") {
3031
+ if (e[n - 1][1].type === "tableDelimiterMarker") {
3032
+ const s = r.length - 1;
3033
+ r[s] = r[s] === "left" ? "center" : "right";
3034
+ }
3035
+ } else if (i[1].type === "tableDelimiterRow")
3036
+ break;
3037
+ } else
3038
+ i[0] === "enter" && i[1].type === "tableDelimiterRow" && (t = !0);
3039
+ n += 1;
3040
+ }
3041
+ return r;
3042
+ }
3043
+ function wi() {
3044
+ return {
3045
+ flow: {
3046
+ null: {
3047
+ tokenize: bi,
3048
+ resolveAll: xi
3049
+ }
3050
+ }
3051
+ };
3052
+ }
3053
+ function bi(e, n, t) {
3054
+ const r = this;
3055
+ let i = 0, s = 0, o;
3056
+ return a;
3057
+ function a(f) {
3058
+ let S = r.events.length - 1;
3059
+ for (; S > -1; ) {
3060
+ const H = r.events[S][1].type;
3061
+ if (H === "lineEnding" || // Note: markdown-rs uses `whitespace` instead of `linePrefix`
3062
+ H === "linePrefix")
3063
+ S--;
3064
+ else
3065
+ break;
3066
+ }
3067
+ const E = S > -1 ? r.events[S][1].type : null, P = E === "tableHead" || E === "tableRow" ? b : p;
3068
+ return P === b && r.parser.lazy[r.now().line] ? t(f) : P(f);
3069
+ }
3070
+ function p(f) {
3071
+ return e.enter("tableHead"), e.enter("tableRow"), h(f);
3072
+ }
3073
+ function h(f) {
3074
+ return f === 124 || (o = !0, s += 1), m(f);
3075
+ }
3076
+ function m(f) {
3077
+ return f === null ? t(f) : A(f) ? s > 1 ? (s = 0, r.interrupt = !0, e.exit("tableRow"), e.enter("lineEnding"), e.consume(f), e.exit("lineEnding"), c) : t(f) : _(f) ? M(e, m, "whitespace")(f) : (s += 1, o && (o = !1, i += 1), f === 124 ? (e.enter("tableCellDivider"), e.consume(f), e.exit("tableCellDivider"), o = !0, m) : (e.enter("data"), d(f)));
3078
+ }
3079
+ function d(f) {
3080
+ return f === null || f === 124 || Z(f) ? (e.exit("data"), m(f)) : (e.consume(f), f === 92 ? g : d);
3081
+ }
3082
+ function g(f) {
3083
+ return f === 92 || f === 124 ? (e.consume(f), d) : d(f);
3084
+ }
3085
+ function c(f) {
3086
+ return r.interrupt = !1, r.parser.lazy[r.now().line] ? t(f) : (e.enter("tableDelimiterRow"), o = !1, _(f) ? M(
3087
+ e,
3088
+ k,
3089
+ "linePrefix",
3090
+ r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4
3091
+ )(f) : k(f));
3092
+ }
3093
+ function k(f) {
3094
+ return f === 45 || f === 58 ? j(f) : f === 124 ? (o = !0, e.enter("tableCellDivider"), e.consume(f), e.exit("tableCellDivider"), T) : D(f);
3095
+ }
3096
+ function T(f) {
3097
+ return _(f) ? M(e, j, "whitespace")(f) : j(f);
3098
+ }
3099
+ function j(f) {
3100
+ return f === 58 ? (s += 1, o = !0, e.enter("tableDelimiterMarker"), e.consume(f), e.exit("tableDelimiterMarker"), y) : f === 45 ? (s += 1, y(f)) : f === null || A(f) ? N(f) : D(f);
3101
+ }
3102
+ function y(f) {
3103
+ return f === 45 ? (e.enter("tableDelimiterFiller"), G(f)) : D(f);
3104
+ }
3105
+ function G(f) {
3106
+ return f === 45 ? (e.consume(f), G) : f === 58 ? (o = !0, e.exit("tableDelimiterFiller"), e.enter("tableDelimiterMarker"), e.consume(f), e.exit("tableDelimiterMarker"), C) : (e.exit("tableDelimiterFiller"), C(f));
3107
+ }
3108
+ function C(f) {
3109
+ return _(f) ? M(e, N, "whitespace")(f) : N(f);
3110
+ }
3111
+ function N(f) {
3112
+ return f === 124 ? k(f) : f === null || A(f) ? !o || i !== s ? D(f) : (e.exit("tableDelimiterRow"), e.exit("tableHead"), n(f)) : D(f);
3113
+ }
3114
+ function D(f) {
3115
+ return t(f);
3116
+ }
3117
+ function b(f) {
3118
+ return e.enter("tableRow"), z(f);
3119
+ }
3120
+ function z(f) {
3121
+ return f === 124 ? (e.enter("tableCellDivider"), e.consume(f), e.exit("tableCellDivider"), z) : f === null || A(f) ? (e.exit("tableRow"), n(f)) : _(f) ? M(e, z, "whitespace")(f) : (e.enter("data"), U(f));
3122
+ }
3123
+ function U(f) {
3124
+ return f === null || f === 124 || Z(f) ? (e.exit("data"), z(f)) : (e.consume(f), f === 92 ? F : U);
3125
+ }
3126
+ function F(f) {
3127
+ return f === 92 || f === 124 ? (e.consume(f), U) : U(f);
3128
+ }
3129
+ }
3130
+ function xi(e, n) {
3131
+ let t = -1, r = !0, i = 0, s = [0, 0, 0, 0], o = [0, 0, 0, 0], a = !1, p = 0, h, m, d;
3132
+ const g = new mi();
3133
+ for (; ++t < e.length; ) {
3134
+ const c = e[t], k = c[1];
3135
+ c[0] === "enter" ? k.type === "tableHead" ? (a = !1, p !== 0 && (mt(g, n, p, h, m), m = void 0, p = 0), h = {
3136
+ type: "table",
3137
+ start: Object.assign({}, k.start),
3138
+ // Note: correct end is set later.
3139
+ end: Object.assign({}, k.end)
3140
+ }, g.add(t, 0, [["enter", h, n]])) : k.type === "tableRow" || k.type === "tableDelimiterRow" ? (r = !0, d = void 0, s = [0, 0, 0, 0], o = [0, t + 1, 0, 0], a && (a = !1, m = {
3141
+ type: "tableBody",
3142
+ start: Object.assign({}, k.start),
3143
+ // Note: correct end is set later.
3144
+ end: Object.assign({}, k.end)
3145
+ }, g.add(t, 0, [["enter", m, n]])), i = k.type === "tableDelimiterRow" ? 2 : m ? 3 : 1) : i && (k.type === "data" || k.type === "tableDelimiterMarker" || k.type === "tableDelimiterFiller") ? (r = !1, o[2] === 0 && (s[1] !== 0 && (o[0] = o[1], d = _e(
3146
+ g,
3147
+ n,
3148
+ s,
3149
+ i,
3150
+ void 0,
3151
+ d
3152
+ ), s = [0, 0, 0, 0]), o[2] = t)) : k.type === "tableCellDivider" && (r ? r = !1 : (s[1] !== 0 && (o[0] = o[1], d = _e(
3153
+ g,
3154
+ n,
3155
+ s,
3156
+ i,
3157
+ void 0,
3158
+ d
3159
+ )), s = o, o = [s[1], t, 0, 0])) : k.type === "tableHead" ? (a = !0, p = t) : k.type === "tableRow" || k.type === "tableDelimiterRow" ? (p = t, s[1] !== 0 ? (o[0] = o[1], d = _e(
3160
+ g,
3161
+ n,
3162
+ s,
3163
+ i,
3164
+ t,
3165
+ d
3166
+ )) : o[1] !== 0 && (d = _e(g, n, o, i, t, d)), i = 0) : i && (k.type === "data" || k.type === "tableDelimiterMarker" || k.type === "tableDelimiterFiller") && (o[3] = t);
3167
+ }
3168
+ for (p !== 0 && mt(g, n, p, h, m), g.consume(n.events), t = -1; ++t < n.events.length; ) {
3169
+ const c = n.events[t];
3170
+ c[0] === "enter" && c[1].type === "table" && (c[1]._align = fi(n.events, t));
3171
+ }
3172
+ return e;
3173
+ }
3174
+ function _e(e, n, t, r, i, s) {
3175
+ const o = r === 1 ? "tableHeader" : r === 2 ? "tableDelimiter" : "tableData", a = "tableContent";
3176
+ t[0] !== 0 && (s.end = Object.assign({}, Ce(n.events, t[0])), e.add(t[0], 0, [["exit", s, n]]));
3177
+ const p = Ce(n.events, t[1]);
3178
+ if (s = {
3179
+ type: o,
3180
+ start: Object.assign({}, p),
3181
+ // Note: correct end is set later.
3182
+ end: Object.assign({}, p)
3183
+ }, e.add(t[1], 0, [["enter", s, n]]), t[2] !== 0) {
3184
+ const h = Ce(n.events, t[2]), m = Ce(n.events, t[3]), d = {
3185
+ type: a,
3186
+ start: Object.assign({}, h),
3187
+ end: Object.assign({}, m)
3188
+ };
3189
+ if (e.add(t[2], 0, [["enter", d, n]]), r !== 2) {
3190
+ const g = n.events[t[2]], c = n.events[t[3]];
3191
+ if (g[1].end = Object.assign({}, c[1].end), g[1].type = "chunkText", g[1].contentType = "text", t[3] > t[2] + 1) {
3192
+ const k = t[2] + 1, T = t[3] - t[2] - 1;
3193
+ e.add(k, T, []);
3194
+ }
3195
+ }
3196
+ e.add(t[3] + 1, 0, [["exit", d, n]]);
3197
+ }
3198
+ return i !== void 0 && (s.end = Object.assign({}, Ce(n.events, i)), e.add(i, 0, [["exit", s, n]]), s = void 0), s;
3199
+ }
3200
+ function mt(e, n, t, r, i) {
3201
+ const s = [], o = Ce(n.events, t);
3202
+ i && (i.end = Object.assign({}, o), s.push(["exit", i, n])), r.end = Object.assign({}, o), s.push(["exit", r, n]), e.add(t + 1, 0, s);
3203
+ }
3204
+ function Ce(e, n) {
3205
+ const t = e[n], r = t[0] === "enter" ? "start" : "end";
3206
+ return t[1][r];
3207
+ }
3208
+ function yi() {
3209
+ return {
3210
+ enter: {
3211
+ table: ki,
3212
+ tableData: gt,
3213
+ tableHeader: gt,
3214
+ tableRow: Si
3215
+ },
3216
+ exit: {
3217
+ codeText: Ei,
3218
+ table: Ci,
3219
+ tableData: Fe,
3220
+ tableHeader: Fe,
3221
+ tableRow: Fe
3222
+ }
3223
+ };
3224
+ }
3225
+ function ki(e) {
3226
+ const n = e._align;
3227
+ this.enter(
3228
+ {
3229
+ type: "table",
3230
+ align: n.map(function(t) {
3231
+ return t === "none" ? null : t;
3232
+ }),
3233
+ children: []
3234
+ },
3235
+ e
3236
+ ), this.data.inTable = !0;
3237
+ }
3238
+ function Ci(e) {
3239
+ this.exit(e), this.data.inTable = void 0;
3240
+ }
3241
+ function Si(e) {
3242
+ this.enter({ type: "tableRow", children: [] }, e);
3243
+ }
3244
+ function Fe(e) {
3245
+ this.exit(e);
3246
+ }
3247
+ function gt(e) {
3248
+ this.enter({ type: "tableCell", children: [] }, e);
3249
+ }
3250
+ function Ei(e) {
3251
+ let n = this.resume();
3252
+ this.data.inTable && (n = n.replace(/\\([\\|])/g, Ai));
3253
+ const t = this.stack[this.stack.length - 1];
3254
+ t.type, t.value = n, this.exit(e);
3255
+ }
3256
+ function Ai(e, n) {
3257
+ return n === "|" ? n : e;
3258
+ }
3259
+ class Ii extends Error {
3260
+ constructor(n = "Operation was cancelled.") {
3261
+ super(n);
3262
+ }
3263
+ }
3264
+ class ft {
3265
+ constructor() {
3266
+ I(this, "isCancellationRequested");
3267
+ I(this, "listeners", /* @__PURE__ */ new Set());
3268
+ }
3269
+ addListener(n) {
3270
+ this.isCancellationRequested ? n() : this.listeners.add(n);
3271
+ }
3272
+ cancel() {
3273
+ if (!this.isCancellationRequested) {
3274
+ this.isCancellationRequested = !0;
3275
+ for (var n of this.listeners)
3276
+ n();
3277
+ this.listeners = null;
3278
+ }
3279
+ }
3280
+ removeListener(n) {
3281
+ this.listeners.delete(n);
3282
+ }
3283
+ throwIfCancellationRequested() {
3284
+ if (this.isCancellationRequested)
3285
+ throw new Ii();
3286
+ }
3287
+ }
3288
+ class vi {
3289
+ constructor(n, t) {
3290
+ I(this, "node");
3291
+ I(this, "codeNode");
3292
+ I(this, "language");
3293
+ I(this, "code");
3294
+ I(this, "_ct");
3295
+ this.node = /* @__PURE__ */ R("pre", null, this.codeNode = /* @__PURE__ */ R("code", null)), this.updateCodeAsync(n, t, this._ct = new ft());
3296
+ }
3297
+ async updateCodeAsync(n, t, r) {
3298
+ const i = Li(n);
3299
+ if (i) {
3300
+ if (await i.promise, r.isCancellationRequested)
3301
+ return;
3302
+ this.language = n, this.code = t, this.codeNode.innerHTML = pe.result.default.highlight(t, {
3303
+ language: n
3304
+ }).value;
3305
+ } else
3306
+ this.language = n, this.code = t, this.codeNode.textContent = t;
3307
+ }
3308
+ updateCode(n, t) {
3309
+ this._ct.cancel(), !(this.language === n && this.code === t) && this.updateCodeAsync(n, t, this._ct = new ft());
3310
+ }
3311
+ }
3312
+ let pe;
3313
+ function _i() {
3314
+ return pe || (pe = { promise: import("./core-Diwflo5W.js") }, pe.promise.then((e) => pe.result = e).catch((e) => pe.error = e), pe);
3315
+ }
3316
+ const wt = {};
3317
+ function Li(e) {
3318
+ let n = wt[e];
3319
+ if (n)
3320
+ return n;
3321
+ _i();
3322
+ let t;
3323
+ switch (e) {
3324
+ case "javascript":
3325
+ t = import("./javascript-CDslspYb.js");
3326
+ break;
3327
+ case "csharp":
3328
+ t = import("./csharp-Cigc7XMa.js");
3329
+ break;
3330
+ case "python":
3331
+ t = import("./python-CzH_tl5q.js");
3332
+ break;
3333
+ case "css":
3334
+ t = import("./css-B-yPI1XM.js");
3335
+ break;
3336
+ case "typescript":
3337
+ t = import("./typescript-Bx5cZccb.js");
3338
+ break;
3339
+ default:
3340
+ return null;
3341
+ }
3342
+ return n = {
3343
+ promise: (async () => {
3344
+ const r = await t;
3345
+ return (await pe.promise).default.registerLanguage(e, r.default), r.default;
3346
+ })()
3347
+ }, wt[e] = n, n.promise.then((r) => n.result = r).catch((r) => n.error = r), n;
3348
+ }
3349
+ function qe(e, n) {
3350
+ const t = ci(n, {
3351
+ extensions: [wi()],
3352
+ mdastExtensions: [yi()]
3353
+ }), r = {}, i = {};
3354
+ Ot(t, r, i), Ge(t, e, r, i);
3355
+ }
3356
+ function Ot(e, n, t) {
3357
+ for (const r of e.children) {
3358
+ switch (r.type) {
3359
+ case "definition":
3360
+ const i = r.identifier;
3361
+ i && (n[i] = r, t[i.toLowerCase()] = r);
3362
+ continue;
3363
+ }
3364
+ r.children && Ot(r, n, t);
3365
+ }
3366
+ }
3367
+ function Ge(e, n, t, r) {
3368
+ var s;
3369
+ let i = n.firstChild;
3370
+ for (const o of e.children) {
3371
+ let a;
3372
+ switch (o.type) {
3373
+ case "code":
3374
+ let p = bt.get(i);
3375
+ if (p)
3376
+ p.updateCode(o.lang, o.value);
3377
+ else {
3378
+ for (; i; ) {
3379
+ const m = i.nextSibling;
3380
+ i.remove(), i = m;
3381
+ }
3382
+ p = new vi(o.lang, o.value), i = p.node, bt.set(i, p), n.appendChild(i);
3383
+ }
3384
+ i = i.nextSibling;
3385
+ continue;
3386
+ case "html":
3387
+ if (!((i == null ? void 0 : i.nodeType) === Node.ELEMENT_NODE && i.nodeName === "SPAN")) {
3388
+ for (; i; ) {
3389
+ const m = i.nextSibling;
3390
+ i.remove(), i = m;
3391
+ }
3392
+ n.appendChild(i = document.createElement("span"));
3393
+ }
3394
+ i.innerHTML = o.value, i = i.nextSibling;
3395
+ continue;
3396
+ case "inlineCode":
3397
+ if (!((i == null ? void 0 : i.nodeType) === Node.ELEMENT_NODE && i.nodeName === "CODE")) {
3398
+ for (; i; ) {
3399
+ const m = i.nextSibling;
3400
+ i.remove(), i = m;
3401
+ }
3402
+ n.appendChild(i = document.createElement("code"));
3403
+ }
3404
+ i.textContent = o.value, i = i.nextSibling;
3405
+ continue;
3406
+ case "text":
3407
+ if ((i == null ? void 0 : i.nodeType) === Node.TEXT_NODE)
3408
+ i.nodeValue = o.value;
3409
+ else {
3410
+ for (; i; ) {
3411
+ const m = i.nextSibling;
3412
+ i.remove(), i = m;
3413
+ }
3414
+ n.appendChild(i = document.createTextNode(o.value));
3415
+ }
3416
+ i = i.nextSibling;
3417
+ continue;
3418
+ case "yaml":
3419
+ continue;
3420
+ case "break":
3421
+ if (!((i == null ? void 0 : i.nodeType) === Node.ELEMENT_NODE && i.nodeName === "BR")) {
3422
+ for (; i; ) {
3423
+ const m = i.nextSibling;
3424
+ i.remove(), i = m;
3425
+ }
3426
+ n.appendChild(i = document.createElement("br"));
3427
+ }
3428
+ i = i.nextSibling;
3429
+ continue;
3430
+ case "thematicBreak":
3431
+ if (!((i == null ? void 0 : i.nodeType) === Node.ELEMENT_NODE && i.nodeName === "HR")) {
3432
+ for (; i; ) {
3433
+ const m = i.nextSibling;
3434
+ i.remove(), i = m;
3435
+ }
3436
+ n.appendChild(i = document.createElement("hr"));
3437
+ }
3438
+ i = i.nextSibling;
3439
+ continue;
3440
+ case "image":
3441
+ if (!((i == null ? void 0 : i.nodeType) === Node.ELEMENT_NODE && i.nodeName === "IMG")) {
3442
+ for (; i; ) {
3443
+ const m = i.nextSibling;
3444
+ i.remove(), i = m;
3445
+ }
3446
+ n.appendChild(i = document.createElement("img"));
3447
+ }
3448
+ i.src = o.url || "", i.alt = o.alt || "", i.title = o.title || "", i = i.nextSibling;
3449
+ continue;
3450
+ case "linkReference":
3451
+ if (!((i == null ? void 0 : i.nodeType) === Node.ELEMENT_NODE && i.nodeName === "A")) {
3452
+ for (; i; ) {
3453
+ const m = i.nextSibling;
3454
+ i.remove(), i = m;
3455
+ }
3456
+ n.appendChild(i = document.createElement("a"));
3457
+ }
3458
+ Ge(
3459
+ o,
3460
+ i,
3461
+ t,
3462
+ r
3463
+ );
3464
+ let h;
3465
+ switch (o.referenceType) {
3466
+ case "shortcut":
3467
+ h = t[i.textContent.toLowerCase()];
3468
+ break;
3469
+ case "collapsed":
3470
+ h = r[i.textContent.toLowerCase()] || t[i.textContent.toLowerCase()];
3471
+ break;
3472
+ case "full":
3473
+ h = r[(s = o.identifier) == null ? void 0 : s.toLowerCase()];
3474
+ break;
3475
+ }
3476
+ i.href = (h == null ? void 0 : h.url) || "", i.target = "_blank", i.title = (h == null ? void 0 : h.title) || "", i = i.nextSibling;
3477
+ continue;
3478
+ case "definition":
3479
+ continue;
3480
+ case "footnoteDefinition":
3481
+ case "footnoteReference":
3482
+ case "imageReference":
3483
+ continue;
3484
+ case "blockquote":
3485
+ a = "BLOCKQUOTE";
3486
+ break;
3487
+ case "delete":
3488
+ a = "DEL";
3489
+ break;
3490
+ case "emphasis":
3491
+ a = "EM";
3492
+ break;
3493
+ case "heading":
3494
+ a = "H" + o.depth;
3495
+ break;
3496
+ case "link":
3497
+ a = "A";
3498
+ break;
3499
+ case "list":
3500
+ a = o.ordered ? "OL" : "UL";
3501
+ break;
3502
+ case "listItem":
3503
+ a = "LI";
3504
+ break;
3505
+ case "paragraph":
3506
+ a = "P";
3507
+ break;
3508
+ case "strong":
3509
+ a = "STRONG";
3510
+ break;
3511
+ case "table":
3512
+ a = "TABLE";
3513
+ break;
3514
+ case "tableCell":
3515
+ a = "TD";
3516
+ break;
3517
+ case "tableRow":
3518
+ a = "TR";
3519
+ break;
3520
+ default:
3521
+ console.warn("Unknown MDAST node type: " + o.type);
3522
+ continue;
3523
+ }
3524
+ if (!((i == null ? void 0 : i.nodeType) === Node.ELEMENT_NODE && i.nodeName === a)) {
3525
+ for (; i; ) {
3526
+ const p = i.nextSibling;
3527
+ i.remove(), i = p;
3528
+ }
3529
+ n.appendChild(i = document.createElement(a));
3530
+ }
3531
+ a === "A" && (i.href = o.url || "", i.target = "_blank", i.title = o.title || ""), Ge(
3532
+ o,
3533
+ i,
3534
+ t,
3535
+ r
3536
+ ), i = i.nextSibling;
3537
+ }
3538
+ for (; i; ) {
3539
+ const o = i.nextSibling;
3540
+ i.remove(), i = o;
3541
+ }
3542
+ }
3543
+ const bt = /* @__PURE__ */ new WeakMap();
3544
+ class zi {
3545
+ constructor(n) {
3546
+ I(this, "node");
3547
+ I(this, "messageNode");
3548
+ this.node = /* @__PURE__ */ R("div", { class: "shadow-md border border-Light rounded-lg" }, this.messageNode = /* @__PURE__ */ R("div", { class: "p-5" }, n));
3549
+ }
3550
+ updateMarkdown(n) {
3551
+ qe(this.messageNode, n);
3552
+ }
3553
+ }
3554
+ class Pt {
3555
+ constructor(n, t, r) {
3556
+ I(this, "node");
3557
+ I(this, "chat");
3558
+ I(this, "message");
3559
+ I(this, "bubble");
3560
+ this.chat = n, this.message = t, this.node = /* @__PURE__ */ R("li", { class: "relative" }, r, (this.bubble = new zi(t)).node);
3561
+ }
3562
+ }
3563
+ class Bi extends Pt {
3564
+ constructor(n, t, r, i) {
3565
+ super(
3566
+ n,
3567
+ t,
3568
+ /* @__PURE__ */ R(St, { class: "absolute top-0 left-[-3.25rem] shadow-md", id: r }, i)
3569
+ ), this.bubble.node.style.background = "hsla(207,100%,98%,1)";
3570
+ }
3571
+ toDto() {
3572
+ return {
3573
+ role: "user",
3574
+ content: this.message
3575
+ };
3576
+ }
3577
+ }
3578
+ class xt extends Pt {
3579
+ constructor(n, t, r) {
3580
+ super(n, t, r), this.bubble.node.classList.add("bg-White"), this.bubble.messageNode.classList.add("prose", "prose-sm", "prose-neutral", "prose-code:text-[1em]", "max-w-none");
3581
+ }
3582
+ updateMessage(n) {
3583
+ this.message = n, this.bubble.updateMarkdown(n);
3584
+ }
3585
+ toDto() {
3586
+ return {
3587
+ role: "assistant",
3588
+ content: this.message
3589
+ };
3590
+ }
3591
+ }
3592
+ var q = /* @__PURE__ */ ((e) => (e[e.Init = 0] = "Init", e[e.Done = 1] = "Done", e[e.Error = 2] = "Error", e[e.AgentManifest = 3] = "AgentManifest", e[e.AppendMessage = 4] = "AppendMessage", e[e.ToolCallUpdate = 5] = "ToolCallUpdate", e[e.Loop = 6] = "Loop", e[e.ToolCallStatus = 7] = "ToolCallStatus", e[e.ToolCallLog = 8] = "ToolCallLog", e[e.ToolCallDone = 9] = "ToolCallDone", e[e.ToolCallError = 10] = "ToolCallError", e))(q || {}), X = /* @__PURE__ */ ((e) => (e.Progress = "progress", e.Complete = "complete", e.Info = "info", e.Warning = "warning", e.Error = "error", e.Undetermined = "undetermined", e))(X || {}), oe = /* @__PURE__ */ ((e) => (e.ExtraSmall = "16", e.Small = "20", e.Medium = "24", e.Large = "28", e.ExtraLarge = "32", e.ExtraExtraLarge = "40", e))(oe || {});
3593
+ function Ti({ size: e = oe.Medium, ...n }) {
3594
+ const t = J("svg");
3595
+ t.setAttribute("viewBox", "0 0 448 512"), t.setAttribute("fill", "currentColor"), t.setAttribute("width", e), t.setAttribute("height", e), xe(t, n);
3596
+ const r = J("path");
3597
+ return r.setAttribute(
3598
+ "d",
3599
+ "M413.505 91.951L133.49 371.966l-98.995-98.995c-4.686-4.686-12.284-4.686-16.971 0L6.211 284.284c-4.686 4.686-4.686 12.284 0 16.971l118.794 118.794c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-11.314-11.314c-4.686-4.686-12.284-4.686-16.97 0z"
3600
+ ), t.appendChild(r), t.classList.add("icon"), t;
3601
+ }
3602
+ function Mi({ size: e = oe.Medium, ...n }) {
3603
+ const t = J("svg");
3604
+ t.setAttribute("viewBox", "0 0 512 512"), t.setAttribute("fill", "currentColor"), t.setAttribute("width", e), t.setAttribute("height", e), xe(t, n);
3605
+ const r = J("path");
3606
+ return r.setAttribute(
3607
+ "d",
3608
+ "M256 40c118.621 0 216 96.075 216 216 0 119.291-96.61 216-216 216-119.244 0-216-96.562-216-216 0-119.203 96.602-216 216-216m0-32C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm-11.49 120h22.979c6.823 0 12.274 5.682 11.99 12.5l-7 168c-.268 6.428-5.556 11.5-11.99 11.5h-8.979c-6.433 0-11.722-5.073-11.99-11.5l-7-168c-.283-6.818 5.167-12.5 11.99-12.5zM256 340c-15.464 0-28 12.536-28 28s12.536 28 28 28 28-12.536 28-28-12.536-28-28-28z"
3609
+ ), t.appendChild(r), t.classList.add("icon"), t;
3610
+ }
3611
+ function yt({ size: e = oe.Medium, ...n }) {
3612
+ const t = J("svg");
3613
+ t.setAttribute("viewBox", "0 0 512 512"), t.setAttribute("fill", "currentColor"), t.setAttribute("width", e), t.setAttribute("height", e), xe(t, n);
3614
+ const r = J("path");
3615
+ return r.setAttribute(
3616
+ "d",
3617
+ "M256 40c118.621 0 216 96.075 216 216 0 119.291-96.61 216-216 216-119.244 0-216-96.562-216-216 0-119.203 96.602-216 216-216m0-32C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm-36 344h12V232h-12c-6.627 0-12-5.373-12-12v-8c0-6.627 5.373-12 12-12h48c6.627 0 12 5.373 12 12v140h12c6.627 0 12 5.373 12 12v8c0 6.627-5.373 12-12 12h-72c-6.627 0-12-5.373-12-12v-8c0-6.627 5.373-12 12-12zm36-240c-17.673 0-32 14.327-32 32s14.327 32 32 32 32-14.327 32-32-14.327-32-32-32z"
3618
+ ), t.appendChild(r), t.classList.add("icon"), t;
3619
+ }
3620
+ function Di({ size: e = oe.Medium, ...n }) {
3621
+ const t = J("svg");
3622
+ t.setAttribute("viewBox", "0 0 32 32"), t.setAttribute("fill", "currentColor"), t.setAttribute("width", e), t.setAttribute("height", e), xe(t, n);
3623
+ const r = J("path");
3624
+ return r.setAttribute(
3625
+ "d",
3626
+ "M14.75 21.75C15.0833 21.4167 15.5 21.25 16 21.25C16.5 21.25 16.9167 21.4167 17.25 21.75C17.5833 22.0833 17.75 22.5 17.75 23C17.75 23.5 17.5833 23.9167 17.25 24.25C16.9167 24.5833 16.5 24.75 16 24.75C15.5 24.75 15.0833 24.5833 14.75 24.25C14.4167 23.9167 14.25 23.5 14.25 23C14.25 22.5 14.4167 22.0833 14.75 21.75ZM16.5 19.75H15.5C15.2917 19.75 15.1042 19.6875 14.9375 19.5625C14.8125 19.3958 14.75 19.2083 14.75 19C14.75 18 15 17.1667 15.5 16.5C16 15.7917 16.5417 15.2917 17.125 15C17.75 14.7083 18.3125 14.3333 18.8125 13.875C19.3125 13.4167 19.5625 12.875 19.5625 12.25C19.5625 11.8333 19.4375 11.4375 19.1875 11.0625C18.9375 10.6875 18.5417 10.375 18 10.125C17.4583 9.875 16.7917 9.75 16 9.75C14.4583 9.75 13.2083 10.3542 12.25 11.5625C12 11.9375 11.6667 11.9792 11.25 11.6875L10.4375 11.125C10.0208 10.8333 9.95833 10.4792 10.25 10.0625C11.7083 8.1875 13.625 7.25 16 7.25C17.7083 7.25 19.1458 7.70833 20.3125 8.625C21.4792 9.54167 22.0625 10.75 22.0625 12.25C22.0625 13.2083 21.8125 14.0417 21.3125 14.75C20.8125 15.4167 20.25 15.8958 19.625 16.1875C19.0417 16.4792 18.5 16.875 18 17.375C17.5 17.8333 17.25 18.375 17.25 19C17.25 19.2083 17.1667 19.3958 17 19.5625C16.875 19.6875 16.7083 19.75 16.5 19.75ZM16 2.5C12.25 2.5 9.0625 3.83333 6.4375 6.5C3.8125 9.125 2.5 12.2917 2.5 16C2.5 19.75 3.8125 22.9375 6.4375 25.5625C9.10417 28.1875 12.2917 29.5 16 29.5C19.75 29.5 22.9375 28.1875 25.5625 25.5625C28.1875 22.8958 29.5 19.7083 29.5 16C29.5 12.25 28.1667 9.0625 25.5 6.4375C22.875 3.8125 19.7083 2.5 16 2.5ZM5 5.0625C8.04167 2.02083 11.7083 0.5 16 0.5C20.2917 0.5 23.9375 2.02083 26.9375 5.0625C29.9792 8.0625 31.5 11.7083 31.5 16C31.5 20.2917 29.9792 23.9583 26.9375 27C23.9375 30 20.2917 31.5 16 31.5C11.7083 31.5 8.04167 30 5 27C2 23.9583 0.5 20.2917 0.5 16C0.5 11.7083 2 8.0625 5 5.0625Z"
3627
+ ), t.appendChild(r), t.classList.add("icon"), t;
3628
+ }
3629
+ class Ue {
3630
+ // export interface AIChatToolCallProps extends JSX.HTMLAttributes<HTMLLIElement> {
3631
+ // id?: string;
3632
+ // name?: string;
3633
+ // args?: string;
3634
+ // initialIcon: string;
3635
+ // initialMarkdown: string;
3636
+ // }
3637
+ constructor(n, t, r, i, s) {
3638
+ I(this, "node");
3639
+ // private _id: string;
3640
+ // get id() {
3641
+ // return this._id;
3642
+ // }
3643
+ // set id(value: string) {
3644
+ // this._id = value;
3645
+ // //this.idNode.textContent = value;
3646
+ // }
3647
+ // idNode: HTMLElement;
3648
+ // private _name: string = "";
3649
+ // get name() {
3650
+ // return this._name;
3651
+ // }
3652
+ // set name(value: string) {
3653
+ // this._name = value;
3654
+ // //this.nameNode.textContent = value;
3655
+ // }
3656
+ // nameNode: HTMLPreElement;
3657
+ // private _args: string = "";
3658
+ // get arguments() {
3659
+ // return this._args;
3660
+ // }
3661
+ // appendArguments(args: string) {
3662
+ // if (this._args) {
3663
+ // if (args) this._args += args;
3664
+ // } else this._args = args;
3665
+ // //this.argsNode.textContent = this._args;
3666
+ // }
3667
+ // argsNode: HTMLPreElement;
3668
+ // logNode: HTMLElement;
3669
+ I(this, "_itemsNode");
3670
+ I(this, "_itemsByIndex", {});
3671
+ I(this, "_initialItem");
3672
+ this._initialItem = new kt(n, t), this.node = /* @__PURE__ */ R("li", { class: "first:pt-0 last:pb-0 pt-2 pb-2" }, this._itemsNode = /* @__PURE__ */ R("ol", { class: "flex flex-col gap-1" }, this._initialItem.node));
3673
+ }
3674
+ log(n, t, r) {
3675
+ }
3676
+ status(n, t, r, i) {
3677
+ let s;
3678
+ if (this._initialItem)
3679
+ this._itemsByIndex[n] = s = this._initialItem, this._initialItem = null;
3680
+ else if (!(s = this._itemsByIndex[n])) {
3681
+ this._itemsByIndex[n] = s = new kt(r, i), this._itemsNode.appendChild(s.node);
3682
+ return;
3683
+ }
3684
+ s.status(t, r, i);
3685
+ }
3686
+ done() {
3687
+ if (this._initialItem)
3688
+ this._initialItem.status(-1, X.Complete, "Successfully invoked tool.");
3689
+ else
3690
+ for (const n in this._itemsByIndex) {
3691
+ const t = this._itemsByIndex[n];
3692
+ t.icon === X.Progress && (t.icon = X.Undetermined);
3693
+ }
3694
+ }
3695
+ error() {
3696
+ if (this._initialItem)
3697
+ this._initialItem.status(
3698
+ -1,
3699
+ X.Error,
3700
+ "An error occurred while invoking the tool."
3701
+ );
3702
+ else
3703
+ for (const n in this._itemsByIndex) {
3704
+ const t = this._itemsByIndex[n];
3705
+ t.icon === X.Progress && (t.icon = X.Undetermined);
3706
+ }
3707
+ }
3708
+ }
3709
+ class kt {
3710
+ constructor(n, t) {
3711
+ I(this, "node");
3712
+ I(this, "_icon");
3713
+ I(this, "_iconNode");
3714
+ I(this, "_markdown");
3715
+ I(this, "_markdownNode");
3716
+ this._icon = n, this._markdown = t, this.node = /* @__PURE__ */ R("li", { class: "flex gap-2 items-center px-5" }, this._iconNode = Ct(n), this._markdownNode = /* @__PURE__ */ R("span", null)), qe(this._markdownNode, this._markdown);
3717
+ }
3718
+ get icon() {
3719
+ return this._icon;
3720
+ }
3721
+ set icon(n) {
3722
+ n !== this._icon && (this._iconNode.replaceWith(this._iconNode = Ct(n)), this._icon = n);
3723
+ }
3724
+ get markdown() {
3725
+ return this._markdown;
3726
+ }
3727
+ set markdown(n) {
3728
+ n !== this._markdown && (qe(this._markdownNode, this._markdown = n), this._markdown = n);
3729
+ }
3730
+ status(n, t, r) {
3731
+ this.icon = t, this.markdown = r;
3732
+ }
3733
+ }
3734
+ function Ct(e) {
3735
+ switch (e) {
3736
+ case X.Progress:
3737
+ return /* @__PURE__ */ R(Et, { size: He.Small });
3738
+ case X.Complete:
3739
+ return /* @__PURE__ */ R(Ti, { size: oe.Medium, class: "text-Land-Green-Main-41" });
3740
+ case X.Info:
3741
+ return /* @__PURE__ */ R(yt, { size: oe.Medium, class: "text-Sea-Blue-Main-28" });
3742
+ case X.Warning:
3743
+ return /* @__PURE__ */ R(yt, { size: oe.Medium, class: "text-Terracotta-Main-35" });
3744
+ case X.Error:
3745
+ return /* @__PURE__ */ R(Mi, { size: oe.Medium, class: "text-Energy-Red-Main-54" });
3746
+ }
3747
+ return e != null && e.startsWith("https://") ? /* @__PURE__ */ R("img", { src: e, alt: "", class: "w-6 h-6" }) : (e && e !== X.Undetermined && console.warn(`Unknown icon '${e}'. Defaulting to undetermined.`), /* @__PURE__ */ R(Di, { size: oe.Medium, class: "text-Sandstone-Main-79" }));
3748
+ }
3749
+ class Re {
3750
+ constructor() {
3751
+ I(this, "node");
3752
+ I(this, "toolCallsNode");
3753
+ I(this, "toolCallsByIndex", {});
3754
+ I(this, "toolCallsById", {});
3755
+ this.node = /* @__PURE__ */ R("li", null, this.toolCallsNode = /* @__PURE__ */ R("ol", { class: "flex flex-col divide-y divide-Light" }));
3756
+ }
3757
+ aggregate(n, t, r, i) {
3758
+ let s = this.toolCallsByIndex[t];
3759
+ s || (this.toolCallsByIndex[t] = s = new Ue("progress", "Invoking tool…"), this.toolCallsNode.appendChild(s.node)), n && (this.toolCallsById[n] = s);
3760
+ }
3761
+ completeAggregation() {
3762
+ }
3763
+ log(n, t, r, i) {
3764
+ var s;
3765
+ (s = this.toolCallsById[n]) == null || s.log(t, r, i);
3766
+ }
3767
+ status(n, t, r, i, s) {
3768
+ var o;
3769
+ (o = this.toolCallsById[n]) == null || o.status(t, r, i, s);
3770
+ }
3771
+ done(n) {
3772
+ var t;
3773
+ (t = this.toolCallsById[n]) == null || t.done();
3774
+ }
3775
+ error(n) {
3776
+ var t;
3777
+ (t = this.toolCallsById[n]) == null || t.error();
3778
+ }
3779
+ }
3780
+ class Fi {
3781
+ constructor() {
3782
+ I(this, "_reader");
3783
+ I(this, "_buffer", new Uint8Array(0));
3784
+ I(this, "_bufferOffset", 0);
3785
+ }
3786
+ async initializeConnectionAsync(n, t) {
3787
+ var r = await fetch(n, {
3788
+ method: "POST",
3789
+ headers: {
3790
+ "Content-Type": "application/json"
3791
+ },
3792
+ body: JSON.stringify(t)
3793
+ });
3794
+ this._reader = r.body.getReader();
3795
+ }
3796
+ async readBytesAsync(n) {
3797
+ if (this._buffer.length - this._bufferOffset >= n) {
3798
+ const r = this._buffer.subarray(this._bufferOffset, this._bufferOffset + n);
3799
+ return this._bufferOffset += n, r;
3800
+ }
3801
+ for (; this._buffer.length - this._bufferOffset < n; ) {
3802
+ const { done: r, value: i } = await this._reader.read();
3803
+ if (r) {
3804
+ const s = this._buffer.subarray(this._bufferOffset);
3805
+ return this._buffer = new Uint8Array(0), this._bufferOffset = 0, s;
3806
+ }
3807
+ this._buffer = Ri(this._buffer, i, this._bufferOffset), this._bufferOffset = 0;
3808
+ }
3809
+ const t = this._buffer.subarray(this._bufferOffset, this._bufferOffset + n);
3810
+ return this._bufferOffset += n, t;
3811
+ }
3812
+ async readLittleEndianInt32Async() {
3813
+ const n = await this.readBytesAsync(4), t = n.buffer.slice(n.byteOffset, n.byteOffset + n.byteLength);
3814
+ return new DataView(t).getInt32(0, !0);
3815
+ }
3816
+ async readLittleEndianDoubleAsync() {
3817
+ const n = await this.readBytesAsync(8), t = n.buffer.slice(n.byteOffset, n.byteOffset + n.byteLength);
3818
+ return new DataView(t).getFloat64(0, !0);
3819
+ }
3820
+ async readUtf8StringAsync() {
3821
+ const n = await this.readLittleEndianInt32Async();
3822
+ if (n === -1)
3823
+ return null;
3824
+ const t = await this.readBytesAsync(n);
3825
+ return new TextDecoder().decode(t);
3826
+ }
3827
+ async readMessageAsync() {
3828
+ let n = performance.now();
3829
+ const t = await this.readBytesAsync(1);
3830
+ if (t.length == 0)
3831
+ return null;
3832
+ const r = t[0];
3833
+ let i;
3834
+ switch (r) {
3835
+ case q.Init:
3836
+ case q.Done:
3837
+ return i = performance.now(), { type: r, elapsed: i - n };
3838
+ case q.Error: {
3839
+ const s = await this.readUtf8StringAsync();
3840
+ return i = performance.now(), {
3841
+ type: r,
3842
+ elapsed: i - n,
3843
+ errorMarkdown: s
3844
+ };
3845
+ }
3846
+ case q.AgentManifest: {
3847
+ const s = await this.readUtf8StringAsync(), o = await this.readUtf8StringAsync(), a = await this.readUtf8StringAsync(), p = await this.readUtf8StringAsync();
3848
+ return i = performance.now(), {
3849
+ type: r,
3850
+ elapsed: i - n,
3851
+ parentFunctionId: s,
3852
+ agentManifestName: o,
3853
+ agentManifestBackgroundColor: a,
3854
+ agentManifestIcon: p
3855
+ };
3856
+ }
3857
+ case q.AppendMessage: {
3858
+ const s = await this.readUtf8StringAsync(), o = await this.readUtf8StringAsync();
3859
+ return i = performance.now(), {
3860
+ type: r,
3861
+ elapsed: i - n,
3862
+ parentFunctionId: s,
3863
+ appendMessageMarkdown: o
3864
+ };
3865
+ }
3866
+ case q.ToolCallUpdate: {
3867
+ const s = await this.readUtf8StringAsync(), o = await this.readUtf8StringAsync(), a = await this.readLittleEndianInt32Async(), p = await this.readUtf8StringAsync(), h = await this.readUtf8StringAsync();
3868
+ return i = performance.now(), {
3869
+ type: r,
3870
+ elapsed: i - n,
3871
+ parentFunctionId: s,
3872
+ toolCallFunctionId: o,
3873
+ toolCallUpdateIndex: a,
3874
+ toolCallUpdateName: p,
3875
+ toolCallUpdateArguments: h
3876
+ };
3877
+ }
3878
+ case q.Loop: {
3879
+ const s = await this.readUtf8StringAsync();
3880
+ return i = performance.now(), {
3881
+ type: r,
3882
+ elapsed: i - n,
3883
+ parentFunctionId: s
3884
+ };
3885
+ }
3886
+ case q.ToolCallStatus: {
3887
+ const s = await this.readUtf8StringAsync(), o = await this.readLittleEndianInt32Async(), a = await this.readLittleEndianDoubleAsync(), p = await this.readUtf8StringAsync(), h = await this.readUtf8StringAsync();
3888
+ return i = performance.now(), {
3889
+ type: r,
3890
+ elapsed: i - n,
3891
+ toolCallFunctionId: s,
3892
+ toolCallStatusIndex: o,
3893
+ toolCallStatusProgress: a,
3894
+ toolCallIcon: p,
3895
+ toolCallMarkdown: h
3896
+ };
3897
+ }
3898
+ case q.ToolCallLog: {
3899
+ const s = await this.readUtf8StringAsync(), o = await this.readBytesAsync(1);
3900
+ if (o.length == 0)
3901
+ return null;
3902
+ const a = o[0], p = await this.readLittleEndianDoubleAsync(), h = await this.readUtf8StringAsync();
3903
+ return i = performance.now(), {
3904
+ type: r,
3905
+ elapsed: i - n,
3906
+ toolCallFunctionId: s,
3907
+ toolCallLogLevel: a,
3908
+ toolCallTime: p,
3909
+ toolCallMarkdown: h
3910
+ };
3911
+ }
3912
+ case q.ToolCallDone: {
3913
+ const s = await this.readUtf8StringAsync();
3914
+ return i = performance.now(), {
3915
+ type: r,
3916
+ elapsed: i - n,
3917
+ toolCallFunctionId: s
3918
+ };
3919
+ }
3920
+ case q.ToolCallError: {
3921
+ const s = await this.readUtf8StringAsync();
3922
+ return i = performance.now(), {
3923
+ type: r,
3924
+ elapsed: i - n,
3925
+ toolCallFunctionId: s
3926
+ };
3927
+ }
3928
+ default:
3929
+ throw new Error(`Unexpected message type: ${r}`);
3930
+ }
3931
+ }
3932
+ }
3933
+ function Ri(e, n, t) {
3934
+ t > 0 && e.copyWithin(0, t);
3935
+ let r = new Uint8Array(e.length - t + n.length);
3936
+ return r.set(e.subarray(0, e.length - t), 0), r.set(n, e.length - t), r;
3937
+ }
3938
+ class Ni extends Fi {
3939
+ constructor(t = 1) {
3940
+ super();
3941
+ I(this, "_latestReadMessagePromise");
3942
+ I(this, "_lettersRead", 0);
3943
+ I(this, "_lettersReadTime", 0);
3944
+ I(this, "_isDone");
3945
+ // FIFO queue implementation
3946
+ I(this, "_queue", []);
3947
+ I(this, "_headIndex", 0);
3948
+ this.chunkSize = t;
3949
+ }
3950
+ async initializeConnectionAsync(t, r) {
3951
+ await super.initializeConnectionAsync(t, r), this.readMessagesContinuouslyAsync();
3952
+ }
3953
+ // Reads messages continuously from the stream without stopping
3954
+ async readMessagesContinuouslyAsync() {
3955
+ try {
3956
+ for (; ; ) {
3957
+ const t = await (this._latestReadMessagePromise = this.readMessageAsync());
3958
+ if (!t)
3959
+ return;
3960
+ if (t.type === q.AppendMessage) {
3961
+ t.appendMessageMarkdown && (this._lettersRead += t.appendMessageMarkdown.length), this._lettersReadTime += t.elapsed;
3962
+ const r = this.peekParentFunctionId(t.parentFunctionId);
3963
+ if (r && r.type === q.AppendMessage) {
3964
+ t.appendMessageMarkdown && (r.appendMessageMarkdown += t.appendMessageMarkdown), r.elapsed += t.elapsed;
3965
+ continue;
3966
+ }
3967
+ }
3968
+ this.enqueue(t);
3969
+ }
3970
+ } finally {
3971
+ this._isDone = !0;
3972
+ }
3973
+ }
3974
+ async readMessageFromQueueAsync() {
3975
+ return this.size() ? this.dequeue() : (await this._latestReadMessagePromise, this.dequeue());
3976
+ }
3977
+ async *readMessagesAsync() {
3978
+ for (; ; ) {
3979
+ const t = await this.readMessageFromQueueAsync();
3980
+ if (!t)
3981
+ return;
3982
+ if (t.type === q.AppendMessage && t.appendMessageMarkdown) {
3983
+ const r = t.appendMessageMarkdown;
3984
+ for (let i = 0; ; ) {
3985
+ if (this.peek() || this._isDone) {
3986
+ yield i ? {
3987
+ ...t,
3988
+ appendMessageMarkdown: r.substring(i)
3989
+ } : t;
3990
+ break;
3991
+ }
3992
+ const s = r.substring(i, i += this.chunkSize);
3993
+ if (yield {
3994
+ ...t,
3995
+ appendMessageMarkdown: s
3996
+ }, i < r.length) {
3997
+ const o = this._lettersReadTime ? this._lettersReadTime / this._lettersRead : 0;
3998
+ o && await new Promise((a) => setTimeout(a, o * s.length));
3999
+ } else
4000
+ break;
4001
+ }
4002
+ } else
4003
+ yield t;
4004
+ }
4005
+ }
4006
+ // Pointer to the front of the queue
4007
+ enqueue(t) {
4008
+ this._queue.push(t);
4009
+ }
4010
+ dequeue() {
4011
+ if (this.isEmpty())
4012
+ return;
4013
+ const t = this._queue[this._headIndex];
4014
+ return this._queue[this._headIndex] = null, this._headIndex++, this._headIndex > this._queue.length / 2 && (this._queue = this._queue.slice(this._headIndex), this._headIndex = 0), t;
4015
+ }
4016
+ peek() {
4017
+ return this.isEmpty() ? void 0 : this._queue[this._headIndex];
4018
+ }
4019
+ peekParentFunctionId(t) {
4020
+ if (this.isEmpty())
4021
+ return;
4022
+ let r = this._headIndex;
4023
+ do {
4024
+ const i = this._queue[r];
4025
+ switch (i.type) {
4026
+ case q.Init:
4027
+ case q.Done:
4028
+ case q.Error:
4029
+ return;
4030
+ }
4031
+ if (i.parentFunctionId === t)
4032
+ return i;
4033
+ } while (++r < this._queue.length);
4034
+ }
4035
+ isEmpty() {
4036
+ return this._headIndex >= this._queue.length;
4037
+ }
4038
+ size() {
4039
+ return this._queue.length - this._headIndex;
4040
+ }
4041
+ }
4042
+ const Oi = '*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:currentColor}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Avenir Next,ui-sans-serif,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}b,strong{font-weight:600}:root{--Dark-Blue-5: hsl(223, 67%, 5%);--Dark-Blue-10: hsl(223, 67%, 10%);--Dark-Blue-15: hsl(223, 67%, 15%);--Dark-Blue-20: hsl(223, 67%, 20%);--Dark-Blue-25: hsl(223, 67%, 25%);--Dark-Blue-30: hsl(223, 67%, 30%);--Dark-Blue-35: hsl(223, 67%, 35%);--Dark-Blue-40: hsl(223, 67%, 40%);--Dark-Blue-45: hsl(223, 67%, 45%);--Dark-Blue-50: hsl(223, 67%, 50%);--Dark-Blue-55: hsl(223, 67%, 55%);--Dark-Blue-60: hsl(223, 67%, 60%);--Dark-Blue-65: hsl(223, 67%, 65%);--Dark-Blue-70: hsl(223, 67%, 70%);--Dark-Blue-75: hsl(223, 67%, 75%);--Dark-Blue-80: hsl(223, 67%, 80%);--Dark-Blue-85: hsl(223, 67%, 85%);--Dark-Blue-90: hsl(223, 67%, 90%);--Dark-Blue-95: hsl(223, 67%, 95%);--Dark-Blue-Main-18: hsl(223, 67%, 18%);--Sea-Blue-5: hsl(218, 100%, 5%);--Sea-Blue-10: hsl(218, 100%, 10%);--Sea-Blue-15: hsl(218, 100%, 15%);--Sea-Blue-20: hsl(218, 100%, 20%);--Sea-Blue-25: hsl(218, 100%, 25%);--Sea-Blue-30: hsl(218, 100%, 30%);--Sea-Blue-35: hsl(218, 100%, 35%);--Sea-Blue-40: hsl(218, 100%, 40%);--Sea-Blue-45: hsl(218, 100%, 45%);--Sea-Blue-50: hsl(218, 100%, 50%);--Sea-Blue-55: hsl(218, 100%, 55%);--Sea-Blue-60: hsl(218, 100%, 60%);--Sea-Blue-65: hsl(218, 100%, 65%);--Sea-Blue-70: hsl(218, 100%, 70%);--Sea-Blue-75: hsl(218, 100%, 75%);--Sea-Blue-80: hsl(218, 100%, 80%);--Sea-Blue-85: hsl(218, 100%, 85%);--Sea-Blue-90: hsl(218, 100%, 90%);--Sea-Blue-95: hsl(218, 100%, 95%);--Sea-Blue-Main-28: hsl(218, 100%, 28%);--Sky-Blue-5: hsl(196, 74%, 5%);--Sky-Blue-10: hsl(196, 74%, 10%);--Sky-Blue-15: hsl(196, 74%, 15%);--Sky-Blue-20: hsl(196, 74%, 20%);--Sky-Blue-25: hsl(196, 74%, 25%);--Sky-Blue-30: hsl(196, 74%, 30%);--Sky-Blue-35: hsl(196, 74%, 35%);--Sky-Blue-40: hsl(196, 74%, 40%);--Sky-Blue-45: hsl(196, 74%, 45%);--Sky-Blue-50: hsl(196, 74%, 50%);--Sky-Blue-55: hsl(196, 74%, 55%);--Sky-Blue-60: hsl(196, 74%, 60%);--Sky-Blue-65: hsl(196, 74%, 65%);--Sky-Blue-70: hsl(196, 74%, 70%);--Sky-Blue-75: hsl(196, 74%, 75%);--Sky-Blue-80: hsl(196, 74%, 80%);--Sky-Blue-85: hsl(196, 74%, 85%);--Sky-Blue-90: hsl(196, 74%, 90%);--Sky-Blue-95: hsl(196, 74%, 95%);--Sky-Blue-97: hsl(196, 74%, 97%);--Sky-Blue-Main-77: hsl(196, 74%, 77%);--Digi-Green-5: hsl(139, 100%, 5%);--Digi-Green-10: hsl(139, 100%, 10%);--Digi-Green-15: hsl(139, 100%, 15%);--Digi-Green-20: hsl(139, 100%, 20%);--Digi-Green-25: hsl(139, 100%, 25%);--Digi-Green-30: hsl(139, 100%, 30%);--Digi-Green-35: hsl(139, 100%, 35%);--Digi-Green-40: hsl(139, 100%, 40%);--Digi-Green-45: hsl(139, 100%, 45%);--Digi-Green-50: hsl(139, 100%, 50%);--Digi-Green-55: hsl(139, 100%, 55%);--Digi-Green-60: hsl(139, 100%, 60%);--Digi-Green-65: hsl(139, 100%, 65%);--Digi-Green-70: hsl(139, 100%, 70%);--Digi-Green-75: hsl(139, 100%, 75%);--Digi-Green-80: hsl(139, 100%, 80%);--Digi-Green-85: hsl(139, 100%, 85%);--Digi-Green-90: hsl(139, 100%, 90%);--Digi-Green-95: hsl(139, 100%, 95%);--Digi-Green-Main-78: hsl(139, 100%, 78%);--Sandstone-5: hsl(40, 3%, 5%);--Sandstone-10: hsl(40, 3%, 10%);--Sandstone-15: hsl(40, 3%, 15%);--Sandstone-20: hsl(40, 3%, 20%);--Sandstone-25: hsl(40, 3%, 25%);--Sandstone-30: hsl(40, 3%, 30%);--Sandstone-35: hsl(40, 3%, 35%);--Sandstone-40: hsl(40, 3%, 40%);--Sandstone-45: hsl(40, 3%, 45%);--Sandstone-50: hsl(40, 3%, 50%);--Sandstone-55: hsl(40, 3%, 55%);--Sandstone-60: hsl(40, 3%, 60%);--Sandstone-65: hsl(40, 3%, 65%);--Sandstone-70: hsl(40, 3%, 70%);--Sandstone-75: hsl(40, 3%, 75%);--Sandstone-80: hsl(40, 3%, 80%);--Sandstone-85: hsl(40, 3%, 85%);--Sandstone-90: hsl(40, 3%, 90%);--Sandstone-95: hsl(40, 3%, 95%);--Sandstone-97: hsl(40, 3%, 97%);--Sandstone-Main-79: hsl(40, 3%, 79%);--Warm-Grey-5: hsl(30, 8%, 5%);--Warm-Grey-10: hsl(30, 8%, 10%);--Warm-Grey-15: hsl(30, 8%, 15%);--Warm-Grey-20: hsl(30, 8%, 20%);--Warm-Grey-25: hsl(30, 8%, 25%);--Warm-Grey-30: hsl(30, 8%, 30%);--Warm-Grey-35: hsl(30, 8%, 35%);--Warm-Grey-40: hsl(30, 8%, 40%);--Warm-Grey-45: hsl(30, 8%, 45%);--Warm-Grey-50: hsl(30, 8%, 50%);--Warm-Grey-55: hsl(30, 8%, 55%);--Warm-Grey-60: hsl(30, 8%, 60%);--Warm-Grey-65: hsl(30, 8%, 65%);--Warm-Grey-70: hsl(30, 8%, 70%);--Warm-Grey-75: hsl(30, 8%, 75%);--Warm-Grey-80: hsl(30, 8%, 80%);--Warm-Grey-85: hsl(30, 8%, 85%);--Warm-Grey-90: hsl(30, 8%, 90%);--Warm-Grey-95: hsl(30, 8%, 95%);--Warm-Grey-Main-56: hsl(30, 8%, 56%);--Earth-5: hsl(35, 53%, 5%);--Earth-10: hsl(35, 53%, 10%);--Earth-15: hsl(35, 53%, 15%);--Earth-20: hsl(35, 53%, 20%);--Earth-25: hsl(35, 53%, 25%);--Earth-30: hsl(35, 53%, 30%);--Earth-35: hsl(35, 53%, 35%);--Earth-40: hsl(35, 53%, 40%);--Earth-45: hsl(35, 53%, 45%);--Earth-50: hsl(35, 53%, 50%);--Earth-55: hsl(35, 53%, 55%);--Earth-60: hsl(35, 53%, 60%);--Earth-65: hsl(35, 53%, 65%);--Earth-70: hsl(35, 53%, 70%);--Earth-75: hsl(35, 53%, 75%);--Earth-80: hsl(35, 53%, 80%);--Earth-85: hsl(35, 53%, 85%);--Earth-90: hsl(35, 53%, 90%);--Earth-95: hsl(35, 53%, 95%);--Earth-97: hsl(35, 53%, 97%);--Earth-Main-89: hsl(35, 53%, 89%);--Pine-5: hsl(195, 46%, 5%);--Pine-10: hsl(195, 46%, 10%);--Pine-15: hsl(195, 46%, 15%);--Pine-20: hsl(195, 46%, 20%);--Pine-25: hsl(195, 46%, 25%);--Pine-30: hsl(195, 46%, 30%);--Pine-35: hsl(195, 46%, 35%);--Pine-40: hsl(195, 46%, 40%);--Pine-45: hsl(195, 46%, 45%);--Pine-50: hsl(195, 46%, 50%);--Pine-55: hsl(195, 46%, 55%);--Pine-60: hsl(195, 46%, 60%);--Pine-65: hsl(195, 46%, 65%);--Pine-70: hsl(195, 46%, 70%);--Pine-75: hsl(195, 46%, 75%);--Pine-80: hsl(195, 46%, 80%);--Pine-85: hsl(195, 46%, 85%);--Pine-90: hsl(195, 46%, 90%);--Pine-95: hsl(195, 46%, 95%);--Pine-Main-30: hsl(195, 46%, 30%);--Eucalyptus-5: hsl(178, 80%, 5%);--Eucalyptus-10: hsl(178, 80%, 10%);--Eucalyptus-15: hsl(178, 80%, 15%);--Eucalyptus-20: hsl(178, 80%, 20%);--Eucalyptus-25: hsl(178, 80%, 25%);--Eucalyptus-30: hsl(178, 80%, 30%);--Eucalyptus-35: hsl(178, 80%, 35%);--Eucalyptus-40: hsl(178, 80%, 40%);--Eucalyptus-45: hsl(178, 80%, 45%);--Eucalyptus-50: hsl(178, 80%, 50%);--Eucalyptus-55: hsl(178, 80%, 55%);--Eucalyptus-60: hsl(178, 80%, 60%);--Eucalyptus-65: hsl(178, 80%, 65%);--Eucalyptus-70: hsl(178, 80%, 70%);--Eucalyptus-75: hsl(178, 80%, 75%);--Eucalyptus-80: hsl(178, 80%, 80%);--Eucalyptus-85: hsl(178, 80%, 85%);--Eucalyptus-90: hsl(178, 80%, 90%);--Eucalyptus-95: hsl(178, 80%, 95%);--Eucalyptus-Main-41: hsl(178, 80%, 41%);--Lavender-5: hsl(232, 58%, 5%);--Lavender-10: hsl(232, 58%, 10%);--Lavender-15: hsl(232, 58%, 15%);--Lavender-20: hsl(232, 58%, 20%);--Lavender-25: hsl(232, 58%, 25%);--Lavender-30: hsl(232, 58%, 30%);--Lavender-35: hsl(232, 58%, 35%);--Lavender-40: hsl(232, 58%, 40%);--Lavender-45: hsl(232, 58%, 45%);--Lavender-50: hsl(232, 58%, 50%);--Lavender-55: hsl(232, 58%, 55%);--Lavender-60: hsl(232, 58%, 60%);--Lavender-65: hsl(232, 58%, 65%);--Lavender-70: hsl(232, 58%, 70%);--Lavender-75: hsl(232, 58%, 75%);--Lavender-80: hsl(232, 58%, 80%);--Lavender-85: hsl(232, 58%, 85%);--Lavender-90: hsl(232, 58%, 90%);--Lavender-95: hsl(232, 58%, 95%);--Lavender-Main-77: hsl(232, 58%, 77%);--Terracotta-5: hsl(34, 100%, 5%);--Terracotta-10: hsl(34, 100%, 10%);--Terracotta-15: hsl(34, 100%, 15%);--Terracotta-20: hsl(34, 100%, 20%);--Terracotta-25: hsl(34, 100%, 25%);--Terracotta-30: hsl(34, 100%, 30%);--Terracotta-35: hsl(34, 100%, 35%);--Terracotta-40: hsl(34, 100%, 40%);--Terracotta-45: hsl(34, 100%, 45%);--Terracotta-50: hsl(34, 100%, 50%);--Terracotta-55: hsl(34, 100%, 55%);--Terracotta-60: hsl(34, 100%, 60%);--Terracotta-65: hsl(34, 100%, 65%);--Terracotta-70: hsl(34, 100%, 70%);--Terracotta-75: hsl(34, 100%, 75%);--Terracotta-80: hsl(34, 100%, 80%);--Terracotta-85: hsl(34, 100%, 85%);--Terracotta-90: hsl(34, 100%, 90%);--Terracotta-95: hsl(34, 100%, 95%);--Terracotta-Main-35: hsl(34, 100%, 35%);--Land-Green-5: hsl(114, 49%, 5%);--Land-Green-10: hsl(114, 49%, 10%);--Land-Green-15: hsl(114, 49%, 15%);--Land-Green-20: hsl(114, 49%, 20%);--Land-Green-25: hsl(114, 49%, 25%);--Land-Green-30: hsl(114, 49%, 30%);--Land-Green-35: hsl(114, 49%, 35%);--Land-Green-40: hsl(114, 49%, 40%);--Land-Green-45: hsl(114, 49%, 45%);--Land-Green-50: hsl(114, 49%, 50%);--Land-Green-55: hsl(114, 49%, 55%);--Land-Green-60: hsl(114, 49%, 60%);--Land-Green-65: hsl(114, 49%, 65%);--Land-Green-70: hsl(114, 49%, 70%);--Land-Green-75: hsl(114, 49%, 75%);--Land-Green-80: hsl(114, 49%, 80%);--Land-Green-85: hsl(114, 49%, 85%);--Land-Green-90: hsl(114, 49%, 90%);--Land-Green-95: hsl(114, 49%, 95%);--Land-Green-Main-41: hsl(114, 49%, 41%);--Sunflower-5: hsl(55, 100%, 5%);--Sunflower-10: hsl(55, 100%, 10%);--Sunflower-15: hsl(55, 100%, 15%);--Sunflower-20: hsl(55, 100%, 20%);--Sunflower-25: hsl(55, 100%, 25%);--Sunflower-30: hsl(55, 100%, 30%);--Sunflower-35: hsl(55, 100%, 35%);--Sunflower-40: hsl(55, 100%, 40%);--Sunflower-45: hsl(55, 100%, 45%);--Sunflower-50: hsl(55, 100%, 50%);--Sunflower-55: hsl(55, 100%, 55%);--Sunflower-60: hsl(55, 100%, 60%);--Sunflower-65: hsl(55, 100%, 65%);--Sunflower-70: hsl(55, 100%, 70%);--Sunflower-75: hsl(55, 100%, 75%);--Sunflower-80: hsl(55, 100%, 80%);--Sunflower-85: hsl(55, 100%, 85%);--Sunflower-90: hsl(55, 100%, 90%);--Sunflower-95: hsl(55, 100%, 95%);--Sunflower-Main-73: hsl(55, 100%, 73%);--Energy-Red-5: hsl(357, 83%, 5%);--Energy-Red-10: hsl(357, 83%, 10%);--Energy-Red-15: hsl(357, 83%, 15%);--Energy-Red-20: hsl(357, 83%, 20%);--Energy-Red-25: hsl(357, 83%, 25%);--Energy-Red-30: hsl(357, 83%, 30%);--Energy-Red-35: hsl(357, 83%, 35%);--Energy-Red-40: hsl(357, 83%, 40%);--Energy-Red-45: hsl(357, 83%, 45%);--Energy-Red-50: hsl(357, 83%, 50%);--Energy-Red-55: hsl(357, 83%, 55%);--Energy-Red-60: hsl(357, 83%, 60%);--Energy-Red-65: hsl(357, 83%, 65%);--Energy-Red-70: hsl(357, 83%, 70%);--Energy-Red-75: hsl(357, 83%, 75%);--Energy-Red-80: hsl(357, 83%, 80%);--Energy-Red-85: hsl(357, 83%, 85%);--Energy-Red-90: hsl(357, 83%, 90%);--Energy-Red-95: hsl(357, 83%, 95%);--Energy-Red-Main-54: hsl(357, 83%, 54%);--Cyan-5: hsl(196, 100%, 5%);--Cyan-10: hsl(196, 100%, 10%);--Cyan-15: hsl(196, 100%, 15%);--Cyan-20: hsl(196, 100%, 20%);--Cyan-25: hsl(196, 100%, 25%);--Cyan-30: hsl(196, 100%, 30%);--Cyan-35: hsl(196, 100%, 35%);--Cyan-40: hsl(196, 100%, 40%);--Cyan-45: hsl(196, 100%, 45%);--Cyan-50: hsl(196, 100%, 50%);--Cyan-55: hsl(196, 100%, 55%);--Cyan-60: hsl(196, 100%, 60%);--Cyan-65: hsl(196, 100%, 65%);--Cyan-70: hsl(196, 100%, 70%);--Cyan-75: hsl(196, 100%, 75%);--Cyan-80: hsl(196, 100%, 80%);--Cyan-85: hsl(196, 100%, 85%);--Cyan-90: hsl(196, 100%, 90%);--Cyan-95: hsl(196, 100%, 95%);--Cyan-Main-43: hsl(196, 100%, 43%);--Black: hsl(40 3% 10%);--White: hsl(40 3% 100%);--Light: hsl(40, 3%, 90%);--Default: hsl(40, 3%, 79%);--Medium: hsl(40, 3%, 75%);--Strong: hsl(218, 100%, 28%);--Emphasis: hsl(223, 67%, 18%);--vui-animation-duration-0: 0ms;--vui-animation-duration-100: .13s;--vui-animation-duration-200: .16s;--vui-animation-duration-300: .19s;--vui-animation-duration-400: .22s;--vui-animation-duration-500: .25s;--vui-animation-duration-600: .3s;--vui-animation-duration-700: .35s;--vui-animation-duration-800: .4s;--vui-animation-duration-900: .45s;--vui-animation-duration-1000: .5s;--vui-animation-duration-2000: 1s;--vui-animation-duration-4000: 2s;--vui-animation-ease-in-out: cubic-bezier(.45, 0, .4, 1);--vui-animation-ease-in: cubic-bezier(.5, 0, 1, 1);--vui-animation-ease-out: cubic-bezier(0, 0, .4, 1);--vui-animation-linear: cubic-bezier(0, 0, 1, 1);--vui-elevation-1: 0 6px 23px -10px hsla(223, 67%, 18%, .2);--vui-elevation-2: 0 9px 20px -6px hsla(223, 67%, 18%, .2);--vui-elevation-3: 0 12px 23px -4px hsla(223, 67%, 18%, .2);--vui-elevation-4: 0 15px 23px 0 hsla(223, 67%, 18%, .2)}h1,.h1{font-family:Avenir Next;font-size:3.125rem;font-style:normal;font-weight:400;line-height:1.24}@media only screen and (max-width: 992px){h1,.h1{font-size:1.9375rem;line-height:1.5483870967741935}}h1,.h1{color:var(--Dark-Blue-Main-18, hsl(223, 67%, 18%))}h2,.h2{font-family:Avenir Next;font-size:2rem;font-style:normal;font-weight:400;line-height:1.3125}@media only screen and (max-width: 992px){h2,.h2{font-size:1.75rem;line-height:1.3571428571428572}}h2,.h2{color:var(--Dark-Blue-Main-18, hsl(223, 67%, 18%))}h3,.h3{font-family:Avenir Next;font-size:1.5rem;font-style:normal;font-weight:400;line-height:1.3333333333333333}@media only screen and (max-width: 992px){h3,.h3{font-size:1.375rem;line-height:1.4545454545454546}}h3,.h3{color:var(--Dark-Blue-Main-18, hsl(223, 67%, 18%))}h4,.h4{font-family:Avenir Next;font-size:1.25rem;font-style:normal;font-weight:600;line-height:1.2}@media only screen and (max-width: 992px){h4,.h4{font-size:1.125rem;line-height:1.3333333333333333}}h4,.h4{color:var(--Dark-Blue-Main-18, hsl(223, 67%, 18%))}h5,.h5{font-family:Avenir Next;font-size:1.125rem;font-style:normal;font-weight:600;line-height:1.4444444444444444}@media only screen and (max-width: 992px){h5,.h5{font-size:1rem;line-height:1.375}}h5,.h5{color:var(--Dark-Blue-Main-18, hsl(223, 67%, 18%))}h6,.h6{font-family:Avenir Next;font-size:1rem;font-style:normal;font-weight:600;line-height:1.375;color:var(--Dark-Blue-Main-18, hsl(223, 67%, 18%))}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.sideMenuItem>.icon{width:24px;height:24px}.avatar{font-family:Avenir Next;font-weight:500;font-style:normal;align-items:center;background:#e6e6e5;border-radius:9999px;color:#353431;display:inline-flex;justify-content:center;overflow:hidden;text-transform:uppercase}.avatar.avatar-xl{font-size:1.125rem;line-height:1.5555555555555556;height:3rem;width:3rem}.avatar.avatar-lg{font-size:1rem;line-height:1.5;height:2.5rem;width:2.5rem}.avatar.avatar-md{font-size:.875rem;line-height:1.4285714285714286;height:2rem;width:2rem}.avatar.avatar-sm{font-size:.75rem;line-height:1.3333333333333333;height:1.5rem;width:1.5rem}.avatar.avatar-xxl{font-size:1.125rem;line-height:1.5555555555555556;height:3.5rem;width:3.5rem}.prose{color:var(--tw-prose-body);max-width:65ch}.prose :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-lead);font-size:1.25em;line-height:1.6;margin-top:1.2em;margin-bottom:1.2em}.prose :where(a):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-links);text-decoration:underline;font-weight:500}.prose :where(strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-bold);font-weight:600}.prose :where(a strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(blockquote strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(thead th strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal;margin-top:1.25em;margin-bottom:1.25em;padding-left:1.625em}.prose :where(ol[type=A]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=A s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=I]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type=I s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type="1"]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal}.prose :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:disc;margin-top:1.25em;margin-bottom:1.25em;padding-left:1.625em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{font-weight:400;color:var(--tw-prose-counters)}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{color:var(--tw-prose-bullets)}.prose :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.25em}.prose :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-top:3em;margin-bottom:3em}.prose :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-style:italic;color:var(--tw-prose-quotes);border-left-width:.25rem;border-left-color:var(--tw-prose-quote-borders);quotes:"“""”""‘""’";margin-top:1.6em;margin-bottom:1.6em;padding-left:1em}.prose :where(blockquote p:first-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:open-quote}.prose :where(blockquote p:last-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:close-quote}.prose :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:800;font-size:2.25em;margin-top:0;margin-bottom:.8888889em;line-height:1.1111111}.prose :where(h1 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:900;color:inherit}.prose :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:700;font-size:1.5em;margin-top:2em;margin-bottom:1em;line-height:1.3333333}.prose :where(h2 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:800;color:inherit}.prose :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;font-size:1.25em;margin-top:1.6em;margin-bottom:.6em;line-height:1.6}.prose :where(h3 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}.prose :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.5em;margin-bottom:.5em;line-height:1.5}.prose :where(h4 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}.prose :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){display:block;margin-top:2em;margin-bottom:2em}.prose :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-family:inherit;color:var(--tw-prose-kbd);box-shadow:0 0 0 1px rgb(var(--tw-prose-kbd-shadows) / 10%),0 3px rgb(var(--tw-prose-kbd-shadows) / 10%);font-size:.875em;border-radius:.3125rem;padding:.1875em .375em}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-code);font-weight:600;font-size:.875em}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:"`"}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:"`"}.prose :where(a code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h1 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.875em}.prose :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.9em}.prose :where(h4 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(blockquote code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(thead th code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-pre-code);background-color:var(--tw-prose-pre-bg);overflow-x:auto;font-weight:400;font-size:.875em;line-height:1.7142857;margin-top:1.7142857em;margin-bottom:1.7142857em;border-radius:.375rem;padding:.8571429em 1.1428571em}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)){background-color:transparent;border-width:0;border-radius:0;padding:0;font-weight:inherit;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:none}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:none}.prose :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){width:100%;table-layout:auto;text-align:left;margin-top:2em;margin-bottom:2em;font-size:.875em;line-height:1.7142857}.prose :where(thead):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-th-borders)}.prose :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;vertical-align:bottom;padding-right:.5714286em;padding-bottom:.5714286em;padding-left:.5714286em}.prose :where(tbody tr):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-td-borders)}.prose :where(tbody tr:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:0}.prose :where(tbody td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:baseline}.prose :where(tfoot):not(:where([class~=not-prose],[class~=not-prose] *)){border-top-width:1px;border-top-color:var(--tw-prose-th-borders)}.prose :where(tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:top}.prose :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-captions);font-size:.875em;line-height:1.4285714;margin-top:.8571429em}.prose{--tw-prose-body: #374151;--tw-prose-headings: #111827;--tw-prose-lead: #4b5563;--tw-prose-links: #111827;--tw-prose-bold: #111827;--tw-prose-counters: #6b7280;--tw-prose-bullets: #d1d5db;--tw-prose-hr: #e5e7eb;--tw-prose-quotes: #111827;--tw-prose-quote-borders: #e5e7eb;--tw-prose-captions: #6b7280;--tw-prose-kbd: #111827;--tw-prose-kbd-shadows: 17 24 39;--tw-prose-code: #111827;--tw-prose-pre-code: #e5e7eb;--tw-prose-pre-bg: #1f2937;--tw-prose-th-borders: #d1d5db;--tw-prose-td-borders: #e5e7eb;--tw-prose-invert-body: #d1d5db;--tw-prose-invert-headings: #fff;--tw-prose-invert-lead: #9ca3af;--tw-prose-invert-links: #fff;--tw-prose-invert-bold: #fff;--tw-prose-invert-counters: #9ca3af;--tw-prose-invert-bullets: #4b5563;--tw-prose-invert-hr: #374151;--tw-prose-invert-quotes: #f3f4f6;--tw-prose-invert-quote-borders: #374151;--tw-prose-invert-captions: #9ca3af;--tw-prose-invert-kbd: #fff;--tw-prose-invert-kbd-shadows: 255 255 255;--tw-prose-invert-code: #fff;--tw-prose-invert-pre-code: #d1d5db;--tw-prose-invert-pre-bg: rgb(0 0 0 / 50%);--tw-prose-invert-th-borders: #4b5563;--tw-prose-invert-td-borders: #374151;font-size:1rem;line-height:1.75}.prose :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;margin-bottom:.5em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-left:.375em}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-left:.375em}.prose :where(.prose>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(.prose>ul>li>*:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ul>li>*:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(.prose>ol>li>*:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ol>li>*:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;padding-left:1.625em}.prose :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-left:0}.prose :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-right:0}.prose :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding:.5714286em}.prose :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-left:0}.prose :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-right:0}.prose :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(.prose>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(.prose>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.prose-sm{font-size:.875rem;line-height:1.7142857}.prose-sm :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em}.prose-sm :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.2857143em;line-height:1.5555556;margin-top:.8888889em;margin-bottom:.8888889em}.prose-sm :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em;margin-bottom:1.3333333em;padding-left:1.1111111em}.prose-sm :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:2.1428571em;margin-top:0;margin-bottom:.8em;line-height:1.2}.prose-sm :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.4285714em;margin-top:1.6em;margin-bottom:.8em;line-height:1.4}.prose-sm :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.2857143em;margin-top:1.5555556em;margin-bottom:.4444444em;line-height:1.5555556}.prose-sm :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.4285714em;margin-bottom:.5714286em;line-height:1.4285714}.prose-sm :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose-sm :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;border-radius:.3125rem;padding:.1428571em .3571429em}.prose-sm :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em}.prose-sm :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.9em}.prose-sm :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8888889em}.prose-sm :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.6666667;margin-top:1.6666667em;margin-bottom:1.6666667em;border-radius:.25rem;padding:.6666667em 1em}.prose-sm :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em;padding-left:1.5714286em}.prose-sm :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em;padding-left:1.5714286em}.prose-sm :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.2857143em;margin-bottom:.2857143em}.prose-sm :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-left:.4285714em}.prose-sm :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-left:.4285714em}.prose-sm :where(.prose-sm>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5714286em;margin-bottom:.5714286em}.prose-sm :where(.prose-sm>ul>li>*:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(.prose-sm>ul>li>*:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.1428571em}.prose-sm :where(.prose-sm>ol>li>*:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(.prose-sm>ol>li>*:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.1428571em}.prose-sm :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5714286em;margin-bottom:.5714286em}.prose-sm :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em}.prose-sm :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.2857143em;padding-left:1.5714286em}.prose-sm :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2.8571429em;margin-bottom:2.8571429em}.prose-sm :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.5}.prose-sm :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){padding-right:1em;padding-bottom:.6666667em;padding-left:1em}.prose-sm :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-left:0}.prose-sm :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-right:0}.prose-sm :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding:.6666667em 1em}.prose-sm :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-left:0}.prose-sm :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-right:0}.prose-sm :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose-sm :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.3333333;margin-top:.6666667em}.prose-sm :where(.prose-sm>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(.prose-sm>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.prose-neutral{--tw-prose-body: #404040;--tw-prose-headings: #171717;--tw-prose-lead: #525252;--tw-prose-links: #171717;--tw-prose-bold: #171717;--tw-prose-counters: #737373;--tw-prose-bullets: #d4d4d4;--tw-prose-hr: #e5e5e5;--tw-prose-quotes: #171717;--tw-prose-quote-borders: #e5e5e5;--tw-prose-captions: #737373;--tw-prose-kbd: #171717;--tw-prose-kbd-shadows: 23 23 23;--tw-prose-code: #171717;--tw-prose-pre-code: #e5e5e5;--tw-prose-pre-bg: #262626;--tw-prose-th-borders: #d4d4d4;--tw-prose-td-borders: #e5e5e5;--tw-prose-invert-body: #d4d4d4;--tw-prose-invert-headings: #fff;--tw-prose-invert-lead: #a3a3a3;--tw-prose-invert-links: #fff;--tw-prose-invert-bold: #fff;--tw-prose-invert-counters: #a3a3a3;--tw-prose-invert-bullets: #525252;--tw-prose-invert-hr: #404040;--tw-prose-invert-quotes: #f5f5f5;--tw-prose-invert-quote-borders: #404040;--tw-prose-invert-captions: #a3a3a3;--tw-prose-invert-kbd: #fff;--tw-prose-invert-kbd-shadows: 255 255 255;--tw-prose-invert-code: #fff;--tw-prose-invert-pre-code: #d4d4d4;--tw-prose-invert-pre-bg: rgb(0 0 0 / 50%);--tw-prose-invert-th-borders: #525252;--tw-prose-invert-td-borders: #404040}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.left-\\[-3\\.25rem\\]{left:-3.25rem}.top-0{top:0}.top-\\[3\\%\\]{top:3%}.inline{display:inline}.flex{display:flex}.table{display:table}.h-6{height:1.5rem}.h-\\[1\\.421875rem\\]{height:1.421875rem}.w-6{width:1.5rem}.max-w-none{max-width:none}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.flex-col{flex-direction:column}.items-center{align-items:center}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-4{gap:1rem}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-Light>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:hsl(40 3% 90% / var(--tw-divide-opacity))}.overflow-hidden{overflow:hidden}.rounded-lg{border-radius:.5rem}.border{border-width:1px}.border-Light{--tw-border-opacity: 1;border-color:hsl(40 3% 90% / var(--tw-border-opacity))}.bg-Dark-Blue-Main-18{--tw-bg-opacity: 1;background-color:hsl(223 67% 18% / var(--tw-bg-opacity))}.bg-Energy-Red-95{--tw-bg-opacity: 1;background-color:hsl(357 83% 95% / var(--tw-bg-opacity))}.bg-Eucalyptus-85{--tw-bg-opacity: 1;background-color:hsl(178 80% 85% / var(--tw-bg-opacity))}.bg-Land-Green-95{--tw-bg-opacity: 1;background-color:hsl(114 49% 95% / var(--tw-bg-opacity))}.bg-Lavender-90{--tw-bg-opacity: 1;background-color:hsl(232 58% 90% / var(--tw-bg-opacity))}.bg-Sea-Blue-Main-28{--tw-bg-opacity: 1;background-color:hsl(218 100% 28% / var(--tw-bg-opacity))}.bg-Sunflower-85{--tw-bg-opacity: 1;background-color:hsl(55 100% 85% / var(--tw-bg-opacity))}.bg-Terracotta-85{--tw-bg-opacity: 1;background-color:hsl(34 100% 85% / var(--tw-bg-opacity))}.bg-White{--tw-bg-opacity: 1;background-color:hsl(40 3% 100% / var(--tw-bg-opacity))}.p-5{padding:1.25rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.pb-2{padding-bottom:.5rem}.pt-2{padding-top:.5rem}.text-\\[0\\.875rem\\]{font-size:.875rem}.text-Energy-Red-45{--tw-text-opacity: 1;color:hsl(357 83% 45% / var(--tw-text-opacity))}.text-Energy-Red-Main-54{--tw-text-opacity: 1;color:hsl(357 83% 54% / var(--tw-text-opacity))}.text-Eucalyptus-20{--tw-text-opacity: 1;color:hsl(178 80% 20% / var(--tw-text-opacity))}.text-Land-Green-30{--tw-text-opacity: 1;color:hsl(114 49% 30% / var(--tw-text-opacity))}.text-Land-Green-Main-41{--tw-text-opacity: 1;color:hsl(114 49% 41% / var(--tw-text-opacity))}.text-Lavender-50{--tw-text-opacity: 1;color:hsl(232 58% 50% / var(--tw-text-opacity))}.text-Sandstone-Main-79{--tw-text-opacity: 1;color:hsl(40 3% 79% / var(--tw-text-opacity))}.text-Sea-Blue-Main-28{--tw-text-opacity: 1;color:hsl(218 100% 28% / var(--tw-text-opacity))}.text-Sky-Blue-95{--tw-text-opacity: 1;color:hsl(196 74% 95% / var(--tw-text-opacity))}.text-Sunflower-20{--tw-text-opacity: 1;color:hsl(55 100% 20% / var(--tw-text-opacity))}.text-Terracotta-20{--tw-text-opacity: 1;color:hsl(34 100% 20% / var(--tw-text-opacity))}.text-Terracotta-Main-35{--tw-text-opacity: 1;color:hsl(34 100% 35% / var(--tw-text-opacity))}.text-White{--tw-text-opacity: 1;color:hsl(40 3% 100% / var(--tw-text-opacity))}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.title{font-family:DNV Display;font-size:4rem;font-style:normal;font-weight:400;line-height:1.15625}@media only screen and (max-width: 992px){.title{font-size:2.625rem;line-height:1.2380952380952381}}.title{color:var(--Dark-Blue-Main-18, hsl(223, 67%, 18%))}:is(.dark .title){color:var(--White, hsl(40 3% 100%))}.first\\:pt-0:first-child{padding-top:0}.last\\:pb-0:last-child{padding-bottom:0}.prose-code\\:text-\\[1em\\] :is(:where(code):not(:where([class~=not-prose],[class~=not-prose] *))){font-size:1em}', Pi = "pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#ddd;background:#303030}.hljs-keyword,.hljs-selector-tag,.hljs-literal,.hljs-section,.hljs-link{color:#fff}.hljs-string,.hljs-title,.hljs-name,.hljs-type,.hljs-attribute,.hljs-symbol,.hljs-bullet,.hljs-built_in,.hljs-addition,.hljs-variable,.hljs-template-tag,.hljs-template-variable{color:#d88}.hljs-comment,.hljs-quote,.hljs-deletion,.hljs-meta{color:#979797}.hljs-keyword,.hljs-selector-tag,.hljs-literal,.hljs-title,.hljs-section,.hljs-doctag,.hljs-type,.hljs-name,.hljs-strong{font-weight:700}.hljs-emphasis{font-style:italic}";
4043
+ class qi {
4044
+ constructor(n) {
4045
+ I(this, "node");
4046
+ I(this, "userId");
4047
+ I(this, "avatarLetters");
4048
+ I(this, "url");
4049
+ I(this, "messagesNode");
4050
+ I(this, "messages", []);
4051
+ I(this, "statusNode");
4052
+ I(this, "_canSubmit", !0);
4053
+ I(this, "_generatingNode");
4054
+ I(this, "_functionIdToParentFunctionId", {});
4055
+ I(this, "_groupByFunctionId", {});
4056
+ this.userId = n.userId, this.avatarLetters = n.avatarLetters, this.url = n.url, this.node = /* @__PURE__ */ R("div", null);
4057
+ const t = document.createElement("style");
4058
+ t.textContent = Oi + `
4059
+ ` + Pi;
4060
+ const r = this.node.attachShadow({ mode: "closed" });
4061
+ r.appendChild(t), r.appendChild(
4062
+ /* @__PURE__ */ R("div", { class: "flex flex-col gap-4" }, this.messagesNode = /* @__PURE__ */ R("ol", { class: "flex flex-col gap-4" }), this.statusNode = /* @__PURE__ */ R("div", { class: "select-none text-[0.875rem] h-[1.421875rem] overflow-hidden" }))
4063
+ );
4064
+ let i = new Ue("progress", "Hello");
4065
+ this.messagesNode.appendChild(i.node), i = new Ue("done", "sad asdsa asd sad "), this.messagesNode.appendChild(i.node);
4066
+ }
4067
+ get canSubmit() {
4068
+ return this._canSubmit;
4069
+ }
4070
+ get generatingNode() {
4071
+ return this._generatingNode || (this._generatingNode = /* @__PURE__ */ R("div", { class: "flex gap-2 items-center text-seaBlue-80" }, /* @__PURE__ */ R(Et, { size: He.ExtraSmall }), "Generating response…"));
4072
+ }
4073
+ setGeneratingStatus() {
4074
+ const n = this.generatingNode, t = this.statusNode.firstChild;
4075
+ t ? t !== n && t.replaceWith(this.generatingNode) : this.statusNode.appendChild(this.generatingNode);
4076
+ }
4077
+ clearStatus() {
4078
+ var n;
4079
+ (n = this.statusNode.firstChild) == null || n.remove();
4080
+ }
4081
+ async submitMessageAsync(n) {
4082
+ if (!this._canSubmit)
4083
+ throw new Error("Cannot submit message because another message is currently being processed");
4084
+ this._canSubmit = !1;
4085
+ try {
4086
+ this.setGeneratingStatus();
4087
+ const t = new Bi(this, n, this.userId, this.avatarLetters);
4088
+ this.messages.push(t), this.messagesNode.appendChild(t.node), this.setGeneratingStatus();
4089
+ const r = new Ni();
4090
+ await r.initializeConnectionAsync(
4091
+ this.url,
4092
+ this.messages.map((s) => s.toDto())
4093
+ );
4094
+ let i;
4095
+ for await (const s of r.readMessagesAsync())
4096
+ switch (s.type) {
4097
+ case q.Init:
4098
+ i = null;
4099
+ break;
4100
+ case q.AppendMessage:
4101
+ i instanceof xt || (i = new xt(
4102
+ this,
4103
+ void 0,
4104
+ /* @__PURE__ */ R(un, { class: "absolute top-0 left-[-3.25rem] shadow-md" })
4105
+ ), this.messages.push(i), this.messagesNode.appendChild(i.node));
4106
+ const o = i.message;
4107
+ i.updateMessage(
4108
+ o ? o + s.appendMessageMarkdown : s.appendMessageMarkdown
4109
+ );
4110
+ break;
4111
+ case q.ToolCallUpdate: {
4112
+ s.toolCallFunctionId && (this._functionIdToParentFunctionId[s.toolCallFunctionId] = s.parentFunctionId), i instanceof Re || (i = new Re(), this.messagesNode.appendChild(i.node)), s.toolCallFunctionId && (this._groupByFunctionId[s.toolCallFunctionId] = i), i.aggregate(
4113
+ //msg.parentFunctionId,
4114
+ s.toolCallFunctionId,
4115
+ s.toolCallUpdateIndex,
4116
+ s.toolCallUpdateName,
4117
+ s.toolCallUpdateArguments
4118
+ );
4119
+ break;
4120
+ }
4121
+ case q.ToolCallStatus: {
4122
+ const a = this._groupByFunctionId[s.toolCallFunctionId];
4123
+ if (a)
4124
+ a.status(
4125
+ s.toolCallFunctionId,
4126
+ s.toolCallStatusIndex,
4127
+ s.toolCallStatusProgress,
4128
+ s.toolCallIcon,
4129
+ s.toolCallMarkdown
4130
+ );
4131
+ else
4132
+ debugger;
4133
+ break;
4134
+ }
4135
+ case q.ToolCallLog: {
4136
+ const a = this._groupByFunctionId[s.toolCallFunctionId];
4137
+ if (a)
4138
+ a.log(s.toolCallFunctionId, s.toolCallLogLevel, s.toolCallTime, s.toolCallMarkdown);
4139
+ else
4140
+ debugger;
4141
+ break;
4142
+ }
4143
+ case q.Loop:
4144
+ i instanceof Re && i.completeAggregation(), i = null;
4145
+ break;
4146
+ case q.ToolCallDone: {
4147
+ const a = this._groupByFunctionId[s.toolCallFunctionId];
4148
+ if (a)
4149
+ a.done(s.toolCallFunctionId);
4150
+ else
4151
+ debugger;
4152
+ break;
4153
+ }
4154
+ case q.ToolCallError: {
4155
+ const a = this._groupByFunctionId[s.toolCallFunctionId];
4156
+ if (a)
4157
+ a.error(s.toolCallFunctionId);
4158
+ else
4159
+ debugger;
4160
+ break;
4161
+ }
4162
+ default:
4163
+ i = null;
4164
+ break;
4165
+ }
4166
+ } finally {
4167
+ this.clearStatus(), this._canSubmit = !0;
4168
+ }
4169
+ }
4170
+ }
4171
+ export {
4172
+ qi as AIChat
4173
+ };