super-agent-sdk 1.0.12 → 1.0.13

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/widget.mjs CHANGED
@@ -1,204 +1,220 @@
1
- import ct, { useState as V, useRef as X, useCallback as H, useEffect as re, createContext as na, useMemo as ht, useContext as ra, isValidElement as ia, cloneElement as aa, createElement as oa } from "react";
1
+ import ct, { useState as W, useRef as X, useEffect as te, useCallback as H, createContext as na, useMemo as ht, useContext as ra, isValidElement as ia, cloneElement as aa, createElement as oa } from "react";
2
2
  import { createRoot as la } from "react-dom/client";
3
3
  import { jsx as h, jsxs as T, Fragment as we } from "react/jsx-runtime";
4
4
  import { a as zt, g as Br, c as sa } from "./nosUploader-BkBtdrMs.js";
5
5
  function ua(e) {
6
- const { sdk: t, sessionId: n, onSessionCreated: r, onStreamStart: i, onStreamEnd: o, onError: a, onMessageSend: l } = e, [s, u] = V([]), [p, c] = V("ready"), [f, d] = V(null), m = X(null), w = X(!1), C = X(null), b = X(n), S = X(!0);
7
- b.current = n, S.current = s.length === 0;
8
- const v = H((A, _) => {
6
+ const { sdk: t, sessionId: n, onSessionCreated: r, onStreamStart: i, onStreamEnd: o, onError: a, onMessageSend: l } = e, [s, u] = W([]), [p, c] = W("ready"), [f, d] = W(null), g = X(null), w = X(!1), C = X(null), b = X(n), S = X(!0), v = X(null);
7
+ b.current = n, S.current = s.length === 0, te(() => {
8
+ var O;
9
+ const F = v.current;
10
+ !F || F === n || ((O = g.current) == null || O.abort(), g.current = null, C.current && (clearTimeout(C.current), C.current = null), w.current = !1, v.current = null, c("ready"));
11
+ }, [n]);
12
+ const A = H((F, O) => {
9
13
  if (w.current) return;
10
- w.current = !0, l == null || l(A);
11
- const O = {
14
+ w.current = !0, l == null || l(F);
15
+ const x = {
12
16
  id: `user_${Date.now()}`,
13
17
  role: "user",
14
18
  parts: [
15
- ...(_ ?? []).map((P) => ({ type: "attachment", attachment: P })),
16
- { type: "text", content: A }
19
+ ...(O ?? []).map((N) => ({ type: "attachment", attachment: N })),
20
+ { type: "text", content: F }
17
21
  ],
18
22
  timestamp: Date.now()
19
- }, x = `assistant_${Date.now()}`, I = {
20
- id: x,
23
+ }, I = `assistant_${Date.now()}`, P = {
24
+ id: I,
21
25
  role: "assistant",
22
26
  parts: [],
23
27
  timestamp: Date.now()
24
- }, D = S.current;
25
- u((P) => [...P, O, I]), c("submitted"), d(null);
26
- const $ = (P) => {
27
- let z = "", B = "", F = [], j = !1;
28
- const q = () => {
29
- const g = [...F];
30
- if (z) {
31
- const G = g.findIndex((ee) => ee.type === "thinking");
32
- G >= 0 ? g[G] = { type: "thinking", content: z } : g.unshift({ type: "thinking", content: z });
28
+ }, j = S.current;
29
+ u((N) => [...N, x, P]), c("submitted"), d(null);
30
+ const R = (N) => {
31
+ let q = "", E = "", B = [], V = !1;
32
+ v.current = N;
33
+ const m = () => {
34
+ const $ = [...B];
35
+ if (q) {
36
+ const Z = $.findIndex((y) => y.type === "thinking");
37
+ Z >= 0 ? $[Z] = { type: "thinking", content: q } : $.unshift({ type: "thinking", content: q });
33
38
  }
34
- if (B) {
35
- const G = g[g.length - 1];
36
- (G == null ? void 0 : G.type) === "text" ? g[g.length - 1] = { type: "text", content: B } : g.push({ type: "text", content: B });
39
+ if (E) {
40
+ const Z = $[$.length - 1];
41
+ (Z == null ? void 0 : Z.type) === "text" ? $[$.length - 1] = { type: "text", content: E } : $.push({ type: "text", content: E });
37
42
  }
38
43
  u(
39
- (G) => G.map((ee) => ee.id === x ? { ...ee, parts: g } : ee)
44
+ (Z) => Z.map((y) => y.id === I ? { ...y, parts: $ } : y)
40
45
  );
41
46
  };
42
- m.current = t.chat({
43
- sessionId: P,
44
- message: A,
45
- attachments: _ && _.length > 0 ? _ : void 0,
47
+ g.current = t.chat({
48
+ sessionId: N,
49
+ message: F,
50
+ attachments: O && O.length > 0 ? O : void 0,
46
51
  stream: !0,
47
- onMessage: (g) => {
48
- switch (j || (j = !0, c("streaming")), g.type) {
49
- case "thinking":
50
- z += g.content;
51
- break;
52
- case "ai":
53
- B += g.content;
54
- break;
55
- case "tool_call":
56
- B && (F.push({ type: "text", content: B }), B = ""), F.push({
57
- type: "tool_call",
58
- toolName: g.toolName,
59
- toolCallId: g.toolCallId,
60
- args: g.args ?? "{}"
61
- });
62
- break;
63
- case "tool_result":
64
- B && (F.push({ type: "text", content: B }), B = ""), F.push({
65
- type: "tool_result",
66
- toolName: g.toolName ?? "",
67
- toolCallId: g.toolCallId,
68
- content: g.content,
69
- artifacts: g.artifacts,
70
- renderMode: g.renderMode,
71
- html: g.html
72
- });
73
- break;
74
- case "interrupt":
75
- B && (F.push({ type: "text", content: B }), B = ""), g.interrupt && F.push({
76
- type: "interrupt",
77
- interrupt: g.interrupt,
78
- resolved: !1
79
- }), q(), w.current = !1, m.current = null;
80
- return;
81
- case "stop":
82
- g.content && (B = g.content), q();
83
- return;
52
+ onMessage: ($) => {
53
+ if (v.current === N) {
54
+ switch (V || (V = !0, c("streaming")), $.type) {
55
+ case "thinking":
56
+ q += $.content;
57
+ break;
58
+ case "ai":
59
+ E += $.content;
60
+ break;
61
+ case "tool_call":
62
+ E && (B.push({ type: "text", content: E }), E = ""), B.push({
63
+ type: "tool_call",
64
+ toolName: $.toolName,
65
+ toolCallId: $.toolCallId,
66
+ args: $.args ?? "{}"
67
+ });
68
+ break;
69
+ case "tool_result":
70
+ E && (B.push({ type: "text", content: E }), E = ""), B.push({
71
+ type: "tool_result",
72
+ toolName: $.toolName ?? "",
73
+ toolCallId: $.toolCallId,
74
+ content: $.content,
75
+ artifacts: $.artifacts,
76
+ renderMode: $.renderMode,
77
+ html: $.html
78
+ });
79
+ break;
80
+ case "interrupt":
81
+ E && (B.push({ type: "text", content: E }), E = ""), $.interrupt && B.push({
82
+ type: "interrupt",
83
+ interrupt: $.interrupt,
84
+ resolved: !1
85
+ }), m(), w.current = !1, g.current = null, v.current = null;
86
+ return;
87
+ case "stop":
88
+ $.content && (E = $.content), m();
89
+ return;
90
+ }
91
+ m();
84
92
  }
85
- q();
86
93
  },
87
- onDone: (g) => {
88
- (B || F.length > 0 || z) && q(), g.sessionId && g.sessionId !== b.current && (r == null || r(g.sessionId));
89
- const G = () => {
90
- C.current && (clearTimeout(C.current), C.current = null), o == null || o(g.sessionId || P), c("ready"), w.current = !1, m.current = null;
94
+ onDone: ($) => {
95
+ v.current === N && (E || B.length > 0 || q) && m();
96
+ const Z = () => {
97
+ C.current && (clearTimeout(C.current), C.current = null), o == null || o($.sessionId || N), c("ready"), w.current = !1, g.current = null, v.current = null;
91
98
  };
92
- if (D) {
93
- const ee = A.slice(0, 30), y = g.sessionId || P;
94
- t.renameConversation(y, ee).catch(() => {
95
- }).finally(G);
99
+ if (j) {
100
+ const y = F.slice(0, 30), pe = $.sessionId || N;
101
+ t.renameConversation(pe, y).catch(() => {
102
+ }).finally(Z);
96
103
  } else
97
- G();
104
+ Z();
98
105
  },
99
- onError: (g) => {
100
- F.push({ type: "error", content: g.message }), q(), C.current && (clearTimeout(C.current), C.current = null), d(g), c("error"), a == null || a(g), w.current = !1, m.current = null;
106
+ onError: ($) => {
107
+ v.current === N && (B.push({ type: "error", content: $.message }), m()), C.current && (clearTimeout(C.current), C.current = null), d($), c("error"), a == null || a($), w.current = !1, g.current = null, v.current = null;
101
108
  }
102
- }), i == null || i(P);
109
+ }), i == null || i(N);
103
110
  };
104
- b.current ? $(b.current) : t.createSession().then((P) => {
105
- b.current = P, r == null || r(P), $(P);
106
- }).catch((P) => {
107
- d(P instanceof Error ? P : new Error(String(P))), c("error"), a == null || a(P instanceof Error ? P : new Error(String(P))), w.current = !1;
111
+ b.current ? R(b.current) : t.createSession().then((N) => {
112
+ if (b.current) {
113
+ w.current = !1, c("ready");
114
+ return;
115
+ }
116
+ b.current = N, r == null || r(N), R(N);
117
+ }).catch((N) => {
118
+ d(N instanceof Error ? N : new Error(String(N))), c("error"), a == null || a(N instanceof Error ? N : new Error(String(N))), w.current = !1;
108
119
  });
109
- }, [t, r, i, o, a, l]), N = H(() => {
110
- const A = b.current;
111
- A && (C.current && clearTimeout(C.current), C.current = setTimeout(() => {
112
- var _;
113
- C.current = null, (_ = m.current) == null || _.abort(), m.current = null, w.current = !1, c("ready");
114
- }, 8e3), t.stopGeneration(A).catch(() => {
120
+ }, [t, r, i, o, a, l]), M = H(() => {
121
+ const F = b.current;
122
+ F && (C.current && clearTimeout(C.current), C.current = setTimeout(() => {
123
+ var O;
124
+ C.current = null, (O = g.current) == null || O.abort(), g.current = null, w.current = !1, v.current = null, c("ready");
125
+ }, 8e3), t.stopGeneration(F).catch(() => {
115
126
  }));
116
- }, [t]), M = H(() => {
127
+ }, [t]), k = H(() => {
117
128
  if (w.current) return;
118
- const A = s.findLastIndex((x) => x.role === "user");
119
- if (A < 0) return;
120
- const _ = s[A].parts.filter((x) => x.type === "text").map((x) => x.content).join(""), O = s[A].parts.filter((x) => x.type === "attachment").map((x) => x.attachment);
121
- u((x) => x.slice(0, A)), v(_, O.length > 0 ? O : void 0);
122
- }, [s, v]), k = H((A, _) => {
129
+ const F = s.findLastIndex((I) => I.role === "user");
130
+ if (F < 0) return;
131
+ const O = s[F].parts.filter((I) => I.type === "text").map((I) => I.content).join(""), x = s[F].parts.filter((I) => I.type === "attachment").map((I) => I.attachment);
132
+ u((I) => I.slice(0, F)), A(O, x.length > 0 ? x : void 0);
133
+ }, [s, A]), D = H((F, O) => {
123
134
  u(
124
- (z) => z.map((B) => ({
135
+ (E) => E.map((B) => ({
125
136
  ...B,
126
137
  parts: B.parts.map(
127
- (F) => F.type === "interrupt" && F.interrupt.interruptId === A ? { ...F, resolved: !0, response: _ } : F
138
+ (V) => V.type === "interrupt" && V.interrupt.interruptId === F ? { ...V, resolved: !0, response: O } : V
128
139
  )
129
140
  }))
130
141
  );
131
- const O = b.current;
132
- if (!O) return;
133
- w.current = !0;
134
- let x = 0;
135
- u((z) => z.length > 0 && z[z.length - 1].role === "assistant" ? (x = z[z.length - 1].parts.length, z) : (x = 0, [...z, { id: `assistant_${Date.now()}`, role: "assistant", parts: [], timestamp: Date.now() }])), c("streaming");
136
- let I = "", D = "", $ = [];
137
- const P = () => {
138
- const z = [...$];
139
- if (I) {
140
- const B = z.findIndex((F) => F.type === "thinking");
141
- B >= 0 ? z[B] = { type: "thinking", content: I } : z.unshift({ type: "thinking", content: I });
142
+ const x = b.current;
143
+ if (!x) return;
144
+ w.current = !0, v.current = x;
145
+ const I = new AbortController();
146
+ g.current = I;
147
+ let P = 0;
148
+ u((E) => E.length > 0 && E[E.length - 1].role === "assistant" ? (P = E[E.length - 1].parts.length, E) : (P = 0, [...E, { id: `assistant_${Date.now()}`, role: "assistant", parts: [], timestamp: Date.now() }])), c("streaming");
149
+ let j = "", R = "", N = [];
150
+ const q = () => {
151
+ const E = [...N];
152
+ if (j) {
153
+ const B = E.findIndex((V) => V.type === "thinking");
154
+ B >= 0 ? E[B] = { type: "thinking", content: j } : E.unshift({ type: "thinking", content: j });
142
155
  }
143
- if (D) {
144
- const B = z[z.length - 1];
145
- (B == null ? void 0 : B.type) === "text" ? z[z.length - 1] = { type: "text", content: D } : z.push({ type: "text", content: D });
156
+ if (R) {
157
+ const B = E[E.length - 1];
158
+ (B == null ? void 0 : B.type) === "text" ? E[E.length - 1] = { type: "text", content: R } : E.push({ type: "text", content: R });
146
159
  }
147
160
  u((B) => {
148
- const F = B.findLastIndex((j) => j.role === "assistant");
149
- return F < 0 ? B : B.map(
150
- (j, q) => q === F ? { ...j, parts: [...j.parts.slice(0, x), ...z] } : j
161
+ const V = B.findLastIndex((m) => m.role === "assistant");
162
+ return V < 0 ? B : B.map(
163
+ (m, $) => $ === V ? { ...m, parts: [...m.parts.slice(0, P), ...E] } : m
151
164
  );
152
165
  });
153
166
  };
154
167
  t.respondInterrupt(
155
- A,
168
+ F,
169
+ x,
156
170
  O,
157
- _,
158
- (z) => {
159
- switch (z.type) {
160
- case "thinking":
161
- I += z.content;
162
- break;
163
- case "ai":
164
- D += z.content;
165
- break;
166
- case "tool_call":
167
- D && ($.push({ type: "text", content: D }), D = ""), $.push({
168
- type: "tool_call",
169
- toolName: z.toolName,
170
- toolCallId: z.toolCallId,
171
- args: z.args ?? "{}"
172
- });
173
- break;
174
- case "tool_result":
175
- D && ($.push({ type: "text", content: D }), D = ""), $.push({
176
- type: "tool_result",
177
- toolName: z.toolName ?? "",
178
- toolCallId: z.toolCallId,
179
- content: z.content,
180
- artifacts: z.artifacts,
181
- renderMode: z.renderMode,
182
- html: z.html
183
- });
184
- break;
185
- case "interrupt":
186
- D && ($.push({ type: "text", content: D }), D = ""), z.interrupt && $.push({ type: "interrupt", interrupt: z.interrupt, resolved: !1 }), w.current = !1, m.current = null;
187
- break;
188
- case "done":
189
- o == null || o(O), c("ready"), w.current = !1, m.current = null;
190
- break;
171
+ (E) => {
172
+ if (v.current === x) {
173
+ switch (E.type) {
174
+ case "thinking":
175
+ j += E.content;
176
+ break;
177
+ case "ai":
178
+ R += E.content;
179
+ break;
180
+ case "tool_call":
181
+ R && (N.push({ type: "text", content: R }), R = ""), N.push({
182
+ type: "tool_call",
183
+ toolName: E.toolName,
184
+ toolCallId: E.toolCallId,
185
+ args: E.args ?? "{}"
186
+ });
187
+ break;
188
+ case "tool_result":
189
+ R && (N.push({ type: "text", content: R }), R = ""), N.push({
190
+ type: "tool_result",
191
+ toolName: E.toolName ?? "",
192
+ toolCallId: E.toolCallId,
193
+ content: E.content,
194
+ artifacts: E.artifacts,
195
+ renderMode: E.renderMode,
196
+ html: E.html
197
+ });
198
+ break;
199
+ case "interrupt":
200
+ R && (N.push({ type: "text", content: R }), R = ""), E.interrupt && N.push({ type: "interrupt", interrupt: E.interrupt, resolved: !1 }), w.current = !1, g.current = null, v.current = null;
201
+ break;
202
+ case "done":
203
+ o == null || o(x), c("ready"), w.current = !1, g.current = null, v.current = null;
204
+ break;
205
+ }
206
+ q();
191
207
  }
192
- P();
193
208
  },
194
- (z) => {
195
- $.push({ type: "error", content: z.message }), P(), d(z), c("error"), w.current = !1, m.current = null, a == null || a(z);
196
- }
197
- ).catch((z) => {
198
- a == null || a(z instanceof Error ? z : new Error(String(z))), c("error"), w.current = !1, m.current = null;
209
+ (E) => {
210
+ v.current === x && (N.push({ type: "error", content: E.message }), q()), d(E), c("error"), w.current = !1, g.current = null, v.current = null, a == null || a(E);
211
+ },
212
+ I.signal
213
+ ).catch((E) => {
214
+ v.current === x && (a == null || a(E instanceof Error ? E : new Error(String(E))), c("error"), w.current = !1, g.current = null, v.current = null);
199
215
  });
200
216
  }, [t, a, o]);
201
- return { messages: s, status: p, error: f, sendMessage: v, stop: N, regenerate: M, setMessages: u, respondToInterrupt: k };
217
+ return { messages: s, status: p, error: f, sendMessage: A, stop: M, regenerate: k, setMessages: u, respondToInterrupt: D };
202
218
  }
203
219
  const $r = "sa_active_conversation", Ut = 20;
204
220
  function _n(e) {
@@ -216,68 +232,68 @@ function ca(e, t) {
216
232
  }
217
233
  }
218
234
  function pa(e) {
219
- const { sdk: t, onConversationChange: n } = e, r = t.botId, [i, o] = V([]), [a, l] = V(
235
+ const { sdk: t, onConversationChange: n } = e, r = t.botId, [i, o] = W([]), [a, l] = W(
220
236
  () => _n(r)
221
- ), [s, u] = V(!1), [p, c] = V(!0), f = X(!0), d = X(1), m = X(!1);
222
- re(() => () => {
237
+ ), [s, u] = W(!1), [p, c] = W(!0), f = X(!0), d = X(1), g = X(!1);
238
+ te(() => () => {
223
239
  f.current = !1;
224
240
  }, []);
225
- const w = H((A) => {
226
- l(A), ca(r, A), A && (n == null || n(A));
241
+ const w = H((D) => {
242
+ l(D), ca(r, D), D && (n == null || n(D));
227
243
  }, [r, n]), C = H(async () => {
228
- if (!m.current) {
229
- m.current = !0, u(!0);
244
+ if (!g.current) {
245
+ g.current = !0, u(!0);
230
246
  try {
231
247
  d.current = 1;
232
- const A = await t.listConversations({ page: 1, size: Ut });
248
+ const D = await t.listConversations({ page: 1, size: Ut });
233
249
  if (!f.current) return;
234
- o(A.items), c(A.items.length < A.total);
235
- const _ = _n(r);
236
- _ && !A.items.find((O) => O.sessionId === _) && w(null);
250
+ o(D.items), c(D.items.length < D.total);
251
+ const F = _n(r);
252
+ F && !D.items.find((O) => O.sessionId === F) && w(null);
237
253
  } catch {
238
254
  } finally {
239
- m.current = !1, f.current && u(!1);
255
+ g.current = !1, f.current && u(!1);
240
256
  }
241
257
  }
242
258
  }, [t, w]), b = H(async () => {
243
- if (!(m.current || !p)) {
244
- m.current = !0, u(!0);
259
+ if (!(g.current || !p)) {
260
+ g.current = !0, u(!0);
245
261
  try {
246
- const A = d.current + 1, _ = await t.listConversations({ page: A, size: Ut });
262
+ const D = d.current + 1, F = await t.listConversations({ page: D, size: Ut });
247
263
  if (!f.current) return;
248
- d.current = A, o((x) => {
249
- const I = new Set(x.map(($) => $.sessionId)), D = _.items.filter(($) => !I.has($.sessionId));
250
- return [...x, ...D];
264
+ d.current = D, o((x) => {
265
+ const I = new Set(x.map((j) => j.sessionId)), P = F.items.filter((j) => !I.has(j.sessionId));
266
+ return [...x, ...P];
251
267
  });
252
268
  const O = d.current * Ut;
253
- c(O < _.total);
269
+ c(O < F.total);
254
270
  } catch {
255
271
  } finally {
256
- m.current = !1, f.current && u(!1);
272
+ g.current = !1, f.current && u(!1);
257
273
  }
258
274
  }
259
- }, [t, p]), S = H(async (A) => (w(A), await t.getMessages(A)), [t, w]), v = H(async () => {
275
+ }, [t, p]), S = H(async (D) => (w(D), await t.getMessages(D)), [t, w]), v = H(async () => {
260
276
  try {
261
- const A = await t.createSession(), _ = (/* @__PURE__ */ new Date()).toISOString();
277
+ const D = await t.createSession(), F = (/* @__PURE__ */ new Date()).toISOString();
262
278
  o((O) => [
263
- { sessionId: A, botId: 0, title: "新对话", createTime: _, updateTime: _ },
279
+ { sessionId: D, botId: 0, title: "新对话", createTime: F, updateTime: F },
264
280
  ...O
265
- ]), w(A);
281
+ ]), w(D);
266
282
  } catch {
267
283
  w(null);
268
284
  }
269
- }, [t, w]), N = H(async (A) => {
270
- o((_) => _.filter((O) => O.sessionId !== A)), a === A && w(null);
285
+ }, [t, w]), A = H(async (D) => {
286
+ o((F) => F.filter((O) => O.sessionId !== D)), a === D && w(null);
271
287
  try {
272
- await t.deleteConversation(A);
288
+ await t.deleteConversation(D);
273
289
  } catch {
274
290
  }
275
- }, [t, a, w]), M = H(async (A, _) => {
276
- await t.renameConversation(A, _), o(
277
- (O) => O.map((x) => x.sessionId === A ? { ...x, title: _ } : x)
291
+ }, [t, a, w]), M = H(async (D, F) => {
292
+ await t.renameConversation(D, F), o(
293
+ (O) => O.map((x) => x.sessionId === D ? { ...x, title: F } : x)
278
294
  );
279
295
  }, [t]), { enabled: k = !0 } = e;
280
- return re(() => {
296
+ return te(() => {
281
297
  k && C();
282
298
  }, [k, C]), {
283
299
  conversations: i,
@@ -288,7 +304,7 @@ function pa(e) {
288
304
  loadMore: b,
289
305
  switchConversation: S,
290
306
  newConversation: v,
291
- deleteConversation: N,
307
+ deleteConversation: A,
292
308
  renameConversation: M,
293
309
  setActiveConversationId: w
294
310
  };
@@ -332,12 +348,12 @@ function Le() {
332
348
  return e;
333
349
  }
334
350
  function On({ sdk: e, hooks: t, attachmentUploader: n, nosUpload: r, children: i }) {
335
- const [o, a] = V(!1), [l, s] = V(!1), [u, p] = V(null), [c, f] = V(null), [d, m] = V(!1), [w, C] = V(!1);
336
- re(() => {
351
+ const [o, a] = W(!1), [l, s] = W(!1), [u, p] = W(null), [c, f] = W(null), [d, g] = W(!1), [w, C] = W(!1);
352
+ te(() => {
337
353
  e.getToken().then(() => {
338
- m(!0);
354
+ g(!0);
339
355
  }).catch(() => {
340
- m(!0);
356
+ g(!0);
341
357
  });
342
358
  }, [e]);
343
359
  const b = pa({
@@ -347,91 +363,91 @@ function On({ sdk: e, hooks: t, attachmentUploader: n, nosUpload: r, children: i
347
363
  }), S = ua({
348
364
  sdk: e,
349
365
  sessionId: b.activeConversationId,
350
- onSessionCreated: (F) => {
351
- b.setActiveConversationId(F);
366
+ onSessionCreated: (E) => {
367
+ b.setActiveConversationId(E);
352
368
  },
353
369
  onStreamStart: t == null ? void 0 : t.onStreamStart,
354
- onStreamEnd: (F) => {
355
- var j;
356
- (j = t == null ? void 0 : t.onStreamEnd) == null || j.call(t, F), b.loadConversations();
370
+ onStreamEnd: (E) => {
371
+ var B;
372
+ (B = t == null ? void 0 : t.onStreamEnd) == null || B.call(t, E), b.loadConversations();
357
373
  },
358
374
  onError: t == null ? void 0 : t.onError,
359
375
  onMessageSend: t == null ? void 0 : t.onMessageSend
360
- }), v = H((F) => {
361
- if (F.type === "link") {
362
- window.open(F.url, F.target ?? "_blank", "noopener");
376
+ }), v = H((E) => {
377
+ if (E.type === "link") {
378
+ window.open(E.url, E.target ?? "_blank", "noopener");
363
379
  return;
364
380
  }
365
- f(F);
366
- }, []), N = H(() => f(null), []), M = H(async (F) => {
381
+ f(E);
382
+ }, []), A = H(() => f(null), []), M = H(async (E) => {
367
383
  C(!0);
368
384
  try {
369
- const j = await b.switchConversation(F);
370
- S.setMessages(j);
385
+ const B = await b.switchConversation(E);
386
+ S.setMessages(B);
371
387
  } finally {
372
388
  C(!1);
373
389
  }
374
390
  }, [b, S]), k = H(async () => {
375
391
  S.setMessages([]), await b.newConversation();
376
- }, [b, S]), A = H(async (F) => {
377
- b.activeConversationId === F && S.setMessages([]), await b.deleteConversation(F);
392
+ }, [b, S]), D = H(async (E) => {
393
+ b.activeConversationId === E && S.setMessages([]), await b.deleteConversation(E);
378
394
  }, [b, S]);
379
- re(() => {
380
- b.activeConversationId && S.messages.length === 0 && (C(!0), e.getMessages(b.activeConversationId).then((F) => {
381
- S.setMessages(F);
395
+ te(() => {
396
+ b.activeConversationId && S.messages.length === 0 && (C(!0), e.getMessages(b.activeConversationId).then((E) => {
397
+ S.setMessages(E);
382
398
  }).catch(() => {
383
399
  }).finally(() => C(!1)));
384
400
  }, []);
385
- const _ = H(() => {
386
- a((F) => !F);
387
- }, []), O = H((F) => {
388
- a(F);
401
+ const F = H(() => {
402
+ a((E) => !E);
403
+ }, []), O = H((E) => {
404
+ a(E);
389
405
  }, []), x = H(() => {
390
- s((F) => !F), p((F) => null);
391
- }, []), I = H((F) => {
392
- p(F), s(!0);
393
- }, []), D = ht(() => {
394
- const F = /* @__PURE__ */ new Set(), j = [];
395
- for (const q of S.messages)
396
- for (const g of q.parts)
397
- if (g.type === "tool_result" && g.artifacts)
398
- for (const G of Ur(g.artifacts)) {
399
- const ee = G.id || `${G.url}:${G.filename}`;
400
- F.has(ee) || (F.add(ee), j.push(G));
406
+ s((E) => !E), p((E) => null);
407
+ }, []), I = H((E) => {
408
+ p(E), s(!0);
409
+ }, []), P = ht(() => {
410
+ const E = /* @__PURE__ */ new Set(), B = [];
411
+ for (const V of S.messages)
412
+ for (const m of V.parts)
413
+ if (m.type === "tool_result" && m.artifacts)
414
+ for (const $ of Ur(m.artifacts)) {
415
+ const Z = $.id || `${$.url}:${$.filename}`;
416
+ E.has(Z) || (E.add(Z), B.push($));
401
417
  }
402
- return j;
403
- }, [S.messages]), $ = H(async () => {
404
- const F = b.activeConversationId;
405
- if (!F) return null;
418
+ return B;
419
+ }, [S.messages]), j = H(async () => {
420
+ const E = b.activeConversationId;
421
+ if (!E) return null;
406
422
  try {
407
- const j = await e.getMessages(F);
408
- S.setMessages(j);
409
- const q = j.findLast((g) => g.role === "assistant");
410
- return (q == null ? void 0 : q.id) ?? null;
423
+ const B = await e.getMessages(E);
424
+ S.setMessages(B);
425
+ const V = B.findLast((m) => m.role === "assistant");
426
+ return (V == null ? void 0 : V.id) ?? null;
411
427
  } catch {
412
428
  return null;
413
429
  }
414
- }, [e, b.activeConversationId, S]), P = H((F, j, q) => {
415
- if (/^\d+$/.test(F)) {
416
- e.feedback(F, j, q).catch(() => {
430
+ }, [e, b.activeConversationId, S]), R = H((E, B, V) => {
431
+ if (/^\d+$/.test(E)) {
432
+ e.feedback(E, B, V).catch(() => {
417
433
  });
418
434
  return;
419
435
  }
420
- $().then((g) => {
421
- g && e.feedback(g, j, q).catch(() => {
436
+ j().then((m) => {
437
+ m && e.feedback(m, B, V).catch(() => {
422
438
  });
423
439
  });
424
- }, [e, $]), z = H((F) => {
425
- if (/^\d+$/.test(F)) {
426
- e.cancelFeedback(F).catch(() => {
440
+ }, [e, j]), N = H((E) => {
441
+ if (/^\d+$/.test(E)) {
442
+ e.cancelFeedback(E).catch(() => {
427
443
  });
428
444
  return;
429
445
  }
430
- $().then((j) => {
431
- j && e.cancelFeedback(j).catch(() => {
446
+ j().then((B) => {
447
+ B && e.cancelFeedback(B).catch(() => {
432
448
  });
433
449
  });
434
- }, [e, $]), B = ht(() => ({
450
+ }, [e, j]), q = ht(() => ({
435
451
  sdk: e,
436
452
  status: S.status,
437
453
  error: S.error,
@@ -440,7 +456,7 @@ function On({ sdk: e, hooks: t, attachmentUploader: n, nosUpload: r, children: i
440
456
  activeConversationId: b.activeConversationId,
441
457
  isThreadListOpen: o,
442
458
  isArtifactDrawerOpen: l,
443
- allArtifacts: D,
459
+ allArtifacts: P,
444
460
  activePreviewArtifact: u,
445
461
  activePanel: c,
446
462
  hasMore: b.hasMore,
@@ -453,17 +469,17 @@ function On({ sdk: e, hooks: t, attachmentUploader: n, nosUpload: r, children: i
453
469
  regenerate: S.regenerate,
454
470
  switchConversation: M,
455
471
  newConversation: k,
456
- deleteConversation: A,
472
+ deleteConversation: D,
457
473
  renameConversation: b.renameConversation,
458
474
  loadMoreConversations: b.loadMore,
459
- toggleThreadList: _,
475
+ toggleThreadList: F,
460
476
  setThreadListOpen: O,
461
477
  toggleArtifactDrawer: x,
462
478
  openArtifactPreview: I,
463
479
  openPanel: v,
464
- closePanel: N,
465
- feedback: P,
466
- cancelFeedback: z,
480
+ closePanel: A,
481
+ feedback: R,
482
+ cancelFeedback: N,
467
483
  respondToInterrupt: S.respondToInterrupt
468
484
  }), [
469
485
  e,
@@ -484,25 +500,25 @@ function On({ sdk: e, hooks: t, attachmentUploader: n, nosUpload: r, children: i
484
500
  b.loading,
485
501
  o,
486
502
  l,
487
- D,
503
+ P,
488
504
  u,
489
505
  c,
490
506
  w,
491
507
  M,
492
508
  k,
493
- A,
494
- _,
509
+ D,
510
+ F,
495
511
  O,
496
512
  x,
497
513
  I,
498
514
  v,
499
- N,
500
- P,
501
- z
515
+ A,
516
+ R,
517
+ N
502
518
  ]);
503
- return /* @__PURE__ */ h(Vr.Provider, { value: B, children: i });
519
+ return /* @__PURE__ */ h(Vr.Provider, { value: q, children: i });
504
520
  }
505
- const le = "https://ehr-web.netease.com/ehr-web/erh-super-agent", pe = {
521
+ const le = "https://ehr-web.netease.com/ehr-web/erh-super-agent", de = {
506
522
  recently: `${le}/recently.svg`,
507
523
  home: `${le}/home.svg`,
508
524
  mergeWindow: `${le}/merge_window.svg`,
@@ -533,57 +549,57 @@ const le = "https://ehr-web.netease.com/ehr-web/erh-super-agent", pe = {
533
549
  MAX_HEIGHT_RATIO: 0.95
534
550
  };
535
551
  function da({ defaultWidth: e = se.DEFAULT_WIDTH, defaultHeight: t = se.DEFAULT_HEIGHT, sidebarWidth: n = 0 } = {}) {
536
- const [r, i] = V(e), [o, a] = V({ x: 0, y: 0 }), [l, s] = V(!1), [u, p] = V(!1), [c, f] = V(null), [d, m] = V(() => typeof window > "u" ? { width: 0, height: 0 } : { width: window.innerWidth, height: window.innerHeight }), w = X(!1), C = X(0), b = X(r), S = X(!1), v = X({ x: 0, y: 0 }), N = X({ x: 0, y: 0 }), M = X(!1), k = X(null);
537
- re(() => {
538
- const P = () => m({ width: window.innerWidth, height: window.innerHeight });
539
- return window.addEventListener("resize", P), () => window.removeEventListener("resize", P);
540
- }, []), re(() => () => {
541
- var P;
542
- (P = k.current) == null || P.call(k);
552
+ const [r, i] = W(e), [o, a] = W({ x: 0, y: 0 }), [l, s] = W(!1), [u, p] = W(!1), [c, f] = W(null), [d, g] = W(() => typeof window > "u" ? { width: 0, height: 0 } : { width: window.innerWidth, height: window.innerHeight }), w = X(!1), C = X(0), b = X(r), S = X(!1), v = X({ x: 0, y: 0 }), A = X({ x: 0, y: 0 }), M = X(!1), k = X(null);
553
+ te(() => {
554
+ const R = () => g({ width: window.innerWidth, height: window.innerHeight });
555
+ return window.addEventListener("resize", R), () => window.removeEventListener("resize", R);
556
+ }, []), te(() => () => {
557
+ var R;
558
+ (R = k.current) == null || R.call(k);
543
559
  }, []);
544
- const A = Math.floor(d.height * se.MAX_HEIGHT_RATIO), _ = Math.min(c || t, A), O = r + n;
545
- re(() => {
560
+ const D = Math.floor(d.height * se.MAX_HEIGHT_RATIO), F = Math.min(c || t, D), O = r + n;
561
+ te(() => {
546
562
  if (!l) {
547
- const P = d.width - O - 20, z = d.height - _ - 20;
548
- a((B) => B.x === P && B.y === z ? B : { x: P, y: z });
549
- }
550
- }, [l, O, _, d]);
551
- const x = H((P) => {
552
- if (u || P.target.closest("button, input, textarea")) return;
553
- S.current = !0, M.current = !1, v.current = { x: P.clientX, y: P.clientY }, N.current = { ...o };
554
- const z = (j) => {
563
+ const R = d.width - O - 20, N = d.height - F - 20;
564
+ a((q) => q.x === R && q.y === N ? q : { x: R, y: N });
565
+ }
566
+ }, [l, O, F, d]);
567
+ const x = H((R) => {
568
+ if (u || R.target.closest("button, input, textarea")) return;
569
+ S.current = !0, M.current = !1, v.current = { x: R.clientX, y: R.clientY }, A.current = { ...o };
570
+ const N = (B) => {
555
571
  if (!S.current) return;
556
- const q = j.clientX - v.current.x, g = j.clientY - v.current.y;
557
- (Math.abs(q) > 3 || Math.abs(g) > 3) && (M.current = !0), M.current && (s(!0), a({
558
- x: Math.max(-200, Math.min(N.current.x + q, window.innerWidth - 100)),
559
- y: Math.max(0, Math.min(N.current.y + g, window.innerHeight - 48))
572
+ const V = B.clientX - v.current.x, m = B.clientY - v.current.y;
573
+ (Math.abs(V) > 3 || Math.abs(m) > 3) && (M.current = !0), M.current && (s(!0), a({
574
+ x: Math.max(-200, Math.min(A.current.x + V, window.innerWidth - 100)),
575
+ y: Math.max(0, Math.min(A.current.y + m, window.innerHeight - 48))
560
576
  }));
561
- }, B = () => {
562
- S.current = !1, F();
563
- }, F = () => {
564
- document.removeEventListener("mousemove", z), document.removeEventListener("mouseup", B), k.current = null;
577
+ }, q = () => {
578
+ S.current = !1, E();
579
+ }, E = () => {
580
+ document.removeEventListener("mousemove", N), document.removeEventListener("mouseup", q), k.current = null;
565
581
  };
566
- document.addEventListener("mousemove", z), document.addEventListener("mouseup", B), k.current = F;
567
- }, [u, o]), I = H((P) => {
568
- P.preventDefault(), P.stopPropagation(), w.current = !0, C.current = P.clientX, b.current = r;
569
- const z = o.x + r, B = o.y, F = (g) => {
582
+ document.addEventListener("mousemove", N), document.addEventListener("mouseup", q), k.current = E;
583
+ }, [u, o]), I = H((R) => {
584
+ R.preventDefault(), R.stopPropagation(), w.current = !0, C.current = R.clientX, b.current = r;
585
+ const N = o.x + r, q = o.y, E = (m) => {
570
586
  if (!w.current) return;
571
- const G = g.clientX - C.current;
572
- let ee = b.current - G;
573
- if (ee > se.MAX_WIDTH) {
574
- w.current = !1, p(!0), q();
587
+ const $ = m.clientX - C.current;
588
+ let Z = b.current - $;
589
+ if (Z > se.MAX_WIDTH) {
590
+ w.current = !1, p(!0), V();
575
591
  return;
576
592
  }
577
- ee = Math.max(se.MIN_WIDTH, ee), i(ee), a({ x: z - ee, y: B });
578
- }, j = () => {
579
- w.current = !1, q();
580
- }, q = () => {
581
- document.removeEventListener("mousemove", F), document.removeEventListener("mouseup", j), k.current = null;
593
+ Z = Math.max(se.MIN_WIDTH, Z), i(Z), a({ x: N - Z, y: q });
594
+ }, B = () => {
595
+ w.current = !1, V();
596
+ }, V = () => {
597
+ document.removeEventListener("mousemove", E), document.removeEventListener("mouseup", B), k.current = null;
582
598
  };
583
- document.addEventListener("mousemove", F), document.addEventListener("mouseup", j), k.current = q;
584
- }, [r, o]), D = H(() => {
585
- u && i(e), p((P) => !P);
586
- }, [u, e]), $ = H(() => {
599
+ document.addEventListener("mousemove", E), document.addEventListener("mouseup", B), k.current = V;
600
+ }, [r, o]), P = H(() => {
601
+ u && i(e), p((R) => !R);
602
+ }, [u, e]), j = H(() => {
587
603
  p(!1), i(e), s(!1), f(null);
588
604
  }, [e]);
589
605
  return {
@@ -597,20 +613,20 @@ function da({ defaultWidth: e = se.DEFAULT_WIDTH, defaultHeight: t = se.DEFAULT_
597
613
  defaultHeight: t,
598
614
  /** 真实渲染几何(含侧边栏宽度 / 自适应高度,统一在 hook 内钳制) */
599
615
  totalWidth: O,
600
- windowHeight: _,
616
+ windowHeight: F,
601
617
  // 交互
602
618
  startWindowDrag: x,
603
619
  startResize: I,
604
- toggleMaximize: D,
620
+ toggleMaximize: P,
605
621
  setIsMaximized: p,
606
622
  setLockedHeight: f,
607
623
  setHasCustomPosition: s,
608
- reset: $
624
+ reset: j
609
625
  };
610
626
  }
611
627
  function fa(e) {
612
628
  const { enabled: t, contentSelector: n, defaultHeight: r, onHeightChange: i } = e, o = X(null);
613
- return re(() => {
629
+ return te(() => {
614
630
  if (!t || !o.current) return;
615
631
  const l = o.current.querySelector(n);
616
632
  if (!l) return;
@@ -619,7 +635,7 @@ function fa(e) {
619
635
  if (!c) return;
620
636
  const f = c.querySelector(n);
621
637
  if (!f) return;
622
- const d = c.offsetHeight - f.clientHeight, m = f.scrollHeight + d, w = Math.floor(window.innerHeight * se.MAX_HEIGHT_RATIO), C = Math.max(r, Math.min(m, w));
638
+ const d = c.offsetHeight - f.clientHeight, g = f.scrollHeight + d, w = Math.floor(window.innerHeight * se.MAX_HEIGHT_RATIO), C = Math.max(r, Math.min(g, w));
623
639
  i((b) => b === C ? b : C);
624
640
  };
625
641
  s();
@@ -641,16 +657,16 @@ function ha(e, t) {
641
657
  };
642
658
  }
643
659
  function ga({ isOpen: e, onClick: t, triggerLogo: n }) {
644
- const [r, i] = V(null), o = X(!1), a = X(!1), l = X({ x: 0, y: 0 }), s = X({ x: 0, y: 0 }), u = X(null);
645
- re(() => () => {
660
+ const [r, i] = W(null), o = X(!1), a = X(!1), l = X({ x: 0, y: 0 }), s = X({ x: 0, y: 0 }), u = X(null);
661
+ te(() => () => {
646
662
  var d;
647
663
  (d = u.current) == null || d.call(u);
648
664
  }, []);
649
665
  const p = H((d) => {
650
666
  if (d.button !== 0) return;
651
667
  o.current = !0, a.current = !1, l.current = { x: d.clientX, y: d.clientY };
652
- const m = d.currentTarget.getBoundingClientRect();
653
- s.current = { x: m.left, y: m.top };
668
+ const g = d.currentTarget.getBoundingClientRect();
669
+ s.current = { x: g.left, y: g.top };
654
670
  const w = (b) => {
655
671
  if (!o.current) return;
656
672
  const S = b.clientX - l.current.x, v = b.clientY - l.current.y;
@@ -681,7 +697,7 @@ function ga({ isOpen: e, onClick: t, triggerLogo: n }) {
681
697
  onClick: c,
682
698
  "aria-label": "打开 AI 助手",
683
699
  title: "AI 助手",
684
- children: /* @__PURE__ */ h("img", { src: n || pe.triggerLogo, alt: "AI 助手", className: "block h-full w-full", draggable: !1 })
700
+ children: /* @__PURE__ */ h("img", { src: n || de.triggerLogo, alt: "AI 助手", className: "block h-full w-full", draggable: !1 })
685
701
  }
686
702
  );
687
703
  }
@@ -715,8 +731,8 @@ function ma({
715
731
  }) {
716
732
  return /* @__PURE__ */ T("div", { className: "relative z-20 flex h-9 shrink-0 select-none items-center justify-between px-[15px]", children: [
717
733
  /* @__PURE__ */ T("div", { className: "flex items-center gap-3", children: [
718
- /* @__PURE__ */ h(ot, { tooltip: "历史记录", onClick: t, children: /* @__PURE__ */ h("img", { src: pe.recently, alt: "", width: 20, height: 20 }) }),
719
- i && o && /* @__PURE__ */ h(ot, { tooltip: "回到首页", onClick: o, children: /* @__PURE__ */ h("img", { src: pe.home, alt: "", width: 20, height: 20 }) })
734
+ /* @__PURE__ */ h(ot, { tooltip: "历史记录", onClick: t, children: /* @__PURE__ */ h("img", { src: de.recently, alt: "", width: 20, height: 20 }) }),
735
+ i && o && /* @__PURE__ */ h(ot, { tooltip: "回到首页", onClick: o, children: /* @__PURE__ */ h("img", { src: de.home, alt: "", width: 20, height: 20 }) })
720
736
  ] }),
721
737
  /* @__PURE__ */ T("div", { className: "flex items-center gap-2.5", children: [
722
738
  l > 0 && s && /* @__PURE__ */ h(ot, { tooltip: "会话产物", onClick: s, children: /* @__PURE__ */ T("span", { className: "relative flex items-center gap-1", children: [
@@ -726,8 +742,8 @@ function ma({
726
742
  ] }),
727
743
  l > 0 && /* @__PURE__ */ h("span", { className: "absolute -right-2 -top-1.5 min-w-[14px] rounded-full bg-[var(--sa-primary)] px-0.5 text-center text-[9px] font-medium leading-[14px] text-white", children: l > 99 ? "99+" : l })
728
744
  ] }) }),
729
- r && /* @__PURE__ */ h(ot, { tooltip: n ? "小窗" : "大窗", onClick: r, children: /* @__PURE__ */ h("img", { src: n ? pe.spiltWindow : pe.mergeWindow, alt: "", width: 20, height: 20 }) }),
730
- a && /* @__PURE__ */ h(ot, { tooltip: "关闭", onClick: e, children: /* @__PURE__ */ h("img", { src: pe.close, alt: "", width: 20, height: 20 }) })
745
+ r && /* @__PURE__ */ h(ot, { tooltip: n ? "小窗" : "大窗", onClick: r, children: /* @__PURE__ */ h("img", { src: n ? de.spiltWindow : de.mergeWindow, alt: "", width: 20, height: 20 }) }),
746
+ a && /* @__PURE__ */ h(ot, { tooltip: "关闭", onClick: e, children: /* @__PURE__ */ h("img", { src: de.close, alt: "", width: 20, height: 20 }) })
731
747
  ] })
732
748
  ] });
733
749
  }
@@ -757,14 +773,14 @@ function Bn({ width: e }) {
757
773
  hasMore: l,
758
774
  loadMoreConversations: s,
759
775
  conversationsLoading: u
760
- } = Le(), [p, c] = V(null), [f, d] = V(""), [m, w] = V(null), C = X(null), b = H((M, k) => {
776
+ } = Le(), [p, c] = W(null), [f, d] = W(""), [g, w] = W(null), C = X(null), b = H((M, k) => {
761
777
  c(M), d(k ?? "");
762
778
  }, []), S = H((M) => {
763
779
  f.trim() && a(M, f.trim()), c(null);
764
780
  }, [f, a]), v = H(() => {
765
781
  const M = C.current;
766
782
  !M || !l || M.scrollHeight - M.scrollTop - M.clientHeight < 50 && s();
767
- }, [l, s]), N = ht(() => Wr(t), [t]);
783
+ }, [l, s]), A = ht(() => Wr(t), [t]);
768
784
  return /* @__PURE__ */ T(
769
785
  "div",
770
786
  {
@@ -778,7 +794,7 @@ function Bn({ width: e }) {
778
794
  className: "sa-new-chat mb-4 flex h-8 w-full shrink-0 items-center justify-center gap-2 rounded-md text-[14px] font-medium transition-colors",
779
795
  onClick: i,
780
796
  children: [
781
- /* @__PURE__ */ h("img", { src: pe.messageCreate, alt: "", width: 18, height: 18 }),
797
+ /* @__PURE__ */ h("img", { src: de.messageCreate, alt: "", width: 18, height: 18 }),
782
798
  /* @__PURE__ */ h("span", { className: "sa-new-chat-text whitespace-nowrap", children: "新建对话" })
783
799
  ]
784
800
  }
@@ -790,7 +806,7 @@ function Bn({ width: e }) {
790
806
  /* @__PURE__ */ T("div", { ref: C, className: "flex-1 overflow-y-auto", onScroll: v, children: [
791
807
  u && t.length === 0 && /* @__PURE__ */ h("div", { className: "px-0.5 py-2 text-[12px] text-[#999]", children: "加载中..." }),
792
808
  !u && t.length === 0 && /* @__PURE__ */ h("div", { className: "px-0.5 py-2 text-[12px] text-[#999]", children: "暂无记录" }),
793
- N.map((M) => /* @__PURE__ */ T("div", { className: "mb-1", children: [
809
+ A.map((M) => /* @__PURE__ */ T("div", { className: "mb-1", children: [
794
810
  /* @__PURE__ */ h("div", { className: "px-1 pb-1 pt-2 text-[11px] text-[#A0A0A0]", children: M.label }),
795
811
  M.items.map((k) => /* @__PURE__ */ h(
796
812
  "div",
@@ -799,10 +815,10 @@ function Bn({ width: e }) {
799
815
  onClick: () => {
800
816
  p !== k.sessionId && r(k.sessionId);
801
817
  },
802
- onMouseEnter: (A) => {
818
+ onMouseEnter: (D) => {
803
819
  if (p === k.sessionId) return;
804
- const _ = A.currentTarget.getBoundingClientRect();
805
- w({ text: k.title || "新会话", x: _.right + 8, y: _.top + _.height / 2 });
820
+ const F = D.currentTarget.getBoundingClientRect();
821
+ w({ text: k.title || "新会话", x: F.right + 8, y: F.top + F.height / 2 });
806
822
  },
807
823
  onMouseLeave: () => w(null),
808
824
  children: p === k.sessionId ? /* @__PURE__ */ h(
@@ -810,16 +826,16 @@ function Bn({ width: e }) {
810
826
  {
811
827
  className: "w-full rounded border border-[var(--sa-primary)] bg-white px-1.5 py-0.5 text-[12px] outline-none",
812
828
  value: f,
813
- onChange: (A) => d(A.target.value),
829
+ onChange: (D) => d(D.target.value),
814
830
  onBlur: () => S(k.sessionId),
815
- onKeyDown: (A) => {
816
- A.key === "Enter" && S(k.sessionId), A.key === "Escape" && c(null);
831
+ onKeyDown: (D) => {
832
+ D.key === "Enter" && S(k.sessionId), D.key === "Escape" && c(null);
817
833
  },
818
- onClick: (A) => A.stopPropagation(),
834
+ onClick: (D) => D.stopPropagation(),
819
835
  autoFocus: !0
820
836
  }
821
837
  ) : /* @__PURE__ */ T(we, { children: [
822
- /* @__PURE__ */ h("img", { src: pe.message, alt: "", width: 16, height: 16, className: "shrink-0 opacity-60" }),
838
+ /* @__PURE__ */ h("img", { src: de.message, alt: "", width: 16, height: 16, className: "shrink-0 opacity-60" }),
823
839
  /* @__PURE__ */ h("span", { className: "flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-left text-[#333]", children: k.title || "新会话" }),
824
840
  /* @__PURE__ */ T("span", { className: "hidden shrink-0 items-center gap-0.5 group-hover:flex", children: [
825
841
  /* @__PURE__ */ h(
@@ -827,8 +843,8 @@ function Bn({ width: e }) {
827
843
  {
828
844
  type: "button",
829
845
  className: "flex h-5 w-5 items-center justify-center rounded text-[#999] hover:bg-white/70 hover:text-[var(--sa-primary)]",
830
- onClick: (A) => {
831
- A.stopPropagation(), b(k.sessionId, k.title);
846
+ onClick: (D) => {
847
+ D.stopPropagation(), b(k.sessionId, k.title);
832
848
  },
833
849
  title: "重命名",
834
850
  children: /* @__PURE__ */ h("svg", { width: 12, height: 12, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ h("path", { d: "M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z" }) })
@@ -839,8 +855,8 @@ function Bn({ width: e }) {
839
855
  {
840
856
  type: "button",
841
857
  className: "flex h-5 w-5 items-center justify-center rounded text-[#999] hover:bg-white/70 hover:text-[#ef4444]",
842
- onClick: (A) => {
843
- A.stopPropagation(), o(k.sessionId);
858
+ onClick: (D) => {
859
+ D.stopPropagation(), o(k.sessionId);
844
860
  },
845
861
  title: "删除",
846
862
  children: /* @__PURE__ */ h("svg", { width: 12, height: 12, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ h("path", { d: "M3 6h18M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" }) })
@@ -855,12 +871,12 @@ function Bn({ width: e }) {
855
871
  u && t.length > 0 && /* @__PURE__ */ h("div", { className: "px-0.5 py-2 text-[12px] text-[#999]", children: l ? "加载更多..." : "加载中..." }),
856
872
  !u && l && /* @__PURE__ */ h("div", { className: "px-0.5 py-2 text-center text-[11px] text-[#C0C0C0]", children: "向下滚动加载更多" })
857
873
  ] }),
858
- m && /* @__PURE__ */ h(
874
+ g && /* @__PURE__ */ h(
859
875
  "div",
860
876
  {
861
877
  className: "pointer-events-none fixed z-[10001] whitespace-nowrap rounded border border-[#E8E8E8] bg-white px-2.5 py-1.5 text-[12px] leading-[1.4] text-[#333] shadow-[0_2px_8px_rgba(0,0,0,0.12)]",
862
- style: { left: m.x, top: m.y, transform: "translateY(-50%)" },
863
- children: m.text
878
+ style: { left: g.x, top: g.y, transform: "translateY(-50%)" },
879
+ children: g.text
864
880
  }
865
881
  )
866
882
  ]
@@ -874,11 +890,11 @@ function ba(e) {
874
890
  const { scrollTop: l, scrollHeight: s, clientHeight: u } = a, p = s - l - u < 40;
875
891
  l < r.current && !p && (n.current = !0), p && (n.current = !1), r.current = l;
876
892
  }, []);
877
- re(() => {
893
+ te(() => {
878
894
  const a = t.current;
879
895
  if (a)
880
896
  return a.addEventListener("scroll", i, { passive: !0 }), () => a.removeEventListener("scroll", i);
881
- }, [i]), re(() => {
897
+ }, [i]), te(() => {
882
898
  if (n.current) return;
883
899
  const a = t.current;
884
900
  a && requestAnimationFrame(() => {
@@ -936,7 +952,7 @@ function qr(e, t) {
936
952
  function on(e) {
937
953
  return e.toLowerCase();
938
954
  }
939
- class he {
955
+ class ge {
940
956
  /**
941
957
  * @param {string} property
942
958
  * Property.
@@ -949,37 +965,37 @@ class he {
949
965
  this.attribute = n, this.property = t;
950
966
  }
951
967
  }
952
- he.prototype.attribute = "";
953
- he.prototype.booleanish = !1;
954
- he.prototype.boolean = !1;
955
- he.prototype.commaOrSpaceSeparated = !1;
956
- he.prototype.commaSeparated = !1;
957
- he.prototype.defined = !1;
958
- he.prototype.mustUseProperty = !1;
959
- he.prototype.number = !1;
960
- he.prototype.overloadedBoolean = !1;
961
- he.prototype.property = "";
962
- he.prototype.spaceSeparated = !1;
963
- he.prototype.space = void 0;
968
+ ge.prototype.attribute = "";
969
+ ge.prototype.booleanish = !1;
970
+ ge.prototype.boolean = !1;
971
+ ge.prototype.commaOrSpaceSeparated = !1;
972
+ ge.prototype.commaSeparated = !1;
973
+ ge.prototype.defined = !1;
974
+ ge.prototype.mustUseProperty = !1;
975
+ ge.prototype.number = !1;
976
+ ge.prototype.overloadedBoolean = !1;
977
+ ge.prototype.property = "";
978
+ ge.prototype.spaceSeparated = !1;
979
+ ge.prototype.space = void 0;
964
980
  let Ea = 0;
965
- const Y = We(), ae = We(), ln = We(), L = We(), ne = We(), Ue = We(), xe = We();
981
+ const G = We(), ae = We(), ln = We(), L = We(), re = We(), Ue = We(), xe = We();
966
982
  function We() {
967
983
  return 2 ** ++Ea;
968
984
  }
969
985
  const sn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
970
986
  __proto__: null,
971
- boolean: Y,
987
+ boolean: G,
972
988
  booleanish: ae,
973
989
  commaOrSpaceSeparated: xe,
974
990
  commaSeparated: Ue,
975
991
  number: L,
976
992
  overloadedBoolean: ln,
977
- spaceSeparated: ne
993
+ spaceSeparated: re
978
994
  }, Symbol.toStringTag, { value: "Module" })), Vt = (
979
995
  /** @type {ReadonlyArray<keyof typeof types>} */
980
996
  Object.keys(sn)
981
997
  );
982
- class bn extends he {
998
+ class bn extends ge {
983
999
  /**
984
1000
  * @constructor
985
1001
  * @param {string} property
@@ -1029,36 +1045,36 @@ const Yr = Je({
1029
1045
  ariaColCount: L,
1030
1046
  ariaColIndex: L,
1031
1047
  ariaColSpan: L,
1032
- ariaControls: ne,
1048
+ ariaControls: re,
1033
1049
  ariaCurrent: null,
1034
- ariaDescribedBy: ne,
1050
+ ariaDescribedBy: re,
1035
1051
  ariaDetails: null,
1036
1052
  ariaDisabled: ae,
1037
- ariaDropEffect: ne,
1053
+ ariaDropEffect: re,
1038
1054
  ariaErrorMessage: null,
1039
1055
  ariaExpanded: ae,
1040
- ariaFlowTo: ne,
1056
+ ariaFlowTo: re,
1041
1057
  ariaGrabbed: ae,
1042
1058
  ariaHasPopup: null,
1043
1059
  ariaHidden: ae,
1044
1060
  ariaInvalid: null,
1045
1061
  ariaKeyShortcuts: null,
1046
1062
  ariaLabel: null,
1047
- ariaLabelledBy: ne,
1063
+ ariaLabelledBy: re,
1048
1064
  ariaLevel: L,
1049
1065
  ariaLive: null,
1050
1066
  ariaModal: ae,
1051
1067
  ariaMultiLine: ae,
1052
1068
  ariaMultiSelectable: ae,
1053
1069
  ariaOrientation: null,
1054
- ariaOwns: ne,
1070
+ ariaOwns: re,
1055
1071
  ariaPlaceholder: null,
1056
1072
  ariaPosInSet: L,
1057
1073
  ariaPressed: ae,
1058
1074
  ariaReadOnly: ae,
1059
1075
  ariaRelevant: null,
1060
1076
  ariaRequired: ae,
1061
- ariaRoleDescription: ne,
1077
+ ariaRoleDescription: re,
1062
1078
  ariaRowCount: L,
1063
1079
  ariaRowIndex: L,
1064
1080
  ariaRowSpan: L,
@@ -1093,27 +1109,27 @@ const Ia = Je({
1093
1109
  // Standard Properties.
1094
1110
  abbr: null,
1095
1111
  accept: Ue,
1096
- acceptCharset: ne,
1097
- accessKey: ne,
1112
+ acceptCharset: re,
1113
+ accessKey: re,
1098
1114
  action: null,
1099
1115
  allow: null,
1100
- allowFullScreen: Y,
1101
- allowPaymentRequest: Y,
1102
- allowUserMedia: Y,
1103
- alpha: Y,
1116
+ allowFullScreen: G,
1117
+ allowPaymentRequest: G,
1118
+ allowUserMedia: G,
1119
+ alpha: G,
1104
1120
  alt: null,
1105
1121
  as: null,
1106
- async: Y,
1122
+ async: G,
1107
1123
  autoCapitalize: null,
1108
- autoComplete: ne,
1109
- autoFocus: Y,
1110
- autoPlay: Y,
1111
- blocking: ne,
1124
+ autoComplete: re,
1125
+ autoFocus: G,
1126
+ autoPlay: G,
1127
+ blocking: re,
1112
1128
  capture: null,
1113
1129
  charSet: null,
1114
- checked: Y,
1130
+ checked: G,
1115
1131
  cite: null,
1116
- className: ne,
1132
+ className: re,
1117
1133
  closedBy: null,
1118
1134
  colorSpace: null,
1119
1135
  cols: L,
@@ -1122,18 +1138,18 @@ const Ia = Je({
1122
1138
  commandFor: null,
1123
1139
  content: null,
1124
1140
  contentEditable: ae,
1125
- controls: Y,
1126
- controlsList: ne,
1141
+ controls: G,
1142
+ controlsList: re,
1127
1143
  coords: L | Ue,
1128
1144
  crossOrigin: null,
1129
1145
  data: null,
1130
1146
  dateTime: null,
1131
1147
  decoding: null,
1132
- default: Y,
1133
- defer: Y,
1148
+ default: G,
1149
+ defer: G,
1134
1150
  dir: null,
1135
1151
  dirName: null,
1136
- disabled: Y,
1152
+ disabled: G,
1137
1153
  download: ln,
1138
1154
  draggable: ae,
1139
1155
  encType: null,
@@ -1143,36 +1159,36 @@ const Ia = Je({
1143
1159
  formAction: null,
1144
1160
  formEncType: null,
1145
1161
  formMethod: null,
1146
- formNoValidate: Y,
1162
+ formNoValidate: G,
1147
1163
  formTarget: null,
1148
- headers: ne,
1164
+ headers: re,
1149
1165
  height: L,
1150
1166
  hidden: ln,
1151
1167
  high: L,
1152
1168
  href: null,
1153
1169
  hrefLang: null,
1154
- htmlFor: ne,
1155
- httpEquiv: ne,
1170
+ htmlFor: re,
1171
+ httpEquiv: re,
1156
1172
  id: null,
1157
1173
  imageSizes: null,
1158
1174
  imageSrcSet: null,
1159
- inert: Y,
1175
+ inert: G,
1160
1176
  inputMode: null,
1161
1177
  integrity: null,
1162
1178
  is: null,
1163
- isMap: Y,
1179
+ isMap: G,
1164
1180
  itemId: null,
1165
- itemProp: ne,
1166
- itemRef: ne,
1167
- itemScope: Y,
1168
- itemType: ne,
1181
+ itemProp: re,
1182
+ itemRef: re,
1183
+ itemScope: G,
1184
+ itemType: re,
1169
1185
  kind: null,
1170
1186
  label: null,
1171
1187
  lang: null,
1172
1188
  language: null,
1173
1189
  list: null,
1174
1190
  loading: null,
1175
- loop: Y,
1191
+ loop: G,
1176
1192
  low: L,
1177
1193
  manifest: null,
1178
1194
  max: null,
@@ -1181,12 +1197,12 @@ const Ia = Je({
1181
1197
  method: null,
1182
1198
  min: null,
1183
1199
  minLength: L,
1184
- multiple: Y,
1185
- muted: Y,
1200
+ multiple: G,
1201
+ muted: G,
1186
1202
  name: null,
1187
1203
  nonce: null,
1188
- noModule: Y,
1189
- noValidate: Y,
1204
+ noModule: G,
1205
+ noValidate: G,
1190
1206
  onAbort: null,
1191
1207
  onAfterPrint: null,
1192
1208
  onAuxClick: null,
@@ -1275,34 +1291,34 @@ const Ia = Je({
1275
1291
  onVolumeChange: null,
1276
1292
  onWaiting: null,
1277
1293
  onWheel: null,
1278
- open: Y,
1294
+ open: G,
1279
1295
  optimum: L,
1280
1296
  pattern: null,
1281
- ping: ne,
1297
+ ping: re,
1282
1298
  placeholder: null,
1283
- playsInline: Y,
1299
+ playsInline: G,
1284
1300
  popover: null,
1285
1301
  popoverTarget: null,
1286
1302
  popoverTargetAction: null,
1287
1303
  poster: null,
1288
1304
  preload: null,
1289
- readOnly: Y,
1305
+ readOnly: G,
1290
1306
  referrerPolicy: null,
1291
- rel: ne,
1292
- required: Y,
1293
- reversed: Y,
1307
+ rel: re,
1308
+ required: G,
1309
+ reversed: G,
1294
1310
  rows: L,
1295
1311
  rowSpan: L,
1296
- sandbox: ne,
1312
+ sandbox: re,
1297
1313
  scope: null,
1298
- scoped: Y,
1299
- seamless: Y,
1300
- selected: Y,
1301
- shadowRootClonable: Y,
1302
- shadowRootCustomElementRegistry: Y,
1303
- shadowRootDelegatesFocus: Y,
1314
+ scoped: G,
1315
+ seamless: G,
1316
+ selected: G,
1317
+ shadowRootClonable: G,
1318
+ shadowRootCustomElementRegistry: G,
1319
+ shadowRootDelegatesFocus: G,
1304
1320
  shadowRootMode: null,
1305
- shadowRootSerializable: Y,
1321
+ shadowRootSerializable: G,
1306
1322
  shape: null,
1307
1323
  size: L,
1308
1324
  sizes: null,
@@ -1321,7 +1337,7 @@ const Ia = Je({
1321
1337
  title: null,
1322
1338
  translate: null,
1323
1339
  type: null,
1324
- typeMustMatch: Y,
1340
+ typeMustMatch: G,
1325
1341
  useMap: null,
1326
1342
  value: ae,
1327
1343
  width: L,
@@ -1333,7 +1349,7 @@ const Ia = Je({
1333
1349
  // Several. Use CSS `text-align` instead,
1334
1350
  aLink: null,
1335
1351
  // `<body>`. Use CSS `a:active {color}` instead
1336
- archive: ne,
1352
+ archive: re,
1337
1353
  // `<object>`. List of URIs to archives
1338
1354
  axis: null,
1339
1355
  // `<td>` and `<th>`. Use `scope` on `<th>`
@@ -1367,9 +1383,9 @@ const Ia = Je({
1367
1383
  // `<object>`
1368
1384
  color: null,
1369
1385
  // `<font>` and `<hr>`. Use CSS instead
1370
- compact: Y,
1386
+ compact: G,
1371
1387
  // Lists. Use CSS to reduce space between items instead
1372
- declare: Y,
1388
+ declare: G,
1373
1389
  // `<object>`
1374
1390
  event: null,
1375
1391
  // `<script>`
@@ -1393,13 +1409,13 @@ const Ia = Je({
1393
1409
  // `<body>`
1394
1410
  marginWidth: L,
1395
1411
  // `<body>`
1396
- noResize: Y,
1412
+ noResize: G,
1397
1413
  // `<frame>`
1398
- noHref: Y,
1414
+ noHref: G,
1399
1415
  // `<area>`. Use no href instead of an explicit `nohref`
1400
- noShade: Y,
1416
+ noShade: G,
1401
1417
  // `<hr>`. Use background-color and height instead of borders
1402
- noWrap: Y,
1418
+ noWrap: G,
1403
1419
  // `<td>` and `<th>`
1404
1420
  object: null,
1405
1421
  // `<applet>`
@@ -1439,11 +1455,11 @@ const Ia = Je({
1439
1455
  allowTransparency: null,
1440
1456
  autoCorrect: null,
1441
1457
  autoSave: null,
1442
- credentialless: Y,
1443
- disablePictureInPicture: Y,
1444
- disableRemotePlayback: Y,
1458
+ credentialless: G,
1459
+ disablePictureInPicture: G,
1460
+ disableRemotePlayback: G,
1445
1461
  exportParts: Ue,
1446
- part: ne,
1462
+ part: re,
1447
1463
  prefix: null,
1448
1464
  property: null,
1449
1465
  results: L,
@@ -1652,7 +1668,7 @@ const Ia = Je({
1652
1668
  by: null,
1653
1669
  calcMode: null,
1654
1670
  capHeight: L,
1655
- className: ne,
1671
+ className: re,
1656
1672
  clip: null,
1657
1673
  clipPath: null,
1658
1674
  clipPathUnits: null,
@@ -1679,7 +1695,7 @@ const Ia = Je({
1679
1695
  dur: null,
1680
1696
  divisor: L,
1681
1697
  dominantBaseline: null,
1682
- download: Y,
1698
+ download: G,
1683
1699
  dx: null,
1684
1700
  dy: null,
1685
1701
  edgeMode: null,
@@ -1888,7 +1904,7 @@ const Ia = Je({
1888
1904
  patternTransform: null,
1889
1905
  patternUnits: null,
1890
1906
  phase: null,
1891
- ping: ne,
1907
+ ping: re,
1892
1908
  pitch: null,
1893
1909
  playbackOrder: null,
1894
1910
  pointerEvents: null,
@@ -2059,7 +2075,7 @@ const Ia = Je({
2059
2075
  }, Aa = /[A-Z]/g, Un = /-[a-z]/g, Na = /^data[-\w.:]+$/i;
2060
2076
  function Da(e, t) {
2061
2077
  const n = on(t);
2062
- let r = t, i = he;
2078
+ let r = t, i = ge;
2063
2079
  if (n in e.normal)
2064
2080
  return e.property[e.normal[n]];
2065
2081
  if (n.length > 4 && n.slice(0, 4) === "data" && Na.test(t)) {
@@ -2095,30 +2111,30 @@ function qa(e, t) {
2095
2111
  if (!e) return [];
2096
2112
  t = t || {};
2097
2113
  var n = 1, r = 1;
2098
- function i(m) {
2099
- var w = m.match(Ra);
2114
+ function i(g) {
2115
+ var w = g.match(Ra);
2100
2116
  w && (n += w.length);
2101
- var C = m.lastIndexOf(Ua);
2102
- r = ~C ? m.length - C : r + m.length;
2117
+ var C = g.lastIndexOf(Ua);
2118
+ r = ~C ? g.length - C : r + g.length;
2103
2119
  }
2104
2120
  function o() {
2105
- var m = { line: n, column: r };
2121
+ var g = { line: n, column: r };
2106
2122
  return function(w) {
2107
- return w.position = new a(m), u(), w;
2123
+ return w.position = new a(g), u(), w;
2108
2124
  };
2109
2125
  }
2110
- function a(m) {
2111
- this.start = m, this.end = { line: n, column: r }, this.source = t.source;
2126
+ function a(g) {
2127
+ this.start = g, this.end = { line: n, column: r }, this.source = t.source;
2112
2128
  }
2113
2129
  a.prototype.content = e;
2114
- function l(m) {
2130
+ function l(g) {
2115
2131
  var w = new Error(
2116
- t.source + ":" + n + ":" + r + ": " + m
2132
+ t.source + ":" + n + ":" + r + ": " + g
2117
2133
  );
2118
- if (w.reason = m, w.filename = t.source, w.line = n, w.column = r, w.source = e, !t.silent) throw w;
2134
+ if (w.reason = g, w.filename = t.source, w.line = n, w.column = r, w.source = e, !t.silent) throw w;
2119
2135
  }
2120
- function s(m) {
2121
- var w = m.exec(e);
2136
+ function s(g) {
2137
+ var w = g.exec(e);
2122
2138
  if (w) {
2123
2139
  var C = w[0];
2124
2140
  return i(C), e = e.slice(C.length), w;
@@ -2127,31 +2143,31 @@ function qa(e, t) {
2127
2143
  function u() {
2128
2144
  s(_a);
2129
2145
  }
2130
- function p(m) {
2146
+ function p(g) {
2131
2147
  var w;
2132
- for (m = m || []; w = c(); )
2133
- w !== !1 && m.push(w);
2134
- return m;
2148
+ for (g = g || []; w = c(); )
2149
+ w !== !1 && g.push(w);
2150
+ return g;
2135
2151
  }
2136
2152
  function c() {
2137
- var m = o();
2153
+ var g = o();
2138
2154
  if (!(Wn != e.charAt(0) || qn != e.charAt(1))) {
2139
2155
  for (var w = 2; je != e.charAt(w) && (qn != e.charAt(w) || Wn != e.charAt(w + 1)); )
2140
2156
  ++w;
2141
2157
  if (w += 2, je === e.charAt(w - 1))
2142
2158
  return l("End of comment missing");
2143
2159
  var C = e.slice(2, w - 2);
2144
- return r += 2, i(C), e = e.slice(w), r += 2, m({
2160
+ return r += 2, i(C), e = e.slice(w), r += 2, g({
2145
2161
  type: Va,
2146
2162
  comment: C
2147
2163
  });
2148
2164
  }
2149
2165
  }
2150
2166
  function f() {
2151
- var m = o(), w = s(Oa);
2167
+ var g = o(), w = s(Oa);
2152
2168
  if (w) {
2153
2169
  if (c(), !s(Ba)) return l("property missing ':'");
2154
- var C = s($a), b = m({
2170
+ var C = s($a), b = g({
2155
2171
  type: Wa,
2156
2172
  property: Yn(w[0].replace(Vn, je)),
2157
2173
  value: C ? Yn(C[0].replace(Vn, je)) : je
@@ -2160,11 +2176,11 @@ function qa(e, t) {
2160
2176
  }
2161
2177
  }
2162
2178
  function d() {
2163
- var m = [];
2164
- p(m);
2179
+ var g = [];
2180
+ p(g);
2165
2181
  for (var w; w = f(); )
2166
- w !== !1 && (m.push(w), p(m));
2167
- return m;
2182
+ w !== !1 && (g.push(w), p(g));
2183
+ return g;
2168
2184
  }
2169
2185
  return u(), d();
2170
2186
  }
@@ -2733,7 +2749,7 @@ function li(e, t) {
2733
2749
  function Se(e) {
2734
2750
  return e.replace(/[\t\n\r ]+/g, " ").replace(/^ | $/g, "").toLowerCase().toUpperCase();
2735
2751
  }
2736
- const de = _e(/[A-Za-z]/), ue = _e(/[\dA-Za-z]/), Ro = _e(/[#-'*+\--9=?A-Z^-~]/);
2752
+ const fe = _e(/[A-Za-z]/), ue = _e(/[\dA-Za-z]/), Ro = _e(/[#-'*+\--9=?A-Z^-~]/);
2737
2753
  function At(e) {
2738
2754
  return (
2739
2755
  // Special whitespace codes (which have negative values), C0 and Control
@@ -2777,7 +2793,7 @@ function Ze(e) {
2777
2793
  }
2778
2794
  return t.join("") + e.slice(r);
2779
2795
  }
2780
- function Z(e, t, n, r) {
2796
+ function ee(e, t, n, r) {
2781
2797
  const i = r ? r - 1 : Number.POSITIVE_INFINITY;
2782
2798
  let o = 0;
2783
2799
  return a;
@@ -2800,7 +2816,7 @@ function $o(e) {
2800
2816
  e.consume(l);
2801
2817
  return;
2802
2818
  }
2803
- return e.enter("lineEnding"), e.consume(l), e.exit("lineEnding"), Z(e, t, "linePrefix");
2819
+ return e.enter("lineEnding"), e.consume(l), e.exit("lineEnding"), ee(e, t, "linePrefix");
2804
2820
  }
2805
2821
  function i(l) {
2806
2822
  return e.enter("paragraph"), o(l);
@@ -2831,28 +2847,28 @@ function jo(e) {
2831
2847
  return l;
2832
2848
  function l(v) {
2833
2849
  if (r < n.length) {
2834
- const N = n[r];
2835
- return t.containerState = N[1], e.attempt(N[0].continuation, s, u)(v);
2850
+ const A = n[r];
2851
+ return t.containerState = A[1], e.attempt(A[0].continuation, s, u)(v);
2836
2852
  }
2837
2853
  return u(v);
2838
2854
  }
2839
2855
  function s(v) {
2840
2856
  if (r++, t.containerState._closeFlow) {
2841
2857
  t.containerState._closeFlow = void 0, i && S();
2842
- const N = t.events.length;
2843
- let M = N, k;
2858
+ const A = t.events.length;
2859
+ let M = A, k;
2844
2860
  for (; M--; )
2845
2861
  if (t.events[M][0] === "exit" && t.events[M][1].type === "chunkFlow") {
2846
2862
  k = t.events[M][1].end;
2847
2863
  break;
2848
2864
  }
2849
2865
  b(r);
2850
- let A = N;
2851
- for (; A < t.events.length; )
2852
- t.events[A][1].end = {
2866
+ let D = A;
2867
+ for (; D < t.events.length; )
2868
+ t.events[D][1].end = {
2853
2869
  ...k
2854
- }, A++;
2855
- return be(t.events, M + 1, 0, t.events.slice(N)), t.events.length = A, u(v);
2870
+ }, D++;
2871
+ return be(t.events, M + 1, 0, t.events.slice(A)), t.events.length = D, u(v);
2856
2872
  }
2857
2873
  return l(v);
2858
2874
  }
@@ -2861,7 +2877,7 @@ function jo(e) {
2861
2877
  if (!i)
2862
2878
  return f(v);
2863
2879
  if (i.currentConstruct && i.currentConstruct.concrete)
2864
- return m(v);
2880
+ return g(v);
2865
2881
  t.interrupt = !!(i.currentConstruct && !i._gfmTableDynamicInterruptHack);
2866
2882
  }
2867
2883
  return t.containerState = {}, e.check(er, p, c)(v);
@@ -2870,15 +2886,15 @@ function jo(e) {
2870
2886
  return i && S(), b(r), f(v);
2871
2887
  }
2872
2888
  function c(v) {
2873
- return t.parser.lazy[t.now().line] = r !== n.length, a = t.now().offset, m(v);
2889
+ return t.parser.lazy[t.now().line] = r !== n.length, a = t.now().offset, g(v);
2874
2890
  }
2875
2891
  function f(v) {
2876
- return t.containerState = {}, e.attempt(er, d, m)(v);
2892
+ return t.containerState = {}, e.attempt(er, d, g)(v);
2877
2893
  }
2878
2894
  function d(v) {
2879
2895
  return r++, n.push([t.currentConstruct, t.containerState]), f(v);
2880
2896
  }
2881
- function m(v) {
2897
+ function g(v) {
2882
2898
  if (v === null) {
2883
2899
  i && S(), b(0), e.consume(v);
2884
2900
  return;
@@ -2896,9 +2912,9 @@ function jo(e) {
2896
2912
  }
2897
2913
  return U(v) ? (e.consume(v), C(e.exit("chunkFlow")), r = 0, t.interrupt = void 0, l) : (e.consume(v), w);
2898
2914
  }
2899
- function C(v, N) {
2915
+ function C(v, A) {
2900
2916
  const M = t.sliceStream(v);
2901
- if (N && M.push(null), v.previous = o, o && (o.next = v), o = v, i.defineSkip(v.start), i.write(M), t.parser.lazy[v.start.line]) {
2917
+ if (A && M.push(null), v.previous = o, o && (o.next = v), o = v, i.defineSkip(v.start), i.write(M), t.parser.lazy[v.start.line]) {
2902
2918
  let k = i.events.length;
2903
2919
  for (; k--; )
2904
2920
  if (
@@ -2908,27 +2924,27 @@ function jo(e) {
2908
2924
  i.events[k][1].end.offset > a)
2909
2925
  )
2910
2926
  return;
2911
- const A = t.events.length;
2912
- let _ = A, O, x;
2913
- for (; _--; )
2914
- if (t.events[_][0] === "exit" && t.events[_][1].type === "chunkFlow") {
2927
+ const D = t.events.length;
2928
+ let F = D, O, x;
2929
+ for (; F--; )
2930
+ if (t.events[F][0] === "exit" && t.events[F][1].type === "chunkFlow") {
2915
2931
  if (O) {
2916
- x = t.events[_][1].end;
2932
+ x = t.events[F][1].end;
2917
2933
  break;
2918
2934
  }
2919
2935
  O = !0;
2920
2936
  }
2921
- for (b(r), k = A; k < t.events.length; )
2937
+ for (b(r), k = D; k < t.events.length; )
2922
2938
  t.events[k][1].end = {
2923
2939
  ...x
2924
2940
  }, k++;
2925
- be(t.events, _ + 1, 0, t.events.slice(A)), t.events.length = k;
2941
+ be(t.events, F + 1, 0, t.events.slice(D)), t.events.length = k;
2926
2942
  }
2927
2943
  }
2928
2944
  function b(v) {
2929
- let N = n.length;
2930
- for (; N-- > v; ) {
2931
- const M = n[N];
2945
+ let A = n.length;
2946
+ for (; A-- > v; ) {
2947
+ const M = n[A];
2932
2948
  t.containerState = M[1], M[0].exit.call(t, e);
2933
2949
  }
2934
2950
  n.length = v;
@@ -2938,7 +2954,7 @@ function jo(e) {
2938
2954
  }
2939
2955
  }
2940
2956
  function Uo(e, t, n) {
2941
- return Z(e, e.attempt(this.parser.constructs.document, t, n), "linePrefix", this.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4);
2957
+ return ee(e, e.attempt(this.parser.constructs.document, t, n), "linePrefix", this.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4);
2942
2958
  }
2943
2959
  function Qe(e) {
2944
2960
  if (e === null || ie(e) || Ve(e))
@@ -3043,7 +3059,7 @@ function Yo(e, t, n) {
3043
3059
  return e.enter("autolink"), e.enter("autolinkMarker"), e.consume(d), e.exit("autolinkMarker"), e.enter("autolinkProtocol"), o;
3044
3060
  }
3045
3061
  function o(d) {
3046
- return de(d) ? (e.consume(d), a) : d === 64 ? n(d) : u(d);
3062
+ return fe(d) ? (e.consume(d), a) : d === 64 ? n(d) : u(d);
3047
3063
  }
3048
3064
  function a(d) {
3049
3065
  return d === 43 || d === 45 || d === 46 || ue(d) ? (r = 1, l(d)) : u(d);
@@ -3065,8 +3081,8 @@ function Yo(e, t, n) {
3065
3081
  }
3066
3082
  function f(d) {
3067
3083
  if ((d === 45 || ue(d)) && r++ < 63) {
3068
- const m = d === 45 ? f : c;
3069
- return e.consume(d), m;
3084
+ const g = d === 45 ? f : c;
3085
+ return e.consume(d), g;
3070
3086
  }
3071
3087
  return n(d);
3072
3088
  }
@@ -3078,7 +3094,7 @@ const bt = {
3078
3094
  function Go(e, t, n) {
3079
3095
  return r;
3080
3096
  function r(o) {
3081
- return Q(o) ? Z(e, i, "linePrefix")(o) : i(o);
3097
+ return Q(o) ? ee(e, i, "linePrefix")(o) : i(o);
3082
3098
  }
3083
3099
  function i(o) {
3084
3100
  return o === null || U(o) ? t(o) : n(o);
@@ -3112,7 +3128,7 @@ function Ko(e, t, n) {
3112
3128
  const r = this;
3113
3129
  return i;
3114
3130
  function i(a) {
3115
- return Q(a) ? Z(e, o, "linePrefix", r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(a) : o(a);
3131
+ return Q(a) ? ee(e, o, "linePrefix", r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(a) : o(a);
3116
3132
  }
3117
3133
  function o(a) {
3118
3134
  return e.attempt(si, t, n)(a);
@@ -3178,63 +3194,63 @@ function el(e, t, n) {
3178
3194
  return u(k);
3179
3195
  }
3180
3196
  function u(k) {
3181
- const A = r.events[r.events.length - 1];
3182
- return o = A && A[1].type === "linePrefix" ? A[2].sliceSerialize(A[1], !0).length : 0, l = k, e.enter("codeFenced"), e.enter("codeFencedFence"), e.enter("codeFencedFenceSequence"), p(k);
3197
+ const D = r.events[r.events.length - 1];
3198
+ return o = D && D[1].type === "linePrefix" ? D[2].sliceSerialize(D[1], !0).length : 0, l = k, e.enter("codeFenced"), e.enter("codeFencedFence"), e.enter("codeFencedFenceSequence"), p(k);
3183
3199
  }
3184
3200
  function p(k) {
3185
- return k === l ? (a++, e.consume(k), p) : a < 3 ? n(k) : (e.exit("codeFencedFenceSequence"), Q(k) ? Z(e, c, "whitespace")(k) : c(k));
3201
+ return k === l ? (a++, e.consume(k), p) : a < 3 ? n(k) : (e.exit("codeFencedFenceSequence"), Q(k) ? ee(e, c, "whitespace")(k) : c(k));
3186
3202
  }
3187
3203
  function c(k) {
3188
- return k === null || U(k) ? (e.exit("codeFencedFence"), r.interrupt ? t(k) : e.check(nr, w, N)(k)) : (e.enter("codeFencedFenceInfo"), e.enter("chunkString", {
3204
+ return k === null || U(k) ? (e.exit("codeFencedFence"), r.interrupt ? t(k) : e.check(nr, w, A)(k)) : (e.enter("codeFencedFenceInfo"), e.enter("chunkString", {
3189
3205
  contentType: "string"
3190
3206
  }), f(k));
3191
3207
  }
3192
3208
  function f(k) {
3193
- return k === null || U(k) ? (e.exit("chunkString"), e.exit("codeFencedFenceInfo"), c(k)) : Q(k) ? (e.exit("chunkString"), e.exit("codeFencedFenceInfo"), Z(e, d, "whitespace")(k)) : k === 96 && k === l ? n(k) : (e.consume(k), f);
3209
+ return k === null || U(k) ? (e.exit("chunkString"), e.exit("codeFencedFenceInfo"), c(k)) : Q(k) ? (e.exit("chunkString"), e.exit("codeFencedFenceInfo"), ee(e, d, "whitespace")(k)) : k === 96 && k === l ? n(k) : (e.consume(k), f);
3194
3210
  }
3195
3211
  function d(k) {
3196
3212
  return k === null || U(k) ? c(k) : (e.enter("codeFencedFenceMeta"), e.enter("chunkString", {
3197
3213
  contentType: "string"
3198
- }), m(k));
3214
+ }), g(k));
3199
3215
  }
3200
- function m(k) {
3201
- return k === null || U(k) ? (e.exit("chunkString"), e.exit("codeFencedFenceMeta"), c(k)) : k === 96 && k === l ? n(k) : (e.consume(k), m);
3216
+ function g(k) {
3217
+ return k === null || U(k) ? (e.exit("chunkString"), e.exit("codeFencedFenceMeta"), c(k)) : k === 96 && k === l ? n(k) : (e.consume(k), g);
3202
3218
  }
3203
3219
  function w(k) {
3204
- return e.attempt(i, N, C)(k);
3220
+ return e.attempt(i, A, C)(k);
3205
3221
  }
3206
3222
  function C(k) {
3207
3223
  return e.enter("lineEnding"), e.consume(k), e.exit("lineEnding"), b;
3208
3224
  }
3209
3225
  function b(k) {
3210
- return o > 0 && Q(k) ? Z(e, S, "linePrefix", o + 1)(k) : S(k);
3226
+ return o > 0 && Q(k) ? ee(e, S, "linePrefix", o + 1)(k) : S(k);
3211
3227
  }
3212
3228
  function S(k) {
3213
- return k === null || U(k) ? e.check(nr, w, N)(k) : (e.enter("codeFlowValue"), v(k));
3229
+ return k === null || U(k) ? e.check(nr, w, A)(k) : (e.enter("codeFlowValue"), v(k));
3214
3230
  }
3215
3231
  function v(k) {
3216
3232
  return k === null || U(k) ? (e.exit("codeFlowValue"), S(k)) : (e.consume(k), v);
3217
3233
  }
3218
- function N(k) {
3234
+ function A(k) {
3219
3235
  return e.exit("codeFenced"), t(k);
3220
3236
  }
3221
- function M(k, A, _) {
3237
+ function M(k, D, F) {
3222
3238
  let O = 0;
3223
3239
  return x;
3224
- function x(z) {
3225
- return k.enter("lineEnding"), k.consume(z), k.exit("lineEnding"), I;
3240
+ function x(N) {
3241
+ return k.enter("lineEnding"), k.consume(N), k.exit("lineEnding"), I;
3226
3242
  }
3227
- function I(z) {
3228
- return k.enter("codeFencedFence"), Q(z) ? Z(k, D, "linePrefix", r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(z) : D(z);
3243
+ function I(N) {
3244
+ return k.enter("codeFencedFence"), Q(N) ? ee(k, P, "linePrefix", r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(N) : P(N);
3229
3245
  }
3230
- function D(z) {
3231
- return z === l ? (k.enter("codeFencedFenceSequence"), $(z)) : _(z);
3246
+ function P(N) {
3247
+ return N === l ? (k.enter("codeFencedFenceSequence"), j(N)) : F(N);
3232
3248
  }
3233
- function $(z) {
3234
- return z === l ? (O++, k.consume(z), $) : O >= a ? (k.exit("codeFencedFenceSequence"), Q(z) ? Z(k, P, "whitespace")(z) : P(z)) : _(z);
3249
+ function j(N) {
3250
+ return N === l ? (O++, k.consume(N), j) : O >= a ? (k.exit("codeFencedFenceSequence"), Q(N) ? ee(k, R, "whitespace")(N) : R(N)) : F(N);
3235
3251
  }
3236
- function P(z) {
3237
- return z === null || U(z) ? (k.exit("codeFencedFence"), A(z)) : _(z);
3252
+ function R(N) {
3253
+ return N === null || U(N) ? (k.exit("codeFencedFence"), D(N)) : F(N);
3238
3254
  }
3239
3255
  }
3240
3256
  }
@@ -3259,7 +3275,7 @@ function rl(e, t, n) {
3259
3275
  const r = this;
3260
3276
  return i;
3261
3277
  function i(u) {
3262
- return e.enter("codeIndented"), Z(e, o, "linePrefix", 5)(u);
3278
+ return e.enter("codeIndented"), ee(e, o, "linePrefix", 5)(u);
3263
3279
  }
3264
3280
  function o(u) {
3265
3281
  const p = r.events[r.events.length - 1];
@@ -3279,7 +3295,7 @@ function il(e, t, n) {
3279
3295
  const r = this;
3280
3296
  return i;
3281
3297
  function i(a) {
3282
- return r.parser.lazy[r.now().line] ? n(a) : U(a) ? (e.enter("lineEnding"), e.consume(a), e.exit("lineEnding"), i) : Z(e, o, "linePrefix", 5)(a);
3298
+ return r.parser.lazy[r.now().line] ? n(a) : U(a) ? (e.enter("lineEnding"), e.consume(a), e.exit("lineEnding"), i) : ee(e, o, "linePrefix", 5)(a);
3283
3299
  }
3284
3300
  function o(a) {
3285
3301
  const l = r.events[r.events.length - 1];
@@ -3530,7 +3546,7 @@ function cl(e, t) {
3530
3546
  let a = n._tokenizer;
3531
3547
  a || (a = r.parser[n.contentType](n.start), n._contentTypeTextTrailing && (a._contentTypeTextTrailing = !0));
3532
3548
  const l = a.events, s = [], u = {};
3533
- let p, c, f = -1, d = n, m = 0, w = 0;
3549
+ let p, c, f = -1, d = n, g = 0, w = 0;
3534
3550
  const C = [w];
3535
3551
  for (; d; ) {
3536
3552
  for (; e.get(++i)[1] !== d; )
@@ -3545,7 +3561,7 @@ function cl(e, t) {
3545
3561
  s.push([S, S + b.length - 1]), e.splice(S, 2, b);
3546
3562
  }
3547
3563
  for (s.reverse(), f = -1; ++f < s.length; )
3548
- u[m + s[f][0]] = m + s[f][1], m += s[f][1] - s[f][0] - 1;
3564
+ u[g + s[f][0]] = g + s[f][1], g += s[f][1] - s[f][0] - 1;
3549
3565
  return u;
3550
3566
  }
3551
3567
  const pl = {
@@ -3583,7 +3599,7 @@ function gl(e, t, n) {
3583
3599
  const r = this;
3584
3600
  return i;
3585
3601
  function i(a) {
3586
- return e.exit("chunkContent"), e.enter("lineEnding"), e.consume(a), e.exit("lineEnding"), Z(e, o, "linePrefix");
3602
+ return e.exit("chunkContent"), e.enter("lineEnding"), e.consume(a), e.exit("lineEnding"), ee(e, o, "linePrefix");
3587
3603
  }
3588
3604
  function o(a) {
3589
3605
  if (a === null || U(a))
@@ -3607,9 +3623,9 @@ function di(e, t, n, r, i, o, a, l, s) {
3607
3623
  }), d(b));
3608
3624
  }
3609
3625
  function d(b) {
3610
- return b === 62 ? (e.exit("chunkString"), e.exit(l), f(b)) : b === null || b === 60 || U(b) ? n(b) : (e.consume(b), b === 92 ? m : d);
3626
+ return b === 62 ? (e.exit("chunkString"), e.exit(l), f(b)) : b === null || b === 60 || U(b) ? n(b) : (e.consume(b), b === 92 ? g : d);
3611
3627
  }
3612
- function m(b) {
3628
+ function g(b) {
3613
3629
  return b === 60 || b === 62 || b === 92 ? (e.consume(b), d) : d(b);
3614
3630
  }
3615
3631
  function w(b) {
@@ -3653,7 +3669,7 @@ function hi(e, t, n, r, i, o) {
3653
3669
  return f === a ? (e.enter(i), e.consume(f), e.exit(i), e.exit(r), t) : (e.enter(o), u(f));
3654
3670
  }
3655
3671
  function u(f) {
3656
- return f === a ? (e.exit(o), s(a)) : f === null ? n(f) : U(f) ? (e.enter("lineEnding"), e.consume(f), e.exit("lineEnding"), Z(e, u, "linePrefix")) : (e.enter("chunkString", {
3672
+ return f === a ? (e.exit(o), s(a)) : f === null ? n(f) : U(f) ? (e.enter("lineEnding"), e.consume(f), e.exit("lineEnding"), ee(e, u, "linePrefix")) : (e.enter("chunkString", {
3657
3673
  contentType: "string"
3658
3674
  }), p(f));
3659
3675
  }
@@ -3668,7 +3684,7 @@ function dt(e, t) {
3668
3684
  let n;
3669
3685
  return r;
3670
3686
  function r(i) {
3671
- return U(i) ? (e.enter("lineEnding"), e.consume(i), e.exit("lineEnding"), n = !0, r) : Q(i) ? Z(e, r, n ? "linePrefix" : "lineSuffix")(i) : t(i);
3687
+ return U(i) ? (e.enter("lineEnding"), e.consume(i), e.exit("lineEnding"), n = !0, r) : Q(i) ? ee(e, r, n ? "linePrefix" : "lineSuffix")(i) : t(i);
3672
3688
  }
3673
3689
  }
3674
3690
  const ml = {
@@ -3720,7 +3736,7 @@ function bl(e, t, n) {
3720
3736
  return e.attempt(xl, c, c)(d);
3721
3737
  }
3722
3738
  function c(d) {
3723
- return Q(d) ? Z(e, f, "whitespace")(d) : f(d);
3739
+ return Q(d) ? ee(e, f, "whitespace")(d) : f(d);
3724
3740
  }
3725
3741
  function f(d) {
3726
3742
  return d === null || U(d) ? (e.exit("definition"), r.parser.defined.push(i), t(d)) : n(d);
@@ -3735,7 +3751,7 @@ function wl(e, t, n) {
3735
3751
  return hi(e, o, n, "definitionTitle", "definitionTitleMarker", "definitionTitleString")(l);
3736
3752
  }
3737
3753
  function o(l) {
3738
- return Q(l) ? Z(e, a, "whitespace")(l) : a(l);
3754
+ return Q(l) ? ee(e, a, "whitespace")(l) : a(l);
3739
3755
  }
3740
3756
  function a(l) {
3741
3757
  return l === null || U(l) ? t(l) : n(l);
@@ -3785,7 +3801,7 @@ function Sl(e, t, n) {
3785
3801
  return p === 35 && r++ < 6 ? (e.consume(p), a) : p === null || ie(p) ? (e.exit("atxHeadingSequence"), l(p)) : n(p);
3786
3802
  }
3787
3803
  function l(p) {
3788
- return p === 35 ? (e.enter("atxHeadingSequence"), s(p)) : p === null || U(p) ? (e.exit("atxHeading"), t(p)) : Q(p) ? Z(e, l, "whitespace")(p) : (e.enter("atxHeadingText"), u(p));
3804
+ return p === 35 ? (e.enter("atxHeadingSequence"), s(p)) : p === null || U(p) ? (e.exit("atxHeading"), t(p)) : Q(p) ? ee(e, l, "whitespace")(p) : (e.enter("atxHeadingText"), u(p));
3789
3805
  }
3790
3806
  function s(p) {
3791
3807
  return p === 35 ? (e.consume(p), s) : (e.exit("atxHeadingSequence"), l(p));
@@ -3886,51 +3902,51 @@ function Nl(e, t, n) {
3886
3902
  return e.enter("htmlFlow"), e.enter("htmlFlowData"), e.consume(y), c;
3887
3903
  }
3888
3904
  function c(y) {
3889
- return y === 33 ? (e.consume(y), f) : y === 47 ? (e.consume(y), o = !0, w) : y === 63 ? (e.consume(y), i = 3, r.interrupt ? t : g) : de(y) ? (e.consume(y), a = String.fromCharCode(y), C) : n(y);
3905
+ return y === 33 ? (e.consume(y), f) : y === 47 ? (e.consume(y), o = !0, w) : y === 63 ? (e.consume(y), i = 3, r.interrupt ? t : m) : fe(y) ? (e.consume(y), a = String.fromCharCode(y), C) : n(y);
3890
3906
  }
3891
3907
  function f(y) {
3892
- return y === 45 ? (e.consume(y), i = 2, d) : y === 91 ? (e.consume(y), i = 5, l = 0, m) : de(y) ? (e.consume(y), i = 4, r.interrupt ? t : g) : n(y);
3908
+ return y === 45 ? (e.consume(y), i = 2, d) : y === 91 ? (e.consume(y), i = 5, l = 0, g) : fe(y) ? (e.consume(y), i = 4, r.interrupt ? t : m) : n(y);
3893
3909
  }
3894
3910
  function d(y) {
3895
- return y === 45 ? (e.consume(y), r.interrupt ? t : g) : n(y);
3911
+ return y === 45 ? (e.consume(y), r.interrupt ? t : m) : n(y);
3896
3912
  }
3897
- function m(y) {
3898
- const ge = "CDATA[";
3899
- return y === ge.charCodeAt(l++) ? (e.consume(y), l === ge.length ? r.interrupt ? t : D : m) : n(y);
3913
+ function g(y) {
3914
+ const pe = "CDATA[";
3915
+ return y === pe.charCodeAt(l++) ? (e.consume(y), l === pe.length ? r.interrupt ? t : P : g) : n(y);
3900
3916
  }
3901
3917
  function w(y) {
3902
- return de(y) ? (e.consume(y), a = String.fromCharCode(y), C) : n(y);
3918
+ return fe(y) ? (e.consume(y), a = String.fromCharCode(y), C) : n(y);
3903
3919
  }
3904
3920
  function C(y) {
3905
3921
  if (y === null || y === 47 || y === 62 || ie(y)) {
3906
- const ge = y === 47, ze = a.toLowerCase();
3907
- return !ge && !o && ir.includes(ze) ? (i = 1, r.interrupt ? t(y) : D(y)) : El.includes(a.toLowerCase()) ? (i = 6, ge ? (e.consume(y), b) : r.interrupt ? t(y) : D(y)) : (i = 7, r.interrupt && !r.parser.lazy[r.now().line] ? n(y) : o ? S(y) : v(y));
3922
+ const pe = y === 47, ze = a.toLowerCase();
3923
+ return !pe && !o && ir.includes(ze) ? (i = 1, r.interrupt ? t(y) : P(y)) : El.includes(a.toLowerCase()) ? (i = 6, pe ? (e.consume(y), b) : r.interrupt ? t(y) : P(y)) : (i = 7, r.interrupt && !r.parser.lazy[r.now().line] ? n(y) : o ? S(y) : v(y));
3908
3924
  }
3909
3925
  return y === 45 || ue(y) ? (e.consume(y), a += String.fromCharCode(y), C) : n(y);
3910
3926
  }
3911
3927
  function b(y) {
3912
- return y === 62 ? (e.consume(y), r.interrupt ? t : D) : n(y);
3928
+ return y === 62 ? (e.consume(y), r.interrupt ? t : P) : n(y);
3913
3929
  }
3914
3930
  function S(y) {
3915
3931
  return Q(y) ? (e.consume(y), S) : x(y);
3916
3932
  }
3917
3933
  function v(y) {
3918
- return y === 47 ? (e.consume(y), x) : y === 58 || y === 95 || de(y) ? (e.consume(y), N) : Q(y) ? (e.consume(y), v) : x(y);
3934
+ return y === 47 ? (e.consume(y), x) : y === 58 || y === 95 || fe(y) ? (e.consume(y), A) : Q(y) ? (e.consume(y), v) : x(y);
3919
3935
  }
3920
- function N(y) {
3921
- return y === 45 || y === 46 || y === 58 || y === 95 || ue(y) ? (e.consume(y), N) : M(y);
3936
+ function A(y) {
3937
+ return y === 45 || y === 46 || y === 58 || y === 95 || ue(y) ? (e.consume(y), A) : M(y);
3922
3938
  }
3923
3939
  function M(y) {
3924
3940
  return y === 61 ? (e.consume(y), k) : Q(y) ? (e.consume(y), M) : v(y);
3925
3941
  }
3926
3942
  function k(y) {
3927
- return y === null || y === 60 || y === 61 || y === 62 || y === 96 ? n(y) : y === 34 || y === 39 ? (e.consume(y), s = y, A) : Q(y) ? (e.consume(y), k) : _(y);
3943
+ return y === null || y === 60 || y === 61 || y === 62 || y === 96 ? n(y) : y === 34 || y === 39 ? (e.consume(y), s = y, D) : Q(y) ? (e.consume(y), k) : F(y);
3928
3944
  }
3929
- function A(y) {
3930
- return y === s ? (e.consume(y), s = null, O) : y === null || U(y) ? n(y) : (e.consume(y), A);
3945
+ function D(y) {
3946
+ return y === s ? (e.consume(y), s = null, O) : y === null || U(y) ? n(y) : (e.consume(y), D);
3931
3947
  }
3932
- function _(y) {
3933
- return y === null || y === 34 || y === 39 || y === 47 || y === 60 || y === 61 || y === 62 || y === 96 || ie(y) ? M(y) : (e.consume(y), _);
3948
+ function F(y) {
3949
+ return y === null || y === 34 || y === 39 || y === 47 || y === 60 || y === 61 || y === 62 || y === 96 || ie(y) ? M(y) : (e.consume(y), F);
3934
3950
  }
3935
3951
  function O(y) {
3936
3952
  return y === 47 || y === 62 || Q(y) ? v(y) : n(y);
@@ -3939,43 +3955,43 @@ function Nl(e, t, n) {
3939
3955
  return y === 62 ? (e.consume(y), I) : n(y);
3940
3956
  }
3941
3957
  function I(y) {
3942
- return y === null || U(y) ? D(y) : Q(y) ? (e.consume(y), I) : n(y);
3958
+ return y === null || U(y) ? P(y) : Q(y) ? (e.consume(y), I) : n(y);
3943
3959
  }
3944
- function D(y) {
3945
- return y === 45 && i === 2 ? (e.consume(y), B) : y === 60 && i === 1 ? (e.consume(y), F) : y === 62 && i === 4 ? (e.consume(y), G) : y === 63 && i === 3 ? (e.consume(y), g) : y === 93 && i === 5 ? (e.consume(y), q) : U(y) && (i === 6 || i === 7) ? (e.exit("htmlFlowData"), e.check(zl, ee, $)(y)) : y === null || U(y) ? (e.exit("htmlFlowData"), $(y)) : (e.consume(y), D);
3960
+ function P(y) {
3961
+ return y === 45 && i === 2 ? (e.consume(y), q) : y === 60 && i === 1 ? (e.consume(y), E) : y === 62 && i === 4 ? (e.consume(y), $) : y === 63 && i === 3 ? (e.consume(y), m) : y === 93 && i === 5 ? (e.consume(y), V) : U(y) && (i === 6 || i === 7) ? (e.exit("htmlFlowData"), e.check(zl, Z, j)(y)) : y === null || U(y) ? (e.exit("htmlFlowData"), j(y)) : (e.consume(y), P);
3946
3962
  }
3947
- function $(y) {
3948
- return e.check(Tl, P, ee)(y);
3963
+ function j(y) {
3964
+ return e.check(Tl, R, Z)(y);
3949
3965
  }
3950
- function P(y) {
3951
- return e.enter("lineEnding"), e.consume(y), e.exit("lineEnding"), z;
3966
+ function R(y) {
3967
+ return e.enter("lineEnding"), e.consume(y), e.exit("lineEnding"), N;
3952
3968
  }
3953
- function z(y) {
3954
- return y === null || U(y) ? $(y) : (e.enter("htmlFlowData"), D(y));
3969
+ function N(y) {
3970
+ return y === null || U(y) ? j(y) : (e.enter("htmlFlowData"), P(y));
3955
3971
  }
3956
- function B(y) {
3957
- return y === 45 ? (e.consume(y), g) : D(y);
3972
+ function q(y) {
3973
+ return y === 45 ? (e.consume(y), m) : P(y);
3958
3974
  }
3959
- function F(y) {
3960
- return y === 47 ? (e.consume(y), a = "", j) : D(y);
3975
+ function E(y) {
3976
+ return y === 47 ? (e.consume(y), a = "", B) : P(y);
3961
3977
  }
3962
- function j(y) {
3978
+ function B(y) {
3963
3979
  if (y === 62) {
3964
- const ge = a.toLowerCase();
3965
- return ir.includes(ge) ? (e.consume(y), G) : D(y);
3980
+ const pe = a.toLowerCase();
3981
+ return ir.includes(pe) ? (e.consume(y), $) : P(y);
3966
3982
  }
3967
- return de(y) && a.length < 8 ? (e.consume(y), a += String.fromCharCode(y), j) : D(y);
3983
+ return fe(y) && a.length < 8 ? (e.consume(y), a += String.fromCharCode(y), B) : P(y);
3968
3984
  }
3969
- function q(y) {
3970
- return y === 93 ? (e.consume(y), g) : D(y);
3985
+ function V(y) {
3986
+ return y === 93 ? (e.consume(y), m) : P(y);
3971
3987
  }
3972
- function g(y) {
3973
- return y === 62 ? (e.consume(y), G) : y === 45 && i === 2 ? (e.consume(y), g) : D(y);
3988
+ function m(y) {
3989
+ return y === 62 ? (e.consume(y), $) : y === 45 && i === 2 ? (e.consume(y), m) : P(y);
3974
3990
  }
3975
- function G(y) {
3976
- return y === null || U(y) ? (e.exit("htmlFlowData"), ee(y)) : (e.consume(y), G);
3991
+ function $(y) {
3992
+ return y === null || U(y) ? (e.exit("htmlFlowData"), Z(y)) : (e.consume(y), $);
3977
3993
  }
3978
- function ee(y) {
3994
+ function Z(y) {
3979
3995
  return e.exit("htmlFlow"), t(y);
3980
3996
  }
3981
3997
  }
@@ -4003,93 +4019,93 @@ function Pl(e, t, n) {
4003
4019
  const r = this;
4004
4020
  let i, o, a;
4005
4021
  return l;
4006
- function l(g) {
4007
- return e.enter("htmlText"), e.enter("htmlTextData"), e.consume(g), s;
4022
+ function l(m) {
4023
+ return e.enter("htmlText"), e.enter("htmlTextData"), e.consume(m), s;
4008
4024
  }
4009
- function s(g) {
4010
- return g === 33 ? (e.consume(g), u) : g === 47 ? (e.consume(g), M) : g === 63 ? (e.consume(g), v) : de(g) ? (e.consume(g), _) : n(g);
4025
+ function s(m) {
4026
+ return m === 33 ? (e.consume(m), u) : m === 47 ? (e.consume(m), M) : m === 63 ? (e.consume(m), v) : fe(m) ? (e.consume(m), F) : n(m);
4011
4027
  }
4012
- function u(g) {
4013
- return g === 45 ? (e.consume(g), p) : g === 91 ? (e.consume(g), o = 0, m) : de(g) ? (e.consume(g), S) : n(g);
4028
+ function u(m) {
4029
+ return m === 45 ? (e.consume(m), p) : m === 91 ? (e.consume(m), o = 0, g) : fe(m) ? (e.consume(m), S) : n(m);
4014
4030
  }
4015
- function p(g) {
4016
- return g === 45 ? (e.consume(g), d) : n(g);
4031
+ function p(m) {
4032
+ return m === 45 ? (e.consume(m), d) : n(m);
4017
4033
  }
4018
- function c(g) {
4019
- return g === null ? n(g) : g === 45 ? (e.consume(g), f) : U(g) ? (a = c, F(g)) : (e.consume(g), c);
4034
+ function c(m) {
4035
+ return m === null ? n(m) : m === 45 ? (e.consume(m), f) : U(m) ? (a = c, E(m)) : (e.consume(m), c);
4020
4036
  }
4021
- function f(g) {
4022
- return g === 45 ? (e.consume(g), d) : c(g);
4037
+ function f(m) {
4038
+ return m === 45 ? (e.consume(m), d) : c(m);
4023
4039
  }
4024
- function d(g) {
4025
- return g === 62 ? B(g) : g === 45 ? f(g) : c(g);
4040
+ function d(m) {
4041
+ return m === 62 ? q(m) : m === 45 ? f(m) : c(m);
4026
4042
  }
4027
- function m(g) {
4028
- const G = "CDATA[";
4029
- return g === G.charCodeAt(o++) ? (e.consume(g), o === G.length ? w : m) : n(g);
4043
+ function g(m) {
4044
+ const $ = "CDATA[";
4045
+ return m === $.charCodeAt(o++) ? (e.consume(m), o === $.length ? w : g) : n(m);
4030
4046
  }
4031
- function w(g) {
4032
- return g === null ? n(g) : g === 93 ? (e.consume(g), C) : U(g) ? (a = w, F(g)) : (e.consume(g), w);
4047
+ function w(m) {
4048
+ return m === null ? n(m) : m === 93 ? (e.consume(m), C) : U(m) ? (a = w, E(m)) : (e.consume(m), w);
4033
4049
  }
4034
- function C(g) {
4035
- return g === 93 ? (e.consume(g), b) : w(g);
4050
+ function C(m) {
4051
+ return m === 93 ? (e.consume(m), b) : w(m);
4036
4052
  }
4037
- function b(g) {
4038
- return g === 62 ? B(g) : g === 93 ? (e.consume(g), b) : w(g);
4053
+ function b(m) {
4054
+ return m === 62 ? q(m) : m === 93 ? (e.consume(m), b) : w(m);
4039
4055
  }
4040
- function S(g) {
4041
- return g === null || g === 62 ? B(g) : U(g) ? (a = S, F(g)) : (e.consume(g), S);
4056
+ function S(m) {
4057
+ return m === null || m === 62 ? q(m) : U(m) ? (a = S, E(m)) : (e.consume(m), S);
4042
4058
  }
4043
- function v(g) {
4044
- return g === null ? n(g) : g === 63 ? (e.consume(g), N) : U(g) ? (a = v, F(g)) : (e.consume(g), v);
4059
+ function v(m) {
4060
+ return m === null ? n(m) : m === 63 ? (e.consume(m), A) : U(m) ? (a = v, E(m)) : (e.consume(m), v);
4045
4061
  }
4046
- function N(g) {
4047
- return g === 62 ? B(g) : v(g);
4062
+ function A(m) {
4063
+ return m === 62 ? q(m) : v(m);
4048
4064
  }
4049
- function M(g) {
4050
- return de(g) ? (e.consume(g), k) : n(g);
4065
+ function M(m) {
4066
+ return fe(m) ? (e.consume(m), k) : n(m);
4051
4067
  }
4052
- function k(g) {
4053
- return g === 45 || ue(g) ? (e.consume(g), k) : A(g);
4068
+ function k(m) {
4069
+ return m === 45 || ue(m) ? (e.consume(m), k) : D(m);
4054
4070
  }
4055
- function A(g) {
4056
- return U(g) ? (a = A, F(g)) : Q(g) ? (e.consume(g), A) : B(g);
4071
+ function D(m) {
4072
+ return U(m) ? (a = D, E(m)) : Q(m) ? (e.consume(m), D) : q(m);
4057
4073
  }
4058
- function _(g) {
4059
- return g === 45 || ue(g) ? (e.consume(g), _) : g === 47 || g === 62 || ie(g) ? O(g) : n(g);
4074
+ function F(m) {
4075
+ return m === 45 || ue(m) ? (e.consume(m), F) : m === 47 || m === 62 || ie(m) ? O(m) : n(m);
4060
4076
  }
4061
- function O(g) {
4062
- return g === 47 ? (e.consume(g), B) : g === 58 || g === 95 || de(g) ? (e.consume(g), x) : U(g) ? (a = O, F(g)) : Q(g) ? (e.consume(g), O) : B(g);
4077
+ function O(m) {
4078
+ return m === 47 ? (e.consume(m), q) : m === 58 || m === 95 || fe(m) ? (e.consume(m), x) : U(m) ? (a = O, E(m)) : Q(m) ? (e.consume(m), O) : q(m);
4063
4079
  }
4064
- function x(g) {
4065
- return g === 45 || g === 46 || g === 58 || g === 95 || ue(g) ? (e.consume(g), x) : I(g);
4080
+ function x(m) {
4081
+ return m === 45 || m === 46 || m === 58 || m === 95 || ue(m) ? (e.consume(m), x) : I(m);
4066
4082
  }
4067
- function I(g) {
4068
- return g === 61 ? (e.consume(g), D) : U(g) ? (a = I, F(g)) : Q(g) ? (e.consume(g), I) : O(g);
4083
+ function I(m) {
4084
+ return m === 61 ? (e.consume(m), P) : U(m) ? (a = I, E(m)) : Q(m) ? (e.consume(m), I) : O(m);
4069
4085
  }
4070
- function D(g) {
4071
- return g === null || g === 60 || g === 61 || g === 62 || g === 96 ? n(g) : g === 34 || g === 39 ? (e.consume(g), i = g, $) : U(g) ? (a = D, F(g)) : Q(g) ? (e.consume(g), D) : (e.consume(g), P);
4086
+ function P(m) {
4087
+ return m === null || m === 60 || m === 61 || m === 62 || m === 96 ? n(m) : m === 34 || m === 39 ? (e.consume(m), i = m, j) : U(m) ? (a = P, E(m)) : Q(m) ? (e.consume(m), P) : (e.consume(m), R);
4072
4088
  }
4073
- function $(g) {
4074
- return g === i ? (e.consume(g), i = void 0, z) : g === null ? n(g) : U(g) ? (a = $, F(g)) : (e.consume(g), $);
4089
+ function j(m) {
4090
+ return m === i ? (e.consume(m), i = void 0, N) : m === null ? n(m) : U(m) ? (a = j, E(m)) : (e.consume(m), j);
4075
4091
  }
4076
- function P(g) {
4077
- return g === null || g === 34 || g === 39 || g === 60 || g === 61 || g === 96 ? n(g) : g === 47 || g === 62 || ie(g) ? O(g) : (e.consume(g), P);
4092
+ function R(m) {
4093
+ return m === null || m === 34 || m === 39 || m === 60 || m === 61 || m === 96 ? n(m) : m === 47 || m === 62 || ie(m) ? O(m) : (e.consume(m), R);
4078
4094
  }
4079
- function z(g) {
4080
- return g === 47 || g === 62 || ie(g) ? O(g) : n(g);
4095
+ function N(m) {
4096
+ return m === 47 || m === 62 || ie(m) ? O(m) : n(m);
4081
4097
  }
4082
- function B(g) {
4083
- return g === 62 ? (e.consume(g), e.exit("htmlTextData"), e.exit("htmlText"), t) : n(g);
4098
+ function q(m) {
4099
+ return m === 62 ? (e.consume(m), e.exit("htmlTextData"), e.exit("htmlText"), t) : n(m);
4084
4100
  }
4085
- function F(g) {
4086
- return e.exit("htmlTextData"), e.enter("lineEnding"), e.consume(g), e.exit("lineEnding"), j;
4101
+ function E(m) {
4102
+ return e.exit("htmlTextData"), e.enter("lineEnding"), e.consume(m), e.exit("lineEnding"), B;
4087
4103
  }
4088
- function j(g) {
4089
- return Q(g) ? Z(e, q, "linePrefix", r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(g) : q(g);
4104
+ function B(m) {
4105
+ return Q(m) ? ee(e, V, "linePrefix", r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(m) : V(m);
4090
4106
  }
4091
- function q(g) {
4092
- return e.enter("htmlTextData"), a(g);
4107
+ function V(m) {
4108
+ return e.enter("htmlTextData"), a(m);
4093
4109
  }
4094
4110
  }
4095
4111
  const zn = {
@@ -4273,7 +4289,7 @@ const Yt = {
4273
4289
  function Gl(e, t) {
4274
4290
  return n;
4275
4291
  function n(r) {
4276
- return e.enter("lineEnding"), e.consume(r), e.exit("lineEnding"), Z(e, t, "linePrefix");
4292
+ return e.enter("lineEnding"), e.consume(r), e.exit("lineEnding"), ee(e, t, "linePrefix");
4277
4293
  }
4278
4294
  }
4279
4295
  const Et = {
@@ -4293,10 +4309,10 @@ function Xl(e, t, n) {
4293
4309
  return u === i ? (e.enter("thematicBreakSequence"), s(u)) : r >= 3 && (u === null || U(u)) ? (e.exit("thematicBreak"), t(u)) : n(u);
4294
4310
  }
4295
4311
  function s(u) {
4296
- return u === i ? (e.consume(u), r++, s) : (e.exit("thematicBreakSequence"), Q(u) ? Z(e, l, "whitespace")(u) : l(u));
4312
+ return u === i ? (e.consume(u), r++, s) : (e.exit("thematicBreakSequence"), Q(u) ? ee(e, l, "whitespace")(u) : l(u));
4297
4313
  }
4298
4314
  }
4299
- const fe = {
4315
+ const he = {
4300
4316
  continuation: {
4301
4317
  tokenize: Zl
4302
4318
  },
@@ -4315,11 +4331,11 @@ function Jl(e, t, n) {
4315
4331
  let o = i && i[1].type === "linePrefix" ? i[2].sliceSerialize(i[1], !0).length : 0, a = 0;
4316
4332
  return l;
4317
4333
  function l(d) {
4318
- const m = r.containerState.type || (d === 42 || d === 43 || d === 45 ? "listUnordered" : "listOrdered");
4319
- if (m === "listUnordered" ? !r.containerState.marker || d === r.containerState.marker : pn(d)) {
4320
- if (r.containerState.type || (r.containerState.type = m, e.enter(m, {
4334
+ const g = r.containerState.type || (d === 42 || d === 43 || d === 45 ? "listUnordered" : "listOrdered");
4335
+ if (g === "listUnordered" ? !r.containerState.marker || d === r.containerState.marker : pn(d)) {
4336
+ if (r.containerState.type || (r.containerState.type = g, e.enter(g, {
4321
4337
  _container: !0
4322
- })), m === "listUnordered")
4338
+ })), g === "listUnordered")
4323
4339
  return e.enter("listItemPrefix"), d === 42 || d === 45 ? e.check(Et, n, u)(d) : u(d);
4324
4340
  if (!r.interrupt || d === 49)
4325
4341
  return e.enter("listItemPrefix"), e.enter("listItemValue"), s(d);
@@ -4351,18 +4367,18 @@ function Zl(e, t, n) {
4351
4367
  const r = this;
4352
4368
  return r.containerState._closeFlow = void 0, e.check(bt, i, o);
4353
4369
  function i(l) {
4354
- return r.containerState.furtherBlankLines = r.containerState.furtherBlankLines || r.containerState.initialBlankLine, Z(e, t, "listItemIndent", r.containerState.size + 1)(l);
4370
+ return r.containerState.furtherBlankLines = r.containerState.furtherBlankLines || r.containerState.initialBlankLine, ee(e, t, "listItemIndent", r.containerState.size + 1)(l);
4355
4371
  }
4356
4372
  function o(l) {
4357
4373
  return r.containerState.furtherBlankLines || !Q(l) ? (r.containerState.furtherBlankLines = void 0, r.containerState.initialBlankLine = void 0, a(l)) : (r.containerState.furtherBlankLines = void 0, r.containerState.initialBlankLine = void 0, e.attempt(Ql, t, a)(l));
4358
4374
  }
4359
4375
  function a(l) {
4360
- return r.containerState._closeFlow = !0, r.interrupt = void 0, Z(e, e.attempt(fe, t, n), "linePrefix", r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(l);
4376
+ return r.containerState._closeFlow = !0, r.interrupt = void 0, ee(e, e.attempt(he, t, n), "linePrefix", r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(l);
4361
4377
  }
4362
4378
  }
4363
4379
  function es(e, t, n) {
4364
4380
  const r = this;
4365
- return Z(e, i, "listItemIndent", r.containerState.size + 1);
4381
+ return ee(e, i, "listItemIndent", r.containerState.size + 1);
4366
4382
  function i(o) {
4367
4383
  const a = r.events[r.events.length - 1];
4368
4384
  return a && a[1].type === "listItemIndent" && a[2].sliceSerialize(a[1], !0).length === r.containerState.size ? t(o) : n(o);
@@ -4373,7 +4389,7 @@ function ts(e) {
4373
4389
  }
4374
4390
  function ns(e, t, n) {
4375
4391
  const r = this;
4376
- return Z(e, i, "listItemPrefixWhitespace", r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 5);
4392
+ return ee(e, i, "listItemPrefixWhitespace", r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 5);
4377
4393
  function i(o) {
4378
4394
  const a = r.events[r.events.length - 1];
4379
4395
  return !Q(o) && a && a[1].type === "listItemPrefixWhitespace" ? t(o) : n(o);
@@ -4425,7 +4441,7 @@ function is(e, t, n) {
4425
4441
  return e.enter("setextHeadingLineSequence"), l(u);
4426
4442
  }
4427
4443
  function l(u) {
4428
- return u === i ? (e.consume(u), l) : (e.exit("setextHeadingLineSequence"), Q(u) ? Z(e, s, "lineSuffix")(u) : s(u));
4444
+ return u === i ? (e.consume(u), l) : (e.exit("setextHeadingLineSequence"), Q(u) ? ee(e, s, "lineSuffix")(u) : s(u));
4429
4445
  }
4430
4446
  function s(u) {
4431
4447
  return u === null || U(u) ? (e.exit("setextHeadingLine"), t(u)) : n(u);
@@ -4440,7 +4456,7 @@ function os(e) {
4440
4456
  bt,
4441
4457
  r,
4442
4458
  // Try to parse initial flow (essentially, only code).
4443
- e.attempt(this.parser.constructs.flowInitial, i, Z(e, e.attempt(this.parser.constructs.flow, i, e.attempt(pl, i)), "linePrefix"))
4459
+ e.attempt(this.parser.constructs.flowInitial, i, ee(e, e.attempt(this.parser.constructs.flow, i, e.attempt(pl, i)), "linePrefix"))
4444
4460
  );
4445
4461
  return n;
4446
4462
  function r(o) {
@@ -4549,19 +4565,19 @@ function cs(e, t) {
4549
4565
  return e;
4550
4566
  }
4551
4567
  const ps = {
4552
- 42: fe,
4553
- 43: fe,
4554
- 45: fe,
4555
- 48: fe,
4556
- 49: fe,
4557
- 50: fe,
4558
- 51: fe,
4559
- 52: fe,
4560
- 53: fe,
4561
- 54: fe,
4562
- 55: fe,
4563
- 56: fe,
4564
- 57: fe,
4568
+ 42: he,
4569
+ 43: he,
4570
+ 45: he,
4571
+ 48: he,
4572
+ 49: he,
4573
+ 50: he,
4574
+ 51: he,
4575
+ 52: he,
4576
+ 53: he,
4577
+ 54: he,
4578
+ 55: he,
4579
+ 56: he,
4580
+ 57: he,
4565
4581
  62: si
4566
4582
  }, ds = {
4567
4583
  91: ml
@@ -4623,12 +4639,12 @@ function ks(e, t, n) {
4623
4639
  const i = {}, o = [];
4624
4640
  let a = [], l = [];
4625
4641
  const s = {
4626
- attempt: A(M),
4627
- check: A(k),
4642
+ attempt: D(M),
4643
+ check: D(k),
4628
4644
  consume: S,
4629
4645
  enter: v,
4630
- exit: N,
4631
- interrupt: A(k, {
4646
+ exit: A,
4647
+ interrupt: D(k, {
4632
4648
  interrupt: !0
4633
4649
  })
4634
4650
  }, u = {
@@ -4636,7 +4652,7 @@ function ks(e, t, n) {
4636
4652
  containerState: {},
4637
4653
  defineSkip: w,
4638
4654
  events: [],
4639
- now: m,
4655
+ now: g,
4640
4656
  parser: e,
4641
4657
  previous: null,
4642
4658
  sliceSerialize: f,
@@ -4646,28 +4662,28 @@ function ks(e, t, n) {
4646
4662
  let p = t.tokenize.call(u, s);
4647
4663
  return t.resolveAll && o.push(t), u;
4648
4664
  function c(I) {
4649
- return a = ve(a, I), C(), a[a.length - 1] !== null ? [] : (_(t, 0), u.events = Ft(o, u.events, u), u.events);
4665
+ return a = ve(a, I), C(), a[a.length - 1] !== null ? [] : (F(t, 0), u.events = Ft(o, u.events, u), u.events);
4650
4666
  }
4651
- function f(I, D) {
4652
- return Cs(d(I), D);
4667
+ function f(I, P) {
4668
+ return Cs(d(I), P);
4653
4669
  }
4654
4670
  function d(I) {
4655
4671
  return vs(a, I);
4656
4672
  }
4657
- function m() {
4673
+ function g() {
4658
4674
  const {
4659
4675
  _bufferIndex: I,
4660
- _index: D,
4661
- line: $,
4662
- column: P,
4663
- offset: z
4676
+ _index: P,
4677
+ line: j,
4678
+ column: R,
4679
+ offset: N
4664
4680
  } = r;
4665
4681
  return {
4666
4682
  _bufferIndex: I,
4667
- _index: D,
4668
- line: $,
4669
- column: P,
4670
- offset: z
4683
+ _index: P,
4684
+ line: j,
4685
+ column: R,
4686
+ offset: N
4671
4687
  };
4672
4688
  }
4673
4689
  function w(I) {
@@ -4676,12 +4692,12 @@ function ks(e, t, n) {
4676
4692
  function C() {
4677
4693
  let I;
4678
4694
  for (; r._index < a.length; ) {
4679
- const D = a[r._index];
4680
- if (typeof D == "string")
4681
- for (I = r._index, r._bufferIndex < 0 && (r._bufferIndex = 0); r._index === I && r._bufferIndex < D.length; )
4682
- b(D.charCodeAt(r._bufferIndex));
4695
+ const P = a[r._index];
4696
+ if (typeof P == "string")
4697
+ for (I = r._index, r._bufferIndex < 0 && (r._bufferIndex = 0); r._index === I && r._bufferIndex < P.length; )
4698
+ b(P.charCodeAt(r._bufferIndex));
4683
4699
  else
4684
- b(D);
4700
+ b(P);
4685
4701
  }
4686
4702
  }
4687
4703
  function b(I) {
@@ -4693,35 +4709,35 @@ function ks(e, t, n) {
4693
4709
  /** @type {string} */
4694
4710
  a[r._index].length && (r._bufferIndex = -1, r._index++)), u.previous = I;
4695
4711
  }
4696
- function v(I, D) {
4697
- const $ = D || {};
4698
- return $.type = I, $.start = m(), u.events.push(["enter", $, u]), l.push($), $;
4712
+ function v(I, P) {
4713
+ const j = P || {};
4714
+ return j.type = I, j.start = g(), u.events.push(["enter", j, u]), l.push(j), j;
4699
4715
  }
4700
- function N(I) {
4701
- const D = l.pop();
4702
- return D.end = m(), u.events.push(["exit", D, u]), D;
4716
+ function A(I) {
4717
+ const P = l.pop();
4718
+ return P.end = g(), u.events.push(["exit", P, u]), P;
4703
4719
  }
4704
- function M(I, D) {
4705
- _(I, D.from);
4720
+ function M(I, P) {
4721
+ F(I, P.from);
4706
4722
  }
4707
- function k(I, D) {
4708
- D.restore();
4723
+ function k(I, P) {
4724
+ P.restore();
4709
4725
  }
4710
- function A(I, D) {
4711
- return $;
4712
- function $(P, z, B) {
4713
- let F, j, q, g;
4714
- return Array.isArray(P) ? (
4726
+ function D(I, P) {
4727
+ return j;
4728
+ function j(R, N, q) {
4729
+ let E, B, V, m;
4730
+ return Array.isArray(R) ? (
4715
4731
  /* c8 ignore next 1 */
4716
- ee(P)
4717
- ) : "tokenize" in P ? (
4732
+ Z(R)
4733
+ ) : "tokenize" in R ? (
4718
4734
  // Looks like a construct.
4719
- ee([
4735
+ Z([
4720
4736
  /** @type {Construct} */
4721
- P
4737
+ R
4722
4738
  ])
4723
- ) : G(P);
4724
- function G(oe) {
4739
+ ) : $(R);
4740
+ function $(oe) {
4725
4741
  return Pe;
4726
4742
  function Pe(ye) {
4727
4743
  const Te = ye !== null && oe[ye], Ae = ye !== null && oe.null, Fe = [
@@ -4730,45 +4746,45 @@ function ks(e, t, n) {
4730
4746
  ...Array.isArray(Te) ? Te : Te ? [Te] : [],
4731
4747
  ...Array.isArray(Ae) ? Ae : Ae ? [Ae] : []
4732
4748
  ];
4733
- return ee(Fe)(ye);
4749
+ return Z(Fe)(ye);
4734
4750
  }
4735
4751
  }
4736
- function ee(oe) {
4737
- return F = oe, j = 0, oe.length === 0 ? B : y(oe[j]);
4752
+ function Z(oe) {
4753
+ return E = oe, B = 0, oe.length === 0 ? q : y(oe[B]);
4738
4754
  }
4739
4755
  function y(oe) {
4740
4756
  return Pe;
4741
4757
  function Pe(ye) {
4742
- return g = O(), q = oe, oe.partial || (u.currentConstruct = oe), oe.name && u.parser.constructs.disable.null.includes(oe.name) ? ze() : oe.tokenize.call(
4758
+ return m = O(), V = oe, oe.partial || (u.currentConstruct = oe), oe.name && u.parser.constructs.disable.null.includes(oe.name) ? ze() : oe.tokenize.call(
4743
4759
  // If we do have fields, create an object w/ `context` as its
4744
4760
  // prototype.
4745
4761
  // This allows a “live binding”, which is needed for `interrupt`.
4746
- D ? Object.assign(Object.create(u), D) : u,
4762
+ P ? Object.assign(Object.create(u), P) : u,
4747
4763
  s,
4748
- ge,
4764
+ pe,
4749
4765
  ze
4750
4766
  )(ye);
4751
4767
  }
4752
4768
  }
4753
- function ge(oe) {
4754
- return I(q, g), z;
4769
+ function pe(oe) {
4770
+ return I(V, m), N;
4755
4771
  }
4756
4772
  function ze(oe) {
4757
- return g.restore(), ++j < F.length ? y(F[j]) : B;
4773
+ return m.restore(), ++B < E.length ? y(E[B]) : q;
4758
4774
  }
4759
4775
  }
4760
4776
  }
4761
- function _(I, D) {
4762
- I.resolveAll && !o.includes(I) && o.push(I), I.resolve && be(u.events, D, u.events.length - D, I.resolve(u.events.slice(D), u)), I.resolveTo && (u.events = I.resolveTo(u.events, u));
4777
+ function F(I, P) {
4778
+ I.resolveAll && !o.includes(I) && o.push(I), I.resolve && be(u.events, P, u.events.length - P, I.resolve(u.events.slice(P), u)), I.resolveTo && (u.events = I.resolveTo(u.events, u));
4763
4779
  }
4764
4780
  function O() {
4765
- const I = m(), D = u.previous, $ = u.currentConstruct, P = u.events.length, z = Array.from(l);
4781
+ const I = g(), P = u.previous, j = u.currentConstruct, R = u.events.length, N = Array.from(l);
4766
4782
  return {
4767
- from: P,
4768
- restore: B
4783
+ from: R,
4784
+ restore: q
4769
4785
  };
4770
- function B() {
4771
- r = I, u.previous = D, u.currentConstruct = $, u.events.length = P, l = z, x();
4786
+ function q() {
4787
+ r = I, u.previous = P, u.currentConstruct = j, u.events.length = R, l = N, x();
4772
4788
  }
4773
4789
  }
4774
4790
  function x() {
@@ -4971,38 +4987,38 @@ function Ds(e) {
4971
4987
  codeFenced: s(C),
4972
4988
  codeFencedFence: w,
4973
4989
  codeFencedFenceInfo: d,
4974
- codeFencedFenceMeta: m,
4990
+ codeFencedFenceMeta: g,
4975
4991
  codeFlowValue: x,
4976
4992
  codeIndented: s(b),
4977
- codeText: s(z),
4993
+ codeText: s(N),
4978
4994
  codeTextData: x,
4979
4995
  data: x,
4980
4996
  definition: s(),
4981
- definitionDestinationString: N,
4997
+ definitionDestinationString: A,
4982
4998
  definitionLabelString: S,
4983
4999
  definitionTitleString: v,
4984
5000
  emphasis: s(),
4985
- hardBreakEscape: s(D),
4986
- hardBreakTrailing: s(D),
4987
- htmlFlow: s($),
5001
+ hardBreakEscape: s(P),
5002
+ hardBreakTrailing: s(P),
5003
+ htmlFlow: s(j),
4988
5004
  htmlFlowData: x,
4989
- htmlText: s(P),
5005
+ htmlText: s(R),
4990
5006
  htmlTextData: x,
4991
- image: s(F),
4992
- label: q,
4993
- labelText: j,
5007
+ image: s(E),
5008
+ label: V,
5009
+ labelText: B,
4994
5010
  lineEnding: I,
4995
- link: s(B),
5011
+ link: s(q),
4996
5012
  listItem: s(),
4997
5013
  listOrdered: s(),
4998
5014
  listUnordered: s(),
4999
5015
  paragraph: s(),
5000
- referenceString: ge,
5001
- resourceDestinationString: g,
5002
- resourceTitleString: G,
5003
- resource: ee,
5004
- setextHeading: s(_),
5005
- setextHeadingLineSequence: A,
5016
+ referenceString: pe,
5017
+ resourceDestinationString: m,
5018
+ resourceTitleString: $,
5019
+ resource: Z,
5020
+ setextHeading: s(F),
5021
+ setextHeadingLineSequence: D,
5006
5022
  setextHeadingText: k,
5007
5023
  strong: s(),
5008
5024
  thematicBreak: s()
@@ -5011,13 +5027,13 @@ function Ds(e) {
5011
5027
  bi(t, (e || {}).mdastExtensions || []);
5012
5028
  const n = {};
5013
5029
  return r;
5014
- function r(E) {
5015
- let R = {
5030
+ function r(z) {
5031
+ let _ = {
5016
5032
  type: "root",
5017
5033
  children: []
5018
5034
  };
5019
- const W = {
5020
- stack: [R],
5035
+ const Y = {
5036
+ stack: [_],
5021
5037
  tokenStack: [],
5022
5038
  config: t,
5023
5039
  enter: l,
@@ -5026,53 +5042,53 @@ function Ds(e) {
5026
5042
  resume: p,
5027
5043
  data: n
5028
5044
  }, K = [];
5029
- let te = -1;
5030
- for (; ++te < E.length; )
5031
- if (E[te][1].type === "listOrdered" || E[te][1].type === "listUnordered")
5032
- if (E[te][0] === "enter")
5033
- K.push(te);
5045
+ let ne = -1;
5046
+ for (; ++ne < z.length; )
5047
+ if (z[ne][1].type === "listOrdered" || z[ne][1].type === "listUnordered")
5048
+ if (z[ne][0] === "enter")
5049
+ K.push(ne);
5034
5050
  else {
5035
5051
  const Ce = K.pop();
5036
- te = i(E, Ce, te);
5052
+ ne = i(z, Ce, ne);
5037
5053
  }
5038
- for (te = -1; ++te < E.length; ) {
5039
- const Ce = t[E[te][0]];
5040
- xi.call(Ce, E[te][1].type) && Ce[E[te][1].type].call(Object.assign({
5041
- sliceSerialize: E[te][2].sliceSerialize
5042
- }, W), E[te][1]);
5043
- }
5044
- if (W.tokenStack.length > 0) {
5045
- const Ce = W.tokenStack[W.tokenStack.length - 1];
5046
- (Ce[1] || lr).call(W, void 0, Ce[0]);
5047
- }
5048
- for (R.position = {
5049
- start: Re(E.length > 0 ? E[0][1].start : {
5054
+ for (ne = -1; ++ne < z.length; ) {
5055
+ const Ce = t[z[ne][0]];
5056
+ xi.call(Ce, z[ne][1].type) && Ce[z[ne][1].type].call(Object.assign({
5057
+ sliceSerialize: z[ne][2].sliceSerialize
5058
+ }, Y), z[ne][1]);
5059
+ }
5060
+ if (Y.tokenStack.length > 0) {
5061
+ const Ce = Y.tokenStack[Y.tokenStack.length - 1];
5062
+ (Ce[1] || lr).call(Y, void 0, Ce[0]);
5063
+ }
5064
+ for (_.position = {
5065
+ start: Re(z.length > 0 ? z[0][1].start : {
5050
5066
  line: 1,
5051
5067
  column: 1,
5052
5068
  offset: 0
5053
5069
  }),
5054
- end: Re(E.length > 0 ? E[E.length - 2][1].end : {
5070
+ end: Re(z.length > 0 ? z[z.length - 2][1].end : {
5055
5071
  line: 1,
5056
5072
  column: 1,
5057
5073
  offset: 0
5058
5074
  })
5059
- }, te = -1; ++te < t.transforms.length; )
5060
- R = t.transforms[te](R) || R;
5061
- return R;
5062
- }
5063
- function i(E, R, W) {
5064
- let K = R - 1, te = -1, Ce = !1, Be, Ne, it, at;
5065
- for (; ++K <= W; ) {
5066
- const me = E[K];
5075
+ }, ne = -1; ++ne < t.transforms.length; )
5076
+ _ = t.transforms[ne](_) || _;
5077
+ return _;
5078
+ }
5079
+ function i(z, _, Y) {
5080
+ let K = _ - 1, ne = -1, Ce = !1, Be, Ne, it, at;
5081
+ for (; ++K <= Y; ) {
5082
+ const me = z[K];
5067
5083
  switch (me[1].type) {
5068
5084
  case "listUnordered":
5069
5085
  case "listOrdered":
5070
5086
  case "blockQuote": {
5071
- me[0] === "enter" ? te++ : te--, at = void 0;
5087
+ me[0] === "enter" ? ne++ : ne--, at = void 0;
5072
5088
  break;
5073
5089
  }
5074
5090
  case "lineEndingBlank": {
5075
- me[0] === "enter" && (Be && !at && !te && !it && (it = K), at = void 0);
5091
+ me[0] === "enter" && (Be && !at && !ne && !it && (it = K), at = void 0);
5076
5092
  break;
5077
5093
  }
5078
5094
  case "linePrefix":
@@ -5084,17 +5100,17 @@ function Ds(e) {
5084
5100
  default:
5085
5101
  at = void 0;
5086
5102
  }
5087
- if (!te && me[0] === "enter" && me[1].type === "listItemPrefix" || te === -1 && me[0] === "exit" && (me[1].type === "listUnordered" || me[1].type === "listOrdered")) {
5103
+ if (!ne && me[0] === "enter" && me[1].type === "listItemPrefix" || ne === -1 && me[0] === "exit" && (me[1].type === "listUnordered" || me[1].type === "listOrdered")) {
5088
5104
  if (Be) {
5089
5105
  let Xe = K;
5090
5106
  for (Ne = void 0; Xe--; ) {
5091
- const De = E[Xe];
5107
+ const De = z[Xe];
5092
5108
  if (De[1].type === "lineEnding" || De[1].type === "lineEndingBlank") {
5093
5109
  if (De[0] === "exit") continue;
5094
- Ne && (E[Ne][1].type = "lineEndingBlank", Ce = !0), De[1].type = "lineEnding", Ne = Xe;
5110
+ Ne && (z[Ne][1].type = "lineEndingBlank", Ce = !0), De[1].type = "lineEnding", Ne = Xe;
5095
5111
  } else if (!(De[1].type === "linePrefix" || De[1].type === "blockQuotePrefix" || De[1].type === "blockQuotePrefixWhitespace" || De[1].type === "blockQuoteMarker" || De[1].type === "listItemIndent")) break;
5096
5112
  }
5097
- it && (!Ne || it < Ne) && (Be._spread = !0), Be.end = Object.assign({}, Ne ? E[Ne][1].start : me[1].end), E.splice(Ne || K, 0, ["exit", Be, me[2]]), K++, W++;
5113
+ it && (!Ne || it < Ne) && (Be._spread = !0), Be.end = Object.assign({}, Ne ? z[Ne][1].start : me[1].end), z.splice(Ne || K, 0, ["exit", Be, me[2]]), K++, Y++;
5098
5114
  }
5099
5115
  if (me[1].type === "listItemPrefix") {
5100
5116
  const Xe = {
@@ -5104,16 +5120,16 @@ function Ds(e) {
5104
5120
  // @ts-expect-error: we’ll add `end` in a second.
5105
5121
  end: void 0
5106
5122
  };
5107
- Be = Xe, E.splice(K, 0, ["enter", Xe, me[2]]), K++, W++, it = void 0, at = !0;
5123
+ Be = Xe, z.splice(K, 0, ["enter", Xe, me[2]]), K++, Y++, it = void 0, at = !0;
5108
5124
  }
5109
5125
  }
5110
5126
  }
5111
- return E[R][1]._spread = Ce, W;
5127
+ return z[_][1]._spread = Ce, Y;
5112
5128
  }
5113
- function o(E, R) {
5114
- return W;
5115
- function W(K) {
5116
- l.call(this, E(K), K), R && R.call(this, K);
5129
+ function o(z, _) {
5130
+ return Y;
5131
+ function Y(K) {
5132
+ l.call(this, z(K), K), _ && _.call(this, K);
5117
5133
  }
5118
5134
  }
5119
5135
  function a() {
@@ -5122,28 +5138,28 @@ function Ds(e) {
5122
5138
  children: []
5123
5139
  });
5124
5140
  }
5125
- function l(E, R, W) {
5126
- this.stack[this.stack.length - 1].children.push(E), this.stack.push(E), this.tokenStack.push([R, W || void 0]), E.position = {
5127
- start: Re(R.start),
5141
+ function l(z, _, Y) {
5142
+ this.stack[this.stack.length - 1].children.push(z), this.stack.push(z), this.tokenStack.push([_, Y || void 0]), z.position = {
5143
+ start: Re(_.start),
5128
5144
  // @ts-expect-error: `end` will be patched later.
5129
5145
  end: void 0
5130
5146
  };
5131
5147
  }
5132
- function s(E) {
5133
- return R;
5134
- function R(W) {
5135
- E && E.call(this, W), u.call(this, W);
5148
+ function s(z) {
5149
+ return _;
5150
+ function _(Y) {
5151
+ z && z.call(this, Y), u.call(this, Y);
5136
5152
  }
5137
5153
  }
5138
- function u(E, R) {
5139
- const W = this.stack.pop(), K = this.tokenStack.pop();
5154
+ function u(z, _) {
5155
+ const Y = this.stack.pop(), K = this.tokenStack.pop();
5140
5156
  if (K)
5141
- K[0].type !== E.type && (R ? R.call(this, E, K[0]) : (K[1] || lr).call(this, E, K[0]));
5142
- else throw new Error("Cannot close `" + E.type + "` (" + pt({
5143
- start: E.start,
5144
- end: E.end
5157
+ K[0].type !== z.type && (_ ? _.call(this, z, K[0]) : (K[1] || lr).call(this, z, K[0]));
5158
+ else throw new Error("Cannot close `" + z.type + "` (" + pt({
5159
+ start: z.start,
5160
+ end: z.end
5145
5161
  }) + "): it’s not open");
5146
- W.position.end = Re(E.end);
5162
+ Y.position.end = Re(z.end);
5147
5163
  }
5148
5164
  function p() {
5149
5165
  return En(this.stack.pop());
@@ -5151,168 +5167,168 @@ function Ds(e) {
5151
5167
  function c() {
5152
5168
  this.data.expectingFirstListItemValue = !0;
5153
5169
  }
5154
- function f(E) {
5170
+ function f(z) {
5155
5171
  if (this.data.expectingFirstListItemValue) {
5156
- const R = this.stack[this.stack.length - 2];
5157
- R.start = Number.parseInt(this.sliceSerialize(E), 10), this.data.expectingFirstListItemValue = void 0;
5172
+ const _ = this.stack[this.stack.length - 2];
5173
+ _.start = Number.parseInt(this.sliceSerialize(z), 10), this.data.expectingFirstListItemValue = void 0;
5158
5174
  }
5159
5175
  }
5160
5176
  function d() {
5161
- const E = this.resume(), R = this.stack[this.stack.length - 1];
5162
- R.lang = E;
5177
+ const z = this.resume(), _ = this.stack[this.stack.length - 1];
5178
+ _.lang = z;
5163
5179
  }
5164
- function m() {
5165
- const E = this.resume(), R = this.stack[this.stack.length - 1];
5166
- R.meta = E;
5180
+ function g() {
5181
+ const z = this.resume(), _ = this.stack[this.stack.length - 1];
5182
+ _.meta = z;
5167
5183
  }
5168
5184
  function w() {
5169
5185
  this.data.flowCodeInside || (this.buffer(), this.data.flowCodeInside = !0);
5170
5186
  }
5171
5187
  function C() {
5172
- const E = this.resume(), R = this.stack[this.stack.length - 1];
5173
- R.value = E.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g, ""), this.data.flowCodeInside = void 0;
5188
+ const z = this.resume(), _ = this.stack[this.stack.length - 1];
5189
+ _.value = z.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g, ""), this.data.flowCodeInside = void 0;
5174
5190
  }
5175
5191
  function b() {
5176
- const E = this.resume(), R = this.stack[this.stack.length - 1];
5177
- R.value = E.replace(/(\r?\n|\r)$/g, "");
5192
+ const z = this.resume(), _ = this.stack[this.stack.length - 1];
5193
+ _.value = z.replace(/(\r?\n|\r)$/g, "");
5178
5194
  }
5179
- function S(E) {
5180
- const R = this.resume(), W = this.stack[this.stack.length - 1];
5181
- W.label = R, W.identifier = Se(this.sliceSerialize(E)).toLowerCase();
5195
+ function S(z) {
5196
+ const _ = this.resume(), Y = this.stack[this.stack.length - 1];
5197
+ Y.label = _, Y.identifier = Se(this.sliceSerialize(z)).toLowerCase();
5182
5198
  }
5183
5199
  function v() {
5184
- const E = this.resume(), R = this.stack[this.stack.length - 1];
5185
- R.title = E;
5200
+ const z = this.resume(), _ = this.stack[this.stack.length - 1];
5201
+ _.title = z;
5186
5202
  }
5187
- function N() {
5188
- const E = this.resume(), R = this.stack[this.stack.length - 1];
5189
- R.url = E;
5203
+ function A() {
5204
+ const z = this.resume(), _ = this.stack[this.stack.length - 1];
5205
+ _.url = z;
5190
5206
  }
5191
- function M(E) {
5192
- const R = this.stack[this.stack.length - 1];
5193
- if (!R.depth) {
5194
- const W = this.sliceSerialize(E).length;
5195
- R.depth = W;
5207
+ function M(z) {
5208
+ const _ = this.stack[this.stack.length - 1];
5209
+ if (!_.depth) {
5210
+ const Y = this.sliceSerialize(z).length;
5211
+ _.depth = Y;
5196
5212
  }
5197
5213
  }
5198
5214
  function k() {
5199
5215
  this.data.setextHeadingSlurpLineEnding = !0;
5200
5216
  }
5201
- function A(E) {
5202
- const R = this.stack[this.stack.length - 1];
5203
- R.depth = this.sliceSerialize(E).codePointAt(0) === 61 ? 1 : 2;
5217
+ function D(z) {
5218
+ const _ = this.stack[this.stack.length - 1];
5219
+ _.depth = this.sliceSerialize(z).codePointAt(0) === 61 ? 1 : 2;
5204
5220
  }
5205
- function _() {
5221
+ function F() {
5206
5222
  this.data.setextHeadingSlurpLineEnding = void 0;
5207
5223
  }
5208
- function O(E) {
5209
- const W = this.stack[this.stack.length - 1].children;
5210
- let K = W[W.length - 1];
5224
+ function O(z) {
5225
+ const Y = this.stack[this.stack.length - 1].children;
5226
+ let K = Y[Y.length - 1];
5211
5227
  (!K || K.type !== "text") && (K = Ge(), K.position = {
5212
- start: Re(E.start),
5228
+ start: Re(z.start),
5213
5229
  // @ts-expect-error: we’ll add `end` later.
5214
5230
  end: void 0
5215
- }, W.push(K)), this.stack.push(K);
5231
+ }, Y.push(K)), this.stack.push(K);
5216
5232
  }
5217
- function x(E) {
5218
- const R = this.stack.pop();
5219
- R.value += this.sliceSerialize(E), R.position.end = Re(E.end);
5233
+ function x(z) {
5234
+ const _ = this.stack.pop();
5235
+ _.value += this.sliceSerialize(z), _.position.end = Re(z.end);
5220
5236
  }
5221
- function I(E) {
5222
- const R = this.stack[this.stack.length - 1];
5237
+ function I(z) {
5238
+ const _ = this.stack[this.stack.length - 1];
5223
5239
  if (this.data.atHardBreak) {
5224
- const W = R.children[R.children.length - 1];
5225
- W.position.end = Re(E.end), this.data.atHardBreak = void 0;
5240
+ const Y = _.children[_.children.length - 1];
5241
+ Y.position.end = Re(z.end), this.data.atHardBreak = void 0;
5226
5242
  return;
5227
5243
  }
5228
- !this.data.setextHeadingSlurpLineEnding && t.canContainEols.includes(R.type) && (O.call(this, E), x.call(this, E));
5244
+ !this.data.setextHeadingSlurpLineEnding && t.canContainEols.includes(_.type) && (O.call(this, z), x.call(this, z));
5229
5245
  }
5230
- function D() {
5246
+ function P() {
5231
5247
  this.data.atHardBreak = !0;
5232
5248
  }
5233
- function $() {
5234
- const E = this.resume(), R = this.stack[this.stack.length - 1];
5235
- R.value = E;
5249
+ function j() {
5250
+ const z = this.resume(), _ = this.stack[this.stack.length - 1];
5251
+ _.value = z;
5236
5252
  }
5237
- function P() {
5238
- const E = this.resume(), R = this.stack[this.stack.length - 1];
5239
- R.value = E;
5253
+ function R() {
5254
+ const z = this.resume(), _ = this.stack[this.stack.length - 1];
5255
+ _.value = z;
5240
5256
  }
5241
- function z() {
5242
- const E = this.resume(), R = this.stack[this.stack.length - 1];
5243
- R.value = E;
5257
+ function N() {
5258
+ const z = this.resume(), _ = this.stack[this.stack.length - 1];
5259
+ _.value = z;
5244
5260
  }
5245
- function B() {
5246
- const E = this.stack[this.stack.length - 1];
5261
+ function q() {
5262
+ const z = this.stack[this.stack.length - 1];
5247
5263
  if (this.data.inReference) {
5248
- const R = this.data.referenceType || "shortcut";
5249
- E.type += "Reference", E.referenceType = R, delete E.url, delete E.title;
5264
+ const _ = this.data.referenceType || "shortcut";
5265
+ z.type += "Reference", z.referenceType = _, delete z.url, delete z.title;
5250
5266
  } else
5251
- delete E.identifier, delete E.label;
5267
+ delete z.identifier, delete z.label;
5252
5268
  this.data.referenceType = void 0;
5253
5269
  }
5254
- function F() {
5255
- const E = this.stack[this.stack.length - 1];
5270
+ function E() {
5271
+ const z = this.stack[this.stack.length - 1];
5256
5272
  if (this.data.inReference) {
5257
- const R = this.data.referenceType || "shortcut";
5258
- E.type += "Reference", E.referenceType = R, delete E.url, delete E.title;
5273
+ const _ = this.data.referenceType || "shortcut";
5274
+ z.type += "Reference", z.referenceType = _, delete z.url, delete z.title;
5259
5275
  } else
5260
- delete E.identifier, delete E.label;
5276
+ delete z.identifier, delete z.label;
5261
5277
  this.data.referenceType = void 0;
5262
5278
  }
5263
- function j(E) {
5264
- const R = this.sliceSerialize(E), W = this.stack[this.stack.length - 2];
5265
- W.label = Ts(R), W.identifier = Se(R).toLowerCase();
5279
+ function B(z) {
5280
+ const _ = this.sliceSerialize(z), Y = this.stack[this.stack.length - 2];
5281
+ Y.label = Ts(_), Y.identifier = Se(_).toLowerCase();
5266
5282
  }
5267
- function q() {
5268
- const E = this.stack[this.stack.length - 1], R = this.resume(), W = this.stack[this.stack.length - 1];
5269
- if (this.data.inReference = !0, W.type === "link") {
5270
- const K = E.children;
5271
- W.children = K;
5283
+ function V() {
5284
+ const z = this.stack[this.stack.length - 1], _ = this.resume(), Y = this.stack[this.stack.length - 1];
5285
+ if (this.data.inReference = !0, Y.type === "link") {
5286
+ const K = z.children;
5287
+ Y.children = K;
5272
5288
  } else
5273
- W.alt = R;
5289
+ Y.alt = _;
5274
5290
  }
5275
- function g() {
5276
- const E = this.resume(), R = this.stack[this.stack.length - 1];
5277
- R.url = E;
5291
+ function m() {
5292
+ const z = this.resume(), _ = this.stack[this.stack.length - 1];
5293
+ _.url = z;
5278
5294
  }
5279
- function G() {
5280
- const E = this.resume(), R = this.stack[this.stack.length - 1];
5281
- R.title = E;
5295
+ function $() {
5296
+ const z = this.resume(), _ = this.stack[this.stack.length - 1];
5297
+ _.title = z;
5282
5298
  }
5283
- function ee() {
5299
+ function Z() {
5284
5300
  this.data.inReference = void 0;
5285
5301
  }
5286
5302
  function y() {
5287
5303
  this.data.referenceType = "collapsed";
5288
5304
  }
5289
- function ge(E) {
5290
- const R = this.resume(), W = this.stack[this.stack.length - 1];
5291
- W.label = R, W.identifier = Se(this.sliceSerialize(E)).toLowerCase(), this.data.referenceType = "full";
5305
+ function pe(z) {
5306
+ const _ = this.resume(), Y = this.stack[this.stack.length - 1];
5307
+ Y.label = _, Y.identifier = Se(this.sliceSerialize(z)).toLowerCase(), this.data.referenceType = "full";
5292
5308
  }
5293
- function ze(E) {
5294
- this.data.characterReferenceType = E.type;
5309
+ function ze(z) {
5310
+ this.data.characterReferenceType = z.type;
5295
5311
  }
5296
- function oe(E) {
5297
- const R = this.sliceSerialize(E), W = this.data.characterReferenceType;
5312
+ function oe(z) {
5313
+ const _ = this.sliceSerialize(z), Y = this.data.characterReferenceType;
5298
5314
  let K;
5299
- W ? (K = li(R, W === "characterReferenceMarkerNumeric" ? 10 : 16), this.data.characterReferenceType = void 0) : K = In(R);
5300
- const te = this.stack[this.stack.length - 1];
5301
- te.value += K;
5315
+ Y ? (K = li(_, Y === "characterReferenceMarkerNumeric" ? 10 : 16), this.data.characterReferenceType = void 0) : K = In(_);
5316
+ const ne = this.stack[this.stack.length - 1];
5317
+ ne.value += K;
5302
5318
  }
5303
- function Pe(E) {
5304
- const R = this.stack.pop();
5305
- R.position.end = Re(E.end);
5319
+ function Pe(z) {
5320
+ const _ = this.stack.pop();
5321
+ _.position.end = Re(z.end);
5306
5322
  }
5307
- function ye(E) {
5308
- x.call(this, E);
5309
- const R = this.stack[this.stack.length - 1];
5310
- R.url = this.sliceSerialize(E);
5323
+ function ye(z) {
5324
+ x.call(this, z);
5325
+ const _ = this.stack[this.stack.length - 1];
5326
+ _.url = this.sliceSerialize(z);
5311
5327
  }
5312
- function Te(E) {
5313
- x.call(this, E);
5314
- const R = this.stack[this.stack.length - 1];
5315
- R.url = "mailto:" + this.sliceSerialize(E);
5328
+ function Te(z) {
5329
+ x.call(this, z);
5330
+ const _ = this.stack[this.stack.length - 1];
5331
+ _.url = "mailto:" + this.sliceSerialize(z);
5316
5332
  }
5317
5333
  function Ae() {
5318
5334
  return {
@@ -5384,19 +5400,19 @@ function Ds(e) {
5384
5400
  children: []
5385
5401
  };
5386
5402
  }
5387
- function rt(E) {
5403
+ function rt(z) {
5388
5404
  return {
5389
5405
  type: "list",
5390
- ordered: E.type === "listOrdered",
5406
+ ordered: z.type === "listOrdered",
5391
5407
  start: null,
5392
- spread: E._spread,
5408
+ spread: z._spread,
5393
5409
  children: []
5394
5410
  };
5395
5411
  }
5396
- function ke(E) {
5412
+ function ke(z) {
5397
5413
  return {
5398
5414
  type: "listItem",
5399
- spread: E._spread,
5415
+ spread: z._spread,
5400
5416
  checked: null,
5401
5417
  children: []
5402
5418
  };
@@ -5747,8 +5763,8 @@ function eu(e, t, n) {
5747
5763
  for (; ++s < l; ) {
5748
5764
  const c = t.children[s], f = {}, d = a ? a[s] : void 0;
5749
5765
  d && (f.align = d);
5750
- let m = { type: "element", tagName: o, properties: f, children: [] };
5751
- c && (m.children = e.all(c), e.patch(c, m), m = e.applyData(c, m)), u.push(m);
5766
+ let g = { type: "element", tagName: o, properties: f, children: [] };
5767
+ c && (g.children = e.all(c), e.patch(c, g), g = e.applyData(c, g)), u.push(g);
5752
5768
  }
5753
5769
  const p = {
5754
5770
  type: "element",
@@ -6053,11 +6069,11 @@ function hu(e) {
6053
6069
  continue;
6054
6070
  const p = e.all(u), c = String(u.identifier).toUpperCase(), f = Ze(c.toLowerCase());
6055
6071
  let d = 0;
6056
- const m = [], w = e.footnoteCounts.get(c);
6072
+ const g = [], w = e.footnoteCounts.get(c);
6057
6073
  for (; w !== void 0 && ++d <= w; ) {
6058
- m.length > 0 && m.push({ type: "text", value: " " });
6074
+ g.length > 0 && g.push({ type: "text", value: " " });
6059
6075
  let S = typeof n == "string" ? n : n(s, d);
6060
- typeof S == "string" && (S = { type: "text", value: S }), m.push({
6076
+ typeof S == "string" && (S = { type: "text", value: S }), g.push({
6061
6077
  type: "element",
6062
6078
  tagName: "a",
6063
6079
  properties: {
@@ -6072,9 +6088,9 @@ function hu(e) {
6072
6088
  const C = p[p.length - 1];
6073
6089
  if (C && C.type === "element" && C.tagName === "p") {
6074
6090
  const S = C.children[C.children.length - 1];
6075
- S && S.type === "text" ? S.value += " " : C.children.push({ type: "text", value: " " }), C.children.push(...m);
6091
+ S && S.type === "text" ? S.value += " " : C.children.push({ type: "text", value: " " }), C.children.push(...g);
6076
6092
  } else
6077
- p.push(...m);
6093
+ p.push(...g);
6078
6094
  const b = {
6079
6095
  type: "element",
6080
6096
  tagName: "li",
@@ -6224,7 +6240,7 @@ function Ii(e, t, n, r) {
6224
6240
  }
6225
6241
  return f;
6226
6242
  function f() {
6227
- let d = Ei, m, w, C;
6243
+ let d = Ei, g, w, C;
6228
6244
  if ((!t || o(s, u, p[p.length - 1] || void 0)) && (d = vu(n(s, p)), d[0] === fn))
6229
6245
  return d;
6230
6246
  if ("children" in s && s.children) {
@@ -6235,9 +6251,9 @@ function Ii(e, t, n, r) {
6235
6251
  if (b.children && d[0] !== ku)
6236
6252
  for (w = (r ? b.children.length : -1) + a, C = p.concat(b); w > -1 && w < b.children.length; ) {
6237
6253
  const S = b.children[w];
6238
- if (m = l(S, w, C)(), m[0] === fn)
6239
- return m;
6240
- w = typeof m[1] == "number" ? m[1] : w + a;
6254
+ if (g = l(S, w, C)(), g[0] === fn)
6255
+ return g;
6256
+ w = typeof g[1] == "number" ? g[1] : w + a;
6241
6257
  }
6242
6258
  }
6243
6259
  return d;
@@ -6295,13 +6311,13 @@ function Su(e, t) {
6295
6311
  const f = p.children;
6296
6312
  let d = -1;
6297
6313
  for (; ++d < f.length; ) {
6298
- const m = l.one(f[d], p);
6299
- if (m) {
6300
- if (d && f[d - 1].type === "break" && (!Array.isArray(m) && m.type === "text" && (m.value = hr(m.value)), !Array.isArray(m) && m.type === "element")) {
6301
- const w = m.children[0];
6314
+ const g = l.one(f[d], p);
6315
+ if (g) {
6316
+ if (d && f[d - 1].type === "break" && (!Array.isArray(g) && g.type === "text" && (g.value = hr(g.value)), !Array.isArray(g) && g.type === "element")) {
6317
+ const w = g.children[0];
6302
6318
  w && w.type === "text" && (w.value = hr(w.value));
6303
6319
  }
6304
- Array.isArray(m) ? c.push(...m) : c.push(m);
6320
+ Array.isArray(g) ? c.push(...g) : c.push(g);
6305
6321
  }
6306
6322
  }
6307
6323
  }
@@ -7248,8 +7264,8 @@ class Mn extends Vu {
7248
7264
  /** @type {CompileTree extends undefined ? Node : CompileTree} */
7249
7265
  /** @type {unknown} */
7250
7266
  c
7251
- ), m = r.stringify(d, f);
7252
- Gu(m) ? f.value = m : f.result = m, u(
7267
+ ), g = r.stringify(d, f);
7268
+ Gu(g) ? f.value = g : f.result = g, u(
7253
7269
  p,
7254
7270
  /** @type {VFileWithOutput<CompileResult>} */
7255
7271
  f
@@ -7518,9 +7534,9 @@ class Mn extends Vu {
7518
7534
  if (f === -1)
7519
7535
  r.push([u, ...p]);
7520
7536
  else if (p.length > 0) {
7521
- let [d, ...m] = p;
7537
+ let [d, ...g] = p;
7522
7538
  const w = r[f][1];
7523
- gn(w) && gn(d) && (d = Gt(!0, w, d)), r[f] = [u, d, ...m];
7539
+ gn(w) && gn(d) && (d = Gt(!0, w, d)), r[f] = [u, d, ...g];
7524
7540
  }
7525
7541
  }
7526
7542
  }
@@ -7628,8 +7644,8 @@ function nc(e, t) {
7628
7644
  let d;
7629
7645
  for (d in Wt)
7630
7646
  if (Object.hasOwn(Wt, d) && Object.hasOwn(p.properties, d)) {
7631
- const m = p.properties[d], w = Wt[d];
7632
- (w === null || w.includes(p.tagName)) && (p.properties[d] = s(String(m || ""), d, p));
7647
+ const g = p.properties[d], w = Wt[d];
7648
+ (w === null || w.includes(p.tagName)) && (p.properties[d] = s(String(g || ""), d, p));
7633
7649
  }
7634
7650
  }
7635
7651
  if (p.type === "element") {
@@ -7670,10 +7686,10 @@ function ac(e, t, n) {
7670
7686
  function l(u, p) {
7671
7687
  let c = -1, f;
7672
7688
  for (; ++c < p.length; ) {
7673
- const d = p[c], m = f ? f.children : void 0;
7689
+ const d = p[c], g = f ? f.children : void 0;
7674
7690
  if (i(
7675
7691
  d,
7676
- m ? m.indexOf(d) : void 0,
7692
+ g ? g.indexOf(d) : void 0,
7677
7693
  f
7678
7694
  ))
7679
7695
  return;
@@ -7684,26 +7700,26 @@ function ac(e, t, n) {
7684
7700
  }
7685
7701
  function s(u, p) {
7686
7702
  const c = p[p.length - 1], f = o[a][0], d = o[a][1];
7687
- let m = 0;
7703
+ let g = 0;
7688
7704
  const C = c.children.indexOf(u);
7689
7705
  let b = !1, S = [];
7690
7706
  f.lastIndex = 0;
7691
7707
  let v = f.exec(u.value);
7692
7708
  for (; v; ) {
7693
- const N = v.index, M = {
7709
+ const A = v.index, M = {
7694
7710
  index: v.index,
7695
7711
  input: v.input,
7696
7712
  stack: [...p, u]
7697
7713
  };
7698
7714
  let k = d(...v, M);
7699
- if (typeof k == "string" && (k = k.length > 0 ? { type: "text", value: k } : void 0), k === !1 ? f.lastIndex = N + 1 : (m !== N && S.push({
7715
+ if (typeof k == "string" && (k = k.length > 0 ? { type: "text", value: k } : void 0), k === !1 ? f.lastIndex = A + 1 : (g !== A && S.push({
7700
7716
  type: "text",
7701
- value: u.value.slice(m, N)
7702
- }), Array.isArray(k) ? S.push(...k) : k && S.push(k), m = N + v[0].length, b = !0), !f.global)
7717
+ value: u.value.slice(g, A)
7718
+ }), Array.isArray(k) ? S.push(...k) : k && S.push(k), g = A + v[0].length, b = !0), !f.global)
7703
7719
  break;
7704
7720
  v = f.exec(u.value);
7705
7721
  }
7706
- return b ? (m < u.value.length && S.push({ type: "text", value: u.value.slice(m) }), c.children.splice(C, 1, ...S)) : S = [u], C + S.length;
7722
+ return b ? (g < u.value.length && S.push({ type: "text", value: u.value.slice(g) }), c.children.splice(C, 1, ...S)) : S = [u], C + S.length;
7707
7723
  }
7708
7724
  }
7709
7725
  function oc(e) {
@@ -8025,27 +8041,27 @@ function $c(e, t) {
8025
8041
  n.alignDelimiters !== !1 && (S = C.length + S + b.length, S > s[c] && (s[c] = S), d[c] = S), f[c] = v;
8026
8042
  }
8027
8043
  a.splice(1, 0, f), l.splice(1, 0, d), p = -1;
8028
- const m = [];
8044
+ const g = [];
8029
8045
  for (; ++p < a.length; ) {
8030
8046
  const w = a[p], C = l[p];
8031
8047
  c = -1;
8032
8048
  const b = [];
8033
8049
  for (; ++c < u; ) {
8034
8050
  const S = w[c] || "";
8035
- let v = "", N = "";
8051
+ let v = "", A = "";
8036
8052
  if (n.alignDelimiters !== !1) {
8037
8053
  const M = s[c] - (C[c] || 0), k = o[c];
8038
- k === 114 ? v = " ".repeat(M) : k === 99 ? M % 2 ? (v = " ".repeat(M / 2 + 0.5), N = " ".repeat(M / 2 - 0.5)) : (v = " ".repeat(M / 2), N = v) : N = " ".repeat(M);
8054
+ k === 114 ? v = " ".repeat(M) : k === 99 ? M % 2 ? (v = " ".repeat(M / 2 + 0.5), A = " ".repeat(M / 2 - 0.5)) : (v = " ".repeat(M / 2), A = v) : A = " ".repeat(M);
8039
8055
  }
8040
8056
  n.delimiterStart !== !1 && !c && b.push("|"), n.padding !== !1 && // Don’t add the opening space if we’re not aligning and the cell is
8041
8057
  // empty: there will be a closing space.
8042
- !(n.alignDelimiters === !1 && S === "") && (n.delimiterStart !== !1 || c) && b.push(" "), n.alignDelimiters !== !1 && b.push(v), b.push(S), n.alignDelimiters !== !1 && b.push(N), n.padding !== !1 && b.push(" "), (n.delimiterEnd !== !1 || c !== u - 1) && b.push("|");
8058
+ !(n.alignDelimiters === !1 && S === "") && (n.delimiterStart !== !1 || c) && b.push(" "), n.alignDelimiters !== !1 && b.push(v), b.push(S), n.alignDelimiters !== !1 && b.push(A), n.padding !== !1 && b.push(" "), (n.delimiterEnd !== !1 || c !== u - 1) && b.push("|");
8043
8059
  }
8044
- m.push(
8060
+ g.push(
8045
8061
  n.delimiterEnd === !1 ? b.join("").replace(/ +$/, "") : b.join("")
8046
8062
  );
8047
8063
  }
8048
- return m.join(`
8064
+ return g.join(`
8049
8065
  `);
8050
8066
  }
8051
8067
  function Hc(e) {
@@ -8731,15 +8747,15 @@ function Ip(e) {
8731
8747
  tableRow: l
8732
8748
  }
8733
8749
  };
8734
- function a(d, m, w, C) {
8750
+ function a(d, g, w, C) {
8735
8751
  return u(p(d, w, C), d.align);
8736
8752
  }
8737
- function l(d, m, w, C) {
8753
+ function l(d, g, w, C) {
8738
8754
  const b = c(d, w, C), S = u([b]);
8739
8755
  return S.slice(0, S.indexOf(`
8740
8756
  `));
8741
8757
  }
8742
- function s(d, m, w, C) {
8758
+ function s(d, g, w, C) {
8743
8759
  const b = w.enter("tableCell"), S = w.enter("phrasing"), v = w.containerPhrasing(d, {
8744
8760
  ...C,
8745
8761
  before: o,
@@ -8747,9 +8763,9 @@ function Ip(e) {
8747
8763
  });
8748
8764
  return S(), b(), v;
8749
8765
  }
8750
- function u(d, m) {
8766
+ function u(d, g) {
8751
8767
  return $c(d, {
8752
- align: m,
8768
+ align: g,
8753
8769
  // @ts-expect-error: `markdown-table` types should support `null`.
8754
8770
  alignDelimiters: r,
8755
8771
  // @ts-expect-error: `markdown-table` types should support `null`.
@@ -8758,24 +8774,24 @@ function Ip(e) {
8758
8774
  stringLength: i
8759
8775
  });
8760
8776
  }
8761
- function p(d, m, w) {
8777
+ function p(d, g, w) {
8762
8778
  const C = d.children;
8763
8779
  let b = -1;
8764
- const S = [], v = m.enter("table");
8780
+ const S = [], v = g.enter("table");
8765
8781
  for (; ++b < C.length; )
8766
- S[b] = c(C[b], m, w);
8782
+ S[b] = c(C[b], g, w);
8767
8783
  return v(), S;
8768
8784
  }
8769
- function c(d, m, w) {
8785
+ function c(d, g, w) {
8770
8786
  const C = d.children;
8771
8787
  let b = -1;
8772
- const S = [], v = m.enter("tableRow");
8788
+ const S = [], v = g.enter("tableRow");
8773
8789
  for (; ++b < C.length; )
8774
- S[b] = s(C[b], d, m, w);
8790
+ S[b] = s(C[b], d, g, w);
8775
8791
  return v(), S;
8776
8792
  }
8777
- function f(d, m, w) {
8778
- let C = Ui.inlineCode(d, m, w);
8793
+ function f(d, g, w) {
8794
+ let C = Ui.inlineCode(d, g, w);
8779
8795
  return w.stack.includes("tableCell") && (C = C.replace(/\|/g, "\\$&")), C;
8780
8796
  }
8781
8797
  }
@@ -8912,7 +8928,7 @@ function Rp(e, t, n) {
8912
8928
  return e.consume(c), i = !0, s;
8913
8929
  }
8914
8930
  function p(c) {
8915
- return o && i && de(r.previous) ? (e.exit("literalAutolinkEmail"), e.exit("literalAutolink"), t(c)) : n(c);
8931
+ return o && i && fe(r.previous) ? (e.exit("literalAutolinkEmail"), e.exit("literalAutolink"), t(c)) : n(c);
8916
8932
  }
8917
8933
  }
8918
8934
  function _p(e, t, n) {
@@ -8933,7 +8949,7 @@ function Op(e, t, n) {
8933
8949
  return (c === 72 || c === 104) && Ki.call(r, r.previous) && !Rn(r.events) ? (e.enter("literalAutolink"), e.enter("literalAutolinkHttp"), i += String.fromCodePoint(c), e.consume(c), l) : n(c);
8934
8950
  }
8935
8951
  function l(c) {
8936
- if (de(c) && i.length < 5)
8952
+ if (fe(c) && i.length < 5)
8937
8953
  return i += String.fromCodePoint(c), e.consume(c), l;
8938
8954
  if (c === 58) {
8939
8955
  const f = i.toLowerCase();
@@ -8998,10 +9014,10 @@ function jp(e, t, n) {
8998
9014
  return l === null || l === 40 || l === 91 || ie(l) || Ve(l) ? t(l) : r(l);
8999
9015
  }
9000
9016
  function o(l) {
9001
- return de(l) ? a(l) : n(l);
9017
+ return fe(l) ? a(l) : n(l);
9002
9018
  }
9003
9019
  function a(l) {
9004
- return l === 59 ? (e.consume(l), r) : de(l) ? (e.consume(l), a) : n(l);
9020
+ return l === 59 ? (e.consume(l), r) : fe(l) ? (e.consume(l), a) : n(l);
9005
9021
  }
9006
9022
  }
9007
9023
  function Up(e, t, n) {
@@ -9017,7 +9033,7 @@ function Xi(e) {
9017
9033
  return e === null || e === 40 || e === 42 || e === 95 || e === 91 || e === 93 || e === 126 || ie(e);
9018
9034
  }
9019
9035
  function Ki(e) {
9020
- return !de(e);
9036
+ return !fe(e);
9021
9037
  }
9022
9038
  function Qi(e) {
9023
9039
  return !(e === 47 || xn(e));
@@ -9179,36 +9195,36 @@ function Xp(e, t, n) {
9179
9195
  const r = this, i = r.parser.gfmFootnotes || (r.parser.gfmFootnotes = []);
9180
9196
  let o, a = 0, l;
9181
9197
  return s;
9182
- function s(m) {
9183
- return e.enter("gfmFootnoteDefinition")._container = !0, e.enter("gfmFootnoteDefinitionLabel"), e.enter("gfmFootnoteDefinitionLabelMarker"), e.consume(m), e.exit("gfmFootnoteDefinitionLabelMarker"), u;
9198
+ function s(g) {
9199
+ return e.enter("gfmFootnoteDefinition")._container = !0, e.enter("gfmFootnoteDefinitionLabel"), e.enter("gfmFootnoteDefinitionLabelMarker"), e.consume(g), e.exit("gfmFootnoteDefinitionLabelMarker"), u;
9184
9200
  }
9185
- function u(m) {
9186
- return m === 94 ? (e.enter("gfmFootnoteDefinitionMarker"), e.consume(m), e.exit("gfmFootnoteDefinitionMarker"), e.enter("gfmFootnoteDefinitionLabelString"), e.enter("chunkString").contentType = "string", p) : n(m);
9201
+ function u(g) {
9202
+ return g === 94 ? (e.enter("gfmFootnoteDefinitionMarker"), e.consume(g), e.exit("gfmFootnoteDefinitionMarker"), e.enter("gfmFootnoteDefinitionLabelString"), e.enter("chunkString").contentType = "string", p) : n(g);
9187
9203
  }
9188
- function p(m) {
9204
+ function p(g) {
9189
9205
  if (
9190
9206
  // Too long.
9191
9207
  a > 999 || // Closing brace with nothing.
9192
- m === 93 && !l || // Space or tab is not supported by GFM for some reason.
9208
+ g === 93 && !l || // Space or tab is not supported by GFM for some reason.
9193
9209
  // `\n` and `[` not being supported makes sense.
9194
- m === null || m === 91 || ie(m)
9210
+ g === null || g === 91 || ie(g)
9195
9211
  )
9196
- return n(m);
9197
- if (m === 93) {
9212
+ return n(g);
9213
+ if (g === 93) {
9198
9214
  e.exit("chunkString");
9199
9215
  const w = e.exit("gfmFootnoteDefinitionLabelString");
9200
- return o = Se(r.sliceSerialize(w)), e.enter("gfmFootnoteDefinitionLabelMarker"), e.consume(m), e.exit("gfmFootnoteDefinitionLabelMarker"), e.exit("gfmFootnoteDefinitionLabel"), f;
9216
+ return o = Se(r.sliceSerialize(w)), e.enter("gfmFootnoteDefinitionLabelMarker"), e.consume(g), e.exit("gfmFootnoteDefinitionLabelMarker"), e.exit("gfmFootnoteDefinitionLabel"), f;
9201
9217
  }
9202
- return ie(m) || (l = !0), a++, e.consume(m), m === 92 ? c : p;
9218
+ return ie(g) || (l = !0), a++, e.consume(g), g === 92 ? c : p;
9203
9219
  }
9204
- function c(m) {
9205
- return m === 91 || m === 92 || m === 93 ? (e.consume(m), a++, p) : p(m);
9220
+ function c(g) {
9221
+ return g === 91 || g === 92 || g === 93 ? (e.consume(g), a++, p) : p(g);
9206
9222
  }
9207
- function f(m) {
9208
- return m === 58 ? (e.enter("definitionMarker"), e.consume(m), e.exit("definitionMarker"), i.includes(o) || i.push(o), Z(e, d, "gfmFootnoteDefinitionWhitespace")) : n(m);
9223
+ function f(g) {
9224
+ return g === 58 ? (e.enter("definitionMarker"), e.consume(g), e.exit("definitionMarker"), i.includes(o) || i.push(o), ee(e, d, "gfmFootnoteDefinitionWhitespace")) : n(g);
9209
9225
  }
9210
- function d(m) {
9211
- return t(m);
9226
+ function d(g) {
9227
+ return t(g);
9212
9228
  }
9213
9229
  }
9214
9230
  function Kp(e, t, n) {
@@ -9219,7 +9235,7 @@ function Qp(e) {
9219
9235
  }
9220
9236
  function Jp(e, t, n) {
9221
9237
  const r = this;
9222
- return Z(e, i, "gfmFootnoteDefinitionIndent", 5);
9238
+ return ee(e, i, "gfmFootnoteDefinitionIndent", 5);
9223
9239
  function i(o) {
9224
9240
  const a = r.events[r.events.length - 1];
9225
9241
  return a && a[1].type === "gfmFootnoteDefinitionIndent" && a[2].sliceSerialize(a[1], !0).length === 4 ? t(o) : n(o);
@@ -9273,16 +9289,16 @@ function Zp(e) {
9273
9289
  const u = this.previous, p = this.events;
9274
9290
  let c = 0;
9275
9291
  return f;
9276
- function f(m) {
9277
- return u === 126 && p[p.length - 1][1].type !== "characterEscape" ? s(m) : (a.enter("strikethroughSequenceTemporary"), d(m));
9292
+ function f(g) {
9293
+ return u === 126 && p[p.length - 1][1].type !== "characterEscape" ? s(g) : (a.enter("strikethroughSequenceTemporary"), d(g));
9278
9294
  }
9279
- function d(m) {
9295
+ function d(g) {
9280
9296
  const w = Qe(u);
9281
- if (m === 126)
9282
- return c > 1 ? s(m) : (a.consume(m), c++, d);
9283
- if (c < 2 && !n) return s(m);
9284
- const C = a.exit("strikethroughSequenceTemporary"), b = Qe(m);
9285
- return C._open = !b || b === 2 && !!w, C._close = !w || w === 2 && !!b, l(m);
9297
+ if (g === 126)
9298
+ return c > 1 ? s(g) : (a.consume(g), c++, d);
9299
+ if (c < 2 && !n) return s(g);
9300
+ const C = a.exit("strikethroughSequenceTemporary"), b = Qe(g);
9301
+ return C._open = !b || b === 2 && !!w, C._close = !w || w === 2 && !!b, l(g);
9286
9302
  }
9287
9303
  }
9288
9304
  }
@@ -9392,13 +9408,13 @@ function id(e, t, n) {
9392
9408
  function l(x) {
9393
9409
  let I = r.events.length - 1;
9394
9410
  for (; I > -1; ) {
9395
- const P = r.events[I][1].type;
9396
- if (P === "lineEnding" || // Note: markdown-rs uses `whitespace` instead of `linePrefix`
9397
- P === "linePrefix") I--;
9411
+ const R = r.events[I][1].type;
9412
+ if (R === "lineEnding" || // Note: markdown-rs uses `whitespace` instead of `linePrefix`
9413
+ R === "linePrefix") I--;
9398
9414
  else break;
9399
9415
  }
9400
- const D = I > -1 ? r.events[I][1].type : null, $ = D === "tableHead" || D === "tableRow" ? k : s;
9401
- return $ === k && r.parser.lazy[r.now().line] ? n(x) : $(x);
9416
+ const P = I > -1 ? r.events[I][1].type : null, j = P === "tableHead" || P === "tableRow" ? k : s;
9417
+ return j === k && r.parser.lazy[r.now().line] ? n(x) : j(x);
9402
9418
  }
9403
9419
  function s(x) {
9404
9420
  return e.enter("tableHead"), e.enter("tableRow"), u(x);
@@ -9407,7 +9423,7 @@ function id(e, t, n) {
9407
9423
  return x === 124 || (a = !0, o += 1), p(x);
9408
9424
  }
9409
9425
  function p(x) {
9410
- return x === null ? n(x) : U(x) ? o > 1 ? (o = 0, r.interrupt = !0, e.exit("tableRow"), e.enter("lineEnding"), e.consume(x), e.exit("lineEnding"), d) : n(x) : Q(x) ? Z(e, p, "whitespace")(x) : (o += 1, a && (a = !1, i += 1), x === 124 ? (e.enter("tableCellDivider"), e.consume(x), e.exit("tableCellDivider"), a = !0, p) : (e.enter("data"), c(x)));
9426
+ return x === null ? n(x) : U(x) ? o > 1 ? (o = 0, r.interrupt = !0, e.exit("tableRow"), e.enter("lineEnding"), e.consume(x), e.exit("lineEnding"), d) : n(x) : Q(x) ? ee(e, p, "whitespace")(x) : (o += 1, a && (a = !1, i += 1), x === 124 ? (e.enter("tableCellDivider"), e.consume(x), e.exit("tableCellDivider"), a = !0, p) : (e.enter("data"), c(x)));
9411
9427
  }
9412
9428
  function c(x) {
9413
9429
  return x === null || x === 124 || ie(x) ? (e.exit("data"), p(x)) : (e.consume(x), x === 92 ? f : c);
@@ -9416,16 +9432,16 @@ function id(e, t, n) {
9416
9432
  return x === 92 || x === 124 ? (e.consume(x), c) : c(x);
9417
9433
  }
9418
9434
  function d(x) {
9419
- return r.interrupt = !1, r.parser.lazy[r.now().line] ? n(x) : (e.enter("tableDelimiterRow"), a = !1, Q(x) ? Z(e, m, "linePrefix", r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(x) : m(x));
9435
+ return r.interrupt = !1, r.parser.lazy[r.now().line] ? n(x) : (e.enter("tableDelimiterRow"), a = !1, Q(x) ? ee(e, g, "linePrefix", r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(x) : g(x));
9420
9436
  }
9421
- function m(x) {
9437
+ function g(x) {
9422
9438
  return x === 45 || x === 58 ? C(x) : x === 124 ? (a = !0, e.enter("tableCellDivider"), e.consume(x), e.exit("tableCellDivider"), w) : M(x);
9423
9439
  }
9424
9440
  function w(x) {
9425
- return Q(x) ? Z(e, C, "whitespace")(x) : C(x);
9441
+ return Q(x) ? ee(e, C, "whitespace")(x) : C(x);
9426
9442
  }
9427
9443
  function C(x) {
9428
- return x === 58 ? (o += 1, a = !0, e.enter("tableDelimiterMarker"), e.consume(x), e.exit("tableDelimiterMarker"), b) : x === 45 ? (o += 1, b(x)) : x === null || U(x) ? N(x) : M(x);
9444
+ return x === 58 ? (o += 1, a = !0, e.enter("tableDelimiterMarker"), e.consume(x), e.exit("tableDelimiterMarker"), b) : x === 45 ? (o += 1, b(x)) : x === null || U(x) ? A(x) : M(x);
9429
9445
  }
9430
9446
  function b(x) {
9431
9447
  return x === 45 ? (e.enter("tableDelimiterFiller"), S(x)) : M(x);
@@ -9434,43 +9450,43 @@ function id(e, t, n) {
9434
9450
  return x === 45 ? (e.consume(x), S) : x === 58 ? (a = !0, e.exit("tableDelimiterFiller"), e.enter("tableDelimiterMarker"), e.consume(x), e.exit("tableDelimiterMarker"), v) : (e.exit("tableDelimiterFiller"), v(x));
9435
9451
  }
9436
9452
  function v(x) {
9437
- return Q(x) ? Z(e, N, "whitespace")(x) : N(x);
9453
+ return Q(x) ? ee(e, A, "whitespace")(x) : A(x);
9438
9454
  }
9439
- function N(x) {
9440
- return x === 124 ? m(x) : x === null || U(x) ? !a || i !== o ? M(x) : (e.exit("tableDelimiterRow"), e.exit("tableHead"), t(x)) : M(x);
9455
+ function A(x) {
9456
+ return x === 124 ? g(x) : x === null || U(x) ? !a || i !== o ? M(x) : (e.exit("tableDelimiterRow"), e.exit("tableHead"), t(x)) : M(x);
9441
9457
  }
9442
9458
  function M(x) {
9443
9459
  return n(x);
9444
9460
  }
9445
9461
  function k(x) {
9446
- return e.enter("tableRow"), A(x);
9462
+ return e.enter("tableRow"), D(x);
9447
9463
  }
9448
- function A(x) {
9449
- return x === 124 ? (e.enter("tableCellDivider"), e.consume(x), e.exit("tableCellDivider"), A) : x === null || U(x) ? (e.exit("tableRow"), t(x)) : Q(x) ? Z(e, A, "whitespace")(x) : (e.enter("data"), _(x));
9464
+ function D(x) {
9465
+ return x === 124 ? (e.enter("tableCellDivider"), e.consume(x), e.exit("tableCellDivider"), D) : x === null || U(x) ? (e.exit("tableRow"), t(x)) : Q(x) ? ee(e, D, "whitespace")(x) : (e.enter("data"), F(x));
9450
9466
  }
9451
- function _(x) {
9452
- return x === null || x === 124 || ie(x) ? (e.exit("data"), A(x)) : (e.consume(x), x === 92 ? O : _);
9467
+ function F(x) {
9468
+ return x === null || x === 124 || ie(x) ? (e.exit("data"), D(x)) : (e.consume(x), x === 92 ? O : F);
9453
9469
  }
9454
9470
  function O(x) {
9455
- return x === 92 || x === 124 ? (e.consume(x), _) : _(x);
9471
+ return x === 92 || x === 124 ? (e.consume(x), F) : F(x);
9456
9472
  }
9457
9473
  }
9458
9474
  function ad(e, t) {
9459
9475
  let n = -1, r = !0, i = 0, o = [0, 0, 0, 0], a = [0, 0, 0, 0], l = !1, s = 0, u, p, c;
9460
9476
  const f = new ed();
9461
9477
  for (; ++n < e.length; ) {
9462
- const d = e[n], m = d[1];
9463
- d[0] === "enter" ? m.type === "tableHead" ? (l = !1, s !== 0 && (Pr(f, t, s, u, p), p = void 0, s = 0), u = {
9478
+ const d = e[n], g = d[1];
9479
+ d[0] === "enter" ? g.type === "tableHead" ? (l = !1, s !== 0 && (Pr(f, t, s, u, p), p = void 0, s = 0), u = {
9464
9480
  type: "table",
9465
- start: Object.assign({}, m.start),
9481
+ start: Object.assign({}, g.start),
9466
9482
  // Note: correct end is set later.
9467
- end: Object.assign({}, m.end)
9468
- }, f.add(n, 0, [["enter", u, t]])) : m.type === "tableRow" || m.type === "tableDelimiterRow" ? (r = !0, c = void 0, o = [0, 0, 0, 0], a = [0, n + 1, 0, 0], l && (l = !1, p = {
9483
+ end: Object.assign({}, g.end)
9484
+ }, f.add(n, 0, [["enter", u, t]])) : g.type === "tableRow" || g.type === "tableDelimiterRow" ? (r = !0, c = void 0, o = [0, 0, 0, 0], a = [0, n + 1, 0, 0], l && (l = !1, p = {
9469
9485
  type: "tableBody",
9470
- start: Object.assign({}, m.start),
9486
+ start: Object.assign({}, g.start),
9471
9487
  // Note: correct end is set later.
9472
- end: Object.assign({}, m.end)
9473
- }, f.add(n, 0, [["enter", p, t]])), i = m.type === "tableDelimiterRow" ? 2 : p ? 3 : 1) : i && (m.type === "data" || m.type === "tableDelimiterMarker" || m.type === "tableDelimiterFiller") ? (r = !1, a[2] === 0 && (o[1] !== 0 && (a[0] = a[1], c = St(f, t, o, i, void 0, c), o = [0, 0, 0, 0]), a[2] = n)) : m.type === "tableCellDivider" && (r ? r = !1 : (o[1] !== 0 && (a[0] = a[1], c = St(f, t, o, i, void 0, c)), o = a, a = [o[1], n, 0, 0])) : m.type === "tableHead" ? (l = !0, s = n) : m.type === "tableRow" || m.type === "tableDelimiterRow" ? (s = n, o[1] !== 0 ? (a[0] = a[1], c = St(f, t, o, i, n, c)) : a[1] !== 0 && (c = St(f, t, a, i, n, c)), i = 0) : i && (m.type === "data" || m.type === "tableDelimiterMarker" || m.type === "tableDelimiterFiller") && (a[3] = n);
9488
+ end: Object.assign({}, g.end)
9489
+ }, f.add(n, 0, [["enter", p, t]])), i = g.type === "tableDelimiterRow" ? 2 : p ? 3 : 1) : i && (g.type === "data" || g.type === "tableDelimiterMarker" || g.type === "tableDelimiterFiller") ? (r = !1, a[2] === 0 && (o[1] !== 0 && (a[0] = a[1], c = St(f, t, o, i, void 0, c), o = [0, 0, 0, 0]), a[2] = n)) : g.type === "tableCellDivider" && (r ? r = !1 : (o[1] !== 0 && (a[0] = a[1], c = St(f, t, o, i, void 0, c)), o = a, a = [o[1], n, 0, 0])) : g.type === "tableHead" ? (l = !0, s = n) : g.type === "tableRow" || g.type === "tableDelimiterRow" ? (s = n, o[1] !== 0 ? (a[0] = a[1], c = St(f, t, o, i, n, c)) : a[1] !== 0 && (c = St(f, t, a, i, n, c)), i = 0) : i && (g.type === "data" || g.type === "tableDelimiterMarker" || g.type === "tableDelimiterFiller") && (a[3] = n);
9474
9490
  }
9475
9491
  for (s !== 0 && Pr(f, t, s, u, p), f.consume(t.events), n = -1; ++n < t.events.length; ) {
9476
9492
  const d = t.events[n];
@@ -9496,8 +9512,8 @@ function St(e, t, n, r, i, o) {
9496
9512
  if (e.add(n[2], 0, [["enter", c, t]]), r !== 2) {
9497
9513
  const f = t.events[n[2]], d = t.events[n[3]];
9498
9514
  if (f[1].end = Object.assign({}, d[1].end), f[1].type = "chunkText", f[1].contentType = "text", n[3] > n[2] + 1) {
9499
- const m = n[2] + 1, w = n[3] - n[2] - 1;
9500
- e.add(m, w, []);
9515
+ const g = n[2] + 1, w = n[3] - n[2] - 1;
9516
+ e.add(g, w, []);
9501
9517
  }
9502
9518
  }
9503
9519
  e.add(n[3] + 1, 0, [["exit", c, t]]);
@@ -9547,7 +9563,7 @@ function sd(e, t, n) {
9547
9563
  }
9548
9564
  }
9549
9565
  function ud(e, t, n) {
9550
- return Z(e, r, "whitespace");
9566
+ return ee(e, r, "whitespace");
9551
9567
  function r(i) {
9552
9568
  return i === null ? n(i) : t(i);
9553
9569
  }
@@ -9595,7 +9611,7 @@ function J({ name: e, size: t = 16, color: n = "currentColor", className: r, sty
9595
9611
  );
9596
9612
  }
9597
9613
  function md({ content: e }) {
9598
- const [t, n] = V(!1);
9614
+ const [t, n] = W(!1);
9599
9615
  return /* @__PURE__ */ T("div", { className: "sa-thinking-part", onClick: () => n(!t), children: [
9600
9616
  /* @__PURE__ */ T("div", { className: "sa-thinking-header", children: [
9601
9617
  /* @__PURE__ */ h("span", { className: "sa-thinking-icon", children: /* @__PURE__ */ h(J, { name: "brain", size: 14 }) }),
@@ -9606,7 +9622,7 @@ function md({ content: e }) {
9606
9622
  ] });
9607
9623
  }
9608
9624
  function xd({ toolName: e, toolCallId: t, args: n }) {
9609
- const [r, i] = V(!1), [o, a] = V(!1);
9625
+ const [r, i] = W(!1), [o, a] = W(!1);
9610
9626
  let l = n;
9611
9627
  try {
9612
9628
  l = JSON.stringify(JSON.parse(n), null, 2);
@@ -9639,7 +9655,7 @@ function xd({ toolName: e, toolCallId: t, args: n }) {
9639
9655
  ] });
9640
9656
  }
9641
9657
  function Rr({ text: e }) {
9642
- const [t, n] = V(!1);
9658
+ const [t, n] = W(!1);
9643
9659
  return /* @__PURE__ */ T("button", { className: "sa-action-btn", onClick: () => {
9644
9660
  var i;
9645
9661
  (i = navigator.clipboard) == null || i.writeText(e).then(() => {
@@ -9653,8 +9669,8 @@ function Rr({ text: e }) {
9653
9669
  ] });
9654
9670
  }
9655
9671
  function bd({ html: e }) {
9656
- const [t, n] = V(null);
9657
- return re(() => {
9672
+ const [t, n] = W(null);
9673
+ return te(() => {
9658
9674
  let r = !1;
9659
9675
  return import("./purify.es-C-6FFqDW.js").then((i) => {
9660
9676
  r || n(i.default.sanitize(e, { FORCE_BODY: !0, ADD_ATTR: ["target"] }));
@@ -9870,7 +9886,7 @@ function Id(e) {
9870
9886
  return typeof e == "string" ? { value: e, label: e } : e;
9871
9887
  }
9872
9888
  function zd({ interrupt: e, onRespond: t, disabled: n, initialValue: r }) {
9873
- const i = (e.options ?? []).map(Id), [o, a] = V(
9889
+ const i = (e.options ?? []).map(Id), [o, a] = W(
9874
9890
  () => new Set(Array.isArray(r) ? r : [])
9875
9891
  ), l = (s) => {
9876
9892
  n || a((u) => {
@@ -9914,7 +9930,7 @@ function zd({ interrupt: e, onRespond: t, disabled: n, initialValue: r }) {
9914
9930
  ] });
9915
9931
  }
9916
9932
  function Td({ interrupt: e, onRespond: t, disabled: n, initialValue: r }) {
9917
- const [i, o] = V(r ?? ""), a = e.inputType ?? "text", l = a === "textarea", s = () => {
9933
+ const [i, o] = W(r ?? ""), a = e.inputType ?? "text", l = a === "textarea", s = () => {
9918
9934
  n || e.required && !i.trim() || t({ action: "submit", value: i.trim() });
9919
9935
  };
9920
9936
  return /* @__PURE__ */ T("div", { className: "sa-interrupt-card", children: [
@@ -9962,7 +9978,7 @@ function Td({ interrupt: e, onRespond: t, disabled: n, initialValue: r }) {
9962
9978
  ] });
9963
9979
  }
9964
9980
  function Ad({ interrupt: e, onRespond: t, disabled: n, initialValue: r }) {
9965
- const i = e.fields ?? [], [o, a] = V(() => {
9981
+ const i = e.fields ?? [], [o, a] = W(() => {
9966
9982
  const p = {};
9967
9983
  for (const c of i)
9968
9984
  p[c.name] = (r == null ? void 0 : r[c.name]) ?? c.defaultValue ?? "";
@@ -10061,9 +10077,9 @@ const Ld = [
10061
10077
  { value: 6, label: "难以理解" }
10062
10078
  ];
10063
10079
  function Md({ message: e, onCopy: t, onRegenerate: n, onFeedback: r }) {
10064
- const { status: i, cancelFeedback: o } = Le(), [a, l] = V(null), [s, u] = V(!1), [p, c] = V(!1), f = X(null), d = H(() => {
10080
+ const { status: i, cancelFeedback: o } = Le(), [a, l] = W(null), [s, u] = W(!1), [p, c] = W(!1), f = X(null), d = H(() => {
10065
10081
  t(), u(!0), setTimeout(() => u(!1), 2e3);
10066
- }, [t]), m = H(() => {
10082
+ }, [t]), g = H(() => {
10067
10083
  a === "like" ? (l(null), o(e.id)) : (l("like"), c(!1), r == null || r(e.id, "like"));
10068
10084
  }, [a, e.id, r, o]), w = H(() => {
10069
10085
  a === "dislike" ? (l(null), c(!1), o(e.id)) : c(!0);
@@ -10072,12 +10088,12 @@ function Md({ message: e, onCopy: t, onRegenerate: n, onFeedback: r }) {
10072
10088
  }, [e.id, r]), b = H(() => {
10073
10089
  c(!1);
10074
10090
  }, []);
10075
- return re(() => {
10091
+ return te(() => {
10076
10092
  if (!p) return;
10077
- const S = (N) => {
10078
- f.current && !f.current.contains(N.target) && c(!1);
10079
- }, v = (N) => {
10080
- N.key === "Escape" && c(!1);
10093
+ const S = (A) => {
10094
+ f.current && !f.current.contains(A.target) && c(!1);
10095
+ }, v = (A) => {
10096
+ A.key === "Escape" && c(!1);
10081
10097
  };
10082
10098
  return document.addEventListener("mousedown", S), document.addEventListener("keydown", v), () => {
10083
10099
  document.removeEventListener("mousedown", S), document.removeEventListener("keydown", v);
@@ -10098,7 +10114,7 @@ function Md({ message: e, onCopy: t, onRegenerate: n, onFeedback: r }) {
10098
10114
  "button",
10099
10115
  {
10100
10116
  className: `sa-action-btn ${a === "like" ? "sa-action-btn-active" : ""}`,
10101
- onClick: m,
10117
+ onClick: g,
10102
10118
  title: "有用",
10103
10119
  "aria-label": "点赞",
10104
10120
  children: /* @__PURE__ */ h(J, { name: "thumbs-up", size: 14 })
@@ -10121,7 +10137,7 @@ function Md({ message: e, onCopy: t, onRegenerate: n, onFeedback: r }) {
10121
10137
  ] });
10122
10138
  }
10123
10139
  function Pd({ onSubmit: e, onCancel: t }) {
10124
- const [n, r] = V(void 0), [i, o] = V("");
10140
+ const [n, r] = W(void 0), [i, o] = W("");
10125
10141
  return /* @__PURE__ */ T("div", { className: "sa-dislike-panel", children: [
10126
10142
  /* @__PURE__ */ h("div", { className: "sa-dislike-panel-title", children: "请选择不满意的原因(可选)" }),
10127
10143
  /* @__PURE__ */ h("div", { className: "sa-dislike-reasons", children: Ld.map((a) => /* @__PURE__ */ h(
@@ -10165,9 +10181,9 @@ function Rd({
10165
10181
  }) {
10166
10182
  const { regenerate: l, feedback: s, respondToInterrupt: u } = Le(), p = H(() => {
10167
10183
  var M;
10168
- const N = e.parts.filter((k) => k.type === "text").map((k) => k.content).join(`
10184
+ const A = e.parts.filter((k) => k.type === "text").map((k) => k.content).join(`
10169
10185
  `);
10170
- (M = navigator.clipboard) == null || M.writeText(N).catch(() => {
10186
+ (M = navigator.clipboard) == null || M.writeText(A).catch(() => {
10171
10187
  });
10172
10188
  }, [e]), c = e.role === "user", f = r.Message;
10173
10189
  if (f)
@@ -10185,7 +10201,7 @@ function Rd({
10185
10201
  showTimestamp: a
10186
10202
  }
10187
10203
  );
10188
- const d = r.TextPart ?? fd, m = r.ThinkingPart ?? md, w = r.ToolCallPart ?? xd, C = r.ToolResultPart ?? wd, b = r.ErrorPart ?? yd, S = r.ActionBar ?? Md, v = !c && e.parts.some((N) => N.type === "text" && N.content);
10204
+ const d = r.TextPart ?? fd, g = r.ThinkingPart ?? md, w = r.ToolCallPart ?? xd, C = r.ToolResultPart ?? wd, b = r.ErrorPart ?? yd, S = r.ActionBar ?? Md, v = !c && e.parts.some((A) => A.type === "text" && A.content);
10189
10205
  return /* @__PURE__ */ T(
10190
10206
  "div",
10191
10207
  {
@@ -10194,7 +10210,7 @@ function Rd({
10194
10210
  !c && /* @__PURE__ */ h(
10195
10211
  Or,
10196
10212
  {
10197
- src: (i == null ? void 0 : i.assistant) || (t && n ? pe.assistantAvatarGenerating : pe.assistantAvatar),
10213
+ src: (i == null ? void 0 : i.assistant) || (t && n ? de.assistantAvatarGenerating : de.assistantAvatar),
10198
10214
  alt: "AI"
10199
10215
  }
10200
10216
  ),
@@ -10207,21 +10223,21 @@ function Rd({
10207
10223
  }
10208
10224
  ),
10209
10225
  /* @__PURE__ */ T("div", { className: "sa-message-body", children: [
10210
- e.parts.map((N, M) => {
10211
- switch (N.type) {
10226
+ e.parts.map((A, M) => {
10227
+ switch (A.type) {
10212
10228
  case "text":
10213
- return /* @__PURE__ */ h(d, { content: N.content }, M);
10229
+ return /* @__PURE__ */ h(d, { content: A.content }, M);
10214
10230
  case "attachment":
10215
- return /* @__PURE__ */ h(kd, { attachment: N.attachment }, M);
10231
+ return /* @__PURE__ */ h(kd, { attachment: A.attachment }, M);
10216
10232
  case "thinking":
10217
- return /* @__PURE__ */ h(m, { content: N.content }, M);
10233
+ return /* @__PURE__ */ h(g, { content: A.content }, M);
10218
10234
  case "tool_call":
10219
10235
  return /* @__PURE__ */ h(
10220
10236
  w,
10221
10237
  {
10222
- toolName: N.toolName,
10223
- toolCallId: N.toolCallId,
10224
- args: N.args
10238
+ toolName: A.toolName,
10239
+ toolCallId: A.toolCallId,
10240
+ args: A.args
10225
10241
  },
10226
10242
  M
10227
10243
  );
@@ -10229,12 +10245,12 @@ function Rd({
10229
10245
  return /* @__PURE__ */ h(
10230
10246
  C,
10231
10247
  {
10232
- toolName: N.toolName,
10233
- toolCallId: N.toolCallId,
10234
- content: N.content,
10235
- artifacts: N.artifacts,
10236
- renderMode: N.renderMode,
10237
- html: N.html,
10248
+ toolName: A.toolName,
10249
+ toolCallId: A.toolCallId,
10250
+ content: A.content,
10251
+ artifacts: A.artifacts,
10252
+ renderMode: A.renderMode,
10253
+ html: A.html,
10238
10254
  artifactPreview: o
10239
10255
  },
10240
10256
  M
@@ -10243,7 +10259,7 @@ function Rd({
10243
10259
  return /* @__PURE__ */ h(
10244
10260
  b,
10245
10261
  {
10246
- content: N.content,
10262
+ content: A.content,
10247
10263
  onRetry: l
10248
10264
  },
10249
10265
  M
@@ -10252,10 +10268,10 @@ function Rd({
10252
10268
  return /* @__PURE__ */ h(
10253
10269
  Dd,
10254
10270
  {
10255
- interrupt: N.interrupt,
10256
- resolved: N.resolved ?? !1,
10257
- response: N.response,
10258
- onRespond: (k) => u(N.interrupt.interruptId, k)
10271
+ interrupt: A.interrupt,
10272
+ resolved: A.resolved ?? !1,
10273
+ response: A.response,
10274
+ onRespond: (k) => u(A.interrupt.interruptId, k)
10259
10275
  },
10260
10276
  M
10261
10277
  );
@@ -10295,7 +10311,7 @@ function _d({ message: e, suggestedPrompts: t, onPromptClick: n, capabilities: r
10295
10311
  };
10296
10312
  return /* @__PURE__ */ T("div", { className: "flex flex-col gap-8 py-2", children: [
10297
10313
  /* @__PURE__ */ T("div", { className: "flex flex-col items-center gap-1 opacity-0 animate-sa-home-fade-in", children: [
10298
- /* @__PURE__ */ h("img", { src: o || pe.logo, alt: "AI 助手", className: "block max-w-16 shrink-0 animate-sa-logo-float", draggable: !1 }),
10314
+ /* @__PURE__ */ h("img", { src: o || de.logo, alt: "AI 助手", className: "block max-w-16 shrink-0 animate-sa-logo-float", draggable: !1 }),
10299
10315
  /* @__PURE__ */ h("h3", { className: "sa-shimmer-text m-0 mb-1 text-[18px] font-bold leading-[1.3] text-[#333] animate-sa-title-shimmer", children: e || "你好!有什么可以帮你的?" })
10300
10316
  ] }),
10301
10317
  r && r.length > 0 && /* @__PURE__ */ h("div", { className: "flex flex-col items-start gap-4 opacity-0 animate-sa-home-fade-in", style: { animationDelay: "150ms" }, children: r.map((s) => /* @__PURE__ */ T("div", { className: "inline-flex w-full max-w-full min-w-0 items-center gap-[7px]", children: [
@@ -10339,7 +10355,7 @@ function _d({ message: e, suggestedPrompts: t, onPromptClick: n, capabilities: r
10339
10355
  ] });
10340
10356
  }
10341
10357
  function Zi({ slots: e, welcomeMessage: t, suggestedPrompts: n, avatar: r, artifactPreview: i, capabilities: o, quickLinks: a, logo: l, showTimestamp: s }) {
10342
- const { messages: u, status: p, sendMessage: c, openPanel: f } = Le(), { containerRef: d } = ba([u]), m = p === "streaming", w = e.WelcomeScreen ?? _d, C = e.AppendContainer;
10358
+ const { messages: u, status: p, sendMessage: c, openPanel: f } = Le(), { containerRef: d } = ba([u]), g = p === "streaming", w = e.WelcomeScreen ?? _d, C = e.AppendContainer;
10343
10359
  return u.length === 0 ? /* @__PURE__ */ T("div", { className: "sa-thread", ref: d, children: [
10344
10360
  /* @__PURE__ */ h(
10345
10361
  w,
@@ -10358,7 +10374,7 @@ function Zi({ slots: e, welcomeMessage: t, suggestedPrompts: n, avatar: r, artif
10358
10374
  Rd,
10359
10375
  {
10360
10376
  message: b,
10361
- isStreaming: m,
10377
+ isStreaming: g,
10362
10378
  isLast: S === u.length - 1,
10363
10379
  slots: e,
10364
10380
  avatar: r,
@@ -10370,7 +10386,7 @@ function Zi({ slots: e, welcomeMessage: t, suggestedPrompts: n, avatar: r, artif
10370
10386
  }
10371
10387
  function Od({ items: e, activeIndex: t, onSelect: n }) {
10372
10388
  const r = X(null);
10373
- return re(() => {
10389
+ return te(() => {
10374
10390
  var o;
10375
10391
  const i = (o = r.current) == null ? void 0 : o.children[t];
10376
10392
  i == null || i.scrollIntoView({ block: "nearest" });
@@ -10393,14 +10409,14 @@ function Od({ items: e, activeIndex: t, onSelect: n }) {
10393
10409
  )) });
10394
10410
  }
10395
10411
  function Bd({ sdk: e, input: t, onSelect: n }) {
10396
- const [r, i] = V([]), [o, a] = V(!1), [l, s] = V(0), u = X(!1);
10397
- re(() => {
10412
+ const [r, i] = W([]), [o, a] = W(!1), [l, s] = W(0), u = X(!1);
10413
+ te(() => {
10398
10414
  u.current || (u.current = !0, e.listSkills().then(i).catch(() => i([])));
10399
10415
  }, [e]);
10400
10416
  const p = /^\/\S*$/.test(t);
10401
- re(() => {
10417
+ te(() => {
10402
10418
  a(p);
10403
- }, [p]), re(() => {
10419
+ }, [p]), te(() => {
10404
10420
  p && s(0);
10405
10421
  }, [t, p]);
10406
10422
  const c = t.startsWith("/") ? t.slice(1).toLowerCase() : "", f = ht(
@@ -10408,18 +10424,18 @@ function Bd({ sdk: e, input: t, onSelect: n }) {
10408
10424
  (v) => !c || v.code.toLowerCase().includes(c) || v.name.toLowerCase().includes(c) || v.displayName && v.displayName.toLowerCase().includes(c)
10409
10425
  ),
10410
10426
  [r, c]
10411
- ), d = X(o), m = X(f), w = X(l), C = X(n);
10412
- d.current = o, m.current = f, w.current = l, C.current = n;
10427
+ ), d = X(o), g = X(f), w = X(l), C = X(n);
10428
+ d.current = o, g.current = f, w.current = l, C.current = n;
10413
10429
  const b = H((v) => {
10414
- if (!d.current || m.current.length === 0) return !1;
10430
+ if (!d.current || g.current.length === 0) return !1;
10415
10431
  switch (v.key) {
10416
10432
  case "ArrowDown":
10417
- return v.preventDefault(), s((N) => (N + 1) % m.current.length), !0;
10433
+ return v.preventDefault(), s((A) => (A + 1) % g.current.length), !0;
10418
10434
  case "ArrowUp":
10419
- return v.preventDefault(), s((N) => (N - 1 + m.current.length) % m.current.length), !0;
10435
+ return v.preventDefault(), s((A) => (A - 1 + g.current.length) % g.current.length), !0;
10420
10436
  case "Enter":
10421
10437
  case "Tab":
10422
- return v.preventDefault(), C.current(m.current[w.current]), a(!1), !0;
10438
+ return v.preventDefault(), C.current(g.current[w.current]), a(!1), !0;
10423
10439
  case "Escape":
10424
10440
  return v.preventDefault(), a(!1), !0;
10425
10441
  default:
@@ -10446,9 +10462,9 @@ function Hd({ size: e = 16 }) {
10446
10462
  );
10447
10463
  }
10448
10464
  function ea() {
10449
- const { status: e, sendMessage: t, stop: n, sdk: r, attachmentUploader: i, nosUpload: o } = Le(), [a, l] = V(""), [s, u] = V([]), p = X(null), c = X(null), f = !!i || !!o, d = e === "streaming" || e === "submitted", m = s.filter((x) => x.attachment), w = s.some(
10465
+ const { status: e, sendMessage: t, stop: n, sdk: r, attachmentUploader: i, nosUpload: o } = Le(), [a, l] = W(""), [s, u] = W([]), p = X(null), c = X(null), f = !!i || !!o, d = e === "streaming" || e === "submitted", g = s.filter((x) => x.attachment), w = s.some(
10450
10466
  (x) => !x.attachment && x.status === "uploading"
10451
- ), C = !!a.trim() || s.length > 0 || d, b = !d && !w && (a.trim().length > 0 || m.length > 0), S = H((x) => {
10467
+ ), C = !!a.trim() || s.length > 0 || d, b = !d && !w && (a.trim().length > 0 || g.length > 0), S = H((x) => {
10452
10468
  l(`/${x.name} `), setTimeout(() => {
10453
10469
  const I = p.current;
10454
10470
  I && (I.focus(), I.selectionStart = I.selectionEnd = I.value.length);
@@ -10457,65 +10473,65 @@ function ea() {
10457
10473
  sdk: r,
10458
10474
  input: a,
10459
10475
  onSelect: S
10460
- }), N = H(
10476
+ }), A = H(
10461
10477
  (x) => {
10462
10478
  const I = Array.from(x.target.files ?? []);
10463
10479
  if (x.target.value = "", !f || I.length === 0) return;
10464
- const D = $d - s.length, $ = I.slice(0, Math.max(0, D));
10465
- if ($.length === 0) return;
10466
- const P = $.map((z) => ({
10467
- key: `${z.name}_${z.size}_${Date.now()}_${Math.random().toString(36).slice(2, 6)}`,
10468
- file: z,
10480
+ const P = $d - s.length, j = I.slice(0, Math.max(0, P));
10481
+ if (j.length === 0) return;
10482
+ const R = j.map((N) => ({
10483
+ key: `${N.name}_${N.size}_${Date.now()}_${Math.random().toString(36).slice(2, 6)}`,
10484
+ file: N,
10469
10485
  status: "uploading"
10470
10486
  }));
10471
- u((z) => [...z, ...P]);
10472
- for (const { key: z, file: B } of P)
10487
+ u((N) => [...N, ...R]);
10488
+ for (const { key: N, file: q } of R)
10473
10489
  (i || sa({
10474
10490
  baseURL: o.baseURL,
10475
10491
  headers: o.headers,
10476
10492
  trunkSize: o.trunkSize,
10477
- onProgress: (j) => u(
10478
- (q) => q.map((g) => g.key === z ? { ...g, percent: j } : g)
10493
+ onProgress: (B) => u(
10494
+ (V) => V.map((m) => m.key === N ? { ...m, percent: B } : m)
10479
10495
  )
10480
- }))(B).then((j) => {
10496
+ }))(q).then((B) => {
10481
10497
  u(
10482
- (q) => q.map(
10483
- (g) => g.key === z ? {
10484
- ...g,
10498
+ (V) => V.map(
10499
+ (m) => m.key === N ? {
10500
+ ...m,
10485
10501
  attachment: {
10486
- ...j,
10487
- filename: j.filename || B.name,
10488
- size: j.size ?? B.size,
10489
- mime: j.mime ?? B.type
10502
+ ...B,
10503
+ filename: B.filename || q.name,
10504
+ size: B.size ?? q.size,
10505
+ mime: B.mime ?? q.type
10490
10506
  }
10491
- } : g
10507
+ } : m
10492
10508
  )
10493
10509
  );
10494
- }).catch((j) => {
10510
+ }).catch((B) => {
10495
10511
  u(
10496
- (q) => q.map(
10497
- (g) => g.key === z ? {
10498
- ...g,
10512
+ (V) => V.map(
10513
+ (m) => m.key === N ? {
10514
+ ...m,
10499
10515
  status: "error",
10500
- errorMsg: j instanceof Error ? j.message : String(j)
10501
- } : g
10516
+ errorMsg: B instanceof Error ? B.message : String(B)
10517
+ } : m
10502
10518
  )
10503
10519
  );
10504
10520
  });
10505
10521
  },
10506
10522
  [i, o, s]
10507
10523
  ), M = H((x) => {
10508
- u((I) => I.filter((D) => D.key !== x));
10524
+ u((I) => I.filter((P) => P.key !== x));
10509
10525
  }, []), k = H(() => {
10510
10526
  if (!b) return;
10511
- const x = a.trim(), I = m.map((D) => D.attachment);
10527
+ const x = a.trim(), I = g.map((P) => P.attachment);
10512
10528
  t(x, I.length > 0 ? I : void 0), l(""), u([]), p.current && (p.current.style.height = "auto");
10513
- }, [b, a, m, t]), A = H(
10529
+ }, [b, a, g, t]), D = H(
10514
10530
  (x) => {
10515
10531
  v.handleKeyDown(x) || x.key === "Enter" && !x.shiftKey && (x.preventDefault(), k());
10516
10532
  },
10517
10533
  [k, v.handleKeyDown]
10518
- ), _ = H(
10534
+ ), F = H(
10519
10535
  (x) => {
10520
10536
  l(x.target.value);
10521
10537
  const I = x.target;
@@ -10602,7 +10618,7 @@ function ea() {
10602
10618
  type: "file",
10603
10619
  multiple: !0,
10604
10620
  className: "hidden",
10605
- onChange: N,
10621
+ onChange: A,
10606
10622
  "aria-label": "选择附件"
10607
10623
  }
10608
10624
  ),
@@ -10612,8 +10628,8 @@ function ea() {
10612
10628
  ref: p,
10613
10629
  className: `sa-input-field min-h-[34px] flex-1 resize-none border-none bg-transparent p-0 text-[14px] leading-[1.5] text-[#333] outline-none placeholder:text-[#B8B8B8] ${f ? "pl-[4px]" : ""}`,
10614
10630
  value: a,
10615
- onChange: _,
10616
- onKeyDown: A,
10631
+ onChange: F,
10632
+ onKeyDown: D,
10617
10633
  placeholder: "请输入你想要了解的关键词",
10618
10634
  rows: 1,
10619
10635
  disabled: d
@@ -10640,7 +10656,7 @@ function ea() {
10640
10656
  children: /* @__PURE__ */ h(
10641
10657
  "img",
10642
10658
  {
10643
- src: pe.sendSolid,
10659
+ src: de.sendSolid,
10644
10660
  alt: "发送",
10645
10661
  width: 14,
10646
10662
  height: 14,
@@ -10676,7 +10692,7 @@ function jd({ artifact: e }) {
10676
10692
  if (e.type === "docx") {
10677
10693
  const u = await fetch(e.url);
10678
10694
  if (!u.ok) throw new Error(`HTTP ${u.status}`);
10679
- const p = await u.arrayBuffer(), f = await (await import("./mammoth.browser-CmEXxaIp.js").then((m) => m.m)).convertToHtml({ arrayBuffer: p }), d = (await import("./purify.es-C-6FFqDW.js")).default;
10695
+ const p = await u.arrayBuffer(), f = await (await import("./mammoth.browser-CmEXxaIp.js").then((g) => g.m)).convertToHtml({ arrayBuffer: p }), d = (await import("./purify.es-C-6FFqDW.js")).default;
10680
10696
  l || (n(d.sanitize(f.value, { FORCE_BODY: !0, ADD_ATTR: ["target"] })), i(!1));
10681
10697
  return;
10682
10698
  }
@@ -10694,10 +10710,10 @@ function jd({ artifact: e }) {
10694
10710
  ] }) : e.type === "pdf" ? /* @__PURE__ */ h("iframe", { src: e.url, title: e.filename, className: "sa-drawer-preview-iframe", sandbox: "allow-scripts" }) : t !== null ? /* @__PURE__ */ h("div", { className: "sa-drawer-preview-html-scroll", children: /* @__PURE__ */ h("div", { className: "sa-drawer-preview-html sa-text-part", dangerouslySetInnerHTML: { __html: t } }) }) : null;
10695
10711
  }
10696
10712
  function Ud({ artifacts: e, initialArtifact: t, onClose: n }) {
10697
- const [r, i] = V(
10713
+ const [r, i] = W(
10698
10714
  t ? { mode: "preview", artifact: t } : { mode: "list" }
10699
- ), [o, a] = V(!1), l = X(null), [s, u] = V(340), p = X(null);
10700
- re(() => {
10715
+ ), [o, a] = W(!1), l = X(null), [s, u] = W(340), p = X(null);
10716
+ te(() => {
10701
10717
  t && (l.current && (clearTimeout(l.current), l.current = null, a(!1)), i({ mode: "preview", artifact: t }));
10702
10718
  }, [t]);
10703
10719
  const c = H(() => {
@@ -10705,7 +10721,7 @@ function Ud({ artifacts: e, initialArtifact: t, onClose: n }) {
10705
10721
  l.current = null, n();
10706
10722
  }, 240);
10707
10723
  }, [n]);
10708
- re(() => () => {
10724
+ te(() => () => {
10709
10725
  var w;
10710
10726
  l.current && clearTimeout(l.current), (w = p.current) == null || w.call(p);
10711
10727
  }, []);
@@ -10714,16 +10730,16 @@ function Ud({ artifacts: e, initialArtifact: t, onClose: n }) {
10714
10730
  }, []), d = H(() => {
10715
10731
  i({ mode: "list" });
10716
10732
  }, []);
10717
- re(() => {
10733
+ te(() => {
10718
10734
  const w = (C) => {
10719
10735
  C.key === "Escape" && c();
10720
10736
  };
10721
10737
  return document.addEventListener("keydown", w), () => document.removeEventListener("keydown", w);
10722
10738
  }, [c]);
10723
- const m = H((w) => {
10739
+ const g = H((w) => {
10724
10740
  w.preventDefault();
10725
- const C = w.clientX, b = s, S = (N) => {
10726
- const M = C - N.clientX;
10741
+ const C = w.clientX, b = s, S = (A) => {
10742
+ const M = C - A.clientX;
10727
10743
  u(Math.max(240, Math.min(window.innerWidth * 0.7, b + M)));
10728
10744
  }, v = () => {
10729
10745
  document.removeEventListener("mousemove", S), document.removeEventListener("mouseup", v), document.body.style.cursor = "", document.body.style.userSelect = "", p.current = null;
@@ -10731,7 +10747,7 @@ function Ud({ artifacts: e, initialArtifact: t, onClose: n }) {
10731
10747
  document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", document.addEventListener("mousemove", S), document.addEventListener("mouseup", v), p.current = v;
10732
10748
  }, [s]);
10733
10749
  return /* @__PURE__ */ T("div", { className: `sa-artifact-drawer ${o ? "sa-drawer-closing" : ""}`, style: { width: s }, children: [
10734
- /* @__PURE__ */ h("div", { className: "sa-drawer-resize-handle", onMouseDown: m }),
10750
+ /* @__PURE__ */ h("div", { className: "sa-drawer-resize-handle", onMouseDown: g }),
10735
10751
  /* @__PURE__ */ T("div", { className: "sa-artifact-drawer-header", children: [
10736
10752
  r.mode === "preview" ? /* @__PURE__ */ T(we, { children: [
10737
10753
  /* @__PURE__ */ h("button", { className: "sa-drawer-btn", onClick: d, title: "返回列表", "aria-label": "返回列表", children: /* @__PURE__ */ h("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ h("path", { d: "M15 18l-6-6 6-6" }) }) }),
@@ -10783,7 +10799,7 @@ function Ud({ artifacts: e, initialArtifact: t, onClose: n }) {
10783
10799
  ] });
10784
10800
  }
10785
10801
  function Vd({ page: e, onBack: t, centered: n }) {
10786
- re(() => {
10802
+ te(() => {
10787
10803
  const i = (o) => {
10788
10804
  o.key === "Escape" && t();
10789
10805
  };
@@ -10854,35 +10870,35 @@ function qd({
10854
10870
  showTimestamp: d
10855
10871
  }) {
10856
10872
  const {
10857
- status: m,
10873
+ status: g,
10858
10874
  sendMessage: w,
10859
10875
  stop: C,
10860
10876
  toggleThreadList: b,
10861
10877
  setThreadListOpen: S,
10862
10878
  isThreadListOpen: v,
10863
- toggleArtifactDrawer: N,
10879
+ toggleArtifactDrawer: A,
10864
10880
  allArtifacts: M,
10865
10881
  activePanel: k,
10866
- closePanel: A,
10867
- messages: _,
10882
+ closePanel: D,
10883
+ messages: F,
10868
10884
  messagesLoading: O,
10869
10885
  conversations: x,
10870
10886
  activeConversationId: I,
10871
- switchConversation: D,
10872
- newConversation: $,
10873
- deleteConversation: P,
10874
- renameConversation: z,
10875
- hasMore: B,
10876
- loadMoreConversations: F
10887
+ switchConversation: P,
10888
+ newConversation: j,
10889
+ deleteConversation: R,
10890
+ renameConversation: N,
10891
+ hasMore: q,
10892
+ loadMoreConversations: E
10877
10893
  } = Le(), {
10878
- width: j,
10879
- position: q,
10880
- hasCustomPosition: g,
10881
- isMaximized: G,
10894
+ width: B,
10895
+ position: V,
10896
+ hasCustomPosition: m,
10897
+ isMaximized: $,
10882
10898
  // 统一由 hook 计算的真实渲染几何(含侧边栏宽度、自适应高度、视口钳制)
10883
- totalWidth: ee,
10899
+ totalWidth: Z,
10884
10900
  windowHeight: y,
10885
- startWindowDrag: ge,
10901
+ startWindowDrag: pe,
10886
10902
  startResize: ze,
10887
10903
  toggleMaximize: oe,
10888
10904
  reset: Pe,
@@ -10892,16 +10908,16 @@ function qd({
10892
10908
  defaultHeight: f ?? se.DEFAULT_HEIGHT,
10893
10909
  // 大窗不消费窗口几何,无需区分 isMaximized(避免与 hook 状态循环依赖)
10894
10910
  sidebarWidth: 0
10895
- }), Te = X(null), Ae = X(null), Fe = !O && _.length === 0, qe = !O && _.length > 0, Ye = !!k;
10896
- re(() => {
10897
- e || (Pe(), A());
10898
- }, [e, Pe, A]), re(() => {
10899
- S(G ? Te.current ?? !0 : Ae.current ?? !1);
10900
- }, [G, S]), re(() => {
10911
+ }), Te = X(null), Ae = X(null), Fe = !O && F.length === 0, qe = !O && F.length > 0, Ye = !!k;
10912
+ te(() => {
10913
+ e || (Pe(), D());
10914
+ }, [e, Pe, D]), te(() => {
10915
+ S($ ? Te.current ?? !0 : Ae.current ?? !1);
10916
+ }, [$, S]), te(() => {
10901
10917
  qe || ye(null);
10902
10918
  }, [qe, ye]);
10903
10919
  const Bt = fa({
10904
- enabled: e && qe && !G && !Ye,
10920
+ enabled: e && qe && !$ && !Ye,
10905
10921
  contentSelector: ".sa-panel-content",
10906
10922
  defaultHeight: f ?? se.DEFAULT_HEIGHT,
10907
10923
  onHeightChange: ye
@@ -10909,32 +10925,32 @@ function qd({
10909
10925
  if (!e) return null;
10910
10926
  const et = r.Header, tt = r.Composer, Oe = r.ThreadList, $t = () => {
10911
10927
  const K = !v;
10912
- b(), G ? Te.current = K : Ae.current = K;
10913
- }, nt = 200, rt = v && !G, ke = "var(--sa-radius, 16px)", yt = rt ? `0px ${ke} ${ke} 0px` : `${ke} ${ke} ${ke} ${ke}`, Ht = g ? q.x : window.innerWidth - ee - 20, Ge = Math.min(nt, Math.max(0, Ht - 1)), jt = g ? { width: `${ee}px`, height: `${y}px`, left: `${q.x}px`, top: `${q.y}px` } : { width: `${ee}px`, height: `${y}px`, right: "20px", bottom: "20px" }, E = {
10928
+ b(), $ ? Te.current = K : Ae.current = K;
10929
+ }, nt = 200, rt = v && !$, ke = "var(--sa-radius, 16px)", yt = rt ? `0px ${ke} ${ke} 0px` : `${ke} ${ke} ${ke} ${ke}`, Ht = m ? V.x : window.innerWidth - Z - 20, Ge = Math.min(nt, Math.max(0, Ht - 1)), jt = m ? { width: `${Z}px`, height: `${y}px`, left: `${V.x}px`, top: `${V.y}px` } : { width: `${Z}px`, height: `${y}px`, right: "20px", bottom: "20px" }, z = {
10914
10930
  title: n,
10915
10931
  onClose: t,
10916
10932
  onToggleThreadList: $t,
10917
- isMaximized: G,
10933
+ isMaximized: $,
10918
10934
  onToggleMaximize: oe,
10919
10935
  // 整屏容器态隐藏「回到首页」与产物入口:返回按钮已接管退出,抽屉也随内容区一并被替换
10920
10936
  showHome: qe && !Ye,
10921
- onHome: $,
10937
+ onHome: j,
10922
10938
  artifactCount: Ye || !l ? 0 : M.length,
10923
- onToggleArtifactDrawer: Ye || !l ? void 0 : N
10924
- }, R = {
10939
+ onToggleArtifactDrawer: Ye || !l ? void 0 : A
10940
+ }, _ = {
10925
10941
  conversations: x,
10926
10942
  activeSessionId: I,
10927
- onSwitch: D,
10928
- onNew: $,
10929
- onDelete: P,
10930
- onRename: z,
10931
- hasMore: B,
10932
- onLoadMore: F
10933
- }, W = /* @__PURE__ */ T(
10943
+ onSwitch: P,
10944
+ onNew: j,
10945
+ onDelete: R,
10946
+ onRename: N,
10947
+ hasMore: q,
10948
+ onLoadMore: E
10949
+ }, Y = /* @__PURE__ */ T(
10934
10950
  "div",
10935
10951
  {
10936
- className: `relative flex min-w-0 flex-col bg-white ${G ? "flex-1" : "h-full shrink-0"}`,
10937
- style: G ? void 0 : { width: `${j}px`, borderRadius: yt, overflow: "hidden" },
10952
+ className: `relative flex min-w-0 flex-col bg-white ${$ ? "flex-1" : "h-full shrink-0"}`,
10953
+ style: $ ? void 0 : { width: `${B}px`, borderRadius: yt, overflow: "hidden" },
10938
10954
  children: [
10939
10955
  Fe && /* @__PURE__ */ T(we, { children: [
10940
10956
  /* @__PURE__ */ h("div", { className: "sa-home-gradient pointer-events-none absolute inset-x-0 top-0 z-0 h-[238px] opacity-10" }),
@@ -10943,16 +10959,16 @@ function qd({
10943
10959
  /* @__PURE__ */ h(
10944
10960
  "div",
10945
10961
  {
10946
- className: `relative z-20 ${Fe || G ? "" : "bg-white"} ${G ? "cursor-default" : "cursor-grab active:cursor-grabbing"}`,
10947
- onMouseDown: G ? void 0 : ge,
10948
- children: et ? /* @__PURE__ */ h(et, { ...E }) : /* @__PURE__ */ h(ma, { ...E })
10962
+ className: `relative z-20 ${Fe || $ ? "" : "bg-white"} ${$ ? "cursor-default" : "cursor-grab active:cursor-grabbing"}`,
10963
+ onMouseDown: $ ? void 0 : pe,
10964
+ children: et ? /* @__PURE__ */ h(et, { ...z }) : /* @__PURE__ */ h(ma, { ...z })
10949
10965
  }
10950
10966
  ),
10951
10967
  /* @__PURE__ */ h(
10952
10968
  ta,
10953
10969
  {
10954
10970
  contentClassName: `sa-panel-content relative z-[2] ${Fe ? "sa-home-view" : ""}`,
10955
- centered: G,
10971
+ centered: $,
10956
10972
  composerClassName: "shrink-0",
10957
10973
  artifactPreview: l,
10958
10974
  thread: /* @__PURE__ */ h(
@@ -10969,20 +10985,20 @@ function qd({
10969
10985
  showTimestamp: d
10970
10986
  }
10971
10987
  ),
10972
- composer: tt ? /* @__PURE__ */ h(tt, { status: m, onSend: w, onStop: C }) : /* @__PURE__ */ h(ea, {})
10988
+ composer: tt ? /* @__PURE__ */ h(tt, { status: g, onSend: w, onStop: C }) : /* @__PURE__ */ h(ea, {})
10973
10989
  }
10974
10990
  )
10975
10991
  ]
10976
10992
  }
10977
10993
  );
10978
- return G ? /* @__PURE__ */ h("div", { className: "fixed inset-0 z-[var(--sa-z-index,9999)] flex animate-sa-fade-in flex-col justify-end bg-black/30", children: /* @__PURE__ */ T(
10994
+ return $ ? /* @__PURE__ */ h("div", { className: "fixed inset-0 z-[var(--sa-z-index,9999)] flex animate-sa-fade-in flex-col justify-end bg-black/30", children: /* @__PURE__ */ T(
10979
10995
  "div",
10980
10996
  {
10981
10997
  className: "flex h-[calc(100%_-_48px)] w-full animate-sa-slide-up-full flex-row overflow-hidden bg-[#F5F5F5] shadow-[0_-12px_48px_rgba(0,0,0,0.25)]",
10982
10998
  style: { borderRadius: "var(--sa-radius, 16px) var(--sa-radius, 16px) 0px 0px" },
10983
10999
  children: [
10984
- v && (Oe ? /* @__PURE__ */ h(Oe, { ...R }) : /* @__PURE__ */ h(Bn, { width: 220 })),
10985
- W
11000
+ v && (Oe ? /* @__PURE__ */ h(Oe, { ..._ }) : /* @__PURE__ */ h(Bn, { width: 220 })),
11001
+ Y
10986
11002
  ]
10987
11003
  }
10988
11004
  ) }) : /* @__PURE__ */ T(
@@ -11004,7 +11020,7 @@ function qd({
11004
11020
  {
11005
11021
  className: "absolute -top-px -bottom-px -left-px z-10 overflow-hidden border border-r-0 border-[#DADADA] bg-[#FAFAFA] shadow-[0_12px_36px_rgba(0,0,0,0.18)]",
11006
11022
  style: { width: Ge, transform: `translateX(-${Ge}px)`, borderRadius: `${ke} 0px 0px ${ke}` },
11007
- children: /* @__PURE__ */ h(Oe, { ...R })
11023
+ children: /* @__PURE__ */ h(Oe, { ..._ })
11008
11024
  }
11009
11025
  ) : /* @__PURE__ */ h(
11010
11026
  "div",
@@ -11014,7 +11030,7 @@ function qd({
11014
11030
  children: /* @__PURE__ */ h(Bn, { width: nt })
11015
11031
  }
11016
11032
  )),
11017
- W
11033
+ Y
11018
11034
  ]
11019
11035
  }
11020
11036
  );
@@ -11034,14 +11050,14 @@ function Gd({
11034
11050
  onLoadMore: u,
11035
11051
  conversationsLoading: p
11036
11052
  }) {
11037
- const [c, f] = V(null), [d, m] = V(null), [w, C] = V(""), [b, S] = V(null), v = X(null);
11038
- re(
11053
+ const [c, f] = W(null), [d, g] = W(null), [w, C] = W(""), [b, S] = W(null), v = X(null);
11054
+ te(
11039
11055
  () => () => {
11040
11056
  v.current && clearTimeout(v.current);
11041
11057
  },
11042
11058
  []
11043
11059
  );
11044
- const N = H(
11060
+ const A = H(
11045
11061
  (x, I) => {
11046
11062
  I.stopPropagation(), c === x ? (i(x), f(null)) : (f(x), v.current && clearTimeout(v.current), v.current = setTimeout(
11047
11063
  () => f(null),
@@ -11050,17 +11066,17 @@ function Gd({
11050
11066
  },
11051
11067
  [c, i]
11052
11068
  ), M = H(
11053
- (x, I, D) => {
11054
- D.stopPropagation(), m(x), C(I ?? "");
11069
+ (x, I, P) => {
11070
+ P.stopPropagation(), g(x), C(I ?? "");
11055
11071
  },
11056
11072
  []
11057
11073
  ), k = H(
11058
11074
  (x) => {
11059
- w.trim() && o(x, w.trim()), m(null);
11075
+ w.trim() && o(x, w.trim()), g(null);
11060
11076
  },
11061
11077
  [w, o]
11062
- ), A = X(null), _ = H(() => {
11063
- const x = A.current;
11078
+ ), D = X(null), F = H(() => {
11079
+ const x = D.current;
11064
11080
  !x || !s || !u || x.scrollHeight - x.scrollTop - x.clientHeight < 50 && u();
11065
11081
  }, [s, u]), O = ht(
11066
11082
  () => Wr(e),
@@ -11086,7 +11102,7 @@ function Gd({
11086
11102
  onClick: () => {
11087
11103
  r(), l();
11088
11104
  },
11089
- children: /* @__PURE__ */ h("img", { src: pe.messageCreate, alt: "", width: 18, height: 18 })
11105
+ children: /* @__PURE__ */ h("img", { src: de.messageCreate, alt: "", width: 18, height: 18 })
11090
11106
  }
11091
11107
  )
11092
11108
  ] }) : /* @__PURE__ */ T("div", { className: "relative flex w-[220px] shrink-0 flex-col border-r border-[#ECECEC] bg-[#FAFAFA] p-3", children: [
@@ -11098,7 +11114,7 @@ function Gd({
11098
11114
  className: "sa-new-chat flex h-8 flex-1 items-center justify-center gap-2 rounded-md text-[14px] font-medium transition-colors",
11099
11115
  onClick: r,
11100
11116
  children: [
11101
- /* @__PURE__ */ h("img", { src: pe.messageCreate, alt: "", width: 18, height: 18 }),
11117
+ /* @__PURE__ */ h("img", { src: de.messageCreate, alt: "", width: 18, height: 18 }),
11102
11118
  /* @__PURE__ */ h("span", { className: "sa-new-chat-text whitespace-nowrap", children: "新建对话" })
11103
11119
  ]
11104
11120
  }
@@ -11121,30 +11137,30 @@ function Gd({
11121
11137
  /* @__PURE__ */ T(
11122
11138
  "div",
11123
11139
  {
11124
- ref: A,
11140
+ ref: D,
11125
11141
  className: "flex-1 overflow-y-auto",
11126
- onScroll: _,
11142
+ onScroll: F,
11127
11143
  children: [
11128
11144
  p && e.length === 0 && /* @__PURE__ */ h("div", { className: "px-0.5 py-2 text-[12px] text-[#999]", children: "加载中..." }),
11129
11145
  !p && e.length === 0 && /* @__PURE__ */ h("div", { className: "px-0.5 py-2 text-[12px] text-[#999]", children: "暂无记录" }),
11130
11146
  O.map((x) => /* @__PURE__ */ T("div", { className: "mb-1", children: [
11131
11147
  /* @__PURE__ */ h("div", { className: "px-1 pb-1 pt-2 text-[11px] text-[#A0A0A0]", children: x.label }),
11132
11148
  x.items.map((I) => {
11133
- const D = I.sessionId === t, $ = c === I.sessionId;
11149
+ const P = I.sessionId === t, j = c === I.sessionId;
11134
11150
  return /* @__PURE__ */ h(
11135
11151
  "div",
11136
11152
  {
11137
- className: `group relative mb-0.5 flex h-8 w-full cursor-pointer items-center gap-1 rounded-md px-0.5 text-[13px] transition-colors ${D ? "bg-[#E8F1FE]" : "hover:bg-[#E8F1FE]"}`,
11153
+ className: `group relative mb-0.5 flex h-8 w-full cursor-pointer items-center gap-1 rounded-md px-0.5 text-[13px] transition-colors ${P ? "bg-[#E8F1FE]" : "hover:bg-[#E8F1FE]"}`,
11138
11154
  onClick: () => {
11139
11155
  d !== I.sessionId && n(I.sessionId);
11140
11156
  },
11141
- onMouseEnter: (P) => {
11157
+ onMouseEnter: (R) => {
11142
11158
  if (d === I.sessionId) return;
11143
- const z = P.currentTarget.getBoundingClientRect();
11159
+ const N = R.currentTarget.getBoundingClientRect();
11144
11160
  S({
11145
11161
  text: I.title || "新会话",
11146
- x: z.right + 8,
11147
- y: z.top + z.height / 2
11162
+ x: N.right + 8,
11163
+ y: N.top + N.height / 2
11148
11164
  });
11149
11165
  },
11150
11166
  onMouseLeave: () => S(null),
@@ -11153,19 +11169,19 @@ function Gd({
11153
11169
  {
11154
11170
  className: "w-full rounded border border-[var(--sa-primary)] bg-white px-1.5 py-0.5 text-[12px] outline-none",
11155
11171
  value: w,
11156
- onChange: (P) => C(P.target.value),
11172
+ onChange: (R) => C(R.target.value),
11157
11173
  onBlur: () => k(I.sessionId),
11158
- onKeyDown: (P) => {
11159
- P.key === "Enter" && k(I.sessionId), P.key === "Escape" && m(null);
11174
+ onKeyDown: (R) => {
11175
+ R.key === "Enter" && k(I.sessionId), R.key === "Escape" && g(null);
11160
11176
  },
11161
- onClick: (P) => P.stopPropagation(),
11177
+ onClick: (R) => R.stopPropagation(),
11162
11178
  autoFocus: !0
11163
11179
  }
11164
11180
  ) : /* @__PURE__ */ T(we, { children: [
11165
11181
  /* @__PURE__ */ h(
11166
11182
  "img",
11167
11183
  {
11168
- src: pe.message,
11184
+ src: de.message,
11169
11185
  alt: "",
11170
11186
  width: 16,
11171
11187
  height: 16,
@@ -11179,7 +11195,7 @@ function Gd({
11179
11195
  {
11180
11196
  type: "button",
11181
11197
  className: "flex h-5 w-5 items-center justify-center rounded text-[#999] hover:bg-white/70 hover:text-[var(--sa-primary)]",
11182
- onClick: (P) => M(I.sessionId, I.title, P),
11198
+ onClick: (R) => M(I.sessionId, I.title, R),
11183
11199
  title: "重命名",
11184
11200
  children: /* @__PURE__ */ h(J, { name: "pen", size: 12 })
11185
11201
  }
@@ -11188,13 +11204,13 @@ function Gd({
11188
11204
  "button",
11189
11205
  {
11190
11206
  type: "button",
11191
- className: `flex h-5 w-5 items-center justify-center rounded ${$ ? "bg-[#fee2e2] text-[#ef4444]" : "text-[#999] hover:bg-white/70 hover:text-[#ef4444]"}`,
11192
- onClick: (P) => N(I.sessionId, P),
11193
- title: $ ? "确认删除" : "删除",
11207
+ className: `flex h-5 w-5 items-center justify-center rounded ${j ? "bg-[#fee2e2] text-[#ef4444]" : "text-[#999] hover:bg-white/70 hover:text-[#ef4444]"}`,
11208
+ onClick: (R) => A(I.sessionId, R),
11209
+ title: j ? "确认删除" : "删除",
11194
11210
  children: /* @__PURE__ */ h(
11195
11211
  J,
11196
11212
  {
11197
- name: $ ? "x" : "trash2",
11213
+ name: j ? "x" : "trash2",
11198
11214
  size: 12
11199
11215
  }
11200
11216
  )
@@ -11242,37 +11258,37 @@ function Xd({
11242
11258
  const {
11243
11259
  status: f,
11244
11260
  sendMessage: d,
11245
- stop: m,
11261
+ stop: g,
11246
11262
  conversations: w,
11247
11263
  activeConversationId: C,
11248
11264
  switchConversation: b,
11249
11265
  newConversation: S,
11250
11266
  deleteConversation: v,
11251
- renameConversation: N,
11267
+ renameConversation: A,
11252
11268
  toggleArtifactDrawer: M,
11253
11269
  allArtifacts: k,
11254
- activePanel: A,
11255
- closePanel: _,
11270
+ activePanel: D,
11271
+ closePanel: F,
11256
11272
  hasMore: O,
11257
11273
  loadMoreConversations: x,
11258
11274
  conversationsLoading: I
11259
- } = Le(), [D, $] = V(l), P = H(() => $((q) => !q), []), z = !!A;
11260
- re(() => () => _(), [_]);
11261
- const B = t.ThreadList, F = t.Composer, j = t.Header;
11275
+ } = Le(), [P, j] = W(l), R = H(() => j((V) => !V), []), N = !!D;
11276
+ te(() => () => F(), [F]);
11277
+ const q = t.ThreadList, E = t.Composer, B = t.Header;
11262
11278
  return /* @__PURE__ */ T("div", { className: "sa-fullpage", children: [
11263
- B ? /* @__PURE__ */ h(
11279
+ q ? /* @__PURE__ */ h(
11264
11280
  "div",
11265
11281
  {
11266
- className: `sa-fp-sidebar-wrapper ${D ? "" : "sa-fp-sidebar-wrapper-collapsed"}`,
11282
+ className: `sa-fp-sidebar-wrapper ${P ? "" : "sa-fp-sidebar-wrapper-collapsed"}`,
11267
11283
  children: /* @__PURE__ */ h(
11268
- B,
11284
+ q,
11269
11285
  {
11270
11286
  conversations: w,
11271
11287
  activeSessionId: C,
11272
11288
  onSwitch: b,
11273
11289
  onNew: S,
11274
11290
  onDelete: v,
11275
- onRename: N,
11291
+ onRename: A,
11276
11292
  hasMore: O,
11277
11293
  onLoadMore: x
11278
11294
  }
@@ -11286,27 +11302,27 @@ function Xd({
11286
11302
  onSwitch: b,
11287
11303
  onNew: S,
11288
11304
  onDelete: v,
11289
- onRename: N,
11290
- isCollapsed: !D,
11291
- onToggleCollapse: P,
11305
+ onRename: A,
11306
+ isCollapsed: !P,
11307
+ onToggleCollapse: R,
11292
11308
  hasMore: O,
11293
11309
  onLoadMore: x,
11294
11310
  conversationsLoading: I
11295
11311
  }
11296
11312
  ),
11297
11313
  /* @__PURE__ */ T("div", { className: "sa-fp-main", children: [
11298
- j ? /* @__PURE__ */ h(
11299
- j,
11314
+ B ? /* @__PURE__ */ h(
11315
+ B,
11300
11316
  {
11301
11317
  title: e,
11302
11318
  onClose: s ?? Yd,
11303
- onToggleThreadList: P,
11304
- artifactCount: z || !p ? 0 : k.length,
11305
- onToggleArtifactDrawer: z || !p ? void 0 : M
11319
+ onToggleThreadList: R,
11320
+ artifactCount: N || !p ? 0 : k.length,
11321
+ onToggleArtifactDrawer: N || !p ? void 0 : M
11306
11322
  }
11307
11323
  ) : /* @__PURE__ */ T("div", { className: "sa-fp-header", children: [
11308
11324
  /* @__PURE__ */ h("div", { className: "sa-fp-header-title", children: e }),
11309
- /* @__PURE__ */ h("div", { className: "sa-fp-header-actions", children: !z && p && k.length > 0 && /* @__PURE__ */ T(
11325
+ /* @__PURE__ */ h("div", { className: "sa-fp-header-actions", children: !N && p && k.length > 0 && /* @__PURE__ */ T(
11310
11326
  "button",
11311
11327
  {
11312
11328
  className: "sa-fp-header-btn sa-header-btn-artifact",
@@ -11352,7 +11368,7 @@ function Xd({
11352
11368
  showTimestamp: c
11353
11369
  }
11354
11370
  ),
11355
- composer: F ? /* @__PURE__ */ h(F, { status: f, onSend: d, onStop: m }) : /* @__PURE__ */ h(ea, {})
11371
+ composer: E ? /* @__PURE__ */ h(E, { status: f, onSend: d, onStop: g }) : /* @__PURE__ */ h(ea, {})
11356
11372
  }
11357
11373
  )
11358
11374
  ] })
@@ -11373,26 +11389,26 @@ function Kd(e) {
11373
11389
  avatar: c,
11374
11390
  artifactPreview: f,
11375
11391
  capabilities: d,
11376
- quickLinks: m,
11392
+ quickLinks: g,
11377
11393
  logo: w,
11378
11394
  triggerLogo: C,
11379
11395
  theme: b,
11380
11396
  showTimestamp: S,
11381
11397
  attachmentUploader: v,
11382
- nosUpload: N
11383
- } = e, [M, k] = V(s);
11384
- re(() => {
11398
+ nosUpload: A
11399
+ } = e, [M, k] = W(s);
11400
+ te(() => {
11385
11401
  k(s);
11386
11402
  }, [s]);
11387
- const A = H(() => {
11388
- var I, D;
11403
+ const D = H(() => {
11404
+ var I, P;
11389
11405
  const x = !M;
11390
- k(x), u == null || u(x), x ? (I = i.onOpen) == null || I.call(i) : (D = i.onClose) == null || D.call(i);
11391
- }, [M, i, u]), _ = H(() => {
11406
+ k(x), u == null || u(x), x ? (I = i.onOpen) == null || I.call(i) : (P = i.onClose) == null || P.call(i);
11407
+ }, [M, i, u]), F = H(() => {
11392
11408
  var x;
11393
11409
  k(!1), u == null || u(!1), (x = i.onClose) == null || x.call(i);
11394
11410
  }, [i, u]), O = r.Trigger ?? ga;
11395
- return n === "fullpage" ? M ? /* @__PURE__ */ h(On, { sdk: t, hooks: i, attachmentUploader: v, nosUpload: N, children: /* @__PURE__ */ h(
11411
+ return n === "fullpage" ? M ? /* @__PURE__ */ h(On, { sdk: t, hooks: i, attachmentUploader: v, nosUpload: A, children: /* @__PURE__ */ h(
11396
11412
  Xd,
11397
11413
  {
11398
11414
  title: l,
@@ -11400,21 +11416,21 @@ function Kd(e) {
11400
11416
  welcomeMessage: o,
11401
11417
  suggestedPrompts: a,
11402
11418
  capabilities: d,
11403
- quickLinks: m,
11419
+ quickLinks: g,
11404
11420
  logo: w,
11405
11421
  sidebarDefaultOpen: p,
11406
- onClose: _,
11422
+ onClose: F,
11407
11423
  avatar: c,
11408
11424
  artifactPreview: f,
11409
11425
  showTimestamp: S
11410
11426
  }
11411
- ) }) : null : /* @__PURE__ */ T(On, { sdk: t, hooks: i, attachmentUploader: v, nosUpload: N, children: [
11412
- /* @__PURE__ */ h(O, { isOpen: M, onClick: A, triggerLogo: C }),
11427
+ ) }) : null : /* @__PURE__ */ T(On, { sdk: t, hooks: i, attachmentUploader: v, nosUpload: A, children: [
11428
+ /* @__PURE__ */ h(O, { isOpen: M, onClick: D, triggerLogo: C }),
11413
11429
  /* @__PURE__ */ h(
11414
11430
  qd,
11415
11431
  {
11416
11432
  isOpen: M,
11417
- onClose: _,
11433
+ onClose: F,
11418
11434
  title: l,
11419
11435
  slots: r,
11420
11436
  welcomeMessage: o,
@@ -11422,7 +11438,7 @@ function Kd(e) {
11422
11438
  avatar: c,
11423
11439
  artifactPreview: f,
11424
11440
  capabilities: d,
11425
- quickLinks: m,
11441
+ quickLinks: g,
11426
11442
  logo: w,
11427
11443
  defaultWidth: b == null ? void 0 : b.panelWidth,
11428
11444
  defaultHeight: b == null ? void 0 : b.panelHeight,
@@ -12751,7 +12767,7 @@ ${Jd}`, document.head.appendChild(s);
12751
12767
  };
12752
12768
  }
12753
12769
  export {
12754
- pe as ASSETS,
12770
+ de as ASSETS,
12755
12771
  Md as ActionBar,
12756
12772
  On as ChatProvider,
12757
12773
  Kd as ChatWidget,