@cuadra-ai/uikit 0.1.7 → 0.1.9

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.mjs CHANGED
@@ -1,23 +1,23 @@
1
- var Ft = Object.defineProperty;
2
- var zt = (e, r, t) => r in e ? Ft(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
3
- var ee = (e, r, t) => zt(e, typeof r != "symbol" ? r + "" : r, t);
4
- import { jsx as h, jsxs as T, Fragment as W } from "react/jsx-runtime";
5
- import { forwardRef as Ye, createElement as Ae, useMemo as H, useState as N, useEffect as L, useCallback as re, memo as jt, useRef as et, createContext as $t } from "react";
6
- import { createPortal as ze } from "react-dom";
7
- import { useLocalRuntime as tt, AssistantRuntimeProvider as rt, unstable_useRemoteThreadListRuntime as Ot, useThreadRuntime as Ut, ThreadPrimitive as te, ComposerPrimitive as be, useAssistantApi as Bt, MessagePrimitive as ce, ThreadListPrimitive as ke, useThreadListItem as Wt, useThread as Ht, ThreadListItemPrimitive as xe } from "@assistant-ui/react";
8
- import { unstable_memoizeMarkdownComponents as qt, useIsMarkdownCodeBlock as Kt, MarkdownTextPrimitive as Vt } from "@assistant-ui/react-markdown";
9
- const Xt = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Gt = (e) => e.replace(
1
+ var jt = Object.defineProperty;
2
+ var $t = (e, r, t) => r in e ? jt(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
3
+ var le = (e, r, t) => $t(e, typeof r != "symbol" ? r + "" : r, t);
4
+ import { jsx as d, jsxs as v, Fragment as B } from "react/jsx-runtime";
5
+ import { forwardRef as tt, createElement as Ne, useMemo as W, useState as N, useEffect as M, useCallback as te, memo as Ot, useRef as rt, createContext as Ut } from "react";
6
+ import { createPortal as $e } from "react-dom";
7
+ import { useLocalRuntime as nt, AssistantRuntimeProvider as at, unstable_useRemoteThreadListRuntime as Bt, useThreadRuntime as Wt, ThreadPrimitive as ee, ComposerPrimitive as ke, useAssistantApi as Ht, MessagePrimitive as se, ThreadListPrimitive as xe, useThreadListItem as qt, useThread as Kt, ThreadListItemPrimitive as we } from "@assistant-ui/react";
8
+ import { unstable_memoizeMarkdownComponents as Vt, useIsMarkdownCodeBlock as Gt, MarkdownTextPrimitive as Zt } from "@assistant-ui/react-markdown";
9
+ const Jt = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Qt = (e) => e.replace(
10
10
  /^([A-Z])|[\s-_]+(\w)/g,
11
11
  (r, t, n) => n ? n.toUpperCase() : t.toLowerCase()
12
- ), je = (e) => {
13
- const r = Gt(e);
12
+ ), Oe = (e) => {
13
+ const r = Qt(e);
14
14
  return r.charAt(0).toUpperCase() + r.slice(1);
15
- }, nt = (...e) => e.filter((r, t, n) => !!r && r.trim() !== "" && n.indexOf(r) === t).join(" ").trim(), Zt = (e) => {
15
+ }, it = (...e) => e.filter((r, t, n) => !!r && r.trim() !== "" && n.indexOf(r) === t).join(" ").trim(), Xt = (e) => {
16
16
  for (const r in e)
17
17
  if (r.startsWith("aria-") || r === "role" || r === "title")
18
18
  return !0;
19
19
  };
20
- var Jt = {
20
+ var Yt = {
21
21
  xmlns: "http://www.w3.org/2000/svg",
22
22
  width: 24,
23
23
  height: 24,
@@ -28,7 +28,7 @@ var Jt = {
28
28
  strokeLinecap: "round",
29
29
  strokeLinejoin: "round"
30
30
  };
31
- const Qt = Ye(
31
+ const er = tt(
32
32
  ({
33
33
  color: e = "currentColor",
34
34
  size: r = 24,
@@ -38,76 +38,75 @@ const Qt = Ye(
38
38
  children: o,
39
39
  iconNode: a,
40
40
  ...u
41
- }, l) => Ae(
41
+ }, l) => Ne(
42
42
  "svg",
43
43
  {
44
44
  ref: l,
45
- ...Jt,
45
+ ...Yt,
46
46
  width: r,
47
47
  height: r,
48
48
  stroke: e,
49
49
  strokeWidth: n ? Number(t) * 24 / Number(r) : t,
50
- className: nt("lucide", i),
51
- ...!o && !Zt(u) && { "aria-hidden": "true" },
50
+ className: it("lucide", i),
51
+ ...!o && !Xt(u) && { "aria-hidden": "true" },
52
52
  ...u
53
53
  },
54
54
  [
55
- ...a.map(([s, f]) => Ae(s, f)),
55
+ ...a.map(([s, f]) => Ne(s, f)),
56
56
  ...Array.isArray(o) ? o : [o]
57
57
  ]
58
58
  )
59
59
  );
60
- const z = (e, r) => {
61
- const t = Ye(
62
- ({ className: n, ...i }, o) => Ae(Qt, {
60
+ const j = (e, r) => {
61
+ const t = tt(
62
+ ({ className: n, ...i }, o) => Ne(er, {
63
63
  ref: o,
64
64
  iconNode: r,
65
- className: nt(
66
- `lucide-${Xt(je(e))}`,
65
+ className: it(
66
+ `lucide-${Jt(Oe(e))}`,
67
67
  `lucide-${e}`,
68
68
  n
69
69
  ),
70
70
  ...i
71
71
  })
72
72
  );
73
- return t.displayName = je(e), t;
73
+ return t.displayName = Oe(e), t;
74
74
  };
75
- const Yt = [
75
+ const tr = [
76
76
  ["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }],
77
77
  ["path", { d: "M12 19V5", key: "x0mq9r" }]
78
- ], er = z("arrow-up", Yt);
79
- const tr = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]], rr = z("check", tr);
80
- const nr = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], ar = z("chevron-down", nr);
81
- const ir = [
78
+ ], rr = j("arrow-up", tr);
79
+ const nr = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]], ar = j("check", nr);
80
+ const ir = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], or = j("chevron-down", ir);
81
+ const lr = [
82
82
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
83
83
  ["path", { d: "M12 18a6 6 0 0 0 0-12v12z", key: "j4l70d" }]
84
- ], or = z("contrast", ir);
85
- const lr = [
84
+ ], ur = j("contrast", lr);
85
+ const cr = [
86
86
  ["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
87
87
  ["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
88
- ], ur = z("copy", lr);
89
- const cr = [
88
+ ], sr = j("copy", cr);
89
+ const dr = [
90
90
  ["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
91
91
  ["circle", { cx: "12", cy: "5", r: "1", key: "gxeob9" }],
92
92
  ["circle", { cx: "12", cy: "19", r: "1", key: "lyex9k" }]
93
- ], sr = z("ellipsis-vertical", cr);
94
- const dr = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]], at = z("loader-circle", dr);
95
- const fr = [
93
+ ], fr = j("ellipsis-vertical", dr);
94
+ const hr = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]], ot = j("loader-circle", hr);
95
+ const mr = [
96
96
  ["path", { d: "M4 5h16", key: "1tepv9" }],
97
97
  ["path", { d: "M4 12h16", key: "1lakjw" }],
98
98
  ["path", { d: "M4 19h16", key: "1djgab" }]
99
- ], hr = z("menu", fr);
100
- const mr = [
99
+ ], pr = j("menu", mr);
100
+ const gr = [
101
101
  ["path", { d: "M5 12h14", key: "1ays0h" }],
102
102
  ["path", { d: "M12 5v14", key: "s699le" }]
103
- ], pr = z("plus", mr);
104
- class it {
105
- constructor(r, t, n = !1, i) {
106
- ee(this, "baseUrl");
107
- ee(this, "sessionToken", null);
108
- ee(this, "isProxyMode", !1);
109
- ee(this, "tenantId", null);
110
- this.baseUrl = r.replace(/\/$/, ""), this.isProxyMode = n, t && (this.sessionToken = t), i && (this.tenantId = i);
103
+ ], br = j("plus", gr);
104
+ class lt {
105
+ constructor(r, t, n = !1) {
106
+ le(this, "baseUrl");
107
+ le(this, "sessionToken", null);
108
+ le(this, "isProxyMode", !1);
109
+ this.baseUrl = r.replace(/\/$/, ""), this.isProxyMode = n, t && (this.sessionToken = t);
111
110
  }
112
111
  /**
113
112
  * Set or update the session token
@@ -115,12 +114,6 @@ class it {
115
114
  setSessionToken(r) {
116
115
  this.sessionToken = r;
117
116
  }
118
- /**
119
- * Set or update the tenant ID
120
- */
121
- setTenantId(r) {
122
- this.tenantId = r;
123
- }
124
117
  /**
125
118
  * Create or continue a chat with streaming support
126
119
  * Returns a ReadableStream for SSE parsing
@@ -137,7 +130,7 @@ class it {
137
130
  "Content-Type": "application/json",
138
131
  "Idempotency-Key": this.generateIdempotencyKey()
139
132
  };
140
- this.sessionToken && (o.Authorization = `Bearer ${this.sessionToken}`), this.tenantId && (o["X-Tenant-Id"] = this.tenantId);
133
+ this.sessionToken && (o.Authorization = `Bearer ${this.sessionToken}`);
141
134
  const a = {
142
135
  ...r,
143
136
  stream: !0
@@ -164,7 +157,7 @@ class it {
164
157
  const t = this.getUrl(`/v1/chats/${r}`), n = {
165
158
  "Content-Type": "application/json"
166
159
  };
167
- this.sessionToken && (n.Authorization = `Bearer ${this.sessionToken}`), this.tenantId && (n["X-Tenant-Id"] = this.tenantId);
160
+ this.sessionToken && (n.Authorization = `Bearer ${this.sessionToken}`);
168
161
  const i = await fetch(t, {
169
162
  method: "GET",
170
163
  headers: n
@@ -188,7 +181,7 @@ class it {
188
181
  const i = {
189
182
  "Content-Type": "application/json"
190
183
  };
191
- this.sessionToken && (i.Authorization = `Bearer ${this.sessionToken}`), this.tenantId && (i["X-Tenant-Id"] = this.tenantId);
184
+ this.sessionToken && (i.Authorization = `Bearer ${this.sessionToken}`);
192
185
  const o = await fetch(n.toString(), {
193
186
  method: "GET",
194
187
  headers: i
@@ -224,7 +217,7 @@ class it {
224
217
  "Content-Type": "application/json",
225
218
  "Idempotency-Key": this.generateIdempotencyKey()
226
219
  };
227
- this.sessionToken && (u.Authorization = `Bearer ${this.sessionToken}`), this.tenantId && (u["X-Tenant-Id"] = this.tenantId);
220
+ this.sessionToken && (u.Authorization = `Bearer ${this.sessionToken}`);
228
221
  const l = await fetch(o.toString(), {
229
222
  method: "PATCH",
230
223
  headers: u,
@@ -261,7 +254,7 @@ class it {
261
254
  "Content-Type": "application/json",
262
255
  "Idempotency-Key": this.generateIdempotencyKey()
263
256
  };
264
- this.sessionToken && (a.Authorization = `Bearer ${this.sessionToken}`), this.tenantId && (a["X-Tenant-Id"] = this.tenantId);
257
+ this.sessionToken && (a.Authorization = `Bearer ${this.sessionToken}`);
265
258
  const u = await fetch(i.toString(), {
266
259
  method: "DELETE",
267
260
  headers: a
@@ -284,7 +277,7 @@ class it {
284
277
  const i = {
285
278
  "Content-Type": "application/json"
286
279
  };
287
- this.sessionToken && (i.Authorization = `Bearer ${this.sessionToken}`), this.tenantId && (i["X-Tenant-Id"] = this.tenantId);
280
+ this.sessionToken && (i.Authorization = `Bearer ${this.sessionToken}`);
288
281
  const o = await fetch(n.toString(), {
289
282
  method: "GET",
290
283
  headers: i
@@ -304,7 +297,7 @@ class it {
304
297
  const t = this.getUrl(`/v1/models/${r}`), n = {
305
298
  "Content-Type": "application/json"
306
299
  };
307
- this.sessionToken && (n.Authorization = `Bearer ${this.sessionToken}`), this.tenantId && (n["X-Tenant-Id"] = this.tenantId);
300
+ this.sessionToken && (n.Authorization = `Bearer ${this.sessionToken}`);
308
301
  const i = await fetch(t, {
309
302
  method: "GET",
310
303
  headers: n
@@ -318,7 +311,7 @@ class it {
318
311
  return i.json();
319
312
  }
320
313
  }
321
- async function* gr(e, r) {
314
+ async function* kr(e, r) {
322
315
  const t = e.getReader(), n = new TextDecoder();
323
316
  let i = "";
324
317
  try {
@@ -351,7 +344,7 @@ async function* gr(e, r) {
351
344
  t.releaseLock();
352
345
  }
353
346
  }
354
- function br(e) {
347
+ function xr(e) {
355
348
  return e.map((r) => {
356
349
  let t = "";
357
350
  if (typeof r.content == "string")
@@ -366,49 +359,51 @@ function br(e) {
366
359
  };
367
360
  });
368
361
  }
369
- function kr(e, r) {
370
- const { modelId: t, systemPrompt: n, ephemeral: i, onChatCreated: o } = r;
362
+ function wr(e, r) {
363
+ const { modelId: t, systemPrompt: n, ephemeral: i, onChatCreated: o, onUserMessage: a } = r;
371
364
  return {
372
- async *run(a) {
373
- const { messages: u, abortSignal: l } = a, f = {
374
- messages: br(u),
365
+ async *run(u) {
366
+ const { messages: l, abortSignal: s } = u;
367
+ l.length > 0 && l[l.length - 1].role === "user" && a?.();
368
+ const c = {
369
+ messages: xr(l),
375
370
  chatId: null,
376
371
  // Thread ID will be set by runtime if needed
377
372
  systemPrompt: n,
378
373
  ephemeral: i,
379
374
  stream: !0
380
375
  };
381
- t && t.trim() !== "" && (f.modelId = t);
382
- const c = await e.createOrContinueChat(f, l);
383
- let p = "", g;
384
- for await (const d of gr(c, l)) {
385
- if (l?.aborted)
376
+ t && t.trim() !== "" && (c.modelId = t);
377
+ const p = await e.createOrContinueChat(c, s);
378
+ let g = "", h;
379
+ for await (const k of kr(p, s)) {
380
+ if (s?.aborted)
386
381
  throw new Error("Request aborted");
387
- const k = d.id;
388
- k && !g && (g = k, o?.(k));
389
- const b = d.delta;
390
- if (b != null && (p += b), d.type === "message" || d.content) {
391
- const w = d.content || "";
392
- p += w;
382
+ const b = k.id;
383
+ b && !h && (h = b, o?.(b));
384
+ const x = k.delta;
385
+ if (x != null && (g += x), k.type === "message" || k.content) {
386
+ const y = k.content || "";
387
+ g += y;
393
388
  }
394
- if (d.message && (p += d.message.content || ""), d.tool_calls, d.finished) {
395
- p && (yield {
396
- content: [{ type: "text", text: p }]
389
+ if (k.message && (g += k.message.content || ""), k.tool_calls, k.finished) {
390
+ g && (yield {
391
+ content: [{ type: "text", text: g }]
397
392
  });
398
393
  break;
399
394
  }
400
- p && (yield {
401
- content: [{ type: "text", text: p }]
395
+ g && (yield {
396
+ content: [{ type: "text", text: g }]
402
397
  });
403
398
  }
404
- p && (yield {
405
- content: [{ type: "text", text: p }]
399
+ g && (yield {
400
+ content: [{ type: "text", text: g }]
406
401
  });
407
402
  }
408
403
  };
409
404
  }
410
- const $e = /* @__PURE__ */ new Map();
411
- function xr(e, r) {
405
+ const Ue = /* @__PURE__ */ new Map();
406
+ function yr(e, r) {
412
407
  return {
413
408
  async list() {
414
409
  const t = [];
@@ -429,7 +424,7 @@ function xr(e, r) {
429
424
  }).filter((u) => u !== null) };
430
425
  },
431
426
  async initialize(t) {
432
- return { remoteId: $e.get(t) || t, externalId: void 0 };
427
+ return { remoteId: Ue.get(t) || t, externalId: void 0 };
433
428
  },
434
429
  async rename(t, n) {
435
430
  await e.updateChat(t, { title: n });
@@ -465,65 +460,66 @@ function xr(e, r) {
465
460
  },
466
461
  // Add a method to update the remoteId mapping when chat ID is received
467
462
  updateRemoteId(t, n) {
468
- $e.set(t, n), r?.(t, n);
463
+ Ue.set(t, n), r?.(t, n);
469
464
  }
470
465
  };
471
466
  }
472
- function wr({
467
+ function Cr({
473
468
  children: e,
474
469
  baseUrl: r,
475
470
  sessionToken: t,
476
471
  isProxyMode: n = !1,
477
- tenantId: i,
478
- mode: o = "multiChat",
479
- modelId: a,
480
- onModelChange: u,
481
- ephemeral: l = !1,
482
- systemPrompt: s,
483
- initialThreadId: f,
484
- onError: c,
485
- onChatCreated: p,
472
+ mode: i = "multiChat",
473
+ modelId: o,
474
+ onModelChange: a,
475
+ ephemeral: u = !1,
476
+ systemPrompt: l,
477
+ initialThreadId: s,
478
+ onError: f,
479
+ onChatCreated: c,
480
+ onUserMessage: p,
486
481
  onThreadIdUpdate: g,
487
- onChatsLoaded: d
482
+ onChatsLoaded: h
488
483
  }) {
489
- const k = H(
490
- () => new it(r, t || void 0, n, i),
491
- [r, t, n, i]
492
- ), [b, x] = N(a || null);
493
- L(() => {
494
- a && x(a);
495
- }, [a]);
496
- const w = re(
497
- (I) => {
498
- p?.(I);
484
+ const k = W(
485
+ () => new lt(r, t || void 0, n),
486
+ [r, t, n]
487
+ ), [b, x] = N(o || null);
488
+ M(() => {
489
+ o && x(o);
490
+ }, [o]);
491
+ const w = te(
492
+ (C) => {
493
+ c?.(C);
499
494
  },
500
- [p]
501
- ), y = re(
502
- (I, D) => {
503
- g?.(I, D);
495
+ [c]
496
+ ), y = te(
497
+ (C, L) => {
498
+ g?.(C, L);
504
499
  },
505
500
  [g]
506
- ), v = H(() => kr(k, {
501
+ ), A = W(() => wr(k, {
507
502
  modelId: b || void 0,
508
503
  // Pass undefined if not set (backend resolves it)
509
- systemPrompt: s,
510
- ephemeral: l,
511
- onChatCreated: w
512
- }), [k, b, s, l, w]), C = tt(v);
513
- return o === "singleChat" ? /* @__PURE__ */ h(rt, { runtime: C, children: e }) : /* @__PURE__ */ h(
514
- yr,
504
+ systemPrompt: l,
505
+ ephemeral: u,
506
+ onChatCreated: w,
507
+ onUserMessage: p
508
+ }), [k, b, l, u, w, p]), T = nt(A);
509
+ return i === "singleChat" ? /* @__PURE__ */ d(at, { runtime: T, children: e }) : /* @__PURE__ */ d(
510
+ vr,
515
511
  {
516
512
  client: k,
517
- modelAdapter: v,
518
- initialThreadId: f,
519
- onChatsLoaded: d,
513
+ modelAdapter: A,
514
+ initialThreadId: s,
515
+ onChatsLoaded: h,
520
516
  onThreadIdUpdate: y,
521
- onError: c,
517
+ onError: f,
522
518
  children: e
523
519
  }
524
520
  );
525
521
  }
526
- function yr({
522
+ function vr({
527
523
  client: e,
528
524
  modelAdapter: r,
529
525
  initialThreadId: t,
@@ -532,27 +528,27 @@ function yr({
532
528
  onError: o,
533
529
  children: a
534
530
  }) {
535
- const u = H(() => xr(e, (c, p) => {
531
+ const u = W(() => yr(e, (c, p) => {
536
532
  i?.(c, p);
537
- }), [e, i]), l = H(() => ({
533
+ }), [e, i]), l = W(() => ({
538
534
  ...u,
539
535
  async list() {
540
536
  const c = await u.list();
541
537
  return n?.(), c;
542
538
  }
543
539
  }), [u, n]);
544
- L(() => {
540
+ M(() => {
545
541
  window.__cuadraThreadListAdapter = l, window.__cuadraThreadListRuntime = null;
546
542
  }, [l]);
547
- const s = re(() => tt(r), [r]), f = Ot({
543
+ const s = te(() => nt(r), [r]), f = Bt({
548
544
  adapter: l,
549
545
  runtimeHook: s
550
546
  });
551
- return L(() => {
547
+ return M(() => {
552
548
  window.__cuadraThreadListRuntime = f;
553
- }, [f]), /* @__PURE__ */ h(rt, { runtime: f, children: a });
549
+ }, [f]), /* @__PURE__ */ d(at, { runtime: f, children: a });
554
550
  }
555
- function Oe(e, r) {
551
+ function Be(e, r) {
556
552
  const t = String(e);
557
553
  if (typeof r != "string")
558
554
  throw new TypeError("Expected character");
@@ -561,36 +557,36 @@ function Oe(e, r) {
561
557
  n++, i = t.indexOf(r, i + r.length);
562
558
  return n;
563
559
  }
564
- const ne = he(/[A-Za-z]/), Le = he(/[\dA-Za-z]/);
565
- function Cr(e) {
560
+ const re = me(/[A-Za-z]/), Me = me(/[\dA-Za-z]/);
561
+ function Tr(e) {
566
562
  return (
567
563
  // Special whitespace codes (which have negative values), C0 and Control
568
564
  // character DEL
569
565
  e !== null && (e < 32 || e === 127)
570
566
  );
571
567
  }
572
- function G(e) {
568
+ function Z(e) {
573
569
  return e !== null && e < -2;
574
570
  }
575
- function M(e) {
571
+ function D(e) {
576
572
  return e !== null && (e < 0 || e === 32);
577
573
  }
578
- function _(e) {
574
+ function F(e) {
579
575
  return e === -2 || e === -1 || e === 32;
580
576
  }
581
- const fe = he(/\p{P}|\p{S}/u), q = he(/\s/);
582
- function he(e) {
577
+ const he = me(/\p{P}|\p{S}/u), H = me(/\s/);
578
+ function me(e) {
583
579
  return r;
584
580
  function r(t) {
585
581
  return t !== null && t > -1 && e.test(String.fromCharCode(t));
586
582
  }
587
583
  }
588
- function vr(e) {
584
+ function Ar(e) {
589
585
  if (typeof e != "string")
590
586
  throw new TypeError("Expected a string");
591
587
  return e.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
592
588
  }
593
- const me = (
589
+ const pe = (
594
590
  // Note: overloads in JSDoc can’t yet use different `@template`s.
595
591
  /**
596
592
  * @type {(
@@ -607,29 +603,29 @@ const me = (
607
603
  */
608
604
  (function(e) {
609
605
  if (e == null)
610
- return Nr;
606
+ return Lr;
611
607
  if (typeof e == "function")
612
- return pe(e);
608
+ return ge(e);
613
609
  if (typeof e == "object")
614
- return Array.isArray(e) ? Tr(e) : (
610
+ return Array.isArray(e) ? Ir(e) : (
615
611
  // Cast because `ReadonlyArray` goes into the above but `isArray`
616
612
  // narrows to `Array`.
617
- Ir(
613
+ Nr(
618
614
  /** @type {Props} */
619
615
  e
620
616
  )
621
617
  );
622
618
  if (typeof e == "string")
623
- return Ar(e);
619
+ return Sr(e);
624
620
  throw new Error("Expected function, string, or object as test");
625
621
  })
626
622
  );
627
- function Tr(e) {
623
+ function Ir(e) {
628
624
  const r = [];
629
625
  let t = -1;
630
626
  for (; ++t < e.length; )
631
- r[t] = me(e[t]);
632
- return pe(n);
627
+ r[t] = pe(e[t]);
628
+ return ge(n);
633
629
  function n(...i) {
634
630
  let o = -1;
635
631
  for (; ++o < r.length; )
@@ -637,12 +633,12 @@ function Tr(e) {
637
633
  return !1;
638
634
  }
639
635
  }
640
- function Ir(e) {
636
+ function Nr(e) {
641
637
  const r = (
642
638
  /** @type {Record<string, unknown>} */
643
639
  e
644
640
  );
645
- return pe(t);
641
+ return ge(t);
646
642
  function t(n) {
647
643
  const i = (
648
644
  /** @type {Record<string, unknown>} */
@@ -655,16 +651,16 @@ function Ir(e) {
655
651
  return !0;
656
652
  }
657
653
  }
658
- function Ar(e) {
659
- return pe(r);
654
+ function Sr(e) {
655
+ return ge(r);
660
656
  function r(t) {
661
657
  return t && t.type === e;
662
658
  }
663
659
  }
664
- function pe(e) {
660
+ function ge(e) {
665
661
  return r;
666
662
  function r(t, n, i) {
667
- return !!(Sr(t) && e.call(
663
+ return !!(Mr(t) && e.call(
668
664
  this,
669
665
  t,
670
666
  typeof n == "number" ? n : void 0,
@@ -672,17 +668,17 @@ function pe(e) {
672
668
  ));
673
669
  }
674
670
  }
675
- function Nr() {
671
+ function Lr() {
676
672
  return !0;
677
673
  }
678
- function Sr(e) {
674
+ function Mr(e) {
679
675
  return e !== null && typeof e == "object" && "type" in e;
680
676
  }
681
- const ot = [], Lr = !0, Ne = !1, Mr = "skip";
682
- function lt(e, r, t, n) {
677
+ const ut = [], Dr = !0, Se = !1, Pr = "skip";
678
+ function ct(e, r, t, n) {
683
679
  let i;
684
680
  typeof r == "function" && typeof t != "function" ? (n = t, t = r) : i = r;
685
- const o = me(i), a = n ? -1 : 1;
681
+ const o = pe(i), a = n ? -1 : 1;
686
682
  u(e, void 0, [])();
687
683
  function u(l, s, f) {
688
684
  const c = (
@@ -703,41 +699,41 @@ function lt(e, r, t, n) {
703
699
  }
704
700
  return p;
705
701
  function p() {
706
- let g = ot, d, k, b;
707
- if ((!r || o(l, s, f[f.length - 1] || void 0)) && (g = Dr(t(l, f)), g[0] === Ne))
702
+ let g = ut, h, k, b;
703
+ if ((!r || o(l, s, f[f.length - 1] || void 0)) && (g = Rr(t(l, f)), g[0] === Se))
708
704
  return g;
709
705
  if ("children" in l && l.children) {
710
706
  const x = (
711
707
  /** @type {UnistParent} */
712
708
  l
713
709
  );
714
- if (x.children && g[0] !== Mr)
710
+ if (x.children && g[0] !== Pr)
715
711
  for (k = (n ? x.children.length : -1) + a, b = f.concat(x); k > -1 && k < x.children.length; ) {
716
712
  const w = x.children[k];
717
- if (d = u(w, k, b)(), d[0] === Ne)
718
- return d;
719
- k = typeof d[1] == "number" ? d[1] : k + a;
713
+ if (h = u(w, k, b)(), h[0] === Se)
714
+ return h;
715
+ k = typeof h[1] == "number" ? h[1] : k + a;
720
716
  }
721
717
  }
722
718
  return g;
723
719
  }
724
720
  }
725
721
  }
726
- function Dr(e) {
727
- return Array.isArray(e) ? e : typeof e == "number" ? [Lr, e] : e == null ? ot : [e];
722
+ function Rr(e) {
723
+ return Array.isArray(e) ? e : typeof e == "number" ? [Dr, e] : e == null ? ut : [e];
728
724
  }
729
- function Pr(e, r, t) {
730
- const i = me((t || {}).ignore || []), o = Rr(r);
725
+ function Er(e, r, t) {
726
+ const i = pe((t || {}).ignore || []), o = _r(r);
731
727
  let a = -1;
732
728
  for (; ++a < o.length; )
733
- lt(e, "text", u);
729
+ ct(e, "text", u);
734
730
  function u(s, f) {
735
731
  let c = -1, p;
736
732
  for (; ++c < f.length; ) {
737
- const g = f[c], d = p ? p.children : void 0;
733
+ const g = f[c], h = p ? p.children : void 0;
738
734
  if (i(
739
735
  g,
740
- d ? d.indexOf(g) : void 0,
736
+ h ? h.indexOf(g) : void 0,
741
737
  p
742
738
  ))
743
739
  return;
@@ -748,29 +744,29 @@ function Pr(e, r, t) {
748
744
  }
749
745
  function l(s, f) {
750
746
  const c = f[f.length - 1], p = o[a][0], g = o[a][1];
751
- let d = 0;
747
+ let h = 0;
752
748
  const b = c.children.indexOf(s);
753
749
  let x = !1, w = [];
754
750
  p.lastIndex = 0;
755
751
  let y = p.exec(s.value);
756
752
  for (; y; ) {
757
- const v = y.index, C = {
753
+ const A = y.index, T = {
758
754
  index: y.index,
759
755
  input: y.input,
760
756
  stack: [...f, s]
761
757
  };
762
- let I = g(...y, C);
763
- if (typeof I == "string" && (I = I.length > 0 ? { type: "text", value: I } : void 0), I === !1 ? p.lastIndex = v + 1 : (d !== v && w.push({
758
+ let C = g(...y, T);
759
+ if (typeof C == "string" && (C = C.length > 0 ? { type: "text", value: C } : void 0), C === !1 ? p.lastIndex = A + 1 : (h !== A && w.push({
764
760
  type: "text",
765
- value: s.value.slice(d, v)
766
- }), Array.isArray(I) ? w.push(...I) : I && w.push(I), d = v + y[0].length, x = !0), !p.global)
761
+ value: s.value.slice(h, A)
762
+ }), Array.isArray(C) ? w.push(...C) : C && w.push(C), h = A + y[0].length, x = !0), !p.global)
767
763
  break;
768
764
  y = p.exec(s.value);
769
765
  }
770
- return x ? (d < s.value.length && w.push({ type: "text", value: s.value.slice(d) }), c.children.splice(b, 1, ...w)) : w = [s], b + w.length;
766
+ return x ? (h < s.value.length && w.push({ type: "text", value: s.value.slice(h) }), c.children.splice(b, 1, ...w)) : w = [s], b + w.length;
771
767
  }
772
768
  }
773
- function Rr(e) {
769
+ function _r(e) {
774
770
  const r = [];
775
771
  if (!Array.isArray(e))
776
772
  throw new TypeError("Expected find and replace tuple or list of tuples");
@@ -778,98 +774,98 @@ function Rr(e) {
778
774
  let n = -1;
779
775
  for (; ++n < t.length; ) {
780
776
  const i = t[n];
781
- r.push([Er(i[0]), _r(i[1])]);
777
+ r.push([Fr(i[0]), zr(i[1])]);
782
778
  }
783
779
  return r;
784
780
  }
785
- function Er(e) {
786
- return typeof e == "string" ? new RegExp(vr(e), "g") : e;
781
+ function Fr(e) {
782
+ return typeof e == "string" ? new RegExp(Ar(e), "g") : e;
787
783
  }
788
- function _r(e) {
784
+ function zr(e) {
789
785
  return typeof e == "function" ? e : function() {
790
786
  return e;
791
787
  };
792
788
  }
793
- const we = "phrasing", ye = ["autolink", "link", "image", "label"];
794
- function Fr() {
789
+ const ye = "phrasing", Ce = ["autolink", "link", "image", "label"];
790
+ function jr() {
795
791
  return {
796
- transforms: [Wr],
792
+ transforms: [qr],
797
793
  enter: {
798
- literalAutolink: jr,
799
- literalAutolinkEmail: Ce,
800
- literalAutolinkHttp: Ce,
801
- literalAutolinkWww: Ce
794
+ literalAutolink: Or,
795
+ literalAutolinkEmail: ve,
796
+ literalAutolinkHttp: ve,
797
+ literalAutolinkWww: ve
802
798
  },
803
799
  exit: {
804
- literalAutolink: Br,
805
- literalAutolinkEmail: Ur,
806
- literalAutolinkHttp: $r,
807
- literalAutolinkWww: Or
800
+ literalAutolink: Hr,
801
+ literalAutolinkEmail: Wr,
802
+ literalAutolinkHttp: Ur,
803
+ literalAutolinkWww: Br
808
804
  }
809
805
  };
810
806
  }
811
- function zr() {
807
+ function $r() {
812
808
  return {
813
809
  unsafe: [
814
810
  {
815
811
  character: "@",
816
812
  before: "[+\\-.\\w]",
817
813
  after: "[\\-.\\w]",
818
- inConstruct: we,
819
- notInConstruct: ye
814
+ inConstruct: ye,
815
+ notInConstruct: Ce
820
816
  },
821
817
  {
822
818
  character: ".",
823
819
  before: "[Ww]",
824
820
  after: "[\\-.\\w]",
825
- inConstruct: we,
826
- notInConstruct: ye
821
+ inConstruct: ye,
822
+ notInConstruct: Ce
827
823
  },
828
824
  {
829
825
  character: ":",
830
826
  before: "[ps]",
831
827
  after: "\\/",
832
- inConstruct: we,
833
- notInConstruct: ye
828
+ inConstruct: ye,
829
+ notInConstruct: Ce
834
830
  }
835
831
  ]
836
832
  };
837
833
  }
838
- function jr(e) {
834
+ function Or(e) {
839
835
  this.enter({ type: "link", title: null, url: "", children: [] }, e);
840
836
  }
841
- function Ce(e) {
837
+ function ve(e) {
842
838
  this.config.enter.autolinkProtocol.call(this, e);
843
839
  }
844
- function $r(e) {
840
+ function Ur(e) {
845
841
  this.config.exit.autolinkProtocol.call(this, e);
846
842
  }
847
- function Or(e) {
843
+ function Br(e) {
848
844
  this.config.exit.data.call(this, e);
849
845
  const r = this.stack[this.stack.length - 1];
850
846
  r.type, r.url = "http://" + this.sliceSerialize(e);
851
847
  }
852
- function Ur(e) {
848
+ function Wr(e) {
853
849
  this.config.exit.autolinkEmail.call(this, e);
854
850
  }
855
- function Br(e) {
851
+ function Hr(e) {
856
852
  this.exit(e);
857
853
  }
858
- function Wr(e) {
859
- Pr(
854
+ function qr(e) {
855
+ Er(
860
856
  e,
861
857
  [
862
- [/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi, Hr],
863
- [/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu, qr]
858
+ [/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi, Kr],
859
+ [/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu, Vr]
864
860
  ],
865
861
  { ignore: ["link", "linkReference"] }
866
862
  );
867
863
  }
868
- function Hr(e, r, t, n, i) {
864
+ function Kr(e, r, t, n, i) {
869
865
  let o = "";
870
- if (!ut(i) || (/^w/i.test(r) && (t = r + t, r = "", o = "http://"), !Kr(t)))
866
+ if (!st(i) || (/^w/i.test(r) && (t = r + t, r = "", o = "http://"), !Gr(t)))
871
867
  return !1;
872
- const a = Vr(t + n);
868
+ const a = Zr(t + n);
873
869
  if (!a[0]) return !1;
874
870
  const u = {
875
871
  type: "link",
@@ -879,10 +875,10 @@ function Hr(e, r, t, n, i) {
879
875
  };
880
876
  return a[1] ? [u, { type: "text", value: a[1] }] : u;
881
877
  }
882
- function qr(e, r, t, n) {
878
+ function Vr(e, r, t, n) {
883
879
  return (
884
880
  // Not an expected previous character.
885
- !ut(n, !0) || // Label ends in not allowed character.
881
+ !st(n, !0) || // Label ends in not allowed character.
886
882
  /[-\d_]$/.test(t) ? !1 : {
887
883
  type: "link",
888
884
  title: null,
@@ -891,68 +887,68 @@ function qr(e, r, t, n) {
891
887
  }
892
888
  );
893
889
  }
894
- function Kr(e) {
890
+ function Gr(e) {
895
891
  const r = e.split(".");
896
892
  return !(r.length < 2 || r[r.length - 1] && (/_/.test(r[r.length - 1]) || !/[a-zA-Z\d]/.test(r[r.length - 1])) || r[r.length - 2] && (/_/.test(r[r.length - 2]) || !/[a-zA-Z\d]/.test(r[r.length - 2])));
897
893
  }
898
- function Vr(e) {
894
+ function Zr(e) {
899
895
  const r = /[!"&'),.:;<>?\]}]+$/.exec(e);
900
896
  if (!r)
901
897
  return [e, void 0];
902
898
  e = e.slice(0, r.index);
903
899
  let t = r[0], n = t.indexOf(")");
904
- const i = Oe(e, "(");
905
- let o = Oe(e, ")");
900
+ const i = Be(e, "(");
901
+ let o = Be(e, ")");
906
902
  for (; n !== -1 && i > o; )
907
903
  e += t.slice(0, n + 1), t = t.slice(n + 1), n = t.indexOf(")"), o++;
908
904
  return [e, t];
909
905
  }
910
- function ut(e, r) {
906
+ function st(e, r) {
911
907
  const t = e.input.charCodeAt(e.index - 1);
912
- return (e.index === 0 || q(t) || fe(t)) && // If it’s an email, the previous character should not be a slash.
908
+ return (e.index === 0 || H(t) || he(t)) && // If it’s an email, the previous character should not be a slash.
913
909
  (!r || t !== 47);
914
910
  }
915
- function ie(e) {
911
+ function ae(e) {
916
912
  return e.replace(/[\t\n\r ]+/g, " ").replace(/^ | $/g, "").toLowerCase().toUpperCase();
917
913
  }
918
- ct.peek = rn;
919
- function Xr() {
914
+ dt.peek = an;
915
+ function Jr() {
920
916
  this.buffer();
921
917
  }
922
- function Gr(e) {
918
+ function Qr(e) {
923
919
  this.enter({ type: "footnoteReference", identifier: "", label: "" }, e);
924
920
  }
925
- function Zr() {
921
+ function Xr() {
926
922
  this.buffer();
927
923
  }
928
- function Jr(e) {
924
+ function Yr(e) {
929
925
  this.enter(
930
926
  { type: "footnoteDefinition", identifier: "", label: "", children: [] },
931
927
  e
932
928
  );
933
929
  }
934
- function Qr(e) {
930
+ function en(e) {
935
931
  const r = this.resume(), t = this.stack[this.stack.length - 1];
936
- t.type, t.identifier = ie(
932
+ t.type, t.identifier = ae(
937
933
  this.sliceSerialize(e)
938
934
  ).toLowerCase(), t.label = r;
939
935
  }
940
- function Yr(e) {
936
+ function tn(e) {
941
937
  this.exit(e);
942
938
  }
943
- function en(e) {
939
+ function rn(e) {
944
940
  const r = this.resume(), t = this.stack[this.stack.length - 1];
945
- t.type, t.identifier = ie(
941
+ t.type, t.identifier = ae(
946
942
  this.sliceSerialize(e)
947
943
  ).toLowerCase(), t.label = r;
948
944
  }
949
- function tn(e) {
945
+ function nn(e) {
950
946
  this.exit(e);
951
947
  }
952
- function rn() {
948
+ function an() {
953
949
  return "[";
954
950
  }
955
- function ct(e, r, t, n) {
951
+ function dt(e, r, t, n) {
956
952
  const i = t.createTracker(n);
957
953
  let o = i.move("[^");
958
954
  const a = t.enter("footnoteReference"), u = t.enter("reference");
@@ -960,26 +956,26 @@ function ct(e, r, t, n) {
960
956
  t.safe(t.associationId(e), { after: "]", before: o })
961
957
  ), u(), a(), o += i.move("]"), o;
962
958
  }
963
- function nn() {
959
+ function on() {
964
960
  return {
965
961
  enter: {
966
- gfmFootnoteCallString: Xr,
967
- gfmFootnoteCall: Gr,
968
- gfmFootnoteDefinitionLabelString: Zr,
969
- gfmFootnoteDefinition: Jr
962
+ gfmFootnoteCallString: Jr,
963
+ gfmFootnoteCall: Qr,
964
+ gfmFootnoteDefinitionLabelString: Xr,
965
+ gfmFootnoteDefinition: Yr
970
966
  },
971
967
  exit: {
972
- gfmFootnoteCallString: Qr,
973
- gfmFootnoteCall: Yr,
974
- gfmFootnoteDefinitionLabelString: en,
975
- gfmFootnoteDefinition: tn
968
+ gfmFootnoteCallString: en,
969
+ gfmFootnoteCall: tn,
970
+ gfmFootnoteDefinitionLabelString: rn,
971
+ gfmFootnoteDefinition: nn
976
972
  }
977
973
  };
978
974
  }
979
- function an(e) {
975
+ function ln(e) {
980
976
  let r = !1;
981
977
  return e && e.firstLineBlank && (r = !0), {
982
- handlers: { footnoteDefinition: t, footnoteReference: ct },
978
+ handlers: { footnoteDefinition: t, footnoteReference: dt },
983
979
  // This is on by default already.
984
980
  unsafe: [{ character: "[", inConstruct: ["label", "phrasing", "reference"] }]
985
981
  };
@@ -993,18 +989,18 @@ function an(e) {
993
989
  (r ? `
994
990
  ` : " ") + o.indentLines(
995
991
  o.containerFlow(n, u.current()),
996
- r ? st : on
992
+ r ? ft : un
997
993
  )
998
994
  )), s(), l;
999
995
  }
1000
996
  }
1001
- function on(e, r, t) {
1002
- return r === 0 ? e : st(e, r, t);
997
+ function un(e, r, t) {
998
+ return r === 0 ? e : ft(e, r, t);
1003
999
  }
1004
- function st(e, r, t) {
1000
+ function ft(e, r, t) {
1005
1001
  return (t ? "" : " ") + e;
1006
1002
  }
1007
- const ln = [
1003
+ const cn = [
1008
1004
  "autolink",
1009
1005
  "destinationLiteral",
1010
1006
  "destinationRaw",
@@ -1012,33 +1008,33 @@ const ln = [
1012
1008
  "titleQuote",
1013
1009
  "titleApostrophe"
1014
1010
  ];
1015
- dt.peek = fn;
1016
- function un() {
1011
+ ht.peek = mn;
1012
+ function sn() {
1017
1013
  return {
1018
1014
  canContainEols: ["delete"],
1019
- enter: { strikethrough: sn },
1020
- exit: { strikethrough: dn }
1015
+ enter: { strikethrough: fn },
1016
+ exit: { strikethrough: hn }
1021
1017
  };
1022
1018
  }
1023
- function cn() {
1019
+ function dn() {
1024
1020
  return {
1025
1021
  unsafe: [
1026
1022
  {
1027
1023
  character: "~",
1028
1024
  inConstruct: "phrasing",
1029
- notInConstruct: ln
1025
+ notInConstruct: cn
1030
1026
  }
1031
1027
  ],
1032
- handlers: { delete: dt }
1028
+ handlers: { delete: ht }
1033
1029
  };
1034
1030
  }
1035
- function sn(e) {
1031
+ function fn(e) {
1036
1032
  this.enter({ type: "delete", children: [] }, e);
1037
1033
  }
1038
- function dn(e) {
1034
+ function hn(e) {
1039
1035
  this.exit(e);
1040
1036
  }
1041
- function dt(e, r, t, n) {
1037
+ function ht(e, r, t, n) {
1042
1038
  const i = t.createTracker(n), o = t.enter("strikethrough");
1043
1039
  let a = i.move("~~");
1044
1040
  return a += t.containerPhrasing(e, {
@@ -1047,20 +1043,20 @@ function dt(e, r, t, n) {
1047
1043
  after: "~"
1048
1044
  }), a += i.move("~~"), o(), a;
1049
1045
  }
1050
- function fn() {
1046
+ function mn() {
1051
1047
  return "~";
1052
1048
  }
1053
- function hn(e) {
1049
+ function pn(e) {
1054
1050
  return e.length;
1055
1051
  }
1056
- function mn(e, r) {
1057
- const t = r || {}, n = (t.align || []).concat(), i = t.stringLength || hn, o = [], a = [], u = [], l = [];
1052
+ function gn(e, r) {
1053
+ const t = r || {}, n = (t.align || []).concat(), i = t.stringLength || pn, o = [], a = [], u = [], l = [];
1058
1054
  let s = 0, f = -1;
1059
1055
  for (; ++f < e.length; ) {
1060
1056
  const k = [], b = [];
1061
1057
  let x = -1;
1062
1058
  for (e[f].length > s && (s = e[f].length); ++x < e[f].length; ) {
1063
- const w = pn(e[f][x]);
1059
+ const w = bn(e[f][x]);
1064
1060
  if (t.alignDelimiters !== !1) {
1065
1061
  const y = i(w);
1066
1062
  b[x] = y, (l[x] === void 0 || y > l[x]) && (l[x] = y);
@@ -1072,9 +1068,9 @@ function mn(e, r) {
1072
1068
  let c = -1;
1073
1069
  if (typeof n == "object" && "length" in n)
1074
1070
  for (; ++c < s; )
1075
- o[c] = Ue(n[c]);
1071
+ o[c] = We(n[c]);
1076
1072
  else {
1077
- const k = Ue(n);
1073
+ const k = We(n);
1078
1074
  for (; ++c < s; )
1079
1075
  o[c] = k;
1080
1076
  }
@@ -1092,52 +1088,52 @@ function mn(e, r) {
1092
1088
  t.alignDelimiters !== !1 && (w = b.length + w + x.length, w > l[c] && (l[c] = w), g[c] = w), p[c] = y;
1093
1089
  }
1094
1090
  a.splice(1, 0, p), u.splice(1, 0, g), f = -1;
1095
- const d = [];
1091
+ const h = [];
1096
1092
  for (; ++f < a.length; ) {
1097
1093
  const k = a[f], b = u[f];
1098
1094
  c = -1;
1099
1095
  const x = [];
1100
1096
  for (; ++c < s; ) {
1101
1097
  const w = k[c] || "";
1102
- let y = "", v = "";
1098
+ let y = "", A = "";
1103
1099
  if (t.alignDelimiters !== !1) {
1104
- const C = l[c] - (b[c] || 0), I = o[c];
1105
- I === 114 ? y = " ".repeat(C) : I === 99 ? C % 2 ? (y = " ".repeat(C / 2 + 0.5), v = " ".repeat(C / 2 - 0.5)) : (y = " ".repeat(C / 2), v = y) : v = " ".repeat(C);
1100
+ const T = l[c] - (b[c] || 0), C = o[c];
1101
+ C === 114 ? y = " ".repeat(T) : C === 99 ? T % 2 ? (y = " ".repeat(T / 2 + 0.5), A = " ".repeat(T / 2 - 0.5)) : (y = " ".repeat(T / 2), A = y) : A = " ".repeat(T);
1106
1102
  }
1107
1103
  t.delimiterStart !== !1 && !c && x.push("|"), t.padding !== !1 && // Don’t add the opening space if we’re not aligning and the cell is
1108
1104
  // empty: there will be a closing space.
1109
- !(t.alignDelimiters === !1 && w === "") && (t.delimiterStart !== !1 || c) && x.push(" "), t.alignDelimiters !== !1 && x.push(y), x.push(w), t.alignDelimiters !== !1 && x.push(v), t.padding !== !1 && x.push(" "), (t.delimiterEnd !== !1 || c !== s - 1) && x.push("|");
1105
+ !(t.alignDelimiters === !1 && w === "") && (t.delimiterStart !== !1 || c) && x.push(" "), t.alignDelimiters !== !1 && x.push(y), x.push(w), t.alignDelimiters !== !1 && x.push(A), t.padding !== !1 && x.push(" "), (t.delimiterEnd !== !1 || c !== s - 1) && x.push("|");
1110
1106
  }
1111
- d.push(
1107
+ h.push(
1112
1108
  t.delimiterEnd === !1 ? x.join("").replace(/ +$/, "") : x.join("")
1113
1109
  );
1114
1110
  }
1115
- return d.join(`
1111
+ return h.join(`
1116
1112
  `);
1117
1113
  }
1118
- function pn(e) {
1114
+ function bn(e) {
1119
1115
  return e == null ? "" : String(e);
1120
1116
  }
1121
- function Ue(e) {
1117
+ function We(e) {
1122
1118
  const r = typeof e == "string" ? e.codePointAt(0) : 0;
1123
1119
  return r === 67 || r === 99 ? 99 : r === 76 || r === 108 ? 108 : r === 82 || r === 114 ? 114 : 0;
1124
1120
  }
1125
- function gn(e, r, t, n) {
1121
+ function kn(e, r, t, n) {
1126
1122
  const i = t.enter("blockquote"), o = t.createTracker(n);
1127
1123
  o.move("> "), o.shift(2);
1128
1124
  const a = t.indentLines(
1129
1125
  t.containerFlow(e, o.current()),
1130
- bn
1126
+ xn
1131
1127
  );
1132
1128
  return i(), a;
1133
1129
  }
1134
- function bn(e, r, t) {
1130
+ function xn(e, r, t) {
1135
1131
  return ">" + (t ? "" : " ") + e;
1136
1132
  }
1137
- function kn(e, r) {
1138
- return Be(e, r.inConstruct, !0) && !Be(e, r.notInConstruct, !1);
1133
+ function wn(e, r) {
1134
+ return He(e, r.inConstruct, !0) && !He(e, r.notInConstruct, !1);
1139
1135
  }
1140
- function Be(e, r, t) {
1136
+ function He(e, r, t) {
1141
1137
  if (typeof r == "string" && (r = [r]), !r || r.length === 0)
1142
1138
  return t;
1143
1139
  let n = -1;
@@ -1146,16 +1142,16 @@ function Be(e, r, t) {
1146
1142
  return !0;
1147
1143
  return !1;
1148
1144
  }
1149
- function We(e, r, t, n) {
1145
+ function qe(e, r, t, n) {
1150
1146
  let i = -1;
1151
1147
  for (; ++i < t.unsafe.length; )
1152
1148
  if (t.unsafe[i].character === `
1153
- ` && kn(t.stack, t.unsafe[i]))
1149
+ ` && wn(t.stack, t.unsafe[i]))
1154
1150
  return /[ \t]/.test(n.before) ? "" : " ";
1155
1151
  return `\\
1156
1152
  `;
1157
1153
  }
1158
- function xn(e, r) {
1154
+ function yn(e, r) {
1159
1155
  const t = String(e);
1160
1156
  let n = t.indexOf(r), i = n, o = 0, a = 0;
1161
1157
  if (typeof r != "string")
@@ -1164,13 +1160,13 @@ function xn(e, r) {
1164
1160
  n === i ? ++o > a && (a = o) : o = 1, i = n + r.length, n = t.indexOf(r, i);
1165
1161
  return a;
1166
1162
  }
1167
- function wn(e, r) {
1163
+ function Cn(e, r) {
1168
1164
  return !!(r.options.fences === !1 && e.value && // If there’s no info…
1169
1165
  !e.lang && // And there’s a non-whitespace character…
1170
1166
  /[^ \r\n]/.test(e.value) && // And the value doesn’t start or end in a blank…
1171
1167
  !/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value));
1172
1168
  }
1173
- function yn(e) {
1169
+ function vn(e) {
1174
1170
  const r = e.options.fence || "`";
1175
1171
  if (r !== "`" && r !== "~")
1176
1172
  throw new Error(
@@ -1178,13 +1174,13 @@ function yn(e) {
1178
1174
  );
1179
1175
  return r;
1180
1176
  }
1181
- function Cn(e, r, t, n) {
1182
- const i = yn(t), o = e.value || "", a = i === "`" ? "GraveAccent" : "Tilde";
1183
- if (wn(e, t)) {
1184
- const c = t.enter("codeIndented"), p = t.indentLines(o, vn);
1177
+ function Tn(e, r, t, n) {
1178
+ const i = vn(t), o = e.value || "", a = i === "`" ? "GraveAccent" : "Tilde";
1179
+ if (Cn(e, t)) {
1180
+ const c = t.enter("codeIndented"), p = t.indentLines(o, An);
1185
1181
  return c(), p;
1186
1182
  }
1187
- const u = t.createTracker(n), l = i.repeat(Math.max(xn(o, i) + 1, 3)), s = t.enter("codeFenced");
1183
+ const u = t.createTracker(n), l = i.repeat(Math.max(yn(o, i) + 1, 3)), s = t.enter("codeFenced");
1188
1184
  let f = u.move(l);
1189
1185
  if (e.lang) {
1190
1186
  const c = t.enter(`codeFencedLang${a}`);
@@ -1213,10 +1209,10 @@ function Cn(e, r, t, n) {
1213
1209
  `), o && (f += u.move(o + `
1214
1210
  `)), f += u.move(l), s(), f;
1215
1211
  }
1216
- function vn(e, r, t) {
1212
+ function An(e, r, t) {
1217
1213
  return (t ? "" : " ") + e;
1218
1214
  }
1219
- function Me(e) {
1215
+ function De(e) {
1220
1216
  const r = e.options.quote || '"';
1221
1217
  if (r !== '"' && r !== "'")
1222
1218
  throw new Error(
@@ -1224,8 +1220,8 @@ function Me(e) {
1224
1220
  );
1225
1221
  return r;
1226
1222
  }
1227
- function Tn(e, r, t, n) {
1228
- const i = Me(t), o = i === '"' ? "Quote" : "Apostrophe", a = t.enter("definition");
1223
+ function In(e, r, t, n) {
1224
+ const i = De(t), o = i === '"' ? "Quote" : "Apostrophe", a = t.enter("definition");
1229
1225
  let u = t.enter("label");
1230
1226
  const l = t.createTracker(n);
1231
1227
  let s = l.move("[");
@@ -1254,7 +1250,7 @@ function Tn(e, r, t, n) {
1254
1250
  })
1255
1251
  ), s += l.move(i), u()), a(), s;
1256
1252
  }
1257
- function In(e) {
1253
+ function Nn(e) {
1258
1254
  const r = e.options.emphasis || "*";
1259
1255
  if (r !== "*" && r !== "_")
1260
1256
  throw new Error(
@@ -1262,17 +1258,17 @@ function In(e) {
1262
1258
  );
1263
1259
  return r;
1264
1260
  }
1265
- function ae(e) {
1261
+ function ne(e) {
1266
1262
  return "&#x" + e.toString(16).toUpperCase() + ";";
1267
1263
  }
1268
- function se(e) {
1269
- if (e === null || M(e) || q(e))
1264
+ function de(e) {
1265
+ if (e === null || D(e) || H(e))
1270
1266
  return 1;
1271
- if (fe(e))
1267
+ if (he(e))
1272
1268
  return 2;
1273
1269
  }
1274
- function de(e, r, t) {
1275
- const n = se(e), i = se(r);
1270
+ function fe(e, r, t) {
1271
+ const n = de(e), i = de(r);
1276
1272
  return n === void 0 ? i === void 0 ? (
1277
1273
  // Letter inside:
1278
1274
  // we have to encode *both* letters for `_` as it is looser.
@@ -1304,9 +1300,9 @@ function de(e, r, t) {
1304
1300
  { inside: !1, outside: !1 }
1305
1301
  );
1306
1302
  }
1307
- ft.peek = An;
1308
- function ft(e, r, t, n) {
1309
- const i = In(t), o = t.enter("emphasis"), a = t.createTracker(n), u = a.move(i);
1303
+ mt.peek = Sn;
1304
+ function mt(e, r, t, n) {
1305
+ const i = Nn(t), o = t.enter("emphasis"), a = t.createTracker(n), u = a.move(i);
1310
1306
  let l = a.move(
1311
1307
  t.containerPhrasing(e, {
1312
1308
  after: i,
@@ -1314,67 +1310,67 @@ function ft(e, r, t, n) {
1314
1310
  ...a.current()
1315
1311
  })
1316
1312
  );
1317
- const s = l.charCodeAt(0), f = de(
1313
+ const s = l.charCodeAt(0), f = fe(
1318
1314
  n.before.charCodeAt(n.before.length - 1),
1319
1315
  s,
1320
1316
  i
1321
1317
  );
1322
- f.inside && (l = ae(s) + l.slice(1));
1323
- const c = l.charCodeAt(l.length - 1), p = de(n.after.charCodeAt(0), c, i);
1324
- p.inside && (l = l.slice(0, -1) + ae(c));
1318
+ f.inside && (l = ne(s) + l.slice(1));
1319
+ const c = l.charCodeAt(l.length - 1), p = fe(n.after.charCodeAt(0), c, i);
1320
+ p.inside && (l = l.slice(0, -1) + ne(c));
1325
1321
  const g = a.move(i);
1326
1322
  return o(), t.attentionEncodeSurroundingInfo = {
1327
1323
  after: p.outside,
1328
1324
  before: f.outside
1329
1325
  }, u + l + g;
1330
1326
  }
1331
- function An(e, r, t) {
1327
+ function Sn(e, r, t) {
1332
1328
  return t.options.emphasis || "*";
1333
1329
  }
1334
- function Nn(e, r, t, n) {
1330
+ function Ln(e, r, t, n) {
1335
1331
  let i, o, a;
1336
- typeof r == "function" && typeof t != "function" ? (o = void 0, a = r, i = t) : (o = r, a = t, i = n), lt(e, o, u, i);
1332
+ typeof r == "function" && typeof t != "function" ? (o = void 0, a = r, i = t) : (o = r, a = t, i = n), ct(e, o, u, i);
1337
1333
  function u(l, s) {
1338
1334
  const f = s[s.length - 1], c = f ? f.children.indexOf(l) : void 0;
1339
1335
  return a(l, c, f);
1340
1336
  }
1341
1337
  }
1342
- const Sn = {};
1343
- function ht(e, r) {
1344
- const t = Sn, n = typeof t.includeImageAlt == "boolean" ? t.includeImageAlt : !0, i = typeof t.includeHtml == "boolean" ? t.includeHtml : !0;
1345
- return mt(e, n, i);
1338
+ const Mn = {};
1339
+ function pt(e, r) {
1340
+ const t = Mn, n = typeof t.includeImageAlt == "boolean" ? t.includeImageAlt : !0, i = typeof t.includeHtml == "boolean" ? t.includeHtml : !0;
1341
+ return gt(e, n, i);
1346
1342
  }
1347
- function mt(e, r, t) {
1348
- if (Ln(e)) {
1343
+ function gt(e, r, t) {
1344
+ if (Dn(e)) {
1349
1345
  if ("value" in e)
1350
1346
  return e.type === "html" && !t ? "" : e.value;
1351
1347
  if (r && "alt" in e && e.alt)
1352
1348
  return e.alt;
1353
1349
  if ("children" in e)
1354
- return He(e.children, r, t);
1350
+ return Ke(e.children, r, t);
1355
1351
  }
1356
- return Array.isArray(e) ? He(e, r, t) : "";
1352
+ return Array.isArray(e) ? Ke(e, r, t) : "";
1357
1353
  }
1358
- function He(e, r, t) {
1354
+ function Ke(e, r, t) {
1359
1355
  const n = [];
1360
1356
  let i = -1;
1361
1357
  for (; ++i < e.length; )
1362
- n[i] = mt(e[i], r, t);
1358
+ n[i] = gt(e[i], r, t);
1363
1359
  return n.join("");
1364
1360
  }
1365
- function Ln(e) {
1361
+ function Dn(e) {
1366
1362
  return !!(e && typeof e == "object");
1367
1363
  }
1368
- function Mn(e, r) {
1364
+ function Pn(e, r) {
1369
1365
  let t = !1;
1370
- return Nn(e, function(n) {
1366
+ return Ln(e, function(n) {
1371
1367
  if ("value" in n && /\r?\n|\r/.test(n.value) || n.type === "break")
1372
- return t = !0, Ne;
1373
- }), !!((!e.depth || e.depth < 3) && ht(e) && (r.options.setext || t));
1368
+ return t = !0, Se;
1369
+ }), !!((!e.depth || e.depth < 3) && pt(e) && (r.options.setext || t));
1374
1370
  }
1375
- function Dn(e, r, t, n) {
1371
+ function Rn(e, r, t, n) {
1376
1372
  const i = Math.max(Math.min(6, e.depth || 1), 1), o = t.createTracker(n);
1377
- if (Mn(e, t)) {
1373
+ if (Pn(e, t)) {
1378
1374
  const f = t.enter("headingSetext"), c = t.enter("phrasing"), p = t.containerPhrasing(e, {
1379
1375
  ...o.current(),
1380
1376
  before: `
@@ -1399,18 +1395,18 @@ function Dn(e, r, t, n) {
1399
1395
  `,
1400
1396
  ...o.current()
1401
1397
  });
1402
- return /^[\t ]/.test(s) && (s = ae(s.charCodeAt(0)) + s.slice(1)), s = s ? a + " " + s : a, t.options.closeAtx && (s += " " + a), l(), u(), s;
1398
+ return /^[\t ]/.test(s) && (s = ne(s.charCodeAt(0)) + s.slice(1)), s = s ? a + " " + s : a, t.options.closeAtx && (s += " " + a), l(), u(), s;
1403
1399
  }
1404
- pt.peek = Pn;
1405
- function pt(e) {
1400
+ bt.peek = En;
1401
+ function bt(e) {
1406
1402
  return e.value || "";
1407
1403
  }
1408
- function Pn() {
1404
+ function En() {
1409
1405
  return "<";
1410
1406
  }
1411
- gt.peek = Rn;
1412
- function gt(e, r, t, n) {
1413
- const i = Me(t), o = i === '"' ? "Quote" : "Apostrophe", a = t.enter("image");
1407
+ kt.peek = _n;
1408
+ function kt(e, r, t, n) {
1409
+ const i = De(t), o = i === '"' ? "Quote" : "Apostrophe", a = t.enter("image");
1414
1410
  let u = t.enter("label");
1415
1411
  const l = t.createTracker(n);
1416
1412
  let s = l.move("![");
@@ -1434,11 +1430,11 @@ function gt(e, r, t, n) {
1434
1430
  })
1435
1431
  ), s += l.move(i), u()), s += l.move(")"), a(), s;
1436
1432
  }
1437
- function Rn() {
1433
+ function _n() {
1438
1434
  return "!";
1439
1435
  }
1440
- bt.peek = En;
1441
- function bt(e, r, t, n) {
1436
+ xt.peek = Fn;
1437
+ function xt(e, r, t, n) {
1442
1438
  const i = e.referenceType, o = t.enter("imageReference");
1443
1439
  let a = t.enter("label");
1444
1440
  const u = t.createTracker(n);
@@ -1458,11 +1454,11 @@ function bt(e, r, t, n) {
1458
1454
  });
1459
1455
  return a(), t.stack = f, o(), i === "full" || !s || s !== c ? l += u.move(c + "]") : i === "shortcut" ? l = l.slice(0, -1) : l += u.move("]"), l;
1460
1456
  }
1461
- function En() {
1457
+ function Fn() {
1462
1458
  return "!";
1463
1459
  }
1464
- kt.peek = _n;
1465
- function kt(e, r, t) {
1460
+ wt.peek = zn;
1461
+ function wt(e, r, t) {
1466
1462
  let n = e.value || "", i = "`", o = -1;
1467
1463
  for (; new RegExp("(^|[^`])" + i + "([^`]|$)").test(n); )
1468
1464
  i += "`";
@@ -1477,11 +1473,11 @@ function kt(e, r, t) {
1477
1473
  }
1478
1474
  return i + n + i;
1479
1475
  }
1480
- function _n() {
1476
+ function zn() {
1481
1477
  return "`";
1482
1478
  }
1483
- function xt(e, r) {
1484
- const t = ht(e);
1479
+ function yt(e, r) {
1480
+ const t = pt(e);
1485
1481
  return !!(!r.options.resourceLink && // If there’s a url…
1486
1482
  e.url && // And there’s a no title…
1487
1483
  !e.title && // And the content of `node` is a single text node…
@@ -1491,11 +1487,11 @@ function xt(e, r) {
1491
1487
  // references don’t work), space, or angle brackets…
1492
1488
  !/[\0- <>\u007F]/.test(e.url));
1493
1489
  }
1494
- wt.peek = Fn;
1495
- function wt(e, r, t, n) {
1496
- const i = Me(t), o = i === '"' ? "Quote" : "Apostrophe", a = t.createTracker(n);
1490
+ Ct.peek = jn;
1491
+ function Ct(e, r, t, n) {
1492
+ const i = De(t), o = i === '"' ? "Quote" : "Apostrophe", a = t.createTracker(n);
1497
1493
  let u, l;
1498
- if (xt(e, t)) {
1494
+ if (yt(e, t)) {
1499
1495
  const f = t.stack;
1500
1496
  t.stack = [], u = t.enter("autolink");
1501
1497
  let c = a.move("<");
@@ -1533,11 +1529,11 @@ function wt(e, r, t, n) {
1533
1529
  })
1534
1530
  ), s += a.move(i), l()), s += a.move(")"), u(), s;
1535
1531
  }
1536
- function Fn(e, r, t) {
1537
- return xt(e, t) ? "<" : "[";
1532
+ function jn(e, r, t) {
1533
+ return yt(e, t) ? "<" : "[";
1538
1534
  }
1539
- yt.peek = zn;
1540
- function yt(e, r, t, n) {
1535
+ vt.peek = $n;
1536
+ function vt(e, r, t, n) {
1541
1537
  const i = e.referenceType, o = t.enter("linkReference");
1542
1538
  let a = t.enter("label");
1543
1539
  const u = t.createTracker(n);
@@ -1557,10 +1553,10 @@ function yt(e, r, t, n) {
1557
1553
  });
1558
1554
  return a(), t.stack = f, o(), i === "full" || !s || s !== c ? l += u.move(c + "]") : i === "shortcut" ? l = l.slice(0, -1) : l += u.move("]"), l;
1559
1555
  }
1560
- function zn() {
1556
+ function $n() {
1561
1557
  return "[";
1562
1558
  }
1563
- function De(e) {
1559
+ function Pe(e) {
1564
1560
  const r = e.options.bullet || "*";
1565
1561
  if (r !== "*" && r !== "+" && r !== "-")
1566
1562
  throw new Error(
@@ -1568,8 +1564,8 @@ function De(e) {
1568
1564
  );
1569
1565
  return r;
1570
1566
  }
1571
- function jn(e) {
1572
- const r = De(e), t = e.options.bulletOther;
1567
+ function On(e) {
1568
+ const r = Pe(e), t = e.options.bulletOther;
1573
1569
  if (!t)
1574
1570
  return r === "*" ? "-" : "*";
1575
1571
  if (t !== "*" && t !== "+" && t !== "-")
@@ -1582,7 +1578,7 @@ function jn(e) {
1582
1578
  );
1583
1579
  return t;
1584
1580
  }
1585
- function $n(e) {
1581
+ function Un(e) {
1586
1582
  const r = e.options.bulletOrdered || ".";
1587
1583
  if (r !== "." && r !== ")")
1588
1584
  throw new Error(
@@ -1590,7 +1586,7 @@ function $n(e) {
1590
1586
  );
1591
1587
  return r;
1592
1588
  }
1593
- function Ct(e) {
1589
+ function Tt(e) {
1594
1590
  const r = e.options.rule || "*";
1595
1591
  if (r !== "*" && r !== "-" && r !== "_")
1596
1592
  throw new Error(
@@ -1598,10 +1594,10 @@ function Ct(e) {
1598
1594
  );
1599
1595
  return r;
1600
1596
  }
1601
- function On(e, r, t, n) {
1597
+ function Bn(e, r, t, n) {
1602
1598
  const i = t.enter("list"), o = t.bulletCurrent;
1603
- let a = e.ordered ? $n(t) : De(t);
1604
- const u = e.ordered ? a === "." ? ")" : "." : jn(t);
1599
+ let a = e.ordered ? Un(t) : Pe(t);
1600
+ const u = e.ordered ? a === "." ? ")" : "." : On(t);
1605
1601
  let l = r && t.bulletLastUsed ? a === t.bulletLastUsed : !1;
1606
1602
  if (!e.ordered) {
1607
1603
  const f = e.children ? e.children[0] : void 0;
@@ -1610,7 +1606,7 @@ function On(e, r, t, n) {
1610
1606
  (a === "*" || a === "-") && // Empty first list item:
1611
1607
  f && (!f.children || !f.children[0]) && // Directly in two other list items:
1612
1608
  t.stack[t.stack.length - 1] === "list" && t.stack[t.stack.length - 2] === "listItem" && t.stack[t.stack.length - 3] === "list" && t.stack[t.stack.length - 4] === "listItem" && // That are each the first child.
1613
- t.indexStack[t.indexStack.length - 1] === 0 && t.indexStack[t.indexStack.length - 2] === 0 && t.indexStack[t.indexStack.length - 3] === 0 && (l = !0), Ct(t) === a && f
1609
+ t.indexStack[t.indexStack.length - 1] === 0 && t.indexStack[t.indexStack.length - 2] === 0 && t.indexStack[t.indexStack.length - 3] === 0 && (l = !0), Tt(t) === a && f
1614
1610
  ) {
1615
1611
  let c = -1;
1616
1612
  for (; ++c < e.children.length; ) {
@@ -1626,7 +1622,7 @@ function On(e, r, t, n) {
1626
1622
  const s = t.containerFlow(e, n);
1627
1623
  return t.bulletLastUsed = a, t.bulletCurrent = o, i(), s;
1628
1624
  }
1629
- function Un(e) {
1625
+ function Wn(e) {
1630
1626
  const r = e.options.listItemIndent || "one";
1631
1627
  if (r !== "tab" && r !== "one" && r !== "mixed")
1632
1628
  throw new Error(
@@ -1634,9 +1630,9 @@ function Un(e) {
1634
1630
  );
1635
1631
  return r;
1636
1632
  }
1637
- function Bn(e, r, t, n) {
1638
- const i = Un(t);
1639
- let o = t.bulletCurrent || De(t);
1633
+ function Hn(e, r, t, n) {
1634
+ const i = Wn(t);
1635
+ let o = t.bulletCurrent || Pe(t);
1640
1636
  r && r.type === "list" && r.ordered && (o = (typeof r.start == "number" && r.start > -1 ? r.start : 1) + (t.options.incrementListMarker === !1 ? 0 : r.children.indexOf(e)) + o);
1641
1637
  let a = o.length + 1;
1642
1638
  (i === "tab" || i === "mixed" && (r && r.type === "list" && r.spread || e.spread)) && (a = Math.ceil(a / 4) * 4);
@@ -1651,13 +1647,13 @@ function Bn(e, r, t, n) {
1651
1647
  return p ? (g ? "" : " ".repeat(a)) + c : (g ? o : o + " ".repeat(a - o.length)) + c;
1652
1648
  }
1653
1649
  }
1654
- function Wn(e, r, t, n) {
1650
+ function qn(e, r, t, n) {
1655
1651
  const i = t.enter("paragraph"), o = t.enter("phrasing"), a = t.containerPhrasing(e, n);
1656
1652
  return o(), i(), a;
1657
1653
  }
1658
- const Hn = (
1654
+ const Kn = (
1659
1655
  /** @type {(node?: unknown) => node is Exclude<PhrasingContent, Html>} */
1660
- me([
1656
+ pe([
1661
1657
  "break",
1662
1658
  "delete",
1663
1659
  "emphasis",
@@ -1681,12 +1677,12 @@ const Hn = (
1681
1677
  "textDirective"
1682
1678
  ])
1683
1679
  );
1684
- function qn(e, r, t, n) {
1680
+ function Vn(e, r, t, n) {
1685
1681
  return (e.children.some(function(a) {
1686
- return Hn(a);
1682
+ return Kn(a);
1687
1683
  }) ? t.containerPhrasing : t.containerFlow).call(t, e, n);
1688
1684
  }
1689
- function Kn(e) {
1685
+ function Gn(e) {
1690
1686
  const r = e.options.strong || "*";
1691
1687
  if (r !== "*" && r !== "_")
1692
1688
  throw new Error(
@@ -1694,9 +1690,9 @@ function Kn(e) {
1694
1690
  );
1695
1691
  return r;
1696
1692
  }
1697
- vt.peek = Vn;
1698
- function vt(e, r, t, n) {
1699
- const i = Kn(t), o = t.enter("strong"), a = t.createTracker(n), u = a.move(i + i);
1693
+ At.peek = Zn;
1694
+ function At(e, r, t, n) {
1695
+ const i = Gn(t), o = t.enter("strong"), a = t.createTracker(n), u = a.move(i + i);
1700
1696
  let l = a.move(
1701
1697
  t.containerPhrasing(e, {
1702
1698
  after: i,
@@ -1704,27 +1700,27 @@ function vt(e, r, t, n) {
1704
1700
  ...a.current()
1705
1701
  })
1706
1702
  );
1707
- const s = l.charCodeAt(0), f = de(
1703
+ const s = l.charCodeAt(0), f = fe(
1708
1704
  n.before.charCodeAt(n.before.length - 1),
1709
1705
  s,
1710
1706
  i
1711
1707
  );
1712
- f.inside && (l = ae(s) + l.slice(1));
1713
- const c = l.charCodeAt(l.length - 1), p = de(n.after.charCodeAt(0), c, i);
1714
- p.inside && (l = l.slice(0, -1) + ae(c));
1708
+ f.inside && (l = ne(s) + l.slice(1));
1709
+ const c = l.charCodeAt(l.length - 1), p = fe(n.after.charCodeAt(0), c, i);
1710
+ p.inside && (l = l.slice(0, -1) + ne(c));
1715
1711
  const g = a.move(i + i);
1716
1712
  return o(), t.attentionEncodeSurroundingInfo = {
1717
1713
  after: p.outside,
1718
1714
  before: f.outside
1719
1715
  }, u + l + g;
1720
1716
  }
1721
- function Vn(e, r, t) {
1717
+ function Zn(e, r, t) {
1722
1718
  return t.options.strong || "*";
1723
1719
  }
1724
- function Xn(e, r, t, n) {
1720
+ function Jn(e, r, t, n) {
1725
1721
  return t.safe(e.value, n);
1726
1722
  }
1727
- function Gn(e) {
1723
+ function Qn(e) {
1728
1724
  const r = e.options.ruleRepetition || 3;
1729
1725
  if (r < 3)
1730
1726
  throw new Error(
@@ -1732,50 +1728,50 @@ function Gn(e) {
1732
1728
  );
1733
1729
  return r;
1734
1730
  }
1735
- function Zn(e, r, t) {
1736
- const n = (Ct(t) + (t.options.ruleSpaces ? " " : "")).repeat(Gn(t));
1731
+ function Xn(e, r, t) {
1732
+ const n = (Tt(t) + (t.options.ruleSpaces ? " " : "")).repeat(Qn(t));
1737
1733
  return t.options.ruleSpaces ? n.slice(0, -1) : n;
1738
1734
  }
1739
- const Tt = {
1740
- blockquote: gn,
1741
- break: We,
1742
- code: Cn,
1743
- definition: Tn,
1744
- emphasis: ft,
1745
- hardBreak: We,
1746
- heading: Dn,
1747
- html: pt,
1748
- image: gt,
1749
- imageReference: bt,
1750
- inlineCode: kt,
1751
- link: wt,
1752
- linkReference: yt,
1753
- list: On,
1754
- listItem: Bn,
1755
- paragraph: Wn,
1756
- root: qn,
1757
- strong: vt,
1758
- text: Xn,
1759
- thematicBreak: Zn
1735
+ const It = {
1736
+ blockquote: kn,
1737
+ break: qe,
1738
+ code: Tn,
1739
+ definition: In,
1740
+ emphasis: mt,
1741
+ hardBreak: qe,
1742
+ heading: Rn,
1743
+ html: bt,
1744
+ image: kt,
1745
+ imageReference: xt,
1746
+ inlineCode: wt,
1747
+ link: Ct,
1748
+ linkReference: vt,
1749
+ list: Bn,
1750
+ listItem: Hn,
1751
+ paragraph: qn,
1752
+ root: Vn,
1753
+ strong: At,
1754
+ text: Jn,
1755
+ thematicBreak: Xn
1760
1756
  };
1761
- function Jn() {
1757
+ function Yn() {
1762
1758
  return {
1763
1759
  enter: {
1764
- table: Qn,
1765
- tableData: qe,
1766
- tableHeader: qe,
1767
- tableRow: ea
1760
+ table: ea,
1761
+ tableData: Ve,
1762
+ tableHeader: Ve,
1763
+ tableRow: ra
1768
1764
  },
1769
1765
  exit: {
1770
- codeText: ta,
1771
- table: Yn,
1772
- tableData: ve,
1773
- tableHeader: ve,
1774
- tableRow: ve
1766
+ codeText: na,
1767
+ table: ta,
1768
+ tableData: Te,
1769
+ tableHeader: Te,
1770
+ tableRow: Te
1775
1771
  }
1776
1772
  };
1777
1773
  }
1778
- function Qn(e) {
1774
+ function ea(e) {
1779
1775
  const r = e._align;
1780
1776
  this.enter(
1781
1777
  {
@@ -1788,28 +1784,28 @@ function Qn(e) {
1788
1784
  e
1789
1785
  ), this.data.inTable = !0;
1790
1786
  }
1791
- function Yn(e) {
1787
+ function ta(e) {
1792
1788
  this.exit(e), this.data.inTable = void 0;
1793
1789
  }
1794
- function ea(e) {
1790
+ function ra(e) {
1795
1791
  this.enter({ type: "tableRow", children: [] }, e);
1796
1792
  }
1797
- function ve(e) {
1793
+ function Te(e) {
1798
1794
  this.exit(e);
1799
1795
  }
1800
- function qe(e) {
1796
+ function Ve(e) {
1801
1797
  this.enter({ type: "tableCell", children: [] }, e);
1802
1798
  }
1803
- function ta(e) {
1799
+ function na(e) {
1804
1800
  let r = this.resume();
1805
- this.data.inTable && (r = r.replace(/\\([\\|])/g, ra));
1801
+ this.data.inTable && (r = r.replace(/\\([\\|])/g, aa));
1806
1802
  const t = this.stack[this.stack.length - 1];
1807
1803
  t.type, t.value = r, this.exit(e);
1808
1804
  }
1809
- function ra(e, r) {
1805
+ function aa(e, r) {
1810
1806
  return r === "|" ? r : e;
1811
1807
  }
1812
- function na(e) {
1808
+ function ia(e) {
1813
1809
  const r = e || {}, t = r.tableCellPadding, n = r.tablePipeAlign, i = r.stringLength, o = t ? " " : "|";
1814
1810
  return {
1815
1811
  unsafe: [
@@ -1838,15 +1834,15 @@ function na(e) {
1838
1834
  tableRow: u
1839
1835
  }
1840
1836
  };
1841
- function a(g, d, k, b) {
1837
+ function a(g, h, k, b) {
1842
1838
  return s(f(g, k, b), g.align);
1843
1839
  }
1844
- function u(g, d, k, b) {
1840
+ function u(g, h, k, b) {
1845
1841
  const x = c(g, k, b), w = s([x]);
1846
1842
  return w.slice(0, w.indexOf(`
1847
1843
  `));
1848
1844
  }
1849
- function l(g, d, k, b) {
1845
+ function l(g, h, k, b) {
1850
1846
  const x = k.enter("tableCell"), w = k.enter("phrasing"), y = k.containerPhrasing(g, {
1851
1847
  ...b,
1852
1848
  before: o,
@@ -1854,9 +1850,9 @@ function na(e) {
1854
1850
  });
1855
1851
  return w(), x(), y;
1856
1852
  }
1857
- function s(g, d) {
1858
- return mn(g, {
1859
- align: d,
1853
+ function s(g, h) {
1854
+ return gn(g, {
1855
+ align: h,
1860
1856
  // @ts-expect-error: `markdown-table` types should support `null`.
1861
1857
  alignDelimiters: n,
1862
1858
  // @ts-expect-error: `markdown-table` types should support `null`.
@@ -1865,47 +1861,47 @@ function na(e) {
1865
1861
  stringLength: i
1866
1862
  });
1867
1863
  }
1868
- function f(g, d, k) {
1864
+ function f(g, h, k) {
1869
1865
  const b = g.children;
1870
1866
  let x = -1;
1871
- const w = [], y = d.enter("table");
1867
+ const w = [], y = h.enter("table");
1872
1868
  for (; ++x < b.length; )
1873
- w[x] = c(b[x], d, k);
1869
+ w[x] = c(b[x], h, k);
1874
1870
  return y(), w;
1875
1871
  }
1876
- function c(g, d, k) {
1872
+ function c(g, h, k) {
1877
1873
  const b = g.children;
1878
1874
  let x = -1;
1879
- const w = [], y = d.enter("tableRow");
1875
+ const w = [], y = h.enter("tableRow");
1880
1876
  for (; ++x < b.length; )
1881
- w[x] = l(b[x], g, d, k);
1877
+ w[x] = l(b[x], g, h, k);
1882
1878
  return y(), w;
1883
1879
  }
1884
- function p(g, d, k) {
1885
- let b = Tt.inlineCode(g, d, k);
1880
+ function p(g, h, k) {
1881
+ let b = It.inlineCode(g, h, k);
1886
1882
  return k.stack.includes("tableCell") && (b = b.replace(/\|/g, "\\$&")), b;
1887
1883
  }
1888
1884
  }
1889
- function aa() {
1885
+ function oa() {
1890
1886
  return {
1891
1887
  exit: {
1892
- taskListCheckValueChecked: Ke,
1893
- taskListCheckValueUnchecked: Ke,
1894
- paragraph: oa
1888
+ taskListCheckValueChecked: Ge,
1889
+ taskListCheckValueUnchecked: Ge,
1890
+ paragraph: ua
1895
1891
  }
1896
1892
  };
1897
1893
  }
1898
- function ia() {
1894
+ function la() {
1899
1895
  return {
1900
1896
  unsafe: [{ atBreak: !0, character: "-", after: "[:|-]" }],
1901
- handlers: { listItem: la }
1897
+ handlers: { listItem: ca }
1902
1898
  };
1903
1899
  }
1904
- function Ke(e) {
1900
+ function Ge(e) {
1905
1901
  const r = this.stack[this.stack.length - 2];
1906
1902
  r.type, r.checked = e.type === "taskListCheckValueChecked";
1907
1903
  }
1908
- function oa(e) {
1904
+ function ua(e) {
1909
1905
  const r = this.stack[this.stack.length - 2];
1910
1906
  if (r && r.type === "listItem" && typeof r.checked == "boolean") {
1911
1907
  const t = this.stack[this.stack.length - 1];
@@ -1926,10 +1922,10 @@ function oa(e) {
1926
1922
  }
1927
1923
  this.exit(e);
1928
1924
  }
1929
- function la(e, r, t, n) {
1925
+ function ca(e, r, t, n) {
1930
1926
  const i = e.children[0], o = typeof e.checked == "boolean" && i && i.type === "paragraph", a = "[" + (e.checked ? "x" : " ") + "] ", u = t.createTracker(n);
1931
1927
  o && u.move(a);
1932
- let l = Tt.listItem(e, r, t, {
1928
+ let l = It.listItem(e, r, t, {
1933
1929
  ...n,
1934
1930
  ...u.current()
1935
1931
  });
@@ -1938,27 +1934,27 @@ function la(e, r, t, n) {
1938
1934
  return f + a;
1939
1935
  }
1940
1936
  }
1941
- function ua() {
1937
+ function sa() {
1942
1938
  return [
1943
- Fr(),
1944
- nn(),
1945
- un(),
1946
- Jn(),
1947
- aa()
1939
+ jr(),
1940
+ on(),
1941
+ sn(),
1942
+ Yn(),
1943
+ oa()
1948
1944
  ];
1949
1945
  }
1950
- function ca(e) {
1946
+ function da(e) {
1951
1947
  return {
1952
1948
  extensions: [
1953
- zr(),
1954
- an(e),
1955
- cn(),
1956
- na(e),
1957
- ia()
1949
+ $r(),
1950
+ ln(e),
1951
+ dn(),
1952
+ ia(e),
1953
+ la()
1958
1954
  ]
1959
1955
  };
1960
1956
  }
1961
- function ue(e, r, t, n) {
1957
+ function ce(e, r, t, n) {
1962
1958
  const i = e.length;
1963
1959
  let o = 0, a;
1964
1960
  if (r < 0 ? r = -r > i ? 0 : i + r : r = r > i ? i : r, t = t > 0 ? t : 0, n.length < 1e4)
@@ -1967,24 +1963,24 @@ function ue(e, r, t, n) {
1967
1963
  for (t && e.splice(r, t); o < n.length; )
1968
1964
  a = n.slice(o, o + 1e4), a.unshift(r, 0), e.splice(...a), o += 1e4, r += 1e4;
1969
1965
  }
1970
- const Ve = {}.hasOwnProperty;
1971
- function sa(e) {
1966
+ const Ze = {}.hasOwnProperty;
1967
+ function fa(e) {
1972
1968
  const r = {};
1973
1969
  let t = -1;
1974
1970
  for (; ++t < e.length; )
1975
- da(r, e[t]);
1971
+ ha(r, e[t]);
1976
1972
  return r;
1977
1973
  }
1978
- function da(e, r) {
1974
+ function ha(e, r) {
1979
1975
  let t;
1980
1976
  for (t in r) {
1981
- const i = (Ve.call(e, t) ? e[t] : void 0) || (e[t] = {}), o = r[t];
1977
+ const i = (Ze.call(e, t) ? e[t] : void 0) || (e[t] = {}), o = r[t];
1982
1978
  let a;
1983
1979
  if (o)
1984
1980
  for (a in o) {
1985
- Ve.call(i, a) || (i[a] = []);
1981
+ Ze.call(i, a) || (i[a] = []);
1986
1982
  const u = o[a];
1987
- fa(
1983
+ ma(
1988
1984
  // @ts-expect-error Looks like a list.
1989
1985
  i[a],
1990
1986
  Array.isArray(u) ? u : u ? [u] : []
@@ -1992,96 +1988,96 @@ function da(e, r) {
1992
1988
  }
1993
1989
  }
1994
1990
  }
1995
- function fa(e, r) {
1991
+ function ma(e, r) {
1996
1992
  let t = -1;
1997
1993
  const n = [];
1998
1994
  for (; ++t < r.length; )
1999
1995
  (r[t].add === "after" ? e : n).push(r[t]);
2000
- ue(e, 0, 0, n);
1996
+ ce(e, 0, 0, n);
2001
1997
  }
2002
- const ha = {
2003
- tokenize: xa,
2004
- partial: !0
2005
- }, It = {
2006
- tokenize: wa,
2007
- partial: !0
2008
- }, At = {
1998
+ const pa = {
2009
1999
  tokenize: ya,
2010
2000
  partial: !0
2011
2001
  }, Nt = {
2012
2002
  tokenize: Ca,
2013
2003
  partial: !0
2014
- }, ma = {
2004
+ }, St = {
2015
2005
  tokenize: va,
2016
2006
  partial: !0
2017
- }, St = {
2018
- name: "wwwAutolink",
2019
- tokenize: ba,
2020
- previous: Mt
2021
2007
  }, Lt = {
2008
+ tokenize: Ta,
2009
+ partial: !0
2010
+ }, ga = {
2011
+ tokenize: Aa,
2012
+ partial: !0
2013
+ }, Mt = {
2014
+ name: "wwwAutolink",
2015
+ tokenize: xa,
2016
+ previous: Pt
2017
+ }, Dt = {
2022
2018
  name: "protocolAutolink",
2023
- tokenize: ka,
2024
- previous: Dt
2025
- }, j = {
2019
+ tokenize: wa,
2020
+ previous: Rt
2021
+ }, $ = {
2026
2022
  name: "emailAutolink",
2027
- tokenize: ga,
2028
- previous: Pt
2023
+ tokenize: ka,
2024
+ previous: Et
2029
2025
  }, R = {};
2030
- function pa() {
2026
+ function ba() {
2031
2027
  return {
2032
2028
  text: R
2033
2029
  };
2034
2030
  }
2035
- let B = 48;
2036
- for (; B < 123; )
2037
- R[B] = j, B++, B === 58 ? B = 65 : B === 91 && (B = 97);
2038
- R[43] = j;
2039
- R[45] = j;
2040
- R[46] = j;
2041
- R[95] = j;
2042
- R[72] = [j, Lt];
2043
- R[104] = [j, Lt];
2044
- R[87] = [j, St];
2045
- R[119] = [j, St];
2046
- function ga(e, r, t) {
2031
+ let U = 48;
2032
+ for (; U < 123; )
2033
+ R[U] = $, U++, U === 58 ? U = 65 : U === 91 && (U = 97);
2034
+ R[43] = $;
2035
+ R[45] = $;
2036
+ R[46] = $;
2037
+ R[95] = $;
2038
+ R[72] = [$, Dt];
2039
+ R[104] = [$, Dt];
2040
+ R[87] = [$, Mt];
2041
+ R[119] = [$, Mt];
2042
+ function ka(e, r, t) {
2047
2043
  const n = this;
2048
2044
  let i, o;
2049
2045
  return a;
2050
2046
  function a(c) {
2051
- return !Se(c) || !Pt.call(n, n.previous) || Pe(n.events) ? t(c) : (e.enter("literalAutolink"), e.enter("literalAutolinkEmail"), u(c));
2047
+ return !Le(c) || !Et.call(n, n.previous) || Re(n.events) ? t(c) : (e.enter("literalAutolink"), e.enter("literalAutolinkEmail"), u(c));
2052
2048
  }
2053
2049
  function u(c) {
2054
- return Se(c) ? (e.consume(c), u) : c === 64 ? (e.consume(c), l) : t(c);
2050
+ return Le(c) ? (e.consume(c), u) : c === 64 ? (e.consume(c), l) : t(c);
2055
2051
  }
2056
2052
  function l(c) {
2057
- return c === 46 ? e.check(ma, f, s)(c) : c === 45 || c === 95 || Le(c) ? (o = !0, e.consume(c), l) : f(c);
2053
+ return c === 46 ? e.check(ga, f, s)(c) : c === 45 || c === 95 || Me(c) ? (o = !0, e.consume(c), l) : f(c);
2058
2054
  }
2059
2055
  function s(c) {
2060
2056
  return e.consume(c), i = !0, l;
2061
2057
  }
2062
2058
  function f(c) {
2063
- return o && i && ne(n.previous) ? (e.exit("literalAutolinkEmail"), e.exit("literalAutolink"), r(c)) : t(c);
2059
+ return o && i && re(n.previous) ? (e.exit("literalAutolinkEmail"), e.exit("literalAutolink"), r(c)) : t(c);
2064
2060
  }
2065
2061
  }
2066
- function ba(e, r, t) {
2062
+ function xa(e, r, t) {
2067
2063
  const n = this;
2068
2064
  return i;
2069
2065
  function i(a) {
2070
- return a !== 87 && a !== 119 || !Mt.call(n, n.previous) || Pe(n.events) ? t(a) : (e.enter("literalAutolink"), e.enter("literalAutolinkWww"), e.check(ha, e.attempt(It, e.attempt(At, o), t), t)(a));
2066
+ return a !== 87 && a !== 119 || !Pt.call(n, n.previous) || Re(n.events) ? t(a) : (e.enter("literalAutolink"), e.enter("literalAutolinkWww"), e.check(pa, e.attempt(Nt, e.attempt(St, o), t), t)(a));
2071
2067
  }
2072
2068
  function o(a) {
2073
2069
  return e.exit("literalAutolinkWww"), e.exit("literalAutolink"), r(a);
2074
2070
  }
2075
2071
  }
2076
- function ka(e, r, t) {
2072
+ function wa(e, r, t) {
2077
2073
  const n = this;
2078
2074
  let i = "", o = !1;
2079
2075
  return a;
2080
2076
  function a(c) {
2081
- return (c === 72 || c === 104) && Dt.call(n, n.previous) && !Pe(n.events) ? (e.enter("literalAutolink"), e.enter("literalAutolinkHttp"), i += String.fromCodePoint(c), e.consume(c), u) : t(c);
2077
+ return (c === 72 || c === 104) && Rt.call(n, n.previous) && !Re(n.events) ? (e.enter("literalAutolink"), e.enter("literalAutolinkHttp"), i += String.fromCodePoint(c), e.consume(c), u) : t(c);
2082
2078
  }
2083
2079
  function u(c) {
2084
- if (ne(c) && i.length < 5)
2080
+ if (re(c) && i.length < 5)
2085
2081
  return i += String.fromCodePoint(c), e.consume(c), u;
2086
2082
  if (c === 58) {
2087
2083
  const p = i.toLowerCase();
@@ -2094,13 +2090,13 @@ function ka(e, r, t) {
2094
2090
  return c === 47 ? (e.consume(c), o ? s : (o = !0, l)) : t(c);
2095
2091
  }
2096
2092
  function s(c) {
2097
- return c === null || Cr(c) || M(c) || q(c) || fe(c) ? t(c) : e.attempt(It, e.attempt(At, f), t)(c);
2093
+ return c === null || Tr(c) || D(c) || H(c) || he(c) ? t(c) : e.attempt(Nt, e.attempt(St, f), t)(c);
2098
2094
  }
2099
2095
  function f(c) {
2100
2096
  return e.exit("literalAutolinkHttp"), e.exit("literalAutolink"), r(c);
2101
2097
  }
2102
2098
  }
2103
- function xa(e, r, t) {
2099
+ function ya(e, r, t) {
2104
2100
  let n = 0;
2105
2101
  return i;
2106
2102
  function i(a) {
@@ -2110,11 +2106,11 @@ function xa(e, r, t) {
2110
2106
  return a === null ? t(a) : r(a);
2111
2107
  }
2112
2108
  }
2113
- function wa(e, r, t) {
2109
+ function Ca(e, r, t) {
2114
2110
  let n, i, o;
2115
2111
  return a;
2116
2112
  function a(s) {
2117
- return s === 46 || s === 95 ? e.check(Nt, l, u)(s) : s === null || M(s) || q(s) || s !== 45 && fe(s) ? l(s) : (o = !0, e.consume(s), a);
2113
+ return s === 46 || s === 95 ? e.check(Lt, l, u)(s) : s === null || D(s) || H(s) || s !== 45 && he(s) ? l(s) : (o = !0, e.consume(s), a);
2118
2114
  }
2119
2115
  function u(s) {
2120
2116
  return s === 95 ? n = !0 : (i = n, n = void 0), e.consume(s), a;
@@ -2123,57 +2119,57 @@ function wa(e, r, t) {
2123
2119
  return i || n || !o ? t(s) : r(s);
2124
2120
  }
2125
2121
  }
2126
- function ya(e, r) {
2122
+ function va(e, r) {
2127
2123
  let t = 0, n = 0;
2128
2124
  return i;
2129
2125
  function i(a) {
2130
- return a === 40 ? (t++, e.consume(a), i) : a === 41 && n < t ? o(a) : a === 33 || a === 34 || a === 38 || a === 39 || a === 41 || a === 42 || a === 44 || a === 46 || a === 58 || a === 59 || a === 60 || a === 63 || a === 93 || a === 95 || a === 126 ? e.check(Nt, r, o)(a) : a === null || M(a) || q(a) ? r(a) : (e.consume(a), i);
2126
+ return a === 40 ? (t++, e.consume(a), i) : a === 41 && n < t ? o(a) : a === 33 || a === 34 || a === 38 || a === 39 || a === 41 || a === 42 || a === 44 || a === 46 || a === 58 || a === 59 || a === 60 || a === 63 || a === 93 || a === 95 || a === 126 ? e.check(Lt, r, o)(a) : a === null || D(a) || H(a) ? r(a) : (e.consume(a), i);
2131
2127
  }
2132
2128
  function o(a) {
2133
2129
  return a === 41 && n++, e.consume(a), i;
2134
2130
  }
2135
2131
  }
2136
- function Ca(e, r, t) {
2132
+ function Ta(e, r, t) {
2137
2133
  return n;
2138
2134
  function n(u) {
2139
2135
  return u === 33 || u === 34 || u === 39 || u === 41 || u === 42 || u === 44 || u === 46 || u === 58 || u === 59 || u === 63 || u === 95 || u === 126 ? (e.consume(u), n) : u === 38 ? (e.consume(u), o) : u === 93 ? (e.consume(u), i) : (
2140
2136
  // `<` is an end.
2141
2137
  u === 60 || // So is whitespace.
2142
- u === null || M(u) || q(u) ? r(u) : t(u)
2138
+ u === null || D(u) || H(u) ? r(u) : t(u)
2143
2139
  );
2144
2140
  }
2145
2141
  function i(u) {
2146
- return u === null || u === 40 || u === 91 || M(u) || q(u) ? r(u) : n(u);
2142
+ return u === null || u === 40 || u === 91 || D(u) || H(u) ? r(u) : n(u);
2147
2143
  }
2148
2144
  function o(u) {
2149
- return ne(u) ? a(u) : t(u);
2145
+ return re(u) ? a(u) : t(u);
2150
2146
  }
2151
2147
  function a(u) {
2152
- return u === 59 ? (e.consume(u), n) : ne(u) ? (e.consume(u), a) : t(u);
2148
+ return u === 59 ? (e.consume(u), n) : re(u) ? (e.consume(u), a) : t(u);
2153
2149
  }
2154
2150
  }
2155
- function va(e, r, t) {
2151
+ function Aa(e, r, t) {
2156
2152
  return n;
2157
2153
  function n(o) {
2158
2154
  return e.consume(o), i;
2159
2155
  }
2160
2156
  function i(o) {
2161
- return Le(o) ? t(o) : r(o);
2157
+ return Me(o) ? t(o) : r(o);
2162
2158
  }
2163
2159
  }
2164
- function Mt(e) {
2165
- return e === null || e === 40 || e === 42 || e === 95 || e === 91 || e === 93 || e === 126 || M(e);
2160
+ function Pt(e) {
2161
+ return e === null || e === 40 || e === 42 || e === 95 || e === 91 || e === 93 || e === 126 || D(e);
2166
2162
  }
2167
- function Dt(e) {
2168
- return !ne(e);
2163
+ function Rt(e) {
2164
+ return !re(e);
2169
2165
  }
2170
- function Pt(e) {
2171
- return !(e === 47 || Se(e));
2166
+ function Et(e) {
2167
+ return !(e === 47 || Le(e));
2172
2168
  }
2173
- function Se(e) {
2174
- return e === 43 || e === 45 || e === 46 || e === 95 || Le(e);
2169
+ function Le(e) {
2170
+ return e === 43 || e === 45 || e === 46 || e === 95 || Me(e);
2175
2171
  }
2176
- function Pe(e) {
2172
+ function Re(e) {
2177
2173
  let r = e.length, t = !1;
2178
2174
  for (; r--; ) {
2179
2175
  const n = e[r][1];
@@ -2188,7 +2184,7 @@ function Pe(e) {
2188
2184
  }
2189
2185
  return e.length > 0 && !t && (e[e.length - 1][1]._gfmAutolinkLiteralWalkedInto = !0), t;
2190
2186
  }
2191
- function Ta(e, r, t) {
2187
+ function Ia(e, r, t) {
2192
2188
  const n = [];
2193
2189
  let i = -1;
2194
2190
  for (; ++i < e.length; ) {
@@ -2197,61 +2193,61 @@ function Ta(e, r, t) {
2197
2193
  }
2198
2194
  return r;
2199
2195
  }
2200
- function F(e, r, t, n) {
2196
+ function z(e, r, t, n) {
2201
2197
  const i = n ? n - 1 : Number.POSITIVE_INFINITY;
2202
2198
  let o = 0;
2203
2199
  return a;
2204
2200
  function a(l) {
2205
- return _(l) ? (e.enter(t), u(l)) : r(l);
2201
+ return F(l) ? (e.enter(t), u(l)) : r(l);
2206
2202
  }
2207
2203
  function u(l) {
2208
- return _(l) && o++ < i ? (e.consume(l), u) : (e.exit(t), r(l));
2204
+ return F(l) && o++ < i ? (e.consume(l), u) : (e.exit(t), r(l));
2209
2205
  }
2210
2206
  }
2211
- const Ia = {
2207
+ const Na = {
2212
2208
  partial: !0,
2213
- tokenize: Aa
2209
+ tokenize: Sa
2214
2210
  };
2215
- function Aa(e, r, t) {
2211
+ function Sa(e, r, t) {
2216
2212
  return n;
2217
2213
  function n(o) {
2218
- return _(o) ? F(e, i, "linePrefix")(o) : i(o);
2214
+ return F(o) ? z(e, i, "linePrefix")(o) : i(o);
2219
2215
  }
2220
2216
  function i(o) {
2221
- return o === null || G(o) ? r(o) : t(o);
2217
+ return o === null || Z(o) ? r(o) : t(o);
2222
2218
  }
2223
2219
  }
2224
- const Na = {
2225
- tokenize: _a,
2220
+ const La = {
2221
+ tokenize: za,
2226
2222
  partial: !0
2227
2223
  };
2228
- function Sa() {
2224
+ function Ma() {
2229
2225
  return {
2230
2226
  document: {
2231
2227
  91: {
2232
2228
  name: "gfmFootnoteDefinition",
2233
- tokenize: Pa,
2229
+ tokenize: Ea,
2234
2230
  continuation: {
2235
- tokenize: Ra
2231
+ tokenize: _a
2236
2232
  },
2237
- exit: Ea
2233
+ exit: Fa
2238
2234
  }
2239
2235
  },
2240
2236
  text: {
2241
2237
  91: {
2242
2238
  name: "gfmFootnoteCall",
2243
- tokenize: Da
2239
+ tokenize: Ra
2244
2240
  },
2245
2241
  93: {
2246
2242
  name: "gfmPotentialFootnoteCall",
2247
2243
  add: "after",
2248
- tokenize: La,
2249
- resolveTo: Ma
2244
+ tokenize: Da,
2245
+ resolveTo: Pa
2250
2246
  }
2251
2247
  }
2252
2248
  };
2253
2249
  }
2254
- function La(e, r, t) {
2250
+ function Da(e, r, t) {
2255
2251
  const n = this;
2256
2252
  let i = n.events.length;
2257
2253
  const o = n.parser.gfmFootnotes || (n.parser.gfmFootnotes = []);
@@ -2269,14 +2265,14 @@ function La(e, r, t) {
2269
2265
  function u(l) {
2270
2266
  if (!a || !a._balanced)
2271
2267
  return t(l);
2272
- const s = ie(n.sliceSerialize({
2268
+ const s = ae(n.sliceSerialize({
2273
2269
  start: a.end,
2274
2270
  end: n.now()
2275
2271
  }));
2276
2272
  return s.codePointAt(0) !== 94 || !o.includes(s.slice(1)) ? t(l) : (e.enter("gfmFootnoteCallLabelMarker"), e.consume(l), e.exit("gfmFootnoteCallLabelMarker"), r(l));
2277
2273
  }
2278
2274
  }
2279
- function Ma(e, r) {
2275
+ function Pa(e, r) {
2280
2276
  let t = e.length;
2281
2277
  for (; t--; )
2282
2278
  if (e[t][1].type === "labelImage" && e[t][0] === "enter") {
@@ -2326,7 +2322,7 @@ function Ma(e, r) {
2326
2322
  ];
2327
2323
  return e.splice(t, e.length - t + 1, ...u), e;
2328
2324
  }
2329
- function Da(e, r, t) {
2325
+ function Ra(e, r, t) {
2330
2326
  const n = this, i = n.parser.gfmFootnotes || (n.parser.gfmFootnotes = []);
2331
2327
  let o = 0, a;
2332
2328
  return u;
@@ -2342,71 +2338,71 @@ function Da(e, r, t) {
2342
2338
  o > 999 || // Closing brace with nothing.
2343
2339
  c === 93 && !a || // Space or tab is not supported by GFM for some reason.
2344
2340
  // `\n` and `[` not being supported makes sense.
2345
- c === null || c === 91 || M(c)
2341
+ c === null || c === 91 || D(c)
2346
2342
  )
2347
2343
  return t(c);
2348
2344
  if (c === 93) {
2349
2345
  e.exit("chunkString");
2350
2346
  const p = e.exit("gfmFootnoteCallString");
2351
- return i.includes(ie(n.sliceSerialize(p))) ? (e.enter("gfmFootnoteCallLabelMarker"), e.consume(c), e.exit("gfmFootnoteCallLabelMarker"), e.exit("gfmFootnoteCall"), r) : t(c);
2347
+ return i.includes(ae(n.sliceSerialize(p))) ? (e.enter("gfmFootnoteCallLabelMarker"), e.consume(c), e.exit("gfmFootnoteCallLabelMarker"), e.exit("gfmFootnoteCall"), r) : t(c);
2352
2348
  }
2353
- return M(c) || (a = !0), o++, e.consume(c), c === 92 ? f : s;
2349
+ return D(c) || (a = !0), o++, e.consume(c), c === 92 ? f : s;
2354
2350
  }
2355
2351
  function f(c) {
2356
2352
  return c === 91 || c === 92 || c === 93 ? (e.consume(c), o++, s) : s(c);
2357
2353
  }
2358
2354
  }
2359
- function Pa(e, r, t) {
2355
+ function Ea(e, r, t) {
2360
2356
  const n = this, i = n.parser.gfmFootnotes || (n.parser.gfmFootnotes = []);
2361
2357
  let o, a = 0, u;
2362
2358
  return l;
2363
- function l(d) {
2364
- return e.enter("gfmFootnoteDefinition")._container = !0, e.enter("gfmFootnoteDefinitionLabel"), e.enter("gfmFootnoteDefinitionLabelMarker"), e.consume(d), e.exit("gfmFootnoteDefinitionLabelMarker"), s;
2359
+ function l(h) {
2360
+ return e.enter("gfmFootnoteDefinition")._container = !0, e.enter("gfmFootnoteDefinitionLabel"), e.enter("gfmFootnoteDefinitionLabelMarker"), e.consume(h), e.exit("gfmFootnoteDefinitionLabelMarker"), s;
2365
2361
  }
2366
- function s(d) {
2367
- return d === 94 ? (e.enter("gfmFootnoteDefinitionMarker"), e.consume(d), e.exit("gfmFootnoteDefinitionMarker"), e.enter("gfmFootnoteDefinitionLabelString"), e.enter("chunkString").contentType = "string", f) : t(d);
2362
+ function s(h) {
2363
+ return h === 94 ? (e.enter("gfmFootnoteDefinitionMarker"), e.consume(h), e.exit("gfmFootnoteDefinitionMarker"), e.enter("gfmFootnoteDefinitionLabelString"), e.enter("chunkString").contentType = "string", f) : t(h);
2368
2364
  }
2369
- function f(d) {
2365
+ function f(h) {
2370
2366
  if (
2371
2367
  // Too long.
2372
2368
  a > 999 || // Closing brace with nothing.
2373
- d === 93 && !u || // Space or tab is not supported by GFM for some reason.
2369
+ h === 93 && !u || // Space or tab is not supported by GFM for some reason.
2374
2370
  // `\n` and `[` not being supported makes sense.
2375
- d === null || d === 91 || M(d)
2371
+ h === null || h === 91 || D(h)
2376
2372
  )
2377
- return t(d);
2378
- if (d === 93) {
2373
+ return t(h);
2374
+ if (h === 93) {
2379
2375
  e.exit("chunkString");
2380
2376
  const k = e.exit("gfmFootnoteDefinitionLabelString");
2381
- return o = ie(n.sliceSerialize(k)), e.enter("gfmFootnoteDefinitionLabelMarker"), e.consume(d), e.exit("gfmFootnoteDefinitionLabelMarker"), e.exit("gfmFootnoteDefinitionLabel"), p;
2377
+ return o = ae(n.sliceSerialize(k)), e.enter("gfmFootnoteDefinitionLabelMarker"), e.consume(h), e.exit("gfmFootnoteDefinitionLabelMarker"), e.exit("gfmFootnoteDefinitionLabel"), p;
2382
2378
  }
2383
- return M(d) || (u = !0), a++, e.consume(d), d === 92 ? c : f;
2379
+ return D(h) || (u = !0), a++, e.consume(h), h === 92 ? c : f;
2384
2380
  }
2385
- function c(d) {
2386
- return d === 91 || d === 92 || d === 93 ? (e.consume(d), a++, f) : f(d);
2381
+ function c(h) {
2382
+ return h === 91 || h === 92 || h === 93 ? (e.consume(h), a++, f) : f(h);
2387
2383
  }
2388
- function p(d) {
2389
- return d === 58 ? (e.enter("definitionMarker"), e.consume(d), e.exit("definitionMarker"), i.includes(o) || i.push(o), F(e, g, "gfmFootnoteDefinitionWhitespace")) : t(d);
2384
+ function p(h) {
2385
+ return h === 58 ? (e.enter("definitionMarker"), e.consume(h), e.exit("definitionMarker"), i.includes(o) || i.push(o), z(e, g, "gfmFootnoteDefinitionWhitespace")) : t(h);
2390
2386
  }
2391
- function g(d) {
2392
- return r(d);
2387
+ function g(h) {
2388
+ return r(h);
2393
2389
  }
2394
2390
  }
2395
- function Ra(e, r, t) {
2396
- return e.check(Ia, r, e.attempt(Na, r, t));
2391
+ function _a(e, r, t) {
2392
+ return e.check(Na, r, e.attempt(La, r, t));
2397
2393
  }
2398
- function Ea(e) {
2394
+ function Fa(e) {
2399
2395
  e.exit("gfmFootnoteDefinition");
2400
2396
  }
2401
- function _a(e, r, t) {
2397
+ function za(e, r, t) {
2402
2398
  const n = this;
2403
- return F(e, i, "gfmFootnoteDefinitionIndent", 5);
2399
+ return z(e, i, "gfmFootnoteDefinitionIndent", 5);
2404
2400
  function i(o) {
2405
2401
  const a = n.events[n.events.length - 1];
2406
2402
  return a && a[1].type === "gfmFootnoteDefinitionIndent" && a[2].sliceSerialize(a[1], !0).length === 4 ? r(o) : t(o);
2407
2403
  }
2408
2404
  }
2409
- function Fa(e) {
2405
+ function ja(e) {
2410
2406
  let t = (e || {}).singleTilde;
2411
2407
  const n = {
2412
2408
  name: "strikethrough",
@@ -2442,7 +2438,7 @@ function Fa(e) {
2442
2438
  start: Object.assign({}, a[s][1].end),
2443
2439
  end: Object.assign({}, a[l][1].start)
2444
2440
  }, p = [["enter", f, u], ["enter", a[s][1], u], ["exit", a[s][1], u], ["enter", c, u]], g = u.parser.constructs.insideSpan.null;
2445
- g && ue(p, p.length, 0, Ta(g, a.slice(s + 1, l), u)), ue(p, p.length, 0, [["exit", c, u], ["enter", a[l][1], u], ["exit", a[l][1], u], ["exit", f, u]]), ue(a, s - 1, l - s + 3, p), l = s + p.length - 2;
2441
+ g && ce(p, p.length, 0, Ia(g, a.slice(s + 1, l), u)), ce(p, p.length, 0, [["exit", c, u], ["enter", a[l][1], u], ["exit", a[l][1], u], ["exit", f, u]]), ce(a, s - 1, l - s + 3, p), l = s + p.length - 2;
2446
2442
  break;
2447
2443
  }
2448
2444
  }
@@ -2454,20 +2450,20 @@ function Fa(e) {
2454
2450
  const s = this.previous, f = this.events;
2455
2451
  let c = 0;
2456
2452
  return p;
2457
- function p(d) {
2458
- return s === 126 && f[f.length - 1][1].type !== "characterEscape" ? l(d) : (a.enter("strikethroughSequenceTemporary"), g(d));
2453
+ function p(h) {
2454
+ return s === 126 && f[f.length - 1][1].type !== "characterEscape" ? l(h) : (a.enter("strikethroughSequenceTemporary"), g(h));
2459
2455
  }
2460
- function g(d) {
2461
- const k = se(s);
2462
- if (d === 126)
2463
- return c > 1 ? l(d) : (a.consume(d), c++, g);
2464
- if (c < 2 && !t) return l(d);
2465
- const b = a.exit("strikethroughSequenceTemporary"), x = se(d);
2466
- return b._open = !x || x === 2 && !!k, b._close = !k || k === 2 && !!x, u(d);
2456
+ function g(h) {
2457
+ const k = de(s);
2458
+ if (h === 126)
2459
+ return c > 1 ? l(h) : (a.consume(h), c++, g);
2460
+ if (c < 2 && !t) return l(h);
2461
+ const b = a.exit("strikethroughSequenceTemporary"), x = de(h);
2462
+ return b._open = !x || x === 2 && !!k, b._close = !k || k === 2 && !!x, u(h);
2467
2463
  }
2468
2464
  }
2469
2465
  }
2470
- class za {
2466
+ class $a {
2471
2467
  /**
2472
2468
  * Create a new edit map.
2473
2469
  */
@@ -2483,7 +2479,7 @@ class za {
2483
2479
  * @returns {undefined}
2484
2480
  */
2485
2481
  add(r, t, n) {
2486
- ja(this, r, t, n);
2482
+ Oa(this, r, t, n);
2487
2483
  }
2488
2484
  // To do: add this when moving to `micromark`.
2489
2485
  // /**
@@ -2522,7 +2518,7 @@ class za {
2522
2518
  this.map.length = 0;
2523
2519
  }
2524
2520
  }
2525
- function ja(e, r, t, n) {
2521
+ function Oa(e, r, t, n) {
2526
2522
  let i = 0;
2527
2523
  if (!(t === 0 && n.length === 0)) {
2528
2524
  for (; i < e.map.length; ) {
@@ -2535,7 +2531,7 @@ function ja(e, r, t, n) {
2535
2531
  e.map.push([r, t, n]);
2536
2532
  }
2537
2533
  }
2538
- function $a(e, r) {
2534
+ function Ua(e, r) {
2539
2535
  let t = !1;
2540
2536
  const n = [];
2541
2537
  for (; r < e.length; ) {
@@ -2555,18 +2551,18 @@ function $a(e, r) {
2555
2551
  }
2556
2552
  return n;
2557
2553
  }
2558
- function Oa() {
2554
+ function Ba() {
2559
2555
  return {
2560
2556
  flow: {
2561
2557
  null: {
2562
2558
  name: "table",
2563
- tokenize: Ua,
2564
- resolveAll: Ba
2559
+ tokenize: Wa,
2560
+ resolveAll: Ha
2565
2561
  }
2566
2562
  }
2567
2563
  };
2568
2564
  }
2569
- function Ua(e, r, t) {
2565
+ function Wa(e, r, t) {
2570
2566
  const n = this;
2571
2567
  let i = 0, o = 0, a;
2572
2568
  return u;
@@ -2578,8 +2574,8 @@ function Ua(e, r, t) {
2578
2574
  J === "linePrefix") P--;
2579
2575
  else break;
2580
2576
  }
2581
- const Z = P > -1 ? n.events[P][1].type : null, O = Z === "tableHead" || Z === "tableRow" ? I : l;
2582
- return O === I && n.parser.lazy[n.now().line] ? t(m) : O(m);
2577
+ const ie = P > -1 ? n.events[P][1].type : null, O = ie === "tableHead" || ie === "tableRow" ? C : l;
2578
+ return O === C && n.parser.lazy[n.now().line] ? t(m) : O(m);
2583
2579
  }
2584
2580
  function l(m) {
2585
2581
  return e.enter("tableHead"), e.enter("tableRow"), s(m);
@@ -2588,88 +2584,88 @@ function Ua(e, r, t) {
2588
2584
  return m === 124 || (a = !0, o += 1), f(m);
2589
2585
  }
2590
2586
  function f(m) {
2591
- return m === null ? t(m) : G(m) ? o > 1 ? (o = 0, n.interrupt = !0, e.exit("tableRow"), e.enter("lineEnding"), e.consume(m), e.exit("lineEnding"), g) : t(m) : _(m) ? F(e, f, "whitespace")(m) : (o += 1, a && (a = !1, i += 1), m === 124 ? (e.enter("tableCellDivider"), e.consume(m), e.exit("tableCellDivider"), a = !0, f) : (e.enter("data"), c(m)));
2587
+ return m === null ? t(m) : Z(m) ? o > 1 ? (o = 0, n.interrupt = !0, e.exit("tableRow"), e.enter("lineEnding"), e.consume(m), e.exit("lineEnding"), g) : t(m) : F(m) ? z(e, f, "whitespace")(m) : (o += 1, a && (a = !1, i += 1), m === 124 ? (e.enter("tableCellDivider"), e.consume(m), e.exit("tableCellDivider"), a = !0, f) : (e.enter("data"), c(m)));
2592
2588
  }
2593
2589
  function c(m) {
2594
- return m === null || m === 124 || M(m) ? (e.exit("data"), f(m)) : (e.consume(m), m === 92 ? p : c);
2590
+ return m === null || m === 124 || D(m) ? (e.exit("data"), f(m)) : (e.consume(m), m === 92 ? p : c);
2595
2591
  }
2596
2592
  function p(m) {
2597
2593
  return m === 92 || m === 124 ? (e.consume(m), c) : c(m);
2598
2594
  }
2599
2595
  function g(m) {
2600
- return n.interrupt = !1, n.parser.lazy[n.now().line] ? t(m) : (e.enter("tableDelimiterRow"), a = !1, _(m) ? F(e, d, "linePrefix", n.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(m) : d(m));
2596
+ return n.interrupt = !1, n.parser.lazy[n.now().line] ? t(m) : (e.enter("tableDelimiterRow"), a = !1, F(m) ? z(e, h, "linePrefix", n.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(m) : h(m));
2601
2597
  }
2602
- function d(m) {
2603
- return m === 45 || m === 58 ? b(m) : m === 124 ? (a = !0, e.enter("tableCellDivider"), e.consume(m), e.exit("tableCellDivider"), k) : C(m);
2598
+ function h(m) {
2599
+ return m === 45 || m === 58 ? b(m) : m === 124 ? (a = !0, e.enter("tableCellDivider"), e.consume(m), e.exit("tableCellDivider"), k) : T(m);
2604
2600
  }
2605
2601
  function k(m) {
2606
- return _(m) ? F(e, b, "whitespace")(m) : b(m);
2602
+ return F(m) ? z(e, b, "whitespace")(m) : b(m);
2607
2603
  }
2608
2604
  function b(m) {
2609
- return m === 58 ? (o += 1, a = !0, e.enter("tableDelimiterMarker"), e.consume(m), e.exit("tableDelimiterMarker"), x) : m === 45 ? (o += 1, x(m)) : m === null || G(m) ? v(m) : C(m);
2605
+ return m === 58 ? (o += 1, a = !0, e.enter("tableDelimiterMarker"), e.consume(m), e.exit("tableDelimiterMarker"), x) : m === 45 ? (o += 1, x(m)) : m === null || Z(m) ? A(m) : T(m);
2610
2606
  }
2611
2607
  function x(m) {
2612
- return m === 45 ? (e.enter("tableDelimiterFiller"), w(m)) : C(m);
2608
+ return m === 45 ? (e.enter("tableDelimiterFiller"), w(m)) : T(m);
2613
2609
  }
2614
2610
  function w(m) {
2615
2611
  return m === 45 ? (e.consume(m), w) : m === 58 ? (a = !0, e.exit("tableDelimiterFiller"), e.enter("tableDelimiterMarker"), e.consume(m), e.exit("tableDelimiterMarker"), y) : (e.exit("tableDelimiterFiller"), y(m));
2616
2612
  }
2617
2613
  function y(m) {
2618
- return _(m) ? F(e, v, "whitespace")(m) : v(m);
2614
+ return F(m) ? z(e, A, "whitespace")(m) : A(m);
2619
2615
  }
2620
- function v(m) {
2621
- return m === 124 ? d(m) : m === null || G(m) ? !a || i !== o ? C(m) : (e.exit("tableDelimiterRow"), e.exit("tableHead"), r(m)) : C(m);
2616
+ function A(m) {
2617
+ return m === 124 ? h(m) : m === null || Z(m) ? !a || i !== o ? T(m) : (e.exit("tableDelimiterRow"), e.exit("tableHead"), r(m)) : T(m);
2622
2618
  }
2623
- function C(m) {
2619
+ function T(m) {
2624
2620
  return t(m);
2625
2621
  }
2626
- function I(m) {
2627
- return e.enter("tableRow"), D(m);
2622
+ function C(m) {
2623
+ return e.enter("tableRow"), L(m);
2628
2624
  }
2629
- function D(m) {
2630
- return m === 124 ? (e.enter("tableCellDivider"), e.consume(m), e.exit("tableCellDivider"), D) : m === null || G(m) ? (e.exit("tableRow"), r(m)) : _(m) ? F(e, D, "whitespace")(m) : (e.enter("data"), U(m));
2625
+ function L(m) {
2626
+ return m === 124 ? (e.enter("tableCellDivider"), e.consume(m), e.exit("tableCellDivider"), L) : m === null || Z(m) ? (e.exit("tableRow"), r(m)) : F(m) ? z(e, L, "whitespace")(m) : (e.enter("data"), E(m));
2631
2627
  }
2632
- function U(m) {
2633
- return m === null || m === 124 || M(m) ? (e.exit("data"), D(m)) : (e.consume(m), m === 92 ? $ : U);
2628
+ function E(m) {
2629
+ return m === null || m === 124 || D(m) ? (e.exit("data"), L(m)) : (e.consume(m), m === 92 ? q : E);
2634
2630
  }
2635
- function $(m) {
2636
- return m === 92 || m === 124 ? (e.consume(m), U) : U(m);
2631
+ function q(m) {
2632
+ return m === 92 || m === 124 ? (e.consume(m), E) : E(m);
2637
2633
  }
2638
2634
  }
2639
- function Ba(e, r) {
2635
+ function Ha(e, r) {
2640
2636
  let t = -1, n = !0, i = 0, o = [0, 0, 0, 0], a = [0, 0, 0, 0], u = !1, l = 0, s, f, c;
2641
- const p = new za();
2637
+ const p = new $a();
2642
2638
  for (; ++t < e.length; ) {
2643
- const g = e[t], d = g[1];
2644
- g[0] === "enter" ? d.type === "tableHead" ? (u = !1, l !== 0 && (Xe(p, r, l, s, f), f = void 0, l = 0), s = {
2639
+ const g = e[t], h = g[1];
2640
+ g[0] === "enter" ? h.type === "tableHead" ? (u = !1, l !== 0 && (Je(p, r, l, s, f), f = void 0, l = 0), s = {
2645
2641
  type: "table",
2646
- start: Object.assign({}, d.start),
2642
+ start: Object.assign({}, h.start),
2647
2643
  // Note: correct end is set later.
2648
- end: Object.assign({}, d.end)
2649
- }, p.add(t, 0, [["enter", s, r]])) : d.type === "tableRow" || d.type === "tableDelimiterRow" ? (n = !0, c = void 0, o = [0, 0, 0, 0], a = [0, t + 1, 0, 0], u && (u = !1, f = {
2644
+ end: Object.assign({}, h.end)
2645
+ }, p.add(t, 0, [["enter", s, r]])) : h.type === "tableRow" || h.type === "tableDelimiterRow" ? (n = !0, c = void 0, o = [0, 0, 0, 0], a = [0, t + 1, 0, 0], u && (u = !1, f = {
2650
2646
  type: "tableBody",
2651
- start: Object.assign({}, d.start),
2647
+ start: Object.assign({}, h.start),
2652
2648
  // Note: correct end is set later.
2653
- end: Object.assign({}, d.end)
2654
- }, p.add(t, 0, [["enter", f, r]])), i = d.type === "tableDelimiterRow" ? 2 : f ? 3 : 1) : i && (d.type === "data" || d.type === "tableDelimiterMarker" || d.type === "tableDelimiterFiller") ? (n = !1, a[2] === 0 && (o[1] !== 0 && (a[0] = a[1], c = le(p, r, o, i, void 0, c), o = [0, 0, 0, 0]), a[2] = t)) : d.type === "tableCellDivider" && (n ? n = !1 : (o[1] !== 0 && (a[0] = a[1], c = le(p, r, o, i, void 0, c)), o = a, a = [o[1], t, 0, 0])) : d.type === "tableHead" ? (u = !0, l = t) : d.type === "tableRow" || d.type === "tableDelimiterRow" ? (l = t, o[1] !== 0 ? (a[0] = a[1], c = le(p, r, o, i, t, c)) : a[1] !== 0 && (c = le(p, r, a, i, t, c)), i = 0) : i && (d.type === "data" || d.type === "tableDelimiterMarker" || d.type === "tableDelimiterFiller") && (a[3] = t);
2649
+ end: Object.assign({}, h.end)
2650
+ }, p.add(t, 0, [["enter", f, r]])), i = h.type === "tableDelimiterRow" ? 2 : f ? 3 : 1) : i && (h.type === "data" || h.type === "tableDelimiterMarker" || h.type === "tableDelimiterFiller") ? (n = !1, a[2] === 0 && (o[1] !== 0 && (a[0] = a[1], c = ue(p, r, o, i, void 0, c), o = [0, 0, 0, 0]), a[2] = t)) : h.type === "tableCellDivider" && (n ? n = !1 : (o[1] !== 0 && (a[0] = a[1], c = ue(p, r, o, i, void 0, c)), o = a, a = [o[1], t, 0, 0])) : h.type === "tableHead" ? (u = !0, l = t) : h.type === "tableRow" || h.type === "tableDelimiterRow" ? (l = t, o[1] !== 0 ? (a[0] = a[1], c = ue(p, r, o, i, t, c)) : a[1] !== 0 && (c = ue(p, r, a, i, t, c)), i = 0) : i && (h.type === "data" || h.type === "tableDelimiterMarker" || h.type === "tableDelimiterFiller") && (a[3] = t);
2655
2651
  }
2656
- for (l !== 0 && Xe(p, r, l, s, f), p.consume(r.events), t = -1; ++t < r.events.length; ) {
2652
+ for (l !== 0 && Je(p, r, l, s, f), p.consume(r.events), t = -1; ++t < r.events.length; ) {
2657
2653
  const g = r.events[t];
2658
- g[0] === "enter" && g[1].type === "table" && (g[1]._align = $a(r.events, t));
2654
+ g[0] === "enter" && g[1].type === "table" && (g[1]._align = Ua(r.events, t));
2659
2655
  }
2660
2656
  return e;
2661
2657
  }
2662
- function le(e, r, t, n, i, o) {
2658
+ function ue(e, r, t, n, i, o) {
2663
2659
  const a = n === 1 ? "tableHeader" : n === 2 ? "tableDelimiter" : "tableData", u = "tableContent";
2664
- t[0] !== 0 && (o.end = Object.assign({}, X(r.events, t[0])), e.add(t[0], 0, [["exit", o, r]]));
2665
- const l = X(r.events, t[1]);
2660
+ t[0] !== 0 && (o.end = Object.assign({}, G(r.events, t[0])), e.add(t[0], 0, [["exit", o, r]]));
2661
+ const l = G(r.events, t[1]);
2666
2662
  if (o = {
2667
2663
  type: a,
2668
2664
  start: Object.assign({}, l),
2669
2665
  // Note: correct end is set later.
2670
2666
  end: Object.assign({}, l)
2671
2667
  }, e.add(t[1], 0, [["enter", o, r]]), t[2] !== 0) {
2672
- const s = X(r.events, t[2]), f = X(r.events, t[3]), c = {
2668
+ const s = G(r.events, t[2]), f = G(r.events, t[3]), c = {
2673
2669
  type: u,
2674
2670
  start: Object.assign({}, s),
2675
2671
  end: Object.assign({}, f)
@@ -2677,34 +2673,34 @@ function le(e, r, t, n, i, o) {
2677
2673
  if (e.add(t[2], 0, [["enter", c, r]]), n !== 2) {
2678
2674
  const p = r.events[t[2]], g = r.events[t[3]];
2679
2675
  if (p[1].end = Object.assign({}, g[1].end), p[1].type = "chunkText", p[1].contentType = "text", t[3] > t[2] + 1) {
2680
- const d = t[2] + 1, k = t[3] - t[2] - 1;
2681
- e.add(d, k, []);
2676
+ const h = t[2] + 1, k = t[3] - t[2] - 1;
2677
+ e.add(h, k, []);
2682
2678
  }
2683
2679
  }
2684
2680
  e.add(t[3] + 1, 0, [["exit", c, r]]);
2685
2681
  }
2686
- return i !== void 0 && (o.end = Object.assign({}, X(r.events, i)), e.add(i, 0, [["exit", o, r]]), o = void 0), o;
2682
+ return i !== void 0 && (o.end = Object.assign({}, G(r.events, i)), e.add(i, 0, [["exit", o, r]]), o = void 0), o;
2687
2683
  }
2688
- function Xe(e, r, t, n, i) {
2689
- const o = [], a = X(r.events, t);
2684
+ function Je(e, r, t, n, i) {
2685
+ const o = [], a = G(r.events, t);
2690
2686
  i && (i.end = Object.assign({}, a), o.push(["exit", i, r])), n.end = Object.assign({}, a), o.push(["exit", n, r]), e.add(t + 1, 0, o);
2691
2687
  }
2692
- function X(e, r) {
2688
+ function G(e, r) {
2693
2689
  const t = e[r], n = t[0] === "enter" ? "start" : "end";
2694
2690
  return t[1][n];
2695
2691
  }
2696
- const Wa = {
2692
+ const qa = {
2697
2693
  name: "tasklistCheck",
2698
- tokenize: qa
2694
+ tokenize: Va
2699
2695
  };
2700
- function Ha() {
2696
+ function Ka() {
2701
2697
  return {
2702
2698
  text: {
2703
- 91: Wa
2699
+ 91: qa
2704
2700
  }
2705
2701
  };
2706
2702
  }
2707
- function qa(e, r, t) {
2703
+ function Va(e, r, t) {
2708
2704
  const n = this;
2709
2705
  return i;
2710
2706
  function i(l) {
@@ -2716,56 +2712,56 @@ function qa(e, r, t) {
2716
2712
  );
2717
2713
  }
2718
2714
  function o(l) {
2719
- return M(l) ? (e.enter("taskListCheckValueUnchecked"), e.consume(l), e.exit("taskListCheckValueUnchecked"), a) : l === 88 || l === 120 ? (e.enter("taskListCheckValueChecked"), e.consume(l), e.exit("taskListCheckValueChecked"), a) : t(l);
2715
+ return D(l) ? (e.enter("taskListCheckValueUnchecked"), e.consume(l), e.exit("taskListCheckValueUnchecked"), a) : l === 88 || l === 120 ? (e.enter("taskListCheckValueChecked"), e.consume(l), e.exit("taskListCheckValueChecked"), a) : t(l);
2720
2716
  }
2721
2717
  function a(l) {
2722
2718
  return l === 93 ? (e.enter("taskListCheckMarker"), e.consume(l), e.exit("taskListCheckMarker"), e.exit("taskListCheck"), u) : t(l);
2723
2719
  }
2724
2720
  function u(l) {
2725
- return G(l) ? r(l) : _(l) ? e.check({
2726
- tokenize: Ka
2721
+ return Z(l) ? r(l) : F(l) ? e.check({
2722
+ tokenize: Ga
2727
2723
  }, r, t)(l) : t(l);
2728
2724
  }
2729
2725
  }
2730
- function Ka(e, r, t) {
2731
- return F(e, n, "whitespace");
2726
+ function Ga(e, r, t) {
2727
+ return z(e, n, "whitespace");
2732
2728
  function n(i) {
2733
2729
  return i === null ? t(i) : r(i);
2734
2730
  }
2735
2731
  }
2736
- function Va(e) {
2737
- return sa([
2738
- pa(),
2739
- Sa(),
2740
- Fa(e),
2741
- Oa(),
2742
- Ha()
2732
+ function Za(e) {
2733
+ return fa([
2734
+ ba(),
2735
+ Ma(),
2736
+ ja(e),
2737
+ Ba(),
2738
+ Ka()
2743
2739
  ]);
2744
2740
  }
2745
- const Xa = {};
2746
- function Ga(e) {
2741
+ const Ja = {};
2742
+ function Qa(e) {
2747
2743
  const r = (
2748
2744
  /** @type {Processor<Root>} */
2749
2745
  this
2750
- ), t = e || Xa, n = r.data(), i = n.micromarkExtensions || (n.micromarkExtensions = []), o = n.fromMarkdownExtensions || (n.fromMarkdownExtensions = []), a = n.toMarkdownExtensions || (n.toMarkdownExtensions = []);
2751
- i.push(Va(t)), o.push(ua()), a.push(ca(t));
2746
+ ), t = e || Ja, n = r.data(), i = n.micromarkExtensions || (n.micromarkExtensions = []), o = n.fromMarkdownExtensions || (n.fromMarkdownExtensions = []), a = n.toMarkdownExtensions || (n.toMarkdownExtensions = []);
2747
+ i.push(Za(t)), o.push(sa()), a.push(da(t));
2752
2748
  }
2753
- function A(...e) {
2749
+ function I(...e) {
2754
2750
  return e.filter(Boolean).join(" ");
2755
2751
  }
2756
- const Za = ({ content: e }) => /* @__PURE__ */ h(
2757
- Vt,
2752
+ const Xa = ({ content: e }) => /* @__PURE__ */ d(
2753
+ Zt,
2758
2754
  {
2759
- remarkPlugins: [Ga],
2755
+ remarkPlugins: [Qa],
2760
2756
  className: "cuadra-aui-md",
2761
- components: Ya,
2757
+ components: ti,
2762
2758
  children: e
2763
2759
  }
2764
- ), Rt = jt(Za), Ja = ({ language: e, code: r }) => {
2765
- const { isCopied: t, copyToClipboard: n } = Qa();
2766
- return /* @__PURE__ */ T("div", { className: "cuadra-flex cuadra-items-center cuadra-justify-between cuadra-gap-4 cuadra-mt-4 cuadra-rounded-t-lg cuadra-bg-muted/50 cuadra-border-b cuadra-border-border cuadra-px-4 cuadra-py-2 cuadra-text-sm cuadra-font-normal cuadra-text-foreground cuadra-font-brand", children: [
2767
- /* @__PURE__ */ h("span", { className: "cuadra-lowercase [&>span]:cuadra-text-xs cuadra-font-brand", children: e }),
2768
- /* @__PURE__ */ T(
2760
+ ), _t = Ot(Xa), Ya = ({ language: e, code: r }) => {
2761
+ const { isCopied: t, copyToClipboard: n } = ei();
2762
+ return /* @__PURE__ */ v("div", { className: "cuadra-flex cuadra-items-center cuadra-justify-between cuadra-gap-4 cuadra-mt-4 cuadra-rounded-t-lg cuadra-bg-muted/50 cuadra-border-b cuadra-border-border cuadra-px-4 cuadra-py-2 cuadra-text-sm cuadra-font-normal cuadra-text-foreground cuadra-font-brand", children: [
2763
+ /* @__PURE__ */ d("span", { className: "cuadra-lowercase [&>span]:cuadra-text-xs cuadra-font-brand", children: e }),
2764
+ /* @__PURE__ */ v(
2769
2765
  "button",
2770
2766
  {
2771
2767
  onClick: () => {
@@ -2774,13 +2770,13 @@ const Za = ({ content: e }) => /* @__PURE__ */ h(
2774
2770
  className: "cuadra-p-1 cuadra-rounded hover:cuadra-bg-muted cuadra-transition-colors",
2775
2771
  "aria-label": "Copy code",
2776
2772
  children: [
2777
- !t && /* @__PURE__ */ h(ur, { className: "cuadra-h-4 cuadra-w-4" }),
2778
- t && /* @__PURE__ */ h(rr, { className: "cuadra-h-4 cuadra-w-4" })
2773
+ !t && /* @__PURE__ */ d(sr, { className: "cuadra-h-4 cuadra-w-4" }),
2774
+ t && /* @__PURE__ */ d(ar, { className: "cuadra-h-4 cuadra-w-4" })
2779
2775
  ]
2780
2776
  }
2781
2777
  )
2782
2778
  ] });
2783
- }, Qa = ({
2779
+ }, ei = ({
2784
2780
  copiedDuration: e = 3e3
2785
2781
  } = {}) => {
2786
2782
  const [r, t] = N(!1);
@@ -2789,100 +2785,100 @@ const Za = ({ content: e }) => /* @__PURE__ */ h(
2789
2785
  t(!0), setTimeout(() => t(!1), e);
2790
2786
  });
2791
2787
  } };
2792
- }, Ya = qt({
2793
- h1: ({ className: e, ...r }) => /* @__PURE__ */ h(
2788
+ }, ti = Vt({
2789
+ h1: ({ className: e, ...r }) => /* @__PURE__ */ d(
2794
2790
  "h1",
2795
2791
  {
2796
- className: A("cuadra-mb-6 cuadra-scroll-m-20 cuadra-text-2xl cuadra-font-normal cuadra-tracking-tight last:cuadra-mb-0 font-brand", e),
2792
+ className: I("cuadra-mb-6 cuadra-scroll-m-20 cuadra-text-2xl cuadra-font-normal cuadra-tracking-tight last:cuadra-mb-0 font-brand", e),
2797
2793
  ...r
2798
2794
  }
2799
2795
  ),
2800
- h2: ({ className: e, ...r }) => /* @__PURE__ */ h(
2796
+ h2: ({ className: e, ...r }) => /* @__PURE__ */ d(
2801
2797
  "h2",
2802
2798
  {
2803
- className: A(
2799
+ className: I(
2804
2800
  "cuadra-mb-4 cuadra-mt-6 cuadra-scroll-m-20 cuadra-text-xl cuadra-font-normal cuadra-tracking-tight first:cuadra-mt-0 last:cuadra-mb-0 font-brand",
2805
2801
  e
2806
2802
  ),
2807
2803
  ...r
2808
2804
  }
2809
2805
  ),
2810
- h3: ({ className: e, ...r }) => /* @__PURE__ */ h(
2806
+ h3: ({ className: e, ...r }) => /* @__PURE__ */ d(
2811
2807
  "h3",
2812
2808
  {
2813
- className: A(
2809
+ className: I(
2814
2810
  "cuadra-mb-3 cuadra-mt-5 cuadra-scroll-m-20 cuadra-text-lg cuadra-font-normal cuadra-tracking-tight first:cuadra-mt-0 last:cuadra-mb-0 font-brand",
2815
2811
  e
2816
2812
  ),
2817
2813
  ...r
2818
2814
  }
2819
2815
  ),
2820
- h4: ({ className: e, ...r }) => /* @__PURE__ */ h(
2816
+ h4: ({ className: e, ...r }) => /* @__PURE__ */ d(
2821
2817
  "h4",
2822
2818
  {
2823
- className: A(
2819
+ className: I(
2824
2820
  "cuadra-mb-4 cuadra-mt-6 cuadra-scroll-m-20 cuadra-text-xl cuadra-font-normal cuadra-tracking-tight first:cuadra-mt-0 last:cuadra-mb-0 font-brand",
2825
2821
  e
2826
2822
  ),
2827
2823
  ...r
2828
2824
  }
2829
2825
  ),
2830
- h5: ({ className: e, ...r }) => /* @__PURE__ */ h("h5", { className: A("cuadra-my-4 cuadra-text-lg cuadra-font-normal first:cuadra-mt-0 last:cuadra-mb-0 font-brand", e), ...r }),
2831
- h6: ({ className: e, ...r }) => /* @__PURE__ */ h("h6", { className: A("cuadra-my-4 cuadra-font-normal first:cuadra-mb-0 font-brand", e), ...r }),
2832
- p: ({ className: e, ...r }) => /* @__PURE__ */ h("p", { className: A("cuadra-mb-5 cuadra-mt-5 cuadra-leading-7 first:cuadra-mt-0 last:cuadra-mb-0 font-brand", e), ...r }),
2833
- a: ({ className: e, ...r }) => /* @__PURE__ */ h(
2826
+ h5: ({ className: e, ...r }) => /* @__PURE__ */ d("h5", { className: I("cuadra-my-4 cuadra-text-lg cuadra-font-normal first:cuadra-mt-0 last:cuadra-mb-0 font-brand", e), ...r }),
2827
+ h6: ({ className: e, ...r }) => /* @__PURE__ */ d("h6", { className: I("cuadra-my-4 cuadra-font-normal first:cuadra-mb-0 font-brand", e), ...r }),
2828
+ p: ({ className: e, ...r }) => /* @__PURE__ */ d("p", { className: I("cuadra-mb-5 cuadra-mt-5 cuadra-leading-7 first:cuadra-mt-0 last:cuadra-mb-0 font-brand", e), ...r }),
2829
+ a: ({ className: e, ...r }) => /* @__PURE__ */ d(
2834
2830
  "a",
2835
2831
  {
2836
- className: A("cuadra-text-primary cuadra-font-medium cuadra-underline cuadra-underline-offset-4 font-brand", e),
2832
+ className: I("cuadra-text-primary cuadra-font-medium cuadra-underline cuadra-underline-offset-4 font-brand", e),
2837
2833
  ...r
2838
2834
  }
2839
2835
  ),
2840
- blockquote: ({ className: e, ...r }) => /* @__PURE__ */ h("blockquote", { className: A("cuadra-border-l-2 cuadra-pl-6 cuadra-italic font-brand", e), ...r }),
2841
- ul: ({ className: e, ...r }) => /* @__PURE__ */ h("ul", { className: A("cuadra-my-5 cuadra-ml-6 cuadra-list-disc [&>li]:cuadra-mt-2 font-brand", e), ...r }),
2842
- ol: ({ className: e, ...r }) => /* @__PURE__ */ h("ol", { className: A("cuadra-my-5 cuadra-ml-6 cuadra-list-decimal [&>li]:cuadra-mt-2 font-brand", e), ...r }),
2843
- hr: ({ className: e, ...r }) => /* @__PURE__ */ h("hr", { className: A("cuadra-my-5 cuadra-border-b", e), ...r }),
2844
- table: ({ className: e, ...r }) => /* @__PURE__ */ h(
2836
+ blockquote: ({ className: e, ...r }) => /* @__PURE__ */ d("blockquote", { className: I("cuadra-border-l-2 cuadra-pl-6 cuadra-italic font-brand", e), ...r }),
2837
+ ul: ({ className: e, ...r }) => /* @__PURE__ */ d("ul", { className: I("cuadra-my-5 cuadra-ml-6 cuadra-list-disc [&>li]:cuadra-mt-2 font-brand", e), ...r }),
2838
+ ol: ({ className: e, ...r }) => /* @__PURE__ */ d("ol", { className: I("cuadra-my-5 cuadra-ml-6 cuadra-list-decimal [&>li]:cuadra-mt-2 font-brand", e), ...r }),
2839
+ hr: ({ className: e, ...r }) => /* @__PURE__ */ d("hr", { className: I("cuadra-my-5 cuadra-border-b", e), ...r }),
2840
+ table: ({ className: e, ...r }) => /* @__PURE__ */ d(
2845
2841
  "table",
2846
2842
  {
2847
- className: A("cuadra-my-5 cuadra-w-full cuadra-border-separate cuadra-border-spacing-0 cuadra-overflow-y-auto font-brand", e),
2843
+ className: I("cuadra-my-5 cuadra-w-full cuadra-border-separate cuadra-border-spacing-0 cuadra-overflow-y-auto font-brand", e),
2848
2844
  ...r
2849
2845
  }
2850
2846
  ),
2851
- th: ({ className: e, ...r }) => /* @__PURE__ */ h(
2847
+ th: ({ className: e, ...r }) => /* @__PURE__ */ d(
2852
2848
  "th",
2853
2849
  {
2854
- className: A(
2850
+ className: I(
2855
2851
  "cuadra-bg-muted cuadra-px-4 cuadra-py-2 cuadra-text-left cuadra-font-normal first:cuadra-rounded-tl-lg last:cuadra-rounded-tr-lg [&[align=center]]:cuadra-text-center [&[align=right]]:cuadra-text-right font-brand",
2856
2852
  e
2857
2853
  ),
2858
2854
  ...r
2859
2855
  }
2860
2856
  ),
2861
- td: ({ className: e, ...r }) => /* @__PURE__ */ h(
2857
+ td: ({ className: e, ...r }) => /* @__PURE__ */ d(
2862
2858
  "td",
2863
2859
  {
2864
- className: A(
2860
+ className: I(
2865
2861
  "cuadra-border-b cuadra-border-l cuadra-px-4 cuadra-py-2 cuadra-text-left last:cuadra-border-r [&[align=center]]:cuadra-text-center [&[align=right]]:cuadra-text-right font-brand",
2866
2862
  e
2867
2863
  ),
2868
2864
  ...r
2869
2865
  }
2870
2866
  ),
2871
- tr: ({ className: e, ...r }) => /* @__PURE__ */ h(
2867
+ tr: ({ className: e, ...r }) => /* @__PURE__ */ d(
2872
2868
  "tr",
2873
2869
  {
2874
- className: A(
2870
+ className: I(
2875
2871
  "cuadra-m-0 cuadra-border-b cuadra-p-0 first:cuadra-border-t [&:last-child>td:first-child]:cuadra-rounded-bl-lg [&:last-child>td:last-child]:cuadra-rounded-br-lg",
2876
2872
  e
2877
2873
  ),
2878
2874
  ...r
2879
2875
  }
2880
2876
  ),
2881
- sup: ({ className: e, ...r }) => /* @__PURE__ */ h("sup", { className: A("[&>a]:cuadra-text-xs [&>a]:cuadra-no-underline font-brand", e), ...r }),
2882
- pre: ({ className: e, ...r }) => /* @__PURE__ */ h(
2877
+ sup: ({ className: e, ...r }) => /* @__PURE__ */ d("sup", { className: I("[&>a]:cuadra-text-xs [&>a]:cuadra-no-underline font-brand", e), ...r }),
2878
+ pre: ({ className: e, ...r }) => /* @__PURE__ */ d(
2883
2879
  "pre",
2884
2880
  {
2885
- className: A(
2881
+ className: I(
2886
2882
  "cuadra-overflow-x-auto cuadra-rounded-b-lg !cuadra-rounded-t-none cuadra-bg-muted cuadra-p-4 cuadra-text-foreground font-brand",
2887
2883
  e
2888
2884
  ),
@@ -2890,152 +2886,153 @@ const Za = ({ content: e }) => /* @__PURE__ */ h(
2890
2886
  }
2891
2887
  ),
2892
2888
  code: function({ className: r, ...t }) {
2893
- const n = Kt();
2894
- return /* @__PURE__ */ h(
2889
+ const n = Gt();
2890
+ return /* @__PURE__ */ d(
2895
2891
  "code",
2896
2892
  {
2897
- className: A(!n && "cuadra-bg-muted cuadra-rounded cuadra-border cuadra-font-normal font-brand", r),
2893
+ className: I(!n && "cuadra-bg-muted cuadra-rounded cuadra-border cuadra-font-normal font-brand", r),
2898
2894
  ...t
2899
2895
  }
2900
2896
  );
2901
2897
  },
2902
- CodeHeader: Ja
2903
- }), Ge = [
2898
+ CodeHeader: Ya
2899
+ }), Qe = [
2904
2900
  "Sending question…",
2905
2901
  "Understanding your need…",
2906
2902
  "Scanning data…",
2907
2903
  "Comparing results…",
2908
2904
  "Composing answer…"
2909
2905
  ];
2910
- function ei({ active: e }) {
2906
+ function ri({ active: e }) {
2911
2907
  const [r, t] = N(0);
2912
- return L(() => {
2908
+ return M(() => {
2913
2909
  if (!e) {
2914
2910
  t(0);
2915
2911
  return;
2916
2912
  }
2917
2913
  const n = window.setInterval(() => {
2918
- t((i) => i >= Ge.length - 1 ? (window.clearInterval(n), i) : i + 1);
2914
+ t((i) => i >= Qe.length - 1 ? (window.clearInterval(n), i) : i + 1);
2919
2915
  }, 2500);
2920
2916
  return () => window.clearInterval(n);
2921
- }, [e]), e ? /* @__PURE__ */ T("span", { className: "cuadra-text-xs cuadra-text-muted-foreground cuadra-font-brand", children: [
2917
+ }, [e]), e ? /* @__PURE__ */ v("span", { className: "cuadra-text-xs cuadra-text-muted-foreground cuadra-font-brand", children: [
2922
2918
  "Thinking… ",
2923
- Ge[r]
2919
+ Qe[r]
2924
2920
  ] }) : null;
2925
2921
  }
2926
- function Ze({
2922
+ function Xe({
2927
2923
  welcomeTitle: e = "Hi, how can I help you today?",
2928
2924
  welcomeSubtitle: r = "Start exploring our platform and discover what you can build.",
2929
2925
  extraTopPadding: t,
2930
- suggestions: n
2926
+ suggestions: n,
2927
+ inputPlaceholder: i = "Type your message..."
2931
2928
  } = {}) {
2932
- const i = Ut(), [o, a] = N(!1), [u, l] = N(null), [s, f] = N(!1);
2933
- return L(() => {
2934
- if (!i) {
2935
- a(!1);
2929
+ const o = Wt(), [a, u] = N(!1), [l, s] = N(null), [f, c] = N(!1);
2930
+ return M(() => {
2931
+ if (!o) {
2932
+ u(!1);
2936
2933
  return;
2937
2934
  }
2938
2935
  try {
2939
- const c = i?.store;
2940
- if (!c) {
2941
- a(!1);
2936
+ const p = o?.store;
2937
+ if (!p) {
2938
+ u(!1);
2942
2939
  return;
2943
2940
  }
2944
- const p = c.subscribe?.((d) => {
2945
- const k = d?.threadId, b = d?.messages || [], x = d?.isLoadingHistory || !1, w = b.length;
2946
- k && k !== u && l(k), a(x && w === 0);
2947
- const v = b.some(
2948
- (C) => C.role === "assistant" && !!C.content && (Array.isArray(C.content) ? C.content.some((I) => typeof I == "object" && I?.text ? I.text.trim().length > 0 : !1) : typeof C.content == "string" ? C.content.trim().length > 0 : !1)
2941
+ const g = p.subscribe?.((k) => {
2942
+ const b = k?.threadId, x = k?.messages || [], w = k?.isLoadingHistory || !1, y = x.length;
2943
+ b && b !== l && s(b), u(w && y === 0);
2944
+ const T = x.some(
2945
+ (C) => C.role === "assistant" && !!C.content && (Array.isArray(C.content) ? C.content.some((L) => typeof L == "object" && L?.text ? L.text.trim().length > 0 : !1) : typeof C.content == "string" ? C.content.trim().length > 0 : !1)
2949
2946
  );
2950
- f(v);
2951
- }), g = c.getState?.();
2952
- if (g) {
2953
- const d = g?.threadId, k = g?.messages || [], b = g?.isLoadingHistory || !1, x = k.length;
2954
- d && d !== u && l(d), a(b && x === 0);
2955
- const y = k.some(
2956
- (v) => v.role === "assistant" && !!v.content && (Array.isArray(v.content) ? v.content.some((C) => typeof C == "object" && C?.text ? C.text.trim().length > 0 : !1) : typeof v.content == "string" ? v.content.trim().length > 0 : !1)
2947
+ c(T);
2948
+ }), h = p.getState?.();
2949
+ if (h) {
2950
+ const k = h?.threadId, b = h?.messages || [], x = h?.isLoadingHistory || !1, w = b.length;
2951
+ k && k !== l && s(k), u(x && w === 0);
2952
+ const A = b.some(
2953
+ (T) => T.role === "assistant" && !!T.content && (Array.isArray(T.content) ? T.content.some((C) => typeof C == "object" && C?.text ? C.text.trim().length > 0 : !1) : typeof T.content == "string" ? T.content.trim().length > 0 : !1)
2957
2954
  );
2958
- f(y);
2955
+ c(A);
2959
2956
  }
2960
2957
  return () => {
2961
- p && p();
2958
+ g && g();
2962
2959
  };
2963
2960
  } catch {
2964
- a(!1);
2961
+ u(!1);
2965
2962
  }
2966
- }, [i, u]), /* @__PURE__ */ T(te.Root, { className: "cuadra-bg-inherit cuadra-flex cuadra-flex-col cuadra-w-full cuadra-h-full", children: [
2967
- /* @__PURE__ */ h(
2968
- te.Viewport,
2963
+ }, [o, l]), /* @__PURE__ */ v(ee.Root, { className: "cuadra-bg-inherit cuadra-flex cuadra-flex-col cuadra-w-full cuadra-h-full", children: [
2964
+ /* @__PURE__ */ d(
2965
+ ee.Viewport,
2969
2966
  {
2970
2967
  className: "cuadra-w-full cuadra-bg-inherit cuadra-px-4 cuadra-flex-1 cuadra-min-h-0 cuadra-overflow-y-auto cuadra-relative scrollbar-thin cuadra-pt-4",
2971
2968
  style: t ? { paddingTop: t } : void 0,
2972
- children: o ? /* @__PURE__ */ h("div", { className: "cuadra-absolute cuadra-inset-0 cuadra-flex cuadra-items-center cuadra-justify-center", children: /* @__PURE__ */ T("div", { className: "cuadra-flex cuadra-flex-col cuadra-items-center cuadra-gap-2", children: [
2973
- /* @__PURE__ */ h(at, { className: "cuadra-h-6 cuadra-w-6 cuadra-animate-spin cuadra-text-muted-foreground" }),
2974
- /* @__PURE__ */ h("p", { className: "cuadra-text-sm cuadra-text-muted-foreground font-brand", children: "Loading messages..." })
2975
- ] }) }) : /* @__PURE__ */ T(W, { children: [
2976
- /* @__PURE__ */ h(te.Empty, { children: /* @__PURE__ */ h(
2977
- ti,
2969
+ children: a ? /* @__PURE__ */ d("div", { className: "cuadra-absolute cuadra-inset-0 cuadra-flex cuadra-items-center cuadra-justify-center", children: /* @__PURE__ */ v("div", { className: "cuadra-flex cuadra-flex-col cuadra-items-center cuadra-gap-2", children: [
2970
+ /* @__PURE__ */ d(ot, { className: "cuadra-h-6 cuadra-w-6 cuadra-animate-spin cuadra-text-muted-foreground" }),
2971
+ /* @__PURE__ */ d("p", { className: "cuadra-text-sm cuadra-text-muted-foreground font-brand", children: "Loading messages..." })
2972
+ ] }) }) : /* @__PURE__ */ v(B, { children: [
2973
+ /* @__PURE__ */ d(ee.Empty, { children: /* @__PURE__ */ d(
2974
+ ni,
2978
2975
  {
2979
2976
  title: e,
2980
2977
  subtitle: r,
2981
2978
  suggestions: n
2982
2979
  }
2983
2980
  ) }),
2984
- /* @__PURE__ */ h(
2985
- te.Messages,
2981
+ /* @__PURE__ */ d(
2982
+ ee.Messages,
2986
2983
  {
2987
2984
  components: {
2988
- UserMessage: ri,
2989
- AssistantMessage: ni
2985
+ UserMessage: ai,
2986
+ AssistantMessage: ii
2990
2987
  }
2991
2988
  }
2992
2989
  ),
2993
- /* @__PURE__ */ h(te.If, { running: !0, children: !s && /* @__PURE__ */ h("div", { className: "cuadra-mt-2 cuadra-max-w-2xl", children: /* @__PURE__ */ h(ei, { active: !0 }) }) })
2990
+ /* @__PURE__ */ d(ee.If, { running: !0, children: !f && /* @__PURE__ */ d("div", { className: "cuadra-mt-2 cuadra-max-w-2xl", children: /* @__PURE__ */ d(ri, { active: !0 }) }) })
2994
2991
  ] })
2995
2992
  }
2996
2993
  ),
2997
- /* @__PURE__ */ h("div", { className: "cuadra-w-full cuadra-mt-3 cuadra-border-t cuadra-border-border cuadra-pt-4", children: /* @__PURE__ */ T(be.Root, { className: "cuadra-relative !cuadra-relative cuadra-flex-1 cuadra-w-full", children: [
2998
- /* @__PURE__ */ h(
2999
- be.Input,
2994
+ /* @__PURE__ */ d("div", { className: "cuadra-w-full cuadra-mt-3 cuadra-border-t cuadra-border-border cuadra-pt-4", children: /* @__PURE__ */ v(ke.Root, { className: "cuadra-relative !cuadra-relative cuadra-flex-1 cuadra-w-full", children: [
2995
+ /* @__PURE__ */ d(
2996
+ ke.Input,
3000
2997
  {
3001
2998
  asChild: !0,
3002
- children: /* @__PURE__ */ h(
2999
+ children: /* @__PURE__ */ d(
3003
3000
  "textarea",
3004
3001
  {
3005
3002
  rows: 3,
3006
- placeholder: "Type your message...",
3003
+ placeholder: i,
3007
3004
  className: "cuadra-flex cuadra-min-h-[80px] cuadra-w-full cuadra-rounded-md cuadra-border cuadra-border-input cuadra-bg-background cuadra-px-3 cuadra-py-2 cuadra-text-base placeholder:cuadra-text-muted-foreground focus-visible:cuadra-outline-none disabled:cuadra-cursor-not-allowed disabled:cuadra-opacity-50 cuadra-resize-none cuadra-pr-10 font-brand",
3008
3005
  style: { paddingRight: "2.5rem", fontSize: "1rem" }
3009
3006
  }
3010
3007
  )
3011
3008
  }
3012
3009
  ),
3013
- /* @__PURE__ */ h(be.Send, { asChild: !0, children: /* @__PURE__ */ h(
3010
+ /* @__PURE__ */ d(ke.Send, { asChild: !0, children: /* @__PURE__ */ d(
3014
3011
  "button",
3015
3012
  {
3016
3013
  className: "!cuadra-absolute !cuadra-bottom-2 !cuadra-right-2 cuadra-size-8 cuadra-bg-secondary cuadra-text-secondary-foreground cuadra-rounded-md cuadra-shadow-sm hover:cuadra-bg-secondary/90 disabled:cuadra-opacity-50 disabled:cuadra-cursor-not-allowed cuadra-flex cuadra-items-center cuadra-justify-center",
3017
3014
  style: { position: "absolute", bottom: "0.5rem", right: "0.5rem" },
3018
3015
  "aria-label": "Send message",
3019
3016
  type: "button",
3020
- children: /* @__PURE__ */ h(er, { className: "cuadra-h-4 cuadra-w-4" })
3017
+ children: /* @__PURE__ */ d(rr, { className: "cuadra-h-4 cuadra-w-4" })
3021
3018
  }
3022
3019
  ) })
3023
3020
  ] }) })
3024
3021
  ] });
3025
3022
  }
3026
- function ti({ title: e, subtitle: r, suggestions: t }) {
3027
- const n = Bt(), i = async (o) => {
3023
+ function ni({ title: e, subtitle: r, suggestions: t }) {
3024
+ const n = Ht(), i = async (o) => {
3028
3025
  try {
3029
3026
  n.composer().setText(o), await new Promise((a) => setTimeout(a, 10)), n.composer().send();
3030
3027
  } catch {
3031
3028
  }
3032
3029
  };
3033
- return /* @__PURE__ */ h("div", { className: "cuadra-flex cuadra-flex-col cuadra-items-center cuadra-h-full cuadra-py-12 cuadra-px-4 cuadra-overflow-y-auto scrollbar-hide", children: /* @__PURE__ */ T("div", { className: "cuadra-text-center cuadra-max-w-3xl cuadra-w-full cuadra-flex cuadra-flex-col cuadra-items-center cuadra-justify-center cuadra-min-h-full", children: [
3034
- /* @__PURE__ */ T("div", { className: "cuadra-flex cuadra-flex-col cuadra-items-center cuadra-justify-center cuadra-mb-8", children: [
3035
- /* @__PURE__ */ h("h2", { className: "cuadra-text-lg cuadra-font-normal cuadra-text-foreground cuadra-mb-2 font-brand", children: e }),
3036
- /* @__PURE__ */ h("p", { className: "cuadra-text-muted-foreground font-brand", children: r })
3030
+ return /* @__PURE__ */ d("div", { className: "cuadra-flex cuadra-flex-col cuadra-items-center cuadra-h-full cuadra-py-12 cuadra-px-4 cuadra-overflow-y-auto scrollbar-hide", children: /* @__PURE__ */ v("div", { className: "cuadra-text-center cuadra-max-w-3xl cuadra-w-full cuadra-flex cuadra-flex-col cuadra-items-center cuadra-justify-center cuadra-min-h-full", children: [
3031
+ /* @__PURE__ */ v("div", { className: "cuadra-flex cuadra-flex-col cuadra-items-center cuadra-justify-center cuadra-mb-8", children: [
3032
+ /* @__PURE__ */ d("h2", { className: "cuadra-text-lg cuadra-font-normal cuadra-text-foreground cuadra-mb-2 font-brand", children: e }),
3033
+ /* @__PURE__ */ d("p", { className: "cuadra-text-muted-foreground font-brand", children: r })
3037
3034
  ] }),
3038
- t && t.length > 0 && /* @__PURE__ */ h("div", { className: "cuadra-grid cuadra-grid-cols-2 cuadra-gap-2 cuadra-pb-4 cuadra-w-full cuadra-max-w-2xl", children: t.map((o, a) => /* @__PURE__ */ h(
3035
+ t && t.length > 0 && /* @__PURE__ */ d("div", { className: "cuadra-grid cuadra-grid-cols-2 cuadra-gap-2 cuadra-pb-4 cuadra-w-full cuadra-max-w-2xl", children: t.map((o, a) => /* @__PURE__ */ d(
3039
3036
  "button",
3040
3037
  {
3041
3038
  type: "button",
@@ -3048,8 +3045,8 @@ function ti({ title: e, subtitle: r, suggestions: t }) {
3048
3045
  )) })
3049
3046
  ] }) });
3050
3047
  }
3051
- function ri() {
3052
- return /* @__PURE__ */ h(ce.Root, { className: "cuadra-grid cuadra-w-full cuadra-auto-rows-auto cuadra-grid-cols-[minmax(72px,1fr)_auto] cuadra-gap-y-2 cuadra-py-3 [&:where(>*)]:cuadra-col-start-2", children: /* @__PURE__ */ h(
3048
+ function ai() {
3049
+ return /* @__PURE__ */ d(se.Root, { className: "cuadra-grid cuadra-w-full cuadra-auto-rows-auto cuadra-grid-cols-[minmax(72px,1fr)_auto] cuadra-gap-y-2 cuadra-py-3 [&:where(>*)]:cuadra-col-start-2", children: /* @__PURE__ */ d(
3053
3050
  "div",
3054
3051
  {
3055
3052
  className: "cuadra-bg-muted cuadra-text-foreground cuadra-col-start-2 cuadra-row-start-2 cuadra-max-w-[calc(42rem*0.8)] cuadra-break-words cuadra-rounded-3xl cuadra-px-5 cuadra-py-2.5 font-brand",
@@ -3064,19 +3061,19 @@ function ri() {
3064
3061
  paddingBottom: "0.625rem",
3065
3062
  wordBreak: "break-word"
3066
3063
  },
3067
- children: /* @__PURE__ */ h(
3068
- ce.Parts,
3064
+ children: /* @__PURE__ */ d(
3065
+ se.Parts,
3069
3066
  {
3070
3067
  components: {
3071
- Text: ({ text: e }) => /* @__PURE__ */ h(Rt, { content: e || "" })
3068
+ Text: ({ text: e }) => /* @__PURE__ */ d(_t, { content: e || "" })
3072
3069
  }
3073
3070
  }
3074
3071
  )
3075
3072
  }
3076
3073
  ) });
3077
3074
  }
3078
- function ni() {
3079
- return /* @__PURE__ */ h(ce.Root, { className: "cuadra-relative cuadra-grid cuadra-w-full cuadra-grid-cols-[auto_auto_1fr] cuadra-grid-rows-[auto_1fr] cuadra-py-3", children: /* @__PURE__ */ h(
3075
+ function ii() {
3076
+ return /* @__PURE__ */ d(se.Root, { className: "cuadra-relative cuadra-grid cuadra-w-full cuadra-grid-cols-[auto_auto_1fr] cuadra-grid-rows-[auto_1fr] cuadra-py-3", children: /* @__PURE__ */ d(
3080
3077
  "div",
3081
3078
  {
3082
3079
  className: "cuadra-text-foreground cuadra-col-span-2 cuadra-col-start-2 cuadra-row-start-1 cuadra-my-1.5 cuadra-max-w-[90%] cuadra-break-words cuadra-leading-7 font-brand",
@@ -3085,49 +3082,49 @@ function ni() {
3085
3082
  marginTop: "0.375rem",
3086
3083
  marginBottom: "0.375rem"
3087
3084
  },
3088
- children: /* @__PURE__ */ h(
3089
- ce.Parts,
3085
+ children: /* @__PURE__ */ d(
3086
+ se.Parts,
3090
3087
  {
3091
3088
  components: {
3092
- Text: ({ text: e }) => /* @__PURE__ */ h(Rt, { content: e || "" })
3089
+ Text: ({ text: e }) => /* @__PURE__ */ d(_t, { content: e || "" })
3093
3090
  }
3094
3091
  }
3095
3092
  )
3096
3093
  }
3097
3094
  ) });
3098
3095
  }
3099
- function ai({ onThreadSelect: e }) {
3100
- const r = Wt(), t = Ht((b) => b.threadId), [n, i] = N(null), o = r?.id === t, a = n === r?.id, [u, l] = N(!1), [s, f] = N(r?.title || ""), [c, p] = N(!1), [g, d] = N(!1), k = async () => {
3096
+ function oi({ onThreadSelect: e }) {
3097
+ const r = qt(), t = Kt((b) => b.threadId), [n, i] = N(null), o = r?.id === t, a = n === r?.id, [u, l] = N(!1), [s, f] = N(r?.title || ""), [c, p] = N(!1), [g, h] = N(!1), k = async () => {
3101
3098
  if (!r?.remoteId || !s || s === r.title) {
3102
3099
  l(!1);
3103
3100
  return;
3104
3101
  }
3105
3102
  try {
3106
- d(!0);
3103
+ h(!0);
3107
3104
  const b = window.__cuadraThreadListAdapter;
3108
3105
  b && typeof b.rename == "function" && await b.rename(r.remoteId, s), l(!1), p(!1);
3109
3106
  } catch {
3110
3107
  l(!1), p(!1);
3111
3108
  } finally {
3112
- d(!1);
3109
+ h(!1);
3113
3110
  }
3114
3111
  };
3115
- return L(() => {
3112
+ return M(() => {
3116
3113
  r?.title && !u && f(r.title);
3117
- }, [r?.title, u]), r ? /* @__PURE__ */ h(
3118
- xe.Root,
3114
+ }, [r?.title, u]), r ? /* @__PURE__ */ d(
3115
+ we.Root,
3119
3116
  {
3120
3117
  className: `group cuadra-relative cuadra-flex cuadra-items-center cuadra-gap-3 cuadra-rounded-lg cuadra-transition-colors cuadra-cursor-pointer cuadra-border cuadra-mb-2 ${o ? "cuadra-bg-muted cuadra-border-border" : "cuadra-border-transparent hover:cuadra-bg-muted hover:cuadra-border-border"}`,
3121
3118
  style: { marginBottom: "0.5rem" },
3122
3119
  onMouseEnter: () => i(r.id),
3123
3120
  onMouseLeave: () => i(null),
3124
- children: /* @__PURE__ */ T(
3125
- xe.Trigger,
3121
+ children: /* @__PURE__ */ v(
3122
+ we.Trigger,
3126
3123
  {
3127
3124
  className: "cuadra-p-3 cuadra-flex-1 cuadra-flex cuadra-items-center cuadra-justify-between cuadra-w-full cuadra-min-w-0 cuadra-cursor-pointer",
3128
3125
  onClick: () => e?.(),
3129
3126
  children: [
3130
- /* @__PURE__ */ h("div", { className: "cuadra-flex cuadra-flex-col cuadra-min-w-0 cuadra-flex-1 cuadra-items-start cuadra-text-left", children: u ? /* @__PURE__ */ h(
3127
+ /* @__PURE__ */ d("div", { className: "cuadra-flex cuadra-flex-col cuadra-min-w-0 cuadra-flex-1 cuadra-items-start cuadra-text-left", children: u ? /* @__PURE__ */ d(
3131
3128
  "input",
3132
3129
  {
3133
3130
  className: "cuadra-flex cuadra-w-full cuadra-rounded-md cuadra-border cuadra-border-input cuadra-bg-background cuadra-px-3 cuadra-py-2 cuadra-text-sm placeholder:cuadra-text-muted-foreground focus-visible:cuadra-outline-none disabled:cuadra-cursor-not-allowed disabled:cuadra-opacity-50 font-brand",
@@ -3140,12 +3137,12 @@ function ai({ onThreadSelect: e }) {
3140
3137
  autoFocus: !0,
3141
3138
  onClick: (b) => b.stopPropagation()
3142
3139
  }
3143
- ) : /* @__PURE__ */ T(W, { children: [
3144
- /* @__PURE__ */ h("span", { className: "cuadra-text-sm cuadra-font-normal cuadra-text-foreground cuadra-truncate font-brand", children: (r.title?.length || 0) > 60 ? `${r.title?.slice(0, 60)}…` : r.title || "Chat" }),
3145
- r.updatedAt && /* @__PURE__ */ h("span", { className: "cuadra-text-xs cuadra-text-muted-foreground cuadra-mt-1 font-brand", children: new Date(r.updatedAt).toLocaleDateString() })
3140
+ ) : /* @__PURE__ */ v(B, { children: [
3141
+ /* @__PURE__ */ d("span", { className: "cuadra-text-sm cuadra-font-normal cuadra-text-foreground cuadra-truncate font-brand", children: (r.title?.length || 0) > 60 ? `${r.title?.slice(0, 60)}…` : r.title || "Chat" }),
3142
+ r.updatedAt && /* @__PURE__ */ d("span", { className: "cuadra-text-xs cuadra-text-muted-foreground cuadra-mt-1 font-brand", children: new Date(r.updatedAt).toLocaleDateString() })
3146
3143
  ] }) }),
3147
- /* @__PURE__ */ h("div", { className: "cuadra-ml-2 cuadra-flex-shrink-0 cuadra-w-6 cuadra-h-6 cuadra-flex cuadra-items-center cuadra-justify-center", children: (a || o || c) && /* @__PURE__ */ T("div", { className: "cuadra-relative", children: [
3148
- /* @__PURE__ */ h(
3144
+ /* @__PURE__ */ d("div", { className: "cuadra-ml-2 cuadra-flex-shrink-0 cuadra-w-6 cuadra-h-6 cuadra-flex cuadra-items-center cuadra-justify-center", children: (a || o || c) && /* @__PURE__ */ v("div", { className: "cuadra-relative", children: [
3145
+ /* @__PURE__ */ d(
3149
3146
  "button",
3150
3147
  {
3151
3148
  className: "cuadra-p-1 cuadra-rounded hover:cuadra-bg-background/50 cuadra-transition-colors",
@@ -3153,18 +3150,18 @@ function ai({ onThreadSelect: e }) {
3153
3150
  b.stopPropagation(), p(!c);
3154
3151
  },
3155
3152
  "aria-label": "Thread options",
3156
- children: /* @__PURE__ */ h(sr, { className: "cuadra-h-4 cuadra-w-4 cuadra-text-muted-foreground" })
3153
+ children: /* @__PURE__ */ d(fr, { className: "cuadra-h-4 cuadra-w-4 cuadra-text-muted-foreground" })
3157
3154
  }
3158
3155
  ),
3159
- c && /* @__PURE__ */ T(W, { children: [
3160
- /* @__PURE__ */ h(
3156
+ c && /* @__PURE__ */ v(B, { children: [
3157
+ /* @__PURE__ */ d(
3161
3158
  "div",
3162
3159
  {
3163
3160
  className: "cuadra-fixed cuadra-inset-0 cuadra-z-40",
3164
3161
  onClick: () => p(!1)
3165
3162
  }
3166
3163
  ),
3167
- /* @__PURE__ */ h("div", { className: "cuadra-absolute cuadra-right-0 cuadra-top-8 cuadra-z-50 cuadra-bg-background cuadra-border cuadra-border-border cuadra-rounded-lg cuadra-shadow-lg cuadra-min-w-[120px] cuadra-overflow-hidden", children: u ? /* @__PURE__ */ h(
3164
+ /* @__PURE__ */ d("div", { className: "cuadra-absolute cuadra-right-0 cuadra-top-8 cuadra-z-50 cuadra-bg-background cuadra-border cuadra-border-border cuadra-rounded-lg cuadra-shadow-lg cuadra-min-w-[120px] cuadra-overflow-hidden", children: u ? /* @__PURE__ */ d(
3168
3165
  "button",
3169
3166
  {
3170
3167
  className: "cuadra-w-full cuadra-px-3 cuadra-py-2 cuadra-text-sm cuadra-text-left hover:cuadra-bg-muted cuadra-transition-colors font-brand",
@@ -3174,8 +3171,8 @@ function ai({ onThreadSelect: e }) {
3174
3171
  disabled: g,
3175
3172
  children: "Save"
3176
3173
  }
3177
- ) : /* @__PURE__ */ T(W, { children: [
3178
- /* @__PURE__ */ h(
3174
+ ) : /* @__PURE__ */ v(B, { children: [
3175
+ /* @__PURE__ */ d(
3179
3176
  "button",
3180
3177
  {
3181
3178
  className: "cuadra-w-full cuadra-px-3 cuadra-py-2 cuadra-text-sm cuadra-text-left hover:cuadra-bg-muted cuadra-transition-colors font-brand",
@@ -3185,8 +3182,8 @@ function ai({ onThreadSelect: e }) {
3185
3182
  children: "Rename"
3186
3183
  }
3187
3184
  ),
3188
- /* @__PURE__ */ h("div", { className: "cuadra-border-t cuadra-border-border" }),
3189
- /* @__PURE__ */ h(xe.Delete, { asChild: !0, children: /* @__PURE__ */ h(
3185
+ /* @__PURE__ */ d("div", { className: "cuadra-border-t cuadra-border-border" }),
3186
+ /* @__PURE__ */ d(we.Delete, { asChild: !0, children: /* @__PURE__ */ d(
3190
3187
  "button",
3191
3188
  {
3192
3189
  className: "cuadra-w-full cuadra-px-3 cuadra-py-2 cuadra-text-sm cuadra-text-left cuadra-text-destructive hover:cuadra-bg-muted cuadra-transition-colors font-brand",
@@ -3205,38 +3202,38 @@ function ai({ onThreadSelect: e }) {
3205
3202
  }
3206
3203
  ) : null;
3207
3204
  }
3208
- function Je({ onThreadSelect: e }) {
3209
- return /* @__PURE__ */ T(ke.Root, { className: "!cuadra-border-r cuadra-border-border cuadra-flex cuadra-flex-col cuadra-bg-background cuadra-transition-all cuadra-duration-300 cuadra-ease-in-out cuadra-h-full cuadra-w-80", style: { borderRightWidth: "1px" }, children: [
3210
- /* @__PURE__ */ h("div", { className: "cuadra-border-b cuadra-border-border cuadra-flex cuadra-items-center cuadra-justify-between cuadra-transition-all cuadra-duration-300 cuadra-h-16 cuadra-px-4", children: /* @__PURE__ */ h("h3", { className: "cuadra-text-sm cuadra-font-normal cuadra-text-foreground cuadra-text-nowrap font-brand", children: "Chat History" }) }),
3211
- /* @__PURE__ */ T("div", { className: "cuadra-flex-1 cuadra-overflow-y-auto cuadra-p-2 scrollbar-thin", children: [
3212
- /* @__PURE__ */ h(
3213
- ke.New,
3205
+ function Ye({ onThreadSelect: e }) {
3206
+ return /* @__PURE__ */ v(xe.Root, { className: "!cuadra-border-r cuadra-border-border cuadra-flex cuadra-flex-col cuadra-bg-background cuadra-transition-all cuadra-duration-300 cuadra-ease-in-out cuadra-h-full cuadra-w-80", style: { borderRightWidth: "1px" }, children: [
3207
+ /* @__PURE__ */ d("div", { className: "cuadra-border-b cuadra-border-border cuadra-flex cuadra-items-center cuadra-justify-between cuadra-transition-all cuadra-duration-300 cuadra-h-16 cuadra-px-4", children: /* @__PURE__ */ d("h3", { className: "cuadra-text-sm cuadra-font-normal cuadra-text-foreground cuadra-text-nowrap font-brand", children: "Chat History" }) }),
3208
+ /* @__PURE__ */ v("div", { className: "cuadra-flex-1 cuadra-overflow-y-auto cuadra-p-2 scrollbar-thin", children: [
3209
+ /* @__PURE__ */ d(
3210
+ xe.New,
3214
3211
  {
3215
3212
  className: "group cuadra-relative cuadra-flex cuadra-items-center cuadra-gap-3 cuadra-p-3 cuadra-rounded-lg cuadra-cursor-pointer cuadra-transition-colors cuadra-border cuadra-border-transparent hover:cuadra-bg-muted hover:cuadra-border-border",
3216
3213
  onClick: () => e?.(),
3217
- children: /* @__PURE__ */ h("div", { className: "cuadra-flex-1 cuadra-min-w-0", children: /* @__PURE__ */ T("div", { className: "cuadra-flex cuadra-items-center cuadra-gap-2", children: [
3218
- /* @__PURE__ */ h(pr, { className: "cuadra-h-4 cuadra-w-4 cuadra-text-muted-foreground" }),
3219
- /* @__PURE__ */ h("h4", { className: "cuadra-text-sm cuadra-font-normal cuadra-text-foreground font-brand", children: "New Chat" })
3214
+ children: /* @__PURE__ */ d("div", { className: "cuadra-flex-1 cuadra-min-w-0", children: /* @__PURE__ */ v("div", { className: "cuadra-flex cuadra-items-center cuadra-gap-2", children: [
3215
+ /* @__PURE__ */ d(br, { className: "cuadra-h-4 cuadra-w-4 cuadra-text-muted-foreground" }),
3216
+ /* @__PURE__ */ d("h4", { className: "cuadra-text-sm cuadra-font-normal cuadra-text-foreground font-brand", children: "New Chat" })
3220
3217
  ] }) })
3221
3218
  }
3222
3219
  ),
3223
- /* @__PURE__ */ h("div", { className: "cuadra-my-2 cuadra-border-t cuadra-border-border" }),
3224
- /* @__PURE__ */ h(
3225
- ke.Items,
3220
+ /* @__PURE__ */ d("div", { className: "cuadra-my-2 cuadra-border-t cuadra-border-border" }),
3221
+ /* @__PURE__ */ d(
3222
+ xe.Items,
3226
3223
  {
3227
3224
  components: {
3228
- ThreadListItem: (r) => /* @__PURE__ */ h(ai, { ...r, onThreadSelect: e })
3225
+ ThreadListItem: (r) => /* @__PURE__ */ d(oi, { ...r, onThreadSelect: e })
3229
3226
  }
3230
3227
  }
3231
3228
  )
3232
3229
  ] })
3233
3230
  ] });
3234
3231
  }
3235
- const ii = `
3232
+ const li = `
3236
3233
  @keyframes rotate {
3237
3234
  100% { transform: rotate(1turn); }
3238
3235
  }
3239
- `, Te = ({
3236
+ `, Ae = ({
3240
3237
  children: e,
3241
3238
  className: r = "",
3242
3239
  paddingX: t = "px-0",
@@ -3245,15 +3242,15 @@ const ii = `
3245
3242
  style: o,
3246
3243
  contentStyle: a,
3247
3244
  rotating: u = !1
3248
- }) => /* @__PURE__ */ T(W, { children: [
3249
- /* @__PURE__ */ h("style", { children: ii }),
3250
- /* @__PURE__ */ T(
3245
+ }) => /* @__PURE__ */ v(B, { children: [
3246
+ /* @__PURE__ */ d("style", { children: li }),
3247
+ /* @__PURE__ */ v(
3251
3248
  "div",
3252
3249
  {
3253
3250
  className: `cuadra-relative cuadra-bg-background md:cuadra-rounded-xl cuadra-overflow-hidden ${r}`,
3254
3251
  style: { padding: i, ...o },
3255
3252
  children: [
3256
- /* @__PURE__ */ h(
3253
+ /* @__PURE__ */ d(
3257
3254
  "div",
3258
3255
  {
3259
3256
  className: "cuadra-absolute md:cuadra-rounded-xl",
@@ -3279,7 +3276,7 @@ const ii = `
3279
3276
  }
3280
3277
  }
3281
3278
  ),
3282
- /* @__PURE__ */ h(
3279
+ /* @__PURE__ */ d(
3283
3280
  "div",
3284
3281
  {
3285
3282
  className: `cuadra-relative cuadra-bg-background cuadra-h-full cuadra-z-10 cuadra-flex cuadra-flex-col cuadra-overflow-hidden ${t} ${n}`,
@@ -3293,7 +3290,7 @@ const ii = `
3293
3290
  ]
3294
3291
  }
3295
3292
  )
3296
- ] }), oi = ({ className: e = "", theme: r = "system" }) => {
3293
+ ] }), ui = ({ className: e = "", theme: r = "system" }) => {
3297
3294
  const t = () => {
3298
3295
  if (typeof window > "u") return "light";
3299
3296
  if (r === "system") {
@@ -3302,12 +3299,12 @@ const ii = `
3302
3299
  }
3303
3300
  return r;
3304
3301
  }, [n, i] = N(t);
3305
- return L(() => {
3302
+ return M(() => {
3306
3303
  r !== "system" && i(r);
3307
- }, [r]), L(() => {
3304
+ }, [r]), M(() => {
3308
3305
  const a = document.documentElement;
3309
3306
  a.classList.remove("light", "dark"), a.classList.add(n), r === "system" && localStorage.setItem("theme", n);
3310
- }, [n, r]), /* @__PURE__ */ h(
3307
+ }, [n, r]), /* @__PURE__ */ d(
3311
3308
  "button",
3312
3309
  {
3313
3310
  type: "button",
@@ -3317,15 +3314,15 @@ const ii = `
3317
3314
  },
3318
3315
  disabled: r !== "system",
3319
3316
  className: `cuadra-flex cuadra-items-center cuadra-justify-center cuadra-h-8 cuadra-w-8 cuadra-rounded-full cuadra-bg-muted hover:cuadra-bg-muted/80 cuadra-transition-colors disabled:cuadra-opacity-50 disabled:cuadra-cursor-not-allowed ${e}`,
3320
- children: /* @__PURE__ */ h(
3321
- or,
3317
+ children: /* @__PURE__ */ d(
3318
+ ur,
3322
3319
  {
3323
3320
  className: `cuadra-h-4 cuadra-w-4 cuadra-transition-colors ${n === "dark" ? "cuadra-text-primary" : "cuadra-text-gray-400"}`
3324
3321
  }
3325
3322
  )
3326
3323
  }
3327
3324
  );
3328
- }, Qe = ({
3325
+ }, et = ({
3329
3326
  currentModel: e,
3330
3327
  models: r,
3331
3328
  modelsLoading: t,
@@ -3337,34 +3334,34 @@ const ii = `
3337
3334
  onMobileMenuClick: l,
3338
3335
  showMobileMenuButton: s = !1
3339
3336
  }) => {
3340
- const [f, c] = N(!1), p = et(null);
3341
- L(() => {
3342
- const d = (k) => {
3337
+ const [f, c] = N(!1), p = rt(null);
3338
+ M(() => {
3339
+ const h = (k) => {
3343
3340
  p.current && !p.current.contains(k.target) && c(!1);
3344
3341
  };
3345
- return f && document.addEventListener("mousedown", d), () => {
3346
- document.removeEventListener("mousedown", d);
3342
+ return f && document.addEventListener("mousedown", h), () => {
3343
+ document.removeEventListener("mousedown", h);
3347
3344
  };
3348
3345
  }, [f]);
3349
- const g = r.find((d) => d.id === e);
3350
- return /* @__PURE__ */ T("div", { className: "cuadra-h-16 cuadra-px-4 cuadra-border-b cuadra-border-border cuadra-flex cuadra-items-center cuadra-justify-between cuadra-bg-background", children: [
3351
- /* @__PURE__ */ T("div", { className: "cuadra-flex cuadra-items-center cuadra-gap-2", children: [
3352
- s && /* @__PURE__ */ h(
3346
+ const g = r.find((h) => h.id === e);
3347
+ return /* @__PURE__ */ v("div", { className: "cuadra-h-16 cuadra-px-4 cuadra-border-b cuadra-border-border cuadra-flex cuadra-items-center cuadra-justify-between cuadra-bg-background", children: [
3348
+ /* @__PURE__ */ v("div", { className: "cuadra-flex cuadra-items-center cuadra-gap-2", children: [
3349
+ s && /* @__PURE__ */ d(
3353
3350
  "button",
3354
3351
  {
3355
3352
  type: "button",
3356
3353
  onClick: l,
3357
3354
  className: "cuadra-flex cuadra-items-center cuadra-justify-center cuadra-h-8 cuadra-w-8 cuadra-rounded-full cuadra-bg-muted hover:cuadra-bg-muted/80 cuadra-transition-colors disabled:cuadra-opacity-50 disabled:cuadra-cursor-not-allowed md:cuadra-hidden",
3358
3355
  "aria-label": "Toggle thread list",
3359
- children: /* @__PURE__ */ h(hr, { className: "cuadra-h-4 cuadra-w-4 cuadra-text-foreground" })
3356
+ children: /* @__PURE__ */ d(pr, { className: "cuadra-h-4 cuadra-w-4 cuadra-text-foreground" })
3360
3357
  }
3361
3358
  ),
3362
- a && /* @__PURE__ */ h("div", { className: "cuadra-flex cuadra-items-center cuadra-gap-2", children: /* @__PURE__ */ h(oi, { theme: u }) })
3359
+ a && /* @__PURE__ */ d("div", { className: "cuadra-flex cuadra-items-center cuadra-gap-2", children: /* @__PURE__ */ d(ui, { theme: u }) })
3363
3360
  ] }),
3364
- /* @__PURE__ */ T("div", { className: "cuadra-flex cuadra-items-center cuadra-gap-2 md:cuadra-ml-0 cuadra-ml-auto", children: [
3365
- !o && /* @__PURE__ */ h("label", { className: "cuadra-hidden md:cuadra-inline cuadra-text-sm cuadra-text-muted-foreground cuadra-font-brand", children: "Model" }),
3366
- o ? null : t ? /* @__PURE__ */ h("div", { className: "cuadra-w-48 cuadra-rounded-md cuadra-border cuadra-border-border cuadra-px-3 cuadra-py-2 cuadra-bg-muted", children: /* @__PURE__ */ h("span", { className: "cuadra-text-muted-foreground cuadra-text-sm cuadra-font-brand", children: "Loading..." }) }) : n ? /* @__PURE__ */ h("div", { className: "cuadra-w-48 cuadra-rounded-md cuadra-border cuadra-border-destructive cuadra-px-3 cuadra-py-2 cuadra-bg-destructive/10", children: /* @__PURE__ */ h("span", { className: "cuadra-text-destructive cuadra-text-sm cuadra-font-brand", children: "Failed to load models" }) }) : /* @__PURE__ */ T("div", { ref: p, className: "cuadra-relative cuadra-w-48", children: [
3367
- /* @__PURE__ */ T(
3361
+ /* @__PURE__ */ v("div", { className: "cuadra-flex cuadra-items-center cuadra-gap-2 md:cuadra-ml-0 cuadra-ml-auto", children: [
3362
+ !o && /* @__PURE__ */ d("label", { className: "cuadra-hidden md:cuadra-inline cuadra-text-sm cuadra-text-muted-foreground cuadra-font-brand", children: "Model" }),
3363
+ o ? null : t ? /* @__PURE__ */ d("div", { className: "cuadra-w-48 cuadra-rounded-md cuadra-border cuadra-border-border cuadra-px-3 cuadra-py-2 cuadra-bg-muted", children: /* @__PURE__ */ d("span", { className: "cuadra-text-muted-foreground cuadra-text-sm cuadra-font-brand", children: "Loading..." }) }) : n ? /* @__PURE__ */ d("div", { className: "cuadra-w-48 cuadra-rounded-md cuadra-border cuadra-border-destructive cuadra-px-3 cuadra-py-2 cuadra-bg-destructive/10", children: /* @__PURE__ */ d("span", { className: "cuadra-text-destructive cuadra-text-sm cuadra-font-brand", children: "Failed to load models" }) }) : /* @__PURE__ */ v("div", { ref: p, className: "cuadra-relative cuadra-w-48", children: [
3364
+ /* @__PURE__ */ v(
3368
3365
  "button",
3369
3366
  {
3370
3367
  type: "button",
@@ -3372,21 +3369,21 @@ const ii = `
3372
3369
  disabled: t || r.length === 0 || !!n,
3373
3370
  className: "cuadra-flex cuadra-h-10 cuadra-w-full cuadra-items-center cuadra-justify-between cuadra-rounded-md cuadra-border cuadra-border-input cuadra-bg-background cuadra-px-3 cuadra-py-2 cuadra-text-sm placeholder:cuadra-text-muted-foreground focus:cuadra-outline-none disabled:cuadra-cursor-not-allowed disabled:cuadra-opacity-50 cuadra-font-brand",
3374
3371
  children: [
3375
- /* @__PURE__ */ h("span", { className: g ? "cuadra-text-foreground" : "cuadra-text-muted-foreground", children: g?.name || "Select model" }),
3376
- /* @__PURE__ */ h(ar, { className: "cuadra-ml-2 cuadra-h-4 cuadra-w-4 cuadra-opacity-50" })
3372
+ /* @__PURE__ */ d("span", { className: g ? "cuadra-text-foreground" : "cuadra-text-muted-foreground", children: g?.name || "Select model" }),
3373
+ /* @__PURE__ */ d(or, { className: "cuadra-ml-2 cuadra-h-4 cuadra-w-4 cuadra-opacity-50" })
3377
3374
  ]
3378
3375
  }
3379
3376
  ),
3380
- f && r.length > 0 && /* @__PURE__ */ h("div", { className: "cuadra-absolute cuadra-z-50 cuadra-mt-1 cuadra-w-full cuadra-min-w-[8rem] cuadra-overflow-hidden cuadra-rounded-md glass-popover cuadra-text-popover-foreground cuadra-animate-in fade-in-80 cuadra-border cuadra-border-border cuadra-bg-popover cuadra-shadow-md", children: /* @__PURE__ */ h("div", { className: "cuadra-p-1", children: r.map((d) => /* @__PURE__ */ T(
3377
+ f && r.length > 0 && /* @__PURE__ */ d("div", { className: "cuadra-absolute cuadra-z-50 cuadra-mt-1 cuadra-w-full cuadra-min-w-[8rem] cuadra-overflow-hidden cuadra-rounded-md glass-popover cuadra-text-popover-foreground cuadra-animate-in fade-in-80 cuadra-border cuadra-border-border cuadra-bg-popover cuadra-shadow-md", children: /* @__PURE__ */ d("div", { className: "cuadra-p-1", children: r.map((h) => /* @__PURE__ */ v(
3381
3378
  "button",
3382
3379
  {
3383
3380
  type: "button",
3384
3381
  onClick: () => {
3385
- i(d.id), c(!1);
3382
+ i(h.id), c(!1);
3386
3383
  },
3387
- className: `cuadra-relative cuadra-flex cuadra-w-full cuadra-cursor-pointer cuadra-select-none cuadra-items-center cuadra-rounded-sm cuadra-py-1.5 cuadra-pl-8 cuadra-pr-2 cuadra-text-sm cuadra-outline-none focus:cuadra-bg-secondary focus:cuadra-text-secondary-foreground font-brand cuadra-transition-colors ${e === d.id ? "cuadra-bg-secondary cuadra-text-secondary-foreground" : "hover:cuadra-bg-secondary/50"}`,
3384
+ className: `cuadra-relative cuadra-flex cuadra-w-full cuadra-cursor-pointer cuadra-select-none cuadra-items-center cuadra-rounded-sm cuadra-py-1.5 cuadra-pl-8 cuadra-pr-2 cuadra-text-sm cuadra-outline-none focus:cuadra-bg-secondary focus:cuadra-text-secondary-foreground font-brand cuadra-transition-colors ${e === h.id ? "cuadra-bg-secondary cuadra-text-secondary-foreground" : "hover:cuadra-bg-secondary/50"}`,
3388
3385
  children: [
3389
- e === d.id && /* @__PURE__ */ h("span", { className: "cuadra-absolute cuadra-left-2 cuadra-flex cuadra-h-3.5 cuadra-w-3.5 cuadra-items-center cuadra-justify-center", children: /* @__PURE__ */ h(
3386
+ e === h.id && /* @__PURE__ */ d("span", { className: "cuadra-absolute cuadra-left-2 cuadra-flex cuadra-h-3.5 cuadra-w-3.5 cuadra-items-center cuadra-justify-center", children: /* @__PURE__ */ d(
3390
3387
  "svg",
3391
3388
  {
3392
3389
  xmlns: "http://www.w3.org/2000/svg",
@@ -3394,7 +3391,7 @@ const ii = `
3394
3391
  height: "16",
3395
3392
  fill: "none",
3396
3393
  viewBox: "0 0 16 16",
3397
- children: /* @__PURE__ */ h(
3394
+ children: /* @__PURE__ */ d(
3398
3395
  "path",
3399
3396
  {
3400
3397
  fill: "currentColor",
@@ -3405,17 +3402,17 @@ const ii = `
3405
3402
  )
3406
3403
  }
3407
3404
  ) }),
3408
- /* @__PURE__ */ h("span", { children: d.name })
3405
+ /* @__PURE__ */ d("span", { children: h.name })
3409
3406
  ]
3410
3407
  },
3411
- d.id
3408
+ h.id
3412
3409
  )) }) })
3413
3410
  ] })
3414
3411
  ] })
3415
3412
  ] });
3416
- }, li = $t(void 0), Ie = ({ children: e, value: r }) => /* @__PURE__ */ h(li.Provider, { value: r, children: e });
3417
- function ui() {
3418
- L(() => {
3413
+ }, ci = Ut(void 0), Ie = ({ children: e, value: r }) => /* @__PURE__ */ d(ci.Provider, { value: r, children: e });
3414
+ function si() {
3415
+ M(() => {
3419
3416
  if (document.querySelector("style[data-cuadra-uikit]"))
3420
3417
  return;
3421
3418
  const r = document.createElement("div");
@@ -3437,8 +3434,8 @@ function ui() {
3437
3434
  }, document.head.appendChild(n), o) break;
3438
3435
  }, []);
3439
3436
  }
3440
- const ci = ({ config: e }) => {
3441
- ui();
3437
+ const di = ({ config: e }) => {
3438
+ si();
3442
3439
  const {
3443
3440
  baseUrl: r,
3444
3441
  proxyUrl: t,
@@ -3453,43 +3450,45 @@ const ci = ({ config: e }) => {
3453
3450
  welcomeTitle: c,
3454
3451
  welcomeSubtitle: p,
3455
3452
  extraTopPadding: g,
3456
- suggestions: d,
3457
- showThemeToggle: k = !0,
3458
- theme: b = "system",
3459
- onError: x,
3460
- onChatCreated: w,
3461
- onThreadIdUpdate: y
3462
- } = e, [v, C] = N(!1), I = t || r || "", D = !!t, U = H(
3463
- () => new it(I, n || void 0, D, e.tenantId),
3464
- [I, n, D, e.tenantId]
3465
- ), [$, m] = N(null), [P, Z] = N(!1), [O, J] = N(null), [Et, Re] = N(!1);
3466
- L(() => {
3467
- i === "multiChat" && Re(!0);
3453
+ suggestions: h,
3454
+ inputPlaceholder: k,
3455
+ showThemeToggle: b = !0,
3456
+ theme: x = "system",
3457
+ onError: w,
3458
+ onChatCreated: y,
3459
+ onUserMessage: A,
3460
+ onThreadIdUpdate: T
3461
+ } = e, [C, L] = N(!1), E = t || r || "", q = !!t, m = W(
3462
+ () => new lt(E, n || void 0, q),
3463
+ [E, n, q]
3464
+ ), [P, ie] = N(null), [O, J] = N(!1), [Q, Ee] = N(null), [Ft, _e] = N(!1);
3465
+ M(() => {
3466
+ i === "multiChat" && _e(!0);
3468
3467
  }, [i]);
3469
- const K = re(async () => {
3468
+ const K = te(async () => {
3470
3469
  if (o === "selector") {
3471
- Z(!0), J(null);
3470
+ J(!0), Ee(null);
3472
3471
  try {
3473
- const S = await U.listModels();
3474
- m(S);
3472
+ const S = await m.listModels();
3473
+ ie(S);
3475
3474
  } catch (S) {
3476
- J(S instanceof Error ? S : new Error("Failed to load models"));
3475
+ Ee(S instanceof Error ? S : new Error("Failed to load models"));
3477
3476
  } finally {
3478
- Z(!1);
3477
+ J(!1);
3479
3478
  }
3480
3479
  }
3481
- }, [U, o]);
3482
- L(() => {
3480
+ }, [m, o]);
3481
+ M(() => {
3483
3482
  o === "selector" && K();
3484
- }, [o, K]), L(() => (typeof window < "u" && (window.__cuadraUIKitRefetchModels = K), () => {
3483
+ }, [o, K]), M(() => (typeof window < "u" && (window.__cuadraUIKitRefetchModels = K), () => {
3485
3484
  typeof window < "u" && delete window.__cuadraUIKitRefetchModels;
3486
3485
  }), [K]);
3487
- const [E, Ee] = N(
3486
+ const [_, Fe] = N(
3488
3487
  o === "fixed" && a || null
3489
- ), _e = et(E), Q = re(
3488
+ ), ze = rt(_), X = te(
3490
3489
  (S) => {
3491
- const Y = _e.current;
3492
- Ee(S), _e.current = S, u?.(S), Y !== null && Y !== S && i === "multiChat" && setTimeout(() => {
3490
+ const Y = ze.current;
3491
+ Fe(S), ze.current = S, u?.(S), Y !== null && Y !== S && i === "multiChat" && setTimeout(() => {
3493
3492
  const V = window.__cuadraThreadListRuntime;
3494
3493
  if (V?.threads?.switchToNewThread)
3495
3494
  try {
@@ -3510,134 +3509,135 @@ const ci = ({ config: e }) => {
3510
3509
  },
3511
3510
  [u, i]
3512
3511
  );
3513
- L(() => {
3514
- if (o === "selector" && $?.items && $.items.length > 0 && !E) {
3515
- const S = $.items[0];
3512
+ M(() => {
3513
+ if (o === "selector" && P?.items && P.items.length > 0 && !_) {
3514
+ const S = P.items[0];
3516
3515
  if (S?.id) {
3517
3516
  const Y = S.id;
3518
- Ee(Y), u?.(Y);
3517
+ Fe(Y), u?.(Y);
3519
3518
  }
3520
3519
  }
3521
- }, [o, $?.items, E, u]);
3522
- const _t = o === "fixed" ? !!a : !!E, oe = H(
3523
- () => ($?.items || []).filter((S) => S?.id && S?.displayName).map((S) => ({ id: S.id, name: S.displayName })),
3524
- [$]
3525
- ), ge = H(
3520
+ }, [o, P?.items, _, u]);
3521
+ const zt = o === "fixed" ? !!a : !!_, oe = W(
3522
+ () => (P?.items || []).filter((S) => S?.id && S?.displayName).map((S) => ({ id: S.id, name: S.displayName })),
3523
+ [P]
3524
+ ), be = W(
3526
3525
  () => ({
3527
- currentModelId: E || "",
3526
+ currentModelId: _ || "",
3528
3527
  models: oe,
3529
- modelsLoading: P,
3530
- modelsError: O,
3531
- onModelChange: Q,
3528
+ modelsLoading: O,
3529
+ modelsError: Q,
3530
+ onModelChange: X,
3532
3531
  refetchModels: K
3533
3532
  }),
3534
- [E, oe, P, O, Q, K]
3533
+ [_, oe, O, Q, X, K]
3535
3534
  );
3536
- return o === "selector" && P || i === "multiChat" && Et ? /* @__PURE__ */ h(Ie, { value: ge, children: /* @__PURE__ */ h(Te, { className: "cuadra-h-full", paddingX: "cuadra-px-0", paddingY: "cuadra-py-0", children: /* @__PURE__ */ h("div", { className: "cuadra-flex cuadra-items-center cuadra-justify-center cuadra-h-full", children: /* @__PURE__ */ h(at, { className: "cuadra-h-6 cuadra-w-6 cuadra-animate-spin cuadra-text-muted-foreground" }) }) }) }) : o === "selector" && !_t && O ? /* @__PURE__ */ h(Ie, { value: ge, children: /* @__PURE__ */ h(Te, { className: "cuadra-h-full", paddingX: "cuadra-px-0", paddingY: "cuadra-py-0", children: /* @__PURE__ */ h("div", { className: "cuadra-flex cuadra-items-center cuadra-justify-center cuadra-h-full", children: /* @__PURE__ */ h("div", { className: "cuadra-flex cuadra-flex-col cuadra-items-center cuadra-gap-2", children: /* @__PURE__ */ h("p", { className: "cuadra-text-sm cuadra-text-destructive font-brand", children: "Failed to load models" }) }) }) }) }) : /* @__PURE__ */ h("div", { className: "cuadra-uikit cuadra-h-full cuadra-w-full", style: { height: "100%", width: "100%" }, children: /* @__PURE__ */ h(Ie, { value: ge, children: /* @__PURE__ */ h(
3537
- wr,
3535
+ return o === "selector" && O || i === "multiChat" && Ft ? /* @__PURE__ */ d(Ie, { value: be, children: /* @__PURE__ */ d(Ae, { className: "cuadra-h-full", paddingX: "cuadra-px-0", paddingY: "cuadra-py-0", children: /* @__PURE__ */ d("div", { className: "cuadra-flex cuadra-items-center cuadra-justify-center cuadra-h-full", children: /* @__PURE__ */ d(ot, { className: "cuadra-h-6 cuadra-w-6 cuadra-animate-spin cuadra-text-muted-foreground" }) }) }) }) : o === "selector" && !zt && Q ? /* @__PURE__ */ d(Ie, { value: be, children: /* @__PURE__ */ d(Ae, { className: "cuadra-h-full", paddingX: "cuadra-px-0", paddingY: "cuadra-py-0", children: /* @__PURE__ */ d("div", { className: "cuadra-flex cuadra-items-center cuadra-justify-center cuadra-h-full", children: /* @__PURE__ */ d("div", { className: "cuadra-flex cuadra-flex-col cuadra-items-center cuadra-gap-2", children: /* @__PURE__ */ d("p", { className: "cuadra-text-sm cuadra-text-destructive font-brand", children: "Failed to load models" }) }) }) }) }) : /* @__PURE__ */ d("div", { className: "cuadra-uikit cuadra-h-full cuadra-w-full", style: { height: "100%", width: "100%" }, children: /* @__PURE__ */ d(Ie, { value: be, children: /* @__PURE__ */ d(
3536
+ Cr,
3538
3537
  {
3539
- baseUrl: D ? I : r || I,
3538
+ baseUrl: q ? E : r || E,
3540
3539
  sessionToken: n,
3541
- isProxyMode: D,
3542
- tenantId: e.tenantId,
3540
+ isProxyMode: q,
3543
3541
  mode: i,
3544
3542
  modelMode: o,
3545
- modelId: E || a || void 0,
3546
- onModelChange: Q,
3543
+ modelId: _ || a || void 0,
3544
+ onModelChange: X,
3547
3545
  ephemeral: l,
3548
3546
  systemPrompt: s,
3549
3547
  initialThreadId: f,
3550
- onError: x,
3551
- onChatCreated: w,
3552
- onThreadIdUpdate: y,
3548
+ onError: w,
3549
+ onChatCreated: y,
3550
+ onUserMessage: A,
3551
+ onThreadIdUpdate: T,
3553
3552
  onChatsLoaded: () => {
3554
- i === "multiChat" && Re(!1);
3553
+ i === "multiChat" && _e(!1);
3555
3554
  },
3556
- children: /* @__PURE__ */ h(
3557
- Te,
3555
+ children: /* @__PURE__ */ d(
3556
+ Ae,
3558
3557
  {
3559
3558
  paddingX: "cuadra-px-0",
3560
3559
  paddingY: "cuadra-py-0",
3561
3560
  className: `cuadra-h-full ${e.containerClass || ""}`,
3562
3561
  borderSizePx: 4,
3563
3562
  style: { height: "100%" },
3564
- children: /* @__PURE__ */ h("div", { className: "cuadra-h-full cuadra-flex cuadra-relative", style: { height: "100%" }, children: i === "multiChat" ? /* @__PURE__ */ T(W, { children: [
3565
- v && typeof document < "u" && ze(
3566
- /* @__PURE__ */ h(
3563
+ children: /* @__PURE__ */ d("div", { className: "cuadra-h-full cuadra-flex cuadra-relative", style: { height: "100%" }, children: i === "multiChat" ? /* @__PURE__ */ v(B, { children: [
3564
+ C && typeof document < "u" && $e(
3565
+ /* @__PURE__ */ d(
3567
3566
  "div",
3568
3567
  {
3569
3568
  className: "cuadra-fixed cuadra-inset-0 cuadra-bg-black/50 cuadra-z-40 md:cuadra-hidden",
3570
- onClick: () => C(!1)
3569
+ onClick: () => L(!1)
3571
3570
  }
3572
3571
  ),
3573
3572
  document.body
3574
3573
  ),
3575
- typeof document < "u" && /* @__PURE__ */ T(W, { children: [
3576
- /* @__PURE__ */ h(
3574
+ typeof document < "u" && /* @__PURE__ */ v(B, { children: [
3575
+ /* @__PURE__ */ d(
3577
3576
  "div",
3578
3577
  {
3579
3578
  className: "cuadra-hidden md:cuadra-block !cuadra-border-r cuadra-border-border cuadra-flex cuadra-flex-col cuadra-bg-background cuadra-transition-all cuadra-duration-300 cuadra-ease-in-out cuadra-h-full cuadra-w-80 cuadra-relative",
3580
3579
  style: { borderRightWidth: "1px", height: "100%" },
3581
- children: /* @__PURE__ */ h(Je, { onThreadSelect: () => C(!1) })
3580
+ children: /* @__PURE__ */ d(Ye, { onThreadSelect: () => L(!1) })
3582
3581
  }
3583
3582
  ),
3584
- v && ze(
3585
- /* @__PURE__ */ h(
3583
+ C && $e(
3584
+ /* @__PURE__ */ d(
3586
3585
  "div",
3587
3586
  {
3588
3587
  className: "cuadra-block md:cuadra-hidden !cuadra-border-r cuadra-border-border cuadra-flex cuadra-flex-col cuadra-bg-background cuadra-transition-all cuadra-duration-300 cuadra-ease-in-out cuadra-h-screen cuadra-w-80 cuadra-fixed cuadra-z-50 cuadra-top-0 cuadra-left-0 cuadra-translate-x-0",
3589
3588
  style: { borderRightWidth: "1px" },
3590
- children: /* @__PURE__ */ h(Je, { onThreadSelect: () => C(!1) })
3589
+ children: /* @__PURE__ */ d(Ye, { onThreadSelect: () => L(!1) })
3591
3590
  }
3592
3591
  ),
3593
3592
  document.body
3594
3593
  )
3595
3594
  ] }),
3596
- /* @__PURE__ */ T("div", { className: "cuadra-flex-1 cuadra-flex cuadra-flex-col", children: [
3597
- o === "selector" && /* @__PURE__ */ h(
3598
- Qe,
3595
+ /* @__PURE__ */ v("div", { className: "cuadra-flex-1 cuadra-flex cuadra-flex-col", children: [
3596
+ o === "selector" && /* @__PURE__ */ d(
3597
+ et,
3599
3598
  {
3600
- currentModel: E || "",
3599
+ currentModel: _ || "",
3601
3600
  models: oe,
3602
- modelsLoading: P,
3603
- modelsError: O,
3604
- onModelChange: Q,
3605
- showThemeToggle: k,
3606
- theme: b,
3607
- onMobileMenuClick: () => C(!v),
3601
+ modelsLoading: O,
3602
+ modelsError: Q,
3603
+ onModelChange: X,
3604
+ showThemeToggle: b,
3605
+ theme: x,
3606
+ onMobileMenuClick: () => L(!C),
3608
3607
  showMobileMenuButton: i === "multiChat"
3609
3608
  }
3610
3609
  ),
3611
- /* @__PURE__ */ h("div", { className: "cuadra-flex-1 cuadra-relative cuadra-min-h-0 cuadra-space-y-4 cuadra-p-4", children: /* @__PURE__ */ h(
3612
- Ze,
3610
+ /* @__PURE__ */ d("div", { className: "cuadra-flex-1 cuadra-relative cuadra-min-h-0 cuadra-space-y-4 cuadra-p-4", children: /* @__PURE__ */ d(
3611
+ Xe,
3613
3612
  {
3614
3613
  welcomeTitle: c,
3615
3614
  welcomeSubtitle: p,
3616
3615
  extraTopPadding: g,
3617
- suggestions: d
3616
+ suggestions: h,
3617
+ inputPlaceholder: k
3618
3618
  }
3619
3619
  ) })
3620
3620
  ] })
3621
- ] }) : /* @__PURE__ */ T("div", { className: "cuadra-flex-1 cuadra-flex cuadra-flex-col", children: [
3622
- o === "selector" && /* @__PURE__ */ h(
3623
- Qe,
3621
+ ] }) : /* @__PURE__ */ v("div", { className: "cuadra-flex-1 cuadra-flex cuadra-flex-col", children: [
3622
+ o === "selector" && /* @__PURE__ */ d(
3623
+ et,
3624
3624
  {
3625
- currentModel: E || "",
3625
+ currentModel: _ || "",
3626
3626
  models: oe,
3627
- modelsLoading: P,
3628
- modelsError: O,
3629
- onModelChange: Q,
3630
- showThemeToggle: k,
3631
- theme: b
3627
+ modelsLoading: O,
3628
+ modelsError: Q,
3629
+ onModelChange: X,
3630
+ showThemeToggle: b,
3631
+ theme: x
3632
3632
  }
3633
3633
  ),
3634
- /* @__PURE__ */ h("div", { className: "cuadra-flex-1 cuadra-relative cuadra-min-h-0 cuadra-space-y-4 cuadra-p-4", children: /* @__PURE__ */ h(
3635
- Ze,
3634
+ /* @__PURE__ */ d("div", { className: "cuadra-flex-1 cuadra-relative cuadra-min-h-0 cuadra-space-y-4 cuadra-p-4", children: /* @__PURE__ */ d(
3635
+ Xe,
3636
3636
  {
3637
3637
  welcomeTitle: c,
3638
3638
  welcomeSubtitle: p,
3639
3639
  extraTopPadding: g,
3640
- suggestions: d
3640
+ suggestions: h
3641
3641
  }
3642
3642
  ) })
3643
3643
  ] }) })
@@ -3646,12 +3646,11 @@ const ci = ({ config: e }) => {
3646
3646
  }
3647
3647
  ) }) });
3648
3648
  };
3649
- function bi(e) {
3649
+ function xi(e) {
3650
3650
  const r = {
3651
3651
  baseUrl: e.baseUrl,
3652
3652
  proxyUrl: e.proxyUrl,
3653
3653
  sessionToken: e.sessionToken || null,
3654
- tenantId: e.tenantId,
3655
3654
  mode: e.mode || "multiChat",
3656
3655
  modelMode: e.modelMode || "fixed",
3657
3656
  modelId: e.modelId,
@@ -3664,16 +3663,18 @@ function bi(e) {
3664
3663
  welcomeSubtitle: e.welcomeSubtitle,
3665
3664
  extraTopPadding: e.extraTopPadding,
3666
3665
  suggestions: e.suggestions,
3666
+ inputPlaceholder: e.inputPlaceholder,
3667
3667
  onError: e.onError,
3668
3668
  onChatCreated: e.onChatCreated,
3669
+ onUserMessage: e.onUserMessage,
3669
3670
  onThreadIdUpdate: e.onThreadIdUpdate,
3670
3671
  showThemeToggle: e.showThemeToggle,
3671
3672
  theme: e.theme,
3672
3673
  containerClass: e.className
3673
3674
  };
3674
- return /* @__PURE__ */ h(ci, { config: r });
3675
+ return /* @__PURE__ */ d(di, { config: r });
3675
3676
  }
3676
3677
  export {
3677
- bi as CuadraChat
3678
+ xi as CuadraChat
3678
3679
  };
3679
3680
  //# sourceMappingURL=index.mjs.map