@brainbase-labs/chat-widget 0.1.14 → 0.1.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { useState as pe, useRef as Je, useEffect as Ge, useCallback as ge, useMemo as xn } from "react";
2
- import { jsxs as $, jsx as k, Fragment as Kt } from "react/jsx-runtime";
1
+ import { useState as he, useRef as Be, useEffect as Ge, useCallback as ge, useMemo as xn } from "react";
2
+ import { jsxs as H, jsx as k, Fragment as Kt } from "react/jsx-runtime";
3
3
  const Hn = "bb-chat-";
4
4
  function Hr(e) {
5
5
  try {
@@ -33,180 +33,199 @@ function Vr(e) {
33
33
  onSessionEnd: l,
34
34
  onMessage: o,
35
35
  onError: a
36
- } = e, [c, s] = pe([]), [u, p] = pe([]), [m, h] = pe(!1), [C, E] = pe(null), [S, y] = pe(null), N = Je(0), T = Je(!1);
36
+ } = e, [c, s] = he([]), [u, p] = he([]), [m, h] = he(!1), [C, E] = he(null), [I, y] = he(null), A = Be(0), v = Be(!1), R = Be({});
37
37
  Ge(() => {
38
- if (T.current) return;
39
- T.current = !0;
40
- const A = Hr(n.embedId);
41
- A && A.status === "active" && (y(A.sessionId), s(A.messages), p(A.toolCalls), N.current = A.startTime);
38
+ if (v.current) return;
39
+ v.current = !0;
40
+ const _ = Hr(n.embedId);
41
+ _ && _.status === "active" && (y(_.sessionId), s(_.messages), p(_.toolCalls), A.current = _.startTime);
42
42
  }, [n.embedId]), Ge(() => {
43
- S && c.length > 0 && st(n.embedId, {
44
- sessionId: S,
43
+ I && c.length > 0 && st(n.embedId, {
44
+ sessionId: I,
45
45
  deploymentId: n.deploymentId,
46
46
  workerId: n.workerId,
47
47
  flowId: n.flowId,
48
- startTime: N.current,
48
+ startTime: A.current,
49
49
  messages: c,
50
50
  toolCalls: u,
51
51
  status: "active"
52
52
  });
53
- }, [S, c, u, n]);
54
- const H = ge(async () => (N.current = Date.now(), y(null), s([]), p([]), ut(n.embedId), ""), [n.embedId]), j = ge(
55
- (A, L, v) => {
56
- switch (A.type) {
53
+ }, [I, c, u, n]);
54
+ const q = ge(async () => (A.current = Date.now(), y(null), s([]), p([]), ut(n.embedId), ""), [n.embedId]), x = ge((_, z) => {
55
+ s((L) => {
56
+ let b = !1;
57
+ const N = L.map((T) => T.id === _ ? (b = !0, { ...T, content: z, status: "streaming" }) : T);
58
+ return b || N.push({
59
+ id: _,
60
+ role: "assistant",
61
+ content: z,
62
+ timestamp: Date.now(),
63
+ status: "streaming"
64
+ }), N;
65
+ });
66
+ }, []), O = ge(
67
+ (_, z, L) => {
68
+ switch (_.type) {
57
69
  case "session": {
58
- const P = A.data;
59
- P.session_id && (v(P.session_id), P.is_new && (N.current = Date.now(), i == null || i(P.session_id)));
70
+ const b = _.data;
71
+ b.session_id && (L(b.session_id), b.is_new && (A.current = Date.now(), i == null || i(b.session_id)));
60
72
  break;
61
73
  }
62
74
  case "message": {
63
- const P = A.data;
64
- P.content && s(
65
- (I) => I.map(
66
- (x) => x.id === L ? { ...x, content: P.content, status: "streaming" } : x
67
- )
68
- );
75
+ const b = _.data;
76
+ b.content && (R.current[z] = b.content, x(z, b.content));
77
+ break;
78
+ }
79
+ case "chunk": {
80
+ const b = _.data;
81
+ if (b.content) {
82
+ const T = (R.current[z] ?? "") + b.content;
83
+ R.current[z] = T, x(z, T);
84
+ }
69
85
  break;
70
86
  }
71
87
  case "tool_call": {
72
- const P = A.data;
73
- p((I) => {
74
- const x = I.findIndex(
75
- (z) => z.name === P.function && z.status === "pending"
88
+ const b = _.data;
89
+ if (p((N) => {
90
+ const T = N.findIndex(
91
+ (F) => F.name === b.function && F.status === "pending"
76
92
  );
77
- return x !== -1 && P.result !== void 0 ? I.map(
78
- (z, q) => q === x ? { ...z, result: P.result, status: "completed" } : z
79
- ) : x === -1 ? [
80
- ...I,
93
+ return T !== -1 && b.result !== void 0 ? N.map(
94
+ (F, Q) => Q === T ? { ...F, result: b.result, status: "completed" } : F
95
+ ) : T === -1 ? [
96
+ ...N,
81
97
  {
82
98
  id: `tc-${Date.now()}-${Math.random().toString(36).slice(2)}`,
83
- name: P.function,
84
- arguments: P.args ?? {},
99
+ name: b.function,
100
+ arguments: b.args ?? {},
85
101
  status: "pending",
86
102
  timestamp: Date.now()
87
103
  }
88
- ] : I;
89
- }), P.content && s(
90
- (I) => I.map(
91
- (x) => x.id === L ? { ...x, content: P.content, status: "streaming" } : x
92
- )
93
- );
104
+ ] : N;
105
+ }), b.content) {
106
+ const N = b.content;
107
+ R.current[z] = N, x(z, N);
108
+ }
94
109
  break;
95
110
  }
96
111
  case "waiting":
97
112
  break;
98
113
  case "done": {
99
114
  s(
100
- (P) => P.map((I) => I.id === L ? { ...I, status: "sent" } : I)
101
- );
115
+ (b) => b.map((N) => N.id === z ? { ...N, status: "sent" } : N)
116
+ ), delete R.current[z];
102
117
  break;
103
118
  }
104
119
  case "completed": {
105
- s(
106
- (P) => P.map((I) => I.id === L ? { ...I, status: "sent" } : I)
107
- ), S && st(n.embedId, {
108
- sessionId: S,
109
- deploymentId: n.deploymentId,
110
- workerId: n.workerId,
111
- flowId: n.flowId,
112
- startTime: N.current,
113
- messages: c,
114
- toolCalls: u,
115
- status: "completed"
116
- });
120
+ s((b) => {
121
+ const N = b.map(
122
+ (T) => T.id === z ? { ...T, status: "sent" } : T
123
+ );
124
+ return I && st(n.embedId, {
125
+ sessionId: I,
126
+ deploymentId: n.deploymentId,
127
+ workerId: n.workerId,
128
+ flowId: n.flowId,
129
+ startTime: A.current,
130
+ messages: N,
131
+ toolCalls: [],
132
+ // Tool calls stored separately
133
+ status: "completed"
134
+ }), N;
135
+ }), delete R.current[z];
117
136
  break;
118
137
  }
119
138
  case "error": {
120
- const P = A.data;
139
+ const b = _.data;
121
140
  s(
122
- (I) => I.map(
123
- (x) => x.id === L ? {
124
- ...x,
141
+ (N) => N.map(
142
+ (T) => T.id === z ? {
143
+ ...T,
125
144
  status: "error",
126
- content: P.error ?? "An error occurred"
127
- } : x
145
+ content: b.error ?? "An error occurred"
146
+ } : T
128
147
  )
129
148
  );
130
149
  break;
131
150
  }
132
151
  }
133
152
  },
134
- [n, S, c, u, i]
135
- ), b = ge(
136
- async (A, L, v) => {
137
- const P = A.getReader(), I = new TextDecoder();
138
- let x = "";
153
+ [n, I, i, x]
154
+ ), U = ge(
155
+ async (_, z, L) => {
156
+ const b = _.getReader(), N = new TextDecoder();
157
+ let T = "";
139
158
  try {
140
159
  for (; ; ) {
141
- const { done: z, value: q } = await P.read();
142
- if (z) break;
143
- for (x += I.decode(q, { stream: !0 }); x.includes(`
160
+ const { done: F, value: Q } = await b.read();
161
+ if (F) break;
162
+ T += N.decode(Q, { stream: !0 });
163
+ let f;
164
+ for (; (f = T.indexOf(`
144
165
 
145
- `); ) {
146
- const [Y, J] = x.split(`
147
-
148
- `, 2);
149
- x = J;
150
- for (const f of Y.split(`
166
+ `)) !== -1; ) {
167
+ const le = T.slice(0, f);
168
+ T = T.slice(f + 2);
169
+ for (const ue of le.split(`
151
170
  `))
152
- if (f.startsWith("data: "))
171
+ if (ue.startsWith("data: "))
153
172
  try {
154
- const le = JSON.parse(f.slice(6));
155
- j(le, L, v);
173
+ const d = JSON.parse(ue.slice(6));
174
+ O(d, z, L);
156
175
  } catch {
157
176
  }
158
177
  }
159
178
  }
160
179
  } finally {
161
- P.releaseLock();
180
+ b.releaseLock();
162
181
  }
163
182
  },
164
- [j]
165
- ), F = ge(
166
- async (A) => {
167
- if (!A.trim()) return;
168
- const L = {
183
+ [O]
184
+ ), $ = ge(
185
+ async (_) => {
186
+ if (!_.trim()) return;
187
+ const z = {
169
188
  id: `user-${Date.now()}`,
170
189
  role: "user",
171
- content: A,
190
+ content: _,
172
191
  timestamp: Date.now(),
173
192
  status: "sent"
174
193
  };
175
- s((x) => [...x, L]), o == null || o(L);
176
- const v = `assistant-${Date.now()}`, P = {
177
- id: v,
194
+ s((T) => [...T, z]), o == null || o(z);
195
+ const L = `assistant-${Date.now()}`, b = {
196
+ id: L,
178
197
  role: "assistant",
179
198
  content: "",
180
199
  timestamp: Date.now(),
181
200
  status: "streaming"
182
201
  };
183
- s((x) => [...x, P]), h(!0), E(null);
184
- const I = (x) => {
185
- y(x);
202
+ s((T) => [...T, b]), h(!0), E(null);
203
+ const N = (T) => {
204
+ y(T);
186
205
  };
187
206
  try {
188
207
  if (r) {
189
- const x = t.sendMessage(A);
190
- for await (const z of x)
191
- j(z, v, I);
208
+ const T = t.sendMessage(_);
209
+ for await (const F of T)
210
+ O(F, L, N);
192
211
  } else {
193
- const x = await t.sendMessage({
212
+ const T = await t.sendMessage({
194
213
  embedId: n.embedId,
195
- message: A,
196
- sessionId: S ?? void 0
214
+ message: _,
215
+ sessionId: I ?? void 0
197
216
  });
198
- await b(x, v, I);
217
+ await U(T, L, N);
199
218
  }
200
219
  s(
201
- (x) => x.map(
202
- (z) => z.id === v && z.status === "streaming" ? { ...z, status: "sent" } : z
220
+ (T) => T.map(
221
+ (F) => F.id === L && F.status === "streaming" ? { ...F, status: "sent" } : F
203
222
  )
204
223
  );
205
- } catch (x) {
206
- const z = x instanceof Error ? x : new Error("Failed to send message");
207
- E(z), a == null || a(z), s(
208
- (q) => q.map(
209
- (Y) => Y.id === v ? { ...Y, status: "error", content: "Failed to get response" } : Y
224
+ } catch (T) {
225
+ const F = T instanceof Error ? T : new Error("Failed to send message");
226
+ E(F), a == null || a(F), s(
227
+ (Q) => Q.map(
228
+ (f) => f.id === L ? { ...f, status: "error", content: "Failed to get response" } : f
210
229
  )
211
230
  );
212
231
  } finally {
@@ -214,35 +233,35 @@ function Vr(e) {
214
233
  }
215
234
  },
216
235
  [
217
- S,
236
+ I,
218
237
  t,
219
238
  r,
220
239
  n.embedId,
221
- j,
222
- b,
240
+ O,
241
+ U,
223
242
  o,
224
243
  a
225
244
  ]
226
245
  ), V = ge(async () => {
227
- if (!S) return;
228
- const A = {
229
- sessionId: S,
246
+ if (!I) return;
247
+ const _ = {
248
+ sessionId: I,
230
249
  deploymentId: n.deploymentId,
231
250
  workerId: n.workerId,
232
251
  flowId: n.flowId,
233
- startTime: N.current,
252
+ startTime: A.current,
234
253
  messages: c,
235
254
  toolCalls: u,
236
255
  status: "completed"
237
256
  };
238
- l == null || l(A), ut(n.embedId), y(null), s([]), p([]);
257
+ l == null || l(_), ut(n.embedId), y(null), s([]), p([]);
239
258
  }, [
240
- S,
259
+ I,
241
260
  n,
242
261
  c,
243
262
  u,
244
263
  l
245
- ]), O = ge(() => {
264
+ ]), P = ge(() => {
246
265
  s([]), p([]);
247
266
  }, []);
248
267
  return {
@@ -250,11 +269,11 @@ function Vr(e) {
250
269
  toolCalls: u,
251
270
  isLoading: m,
252
271
  error: C,
253
- sessionId: S,
254
- sendMessage: F,
272
+ sessionId: I,
273
+ sendMessage: $,
255
274
  endSession: V,
256
- clearMessages: O,
257
- startNewSession: H
275
+ clearMessages: P,
276
+ startNewSession: q
258
277
  };
259
278
  }
260
279
  const Qt = "https://chat-embed-deployment.onrender.com";
@@ -356,14 +375,14 @@ const qr = {
356
375
  delay: 1e3
357
376
  }
358
377
  ];
359
- function Ve(e) {
378
+ function Ue(e) {
360
379
  return new Promise((n) => setTimeout(n, e));
361
380
  }
362
381
  function Yr(e, n) {
363
382
  const t = { ...qr, ...e }, r = n ?? Wr, i = `mock-session-${Date.now()}`;
364
383
  return {
365
384
  async getDeploymentConfig(l) {
366
- return await Ve(300), t;
385
+ return await Ue(300), t;
367
386
  },
368
387
  async *sendMessage(l) {
369
388
  yield {
@@ -374,7 +393,7 @@ function Yr(e, n) {
374
393
  const o = r.find(
375
394
  (s) => typeof s.trigger == "string" ? l.toLowerCase().includes(s.trigger.toLowerCase()) : s.trigger.test(l)
376
395
  ) ?? r[r.length - 1];
377
- if (await Ve(o.delay ?? 500), o.toolCalls)
396
+ if (await Ue(o.delay ?? 500), o.toolCalls)
378
397
  for (const s of o.toolCalls)
379
398
  yield {
380
399
  type: "tool_call",
@@ -383,14 +402,14 @@ function Yr(e, n) {
383
402
  args: s.arguments
384
403
  },
385
404
  timestamp: Date.now()
386
- }, await Ve(300), yield {
405
+ }, await Ue(300), yield {
387
406
  type: "tool_call",
388
407
  data: {
389
408
  function: s.name,
390
409
  result: s.result
391
410
  },
392
411
  timestamp: Date.now()
393
- }, await Ve(200);
412
+ }, await Ue(200);
394
413
  const a = o.response.split(" ");
395
414
  let c = "";
396
415
  for (const s of a)
@@ -398,7 +417,7 @@ function Yr(e, n) {
398
417
  type: "message",
399
418
  data: { content: c, role: "assistant" },
400
419
  timestamp: Date.now()
401
- }, await Ve(30 + Math.random() * 40);
420
+ }, await Ue(30 + Math.random() * 40);
402
421
  yield {
403
422
  type: "done",
404
423
  data: { session_id: i },
@@ -411,7 +430,7 @@ const en = ({
411
430
  className: e,
412
431
  color: n = "currentColor",
413
432
  cutoutColor: t = "var(--bb-primary-color)"
414
- }) => /* @__PURE__ */ $(
433
+ }) => /* @__PURE__ */ H(
415
434
  "svg",
416
435
  {
417
436
  className: e,
@@ -490,11 +509,11 @@ const en = ({
490
509
  compact: a = !1
491
510
  }) => {
492
511
  const c = t || "Hello there.", s = r !== void 0 ? r : t ? void 0 : "How can we help?";
493
- return /* @__PURE__ */ $("div", { className: `${G.header} ${a ? G.compact : ""}`, children: [
512
+ return /* @__PURE__ */ H("div", { className: `${G.header} ${a ? G.compact : ""}`, children: [
494
513
  /* @__PURE__ */ k("div", { className: G.headerBackground }),
495
- /* @__PURE__ */ $("div", { className: G.headerContent, children: [
496
- /* @__PURE__ */ $("div", { className: G.topRow, children: [
497
- /* @__PURE__ */ $("div", { className: G.agentInfo, children: [
514
+ /* @__PURE__ */ H("div", { className: G.headerContent, children: [
515
+ /* @__PURE__ */ H("div", { className: G.topRow, children: [
516
+ /* @__PURE__ */ H("div", { className: G.agentInfo, children: [
498
517
  n ? /* @__PURE__ */ k(
499
518
  "img",
500
519
  {
@@ -512,7 +531,7 @@ const en = ({
512
531
  ) }),
513
532
  /* @__PURE__ */ k("span", { className: G.agentName, children: e })
514
533
  ] }),
515
- /* @__PURE__ */ $("div", { className: G.actions, children: [
534
+ /* @__PURE__ */ H("div", { className: G.actions, children: [
516
535
  o && l && /* @__PURE__ */ k(
517
536
  "button",
518
537
  {
@@ -553,7 +572,7 @@ const en = ({
553
572
  )
554
573
  ] })
555
574
  ] }),
556
- !a && /* @__PURE__ */ $("div", { className: G.welcomeText, children: [
575
+ !a && /* @__PURE__ */ H("div", { className: G.welcomeText, children: [
557
576
  /* @__PURE__ */ k("h1", { className: G.title, children: c }),
558
577
  s && /* @__PURE__ */ k("p", { className: G.subtitle, children: s })
559
578
  ] })
@@ -630,16 +649,16 @@ ie.prototype.property = "";
630
649
  ie.prototype.spaceSeparated = !1;
631
650
  ie.prototype.space = void 0;
632
651
  let gi = 0;
633
- const B = Le(), Q = Le(), zn = Le(), w = Le(), X = Le(), Be = Le(), ae = Le();
652
+ const B = Le(), Z = Le(), zn = Le(), w = Le(), X = Le(), Oe = Le(), ae = Le();
634
653
  function Le() {
635
654
  return 2 ** ++gi;
636
655
  }
637
656
  const Mn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
638
657
  __proto__: null,
639
658
  boolean: B,
640
- booleanish: Q,
659
+ booleanish: Z,
641
660
  commaOrSpaceSeparated: ae,
642
- commaSeparated: Be,
661
+ commaSeparated: Oe,
643
662
  number: w,
644
663
  overloadedBoolean: zn,
645
664
  spaceSeparated: X
@@ -674,7 +693,7 @@ Vn.prototype.defined = !0;
674
693
  function ht(e, n, t) {
675
694
  t && (e[n] = t);
676
695
  }
677
- function Fe(e) {
696
+ function Re(e) {
678
697
  const n = {}, t = {};
679
698
  for (const [r, i] of Object.entries(e.properties)) {
680
699
  const l = new Vn(
@@ -687,13 +706,13 @@ function Fe(e) {
687
706
  }
688
707
  return new tn(n, t, e.space);
689
708
  }
690
- const Jt = Fe({
709
+ const Jt = Re({
691
710
  properties: {
692
711
  ariaActiveDescendant: null,
693
- ariaAtomic: Q,
712
+ ariaAtomic: Z,
694
713
  ariaAutoComplete: null,
695
- ariaBusy: Q,
696
- ariaChecked: Q,
714
+ ariaBusy: Z,
715
+ ariaChecked: Z,
697
716
  ariaColCount: w,
698
717
  ariaColIndex: w,
699
718
  ariaColSpan: w,
@@ -701,36 +720,36 @@ const Jt = Fe({
701
720
  ariaCurrent: null,
702
721
  ariaDescribedBy: X,
703
722
  ariaDetails: null,
704
- ariaDisabled: Q,
723
+ ariaDisabled: Z,
705
724
  ariaDropEffect: X,
706
725
  ariaErrorMessage: null,
707
- ariaExpanded: Q,
726
+ ariaExpanded: Z,
708
727
  ariaFlowTo: X,
709
- ariaGrabbed: Q,
728
+ ariaGrabbed: Z,
710
729
  ariaHasPopup: null,
711
- ariaHidden: Q,
730
+ ariaHidden: Z,
712
731
  ariaInvalid: null,
713
732
  ariaKeyShortcuts: null,
714
733
  ariaLabel: null,
715
734
  ariaLabelledBy: X,
716
735
  ariaLevel: w,
717
736
  ariaLive: null,
718
- ariaModal: Q,
719
- ariaMultiLine: Q,
720
- ariaMultiSelectable: Q,
737
+ ariaModal: Z,
738
+ ariaMultiLine: Z,
739
+ ariaMultiSelectable: Z,
721
740
  ariaOrientation: null,
722
741
  ariaOwns: X,
723
742
  ariaPlaceholder: null,
724
743
  ariaPosInSet: w,
725
- ariaPressed: Q,
726
- ariaReadOnly: Q,
744
+ ariaPressed: Z,
745
+ ariaReadOnly: Z,
727
746
  ariaRelevant: null,
728
- ariaRequired: Q,
747
+ ariaRequired: Z,
729
748
  ariaRoleDescription: X,
730
749
  ariaRowCount: w,
731
750
  ariaRowIndex: w,
732
751
  ariaRowSpan: w,
733
- ariaSelected: Q,
752
+ ariaSelected: Z,
734
753
  ariaSetSize: w,
735
754
  ariaSort: null,
736
755
  ariaValueMax: w,
@@ -749,7 +768,7 @@ function Gt(e, n) {
749
768
  function er(e, n) {
750
769
  return Gt(e, n.toLowerCase());
751
770
  }
752
- const yi = Fe({
771
+ const yi = Re({
753
772
  attributes: {
754
773
  acceptcharset: "accept-charset",
755
774
  classname: "class",
@@ -760,7 +779,7 @@ const yi = Fe({
760
779
  properties: {
761
780
  // Standard Properties.
762
781
  abbr: null,
763
- accept: Be,
782
+ accept: Oe,
764
783
  acceptCharset: X,
765
784
  accessKey: X,
766
785
  action: null,
@@ -784,10 +803,10 @@ const yi = Fe({
784
803
  cols: w,
785
804
  colSpan: null,
786
805
  content: null,
787
- contentEditable: Q,
806
+ contentEditable: Z,
788
807
  controls: B,
789
808
  controlsList: X,
790
- coords: w | Be,
809
+ coords: w | Oe,
791
810
  crossOrigin: null,
792
811
  data: null,
793
812
  dateTime: null,
@@ -798,7 +817,7 @@ const yi = Fe({
798
817
  dirName: null,
799
818
  disabled: B,
800
819
  download: zn,
801
- draggable: Q,
820
+ draggable: Z,
802
821
  encType: null,
803
822
  enterKeyHint: null,
804
823
  fetchPriority: null,
@@ -969,7 +988,7 @@ const yi = Fe({
969
988
  sizes: null,
970
989
  slot: null,
971
990
  span: w,
972
- spellCheck: Q,
991
+ spellCheck: Z,
973
992
  src: null,
974
993
  srcDoc: null,
975
994
  srcLang: null,
@@ -984,7 +1003,7 @@ const yi = Fe({
984
1003
  type: null,
985
1004
  typeMustMatch: B,
986
1005
  useMap: null,
987
- value: Q,
1006
+ value: Z,
988
1007
  width: w,
989
1008
  wrap: null,
990
1009
  writingSuggestions: null,
@@ -1076,7 +1095,7 @@ const yi = Fe({
1076
1095
  // `<table>`
1077
1096
  scheme: null,
1078
1097
  // `<meta>`
1079
- scrolling: Q,
1098
+ scrolling: Z,
1080
1099
  // `<frame>`. Use overflow in the child context
1081
1100
  standby: null,
1082
1101
  // `<object>`
@@ -1110,7 +1129,7 @@ const yi = Fe({
1110
1129
  },
1111
1130
  space: "html",
1112
1131
  transform: er
1113
- }), xi = Fe({
1132
+ }), xi = Re({
1114
1133
  attributes: {
1115
1134
  accentHeight: "accent-height",
1116
1135
  alignmentBaseline: "alignment-baseline",
@@ -1369,9 +1388,9 @@ const yi = Fe({
1369
1388
  from: null,
1370
1389
  fx: null,
1371
1390
  fy: null,
1372
- g1: Be,
1373
- g2: Be,
1374
- glyphName: Be,
1391
+ g1: Oe,
1392
+ g2: Oe,
1393
+ glyphName: Oe,
1375
1394
  glyphOrientationHorizontal: null,
1376
1395
  glyphOrientationVertical: null,
1377
1396
  glyphRef: null,
@@ -1669,7 +1688,7 @@ const yi = Fe({
1669
1688
  },
1670
1689
  space: "svg",
1671
1690
  transform: Gt
1672
- }), nr = Fe({
1691
+ }), nr = Re({
1673
1692
  properties: {
1674
1693
  xLinkActuate: null,
1675
1694
  xLinkArcRole: null,
@@ -1683,12 +1702,12 @@ const yi = Fe({
1683
1702
  transform(e, n) {
1684
1703
  return "xlink:" + n.slice(5).toLowerCase();
1685
1704
  }
1686
- }), tr = Fe({
1705
+ }), tr = Re({
1687
1706
  attributes: { xmlnsxlink: "xmlns:xlink" },
1688
1707
  properties: { xmlnsXLink: null, xmlns: null },
1689
1708
  space: "xmlns",
1690
1709
  transform: er
1691
- }), rr = Fe({
1710
+ }), rr = Re({
1692
1711
  properties: { xmlBase: null, xmlLang: null, xmlSpace: null },
1693
1712
  space: "xml",
1694
1713
  transform(e, n) {
@@ -1752,87 +1771,87 @@ function vi() {
1752
1771
  dt = 1;
1753
1772
  var e = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g, n = /\n/g, t = /^\s*/, r = /^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/, i = /^:\s*/, l = /^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/, o = /^[;\s]*/, a = /^\s+|\s+$/g, c = `
1754
1773
  `, s = "/", u = "*", p = "", m = "comment", h = "declaration";
1755
- function C(S, y) {
1756
- if (typeof S != "string")
1774
+ function C(I, y) {
1775
+ if (typeof I != "string")
1757
1776
  throw new TypeError("First argument must be a string");
1758
- if (!S) return [];
1777
+ if (!I) return [];
1759
1778
  y = y || {};
1760
- var N = 1, T = 1;
1761
- function H(I) {
1762
- var x = I.match(n);
1763
- x && (N += x.length);
1764
- var z = I.lastIndexOf(c);
1765
- T = ~z ? I.length - z : T + I.length;
1779
+ var A = 1, v = 1;
1780
+ function R(L) {
1781
+ var b = L.match(n);
1782
+ b && (A += b.length);
1783
+ var N = L.lastIndexOf(c);
1784
+ v = ~N ? L.length - N : v + L.length;
1766
1785
  }
1767
- function j() {
1768
- var I = { line: N, column: T };
1769
- return function(x) {
1770
- return x.position = new b(I), O(), x;
1786
+ function q() {
1787
+ var L = { line: A, column: v };
1788
+ return function(b) {
1789
+ return b.position = new x(L), $(), b;
1771
1790
  };
1772
1791
  }
1773
- function b(I) {
1774
- this.start = I, this.end = { line: N, column: T }, this.source = y.source;
1792
+ function x(L) {
1793
+ this.start = L, this.end = { line: A, column: v }, this.source = y.source;
1775
1794
  }
1776
- b.prototype.content = S;
1777
- function F(I) {
1778
- var x = new Error(
1779
- y.source + ":" + N + ":" + T + ": " + I
1795
+ x.prototype.content = I;
1796
+ function O(L) {
1797
+ var b = new Error(
1798
+ y.source + ":" + A + ":" + v + ": " + L
1780
1799
  );
1781
- if (x.reason = I, x.filename = y.source, x.line = N, x.column = T, x.source = S, !y.silent) throw x;
1800
+ if (b.reason = L, b.filename = y.source, b.line = A, b.column = v, b.source = I, !y.silent) throw b;
1782
1801
  }
1783
- function V(I) {
1784
- var x = I.exec(S);
1785
- if (x) {
1786
- var z = x[0];
1787
- return H(z), S = S.slice(z.length), x;
1802
+ function U(L) {
1803
+ var b = L.exec(I);
1804
+ if (b) {
1805
+ var N = b[0];
1806
+ return R(N), I = I.slice(N.length), b;
1788
1807
  }
1789
1808
  }
1790
- function O() {
1791
- V(t);
1809
+ function $() {
1810
+ U(t);
1792
1811
  }
1793
- function A(I) {
1794
- var x;
1795
- for (I = I || []; x = L(); )
1796
- x !== !1 && I.push(x);
1797
- return I;
1812
+ function V(L) {
1813
+ var b;
1814
+ for (L = L || []; b = P(); )
1815
+ b !== !1 && L.push(b);
1816
+ return L;
1798
1817
  }
1799
- function L() {
1800
- var I = j();
1801
- if (!(s != S.charAt(0) || u != S.charAt(1))) {
1802
- for (var x = 2; p != S.charAt(x) && (u != S.charAt(x) || s != S.charAt(x + 1)); )
1803
- ++x;
1804
- if (x += 2, p === S.charAt(x - 1))
1805
- return F("End of comment missing");
1806
- var z = S.slice(2, x - 2);
1807
- return T += 2, H(z), S = S.slice(x), T += 2, I({
1818
+ function P() {
1819
+ var L = q();
1820
+ if (!(s != I.charAt(0) || u != I.charAt(1))) {
1821
+ for (var b = 2; p != I.charAt(b) && (u != I.charAt(b) || s != I.charAt(b + 1)); )
1822
+ ++b;
1823
+ if (b += 2, p === I.charAt(b - 1))
1824
+ return O("End of comment missing");
1825
+ var N = I.slice(2, b - 2);
1826
+ return v += 2, R(N), I = I.slice(b), v += 2, L({
1808
1827
  type: m,
1809
- comment: z
1828
+ comment: N
1810
1829
  });
1811
1830
  }
1812
1831
  }
1813
- function v() {
1814
- var I = j(), x = V(r);
1815
- if (x) {
1816
- if (L(), !V(i)) return F("property missing ':'");
1817
- var z = V(l), q = I({
1832
+ function _() {
1833
+ var L = q(), b = U(r);
1834
+ if (b) {
1835
+ if (P(), !U(i)) return O("property missing ':'");
1836
+ var N = U(l), T = L({
1818
1837
  type: h,
1819
- property: E(x[0].replace(e, p)),
1820
- value: z ? E(z[0].replace(e, p)) : p
1838
+ property: E(b[0].replace(e, p)),
1839
+ value: N ? E(N[0].replace(e, p)) : p
1821
1840
  });
1822
- return V(o), q;
1841
+ return U(o), T;
1823
1842
  }
1824
1843
  }
1825
- function P() {
1826
- var I = [];
1827
- A(I);
1828
- for (var x; x = v(); )
1829
- x !== !1 && (I.push(x), A(I));
1830
- return I;
1844
+ function z() {
1845
+ var L = [];
1846
+ V(L);
1847
+ for (var b; b = _(); )
1848
+ b !== !1 && (L.push(b), V(L));
1849
+ return L;
1831
1850
  }
1832
- return O(), P();
1851
+ return $(), z();
1833
1852
  }
1834
- function E(S) {
1835
- return S ? S.replace(a, p) : p;
1853
+ function E(I) {
1854
+ return I ? I.replace(a, p) : p;
1836
1855
  }
1837
1856
  return bn = C, bn;
1838
1857
  }
@@ -1859,10 +1878,10 @@ function Ti() {
1859
1878
  }
1860
1879
  return ze;
1861
1880
  }
1862
- var Ue = {}, gt;
1881
+ var qe = {}, gt;
1863
1882
  function Li() {
1864
- if (gt) return Ue;
1865
- gt = 1, Object.defineProperty(Ue, "__esModule", { value: !0 }), Ue.camelCase = void 0;
1883
+ if (gt) return qe;
1884
+ gt = 1, Object.defineProperty(qe, "__esModule", { value: !0 }), qe.camelCase = void 0;
1866
1885
  var e = /^--[a-zA-Z0-9_-]+$/, n = /-([a-z])/g, t = /^[^-]+$/, r = /^-(webkit|moz|ms|o|khtml)-/, i = /^-(ms)-/, l = function(s) {
1867
1886
  return !s || t.test(s) || e.test(s);
1868
1887
  }, o = function(s, u) {
@@ -1872,13 +1891,13 @@ function Li() {
1872
1891
  }, c = function(s, u) {
1873
1892
  return u === void 0 && (u = {}), l(s) ? s : (s = s.toLowerCase(), u.reactCompat ? s = s.replace(i, a) : s = s.replace(r, a), s.replace(n, o));
1874
1893
  };
1875
- return Ue.camelCase = c, Ue;
1894
+ return qe.camelCase = c, qe;
1876
1895
  }
1877
- var qe, yt;
1896
+ var We, yt;
1878
1897
  function Pi() {
1879
- if (yt) return qe;
1898
+ if (yt) return We;
1880
1899
  yt = 1;
1881
- var e = qe && qe.__importDefault || function(i) {
1900
+ var e = We && We.__importDefault || function(i) {
1882
1901
  return i && i.__esModule ? i : { default: i };
1883
1902
  }, n = e(Ti()), t = Li();
1884
1903
  function r(i, l) {
@@ -1887,7 +1906,7 @@ function Pi() {
1887
1906
  a && c && (o[(0, t.camelCase)(a, l)] = c);
1888
1907
  }), o;
1889
1908
  }
1890
- return r.default = r, qe = r, qe;
1909
+ return r.default = r, We = r, We;
1891
1910
  }
1892
1911
  var Ni = Pi();
1893
1912
  const Ai = /* @__PURE__ */ ir(Ni), lr = or("end"), qn = or("start");
@@ -1908,7 +1927,7 @@ function zi(e) {
1908
1927
  if (n && t)
1909
1928
  return { start: n, end: t };
1910
1929
  }
1911
- function Ke(e) {
1930
+ function Qe(e) {
1912
1931
  return !e || typeof e != "object" ? "" : "position" in e || "type" in e ? xt(e.position) : "start" in e || "end" in e ? xt(e) : "line" in e || "column" in e ? Dn(e) : "";
1913
1932
  }
1914
1933
  function Dn(e) {
@@ -1991,7 +2010,7 @@ class ne extends Error {
1991
2010
  c && (l.place = c.position);
1992
2011
  }
1993
2012
  const a = l.place && "start" in l.place ? l.place.start : l.place;
1994
- this.ancestors = l.ancestors || void 0, this.cause = l.cause || void 0, this.column = a ? a.column : void 0, this.fatal = void 0, this.file = "", this.message = i, this.line = a ? a.line : void 0, this.name = Ke(l.place) || "1:1", this.place = l.place || void 0, this.reason = this.message, this.ruleId = l.ruleId || void 0, this.source = l.source || void 0, this.stack = o && l.cause && typeof l.cause.stack == "string" ? l.cause.stack : "", this.actual = void 0, this.expected = void 0, this.note = void 0, this.url = void 0;
2013
+ this.ancestors = l.ancestors || void 0, this.cause = l.cause || void 0, this.column = a ? a.column : void 0, this.fatal = void 0, this.file = "", this.message = i, this.line = a ? a.line : void 0, this.name = Qe(l.place) || "1:1", this.place = l.place || void 0, this.reason = this.message, this.ruleId = l.ruleId || void 0, this.source = l.source || void 0, this.stack = o && l.cause && typeof l.cause.stack == "string" ? l.cause.stack : "", this.actual = void 0, this.expected = void 0, this.note = void 0, this.url = void 0;
1995
2014
  }
1996
2015
  }
1997
2016
  ne.prototype.file = "";
@@ -2354,7 +2373,7 @@ function Kn(e) {
2354
2373
  t.charCodeAt(t.length - 1) === 59 && e !== "semi" || t === n ? !1 : t
2355
2374
  );
2356
2375
  }
2357
- function xe(e, n, t, r) {
2376
+ function ke(e, n, t, r) {
2358
2377
  const i = e.length;
2359
2378
  let l = 0, o;
2360
2379
  if (n < 0 ? n = -n > i ? 0 : i + n : n = n > i ? i : n, t = t > 0 ? t : 0, r.length < 1e4)
@@ -2363,8 +2382,8 @@ function xe(e, n, t, r) {
2363
2382
  for (t && e.splice(n, t); l < r.length; )
2364
2383
  o = r.slice(l, l + 1e4), o.unshift(n, 0), e.splice(...o), l += 1e4, n += 1e4;
2365
2384
  }
2366
- function ce(e, n) {
2367
- return e.length > 0 ? (xe(e, e.length, 0, n), e) : n;
2385
+ function pe(e, n) {
2386
+ return e.length > 0 ? (ke(e, e.length, 0, n), e) : n;
2368
2387
  }
2369
2388
  const Ct = {}.hasOwnProperty;
2370
2389
  function rl(e) {
@@ -2396,7 +2415,7 @@ function ll(e, n) {
2396
2415
  const r = [];
2397
2416
  for (; ++t < n.length; )
2398
2417
  (n[t].add === "after" ? e : r).push(n[t]);
2399
- xe(e, 0, 0, r);
2418
+ ke(e, 0, 0, r);
2400
2419
  }
2401
2420
  function hr(e, n) {
2402
2421
  const t = Number.parseInt(e, n);
@@ -2411,10 +2430,10 @@ function hr(e, n) {
2411
2430
  t > 1114111 ? "�" : String.fromCodePoint(t)
2412
2431
  );
2413
2432
  }
2414
- function Oe(e) {
2433
+ function Fe(e) {
2415
2434
  return e.replace(/[\t\n\r ]+/g, " ").replace(/^ | $/g, "").toLowerCase().toUpperCase();
2416
2435
  }
2417
- const ye = Ee(/[A-Za-z]/), se = Ee(/[\dA-Za-z]/), ol = Ee(/[#-'*+\--9=?A-Z^-~]/);
2436
+ const xe = Ee(/[A-Za-z]/), se = Ee(/[\dA-Za-z]/), ol = Ee(/[#-'*+\--9=?A-Z^-~]/);
2418
2437
  function Bn(e) {
2419
2438
  return (
2420
2439
  // Special whitespace codes (which have negative values), C0 and Control
@@ -2429,7 +2448,7 @@ function M(e) {
2429
2448
  function re(e) {
2430
2449
  return e !== null && (e < 0 || e === 32);
2431
2450
  }
2432
- function U(e) {
2451
+ function W(e) {
2433
2452
  return e === -2 || e === -1 || e === 32;
2434
2453
  }
2435
2454
  const ul = Ee(new RegExp("\\p{P}|\\p{S}", "u")), cl = Ee(/\s/);
@@ -2439,7 +2458,7 @@ function Ee(e) {
2439
2458
  return t !== null && t > -1 && e.test(String.fromCharCode(t));
2440
2459
  }
2441
2460
  }
2442
- function Re(e) {
2461
+ function $e(e) {
2443
2462
  const n = [];
2444
2463
  let t = -1, r = 0, i = 0;
2445
2464
  for (; ++t < e.length; ) {
@@ -2463,10 +2482,10 @@ function K(e, n, t, r) {
2463
2482
  let l = 0;
2464
2483
  return o;
2465
2484
  function o(c) {
2466
- return U(c) ? (e.enter(t), a(c)) : n(c);
2485
+ return W(c) ? (e.enter(t), a(c)) : n(c);
2467
2486
  }
2468
2487
  function a(c) {
2469
- return U(c) && l++ < i ? (e.consume(c), a) : (e.exit(t), n(c));
2488
+ return W(c) && l++ < i ? (e.consume(c), a) : (e.exit(t), n(c));
2470
2489
  }
2471
2490
  }
2472
2491
  const pl = {
@@ -2510,111 +2529,111 @@ function dl(e) {
2510
2529
  const n = this, t = [];
2511
2530
  let r = 0, i, l, o;
2512
2531
  return a;
2513
- function a(T) {
2532
+ function a(v) {
2514
2533
  if (r < t.length) {
2515
- const H = t[r];
2516
- return n.containerState = H[1], e.attempt(H[0].continuation, c, s)(T);
2534
+ const R = t[r];
2535
+ return n.containerState = R[1], e.attempt(R[0].continuation, c, s)(v);
2517
2536
  }
2518
- return s(T);
2537
+ return s(v);
2519
2538
  }
2520
- function c(T) {
2539
+ function c(v) {
2521
2540
  if (r++, n.containerState._closeFlow) {
2522
- n.containerState._closeFlow = void 0, i && N();
2523
- const H = n.events.length;
2524
- let j = H, b;
2525
- for (; j--; )
2526
- if (n.events[j][0] === "exit" && n.events[j][1].type === "chunkFlow") {
2527
- b = n.events[j][1].end;
2541
+ n.containerState._closeFlow = void 0, i && A();
2542
+ const R = n.events.length;
2543
+ let q = R, x;
2544
+ for (; q--; )
2545
+ if (n.events[q][0] === "exit" && n.events[q][1].type === "chunkFlow") {
2546
+ x = n.events[q][1].end;
2528
2547
  break;
2529
2548
  }
2530
2549
  y(r);
2531
- let F = H;
2532
- for (; F < n.events.length; )
2533
- n.events[F][1].end = {
2534
- ...b
2535
- }, F++;
2536
- return xe(n.events, j + 1, 0, n.events.slice(H)), n.events.length = F, s(T);
2550
+ let O = R;
2551
+ for (; O < n.events.length; )
2552
+ n.events[O][1].end = {
2553
+ ...x
2554
+ }, O++;
2555
+ return ke(n.events, q + 1, 0, n.events.slice(R)), n.events.length = O, s(v);
2537
2556
  }
2538
- return a(T);
2557
+ return a(v);
2539
2558
  }
2540
- function s(T) {
2559
+ function s(v) {
2541
2560
  if (r === t.length) {
2542
2561
  if (!i)
2543
- return m(T);
2562
+ return m(v);
2544
2563
  if (i.currentConstruct && i.currentConstruct.concrete)
2545
- return C(T);
2564
+ return C(v);
2546
2565
  n.interrupt = !!(i.currentConstruct && !i._gfmTableDynamicInterruptHack);
2547
2566
  }
2548
- return n.containerState = {}, e.check(_t, u, p)(T);
2567
+ return n.containerState = {}, e.check(_t, u, p)(v);
2549
2568
  }
2550
- function u(T) {
2551
- return i && N(), y(r), m(T);
2569
+ function u(v) {
2570
+ return i && A(), y(r), m(v);
2552
2571
  }
2553
- function p(T) {
2554
- return n.parser.lazy[n.now().line] = r !== t.length, o = n.now().offset, C(T);
2572
+ function p(v) {
2573
+ return n.parser.lazy[n.now().line] = r !== t.length, o = n.now().offset, C(v);
2555
2574
  }
2556
- function m(T) {
2557
- return n.containerState = {}, e.attempt(_t, h, C)(T);
2575
+ function m(v) {
2576
+ return n.containerState = {}, e.attempt(_t, h, C)(v);
2558
2577
  }
2559
- function h(T) {
2560
- return r++, t.push([n.currentConstruct, n.containerState]), m(T);
2578
+ function h(v) {
2579
+ return r++, t.push([n.currentConstruct, n.containerState]), m(v);
2561
2580
  }
2562
- function C(T) {
2563
- if (T === null) {
2564
- i && N(), y(0), e.consume(T);
2581
+ function C(v) {
2582
+ if (v === null) {
2583
+ i && A(), y(0), e.consume(v);
2565
2584
  return;
2566
2585
  }
2567
2586
  return i = i || n.parser.flow(n.now()), e.enter("chunkFlow", {
2568
2587
  _tokenizer: i,
2569
2588
  contentType: "flow",
2570
2589
  previous: l
2571
- }), E(T);
2590
+ }), E(v);
2572
2591
  }
2573
- function E(T) {
2574
- if (T === null) {
2575
- S(e.exit("chunkFlow"), !0), y(0), e.consume(T);
2592
+ function E(v) {
2593
+ if (v === null) {
2594
+ I(e.exit("chunkFlow"), !0), y(0), e.consume(v);
2576
2595
  return;
2577
2596
  }
2578
- return M(T) ? (e.consume(T), S(e.exit("chunkFlow")), r = 0, n.interrupt = void 0, a) : (e.consume(T), E);
2597
+ return M(v) ? (e.consume(v), I(e.exit("chunkFlow")), r = 0, n.interrupt = void 0, a) : (e.consume(v), E);
2579
2598
  }
2580
- function S(T, H) {
2581
- const j = n.sliceStream(T);
2582
- if (H && j.push(null), T.previous = l, l && (l.next = T), l = T, i.defineSkip(T.start), i.write(j), n.parser.lazy[T.start.line]) {
2583
- let b = i.events.length;
2584
- for (; b--; )
2599
+ function I(v, R) {
2600
+ const q = n.sliceStream(v);
2601
+ if (R && q.push(null), v.previous = l, l && (l.next = v), l = v, i.defineSkip(v.start), i.write(q), n.parser.lazy[v.start.line]) {
2602
+ let x = i.events.length;
2603
+ for (; x--; )
2585
2604
  if (
2586
2605
  // The token starts before the line ending…
2587
- i.events[b][1].start.offset < o && // …and either is not ended yet…
2588
- (!i.events[b][1].end || // …or ends after it.
2589
- i.events[b][1].end.offset > o)
2606
+ i.events[x][1].start.offset < o && // …and either is not ended yet…
2607
+ (!i.events[x][1].end || // …or ends after it.
2608
+ i.events[x][1].end.offset > o)
2590
2609
  )
2591
2610
  return;
2592
- const F = n.events.length;
2593
- let V = F, O, A;
2594
- for (; V--; )
2595
- if (n.events[V][0] === "exit" && n.events[V][1].type === "chunkFlow") {
2596
- if (O) {
2597
- A = n.events[V][1].end;
2611
+ const O = n.events.length;
2612
+ let U = O, $, V;
2613
+ for (; U--; )
2614
+ if (n.events[U][0] === "exit" && n.events[U][1].type === "chunkFlow") {
2615
+ if ($) {
2616
+ V = n.events[U][1].end;
2598
2617
  break;
2599
2618
  }
2600
- O = !0;
2619
+ $ = !0;
2601
2620
  }
2602
- for (y(r), b = F; b < n.events.length; )
2603
- n.events[b][1].end = {
2604
- ...A
2605
- }, b++;
2606
- xe(n.events, V + 1, 0, n.events.slice(F)), n.events.length = b;
2621
+ for (y(r), x = O; x < n.events.length; )
2622
+ n.events[x][1].end = {
2623
+ ...V
2624
+ }, x++;
2625
+ ke(n.events, U + 1, 0, n.events.slice(O)), n.events.length = x;
2607
2626
  }
2608
2627
  }
2609
- function y(T) {
2610
- let H = t.length;
2611
- for (; H-- > T; ) {
2612
- const j = t[H];
2613
- n.containerState = j[1], j[0].exit.call(n, e);
2628
+ function y(v) {
2629
+ let R = t.length;
2630
+ for (; R-- > v; ) {
2631
+ const q = t[R];
2632
+ n.containerState = q[1], q[0].exit.call(n, e);
2614
2633
  }
2615
- t.length = T;
2634
+ t.length = v;
2616
2635
  }
2617
- function N() {
2636
+ function A() {
2618
2637
  i.write([null]), l = void 0, i = void 0, n.containerState._closeFlow = void 0;
2619
2638
  }
2620
2639
  }
@@ -2688,7 +2707,7 @@ function gl(e, n) {
2688
2707
  ...o.start
2689
2708
  }, e[t][1].start = {
2690
2709
  ...a.end
2691
- }, s = [], e[r][1].end.offset - e[r][1].start.offset && (s = ce(s, [["enter", e[r][1], n], ["exit", e[r][1], n]])), s = ce(s, [["enter", i, n], ["enter", o, n], ["exit", o, n], ["enter", l, n]]), s = ce(s, Qn(n.parser.constructs.insideSpan.null, e.slice(r + 1, t), n)), s = ce(s, [["exit", l, n], ["enter", a, n], ["exit", a, n], ["exit", i, n]]), e[t][1].end.offset - e[t][1].start.offset ? (u = 2, s = ce(s, [["enter", e[t][1], n], ["exit", e[t][1], n]])) : u = 0, xe(e, r - 1, t - r + 3, s), t = r + s.length - u - 2;
2710
+ }, s = [], e[r][1].end.offset - e[r][1].start.offset && (s = pe(s, [["enter", e[r][1], n], ["exit", e[r][1], n]])), s = pe(s, [["enter", i, n], ["enter", o, n], ["exit", o, n], ["enter", l, n]]), s = pe(s, Qn(n.parser.constructs.insideSpan.null, e.slice(r + 1, t), n)), s = pe(s, [["exit", l, n], ["enter", a, n], ["exit", a, n], ["exit", i, n]]), e[t][1].end.offset - e[t][1].start.offset ? (u = 2, s = pe(s, [["enter", e[t][1], n], ["exit", e[t][1], n]])) : u = 0, ke(e, r - 1, t - r + 3, s), t = r + s.length - u - 2;
2692
2711
  break;
2693
2712
  }
2694
2713
  }
@@ -2724,7 +2743,7 @@ function kl(e, n, t) {
2724
2743
  return e.enter("autolink"), e.enter("autolinkMarker"), e.consume(h), e.exit("autolinkMarker"), e.enter("autolinkProtocol"), l;
2725
2744
  }
2726
2745
  function l(h) {
2727
- return ye(h) ? (e.consume(h), o) : h === 64 ? t(h) : s(h);
2746
+ return xe(h) ? (e.consume(h), o) : h === 64 ? t(h) : s(h);
2728
2747
  }
2729
2748
  function o(h) {
2730
2749
  return h === 43 || h === 45 || h === 46 || se(h) ? (r = 1, a(h)) : s(h);
@@ -2759,7 +2778,7 @@ const mn = {
2759
2778
  function bl(e, n, t) {
2760
2779
  return r;
2761
2780
  function r(l) {
2762
- return U(l) ? K(e, i, "linePrefix")(l) : i(l);
2781
+ return W(l) ? K(e, i, "linePrefix")(l) : i(l);
2763
2782
  }
2764
2783
  function i(l) {
2765
2784
  return l === null || M(l) ? n(l) : t(l);
@@ -2786,14 +2805,14 @@ function wl(e, n, t) {
2786
2805
  return t(o);
2787
2806
  }
2788
2807
  function l(o) {
2789
- return U(o) ? (e.enter("blockQuotePrefixWhitespace"), e.consume(o), e.exit("blockQuotePrefixWhitespace"), e.exit("blockQuotePrefix"), n) : (e.exit("blockQuotePrefix"), n(o));
2808
+ return W(o) ? (e.enter("blockQuotePrefixWhitespace"), e.consume(o), e.exit("blockQuotePrefixWhitespace"), e.exit("blockQuotePrefix"), n) : (e.exit("blockQuotePrefix"), n(o));
2790
2809
  }
2791
2810
  }
2792
2811
  function Cl(e, n, t) {
2793
2812
  const r = this;
2794
2813
  return i;
2795
2814
  function i(o) {
2796
- return U(o) ? K(e, l, "linePrefix", r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(o) : l(o);
2815
+ return W(o) ? K(e, l, "linePrefix", r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(o) : l(o);
2797
2816
  }
2798
2817
  function l(o) {
2799
2818
  return e.attempt(fr, n, t)(o);
@@ -2851,71 +2870,71 @@ const Et = {
2851
2870
  function El(e, n, t) {
2852
2871
  const r = this, i = {
2853
2872
  partial: !0,
2854
- tokenize: j
2873
+ tokenize: q
2855
2874
  };
2856
2875
  let l = 0, o = 0, a;
2857
2876
  return c;
2858
- function c(b) {
2859
- return s(b);
2877
+ function c(x) {
2878
+ return s(x);
2860
2879
  }
2861
- function s(b) {
2862
- const F = r.events[r.events.length - 1];
2863
- return l = F && F[1].type === "linePrefix" ? F[2].sliceSerialize(F[1], !0).length : 0, a = b, e.enter("codeFenced"), e.enter("codeFencedFence"), e.enter("codeFencedFenceSequence"), u(b);
2880
+ function s(x) {
2881
+ const O = r.events[r.events.length - 1];
2882
+ return l = O && O[1].type === "linePrefix" ? O[2].sliceSerialize(O[1], !0).length : 0, a = x, e.enter("codeFenced"), e.enter("codeFencedFence"), e.enter("codeFencedFenceSequence"), u(x);
2864
2883
  }
2865
- function u(b) {
2866
- return b === a ? (o++, e.consume(b), u) : o < 3 ? t(b) : (e.exit("codeFencedFenceSequence"), U(b) ? K(e, p, "whitespace")(b) : p(b));
2884
+ function u(x) {
2885
+ return x === a ? (o++, e.consume(x), u) : o < 3 ? t(x) : (e.exit("codeFencedFenceSequence"), W(x) ? K(e, p, "whitespace")(x) : p(x));
2867
2886
  }
2868
- function p(b) {
2869
- return b === null || M(b) ? (e.exit("codeFencedFence"), r.interrupt ? n(b) : e.check(Et, E, H)(b)) : (e.enter("codeFencedFenceInfo"), e.enter("chunkString", {
2887
+ function p(x) {
2888
+ return x === null || M(x) ? (e.exit("codeFencedFence"), r.interrupt ? n(x) : e.check(Et, E, R)(x)) : (e.enter("codeFencedFenceInfo"), e.enter("chunkString", {
2870
2889
  contentType: "string"
2871
- }), m(b));
2890
+ }), m(x));
2872
2891
  }
2873
- function m(b) {
2874
- return b === null || M(b) ? (e.exit("chunkString"), e.exit("codeFencedFenceInfo"), p(b)) : U(b) ? (e.exit("chunkString"), e.exit("codeFencedFenceInfo"), K(e, h, "whitespace")(b)) : b === 96 && b === a ? t(b) : (e.consume(b), m);
2892
+ function m(x) {
2893
+ return x === null || M(x) ? (e.exit("chunkString"), e.exit("codeFencedFenceInfo"), p(x)) : W(x) ? (e.exit("chunkString"), e.exit("codeFencedFenceInfo"), K(e, h, "whitespace")(x)) : x === 96 && x === a ? t(x) : (e.consume(x), m);
2875
2894
  }
2876
- function h(b) {
2877
- return b === null || M(b) ? p(b) : (e.enter("codeFencedFenceMeta"), e.enter("chunkString", {
2895
+ function h(x) {
2896
+ return x === null || M(x) ? p(x) : (e.enter("codeFencedFenceMeta"), e.enter("chunkString", {
2878
2897
  contentType: "string"
2879
- }), C(b));
2898
+ }), C(x));
2880
2899
  }
2881
- function C(b) {
2882
- return b === null || M(b) ? (e.exit("chunkString"), e.exit("codeFencedFenceMeta"), p(b)) : b === 96 && b === a ? t(b) : (e.consume(b), C);
2900
+ function C(x) {
2901
+ return x === null || M(x) ? (e.exit("chunkString"), e.exit("codeFencedFenceMeta"), p(x)) : x === 96 && x === a ? t(x) : (e.consume(x), C);
2883
2902
  }
2884
- function E(b) {
2885
- return e.attempt(i, H, S)(b);
2903
+ function E(x) {
2904
+ return e.attempt(i, R, I)(x);
2886
2905
  }
2887
- function S(b) {
2888
- return e.enter("lineEnding"), e.consume(b), e.exit("lineEnding"), y;
2906
+ function I(x) {
2907
+ return e.enter("lineEnding"), e.consume(x), e.exit("lineEnding"), y;
2889
2908
  }
2890
- function y(b) {
2891
- return l > 0 && U(b) ? K(e, N, "linePrefix", l + 1)(b) : N(b);
2909
+ function y(x) {
2910
+ return l > 0 && W(x) ? K(e, A, "linePrefix", l + 1)(x) : A(x);
2892
2911
  }
2893
- function N(b) {
2894
- return b === null || M(b) ? e.check(Et, E, H)(b) : (e.enter("codeFlowValue"), T(b));
2912
+ function A(x) {
2913
+ return x === null || M(x) ? e.check(Et, E, R)(x) : (e.enter("codeFlowValue"), v(x));
2895
2914
  }
2896
- function T(b) {
2897
- return b === null || M(b) ? (e.exit("codeFlowValue"), N(b)) : (e.consume(b), T);
2915
+ function v(x) {
2916
+ return x === null || M(x) ? (e.exit("codeFlowValue"), A(x)) : (e.consume(x), v);
2898
2917
  }
2899
- function H(b) {
2900
- return e.exit("codeFenced"), n(b);
2918
+ function R(x) {
2919
+ return e.exit("codeFenced"), n(x);
2901
2920
  }
2902
- function j(b, F, V) {
2903
- let O = 0;
2904
- return A;
2905
- function A(x) {
2906
- return b.enter("lineEnding"), b.consume(x), b.exit("lineEnding"), L;
2921
+ function q(x, O, U) {
2922
+ let $ = 0;
2923
+ return V;
2924
+ function V(b) {
2925
+ return x.enter("lineEnding"), x.consume(b), x.exit("lineEnding"), P;
2907
2926
  }
2908
- function L(x) {
2909
- return b.enter("codeFencedFence"), U(x) ? K(b, v, "linePrefix", r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(x) : v(x);
2927
+ function P(b) {
2928
+ return x.enter("codeFencedFence"), W(b) ? K(x, _, "linePrefix", r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(b) : _(b);
2910
2929
  }
2911
- function v(x) {
2912
- return x === a ? (b.enter("codeFencedFenceSequence"), P(x)) : V(x);
2930
+ function _(b) {
2931
+ return b === a ? (x.enter("codeFencedFenceSequence"), z(b)) : U(b);
2913
2932
  }
2914
- function P(x) {
2915
- return x === a ? (O++, b.consume(x), P) : O >= o ? (b.exit("codeFencedFenceSequence"), U(x) ? K(b, I, "whitespace")(x) : I(x)) : V(x);
2933
+ function z(b) {
2934
+ return b === a ? ($++, x.consume(b), z) : $ >= o ? (x.exit("codeFencedFenceSequence"), W(b) ? K(x, L, "whitespace")(b) : L(b)) : U(b);
2916
2935
  }
2917
- function I(x) {
2918
- return x === null || M(x) ? (b.exit("codeFencedFence"), F(x)) : V(x);
2936
+ function L(b) {
2937
+ return b === null || M(b) ? (x.exit("codeFencedFence"), O(b)) : U(b);
2919
2938
  }
2920
2939
  }
2921
2940
  }
@@ -3088,7 +3107,7 @@ class Dl {
3088
3107
  const i = t || 0;
3089
3108
  this.setCursor(Math.trunc(n));
3090
3109
  const l = this.right.splice(this.right.length - i, Number.POSITIVE_INFINITY);
3091
- return r && We(this.left, r), l.reverse();
3110
+ return r && Ye(this.left, r), l.reverse();
3092
3111
  }
3093
3112
  /**
3094
3113
  * Remove and return the highest-numbered item in the array, so
@@ -3123,7 +3142,7 @@ class Dl {
3123
3142
  * Nothing.
3124
3143
  */
3125
3144
  pushMany(n) {
3126
- this.setCursor(Number.POSITIVE_INFINITY), We(this.left, n);
3145
+ this.setCursor(Number.POSITIVE_INFINITY), Ye(this.left, n);
3127
3146
  }
3128
3147
  /**
3129
3148
  * Inserts a single item to the low-numbered side of the array;
@@ -3147,7 +3166,7 @@ class Dl {
3147
3166
  * Nothing.
3148
3167
  */
3149
3168
  unshiftMany(n) {
3150
- this.setCursor(0), We(this.right, n.reverse());
3169
+ this.setCursor(0), Ye(this.right, n.reverse());
3151
3170
  }
3152
3171
  /**
3153
3172
  * Move the cursor to a specific position in the array. Requires
@@ -3165,14 +3184,14 @@ class Dl {
3165
3184
  if (!(n === this.left.length || n > this.left.length && this.right.length === 0 || n < 0 && this.left.length === 0))
3166
3185
  if (n < this.left.length) {
3167
3186
  const t = this.left.splice(n, Number.POSITIVE_INFINITY);
3168
- We(this.right, t.reverse());
3187
+ Ye(this.right, t.reverse());
3169
3188
  } else {
3170
3189
  const t = this.right.splice(this.left.length + this.right.length - n, Number.POSITIVE_INFINITY);
3171
- We(this.left, t.reverse());
3190
+ Ye(this.left, t.reverse());
3172
3191
  }
3173
3192
  }
3174
3193
  }
3175
- function We(e, n) {
3194
+ function Ye(e, n) {
3176
3195
  let t = 0;
3177
3196
  if (n.length < 1e4)
3178
3197
  e.push(...n);
@@ -3202,7 +3221,7 @@ function gr(e) {
3202
3221
  }, a = u.slice(i, t), a.unshift(r), u.splice(i, t - i + 1, a));
3203
3222
  }
3204
3223
  }
3205
- return xe(e, 0, Number.POSITIVE_INFINITY, u.slice(0)), !s;
3224
+ return ke(e, 0, Number.POSITIVE_INFINITY, u.slice(0)), !s;
3206
3225
  }
3207
3226
  function Bl(e, n) {
3208
3227
  const t = e.get(n)[1], r = e.get(n)[2];
@@ -3212,7 +3231,7 @@ function Bl(e, n) {
3212
3231
  o || (o = r.parser[t.contentType](t.start), t._contentTypeTextTrailing && (o._contentTypeTextTrailing = !0));
3213
3232
  const a = o.events, c = [], s = {};
3214
3233
  let u, p, m = -1, h = t, C = 0, E = 0;
3215
- const S = [E];
3234
+ const I = [E];
3216
3235
  for (; h; ) {
3217
3236
  for (; e.get(++i)[1] !== h; )
3218
3237
  ;
@@ -3220,10 +3239,10 @@ function Bl(e, n) {
3220
3239
  }
3221
3240
  for (h = t; ++m < a.length; )
3222
3241
  // Find a void token that includes a break.
3223
- a[m][0] === "exit" && a[m - 1][0] === "enter" && a[m][1].type === a[m - 1][1].type && a[m][1].start.line !== a[m][1].end.line && (E = m + 1, S.push(E), h._tokenizer = void 0, h.previous = void 0, h = h.next);
3224
- for (o.events = [], h ? (h._tokenizer = void 0, h.previous = void 0) : S.pop(), m = S.length; m--; ) {
3225
- const y = a.slice(S[m], S[m + 1]), N = l.pop();
3226
- c.push([N, N + y.length - 1]), e.splice(N, 2, y);
3242
+ a[m][0] === "exit" && a[m - 1][0] === "enter" && a[m][1].type === a[m - 1][1].type && a[m][1].start.line !== a[m][1].end.line && (E = m + 1, I.push(E), h._tokenizer = void 0, h.previous = void 0, h = h.next);
3243
+ for (o.events = [], h ? (h._tokenizer = void 0, h.previous = void 0) : I.pop(), m = I.length; m--; ) {
3244
+ const y = a.slice(I[m], I[m + 1]), A = l.pop();
3245
+ c.push([A, A + y.length - 1]), e.splice(A, 2, y);
3227
3246
  }
3228
3247
  for (c.reverse(), m = -1; ++m < c.length; )
3229
3248
  s[C + c[m][0]] = C + c[m][1], C += c[m][1] - c[m][0] - 1;
@@ -3294,9 +3313,9 @@ function yr(e, n, t, r, i, l, o, a, c) {
3294
3313
  return y === 60 || y === 62 || y === 92 ? (e.consume(y), h) : h(y);
3295
3314
  }
3296
3315
  function E(y) {
3297
- return !u && (y === null || y === 41 || re(y)) ? (e.exit("chunkString"), e.exit(a), e.exit(o), e.exit(r), n(y)) : u < s && y === 40 ? (e.consume(y), u++, E) : y === 41 ? (e.consume(y), u--, E) : y === null || y === 32 || y === 40 || Bn(y) ? t(y) : (e.consume(y), y === 92 ? S : E);
3316
+ return !u && (y === null || y === 41 || re(y)) ? (e.exit("chunkString"), e.exit(a), e.exit(o), e.exit(r), n(y)) : u < s && y === 40 ? (e.consume(y), u++, E) : y === 41 ? (e.consume(y), u--, E) : y === null || y === 32 || y === 40 || Bn(y) ? t(y) : (e.consume(y), y === 92 ? I : E);
3298
3317
  }
3299
- function S(y) {
3318
+ function I(y) {
3300
3319
  return y === 40 || y === 41 || y === 92 ? (e.consume(y), E) : E(y);
3301
3320
  }
3302
3321
  }
@@ -3318,7 +3337,7 @@ function xr(e, n, t, r, i, l) {
3318
3337
  }), p(h));
3319
3338
  }
3320
3339
  function p(h) {
3321
- return h === null || h === 91 || h === 93 || M(h) || a++ > 999 ? (e.exit("chunkString"), u(h)) : (e.consume(h), c || (c = !U(h)), h === 92 ? m : p);
3340
+ return h === null || h === 91 || h === 93 || M(h) || a++ > 999 ? (e.exit("chunkString"), u(h)) : (e.consume(h), c || (c = !W(h)), h === 92 ? m : p);
3322
3341
  }
3323
3342
  function m(h) {
3324
3343
  return h === 91 || h === 92 || h === 93 ? (e.consume(h), a++, p) : p(h);
@@ -3345,11 +3364,11 @@ function kr(e, n, t, r, i, l) {
3345
3364
  return m === o || m === 92 ? (e.consume(m), u) : u(m);
3346
3365
  }
3347
3366
  }
3348
- function Qe(e, n) {
3367
+ function Ze(e, n) {
3349
3368
  let t;
3350
3369
  return r;
3351
3370
  function r(i) {
3352
- return M(i) ? (e.enter("lineEnding"), e.consume(i), e.exit("lineEnding"), t = !0, r) : U(i) ? K(e, r, t ? "linePrefix" : "lineSuffix")(i) : n(i);
3371
+ return M(i) ? (e.enter("lineEnding"), e.consume(i), e.exit("lineEnding"), t = !0, r) : W(i) ? K(e, r, t ? "linePrefix" : "lineSuffix")(i) : n(i);
3353
3372
  }
3354
3373
  }
3355
3374
  const Hl = {
@@ -3379,10 +3398,10 @@ function Ul(e, n, t) {
3379
3398
  )(h);
3380
3399
  }
3381
3400
  function a(h) {
3382
- return i = Oe(r.sliceSerialize(r.events[r.events.length - 1][1]).slice(1, -1)), h === 58 ? (e.enter("definitionMarker"), e.consume(h), e.exit("definitionMarker"), c) : t(h);
3401
+ return i = Fe(r.sliceSerialize(r.events[r.events.length - 1][1]).slice(1, -1)), h === 58 ? (e.enter("definitionMarker"), e.consume(h), e.exit("definitionMarker"), c) : t(h);
3383
3402
  }
3384
3403
  function c(h) {
3385
- return re(h) ? Qe(e, s)(h) : s(h);
3404
+ return re(h) ? Ze(e, s)(h) : s(h);
3386
3405
  }
3387
3406
  function s(h) {
3388
3407
  return yr(
@@ -3401,7 +3420,7 @@ function Ul(e, n, t) {
3401
3420
  return e.attempt(Vl, p, p)(h);
3402
3421
  }
3403
3422
  function p(h) {
3404
- return U(h) ? K(e, m, "whitespace")(h) : m(h);
3423
+ return W(h) ? K(e, m, "whitespace")(h) : m(h);
3405
3424
  }
3406
3425
  function m(h) {
3407
3426
  return h === null || M(h) ? (e.exit("definition"), r.parser.defined.push(i), n(h)) : t(h);
@@ -3410,13 +3429,13 @@ function Ul(e, n, t) {
3410
3429
  function ql(e, n, t) {
3411
3430
  return r;
3412
3431
  function r(a) {
3413
- return re(a) ? Qe(e, i)(a) : t(a);
3432
+ return re(a) ? Ze(e, i)(a) : t(a);
3414
3433
  }
3415
3434
  function i(a) {
3416
3435
  return kr(e, l, t, "definitionTitle", "definitionTitleMarker", "definitionTitleString")(a);
3417
3436
  }
3418
3437
  function l(a) {
3419
- return U(a) ? K(e, o, "whitespace")(a) : o(a);
3438
+ return W(a) ? K(e, o, "whitespace")(a) : o(a);
3420
3439
  }
3421
3440
  function o(a) {
3422
3441
  return a === null || M(a) ? n(a) : t(a);
@@ -3451,7 +3470,7 @@ function Kl(e, n) {
3451
3470
  start: e[r][1].start,
3452
3471
  end: e[t][1].end,
3453
3472
  contentType: "text"
3454
- }, xe(e, r, t - r + 1, [["enter", i, n], ["enter", l, n], ["exit", l, n], ["exit", i, n]])), e;
3473
+ }, ke(e, r, t - r + 1, [["enter", i, n], ["enter", l, n], ["exit", l, n], ["exit", i, n]])), e;
3455
3474
  }
3456
3475
  function Ql(e, n, t) {
3457
3476
  let r = 0;
@@ -3466,7 +3485,7 @@ function Ql(e, n, t) {
3466
3485
  return u === 35 && r++ < 6 ? (e.consume(u), o) : u === null || re(u) ? (e.exit("atxHeadingSequence"), a(u)) : t(u);
3467
3486
  }
3468
3487
  function a(u) {
3469
- return u === 35 ? (e.enter("atxHeadingSequence"), c(u)) : u === null || M(u) ? (e.exit("atxHeading"), n(u)) : U(u) ? K(e, a, "whitespace")(u) : (e.enter("atxHeadingText"), s(u));
3488
+ return u === 35 ? (e.enter("atxHeadingSequence"), c(u)) : u === null || M(u) ? (e.exit("atxHeading"), n(u)) : W(u) ? K(e, a, "whitespace")(u) : (e.enter("atxHeadingText"), s(u));
3470
3489
  }
3471
3490
  function c(u) {
3472
3491
  return u === 35 ? (e.consume(u), c) : (e.exit("atxHeadingSequence"), a(u));
@@ -3567,96 +3586,96 @@ function to(e, n, t) {
3567
3586
  return e.enter("htmlFlow"), e.enter("htmlFlowData"), e.consume(d), p;
3568
3587
  }
3569
3588
  function p(d) {
3570
- return d === 33 ? (e.consume(d), m) : d === 47 ? (e.consume(d), l = !0, E) : d === 63 ? (e.consume(d), i = 3, r.interrupt ? n : f) : ye(d) ? (e.consume(d), o = String.fromCharCode(d), S) : t(d);
3589
+ return d === 33 ? (e.consume(d), m) : d === 47 ? (e.consume(d), l = !0, E) : d === 63 ? (e.consume(d), i = 3, r.interrupt ? n : f) : xe(d) ? (e.consume(d), o = String.fromCharCode(d), I) : t(d);
3571
3590
  }
3572
3591
  function m(d) {
3573
- return d === 45 ? (e.consume(d), i = 2, h) : d === 91 ? (e.consume(d), i = 5, a = 0, C) : ye(d) ? (e.consume(d), i = 4, r.interrupt ? n : f) : t(d);
3592
+ return d === 45 ? (e.consume(d), i = 2, h) : d === 91 ? (e.consume(d), i = 5, a = 0, C) : xe(d) ? (e.consume(d), i = 4, r.interrupt ? n : f) : t(d);
3574
3593
  }
3575
3594
  function h(d) {
3576
3595
  return d === 45 ? (e.consume(d), r.interrupt ? n : f) : t(d);
3577
3596
  }
3578
3597
  function C(d) {
3579
- const he = "CDATA[";
3580
- return d === he.charCodeAt(a++) ? (e.consume(d), a === he.length ? r.interrupt ? n : v : C) : t(d);
3598
+ const fe = "CDATA[";
3599
+ return d === fe.charCodeAt(a++) ? (e.consume(d), a === fe.length ? r.interrupt ? n : _ : C) : t(d);
3581
3600
  }
3582
3601
  function E(d) {
3583
- return ye(d) ? (e.consume(d), o = String.fromCharCode(d), S) : t(d);
3602
+ return xe(d) ? (e.consume(d), o = String.fromCharCode(d), I) : t(d);
3584
3603
  }
3585
- function S(d) {
3604
+ function I(d) {
3586
3605
  if (d === null || d === 47 || d === 62 || re(d)) {
3587
- const he = d === 47, ve = o.toLowerCase();
3588
- return !he && !l && Tt.includes(ve) ? (i = 1, r.interrupt ? n(d) : v(d)) : Zl.includes(o.toLowerCase()) ? (i = 6, he ? (e.consume(d), y) : r.interrupt ? n(d) : v(d)) : (i = 7, r.interrupt && !r.parser.lazy[r.now().line] ? t(d) : l ? N(d) : T(d));
3606
+ const fe = d === 47, ve = o.toLowerCase();
3607
+ return !fe && !l && Tt.includes(ve) ? (i = 1, r.interrupt ? n(d) : _(d)) : Zl.includes(o.toLowerCase()) ? (i = 6, fe ? (e.consume(d), y) : r.interrupt ? n(d) : _(d)) : (i = 7, r.interrupt && !r.parser.lazy[r.now().line] ? t(d) : l ? A(d) : v(d));
3589
3608
  }
3590
- return d === 45 || se(d) ? (e.consume(d), o += String.fromCharCode(d), S) : t(d);
3609
+ return d === 45 || se(d) ? (e.consume(d), o += String.fromCharCode(d), I) : t(d);
3591
3610
  }
3592
3611
  function y(d) {
3593
- return d === 62 ? (e.consume(d), r.interrupt ? n : v) : t(d);
3612
+ return d === 62 ? (e.consume(d), r.interrupt ? n : _) : t(d);
3594
3613
  }
3595
- function N(d) {
3596
- return U(d) ? (e.consume(d), N) : A(d);
3597
- }
3598
- function T(d) {
3599
- return d === 47 ? (e.consume(d), A) : d === 58 || d === 95 || ye(d) ? (e.consume(d), H) : U(d) ? (e.consume(d), T) : A(d);
3600
- }
3601
- function H(d) {
3602
- return d === 45 || d === 46 || d === 58 || d === 95 || se(d) ? (e.consume(d), H) : j(d);
3614
+ function A(d) {
3615
+ return W(d) ? (e.consume(d), A) : V(d);
3603
3616
  }
3604
- function j(d) {
3605
- return d === 61 ? (e.consume(d), b) : U(d) ? (e.consume(d), j) : T(d);
3617
+ function v(d) {
3618
+ return d === 47 ? (e.consume(d), V) : d === 58 || d === 95 || xe(d) ? (e.consume(d), R) : W(d) ? (e.consume(d), v) : V(d);
3606
3619
  }
3607
- function b(d) {
3608
- return d === null || d === 60 || d === 61 || d === 62 || d === 96 ? t(d) : d === 34 || d === 39 ? (e.consume(d), c = d, F) : U(d) ? (e.consume(d), b) : V(d);
3620
+ function R(d) {
3621
+ return d === 45 || d === 46 || d === 58 || d === 95 || se(d) ? (e.consume(d), R) : q(d);
3609
3622
  }
3610
- function F(d) {
3611
- return d === c ? (e.consume(d), c = null, O) : d === null || M(d) ? t(d) : (e.consume(d), F);
3623
+ function q(d) {
3624
+ return d === 61 ? (e.consume(d), x) : W(d) ? (e.consume(d), q) : v(d);
3612
3625
  }
3613
- function V(d) {
3614
- return d === null || d === 34 || d === 39 || d === 47 || d === 60 || d === 61 || d === 62 || d === 96 || re(d) ? j(d) : (e.consume(d), V);
3626
+ function x(d) {
3627
+ return d === null || d === 60 || d === 61 || d === 62 || d === 96 ? t(d) : d === 34 || d === 39 ? (e.consume(d), c = d, O) : W(d) ? (e.consume(d), x) : U(d);
3615
3628
  }
3616
3629
  function O(d) {
3617
- return d === 47 || d === 62 || U(d) ? T(d) : t(d);
3630
+ return d === c ? (e.consume(d), c = null, $) : d === null || M(d) ? t(d) : (e.consume(d), O);
3618
3631
  }
3619
- function A(d) {
3620
- return d === 62 ? (e.consume(d), L) : t(d);
3632
+ function U(d) {
3633
+ return d === null || d === 34 || d === 39 || d === 47 || d === 60 || d === 61 || d === 62 || d === 96 || re(d) ? q(d) : (e.consume(d), U);
3621
3634
  }
3622
- function L(d) {
3623
- return d === null || M(d) ? v(d) : U(d) ? (e.consume(d), L) : t(d);
3635
+ function $(d) {
3636
+ return d === 47 || d === 62 || W(d) ? v(d) : t(d);
3624
3637
  }
3625
- function v(d) {
3626
- return d === 45 && i === 2 ? (e.consume(d), z) : d === 60 && i === 1 ? (e.consume(d), q) : d === 62 && i === 4 ? (e.consume(d), le) : d === 63 && i === 3 ? (e.consume(d), f) : d === 93 && i === 5 ? (e.consume(d), J) : M(d) && (i === 6 || i === 7) ? (e.exit("htmlFlowData"), e.check(Gl, ke, P)(d)) : d === null || M(d) ? (e.exit("htmlFlowData"), P(d)) : (e.consume(d), v);
3638
+ function V(d) {
3639
+ return d === 62 ? (e.consume(d), P) : t(d);
3627
3640
  }
3628
3641
  function P(d) {
3629
- return e.check(eo, I, ke)(d);
3642
+ return d === null || M(d) ? _(d) : W(d) ? (e.consume(d), P) : t(d);
3630
3643
  }
3631
- function I(d) {
3632
- return e.enter("lineEnding"), e.consume(d), e.exit("lineEnding"), x;
3633
- }
3634
- function x(d) {
3635
- return d === null || M(d) ? P(d) : (e.enter("htmlFlowData"), v(d));
3644
+ function _(d) {
3645
+ return d === 45 && i === 2 ? (e.consume(d), N) : d === 60 && i === 1 ? (e.consume(d), T) : d === 62 && i === 4 ? (e.consume(d), le) : d === 63 && i === 3 ? (e.consume(d), f) : d === 93 && i === 5 ? (e.consume(d), Q) : M(d) && (i === 6 || i === 7) ? (e.exit("htmlFlowData"), e.check(Gl, ue, z)(d)) : d === null || M(d) ? (e.exit("htmlFlowData"), z(d)) : (e.consume(d), _);
3636
3646
  }
3637
3647
  function z(d) {
3638
- return d === 45 ? (e.consume(d), f) : v(d);
3648
+ return e.check(eo, L, ue)(d);
3639
3649
  }
3640
- function q(d) {
3641
- return d === 47 ? (e.consume(d), o = "", Y) : v(d);
3650
+ function L(d) {
3651
+ return e.enter("lineEnding"), e.consume(d), e.exit("lineEnding"), b;
3652
+ }
3653
+ function b(d) {
3654
+ return d === null || M(d) ? z(d) : (e.enter("htmlFlowData"), _(d));
3655
+ }
3656
+ function N(d) {
3657
+ return d === 45 ? (e.consume(d), f) : _(d);
3658
+ }
3659
+ function T(d) {
3660
+ return d === 47 ? (e.consume(d), o = "", F) : _(d);
3642
3661
  }
3643
- function Y(d) {
3662
+ function F(d) {
3644
3663
  if (d === 62) {
3645
- const he = o.toLowerCase();
3646
- return Tt.includes(he) ? (e.consume(d), le) : v(d);
3664
+ const fe = o.toLowerCase();
3665
+ return Tt.includes(fe) ? (e.consume(d), le) : _(d);
3647
3666
  }
3648
- return ye(d) && o.length < 8 ? (e.consume(d), o += String.fromCharCode(d), Y) : v(d);
3667
+ return xe(d) && o.length < 8 ? (e.consume(d), o += String.fromCharCode(d), F) : _(d);
3649
3668
  }
3650
- function J(d) {
3651
- return d === 93 ? (e.consume(d), f) : v(d);
3669
+ function Q(d) {
3670
+ return d === 93 ? (e.consume(d), f) : _(d);
3652
3671
  }
3653
3672
  function f(d) {
3654
- return d === 62 ? (e.consume(d), le) : d === 45 && i === 2 ? (e.consume(d), f) : v(d);
3673
+ return d === 62 ? (e.consume(d), le) : d === 45 && i === 2 ? (e.consume(d), f) : _(d);
3655
3674
  }
3656
3675
  function le(d) {
3657
- return d === null || M(d) ? (e.exit("htmlFlowData"), ke(d)) : (e.consume(d), le);
3676
+ return d === null || M(d) ? (e.exit("htmlFlowData"), ue(d)) : (e.consume(d), le);
3658
3677
  }
3659
- function ke(d) {
3678
+ function ue(d) {
3660
3679
  return e.exit("htmlFlow"), n(d);
3661
3680
  }
3662
3681
  }
@@ -3688,88 +3707,88 @@ function oo(e, n, t) {
3688
3707
  return e.enter("htmlText"), e.enter("htmlTextData"), e.consume(f), c;
3689
3708
  }
3690
3709
  function c(f) {
3691
- return f === 33 ? (e.consume(f), s) : f === 47 ? (e.consume(f), j) : f === 63 ? (e.consume(f), T) : ye(f) ? (e.consume(f), V) : t(f);
3710
+ return f === 33 ? (e.consume(f), s) : f === 47 ? (e.consume(f), q) : f === 63 ? (e.consume(f), v) : xe(f) ? (e.consume(f), U) : t(f);
3692
3711
  }
3693
3712
  function s(f) {
3694
- return f === 45 ? (e.consume(f), u) : f === 91 ? (e.consume(f), l = 0, C) : ye(f) ? (e.consume(f), N) : t(f);
3713
+ return f === 45 ? (e.consume(f), u) : f === 91 ? (e.consume(f), l = 0, C) : xe(f) ? (e.consume(f), A) : t(f);
3695
3714
  }
3696
3715
  function u(f) {
3697
3716
  return f === 45 ? (e.consume(f), h) : t(f);
3698
3717
  }
3699
3718
  function p(f) {
3700
- return f === null ? t(f) : f === 45 ? (e.consume(f), m) : M(f) ? (o = p, q(f)) : (e.consume(f), p);
3719
+ return f === null ? t(f) : f === 45 ? (e.consume(f), m) : M(f) ? (o = p, T(f)) : (e.consume(f), p);
3701
3720
  }
3702
3721
  function m(f) {
3703
3722
  return f === 45 ? (e.consume(f), h) : p(f);
3704
3723
  }
3705
3724
  function h(f) {
3706
- return f === 62 ? z(f) : f === 45 ? m(f) : p(f);
3725
+ return f === 62 ? N(f) : f === 45 ? m(f) : p(f);
3707
3726
  }
3708
3727
  function C(f) {
3709
3728
  const le = "CDATA[";
3710
3729
  return f === le.charCodeAt(l++) ? (e.consume(f), l === le.length ? E : C) : t(f);
3711
3730
  }
3712
3731
  function E(f) {
3713
- return f === null ? t(f) : f === 93 ? (e.consume(f), S) : M(f) ? (o = E, q(f)) : (e.consume(f), E);
3732
+ return f === null ? t(f) : f === 93 ? (e.consume(f), I) : M(f) ? (o = E, T(f)) : (e.consume(f), E);
3714
3733
  }
3715
- function S(f) {
3734
+ function I(f) {
3716
3735
  return f === 93 ? (e.consume(f), y) : E(f);
3717
3736
  }
3718
3737
  function y(f) {
3719
- return f === 62 ? z(f) : f === 93 ? (e.consume(f), y) : E(f);
3720
- }
3721
- function N(f) {
3722
- return f === null || f === 62 ? z(f) : M(f) ? (o = N, q(f)) : (e.consume(f), N);
3738
+ return f === 62 ? N(f) : f === 93 ? (e.consume(f), y) : E(f);
3723
3739
  }
3724
- function T(f) {
3725
- return f === null ? t(f) : f === 63 ? (e.consume(f), H) : M(f) ? (o = T, q(f)) : (e.consume(f), T);
3726
- }
3727
- function H(f) {
3728
- return f === 62 ? z(f) : T(f);
3740
+ function A(f) {
3741
+ return f === null || f === 62 ? N(f) : M(f) ? (o = A, T(f)) : (e.consume(f), A);
3729
3742
  }
3730
- function j(f) {
3731
- return ye(f) ? (e.consume(f), b) : t(f);
3743
+ function v(f) {
3744
+ return f === null ? t(f) : f === 63 ? (e.consume(f), R) : M(f) ? (o = v, T(f)) : (e.consume(f), v);
3732
3745
  }
3733
- function b(f) {
3734
- return f === 45 || se(f) ? (e.consume(f), b) : F(f);
3746
+ function R(f) {
3747
+ return f === 62 ? N(f) : v(f);
3735
3748
  }
3736
- function F(f) {
3737
- return M(f) ? (o = F, q(f)) : U(f) ? (e.consume(f), F) : z(f);
3749
+ function q(f) {
3750
+ return xe(f) ? (e.consume(f), x) : t(f);
3738
3751
  }
3739
- function V(f) {
3740
- return f === 45 || se(f) ? (e.consume(f), V) : f === 47 || f === 62 || re(f) ? O(f) : t(f);
3752
+ function x(f) {
3753
+ return f === 45 || se(f) ? (e.consume(f), x) : O(f);
3741
3754
  }
3742
3755
  function O(f) {
3743
- return f === 47 ? (e.consume(f), z) : f === 58 || f === 95 || ye(f) ? (e.consume(f), A) : M(f) ? (o = O, q(f)) : U(f) ? (e.consume(f), O) : z(f);
3756
+ return M(f) ? (o = O, T(f)) : W(f) ? (e.consume(f), O) : N(f);
3744
3757
  }
3745
- function A(f) {
3746
- return f === 45 || f === 46 || f === 58 || f === 95 || se(f) ? (e.consume(f), A) : L(f);
3758
+ function U(f) {
3759
+ return f === 45 || se(f) ? (e.consume(f), U) : f === 47 || f === 62 || re(f) ? $(f) : t(f);
3747
3760
  }
3748
- function L(f) {
3749
- return f === 61 ? (e.consume(f), v) : M(f) ? (o = L, q(f)) : U(f) ? (e.consume(f), L) : O(f);
3761
+ function $(f) {
3762
+ return f === 47 ? (e.consume(f), N) : f === 58 || f === 95 || xe(f) ? (e.consume(f), V) : M(f) ? (o = $, T(f)) : W(f) ? (e.consume(f), $) : N(f);
3750
3763
  }
3751
- function v(f) {
3752
- return f === null || f === 60 || f === 61 || f === 62 || f === 96 ? t(f) : f === 34 || f === 39 ? (e.consume(f), i = f, P) : M(f) ? (o = v, q(f)) : U(f) ? (e.consume(f), v) : (e.consume(f), I);
3764
+ function V(f) {
3765
+ return f === 45 || f === 46 || f === 58 || f === 95 || se(f) ? (e.consume(f), V) : P(f);
3753
3766
  }
3754
3767
  function P(f) {
3755
- return f === i ? (e.consume(f), i = void 0, x) : f === null ? t(f) : M(f) ? (o = P, q(f)) : (e.consume(f), P);
3768
+ return f === 61 ? (e.consume(f), _) : M(f) ? (o = P, T(f)) : W(f) ? (e.consume(f), P) : $(f);
3756
3769
  }
3757
- function I(f) {
3758
- return f === null || f === 34 || f === 39 || f === 60 || f === 61 || f === 96 ? t(f) : f === 47 || f === 62 || re(f) ? O(f) : (e.consume(f), I);
3759
- }
3760
- function x(f) {
3761
- return f === 47 || f === 62 || re(f) ? O(f) : t(f);
3770
+ function _(f) {
3771
+ return f === null || f === 60 || f === 61 || f === 62 || f === 96 ? t(f) : f === 34 || f === 39 ? (e.consume(f), i = f, z) : M(f) ? (o = _, T(f)) : W(f) ? (e.consume(f), _) : (e.consume(f), L);
3762
3772
  }
3763
3773
  function z(f) {
3774
+ return f === i ? (e.consume(f), i = void 0, b) : f === null ? t(f) : M(f) ? (o = z, T(f)) : (e.consume(f), z);
3775
+ }
3776
+ function L(f) {
3777
+ return f === null || f === 34 || f === 39 || f === 60 || f === 61 || f === 96 ? t(f) : f === 47 || f === 62 || re(f) ? $(f) : (e.consume(f), L);
3778
+ }
3779
+ function b(f) {
3780
+ return f === 47 || f === 62 || re(f) ? $(f) : t(f);
3781
+ }
3782
+ function N(f) {
3764
3783
  return f === 62 ? (e.consume(f), e.exit("htmlTextData"), e.exit("htmlText"), n) : t(f);
3765
3784
  }
3766
- function q(f) {
3767
- return e.exit("htmlTextData"), e.enter("lineEnding"), e.consume(f), e.exit("lineEnding"), Y;
3785
+ function T(f) {
3786
+ return e.exit("htmlTextData"), e.enter("lineEnding"), e.consume(f), e.exit("lineEnding"), F;
3768
3787
  }
3769
- function Y(f) {
3770
- return U(f) ? K(e, J, "linePrefix", r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(f) : J(f);
3788
+ function F(f) {
3789
+ return W(f) ? K(e, Q, "linePrefix", r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(f) : Q(f);
3771
3790
  }
3772
- function J(f) {
3791
+ function Q(f) {
3773
3792
  return e.enter("htmlTextData"), o(f);
3774
3793
  }
3775
3794
  }
@@ -3795,7 +3814,7 @@ function co(e) {
3795
3814
  r.type = "data", n += i;
3796
3815
  }
3797
3816
  }
3798
- return e.length !== t.length && xe(e, 0, e.length, t), e;
3817
+ return e.length !== t.length && ke(e, 0, e.length, t), e;
3799
3818
  }
3800
3819
  function po(e, n) {
3801
3820
  let t = e.length, r = 0, i, l, o, a;
@@ -3835,7 +3854,7 @@ function po(e, n) {
3835
3854
  ...e[o - 2][1].start
3836
3855
  }
3837
3856
  };
3838
- return a = [["enter", c, n], ["enter", s, n]], a = ce(a, e.slice(l + 1, l + r + 3)), a = ce(a, [["enter", u, n]]), a = ce(a, Qn(n.parser.constructs.insideSpan.null, e.slice(l + r + 4, o - 3), n)), a = ce(a, [["exit", u, n], e[o - 2], e[o - 1], ["exit", s, n]]), a = ce(a, e.slice(o + 1)), a = ce(a, [["exit", c, n]]), xe(e, l, e.length, a), e;
3857
+ return a = [["enter", c, n], ["enter", s, n]], a = pe(a, e.slice(l + 1, l + r + 3)), a = pe(a, [["enter", u, n]]), a = pe(a, Qn(n.parser.constructs.insideSpan.null, e.slice(l + r + 4, o - 3), n)), a = pe(a, [["exit", u, n], e[o - 2], e[o - 1], ["exit", s, n]]), a = pe(a, e.slice(o + 1)), a = pe(a, [["exit", c, n]]), ke(e, l, e.length, a), e;
3839
3858
  }
3840
3859
  function ho(e, n, t) {
3841
3860
  const r = this;
@@ -3847,7 +3866,7 @@ function ho(e, n, t) {
3847
3866
  }
3848
3867
  return a;
3849
3868
  function a(m) {
3850
- return l ? l._inactive ? p(m) : (o = r.parser.defined.includes(Oe(r.sliceSerialize({
3869
+ return l ? l._inactive ? p(m) : (o = r.parser.defined.includes(Fe(r.sliceSerialize({
3851
3870
  start: l.end,
3852
3871
  end: r.now()
3853
3872
  }))), e.enter("labelEnd"), e.enter("labelMarker"), e.consume(m), e.exit("labelMarker"), e.exit("labelEnd"), c) : t(m);
@@ -3871,13 +3890,13 @@ function fo(e, n, t) {
3871
3890
  return e.enter("resource"), e.enter("resourceMarker"), e.consume(p), e.exit("resourceMarker"), i;
3872
3891
  }
3873
3892
  function i(p) {
3874
- return re(p) ? Qe(e, l)(p) : l(p);
3893
+ return re(p) ? Ze(e, l)(p) : l(p);
3875
3894
  }
3876
3895
  function l(p) {
3877
3896
  return p === 41 ? u(p) : yr(e, o, a, "resourceDestination", "resourceDestinationLiteral", "resourceDestinationLiteralMarker", "resourceDestinationRaw", "resourceDestinationString", 32)(p);
3878
3897
  }
3879
3898
  function o(p) {
3880
- return re(p) ? Qe(e, c)(p) : u(p);
3899
+ return re(p) ? Ze(e, c)(p) : u(p);
3881
3900
  }
3882
3901
  function a(p) {
3883
3902
  return t(p);
@@ -3886,7 +3905,7 @@ function fo(e, n, t) {
3886
3905
  return p === 34 || p === 39 || p === 40 ? kr(e, s, t, "resourceTitle", "resourceTitleMarker", "resourceTitleString")(p) : u(p);
3887
3906
  }
3888
3907
  function s(p) {
3889
- return re(p) ? Qe(e, u)(p) : u(p);
3908
+ return re(p) ? Ze(e, u)(p) : u(p);
3890
3909
  }
3891
3910
  function u(p) {
3892
3911
  return p === 41 ? (e.enter("resourceMarker"), e.consume(p), e.exit("resourceMarker"), e.exit("resource"), n) : t(p);
@@ -3899,7 +3918,7 @@ function mo(e, n, t) {
3899
3918
  return xr.call(r, e, l, o, "reference", "referenceMarker", "referenceString")(a);
3900
3919
  }
3901
3920
  function l(a) {
3902
- return r.parser.defined.includes(Oe(r.sliceSerialize(r.events[r.events.length - 1][1]).slice(1, -1))) ? n(a) : t(a);
3921
+ return r.parser.defined.includes(Fe(r.sliceSerialize(r.events[r.events.length - 1][1]).slice(1, -1))) ? n(a) : t(a);
3903
3922
  }
3904
3923
  function o(a) {
3905
3924
  return t(a);
@@ -3974,7 +3993,7 @@ function Co(e, n, t) {
3974
3993
  return s === i ? (e.enter("thematicBreakSequence"), c(s)) : r >= 3 && (s === null || M(s)) ? (e.exit("thematicBreak"), n(s)) : t(s);
3975
3994
  }
3976
3995
  function c(s) {
3977
- return s === i ? (e.consume(s), r++, c) : (e.exit("thematicBreakSequence"), U(s) ? K(e, a, "whitespace")(s) : a(s));
3996
+ return s === i ? (e.consume(s), r++, c) : (e.exit("thematicBreakSequence"), W(s) ? K(e, a, "whitespace")(s) : a(s));
3978
3997
  }
3979
3998
  }
3980
3999
  const te = {
@@ -4022,7 +4041,7 @@ function Io(e, n, t) {
4022
4041
  return r.containerState.initialBlankLine = !0, l++, m(h);
4023
4042
  }
4024
4043
  function p(h) {
4025
- return U(h) ? (e.enter("listItemPrefixWhitespace"), e.consume(h), e.exit("listItemPrefixWhitespace"), m) : t(h);
4044
+ return W(h) ? (e.enter("listItemPrefixWhitespace"), e.consume(h), e.exit("listItemPrefixWhitespace"), m) : t(h);
4026
4045
  }
4027
4046
  function m(h) {
4028
4047
  return r.containerState.size = l + r.sliceSerialize(e.exit("listItemPrefix"), !0).length, n(h);
@@ -4035,7 +4054,7 @@ function Eo(e, n, t) {
4035
4054
  return r.containerState.furtherBlankLines = r.containerState.furtherBlankLines || r.containerState.initialBlankLine, K(e, n, "listItemIndent", r.containerState.size + 1)(a);
4036
4055
  }
4037
4056
  function l(a) {
4038
- return r.containerState.furtherBlankLines || !U(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(So, n, o)(a));
4057
+ return r.containerState.furtherBlankLines || !W(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(So, n, o)(a));
4039
4058
  }
4040
4059
  function o(a) {
4041
4060
  return r.containerState._closeFlow = !0, r.interrupt = void 0, K(e, e.attempt(te, n, t), "linePrefix", r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(a);
@@ -4057,7 +4076,7 @@ function Lo(e, n, t) {
4057
4076
  return K(e, i, "listItemPrefixWhitespace", r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 5);
4058
4077
  function i(l) {
4059
4078
  const o = r.events[r.events.length - 1];
4060
- return !U(l) && o && o[1].type === "listItemPrefixWhitespace" ? n(l) : t(l);
4079
+ return !W(l) && o && o[1].type === "listItemPrefixWhitespace" ? n(l) : t(l);
4061
4080
  }
4062
4081
  }
4063
4082
  const Lt = {
@@ -4106,7 +4125,7 @@ function No(e, n, t) {
4106
4125
  return e.enter("setextHeadingLineSequence"), a(s);
4107
4126
  }
4108
4127
  function a(s) {
4109
- return s === i ? (e.consume(s), a) : (e.exit("setextHeadingLineSequence"), U(s) ? K(e, c, "lineSuffix")(s) : c(s));
4128
+ return s === i ? (e.consume(s), a) : (e.exit("setextHeadingLineSequence"), W(s) ? K(e, c, "lineSuffix")(s) : c(s));
4110
4129
  }
4111
4130
  function c(s) {
4112
4131
  return s === null || M(s) ? (e.exit("setextHeadingLine"), n(s)) : t(s);
@@ -4304,12 +4323,12 @@ function Xo(e, n, t) {
4304
4323
  const i = {}, l = [];
4305
4324
  let o = [], a = [];
4306
4325
  const c = {
4307
- attempt: F(j),
4308
- check: F(b),
4309
- consume: N,
4310
- enter: T,
4311
- exit: H,
4312
- interrupt: F(b, {
4326
+ attempt: O(q),
4327
+ check: O(x),
4328
+ consume: A,
4329
+ enter: v,
4330
+ exit: R,
4331
+ interrupt: O(x, {
4313
4332
  interrupt: !0
4314
4333
  })
4315
4334
  }, s = {
@@ -4326,133 +4345,133 @@ function Xo(e, n, t) {
4326
4345
  };
4327
4346
  let u = n.tokenize.call(s, c);
4328
4347
  return n.resolveAll && l.push(n), s;
4329
- function p(L) {
4330
- return o = ce(o, L), S(), o[o.length - 1] !== null ? [] : (V(n, 0), s.events = Qn(l, s.events, s), s.events);
4348
+ function p(P) {
4349
+ return o = pe(o, P), I(), o[o.length - 1] !== null ? [] : (U(n, 0), s.events = Qn(l, s.events, s), s.events);
4331
4350
  }
4332
- function m(L, v) {
4333
- return Qo(h(L), v);
4351
+ function m(P, _) {
4352
+ return Qo(h(P), _);
4334
4353
  }
4335
- function h(L) {
4336
- return Ko(o, L);
4354
+ function h(P) {
4355
+ return Ko(o, P);
4337
4356
  }
4338
4357
  function C() {
4339
4358
  const {
4340
- _bufferIndex: L,
4341
- _index: v,
4342
- line: P,
4343
- column: I,
4344
- offset: x
4359
+ _bufferIndex: P,
4360
+ _index: _,
4361
+ line: z,
4362
+ column: L,
4363
+ offset: b
4345
4364
  } = r;
4346
4365
  return {
4347
- _bufferIndex: L,
4348
- _index: v,
4349
- line: P,
4350
- column: I,
4351
- offset: x
4366
+ _bufferIndex: P,
4367
+ _index: _,
4368
+ line: z,
4369
+ column: L,
4370
+ offset: b
4352
4371
  };
4353
4372
  }
4354
- function E(L) {
4355
- i[L.line] = L.column, A();
4373
+ function E(P) {
4374
+ i[P.line] = P.column, V();
4356
4375
  }
4357
- function S() {
4358
- let L;
4376
+ function I() {
4377
+ let P;
4359
4378
  for (; r._index < o.length; ) {
4360
- const v = o[r._index];
4361
- if (typeof v == "string")
4362
- for (L = r._index, r._bufferIndex < 0 && (r._bufferIndex = 0); r._index === L && r._bufferIndex < v.length; )
4363
- y(v.charCodeAt(r._bufferIndex));
4379
+ const _ = o[r._index];
4380
+ if (typeof _ == "string")
4381
+ for (P = r._index, r._bufferIndex < 0 && (r._bufferIndex = 0); r._index === P && r._bufferIndex < _.length; )
4382
+ y(_.charCodeAt(r._bufferIndex));
4364
4383
  else
4365
- y(v);
4384
+ y(_);
4366
4385
  }
4367
4386
  }
4368
- function y(L) {
4369
- u = u(L);
4387
+ function y(P) {
4388
+ u = u(P);
4370
4389
  }
4371
- function N(L) {
4372
- M(L) ? (r.line++, r.column = 1, r.offset += L === -3 ? 2 : 1, A()) : L !== -1 && (r.column++, r.offset++), r._bufferIndex < 0 ? r._index++ : (r._bufferIndex++, r._bufferIndex === // Points w/ non-negative `_bufferIndex` reference
4390
+ function A(P) {
4391
+ M(P) ? (r.line++, r.column = 1, r.offset += P === -3 ? 2 : 1, V()) : P !== -1 && (r.column++, r.offset++), r._bufferIndex < 0 ? r._index++ : (r._bufferIndex++, r._bufferIndex === // Points w/ non-negative `_bufferIndex` reference
4373
4392
  // strings.
4374
4393
  /** @type {string} */
4375
- o[r._index].length && (r._bufferIndex = -1, r._index++)), s.previous = L;
4394
+ o[r._index].length && (r._bufferIndex = -1, r._index++)), s.previous = P;
4376
4395
  }
4377
- function T(L, v) {
4378
- const P = v || {};
4379
- return P.type = L, P.start = C(), s.events.push(["enter", P, s]), a.push(P), P;
4396
+ function v(P, _) {
4397
+ const z = _ || {};
4398
+ return z.type = P, z.start = C(), s.events.push(["enter", z, s]), a.push(z), z;
4380
4399
  }
4381
- function H(L) {
4382
- const v = a.pop();
4383
- return v.end = C(), s.events.push(["exit", v, s]), v;
4400
+ function R(P) {
4401
+ const _ = a.pop();
4402
+ return _.end = C(), s.events.push(["exit", _, s]), _;
4384
4403
  }
4385
- function j(L, v) {
4386
- V(L, v.from);
4404
+ function q(P, _) {
4405
+ U(P, _.from);
4387
4406
  }
4388
- function b(L, v) {
4389
- v.restore();
4407
+ function x(P, _) {
4408
+ _.restore();
4390
4409
  }
4391
- function F(L, v) {
4392
- return P;
4393
- function P(I, x, z) {
4394
- let q, Y, J, f;
4395
- return Array.isArray(I) ? (
4410
+ function O(P, _) {
4411
+ return z;
4412
+ function z(L, b, N) {
4413
+ let T, F, Q, f;
4414
+ return Array.isArray(L) ? (
4396
4415
  /* c8 ignore next 1 */
4397
- ke(I)
4398
- ) : "tokenize" in I ? (
4416
+ ue(L)
4417
+ ) : "tokenize" in L ? (
4399
4418
  // Looks like a construct.
4400
- ke([
4419
+ ue([
4401
4420
  /** @type {Construct} */
4402
- I
4421
+ L
4403
4422
  ])
4404
- ) : le(I);
4405
- function le(Z) {
4406
- return $e;
4407
- function $e(Ce) {
4408
- const Pe = Ce !== null && Z[Ce], Ne = Ce !== null && Z.null, ln = [
4423
+ ) : le(L);
4424
+ function le(J) {
4425
+ return je;
4426
+ function je(Ce) {
4427
+ const Pe = Ce !== null && J[Ce], Ne = Ce !== null && J.null, ln = [
4409
4428
  // To do: add more extension tests.
4410
4429
  /* c8 ignore next 2 */
4411
4430
  ...Array.isArray(Pe) ? Pe : Pe ? [Pe] : [],
4412
4431
  ...Array.isArray(Ne) ? Ne : Ne ? [Ne] : []
4413
4432
  ];
4414
- return ke(ln)(Ce);
4433
+ return ue(ln)(Ce);
4415
4434
  }
4416
4435
  }
4417
- function ke(Z) {
4418
- return q = Z, Y = 0, Z.length === 0 ? z : d(Z[Y]);
4436
+ function ue(J) {
4437
+ return T = J, F = 0, J.length === 0 ? N : d(J[F]);
4419
4438
  }
4420
- function d(Z) {
4421
- return $e;
4422
- function $e(Ce) {
4423
- return f = O(), J = Z, Z.partial || (s.currentConstruct = Z), Z.name && s.parser.constructs.disable.null.includes(Z.name) ? ve() : Z.tokenize.call(
4439
+ function d(J) {
4440
+ return je;
4441
+ function je(Ce) {
4442
+ return f = $(), Q = J, J.partial || (s.currentConstruct = J), J.name && s.parser.constructs.disable.null.includes(J.name) ? ve() : J.tokenize.call(
4424
4443
  // If we do have fields, create an object w/ `context` as its
4425
4444
  // prototype.
4426
4445
  // This allows a “live binding”, which is needed for `interrupt`.
4427
- v ? Object.assign(Object.create(s), v) : s,
4446
+ _ ? Object.assign(Object.create(s), _) : s,
4428
4447
  c,
4429
- he,
4448
+ fe,
4430
4449
  ve
4431
4450
  )(Ce);
4432
4451
  }
4433
4452
  }
4434
- function he(Z) {
4435
- return L(J, f), x;
4453
+ function fe(J) {
4454
+ return P(Q, f), b;
4436
4455
  }
4437
- function ve(Z) {
4438
- return f.restore(), ++Y < q.length ? d(q[Y]) : z;
4456
+ function ve(J) {
4457
+ return f.restore(), ++F < T.length ? d(T[F]) : N;
4439
4458
  }
4440
4459
  }
4441
4460
  }
4442
- function V(L, v) {
4443
- L.resolveAll && !l.includes(L) && l.push(L), L.resolve && xe(s.events, v, s.events.length - v, L.resolve(s.events.slice(v), s)), L.resolveTo && (s.events = L.resolveTo(s.events, s));
4461
+ function U(P, _) {
4462
+ P.resolveAll && !l.includes(P) && l.push(P), P.resolve && ke(s.events, _, s.events.length - _, P.resolve(s.events.slice(_), s)), P.resolveTo && (s.events = P.resolveTo(s.events, s));
4444
4463
  }
4445
- function O() {
4446
- const L = C(), v = s.previous, P = s.currentConstruct, I = s.events.length, x = Array.from(a);
4464
+ function $() {
4465
+ const P = C(), _ = s.previous, z = s.currentConstruct, L = s.events.length, b = Array.from(a);
4447
4466
  return {
4448
- from: I,
4449
- restore: z
4467
+ from: L,
4468
+ restore: N
4450
4469
  };
4451
- function z() {
4452
- r = L, s.previous = v, s.currentConstruct = P, s.events.length = I, a = x, A();
4470
+ function N() {
4471
+ r = P, s.previous = _, s.currentConstruct = z, s.events.length = L, a = b, V();
4453
4472
  }
4454
4473
  }
4455
- function A() {
4474
+ function V() {
4456
4475
  r.line in i && r.column < 2 && (r.column = i[r.line], r.offset += i[r.line] - 1);
4457
4476
  }
4458
4477
  }
@@ -4596,20 +4615,20 @@ function ia(e) {
4596
4615
  canContainEols: ["emphasis", "fragment", "heading", "paragraph", "strong"],
4597
4616
  enter: {
4598
4617
  autolink: l(ot),
4599
- autolinkProtocol: O,
4600
- autolinkEmail: O,
4618
+ autolinkProtocol: $,
4619
+ autolinkEmail: $,
4601
4620
  atxHeading: l(rt),
4602
4621
  blockQuote: l(Ne),
4603
- characterEscape: O,
4604
- characterReference: O,
4622
+ characterEscape: $,
4623
+ characterReference: $,
4605
4624
  codeFenced: l(ln),
4606
4625
  codeFencedFenceInfo: o,
4607
4626
  codeFencedFenceMeta: o,
4608
4627
  codeIndented: l(ln, o),
4609
4628
  codeText: l(zr, o),
4610
- codeTextData: O,
4611
- data: O,
4612
- codeFlowValue: O,
4629
+ codeTextData: $,
4630
+ data: $,
4631
+ codeFlowValue: $,
4613
4632
  definition: l(Mr),
4614
4633
  definitionDestinationString: o,
4615
4634
  definitionLabelString: o,
@@ -4618,9 +4637,9 @@ function ia(e) {
4618
4637
  hardBreakEscape: l(it),
4619
4638
  hardBreakTrailing: l(it),
4620
4639
  htmlFlow: l(lt, o),
4621
- htmlFlowData: O,
4640
+ htmlFlowData: $,
4622
4641
  htmlText: l(lt, o),
4623
- htmlTextData: O,
4642
+ htmlTextData: $,
4624
4643
  image: l(Br),
4625
4644
  label: o,
4626
4645
  link: l(ot),
@@ -4639,52 +4658,52 @@ function ia(e) {
4639
4658
  },
4640
4659
  exit: {
4641
4660
  atxHeading: c(),
4642
- atxHeadingSequence: j,
4661
+ atxHeadingSequence: q,
4643
4662
  autolink: c(),
4644
4663
  autolinkEmail: Pe,
4645
4664
  autolinkProtocol: Ce,
4646
4665
  blockQuote: c(),
4647
- characterEscapeValue: A,
4666
+ characterEscapeValue: V,
4648
4667
  characterReferenceMarkerHexadecimal: ve,
4649
4668
  characterReferenceMarkerNumeric: ve,
4650
- characterReferenceValue: Z,
4651
- characterReference: $e,
4652
- codeFenced: c(S),
4669
+ characterReferenceValue: J,
4670
+ characterReference: je,
4671
+ codeFenced: c(I),
4653
4672
  codeFencedFence: E,
4654
4673
  codeFencedFenceInfo: h,
4655
4674
  codeFencedFenceMeta: C,
4656
- codeFlowValue: A,
4675
+ codeFlowValue: V,
4657
4676
  codeIndented: c(y),
4658
- codeText: c(x),
4659
- codeTextData: A,
4660
- data: A,
4677
+ codeText: c(b),
4678
+ codeTextData: V,
4679
+ data: V,
4661
4680
  definition: c(),
4662
- definitionDestinationString: H,
4663
- definitionLabelString: N,
4664
- definitionTitleString: T,
4681
+ definitionDestinationString: R,
4682
+ definitionLabelString: A,
4683
+ definitionTitleString: v,
4665
4684
  emphasis: c(),
4666
- hardBreakEscape: c(v),
4667
- hardBreakTrailing: c(v),
4668
- htmlFlow: c(P),
4669
- htmlFlowData: A,
4670
- htmlText: c(I),
4671
- htmlTextData: A,
4672
- image: c(q),
4673
- label: J,
4674
- labelText: Y,
4675
- lineEnding: L,
4676
- link: c(z),
4685
+ hardBreakEscape: c(_),
4686
+ hardBreakTrailing: c(_),
4687
+ htmlFlow: c(z),
4688
+ htmlFlowData: V,
4689
+ htmlText: c(L),
4690
+ htmlTextData: V,
4691
+ image: c(T),
4692
+ label: Q,
4693
+ labelText: F,
4694
+ lineEnding: P,
4695
+ link: c(N),
4677
4696
  listItem: c(),
4678
4697
  listOrdered: c(),
4679
4698
  listUnordered: c(),
4680
4699
  paragraph: c(),
4681
- referenceString: he,
4700
+ referenceString: fe,
4682
4701
  resourceDestinationString: f,
4683
4702
  resourceTitleString: le,
4684
- resource: ke,
4685
- setextHeading: c(V),
4686
- setextHeadingLineSequence: F,
4687
- setextHeadingText: b,
4703
+ resource: ue,
4704
+ setextHeading: c(U),
4705
+ setextHeadingLineSequence: O,
4706
+ setextHeadingText: x,
4688
4707
  strong: c(),
4689
4708
  thematicBreak: c()
4690
4709
  }
@@ -4693,12 +4712,12 @@ function ia(e) {
4693
4712
  const t = {};
4694
4713
  return r;
4695
4714
  function r(g) {
4696
- let _ = {
4715
+ let S = {
4697
4716
  type: "root",
4698
4717
  children: []
4699
4718
  };
4700
4719
  const D = {
4701
- stack: [_],
4720
+ stack: [S],
4702
4721
  tokenStack: [],
4703
4722
  config: n,
4704
4723
  enter: a,
@@ -4706,27 +4725,27 @@ function ia(e) {
4706
4725
  buffer: o,
4707
4726
  resume: u,
4708
4727
  data: t
4709
- }, R = [];
4710
- let W = -1;
4711
- for (; ++W < g.length; )
4712
- if (g[W][1].type === "listOrdered" || g[W][1].type === "listUnordered")
4713
- if (g[W][0] === "enter")
4714
- R.push(W);
4728
+ }, j = [];
4729
+ let Y = -1;
4730
+ for (; ++Y < g.length; )
4731
+ if (g[Y][1].type === "listOrdered" || g[Y][1].type === "listUnordered")
4732
+ if (g[Y][0] === "enter")
4733
+ j.push(Y);
4715
4734
  else {
4716
- const fe = R.pop();
4717
- W = i(g, fe, W);
4735
+ const de = j.pop();
4736
+ Y = i(g, de, Y);
4718
4737
  }
4719
- for (W = -1; ++W < g.length; ) {
4720
- const fe = n[g[W][0]];
4721
- Cr.call(fe, g[W][1].type) && fe[g[W][1].type].call(Object.assign({
4722
- sliceSerialize: g[W][2].sliceSerialize
4723
- }, D), g[W][1]);
4738
+ for (Y = -1; ++Y < g.length; ) {
4739
+ const de = n[g[Y][0]];
4740
+ Cr.call(de, g[Y][1].type) && de[g[Y][1].type].call(Object.assign({
4741
+ sliceSerialize: g[Y][2].sliceSerialize
4742
+ }, D), g[Y][1]);
4724
4743
  }
4725
4744
  if (D.tokenStack.length > 0) {
4726
- const fe = D.tokenStack[D.tokenStack.length - 1];
4727
- (fe[1] || Nt).call(D, void 0, fe[0]);
4745
+ const de = D.tokenStack[D.tokenStack.length - 1];
4746
+ (de[1] || Nt).call(D, void 0, de[0]);
4728
4747
  }
4729
- for (_.position = {
4748
+ for (S.position = {
4730
4749
  start: _e(g.length > 0 ? g[0][1].start : {
4731
4750
  line: 1,
4732
4751
  column: 1,
@@ -4737,23 +4756,23 @@ function ia(e) {
4737
4756
  column: 1,
4738
4757
  offset: 0
4739
4758
  })
4740
- }, W = -1; ++W < n.transforms.length; )
4741
- _ = n.transforms[W](_) || _;
4742
- return _;
4743
- }
4744
- function i(g, _, D) {
4745
- let R = _ - 1, W = -1, fe = !1, Te, be, je, He;
4746
- for (; ++R <= D; ) {
4747
- const oe = g[R];
4759
+ }, Y = -1; ++Y < n.transforms.length; )
4760
+ S = n.transforms[Y](S) || S;
4761
+ return S;
4762
+ }
4763
+ function i(g, S, D) {
4764
+ let j = S - 1, Y = -1, de = !1, Te, be, He, Ve;
4765
+ for (; ++j <= D; ) {
4766
+ const oe = g[j];
4748
4767
  switch (oe[1].type) {
4749
4768
  case "listUnordered":
4750
4769
  case "listOrdered":
4751
4770
  case "blockQuote": {
4752
- oe[0] === "enter" ? W++ : W--, He = void 0;
4771
+ oe[0] === "enter" ? Y++ : Y--, Ve = void 0;
4753
4772
  break;
4754
4773
  }
4755
4774
  case "lineEndingBlank": {
4756
- oe[0] === "enter" && (Te && !He && !W && !je && (je = R), He = void 0);
4775
+ oe[0] === "enter" && (Te && !Ve && !Y && !He && (He = j), Ve = void 0);
4757
4776
  break;
4758
4777
  }
4759
4778
  case "linePrefix":
@@ -4763,19 +4782,19 @@ function ia(e) {
4763
4782
  case "listItemPrefixWhitespace":
4764
4783
  break;
4765
4784
  default:
4766
- He = void 0;
4785
+ Ve = void 0;
4767
4786
  }
4768
- if (!W && oe[0] === "enter" && oe[1].type === "listItemPrefix" || W === -1 && oe[0] === "exit" && (oe[1].type === "listUnordered" || oe[1].type === "listOrdered")) {
4787
+ if (!Y && oe[0] === "enter" && oe[1].type === "listItemPrefix" || Y === -1 && oe[0] === "exit" && (oe[1].type === "listUnordered" || oe[1].type === "listOrdered")) {
4769
4788
  if (Te) {
4770
- let Ae = R;
4789
+ let Ae = j;
4771
4790
  for (be = void 0; Ae--; ) {
4772
4791
  const we = g[Ae];
4773
4792
  if (we[1].type === "lineEnding" || we[1].type === "lineEndingBlank") {
4774
4793
  if (we[0] === "exit") continue;
4775
- be && (g[be][1].type = "lineEndingBlank", fe = !0), we[1].type = "lineEnding", be = Ae;
4794
+ be && (g[be][1].type = "lineEndingBlank", de = !0), we[1].type = "lineEnding", be = Ae;
4776
4795
  } else if (!(we[1].type === "linePrefix" || we[1].type === "blockQuotePrefix" || we[1].type === "blockQuotePrefixWhitespace" || we[1].type === "blockQuoteMarker" || we[1].type === "listItemIndent")) break;
4777
4796
  }
4778
- je && (!be || je < be) && (Te._spread = !0), Te.end = Object.assign({}, be ? g[be][1].start : oe[1].end), g.splice(be || R, 0, ["exit", Te, oe[2]]), R++, D++;
4797
+ He && (!be || He < be) && (Te._spread = !0), Te.end = Object.assign({}, be ? g[be][1].start : oe[1].end), g.splice(be || j, 0, ["exit", Te, oe[2]]), j++, D++;
4779
4798
  }
4780
4799
  if (oe[1].type === "listItemPrefix") {
4781
4800
  const Ae = {
@@ -4785,16 +4804,16 @@ function ia(e) {
4785
4804
  // @ts-expect-error: we’ll add `end` in a second.
4786
4805
  end: void 0
4787
4806
  };
4788
- Te = Ae, g.splice(R, 0, ["enter", Ae, oe[2]]), R++, D++, je = void 0, He = !0;
4807
+ Te = Ae, g.splice(j, 0, ["enter", Ae, oe[2]]), j++, D++, He = void 0, Ve = !0;
4789
4808
  }
4790
4809
  }
4791
4810
  }
4792
- return g[_][1]._spread = fe, D;
4811
+ return g[S][1]._spread = de, D;
4793
4812
  }
4794
- function l(g, _) {
4813
+ function l(g, S) {
4795
4814
  return D;
4796
- function D(R) {
4797
- a.call(this, g(R), R), _ && _.call(this, R);
4815
+ function D(j) {
4816
+ a.call(this, g(j), j), S && S.call(this, j);
4798
4817
  }
4799
4818
  }
4800
4819
  function o() {
@@ -4803,24 +4822,24 @@ function ia(e) {
4803
4822
  children: []
4804
4823
  });
4805
4824
  }
4806
- function a(g, _, D) {
4807
- this.stack[this.stack.length - 1].children.push(g), this.stack.push(g), this.tokenStack.push([_, D || void 0]), g.position = {
4808
- start: _e(_.start),
4825
+ function a(g, S, D) {
4826
+ this.stack[this.stack.length - 1].children.push(g), this.stack.push(g), this.tokenStack.push([S, D || void 0]), g.position = {
4827
+ start: _e(S.start),
4809
4828
  // @ts-expect-error: `end` will be patched later.
4810
4829
  end: void 0
4811
4830
  };
4812
4831
  }
4813
4832
  function c(g) {
4814
- return _;
4815
- function _(D) {
4833
+ return S;
4834
+ function S(D) {
4816
4835
  g && g.call(this, D), s.call(this, D);
4817
4836
  }
4818
4837
  }
4819
- function s(g, _) {
4820
- const D = this.stack.pop(), R = this.tokenStack.pop();
4821
- if (R)
4822
- R[0].type !== g.type && (_ ? _.call(this, g, R[0]) : (R[1] || Nt).call(this, g, R[0]));
4823
- else throw new Error("Cannot close `" + g.type + "` (" + Ke({
4838
+ function s(g, S) {
4839
+ const D = this.stack.pop(), j = this.tokenStack.pop();
4840
+ if (j)
4841
+ j[0].type !== g.type && (S ? S.call(this, g, j[0]) : (j[1] || Nt).call(this, g, j[0]));
4842
+ else throw new Error("Cannot close `" + g.type + "` (" + Qe({
4824
4843
  start: g.start,
4825
4844
  end: g.end
4826
4845
  }) + "): it’s not open");
@@ -4834,166 +4853,166 @@ function ia(e) {
4834
4853
  }
4835
4854
  function m(g) {
4836
4855
  if (this.data.expectingFirstListItemValue) {
4837
- const _ = this.stack[this.stack.length - 2];
4838
- _.start = Number.parseInt(this.sliceSerialize(g), 10), this.data.expectingFirstListItemValue = void 0;
4856
+ const S = this.stack[this.stack.length - 2];
4857
+ S.start = Number.parseInt(this.sliceSerialize(g), 10), this.data.expectingFirstListItemValue = void 0;
4839
4858
  }
4840
4859
  }
4841
4860
  function h() {
4842
- const g = this.resume(), _ = this.stack[this.stack.length - 1];
4843
- _.lang = g;
4861
+ const g = this.resume(), S = this.stack[this.stack.length - 1];
4862
+ S.lang = g;
4844
4863
  }
4845
4864
  function C() {
4846
- const g = this.resume(), _ = this.stack[this.stack.length - 1];
4847
- _.meta = g;
4865
+ const g = this.resume(), S = this.stack[this.stack.length - 1];
4866
+ S.meta = g;
4848
4867
  }
4849
4868
  function E() {
4850
4869
  this.data.flowCodeInside || (this.buffer(), this.data.flowCodeInside = !0);
4851
4870
  }
4852
- function S() {
4853
- const g = this.resume(), _ = this.stack[this.stack.length - 1];
4854
- _.value = g.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g, ""), this.data.flowCodeInside = void 0;
4871
+ function I() {
4872
+ const g = this.resume(), S = this.stack[this.stack.length - 1];
4873
+ S.value = g.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g, ""), this.data.flowCodeInside = void 0;
4855
4874
  }
4856
4875
  function y() {
4857
- const g = this.resume(), _ = this.stack[this.stack.length - 1];
4858
- _.value = g.replace(/(\r?\n|\r)$/g, "");
4876
+ const g = this.resume(), S = this.stack[this.stack.length - 1];
4877
+ S.value = g.replace(/(\r?\n|\r)$/g, "");
4859
4878
  }
4860
- function N(g) {
4861
- const _ = this.resume(), D = this.stack[this.stack.length - 1];
4862
- D.label = _, D.identifier = Oe(this.sliceSerialize(g)).toLowerCase();
4879
+ function A(g) {
4880
+ const S = this.resume(), D = this.stack[this.stack.length - 1];
4881
+ D.label = S, D.identifier = Fe(this.sliceSerialize(g)).toLowerCase();
4863
4882
  }
4864
- function T() {
4865
- const g = this.resume(), _ = this.stack[this.stack.length - 1];
4866
- _.title = g;
4883
+ function v() {
4884
+ const g = this.resume(), S = this.stack[this.stack.length - 1];
4885
+ S.title = g;
4867
4886
  }
4868
- function H() {
4869
- const g = this.resume(), _ = this.stack[this.stack.length - 1];
4870
- _.url = g;
4887
+ function R() {
4888
+ const g = this.resume(), S = this.stack[this.stack.length - 1];
4889
+ S.url = g;
4871
4890
  }
4872
- function j(g) {
4873
- const _ = this.stack[this.stack.length - 1];
4874
- if (!_.depth) {
4891
+ function q(g) {
4892
+ const S = this.stack[this.stack.length - 1];
4893
+ if (!S.depth) {
4875
4894
  const D = this.sliceSerialize(g).length;
4876
- _.depth = D;
4895
+ S.depth = D;
4877
4896
  }
4878
4897
  }
4879
- function b() {
4898
+ function x() {
4880
4899
  this.data.setextHeadingSlurpLineEnding = !0;
4881
4900
  }
4882
- function F(g) {
4883
- const _ = this.stack[this.stack.length - 1];
4884
- _.depth = this.sliceSerialize(g).codePointAt(0) === 61 ? 1 : 2;
4901
+ function O(g) {
4902
+ const S = this.stack[this.stack.length - 1];
4903
+ S.depth = this.sliceSerialize(g).codePointAt(0) === 61 ? 1 : 2;
4885
4904
  }
4886
- function V() {
4905
+ function U() {
4887
4906
  this.data.setextHeadingSlurpLineEnding = void 0;
4888
4907
  }
4889
- function O(g) {
4908
+ function $(g) {
4890
4909
  const D = this.stack[this.stack.length - 1].children;
4891
- let R = D[D.length - 1];
4892
- (!R || R.type !== "text") && (R = $r(), R.position = {
4910
+ let j = D[D.length - 1];
4911
+ (!j || j.type !== "text") && (j = $r(), j.position = {
4893
4912
  start: _e(g.start),
4894
4913
  // @ts-expect-error: we’ll add `end` later.
4895
4914
  end: void 0
4896
- }, D.push(R)), this.stack.push(R);
4915
+ }, D.push(j)), this.stack.push(j);
4897
4916
  }
4898
- function A(g) {
4899
- const _ = this.stack.pop();
4900
- _.value += this.sliceSerialize(g), _.position.end = _e(g.end);
4917
+ function V(g) {
4918
+ const S = this.stack.pop();
4919
+ S.value += this.sliceSerialize(g), S.position.end = _e(g.end);
4901
4920
  }
4902
- function L(g) {
4903
- const _ = this.stack[this.stack.length - 1];
4921
+ function P(g) {
4922
+ const S = this.stack[this.stack.length - 1];
4904
4923
  if (this.data.atHardBreak) {
4905
- const D = _.children[_.children.length - 1];
4924
+ const D = S.children[S.children.length - 1];
4906
4925
  D.position.end = _e(g.end), this.data.atHardBreak = void 0;
4907
4926
  return;
4908
4927
  }
4909
- !this.data.setextHeadingSlurpLineEnding && n.canContainEols.includes(_.type) && (O.call(this, g), A.call(this, g));
4928
+ !this.data.setextHeadingSlurpLineEnding && n.canContainEols.includes(S.type) && ($.call(this, g), V.call(this, g));
4910
4929
  }
4911
- function v() {
4930
+ function _() {
4912
4931
  this.data.atHardBreak = !0;
4913
4932
  }
4914
- function P() {
4915
- const g = this.resume(), _ = this.stack[this.stack.length - 1];
4916
- _.value = g;
4933
+ function z() {
4934
+ const g = this.resume(), S = this.stack[this.stack.length - 1];
4935
+ S.value = g;
4917
4936
  }
4918
- function I() {
4919
- const g = this.resume(), _ = this.stack[this.stack.length - 1];
4920
- _.value = g;
4937
+ function L() {
4938
+ const g = this.resume(), S = this.stack[this.stack.length - 1];
4939
+ S.value = g;
4921
4940
  }
4922
- function x() {
4923
- const g = this.resume(), _ = this.stack[this.stack.length - 1];
4924
- _.value = g;
4941
+ function b() {
4942
+ const g = this.resume(), S = this.stack[this.stack.length - 1];
4943
+ S.value = g;
4925
4944
  }
4926
- function z() {
4945
+ function N() {
4927
4946
  const g = this.stack[this.stack.length - 1];
4928
4947
  if (this.data.inReference) {
4929
- const _ = this.data.referenceType || "shortcut";
4930
- g.type += "Reference", g.referenceType = _, delete g.url, delete g.title;
4948
+ const S = this.data.referenceType || "shortcut";
4949
+ g.type += "Reference", g.referenceType = S, delete g.url, delete g.title;
4931
4950
  } else
4932
4951
  delete g.identifier, delete g.label;
4933
4952
  this.data.referenceType = void 0;
4934
4953
  }
4935
- function q() {
4954
+ function T() {
4936
4955
  const g = this.stack[this.stack.length - 1];
4937
4956
  if (this.data.inReference) {
4938
- const _ = this.data.referenceType || "shortcut";
4939
- g.type += "Reference", g.referenceType = _, delete g.url, delete g.title;
4957
+ const S = this.data.referenceType || "shortcut";
4958
+ g.type += "Reference", g.referenceType = S, delete g.url, delete g.title;
4940
4959
  } else
4941
4960
  delete g.identifier, delete g.label;
4942
4961
  this.data.referenceType = void 0;
4943
4962
  }
4944
- function Y(g) {
4945
- const _ = this.sliceSerialize(g), D = this.stack[this.stack.length - 2];
4946
- D.label = na(_), D.identifier = Oe(_).toLowerCase();
4963
+ function F(g) {
4964
+ const S = this.sliceSerialize(g), D = this.stack[this.stack.length - 2];
4965
+ D.label = na(S), D.identifier = Fe(S).toLowerCase();
4947
4966
  }
4948
- function J() {
4949
- const g = this.stack[this.stack.length - 1], _ = this.resume(), D = this.stack[this.stack.length - 1];
4967
+ function Q() {
4968
+ const g = this.stack[this.stack.length - 1], S = this.resume(), D = this.stack[this.stack.length - 1];
4950
4969
  if (this.data.inReference = !0, D.type === "link") {
4951
- const R = g.children;
4952
- D.children = R;
4970
+ const j = g.children;
4971
+ D.children = j;
4953
4972
  } else
4954
- D.alt = _;
4973
+ D.alt = S;
4955
4974
  }
4956
4975
  function f() {
4957
- const g = this.resume(), _ = this.stack[this.stack.length - 1];
4958
- _.url = g;
4976
+ const g = this.resume(), S = this.stack[this.stack.length - 1];
4977
+ S.url = g;
4959
4978
  }
4960
4979
  function le() {
4961
- const g = this.resume(), _ = this.stack[this.stack.length - 1];
4962
- _.title = g;
4980
+ const g = this.resume(), S = this.stack[this.stack.length - 1];
4981
+ S.title = g;
4963
4982
  }
4964
- function ke() {
4983
+ function ue() {
4965
4984
  this.data.inReference = void 0;
4966
4985
  }
4967
4986
  function d() {
4968
4987
  this.data.referenceType = "collapsed";
4969
4988
  }
4970
- function he(g) {
4971
- const _ = this.resume(), D = this.stack[this.stack.length - 1];
4972
- D.label = _, D.identifier = Oe(this.sliceSerialize(g)).toLowerCase(), this.data.referenceType = "full";
4989
+ function fe(g) {
4990
+ const S = this.resume(), D = this.stack[this.stack.length - 1];
4991
+ D.label = S, D.identifier = Fe(this.sliceSerialize(g)).toLowerCase(), this.data.referenceType = "full";
4973
4992
  }
4974
4993
  function ve(g) {
4975
4994
  this.data.characterReferenceType = g.type;
4976
4995
  }
4977
- function Z(g) {
4978
- const _ = this.sliceSerialize(g), D = this.data.characterReferenceType;
4979
- let R;
4980
- D ? (R = hr(_, D === "characterReferenceMarkerNumeric" ? 10 : 16), this.data.characterReferenceType = void 0) : R = Kn(_);
4981
- const W = this.stack[this.stack.length - 1];
4982
- W.value += R;
4996
+ function J(g) {
4997
+ const S = this.sliceSerialize(g), D = this.data.characterReferenceType;
4998
+ let j;
4999
+ D ? (j = hr(S, D === "characterReferenceMarkerNumeric" ? 10 : 16), this.data.characterReferenceType = void 0) : j = Kn(S);
5000
+ const Y = this.stack[this.stack.length - 1];
5001
+ Y.value += j;
4983
5002
  }
4984
- function $e(g) {
4985
- const _ = this.stack.pop();
4986
- _.position.end = _e(g.end);
5003
+ function je(g) {
5004
+ const S = this.stack.pop();
5005
+ S.position.end = _e(g.end);
4987
5006
  }
4988
5007
  function Ce(g) {
4989
- A.call(this, g);
4990
- const _ = this.stack[this.stack.length - 1];
4991
- _.url = this.sliceSerialize(g);
5008
+ V.call(this, g);
5009
+ const S = this.stack[this.stack.length - 1];
5010
+ S.url = this.sliceSerialize(g);
4992
5011
  }
4993
5012
  function Pe(g) {
4994
- A.call(this, g);
4995
- const _ = this.stack[this.stack.length - 1];
4996
- _.url = "mailto:" + this.sliceSerialize(g);
5013
+ V.call(this, g);
5014
+ const S = this.stack[this.stack.length - 1];
5015
+ S.url = "mailto:" + this.sliceSerialize(g);
4997
5016
  }
4998
5017
  function Ne() {
4999
5018
  return {
@@ -5144,13 +5163,13 @@ function la(e, n) {
5144
5163
  }
5145
5164
  }
5146
5165
  function Nt(e, n) {
5147
- throw e ? new Error("Cannot close `" + e.type + "` (" + Ke({
5166
+ throw e ? new Error("Cannot close `" + e.type + "` (" + Qe({
5148
5167
  start: e.start,
5149
5168
  end: e.end
5150
- }) + "): a different token (`" + n.type + "`, " + Ke({
5169
+ }) + "): a different token (`" + n.type + "`, " + Qe({
5151
5170
  start: n.start,
5152
5171
  end: n.end
5153
- }) + ") is open") : new Error("Cannot close document, a token (`" + n.type + "`, " + Ke({
5172
+ }) + ") is open") : new Error("Cannot close document, a token (`" + n.type + "`, " + Qe({
5154
5173
  start: n.start,
5155
5174
  end: n.end
5156
5175
  }) + ") is still open");
@@ -5215,7 +5234,7 @@ function pa(e, n) {
5215
5234
  return e.patch(n, t), e.applyData(n, t);
5216
5235
  }
5217
5236
  function ha(e, n) {
5218
- const t = typeof e.options.clobberPrefix == "string" ? e.options.clobberPrefix : "user-content-", r = String(n.identifier).toUpperCase(), i = Re(r.toLowerCase()), l = e.footnoteOrder.indexOf(r);
5237
+ const t = typeof e.options.clobberPrefix == "string" ? e.options.clobberPrefix : "user-content-", r = String(n.identifier).toUpperCase(), i = $e(r.toLowerCase()), l = e.footnoteOrder.indexOf(r);
5219
5238
  let o, a = e.footnoteCounts.get(r);
5220
5239
  a === void 0 ? (a = 0, e.footnoteOrder.push(r), o = e.footnoteOrder.length) : o = l + 1, a += 1, e.footnoteCounts.set(r, a);
5221
5240
  const c = {
@@ -5267,13 +5286,13 @@ function ma(e, n) {
5267
5286
  const t = String(n.identifier).toUpperCase(), r = e.definitionById.get(t);
5268
5287
  if (!r)
5269
5288
  return Sr(e, n);
5270
- const i = { src: Re(r.url || ""), alt: n.alt };
5289
+ const i = { src: $e(r.url || ""), alt: n.alt };
5271
5290
  r.title !== null && r.title !== void 0 && (i.title = r.title);
5272
5291
  const l = { type: "element", tagName: "img", properties: i, children: [] };
5273
5292
  return e.patch(n, l), e.applyData(n, l);
5274
5293
  }
5275
5294
  function ga(e, n) {
5276
- const t = { src: Re(n.url) };
5295
+ const t = { src: $e(n.url) };
5277
5296
  n.alt !== null && n.alt !== void 0 && (t.alt = n.alt), n.title !== null && n.title !== void 0 && (t.title = n.title);
5278
5297
  const r = { type: "element", tagName: "img", properties: t, children: [] };
5279
5298
  return e.patch(n, r), e.applyData(n, r);
@@ -5293,7 +5312,7 @@ function xa(e, n) {
5293
5312
  const t = String(n.identifier).toUpperCase(), r = e.definitionById.get(t);
5294
5313
  if (!r)
5295
5314
  return Sr(e, n);
5296
- const i = { href: Re(r.url || "") };
5315
+ const i = { href: $e(r.url || "") };
5297
5316
  r.title !== null && r.title !== void 0 && (i.title = r.title);
5298
5317
  const l = {
5299
5318
  type: "element",
@@ -5304,7 +5323,7 @@ function xa(e, n) {
5304
5323
  return e.patch(n, l), e.applyData(n, l);
5305
5324
  }
5306
5325
  function ka(e, n) {
5307
- const t = { href: Re(n.url) };
5326
+ const t = { href: $e(n.url) };
5308
5327
  n.title !== null && n.title !== void 0 && (t.title = n.title);
5309
5328
  const r = {
5310
5329
  type: "element",
@@ -5520,7 +5539,7 @@ const Aa = {
5520
5539
  };
5521
5540
  function on() {
5522
5541
  }
5523
- const Er = -1, gn = 0, Ze = 1, fn = 2, Jn = 3, Gn = 4, et = 5, nt = 6, vr = 7, Tr = 8, Dt = typeof self == "object" ? self : globalThis, za = (e, n) => {
5542
+ const Er = -1, gn = 0, Je = 1, fn = 2, Jn = 3, Gn = 4, et = 5, nt = 6, vr = 7, Tr = 8, Dt = typeof self == "object" ? self : globalThis, za = (e, n) => {
5524
5543
  const t = (i, l) => (e.set(l, i), i), r = (i) => {
5525
5544
  if (e.has(i))
5526
5545
  return e.get(i);
@@ -5529,7 +5548,7 @@ const Er = -1, gn = 0, Ze = 1, fn = 2, Jn = 3, Gn = 4, et = 5, nt = 6, vr = 7, T
5529
5548
  case gn:
5530
5549
  case Er:
5531
5550
  return t(o, i);
5532
- case Ze: {
5551
+ case Je: {
5533
5552
  const a = t([], i);
5534
5553
  for (const c of o)
5535
5554
  a.push(r(c));
@@ -5577,14 +5596,14 @@ const Er = -1, gn = 0, Ze = 1, fn = 2, Jn = 3, Gn = 4, et = 5, nt = 6, vr = 7, T
5577
5596
  return t(new Dt[l](o), i);
5578
5597
  };
5579
5598
  return r;
5580
- }, Bt = (e) => za(/* @__PURE__ */ new Map(), e)(0), Me = "", { toString: Ma } = {}, { keys: Da } = Object, Ye = (e) => {
5599
+ }, Bt = (e) => za(/* @__PURE__ */ new Map(), e)(0), Me = "", { toString: Ma } = {}, { keys: Da } = Object, Xe = (e) => {
5581
5600
  const n = typeof e;
5582
5601
  if (n !== "object" || !e)
5583
5602
  return [gn, n];
5584
5603
  const t = Ma.call(e).slice(8, -1);
5585
5604
  switch (t) {
5586
5605
  case "Array":
5587
- return [Ze, Me];
5606
+ return [Je, Me];
5588
5607
  case "Object":
5589
5608
  return [fn, Me];
5590
5609
  case "Date":
@@ -5596,9 +5615,9 @@ const Er = -1, gn = 0, Ze = 1, fn = 2, Jn = 3, Gn = 4, et = 5, nt = 6, vr = 7, T
5596
5615
  case "Set":
5597
5616
  return [nt, Me];
5598
5617
  case "DataView":
5599
- return [Ze, t];
5618
+ return [Je, t];
5600
5619
  }
5601
- return t.includes("Array") ? [Ze, t] : t.includes("Error") ? [vr, t] : [fn, t];
5620
+ return t.includes("Array") ? [Je, t] : t.includes("Error") ? [vr, t] : [fn, t];
5602
5621
  }, an = ([e, n]) => e === gn && (n === "function" || n === "symbol"), Ba = (e, n, t, r) => {
5603
5622
  const i = (o, a) => {
5604
5623
  const c = r.push(o) - 1;
@@ -5606,7 +5625,7 @@ const Er = -1, gn = 0, Ze = 1, fn = 2, Jn = 3, Gn = 4, et = 5, nt = 6, vr = 7, T
5606
5625
  }, l = (o) => {
5607
5626
  if (t.has(o))
5608
5627
  return t.get(o);
5609
- let [a, c] = Ye(o);
5628
+ let [a, c] = Xe(o);
5610
5629
  switch (a) {
5611
5630
  case gn: {
5612
5631
  let u = o;
@@ -5625,7 +5644,7 @@ const Er = -1, gn = 0, Ze = 1, fn = 2, Jn = 3, Gn = 4, et = 5, nt = 6, vr = 7, T
5625
5644
  }
5626
5645
  return i([a, u], o);
5627
5646
  }
5628
- case Ze: {
5647
+ case Je: {
5629
5648
  if (c) {
5630
5649
  let m = o;
5631
5650
  return c === "DataView" ? m = new Uint8Array(o.buffer) : c === "ArrayBuffer" && (m = new Uint8Array(o)), i([c, [...m]], o);
@@ -5649,7 +5668,7 @@ const Er = -1, gn = 0, Ze = 1, fn = 2, Jn = 3, Gn = 4, et = 5, nt = 6, vr = 7, T
5649
5668
  return l(o.toJSON());
5650
5669
  const u = [], p = i([a, u], o);
5651
5670
  for (const m of Da(o))
5652
- (e || !an(Ye(o[m]))) && u.push([l(m), l(o[m])]);
5671
+ (e || !an(Xe(o[m]))) && u.push([l(m), l(o[m])]);
5653
5672
  return p;
5654
5673
  }
5655
5674
  case Jn:
@@ -5661,13 +5680,13 @@ const Er = -1, gn = 0, Ze = 1, fn = 2, Jn = 3, Gn = 4, et = 5, nt = 6, vr = 7, T
5661
5680
  case et: {
5662
5681
  const u = [], p = i([a, u], o);
5663
5682
  for (const [m, h] of o)
5664
- (e || !(an(Ye(m)) || an(Ye(h)))) && u.push([l(m), l(h)]);
5683
+ (e || !(an(Xe(m)) || an(Xe(h)))) && u.push([l(m), l(h)]);
5665
5684
  return p;
5666
5685
  }
5667
5686
  case nt: {
5668
5687
  const u = [], p = i([a, u], o);
5669
5688
  for (const m of o)
5670
- (e || !an(Ye(m))) && u.push(l(m));
5689
+ (e || !an(Xe(m))) && u.push(l(m));
5671
5690
  return p;
5672
5691
  }
5673
5692
  }
@@ -5705,13 +5724,13 @@ function Ra(e) {
5705
5724
  );
5706
5725
  if (!s)
5707
5726
  continue;
5708
- const u = e.all(s), p = String(s.identifier).toUpperCase(), m = Re(p.toLowerCase());
5727
+ const u = e.all(s), p = String(s.identifier).toUpperCase(), m = $e(p.toLowerCase());
5709
5728
  let h = 0;
5710
5729
  const C = [], E = e.footnoteCounts.get(p);
5711
5730
  for (; E !== void 0 && ++h <= E; ) {
5712
5731
  C.length > 0 && C.push({ type: "text", value: " " });
5713
- let N = typeof t == "string" ? t : t(c, h);
5714
- typeof N == "string" && (N = { type: "text", value: N }), C.push({
5732
+ let A = typeof t == "string" ? t : t(c, h);
5733
+ typeof A == "string" && (A = { type: "text", value: A }), C.push({
5715
5734
  type: "element",
5716
5735
  tagName: "a",
5717
5736
  properties: {
@@ -5720,13 +5739,13 @@ function Ra(e) {
5720
5739
  ariaLabel: typeof r == "string" ? r : r(c, h),
5721
5740
  className: ["data-footnote-backref"]
5722
5741
  },
5723
- children: Array.isArray(N) ? N : [N]
5742
+ children: Array.isArray(A) ? A : [A]
5724
5743
  });
5725
5744
  }
5726
- const S = u[u.length - 1];
5727
- if (S && S.type === "element" && S.tagName === "p") {
5728
- const N = S.children[S.children.length - 1];
5729
- N && N.type === "text" ? N.value += " " : S.children.push({ type: "text", value: " " }), S.children.push(...C);
5745
+ const I = u[u.length - 1];
5746
+ if (I && I.type === "element" && I.tagName === "p") {
5747
+ const A = I.children[I.children.length - 1];
5748
+ A && A.type === "text" ? A.value += " " : I.children.push({ type: "text", value: " " }), I.children.push(...C);
5730
5749
  } else
5731
5750
  u.push(...C);
5732
5751
  const y = {
@@ -5878,7 +5897,7 @@ function Ya(e, n, t, r) {
5878
5897
  }
5879
5898
  return m;
5880
5899
  function m() {
5881
- let h = Pr, C, E, S;
5900
+ let h = Pr, C, E, I;
5882
5901
  if ((!n || l(c, s, u[u.length - 1] || void 0)) && (h = Xa(t(c, u)), h[0] === Ft))
5883
5902
  return h;
5884
5903
  if ("children" in c && c.children) {
@@ -5887,9 +5906,9 @@ function Ya(e, n, t, r) {
5887
5906
  c
5888
5907
  );
5889
5908
  if (y.children && h[0] !== Wa)
5890
- for (E = (r ? y.children.length : -1) + o, S = u.concat(y); E > -1 && E < y.children.length; ) {
5891
- const N = y.children[E];
5892
- if (C = a(N, E, S)(), C[0] === Ft)
5909
+ for (E = (r ? y.children.length : -1) + o, I = u.concat(y); E > -1 && E < y.children.length; ) {
5910
+ const A = y.children[E];
5911
+ if (C = a(A, E, I)(), C[0] === Ft)
5893
5912
  return C;
5894
5913
  E = typeof C[1] == "number" ? C[1] : E + o;
5895
5914
  }
@@ -5936,7 +5955,7 @@ function Qa(e, n) {
5936
5955
  return h(a, u, p);
5937
5956
  if (a.options.passThrough && a.options.passThrough.includes(m)) {
5938
5957
  if ("children" in u) {
5939
- const { children: E, ...S } = u, y = dn(S);
5958
+ const { children: E, ...I } = u, y = dn(I);
5940
5959
  return y.children = a.all(u), y;
5941
5960
  }
5942
5961
  return dn(u);
@@ -6060,11 +6079,11 @@ function ts() {
6060
6079
  return s[u];
6061
6080
  };
6062
6081
  return Sn = function c() {
6063
- var s, u, p, m, h, C, E = arguments[0], S = 1, y = arguments.length, N = !1;
6064
- for (typeof E == "boolean" && (N = E, E = arguments[1] || {}, S = 2), (E == null || typeof E != "object" && typeof E != "function") && (E = {}); S < y; ++S)
6065
- if (s = arguments[S], s != null)
6082
+ var s, u, p, m, h, C, E = arguments[0], I = 1, y = arguments.length, A = !1;
6083
+ for (typeof E == "boolean" && (A = E, E = arguments[1] || {}, I = 2), (E == null || typeof E != "object" && typeof E != "function") && (E = {}); I < y; ++I)
6084
+ if (s = arguments[I], s != null)
6066
6085
  for (u in s)
6067
- p = a(E, u), m = a(s, u), E !== m && (N && m && (l(m) || (h = i(m))) ? (h ? (h = !1, C = p && i(p) ? p : []) : C = p && l(p) ? p : {}, o(E, { name: u, newValue: c(N, C, m) })) : typeof m < "u" && o(E, { name: u, newValue: m }));
6086
+ p = a(E, u), m = a(s, u), E !== m && (A && m && (l(m) || (h = i(m))) ? (h ? (h = !1, C = p && i(p) ? p : []) : C = p && l(p) ? p : {}, o(E, { name: u, newValue: c(A, C, m) })) : typeof m < "u" && o(E, { name: u, newValue: m }));
6068
6087
  return E;
6069
6088
  }, Sn;
6070
6089
  }
@@ -6132,7 +6151,7 @@ function ls(e, n) {
6132
6151
  i(null, o);
6133
6152
  }
6134
6153
  }
6135
- const me = { basename: os, dirname: as, extname: ss, join: us, sep: "/" };
6154
+ const ye = { basename: os, dirname: as, extname: ss, join: us, sep: "/" };
6136
6155
  function os(e, n) {
6137
6156
  if (n !== void 0 && typeof n != "string")
6138
6157
  throw new TypeError('"ext" argument must be a string');
@@ -6338,7 +6357,7 @@ class Ar {
6338
6357
  * Basename.
6339
6358
  */
6340
6359
  get basename() {
6341
- return typeof this.path == "string" ? me.basename(this.path) : void 0;
6360
+ return typeof this.path == "string" ? ye.basename(this.path) : void 0;
6342
6361
  }
6343
6362
  /**
6344
6363
  * Set basename (including extname) (`'index.min.js'`).
@@ -6353,7 +6372,7 @@ class Ar {
6353
6372
  * Nothing.
6354
6373
  */
6355
6374
  set basename(n) {
6356
- Tn(n, "basename"), vn(n, "basename"), this.path = me.join(this.dirname || "", n);
6375
+ Tn(n, "basename"), vn(n, "basename"), this.path = ye.join(this.dirname || "", n);
6357
6376
  }
6358
6377
  /**
6359
6378
  * Get the parent path (example: `'~'`).
@@ -6362,7 +6381,7 @@ class Ar {
6362
6381
  * Dirname.
6363
6382
  */
6364
6383
  get dirname() {
6365
- return typeof this.path == "string" ? me.dirname(this.path) : void 0;
6384
+ return typeof this.path == "string" ? ye.dirname(this.path) : void 0;
6366
6385
  }
6367
6386
  /**
6368
6387
  * Set the parent path (example: `'~'`).
@@ -6375,7 +6394,7 @@ class Ar {
6375
6394
  * Nothing.
6376
6395
  */
6377
6396
  set dirname(n) {
6378
- Vt(this.basename, "dirname"), this.path = me.join(n || "", this.basename);
6397
+ Vt(this.basename, "dirname"), this.path = ye.join(n || "", this.basename);
6379
6398
  }
6380
6399
  /**
6381
6400
  * Get the extname (including dot) (example: `'.js'`).
@@ -6384,7 +6403,7 @@ class Ar {
6384
6403
  * Extname.
6385
6404
  */
6386
6405
  get extname() {
6387
- return typeof this.path == "string" ? me.extname(this.path) : void 0;
6406
+ return typeof this.path == "string" ? ye.extname(this.path) : void 0;
6388
6407
  }
6389
6408
  /**
6390
6409
  * Set the extname (including dot) (example: `'.js'`).
@@ -6405,7 +6424,7 @@ class Ar {
6405
6424
  if (n.includes(".", 1))
6406
6425
  throw new Error("`extname` cannot contain multiple dots");
6407
6426
  }
6408
- this.path = me.join(this.dirname, this.stem + (n || ""));
6427
+ this.path = ye.join(this.dirname, this.stem + (n || ""));
6409
6428
  }
6410
6429
  /**
6411
6430
  * Get the full path (example: `'~/index.min.js'`).
@@ -6438,7 +6457,7 @@ class Ar {
6438
6457
  * Stem.
6439
6458
  */
6440
6459
  get stem() {
6441
- return typeof this.path == "string" ? me.basename(this.path, this.extname) : void 0;
6460
+ return typeof this.path == "string" ? ye.basename(this.path, this.extname) : void 0;
6442
6461
  }
6443
6462
  /**
6444
6463
  * Set the stem (basename w/o extname) (example: `'index.min'`).
@@ -6453,7 +6472,7 @@ class Ar {
6453
6472
  * Nothing.
6454
6473
  */
6455
6474
  set stem(n) {
6456
- Tn(n, "stem"), vn(n, "stem"), this.path = me.join(this.dirname || "", n + (this.extname || ""));
6475
+ Tn(n, "stem"), vn(n, "stem"), this.path = ye.join(this.dirname || "", n + (this.extname || ""));
6457
6476
  }
6458
6477
  // Normal prototypal methods.
6459
6478
  /**
@@ -6667,9 +6686,9 @@ class Ar {
6667
6686
  }
6668
6687
  }
6669
6688
  function vn(e, n) {
6670
- if (e && e.includes(me.sep))
6689
+ if (e && e.includes(ye.sep))
6671
6690
  throw new Error(
6672
- "`" + n + "` cannot be a path: did not expect `" + me.sep + "`"
6691
+ "`" + n + "` cannot be a path: did not expect `" + ye.sep + "`"
6673
6692
  );
6674
6693
  }
6675
6694
  function Tn(e, n) {
@@ -7278,7 +7297,7 @@ function Ls(e, n) {
7278
7297
  components: i,
7279
7298
  ignoreInvalidStyle: !0,
7280
7299
  jsx: k,
7281
- jsxs: $,
7300
+ jsxs: H,
7282
7301
  passKeys: !0,
7283
7302
  passNode: !0
7284
7303
  });
@@ -7309,7 +7328,7 @@ function Ps(e) {
7309
7328
  Ss.test(e.slice(0, n)) ? e : ""
7310
7329
  );
7311
7330
  }
7312
- const Ns = "_messageWrapper_1thak_1", As = "_user_1thak_19", zs = "_assistant_1thak_24", Ms = "_avatar_1thak_28", Ds = "_avatarPlaceholder_1thak_43", Bs = "_brainbaseLogo_1thak_53", Os = "_messageBubble_1thak_58", Fs = "_error_1thak_76", Rs = "_content_1thak_81", $s = "_markdown_1thak_92", js = "_cursor_1thak_183", Hs = "_errorIndicator_1thak_202", ue = {
7331
+ const Ns = "_messageWrapper_1thak_1", As = "_user_1thak_19", zs = "_assistant_1thak_24", Ms = "_avatar_1thak_28", Ds = "_avatarPlaceholder_1thak_43", Bs = "_brainbaseLogo_1thak_53", Os = "_messageBubble_1thak_58", Fs = "_error_1thak_76", Rs = "_content_1thak_81", $s = "_markdown_1thak_92", js = "_cursor_1thak_183", Hs = "_errorIndicator_1thak_202", ce = {
7313
7332
  messageWrapper: Ns,
7314
7333
  user: As,
7315
7334
  assistant: zs,
@@ -7328,27 +7347,27 @@ const Ns = "_messageWrapper_1thak_1", As = "_user_1thak_19", zs = "_assistant_1t
7328
7347
  agentLogoUrl: t
7329
7348
  }) => {
7330
7349
  const r = e.role === "user", i = e.status === "streaming", l = e.status === "error";
7331
- return /* @__PURE__ */ $(
7350
+ return /* @__PURE__ */ H(
7332
7351
  "div",
7333
7352
  {
7334
- className: `${ue.messageWrapper} ${r ? ue.user : ue.assistant}`,
7353
+ className: `${ce.messageWrapper} ${r ? ce.user : ce.assistant}`,
7335
7354
  children: [
7336
- !r && /* @__PURE__ */ k("div", { className: ue.avatar, children: t ? /* @__PURE__ */ k("img", { src: t, alt: n || "AI" }) : /* @__PURE__ */ k("div", { className: ue.avatarPlaceholder, children: /* @__PURE__ */ k(
7355
+ !r && /* @__PURE__ */ k("div", { className: ce.avatar, children: t ? /* @__PURE__ */ k("img", { src: t, alt: n || "AI" }) : /* @__PURE__ */ k("div", { className: ce.avatarPlaceholder, children: /* @__PURE__ */ k(
7337
7356
  en,
7338
7357
  {
7339
- className: ue.brainbaseLogo,
7358
+ className: ce.brainbaseLogo,
7340
7359
  color: "white",
7341
7360
  cutoutColor: "var(--bb-primary-color)"
7342
7361
  }
7343
7362
  ) }) }),
7344
- /* @__PURE__ */ $(
7363
+ /* @__PURE__ */ H(
7345
7364
  "div",
7346
7365
  {
7347
- className: `${ue.messageBubble} ${l ? ue.error : ""}`,
7366
+ className: `${ce.messageBubble} ${l ? ce.error : ""}`,
7348
7367
  role: "article",
7349
7368
  "aria-label": `${r ? "Your message" : `${n || "AI"} says`}`,
7350
7369
  children: [
7351
- /* @__PURE__ */ $("div", { className: `${ue.content} ${r ? "" : ue.markdown}`, children: [
7370
+ /* @__PURE__ */ H("div", { className: `${ce.content} ${r ? "" : ce.markdown}`, children: [
7352
7371
  r ? e.content : /* @__PURE__ */ k(
7353
7372
  Es,
7354
7373
  {
@@ -7358,10 +7377,10 @@ const Ns = "_messageWrapper_1thak_1", As = "_user_1thak_19", zs = "_assistant_1t
7358
7377
  children: e.content
7359
7378
  }
7360
7379
  ),
7361
- i && /* @__PURE__ */ k("span", { className: ue.cursor })
7380
+ i && /* @__PURE__ */ k("span", { className: ce.cursor })
7362
7381
  ] }),
7363
- l && /* @__PURE__ */ $("div", { className: ue.errorIndicator, children: [
7364
- /* @__PURE__ */ $("svg", { viewBox: "0 0 24 24", fill: "none", children: [
7382
+ l && /* @__PURE__ */ H("div", { className: ce.errorIndicator, children: [
7383
+ /* @__PURE__ */ H("svg", { viewBox: "0 0 24 24", fill: "none", children: [
7365
7384
  /* @__PURE__ */ k("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "2" }),
7366
7385
  /* @__PURE__ */ k("path", { d: "M12 8V12M12 16H12.01", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" })
7367
7386
  ] }),
@@ -7373,7 +7392,7 @@ const Ns = "_messageWrapper_1thak_1", As = "_user_1thak_19", zs = "_assistant_1t
7373
7392
  ]
7374
7393
  }
7375
7394
  );
7376
- }, Us = "_toolCall_1wby1_1", qs = "_iconWrapper_1wby1_24", Ws = "_spinner_1wby1_33", Ys = "_checkIcon_1wby1_48", Xs = "_errorIcon_1wby1_54", Ks = "_content_1wby1_60", Qs = "_label_1wby1_66", Zs = "_name_1wby1_73", Js = "_pending_1wby1_78", Gs = "_completed_1wby1_82", eu = "_error_1wby1_54", de = {
7395
+ }, Us = "_toolCall_1wby1_1", qs = "_iconWrapper_1wby1_24", Ws = "_spinner_1wby1_33", Ys = "_checkIcon_1wby1_48", Xs = "_errorIcon_1wby1_54", Ks = "_content_1wby1_60", Qs = "_label_1wby1_66", Zs = "_name_1wby1_73", Js = "_pending_1wby1_78", Gs = "_completed_1wby1_82", eu = "_error_1wby1_54", me = {
7377
7396
  toolCall: Us,
7378
7397
  iconWrapper: qs,
7379
7398
  spinner: Ws,
@@ -7387,12 +7406,12 @@ const Ns = "_messageWrapper_1thak_1", As = "_user_1thak_19", zs = "_assistant_1t
7387
7406
  error: eu
7388
7407
  }, nu = ({ toolCall: e }) => {
7389
7408
  const n = e.status === "pending" || e.status === "executing", t = e.status === "completed", r = e.status === "error", i = (l) => l.replace(/_/g, " ").replace(/([A-Z])/g, " $1").trim().toLowerCase().replace(/^./, (o) => o.toUpperCase());
7390
- return /* @__PURE__ */ $(
7409
+ return /* @__PURE__ */ H(
7391
7410
  "div",
7392
7411
  {
7393
- className: `${de.toolCall} ${n ? de.pending : ""} ${t ? de.completed : ""} ${r ? de.error : ""}`,
7412
+ className: `${me.toolCall} ${n ? me.pending : ""} ${t ? me.completed : ""} ${r ? me.error : ""}`,
7394
7413
  children: [
7395
- /* @__PURE__ */ k("div", { className: de.iconWrapper, children: n ? /* @__PURE__ */ k("div", { className: de.spinner }) : t ? /* @__PURE__ */ k("svg", { viewBox: "0 0 24 24", fill: "none", className: de.checkIcon, children: /* @__PURE__ */ k(
7414
+ /* @__PURE__ */ k("div", { className: me.iconWrapper, children: n ? /* @__PURE__ */ k("div", { className: me.spinner }) : t ? /* @__PURE__ */ k("svg", { viewBox: "0 0 24 24", fill: "none", className: me.checkIcon, children: /* @__PURE__ */ k(
7396
7415
  "path",
7397
7416
  {
7398
7417
  d: "M20 6L9 17L4 12",
@@ -7401,7 +7420,7 @@ const Ns = "_messageWrapper_1thak_1", As = "_user_1thak_19", zs = "_assistant_1t
7401
7420
  strokeLinecap: "round",
7402
7421
  strokeLinejoin: "round"
7403
7422
  }
7404
- ) }) : /* @__PURE__ */ k("svg", { viewBox: "0 0 24 24", fill: "none", className: de.errorIcon, children: /* @__PURE__ */ k(
7423
+ ) }) : /* @__PURE__ */ k("svg", { viewBox: "0 0 24 24", fill: "none", className: me.errorIcon, children: /* @__PURE__ */ k(
7405
7424
  "path",
7406
7425
  {
7407
7426
  d: "M6 18L18 6M6 6L18 18",
@@ -7411,9 +7430,9 @@ const Ns = "_messageWrapper_1thak_1", As = "_user_1thak_19", zs = "_assistant_1t
7411
7430
  strokeLinejoin: "round"
7412
7431
  }
7413
7432
  ) }) }),
7414
- /* @__PURE__ */ $("div", { className: de.content, children: [
7415
- /* @__PURE__ */ k("span", { className: de.label, children: n ? "Running" : t ? "Completed" : "Failed" }),
7416
- /* @__PURE__ */ k("span", { className: de.name, children: i(e.name) })
7433
+ /* @__PURE__ */ H("div", { className: me.content, children: [
7434
+ /* @__PURE__ */ k("span", { className: me.label, children: n ? "Running" : t ? "Completed" : "Failed" }),
7435
+ /* @__PURE__ */ k("span", { className: me.name, children: i(e.name) })
7417
7436
  ] })
7418
7437
  ]
7419
7438
  }
@@ -7428,7 +7447,7 @@ const Ns = "_messageWrapper_1thak_1", As = "_user_1thak_19", zs = "_assistant_1t
7428
7447
  }, su = ({
7429
7448
  agentName: e = "AI",
7430
7449
  agentLogoUrl: n
7431
- }) => /* @__PURE__ */ $("div", { className: Se.wrapper, role: "status", "aria-label": `${e} is typing`, children: [
7450
+ }) => /* @__PURE__ */ H("div", { className: Se.wrapper, role: "status", "aria-label": `${e} is typing`, children: [
7432
7451
  /* @__PURE__ */ k("div", { className: Se.avatar, children: n ? /* @__PURE__ */ k("img", { src: n, alt: e }) : /* @__PURE__ */ k("div", { className: Se.avatarPlaceholder, children: /* @__PURE__ */ k(
7433
7452
  en,
7434
7453
  {
@@ -7437,7 +7456,7 @@ const Ns = "_messageWrapper_1thak_1", As = "_user_1thak_19", zs = "_assistant_1t
7437
7456
  cutoutColor: "var(--bb-primary-color)"
7438
7457
  }
7439
7458
  ) }) }),
7440
- /* @__PURE__ */ $("div", { className: Se.bubble, children: [
7459
+ /* @__PURE__ */ H("div", { className: Se.bubble, children: [
7441
7460
  /* @__PURE__ */ k("span", { className: Se.dot }),
7442
7461
  /* @__PURE__ */ k("span", { className: Se.dot }),
7443
7462
  /* @__PURE__ */ k("span", { className: Se.dot })
@@ -7455,7 +7474,7 @@ const Ns = "_messageWrapper_1thak_1", As = "_user_1thak_19", zs = "_assistant_1t
7455
7474
  agentLogoUrl: i
7456
7475
  }) => {
7457
7476
  var c;
7458
- const l = Je(null), o = Je(null);
7477
+ const l = Be(null), o = Be(null);
7459
7478
  Ge(() => {
7460
7479
  var s;
7461
7480
  (s = o.current) == null || s.scrollIntoView({ behavior: "smooth" });
@@ -7463,8 +7482,8 @@ const Ns = "_messageWrapper_1thak_1", As = "_user_1thak_19", zs = "_assistant_1t
7463
7482
  const a = n.filter(
7464
7483
  (s) => s.status === "pending" || s.status === "executing"
7465
7484
  );
7466
- return /* @__PURE__ */ $("div", { className: un.messageList, ref: l, role: "log", "aria-live": "polite", children: [
7467
- e.length === 0 && !t && /* @__PURE__ */ $("div", { className: un.emptyState, children: [
7485
+ return /* @__PURE__ */ H("div", { className: un.messageList, ref: l, role: "log", "aria-live": "polite", children: [
7486
+ e.length === 0 && !t && /* @__PURE__ */ H("div", { className: un.emptyState, children: [
7468
7487
  /* @__PURE__ */ k("div", { className: un.emptyIcon, children: /* @__PURE__ */ k("svg", { viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ k(
7469
7488
  "path",
7470
7489
  {
@@ -7490,7 +7509,7 @@ const Ns = "_messageWrapper_1thak_1", As = "_user_1thak_19", zs = "_assistant_1t
7490
7509
  t && ((c = e[e.length - 1]) == null ? void 0 : c.role) === "user" && /* @__PURE__ */ k(su, { agentName: r, agentLogoUrl: i }),
7491
7510
  /* @__PURE__ */ k("div", { ref: o })
7492
7511
  ] });
7493
- }, du = "_inputWrapper_5lgg7_1", mu = "_inputContainer_5lgg7_7", gu = "_textarea_5lgg7_23", yu = "_sendButton_5lgg7_50", xu = "_hint_5lgg7_89", Xe = {
7512
+ }, du = "_inputWrapper_5lgg7_1", mu = "_inputContainer_5lgg7_7", gu = "_textarea_5lgg7_23", yu = "_sendButton_5lgg7_50", xu = "_hint_5lgg7_89", Ke = {
7494
7513
  inputWrapper: du,
7495
7514
  inputContainer: mu,
7496
7515
  textarea: gu,
@@ -7501,7 +7520,7 @@ const Ns = "_messageWrapper_1thak_1", As = "_user_1thak_19", zs = "_assistant_1t
7501
7520
  disabled: n = !1,
7502
7521
  placeholder: t = "Send a message..."
7503
7522
  }) => {
7504
- const [r, i] = pe(""), l = Je(null), o = ge(() => {
7523
+ const [r, i] = he(""), l = Be(null), o = ge(() => {
7505
7524
  const s = l.current;
7506
7525
  s && (s.style.height = "auto", s.style.height = `${Math.min(s.scrollHeight, 150)}px`);
7507
7526
  }, []);
@@ -7521,13 +7540,13 @@ const Ns = "_messageWrapper_1thak_1", As = "_user_1thak_19", zs = "_assistant_1t
7521
7540
  },
7522
7541
  [a]
7523
7542
  );
7524
- return /* @__PURE__ */ $("form", { className: Xe.inputWrapper, onSubmit: a, children: [
7525
- /* @__PURE__ */ $("div", { className: Xe.inputContainer, children: [
7543
+ return /* @__PURE__ */ H("form", { className: Ke.inputWrapper, onSubmit: a, children: [
7544
+ /* @__PURE__ */ H("div", { className: Ke.inputContainer, children: [
7526
7545
  /* @__PURE__ */ k(
7527
7546
  "textarea",
7528
7547
  {
7529
7548
  ref: l,
7530
- className: Xe.textarea,
7549
+ className: Ke.textarea,
7531
7550
  value: r,
7532
7551
  onChange: (s) => i(s.target.value),
7533
7552
  onKeyDown: c,
@@ -7541,7 +7560,7 @@ const Ns = "_messageWrapper_1thak_1", As = "_user_1thak_19", zs = "_assistant_1t
7541
7560
  "button",
7542
7561
  {
7543
7562
  type: "submit",
7544
- className: Xe.sendButton,
7563
+ className: Ke.sendButton,
7545
7564
  disabled: n || !r.trim(),
7546
7565
  "aria-label": "Send message",
7547
7566
  children: /* @__PURE__ */ k("svg", { viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ k(
@@ -7557,7 +7576,7 @@ const Ns = "_messageWrapper_1thak_1", As = "_user_1thak_19", zs = "_assistant_1t
7557
7576
  }
7558
7577
  )
7559
7578
  ] }),
7560
- /* @__PURE__ */ $("div", { className: Xe.hint, children: [
7579
+ /* @__PURE__ */ H("div", { className: Ke.hint, children: [
7561
7580
  "Press ",
7562
7581
  /* @__PURE__ */ k("kbd", { children: "Enter" }),
7563
7582
  " to send, ",
@@ -7570,7 +7589,7 @@ const Ns = "_messageWrapper_1thak_1", As = "_user_1thak_19", zs = "_assistant_1t
7570
7589
  logo: wu,
7571
7590
  poweredText: Cu,
7572
7591
  text: _u
7573
- }, Su = ({ className: e }) => /* @__PURE__ */ $(
7592
+ }, Su = ({ className: e }) => /* @__PURE__ */ H(
7574
7593
  "svg",
7575
7594
  {
7576
7595
  className: e,
@@ -7622,7 +7641,7 @@ const Ns = "_messageWrapper_1thak_1", As = "_user_1thak_19", zs = "_assistant_1t
7622
7641
  )
7623
7642
  ]
7624
7643
  }
7625
- ), Iu = ({ showBranding: e = !0 }) => e ? /* @__PURE__ */ $(
7644
+ ), Iu = ({ showBranding: e = !0 }) => e ? /* @__PURE__ */ H(
7626
7645
  "a",
7627
7646
  {
7628
7647
  href: "https://brainbaselabs.com/",
@@ -7655,14 +7674,14 @@ const Ns = "_messageWrapper_1thak_1", As = "_user_1thak_19", zs = "_assistant_1t
7655
7674
  onNewChat: o
7656
7675
  }) => {
7657
7676
  var h;
7658
- const [a, c] = pe(!1), s = n.length > 0, u = () => {
7677
+ const [a, c] = he(!1), s = n.length > 0, u = () => {
7659
7678
  c(!0);
7660
7679
  }, p = () => {
7661
7680
  c(!1), o == null || o();
7662
7681
  }, m = () => {
7663
7682
  c(!1);
7664
7683
  };
7665
- return /* @__PURE__ */ $("div", { className: Ie.container, role: "dialog", "aria-label": "Chat window", children: [
7684
+ return /* @__PURE__ */ H("div", { className: Ie.container, role: "dialog", "aria-label": "Chat window", children: [
7666
7685
  /* @__PURE__ */ k(
7667
7686
  ui,
7668
7687
  {
@@ -7676,7 +7695,7 @@ const Ns = "_messageWrapper_1thak_1", As = "_user_1thak_19", zs = "_assistant_1t
7676
7695
  compact: s
7677
7696
  }
7678
7697
  ),
7679
- /* @__PURE__ */ $("div", { className: Ie.body, children: [
7698
+ /* @__PURE__ */ H("div", { className: Ie.body, children: [
7680
7699
  /* @__PURE__ */ k(
7681
7700
  fu,
7682
7701
  {
@@ -7697,9 +7716,9 @@ const Ns = "_messageWrapper_1thak_1", As = "_user_1thak_19", zs = "_assistant_1t
7697
7716
  )
7698
7717
  ] }),
7699
7718
  /* @__PURE__ */ k(Iu, { showBranding: ((h = e.styling) == null ? void 0 : h.showBranding) ?? !0 }),
7700
- a && /* @__PURE__ */ k("div", { className: Ie.confirmationOverlay, children: /* @__PURE__ */ $("div", { className: Ie.confirmationDialog, children: [
7719
+ a && /* @__PURE__ */ k("div", { className: Ie.confirmationOverlay, children: /* @__PURE__ */ H("div", { className: Ie.confirmationDialog, children: [
7701
7720
  /* @__PURE__ */ k("p", { className: Ie.confirmationText, children: "End current chat and start a new conversation?" }),
7702
- /* @__PURE__ */ $("div", { className: Ie.confirmationButtons, children: [
7721
+ /* @__PURE__ */ H("div", { className: Ie.confirmationButtons, children: [
7703
7722
  /* @__PURE__ */ k(
7704
7723
  "button",
7705
7724
  {
@@ -7730,7 +7749,7 @@ const Ns = "_messageWrapper_1thak_1", As = "_user_1thak_19", zs = "_assistant_1t
7730
7749
  onClick: e,
7731
7750
  agentLogoUrl: n,
7732
7751
  unreadCount: t = 0
7733
- }) => /* @__PURE__ */ $(
7752
+ }) => /* @__PURE__ */ H(
7734
7753
  "button",
7735
7754
  {
7736
7755
  className: pn.toggleButton,
@@ -7787,7 +7806,7 @@ const Ns = "_messageWrapper_1thak_1", As = "_user_1thak_19", zs = "_assistant_1t
7787
7806
  return {
7788
7807
  title: "Chat Not Found",
7789
7808
  description: n || "This chat widget is not configured correctly. Please check the embed ID.",
7790
- icon: /* @__PURE__ */ $("svg", { viewBox: "0 0 24 24", fill: "none", className: ee.errorIcon, children: [
7809
+ icon: /* @__PURE__ */ H("svg", { viewBox: "0 0 24 24", fill: "none", className: ee.errorIcon, children: [
7791
7810
  /* @__PURE__ */ k(
7792
7811
  "circle",
7793
7812
  {
@@ -7813,7 +7832,7 @@ const Ns = "_messageWrapper_1thak_1", As = "_user_1thak_19", zs = "_assistant_1t
7813
7832
  return {
7814
7833
  title: "Connection Error",
7815
7834
  description: n || "Unable to connect to the chat service. Please check your internet connection.",
7816
- icon: /* @__PURE__ */ $("svg", { viewBox: "0 0 24 24", fill: "none", className: ee.errorIcon, children: [
7835
+ icon: /* @__PURE__ */ H("svg", { viewBox: "0 0 24 24", fill: "none", className: ee.errorIcon, children: [
7817
7836
  /* @__PURE__ */ k(
7818
7837
  "path",
7819
7838
  {
@@ -7849,8 +7868,8 @@ const Ns = "_messageWrapper_1thak_1", As = "_user_1thak_19", zs = "_assistant_1t
7849
7868
  };
7850
7869
  }
7851
7870
  }, { title: l, description: o, icon: a } = i();
7852
- return /* @__PURE__ */ $("div", { className: ee.container, children: [
7853
- /* @__PURE__ */ $("div", { className: ee.header, children: [
7871
+ return /* @__PURE__ */ H("div", { className: ee.container, children: [
7872
+ /* @__PURE__ */ H("div", { className: ee.header, children: [
7854
7873
  /* @__PURE__ */ k("div", { className: ee.logoWrapper, children: /* @__PURE__ */ k(
7855
7874
  en,
7856
7875
  {
@@ -7878,13 +7897,13 @@ const Ns = "_messageWrapper_1thak_1", As = "_user_1thak_19", zs = "_assistant_1t
7878
7897
  }
7879
7898
  )
7880
7899
  ] }),
7881
- /* @__PURE__ */ $("div", { className: ee.content, children: [
7900
+ /* @__PURE__ */ H("div", { className: ee.content, children: [
7882
7901
  /* @__PURE__ */ k("div", { className: ee.iconWrapper, children: a }),
7883
7902
  /* @__PURE__ */ k("h2", { className: ee.title, children: l }),
7884
7903
  /* @__PURE__ */ k("p", { className: ee.description, children: o }),
7885
7904
  t && /* @__PURE__ */ k("button", { className: ee.retryButton, onClick: t, type: "button", children: "Try Again" })
7886
7905
  ] }),
7887
- /* @__PURE__ */ k("div", { className: ee.footer, children: /* @__PURE__ */ $(
7906
+ /* @__PURE__ */ k("div", { className: ee.footer, children: /* @__PURE__ */ H(
7888
7907
  "a",
7889
7908
  {
7890
7909
  href: "https://brainbaselabs.com",
@@ -7929,27 +7948,27 @@ const Ns = "_messageWrapper_1thak_1", As = "_user_1thak_19", zs = "_assistant_1t
7929
7948
  onMessage: h,
7930
7949
  onError: C
7931
7950
  }) => {
7932
- const [E, S] = pe(l), [y, N] = pe(null), [T, H] = pe(!0), [j, b] = pe(null), [F, V] = pe(), O = xn(() => t ? Yr(
7951
+ const [E, I] = he(l), [y, A] = he(null), [v, R] = he(!0), [q, x] = he(null), [O, U] = he(), $ = xn(() => t ? Yr(
7933
7952
  { primaryColor: o, agentName: a, welcomeMessage: c },
7934
7953
  r
7935
- ) : Ur(n), [t, o, a, c, r, n]), A = ge(async () => {
7936
- H(!0), b(null), V(void 0);
7954
+ ) : Ur(n), [t, o, a, c, r, n]), V = ge(async () => {
7955
+ R(!0), x(null), U(void 0);
7937
7956
  try {
7938
- const Y = await O.getDeploymentConfig(e);
7939
- N({
7940
- ...Y,
7957
+ const F = await $.getDeploymentConfig(e);
7958
+ A({
7959
+ ...F,
7941
7960
  // Allow prop overrides
7942
- primaryColor: o ?? Y.primaryColor,
7943
- agentName: a ?? Y.agentName,
7944
- welcomeMessage: c ?? Y.welcomeMessage,
7961
+ primaryColor: o ?? F.primaryColor,
7962
+ agentName: a ?? F.agentName,
7963
+ welcomeMessage: c ?? F.welcomeMessage,
7945
7964
  styling: {
7946
- ...Y.styling ?? {},
7965
+ ...F.styling ?? {},
7947
7966
  ...s !== void 0 ? { showBranding: s } : {}
7948
7967
  }
7949
7968
  });
7950
- } catch (Y) {
7951
- const J = Y instanceof Error ? Y : new Error("Failed to load config");
7952
- J.message.includes("404") ? (b("not_found"), V("The chat widget with this embed ID was not found.")) : J.message.includes("Failed to fetch") || J.message.includes("network") ? b("network") : b("unknown"), t && (N({
7969
+ } catch (F) {
7970
+ const Q = F instanceof Error ? F : new Error("Failed to load config");
7971
+ Q.message.includes("404") ? (x("not_found"), U("The chat widget with this embed ID was not found.")) : Q.message.includes("Failed to fetch") || Q.message.includes("network") ? x("network") : x("unknown"), t && (A({
7953
7972
  embedId: e,
7954
7973
  deploymentId: "mock-deployment",
7955
7974
  workerId: "mock-worker",
@@ -7957,15 +7976,15 @@ const Ns = "_messageWrapper_1thak_1", As = "_user_1thak_19", zs = "_assistant_1t
7957
7976
  primaryColor: o ?? "#1a1a2e",
7958
7977
  agentName: a ?? "AI Assistant",
7959
7978
  styling: s !== void 0 ? { showBranding: s } : void 0
7960
- }), b(null)), C == null || C(J);
7979
+ }), x(null)), C == null || C(Q);
7961
7980
  } finally {
7962
- H(!1);
7981
+ R(!1);
7963
7982
  }
7964
- }, [e, t, O, o, a, c, C]);
7983
+ }, [e, t, $, o, a, c, C]);
7965
7984
  Ge(() => {
7966
- A();
7967
- }, [A]);
7968
- const L = xn(() => y || {
7985
+ V();
7986
+ }, [V]);
7987
+ const P = xn(() => y || {
7969
7988
  embedId: e,
7970
7989
  deploymentId: "",
7971
7990
  workerId: "",
@@ -7976,35 +7995,35 @@ const Ns = "_messageWrapper_1thak_1", As = "_user_1thak_19", zs = "_assistant_1t
7976
7995
  styling: s !== void 0 ? {
7977
7996
  showBranding: s
7978
7997
  } : void 0
7979
- }, [y, e, o, a, c, s]), v = Vr({
7980
- config: L,
7981
- apiClient: O,
7998
+ }, [y, e, o, a, c, s]), _ = Vr({
7999
+ config: P,
8000
+ apiClient: $,
7982
8001
  mockMode: t,
7983
8002
  onSessionStart: p,
7984
8003
  onSessionEnd: m,
7985
8004
  onMessage: h,
7986
8005
  onError: C
7987
- }), P = xn(
8006
+ }), z = xn(
7988
8007
  () => ({
7989
8008
  "--bb-primary-color": (y == null ? void 0 : y.primaryColor) ?? o ?? "#1a1a2e"
7990
8009
  }),
7991
8010
  [y == null ? void 0 : y.primaryColor, o]
7992
- ), I = () => {
7993
- v.endSession(), v.startNewSession();
7994
- }, x = () => {
7995
- S(!1);
7996
- }, z = () => {
7997
- A();
7998
- }, q = i === "inline";
7999
- return T ? null : j && !t ? !q && !E ? /* @__PURE__ */ k(
8011
+ ), L = () => {
8012
+ _.endSession(), _.startNewSession();
8013
+ }, b = () => {
8014
+ I(!1);
8015
+ }, N = () => {
8016
+ V();
8017
+ }, T = i === "inline";
8018
+ return v ? null : q && !t ? !T && !E ? /* @__PURE__ */ k(
8000
8019
  "div",
8001
8020
  {
8002
8021
  className: `${De.widget} ${De[i]} ${u ?? ""}`,
8003
- style: P,
8022
+ style: z,
8004
8023
  children: /* @__PURE__ */ k(
8005
8024
  Xt,
8006
8025
  {
8007
- onClick: () => S(!0),
8026
+ onClick: () => I(!0),
8008
8027
  agentName: a
8009
8028
  }
8010
8029
  )
@@ -8013,14 +8032,14 @@ const Ns = "_messageWrapper_1thak_1", As = "_user_1thak_19", zs = "_assistant_1t
8013
8032
  "div",
8014
8033
  {
8015
8034
  className: `${De.widget} ${De[i]} ${u ?? ""}`,
8016
- style: P,
8035
+ style: z,
8017
8036
  children: /* @__PURE__ */ k(
8018
8037
  Gu,
8019
8038
  {
8020
- errorType: j,
8021
- message: F,
8022
- onRetry: z,
8023
- onClose: q ? void 0 : x
8039
+ errorType: q,
8040
+ message: O,
8041
+ onRetry: N,
8042
+ onClose: T ? void 0 : b
8024
8043
  }
8025
8044
  )
8026
8045
  }
@@ -8028,21 +8047,21 @@ const Ns = "_messageWrapper_1thak_1", As = "_user_1thak_19", zs = "_assistant_1t
8028
8047
  "div",
8029
8048
  {
8030
8049
  className: `${De.widget} ${De[i]} ${u ?? ""}`,
8031
- style: P,
8032
- children: E || q ? /* @__PURE__ */ k(
8050
+ style: z,
8051
+ children: E || T ? /* @__PURE__ */ k(
8033
8052
  Mu,
8034
8053
  {
8035
- config: L,
8036
- messages: v.messages,
8037
- isLoading: v.isLoading,
8038
- onSendMessage: v.sendMessage,
8039
- onClose: q ? void 0 : x,
8040
- onNewChat: I
8054
+ config: P,
8055
+ messages: _.messages,
8056
+ isLoading: _.isLoading,
8057
+ onSendMessage: _.sendMessage,
8058
+ onClose: T ? void 0 : b,
8059
+ onNewChat: L
8041
8060
  }
8042
8061
  ) : /* @__PURE__ */ k(
8043
8062
  Xt,
8044
8063
  {
8045
- onClick: () => S(!0),
8064
+ onClick: () => I(!0),
8046
8065
  agentName: y == null ? void 0 : y.agentName,
8047
8066
  agentLogoUrl: y == null ? void 0 : y.agentLogoUrl
8048
8067
  }