@pagelines/sdk 1.0.602 → 1.0.604

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.
@@ -1,24 +1,24 @@
1
1
  var Un = Object.defineProperty;
2
- var Ps = (i, t, e) => t in i ? Un(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
3
- var d = (i, t) => Un(i, "name", { value: t, configurable: !0 });
4
- var C = (i, t, e) => Ps(i, typeof t != "symbol" ? t + "" : t, e);
5
- import { defineComponent as ye, openBlock as v, createElementBlock as S, createElementVNode as w, normalizeClass as E, ref as ie, watch as It, computed as j, createCommentVNode as G, renderSlot as cn, onMounted as Mt, unref as rn, Fragment as Me, toDisplayString as ne, shallowRef as ps, onBeforeUnmount as fs, nextTick as Bs, createVNode as We, withCtx as Fs, renderList as Qt, createBlock as Hn, withModifiers as lt, createTextVNode as At, withDirectives as Us, vModelText as Hs } from "vue";
6
- import { SettingsObject as js, Agent as Dt, getDefaultAvatarUrl as gs, createLogger as Gs } from "@pagelines/core";
2
+ var Ps = (r, t, e) => t in r ? Un(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
3
+ var d = (r, t) => Un(r, "name", { value: t, configurable: !0 });
4
+ var C = (r, t, e) => Ps(r, typeof t != "symbol" ? t + "" : t, e);
5
+ import { defineComponent as Re, openBlock as v, createElementBlock as w, createElementVNode as y, normalizeClass as A, ref as ae, watch as Mt, computed as U, createCommentVNode as j, renderSlot as dn, onMounted as Bt, unref as on, Fragment as $e, toDisplayString as se, shallowRef as ps, onBeforeUnmount as fs, nextTick as Bs, createVNode as Ye, withCtx as Fs, renderList as tn, createBlock as Hn, withModifiers as ht, createTextVNode as Ct, withDirectives as Us, vModelText as Hs } from "vue";
6
+ import { SettingsObject as Gs, Agent as Nt, getDefaultAvatarUrl as gs, createLogger as js } from "@pagelines/core";
7
7
  import { P as Ws } from "./sdkClient.js";
8
8
  const qs = { class: "spinner max-w-sm" }, Ys = {
9
9
  class: "ring-circular h-full w-full origin-center",
10
10
  viewBox: "25 25 50 50"
11
- }, jn = /* @__PURE__ */ ye({
11
+ }, Gn = /* @__PURE__ */ Re({
12
12
  __name: "FSpinner",
13
13
  props: {
14
14
  width: { type: String, default: "" },
15
15
  colorMode: { type: String, default: "primary" }
16
16
  },
17
- setup(i) {
18
- return (t, e) => (v(), S("div", qs, [
19
- (v(), S("svg", Ys, [
20
- w("circle", {
21
- class: E([i.colorMode, "ring-path"]),
17
+ setup(r) {
18
+ return (t, e) => (v(), w("div", qs, [
19
+ (v(), w("svg", Ys, [
20
+ y("circle", {
21
+ class: A([r.colorMode, "ring-path"]),
22
22
  cx: "50",
23
23
  cy: "50",
24
24
  r: "20",
@@ -34,35 +34,36 @@ const qs = { class: "spinner max-w-sm" }, Ys = {
34
34
  { pattern: /\bNO_REP\w*\b/g, label: "NO_REPLY — bot chose not to respond" },
35
35
  { pattern: /\bHEARTBEAT_OK\b/g, label: "HEARTBEAT_OK — scheduled check, nothing to do" }
36
36
  ], Zs = 9e4, ms = /* @__PURE__ */ new Set(["CREDIT_LIMIT", "OVERAGE_CAP"]), Xs = /* @__PURE__ */ new Set([...ms, "EMPTY_STREAM", "RATE_LIMIT"]), bs = /* @__PURE__ */ new Set(["agent_deleted", "AGENT_DELETED"]);
37
- function Ks(i) {
38
- if (!(i.bucket !== void 0 || Xs.has(i.code)))
37
+ function Ks(r) {
38
+ if (!(r.bucket !== void 0 || Xs.has(r.code)))
39
39
  return { surface: "hard" };
40
- const e = i.bucket ?? (ms.has(i.code) ? "account" : "error"), n = {
41
- ...i.actionLabel ? { actionLabel: i.actionLabel } : {},
42
- ...i.actionUrl ? { actionUrl: i.actionUrl } : {},
43
- ...i.help ? { help: i.help } : {}
40
+ const e = r.bucket ?? (ms.has(r.code) ? "account" : "error"), n = {
41
+ ...r.actionLabel ? { actionLabel: r.actionLabel } : {},
42
+ ...r.actionUrl ? { actionUrl: r.actionUrl } : {},
43
+ ...r.help ? { help: r.help } : {}
44
44
  };
45
- return e === "account" ? { surface: "transcript", issue: { code: i.code, bucket: e, ...n }, sendBlockedReason: "account" } : bs.has(i.code) ? { surface: "transcript", issue: { code: i.code, bucket: e, ...n }, sendBlockedReason: "agent_deleted" } : { surface: "transient", issue: { code: i.code, message: i.error, ...n } };
45
+ return e === "account" ? { surface: "transcript", issue: { code: r.code, bucket: e, ...n }, sendBlockedReason: "account" } : bs.has(r.code) ? { surface: "transcript", issue: { code: r.code, bucket: e, ...n }, sendBlockedReason: "agent_deleted" } : { surface: "transient", issue: { code: r.code, message: r.error, ...n } };
46
46
  }
47
47
  d(Ks, "presentChatStreamError");
48
- const kn = class kn extends js {
48
+ const wn = class wn extends Gs {
49
49
  constructor(e) {
50
50
  super("AgentChatController", e);
51
51
  C(this, "isTextMode", !1);
52
52
  C(this, "lastMessage", { hash: "", time: 0 });
53
53
  C(this, "isConnecting", !1);
54
+ C(this, "activeTurnGeneration", 0);
54
55
  // Chat conversation tracking (server-managed persistence)
55
56
  C(this, "conversationId");
56
- C(this, "textState", ie({
57
+ C(this, "textState", ae({
57
58
  isActive: !1,
58
59
  isConnected: !1,
59
60
  isThinking: !1,
60
61
  connectionStatus: "disconnected"
61
62
  }));
62
- C(this, "agentMode", ie("self"));
63
- C(this, "sharedMessages", ie([]));
63
+ C(this, "agentMode", ae("self"));
64
+ C(this, "sharedMessages", ae([]));
64
65
  C(this, "_agent");
65
- this._agent = e.agent instanceof Dt ? e.agent : new Dt({ config: e.agent }), this.setupModeWatcher(), this.setupAvailabilityWatcher();
66
+ this._agent = e.agent instanceof Nt ? e.agent : new Nt({ config: e.agent }), this.setupModeWatcher(), this.setupAvailabilityWatcher();
66
67
  }
67
68
  get chatEnabled() {
68
69
  const e = this._agent.state.value.lifecycle;
@@ -88,13 +89,13 @@ const kn = class kn extends js {
88
89
  return e.includes("timed out") || e.includes("starting up") || e.includes("503") || e.includes("429") || e.includes("[no-reply]") || e.includes("[stream-open]") || e.includes("[stream-read]") || e.includes("[api]");
89
90
  }
90
91
  isDuplicateMessage(e, n) {
91
- const r = `${n}:${e.toLowerCase().trim()}`, s = Date.now(), l = r === this.lastMessage.hash && s - this.lastMessage.time < 500;
92
- return l || (this.lastMessage = { hash: r, time: s }), l;
92
+ const i = `${n}:${e.toLowerCase().trim()}`, s = Date.now(), l = i === this.lastMessage.hash && s - this.lastMessage.time < 500;
93
+ return l || (this.lastMessage = { hash: i, time: s }), l;
93
94
  }
94
- addMessage(e, n, r, s) {
95
+ addMessage(e, n, i, s) {
95
96
  this.isDuplicateMessage(e, n) || (this.sharedMessages.value = [
96
97
  ...this.sharedMessages.value,
97
- { id: Date.now().toString(), text: e, sender: n, timestamp: (/* @__PURE__ */ new Date()).toISOString(), attachments: r, ...s ? { issue: s } : {} }
98
+ { id: Date.now().toString(), text: e, sender: n, timestamp: (/* @__PURE__ */ new Date()).toISOString(), attachments: i, ...s ? { issue: s } : {} }
98
99
  ]);
99
100
  }
100
101
  /**
@@ -112,13 +113,13 @@ const kn = class kn extends js {
112
113
  getDynamicSettings() {
113
114
  const { sdk: e } = this.settings;
114
115
  if (!e) return { context: this.settings.context || "", firstMessage: this.settings.firstMessage || "" };
115
- const n = e.activeUser.value, r = n?.agents?.find((l) => l.agentId === n.primaryAgentId), s = n ? `
116
+ const n = e.activeUser.value, i = n?.agents?.find((l) => l.agentId === n.primaryAgentId), s = n ? `
116
117
 
117
118
  Current User:
118
- - Name: ${r?.name || "Anonymous"}
119
+ - Name: ${i?.name || "Anonymous"}
119
120
  - Email: ${n.email}
120
- - Title: ${r?.title || ""}
121
- - About: ${r?.summary || ""}
121
+ - Title: ${i?.title || ""}
122
+ - About: ${i?.summary || ""}
122
123
  ` : "";
123
124
  return {
124
125
  context: `${this.settings.context || ""}${s}`.trim(),
@@ -136,16 +137,27 @@ Current User:
136
137
  connectionStatus: "disconnected",
137
138
  error: void 0,
138
139
  sendBlockedReason: void 0,
139
- workingDescription: void 0
140
+ workingDescription: void 0,
141
+ toolActivities: void 0
142
+ });
143
+ }
144
+ updateToolActivity(e) {
145
+ const n = this.textState.value.toolActivities ?? [], i = n.findIndex((l) => l.activityId === e.activityId), s = i >= 0 ? [...n.slice(0, i), e, ...n.slice(i + 1)] : [...n, e];
146
+ this.updateState(this.textState, { toolActivities: s });
147
+ }
148
+ finishToolActivities(e) {
149
+ const n = this.textState.value.toolActivities;
150
+ n?.length && this.updateState(this.textState, {
151
+ toolActivities: n.map((i) => i.status === "started" ? { ...i, status: e } : i)
140
152
  });
141
153
  }
142
154
  setupModeWatcher() {
143
- It(this.agentMode, async (e, n) => {
155
+ Mt(this.agentMode, async (e, n) => {
144
156
  this.logger.info(`Mode changed from ${n} to ${e}`), this.isTextMode && (n === "talk" || n === "chat") && await this.endConversation();
145
157
  });
146
158
  }
147
159
  setupAvailabilityWatcher() {
148
- It(() => this.chatEnabled, (e) => {
160
+ Mt(() => this.chatEnabled, (e) => {
149
161
  if (!(!this.isTextMode || this.isConnecting)) {
150
162
  if (e) {
151
163
  this.textState.value.isConnected || this.updateState(this.textState, {
@@ -172,9 +184,9 @@ Current User:
172
184
  * agent/client.ts survive into the console line).
173
185
  */
174
186
  handleError(e, n) {
175
- const r = e.message;
176
- this.logger.error("Conversation error:", { message: r, raw: n, error: e }), this.addMessage(r, "system"), this.resetState(), this.updateState(this.textState, {
177
- error: r,
187
+ const i = e.message;
188
+ this.logger.error("Conversation error:", { message: i, raw: n, error: e }), this.addMessage(i, "system"), this.resetState(), this.updateState(this.textState, {
189
+ error: i,
178
190
  connectionStatus: "error"
179
191
  });
180
192
  }
@@ -203,7 +215,7 @@ Current User:
203
215
  }
204
216
  }
205
217
  async endConversation() {
206
- if (!this.isTextMode) {
218
+ if (this.activeTurnGeneration += 1, !this.isTextMode) {
207
219
  this.resetState();
208
220
  return;
209
221
  }
@@ -216,105 +228,137 @@ Current User:
216
228
  async sendChatMessage(e, n) {
217
229
  if (!this.isTextMode)
218
230
  return;
219
- const { chatStreamFn: r } = this.settings;
231
+ const { chatStreamFn: i } = this.settings;
220
232
  if (!this.chatEnabled) {
221
233
  this.addMessage("Agent is currently offline.", "system");
222
234
  return;
223
235
  }
224
- if (this.textState.value.sendBlockedReason)
236
+ if (this.textState.value.sendBlockedReason || this.textState.value.isThinking)
225
237
  return;
226
238
  const { sdk: s } = this.settings;
227
- if (!r && !this._agent.handle.value) {
239
+ if (!i && !this._agent.handle.value) {
228
240
  this.handleError(new Error("Agent handle required for chat"));
229
241
  return;
230
242
  }
231
- this.addMessage(e, "user", n), this.updateState(this.textState, { isThinking: !0, workingDescription: void 0, transientIssue: void 0 });
232
- const l = `stream-${Date.now()}`;
233
- let o = !1, h = !1;
234
- const c = /* @__PURE__ */ d((y, I = "assistant") => {
235
- this.updateState(this.textState, { workingDescription: void 0 }), o || (o = !0, this.sharedMessages.value = [
243
+ this.addMessage(e, "user", n), this.updateState(this.textState, { isThinking: !0, workingDescription: void 0, toolActivities: [], transientIssue: void 0 });
244
+ const l = ++this.activeTurnGeneration, o = `stream-${Date.now()}`;
245
+ let h = !1, c = !1;
246
+ const m = /* @__PURE__ */ d(() => l === this.activeTurnGeneration, "isCurrentTurn"), b = /* @__PURE__ */ d((E, L = "assistant") => {
247
+ if (!m())
248
+ return;
249
+ this.updateState(this.textState, { workingDescription: void 0 }), h || (h = !0, this.sharedMessages.value = [
236
250
  ...this.sharedMessages.value,
237
- { id: l, text: "", sender: I === "system" ? "system" : "agent", timestamp: (/* @__PURE__ */ new Date()).toISOString() }
251
+ { id: o, text: "", sender: L === "system" ? "system" : "agent", timestamp: (/* @__PURE__ */ new Date()).toISOString() }
238
252
  ]);
239
- const M = this.sharedMessages.value, $ = M[M.length - 1];
240
- $?.id === l && ($.text += y, this.sharedMessages.value = [...M]);
241
- }, "onDelta"), k = /* @__PURE__ */ d((y) => {
242
- h = !0, o = !0, this.updateState(this.textState, { workingDescription: void 0 });
243
- const I = this.sharedMessages.value, M = I.findIndex(($) => $.id === y.id);
244
- if (M >= 0)
253
+ const I = this.sharedMessages.value, B = I[I.length - 1];
254
+ B?.id === o && (B.text += E, this.sharedMessages.value = [...I]);
255
+ }, "onDelta"), k = /* @__PURE__ */ d((E) => {
256
+ if (!m())
257
+ return;
258
+ c = !0, h = !0, this.updateState(this.textState, { workingDescription: void 0 }), this.finishToolActivities("completed");
259
+ const L = this.sharedMessages.value, I = L.findIndex((B) => B.id === E.id);
260
+ if (I >= 0)
245
261
  this.sharedMessages.value = [
246
- ...I.slice(0, M),
247
- y,
248
- ...I.slice(M + 1)
262
+ ...L.slice(0, I),
263
+ E,
264
+ ...L.slice(I + 1)
249
265
  ];
250
266
  else {
251
- const $ = I[I.length - 1];
252
- this.sharedMessages.value = $?.id === l ? [...I.slice(0, -1), y] : [...I, y];
267
+ const B = L[L.length - 1];
268
+ this.sharedMessages.value = B?.id === o ? [...L.slice(0, -1), E] : [...L, E];
253
269
  }
254
- y.sender === "system" && y.issue?.bucket === "account" ? this.updateState(this.textState, { sendBlockedReason: "account" }) : y.sender === "system" && y.issue?.code && bs.has(y.issue.code) && this.updateState(this.textState, { sendBlockedReason: "agent_deleted" });
255
- }, "onMessage"), m = /* @__PURE__ */ d((y) => {
256
- if (!o && !h) {
257
- b("empty_stream — assistant returned no content");
270
+ E.sender === "system" && E.issue?.bucket === "account" ? this.updateState(this.textState, { sendBlockedReason: "account" }) : E.sender === "system" && E.issue?.code && bs.has(E.issue.code) && this.updateState(this.textState, { sendBlockedReason: "agent_deleted" });
271
+ }, "onMessage"), T = /* @__PURE__ */ d((E) => {
272
+ if (!m())
273
+ return;
274
+ if (!h && !c) {
275
+ F("empty_stream — assistant returned no content");
258
276
  return;
259
277
  }
260
- const I = this.sharedMessages.value, M = I[I.length - 1];
261
- if (M?.id === l && M.sender === "agent" && M.text) {
262
- let $ = M.text;
263
- for (const W of Vs)
264
- W.pattern.test($) && (console.debug(`[chat] filtered directive: ${W.label}`), $ = $.replace(W.pattern, "").trim(), W.pattern.lastIndex = 0);
265
- $ ? $ !== M.text && (M.text = $, this.sharedMessages.value = [...I]) : this.sharedMessages.value = I.slice(0, -1);
266
- }
267
- y && (this.conversationId = y), this.updateState(this.textState, { isThinking: !1, workingDescription: void 0, transientIssue: void 0 });
268
- }, "onDone"), b = /* @__PURE__ */ d((y) => {
269
- this.updateState(this.textState, { workingDescription: void 0 });
270
- const I = this.sharedMessages.value, M = I[I.length - 1];
271
- if (M?.id === l && !M.text && (this.sharedMessages.value = I.slice(0, -1)), typeof y == "object" && y.code && y.error) {
272
- const U = Ks(y);
273
- U.surface === "transient" ? this.updateState(this.textState, { isThinking: !1, transientIssue: U.issue }) : U.surface === "transcript" ? (this.addMessage(y.error, "system", void 0, U.issue), this.updateState(this.textState, {
278
+ this.finishToolActivities("completed");
279
+ const L = this.sharedMessages.value, I = L[L.length - 1];
280
+ if (I?.id === o && I.sender === "agent" && I.text) {
281
+ let B = I.text;
282
+ for (const z of Vs)
283
+ z.pattern.test(B) && (console.debug(`[chat] filtered directive: ${z.label}`), B = B.replace(z.pattern, "").trim(), z.pattern.lastIndex = 0);
284
+ B ? B !== I.text && (I.text = B, this.sharedMessages.value = [...L]) : this.sharedMessages.value = L.slice(0, -1);
285
+ }
286
+ E && (this.conversationId = E), this.updateState(this.textState, { isThinking: !1, workingDescription: void 0, transientIssue: void 0 });
287
+ }, "onDone"), F = /* @__PURE__ */ d((E) => {
288
+ if (!m())
289
+ return;
290
+ this.updateState(this.textState, { workingDescription: void 0 }), this.finishToolActivities("failed");
291
+ const L = this.sharedMessages.value, I = L[L.length - 1];
292
+ if (I?.id === o && !I.text && (this.sharedMessages.value = L.slice(0, -1)), typeof E == "object" && E.code && E.error) {
293
+ const Z = Ks(E);
294
+ Z.surface === "transient" ? this.updateState(this.textState, { isThinking: !1, transientIssue: Z.issue }) : Z.surface === "transcript" ? (this.addMessage(E.error, "system", void 0, Z.issue), this.updateState(this.textState, {
274
295
  isThinking: !1,
275
- ...U.sendBlockedReason ? { sendBlockedReason: U.sendBlockedReason } : {}
276
- })) : this.handleError(new Error(y.error));
296
+ ...Z.sendBlockedReason ? { sendBlockedReason: Z.sendBlockedReason } : {}
297
+ })) : this.handleError(new Error(E.error));
277
298
  return;
278
299
  }
279
- const $ = typeof y == "string" ? y : y.error, W = this.mapChatError($);
280
- this.isTransientError($) ? (this.logger.warn("Chat turn failed (transient):", { raw: $, friendly: W }), this.addMessage(W, "system"), this.updateState(this.textState, { isThinking: !1 })) : this.handleError(new Error(W), $);
281
- }, "onError"), T = /* @__PURE__ */ d((y) => {
282
- const I = y.trim();
283
- this.updateState(this.textState, { workingDescription: I || void 0 });
284
- }, "onStatus"), F = /* @__PURE__ */ d(() => {
285
- this.updateState(this.textState, { workingDescription: void 0 });
300
+ const B = typeof E == "string" ? E : E.error, z = this.mapChatError(B);
301
+ this.isTransientError(B) ? (this.logger.warn("Chat turn failed (transient):", { raw: B, friendly: z }), this.addMessage(z, "system"), this.updateState(this.textState, { isThinking: !1 })) : this.handleError(new Error(z), B);
302
+ }, "onError"), M = /* @__PURE__ */ d((E) => {
303
+ if (!m())
304
+ return;
305
+ const L = E.trim();
306
+ this.updateState(this.textState, { workingDescription: L || void 0 });
307
+ }, "onStatus"), V = /* @__PURE__ */ d((E) => {
308
+ m() && this.updateToolActivity(E);
309
+ }, "onToolActivity"), oe = /* @__PURE__ */ d(() => {
310
+ m() && this.updateState(this.textState, { workingDescription: void 0 });
286
311
  }, "onWorkingEnd");
287
312
  try {
288
- const y = r ? r({
313
+ const E = i ? i({
289
314
  message: e,
290
315
  attachments: n,
291
316
  conversationId: this.conversationId,
292
317
  history: this.buildHistory(),
293
- onDelta: c,
318
+ onDelta: b,
294
319
  onMessage: k,
295
- onDone: m,
296
- onError: b,
297
- onStatus: T,
298
- onWorkingEnd: F
320
+ onDone: T,
321
+ onError: F,
322
+ onStatus: M,
323
+ onToolActivity: V,
324
+ onWorkingEnd: oe
299
325
  }) : s.chat.chatStreamPublic({
300
326
  handle: this._agent.handle.value,
301
327
  message: e,
302
328
  attachments: n,
303
329
  anonymousId: s.user.generateAnonId(),
304
330
  context: this.getDynamicSettings().context || void 0,
305
- onDelta: c,
331
+ onDelta: b,
306
332
  onMessage: k,
307
- onDone: m,
308
- onError: b,
309
- onStatus: T,
310
- onWorkingEnd: F
333
+ onDone: T,
334
+ onError: F,
335
+ onStatus: M,
336
+ onToolActivity: V,
337
+ onWorkingEnd: oe
311
338
  });
312
339
  await Promise.race([
313
- y,
314
- new Promise((I, M) => setTimeout(() => M(new Error("timed out")), Zs))
340
+ E,
341
+ new Promise((L, I) => setTimeout(() => I(new Error("timed out")), Zs))
315
342
  ]);
316
- } catch (y) {
317
- b(y.message || "Something went wrong");
343
+ } catch (E) {
344
+ F(E.message || "Something went wrong");
345
+ }
346
+ }
347
+ async stopChatTurn() {
348
+ if (this.textState.value.isThinking) {
349
+ this.activeTurnGeneration += 1, this.finishToolActivities("failed"), this.updateState(this.textState, {
350
+ isThinking: !1,
351
+ workingDescription: void 0,
352
+ transientIssue: void 0
353
+ });
354
+ try {
355
+ await this.settings.cancelChatTurnFn?.({ conversationId: this.conversationId });
356
+ } catch (e) {
357
+ this.logger.warn("stopChatTurn: cancel failed", {
358
+ conversationId: this.conversationId,
359
+ error: e instanceof Error ? e.message : String(e)
360
+ });
361
+ }
318
362
  }
319
363
  }
320
364
  buildHistory() {
@@ -334,30 +378,30 @@ Current User:
334
378
  await this.endConversation();
335
379
  }
336
380
  };
337
- d(kn, "AgentChatController");
338
- let Gn = kn;
339
- function Wn(i) {
340
- return i ? typeof i == "string" ? i : i.src || "" : "";
381
+ d(wn, "AgentChatController");
382
+ let jn = wn;
383
+ function Wn(r) {
384
+ return r ? typeof r == "string" ? r : r.src || "" : "";
341
385
  }
342
386
  d(Wn, "getImageSrc");
343
- function pa(i) {
344
- return Wn(i.cover) || Wn(i.avatar) || gs(i.name);
387
+ function ba(r) {
388
+ return Wn(r.cover) || Wn(r.avatar) || gs(r.name);
345
389
  }
346
- d(pa, "getAgentAvatarUrl");
347
- function qn(i) {
348
- const t = i.target;
390
+ d(ba, "getAgentAvatarUrl");
391
+ function qn(r) {
392
+ const t = r.target;
349
393
  t.dataset.fallbackUsed || (t.dataset.fallbackUsed = "true", t.src = gs());
350
394
  }
351
395
  d(qn, "handleImageError");
352
- function fa(i) {
353
- const { template: t, agent: e } = i;
396
+ function xa(r) {
397
+ const { template: t, agent: e } = r;
354
398
  return t.replace(/{name}/g, e.name || "Assistant").replace(/{title}/g, e.title || "").replace(/{handle}/g, e.handle || "").replace(/{orgName}/g, e.org?.name || "");
355
399
  }
356
- d(fa, "parseButtonTemplate");
400
+ d(xa, "parseButtonTemplate");
357
401
  const Qs = {
358
402
  key: 0,
359
403
  class: "absolute inset-0 flex items-center justify-center"
360
- }, ga = /* @__PURE__ */ ye({
404
+ }, ka = /* @__PURE__ */ Re({
361
405
  __name: "ElAgentButton",
362
406
  props: {
363
407
  theme: { default: "primary" },
@@ -366,51 +410,51 @@ const Qs = {
366
410
  icon: {},
367
411
  iconAfter: {}
368
412
  },
369
- setup(i) {
370
- const t = j(() => ({
413
+ setup(r) {
414
+ const t = U(() => ({
371
415
  primary: "bg-primary-600 border-primary-400 hover:border-primary-300 hover:bg-primary-500",
372
416
  green: "bg-green-600 border-green-400 hover:border-green-300 hover:bg-green-500",
373
417
  red: "bg-red-600 border-red-400 hover:border-red-300 hover:bg-red-500",
374
418
  default: "bg-white/10 border-white/20 hover:border-white/40 hover:bg-white/20"
375
- })[i.theme]), e = j(() => ({
419
+ })[r.theme]), e = U(() => ({
376
420
  sm: "px-4 py-2 text-sm",
377
421
  md: "px-6 py-3 text-base",
378
422
  lg: "px-8 py-4 text-base"
379
- })[i.size]), n = j(() => ({
423
+ })[r.size]), n = U(() => ({
380
424
  sm: "size-4",
381
425
  md: "size-4",
382
426
  lg: "size-5"
383
- })[i.size]);
384
- return (r, s) => (v(), S("button", {
385
- class: E(["relative inline-flex items-center justify-center gap-2 font-medium rounded-full backdrop-blur-sm border-2 text-white transition-all duration-200 focus:outline-none active:opacity-80 disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer", [t.value, e.value]])
427
+ })[r.size]);
428
+ return (i, s) => (v(), w("button", {
429
+ class: A(["relative inline-flex items-center justify-center gap-2 font-medium rounded-full backdrop-blur-sm border-2 text-white transition-all duration-200 focus:outline-none active:opacity-80 disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer", [t.value, e.value]])
386
430
  }, [
387
- i.loading ? (v(), S("div", Qs, [...s[0] || (s[0] = [
388
- w("i", { class: "i-svg-spinners-90-ring-with-bg size-5" }, null, -1)
389
- ])])) : G("", !0),
390
- w("span", {
391
- class: E(["flex items-center gap-2 transition-opacity duration-200", i.loading ? "opacity-0" : "opacity-100"])
431
+ r.loading ? (v(), w("div", Qs, [...s[0] || (s[0] = [
432
+ y("i", { class: "i-svg-spinners-90-ring-with-bg size-5" }, null, -1)
433
+ ])])) : j("", !0),
434
+ y("span", {
435
+ class: A(["flex items-center gap-2 transition-opacity duration-200", r.loading ? "opacity-0" : "opacity-100"])
392
436
  }, [
393
- i.icon ? (v(), S("i", {
437
+ r.icon ? (v(), w("i", {
394
438
  key: 0,
395
- class: E([i.icon, n.value])
396
- }, null, 2)) : G("", !0),
397
- cn(r.$slots, "default"),
398
- i.iconAfter ? (v(), S("i", {
439
+ class: A([r.icon, n.value])
440
+ }, null, 2)) : j("", !0),
441
+ dn(i.$slots, "default"),
442
+ r.iconAfter ? (v(), w("i", {
399
443
  key: 1,
400
- class: E([i.iconAfter, n.value])
401
- }, null, 2)) : G("", !0)
444
+ class: A([r.iconAfter, n.value])
445
+ }, null, 2)) : j("", !0)
402
446
  ], 2)
403
447
  ], 2));
404
448
  }
405
- }), Js = ["value"], ma = /* @__PURE__ */ ye({
449
+ }), Js = ["value"], va = /* @__PURE__ */ Re({
406
450
  __name: "AgentInputEmail",
407
451
  props: {
408
452
  modelValue: { default: "" }
409
453
  },
410
454
  emits: ["update:modelValue"],
411
- setup(i, { emit: t }) {
455
+ setup(r, { emit: t }) {
412
456
  const e = t;
413
- return (n, r) => (v(), S("input", {
457
+ return (n, i) => (v(), w("input", {
414
458
  name: "username",
415
459
  type: "email",
416
460
  inputmode: "email",
@@ -419,13 +463,13 @@ const Qs = {
419
463
  autocorrect: "off",
420
464
  spellcheck: "false",
421
465
  placeholder: "Enter your email",
422
- value: i.modelValue,
466
+ value: r.modelValue,
423
467
  class: "w-full px-6 py-3 text-theme-900 placeholder-theme-500 bg-white border border-white rounded-full focus:outline-none transition-colors",
424
468
  style: { "font-size": "16px" },
425
- onInput: r[0] || (r[0] = (s) => e("update:modelValue", s.target.value))
469
+ onInput: i[0] || (i[0] = (s) => e("update:modelValue", s.target.value))
426
470
  }, null, 40, Js));
427
471
  }
428
- }), ei = ["placeholder", "value"], ba = /* @__PURE__ */ ye({
472
+ }), ei = ["placeholder", "value"], ya = /* @__PURE__ */ Re({
429
473
  __name: "AgentInputOneTimeCode",
430
474
  props: {
431
475
  modelValue: {},
@@ -433,18 +477,18 @@ const Qs = {
433
477
  focusFirst: { type: Boolean }
434
478
  },
435
479
  emits: ["update:modelValue", "autoSubmit"],
436
- setup(i, { emit: t }) {
437
- const e = i, n = t, r = ie(null), s = j(() => "0".repeat(e.length));
438
- Mt(() => {
439
- e.focusFirst && !("ontouchstart" in window) && r.value?.focus();
480
+ setup(r, { emit: t }) {
481
+ const e = r, n = t, i = ae(null), s = U(() => "0".repeat(e.length));
482
+ Bt(() => {
483
+ e.focusFirst && !("ontouchstart" in window) && i.value?.focus();
440
484
  });
441
485
  function l(o) {
442
486
  const h = o.target.value.replace(/\D/g, "").slice(0, e.length);
443
487
  n("update:modelValue", h), h.length === e.length && n("autoSubmit", h);
444
488
  }
445
- return d(l, "onInput"), (o, h) => (v(), S("input", {
489
+ return d(l, "onInput"), (o, h) => (v(), w("input", {
446
490
  ref_key: "input",
447
- ref: r,
491
+ ref: i,
448
492
  name: "one-time-code",
449
493
  type: "text",
450
494
  inputmode: "numeric",
@@ -454,7 +498,7 @@ const Qs = {
454
498
  spellcheck: "false",
455
499
  enterkeyhint: "done",
456
500
  placeholder: s.value,
457
- value: i.modelValue,
501
+ value: r.modelValue,
458
502
  class: "w-full px-6 py-3 text-center font-mono tracking-[0.35em] text-theme-900 placeholder-theme-500 bg-white border border-white rounded-full focus:outline-none transition-colors",
459
503
  style: { "font-size": "16px" },
460
504
  onInput: l
@@ -463,7 +507,7 @@ const Qs = {
463
507
  }), ti = { class: "relative flex-shrink-0" }, ni = ["src", "alt"], si = { class: "absolute top-1 right-1" }, ii = {
464
508
  key: 1,
465
509
  class: "size-3 bg-theme-400 rounded-full ring-2 ring-white"
466
- }, ri = { class: "min-w-0" }, ai = /* @__PURE__ */ ye({
510
+ }, ri = { class: "min-w-0" }, ai = /* @__PURE__ */ Re({
467
511
  __name: "ElModeHeader",
468
512
  props: {
469
513
  agent: {},
@@ -471,74 +515,74 @@ const Qs = {
471
515
  isOnline: { type: Boolean, default: !1 },
472
516
  layout: { default: "centered" }
473
517
  },
474
- setup(i) {
475
- return (t, e) => (v(), S("div", {
476
- class: E(["flex gap-4", [
477
- i.layout === "centered" ? "flex-col items-center text-center" : "flex-row items-center justify-center"
518
+ setup(r) {
519
+ return (t, e) => (v(), w("div", {
520
+ class: A(["flex gap-4", [
521
+ r.layout === "centered" ? "flex-col items-center text-center" : "flex-row items-center justify-center"
478
522
  ]])
479
523
  }, [
480
- w("div", ti, [
481
- w("div", {
482
- class: E(["rounded-full overflow-hidden border-white", i.size === "lg" ? "w-20 h-20 sm:w-24 sm:h-24 border-4" : "w-16 sm:size-16 border-2"])
524
+ y("div", ti, [
525
+ y("div", {
526
+ class: A(["rounded-full overflow-hidden border-white", r.size === "lg" ? "w-20 h-20 sm:w-24 sm:h-24 border-4" : "w-16 sm:size-16 border-2"])
483
527
  }, [
484
- w("img", {
485
- src: i.agent.avatarUrl.value,
486
- alt: i.agent.displayName.value,
528
+ y("img", {
529
+ src: r.agent.avatarUrl.value,
530
+ alt: r.agent.displayName.value,
487
531
  class: "w-full h-full object-cover",
488
532
  onError: e[0] || (e[0] = //@ts-ignore
489
- (...n) => rn(qn) && rn(qn)(...n))
533
+ (...n) => on(qn) && on(qn)(...n))
490
534
  }, null, 40, ni)
491
535
  ], 2),
492
- w("div", si, [
493
- i.isOnline ? (v(), S(Me, { key: 0 }, [
494
- e[1] || (e[1] = w("div", {
536
+ y("div", si, [
537
+ r.isOnline ? (v(), w($e, { key: 0 }, [
538
+ e[1] || (e[1] = y("div", {
495
539
  class: "size-3 bg-green-500 rounded-full ring-2 ring-white absolute animate-ping",
496
540
  style: { "animation-duration": "3s" }
497
541
  }, null, -1)),
498
- e[2] || (e[2] = w("div", { class: "size-3 bg-green-500 rounded-full ring-2 ring-white" }, null, -1))
499
- ], 64)) : (v(), S("div", ii))
542
+ e[2] || (e[2] = y("div", { class: "size-3 bg-green-500 rounded-full ring-2 ring-white" }, null, -1))
543
+ ], 64)) : (v(), w("div", ii))
500
544
  ])
501
545
  ]),
502
- w("div", ri, [
503
- w("h1", {
504
- class: E(["font-light text-white mb-1 truncate", [
505
- i.size === "lg" ? "text-3xl mb-2" : "text-xl sm:text-2xl tracking-wide leading-tight",
506
- i.layout === "horizontal" ? "text-white/95" : ""
546
+ y("div", ri, [
547
+ y("h1", {
548
+ class: A(["font-light text-white mb-1 truncate", [
549
+ r.size === "lg" ? "text-3xl mb-2" : "text-xl sm:text-2xl tracking-wide leading-tight",
550
+ r.layout === "horizontal" ? "text-white/95" : ""
507
551
  ]])
508
- }, ne(i.agent.displayName.value), 3),
509
- w("p", {
510
- class: E(["font-light line-clamp-1", [
511
- i.size === "lg" ? "text-base text-white/60" : "text-sm sm:text-base",
512
- i.layout === "horizontal" ? "text-white/70 truncate" : "text-white/60"
552
+ }, se(r.agent.displayName.value), 3),
553
+ y("p", {
554
+ class: A(["font-light line-clamp-1", [
555
+ r.size === "lg" ? "text-base text-white/60" : "text-sm sm:text-base",
556
+ r.layout === "horizontal" ? "text-white/70 truncate" : "text-white/60"
513
557
  ]])
514
- }, ne(i.layout === "horizontal" ? i.agent.title.value || "Assistant" : i.agent.title.value), 3)
558
+ }, se(r.layout === "horizontal" ? r.agent.title.value || "Assistant" : r.agent.title.value), 3)
515
559
  ])
516
560
  ], 2));
517
561
  }
518
562
  });
519
- function Yn(i, t) {
520
- (t == null || t > i.length) && (t = i.length);
521
- for (var e = 0, n = Array(t); e < t; e++) n[e] = i[e];
563
+ function Yn(r, t) {
564
+ (t == null || t > r.length) && (t = r.length);
565
+ for (var e = 0, n = Array(t); e < t; e++) n[e] = r[e];
522
566
  return n;
523
567
  }
524
568
  d(Yn, "_arrayLikeToArray");
525
- function li(i) {
526
- if (Array.isArray(i)) return i;
569
+ function li(r) {
570
+ if (Array.isArray(r)) return r;
527
571
  }
528
572
  d(li, "_arrayWithHoles");
529
- function oi(i, t) {
530
- var e = i == null ? null : typeof Symbol < "u" && i[Symbol.iterator] || i["@@iterator"];
573
+ function oi(r, t) {
574
+ var e = r == null ? null : typeof Symbol < "u" && r[Symbol.iterator] || r["@@iterator"];
531
575
  if (e != null) {
532
- var n, r, s, l, o = [], h = !0, c = !1;
576
+ var n, i, s, l, o = [], h = !0, c = !1;
533
577
  try {
534
- if (s = (e = e.call(i)).next, t !== 0) for (; !(h = (n = s.call(e)).done) && (o.push(n.value), o.length !== t); h = !0) ;
535
- } catch (k) {
536
- c = !0, r = k;
578
+ if (s = (e = e.call(r)).next, t !== 0) for (; !(h = (n = s.call(e)).done) && (o.push(n.value), o.length !== t); h = !0) ;
579
+ } catch (m) {
580
+ c = !0, i = m;
537
581
  } finally {
538
582
  try {
539
583
  if (!h && e.return != null && (l = e.return(), Object(l) !== l)) return;
540
584
  } finally {
541
- if (c) throw r;
585
+ if (c) throw i;
542
586
  }
543
587
  }
544
588
  return o;
@@ -550,148 +594,148 @@ function ci() {
550
594
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
551
595
  }
552
596
  d(ci, "_nonIterableRest");
553
- function ui(i, t) {
554
- return li(i) || oi(i, t) || hi(i, t) || ci();
597
+ function ui(r, t) {
598
+ return li(r) || oi(r, t) || hi(r, t) || ci();
555
599
  }
556
600
  d(ui, "_slicedToArray");
557
- function hi(i, t) {
558
- if (i) {
559
- if (typeof i == "string") return Yn(i, t);
560
- var e = {}.toString.call(i).slice(8, -1);
561
- return e === "Object" && i.constructor && (e = i.constructor.name), e === "Map" || e === "Set" ? Array.from(i) : e === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e) ? Yn(i, t) : void 0;
601
+ function hi(r, t) {
602
+ if (r) {
603
+ if (typeof r == "string") return Yn(r, t);
604
+ var e = {}.toString.call(r).slice(8, -1);
605
+ return e === "Object" && r.constructor && (e = r.constructor.name), e === "Map" || e === "Set" ? Array.from(r) : e === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e) ? Yn(r, t) : void 0;
562
606
  }
563
607
  }
564
608
  d(hi, "_unsupportedIterableToArray");
565
609
  const xs = Object.entries, Vn = Object.setPrototypeOf, di = Object.isFrozen, pi = Object.getPrototypeOf, fi = Object.getOwnPropertyDescriptor;
566
- let re = Object.freeze, oe = Object.seal, Xe = Object.create, ks = typeof Reflect < "u" && Reflect, an = ks.apply, ln = ks.construct;
567
- re || (re = /* @__PURE__ */ d(function(t) {
610
+ let le = Object.freeze, he = Object.seal, Qe = Object.create, ks = typeof Reflect < "u" && Reflect, cn = ks.apply, un = ks.construct;
611
+ le || (le = /* @__PURE__ */ d(function(t) {
568
612
  return t;
569
613
  }, "freeze"));
570
- oe || (oe = /* @__PURE__ */ d(function(t) {
614
+ he || (he = /* @__PURE__ */ d(function(t) {
571
615
  return t;
572
616
  }, "seal"));
573
- an || (an = /* @__PURE__ */ d(function(t, e) {
574
- for (var n = arguments.length, r = new Array(n > 2 ? n - 2 : 0), s = 2; s < n; s++)
575
- r[s - 2] = arguments[s];
576
- return t.apply(e, r);
617
+ cn || (cn = /* @__PURE__ */ d(function(t, e) {
618
+ for (var n = arguments.length, i = new Array(n > 2 ? n - 2 : 0), s = 2; s < n; s++)
619
+ i[s - 2] = arguments[s];
620
+ return t.apply(e, i);
577
621
  }, "apply"));
578
- ln || (ln = /* @__PURE__ */ d(function(t) {
579
- for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), r = 1; r < e; r++)
580
- n[r - 1] = arguments[r];
622
+ un || (un = /* @__PURE__ */ d(function(t) {
623
+ for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++)
624
+ n[i - 1] = arguments[i];
581
625
  return new t(...n);
582
626
  }, "construct"));
583
- const qe = Z(Array.prototype.forEach), gi = Z(Array.prototype.lastIndexOf), Zn = Z(Array.prototype.pop), Ye = Z(Array.prototype.push), mi = Z(Array.prototype.splice), se = Array.isArray, ht = Z(String.prototype.toLowerCase), Jt = Z(String.prototype.toString), Xn = Z(String.prototype.match), Ve = Z(String.prototype.replace), Kn = Z(String.prototype.indexOf), bi = Z(String.prototype.trim), xi = Z(Number.prototype.toString), ki = Z(Boolean.prototype.toString), Qn = typeof BigInt > "u" ? null : Z(BigInt.prototype.toString), Jn = typeof Symbol > "u" ? null : Z(Symbol.prototype.toString), Y = Z(Object.prototype.hasOwnProperty), ot = Z(Object.prototype.toString), J = Z(RegExp.prototype.test), ct = yi(TypeError);
584
- function Z(i) {
627
+ const Ve = Q(Array.prototype.forEach), gi = Q(Array.prototype.lastIndexOf), Zn = Q(Array.prototype.pop), Ze = Q(Array.prototype.push), mi = Q(Array.prototype.splice), re = Array.isArray, gt = Q(String.prototype.toLowerCase), nn = Q(String.prototype.toString), Xn = Q(String.prototype.match), Xe = Q(String.prototype.replace), Kn = Q(String.prototype.indexOf), bi = Q(String.prototype.trim), xi = Q(Number.prototype.toString), ki = Q(Boolean.prototype.toString), Qn = typeof BigInt > "u" ? null : Q(BigInt.prototype.toString), Jn = typeof Symbol > "u" ? null : Q(Symbol.prototype.toString), Y = Q(Object.prototype.hasOwnProperty), dt = Q(Object.prototype.toString), te = Q(RegExp.prototype.test), pt = vi(TypeError);
628
+ function Q(r) {
585
629
  return function(t) {
586
630
  t instanceof RegExp && (t.lastIndex = 0);
587
- for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), r = 1; r < e; r++)
588
- n[r - 1] = arguments[r];
589
- return an(i, t, n);
631
+ for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++)
632
+ n[i - 1] = arguments[i];
633
+ return cn(r, t, n);
590
634
  };
591
635
  }
592
- d(Z, "unapply");
593
- function yi(i) {
636
+ d(Q, "unapply");
637
+ function vi(r) {
594
638
  return function() {
595
639
  for (var t = arguments.length, e = new Array(t), n = 0; n < t; n++)
596
640
  e[n] = arguments[n];
597
- return ln(i, e);
641
+ return un(r, e);
598
642
  };
599
643
  }
600
- d(yi, "unconstruct");
601
- function R(i, t) {
602
- let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ht;
603
- if (Vn && Vn(i, null), !se(t))
604
- return i;
644
+ d(vi, "unconstruct");
645
+ function _(r, t) {
646
+ let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : gt;
647
+ if (Vn && Vn(r, null), !re(t))
648
+ return r;
605
649
  let n = t.length;
606
650
  for (; n--; ) {
607
- let r = t[n];
608
- if (typeof r == "string") {
609
- const s = e(r);
610
- s !== r && (di(t) || (t[n] = s), r = s);
651
+ let i = t[n];
652
+ if (typeof i == "string") {
653
+ const s = e(i);
654
+ s !== i && (di(t) || (t[n] = s), i = s);
611
655
  }
612
- i[r] = !0;
656
+ r[i] = !0;
613
657
  }
614
- return i;
658
+ return r;
615
659
  }
616
- d(R, "addToSet");
617
- function wi(i) {
618
- for (let t = 0; t < i.length; t++)
619
- Y(i, t) || (i[t] = null);
620
- return i;
660
+ d(_, "addToSet");
661
+ function yi(r) {
662
+ for (let t = 0; t < r.length; t++)
663
+ Y(r, t) || (r[t] = null);
664
+ return r;
621
665
  }
622
- d(wi, "cleanArray");
623
- function ee(i) {
624
- const t = Xe(null);
625
- for (const n of xs(i)) {
666
+ d(yi, "cleanArray");
667
+ function ne(r) {
668
+ const t = Qe(null);
669
+ for (const n of xs(r)) {
626
670
  var e = ui(n, 2);
627
- const r = e[0], s = e[1];
628
- Y(i, r) && (se(s) ? t[r] = wi(s) : s && typeof s == "object" && s.constructor === Object ? t[r] = ee(s) : t[r] = s);
671
+ const i = e[0], s = e[1];
672
+ Y(r, i) && (re(s) ? t[i] = yi(s) : s && typeof s == "object" && s.constructor === Object ? t[i] = ne(s) : t[i] = s);
629
673
  }
630
674
  return t;
631
675
  }
632
- d(ee, "clone");
633
- function vi(i) {
634
- switch (typeof i) {
676
+ d(ne, "clone");
677
+ function wi(r) {
678
+ switch (typeof r) {
635
679
  case "string":
636
- return i;
680
+ return r;
637
681
  case "number":
638
- return xi(i);
682
+ return xi(r);
639
683
  case "boolean":
640
- return ki(i);
684
+ return ki(r);
641
685
  case "bigint":
642
- return Qn ? Qn(i) : "0";
686
+ return Qn ? Qn(r) : "0";
643
687
  case "symbol":
644
- return Jn ? Jn(i) : "Symbol()";
688
+ return Jn ? Jn(r) : "Symbol()";
645
689
  case "undefined":
646
- return ot(i);
690
+ return dt(r);
647
691
  case "function":
648
692
  case "object": {
649
- if (i === null)
650
- return ot(i);
651
- const t = i, e = be(t, "toString");
693
+ if (r === null)
694
+ return dt(r);
695
+ const t = r, e = Te(t, "toString");
652
696
  if (typeof e == "function") {
653
697
  const n = e(t);
654
- return typeof n == "string" ? n : ot(n);
698
+ return typeof n == "string" ? n : dt(n);
655
699
  }
656
- return ot(i);
700
+ return dt(r);
657
701
  }
658
702
  default:
659
- return ot(i);
703
+ return dt(r);
660
704
  }
661
705
  }
662
- d(vi, "stringifyValue");
663
- function be(i, t) {
664
- for (; i !== null; ) {
665
- const n = fi(i, t);
706
+ d(wi, "stringifyValue");
707
+ function Te(r, t) {
708
+ for (; r !== null; ) {
709
+ const n = fi(r, t);
666
710
  if (n) {
667
711
  if (n.get)
668
- return Z(n.get);
712
+ return Q(n.get);
669
713
  if (typeof n.value == "function")
670
- return Z(n.value);
714
+ return Q(n.value);
671
715
  }
672
- i = pi(i);
716
+ r = pi(r);
673
717
  }
674
718
  function e() {
675
719
  return null;
676
720
  }
677
721
  return d(e, "fallbackValue"), e;
678
722
  }
679
- d(be, "lookupGetter");
680
- function Ti(i) {
723
+ d(Te, "lookupGetter");
724
+ function Ti(r) {
681
725
  try {
682
- return J(i, ""), !0;
726
+ return te(r, ""), !0;
683
727
  } catch {
684
728
  return !1;
685
729
  }
686
730
  }
687
731
  d(Ti, "isRegex");
688
- const es = re(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "search", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), en = re(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "enterkeyhint", "exportparts", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "inputmode", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "part", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), tn = re(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), Si = re(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), nn = re(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]), Ai = re(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), ts = re(["#text"]), ns = re(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "command", "commandfor", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "exportparts", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inert", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "part", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "slot", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns"]), sn = re(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "mask-type", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), ss = re(["accent", "accentunder", "align", "bevelled", "close", "columnalign", "columnlines", "columnspacing", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lquote", "lspace", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), Et = re(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), Ei = oe(/{{[\w\W]*|^[\w\W]*}}/g), _i = oe(/<%[\w\W]*|^[\w\W]*%>/g), Ri = oe(/\${[\w\W]*/g), Ii = oe(/^data-[\-\w.\u00B7-\uFFFF]+$/), Di = oe(/^aria-[\-\w]+$/), is = oe(
732
+ const es = le(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "search", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), sn = le(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "enterkeyhint", "exportparts", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "inputmode", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "part", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), rn = le(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), Si = le(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), an = le(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]), Ai = le(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), ts = le(["#text"]), ns = le(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "command", "commandfor", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "exportparts", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inert", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "part", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "slot", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns"]), ln = le(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "mask-type", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), ss = le(["accent", "accentunder", "align", "bevelled", "close", "columnalign", "columnlines", "columnspacing", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lquote", "lspace", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), Dt = le(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), Ei = he(/{{[\w\W]*|^[\w\W]*}}/g), _i = he(/<%[\w\W]*|^[\w\W]*%>/g), Ri = he(/\${[\w\W]*/g), Ii = he(/^data-[\-\w.\u00B7-\uFFFF]+$/), Ci = he(/^aria-[\-\w]+$/), is = he(
689
733
  /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
690
734
  // eslint-disable-line no-useless-escape
691
- ), Ci = oe(/^(?:\w+script|data):/i), Oi = oe(
735
+ ), Di = he(/^(?:\w+script|data):/i), Oi = he(
692
736
  /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
693
737
  // eslint-disable-line no-control-regex
694
- ), Li = oe(/^html$/i), Mi = oe(/^[a-z][.\w]*(-[.\w]+)+$/i), me = {
738
+ ), Li = he(/^html$/i), Mi = he(/^[a-z][.\w]*(-[.\w]+)+$/i), we = {
695
739
  element: 1,
696
740
  attribute: 2,
697
741
  text: 3,
@@ -713,8 +757,8 @@ const es = re(["a", "abbr", "acronym", "address", "area", "article", "aside", "a
713
757
  if (typeof t != "object" || typeof t.createPolicy != "function")
714
758
  return null;
715
759
  let n = null;
716
- const r = "data-tt-policy-suffix";
717
- e && e.hasAttribute(r) && (n = e.getAttribute(r));
760
+ const i = "data-tt-policy-suffix";
761
+ e && e.hasAttribute(i) && (n = e.getAttribute(i));
718
762
  const s = "dompurify" + (n ? "#" + n : "");
719
763
  try {
720
764
  return t.createPolicy(s, {
@@ -741,31 +785,31 @@ const es = re(["a", "abbr", "acronym", "address", "area", "article", "aside", "a
741
785
  uponSanitizeShadowNode: []
742
786
  };
743
787
  }, "_createHooksMap");
744
- function ys() {
745
- let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Ni();
746
- const t = /* @__PURE__ */ d((x) => ys(x), "DOMPurify");
747
- if (t.version = "3.4.7", t.removed = [], !i || !i.document || i.document.nodeType !== me.document || !i.Element)
788
+ function vs() {
789
+ let r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Ni();
790
+ const t = /* @__PURE__ */ d((x) => vs(x), "DOMPurify");
791
+ if (t.version = "3.4.7", t.removed = [], !r || !r.document || r.document.nodeType !== we.document || !r.Element)
748
792
  return t.isSupported = !1, t;
749
- let e = i.document;
750
- const n = e, r = n.currentScript;
751
- i.DocumentFragment;
752
- const s = i.HTMLTemplateElement, l = i.Node, o = i.Element, h = i.NodeFilter, c = i.NamedNodeMap;
753
- c === void 0 && (i.NamedNodeMap || i.MozNamedAttrMap), i.HTMLFormElement;
754
- const k = i.DOMParser, m = i.trustedTypes, b = o.prototype, T = be(b, "cloneNode"), F = be(b, "remove"), y = be(b, "nextSibling"), I = be(b, "childNodes"), M = be(b, "parentNode"), $ = be(b, "shadowRoot"), W = be(b, "attributes"), U = l && l.prototype ? be(l.prototype, "nodeType") : null, X = l && l.prototype ? be(l.prototype, "nodeName") : null;
793
+ let e = r.document;
794
+ const n = e, i = n.currentScript;
795
+ r.DocumentFragment;
796
+ const s = r.HTMLTemplateElement, l = r.Node, o = r.Element, h = r.NodeFilter, c = r.NamedNodeMap;
797
+ c === void 0 && (r.NamedNodeMap || r.MozNamedAttrMap), r.HTMLFormElement;
798
+ const m = r.DOMParser, b = r.trustedTypes, k = o.prototype, T = Te(k, "cloneNode"), F = Te(k, "remove"), M = Te(k, "nextSibling"), V = Te(k, "childNodes"), oe = Te(k, "parentNode"), E = Te(k, "shadowRoot"), L = Te(k, "attributes"), I = l && l.prototype ? Te(l.prototype, "nodeType") : null, B = l && l.prototype ? Te(l.prototype, "nodeName") : null;
755
799
  if (typeof s == "function") {
756
800
  const x = e.createElement("template");
757
801
  x.content && x.content.ownerDocument && (e = x.content.ownerDocument);
758
802
  }
759
- let B, ae = "";
760
- const we = e, ve = we.implementation, ft = we.createNodeIterator, gt = we.createDocumentFragment, O = we.getElementsByTagName, mt = n.importNode;
761
- let q = rs();
762
- t.isSupported = typeof xs == "function" && typeof M == "function" && ve && ve.createHTMLDocument !== void 0;
763
- const Ce = Ei, Pe = _i, Be = Ri, $t = Ii, Pt = Di, Bt = Ci, nt = Oi, bt = Mi;
764
- let _ = is, p = null;
765
- const f = R({}, [...es, ...en, ...tn, ...nn, ...ts]);
766
- let A = null;
767
- const K = R({}, [...ns, ...sn, ...ss, ...Et]);
768
- let P = Object.seal(Xe(null, {
803
+ let z, Z = "";
804
+ const ce = e, de = ce.implementation, xt = ce.createNodeIterator, it = ce.createDocumentFragment, Ue = ce.getElementsByTagName, Ht = n.importNode;
805
+ let K = rs();
806
+ t.isSupported = typeof xs == "function" && typeof oe == "function" && de && de.createHTMLDocument !== void 0;
807
+ const xe = Ei, Me = _i, R = Ri, kt = Ii, rt = Ci, vt = Di, yt = Oi, Gt = Mi;
808
+ let wt = is, W = null;
809
+ const at = _({}, [...es, ...sn, ...rn, ...an, ...ts]);
810
+ let q = null;
811
+ const lt = _({}, [...ns, ...ln, ...ss, ...Dt]);
812
+ let G = Object.seal(Qe(null, {
769
813
  tagNameCheck: {
770
814
  writable: !0,
771
815
  configurable: !1,
@@ -784,8 +828,8 @@ function ys() {
784
828
  enumerable: !0,
785
829
  value: !1
786
830
  }
787
- })), Te = null, Se = null;
788
- const Ae = Object.seal(Xe(null, {
831
+ })), Ie = null, S = null;
832
+ const f = Object.seal(Qe(null, {
789
833
  tagCheck: {
790
834
  writable: !0,
791
835
  configurable: !1,
@@ -799,72 +843,72 @@ function ys() {
799
843
  value: null
800
844
  }
801
845
  }));
802
- let yn = !0, Ft = !0, wn = !1, vn = !0, Ee = !1, st = !0, Oe = !1, Ut = !1, Ht = !1, Fe = !1, xt = !1, kt = !1, Tn = !0, Sn = !1;
846
+ let p = !0, D = !0, J = !1, Ae = !0, pe = !1, Ee = !0, Ne = !1, jt = !1, Wt = !1, He = !1, Tt = !1, St = !1, Tn = !0, Sn = !1;
803
847
  const An = "user-content-";
804
- let jt = !0, it = !1, Ue = {}, pe = null;
805
- const Gt = R({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
848
+ let qt = !0, ot = !1, Ge = {}, ke = null;
849
+ const Yt = _({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
806
850
  let En = null;
807
- const _n = R({}, ["audio", "video", "img", "source", "image", "track"]);
808
- let Wt = null;
809
- const Rn = R({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), yt = "http://www.w3.org/1998/Math/MathML", wt = "http://www.w3.org/2000/svg", fe = "http://www.w3.org/1999/xhtml";
810
- let He = fe, qt = !1, Yt = null;
811
- const Cs = R({}, [yt, wt, fe], Jt);
812
- let Vt = R({}, ["mi", "mo", "mn", "ms", "mtext"]), Zt = R({}, ["annotation-xml"]);
813
- const Os = R({}, ["title", "style", "font", "a", "script"]);
814
- let rt = null;
851
+ const _n = _({}, ["audio", "video", "img", "source", "image", "track"]);
852
+ let Vt = null;
853
+ const Rn = _({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), At = "http://www.w3.org/1998/Math/MathML", Et = "http://www.w3.org/2000/svg", ve = "http://www.w3.org/1999/xhtml";
854
+ let je = ve, Zt = !1, Xt = null;
855
+ const Ds = _({}, [At, Et, ve], nn);
856
+ let Kt = _({}, ["mi", "mo", "mn", "ms", "mtext"]), Qt = _({}, ["annotation-xml"]);
857
+ const Os = _({}, ["title", "style", "font", "a", "script"]);
858
+ let ct = null;
815
859
  const Ls = ["application/xhtml+xml", "text/html"], Ms = "text/html";
816
- let V = null, je = null;
860
+ let X = null, We = null;
817
861
  const Ns = e.createElement("form"), In = /* @__PURE__ */ d(function(a) {
818
862
  return a instanceof RegExp || a instanceof Function;
819
- }, "isRegexOrFunction"), Xt = /* @__PURE__ */ d(function() {
863
+ }, "isRegexOrFunction"), Jt = /* @__PURE__ */ d(function() {
820
864
  let a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
821
- if (je && je === a)
865
+ if (We && We === a)
822
866
  return;
823
- (!a || typeof a != "object") && (a = {}), a = ee(a), rt = // eslint-disable-next-line unicorn/prefer-includes
824
- Ls.indexOf(a.PARSER_MEDIA_TYPE) === -1 ? Ms : a.PARSER_MEDIA_TYPE, V = rt === "application/xhtml+xml" ? Jt : ht, p = Y(a, "ALLOWED_TAGS") && se(a.ALLOWED_TAGS) ? R({}, a.ALLOWED_TAGS, V) : f, A = Y(a, "ALLOWED_ATTR") && se(a.ALLOWED_ATTR) ? R({}, a.ALLOWED_ATTR, V) : K, Yt = Y(a, "ALLOWED_NAMESPACES") && se(a.ALLOWED_NAMESPACES) ? R({}, a.ALLOWED_NAMESPACES, Jt) : Cs, Wt = Y(a, "ADD_URI_SAFE_ATTR") && se(a.ADD_URI_SAFE_ATTR) ? R(ee(Rn), a.ADD_URI_SAFE_ATTR, V) : Rn, En = Y(a, "ADD_DATA_URI_TAGS") && se(a.ADD_DATA_URI_TAGS) ? R(ee(_n), a.ADD_DATA_URI_TAGS, V) : _n, pe = Y(a, "FORBID_CONTENTS") && se(a.FORBID_CONTENTS) ? R({}, a.FORBID_CONTENTS, V) : Gt, Te = Y(a, "FORBID_TAGS") && se(a.FORBID_TAGS) ? R({}, a.FORBID_TAGS, V) : ee({}), Se = Y(a, "FORBID_ATTR") && se(a.FORBID_ATTR) ? R({}, a.FORBID_ATTR, V) : ee({}), Ue = Y(a, "USE_PROFILES") ? a.USE_PROFILES && typeof a.USE_PROFILES == "object" ? ee(a.USE_PROFILES) : a.USE_PROFILES : !1, yn = a.ALLOW_ARIA_ATTR !== !1, Ft = a.ALLOW_DATA_ATTR !== !1, wn = a.ALLOW_UNKNOWN_PROTOCOLS || !1, vn = a.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Ee = a.SAFE_FOR_TEMPLATES || !1, st = a.SAFE_FOR_XML !== !1, Oe = a.WHOLE_DOCUMENT || !1, Fe = a.RETURN_DOM || !1, xt = a.RETURN_DOM_FRAGMENT || !1, kt = a.RETURN_TRUSTED_TYPE || !1, Ht = a.FORCE_BODY || !1, Tn = a.SANITIZE_DOM !== !1, Sn = a.SANITIZE_NAMED_PROPS || !1, jt = a.KEEP_CONTENT !== !1, it = a.IN_PLACE || !1, _ = Ti(a.ALLOWED_URI_REGEXP) ? a.ALLOWED_URI_REGEXP : is, He = typeof a.NAMESPACE == "string" ? a.NAMESPACE : fe, Vt = Y(a, "MATHML_TEXT_INTEGRATION_POINTS") && a.MATHML_TEXT_INTEGRATION_POINTS && typeof a.MATHML_TEXT_INTEGRATION_POINTS == "object" ? ee(a.MATHML_TEXT_INTEGRATION_POINTS) : R({}, ["mi", "mo", "mn", "ms", "mtext"]), Zt = Y(a, "HTML_INTEGRATION_POINTS") && a.HTML_INTEGRATION_POINTS && typeof a.HTML_INTEGRATION_POINTS == "object" ? ee(a.HTML_INTEGRATION_POINTS) : R({}, ["annotation-xml"]);
825
- const u = Y(a, "CUSTOM_ELEMENT_HANDLING") && a.CUSTOM_ELEMENT_HANDLING && typeof a.CUSTOM_ELEMENT_HANDLING == "object" ? ee(a.CUSTOM_ELEMENT_HANDLING) : Xe(null);
826
- if (P = Xe(null), Y(u, "tagNameCheck") && In(u.tagNameCheck) && (P.tagNameCheck = u.tagNameCheck), Y(u, "attributeNameCheck") && In(u.attributeNameCheck) && (P.attributeNameCheck = u.attributeNameCheck), Y(u, "allowCustomizedBuiltInElements") && typeof u.allowCustomizedBuiltInElements == "boolean" && (P.allowCustomizedBuiltInElements = u.allowCustomizedBuiltInElements), Ee && (Ft = !1), xt && (Fe = !0), Ue && (p = R({}, ts), A = Xe(null), Ue.html === !0 && (R(p, es), R(A, ns)), Ue.svg === !0 && (R(p, en), R(A, sn), R(A, Et)), Ue.svgFilters === !0 && (R(p, tn), R(A, sn), R(A, Et)), Ue.mathMl === !0 && (R(p, nn), R(A, ss), R(A, Et))), Ae.tagCheck = null, Ae.attributeCheck = null, Y(a, "ADD_TAGS") && (typeof a.ADD_TAGS == "function" ? Ae.tagCheck = a.ADD_TAGS : se(a.ADD_TAGS) && (p === f && (p = ee(p)), R(p, a.ADD_TAGS, V))), Y(a, "ADD_ATTR") && (typeof a.ADD_ATTR == "function" ? Ae.attributeCheck = a.ADD_ATTR : se(a.ADD_ATTR) && (A === K && (A = ee(A)), R(A, a.ADD_ATTR, V))), Y(a, "ADD_URI_SAFE_ATTR") && se(a.ADD_URI_SAFE_ATTR) && R(Wt, a.ADD_URI_SAFE_ATTR, V), Y(a, "FORBID_CONTENTS") && se(a.FORBID_CONTENTS) && (pe === Gt && (pe = ee(pe)), R(pe, a.FORBID_CONTENTS, V)), Y(a, "ADD_FORBID_CONTENTS") && se(a.ADD_FORBID_CONTENTS) && (pe === Gt && (pe = ee(pe)), R(pe, a.ADD_FORBID_CONTENTS, V)), jt && (p["#text"] = !0), Oe && R(p, ["html", "head", "body"]), p.table && (R(p, ["tbody"]), delete Te.tbody), a.TRUSTED_TYPES_POLICY) {
867
+ (!a || typeof a != "object") && (a = {}), a = ne(a), ct = // eslint-disable-next-line unicorn/prefer-includes
868
+ Ls.indexOf(a.PARSER_MEDIA_TYPE) === -1 ? Ms : a.PARSER_MEDIA_TYPE, X = ct === "application/xhtml+xml" ? nn : gt, W = Y(a, "ALLOWED_TAGS") && re(a.ALLOWED_TAGS) ? _({}, a.ALLOWED_TAGS, X) : at, q = Y(a, "ALLOWED_ATTR") && re(a.ALLOWED_ATTR) ? _({}, a.ALLOWED_ATTR, X) : lt, Xt = Y(a, "ALLOWED_NAMESPACES") && re(a.ALLOWED_NAMESPACES) ? _({}, a.ALLOWED_NAMESPACES, nn) : Ds, Vt = Y(a, "ADD_URI_SAFE_ATTR") && re(a.ADD_URI_SAFE_ATTR) ? _(ne(Rn), a.ADD_URI_SAFE_ATTR, X) : Rn, En = Y(a, "ADD_DATA_URI_TAGS") && re(a.ADD_DATA_URI_TAGS) ? _(ne(_n), a.ADD_DATA_URI_TAGS, X) : _n, ke = Y(a, "FORBID_CONTENTS") && re(a.FORBID_CONTENTS) ? _({}, a.FORBID_CONTENTS, X) : Yt, Ie = Y(a, "FORBID_TAGS") && re(a.FORBID_TAGS) ? _({}, a.FORBID_TAGS, X) : ne({}), S = Y(a, "FORBID_ATTR") && re(a.FORBID_ATTR) ? _({}, a.FORBID_ATTR, X) : ne({}), Ge = Y(a, "USE_PROFILES") ? a.USE_PROFILES && typeof a.USE_PROFILES == "object" ? ne(a.USE_PROFILES) : a.USE_PROFILES : !1, p = a.ALLOW_ARIA_ATTR !== !1, D = a.ALLOW_DATA_ATTR !== !1, J = a.ALLOW_UNKNOWN_PROTOCOLS || !1, Ae = a.ALLOW_SELF_CLOSE_IN_ATTR !== !1, pe = a.SAFE_FOR_TEMPLATES || !1, Ee = a.SAFE_FOR_XML !== !1, Ne = a.WHOLE_DOCUMENT || !1, He = a.RETURN_DOM || !1, Tt = a.RETURN_DOM_FRAGMENT || !1, St = a.RETURN_TRUSTED_TYPE || !1, Wt = a.FORCE_BODY || !1, Tn = a.SANITIZE_DOM !== !1, Sn = a.SANITIZE_NAMED_PROPS || !1, qt = a.KEEP_CONTENT !== !1, ot = a.IN_PLACE || !1, wt = Ti(a.ALLOWED_URI_REGEXP) ? a.ALLOWED_URI_REGEXP : is, je = typeof a.NAMESPACE == "string" ? a.NAMESPACE : ve, Kt = Y(a, "MATHML_TEXT_INTEGRATION_POINTS") && a.MATHML_TEXT_INTEGRATION_POINTS && typeof a.MATHML_TEXT_INTEGRATION_POINTS == "object" ? ne(a.MATHML_TEXT_INTEGRATION_POINTS) : _({}, ["mi", "mo", "mn", "ms", "mtext"]), Qt = Y(a, "HTML_INTEGRATION_POINTS") && a.HTML_INTEGRATION_POINTS && typeof a.HTML_INTEGRATION_POINTS == "object" ? ne(a.HTML_INTEGRATION_POINTS) : _({}, ["annotation-xml"]);
869
+ const u = Y(a, "CUSTOM_ELEMENT_HANDLING") && a.CUSTOM_ELEMENT_HANDLING && typeof a.CUSTOM_ELEMENT_HANDLING == "object" ? ne(a.CUSTOM_ELEMENT_HANDLING) : Qe(null);
870
+ if (G = Qe(null), Y(u, "tagNameCheck") && In(u.tagNameCheck) && (G.tagNameCheck = u.tagNameCheck), Y(u, "attributeNameCheck") && In(u.attributeNameCheck) && (G.attributeNameCheck = u.attributeNameCheck), Y(u, "allowCustomizedBuiltInElements") && typeof u.allowCustomizedBuiltInElements == "boolean" && (G.allowCustomizedBuiltInElements = u.allowCustomizedBuiltInElements), pe && (D = !1), Tt && (He = !0), Ge && (W = _({}, ts), q = Qe(null), Ge.html === !0 && (_(W, es), _(q, ns)), Ge.svg === !0 && (_(W, sn), _(q, ln), _(q, Dt)), Ge.svgFilters === !0 && (_(W, rn), _(q, ln), _(q, Dt)), Ge.mathMl === !0 && (_(W, an), _(q, ss), _(q, Dt))), f.tagCheck = null, f.attributeCheck = null, Y(a, "ADD_TAGS") && (typeof a.ADD_TAGS == "function" ? f.tagCheck = a.ADD_TAGS : re(a.ADD_TAGS) && (W === at && (W = ne(W)), _(W, a.ADD_TAGS, X))), Y(a, "ADD_ATTR") && (typeof a.ADD_ATTR == "function" ? f.attributeCheck = a.ADD_ATTR : re(a.ADD_ATTR) && (q === lt && (q = ne(q)), _(q, a.ADD_ATTR, X))), Y(a, "ADD_URI_SAFE_ATTR") && re(a.ADD_URI_SAFE_ATTR) && _(Vt, a.ADD_URI_SAFE_ATTR, X), Y(a, "FORBID_CONTENTS") && re(a.FORBID_CONTENTS) && (ke === Yt && (ke = ne(ke)), _(ke, a.FORBID_CONTENTS, X)), Y(a, "ADD_FORBID_CONTENTS") && re(a.ADD_FORBID_CONTENTS) && (ke === Yt && (ke = ne(ke)), _(ke, a.ADD_FORBID_CONTENTS, X)), qt && (W["#text"] = !0), Ne && _(W, ["html", "head", "body"]), W.table && (_(W, ["tbody"]), delete Ie.tbody), a.TRUSTED_TYPES_POLICY) {
827
871
  if (typeof a.TRUSTED_TYPES_POLICY.createHTML != "function")
828
- throw ct('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
872
+ throw pt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
829
873
  if (typeof a.TRUSTED_TYPES_POLICY.createScriptURL != "function")
830
- throw ct('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
831
- B = a.TRUSTED_TYPES_POLICY, ae = B.createHTML("");
874
+ throw pt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
875
+ z = a.TRUSTED_TYPES_POLICY, Z = z.createHTML("");
832
876
  } else
833
- B === void 0 && (B = zi(m, r)), B !== null && typeof ae == "string" && (ae = B.createHTML(""));
834
- (q.uponSanitizeElement.length > 0 || q.uponSanitizeAttribute.length > 0) && p === f && (p = ee(p)), q.uponSanitizeAttribute.length > 0 && A === K && (A = ee(A)), re && re(a), je = a;
835
- }, "_parseConfig"), Dn = R({}, [...en, ...tn, ...Si]), Cn = R({}, [...nn, ...Ai]), zs = /* @__PURE__ */ d(function(a) {
836
- let u = M(a);
877
+ z === void 0 && (z = zi(b, i)), z !== null && typeof Z == "string" && (Z = z.createHTML(""));
878
+ (K.uponSanitizeElement.length > 0 || K.uponSanitizeAttribute.length > 0) && W === at && (W = ne(W)), K.uponSanitizeAttribute.length > 0 && q === lt && (q = ne(q)), le && le(a), We = a;
879
+ }, "_parseConfig"), Cn = _({}, [...sn, ...rn, ...Si]), Dn = _({}, [...an, ...Ai]), zs = /* @__PURE__ */ d(function(a) {
880
+ let u = oe(a);
837
881
  (!u || !u.tagName) && (u = {
838
- namespaceURI: He,
882
+ namespaceURI: je,
839
883
  tagName: "template"
840
884
  });
841
- const g = ht(a.tagName), z = ht(u.tagName);
842
- return Yt[a.namespaceURI] ? a.namespaceURI === wt ? u.namespaceURI === fe ? g === "svg" : u.namespaceURI === yt ? g === "svg" && (z === "annotation-xml" || Vt[z]) : !!Dn[g] : a.namespaceURI === yt ? u.namespaceURI === fe ? g === "math" : u.namespaceURI === wt ? g === "math" && Zt[z] : !!Cn[g] : a.namespaceURI === fe ? u.namespaceURI === wt && !Zt[z] || u.namespaceURI === yt && !Vt[z] ? !1 : !Cn[g] && (Os[g] || !Dn[g]) : !!(rt === "application/xhtml+xml" && Yt[a.namespaceURI]) : !1;
843
- }, "_checkValidNamespace"), ce = /* @__PURE__ */ d(function(a) {
844
- Ye(t.removed, {
885
+ const g = gt(a.tagName), P = gt(u.tagName);
886
+ return Xt[a.namespaceURI] ? a.namespaceURI === Et ? u.namespaceURI === ve ? g === "svg" : u.namespaceURI === At ? g === "svg" && (P === "annotation-xml" || Kt[P]) : !!Cn[g] : a.namespaceURI === At ? u.namespaceURI === ve ? g === "math" : u.namespaceURI === Et ? g === "math" && Qt[P] : !!Dn[g] : a.namespaceURI === ve ? u.namespaceURI === Et && !Qt[P] || u.namespaceURI === At && !Kt[P] ? !1 : !Dn[g] && (Os[g] || !Cn[g]) : !!(ct === "application/xhtml+xml" && Xt[a.namespaceURI]) : !1;
887
+ }, "_checkValidNamespace"), fe = /* @__PURE__ */ d(function(a) {
888
+ Ze(t.removed, {
845
889
  element: a
846
890
  });
847
891
  try {
848
- M(a).removeChild(a);
892
+ oe(a).removeChild(a);
849
893
  } catch {
850
894
  F(a);
851
895
  }
852
- }, "_forceRemove"), Le = /* @__PURE__ */ d(function(a, u) {
896
+ }, "_forceRemove"), ze = /* @__PURE__ */ d(function(a, u) {
853
897
  try {
854
- Ye(t.removed, {
898
+ Ze(t.removed, {
855
899
  attribute: u.getAttributeNode(a),
856
900
  from: u
857
901
  });
858
902
  } catch {
859
- Ye(t.removed, {
903
+ Ze(t.removed, {
860
904
  attribute: null,
861
905
  from: u
862
906
  });
863
907
  }
864
908
  if (u.removeAttribute(a), a === "is")
865
- if (Fe || xt)
909
+ if (He || Tt)
866
910
  try {
867
- ce(u);
911
+ fe(u);
868
912
  } catch {
869
913
  }
870
914
  else
@@ -874,30 +918,30 @@ function ys() {
874
918
  }
875
919
  }, "_removeAttribute"), On = /* @__PURE__ */ d(function(a) {
876
920
  let u = null, g = null;
877
- if (Ht)
921
+ if (Wt)
878
922
  a = "<remove></remove>" + a;
879
923
  else {
880
924
  const H = Xn(a, /^[\r\n\t ]+/);
881
925
  g = H && H[0];
882
926
  }
883
- rt === "application/xhtml+xml" && He === fe && (a = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + a + "</body></html>");
884
- const z = B ? B.createHTML(a) : a;
885
- if (He === fe)
927
+ ct === "application/xhtml+xml" && je === ve && (a = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + a + "</body></html>");
928
+ const P = z ? z.createHTML(a) : a;
929
+ if (je === ve)
886
930
  try {
887
- u = new k().parseFromString(z, rt);
931
+ u = new m().parseFromString(P, ct);
888
932
  } catch {
889
933
  }
890
934
  if (!u || !u.documentElement) {
891
- u = ve.createDocument(He, "template", null);
935
+ u = de.createDocument(je, "template", null);
892
936
  try {
893
- u.documentElement.innerHTML = qt ? ae : z;
937
+ u.documentElement.innerHTML = Zt ? Z : P;
894
938
  } catch {
895
939
  }
896
940
  }
897
- const D = u.body || u.documentElement;
898
- return a && g && D.insertBefore(e.createTextNode(g), D.childNodes[0] || null), He === fe ? O.call(u, Oe ? "html" : "body")[0] : Oe ? u.documentElement : D;
941
+ const O = u.body || u.documentElement;
942
+ return a && g && O.insertBefore(e.createTextNode(g), O.childNodes[0] || null), je === ve ? Ue.call(u, Ne ? "html" : "body")[0] : Ne ? u.documentElement : O;
899
943
  }, "_initDocument"), Ln = /* @__PURE__ */ d(function(a) {
900
- return ft.call(
944
+ return xt.call(
901
945
  a.ownerDocument || a,
902
946
  a,
903
947
  // eslint-disable-next-line no-bitwise
@@ -906,7 +950,7 @@ function ys() {
906
950
  );
907
951
  }, "_createNodeIterator"), Mn = /* @__PURE__ */ d(function(a) {
908
952
  a.normalize();
909
- const u = ft.call(
953
+ const u = xt.call(
910
954
  a.ownerDocument || a,
911
955
  a,
912
956
  // eslint-disable-next-line no-bitwise
@@ -915,26 +959,26 @@ function ys() {
915
959
  );
916
960
  let g = u.nextNode();
917
961
  for (; g; ) {
918
- let z = g.data;
919
- qe([Ce, Pe, Be], (D) => {
920
- z = Ve(z, D, " ");
921
- }), g.data = z, g = u.nextNode();
922
- }
923
- }, "_scrubTemplateExpressions"), vt = /* @__PURE__ */ d(function(a) {
924
- const u = X ? X(a) : null;
925
- return typeof u != "string" || V(u) !== "form" ? !1 : typeof a.nodeName != "string" || typeof a.textContent != "string" || typeof a.removeChild != "function" || // Realm-safe NamedNodeMap detection: equality against the cached
962
+ let P = g.data;
963
+ Ve([xe, Me, R], (O) => {
964
+ P = Xe(P, O, " ");
965
+ }), g.data = P, g = u.nextNode();
966
+ }
967
+ }, "_scrubTemplateExpressions"), _t = /* @__PURE__ */ d(function(a) {
968
+ const u = B ? B(a) : null;
969
+ return typeof u != "string" || X(u) !== "form" ? !1 : typeof a.nodeName != "string" || typeof a.textContent != "string" || typeof a.removeChild != "function" || // Realm-safe NamedNodeMap detection: equality against the cached
926
970
  // prototype getter. Clobbered .attributes (e.g. <input name="attributes">)
927
971
  // makes the direct read diverge from the cached read; a clean form
928
972
  // (same-realm OR foreign-realm) has both reads pointing at the same
929
973
  // canonical NamedNodeMap.
930
- a.attributes !== W(a) || typeof a.removeAttribute != "function" || typeof a.setAttribute != "function" || typeof a.namespaceURI != "string" || typeof a.insertBefore != "function" || typeof a.hasChildNodes != "function" || // NodeType clobbering probe. Cached Node.prototype.nodeType getter
974
+ a.attributes !== L(a) || typeof a.removeAttribute != "function" || typeof a.setAttribute != "function" || typeof a.namespaceURI != "string" || typeof a.insertBefore != "function" || typeof a.hasChildNodes != "function" || // NodeType clobbering probe. Cached Node.prototype.nodeType getter
931
975
  // returns the integer 1 for any Element regardless of realm; direct
932
976
  // read on a clobbered form (e.g. <input name="nodeType">) returns
933
977
  // the named child element. Cheap addition — nodeType is read from
934
978
  // an internal slot, no serialization cost — and removes a residual
935
979
  // clobbering surface used by several mXSS / PI / comment branches
936
980
  // in _sanitizeElements that compare currentNode.nodeType directly.
937
- a.nodeType !== U(a) || // HTMLFormElement has [LegacyOverrideBuiltIns]: a descendant named
981
+ a.nodeType !== I(a) || // HTMLFormElement has [LegacyOverrideBuiltIns]: a descendant named
938
982
  // "childNodes" shadows the prototype getter. Direct reads of
939
983
  // form.childNodes from a clobbered form return the named child
940
984
  // instead of the real NodeList, so any walk that reads it directly
@@ -945,79 +989,79 @@ function ys() {
945
989
  // select, etc.) regardless of whether the named child happens to
946
990
  // carry a numeric .length, which a typeof-based probe would miss
947
991
  // (e.g. HTMLSelectElement.length is a defined unsigned-long).
948
- a.childNodes !== I(a);
949
- }, "_isClobbered"), at = /* @__PURE__ */ d(function(a) {
950
- if (!U || typeof a != "object" || a === null)
992
+ a.childNodes !== V(a);
993
+ }, "_isClobbered"), ut = /* @__PURE__ */ d(function(a) {
994
+ if (!I || typeof a != "object" || a === null)
951
995
  return !1;
952
996
  try {
953
- return U(a) === me.documentFragment;
997
+ return I(a) === we.documentFragment;
954
998
  } catch {
955
999
  return !1;
956
1000
  }
957
- }, "_isDocumentFragment"), Tt = /* @__PURE__ */ d(function(a) {
958
- if (!U || typeof a != "object" || a === null)
1001
+ }, "_isDocumentFragment"), Rt = /* @__PURE__ */ d(function(a) {
1002
+ if (!I || typeof a != "object" || a === null)
959
1003
  return !1;
960
1004
  try {
961
- return typeof U(a) == "number";
1005
+ return typeof I(a) == "number";
962
1006
  } catch {
963
1007
  return !1;
964
1008
  }
965
1009
  }, "_isNode");
966
- function ke(x, a, u) {
967
- qe(x, (g) => {
968
- g.call(t, a, u, je);
1010
+ function _e(x, a, u) {
1011
+ Ve(x, (g) => {
1012
+ g.call(t, a, u, We);
969
1013
  });
970
1014
  }
971
- d(ke, "_executeHooks");
1015
+ d(_e, "_executeHooks");
972
1016
  const Nn = /* @__PURE__ */ d(function(a) {
973
1017
  let u = null;
974
- if (ke(q.beforeSanitizeElements, a, null), vt(a))
975
- return ce(a), !0;
976
- const g = V(a.nodeName);
977
- if (ke(q.uponSanitizeElement, a, {
1018
+ if (_e(K.beforeSanitizeElements, a, null), _t(a))
1019
+ return fe(a), !0;
1020
+ const g = X(a.nodeName);
1021
+ if (_e(K.uponSanitizeElement, a, {
978
1022
  tagName: g,
979
- allowedTags: p
980
- }), st && a.hasChildNodes() && !Tt(a.firstElementChild) && J(/<[/\w!]/g, a.innerHTML) && J(/<[/\w!]/g, a.textContent) || st && a.namespaceURI === fe && g === "style" && Tt(a.firstElementChild) || a.nodeType === me.progressingInstruction || st && a.nodeType === me.comment && J(/<[/\w]/g, a.data))
981
- return ce(a), !0;
982
- if (Te[g] || !(Ae.tagCheck instanceof Function && Ae.tagCheck(g)) && !p[g]) {
983
- if (!Te[g] && $n(g) && (P.tagNameCheck instanceof RegExp && J(P.tagNameCheck, g) || P.tagNameCheck instanceof Function && P.tagNameCheck(g)))
1023
+ allowedTags: W
1024
+ }), Ee && a.hasChildNodes() && !Rt(a.firstElementChild) && te(/<[/\w!]/g, a.innerHTML) && te(/<[/\w!]/g, a.textContent) || Ee && a.namespaceURI === ve && g === "style" && Rt(a.firstElementChild) || a.nodeType === we.progressingInstruction || Ee && a.nodeType === we.comment && te(/<[/\w]/g, a.data))
1025
+ return fe(a), !0;
1026
+ if (Ie[g] || !(f.tagCheck instanceof Function && f.tagCheck(g)) && !W[g]) {
1027
+ if (!Ie[g] && $n(g) && (G.tagNameCheck instanceof RegExp && te(G.tagNameCheck, g) || G.tagNameCheck instanceof Function && G.tagNameCheck(g)))
984
1028
  return !1;
985
- if (jt && !pe[g]) {
986
- const D = M(a), H = I(a);
987
- if (H && D) {
988
- const le = H.length;
989
- for (let ge = le - 1; ge >= 0; --ge) {
990
- const ue = T(H[ge], !0);
991
- D.insertBefore(ue, y(a));
1029
+ if (qt && !ke[g]) {
1030
+ const O = oe(a), H = V(a);
1031
+ if (H && O) {
1032
+ const ue = H.length;
1033
+ for (let ye = ue - 1; ye >= 0; --ye) {
1034
+ const ge = T(H[ye], !0);
1035
+ O.insertBefore(ge, M(a));
992
1036
  }
993
1037
  }
994
1038
  }
995
- return ce(a), !0;
1039
+ return fe(a), !0;
996
1040
  }
997
- return (U ? U(a) : a.nodeType) === me.element && !zs(a) || (g === "noscript" || g === "noembed" || g === "noframes") && J(/<\/no(script|embed|frames)/i, a.innerHTML) ? (ce(a), !0) : (Ee && a.nodeType === me.text && (u = a.textContent, qe([Ce, Pe, Be], (D) => {
998
- u = Ve(u, D, " ");
999
- }), a.textContent !== u && (Ye(t.removed, {
1041
+ return (I ? I(a) : a.nodeType) === we.element && !zs(a) || (g === "noscript" || g === "noembed" || g === "noframes") && te(/<\/no(script|embed|frames)/i, a.innerHTML) ? (fe(a), !0) : (pe && a.nodeType === we.text && (u = a.textContent, Ve([xe, Me, R], (O) => {
1042
+ u = Xe(u, O, " ");
1043
+ }), a.textContent !== u && (Ze(t.removed, {
1000
1044
  element: a.cloneNode()
1001
- }), a.textContent = u)), ke(q.afterSanitizeElements, a, null), !1);
1045
+ }), a.textContent = u)), _e(K.afterSanitizeElements, a, null), !1);
1002
1046
  }, "_sanitizeElements"), zn = /* @__PURE__ */ d(function(a, u, g) {
1003
- if (Se[u] || Tn && (u === "id" || u === "name") && (g in e || g in Ns))
1047
+ if (S[u] || Tn && (u === "id" || u === "name") && (g in e || g in Ns))
1004
1048
  return !1;
1005
- const z = A[u] || Ae.attributeCheck instanceof Function && Ae.attributeCheck(u, a);
1006
- if (!(Ft && !Se[u] && J($t, u))) {
1007
- if (!(yn && J(Pt, u))) {
1008
- if (!z || Se[u]) {
1049
+ const P = q[u] || f.attributeCheck instanceof Function && f.attributeCheck(u, a);
1050
+ if (!(D && !S[u] && te(kt, u))) {
1051
+ if (!(p && te(rt, u))) {
1052
+ if (!P || S[u]) {
1009
1053
  if (
1010
1054
  // First condition does a very basic check if a) it's basically a valid custom element tagname AND
1011
1055
  // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
1012
1056
  // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
1013
- !($n(a) && (P.tagNameCheck instanceof RegExp && J(P.tagNameCheck, a) || P.tagNameCheck instanceof Function && P.tagNameCheck(a)) && (P.attributeNameCheck instanceof RegExp && J(P.attributeNameCheck, u) || P.attributeNameCheck instanceof Function && P.attributeNameCheck(u, a)) || // Alternative, second condition checks if it's an `is`-attribute, AND
1057
+ !($n(a) && (G.tagNameCheck instanceof RegExp && te(G.tagNameCheck, a) || G.tagNameCheck instanceof Function && G.tagNameCheck(a)) && (G.attributeNameCheck instanceof RegExp && te(G.attributeNameCheck, u) || G.attributeNameCheck instanceof Function && G.attributeNameCheck(u, a)) || // Alternative, second condition checks if it's an `is`-attribute, AND
1014
1058
  // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
1015
- u === "is" && P.allowCustomizedBuiltInElements && (P.tagNameCheck instanceof RegExp && J(P.tagNameCheck, g) || P.tagNameCheck instanceof Function && P.tagNameCheck(g)))
1059
+ u === "is" && G.allowCustomizedBuiltInElements && (G.tagNameCheck instanceof RegExp && te(G.tagNameCheck, g) || G.tagNameCheck instanceof Function && G.tagNameCheck(g)))
1016
1060
  ) return !1;
1017
- } else if (!Wt[u]) {
1018
- if (!J(_, Ve(g, nt, ""))) {
1061
+ } else if (!Vt[u]) {
1062
+ if (!te(wt, Xe(g, yt, ""))) {
1019
1063
  if (!((u === "src" || u === "xlink:href" || u === "href") && a !== "script" && Kn(g, "data:") === 0 && En[a])) {
1020
- if (!(wn && !J(Bt, Ve(g, nt, "")))) {
1064
+ if (!(J && !te(vt, Xe(g, yt, "")))) {
1021
1065
  if (g)
1022
1066
  return !1;
1023
1067
  }
@@ -1027,294 +1071,294 @@ function ys() {
1027
1071
  }
1028
1072
  }
1029
1073
  return !0;
1030
- }, "_isValidAttribute"), $s = R({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]), $n = /* @__PURE__ */ d(function(a) {
1031
- return !$s[ht(a)] && J(bt, a);
1074
+ }, "_isValidAttribute"), $s = _({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]), $n = /* @__PURE__ */ d(function(a) {
1075
+ return !$s[gt(a)] && te(Gt, a);
1032
1076
  }, "_isBasicCustomElement"), Pn = /* @__PURE__ */ d(function(a) {
1033
- ke(q.beforeSanitizeAttributes, a, null);
1077
+ _e(K.beforeSanitizeAttributes, a, null);
1034
1078
  const u = a.attributes;
1035
- if (!u || vt(a))
1079
+ if (!u || _t(a))
1036
1080
  return;
1037
1081
  const g = {
1038
1082
  attrName: "",
1039
1083
  attrValue: "",
1040
1084
  keepAttr: !0,
1041
- allowedAttributes: A,
1085
+ allowedAttributes: q,
1042
1086
  forceKeepAttr: void 0
1043
1087
  };
1044
- let z = u.length;
1045
- for (; z--; ) {
1046
- const D = u[z], H = D.name, le = D.namespaceURI, ge = D.value, ue = V(H), Kt = ge;
1047
- let Q = H === "value" ? Kt : bi(Kt);
1048
- if (g.attrName = ue, g.attrValue = Q, g.keepAttr = !0, g.forceKeepAttr = void 0, ke(q.uponSanitizeAttribute, a, g), Q = g.attrValue, Sn && (ue === "id" || ue === "name") && Kn(Q, An) !== 0 && (Le(H, a), Q = An + Q), st && J(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, Q)) {
1049
- Le(H, a);
1088
+ let P = u.length;
1089
+ for (; P--; ) {
1090
+ const O = u[P], H = O.name, ue = O.namespaceURI, ye = O.value, ge = X(H), en = ye;
1091
+ let ee = H === "value" ? en : bi(en);
1092
+ if (g.attrName = ge, g.attrValue = ee, g.keepAttr = !0, g.forceKeepAttr = void 0, _e(K.uponSanitizeAttribute, a, g), ee = g.attrValue, Sn && (ge === "id" || ge === "name") && Kn(ee, An) !== 0 && (ze(H, a), ee = An + ee), Ee && te(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, ee)) {
1093
+ ze(H, a);
1050
1094
  continue;
1051
1095
  }
1052
- if (ue === "attributename" && Xn(Q, "href")) {
1053
- Le(H, a);
1096
+ if (ge === "attributename" && Xn(ee, "href")) {
1097
+ ze(H, a);
1054
1098
  continue;
1055
1099
  }
1056
1100
  if (g.forceKeepAttr)
1057
1101
  continue;
1058
1102
  if (!g.keepAttr) {
1059
- Le(H, a);
1103
+ ze(H, a);
1060
1104
  continue;
1061
1105
  }
1062
- if (!vn && J(/\/>/i, Q)) {
1063
- Le(H, a);
1106
+ if (!Ae && te(/\/>/i, ee)) {
1107
+ ze(H, a);
1064
1108
  continue;
1065
1109
  }
1066
- Ee && qe([Ce, Pe, Be], (Fn) => {
1067
- Q = Ve(Q, Fn, " ");
1110
+ pe && Ve([xe, Me, R], (Fn) => {
1111
+ ee = Xe(ee, Fn, " ");
1068
1112
  });
1069
- const Bn = V(a.nodeName);
1070
- if (!zn(Bn, ue, Q)) {
1071
- Le(H, a);
1113
+ const Bn = X(a.nodeName);
1114
+ if (!zn(Bn, ge, ee)) {
1115
+ ze(H, a);
1072
1116
  continue;
1073
1117
  }
1074
- if (B && typeof m == "object" && typeof m.getAttributeType == "function" && !le)
1075
- switch (m.getAttributeType(Bn, ue)) {
1118
+ if (z && typeof b == "object" && typeof b.getAttributeType == "function" && !ue)
1119
+ switch (b.getAttributeType(Bn, ge)) {
1076
1120
  case "TrustedHTML": {
1077
- Q = B.createHTML(Q);
1121
+ ee = z.createHTML(ee);
1078
1122
  break;
1079
1123
  }
1080
1124
  case "TrustedScriptURL": {
1081
- Q = B.createScriptURL(Q);
1125
+ ee = z.createScriptURL(ee);
1082
1126
  break;
1083
1127
  }
1084
1128
  }
1085
- if (Q !== Kt)
1129
+ if (ee !== en)
1086
1130
  try {
1087
- le ? a.setAttributeNS(le, H, Q) : a.setAttribute(H, Q), vt(a) ? ce(a) : Zn(t.removed);
1131
+ ue ? a.setAttributeNS(ue, H, ee) : a.setAttribute(H, ee), _t(a) ? fe(a) : Zn(t.removed);
1088
1132
  } catch {
1089
- Le(H, a);
1133
+ ze(H, a);
1090
1134
  }
1091
1135
  }
1092
- ke(q.afterSanitizeAttributes, a, null);
1093
- }, "_sanitizeAttributes"), St = /* @__PURE__ */ d(function(a) {
1136
+ _e(K.afterSanitizeAttributes, a, null);
1137
+ }, "_sanitizeAttributes"), It = /* @__PURE__ */ d(function(a) {
1094
1138
  let u = null;
1095
1139
  const g = Ln(a);
1096
- for (ke(q.beforeSanitizeShadowDOM, a, null); u = g.nextNode(); )
1097
- if (ke(q.uponSanitizeShadowNode, u, null), Nn(u), Pn(u), at(u.content) && St(u.content), (U ? U(u) : u.nodeType) === me.element) {
1098
- const D = $ ? $(u) : u.shadowRoot;
1099
- at(D) && (Ge(D), St(D));
1100
- }
1101
- ke(q.afterSanitizeShadowDOM, a, null);
1102
- }, "_sanitizeShadowDOM"), Ge = /* @__PURE__ */ d(function(a) {
1103
- const u = U ? U(a) : a.nodeType;
1104
- if (u === me.element) {
1105
- const D = $ ? $(a) : a.shadowRoot;
1106
- at(D) && (Ge(D), St(D));
1107
- }
1108
- const g = I ? I(a) : a.childNodes;
1140
+ for (_e(K.beforeSanitizeShadowDOM, a, null); u = g.nextNode(); )
1141
+ if (_e(K.uponSanitizeShadowNode, u, null), Nn(u), Pn(u), ut(u.content) && It(u.content), (I ? I(u) : u.nodeType) === we.element) {
1142
+ const O = E ? E(u) : u.shadowRoot;
1143
+ ut(O) && (qe(O), It(O));
1144
+ }
1145
+ _e(K.afterSanitizeShadowDOM, a, null);
1146
+ }, "_sanitizeShadowDOM"), qe = /* @__PURE__ */ d(function(a) {
1147
+ const u = I ? I(a) : a.nodeType;
1148
+ if (u === we.element) {
1149
+ const O = E ? E(a) : a.shadowRoot;
1150
+ ut(O) && (qe(O), It(O));
1151
+ }
1152
+ const g = V ? V(a) : a.childNodes;
1109
1153
  if (!g)
1110
1154
  return;
1111
- const z = [];
1112
- qe(g, (D) => {
1113
- Ye(z, D);
1155
+ const P = [];
1156
+ Ve(g, (O) => {
1157
+ Ze(P, O);
1114
1158
  });
1115
- for (const D of z)
1116
- Ge(D);
1117
- if (u === me.element) {
1118
- const D = X ? X(a) : null;
1119
- if (typeof D == "string" && V(D) === "template") {
1159
+ for (const O of P)
1160
+ qe(O);
1161
+ if (u === we.element) {
1162
+ const O = B ? B(a) : null;
1163
+ if (typeof O == "string" && X(O) === "template") {
1120
1164
  const H = a.content;
1121
- at(H) && Ge(H);
1165
+ ut(H) && qe(H);
1122
1166
  }
1123
1167
  }
1124
1168
  }, "_sanitizeAttachedShadowRoots");
1125
1169
  return t.sanitize = function(x) {
1126
- let a = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, u = null, g = null, z = null, D = null;
1127
- if (qt = !x, qt && (x = "<!-->"), typeof x != "string" && !Tt(x) && (x = vi(x), typeof x != "string"))
1128
- throw ct("dirty is not a string, aborting");
1170
+ let a = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, u = null, g = null, P = null, O = null;
1171
+ if (Zt = !x, Zt && (x = "<!-->"), typeof x != "string" && !Rt(x) && (x = wi(x), typeof x != "string"))
1172
+ throw pt("dirty is not a string, aborting");
1129
1173
  if (!t.isSupported)
1130
1174
  return x;
1131
- if (Ut || Xt(a), t.removed = [], typeof x == "string" && (it = !1), it) {
1132
- const ge = X ? X(x) : x.nodeName;
1133
- if (typeof ge == "string") {
1134
- const ue = V(ge);
1135
- if (!p[ue] || Te[ue])
1136
- throw ct("root node is forbidden and cannot be sanitized in-place");
1137
- }
1138
- if (vt(x))
1139
- throw ct("root node is clobbered and cannot be sanitized in-place");
1140
- Ge(x);
1141
- } else if (Tt(x))
1142
- u = On("<!---->"), g = u.ownerDocument.importNode(x, !0), g.nodeType === me.element && g.nodeName === "BODY" || g.nodeName === "HTML" ? u = g : u.appendChild(g), Ge(g);
1175
+ if (jt || Jt(a), t.removed = [], typeof x == "string" && (ot = !1), ot) {
1176
+ const ye = B ? B(x) : x.nodeName;
1177
+ if (typeof ye == "string") {
1178
+ const ge = X(ye);
1179
+ if (!W[ge] || Ie[ge])
1180
+ throw pt("root node is forbidden and cannot be sanitized in-place");
1181
+ }
1182
+ if (_t(x))
1183
+ throw pt("root node is clobbered and cannot be sanitized in-place");
1184
+ qe(x);
1185
+ } else if (Rt(x))
1186
+ u = On("<!---->"), g = u.ownerDocument.importNode(x, !0), g.nodeType === we.element && g.nodeName === "BODY" || g.nodeName === "HTML" ? u = g : u.appendChild(g), qe(g);
1143
1187
  else {
1144
- if (!Fe && !Ee && !Oe && // eslint-disable-next-line unicorn/prefer-includes
1188
+ if (!He && !pe && !Ne && // eslint-disable-next-line unicorn/prefer-includes
1145
1189
  x.indexOf("<") === -1)
1146
- return B && kt ? B.createHTML(x) : x;
1190
+ return z && St ? z.createHTML(x) : x;
1147
1191
  if (u = On(x), !u)
1148
- return Fe ? null : kt ? ae : "";
1149
- }
1150
- u && Ht && ce(u.firstChild);
1151
- const H = Ln(it ? x : u);
1152
- for (; z = H.nextNode(); )
1153
- Nn(z), Pn(z), at(z.content) && St(z.content);
1154
- if (it)
1155
- return Ee && Mn(x), x;
1156
- if (Fe) {
1157
- if (Ee && Mn(u), xt)
1158
- for (D = gt.call(u.ownerDocument); u.firstChild; )
1159
- D.appendChild(u.firstChild);
1192
+ return He ? null : St ? Z : "";
1193
+ }
1194
+ u && Wt && fe(u.firstChild);
1195
+ const H = Ln(ot ? x : u);
1196
+ for (; P = H.nextNode(); )
1197
+ Nn(P), Pn(P), ut(P.content) && It(P.content);
1198
+ if (ot)
1199
+ return pe && Mn(x), x;
1200
+ if (He) {
1201
+ if (pe && Mn(u), Tt)
1202
+ for (O = it.call(u.ownerDocument); u.firstChild; )
1203
+ O.appendChild(u.firstChild);
1160
1204
  else
1161
- D = u;
1162
- return (A.shadowroot || A.shadowrootmode) && (D = mt.call(n, D, !0)), D;
1163
- }
1164
- let le = Oe ? u.outerHTML : u.innerHTML;
1165
- return Oe && p["!doctype"] && u.ownerDocument && u.ownerDocument.doctype && u.ownerDocument.doctype.name && J(Li, u.ownerDocument.doctype.name) && (le = "<!DOCTYPE " + u.ownerDocument.doctype.name + `>
1166
- ` + le), Ee && qe([Ce, Pe, Be], (ge) => {
1167
- le = Ve(le, ge, " ");
1168
- }), B && kt ? B.createHTML(le) : le;
1205
+ O = u;
1206
+ return (q.shadowroot || q.shadowrootmode) && (O = Ht.call(n, O, !0)), O;
1207
+ }
1208
+ let ue = Ne ? u.outerHTML : u.innerHTML;
1209
+ return Ne && W["!doctype"] && u.ownerDocument && u.ownerDocument.doctype && u.ownerDocument.doctype.name && te(Li, u.ownerDocument.doctype.name) && (ue = "<!DOCTYPE " + u.ownerDocument.doctype.name + `>
1210
+ ` + ue), pe && Ve([xe, Me, R], (ye) => {
1211
+ ue = Xe(ue, ye, " ");
1212
+ }), z && St ? z.createHTML(ue) : ue;
1169
1213
  }, t.setConfig = function() {
1170
1214
  let x = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1171
- Xt(x), Ut = !0;
1215
+ Jt(x), jt = !0;
1172
1216
  }, t.clearConfig = function() {
1173
- je = null, Ut = !1;
1217
+ We = null, jt = !1;
1174
1218
  }, t.isValidAttribute = function(x, a, u) {
1175
- je || Xt({});
1176
- const g = V(x), z = V(a);
1177
- return zn(g, z, u);
1219
+ We || Jt({});
1220
+ const g = X(x), P = X(a);
1221
+ return zn(g, P, u);
1178
1222
  }, t.addHook = function(x, a) {
1179
- typeof a == "function" && Ye(q[x], a);
1223
+ typeof a == "function" && Ze(K[x], a);
1180
1224
  }, t.removeHook = function(x, a) {
1181
1225
  if (a !== void 0) {
1182
- const u = gi(q[x], a);
1183
- return u === -1 ? void 0 : mi(q[x], u, 1)[0];
1226
+ const u = gi(K[x], a);
1227
+ return u === -1 ? void 0 : mi(K[x], u, 1)[0];
1184
1228
  }
1185
- return Zn(q[x]);
1229
+ return Zn(K[x]);
1186
1230
  }, t.removeHooks = function(x) {
1187
- q[x] = [];
1231
+ K[x] = [];
1188
1232
  }, t.removeAllHooks = function() {
1189
- q = rs();
1233
+ K = rs();
1190
1234
  }, t;
1191
1235
  }
1192
- d(ys, "createDOMPurify");
1193
- var $i = ys();
1194
- function un() {
1236
+ d(vs, "createDOMPurify");
1237
+ var $i = vs();
1238
+ function pn() {
1195
1239
  return { async: !1, breaks: !1, extensions: null, gfm: !0, hooks: null, pedantic: !1, renderer: null, silent: !1, tokenizer: null, walkTokens: null };
1196
1240
  }
1197
- d(un, "M");
1198
- var $e = un();
1199
- function ws(i) {
1200
- $e = i;
1241
+ d(pn, "M");
1242
+ var Fe = pn();
1243
+ function ys(r) {
1244
+ Fe = r;
1201
1245
  }
1202
- d(ws, "N");
1203
- var Ne = { exec: /* @__PURE__ */ d(() => null, "exec") };
1204
- function Ze(i) {
1246
+ d(ys, "N");
1247
+ var Pe = { exec: /* @__PURE__ */ d(() => null, "exec") };
1248
+ function Ke(r) {
1205
1249
  let t = [];
1206
1250
  return (e) => {
1207
- let n = Math.max(0, Math.min(3, e - 1)), r = t[n];
1208
- return r || (r = i(n), t[n] = r), r;
1251
+ let n = Math.max(0, Math.min(3, e - 1)), i = t[n];
1252
+ return i || (i = r(n), t[n] = i), i;
1209
1253
  };
1210
1254
  }
1211
- d(Ze, "E");
1212
- function L(i, t = "") {
1213
- let e = typeof i == "string" ? i : i.source, n = { replace: /* @__PURE__ */ d((r, s) => {
1255
+ d(Ke, "E");
1256
+ function N(r, t = "") {
1257
+ let e = typeof r == "string" ? r : r.source, n = { replace: /* @__PURE__ */ d((i, s) => {
1214
1258
  let l = typeof s == "string" ? s : s.source;
1215
- return l = l.replace(te.caret, "$1"), e = e.replace(r, l), n;
1259
+ return l = l.replace(ie.caret, "$1"), e = e.replace(i, l), n;
1216
1260
  }, "replace"), getRegex: /* @__PURE__ */ d(() => new RegExp(e, t), "getRegex") };
1217
1261
  return n;
1218
1262
  }
1219
- d(L, "d");
1220
- var Pi = ((i = "") => {
1263
+ d(N, "d");
1264
+ var Pi = ((r = "") => {
1221
1265
  try {
1222
- return !!new RegExp("(?<=1)(?<!1)" + i);
1266
+ return !!new RegExp("(?<=1)(?<!1)" + r);
1223
1267
  } catch {
1224
1268
  return !1;
1225
1269
  }
1226
- })(), te = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: /* @__PURE__ */ d((i) => new RegExp(`^( {0,3}${i})((?:[ ][^\\n]*)?(?:\\n|$))`), "listItemRegex"), nextBulletRegex: Ze((i) => new RegExp(`^ {0,${i}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)), hrRegex: Ze((i) => new RegExp(`^ {0,${i}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)), fencesBeginRegex: Ze((i) => new RegExp(`^ {0,${i}}(?:\`\`\`|~~~)`)), headingBeginRegex: Ze((i) => new RegExp(`^ {0,${i}}#`)), htmlBeginRegex: Ze((i) => new RegExp(`^ {0,${i}}<(?:[a-z].*>|!--)`, "i")), blockquoteBeginRegex: Ze((i) => new RegExp(`^ {0,${i}}>`)) }, Bi = /^(?:[ \t]*(?:\n|$))+/, Fi = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Ui = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, pt = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Hi = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, hn = / {0,3}(?:[*+-]|\d{1,9}[.)])/, vs = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, Ts = L(vs).replace(/bull/g, hn).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), ji = L(vs).replace(/bull/g, hn).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), dn = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Gi = /^[^\n]+/, pn = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Wi = L(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", pn).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), qi = L(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, hn).getRegex(), Nt = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", fn = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Yi = L("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", fn).replace("tag", Nt).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), Ss = L(dn).replace("hr", pt).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Nt).getRegex(), Vi = L(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Ss).getRegex(), gn = { blockquote: Vi, code: Fi, def: Wi, fences: Ui, heading: Hi, hr: pt, html: Yi, lheading: Ts, list: qi, newline: Bi, paragraph: Ss, table: Ne, text: Gi }, as = L("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", pt).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Nt).getRegex(), Zi = { ...gn, lheading: ji, table: as, paragraph: L(dn).replace("hr", pt).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", as).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Nt).getRegex() }, Xi = { ...gn, html: L(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", fn).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: Ne, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: L(dn).replace("hr", pt).replace("heading", ` *#{1,6} *[^
1227
- ]`).replace("lheading", Ts).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Ki = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Qi = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, As = /^( {2,}|\\)\n(?!\s*$)/, Ji = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, tt = /[\p{P}\p{S}]/u, zt = /[\s\p{P}\p{S}]/u, mn = /[^\s\p{P}\p{S}]/u, er = L(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, zt).getRegex(), Es = /(?!~)[\p{P}\p{S}]/u, tr = /(?!~)[\s\p{P}\p{S}]/u, nr = /(?:[^\s\p{P}\p{S}]|~)/u, sr = L(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", Pi ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), _s = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, ir = L(_s, "u").replace(/punct/g, tt).getRegex(), rr = L(_s, "u").replace(/punct/g, Es).getRegex(), Rs = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", ar = L(Rs, "gu").replace(/notPunctSpace/g, mn).replace(/punctSpace/g, zt).replace(/punct/g, tt).getRegex(), lr = L(Rs, "gu").replace(/notPunctSpace/g, nr).replace(/punctSpace/g, tr).replace(/punct/g, Es).getRegex(), or = L("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, mn).replace(/punctSpace/g, zt).replace(/punct/g, tt).getRegex(), cr = L(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, tt).getRegex(), ur = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", hr = L(ur, "gu").replace(/notPunctSpace/g, mn).replace(/punctSpace/g, zt).replace(/punct/g, tt).getRegex(), dr = L(/\\(punct)/, "gu").replace(/punct/g, tt).getRegex(), pr = L(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), fr = L(fn).replace("(?:-->|$)", "-->").getRegex(), gr = L("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", fr).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), Ct = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, mr = L(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", Ct).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), Is = L(/^!?\[(label)\]\[(ref)\]/).replace("label", Ct).replace("ref", pn).getRegex(), Ds = L(/^!?\[(ref)\](?:\[\])?/).replace("ref", pn).getRegex(), br = L("reflink|nolink(?!\\()", "g").replace("reflink", Is).replace("nolink", Ds).getRegex(), ls = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, bn = { _backpedal: Ne, anyPunctuation: dr, autolink: pr, blockSkip: sr, br: As, code: Qi, del: Ne, delLDelim: Ne, delRDelim: Ne, emStrongLDelim: ir, emStrongRDelimAst: ar, emStrongRDelimUnd: or, escape: Ki, link: mr, nolink: Ds, punctuation: er, reflink: Is, reflinkSearch: br, tag: gr, text: Ji, url: Ne }, xr = { ...bn, link: L(/^!?\[(label)\]\((.*?)\)/).replace("label", Ct).getRegex(), reflink: L(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", Ct).getRegex() }, on = { ...bn, emStrongRDelimAst: lr, emStrongLDelim: rr, delLDelim: cr, delRDelim: hr, url: L(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", ls).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: L(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", ls).getRegex() }, kr = { ...on, br: L(As).replace("{2,}", "*").getRegex(), text: L(on.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, _t = { normal: gn, gfm: Zi, pedantic: Xi }, ut = { normal: bn, gfm: on, breaks: kr, pedantic: xr }, yr = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }, os = /* @__PURE__ */ d((i) => yr[i], "ge");
1228
- function xe(i, t) {
1270
+ })(), ie = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: /* @__PURE__ */ d((r) => new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`), "listItemRegex"), nextBulletRegex: Ke((r) => new RegExp(`^ {0,${r}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)), hrRegex: Ke((r) => new RegExp(`^ {0,${r}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)), fencesBeginRegex: Ke((r) => new RegExp(`^ {0,${r}}(?:\`\`\`|~~~)`)), headingBeginRegex: Ke((r) => new RegExp(`^ {0,${r}}#`)), htmlBeginRegex: Ke((r) => new RegExp(`^ {0,${r}}<(?:[a-z].*>|!--)`, "i")), blockquoteBeginRegex: Ke((r) => new RegExp(`^ {0,${r}}>`)) }, Bi = /^(?:[ \t]*(?:\n|$))+/, Fi = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Ui = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, bt = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Hi = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, fn = / {0,3}(?:[*+-]|\d{1,9}[.)])/, ws = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, Ts = N(ws).replace(/bull/g, fn).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), Gi = N(ws).replace(/bull/g, fn).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), gn = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, ji = /^[^\n]+/, mn = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Wi = N(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", mn).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), qi = N(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, fn).getRegex(), Ft = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", bn = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Yi = N("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", bn).replace("tag", Ft).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), Ss = N(gn).replace("hr", bt).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Ft).getRegex(), Vi = N(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Ss).getRegex(), xn = { blockquote: Vi, code: Fi, def: Wi, fences: Ui, heading: Hi, hr: bt, html: Yi, lheading: Ts, list: qi, newline: Bi, paragraph: Ss, table: Pe, text: ji }, as = N("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", bt).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Ft).getRegex(), Zi = { ...xn, lheading: Gi, table: as, paragraph: N(gn).replace("hr", bt).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", as).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Ft).getRegex() }, Xi = { ...xn, html: N(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", bn).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: Pe, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: N(gn).replace("hr", bt).replace("heading", ` *#{1,6} *[^
1271
+ ]`).replace("lheading", Ts).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Ki = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Qi = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, As = /^( {2,}|\\)\n(?!\s*$)/, Ji = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, st = /[\p{P}\p{S}]/u, Ut = /[\s\p{P}\p{S}]/u, kn = /[^\s\p{P}\p{S}]/u, er = N(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Ut).getRegex(), Es = /(?!~)[\p{P}\p{S}]/u, tr = /(?!~)[\s\p{P}\p{S}]/u, nr = /(?:[^\s\p{P}\p{S}]|~)/u, sr = N(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", Pi ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), _s = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, ir = N(_s, "u").replace(/punct/g, st).getRegex(), rr = N(_s, "u").replace(/punct/g, Es).getRegex(), Rs = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", ar = N(Rs, "gu").replace(/notPunctSpace/g, kn).replace(/punctSpace/g, Ut).replace(/punct/g, st).getRegex(), lr = N(Rs, "gu").replace(/notPunctSpace/g, nr).replace(/punctSpace/g, tr).replace(/punct/g, Es).getRegex(), or = N("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, kn).replace(/punctSpace/g, Ut).replace(/punct/g, st).getRegex(), cr = N(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, st).getRegex(), ur = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", hr = N(ur, "gu").replace(/notPunctSpace/g, kn).replace(/punctSpace/g, Ut).replace(/punct/g, st).getRegex(), dr = N(/\\(punct)/, "gu").replace(/punct/g, st).getRegex(), pr = N(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), fr = N(bn).replace("(?:-->|$)", "-->").getRegex(), gr = N("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", fr).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), zt = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, mr = N(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", zt).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), Is = N(/^!?\[(label)\]\[(ref)\]/).replace("label", zt).replace("ref", mn).getRegex(), Cs = N(/^!?\[(ref)\](?:\[\])?/).replace("ref", mn).getRegex(), br = N("reflink|nolink(?!\\()", "g").replace("reflink", Is).replace("nolink", Cs).getRegex(), ls = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, vn = { _backpedal: Pe, anyPunctuation: dr, autolink: pr, blockSkip: sr, br: As, code: Qi, del: Pe, delLDelim: Pe, delRDelim: Pe, emStrongLDelim: ir, emStrongRDelimAst: ar, emStrongRDelimUnd: or, escape: Ki, link: mr, nolink: Cs, punctuation: er, reflink: Is, reflinkSearch: br, tag: gr, text: Ji, url: Pe }, xr = { ...vn, link: N(/^!?\[(label)\]\((.*?)\)/).replace("label", zt).getRegex(), reflink: N(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", zt).getRegex() }, hn = { ...vn, emStrongRDelimAst: lr, emStrongLDelim: rr, delLDelim: cr, delRDelim: hr, url: N(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", ls).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: N(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", ls).getRegex() }, kr = { ...hn, br: N(As).replace("{2,}", "*").getRegex(), text: N(hn.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, Ot = { normal: xn, gfm: Zi, pedantic: Xi }, ft = { normal: vn, gfm: hn, breaks: kr, pedantic: xr }, vr = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }, os = /* @__PURE__ */ d((r) => vr[r], "ge");
1272
+ function Se(r, t) {
1229
1273
  if (t) {
1230
- if (te.escapeTest.test(i)) return i.replace(te.escapeReplace, os);
1231
- } else if (te.escapeTestNoEncode.test(i)) return i.replace(te.escapeReplaceNoEncode, os);
1232
- return i;
1274
+ if (ie.escapeTest.test(r)) return r.replace(ie.escapeReplace, os);
1275
+ } else if (ie.escapeTestNoEncode.test(r)) return r.replace(ie.escapeReplaceNoEncode, os);
1276
+ return r;
1233
1277
  }
1234
- d(xe, "O");
1235
- function cs(i) {
1278
+ d(Se, "O");
1279
+ function cs(r) {
1236
1280
  try {
1237
- i = encodeURI(i).replace(te.percentDecode, "%");
1281
+ r = encodeURI(r).replace(ie.percentDecode, "%");
1238
1282
  } catch {
1239
1283
  return null;
1240
1284
  }
1241
- return i;
1285
+ return r;
1242
1286
  }
1243
1287
  d(cs, "V");
1244
- function us(i, t) {
1245
- let e = i.replace(te.findPipe, (s, l, o) => {
1288
+ function us(r, t) {
1289
+ let e = r.replace(ie.findPipe, (s, l, o) => {
1246
1290
  let h = !1, c = l;
1247
1291
  for (; --c >= 0 && o[c] === "\\"; ) h = !h;
1248
1292
  return h ? "|" : " |";
1249
- }), n = e.split(te.splitPipe), r = 0;
1293
+ }), n = e.split(ie.splitPipe), i = 0;
1250
1294
  if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), t) if (n.length > t) n.splice(t);
1251
1295
  else for (; n.length < t; ) n.push("");
1252
- for (; r < n.length; r++) n[r] = n[r].trim().replace(te.slashPipe, "|");
1296
+ for (; i < n.length; i++) n[i] = n[i].trim().replace(ie.slashPipe, "|");
1253
1297
  return n;
1254
1298
  }
1255
1299
  d(us, "Y");
1256
- function _e(i, t, e) {
1257
- let n = i.length;
1300
+ function Ce(r, t, e) {
1301
+ let n = r.length;
1258
1302
  if (n === 0) return "";
1259
- let r = 0;
1260
- for (; r < n && i.charAt(n - r - 1) === t; )
1261
- r++;
1262
- return i.slice(0, n - r);
1303
+ let i = 0;
1304
+ for (; i < n && r.charAt(n - i - 1) === t; )
1305
+ i++;
1306
+ return r.slice(0, n - i);
1263
1307
  }
1264
- d(_e, "$");
1265
- function hs(i) {
1266
- let t = i.split(`
1308
+ d(Ce, "$");
1309
+ function hs(r) {
1310
+ let t = r.split(`
1267
1311
  `), e = t.length - 1;
1268
- for (; e >= 0 && te.blankLine.test(t[e]); ) e--;
1269
- return t.length - e <= 2 ? i : t.slice(0, e + 1).join(`
1312
+ for (; e >= 0 && ie.blankLine.test(t[e]); ) e--;
1313
+ return t.length - e <= 2 ? r : t.slice(0, e + 1).join(`
1270
1314
  `);
1271
1315
  }
1272
1316
  d(hs, "ee");
1273
- function wr(i, t) {
1274
- if (i.indexOf(t[1]) === -1) return -1;
1317
+ function yr(r, t) {
1318
+ if (r.indexOf(t[1]) === -1) return -1;
1275
1319
  let e = 0;
1276
- for (let n = 0; n < i.length; n++) if (i[n] === "\\") n++;
1277
- else if (i[n] === t[0]) e++;
1278
- else if (i[n] === t[1] && (e--, e < 0)) return n;
1320
+ for (let n = 0; n < r.length; n++) if (r[n] === "\\") n++;
1321
+ else if (r[n] === t[0]) e++;
1322
+ else if (r[n] === t[1] && (e--, e < 0)) return n;
1279
1323
  return e > 0 ? -2 : -1;
1280
1324
  }
1281
- d(wr, "fe");
1282
- function vr(i, t = 0) {
1325
+ d(yr, "fe");
1326
+ function wr(r, t = 0) {
1283
1327
  let e = t, n = "";
1284
- for (let r of i) if (r === " ") {
1328
+ for (let i of r) if (i === " ") {
1285
1329
  let s = 4 - e % 4;
1286
1330
  n += " ".repeat(s), e += s;
1287
- } else n += r, e++;
1331
+ } else n += i, e++;
1288
1332
  return n;
1289
1333
  }
1290
- d(vr, "me");
1291
- function ds(i, t, e, n, r) {
1292
- let s = t.href, l = t.title || null, o = i[1].replace(r.other.outputLinkReplace, "$1");
1334
+ d(wr, "me");
1335
+ function ds(r, t, e, n, i) {
1336
+ let s = t.href, l = t.title || null, o = r[1].replace(i.other.outputLinkReplace, "$1");
1293
1337
  n.state.inLink = !0;
1294
- let h = { type: i[0].charAt(0) === "!" ? "image" : "link", raw: e, href: s, title: l, text: o, tokens: n.inlineTokens(o) };
1338
+ let h = { type: r[0].charAt(0) === "!" ? "image" : "link", raw: e, href: s, title: l, text: o, tokens: n.inlineTokens(o) };
1295
1339
  return n.state.inLink = !1, h;
1296
1340
  }
1297
1341
  d(ds, "xe");
1298
- function Tr(i, t, e) {
1299
- let n = i.match(e.other.indentCodeCompensation);
1342
+ function Tr(r, t, e) {
1343
+ let n = r.match(e.other.indentCodeCompensation);
1300
1344
  if (n === null) return t;
1301
- let r = n[1];
1345
+ let i = n[1];
1302
1346
  return t.split(`
1303
1347
  `).map((s) => {
1304
1348
  let l = s.match(e.other.beginningSpace);
1305
1349
  if (l === null) return s;
1306
1350
  let [o] = l;
1307
- return o.length >= r.length ? s.slice(r.length) : s;
1351
+ return o.length >= i.length ? s.slice(i.length) : s;
1308
1352
  }).join(`
1309
1353
  `);
1310
1354
  }
1311
1355
  d(Tr, "st");
1312
- var Ke, Ot = (Ke = class {
1356
+ var Je, $t = (Je = class {
1313
1357
  constructor(t) {
1314
1358
  C(this, "options");
1315
1359
  C(this, "rules");
1316
1360
  C(this, "lexer");
1317
- this.options = t || $e;
1361
+ this.options = t || Fe;
1318
1362
  }
1319
1363
  space(t) {
1320
1364
  let e = this.rules.block.newline.exec(t);
@@ -1323,15 +1367,15 @@ var Ke, Ot = (Ke = class {
1323
1367
  code(t) {
1324
1368
  let e = this.rules.block.code.exec(t);
1325
1369
  if (e) {
1326
- let n = this.options.pedantic ? e[0] : hs(e[0]), r = n.replace(this.rules.other.codeRemoveIndent, "");
1327
- return { type: "code", raw: n, codeBlockStyle: "indented", text: r };
1370
+ let n = this.options.pedantic ? e[0] : hs(e[0]), i = n.replace(this.rules.other.codeRemoveIndent, "");
1371
+ return { type: "code", raw: n, codeBlockStyle: "indented", text: i };
1328
1372
  }
1329
1373
  }
1330
1374
  fences(t) {
1331
1375
  let e = this.rules.block.fences.exec(t);
1332
1376
  if (e) {
1333
- let n = e[0], r = Tr(n, e[3] || "", this.rules);
1334
- return { type: "code", raw: n, lang: e[2] ? e[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : e[2], text: r };
1377
+ let n = e[0], i = Tr(n, e[3] || "", this.rules);
1378
+ return { type: "code", raw: n, lang: e[2] ? e[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : e[2], text: i };
1335
1379
  }
1336
1380
  }
1337
1381
  heading(t) {
@@ -1339,90 +1383,90 @@ var Ke, Ot = (Ke = class {
1339
1383
  if (e) {
1340
1384
  let n = e[2].trim();
1341
1385
  if (this.rules.other.endingHash.test(n)) {
1342
- let r = _e(n, "#");
1343
- (this.options.pedantic || !r || this.rules.other.endingSpaceChar.test(r)) && (n = r.trim());
1386
+ let i = Ce(n, "#");
1387
+ (this.options.pedantic || !i || this.rules.other.endingSpaceChar.test(i)) && (n = i.trim());
1344
1388
  }
1345
- return { type: "heading", raw: _e(e[0], `
1389
+ return { type: "heading", raw: Ce(e[0], `
1346
1390
  `), depth: e[1].length, text: n, tokens: this.lexer.inline(n) };
1347
1391
  }
1348
1392
  }
1349
1393
  hr(t) {
1350
1394
  let e = this.rules.block.hr.exec(t);
1351
- if (e) return { type: "hr", raw: _e(e[0], `
1395
+ if (e) return { type: "hr", raw: Ce(e[0], `
1352
1396
  `) };
1353
1397
  }
1354
1398
  blockquote(t) {
1355
1399
  let e = this.rules.block.blockquote.exec(t);
1356
1400
  if (e) {
1357
- let n = _e(e[0], `
1401
+ let n = Ce(e[0], `
1358
1402
  `).split(`
1359
- `), r = "", s = "", l = [];
1403
+ `), i = "", s = "", l = [];
1360
1404
  for (; n.length > 0; ) {
1361
1405
  let o = !1, h = [], c;
1362
1406
  for (c = 0; c < n.length; c++) if (this.rules.other.blockquoteStart.test(n[c])) h.push(n[c]), o = !0;
1363
1407
  else if (!o) h.push(n[c]);
1364
1408
  else break;
1365
1409
  n = n.slice(c);
1366
- let k = h.join(`
1367
- `), m = k.replace(this.rules.other.blockquoteSetextReplace, `
1410
+ let m = h.join(`
1411
+ `), b = m.replace(this.rules.other.blockquoteSetextReplace, `
1368
1412
  $1`).replace(this.rules.other.blockquoteSetextReplace2, "");
1369
- r = r ? `${r}
1370
- ${k}` : k, s = s ? `${s}
1371
- ${m}` : m;
1372
- let b = this.lexer.state.top;
1373
- if (this.lexer.state.top = !0, this.lexer.blockTokens(m, l, !0), this.lexer.state.top = b, n.length === 0) break;
1413
+ i = i ? `${i}
1414
+ ${m}` : m, s = s ? `${s}
1415
+ ${b}` : b;
1416
+ let k = this.lexer.state.top;
1417
+ if (this.lexer.state.top = !0, this.lexer.blockTokens(b, l, !0), this.lexer.state.top = k, n.length === 0) break;
1374
1418
  let T = l.at(-1);
1375
1419
  if (T?.type === "code") break;
1376
1420
  if (T?.type === "blockquote") {
1377
- let F = T, y = F.raw + `
1421
+ let F = T, M = F.raw + `
1378
1422
  ` + n.join(`
1379
- `), I = this.blockquote(y);
1380
- l[l.length - 1] = I, r = r.substring(0, r.length - F.raw.length) + I.raw, s = s.substring(0, s.length - F.text.length) + I.text;
1423
+ `), V = this.blockquote(M);
1424
+ l[l.length - 1] = V, i = i.substring(0, i.length - F.raw.length) + V.raw, s = s.substring(0, s.length - F.text.length) + V.text;
1381
1425
  break;
1382
1426
  } else if (T?.type === "list") {
1383
- let F = T, y = F.raw + `
1427
+ let F = T, M = F.raw + `
1384
1428
  ` + n.join(`
1385
- `), I = this.list(y);
1386
- l[l.length - 1] = I, r = r.substring(0, r.length - T.raw.length) + I.raw, s = s.substring(0, s.length - F.raw.length) + I.raw, n = y.substring(l.at(-1).raw.length).split(`
1429
+ `), V = this.list(M);
1430
+ l[l.length - 1] = V, i = i.substring(0, i.length - T.raw.length) + V.raw, s = s.substring(0, s.length - F.raw.length) + V.raw, n = M.substring(l.at(-1).raw.length).split(`
1387
1431
  `);
1388
1432
  continue;
1389
1433
  }
1390
1434
  }
1391
- return { type: "blockquote", raw: r, tokens: l, text: s };
1435
+ return { type: "blockquote", raw: i, tokens: l, text: s };
1392
1436
  }
1393
1437
  }
1394
1438
  list(t) {
1395
1439
  let e = this.rules.block.list.exec(t);
1396
1440
  if (e) {
1397
- let n = e[1].trim(), r = n.length > 1, s = { type: "list", raw: "", ordered: r, start: r ? +n.slice(0, -1) : "", loose: !1, items: [] };
1398
- n = r ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = r ? n : "[*+-]");
1441
+ let n = e[1].trim(), i = n.length > 1, s = { type: "list", raw: "", ordered: i, start: i ? +n.slice(0, -1) : "", loose: !1, items: [] };
1442
+ n = i ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = i ? n : "[*+-]");
1399
1443
  let l = this.rules.other.listItemRegex(n), o = !1;
1400
1444
  for (; t; ) {
1401
- let c = !1, k = "", m = "";
1445
+ let c = !1, m = "", b = "";
1402
1446
  if (!(e = l.exec(t)) || this.rules.block.hr.test(t)) break;
1403
- k = e[0], t = t.substring(k.length);
1404
- let b = vr(e[2].split(`
1447
+ m = e[0], t = t.substring(m.length);
1448
+ let k = wr(e[2].split(`
1405
1449
  `, 1)[0], e[1].length), T = t.split(`
1406
- `, 1)[0], F = !b.trim(), y = 0;
1407
- if (this.options.pedantic ? (y = 2, m = b.trimStart()) : F ? y = e[1].length + 1 : (y = b.search(this.rules.other.nonSpaceChar), y = y > 4 ? 1 : y, m = b.slice(y), y += e[1].length), F && this.rules.other.blankLine.test(T) && (k += T + `
1450
+ `, 1)[0], F = !k.trim(), M = 0;
1451
+ if (this.options.pedantic ? (M = 2, b = k.trimStart()) : F ? M = e[1].length + 1 : (M = k.search(this.rules.other.nonSpaceChar), M = M > 4 ? 1 : M, b = k.slice(M), M += e[1].length), F && this.rules.other.blankLine.test(T) && (m += T + `
1408
1452
  `, t = t.substring(T.length + 1), c = !0), !c) {
1409
- let I = this.rules.other.nextBulletRegex(y), M = this.rules.other.hrRegex(y), $ = this.rules.other.fencesBeginRegex(y), W = this.rules.other.headingBeginRegex(y), U = this.rules.other.htmlBeginRegex(y), X = this.rules.other.blockquoteBeginRegex(y);
1453
+ let V = this.rules.other.nextBulletRegex(M), oe = this.rules.other.hrRegex(M), E = this.rules.other.fencesBeginRegex(M), L = this.rules.other.headingBeginRegex(M), I = this.rules.other.htmlBeginRegex(M), B = this.rules.other.blockquoteBeginRegex(M);
1410
1454
  for (; t; ) {
1411
- let B = t.split(`
1412
- `, 1)[0], ae;
1413
- if (T = B, this.options.pedantic ? (T = T.replace(this.rules.other.listReplaceNesting, " "), ae = T) : ae = T.replace(this.rules.other.tabCharGlobal, " "), $.test(T) || W.test(T) || U.test(T) || X.test(T) || I.test(T) || M.test(T)) break;
1414
- if (ae.search(this.rules.other.nonSpaceChar) >= y || !T.trim()) m += `
1415
- ` + ae.slice(y);
1455
+ let z = t.split(`
1456
+ `, 1)[0], Z;
1457
+ if (T = z, this.options.pedantic ? (T = T.replace(this.rules.other.listReplaceNesting, " "), Z = T) : Z = T.replace(this.rules.other.tabCharGlobal, " "), E.test(T) || L.test(T) || I.test(T) || B.test(T) || V.test(T) || oe.test(T)) break;
1458
+ if (Z.search(this.rules.other.nonSpaceChar) >= M || !T.trim()) b += `
1459
+ ` + Z.slice(M);
1416
1460
  else {
1417
- if (F || b.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || $.test(b) || W.test(b) || M.test(b)) break;
1418
- m += `
1461
+ if (F || k.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || E.test(k) || L.test(k) || oe.test(k)) break;
1462
+ b += `
1419
1463
  ` + T;
1420
1464
  }
1421
- F = !T.trim(), k += B + `
1422
- `, t = t.substring(B.length + 1), b = ae.slice(y);
1465
+ F = !T.trim(), m += z + `
1466
+ `, t = t.substring(z.length + 1), k = Z.slice(M);
1423
1467
  }
1424
1468
  }
1425
- s.loose || (o ? s.loose = !0 : this.rules.other.doubleBlankLine.test(k) && (o = !0)), s.items.push({ type: "list_item", raw: k, task: !!this.options.gfm && this.rules.other.listIsTask.test(m), loose: !1, text: m, tokens: [] }), s.raw += k;
1469
+ s.loose || (o ? s.loose = !0 : this.rules.other.doubleBlankLine.test(m) && (o = !0)), s.items.push({ type: "list_item", raw: m, task: !!this.options.gfm && this.rules.other.listIsTask.test(b), loose: !1, text: b, tokens: [] }), s.raw += m;
1426
1470
  }
1427
1471
  let h = s.items.at(-1);
1428
1472
  if (h) h.raw = h.raw.trimEnd(), h.text = h.text.trimEnd();
@@ -1430,27 +1474,27 @@ ${m}` : m;
1430
1474
  s.raw = s.raw.trimEnd();
1431
1475
  for (let c of s.items) {
1432
1476
  this.lexer.state.top = !1, c.tokens = this.lexer.blockTokens(c.text, []);
1433
- let k = c.tokens[0];
1434
- if (c.task && (k?.type === "text" || k?.type === "paragraph")) {
1435
- c.text = c.text.replace(this.rules.other.listReplaceTask, ""), k.raw = k.raw.replace(this.rules.other.listReplaceTask, ""), k.text = k.text.replace(this.rules.other.listReplaceTask, "");
1436
- for (let b = this.lexer.inlineQueue.length - 1; b >= 0; b--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[b].src)) {
1437
- this.lexer.inlineQueue[b].src = this.lexer.inlineQueue[b].src.replace(this.rules.other.listReplaceTask, "");
1477
+ let m = c.tokens[0];
1478
+ if (c.task && (m?.type === "text" || m?.type === "paragraph")) {
1479
+ c.text = c.text.replace(this.rules.other.listReplaceTask, ""), m.raw = m.raw.replace(this.rules.other.listReplaceTask, ""), m.text = m.text.replace(this.rules.other.listReplaceTask, "");
1480
+ for (let k = this.lexer.inlineQueue.length - 1; k >= 0; k--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[k].src)) {
1481
+ this.lexer.inlineQueue[k].src = this.lexer.inlineQueue[k].src.replace(this.rules.other.listReplaceTask, "");
1438
1482
  break;
1439
1483
  }
1440
- let m = this.rules.other.listTaskCheckbox.exec(c.raw);
1441
- if (m) {
1442
- let b = { type: "checkbox", raw: m[0] + " ", checked: m[0] !== "[ ]" };
1443
- c.checked = b.checked, s.loose ? c.tokens[0] && ["paragraph", "text"].includes(c.tokens[0].type) && "tokens" in c.tokens[0] && c.tokens[0].tokens ? (c.tokens[0].raw = b.raw + c.tokens[0].raw, c.tokens[0].text = b.raw + c.tokens[0].text, c.tokens[0].tokens.unshift(b)) : c.tokens.unshift({ type: "paragraph", raw: b.raw, text: b.raw, tokens: [b] }) : c.tokens.unshift(b);
1484
+ let b = this.rules.other.listTaskCheckbox.exec(c.raw);
1485
+ if (b) {
1486
+ let k = { type: "checkbox", raw: b[0] + " ", checked: b[0] !== "[ ]" };
1487
+ c.checked = k.checked, s.loose ? c.tokens[0] && ["paragraph", "text"].includes(c.tokens[0].type) && "tokens" in c.tokens[0] && c.tokens[0].tokens ? (c.tokens[0].raw = k.raw + c.tokens[0].raw, c.tokens[0].text = k.raw + c.tokens[0].text, c.tokens[0].tokens.unshift(k)) : c.tokens.unshift({ type: "paragraph", raw: k.raw, text: k.raw, tokens: [k] }) : c.tokens.unshift(k);
1444
1488
  }
1445
1489
  } else c.task && (c.task = !1);
1446
1490
  if (!s.loose) {
1447
- let m = c.tokens.filter((T) => T.type === "space"), b = m.length > 0 && m.some((T) => this.rules.other.anyLine.test(T.raw));
1448
- s.loose = b;
1491
+ let b = c.tokens.filter((T) => T.type === "space"), k = b.length > 0 && b.some((T) => this.rules.other.anyLine.test(T.raw));
1492
+ s.loose = k;
1449
1493
  }
1450
1494
  }
1451
1495
  if (s.loose) for (let c of s.items) {
1452
1496
  c.loose = !0;
1453
- for (let k of c.tokens) k.type === "text" && (k.type = "paragraph");
1497
+ for (let m of c.tokens) m.type === "text" && (m.type = "paragraph");
1454
1498
  }
1455
1499
  return s;
1456
1500
  }
@@ -1465,19 +1509,19 @@ ${m}` : m;
1465
1509
  def(t) {
1466
1510
  let e = this.rules.block.def.exec(t);
1467
1511
  if (e) {
1468
- let n = e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "), r = e[2] ? e[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", s = e[3] ? e[3].substring(1, e[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : e[3];
1469
- return { type: "def", tag: n, raw: _e(e[0], `
1470
- `), href: r, title: s };
1512
+ let n = e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "), i = e[2] ? e[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", s = e[3] ? e[3].substring(1, e[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : e[3];
1513
+ return { type: "def", tag: n, raw: Ce(e[0], `
1514
+ `), href: i, title: s };
1471
1515
  }
1472
1516
  }
1473
1517
  table(t) {
1474
1518
  let e = this.rules.block.table.exec(t);
1475
1519
  if (!e || !this.rules.other.tableDelimiter.test(e[2])) return;
1476
- let n = us(e[1]), r = e[2].replace(this.rules.other.tableAlignChars, "").split("|"), s = e[3]?.trim() ? e[3].replace(this.rules.other.tableRowBlankLine, "").split(`
1477
- `) : [], l = { type: "table", raw: _e(e[0], `
1520
+ let n = us(e[1]), i = e[2].replace(this.rules.other.tableAlignChars, "").split("|"), s = e[3]?.trim() ? e[3].replace(this.rules.other.tableRowBlankLine, "").split(`
1521
+ `) : [], l = { type: "table", raw: Ce(e[0], `
1478
1522
  `), header: [], align: [], rows: [] };
1479
- if (n.length === r.length) {
1480
- for (let o of r) this.rules.other.tableAlignRight.test(o) ? l.align.push("right") : this.rules.other.tableAlignCenter.test(o) ? l.align.push("center") : this.rules.other.tableAlignLeft.test(o) ? l.align.push("left") : l.align.push(null);
1523
+ if (n.length === i.length) {
1524
+ for (let o of i) this.rules.other.tableAlignRight.test(o) ? l.align.push("right") : this.rules.other.tableAlignCenter.test(o) ? l.align.push("center") : this.rules.other.tableAlignLeft.test(o) ? l.align.push("left") : l.align.push(null);
1481
1525
  for (let o = 0; o < n.length; o++) l.header.push({ text: n[o], tokens: this.lexer.inline(n[o]), header: !0, align: l.align[o] });
1482
1526
  for (let o of s) l.rows.push(us(o, l.header.length).map((h, c) => ({ text: h, tokens: this.lexer.inline(h), header: !1, align: l.align[c] })));
1483
1527
  return l;
@@ -1487,7 +1531,7 @@ ${m}` : m;
1487
1531
  let e = this.rules.block.lheading.exec(t);
1488
1532
  if (e) {
1489
1533
  let n = e[1].trim();
1490
- return { type: "heading", raw: _e(e[0], `
1534
+ return { type: "heading", raw: Ce(e[0], `
1491
1535
  `), depth: e[2].charAt(0) === "=" ? 1 : 2, text: n, tokens: this.lexer.inline(n) };
1492
1536
  }
1493
1537
  }
@@ -1517,28 +1561,28 @@ ${m}` : m;
1517
1561
  let n = e[2].trim();
1518
1562
  if (!this.options.pedantic && this.rules.other.startAngleBracket.test(n)) {
1519
1563
  if (!this.rules.other.endAngleBracket.test(n)) return;
1520
- let l = _e(n.slice(0, -1), "\\");
1564
+ let l = Ce(n.slice(0, -1), "\\");
1521
1565
  if ((n.length - l.length) % 2 === 0) return;
1522
1566
  } else {
1523
- let l = wr(e[2], "()");
1567
+ let l = yr(e[2], "()");
1524
1568
  if (l === -2) return;
1525
1569
  if (l > -1) {
1526
1570
  let o = (e[0].indexOf("!") === 0 ? 5 : 4) + e[1].length + l;
1527
1571
  e[2] = e[2].substring(0, l), e[0] = e[0].substring(0, o).trim(), e[3] = "";
1528
1572
  }
1529
1573
  }
1530
- let r = e[2], s = "";
1574
+ let i = e[2], s = "";
1531
1575
  if (this.options.pedantic) {
1532
- let l = this.rules.other.pedanticHrefTitle.exec(r);
1533
- l && (r = l[1], s = l[3]);
1576
+ let l = this.rules.other.pedanticHrefTitle.exec(i);
1577
+ l && (i = l[1], s = l[3]);
1534
1578
  } else s = e[3] ? e[3].slice(1, -1) : "";
1535
- return r = r.trim(), this.rules.other.startAngleBracket.test(r) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? r = r.slice(1) : r = r.slice(1, -1)), ds(e, { href: r && r.replace(this.rules.inline.anyPunctuation, "$1"), title: s && s.replace(this.rules.inline.anyPunctuation, "$1") }, e[0], this.lexer, this.rules);
1579
+ return i = i.trim(), this.rules.other.startAngleBracket.test(i) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? i = i.slice(1) : i = i.slice(1, -1)), ds(e, { href: i && i.replace(this.rules.inline.anyPunctuation, "$1"), title: s && s.replace(this.rules.inline.anyPunctuation, "$1") }, e[0], this.lexer, this.rules);
1536
1580
  }
1537
1581
  }
1538
1582
  reflink(t, e) {
1539
1583
  let n;
1540
1584
  if ((n = this.rules.inline.reflink.exec(t)) || (n = this.rules.inline.nolink.exec(t))) {
1541
- let r = (n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "), s = e[r.toLowerCase()];
1585
+ let i = (n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "), s = e[i.toLowerCase()];
1542
1586
  if (!s) {
1543
1587
  let l = n[0].charAt(0);
1544
1588
  return { type: "text", raw: l, text: l };
@@ -1547,35 +1591,35 @@ ${m}` : m;
1547
1591
  }
1548
1592
  }
1549
1593
  emStrong(t, e, n = "") {
1550
- let r = this.rules.inline.emStrongLDelim.exec(t);
1551
- if (!(!r || !r[1] && !r[2] && !r[3] && !r[4] || r[4] && n.match(this.rules.other.unicodeAlphaNumeric)) && (!(r[1] || r[3]) || !n || this.rules.inline.punctuation.exec(n))) {
1552
- let s = [...r[0]].length - 1, l, o, h = s, c = 0, k = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
1553
- for (k.lastIndex = 0, e = e.slice(-1 * t.length + s); (r = k.exec(e)) !== null; ) {
1554
- if (l = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !l) continue;
1555
- if (o = [...l].length, r[3] || r[4]) {
1594
+ let i = this.rules.inline.emStrongLDelim.exec(t);
1595
+ if (!(!i || !i[1] && !i[2] && !i[3] && !i[4] || i[4] && n.match(this.rules.other.unicodeAlphaNumeric)) && (!(i[1] || i[3]) || !n || this.rules.inline.punctuation.exec(n))) {
1596
+ let s = [...i[0]].length - 1, l, o, h = s, c = 0, m = i[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
1597
+ for (m.lastIndex = 0, e = e.slice(-1 * t.length + s); (i = m.exec(e)) !== null; ) {
1598
+ if (l = i[1] || i[2] || i[3] || i[4] || i[5] || i[6], !l) continue;
1599
+ if (o = [...l].length, i[3] || i[4]) {
1556
1600
  h += o;
1557
1601
  continue;
1558
- } else if ((r[5] || r[6]) && s % 3 && !((s + o) % 3)) {
1602
+ } else if ((i[5] || i[6]) && s % 3 && !((s + o) % 3)) {
1559
1603
  c += o;
1560
1604
  continue;
1561
1605
  }
1562
1606
  if (h -= o, h > 0) continue;
1563
1607
  o = Math.min(o, o + h + c);
1564
- let m = [...r[0]][0].length, b = t.slice(0, s + r.index + m + o);
1608
+ let b = [...i[0]][0].length, k = t.slice(0, s + i.index + b + o);
1565
1609
  if (Math.min(s, o) % 2) {
1566
- let F = b.slice(1, -1);
1567
- return { type: "em", raw: b, text: F, tokens: this.lexer.inlineTokens(F) };
1610
+ let F = k.slice(1, -1);
1611
+ return { type: "em", raw: k, text: F, tokens: this.lexer.inlineTokens(F) };
1568
1612
  }
1569
- let T = b.slice(2, -2);
1570
- return { type: "strong", raw: b, text: T, tokens: this.lexer.inlineTokens(T) };
1613
+ let T = k.slice(2, -2);
1614
+ return { type: "strong", raw: k, text: T, tokens: this.lexer.inlineTokens(T) };
1571
1615
  }
1572
1616
  }
1573
1617
  }
1574
1618
  codespan(t) {
1575
1619
  let e = this.rules.inline.code.exec(t);
1576
1620
  if (e) {
1577
- let n = e[2].replace(this.rules.other.newLineCharGlobal, " "), r = this.rules.other.nonSpaceChar.test(n), s = this.rules.other.startingSpaceChar.test(n) && this.rules.other.endingSpaceChar.test(n);
1578
- return r && s && (n = n.substring(1, n.length - 1)), { type: "codespan", raw: e[0], text: n };
1621
+ let n = e[2].replace(this.rules.other.newLineCharGlobal, " "), i = this.rules.other.nonSpaceChar.test(n), s = this.rules.other.startingSpaceChar.test(n) && this.rules.other.endingSpaceChar.test(n);
1622
+ return i && s && (n = n.substring(1, n.length - 1)), { type: "codespan", raw: e[0], text: n };
1579
1623
  }
1580
1624
  }
1581
1625
  br(t) {
@@ -1583,42 +1627,42 @@ ${m}` : m;
1583
1627
  if (e) return { type: "br", raw: e[0] };
1584
1628
  }
1585
1629
  del(t, e, n = "") {
1586
- let r = this.rules.inline.delLDelim.exec(t);
1587
- if (r && (!r[1] || !n || this.rules.inline.punctuation.exec(n))) {
1588
- let s = [...r[0]].length - 1, l, o, h = s, c = this.rules.inline.delRDelim;
1589
- for (c.lastIndex = 0, e = e.slice(-1 * t.length + s); (r = c.exec(e)) !== null; ) {
1590
- if (l = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !l || (o = [...l].length, o !== s)) continue;
1591
- if (r[3] || r[4]) {
1630
+ let i = this.rules.inline.delLDelim.exec(t);
1631
+ if (i && (!i[1] || !n || this.rules.inline.punctuation.exec(n))) {
1632
+ let s = [...i[0]].length - 1, l, o, h = s, c = this.rules.inline.delRDelim;
1633
+ for (c.lastIndex = 0, e = e.slice(-1 * t.length + s); (i = c.exec(e)) !== null; ) {
1634
+ if (l = i[1] || i[2] || i[3] || i[4] || i[5] || i[6], !l || (o = [...l].length, o !== s)) continue;
1635
+ if (i[3] || i[4]) {
1592
1636
  h += o;
1593
1637
  continue;
1594
1638
  }
1595
1639
  if (h -= o, h > 0) continue;
1596
1640
  o = Math.min(o, o + h);
1597
- let k = [...r[0]][0].length, m = t.slice(0, s + r.index + k + o), b = m.slice(s, -s);
1598
- return { type: "del", raw: m, text: b, tokens: this.lexer.inlineTokens(b) };
1641
+ let m = [...i[0]][0].length, b = t.slice(0, s + i.index + m + o), k = b.slice(s, -s);
1642
+ return { type: "del", raw: b, text: k, tokens: this.lexer.inlineTokens(k) };
1599
1643
  }
1600
1644
  }
1601
1645
  }
1602
1646
  autolink(t) {
1603
1647
  let e = this.rules.inline.autolink.exec(t);
1604
1648
  if (e) {
1605
- let n, r;
1606
- return e[2] === "@" ? (n = e[1], r = "mailto:" + n) : (n = e[1], r = n), { type: "link", raw: e[0], text: n, href: r, tokens: [{ type: "text", raw: n, text: n }] };
1649
+ let n, i;
1650
+ return e[2] === "@" ? (n = e[1], i = "mailto:" + n) : (n = e[1], i = n), { type: "link", raw: e[0], text: n, href: i, tokens: [{ type: "text", raw: n, text: n }] };
1607
1651
  }
1608
1652
  }
1609
1653
  url(t) {
1610
1654
  let e;
1611
1655
  if (e = this.rules.inline.url.exec(t)) {
1612
- let n, r;
1613
- if (e[2] === "@") n = e[0], r = "mailto:" + n;
1656
+ let n, i;
1657
+ if (e[2] === "@") n = e[0], i = "mailto:" + n;
1614
1658
  else {
1615
1659
  let s;
1616
1660
  do
1617
1661
  s = e[0], e[0] = this.rules.inline._backpedal.exec(e[0])?.[0] ?? "";
1618
1662
  while (s !== e[0]);
1619
- n = e[0], e[1] === "www." ? r = "http://" + e[0] : r = e[0];
1663
+ n = e[0], e[1] === "www." ? i = "http://" + e[0] : i = e[0];
1620
1664
  }
1621
- return { type: "link", raw: e[0], text: n, href: r, tokens: [{ type: "text", raw: n, text: n }] };
1665
+ return { type: "link", raw: e[0], text: n, href: i, tokens: [{ type: "text", raw: n, text: n }] };
1622
1666
  }
1623
1667
  }
1624
1668
  inlineText(t) {
@@ -1628,28 +1672,28 @@ ${m}` : m;
1628
1672
  return { type: "text", raw: e[0], text: e[0], escaped: n };
1629
1673
  }
1630
1674
  }
1631
- }, d(Ke, "w"), Ke), Ie, he = (Ie = class {
1675
+ }, d(Je, "w"), Je), Oe, me = (Oe = class {
1632
1676
  constructor(t) {
1633
1677
  C(this, "tokens");
1634
1678
  C(this, "options");
1635
1679
  C(this, "state");
1636
1680
  C(this, "inlineQueue");
1637
1681
  C(this, "tokenizer");
1638
- this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = t || $e, this.options.tokenizer = this.options.tokenizer || new Ot(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 };
1639
- let e = { other: te, block: _t.normal, inline: ut.normal };
1640
- this.options.pedantic ? (e.block = _t.pedantic, e.inline = ut.pedantic) : this.options.gfm && (e.block = _t.gfm, this.options.breaks ? e.inline = ut.breaks : e.inline = ut.gfm), this.tokenizer.rules = e;
1682
+ this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = t || Fe, this.options.tokenizer = this.options.tokenizer || new $t(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 };
1683
+ let e = { other: ie, block: Ot.normal, inline: ft.normal };
1684
+ this.options.pedantic ? (e.block = Ot.pedantic, e.inline = ft.pedantic) : this.options.gfm && (e.block = Ot.gfm, this.options.breaks ? e.inline = ft.breaks : e.inline = ft.gfm), this.tokenizer.rules = e;
1641
1685
  }
1642
1686
  static get rules() {
1643
- return { block: _t, inline: ut };
1687
+ return { block: Ot, inline: ft };
1644
1688
  }
1645
1689
  static lex(t, e) {
1646
- return new Ie(e).lex(t);
1690
+ return new Oe(e).lex(t);
1647
1691
  }
1648
1692
  static lexInline(t, e) {
1649
- return new Ie(e).inlineTokens(t);
1693
+ return new Oe(e).inlineTokens(t);
1650
1694
  }
1651
1695
  lex(t) {
1652
- t = t.replace(te.carriageReturn, `
1696
+ t = t.replace(ie.carriageReturn, `
1653
1697
  `), this.blockTokens(t, this.tokens);
1654
1698
  for (let e = 0; e < this.inlineQueue.length; e++) {
1655
1699
  let n = this.inlineQueue[e];
@@ -1658,10 +1702,10 @@ ${m}` : m;
1658
1702
  return this.inlineQueue = [], this.tokens;
1659
1703
  }
1660
1704
  blockTokens(t, e = [], n = !1) {
1661
- this.tokenizer.lexer = this, this.options.pedantic && (t = t.replace(te.tabCharGlobal, " ").replace(te.spaceLine, ""));
1662
- let r = 1 / 0;
1705
+ this.tokenizer.lexer = this, this.options.pedantic && (t = t.replace(ie.tabCharGlobal, " ").replace(ie.spaceLine, ""));
1706
+ let i = 1 / 0;
1663
1707
  for (; t; ) {
1664
- if (t.length < r) r = t.length;
1708
+ if (t.length < i) i = t.length;
1665
1709
  else {
1666
1710
  this.infiniteLoopError(t.charCodeAt(0));
1667
1711
  break;
@@ -1728,8 +1772,8 @@ ${m}` : m;
1728
1772
  let l = t;
1729
1773
  if (this.options.extensions?.startBlock) {
1730
1774
  let o = 1 / 0, h = t.slice(1), c;
1731
- this.options.extensions.startBlock.forEach((k) => {
1732
- c = k.call({ lexer: this }, h), typeof c == "number" && c >= 0 && (o = Math.min(o, c));
1775
+ this.options.extensions.startBlock.forEach((m) => {
1776
+ c = m.call({ lexer: this }, h), typeof c == "number" && c >= 0 && (o = Math.min(o, c));
1733
1777
  }), o < 1 / 0 && o >= 0 && (l = t.substring(0, o + 1));
1734
1778
  }
1735
1779
  if (this.state.top && (s = this.tokenizer.paragraph(l))) {
@@ -1761,14 +1805,14 @@ ${m}` : m;
1761
1805
  }
1762
1806
  inlineTokens(t, e = []) {
1763
1807
  this.tokenizer.lexer = this;
1764
- let n = t, r = null;
1808
+ let n = t, i = null;
1765
1809
  if (this.tokens.links) {
1766
1810
  let c = Object.keys(this.tokens.links);
1767
- if (c.length > 0) for (; (r = this.tokenizer.rules.inline.reflinkSearch.exec(n)) !== null; ) c.includes(r[0].slice(r[0].lastIndexOf("[") + 1, -1)) && (n = n.slice(0, r.index) + "[" + "a".repeat(r[0].length - 2) + "]" + n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
1811
+ if (c.length > 0) for (; (i = this.tokenizer.rules.inline.reflinkSearch.exec(n)) !== null; ) c.includes(i[0].slice(i[0].lastIndexOf("[") + 1, -1)) && (n = n.slice(0, i.index) + "[" + "a".repeat(i[0].length - 2) + "]" + n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
1768
1812
  }
1769
- for (; (r = this.tokenizer.rules.inline.anyPunctuation.exec(n)) !== null; ) n = n.slice(0, r.index) + "++" + n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
1813
+ for (; (i = this.tokenizer.rules.inline.anyPunctuation.exec(n)) !== null; ) n = n.slice(0, i.index) + "++" + n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
1770
1814
  let s;
1771
- for (; (r = this.tokenizer.rules.inline.blockSkip.exec(n)) !== null; ) s = r[2] ? r[2].length : 0, n = n.slice(0, r.index + s) + "[" + "a".repeat(r[0].length - s - 2) + "]" + n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
1815
+ for (; (i = this.tokenizer.rules.inline.blockSkip.exec(n)) !== null; ) s = i[2] ? i[2].length : 0, n = n.slice(0, i.index + s) + "[" + "a".repeat(i[0].length - s - 2) + "]" + n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
1772
1816
  n = this.options.hooks?.emStrongMask?.call({ lexer: this }, n) ?? n;
1773
1817
  let l = !1, o = "", h = 1 / 0;
1774
1818
  for (; t; ) {
@@ -1779,7 +1823,7 @@ ${m}` : m;
1779
1823
  }
1780
1824
  l || (o = ""), l = !1;
1781
1825
  let c;
1782
- if (this.options.extensions?.inline?.some((m) => (c = m.call({ lexer: this }, t, e)) ? (t = t.substring(c.raw.length), e.push(c), !0) : !1)) continue;
1826
+ if (this.options.extensions?.inline?.some((b) => (c = b.call({ lexer: this }, t, e)) ? (t = t.substring(c.raw.length), e.push(c), !0) : !1)) continue;
1783
1827
  if (c = this.tokenizer.escape(t)) {
1784
1828
  t = t.substring(c.raw.length), e.push(c);
1785
1829
  continue;
@@ -1794,8 +1838,8 @@ ${m}` : m;
1794
1838
  }
1795
1839
  if (c = this.tokenizer.reflink(t, this.tokens.links)) {
1796
1840
  t = t.substring(c.raw.length);
1797
- let m = e.at(-1);
1798
- c.type === "text" && m?.type === "text" ? (m.raw += c.raw, m.text += c.text) : e.push(c);
1841
+ let b = e.at(-1);
1842
+ c.type === "text" && b?.type === "text" ? (b.raw += c.raw, b.text += c.text) : e.push(c);
1799
1843
  continue;
1800
1844
  }
1801
1845
  if (c = this.tokenizer.emStrong(t, n, o)) {
@@ -1822,17 +1866,17 @@ ${m}` : m;
1822
1866
  t = t.substring(c.raw.length), e.push(c);
1823
1867
  continue;
1824
1868
  }
1825
- let k = t;
1869
+ let m = t;
1826
1870
  if (this.options.extensions?.startInline) {
1827
- let m = 1 / 0, b = t.slice(1), T;
1871
+ let b = 1 / 0, k = t.slice(1), T;
1828
1872
  this.options.extensions.startInline.forEach((F) => {
1829
- T = F.call({ lexer: this }, b), typeof T == "number" && T >= 0 && (m = Math.min(m, T));
1830
- }), m < 1 / 0 && m >= 0 && (k = t.substring(0, m + 1));
1873
+ T = F.call({ lexer: this }, k), typeof T == "number" && T >= 0 && (b = Math.min(b, T));
1874
+ }), b < 1 / 0 && b >= 0 && (m = t.substring(0, b + 1));
1831
1875
  }
1832
- if (c = this.tokenizer.inlineText(k)) {
1876
+ if (c = this.tokenizer.inlineText(m)) {
1833
1877
  t = t.substring(c.raw.length), c.raw.slice(-1) !== "_" && (o = c.raw.slice(-1)), l = !0;
1834
- let m = e.at(-1);
1835
- m?.type === "text" ? (m.raw += c.raw, m.text += c.text) : e.push(c);
1878
+ let b = e.at(-1);
1879
+ b?.type === "text" ? (b.raw += c.raw, b.text += c.text) : e.push(c);
1836
1880
  continue;
1837
1881
  }
1838
1882
  if (t) {
@@ -1847,20 +1891,20 @@ ${m}` : m;
1847
1891
  if (this.options.silent) console.error(e);
1848
1892
  else throw new Error(e);
1849
1893
  }
1850
- }, d(Ie, "l"), Ie), Qe, Lt = (Qe = class {
1894
+ }, d(Oe, "l"), Oe), et, Pt = (et = class {
1851
1895
  constructor(t) {
1852
1896
  C(this, "options");
1853
1897
  C(this, "parser");
1854
- this.options = t || $e;
1898
+ this.options = t || Fe;
1855
1899
  }
1856
1900
  space(t) {
1857
1901
  return "";
1858
1902
  }
1859
1903
  code({ text: t, lang: e, escaped: n }) {
1860
- let r = (e || "").match(te.notSpaceStart)?.[0], s = t.replace(te.endingNewline, "") + `
1904
+ let i = (e || "").match(ie.notSpaceStart)?.[0], s = t.replace(ie.endingNewline, "") + `
1861
1905
  `;
1862
- return r ? '<pre><code class="language-' + xe(r) + '">' + (n ? s : xe(s, !0)) + `</code></pre>
1863
- ` : "<pre><code>" + (n ? s : xe(s, !0)) + `</code></pre>
1906
+ return i ? '<pre><code class="language-' + Se(i) + '">' + (n ? s : Se(s, !0)) + `</code></pre>
1907
+ ` : "<pre><code>" + (n ? s : Se(s, !0)) + `</code></pre>
1864
1908
  `;
1865
1909
  }
1866
1910
  blockquote({ tokens: t }) {
@@ -1883,14 +1927,14 @@ ${this.parser.parse(t)}</blockquote>
1883
1927
  `;
1884
1928
  }
1885
1929
  list(t) {
1886
- let e = t.ordered, n = t.start, r = "";
1930
+ let e = t.ordered, n = t.start, i = "";
1887
1931
  for (let o = 0; o < t.items.length; o++) {
1888
1932
  let h = t.items[o];
1889
- r += this.listitem(h);
1933
+ i += this.listitem(h);
1890
1934
  }
1891
1935
  let s = e ? "ol" : "ul", l = e && n !== 1 ? ' start="' + n + '"' : "";
1892
1936
  return "<" + s + l + `>
1893
- ` + r + "</" + s + `>
1937
+ ` + i + "</" + s + `>
1894
1938
  `;
1895
1939
  }
1896
1940
  listitem(t) {
@@ -1908,17 +1952,17 @@ ${this.parser.parse(t)}</blockquote>
1908
1952
  let e = "", n = "";
1909
1953
  for (let s = 0; s < t.header.length; s++) n += this.tablecell(t.header[s]);
1910
1954
  e += this.tablerow({ text: n });
1911
- let r = "";
1955
+ let i = "";
1912
1956
  for (let s = 0; s < t.rows.length; s++) {
1913
1957
  let l = t.rows[s];
1914
1958
  n = "";
1915
1959
  for (let o = 0; o < l.length; o++) n += this.tablecell(l[o]);
1916
- r += this.tablerow({ text: n });
1960
+ i += this.tablerow({ text: n });
1917
1961
  }
1918
- return r && (r = `<tbody>${r}</tbody>`), `<table>
1962
+ return i && (i = `<tbody>${i}</tbody>`), `<table>
1919
1963
  <thead>
1920
1964
  ` + e + `</thead>
1921
- ` + r + `</table>
1965
+ ` + i + `</table>
1922
1966
  `;
1923
1967
  }
1924
1968
  tablerow({ text: t }) {
@@ -1938,7 +1982,7 @@ ${t}</tr>
1938
1982
  return `<em>${this.parser.parseInline(t)}</em>`;
1939
1983
  }
1940
1984
  codespan({ text: t }) {
1941
- return `<code>${xe(t, !0)}</code>`;
1985
+ return `<code>${Se(t, !0)}</code>`;
1942
1986
  }
1943
1987
  br(t) {
1944
1988
  return "<br>";
@@ -1947,24 +1991,24 @@ ${t}</tr>
1947
1991
  return `<del>${this.parser.parseInline(t)}</del>`;
1948
1992
  }
1949
1993
  link({ href: t, title: e, tokens: n }) {
1950
- let r = this.parser.parseInline(n), s = cs(t);
1951
- if (s === null) return r;
1994
+ let i = this.parser.parseInline(n), s = cs(t);
1995
+ if (s === null) return i;
1952
1996
  t = s;
1953
1997
  let l = '<a href="' + t + '"';
1954
- return e && (l += ' title="' + xe(e) + '"'), l += ">" + r + "</a>", l;
1998
+ return e && (l += ' title="' + Se(e) + '"'), l += ">" + i + "</a>", l;
1955
1999
  }
1956
- image({ href: t, title: e, text: n, tokens: r }) {
1957
- r && (n = this.parser.parseInline(r, this.parser.textRenderer));
2000
+ image({ href: t, title: e, text: n, tokens: i }) {
2001
+ i && (n = this.parser.parseInline(i, this.parser.textRenderer));
1958
2002
  let s = cs(t);
1959
- if (s === null) return xe(n);
2003
+ if (s === null) return Se(n);
1960
2004
  t = s;
1961
- let l = `<img src="${t}" alt="${xe(n)}"`;
1962
- return e && (l += ` title="${xe(e)}"`), l += ">", l;
2005
+ let l = `<img src="${t}" alt="${Se(n)}"`;
2006
+ return e && (l += ` title="${Se(e)}"`), l += ">", l;
1963
2007
  }
1964
2008
  text(t) {
1965
- return "tokens" in t && t.tokens ? this.parser.parseInline(t.tokens) : "escaped" in t && t.escaped ? t.text : xe(t.text);
2009
+ return "tokens" in t && t.tokens ? this.parser.parseInline(t.tokens) : "escaped" in t && t.escaped ? t.text : Se(t.text);
1966
2010
  }
1967
- }, d(Qe, "y"), Qe), Je, xn = (Je = class {
2011
+ }, d(et, "y"), et), tt, yn = (tt = class {
1968
2012
  strong({ text: t }) {
1969
2013
  return t;
1970
2014
  }
@@ -1995,32 +2039,32 @@ ${t}</tr>
1995
2039
  checkbox({ raw: t }) {
1996
2040
  return t;
1997
2041
  }
1998
- }, d(Je, "L"), Je), De, de = (De = class {
2042
+ }, d(tt, "L"), tt), Le, be = (Le = class {
1999
2043
  constructor(t) {
2000
2044
  C(this, "options");
2001
2045
  C(this, "renderer");
2002
2046
  C(this, "textRenderer");
2003
- this.options = t || $e, this.options.renderer = this.options.renderer || new Lt(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new xn();
2047
+ this.options = t || Fe, this.options.renderer = this.options.renderer || new Pt(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new yn();
2004
2048
  }
2005
2049
  static parse(t, e) {
2006
- return new De(e).parse(t);
2050
+ return new Le(e).parse(t);
2007
2051
  }
2008
2052
  static parseInline(t, e) {
2009
- return new De(e).parseInline(t);
2053
+ return new Le(e).parseInline(t);
2010
2054
  }
2011
2055
  parse(t) {
2012
2056
  this.renderer.parser = this;
2013
2057
  let e = "";
2014
2058
  for (let n = 0; n < t.length; n++) {
2015
- let r = t[n];
2016
- if (this.options.extensions?.renderers?.[r.type]) {
2017
- let l = r, o = this.options.extensions.renderers[l.type].call({ parser: this }, l);
2059
+ let i = t[n];
2060
+ if (this.options.extensions?.renderers?.[i.type]) {
2061
+ let l = i, o = this.options.extensions.renderers[l.type].call({ parser: this }, l);
2018
2062
  if (o !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "def", "paragraph", "text"].includes(l.type)) {
2019
2063
  e += o || "";
2020
2064
  continue;
2021
2065
  }
2022
2066
  }
2023
- let s = r;
2067
+ let s = i;
2024
2068
  switch (s.type) {
2025
2069
  case "space": {
2026
2070
  e += this.renderer.space(s);
@@ -2082,8 +2126,8 @@ ${t}</tr>
2082
2126
  parseInline(t, e = this.renderer) {
2083
2127
  this.renderer.parser = this;
2084
2128
  let n = "";
2085
- for (let r = 0; r < t.length; r++) {
2086
- let s = t[r];
2129
+ for (let i = 0; i < t.length; i++) {
2130
+ let s = t[i];
2087
2131
  if (this.options.extensions?.renderers?.[s.type]) {
2088
2132
  let o = this.options.extensions.renderers[s.type].call({ parser: this }, s);
2089
2133
  if (o !== !1 || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(s.type)) {
@@ -2146,11 +2190,11 @@ ${t}</tr>
2146
2190
  }
2147
2191
  return n;
2148
2192
  }
2149
- }, d(De, "l"), De), Re, dt = (Re = class {
2193
+ }, d(Le, "l"), Le), De, mt = (De = class {
2150
2194
  constructor(t) {
2151
2195
  C(this, "options");
2152
2196
  C(this, "block");
2153
- this.options = t || $e;
2197
+ this.options = t || Fe;
2154
2198
  }
2155
2199
  preprocess(t) {
2156
2200
  return t;
@@ -2165,41 +2209,41 @@ ${t}</tr>
2165
2209
  return t;
2166
2210
  }
2167
2211
  provideLexer(t = this.block) {
2168
- return t ? he.lex : he.lexInline;
2212
+ return t ? me.lex : me.lexInline;
2169
2213
  }
2170
2214
  provideParser(t = this.block) {
2171
- return t ? de.parse : de.parseInline;
2215
+ return t ? be.parse : be.parseInline;
2172
2216
  }
2173
- }, d(Re, "P"), C(Re, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"])), C(Re, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), Re), et, Sr = (et = class {
2217
+ }, d(De, "P"), C(De, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"])), C(De, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), De), nt, Sr = (nt = class {
2174
2218
  constructor(...t) {
2175
- C(this, "defaults", un());
2219
+ C(this, "defaults", pn());
2176
2220
  C(this, "options", this.setOptions);
2177
2221
  C(this, "parse", this.parseMarkdown(!0));
2178
2222
  C(this, "parseInline", this.parseMarkdown(!1));
2179
- C(this, "Parser", de);
2180
- C(this, "Renderer", Lt);
2181
- C(this, "TextRenderer", xn);
2182
- C(this, "Lexer", he);
2183
- C(this, "Tokenizer", Ot);
2184
- C(this, "Hooks", dt);
2223
+ C(this, "Parser", be);
2224
+ C(this, "Renderer", Pt);
2225
+ C(this, "TextRenderer", yn);
2226
+ C(this, "Lexer", me);
2227
+ C(this, "Tokenizer", $t);
2228
+ C(this, "Hooks", mt);
2185
2229
  this.use(...t);
2186
2230
  }
2187
2231
  walkTokens(t, e) {
2188
2232
  let n = [];
2189
- for (let r of t) switch (n = n.concat(e.call(this, r)), r.type) {
2233
+ for (let i of t) switch (n = n.concat(e.call(this, i)), i.type) {
2190
2234
  case "table": {
2191
- let s = r;
2235
+ let s = i;
2192
2236
  for (let l of s.header) n = n.concat(this.walkTokens(l.tokens, e));
2193
2237
  for (let l of s.rows) for (let o of l) n = n.concat(this.walkTokens(o.tokens, e));
2194
2238
  break;
2195
2239
  }
2196
2240
  case "list": {
2197
- let s = r;
2241
+ let s = i;
2198
2242
  n = n.concat(this.walkTokens(s.items, e));
2199
2243
  break;
2200
2244
  }
2201
2245
  default: {
2202
- let s = r;
2246
+ let s = i;
2203
2247
  this.defaults.extensions?.childTokens?.[s.type] ? this.defaults.extensions.childTokens[s.type].forEach((l) => {
2204
2248
  let o = s[l].flat(1 / 0);
2205
2249
  n = n.concat(this.walkTokens(o, e));
@@ -2211,8 +2255,8 @@ ${t}</tr>
2211
2255
  use(...t) {
2212
2256
  let e = this.defaults.extensions || { renderers: {}, childTokens: {} };
2213
2257
  return t.forEach((n) => {
2214
- let r = { ...n };
2215
- if (r.async = this.defaults.async || r.async || !1, n.extensions && (n.extensions.forEach((s) => {
2258
+ let i = { ...n };
2259
+ if (i.async = this.defaults.async || i.async || !1, n.extensions && (n.extensions.forEach((s) => {
2216
2260
  if (!s.name) throw new Error("extension name required");
2217
2261
  if ("renderer" in s) {
2218
2262
  let l = e.renderers[s.name];
@@ -2227,92 +2271,92 @@ ${t}</tr>
2227
2271
  l ? l.unshift(s.tokenizer) : e[s.level] = [s.tokenizer], s.start && (s.level === "block" ? e.startBlock ? e.startBlock.push(s.start) : e.startBlock = [s.start] : s.level === "inline" && (e.startInline ? e.startInline.push(s.start) : e.startInline = [s.start]));
2228
2272
  }
2229
2273
  "childTokens" in s && s.childTokens && (e.childTokens[s.name] = s.childTokens);
2230
- }), r.extensions = e), n.renderer) {
2231
- let s = this.defaults.renderer || new Lt(this.defaults);
2274
+ }), i.extensions = e), n.renderer) {
2275
+ let s = this.defaults.renderer || new Pt(this.defaults);
2232
2276
  for (let l in n.renderer) {
2233
2277
  if (!(l in s)) throw new Error(`renderer '${l}' does not exist`);
2234
2278
  if (["options", "parser"].includes(l)) continue;
2235
2279
  let o = l, h = n.renderer[o], c = s[o];
2236
- s[o] = (...k) => {
2237
- let m = h.apply(s, k);
2238
- return m === !1 && (m = c.apply(s, k)), m || "";
2280
+ s[o] = (...m) => {
2281
+ let b = h.apply(s, m);
2282
+ return b === !1 && (b = c.apply(s, m)), b || "";
2239
2283
  };
2240
2284
  }
2241
- r.renderer = s;
2285
+ i.renderer = s;
2242
2286
  }
2243
2287
  if (n.tokenizer) {
2244
- let s = this.defaults.tokenizer || new Ot(this.defaults);
2288
+ let s = this.defaults.tokenizer || new $t(this.defaults);
2245
2289
  for (let l in n.tokenizer) {
2246
2290
  if (!(l in s)) throw new Error(`tokenizer '${l}' does not exist`);
2247
2291
  if (["options", "rules", "lexer"].includes(l)) continue;
2248
2292
  let o = l, h = n.tokenizer[o], c = s[o];
2249
- s[o] = (...k) => {
2250
- let m = h.apply(s, k);
2251
- return m === !1 && (m = c.apply(s, k)), m;
2293
+ s[o] = (...m) => {
2294
+ let b = h.apply(s, m);
2295
+ return b === !1 && (b = c.apply(s, m)), b;
2252
2296
  };
2253
2297
  }
2254
- r.tokenizer = s;
2298
+ i.tokenizer = s;
2255
2299
  }
2256
2300
  if (n.hooks) {
2257
- let s = this.defaults.hooks || new dt();
2301
+ let s = this.defaults.hooks || new mt();
2258
2302
  for (let l in n.hooks) {
2259
2303
  if (!(l in s)) throw new Error(`hook '${l}' does not exist`);
2260
2304
  if (["options", "block"].includes(l)) continue;
2261
2305
  let o = l, h = n.hooks[o], c = s[o];
2262
- dt.passThroughHooks.has(l) ? s[o] = (k) => {
2263
- if (this.defaults.async && dt.passThroughHooksRespectAsync.has(l)) return (async () => {
2264
- let b = await h.call(s, k);
2265
- return c.call(s, b);
2306
+ mt.passThroughHooks.has(l) ? s[o] = (m) => {
2307
+ if (this.defaults.async && mt.passThroughHooksRespectAsync.has(l)) return (async () => {
2308
+ let k = await h.call(s, m);
2309
+ return c.call(s, k);
2266
2310
  })();
2267
- let m = h.call(s, k);
2268
- return c.call(s, m);
2269
- } : s[o] = (...k) => {
2311
+ let b = h.call(s, m);
2312
+ return c.call(s, b);
2313
+ } : s[o] = (...m) => {
2270
2314
  if (this.defaults.async) return (async () => {
2271
- let b = await h.apply(s, k);
2272
- return b === !1 && (b = await c.apply(s, k)), b;
2315
+ let k = await h.apply(s, m);
2316
+ return k === !1 && (k = await c.apply(s, m)), k;
2273
2317
  })();
2274
- let m = h.apply(s, k);
2275
- return m === !1 && (m = c.apply(s, k)), m;
2318
+ let b = h.apply(s, m);
2319
+ return b === !1 && (b = c.apply(s, m)), b;
2276
2320
  };
2277
2321
  }
2278
- r.hooks = s;
2322
+ i.hooks = s;
2279
2323
  }
2280
2324
  if (n.walkTokens) {
2281
2325
  let s = this.defaults.walkTokens, l = n.walkTokens;
2282
- r.walkTokens = function(o) {
2326
+ i.walkTokens = function(o) {
2283
2327
  let h = [];
2284
2328
  return h.push(l.call(this, o)), s && (h = h.concat(s.call(this, o))), h;
2285
2329
  };
2286
2330
  }
2287
- this.defaults = { ...this.defaults, ...r };
2331
+ this.defaults = { ...this.defaults, ...i };
2288
2332
  }), this;
2289
2333
  }
2290
2334
  setOptions(t) {
2291
2335
  return this.defaults = { ...this.defaults, ...t }, this;
2292
2336
  }
2293
2337
  lexer(t, e) {
2294
- return he.lex(t, e ?? this.defaults);
2338
+ return me.lex(t, e ?? this.defaults);
2295
2339
  }
2296
2340
  parser(t, e) {
2297
- return de.parse(t, e ?? this.defaults);
2341
+ return be.parse(t, e ?? this.defaults);
2298
2342
  }
2299
2343
  parseMarkdown(t) {
2300
2344
  return (e, n) => {
2301
- let r = { ...n }, s = { ...this.defaults, ...r }, l = this.onError(!!s.silent, !!s.async);
2302
- if (this.defaults.async === !0 && r.async === !1) return l(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
2345
+ let i = { ...n }, s = { ...this.defaults, ...i }, l = this.onError(!!s.silent, !!s.async);
2346
+ if (this.defaults.async === !0 && i.async === !1) return l(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
2303
2347
  if (typeof e > "u" || e === null) return l(new Error("marked(): input parameter is undefined or null"));
2304
2348
  if (typeof e != "string") return l(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(e) + ", string expected"));
2305
2349
  if (s.hooks && (s.hooks.options = s, s.hooks.block = t), s.async) return (async () => {
2306
- let o = s.hooks ? await s.hooks.preprocess(e) : e, h = await (s.hooks ? await s.hooks.provideLexer(t) : t ? he.lex : he.lexInline)(o, s), c = s.hooks ? await s.hooks.processAllTokens(h) : h;
2350
+ let o = s.hooks ? await s.hooks.preprocess(e) : e, h = await (s.hooks ? await s.hooks.provideLexer(t) : t ? me.lex : me.lexInline)(o, s), c = s.hooks ? await s.hooks.processAllTokens(h) : h;
2307
2351
  s.walkTokens && await Promise.all(this.walkTokens(c, s.walkTokens));
2308
- let k = await (s.hooks ? await s.hooks.provideParser(t) : t ? de.parse : de.parseInline)(c, s);
2309
- return s.hooks ? await s.hooks.postprocess(k) : k;
2352
+ let m = await (s.hooks ? await s.hooks.provideParser(t) : t ? be.parse : be.parseInline)(c, s);
2353
+ return s.hooks ? await s.hooks.postprocess(m) : m;
2310
2354
  })().catch(l);
2311
2355
  try {
2312
2356
  s.hooks && (e = s.hooks.preprocess(e));
2313
- let o = (s.hooks ? s.hooks.provideLexer(t) : t ? he.lex : he.lexInline)(e, s);
2357
+ let o = (s.hooks ? s.hooks.provideLexer(t) : t ? me.lex : me.lexInline)(e, s);
2314
2358
  s.hooks && (o = s.hooks.processAllTokens(o)), s.walkTokens && this.walkTokens(o, s.walkTokens);
2315
- let h = (s.hooks ? s.hooks.provideParser(t) : t ? de.parse : de.parseInline)(o, s);
2359
+ let h = (s.hooks ? s.hooks.provideParser(t) : t ? be.parse : be.parseInline)(o, s);
2316
2360
  return s.hooks && (h = s.hooks.postprocess(h)), h;
2317
2361
  } catch (o) {
2318
2362
  return l(o);
@@ -2323,57 +2367,57 @@ ${t}</tr>
2323
2367
  return (n) => {
2324
2368
  if (n.message += `
2325
2369
  Please report this to https://github.com/markedjs/marked.`, t) {
2326
- let r = "<p>An error occurred:</p><pre>" + xe(n.message + "", !0) + "</pre>";
2327
- return e ? Promise.resolve(r) : r;
2370
+ let i = "<p>An error occurred:</p><pre>" + Se(n.message + "", !0) + "</pre>";
2371
+ return e ? Promise.resolve(i) : i;
2328
2372
  }
2329
2373
  if (e) return Promise.reject(n);
2330
2374
  throw n;
2331
2375
  };
2332
2376
  }
2333
- }, d(et, "q"), et), ze = new Sr();
2334
- function N(i, t) {
2335
- return ze.parse(i, t);
2377
+ }, d(nt, "q"), nt), Be = new Sr();
2378
+ function $(r, t) {
2379
+ return Be.parse(r, t);
2336
2380
  }
2337
- d(N, "g");
2338
- N.options = N.setOptions = function(i) {
2339
- return ze.setOptions(i), N.defaults = ze.defaults, ws(N.defaults), N;
2381
+ d($, "g");
2382
+ $.options = $.setOptions = function(r) {
2383
+ return Be.setOptions(r), $.defaults = Be.defaults, ys($.defaults), $;
2340
2384
  };
2341
- N.getDefaults = un;
2342
- N.defaults = $e;
2343
- N.use = function(...i) {
2344
- return ze.use(...i), N.defaults = ze.defaults, ws(N.defaults), N;
2385
+ $.getDefaults = pn;
2386
+ $.defaults = Fe;
2387
+ $.use = function(...r) {
2388
+ return Be.use(...r), $.defaults = Be.defaults, ys($.defaults), $;
2345
2389
  };
2346
- N.walkTokens = function(i, t) {
2347
- return ze.walkTokens(i, t);
2390
+ $.walkTokens = function(r, t) {
2391
+ return Be.walkTokens(r, t);
2348
2392
  };
2349
- N.parseInline = ze.parseInline;
2350
- N.Parser = de;
2351
- N.parser = de.parse;
2352
- N.Renderer = Lt;
2353
- N.TextRenderer = xn;
2354
- N.Lexer = he;
2355
- N.lexer = he.lex;
2356
- N.Tokenizer = Ot;
2357
- N.Hooks = dt;
2358
- N.parse = N;
2359
- N.options;
2360
- N.setOptions;
2361
- N.use;
2362
- N.walkTokens;
2363
- N.parseInline;
2364
- de.parse;
2365
- he.lex;
2366
- const Ar = ["innerHTML"], Rt = /* @__PURE__ */ ye({
2393
+ $.parseInline = Be.parseInline;
2394
+ $.Parser = be;
2395
+ $.parser = be.parse;
2396
+ $.Renderer = Pt;
2397
+ $.TextRenderer = yn;
2398
+ $.Lexer = me;
2399
+ $.lexer = me.lex;
2400
+ $.Tokenizer = $t;
2401
+ $.Hooks = mt;
2402
+ $.parse = $;
2403
+ $.options;
2404
+ $.setOptions;
2405
+ $.use;
2406
+ $.walkTokens;
2407
+ $.parseInline;
2408
+ be.parse;
2409
+ me.lex;
2410
+ const Ar = ["innerHTML"], Lt = /* @__PURE__ */ Re({
2367
2411
  __name: "ChatRichText",
2368
2412
  props: {
2369
2413
  text: {},
2370
2414
  inverted: { type: Boolean },
2371
2415
  streaming: { type: Boolean }
2372
2416
  },
2373
- setup(i) {
2374
- const t = i, e = ps(t.text);
2417
+ setup(r) {
2418
+ const t = r, e = ps(t.text);
2375
2419
  let n;
2376
- It(
2420
+ Mt(
2377
2421
  [() => t.text, () => t.streaming],
2378
2422
  ([l, o]) => {
2379
2423
  if (!o) {
@@ -2387,8 +2431,8 @@ const Ar = ["innerHTML"], Rt = /* @__PURE__ */ ye({
2387
2431
  ), fs(() => {
2388
2432
  n !== void 0 && cancelAnimationFrame(n);
2389
2433
  });
2390
- const r = new N.Renderer();
2391
- r.link = ({ href: l, text: o }) => {
2434
+ const i = new $.Renderer();
2435
+ i.link = ({ href: l, text: o }) => {
2392
2436
  const h = l.trim();
2393
2437
  if (!h || h === "#")
2394
2438
  return o;
@@ -2400,23 +2444,23 @@ const Ar = ["innerHTML"], Rt = /* @__PURE__ */ ye({
2400
2444
  c = !1;
2401
2445
  }
2402
2446
  return c ? `<a href="${l}">${o}</a>` : `<a href="${l}" target="_blank" rel="noopener noreferrer">${o}</a>`;
2403
- }, N.setOptions({ breaks: !0, gfm: !0, renderer: r });
2404
- const s = j(() => {
2447
+ }, $.setOptions({ breaks: !0, gfm: !0, renderer: i });
2448
+ const s = U(() => {
2405
2449
  const l = e.value;
2406
2450
  if (!l) return "";
2407
- const o = N.parse(l, { async: !1 });
2451
+ const o = $.parse(l, { async: !1 });
2408
2452
  return $i.sanitize(o, { ADD_ATTR: ["target"], ADD_DATA_URI_TAGS: ["img"] });
2409
2453
  });
2410
- return (l, o) => (v(), S("div", {
2411
- class: E(["chat-msg-prose break-words text-[14px] leading-relaxed @sm/chat:text-[15px] @sm/chat:leading-relaxed", i.inverted ? "chat-msg-prose-invert" : ""]),
2454
+ return (l, o) => (v(), w("div", {
2455
+ class: A(["chat-msg-prose break-words text-[14px] leading-relaxed @sm/chat:text-[15px] @sm/chat:leading-relaxed", r.inverted ? "chat-msg-prose-invert" : ""]),
2412
2456
  innerHTML: s.value
2413
2457
  }, null, 10, Ar));
2414
2458
  }
2415
- }), Er = 80, _r = /* @__PURE__ */ ye({
2459
+ }), Er = 80, _r = /* @__PURE__ */ Re({
2416
2460
  __name: "ChatScroller",
2417
- setup(i, { expose: t }) {
2418
- const e = ie(), n = ie();
2419
- let r = !0, s;
2461
+ setup(r, { expose: t }) {
2462
+ const e = ae(), n = ae();
2463
+ let i = !0, s;
2420
2464
  function l() {
2421
2465
  const c = e.value;
2422
2466
  c && (c.scrollTop = c.scrollHeight);
@@ -2424,64 +2468,70 @@ const Ar = ["innerHTML"], Rt = /* @__PURE__ */ ye({
2424
2468
  d(l, "scrollToBottom");
2425
2469
  function o() {
2426
2470
  const c = e.value;
2427
- c && (r = c.scrollHeight - c.scrollTop - c.clientHeight <= Er);
2471
+ c && (i = c.scrollHeight - c.scrollTop - c.clientHeight <= Er);
2428
2472
  }
2429
2473
  d(o, "onScroll");
2430
2474
  function h() {
2431
- r = !0, l();
2475
+ i = !0, l();
2432
2476
  }
2433
- return d(h, "pin"), t({ pin: h }), Mt(() => {
2477
+ return d(h, "pin"), t({ pin: h }), Bt(() => {
2434
2478
  requestAnimationFrame(() => {
2435
2479
  l(), requestAnimationFrame(l);
2436
2480
  }), n.value && (s = new ResizeObserver(() => {
2437
- r && l();
2481
+ i && l();
2438
2482
  }), s.observe(n.value));
2439
2483
  }), fs(() => {
2440
2484
  s?.disconnect();
2441
- }), (c, k) => (v(), S("div", {
2485
+ }), (c, m) => (v(), w("div", {
2442
2486
  ref_key: "viewport",
2443
2487
  ref: e,
2444
2488
  class: "overflow-y-auto overflow-x-hidden min-h-0 flex flex-col [overflow-anchor:none] [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",
2445
2489
  onScrollPassive: o
2446
2490
  }, [
2447
- w("div", {
2491
+ y("div", {
2448
2492
  ref_key: "content",
2449
2493
  ref: n,
2450
2494
  class: "flex-1 flex flex-col"
2451
2495
  }, [
2452
- cn(c.$slots, "default")
2496
+ dn(c.$slots, "default")
2453
2497
  ], 512)
2454
2498
  ], 544));
2455
2499
  }
2456
2500
  }), Rr = { class: "@container/chat flex flex-col h-full relative" }, Ir = {
2457
2501
  key: 0,
2458
2502
  class: "pb-4"
2459
- }, Dr = {
2503
+ }, Cr = {
2460
2504
  key: 0,
2461
2505
  class: "flex flex-col items-center justify-center px-4 min-h-full"
2462
- }, Cr = { class: "relative mb-4 size-20 @sm/chat:size-24" }, Or = ["src", "alt"], Lr = ["title"], Mr = {
2506
+ }, Dr = { class: "relative mb-4 size-20 @sm/chat:size-24" }, Or = ["src", "alt"], Lr = ["title"], Mr = {
2463
2507
  key: 0,
2464
2508
  class: "flex items-center gap-3 py-3 px-2"
2465
2509
  }, Nr = ["data-message-id", "data-message-sender", "data-conversation-id", "data-message-sequence", "data-system-kind", "data-issue-code", "data-issue-bucket", "data-issue-action-label", "data-issue-action-url", "data-streaming"], zr = { class: "max-w-[85%] min-w-0" }, $r = ["href"], Pr = ["data-message-id", "data-message-sender", "data-conversation-id", "data-message-sequence", "data-system-kind", "data-issue-code", "data-issue-bucket", "data-streaming"], Br = ["data-test", "data-message-id", "data-message-sender", "data-conversation-id", "data-message-sequence", "data-system-kind", "data-streaming"], Fr = {
2466
2510
  key: 0,
2467
2511
  class: "flex-shrink-0 size-7 @sm/chat:size-8"
2468
- }, Ur = ["src", "alt"], Hr = ["src", "alt"], jr = ["src"], Gr = ["href"], Wr = ["data-working-description"], qr = { class: "truncate" }, Yr = ["data-issue-code"], Vr = ["href"], Zr = {
2469
- key: 3,
2512
+ }, Ur = ["src", "alt"], Hr = ["src", "alt"], Gr = ["src"], jr = ["href"], Wr = ["data-working-description"], qr = { class: "truncate" }, Yr = ["data-tool-activity-status"], Vr = { class: "truncate" }, Zr = ["data-issue-code"], Xr = ["href"], Kr = {
2513
+ key: 4,
2470
2514
  "data-test": "messaging-thinking-indicator",
2471
2515
  class: "flex gap-2 justify-start items-center mb-4"
2472
- }, Xr = ["src", "alt"], Kr = {
2516
+ }, Qr = ["src", "alt"], Jr = {
2473
2517
  key: 0,
2474
2518
  class: "flex items-center gap-2 px-2 pb-2 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden"
2475
- }, Qr = ["src", "alt"], Jr = { class: "max-w-20 truncate" }, ea = ["onClick"], ta = {
2519
+ }, ea = ["src", "alt"], ta = { class: "max-w-20 truncate" }, na = ["onClick"], sa = {
2476
2520
  key: 0,
2477
2521
  class: "shrink-0 flex items-center justify-center size-14"
2478
- }, na = ["disabled"], sa = {
2522
+ }, ia = ["disabled"], ra = {
2479
2523
  key: 0,
2480
2524
  class: "i-svg-spinners-ring-resize size-4"
2481
- }, ia = {
2525
+ }, aa = {
2482
2526
  key: 1,
2483
2527
  class: "i-tabler-paperclip size-5"
2484
- }, ra = ["placeholder", "disabled"], aa = ["disabled"], xa = /* @__PURE__ */ ye({
2528
+ }, la = ["placeholder", "disabled"], oa = ["disabled", "aria-label"], ca = {
2529
+ key: 0,
2530
+ class: "i-tabler-player-stop-filled size-4"
2531
+ }, ua = {
2532
+ key: 1,
2533
+ class: "i-tabler-arrow-up size-5"
2534
+ }, wa = /* @__PURE__ */ Re({
2485
2535
  __name: "ElAgentChat",
2486
2536
  props: {
2487
2537
  chatController: {},
@@ -2493,461 +2543,509 @@ const Ar = ["innerHTML"], Rt = /* @__PURE__ */ ye({
2493
2543
  setupHint: {},
2494
2544
  emptyStateMessage: {}
2495
2545
  },
2496
- setup(i) {
2546
+ setup(r) {
2497
2547
  const t = {
2498
2548
  private: { icon: "i-tabler-lock", label: "Private", tooltip: "Only you can see this conversation" },
2499
2549
  org: { icon: "i-tabler-users", label: "Workspace", tooltip: "Visible to workspace members" },
2500
2550
  public: { icon: "i-tabler-globe", label: "Public", tooltip: "Anyone with the link can see this" }
2501
- }, e = j(() => {
2502
- const _ = { ...t[i.scope] };
2503
- return i.scope === "org" && i.scopeName && (_.label = i.scopeName, _.tooltip = `Visible to ${i.scopeName} members`), _;
2504
- }), n = ie(""), r = ie(!1), s = ie(), l = ie(), o = ie(), h = ie([]), c = ie(!1);
2505
- function k(_) {
2506
- return _ ? /\[[^\]]+\]\([^)]+\)/.test(_) : !1;
2507
- }
2508
- d(k, "containsMarkdownLink");
2509
- function m(_) {
2510
- return _.sender === "system" && (!!_.issue || _.id === B.value);
2511
- }
2512
- d(m, "isSystemExplainerMessage");
2513
- function b(_, p) {
2514
- const f = _[p], A = _[p + 1];
2515
- return !A || A.sender !== f.sender;
2516
- }
2517
- d(b, "shouldShowAvatar");
2518
- const T = j(() => i.chatController?.textState.value), F = j(() => T.value?.isConnected ?? !1), y = j(() => T.value?.isThinking ?? !1), I = j(() => T.value?.connectionStatus === "disconnected" && !!T.value?.error), M = j(() => T.value?.connectionStatus !== "connected" && !T.value?.error), $ = j(() => T.value?.error), W = j(() => i.chatController?.sharedMessages.value ?? []), U = j(() => T.value?.workingDescription?.trim() || void 0), X = j(() => T.value?.transientIssue), B = j(() => {
2519
- if (!y.value) return;
2520
- const _ = W.value, p = _[_.length - 1];
2521
- return p?.sender === "agent" || p?.sender === "system" ? p.id : void 0;
2522
- }), ae = j(() => !y.value || U.value ? !1 : B.value === void 0), we = j(() => T.value?.sendBlockedReason), ve = j(() => !F.value || we.value !== void 0), ft = j(() => I.value ? "Agent is offline" : M.value ? "Connecting..." : we.value === "agent_deleted" ? "This assistant was deleted" : we.value === "account" ? "Resolve the billing issue above to continue" : "Message"), gt = j(() => (n.value.trim() || h.value.length > 0) && !ve.value && !c.value), O = j(() => i.variant === "light"), mt = j(
2523
- () => O.value ? "bg-gradient-to-r from-transparent via-black/5 to-transparent" : "bg-gradient-to-r from-transparent via-white/5 to-transparent"
2524
- ), q = j(() => O.value ? "text-theme-300" : "text-white/30");
2525
- Mt(async () => {
2526
- i.chatController && !F.value && await i.chatController.startTextConversation();
2551
+ }, e = U(() => {
2552
+ const S = { ...t[r.scope] };
2553
+ return r.scope === "org" && r.scopeName && (S.label = r.scopeName, S.tooltip = `Visible to ${r.scopeName} members`), S;
2554
+ }), n = ae(""), i = ae(!1), s = ae(), l = ae(), o = ae(), h = ae([]), c = ae(!1);
2555
+ function m(S) {
2556
+ return S ? /\[[^\]]+\]\([^)]+\)/.test(S) : !1;
2557
+ }
2558
+ d(m, "containsMarkdownLink");
2559
+ function b(S) {
2560
+ return S.sender === "system" && (!!S.issue || S.id === de.value);
2561
+ }
2562
+ d(b, "isSystemExplainerMessage");
2563
+ function k(S, f) {
2564
+ const p = S[f], D = S[f + 1];
2565
+ return !D || D.sender !== p.sender;
2566
+ }
2567
+ d(k, "shouldShowAvatar");
2568
+ const T = U(() => r.chatController?.textState.value), F = U(() => T.value?.isConnected ?? !1), M = U(() => T.value?.isThinking ?? !1), V = U(() => T.value?.connectionStatus === "disconnected" && !!T.value?.error), oe = U(() => T.value?.connectionStatus !== "connected" && !T.value?.error), E = U(() => T.value?.error), L = U(() => r.chatController?.sharedMessages.value ?? []), I = U(() => T.value?.workingDescription?.trim() || void 0), B = U(() => M.value ? T.value?.toolActivities ?? [] : []), z = U(() => {
2569
+ const S = B.value, f = Z(S, "started");
2570
+ if (f)
2571
+ return { status: "started", icon: "i-tabler-loader-2 animate-spin", label: f.label };
2572
+ const p = Z(S, "failed");
2573
+ if (p)
2574
+ return { status: "failed", icon: "i-tabler-alert-circle text-red-500", label: p.label };
2575
+ const D = S.filter((J) => J.status === "completed").length;
2576
+ if (D > 0)
2577
+ return {
2578
+ status: "completed",
2579
+ icon: "i-tabler-circle-check-filled text-emerald-500",
2580
+ label: D === 1 ? "1 action completed" : `${D} actions completed`
2581
+ };
2582
+ });
2583
+ function Z(S, f) {
2584
+ for (let p = S.length - 1; p >= 0; p--) {
2585
+ const D = S[p];
2586
+ if (D?.status === f)
2587
+ return D;
2588
+ }
2589
+ }
2590
+ d(Z, "lastToolActivityWithStatus");
2591
+ const ce = U(() => T.value?.transientIssue), de = U(() => {
2592
+ if (!M.value) return;
2593
+ const S = L.value, f = S[S.length - 1];
2594
+ return f?.sender === "agent" || f?.sender === "system" ? f.id : void 0;
2595
+ }), xt = U(() => !M.value || I.value ? !1 : de.value === void 0), it = U(() => T.value?.sendBlockedReason), Ue = U(() => !F.value || it.value !== void 0), Ht = U(() => V.value ? "Agent is offline" : oe.value ? "Connecting..." : it.value === "agent_deleted" ? "This assistant was deleted" : it.value === "account" ? "Resolve the billing issue above to continue" : "Message"), K = U(() => (n.value.trim() || h.value.length > 0) && !Ue.value && !c.value && !M.value), xe = U(() => !!r.chatController && M.value && !c.value), Me = U(() => K.value || xe.value), R = U(() => r.variant === "light"), kt = U(
2596
+ () => R.value ? "bg-gradient-to-r from-transparent via-black/5 to-transparent" : "bg-gradient-to-r from-transparent via-white/5 to-transparent"
2597
+ ), rt = U(() => R.value ? "text-theme-300" : "text-white/30");
2598
+ Bt(async () => {
2599
+ r.chatController && !F.value && await r.chatController.startTextConversation();
2527
2600
  });
2528
- async function Ce() {
2529
- const _ = n.value.trim(), p = h.value.length > 0;
2530
- if (!_ && !p || !i.chatController || ve.value || c.value)
2601
+ async function vt() {
2602
+ const S = n.value.trim(), f = h.value.length > 0;
2603
+ if (!S && !f || !r.chatController || Ue.value || c.value || M.value)
2604
+ return;
2605
+ const p = n.value, D = f ? [...h.value] : void 0;
2606
+ n.value = "", h.value = [], l.value && (l.value.style.height = "auto", l.value.focus()), s.value?.pin(), await r.chatController.sendChatMessage(p, D);
2607
+ }
2608
+ d(vt, "sendMessage");
2609
+ async function yt() {
2610
+ !r.chatController || !xe.value || await r.chatController.stopChatTurn();
2611
+ }
2612
+ d(yt, "stopMessage");
2613
+ async function Gt() {
2614
+ if (xe.value) {
2615
+ await yt();
2531
2616
  return;
2532
- const f = n.value, A = p ? [...h.value] : void 0;
2533
- n.value = "", h.value = [], l.value && (l.value.style.height = "auto", l.value.focus()), s.value?.pin(), await i.chatController.sendChatMessage(f, A);
2617
+ }
2618
+ await vt();
2534
2619
  }
2535
- d(Ce, "sendMessage");
2536
- async function Pe(_) {
2537
- _.key === "Enter" && !_.shiftKey && (_.preventDefault(), await Ce());
2620
+ d(Gt, "handleComposerAction");
2621
+ async function wt(S) {
2622
+ S.key === "Enter" && !S.shiftKey && (S.preventDefault(), await vt());
2538
2623
  }
2539
- d(Pe, "handleKeydown");
2540
- function Be() {
2624
+ d(wt, "handleKeydown");
2625
+ function W() {
2541
2626
  l.value && (l.value.style.height = "auto", l.value.style.height = `${Math.min(l.value.scrollHeight, 150)}px`);
2542
2627
  }
2543
- d(Be, "adjustTextareaHeight"), It(n, () => Bs(() => Be()));
2544
- function $t() {
2628
+ d(W, "adjustTextareaHeight"), Mt(n, () => Bs(() => W()));
2629
+ function at() {
2545
2630
  o.value?.click();
2546
2631
  }
2547
- d($t, "triggerFileInput");
2548
- async function Pt(_) {
2549
- const p = _.target, f = p.files?.[0];
2550
- if (!(!f || !i.uploadFn)) {
2632
+ d(at, "triggerFileInput");
2633
+ async function q(S) {
2634
+ const f = S.target, p = f.files?.[0];
2635
+ if (!(!p || !r.uploadFn)) {
2551
2636
  c.value = !0;
2552
2637
  try {
2553
- const A = await i.uploadFn(f);
2554
- h.value = [...h.value, A];
2555
- } catch (A) {
2556
- const K = A instanceof Error ? A.message : "Couldn't attach that file.";
2557
- i.chatController?.notify(`Upload failed — ${K}`);
2638
+ const D = await r.uploadFn(p);
2639
+ h.value = [...h.value, D];
2640
+ } catch (D) {
2641
+ const J = D instanceof Error ? D.message : "Couldn't attach that file.";
2642
+ r.chatController?.notify(`Upload failed — ${J}`);
2558
2643
  } finally {
2559
- c.value = !1, p.value = "";
2644
+ c.value = !1, f.value = "";
2560
2645
  }
2561
2646
  }
2562
2647
  }
2563
- d(Pt, "handleFileSelect");
2564
- function Bt(_) {
2565
- h.value = h.value.filter((p, f) => f !== _);
2566
- }
2567
- d(Bt, "removeAttachment");
2568
- function nt(_, p) {
2569
- if (p === 0) {
2570
- const Se = _[p];
2571
- return Se?.timestamp ? bt(new Date(Se.timestamp)) : null;
2572
- }
2573
- const f = _[p - 1], A = _[p];
2574
- if (!f?.timestamp || !A?.timestamp) return null;
2575
- const K = new Date(f.timestamp).getTime();
2576
- return new Date(A.timestamp).getTime() - K > 36e5 ? bt(new Date(A.timestamp)) : null;
2577
- }
2578
- d(nt, "shouldShowTimeDivider");
2579
- function bt(_) {
2580
- const p = /* @__PURE__ */ new Date(), f = _.toDateString() === p.toDateString(), A = new Date(p);
2581
- A.setDate(A.getDate() - 1);
2582
- const K = _.toDateString() === A.toDateString(), P = _.toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" });
2583
- if (f) return P;
2584
- if (K) return `Yesterday, ${P}`;
2585
- const Te = _.getFullYear() === p.getFullYear();
2586
- return `${_.toLocaleDateString("en-US", {
2648
+ d(q, "handleFileSelect");
2649
+ function lt(S) {
2650
+ h.value = h.value.filter((f, p) => p !== S);
2651
+ }
2652
+ d(lt, "removeAttachment");
2653
+ function G(S, f) {
2654
+ if (f === 0) {
2655
+ const Ee = S[f];
2656
+ return Ee?.timestamp ? Ie(new Date(Ee.timestamp)) : null;
2657
+ }
2658
+ const p = S[f - 1], D = S[f];
2659
+ if (!p?.timestamp || !D?.timestamp) return null;
2660
+ const J = new Date(p.timestamp).getTime();
2661
+ return new Date(D.timestamp).getTime() - J > 36e5 ? Ie(new Date(D.timestamp)) : null;
2662
+ }
2663
+ d(G, "shouldShowTimeDivider");
2664
+ function Ie(S) {
2665
+ const f = /* @__PURE__ */ new Date(), p = S.toDateString() === f.toDateString(), D = new Date(f);
2666
+ D.setDate(D.getDate() - 1);
2667
+ const J = S.toDateString() === D.toDateString(), Ae = S.toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" });
2668
+ if (p) return Ae;
2669
+ if (J) return `Yesterday, ${Ae}`;
2670
+ const pe = S.getFullYear() === f.getFullYear();
2671
+ return `${S.toLocaleDateString("en-US", {
2587
2672
  weekday: "long",
2588
2673
  month: "short",
2589
2674
  day: "numeric",
2590
- ...Te ? {} : { year: "numeric" }
2591
- })}, ${P}`;
2675
+ ...pe ? {} : { year: "numeric" }
2676
+ })}, ${Ae}`;
2592
2677
  }
2593
- return d(bt, "formatTimeDivider"), (_, p) => (v(), S("div", Rr, [
2594
- O.value ? G("", !0) : (v(), S("div", Ir, [
2595
- We(ai, {
2596
- agent: i.agent,
2678
+ return d(Ie, "formatTimeDivider"), (S, f) => (v(), w("div", Rr, [
2679
+ R.value ? j("", !0) : (v(), w("div", Ir, [
2680
+ Ye(ai, {
2681
+ agent: r.agent,
2597
2682
  "is-online": F.value
2598
2683
  }, null, 8, ["agent", "is-online"])
2599
2684
  ])),
2600
- I.value ? (v(), S("div", {
2685
+ V.value ? (v(), w("div", {
2601
2686
  key: 1,
2602
- class: E(["py-16 flex flex-col items-center justify-center gap-3 text-sm", O.value ? "text-theme-400" : "text-white/60"])
2687
+ class: A(["py-16 flex flex-col items-center justify-center gap-3 text-sm", R.value ? "text-theme-400" : "text-white/60"])
2603
2688
  }, [
2604
- w("i", {
2605
- class: E(["i-heroicons-cloud-arrow-down size-8", O.value ? "text-theme-300" : "text-white/40"])
2689
+ y("i", {
2690
+ class: A(["i-heroicons-cloud-arrow-down size-8", R.value ? "text-theme-300" : "text-white/40"])
2606
2691
  }, null, 2),
2607
- w("span", null, ne($.value), 1)
2608
- ], 2)) : M.value ? (v(), S("div", {
2692
+ y("span", null, se(E.value), 1)
2693
+ ], 2)) : oe.value ? (v(), w("div", {
2609
2694
  key: 2,
2610
- class: E(["py-16 flex flex-col items-center justify-center gap-2 text-sm", O.value ? "text-theme-400" : "text-theme-600"])
2695
+ class: A(["py-16 flex flex-col items-center justify-center gap-2 text-sm", R.value ? "text-theme-400" : "text-theme-600"])
2611
2696
  }, [
2612
- We(jn, { class: "size-4" })
2613
- ], 2)) : i.setupHint ? (v(), S("div", {
2697
+ Ye(Gn, { class: "size-4" })
2698
+ ], 2)) : r.setupHint ? (v(), w("div", {
2614
2699
  key: 3,
2615
- class: E(["flex items-center justify-center gap-1.5 py-2 text-[11px]", q.value])
2700
+ class: A(["flex items-center justify-center gap-1.5 py-2 text-[11px]", rt.value])
2616
2701
  }, [
2617
- p[10] || (p[10] = w("i", { class: "i-tabler-tool size-3" }, null, -1)),
2618
- w("span", null, ne(i.setupHint), 1)
2619
- ], 2)) : G("", !0),
2620
- We(_r, {
2702
+ f[10] || (f[10] = y("i", { class: "i-tabler-tool size-3" }, null, -1)),
2703
+ y("span", null, se(r.setupHint), 1)
2704
+ ], 2)) : j("", !0),
2705
+ Ye(_r, {
2621
2706
  ref_key: "chatScroller",
2622
2707
  ref: s,
2623
2708
  class: "flex-1"
2624
2709
  }, {
2625
2710
  default: Fs(() => [
2626
- w("div", {
2627
- class: E(W.value.length === 0 ? "flex-1 flex flex-col items-center justify-center px-3" : "pt-4 pb-[120px] px-3 space-y-1")
2711
+ y("div", {
2712
+ class: A(L.value.length === 0 ? "flex-1 flex flex-col items-center justify-center px-3" : "pt-4 pb-[120px] px-3 space-y-1")
2628
2713
  }, [
2629
- W.value.length === 0 && !M.value && !I.value ? (v(), S("div", Dr, [
2630
- w("div", Cr, [
2631
- w("img", {
2632
- src: i.agent.avatarUrl.value,
2633
- alt: i.agent.displayName.value,
2634
- class: E(["size-full rounded-full object-cover ring-1", O.value ? "ring-black/5" : "ring-white/10"])
2714
+ L.value.length === 0 && !oe.value && !V.value ? (v(), w("div", Cr, [
2715
+ y("div", Dr, [
2716
+ y("img", {
2717
+ src: r.agent.avatarUrl.value,
2718
+ alt: r.agent.displayName.value,
2719
+ class: A(["size-full rounded-full object-cover ring-1", R.value ? "ring-black/5" : "ring-white/10"])
2635
2720
  }, null, 10, Or),
2636
- F.value ? (v(), S("span", {
2721
+ F.value ? (v(), w("span", {
2637
2722
  key: 0,
2638
- class: E(["absolute top-[85%] left-[85%] -translate-x-1/2 -translate-y-1/2 size-[18%] min-w-2.5 min-h-2.5 flex items-center justify-center rounded-full", O.value ? "bg-white" : "bg-theme-900"])
2639
- }, [...p[11] || (p[11] = [
2640
- w("span", { class: "size-[70%] inline-flex rounded-full bg-emerald-500" }, null, -1)
2641
- ])], 2)) : G("", !0)
2723
+ class: A(["absolute top-[85%] left-[85%] -translate-x-1/2 -translate-y-1/2 size-[18%] min-w-2.5 min-h-2.5 flex items-center justify-center rounded-full", R.value ? "bg-white" : "bg-theme-900"])
2724
+ }, [...f[11] || (f[11] = [
2725
+ y("span", { class: "size-[70%] inline-flex rounded-full bg-emerald-500" }, null, -1)
2726
+ ])], 2)) : j("", !0)
2642
2727
  ]),
2643
- w("div", {
2644
- class: E(["text-base @sm/chat:text-lg font-semibold", O.value ? "text-theme-900" : "text-white"])
2645
- }, ne(i.agent.displayName.value), 3),
2646
- w("p", {
2647
- class: E(["mt-1 text-center text-xs @sm/chat:text-sm", q.value])
2648
- }, ne(i.emptyStateMessage || "Type your message to get started."), 3),
2649
- w("div", {
2650
- class: E(["inline-flex items-center gap-1.5 mt-5 px-2.5 py-1 rounded-full text-[11px]", O.value ? "bg-theme-50 border border-theme-100 text-theme-400" : "bg-white/10 border border-white/20 text-white/40"]),
2728
+ y("div", {
2729
+ class: A(["text-base @sm/chat:text-lg font-semibold", R.value ? "text-theme-900" : "text-white"])
2730
+ }, se(r.agent.displayName.value), 3),
2731
+ y("p", {
2732
+ class: A(["mt-1 text-center text-xs @sm/chat:text-sm", rt.value])
2733
+ }, se(r.emptyStateMessage || "Type your message to get started."), 3),
2734
+ y("div", {
2735
+ class: A(["inline-flex items-center gap-1.5 mt-5 px-2.5 py-1 rounded-full text-[11px]", R.value ? "bg-theme-50 border border-theme-100 text-theme-400" : "bg-white/10 border border-white/20 text-white/40"]),
2651
2736
  title: e.value.tooltip
2652
2737
  }, [
2653
- w("i", {
2654
- class: E([e.value.icon, "size-3"])
2738
+ y("i", {
2739
+ class: A([e.value.icon, "size-3"])
2655
2740
  }, null, 2),
2656
- w("span", null, ne(e.value.label), 1)
2741
+ y("span", null, se(e.value.label), 1)
2657
2742
  ], 10, Lr)
2658
- ])) : G("", !0),
2659
- (v(!0), S(Me, null, Qt(W.value, (f, A) => (v(), S(Me, {
2660
- key: f.id
2743
+ ])) : j("", !0),
2744
+ (v(!0), w($e, null, tn(L.value, (p, D) => (v(), w($e, {
2745
+ key: p.id
2661
2746
  }, [
2662
- nt(W.value, A) ? (v(), S("div", Mr, [
2663
- w("div", {
2664
- class: E(["flex-1 h-px", mt.value])
2747
+ G(L.value, D) ? (v(), w("div", Mr, [
2748
+ y("div", {
2749
+ class: A(["flex-1 h-px", kt.value])
2665
2750
  }, null, 2),
2666
- w("span", {
2667
- class: E(["text-[10px] @sm/chat:text-[11px] font-medium shrink-0 tracking-widest uppercase", q.value])
2668
- }, ne(nt(W.value, A)), 3),
2669
- w("div", {
2670
- class: E(["flex-1 h-px", mt.value])
2751
+ y("span", {
2752
+ class: A(["text-[10px] @sm/chat:text-[11px] font-medium shrink-0 tracking-widest uppercase", rt.value])
2753
+ }, se(G(L.value, D)), 3),
2754
+ y("div", {
2755
+ class: A(["flex-1 h-px", kt.value])
2671
2756
  }, null, 2)
2672
- ])) : G("", !0),
2673
- m(f) ? (v(), S("div", {
2757
+ ])) : j("", !0),
2758
+ b(p) ? (v(), w("div", {
2674
2759
  key: 1,
2675
2760
  "data-test": "messaging-system-msg",
2676
- "data-message-id": f.id,
2677
- "data-message-sender": f.sender,
2678
- "data-conversation-id": f.conversationId,
2679
- "data-message-sequence": f.sequence,
2680
- "data-system-kind": f.systemKind,
2681
- "data-issue-code": f.issue?.code,
2682
- "data-issue-bucket": f.issue?.bucket,
2683
- "data-issue-action-label": f.issue?.actionLabel,
2684
- "data-issue-action-url": f.issue?.actionUrl,
2685
- "data-streaming": f.id === B.value ? "true" : void 0,
2761
+ "data-message-id": p.id,
2762
+ "data-message-sender": p.sender,
2763
+ "data-conversation-id": p.conversationId,
2764
+ "data-message-sequence": p.sequence,
2765
+ "data-system-kind": p.systemKind,
2766
+ "data-issue-code": p.issue?.code,
2767
+ "data-issue-bucket": p.issue?.bucket,
2768
+ "data-issue-action-label": p.issue?.actionLabel,
2769
+ "data-issue-action-url": p.issue?.actionUrl,
2770
+ "data-streaming": p.id === de.value ? "true" : void 0,
2686
2771
  class: "flex gap-2 items-end justify-start mb-4"
2687
2772
  }, [
2688
- w("div", zr, [
2689
- w("div", {
2690
- class: E(["mb-1 pl-1 text-[11px] font-medium", O.value ? "text-theme-500" : "text-white/45"])
2773
+ y("div", zr, [
2774
+ y("div", {
2775
+ class: A(["mb-1 pl-1 text-[11px] font-medium", R.value ? "text-theme-500" : "text-white/45"])
2691
2776
  }, " System Message ", 2),
2692
- w("div", {
2693
- class: E(["rounded-2xl rounded-bl-[4px] px-3.5 py-2 border system-msg-content", O.value ? "bg-theme-100 border-theme-200 text-theme-800" : "bg-white/[0.18] border-white/15 text-white/90"])
2777
+ y("div", {
2778
+ class: A(["rounded-2xl rounded-bl-[4px] px-3.5 py-2 border system-msg-content", R.value ? "bg-theme-100 border-theme-200 text-theme-800" : "bg-white/[0.18] border-white/15 text-white/90"])
2694
2779
  }, [
2695
- f.text ? (v(), Hn(Rt, {
2780
+ p.text ? (v(), Hn(Lt, {
2696
2781
  key: 0,
2697
- text: f.text,
2698
- inverted: !O.value,
2699
- streaming: f.id === B.value,
2700
- onClick: p[0] || (p[0] = lt(() => {
2782
+ text: p.text,
2783
+ inverted: !R.value,
2784
+ streaming: p.id === de.value,
2785
+ onClick: f[0] || (f[0] = ht(() => {
2701
2786
  }, ["stop"]))
2702
- }, null, 8, ["text", "inverted", "streaming"])) : f.issue?.help ? (v(), Hn(Rt, {
2787
+ }, null, 8, ["text", "inverted", "streaming"])) : p.issue?.help ? (v(), Hn(Lt, {
2703
2788
  key: 1,
2704
- text: f.issue.help,
2705
- inverted: !O.value
2706
- }, null, 8, ["text", "inverted"])) : G("", !0),
2707
- f.issue?.actionUrl && !k(f.text) ? (v(), S("a", {
2789
+ text: p.issue.help,
2790
+ inverted: !R.value
2791
+ }, null, 8, ["text", "inverted"])) : j("", !0),
2792
+ p.issue?.actionUrl && !m(p.text) ? (v(), w("a", {
2708
2793
  key: 2,
2709
- href: f.issue.actionUrl,
2794
+ href: p.issue.actionUrl,
2710
2795
  "data-test": "messaging-system-msg-action",
2711
- class: E(["mt-2 text-[12px] font-medium inline-flex items-center gap-1", O.value ? "text-theme-900 hover:text-theme-700" : "text-white hover:text-white/80"]),
2712
- onClick: p[1] || (p[1] = lt(() => {
2796
+ class: A(["mt-2 text-[12px] font-medium inline-flex items-center gap-1", R.value ? "text-theme-900 hover:text-theme-700" : "text-white hover:text-white/80"]),
2797
+ onClick: f[1] || (f[1] = ht(() => {
2713
2798
  }, ["stop"]))
2714
2799
  }, [
2715
- At(ne(f.issue.actionLabel) + " ", 1),
2716
- p[12] || (p[12] = w("i", { class: "i-tabler-arrow-right size-3" }, null, -1))
2717
- ], 10, $r)) : G("", !0)
2800
+ Ct(se(p.issue.actionLabel) + " ", 1),
2801
+ f[12] || (f[12] = y("i", { class: "i-tabler-arrow-right size-3" }, null, -1))
2802
+ ], 10, $r)) : j("", !0)
2718
2803
  ], 2)
2719
2804
  ])
2720
- ], 8, Nr)) : f.sender === "system" ? (v(), S("div", {
2805
+ ], 8, Nr)) : p.sender === "system" ? (v(), w("div", {
2721
2806
  key: 2,
2722
2807
  "data-test": "messaging-system-status-msg",
2723
- "data-message-id": f.id,
2724
- "data-message-sender": f.sender,
2725
- "data-conversation-id": f.conversationId,
2726
- "data-message-sequence": f.sequence,
2727
- "data-system-kind": f.systemKind,
2728
- "data-issue-code": f.issue?.code,
2729
- "data-issue-bucket": f.issue?.bucket,
2730
- "data-streaming": f.id === B.value ? "true" : void 0,
2731
- class: E(["flex items-start gap-2 px-3 py-2 text-[13px] leading-relaxed", O.value ? "text-theme-500" : "text-white/60"])
2808
+ "data-message-id": p.id,
2809
+ "data-message-sender": p.sender,
2810
+ "data-conversation-id": p.conversationId,
2811
+ "data-message-sequence": p.sequence,
2812
+ "data-system-kind": p.systemKind,
2813
+ "data-issue-code": p.issue?.code,
2814
+ "data-issue-bucket": p.issue?.bucket,
2815
+ "data-streaming": p.id === de.value ? "true" : void 0,
2816
+ class: A(["flex items-start gap-2 px-3 py-2 text-[13px] leading-relaxed", R.value ? "text-theme-500" : "text-white/60"])
2732
2817
  }, [
2733
- p[13] || (p[13] = w("i", { class: "i-tabler-info-circle size-4 mt-0.5 shrink-0" }, null, -1)),
2734
- We(Rt, {
2735
- text: f.text,
2736
- inverted: !O.value,
2737
- onClick: p[2] || (p[2] = lt(() => {
2818
+ f[13] || (f[13] = y("i", { class: "i-tabler-info-circle size-4 mt-0.5 shrink-0" }, null, -1)),
2819
+ Ye(Lt, {
2820
+ text: p.text,
2821
+ inverted: !R.value,
2822
+ onClick: f[2] || (f[2] = ht(() => {
2738
2823
  }, ["stop"]))
2739
2824
  }, null, 8, ["text", "inverted"])
2740
- ], 10, Pr)) : (v(), S("div", {
2825
+ ], 10, Pr)) : (v(), w("div", {
2741
2826
  key: 3,
2742
- "data-test": f.sender === "agent" ? "messaging-assistant-msg" : f.sender === "user" ? "messaging-user-msg" : void 0,
2743
- "data-message-id": f.id,
2744
- "data-message-sender": f.sender,
2745
- "data-conversation-id": f.conversationId,
2746
- "data-message-sequence": f.sequence,
2747
- "data-system-kind": f.systemKind,
2748
- "data-streaming": f.id === B.value ? "true" : void 0,
2749
- class: E(["flex gap-2 items-end", {
2750
- "justify-end": f.sender === "user",
2751
- "justify-start": f.sender === "agent",
2752
- "mb-4": b(W.value, A)
2827
+ "data-test": p.sender === "agent" ? "messaging-assistant-msg" : p.sender === "user" ? "messaging-user-msg" : void 0,
2828
+ "data-message-id": p.id,
2829
+ "data-message-sender": p.sender,
2830
+ "data-conversation-id": p.conversationId,
2831
+ "data-message-sequence": p.sequence,
2832
+ "data-system-kind": p.systemKind,
2833
+ "data-streaming": p.id === de.value ? "true" : void 0,
2834
+ class: A(["flex gap-2 items-end", {
2835
+ "justify-end": p.sender === "user",
2836
+ "justify-start": p.sender === "agent",
2837
+ "mb-4": k(L.value, D)
2753
2838
  }])
2754
2839
  }, [
2755
- f.sender === "agent" ? (v(), S("div", Fr, [
2756
- b(W.value, A) ? (v(), S("img", {
2840
+ p.sender === "agent" ? (v(), w("div", Fr, [
2841
+ k(L.value, D) ? (v(), w("img", {
2757
2842
  key: 0,
2758
- src: i.agent.avatarUrl.value,
2759
- alt: i.agent.displayName.value,
2760
- class: E(["size-6 @sm/chat:size-7 rounded-full object-cover shadow-sm", O.value ? "ring-1 ring-black/5" : ""])
2761
- }, null, 10, Ur)) : G("", !0)
2762
- ])) : G("", !0),
2763
- w("div", {
2764
- class: E(f.sender === "user" ? "max-w-[75%]" : "max-w-[85%]")
2843
+ src: r.agent.avatarUrl.value,
2844
+ alt: r.agent.displayName.value,
2845
+ class: A(["size-6 @sm/chat:size-7 rounded-full object-cover shadow-sm", R.value ? "ring-1 ring-black/5" : ""])
2846
+ }, null, 10, Ur)) : j("", !0)
2847
+ ])) : j("", !0),
2848
+ y("div", {
2849
+ class: A(p.sender === "user" ? "max-w-[75%]" : "max-w-[85%]")
2765
2850
  }, [
2766
- f.attachments?.length ? (v(), S("div", {
2851
+ p.attachments?.length ? (v(), w("div", {
2767
2852
  key: 0,
2768
- class: E(["mb-1 space-y-1", f.sender === "user" ? "flex flex-col items-end" : ""])
2853
+ class: A(["mb-1 space-y-1", p.sender === "user" ? "flex flex-col items-end" : ""])
2769
2854
  }, [
2770
- (v(!0), S(Me, null, Qt(f.attachments, (K, P) => (v(), S(Me, { key: P }, [
2771
- K.type === "image" ? (v(), S("img", {
2855
+ (v(!0), w($e, null, tn(p.attachments, (J, Ae) => (v(), w($e, { key: Ae }, [
2856
+ J.type === "image" ? (v(), w("img", {
2772
2857
  key: 0,
2773
- src: K.src,
2774
- alt: K.filename,
2858
+ src: J.src,
2859
+ alt: J.filename,
2775
2860
  class: "rounded-xl object-cover max-h-48 max-w-[240px] @sm/chat:max-w-[320px]"
2776
- }, null, 8, Hr)) : K.type === "audio" ? (v(), S("audio", {
2861
+ }, null, 8, Hr)) : J.type === "audio" ? (v(), w("audio", {
2777
2862
  key: 1,
2778
- src: K.src,
2863
+ src: J.src,
2779
2864
  controls: "",
2780
2865
  class: "max-w-full"
2781
- }, null, 8, jr)) : (v(), S("a", {
2866
+ }, null, 8, Gr)) : (v(), w("a", {
2782
2867
  key: 2,
2783
- href: K.src,
2868
+ href: J.src,
2784
2869
  target: "_blank",
2785
2870
  rel: "noopener",
2786
- class: E(["inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", O.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
2871
+ class: A(["inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", R.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
2787
2872
  }, [
2788
- p[14] || (p[14] = w("i", { class: "i-tabler-file size-3.5" }, null, -1)),
2789
- At(" " + ne(K.filename), 1)
2790
- ], 10, Gr))
2873
+ f[14] || (f[14] = y("i", { class: "i-tabler-file size-3.5" }, null, -1)),
2874
+ Ct(" " + se(J.filename), 1)
2875
+ ], 10, jr))
2791
2876
  ], 64))), 128))
2792
- ], 2)) : G("", !0),
2793
- f.text ? (v(), S("div", {
2877
+ ], 2)) : j("", !0),
2878
+ p.text ? (v(), w("div", {
2794
2879
  key: 1,
2795
- class: E(["rounded-2xl px-3.5 py-2", [
2796
- f.sender === "user" ? "bg-primary-500 text-white rounded-br-[4px]" : O.value ? "bg-theme-50 text-theme-800 border border-black/[0.02] rounded-bl-[4px]" : "bg-white/15 backdrop-blur-sm text-white/95 rounded-bl-[4px]"
2880
+ class: A(["rounded-2xl px-3.5 py-2", [
2881
+ p.sender === "user" ? "bg-primary-500 text-white rounded-br-[4px]" : R.value ? "bg-theme-50 text-theme-800 border border-black/[0.02] rounded-bl-[4px]" : "bg-white/15 backdrop-blur-sm text-white/95 rounded-bl-[4px]"
2797
2882
  ]])
2798
2883
  }, [
2799
- We(Rt, {
2800
- text: f.text,
2801
- inverted: f.sender === "user" || !O.value,
2802
- streaming: f.id === B.value,
2803
- onClick: p[3] || (p[3] = lt(() => {
2884
+ Ye(Lt, {
2885
+ text: p.text,
2886
+ inverted: p.sender === "user" || !R.value,
2887
+ streaming: p.id === de.value,
2888
+ onClick: f[3] || (f[3] = ht(() => {
2804
2889
  }, ["stop"]))
2805
2890
  }, null, 8, ["text", "inverted", "streaming"])
2806
- ], 2)) : G("", !0)
2891
+ ], 2)) : j("", !0)
2807
2892
  ], 2)
2808
2893
  ], 10, Br))
2809
2894
  ], 64))), 128)),
2810
- U.value ? (v(), S("div", {
2895
+ I.value ? (v(), w("div", {
2811
2896
  key: 1,
2812
2897
  "data-test": "messaging-working-state",
2813
- "data-working-description": U.value,
2814
- class: E(["flex items-center gap-1.5 pl-2 pr-3 pb-1 mb-3 text-[12px] leading-none", O.value ? "text-theme-500" : "text-white/45"])
2898
+ "data-working-description": I.value,
2899
+ class: A(["flex items-center gap-1.5 pl-2 pr-3 pb-1 mb-3 text-[12px] leading-none", R.value ? "text-theme-500" : "text-white/45"])
2815
2900
  }, [
2816
- p[15] || (p[15] = w("i", {
2901
+ f[15] || (f[15] = y("i", {
2817
2902
  class: "i-tabler-loader-2 size-3.5 shrink-0 animate-spin opacity-70",
2818
2903
  "aria-hidden": "true"
2819
2904
  }, null, -1)),
2820
- w("span", qr, ne(U.value), 1)
2821
- ], 10, Wr)) : G("", !0),
2822
- X.value ? (v(), S("div", {
2905
+ y("span", qr, se(I.value), 1)
2906
+ ], 10, Wr)) : j("", !0),
2907
+ z.value ? (v(), w("div", {
2823
2908
  key: 2,
2909
+ "data-test": "messaging-tool-activity",
2910
+ "data-tool-activity-status": z.value.status,
2911
+ class: A(["flex items-center gap-1.5 pl-2 pr-3 pb-1 mb-3 text-[12px] leading-none", R.value ? "text-theme-500" : "text-white/45"])
2912
+ }, [
2913
+ y("i", {
2914
+ class: A(["size-3.5 shrink-0 opacity-80", z.value.icon]),
2915
+ "aria-hidden": "true"
2916
+ }, null, 2),
2917
+ y("span", Vr, se(z.value.label), 1)
2918
+ ], 10, Yr)) : j("", !0),
2919
+ ce.value ? (v(), w("div", {
2920
+ key: 3,
2824
2921
  "data-test": "messaging-transient-issue",
2825
- "data-issue-code": X.value.code,
2826
- class: E(["flex items-center gap-1.5 pl-2 pr-3 pb-1 mb-3 text-[12px] leading-snug", O.value ? "text-theme-600" : "text-white/60"])
2922
+ "data-issue-code": ce.value.code,
2923
+ class: A(["flex items-center gap-1.5 pl-2 pr-3 pb-1 mb-3 text-[12px] leading-snug", R.value ? "text-theme-600" : "text-white/60"])
2827
2924
  }, [
2828
- p[16] || (p[16] = w("i", {
2925
+ f[16] || (f[16] = y("i", {
2829
2926
  class: "i-tabler-alert-circle size-3.5 shrink-0 text-red-500",
2830
2927
  "aria-hidden": "true"
2831
2928
  }, null, -1)),
2832
- w("span", null, [
2833
- At(ne(X.value.message), 1),
2834
- X.value.help ? (v(), S(Me, { key: 0 }, [
2835
- At(ne(X.value.help), 1)
2836
- ], 64)) : G("", !0)
2929
+ y("span", null, [
2930
+ Ct(se(ce.value.message), 1),
2931
+ ce.value.help ? (v(), w($e, { key: 0 }, [
2932
+ Ct(se(ce.value.help), 1)
2933
+ ], 64)) : j("", !0)
2837
2934
  ]),
2838
- X.value.actionUrl && X.value.actionLabel ? (v(), S("a", {
2935
+ ce.value.actionUrl && ce.value.actionLabel ? (v(), w("a", {
2839
2936
  key: 0,
2840
- href: X.value.actionUrl,
2937
+ href: ce.value.actionUrl,
2841
2938
  class: "shrink-0 underline underline-offset-2",
2842
- onClick: p[4] || (p[4] = lt(() => {
2939
+ onClick: f[4] || (f[4] = ht(() => {
2843
2940
  }, ["stop"]))
2844
- }, ne(X.value.actionLabel), 9, Vr)) : G("", !0)
2845
- ], 10, Yr)) : G("", !0),
2846
- ae.value ? (v(), S("div", Zr, [
2847
- w("img", {
2848
- src: i.agent.avatarUrl.value,
2849
- alt: i.agent.displayName.value,
2850
- class: E(["size-7 @sm/chat:size-8 flex-shrink-0 rounded-full object-cover shadow-sm", O.value ? "ring-1 ring-black/5" : ""])
2851
- }, null, 10, Xr),
2852
- w("div", {
2853
- class: E(["rounded-2xl px-3.5 py-2.5 flex items-center", O.value ? "bg-theme-100" : "bg-white/15 backdrop-blur-sm"])
2941
+ }, se(ce.value.actionLabel), 9, Xr)) : j("", !0)
2942
+ ], 10, Zr)) : j("", !0),
2943
+ xt.value ? (v(), w("div", Kr, [
2944
+ y("img", {
2945
+ src: r.agent.avatarUrl.value,
2946
+ alt: r.agent.displayName.value,
2947
+ class: A(["size-7 @sm/chat:size-8 flex-shrink-0 rounded-full object-cover shadow-sm", R.value ? "ring-1 ring-black/5" : ""])
2948
+ }, null, 10, Qr),
2949
+ y("div", {
2950
+ class: A(["rounded-2xl px-3.5 py-2.5 flex items-center", R.value ? "bg-theme-100" : "bg-white/15 backdrop-blur-sm"])
2854
2951
  }, [
2855
- w("i", {
2856
- class: E(["i-svg-spinners-3-dots-bounce size-7", O.value ? "text-theme-400" : "text-white/50"])
2952
+ y("i", {
2953
+ class: A(["i-svg-spinners-3-dots-bounce size-7", R.value ? "text-theme-400" : "text-white/50"])
2857
2954
  }, null, 2)
2858
2955
  ], 2)
2859
- ])) : G("", !0)
2956
+ ])) : j("", !0)
2860
2957
  ], 2)
2861
2958
  ]),
2862
2959
  _: 1
2863
2960
  }, 512),
2864
- w("div", {
2865
- class: E(["absolute bottom-0 left-0 right-0 z-30 px-5 pb-4 pt-3", O.value ? "bg-gradient-to-t from-theme-50/90 via-theme-50/55 to-transparent" : "bg-gradient-to-t from-black/80 via-black/70 to-black/40"])
2961
+ y("div", {
2962
+ class: A(["absolute bottom-0 left-0 right-0 z-30 px-5 pb-4 pt-3", R.value ? "bg-gradient-to-t from-theme-50/90 via-theme-50/55 to-transparent" : "bg-gradient-to-t from-black/80 via-black/70 to-black/40"])
2866
2963
  }, [
2867
- h.value.length > 0 ? (v(), S("div", Kr, [
2868
- (v(!0), S(Me, null, Qt(h.value, (f, A) => (v(), S("div", {
2869
- key: A,
2964
+ h.value.length > 0 ? (v(), w("div", Jr, [
2965
+ (v(!0), w($e, null, tn(h.value, (p, D) => (v(), w("div", {
2966
+ key: D,
2870
2967
  class: "relative shrink-0 group"
2871
2968
  }, [
2872
- f.type === "image" ? (v(), S("img", {
2969
+ p.type === "image" ? (v(), w("img", {
2873
2970
  key: 0,
2874
- src: f.src,
2875
- alt: f.filename,
2876
- class: E(["size-14 rounded-xl object-cover border", O.value ? "border-black/10" : "border-white/20"])
2877
- }, null, 10, Qr)) : (v(), S("div", {
2971
+ src: p.src,
2972
+ alt: p.filename,
2973
+ class: A(["size-14 rounded-xl object-cover border", R.value ? "border-black/10" : "border-white/20"])
2974
+ }, null, 10, ea)) : (v(), w("div", {
2878
2975
  key: 1,
2879
- class: E(["h-14 px-3 rounded-xl flex items-center gap-1.5 text-xs border", O.value ? "border-black/10 bg-theme-50 text-theme-600" : "border-white/20 bg-white/10 text-white/70"])
2976
+ class: A(["h-14 px-3 rounded-xl flex items-center gap-1.5 text-xs border", R.value ? "border-black/10 bg-theme-50 text-theme-600" : "border-white/20 bg-white/10 text-white/70"])
2880
2977
  }, [
2881
- p[17] || (p[17] = w("i", { class: "i-tabler-file size-4" }, null, -1)),
2882
- w("span", Jr, ne(f.filename), 1)
2978
+ f[17] || (f[17] = y("i", { class: "i-tabler-file size-4" }, null, -1)),
2979
+ y("span", ta, se(p.filename), 1)
2883
2980
  ], 2)),
2884
- w("button", {
2981
+ y("button", {
2885
2982
  class: "absolute -top-1.5 -right-1.5 size-5 flex items-center justify-center rounded-full bg-theme-800 text-white text-xs scale-0 group-hover:scale-100 transition-transform cursor-pointer",
2886
- onClick: /* @__PURE__ */ d((K) => Bt(A), "onClick")
2887
- }, [...p[18] || (p[18] = [
2888
- w("i", { class: "i-tabler-x size-3" }, null, -1)
2889
- ])], 8, ea)
2983
+ onClick: /* @__PURE__ */ d((J) => lt(D), "onClick")
2984
+ }, [...f[18] || (f[18] = [
2985
+ y("i", { class: "i-tabler-x size-3" }, null, -1)
2986
+ ])], 8, na)
2890
2987
  ]))), 128)),
2891
- c.value ? (v(), S("div", ta, [
2892
- We(jn, { class: "size-5" })
2893
- ])) : G("", !0)
2894
- ])) : G("", !0),
2895
- i.uploadFn ? (v(), S("input", {
2988
+ c.value ? (v(), w("div", sa, [
2989
+ Ye(Gn, { class: "size-5" })
2990
+ ])) : j("", !0)
2991
+ ])) : j("", !0),
2992
+ r.uploadFn ? (v(), w("input", {
2896
2993
  key: 1,
2897
2994
  ref_key: "fileInput",
2898
2995
  ref: o,
2899
2996
  type: "file",
2900
2997
  accept: "image/*,audio/*,video/*",
2901
2998
  class: "hidden",
2902
- onChange: Pt
2903
- }, null, 544)) : G("", !0),
2904
- w("div", {
2905
- class: E(["flex items-end gap-1 w-full rounded-[24px] p-1.5 transition-colors duration-200", O.value ? r.value ? "bg-theme-50 ring-1 ring-theme-300" : "bg-theme-25 ring-1 ring-theme-200 hover:ring-theme-300" : r.value ? "bg-white/15 ring-1 ring-white/25" : "bg-white/10 ring-1 ring-transparent hover:ring-white/15"])
2999
+ onChange: q
3000
+ }, null, 544)) : j("", !0),
3001
+ y("div", {
3002
+ class: A(["flex items-end gap-1 w-full rounded-[24px] p-1.5 transition-colors duration-200", R.value ? i.value ? "bg-theme-50 ring-1 ring-theme-300" : "bg-theme-25 ring-1 ring-theme-200 hover:ring-theme-300" : i.value ? "bg-white/15 ring-1 ring-white/25" : "bg-white/10 ring-1 ring-transparent hover:ring-white/15"])
2906
3003
  }, [
2907
- w("button", {
2908
- class: E(["shrink-0 flex items-center justify-center rounded-full transition-colors mb-0.5 ml-0.5 size-9 @sm/chat:size-10", [
2909
- i.uploadFn ? "cursor-pointer" : "cursor-default",
2910
- O.value ? "text-theme-400 hover:text-theme-600 hover:bg-black/5" : "text-white/50 hover:text-white/80 hover:bg-white/10",
3004
+ y("button", {
3005
+ class: A(["shrink-0 flex items-center justify-center rounded-full transition-colors mb-0.5 ml-0.5 size-9 @sm/chat:size-10", [
3006
+ r.uploadFn ? "cursor-pointer" : "cursor-default",
3007
+ R.value ? "text-theme-400 hover:text-theme-600 hover:bg-black/5" : "text-white/50 hover:text-white/80 hover:bg-white/10",
2911
3008
  c.value ? "opacity-50 pointer-events-none" : ""
2912
3009
  ]]),
2913
- disabled: ve.value || c.value || !i.uploadFn,
2914
- onClick: p[5] || (p[5] = (f) => i.uploadFn && $t())
3010
+ disabled: Ue.value || c.value || !r.uploadFn,
3011
+ onClick: f[5] || (f[5] = (p) => r.uploadFn && at())
2915
3012
  }, [
2916
- c.value ? (v(), S("i", sa)) : (v(), S("i", ia))
2917
- ], 10, na),
2918
- Us(w("textarea", {
3013
+ c.value ? (v(), w("i", ra)) : (v(), w("i", aa))
3014
+ ], 10, ia),
3015
+ Us(y("textarea", {
2919
3016
  ref_key: "textarea",
2920
3017
  ref: l,
2921
- "onUpdate:modelValue": p[6] || (p[6] = (f) => n.value = f),
3018
+ "onUpdate:modelValue": f[6] || (f[6] = (p) => n.value = p),
2922
3019
  "data-test": "messaging-input",
2923
3020
  rows: "1",
2924
3021
  enterkeyhint: "send",
2925
- placeholder: ft.value,
2926
- disabled: ve.value,
3022
+ placeholder: Ht.value,
3023
+ disabled: Ue.value,
2927
3024
  style: { fontSize: "16px", resize: "none" },
2928
- class: E(["flex-1 min-w-0 bg-transparent px-1 py-2 focus:outline-none disabled:opacity-50 overflow-y-auto leading-relaxed [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden", O.value ? "text-theme-800 placeholder-theme-400" : "text-white placeholder-white/50"]),
2929
- onKeydown: Pe,
2930
- onFocus: p[7] || (p[7] = (f) => r.value = !0),
2931
- onBlur: p[8] || (p[8] = (f) => r.value = !1)
2932
- }, null, 42, ra), [
3025
+ class: A(["flex-1 min-w-0 bg-transparent px-1 py-2 focus:outline-none disabled:opacity-50 overflow-y-auto leading-relaxed [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden", R.value ? "text-theme-800 placeholder-theme-400" : "text-white placeholder-white/50"]),
3026
+ onKeydown: wt,
3027
+ onFocus: f[7] || (f[7] = (p) => i.value = !0),
3028
+ onBlur: f[8] || (f[8] = (p) => i.value = !1)
3029
+ }, null, 42, la), [
2933
3030
  [Hs, n.value]
2934
3031
  ]),
2935
- w("button", {
3032
+ y("button", {
2936
3033
  "data-test": "messaging-send-btn",
2937
- class: E(["shrink-0 flex items-center justify-center rounded-full transition-transform duration-200 mb-0.5 mr-0.5 size-9 @sm/chat:size-10", gt.value ? "bg-primary-500 text-white hover:scale-105 active:scale-95 cursor-pointer" : O.value ? "bg-black/5 text-black/20" : "bg-white/10 text-white/30"]),
2938
- disabled: !gt.value,
2939
- onClick: p[9] || (p[9] = (f) => Ce())
2940
- }, [...p[19] || (p[19] = [
2941
- w("i", { class: "i-tabler-arrow-up size-5" }, null, -1)
2942
- ])], 10, aa)
3034
+ class: A(["shrink-0 flex items-center justify-center rounded-full transition-transform duration-200 mb-0.5 mr-0.5 size-9 @sm/chat:size-10", Me.value ? "bg-primary-500 text-white hover:scale-105 active:scale-95 cursor-pointer" : R.value ? "bg-black/5 text-black/20" : "bg-white/10 text-white/30"]),
3035
+ disabled: !Me.value,
3036
+ "aria-label": xe.value ? "Stop reply" : "Send message",
3037
+ onClick: f[9] || (f[9] = (p) => Gt())
3038
+ }, [
3039
+ xe.value ? (v(), w("i", ca)) : (v(), w("i", ua))
3040
+ ], 10, oa)
2943
3041
  ], 2)
2944
3042
  ], 2)
2945
3043
  ]));
2946
3044
  }
2947
- }), la = { class: "agent-wrap" }, oa = {
3045
+ }), ha = { class: "agent-wrap" }, da = {
2948
3046
  key: 0,
2949
3047
  class: "flex items-center justify-center h-full"
2950
- }, ka = /* @__PURE__ */ ye({
3048
+ }, Ta = /* @__PURE__ */ Re({
2951
3049
  __name: "AgentWrap",
2952
3050
  props: {
2953
3051
  sdk: {},
@@ -2960,17 +3058,17 @@ const Ar = ["innerHTML"], Rt = /* @__PURE__ */ ye({
2960
3058
  hasClose: { type: Boolean },
2961
3059
  apiBase: {}
2962
3060
  },
2963
- setup(i) {
2964
- const t = Gs("AgentWrap"), e = i, n = e.sdk || Ws.getInstance({
3061
+ setup(r) {
3062
+ const t = js("AgentWrap"), e = r, n = e.sdk || Ws.getInstance({
2965
3063
  isDev: typeof window < "u" ? window.location.hostname === "localhost" || window.location.hostname.includes("127.0.0.1") : !1,
2966
3064
  ...e.apiBase && { apiBase: e.apiBase }
2967
- }), r = ie(!e.agent), s = ps(e.agent ? new Dt({ config: e.agent }) : void 0), l = ie();
2968
- return Mt(async () => {
3065
+ }), i = ae(!e.agent), s = ps(e.agent ? new Nt({ config: e.agent }) : void 0), l = ae();
3066
+ return Bt(async () => {
2969
3067
  if (e.agent) {
2970
3068
  t.debug("Agent provided via props, skipping fetch", {
2971
3069
  agentId: e.agent.agentId,
2972
3070
  handle: e.agent.handle
2973
- }), r.value = !1;
3071
+ }), i.value = !1;
2974
3072
  return;
2975
3073
  }
2976
3074
  if (!e.handle) {
@@ -2985,13 +3083,13 @@ const Ar = ["innerHTML"], Rt = /* @__PURE__ */ ye({
2985
3083
  isDev: n.isDev,
2986
3084
  apiBase: n.apiBase
2987
3085
  }
2988
- }), r.value = !1;
3086
+ }), i.value = !1;
2989
3087
  return;
2990
3088
  }
2991
3089
  try {
2992
- r.value = !0, t.debug("Fetching public agent", { handle: e.handle });
3090
+ i.value = !0, t.debug("Fetching public agent", { handle: e.handle });
2993
3091
  const o = await n.user.getPublicAgent({ handle: e.handle });
2994
- o ? (s.value = new Dt({ config: o }), t.debug("Successfully fetched public agent", {
3092
+ o ? (s.value = new Nt({ config: o }), t.debug("Successfully fetched public agent", {
2995
3093
  agentId: o.agentId,
2996
3094
  handle: o.handle
2997
3095
  }), o.agentId && n.user.track({
@@ -3023,9 +3121,9 @@ const Ar = ["innerHTML"], Rt = /* @__PURE__ */ ye({
3023
3121
  }
3024
3122
  });
3025
3123
  } finally {
3026
- r.value = !1, s.value || t.debug("AgentWrap component will render empty (silent failure)", {
3124
+ i.value = !1, s.value || t.debug("AgentWrap component will render empty (silent failure)", {
3027
3125
  state: {
3028
- loading: r.value,
3126
+ loading: i.value,
3029
3127
  hasAgent: !!s.value,
3030
3128
  error: l.value
3031
3129
  },
@@ -3041,33 +3139,33 @@ const Ar = ["innerHTML"], Rt = /* @__PURE__ */ ye({
3041
3139
  }
3042
3140
  });
3043
3141
  }
3044
- }), (o, h) => (v(), S("div", la, [
3045
- r.value ? (v(), S("div", oa, [...h[0] || (h[0] = [
3046
- w("div", { class: "animate-spin rounded-full size-6 border-b-2 border-white" }, null, -1)
3047
- ])])) : s.value ? cn(o.$slots, "default", {
3142
+ }), (o, h) => (v(), w("div", ha, [
3143
+ i.value ? (v(), w("div", da, [...h[0] || (h[0] = [
3144
+ y("div", { class: "animate-spin rounded-full size-6 border-b-2 border-white" }, null, -1)
3145
+ ])])) : s.value ? dn(o.$slots, "default", {
3048
3146
  key: 1,
3049
- sdk: rn(n),
3147
+ sdk: on(n),
3050
3148
  agent: s.value,
3051
- context: i.context,
3052
- firstMessage: i.firstMessage,
3053
- buttonText: i.buttonText,
3054
- buttonIcon: i.buttonIcon,
3055
- loading: r.value
3056
- }) : G("", !0)
3149
+ context: r.context,
3150
+ firstMessage: r.firstMessage,
3151
+ buttonText: r.buttonText,
3152
+ buttonIcon: r.buttonIcon,
3153
+ loading: i.value
3154
+ }) : j("", !0)
3057
3155
  ]));
3058
3156
  }
3059
3157
  });
3060
3158
  export {
3061
- Gn as A,
3062
- ka as _,
3063
- xa as a,
3064
- ma as b,
3065
- ga as c,
3066
- ba as d,
3067
- jn as e,
3159
+ jn as A,
3160
+ Ta as _,
3161
+ wa as a,
3162
+ va as b,
3163
+ ka as c,
3164
+ ya as d,
3165
+ Gn as e,
3068
3166
  ai as f,
3069
- pa as g,
3167
+ ba as g,
3070
3168
  qn as h,
3071
- fa as p
3169
+ xa as p
3072
3170
  };
3073
3171
  //# sourceMappingURL=AgentWrap.vue_vue_type_script_setup_true_lang.js.map