@pagelines/sdk 1.0.709 → 1.0.711

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/AgentWrap.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import "./rolldown-runtime.js";
2
2
  import { s as e, t } from "./sdkClient.js";
3
- import { Agent as n, CHAT_ISSUE_COPY as r, SettingsObject as i, createLogger as a, getDefaultAvatarUrl as o, isAssistantSilenceControl as s, parseChatVisualFencePayload as c } from "@pagelines/core";
4
- import { Fragment as u, computed as f, createBlock as p, createCommentVNode as m, createElementBlock as h, createElementVNode as _, createTextVNode as v, createVNode as b, defineComponent as x, nextTick as S, normalizeClass as C, normalizeStyle as T, onBeforeUnmount as te, onMounted as ne, onUnmounted as re, openBlock as k, ref as A, renderList as j, renderSlot as ie, resolveDynamicComponent as ae, shallowRef as P, toDisplayString as F, unref as oe, vModelText as I, watch as se, withCtx as ce, withDirectives as R, withKeys as ue, withModifiers as z } from "vue";
3
+ import { Agent as n, CHAT_ISSUE_COPY as r, SettingsObject as i, createLogger as a, getDefaultAvatarUrl as o, isAssistantSilenceControl as s, parseChatCardFencePayload as c, parseChatVisualFencePayload as u } from "@pagelines/core";
4
+ import { Fragment as f, computed as p, createBlock as m, createCommentVNode as h, createElementBlock as _, createElementVNode as v, createTextVNode as te, createVNode as b, defineComponent as x, nextTick as ne, normalizeClass as S, normalizeStyle as C, onBeforeUnmount as re, onMounted as ie, onUnmounted as ae, openBlock as T, ref as k, renderList as A, renderSlot as oe, resolveDynamicComponent as j, shallowRef as se, toDisplayString as P, unref as ce, vModelText as ue, watch as de, withCtx as F, withDirectives as pe, withKeys as he, withModifiers as I } from "vue";
5
5
  //#region ui/FSpinner.vue?vue&type=script&setup=true&lang.ts
6
- var de = { class: "spinner max-w-sm" }, B = {
6
+ var R = { class: "spinner max-w-sm" }, z = {
7
7
  class: "ring-circular h-full w-full origin-center",
8
8
  viewBox: "25 25 50 50"
9
- }, pe = /* @__PURE__ */ x({
9
+ }, _e = /* @__PURE__ */ x({
10
10
  __name: "FSpinner",
11
11
  props: {
12
12
  width: {
@@ -19,8 +19,8 @@ var de = { class: "spinner max-w-sm" }, B = {
19
19
  }
20
20
  },
21
21
  setup(e) {
22
- return (t, n) => (k(), h("div", de, [(k(), h("svg", B, [_("circle", {
23
- class: C([e.colorMode, "ring-path"]),
22
+ return (t, n) => (T(), _("div", R, [(T(), _("svg", z, [v("circle", {
23
+ class: S([e.colorMode, "ring-path"]),
24
24
  cx: "50",
25
25
  cy: "50",
26
26
  r: "20",
@@ -30,7 +30,7 @@ var de = { class: "spinner max-w-sm" }, B = {
30
30
  "stroke-miterlimit": "30"
31
31
  }, null, 2)]))]));
32
32
  }
33
- }), he = [
33
+ }), ve = [
34
34
  {
35
35
  mode: "self",
36
36
  label: "Overview",
@@ -70,10 +70,10 @@ function recorderMimeType() {
70
70
  }
71
71
  var VoiceRecorderController = class extends i {
72
72
  constructor(t) {
73
- super("VoiceRecorderController", t), e(this, "state", A({
73
+ super("VoiceRecorderController", t), e(this, "state", k({
74
74
  phase: "idle",
75
75
  elapsedMs: 0
76
- })), e(this, "isActive", f(() => this.state.value.phase !== "idle")), e(this, "isBusy", f(() => this.state.value.phase !== "idle")), e(this, "elapsedLabel", f(() => formatVoiceRecordingDuration({ ms: this.state.value.elapsedMs }))), e(this, "statusText", f(() => this.state.value.phase === "preparing" ? "Starting microphone" : this.state.value.phase === "sending" ? "Sending voice message" : "Release to send")), e(this, "recorder", void 0), e(this, "stream", void 0), e(this, "chunks", []), e(this, "timer", void 0), e(this, "startedAt", 0), e(this, "cancelOnStop", !1), e(this, "stopAfterStart", !1), e(this, "startToken", 0);
76
+ })), e(this, "isActive", p(() => this.state.value.phase !== "idle")), e(this, "isBusy", p(() => this.state.value.phase !== "idle")), e(this, "elapsedLabel", p(() => formatVoiceRecordingDuration({ ms: this.state.value.elapsedMs }))), e(this, "statusText", p(() => this.state.value.phase === "preparing" ? "Starting microphone" : this.state.value.phase === "sending" ? "Sending voice message" : "Release to send")), e(this, "recorder", void 0), e(this, "stream", void 0), e(this, "chunks", []), e(this, "timer", void 0), e(this, "startedAt", 0), e(this, "cancelOnStop", !1), e(this, "stopAfterStart", !1), e(this, "startToken", 0);
77
77
  }
78
78
  get canUseBrowserRecording() {
79
79
  return !!this.settings.getUserMedia || typeof navigator < "u" && !!navigator.mediaDevices?.getUserMedia && typeof MediaRecorder < "u";
@@ -185,7 +185,7 @@ var VoiceRecorderController = class extends i {
185
185
  function durableJournalOutcome(e) {
186
186
  return e.turnOutcome === "failed" ? "failed" : e.turnOutcome === "stopped" ? "stopped" : e.sender === "system" ? "failed" : "completed";
187
187
  }
188
- var _e = {
188
+ var B = {
189
189
  waiting: "Waiting for results",
190
190
  finishing: "Finishing up",
191
191
  completed: "Work complete",
@@ -193,7 +193,7 @@ var _e = {
193
193
  stopped: "Stopped",
194
194
  notifyHint: "Taking longer than usual. You can leave and I’ll notify you when it’s ready.",
195
195
  leaveHint: "Taking longer than usual. You can leave this chat while I work."
196
- }, ve = 15e3, ye = 6e4, H = 3;
196
+ }, ye = 15e3, H = 6e4, be = 3;
197
197
  function toMs(e) {
198
198
  if (!e) return;
199
199
  let t = Date.parse(e);
@@ -209,7 +209,7 @@ function milestoneRows(e, t) {
209
209
  let n = e.filter((e) => e.status === "completed" || e.status === "failed" && !!e.note).filter((e) => !t.has(e.activityId)).slice().sort(byEvent), r = [];
210
210
  for (let e of n) {
211
211
  let t = e.status === "completed" ? "done" : "failed", n = r[r.length - 1];
212
- if (t === "done" && n?.tone === "done" && n.label === e.label && eventMs(e) - n.lastMs <= ve) {
212
+ if (t === "done" && n?.tone === "done" && n.label === e.label && eventMs(e) - n.lastMs <= ye) {
213
213
  n.count += 1, n.lastMs = eventMs(e);
214
214
  continue;
215
215
  }
@@ -230,12 +230,12 @@ function milestoneRows(e, t) {
230
230
  }));
231
231
  }
232
232
  function splitRows(e) {
233
- return e.length <= H ? {
233
+ return e.length <= be ? {
234
234
  visibleRows: e,
235
235
  hiddenRows: []
236
236
  } : {
237
- visibleRows: e.slice(e.length - H),
238
- hiddenRows: e.slice(0, e.length - H)
237
+ visibleRows: e.slice(e.length - be),
238
+ hiddenRows: e.slice(0, e.length - be)
239
239
  };
240
240
  }
241
241
  function buildWorkJournalModel(e) {
@@ -247,7 +247,7 @@ function buildWorkJournalModel(e) {
247
247
  terminal: {
248
248
  id: "work-complete",
249
249
  tone: "completed",
250
- label: _e.completed
250
+ label: B.completed
251
251
  }
252
252
  };
253
253
  if (n === "failed") {
@@ -261,7 +261,7 @@ function buildWorkJournalModel(e) {
261
261
  terminal: {
262
262
  id: "work-failed",
263
263
  tone: "failed",
264
- label: _e.failed,
264
+ label: B.failed,
265
265
  ...o && e?.note ? { note: e.note } : {}
266
266
  }
267
267
  };
@@ -275,25 +275,25 @@ function buildWorkJournalModel(e) {
275
275
  terminal: {
276
276
  id: "work-stopped",
277
277
  tone: "stopped",
278
- label: _e.stopped
278
+ label: B.stopped
279
279
  }
280
280
  };
281
281
  }
282
282
  let { visibleRows: s, hiddenRows: c } = splitRows(milestoneRows(t, /* @__PURE__ */ new Set())), u = t.filter((e) => e.status === "started").sort(byEvent).pop(), f = t.reduce((e, t) => Math.max(e, eventMs(t)), a ?? -Infinity), p = Number.isFinite(f) ? f : r, m = t.reduce((e, t) => {
283
283
  let n = toMs(t.startedAt) ?? toMs(t.endedAt);
284
284
  return n === void 0 ? e : Math.min(e, n);
285
- }, Infinity), h = p + ve, _ = (Number.isFinite(m) ? m : p) + ye, v = r >= h, b = u || v ? {
285
+ }, Infinity), h = p + ye, _ = (Number.isFinite(m) ? m : p) + H, v = r >= h, te = u || v ? {
286
286
  id: u?.activityId ?? "work-active",
287
287
  tone: "active",
288
- label: v ? u ? _e.waiting : _e.finishing : u.label
289
- } : void 0, x = v && r >= _ ? i ? _e.notifyHint : _e.leaveHint : void 0, S = [h, _].filter((e) => e > r).sort((e, t) => e - t)[0];
288
+ label: v ? u ? B.waiting : B.finishing : u.label
289
+ } : void 0, b = v && r >= _ ? i ? B.notifyHint : B.leaveHint : void 0, x = [h, _].filter((e) => e > r).sort((e, t) => e - t)[0];
290
290
  return {
291
291
  outcome: n,
292
292
  visibleRows: s,
293
293
  hiddenRows: c,
294
- ...b ? { terminal: b } : {},
295
- ...x ? { hint: x } : {},
296
- ...S === void 0 ? {} : { nextBoundaryAtMs: S }
294
+ ...te ? { terminal: te } : {},
295
+ ...b ? { hint: b } : {},
296
+ ...x === void 0 ? {} : { nextBoundaryAtMs: x }
297
297
  };
298
298
  }
299
299
  function buildLiveTurnBlocks(e) {
@@ -352,17 +352,17 @@ function buildLiveTurnBlocks(e) {
352
352
  }
353
353
  //#endregion
354
354
  //#region agent/AgentController.ts
355
- var be = /* @__PURE__ */ new Set(["CREDIT_LIMIT", "OVERAGE_CAP"]), U = /* @__PURE__ */ new Set([
356
- ...be,
355
+ var U = /* @__PURE__ */ new Set(["CREDIT_LIMIT", "OVERAGE_CAP"]), Se = /* @__PURE__ */ new Set([
356
+ ...U,
357
357
  "EMPTY_STREAM",
358
358
  "RATE_LIMIT"
359
- ]), Se = /* @__PURE__ */ new Set(["agent_deleted", "AGENT_DELETED"]), W = {
359
+ ]), W = /* @__PURE__ */ new Set(["agent_deleted", "AGENT_DELETED"]), Ce = {
360
360
  CREDIT_LIMIT: "billing_budget_reached",
361
361
  OVERAGE_CAP: "billing_runaway_cap"
362
362
  };
363
363
  function presentChatStreamError(e) {
364
- if (!(e.bucket !== void 0 || U.has(e.code))) return { surface: "hard" };
365
- let t = e.bucket ?? (be.has(e.code) ? "account" : "error"), n = {
364
+ if (!(e.bucket !== void 0 || Se.has(e.code))) return { surface: "hard" };
365
+ let t = e.bucket ?? (U.has(e.code) ? "account" : "error"), n = {
366
366
  ...e.actionLabel ? { actionLabel: e.actionLabel } : {},
367
367
  ...e.actionUrl ? { actionUrl: e.actionUrl } : {},
368
368
  ...e.help ? { help: e.help } : {}
@@ -375,7 +375,7 @@ function presentChatStreamError(e) {
375
375
  ...n
376
376
  },
377
377
  sendBlockedReason: "account"
378
- } : Se.has(e.code) ? {
378
+ } : W.has(e.code) ? {
379
379
  surface: "transcript",
380
380
  issue: {
381
381
  code: e.code,
@@ -393,7 +393,7 @@ function presentChatStreamError(e) {
393
393
  };
394
394
  }
395
395
  function transcriptMessageForChatStreamError(e) {
396
- let t = W[e.code];
396
+ let t = Ce[e.code];
397
397
  return t ? r[t].oneLine : e.error;
398
398
  }
399
399
  var AgentChatController = class extends i {
@@ -401,16 +401,16 @@ var AgentChatController = class extends i {
401
401
  super("AgentChatController", t), e(this, "isTextMode", !1), e(this, "lastMessage", {
402
402
  hash: "",
403
403
  time: 0
404
- }), e(this, "isConnecting", !1), e(this, "activeTurnGeneration", 0), e(this, "boundaryTimer", void 0), e(this, "nowMs", P(Date.now())), e(this, "toolActivityTiming", P({})), e(this, "lastVisibleProgressAtMs", P()), e(this, "liveSegments", P([])), e(this, "liveStreamMessageId", P(void 0)), e(this, "conversationId", void 0), e(this, "textState", A({
404
+ }), e(this, "isConnecting", !1), e(this, "activeTurnGeneration", 0), e(this, "boundaryTimer", void 0), e(this, "nowMs", se(Date.now())), e(this, "toolActivityTiming", se({})), e(this, "lastVisibleProgressAtMs", se()), e(this, "liveSegments", se([])), e(this, "liveStreamMessageId", se(void 0)), e(this, "conversationId", void 0), e(this, "textState", k({
405
405
  isActive: !1,
406
406
  isConnected: !1,
407
407
  isThinking: !1,
408
408
  connectionStatus: "disconnected"
409
- })), e(this, "agentMode", A("self")), e(this, "sharedMessages", A([])), e(this, "composerState", A({
409
+ })), e(this, "agentMode", k("self")), e(this, "sharedMessages", k([])), e(this, "composerState", k({
410
410
  text: "",
411
411
  pendingAttachments: [],
412
412
  isUploading: !1
413
- })), e(this, "workJournal", f(() => {
413
+ })), e(this, "workJournal", p(() => {
414
414
  let e = this.textState.value.isThinking ? "running" : this.textState.value.turnOutcome;
415
415
  if (!e) return;
416
416
  let t = this.textState.value.toolActivities;
@@ -421,7 +421,7 @@ var AgentChatController = class extends i {
421
421
  canNotifyOnCompletion: !1,
422
422
  lastVisibleProgressAtMs: this.lastVisibleProgressAtMs.value
423
423
  });
424
- })), e(this, "liveTurnBlocks", f(() => {
424
+ })), e(this, "liveTurnBlocks", p(() => {
425
425
  if (!this.textState.value.isThinking) return [];
426
426
  let e = this.textState.value.toolActivities ?? [], t = this.liveSegments.value;
427
427
  return !t.length && !e.length ? [] : buildLiveTurnBlocks({
@@ -431,14 +431,14 @@ var AgentChatController = class extends i {
431
431
  canNotifyOnCompletion: !1,
432
432
  lastVisibleProgressAtMs: this.lastVisibleProgressAtMs.value
433
433
  });
434
- })), e(this, "canUseComposer", f(() => this.textState.value.sendBlockedReason !== "agent_deleted" && !this.composerState.value.isUploading && !this.textState.value.isThinking)), e(this, "canAttachFile", f(() => !!this.settings.uploadFileFn)), e(this, "canRecordAudio", f(() => this.canAttachFile.value && this.canUseComposer.value && !this.composerState.value.text.trim() && this.composerState.value.pendingAttachments.length === 0)), e(this, "voiceRecorder", new VoiceRecorderController({
434
+ })), e(this, "canUseComposer", p(() => this.textState.value.sendBlockedReason !== "agent_deleted" && !this.composerState.value.isUploading && !this.textState.value.isThinking)), e(this, "canAttachFile", p(() => !!this.settings.uploadFileFn)), e(this, "canRecordAudio", p(() => this.canAttachFile.value && this.canUseComposer.value && !this.composerState.value.text.trim() && this.composerState.value.pendingAttachments.length === 0)), e(this, "voiceRecorder", new VoiceRecorderController({
435
435
  getCanRecord: () => this.canRecordAudio.value,
436
436
  getUploadFn: () => {
437
437
  let e = this.settings.uploadFileFn;
438
438
  return e ? (t) => e({ file: t }) : void 0;
439
439
  },
440
440
  getChatController: () => this
441
- })), e(this, "canSend", f(() => (this.composerState.value.text.trim().length > 0 || this.composerState.value.pendingAttachments.length > 0) && this.canUseComposer.value && !this.voiceRecorder.isBusy.value)), e(this, "canStop", f(() => this.textState.value.isThinking && !this.composerState.value.isUploading && !this.voiceRecorder.isBusy.value)), e(this, "composerAction", f(() => this.canStop.value ? "stop" : this.canSend.value ? "send" : "idle")), e(this, "_agent", void 0), this._agent = t.agent instanceof n ? t.agent : new n({ config: t.agent }), this.setupModeWatcher(), this.setupAvailabilityWatcher(), this.setupBoundaryWatcher();
441
+ })), e(this, "canSend", p(() => (this.composerState.value.text.trim().length > 0 || this.composerState.value.pendingAttachments.length > 0) && this.canUseComposer.value && !this.voiceRecorder.isBusy.value)), e(this, "canStop", p(() => this.textState.value.isThinking && !this.composerState.value.isUploading && !this.voiceRecorder.isBusy.value)), e(this, "composerAction", p(() => this.canStop.value ? "stop" : this.canSend.value ? "send" : "idle")), e(this, "_agent", void 0), this._agent = t.agent instanceof n ? t.agent : new n({ config: t.agent }), this.setupModeWatcher(), this.setupAvailabilityWatcher(), this.setupBoundaryWatcher();
442
442
  }
443
443
  get chatEnabled() {
444
444
  let e = this._agent.state.value.lifecycle;
@@ -577,7 +577,7 @@ Current User:
577
577
  });
578
578
  }
579
579
  setupBoundaryWatcher() {
580
- se(() => this.workJournal.value?.nextBoundaryAtMs, (e) => {
580
+ de(() => this.workJournal.value?.nextBoundaryAtMs, (e) => {
581
581
  this.scheduleBoundary(e);
582
582
  });
583
583
  }
@@ -639,12 +639,12 @@ Current User:
639
639
  });
640
640
  }
641
641
  setupModeWatcher() {
642
- se(this.agentMode, async (e, t) => {
642
+ de(this.agentMode, async (e, t) => {
643
643
  this.logger.info(`Mode changed from ${t} to ${e}`), this.isTextMode && (t === "talk" || t === "chat") && await this.endConversation();
644
644
  });
645
645
  }
646
646
  setupAvailabilityWatcher() {
647
- se(() => this.chatEnabled, (e) => {
647
+ de(() => this.chatEnabled, (e) => {
648
648
  if (!(!this.isTextMode || this.isConnecting)) {
649
649
  if (e) {
650
650
  this.textState.value.isConnected || this.updateState(this.textState, {
@@ -779,7 +779,7 @@ Current User:
779
779
  let e = i[i.length - 1];
780
780
  this.sharedMessages.value = e?.id === a ? [...i.slice(0, -1), r] : [...i, r];
781
781
  }
782
- r.sender === "system" && r.issue?.bucket === "account" ? this.updateState(this.textState, { sendBlockedReason: "account" }) : r.sender === "system" && r.issue?.code && Se.has(r.issue.code) && this.updateState(this.textState, { sendBlockedReason: "agent_deleted" });
782
+ r.sender === "system" && r.issue?.bucket === "account" ? this.updateState(this.textState, { sendBlockedReason: "account" }) : r.sender === "system" && r.issue?.code && W.has(r.issue.code) && this.updateState(this.textState, { sendBlockedReason: "agent_deleted" });
783
783
  }, onDone = (e) => {
784
784
  if (!isCurrentTurn()) return;
785
785
  if (!o && !c) {
@@ -949,10 +949,10 @@ function parseButtonTemplate(e) {
949
949
  }
950
950
  //#endregion
951
951
  //#region agent/ui/ElAgentButton.vue?vue&type=script&setup=true&lang.ts
952
- var Ce = {
952
+ var we = {
953
953
  key: 0,
954
954
  class: "absolute inset-0 flex items-center justify-center"
955
- }, we = /* @__PURE__ */ x({
955
+ }, Te = /* @__PURE__ */ x({
956
956
  __name: "ElAgentButton",
957
957
  props: {
958
958
  theme: { default: "primary" },
@@ -965,40 +965,40 @@ var Ce = {
965
965
  iconAfter: {}
966
966
  },
967
967
  setup(e) {
968
- let t = f(() => ({
968
+ let t = p(() => ({
969
969
  primary: "bg-primary-600 border-primary-400 hover:border-primary-300 hover:bg-primary-500",
970
970
  green: "bg-green-600 border-green-400 hover:border-green-300 hover:bg-green-500",
971
971
  red: "bg-red-600 border-red-400 hover:border-red-300 hover:bg-red-500",
972
972
  default: "bg-white/10 border-white/20 hover:border-white/40 hover:bg-white/20",
973
973
  dark: "bg-theme-900 border-transparent hover:bg-theme-800"
974
- })[e.theme]), n = f(() => ({
974
+ })[e.theme]), n = p(() => ({
975
975
  sm: "px-4 py-2 text-sm",
976
976
  md: "px-6 py-3 text-base",
977
977
  lg: "px-8 py-4 text-base"
978
- })[e.size]), r = f(() => ({
978
+ })[e.size]), r = p(() => ({
979
979
  sm: "size-4",
980
980
  md: "size-4",
981
981
  lg: "size-5"
982
982
  })[e.size]);
983
- return (i, a) => (k(), h("button", { class: C(["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, n.value]]) }, [e.loading ? (k(), h("div", Ce, [...a[0] || (a[0] = [_("i", { class: "i-svg-spinners-90-ring-with-bg size-5" }, null, -1)])])) : m("", !0), _("span", { class: C(["flex items-center gap-2 transition-opacity duration-200", e.loading ? "opacity-0" : "opacity-100"]) }, [
984
- e.icon ? (k(), h("i", {
983
+ return (i, a) => (T(), _("button", { class: S(["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, n.value]]) }, [e.loading ? (T(), _("div", we, [...a[0] || (a[0] = [v("i", { class: "i-svg-spinners-90-ring-with-bg size-5" }, null, -1)])])) : h("", !0), v("span", { class: S(["flex items-center gap-2 transition-opacity duration-200", e.loading ? "opacity-0" : "opacity-100"]) }, [
984
+ e.icon ? (T(), _("i", {
985
985
  key: 0,
986
- class: C([e.icon, r.value])
987
- }, null, 2)) : m("", !0),
988
- ie(i.$slots, "default"),
989
- e.iconAfter ? (k(), h("i", {
986
+ class: S([e.icon, r.value])
987
+ }, null, 2)) : h("", !0),
988
+ oe(i.$slots, "default"),
989
+ e.iconAfter ? (T(), _("i", {
990
990
  key: 1,
991
- class: C([e.iconAfter, r.value])
992
- }, null, 2)) : m("", !0)
991
+ class: S([e.iconAfter, r.value])
992
+ }, null, 2)) : h("", !0)
993
993
  ], 2)], 2));
994
994
  }
995
- }), Te = ["value"], Ee = /* @__PURE__ */ x({
995
+ }), Ee = ["value"], De = /* @__PURE__ */ x({
996
996
  __name: "AgentInputEmail",
997
997
  props: { modelValue: { default: "" } },
998
998
  emits: ["update:modelValue"],
999
999
  setup(e, { emit: t }) {
1000
1000
  let n = t;
1001
- return (t, r) => (k(), h("input", {
1001
+ return (t, r) => (T(), _("input", {
1002
1002
  name: "username",
1003
1003
  type: "email",
1004
1004
  inputmode: "email",
@@ -1011,9 +1011,9 @@ var Ce = {
1011
1011
  class: "w-full px-6 py-3 text-theme-900 placeholder-theme-500 bg-white border border-white rounded-full focus:outline-none transition-colors",
1012
1012
  style: { "font-size": "16px" },
1013
1013
  onInput: r[0] || (r[0] = (e) => n("update:modelValue", e.target.value))
1014
- }, null, 40, Te));
1014
+ }, null, 40, Ee));
1015
1015
  }
1016
- }), De = ["placeholder", "value"], Oe = /* @__PURE__ */ x({
1016
+ }), Oe = ["placeholder", "value"], ke = /* @__PURE__ */ x({
1017
1017
  __name: "AgentInputOneTimeCode",
1018
1018
  props: {
1019
1019
  modelValue: {},
@@ -1022,15 +1022,15 @@ var Ce = {
1022
1022
  },
1023
1023
  emits: ["update:modelValue", "autoSubmit"],
1024
1024
  setup(e, { emit: t }) {
1025
- let n = e, r = t, i = A(null), a = f(() => "0".repeat(n.length));
1026
- ne(() => {
1025
+ let n = e, r = t, i = k(null), a = p(() => "0".repeat(n.length));
1026
+ ie(() => {
1027
1027
  n.focusFirst && !("ontouchstart" in window) && i.value?.focus();
1028
1028
  });
1029
1029
  function onInput(e) {
1030
1030
  let t = e.target.value.replace(/\D/g, "").slice(0, n.length);
1031
1031
  r("update:modelValue", t), t.length === n.length && r("autoSubmit", t);
1032
1032
  }
1033
- return (t, n) => (k(), h("input", {
1033
+ return (t, n) => (T(), _("input", {
1034
1034
  ref_key: "input",
1035
1035
  ref: i,
1036
1036
  name: "one-time-code",
@@ -1046,9 +1046,9 @@ var Ce = {
1046
1046
  class: "w-full px-6 py-3 text-center font-mono tracking-[0.35em] text-theme-900 placeholder-theme-500 bg-white border border-white rounded-full focus:outline-none transition-colors",
1047
1047
  style: { "font-size": "16px" },
1048
1048
  onInput
1049
- }, null, 40, De));
1049
+ }, null, 40, Oe));
1050
1050
  }
1051
- }), ke = { class: "relative flex-shrink-0" }, Ae = ["src", "alt"], je = { class: "absolute top-1 right-1" }, Me = {
1051
+ }), G = { class: "relative flex-shrink-0" }, Ae = ["src", "alt"], je = { class: "absolute top-1 right-1" }, Me = {
1052
1052
  key: 1,
1053
1053
  class: "size-3 bg-theme-400 rounded-full ring-2 ring-white"
1054
1054
  }, Ne = { class: "min-w-0" }, Pe = /* @__PURE__ */ x({
@@ -1063,15 +1063,15 @@ var Ce = {
1063
1063
  layout: { default: "centered" }
1064
1064
  },
1065
1065
  setup(e) {
1066
- return (t, n) => (k(), h("div", { class: C(["flex gap-4", [e.layout === "centered" ? "flex-col items-center text-center" : "flex-row items-center justify-center"]]) }, [_("div", ke, [_("div", { class: C(["rounded-full overflow-hidden border-white", e.size === "lg" ? "w-20 h-20 sm:w-24 sm:h-24 border-4" : "w-16 sm:size-16 border-2"]) }, [_("img", {
1066
+ return (t, n) => (T(), _("div", { class: S(["flex gap-4", [e.layout === "centered" ? "flex-col items-center text-center" : "flex-row items-center justify-center"]]) }, [v("div", G, [v("div", { class: S(["rounded-full overflow-hidden border-white", e.size === "lg" ? "w-20 h-20 sm:w-24 sm:h-24 border-4" : "w-16 sm:size-16 border-2"]) }, [v("img", {
1067
1067
  src: e.agent.avatarUrl.value,
1068
1068
  alt: e.agent.displayName.value,
1069
1069
  class: "w-full h-full object-cover",
1070
- onError: n[0] || (n[0] = (...e) => oe(handleImageError) && oe(handleImageError)(...e))
1071
- }, null, 40, Ae)], 2), _("div", je, [e.isOnline ? (k(), h(u, { key: 0 }, [n[1] || (n[1] = _("div", {
1070
+ onError: n[0] || (n[0] = (...e) => ce(handleImageError) && ce(handleImageError)(...e))
1071
+ }, null, 40, Ae)], 2), v("div", je, [e.isOnline ? (T(), _(f, { key: 0 }, [n[1] || (n[1] = v("div", {
1072
1072
  class: "size-3 bg-green-500 rounded-full ring-2 ring-white absolute animate-ping",
1073
1073
  style: { "animation-duration": "3s" }
1074
- }, null, -1)), n[2] || (n[2] = _("div", { class: "size-3 bg-green-500 rounded-full ring-2 ring-white" }, null, -1))], 64)) : (k(), h("div", Me))])]), _("div", Ne, [_("h1", { class: C(["font-light text-white mb-1 truncate", [e.size === "lg" ? "text-3xl mb-2" : "text-xl sm:text-2xl tracking-wide leading-tight", e.layout === "horizontal" ? "text-white/95" : ""]]) }, F(e.agent.displayName.value), 3), _("p", { class: C(["font-light line-clamp-1", [e.size === "lg" ? "text-base text-white/60" : "text-sm sm:text-base", e.layout === "horizontal" ? "text-white/70 truncate" : "text-white/60"]]) }, F(e.layout === "horizontal" ? e.agent.title.value || "Assistant" : e.agent.title.value), 3)])], 2));
1074
+ }, null, -1)), n[2] || (n[2] = v("div", { class: "size-3 bg-green-500 rounded-full ring-2 ring-white" }, null, -1))], 64)) : (T(), _("div", Me))])]), v("div", Ne, [v("h1", { class: S(["font-light text-white mb-1 truncate", [e.size === "lg" ? "text-3xl mb-2" : "text-xl sm:text-2xl tracking-wide leading-tight", e.layout === "horizontal" ? "text-white/95" : ""]]) }, P(e.agent.displayName.value), 3), v("p", { class: S(["font-light line-clamp-1", [e.size === "lg" ? "text-base text-white/60" : "text-sm sm:text-base", e.layout === "horizontal" ? "text-white/70 truncate" : "text-white/60"]]) }, P(e.layout === "horizontal" ? e.agent.title.value || "Assistant" : e.agent.title.value), 3)])], 2));
1075
1075
  }
1076
1076
  }), Fe = { class: "relative shrink-0 rounded-full" }, Ie = ["src", "alt"], Le = ["src", "alt"], Re = ["aria-label"], ze = /* @__PURE__ */ x({
1077
1077
  __name: "AgentAvatar",
@@ -1092,7 +1092,7 @@ var Ce = {
1092
1092
  amber: "bg-amber-500",
1093
1093
  red: "bg-red-500",
1094
1094
  grey: "bg-theme-300"
1095
- }, n = f(() => {
1095
+ }, n = p(() => {
1096
1096
  let n = e.agent.state.value;
1097
1097
  return e.showStatus && n.lifecycle !== "unknown" ? t[n.color] : null;
1098
1098
  }), r = {
@@ -1100,32 +1100,32 @@ var Ce = {
1100
1100
  height: "clamp(7px, 14%, 14px)",
1101
1101
  top: "calc(14.6% - clamp(3.5px, 7%, 7px))",
1102
1102
  right: "calc(14.6% - clamp(3.5px, 7%, 7px))"
1103
- }, i = f(() => e.isLight ? "ring-white" : "ring-theme-900");
1104
- return (t, a) => (k(), h("div", Fe, [
1105
- _("img", {
1103
+ }, i = p(() => e.isLight ? "ring-white" : "ring-theme-900");
1104
+ return (t, a) => (T(), _("div", Fe, [
1105
+ v("img", {
1106
1106
  src: e.agent.avatarUrl.value,
1107
1107
  alt: e.agent.displayName.value,
1108
- class: C(["size-full rounded-full object-cover ring-1", e.isLight ? "ring-black/5" : "ring-white/10"])
1108
+ class: S(["size-full rounded-full object-cover ring-1", e.isLight ? "ring-black/5" : "ring-white/10"])
1109
1109
  }, null, 10, Ie),
1110
- e.agent.ownerMarkUrl.value ? (k(), h("img", {
1110
+ e.agent.ownerMarkUrl.value ? (T(), _("img", {
1111
1111
  key: 0,
1112
1112
  src: e.agent.ownerMarkUrl.value,
1113
1113
  alt: e.agent.owner.value?.fullName ? `Owned by ${e.agent.owner.value.fullName}` : "Owner",
1114
- class: C(["absolute z-10 size-[36%] -bottom-[3%] -left-[3%] rounded-full object-cover ring-2", i.value])
1115
- }, null, 10, Le)) : m("", !0),
1116
- n.value ? (k(), h("span", {
1114
+ class: S(["absolute z-10 size-[36%] -bottom-[3%] -left-[3%] rounded-full object-cover ring-2", i.value])
1115
+ }, null, 10, Le)) : h("", !0),
1116
+ n.value ? (T(), _("span", {
1117
1117
  key: 1,
1118
1118
  role: "status",
1119
1119
  "aria-label": e.agent.state.value.tooltip,
1120
- class: C(["absolute z-10 rounded-full ring-2", [n.value, i.value]]),
1120
+ class: S(["absolute z-10 rounded-full ring-2", [n.value, i.value]]),
1121
1121
  style: r
1122
- }, null, 10, Re)) : m("", !0),
1123
- n.value && e.agent.state.value.lifecycle === "running" ? (k(), h("span", {
1122
+ }, null, 10, Re)) : h("", !0),
1123
+ n.value && e.agent.state.value.lifecycle === "running" ? (T(), _("span", {
1124
1124
  key: 2,
1125
1125
  "aria-hidden": "true",
1126
- class: C(["pointer-events-none absolute rounded-full animate-ping opacity-50 [animation-duration:3s]", n.value]),
1126
+ class: S(["pointer-events-none absolute rounded-full animate-ping opacity-50 [animation-duration:3s]", n.value]),
1127
1127
  style: r
1128
- }, null, 2)) : m("", !0)
1128
+ }, null, 2)) : h("", !0)
1129
1129
  ]));
1130
1130
  }
1131
1131
  }), Be = {
@@ -1133,7 +1133,7 @@ var Ce = {
1133
1133
  class: "sr-only",
1134
1134
  role: "status",
1135
1135
  "aria-live": "polite"
1136
- }, Ve = ["aria-expanded", "disabled"], G = ["aria-expanded"], He = {
1136
+ }, K = ["aria-expanded", "disabled"], Ve = ["aria-expanded"], He = {
1137
1137
  class: "flex w-5 shrink-0 justify-center self-stretch",
1138
1138
  "aria-hidden": "true"
1139
1139
  }, Ue = ["data-journal-row"], We = {
@@ -1149,18 +1149,18 @@ var Ce = {
1149
1149
  isLight: { type: Boolean }
1150
1150
  },
1151
1151
  setup(e) {
1152
- let t = e, n = P(!1);
1152
+ let t = e, n = se(!1);
1153
1153
  function toggle() {
1154
1154
  n.value = !n.value;
1155
1155
  }
1156
- let r = f(() => t.model.outcome === "completed"), i = f(() => t.model.hiddenRows.length), a = f(() => t.model.hint ?? (t.model.terminal?.tone === "active" ? t.model.terminal.label : void 0)), o = f(() => {
1156
+ let r = p(() => t.model.outcome === "completed"), i = p(() => t.model.hiddenRows.length), a = p(() => t.model.hint ?? (t.model.terminal?.tone === "active" ? t.model.terminal.label : void 0)), o = p(() => {
1157
1157
  let e = t.model;
1158
1158
  return r.value ? n.value ? e.hiddenRows : [] : [
1159
1159
  ...n.value ? e.hiddenRows : [],
1160
1160
  ...e.visibleRows,
1161
1161
  ...e.terminal ? [e.terminal] : []
1162
1162
  ];
1163
- }), s = f(() => t.isLight ? {
1163
+ }), s = p(() => t.isLight ? {
1164
1164
  spine: "bg-theme-200",
1165
1165
  dashed: "border-theme-300",
1166
1166
  doneMark: "text-theme-400",
@@ -1176,7 +1176,7 @@ var Ce = {
1176
1176
  stoppedSquare: "bg-white/55",
1177
1177
  muted: "text-white/55",
1178
1178
  ring: "focus-visible:ring-white"
1179
- }), c = f(() => {
1179
+ }), c = p(() => {
1180
1180
  let e = t.isLight;
1181
1181
  return {
1182
1182
  done: {
@@ -1219,64 +1219,64 @@ var Ce = {
1219
1219
  }
1220
1220
  };
1221
1221
  });
1222
- return (t, f) => (k(), h("div", { class: C(["w-full py-0.5", s.value.muted]) }, [
1223
- a.value ? (k(), h("span", Be, F(a.value), 1)) : m("", !0),
1224
- r.value ? (k(), h("button", {
1222
+ return (t, u) => (T(), _("div", { class: S(["w-full py-0.5", s.value.muted]) }, [
1223
+ a.value ? (T(), _("span", Be, P(a.value), 1)) : h("", !0),
1224
+ r.value ? (T(), _("button", {
1225
1225
  key: 1,
1226
1226
  type: "button",
1227
1227
  "data-test": "messaging-tool-activity-summary",
1228
1228
  "data-journal-disclosure": "",
1229
1229
  "aria-expanded": n.value,
1230
1230
  disabled: i.value === 0,
1231
- class: C(["flex min-h-11 items-center gap-x-2 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-default", s.value.ring]),
1231
+ class: S(["flex min-h-11 items-center gap-x-2 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-default", s.value.ring]),
1232
1232
  onClick: toggle
1233
1233
  }, [
1234
- f[0] || (f[0] = _("i", {
1234
+ u[0] || (u[0] = v("i", {
1235
1235
  "data-journal-station": "completed",
1236
1236
  class: "i-tabler-circle-check size-3.5 shrink-0 text-green-600",
1237
1237
  "aria-hidden": "true"
1238
1238
  }, null, -1)),
1239
- _("span", { class: C(["text-[12.5px] font-medium leading-none", s.value.muted]) }, F(e.model.terminal?.label), 3),
1240
- i.value ? (k(), h("i", {
1239
+ v("span", { class: S(["text-[12.5px] font-medium leading-none", s.value.muted]) }, P(e.model.terminal?.label), 3),
1240
+ i.value ? (T(), _("i", {
1241
1241
  key: 0,
1242
- class: C(["size-[13px] shrink-0", [n.value ? "i-tabler-chevron-down" : "i-tabler-chevron-right", s.value.muted]]),
1242
+ class: S(["size-[13px] shrink-0", [n.value ? "i-tabler-chevron-down" : "i-tabler-chevron-right", s.value.muted]]),
1243
1243
  "aria-hidden": "true"
1244
- }, null, 2)) : m("", !0)
1245
- ], 10, Ve)) : i.value ? (k(), h("button", {
1244
+ }, null, 2)) : h("", !0)
1245
+ ], 10, K)) : i.value ? (T(), _("button", {
1246
1246
  key: 2,
1247
1247
  type: "button",
1248
1248
  "data-test": "messaging-tool-activity-summary",
1249
1249
  "data-journal-disclosure": "",
1250
1250
  "aria-expanded": n.value,
1251
- class: C(["flex min-h-11 w-full gap-x-2.5 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2", s.value.ring]),
1251
+ class: S(["flex min-h-11 w-full gap-x-2.5 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2", s.value.ring]),
1252
1252
  onClick: toggle
1253
- }, [_("span", He, [_("span", {
1253
+ }, [v("span", He, [v("span", {
1254
1254
  "data-journal-spine": "dashed",
1255
- class: C(["w-0 border-l border-dashed", s.value.dashed])
1256
- }, null, 2)]), _("span", { class: C(["flex min-h-[20px] items-center gap-0.5 pb-2 text-[12px] leading-none", s.value.muted]) }, [v(F(i.value) + " earlier updates ", 1), _("i", {
1257
- class: C(["size-3 shrink-0", n.value ? "i-tabler-chevron-down" : "i-tabler-chevron-right"]),
1255
+ class: S(["w-0 border-l border-dashed", s.value.dashed])
1256
+ }, null, 2)]), v("span", { class: S(["flex min-h-[20px] items-center gap-0.5 pb-2 text-[12px] leading-none", s.value.muted]) }, [te(P(i.value) + " earlier updates ", 1), v("i", {
1257
+ class: S(["size-3 shrink-0", n.value ? "i-tabler-chevron-down" : "i-tabler-chevron-right"]),
1258
1258
  "aria-hidden": "true"
1259
- }, null, 2)], 2)], 10, G)) : m("", !0),
1260
- (k(!0), h(u, null, j(o.value, (e, t) => (k(), h("div", {
1259
+ }, null, 2)], 2)], 10, Ve)) : h("", !0),
1260
+ (T(!0), _(f, null, A(o.value, (e, t) => (T(), _("div", {
1261
1261
  key: e.id,
1262
1262
  "data-test": "messaging-tool-activity-row",
1263
1263
  "data-journal-row": e.tone,
1264
- class: C([r.value ? "pl-[22px]" : "", "flex gap-x-2.5"])
1265
- }, [_("div", We, [_("span", Ge, [(k(), p(ae(c.value[e.tone].station.tag), {
1264
+ class: S([r.value ? "pl-[22px]" : "", "flex gap-x-2.5"])
1265
+ }, [v("div", We, [v("span", Ge, [(T(), m(j(c.value[e.tone].station.tag), {
1266
1266
  "data-journal-station": e.tone,
1267
- class: C(c.value[e.tone].station.class)
1268
- }, null, 8, ["data-journal-station", "class"]))]), t === o.value.length - 1 ? m("", !0) : (k(), h("span", {
1267
+ class: S(c.value[e.tone].station.class)
1268
+ }, null, 8, ["data-journal-station", "class"]))]), t === o.value.length - 1 ? h("", !0) : (T(), _("span", {
1269
1269
  key: 0,
1270
- class: C(["w-px flex-1", s.value.spine])
1271
- }, null, 2))]), _("div", { class: C(["min-w-0 flex-1", t === o.value.length - 1 ? "" : "pb-2"]) }, [_("span", { class: C(["relative block leading-snug", c.value[e.tone].label]) }, [v(F(e.label), 1), c.value[e.tone].statusWord ? (k(), h("span", Ke, ", " + F(c.value[e.tone].statusWord), 1)) : m("", !0)], 2), e.note ? (k(), h("p", {
1270
+ class: S(["w-px flex-1", s.value.spine])
1271
+ }, null, 2))]), v("div", { class: S(["min-w-0 flex-1", t === o.value.length - 1 ? "" : "pb-2"]) }, [v("span", { class: S(["relative block leading-snug", c.value[e.tone].label]) }, [te(P(e.label), 1), c.value[e.tone].statusWord ? (T(), _("span", Ke, ", " + P(c.value[e.tone].statusWord), 1)) : h("", !0)], 2), e.note ? (T(), _("p", {
1272
1272
  key: 0,
1273
- class: C(["pt-0.5 text-[11.5px] leading-snug", s.value.muted])
1274
- }, F(e.note), 3)) : m("", !0)], 2)], 10, Ue))), 128)),
1275
- !r.value && e.model.hint ? (k(), h("p", {
1273
+ class: S(["pt-0.5 text-[11.5px] leading-snug", s.value.muted])
1274
+ }, P(e.note), 3)) : h("", !0)], 2)], 10, Ue))), 128)),
1275
+ !r.value && e.model.hint ? (T(), _("p", {
1276
1276
  key: 3,
1277
1277
  "data-test": "messaging-tool-activity-hint",
1278
- class: C(["pl-[30px] pt-2.5 text-[12px] leading-snug", s.value.muted])
1279
- }, F(e.model.hint), 3)) : m("", !0)
1278
+ class: S(["pl-[30px] pt-2.5 text-[12px] leading-snug", s.value.muted])
1279
+ }, P(e.model.hint), 3)) : h("", !0)
1280
1280
  ], 2));
1281
1281
  }
1282
1282
  });
@@ -1321,10 +1321,10 @@ function _unsupportedIterableToArray(e, t) {
1321
1321
  return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? _arrayLikeToArray(e, t) : void 0;
1322
1322
  }
1323
1323
  }
1324
- var Je = Object.entries, Ye = Object.setPrototypeOf, Xe = Object.isFrozen, Ze = Object.getPrototypeOf, Qe = Object.getOwnPropertyDescriptor, K = Object.freeze, q = Object.seal, $e = Object.create, et = typeof Reflect < "u" && Reflect, tt = et.apply, nt = et.construct;
1325
- K || (K = function freeze(e) {
1324
+ var Je = Object.entries, Ye = Object.setPrototypeOf, Xe = Object.isFrozen, Ze = Object.getPrototypeOf, Qe = Object.getOwnPropertyDescriptor, q = Object.freeze, J = Object.seal, $e = Object.create, et = typeof Reflect < "u" && Reflect, tt = et.apply, nt = et.construct;
1325
+ q || (q = function freeze(e) {
1326
1326
  return e;
1327
- }), q || (q = function seal(e) {
1327
+ }), J || (J = function seal(e) {
1328
1328
  return e;
1329
1329
  }), tt || (tt = function apply(e, t) {
1330
1330
  var n = [...arguments].slice(2);
@@ -1332,7 +1332,7 @@ K || (K = function freeze(e) {
1332
1332
  }), nt || (nt = function construct(e) {
1333
1333
  return new e(...[...arguments].slice(1));
1334
1334
  });
1335
- var rt = unapply(Array.prototype.forEach), it = unapply(Array.prototype.lastIndexOf), at = unapply(Array.prototype.pop), st = unapply(Array.prototype.push), ct = unapply(Array.prototype.splice), lt = Array.isArray, ut = unapply(String.prototype.toLowerCase), dt = unapply(String.prototype.toString), ft = unapply(String.prototype.match), pt = unapply(String.prototype.replace), mt = unapply(String.prototype.indexOf), ht = unapply(String.prototype.trim), gt = unapply(Number.prototype.toString), _t = unapply(Boolean.prototype.toString), vt = typeof BigInt > "u" ? null : unapply(BigInt.prototype.toString), yt = typeof Symbol > "u" ? null : unapply(Symbol.prototype.toString), J = unapply(Object.prototype.hasOwnProperty), bt = unapply(Object.prototype.toString), X = unapply(RegExp.prototype.test), xt = unconstruct(TypeError);
1335
+ var rt = unapply(Array.prototype.forEach), it = unapply(Array.prototype.lastIndexOf), at = unapply(Array.prototype.pop), st = unapply(Array.prototype.push), ct = unapply(Array.prototype.splice), lt = Array.isArray, ut = unapply(String.prototype.toLowerCase), dt = unapply(String.prototype.toString), ft = unapply(String.prototype.match), pt = unapply(String.prototype.replace), mt = unapply(String.prototype.indexOf), ht = unapply(String.prototype.trim), gt = unapply(Number.prototype.toString), _t = unapply(Boolean.prototype.toString), vt = typeof BigInt > "u" ? null : unapply(BigInt.prototype.toString), yt = typeof Symbol > "u" ? null : unapply(Symbol.prototype.toString), X = unapply(Object.prototype.hasOwnProperty), bt = unapply(Object.prototype.toString), Z = unapply(RegExp.prototype.test), xt = unconstruct(TypeError);
1336
1336
  function unapply(e) {
1337
1337
  return function(t) {
1338
1338
  t instanceof RegExp && (t.lastIndex = 0);
@@ -1360,7 +1360,7 @@ function addToSet(e, t) {
1360
1360
  return e;
1361
1361
  }
1362
1362
  function cleanArray(e) {
1363
- for (let t = 0; t < e.length; t++) J(e, t) || (e[t] = null);
1363
+ for (let t = 0; t < e.length; t++) X(e, t) || (e[t] = null);
1364
1364
  return e;
1365
1365
  }
1366
1366
  function clone(e) {
@@ -1368,7 +1368,7 @@ function clone(e) {
1368
1368
  for (let r of Je(e)) {
1369
1369
  var n = _slicedToArray(r, 2);
1370
1370
  let i = n[0], a = n[1];
1371
- J(e, i) && (lt(a) ? t[i] = cleanArray(a) : a && typeof a == "object" && a.constructor === Object ? t[i] = clone(a) : t[i] = a);
1371
+ X(e, i) && (lt(a) ? t[i] = cleanArray(a) : a && typeof a == "object" && a.constructor === Object ? t[i] = clone(a) : t[i] = a);
1372
1372
  }
1373
1373
  return t;
1374
1374
  }
@@ -1409,12 +1409,12 @@ function lookupGetter(e, t) {
1409
1409
  }
1410
1410
  function isRegex(e) {
1411
1411
  try {
1412
- return X(e, ""), !0;
1412
+ return Z(e, ""), !0;
1413
1413
  } catch {
1414
1414
  return !1;
1415
1415
  }
1416
1416
  }
1417
- var St = K(/* @__PURE__ */ "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".split(".")), Ct = K(/* @__PURE__ */ "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".split(".")), wt = K([
1417
+ var St = q(/* @__PURE__ */ "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".split(".")), Ct = q(/* @__PURE__ */ "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".split(".")), wt = q([
1418
1418
  "feBlend",
1419
1419
  "feColorMatrix",
1420
1420
  "feComponentTransfer",
@@ -1440,7 +1440,7 @@ var St = K(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
1440
1440
  "feSpotLight",
1441
1441
  "feTile",
1442
1442
  "feTurbulence"
1443
- ]), Tt = K([
1443
+ ]), Tt = q([
1444
1444
  "animate",
1445
1445
  "color-profile",
1446
1446
  "cursor",
@@ -1463,7 +1463,7 @@ var St = K(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
1463
1463
  "solidcolor",
1464
1464
  "unknown",
1465
1465
  "use"
1466
- ]), Et = K(/* @__PURE__ */ "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".split(".")), Dt = K([
1466
+ ]), Et = q(/* @__PURE__ */ "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".split(".")), Dt = q([
1467
1467
  "maction",
1468
1468
  "maligngroup",
1469
1469
  "malignmark",
@@ -1479,13 +1479,13 @@ var St = K(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
1479
1479
  "annotation-xml",
1480
1480
  "mprescripts",
1481
1481
  "none"
1482
- ]), Ot = K(["#text"]), kt = K(/* @__PURE__ */ "accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns".split(".")), At = K(/* @__PURE__ */ "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.dominant-baseline.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-orientation.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".split(".")), jt = K(/* @__PURE__ */ "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".split(".")), Mt = K([
1482
+ ]), Ot = q(["#text"]), kt = q(/* @__PURE__ */ "accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns".split(".")), At = q(/* @__PURE__ */ "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.dominant-baseline.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-orientation.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".split(".")), jt = q(/* @__PURE__ */ "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".split(".")), Mt = q([
1483
1483
  "xlink:href",
1484
1484
  "xml:id",
1485
1485
  "xlink:title",
1486
1486
  "xml:space",
1487
1487
  "xmlns:xlink"
1488
- ]), Nt = q(/{{[\w\W]*|^[\w\W]*}}/g), Pt = q(/<%[\w\W]*|^[\w\W]*%>/g), Ft = q(/\${[\w\W]*/g), It = q(/^data-[\-\w.\u00B7-\uFFFF]+$/), Lt = q(/^aria-[\-\w]+$/), Rt = q(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), zt = q(/^(?:\w+script|data):/i), Bt = q(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), Vt = q(/^html$/i), Ht = q(/^[a-z][.\w]*(-[.\w]+)+$/i), Ut = q(/<[/\w!]/g), Wt = q(/<[/\w]/g), Gt = q(/<\/no(script|embed|frames)/i), Kt = q(/\/>/i), qt = {
1488
+ ]), Nt = J(/{{[\w\W]*|^[\w\W]*}}/g), Pt = J(/<%[\w\W]*|^[\w\W]*%>/g), Ft = J(/\${[\w\W]*/g), It = J(/^data-[\-\w.\u00B7-\uFFFF]+$/), Lt = J(/^aria-[\-\w]+$/), Rt = J(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), zt = J(/^(?:\w+script|data):/i), Bt = J(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), Vt = J(/^html$/i), Ht = J(/^[a-z][.\w]*(-[.\w]+)+$/i), Ut = J(/<[/\w!]/g), Wt = J(/<[/\w]/g), Gt = J(/<\/no(script|embed|frames)/i), Kt = J(/\/>/i), qt = {
1489
1489
  element: 1,
1490
1490
  attribute: 2,
1491
1491
  text: 3,
@@ -1530,7 +1530,7 @@ var St = K(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
1530
1530
  uponSanitizeShadowNode: []
1531
1531
  };
1532
1532
  }, Zt = function _resolveSetOption(e, t, n, r) {
1533
- return J(e, t) && lt(e[t]) ? addToSet(r.base ? clone(r.base) : {}, e[t], r.transform) : n;
1533
+ return X(e, t) && lt(e[t]) ? addToSet(r.base ? clone(r.base) : {}, e[t], r.transform) : n;
1534
1534
  };
1535
1535
  function createDOMPurify() {
1536
1536
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Jt(), DOMPurify = (e) => createDOMPurify(e);
@@ -1539,32 +1539,32 @@ function createDOMPurify() {
1539
1539
  e.DocumentFragment;
1540
1540
  let i = e.HTMLTemplateElement, a = e.Node, o = e.Element, s = e.NodeFilter;
1541
1541
  e.NamedNodeMap === void 0 && (e.NamedNodeMap || e.MozNamedAttrMap), e.HTMLFormElement;
1542
- let c = e.DOMParser, u = e.trustedTypes, f = o.prototype, p = lookupGetter(f, "cloneNode"), m = lookupGetter(f, "remove"), h = lookupGetter(f, "nextSibling"), _ = lookupGetter(f, "childNodes"), v = lookupGetter(f, "parentNode"), b = lookupGetter(f, "shadowRoot"), x = lookupGetter(f, "attributes"), S = a && a.prototype ? lookupGetter(a.prototype, "nodeType") : null, C = a && a.prototype ? lookupGetter(a.prototype, "nodeName") : null;
1542
+ let c = e.DOMParser, u = e.trustedTypes, f = o.prototype, p = lookupGetter(f, "cloneNode"), m = lookupGetter(f, "remove"), h = lookupGetter(f, "nextSibling"), _ = lookupGetter(f, "childNodes"), v = lookupGetter(f, "parentNode"), te = lookupGetter(f, "shadowRoot"), b = lookupGetter(f, "attributes"), x = a && a.prototype ? lookupGetter(a.prototype, "nodeType") : null, ne = a && a.prototype ? lookupGetter(a.prototype, "nodeName") : null;
1543
1543
  if (typeof i == "function") {
1544
1544
  let e = t.createElement("template");
1545
1545
  e.content && e.content.ownerDocument && (t = e.content.ownerDocument);
1546
1546
  }
1547
- let T, te = "", ne, re = !1, k = 0, A = function _assertNotInTrustedTypesPolicy() {
1548
- if (k > 0) throw xt("A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the \"DOMPurify and Trusted Types\" section of the README.");
1549
- }, j = function _createTrustedHTML(e) {
1550
- A(), k++;
1547
+ let S, C = "", re, ie = !1, ae = 0, T = function _assertNotInTrustedTypesPolicy() {
1548
+ if (ae > 0) throw xt("A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the \"DOMPurify and Trusted Types\" section of the README.");
1549
+ }, k = function _createTrustedHTML(e) {
1550
+ T(), ae++;
1551
1551
  try {
1552
- return T.createHTML(e);
1552
+ return S.createHTML(e);
1553
1553
  } finally {
1554
- k--;
1554
+ ae--;
1555
1555
  }
1556
- }, ie = function _createTrustedScriptURL(e) {
1557
- A(), k++;
1556
+ }, A = function _createTrustedScriptURL(e) {
1557
+ T(), ae++;
1558
1558
  try {
1559
- return T.createScriptURL(e);
1559
+ return S.createScriptURL(e);
1560
1560
  } finally {
1561
- k--;
1561
+ ae--;
1562
1562
  }
1563
- }, ae = function _getDefaultTrustedTypesPolicy() {
1564
- return re || (ne = Yt(u, r), re = !0), ne;
1565
- }, P = t, F = P.implementation, oe = P.createNodeIterator, I = P.createDocumentFragment, se = P.getElementsByTagName, ce = n.importNode, R = Xt();
1566
- DOMPurify.isSupported = typeof Je == "function" && typeof v == "function" && F && F.createHTMLDocument !== void 0;
1567
- let ue = Nt, z = Pt, de = Ft, B = It, pe = Lt, he = zt, _e = Bt, ve = Ht, ye = Rt, H = null, be = addToSet({}, [
1563
+ }, oe = function _getDefaultTrustedTypesPolicy() {
1564
+ return ie || (re = Yt(u, r), ie = !0), re;
1565
+ }, j = t, se = j.implementation, P = j.createNodeIterator, ce = j.createDocumentFragment, ue = j.getElementsByTagName, de = n.importNode, F = Xt();
1566
+ DOMPurify.isSupported = typeof Je == "function" && typeof v == "function" && se && se.createHTMLDocument !== void 0;
1567
+ let pe = Nt, he = Pt, I = Ft, R = It, z = Lt, _e = zt, ve = Bt, B = Ht, ye = Rt, H = null, be = addToSet({}, [
1568
1568
  ...St,
1569
1569
  ...Ct,
1570
1570
  ...wt,
@@ -1607,14 +1607,14 @@ function createDOMPurify() {
1607
1607
  enumerable: !0,
1608
1608
  value: null
1609
1609
  }
1610
- })), Ee = !0, De = !0, Oe = !1, ke = !0, Ae = !1, je = !0, Me = !1, Ne = !1, Pe = null, Fe = null, Ie = !1, Le = !1, Re = !1, ze = !1, Be = !0, Ve = !1, G = "user-content-", He = !0, Ue = !1, We = {}, Ge = null, Ke = addToSet({}, /* @__PURE__ */ "annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp".split(".")), qe = null, Ye = addToSet({}, [
1610
+ })), Ee = !0, De = !0, Oe = !1, ke = !0, G = !1, Ae = !0, je = !1, Me = !1, Ne = null, Pe = null, Fe = !1, Ie = !1, Le = !1, Re = !1, ze = !0, Be = !1, K = "user-content-", Ve = !0, He = !1, Ue = {}, We = null, Ge = addToSet({}, /* @__PURE__ */ "annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp".split(".")), Ke = null, qe = addToSet({}, [
1611
1611
  "audio",
1612
1612
  "video",
1613
1613
  "img",
1614
1614
  "source",
1615
1615
  "image",
1616
1616
  "track"
1617
- ]), Xe = null, Ze = addToSet({}, [
1617
+ ]), Ye = null, Xe = addToSet({}, [
1618
1618
  "alt",
1619
1619
  "class",
1620
1620
  "for",
@@ -1629,69 +1629,69 @@ function createDOMPurify() {
1629
1629
  "value",
1630
1630
  "style",
1631
1631
  "xmlns"
1632
- ]), Qe = "http://www.w3.org/1998/Math/MathML", et = "http://www.w3.org/2000/svg", tt = "http://www.w3.org/1999/xhtml", nt = tt, gt = !1, _t = null, vt = addToSet({}, [
1632
+ ]), Ze = "http://www.w3.org/1998/Math/MathML", Qe = "http://www.w3.org/2000/svg", et = "http://www.w3.org/1999/xhtml", tt = et, nt = !1, gt = null, _t = addToSet({}, [
1633
+ Ze,
1633
1634
  Qe,
1634
- et,
1635
- tt
1636
- ], dt), yt = K([
1635
+ et
1636
+ ], dt), vt = q([
1637
1637
  "mi",
1638
1638
  "mo",
1639
1639
  "mn",
1640
1640
  "ms",
1641
1641
  "mtext"
1642
- ]), bt = addToSet({}, yt), Qt = K(["annotation-xml"]), $t = addToSet({}, Qt), en = addToSet({}, [
1642
+ ]), yt = addToSet({}, vt), bt = q(["annotation-xml"]), Qt = addToSet({}, bt), $t = addToSet({}, [
1643
1643
  "title",
1644
1644
  "style",
1645
1645
  "font",
1646
1646
  "a",
1647
1647
  "script"
1648
- ]), tn = null, Z = ["application/xhtml+xml", "text/html"], Q = null, nn = null, rn = t.createElement("form"), an = function isRegexOrFunction(e) {
1648
+ ]), en = null, tn = ["application/xhtml+xml", "text/html"], Q = null, nn = null, rn = t.createElement("form"), an = function isRegexOrFunction(e) {
1649
1649
  return e instanceof RegExp || e instanceof Function;
1650
1650
  }, on = function _parseConfig() {
1651
1651
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1652
1652
  if (nn && nn === e) return;
1653
- (!e || typeof e != "object") && (e = {}), e = clone(e), tn = Z.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, Q = tn === "application/xhtml+xml" ? dt : ut, H = Zt(e, "ALLOWED_TAGS", be, { transform: Q }), U = Zt(e, "ALLOWED_ATTR", Se, { transform: Q }), _t = Zt(e, "ALLOWED_NAMESPACES", vt, { transform: dt }), Xe = Zt(e, "ADD_URI_SAFE_ATTR", Ze, {
1653
+ (!e || typeof e != "object") && (e = {}), e = clone(e), en = tn.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, Q = en === "application/xhtml+xml" ? dt : ut, H = Zt(e, "ALLOWED_TAGS", be, { transform: Q }), U = Zt(e, "ALLOWED_ATTR", Se, { transform: Q }), gt = Zt(e, "ALLOWED_NAMESPACES", _t, { transform: dt }), Ye = Zt(e, "ADD_URI_SAFE_ATTR", Xe, {
1654
1654
  transform: Q,
1655
- base: Ze
1656
- }), qe = Zt(e, "ADD_DATA_URI_TAGS", Ye, {
1655
+ base: Xe
1656
+ }), Ke = Zt(e, "ADD_DATA_URI_TAGS", qe, {
1657
1657
  transform: Q,
1658
- base: Ye
1659
- }), Ge = Zt(e, "FORBID_CONTENTS", Ke, { transform: Q }), Ce = Zt(e, "FORBID_TAGS", clone({}), { transform: Q }), we = Zt(e, "FORBID_ATTR", clone({}), { transform: Q }), We = J(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? clone(e.USE_PROFILES) : e.USE_PROFILES : !1, Ee = e.ALLOW_ARIA_ATTR !== !1, De = e.ALLOW_DATA_ATTR !== !1, Oe = e.ALLOW_UNKNOWN_PROTOCOLS || !1, ke = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Ae = e.SAFE_FOR_TEMPLATES || !1, je = e.SAFE_FOR_XML !== !1, Me = e.WHOLE_DOCUMENT || !1, Le = e.RETURN_DOM || !1, Re = e.RETURN_DOM_FRAGMENT || !1, ze = e.RETURN_TRUSTED_TYPE || !1, Ie = e.FORCE_BODY || !1, Be = e.SANITIZE_DOM !== !1, Ve = e.SANITIZE_NAMED_PROPS || !1, He = e.KEEP_CONTENT !== !1, Ue = e.IN_PLACE || !1, ye = isRegex(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : Rt, nt = typeof e.NAMESPACE == "string" ? e.NAMESPACE : tt, bt = J(e, "MATHML_TEXT_INTEGRATION_POINTS") && e.MATHML_TEXT_INTEGRATION_POINTS && typeof e.MATHML_TEXT_INTEGRATION_POINTS == "object" ? clone(e.MATHML_TEXT_INTEGRATION_POINTS) : addToSet({}, yt), $t = J(e, "HTML_INTEGRATION_POINTS") && e.HTML_INTEGRATION_POINTS && typeof e.HTML_INTEGRATION_POINTS == "object" ? clone(e.HTML_INTEGRATION_POINTS) : addToSet({}, Qt);
1660
- let t = J(e, "CUSTOM_ELEMENT_HANDLING") && e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING == "object" ? clone(e.CUSTOM_ELEMENT_HANDLING) : $e(null);
1661
- if (W = $e(null), J(t, "tagNameCheck") && an(t.tagNameCheck) && (W.tagNameCheck = t.tagNameCheck), J(t, "attributeNameCheck") && an(t.attributeNameCheck) && (W.attributeNameCheck = t.attributeNameCheck), J(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (W.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), q(W), Ae && (De = !1), Re && (Le = !0), We && (H = addToSet({}, Ot), U = $e(null), We.html === !0 && (addToSet(H, St), addToSet(U, kt)), We.svg === !0 && (addToSet(H, Ct), addToSet(U, At), addToSet(U, Mt)), We.svgFilters === !0 && (addToSet(H, wt), addToSet(U, At), addToSet(U, Mt)), We.mathMl === !0 && (addToSet(H, Et), addToSet(U, jt), addToSet(U, Mt))), Te.tagCheck = null, Te.attributeCheck = null, J(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? Te.tagCheck = e.ADD_TAGS : lt(e.ADD_TAGS) && (H === be && (H = clone(H)), addToSet(H, e.ADD_TAGS, Q))), J(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? Te.attributeCheck = e.ADD_ATTR : lt(e.ADD_ATTR) && (U === Se && (U = clone(U)), addToSet(U, e.ADD_ATTR, Q))), J(e, "ADD_URI_SAFE_ATTR") && lt(e.ADD_URI_SAFE_ATTR) && addToSet(Xe, e.ADD_URI_SAFE_ATTR, Q), J(e, "FORBID_CONTENTS") && lt(e.FORBID_CONTENTS) && (Ge === Ke && (Ge = clone(Ge)), addToSet(Ge, e.FORBID_CONTENTS, Q)), J(e, "ADD_FORBID_CONTENTS") && lt(e.ADD_FORBID_CONTENTS) && (Ge === Ke && (Ge = clone(Ge)), addToSet(Ge, e.ADD_FORBID_CONTENTS, Q)), He && (H["#text"] = !0), Me && addToSet(H, [
1658
+ base: qe
1659
+ }), We = Zt(e, "FORBID_CONTENTS", Ge, { transform: Q }), Ce = Zt(e, "FORBID_TAGS", clone({}), { transform: Q }), we = Zt(e, "FORBID_ATTR", clone({}), { transform: Q }), Ue = X(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? clone(e.USE_PROFILES) : e.USE_PROFILES : !1, Ee = e.ALLOW_ARIA_ATTR !== !1, De = e.ALLOW_DATA_ATTR !== !1, Oe = e.ALLOW_UNKNOWN_PROTOCOLS || !1, ke = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, G = e.SAFE_FOR_TEMPLATES || !1, Ae = e.SAFE_FOR_XML !== !1, je = e.WHOLE_DOCUMENT || !1, Ie = e.RETURN_DOM || !1, Le = e.RETURN_DOM_FRAGMENT || !1, Re = e.RETURN_TRUSTED_TYPE || !1, Fe = e.FORCE_BODY || !1, ze = e.SANITIZE_DOM !== !1, Be = e.SANITIZE_NAMED_PROPS || !1, Ve = e.KEEP_CONTENT !== !1, He = e.IN_PLACE || !1, ye = isRegex(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : Rt, tt = typeof e.NAMESPACE == "string" ? e.NAMESPACE : et, yt = X(e, "MATHML_TEXT_INTEGRATION_POINTS") && e.MATHML_TEXT_INTEGRATION_POINTS && typeof e.MATHML_TEXT_INTEGRATION_POINTS == "object" ? clone(e.MATHML_TEXT_INTEGRATION_POINTS) : addToSet({}, vt), Qt = X(e, "HTML_INTEGRATION_POINTS") && e.HTML_INTEGRATION_POINTS && typeof e.HTML_INTEGRATION_POINTS == "object" ? clone(e.HTML_INTEGRATION_POINTS) : addToSet({}, bt);
1660
+ let t = X(e, "CUSTOM_ELEMENT_HANDLING") && e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING == "object" ? clone(e.CUSTOM_ELEMENT_HANDLING) : $e(null);
1661
+ if (W = $e(null), X(t, "tagNameCheck") && an(t.tagNameCheck) && (W.tagNameCheck = t.tagNameCheck), X(t, "attributeNameCheck") && an(t.attributeNameCheck) && (W.attributeNameCheck = t.attributeNameCheck), X(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (W.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), J(W), G && (De = !1), Le && (Ie = !0), Ue && (H = addToSet({}, Ot), U = $e(null), Ue.html === !0 && (addToSet(H, St), addToSet(U, kt)), Ue.svg === !0 && (addToSet(H, Ct), addToSet(U, At), addToSet(U, Mt)), Ue.svgFilters === !0 && (addToSet(H, wt), addToSet(U, At), addToSet(U, Mt)), Ue.mathMl === !0 && (addToSet(H, Et), addToSet(U, jt), addToSet(U, Mt))), Te.tagCheck = null, Te.attributeCheck = null, X(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? Te.tagCheck = e.ADD_TAGS : lt(e.ADD_TAGS) && (H === be && (H = clone(H)), addToSet(H, e.ADD_TAGS, Q))), X(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? Te.attributeCheck = e.ADD_ATTR : lt(e.ADD_ATTR) && (U === Se && (U = clone(U)), addToSet(U, e.ADD_ATTR, Q))), X(e, "ADD_URI_SAFE_ATTR") && lt(e.ADD_URI_SAFE_ATTR) && addToSet(Ye, e.ADD_URI_SAFE_ATTR, Q), X(e, "FORBID_CONTENTS") && lt(e.FORBID_CONTENTS) && (We === Ge && (We = clone(We)), addToSet(We, e.FORBID_CONTENTS, Q)), X(e, "ADD_FORBID_CONTENTS") && lt(e.ADD_FORBID_CONTENTS) && (We === Ge && (We = clone(We)), addToSet(We, e.ADD_FORBID_CONTENTS, Q)), Ve && (H["#text"] = !0), je && addToSet(H, [
1662
1662
  "html",
1663
1663
  "head",
1664
1664
  "body"
1665
1665
  ]), H.table && (addToSet(H, ["tbody"]), delete Ce.tbody), e.TRUSTED_TYPES_POLICY) {
1666
1666
  if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw xt("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
1667
1667
  if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw xt("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
1668
- let t = T;
1669
- T = e.TRUSTED_TYPES_POLICY;
1668
+ let t = S;
1669
+ S = e.TRUSTED_TYPES_POLICY;
1670
1670
  try {
1671
- te = j("");
1671
+ C = k("");
1672
1672
  } catch (e) {
1673
- throw T = t, e;
1673
+ throw S = t, e;
1674
1674
  }
1675
- } else e.TRUSTED_TYPES_POLICY === null ? (T = void 0, te = "") : (T === void 0 && (T = ae()), T && typeof te == "string" && (te = j("")));
1676
- K && K(e), nn = e;
1675
+ } else e.TRUSTED_TYPES_POLICY === null ? (S = void 0, C = "") : (S === void 0 && (S = oe()), S && typeof C == "string" && (C = k("")));
1676
+ q && q(e), nn = e;
1677
1677
  }, sn = addToSet({}, [
1678
1678
  ...Ct,
1679
1679
  ...wt,
1680
1680
  ...Tt
1681
1681
  ]), cn = addToSet({}, [...Et, ...Dt]), ln = function _checkSvgNamespace(e, t, n) {
1682
- return t.namespaceURI === tt ? e === "svg" : t.namespaceURI === Qe ? e === "svg" && (n === "annotation-xml" || bt[n]) : !!sn[e];
1682
+ return t.namespaceURI === et ? e === "svg" : t.namespaceURI === Ze ? e === "svg" && (n === "annotation-xml" || yt[n]) : !!sn[e];
1683
1683
  }, un = function _checkMathMlNamespace(e, t, n) {
1684
- return t.namespaceURI === tt ? e === "math" : t.namespaceURI === et ? e === "math" && $t[n] : !!cn[e];
1684
+ return t.namespaceURI === et ? e === "math" : t.namespaceURI === Qe ? e === "math" && Qt[n] : !!cn[e];
1685
1685
  }, dn = function _checkHtmlNamespace(e, t, n) {
1686
- return t.namespaceURI === et && !$t[n] || t.namespaceURI === Qe && !bt[n] ? !1 : !cn[e] && (en[e] || !sn[e]);
1686
+ return t.namespaceURI === Qe && !Qt[n] || t.namespaceURI === Ze && !yt[n] ? !1 : !cn[e] && ($t[e] || !sn[e]);
1687
1687
  }, fn = function _checkValidNamespace(e) {
1688
1688
  let t = v(e);
1689
1689
  (!t || !t.tagName) && (t = {
1690
- namespaceURI: nt,
1690
+ namespaceURI: tt,
1691
1691
  tagName: "template"
1692
1692
  });
1693
1693
  let n = ut(e.tagName), r = ut(t.tagName);
1694
- return _t[e.namespaceURI] ? e.namespaceURI === et ? ln(n, t, r) : e.namespaceURI === Qe ? un(n, t, r) : e.namespaceURI === tt ? dn(n, t, r) : !!(tn === "application/xhtml+xml" && _t[e.namespaceURI]) : !1;
1694
+ return gt[e.namespaceURI] ? e.namespaceURI === Qe ? ln(n, t, r) : e.namespaceURI === Ze ? un(n, t, r) : e.namespaceURI === et ? dn(n, t, r) : !!(en === "application/xhtml+xml" && gt[e.namespaceURI]) : !1;
1695
1695
  }, pn = function _forceRemove(e) {
1696
1696
  st(DOMPurify.removed, { element: e });
1697
1697
  try {
@@ -1712,7 +1712,7 @@ function createDOMPurify() {
1712
1712
  } catch {}
1713
1713
  });
1714
1714
  }
1715
- let n = x(e);
1715
+ let n = b(e);
1716
1716
  if (n) for (let t = n.length - 1; t >= 0; --t) {
1717
1717
  let r = n[t], i = r && r.name;
1718
1718
  if (typeof i == "string") try {
@@ -1731,14 +1731,14 @@ function createDOMPurify() {
1731
1731
  from: t
1732
1732
  });
1733
1733
  }
1734
- if (t.removeAttribute(e), e === "is") if (Le || Re) try {
1734
+ if (t.removeAttribute(e), e === "is") if (Ie || Le) try {
1735
1735
  pn(t);
1736
1736
  } catch {}
1737
1737
  else try {
1738
1738
  t.setAttribute(e, "");
1739
1739
  } catch {}
1740
1740
  }, gn = function _stripDisallowedAttributes(e) {
1741
- let t = x(e);
1741
+ let t = b(e);
1742
1742
  if (t) for (let n = t.length - 1; n >= 0; --n) {
1743
1743
  let r = t[n], i = r && r.name;
1744
1744
  if (!(typeof i != "string" || U[Q(i)])) try {
@@ -1749,23 +1749,23 @@ function createDOMPurify() {
1749
1749
  let t = [e];
1750
1750
  for (; t.length > 0;) {
1751
1751
  let e = t.pop();
1752
- (S ? S(e) : e.nodeType) === qt.element && gn(e);
1752
+ (x ? x(e) : e.nodeType) === qt.element && gn(e);
1753
1753
  let n = _(e);
1754
1754
  if (n) for (let e = n.length - 1; e >= 0; --e) t.push(n[e]);
1755
1755
  }
1756
1756
  }, vn = function _neutralizePatchLinkage(e) {
1757
- if (!je) return;
1757
+ if (!Ae) return;
1758
1758
  let t = [e];
1759
1759
  for (; t.length > 0;) {
1760
- let e = t.pop(), n = S ? S(e) : e.nodeType;
1761
- if (n === qt.processingInstruction || n === qt.comment && X(Wt, e.data)) {
1760
+ let e = t.pop(), n = x ? x(e) : e.nodeType;
1761
+ if (n === qt.processingInstruction || n === qt.comment && Z(Wt, e.data)) {
1762
1762
  try {
1763
1763
  m(e);
1764
1764
  } catch {}
1765
1765
  continue;
1766
1766
  }
1767
1767
  if (n === qt.element) {
1768
- let t = e, n = Q(C ? C(e) : e.nodeName);
1768
+ let t = e, n = Q(ne ? ne(e) : e.nodeName);
1769
1769
  try {
1770
1770
  t.hasAttribute && t.hasAttribute("patchsrc") && t.removeAttribute("patchsrc"), t.hasAttribute && t.hasAttribute("for") && n !== "label" && n !== "output" && t.removeAttribute("for");
1771
1771
  } catch {}
@@ -1775,50 +1775,50 @@ function createDOMPurify() {
1775
1775
  }
1776
1776
  }, yn = function _initDocument(e) {
1777
1777
  let n = null, r = null;
1778
- if (Ie) e = "<remove></remove>" + e;
1778
+ if (Fe) e = "<remove></remove>" + e;
1779
1779
  else {
1780
1780
  let t = ft(e, /^[\r\n\t ]+/);
1781
1781
  r = t && t[0];
1782
1782
  }
1783
- tn === "application/xhtml+xml" && nt === tt && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
1784
- let i = T ? j(e) : e;
1785
- if (nt === tt) try {
1786
- n = new c().parseFromString(i, tn);
1783
+ en === "application/xhtml+xml" && tt === et && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
1784
+ let i = S ? k(e) : e;
1785
+ if (tt === et) try {
1786
+ n = new c().parseFromString(i, en);
1787
1787
  } catch {}
1788
1788
  if (!n || !n.documentElement) {
1789
- n = F.createDocument(nt, "template", null);
1789
+ n = se.createDocument(tt, "template", null);
1790
1790
  try {
1791
- n.documentElement.innerHTML = gt ? te : i;
1791
+ n.documentElement.innerHTML = nt ? C : i;
1792
1792
  } catch {}
1793
1793
  }
1794
1794
  let a = n.body || n.documentElement;
1795
- return e && r && a.insertBefore(t.createTextNode(r), a.childNodes[0] || null), nt === tt ? se.call(n, Me ? "html" : "body")[0] : Me ? n.documentElement : a;
1795
+ return e && r && a.insertBefore(t.createTextNode(r), a.childNodes[0] || null), tt === et ? ue.call(n, je ? "html" : "body")[0] : je ? n.documentElement : a;
1796
1796
  }, bn = function _createNodeIterator(e) {
1797
- return oe.call(e.ownerDocument || e, e, s.SHOW_ELEMENT | s.SHOW_COMMENT | s.SHOW_TEXT | s.SHOW_PROCESSING_INSTRUCTION | s.SHOW_CDATA_SECTION, null);
1797
+ return P.call(e.ownerDocument || e, e, s.SHOW_ELEMENT | s.SHOW_COMMENT | s.SHOW_TEXT | s.SHOW_PROCESSING_INSTRUCTION | s.SHOW_CDATA_SECTION, null);
1798
1798
  }, xn = function _stripTemplateExpressions(e) {
1799
- return e = pt(e, ue, " "), e = pt(e, z, " "), e = pt(e, de, " "), e;
1799
+ return e = pt(e, pe, " "), e = pt(e, he, " "), e = pt(e, I, " "), e;
1800
1800
  }, Sn = function _scrubTemplateExpressions(e) {
1801
1801
  e.normalize();
1802
- let t = oe.call(e.ownerDocument || e, e, s.SHOW_TEXT | s.SHOW_COMMENT | s.SHOW_CDATA_SECTION | s.SHOW_PROCESSING_INSTRUCTION, null), n = t.nextNode();
1802
+ let t = P.call(e.ownerDocument || e, e, s.SHOW_TEXT | s.SHOW_COMMENT | s.SHOW_CDATA_SECTION | s.SHOW_PROCESSING_INSTRUCTION, null), n = t.nextNode();
1803
1803
  for (; n;) n.data = xn(n.data), n = t.nextNode();
1804
1804
  let r = e.querySelectorAll?.call(e, "template");
1805
1805
  r && rt(r, (e) => {
1806
1806
  wn(e.content) && Sn(e.content);
1807
1807
  });
1808
1808
  }, Cn = function _isClobbered(e) {
1809
- let t = C ? C(e) : null;
1810
- return typeof t != "string" || Q(t) !== "form" ? !1 : typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || e.attributes !== x(e) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function" || e.nodeType !== S(e) || e.childNodes !== _(e);
1809
+ let t = ne ? ne(e) : null;
1810
+ return typeof t != "string" || Q(t) !== "form" ? !1 : typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || e.attributes !== b(e) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function" || e.nodeType !== x(e) || e.childNodes !== _(e);
1811
1811
  }, wn = function _isDocumentFragment(e) {
1812
- if (!S || typeof e != "object" || !e) return !1;
1812
+ if (!x || typeof e != "object" || !e) return !1;
1813
1813
  try {
1814
- return S(e) === qt.documentFragment;
1814
+ return x(e) === qt.documentFragment;
1815
1815
  } catch {
1816
1816
  return !1;
1817
1817
  }
1818
1818
  }, Tn = function _isNode(e) {
1819
- if (!S || typeof e != "object" || !e) return !1;
1819
+ if (!x || typeof e != "object" || !e) return !1;
1820
1820
  try {
1821
- return typeof S(e) == "number";
1821
+ return typeof x(e) == "number";
1822
1822
  } catch {
1823
1823
  return !1;
1824
1824
  }
@@ -1829,46 +1829,46 @@ function createDOMPurify() {
1829
1829
  });
1830
1830
  }
1831
1831
  let En = function _isUnsafeNode(e, t) {
1832
- return !!(je && e.hasChildNodes() && !Tn(e.firstElementChild) && X(Ut, e.textContent) && X(Ut, e.innerHTML) || je && e.namespaceURI === tt && t === "style" && Tn(e.firstElementChild) || e.nodeType === qt.processingInstruction || je && e.nodeType === qt.comment && X(Wt, e.data));
1832
+ return !!(Ae && e.hasChildNodes() && !Tn(e.firstElementChild) && Z(Ut, e.textContent) && Z(Ut, e.innerHTML) || Ae && e.namespaceURI === et && t === "style" && Tn(e.firstElementChild) || e.nodeType === qt.processingInstruction || Ae && e.nodeType === qt.comment && Z(Wt, e.data));
1833
1833
  }, Dn = function _sanitizeDisallowedNode(e, t) {
1834
- if (!Ce[t] && jn(t) && (W.tagNameCheck instanceof RegExp && X(W.tagNameCheck, t) || W.tagNameCheck instanceof Function && W.tagNameCheck(t))) return !1;
1835
- if (He && !Ge[t]) {
1834
+ if (!Ce[t] && jn(t) && (W.tagNameCheck instanceof RegExp && Z(W.tagNameCheck, t) || W.tagNameCheck instanceof Function && W.tagNameCheck(t))) return !1;
1835
+ if (Ve && !We[t]) {
1836
1836
  let t = v(e), n = _(e);
1837
1837
  if (n && t) {
1838
1838
  let r = n.length;
1839
1839
  for (let i = r - 1; i >= 0; --i) {
1840
- let r = Ue ? n[i] : p(n[i], !0);
1840
+ let r = He ? n[i] : p(n[i], !0);
1841
1841
  t.insertBefore(r, h(e));
1842
1842
  }
1843
1843
  }
1844
1844
  }
1845
1845
  return pn(e), !0;
1846
1846
  }, On = function _sanitizeElements(e, t) {
1847
- if (_executeHooks(R.beforeSanitizeElements, e, null), e !== t && v(e) === null) return !0;
1847
+ if (_executeHooks(F.beforeSanitizeElements, e, null), e !== t && v(e) === null) return !0;
1848
1848
  if (Cn(e)) return pn(e), !0;
1849
- let n = Q(C ? C(e) : e.nodeName);
1850
- if (_executeHooks(R.uponSanitizeElement, e, {
1849
+ let n = Q(ne ? ne(e) : e.nodeName);
1850
+ if (_executeHooks(F.uponSanitizeElement, e, {
1851
1851
  tagName: n,
1852
1852
  allowedTags: H
1853
1853
  }), e !== t && v(e) === null) return !0;
1854
1854
  if (En(e, n)) return pn(e), !0;
1855
1855
  if (Ce[n] || !(Te.tagCheck instanceof Function && Te.tagCheck(n)) && !H[n]) {
1856
1856
  let t = Dn(e, n);
1857
- return t === !1 && _executeHooks(R.afterSanitizeElements, e, null), t;
1857
+ return t === !1 && _executeHooks(F.afterSanitizeElements, e, null), t;
1858
1858
  }
1859
- if ((S ? S(e) : e.nodeType) === qt.element && !fn(e) || (n === "noscript" || n === "noembed" || n === "noframes") && X(Gt, e.innerHTML)) return pn(e), !0;
1860
- if (Ae && e.nodeType === qt.text) {
1859
+ if ((x ? x(e) : e.nodeType) === qt.element && !fn(e) || (n === "noscript" || n === "noembed" || n === "noframes") && Z(Gt, e.innerHTML)) return pn(e), !0;
1860
+ if (G && e.nodeType === qt.text) {
1861
1861
  let t = xn(e.textContent);
1862
1862
  e.textContent !== t && (st(DOMPurify.removed, { element: e.cloneNode() }), e.textContent = t);
1863
1863
  }
1864
- return _executeHooks(R.afterSanitizeElements, e, null), !1;
1864
+ return _executeHooks(F.afterSanitizeElements, e, null), !1;
1865
1865
  }, kn = function _isValidAttribute(e, n, r) {
1866
- if (we[n] || je && n === "patchsrc" || je && n === "for" && e !== "label" && e !== "output" || Be && (n === "id" || n === "name") && (r in t || r in rn)) return !1;
1866
+ if (we[n] || Ae && n === "patchsrc" || Ae && n === "for" && e !== "label" && e !== "output" || ze && (n === "id" || n === "name") && (r in t || r in rn)) return !1;
1867
1867
  let i = U[n] || Te.attributeCheck instanceof Function && Te.attributeCheck(n, e);
1868
- if (!(De && X(B, n)) && !(Ee && X(pe, n))) {
1868
+ if (!(De && Z(R, n)) && !(Ee && Z(z, n))) {
1869
1869
  if (!i) {
1870
- if (!(jn(e) && (W.tagNameCheck instanceof RegExp && X(W.tagNameCheck, e) || W.tagNameCheck instanceof Function && W.tagNameCheck(e)) && (W.attributeNameCheck instanceof RegExp && X(W.attributeNameCheck, n) || W.attributeNameCheck instanceof Function && W.attributeNameCheck(n, e)) || n === "is" && W.allowCustomizedBuiltInElements && (W.tagNameCheck instanceof RegExp && X(W.tagNameCheck, r) || W.tagNameCheck instanceof Function && W.tagNameCheck(r)))) return !1;
1871
- } else if (!Xe[n] && !X(ye, pt(r, _e, "")) && !((n === "src" || n === "xlink:href" || n === "href") && e !== "script" && mt(r, "data:") === 0 && qe[e]) && !(Oe && !X(he, pt(r, _e, ""))) && r) return !1;
1870
+ if (!(jn(e) && (W.tagNameCheck instanceof RegExp && Z(W.tagNameCheck, e) || W.tagNameCheck instanceof Function && W.tagNameCheck(e)) && (W.attributeNameCheck instanceof RegExp && Z(W.attributeNameCheck, n) || W.attributeNameCheck instanceof Function && W.attributeNameCheck(n, e)) || n === "is" && W.allowCustomizedBuiltInElements && (W.tagNameCheck instanceof RegExp && Z(W.tagNameCheck, r) || W.tagNameCheck instanceof Function && W.tagNameCheck(r)))) return !1;
1871
+ } else if (!Ye[n] && !Z(ye, pt(r, ve, "")) && !((n === "src" || n === "xlink:href" || n === "href") && e !== "script" && mt(r, "data:") === 0 && Ke[e]) && !(Oe && !Z(_e, pt(r, ve, ""))) && r) return !1;
1872
1872
  }
1873
1873
  return !0;
1874
1874
  }, An = addToSet({}, [
@@ -1881,11 +1881,11 @@ function createDOMPurify() {
1881
1881
  "font-face-uri",
1882
1882
  "missing-glyph"
1883
1883
  ]), jn = function _isBasicCustomElement(e) {
1884
- return !An[ut(e)] && X(ve, e);
1884
+ return !An[ut(e)] && Z(B, e);
1885
1885
  }, Mn = function _applyTrustedTypesToAttribute(e, t, n, r) {
1886
- if (T && typeof u == "object" && typeof u.getAttributeType == "function" && !n) switch (u.getAttributeType(e, t)) {
1887
- case "TrustedHTML": return j(r);
1888
- case "TrustedScriptURL": return ie(r);
1886
+ if (S && typeof u == "object" && typeof u.getAttributeType == "function" && !n) switch (u.getAttributeType(e, t)) {
1887
+ case "TrustedHTML": return k(r);
1888
+ case "TrustedScriptURL": return A(r);
1889
1889
  }
1890
1890
  return r;
1891
1891
  }, Nn = function _setAttributeValue(e, t, n, r) {
@@ -1895,7 +1895,7 @@ function createDOMPurify() {
1895
1895
  hn(t, e);
1896
1896
  }
1897
1897
  }, Pn = function _sanitizeAttributes(e) {
1898
- _executeHooks(R.beforeSanitizeAttributes, e, null);
1898
+ _executeHooks(F.beforeSanitizeAttributes, e, null);
1899
1899
  let t = e.attributes;
1900
1900
  if (!t || Cn(e)) return;
1901
1901
  let n = {
@@ -1907,7 +1907,7 @@ function createDOMPurify() {
1907
1907
  }, r = t.length, i = Q(e.nodeName);
1908
1908
  for (; r--;) {
1909
1909
  let a = t[r], o = a.name, s = a.namespaceURI, c = a.value, u = Q(o), f = c, p = o === "value" ? f : ht(f);
1910
- if (n.attrName = u, n.attrValue = p, n.keepAttr = !0, n.forceKeepAttr = void 0, _executeHooks(R.uponSanitizeAttribute, e, n), p = n.attrValue, Ve && (u === "id" || u === "name") && mt(p, G) !== 0 && (hn(o, e), p = G + p), je && X(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, p)) {
1910
+ if (n.attrName = u, n.attrValue = p, n.keepAttr = !0, n.forceKeepAttr = void 0, _executeHooks(F.uponSanitizeAttribute, e, n), p = n.attrValue, Be && (u === "id" || u === "name") && mt(p, K) !== 0 && (hn(o, e), p = K + p), Ae && Z(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, p)) {
1911
1911
  hn(o, e);
1912
1912
  continue;
1913
1913
  }
@@ -1920,25 +1920,25 @@ function createDOMPurify() {
1920
1920
  hn(o, e);
1921
1921
  continue;
1922
1922
  }
1923
- if (!ke && X(Kt, p)) {
1923
+ if (!ke && Z(Kt, p)) {
1924
1924
  hn(o, e);
1925
1925
  continue;
1926
1926
  }
1927
- if (Ae && (p = xn(p)), !kn(i, u, p)) {
1927
+ if (G && (p = xn(p)), !kn(i, u, p)) {
1928
1928
  hn(o, e);
1929
1929
  continue;
1930
1930
  }
1931
1931
  p = Mn(i, u, s, p), p !== f && Nn(e, o, s, p);
1932
1932
  }
1933
1933
  }
1934
- _executeHooks(R.afterSanitizeAttributes, e, null);
1934
+ _executeHooks(F.afterSanitizeAttributes, e, null);
1935
1935
  }, Fn = function _sanitizeShadowDOM(e) {
1936
1936
  let t = null, n = bn(e);
1937
- for (_executeHooks(R.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) if (_executeHooks(R.uponSanitizeShadowNode, t, null), On(t, e), Pn(t), wn(t.content) && Fn(t.content), (S ? S(t) : t.nodeType) === qt.element) {
1938
- let e = b(t);
1937
+ for (_executeHooks(F.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) if (_executeHooks(F.uponSanitizeShadowNode, t, null), On(t, e), Pn(t), wn(t.content) && Fn(t.content), (x ? x(t) : t.nodeType) === qt.element) {
1938
+ let e = te(t);
1939
1939
  wn(e) && (In(e), Fn(e));
1940
1940
  }
1941
- _executeHooks(R.afterSanitizeShadowDOM, e, null);
1941
+ _executeHooks(F.afterSanitizeShadowDOM, e, null);
1942
1942
  }, In = function _sanitizeAttachedShadowRoots(e) {
1943
1943
  let t = [{
1944
1944
  node: e,
@@ -1950,13 +1950,13 @@ function createDOMPurify() {
1950
1950
  Fn(e.shadow);
1951
1951
  continue;
1952
1952
  }
1953
- let n = e.node, r = (S ? S(n) : n.nodeType) === qt.element, i = _(n);
1953
+ let n = e.node, r = (x ? x(n) : n.nodeType) === qt.element, i = _(n);
1954
1954
  if (i) for (let e = i.length - 1; e >= 0; --e) t.push({
1955
1955
  node: i[e],
1956
1956
  shadow: null
1957
1957
  });
1958
1958
  if (r) {
1959
- let e = C ? C(n) : null;
1959
+ let e = ne ? ne(n) : null;
1960
1960
  if (typeof e == "string" && Q(e) === "template") {
1961
1961
  let e = n.content;
1962
1962
  wn(e) && t.push({
@@ -1966,7 +1966,7 @@ function createDOMPurify() {
1966
1966
  }
1967
1967
  }
1968
1968
  if (r) {
1969
- let e = b(n);
1969
+ let e = te(n);
1970
1970
  wn(e) && t.push({
1971
1971
  node: null,
1972
1972
  shadow: e
@@ -1979,13 +1979,13 @@ function createDOMPurify() {
1979
1979
  };
1980
1980
  return DOMPurify.sanitize = function(e) {
1981
1981
  let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = null, i = null, a = null, o = null;
1982
- if (gt = !e, gt && (e = "<!-->"), typeof e != "string" && !Tn(e) && (e = stringifyValue(e), typeof e != "string")) throw xt("dirty is not a string, aborting");
1982
+ if (nt = !e, nt && (e = "<!-->"), typeof e != "string" && !Tn(e) && (e = stringifyValue(e), typeof e != "string")) throw xt("dirty is not a string, aborting");
1983
1983
  if (!DOMPurify.isSupported) return e;
1984
- Ne ? (H = Pe, U = Fe) : on(t), (R.uponSanitizeElement.length > 0 || R.uponSanitizeAttribute.length > 0) && (H = clone(H)), R.uponSanitizeAttribute.length > 0 && (U = clone(U)), DOMPurify.removed = [];
1985
- let s = Ue && typeof e != "string" && Tn(e);
1984
+ Me ? (H = Ne, U = Pe) : on(t), (F.uponSanitizeElement.length > 0 || F.uponSanitizeAttribute.length > 0) && (H = clone(H)), F.uponSanitizeAttribute.length > 0 && (U = clone(U)), DOMPurify.removed = [];
1985
+ let s = He && typeof e != "string" && Tn(e);
1986
1986
  if (s) {
1987
1987
  vn(e);
1988
- let t = C ? C(e) : e.nodeName;
1988
+ let t = ne ? ne(e) : e.nodeName;
1989
1989
  if (typeof t == "string") {
1990
1990
  let n = Q(t);
1991
1991
  if (!H[n] || Ce[n]) throw mn(e), xt("root node is forbidden and cannot be sanitized in-place");
@@ -1998,10 +1998,10 @@ function createDOMPurify() {
1998
1998
  }
1999
1999
  } else if (Tn(e)) r = yn("<!---->"), i = r.ownerDocument.importNode(e, !0), i.nodeType === qt.element && i.nodeName === "BODY" || i.nodeName === "HTML" ? r = i : r.appendChild(i), In(i);
2000
2000
  else {
2001
- if (!Le && !Ae && !Me && e.indexOf("<") === -1) return T && ze ? j(e) : e;
2002
- if (r = yn(e), !r) return Le ? null : ze ? te : "";
2001
+ if (!Ie && !G && !je && e.indexOf("<") === -1) return S && Re ? k(e) : e;
2002
+ if (r = yn(e), !r) return Ie ? null : Re ? C : "";
2003
2003
  }
2004
- r && Ie && pn(r.firstChild);
2004
+ r && Fe && pn(r.firstChild);
2005
2005
  let c = s ? e : r, u = bn(c);
2006
2006
  try {
2007
2007
  for (; a = u.nextNode();) On(a, c), Pn(a), wn(a.content) && Fn(a.content);
@@ -2012,37 +2012,37 @@ function createDOMPurify() {
2012
2012
  }
2013
2013
  if (s) return rt(DOMPurify.removed, (e) => {
2014
2014
  e.element && _n(e.element);
2015
- }), Ae && Sn(e), e;
2016
- if (Le) {
2017
- if (Ae && Sn(r), Re) for (o = I.call(r.ownerDocument); r.firstChild;) o.appendChild(r.firstChild);
2015
+ }), G && Sn(e), e;
2016
+ if (Ie) {
2017
+ if (G && Sn(r), Le) for (o = ce.call(r.ownerDocument); r.firstChild;) o.appendChild(r.firstChild);
2018
2018
  else o = r;
2019
- return (U.shadowroot || U.shadowrootmode) && (o = ce.call(n, o, !0)), o;
2019
+ return (U.shadowroot || U.shadowrootmode) && (o = de.call(n, o, !0)), o;
2020
2020
  }
2021
- let f = Me ? r.outerHTML : r.innerHTML;
2022
- return Me && H["!doctype"] && r.ownerDocument && r.ownerDocument.doctype && r.ownerDocument.doctype.name && X(Vt, r.ownerDocument.doctype.name) && (f = "<!DOCTYPE " + r.ownerDocument.doctype.name + ">\n" + f), Ae && (f = xn(f)), T && ze ? j(f) : f;
2021
+ let f = je ? r.outerHTML : r.innerHTML;
2022
+ return je && H["!doctype"] && r.ownerDocument && r.ownerDocument.doctype && r.ownerDocument.doctype.name && Z(Vt, r.ownerDocument.doctype.name) && (f = "<!DOCTYPE " + r.ownerDocument.doctype.name + ">\n" + f), G && (f = xn(f)), S && Re ? k(f) : f;
2023
2023
  }, DOMPurify.setConfig = function() {
2024
2024
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2025
- on(e), Ne = !0, Pe = H, Fe = U;
2025
+ on(e), Me = !0, Ne = H, Pe = U;
2026
2026
  }, DOMPurify.clearConfig = function() {
2027
- nn = null, Ne = !1, Pe = null, Fe = null, T = ne, te = "";
2027
+ nn = null, Me = !1, Ne = null, Pe = null, S = re, C = "";
2028
2028
  }, DOMPurify.isValidAttribute = function(e, t, n) {
2029
2029
  nn || on({});
2030
2030
  let r = Q(e), i = Q(t);
2031
2031
  return kn(r, i, n);
2032
2032
  }, DOMPurify.addHook = function(e, t) {
2033
- typeof t == "function" && J(R, e) && st(R[e], t);
2033
+ typeof t == "function" && X(F, e) && st(F[e], t);
2034
2034
  }, DOMPurify.removeHook = function(e, t) {
2035
- if (J(R, e)) {
2035
+ if (X(F, e)) {
2036
2036
  if (t !== void 0) {
2037
- let n = it(R[e], t);
2038
- return n === -1 ? void 0 : ct(R[e], n, 1)[0];
2037
+ let n = it(F[e], t);
2038
+ return n === -1 ? void 0 : ct(F[e], n, 1)[0];
2039
2039
  }
2040
- return at(R[e]);
2040
+ return at(F[e]);
2041
2041
  }
2042
2042
  }, DOMPurify.removeHooks = function(e) {
2043
- J(R, e) && (R[e] = []);
2043
+ X(F, e) && (F[e] = []);
2044
2044
  }, DOMPurify.removeAllHooks = function() {
2045
- R = Xt();
2045
+ F = Xt();
2046
2046
  }, DOMPurify;
2047
2047
  }
2048
2048
  var Qt = createDOMPurify(), _Class;
@@ -2076,7 +2076,7 @@ function d(e, t = "") {
2076
2076
  let n = typeof e == "string" ? e : e.source, r = {
2077
2077
  replace: (e, t) => {
2078
2078
  let i = typeof t == "string" ? t : t.source;
2079
- return i = i.replace(Z.caret, "$1"), n = n.replace(e, i), r;
2079
+ return i = i.replace(Q.caret, "$1"), n = n.replace(e, i), r;
2080
2080
  },
2081
2081
  getRegex: () => new RegExp(n, t)
2082
2082
  };
@@ -2088,7 +2088,7 @@ var tn = ((e = "") => {
2088
2088
  } catch {
2089
2089
  return !1;
2090
2090
  }
2091
- })(), Z = {
2091
+ })(), Q = {
2092
2092
  codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm,
2093
2093
  outputLinkReplace: /\\([\[\]])/g,
2094
2094
  indentCodeCompensation: /^(\s+)(?:```)/,
@@ -2145,112 +2145,112 @@ var tn = ((e = "") => {
2145
2145
  headingBeginRegex: E((e) => RegExp(`^ {0,${e}}#`)),
2146
2146
  htmlBeginRegex: E((e) => RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`, "i")),
2147
2147
  blockquoteBeginRegex: E((e) => RegExp(`^ {0,${e}}>`))
2148
- }, Q = /^(?:[ \t]*(?:\n|$))+/, nn = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, rn = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, an = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, on = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, sn = / {0,3}(?:[*+-]|\d{1,9}[.)])/, cn = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, ln = d(cn).replace(/bull/g, sn).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(), un = d(cn).replace(/bull/g, sn).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), dn = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, fn = /^[^\n]+/, pn = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, mn = d(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", pn).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), hn = d(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, sn).getRegex(), gn = "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", _n = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, vn = d("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n+|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n+|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\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", _n).replace("tag", gn).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), le = (e) => d(dn).replace("hr", an).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", e).replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", gn).getRegex(), yn = le(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/), bn = le(/ {0,3}(?:[*+-]|\d{1,9}[.)])[ \t]+[^ \t\n]/), xn = {
2149
- blockquote: d(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", bn).getRegex(),
2150
- code: nn,
2151
- def: mn,
2152
- fences: rn,
2153
- heading: on,
2154
- hr: an,
2155
- html: vn,
2156
- lheading: ln,
2157
- list: hn,
2158
- newline: Q,
2159
- paragraph: yn,
2160
- table: en,
2161
- text: fn
2162
- }, Sn = d("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", an).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", gn).getRegex(), Cn = {
2163
- ...xn,
2148
+ }, nn = /^(?:[ \t]*(?:\n|$))+/, rn = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, an = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, on = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, sn = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, cn = / {0,3}(?:[*+-]|\d{1,9}[.)])/, ln = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, un = d(ln).replace(/bull/g, cn).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), dn = d(ln).replace(/bull/g, cn).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), fn = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, pn = /^[^\n]+/, mn = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, hn = d(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", mn).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), gn = d(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, cn).getRegex(), _n = "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", vn = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, yn = d("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n+|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n+|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\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", vn).replace("tag", _n).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), le = (e) => d(fn).replace("hr", on).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", e).replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", _n).getRegex(), bn = le(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/), xn = le(/ {0,3}(?:[*+-]|\d{1,9}[.)])[ \t]+[^ \t\n]/), Sn = {
2149
+ blockquote: d(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", xn).getRegex(),
2150
+ code: rn,
2151
+ def: hn,
2152
+ fences: an,
2153
+ heading: sn,
2154
+ hr: on,
2155
+ html: yn,
2164
2156
  lheading: un,
2165
- table: Sn,
2166
- paragraph: d(dn).replace("hr", an).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Sn).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", gn).getRegex()
2167
- }, wn = {
2168
- ...xn,
2169
- html: d("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", _n).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(),
2157
+ list: gn,
2158
+ newline: nn,
2159
+ paragraph: bn,
2160
+ table: en,
2161
+ text: pn
2162
+ }, Cn = d("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", on).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", _n).getRegex(), wn = {
2163
+ ...Sn,
2164
+ lheading: dn,
2165
+ table: Cn,
2166
+ paragraph: d(fn).replace("hr", on).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Cn).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", _n).getRegex()
2167
+ }, Tn = {
2168
+ ...Sn,
2169
+ html: d("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", vn).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(),
2170
2170
  def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
2171
2171
  heading: /^(#{1,6})(.*)(?:\n+|$)/,
2172
2172
  fences: en,
2173
2173
  lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
2174
- paragraph: d(dn).replace("hr", an).replace("heading", " *#{1,6} *[^\n]").replace("lheading", ln).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
2175
- }, Tn = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, En = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Dn = /^( {2,}|\\)\n(?!\s*$)/, On = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, kn = /[\p{P}\p{S}]/u, An = /[\s\p{P}\p{S}]/u, jn = /[^\s\p{P}\p{S}]/u, Mn = d(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, An).getRegex(), Nn = /(?!~)[\p{P}\p{S}]/u, Pn = /(?!~)[\s\p{P}\p{S}]/u, Fn = /(?:[^\s\p{P}\p{S}]|~)/u, In = d(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", tn ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), Ln = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, Rn = d(Ln, "u").replace(/punct/g, kn).getRegex(), zn = d(Ln, "u").replace(/punct/g, Nn).getRegex(), Bn = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Vn = d(Bn, "gu").replace(/notPunctSpace/g, jn).replace(/punctSpace/g, An).replace(/punct/g, kn).getRegex(), Hn = d(Bn, "gu").replace(/notPunctSpace/g, Fn).replace(/punctSpace/g, Pn).replace(/punct/g, Nn).getRegex(), Un = d("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, jn).replace(/punctSpace/g, An).replace(/punct/g, kn).getRegex(), Wn = d(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, kn).getRegex(), Gn = d("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, jn).replace(/punctSpace/g, An).replace(/punct/g, kn).getRegex(), Kn = d(/\\(punct)/, "gu").replace(/punct/g, kn).getRegex(), qn = 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(), Jn = d(_n).replace("(?:-->|$)", "-->").getRegex(), Yn = 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", Jn).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), Xn = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, Zn = d(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", Xn).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), Qn = d(/^!?\[(label)\]\[(ref)\]/).replace("label", Xn).replace("ref", pn).getRegex(), $n = d(/^!?\[(ref)\](?:\[\])?/).replace("ref", pn).getRegex(), er = d("reflink|nolink(?!\\()", "g").replace("reflink", Qn).replace("nolink", $n).getRegex(), tr = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, nr = {
2174
+ paragraph: d(fn).replace("hr", on).replace("heading", " *#{1,6} *[^\n]").replace("lheading", un).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
2175
+ }, En = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Dn = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, On = /^( {2,}|\\)\n(?!\s*$)/, kn = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, An = /[\p{P}\p{S}]/u, jn = /[\s\p{P}\p{S}]/u, Mn = /[^\s\p{P}\p{S}]/u, Nn = d(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, jn).getRegex(), Pn = /(?!~)[\p{P}\p{S}]/u, Fn = /(?!~)[\s\p{P}\p{S}]/u, In = /(?:[^\s\p{P}\p{S}]|~)/u, Ln = d(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", tn ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), Rn = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, zn = d(Rn, "u").replace(/punct/g, An).getRegex(), Bn = d(Rn, "u").replace(/punct/g, Pn).getRegex(), Vn = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Hn = d(Vn, "gu").replace(/notPunctSpace/g, Mn).replace(/punctSpace/g, jn).replace(/punct/g, An).getRegex(), Un = d(Vn, "gu").replace(/notPunctSpace/g, In).replace(/punctSpace/g, Fn).replace(/punct/g, Pn).getRegex(), Wn = d("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, Mn).replace(/punctSpace/g, jn).replace(/punct/g, An).getRegex(), Gn = d(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, An).getRegex(), Kn = d("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Mn).replace(/punctSpace/g, jn).replace(/punct/g, An).getRegex(), qn = d(/\\(punct)/, "gu").replace(/punct/g, An).getRegex(), Jn = 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(), Yn = d(vn).replace("(?:-->|$)", "-->").getRegex(), Xn = 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", Yn).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), Zn = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, Qn = d(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", Zn).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), $n = d(/^!?\[(label)\]\[(ref)\]/).replace("label", Zn).replace("ref", mn).getRegex(), er = d(/^!?\[(ref)\](?:\[\])?/).replace("ref", mn).getRegex(), tr = d("reflink|nolink(?!\\()", "g").replace("reflink", $n).replace("nolink", er).getRegex(), nr = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, rr = {
2176
2176
  _backpedal: en,
2177
- anyPunctuation: Kn,
2178
- autolink: qn,
2179
- blockSkip: In,
2180
- br: Dn,
2181
- code: En,
2177
+ anyPunctuation: qn,
2178
+ autolink: Jn,
2179
+ blockSkip: Ln,
2180
+ br: On,
2181
+ code: Dn,
2182
2182
  del: en,
2183
2183
  delLDelim: en,
2184
2184
  delRDelim: en,
2185
- emStrongLDelim: Rn,
2186
- emStrongRDelimAst: Vn,
2187
- emStrongRDelimUnd: Un,
2188
- escape: Tn,
2189
- link: Zn,
2190
- nolink: $n,
2191
- punctuation: Mn,
2192
- reflink: Qn,
2193
- reflinkSearch: er,
2194
- tag: Yn,
2195
- text: On,
2185
+ emStrongLDelim: zn,
2186
+ emStrongRDelimAst: Hn,
2187
+ emStrongRDelimUnd: Wn,
2188
+ escape: En,
2189
+ link: Qn,
2190
+ nolink: er,
2191
+ punctuation: Nn,
2192
+ reflink: $n,
2193
+ reflinkSearch: tr,
2194
+ tag: Xn,
2195
+ text: kn,
2196
2196
  url: en
2197
- }, rr = {
2198
- ...nr,
2199
- link: d(/^!?\[(label)\]\((.*?)\)/).replace("label", Xn).getRegex(),
2200
- reflink: d(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", Xn).getRegex()
2201
2197
  }, ir = {
2202
- ...nr,
2203
- emStrongRDelimAst: Hn,
2204
- emStrongLDelim: zn,
2205
- delLDelim: Wn,
2206
- delRDelim: Gn,
2207
- url: d(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", tr).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
2198
+ ...rr,
2199
+ link: d(/^!?\[(label)\]\((.*?)\)/).replace("label", Zn).getRegex(),
2200
+ reflink: d(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", Zn).getRegex()
2201
+ }, ar = {
2202
+ ...rr,
2203
+ emStrongRDelimAst: Un,
2204
+ emStrongLDelim: Bn,
2205
+ delLDelim: Gn,
2206
+ delRDelim: Kn,
2207
+ url: d(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", nr).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
2208
2208
  _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
2209
2209
  del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
2210
- 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", tr).getRegex()
2211
- }, ar = {
2212
- ...ir,
2213
- br: d(Dn).replace("{2,}", "*").getRegex(),
2214
- text: d(ir.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
2210
+ 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", nr).getRegex()
2215
2211
  }, or = {
2216
- normal: xn,
2217
- gfm: Cn,
2218
- pedantic: wn
2212
+ ...ar,
2213
+ br: d(On).replace("{2,}", "*").getRegex(),
2214
+ text: d(ar.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
2219
2215
  }, sr = {
2220
- normal: nr,
2221
- gfm: ir,
2222
- breaks: ar,
2223
- pedantic: rr
2216
+ normal: Sn,
2217
+ gfm: wn,
2218
+ pedantic: Tn
2224
2219
  }, cr = {
2220
+ normal: rr,
2221
+ gfm: ar,
2222
+ breaks: or,
2223
+ pedantic: ir
2224
+ }, lr = {
2225
2225
  "&": "&amp;",
2226
2226
  "<": "&lt;",
2227
2227
  ">": "&gt;",
2228
2228
  "\"": "&quot;",
2229
2229
  "'": "&#39;"
2230
- }, ge = (e) => cr[e];
2230
+ }, ge = (e) => lr[e];
2231
2231
  function O(e, t) {
2232
2232
  if (t) {
2233
- if (Z.escapeTest.test(e)) return e.replace(Z.escapeReplace, ge);
2234
- } else if (Z.escapeTestNoEncode.test(e)) return e.replace(Z.escapeReplaceNoEncode, ge);
2233
+ if (Q.escapeTest.test(e)) return e.replace(Q.escapeReplace, ge);
2234
+ } else if (Q.escapeTestNoEncode.test(e)) return e.replace(Q.escapeReplaceNoEncode, ge);
2235
2235
  return e;
2236
2236
  }
2237
2237
  function V(e) {
2238
2238
  try {
2239
- e = encodeURI(e).replace(Z.percentDecode, "%");
2239
+ e = encodeURI(e).replace(Q.percentDecode, "%");
2240
2240
  } catch {
2241
2241
  return null;
2242
2242
  }
2243
2243
  return e;
2244
2244
  }
2245
2245
  function Y(e, t) {
2246
- let n = e.replace(Z.findPipe, (e, t, n) => {
2246
+ let n = e.replace(Q.findPipe, (e, t, n) => {
2247
2247
  let r = !1, i = t;
2248
2248
  for (; --i >= 0 && n[i] === "\\";) r = !r;
2249
2249
  return r ? "|" : " |";
2250
- }).split(Z.splitPipe), r = 0;
2250
+ }).split(Q.splitPipe), r = 0;
2251
2251
  if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), t) if (n.length > t) n.splice(t);
2252
2252
  else for (; n.length < t;) n.push("");
2253
- for (; r < n.length; r++) n[r] = n[r].trim().replace(Z.slashPipe, "|");
2253
+ for (; r < n.length; r++) n[r] = n[r].trim().replace(Q.slashPipe, "|");
2254
2254
  return n;
2255
2255
  }
2256
2256
  function $(e, t, n) {
@@ -2267,7 +2267,7 @@ function $(e, t, n) {
2267
2267
  }
2268
2268
  function ee(e) {
2269
2269
  let t = e.split("\n"), n = t.length - 1;
2270
- for (; n >= 0 && Z.blankLine.test(t[n]);) n--;
2270
+ for (; n >= 0 && Q.blankLine.test(t[n]);) n--;
2271
2271
  return t.length - n <= 2 ? e : t.slice(0, n + 1).join("\n");
2272
2272
  }
2273
2273
  function fe(e, t) {
@@ -2762,7 +2762,7 @@ ${c}` : c;
2762
2762
  };
2763
2763
  }
2764
2764
  }
2765
- }, lr = class l {
2765
+ }, ur = class l {
2766
2766
  constructor(t) {
2767
2767
  e(this, "tokens", void 0), e(this, "options", void 0), e(this, "state", void 0), e(this, "inlineQueue", void 0), e(this, "tokenizer", void 0), this.tokens = [], this.tokens.links = Object.create(null), this.options = t || $t, this.options.tokenizer = this.options.tokenizer || new w(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
2768
2768
  inLink: !1,
@@ -2770,16 +2770,16 @@ ${c}` : c;
2770
2770
  top: !0
2771
2771
  };
2772
2772
  let n = {
2773
- other: Z,
2774
- block: or.normal,
2775
- inline: sr.normal
2773
+ other: Q,
2774
+ block: sr.normal,
2775
+ inline: cr.normal
2776
2776
  };
2777
- this.options.pedantic ? (n.block = or.pedantic, n.inline = sr.pedantic) : this.options.gfm && (n.block = or.gfm, this.options.breaks ? n.inline = sr.breaks : n.inline = sr.gfm), this.tokenizer.rules = n;
2777
+ this.options.pedantic ? (n.block = sr.pedantic, n.inline = cr.pedantic) : this.options.gfm && (n.block = sr.gfm, this.options.breaks ? n.inline = cr.breaks : n.inline = cr.gfm), this.tokenizer.rules = n;
2778
2778
  }
2779
2779
  static get rules() {
2780
2780
  return {
2781
- block: or,
2782
- inline: sr
2781
+ block: sr,
2782
+ inline: cr
2783
2783
  };
2784
2784
  }
2785
2785
  static lex(e, t) {
@@ -2789,7 +2789,7 @@ ${c}` : c;
2789
2789
  return new l(t).inlineTokens(e);
2790
2790
  }
2791
2791
  lex(e) {
2792
- e = e.replace(Z.carriageReturn, "\n"), this.blockTokens(e, this.tokens);
2792
+ e = e.replace(Q.carriageReturn, "\n"), this.blockTokens(e, this.tokens);
2793
2793
  for (let e = 0; e < this.inlineQueue.length; e++) {
2794
2794
  let t = this.inlineQueue[e];
2795
2795
  this.inlineTokens(t.src, t.tokens);
@@ -2797,7 +2797,7 @@ ${c}` : c;
2797
2797
  return this.inlineQueue = [], this.tokens;
2798
2798
  }
2799
2799
  blockTokens(e, t = [], n = !1) {
2800
- this.tokenizer.lexer = this, this.options.pedantic && (e = e.replace(Z.tabCharGlobal, " ").replace(Z.spaceLine, ""));
2800
+ this.tokenizer.lexer = this, this.options.pedantic && (e = e.replace(Q.tabCharGlobal, " ").replace(Q.spaceLine, ""));
2801
2801
  let r = Infinity;
2802
2802
  for (; e;) {
2803
2803
  if (e.length < r) r = e.length;
@@ -2987,7 +2987,7 @@ ${c}` : c;
2987
2987
  return "";
2988
2988
  }
2989
2989
  code({ text: e, lang: t, escaped: n }) {
2990
- let r = (t || "").match(Z.notSpaceStart)?.[0], i = e.replace(Z.endingNewline, "") + "\n";
2990
+ let r = (t || "").match(Q.notSpaceStart)?.[0], i = e.replace(Q.endingNewline, "") + "\n";
2991
2991
  return r ? "<pre><code class=\"language-" + O(r) + "\">" + (n ? i : O(i, !0)) + "</code></pre>\n" : "<pre><code>" + (n ? i : O(i, !0)) + "</code></pre>\n";
2992
2992
  }
2993
2993
  blockquote({ tokens: e }) {
@@ -3115,7 +3115,7 @@ ${e}</tr>
3115
3115
  checkbox({ raw: e }) {
3116
3116
  return e;
3117
3117
  }
3118
- }, ur = class l {
3118
+ }, dr = class l {
3119
3119
  constructor(t) {
3120
3120
  e(this, "options", void 0), e(this, "renderer", void 0), e(this, "textRenderer", void 0), this.options = t || $t, this.options.renderer = this.options.renderer || new y(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new L();
3121
3121
  }
@@ -3263,7 +3263,7 @@ ${e}</tr>
3263
3263
  }
3264
3264
  return n;
3265
3265
  }
3266
- }, dr = (_Class = class {
3266
+ }, fr = (_Class = class {
3267
3267
  constructor(t) {
3268
3268
  e(this, "options", void 0), e(this, "block", void 0), this.options = t || $t;
3269
3269
  }
@@ -3280,10 +3280,10 @@ ${e}</tr>
3280
3280
  return e;
3281
3281
  }
3282
3282
  provideLexer(e = this.block) {
3283
- return e ? lr.lex : lr.lexInline;
3283
+ return e ? ur.lex : ur.lexInline;
3284
3284
  }
3285
3285
  provideParser(e = this.block) {
3286
- return e ? ur.parse : ur.parseInline;
3286
+ return e ? dr.parse : dr.parseInline;
3287
3287
  }
3288
3288
  }, e(_Class, "passThroughHooks", /* @__PURE__ */ new Set([
3289
3289
  "preprocess",
@@ -3296,7 +3296,7 @@ ${e}</tr>
3296
3296
  "processAllTokens"
3297
3297
  ])), _Class), D = class {
3298
3298
  constructor(...t) {
3299
- e(this, "defaults", M()), e(this, "options", this.setOptions), e(this, "parse", this.parseMarkdown(!0)), e(this, "parseInline", this.parseMarkdown(!1)), e(this, "Parser", ur), e(this, "Renderer", y), e(this, "TextRenderer", L), e(this, "Lexer", lr), e(this, "Tokenizer", w), e(this, "Hooks", dr), this.use(...t);
3299
+ e(this, "defaults", M()), e(this, "options", this.setOptions), e(this, "parse", this.parseMarkdown(!0)), e(this, "parseInline", this.parseMarkdown(!1)), e(this, "Parser", dr), e(this, "Renderer", y), e(this, "TextRenderer", L), e(this, "Lexer", ur), e(this, "Tokenizer", w), e(this, "Hooks", fr), this.use(...t);
3300
3300
  }
3301
3301
  walkTokens(e, t) {
3302
3302
  let n = [];
@@ -3375,13 +3375,13 @@ ${e}</tr>
3375
3375
  n.tokenizer = t;
3376
3376
  }
3377
3377
  if (e.hooks) {
3378
- let t = this.defaults.hooks || new dr();
3378
+ let t = this.defaults.hooks || new fr();
3379
3379
  for (let n in e.hooks) {
3380
3380
  if (!(n in t)) throw Error(`hook '${n}' does not exist`);
3381
3381
  if (["options", "block"].includes(n)) continue;
3382
3382
  let r = n, i = e.hooks[r], a = t[r];
3383
- dr.passThroughHooks.has(n) ? t[r] = (e) => {
3384
- if (this.defaults.async && dr.passThroughHooksRespectAsync.has(n)) return (async () => {
3383
+ fr.passThroughHooks.has(n) ? t[r] = (e) => {
3384
+ if (this.defaults.async && fr.passThroughHooksRespectAsync.has(n)) return (async () => {
3385
3385
  let n = await i.call(t, e);
3386
3386
  return a.call(t, n);
3387
3387
  })();
@@ -3418,10 +3418,10 @@ ${e}</tr>
3418
3418
  }, this;
3419
3419
  }
3420
3420
  lexer(e, t) {
3421
- return lr.lex(e, t ?? this.defaults);
3421
+ return ur.lex(e, t ?? this.defaults);
3422
3422
  }
3423
3423
  parser(e, t) {
3424
- return ur.parse(e, t ?? this.defaults);
3424
+ return dr.parse(e, t ?? this.defaults);
3425
3425
  }
3426
3426
  parseMarkdown(e) {
3427
3427
  return (t, n) => {
@@ -3433,16 +3433,16 @@ ${e}</tr>
3433
3433
  if (typeof t > "u" || t === null) return a(/* @__PURE__ */ Error("marked(): input parameter is undefined or null"));
3434
3434
  if (typeof t != "string") return a(/* @__PURE__ */ Error("marked(): input parameter is of type " + Object.prototype.toString.call(t) + ", string expected"));
3435
3435
  if (i.hooks && (i.hooks.options = i, i.hooks.block = e), i.async) return (async () => {
3436
- let n = i.hooks ? await i.hooks.preprocess(t) : t, r = await (i.hooks ? await i.hooks.provideLexer(e) : e ? lr.lex : lr.lexInline)(n, i), a = i.hooks ? await i.hooks.processAllTokens(r) : r;
3436
+ let n = i.hooks ? await i.hooks.preprocess(t) : t, r = await (i.hooks ? await i.hooks.provideLexer(e) : e ? ur.lex : ur.lexInline)(n, i), a = i.hooks ? await i.hooks.processAllTokens(r) : r;
3437
3437
  i.walkTokens && await Promise.all(this.walkTokens(a, i.walkTokens));
3438
- let o = await (i.hooks ? await i.hooks.provideParser(e) : e ? ur.parse : ur.parseInline)(a, i);
3438
+ let o = await (i.hooks ? await i.hooks.provideParser(e) : e ? dr.parse : dr.parseInline)(a, i);
3439
3439
  return i.hooks ? await i.hooks.postprocess(o) : o;
3440
3440
  })().catch(a);
3441
3441
  try {
3442
3442
  i.hooks && (t = i.hooks.preprocess(t));
3443
- let n = (i.hooks ? i.hooks.provideLexer(e) : e ? lr.lex : lr.lexInline)(t, i);
3443
+ let n = (i.hooks ? i.hooks.provideLexer(e) : e ? ur.lex : ur.lexInline)(t, i);
3444
3444
  i.hooks && (n = i.hooks.processAllTokens(n)), i.walkTokens && this.walkTokens(n, i.walkTokens);
3445
- let r = (i.hooks ? i.hooks.provideParser(e) : e ? ur.parse : ur.parseInline)(n, i);
3445
+ let r = (i.hooks ? i.hooks.provideParser(e) : e ? dr.parse : dr.parseInline)(n, i);
3446
3446
  return i.hooks && (r = i.hooks.postprocess(r)), r;
3447
3447
  } catch (e) {
3448
3448
  return a(e);
@@ -3459,25 +3459,83 @@ ${e}</tr>
3459
3459
  throw n;
3460
3460
  };
3461
3461
  }
3462
- }, fr = new D();
3462
+ }, pr = new D();
3463
3463
  function g(e, t) {
3464
- return fr.parse(e, t);
3464
+ return pr.parse(e, t);
3465
3465
  }
3466
3466
  g.options = g.setOptions = function(e) {
3467
- return fr.setOptions(e), g.defaults = fr.defaults, N(g.defaults), g;
3467
+ return pr.setOptions(e), g.defaults = pr.defaults, N(g.defaults), g;
3468
3468
  }, g.getDefaults = M, g.defaults = $t, g.use = function(...e) {
3469
- return fr.use(...e), g.defaults = fr.defaults, N(g.defaults), g;
3469
+ return pr.use(...e), g.defaults = pr.defaults, N(g.defaults), g;
3470
3470
  }, g.walkTokens = function(e, t) {
3471
- return fr.walkTokens(e, t);
3472
- }, g.parseInline = fr.parseInline, g.Parser = ur, g.parser = ur.parse, g.Renderer = y, g.TextRenderer = L, g.Lexer = lr, g.lexer = lr.lex, g.Tokenizer = w, g.Hooks = dr, g.parse = g, g.options, g.setOptions, g.use, g.walkTokens, g.parseInline, ur.parse, lr.lex;
3471
+ return pr.walkTokens(e, t);
3472
+ }, g.parseInline = pr.parseInline, g.Parser = dr, g.parser = dr.parse, g.Renderer = y, g.TextRenderer = L, g.Lexer = ur, g.lexer = ur.lex, g.Tokenizer = w, g.Hooks = fr, g.parse = g, g.options, g.setOptions, g.use, g.walkTokens, g.parseInline, dr.parse, ur.lex;
3473
3473
  //#endregion
3474
- //#region agent/ui/chat-diagram-layout.ts
3475
- var pr = 112, mr = 52, hr = 14, gr = 54, _r = 34, vr = 260;
3474
+ //#region agent/ui/ChatCardBlock.vue?vue&type=script&setup=true&lang.ts
3475
+ var mr = ["aria-label"], hr = ["innerHTML"], gr = ["onClick"], _r = /* @__PURE__ */ x({
3476
+ __name: "ChatCardBlock",
3477
+ props: {
3478
+ spec: {},
3479
+ inverted: { type: Boolean }
3480
+ },
3481
+ emits: ["action"],
3482
+ setup(e, { emit: t }) {
3483
+ let n = e, r = t, i = p(() => {
3484
+ if (!n.spec.body) return "";
3485
+ let e = g.parse(n.spec.body, { async: !1 });
3486
+ return Qt.sanitize(e, { ADD_ATTR: ["target"] });
3487
+ }), a = p(() => n.inverted ? "rgba(255, 255, 255, 0.16)" : "rgba(0, 0, 0, 0.1)"), o = p(() => n.inverted ? "rgba(255, 255, 255, 0.12)" : "color-mix(in oklch, var(--color-theme-200) 80%, transparent)"), s = p(() => n.inverted ? "rgba(255, 255, 255, 0.95)" : "var(--color-theme-900)"), c = p(() => n.inverted ? "rgba(255, 255, 255, 0.8)" : "var(--color-theme-800)"), u = p(() => n.inverted ? `inset 0 0 0 1px ${a.value}` : `inset 0 0 0 1px ${a.value}, 0 1px 2px rgba(15, 23, 42, 0.04), 0 6px 20px rgba(15, 23, 42, 0.05)`);
3488
+ function actionStyle(e) {
3489
+ return e === "primary" ? {
3490
+ background: n.inverted ? "rgba(255, 255, 255, 0.92)" : "var(--color-theme-900)",
3491
+ color: n.inverted ? "var(--color-theme-900)" : "#fff"
3492
+ } : e === "destructive" ? {
3493
+ background: "transparent",
3494
+ color: "#D93025"
3495
+ } : {
3496
+ background: "transparent",
3497
+ color: s.value
3498
+ };
3499
+ }
3500
+ return (t, n) => (T(), _("div", {
3501
+ "data-test": "chat-card",
3502
+ class: "my-6 w-full max-w-[55ch] self-start overflow-hidden rounded-[20px]",
3503
+ style: C({ boxShadow: u.value }),
3504
+ "aria-label": e.spec.title
3505
+ }, [
3506
+ v("div", {
3507
+ class: "px-4 pb-3 pt-3.5",
3508
+ style: C(i.value ? { borderBottom: `1px solid ${o.value}` } : void 0)
3509
+ }, [v("div", {
3510
+ class: "text-[14px] font-semibold leading-tight",
3511
+ style: C({ color: s.value })
3512
+ }, P(e.spec.title), 5)], 4),
3513
+ i.value ? (T(), _("div", {
3514
+ key: 0,
3515
+ class: "chat-msg-prose px-4 py-3.5 text-[14px] leading-relaxed",
3516
+ style: C({ color: c.value }),
3517
+ innerHTML: i.value
3518
+ }, null, 12, hr)) : h("", !0),
3519
+ e.spec.actions?.length ? (T(), _("div", {
3520
+ key: 1,
3521
+ class: "flex flex-wrap items-center gap-2 px-3 py-2.5",
3522
+ style: C({ borderTop: `1px solid ${o.value}` })
3523
+ }, [(T(!0), _(f, null, A(e.spec.actions, (e) => (T(), _("button", {
3524
+ key: e.label,
3525
+ type: "button",
3526
+ "data-test": "chat-card-action",
3527
+ class: "inline-flex h-10 items-center justify-center rounded-full px-5 text-[14px] font-semibold transition-colors duration-150 active:opacity-80",
3528
+ style: C(actionStyle(e.style)),
3529
+ onClick: (t) => r("action", e.reply)
3530
+ }, P(e.label), 13, gr))), 128))], 4)) : h("", !0)
3531
+ ], 12, mr));
3532
+ }
3533
+ }), vr = 112, yr = 52, br = 14, xr = 54, Sr = 34, Cr = 260;
3476
3534
  function nodeWidthFor(e) {
3477
3535
  let { orientation: t, maxRows: n, maxWidth: r } = e;
3478
- if (t === "horizontal" || !r) return pr;
3479
- let i = r - hr * 2 - (n - 1) * gr;
3480
- return Math.min(vr, Math.max(pr, Math.floor(i / n)));
3536
+ if (t === "horizontal" || !r) return vr;
3537
+ let i = r - br * 2 - (n - 1) * xr;
3538
+ return Math.min(Cr, Math.max(vr, Math.floor(i / n)));
3481
3539
  }
3482
3540
  function orientationFor(e) {
3483
3541
  return e.layout === "left-to-right" || e.layout === "radial" ? "horizontal" : e.layout === "top-to-bottom" ? "vertical" : e.diagramType === "sequence" ? "horizontal" : "vertical";
@@ -3514,11 +3572,11 @@ function buildLayout(e, t, n) {
3514
3572
  orientation: t,
3515
3573
  maxRows: o,
3516
3574
  ...n === void 0 ? {} : { maxWidth: n }
3517
- }), u = t === "horizontal" ? hr * 2 + s * c + (s - 1) * gr : hr * 2 + o * c + (o - 1) * gr, f = t === "horizontal" ? hr * 2 + o * mr + (o - 1) * _r : hr * 2 + s * mr + (s - 1) * _r, p = [];
3575
+ }), u = t === "horizontal" ? br * 2 + s * c + (s - 1) * xr : br * 2 + o * c + (o - 1) * xr, f = t === "horizontal" ? br * 2 + o * yr + (o - 1) * Sr : br * 2 + s * yr + (s - 1) * Sr, p = [];
3518
3576
  for (let [e, [, n]] of a.entries()) {
3519
- let r = (o - n.length) * (t === "horizontal" ? 86 : c + gr) / 2;
3577
+ let r = (o - n.length) * (t === "horizontal" ? 86 : c + xr) / 2;
3520
3578
  for (let [i, a] of n.entries()) {
3521
- let n = t === "horizontal" ? hr + e * (c + gr) : hr + r + i * (c + gr), o = t === "horizontal" ? hr + r + i * 86 : hr + e * 86;
3579
+ let n = t === "horizontal" ? br + e * (c + xr) : br + r + i * (c + xr), o = t === "horizontal" ? br + r + i * 86 : br + e * 86;
3522
3580
  p.push({
3523
3581
  id: a.id,
3524
3582
  label: a.label,
@@ -3527,7 +3585,7 @@ function buildLayout(e, t, n) {
3527
3585
  x: n,
3528
3586
  y: o,
3529
3587
  width: c,
3530
- height: mr
3588
+ height: yr
3531
3589
  });
3532
3590
  }
3533
3591
  }
@@ -3604,14 +3662,14 @@ function formatChatVisualTick(e) {
3604
3662
  let { prefix: r, suffix: i } = affixes(n);
3605
3663
  return `${r}${formatChatVisualValue({ value: t })}${i}`;
3606
3664
  }
3607
- var yr = 5.4, br = 10, xr = 15, Sr = 16;
3665
+ var wr = 5.4, Tr = 10, Er = 15, Dr = 16;
3608
3666
  function planChatVisualXLabels(e) {
3609
3667
  let { labels: t, plotWidth: n } = e;
3610
3668
  if (!t.length || n <= 0) return {
3611
3669
  mode: "horizontal",
3612
3670
  entries: []
3613
3671
  };
3614
- let r = t.map((e) => e.length > Sr ? `${e.slice(0, Sr - 1).trimEnd()}\u2026` : e), i = t.length - 1;
3672
+ let r = t.map((e) => e.length > Dr ? `${e.slice(0, Dr - 1).trimEnd()}\u2026` : e), i = t.length - 1;
3615
3673
  if (i === 0) return {
3616
3674
  mode: "horizontal",
3617
3675
  entries: [{
@@ -3619,14 +3677,14 @@ function planChatVisualXLabels(e) {
3619
3677
  text: r[0]
3620
3678
  }]
3621
3679
  };
3622
- if ((Math.max(...r.map((e) => e.length * yr)) + br) * t.length <= n) return {
3680
+ if ((Math.max(...r.map((e) => e.length * wr)) + Tr) * t.length <= n) return {
3623
3681
  mode: "horizontal",
3624
3682
  entries: r.map((e, t) => ({
3625
3683
  index: t,
3626
3684
  text: e
3627
3685
  }))
3628
3686
  };
3629
- let a = Math.max(2, Math.floor(n / xr));
3687
+ let a = Math.max(2, Math.floor(n / Er));
3630
3688
  if (t.length <= a) return {
3631
3689
  mode: "angled",
3632
3690
  entries: r.map((e, t) => ({
@@ -3646,22 +3704,22 @@ function planChatVisualXLabels(e) {
3646
3704
  }
3647
3705
  //#endregion
3648
3706
  //#region agent/ui/ChatVisualBlock.vue?vue&type=script&setup=true&lang.ts
3649
- var Cr = [
3707
+ var Or = [
3650
3708
  "data-visual-type",
3651
3709
  "data-chart-type",
3652
3710
  "data-stacking",
3653
3711
  "data-diagram-type",
3654
3712
  "aria-label"
3655
- ], wr = { class: "mb-2.5" }, Tr = ["aria-label"], Er = {
3713
+ ], kr = { class: "mb-2.5" }, Ar = ["aria-label"], jr = {
3656
3714
  key: 0,
3657
3715
  "data-test": "chat-visual-horizontal-bars",
3658
3716
  class: "grid gap-3"
3659
- }, Dr = { class: "mb-1 flex items-start justify-between gap-3 text-[12px]" }, Or = ["viewBox"], kr = [
3717
+ }, Mr = { class: "mb-1 flex items-start justify-between gap-3 text-[12px]" }, Nr = ["viewBox"], Pr = [
3660
3718
  "x1",
3661
3719
  "x2",
3662
3720
  "y1",
3663
3721
  "y2"
3664
- ], Ar = ["x", "y"], jr = [
3722
+ ], Fr = ["x", "y"], Ir = [
3665
3723
  "data-row-index",
3666
3724
  "data-series-index",
3667
3725
  "data-data-key",
@@ -3669,56 +3727,56 @@ var Cr = [
3669
3727
  "y",
3670
3728
  "width",
3671
3729
  "height"
3672
- ], Mr = ["data-trend-key", "d"], Nr = ["d"], Pr = ["cx", "cy"], Fr = ["cx", "cy"], Ir = [
3730
+ ], Lr = ["data-trend-key", "d"], Rr = ["d"], zr = ["cx", "cy"], Br = ["cx", "cy"], Vr = [
3673
3731
  "x",
3674
3732
  "y",
3675
3733
  "text-anchor",
3676
3734
  "transform"
3677
- ], Lr = {
3735
+ ], Hr = {
3678
3736
  key: 2,
3679
3737
  class: "mt-2.5 flex flex-wrap items-center gap-x-4 gap-y-1.5"
3680
- }, Rr = {
3738
+ }, Ur = {
3681
3739
  key: 1,
3682
3740
  class: "grid gap-3"
3683
- }, zr = { class: "mb-1 flex items-baseline justify-between gap-3 text-[12px]" }, Br = { class: "shrink-0 tabular-nums" }, Vr = {
3741
+ }, Wr = { class: "mb-1 flex items-baseline justify-between gap-3 text-[12px]" }, Gr = { class: "shrink-0 tabular-nums" }, Kr = {
3684
3742
  key: 2,
3685
3743
  class: "overflow-x-auto"
3686
- }, Hr = ["viewBox", "aria-label"], Ur = [
3744
+ }, qr = ["viewBox", "aria-label"], Jr = [
3687
3745
  "data-from",
3688
3746
  "data-to",
3689
3747
  "x1",
3690
3748
  "y1",
3691
3749
  "x2",
3692
3750
  "y2"
3693
- ], Wr = ["cx", "cy"], Gr = ["x", "y"], Kr = [
3751
+ ], Yr = ["cx", "cy"], Xr = ["x", "y"], Zr = [
3694
3752
  "data-node-id",
3695
3753
  "data-node-kind",
3696
3754
  "transform"
3697
- ], qr = ["points"], Jr = ["width", "height"], Yr = ["width", "height"], Xr = {
3755
+ ], Qr = ["points"], $r = ["width", "height"], ei = ["width", "height"], ti = {
3698
3756
  xmlns: "http://www.w3.org/1999/xhtml",
3699
3757
  class: "flex h-full min-w-0 flex-col items-center justify-center text-center"
3700
- }, Zr = /* @__PURE__ */ x({
3758
+ }, ni = /* @__PURE__ */ x({
3701
3759
  __name: "ChatVisualBlock",
3702
3760
  props: {
3703
3761
  result: {},
3704
3762
  inverted: { type: Boolean }
3705
3763
  },
3706
3764
  setup(e) {
3707
- let t = e, n = A(), r = P(360), i;
3708
- ne(() => {
3765
+ let t = e, n = k(), r = se(360), i;
3766
+ ie(() => {
3709
3767
  typeof ResizeObserver > "u" || !n.value || (i = new ResizeObserver((e) => {
3710
3768
  let t = e[0]?.contentRect.width;
3711
3769
  t && (r.value = Math.round(t));
3712
3770
  }), i.observe(n.value));
3713
- }), te(() => i?.disconnect());
3714
- let a = f(() => Math.min(720, Math.max(280, r.value))), o = f(() => t.result.ok ? t.result.spec : null), s = f(() => o.value?.visualType === "chart" ? o.value : null), c = f(() => o.value?.visualType === "diagram" ? o.value : null);
3771
+ }), re(() => i?.disconnect());
3772
+ let a = p(() => Math.min(720, Math.max(280, r.value))), o = p(() => t.result.ok ? t.result.spec : null), s = p(() => o.value?.visualType === "chart" ? o.value : null), c = p(() => o.value?.visualType === "diagram" ? o.value : null);
3715
3773
  function isCartesianChart(e) {
3716
3774
  return e?.chartType === "bar" || e?.chartType === "line" || e?.chartType === "scatter";
3717
3775
  }
3718
3776
  function isPieChart(e) {
3719
3777
  return e?.chartType === "pie";
3720
3778
  }
3721
- let p = f(() => s.value?.data ?? []), v = f(() => isCartesianChart(s.value) ? s.value : null), b = f(() => v.value?.series ?? []), x = f(() => isPieChart(s.value) ? s.value : null), S = f(() => v.value?.chartType === "bar" && v.value.stacking === "stacked");
3779
+ let u = p(() => s.value?.data ?? []), m = p(() => isCartesianChart(s.value) ? s.value : null), te = p(() => m.value?.series ?? []), b = p(() => isPieChart(s.value) ? s.value : null), x = p(() => m.value?.chartType === "bar" && m.value.stacking === "stacked");
3722
3780
  function numericValue(e) {
3723
3781
  return typeof e == "number" && Number.isFinite(e) ? e : null;
3724
3782
  }
@@ -3750,8 +3808,8 @@ var Cr = [
3750
3808
  intercept: (r - s * n) / t
3751
3809
  };
3752
3810
  }
3753
- let C = f(() => {
3754
- let e = [], t = v.value;
3811
+ let ne = p(() => {
3812
+ let e = [], t = m.value;
3755
3813
  if (!t) return e;
3756
3814
  if (t.chartType === "bar" && t.stacking === "stacked") for (let n of t.data) {
3757
3815
  let r = 0, i = 0;
@@ -3780,8 +3838,8 @@ var Cr = [
3780
3838
  let n = e > 0 ? e : 1, r = Math.floor(Math.log10(n)), i = n / 10 ** r, a;
3781
3839
  return a = t ? i < 1.5 ? 1 : i < 3 ? 2 : i < 7 ? 5 : 10 : i <= 1 ? 1 : i <= 2 ? 2 : i <= 5 ? 5 : 10, a * 10 ** r;
3782
3840
  }
3783
- let re = f(() => {
3784
- let e = C.value, t = e.length ? Math.max(0, ...e) : 1, n = e.length ? Math.min(0, ...e) : 0;
3841
+ let S = p(() => {
3842
+ let e = ne.value, t = e.length ? Math.max(0, ...e) : 1, n = e.length ? Math.min(0, ...e) : 0;
3785
3843
  if (n === t) return {
3786
3844
  min: 0,
3787
3845
  max: t || 1,
@@ -3794,8 +3852,8 @@ var Cr = [
3794
3852
  max: a,
3795
3853
  ticks: o
3796
3854
  };
3797
- }), ie = f(() => resolveSharedSeriesFormat({ series: b.value })), ae = f(() => {
3798
- let e = v.value;
3855
+ }), ae = p(() => resolveSharedSeriesFormat({ series: te.value })), oe = p(() => {
3856
+ let e = m.value;
3799
3857
  if (!e) return {
3800
3858
  mode: "horizontal",
3801
3859
  entries: []
@@ -3805,8 +3863,8 @@ var Cr = [
3805
3863
  labels: e.data.map((e) => String(e?.[t] ?? "")),
3806
3864
  plotWidth: Math.max(200, a.value - 42)
3807
3865
  });
3808
- }), I = f(() => {
3809
- let e = ie.value?.valueFormat, t = !!(ie.value && (e === "currency" || e === "percent" || ie.value.valuePrefix || ie.value.valueSuffix)), n = e === "duration" ? 46 : t ? 38 : 30, r = ae.value.mode === "angled";
3866
+ }), j = p(() => {
3867
+ let e = ae.value?.valueFormat, t = !!(ae.value && (e === "currency" || e === "percent" || ae.value.valuePrefix || ae.value.valueSuffix)), n = e === "duration" ? 46 : t ? 38 : 30, r = oe.value.mode === "angled";
3810
3868
  return {
3811
3869
  width: a.value,
3812
3870
  height: 168 + (r ? 36 : 0),
@@ -3817,7 +3875,7 @@ var Cr = [
3817
3875
  };
3818
3876
  });
3819
3877
  function labelCenterX(e, t) {
3820
- let n = v.value, r = I.value;
3878
+ let n = m.value, r = j.value;
3821
3879
  if (n?.chartType === "bar") {
3822
3880
  let n = r.width - r.left - r.right;
3823
3881
  return r.left + (e + .5) * (n / Math.max(t, 1));
@@ -3825,22 +3883,22 @@ var Cr = [
3825
3883
  return xForIndex(e, t);
3826
3884
  }
3827
3885
  function xForIndex(e, t) {
3828
- let n = I.value, r = n.width - n.left - n.right;
3886
+ let n = j.value, r = n.width - n.left - n.right;
3829
3887
  return t <= 1 ? n.left + r / 2 : n.left + r * e / (t - 1);
3830
3888
  }
3831
3889
  function yForValue(e) {
3832
- let { min: t, max: n } = re.value, r = I.value, i = r.height - r.top - r.bottom;
3890
+ let { min: t, max: n } = S.value, r = j.value, i = r.height - r.top - r.bottom;
3833
3891
  return r.top + (n - e) / (n - t || 1) * i;
3834
3892
  }
3835
3893
  function pathForSeries(e) {
3836
- let t = v.value;
3894
+ let t = m.value;
3837
3895
  return t ? t.data.map((n, r) => {
3838
3896
  let i = numericValue(n[e]) ?? 0;
3839
3897
  return `${r === 0 ? "M" : "L"} ${xForIndex(r, t.data.length).toFixed(1)} ${yForValue(i).toFixed(1)}`;
3840
3898
  }).join(" ") : "";
3841
3899
  }
3842
- let se = f(() => {
3843
- let e = v.value;
3900
+ let ue = p(() => {
3901
+ let e = m.value;
3844
3902
  if (!e?.trendLine || e.chartType !== "line" && e.chartType !== "scatter") return null;
3845
3903
  let t = trendLinePoints(e, e.trendLine.dataKey), n = linearTrend(t);
3846
3904
  if (!n || !t.length) return null;
@@ -3850,11 +3908,11 @@ var Cr = [
3850
3908
  dataKey: e.trendLine.dataKey,
3851
3909
  seriesIndex: s
3852
3910
  };
3853
- }), ce = f(() => {
3854
- let e = v.value;
3911
+ }), de = p(() => {
3912
+ let e = m.value;
3855
3913
  if (!e || e.chartType !== "bar") return [];
3856
- let t = I.value, n = (t.width - t.left - t.right) / Math.max(e.data.length, 1), r = yForValue(0);
3857
- if (S.value) {
3914
+ let t = j.value, n = (t.width - t.left - t.right) / Math.max(e.data.length, 1), r = yForValue(0);
3915
+ if (x.value) {
3858
3916
  let r = Math.max(4, Math.min(24, n * .42));
3859
3917
  return e.data.flatMap((i, a) => {
3860
3918
  let o = 0, s = 0, c = t.left + a * n + (n - r) / 2;
@@ -3887,12 +3945,12 @@ var Cr = [
3887
3945
  dataKey: e.dataKey
3888
3946
  };
3889
3947
  }));
3890
- }), R = f(() => {
3891
- let e = v.value;
3948
+ }), F = p(() => {
3949
+ let e = m.value;
3892
3950
  if (!e) return [];
3893
3951
  let t = e.data;
3894
3952
  if (!t.length) return [];
3895
- let n = t.length - 1, r = ae.value, i = r.mode === "angled";
3953
+ let n = t.length - 1, r = oe.value, i = r.mode === "angled";
3896
3954
  return r.entries.map(({ index: e, text: r }) => ({
3897
3955
  key: `${e}`,
3898
3956
  label: r,
@@ -3900,9 +3958,9 @@ var Cr = [
3900
3958
  anchor: i ? "end" : e === 0 ? "start" : e === n ? "end" : "middle",
3901
3959
  angled: i
3902
3960
  })).filter((e) => e.label);
3903
- }), ue = f(() => {
3904
- let e = v.value;
3905
- if (!e || e.chartType !== "bar" || e.series.length !== 1 || S.value) return [];
3961
+ }), pe = p(() => {
3962
+ let e = m.value;
3963
+ if (!e || e.chartType !== "bar" || e.series.length !== 1 || x.value) return [];
3906
3964
  let t = e.series[0], n = e.data.map((n, r) => {
3907
3965
  let i = categoryLabel(n, e.xKey), a = numericValue(n[t.dataKey]);
3908
3966
  return !i || a === null ? null : {
@@ -3923,8 +3981,8 @@ var Cr = [
3923
3981
  width: e.rawValue <= 0 ? 0 : Math.max(2, e.rawValue / r * 100),
3924
3982
  seriesIndex: 0
3925
3983
  }));
3926
- }), z = f(() => {
3927
- let e = v.value;
3984
+ }), he = p(() => {
3985
+ let e = m.value;
3928
3986
  if (!e?.data.length) return [];
3929
3987
  let t = e.data[e.data.length - 1];
3930
3988
  return e.series.map((e, n) => {
@@ -3939,8 +3997,8 @@ var Cr = [
3939
3997
  seriesIndex: n
3940
3998
  };
3941
3999
  });
3942
- }), de = f(() => {
3943
- let e = v.value;
4000
+ }), I = p(() => {
4001
+ let e = m.value;
3944
4002
  if (!e?.data.length || e.chartType !== "line") return [];
3945
4003
  let t = e.data.length - 1, n = e.data[t];
3946
4004
  return e.series.map((r, i) => {
@@ -3952,8 +4010,8 @@ var Cr = [
3952
4010
  seriesIndex: i
3953
4011
  };
3954
4012
  }).filter((e) => e !== null);
3955
- }), B = f(() => {
3956
- let e = x.value;
4013
+ }), R = p(() => {
4014
+ let e = b.value;
3957
4015
  if (!e) return [];
3958
4016
  let t = e.data.map((t) => ({
3959
4017
  name: String(t[e.nameKey] ?? ""),
@@ -3968,17 +4026,17 @@ var Cr = [
3968
4026
  series: r
3969
4027
  })
3970
4028
  }));
3971
- }), pe = f(() => c.value ? layoutChatDiagram(c.value, { maxWidth: r.value }) : null), he = [
4029
+ }), z = p(() => c.value ? layoutChatDiagram(c.value, { maxWidth: r.value }) : null), _e = [
3972
4030
  "var(--color-theme-900)",
3973
4031
  "var(--color-primary-500)",
3974
4032
  "color-mix(in oklch, var(--color-primary-500) 55%, var(--color-theme-500))"
3975
- ], _e = [
4033
+ ], ve = [
3976
4034
  "rgba(255, 255, 255, 0.92)",
3977
4035
  "color-mix(in oklch, white 30%, var(--color-primary-500))",
3978
4036
  "rgba(255, 255, 255, 0.55)"
3979
4037
  ];
3980
4038
  function seriesColor(e) {
3981
- let n = t.inverted ? _e : he;
4039
+ let n = t.inverted ? ve : _e;
3982
4040
  return n[e % n.length];
3983
4041
  }
3984
4042
  function diagramNodeFill(e) {
@@ -3987,82 +4045,82 @@ var Cr = [
3987
4045
  function diagramNodeStroke(e) {
3988
4046
  return e === "decision" ? t.inverted ? "rgba(255, 255, 255, 0.26)" : "color-mix(in oklch, var(--color-primary-500) 32%, var(--color-theme-300))" : Se.value;
3989
4047
  }
3990
- let ve = f(() => t.inverted ? "rgba(255, 255, 255, 0.95)" : "var(--color-theme-900)"), ye = f(() => t.inverted ? "rgba(255, 255, 255, 0.6)" : "var(--color-theme-500)"), H = f(() => t.inverted ? "rgba(255, 255, 255, 0.45)" : "color-mix(in oklch, var(--color-theme-900) 42%, transparent)"), be = f(() => t.inverted ? "rgba(255, 255, 255, 0.1)" : "color-mix(in oklch, var(--color-theme-900) 8%, transparent)"), U = f(() => t.inverted ? "rgba(255, 255, 255, 0.24)" : "color-mix(in oklch, var(--color-theme-900) 18%, transparent)"), Se = f(() => t.inverted ? "rgba(255, 255, 255, 0.16)" : "color-mix(in oklch, var(--color-theme-300) 55%, transparent)"), W = f(() => t.inverted ? "rgba(255, 255, 255, 0.14)" : "color-mix(in oklch, var(--color-theme-900) 10%, transparent)"), Ce = f(() => t.inverted ? "rgba(255, 255, 255, 0.18)" : "color-mix(in oklch, var(--color-theme-900) 16%, transparent)"), we = f(() => t.inverted ? "rgba(255, 255, 255, 0.12)" : "color-mix(in oklch, var(--color-theme-900) 9%, transparent)");
3991
- return (e, r) => o.value ? (k(), h("section", {
4048
+ let B = p(() => t.inverted ? "rgba(255, 255, 255, 0.95)" : "var(--color-theme-900)"), ye = p(() => t.inverted ? "rgba(255, 255, 255, 0.6)" : "var(--color-theme-500)"), H = p(() => t.inverted ? "rgba(255, 255, 255, 0.45)" : "color-mix(in oklch, var(--color-theme-900) 42%, transparent)"), be = p(() => t.inverted ? "rgba(255, 255, 255, 0.1)" : "color-mix(in oklch, var(--color-theme-900) 8%, transparent)"), U = p(() => t.inverted ? "rgba(255, 255, 255, 0.24)" : "color-mix(in oklch, var(--color-theme-900) 18%, transparent)"), Se = p(() => t.inverted ? "rgba(255, 255, 255, 0.16)" : "color-mix(in oklch, var(--color-theme-300) 55%, transparent)"), W = p(() => t.inverted ? "rgba(255, 255, 255, 0.14)" : "color-mix(in oklch, var(--color-theme-900) 10%, transparent)"), Ce = p(() => t.inverted ? "rgba(255, 255, 255, 0.18)" : "color-mix(in oklch, var(--color-theme-900) 16%, transparent)"), we = p(() => t.inverted ? "rgba(255, 255, 255, 0.12)" : "color-mix(in oklch, var(--color-theme-900) 9%, transparent)");
4049
+ return (e, r) => o.value ? (T(), _("section", {
3992
4050
  key: 0,
3993
4051
  "data-test": "chat-visual",
3994
4052
  "data-visual-type": o.value.visualType,
3995
4053
  "data-chart-type": s.value?.chartType,
3996
- "data-stacking": S.value ? "stacked" : void 0,
4054
+ "data-stacking": x.value ? "stacked" : void 0,
3997
4055
  "data-diagram-type": c.value?.diagramType,
3998
4056
  class: "my-6 w-full rounded-[20px] px-4 pb-3.5 pt-4",
3999
- style: T({ boxShadow: `inset 0 0 0 1px ${W.value}` }),
4057
+ style: C({ boxShadow: `inset 0 0 0 1px ${W.value}` }),
4000
4058
  "aria-label": o.value.meta.title
4001
4059
  }, [
4002
- _("header", wr, [_("h4", {
4060
+ v("header", kr, [v("h4", {
4003
4061
  class: "text-[13px] font-semibold leading-tight",
4004
- style: T({ color: ve.value })
4005
- }, F(o.value.meta.title), 5), o.value.meta.description ? (k(), h("p", {
4062
+ style: C({ color: B.value })
4063
+ }, P(o.value.meta.title), 5), o.value.meta.description ? (T(), _("p", {
4006
4064
  key: 0,
4007
4065
  class: "mt-0.5 text-[12px] leading-snug",
4008
- style: T({ color: ye.value })
4009
- }, F(o.value.meta.description), 5)) : m("", !0)]),
4010
- _("div", {
4066
+ style: C({ color: ye.value })
4067
+ }, P(o.value.meta.description), 5)) : h("", !0)]),
4068
+ v("div", {
4011
4069
  ref_key: "bodyEl",
4012
4070
  ref: n
4013
- }, [v.value ? (k(), h("div", {
4071
+ }, [m.value ? (T(), _("div", {
4014
4072
  key: 0,
4015
4073
  role: "img",
4016
4074
  "aria-label": o.value.meta.title
4017
- }, [ue.value.length ? (k(), h("div", Er, [(k(!0), h(u, null, j(ue.value, (e) => (k(), h("div", {
4075
+ }, [pe.value.length ? (T(), _("div", jr, [(T(!0), _(f, null, A(pe.value, (e) => (T(), _("div", {
4018
4076
  key: e.key,
4019
4077
  "data-test": "chat-visual-horizontal-bar",
4020
4078
  class: "min-w-0"
4021
- }, [_("div", Dr, [_("span", {
4079
+ }, [v("div", Mr, [v("span", {
4022
4080
  class: "line-clamp-2 min-w-0 font-medium leading-snug",
4023
- style: T({ color: ve.value })
4024
- }, F(e.label), 5), _("span", {
4081
+ style: C({ color: B.value })
4082
+ }, P(e.label), 5), v("span", {
4025
4083
  class: "shrink-0 font-semibold tabular-nums",
4026
- style: T({ color: ve.value })
4027
- }, F(e.value), 5)]), _("div", {
4084
+ style: C({ color: B.value })
4085
+ }, P(e.value), 5)]), v("div", {
4028
4086
  class: "h-2 w-full overflow-hidden rounded-full",
4029
- style: T({ background: we.value })
4030
- }, [_("div", {
4087
+ style: C({ background: we.value })
4088
+ }, [v("div", {
4031
4089
  class: "h-full rounded-full",
4032
- style: T({
4090
+ style: C({
4033
4091
  width: `${e.width}%`,
4034
4092
  background: seriesColor(e.seriesIndex)
4035
4093
  })
4036
- }, null, 4)], 4)]))), 128))])) : (k(), h("svg", {
4094
+ }, null, 4)], 4)]))), 128))])) : (T(), _("svg", {
4037
4095
  key: 1,
4038
4096
  class: "block h-auto w-full overflow-visible",
4039
- viewBox: `0 0 ${I.value.width} ${I.value.height}`,
4040
- style: T({ aspectRatio: `${I.value.width} / ${I.value.height}` }),
4097
+ viewBox: `0 0 ${j.value.width} ${j.value.height}`,
4098
+ style: C({ aspectRatio: `${j.value.width} / ${j.value.height}` }),
4041
4099
  preserveAspectRatio: "xMidYMid meet",
4042
4100
  "aria-hidden": "true"
4043
4101
  }, [
4044
- (k(!0), h(u, null, j(re.value.ticks, (e) => (k(), h("line", {
4102
+ (T(!0), _(f, null, A(S.value.ticks, (e) => (T(), _("line", {
4045
4103
  key: `grid-${e}`,
4046
- x1: I.value.left,
4047
- x2: I.value.width - I.value.right,
4104
+ x1: j.value.left,
4105
+ x2: j.value.width - j.value.right,
4048
4106
  y1: yForValue(e),
4049
4107
  y2: yForValue(e),
4050
4108
  "stroke-width": "1",
4051
4109
  "vector-effect": "non-scaling-stroke",
4052
- style: T({ stroke: e === 0 ? U.value : be.value })
4053
- }, null, 12, kr))), 128)),
4054
- _("g", null, [(k(!0), h(u, null, j(re.value.ticks, (e) => (k(), h("text", {
4110
+ style: C({ stroke: e === 0 ? U.value : be.value })
4111
+ }, null, 12, Pr))), 128)),
4112
+ v("g", null, [(T(!0), _(f, null, A(S.value.ticks, (e) => (T(), _("text", {
4055
4113
  key: `y-${e}`,
4056
- x: I.value.left - 7,
4114
+ x: j.value.left - 7,
4057
4115
  y: yForValue(e) + 3,
4058
4116
  "text-anchor": "end",
4059
4117
  "font-size": "9.5",
4060
- style: T({ fill: H.value })
4061
- }, F(oe(formatChatVisualTick)({
4118
+ style: C({ fill: H.value })
4119
+ }, P(ce(formatChatVisualTick)({
4062
4120
  value: e,
4063
- shared: ie.value
4064
- })), 13, Ar))), 128))]),
4065
- v.value.chartType === "bar" ? (k(!0), h(u, { key: 0 }, j(ce.value, (e) => (k(), h("rect", {
4121
+ shared: ae.value
4122
+ })), 13, Fr))), 128))]),
4123
+ m.value.chartType === "bar" ? (T(!0), _(f, { key: 0 }, A(de.value, (e) => (T(), _("rect", {
4066
4124
  key: e.key,
4067
4125
  "data-test": "chat-visual-bar",
4068
4126
  "data-row-index": e.rowIndex,
@@ -4073,22 +4131,22 @@ var Cr = [
4073
4131
  width: e.width,
4074
4132
  height: e.height,
4075
4133
  rx: "2.5",
4076
- style: T({ fill: seriesColor(e.seriesIndex) })
4077
- }, null, 12, jr))), 128)) : (k(), h(u, { key: 1 }, [
4078
- se.value ? (k(), h("path", {
4134
+ style: C({ fill: seriesColor(e.seriesIndex) })
4135
+ }, null, 12, Ir))), 128)) : (T(), _(f, { key: 1 }, [
4136
+ ue.value ? (T(), _("path", {
4079
4137
  key: 0,
4080
4138
  "data-test": "chat-visual-trend-line",
4081
- "data-trend-key": se.value.dataKey,
4082
- d: se.value.path,
4139
+ "data-trend-key": ue.value.dataKey,
4140
+ d: ue.value.path,
4083
4141
  fill: "none",
4084
4142
  "stroke-width": "1.4",
4085
4143
  "stroke-linecap": "round",
4086
4144
  "stroke-linejoin": "round",
4087
4145
  "stroke-dasharray": "4 3",
4088
4146
  "vector-effect": "non-scaling-stroke",
4089
- style: T({ stroke: seriesColor(se.value.seriesIndex) })
4090
- }, null, 12, Mr)) : m("", !0),
4091
- (k(!0), h(u, null, j(b.value, (e, t) => (k(), h("g", { key: e.dataKey }, [v.value.chartType === "line" ? (k(), h("path", {
4147
+ style: C({ stroke: seriesColor(ue.value.seriesIndex) })
4148
+ }, null, 12, Lr)) : h("", !0),
4149
+ (T(!0), _(f, null, A(te.value, (e, t) => (T(), _("g", { key: e.dataKey }, [m.value.chartType === "line" ? (T(), _("path", {
4092
4150
  key: 0,
4093
4151
  d: pathForSeries(e.dataKey),
4094
4152
  fill: "none",
@@ -4096,74 +4154,74 @@ var Cr = [
4096
4154
  "stroke-linecap": "round",
4097
4155
  "stroke-linejoin": "round",
4098
4156
  "vector-effect": "non-scaling-stroke",
4099
- style: T({ stroke: seriesColor(t) })
4100
- }, null, 12, Nr)) : m("", !0), (k(!0), h(u, null, j(p.value, (n, r) => (k(), h(u, { key: `${e.dataKey}-${r}` }, [v.value.chartType === "scatter" ? (k(), h("circle", {
4157
+ style: C({ stroke: seriesColor(t) })
4158
+ }, null, 12, Rr)) : h("", !0), (T(!0), _(f, null, A(u.value, (n, r) => (T(), _(f, { key: `${e.dataKey}-${r}` }, [m.value.chartType === "scatter" ? (T(), _("circle", {
4101
4159
  key: 0,
4102
- cx: xForIndex(r, p.value.length),
4160
+ cx: xForIndex(r, u.value.length),
4103
4161
  cy: yForValue(numericValue(n[e.dataKey]) ?? 0),
4104
4162
  r: "2.6",
4105
- style: T({ fill: seriesColor(t) })
4106
- }, null, 12, Pr)) : m("", !0)], 64))), 128))]))), 128)),
4107
- (k(!0), h(u, null, j(de.value, (e) => (k(), h("circle", {
4163
+ style: C({ fill: seriesColor(t) })
4164
+ }, null, 12, zr)) : h("", !0)], 64))), 128))]))), 128)),
4165
+ (T(!0), _(f, null, A(I.value, (e) => (T(), _("circle", {
4108
4166
  key: `marker-${e.key}`,
4109
4167
  cx: e.cx,
4110
4168
  cy: e.cy,
4111
4169
  r: "3",
4112
- style: T({ fill: seriesColor(e.seriesIndex) })
4113
- }, null, 12, Fr))), 128))
4170
+ style: C({ fill: seriesColor(e.seriesIndex) })
4171
+ }, null, 12, Br))), 128))
4114
4172
  ], 64)),
4115
- (k(!0), h(u, null, j(R.value, (e) => (k(), h("text", {
4173
+ (T(!0), _(f, null, A(F.value, (e) => (T(), _("text", {
4116
4174
  key: e.key,
4117
4175
  x: e.x,
4118
- y: e.angled ? I.value.height - I.value.bottom + 12 : I.value.height - 6,
4176
+ y: e.angled ? j.value.height - j.value.bottom + 12 : j.value.height - 6,
4119
4177
  "text-anchor": e.anchor,
4120
4178
  "font-size": "9.5",
4121
- transform: e.angled ? `rotate(${oe(-40)} ${e.x} ${I.value.height - I.value.bottom + 12})` : void 0,
4122
- style: T({ fill: H.value })
4123
- }, F(e.label), 13, Ir))), 128))
4124
- ], 12, Or)), z.value.length > 1 || v.value.chartType !== "bar" ? (k(), h("div", Lr, [(k(!0), h(u, null, j(z.value, (e) => (k(), h("div", {
4179
+ transform: e.angled ? `rotate(${ce(-40)} ${e.x} ${j.value.height - j.value.bottom + 12})` : void 0,
4180
+ style: C({ fill: H.value })
4181
+ }, P(e.label), 13, Vr))), 128))
4182
+ ], 12, Nr)), he.value.length > 1 || m.value.chartType !== "bar" ? (T(), _("div", Hr, [(T(!0), _(f, null, A(he.value, (e) => (T(), _("div", {
4125
4183
  key: e.key,
4126
4184
  class: "inline-flex items-center gap-1.5 text-[11.5px] leading-none"
4127
4185
  }, [
4128
- _("span", {
4186
+ v("span", {
4129
4187
  class: "size-2.5 shrink-0 rounded-full",
4130
- style: T({ background: seriesColor(e.seriesIndex) })
4188
+ style: C({ background: seriesColor(e.seriesIndex) })
4131
4189
  }, null, 4),
4132
- _("span", { style: T({ color: ye.value }) }, F(e.label), 5),
4133
- _("span", {
4190
+ v("span", { style: C({ color: ye.value }) }, P(e.label), 5),
4191
+ v("span", {
4134
4192
  class: "font-semibold tabular-nums",
4135
- style: T({ color: ve.value })
4136
- }, F(e.value), 5)
4137
- ]))), 128))])) : m("", !0)], 8, Tr)) : x.value ? (k(), h("div", Rr, [(k(!0), h(u, null, j(B.value, (e, t) => (k(), h("div", { key: e.key }, [_("div", zr, [_("span", {
4193
+ style: C({ color: B.value })
4194
+ }, P(e.value), 5)
4195
+ ]))), 128))])) : h("", !0)], 8, Ar)) : b.value ? (T(), _("div", Ur, [(T(!0), _(f, null, A(R.value, (e, t) => (T(), _("div", { key: e.key }, [v("div", Wr, [v("span", {
4138
4196
  class: "truncate font-medium",
4139
- style: T({ color: ve.value })
4140
- }, F(e.name), 5), _("span", Br, [_("span", {
4197
+ style: C({ color: B.value })
4198
+ }, P(e.name), 5), v("span", Gr, [v("span", {
4141
4199
  class: "font-semibold",
4142
- style: T({ color: ve.value })
4143
- }, F(e.display), 5), _("span", {
4200
+ style: C({ color: B.value })
4201
+ }, P(e.display), 5), v("span", {
4144
4202
  class: "ml-1.5",
4145
- style: T({ color: ye.value })
4146
- }, F(Math.round(e.percent * 100)) + "%", 5)])]), _("div", {
4203
+ style: C({ color: ye.value })
4204
+ }, P(Math.round(e.percent * 100)) + "%", 5)])]), v("div", {
4147
4205
  class: "h-1.5 w-full overflow-hidden rounded-full",
4148
- style: T({ background: we.value })
4149
- }, [_("div", {
4206
+ style: C({ background: we.value })
4207
+ }, [v("div", {
4150
4208
  class: "h-full rounded-full",
4151
- style: T({
4209
+ style: C({
4152
4210
  width: `${Math.max(2, e.percent * 100)}%`,
4153
4211
  background: seriesColor(t)
4154
4212
  })
4155
- }, null, 4)], 4)]))), 128))])) : c.value && pe.value ? (k(), h("div", Vr, [(k(), h("svg", {
4213
+ }, null, 4)], 4)]))), 128))])) : c.value && z.value ? (T(), _("div", Kr, [(T(), _("svg", {
4156
4214
  "data-test": "chat-visual-diagram-svg",
4157
4215
  class: "block h-auto overflow-visible",
4158
- viewBox: `0 0 ${pe.value.width} ${pe.value.height}`,
4159
- style: T({
4160
- width: `${pe.value.width}px`,
4161
- aspectRatio: `${pe.value.width} / ${pe.value.height}`
4216
+ viewBox: `0 0 ${z.value.width} ${z.value.height}`,
4217
+ style: C({
4218
+ width: `${z.value.width}px`,
4219
+ aspectRatio: `${z.value.width} / ${z.value.height}`
4162
4220
  }),
4163
4221
  role: "img",
4164
4222
  "aria-label": o.value.meta.title
4165
4223
  }, [
4166
- (k(!0), h(u, null, j(pe.value.edges, (e) => (k(), h("line", {
4224
+ (T(!0), _(f, null, A(z.value.edges, (e) => (T(), _("line", {
4167
4225
  key: e.key,
4168
4226
  "data-test": "chat-visual-diagram-edge",
4169
4227
  "data-from": e.from,
@@ -4175,98 +4233,99 @@ var Cr = [
4175
4233
  "stroke-width": "1.4",
4176
4234
  "stroke-linecap": "round",
4177
4235
  "vector-effect": "non-scaling-stroke",
4178
- style: T({ stroke: Ce.value })
4179
- }, null, 12, Ur))), 128)),
4180
- (k(!0), h(u, null, j(pe.value.edges, (e) => (k(), h("circle", {
4236
+ style: C({ stroke: Ce.value })
4237
+ }, null, 12, Jr))), 128)),
4238
+ (T(!0), _(f, null, A(z.value.edges, (e) => (T(), _("circle", {
4181
4239
  key: `${e.key}-dot`,
4182
4240
  cx: e.x2,
4183
4241
  cy: e.y2,
4184
4242
  r: "2.4",
4185
- style: T({ fill: Ce.value })
4186
- }, null, 12, Wr))), 128)),
4187
- (k(!0), h(u, null, j(pe.value.edges.filter((e) => e.label), (e) => (k(), h("foreignObject", {
4243
+ style: C({ fill: Ce.value })
4244
+ }, null, 12, Yr))), 128)),
4245
+ (T(!0), _(f, null, A(z.value.edges.filter((e) => e.label), (e) => (T(), _("foreignObject", {
4188
4246
  key: `${e.key}-label`,
4189
4247
  x: e.labelX - 55,
4190
4248
  y: e.labelY - 12,
4191
4249
  width: "110",
4192
4250
  height: "24"
4193
- }, [_("div", {
4251
+ }, [v("div", {
4194
4252
  xmlns: "http://www.w3.org/1999/xhtml",
4195
4253
  class: "flex h-full items-center justify-center px-1 text-center text-[10.5px] font-medium leading-none",
4196
- style: T({
4254
+ style: C({
4197
4255
  color: ye.value,
4198
4256
  background: t.inverted ? "var(--color-theme-900)" : "var(--color-theme-0)"
4199
4257
  })
4200
- }, F(e.label), 5)], 8, Gr))), 128)),
4201
- (k(!0), h(u, null, j(pe.value.nodes, (e) => (k(), h("g", {
4258
+ }, P(e.label), 5)], 8, Xr))), 128)),
4259
+ (T(!0), _(f, null, A(z.value.nodes, (e) => (T(), _("g", {
4202
4260
  key: e.id,
4203
4261
  "data-test": "chat-visual-diagram-node",
4204
4262
  "data-node-id": e.id,
4205
4263
  "data-node-kind": e.kind,
4206
4264
  transform: `translate(${e.x} ${e.y})`
4207
- }, [e.kind === "decision" ? (k(), h("polygon", {
4265
+ }, [e.kind === "decision" ? (T(), _("polygon", {
4208
4266
  key: 0,
4209
4267
  points: `${e.width / 2},0 ${e.width},${e.height / 2} ${e.width / 2},${e.height} 0,${e.height / 2}`,
4210
4268
  "stroke-width": "1",
4211
4269
  "vector-effect": "non-scaling-stroke",
4212
- style: T({
4270
+ style: C({
4213
4271
  fill: diagramNodeFill(e.kind),
4214
4272
  stroke: diagramNodeStroke(e.kind)
4215
4273
  })
4216
- }, null, 12, qr)) : (k(), h("rect", {
4274
+ }, null, 12, Qr)) : (T(), _("rect", {
4217
4275
  key: 1,
4218
4276
  width: e.width,
4219
4277
  height: e.height,
4220
4278
  rx: "12",
4221
4279
  "stroke-width": "1",
4222
4280
  "vector-effect": "non-scaling-stroke",
4223
- style: T({
4281
+ style: C({
4224
4282
  fill: diagramNodeFill(e.kind),
4225
4283
  stroke: diagramNodeStroke(e.kind)
4226
4284
  })
4227
- }, null, 12, Jr)), (k(), h("foreignObject", {
4285
+ }, null, 12, $r)), (T(), _("foreignObject", {
4228
4286
  x: "8",
4229
4287
  y: "5",
4230
4288
  width: e.width - 16,
4231
4289
  height: e.height - 10
4232
- }, [_("div", Xr, [_("div", {
4290
+ }, [v("div", ti, [v("div", {
4233
4291
  class: "line-clamp-2 text-[13px] font-semibold leading-tight",
4234
- style: T({ color: ve.value })
4235
- }, F(e.label), 5), e.detail ? (k(), h("div", {
4292
+ style: C({ color: B.value })
4293
+ }, P(e.label), 5), e.detail ? (T(), _("div", {
4236
4294
  key: 0,
4237
4295
  class: "mt-0.5 line-clamp-1 text-[10.5px] leading-none",
4238
- style: T({ color: ye.value })
4239
- }, F(e.detail), 5)) : m("", !0)])], 8, Yr))], 8, Kr))), 128))
4240
- ], 12, Hr))])) : m("", !0)], 512),
4241
- o.value.meta.footer ? (k(), h("footer", {
4296
+ style: C({ color: ye.value })
4297
+ }, P(e.detail), 5)) : h("", !0)])], 8, ei))], 8, Zr))), 128))
4298
+ ], 12, qr))])) : h("", !0)], 512),
4299
+ o.value.meta.footer ? (T(), _("footer", {
4242
4300
  key: 0,
4243
4301
  class: "mt-3 text-[11px] leading-snug",
4244
- style: T({ color: H.value })
4245
- }, F(o.value.meta.footer), 5)) : m("", !0)
4246
- ], 12, Cr)) : m("", !0);
4302
+ style: C({ color: H.value })
4303
+ }, P(o.value.meta.footer), 5)) : h("", !0)
4304
+ ], 12, Or)) : h("", !0);
4247
4305
  }
4248
- }), Qr = ["innerHTML"], $r = /* @__PURE__ */ x({
4306
+ }), ri = ["innerHTML"], ii = /* @__PURE__ */ x({
4249
4307
  __name: "ChatRichText",
4250
4308
  props: {
4251
4309
  text: {},
4252
4310
  inverted: { type: Boolean },
4253
4311
  streaming: { type: Boolean }
4254
4312
  },
4255
- setup(e) {
4256
- let t = e, n = P(t.text), r;
4257
- se([() => t.text, () => t.streaming], ([e, i]) => {
4258
- if (!i) {
4259
- r !== void 0 && (cancelAnimationFrame(r), r = void 0), n.value = e;
4313
+ emits: ["action"],
4314
+ setup(e, { emit: t }) {
4315
+ let n = e, r = t, i = se(n.text), a;
4316
+ de([() => n.text, () => n.streaming], ([e, t]) => {
4317
+ if (!t) {
4318
+ a !== void 0 && (cancelAnimationFrame(a), a = void 0), i.value = e;
4260
4319
  return;
4261
4320
  }
4262
- r === void 0 && (r = requestAnimationFrame(() => {
4263
- r = void 0, n.value = t.text;
4321
+ a === void 0 && (a = requestAnimationFrame(() => {
4322
+ a = void 0, i.value = n.text;
4264
4323
  }));
4265
- }), te(() => {
4266
- r !== void 0 && cancelAnimationFrame(r);
4324
+ }), re(() => {
4325
+ a !== void 0 && cancelAnimationFrame(a);
4267
4326
  });
4268
- let i = new g.Renderer();
4269
- i.link = ({ href: e, text: t }) => {
4327
+ let o = new g.Renderer();
4328
+ o.link = ({ href: e, text: t }) => {
4270
4329
  let n = e.trim();
4271
4330
  if (!n || n === "#") return t;
4272
4331
  let r = !1;
@@ -4279,7 +4338,7 @@ var Cr = [
4279
4338
  }, g.setOptions({
4280
4339
  breaks: !0,
4281
4340
  gfm: !0,
4282
- renderer: i
4341
+ renderer: o
4283
4342
  });
4284
4343
  function renderMarkdown(e) {
4285
4344
  if (!e) return "";
@@ -4338,147 +4397,170 @@ var Cr = [
4338
4397
  height: e.target.naturalHeight || null
4339
4398
  });
4340
4399
  }
4341
- let a = /```(?:pl-visual|pl-platform-visual)[ \t]*(?:\r?\n|$)/;
4400
+ let s = /```(?:pl-visual|pl-platform-visual|pl-card)[ \t]*(?:\r?\n|$)/;
4342
4401
  function richTextSegments(e) {
4343
- let { text: t, streaming: n } = e, r = [], i = /```(?:pl-visual|pl-platform-visual)[ \t]*\r?\n([\s\S]*?)```/g, o = 0, s = 0, u = i.exec(t);
4344
- for (; u !== null;) {
4345
- let e = renderMarkdown(t.slice(o, u.index));
4402
+ let { text: t, streaming: n } = e, r = [], i = /```(pl-visual|pl-platform-visual|pl-card)[ \t]*\r?\n([\s\S]*?)```/g, a = 0, o = 0, f = i.exec(t);
4403
+ for (; f !== null;) {
4404
+ let e = renderMarkdown(t.slice(a, f.index));
4346
4405
  e && r.push({
4347
4406
  kind: "markdown",
4348
- key: `md-${s}`,
4407
+ key: `md-${o}`,
4349
4408
  html: e
4350
4409
  });
4351
- let n = c(u[1].trim());
4352
- if (n.ok) r.push({
4353
- kind: "visual",
4354
- key: `visual-${s}`,
4355
- result: n
4356
- });
4357
- else {
4358
- typeof console < "u" && console.warn("[pl-visual] parse_failed", {
4359
- reason: n.reason,
4360
- message: n.message,
4361
- hasFallbackMarkdown: !!n.fallbackMarkdown,
4362
- payloadChars: u[1].trim().length,
4363
- ...visualPayloadShape(u[1].trim())
4364
- });
4365
- let e = n.fallbackMarkdown ? renderMarkdown(n.fallbackMarkdown) : "";
4366
- e && r.push({
4410
+ let n = f[1], s = f[2].trim();
4411
+ if (n === "pl-card") {
4412
+ let e = c(s);
4413
+ e.ok ? r.push({
4414
+ kind: "card",
4415
+ key: `card-${o}`,
4416
+ spec: e.spec
4417
+ }) : (typeof console < "u" && console.warn("[pl-card] parse_failed", {
4418
+ reason: e.reason,
4419
+ message: e.message,
4420
+ payloadChars: s.length
4421
+ }), r.push({
4367
4422
  kind: "markdown",
4368
- key: `visual-${s}`,
4369
- html: e
4423
+ key: `card-${o}`,
4424
+ html: renderMarkdown(`\`\`\`\n${s}\n\`\`\``)
4425
+ }));
4426
+ } else {
4427
+ let e = u(s);
4428
+ if (e.ok) r.push({
4429
+ kind: "visual",
4430
+ key: `visual-${o}`,
4431
+ result: e
4370
4432
  });
4433
+ else {
4434
+ typeof console < "u" && console.warn("[pl-visual] parse_failed", {
4435
+ reason: e.reason,
4436
+ message: e.message,
4437
+ hasFallbackMarkdown: !!e.fallbackMarkdown,
4438
+ payloadChars: s.length,
4439
+ ...visualPayloadShape(s)
4440
+ });
4441
+ let t = e.fallbackMarkdown ? renderMarkdown(e.fallbackMarkdown) : "";
4442
+ t && r.push({
4443
+ kind: "markdown",
4444
+ key: `visual-${o}`,
4445
+ html: t
4446
+ });
4447
+ }
4371
4448
  }
4372
- o = u.index + u[0].length, s += 1, u = i.exec(t);
4449
+ a = f.index + f[0].length, o += 1, f = i.exec(t);
4373
4450
  }
4374
- let f = t.slice(o), p = n ? a.exec(f) : null;
4375
- if (p) {
4376
- let e = renderMarkdown(f.slice(0, p.index));
4451
+ let p = t.slice(a), m = n ? s.exec(p) : null;
4452
+ if (m) {
4453
+ let e = renderMarkdown(p.slice(0, m.index));
4377
4454
  return e && r.push({
4378
4455
  kind: "markdown",
4379
- key: `md-${s}`,
4456
+ key: `md-${o}`,
4380
4457
  html: e
4381
4458
  }), r.push({
4382
4459
  kind: "pending-visual",
4383
- key: `pending-${s}`
4460
+ key: `pending-${o}`
4384
4461
  }), r;
4385
4462
  }
4386
- let m = renderMarkdown(f);
4387
- return m && r.push({
4463
+ let h = renderMarkdown(p);
4464
+ return h && r.push({
4388
4465
  kind: "markdown",
4389
- key: `md-${s}`,
4390
- html: m
4466
+ key: `md-${o}`,
4467
+ html: h
4391
4468
  }), r;
4392
4469
  }
4393
- let o = f(() => {
4394
- let e = n.value;
4470
+ let h = p(() => {
4471
+ let e = i.value;
4395
4472
  return e ? richTextSegments({
4396
4473
  text: e,
4397
- streaming: !!t.streaming
4474
+ streaming: !!n.streaming
4398
4475
  }) : [];
4399
4476
  });
4400
- return (t, n) => (k(), h("div", {
4477
+ return (t, n) => (T(), _("div", {
4401
4478
  class: "chat-msg-rich break-words text-[14px] leading-relaxed @sm/chat:max-w-[65ch] @sm/chat:text-[16px] @sm/chat:leading-relaxed",
4402
4479
  onErrorCapture: onRichTextAssetError
4403
- }, [(k(!0), h(u, null, j(o.value, (t) => (k(), h(u, { key: t.key }, [t.kind === "markdown" ? (k(), h("div", {
4480
+ }, [(T(!0), _(f, null, A(h.value, (t) => (T(), _(f, { key: t.key }, [t.kind === "markdown" ? (T(), _("div", {
4404
4481
  key: 0,
4405
- class: C(["chat-msg-prose", e.inverted ? "chat-msg-prose-invert" : ""]),
4482
+ class: S(["chat-msg-prose", e.inverted ? "chat-msg-prose-invert" : ""]),
4406
4483
  innerHTML: t.html
4407
- }, null, 10, Qr)) : t.kind === "visual" ? (k(), p(Zr, {
4484
+ }, null, 10, ri)) : t.kind === "visual" ? (T(), m(ni, {
4408
4485
  key: 1,
4409
4486
  result: t.result,
4410
4487
  inverted: e.inverted
4411
- }, null, 8, ["result", "inverted"])) : (k(), h("div", {
4488
+ }, null, 8, ["result", "inverted"])) : t.kind === "card" ? (T(), m(_r, {
4412
4489
  key: 2,
4490
+ spec: t.spec,
4491
+ inverted: e.inverted,
4492
+ onAction: n[0] || (n[0] = (e) => r("action", e))
4493
+ }, null, 8, ["spec", "inverted"])) : (T(), _("div", {
4494
+ key: 3,
4413
4495
  "data-test": "chat-visual-pending",
4414
4496
  role: "status",
4415
4497
  class: "my-6 flex items-center gap-2.5 rounded-[20px] px-4 py-5 text-[12px] font-medium",
4416
- style: T({
4498
+ style: C({
4417
4499
  boxShadow: `inset 0 0 0 1px ${e.inverted ? "rgba(255, 255, 255, 0.14)" : "color-mix(in oklch, var(--color-theme-900) 8%, transparent)"}`,
4418
4500
  color: e.inverted ? "rgba(255, 255, 255, 0.6)" : "var(--color-theme-500)"
4419
4501
  })
4420
- }, [...n[0] || (n[0] = [_("span", {
4502
+ }, [...n[1] || (n[1] = [v("span", {
4421
4503
  class: "size-2 shrink-0 animate-pulse rounded-full",
4422
4504
  style: { background: "currentcolor" }
4423
- }, null, -1), v(" Preparing chart… ", -1)])], 4))], 64))), 128))], 32));
4505
+ }, null, -1), te(" Preparing chart… ", -1)])], 4))], 64))), 128))], 32));
4424
4506
  }
4425
- }), ei = 80, ti = 600, ni = /* @__PURE__ */ x({
4507
+ }), ai = 80, oi = 600, si = /* @__PURE__ */ x({
4426
4508
  __name: "ChatScroller",
4427
4509
  setup(e, { expose: t }) {
4428
- let n = A(), r = A(), i = A(!0), a, o = 0;
4510
+ let n = k(), r = k(), i = k(!0), a, o = 0;
4429
4511
  function scrollToBottom() {
4430
4512
  let e = n.value;
4431
4513
  e && (e.scrollTop = e.scrollHeight);
4432
4514
  }
4433
4515
  function onScroll() {
4434
4516
  let e = n.value;
4435
- e && (i.value = e.scrollHeight - e.scrollTop - e.clientHeight <= ei);
4517
+ e && (i.value = e.scrollHeight - e.scrollTop - e.clientHeight <= ai);
4436
4518
  }
4437
4519
  function markUserGesture() {
4438
- o = Date.now() + ti;
4520
+ o = Date.now() + oi;
4439
4521
  }
4440
4522
  function pin() {
4441
4523
  i.value = !0, scrollToBottom();
4442
4524
  }
4443
- return t({ pin }), ne(() => {
4525
+ return t({ pin }), ie(() => {
4444
4526
  requestAnimationFrame(() => {
4445
4527
  scrollToBottom(), requestAnimationFrame(scrollToBottom);
4446
4528
  }), r.value && (a = new ResizeObserver(() => {
4447
4529
  i.value && Date.now() > o && scrollToBottom();
4448
4530
  }), a.observe(r.value), n.value && a.observe(n.value));
4449
- }), te(() => {
4531
+ }), re(() => {
4450
4532
  a?.disconnect();
4451
- }), (e, t) => (k(), h("div", {
4533
+ }), (e, t) => (T(), _("div", {
4452
4534
  ref_key: "viewport",
4453
4535
  ref: n,
4454
- class: C(["overflow-y-auto overflow-x-hidden min-h-0 flex flex-col [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden", i.value ? "[overflow-anchor:none]" : ""]),
4536
+ class: S(["overflow-y-auto overflow-x-hidden min-h-0 flex flex-col [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden", i.value ? "[overflow-anchor:none]" : ""]),
4455
4537
  onScrollPassive: onScroll,
4456
4538
  onWheelPassive: markUserGesture,
4457
4539
  onTouchstartPassive: markUserGesture
4458
- }, [_("div", {
4540
+ }, [v("div", {
4459
4541
  ref_key: "content",
4460
4542
  ref: r,
4461
4543
  class: "flex-1 flex flex-col"
4462
- }, [ie(e.$slots, "default")], 512)], 34));
4544
+ }, [oe(e.$slots, "default")], 512)], 34));
4463
4545
  }
4464
- }), ri = {
4546
+ }), ci = {
4465
4547
  key: 0,
4466
4548
  class: "pb-4"
4467
- }, ii = {
4549
+ }, li = {
4468
4550
  key: 1,
4469
4551
  "data-test": "messaging-sdk-header",
4470
4552
  class: "shrink-0 border-b border-theme-100 px-4 py-3"
4471
- }, ai = { class: "min-w-0 flex-1" }, oi = { class: "truncate text-base font-semibold leading-tight text-theme-900" }, si = { class: "mt-1 truncate text-sm leading-tight text-theme-500" }, ci = {
4553
+ }, ui = { class: "min-w-0 flex-1" }, di = { class: "truncate text-base font-semibold leading-tight text-theme-900" }, fi = { class: "mt-1 truncate text-sm leading-tight text-theme-500" }, pi = {
4472
4554
  key: 0,
4473
4555
  class: "shrink-0 rounded-full bg-theme-50 px-2.5 py-1 font-mono text-[11px] font-medium text-theme-500"
4474
- }, li = {
4556
+ }, mi = {
4475
4557
  key: 0,
4476
4558
  "data-test": "messaging-empty-state",
4477
4559
  class: "flex flex-col items-center justify-center px-4"
4478
- }, ui = ["title"], di = {
4560
+ }, hi = ["title"], gi = {
4479
4561
  key: 0,
4480
4562
  class: "flex items-center gap-3 py-3 px-2"
4481
- }, fi = ["data-journal-outcome"], pi = [
4563
+ }, _i = ["data-journal-outcome"], vi = [
4482
4564
  "data-message-id",
4483
4565
  "data-message-sender",
4484
4566
  "data-conversation-id",
@@ -4489,7 +4571,7 @@ var Cr = [
4489
4571
  "data-issue-action-label",
4490
4572
  "data-issue-action-url",
4491
4573
  "data-streaming"
4492
- ], mi = { class: "max-w-[85%] min-w-0" }, hi = ["href"], gi = [
4574
+ ], yi = { class: "max-w-[85%] min-w-0" }, bi = ["href"], xi = [
4493
4575
  "data-message-id",
4494
4576
  "data-message-sender",
4495
4577
  "data-conversation-id",
@@ -4498,7 +4580,7 @@ var Cr = [
4498
4580
  "data-issue-code",
4499
4581
  "data-issue-bucket",
4500
4582
  "data-streaming"
4501
- ], _i = [
4583
+ ], Si = [
4502
4584
  "data-test",
4503
4585
  "data-message-id",
4504
4586
  "data-message-sender",
@@ -4506,51 +4588,51 @@ var Cr = [
4506
4588
  "data-message-sequence",
4507
4589
  "data-system-kind",
4508
4590
  "data-streaming"
4509
- ], vi = ["src", "alt"], yi = ["src"], bi = ["href"], xi = {
4591
+ ], Ci = ["src", "alt"], wi = ["src"], Ti = ["href"], Ei = {
4510
4592
  key: 0,
4511
4593
  "data-test": "messaging-message-text-part"
4512
- }, Si = [
4594
+ }, Di = [
4513
4595
  "src",
4514
4596
  "alt",
4515
4597
  "data-attachment-placement"
4516
- ], Ci = ["src", "data-attachment-placement"], wi = ["href", "data-attachment-placement"], Ti = ["data-journal-outcome"], Ei = {
4598
+ ], Oi = ["src", "data-attachment-placement"], ki = ["href", "data-attachment-placement"], Ai = ["data-journal-outcome"], ji = {
4517
4599
  key: 2,
4518
4600
  "data-test": "messaging-tool-activity-tail",
4519
4601
  "aria-label": "Assistant is still working",
4520
4602
  class: "mb-4 grid h-[17px] w-5 place-items-center"
4521
- }, Di = ["data-journal-outcome"], Oi = ["data-working-description"], ki = { class: "truncate" }, Ai = ["data-issue-code"], ji = ["href"], Mi = {
4603
+ }, Mi = ["data-journal-outcome"], Ni = ["data-working-description"], Pi = { class: "truncate" }, Fi = ["data-issue-code"], Ii = ["href"], Li = {
4522
4604
  key: 3,
4523
4605
  "data-test": "messaging-thinking-indicator",
4524
4606
  class: "flex gap-2 justify-start items-center mb-4"
4525
- }, Ni = ["src", "alt"], Pi = { class: "max-w-20 truncate" }, Fi = ["onClick"], Ii = {
4607
+ }, Ri = ["src", "alt"], zi = { class: "max-w-20 truncate" }, Bi = ["onClick"], Vi = {
4526
4608
  key: 0,
4527
4609
  class: "shrink-0 flex items-center justify-center size-14"
4528
- }, Li = ["data-composer-action"], Ri = ["placeholder", "disabled"], zi = { class: "font-mono text-sm tabular-nums" }, Bi = { class: "mt-2.5 flex items-center" }, Vi = [
4610
+ }, Hi = ["data-composer-action"], Ui = ["placeholder", "disabled"], Wi = { class: "font-mono text-sm tabular-nums" }, Gi = { class: "mt-2.5 flex items-center" }, Ki = [
4529
4611
  "disabled",
4530
4612
  "aria-label",
4531
4613
  "title"
4532
- ], Hi = {
4614
+ ], qi = {
4533
4615
  key: 0,
4534
4616
  class: "i-svg-spinners-ring-resize size-5"
4535
- }, Ui = {
4617
+ }, Ji = {
4536
4618
  key: 1,
4537
4619
  class: "i-tabler-plus size-5"
4538
- }, Wi = { class: "sr-only" }, Gi = { class: "flex items-center gap-2" }, Ki = ["aria-label", "title"], qi = { class: "sr-only" }, Ji = [
4620
+ }, Yi = { class: "sr-only" }, Xi = { class: "flex items-center gap-2" }, Zi = ["aria-label", "title"], Qi = { class: "sr-only" }, $i = [
4539
4621
  "data-composer-action",
4540
4622
  "disabled",
4541
4623
  "aria-label",
4542
4624
  "title"
4543
- ], Yi = {
4625
+ ], ea = {
4544
4626
  key: 0,
4545
4627
  class: "i-tabler-player-stop-filled size-3.5"
4546
- }, Xi = {
4628
+ }, ta = {
4547
4629
  key: 1,
4548
4630
  class: "i-tabler-arrow-up size-[17px]"
4549
- }, Zi = { class: "sr-only" }, Qi = {
4631
+ }, na = { class: "sr-only" }, ra = {
4550
4632
  key: 2,
4551
4633
  "data-test": "messaging-suggested-prompts",
4552
4634
  class: "mt-5 w-full sm:mx-auto sm:max-w-[720px]"
4553
- }, $i = { class: "flex flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-center sm:justify-center" }, ea = ["disabled", "onClick"], ta = ["aria-expanded"], na = /* @__PURE__ */ x({
4635
+ }, ia = { class: "flex flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-center sm:justify-center" }, aa = ["disabled", "onClick"], oa = ["aria-expanded"], sa = /* @__PURE__ */ x({
4554
4636
  __name: "ElAgentChat",
4555
4637
  props: {
4556
4638
  chatController: {},
@@ -4588,10 +4670,10 @@ var Cr = [
4588
4670
  label: "Public",
4589
4671
  tooltip: "Anyone with the link can see this"
4590
4672
  }
4591
- }, n = f(() => {
4673
+ }, n = p(() => {
4592
4674
  let n = { ...t[e.scope] };
4593
4675
  return e.scope === "org" && e.scopeName && (n.label = e.scopeName, n.tooltip = `Visible to ${e.scopeName} members`), n;
4594
- }), r = A(!1), i = A(), a = A(), o = A();
4676
+ }), r = k(!1), i = k(), a = k(), o = k();
4595
4677
  function containsMarkdownLink(e) {
4596
4678
  return e ? /\[[^\]]+\]\([^)]+\)/.test(e) : !1;
4597
4679
  }
@@ -4602,23 +4684,23 @@ var Cr = [
4602
4684
  let n = e[t], r = e[t + 1];
4603
4685
  return !r || r.sender !== n.sender;
4604
4686
  }
4605
- let s = f(() => e.chatController?.textState.value), c = f(() => s.value?.isConnected ?? !1), x = f(() => s.value?.isThinking ?? !1), T = f(() => s.value?.connectionStatus === "disconnected" && !!s.value?.error), te = f(() => s.value?.connectionStatus !== "connected" && !s.value?.error), ae = A(!1), P = f(() => e.chatController?.liveTurnBlocks?.value ?? []), oe = f(() => {
4606
- for (let e = P.value.length - 1; e >= 0; e--) {
4607
- let t = P.value[e];
4687
+ let s = p(() => e.chatController?.textState.value), c = p(() => s.value?.isConnected ?? !1), u = p(() => s.value?.isThinking ?? !1), x = p(() => s.value?.connectionStatus === "disconnected" && !!s.value?.error), C = p(() => s.value?.connectionStatus !== "connected" && !s.value?.error), re = k(!1), j = p(() => e.chatController?.liveTurnBlocks?.value ?? []), se = p(() => {
4688
+ for (let e = j.value.length - 1; e >= 0; e--) {
4689
+ let t = j.value[e];
4608
4690
  if (t?.kind === "text") return t.id;
4609
4691
  }
4610
- }), de = f(() => e.chatController?.liveStreamMessageId?.value), B = f(() => {
4692
+ }), ce = p(() => e.chatController?.liveStreamMessageId?.value), R = p(() => {
4611
4693
  let t = e.chatController?.sharedMessages.value ?? [];
4612
- return P.value.length && de.value ? t.filter((e) => e.id !== de.value) : t;
4613
- }), he = f(() => {
4694
+ return j.value.length && ce.value ? t.filter((e) => e.id !== ce.value) : t;
4695
+ }), z = p(() => {
4614
4696
  if (!e.chatController?.workJournal?.value) return s.value?.workingDescription?.trim() || void 0;
4615
- }), _e = f(() => e.chatController?.workJournal?.value), ve = f(() => {
4616
- if (!_e.value && !P.value.length) return;
4617
- let e = B.value, t = e[e.length - 1];
4697
+ }), ve = p(() => e.chatController?.workJournal?.value), B = p(() => {
4698
+ if (!ve.value && !j.value.length) return;
4699
+ let e = R.value, t = e[e.length - 1];
4618
4700
  if (t) return t.sender === "agent" || t.sender === "system" ? e.length >= 2 ? e[e.length - 2].id : void 0 : t.id;
4619
- }), ye = f(() => {
4701
+ }), ye = p(() => {
4620
4702
  let t = {};
4621
- for (let n of B.value) {
4703
+ for (let n of R.value) {
4622
4704
  if (n.sender === "user" || !n.toolActivities?.length) continue;
4623
4705
  let r = e.chatController?.workJournalFor?.({
4624
4706
  activities: n.toolActivities,
@@ -4678,42 +4760,45 @@ var Cr = [
4678
4760
  text: t.slice(i)
4679
4761
  }), r;
4680
4762
  }
4681
- let H = f(() => s.value?.transientIssue), be = f(() => {
4682
- if (!x.value) return;
4683
- let e = B.value, t = e[e.length - 1];
4763
+ let H = p(() => s.value?.transientIssue), be = p(() => {
4764
+ if (!u.value) return;
4765
+ let e = R.value, t = e[e.length - 1];
4684
4766
  return t?.sender === "agent" || t?.sender === "system" ? t.id : void 0;
4685
- }), U = f(() => !x.value || he.value || _e.value || P.value.length ? !1 : be.value === void 0), Se = f(() => s.value?.sendBlockedReason), W = f(() => Se.value === "agent_deleted"), Ce = f(() => T.value ? `${e.agent.displayName.value || e.agent.name.value || "Assistant"} is offline` : te.value ? "Connecting..." : Se.value === "agent_deleted" ? "This assistant was deleted" : `Message ${e.agent.displayName.value || e.agent.name.value || "assistant"}`), we = f(() => e.chatController?.composerState?.value ?? {
4767
+ }), U = p(() => !u.value || z.value || ve.value || j.value.length ? !1 : be.value === void 0), Se = p(() => s.value?.sendBlockedReason), W = p(() => Se.value === "agent_deleted"), Ce = p(() => x.value ? `${e.agent.displayName.value || e.agent.name.value || "Assistant"} is offline` : C.value ? "Connecting..." : Se.value === "agent_deleted" ? "This assistant was deleted" : `Message ${e.agent.displayName.value || e.agent.name.value || "assistant"}`), we = p(() => e.chatController?.composerState?.value ?? {
4686
4768
  text: "",
4687
4769
  pendingAttachments: [],
4688
4770
  isUploading: !1
4689
- }), Te = f({
4771
+ }), Te = p({
4690
4772
  get: () => we.value.text,
4691
4773
  set: (t) => e.chatController?.setComposerText?.({ text: t })
4692
- }), Ee = f(() => we.value.pendingAttachments), De = f(() => we.value.isUploading), Oe = f(() => e.chatController?.voiceRecorder), ke = f(() => Oe.value?.isBusy.value ?? !1), Ae = f(() => e.chatController?.canAttachFile?.value ?? !1), je = f(() => e.chatController?.canRecordAudio?.value ?? !1), Me = f(() => e.chatController?.composerAction?.value ?? "idle"), Ne = f(() => Me.value !== "idle"), Fe = f(() => Me.value === "stop" ? "Stop reply" : "Send message"), Ie = f(() => je.value && !ke.value && !!Oe.value?.canUseBrowserRecording), Le = f(() => Oe.value?.isActive.value ?? !1), Re = f(() => Oe.value?.elapsedLabel.value ?? "0:00"), Be = f(() => Oe.value?.statusText.value ?? "Release to send"), Ve = f(() => Oe.value?.state.value.phase === "sending" ? "Sending voice message" : Le.value ? "Release to send voice message" : "Hold to record voice message"), G = f(() => e.variant === "light"), He = f(() => G.value ? "bg-gradient-to-r from-transparent via-black/5 to-transparent" : "bg-gradient-to-r from-transparent via-white/5 to-transparent"), Ue = f(() => G.value ? "text-theme-300" : "text-white/30");
4693
- ne(async () => {
4774
+ }), Ee = p(() => we.value.pendingAttachments), De = p(() => we.value.isUploading), Oe = p(() => e.chatController?.voiceRecorder), ke = p(() => Oe.value?.isBusy.value ?? !1), G = p(() => e.chatController?.canAttachFile?.value ?? !1), Ae = p(() => e.chatController?.canRecordAudio?.value ?? !1), je = p(() => e.chatController?.composerAction?.value ?? "idle"), Me = p(() => je.value !== "idle"), Ne = p(() => je.value === "stop" ? "Stop reply" : "Send message"), Fe = p(() => Ae.value && !ke.value && !!Oe.value?.canUseBrowserRecording), Ie = p(() => Oe.value?.isActive.value ?? !1), Le = p(() => Oe.value?.elapsedLabel.value ?? "0:00"), Re = p(() => Oe.value?.statusText.value ?? "Release to send"), Be = p(() => Oe.value?.state.value.phase === "sending" ? "Sending voice message" : Ie.value ? "Release to send voice message" : "Hold to record voice message"), K = p(() => e.variant === "light"), Ve = p(() => K.value ? "bg-gradient-to-r from-transparent via-black/5 to-transparent" : "bg-gradient-to-r from-transparent via-white/5 to-transparent"), He = p(() => K.value ? "text-theme-300" : "text-white/30");
4775
+ ie(async () => {
4694
4776
  e.chatController && !c.value && await e.chatController.startTextConversation();
4695
- }), re(() => {
4777
+ }), ae(() => {
4696
4778
  e.chatController?.voiceRecorder?.teardown();
4697
4779
  });
4698
4780
  async function sendMessage() {
4699
- !e.chatController || Me.value !== "send" || (a.value && (a.value.style.height = "auto", a.value.focus()), i.value?.pin(), await e.chatController.sendComposerMessage());
4781
+ !e.chatController || je.value !== "send" || (a.value && (a.value.style.height = "auto", a.value.focus()), i.value?.pin(), await e.chatController.sendComposerMessage());
4782
+ }
4783
+ async function handleCardAction(t) {
4784
+ !e.chatController || W.value || (i.value?.pin(), await e.chatController.sendChatMessage(t));
4700
4785
  }
4701
4786
  async function sendSuggestedPrompt(t) {
4702
4787
  !e.chatController || W.value || (i.value?.pin(), await e.chatController.sendChatMessage(t.prompt));
4703
4788
  }
4704
4789
  async function handleComposerAction() {
4705
- e.chatController && (Me.value === "send" && i.value?.pin(), await e.chatController.handleComposerAction());
4790
+ e.chatController && (je.value === "send" && i.value?.pin(), await e.chatController.handleComposerAction());
4706
4791
  }
4707
4792
  async function handleKeydown(e) {
4708
4793
  e.key === "Enter" && !e.shiftKey && (e.preventDefault(), await sendMessage());
4709
4794
  }
4710
4795
  function focusComposer(e) {
4711
- Le.value || W.value || e.target instanceof Element && e.target.closest("button, a, textarea") || a.value?.focus();
4796
+ Ie.value || W.value || e.target instanceof Element && e.target.closest("button, a, textarea") || a.value?.focus();
4712
4797
  }
4713
4798
  function adjustTextareaHeight() {
4714
4799
  a.value && (a.value.style.height = "auto", a.value.style.height = `${Math.min(a.value.scrollHeight, 150)}px`);
4715
4800
  }
4716
- se(Te, () => S(() => adjustTextareaHeight()));
4801
+ de(Te, () => ne(() => adjustTextareaHeight()));
4717
4802
  function triggerFileInput() {
4718
4803
  o.value?.click();
4719
4804
  }
@@ -4757,59 +4842,59 @@ var Cr = [
4757
4842
  ...o ? {} : { year: "numeric" }
4758
4843
  })}, ${a}`;
4759
4844
  }
4760
- return (t, s) => (k(), h("div", { class: C(["@container/chat relative flex h-full flex-col", B.value.length === 0 ? "min-h-0 [justify-content:safe_center] overflow-y-auto" : ""]) }, [
4761
- e.showHeader && !G.value ? (k(), h("div", ri, [b(Pe, {
4845
+ return (t, s) => (T(), _("div", { class: S(["@container/chat relative flex h-full flex-col", R.value.length === 0 ? "min-h-0 [justify-content:safe_center] overflow-y-auto" : ""]) }, [
4846
+ e.showHeader && !K.value ? (T(), _("div", ci, [b(Pe, {
4762
4847
  agent: e.agent,
4763
4848
  "is-online": c.value
4764
- }, null, 8, ["agent", "is-online"])])) : e.showHeader ? (k(), h("div", ii, [_("div", { class: C(["flex items-center gap-3", e.centered ? "max-w-[720px] mx-auto" : ""]) }, [
4849
+ }, null, 8, ["agent", "is-online"])])) : e.showHeader ? (T(), _("div", li, [v("div", { class: S(["flex items-center gap-3", e.centered ? "max-w-[720px] mx-auto" : ""]) }, [
4765
4850
  b(ze, {
4766
4851
  agent: e.agent,
4767
- "is-light": G.value,
4852
+ "is-light": K.value,
4768
4853
  class: "size-10"
4769
4854
  }, null, 8, ["agent", "is-light"]),
4770
- _("div", ai, [_("div", oi, F(e.agent.displayName.value), 1), _("div", si, F(e.agent.title.value || "Assistant"), 1)]),
4771
- e.headerMeta ? (k(), h("span", ci, F(e.headerMeta), 1)) : m("", !0)
4772
- ], 2)])) : m("", !0),
4773
- te.value ? (k(), h("div", {
4855
+ v("div", ui, [v("div", di, P(e.agent.displayName.value), 1), v("div", fi, P(e.agent.title.value || "Assistant"), 1)]),
4856
+ e.headerMeta ? (T(), _("span", pi, P(e.headerMeta), 1)) : h("", !0)
4857
+ ], 2)])) : h("", !0),
4858
+ C.value ? (T(), _("div", {
4774
4859
  key: 2,
4775
- class: C(["py-16 flex flex-col items-center justify-center gap-2 text-sm", G.value ? "text-theme-400" : "text-theme-600"])
4776
- }, [b(pe, { class: "size-4" })], 2)) : e.setupHint ? (k(), h("div", {
4860
+ class: S(["py-16 flex flex-col items-center justify-center gap-2 text-sm", K.value ? "text-theme-400" : "text-theme-600"])
4861
+ }, [b(_e, { class: "size-4" })], 2)) : e.setupHint ? (T(), _("div", {
4777
4862
  key: 3,
4778
- class: C(["flex items-center justify-center gap-1.5 py-2 text-[11px]", Ue.value])
4779
- }, [s[20] || (s[20] = _("i", { class: "i-tabler-tool size-3" }, null, -1)), _("span", null, F(e.setupHint), 1)], 2)) : m("", !0),
4780
- b(ni, {
4863
+ class: S(["flex items-center justify-center gap-1.5 py-2 text-[11px]", He.value])
4864
+ }, [s[20] || (s[20] = v("i", { class: "i-tabler-tool size-3" }, null, -1)), v("span", null, P(e.setupHint), 1)], 2)) : h("", !0),
4865
+ b(si, {
4781
4866
  ref_key: "chatScroller",
4782
4867
  ref: i,
4783
- class: C(B.value.length === 0 ? "flex-none" : "flex-1")
4868
+ class: S(R.value.length === 0 ? "flex-none" : "flex-1")
4784
4869
  }, {
4785
- default: ce(() => [_("div", { class: C([B.value.length === 0 ? "flex flex-col items-center justify-center px-3 py-4" : e.centered ? "pt-20 pb-[120px] px-3 space-y-2" : "pt-4 pb-[120px] px-3 space-y-2", e.centered ? B.value.length === 0 ? "max-w-[900px] mx-auto w-full" : "max-w-[720px] mx-auto w-full" : ""]) }, [
4786
- B.value.length === 0 && !te.value ? (k(), h("div", li, [ie(t.$slots, "empty-heading", {
4870
+ default: F(() => [v("div", { class: S([R.value.length === 0 ? "flex flex-col items-center justify-center px-3 py-4" : e.centered ? "pt-20 pb-[120px] px-3 space-y-2" : "pt-4 pb-[120px] px-3 space-y-2", e.centered ? R.value.length === 0 ? "max-w-[900px] mx-auto w-full" : "max-w-[720px] mx-auto w-full" : ""]) }, [
4871
+ R.value.length === 0 && !C.value ? (T(), _("div", mi, [oe(t.$slots, "empty-heading", {
4787
4872
  agent: e.agent,
4788
- isLight: G.value
4873
+ isLight: K.value
4789
4874
  }, () => [b(ze, {
4790
4875
  agent: e.agent,
4791
- "is-light": G.value,
4876
+ "is-light": K.value,
4792
4877
  class: "mb-4 size-20 @sm/chat:size-24"
4793
- }, null, 8, ["agent", "is-light"]), _("div", { class: C(["text-base @sm/chat:text-lg font-semibold", G.value ? "text-theme-900" : "text-white"]) }, F(e.agent.displayName.value), 3)]), e.emptyStateMessage === "" ? m("", !0) : (k(), h(u, { key: 0 }, [_("p", { class: C(["mt-1 text-center text-xs @sm/chat:text-sm", Ue.value]) }, F(e.emptyStateMessage || "Type your message to get started."), 3), _("div", {
4794
- class: C(["inline-flex items-center gap-1.5 mt-5 px-2.5 py-1 rounded-full text-[11px]", G.value ? "bg-theme-50 border border-theme-100 text-theme-400" : "bg-white/10 border border-white/20 text-white/40"]),
4878
+ }, null, 8, ["agent", "is-light"]), v("div", { class: S(["text-base @sm/chat:text-lg font-semibold", K.value ? "text-theme-900" : "text-white"]) }, P(e.agent.displayName.value), 3)]), e.emptyStateMessage === "" ? h("", !0) : (T(), _(f, { key: 0 }, [v("p", { class: S(["mt-1 text-center text-xs @sm/chat:text-sm", He.value]) }, P(e.emptyStateMessage || "Type your message to get started."), 3), v("div", {
4879
+ class: S(["inline-flex items-center gap-1.5 mt-5 px-2.5 py-1 rounded-full text-[11px]", K.value ? "bg-theme-50 border border-theme-100 text-theme-400" : "bg-white/10 border border-white/20 text-white/40"]),
4795
4880
  title: n.value.tooltip
4796
- }, [_("i", { class: C([n.value.icon, "size-3"]) }, null, 2), _("span", null, F(n.value.label), 1)], 10, ui)], 64))])) : m("", !0),
4797
- (k(!0), h(u, null, j(B.value, (e, t) => (k(), h(u, { key: e.id }, [
4798
- shouldShowTimeDivider(B.value, t) ? (k(), h("div", di, [
4799
- _("div", { class: C(["flex-1 h-px", He.value]) }, null, 2),
4800
- _("span", { class: C(["text-[10px] @sm/chat:text-[11px] font-medium shrink-0 tracking-widest uppercase", Ue.value]) }, F(shouldShowTimeDivider(B.value, t)), 3),
4801
- _("div", { class: C(["flex-1 h-px", He.value]) }, null, 2)
4802
- ])) : m("", !0),
4803
- messageWorkJournal(e) ? (k(), h("div", {
4881
+ }, [v("i", { class: S([n.value.icon, "size-3"]) }, null, 2), v("span", null, P(n.value.label), 1)], 10, hi)], 64))])) : h("", !0),
4882
+ (T(!0), _(f, null, A(R.value, (e, t) => (T(), _(f, { key: e.id }, [
4883
+ shouldShowTimeDivider(R.value, t) ? (T(), _("div", gi, [
4884
+ v("div", { class: S(["flex-1 h-px", Ve.value]) }, null, 2),
4885
+ v("span", { class: S(["text-[10px] @sm/chat:text-[11px] font-medium shrink-0 tracking-widest uppercase", He.value]) }, P(shouldShowTimeDivider(R.value, t)), 3),
4886
+ v("div", { class: S(["flex-1 h-px", Ve.value]) }, null, 2)
4887
+ ])) : h("", !0),
4888
+ messageWorkJournal(e) ? (T(), _("div", {
4804
4889
  key: 1,
4805
4890
  "data-test": "messaging-message-tool-activity",
4806
4891
  "data-journal-outcome": messageWorkJournal(e)?.outcome,
4807
4892
  class: "mb-4 w-full"
4808
4893
  }, [b(qe, {
4809
4894
  model: messageWorkJournal(e),
4810
- "is-light": G.value
4811
- }, null, 8, ["model", "is-light"])], 8, fi)) : m("", !0),
4812
- isSystemExplainerMessage(e) ? (k(), h("div", {
4895
+ "is-light": K.value
4896
+ }, null, 8, ["model", "is-light"])], 8, _i)) : h("", !0),
4897
+ isSystemExplainerMessage(e) ? (T(), _("div", {
4813
4898
  key: 2,
4814
4899
  "data-test": "messaging-system-msg",
4815
4900
  "data-message-id": e.id,
@@ -4823,27 +4908,28 @@ var Cr = [
4823
4908
  "data-issue-action-url": e.issue?.actionUrl,
4824
4909
  "data-streaming": e.id === be.value ? "true" : void 0,
4825
4910
  class: "flex gap-2 items-end justify-start mb-4"
4826
- }, [_("div", mi, [_("div", { class: C(["mb-1 pl-1 text-[11px] font-medium", G.value ? "text-theme-500" : "text-white/45"]) }, " System Message ", 2), _("div", { class: C(["rounded-[20px] rounded-bl-[4px] px-4 py-2.5 border system-msg-content", G.value ? "bg-theme-25 border-theme-200 text-theme-700" : "bg-white/[0.08] border-white/10 text-white/85"]) }, [e.text ? (k(), p($r, {
4911
+ }, [v("div", yi, [v("div", { class: S(["mb-1 pl-1 text-[11px] font-medium", K.value ? "text-theme-500" : "text-white/45"]) }, " System Message ", 2), v("div", { class: S(["rounded-[20px] rounded-bl-[4px] px-4 py-2.5 border system-msg-content", K.value ? "bg-theme-25 border-theme-200 text-theme-700" : "bg-white/[0.08] border-white/10 text-white/85"]) }, [e.text ? (T(), m(ii, {
4827
4912
  key: 0,
4828
4913
  text: e.text,
4829
- inverted: !G.value,
4914
+ inverted: !K.value,
4830
4915
  streaming: e.id === be.value,
4831
- onClick: s[0] || (s[0] = z(() => {}, ["stop"]))
4916
+ onClick: s[0] || (s[0] = I(() => {}, ["stop"])),
4917
+ onAction: handleCardAction
4832
4918
  }, null, 8, [
4833
4919
  "text",
4834
4920
  "inverted",
4835
4921
  "streaming"
4836
- ])) : e.issue?.help ? (k(), p($r, {
4922
+ ])) : e.issue?.help ? (T(), m(ii, {
4837
4923
  key: 1,
4838
4924
  text: e.issue.help,
4839
- inverted: !G.value
4840
- }, null, 8, ["text", "inverted"])) : m("", !0), e.issue?.actionUrl && !containsMarkdownLink(e.text) ? (k(), h("a", {
4925
+ inverted: !K.value
4926
+ }, null, 8, ["text", "inverted"])) : h("", !0), e.issue?.actionUrl && !containsMarkdownLink(e.text) ? (T(), _("a", {
4841
4927
  key: 2,
4842
4928
  href: e.issue.actionUrl,
4843
4929
  "data-test": "messaging-system-msg-action",
4844
- class: C(["mt-2 text-[12px] font-medium inline-flex items-center gap-1", G.value ? "text-theme-900 hover:text-theme-700" : "text-white hover:text-white/80"]),
4845
- onClick: s[1] || (s[1] = z(() => {}, ["stop"]))
4846
- }, [v(F(e.issue.actionLabel) + " ", 1), s[21] || (s[21] = _("i", { class: "i-tabler-arrow-right size-3" }, null, -1))], 10, hi)) : m("", !0)], 2)])], 8, pi)) : e.sender === "system" ? (k(), h("div", {
4930
+ class: S(["mt-2 text-[12px] font-medium inline-flex items-center gap-1", K.value ? "text-theme-900 hover:text-theme-700" : "text-white hover:text-white/80"]),
4931
+ onClick: s[1] || (s[1] = I(() => {}, ["stop"]))
4932
+ }, [te(P(e.issue.actionLabel) + " ", 1), s[21] || (s[21] = v("i", { class: "i-tabler-arrow-right size-3" }, null, -1))], 10, bi)) : h("", !0)], 2)])], 8, vi)) : e.sender === "system" ? (T(), _("div", {
4847
4933
  key: 3,
4848
4934
  "data-test": "messaging-system-status-msg",
4849
4935
  "data-message-id": e.id,
@@ -4854,12 +4940,12 @@ var Cr = [
4854
4940
  "data-issue-code": e.issue?.code,
4855
4941
  "data-issue-bucket": e.issue?.bucket,
4856
4942
  "data-streaming": e.id === be.value ? "true" : void 0,
4857
- class: C(["flex items-start gap-2 px-3 py-2 text-[13px] leading-relaxed", G.value ? "text-theme-500" : "text-white/60"])
4858
- }, [s[22] || (s[22] = _("i", { class: "i-tabler-info-circle size-4 mt-0.5 shrink-0" }, null, -1)), b($r, {
4943
+ class: S(["flex items-start gap-2 px-3 py-2 text-[13px] leading-relaxed", K.value ? "text-theme-500" : "text-white/60"])
4944
+ }, [s[22] || (s[22] = v("i", { class: "i-tabler-info-circle size-4 mt-0.5 shrink-0" }, null, -1)), b(ii, {
4859
4945
  text: e.text,
4860
- inverted: !G.value,
4861
- onClick: s[2] || (s[2] = z(() => {}, ["stop"]))
4862
- }, null, 8, ["text", "inverted"])], 10, gi)) : (k(), h("div", {
4946
+ inverted: !K.value,
4947
+ onClick: s[2] || (s[2] = I(() => {}, ["stop"]))
4948
+ }, null, 8, ["text", "inverted"])], 10, xi)) : (T(), _("div", {
4863
4949
  key: 4,
4864
4950
  "data-test": e.sender === "agent" ? "messaging-assistant-msg" : e.sender === "user" ? "messaging-user-msg" : void 0,
4865
4951
  "data-message-id": e.id,
@@ -4868,160 +4954,162 @@ var Cr = [
4868
4954
  "data-message-sequence": e.sequence,
4869
4955
  "data-system-kind": e.systemKind,
4870
4956
  "data-streaming": e.id === be.value ? "true" : void 0,
4871
- class: C(["flex gap-2 items-end", {
4957
+ class: S(["flex gap-2 items-end", {
4872
4958
  "justify-end": e.sender === "user",
4873
4959
  "justify-start": e.sender === "agent",
4874
- "mb-6": isGroupEnd(B.value, t)
4960
+ "mb-6": isGroupEnd(R.value, t)
4875
4961
  }])
4876
- }, [_("div", {
4962
+ }, [v("div", {
4877
4963
  "data-test": "messaging-message-body",
4878
- class: C(e.sender === "user" ? "max-w-[min(78%,30rem)]" : "w-full min-w-0 @sm/chat:pr-[1em] @lg/chat:pr-[2em]")
4879
- }, [blockAttachmentsForMessage(e).length ? (k(), h("div", {
4964
+ class: S(e.sender === "user" ? "max-w-[min(78%,30rem)]" : "w-full min-w-0 @sm/chat:pr-[1em] @lg/chat:pr-[2em]")
4965
+ }, [blockAttachmentsForMessage(e).length ? (T(), _("div", {
4880
4966
  key: 0,
4881
- class: C(["mb-1 space-y-1", e.sender === "user" ? "flex flex-col items-end" : ""])
4882
- }, [(k(!0), h(u, null, j(blockAttachmentsForMessage(e), ({ attachment: e, index: t }) => (k(), h(u, { key: attachmentKey(e, t) }, [e.type === "image" ? (k(), h("img", {
4967
+ class: S(["mb-1 space-y-1", e.sender === "user" ? "flex flex-col items-end" : ""])
4968
+ }, [(T(!0), _(f, null, A(blockAttachmentsForMessage(e), ({ attachment: e, index: t }) => (T(), _(f, { key: attachmentKey(e, t) }, [e.type === "image" ? (T(), _("img", {
4883
4969
  key: 0,
4884
4970
  src: e.src,
4885
4971
  alt: e.filename,
4886
4972
  "data-test": "messaging-attachment",
4887
4973
  "data-attachment-placement": "block",
4888
4974
  class: "rounded-xl object-cover max-h-48 max-w-[240px] @sm/chat:max-w-[320px]"
4889
- }, null, 8, vi)) : e.type === "audio" ? (k(), h("audio", {
4975
+ }, null, 8, Ci)) : e.type === "audio" ? (T(), _("audio", {
4890
4976
  key: 1,
4891
4977
  src: e.src,
4892
4978
  controls: "",
4893
4979
  "data-test": "messaging-attachment",
4894
4980
  "data-attachment-placement": "block",
4895
4981
  class: "max-w-full"
4896
- }, null, 8, yi)) : (k(), h("a", {
4982
+ }, null, 8, wi)) : (T(), _("a", {
4897
4983
  key: 2,
4898
4984
  href: e.src,
4899
4985
  target: "_blank",
4900
4986
  rel: "noopener",
4901
4987
  "data-test": "messaging-attachment",
4902
4988
  "data-attachment-placement": "block",
4903
- class: C(["inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", G.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
4904
- }, [s[23] || (s[23] = _("i", { class: "i-tabler-file size-3.5" }, null, -1)), v(" " + F(e.filename), 1)], 10, bi))], 64))), 128))], 2)) : m("", !0), messageRenderParts(e).length ? (k(), h("div", {
4989
+ class: S(["inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", K.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
4990
+ }, [s[23] || (s[23] = v("i", { class: "i-tabler-file size-3.5" }, null, -1)), te(" " + P(e.filename), 1)], 10, Ti))], 64))), 128))], 2)) : h("", !0), messageRenderParts(e).length ? (T(), _("div", {
4905
4991
  key: 1,
4906
4992
  "data-test": "messaging-message-content",
4907
- class: C(e.sender === "user" ? G.value ? "rounded-[20px] rounded-br-[4px] px-4 py-2.5 bg-theme-900 text-theme-0 shadow-[0_1px_2px_rgba(5,15,25,0.14)]" : "rounded-[20px] rounded-br-[4px] px-4 py-2.5 bg-theme-0 text-theme-950" : G.value ? "text-theme-800" : "text-white/95")
4908
- }, [(k(!0), h(u, null, j(messageRenderParts(e), (t) => (k(), h(u, { key: t.key }, [t.kind === "text" && t.text ? (k(), h("div", xi, [b($r, {
4993
+ class: S(e.sender === "user" ? K.value ? "rounded-[20px] rounded-br-[4px] px-4 py-2.5 bg-theme-900 text-theme-0 shadow-[0_1px_2px_rgba(5,15,25,0.14)]" : "rounded-[20px] rounded-br-[4px] px-4 py-2.5 bg-theme-0 text-theme-950" : K.value ? "text-theme-800" : "text-white/95")
4994
+ }, [(T(!0), _(f, null, A(messageRenderParts(e), (t) => (T(), _(f, { key: t.key }, [t.kind === "text" && t.text ? (T(), _("div", Ei, [b(ii, {
4909
4995
  text: t.text,
4910
- inverted: e.sender === "user" || !G.value,
4996
+ inverted: e.sender === "user" || !K.value,
4911
4997
  streaming: e.id === be.value,
4912
- onClick: s[3] || (s[3] = z(() => {}, ["stop"]))
4998
+ onClick: s[3] || (s[3] = I(() => {}, ["stop"])),
4999
+ onAction: handleCardAction
4913
5000
  }, null, 8, [
4914
5001
  "text",
4915
5002
  "inverted",
4916
5003
  "streaming"
4917
- ])])) : t.kind === "attachment" && t.attachment.type === "image" ? (k(), h("img", {
5004
+ ])])) : t.kind === "attachment" && t.attachment.type === "image" ? (T(), _("img", {
4918
5005
  key: 1,
4919
5006
  src: t.attachment.src,
4920
5007
  alt: t.attachment.filename,
4921
5008
  "data-test": "messaging-attachment",
4922
5009
  "data-attachment-placement": t.placement,
4923
5010
  class: "my-2 rounded-xl object-cover max-h-48 max-w-[240px] @sm/chat:max-w-[320px]"
4924
- }, null, 8, Si)) : t.kind === "attachment" && t.attachment.type === "audio" ? (k(), h("audio", {
5011
+ }, null, 8, Di)) : t.kind === "attachment" && t.attachment.type === "audio" ? (T(), _("audio", {
4925
5012
  key: 2,
4926
5013
  src: t.attachment.src,
4927
5014
  controls: "",
4928
5015
  "data-test": "messaging-attachment",
4929
5016
  "data-attachment-placement": t.placement,
4930
5017
  class: "my-2 max-w-full"
4931
- }, null, 8, Ci)) : t.kind === "attachment" ? (k(), h("a", {
5018
+ }, null, 8, Oi)) : t.kind === "attachment" ? (T(), _("a", {
4932
5019
  key: 3,
4933
5020
  href: t.attachment.src,
4934
5021
  target: "_blank",
4935
5022
  rel: "noopener",
4936
5023
  "data-test": "messaging-attachment",
4937
5024
  "data-attachment-placement": t.placement,
4938
- class: C(["my-2 inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", G.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
4939
- }, [s[24] || (s[24] = _("i", { class: "i-tabler-file size-3.5" }, null, -1)), v(" " + F(t.attachment.filename), 1)], 10, wi)) : m("", !0)], 64))), 128))], 2)) : m("", !0)], 2)], 10, _i)),
4940
- e.id === ve.value ? (k(), h(u, { key: 5 }, [P.value.length ? (k(!0), h(u, { key: 0 }, j(P.value, (e) => (k(), h(u, { key: e.id }, [e.kind === "work" ? (k(), h("div", {
5025
+ class: S(["my-2 inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", K.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
5026
+ }, [s[24] || (s[24] = v("i", { class: "i-tabler-file size-3.5" }, null, -1)), te(" " + P(t.attachment.filename), 1)], 10, ki)) : h("", !0)], 64))), 128))], 2)) : h("", !0)], 2)], 10, Si)),
5027
+ e.id === B.value ? (T(), _(f, { key: 5 }, [j.value.length ? (T(!0), _(f, { key: 0 }, A(j.value, (e) => (T(), _(f, { key: e.id }, [e.kind === "work" ? (T(), _("div", {
4941
5028
  key: 0,
4942
5029
  "data-test": "messaging-tool-activity",
4943
5030
  "data-journal-outcome": e.journal.outcome,
4944
5031
  class: "mb-4 w-full"
4945
5032
  }, [b(qe, {
4946
5033
  model: e.journal,
4947
- "is-light": G.value
4948
- }, null, 8, ["model", "is-light"])], 8, Ti)) : e.kind === "text" && e.content ? (k(), h("div", {
5034
+ "is-light": K.value
5035
+ }, null, 8, ["model", "is-light"])], 8, Ai)) : e.kind === "text" && e.content ? (T(), _("div", {
4949
5036
  key: 1,
4950
5037
  "data-test": "messaging-live-text-block",
4951
- class: C(["mb-4 @sm/chat:pr-[1em] @lg/chat:pr-[2em]", G.value ? "text-theme-800" : "text-white/95"])
4952
- }, [b($r, {
5038
+ class: S(["mb-4 @sm/chat:pr-[1em] @lg/chat:pr-[2em]", K.value ? "text-theme-800" : "text-white/95"])
5039
+ }, [b(ii, {
4953
5040
  text: e.content,
4954
- inverted: !G.value,
4955
- streaming: e.id === oe.value,
4956
- onClick: s[4] || (s[4] = z(() => {}, ["stop"]))
5041
+ inverted: !K.value,
5042
+ streaming: e.id === se.value,
5043
+ onClick: s[4] || (s[4] = I(() => {}, ["stop"])),
5044
+ onAction: handleCardAction
4957
5045
  }, null, 8, [
4958
5046
  "text",
4959
5047
  "inverted",
4960
5048
  "streaming"
4961
- ])], 2)) : (k(), h("div", Ei, [b(pe, { class: C(["size-3.5", G.value ? "text-theme-500" : "text-white/70"]) }, null, 8, ["class"])]))], 64))), 128)) : _e.value ? (k(), h("div", {
5049
+ ])], 2)) : (T(), _("div", ji, [b(_e, { class: S(["size-3.5", K.value ? "text-theme-500" : "text-white/70"]) }, null, 8, ["class"])]))], 64))), 128)) : ve.value ? (T(), _("div", {
4962
5050
  key: 1,
4963
5051
  "data-test": "messaging-tool-activity",
4964
- "data-journal-outcome": _e.value.outcome,
5052
+ "data-journal-outcome": ve.value.outcome,
4965
5053
  class: "mb-4 w-full"
4966
5054
  }, [b(qe, {
4967
- model: _e.value,
4968
- "is-light": G.value
4969
- }, null, 8, ["model", "is-light"])], 8, Di)) : m("", !0)], 64)) : m("", !0)
5055
+ model: ve.value,
5056
+ "is-light": K.value
5057
+ }, null, 8, ["model", "is-light"])], 8, Mi)) : h("", !0)], 64)) : h("", !0)
4970
5058
  ], 64))), 128)),
4971
- he.value ? (k(), h("div", {
5059
+ z.value ? (T(), _("div", {
4972
5060
  key: 1,
4973
5061
  "data-test": "messaging-working-state",
4974
- "data-working-description": he.value,
4975
- class: C(["flex items-center gap-1.5 pl-2 pr-3 pb-1 mb-3 text-[12px] leading-none", G.value ? "text-theme-500" : "text-white/45"])
4976
- }, [s[25] || (s[25] = _("i", {
5062
+ "data-working-description": z.value,
5063
+ class: S(["flex items-center gap-1.5 pl-2 pr-3 pb-1 mb-3 text-[12px] leading-none", K.value ? "text-theme-500" : "text-white/45"])
5064
+ }, [s[25] || (s[25] = v("i", {
4977
5065
  class: "i-tabler-loader-2 size-3.5 shrink-0 animate-spin opacity-70",
4978
5066
  "aria-hidden": "true"
4979
- }, null, -1)), _("span", ki, F(he.value), 1)], 10, Oi)) : m("", !0),
4980
- H.value ? (k(), h("div", {
5067
+ }, null, -1)), v("span", Pi, P(z.value), 1)], 10, Ni)) : h("", !0),
5068
+ H.value ? (T(), _("div", {
4981
5069
  key: 2,
4982
5070
  "data-test": "messaging-transient-issue",
4983
5071
  "data-issue-code": H.value.code,
4984
- class: C(["flex items-center gap-1.5 pl-2 pr-3 pb-1 mb-3 text-[12px] leading-snug", G.value ? "text-theme-600" : "text-white/60"])
5072
+ class: S(["flex items-center gap-1.5 pl-2 pr-3 pb-1 mb-3 text-[12px] leading-snug", K.value ? "text-theme-600" : "text-white/60"])
4985
5073
  }, [
4986
- s[26] || (s[26] = _("i", {
5074
+ s[26] || (s[26] = v("i", {
4987
5075
  class: "i-tabler-alert-circle size-3.5 shrink-0 text-red-500",
4988
5076
  "aria-hidden": "true"
4989
5077
  }, null, -1)),
4990
- _("span", null, [v(F(H.value.message), 1), H.value.help ? (k(), h(u, { key: 0 }, [v(F(H.value.help), 1)], 64)) : m("", !0)]),
4991
- H.value.actionUrl && H.value.actionLabel ? (k(), h("a", {
5078
+ v("span", null, [te(P(H.value.message), 1), H.value.help ? (T(), _(f, { key: 0 }, [te(P(H.value.help), 1)], 64)) : h("", !0)]),
5079
+ H.value.actionUrl && H.value.actionLabel ? (T(), _("a", {
4992
5080
  key: 0,
4993
5081
  href: H.value.actionUrl,
4994
5082
  class: "shrink-0 underline underline-offset-2",
4995
- onClick: s[5] || (s[5] = z(() => {}, ["stop"]))
4996
- }, F(H.value.actionLabel), 9, ji)) : m("", !0)
4997
- ], 10, Ai)) : m("", !0),
4998
- U.value ? (k(), h("div", Mi, [_("i", {
4999
- class: C(["i-svg-spinners-3-dots-bounce size-7", G.value ? "text-theme-400" : "text-white/50"]),
5083
+ onClick: s[5] || (s[5] = I(() => {}, ["stop"]))
5084
+ }, P(H.value.actionLabel), 9, Ii)) : h("", !0)
5085
+ ], 10, Fi)) : h("", !0),
5086
+ U.value ? (T(), _("div", Li, [v("i", {
5087
+ class: S(["i-svg-spinners-3-dots-bounce size-7", K.value ? "text-theme-400" : "text-white/50"]),
5000
5088
  "aria-hidden": "true"
5001
- }, null, 2)])) : m("", !0)
5089
+ }, null, 2)])) : h("", !0)
5002
5090
  ], 2)]),
5003
5091
  _: 3
5004
5092
  }, 8, ["class"]),
5005
- _("div", { class: C(["left-0 right-0 z-30 px-5 pb-4 pt-3", [B.value.length === 0 ? "relative shrink-0" : "absolute bottom-0", G.value ? "bg-gradient-to-t from-theme-0/90 via-theme-0/55 to-transparent" : "bg-gradient-to-t from-black/90 via-black/60 to-transparent"]]) }, [
5006
- Ee.value.length > 0 ? (k(), h("div", {
5093
+ v("div", { class: S(["left-0 right-0 z-30 px-5 pb-4 pt-3", [R.value.length === 0 ? "relative shrink-0" : "absolute bottom-0", K.value ? "bg-gradient-to-t from-theme-0/90 via-theme-0/55 to-transparent" : "bg-gradient-to-t from-black/90 via-black/60 to-transparent"]]) }, [
5094
+ Ee.value.length > 0 ? (T(), _("div", {
5007
5095
  key: 0,
5008
- class: C(["flex items-center gap-2 px-2 pb-2 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden", e.centered ? "max-w-[720px] mx-auto" : ""])
5009
- }, [(k(!0), h(u, null, j(Ee.value, (e, t) => (k(), h("div", {
5096
+ class: S(["flex items-center gap-2 px-2 pb-2 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden", e.centered ? "max-w-[720px] mx-auto" : ""])
5097
+ }, [(T(!0), _(f, null, A(Ee.value, (e, t) => (T(), _("div", {
5010
5098
  key: t,
5011
5099
  class: "relative shrink-0 group"
5012
- }, [e.type === "image" ? (k(), h("img", {
5100
+ }, [e.type === "image" ? (T(), _("img", {
5013
5101
  key: 0,
5014
5102
  src: e.src,
5015
5103
  alt: e.filename,
5016
- class: C(["size-14 rounded-xl object-cover border", G.value ? "border-black/10" : "border-white/20"])
5017
- }, null, 10, Ni)) : (k(), h("div", {
5104
+ class: S(["size-14 rounded-xl object-cover border", K.value ? "border-black/10" : "border-white/20"])
5105
+ }, null, 10, Ri)) : (T(), _("div", {
5018
5106
  key: 1,
5019
- class: C(["h-14 px-3 rounded-xl flex items-center gap-1.5 text-xs border", G.value ? "border-black/10 bg-theme-50 text-theme-600" : "border-white/20 bg-white/10 text-white/70"])
5020
- }, [s[27] || (s[27] = _("i", { class: "i-tabler-file size-4" }, null, -1)), _("span", Pi, F(e.filename), 1)], 2)), _("button", {
5107
+ class: S(["h-14 px-3 rounded-xl flex items-center gap-1.5 text-xs border", K.value ? "border-black/10 bg-theme-50 text-theme-600" : "border-white/20 bg-white/10 text-white/70"])
5108
+ }, [s[27] || (s[27] = v("i", { class: "i-tabler-file size-4" }, null, -1)), v("span", zi, P(e.filename), 1)], 2)), v("button", {
5021
5109
  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",
5022
5110
  onClick: (e) => removeAttachment(t)
5023
- }, [...s[28] || (s[28] = [_("i", { class: "i-tabler-x size-3" }, null, -1)])], 8, Fi)]))), 128)), De.value ? (k(), h("div", Ii, [b(pe, { class: "size-5" })])) : m("", !0)], 2)) : m("", !0),
5024
- Ae.value ? (k(), h("input", {
5111
+ }, [...s[28] || (s[28] = [v("i", { class: "i-tabler-x size-3" }, null, -1)])], 8, Bi)]))), 128)), De.value ? (T(), _("div", Vi, [b(_e, { class: "size-5" })])) : h("", !0)], 2)) : h("", !0),
5112
+ G.value ? (T(), _("input", {
5025
5113
  key: 1,
5026
5114
  ref_key: "fileInput",
5027
5115
  ref: o,
@@ -5029,21 +5117,21 @@ var Cr = [
5029
5117
  accept: "image/*,audio/*,video/*",
5030
5118
  class: "hidden",
5031
5119
  onChange: handleFileSelect
5032
- }, null, 544)) : m("", !0),
5033
- _("div", {
5120
+ }, null, 544)) : h("", !0),
5121
+ v("div", {
5034
5122
  "data-test": "messaging-composer",
5035
- "data-composer-action": Me.value,
5036
- class: C(["w-full cursor-text rounded-2xl px-4 pb-2.5 pt-3 transition-colors duration-200", [e.centered ? "max-w-[720px] mx-auto" : "", G.value ? r.value ? "bg-white shadow-[0_1px_2px_rgba(15,23,42,0.05),0_8px_24px_rgba(15,23,42,0.05)] ring-1 ring-theme-300" : "bg-white shadow-[0_1px_2px_rgba(15,23,42,0.05),0_8px_24px_rgba(15,23,42,0.05)] ring-1 ring-theme-200 hover:ring-theme-300" : r.value ? "bg-white/15 backdrop-blur-xl ring-1 ring-white/25" : "bg-white/10 backdrop-blur-xl ring-1 ring-white/15 hover:ring-white/25"]]),
5123
+ "data-composer-action": je.value,
5124
+ class: S(["w-full cursor-text rounded-2xl px-4 pb-2.5 pt-3 transition-colors duration-200", [e.centered ? "max-w-[720px] mx-auto" : "", K.value ? r.value ? "bg-white shadow-[0_1px_2px_rgba(15,23,42,0.05),0_8px_24px_rgba(15,23,42,0.05)] ring-1 ring-theme-300" : "bg-white shadow-[0_1px_2px_rgba(15,23,42,0.05),0_8px_24px_rgba(15,23,42,0.05)] ring-1 ring-theme-200 hover:ring-theme-300" : r.value ? "bg-white/15 backdrop-blur-xl ring-1 ring-white/25" : "bg-white/10 backdrop-blur-xl ring-1 ring-white/15 hover:ring-white/25"]]),
5037
5125
  onClick: focusComposer
5038
- }, [Le.value ? (k(), h("div", {
5126
+ }, [Ie.value ? (T(), _("div", {
5039
5127
  key: 1,
5040
5128
  "data-test": "messaging-recording-state",
5041
- class: C(["flex min-w-0 items-center gap-2 py-1", G.value ? "text-theme-700" : "text-white/80"])
5129
+ class: S(["flex min-w-0 items-center gap-2 py-1", K.value ? "text-theme-700" : "text-white/80"])
5042
5130
  }, [
5043
- s[29] || (s[29] = _("span", { class: "size-2.5 shrink-0 rounded-full bg-red-500" }, null, -1)),
5044
- _("span", zi, F(Re.value), 1),
5045
- _("span", { class: C(["min-w-0 truncate text-sm", G.value ? "text-theme-400" : "text-white/45"]) }, F(Be.value), 3)
5046
- ], 2)) : R((k(), h("textarea", {
5131
+ s[29] || (s[29] = v("span", { class: "size-2.5 shrink-0 rounded-full bg-red-500" }, null, -1)),
5132
+ v("span", Wi, P(Le.value), 1),
5133
+ v("span", { class: S(["min-w-0 truncate text-sm", K.value ? "text-theme-400" : "text-white/45"]) }, P(Re.value), 3)
5134
+ ], 2)) : pe((T(), _("textarea", {
5047
5135
  key: 0,
5048
5136
  ref_key: "textarea",
5049
5137
  ref: a,
@@ -5057,77 +5145,77 @@ var Cr = [
5057
5145
  fontSize: "16px",
5058
5146
  resize: "none"
5059
5147
  },
5060
- class: C(["block w-full bg-transparent leading-snug focus:outline-none disabled:opacity-50 overflow-y-auto [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden", G.value ? "text-theme-900 placeholder-theme-400" : "text-white placeholder-white/50"]),
5148
+ class: S(["block w-full bg-transparent leading-snug focus:outline-none disabled:opacity-50 overflow-y-auto [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden", K.value ? "text-theme-900 placeholder-theme-400" : "text-white placeholder-white/50"]),
5061
5149
  onKeydown: handleKeydown,
5062
5150
  onFocus: s[7] || (s[7] = (e) => r.value = !0),
5063
5151
  onBlur: s[8] || (s[8] = (e) => r.value = !1)
5064
- }, null, 42, Ri)), [[I, Te.value]]), _("div", Bi, [
5065
- _("button", {
5066
- class: C(["-ml-2 flex size-8 items-center justify-center transition-opacity hover:opacity-70", [
5067
- Ae.value ? "cursor-pointer" : "cursor-default",
5068
- G.value ? "text-theme-500" : "text-white/50",
5152
+ }, null, 42, Ui)), [[ue, Te.value]]), v("div", Gi, [
5153
+ v("button", {
5154
+ class: S(["-ml-2 flex size-8 items-center justify-center transition-opacity hover:opacity-70", [
5155
+ G.value ? "cursor-pointer" : "cursor-default",
5156
+ K.value ? "text-theme-500" : "text-white/50",
5069
5157
  De.value || ke.value ? "opacity-50 pointer-events-none" : ""
5070
5158
  ]]),
5071
- disabled: W.value || De.value || ke.value || !Ae.value,
5072
- "aria-label": Ae.value ? "Attach file" : "File attachments unavailable",
5073
- title: Ae.value ? "Attach file" : "File attachments unavailable",
5074
- onClick: s[9] || (s[9] = (e) => Ae.value && triggerFileInput())
5075
- }, [De.value ? (k(), h("i", Hi)) : (k(), h("i", Ui)), _("span", Wi, F(Ae.value ? "Attach file" : "File attachments unavailable"), 1)], 10, Vi),
5076
- s[30] || (s[30] = _("div", { class: "flex-1" }, null, -1)),
5077
- _("div", Gi, [Ie.value || Le.value ? (k(), h("button", {
5159
+ disabled: W.value || De.value || ke.value || !G.value,
5160
+ "aria-label": G.value ? "Attach file" : "File attachments unavailable",
5161
+ title: G.value ? "Attach file" : "File attachments unavailable",
5162
+ onClick: s[9] || (s[9] = (e) => G.value && triggerFileInput())
5163
+ }, [De.value ? (T(), _("i", qi)) : (T(), _("i", Ji)), v("span", Yi, P(G.value ? "Attach file" : "File attachments unavailable"), 1)], 10, Ki),
5164
+ s[30] || (s[30] = v("div", { class: "flex-1" }, null, -1)),
5165
+ v("div", Xi, [Fe.value || Ie.value ? (T(), _("button", {
5078
5166
  key: 0,
5079
5167
  "data-test": "messaging-record-audio-btn",
5080
- class: C(["flex size-8 cursor-pointer items-center justify-center transition-[opacity,transform] duration-200 hover:opacity-70", Le.value ? G.value ? "text-theme-900 scale-110" : "text-white scale-110" : G.value ? "text-theme-500" : "text-white/60"]),
5081
- "aria-label": Ve.value,
5082
- title: Ve.value,
5083
- onPointerdown: s[10] || (s[10] = z((e) => startRecording(), ["prevent"])),
5084
- onPointerup: s[11] || (s[11] = z((e) => finishRecording({ cancelled: !1 }), ["prevent"])),
5085
- onPointercancel: s[12] || (s[12] = z((e) => finishRecording({ cancelled: !0 }), ["prevent"])),
5168
+ class: S(["flex size-8 cursor-pointer items-center justify-center transition-[opacity,transform] duration-200 hover:opacity-70", Ie.value ? K.value ? "text-theme-900 scale-110" : "text-white scale-110" : K.value ? "text-theme-500" : "text-white/60"]),
5169
+ "aria-label": Be.value,
5170
+ title: Be.value,
5171
+ onPointerdown: s[10] || (s[10] = I((e) => startRecording(), ["prevent"])),
5172
+ onPointerup: s[11] || (s[11] = I((e) => finishRecording({ cancelled: !1 }), ["prevent"])),
5173
+ onPointercancel: s[12] || (s[12] = I((e) => finishRecording({ cancelled: !0 }), ["prevent"])),
5086
5174
  onKeydown: [
5087
- s[13] || (s[13] = ue(z((e) => startRecording(), ["prevent"]), ["enter"])),
5088
- s[15] || (s[15] = ue(z((e) => startRecording(), ["prevent"]), ["space"])),
5089
- s[17] || (s[17] = ue(z((e) => finishRecording({ cancelled: !0 }), ["prevent"]), ["escape"]))
5175
+ s[13] || (s[13] = he(I((e) => startRecording(), ["prevent"]), ["enter"])),
5176
+ s[15] || (s[15] = he(I((e) => startRecording(), ["prevent"]), ["space"])),
5177
+ s[17] || (s[17] = he(I((e) => finishRecording({ cancelled: !0 }), ["prevent"]), ["escape"]))
5090
5178
  ],
5091
- onKeyup: [s[14] || (s[14] = ue(z((e) => finishRecording({ cancelled: !1 }), ["prevent"]), ["enter"])), s[16] || (s[16] = ue(z((e) => finishRecording({ cancelled: !1 }), ["prevent"]), ["space"]))]
5092
- }, [_("i", { class: C([Le.value ? "i-tabler-microphone-filled" : "i-tabler-microphone", "size-[18px]"]) }, null, 2), _("span", qi, F(Ve.value), 1)], 42, Ki)) : m("", !0), Le.value ? m("", !0) : (k(), h("button", {
5179
+ onKeyup: [s[14] || (s[14] = he(I((e) => finishRecording({ cancelled: !1 }), ["prevent"]), ["enter"])), s[16] || (s[16] = he(I((e) => finishRecording({ cancelled: !1 }), ["prevent"]), ["space"]))]
5180
+ }, [v("i", { class: S([Ie.value ? "i-tabler-microphone-filled" : "i-tabler-microphone", "size-[18px]"]) }, null, 2), v("span", Qi, P(Be.value), 1)], 42, Zi)) : h("", !0), Ie.value ? h("", !0) : (T(), _("button", {
5093
5181
  key: 1,
5094
5182
  "data-test": "messaging-send-btn",
5095
- "data-composer-action": Me.value,
5096
- class: C(["flex size-8 items-center justify-center rounded-full transition-colors duration-150", Ne.value ? G.value ? "bg-theme-900 text-theme-0 hover:bg-theme-800 cursor-pointer" : "bg-theme-0 text-theme-950 hover:bg-theme-100 cursor-pointer" : G.value ? "bg-theme-100 text-theme-400" : "bg-white/10 text-white/30"]),
5097
- disabled: !Ne.value,
5098
- "aria-label": Fe.value,
5099
- title: Fe.value,
5183
+ "data-composer-action": je.value,
5184
+ class: S(["flex size-8 items-center justify-center rounded-full transition-colors duration-150", Me.value ? K.value ? "bg-theme-900 text-theme-0 hover:bg-theme-800 cursor-pointer" : "bg-theme-0 text-theme-950 hover:bg-theme-100 cursor-pointer" : K.value ? "bg-theme-100 text-theme-400" : "bg-white/10 text-white/30"]),
5185
+ disabled: !Me.value,
5186
+ "aria-label": Ne.value,
5187
+ title: Ne.value,
5100
5188
  onClick: s[18] || (s[18] = (e) => handleComposerAction())
5101
- }, [Me.value === "stop" ? (k(), h("i", Yi)) : (k(), h("i", Xi)), _("span", Zi, F(Fe.value), 1)], 10, Ji))])
5102
- ])], 10, Li),
5103
- B.value.length === 0 && e.suggestedPrompts.length > 0 ? (k(), h("div", Qi, [_("div", $i, [(k(!0), h(u, null, j(e.suggestedPrompts, (e, t) => (k(), h("button", {
5189
+ }, [je.value === "stop" ? (T(), _("i", ea)) : (T(), _("i", ta)), v("span", na, P(Ne.value), 1)], 10, $i))])
5190
+ ])], 10, Hi),
5191
+ R.value.length === 0 && e.suggestedPrompts.length > 0 ? (T(), _("div", ra, [v("div", ia, [(T(!0), _(f, null, A(e.suggestedPrompts, (e, t) => (T(), _("button", {
5104
5192
  key: e.id,
5105
5193
  type: "button",
5106
5194
  disabled: W.value,
5107
5195
  "data-test": "messaging-suggested-prompt",
5108
- class: C(["w-full rounded-2xl bg-theme-50 px-4 py-3 text-left text-[14.5px] font-medium transition-colors sm:w-auto sm:rounded-full sm:py-2 sm:text-center sm:text-[14px]", [W.value ? "cursor-not-allowed text-theme-300" : "cursor-pointer text-theme-600 hover:bg-theme-100 hover:text-theme-900", !ae.value && t >= 3 ? "max-sm:hidden" : ""]]),
5196
+ class: S(["w-full rounded-2xl bg-theme-50 px-4 py-3 text-left text-[14.5px] font-medium transition-colors sm:w-auto sm:rounded-full sm:py-2 sm:text-center sm:text-[14px]", [W.value ? "cursor-not-allowed text-theme-300" : "cursor-pointer text-theme-600 hover:bg-theme-100 hover:text-theme-900", !re.value && t >= 3 ? "max-sm:hidden" : ""]]),
5109
5197
  onClick: (t) => sendSuggestedPrompt(e)
5110
- }, F(e.label), 11, ea))), 128)), e.suggestedPrompts.length > 3 ? (k(), h("button", {
5198
+ }, P(e.label), 11, aa))), 128)), e.suggestedPrompts.length > 3 ? (T(), _("button", {
5111
5199
  key: 0,
5112
5200
  type: "button",
5113
5201
  "data-test": "messaging-suggested-prompts-more",
5114
- "aria-expanded": ae.value,
5202
+ "aria-expanded": re.value,
5115
5203
  class: "flex w-full cursor-pointer items-center justify-center gap-1.5 rounded-2xl px-4 py-3 text-[14px] font-medium text-theme-600 ring-1 ring-theme-200 transition-colors hover:bg-theme-50 hover:text-theme-900 sm:hidden",
5116
- onClick: s[19] || (s[19] = (e) => ae.value = !ae.value)
5117
- }, [v(F(ae.value ? "See less" : "See more") + " ", 1), _("i", { class: C(["i-tabler-chevron-down size-4 transition-transform", ae.value ? "rotate-180" : ""]) }, null, 2)], 8, ta)) : m("", !0)])])) : m("", !0)
5204
+ onClick: s[19] || (s[19] = (e) => re.value = !re.value)
5205
+ }, [te(P(re.value ? "See less" : "See more") + " ", 1), v("i", { class: S(["i-tabler-chevron-down size-4 transition-transform", re.value ? "rotate-180" : ""]) }, null, 2)], 8, oa)) : h("", !0)])])) : h("", !0)
5118
5206
  ], 2)
5119
5207
  ], 2));
5120
5208
  }
5121
- }), ra = { class: "agent-wrap" }, ia = {
5209
+ }), ca = { class: "agent-wrap" }, la = {
5122
5210
  key: 0,
5123
5211
  class: "flex items-center justify-center h-full"
5124
- }, aa = {
5212
+ }, ua = {
5125
5213
  key: 2,
5126
5214
  class: "flex h-full flex-col items-center justify-center gap-4 px-6 text-center",
5127
5215
  role: "status",
5128
5216
  "aria-live": "polite",
5129
5217
  "data-test": "agent-unavailable"
5130
- }, oa = /* @__PURE__ */ x({
5218
+ }, da = /* @__PURE__ */ x({
5131
5219
  __name: "AgentWrap",
5132
5220
  props: {
5133
5221
  sdk: {},
@@ -5147,7 +5235,7 @@ var Cr = [
5147
5235
  let r = a("AgentWrap"), i = e, o = i.sdk || t.getInstance({
5148
5236
  isDev: typeof window < "u" ? window.location.hostname === "localhost" || window.location.hostname.includes("127.0.0.1") : !1,
5149
5237
  ...i.apiBase && { apiBase: i.apiBase }
5150
- }), s = P(!i.agent), c = P(i.agent ? new n({ config: i.agent }) : void 0), u = P();
5238
+ }), s = se(!i.agent), c = se(i.agent ? new n({ config: i.agent }) : void 0), u = se();
5151
5239
  async function loadAgent() {
5152
5240
  if (i.agent) {
5153
5241
  r.debug("Agent provided via props, skipping fetch", {
@@ -5223,23 +5311,23 @@ var Cr = [
5223
5311
  });
5224
5312
  }
5225
5313
  }
5226
- return ne(loadAgent), (t, n) => (k(), h("div", ra, [s.value ? (k(), h("div", ia, [_("div", { class: C(["size-6 animate-spin rounded-full border-b-2", i.bare ? "border-theme-400" : "border-white"]) }, null, 2)])) : c.value ? ie(t.$slots, "default", {
5227
- sdk: oe(o),
5314
+ return ie(loadAgent), (t, n) => (T(), _("div", ca, [s.value ? (T(), _("div", la, [v("div", { class: S(["size-6 animate-spin rounded-full border-b-2", i.bare ? "border-theme-400" : "border-white"]) }, null, 2)])) : c.value ? oe(t.$slots, "default", {
5315
+ sdk: ce(o),
5228
5316
  agent: c.value,
5229
5317
  context: e.clientContext ?? e.context,
5230
5318
  firstMessage: e.firstMessage,
5231
5319
  buttonText: e.buttonText,
5232
5320
  buttonIcon: e.buttonIcon,
5233
5321
  loading: s.value
5234
- }, void 0, void 0, 1) : u.value ? (k(), h("div", aa, [n[0] || (n[0] = _("p", { class: "text-sm font-medium text-theme-600" }, " This assistant is unavailable right now. ", -1)), _("button", {
5322
+ }, void 0, void 0, 1) : u.value ? (T(), _("div", ua, [n[0] || (n[0] = v("p", { class: "text-sm font-medium text-theme-600" }, " This assistant is unavailable right now. ", -1)), v("button", {
5235
5323
  type: "button",
5236
5324
  class: "min-h-11 rounded-full bg-theme-900 px-5 text-sm font-semibold text-theme-0 transition-colors hover:bg-theme-700",
5237
5325
  "data-test": "agent-unavailable-retry",
5238
5326
  onClick: loadAgent
5239
- }, " Try again ")])) : m("", !0)]));
5327
+ }, " Try again ")])) : h("", !0)]));
5240
5328
  }
5241
5329
  });
5242
5330
  //#endregion
5243
- export { Oe as a, getAgentAvatarUrl as c, AgentChatController as d, he as f, Pe as i, handleImageError as l, pe as m, na as n, Ee as o, n as p, $r as r, we as s, oa as t, parseButtonTemplate as u };
5331
+ export { ke as a, getAgentAvatarUrl as c, AgentChatController as d, ve as f, Pe as i, handleImageError as l, _e as m, sa as n, De as o, n as p, ii as r, Te as s, da as t, parseButtonTemplate as u };
5244
5332
 
5245
5333
  //# sourceMappingURL=AgentWrap.js.map