@pagelines/sdk 1.0.529 → 1.0.530

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
- var Ln = Object.defineProperty;
2
- var Ms = (a, t, e) => t in a ? Ln(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
3
- var h = (a, t) => Ln(a, "name", { value: t, configurable: !0 });
4
- var D = (a, t, e) => Ms(a, typeof t != "symbol" ? t + "" : t, e);
5
- import { defineComponent as ke, openBlock as T, createElementBlock as A, createElementVNode as S, normalizeClass as _, ref as Z, watch as Ze, computed as U, createCommentVNode as j, renderSlot as en, onMounted as At, Fragment as Ce, renderList as vt, withDirectives as rs, vModelText as as, unref as Xt, toDisplayString as pe, shallowRef as ls, onBeforeUnmount as os, nextTick as Ls, createVNode as Fe, withCtx as Os, createBlock as On, withModifiers as gt, createTextVNode as zn } from "vue";
6
- import { SettingsObject as zs, Agent as wt, getDefaultAvatarUrl as cs, createLogger as Ps } from "@pagelines/core";
7
- import { P as Ns } from "./sdkClient.js";
8
- const $s = { class: "spinner max-w-sm" }, Bs = {
1
+ var Fn = Object.defineProperty;
2
+ var Ps = (i, t, e) => t in i ? Fn(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
3
+ var h = (i, t) => Fn(i, "name", { value: t, configurable: !0 });
4
+ var M = (i, t, e) => Ps(i, typeof t != "symbol" ? t + "" : t, e);
5
+ import { defineComponent as ke, openBlock as T, createElementBlock as A, createElementVNode as S, normalizeClass as _, ref as K, watch as Je, computed as U, createCommentVNode as q, renderSlot as ln, onMounted as Ot, Fragment as De, renderList as Rt, withDirectives as ps, vModelText as ds, unref as nn, toDisplayString as ce, shallowRef as fs, onBeforeUnmount as gs, nextTick as Fs, createVNode as He, withCtx as Bs, createBlock as Bn, withModifiers as Tt, createTextVNode as Un } from "vue";
6
+ import { SettingsObject as Us, Agent as It, getDefaultAvatarUrl as ms, createLogger as Hs } from "@pagelines/core";
7
+ import { P as js } from "./sdkClient.js";
8
+ const Gs = { class: "spinner max-w-sm" }, Ws = {
9
9
  class: "ring-circular h-full w-full origin-center",
10
10
  viewBox: "25 25 50 50"
11
- }, Pn = /* @__PURE__ */ ke({
11
+ }, Hn = /* @__PURE__ */ ke({
12
12
  __name: "FSpinner",
13
13
  props: {
14
14
  width: { type: String, default: "" },
15
15
  colorMode: { type: String, default: "primary" }
16
16
  },
17
- setup(a) {
18
- return (t, e) => (T(), A("div", $s, [
19
- (T(), A("svg", Bs, [
17
+ setup(i) {
18
+ return (t, e) => (T(), A("div", Gs, [
19
+ (T(), A("svg", Ws, [
20
20
  S("circle", {
21
- class: _([a.colorMode, "ring-path"]),
21
+ class: _([i.colorMode, "ring-path"]),
22
22
  cx: "50",
23
23
  cy: "50",
24
24
  r: "20",
@@ -30,27 +30,27 @@ const $s = { class: "spinner max-w-sm" }, Bs = {
30
30
  ]))
31
31
  ]));
32
32
  }
33
- }), Us = [
33
+ }), qs = [
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
- ], Fs = 9e4, us = /* @__PURE__ */ new Set(["CREDIT_LIMIT", "OVERAGE_CAP"]), Hs = /* @__PURE__ */ new Set([...us, "EMPTY_STREAM", "RATE_LIMIT"]), hn = class hn extends zs {
36
+ ], Vs = 9e4, bs = /* @__PURE__ */ new Set(["CREDIT_LIMIT", "OVERAGE_CAP"]), Ys = /* @__PURE__ */ new Set([...bs, "EMPTY_STREAM", "RATE_LIMIT"]), bn = class bn extends Us {
37
37
  constructor(e) {
38
38
  super("AgentChatController", e);
39
- D(this, "isTextMode", !1);
40
- D(this, "lastMessage", { hash: "", time: 0 });
41
- D(this, "isConnecting", !1);
39
+ M(this, "isTextMode", !1);
40
+ M(this, "lastMessage", { hash: "", time: 0 });
41
+ M(this, "isConnecting", !1);
42
42
  // Chat conversation tracking (server-managed persistence)
43
- D(this, "conversationId");
44
- D(this, "textState", Z({
43
+ M(this, "conversationId");
44
+ M(this, "textState", K({
45
45
  isActive: !1,
46
46
  isConnected: !1,
47
47
  isThinking: !1,
48
48
  connectionStatus: "disconnected"
49
49
  }));
50
- D(this, "agentMode", Z("self"));
51
- D(this, "sharedMessages", Z([]));
52
- D(this, "_agent");
53
- this._agent = e.agent instanceof wt ? e.agent : new wt({ config: e.agent }), this.setupModeWatcher(), this.setupAvailabilityWatcher();
50
+ M(this, "agentMode", K("self"));
51
+ M(this, "sharedMessages", K([]));
52
+ M(this, "_agent");
53
+ this._agent = e.agent instanceof It ? e.agent : new It({ config: e.agent }), this.setupModeWatcher(), this.setupAvailabilityWatcher();
54
54
  }
55
55
  get chatEnabled() {
56
56
  const e = this._agent.state.value.lifecycle;
@@ -76,13 +76,13 @@ const $s = { class: "spinner max-w-sm" }, Bs = {
76
76
  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]");
77
77
  }
78
78
  isDuplicateMessage(e, n) {
79
- const i = `${n}:${e.toLowerCase().trim()}`, s = Date.now(), l = i === this.lastMessage.hash && s - this.lastMessage.time < 500;
80
- return l || (this.lastMessage = { hash: i, time: s }), l;
79
+ const r = `${n}:${e.toLowerCase().trim()}`, s = Date.now(), l = r === this.lastMessage.hash && s - this.lastMessage.time < 500;
80
+ return l || (this.lastMessage = { hash: r, time: s }), l;
81
81
  }
82
- addMessage(e, n, i, s) {
82
+ addMessage(e, n, r, s) {
83
83
  this.isDuplicateMessage(e, n) || (this.sharedMessages.value = [
84
84
  ...this.sharedMessages.value,
85
- { id: Date.now().toString(), text: e, sender: n, timestamp: (/* @__PURE__ */ new Date()).toISOString(), attachments: i, ...s ? { issue: s } : {} }
85
+ { id: Date.now().toString(), text: e, sender: n, timestamp: (/* @__PURE__ */ new Date()).toISOString(), attachments: r, ...s ? { issue: s } : {} }
86
86
  ]);
87
87
  }
88
88
  /**
@@ -100,13 +100,13 @@ const $s = { class: "spinner max-w-sm" }, Bs = {
100
100
  getDynamicSettings() {
101
101
  const { sdk: e } = this.settings;
102
102
  if (!e) return { context: this.settings.context || "", firstMessage: this.settings.firstMessage || "" };
103
- const n = e.activeUser.value, i = n?.agents?.find((l) => l.agentId === n.primaryAgentId), s = n ? `
103
+ const n = e.activeUser.value, r = n?.agents?.find((l) => l.agentId === n.primaryAgentId), s = n ? `
104
104
 
105
105
  Current User:
106
- - Name: ${i?.name || "Anonymous"}
106
+ - Name: ${r?.name || "Anonymous"}
107
107
  - Email: ${n.email}
108
- - Title: ${i?.title || ""}
109
- - About: ${i?.summary || ""}
108
+ - Title: ${r?.title || ""}
109
+ - About: ${r?.summary || ""}
110
110
  ` : "";
111
111
  return {
112
112
  context: `${this.settings.context || ""}${s}`.trim(),
@@ -126,12 +126,12 @@ Current User:
126
126
  });
127
127
  }
128
128
  setupModeWatcher() {
129
- Ze(this.agentMode, async (e, n) => {
129
+ Je(this.agentMode, async (e, n) => {
130
130
  this.logger.info(`Mode changed from ${n} to ${e}`), this.isTextMode && (n === "talk" || n === "chat") && await this.endConversation();
131
131
  });
132
132
  }
133
133
  setupAvailabilityWatcher() {
134
- Ze(() => this.chatEnabled, (e) => {
134
+ Je(() => this.chatEnabled, (e) => {
135
135
  if (!(!this.isTextMode || this.isConnecting)) {
136
136
  if (e) {
137
137
  this.textState.value.isConnected || this.updateState(this.textState, {
@@ -158,9 +158,9 @@ Current User:
158
158
  * agent/client.ts survive into the console line).
159
159
  */
160
160
  handleError(e, n) {
161
- const i = e.message;
162
- this.logger.error("Conversation error:", { message: i, raw: n, error: e }), this.addMessage(i, "system"), this.resetState(), this.updateState(this.textState, {
163
- error: i,
161
+ const r = e.message;
162
+ this.logger.error("Conversation error:", { message: r, raw: n, error: e }), this.addMessage(r, "system"), this.resetState(), this.updateState(this.textState, {
163
+ error: r,
164
164
  connectionStatus: "error"
165
165
  });
166
166
  }
@@ -202,86 +202,86 @@ Current User:
202
202
  async sendChatMessage(e, n) {
203
203
  if (!this.isTextMode)
204
204
  return;
205
- const { chatStreamFn: i } = this.settings;
205
+ const { chatStreamFn: r } = this.settings;
206
206
  if (!this.chatEnabled) {
207
207
  this.addMessage("Agent is currently offline.", "system");
208
208
  return;
209
209
  }
210
210
  const { sdk: s } = this.settings;
211
- if (!i && !this._agent.handle.value) {
211
+ if (!r && !this._agent.handle.value) {
212
212
  this.handleError(new Error("Agent handle required for chat"));
213
213
  return;
214
214
  }
215
215
  this.addMessage(e, "user", n), this.updateState(this.textState, { isThinking: !0 });
216
216
  const l = `stream-${Date.now()}`;
217
217
  let o = !1, p = !1;
218
- const c = /* @__PURE__ */ h((f, E = "assistant") => {
218
+ const c = /* @__PURE__ */ h((f, v = "assistant") => {
219
219
  o || (o = !0, this.sharedMessages.value = [
220
220
  ...this.sharedMessages.value,
221
- { id: l, text: "", sender: E === "system" ? "system" : "agent", timestamp: (/* @__PURE__ */ new Date()).toISOString() }
221
+ { id: l, text: "", sender: v === "system" ? "system" : "agent", timestamp: (/* @__PURE__ */ new Date()).toISOString() }
222
222
  ]);
223
- const I = this.sharedMessages.value, z = I[I.length - 1];
224
- z?.id === l && (z.text += f, this.sharedMessages.value = [...I]);
225
- }, "onDelta"), v = /* @__PURE__ */ h((f) => {
223
+ const C = this.sharedMessages.value, z = C[C.length - 1];
224
+ z?.id === l && (z.text += f, this.sharedMessages.value = [...C]);
225
+ }, "onDelta"), x = /* @__PURE__ */ h((f) => {
226
226
  p = !0, o = !0;
227
- const E = this.sharedMessages.value, I = E.findIndex((z) => z.id === f.id);
228
- if (I >= 0)
227
+ const v = this.sharedMessages.value, C = v.findIndex((z) => z.id === f.id);
228
+ if (C >= 0)
229
229
  this.sharedMessages.value = [
230
- ...E.slice(0, I),
230
+ ...v.slice(0, C),
231
231
  f,
232
- ...E.slice(I + 1)
232
+ ...v.slice(C + 1)
233
233
  ];
234
234
  else {
235
- const z = E[E.length - 1];
236
- this.sharedMessages.value = z?.id === l ? [...E.slice(0, -1), f] : [...E, f];
235
+ const z = v[v.length - 1];
236
+ this.sharedMessages.value = z?.id === l ? [...v.slice(0, -1), f] : [...v, f];
237
237
  }
238
238
  f.sender === "system" && f.issue?.bucket === "account" && this.updateState(this.textState, { accountGated: !0 });
239
239
  }, "onMessage"), d = /* @__PURE__ */ h((f) => {
240
240
  if (!o && !p) {
241
- x("empty_stream — assistant returned no content");
241
+ m("empty_stream — assistant returned no content");
242
242
  return;
243
243
  }
244
- const E = this.sharedMessages.value, I = E[E.length - 1];
245
- if (I?.id === l && I.sender === "agent" && I.text) {
246
- let z = I.text;
247
- for (const Q of Us)
248
- Q.pattern.test(z) && (console.debug(`[chat] filtered directive: ${Q.label}`), z = z.replace(Q.pattern, "").trim(), Q.pattern.lastIndex = 0);
249
- z ? z !== I.text && (I.text = z, this.sharedMessages.value = [...E]) : this.sharedMessages.value = E.slice(0, -1);
244
+ const v = this.sharedMessages.value, C = v[v.length - 1];
245
+ if (C?.id === l && C.sender === "agent" && C.text) {
246
+ let z = C.text;
247
+ for (const ee of qs)
248
+ ee.pattern.test(z) && (console.debug(`[chat] filtered directive: ${ee.label}`), z = z.replace(ee.pattern, "").trim(), ee.pattern.lastIndex = 0);
249
+ z ? z !== C.text && (C.text = z, this.sharedMessages.value = [...v]) : this.sharedMessages.value = v.slice(0, -1);
250
250
  }
251
251
  f && (this.conversationId = f), this.updateState(this.textState, { isThinking: !1 });
252
- }, "onDone"), x = /* @__PURE__ */ h((f) => {
253
- const E = this.sharedMessages.value, I = E[E.length - 1];
254
- if (I?.id === l && !I.text && (this.sharedMessages.value = E.slice(0, -1)), typeof f == "object" && f.code && f.error) {
255
- const { bucket: W, actionUrl: N, actionLabel: ie, help: se } = f;
256
- if (W !== void 0 || Hs.has(f.code)) {
257
- const Oe = W ?? (us.has(f.code) ? "account" : "error"), ze = {
252
+ }, "onDone"), m = /* @__PURE__ */ h((f) => {
253
+ const v = this.sharedMessages.value, C = v[v.length - 1];
254
+ if (C?.id === l && !C.text && (this.sharedMessages.value = v.slice(0, -1)), typeof f == "object" && f.code && f.error) {
255
+ const { bucket: te, actionUrl: re, actionLabel: ge, help: $ } = f;
256
+ if (te !== void 0 || Ys.has(f.code)) {
257
+ const me = te ?? (bs.has(f.code) ? "account" : "error"), ye = {
258
258
  code: f.code,
259
- bucket: Oe,
260
- ...ie ? { actionLabel: ie } : {},
261
- ...N ? { actionUrl: N } : {},
262
- ...se ? { help: se } : {}
259
+ bucket: me,
260
+ ...ge ? { actionLabel: ge } : {},
261
+ ...re ? { actionUrl: re } : {},
262
+ ...$ ? { help: $ } : {}
263
263
  };
264
- this.addMessage(f.error, "system", void 0, ze), Oe === "account" ? this.updateState(this.textState, { isThinking: !1, accountGated: !0 }) : this.updateState(this.textState, { isThinking: !1 });
264
+ this.addMessage(f.error, "system", void 0, ye), me === "account" ? this.updateState(this.textState, { isThinking: !1, accountGated: !0 }) : this.updateState(this.textState, { isThinking: !1 });
265
265
  } else
266
266
  this.handleError(new Error(f.error));
267
267
  return;
268
268
  }
269
- const z = typeof f == "string" ? f : f.error, Q = this.mapChatError(z);
270
- this.isTransientError(z) ? (this.logger.warn("Chat turn failed (transient):", { raw: z, friendly: Q }), this.addMessage(Q, "system"), this.updateState(this.textState, { isThinking: !1 })) : this.handleError(new Error(Q), z);
271
- }, "onError"), m = /* @__PURE__ */ h((f) => {
269
+ const z = typeof f == "string" ? f : f.error, ee = this.mapChatError(z);
270
+ this.isTransientError(z) ? (this.logger.warn("Chat turn failed (transient):", { raw: z, friendly: ee }), this.addMessage(ee, "system"), this.updateState(this.textState, { isThinking: !1 })) : this.handleError(new Error(ee), z);
271
+ }, "onError"), b = /* @__PURE__ */ h((f) => {
272
272
  this.addMessage(f, "system");
273
273
  }, "onStatus");
274
274
  try {
275
- const f = i ? i({
275
+ const f = r ? r({
276
276
  message: e,
277
277
  attachments: n,
278
278
  conversationId: this.conversationId,
279
279
  history: this.buildHistory(),
280
280
  onDelta: c,
281
- onMessage: v,
281
+ onMessage: x,
282
282
  onDone: d,
283
- onError: x,
284
- onStatus: m
283
+ onError: m,
284
+ onStatus: b
285
285
  }) : s.chat.chatStreamPublic({
286
286
  handle: this._agent.handle.value,
287
287
  message: e,
@@ -289,17 +289,17 @@ Current User:
289
289
  anonymousId: s.user.generateAnonId(),
290
290
  context: this.getDynamicSettings().context || void 0,
291
291
  onDelta: c,
292
- onMessage: v,
292
+ onMessage: x,
293
293
  onDone: d,
294
- onError: x,
295
- onStatus: m
294
+ onError: m,
295
+ onStatus: b
296
296
  });
297
297
  await Promise.race([
298
298
  f,
299
- new Promise((E, I) => setTimeout(() => I(new Error("timed out")), Fs))
299
+ new Promise((v, C) => setTimeout(() => C(new Error("timed out")), Vs))
300
300
  ]);
301
301
  } catch (f) {
302
- x(f.message || "Something went wrong");
302
+ m(f.message || "Something went wrong");
303
303
  }
304
304
  }
305
305
  buildHistory() {
@@ -319,30 +319,30 @@ Current User:
319
319
  await this.endConversation();
320
320
  }
321
321
  };
322
- h(hn, "AgentChatController");
323
- let Nn = hn;
324
- function $n(a) {
325
- return a ? typeof a == "string" ? a : a.src || "" : "";
322
+ h(bn, "AgentChatController");
323
+ let jn = bn;
324
+ function Gn(i) {
325
+ return i ? typeof i == "string" ? i : i.src || "" : "";
326
326
  }
327
- h($n, "getImageSrc");
328
- function Zr(a) {
329
- return $n(a.cover) || $n(a.avatar) || cs(a.name);
327
+ h(Gn, "getImageSrc");
328
+ function la(i) {
329
+ return Gn(i.cover) || Gn(i.avatar) || ms(i.name);
330
330
  }
331
- h(Zr, "getAgentAvatarUrl");
332
- function Bn(a) {
333
- const t = a.target;
334
- t.dataset.fallbackUsed || (t.dataset.fallbackUsed = "true", t.src = cs());
331
+ h(la, "getAgentAvatarUrl");
332
+ function Wn(i) {
333
+ const t = i.target;
334
+ t.dataset.fallbackUsed || (t.dataset.fallbackUsed = "true", t.src = ms());
335
335
  }
336
- h(Bn, "handleImageError");
337
- function Xr(a) {
338
- const { template: t, agent: e } = a;
336
+ h(Wn, "handleImageError");
337
+ function oa(i) {
338
+ const { template: t, agent: e } = i;
339
339
  return t.replace(/{name}/g, e.name || "Assistant").replace(/{title}/g, e.title || "").replace(/{handle}/g, e.handle || "").replace(/{orgName}/g, e.org?.name || "");
340
340
  }
341
- h(Xr, "parseButtonTemplate");
342
- const Gs = {
341
+ h(oa, "parseButtonTemplate");
342
+ const Zs = {
343
343
  key: 0,
344
344
  class: "absolute inset-0 flex items-center justify-center"
345
- }, Kr = /* @__PURE__ */ ke({
345
+ }, ca = /* @__PURE__ */ ke({
346
346
  __name: "ElAgentButton",
347
347
  props: {
348
348
  theme: { default: "primary" },
@@ -351,61 +351,61 @@ const Gs = {
351
351
  icon: {},
352
352
  iconAfter: {}
353
353
  },
354
- setup(a) {
354
+ setup(i) {
355
355
  const t = U(() => ({
356
356
  primary: "bg-primary-600 border-primary-400 hover:border-primary-300 hover:bg-primary-500",
357
357
  green: "bg-green-600 border-green-400 hover:border-green-300 hover:bg-green-500",
358
358
  red: "bg-red-600 border-red-400 hover:border-red-300 hover:bg-red-500",
359
359
  default: "bg-white/10 border-white/20 hover:border-white/40 hover:bg-white/20"
360
- })[a.theme]), e = U(() => ({
360
+ })[i.theme]), e = U(() => ({
361
361
  sm: "px-4 py-2 text-sm",
362
362
  md: "px-6 py-3 text-base",
363
363
  lg: "px-8 py-4 text-base"
364
- })[a.size]), n = U(() => ({
364
+ })[i.size]), n = U(() => ({
365
365
  sm: "size-4",
366
366
  md: "size-4",
367
367
  lg: "size-5"
368
- })[a.size]);
369
- return (i, s) => (T(), A("button", {
368
+ })[i.size]);
369
+ return (r, s) => (T(), A("button", {
370
370
  class: _(["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]])
371
371
  }, [
372
- a.loading ? (T(), A("div", Gs, [...s[0] || (s[0] = [
372
+ i.loading ? (T(), A("div", Zs, [...s[0] || (s[0] = [
373
373
  S("i", { class: "i-svg-spinners-90-ring-with-bg size-5" }, null, -1)
374
- ])])) : j("", !0),
374
+ ])])) : q("", !0),
375
375
  S("span", {
376
- class: _(["flex items-center gap-2 transition-opacity duration-200", a.loading ? "opacity-0" : "opacity-100"])
376
+ class: _(["flex items-center gap-2 transition-opacity duration-200", i.loading ? "opacity-0" : "opacity-100"])
377
377
  }, [
378
- a.icon ? (T(), A("i", {
378
+ i.icon ? (T(), A("i", {
379
379
  key: 0,
380
- class: _([a.icon, n.value])
381
- }, null, 2)) : j("", !0),
382
- en(i.$slots, "default"),
383
- a.iconAfter ? (T(), A("i", {
380
+ class: _([i.icon, n.value])
381
+ }, null, 2)) : q("", !0),
382
+ ln(r.$slots, "default"),
383
+ i.iconAfter ? (T(), A("i", {
384
384
  key: 1,
385
- class: _([a.iconAfter, n.value])
386
- }, null, 2)) : j("", !0)
385
+ class: _([i.iconAfter, n.value])
386
+ }, null, 2)) : q("", !0)
387
387
  ], 2)
388
388
  ], 2));
389
389
  }
390
- }), js = ["value"], Qr = /* @__PURE__ */ ke({
390
+ }), Xs = ["value"], ua = /* @__PURE__ */ ke({
391
391
  __name: "AgentInputEmail",
392
392
  props: {
393
393
  modelValue: { default: "" }
394
394
  },
395
395
  emits: ["update:modelValue"],
396
- setup(a, { emit: t }) {
396
+ setup(i, { emit: t }) {
397
397
  const e = t;
398
- return (n, i) => (T(), A("input", {
398
+ return (n, r) => (T(), A("input", {
399
399
  type: "email",
400
400
  autocomplete: "email",
401
401
  placeholder: "Enter your email",
402
- value: a.modelValue,
402
+ value: i.modelValue,
403
403
  class: "w-full px-6 py-3 text-theme-900 placeholder-theme-500 bg-white border border-white rounded-full focus:outline-none transition-all",
404
404
  style: { "font-size": "16px" },
405
- onInput: i[0] || (i[0] = (s) => e("update:modelValue", s.target.value))
406
- }, null, 40, js));
405
+ onInput: r[0] || (r[0] = (s) => e("update:modelValue", s.target.value))
406
+ }, null, 40, Xs));
407
407
  }
408
- }), Ws = { class: "flex gap-1.5 justify-center" }, qs = ["onUpdate:modelValue", "onInput", "onKeydown", "onPaste", "onFocus"], Jr = /* @__PURE__ */ ke({
408
+ }), Ks = { class: "flex gap-1.5 justify-center" }, Qs = ["onUpdate:modelValue", "onInput", "onKeydown", "onPaste", "onFocus"], ha = /* @__PURE__ */ ke({
409
409
  __name: "AgentInputOneTimeCode",
410
410
  props: {
411
411
  modelValue: {},
@@ -413,74 +413,74 @@ const Gs = {
413
413
  focusFirst: { type: Boolean }
414
414
  },
415
415
  emits: ["update:modelValue", "autoSubmit"],
416
- setup(a, { emit: t }) {
417
- const e = a, n = t, i = Z([]), s = Z(Array.from({ length: e.length }).fill("")), l = Z(!1);
418
- At(() => {
419
- e.modelValue && (s.value = e.modelValue.split("").slice(0, e.length)), e.focusFirst && !("ontouchstart" in window) && i.value[0]?.focus();
420
- }), Ze(() => e.modelValue, (d) => {
416
+ setup(i, { emit: t }) {
417
+ const e = i, n = t, r = K([]), s = K(Array.from({ length: e.length }).fill("")), l = K(!1);
418
+ Ot(() => {
419
+ e.modelValue && (s.value = e.modelValue.split("").slice(0, e.length)), e.focusFirst && !("ontouchstart" in window) && r.value[0]?.focus();
420
+ }), Je(() => e.modelValue, (d) => {
421
421
  s.value = d ? d.split("").slice(0, e.length) : Array.from({ length: e.length }).fill("");
422
- }), Ze(s, () => {
422
+ }), Je(s, () => {
423
423
  const d = s.value.filter(Boolean).join("");
424
424
  n("update:modelValue", d), d.length === e.length && n("autoSubmit", d);
425
425
  }, { deep: !0 });
426
- function o(d, x) {
427
- x.preventDefault(), l.value = !0;
428
- const m = (x.clipboardData?.getData("text") || "").replace(/\D/g, "");
429
- if (m.length === e.length)
430
- s.value = m.split(""), setTimeout(() => {
431
- i.value[e.length - 1]?.focus(), l.value = !1;
426
+ function o(d, m) {
427
+ m.preventDefault(), l.value = !0;
428
+ const b = (m.clipboardData?.getData("text") || "").replace(/\D/g, "");
429
+ if (b.length === e.length)
430
+ s.value = b.split(""), setTimeout(() => {
431
+ r.value[e.length - 1]?.focus(), l.value = !1;
432
432
  }, 10);
433
433
  else {
434
434
  const f = [...s.value];
435
- m.split("").slice(0, e.length - d).forEach((I, z) => {
436
- f[d + z] = I;
435
+ b.split("").slice(0, e.length - d).forEach((C, z) => {
436
+ f[d + z] = C;
437
437
  }), s.value = f;
438
- const E = Math.min(d + m.length, e.length - 1);
438
+ const v = Math.min(d + b.length, e.length - 1);
439
439
  setTimeout(() => {
440
- i.value[E]?.focus(), l.value = !1;
440
+ r.value[v]?.focus(), l.value = !1;
441
441
  }, 10);
442
442
  }
443
443
  }
444
444
  h(o, "onPaste");
445
- function p(d, x) {
446
- const m = x.target.value.slice(-1).replace(/\D/g, "");
447
- s.value[d] = m, m && d < e.length - 1 && i.value[d + 1]?.focus();
445
+ function p(d, m) {
446
+ const b = m.target.value.slice(-1).replace(/\D/g, "");
447
+ s.value[d] = b, b && d < e.length - 1 && r.value[d + 1]?.focus();
448
448
  }
449
449
  h(p, "onInput");
450
- function c(d, x) {
451
- x.key === "Backspace" ? (x.preventDefault(), s.value[d] = "", d > 0 && i.value[d - 1]?.focus()) : x.key === "ArrowLeft" && d > 0 ? i.value[d - 1]?.focus() : x.key === "ArrowRight" && d < e.length - 1 && i.value[d + 1]?.focus();
450
+ function c(d, m) {
451
+ m.key === "Backspace" ? (m.preventDefault(), s.value[d] = "", d > 0 && r.value[d - 1]?.focus()) : m.key === "ArrowLeft" && d > 0 ? r.value[d - 1]?.focus() : m.key === "ArrowRight" && d < e.length - 1 && r.value[d + 1]?.focus();
452
452
  }
453
453
  h(c, "onKeydown");
454
- function v(d) {
455
- if (i.value[d]?.select(), !l.value && s.value[d])
456
- for (let x = d; x < e.length; x++)
457
- s.value[x] = "";
458
- }
459
- return h(v, "onFocus"), (d, x) => (T(), A("div", Ws, [
460
- (T(!0), A(Ce, null, vt(a.length, (m) => rs((T(), A("input", {
461
- key: m,
454
+ function x(d) {
455
+ if (r.value[d]?.select(), !l.value && s.value[d])
456
+ for (let m = d; m < e.length; m++)
457
+ s.value[m] = "";
458
+ }
459
+ return h(x, "onFocus"), (d, m) => (T(), A("div", Ks, [
460
+ (T(!0), A(De, null, Rt(i.length, (b) => ps((T(), A("input", {
461
+ key: b,
462
462
  ref_for: !0,
463
- ref: /* @__PURE__ */ h((f) => i.value[m - 1] = f, "ref"),
464
- "onUpdate:modelValue": /* @__PURE__ */ h((f) => s.value[m - 1] = f, "onUpdate:modelValue"),
463
+ ref: /* @__PURE__ */ h((f) => r.value[b - 1] = f, "ref"),
464
+ "onUpdate:modelValue": /* @__PURE__ */ h((f) => s.value[b - 1] = f, "onUpdate:modelValue"),
465
465
  type: "text",
466
466
  inputmode: "numeric",
467
467
  autocomplete: "one-time-code",
468
468
  class: "size-11 text-center font-mono text-theme-900 bg-white border border-white rounded-lg focus:outline-none transition-all",
469
469
  style: { "font-size": "16px" },
470
470
  maxlength: "1",
471
- onInput: /* @__PURE__ */ h((f) => p(m - 1, f), "onInput"),
472
- onKeydown: /* @__PURE__ */ h((f) => c(m - 1, f), "onKeydown"),
473
- onPaste: /* @__PURE__ */ h((f) => o(m - 1, f), "onPaste"),
474
- onFocus: /* @__PURE__ */ h((f) => v(m - 1), "onFocus")
475
- }, null, 40, qs)), [
476
- [as, s.value[m - 1]]
471
+ onInput: /* @__PURE__ */ h((f) => p(b - 1, f), "onInput"),
472
+ onKeydown: /* @__PURE__ */ h((f) => c(b - 1, f), "onKeydown"),
473
+ onPaste: /* @__PURE__ */ h((f) => o(b - 1, f), "onPaste"),
474
+ onFocus: /* @__PURE__ */ h((f) => x(b - 1), "onFocus")
475
+ }, null, 40, Qs)), [
476
+ [ds, s.value[b - 1]]
477
477
  ])), 128))
478
478
  ]));
479
479
  }
480
- }), Vs = { class: "relative flex-shrink-0" }, Ys = ["src", "alt"], Zs = { class: "absolute top-1 right-1" }, Xs = {
480
+ }), Js = { class: "relative flex-shrink-0" }, er = ["src", "alt"], tr = { class: "absolute top-1 right-1" }, nr = {
481
481
  key: 1,
482
482
  class: "size-3 bg-theme-400 rounded-full ring-2 ring-white"
483
- }, Ks = { class: "min-w-0" }, Qs = /* @__PURE__ */ ke({
483
+ }, sr = { class: "min-w-0" }, rr = /* @__PURE__ */ ke({
484
484
  __name: "ElModeHeader",
485
485
  props: {
486
486
  agent: {},
@@ -488,219 +488,241 @@ const Gs = {
488
488
  isOnline: { type: Boolean, default: !1 },
489
489
  layout: { default: "centered" }
490
490
  },
491
- setup(a) {
491
+ setup(i) {
492
492
  return (t, e) => (T(), A("div", {
493
493
  class: _(["flex gap-4", [
494
- a.layout === "centered" ? "flex-col items-center text-center" : "flex-row items-center justify-center"
494
+ i.layout === "centered" ? "flex-col items-center text-center" : "flex-row items-center justify-center"
495
495
  ]])
496
496
  }, [
497
- S("div", Vs, [
497
+ S("div", Js, [
498
498
  S("div", {
499
- class: _(["rounded-full overflow-hidden border-white", a.size === "lg" ? "w-20 h-20 sm:w-24 sm:h-24 border-4" : "w-16 sm:size-16 border-2"])
499
+ class: _(["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"])
500
500
  }, [
501
501
  S("img", {
502
- src: a.agent.avatarUrl.value,
503
- alt: a.agent.displayName.value,
502
+ src: i.agent.avatarUrl.value,
503
+ alt: i.agent.displayName.value,
504
504
  class: "w-full h-full object-cover",
505
505
  onError: e[0] || (e[0] = //@ts-ignore
506
- (...n) => Xt(Bn) && Xt(Bn)(...n))
507
- }, null, 40, Ys)
506
+ (...n) => nn(Wn) && nn(Wn)(...n))
507
+ }, null, 40, er)
508
508
  ], 2),
509
- S("div", Zs, [
510
- a.isOnline ? (T(), A(Ce, { key: 0 }, [
509
+ S("div", tr, [
510
+ i.isOnline ? (T(), A(De, { key: 0 }, [
511
511
  e[1] || (e[1] = S("div", {
512
512
  class: "size-3 bg-green-500 rounded-full ring-2 ring-white absolute animate-ping",
513
513
  style: { "animation-duration": "3s" }
514
514
  }, null, -1)),
515
515
  e[2] || (e[2] = S("div", { class: "size-3 bg-green-500 rounded-full ring-2 ring-white" }, null, -1))
516
- ], 64)) : (T(), A("div", Xs))
516
+ ], 64)) : (T(), A("div", nr))
517
517
  ])
518
518
  ]),
519
- S("div", Ks, [
519
+ S("div", sr, [
520
520
  S("h1", {
521
521
  class: _(["font-light text-white mb-1 truncate", [
522
- a.size === "lg" ? "text-3xl mb-2" : "text-xl sm:text-2xl tracking-wide leading-tight",
523
- a.layout === "horizontal" ? "text-white/95" : ""
522
+ i.size === "lg" ? "text-3xl mb-2" : "text-xl sm:text-2xl tracking-wide leading-tight",
523
+ i.layout === "horizontal" ? "text-white/95" : ""
524
524
  ]])
525
- }, pe(a.agent.displayName.value), 3),
525
+ }, ce(i.agent.displayName.value), 3),
526
526
  S("p", {
527
527
  class: _(["font-light line-clamp-1", [
528
- a.size === "lg" ? "text-base text-white/60" : "text-sm sm:text-base",
529
- a.layout === "horizontal" ? "text-white/70 truncate" : "text-white/60"
528
+ i.size === "lg" ? "text-base text-white/60" : "text-sm sm:text-base",
529
+ i.layout === "horizontal" ? "text-white/70 truncate" : "text-white/60"
530
530
  ]])
531
- }, pe(a.layout === "horizontal" ? a.agent.title.value || "Assistant" : a.agent.title.value), 3)
531
+ }, ce(i.layout === "horizontal" ? i.agent.title.value || "Assistant" : i.agent.title.value), 3)
532
532
  ])
533
533
  ], 2));
534
534
  }
535
535
  });
536
- const {
537
- entries: hs,
538
- setPrototypeOf: Un,
539
- isFrozen: Js,
540
- getPrototypeOf: ei,
541
- getOwnPropertyDescriptor: ti
542
- } = Object;
543
- let {
544
- freeze: ee,
545
- seal: ce,
546
- create: Ge
547
- } = Object, {
548
- apply: Kt,
549
- construct: Qt
550
- } = typeof Reflect < "u" && Reflect;
551
- ee || (ee = /* @__PURE__ */ h(function(t) {
536
+ function qn(i, t) {
537
+ (t == null || t > i.length) && (t = i.length);
538
+ for (var e = 0, n = Array(t); e < t; e++) n[e] = i[e];
539
+ return n;
540
+ }
541
+ h(qn, "_arrayLikeToArray");
542
+ function ir(i) {
543
+ if (Array.isArray(i)) return i;
544
+ }
545
+ h(ir, "_arrayWithHoles");
546
+ function ar(i, t) {
547
+ var e = i == null ? null : typeof Symbol < "u" && i[Symbol.iterator] || i["@@iterator"];
548
+ if (e != null) {
549
+ var n, r, s, l, o = [], p = !0, c = !1;
550
+ try {
551
+ if (s = (e = e.call(i)).next, t !== 0) for (; !(p = (n = s.call(e)).done) && (o.push(n.value), o.length !== t); p = !0) ;
552
+ } catch (x) {
553
+ c = !0, r = x;
554
+ } finally {
555
+ try {
556
+ if (!p && e.return != null && (l = e.return(), Object(l) !== l)) return;
557
+ } finally {
558
+ if (c) throw r;
559
+ }
560
+ }
561
+ return o;
562
+ }
563
+ }
564
+ h(ar, "_iterableToArrayLimit");
565
+ function lr() {
566
+ throw new TypeError(`Invalid attempt to destructure non-iterable instance.
567
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
568
+ }
569
+ h(lr, "_nonIterableRest");
570
+ function or(i, t) {
571
+ return ir(i) || ar(i, t) || cr(i, t) || lr();
572
+ }
573
+ h(or, "_slicedToArray");
574
+ function cr(i, t) {
575
+ if (i) {
576
+ if (typeof i == "string") return qn(i, t);
577
+ var e = {}.toString.call(i).slice(8, -1);
578
+ 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) ? qn(i, t) : void 0;
579
+ }
580
+ }
581
+ h(cr, "_unsupportedIterableToArray");
582
+ const xs = Object.entries, Vn = Object.setPrototypeOf, ur = Object.isFrozen, hr = Object.getPrototypeOf, pr = Object.getOwnPropertyDescriptor;
583
+ let se = Object.freeze, le = Object.seal, Ye = Object.create, ks = typeof Reflect < "u" && Reflect, sn = ks.apply, rn = ks.construct;
584
+ se || (se = /* @__PURE__ */ h(function(t) {
552
585
  return t;
553
586
  }, "freeze"));
554
- ce || (ce = /* @__PURE__ */ h(function(t) {
587
+ le || (le = /* @__PURE__ */ h(function(t) {
555
588
  return t;
556
589
  }, "seal"));
557
- Kt || (Kt = /* @__PURE__ */ h(function(t, e) {
558
- for (var n = arguments.length, i = new Array(n > 2 ? n - 2 : 0), s = 2; s < n; s++)
559
- i[s - 2] = arguments[s];
560
- return t.apply(e, i);
590
+ sn || (sn = /* @__PURE__ */ h(function(t, e) {
591
+ for (var n = arguments.length, r = new Array(n > 2 ? n - 2 : 0), s = 2; s < n; s++)
592
+ r[s - 2] = arguments[s];
593
+ return t.apply(e, r);
561
594
  }, "apply"));
562
- Qt || (Qt = /* @__PURE__ */ h(function(t) {
563
- for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++)
564
- n[i - 1] = arguments[i];
595
+ rn || (rn = /* @__PURE__ */ h(function(t) {
596
+ for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), r = 1; r < e; r++)
597
+ n[r - 1] = arguments[r];
565
598
  return new t(...n);
566
599
  }, "construct"));
567
- const tt = H(Array.prototype.forEach), ni = H(Array.prototype.lastIndexOf), Fn = H(Array.prototype.pop), nt = H(Array.prototype.push), si = H(Array.prototype.splice), J = Array.isArray, at = H(String.prototype.toLowerCase), Wt = H(String.prototype.toString), Hn = H(String.prototype.match), He = H(String.prototype.replace), Gn = H(String.prototype.indexOf), ii = H(String.prototype.trim), ri = H(Number.prototype.toString), ai = H(Boolean.prototype.toString), jn = typeof BigInt > "u" ? null : H(BigInt.prototype.toString), Wn = typeof Symbol > "u" ? null : H(Symbol.prototype.toString), B = H(Object.prototype.hasOwnProperty), st = H(Object.prototype.toString), Y = H(RegExp.prototype.test), mt = li(TypeError);
568
- function H(a) {
600
+ const je = G(Array.prototype.forEach), dr = G(Array.prototype.lastIndexOf), Yn = G(Array.prototype.pop), Ge = G(Array.prototype.push), fr = G(Array.prototype.splice), ne = Array.isArray, ct = G(String.prototype.toLowerCase), Kt = G(String.prototype.toString), Zn = G(String.prototype.match), We = G(String.prototype.replace), Xn = G(String.prototype.indexOf), gr = G(String.prototype.trim), mr = G(Number.prototype.toString), br = G(Boolean.prototype.toString), Kn = typeof BigInt > "u" ? null : G(BigInt.prototype.toString), Qn = typeof Symbol > "u" ? null : G(Symbol.prototype.toString), B = G(Object.prototype.hasOwnProperty), lt = G(Object.prototype.toString), X = G(RegExp.prototype.test), St = xr(TypeError);
601
+ function G(i) {
569
602
  return function(t) {
570
603
  t instanceof RegExp && (t.lastIndex = 0);
571
- for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++)
572
- n[i - 1] = arguments[i];
573
- return Kt(a, t, n);
604
+ for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), r = 1; r < e; r++)
605
+ n[r - 1] = arguments[r];
606
+ return sn(i, t, n);
574
607
  };
575
608
  }
576
- h(H, "unapply");
577
- function li(a) {
609
+ h(G, "unapply");
610
+ function xr(i) {
578
611
  return function() {
579
612
  for (var t = arguments.length, e = new Array(t), n = 0; n < t; n++)
580
613
  e[n] = arguments[n];
581
- return Qt(a, e);
614
+ return rn(i, e);
582
615
  };
583
616
  }
584
- h(li, "unconstruct");
585
- function R(a, t) {
586
- let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : at;
587
- if (Un && Un(a, null), !J(t))
588
- return a;
617
+ h(xr, "unconstruct");
618
+ function R(i, t) {
619
+ let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ct;
620
+ if (Vn && Vn(i, null), !ne(t))
621
+ return i;
589
622
  let n = t.length;
590
623
  for (; n--; ) {
591
- let i = t[n];
592
- if (typeof i == "string") {
593
- const s = e(i);
594
- s !== i && (Js(t) || (t[n] = s), i = s);
624
+ let r = t[n];
625
+ if (typeof r == "string") {
626
+ const s = e(r);
627
+ s !== r && (ur(t) || (t[n] = s), r = s);
595
628
  }
596
- a[i] = !0;
629
+ i[r] = !0;
597
630
  }
598
- return a;
631
+ return i;
599
632
  }
600
633
  h(R, "addToSet");
601
- function oi(a) {
602
- for (let t = 0; t < a.length; t++)
603
- B(a, t) || (a[t] = null);
604
- return a;
634
+ function kr(i) {
635
+ for (let t = 0; t < i.length; t++)
636
+ B(i, t) || (i[t] = null);
637
+ return i;
605
638
  }
606
- h(oi, "cleanArray");
607
- function ne(a) {
608
- const t = Ge(null);
609
- for (const [e, n] of hs(a))
610
- B(a, e) && (J(n) ? t[e] = oi(n) : n && typeof n == "object" && n.constructor === Object ? t[e] = ne(n) : t[e] = n);
639
+ h(kr, "cleanArray");
640
+ function ae(i) {
641
+ const t = Ye(null);
642
+ for (const n of xs(i)) {
643
+ var e = or(n, 2);
644
+ const r = e[0], s = e[1];
645
+ B(i, r) && (ne(s) ? t[r] = kr(s) : s && typeof s == "object" && s.constructor === Object ? t[r] = ae(s) : t[r] = s);
646
+ }
611
647
  return t;
612
648
  }
613
- h(ne, "clone");
614
- function ci(a) {
615
- switch (typeof a) {
649
+ h(ae, "clone");
650
+ function yr(i) {
651
+ switch (typeof i) {
616
652
  case "string":
617
- return a;
653
+ return i;
618
654
  case "number":
619
- return ri(a);
655
+ return mr(i);
620
656
  case "boolean":
621
- return ai(a);
657
+ return br(i);
622
658
  case "bigint":
623
- return jn ? jn(a) : "0";
659
+ return Kn ? Kn(i) : "0";
624
660
  case "symbol":
625
- return Wn ? Wn(a) : "Symbol()";
661
+ return Qn ? Qn(i) : "Symbol()";
626
662
  case "undefined":
627
- return st(a);
663
+ return lt(i);
628
664
  case "function":
629
665
  case "object": {
630
- if (a === null)
631
- return st(a);
632
- const t = a, e = je(t, "toString");
666
+ if (i === null)
667
+ return lt(i);
668
+ const t = i, e = Ce(t, "toString");
633
669
  if (typeof e == "function") {
634
670
  const n = e(t);
635
- return typeof n == "string" ? n : st(n);
671
+ return typeof n == "string" ? n : lt(n);
636
672
  }
637
- return st(a);
673
+ return lt(i);
638
674
  }
639
675
  default:
640
- return st(a);
676
+ return lt(i);
641
677
  }
642
678
  }
643
- h(ci, "stringifyValue");
644
- function je(a, t) {
645
- for (; a !== null; ) {
646
- const n = ti(a, t);
679
+ h(yr, "stringifyValue");
680
+ function Ce(i, t) {
681
+ for (; i !== null; ) {
682
+ const n = pr(i, t);
647
683
  if (n) {
648
684
  if (n.get)
649
- return H(n.get);
685
+ return G(n.get);
650
686
  if (typeof n.value == "function")
651
- return H(n.value);
687
+ return G(n.value);
652
688
  }
653
- a = ei(a);
689
+ i = hr(i);
654
690
  }
655
691
  function e() {
656
692
  return null;
657
693
  }
658
694
  return h(e, "fallbackValue"), e;
659
695
  }
660
- h(je, "lookupGetter");
661
- function ui(a) {
696
+ h(Ce, "lookupGetter");
697
+ function wr(i) {
662
698
  try {
663
- return Y(a, ""), !0;
699
+ return X(i, ""), !0;
664
700
  } catch {
665
701
  return !1;
666
702
  }
667
703
  }
668
- h(ui, "isRegex");
669
- const qn = ee(["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"]), qt = ee(["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"]), Vt = ee(["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"]), hi = ee(["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"]), Yt = ee(["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"]), pi = ee(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Vn = ee(["#text"]), Yn = ee(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "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"]), Zt = ee(["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"]), Zn = ee(["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"]), xt = ee(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), di = ce(/\{\{[\w\W]*|[\w\W]*\}\}/gm), fi = ce(/<%[\w\W]*|[\w\W]*%>/gm), gi = ce(/\$\{[\w\W]*/gm), mi = ce(/^data-[\-\w.\u00B7-\uFFFF]+$/), xi = ce(/^aria-[\-\w]+$/), ps = ce(
704
+ h(wr, "isRegex");
705
+ const Jn = se(["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"]), Qt = se(["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"]), Jt = se(["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"]), vr = se(["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"]), en = se(["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"]), Tr = se(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), es = se(["#text"]), ts = se(["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"]), tn = se(["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"]), ns = se(["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"]), At = se(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), Sr = le(/{{[\w\W]*|^[\w\W]*}}/g), Ar = le(/<%[\w\W]*|^[\w\W]*%>/g), Er = le(/\${[\w\W]*/g), _r = le(/^data-[\-\w.\u00B7-\uFFFF]+$/), Rr = le(/^aria-[\-\w]+$/), ss = le(
670
706
  /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
671
707
  // eslint-disable-line no-useless-escape
672
- ), bi = ce(/^(?:\w+script|data):/i), ki = ce(
708
+ ), Ir = le(/^(?:\w+script|data):/i), Cr = le(
673
709
  /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
674
710
  // eslint-disable-line no-control-regex
675
- ), ds = ce(/^html$/i), vi = ce(/^[a-z][.\w]*(-[.\w]+)+$/i);
676
- var Xn = /* @__PURE__ */ Object.freeze({
677
- __proto__: null,
678
- ARIA_ATTR: xi,
679
- ATTR_WHITESPACE: ki,
680
- CUSTOM_ELEMENT: vi,
681
- DATA_ATTR: mi,
682
- DOCTYPE_NAME: ds,
683
- ERB_EXPR: fi,
684
- IS_ALLOWED_URI: ps,
685
- IS_SCRIPT_OR_DATA: bi,
686
- MUSTACHE_EXPR: di,
687
- TMPLIT_EXPR: gi
688
- });
689
- const it = {
711
+ ), Dr = le(/^html$/i), Mr = le(/^[a-z][.\w]*(-[.\w]+)+$/i), qe = {
690
712
  element: 1,
691
713
  text: 3,
692
714
  // Deprecated
693
715
  progressingInstruction: 7,
694
716
  comment: 8,
695
717
  document: 9
696
- }, wi = /* @__PURE__ */ h(function() {
718
+ }, Or = /* @__PURE__ */ h(function() {
697
719
  return typeof window > "u" ? null : window;
698
- }, "getGlobal"), yi = /* @__PURE__ */ h(function(t, e) {
720
+ }, "getGlobal"), Lr = /* @__PURE__ */ h(function(t, e) {
699
721
  if (typeof t != "object" || typeof t.createPolicy != "function")
700
722
  return null;
701
723
  let n = null;
702
- const i = "data-tt-policy-suffix";
703
- e && e.hasAttribute(i) && (n = e.getAttribute(i));
724
+ const r = "data-tt-policy-suffix";
725
+ e && e.hasAttribute(r) && (n = e.getAttribute(r));
704
726
  const s = "dompurify" + (n ? "#" + n : "");
705
727
  try {
706
728
  return t.createPolicy(s, {
@@ -714,7 +736,7 @@ const it = {
714
736
  } catch {
715
737
  return console.warn("TrustedTypes policy " + s + " could not be created."), null;
716
738
  }
717
- }, "_createTrustedTypesPolicy"), Kn = /* @__PURE__ */ h(function() {
739
+ }, "_createTrustedTypesPolicy"), rs = /* @__PURE__ */ h(function() {
718
740
  return {
719
741
  afterSanitizeAttributes: [],
720
742
  afterSanitizeElements: [],
@@ -727,57 +749,27 @@ const it = {
727
749
  uponSanitizeShadowNode: []
728
750
  };
729
751
  }, "_createHooksMap");
730
- function fs() {
731
- let a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : wi();
732
- const t = /* @__PURE__ */ h((y) => fs(y), "DOMPurify");
733
- if (t.version = "3.4.1", t.removed = [], !a || !a.document || a.document.nodeType !== it.document || !a.Element)
752
+ function ys() {
753
+ let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Or();
754
+ const t = /* @__PURE__ */ h((w) => ys(w), "DOMPurify");
755
+ if (t.version = "3.4.5", t.removed = [], !i || !i.document || i.document.nodeType !== qe.document || !i.Element)
734
756
  return t.isSupported = !1, t;
735
- let {
736
- document: e
737
- } = a;
738
- const n = e, i = n.currentScript, {
739
- DocumentFragment: s,
740
- HTMLTemplateElement: l,
741
- Node: o,
742
- Element: p,
743
- NodeFilter: c,
744
- NamedNodeMap: v = a.NamedNodeMap || a.MozNamedAttrMap,
745
- HTMLFormElement: d,
746
- DOMParser: x,
747
- trustedTypes: m
748
- } = a, f = p.prototype, E = je(f, "cloneNode"), I = je(f, "remove"), z = je(f, "nextSibling"), Q = je(f, "childNodes"), W = je(f, "parentNode");
757
+ let e = i.document;
758
+ const n = e, r = n.currentScript, s = i.DocumentFragment, l = i.HTMLTemplateElement, o = i.Node, p = i.Element, c = i.NodeFilter, x = i.NamedNodeMap, d = x === void 0 ? i.NamedNodeMap || i.MozNamedAttrMap : x, m = i.HTMLFormElement, b = i.DOMParser, f = i.trustedTypes, v = p.prototype, C = Ce(v, "cloneNode"), z = Ce(v, "remove"), ee = Ce(v, "nextSibling"), te = Ce(v, "childNodes"), re = Ce(v, "parentNode"), ge = o && o.prototype ? Ce(o.prototype, "nodeType") : null;
749
759
  if (typeof l == "function") {
750
- const y = e.createElement("template");
751
- y.content && y.content.ownerDocument && (e = y.content.ownerDocument);
752
- }
753
- let N, ie = "";
754
- const {
755
- implementation: se,
756
- createNodeIterator: re,
757
- createDocumentFragment: Oe,
758
- getElementsByTagName: ze
759
- } = e, {
760
- importNode: L
761
- } = n;
762
- let q = Kn();
763
- t.isSupported = typeof hs == "function" && typeof W == "function" && se && se.createHTMLDocument !== void 0;
764
- const {
765
- MUSTACHE_EXPR: ve,
766
- ERB_EXPR: Ae,
767
- TMPLIT_EXPR: Pe,
768
- DATA_ATTR: Rt,
769
- ARIA_ATTR: It,
770
- IS_SCRIPT_OR_DATA: Ct,
771
- ATTR_WHITESPACE: ct,
772
- CUSTOM_ELEMENT: ut
773
- } = Xn;
774
- let {
775
- IS_ALLOWED_URI: Ke
776
- } = Xn, w = null;
777
- const k = R({}, [...qn, ...qt, ...Vt, ...Yt, ...Vn]);
778
- let g = null;
779
- const P = R({}, [...Yn, ...Zt, ...Zn, ...xt]);
780
- let C = Object.seal(Ge(null, {
760
+ const w = e.createElement("template");
761
+ w.content && w.content.ownerDocument && (e = w.content.ownerDocument);
762
+ }
763
+ let $, Q = "";
764
+ const me = e, ye = me.implementation, O = me.createNodeIterator, pt = me.createDocumentFragment, tt = me.getElementsByTagName, dt = n.importNode;
765
+ let Y = rs();
766
+ t.isSupported = typeof xs == "function" && typeof re == "function" && ye && ye.createHTMLDocument !== void 0;
767
+ const Ne = Sr, ze = Ar, $e = Er, zt = _r, ft = Rr, gt = Ir, I = Cr, k = Mr;
768
+ let y = ss, E = null;
769
+ const Z = R({}, [...Jn, ...Qt, ...Jt, ...en, ...es]);
770
+ let F = null;
771
+ const nt = R({}, [...ts, ...tn, ...ns, ...At]);
772
+ let P = Object.seal(Ye(null, {
781
773
  tagNameCheck: {
782
774
  writable: !0,
783
775
  configurable: !1,
@@ -796,8 +788,8 @@ function fs() {
796
788
  enumerable: !0,
797
789
  value: !1
798
790
  }
799
- })), ae = null, Ee = null;
800
- const le = Object.seal(Ge(null, {
791
+ })), st = null, mt = null;
792
+ const we = Object.seal(Ye(null, {
801
793
  tagCheck: {
802
794
  writable: !0,
803
795
  configurable: !1,
@@ -811,174 +803,195 @@ function fs() {
811
803
  value: null
812
804
  }
813
805
  }));
814
- let pn = !0, Dt = !0, dn = !1, fn = !0, _e = !1, Qe = !0, Re = !1, Mt = !1, Lt = !1, Ne = !1, ht = !1, pt = !1, gn = !0, mn = !1;
815
- const xn = "user-content-";
816
- let Ot = !0, Je = !1, $e = {}, ge = null;
817
- const zt = 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"]);
818
- let bn = null;
819
- const kn = R({}, ["audio", "video", "img", "source", "image", "track"]);
820
- let Pt = null;
821
- const vn = R({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), dt = "http://www.w3.org/1998/Math/MathML", ft = "http://www.w3.org/2000/svg", me = "http://www.w3.org/1999/xhtml";
822
- let Be = me, Nt = !1, $t = null;
823
- const As = R({}, [dt, ft, me], Wt);
824
- let Bt = R({}, ["mi", "mo", "mn", "ms", "mtext"]), Ut = R({}, ["annotation-xml"]);
825
- const Es = R({}, ["title", "style", "font", "a", "script"]);
826
- let et = null;
827
- const _s = ["application/xhtml+xml", "text/html"], Rs = "text/html";
828
- let G = null, Ue = null;
829
- const Is = e.createElement("form"), wn = /* @__PURE__ */ h(function(r) {
830
- return r instanceof RegExp || r instanceof Function;
831
- }, "isRegexOrFunction"), Ft = /* @__PURE__ */ h(function() {
832
- let r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
833
- if (Ue && Ue === r)
806
+ let xn = !0, $t = !0, kn = !1, yn = !0, ve = !1, rt = !0, Re = !1, Pt = !1, Ft = !1, Pe = !1, bt = !1, xt = !1, wn = !0, vn = !1;
807
+ const Tn = "user-content-";
808
+ let Bt = !0, it = !1, Fe = {}, pe = null;
809
+ const Ut = 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"]);
810
+ let Sn = null;
811
+ const An = R({}, ["audio", "video", "img", "source", "image", "track"]);
812
+ let Ht = null;
813
+ const En = R({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), kt = "http://www.w3.org/1998/Math/MathML", yt = "http://www.w3.org/2000/svg", de = "http://www.w3.org/1999/xhtml";
814
+ let Be = de, jt = !1, Gt = null;
815
+ const Ds = R({}, [kt, yt, de], Kt);
816
+ let Wt = R({}, ["mi", "mo", "mn", "ms", "mtext"]), qt = R({}, ["annotation-xml"]);
817
+ const Ms = R({}, ["title", "style", "font", "a", "script"]);
818
+ let at = null;
819
+ const Os = ["application/xhtml+xml", "text/html"], Ls = "text/html";
820
+ let W = null, Ue = null;
821
+ const Ns = e.createElement("form"), _n = /* @__PURE__ */ h(function(a) {
822
+ return a instanceof RegExp || a instanceof Function;
823
+ }, "isRegexOrFunction"), Vt = /* @__PURE__ */ h(function() {
824
+ let a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
825
+ if (Ue && Ue === a)
834
826
  return;
835
- (!r || typeof r != "object") && (r = {}), r = ne(r), et = // eslint-disable-next-line unicorn/prefer-includes
836
- _s.indexOf(r.PARSER_MEDIA_TYPE) === -1 ? Rs : r.PARSER_MEDIA_TYPE, G = et === "application/xhtml+xml" ? Wt : at, w = B(r, "ALLOWED_TAGS") && J(r.ALLOWED_TAGS) ? R({}, r.ALLOWED_TAGS, G) : k, g = B(r, "ALLOWED_ATTR") && J(r.ALLOWED_ATTR) ? R({}, r.ALLOWED_ATTR, G) : P, $t = B(r, "ALLOWED_NAMESPACES") && J(r.ALLOWED_NAMESPACES) ? R({}, r.ALLOWED_NAMESPACES, Wt) : As, Pt = B(r, "ADD_URI_SAFE_ATTR") && J(r.ADD_URI_SAFE_ATTR) ? R(ne(vn), r.ADD_URI_SAFE_ATTR, G) : vn, bn = B(r, "ADD_DATA_URI_TAGS") && J(r.ADD_DATA_URI_TAGS) ? R(ne(kn), r.ADD_DATA_URI_TAGS, G) : kn, ge = B(r, "FORBID_CONTENTS") && J(r.FORBID_CONTENTS) ? R({}, r.FORBID_CONTENTS, G) : zt, ae = B(r, "FORBID_TAGS") && J(r.FORBID_TAGS) ? R({}, r.FORBID_TAGS, G) : ne({}), Ee = B(r, "FORBID_ATTR") && J(r.FORBID_ATTR) ? R({}, r.FORBID_ATTR, G) : ne({}), $e = B(r, "USE_PROFILES") ? r.USE_PROFILES && typeof r.USE_PROFILES == "object" ? ne(r.USE_PROFILES) : r.USE_PROFILES : !1, pn = r.ALLOW_ARIA_ATTR !== !1, Dt = r.ALLOW_DATA_ATTR !== !1, dn = r.ALLOW_UNKNOWN_PROTOCOLS || !1, fn = r.ALLOW_SELF_CLOSE_IN_ATTR !== !1, _e = r.SAFE_FOR_TEMPLATES || !1, Qe = r.SAFE_FOR_XML !== !1, Re = r.WHOLE_DOCUMENT || !1, Ne = r.RETURN_DOM || !1, ht = r.RETURN_DOM_FRAGMENT || !1, pt = r.RETURN_TRUSTED_TYPE || !1, Lt = r.FORCE_BODY || !1, gn = r.SANITIZE_DOM !== !1, mn = r.SANITIZE_NAMED_PROPS || !1, Ot = r.KEEP_CONTENT !== !1, Je = r.IN_PLACE || !1, Ke = ui(r.ALLOWED_URI_REGEXP) ? r.ALLOWED_URI_REGEXP : ps, Be = typeof r.NAMESPACE == "string" ? r.NAMESPACE : me, Bt = B(r, "MATHML_TEXT_INTEGRATION_POINTS") && r.MATHML_TEXT_INTEGRATION_POINTS && typeof r.MATHML_TEXT_INTEGRATION_POINTS == "object" ? ne(r.MATHML_TEXT_INTEGRATION_POINTS) : R({}, ["mi", "mo", "mn", "ms", "mtext"]), Ut = B(r, "HTML_INTEGRATION_POINTS") && r.HTML_INTEGRATION_POINTS && typeof r.HTML_INTEGRATION_POINTS == "object" ? ne(r.HTML_INTEGRATION_POINTS) : R({}, ["annotation-xml"]);
837
- const u = B(r, "CUSTOM_ELEMENT_HANDLING") && r.CUSTOM_ELEMENT_HANDLING && typeof r.CUSTOM_ELEMENT_HANDLING == "object" ? ne(r.CUSTOM_ELEMENT_HANDLING) : Ge(null);
838
- if (C = Ge(null), B(u, "tagNameCheck") && wn(u.tagNameCheck) && (C.tagNameCheck = u.tagNameCheck), B(u, "attributeNameCheck") && wn(u.attributeNameCheck) && (C.attributeNameCheck = u.attributeNameCheck), B(u, "allowCustomizedBuiltInElements") && typeof u.allowCustomizedBuiltInElements == "boolean" && (C.allowCustomizedBuiltInElements = u.allowCustomizedBuiltInElements), _e && (Dt = !1), ht && (Ne = !0), $e && (w = R({}, Vn), g = Ge(null), $e.html === !0 && (R(w, qn), R(g, Yn)), $e.svg === !0 && (R(w, qt), R(g, Zt), R(g, xt)), $e.svgFilters === !0 && (R(w, Vt), R(g, Zt), R(g, xt)), $e.mathMl === !0 && (R(w, Yt), R(g, Zn), R(g, xt))), le.tagCheck = null, le.attributeCheck = null, B(r, "ADD_TAGS") && (typeof r.ADD_TAGS == "function" ? le.tagCheck = r.ADD_TAGS : J(r.ADD_TAGS) && (w === k && (w = ne(w)), R(w, r.ADD_TAGS, G))), B(r, "ADD_ATTR") && (typeof r.ADD_ATTR == "function" ? le.attributeCheck = r.ADD_ATTR : J(r.ADD_ATTR) && (g === P && (g = ne(g)), R(g, r.ADD_ATTR, G))), B(r, "ADD_URI_SAFE_ATTR") && J(r.ADD_URI_SAFE_ATTR) && R(Pt, r.ADD_URI_SAFE_ATTR, G), B(r, "FORBID_CONTENTS") && J(r.FORBID_CONTENTS) && (ge === zt && (ge = ne(ge)), R(ge, r.FORBID_CONTENTS, G)), B(r, "ADD_FORBID_CONTENTS") && J(r.ADD_FORBID_CONTENTS) && (ge === zt && (ge = ne(ge)), R(ge, r.ADD_FORBID_CONTENTS, G)), Ot && (w["#text"] = !0), Re && R(w, ["html", "head", "body"]), w.table && (R(w, ["tbody"]), delete ae.tbody), r.TRUSTED_TYPES_POLICY) {
839
- if (typeof r.TRUSTED_TYPES_POLICY.createHTML != "function")
840
- throw mt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
841
- if (typeof r.TRUSTED_TYPES_POLICY.createScriptURL != "function")
842
- throw mt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
843
- N = r.TRUSTED_TYPES_POLICY, ie = N.createHTML("");
827
+ (!a || typeof a != "object") && (a = {}), a = ae(a), at = // eslint-disable-next-line unicorn/prefer-includes
828
+ Os.indexOf(a.PARSER_MEDIA_TYPE) === -1 ? Ls : a.PARSER_MEDIA_TYPE, W = at === "application/xhtml+xml" ? Kt : ct, E = B(a, "ALLOWED_TAGS") && ne(a.ALLOWED_TAGS) ? R({}, a.ALLOWED_TAGS, W) : Z, F = B(a, "ALLOWED_ATTR") && ne(a.ALLOWED_ATTR) ? R({}, a.ALLOWED_ATTR, W) : nt, Gt = B(a, "ALLOWED_NAMESPACES") && ne(a.ALLOWED_NAMESPACES) ? R({}, a.ALLOWED_NAMESPACES, Kt) : Ds, Ht = B(a, "ADD_URI_SAFE_ATTR") && ne(a.ADD_URI_SAFE_ATTR) ? R(ae(En), a.ADD_URI_SAFE_ATTR, W) : En, Sn = B(a, "ADD_DATA_URI_TAGS") && ne(a.ADD_DATA_URI_TAGS) ? R(ae(An), a.ADD_DATA_URI_TAGS, W) : An, pe = B(a, "FORBID_CONTENTS") && ne(a.FORBID_CONTENTS) ? R({}, a.FORBID_CONTENTS, W) : Ut, st = B(a, "FORBID_TAGS") && ne(a.FORBID_TAGS) ? R({}, a.FORBID_TAGS, W) : ae({}), mt = B(a, "FORBID_ATTR") && ne(a.FORBID_ATTR) ? R({}, a.FORBID_ATTR, W) : ae({}), Fe = B(a, "USE_PROFILES") ? a.USE_PROFILES && typeof a.USE_PROFILES == "object" ? ae(a.USE_PROFILES) : a.USE_PROFILES : !1, xn = a.ALLOW_ARIA_ATTR !== !1, $t = a.ALLOW_DATA_ATTR !== !1, kn = a.ALLOW_UNKNOWN_PROTOCOLS || !1, yn = a.ALLOW_SELF_CLOSE_IN_ATTR !== !1, ve = a.SAFE_FOR_TEMPLATES || !1, rt = a.SAFE_FOR_XML !== !1, Re = a.WHOLE_DOCUMENT || !1, Pe = a.RETURN_DOM || !1, bt = a.RETURN_DOM_FRAGMENT || !1, xt = a.RETURN_TRUSTED_TYPE || !1, Ft = a.FORCE_BODY || !1, wn = a.SANITIZE_DOM !== !1, vn = a.SANITIZE_NAMED_PROPS || !1, Bt = a.KEEP_CONTENT !== !1, it = a.IN_PLACE || !1, y = wr(a.ALLOWED_URI_REGEXP) ? a.ALLOWED_URI_REGEXP : ss, Be = typeof a.NAMESPACE == "string" ? a.NAMESPACE : de, Wt = B(a, "MATHML_TEXT_INTEGRATION_POINTS") && a.MATHML_TEXT_INTEGRATION_POINTS && typeof a.MATHML_TEXT_INTEGRATION_POINTS == "object" ? ae(a.MATHML_TEXT_INTEGRATION_POINTS) : R({}, ["mi", "mo", "mn", "ms", "mtext"]), qt = B(a, "HTML_INTEGRATION_POINTS") && a.HTML_INTEGRATION_POINTS && typeof a.HTML_INTEGRATION_POINTS == "object" ? ae(a.HTML_INTEGRATION_POINTS) : R({}, ["annotation-xml"]);
829
+ const u = B(a, "CUSTOM_ELEMENT_HANDLING") && a.CUSTOM_ELEMENT_HANDLING && typeof a.CUSTOM_ELEMENT_HANDLING == "object" ? ae(a.CUSTOM_ELEMENT_HANDLING) : Ye(null);
830
+ if (P = Ye(null), B(u, "tagNameCheck") && _n(u.tagNameCheck) && (P.tagNameCheck = u.tagNameCheck), B(u, "attributeNameCheck") && _n(u.attributeNameCheck) && (P.attributeNameCheck = u.attributeNameCheck), B(u, "allowCustomizedBuiltInElements") && typeof u.allowCustomizedBuiltInElements == "boolean" && (P.allowCustomizedBuiltInElements = u.allowCustomizedBuiltInElements), ve && ($t = !1), bt && (Pe = !0), Fe && (E = R({}, es), F = Ye(null), Fe.html === !0 && (R(E, Jn), R(F, ts)), Fe.svg === !0 && (R(E, Qt), R(F, tn), R(F, At)), Fe.svgFilters === !0 && (R(E, Jt), R(F, tn), R(F, At)), Fe.mathMl === !0 && (R(E, en), R(F, ns), R(F, At))), we.tagCheck = null, we.attributeCheck = null, B(a, "ADD_TAGS") && (typeof a.ADD_TAGS == "function" ? we.tagCheck = a.ADD_TAGS : ne(a.ADD_TAGS) && (E === Z && (E = ae(E)), R(E, a.ADD_TAGS, W))), B(a, "ADD_ATTR") && (typeof a.ADD_ATTR == "function" ? we.attributeCheck = a.ADD_ATTR : ne(a.ADD_ATTR) && (F === nt && (F = ae(F)), R(F, a.ADD_ATTR, W))), B(a, "ADD_URI_SAFE_ATTR") && ne(a.ADD_URI_SAFE_ATTR) && R(Ht, a.ADD_URI_SAFE_ATTR, W), B(a, "FORBID_CONTENTS") && ne(a.FORBID_CONTENTS) && (pe === Ut && (pe = ae(pe)), R(pe, a.FORBID_CONTENTS, W)), B(a, "ADD_FORBID_CONTENTS") && ne(a.ADD_FORBID_CONTENTS) && (pe === Ut && (pe = ae(pe)), R(pe, a.ADD_FORBID_CONTENTS, W)), Bt && (E["#text"] = !0), Re && R(E, ["html", "head", "body"]), E.table && (R(E, ["tbody"]), delete st.tbody), a.TRUSTED_TYPES_POLICY) {
831
+ if (typeof a.TRUSTED_TYPES_POLICY.createHTML != "function")
832
+ throw St('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
833
+ if (typeof a.TRUSTED_TYPES_POLICY.createScriptURL != "function")
834
+ throw St('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
835
+ $ = a.TRUSTED_TYPES_POLICY, Q = $.createHTML("");
844
836
  } else
845
- N === void 0 && (N = yi(m, i)), N !== null && typeof ie == "string" && (ie = N.createHTML(""));
846
- ee && ee(r), Ue = r;
847
- }, "_parseConfig"), yn = R({}, [...qt, ...Vt, ...hi]), Tn = R({}, [...Yt, ...pi]), Cs = /* @__PURE__ */ h(function(r) {
848
- let u = W(r);
837
+ $ === void 0 && ($ = Lr(f, r)), $ !== null && typeof Q == "string" && (Q = $.createHTML(""));
838
+ se && se(a), Ue = a;
839
+ }, "_parseConfig"), Rn = R({}, [...Qt, ...Jt, ...vr]), In = R({}, [...en, ...Tr]), zs = /* @__PURE__ */ h(function(a) {
840
+ let u = re(a);
849
841
  (!u || !u.tagName) && (u = {
850
842
  namespaceURI: Be,
851
843
  tagName: "template"
852
844
  });
853
- const b = at(r.tagName), $ = at(u.tagName);
854
- return $t[r.namespaceURI] ? r.namespaceURI === ft ? u.namespaceURI === me ? b === "svg" : u.namespaceURI === dt ? b === "svg" && ($ === "annotation-xml" || Bt[$]) : !!yn[b] : r.namespaceURI === dt ? u.namespaceURI === me ? b === "math" : u.namespaceURI === ft ? b === "math" && Ut[$] : !!Tn[b] : r.namespaceURI === me ? u.namespaceURI === ft && !Ut[$] || u.namespaceURI === dt && !Bt[$] ? !1 : !Tn[b] && (Es[b] || !yn[b]) : !!(et === "application/xhtml+xml" && $t[r.namespaceURI]) : !1;
855
- }, "_checkValidNamespace"), ue = /* @__PURE__ */ h(function(r) {
856
- nt(t.removed, {
857
- element: r
845
+ const g = ct(a.tagName), D = ct(u.tagName);
846
+ return Gt[a.namespaceURI] ? a.namespaceURI === yt ? u.namespaceURI === de ? g === "svg" : u.namespaceURI === kt ? g === "svg" && (D === "annotation-xml" || Wt[D]) : !!Rn[g] : a.namespaceURI === kt ? u.namespaceURI === de ? g === "math" : u.namespaceURI === yt ? g === "math" && qt[D] : !!In[g] : a.namespaceURI === de ? u.namespaceURI === yt && !qt[D] || u.namespaceURI === kt && !Wt[D] ? !1 : !In[g] && (Ms[g] || !Rn[g]) : !!(at === "application/xhtml+xml" && Gt[a.namespaceURI]) : !1;
847
+ }, "_checkValidNamespace"), oe = /* @__PURE__ */ h(function(a) {
848
+ Ge(t.removed, {
849
+ element: a
858
850
  });
859
851
  try {
860
- W(r).removeChild(r);
852
+ re(a).removeChild(a);
861
853
  } catch {
862
- I(r);
854
+ z(a);
863
855
  }
864
- }, "_forceRemove"), Ie = /* @__PURE__ */ h(function(r, u) {
856
+ }, "_forceRemove"), Ie = /* @__PURE__ */ h(function(a, u) {
865
857
  try {
866
- nt(t.removed, {
867
- attribute: u.getAttributeNode(r),
858
+ Ge(t.removed, {
859
+ attribute: u.getAttributeNode(a),
868
860
  from: u
869
861
  });
870
862
  } catch {
871
- nt(t.removed, {
863
+ Ge(t.removed, {
872
864
  attribute: null,
873
865
  from: u
874
866
  });
875
867
  }
876
- if (u.removeAttribute(r), r === "is")
877
- if (Ne || ht)
868
+ if (u.removeAttribute(a), a === "is")
869
+ if (Pe || bt)
878
870
  try {
879
- ue(u);
871
+ oe(u);
880
872
  } catch {
881
873
  }
882
874
  else
883
875
  try {
884
- u.setAttribute(r, "");
876
+ u.setAttribute(a, "");
885
877
  } catch {
886
878
  }
887
- }, "_removeAttribute"), Sn = /* @__PURE__ */ h(function(r) {
888
- let u = null, b = null;
889
- if (Lt)
890
- r = "<remove></remove>" + r;
879
+ }, "_removeAttribute"), Cn = /* @__PURE__ */ h(function(a) {
880
+ let u = null, g = null;
881
+ if (Ft)
882
+ a = "<remove></remove>" + a;
891
883
  else {
892
- const F = Hn(r, /^[\r\n\t ]+/);
893
- b = F && F[0];
884
+ const j = Zn(a, /^[\r\n\t ]+/);
885
+ g = j && j[0];
894
886
  }
895
- et === "application/xhtml+xml" && Be === me && (r = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + r + "</body></html>");
896
- const $ = N ? N.createHTML(r) : r;
897
- if (Be === me)
887
+ at === "application/xhtml+xml" && Be === de && (a = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + a + "</body></html>");
888
+ const D = $ ? $.createHTML(a) : a;
889
+ if (Be === de)
898
890
  try {
899
- u = new x().parseFromString($, et);
891
+ u = new b().parseFromString(D, at);
900
892
  } catch {
901
893
  }
902
894
  if (!u || !u.documentElement) {
903
- u = se.createDocument(Be, "template", null);
895
+ u = ye.createDocument(Be, "template", null);
904
896
  try {
905
- u.documentElement.innerHTML = Nt ? ie : $;
897
+ u.documentElement.innerHTML = jt ? Q : D;
906
898
  } catch {
907
899
  }
908
900
  }
909
- const X = u.body || u.documentElement;
910
- return r && b && X.insertBefore(e.createTextNode(b), X.childNodes[0] || null), Be === me ? ze.call(u, Re ? "html" : "body")[0] : Re ? u.documentElement : X;
911
- }, "_initDocument"), An = /* @__PURE__ */ h(function(r) {
912
- return re.call(
913
- r.ownerDocument || r,
914
- r,
901
+ const H = u.body || u.documentElement;
902
+ return a && g && H.insertBefore(e.createTextNode(g), H.childNodes[0] || null), Be === de ? tt.call(u, Re ? "html" : "body")[0] : Re ? u.documentElement : H;
903
+ }, "_initDocument"), Dn = /* @__PURE__ */ h(function(a) {
904
+ return O.call(
905
+ a.ownerDocument || a,
906
+ a,
915
907
  // eslint-disable-next-line no-bitwise
916
908
  c.SHOW_ELEMENT | c.SHOW_COMMENT | c.SHOW_TEXT | c.SHOW_PROCESSING_INSTRUCTION | c.SHOW_CDATA_SECTION,
917
909
  null
918
910
  );
919
- }, "_createNodeIterator"), Ht = /* @__PURE__ */ h(function(r) {
920
- return r instanceof d && (typeof r.nodeName != "string" || typeof r.textContent != "string" || typeof r.removeChild != "function" || !(r.attributes instanceof v) || typeof r.removeAttribute != "function" || typeof r.setAttribute != "function" || typeof r.namespaceURI != "string" || typeof r.insertBefore != "function" || typeof r.hasChildNodes != "function");
921
- }, "_isClobbered"), Gt = /* @__PURE__ */ h(function(r) {
922
- return typeof o == "function" && r instanceof o;
911
+ }, "_createNodeIterator"), Mn = /* @__PURE__ */ h(function(a) {
912
+ a.normalize();
913
+ const u = O.call(
914
+ a.ownerDocument || a,
915
+ a,
916
+ // eslint-disable-next-line no-bitwise
917
+ c.SHOW_TEXT | c.SHOW_COMMENT | c.SHOW_CDATA_SECTION | c.SHOW_PROCESSING_INSTRUCTION,
918
+ null
919
+ );
920
+ let g = u.nextNode();
921
+ for (; g; ) {
922
+ let D = g.data;
923
+ je([Ne, ze, $e], (H) => {
924
+ D = We(D, H, " ");
925
+ }), g.data = D, g = u.nextNode();
926
+ }
927
+ }, "_scrubTemplateExpressions"), Yt = /* @__PURE__ */ h(function(a) {
928
+ return a instanceof m && (typeof a.nodeName != "string" || typeof a.textContent != "string" || typeof a.removeChild != "function" || !(a.attributes instanceof d) || typeof a.removeAttribute != "function" || typeof a.setAttribute != "function" || typeof a.namespaceURI != "string" || typeof a.insertBefore != "function" || typeof a.hasChildNodes != "function");
929
+ }, "_isClobbered"), wt = /* @__PURE__ */ h(function(a) {
930
+ if (!ge || typeof a != "object" || a === null)
931
+ return !1;
932
+ try {
933
+ return typeof ge(a) == "number";
934
+ } catch {
935
+ return !1;
936
+ }
923
937
  }, "_isNode");
924
- function be(y, r, u) {
925
- tt(y, (b) => {
926
- b.call(t, r, u, Ue);
938
+ function be(w, a, u) {
939
+ je(w, (g) => {
940
+ g.call(t, a, u, Ue);
927
941
  });
928
942
  }
929
943
  h(be, "_executeHooks");
930
- const En = /* @__PURE__ */ h(function(r) {
944
+ const On = /* @__PURE__ */ h(function(a) {
931
945
  let u = null;
932
- if (be(q.beforeSanitizeElements, r, null), Ht(r))
933
- return ue(r), !0;
934
- const b = G(r.nodeName);
935
- if (be(q.uponSanitizeElement, r, {
936
- tagName: b,
937
- allowedTags: w
938
- }), Qe && r.hasChildNodes() && !Gt(r.firstElementChild) && Y(/<[/\w!]/g, r.innerHTML) && Y(/<[/\w!]/g, r.textContent) || Qe && r.namespaceURI === me && b === "style" && Gt(r.firstElementChild) || r.nodeType === it.progressingInstruction || Qe && r.nodeType === it.comment && Y(/<[/\w]/g, r.data))
939
- return ue(r), !0;
940
- if (ae[b] || !(le.tagCheck instanceof Function && le.tagCheck(b)) && !w[b]) {
941
- if (!ae[b] && Rn(b) && (C.tagNameCheck instanceof RegExp && Y(C.tagNameCheck, b) || C.tagNameCheck instanceof Function && C.tagNameCheck(b)))
946
+ if (be(Y.beforeSanitizeElements, a, null), Yt(a))
947
+ return oe(a), !0;
948
+ const g = W(a.nodeName);
949
+ if (be(Y.uponSanitizeElement, a, {
950
+ tagName: g,
951
+ allowedTags: E
952
+ }), rt && a.hasChildNodes() && !wt(a.firstElementChild) && X(/<[/\w!]/g, a.innerHTML) && X(/<[/\w!]/g, a.textContent) || rt && a.namespaceURI === de && g === "style" && wt(a.firstElementChild) || a.nodeType === qe.progressingInstruction || rt && a.nodeType === qe.comment && X(/<[/\w]/g, a.data))
953
+ return oe(a), !0;
954
+ if (st[g] || !(we.tagCheck instanceof Function && we.tagCheck(g)) && !E[g]) {
955
+ if (!st[g] && Nn(g) && (P.tagNameCheck instanceof RegExp && X(P.tagNameCheck, g) || P.tagNameCheck instanceof Function && P.tagNameCheck(g)))
942
956
  return !1;
943
- if (Ot && !ge[b]) {
944
- const $ = W(r) || r.parentNode, X = Q(r) || r.childNodes;
945
- if (X && $) {
946
- const F = X.length;
947
- for (let te = F - 1; te >= 0; --te) {
948
- const oe = E(X[te], !0);
949
- $.insertBefore(oe, z(r));
957
+ if (Bt && !pe[g]) {
958
+ const D = re(a) || a.parentNode, H = te(a) || a.childNodes;
959
+ if (H && D) {
960
+ const j = H.length;
961
+ for (let ie = j - 1; ie >= 0; --ie) {
962
+ const Te = C(H[ie], !0);
963
+ D.insertBefore(Te, ee(a));
950
964
  }
951
965
  }
952
966
  }
953
- return ue(r), !0;
967
+ return oe(a), !0;
954
968
  }
955
- return r instanceof p && !Cs(r) || (b === "noscript" || b === "noembed" || b === "noframes") && Y(/<\/no(script|embed|frames)/i, r.innerHTML) ? (ue(r), !0) : (_e && r.nodeType === it.text && (u = r.textContent, tt([ve, Ae, Pe], ($) => {
956
- u = He(u, $, " ");
957
- }), r.textContent !== u && (nt(t.removed, {
958
- element: r.cloneNode()
959
- }), r.textContent = u)), be(q.afterSanitizeElements, r, null), !1);
960
- }, "_sanitizeElements"), _n = /* @__PURE__ */ h(function(r, u, b) {
961
- if (Ee[u] || gn && (u === "id" || u === "name") && (b in e || b in Is))
969
+ return a instanceof p && !zs(a) || (g === "noscript" || g === "noembed" || g === "noframes") && X(/<\/no(script|embed|frames)/i, a.innerHTML) ? (oe(a), !0) : (ve && a.nodeType === qe.text && (u = a.textContent, je([Ne, ze, $e], (D) => {
970
+ u = We(u, D, " ");
971
+ }), a.textContent !== u && (Ge(t.removed, {
972
+ element: a.cloneNode()
973
+ }), a.textContent = u)), be(Y.afterSanitizeElements, a, null), !1);
974
+ }, "_sanitizeElements"), Ln = /* @__PURE__ */ h(function(a, u, g) {
975
+ if (mt[u] || wn && (u === "id" || u === "name") && (g in e || g in Ns))
962
976
  return !1;
963
- if (!(Dt && !Ee[u] && Y(Rt, u))) {
964
- if (!(pn && Y(It, u))) {
965
- if (!(le.attributeCheck instanceof Function && le.attributeCheck(u, r))) {
966
- if (!g[u] || Ee[u]) {
967
- if (
968
- // First condition does a very basic check if a) it's basically a valid custom element tagname AND
969
- // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
970
- // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
971
- !(Rn(r) && (C.tagNameCheck instanceof RegExp && Y(C.tagNameCheck, r) || C.tagNameCheck instanceof Function && C.tagNameCheck(r)) && (C.attributeNameCheck instanceof RegExp && Y(C.attributeNameCheck, u) || C.attributeNameCheck instanceof Function && C.attributeNameCheck(u, r)) || // Alternative, second condition checks if it's an `is`-attribute, AND
972
- // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
973
- u === "is" && C.allowCustomizedBuiltInElements && (C.tagNameCheck instanceof RegExp && Y(C.tagNameCheck, b) || C.tagNameCheck instanceof Function && C.tagNameCheck(b)))
974
- ) return !1;
975
- } else if (!Pt[u]) {
976
- if (!Y(Ke, He(b, ct, ""))) {
977
- if (!((u === "src" || u === "xlink:href" || u === "href") && r !== "script" && Gn(b, "data:") === 0 && bn[r])) {
978
- if (!(dn && !Y(Ct, He(b, ct, "")))) {
979
- if (b)
980
- return !1;
981
- }
977
+ const D = F[u] || we.attributeCheck instanceof Function && we.attributeCheck(u, a);
978
+ if (!($t && !mt[u] && X(zt, u))) {
979
+ if (!(xn && X(ft, u))) {
980
+ if (!D || mt[u]) {
981
+ if (
982
+ // First condition does a very basic check if a) it's basically a valid custom element tagname AND
983
+ // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
984
+ // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
985
+ !(Nn(a) && (P.tagNameCheck instanceof RegExp && X(P.tagNameCheck, a) || P.tagNameCheck instanceof Function && P.tagNameCheck(a)) && (P.attributeNameCheck instanceof RegExp && X(P.attributeNameCheck, u) || P.attributeNameCheck instanceof Function && P.attributeNameCheck(u, a)) || // Alternative, second condition checks if it's an `is`-attribute, AND
986
+ // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
987
+ u === "is" && P.allowCustomizedBuiltInElements && (P.tagNameCheck instanceof RegExp && X(P.tagNameCheck, g) || P.tagNameCheck instanceof Function && P.tagNameCheck(g)))
988
+ ) return !1;
989
+ } else if (!Ht[u]) {
990
+ if (!X(y, We(g, I, ""))) {
991
+ if (!((u === "src" || u === "xlink:href" || u === "href") && a !== "script" && Xn(g, "data:") === 0 && Sn[a])) {
992
+ if (!(kn && !X(gt, We(g, I, "")))) {
993
+ if (g)
994
+ return !1;
982
995
  }
983
996
  }
984
997
  }
@@ -986,270 +999,280 @@ function fs() {
986
999
  }
987
1000
  }
988
1001
  return !0;
989
- }, "_isValidAttribute"), Ds = R({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]), Rn = /* @__PURE__ */ h(function(r) {
990
- return !Ds[at(r)] && Y(ut, r);
991
- }, "_isBasicCustomElement"), In = /* @__PURE__ */ h(function(r) {
992
- be(q.beforeSanitizeAttributes, r, null);
993
- const {
994
- attributes: u
995
- } = r;
996
- if (!u || Ht(r))
1002
+ }, "_isValidAttribute"), $s = R({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]), Nn = /* @__PURE__ */ h(function(a) {
1003
+ return !$s[ct(a)] && X(k, a);
1004
+ }, "_isBasicCustomElement"), zn = /* @__PURE__ */ h(function(a) {
1005
+ be(Y.beforeSanitizeAttributes, a, null);
1006
+ const u = a.attributes;
1007
+ if (!u || Yt(a))
997
1008
  return;
998
- const b = {
1009
+ const g = {
999
1010
  attrName: "",
1000
1011
  attrValue: "",
1001
1012
  keepAttr: !0,
1002
- allowedAttributes: g,
1013
+ allowedAttributes: F,
1003
1014
  forceKeepAttr: void 0
1004
1015
  };
1005
- let $ = u.length;
1006
- for (; $--; ) {
1007
- const X = u[$], {
1008
- name: F,
1009
- namespaceURI: te,
1010
- value: oe
1011
- } = X, he = G(F), jt = oe;
1012
- let V = F === "value" ? jt : ii(jt);
1013
- if (b.attrName = he, b.attrValue = V, b.keepAttr = !0, b.forceKeepAttr = void 0, be(q.uponSanitizeAttribute, r, b), V = b.attrValue, mn && (he === "id" || he === "name") && Gn(V, xn) !== 0 && (Ie(F, r), V = xn + V), Qe && Y(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, V)) {
1014
- Ie(F, r);
1016
+ let D = u.length;
1017
+ for (; D--; ) {
1018
+ const H = u[D], j = H.name, ie = H.namespaceURI, Te = H.value, xe = W(j), Xt = Te;
1019
+ let V = j === "value" ? Xt : gr(Xt);
1020
+ if (g.attrName = xe, g.attrValue = V, g.keepAttr = !0, g.forceKeepAttr = void 0, be(Y.uponSanitizeAttribute, a, g), V = g.attrValue, vn && (xe === "id" || xe === "name") && Xn(V, Tn) !== 0 && (Ie(j, a), V = Tn + V), rt && X(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, V)) {
1021
+ Ie(j, a);
1015
1022
  continue;
1016
1023
  }
1017
- if (he === "attributename" && Hn(V, "href")) {
1018
- Ie(F, r);
1024
+ if (xe === "attributename" && Zn(V, "href")) {
1025
+ Ie(j, a);
1019
1026
  continue;
1020
1027
  }
1021
- if (b.forceKeepAttr)
1028
+ if (g.forceKeepAttr)
1022
1029
  continue;
1023
- if (!b.keepAttr) {
1024
- Ie(F, r);
1030
+ if (!g.keepAttr) {
1031
+ Ie(j, a);
1025
1032
  continue;
1026
1033
  }
1027
- if (!fn && Y(/\/>/i, V)) {
1028
- Ie(F, r);
1034
+ if (!yn && X(/\/>/i, V)) {
1035
+ Ie(j, a);
1029
1036
  continue;
1030
1037
  }
1031
- _e && tt([ve, Ae, Pe], (Mn) => {
1032
- V = He(V, Mn, " ");
1038
+ ve && je([Ne, ze, $e], (Pn) => {
1039
+ V = We(V, Pn, " ");
1033
1040
  });
1034
- const Dn = G(r.nodeName);
1035
- if (!_n(Dn, he, V)) {
1036
- Ie(F, r);
1041
+ const $n = W(a.nodeName);
1042
+ if (!Ln($n, xe, V)) {
1043
+ Ie(j, a);
1037
1044
  continue;
1038
1045
  }
1039
- if (N && typeof m == "object" && typeof m.getAttributeType == "function" && !te)
1040
- switch (m.getAttributeType(Dn, he)) {
1046
+ if ($ && typeof f == "object" && typeof f.getAttributeType == "function" && !ie)
1047
+ switch (f.getAttributeType($n, xe)) {
1041
1048
  case "TrustedHTML": {
1042
- V = N.createHTML(V);
1049
+ V = $.createHTML(V);
1043
1050
  break;
1044
1051
  }
1045
1052
  case "TrustedScriptURL": {
1046
- V = N.createScriptURL(V);
1053
+ V = $.createScriptURL(V);
1047
1054
  break;
1048
1055
  }
1049
1056
  }
1050
- if (V !== jt)
1057
+ if (V !== Xt)
1051
1058
  try {
1052
- te ? r.setAttributeNS(te, F, V) : r.setAttribute(F, V), Ht(r) ? ue(r) : Fn(t.removed);
1059
+ ie ? a.setAttributeNS(ie, j, V) : a.setAttribute(j, V), Yt(a) ? oe(a) : Yn(t.removed);
1053
1060
  } catch {
1054
- Ie(F, r);
1061
+ Ie(j, a);
1055
1062
  }
1056
1063
  }
1057
- be(q.afterSanitizeAttributes, r, null);
1058
- }, "_sanitizeAttributes"), Cn = /* @__PURE__ */ h(function(r) {
1064
+ be(Y.afterSanitizeAttributes, a, null);
1065
+ }, "_sanitizeAttributes"), Zt = /* @__PURE__ */ h(function(a) {
1059
1066
  let u = null;
1060
- const b = An(r);
1061
- for (be(q.beforeSanitizeShadowDOM, r, null); u = b.nextNode(); )
1062
- be(q.uponSanitizeShadowNode, u, null), En(u), In(u), u.content instanceof s && Cn(u.content);
1063
- be(q.afterSanitizeShadowDOM, r, null);
1064
- }, "_sanitizeShadowDOM");
1065
- return t.sanitize = function(y) {
1066
- let r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, u = null, b = null, $ = null, X = null;
1067
- if (Nt = !y, Nt && (y = "<!-->"), typeof y != "string" && !Gt(y) && (y = ci(y), typeof y != "string"))
1068
- throw mt("dirty is not a string, aborting");
1067
+ const g = Dn(a);
1068
+ for (be(Y.beforeSanitizeShadowDOM, a, null); u = g.nextNode(); )
1069
+ be(Y.uponSanitizeShadowNode, u, null), On(u), zn(u), u.content instanceof s && Zt(u.content);
1070
+ be(Y.afterSanitizeShadowDOM, a, null);
1071
+ }, "_sanitizeShadowDOM"), vt = /* @__PURE__ */ h(function(a) {
1072
+ if (a.nodeType === qe.element && a.shadowRoot instanceof s) {
1073
+ const D = a.shadowRoot;
1074
+ vt(D), Zt(D);
1075
+ }
1076
+ const u = a.childNodes;
1077
+ if (!u)
1078
+ return;
1079
+ const g = [];
1080
+ je(u, (D) => {
1081
+ Ge(g, D);
1082
+ });
1083
+ for (const D of g)
1084
+ vt(D);
1085
+ }, "_sanitizeAttachedShadowRoots");
1086
+ return t.sanitize = function(w) {
1087
+ let a = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, u = null, g = null, D = null, H = null;
1088
+ if (jt = !w, jt && (w = "<!-->"), typeof w != "string" && !wt(w) && (w = yr(w), typeof w != "string"))
1089
+ throw St("dirty is not a string, aborting");
1069
1090
  if (!t.isSupported)
1070
- return y;
1071
- if (Mt || Ft(r), t.removed = [], typeof y == "string" && (Je = !1), Je) {
1072
- const oe = y.nodeName;
1073
- if (typeof oe == "string") {
1074
- const he = G(oe);
1075
- if (!w[he] || ae[he])
1076
- throw mt("root node is forbidden and cannot be sanitized in-place");
1077
- }
1078
- } else if (y instanceof o)
1079
- u = Sn("<!---->"), b = u.ownerDocument.importNode(y, !0), b.nodeType === it.element && b.nodeName === "BODY" || b.nodeName === "HTML" ? u = b : u.appendChild(b);
1091
+ return w;
1092
+ if (Pt || Vt(a), t.removed = [], typeof w == "string" && (it = !1), it) {
1093
+ const Te = w.nodeName;
1094
+ if (typeof Te == "string") {
1095
+ const xe = W(Te);
1096
+ if (!E[xe] || st[xe])
1097
+ throw St("root node is forbidden and cannot be sanitized in-place");
1098
+ }
1099
+ vt(w);
1100
+ } else if (wt(w))
1101
+ u = Cn("<!---->"), g = u.ownerDocument.importNode(w, !0), g.nodeType === qe.element && g.nodeName === "BODY" || g.nodeName === "HTML" ? u = g : u.appendChild(g), vt(g);
1080
1102
  else {
1081
- if (!Ne && !_e && !Re && // eslint-disable-next-line unicorn/prefer-includes
1082
- y.indexOf("<") === -1)
1083
- return N && pt ? N.createHTML(y) : y;
1084
- if (u = Sn(y), !u)
1085
- return Ne ? null : pt ? ie : "";
1086
- }
1087
- u && Lt && ue(u.firstChild);
1088
- const F = An(Je ? y : u);
1089
- for (; $ = F.nextNode(); )
1090
- En($), In($), $.content instanceof s && Cn($.content);
1091
- if (Je)
1092
- return y;
1093
- if (Ne) {
1094
- if (_e) {
1095
- u.normalize();
1096
- let oe = u.innerHTML;
1097
- tt([ve, Ae, Pe], (he) => {
1098
- oe = He(oe, he, " ");
1099
- }), u.innerHTML = oe;
1100
- }
1101
- if (ht)
1102
- for (X = Oe.call(u.ownerDocument); u.firstChild; )
1103
- X.appendChild(u.firstChild);
1103
+ if (!Pe && !ve && !Re && // eslint-disable-next-line unicorn/prefer-includes
1104
+ w.indexOf("<") === -1)
1105
+ return $ && xt ? $.createHTML(w) : w;
1106
+ if (u = Cn(w), !u)
1107
+ return Pe ? null : xt ? Q : "";
1108
+ }
1109
+ u && Ft && oe(u.firstChild);
1110
+ const j = Dn(it ? w : u);
1111
+ for (; D = j.nextNode(); )
1112
+ On(D), zn(D), D.content instanceof s && Zt(D.content);
1113
+ if (it)
1114
+ return ve && Mn(w), w;
1115
+ if (Pe) {
1116
+ if (ve && Mn(u), bt)
1117
+ for (H = pt.call(u.ownerDocument); u.firstChild; )
1118
+ H.appendChild(u.firstChild);
1104
1119
  else
1105
- X = u;
1106
- return (g.shadowroot || g.shadowrootmode) && (X = L.call(n, X, !0)), X;
1107
- }
1108
- let te = Re ? u.outerHTML : u.innerHTML;
1109
- return Re && w["!doctype"] && u.ownerDocument && u.ownerDocument.doctype && u.ownerDocument.doctype.name && Y(ds, u.ownerDocument.doctype.name) && (te = "<!DOCTYPE " + u.ownerDocument.doctype.name + `>
1110
- ` + te), _e && tt([ve, Ae, Pe], (oe) => {
1111
- te = He(te, oe, " ");
1112
- }), N && pt ? N.createHTML(te) : te;
1120
+ H = u;
1121
+ return (F.shadowroot || F.shadowrootmode) && (H = dt.call(n, H, !0)), H;
1122
+ }
1123
+ let ie = Re ? u.outerHTML : u.innerHTML;
1124
+ return Re && E["!doctype"] && u.ownerDocument && u.ownerDocument.doctype && u.ownerDocument.doctype.name && X(Dr, u.ownerDocument.doctype.name) && (ie = "<!DOCTYPE " + u.ownerDocument.doctype.name + `>
1125
+ ` + ie), ve && je([Ne, ze, $e], (Te) => {
1126
+ ie = We(ie, Te, " ");
1127
+ }), $ && xt ? $.createHTML(ie) : ie;
1113
1128
  }, t.setConfig = function() {
1114
- let y = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1115
- Ft(y), Mt = !0;
1129
+ let w = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1130
+ Vt(w), Pt = !0;
1116
1131
  }, t.clearConfig = function() {
1117
- Ue = null, Mt = !1;
1118
- }, t.isValidAttribute = function(y, r, u) {
1119
- Ue || Ft({});
1120
- const b = G(y), $ = G(r);
1121
- return _n(b, $, u);
1122
- }, t.addHook = function(y, r) {
1123
- typeof r == "function" && nt(q[y], r);
1124
- }, t.removeHook = function(y, r) {
1125
- if (r !== void 0) {
1126
- const u = ni(q[y], r);
1127
- return u === -1 ? void 0 : si(q[y], u, 1)[0];
1128
- }
1129
- return Fn(q[y]);
1130
- }, t.removeHooks = function(y) {
1131
- q[y] = [];
1132
+ Ue = null, Pt = !1;
1133
+ }, t.isValidAttribute = function(w, a, u) {
1134
+ Ue || Vt({});
1135
+ const g = W(w), D = W(a);
1136
+ return Ln(g, D, u);
1137
+ }, t.addHook = function(w, a) {
1138
+ typeof a == "function" && Ge(Y[w], a);
1139
+ }, t.removeHook = function(w, a) {
1140
+ if (a !== void 0) {
1141
+ const u = dr(Y[w], a);
1142
+ return u === -1 ? void 0 : fr(Y[w], u, 1)[0];
1143
+ }
1144
+ return Yn(Y[w]);
1145
+ }, t.removeHooks = function(w) {
1146
+ Y[w] = [];
1132
1147
  }, t.removeAllHooks = function() {
1133
- q = Kn();
1148
+ Y = rs();
1134
1149
  }, t;
1135
1150
  }
1136
- h(fs, "createDOMPurify");
1137
- var Ti = fs();
1138
- function tn() {
1151
+ h(ys, "createDOMPurify");
1152
+ var Nr = ys();
1153
+ function on() {
1139
1154
  return { async: !1, breaks: !1, extensions: null, gfm: !0, hooks: null, pedantic: !1, renderer: null, silent: !1, tokenizer: null, walkTokens: null };
1140
1155
  }
1141
- h(tn, "z");
1142
- var Le = tn();
1143
- function gs(a) {
1144
- Le = a;
1156
+ h(on, "M");
1157
+ var Le = on();
1158
+ function ws(i) {
1159
+ Le = i;
1160
+ }
1161
+ h(ws, "N");
1162
+ var Me = { exec: /* @__PURE__ */ h(() => null, "exec") };
1163
+ function Ve(i) {
1164
+ let t = [];
1165
+ return (e) => {
1166
+ let n = Math.max(0, Math.min(3, e - 1)), r = t[n];
1167
+ return r || (r = i(n), t[n] = r), r;
1168
+ };
1145
1169
  }
1146
- h(gs, "G");
1147
- var De = { exec: /* @__PURE__ */ h(() => null, "exec") };
1148
- function M(a, t = "") {
1149
- let e = typeof a == "string" ? a : a.source, n = { replace: /* @__PURE__ */ h((i, s) => {
1170
+ h(Ve, "E");
1171
+ function L(i, t = "") {
1172
+ let e = typeof i == "string" ? i : i.source, n = { replace: /* @__PURE__ */ h((r, s) => {
1150
1173
  let l = typeof s == "string" ? s : s.source;
1151
- return l = l.replace(K.caret, "$1"), e = e.replace(i, l), n;
1174
+ return l = l.replace(J.caret, "$1"), e = e.replace(r, l), n;
1152
1175
  }, "replace"), getRegex: /* @__PURE__ */ h(() => new RegExp(e, t), "getRegex") };
1153
1176
  return n;
1154
1177
  }
1155
- h(M, "d");
1156
- var Si = ((a = "") => {
1178
+ h(L, "d");
1179
+ var zr = ((i = "") => {
1157
1180
  try {
1158
- return !!new RegExp("(?<=1)(?<!1)" + a);
1181
+ return !!new RegExp("(?<=1)(?<!1)" + i);
1159
1182
  } catch {
1160
1183
  return !1;
1161
1184
  }
1162
- })(), K = { 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__ */ h((a) => new RegExp(`^( {0,3}${a})((?:[ ][^\\n]*)?(?:\\n|$))`), "listItemRegex"), nextBulletRegex: /* @__PURE__ */ h((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), "nextBulletRegex"), hrRegex: /* @__PURE__ */ h((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), "hrRegex"), fencesBeginRegex: /* @__PURE__ */ h((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}(?:\`\`\`|~~~)`), "fencesBeginRegex"), headingBeginRegex: /* @__PURE__ */ h((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}#`), "headingBeginRegex"), htmlBeginRegex: /* @__PURE__ */ h((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}<(?:[a-z].*>|!--)`, "i"), "htmlBeginRegex"), blockquoteBeginRegex: /* @__PURE__ */ h((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}>`), "blockquoteBeginRegex") }, Ai = /^(?:[ \t]*(?:\n|$))+/, Ei = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, _i = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, ot = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Ri = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, nn = / {0,3}(?:[*+-]|\d{1,9}[.)])/, ms = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, xs = M(ms).replace(/bull/g, nn).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(), Ii = M(ms).replace(/bull/g, nn).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(), sn = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Ci = /^[^\n]+/, rn = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Di = M(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", rn).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Mi = M(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, nn).getRegex(), Et = "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", an = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Li = M("^ {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", an).replace("tag", Et).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), bs = M(sn).replace("hr", ot).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]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Et).getRegex(), Oi = M(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", bs).getRegex(), ln = { blockquote: Oi, code: Ei, def: Di, fences: _i, heading: Ri, hr: ot, html: Li, lheading: xs, list: Mi, newline: Ai, paragraph: bs, table: De, text: Ci }, Qn = M("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", ot).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", Et).getRegex(), zi = { ...ln, lheading: Ii, table: Qn, paragraph: M(sn).replace("hr", ot).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Qn).replace("blockquote", " {0,3}>").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", Et).getRegex() }, Pi = { ...ln, html: M(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", an).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: De, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: M(sn).replace("hr", ot).replace("heading", ` *#{1,6} *[^
1163
- ]`).replace("lheading", xs).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Ni = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, $i = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, ks = /^( {2,}|\\)\n(?!\s*$)/, Bi = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Xe = /[\p{P}\p{S}]/u, _t = /[\s\p{P}\p{S}]/u, on = /[^\s\p{P}\p{S}]/u, Ui = M(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, _t).getRegex(), vs = /(?!~)[\p{P}\p{S}]/u, Fi = /(?!~)[\s\p{P}\p{S}]/u, Hi = /(?:[^\s\p{P}\p{S}]|~)/u, Gi = M(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", Si ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), ws = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, ji = M(ws, "u").replace(/punct/g, Xe).getRegex(), Wi = M(ws, "u").replace(/punct/g, vs).getRegex(), ys = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", qi = M(ys, "gu").replace(/notPunctSpace/g, on).replace(/punctSpace/g, _t).replace(/punct/g, Xe).getRegex(), Vi = M(ys, "gu").replace(/notPunctSpace/g, Hi).replace(/punctSpace/g, Fi).replace(/punct/g, vs).getRegex(), Yi = M("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, on).replace(/punctSpace/g, _t).replace(/punct/g, Xe).getRegex(), Zi = M(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, Xe).getRegex(), Xi = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", Ki = M(Xi, "gu").replace(/notPunctSpace/g, on).replace(/punctSpace/g, _t).replace(/punct/g, Xe).getRegex(), Qi = M(/\\(punct)/, "gu").replace(/punct/g, Xe).getRegex(), Ji = M(/^<(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(), er = M(an).replace("(?:-->|$)", "-->").getRegex(), tr = M("^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", er).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), yt = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, nr = M(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", yt).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), Ts = M(/^!?\[(label)\]\[(ref)\]/).replace("label", yt).replace("ref", rn).getRegex(), Ss = M(/^!?\[(ref)\](?:\[\])?/).replace("ref", rn).getRegex(), sr = M("reflink|nolink(?!\\()", "g").replace("reflink", Ts).replace("nolink", Ss).getRegex(), Jn = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, cn = { _backpedal: De, anyPunctuation: Qi, autolink: Ji, blockSkip: Gi, br: ks, code: $i, del: De, delLDelim: De, delRDelim: De, emStrongLDelim: ji, emStrongRDelimAst: qi, emStrongRDelimUnd: Yi, escape: Ni, link: nr, nolink: Ss, punctuation: Ui, reflink: Ts, reflinkSearch: sr, tag: tr, text: Bi, url: De }, ir = { ...cn, link: M(/^!?\[(label)\]\((.*?)\)/).replace("label", yt).getRegex(), reflink: M(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", yt).getRegex() }, Jt = { ...cn, emStrongRDelimAst: Vi, emStrongLDelim: Wi, delLDelim: Zi, delRDelim: Ki, url: M(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", Jn).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: M(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", Jn).getRegex() }, rr = { ...Jt, br: M(ks).replace("{2,}", "*").getRegex(), text: M(Jt.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, bt = { normal: ln, gfm: zi, pedantic: Pi }, rt = { normal: cn, gfm: Jt, breaks: rr, pedantic: ir }, ar = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }, es = /* @__PURE__ */ h((a) => ar[a], "de");
1164
- function xe(a, t) {
1185
+ })(), J = { 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__ */ h((i) => new RegExp(`^( {0,3}${i})((?:[ ][^\\n]*)?(?:\\n|$))`), "listItemRegex"), nextBulletRegex: Ve((i) => new RegExp(`^ {0,${i}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)), hrRegex: Ve((i) => new RegExp(`^ {0,${i}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)), fencesBeginRegex: Ve((i) => new RegExp(`^ {0,${i}}(?:\`\`\`|~~~)`)), headingBeginRegex: Ve((i) => new RegExp(`^ {0,${i}}#`)), htmlBeginRegex: Ve((i) => new RegExp(`^ {0,${i}}<(?:[a-z].*>|!--)`, "i")), blockquoteBeginRegex: Ve((i) => new RegExp(`^ {0,${i}}>`)) }, $r = /^(?:[ \t]*(?:\n|$))+/, Pr = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Fr = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, ht = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Br = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, cn = / {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, cn).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(), Ur = L(vs).replace(/bull/g, cn).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(), un = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Hr = /^[^\n]+/, hn = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, jr = L(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", hn).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Gr = L(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, cn).getRegex(), Lt = "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", pn = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Wr = 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", pn).replace("tag", Lt).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), Ss = L(un).replace("hr", ht).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]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Lt).getRegex(), qr = L(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Ss).getRegex(), dn = { blockquote: qr, code: Pr, def: jr, fences: Fr, heading: Br, hr: ht, html: Wr, lheading: Ts, list: Gr, newline: $r, paragraph: Ss, table: Me, text: Hr }, is = L("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", ht).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", Lt).getRegex(), Vr = { ...dn, lheading: Ur, table: is, paragraph: L(un).replace("hr", ht).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", is).replace("blockquote", " {0,3}>").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", Lt).getRegex() }, Yr = { ...dn, html: L(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", pn).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: Me, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: L(un).replace("hr", ht).replace("heading", ` *#{1,6} *[^
1186
+ ]`).replace("lheading", Ts).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Zr = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Xr = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, As = /^( {2,}|\\)\n(?!\s*$)/, Kr = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, et = /[\p{P}\p{S}]/u, Nt = /[\s\p{P}\p{S}]/u, fn = /[^\s\p{P}\p{S}]/u, Qr = L(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Nt).getRegex(), Es = /(?!~)[\p{P}\p{S}]/u, Jr = /(?!~)[\s\p{P}\p{S}]/u, ei = /(?:[^\s\p{P}\p{S}]|~)/u, ti = L(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", zr ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), _s = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, ni = L(_s, "u").replace(/punct/g, et).getRegex(), si = L(_s, "u").replace(/punct/g, Es).getRegex(), Rs = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", ri = L(Rs, "gu").replace(/notPunctSpace/g, fn).replace(/punctSpace/g, Nt).replace(/punct/g, et).getRegex(), ii = L(Rs, "gu").replace(/notPunctSpace/g, ei).replace(/punctSpace/g, Jr).replace(/punct/g, Es).getRegex(), ai = L("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, fn).replace(/punctSpace/g, Nt).replace(/punct/g, et).getRegex(), li = L(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, et).getRegex(), oi = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", ci = L(oi, "gu").replace(/notPunctSpace/g, fn).replace(/punctSpace/g, Nt).replace(/punct/g, et).getRegex(), ui = L(/\\(punct)/, "gu").replace(/punct/g, et).getRegex(), hi = 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(), pi = L(pn).replace("(?:-->|$)", "-->").getRegex(), di = 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", pi).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), Ct = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, fi = 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", hn).getRegex(), Cs = L(/^!?\[(ref)\](?:\[\])?/).replace("ref", hn).getRegex(), gi = L("reflink|nolink(?!\\()", "g").replace("reflink", Is).replace("nolink", Cs).getRegex(), as = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, gn = { _backpedal: Me, anyPunctuation: ui, autolink: hi, blockSkip: ti, br: As, code: Xr, del: Me, delLDelim: Me, delRDelim: Me, emStrongLDelim: ni, emStrongRDelimAst: ri, emStrongRDelimUnd: ai, escape: Zr, link: fi, nolink: Cs, punctuation: Qr, reflink: Is, reflinkSearch: gi, tag: di, text: Kr, url: Me }, mi = { ...gn, link: L(/^!?\[(label)\]\((.*?)\)/).replace("label", Ct).getRegex(), reflink: L(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", Ct).getRegex() }, an = { ...gn, emStrongRDelimAst: ii, emStrongLDelim: si, delLDelim: li, delRDelim: ci, url: L(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", as).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", as).getRegex() }, bi = { ...an, br: L(As).replace("{2,}", "*").getRegex(), text: L(an.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, Et = { normal: dn, gfm: Vr, pedantic: Yr }, ot = { normal: gn, gfm: an, breaks: bi, pedantic: mi }, xi = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }, ls = /* @__PURE__ */ h((i) => xi[i], "ge");
1187
+ function fe(i, t) {
1165
1188
  if (t) {
1166
- if (K.escapeTest.test(a)) return a.replace(K.escapeReplace, es);
1167
- } else if (K.escapeTestNoEncode.test(a)) return a.replace(K.escapeReplaceNoEncode, es);
1168
- return a;
1189
+ if (J.escapeTest.test(i)) return i.replace(J.escapeReplace, ls);
1190
+ } else if (J.escapeTestNoEncode.test(i)) return i.replace(J.escapeReplaceNoEncode, ls);
1191
+ return i;
1169
1192
  }
1170
- h(xe, "O");
1171
- function ts(a) {
1193
+ h(fe, "O");
1194
+ function os(i) {
1172
1195
  try {
1173
- a = encodeURI(a).replace(K.percentDecode, "%");
1196
+ i = encodeURI(i).replace(J.percentDecode, "%");
1174
1197
  } catch {
1175
1198
  return null;
1176
1199
  }
1177
- return a;
1200
+ return i;
1178
1201
  }
1179
- h(ts, "J");
1180
- function ns(a, t) {
1181
- let e = a.replace(K.findPipe, (s, l, o) => {
1202
+ h(os, "V");
1203
+ function cs(i, t) {
1204
+ let e = i.replace(J.findPipe, (s, l, o) => {
1182
1205
  let p = !1, c = l;
1183
1206
  for (; --c >= 0 && o[c] === "\\"; ) p = !p;
1184
1207
  return p ? "|" : " |";
1185
- }), n = e.split(K.splitPipe), i = 0;
1208
+ }), n = e.split(J.splitPipe), r = 0;
1186
1209
  if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), t) if (n.length > t) n.splice(t);
1187
1210
  else for (; n.length < t; ) n.push("");
1188
- for (; i < n.length; i++) n[i] = n[i].trim().replace(K.slashPipe, "|");
1211
+ for (; r < n.length; r++) n[r] = n[r].trim().replace(J.slashPipe, "|");
1189
1212
  return n;
1190
1213
  }
1191
- h(ns, "V");
1192
- function we(a, t, e) {
1193
- let n = a.length;
1214
+ h(cs, "Y");
1215
+ function Se(i, t, e) {
1216
+ let n = i.length;
1194
1217
  if (n === 0) return "";
1195
- let i = 0;
1196
- for (; i < n && a.charAt(n - i - 1) === t; )
1197
- i++;
1198
- return a.slice(0, n - i);
1218
+ let r = 0;
1219
+ for (; r < n && i.charAt(n - r - 1) === t; )
1220
+ r++;
1221
+ return i.slice(0, n - r);
1199
1222
  }
1200
- h(we, "$");
1201
- function ss(a) {
1202
- let t = a.split(`
1223
+ h(Se, "$");
1224
+ function us(i) {
1225
+ let t = i.split(`
1203
1226
  `), e = t.length - 1;
1204
- for (; e >= 0 && K.blankLine.test(t[e]); ) e--;
1205
- return t.length - e <= 2 ? a : t.slice(0, e + 1).join(`
1227
+ for (; e >= 0 && J.blankLine.test(t[e]); ) e--;
1228
+ return t.length - e <= 2 ? i : t.slice(0, e + 1).join(`
1206
1229
  `);
1207
1230
  }
1208
- h(ss, "Y");
1209
- function lr(a, t) {
1210
- if (a.indexOf(t[1]) === -1) return -1;
1231
+ h(us, "ee");
1232
+ function ki(i, t) {
1233
+ if (i.indexOf(t[1]) === -1) return -1;
1211
1234
  let e = 0;
1212
- for (let n = 0; n < a.length; n++) if (a[n] === "\\") n++;
1213
- else if (a[n] === t[0]) e++;
1214
- else if (a[n] === t[1] && (e--, e < 0)) return n;
1235
+ for (let n = 0; n < i.length; n++) if (i[n] === "\\") n++;
1236
+ else if (i[n] === t[0]) e++;
1237
+ else if (i[n] === t[1] && (e--, e < 0)) return n;
1215
1238
  return e > 0 ? -2 : -1;
1216
1239
  }
1217
- h(lr, "ge");
1218
- function or(a, t = 0) {
1240
+ h(ki, "fe");
1241
+ function yi(i, t = 0) {
1219
1242
  let e = t, n = "";
1220
- for (let i of a) if (i === " ") {
1243
+ for (let r of i) if (r === " ") {
1221
1244
  let s = 4 - e % 4;
1222
1245
  n += " ".repeat(s), e += s;
1223
- } else n += i, e++;
1246
+ } else n += r, e++;
1224
1247
  return n;
1225
1248
  }
1226
- h(or, "fe");
1227
- function is(a, t, e, n, i) {
1228
- let s = t.href, l = t.title || null, o = a[1].replace(i.other.outputLinkReplace, "$1");
1249
+ h(yi, "me");
1250
+ function hs(i, t, e, n, r) {
1251
+ let s = t.href, l = t.title || null, o = i[1].replace(r.other.outputLinkReplace, "$1");
1229
1252
  n.state.inLink = !0;
1230
- let p = { type: a[0].charAt(0) === "!" ? "image" : "link", raw: e, href: s, title: l, text: o, tokens: n.inlineTokens(o) };
1253
+ let p = { type: i[0].charAt(0) === "!" ? "image" : "link", raw: e, href: s, title: l, text: o, tokens: n.inlineTokens(o) };
1231
1254
  return n.state.inLink = !1, p;
1232
1255
  }
1233
- h(is, "me");
1234
- function cr(a, t, e) {
1235
- let n = a.match(e.other.indentCodeCompensation);
1256
+ h(hs, "xe");
1257
+ function wi(i, t, e) {
1258
+ let n = i.match(e.other.indentCodeCompensation);
1236
1259
  if (n === null) return t;
1237
- let i = n[1];
1260
+ let r = n[1];
1238
1261
  return t.split(`
1239
1262
  `).map((s) => {
1240
1263
  let l = s.match(e.other.beginningSpace);
1241
1264
  if (l === null) return s;
1242
1265
  let [o] = l;
1243
- return o.length >= i.length ? s.slice(i.length) : s;
1266
+ return o.length >= r.length ? s.slice(r.length) : s;
1244
1267
  }).join(`
1245
1268
  `);
1246
1269
  }
1247
- h(cr, "rt");
1248
- var We, Tt = (We = class {
1270
+ h(wi, "st");
1271
+ var Ze, Dt = (Ze = class {
1249
1272
  constructor(t) {
1250
- D(this, "options");
1251
- D(this, "rules");
1252
- D(this, "lexer");
1273
+ M(this, "options");
1274
+ M(this, "rules");
1275
+ M(this, "lexer");
1253
1276
  this.options = t || Le;
1254
1277
  }
1255
1278
  space(t) {
@@ -1259,15 +1282,15 @@ var We, Tt = (We = class {
1259
1282
  code(t) {
1260
1283
  let e = this.rules.block.code.exec(t);
1261
1284
  if (e) {
1262
- let n = this.options.pedantic ? e[0] : ss(e[0]), i = n.replace(this.rules.other.codeRemoveIndent, "");
1263
- return { type: "code", raw: n, codeBlockStyle: "indented", text: i };
1285
+ let n = this.options.pedantic ? e[0] : us(e[0]), r = n.replace(this.rules.other.codeRemoveIndent, "");
1286
+ return { type: "code", raw: n, codeBlockStyle: "indented", text: r };
1264
1287
  }
1265
1288
  }
1266
1289
  fences(t) {
1267
1290
  let e = this.rules.block.fences.exec(t);
1268
1291
  if (e) {
1269
- let n = e[0], i = cr(n, e[3] || "", this.rules);
1270
- return { type: "code", raw: n, lang: e[2] ? e[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : e[2], text: i };
1292
+ let n = e[0], r = wi(n, e[3] || "", this.rules);
1293
+ return { type: "code", raw: n, lang: e[2] ? e[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : e[2], text: r };
1271
1294
  }
1272
1295
  }
1273
1296
  heading(t) {
@@ -1275,90 +1298,90 @@ var We, Tt = (We = class {
1275
1298
  if (e) {
1276
1299
  let n = e[2].trim();
1277
1300
  if (this.rules.other.endingHash.test(n)) {
1278
- let i = we(n, "#");
1279
- (this.options.pedantic || !i || this.rules.other.endingSpaceChar.test(i)) && (n = i.trim());
1301
+ let r = Se(n, "#");
1302
+ (this.options.pedantic || !r || this.rules.other.endingSpaceChar.test(r)) && (n = r.trim());
1280
1303
  }
1281
- return { type: "heading", raw: we(e[0], `
1304
+ return { type: "heading", raw: Se(e[0], `
1282
1305
  `), depth: e[1].length, text: n, tokens: this.lexer.inline(n) };
1283
1306
  }
1284
1307
  }
1285
1308
  hr(t) {
1286
1309
  let e = this.rules.block.hr.exec(t);
1287
- if (e) return { type: "hr", raw: we(e[0], `
1310
+ if (e) return { type: "hr", raw: Se(e[0], `
1288
1311
  `) };
1289
1312
  }
1290
1313
  blockquote(t) {
1291
1314
  let e = this.rules.block.blockquote.exec(t);
1292
1315
  if (e) {
1293
- let n = we(e[0], `
1316
+ let n = Se(e[0], `
1294
1317
  `).split(`
1295
- `), i = "", s = "", l = [];
1318
+ `), r = "", s = "", l = [];
1296
1319
  for (; n.length > 0; ) {
1297
1320
  let o = !1, p = [], c;
1298
1321
  for (c = 0; c < n.length; c++) if (this.rules.other.blockquoteStart.test(n[c])) p.push(n[c]), o = !0;
1299
1322
  else if (!o) p.push(n[c]);
1300
1323
  else break;
1301
1324
  n = n.slice(c);
1302
- let v = p.join(`
1303
- `), d = v.replace(this.rules.other.blockquoteSetextReplace, `
1325
+ let x = p.join(`
1326
+ `), d = x.replace(this.rules.other.blockquoteSetextReplace, `
1304
1327
  $1`).replace(this.rules.other.blockquoteSetextReplace2, "");
1305
- i = i ? `${i}
1306
- ${v}` : v, s = s ? `${s}
1328
+ r = r ? `${r}
1329
+ ${x}` : x, s = s ? `${s}
1307
1330
  ${d}` : d;
1308
- let x = this.lexer.state.top;
1309
- if (this.lexer.state.top = !0, this.lexer.blockTokens(d, l, !0), this.lexer.state.top = x, n.length === 0) break;
1310
- let m = l.at(-1);
1311
- if (m?.type === "code") break;
1312
- if (m?.type === "blockquote") {
1313
- let f = m, E = f.raw + `
1331
+ let m = this.lexer.state.top;
1332
+ if (this.lexer.state.top = !0, this.lexer.blockTokens(d, l, !0), this.lexer.state.top = m, n.length === 0) break;
1333
+ let b = l.at(-1);
1334
+ if (b?.type === "code") break;
1335
+ if (b?.type === "blockquote") {
1336
+ let f = b, v = f.raw + `
1314
1337
  ` + n.join(`
1315
- `), I = this.blockquote(E);
1316
- l[l.length - 1] = I, i = i.substring(0, i.length - f.raw.length) + I.raw, s = s.substring(0, s.length - f.text.length) + I.text;
1338
+ `), C = this.blockquote(v);
1339
+ l[l.length - 1] = C, r = r.substring(0, r.length - f.raw.length) + C.raw, s = s.substring(0, s.length - f.text.length) + C.text;
1317
1340
  break;
1318
- } else if (m?.type === "list") {
1319
- let f = m, E = f.raw + `
1341
+ } else if (b?.type === "list") {
1342
+ let f = b, v = f.raw + `
1320
1343
  ` + n.join(`
1321
- `), I = this.list(E);
1322
- l[l.length - 1] = I, i = i.substring(0, i.length - m.raw.length) + I.raw, s = s.substring(0, s.length - f.raw.length) + I.raw, n = E.substring(l.at(-1).raw.length).split(`
1344
+ `), C = this.list(v);
1345
+ l[l.length - 1] = C, r = r.substring(0, r.length - b.raw.length) + C.raw, s = s.substring(0, s.length - f.raw.length) + C.raw, n = v.substring(l.at(-1).raw.length).split(`
1323
1346
  `);
1324
1347
  continue;
1325
1348
  }
1326
1349
  }
1327
- return { type: "blockquote", raw: i, tokens: l, text: s };
1350
+ return { type: "blockquote", raw: r, tokens: l, text: s };
1328
1351
  }
1329
1352
  }
1330
1353
  list(t) {
1331
1354
  let e = this.rules.block.list.exec(t);
1332
1355
  if (e) {
1333
- let n = e[1].trim(), i = n.length > 1, s = { type: "list", raw: "", ordered: i, start: i ? +n.slice(0, -1) : "", loose: !1, items: [] };
1334
- n = i ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = i ? n : "[*+-]");
1356
+ let n = e[1].trim(), r = n.length > 1, s = { type: "list", raw: "", ordered: r, start: r ? +n.slice(0, -1) : "", loose: !1, items: [] };
1357
+ n = r ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = r ? n : "[*+-]");
1335
1358
  let l = this.rules.other.listItemRegex(n), o = !1;
1336
1359
  for (; t; ) {
1337
- let c = !1, v = "", d = "";
1360
+ let c = !1, x = "", d = "";
1338
1361
  if (!(e = l.exec(t)) || this.rules.block.hr.test(t)) break;
1339
- v = e[0], t = t.substring(v.length);
1340
- let x = or(e[2].split(`
1341
- `, 1)[0], e[1].length), m = t.split(`
1342
- `, 1)[0], f = !x.trim(), E = 0;
1343
- if (this.options.pedantic ? (E = 2, d = x.trimStart()) : f ? E = e[1].length + 1 : (E = x.search(this.rules.other.nonSpaceChar), E = E > 4 ? 1 : E, d = x.slice(E), E += e[1].length), f && this.rules.other.blankLine.test(m) && (v += m + `
1344
- `, t = t.substring(m.length + 1), c = !0), !c) {
1345
- let I = this.rules.other.nextBulletRegex(E), z = this.rules.other.hrRegex(E), Q = this.rules.other.fencesBeginRegex(E), W = this.rules.other.headingBeginRegex(E), N = this.rules.other.htmlBeginRegex(E), ie = this.rules.other.blockquoteBeginRegex(E);
1362
+ x = e[0], t = t.substring(x.length);
1363
+ let m = yi(e[2].split(`
1364
+ `, 1)[0], e[1].length), b = t.split(`
1365
+ `, 1)[0], f = !m.trim(), v = 0;
1366
+ if (this.options.pedantic ? (v = 2, d = m.trimStart()) : f ? v = e[1].length + 1 : (v = m.search(this.rules.other.nonSpaceChar), v = v > 4 ? 1 : v, d = m.slice(v), v += e[1].length), f && this.rules.other.blankLine.test(b) && (x += b + `
1367
+ `, t = t.substring(b.length + 1), c = !0), !c) {
1368
+ let C = this.rules.other.nextBulletRegex(v), z = this.rules.other.hrRegex(v), ee = this.rules.other.fencesBeginRegex(v), te = this.rules.other.headingBeginRegex(v), re = this.rules.other.htmlBeginRegex(v), ge = this.rules.other.blockquoteBeginRegex(v);
1346
1369
  for (; t; ) {
1347
- let se = t.split(`
1348
- `, 1)[0], re;
1349
- if (m = se, this.options.pedantic ? (m = m.replace(this.rules.other.listReplaceNesting, " "), re = m) : re = m.replace(this.rules.other.tabCharGlobal, " "), Q.test(m) || W.test(m) || N.test(m) || ie.test(m) || I.test(m) || z.test(m)) break;
1350
- if (re.search(this.rules.other.nonSpaceChar) >= E || !m.trim()) d += `
1351
- ` + re.slice(E);
1370
+ let $ = t.split(`
1371
+ `, 1)[0], Q;
1372
+ if (b = $, this.options.pedantic ? (b = b.replace(this.rules.other.listReplaceNesting, " "), Q = b) : Q = b.replace(this.rules.other.tabCharGlobal, " "), ee.test(b) || te.test(b) || re.test(b) || ge.test(b) || C.test(b) || z.test(b)) break;
1373
+ if (Q.search(this.rules.other.nonSpaceChar) >= v || !b.trim()) d += `
1374
+ ` + Q.slice(v);
1352
1375
  else {
1353
- if (f || x.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || Q.test(x) || W.test(x) || z.test(x)) break;
1376
+ if (f || m.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || ee.test(m) || te.test(m) || z.test(m)) break;
1354
1377
  d += `
1355
- ` + m;
1378
+ ` + b;
1356
1379
  }
1357
- f = !m.trim(), v += se + `
1358
- `, t = t.substring(se.length + 1), x = re.slice(E);
1380
+ f = !b.trim(), x += $ + `
1381
+ `, t = t.substring($.length + 1), m = Q.slice(v);
1359
1382
  }
1360
1383
  }
1361
- s.loose || (o ? s.loose = !0 : this.rules.other.doubleBlankLine.test(v) && (o = !0)), s.items.push({ type: "list_item", raw: v, task: !!this.options.gfm && this.rules.other.listIsTask.test(d), loose: !1, text: d, tokens: [] }), s.raw += v;
1384
+ s.loose || (o ? s.loose = !0 : this.rules.other.doubleBlankLine.test(x) && (o = !0)), s.items.push({ type: "list_item", raw: x, task: !!this.options.gfm && this.rules.other.listIsTask.test(d), loose: !1, text: d, tokens: [] }), s.raw += x;
1362
1385
  }
1363
1386
  let p = s.items.at(-1);
1364
1387
  if (p) p.raw = p.raw.trimEnd(), p.text = p.text.trimEnd();
@@ -1366,27 +1389,27 @@ ${d}` : d;
1366
1389
  s.raw = s.raw.trimEnd();
1367
1390
  for (let c of s.items) {
1368
1391
  this.lexer.state.top = !1, c.tokens = this.lexer.blockTokens(c.text, []);
1369
- let v = c.tokens[0];
1370
- if (c.task && (v?.type === "text" || v?.type === "paragraph")) {
1371
- c.text = c.text.replace(this.rules.other.listReplaceTask, ""), v.raw = v.raw.replace(this.rules.other.listReplaceTask, ""), v.text = v.text.replace(this.rules.other.listReplaceTask, "");
1372
- for (let x = this.lexer.inlineQueue.length - 1; x >= 0; x--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[x].src)) {
1373
- this.lexer.inlineQueue[x].src = this.lexer.inlineQueue[x].src.replace(this.rules.other.listReplaceTask, "");
1392
+ let x = c.tokens[0];
1393
+ if (c.task && (x?.type === "text" || x?.type === "paragraph")) {
1394
+ c.text = c.text.replace(this.rules.other.listReplaceTask, ""), x.raw = x.raw.replace(this.rules.other.listReplaceTask, ""), x.text = x.text.replace(this.rules.other.listReplaceTask, "");
1395
+ for (let m = this.lexer.inlineQueue.length - 1; m >= 0; m--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[m].src)) {
1396
+ this.lexer.inlineQueue[m].src = this.lexer.inlineQueue[m].src.replace(this.rules.other.listReplaceTask, "");
1374
1397
  break;
1375
1398
  }
1376
1399
  let d = this.rules.other.listTaskCheckbox.exec(c.raw);
1377
1400
  if (d) {
1378
- let x = { type: "checkbox", raw: d[0] + " ", checked: d[0] !== "[ ]" };
1379
- c.checked = x.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 = x.raw + c.tokens[0].raw, c.tokens[0].text = x.raw + c.tokens[0].text, c.tokens[0].tokens.unshift(x)) : c.tokens.unshift({ type: "paragraph", raw: x.raw, text: x.raw, tokens: [x] }) : c.tokens.unshift(x);
1401
+ let m = { type: "checkbox", raw: d[0] + " ", checked: d[0] !== "[ ]" };
1402
+ c.checked = m.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 = m.raw + c.tokens[0].raw, c.tokens[0].text = m.raw + c.tokens[0].text, c.tokens[0].tokens.unshift(m)) : c.tokens.unshift({ type: "paragraph", raw: m.raw, text: m.raw, tokens: [m] }) : c.tokens.unshift(m);
1380
1403
  }
1381
1404
  } else c.task && (c.task = !1);
1382
1405
  if (!s.loose) {
1383
- let d = c.tokens.filter((m) => m.type === "space"), x = d.length > 0 && d.some((m) => this.rules.other.anyLine.test(m.raw));
1384
- s.loose = x;
1406
+ let d = c.tokens.filter((b) => b.type === "space"), m = d.length > 0 && d.some((b) => this.rules.other.anyLine.test(b.raw));
1407
+ s.loose = m;
1385
1408
  }
1386
1409
  }
1387
1410
  if (s.loose) for (let c of s.items) {
1388
1411
  c.loose = !0;
1389
- for (let v of c.tokens) v.type === "text" && (v.type = "paragraph");
1412
+ for (let x of c.tokens) x.type === "text" && (x.type = "paragraph");
1390
1413
  }
1391
1414
  return s;
1392
1415
  }
@@ -1394,28 +1417,28 @@ ${d}` : d;
1394
1417
  html(t) {
1395
1418
  let e = this.rules.block.html.exec(t);
1396
1419
  if (e) {
1397
- let n = ss(e[0]);
1420
+ let n = us(e[0]);
1398
1421
  return { type: "html", block: !0, raw: n, pre: e[1] === "pre" || e[1] === "script" || e[1] === "style", text: n };
1399
1422
  }
1400
1423
  }
1401
1424
  def(t) {
1402
1425
  let e = this.rules.block.def.exec(t);
1403
1426
  if (e) {
1404
- 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];
1405
- return { type: "def", tag: n, raw: we(e[0], `
1406
- `), href: i, title: s };
1427
+ 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];
1428
+ return { type: "def", tag: n, raw: Se(e[0], `
1429
+ `), href: r, title: s };
1407
1430
  }
1408
1431
  }
1409
1432
  table(t) {
1410
1433
  let e = this.rules.block.table.exec(t);
1411
1434
  if (!e || !this.rules.other.tableDelimiter.test(e[2])) return;
1412
- let n = ns(e[1]), i = e[2].replace(this.rules.other.tableAlignChars, "").split("|"), s = e[3]?.trim() ? e[3].replace(this.rules.other.tableRowBlankLine, "").split(`
1413
- `) : [], l = { type: "table", raw: we(e[0], `
1435
+ let n = cs(e[1]), r = e[2].replace(this.rules.other.tableAlignChars, "").split("|"), s = e[3]?.trim() ? e[3].replace(this.rules.other.tableRowBlankLine, "").split(`
1436
+ `) : [], l = { type: "table", raw: Se(e[0], `
1414
1437
  `), header: [], align: [], rows: [] };
1415
- if (n.length === i.length) {
1416
- 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);
1438
+ if (n.length === r.length) {
1439
+ 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);
1417
1440
  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] });
1418
- for (let o of s) l.rows.push(ns(o, l.header.length).map((p, c) => ({ text: p, tokens: this.lexer.inline(p), header: !1, align: l.align[c] })));
1441
+ for (let o of s) l.rows.push(cs(o, l.header.length).map((p, c) => ({ text: p, tokens: this.lexer.inline(p), header: !1, align: l.align[c] })));
1419
1442
  return l;
1420
1443
  }
1421
1444
  }
@@ -1423,7 +1446,7 @@ ${d}` : d;
1423
1446
  let e = this.rules.block.lheading.exec(t);
1424
1447
  if (e) {
1425
1448
  let n = e[1].trim();
1426
- return { type: "heading", raw: we(e[0], `
1449
+ return { type: "heading", raw: Se(e[0], `
1427
1450
  `), depth: e[2].charAt(0) === "=" ? 1 : 2, text: n, tokens: this.lexer.inline(n) };
1428
1451
  }
1429
1452
  }
@@ -1453,65 +1476,65 @@ ${d}` : d;
1453
1476
  let n = e[2].trim();
1454
1477
  if (!this.options.pedantic && this.rules.other.startAngleBracket.test(n)) {
1455
1478
  if (!this.rules.other.endAngleBracket.test(n)) return;
1456
- let l = we(n.slice(0, -1), "\\");
1479
+ let l = Se(n.slice(0, -1), "\\");
1457
1480
  if ((n.length - l.length) % 2 === 0) return;
1458
1481
  } else {
1459
- let l = lr(e[2], "()");
1482
+ let l = ki(e[2], "()");
1460
1483
  if (l === -2) return;
1461
1484
  if (l > -1) {
1462
1485
  let o = (e[0].indexOf("!") === 0 ? 5 : 4) + e[1].length + l;
1463
1486
  e[2] = e[2].substring(0, l), e[0] = e[0].substring(0, o).trim(), e[3] = "";
1464
1487
  }
1465
1488
  }
1466
- let i = e[2], s = "";
1489
+ let r = e[2], s = "";
1467
1490
  if (this.options.pedantic) {
1468
- let l = this.rules.other.pedanticHrefTitle.exec(i);
1469
- l && (i = l[1], s = l[3]);
1491
+ let l = this.rules.other.pedanticHrefTitle.exec(r);
1492
+ l && (r = l[1], s = l[3]);
1470
1493
  } else s = e[3] ? e[3].slice(1, -1) : "";
1471
- 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)), is(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);
1494
+ 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)), hs(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);
1472
1495
  }
1473
1496
  }
1474
1497
  reflink(t, e) {
1475
1498
  let n;
1476
1499
  if ((n = this.rules.inline.reflink.exec(t)) || (n = this.rules.inline.nolink.exec(t))) {
1477
- let i = (n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "), s = e[i.toLowerCase()];
1500
+ let r = (n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "), s = e[r.toLowerCase()];
1478
1501
  if (!s) {
1479
1502
  let l = n[0].charAt(0);
1480
1503
  return { type: "text", raw: l, text: l };
1481
1504
  }
1482
- return is(n, s, n[0], this.lexer, this.rules);
1505
+ return hs(n, s, n[0], this.lexer, this.rules);
1483
1506
  }
1484
1507
  }
1485
1508
  emStrong(t, e, n = "") {
1486
- let i = this.rules.inline.emStrongLDelim.exec(t);
1487
- 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))) {
1488
- let s = [...i[0]].length - 1, l, o, p = s, c = 0, v = i[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
1489
- for (v.lastIndex = 0, e = e.slice(-1 * t.length + s); (i = v.exec(e)) !== null; ) {
1490
- if (l = i[1] || i[2] || i[3] || i[4] || i[5] || i[6], !l) continue;
1491
- if (o = [...l].length, i[3] || i[4]) {
1509
+ let r = this.rules.inline.emStrongLDelim.exec(t);
1510
+ 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))) {
1511
+ let s = [...r[0]].length - 1, l, o, p = s, c = 0, x = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
1512
+ for (x.lastIndex = 0, e = e.slice(-1 * t.length + s); (r = x.exec(e)) !== null; ) {
1513
+ if (l = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !l) continue;
1514
+ if (o = [...l].length, r[3] || r[4]) {
1492
1515
  p += o;
1493
1516
  continue;
1494
- } else if ((i[5] || i[6]) && s % 3 && !((s + o) % 3)) {
1517
+ } else if ((r[5] || r[6]) && s % 3 && !((s + o) % 3)) {
1495
1518
  c += o;
1496
1519
  continue;
1497
1520
  }
1498
1521
  if (p -= o, p > 0) continue;
1499
1522
  o = Math.min(o, o + p + c);
1500
- let d = [...i[0]][0].length, x = t.slice(0, s + i.index + d + o);
1523
+ let d = [...r[0]][0].length, m = t.slice(0, s + r.index + d + o);
1501
1524
  if (Math.min(s, o) % 2) {
1502
- let f = x.slice(1, -1);
1503
- return { type: "em", raw: x, text: f, tokens: this.lexer.inlineTokens(f) };
1525
+ let f = m.slice(1, -1);
1526
+ return { type: "em", raw: m, text: f, tokens: this.lexer.inlineTokens(f) };
1504
1527
  }
1505
- let m = x.slice(2, -2);
1506
- return { type: "strong", raw: x, text: m, tokens: this.lexer.inlineTokens(m) };
1528
+ let b = m.slice(2, -2);
1529
+ return { type: "strong", raw: m, text: b, tokens: this.lexer.inlineTokens(b) };
1507
1530
  }
1508
1531
  }
1509
1532
  }
1510
1533
  codespan(t) {
1511
1534
  let e = this.rules.inline.code.exec(t);
1512
1535
  if (e) {
1513
- 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);
1514
- return i && s && (n = n.substring(1, n.length - 1)), { type: "codespan", raw: e[0], text: n };
1536
+ 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);
1537
+ return r && s && (n = n.substring(1, n.length - 1)), { type: "codespan", raw: e[0], text: n };
1515
1538
  }
1516
1539
  }
1517
1540
  br(t) {
@@ -1519,42 +1542,42 @@ ${d}` : d;
1519
1542
  if (e) return { type: "br", raw: e[0] };
1520
1543
  }
1521
1544
  del(t, e, n = "") {
1522
- let i = this.rules.inline.delLDelim.exec(t);
1523
- if (i && (!i[1] || !n || this.rules.inline.punctuation.exec(n))) {
1524
- let s = [...i[0]].length - 1, l, o, p = s, c = this.rules.inline.delRDelim;
1525
- for (c.lastIndex = 0, e = e.slice(-1 * t.length + s); (i = c.exec(e)) !== null; ) {
1526
- if (l = i[1] || i[2] || i[3] || i[4] || i[5] || i[6], !l || (o = [...l].length, o !== s)) continue;
1527
- if (i[3] || i[4]) {
1545
+ let r = this.rules.inline.delLDelim.exec(t);
1546
+ if (r && (!r[1] || !n || this.rules.inline.punctuation.exec(n))) {
1547
+ let s = [...r[0]].length - 1, l, o, p = s, c = this.rules.inline.delRDelim;
1548
+ for (c.lastIndex = 0, e = e.slice(-1 * t.length + s); (r = c.exec(e)) !== null; ) {
1549
+ if (l = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !l || (o = [...l].length, o !== s)) continue;
1550
+ if (r[3] || r[4]) {
1528
1551
  p += o;
1529
1552
  continue;
1530
1553
  }
1531
1554
  if (p -= o, p > 0) continue;
1532
1555
  o = Math.min(o, o + p);
1533
- let v = [...i[0]][0].length, d = t.slice(0, s + i.index + v + o), x = d.slice(s, -s);
1534
- return { type: "del", raw: d, text: x, tokens: this.lexer.inlineTokens(x) };
1556
+ let x = [...r[0]][0].length, d = t.slice(0, s + r.index + x + o), m = d.slice(s, -s);
1557
+ return { type: "del", raw: d, text: m, tokens: this.lexer.inlineTokens(m) };
1535
1558
  }
1536
1559
  }
1537
1560
  }
1538
1561
  autolink(t) {
1539
1562
  let e = this.rules.inline.autolink.exec(t);
1540
1563
  if (e) {
1541
- let n, i;
1542
- 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 }] };
1564
+ let n, r;
1565
+ 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 }] };
1543
1566
  }
1544
1567
  }
1545
1568
  url(t) {
1546
1569
  let e;
1547
1570
  if (e = this.rules.inline.url.exec(t)) {
1548
- let n, i;
1549
- if (e[2] === "@") n = e[0], i = "mailto:" + n;
1571
+ let n, r;
1572
+ if (e[2] === "@") n = e[0], r = "mailto:" + n;
1550
1573
  else {
1551
1574
  let s;
1552
1575
  do
1553
1576
  s = e[0], e[0] = this.rules.inline._backpedal.exec(e[0])?.[0] ?? "";
1554
1577
  while (s !== e[0]);
1555
- n = e[0], e[1] === "www." ? i = "http://" + e[0] : i = e[0];
1578
+ n = e[0], e[1] === "www." ? r = "http://" + e[0] : r = e[0];
1556
1579
  }
1557
- return { type: "link", raw: e[0], text: n, href: i, tokens: [{ type: "text", raw: n, text: n }] };
1580
+ return { type: "link", raw: e[0], text: n, href: r, tokens: [{ type: "text", raw: n, text: n }] };
1558
1581
  }
1559
1582
  }
1560
1583
  inlineText(t) {
@@ -1564,28 +1587,28 @@ ${d}` : d;
1564
1587
  return { type: "text", raw: e[0], text: e[0], escaped: n };
1565
1588
  }
1566
1589
  }
1567
- }, h(We, "w"), We), Te, de = (Te = class {
1590
+ }, h(Ze, "w"), Ze), Ee, ue = (Ee = class {
1568
1591
  constructor(t) {
1569
- D(this, "tokens");
1570
- D(this, "options");
1571
- D(this, "state");
1572
- D(this, "inlineQueue");
1573
- D(this, "tokenizer");
1574
- this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = t || Le, this.options.tokenizer = this.options.tokenizer || new Tt(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 };
1575
- let e = { other: K, block: bt.normal, inline: rt.normal };
1576
- this.options.pedantic ? (e.block = bt.pedantic, e.inline = rt.pedantic) : this.options.gfm && (e.block = bt.gfm, this.options.breaks ? e.inline = rt.breaks : e.inline = rt.gfm), this.tokenizer.rules = e;
1592
+ M(this, "tokens");
1593
+ M(this, "options");
1594
+ M(this, "state");
1595
+ M(this, "inlineQueue");
1596
+ M(this, "tokenizer");
1597
+ this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = t || Le, this.options.tokenizer = this.options.tokenizer || new Dt(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 };
1598
+ let e = { other: J, block: Et.normal, inline: ot.normal };
1599
+ this.options.pedantic ? (e.block = Et.pedantic, e.inline = ot.pedantic) : this.options.gfm && (e.block = Et.gfm, this.options.breaks ? e.inline = ot.breaks : e.inline = ot.gfm), this.tokenizer.rules = e;
1577
1600
  }
1578
1601
  static get rules() {
1579
- return { block: bt, inline: rt };
1602
+ return { block: Et, inline: ot };
1580
1603
  }
1581
1604
  static lex(t, e) {
1582
- return new Te(e).lex(t);
1605
+ return new Ee(e).lex(t);
1583
1606
  }
1584
1607
  static lexInline(t, e) {
1585
- return new Te(e).inlineTokens(t);
1608
+ return new Ee(e).inlineTokens(t);
1586
1609
  }
1587
1610
  lex(t) {
1588
- t = t.replace(K.carriageReturn, `
1611
+ t = t.replace(J.carriageReturn, `
1589
1612
  `), this.blockTokens(t, this.tokens);
1590
1613
  for (let e = 0; e < this.inlineQueue.length; e++) {
1591
1614
  let n = this.inlineQueue[e];
@@ -1594,10 +1617,10 @@ ${d}` : d;
1594
1617
  return this.inlineQueue = [], this.tokens;
1595
1618
  }
1596
1619
  blockTokens(t, e = [], n = !1) {
1597
- this.tokenizer.lexer = this, this.options.pedantic && (t = t.replace(K.tabCharGlobal, " ").replace(K.spaceLine, ""));
1598
- let i = 1 / 0;
1620
+ this.tokenizer.lexer = this, this.options.pedantic && (t = t.replace(J.tabCharGlobal, " ").replace(J.spaceLine, ""));
1621
+ let r = 1 / 0;
1599
1622
  for (; t; ) {
1600
- if (t.length < i) i = t.length;
1623
+ if (t.length < r) r = t.length;
1601
1624
  else {
1602
1625
  this.infiniteLoopError(t.charCodeAt(0));
1603
1626
  break;
@@ -1664,8 +1687,8 @@ ${d}` : d;
1664
1687
  let l = t;
1665
1688
  if (this.options.extensions?.startBlock) {
1666
1689
  let o = 1 / 0, p = t.slice(1), c;
1667
- this.options.extensions.startBlock.forEach((v) => {
1668
- c = v.call({ lexer: this }, p), typeof c == "number" && c >= 0 && (o = Math.min(o, c));
1690
+ this.options.extensions.startBlock.forEach((x) => {
1691
+ c = x.call({ lexer: this }, p), typeof c == "number" && c >= 0 && (o = Math.min(o, c));
1669
1692
  }), o < 1 / 0 && o >= 0 && (l = t.substring(0, o + 1));
1670
1693
  }
1671
1694
  if (this.state.top && (s = this.tokenizer.paragraph(l))) {
@@ -1697,14 +1720,14 @@ ${d}` : d;
1697
1720
  }
1698
1721
  inlineTokens(t, e = []) {
1699
1722
  this.tokenizer.lexer = this;
1700
- let n = t, i = null;
1723
+ let n = t, r = null;
1701
1724
  if (this.tokens.links) {
1702
1725
  let c = Object.keys(this.tokens.links);
1703
- 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));
1726
+ 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));
1704
1727
  }
1705
- for (; (i = this.tokenizer.rules.inline.anyPunctuation.exec(n)) !== null; ) n = n.slice(0, i.index) + "++" + n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
1728
+ for (; (r = this.tokenizer.rules.inline.anyPunctuation.exec(n)) !== null; ) n = n.slice(0, r.index) + "++" + n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
1706
1729
  let s;
1707
- 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);
1730
+ 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);
1708
1731
  n = this.options.hooks?.emStrongMask?.call({ lexer: this }, n) ?? n;
1709
1732
  let l = !1, o = "", p = 1 / 0;
1710
1733
  for (; t; ) {
@@ -1758,14 +1781,14 @@ ${d}` : d;
1758
1781
  t = t.substring(c.raw.length), e.push(c);
1759
1782
  continue;
1760
1783
  }
1761
- let v = t;
1784
+ let x = t;
1762
1785
  if (this.options.extensions?.startInline) {
1763
- let d = 1 / 0, x = t.slice(1), m;
1786
+ let d = 1 / 0, m = t.slice(1), b;
1764
1787
  this.options.extensions.startInline.forEach((f) => {
1765
- m = f.call({ lexer: this }, x), typeof m == "number" && m >= 0 && (d = Math.min(d, m));
1766
- }), d < 1 / 0 && d >= 0 && (v = t.substring(0, d + 1));
1788
+ b = f.call({ lexer: this }, m), typeof b == "number" && b >= 0 && (d = Math.min(d, b));
1789
+ }), d < 1 / 0 && d >= 0 && (x = t.substring(0, d + 1));
1767
1790
  }
1768
- if (c = this.tokenizer.inlineText(v)) {
1791
+ if (c = this.tokenizer.inlineText(x)) {
1769
1792
  t = t.substring(c.raw.length), c.raw.slice(-1) !== "_" && (o = c.raw.slice(-1)), l = !0;
1770
1793
  let d = e.at(-1);
1771
1794
  d?.type === "text" ? (d.raw += c.raw, d.text += c.text) : e.push(c);
@@ -1783,20 +1806,20 @@ ${d}` : d;
1783
1806
  if (this.options.silent) console.error(e);
1784
1807
  else throw new Error(e);
1785
1808
  }
1786
- }, h(Te, "l"), Te), qe, St = (qe = class {
1809
+ }, h(Ee, "l"), Ee), Xe, Mt = (Xe = class {
1787
1810
  constructor(t) {
1788
- D(this, "options");
1789
- D(this, "parser");
1811
+ M(this, "options");
1812
+ M(this, "parser");
1790
1813
  this.options = t || Le;
1791
1814
  }
1792
1815
  space(t) {
1793
1816
  return "";
1794
1817
  }
1795
1818
  code({ text: t, lang: e, escaped: n }) {
1796
- let i = (e || "").match(K.notSpaceStart)?.[0], s = t.replace(K.endingNewline, "") + `
1819
+ let r = (e || "").match(J.notSpaceStart)?.[0], s = t.replace(J.endingNewline, "") + `
1797
1820
  `;
1798
- return i ? '<pre><code class="language-' + xe(i) + '">' + (n ? s : xe(s, !0)) + `</code></pre>
1799
- ` : "<pre><code>" + (n ? s : xe(s, !0)) + `</code></pre>
1821
+ return r ? '<pre><code class="language-' + fe(r) + '">' + (n ? s : fe(s, !0)) + `</code></pre>
1822
+ ` : "<pre><code>" + (n ? s : fe(s, !0)) + `</code></pre>
1800
1823
  `;
1801
1824
  }
1802
1825
  blockquote({ tokens: t }) {
@@ -1819,14 +1842,14 @@ ${this.parser.parse(t)}</blockquote>
1819
1842
  `;
1820
1843
  }
1821
1844
  list(t) {
1822
- let e = t.ordered, n = t.start, i = "";
1845
+ let e = t.ordered, n = t.start, r = "";
1823
1846
  for (let o = 0; o < t.items.length; o++) {
1824
1847
  let p = t.items[o];
1825
- i += this.listitem(p);
1848
+ r += this.listitem(p);
1826
1849
  }
1827
1850
  let s = e ? "ol" : "ul", l = e && n !== 1 ? ' start="' + n + '"' : "";
1828
1851
  return "<" + s + l + `>
1829
- ` + i + "</" + s + `>
1852
+ ` + r + "</" + s + `>
1830
1853
  `;
1831
1854
  }
1832
1855
  listitem(t) {
@@ -1844,17 +1867,17 @@ ${this.parser.parse(t)}</blockquote>
1844
1867
  let e = "", n = "";
1845
1868
  for (let s = 0; s < t.header.length; s++) n += this.tablecell(t.header[s]);
1846
1869
  e += this.tablerow({ text: n });
1847
- let i = "";
1870
+ let r = "";
1848
1871
  for (let s = 0; s < t.rows.length; s++) {
1849
1872
  let l = t.rows[s];
1850
1873
  n = "";
1851
1874
  for (let o = 0; o < l.length; o++) n += this.tablecell(l[o]);
1852
- i += this.tablerow({ text: n });
1875
+ r += this.tablerow({ text: n });
1853
1876
  }
1854
- return i && (i = `<tbody>${i}</tbody>`), `<table>
1877
+ return r && (r = `<tbody>${r}</tbody>`), `<table>
1855
1878
  <thead>
1856
1879
  ` + e + `</thead>
1857
- ` + i + `</table>
1880
+ ` + r + `</table>
1858
1881
  `;
1859
1882
  }
1860
1883
  tablerow({ text: t }) {
@@ -1874,7 +1897,7 @@ ${t}</tr>
1874
1897
  return `<em>${this.parser.parseInline(t)}</em>`;
1875
1898
  }
1876
1899
  codespan({ text: t }) {
1877
- return `<code>${xe(t, !0)}</code>`;
1900
+ return `<code>${fe(t, !0)}</code>`;
1878
1901
  }
1879
1902
  br(t) {
1880
1903
  return "<br>";
@@ -1883,24 +1906,24 @@ ${t}</tr>
1883
1906
  return `<del>${this.parser.parseInline(t)}</del>`;
1884
1907
  }
1885
1908
  link({ href: t, title: e, tokens: n }) {
1886
- let i = this.parser.parseInline(n), s = ts(t);
1887
- if (s === null) return i;
1909
+ let r = this.parser.parseInline(n), s = os(t);
1910
+ if (s === null) return r;
1888
1911
  t = s;
1889
1912
  let l = '<a href="' + t + '"';
1890
- return e && (l += ' title="' + xe(e) + '"'), l += ">" + i + "</a>", l;
1913
+ return e && (l += ' title="' + fe(e) + '"'), l += ">" + r + "</a>", l;
1891
1914
  }
1892
- image({ href: t, title: e, text: n, tokens: i }) {
1893
- i && (n = this.parser.parseInline(i, this.parser.textRenderer));
1894
- let s = ts(t);
1895
- if (s === null) return xe(n);
1915
+ image({ href: t, title: e, text: n, tokens: r }) {
1916
+ r && (n = this.parser.parseInline(r, this.parser.textRenderer));
1917
+ let s = os(t);
1918
+ if (s === null) return fe(n);
1896
1919
  t = s;
1897
- let l = `<img src="${t}" alt="${xe(n)}"`;
1898
- return e && (l += ` title="${xe(e)}"`), l += ">", l;
1920
+ let l = `<img src="${t}" alt="${fe(n)}"`;
1921
+ return e && (l += ` title="${fe(e)}"`), l += ">", l;
1899
1922
  }
1900
1923
  text(t) {
1901
- return "tokens" in t && t.tokens ? this.parser.parseInline(t.tokens) : "escaped" in t && t.escaped ? t.text : xe(t.text);
1924
+ return "tokens" in t && t.tokens ? this.parser.parseInline(t.tokens) : "escaped" in t && t.escaped ? t.text : fe(t.text);
1902
1925
  }
1903
- }, h(qe, "y"), qe), Ve, un = (Ve = class {
1926
+ }, h(Xe, "y"), Xe), Ke, mn = (Ke = class {
1904
1927
  strong({ text: t }) {
1905
1928
  return t;
1906
1929
  }
@@ -1931,32 +1954,32 @@ ${t}</tr>
1931
1954
  checkbox({ raw: t }) {
1932
1955
  return t;
1933
1956
  }
1934
- }, h(Ve, "L"), Ve), Se, fe = (Se = class {
1957
+ }, h(Ke, "L"), Ke), _e, he = (_e = class {
1935
1958
  constructor(t) {
1936
- D(this, "options");
1937
- D(this, "renderer");
1938
- D(this, "textRenderer");
1939
- this.options = t || Le, this.options.renderer = this.options.renderer || new St(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new un();
1959
+ M(this, "options");
1960
+ M(this, "renderer");
1961
+ M(this, "textRenderer");
1962
+ this.options = t || Le, this.options.renderer = this.options.renderer || new Mt(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new mn();
1940
1963
  }
1941
1964
  static parse(t, e) {
1942
- return new Se(e).parse(t);
1965
+ return new _e(e).parse(t);
1943
1966
  }
1944
1967
  static parseInline(t, e) {
1945
- return new Se(e).parseInline(t);
1968
+ return new _e(e).parseInline(t);
1946
1969
  }
1947
1970
  parse(t) {
1948
1971
  this.renderer.parser = this;
1949
1972
  let e = "";
1950
1973
  for (let n = 0; n < t.length; n++) {
1951
- let i = t[n];
1952
- if (this.options.extensions?.renderers?.[i.type]) {
1953
- let l = i, o = this.options.extensions.renderers[l.type].call({ parser: this }, l);
1974
+ let r = t[n];
1975
+ if (this.options.extensions?.renderers?.[r.type]) {
1976
+ let l = r, o = this.options.extensions.renderers[l.type].call({ parser: this }, l);
1954
1977
  if (o !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "def", "paragraph", "text"].includes(l.type)) {
1955
1978
  e += o || "";
1956
1979
  continue;
1957
1980
  }
1958
1981
  }
1959
- let s = i;
1982
+ let s = r;
1960
1983
  switch (s.type) {
1961
1984
  case "space": {
1962
1985
  e += this.renderer.space(s);
@@ -2018,8 +2041,8 @@ ${t}</tr>
2018
2041
  parseInline(t, e = this.renderer) {
2019
2042
  this.renderer.parser = this;
2020
2043
  let n = "";
2021
- for (let i = 0; i < t.length; i++) {
2022
- let s = t[i];
2044
+ for (let r = 0; r < t.length; r++) {
2045
+ let s = t[r];
2023
2046
  if (this.options.extensions?.renderers?.[s.type]) {
2024
2047
  let o = this.options.extensions.renderers[s.type].call({ parser: this }, s);
2025
2048
  if (o !== !1 || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(s.type)) {
@@ -2082,10 +2105,10 @@ ${t}</tr>
2082
2105
  }
2083
2106
  return n;
2084
2107
  }
2085
- }, h(Se, "l"), Se), ye, lt = (ye = class {
2108
+ }, h(_e, "l"), _e), Ae, ut = (Ae = class {
2086
2109
  constructor(t) {
2087
- D(this, "options");
2088
- D(this, "block");
2110
+ M(this, "options");
2111
+ M(this, "block");
2089
2112
  this.options = t || Le;
2090
2113
  }
2091
2114
  preprocess(t) {
@@ -2101,41 +2124,41 @@ ${t}</tr>
2101
2124
  return t;
2102
2125
  }
2103
2126
  provideLexer(t = this.block) {
2104
- return t ? de.lex : de.lexInline;
2127
+ return t ? ue.lex : ue.lexInline;
2105
2128
  }
2106
2129
  provideParser(t = this.block) {
2107
- return t ? fe.parse : fe.parseInline;
2130
+ return t ? he.parse : he.parseInline;
2108
2131
  }
2109
- }, h(ye, "P"), D(ye, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"])), D(ye, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), ye), Ye, ur = (Ye = class {
2132
+ }, h(Ae, "P"), M(Ae, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"])), M(Ae, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), Ae), Qe, vi = (Qe = class {
2110
2133
  constructor(...t) {
2111
- D(this, "defaults", tn());
2112
- D(this, "options", this.setOptions);
2113
- D(this, "parse", this.parseMarkdown(!0));
2114
- D(this, "parseInline", this.parseMarkdown(!1));
2115
- D(this, "Parser", fe);
2116
- D(this, "Renderer", St);
2117
- D(this, "TextRenderer", un);
2118
- D(this, "Lexer", de);
2119
- D(this, "Tokenizer", Tt);
2120
- D(this, "Hooks", lt);
2134
+ M(this, "defaults", on());
2135
+ M(this, "options", this.setOptions);
2136
+ M(this, "parse", this.parseMarkdown(!0));
2137
+ M(this, "parseInline", this.parseMarkdown(!1));
2138
+ M(this, "Parser", he);
2139
+ M(this, "Renderer", Mt);
2140
+ M(this, "TextRenderer", mn);
2141
+ M(this, "Lexer", ue);
2142
+ M(this, "Tokenizer", Dt);
2143
+ M(this, "Hooks", ut);
2121
2144
  this.use(...t);
2122
2145
  }
2123
2146
  walkTokens(t, e) {
2124
2147
  let n = [];
2125
- for (let i of t) switch (n = n.concat(e.call(this, i)), i.type) {
2148
+ for (let r of t) switch (n = n.concat(e.call(this, r)), r.type) {
2126
2149
  case "table": {
2127
- let s = i;
2150
+ let s = r;
2128
2151
  for (let l of s.header) n = n.concat(this.walkTokens(l.tokens, e));
2129
2152
  for (let l of s.rows) for (let o of l) n = n.concat(this.walkTokens(o.tokens, e));
2130
2153
  break;
2131
2154
  }
2132
2155
  case "list": {
2133
- let s = i;
2156
+ let s = r;
2134
2157
  n = n.concat(this.walkTokens(s.items, e));
2135
2158
  break;
2136
2159
  }
2137
2160
  default: {
2138
- let s = i;
2161
+ let s = r;
2139
2162
  this.defaults.extensions?.childTokens?.[s.type] ? this.defaults.extensions.childTokens[s.type].forEach((l) => {
2140
2163
  let o = s[l].flat(1 / 0);
2141
2164
  n = n.concat(this.walkTokens(o, e));
@@ -2147,8 +2170,8 @@ ${t}</tr>
2147
2170
  use(...t) {
2148
2171
  let e = this.defaults.extensions || { renderers: {}, childTokens: {} };
2149
2172
  return t.forEach((n) => {
2150
- let i = { ...n };
2151
- if (i.async = this.defaults.async || i.async || !1, n.extensions && (n.extensions.forEach((s) => {
2173
+ let r = { ...n };
2174
+ if (r.async = this.defaults.async || r.async || !1, n.extensions && (n.extensions.forEach((s) => {
2152
2175
  if (!s.name) throw new Error("extension name required");
2153
2176
  if ("renderer" in s) {
2154
2177
  let l = e.renderers[s.name];
@@ -2163,92 +2186,92 @@ ${t}</tr>
2163
2186
  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]));
2164
2187
  }
2165
2188
  "childTokens" in s && s.childTokens && (e.childTokens[s.name] = s.childTokens);
2166
- }), i.extensions = e), n.renderer) {
2167
- let s = this.defaults.renderer || new St(this.defaults);
2189
+ }), r.extensions = e), n.renderer) {
2190
+ let s = this.defaults.renderer || new Mt(this.defaults);
2168
2191
  for (let l in n.renderer) {
2169
2192
  if (!(l in s)) throw new Error(`renderer '${l}' does not exist`);
2170
2193
  if (["options", "parser"].includes(l)) continue;
2171
2194
  let o = l, p = n.renderer[o], c = s[o];
2172
- s[o] = (...v) => {
2173
- let d = p.apply(s, v);
2174
- return d === !1 && (d = c.apply(s, v)), d || "";
2195
+ s[o] = (...x) => {
2196
+ let d = p.apply(s, x);
2197
+ return d === !1 && (d = c.apply(s, x)), d || "";
2175
2198
  };
2176
2199
  }
2177
- i.renderer = s;
2200
+ r.renderer = s;
2178
2201
  }
2179
2202
  if (n.tokenizer) {
2180
- let s = this.defaults.tokenizer || new Tt(this.defaults);
2203
+ let s = this.defaults.tokenizer || new Dt(this.defaults);
2181
2204
  for (let l in n.tokenizer) {
2182
2205
  if (!(l in s)) throw new Error(`tokenizer '${l}' does not exist`);
2183
2206
  if (["options", "rules", "lexer"].includes(l)) continue;
2184
2207
  let o = l, p = n.tokenizer[o], c = s[o];
2185
- s[o] = (...v) => {
2186
- let d = p.apply(s, v);
2187
- return d === !1 && (d = c.apply(s, v)), d;
2208
+ s[o] = (...x) => {
2209
+ let d = p.apply(s, x);
2210
+ return d === !1 && (d = c.apply(s, x)), d;
2188
2211
  };
2189
2212
  }
2190
- i.tokenizer = s;
2213
+ r.tokenizer = s;
2191
2214
  }
2192
2215
  if (n.hooks) {
2193
- let s = this.defaults.hooks || new lt();
2216
+ let s = this.defaults.hooks || new ut();
2194
2217
  for (let l in n.hooks) {
2195
2218
  if (!(l in s)) throw new Error(`hook '${l}' does not exist`);
2196
2219
  if (["options", "block"].includes(l)) continue;
2197
2220
  let o = l, p = n.hooks[o], c = s[o];
2198
- lt.passThroughHooks.has(l) ? s[o] = (v) => {
2199
- if (this.defaults.async && lt.passThroughHooksRespectAsync.has(l)) return (async () => {
2200
- let x = await p.call(s, v);
2201
- return c.call(s, x);
2221
+ ut.passThroughHooks.has(l) ? s[o] = (x) => {
2222
+ if (this.defaults.async && ut.passThroughHooksRespectAsync.has(l)) return (async () => {
2223
+ let m = await p.call(s, x);
2224
+ return c.call(s, m);
2202
2225
  })();
2203
- let d = p.call(s, v);
2226
+ let d = p.call(s, x);
2204
2227
  return c.call(s, d);
2205
- } : s[o] = (...v) => {
2228
+ } : s[o] = (...x) => {
2206
2229
  if (this.defaults.async) return (async () => {
2207
- let x = await p.apply(s, v);
2208
- return x === !1 && (x = await c.apply(s, v)), x;
2230
+ let m = await p.apply(s, x);
2231
+ return m === !1 && (m = await c.apply(s, x)), m;
2209
2232
  })();
2210
- let d = p.apply(s, v);
2211
- return d === !1 && (d = c.apply(s, v)), d;
2233
+ let d = p.apply(s, x);
2234
+ return d === !1 && (d = c.apply(s, x)), d;
2212
2235
  };
2213
2236
  }
2214
- i.hooks = s;
2237
+ r.hooks = s;
2215
2238
  }
2216
2239
  if (n.walkTokens) {
2217
2240
  let s = this.defaults.walkTokens, l = n.walkTokens;
2218
- i.walkTokens = function(o) {
2241
+ r.walkTokens = function(o) {
2219
2242
  let p = [];
2220
2243
  return p.push(l.call(this, o)), s && (p = p.concat(s.call(this, o))), p;
2221
2244
  };
2222
2245
  }
2223
- this.defaults = { ...this.defaults, ...i };
2246
+ this.defaults = { ...this.defaults, ...r };
2224
2247
  }), this;
2225
2248
  }
2226
2249
  setOptions(t) {
2227
2250
  return this.defaults = { ...this.defaults, ...t }, this;
2228
2251
  }
2229
2252
  lexer(t, e) {
2230
- return de.lex(t, e ?? this.defaults);
2253
+ return ue.lex(t, e ?? this.defaults);
2231
2254
  }
2232
2255
  parser(t, e) {
2233
- return fe.parse(t, e ?? this.defaults);
2256
+ return he.parse(t, e ?? this.defaults);
2234
2257
  }
2235
2258
  parseMarkdown(t) {
2236
2259
  return (e, n) => {
2237
- let i = { ...n }, s = { ...this.defaults, ...i }, l = this.onError(!!s.silent, !!s.async);
2238
- 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."));
2260
+ let r = { ...n }, s = { ...this.defaults, ...r }, l = this.onError(!!s.silent, !!s.async);
2261
+ 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."));
2239
2262
  if (typeof e > "u" || e === null) return l(new Error("marked(): input parameter is undefined or null"));
2240
2263
  if (typeof e != "string") return l(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(e) + ", string expected"));
2241
2264
  if (s.hooks && (s.hooks.options = s, s.hooks.block = t), s.async) return (async () => {
2242
- let o = s.hooks ? await s.hooks.preprocess(e) : e, p = await (s.hooks ? await s.hooks.provideLexer(t) : t ? de.lex : de.lexInline)(o, s), c = s.hooks ? await s.hooks.processAllTokens(p) : p;
2265
+ let o = s.hooks ? await s.hooks.preprocess(e) : e, p = await (s.hooks ? await s.hooks.provideLexer(t) : t ? ue.lex : ue.lexInline)(o, s), c = s.hooks ? await s.hooks.processAllTokens(p) : p;
2243
2266
  s.walkTokens && await Promise.all(this.walkTokens(c, s.walkTokens));
2244
- let v = await (s.hooks ? await s.hooks.provideParser(t) : t ? fe.parse : fe.parseInline)(c, s);
2245
- return s.hooks ? await s.hooks.postprocess(v) : v;
2267
+ let x = await (s.hooks ? await s.hooks.provideParser(t) : t ? he.parse : he.parseInline)(c, s);
2268
+ return s.hooks ? await s.hooks.postprocess(x) : x;
2246
2269
  })().catch(l);
2247
2270
  try {
2248
2271
  s.hooks && (e = s.hooks.preprocess(e));
2249
- let o = (s.hooks ? s.hooks.provideLexer(t) : t ? de.lex : de.lexInline)(e, s);
2272
+ let o = (s.hooks ? s.hooks.provideLexer(t) : t ? ue.lex : ue.lexInline)(e, s);
2250
2273
  s.hooks && (o = s.hooks.processAllTokens(o)), s.walkTokens && this.walkTokens(o, s.walkTokens);
2251
- let p = (s.hooks ? s.hooks.provideParser(t) : t ? fe.parse : fe.parseInline)(o, s);
2274
+ let p = (s.hooks ? s.hooks.provideParser(t) : t ? he.parse : he.parseInline)(o, s);
2252
2275
  return s.hooks && (p = s.hooks.postprocess(p)), p;
2253
2276
  } catch (o) {
2254
2277
  return l(o);
@@ -2259,57 +2282,57 @@ ${t}</tr>
2259
2282
  return (n) => {
2260
2283
  if (n.message += `
2261
2284
  Please report this to https://github.com/markedjs/marked.`, t) {
2262
- let i = "<p>An error occurred:</p><pre>" + xe(n.message + "", !0) + "</pre>";
2263
- return e ? Promise.resolve(i) : i;
2285
+ let r = "<p>An error occurred:</p><pre>" + fe(n.message + "", !0) + "</pre>";
2286
+ return e ? Promise.resolve(r) : r;
2264
2287
  }
2265
2288
  if (e) return Promise.reject(n);
2266
2289
  throw n;
2267
2290
  };
2268
2291
  }
2269
- }, h(Ye, "D"), Ye), Me = new ur();
2270
- function O(a, t) {
2271
- return Me.parse(a, t);
2292
+ }, h(Qe, "q"), Qe), Oe = new vi();
2293
+ function N(i, t) {
2294
+ return Oe.parse(i, t);
2272
2295
  }
2273
- h(O, "g");
2274
- O.options = O.setOptions = function(a) {
2275
- return Me.setOptions(a), O.defaults = Me.defaults, gs(O.defaults), O;
2296
+ h(N, "g");
2297
+ N.options = N.setOptions = function(i) {
2298
+ return Oe.setOptions(i), N.defaults = Oe.defaults, ws(N.defaults), N;
2276
2299
  };
2277
- O.getDefaults = tn;
2278
- O.defaults = Le;
2279
- O.use = function(...a) {
2280
- return Me.use(...a), O.defaults = Me.defaults, gs(O.defaults), O;
2300
+ N.getDefaults = on;
2301
+ N.defaults = Le;
2302
+ N.use = function(...i) {
2303
+ return Oe.use(...i), N.defaults = Oe.defaults, ws(N.defaults), N;
2281
2304
  };
2282
- O.walkTokens = function(a, t) {
2283
- return Me.walkTokens(a, t);
2305
+ N.walkTokens = function(i, t) {
2306
+ return Oe.walkTokens(i, t);
2284
2307
  };
2285
- O.parseInline = Me.parseInline;
2286
- O.Parser = fe;
2287
- O.parser = fe.parse;
2288
- O.Renderer = St;
2289
- O.TextRenderer = un;
2290
- O.Lexer = de;
2291
- O.lexer = de.lex;
2292
- O.Tokenizer = Tt;
2293
- O.Hooks = lt;
2294
- O.parse = O;
2295
- O.options;
2296
- O.setOptions;
2297
- O.use;
2298
- O.walkTokens;
2299
- O.parseInline;
2300
- fe.parse;
2301
- de.lex;
2302
- const hr = ["innerHTML"], kt = /* @__PURE__ */ ke({
2308
+ N.parseInline = Oe.parseInline;
2309
+ N.Parser = he;
2310
+ N.parser = he.parse;
2311
+ N.Renderer = Mt;
2312
+ N.TextRenderer = mn;
2313
+ N.Lexer = ue;
2314
+ N.lexer = ue.lex;
2315
+ N.Tokenizer = Dt;
2316
+ N.Hooks = ut;
2317
+ N.parse = N;
2318
+ N.options;
2319
+ N.setOptions;
2320
+ N.use;
2321
+ N.walkTokens;
2322
+ N.parseInline;
2323
+ he.parse;
2324
+ ue.lex;
2325
+ const Ti = ["innerHTML"], _t = /* @__PURE__ */ ke({
2303
2326
  __name: "ChatRichText",
2304
2327
  props: {
2305
2328
  text: {},
2306
2329
  inverted: { type: Boolean },
2307
2330
  streaming: { type: Boolean }
2308
2331
  },
2309
- setup(a) {
2310
- const t = a, e = ls(t.text);
2332
+ setup(i) {
2333
+ const t = i, e = fs(t.text);
2311
2334
  let n;
2312
- Ze(
2335
+ Je(
2313
2336
  [() => t.text, () => t.streaming],
2314
2337
  ([l, o]) => {
2315
2338
  if (!o) {
@@ -2320,11 +2343,11 @@ const hr = ["innerHTML"], kt = /* @__PURE__ */ ke({
2320
2343
  n = void 0, e.value = t.text;
2321
2344
  }));
2322
2345
  }
2323
- ), os(() => {
2346
+ ), gs(() => {
2324
2347
  n !== void 0 && cancelAnimationFrame(n);
2325
2348
  });
2326
- const i = new O.Renderer();
2327
- i.link = ({ href: l, text: o }) => {
2349
+ const r = new N.Renderer();
2350
+ r.link = ({ href: l, text: o }) => {
2328
2351
  const p = l.trim();
2329
2352
  if (!p || p === "#")
2330
2353
  return o;
@@ -2336,23 +2359,23 @@ const hr = ["innerHTML"], kt = /* @__PURE__ */ ke({
2336
2359
  c = !1;
2337
2360
  }
2338
2361
  return c ? `<a href="${l}">${o}</a>` : `<a href="${l}" target="_blank" rel="noopener noreferrer">${o}</a>`;
2339
- }, O.setOptions({ breaks: !0, gfm: !0, renderer: i });
2362
+ }, N.setOptions({ breaks: !0, gfm: !0, renderer: r });
2340
2363
  const s = U(() => {
2341
2364
  const l = e.value;
2342
2365
  if (!l) return "";
2343
- const o = O.parse(l, { async: !1 });
2344
- return Ti.sanitize(o, { ADD_ATTR: ["target"], ADD_DATA_URI_TAGS: ["img"] });
2366
+ const o = N.parse(l, { async: !1 });
2367
+ return Nr.sanitize(o, { ADD_ATTR: ["target"], ADD_DATA_URI_TAGS: ["img"] });
2345
2368
  });
2346
2369
  return (l, o) => (T(), A("div", {
2347
- class: _(["chat-msg-prose break-words text-[14px] leading-relaxed @sm/chat:text-[15px] @sm/chat:leading-relaxed", a.inverted ? "chat-msg-prose-invert" : ""]),
2370
+ class: _(["chat-msg-prose break-words text-[14px] leading-relaxed @sm/chat:text-[15px] @sm/chat:leading-relaxed", i.inverted ? "chat-msg-prose-invert" : ""]),
2348
2371
  innerHTML: s.value
2349
- }, null, 10, hr));
2372
+ }, null, 10, Ti));
2350
2373
  }
2351
- }), pr = 80, dr = /* @__PURE__ */ ke({
2374
+ }), Si = 80, Ai = /* @__PURE__ */ ke({
2352
2375
  __name: "ChatScroller",
2353
- setup(a, { expose: t }) {
2354
- const e = Z(), n = Z();
2355
- let i = !0, s;
2376
+ setup(i, { expose: t }) {
2377
+ const e = K(), n = K();
2378
+ let r = !0, s;
2356
2379
  function l() {
2357
2380
  const c = e.value;
2358
2381
  c && (c.scrollTop = c.scrollHeight);
@@ -2360,21 +2383,21 @@ const hr = ["innerHTML"], kt = /* @__PURE__ */ ke({
2360
2383
  h(l, "scrollToBottom");
2361
2384
  function o() {
2362
2385
  const c = e.value;
2363
- c && (i = c.scrollHeight - c.scrollTop - c.clientHeight <= pr);
2386
+ c && (r = c.scrollHeight - c.scrollTop - c.clientHeight <= Si);
2364
2387
  }
2365
2388
  h(o, "onScroll");
2366
2389
  function p() {
2367
- i = !0, l();
2390
+ r = !0, l();
2368
2391
  }
2369
- return h(p, "pin"), t({ pin: p }), At(() => {
2392
+ return h(p, "pin"), t({ pin: p }), Ot(() => {
2370
2393
  requestAnimationFrame(() => {
2371
2394
  l(), requestAnimationFrame(l);
2372
2395
  }), n.value && (s = new ResizeObserver(() => {
2373
- i && l();
2396
+ r && l();
2374
2397
  }), s.observe(n.value));
2375
- }), os(() => {
2398
+ }), gs(() => {
2376
2399
  s?.disconnect();
2377
- }), (c, v) => (T(), A("div", {
2400
+ }), (c, x) => (T(), A("div", {
2378
2401
  ref_key: "viewport",
2379
2402
  ref: e,
2380
2403
  class: "overflow-y-auto overflow-x-hidden min-h-0 [overflow-anchor:none] [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",
@@ -2384,39 +2407,39 @@ const hr = ["innerHTML"], kt = /* @__PURE__ */ ke({
2384
2407
  ref_key: "content",
2385
2408
  ref: n
2386
2409
  }, [
2387
- en(c.$slots, "default")
2410
+ ln(c.$slots, "default")
2388
2411
  ], 512)
2389
2412
  ], 544));
2390
2413
  }
2391
- }), fr = { class: "@container/chat flex flex-col h-full relative" }, gr = {
2414
+ }), Ei = { class: "@container/chat flex flex-col h-full relative" }, _i = {
2392
2415
  key: 0,
2393
2416
  class: "pb-4"
2394
- }, mr = { class: "pt-4 pb-[120px] px-3 space-y-1" }, xr = {
2417
+ }, Ri = { class: "pt-4 pb-[120px] px-3 space-y-1" }, Ii = {
2395
2418
  key: 0,
2396
2419
  class: "flex flex-col items-center justify-center px-4 min-h-full"
2397
- }, br = { class: "relative mb-4 size-20 @sm/chat:size-24" }, kr = ["src", "alt"], vr = ["title"], wr = {
2420
+ }, Ci = { class: "relative mb-4 size-20 @sm/chat:size-24" }, Di = ["src", "alt"], Mi = ["title"], Oi = {
2398
2421
  key: 0,
2399
2422
  class: "flex items-center gap-3 py-3 px-2"
2400
- }, yr = ["data-issue-code", "data-issue-bucket"], Tr = { class: "max-w-[85%] min-w-0" }, Sr = ["href"], Ar = ["data-test"], Er = {
2423
+ }, Li = ["data-issue-code", "data-issue-bucket"], Ni = { class: "max-w-[85%] min-w-0" }, zi = ["href"], $i = ["data-test"], Pi = {
2401
2424
  key: 0,
2402
2425
  class: "flex-shrink-0 size-7 @sm/chat:size-8"
2403
- }, _r = ["src", "alt"], Rr = ["src", "alt"], Ir = ["src"], Cr = ["href"], Dr = {
2426
+ }, Fi = ["src", "alt"], Bi = ["src", "alt"], Ui = ["src"], Hi = ["href"], ji = {
2404
2427
  key: 1,
2405
2428
  "data-test": "messaging-thinking-indicator",
2406
2429
  class: "flex gap-2 justify-start items-center mb-4"
2407
- }, Mr = ["src", "alt"], Lr = {
2430
+ }, Gi = ["src", "alt"], Wi = {
2408
2431
  key: 0,
2409
2432
  class: "flex items-center gap-2 px-2 pb-2 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden"
2410
- }, Or = ["src", "alt"], zr = { class: "max-w-20 truncate" }, Pr = ["onClick"], Nr = {
2433
+ }, qi = ["src", "alt"], Vi = { class: "max-w-20 truncate" }, Yi = ["onClick"], Zi = {
2411
2434
  key: 0,
2412
2435
  class: "shrink-0 flex items-center justify-center size-14"
2413
- }, $r = ["disabled"], Br = {
2436
+ }, Xi = ["disabled"], Ki = {
2414
2437
  key: 0,
2415
2438
  class: "i-svg-spinners-ring-resize size-4"
2416
- }, Ur = {
2439
+ }, Qi = {
2417
2440
  key: 1,
2418
2441
  class: "i-tabler-paperclip size-5"
2419
- }, Fr = ["placeholder", "disabled"], Hr = ["disabled"], ea = /* @__PURE__ */ ke({
2442
+ }, Ji = ["placeholder", "disabled"], ea = ["disabled"], pa = /* @__PURE__ */ ke({
2420
2443
  __name: "ElAgentChat",
2421
2444
  props: {
2422
2445
  chatController: {},
@@ -2428,401 +2451,401 @@ const hr = ["innerHTML"], kt = /* @__PURE__ */ ke({
2428
2451
  setupHint: {},
2429
2452
  emptyStateMessage: {}
2430
2453
  },
2431
- setup(a) {
2454
+ setup(i) {
2432
2455
  const t = {
2433
2456
  private: { icon: "i-tabler-lock", label: "Private", tooltip: "Only you can see this conversation" },
2434
2457
  org: { icon: "i-tabler-users", label: "Workspace", tooltip: "Visible to workspace members" },
2435
2458
  public: { icon: "i-tabler-globe", label: "Public", tooltip: "Anyone with the link can see this" }
2436
2459
  }, e = U(() => {
2437
- const w = { ...t[a.scope] };
2438
- return a.scope === "org" && a.scopeName && (w.label = a.scopeName, w.tooltip = `Visible to ${a.scopeName} members`), w;
2439
- }), n = Z(""), i = Z(!1), s = Z(), l = Z(), o = Z(), p = Z([]), c = Z(!1);
2440
- function v(w) {
2441
- return w ? /\[[^\]]+\]\([^)]+\)/.test(w) : !1;
2460
+ const I = { ...t[i.scope] };
2461
+ return i.scope === "org" && i.scopeName && (I.label = i.scopeName, I.tooltip = `Visible to ${i.scopeName} members`), I;
2462
+ }), n = K(""), r = K(!1), s = K(), l = K(), o = K(), p = K([]), c = K(!1);
2463
+ function x(I) {
2464
+ return I ? /\[[^\]]+\]\([^)]+\)/.test(I) : !1;
2442
2465
  }
2443
- h(v, "containsMarkdownLink");
2444
- function d(w) {
2445
- return w.sender === "system" && (!!w.issue || w.id === N.value);
2466
+ h(x, "containsMarkdownLink");
2467
+ function d(I) {
2468
+ return I.sender === "system" && (!!I.issue || I.id === re.value);
2446
2469
  }
2447
2470
  h(d, "isSystemExplainerMessage");
2448
- function x(w, k) {
2449
- const g = w[k], P = w[k + 1];
2450
- return !P || P.sender !== g.sender;
2451
- }
2452
- h(x, "shouldShowAvatar");
2453
- const m = U(() => a.chatController?.textState.value), f = U(() => m.value?.isConnected ?? !1), E = U(() => m.value?.isThinking ?? !1), I = U(() => m.value?.connectionStatus === "disconnected" && !!m.value?.error), z = U(() => m.value?.connectionStatus !== "connected" && !m.value?.error), Q = U(() => m.value?.error), W = U(() => a.chatController?.sharedMessages.value ?? []), N = U(() => {
2454
- if (!E.value) return;
2455
- const w = W.value, k = w[w.length - 1];
2471
+ function m(I, k) {
2472
+ const y = I[k], E = I[k + 1];
2473
+ return !E || E.sender !== y.sender;
2474
+ }
2475
+ h(m, "shouldShowAvatar");
2476
+ const b = U(() => i.chatController?.textState.value), f = U(() => b.value?.isConnected ?? !1), v = U(() => b.value?.isThinking ?? !1), C = U(() => b.value?.connectionStatus === "disconnected" && !!b.value?.error), z = U(() => b.value?.connectionStatus !== "connected" && !b.value?.error), ee = U(() => b.value?.error), te = U(() => i.chatController?.sharedMessages.value ?? []), re = U(() => {
2477
+ if (!v.value) return;
2478
+ const I = te.value, k = I[I.length - 1];
2456
2479
  return k?.sender === "agent" || k?.sender === "system" ? k.id : void 0;
2457
- }), ie = U(() => E.value ? N.value === void 0 : !1), se = U(() => m.value?.accountGated ?? !1), re = U(() => !f.value || se.value), Oe = U(() => I.value ? "Agent is offline" : z.value ? "Connecting..." : se.value ? "Resolve the billing issue above to continue" : "Message"), ze = U(() => (n.value.trim() || p.value.length > 0) && !re.value && !c.value), L = U(() => a.variant === "light"), q = U(
2458
- () => L.value ? "bg-gradient-to-r from-transparent via-black/5 to-transparent" : "bg-gradient-to-r from-transparent via-white/5 to-transparent"
2459
- ), ve = U(() => L.value ? "text-theme-300" : "text-white/30");
2460
- At(async () => {
2461
- a.chatController && !f.value && await a.chatController.startTextConversation();
2480
+ }), ge = U(() => v.value ? re.value === void 0 : !1), $ = U(() => b.value?.accountGated ?? !1), Q = U(() => !f.value || $.value), me = U(() => C.value ? "Agent is offline" : z.value ? "Connecting..." : $.value ? "Resolve the billing issue above to continue" : "Message"), ye = U(() => (n.value.trim() || p.value.length > 0) && !Q.value && !c.value), O = U(() => i.variant === "light"), pt = U(
2481
+ () => O.value ? "bg-gradient-to-r from-transparent via-black/5 to-transparent" : "bg-gradient-to-r from-transparent via-white/5 to-transparent"
2482
+ ), tt = U(() => O.value ? "text-theme-300" : "text-white/30");
2483
+ Ot(async () => {
2484
+ i.chatController && !f.value && await i.chatController.startTextConversation();
2462
2485
  });
2463
- async function Ae() {
2464
- const w = n.value.trim(), k = p.value.length > 0;
2465
- if (!w && !k || !a.chatController || !f.value || c.value)
2486
+ async function dt() {
2487
+ const I = n.value.trim(), k = p.value.length > 0;
2488
+ if (!I && !k || !i.chatController || !f.value || c.value)
2466
2489
  return;
2467
- const g = n.value, P = k ? [...p.value] : void 0;
2468
- n.value = "", p.value = [], l.value && (l.value.style.height = "auto", l.value.focus()), s.value?.pin(), await a.chatController.sendChatMessage(g, P);
2490
+ const y = n.value, E = k ? [...p.value] : void 0;
2491
+ n.value = "", p.value = [], l.value && (l.value.style.height = "auto", l.value.focus()), s.value?.pin(), await i.chatController.sendChatMessage(y, E);
2469
2492
  }
2470
- h(Ae, "sendMessage");
2471
- async function Pe(w) {
2472
- w.key === "Enter" && !w.shiftKey && (w.preventDefault(), await Ae());
2493
+ h(dt, "sendMessage");
2494
+ async function Y(I) {
2495
+ I.key === "Enter" && !I.shiftKey && (I.preventDefault(), await dt());
2473
2496
  }
2474
- h(Pe, "handleKeydown");
2475
- function Rt() {
2497
+ h(Y, "handleKeydown");
2498
+ function Ne() {
2476
2499
  l.value && (l.value.style.height = "auto", l.value.style.height = `${Math.min(l.value.scrollHeight, 150)}px`);
2477
2500
  }
2478
- h(Rt, "adjustTextareaHeight"), Ze(n, () => Ls(() => Rt()));
2479
- function It() {
2501
+ h(Ne, "adjustTextareaHeight"), Je(n, () => Fs(() => Ne()));
2502
+ function ze() {
2480
2503
  o.value?.click();
2481
2504
  }
2482
- h(It, "triggerFileInput");
2483
- async function Ct(w) {
2484
- const k = w.target, g = k.files?.[0];
2485
- if (!(!g || !a.uploadFn)) {
2505
+ h(ze, "triggerFileInput");
2506
+ async function $e(I) {
2507
+ const k = I.target, y = k.files?.[0];
2508
+ if (!(!y || !i.uploadFn)) {
2486
2509
  c.value = !0;
2487
2510
  try {
2488
- const P = await a.uploadFn(g);
2489
- p.value = [...p.value, P];
2490
- } catch (P) {
2491
- const C = P instanceof Error ? P.message : "Couldn't attach that file.";
2492
- a.chatController?.notify(`Upload failed — ${C}`);
2511
+ const E = await i.uploadFn(y);
2512
+ p.value = [...p.value, E];
2513
+ } catch (E) {
2514
+ const Z = E instanceof Error ? E.message : "Couldn't attach that file.";
2515
+ i.chatController?.notify(`Upload failed — ${Z}`);
2493
2516
  } finally {
2494
2517
  c.value = !1, k.value = "";
2495
2518
  }
2496
2519
  }
2497
2520
  }
2498
- h(Ct, "handleFileSelect");
2499
- function ct(w) {
2500
- p.value = p.value.filter((k, g) => g !== w);
2521
+ h($e, "handleFileSelect");
2522
+ function zt(I) {
2523
+ p.value = p.value.filter((k, y) => y !== I);
2501
2524
  }
2502
- h(ct, "removeAttachment");
2503
- function ut(w, k) {
2525
+ h(zt, "removeAttachment");
2526
+ function ft(I, k) {
2504
2527
  if (k === 0) {
2505
- const le = w[k];
2506
- return le?.timestamp ? Ke(new Date(le.timestamp)) : null;
2507
- }
2508
- const g = w[k - 1], P = w[k];
2509
- if (!g?.timestamp || !P?.timestamp) return null;
2510
- const C = new Date(g.timestamp).getTime();
2511
- return new Date(P.timestamp).getTime() - C > 36e5 ? Ke(new Date(P.timestamp)) : null;
2512
- }
2513
- h(ut, "shouldShowTimeDivider");
2514
- function Ke(w) {
2515
- const k = /* @__PURE__ */ new Date(), g = w.toDateString() === k.toDateString(), P = new Date(k);
2516
- P.setDate(P.getDate() - 1);
2517
- const C = w.toDateString() === P.toDateString(), ae = w.toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" });
2518
- if (g) return ae;
2519
- if (C) return `Yesterday, ${ae}`;
2520
- const Ee = w.getFullYear() === k.getFullYear();
2521
- return `${w.toLocaleDateString("en-US", {
2528
+ const P = I[k];
2529
+ return P?.timestamp ? gt(new Date(P.timestamp)) : null;
2530
+ }
2531
+ const y = I[k - 1], E = I[k];
2532
+ if (!y?.timestamp || !E?.timestamp) return null;
2533
+ const Z = new Date(y.timestamp).getTime();
2534
+ return new Date(E.timestamp).getTime() - Z > 36e5 ? gt(new Date(E.timestamp)) : null;
2535
+ }
2536
+ h(ft, "shouldShowTimeDivider");
2537
+ function gt(I) {
2538
+ const k = /* @__PURE__ */ new Date(), y = I.toDateString() === k.toDateString(), E = new Date(k);
2539
+ E.setDate(E.getDate() - 1);
2540
+ const Z = I.toDateString() === E.toDateString(), F = I.toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" });
2541
+ if (y) return F;
2542
+ if (Z) return `Yesterday, ${F}`;
2543
+ const nt = I.getFullYear() === k.getFullYear();
2544
+ return `${I.toLocaleDateString("en-US", {
2522
2545
  weekday: "long",
2523
2546
  month: "short",
2524
2547
  day: "numeric",
2525
- ...Ee ? {} : { year: "numeric" }
2526
- })}, ${ae}`;
2548
+ ...nt ? {} : { year: "numeric" }
2549
+ })}, ${F}`;
2527
2550
  }
2528
- return h(Ke, "formatTimeDivider"), (w, k) => (T(), A("div", fr, [
2529
- L.value ? j("", !0) : (T(), A("div", gr, [
2530
- Fe(Qs, {
2531
- agent: a.agent,
2551
+ return h(gt, "formatTimeDivider"), (I, k) => (T(), A("div", Ei, [
2552
+ O.value ? q("", !0) : (T(), A("div", _i, [
2553
+ He(rr, {
2554
+ agent: i.agent,
2532
2555
  "is-online": f.value
2533
2556
  }, null, 8, ["agent", "is-online"])
2534
2557
  ])),
2535
- I.value ? (T(), A("div", {
2558
+ C.value ? (T(), A("div", {
2536
2559
  key: 1,
2537
- class: _(["py-16 flex flex-col items-center justify-center gap-3 text-sm", L.value ? "text-theme-400" : "text-white/60"])
2560
+ class: _(["py-16 flex flex-col items-center justify-center gap-3 text-sm", O.value ? "text-theme-400" : "text-white/60"])
2538
2561
  }, [
2539
2562
  S("i", {
2540
- class: _(["i-heroicons-cloud-arrow-down size-8", L.value ? "text-theme-300" : "text-white/40"])
2563
+ class: _(["i-heroicons-cloud-arrow-down size-8", O.value ? "text-theme-300" : "text-white/40"])
2541
2564
  }, null, 2),
2542
- S("span", null, pe(Q.value), 1)
2565
+ S("span", null, ce(ee.value), 1)
2543
2566
  ], 2)) : z.value ? (T(), A("div", {
2544
2567
  key: 2,
2545
- class: _(["py-16 flex flex-col items-center justify-center gap-2 text-sm", L.value ? "text-theme-400" : "text-theme-600"])
2568
+ class: _(["py-16 flex flex-col items-center justify-center gap-2 text-sm", O.value ? "text-theme-400" : "text-theme-600"])
2546
2569
  }, [
2547
- Fe(Pn, { class: "size-4" })
2548
- ], 2)) : a.setupHint ? (T(), A("div", {
2570
+ He(Hn, { class: "size-4" })
2571
+ ], 2)) : i.setupHint ? (T(), A("div", {
2549
2572
  key: 3,
2550
- class: _(["flex items-center justify-center gap-1.5 py-2 text-[11px]", ve.value])
2573
+ class: _(["flex items-center justify-center gap-1.5 py-2 text-[11px]", tt.value])
2551
2574
  }, [
2552
2575
  k[9] || (k[9] = S("i", { class: "i-tabler-tool size-3" }, null, -1)),
2553
- S("span", null, pe(a.setupHint), 1)
2554
- ], 2)) : j("", !0),
2555
- Fe(dr, {
2576
+ S("span", null, ce(i.setupHint), 1)
2577
+ ], 2)) : q("", !0),
2578
+ He(Ai, {
2556
2579
  ref_key: "chatScroller",
2557
2580
  ref: s,
2558
2581
  class: "flex-1"
2559
2582
  }, {
2560
- default: Os(() => [
2561
- S("div", mr, [
2562
- W.value.length === 0 && !z.value && !I.value ? (T(), A("div", xr, [
2563
- S("div", br, [
2583
+ default: Bs(() => [
2584
+ S("div", Ri, [
2585
+ te.value.length === 0 && !z.value && !C.value ? (T(), A("div", Ii, [
2586
+ S("div", Ci, [
2564
2587
  S("img", {
2565
- src: a.agent.avatarUrl.value,
2566
- alt: a.agent.displayName.value,
2567
- class: _(["size-full rounded-full object-cover ring-1", L.value ? "ring-black/5" : "ring-white/10"])
2568
- }, null, 10, kr),
2588
+ src: i.agent.avatarUrl.value,
2589
+ alt: i.agent.displayName.value,
2590
+ class: _(["size-full rounded-full object-cover ring-1", O.value ? "ring-black/5" : "ring-white/10"])
2591
+ }, null, 10, Di),
2569
2592
  f.value ? (T(), A("span", {
2570
2593
  key: 0,
2571
- class: _(["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", L.value ? "bg-white" : "bg-theme-900"])
2594
+ class: _(["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"])
2572
2595
  }, [...k[10] || (k[10] = [
2573
2596
  S("span", { class: "size-[70%] inline-flex rounded-full bg-emerald-500" }, null, -1)
2574
- ])], 2)) : j("", !0)
2597
+ ])], 2)) : q("", !0)
2575
2598
  ]),
2576
2599
  S("div", {
2577
- class: _(["text-base @sm/chat:text-lg font-semibold", L.value ? "text-theme-900" : "text-white"])
2578
- }, pe(a.agent.displayName.value), 3),
2600
+ class: _(["text-base @sm/chat:text-lg font-semibold", O.value ? "text-theme-900" : "text-white"])
2601
+ }, ce(i.agent.displayName.value), 3),
2579
2602
  S("p", {
2580
- class: _(["mt-1 text-center text-xs @sm/chat:text-sm", ve.value])
2581
- }, pe(a.emptyStateMessage || "Type your message to get started."), 3),
2603
+ class: _(["mt-1 text-center text-xs @sm/chat:text-sm", tt.value])
2604
+ }, ce(i.emptyStateMessage || "Type your message to get started."), 3),
2582
2605
  S("div", {
2583
- class: _(["inline-flex items-center gap-1.5 mt-5 px-2.5 py-1 rounded-full text-[11px]", L.value ? "bg-theme-50 border border-theme-100 text-theme-400" : "bg-white/10 border border-white/20 text-white/40"]),
2606
+ class: _(["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"]),
2584
2607
  title: e.value.tooltip
2585
2608
  }, [
2586
2609
  S("i", {
2587
2610
  class: _([e.value.icon, "size-3"])
2588
2611
  }, null, 2),
2589
- S("span", null, pe(e.value.label), 1)
2590
- ], 10, vr)
2591
- ])) : j("", !0),
2592
- (T(!0), A(Ce, null, vt(W.value, (g, P) => (T(), A(Ce, {
2593
- key: g.id
2612
+ S("span", null, ce(e.value.label), 1)
2613
+ ], 10, Mi)
2614
+ ])) : q("", !0),
2615
+ (T(!0), A(De, null, Rt(te.value, (y, E) => (T(), A(De, {
2616
+ key: y.id
2594
2617
  }, [
2595
- ut(W.value, P) ? (T(), A("div", wr, [
2618
+ ft(te.value, E) ? (T(), A("div", Oi, [
2596
2619
  S("div", {
2597
- class: _(["flex-1 h-px", q.value])
2620
+ class: _(["flex-1 h-px", pt.value])
2598
2621
  }, null, 2),
2599
2622
  S("span", {
2600
- class: _(["text-[10px] @sm/chat:text-[11px] font-medium shrink-0 tracking-widest uppercase", ve.value])
2601
- }, pe(ut(W.value, P)), 3),
2623
+ class: _(["text-[10px] @sm/chat:text-[11px] font-medium shrink-0 tracking-widest uppercase", tt.value])
2624
+ }, ce(ft(te.value, E)), 3),
2602
2625
  S("div", {
2603
- class: _(["flex-1 h-px", q.value])
2626
+ class: _(["flex-1 h-px", pt.value])
2604
2627
  }, null, 2)
2605
- ])) : j("", !0),
2606
- d(g) ? (T(), A("div", {
2628
+ ])) : q("", !0),
2629
+ d(y) ? (T(), A("div", {
2607
2630
  key: 1,
2608
2631
  "data-test": "messaging-system-msg",
2609
- "data-issue-code": g.issue?.code,
2610
- "data-issue-bucket": g.issue?.bucket,
2632
+ "data-issue-code": y.issue?.code,
2633
+ "data-issue-bucket": y.issue?.bucket,
2611
2634
  class: "flex gap-2 items-end justify-start mb-4"
2612
2635
  }, [
2613
- S("div", Tr, [
2636
+ S("div", Ni, [
2614
2637
  S("div", {
2615
- class: _(["mb-1 pl-1 text-[11px] font-medium", L.value ? "text-theme-500" : "text-white/45"])
2638
+ class: _(["mb-1 pl-1 text-[11px] font-medium", O.value ? "text-theme-500" : "text-white/45"])
2616
2639
  }, " System Message ", 2),
2617
2640
  S("div", {
2618
- class: _(["rounded-2xl rounded-bl-[4px] px-3.5 py-2 border system-msg-content", L.value ? "bg-theme-100 border-theme-200 text-theme-800" : "bg-white/[0.18] border-white/15 text-white/90"])
2641
+ class: _(["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"])
2619
2642
  }, [
2620
- g.text ? (T(), On(kt, {
2643
+ y.text ? (T(), Bn(_t, {
2621
2644
  key: 0,
2622
- text: g.text,
2623
- inverted: !L.value,
2624
- streaming: g.id === N.value,
2625
- onClick: k[0] || (k[0] = gt(() => {
2645
+ text: y.text,
2646
+ inverted: !O.value,
2647
+ streaming: y.id === re.value,
2648
+ onClick: k[0] || (k[0] = Tt(() => {
2626
2649
  }, ["stop"]))
2627
- }, null, 8, ["text", "inverted", "streaming"])) : g.issue?.help ? (T(), On(kt, {
2650
+ }, null, 8, ["text", "inverted", "streaming"])) : y.issue?.help ? (T(), Bn(_t, {
2628
2651
  key: 1,
2629
- text: g.issue.help,
2630
- inverted: !L.value
2631
- }, null, 8, ["text", "inverted"])) : j("", !0),
2632
- g.issue?.actionUrl && !v(g.text) ? (T(), A("a", {
2652
+ text: y.issue.help,
2653
+ inverted: !O.value
2654
+ }, null, 8, ["text", "inverted"])) : q("", !0),
2655
+ y.issue?.actionUrl && !x(y.text) ? (T(), A("a", {
2633
2656
  key: 2,
2634
- href: g.issue.actionUrl,
2657
+ href: y.issue.actionUrl,
2635
2658
  "data-test": "messaging-system-msg-action",
2636
- class: _(["mt-2 text-[12px] font-medium inline-flex items-center gap-1", L.value ? "text-theme-900 hover:text-theme-700" : "text-white hover:text-white/80"]),
2637
- onClick: k[1] || (k[1] = gt(() => {
2659
+ class: _(["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"]),
2660
+ onClick: k[1] || (k[1] = Tt(() => {
2638
2661
  }, ["stop"]))
2639
2662
  }, [
2640
- zn(pe(g.issue.actionLabel) + " ", 1),
2663
+ Un(ce(y.issue.actionLabel) + " ", 1),
2641
2664
  k[11] || (k[11] = S("i", { class: "i-tabler-arrow-right size-3" }, null, -1))
2642
- ], 10, Sr)) : j("", !0)
2665
+ ], 10, zi)) : q("", !0)
2643
2666
  ], 2)
2644
2667
  ])
2645
- ], 8, yr)) : g.sender === "system" ? (T(), A("div", {
2668
+ ], 8, Li)) : y.sender === "system" ? (T(), A("div", {
2646
2669
  key: 2,
2647
2670
  "data-test": "messaging-system-status-msg",
2648
- class: _(["flex items-start gap-2 px-3 py-2 text-[13px] leading-relaxed", L.value ? "text-theme-500" : "text-white/60"])
2671
+ class: _(["flex items-start gap-2 px-3 py-2 text-[13px] leading-relaxed", O.value ? "text-theme-500" : "text-white/60"])
2649
2672
  }, [
2650
2673
  k[12] || (k[12] = S("i", { class: "i-tabler-info-circle size-4 mt-0.5 shrink-0" }, null, -1)),
2651
- Fe(kt, {
2652
- text: g.text,
2653
- inverted: !L.value,
2654
- onClick: k[2] || (k[2] = gt(() => {
2674
+ He(_t, {
2675
+ text: y.text,
2676
+ inverted: !O.value,
2677
+ onClick: k[2] || (k[2] = Tt(() => {
2655
2678
  }, ["stop"]))
2656
2679
  }, null, 8, ["text", "inverted"])
2657
2680
  ], 2)) : (T(), A("div", {
2658
2681
  key: 3,
2659
- "data-test": g.sender === "agent" ? "messaging-assistant-msg" : g.sender === "user" ? "messaging-user-msg" : void 0,
2682
+ "data-test": y.sender === "agent" ? "messaging-assistant-msg" : y.sender === "user" ? "messaging-user-msg" : void 0,
2660
2683
  class: _(["flex gap-2 items-end", {
2661
- "justify-end": g.sender === "user",
2662
- "justify-start": g.sender === "agent",
2663
- "mb-4": x(W.value, P)
2684
+ "justify-end": y.sender === "user",
2685
+ "justify-start": y.sender === "agent",
2686
+ "mb-4": m(te.value, E)
2664
2687
  }])
2665
2688
  }, [
2666
- g.sender === "agent" ? (T(), A("div", Er, [
2667
- x(W.value, P) ? (T(), A("img", {
2689
+ y.sender === "agent" ? (T(), A("div", Pi, [
2690
+ m(te.value, E) ? (T(), A("img", {
2668
2691
  key: 0,
2669
- src: a.agent.avatarUrl.value,
2670
- alt: a.agent.displayName.value,
2671
- class: _(["size-6 @sm/chat:size-7 rounded-full object-cover shadow-sm", L.value ? "ring-1 ring-black/5" : ""])
2672
- }, null, 10, _r)) : j("", !0)
2673
- ])) : j("", !0),
2692
+ src: i.agent.avatarUrl.value,
2693
+ alt: i.agent.displayName.value,
2694
+ class: _(["size-6 @sm/chat:size-7 rounded-full object-cover shadow-sm", O.value ? "ring-1 ring-black/5" : ""])
2695
+ }, null, 10, Fi)) : q("", !0)
2696
+ ])) : q("", !0),
2674
2697
  S("div", {
2675
- class: _(g.sender === "user" ? "max-w-[75%]" : "max-w-[85%]")
2698
+ class: _(y.sender === "user" ? "max-w-[75%]" : "max-w-[85%]")
2676
2699
  }, [
2677
- g.attachments?.length ? (T(), A("div", {
2700
+ y.attachments?.length ? (T(), A("div", {
2678
2701
  key: 0,
2679
- class: _(["mb-1 space-y-1", g.sender === "user" ? "flex flex-col items-end" : ""])
2702
+ class: _(["mb-1 space-y-1", y.sender === "user" ? "flex flex-col items-end" : ""])
2680
2703
  }, [
2681
- (T(!0), A(Ce, null, vt(g.attachments, (C, ae) => (T(), A(Ce, { key: ae }, [
2682
- C.type === "image" ? (T(), A("img", {
2704
+ (T(!0), A(De, null, Rt(y.attachments, (Z, F) => (T(), A(De, { key: F }, [
2705
+ Z.type === "image" ? (T(), A("img", {
2683
2706
  key: 0,
2684
- src: C.src,
2685
- alt: C.filename,
2707
+ src: Z.src,
2708
+ alt: Z.filename,
2686
2709
  class: "rounded-xl object-cover max-h-48 max-w-[240px] @sm/chat:max-w-[320px]"
2687
- }, null, 8, Rr)) : C.type === "audio" ? (T(), A("audio", {
2710
+ }, null, 8, Bi)) : Z.type === "audio" ? (T(), A("audio", {
2688
2711
  key: 1,
2689
- src: C.src,
2712
+ src: Z.src,
2690
2713
  controls: "",
2691
2714
  class: "max-w-full"
2692
- }, null, 8, Ir)) : (T(), A("a", {
2715
+ }, null, 8, Ui)) : (T(), A("a", {
2693
2716
  key: 2,
2694
- href: C.src,
2717
+ href: Z.src,
2695
2718
  target: "_blank",
2696
2719
  rel: "noopener",
2697
- class: _(["inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", L.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
2720
+ class: _(["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"])
2698
2721
  }, [
2699
2722
  k[13] || (k[13] = S("i", { class: "i-tabler-file size-3.5" }, null, -1)),
2700
- zn(" " + pe(C.filename), 1)
2701
- ], 10, Cr))
2723
+ Un(" " + ce(Z.filename), 1)
2724
+ ], 10, Hi))
2702
2725
  ], 64))), 128))
2703
- ], 2)) : j("", !0),
2704
- g.text ? (T(), A("div", {
2726
+ ], 2)) : q("", !0),
2727
+ y.text ? (T(), A("div", {
2705
2728
  key: 1,
2706
2729
  class: _(["rounded-2xl px-3.5 py-2", [
2707
- g.sender === "user" ? "bg-primary-500 text-white rounded-br-[4px]" : L.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]"
2730
+ y.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]"
2708
2731
  ]])
2709
2732
  }, [
2710
- Fe(kt, {
2711
- text: g.text,
2712
- inverted: g.sender === "user" || !L.value,
2713
- streaming: g.id === N.value,
2714
- onClick: k[3] || (k[3] = gt(() => {
2733
+ He(_t, {
2734
+ text: y.text,
2735
+ inverted: y.sender === "user" || !O.value,
2736
+ streaming: y.id === re.value,
2737
+ onClick: k[3] || (k[3] = Tt(() => {
2715
2738
  }, ["stop"]))
2716
2739
  }, null, 8, ["text", "inverted", "streaming"])
2717
- ], 2)) : j("", !0)
2740
+ ], 2)) : q("", !0)
2718
2741
  ], 2)
2719
- ], 10, Ar))
2742
+ ], 10, $i))
2720
2743
  ], 64))), 128)),
2721
- ie.value ? (T(), A("div", Dr, [
2744
+ ge.value ? (T(), A("div", ji, [
2722
2745
  S("img", {
2723
- src: a.agent.avatarUrl.value,
2724
- alt: a.agent.displayName.value,
2725
- class: _(["size-7 @sm/chat:size-8 flex-shrink-0 rounded-full object-cover shadow-sm", L.value ? "ring-1 ring-black/5" : ""])
2726
- }, null, 10, Mr),
2746
+ src: i.agent.avatarUrl.value,
2747
+ alt: i.agent.displayName.value,
2748
+ class: _(["size-7 @sm/chat:size-8 flex-shrink-0 rounded-full object-cover shadow-sm", O.value ? "ring-1 ring-black/5" : ""])
2749
+ }, null, 10, Gi),
2727
2750
  S("div", {
2728
- class: _(["rounded-2xl px-3.5 py-2.5 flex items-center", L.value ? "bg-theme-100" : "bg-white/15 backdrop-blur-sm"])
2751
+ class: _(["rounded-2xl px-3.5 py-2.5 flex items-center", O.value ? "bg-theme-100" : "bg-white/15 backdrop-blur-sm"])
2729
2752
  }, [
2730
2753
  S("i", {
2731
- class: _(["i-svg-spinners-3-dots-bounce size-7", L.value ? "text-theme-400" : "text-white/50"])
2754
+ class: _(["i-svg-spinners-3-dots-bounce size-7", O.value ? "text-theme-400" : "text-white/50"])
2732
2755
  }, null, 2)
2733
2756
  ], 2)
2734
- ])) : j("", !0)
2757
+ ])) : q("", !0)
2735
2758
  ])
2736
2759
  ]),
2737
2760
  _: 1
2738
2761
  }, 512),
2739
2762
  S("div", {
2740
- class: _(["absolute bottom-0 left-0 right-0 z-30 px-5 pb-4 pt-3", L.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"])
2763
+ class: _(["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"])
2741
2764
  }, [
2742
- p.value.length > 0 ? (T(), A("div", Lr, [
2743
- (T(!0), A(Ce, null, vt(p.value, (g, P) => (T(), A("div", {
2744
- key: P,
2765
+ p.value.length > 0 ? (T(), A("div", Wi, [
2766
+ (T(!0), A(De, null, Rt(p.value, (y, E) => (T(), A("div", {
2767
+ key: E,
2745
2768
  class: "relative shrink-0 group"
2746
2769
  }, [
2747
- g.type === "image" ? (T(), A("img", {
2770
+ y.type === "image" ? (T(), A("img", {
2748
2771
  key: 0,
2749
- src: g.src,
2750
- alt: g.filename,
2751
- class: _(["size-14 rounded-xl object-cover border", L.value ? "border-black/10" : "border-white/20"])
2752
- }, null, 10, Or)) : (T(), A("div", {
2772
+ src: y.src,
2773
+ alt: y.filename,
2774
+ class: _(["size-14 rounded-xl object-cover border", O.value ? "border-black/10" : "border-white/20"])
2775
+ }, null, 10, qi)) : (T(), A("div", {
2753
2776
  key: 1,
2754
- class: _(["h-14 px-3 rounded-xl flex items-center gap-1.5 text-xs border", L.value ? "border-black/10 bg-theme-50 text-theme-600" : "border-white/20 bg-white/10 text-white/70"])
2777
+ class: _(["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"])
2755
2778
  }, [
2756
2779
  k[14] || (k[14] = S("i", { class: "i-tabler-file size-4" }, null, -1)),
2757
- S("span", zr, pe(g.filename), 1)
2780
+ S("span", Vi, ce(y.filename), 1)
2758
2781
  ], 2)),
2759
2782
  S("button", {
2760
2783
  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",
2761
- onClick: /* @__PURE__ */ h((C) => ct(P), "onClick")
2784
+ onClick: /* @__PURE__ */ h((Z) => zt(E), "onClick")
2762
2785
  }, [...k[15] || (k[15] = [
2763
2786
  S("i", { class: "i-tabler-x size-3" }, null, -1)
2764
- ])], 8, Pr)
2787
+ ])], 8, Yi)
2765
2788
  ]))), 128)),
2766
- c.value ? (T(), A("div", Nr, [
2767
- Fe(Pn, { class: "size-5" })
2768
- ])) : j("", !0)
2769
- ])) : j("", !0),
2770
- a.uploadFn ? (T(), A("input", {
2789
+ c.value ? (T(), A("div", Zi, [
2790
+ He(Hn, { class: "size-5" })
2791
+ ])) : q("", !0)
2792
+ ])) : q("", !0),
2793
+ i.uploadFn ? (T(), A("input", {
2771
2794
  key: 1,
2772
2795
  ref_key: "fileInput",
2773
2796
  ref: o,
2774
2797
  type: "file",
2775
2798
  accept: "image/*,audio/*,video/*",
2776
2799
  class: "hidden",
2777
- onChange: Ct
2778
- }, null, 544)) : j("", !0),
2800
+ onChange: $e
2801
+ }, null, 544)) : q("", !0),
2779
2802
  S("div", {
2780
- class: _(["flex items-end gap-1 w-full rounded-[24px] p-1.5 transition-colors duration-200", L.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"])
2803
+ class: _(["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"])
2781
2804
  }, [
2782
2805
  S("button", {
2783
2806
  class: _(["shrink-0 flex items-center justify-center rounded-full transition-colors mb-0.5 ml-0.5 size-9 @sm/chat:size-10", [
2784
- a.uploadFn ? "cursor-pointer" : "cursor-default",
2785
- L.value ? "text-theme-400 hover:text-theme-600 hover:bg-black/5" : "text-white/50 hover:text-white/80 hover:bg-white/10",
2807
+ i.uploadFn ? "cursor-pointer" : "cursor-default",
2808
+ O.value ? "text-theme-400 hover:text-theme-600 hover:bg-black/5" : "text-white/50 hover:text-white/80 hover:bg-white/10",
2786
2809
  c.value ? "opacity-50 pointer-events-none" : ""
2787
2810
  ]]),
2788
- disabled: re.value || c.value || !a.uploadFn,
2789
- onClick: k[4] || (k[4] = (g) => a.uploadFn && It())
2811
+ disabled: Q.value || c.value || !i.uploadFn,
2812
+ onClick: k[4] || (k[4] = (y) => i.uploadFn && ze())
2790
2813
  }, [
2791
- c.value ? (T(), A("i", Br)) : (T(), A("i", Ur))
2792
- ], 10, $r),
2793
- rs(S("textarea", {
2814
+ c.value ? (T(), A("i", Ki)) : (T(), A("i", Qi))
2815
+ ], 10, Xi),
2816
+ ps(S("textarea", {
2794
2817
  ref_key: "textarea",
2795
2818
  ref: l,
2796
- "onUpdate:modelValue": k[5] || (k[5] = (g) => n.value = g),
2819
+ "onUpdate:modelValue": k[5] || (k[5] = (y) => n.value = y),
2797
2820
  "data-test": "messaging-input",
2798
2821
  rows: "1",
2799
2822
  enterkeyhint: "send",
2800
- placeholder: Oe.value,
2801
- disabled: re.value,
2823
+ placeholder: me.value,
2824
+ disabled: Q.value,
2802
2825
  style: { fontSize: "16px", resize: "none" },
2803
- class: _(["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", L.value ? "text-theme-800 placeholder-theme-400" : "text-white placeholder-white/50"]),
2804
- onKeydown: Pe,
2805
- onFocus: k[6] || (k[6] = (g) => i.value = !0),
2806
- onBlur: k[7] || (k[7] = (g) => i.value = !1)
2807
- }, null, 42, Fr), [
2808
- [as, n.value]
2826
+ class: _(["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"]),
2827
+ onKeydown: Y,
2828
+ onFocus: k[6] || (k[6] = (y) => r.value = !0),
2829
+ onBlur: k[7] || (k[7] = (y) => r.value = !1)
2830
+ }, null, 42, Ji), [
2831
+ [ds, n.value]
2809
2832
  ]),
2810
2833
  S("button", {
2811
2834
  "data-test": "messaging-send-btn",
2812
- class: _(["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", ze.value ? "bg-primary-500 text-white hover:scale-105 active:scale-95 cursor-pointer" : L.value ? "bg-black/5 text-black/20" : "bg-white/10 text-white/30"]),
2813
- disabled: !ze.value,
2814
- onClick: k[8] || (k[8] = (g) => Ae())
2835
+ class: _(["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", ye.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"]),
2836
+ disabled: !ye.value,
2837
+ onClick: k[8] || (k[8] = (y) => dt())
2815
2838
  }, [...k[16] || (k[16] = [
2816
2839
  S("i", { class: "i-tabler-arrow-up size-5" }, null, -1)
2817
- ])], 10, Hr)
2840
+ ])], 10, ea)
2818
2841
  ], 2)
2819
2842
  ], 2)
2820
2843
  ]));
2821
2844
  }
2822
- }), Gr = { class: "agent-wrap" }, jr = {
2845
+ }), ta = { class: "agent-wrap" }, na = {
2823
2846
  key: 0,
2824
2847
  class: "flex items-center justify-center h-full"
2825
- }, ta = /* @__PURE__ */ ke({
2848
+ }, da = /* @__PURE__ */ ke({
2826
2849
  __name: "AgentWrap",
2827
2850
  props: {
2828
2851
  sdk: {},
@@ -2835,17 +2858,17 @@ const hr = ["innerHTML"], kt = /* @__PURE__ */ ke({
2835
2858
  hasClose: { type: Boolean },
2836
2859
  apiBase: {}
2837
2860
  },
2838
- setup(a) {
2839
- const t = Ps("AgentWrap"), e = a, n = e.sdk || Ns.getInstance({
2861
+ setup(i) {
2862
+ const t = Hs("AgentWrap"), e = i, n = e.sdk || js.getInstance({
2840
2863
  isDev: typeof window < "u" ? window.location.hostname === "localhost" || window.location.hostname.includes("127.0.0.1") : !1,
2841
2864
  ...e.apiBase && { apiBase: e.apiBase }
2842
- }), i = Z(!e.agent), s = ls(e.agent ? new wt({ config: e.agent }) : void 0), l = Z();
2843
- return At(async () => {
2865
+ }), r = K(!e.agent), s = fs(e.agent ? new It({ config: e.agent }) : void 0), l = K();
2866
+ return Ot(async () => {
2844
2867
  if (e.agent) {
2845
2868
  t.debug("Agent provided via props, skipping fetch", {
2846
2869
  agentId: e.agent.agentId,
2847
2870
  handle: e.agent.handle
2848
- }), i.value = !1;
2871
+ }), r.value = !1;
2849
2872
  return;
2850
2873
  }
2851
2874
  if (!e.handle) {
@@ -2860,13 +2883,13 @@ const hr = ["innerHTML"], kt = /* @__PURE__ */ ke({
2860
2883
  isDev: n.isDev,
2861
2884
  apiBase: n.apiBase
2862
2885
  }
2863
- }), i.value = !1;
2886
+ }), r.value = !1;
2864
2887
  return;
2865
2888
  }
2866
2889
  try {
2867
- i.value = !0, t.debug("Fetching public agent", { handle: e.handle });
2890
+ r.value = !0, t.debug("Fetching public agent", { handle: e.handle });
2868
2891
  const o = await n.user.getPublicAgent({ handle: e.handle });
2869
- o ? (s.value = new wt({ config: o }), t.debug("Successfully fetched public agent", {
2892
+ o ? (s.value = new It({ config: o }), t.debug("Successfully fetched public agent", {
2870
2893
  agentId: o.agentId,
2871
2894
  handle: o.handle
2872
2895
  }), o.agentId && n.user.track({
@@ -2898,9 +2921,9 @@ const hr = ["innerHTML"], kt = /* @__PURE__ */ ke({
2898
2921
  }
2899
2922
  });
2900
2923
  } finally {
2901
- i.value = !1, s.value || t.debug("AgentWrap component will render empty (silent failure)", {
2924
+ r.value = !1, s.value || t.debug("AgentWrap component will render empty (silent failure)", {
2902
2925
  state: {
2903
- loading: i.value,
2926
+ loading: r.value,
2904
2927
  hasAgent: !!s.value,
2905
2928
  error: l.value
2906
2929
  },
@@ -2916,33 +2939,33 @@ const hr = ["innerHTML"], kt = /* @__PURE__ */ ke({
2916
2939
  }
2917
2940
  });
2918
2941
  }
2919
- }), (o, p) => (T(), A("div", Gr, [
2920
- i.value ? (T(), A("div", jr, [...p[0] || (p[0] = [
2942
+ }), (o, p) => (T(), A("div", ta, [
2943
+ r.value ? (T(), A("div", na, [...p[0] || (p[0] = [
2921
2944
  S("div", { class: "animate-spin rounded-full size-6 border-b-2 border-white" }, null, -1)
2922
- ])])) : s.value ? en(o.$slots, "default", {
2945
+ ])])) : s.value ? ln(o.$slots, "default", {
2923
2946
  key: 1,
2924
- sdk: Xt(n),
2947
+ sdk: nn(n),
2925
2948
  agent: s.value,
2926
- context: a.context,
2927
- firstMessage: a.firstMessage,
2928
- buttonText: a.buttonText,
2929
- buttonIcon: a.buttonIcon,
2930
- loading: i.value
2931
- }) : j("", !0)
2949
+ context: i.context,
2950
+ firstMessage: i.firstMessage,
2951
+ buttonText: i.buttonText,
2952
+ buttonIcon: i.buttonIcon,
2953
+ loading: r.value
2954
+ }) : q("", !0)
2932
2955
  ]));
2933
2956
  }
2934
2957
  });
2935
2958
  export {
2936
- Nn as A,
2937
- ta as _,
2938
- ea as a,
2939
- Qr as b,
2940
- Kr as c,
2941
- Jr as d,
2942
- Pn as e,
2943
- Qs as f,
2944
- Zr as g,
2945
- Bn as h,
2946
- Xr as p
2959
+ jn as A,
2960
+ da as _,
2961
+ pa as a,
2962
+ ua as b,
2963
+ ca as c,
2964
+ ha as d,
2965
+ Hn as e,
2966
+ rr as f,
2967
+ la as g,
2968
+ Wn as h,
2969
+ oa as p
2947
2970
  };
2948
2971
  //# sourceMappingURL=AgentWrap.vue_vue_type_script_setup_true_lang.js.map