@pagelines/sdk 1.0.472 → 1.0.474

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