@pagelines/sdk 1.0.913 → 1.0.915

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/BotWrap.js CHANGED
@@ -1,18 +1,18 @@
1
1
  import { t as e } from "./rolldown-runtime.js";
2
2
  import { c as t, t as n } from "./sdkClient.js";
3
3
  import { CUSTOMER_COMPUTER_STATE_LABEL as r, SettingsObject as i, chatTransportError as a, createLogger as o, customerComputerState as s, getDefaultAvatarUrl as c, isAssistantSilenceControl as d, parseChatCardFencePayload as f, parseChatVisualFencePayload as p } from "@pagelines/core";
4
- import { Fragment as m, Transition as g, computed as _, createBlock as v, createCommentVNode as y, createElementBlock as b, createElementVNode as x, createTextVNode as w, createVNode as T, defineComponent as E, nextTick as ee, normalizeClass as D, normalizeStyle as A, onBeforeUnmount as te, onMounted as ne, onUnmounted as ae, openBlock as j, ref as M, renderList as N, renderSlot as ce, resolveDynamicComponent as le, shallowRef as R, toDisplayString as B, unref as V, useTemplateRef as ue, vModelText as fe, watch as pe, withCtx as me, withDirectives as he, withKeys as ge, withModifiers as _e } from "vue";
4
+ import { Fragment as m, Teleport as g, Transition as _, computed as v, createBlock as y, createCommentVNode as b, createElementBlock as x, createElementVNode as w, createTextVNode as T, createVNode as E, defineComponent as D, guardReactiveProps as A, nextTick as ee, normalizeClass as j, normalizeProps as M, normalizeStyle as N, onBeforeUnmount as te, onMounted as ne, onUnmounted as ae, openBlock as R, ref as B, renderList as V, renderSlot as ce, resolveDynamicComponent as H, shallowRef as U, toDisplayString as G, unref as le, useTemplateRef as ue, vModelText as fe, watch as pe, withCtx as me, withDirectives as he, withKeys as ge, withModifiers as K } from "vue";
5
5
  //#region \0plugin-vue:export-helper
6
- var ve = /* @__PURE__ */ e((e, t) => {
6
+ var _e = /* @__PURE__ */ e((e, t) => {
7
7
  let n = e.__vccOpts || e;
8
8
  for (let [e, r] of t) n[e] = r;
9
9
  return n;
10
- }, "default"), ye = {}, H = { class: "spinner max-w-sm" };
10
+ }, "default"), J = {}, ve = { class: "spinner max-w-sm" };
11
11
  function _sfc_render(e, t) {
12
- return j(), b("div", H, [...t[0] || (t[0] = [x("svg", {
12
+ return R(), x("div", ve, [...t[0] || (t[0] = [w("svg", {
13
13
  class: "ring-circular h-full w-full origin-center",
14
14
  viewBox: "25 25 50 50"
15
- }, [x("circle", {
15
+ }, [w("circle", {
16
16
  class: "ring-path",
17
17
  cx: "50",
18
18
  cy: "50",
@@ -23,7 +23,7 @@ function _sfc_render(e, t) {
23
23
  "stroke-miterlimit": "30"
24
24
  })], -1)])]);
25
25
  }
26
- var xe = /*#__PURE__*/ ve(ye, [["render", _sfc_render]]);
26
+ var Y = /*#__PURE__*/ _e(J, [["render", _sfc_render]]);
27
27
  //#endregion
28
28
  //#region bot/VoiceRecorderController.ts
29
29
  function formatVoiceRecordingDuration(e) {
@@ -40,12 +40,12 @@ function recorderMimeType() {
40
40
  "audio/webm"
41
41
  ].find((e) => MediaRecorder.isTypeSupported?.(e)) || "";
42
42
  }
43
- var U = 400, VoiceRecorderController = class extends i {
43
+ var ye = 400, VoiceRecorderController = class extends i {
44
44
  constructor(e) {
45
- super("VoiceRecorderController", e), t(this, "state", M({
45
+ super("VoiceRecorderController", e), t(this, "state", B({
46
46
  phase: "idle",
47
47
  elapsedMs: 0
48
- })), t(this, "isActive", _(() => this.state.value.phase !== "idle")), t(this, "isBusy", _(() => this.state.value.phase !== "idle")), t(this, "elapsedLabel", _(() => formatVoiceRecordingDuration({ ms: this.state.value.elapsedMs }))), t(this, "statusText", _(() => this.state.value.phase === "preparing" ? "Starting microphone" : this.state.value.phase === "sending" ? "Sending voice message" : "Release to send")), t(this, "recorder", void 0), t(this, "stream", void 0), t(this, "chunks", []), t(this, "timer", void 0), t(this, "startedAt", 0), t(this, "cancelOnStop", !1), t(this, "stopAfterStart", !1), t(this, "startToken", 0);
48
+ })), t(this, "isActive", v(() => this.state.value.phase !== "idle")), t(this, "isBusy", v(() => this.state.value.phase !== "idle")), t(this, "elapsedLabel", v(() => formatVoiceRecordingDuration({ ms: this.state.value.elapsedMs }))), t(this, "statusText", v(() => this.state.value.phase === "preparing" ? "Starting microphone" : this.state.value.phase === "sending" ? "Sending voice message" : "Release to send")), t(this, "recorder", void 0), t(this, "stream", void 0), t(this, "chunks", []), t(this, "timer", void 0), t(this, "startedAt", 0), t(this, "cancelOnStop", !1), t(this, "stopAfterStart", !1), t(this, "startToken", 0);
49
49
  }
50
50
  get canUseBrowserRecording() {
51
51
  return !!this.settings.getUserMedia || typeof navigator < "u" && !!navigator.mediaDevices?.getUserMedia && typeof MediaRecorder < "u";
@@ -74,7 +74,7 @@ var U = 400, VoiceRecorderController = class extends i {
74
74
  this.stream = t, this.recorder = r, this.chunks = [], r.addEventListener("dataavailable", (e) => {
75
75
  e.data.size > 0 && this.chunks.push(e.data);
76
76
  }), r.addEventListener("stop", async () => {
77
- let e = new Blob(this.chunks, { type: r.mimeType || n || "audio/webm" }), t = this.now() - this.startedAt, i = !this.cancelOnStop && e.size > 0 && t >= U;
77
+ let e = new Blob(this.chunks, { type: r.mimeType || n || "audio/webm" }), t = this.now() - this.startedAt, i = !this.cancelOnStop && e.size > 0 && t >= ye;
78
78
  if (this.stopCapture(), !i) {
79
79
  this.reset();
80
80
  return;
@@ -157,7 +157,7 @@ var U = 400, VoiceRecorderController = class extends i {
157
157
  function durableJournalOutcome(e) {
158
158
  return e.turnOutcome === "failed" ? "failed" : e.turnOutcome === "stopped" ? "stopped" : e.sender === "system" ? "failed" : "completed";
159
159
  }
160
- var G = {
160
+ var xe = {
161
161
  finishing: "Finishing up",
162
162
  slowHint: "Taking longer than usual.",
163
163
  completed: "Work complete",
@@ -165,7 +165,7 @@ var G = {
165
165
  stopped: "Stopped",
166
166
  notifyHint: "Taking longer than usual. You can leave and I’ll notify you when it’s ready.",
167
167
  leaveHint: "Taking longer than usual. You can leave this chat while I work."
168
- }, K = 1e4, Se = 15e3, Ce = 6e4, Ee = 3;
168
+ }, Se = 1e4, Ce = 15e3, Ee = 6e4, De = 3;
169
169
  function toMs(e) {
170
170
  if (!e) return;
171
171
  let t = Date.parse(e);
@@ -181,7 +181,7 @@ function milestoneRows(e, t) {
181
181
  let n = e.filter((e) => e.status === "completed" || e.status === "failed" && !!e.note).filter((e) => !t.has(e.activityId)).slice().sort(byEvent), r = [];
182
182
  for (let e of n) {
183
183
  let t = e.status === "completed" ? "done" : "failed", n = r[r.length - 1];
184
- if (t === "done" && n?.tone === "done" && n.label === e.label && eventMs(e) - n.lastMs <= Se) {
184
+ if (t === "done" && n?.tone === "done" && n.label === e.label && eventMs(e) - n.lastMs <= Ce) {
185
185
  n.count += 1, n.lastMs = eventMs(e);
186
186
  continue;
187
187
  }
@@ -202,12 +202,12 @@ function milestoneRows(e, t) {
202
202
  }));
203
203
  }
204
204
  function splitRows(e) {
205
- return e.length <= Ee ? {
205
+ return e.length <= De ? {
206
206
  visibleRows: e,
207
207
  hiddenRows: []
208
208
  } : {
209
- visibleRows: e.slice(e.length - Ee),
210
- hiddenRows: e.slice(0, e.length - Ee)
209
+ visibleRows: e.slice(e.length - De),
210
+ hiddenRows: e.slice(0, e.length - De)
211
211
  };
212
212
  }
213
213
  function buildWorkJournalModel(e) {
@@ -219,7 +219,7 @@ function buildWorkJournalModel(e) {
219
219
  terminal: {
220
220
  id: "work-complete",
221
221
  tone: "completed",
222
- label: G.completed
222
+ label: xe.completed
223
223
  }
224
224
  };
225
225
  if (n === "failed") {
@@ -233,7 +233,7 @@ function buildWorkJournalModel(e) {
233
233
  terminal: {
234
234
  id: "work-failed",
235
235
  tone: "failed",
236
- label: G.failed,
236
+ label: xe.failed,
237
237
  ...o && e?.note ? { note: e.note } : {}
238
238
  }
239
239
  };
@@ -247,18 +247,18 @@ function buildWorkJournalModel(e) {
247
247
  terminal: {
248
248
  id: "work-stopped",
249
249
  tone: "stopped",
250
- label: G.stopped
250
+ label: xe.stopped
251
251
  }
252
252
  };
253
253
  }
254
254
  let { visibleRows: s, hiddenRows: c } = splitRows(milestoneRows(t, /* @__PURE__ */ new Set())), d = 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) => {
255
255
  let n = toMs(t.startedAt) ?? toMs(t.endedAt);
256
256
  return n === void 0 ? e : Math.min(e, n);
257
- }, Infinity), g = p + K, _ = (Number.isFinite(m) ? m : p) + Ce, v = r >= g, y = d || v ? {
257
+ }, Infinity), g = p + Se, _ = (Number.isFinite(m) ? m : p) + Ee, v = r >= g, y = d || v ? {
258
258
  id: d?.activityId ?? "work-active",
259
259
  tone: "active",
260
- label: d?.label ?? G.finishing
261
- } : void 0, b = v && r >= _ ? i ? G.notifyHint : G.leaveHint : void 0, x = [g, _].filter((e) => e > r).sort((e, t) => e - t)[0];
260
+ label: d?.label ?? xe.finishing
261
+ } : void 0, b = v && r >= _ ? i ? xe.notifyHint : xe.leaveHint : void 0, x = [g, _].filter((e) => e > r).sort((e, t) => e - t)[0];
262
262
  return {
263
263
  outcome: n,
264
264
  visibleRows: s,
@@ -352,16 +352,16 @@ var BotChatController = class extends i {
352
352
  super("BotChatController", e), t(this, "isTextMode", !1), t(this, "lastMessage", {
353
353
  hash: "",
354
354
  time: 0
355
- }), t(this, "isConnecting", !1), t(this, "turnEpoch", 0), t(this, "nextStreamToken", 0), t(this, "runningStreamToken", void 0), t(this, "suppressedStreamTokens", /* @__PURE__ */ new Set()), t(this, "queuedMessageIdSet", M(/* @__PURE__ */ new Set())), t(this, "queuedMessageIds", _(() => this.queuedMessageIdSet.value)), t(this, "boundaryTimer", void 0), t(this, "nowMs", R(Date.now())), t(this, "toolActivityTiming", R({})), t(this, "lastVisibleProgressAtMs", R()), t(this, "liveSegments", R([])), t(this, "liveStreamMessageId", R(void 0)), t(this, "conversationId", void 0), t(this, "textState", M({
355
+ }), t(this, "isConnecting", !1), t(this, "turnEpoch", 0), t(this, "nextStreamToken", 0), t(this, "runningStreamToken", void 0), t(this, "suppressedStreamTokens", /* @__PURE__ */ new Set()), t(this, "queuedMessageIdSet", B(/* @__PURE__ */ new Set())), t(this, "queuedMessageIds", v(() => this.queuedMessageIdSet.value)), t(this, "boundaryTimer", void 0), t(this, "nowMs", U(Date.now())), t(this, "toolActivityTiming", U({})), t(this, "lastVisibleProgressAtMs", U()), t(this, "liveSegments", U([])), t(this, "liveStreamMessageId", U(void 0)), t(this, "conversationId", void 0), t(this, "textState", B({
356
356
  isActive: !1,
357
357
  isConnected: !1,
358
358
  isThinking: !1,
359
359
  connectionStatus: "disconnected"
360
- })), t(this, "botMode", M("self")), t(this, "sharedMessages", M([])), t(this, "composerState", M({
360
+ })), t(this, "botMode", B("self")), t(this, "sharedMessages", B([])), t(this, "composerState", B({
361
361
  text: "",
362
362
  pendingAttachments: [],
363
363
  isUploading: !1
364
- })), t(this, "workJournal", _(() => {
364
+ })), t(this, "workJournal", v(() => {
365
365
  let e = this.textState.value.isThinking ? "running" : this.textState.value.turnOutcome;
366
366
  if (!e) return;
367
367
  let t = this.textState.value.toolActivities;
@@ -372,7 +372,7 @@ var BotChatController = class extends i {
372
372
  canNotifyOnCompletion: !1,
373
373
  lastVisibleProgressAtMs: this.lastVisibleProgressAtMs.value
374
374
  });
375
- })), t(this, "liveTurnBlocks", _(() => {
375
+ })), t(this, "liveTurnBlocks", v(() => {
376
376
  if (!this.textState.value.isThinking) return [];
377
377
  let e = this.textState.value.toolActivities ?? [], t = this.liveSegments.value;
378
378
  return !t.length && !e.length ? [] : buildLiveTurnBlocks({
@@ -382,14 +382,14 @@ var BotChatController = class extends i {
382
382
  canNotifyOnCompletion: !1,
383
383
  lastVisibleProgressAtMs: this.lastVisibleProgressAtMs.value
384
384
  });
385
- })), t(this, "canUseComposer", _(() => this.textState.value.sendBlockedReason !== "bot_deleted" && !this.composerState.value.isUploading)), t(this, "canAttachFile", _(() => !!this.settings.uploadFileFn)), t(this, "canRecordAudio", _(() => this.canAttachFile.value && this.canUseComposer.value && !this.composerState.value.text.trim() && this.composerState.value.pendingAttachments.length === 0)), t(this, "voiceRecorder", new VoiceRecorderController({
385
+ })), t(this, "canUseComposer", v(() => this.textState.value.sendBlockedReason !== "bot_deleted" && !this.composerState.value.isUploading)), t(this, "canAttachFile", v(() => !!this.settings.uploadFileFn)), t(this, "canRecordAudio", v(() => this.canAttachFile.value && this.canUseComposer.value && !this.composerState.value.text.trim() && this.composerState.value.pendingAttachments.length === 0)), t(this, "voiceRecorder", new VoiceRecorderController({
386
386
  getCanRecord: () => this.canRecordAudio.value,
387
387
  getUploadFn: () => {
388
388
  let e = this.settings.uploadFileFn;
389
389
  return e ? (t) => e({ file: t }) : void 0;
390
390
  },
391
391
  getChatController: () => this
392
- })), t(this, "canSend", _(() => (this.composerState.value.text.trim().length > 0 || this.composerState.value.pendingAttachments.length > 0) && this.canUseComposer.value && !this.voiceRecorder.isBusy.value)), t(this, "canStop", _(() => this.textState.value.isThinking && !this.composerState.value.isUploading && !this.voiceRecorder.isBusy.value)), t(this, "composerAction", _(() => this.canSend.value ? "send" : this.canStop.value ? "stop" : "idle")), t(this, "composerShowsSecondaryStop", _(() => this.canStop.value && this.composerAction.value === "send")), t(this, "canStartVoice", _(() => {
392
+ })), t(this, "canSend", v(() => (this.composerState.value.text.trim().length > 0 || this.composerState.value.pendingAttachments.length > 0) && this.canUseComposer.value && !this.voiceRecorder.isBusy.value)), t(this, "canStop", v(() => this.textState.value.isThinking && !this.composerState.value.isUploading && !this.voiceRecorder.isBusy.value)), t(this, "composerAction", v(() => this.canSend.value ? "send" : this.canStop.value ? "stop" : "idle")), t(this, "composerShowsSecondaryStop", v(() => this.canStop.value && this.composerAction.value === "send")), t(this, "canStartVoice", v(() => {
393
393
  let e = this.settings.sdk;
394
394
  return this.textState.value.sendBlockedReason !== "bot_deleted" && !!e?.activeUser.value && !!this._bot.botId.value && !!this._bot.orgId.value && !!this.settings.createVoiceClientFn && voiceBrowserSupported();
395
395
  })), t(this, "_bot", void 0), t(this, "localMessageSeq", 0), this._bot = e.bot, this.setupModeWatcher(), this.setupAvailabilityWatcher(), this.setupBoundaryWatcher();
@@ -417,14 +417,17 @@ var BotChatController = class extends i {
417
417
  sender: t,
418
418
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
419
419
  attachments: n,
420
- ...r ? { issue: r } : {}
420
+ ...r
421
421
  }]);
422
422
  }
423
423
  nextLocalMessageId() {
424
424
  return `${Date.now()}-${++this.localMessageSeq}`;
425
425
  }
426
- notify(e) {
427
- e && this.addMessage(e, "system");
426
+ notify(e, t) {
427
+ e && this.addMessage(e, "system", void 0, t);
428
+ }
429
+ get messageShare() {
430
+ return this.settings.messageShareFns;
428
431
  }
429
432
  get canReportMessages() {
430
433
  return !!this.settings.reportMessageFn;
@@ -786,11 +789,11 @@ var BotChatController = class extends i {
786
789
  ...m ? { actionUrl: m } : {},
787
790
  ...g ? { help: g } : {}
788
791
  }, v = o === "account" ? "account" : a === "BOT_DELETED" ? "bot_deleted" : void 0;
789
- v ? (this.addMessage(c, "system", void 0, {
792
+ v ? (this.addMessage(c, "system", void 0, { issue: {
790
793
  code: a,
791
794
  bucket: o,
792
795
  ..._
793
- }), this.updateState(this.textState, {
796
+ } }), this.updateState(this.textState, {
794
797
  isThinking: !1,
795
798
  sendBlockedReason: v
796
799
  })) : this.updateState(this.textState, {
@@ -934,10 +937,10 @@ function parseButtonTemplate(e) {
934
937
  }
935
938
  //#endregion
936
939
  //#region bot/ui/ElBotButton.vue?vue&type=script&setup=true&lang.ts
937
- var De = {
940
+ var ke = {
938
941
  key: 0,
939
942
  class: "absolute inset-0 flex items-center justify-center"
940
- }, ke = /* @__PURE__ */ E({
943
+ }, Ae = /* @__PURE__ */ D({
941
944
  __name: "ElBotButton",
942
945
  props: {
943
946
  theme: { default: "primary" },
@@ -950,40 +953,40 @@ var De = {
950
953
  iconAfter: {}
951
954
  },
952
955
  setup(e) {
953
- let t = _(() => ({
956
+ let t = v(() => ({
954
957
  primary: "bg-primary-600 border-primary-400 hover:border-primary-300 hover:bg-primary-500",
955
958
  green: "bg-green-600 border-green-400 hover:border-green-300 hover:bg-green-500",
956
959
  red: "bg-red-600 border-red-400 hover:border-red-300 hover:bg-red-500",
957
960
  default: "bg-white/10 border-white/20 hover:border-white/40 hover:bg-white/20",
958
961
  dark: "bg-theme-900 border-transparent hover:bg-theme-800"
959
- })[e.theme]), n = _(() => ({
962
+ })[e.theme]), n = v(() => ({
960
963
  sm: "px-4 py-2 text-sm",
961
964
  md: "px-6 py-3 text-base",
962
965
  lg: "px-8 py-4 text-base"
963
- })[e.size]), r = _(() => ({
966
+ })[e.size]), r = v(() => ({
964
967
  sm: "size-4",
965
968
  md: "size-4",
966
969
  lg: "size-5"
967
970
  })[e.size]);
968
- return (i, a) => (j(), b("button", { class: D(["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 ? (j(), b("div", De, [...a[0] || (a[0] = [x("i", { class: "i-svg-spinners-90-ring-with-bg size-5" }, null, -1)])])) : y("", !0), x("span", { class: D(["flex items-center gap-2 transition-opacity duration-200", e.loading ? "opacity-0" : "opacity-100"]) }, [
969
- e.icon ? (j(), b("i", {
971
+ return (i, a) => (R(), x("button", { class: j(["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 ? (R(), x("div", ke, [...a[0] || (a[0] = [w("i", { class: "i-svg-spinners-90-ring-with-bg size-5" }, null, -1)])])) : b("", !0), w("span", { class: j(["flex items-center gap-2 transition-opacity duration-200", e.loading ? "opacity-0" : "opacity-100"]) }, [
972
+ e.icon ? (R(), x("i", {
970
973
  key: 0,
971
- class: D([e.icon, r.value])
972
- }, null, 2)) : y("", !0),
974
+ class: j([e.icon, r.value])
975
+ }, null, 2)) : b("", !0),
973
976
  ce(i.$slots, "default"),
974
- e.iconAfter ? (j(), b("i", {
977
+ e.iconAfter ? (R(), x("i", {
975
978
  key: 1,
976
- class: D([e.iconAfter, r.value])
977
- }, null, 2)) : y("", !0)
979
+ class: j([e.iconAfter, r.value])
980
+ }, null, 2)) : b("", !0)
978
981
  ], 2)], 2));
979
982
  }
980
- }), Ae = ["value"], je = /* @__PURE__ */ E({
983
+ }), je = ["value"], Me = /* @__PURE__ */ D({
981
984
  __name: "BotInputEmail",
982
985
  props: { modelValue: { default: "" } },
983
986
  emits: ["update:modelValue"],
984
987
  setup(e, { emit: t }) {
985
988
  let n = t;
986
- return (t, r) => (j(), b("input", {
989
+ return (t, r) => (R(), x("input", {
987
990
  name: "username",
988
991
  type: "email",
989
992
  inputmode: "email",
@@ -996,9 +999,9 @@ var De = {
996
999
  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",
997
1000
  style: { "font-size": "16px" },
998
1001
  onInput: r[0] || (r[0] = (e) => n("update:modelValue", e.target.value))
999
- }, null, 40, Ae));
1002
+ }, null, 40, je));
1000
1003
  }
1001
- }), Me = ["placeholder", "value"], Ne = /* @__PURE__ */ E({
1004
+ }), Ne = ["placeholder", "value"], Pe = /* @__PURE__ */ D({
1002
1005
  __name: "BotInputOneTimeCode",
1003
1006
  props: {
1004
1007
  modelValue: {},
@@ -1007,7 +1010,7 @@ var De = {
1007
1010
  },
1008
1011
  emits: ["update:modelValue", "autoSubmit"],
1009
1012
  setup(e, { emit: t }) {
1010
- let n = e, r = t, i = M(null), a = _(() => "0".repeat(n.length));
1013
+ let n = e, r = t, i = B(null), a = v(() => "0".repeat(n.length));
1011
1014
  ne(() => {
1012
1015
  n.focusFirst && !("ontouchstart" in window) && i.value?.focus();
1013
1016
  });
@@ -1015,7 +1018,7 @@ var De = {
1015
1018
  let t = e.target.value.replace(/\D/g, "").slice(0, n.length);
1016
1019
  r("update:modelValue", t), t.length === n.length && r("autoSubmit", t);
1017
1020
  }
1018
- return (t, n) => (j(), b("input", {
1021
+ return (t, n) => (R(), x("input", {
1019
1022
  ref_key: "input",
1020
1023
  ref: i,
1021
1024
  name: "one-time-code",
@@ -1031,12 +1034,12 @@ var De = {
1031
1034
  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",
1032
1035
  style: { "font-size": "16px" },
1033
1036
  onInput
1034
- }, null, 40, Me));
1037
+ }, null, 40, Ne));
1035
1038
  }
1036
- }), Pe = { class: "relative flex-shrink-0" }, Fe = ["src", "alt"], Ie = { class: "absolute top-1 right-1" }, Le = {
1039
+ }), Fe = { class: "relative flex-shrink-0" }, Ie = ["src", "alt"], Le = { class: "absolute top-1 right-1" }, ze = {
1037
1040
  key: 1,
1038
1041
  class: "size-3 bg-theme-400 rounded-full ring-2 ring-white"
1039
- }, ze = { class: "min-w-0" }, Be = /* @__PURE__ */ E({
1042
+ }, Be = { class: "min-w-0" }, Ve = /* @__PURE__ */ D({
1040
1043
  __name: "ElModeHeader",
1041
1044
  props: {
1042
1045
  bot: {},
@@ -1048,17 +1051,31 @@ var De = {
1048
1051
  layout: { default: "centered" }
1049
1052
  },
1050
1053
  setup(e) {
1051
- return (t, n) => (j(), b("div", { class: D(["flex gap-4", [e.layout === "centered" ? "flex-col items-center text-center" : "flex-row items-center justify-center"]]) }, [x("div", Pe, [x("div", { class: D(["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"]) }, [x("img", {
1054
+ return (t, n) => (R(), x("div", { class: j(["flex gap-4", [e.layout === "centered" ? "flex-col items-center text-center" : "flex-row items-center justify-center"]]) }, [w("div", Fe, [w("div", { class: j(["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"]) }, [w("img", {
1052
1055
  src: e.bot.avatarUrl.value,
1053
1056
  alt: e.bot.displayName.value,
1054
1057
  class: "w-full h-full object-cover",
1055
- onError: n[0] || (n[0] = (...e) => V(handleImageError) && V(handleImageError)(...e))
1056
- }, null, 40, Fe)], 2), x("div", Ie, [e.isOnline ? (j(), b(m, { key: 0 }, [n[1] || (n[1] = x("div", {
1058
+ onError: n[0] || (n[0] = (...e) => le(handleImageError) && le(handleImageError)(...e))
1059
+ }, null, 40, Ie)], 2), w("div", Le, [e.isOnline ? (R(), x(m, { key: 0 }, [n[1] || (n[1] = w("div", {
1057
1060
  class: "size-3 bg-green-500 rounded-full ring-2 ring-white absolute animate-ping",
1058
1061
  style: { "animation-duration": "3s" }
1059
- }, null, -1)), n[2] || (n[2] = x("div", { class: "size-3 bg-green-500 rounded-full ring-2 ring-white" }, null, -1))], 64)) : (j(), b("div", Le))])]), x("div", ze, [x("h1", { class: D(["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" : ""]]) }, B(e.bot.displayName.value), 3), x("p", { class: D(["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"]]) }, B(e.layout === "horizontal" ? e.bot.title.value || "Assistant" : e.bot.title.value), 3)])], 2));
1062
+ }, null, -1)), n[2] || (n[2] = w("div", { class: "size-3 bg-green-500 rounded-full ring-2 ring-white" }, null, -1))], 64)) : (R(), x("div", ze))])]), w("div", Be, [w("h1", { class: j(["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" : ""]]) }, G(e.bot.displayName.value), 3), w("p", { class: j(["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"]]) }, G(e.layout === "horizontal" ? e.bot.title.value || "Assistant" : e.bot.title.value), 3)])], 2));
1063
+ }
1064
+ });
1065
+ //#endregion
1066
+ //#region bot/voice/voice-end-copy.ts
1067
+ function voiceEndNotice(e, t) {
1068
+ switch (e) {
1069
+ case "bot": return `${t} ended the call`;
1070
+ case "idle-timeout": return "Call ended after 30 seconds of silence";
1071
+ case "network": return "Call dropped. Connection lost.";
1072
+ case "session-cap": return "Call reached its time limit";
1073
+ case "unavailable": return "Call couldn’t connect";
1060
1074
  }
1061
- }), Ve = { class: "relative shrink-0 rounded-full" }, He = ["src", "alt"], Ue = ["src", "alt"], We = ["aria-label"], Ge = /* @__PURE__ */ E({
1075
+ }
1076
+ //#endregion
1077
+ //#region bot/ui/BotAvatar.vue?vue&type=script&setup=true&lang.ts
1078
+ var He = { class: "relative shrink-0 rounded-full" }, Ue = ["src", "alt"], We = ["src", "alt"], Ge = ["aria-label"], Ke = /* @__PURE__ */ D({
1062
1079
  __name: "BotAvatar",
1063
1080
  props: {
1064
1081
  bot: {},
@@ -1081,7 +1098,7 @@ var De = {
1081
1098
  amber: "bg-amber-500",
1082
1099
  red: "bg-red-500",
1083
1100
  grey: "bg-theme-300"
1084
- }, n = _(() => {
1101
+ }, n = v(() => {
1085
1102
  let n = e.bot.state.value;
1086
1103
  return e.showStatus && n.lifecycle !== "unknown" ? t[n.color] : null;
1087
1104
  }), r = {
@@ -1089,67 +1106,67 @@ var De = {
1089
1106
  height: "clamp(7px, 14%, 14px)",
1090
1107
  top: "calc(14.6% - clamp(3.5px, 7%, 7px))",
1091
1108
  right: "calc(14.6% - clamp(3.5px, 7%, 7px))"
1092
- }, i = _(() => e.isLight ? "ring-white" : "ring-theme-900");
1093
- return (t, a) => (j(), b("div", Ve, [
1094
- x("img", {
1109
+ }, i = v(() => e.isLight ? "ring-white" : "ring-theme-900");
1110
+ return (t, a) => (R(), x("div", He, [
1111
+ w("img", {
1095
1112
  src: e.bot.avatarUrl.value,
1096
1113
  alt: e.bot.displayName.value,
1097
- class: D(["size-full rounded-full object-cover ring-1", e.isLight ? "ring-black/5" : "ring-white/10"])
1098
- }, null, 10, He),
1099
- e.showOwnerMark && e.bot.ownerMarkUrl.value ? (j(), b("img", {
1114
+ class: j(["size-full rounded-full object-cover ring-1", e.isLight ? "ring-black/5" : "ring-white/10"])
1115
+ }, null, 10, Ue),
1116
+ e.showOwnerMark && e.bot.ownerMarkUrl.value ? (R(), x("img", {
1100
1117
  key: 0,
1101
1118
  src: e.bot.ownerMarkUrl.value,
1102
1119
  alt: e.bot.owner.value?.fullName ? `Owned by ${e.bot.owner.value.fullName}` : "Owner",
1103
- class: D(["absolute z-10 size-[36%] -bottom-[3%] -left-[3%] rounded-full object-cover ring-2", i.value])
1104
- }, null, 10, Ue)) : y("", !0),
1105
- n.value ? (j(), b("span", {
1120
+ class: j(["absolute z-10 size-[36%] -bottom-[3%] -left-[3%] rounded-full object-cover ring-2", i.value])
1121
+ }, null, 10, We)) : b("", !0),
1122
+ n.value ? (R(), x("span", {
1106
1123
  key: 1,
1107
1124
  role: "status",
1108
1125
  "aria-label": e.bot.state.value.tooltip,
1109
- class: D(["absolute z-10 rounded-full ring-2", [n.value, i.value]]),
1126
+ class: j(["absolute z-10 rounded-full ring-2", [n.value, i.value]]),
1110
1127
  style: r
1111
- }, null, 10, We)) : y("", !0),
1112
- n.value && e.bot.state.value.lifecycle === "running" ? (j(), b("span", {
1128
+ }, null, 10, Ge)) : b("", !0),
1129
+ n.value && e.bot.state.value.lifecycle === "running" ? (R(), x("span", {
1113
1130
  key: 2,
1114
1131
  "aria-hidden": "true",
1115
- class: D(["pointer-events-none absolute rounded-full animate-ping opacity-50 [animation-duration:3s]", n.value]),
1132
+ class: j(["pointer-events-none absolute rounded-full animate-ping opacity-50 [animation-duration:3s]", n.value]),
1116
1133
  style: r
1117
- }, null, 2)) : y("", !0)
1134
+ }, null, 2)) : b("", !0)
1118
1135
  ]));
1119
1136
  }
1120
- }), Ke = {
1137
+ }), qe = {
1121
1138
  key: 0,
1122
1139
  class: "sr-only",
1123
1140
  role: "status",
1124
1141
  "aria-live": "polite"
1125
- }, qe = ["aria-expanded", "disabled"], Je = ["aria-expanded"], Ye = {
1142
+ }, Je = ["aria-expanded", "disabled"], Ye = ["aria-expanded"], Xe = {
1126
1143
  class: "flex w-5 shrink-0 justify-center self-stretch",
1127
1144
  "aria-hidden": "true"
1128
- }, Xe = ["data-journal-row"], Ze = {
1145
+ }, Ze = ["data-journal-row"], Qe = {
1129
1146
  class: "flex w-5 shrink-0 flex-col items-center self-stretch",
1130
1147
  "aria-hidden": "true"
1131
- }, Qe = { class: "flex h-[17px] shrink-0 items-center" }, $e = {
1148
+ }, $e = { class: "flex h-[17px] shrink-0 items-center" }, et = {
1132
1149
  key: 0,
1133
1150
  class: "sr-only"
1134
- }, et = /* @__PURE__ */ E({
1151
+ }, tt = /* @__PURE__ */ D({
1135
1152
  __name: "BotToolActivityGroup",
1136
1153
  props: {
1137
1154
  model: {},
1138
1155
  isLight: { type: Boolean }
1139
1156
  },
1140
1157
  setup(e) {
1141
- let t = e, n = R(!1);
1158
+ let t = e, n = U(!1);
1142
1159
  function toggle() {
1143
1160
  n.value = !n.value;
1144
1161
  }
1145
- let r = _(() => t.model.outcome === "completed"), i = _(() => t.model.hiddenRows.length), a = _(() => t.model.hint ?? (t.model.terminal?.tone === "active" ? t.model.terminal.label : void 0)), o = _(() => {
1162
+ let r = v(() => t.model.outcome === "completed"), i = v(() => t.model.hiddenRows.length), a = v(() => t.model.hint ?? (t.model.terminal?.tone === "active" ? t.model.terminal.label : void 0)), o = v(() => {
1146
1163
  let e = t.model;
1147
1164
  return r.value ? n.value ? e.hiddenRows : [] : [
1148
1165
  ...n.value ? e.hiddenRows : [],
1149
1166
  ...e.visibleRows,
1150
1167
  ...e.terminal ? [e.terminal] : []
1151
1168
  ];
1152
- }), s = _(() => t.isLight ? {
1169
+ }), s = v(() => t.isLight ? {
1153
1170
  spine: "bg-theme-200",
1154
1171
  dashed: "border-theme-300",
1155
1172
  doneMark: "text-theme-400",
@@ -1167,7 +1184,7 @@ var De = {
1167
1184
  stoppedSquare: "bg-white/50",
1168
1185
  muted: "text-white/50",
1169
1186
  ring: "focus-visible:ring-white"
1170
- }), c = _(() => {
1187
+ }), c = v(() => {
1171
1188
  let e = t.isLight;
1172
1189
  return {
1173
1190
  done: {
@@ -1210,64 +1227,64 @@ var De = {
1210
1227
  }
1211
1228
  };
1212
1229
  });
1213
- return (t, d) => (j(), b("div", { class: D(["w-full py-0.5", s.value.muted]) }, [
1214
- a.value ? (j(), b("span", Ke, B(a.value), 1)) : y("", !0),
1215
- r.value ? (j(), b("button", {
1230
+ return (t, d) => (R(), x("div", { class: j(["w-full py-0.5", s.value.muted]) }, [
1231
+ a.value ? (R(), x("span", qe, G(a.value), 1)) : b("", !0),
1232
+ r.value ? (R(), x("button", {
1216
1233
  key: 1,
1217
1234
  type: "button",
1218
1235
  "data-test": "messaging-tool-activity-summary",
1219
1236
  "data-journal-disclosure": "",
1220
1237
  "aria-expanded": n.value,
1221
1238
  disabled: i.value === 0,
1222
- class: D(["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]),
1239
+ class: j(["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]),
1223
1240
  onClick: toggle
1224
1241
  }, [
1225
- d[0] || (d[0] = x("i", {
1242
+ d[0] || (d[0] = w("i", {
1226
1243
  "data-journal-station": "completed",
1227
1244
  class: "i-tabler-circle-check size-3.5 shrink-0 text-green-600",
1228
1245
  "aria-hidden": "true"
1229
1246
  }, null, -1)),
1230
- x("span", { class: D(["text-[12px] font-medium leading-none", s.value.muted]) }, B(e.model.terminal?.label), 3),
1231
- i.value ? (j(), b("i", {
1247
+ w("span", { class: j(["text-[12px] font-medium leading-none", s.value.muted]) }, G(e.model.terminal?.label), 3),
1248
+ i.value ? (R(), x("i", {
1232
1249
  key: 0,
1233
- class: D(["size-[13px] shrink-0", [n.value ? "i-tabler-chevron-down" : "i-tabler-chevron-right", s.value.muted]]),
1250
+ class: j(["size-[13px] shrink-0", [n.value ? "i-tabler-chevron-down" : "i-tabler-chevron-right", s.value.muted]]),
1234
1251
  "aria-hidden": "true"
1235
- }, null, 2)) : y("", !0)
1236
- ], 10, qe)) : i.value ? (j(), b("button", {
1252
+ }, null, 2)) : b("", !0)
1253
+ ], 10, Je)) : i.value ? (R(), x("button", {
1237
1254
  key: 2,
1238
1255
  type: "button",
1239
1256
  "data-test": "messaging-tool-activity-summary",
1240
1257
  "data-journal-disclosure": "",
1241
1258
  "aria-expanded": n.value,
1242
- class: D(["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]),
1259
+ class: j(["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]),
1243
1260
  onClick: toggle
1244
- }, [x("span", Ye, [x("span", {
1261
+ }, [w("span", Xe, [w("span", {
1245
1262
  "data-journal-spine": "dashed",
1246
- class: D(["w-0 border-l border-dashed", s.value.dashed])
1247
- }, null, 2)]), x("span", { class: D(["flex min-h-[20px] items-center gap-0.5 pb-2 text-[12px] leading-none", s.value.muted]) }, [w(B(i.value) + " earlier updates ", 1), x("i", {
1248
- class: D(["size-3 shrink-0", n.value ? "i-tabler-chevron-down" : "i-tabler-chevron-right"]),
1263
+ class: j(["w-0 border-l border-dashed", s.value.dashed])
1264
+ }, null, 2)]), w("span", { class: j(["flex min-h-[20px] items-center gap-0.5 pb-2 text-[12px] leading-none", s.value.muted]) }, [T(G(i.value) + " earlier updates ", 1), w("i", {
1265
+ class: j(["size-3 shrink-0", n.value ? "i-tabler-chevron-down" : "i-tabler-chevron-right"]),
1249
1266
  "aria-hidden": "true"
1250
- }, null, 2)], 2)], 10, Je)) : y("", !0),
1251
- (j(!0), b(m, null, N(o.value, (e, t) => (j(), b("div", {
1267
+ }, null, 2)], 2)], 10, Ye)) : b("", !0),
1268
+ (R(!0), x(m, null, V(o.value, (e, t) => (R(), x("div", {
1252
1269
  key: e.id,
1253
1270
  "data-test": "messaging-tool-activity-row",
1254
1271
  "data-journal-row": e.tone,
1255
- class: D([r.value ? "pl-[22px]" : "", "flex gap-x-2.5"])
1256
- }, [x("div", Ze, [x("span", Qe, [(j(), v(le(c.value[e.tone].station.tag), {
1272
+ class: j([r.value ? "pl-[22px]" : "", "flex gap-x-2.5"])
1273
+ }, [w("div", Qe, [w("span", $e, [(R(), y(H(c.value[e.tone].station.tag), {
1257
1274
  "data-journal-station": e.tone,
1258
- class: D(c.value[e.tone].station.class)
1259
- }, null, 8, ["data-journal-station", "class"]))]), t === o.value.length - 1 ? y("", !0) : (j(), b("span", {
1275
+ class: j(c.value[e.tone].station.class)
1276
+ }, null, 8, ["data-journal-station", "class"]))]), t === o.value.length - 1 ? b("", !0) : (R(), x("span", {
1260
1277
  key: 0,
1261
- class: D(["w-px flex-1", s.value.spine])
1262
- }, null, 2))]), x("div", { class: D(["min-w-0 flex-1", t === o.value.length - 1 ? "" : "pb-2"]) }, [x("span", { class: D(["relative block leading-snug", c.value[e.tone].label]) }, [w(B(e.label), 1), c.value[e.tone].statusWord ? (j(), b("span", $e, ", " + B(c.value[e.tone].statusWord), 1)) : y("", !0)], 2), e.note ? (j(), b("p", {
1278
+ class: j(["w-px flex-1", s.value.spine])
1279
+ }, null, 2))]), w("div", { class: j(["min-w-0 flex-1", t === o.value.length - 1 ? "" : "pb-2"]) }, [w("span", { class: j(["relative block leading-snug", c.value[e.tone].label]) }, [T(G(e.label), 1), c.value[e.tone].statusWord ? (R(), x("span", et, ", " + G(c.value[e.tone].statusWord), 1)) : b("", !0)], 2), e.note ? (R(), x("p", {
1263
1280
  key: 0,
1264
- class: D(["pt-0.5 text-[12px] leading-snug", s.value.muted])
1265
- }, B(e.note), 3)) : y("", !0)], 2)], 10, Xe))), 128)),
1266
- !r.value && e.model.hint ? (j(), b("p", {
1281
+ class: j(["pt-0.5 text-[12px] leading-snug", s.value.muted])
1282
+ }, G(e.note), 3)) : b("", !0)], 2)], 10, Ze))), 128)),
1283
+ !r.value && e.model.hint ? (R(), x("p", {
1267
1284
  key: 3,
1268
1285
  "data-test": "messaging-tool-activity-hint",
1269
- class: D(["pl-[30px] pt-2.5 text-[12px] leading-snug", s.value.muted])
1270
- }, B(e.model.hint), 3)) : y("", !0)
1286
+ class: j(["pl-[30px] pt-2.5 text-[12px] leading-snug", s.value.muted])
1287
+ }, G(e.model.hint), 3)) : b("", !0)
1271
1288
  ], 2));
1272
1289
  }
1273
1290
  });
@@ -1312,86 +1329,86 @@ function _unsupportedIterableToArray(e, t) {
1312
1329
  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;
1313
1330
  }
1314
1331
  }
1315
- var tt = Object.entries, nt = Object.setPrototypeOf, rt = Object.isFrozen, J = Object.getPrototypeOf, it = Object.getOwnPropertyDescriptor, Y = Object.freeze, X = Object.seal, at = Object.create, ot = typeof Reflect < "u" && Reflect, st = ot.apply, ct = ot.construct;
1316
- Y || (Y = function freeze(e) {
1332
+ var nt = Object.entries, rt = Object.setPrototypeOf, it = Object.isFrozen, at = Object.getPrototypeOf, ot = Object.getOwnPropertyDescriptor, X = Object.freeze, Z = Object.seal, st = Object.create, ct = typeof Reflect < "u" && Reflect, lt = ct.apply, ut = ct.construct;
1333
+ X || (X = function freeze(e) {
1317
1334
  return e;
1318
- }), X || (X = function seal(e) {
1335
+ }), Z || (Z = function seal(e) {
1319
1336
  return e;
1320
- }), st || (st = function apply(e, t) {
1337
+ }), lt || (lt = function apply(e, t) {
1321
1338
  var n = [...arguments].slice(2);
1322
1339
  return e.apply(t, n);
1323
- }), ct || (ct = function construct(e) {
1340
+ }), ut || (ut = function construct(e) {
1324
1341
  return new e(...[...arguments].slice(1));
1325
1342
  });
1326
- var lt = unapply(Array.prototype.forEach), Z = unapply(Array.prototype.lastIndexOf), ut = unapply(Array.prototype.pop), dt = unapply(Array.prototype.push), ft = unapply(Array.prototype.splice), pt = Array.isArray, mt = unapply(String.prototype.toLowerCase), ht = unapply(String.prototype.toString), gt = unapply(String.prototype.match), _t = unapply(String.prototype.replace), vt = unapply(String.prototype.indexOf), bt = unapply(String.prototype.trim), xt = unapply(Number.prototype.toString), St = unapply(Boolean.prototype.toString), Ct = typeof BigInt > "u" ? null : unapply(BigInt.prototype.toString), wt = typeof Symbol > "u" ? null : unapply(Symbol.prototype.toString), Q = unapply(Object.prototype.hasOwnProperty), Tt = unapply(Object.prototype.toString), Et = unapply(RegExp.prototype.test), Dt = unconstruct(TypeError);
1343
+ var dt = unapply(Array.prototype.forEach), Q = unapply(Array.prototype.lastIndexOf), ft = unapply(Array.prototype.pop), pt = unapply(Array.prototype.push), mt = unapply(Array.prototype.splice), ht = Array.isArray, gt = unapply(String.prototype.toLowerCase), _t = unapply(String.prototype.toString), vt = unapply(String.prototype.match), bt = unapply(String.prototype.replace), xt = unapply(String.prototype.indexOf), St = unapply(String.prototype.trim), Ct = unapply(Number.prototype.toString), wt = unapply(Boolean.prototype.toString), Tt = typeof BigInt > "u" ? null : unapply(BigInt.prototype.toString), Et = typeof Symbol > "u" ? null : unapply(Symbol.prototype.toString), Dt = unapply(Object.prototype.hasOwnProperty), $ = unapply(Object.prototype.toString), Ot = unapply(RegExp.prototype.test), kt = unconstruct(TypeError);
1327
1344
  function unapply(e) {
1328
1345
  return function(t) {
1329
1346
  t instanceof RegExp && (t.lastIndex = 0);
1330
1347
  var n = [...arguments].slice(1);
1331
- return st(e, t, n);
1348
+ return lt(e, t, n);
1332
1349
  };
1333
1350
  }
1334
1351
  function unconstruct(e) {
1335
1352
  return function() {
1336
- return ct(e, [...arguments]);
1353
+ return ut(e, [...arguments]);
1337
1354
  };
1338
1355
  }
1339
1356
  function addToSet(e, t) {
1340
- let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : mt;
1341
- if (nt && nt(e, null), !pt(t)) return e;
1357
+ let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : gt;
1358
+ if (rt && rt(e, null), !ht(t)) return e;
1342
1359
  let r = t.length;
1343
1360
  for (; r--;) {
1344
1361
  let i = t[r];
1345
1362
  if (typeof i == "string") {
1346
1363
  let e = n(i);
1347
- e !== i && (rt(t) || (t[r] = e), i = e);
1364
+ e !== i && (it(t) || (t[r] = e), i = e);
1348
1365
  }
1349
1366
  e[i] = !0;
1350
1367
  }
1351
1368
  return e;
1352
1369
  }
1353
1370
  function cleanArray(e) {
1354
- for (let t = 0; t < e.length; t++) Q(e, t) || (e[t] = null);
1371
+ for (let t = 0; t < e.length; t++) Dt(e, t) || (e[t] = null);
1355
1372
  return e;
1356
1373
  }
1357
1374
  function clone(e) {
1358
- let t = at(null);
1359
- for (let r of tt(e)) {
1375
+ let t = st(null);
1376
+ for (let r of nt(e)) {
1360
1377
  var n = _slicedToArray(r, 2);
1361
1378
  let i = n[0], a = n[1];
1362
- Q(e, i) && (t[i] = pt(a) ? cleanArray(a) : a && typeof a == "object" && a.constructor === Object ? clone(a) : a);
1379
+ Dt(e, i) && (t[i] = ht(a) ? cleanArray(a) : a && typeof a == "object" && a.constructor === Object ? clone(a) : a);
1363
1380
  }
1364
1381
  return t;
1365
1382
  }
1366
1383
  function stringifyValue(e) {
1367
1384
  switch (typeof e) {
1368
1385
  case "string": return e;
1369
- case "number": return xt(e);
1370
- case "boolean": return St(e);
1371
- case "bigint": return Ct ? Ct(e) : "0";
1372
- case "symbol": return wt ? wt(e) : "Symbol()";
1373
- case "undefined": return Tt(e);
1386
+ case "number": return Ct(e);
1387
+ case "boolean": return wt(e);
1388
+ case "bigint": return Tt ? Tt(e) : "0";
1389
+ case "symbol": return Et ? Et(e) : "Symbol()";
1390
+ case "undefined": return $(e);
1374
1391
  case "function":
1375
1392
  case "object": {
1376
- if (e === null) return Tt(e);
1393
+ if (e === null) return $(e);
1377
1394
  let t = e, n = lookupGetter(t, "toString");
1378
1395
  if (typeof n == "function") {
1379
1396
  let e = n(t);
1380
- return typeof e == "string" ? e : Tt(e);
1397
+ return typeof e == "string" ? e : $(e);
1381
1398
  }
1382
- return Tt(e);
1399
+ return $(e);
1383
1400
  }
1384
- default: return Tt(e);
1401
+ default: return $(e);
1385
1402
  }
1386
1403
  }
1387
1404
  function lookupGetter(e, t) {
1388
1405
  for (; e !== null;) {
1389
- let n = it(e, t);
1406
+ let n = ot(e, t);
1390
1407
  if (n) {
1391
1408
  if (n.get) return unapply(n.get);
1392
1409
  if (typeof n.value == "function") return unapply(n.value);
1393
1410
  }
1394
- e = J(e);
1411
+ e = at(e);
1395
1412
  }
1396
1413
  function fallbackValue() {
1397
1414
  return null;
@@ -1400,12 +1417,12 @@ function lookupGetter(e, t) {
1400
1417
  }
1401
1418
  function isRegex(e) {
1402
1419
  try {
1403
- return Et(e, ""), !0;
1420
+ return Ot(e, ""), !0;
1404
1421
  } catch {
1405
1422
  return !1;
1406
1423
  }
1407
1424
  }
1408
- var Ot = Y(/* @__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(".")), kt = Y(/* @__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(".")), At = Y([
1425
+ var At = X(/* @__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(".")), jt = X(/* @__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(".")), Mt = X([
1409
1426
  "feBlend",
1410
1427
  "feColorMatrix",
1411
1428
  "feComponentTransfer",
@@ -1431,7 +1448,7 @@ var Ot = Y(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
1431
1448
  "feSpotLight",
1432
1449
  "feTile",
1433
1450
  "feTurbulence"
1434
- ]), jt = Y([
1451
+ ]), Nt = X([
1435
1452
  "animate",
1436
1453
  "color-profile",
1437
1454
  "cursor",
@@ -1454,7 +1471,7 @@ var Ot = Y(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
1454
1471
  "solidcolor",
1455
1472
  "unknown",
1456
1473
  "use"
1457
- ]), Mt = Y(/* @__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(".")), Nt = Y([
1474
+ ]), Ft = X(/* @__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(".")), It = X([
1458
1475
  "maction",
1459
1476
  "maligngroup",
1460
1477
  "malignmark",
@@ -1470,13 +1487,13 @@ var Ot = Y(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
1470
1487
  "annotation-xml",
1471
1488
  "mprescripts",
1472
1489
  "none"
1473
- ]), Ft = Y(["#text"]), It = Y(/* @__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(".")), Lt = Y(/* @__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(".")), Rt = Y(/* @__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(".")), zt = Y([
1490
+ ]), Lt = X(["#text"]), Rt = X(/* @__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(".")), zt = X(/* @__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(".")), Bt = X(/* @__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(".")), Vt = X([
1474
1491
  "xlink:href",
1475
1492
  "xml:id",
1476
1493
  "xlink:title",
1477
1494
  "xml:space",
1478
1495
  "xmlns:xlink"
1479
- ]), Bt = X(/{{[\w\W]*|^[\w\W]*}}/g), Vt = X(/<%[\w\W]*|^[\w\W]*%>/g), Ht = X(/\${[\w\W]*/g), Ut = X(/^data-[\-\w.\u00B7-\uFFFF]+$/), Wt = X(/^aria-[\-\w]+$/), Gt = X(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), Kt = X(/^(?:\w+script|data):/i), qt = X(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), Jt = X(/^html$/i), Yt = X(/^[a-z][.\w]*(-[.\w]+)+$/i), Xt = X(/<[/\w!]/g), Zt = X(/<[/\w]/g), Qt = X(/<\/no(script|embed|frames)/i), $t = X(/\/>/i), en = {
1496
+ ]), Ht = Z(/{{[\w\W]*|^[\w\W]*}}/g), Ut = Z(/<%[\w\W]*|^[\w\W]*%>/g), Wt = Z(/\${[\w\W]*/g), Gt = Z(/^data-[\-\w.\u00B7-\uFFFF]+$/), Kt = Z(/^aria-[\-\w]+$/), qt = Z(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), Jt = Z(/^(?:\w+script|data):/i), Yt = Z(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), Xt = Z(/^html$/i), Zt = Z(/^[a-z][.\w]*(-[.\w]+)+$/i), Qt = Z(/<[/\w!]/g), $t = Z(/<[/\w]/g), en = Z(/<\/no(script|embed|frames)/i), tn = Z(/\/>/i), nn = {
1480
1497
  element: 1,
1481
1498
  attribute: 2,
1482
1499
  text: 3,
@@ -1489,9 +1506,9 @@ var Ot = Y(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
1489
1506
  documentType: 10,
1490
1507
  documentFragment: 11,
1491
1508
  notation: 12
1492
- }, tn = function getGlobal() {
1509
+ }, rn = function getGlobal() {
1493
1510
  return typeof window > "u" ? null : window;
1494
- }, nn = function _createTrustedTypesPolicy(e, t) {
1511
+ }, an = function _createTrustedTypesPolicy(e, t) {
1495
1512
  if (typeof e != "object" || typeof e.createPolicy != "function") return null;
1496
1513
  let n = null, r = "data-tt-policy-suffix";
1497
1514
  t && t.hasAttribute(r) && (n = t.getAttribute(r));
@@ -1508,7 +1525,7 @@ var Ot = Y(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
1508
1525
  } catch {
1509
1526
  return console.warn("TrustedTypes policy " + i + " could not be created."), null;
1510
1527
  }
1511
- }, rn = function _createHooksMap() {
1528
+ }, on = function _createHooksMap() {
1512
1529
  return {
1513
1530
  afterSanitizeAttributes: [],
1514
1531
  afterSanitizeElements: [],
@@ -1520,12 +1537,12 @@ var Ot = Y(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
1520
1537
  uponSanitizeElement: [],
1521
1538
  uponSanitizeShadowNode: []
1522
1539
  };
1523
- }, an = function _resolveSetOption(e, t, n, r) {
1524
- return Q(e, t) && pt(e[t]) ? addToSet(r.base ? clone(r.base) : {}, e[t], r.transform) : n;
1540
+ }, sn = function _resolveSetOption(e, t, n, r) {
1541
+ return Dt(e, t) && ht(e[t]) ? addToSet(r.base ? clone(r.base) : {}, e[t], r.transform) : n;
1525
1542
  };
1526
1543
  function createDOMPurify() {
1527
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : tn(), DOMPurify = (e) => createDOMPurify(e);
1528
- if (DOMPurify.version = "3.4.12", DOMPurify.removed = [], !e || !e.document || e.document.nodeType !== en.document || !e.Element) return DOMPurify.isSupported = !1, DOMPurify;
1544
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : rn(), DOMPurify = (e) => createDOMPurify(e);
1545
+ if (DOMPurify.version = "3.4.12", DOMPurify.removed = [], !e || !e.document || e.document.nodeType !== nn.document || !e.Element) return DOMPurify.isSupported = !1, DOMPurify;
1529
1546
  let t = e.document, n = t, r = n.currentScript;
1530
1547
  e.DocumentFragment;
1531
1548
  let i = e.HTMLTemplateElement, a = e.Node, o = e.Element, s = e.NodeFilter;
@@ -1535,38 +1552,38 @@ function createDOMPurify() {
1535
1552
  let e = t.createElement("template");
1536
1553
  e.content && e.content.ownerDocument && (t = e.content.ownerDocument);
1537
1554
  }
1538
- let T, E = "", ee, D = !1, A = 0, te = function _assertNotInTrustedTypesPolicy() {
1539
- if (A > 0) throw Dt("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.");
1540
- }, ne = function _createTrustedHTML(e) {
1541
- te(), A++;
1555
+ let T, E = "", D, A = !1, ee = 0, j = function _assertNotInTrustedTypesPolicy() {
1556
+ if (ee > 0) throw kt("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.");
1557
+ }, M = function _createTrustedHTML(e) {
1558
+ j(), ee++;
1542
1559
  try {
1543
1560
  return T.createHTML(e);
1544
1561
  } finally {
1545
- A--;
1562
+ ee--;
1546
1563
  }
1547
- }, ae = function _createTrustedScriptURL(e) {
1548
- te(), A++;
1564
+ }, N = function _createTrustedScriptURL(e) {
1565
+ j(), ee++;
1549
1566
  try {
1550
1567
  return T.createScriptURL(e);
1551
1568
  } finally {
1552
- A--;
1553
- }
1554
- }, j = function _getDefaultTrustedTypesPolicy() {
1555
- return D || (ee = nn(d, r), D = !0), ee;
1556
- }, M = t, N = M.implementation, ce = M.createNodeIterator, le = M.createDocumentFragment, R = M.getElementsByTagName, B = n.importNode, V = rn();
1557
- DOMPurify.isSupported = typeof tt == "function" && typeof v == "function" && N && N.createHTMLDocument !== void 0;
1558
- let ue = Bt, fe = Vt, pe = Ht, me = Ut, he = Wt, ge = Kt, _e = qt, ve = Yt, ye = Gt, H = null, xe = addToSet({}, [
1559
- ...Ot,
1560
- ...kt,
1569
+ ee--;
1570
+ }
1571
+ }, te = function _getDefaultTrustedTypesPolicy() {
1572
+ return A || (D = an(d, r), A = !0), D;
1573
+ }, ne = t, ae = ne.implementation, R = ne.createNodeIterator, B = ne.createDocumentFragment, V = ne.getElementsByTagName, ce = n.importNode, H = on();
1574
+ DOMPurify.isSupported = typeof nt == "function" && typeof v == "function" && ae && ae.createHTMLDocument !== void 0;
1575
+ let U = Ht, G = Ut, le = Wt, ue = Gt, fe = Kt, pe = Jt, me = Yt, he = Zt, ge = qt, K = null, _e = addToSet({}, [
1561
1576
  ...At,
1577
+ ...jt,
1562
1578
  ...Mt,
1563
- ...Ft
1564
- ]), U = null, G = addToSet({}, [
1565
- ...It,
1566
- ...Lt,
1579
+ ...Ft,
1580
+ ...Lt
1581
+ ]), J = null, ve = addToSet({}, [
1567
1582
  ...Rt,
1568
- ...zt
1569
- ]), K = Object.seal(at(null, {
1583
+ ...zt,
1584
+ ...Bt,
1585
+ ...Vt
1586
+ ]), Y = Object.seal(st(null, {
1570
1587
  tagNameCheck: {
1571
1588
  writable: !0,
1572
1589
  configurable: !1,
@@ -1585,7 +1602,7 @@ function createDOMPurify() {
1585
1602
  enumerable: !0,
1586
1603
  value: !1
1587
1604
  }
1588
- })), Se = null, Ce = null, Ee = Object.seal(at(null, {
1605
+ })), ye = null, xe = null, Se = Object.seal(st(null, {
1589
1606
  tagCheck: {
1590
1607
  writable: !0,
1591
1608
  configurable: !1,
@@ -1598,14 +1615,14 @@ function createDOMPurify() {
1598
1615
  enumerable: !0,
1599
1616
  value: null
1600
1617
  }
1601
- })), De = !0, ke = !0, Ae = !1, je = !0, Me = !1, Ne = !0, Pe = !1, Fe = !1, Ie = null, Le = null, ze = !1, Be = !1, Ve = !1, He = !1, Ue = !0, We = !1, Ge = "user-content-", Ke = !0, qe = !1, Je = {}, Ye = null, Xe = 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(".")), Ze = null, Qe = addToSet({}, [
1618
+ })), Ce = !0, Ee = !0, De = !1, ke = !0, Ae = !1, je = !0, Me = !1, Ne = !1, Pe = null, Fe = null, Ie = !1, Le = !1, ze = !1, Be = !1, Ve = !0, He = !1, Ue = "user-content-", We = !0, Ge = !1, Ke = {}, qe = null, Je = 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(".")), Ye = null, Xe = addToSet({}, [
1602
1619
  "audio",
1603
1620
  "video",
1604
1621
  "img",
1605
1622
  "source",
1606
1623
  "image",
1607
1624
  "track"
1608
- ]), $e = null, et = addToSet({}, [
1625
+ ]), Ze = null, Qe = addToSet({}, [
1609
1626
  "alt",
1610
1627
  "class",
1611
1628
  "for",
@@ -1620,84 +1637,84 @@ function createDOMPurify() {
1620
1637
  "value",
1621
1638
  "style",
1622
1639
  "xmlns"
1623
- ]), nt = "http://www.w3.org/1998/Math/MathML", rt = "http://www.w3.org/2000/svg", J = "http://www.w3.org/1999/xhtml", it = J, ot = !1, st = null, ct = addToSet({}, [
1624
- nt,
1625
- rt,
1626
- J
1627
- ], ht), xt = Y([
1640
+ ]), $e = "http://www.w3.org/1998/Math/MathML", et = "http://www.w3.org/2000/svg", tt = "http://www.w3.org/1999/xhtml", rt = tt, it = !1, at = null, ot = addToSet({}, [
1641
+ $e,
1642
+ et,
1643
+ tt
1644
+ ], _t), ct = X([
1628
1645
  "mi",
1629
1646
  "mo",
1630
1647
  "mn",
1631
1648
  "ms",
1632
1649
  "mtext"
1633
- ]), St = addToSet({}, xt), Ct = Y(["annotation-xml"]), wt = addToSet({}, Ct), Tt = addToSet({}, [
1650
+ ]), lt = addToSet({}, ct), ut = X(["annotation-xml"]), Ct = addToSet({}, ut), wt = addToSet({}, [
1634
1651
  "title",
1635
1652
  "style",
1636
1653
  "font",
1637
1654
  "a",
1638
1655
  "script"
1639
- ]), on = null, sn = ["application/xhtml+xml", "text/html"], $ = null, cn = null, ln = t.createElement("form"), un = function isRegexOrFunction(e) {
1656
+ ]), Tt = null, Et = ["application/xhtml+xml", "text/html"], $ = null, cn = null, ln = t.createElement("form"), un = function isRegexOrFunction(e) {
1640
1657
  return e instanceof RegExp || e instanceof Function;
1641
1658
  }, dn = function _parseConfig() {
1642
1659
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1643
1660
  if (cn && cn === e) return;
1644
- (!e || typeof e != "object") && (e = {}), e = clone(e), on = sn.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, $ = on === "application/xhtml+xml" ? ht : mt, H = an(e, "ALLOWED_TAGS", xe, { transform: $ }), U = an(e, "ALLOWED_ATTR", G, { transform: $ }), st = an(e, "ALLOWED_NAMESPACES", ct, { transform: ht }), $e = an(e, "ADD_URI_SAFE_ATTR", et, {
1645
- transform: $,
1646
- base: et
1647
- }), Ze = an(e, "ADD_DATA_URI_TAGS", Qe, {
1661
+ (!e || typeof e != "object") && (e = {}), e = clone(e), Tt = Et.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, $ = Tt === "application/xhtml+xml" ? _t : gt, K = sn(e, "ALLOWED_TAGS", _e, { transform: $ }), J = sn(e, "ALLOWED_ATTR", ve, { transform: $ }), at = sn(e, "ALLOWED_NAMESPACES", ot, { transform: _t }), Ze = sn(e, "ADD_URI_SAFE_ATTR", Qe, {
1648
1662
  transform: $,
1649
1663
  base: Qe
1650
- }), Ye = an(e, "FORBID_CONTENTS", Xe, { transform: $ }), Se = an(e, "FORBID_TAGS", clone({}), { transform: $ }), Ce = an(e, "FORBID_ATTR", clone({}), { transform: $ }), Je = Q(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? clone(e.USE_PROFILES) : e.USE_PROFILES : !1, De = e.ALLOW_ARIA_ATTR !== !1, ke = e.ALLOW_DATA_ATTR !== !1, Ae = e.ALLOW_UNKNOWN_PROTOCOLS || !1, je = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Me = e.SAFE_FOR_TEMPLATES || !1, Ne = e.SAFE_FOR_XML !== !1, Pe = e.WHOLE_DOCUMENT || !1, Be = e.RETURN_DOM || !1, Ve = e.RETURN_DOM_FRAGMENT || !1, He = e.RETURN_TRUSTED_TYPE || !1, ze = e.FORCE_BODY || !1, Ue = e.SANITIZE_DOM !== !1, We = e.SANITIZE_NAMED_PROPS || !1, Ke = e.KEEP_CONTENT !== !1, qe = e.IN_PLACE || !1, ye = isRegex(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : Gt, it = typeof e.NAMESPACE == "string" ? e.NAMESPACE : J, St = Q(e, "MATHML_TEXT_INTEGRATION_POINTS") && e.MATHML_TEXT_INTEGRATION_POINTS && typeof e.MATHML_TEXT_INTEGRATION_POINTS == "object" ? clone(e.MATHML_TEXT_INTEGRATION_POINTS) : addToSet({}, xt), wt = Q(e, "HTML_INTEGRATION_POINTS") && e.HTML_INTEGRATION_POINTS && typeof e.HTML_INTEGRATION_POINTS == "object" ? clone(e.HTML_INTEGRATION_POINTS) : addToSet({}, Ct);
1651
- let t = Q(e, "CUSTOM_ELEMENT_HANDLING") && e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING == "object" ? clone(e.CUSTOM_ELEMENT_HANDLING) : at(null);
1652
- if (K = at(null), Q(t, "tagNameCheck") && un(t.tagNameCheck) && (K.tagNameCheck = t.tagNameCheck), Q(t, "attributeNameCheck") && un(t.attributeNameCheck) && (K.attributeNameCheck = t.attributeNameCheck), Q(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (K.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), X(K), Me && (ke = !1), Ve && (Be = !0), Je && (H = addToSet({}, Ft), U = at(null), Je.html === !0 && (addToSet(H, Ot), addToSet(U, It)), Je.svg === !0 && (addToSet(H, kt), addToSet(U, Lt), addToSet(U, zt)), Je.svgFilters === !0 && (addToSet(H, At), addToSet(U, Lt), addToSet(U, zt)), Je.mathMl === !0 && (addToSet(H, Mt), addToSet(U, Rt), addToSet(U, zt))), Ee.tagCheck = null, Ee.attributeCheck = null, Q(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? Ee.tagCheck = e.ADD_TAGS : pt(e.ADD_TAGS) && (H === xe && (H = clone(H)), addToSet(H, e.ADD_TAGS, $))), Q(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? Ee.attributeCheck = e.ADD_ATTR : pt(e.ADD_ATTR) && (U === G && (U = clone(U)), addToSet(U, e.ADD_ATTR, $))), Q(e, "ADD_URI_SAFE_ATTR") && pt(e.ADD_URI_SAFE_ATTR) && addToSet($e, e.ADD_URI_SAFE_ATTR, $), Q(e, "FORBID_CONTENTS") && pt(e.FORBID_CONTENTS) && (Ye === Xe && (Ye = clone(Ye)), addToSet(Ye, e.FORBID_CONTENTS, $)), Q(e, "ADD_FORBID_CONTENTS") && pt(e.ADD_FORBID_CONTENTS) && (Ye === Xe && (Ye = clone(Ye)), addToSet(Ye, e.ADD_FORBID_CONTENTS, $)), Ke && (H["#text"] = !0), Pe && addToSet(H, [
1664
+ }), Ye = sn(e, "ADD_DATA_URI_TAGS", Xe, {
1665
+ transform: $,
1666
+ base: Xe
1667
+ }), qe = sn(e, "FORBID_CONTENTS", Je, { transform: $ }), ye = sn(e, "FORBID_TAGS", clone({}), { transform: $ }), xe = sn(e, "FORBID_ATTR", clone({}), { transform: $ }), Ke = Dt(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? clone(e.USE_PROFILES) : e.USE_PROFILES : !1, Ce = e.ALLOW_ARIA_ATTR !== !1, Ee = e.ALLOW_DATA_ATTR !== !1, De = 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, ze = e.RETURN_DOM_FRAGMENT || !1, Be = e.RETURN_TRUSTED_TYPE || !1, Ie = e.FORCE_BODY || !1, Ve = e.SANITIZE_DOM !== !1, He = e.SANITIZE_NAMED_PROPS || !1, We = e.KEEP_CONTENT !== !1, Ge = e.IN_PLACE || !1, ge = isRegex(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : qt, rt = typeof e.NAMESPACE == "string" ? e.NAMESPACE : tt, lt = Dt(e, "MATHML_TEXT_INTEGRATION_POINTS") && e.MATHML_TEXT_INTEGRATION_POINTS && typeof e.MATHML_TEXT_INTEGRATION_POINTS == "object" ? clone(e.MATHML_TEXT_INTEGRATION_POINTS) : addToSet({}, ct), Ct = Dt(e, "HTML_INTEGRATION_POINTS") && e.HTML_INTEGRATION_POINTS && typeof e.HTML_INTEGRATION_POINTS == "object" ? clone(e.HTML_INTEGRATION_POINTS) : addToSet({}, ut);
1668
+ let t = Dt(e, "CUSTOM_ELEMENT_HANDLING") && e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING == "object" ? clone(e.CUSTOM_ELEMENT_HANDLING) : st(null);
1669
+ if (Y = st(null), Dt(t, "tagNameCheck") && un(t.tagNameCheck) && (Y.tagNameCheck = t.tagNameCheck), Dt(t, "attributeNameCheck") && un(t.attributeNameCheck) && (Y.attributeNameCheck = t.attributeNameCheck), Dt(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (Y.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), Z(Y), Ae && (Ee = !1), ze && (Le = !0), Ke && (K = addToSet({}, Lt), J = st(null), Ke.html === !0 && (addToSet(K, At), addToSet(J, Rt)), Ke.svg === !0 && (addToSet(K, jt), addToSet(J, zt), addToSet(J, Vt)), Ke.svgFilters === !0 && (addToSet(K, Mt), addToSet(J, zt), addToSet(J, Vt)), Ke.mathMl === !0 && (addToSet(K, Ft), addToSet(J, Bt), addToSet(J, Vt))), Se.tagCheck = null, Se.attributeCheck = null, Dt(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? Se.tagCheck = e.ADD_TAGS : ht(e.ADD_TAGS) && (K === _e && (K = clone(K)), addToSet(K, e.ADD_TAGS, $))), Dt(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? Se.attributeCheck = e.ADD_ATTR : ht(e.ADD_ATTR) && (J === ve && (J = clone(J)), addToSet(J, e.ADD_ATTR, $))), Dt(e, "ADD_URI_SAFE_ATTR") && ht(e.ADD_URI_SAFE_ATTR) && addToSet(Ze, e.ADD_URI_SAFE_ATTR, $), Dt(e, "FORBID_CONTENTS") && ht(e.FORBID_CONTENTS) && (qe === Je && (qe = clone(qe)), addToSet(qe, e.FORBID_CONTENTS, $)), Dt(e, "ADD_FORBID_CONTENTS") && ht(e.ADD_FORBID_CONTENTS) && (qe === Je && (qe = clone(qe)), addToSet(qe, e.ADD_FORBID_CONTENTS, $)), We && (K["#text"] = !0), Me && addToSet(K, [
1653
1670
  "html",
1654
1671
  "head",
1655
1672
  "body"
1656
- ]), H.table && (addToSet(H, ["tbody"]), delete Se.tbody), e.TRUSTED_TYPES_POLICY) {
1657
- if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw Dt("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
1658
- if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw Dt("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
1673
+ ]), K.table && (addToSet(K, ["tbody"]), delete ye.tbody), e.TRUSTED_TYPES_POLICY) {
1674
+ if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw kt("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
1675
+ if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw kt("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
1659
1676
  let t = T;
1660
1677
  T = e.TRUSTED_TYPES_POLICY;
1661
1678
  try {
1662
- E = ne("");
1679
+ E = M("");
1663
1680
  } catch (e) {
1664
1681
  throw T = t, e;
1665
1682
  }
1666
- } else e.TRUSTED_TYPES_POLICY === null ? (T = void 0, E = "") : (T === void 0 && (T = j()), T && typeof E == "string" && (E = ne("")));
1667
- Y && Y(e), cn = e;
1683
+ } else e.TRUSTED_TYPES_POLICY === null ? (T = void 0, E = "") : (T === void 0 && (T = te()), T && typeof E == "string" && (E = M("")));
1684
+ X && X(e), cn = e;
1668
1685
  }, fn = addToSet({}, [
1669
- ...kt,
1670
- ...At,
1671
- ...jt
1672
- ]), pn = addToSet({}, [...Mt, ...Nt]), mn = function _checkSvgNamespace(e, t, n) {
1673
- return t.namespaceURI === J ? e === "svg" : t.namespaceURI === nt ? e === "svg" && (n === "annotation-xml" || St[n]) : !!fn[e];
1686
+ ...jt,
1687
+ ...Mt,
1688
+ ...Nt
1689
+ ]), pn = addToSet({}, [...Ft, ...It]), mn = function _checkSvgNamespace(e, t, n) {
1690
+ return t.namespaceURI === tt ? e === "svg" : t.namespaceURI === $e ? e === "svg" && (n === "annotation-xml" || lt[n]) : !!fn[e];
1674
1691
  }, hn = function _checkMathMlNamespace(e, t, n) {
1675
- return t.namespaceURI === J ? e === "math" : t.namespaceURI === rt ? e === "math" && wt[n] : !!pn[e];
1692
+ return t.namespaceURI === tt ? e === "math" : t.namespaceURI === et ? e === "math" && Ct[n] : !!pn[e];
1676
1693
  }, gn = function _checkHtmlNamespace(e, t, n) {
1677
- return t.namespaceURI === rt && !wt[n] || t.namespaceURI === nt && !St[n] ? !1 : !pn[e] && (Tt[e] || !fn[e]);
1694
+ return t.namespaceURI === et && !Ct[n] || t.namespaceURI === $e && !lt[n] ? !1 : !pn[e] && (wt[e] || !fn[e]);
1678
1695
  }, _n = function _checkValidNamespace(e) {
1679
1696
  let t = v(e);
1680
1697
  (!t || !t.tagName) && (t = {
1681
- namespaceURI: it,
1698
+ namespaceURI: rt,
1682
1699
  tagName: "template"
1683
1700
  });
1684
- let n = mt(e.tagName), r = mt(t.tagName);
1685
- return st[e.namespaceURI] ? e.namespaceURI === rt ? mn(n, t, r) : e.namespaceURI === nt ? hn(n, t, r) : e.namespaceURI === J ? gn(n, t, r) : !!(on === "application/xhtml+xml" && st[e.namespaceURI]) : !1;
1701
+ let n = gt(e.tagName), r = gt(t.tagName);
1702
+ return at[e.namespaceURI] ? e.namespaceURI === et ? mn(n, t, r) : e.namespaceURI === $e ? hn(n, t, r) : e.namespaceURI === tt ? gn(n, t, r) : !!(Tt === "application/xhtml+xml" && at[e.namespaceURI]) : !1;
1686
1703
  }, vn = function _forceRemove(e) {
1687
- dt(DOMPurify.removed, { element: e });
1704
+ pt(DOMPurify.removed, { element: e });
1688
1705
  try {
1689
1706
  v(e).removeChild(e);
1690
1707
  } catch {
1691
- if (m(e), !v(e)) throw Dt("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
1708
+ if (m(e), !v(e)) throw kt("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
1692
1709
  }
1693
1710
  }, yn = function _neutralizeRoot(e) {
1694
1711
  Sn(e);
1695
1712
  let t = _(e);
1696
1713
  if (t) {
1697
1714
  let e = [];
1698
- lt(t, (t) => {
1699
- dt(e, t);
1700
- }), lt(e, (e) => {
1715
+ dt(t, (t) => {
1716
+ pt(e, t);
1717
+ }), dt(e, (e) => {
1701
1718
  try {
1702
1719
  m(e);
1703
1720
  } catch {}
@@ -1712,18 +1729,18 @@ function createDOMPurify() {
1712
1729
  }
1713
1730
  }, bn = function _removeAttribute(e, t) {
1714
1731
  try {
1715
- dt(DOMPurify.removed, {
1732
+ pt(DOMPurify.removed, {
1716
1733
  attribute: t.getAttributeNode(e),
1717
1734
  from: t
1718
1735
  });
1719
1736
  } catch {
1720
- dt(DOMPurify.removed, {
1737
+ pt(DOMPurify.removed, {
1721
1738
  attribute: null,
1722
1739
  from: t
1723
1740
  });
1724
1741
  }
1725
1742
  if (t.removeAttribute(e), e === "is") {
1726
- if (Be || Ve) try {
1743
+ if (Le || ze) try {
1727
1744
  vn(t);
1728
1745
  } catch {}
1729
1746
  else try {
@@ -1734,7 +1751,7 @@ function createDOMPurify() {
1734
1751
  let t = b(e);
1735
1752
  if (t) for (let n = t.length - 1; n >= 0; --n) {
1736
1753
  let r = t[n], i = r && r.name;
1737
- if (!(typeof i != "string" || U[$(i)])) try {
1754
+ if (!(typeof i != "string" || J[$(i)])) try {
1738
1755
  e.removeAttribute(i);
1739
1756
  } catch {}
1740
1757
  }
@@ -1742,22 +1759,22 @@ function createDOMPurify() {
1742
1759
  let t = [e];
1743
1760
  for (; t.length > 0;) {
1744
1761
  let e = t.pop();
1745
- (x ? x(e) : e.nodeType) === en.element && xn(e);
1762
+ (x ? x(e) : e.nodeType) === nn.element && xn(e);
1746
1763
  let n = _(e);
1747
1764
  if (n) for (let e = n.length - 1; e >= 0; --e) t.push(n[e]);
1748
1765
  }
1749
1766
  }, Cn = function _neutralizePatchLinkage(e) {
1750
- if (!Ne) return;
1767
+ if (!je) return;
1751
1768
  let t = [e];
1752
1769
  for (; t.length > 0;) {
1753
1770
  let e = t.pop(), n = x ? x(e) : e.nodeType;
1754
- if (n === en.processingInstruction || n === en.comment && Et(Zt, e.data)) {
1771
+ if (n === nn.processingInstruction || n === nn.comment && Ot($t, e.data)) {
1755
1772
  try {
1756
1773
  m(e);
1757
1774
  } catch {}
1758
1775
  continue;
1759
1776
  }
1760
- if (n === en.element) {
1777
+ if (n === nn.element) {
1761
1778
  let t = e, n = $(w ? w(e) : e.nodeName);
1762
1779
  try {
1763
1780
  t.hasAttribute && t.hasAttribute("patchsrc") && t.removeAttribute("patchsrc"), t.hasAttribute && t.hasAttribute("for") && n !== "label" && n !== "output" && t.removeAttribute("for");
@@ -1768,34 +1785,34 @@ function createDOMPurify() {
1768
1785
  }
1769
1786
  }, wn = function _initDocument(e) {
1770
1787
  let n = null, r = null;
1771
- if (ze) e = "<remove></remove>" + e;
1788
+ if (Ie) e = "<remove></remove>" + e;
1772
1789
  else {
1773
- let t = gt(e, /^[\r\n\t ]+/);
1790
+ let t = vt(e, /^[\r\n\t ]+/);
1774
1791
  r = t && t[0];
1775
1792
  }
1776
- on === "application/xhtml+xml" && it === J && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
1777
- let i = T ? ne(e) : e;
1778
- if (it === J) try {
1779
- n = new c().parseFromString(i, on);
1793
+ Tt === "application/xhtml+xml" && rt === tt && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
1794
+ let i = T ? M(e) : e;
1795
+ if (rt === tt) try {
1796
+ n = new c().parseFromString(i, Tt);
1780
1797
  } catch {}
1781
1798
  if (!n || !n.documentElement) {
1782
- n = N.createDocument(it, "template", null);
1799
+ n = ae.createDocument(rt, "template", null);
1783
1800
  try {
1784
- n.documentElement.innerHTML = ot ? E : i;
1801
+ n.documentElement.innerHTML = it ? E : i;
1785
1802
  } catch {}
1786
1803
  }
1787
1804
  let a = n.body || n.documentElement;
1788
- return e && r && a.insertBefore(t.createTextNode(r), a.childNodes[0] || null), it === J ? R.call(n, Pe ? "html" : "body")[0] : Pe ? n.documentElement : a;
1805
+ return e && r && a.insertBefore(t.createTextNode(r), a.childNodes[0] || null), rt === tt ? V.call(n, Me ? "html" : "body")[0] : Me ? n.documentElement : a;
1789
1806
  }, Tn = function _createNodeIterator(e) {
1790
- return ce.call(e.ownerDocument || e, e, s.SHOW_ELEMENT | s.SHOW_COMMENT | s.SHOW_TEXT | s.SHOW_PROCESSING_INSTRUCTION | s.SHOW_CDATA_SECTION, null);
1807
+ return R.call(e.ownerDocument || e, e, s.SHOW_ELEMENT | s.SHOW_COMMENT | s.SHOW_TEXT | s.SHOW_PROCESSING_INSTRUCTION | s.SHOW_CDATA_SECTION, null);
1791
1808
  }, En = function _stripTemplateExpressions(e) {
1792
- return e = _t(e, ue, " "), e = _t(e, fe, " "), e = _t(e, pe, " "), e;
1809
+ return e = bt(e, U, " "), e = bt(e, G, " "), e = bt(e, le, " "), e;
1793
1810
  }, Dn = function _scrubTemplateExpressions(e) {
1794
1811
  e.normalize();
1795
- let t = ce.call(e.ownerDocument || e, e, s.SHOW_TEXT | s.SHOW_COMMENT | s.SHOW_CDATA_SECTION | s.SHOW_PROCESSING_INSTRUCTION, null), n = t.nextNode();
1812
+ let t = R.call(e.ownerDocument || e, e, s.SHOW_TEXT | s.SHOW_COMMENT | s.SHOW_CDATA_SECTION | s.SHOW_PROCESSING_INSTRUCTION, null), n = t.nextNode();
1796
1813
  for (; n;) n.data = En(n.data), n = t.nextNode();
1797
1814
  let r = e.querySelectorAll?.call(e, "template");
1798
- r && lt(r, (e) => {
1815
+ r && dt(r, (e) => {
1799
1816
  kn(e.content) && Dn(e.content);
1800
1817
  });
1801
1818
  }, On = function _isClobbered(e) {
@@ -1804,7 +1821,7 @@ function createDOMPurify() {
1804
1821
  }, kn = function _isDocumentFragment(e) {
1805
1822
  if (!x || typeof e != "object" || !e) return !1;
1806
1823
  try {
1807
- return x(e) === en.documentFragment;
1824
+ return x(e) === nn.documentFragment;
1808
1825
  } catch {
1809
1826
  return !1;
1810
1827
  }
@@ -1817,51 +1834,51 @@ function createDOMPurify() {
1817
1834
  }
1818
1835
  };
1819
1836
  function _executeHooks(e, t, n) {
1820
- e.length !== 0 && lt(e, (e) => {
1837
+ e.length !== 0 && dt(e, (e) => {
1821
1838
  e.call(DOMPurify, t, n, cn);
1822
1839
  });
1823
1840
  }
1824
1841
  let jn = function _isUnsafeNode(e, t) {
1825
- return !!(Ne && e.hasChildNodes() && !An(e.firstElementChild) && Et(Xt, e.textContent) && Et(Xt, e.innerHTML) || Ne && e.namespaceURI === J && t === "style" && An(e.firstElementChild) || e.nodeType === en.processingInstruction || Ne && e.nodeType === en.comment && Et(Zt, e.data));
1842
+ return !!(je && e.hasChildNodes() && !An(e.firstElementChild) && Ot(Qt, e.textContent) && Ot(Qt, e.innerHTML) || je && e.namespaceURI === tt && t === "style" && An(e.firstElementChild) || e.nodeType === nn.processingInstruction || je && e.nodeType === nn.comment && Ot($t, e.data));
1826
1843
  }, Mn = function _sanitizeDisallowedNode(e, t) {
1827
- if (!Se[t] && In(t) && (K.tagNameCheck instanceof RegExp && Et(K.tagNameCheck, t) || K.tagNameCheck instanceof Function && K.tagNameCheck(t))) return !1;
1828
- if (Ke && !Ye[t]) {
1844
+ if (!ye[t] && In(t) && (Y.tagNameCheck instanceof RegExp && Ot(Y.tagNameCheck, t) || Y.tagNameCheck instanceof Function && Y.tagNameCheck(t))) return !1;
1845
+ if (We && !qe[t]) {
1829
1846
  let t = v(e), n = _(e);
1830
1847
  if (n && t) {
1831
1848
  let r = n.length;
1832
1849
  for (let i = r - 1; i >= 0; --i) {
1833
- let r = qe ? n[i] : p(n[i], !0);
1850
+ let r = Ge ? n[i] : p(n[i], !0);
1834
1851
  t.insertBefore(r, g(e));
1835
1852
  }
1836
1853
  }
1837
1854
  }
1838
1855
  return vn(e), !0;
1839
1856
  }, Nn = function _sanitizeElements(e, t) {
1840
- if (_executeHooks(V.beforeSanitizeElements, e, null), e !== t && v(e) === null) return !0;
1857
+ if (_executeHooks(H.beforeSanitizeElements, e, null), e !== t && v(e) === null) return !0;
1841
1858
  if (On(e)) return vn(e), !0;
1842
1859
  let n = $(w ? w(e) : e.nodeName);
1843
- if (_executeHooks(V.uponSanitizeElement, e, {
1860
+ if (_executeHooks(H.uponSanitizeElement, e, {
1844
1861
  tagName: n,
1845
- allowedTags: H
1862
+ allowedTags: K
1846
1863
  }), e !== t && v(e) === null) return !0;
1847
1864
  if (jn(e, n)) return vn(e), !0;
1848
- if (Se[n] || !(Ee.tagCheck instanceof Function && Ee.tagCheck(n)) && !H[n]) {
1865
+ if (ye[n] || !(Se.tagCheck instanceof Function && Se.tagCheck(n)) && !K[n]) {
1849
1866
  let t = Mn(e, n);
1850
- return t === !1 && _executeHooks(V.afterSanitizeElements, e, null), t;
1867
+ return t === !1 && _executeHooks(H.afterSanitizeElements, e, null), t;
1851
1868
  }
1852
- if ((x ? x(e) : e.nodeType) === en.element && !_n(e) || (n === "noscript" || n === "noembed" || n === "noframes") && Et(Qt, e.innerHTML)) return vn(e), !0;
1853
- if (Me && e.nodeType === en.text) {
1869
+ if ((x ? x(e) : e.nodeType) === nn.element && !_n(e) || (n === "noscript" || n === "noembed" || n === "noframes") && Ot(en, e.innerHTML)) return vn(e), !0;
1870
+ if (Ae && e.nodeType === nn.text) {
1854
1871
  let t = En(e.textContent);
1855
- e.textContent !== t && (dt(DOMPurify.removed, { element: e.cloneNode() }), e.textContent = t);
1872
+ e.textContent !== t && (pt(DOMPurify.removed, { element: e.cloneNode() }), e.textContent = t);
1856
1873
  }
1857
- return _executeHooks(V.afterSanitizeElements, e, null), !1;
1874
+ return _executeHooks(H.afterSanitizeElements, e, null), !1;
1858
1875
  }, Pn = function _isValidAttribute(e, n, r) {
1859
- if (Ce[n] || Ne && n === "patchsrc" || Ne && n === "for" && e !== "label" && e !== "output" || Ue && (n === "id" || n === "name") && (r in t || r in ln)) return !1;
1860
- let i = U[n] || Ee.attributeCheck instanceof Function && Ee.attributeCheck(n, e);
1861
- if (!(ke && Et(me, n)) && !(De && Et(he, n))) {
1876
+ if (xe[n] || je && n === "patchsrc" || je && n === "for" && e !== "label" && e !== "output" || Ve && (n === "id" || n === "name") && (r in t || r in ln)) return !1;
1877
+ let i = J[n] || Se.attributeCheck instanceof Function && Se.attributeCheck(n, e);
1878
+ if (!(Ee && Ot(ue, n)) && !(Ce && Ot(fe, n))) {
1862
1879
  if (!i) {
1863
- if (!(In(e) && (K.tagNameCheck instanceof RegExp && Et(K.tagNameCheck, e) || K.tagNameCheck instanceof Function && K.tagNameCheck(e)) && (K.attributeNameCheck instanceof RegExp && Et(K.attributeNameCheck, n) || K.attributeNameCheck instanceof Function && K.attributeNameCheck(n, e)) || n === "is" && K.allowCustomizedBuiltInElements && (K.tagNameCheck instanceof RegExp && Et(K.tagNameCheck, r) || K.tagNameCheck instanceof Function && K.tagNameCheck(r)))) return !1;
1864
- } else if (!$e[n] && !Et(ye, _t(r, _e, "")) && (n !== "src" && n !== "xlink:href" && n !== "href" || e === "script" || vt(r, "data:") !== 0 || !Ze[e]) && (!Ae || Et(ge, _t(r, _e, ""))) && r) return !1;
1880
+ if (!(In(e) && (Y.tagNameCheck instanceof RegExp && Ot(Y.tagNameCheck, e) || Y.tagNameCheck instanceof Function && Y.tagNameCheck(e)) && (Y.attributeNameCheck instanceof RegExp && Ot(Y.attributeNameCheck, n) || Y.attributeNameCheck instanceof Function && Y.attributeNameCheck(n, e)) || n === "is" && Y.allowCustomizedBuiltInElements && (Y.tagNameCheck instanceof RegExp && Ot(Y.tagNameCheck, r) || Y.tagNameCheck instanceof Function && Y.tagNameCheck(r)))) return !1;
1881
+ } else if (!Ze[n] && !Ot(ge, bt(r, me, "")) && (n !== "src" && n !== "xlink:href" && n !== "href" || e === "script" || xt(r, "data:") !== 0 || !Ye[e]) && (!De || Ot(pe, bt(r, me, ""))) && r) return !1;
1865
1882
  }
1866
1883
  return !0;
1867
1884
  }, Fn = addToSet({}, [
@@ -1874,37 +1891,37 @@ function createDOMPurify() {
1874
1891
  "font-face-uri",
1875
1892
  "missing-glyph"
1876
1893
  ]), In = function _isBasicCustomElement(e) {
1877
- return !Fn[mt(e)] && Et(ve, e);
1894
+ return !Fn[gt(e)] && Ot(he, e);
1878
1895
  }, Ln = function _applyTrustedTypesToAttribute(e, t, n, r) {
1879
1896
  if (T && typeof d == "object" && typeof d.getAttributeType == "function" && !n) switch (d.getAttributeType(e, t)) {
1880
- case "TrustedHTML": return ne(r);
1881
- case "TrustedScriptURL": return ae(r);
1897
+ case "TrustedHTML": return M(r);
1898
+ case "TrustedScriptURL": return N(r);
1882
1899
  }
1883
1900
  return r;
1884
1901
  }, Rn = function _setAttributeValue(e, t, n, r) {
1885
1902
  try {
1886
- n ? e.setAttributeNS(n, t, r) : e.setAttribute(t, r), On(e) ? vn(e) : ut(DOMPurify.removed);
1903
+ n ? e.setAttributeNS(n, t, r) : e.setAttribute(t, r), On(e) ? vn(e) : ft(DOMPurify.removed);
1887
1904
  } catch {
1888
1905
  bn(t, e);
1889
1906
  }
1890
1907
  }, zn = function _sanitizeAttributes(e) {
1891
- _executeHooks(V.beforeSanitizeAttributes, e, null);
1908
+ _executeHooks(H.beforeSanitizeAttributes, e, null);
1892
1909
  let t = e.attributes;
1893
1910
  if (!t || On(e)) return;
1894
1911
  let n = {
1895
1912
  attrName: "",
1896
1913
  attrValue: "",
1897
1914
  keepAttr: !0,
1898
- allowedAttributes: U,
1915
+ allowedAttributes: J,
1899
1916
  forceKeepAttr: void 0
1900
1917
  }, r = t.length, i = $(e.nodeName);
1901
1918
  for (; r--;) {
1902
- let a = t[r], o = a.name, s = a.namespaceURI, c = a.value, d = $(o), f = c, p = o === "value" ? f : bt(f);
1903
- if (n.attrName = d, n.attrValue = p, n.keepAttr = !0, n.forceKeepAttr = void 0, _executeHooks(V.uponSanitizeAttribute, e, n), p = n.attrValue, We && (d === "id" || d === "name") && vt(p, Ge) !== 0 && (bn(o, e), p = Ge + p), Ne && Et(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, p)) {
1919
+ let a = t[r], o = a.name, s = a.namespaceURI, c = a.value, d = $(o), f = c, p = o === "value" ? f : St(f);
1920
+ if (n.attrName = d, n.attrValue = p, n.keepAttr = !0, n.forceKeepAttr = void 0, _executeHooks(H.uponSanitizeAttribute, e, n), p = n.attrValue, He && (d === "id" || d === "name") && xt(p, Ue) !== 0 && (bn(o, e), p = Ue + p), je && Ot(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, p)) {
1904
1921
  bn(o, e);
1905
1922
  continue;
1906
1923
  }
1907
- if (d === "attributename" && gt(p, "href")) {
1924
+ if (d === "attributename" && vt(p, "href")) {
1908
1925
  bn(o, e);
1909
1926
  continue;
1910
1927
  }
@@ -1913,25 +1930,25 @@ function createDOMPurify() {
1913
1930
  bn(o, e);
1914
1931
  continue;
1915
1932
  }
1916
- if (!je && Et($t, p)) {
1933
+ if (!ke && Ot(tn, p)) {
1917
1934
  bn(o, e);
1918
1935
  continue;
1919
1936
  }
1920
- if (Me && (p = En(p)), !Pn(i, d, p)) {
1937
+ if (Ae && (p = En(p)), !Pn(i, d, p)) {
1921
1938
  bn(o, e);
1922
1939
  continue;
1923
1940
  }
1924
1941
  p = Ln(i, d, s, p), p !== f && Rn(e, o, s, p);
1925
1942
  }
1926
1943
  }
1927
- _executeHooks(V.afterSanitizeAttributes, e, null);
1944
+ _executeHooks(H.afterSanitizeAttributes, e, null);
1928
1945
  }, Bn = function _sanitizeShadowDOM(e) {
1929
1946
  let t = null, n = Tn(e);
1930
- for (_executeHooks(V.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) if (_executeHooks(V.uponSanitizeShadowNode, t, null), Nn(t, e), zn(t), kn(t.content) && Bn(t.content), (x ? x(t) : t.nodeType) === en.element) {
1947
+ for (_executeHooks(H.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) if (_executeHooks(H.uponSanitizeShadowNode, t, null), Nn(t, e), zn(t), kn(t.content) && Bn(t.content), (x ? x(t) : t.nodeType) === nn.element) {
1931
1948
  let e = y(t);
1932
1949
  kn(e) && (Vn(e), Bn(e));
1933
1950
  }
1934
- _executeHooks(V.afterSanitizeShadowDOM, e, null);
1951
+ _executeHooks(H.afterSanitizeShadowDOM, e, null);
1935
1952
  }, Vn = function _sanitizeAttachedShadowRoots(e) {
1936
1953
  let t = [{
1937
1954
  node: e,
@@ -1943,7 +1960,7 @@ function createDOMPurify() {
1943
1960
  Bn(e.shadow);
1944
1961
  continue;
1945
1962
  }
1946
- let n = e.node, r = (x ? x(n) : n.nodeType) === en.element, i = _(n);
1963
+ let n = e.node, r = (x ? x(n) : n.nodeType) === nn.element, i = _(n);
1947
1964
  if (i) for (let e = i.length - 1; e >= 0; --e) t.push({
1948
1965
  node: i[e],
1949
1966
  shadow: null
@@ -1972,73 +1989,73 @@ function createDOMPurify() {
1972
1989
  };
1973
1990
  return DOMPurify.sanitize = function(e) {
1974
1991
  let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = null, i = null, a = null, o = null;
1975
- if (ot = !e, ot && (e = "<!-->"), typeof e != "string" && !An(e) && (e = stringifyValue(e), typeof e != "string")) throw Dt("dirty is not a string, aborting");
1992
+ if (it = !e, it && (e = "<!-->"), typeof e != "string" && !An(e) && (e = stringifyValue(e), typeof e != "string")) throw kt("dirty is not a string, aborting");
1976
1993
  if (!DOMPurify.isSupported) return e;
1977
- Fe ? (H = Ie, U = Le) : dn(t), (V.uponSanitizeElement.length > 0 || V.uponSanitizeAttribute.length > 0) && (H = clone(H)), V.uponSanitizeAttribute.length > 0 && (U = clone(U)), DOMPurify.removed = [];
1978
- let s = qe && typeof e != "string" && An(e);
1994
+ Ne ? (K = Pe, J = Fe) : dn(t), (H.uponSanitizeElement.length > 0 || H.uponSanitizeAttribute.length > 0) && (K = clone(K)), H.uponSanitizeAttribute.length > 0 && (J = clone(J)), DOMPurify.removed = [];
1995
+ let s = Ge && typeof e != "string" && An(e);
1979
1996
  if (s) {
1980
1997
  Cn(e);
1981
1998
  let t = w ? w(e) : e.nodeName;
1982
1999
  if (typeof t == "string") {
1983
2000
  let n = $(t);
1984
- if (!H[n] || Se[n]) throw yn(e), Dt("root node is forbidden and cannot be sanitized in-place");
2001
+ if (!K[n] || ye[n]) throw yn(e), kt("root node is forbidden and cannot be sanitized in-place");
1985
2002
  }
1986
- if (On(e)) throw yn(e), Dt("root node is clobbered and cannot be sanitized in-place");
2003
+ if (On(e)) throw yn(e), kt("root node is clobbered and cannot be sanitized in-place");
1987
2004
  try {
1988
2005
  Vn(e);
1989
2006
  } catch (t) {
1990
2007
  throw yn(e), t;
1991
2008
  }
1992
- } else if (An(e)) r = wn("<!---->"), i = r.ownerDocument.importNode(e, !0), i.nodeType === en.element && i.nodeName === "BODY" || i.nodeName === "HTML" ? r = i : r.appendChild(i), Vn(i);
2009
+ } else if (An(e)) r = wn("<!---->"), i = r.ownerDocument.importNode(e, !0), i.nodeType === nn.element && i.nodeName === "BODY" || i.nodeName === "HTML" ? r = i : r.appendChild(i), Vn(i);
1993
2010
  else {
1994
- if (!Be && !Me && !Pe && e.indexOf("<") === -1) return T && He ? ne(e) : e;
1995
- if (r = wn(e), !r) return Be ? null : He ? E : "";
2011
+ if (!Le && !Ae && !Me && e.indexOf("<") === -1) return T && Be ? M(e) : e;
2012
+ if (r = wn(e), !r) return Le ? null : Be ? E : "";
1996
2013
  }
1997
- r && ze && vn(r.firstChild);
2014
+ r && Ie && vn(r.firstChild);
1998
2015
  let c = s ? e : r, d = Tn(c);
1999
2016
  try {
2000
2017
  for (; a = d.nextNode();) Nn(a, c), zn(a), kn(a.content) && Bn(a.content);
2001
2018
  } catch (t) {
2002
- throw s && (yn(e), lt(DOMPurify.removed, (e) => {
2019
+ throw s && (yn(e), dt(DOMPurify.removed, (e) => {
2003
2020
  e.element && Sn(e.element);
2004
2021
  })), t;
2005
2022
  }
2006
- if (s) return lt(DOMPurify.removed, (e) => {
2023
+ if (s) return dt(DOMPurify.removed, (e) => {
2007
2024
  e.element && Sn(e.element);
2008
- }), Me && Dn(e), e;
2009
- if (Be) {
2010
- if (Me && Dn(r), Ve) for (o = le.call(r.ownerDocument); r.firstChild;) o.appendChild(r.firstChild);
2025
+ }), Ae && Dn(e), e;
2026
+ if (Le) {
2027
+ if (Ae && Dn(r), ze) for (o = B.call(r.ownerDocument); r.firstChild;) o.appendChild(r.firstChild);
2011
2028
  else o = r;
2012
- return (U.shadowroot || U.shadowrootmode) && (o = B.call(n, o, !0)), o;
2029
+ return (J.shadowroot || J.shadowrootmode) && (o = ce.call(n, o, !0)), o;
2013
2030
  }
2014
- let f = Pe ? r.outerHTML : r.innerHTML;
2015
- return Pe && H["!doctype"] && r.ownerDocument && r.ownerDocument.doctype && r.ownerDocument.doctype.name && Et(Jt, r.ownerDocument.doctype.name) && (f = "<!DOCTYPE " + r.ownerDocument.doctype.name + ">\n" + f), Me && (f = En(f)), T && He ? ne(f) : f;
2031
+ let f = Me ? r.outerHTML : r.innerHTML;
2032
+ return Me && K["!doctype"] && r.ownerDocument && r.ownerDocument.doctype && r.ownerDocument.doctype.name && Ot(Xt, r.ownerDocument.doctype.name) && (f = "<!DOCTYPE " + r.ownerDocument.doctype.name + ">\n" + f), Ae && (f = En(f)), T && Be ? M(f) : f;
2016
2033
  }, DOMPurify.setConfig = function() {
2017
2034
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2018
- dn(e), Fe = !0, Ie = H, Le = U;
2035
+ dn(e), Ne = !0, Pe = K, Fe = J;
2019
2036
  }, DOMPurify.clearConfig = function() {
2020
- cn = null, Fe = !1, Ie = null, Le = null, T = ee, E = "";
2037
+ cn = null, Ne = !1, Pe = null, Fe = null, T = D, E = "";
2021
2038
  }, DOMPurify.isValidAttribute = function(e, t, n) {
2022
2039
  cn || dn({});
2023
2040
  let r = $(e), i = $(t);
2024
2041
  return Pn(r, i, n);
2025
2042
  }, DOMPurify.addHook = function(e, t) {
2026
- typeof t == "function" && Q(V, e) && dt(V[e], t);
2043
+ typeof t == "function" && Dt(H, e) && pt(H[e], t);
2027
2044
  }, DOMPurify.removeHook = function(e, t) {
2028
- if (Q(V, e)) {
2045
+ if (Dt(H, e)) {
2029
2046
  if (t !== void 0) {
2030
- let n = Z(V[e], t);
2031
- return n === -1 ? void 0 : ft(V[e], n, 1)[0];
2047
+ let n = Q(H[e], t);
2048
+ return n === -1 ? void 0 : mt(H[e], n, 1)[0];
2032
2049
  }
2033
- return ut(V[e]);
2050
+ return ft(H[e]);
2034
2051
  }
2035
2052
  }, DOMPurify.removeHooks = function(e) {
2036
- Q(V, e) && (V[e] = []);
2053
+ Dt(H, e) && (H[e] = []);
2037
2054
  }, DOMPurify.removeAllHooks = function() {
2038
- V = rn();
2055
+ H = on();
2039
2056
  }, DOMPurify;
2040
2057
  }
2041
- var on = createDOMPurify(), _Class;
2058
+ var cn = createDOMPurify(), _Class;
2042
2059
  function I() {
2043
2060
  return {
2044
2061
  async: !1,
@@ -2053,11 +2070,11 @@ function I() {
2053
2070
  walkTokens: null
2054
2071
  };
2055
2072
  }
2056
- var sn = I();
2073
+ var ln = I();
2057
2074
  function W(e) {
2058
- sn = e;
2075
+ ln = e;
2059
2076
  }
2060
- var $ = { exec: () => null };
2077
+ var un = { exec: () => null };
2061
2078
  function C(e) {
2062
2079
  let t = [];
2063
2080
  return (n) => {
@@ -2069,19 +2086,19 @@ function h(e, t = "") {
2069
2086
  let n = typeof e == "string" ? e : e.source, r = {
2070
2087
  replace: (e, t) => {
2071
2088
  let i = typeof t == "string" ? t : t.source;
2072
- return i = i.replace(ln.caret, "$1"), n = n.replace(e, i), r;
2089
+ return i = i.replace(fn.caret, "$1"), n = n.replace(e, i), r;
2073
2090
  },
2074
2091
  getRegex: () => new RegExp(n, t)
2075
2092
  };
2076
2093
  return r;
2077
2094
  }
2078
- var cn = ((e = "") => {
2095
+ var dn = ((e = "") => {
2079
2096
  try {
2080
2097
  return !!RegExp("(?<=1)(?<!1)" + e);
2081
2098
  } catch {
2082
2099
  return !1;
2083
2100
  }
2084
- })(), ln = {
2101
+ })(), fn = {
2085
2102
  codeRemoveIndent: /^(?: {0,3}\t| {1,4})/gm,
2086
2103
  outputLinkReplace: /\\([\[\]])/g,
2087
2104
  indentCodeCompensation: /^(\s+)(?:```)/,
@@ -2139,125 +2156,125 @@ var cn = ((e = "") => {
2139
2156
  hrRegex: C((e) => RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),
2140
2157
  fencesBeginRegex: C((e) => RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),
2141
2158
  headingBeginRegex: C((e) => RegExp(`^ {0,${e}}#`)),
2142
- htmlBeginRegex: C((e) => RegExp(`^ {0,${e}}(?:</?(?:${wn})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`, "i")),
2159
+ htmlBeginRegex: C((e) => RegExp(`^ {0,${e}}(?:</?(?:${Dn})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`, "i")),
2143
2160
  blockquoteBeginRegex: C((e) => RegExp(`^ {0,${e}}>`))
2144
- }, un = /^(?:[ \t]*(?:\n|$))+/, dn = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, fn = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, pn = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, mn = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, hn = / {0,3}(?:[*+-]|\d{1,9}[.)])/, gn = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, _n = h(gn).replace(/bull/g, hn).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}(?:\s|$)/).replace(/hr/g, / {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), vn = h(gn).replace(/bull/g, hn).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}(?:\s|$)/).replace(/hr/g, / {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), yn = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/, bn = /^[^\n]+/, xn = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Sn = h(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", xn).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Cn = h(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, hn).getRegex(), wn = "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", Tn = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, En = h("^ {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][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", Tn).replace("tag", wn).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), de = (e) => h(yn).replace("hr", pn).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", e).replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", wn).getRegex(), Dn = de(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/), On = de(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/), kn = {
2145
- blockquote: h(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", On).getRegex(),
2146
- code: dn,
2147
- def: Sn,
2148
- fences: fn,
2149
- heading: mn,
2150
- hr: pn,
2151
- html: En,
2152
- lheading: _n,
2153
- list: Cn,
2154
- newline: un,
2155
- paragraph: Dn,
2156
- table: $,
2157
- text: bn
2158
- }, An = h("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", pn).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", wn).getRegex(), jn = {
2159
- ...kn,
2160
- lheading: vn,
2161
- table: An,
2162
- paragraph: h(yn).replace("hr", pn).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", An).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", wn).getRegex()
2163
- }, Mn = {
2164
- ...kn,
2165
- html: h("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", Tn).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(),
2161
+ }, pn = /^(?:[ \t]*(?:\n|$))+/, mn = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, hn = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, gn = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, _n = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, vn = / {0,3}(?:[*+-]|\d{1,9}[.)])/, yn = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, bn = h(yn).replace(/bull/g, vn).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}(?:\s|$)/).replace(/hr/g, / {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), xn = h(yn).replace(/bull/g, vn).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}(?:\s|$)/).replace(/hr/g, / {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), Sn = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/, Cn = /^[^\n]+/, wn = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Tn = h(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", wn).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), En = h(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, vn).getRegex(), Dn = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", On = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, kn = h("^ {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][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", On).replace("tag", Dn).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), de = (e) => h(Sn).replace("hr", gn).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", e).replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Dn).getRegex(), An = de(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/), jn = de(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/), Mn = {
2162
+ blockquote: h(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", jn).getRegex(),
2163
+ code: mn,
2164
+ def: Tn,
2165
+ fences: hn,
2166
+ heading: _n,
2167
+ hr: gn,
2168
+ html: kn,
2169
+ lheading: bn,
2170
+ list: En,
2171
+ newline: pn,
2172
+ paragraph: An,
2173
+ table: un,
2174
+ text: Cn
2175
+ }, Nn = h("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", gn).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Dn).getRegex(), Pn = {
2176
+ ...Mn,
2177
+ lheading: xn,
2178
+ table: Nn,
2179
+ paragraph: h(Sn).replace("hr", gn).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Nn).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Dn).getRegex()
2180
+ }, Fn = {
2181
+ ...Mn,
2182
+ html: h("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", On).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
2166
2183
  def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
2167
2184
  heading: /^(#{1,6})(.*)(?:\n+|$)/,
2168
- fences: $,
2185
+ fences: un,
2169
2186
  lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
2170
- paragraph: h(yn).replace("hr", pn).replace("heading", " *#{1,6} *[^\n]").replace("lheading", _n).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
2171
- }, Nn = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Pn = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Fn = /^( {2,}|\\)\n(?!\s*$)[ \t]*/, In = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Ln = /[\p{P}\p{S}]/u, Rn = /[\s\p{P}\p{S}]/u, zn = /[^\s\p{P}\p{S}]/u, Bn = h(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Rn).getRegex(), Vn = /[\p{Pi}\p{Ps}"']/u, Hn = /(?!~)[\p{P}\p{S}]/u, Un = /(?!~)[\s\p{P}\p{S}]/u, Wn = /(?:[^\s\p{P}\p{S}]|~)/u, Gn = h(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", cn ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), Kn = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, qn = h(Kn, "u").replace(/punct/g, Ln).getRegex(), Jn = h(Kn, "u").replace(/punct/g, Hn).getRegex(), Yn = h(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/, "u").replace(/openQuote/g, Vn).replace(/punct/g, Ln).getRegex(), Xn = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Zn = h(Xn, "gu").replace(/notPunctSpace/g, zn).replace(/punctSpace/g, Rn).replace(/punct/g, Ln).getRegex(), Qn = h(Xn, "gu").replace(/notPunctSpace/g, Wn).replace(/punctSpace/g, Un).replace(/punct/g, Hn).getRegex(), $n = h("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, zn).replace(/punctSpace/g, Rn).replace(/punct/g, Ln).getRegex(), er = h("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, zn).replace(/punctSpace/g, Rn).replace(/punct/g, Ln).getRegex(), tr = h("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, zn).replace(/punctSpace/g, Rn).replace(/punct/g, Ln).getRegex(), nr = h(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, Ln).getRegex(), rr = h("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, zn).replace(/punctSpace/g, Rn).replace(/punct/g, Ln).getRegex(), ir = h(/\\(punct)/, "gu").replace(/punct/g, Ln).getRegex(), ar = h(/^<(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(), or = h(Tn).replace("(?:-->|$)", "-->").getRegex(), sr = h("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", or).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), cr = /\[(?:\\[\s\S]|[^\[\]\\])*\]/, lr = h(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets", cr).getRegex(), ur = h(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", lr).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), dr = h(/^!?\[(label)\]\[(ref)\]/).replace("label", lr).replace("ref", xn).getRegex(), fr = h(/^!?\[(ref)\](?:\[\])?/).replace("ref", xn).getRegex(), pr = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/, mr = h(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets", cr).getRegex(), hr = h("reflink|nolink(?!\\()", "g").replace("reflink", h(/^!?\[(label)\]\[(ref)\]/).replace("label", mr).replace("ref", pr).getRegex()).replace("nolink", h(/^!?\[(ref)\](?:\[\])?/).replace("ref", pr).getRegex()).getRegex(), gr = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, _r = h(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g, /[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(), vr = {
2172
- _backpedal: $,
2173
- anyPunctuation: ir,
2174
- autolink: ar,
2175
- blockSkip: Gn,
2176
- br: Fn,
2177
- code: Pn,
2178
- del: $,
2179
- delLDelim: $,
2180
- delRDelim: $,
2181
- emStrongLDelim: qn,
2182
- emStrongRDelimAst: Zn,
2183
- emStrongRDelimUnd: er,
2184
- escape: Nn,
2185
- link: ur,
2186
- nolink: fr,
2187
- punctuation: Bn,
2188
- reflink: dr,
2189
- reflinkSearch: hr,
2190
- tag: sr,
2191
- text: In,
2192
- url: $
2193
- }, yr = {
2194
- ...vr,
2195
- emStrongLDelim: Yn,
2196
- emStrongRDelimAst: $n,
2197
- emStrongRDelimUnd: tr,
2198
- link: h(/^!?\[(label)\]\((.*?)\)/).replace("label", lr).getRegex(),
2199
- reflink: h(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", lr).getRegex()
2200
- }, br = {
2201
- ...vr,
2202
- emStrongRDelimAst: Qn,
2203
- emStrongLDelim: Jn,
2204
- delLDelim: nr,
2205
- delRDelim: rr,
2206
- url: h(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol", _r).replace("protocol", gr).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),
2207
- _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
2208
- del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
2209
- text: h(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol", gr).replace(/emailProtocol/g, /(?:mailto|xmpp):/).getRegex()
2210
- }, xr = {
2211
- ...br,
2212
- br: h(Fn).replace("{2,}", "*").getRegex(),
2213
- text: h(br.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
2187
+ paragraph: h(Sn).replace("hr", gn).replace("heading", " *#{1,6} *[^\n]").replace("lheading", bn).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
2188
+ }, In = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Ln = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Rn = /^( {2,}|\\)\n(?!\s*$)[ \t]*/, zn = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Bn = /[\p{P}\p{S}]/u, Vn = /[\s\p{P}\p{S}]/u, Hn = /[^\s\p{P}\p{S}]/u, Un = h(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Vn).getRegex(), Wn = /[\p{Pi}\p{Ps}"']/u, Gn = /(?!~)[\p{P}\p{S}]/u, Kn = /(?!~)[\s\p{P}\p{S}]/u, qn = /(?:[^\s\p{P}\p{S}]|~)/u, Jn = h(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", dn ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), Yn = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, Xn = h(Yn, "u").replace(/punct/g, Bn).getRegex(), Zn = h(Yn, "u").replace(/punct/g, Gn).getRegex(), Qn = h(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/, "u").replace(/openQuote/g, Wn).replace(/punct/g, Bn).getRegex(), $n = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", er = h($n, "gu").replace(/notPunctSpace/g, Hn).replace(/punctSpace/g, Vn).replace(/punct/g, Bn).getRegex(), tr = h($n, "gu").replace(/notPunctSpace/g, qn).replace(/punctSpace/g, Kn).replace(/punct/g, Gn).getRegex(), nr = h("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Hn).replace(/punctSpace/g, Vn).replace(/punct/g, Bn).getRegex(), rr = h("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, Hn).replace(/punctSpace/g, Vn).replace(/punct/g, Bn).getRegex(), ir = h("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Hn).replace(/punctSpace/g, Vn).replace(/punct/g, Bn).getRegex(), ar = h(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, Bn).getRegex(), or = h("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Hn).replace(/punctSpace/g, Vn).replace(/punct/g, Bn).getRegex(), sr = h(/\\(punct)/, "gu").replace(/punct/g, Bn).getRegex(), cr = h(/^<(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(), lr = h(On).replace("(?:-->|$)", "-->").getRegex(), ur = h("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", lr).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), dr = /\[(?:\\[\s\S]|[^\[\]\\])*\]/, fr = h(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets", dr).getRegex(), pr = h(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", fr).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), mr = h(/^!?\[(label)\]\[(ref)\]/).replace("label", fr).replace("ref", wn).getRegex(), hr = h(/^!?\[(ref)\](?:\[\])?/).replace("ref", wn).getRegex(), gr = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/, _r = h(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets", dr).getRegex(), vr = h("reflink|nolink(?!\\()", "g").replace("reflink", h(/^!?\[(label)\]\[(ref)\]/).replace("label", _r).replace("ref", gr).getRegex()).replace("nolink", h(/^!?\[(ref)\](?:\[\])?/).replace("ref", gr).getRegex()).getRegex(), yr = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, br = h(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g, /[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(), xr = {
2189
+ _backpedal: un,
2190
+ anyPunctuation: sr,
2191
+ autolink: cr,
2192
+ blockSkip: Jn,
2193
+ br: Rn,
2194
+ code: Ln,
2195
+ del: un,
2196
+ delLDelim: un,
2197
+ delRDelim: un,
2198
+ emStrongLDelim: Xn,
2199
+ emStrongRDelimAst: er,
2200
+ emStrongRDelimUnd: rr,
2201
+ escape: In,
2202
+ link: pr,
2203
+ nolink: hr,
2204
+ punctuation: Un,
2205
+ reflink: mr,
2206
+ reflinkSearch: vr,
2207
+ tag: ur,
2208
+ text: zn,
2209
+ url: un
2214
2210
  }, Sr = {
2215
- normal: kn,
2216
- gfm: jn,
2217
- pedantic: Mn
2211
+ ...xr,
2212
+ emStrongLDelim: Qn,
2213
+ emStrongRDelimAst: nr,
2214
+ emStrongRDelimUnd: ir,
2215
+ link: h(/^!?\[(label)\]\((.*?)\)/).replace("label", fr).getRegex(),
2216
+ reflink: h(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", fr).getRegex()
2218
2217
  }, Cr = {
2219
- normal: vr,
2220
- gfm: br,
2221
- breaks: xr,
2222
- pedantic: yr
2218
+ ...xr,
2219
+ emStrongRDelimAst: tr,
2220
+ emStrongLDelim: Zn,
2221
+ delLDelim: ar,
2222
+ delRDelim: or,
2223
+ url: h(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol", br).replace("protocol", yr).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),
2224
+ _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
2225
+ del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
2226
+ text: h(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol", yr).replace(/emailProtocol/g, /(?:mailto|xmpp):/).getRegex()
2223
2227
  }, wr = {
2228
+ ...Cr,
2229
+ br: h(Rn).replace("{2,}", "*").getRegex(),
2230
+ text: h(Cr.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
2231
+ }, Tr = {
2232
+ normal: Mn,
2233
+ gfm: Pn,
2234
+ pedantic: Fn
2235
+ }, Er = {
2236
+ normal: xr,
2237
+ gfm: Cr,
2238
+ breaks: wr,
2239
+ pedantic: Sr
2240
+ }, Dr = {
2224
2241
  "&": "&amp;",
2225
2242
  "<": "&lt;",
2226
2243
  ">": "&gt;",
2227
2244
  "\"": "&quot;",
2228
2245
  "'": "&#39;"
2229
- }, be = (e) => wr[e];
2246
+ }, be = (e) => Dr[e];
2230
2247
  function O(e, t) {
2231
2248
  if (t) {
2232
- if (ln.escapeTest.test(e)) return e.replace(ln.escapeReplace, be);
2233
- } else if (ln.escapeTestNoEncode.test(e)) return e.replace(ln.escapeReplaceNoEncode, be);
2249
+ if (fn.escapeTest.test(e)) return e.replace(fn.escapeReplace, be);
2250
+ } else if (fn.escapeTestNoEncode.test(e)) return e.replace(fn.escapeReplaceNoEncode, be);
2234
2251
  return e;
2235
2252
  }
2236
2253
  function Re(e) {
2237
- return e.replace(ln.numericCharacterReference, (e, t, n) => {
2254
+ return e.replace(fn.numericCharacterReference, (e, t, n) => {
2238
2255
  let r = t === void 0 ? Number.parseInt(n, 16) : Number.parseInt(t, 10);
2239
2256
  return r === 0 || r > 1114111 || r >= 55296 && r <= 57343 ? "�" : String.fromCodePoint(r);
2240
2257
  });
2241
2258
  }
2242
2259
  function re(e) {
2243
2260
  try {
2244
- e = encodeURI(e).replace(ln.percentDecode, "%");
2261
+ e = encodeURI(e).replace(fn.percentDecode, "%");
2245
2262
  } catch {
2246
2263
  return null;
2247
2264
  }
2248
2265
  return e;
2249
2266
  }
2250
2267
  function se(e, t) {
2251
- let n = e.replace(ln.findPipe, (e, t, n) => {
2268
+ let n = e.replace(fn.findPipe, (e, t, n) => {
2252
2269
  let r = !1, i = t;
2253
2270
  for (; --i >= 0 && n[i] === "\\";) r = !r;
2254
2271
  return r ? "|" : " |";
2255
- }).split(ln.splitPipe), r = 0;
2272
+ }).split(fn.splitPipe), r = 0;
2256
2273
  if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), t) {
2257
2274
  if (n.length > t) n.splice(t);
2258
2275
  else for (; n.length < t;) n.push("");
2259
2276
  }
2260
- for (; r < n.length; r++) n[r] = n[r].trim().replace(ln.slashPipe, "|");
2277
+ for (; r < n.length; r++) n[r] = n[r].trim().replace(fn.slashPipe, "|");
2261
2278
  return n;
2262
2279
  }
2263
2280
  function L(e, t, n) {
@@ -2274,7 +2291,7 @@ function L(e, t, n) {
2274
2291
  }
2275
2292
  function ie(e) {
2276
2293
  let t = e.split("\n"), n = t.length - 1;
2277
- for (; n >= 0 && ln.blankLine.test(t[n]);) n--;
2294
+ for (; n >= 0 && fn.blankLine.test(t[n]);) n--;
2278
2295
  return t.length - n <= 2 ? e : t.slice(0, n + 1).join("\n");
2279
2296
  }
2280
2297
  function q(e) {
@@ -2354,7 +2371,7 @@ function we(e, t, n, r) {
2354
2371
  }
2355
2372
  var P = class {
2356
2373
  constructor(e) {
2357
- t(this, "options", void 0), t(this, "rules", void 0), t(this, "lexer", void 0), this.options = e || sn;
2374
+ t(this, "options", void 0), t(this, "rules", void 0), t(this, "lexer", void 0), this.options = e || ln;
2358
2375
  }
2359
2376
  space(e) {
2360
2377
  let t = this.rules.block.newline.exec(e);
@@ -2817,25 +2834,25 @@ ${p.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
2817
2834
  };
2818
2835
  }
2819
2836
  }
2820
- }, Tr = class l {
2837
+ }, Or = class l {
2821
2838
  constructor(e) {
2822
- t(this, "tokens", void 0), t(this, "options", void 0), t(this, "state", void 0), t(this, "inlineQueue", void 0), t(this, "tokenizer", void 0), this.tokens = [], this.tokens.links = Object.create(null), this.options = e || sn, this.options.tokenizer = this.options.tokenizer || new P(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
2839
+ t(this, "tokens", void 0), t(this, "options", void 0), t(this, "state", void 0), t(this, "inlineQueue", void 0), t(this, "tokenizer", void 0), this.tokens = [], this.tokens.links = Object.create(null), this.options = e || ln, this.options.tokenizer = this.options.tokenizer || new P(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
2823
2840
  inLink: !1,
2824
2841
  inRawBlock: !1,
2825
2842
  linkEmitted: !1,
2826
2843
  top: !0
2827
2844
  };
2828
2845
  let n = {
2829
- other: ln,
2830
- block: Sr.normal,
2831
- inline: Cr.normal
2846
+ other: fn,
2847
+ block: Tr.normal,
2848
+ inline: Er.normal
2832
2849
  };
2833
- this.options.pedantic ? (n.block = Sr.pedantic, n.inline = Cr.pedantic) : this.options.gfm && (n.block = Sr.gfm, n.inline = this.options.breaks ? Cr.breaks : Cr.gfm), this.tokenizer.rules = n;
2850
+ this.options.pedantic ? (n.block = Tr.pedantic, n.inline = Er.pedantic) : this.options.gfm && (n.block = Tr.gfm, n.inline = this.options.breaks ? Er.breaks : Er.gfm), this.tokenizer.rules = n;
2834
2851
  }
2835
2852
  static get rules() {
2836
2853
  return {
2837
- block: Sr,
2838
- inline: Cr
2854
+ block: Tr,
2855
+ inline: Er
2839
2856
  };
2840
2857
  }
2841
2858
  static lex(e, t) {
@@ -2845,7 +2862,7 @@ ${p.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
2845
2862
  return new l(t).inlineTokens(e);
2846
2863
  }
2847
2864
  lex(e) {
2848
- e = e.replace(ln.carriageReturn, "\n"), this.blockTokens(e, this.tokens);
2865
+ e = e.replace(fn.carriageReturn, "\n"), this.blockTokens(e, this.tokens);
2849
2866
  for (let e = 0; e < this.inlineQueue.length; e++) {
2850
2867
  let t = this.inlineQueue[e];
2851
2868
  this.inlineTokens(t.src, t.tokens);
@@ -2853,7 +2870,7 @@ ${p.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
2853
2870
  return this.inlineQueue = [], this.tokens;
2854
2871
  }
2855
2872
  blockTokens(e, t = [], n = !1) {
2856
- this.tokenizer.lexer = this, this.options.pedantic && (e = e.replace(ln.tabCharGlobal, " ").replace(ln.spaceLine, ""));
2873
+ this.tokenizer.lexer = this, this.options.pedantic && (e = e.replace(fn.tabCharGlobal, " ").replace(fn.spaceLine, ""));
2857
2874
  let r = 1 / 0;
2858
2875
  for (; e;) {
2859
2876
  if (e.length < r) r = e.length;
@@ -3055,13 +3072,13 @@ ${p.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
3055
3072
  }
3056
3073
  }, S = class {
3057
3074
  constructor(e) {
3058
- t(this, "options", void 0), t(this, "parser", void 0), this.options = e || sn;
3075
+ t(this, "options", void 0), t(this, "parser", void 0), this.options = e || ln;
3059
3076
  }
3060
3077
  space(e) {
3061
3078
  return "";
3062
3079
  }
3063
3080
  code({ text: e, lang: t, escaped: n }) {
3064
- let r = (t || "").match(ln.notSpaceStart)?.[0], i = e ? e.replace(ln.endingNewline, "") + "\n" : "";
3081
+ let r = (t || "").match(fn.notSpaceStart)?.[0], i = e ? e.replace(fn.endingNewline, "") + "\n" : "";
3065
3082
  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";
3066
3083
  }
3067
3084
  blockquote({ tokens: e }) {
@@ -3189,9 +3206,9 @@ ${e}</tr>
3189
3206
  checkbox({ raw: e }) {
3190
3207
  return e;
3191
3208
  }
3192
- }, Er = class l {
3209
+ }, kr = class l {
3193
3210
  constructor(e) {
3194
- t(this, "options", void 0), t(this, "renderer", void 0), t(this, "textRenderer", void 0), this.options = e || sn, this.options.renderer = this.options.renderer || new S(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new z();
3211
+ t(this, "options", void 0), t(this, "renderer", void 0), t(this, "textRenderer", void 0), this.options = e || ln, this.options.renderer = this.options.renderer || new S(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new z();
3195
3212
  }
3196
3213
  static parse(e, t) {
3197
3214
  return new l(t).parse(e);
@@ -3339,9 +3356,9 @@ ${e}</tr>
3339
3356
  }
3340
3357
  return n;
3341
3358
  }
3342
- }, Dr = (_Class = class {
3359
+ }, Ar = (_Class = class {
3343
3360
  constructor(e) {
3344
- t(this, "options", void 0), t(this, "block", void 0), this.options = e || sn;
3361
+ t(this, "options", void 0), t(this, "block", void 0), this.options = e || ln;
3345
3362
  }
3346
3363
  preprocess(e) {
3347
3364
  return e;
@@ -3356,10 +3373,10 @@ ${e}</tr>
3356
3373
  return e;
3357
3374
  }
3358
3375
  provideLexer(e = this.block) {
3359
- return e ? Tr.lex : Tr.lexInline;
3376
+ return e ? Or.lex : Or.lexInline;
3360
3377
  }
3361
3378
  provideParser(e = this.block) {
3362
- return e ? Er.parse : Er.parseInline;
3379
+ return e ? kr.parse : kr.parseInline;
3363
3380
  }
3364
3381
  }, t(_Class, "passThroughHooks", /* @__PURE__ */ new Set([
3365
3382
  "preprocess",
@@ -3372,7 +3389,7 @@ ${e}</tr>
3372
3389
  "processAllTokens"
3373
3390
  ])), _Class), F = class {
3374
3391
  constructor(...e) {
3375
- t(this, "defaults", I()), t(this, "options", this.setOptions), t(this, "parse", this.parseMarkdown(!0)), t(this, "parseInline", this.parseMarkdown(!1)), t(this, "Parser", Er), t(this, "Renderer", S), t(this, "TextRenderer", z), t(this, "Lexer", Tr), t(this, "Tokenizer", P), t(this, "Hooks", Dr), this.use(...e);
3392
+ t(this, "defaults", I()), t(this, "options", this.setOptions), t(this, "parse", this.parseMarkdown(!0)), t(this, "parseInline", this.parseMarkdown(!1)), t(this, "Parser", kr), t(this, "Renderer", S), t(this, "TextRenderer", z), t(this, "Lexer", Or), t(this, "Tokenizer", P), t(this, "Hooks", Ar), this.use(...e);
3376
3393
  }
3377
3394
  walkTokens(e, t) {
3378
3395
  let n = [];
@@ -3451,13 +3468,13 @@ ${e}</tr>
3451
3468
  n.tokenizer = t;
3452
3469
  }
3453
3470
  if (e.hooks) {
3454
- let t = this.defaults.hooks || new Dr();
3471
+ let t = this.defaults.hooks || new Ar();
3455
3472
  for (let n in e.hooks) {
3456
3473
  if (!(n in t)) throw Error(`hook '${n}' does not exist`);
3457
3474
  if (["options", "block"].includes(n)) continue;
3458
3475
  let r = n, i = e.hooks[r], a = t[r];
3459
- t[r] = Dr.passThroughHooks.has(n) ? (e) => {
3460
- if (this.defaults.async && Dr.passThroughHooksRespectAsync.has(n)) return (async () => {
3476
+ t[r] = Ar.passThroughHooks.has(n) ? (e) => {
3477
+ if (this.defaults.async && Ar.passThroughHooksRespectAsync.has(n)) return (async () => {
3461
3478
  let n = await i.call(t, e);
3462
3479
  return a.call(t, n);
3463
3480
  })();
@@ -3494,10 +3511,10 @@ ${e}</tr>
3494
3511
  }, this;
3495
3512
  }
3496
3513
  lexer(e, t) {
3497
- return Tr.lex(e, t ?? this.defaults);
3514
+ return Or.lex(e, t ?? this.defaults);
3498
3515
  }
3499
3516
  parser(e, t) {
3500
- return Er.parse(e, t ?? this.defaults);
3517
+ return kr.parse(e, t ?? this.defaults);
3501
3518
  }
3502
3519
  parseMarkdown(e) {
3503
3520
  return (t, n) => {
@@ -3509,16 +3526,16 @@ ${e}</tr>
3509
3526
  if (typeof t > "u" || t === null) return a(/* @__PURE__ */ Error("marked(): input parameter is undefined or null"));
3510
3527
  if (typeof t != "string") return a(/* @__PURE__ */ Error("marked(): input parameter is of type " + Object.prototype.toString.call(t) + ", string expected"));
3511
3528
  if (i.hooks && (i.hooks.options = i, i.hooks.block = e), i.async) return (async () => {
3512
- let n = i.hooks ? await i.hooks.preprocess(t) : t, r = await (i.hooks ? await i.hooks.provideLexer(e) : e ? Tr.lex : Tr.lexInline)(n, i), a = i.hooks ? await i.hooks.processAllTokens(r) : r;
3529
+ let n = i.hooks ? await i.hooks.preprocess(t) : t, r = await (i.hooks ? await i.hooks.provideLexer(e) : e ? Or.lex : Or.lexInline)(n, i), a = i.hooks ? await i.hooks.processAllTokens(r) : r;
3513
3530
  i.walkTokens && await Promise.all(this.walkTokens(a, i.walkTokens));
3514
- let o = await (i.hooks ? await i.hooks.provideParser(e) : e ? Er.parse : Er.parseInline)(a, i);
3531
+ let o = await (i.hooks ? await i.hooks.provideParser(e) : e ? kr.parse : kr.parseInline)(a, i);
3515
3532
  return i.hooks ? await i.hooks.postprocess(o) : o;
3516
3533
  })().catch(a);
3517
3534
  try {
3518
3535
  i.hooks && (t = i.hooks.preprocess(t));
3519
- let n = (i.hooks ? i.hooks.provideLexer(e) : e ? Tr.lex : Tr.lexInline)(t, i);
3536
+ let n = (i.hooks ? i.hooks.provideLexer(e) : e ? Or.lex : Or.lexInline)(t, i);
3520
3537
  i.hooks && (n = i.hooks.processAllTokens(n)), i.walkTokens && this.walkTokens(n, i.walkTokens);
3521
- let r = (i.hooks ? i.hooks.provideParser(e) : e ? Er.parse : Er.parseInline)(n, i);
3538
+ let r = (i.hooks ? i.hooks.provideParser(e) : e ? kr.parse : kr.parseInline)(n, i);
3522
3539
  return i.hooks && (r = i.hooks.postprocess(r)), r;
3523
3540
  } catch (e) {
3524
3541
  return a(e);
@@ -3535,22 +3552,22 @@ ${e}</tr>
3535
3552
  throw n;
3536
3553
  };
3537
3554
  }
3538
- }, Or = new F();
3555
+ }, jr = new F();
3539
3556
  function k(e, t) {
3540
- return Or.parse(e, t);
3557
+ return jr.parse(e, t);
3541
3558
  }
3542
3559
  k.options = k.setOptions = function(e) {
3543
- return Or.setOptions(e), k.defaults = Or.defaults, W(k.defaults), k;
3544
- }, k.getDefaults = I, k.defaults = sn;
3560
+ return jr.setOptions(e), k.defaults = jr.defaults, W(k.defaults), k;
3561
+ }, k.getDefaults = I, k.defaults = ln;
3545
3562
  function Pt(...e) {
3546
- return Or.use(...e), k.defaults = Or.defaults, W(k.defaults), k;
3563
+ return jr.use(...e), k.defaults = jr.defaults, W(k.defaults), k;
3547
3564
  }
3548
3565
  k.use = Pt, k.walkTokens = function(e, t) {
3549
- return Or.walkTokens(e, t);
3550
- }, k.parseInline = Or.parseInline, k.Parser = Er, k.parser = Er.parse, k.Renderer = S, k.TextRenderer = z, k.Lexer = Tr, k.lexer = Tr.lex, k.Tokenizer = P, k.Hooks = Dr, k.parse = k, k.options, k.setOptions, k.walkTokens, k.parseInline, Er.parse, Tr.lex;
3566
+ return jr.walkTokens(e, t);
3567
+ }, k.parseInline = jr.parseInline, k.Parser = kr, k.parser = kr.parse, k.Renderer = S, k.TextRenderer = z, k.Lexer = Or, k.lexer = Or.lex, k.Tokenizer = P, k.Hooks = Ar, k.parse = k, k.options, k.setOptions, k.walkTokens, k.parseInline, kr.parse, Or.lex;
3551
3568
  //#endregion
3552
3569
  //#region bot/ui/ChatCardBlock.vue?vue&type=script&setup=true&lang.ts
3553
- var kr = ["aria-label"], Ar = { class: "px-4 pb-2 pt-4" }, jr = ["innerHTML"], Mr = ["onClick"], Nr = /* @__PURE__ */ E({
3570
+ var Mr = ["aria-label"], Nr = { class: "px-4 pb-2 pt-4" }, Pr = ["innerHTML"], Fr = ["onClick"], Ir = /* @__PURE__ */ D({
3554
3571
  __name: "ChatCardBlock",
3555
3572
  props: {
3556
3573
  spec: {},
@@ -3558,11 +3575,11 @@ var kr = ["aria-label"], Ar = { class: "px-4 pb-2 pt-4" }, jr = ["innerHTML"], M
3558
3575
  },
3559
3576
  emits: ["action"],
3560
3577
  setup(e, { emit: t }) {
3561
- let n = e, r = t, i = _(() => {
3578
+ let n = e, r = t, i = v(() => {
3562
3579
  if (!n.spec.body) return "";
3563
3580
  let e = k.parse(n.spec.body, { async: !1 });
3564
- return on.sanitize(e, { ADD_ATTR: ["target"] });
3565
- }), a = _(() => n.inverted ? "rgba(255, 255, 255, 0.22)" : "rgba(0, 0, 0, 0.16)"), o = _(() => n.inverted ? "rgba(255, 255, 255, 0.12)" : "color-mix(in oklch, var(--color-theme-200) 80%, transparent)"), s = _(() => n.inverted ? "rgba(255, 255, 255, 0.95)" : "var(--color-theme-900)"), c = _(() => n.inverted ? "rgba(255, 255, 255, 0.8)" : "var(--color-theme-800)"), d = _(() => n.inverted ? `inset 0 0 0 1px ${a.value}` : `inset 0 0 0 1px ${a.value}, 0 4px 16px rgba(15, 23, 42, 0.05)`), f = _(() => n.inverted ? "transparent" : "var(--color-theme-0)");
3581
+ return cn.sanitize(e, { ADD_ATTR: ["target"] });
3582
+ }), a = v(() => n.inverted ? "rgba(255, 255, 255, 0.22)" : "rgba(0, 0, 0, 0.16)"), o = v(() => n.inverted ? "rgba(255, 255, 255, 0.12)" : "color-mix(in oklch, var(--color-theme-200) 80%, transparent)"), s = v(() => n.inverted ? "rgba(255, 255, 255, 0.95)" : "var(--color-theme-900)"), c = v(() => n.inverted ? "rgba(255, 255, 255, 0.8)" : "var(--color-theme-800)"), d = v(() => n.inverted ? `inset 0 0 0 1px ${a.value}` : `inset 0 0 0 1px ${a.value}, 0 4px 16px rgba(15, 23, 42, 0.05)`), f = v(() => n.inverted ? "transparent" : "var(--color-theme-0)");
3566
3583
  function actionStyle(e) {
3567
3584
  return e === "primary" || e === "destructive" ? {
3568
3585
  background: n.inverted ? "rgba(255, 255, 255, 0.92)" : "var(--color-theme-900)",
@@ -3572,45 +3589,45 @@ var kr = ["aria-label"], Ar = { class: "px-4 pb-2 pt-4" }, jr = ["innerHTML"], M
3572
3589
  color: s.value
3573
3590
  };
3574
3591
  }
3575
- return (t, n) => (j(), b("div", {
3592
+ return (t, n) => (R(), x("div", {
3576
3593
  "data-test": "chat-card",
3577
3594
  class: "my-6 w-full self-start overflow-hidden rounded-2xl",
3578
- style: A({
3595
+ style: N({
3579
3596
  background: f.value,
3580
3597
  boxShadow: d.value
3581
3598
  }),
3582
3599
  "aria-label": e.spec.title
3583
3600
  }, [
3584
- x("div", Ar, [x("div", {
3601
+ w("div", Nr, [w("div", {
3585
3602
  class: "text-[14px] font-semibold leading-tight",
3586
- style: A({ color: s.value })
3587
- }, B(e.spec.title), 5)]),
3588
- i.value ? (j(), b("div", {
3603
+ style: N({ color: s.value })
3604
+ }, G(e.spec.title), 5)]),
3605
+ i.value ? (R(), x("div", {
3589
3606
  key: 0,
3590
3607
  class: "chat-msg-prose px-4 pb-4 pt-2 text-[14px] leading-relaxed",
3591
- style: A({ color: c.value }),
3608
+ style: N({ color: c.value }),
3592
3609
  innerHTML: i.value
3593
- }, null, 12, jr)) : y("", !0),
3594
- e.spec.actions?.length ? (j(), b("div", {
3610
+ }, null, 12, Pr)) : b("", !0),
3611
+ e.spec.actions?.length ? (R(), x("div", {
3595
3612
  key: 1,
3596
3613
  class: "flex flex-wrap items-center gap-2 px-3 py-2.5",
3597
- style: A({ borderTop: `1px solid ${o.value}` })
3598
- }, [(j(!0), b(m, null, N(e.spec.actions, (e) => (j(), b("button", {
3614
+ style: N({ borderTop: `1px solid ${o.value}` })
3615
+ }, [(R(!0), x(m, null, V(e.spec.actions, (e) => (R(), x("button", {
3599
3616
  key: e.label,
3600
3617
  type: "button",
3601
3618
  "data-test": "chat-card-action",
3602
3619
  class: "inline-flex h-10 items-center justify-center rounded-full px-5 text-[14px] font-semibold transition-colors duration-150 active:opacity-80",
3603
- style: A(actionStyle(e.style)),
3620
+ style: N(actionStyle(e.style)),
3604
3621
  onClick: (t) => r("action", e.reply)
3605
- }, B(e.label), 13, Mr))), 128))], 4)) : y("", !0)
3606
- ], 12, kr));
3622
+ }, G(e.label), 13, Fr))), 128))], 4)) : b("", !0)
3623
+ ], 12, Mr));
3607
3624
  }
3608
- }), Pr = 112, Fr = 52, Ir = 14, Lr = 54, Rr = 34, zr = 260;
3625
+ }), Lr = 112, Rr = 52, zr = 14, Br = 54, Vr = 34, Hr = 260;
3609
3626
  function nodeWidthFor(e) {
3610
3627
  let { orientation: t, maxRows: n, maxWidth: r } = e;
3611
- if (t === "horizontal" || !r) return Pr;
3612
- let i = r - 28 - (n - 1) * Lr;
3613
- return Math.min(zr, Math.max(Pr, Math.floor(i / n)));
3628
+ if (t === "horizontal" || !r) return Lr;
3629
+ let i = r - 28 - (n - 1) * Br;
3630
+ return Math.min(Hr, Math.max(Lr, Math.floor(i / n)));
3614
3631
  }
3615
3632
  function orientationFor(e) {
3616
3633
  return e.layout === "left-to-right" || e.layout === "radial" ? "horizontal" : e.layout === "top-to-bottom" ? "vertical" : e.diagramType === "sequence" ? "horizontal" : "vertical";
@@ -3647,11 +3664,11 @@ function buildLayout(e, t, n) {
3647
3664
  orientation: t,
3648
3665
  maxRows: o,
3649
3666
  ...n === void 0 ? {} : { maxWidth: n }
3650
- }), d = t === "horizontal" ? 28 + s * c + (s - 1) * Lr : 28 + o * c + (o - 1) * Lr, f = t === "horizontal" ? 28 + o * Fr + (o - 1) * Rr : 28 + s * Fr + (s - 1) * Rr, p = [];
3667
+ }), d = t === "horizontal" ? 28 + s * c + (s - 1) * Br : 28 + o * c + (o - 1) * Br, f = t === "horizontal" ? 28 + o * Rr + (o - 1) * Vr : 28 + s * Rr + (s - 1) * Vr, p = [];
3651
3668
  for (let [e, [, n]] of a.entries()) {
3652
- let r = (o - n.length) * (t === "horizontal" ? 86 : c + Lr) / 2;
3669
+ let r = (o - n.length) * (t === "horizontal" ? 86 : c + Br) / 2;
3653
3670
  for (let [i, a] of n.entries()) {
3654
- let n = t === "horizontal" ? Ir + e * (c + Lr) : Ir + r + i * (c + Lr), o = t === "horizontal" ? Ir + r + i * 86 : Ir + e * 86;
3671
+ let n = t === "horizontal" ? zr + e * (c + Br) : zr + r + i * (c + Br), o = t === "horizontal" ? zr + r + i * 86 : zr + e * 86;
3655
3672
  p.push({
3656
3673
  id: a.id,
3657
3674
  label: a.label,
@@ -3660,7 +3677,7 @@ function buildLayout(e, t, n) {
3660
3677
  x: n,
3661
3678
  y: o,
3662
3679
  width: c,
3663
- height: Fr
3680
+ height: Rr
3664
3681
  });
3665
3682
  }
3666
3683
  }
@@ -3737,14 +3754,14 @@ function formatChatVisualTick(e) {
3737
3754
  let { prefix: r, suffix: i } = affixes(n);
3738
3755
  return `${r}${formatChatVisualValue({ value: t })}${i}`;
3739
3756
  }
3740
- var Br = 5.4, Vr = 10, Hr = 15, Ur = 16;
3757
+ var Ur = 5.4, Wr = 10, Gr = 15, Kr = 16;
3741
3758
  function planChatVisualXLabels(e) {
3742
3759
  let { labels: t, plotWidth: n } = e;
3743
3760
  if (!t.length || n <= 0) return {
3744
3761
  mode: "horizontal",
3745
3762
  entries: []
3746
3763
  };
3747
- let r = t.map((e) => e.length > Ur ? `${e.slice(0, 15).trimEnd()}\u2026` : e), i = t.length - 1;
3764
+ let r = t.map((e) => e.length > Kr ? `${e.slice(0, 15).trimEnd()}\u2026` : e), i = t.length - 1;
3748
3765
  if (i === 0) return {
3749
3766
  mode: "horizontal",
3750
3767
  entries: [{
@@ -3752,14 +3769,14 @@ function planChatVisualXLabels(e) {
3752
3769
  text: r[0]
3753
3770
  }]
3754
3771
  };
3755
- if ((Math.max(...r.map((e) => e.length * Br)) + Vr) * t.length <= n) return {
3772
+ if ((Math.max(...r.map((e) => e.length * Ur)) + Wr) * t.length <= n) return {
3756
3773
  mode: "horizontal",
3757
3774
  entries: r.map((e, t) => ({
3758
3775
  index: t,
3759
3776
  text: e
3760
3777
  }))
3761
3778
  };
3762
- let a = Math.max(2, Math.floor(n / Hr));
3779
+ let a = Math.max(2, Math.floor(n / Gr));
3763
3780
  if (t.length <= a) return {
3764
3781
  mode: "angled",
3765
3782
  entries: r.map((e, t) => ({
@@ -3779,22 +3796,22 @@ function planChatVisualXLabels(e) {
3779
3796
  }
3780
3797
  //#endregion
3781
3798
  //#region bot/ui/ChatVisualBlock.vue?vue&type=script&setup=true&lang.ts
3782
- var Wr = [
3799
+ var qr = [
3783
3800
  "data-visual-type",
3784
3801
  "data-chart-type",
3785
3802
  "data-stacking",
3786
3803
  "data-diagram-type",
3787
3804
  "aria-label"
3788
- ], Gr = { class: "mb-2.5" }, Kr = ["aria-label"], qr = {
3805
+ ], Jr = { class: "mb-2.5" }, Yr = ["aria-label"], Xr = {
3789
3806
  key: 0,
3790
3807
  "data-test": "chat-visual-horizontal-bars",
3791
3808
  class: "grid gap-3"
3792
- }, Jr = { class: "mb-1 flex items-start justify-between gap-3 text-[12px]" }, Yr = ["viewBox"], Xr = [
3809
+ }, Zr = { class: "mb-1 flex items-start justify-between gap-3 text-[12px]" }, Qr = ["viewBox"], $r = [
3793
3810
  "x1",
3794
3811
  "x2",
3795
3812
  "y1",
3796
3813
  "y2"
3797
- ], Zr = ["x", "y"], Qr = [
3814
+ ], ei = ["x", "y"], ti = [
3798
3815
  "data-row-index",
3799
3816
  "data-series-index",
3800
3817
  "data-data-key",
@@ -3802,56 +3819,56 @@ var Wr = [
3802
3819
  "y",
3803
3820
  "width",
3804
3821
  "height"
3805
- ], $r = ["data-trend-key", "d"], ei = ["d"], ti = ["cx", "cy"], ni = ["cx", "cy"], ri = [
3822
+ ], ni = ["data-trend-key", "d"], ri = ["d"], ii = ["cx", "cy"], ai = ["cx", "cy"], oi = [
3806
3823
  "x",
3807
3824
  "y",
3808
3825
  "text-anchor",
3809
3826
  "transform"
3810
- ], ii = {
3827
+ ], si = {
3811
3828
  key: 2,
3812
3829
  class: "mt-2.5 flex flex-wrap items-center gap-x-4 gap-y-1.5"
3813
- }, ai = {
3830
+ }, ci = {
3814
3831
  key: 1,
3815
3832
  class: "grid gap-3"
3816
- }, oi = { class: "mb-1 flex items-baseline justify-between gap-3 text-[12px]" }, si = { class: "shrink-0 tabular-nums" }, ci = {
3833
+ }, li = { class: "mb-1 flex items-baseline justify-between gap-3 text-[12px]" }, ui = { class: "shrink-0 tabular-nums" }, di = {
3817
3834
  key: 2,
3818
3835
  class: "overflow-x-auto"
3819
- }, li = ["viewBox", "aria-label"], ui = [
3836
+ }, fi = ["viewBox", "aria-label"], pi = [
3820
3837
  "data-from",
3821
3838
  "data-to",
3822
3839
  "x1",
3823
3840
  "y1",
3824
3841
  "x2",
3825
3842
  "y2"
3826
- ], di = ["cx", "cy"], fi = ["x", "y"], pi = [
3843
+ ], mi = ["cx", "cy"], hi = ["x", "y"], gi = [
3827
3844
  "data-node-id",
3828
3845
  "data-node-kind",
3829
3846
  "transform"
3830
- ], mi = ["points"], hi = ["width", "height"], gi = ["width", "height"], _i = {
3847
+ ], _i = ["points"], vi = ["width", "height"], yi = ["width", "height"], bi = {
3831
3848
  xmlns: "http://www.w3.org/1999/xhtml",
3832
3849
  class: "flex h-full min-w-0 flex-col items-center justify-center text-center"
3833
- }, vi = /* @__PURE__ */ E({
3850
+ }, xi = /* @__PURE__ */ D({
3834
3851
  __name: "ChatVisualBlock",
3835
3852
  props: {
3836
3853
  result: {},
3837
3854
  inverted: { type: Boolean }
3838
3855
  },
3839
3856
  setup(e) {
3840
- let t = e, n = M(), r = R(360), i;
3857
+ let t = e, n = B(), r = U(360), i;
3841
3858
  ne(() => {
3842
3859
  typeof ResizeObserver < "u" && n.value && (i = new ResizeObserver((e) => {
3843
3860
  let t = e[0]?.contentRect.width;
3844
3861
  t && (r.value = Math.round(t));
3845
3862
  }), i.observe(n.value));
3846
3863
  }), te(() => i?.disconnect());
3847
- let a = _(() => Math.min(720, Math.max(280, r.value))), o = _(() => t.result.ok ? t.result.spec : null), s = _(() => o.value?.visualType === "chart" ? o.value : null), c = _(() => o.value?.visualType === "diagram" ? o.value : null);
3864
+ let a = v(() => Math.min(720, Math.max(280, r.value))), o = v(() => t.result.ok ? t.result.spec : null), s = v(() => o.value?.visualType === "chart" ? o.value : null), c = v(() => o.value?.visualType === "diagram" ? o.value : null);
3848
3865
  function isCartesianChart(e) {
3849
3866
  return e?.chartType === "bar" || e?.chartType === "line" || e?.chartType === "scatter";
3850
3867
  }
3851
3868
  function isPieChart(e) {
3852
3869
  return e?.chartType === "pie";
3853
3870
  }
3854
- let d = _(() => s.value?.data ?? []), f = _(() => isCartesianChart(s.value) ? s.value : null), p = _(() => f.value?.series ?? []), g = _(() => isPieChart(s.value) ? s.value : null), v = _(() => f.value?.chartType === "bar" && f.value.stacking === "stacked");
3871
+ let d = v(() => s.value?.data ?? []), f = v(() => isCartesianChart(s.value) ? s.value : null), p = v(() => f.value?.series ?? []), g = v(() => isPieChart(s.value) ? s.value : null), _ = v(() => f.value?.chartType === "bar" && f.value.stacking === "stacked");
3855
3872
  function numericValue(e) {
3856
3873
  return typeof e == "number" && Number.isFinite(e) ? e : null;
3857
3874
  }
@@ -3883,7 +3900,7 @@ var Wr = [
3883
3900
  intercept: (r - s * n) / t
3884
3901
  };
3885
3902
  }
3886
- let w = _(() => {
3903
+ let y = v(() => {
3887
3904
  let e = [], t = f.value;
3888
3905
  if (!t) return e;
3889
3906
  if (t.chartType === "bar" && t.stacking === "stacked") for (let n of t.data) {
@@ -3913,8 +3930,8 @@ var Wr = [
3913
3930
  let n = e > 0 ? e : 1, r = Math.floor(Math.log10(n)), i = n / 10 ** r, a;
3914
3931
  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;
3915
3932
  }
3916
- let T = _(() => {
3917
- let e = w.value, t = e.length ? Math.max(0, ...e) : 1, n = e.length ? Math.min(0, ...e) : 0;
3933
+ let T = v(() => {
3934
+ let e = y.value, t = e.length ? Math.max(0, ...e) : 1, n = e.length ? Math.min(0, ...e) : 0;
3918
3935
  if (n === t) return {
3919
3936
  min: 0,
3920
3937
  max: t || 1,
@@ -3927,7 +3944,7 @@ var Wr = [
3927
3944
  max: a,
3928
3945
  ticks: o
3929
3946
  };
3930
- }), E = _(() => resolveSharedSeriesFormat({ series: p.value })), ee = _(() => {
3947
+ }), E = v(() => resolveSharedSeriesFormat({ series: p.value })), D = v(() => {
3931
3948
  let e = f.value;
3932
3949
  if (!e) return {
3933
3950
  mode: "horizontal",
@@ -3938,8 +3955,8 @@ var Wr = [
3938
3955
  labels: e.data.map((e) => String(e?.[t] ?? "")),
3939
3956
  plotWidth: Math.max(200, a.value - 42)
3940
3957
  });
3941
- }), D = _(() => {
3942
- let e = E.value?.valueFormat, t = !!(E.value && (e === "currency" || e === "percent" || E.value.valuePrefix || E.value.valueSuffix)), n = e === "duration" ? 46 : t ? 38 : 30, r = ee.value.mode === "angled";
3958
+ }), A = v(() => {
3959
+ let e = E.value?.valueFormat, t = !!(E.value && (e === "currency" || e === "percent" || E.value.valuePrefix || E.value.valueSuffix)), n = e === "duration" ? 46 : t ? 38 : 30, r = D.value.mode === "angled";
3943
3960
  return {
3944
3961
  width: a.value,
3945
3962
  height: 168 + (r ? 36 : 0),
@@ -3950,7 +3967,7 @@ var Wr = [
3950
3967
  };
3951
3968
  });
3952
3969
  function labelCenterX(e, t) {
3953
- let n = f.value, r = D.value;
3970
+ let n = f.value, r = A.value;
3954
3971
  if (n?.chartType === "bar") {
3955
3972
  let n = r.width - r.left - r.right;
3956
3973
  return r.left + (e + .5) * (n / Math.max(t, 1));
@@ -3958,11 +3975,11 @@ var Wr = [
3958
3975
  return xForIndex(e, t);
3959
3976
  }
3960
3977
  function xForIndex(e, t) {
3961
- let n = D.value, r = n.width - n.left - n.right;
3978
+ let n = A.value, r = n.width - n.left - n.right;
3962
3979
  return t <= 1 ? n.left + r / 2 : n.left + r * e / (t - 1);
3963
3980
  }
3964
3981
  function yForValue(e) {
3965
- let { min: t, max: n } = T.value, r = D.value, i = r.height - r.top - r.bottom;
3982
+ let { min: t, max: n } = T.value, r = A.value, i = r.height - r.top - r.bottom;
3966
3983
  return r.top + (n - e) / (n - t || 1) * i;
3967
3984
  }
3968
3985
  function pathForSeries(e) {
@@ -3972,7 +3989,7 @@ var Wr = [
3972
3989
  return `${r === 0 ? "M" : "L"} ${xForIndex(r, t.data.length).toFixed(1)} ${yForValue(i).toFixed(1)}`;
3973
3990
  }).join(" ") : "";
3974
3991
  }
3975
- let ae = _(() => {
3992
+ let ee = v(() => {
3976
3993
  let e = f.value;
3977
3994
  if (!e?.trendLine || e.chartType !== "line" && e.chartType !== "scatter") return null;
3978
3995
  let t = trendLinePoints(e, e.trendLine.dataKey), n = linearTrend(t);
@@ -3983,11 +4000,11 @@ var Wr = [
3983
4000
  dataKey: e.trendLine.dataKey,
3984
4001
  seriesIndex: s
3985
4002
  };
3986
- }), ce = _(() => {
4003
+ }), j = v(() => {
3987
4004
  let e = f.value;
3988
4005
  if (!e || e.chartType !== "bar") return [];
3989
- let t = D.value, n = (t.width - t.left - t.right) / Math.max(e.data.length, 1), r = yForValue(0);
3990
- if (v.value) {
4006
+ let t = A.value, n = (t.width - t.left - t.right) / Math.max(e.data.length, 1), r = yForValue(0);
4007
+ if (_.value) {
3991
4008
  let r = Math.max(4, Math.min(24, n * .42));
3992
4009
  return e.data.flatMap((i, a) => {
3993
4010
  let o = 0, s = 0, c = t.left + a * n + (n - r) / 2;
@@ -4020,12 +4037,12 @@ var Wr = [
4020
4037
  dataKey: e.dataKey
4021
4038
  };
4022
4039
  }));
4023
- }), le = _(() => {
4040
+ }), M = v(() => {
4024
4041
  let e = f.value;
4025
4042
  if (!e) return [];
4026
4043
  let t = e.data;
4027
4044
  if (!t.length) return [];
4028
- let n = t.length - 1, r = ee.value, i = r.mode === "angled";
4045
+ let n = t.length - 1, r = D.value, i = r.mode === "angled";
4029
4046
  return r.entries.map(({ index: e, text: r }) => ({
4030
4047
  key: `${e}`,
4031
4048
  label: r,
@@ -4033,9 +4050,9 @@ var Wr = [
4033
4050
  anchor: i ? "end" : e === 0 ? "start" : e === n ? "end" : "middle",
4034
4051
  angled: i
4035
4052
  })).filter((e) => e.label);
4036
- }), ue = _(() => {
4053
+ }), ae = v(() => {
4037
4054
  let e = f.value;
4038
- if (!e || e.chartType !== "bar" || e.series.length !== 1 || v.value) return [];
4055
+ if (!e || e.chartType !== "bar" || e.series.length !== 1 || _.value) return [];
4039
4056
  let t = e.series[0], n = e.data.map((n, r) => {
4040
4057
  let i = categoryLabel(n, e.xKey), a = numericValue(n[t.dataKey]);
4041
4058
  return !i || a === null ? null : {
@@ -4056,7 +4073,7 @@ var Wr = [
4056
4073
  width: e.rawValue <= 0 ? 0 : Math.max(2, e.rawValue / r * 100),
4057
4074
  seriesIndex: 0
4058
4075
  }));
4059
- }), fe = _(() => {
4076
+ }), ce = v(() => {
4060
4077
  let e = f.value;
4061
4078
  if (!e?.data.length) return [];
4062
4079
  let t = e.data[e.data.length - 1];
@@ -4072,7 +4089,7 @@ var Wr = [
4072
4089
  seriesIndex: n
4073
4090
  };
4074
4091
  });
4075
- }), pe = _(() => {
4092
+ }), H = v(() => {
4076
4093
  let e = f.value;
4077
4094
  if (!e?.data.length || e.chartType !== "line") return [];
4078
4095
  let t = e.data.length - 1, n = e.data[t];
@@ -4085,7 +4102,7 @@ var Wr = [
4085
4102
  seriesIndex: i
4086
4103
  };
4087
4104
  }).filter((e) => e !== null);
4088
- }), me = _(() => {
4105
+ }), ue = v(() => {
4089
4106
  let e = g.value;
4090
4107
  if (!e) return [];
4091
4108
  let t = e.data.map((t) => ({
@@ -4101,104 +4118,104 @@ var Wr = [
4101
4118
  series: r
4102
4119
  })
4103
4120
  }));
4104
- }), he = _(() => c.value ? layoutChatDiagram(c.value, { maxWidth: r.value }) : null), ge = [
4121
+ }), fe = v(() => c.value ? layoutChatDiagram(c.value, { maxWidth: r.value }) : null), pe = [
4105
4122
  "var(--color-theme-900)",
4106
4123
  "var(--color-primary-500)",
4107
4124
  "color-mix(in oklch, var(--color-primary-500) 55%, var(--color-theme-500))"
4108
- ], _e = [
4125
+ ], me = [
4109
4126
  "rgba(255, 255, 255, 0.92)",
4110
4127
  "color-mix(in oklch, white 30%, var(--color-primary-500))",
4111
4128
  "rgba(255, 255, 255, 0.55)"
4112
4129
  ];
4113
4130
  function seriesColor(e) {
4114
- let n = t.inverted ? _e : ge;
4131
+ let n = t.inverted ? me : pe;
4115
4132
  return n[e % n.length];
4116
4133
  }
4117
4134
  function diagramNodeFill(e) {
4118
4135
  return t.inverted ? e === "decision" ? "rgba(255, 255, 255, 0.1)" : "rgba(255, 255, 255, 0.06)" : e === "decision" ? "color-mix(in oklch, var(--color-primary-500) 6%, var(--color-theme-0))" : e === "output" ? "color-mix(in oklch, var(--color-theme-900) 5%, var(--color-theme-0))" : "var(--color-theme-0)";
4119
4136
  }
4120
4137
  function diagramNodeStroke(e) {
4121
- return t.inverted ? "rgba(255, 255, 255, 0.22)" : G.value;
4138
+ return t.inverted ? "rgba(255, 255, 255, 0.22)" : ve.value;
4122
4139
  }
4123
- let ve = _(() => t.inverted ? "rgba(255, 255, 255, 0.95)" : "var(--color-theme-900)"), ye = _(() => t.inverted ? "rgba(255, 255, 255, 0.6)" : "var(--color-theme-500)"), H = _(() => t.inverted ? "rgba(255, 255, 255, 0.45)" : "color-mix(in oklch, var(--color-theme-900) 42%, transparent)"), xe = _(() => t.inverted ? "rgba(255, 255, 255, 0.1)" : "color-mix(in oklch, var(--color-theme-900) 8%, transparent)"), U = _(() => t.inverted ? "rgba(255, 255, 255, 0.24)" : "color-mix(in oklch, var(--color-theme-900) 18%, transparent)"), G = _(() => t.inverted ? "rgba(255, 255, 255, 0.16)" : "color-mix(in oklch, var(--color-theme-300) 55%, transparent)"), K = _(() => t.inverted ? "rgba(255, 255, 255, 0.14)" : "color-mix(in oklch, var(--color-theme-900) 10%, transparent)"), Se = _(() => t.inverted ? "transparent" : "var(--color-theme-0)"), Ce = _(() => t.inverted ? "rgba(255, 255, 255, 0.18)" : "color-mix(in oklch, var(--color-theme-900) 16%, transparent)"), Ee = _(() => t.inverted ? "rgba(255, 255, 255, 0.12)" : "color-mix(in oklch, var(--color-theme-900) 9%, transparent)");
4124
- return (e, r) => o.value ? (j(), b("section", {
4140
+ let he = v(() => t.inverted ? "rgba(255, 255, 255, 0.95)" : "var(--color-theme-900)"), ge = v(() => t.inverted ? "rgba(255, 255, 255, 0.6)" : "var(--color-theme-500)"), K = v(() => t.inverted ? "rgba(255, 255, 255, 0.45)" : "color-mix(in oklch, var(--color-theme-900) 42%, transparent)"), _e = v(() => t.inverted ? "rgba(255, 255, 255, 0.1)" : "color-mix(in oklch, var(--color-theme-900) 8%, transparent)"), J = v(() => t.inverted ? "rgba(255, 255, 255, 0.24)" : "color-mix(in oklch, var(--color-theme-900) 18%, transparent)"), ve = v(() => t.inverted ? "rgba(255, 255, 255, 0.16)" : "color-mix(in oklch, var(--color-theme-300) 55%, transparent)"), Y = v(() => t.inverted ? "rgba(255, 255, 255, 0.14)" : "color-mix(in oklch, var(--color-theme-900) 10%, transparent)"), ye = v(() => t.inverted ? "transparent" : "var(--color-theme-0)"), xe = v(() => t.inverted ? "rgba(255, 255, 255, 0.18)" : "color-mix(in oklch, var(--color-theme-900) 16%, transparent)"), Se = v(() => t.inverted ? "rgba(255, 255, 255, 0.12)" : "color-mix(in oklch, var(--color-theme-900) 9%, transparent)");
4141
+ return (e, r) => o.value ? (R(), x("section", {
4125
4142
  key: 0,
4126
4143
  "data-test": "chat-visual",
4127
4144
  "data-visual-type": o.value.visualType,
4128
4145
  "data-chart-type": s.value?.chartType,
4129
- "data-stacking": v.value ? "stacked" : void 0,
4146
+ "data-stacking": _.value ? "stacked" : void 0,
4130
4147
  "data-diagram-type": c.value?.diagramType,
4131
4148
  class: "my-6 w-full rounded-[20px] px-4 pb-3.5 pt-4",
4132
- style: A({
4133
- background: Se.value,
4134
- boxShadow: `inset 0 0 0 1px ${K.value}`
4149
+ style: N({
4150
+ background: ye.value,
4151
+ boxShadow: `inset 0 0 0 1px ${Y.value}`
4135
4152
  }),
4136
4153
  "aria-label": o.value.meta.title
4137
4154
  }, [
4138
- x("header", Gr, [x("h4", {
4155
+ w("header", Jr, [w("h4", {
4139
4156
  class: "text-[13px] font-semibold leading-tight",
4140
- style: A({ color: ve.value })
4141
- }, B(o.value.meta.title), 5), o.value.meta.description ? (j(), b("p", {
4157
+ style: N({ color: he.value })
4158
+ }, G(o.value.meta.title), 5), o.value.meta.description ? (R(), x("p", {
4142
4159
  key: 0,
4143
4160
  class: "mt-0.5 text-[12px] leading-snug",
4144
- style: A({ color: ye.value })
4145
- }, B(o.value.meta.description), 5)) : y("", !0)]),
4146
- x("div", {
4161
+ style: N({ color: ge.value })
4162
+ }, G(o.value.meta.description), 5)) : b("", !0)]),
4163
+ w("div", {
4147
4164
  ref_key: "bodyEl",
4148
4165
  ref: n
4149
- }, [f.value ? (j(), b("div", {
4166
+ }, [f.value ? (R(), x("div", {
4150
4167
  key: 0,
4151
4168
  role: "img",
4152
4169
  "aria-label": o.value.meta.title
4153
- }, [ue.value.length ? (j(), b("div", qr, [(j(!0), b(m, null, N(ue.value, (e) => (j(), b("div", {
4170
+ }, [ae.value.length ? (R(), x("div", Xr, [(R(!0), x(m, null, V(ae.value, (e) => (R(), x("div", {
4154
4171
  key: e.key,
4155
4172
  "data-test": "chat-visual-horizontal-bar",
4156
4173
  class: "min-w-0"
4157
- }, [x("div", Jr, [x("span", {
4174
+ }, [w("div", Zr, [w("span", {
4158
4175
  class: "line-clamp-2 min-w-0 font-medium leading-snug",
4159
- style: A({ color: ve.value })
4160
- }, B(e.label), 5), x("span", {
4176
+ style: N({ color: he.value })
4177
+ }, G(e.label), 5), w("span", {
4161
4178
  class: "shrink-0 font-semibold tabular-nums",
4162
- style: A({ color: ve.value })
4163
- }, B(e.value), 5)]), x("div", {
4179
+ style: N({ color: he.value })
4180
+ }, G(e.value), 5)]), w("div", {
4164
4181
  class: "h-2 w-full overflow-hidden rounded-full",
4165
- style: A({ background: Ee.value })
4166
- }, [x("div", {
4182
+ style: N({ background: Se.value })
4183
+ }, [w("div", {
4167
4184
  class: "h-full rounded-full",
4168
- style: A({
4185
+ style: N({
4169
4186
  width: `${e.width}%`,
4170
4187
  background: seriesColor(e.seriesIndex)
4171
4188
  })
4172
- }, null, 4)], 4)]))), 128))])) : (j(), b("svg", {
4189
+ }, null, 4)], 4)]))), 128))])) : (R(), x("svg", {
4173
4190
  key: 1,
4174
4191
  class: "block h-auto w-full overflow-visible",
4175
- viewBox: `0 0 ${D.value.width} ${D.value.height}`,
4176
- style: A({ aspectRatio: `${D.value.width} / ${D.value.height}` }),
4192
+ viewBox: `0 0 ${A.value.width} ${A.value.height}`,
4193
+ style: N({ aspectRatio: `${A.value.width} / ${A.value.height}` }),
4177
4194
  preserveAspectRatio: "xMidYMid meet",
4178
4195
  "aria-hidden": "true"
4179
4196
  }, [
4180
- (j(!0), b(m, null, N(T.value.ticks, (e) => (j(), b("line", {
4197
+ (R(!0), x(m, null, V(T.value.ticks, (e) => (R(), x("line", {
4181
4198
  key: `grid-${e}`,
4182
- x1: D.value.left,
4183
- x2: D.value.width - D.value.right,
4199
+ x1: A.value.left,
4200
+ x2: A.value.width - A.value.right,
4184
4201
  y1: yForValue(e),
4185
4202
  y2: yForValue(e),
4186
4203
  "stroke-width": "1",
4187
4204
  "vector-effect": "non-scaling-stroke",
4188
- style: A({ stroke: e === 0 ? U.value : xe.value })
4189
- }, null, 12, Xr))), 128)),
4190
- x("g", null, [(j(!0), b(m, null, N(T.value.ticks, (e) => (j(), b("text", {
4205
+ style: N({ stroke: e === 0 ? J.value : _e.value })
4206
+ }, null, 12, $r))), 128)),
4207
+ w("g", null, [(R(!0), x(m, null, V(T.value.ticks, (e) => (R(), x("text", {
4191
4208
  key: `y-${e}`,
4192
- x: D.value.left - 7,
4209
+ x: A.value.left - 7,
4193
4210
  y: yForValue(e) + 3,
4194
4211
  "text-anchor": "end",
4195
4212
  "font-size": "9.5",
4196
- style: A({ fill: H.value })
4197
- }, B(V(formatChatVisualTick)({
4213
+ style: N({ fill: K.value })
4214
+ }, G(le(formatChatVisualTick)({
4198
4215
  value: e,
4199
4216
  shared: E.value
4200
- })), 13, Zr))), 128))]),
4201
- f.value.chartType === "bar" ? (j(!0), b(m, { key: 0 }, N(ce.value, (e) => (j(), b("rect", {
4217
+ })), 13, ei))), 128))]),
4218
+ f.value.chartType === "bar" ? (R(!0), x(m, { key: 0 }, V(j.value, (e) => (R(), x("rect", {
4202
4219
  key: e.key,
4203
4220
  "data-test": "chat-visual-bar",
4204
4221
  "data-row-index": e.rowIndex,
@@ -4209,22 +4226,22 @@ var Wr = [
4209
4226
  width: e.width,
4210
4227
  height: e.height,
4211
4228
  rx: "2.5",
4212
- style: A({ fill: seriesColor(e.seriesIndex) })
4213
- }, null, 12, Qr))), 128)) : (j(), b(m, { key: 1 }, [
4214
- ae.value ? (j(), b("path", {
4229
+ style: N({ fill: seriesColor(e.seriesIndex) })
4230
+ }, null, 12, ti))), 128)) : (R(), x(m, { key: 1 }, [
4231
+ ee.value ? (R(), x("path", {
4215
4232
  key: 0,
4216
4233
  "data-test": "chat-visual-trend-line",
4217
- "data-trend-key": ae.value.dataKey,
4218
- d: ae.value.path,
4234
+ "data-trend-key": ee.value.dataKey,
4235
+ d: ee.value.path,
4219
4236
  fill: "none",
4220
4237
  "stroke-width": "1.4",
4221
4238
  "stroke-linecap": "round",
4222
4239
  "stroke-linejoin": "round",
4223
4240
  "stroke-dasharray": "4 3",
4224
4241
  "vector-effect": "non-scaling-stroke",
4225
- style: A({ stroke: seriesColor(ae.value.seriesIndex) })
4226
- }, null, 12, $r)) : y("", !0),
4227
- (j(!0), b(m, null, N(p.value, (e, t) => (j(), b("g", { key: e.dataKey }, [f.value.chartType === "line" ? (j(), b("path", {
4242
+ style: N({ stroke: seriesColor(ee.value.seriesIndex) })
4243
+ }, null, 12, ni)) : b("", !0),
4244
+ (R(!0), x(m, null, V(p.value, (e, t) => (R(), x("g", { key: e.dataKey }, [f.value.chartType === "line" ? (R(), x("path", {
4228
4245
  key: 0,
4229
4246
  d: pathForSeries(e.dataKey),
4230
4247
  fill: "none",
@@ -4232,74 +4249,74 @@ var Wr = [
4232
4249
  "stroke-linecap": "round",
4233
4250
  "stroke-linejoin": "round",
4234
4251
  "vector-effect": "non-scaling-stroke",
4235
- style: A({ stroke: seriesColor(t) })
4236
- }, null, 12, ei)) : y("", !0), (j(!0), b(m, null, N(d.value, (n, r) => (j(), b(m, { key: `${e.dataKey}-${r}` }, [f.value.chartType === "scatter" ? (j(), b("circle", {
4252
+ style: N({ stroke: seriesColor(t) })
4253
+ }, null, 12, ri)) : b("", !0), (R(!0), x(m, null, V(d.value, (n, r) => (R(), x(m, { key: `${e.dataKey}-${r}` }, [f.value.chartType === "scatter" ? (R(), x("circle", {
4237
4254
  key: 0,
4238
4255
  cx: xForIndex(r, d.value.length),
4239
4256
  cy: yForValue(numericValue(n[e.dataKey]) ?? 0),
4240
4257
  r: "2.6",
4241
- style: A({ fill: seriesColor(t) })
4242
- }, null, 12, ti)) : y("", !0)], 64))), 128))]))), 128)),
4243
- (j(!0), b(m, null, N(pe.value, (e) => (j(), b("circle", {
4258
+ style: N({ fill: seriesColor(t) })
4259
+ }, null, 12, ii)) : b("", !0)], 64))), 128))]))), 128)),
4260
+ (R(!0), x(m, null, V(H.value, (e) => (R(), x("circle", {
4244
4261
  key: `marker-${e.key}`,
4245
4262
  cx: e.cx,
4246
4263
  cy: e.cy,
4247
4264
  r: "3",
4248
- style: A({ fill: seriesColor(e.seriesIndex) })
4249
- }, null, 12, ni))), 128))
4265
+ style: N({ fill: seriesColor(e.seriesIndex) })
4266
+ }, null, 12, ai))), 128))
4250
4267
  ], 64)),
4251
- (j(!0), b(m, null, N(le.value, (e) => (j(), b("text", {
4268
+ (R(!0), x(m, null, V(M.value, (e) => (R(), x("text", {
4252
4269
  key: e.key,
4253
4270
  x: e.x,
4254
- y: e.angled ? D.value.height - D.value.bottom + 12 : D.value.height - 6,
4271
+ y: e.angled ? A.value.height - A.value.bottom + 12 : A.value.height - 6,
4255
4272
  "text-anchor": e.anchor,
4256
4273
  "font-size": "9.5",
4257
- transform: e.angled ? `rotate(${V(-40)} ${e.x} ${D.value.height - D.value.bottom + 12})` : void 0,
4258
- style: A({ fill: H.value })
4259
- }, B(e.label), 13, ri))), 128))
4260
- ], 12, Yr)), fe.value.length > 1 || f.value.chartType !== "bar" ? (j(), b("div", ii, [(j(!0), b(m, null, N(fe.value, (e) => (j(), b("div", {
4274
+ transform: e.angled ? `rotate(${le(-40)} ${e.x} ${A.value.height - A.value.bottom + 12})` : void 0,
4275
+ style: N({ fill: K.value })
4276
+ }, G(e.label), 13, oi))), 128))
4277
+ ], 12, Qr)), ce.value.length > 1 || f.value.chartType !== "bar" ? (R(), x("div", si, [(R(!0), x(m, null, V(ce.value, (e) => (R(), x("div", {
4261
4278
  key: e.key,
4262
4279
  class: "inline-flex items-center gap-1.5 text-[11.5px] leading-none"
4263
4280
  }, [
4264
- x("span", {
4281
+ w("span", {
4265
4282
  class: "size-2.5 shrink-0 rounded-full",
4266
- style: A({ background: seriesColor(e.seriesIndex) })
4283
+ style: N({ background: seriesColor(e.seriesIndex) })
4267
4284
  }, null, 4),
4268
- x("span", { style: A({ color: ye.value }) }, B(e.label), 5),
4269
- x("span", {
4285
+ w("span", { style: N({ color: ge.value }) }, G(e.label), 5),
4286
+ w("span", {
4270
4287
  class: "font-semibold tabular-nums",
4271
- style: A({ color: ve.value })
4272
- }, B(e.value), 5)
4273
- ]))), 128))])) : y("", !0)], 8, Kr)) : g.value ? (j(), b("div", ai, [(j(!0), b(m, null, N(me.value, (e, t) => (j(), b("div", { key: e.key }, [x("div", oi, [x("span", {
4288
+ style: N({ color: he.value })
4289
+ }, G(e.value), 5)
4290
+ ]))), 128))])) : b("", !0)], 8, Yr)) : g.value ? (R(), x("div", ci, [(R(!0), x(m, null, V(ue.value, (e, t) => (R(), x("div", { key: e.key }, [w("div", li, [w("span", {
4274
4291
  class: "truncate font-medium",
4275
- style: A({ color: ve.value })
4276
- }, B(e.name), 5), x("span", si, [x("span", {
4292
+ style: N({ color: he.value })
4293
+ }, G(e.name), 5), w("span", ui, [w("span", {
4277
4294
  class: "font-semibold",
4278
- style: A({ color: ve.value })
4279
- }, B(e.display), 5), x("span", {
4295
+ style: N({ color: he.value })
4296
+ }, G(e.display), 5), w("span", {
4280
4297
  class: "ml-1.5",
4281
- style: A({ color: ye.value })
4282
- }, B(Math.round(e.percent * 100)) + "%", 5)])]), x("div", {
4298
+ style: N({ color: ge.value })
4299
+ }, G(Math.round(e.percent * 100)) + "%", 5)])]), w("div", {
4283
4300
  class: "h-1.5 w-full overflow-hidden rounded-full",
4284
- style: A({ background: Ee.value })
4285
- }, [x("div", {
4301
+ style: N({ background: Se.value })
4302
+ }, [w("div", {
4286
4303
  class: "h-full rounded-full",
4287
- style: A({
4304
+ style: N({
4288
4305
  width: `${Math.max(2, e.percent * 100)}%`,
4289
4306
  background: seriesColor(t)
4290
4307
  })
4291
- }, null, 4)], 4)]))), 128))])) : c.value && he.value ? (j(), b("div", ci, [(j(), b("svg", {
4308
+ }, null, 4)], 4)]))), 128))])) : c.value && fe.value ? (R(), x("div", di, [(R(), x("svg", {
4292
4309
  "data-test": "chat-visual-diagram-svg",
4293
4310
  class: "block h-auto overflow-visible",
4294
- viewBox: `0 0 ${he.value.width} ${he.value.height}`,
4295
- style: A({
4296
- width: `${he.value.width}px`,
4297
- aspectRatio: `${he.value.width} / ${he.value.height}`
4311
+ viewBox: `0 0 ${fe.value.width} ${fe.value.height}`,
4312
+ style: N({
4313
+ width: `${fe.value.width}px`,
4314
+ aspectRatio: `${fe.value.width} / ${fe.value.height}`
4298
4315
  }),
4299
4316
  role: "img",
4300
4317
  "aria-label": o.value.meta.title
4301
4318
  }, [
4302
- (j(!0), b(m, null, N(he.value.edges, (e) => (j(), b("line", {
4319
+ (R(!0), x(m, null, V(fe.value.edges, (e) => (R(), x("line", {
4303
4320
  key: e.key,
4304
4321
  "data-test": "chat-visual-diagram-edge",
4305
4322
  "data-from": e.from,
@@ -4311,77 +4328,77 @@ var Wr = [
4311
4328
  "stroke-width": "1.4",
4312
4329
  "stroke-linecap": "round",
4313
4330
  "vector-effect": "non-scaling-stroke",
4314
- style: A({ stroke: Ce.value })
4315
- }, null, 12, ui))), 128)),
4316
- (j(!0), b(m, null, N(he.value.edges, (e) => (j(), b("circle", {
4331
+ style: N({ stroke: xe.value })
4332
+ }, null, 12, pi))), 128)),
4333
+ (R(!0), x(m, null, V(fe.value.edges, (e) => (R(), x("circle", {
4317
4334
  key: `${e.key}-dot`,
4318
4335
  cx: e.x2,
4319
4336
  cy: e.y2,
4320
4337
  r: "2.4",
4321
- style: A({ fill: Ce.value })
4322
- }, null, 12, di))), 128)),
4323
- (j(!0), b(m, null, N(he.value.edges.filter((e) => e.label), (e) => (j(), b("foreignObject", {
4338
+ style: N({ fill: xe.value })
4339
+ }, null, 12, mi))), 128)),
4340
+ (R(!0), x(m, null, V(fe.value.edges.filter((e) => e.label), (e) => (R(), x("foreignObject", {
4324
4341
  key: `${e.key}-label`,
4325
4342
  x: e.labelX - 55,
4326
4343
  y: e.labelY - 12,
4327
4344
  width: "110",
4328
4345
  height: "24"
4329
- }, [x("div", {
4346
+ }, [w("div", {
4330
4347
  xmlns: "http://www.w3.org/1999/xhtml",
4331
4348
  class: "flex h-full items-center justify-center px-1 text-center text-[10.5px] font-medium leading-none",
4332
- style: A({
4333
- color: ye.value,
4349
+ style: N({
4350
+ color: ge.value,
4334
4351
  background: t.inverted ? "var(--color-theme-900)" : "var(--color-theme-0)"
4335
4352
  })
4336
- }, B(e.label), 5)], 8, fi))), 128)),
4337
- (j(!0), b(m, null, N(he.value.nodes, (e) => (j(), b("g", {
4353
+ }, G(e.label), 5)], 8, hi))), 128)),
4354
+ (R(!0), x(m, null, V(fe.value.nodes, (e) => (R(), x("g", {
4338
4355
  key: e.id,
4339
4356
  "data-test": "chat-visual-diagram-node",
4340
4357
  "data-node-id": e.id,
4341
4358
  "data-node-kind": e.kind,
4342
4359
  transform: `translate(${e.x} ${e.y})`
4343
- }, [e.kind === "decision" ? (j(), b("polygon", {
4360
+ }, [e.kind === "decision" ? (R(), x("polygon", {
4344
4361
  key: 0,
4345
4362
  points: `${e.width / 2},0 ${e.width},${e.height / 2} ${e.width / 2},${e.height} 0,${e.height / 2}`,
4346
4363
  "stroke-width": "1",
4347
4364
  "vector-effect": "non-scaling-stroke",
4348
- style: A({
4365
+ style: N({
4349
4366
  fill: diagramNodeFill(e.kind),
4350
4367
  stroke: diagramNodeStroke(e.kind)
4351
4368
  })
4352
- }, null, 12, mi)) : (j(), b("rect", {
4369
+ }, null, 12, _i)) : (R(), x("rect", {
4353
4370
  key: 1,
4354
4371
  width: e.width,
4355
4372
  height: e.height,
4356
4373
  rx: "9",
4357
4374
  "stroke-width": "1",
4358
4375
  "vector-effect": "non-scaling-stroke",
4359
- style: A({
4376
+ style: N({
4360
4377
  fill: diagramNodeFill(e.kind),
4361
4378
  stroke: diagramNodeStroke(e.kind)
4362
4379
  })
4363
- }, null, 12, hi)), (j(), b("foreignObject", {
4380
+ }, null, 12, vi)), (R(), x("foreignObject", {
4364
4381
  x: "8",
4365
4382
  y: "5",
4366
4383
  width: e.width - 16,
4367
4384
  height: e.height - 10
4368
- }, [x("div", _i, [x("div", {
4385
+ }, [w("div", bi, [w("div", {
4369
4386
  class: "line-clamp-2 text-[13px] font-medium leading-snug",
4370
- style: A({ color: ve.value })
4371
- }, B(e.label), 5), e.detail ? (j(), b("div", {
4387
+ style: N({ color: he.value })
4388
+ }, G(e.label), 5), e.detail ? (R(), x("div", {
4372
4389
  key: 0,
4373
4390
  class: "mt-0.5 line-clamp-1 text-[10.5px] leading-none",
4374
- style: A({ color: ye.value })
4375
- }, B(e.detail), 5)) : y("", !0)])], 8, gi))], 8, pi))), 128))
4376
- ], 12, li))])) : y("", !0)], 512),
4377
- o.value.meta.footer ? (j(), b("footer", {
4391
+ style: N({ color: ge.value })
4392
+ }, G(e.detail), 5)) : b("", !0)])], 8, yi))], 8, gi))), 128))
4393
+ ], 12, fi))])) : b("", !0)], 512),
4394
+ o.value.meta.footer ? (R(), x("footer", {
4378
4395
  key: 0,
4379
4396
  class: "mt-3 text-[11px] leading-snug",
4380
- style: A({ color: H.value })
4381
- }, B(o.value.meta.footer), 5)) : y("", !0)
4382
- ], 12, Wr)) : y("", !0);
4397
+ style: N({ color: K.value })
4398
+ }, G(o.value.meta.footer), 5)) : b("", !0)
4399
+ ], 12, qr)) : b("", !0);
4383
4400
  }
4384
- }), yi = ["innerHTML"], bi = /* @__PURE__ */ E({
4401
+ }), Si = ["innerHTML"], Ci = /* @__PURE__ */ D({
4385
4402
  __name: "ChatRichText",
4386
4403
  props: {
4387
4404
  text: {},
@@ -4390,7 +4407,7 @@ var Wr = [
4390
4407
  },
4391
4408
  emits: ["action"],
4392
4409
  setup(e, { emit: t }) {
4393
- let n = e, r = t, i = R(n.text), a;
4410
+ let n = e, r = t, i = U(n.text), a;
4394
4411
  pe([() => n.text, () => n.streaming], ([e, t]) => {
4395
4412
  if (!t) {
4396
4413
  a !== void 0 && (cancelAnimationFrame(a), a = void 0), i.value = e;
@@ -4421,7 +4438,7 @@ var Wr = [
4421
4438
  function renderMarkdown(e) {
4422
4439
  if (!e) return "";
4423
4440
  let t = k.parse(e, { async: !1 });
4424
- return on.sanitize(t, {
4441
+ return cn.sanitize(t, {
4425
4442
  ADD_ATTR: ["target"],
4426
4443
  ADD_DATA_URI_TAGS: ["img"]
4427
4444
  });
@@ -4545,58 +4562,58 @@ var Wr = [
4545
4562
  html: g
4546
4563
  }), r;
4547
4564
  }
4548
- let c = _(() => {
4565
+ let c = v(() => {
4549
4566
  let e = i.value;
4550
4567
  return e ? richTextSegments({
4551
4568
  text: e,
4552
4569
  streaming: !!n.streaming
4553
4570
  }) : [];
4554
4571
  });
4555
- return (t, n) => (j(), b("div", {
4572
+ return (t, n) => (R(), x("div", {
4556
4573
  class: "chat-msg-rich break-words text-[14px] leading-[1.55] @sm/chat:text-[15px] @sm/chat:leading-[1.5]",
4557
4574
  onErrorCapture: onRichTextAssetError
4558
- }, [(j(!0), b(m, null, N(c.value, (t) => (j(), b(m, { key: t.key }, [t.kind === "markdown" ? (j(), b("div", {
4575
+ }, [(R(!0), x(m, null, V(c.value, (t) => (R(), x(m, { key: t.key }, [t.kind === "markdown" ? (R(), x("div", {
4559
4576
  key: 0,
4560
- class: D(["chat-msg-prose", e.inverted ? "chat-msg-prose-invert" : ""]),
4577
+ class: j(["chat-msg-prose", e.inverted ? "chat-msg-prose-invert" : ""]),
4561
4578
  innerHTML: t.html
4562
- }, null, 10, yi)) : t.kind === "visual" ? (j(), v(vi, {
4579
+ }, null, 10, Si)) : t.kind === "visual" ? (R(), y(xi, {
4563
4580
  key: 1,
4564
4581
  result: t.result,
4565
4582
  inverted: e.inverted
4566
- }, null, 8, ["result", "inverted"])) : t.kind === "card" ? (j(), v(Nr, {
4583
+ }, null, 8, ["result", "inverted"])) : t.kind === "card" ? (R(), y(Ir, {
4567
4584
  key: 2,
4568
4585
  spec: t.spec,
4569
4586
  inverted: e.inverted,
4570
4587
  onAction: n[0] || (n[0] = (e) => r("action", e))
4571
- }, null, 8, ["spec", "inverted"])) : (j(), b("div", {
4588
+ }, null, 8, ["spec", "inverted"])) : (R(), x("div", {
4572
4589
  key: 3,
4573
4590
  "data-test": "chat-visual-pending",
4574
4591
  role: "status",
4575
4592
  class: "my-6 flex items-center gap-2.5 rounded-[20px] px-4 py-5 text-[12px] font-medium",
4576
- style: A({
4593
+ style: N({
4577
4594
  background: e.inverted ? "transparent" : "var(--color-theme-0)",
4578
4595
  boxShadow: `inset 0 0 0 1px ${e.inverted ? "rgba(255, 255, 255, 0.14)" : "color-mix(in oklch, var(--color-theme-900) 8%, transparent)"}`,
4579
4596
  color: e.inverted ? "rgba(255, 255, 255, 0.6)" : "var(--color-theme-500)"
4580
4597
  })
4581
- }, [...n[1] || (n[1] = [x("span", {
4598
+ }, [...n[1] || (n[1] = [w("span", {
4582
4599
  class: "size-2 shrink-0 animate-pulse rounded-full",
4583
4600
  style: { background: "currentcolor" }
4584
- }, null, -1), w(" Preparing chart… ", -1)])], 4))], 64))), 128))], 32));
4601
+ }, null, -1), T(" Preparing chart… ", -1)])], 4))], 64))), 128))], 32));
4585
4602
  }
4586
- }), xi = 80, Si = 600, Ci = /* @__PURE__ */ E({
4603
+ }), wi = 80, Ti = 600, Ei = /* @__PURE__ */ D({
4587
4604
  __name: "ChatScroller",
4588
4605
  setup(e, { expose: t }) {
4589
- let n = M(), r = M(), i = M(!0), a, o, s = 0;
4606
+ let n = B(), r = B(), i = B(!0), a, o, s = 0;
4590
4607
  function scrollToBottom() {
4591
4608
  let e = n.value;
4592
4609
  e && (e.scrollTop = e.scrollHeight);
4593
4610
  }
4594
4611
  function onScroll() {
4595
4612
  let e = n.value;
4596
- e && (i.value = e.scrollHeight - e.scrollTop - e.clientHeight <= xi);
4613
+ e && (i.value = e.scrollHeight - e.scrollTop - e.clientHeight <= wi);
4597
4614
  }
4598
4615
  function markUserGesture() {
4599
- s = Date.now() + Si;
4616
+ s = Date.now() + Ti;
4600
4617
  }
4601
4618
  function followPinned() {
4602
4619
  i.value && Date.now() > s && scrollToBottom();
@@ -4615,20 +4632,295 @@ var Wr = [
4615
4632
  }));
4616
4633
  }), te(() => {
4617
4634
  a?.disconnect(), o?.disconnect();
4618
- }), (e, t) => (j(), b("div", {
4635
+ }), (e, t) => (R(), x("div", {
4619
4636
  ref_key: "viewport",
4620
4637
  ref: n,
4621
- class: D(["overflow-y-auto overscroll-contain overflow-x-hidden min-h-0 flex flex-col [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden", i.value ? "[overflow-anchor:none]" : ""]),
4638
+ class: j(["overflow-y-auto overscroll-contain overflow-x-hidden min-h-0 flex flex-col [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden", i.value ? "[overflow-anchor:none]" : ""]),
4622
4639
  onScrollPassive: onScroll,
4623
4640
  onWheelPassive: markUserGesture,
4624
4641
  onTouchstartPassive: markUserGesture
4625
- }, [x("div", {
4642
+ }, [w("div", {
4626
4643
  ref_key: "content",
4627
4644
  ref: r,
4628
4645
  class: "flex-1 flex flex-col"
4629
4646
  }, [ce(e.$slots, "default")], 512)], 34));
4630
4647
  }
4631
- }), wi = {
4648
+ }), Di = ["aria-label"], Oi = { class: "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[28px] h-[28px] overflow-hidden" }, ki = /* @__PURE__ */ D({
4649
+ name: "FClose",
4650
+ __name: "FClose",
4651
+ props: { ariaLabel: {} },
4652
+ emits: ["click"],
4653
+ setup(e) {
4654
+ let t = B(!1);
4655
+ return ne(() => {
4656
+ setTimeout(() => {
4657
+ t.value = !0;
4658
+ }, 100);
4659
+ }), (n, r) => (R(), x("button", {
4660
+ type: "button",
4661
+ "aria-label": e.ariaLabel || "Close",
4662
+ class: "close block cursor-pointer w-[60px] h-[60px] rounded-full transition-all duration-1000 ease-[cubic-bezier(0.25,1,0.33,1)] hover:scale-110 active:scale-90 hover:rotate-90",
4663
+ onClick: r[0] || (r[0] = (e) => n.$emit("click", e))
4664
+ }, [r[1] || (r[1] = w("span", { class: "absolute inset-0 rounded-full transition-all" }, null, -1)), w("span", Oi, [w("span", {
4665
+ class: j(["absolute h-full w-[3px] rounded-[5px] left-[13px] transition-all duration-[400ms] ease-[cubic-bezier(0.52,0.01,0.16,1)]", t.value ? "translate-y-0 translate-x-0 rotate-45" : "translate-y-[30px] -translate-x-[30px] rotate-0"]),
4666
+ style: {
4667
+ "background-color": "currentColor",
4668
+ "transition-delay": "0.15s"
4669
+ }
4670
+ }, null, 2), w("span", {
4671
+ class: j(["absolute h-full w-[3px] rounded-[5px] left-[13px] transition-all duration-[400ms] ease-[cubic-bezier(0.52,0.01,0.16,1)]", t.value ? "translate-y-0 translate-x-0 -rotate-45" : "-translate-y-[30px] -translate-x-[30px] rotate-0"]),
4672
+ style: {
4673
+ "background-color": "currentColor",
4674
+ "transition-delay": "0.45s"
4675
+ }
4676
+ }, null, 2)])], 8, Di));
4677
+ }
4678
+ }), Ai = { class: "flex min-h-full items-center justify-center text-center p-4" }, ji = {
4679
+ key: 0,
4680
+ class: "text-base p-4 font-semibold"
4681
+ }, Mi = {
4682
+ key: 1,
4683
+ class: "flex items-center gap-2 px-2"
4684
+ }, Ni = /* @__PURE__ */ D({
4685
+ inheritAttrs: !1,
4686
+ name: "FModal",
4687
+ __name: "FModal",
4688
+ props: {
4689
+ vis: {
4690
+ type: Boolean,
4691
+ default: !1
4692
+ },
4693
+ modalClass: {},
4694
+ styleClass: {},
4695
+ fullScreen: {
4696
+ type: Boolean,
4697
+ default: !1
4698
+ },
4699
+ hasClose: {
4700
+ type: Boolean,
4701
+ default: !1
4702
+ },
4703
+ title: { default: "" },
4704
+ transitionMode: { default: "modal" },
4705
+ teleportTo: { default: "body" },
4706
+ disableTeleport: {
4707
+ type: Boolean,
4708
+ default: !1
4709
+ }
4710
+ },
4711
+ emits: [
4712
+ "update:vis",
4713
+ "close",
4714
+ "escape"
4715
+ ],
4716
+ setup(e, { emit: t }) {
4717
+ let n = t, r = B(!1);
4718
+ function close(e) {
4719
+ let { reason: t } = e;
4720
+ n("update:vis", !1), n("close", !0), t === "escape" && n("escape", !0);
4721
+ }
4722
+ let i = v(() => {
4723
+ let t = e.modalClass ? [e.modalClass] : ["max-w-screen-md p-24"], n = e.styleClass ? [e.styleClass] : ["bg-theme-0", "shadow-xl"];
4724
+ return e.fullScreen ? t.push("fixed inset-0") : t.push("rounded-2xl"), [
4725
+ "relative",
4726
+ "text-left",
4727
+ "transform",
4728
+ "transition-all",
4729
+ "w-full",
4730
+ "overflow-hidden",
4731
+ ...t,
4732
+ ...n
4733
+ ];
4734
+ }), a = B(!1), o = [];
4735
+ function onKeydown(t) {
4736
+ t.key === "Escape" && e.vis && close({ reason: "escape" });
4737
+ }
4738
+ ne(async () => {
4739
+ r.value = !0;
4740
+ let t = pe(() => e.vis, (e) => {
4741
+ e ? setTimeout(() => a.value = !0, 300) : a.value = !1;
4742
+ }, { immediate: !0 });
4743
+ o.push(t), typeof document < "u" && (document.addEventListener("keydown", onKeydown), o.push(() => document.removeEventListener("keydown", onKeydown)));
4744
+ }), ae(() => {
4745
+ o.forEach((e) => e());
4746
+ });
4747
+ let s = v(() => e.transitionMode === "slideUp" ? {
4748
+ enterActiveClass: "ease-[cubic-bezier(0.25,1,0.33,1)] duration-500",
4749
+ enterFromClass: "opacity-0 translate-y-full scale-95",
4750
+ enterToClass: "opacity-100 translate-y-0 scale-100",
4751
+ leaveActiveClass: "ease-[cubic-bezier(0.25,1,0.33,1)] duration-500",
4752
+ leaveFromClass: "opacity-100 translate-y-0 scale-100",
4753
+ leaveToClass: "opacity-0 translate-y-full scale-95"
4754
+ } : {
4755
+ enterActiveClass: "ease-[cubic-bezier(0.25,1,0.33,1)] duration-500",
4756
+ enterFromClass: "opacity-0 scale-75",
4757
+ enterToClass: "opacity-100 translate-y-0 scale-100",
4758
+ leaveActiveClass: "ease-[cubic-bezier(0.25,1,0.33,1)] duration-500",
4759
+ leaveFromClass: "opacity-100 translate-y-0 scale-100",
4760
+ leaveToClass: "opacity-0 scale-75"
4761
+ });
4762
+ return (t, n) => r.value ? (R(), y(g, {
4763
+ key: 0,
4764
+ to: e.teleportTo,
4765
+ disabled: e.disableTeleport
4766
+ }, [w("div", {
4767
+ class: j(["fixed inset-0 z-50", e.vis ? "" : "pointer-events-none"]),
4768
+ "aria-labelledby": "modal-title",
4769
+ role: "dialog",
4770
+ "aria-modal": "true"
4771
+ }, [E(_, {
4772
+ "enter-active-class": "ease-out duration-300",
4773
+ "enter-from-class": "opacity-0",
4774
+ "enter-to-class": "opacity-100",
4775
+ "leave-active-class": "ease-in duration-200",
4776
+ "leave-from-class": "opacity-100",
4777
+ "leave-to-class": "opacity-0"
4778
+ }, {
4779
+ default: me(() => [e.vis ? (R(), x("div", {
4780
+ key: 0,
4781
+ class: "fixed inset-0 bg-theme-800/60 active:bg-theme-800/80 cursor-pointer dark:bg-theme-600/90 backdrop-blur-sm transition-opacity",
4782
+ onClick: n[0] || (n[0] = (e) => close({ reason: "escape" }))
4783
+ })) : b("", !0)]),
4784
+ _: 1
4785
+ }), w("div", {
4786
+ class: "fixed inset-0 z-40 overflow-y-auto overscroll-contain no-scrollbar",
4787
+ onClick: n[3] || (n[3] = (e) => close({ reason: "escape" }))
4788
+ }, [w("div", Ai, [E(_, M(A(s.value)), {
4789
+ default: me(() => [e.vis ? (R(), x("div", {
4790
+ key: 0,
4791
+ class: j([i.value, "w-full"]),
4792
+ onClick: n[2] || (n[2] = K(() => {}, ["stop"]))
4793
+ }, [e.hasClose || e.title || t.$slots.actions ? (R(), x("div", {
4794
+ key: 0,
4795
+ class: j(!e.title && (e.hasClose || t.$slots.actions) ? "absolute top-0 right-0 z-10" : "flex justify-between items-center")
4796
+ }, [e.title ? (R(), x("h2", ji, G(e.title), 1)) : b("", !0), e.hasClose || t.$slots.actions ? (R(), x("div", Mi, [ce(t.$slots, "actions"), e.hasClose ? (R(), y(ki, {
4797
+ key: 0,
4798
+ class: "relative",
4799
+ "data-test-id": "close-modal",
4800
+ onClick: n[1] || (n[1] = K((e) => close({ reason: "escape" }), ["stop"]))
4801
+ })) : b("", !0)])) : b("", !0)], 2)) : b("", !0), ce(t.$slots, "default")], 2)) : b("", !0)]),
4802
+ _: 3
4803
+ }, 16)])])], 2)], 8, ["to", "disabled"])) : b("", !0);
4804
+ }
4805
+ }), Pi = {
4806
+ "data-test": "share-reply-dialog",
4807
+ class: "flex flex-col"
4808
+ }, Fi = { class: "flex h-[60px] shrink-0 items-center justify-between border-b border-theme-950/[0.06] px-5" }, Ii = { class: "flex flex-col gap-4 p-5" }, Li = { class: "relative max-h-[300px] overflow-hidden rounded-2xl bg-theme-25 p-4 ring-1 ring-theme-950/[0.06]" }, Ri = { class: "flex flex-col gap-3 text-[13px] leading-relaxed text-theme-800" }, zi = {
4809
+ key: 0,
4810
+ class: "max-w-[85%] self-end whitespace-pre-wrap rounded-[14px] bg-theme-50 px-3 py-2"
4811
+ }, Bi = {
4812
+ key: 0,
4813
+ class: "flex h-11 items-center gap-2 rounded-xl bg-theme-50 px-3"
4814
+ }, Vi = ["value"], Hi = {
4815
+ key: 1,
4816
+ class: "text-[13px] text-red-600"
4817
+ }, Ui = { class: "flex items-center gap-3" }, Wi = ["disabled"], Gi = ["disabled"], Ki = /* @__PURE__ */ D({
4818
+ __name: "ShareReplyDialog",
4819
+ props: {
4820
+ message: {},
4821
+ prompt: {},
4822
+ share: {}
4823
+ },
4824
+ emits: ["close"],
4825
+ setup(e, { emit: t }) {
4826
+ let n = t, r = B(), i = B(!1), a = B(!1), o = B(!1), s = B(), c;
4827
+ pe(() => e.message?.id, async (t) => {
4828
+ if (r.value = void 0, s.value = void 0, o.value = !1, t) {
4829
+ i.value = !0;
4830
+ try {
4831
+ r.value = (await e.share.get({ messageId: t }))?.url;
4832
+ } catch {
4833
+ s.value = "Could not load this reply's link.";
4834
+ } finally {
4835
+ i.value = !1;
4836
+ }
4837
+ }
4838
+ }, { immediate: !0 });
4839
+ async function copyLink() {
4840
+ if (e.message && !a.value) {
4841
+ a.value = !0, s.value = void 0;
4842
+ try {
4843
+ r.value ?? (r.value = (await e.share.create({ messageId: e.message.id })).url);
4844
+ } catch {
4845
+ s.value = "Could not create a link. Try again.", a.value = !1;
4846
+ return;
4847
+ }
4848
+ try {
4849
+ await navigator.clipboard.writeText(r.value), o.value = !0, clearTimeout(c), c = setTimeout(() => {
4850
+ o.value = !1;
4851
+ }, 1500);
4852
+ } catch {
4853
+ s.value = "Copy the link from the field above.";
4854
+ } finally {
4855
+ a.value = !1;
4856
+ }
4857
+ }
4858
+ }
4859
+ async function deleteLink() {
4860
+ if (e.message && !a.value) {
4861
+ a.value = !0, s.value = void 0;
4862
+ try {
4863
+ await e.share.remove({ messageId: e.message.id }), r.value = void 0, o.value = !1;
4864
+ } catch {
4865
+ s.value = "Could not delete the link. Try again.";
4866
+ } finally {
4867
+ a.value = !1;
4868
+ }
4869
+ }
4870
+ }
4871
+ return (t, c) => (R(), y(Ni, {
4872
+ vis: !!e.message,
4873
+ "modal-class": "w-full max-w-[480px] p-0",
4874
+ onClose: c[2] || (c[2] = (e) => n("close"))
4875
+ }, {
4876
+ default: me(() => [w("div", Pi, [w("div", Fi, [c[4] || (c[4] = w("span", { class: "text-[15px] font-semibold text-theme-900" }, "Share reply", -1)), w("button", {
4877
+ type: "button",
4878
+ "aria-label": "Close",
4879
+ class: "grid size-9 cursor-pointer place-items-center rounded-full text-theme-500 transition-colors hover:bg-theme-950/5 hover:text-theme-900",
4880
+ onClick: c[0] || (c[0] = (e) => n("close"))
4881
+ }, [...c[3] || (c[3] = [w("i", {
4882
+ class: "i-tabler-x size-[17px]",
4883
+ "aria-hidden": "true"
4884
+ }, null, -1)])])]), w("div", Ii, [
4885
+ w("div", Li, [w("div", Ri, [e.prompt ? (R(), x("div", zi, G(e.prompt), 1)) : b("", !0), e.message ? (R(), y(Ci, {
4886
+ key: 1,
4887
+ text: e.message.text
4888
+ }, null, 8, ["text"])) : b("", !0)]), c[5] || (c[5] = w("div", { class: "pointer-events-none absolute inset-x-0 bottom-0 h-16 bg-gradient-to-t from-theme-25 to-transparent" }, null, -1))]),
4889
+ c[8] || (c[8] = w("p", { class: "text-[13px] leading-relaxed text-theme-500" }, " Anyone with the link can see this message and reply. Messages after it stay private. ", -1)),
4890
+ r.value ? (R(), x("div", Bi, [c[6] || (c[6] = w("i", {
4891
+ class: "i-tabler-link size-[15px] shrink-0 text-theme-400",
4892
+ "aria-hidden": "true"
4893
+ }, null, -1)), w("input", {
4894
+ "data-test": "share-reply-url",
4895
+ value: r.value,
4896
+ readonly: "",
4897
+ "aria-label": "Share link",
4898
+ class: "min-w-0 flex-1 truncate bg-transparent text-[14px] text-theme-800 outline-none",
4899
+ onFocus: c[1] || (c[1] = (e) => e.target.select())
4900
+ }, null, 40, Vi)])) : b("", !0),
4901
+ s.value ? (R(), x("p", Hi, G(s.value), 1)) : b("", !0),
4902
+ w("div", Ui, [r.value ? (R(), x("button", {
4903
+ key: 0,
4904
+ type: "button",
4905
+ "data-test": "share-reply-delete",
4906
+ disabled: a.value,
4907
+ class: "flex h-11 cursor-pointer items-center gap-1.5 px-1 text-[14px] font-medium text-theme-500 transition-colors hover:text-red-600 disabled:opacity-50",
4908
+ onClick: deleteLink
4909
+ }, [...c[7] || (c[7] = [w("i", {
4910
+ class: "i-tabler-trash size-[15px]",
4911
+ "aria-hidden": "true"
4912
+ }, null, -1), T(" Delete link ", -1)])], 8, Wi)) : b("", !0), w("button", {
4913
+ type: "button",
4914
+ "data-test": "share-reply-copy",
4915
+ disabled: i.value || a.value,
4916
+ class: "ml-auto h-11 cursor-pointer rounded-full bg-theme-900 px-5 text-[15px] font-semibold text-theme-0 transition-transform active:scale-[0.98] disabled:opacity-50",
4917
+ onClick: copyLink
4918
+ }, G(o.value ? "Copied" : "Copy link"), 9, Gi)])
4919
+ ])])]),
4920
+ _: 1
4921
+ }, 8, ["vis"]));
4922
+ }
4923
+ }), qi = {
4632
4924
  VOICE_MIC_UNAVAILABLE: "I couldn't reach your microphone. Check that this site is allowed to use it, then try again.",
4633
4925
  VOICE_BOT_UNAVAILABLE: "Your assistant didn't pick up. Give it a moment and start the call again.",
4634
4926
  VOICE_CONNECT_TIMEOUT: "The call took too long to connect. Try again in a moment.",
@@ -4637,21 +4929,21 @@ var Wr = [
4637
4929
  VOICE_UNAVAILABLE: "Voice isn't available right now. You can keep going by typing.",
4638
4930
  VOICE_MINT_INVALID: "That call couldn't be started. Refresh the page and try again.",
4639
4931
  VOICE_PROVIDER_ERROR: "The call ended unexpectedly. Try again, or keep going by typing."
4640
- }, Ti = "The call ended unexpectedly. Try again, or keep going by typing.";
4932
+ }, Ji = "The call ended unexpectedly. Try again, or keep going by typing.";
4641
4933
  function voiceErrorMessage(e) {
4642
- return e && wi[e] || Ti;
4934
+ return e && qi[e] || Ji;
4643
4935
  }
4644
4936
  //#endregion
4645
4937
  //#region bot/ui/VoiceHistogramController.ts
4646
- var Ei = [
4938
+ var Yi = [
4647
4939
  0,
4648
4940
  2,
4649
4941
  4,
4650
4942
  6,
4651
4943
  8
4652
- ], Di = 5, Oi = 33, ki = .7, Ai = .1, ji = 60, Mi = 320, Ni = .55, Pi = .1, Fi = .32, Ii = .9, Li = Ei.map(() => 0), Ri = Ei.map(() => Di), VoiceHistogramController = class {
4944
+ ], Xi = 5, Zi = 33, Qi = .7, $i = .1, ea = 60, ta = 320, na = .55, ra = .1, ia = .32, aa = .9, oa = Yi.map(() => 0), sa = Yi.map(() => Xi), VoiceHistogramController = class {
4653
4945
  constructor(e = typeof window > "u" ? void 0 : window) {
4654
- t(this, "browser", void 0), t(this, "heights", R(Ri)), t(this, "targetBars", Li), t(this, "displayBars", Li), t(this, "level", {
4946
+ t(this, "browser", void 0), t(this, "heights", U(sa)), t(this, "targetBars", oa), t(this, "displayBars", oa), t(this, "level", {
4655
4947
  source: "mic",
4656
4948
  level: 0
4657
4949
  }), t(this, "isMuted", !1), t(this, "usesIdleWave", !1), t(this, "frameId", 0), t(this, "lastFrameAt", 0), t(this, "easeFrame", (e) => {
@@ -4660,12 +4952,12 @@ var Ei = [
4660
4952
  this.frameId = 0;
4661
4953
  let n = Math.min(64, Math.max(0, e - this.lastFrameAt));
4662
4954
  this.lastFrameAt = e;
4663
- let r = this.usesIdleWave ? Ei.map((t, n) => {
4664
- let r = e / 1e3 * Ni * 2 * Math.PI - n * Ii;
4665
- return Pi + Fi * (Math.sin(r) + 1) / 2;
4955
+ let r = this.usesIdleWave ? Yi.map((t, n) => {
4956
+ let r = e / 1e3 * na * 2 * Math.PI - n * aa;
4957
+ return ra + ia * (Math.sin(r) + 1) / 2;
4666
4958
  }) : this.targetBars;
4667
4959
  this.displayBars = this.displayBars.map((e, t) => {
4668
- let i = r[t] ?? 0, a = i > e ? ji : Mi;
4960
+ let i = r[t] ?? 0, a = i > e ? ea : ta;
4669
4961
  return e + (i - e) * (1 - Math.exp(-n / a));
4670
4962
  }), this.publish();
4671
4963
  let i = this.displayBars.every((e, t) => Math.abs((r[t] ?? 0) - e) <= 5e-4);
@@ -4685,20 +4977,20 @@ var Ei = [
4685
4977
  this.frameId && this.browser?.cancelAnimationFrame(this.frameId), this.frameId = 0;
4686
4978
  }
4687
4979
  updateTargets() {
4688
- let gate = (e) => Math.max(0, e - Ai) / .9, e = this.isMuted && this.level.source === "mic";
4689
- this.targetBars = Ei.map((t) => e ? 0 : gate(Math.min(1, Math.max(0, this.level.bands?.[t] ?? this.level.level)))), this.start();
4980
+ let gate = (e) => Math.max(0, e - $i) / .9, e = this.isMuted && this.level.source === "mic";
4981
+ this.targetBars = Yi.map((t) => e ? 0 : gate(Math.min(1, Math.max(0, this.level.bands?.[t] ?? this.level.level)))), this.start();
4690
4982
  }
4691
4983
  start() {
4692
4984
  if (!this.browser || this.browser.matchMedia("(prefers-reduced-motion: reduce)").matches) {
4693
- this.displayBars = this.usesIdleWave ? Li : this.targetBars, this.publish();
4985
+ this.displayBars = this.usesIdleWave ? oa : this.targetBars, this.publish();
4694
4986
  return;
4695
4987
  }
4696
4988
  this.frameId || (this.lastFrameAt = this.browser.performance.now(), this.frameId = this.browser.requestAnimationFrame(this.easeFrame));
4697
4989
  }
4698
4990
  publish() {
4699
- this.heights.value = this.displayBars.map((e) => Math.round((Di + Math.min(1, Math.max(0, e)) ** ki * Oi) * 10) / 10);
4991
+ this.heights.value = this.displayBars.map((e) => Math.round((Xi + Math.min(1, Math.max(0, e)) ** Qi * Zi) * 10) / 10);
4700
4992
  }
4701
- }, zi = {
4993
+ }, ca = {
4702
4994
  connecting: {
4703
4995
  label: "Connecting",
4704
4996
  tone: "bg-amber-500",
@@ -4736,7 +5028,7 @@ function deriveActivity(e) {
4736
5028
  return e.hadError ? "error" : e.sessionState === "live" ? e.speaking.bot ? "speaking" : e.speaking.user ? "listening" : e.work.active ? "working" : e.providerThinking ? "thinking" : "listening" : "connecting";
4737
5029
  }
4738
5030
  function deriveVoiceModePresentation(e) {
4739
- let t = deriveActivity(e), n = zi[t], r = t === "working" ? e.work.description || "Working on it" : n.label, i = t === "working" ? r : n.visibleText ?? "", a = e.takingLonger && (t === "thinking" || t === "working"), o = a ? `${i} ${G.slowHint}` : i;
5031
+ let t = deriveActivity(e), n = ca[t], r = t === "working" ? e.work.description || "Working on it" : n.label, i = t === "working" ? r : n.visibleText ?? "", a = e.takingLonger && (t === "thinking" || t === "working"), o = a ? `${i} ${xe.slowHint}` : i;
4740
5032
  return {
4741
5033
  activity: t,
4742
5034
  label: a ? o : r,
@@ -4748,32 +5040,32 @@ function deriveVoiceModePresentation(e) {
4748
5040
  }
4749
5041
  //#endregion
4750
5042
  //#region bot/ui/VoiceMode.vue?vue&type=script&setup=true&lang.ts
4751
- var Bi = ["data-voice-state", "data-voice-activity"], Vi = ["src"], Hi = {
5043
+ var la = ["data-voice-state", "data-voice-activity"], ua = ["src"], da = {
4752
5044
  key: 1,
4753
5045
  "data-test": "voice-background-fallback",
4754
5046
  "aria-hidden": "true",
4755
5047
  class: "pointer-events-none absolute inset-0 bg-[#0A1522]"
4756
- }, Ui = {
5048
+ }, fa = {
4757
5049
  "data-test": "voice-stage",
4758
5050
  class: "relative z-10 flex flex-1 flex-col items-center px-8"
4759
- }, Wi = { "data-voice-assistant-avatar": "" }, Gi = {
5051
+ }, pa = { "data-voice-assistant-avatar": "" }, ma = {
4760
5052
  "data-test": "voice-lower-stage",
4761
5053
  class: "flex flex-1 flex-col items-center pt-10"
4762
- }, Ki = {
5054
+ }, ha = {
4763
5055
  "data-test": "voice-histogram",
4764
5056
  "aria-hidden": "true",
4765
5057
  class: "flex h-[38px] items-center gap-[5px]"
4766
- }, qi = {
5058
+ }, ga = {
4767
5059
  "data-test": "voice-presence-status",
4768
5060
  role: "status",
4769
5061
  "aria-live": "polite",
4770
5062
  class: "sr-only"
4771
- }, Ji = ["data-taking-longer"], Yi = { class: "absolute inset-x-0 bottom-0 z-20 flex items-center justify-between px-14 pb-[max(3rem,env(safe-area-inset-bottom))] sm:px-12" }, Xi = [
5063
+ }, _a = ["data-taking-longer"], va = { class: "absolute inset-x-0 bottom-0 z-20 flex items-center justify-between px-14 pb-[max(3rem,env(safe-area-inset-bottom))] sm:px-12" }, ya = [
4772
5064
  "disabled",
4773
5065
  "aria-label",
4774
5066
  "aria-pressed",
4775
5067
  "title"
4776
- ], Zi = /* @__PURE__ */ E({
5068
+ ], ba = /* @__PURE__ */ D({
4777
5069
  __name: "VoiceMode",
4778
5070
  props: {
4779
5071
  bot: {},
@@ -4783,58 +5075,61 @@ var Bi = ["data-voice-state", "data-voice-activity"], Vi = ["src"], Hi = {
4783
5075
  },
4784
5076
  emits: ["end"],
4785
5077
  setup(e, { expose: t, emit: n }) {
4786
- let r = n, i = R(!1), a = R(!1), o = R({
5078
+ let r = n, i = U(!1), a = U(), o = U(!1), s = U({
4787
5079
  user: !1,
4788
5080
  bot: !1
4789
- }), s = R({ active: !1 }), c = R(!1), d = R(!1), f = R(), p = _(() => f.value?.state.value ?? "idle"), g = _(() => f.value?.isMuted.value ?? !1), v = new VoiceHistogramController(), y = v.heights, w = ue("endButton"), E = ue("muteButton"), ee = !1, te, M, ce = _(() => deriveVoiceModePresentation({
4790
- sessionState: p.value,
5081
+ }), c = U({ active: !1 }), d = U(!1), f = U(!1), p = U(), g = v(() => p.value?.state.value ?? "idle"), _ = v(() => p.value?.isMuted.value ?? !1), y = new VoiceHistogramController(), b = y.heights, T = ue("endButton"), D = ue("muteButton"), A = !1, ee, M, te, B = v(() => deriveVoiceModePresentation({
5082
+ sessionState: g.value,
4791
5083
  hadError: i.value,
4792
- providerThinking: a.value,
4793
- speaking: o.value,
4794
- work: s.value,
4795
- isMuted: g.value,
4796
- takingLonger: c.value
4797
- })), le = _(() => {
4798
- if (ce.value.activity === "thinking") return "thinking";
4799
- if (ce.value.activity === "working") return `working:${s.value.description ?? ""}`;
5084
+ providerThinking: o.value,
5085
+ speaking: s.value,
5086
+ work: c.value,
5087
+ isMuted: _.value,
5088
+ takingLonger: d.value
5089
+ })), ce = v(() => {
5090
+ if (B.value.activity === "thinking") return "thinking";
5091
+ if (B.value.activity === "working") return `working:${c.value.description ?? ""}`;
4800
5092
  });
4801
- pe(() => ce.value.usesIdleWave, (e) => v.setIdleWave(e), { immediate: !0 }), pe(g, (e) => v.setMuted(e), { immediate: !0 }), pe(le, (e) => {
4802
- M && clearTimeout(M), c.value = !1, e && (M = setTimeout(() => {
4803
- M = void 0, c.value = !0;
4804
- }, K), M.unref?.());
5093
+ pe(() => B.value.usesIdleWave, (e) => y.setIdleWave(e), { immediate: !0 }), pe(_, (e) => y.setMuted(e), { immediate: !0 }), pe(ce, (e) => {
5094
+ te && clearTimeout(te), d.value = !1, e && (te = setTimeout(() => {
5095
+ te = void 0, d.value = !0;
5096
+ }, Se), te.unref?.());
4805
5097
  }, { immediate: !0 });
4806
5098
  async function end() {
4807
- ee = !0, await f.value?.end();
5099
+ A = !0, await p.value?.end();
4808
5100
  }
4809
5101
  t({ end });
4810
5102
  function emitEnd() {
4811
- ee || (ee = !0, r("end"));
5103
+ A || (A = !0, r("end", ee));
4812
5104
  }
4813
5105
  function trapFocus(e) {
4814
- e.shiftKey && document.activeElement === w.value ? (e.preventDefault(), E.value?.focus()) : !e.shiftKey && document.activeElement === E.value && (e.preventDefault(), w.value?.focus());
5106
+ e.shiftKey && document.activeElement === T.value ? (e.preventDefault(), D.value?.focus()) : !e.shiftKey && document.activeElement === D.value && (e.preventDefault(), T.value?.focus());
4815
5107
  }
4816
5108
  async function toggleMute() {
4817
- let e = f.value;
4818
- e && !d.value && (d.value = !0, await e.toggleMuted(), d.value = !1);
5109
+ let e = p.value;
5110
+ e && !f.value && (f.value = !0, await e.toggleMuted(), f.value = !1);
4819
5111
  }
4820
5112
  return ne(async () => {
4821
- w.value?.focus({ preventScroll: !0 });
5113
+ T.value?.focus({ preventScroll: !0 });
4822
5114
  let t = e.chatController?.createVoiceClient({
4823
- onLevel: (e) => v.updateLevel(e),
5115
+ onLevel: (e) => y.updateLevel(e),
5116
+ onEnded: (e) => {
5117
+ ee = e;
5118
+ },
4824
5119
  onStateChange: (e) => {
4825
- e === "ended" && (i.value ? te = setTimeout(emitEnd, 1600) : emitEnd());
5120
+ e === "ended" && (i.value ? M = setTimeout(emitEnd, 1600) : emitEnd());
4826
5121
  },
4827
5122
  onThinkingChange: (e) => {
4828
- a.value = e;
5123
+ o.value = e;
4829
5124
  },
4830
5125
  onSpeakingChange: (e) => {
4831
- o.value = e;
5126
+ s.value = e;
4832
5127
  },
4833
5128
  onWorkChange: (e) => {
4834
- s.value = e;
5129
+ c.value = e;
4835
5130
  },
4836
5131
  onError: (t) => {
4837
- i.value = !0, e.chatController?.notify?.(voiceErrorMessage(t.code)), e.chatController?.logger?.warn("voice.session.failed", {
5132
+ i.value = !0, t.code !== "VOICE_CONNECTION_LOST" && (a.value = voiceErrorMessage(t.code)), e.chatController?.logger?.warn("voice.session.failed", {
4838
5133
  code: t.code,
4839
5134
  providerMessage: t.message
4840
5135
  });
@@ -4847,17 +5142,17 @@ var Bi = ["data-voice-state", "data-voice-activity"], Vi = ["src"], Hi = {
4847
5142
  emitEnd();
4848
5143
  return;
4849
5144
  }
4850
- f.value = t, await t.start();
5145
+ p.value = t, await t.start();
4851
5146
  }), ae(() => {
4852
- ee = !0, te && clearTimeout(te), M && clearTimeout(M), v.stop(), f.value?.end();
4853
- }), (t, n) => (j(), b("div", {
5147
+ A = !0, M && clearTimeout(M), te && clearTimeout(te), y.stop(), p.value?.end();
5148
+ }), (t, n) => (R(), x("div", {
4854
5149
  "data-test": "voice-mode",
4855
- "data-voice-state": p.value,
4856
- "data-voice-activity": ce.value.activity,
5150
+ "data-voice-state": g.value,
5151
+ "data-voice-activity": B.value.activity,
4857
5152
  class: "relative flex min-h-0 flex-1 flex-col overflow-hidden bg-[#0A1522] text-white",
4858
5153
  onKeydown: ge(trapFocus, ["tab"])
4859
5154
  }, [
4860
- e.backdropSrc ? (j(), b("img", {
5155
+ e.backdropSrc ? (R(), x("img", {
4861
5156
  key: 0,
4862
5157
  "data-test": "voice-background-image",
4863
5158
  src: e.backdropSrc,
@@ -4865,89 +5160,89 @@ var Bi = ["data-voice-state", "data-voice-activity"], Vi = ["src"], Hi = {
4865
5160
  "aria-hidden": "true",
4866
5161
  draggable: "false",
4867
5162
  class: "pointer-events-none absolute inset-0 size-full object-cover"
4868
- }, null, 8, Vi)) : (j(), b("div", Hi)),
4869
- n[2] || (n[2] = x("div", {
5163
+ }, null, 8, ua)) : (R(), x("div", da)),
5164
+ n[2] || (n[2] = w("div", {
4870
5165
  "data-test": "voice-background-overlay",
4871
5166
  "aria-hidden": "true",
4872
5167
  class: "pointer-events-none absolute inset-0 bg-gradient-to-b from-[#050F19]/82 via-[#050F19]/90 to-[#050F19]/99"
4873
5168
  }, null, -1)),
4874
- x("div", Ui, [
4875
- n[0] || (n[0] = x("div", {
5169
+ w("div", fa, [
5170
+ n[0] || (n[0] = w("div", {
4876
5171
  "data-test": "voice-stage-spacer",
4877
5172
  "aria-hidden": "true",
4878
5173
  class: "flex-1"
4879
5174
  }, null, -1)),
4880
- x("div", Wi, [T(Ge, {
5175
+ w("div", pa, [E(Ke, {
4881
5176
  bot: e.bot,
4882
5177
  "show-status": !1,
4883
5178
  "show-owner-mark": !1,
4884
5179
  "is-light": !1,
4885
5180
  class: "size-32"
4886
5181
  }, null, 8, ["bot"])]),
4887
- x("div", Gi, [
4888
- x("div", Ki, [(j(!0), b(m, null, N(V(y), (e, t) => (j(), b("span", {
5182
+ w("div", ma, [
5183
+ w("div", ha, [(R(!0), x(m, null, V(le(b), (e, t) => (R(), x("span", {
4889
5184
  key: t,
4890
5185
  "data-test": "voice-histogram-bar",
4891
- class: D(["w-[5px] rounded-full transition-colors duration-150", ce.value.tone]),
4892
- style: A({ height: `${e}px` })
5186
+ class: j(["w-[5px] rounded-full transition-colors duration-150", B.value.tone]),
5187
+ style: N({ height: `${e}px` })
4893
5188
  }, null, 6))), 128))]),
4894
- x("div", qi, B(ce.value.label), 1),
4895
- x("p", {
5189
+ w("div", ga, G(a.value ?? B.value.label), 1),
5190
+ w("p", {
4896
5191
  "data-test": "voice-visible-status",
4897
- "data-taking-longer": ce.value.takingLonger || void 0,
5192
+ "data-taking-longer": B.value.takingLonger || void 0,
4898
5193
  "aria-hidden": "true",
4899
5194
  class: "mt-5 min-h-5 text-center text-sm font-medium tracking-wide text-white/80"
4900
- }, B(ce.value.visibleStatus), 9, Ji)
5195
+ }, G(a.value ?? B.value.visibleStatus), 9, _a)
4901
5196
  ])
4902
5197
  ]),
4903
- x("div", Yi, [x("button", {
5198
+ w("div", va, [w("button", {
4904
5199
  ref_key: "endButton",
4905
- ref: w,
5200
+ ref: T,
4906
5201
  type: "button",
4907
5202
  "data-test": "voice-end-btn",
4908
5203
  class: "flex size-16 cursor-pointer items-center justify-center rounded-full bg-white/10 text-white ring-1 ring-white/20 transition-colors hover:bg-white/15 active:bg-white/25",
4909
5204
  "aria-label": "Hang up",
4910
5205
  title: "Hang up",
4911
5206
  onClick: emitEnd
4912
- }, [...n[1] || (n[1] = [x("i", {
5207
+ }, [...n[1] || (n[1] = [w("i", {
4913
5208
  class: "i-tabler-x size-[25px]",
4914
5209
  "aria-hidden": "true"
4915
- }, null, -1)])], 512), x("button", {
5210
+ }, null, -1)])], 512), w("button", {
4916
5211
  ref_key: "muteButton",
4917
- ref: E,
5212
+ ref: D,
4918
5213
  type: "button",
4919
5214
  "data-test": "voice-mute-btn",
4920
- class: D(["flex size-16 items-center justify-center rounded-full ring-1 transition-colors active:opacity-70", [g.value ? "bg-white text-[#050F19] ring-white" : "bg-white/10 text-white ring-white/20", p.value === "live" && !d.value ? "cursor-pointer" : "cursor-default opacity-50"]]),
4921
- disabled: p.value !== "live" || d.value,
4922
- "aria-label": g.value ? "Unmute microphone" : "Mute microphone",
4923
- "aria-pressed": g.value,
4924
- title: g.value ? "Unmute microphone" : "Mute microphone",
5215
+ class: j(["flex size-16 items-center justify-center rounded-full ring-1 transition-colors active:opacity-70", [_.value ? "bg-white text-[#050F19] ring-white" : "bg-white/10 text-white ring-white/20", g.value === "live" && !f.value ? "cursor-pointer" : "cursor-default opacity-50"]]),
5216
+ disabled: g.value !== "live" || f.value,
5217
+ "aria-label": _.value ? "Unmute microphone" : "Mute microphone",
5218
+ "aria-pressed": _.value,
5219
+ title: _.value ? "Unmute microphone" : "Mute microphone",
4925
5220
  onClick: toggleMute
4926
- }, [x("i", {
4927
- class: D([g.value ? "i-tabler-microphone-off" : "i-tabler-microphone", "size-[25px]"]),
5221
+ }, [w("i", {
5222
+ class: j([_.value ? "i-tabler-microphone-off" : "i-tabler-microphone", "size-[25px]"]),
4928
5223
  "aria-hidden": "true"
4929
- }, null, 2)], 10, Xi)])
4930
- ], 40, Bi));
5224
+ }, null, 2)], 10, ya)])
5225
+ ], 40, la));
4931
5226
  }
4932
- }), Qi = {
5227
+ }), xa = {
4933
5228
  key: 0,
4934
5229
  class: "pb-4"
4935
- }, $i = {
5230
+ }, Sa = {
4936
5231
  key: 1,
4937
5232
  "data-test": "messaging-sdk-header",
4938
5233
  class: "shrink-0 border-b border-theme-100 px-4 py-3"
4939
- }, ea = { class: "min-w-0 flex-1" }, ta = { class: "truncate text-base font-semibold leading-tight text-theme-900" }, na = { class: "mt-1 truncate text-sm leading-tight text-theme-500" }, ra = {
5234
+ }, Ca = { class: "min-w-0 flex-1" }, wa = { class: "truncate text-base font-semibold leading-tight text-theme-900" }, Ta = { class: "mt-1 truncate text-sm leading-tight text-theme-500" }, Ea = {
4940
5235
  key: 0,
4941
5236
  class: "shrink-0 rounded-full bg-theme-50 px-2.5 py-1 font-mono text-[11px] font-medium text-theme-500"
4942
- }, ia = ["aria-label"], aa = {
5237
+ }, Da = ["aria-label"], Oa = {
4943
5238
  key: 0,
4944
5239
  "data-test": "messaging-empty-state",
4945
5240
  class: "flex flex-col items-center justify-center px-4"
4946
- }, oa = ["title"], sa = {
5241
+ }, ka = ["title"], Aa = {
4947
5242
  key: 0,
4948
5243
  "data-test": "messaging-time-divider",
4949
5244
  class: "flex items-center gap-3 py-3 px-2"
4950
- }, ca = ["data-journal-outcome"], la = [
5245
+ }, ja = ["data-journal-outcome"], Ma = [
4951
5246
  "data-message-id",
4952
5247
  "data-message-sender",
4953
5248
  "data-conversation-id",
@@ -4958,13 +5253,15 @@ var Bi = ["data-voice-state", "data-voice-activity"], Vi = ["src"], Hi = {
4958
5253
  "data-issue-action-label",
4959
5254
  "data-issue-action-url",
4960
5255
  "data-streaming"
4961
- ], ua = { class: "flex items-center gap-3" }, da = ["href"], fa = [
5256
+ ], Na = { class: "flex items-center gap-3" }, Pa = ["href"], Fa = [
5257
+ "data-test",
4962
5258
  "data-message-id",
4963
5259
  "data-message-sender",
4964
5260
  "data-conversation-id",
4965
5261
  "data-message-sequence",
5262
+ "data-system-kind",
4966
5263
  "data-routine-run-id"
4967
- ], pa = [
5264
+ ], Ia = [
4968
5265
  "data-message-id",
4969
5266
  "data-message-sender",
4970
5267
  "data-conversation-id",
@@ -4973,7 +5270,7 @@ var Bi = ["data-voice-state", "data-voice-activity"], Vi = ["src"], Hi = {
4973
5270
  "data-issue-code",
4974
5271
  "data-issue-bucket",
4975
5272
  "data-streaming"
4976
- ], ma = [
5273
+ ], La = [
4977
5274
  "data-test",
4978
5275
  "data-message-id",
4979
5276
  "data-message-sender",
@@ -4983,63 +5280,63 @@ var Bi = ["data-voice-state", "data-voice-activity"], Vi = ["src"], Hi = {
4983
5280
  "data-streaming",
4984
5281
  "data-queued",
4985
5282
  "aria-label"
4986
- ], ha = ["data-routine-run-id"], ga = ["src", "alt"], _a = ["src"], va = ["href"], ya = {
5283
+ ], Ra = ["data-routine-run-id"], za = ["src", "alt"], Ba = ["src"], Va = ["href"], Ha = {
4987
5284
  key: 0,
4988
5285
  "data-test": "messaging-message-text-part"
4989
- }, ba = [
5286
+ }, Ua = [
4990
5287
  "src",
4991
5288
  "alt",
4992
5289
  "data-attachment-placement"
4993
- ], xa = ["src", "data-attachment-placement"], Sa = ["href", "data-attachment-placement"], Ca = ["data-actions-reveal"], wa = [
5290
+ ], Wa = ["src", "data-attachment-placement"], Ga = ["href", "data-attachment-placement"], Ka = ["data-actions-reveal"], qa = [
4994
5291
  "data-copied",
4995
5292
  "title",
4996
5293
  "aria-label",
4997
5294
  "onClick"
4998
- ], Ta = ["onClick"], Ea = ["data-journal-outcome"], Da = ["data-journal-outcome"], Oa = ["data-test", "data-working-description"], ka = {
5295
+ ], Ja = ["onClick"], Ya = ["onClick"], Xa = ["data-journal-outcome"], Za = ["data-journal-outcome"], Qa = ["data-test", "data-working-description"], $a = {
4999
5296
  key: 0,
5000
5297
  class: "truncate"
5001
- }, Aa = {
5298
+ }, eo = {
5002
5299
  key: 1,
5003
5300
  class: "sr-only"
5004
- }, ja = ["data-issue-code"], Ma = { class: "min-w-0 flex-1" }, Na = {
5301
+ }, to = ["data-issue-code"], no = { class: "min-w-0 flex-1" }, ro = {
5005
5302
  "data-test": "messaging-transient-issue-title",
5006
5303
  class: "font-medium"
5007
- }, Pa = { "data-test": "messaging-transient-issue-help" }, Fa = ["href"], Ia = ["inert", "aria-hidden"], La = ["data-seat-state"], Ra = ["src", "alt"], za = { class: "max-w-20 truncate" }, Ba = ["onClick"], Va = {
5304
+ }, io = { "data-test": "messaging-transient-issue-help" }, ao = ["href"], oo = ["inert", "aria-hidden"], so = ["data-seat-state"], co = ["src", "alt"], lo = { class: "max-w-20 truncate" }, uo = ["onClick"], fo = {
5008
5305
  key: 0,
5009
5306
  class: "shrink-0 flex items-center justify-center size-14"
5010
- }, Ha = ["data-composer-action"], Ua = ["placeholder", "disabled"], Wa = { class: "font-mono text-sm tabular-nums" }, Ga = { class: "mt-2.5 flex items-center" }, Ka = [
5307
+ }, po = ["data-composer-action"], mo = ["placeholder", "disabled"], ho = { class: "font-mono text-sm tabular-nums" }, go = { class: "mt-2.5 flex items-center" }, _o = [
5011
5308
  "disabled",
5012
5309
  "aria-label",
5013
5310
  "title"
5014
- ], qa = {
5311
+ ], vo = {
5015
5312
  key: 0,
5016
5313
  class: "i-svg-spinners-ring-resize size-5"
5017
- }, Ja = {
5314
+ }, yo = {
5018
5315
  key: 1,
5019
5316
  class: "i-tabler-plus size-5"
5020
- }, Ya = { class: "sr-only" }, Xa = { class: "flex items-center gap-2" }, Za = ["aria-label", "title"], Qa = { class: "sr-only" }, $a = [
5317
+ }, bo = { class: "sr-only" }, xo = { class: "flex items-center gap-2" }, So = ["aria-label", "title"], Co = { class: "sr-only" }, wo = [
5021
5318
  "disabled",
5022
5319
  "aria-label",
5023
5320
  "title"
5024
- ], eo = {
5321
+ ], To = {
5025
5322
  class: "flex h-4 items-center gap-[2px]",
5026
5323
  "aria-hidden": "true"
5027
- }, to = [
5324
+ }, Eo = [
5028
5325
  "data-composer-action",
5029
5326
  "disabled",
5030
5327
  "aria-label",
5031
5328
  "title"
5032
- ], no = {
5329
+ ], Do = {
5033
5330
  key: 0,
5034
5331
  class: "i-tabler-player-stop-filled size-3.5"
5035
- }, ro = {
5332
+ }, Oo = {
5036
5333
  key: 1,
5037
5334
  class: "i-tabler-arrow-up size-[17px]"
5038
- }, io = { class: "sr-only" }, ao = {
5335
+ }, ko = { class: "sr-only" }, Ao = {
5039
5336
  key: 2,
5040
5337
  "data-test": "messaging-ai-notice",
5041
5338
  class: "mx-auto max-w-[640px] @5xl/chat:max-w-[720px] pt-3 text-center text-[11.5px] leading-none text-theme-300"
5042
- }, oo = /*#__PURE__*/ ve(/* @__PURE__ */ E({
5339
+ }, jo = /*#__PURE__*/ _e(/* @__PURE__ */ D({
5043
5340
  __name: "ElBotChat",
5044
5341
  props: {
5045
5342
  chatController: {},
@@ -5076,37 +5373,37 @@ var Bi = ["data-voice-state", "data-voice-activity"], Vi = ["src"], Hi = {
5076
5373
  label: "Public",
5077
5374
  tooltip: "Anyone with the link can see this"
5078
5375
  }
5079
- }, n = _(() => {
5376
+ }, n = v(() => {
5080
5377
  let n = { ...t[e.scope] };
5081
5378
  return e.scope === "org" && e.scopeName && (n.label = e.scopeName, n.tooltip = `Visible to ${e.scopeName} members`), n;
5082
- }), i = M(), a = M(), o = M();
5379
+ }), i = B(), a = B(), o = B();
5083
5380
  function containsMarkdownLink(e) {
5084
5381
  return e ? /\[[^\]]+\]\([^)]+\)/.test(e) : !1;
5085
5382
  }
5086
5383
  function isSystemExplainerMessage(e) {
5087
- return e.sender === "system" && (!!e.issue || e.id === G.value);
5384
+ return e.sender === "system" && (!!e.issue || e.id === J.value);
5088
5385
  }
5089
5386
  function isGroupEnd(e, t) {
5090
5387
  let n = e[t], r = e[t + 1];
5091
5388
  return !r || r.sender !== n.sender;
5092
5389
  }
5093
- let c = _(() => e.chatController?.textState.value), d = _(() => c.value?.isConnected ?? !1), f = _(() => c.value?.isThinking ?? !1), p = _(() => c.value?.connectionStatus !== "connected" && !c.value?.error), E = _(() => e.chatController?.liveTurnBlocks?.value ?? []), te = _(() => {
5094
- for (let e = E.value.length - 1; e >= 0; e--) {
5095
- let t = E.value[e];
5390
+ let c = v(() => e.chatController?.textState.value), d = v(() => c.value?.isConnected ?? !1), f = v(() => c.value?.isThinking ?? !1), p = v(() => c.value?.connectionStatus !== "connected" && !c.value?.error), g = v(() => e.chatController?.liveTurnBlocks?.value ?? []), D = v(() => {
5391
+ for (let e = g.value.length - 1; e >= 0; e--) {
5392
+ let t = g.value[e];
5096
5393
  if (t?.kind === "text") return t.id;
5097
5394
  }
5098
- }), le = _(() => e.chatController?.liveStreamMessageId?.value), V = _(() => {
5395
+ }), A = v(() => e.chatController?.liveStreamMessageId?.value), M = v(() => {
5099
5396
  let t = e.chatController?.sharedMessages.value ?? [];
5100
- return E.value.length && le.value ? t.filter((e) => e.id !== le.value) : t;
5101
- }), ue = _(() => {
5397
+ return g.value.length && A.value ? t.filter((e) => e.id !== A.value) : t;
5398
+ }), te = v(() => {
5102
5399
  if (!e.chatController?.workJournal?.value) return c.value?.workingDescription?.trim() || void 0;
5103
- }), ve = _(() => e.chatController?.workJournal?.value), ye = _(() => {
5104
- if (!ve.value && !E.value.length) return;
5105
- let e = V.value, t = e[e.length - 1];
5400
+ }), H = v(() => e.chatController?.workJournal?.value), le = v(() => {
5401
+ if (!H.value && !g.value.length) return;
5402
+ let e = M.value, t = e[e.length - 1];
5106
5403
  if (t) return t.sender === "bot" || t.sender === "system" ? e.length >= 2 ? e[e.length - 2].id : void 0 : t.id;
5107
- }), H = _(() => {
5404
+ }), ue = v(() => {
5108
5405
  let t = {};
5109
- for (let n of V.value) {
5406
+ for (let n of M.value) {
5110
5407
  if (n.sender === "user" || !n.toolActivities?.length) continue;
5111
5408
  let r = e.chatController?.workJournalFor?.({
5112
5409
  activities: n.toolActivities,
@@ -5118,7 +5415,7 @@ var Bi = ["data-voice-state", "data-voice-activity"], Vi = ["src"], Hi = {
5118
5415
  return t;
5119
5416
  });
5120
5417
  function messageWorkJournal(e) {
5121
- return H.value[e.id];
5418
+ return ue.value[e.id];
5122
5419
  }
5123
5420
  function inlineOffset(e, t) {
5124
5421
  return e.placement?.kind !== "inline" || !Number.isFinite(e.placement.offset) ? null : Math.max(0, Math.min(t.length, Math.trunc(e.placement.offset)));
@@ -5166,79 +5463,84 @@ var Bi = ["data-voice-state", "data-voice-activity"], Vi = ["src"], Hi = {
5166
5463
  text: t.slice(i)
5167
5464
  }), r;
5168
5465
  }
5169
- let U = _(() => c.value?.transientIssue), G = _(() => {
5466
+ let _e = v(() => c.value?.transientIssue), J = v(() => {
5170
5467
  if (!f.value) return;
5171
- let e = V.value, t = e[e.length - 1];
5468
+ let e = M.value, t = e[e.length - 1];
5172
5469
  return t?.sender === "bot" || t?.sender === "system" ? t.id : void 0;
5173
- }), K = _(() => !f.value || ue.value || ve.value || E.value.length ? !1 : G.value === void 0), Se = _(() => !!ue.value || K.value), Ce = _(() => c.value?.sendBlockedReason), Ee = _(() => Ce.value === "bot_deleted"), De = _(() => p.value ? "Connecting..." : Ce.value === "bot_deleted" ? "This assistant was deleted" : "Send a message"), ke = _(() => s(e.bot.state.value)), Ae = _(() => {
5174
- if (J.value || !ke.value || ke.value === "awake") return;
5470
+ }), ve = v(() => !f.value || te.value || H.value || g.value.length ? !1 : J.value === void 0), ye = v(() => !!te.value || ve.value), xe = v(() => c.value?.sendBlockedReason), Se = v(() => xe.value === "bot_deleted"), Ce = v(() => p.value ? "Connecting..." : xe.value === "bot_deleted" ? "This assistant was deleted" : "Send a message"), Ee = v(() => s(e.bot.state.value)), De = v(() => {
5471
+ if (at.value || !Ee.value || Ee.value === "awake") return;
5175
5472
  let t = e.bot.displayName.value || e.bot.name.value || "Your assistant";
5176
- return ke.value === "changing" ? `${t} will be right back…` : ke.value === "stuck" ? `${t} needs attention.` : `${t} is ${r[ke.value].toLowerCase()}.`;
5177
- }), je = _(() => e.chatController?.composerState?.value ?? {
5473
+ return Ee.value === "changing" ? `${t} will be right back…` : Ee.value === "stuck" ? `${t} needs attention.` : `${t} is ${r[Ee.value].toLowerCase()}.`;
5474
+ }), ke = v(() => e.chatController?.composerState?.value ?? {
5178
5475
  text: "",
5179
5476
  pendingAttachments: [],
5180
5477
  isUploading: !1
5181
- }), Me = _({
5182
- get: () => je.value.text,
5478
+ }), Ae = v({
5479
+ get: () => ke.value.text,
5183
5480
  set: (t) => e.chatController?.setComposerText?.({ text: t })
5184
- }), Ne = _(() => je.value.pendingAttachments), Pe = _(() => je.value.isUploading), Fe = _(() => e.chatController?.voiceRecorder), Ie = _(() => Fe.value?.isBusy.value ?? !1), Le = _(() => e.chatController?.canAttachFile?.value ?? !1), ze = _(() => e.chatController?.canRecordAudio?.value ?? !1), Ve = _(() => e.chatController?.composerAction?.value ?? "idle"), He = _(() => Ve.value !== "idle"), Ue = _(() => e.chatController?.composerShowsSecondaryStop?.value ?? !1), We = _(() => e.chatController?.queuedMessageIds?.value);
5481
+ }), je = v(() => ke.value.pendingAttachments), Me = v(() => ke.value.isUploading), Ne = v(() => e.chatController?.voiceRecorder), Pe = v(() => Ne.value?.isBusy.value ?? !1), Fe = v(() => e.chatController?.canAttachFile?.value ?? !1), Ie = v(() => e.chatController?.canRecordAudio?.value ?? !1), Le = v(() => e.chatController?.composerAction?.value ?? "idle"), ze = v(() => Le.value !== "idle"), Be = v(() => e.chatController?.composerShowsSecondaryStop?.value ?? !1), He = v(() => e.chatController?.queuedMessageIds?.value);
5185
5482
  function isQueuedMessage(e) {
5186
- return We.value?.has(e) ?? !1;
5483
+ return He.value?.has(e) ?? !1;
5187
5484
  }
5188
- let Ke = M(), qe;
5485
+ let Ue = B(), We;
5189
5486
  function canCopyMessage(e) {
5190
- return e.sender === "bot" && e.id !== G.value && !!e.text?.trim();
5487
+ return e.sender === "bot" && e.id !== J.value && !!e.text?.trim();
5191
5488
  }
5192
- let Je = _(() => [...V.value].reverse().find(canCopyMessage)?.id);
5489
+ let Ge = v(() => [...M.value].reverse().find(canCopyMessage)?.id);
5193
5490
  async function copyMessage(t) {
5194
5491
  try {
5195
- await navigator.clipboard.writeText(t.text), Ke.value = t.id, clearTimeout(qe), qe = setTimeout(() => {
5196
- Ke.value = void 0;
5492
+ await navigator.clipboard.writeText(t.text), Ue.value = t.id, clearTimeout(We), We = setTimeout(() => {
5493
+ Ue.value = void 0;
5197
5494
  }, 1500);
5198
5495
  } catch (t) {
5199
5496
  console.warn("ElBotChat: copy to clipboard rejected", t), e.chatController?.notify?.("Could not copy that message.");
5200
5497
  }
5201
5498
  }
5202
- ae(() => clearTimeout(qe));
5203
- let Ye = _(() => e.chatController?.canReportMessages ?? !1), Xe = _(() => Ve.value === "stop" ? "Stop reply" : Ue.value ? "Send — answered after current work" : "Send message"), Ze = _(() => ze.value && !Ie.value && !!Fe.value?.canUseBrowserRecording), Qe = _(() => Fe.value?.isActive.value ?? !1), $e = _(() => Fe.value?.state.value.phase === "sending"), tt = _(() => Fe.value?.elapsedLabel.value ?? "0:00"), nt = _(() => {
5204
- let e = Fe.value?.state.value.phase;
5205
- return e === "preparing" || e === "sending" ? Fe.value?.statusText.value ?? "Starting microphone" : ft.value ? "Release to send" : "Click mic to send";
5206
- }), rt = _(() => Fe.value?.state.value.phase === "sending" ? "Sending voice message" : Qe.value ? ft.value ? "Release to send voice message" : "Stop and send voice message" : "Record voice message"), J = M(!1), it = M(), Y = M(), X = M(), at = 0, ot = _(() => e.chatController?.canStartVoice?.value ?? !1);
5207
- pe([() => e.bot.avatar.value?.src, ot], ([e, t]) => {
5208
- let n = ++at;
5209
- if (X.value = void 0, !t || !e || typeof Image > "u") return;
5499
+ ae(() => clearTimeout(We));
5500
+ let qe = v(() => e.chatController?.canReportMessages ?? !1), Je = v(() => e.chatController?.messageShare), Ye = B(), Xe = v(() => {
5501
+ let e = Ye.value;
5502
+ if (!e) return;
5503
+ let t = M.value, n = t.findIndex((t) => t.id === e.id);
5504
+ return t.slice(0, Math.max(n, 0)).reverse().find((e) => e.sender === "user")?.text;
5505
+ }), Ze = v(() => Le.value === "stop" ? "Stop reply" : Be.value ? "Send — answered after current work" : "Send message"), Qe = v(() => Ie.value && !Pe.value && !!Ne.value?.canUseBrowserRecording), $e = v(() => Ne.value?.isActive.value ?? !1), et = v(() => Ne.value?.state.value.phase === "sending"), nt = v(() => Ne.value?.elapsedLabel.value ?? "0:00"), rt = v(() => {
5506
+ let e = Ne.value?.state.value.phase;
5507
+ return e === "preparing" || e === "sending" ? Ne.value?.statusText.value ?? "Starting microphone" : mt.value ? "Release to send" : "Click mic to send";
5508
+ }), it = v(() => Ne.value?.state.value.phase === "sending" ? "Sending voice message" : $e.value ? mt.value ? "Release to send voice message" : "Stop and send voice message" : "Record voice message"), at = B(!1), ot = B(), X = B(), Z = B(), st = 0, ct = v(() => e.chatController?.canStartVoice?.value ?? !1);
5509
+ pe([() => e.bot.avatar.value?.src, ct], ([e, t]) => {
5510
+ let n = ++st;
5511
+ if (Z.value = void 0, !t || !e || typeof Image > "u") return;
5210
5512
  let r = new Image();
5211
5513
  r.onload = () => {
5212
- n === at && (X.value = e);
5514
+ n === st && (Z.value = e);
5213
5515
  }, r.src = e;
5214
5516
  }, { immediate: !0 });
5215
- let st = _(() => ot.value && !J.value && !Qe.value && Ve.value === "idle"), ct = _(() => !d.value), lt = _(() => ct.value ? `Voice available when ${e.bot.displayName.value || e.bot.name.value || "the assistant"} is awake` : "Start voice conversation");
5517
+ let lt = v(() => ct.value && !at.value && !$e.value && Le.value === "idle"), ut = v(() => !d.value), dt = v(() => ut.value ? `Voice available when ${e.bot.displayName.value || e.bot.name.value || "the assistant"} is awake` : "Start voice conversation");
5216
5518
  function startVoiceConversation() {
5217
- st.value && !ct.value && (Y.value = X.value, J.value = !0);
5519
+ lt.value && !ut.value && (X.value = Z.value, at.value = !0);
5218
5520
  }
5219
- async function endVoiceConversation() {
5220
- if (!J.value) return;
5221
- let t = it.value;
5222
- J.value = !1, Y.value = void 0, await ee(), await t?.end(), window.matchMedia("(pointer: coarse)").matches || a.value?.focus(), await e.chatController?.refreshMessages();
5521
+ async function endVoiceConversation(t) {
5522
+ if (!at.value) return;
5523
+ let n = ot.value;
5524
+ at.value = !1, X.value = void 0, await ee(), await n?.end(), window.matchMedia("(pointer: coarse)").matches || a.value?.focus(), await e.chatController?.refreshMessages(), t && e.chatController?.notify(voiceEndNotice(t, e.bot.displayName.value || e.bot.name.value || "Your assistant"), { systemKind: "voice_ended" });
5223
5525
  }
5224
- let Z = _(() => e.variant === "light"), ut = _(() => Z.value ? "bg-theme-200/70" : "bg-white/15"), dt = _(() => Z.value ? "text-theme-300" : "text-white/30");
5526
+ let Q = v(() => e.variant === "light"), ft = v(() => Q.value ? "bg-theme-200/70" : "bg-white/15"), pt = v(() => Q.value ? "text-theme-300" : "text-white/30");
5225
5527
  ne(async () => {
5226
5528
  e.chatController && !d.value && await e.chatController.startTextConversation();
5227
5529
  }), ae(() => {
5228
5530
  e.chatController?.voiceRecorder?.teardown();
5229
5531
  });
5230
5532
  async function sendMessage() {
5231
- e.chatController && Ve.value === "send" && (a.value && (a.value.style.height = "auto", window.matchMedia("(pointer: coarse)").matches ? (a.value.blur(), requestAnimationFrame(() => {
5533
+ e.chatController && Le.value === "send" && (a.value && (a.value.style.height = "auto", window.matchMedia("(pointer: coarse)").matches ? (a.value.blur(), requestAnimationFrame(() => {
5232
5534
  let e = document.activeElement;
5233
5535
  e && (e.tagName === "TEXTAREA" || e.tagName === "INPUT") && e.blur();
5234
5536
  })) : a.value.focus()), i.value?.pin(), await e.chatController.sendComposerMessage());
5235
5537
  }
5236
5538
  async function handleCardAction(t) {
5237
- e.chatController && !Ee.value && (i.value?.pin(), await e.chatController.sendChatMessage(t));
5539
+ e.chatController && !Se.value && (i.value?.pin(), await e.chatController.sendChatMessage(t));
5238
5540
  }
5239
5541
  async function handleComposerAction() {
5240
5542
  if (e.chatController) {
5241
- if (Ve.value === "send") {
5543
+ if (Le.value === "send") {
5242
5544
  await sendMessage();
5243
5545
  return;
5244
5546
  }
@@ -5249,44 +5551,44 @@ var Bi = ["data-voice-state", "data-voice-activity"], Vi = ["src"], Hi = {
5249
5551
  e.isComposing || e.key === "Enter" && !e.shiftKey && (e.preventDefault(), await sendMessage());
5250
5552
  }
5251
5553
  function focusComposer(e) {
5252
- Qe.value || Ee.value || e.target instanceof Element && e.target.closest("button, a, textarea") || a.value?.focus();
5554
+ $e.value || Se.value || e.target instanceof Element && e.target.closest("button, a, textarea") || a.value?.focus();
5253
5555
  }
5254
5556
  function adjustTextareaHeight() {
5255
5557
  a.value && (a.value.style.height = "auto", a.value.style.height = `${Math.min(a.value.scrollHeight, 150)}px`);
5256
5558
  }
5257
- pe(Me, () => ee(() => adjustTextareaHeight()));
5559
+ pe(Ae, () => ee(() => adjustTextareaHeight()));
5258
5560
  function triggerFileInput() {
5259
5561
  o.value?.click();
5260
5562
  }
5261
5563
  async function handleFileSelect(t) {
5262
5564
  let n = t.target, r = n.files?.[0];
5263
- r && e.chatController && !Ie.value && (await e.chatController.attachFile({ file: r }), n.value = "");
5565
+ r && e.chatController && !Pe.value && (await e.chatController.attachFile({ file: r }), n.value = "");
5264
5566
  }
5265
5567
  function removeAttachment(t) {
5266
5568
  e.chatController?.removeAttachment({ index: t });
5267
5569
  }
5268
5570
  function startRecording() {
5269
- Fe.value?.start();
5571
+ Ne.value?.start();
5270
5572
  }
5271
5573
  function finishRecording(e) {
5272
- Fe.value?.finish(e);
5574
+ Ne.value?.finish(e);
5273
5575
  }
5274
- let ft = R(!1), pt = !1;
5576
+ let mt = U(!1), ht = !1;
5275
5577
  function onRecordPointerDown(e) {
5276
- e.pointerType === "touch" && (pt = !0, ft.value = !0, e.currentTarget.setPointerCapture?.(e.pointerId), startRecording());
5578
+ e.pointerType === "touch" && (ht = !0, mt.value = !0, e.currentTarget.setPointerCapture?.(e.pointerId), startRecording());
5277
5579
  }
5278
5580
  function onRecordPointerUp(e) {
5279
- e.pointerType === "touch" && ft.value && (ft.value = !1, finishRecording({ cancelled: !1 }));
5581
+ e.pointerType === "touch" && mt.value && (mt.value = !1, finishRecording({ cancelled: !1 }));
5280
5582
  }
5281
5583
  function onRecordPointerCancel(e) {
5282
- e.pointerType === "touch" && ft.value && (ft.value = !1, pt = !1, finishRecording({ cancelled: !0 }));
5584
+ e.pointerType === "touch" && mt.value && (mt.value = !1, ht = !1, finishRecording({ cancelled: !0 }));
5283
5585
  }
5284
5586
  function toggleRecording() {
5285
- Qe.value ? finishRecording({ cancelled: !1 }) : startRecording();
5587
+ $e.value ? finishRecording({ cancelled: !1 }) : startRecording();
5286
5588
  }
5287
5589
  function onRecordClick() {
5288
- if (pt) {
5289
- pt = !1;
5590
+ if (ht) {
5591
+ ht = !1;
5290
5592
  return;
5291
5593
  }
5292
5594
  toggleRecording();
@@ -5318,24 +5620,24 @@ var Bi = ["data-voice-state", "data-voice-activity"], Vi = ["src"], Hi = {
5318
5620
  ...o ? {} : { year: "numeric" }
5319
5621
  })}, ${a}`;
5320
5622
  }
5321
- return (t, r) => (j(), b("div", {
5623
+ return (t, r) => (R(), x("div", {
5322
5624
  "data-test": "messaging-root",
5323
- class: D(["@container/chat relative flex h-full flex-col", V.value.length === 0 ? "min-h-0 [justify-content:safe_center] overflow-y-auto" : ""])
5625
+ class: j(["@container/chat relative flex h-full flex-col", M.value.length === 0 ? "min-h-0 [justify-content:safe_center] overflow-y-auto" : ""])
5324
5626
  }, [
5325
- e.showHeader && !Z.value ? (j(), b("div", Qi, [T(Be, {
5627
+ e.showHeader && !Q.value ? (R(), x("div", xa, [E(Ve, {
5326
5628
  bot: e.bot,
5327
5629
  "is-online": d.value
5328
- }, null, 8, ["bot", "is-online"])])) : e.showHeader ? (j(), b("div", $i, [x("div", { class: D(["flex items-center gap-3", e.centered ? "max-w-[640px] @5xl/chat:max-w-[720px] mx-auto" : ""]) }, [
5329
- T(Ge, {
5630
+ }, null, 8, ["bot", "is-online"])])) : e.showHeader ? (R(), x("div", Sa, [w("div", { class: j(["flex items-center gap-3", e.centered ? "max-w-[640px] @5xl/chat:max-w-[720px] mx-auto" : ""]) }, [
5631
+ E(Ke, {
5330
5632
  bot: e.bot,
5331
- "is-light": Z.value,
5633
+ "is-light": Q.value,
5332
5634
  class: "size-10"
5333
5635
  }, null, 8, ["bot", "is-light"]),
5334
- x("div", ea, [x("div", ta, B(e.bot.displayName.value), 1), x("div", na, B(e.bot.title.value || "Assistant"), 1)]),
5335
- e.headerMeta ? (j(), b("span", ra, B(e.headerMeta), 1)) : y("", !0)
5336
- ], 2)])) : y("", !0),
5337
- T(g, { name: "voice-call" }, {
5338
- default: me(() => [J.value ? (j(), b("div", {
5636
+ w("div", Ca, [w("div", wa, G(e.bot.displayName.value), 1), w("div", Ta, G(e.bot.title.value || "Assistant"), 1)]),
5637
+ e.headerMeta ? (R(), x("span", Ea, G(e.headerMeta), 1)) : b("", !0)
5638
+ ], 2)])) : b("", !0),
5639
+ E(_, { name: "voice-call" }, {
5640
+ default: me(() => [at.value ? (R(), x("div", {
5339
5641
  key: 0,
5340
5642
  "data-test": "voice-call-overlay",
5341
5643
  role: "dialog",
@@ -5343,12 +5645,12 @@ var Bi = ["data-voice-state", "data-voice-activity"], Vi = ["src"], Hi = {
5343
5645
  "aria-label": `Voice conversation with ${e.bot.displayName.value}`,
5344
5646
  class: "fixed inset-0 z-[100] flex items-stretch justify-stretch bg-[#050F19] sm:items-center sm:justify-center sm:bg-[#050F19]/45 sm:p-6",
5345
5647
  onKeydown: r[0] || (r[0] = ge((e) => endVoiceConversation(), ["esc"]))
5346
- }, [T(Zi, {
5648
+ }, [E(ba, {
5347
5649
  ref_key: "voiceMode",
5348
- ref: it,
5650
+ ref: ot,
5349
5651
  bot: e.bot,
5350
5652
  "chat-controller": e.chatController,
5351
- "backdrop-src": Y.value,
5653
+ "backdrop-src": X.value,
5352
5654
  "is-light": !1,
5353
5655
  class: "voice-call-card h-full w-full sm:max-h-[620px] sm:max-w-[420px] sm:flex-none sm:rounded-[32px] sm:shadow-[0_32px_80px_rgba(5,15,25,0.45)]",
5354
5656
  onEnd: endVoiceConversation
@@ -5356,51 +5658,51 @@ var Bi = ["data-voice-state", "data-voice-activity"], Vi = ["src"], Hi = {
5356
5658
  "bot",
5357
5659
  "chat-controller",
5358
5660
  "backdrop-src"
5359
- ])], 40, ia)) : y("", !0)]),
5661
+ ])], 40, Da)) : b("", !0)]),
5360
5662
  _: 1
5361
5663
  }),
5362
- p.value ? (j(), b("div", {
5664
+ p.value ? (R(), x("div", {
5363
5665
  key: 2,
5364
- class: D(["py-16 flex flex-col items-center justify-center gap-2 text-sm", Z.value ? "text-theme-400" : "text-theme-600"])
5365
- }, [T(xe, { class: "size-4" })], 2)) : e.setupHint ? (j(), b("div", {
5666
+ class: j(["py-16 flex flex-col items-center justify-center gap-2 text-sm", Q.value ? "text-theme-400" : "text-theme-600"])
5667
+ }, [E(Y, { class: "size-4" })], 2)) : e.setupHint ? (R(), x("div", {
5366
5668
  key: 3,
5367
- class: D(["flex items-center justify-center gap-1.5 py-2 text-[11px]", dt.value])
5368
- }, [r[14] || (r[14] = x("i", { class: "i-tabler-tool size-3" }, null, -1)), x("span", null, B(e.setupHint), 1)], 2)) : y("", !0),
5369
- T(Ci, {
5669
+ class: j(["flex items-center justify-center gap-1.5 py-2 text-[11px]", pt.value])
5670
+ }, [r[15] || (r[15] = w("i", { class: "i-tabler-tool size-3" }, null, -1)), w("span", null, G(e.setupHint), 1)], 2)) : b("", !0),
5671
+ E(Ei, {
5370
5672
  ref_key: "chatScroller",
5371
5673
  ref: i,
5372
- inert: J.value,
5373
- "aria-hidden": J.value ? "true" : void 0,
5374
- class: D(V.value.length === 0 ? "flex-none" : "flex-1")
5674
+ inert: at.value,
5675
+ "aria-hidden": at.value ? "true" : void 0,
5676
+ class: j(M.value.length === 0 ? "flex-none" : "flex-1")
5375
5677
  }, {
5376
- default: me(() => [x("div", { class: D([V.value.length === 0 ? "flex flex-col items-center justify-center px-3 py-4" : e.centered ? "pt-20 pb-5 px-3 @lg/chat:px-8 space-y-2" : "pt-4 pb-[120px] px-3 @lg/chat:px-8 space-y-2", e.centered ? V.value.length === 0 ? "max-w-[900px] mx-auto w-full" : "max-w-[640px] @5xl/chat:max-w-[720px] mx-auto w-full" : ""]) }, [
5377
- V.value.length === 0 && !p.value ? (j(), b("div", aa, [ce(t.$slots, "empty-heading", {
5678
+ default: me(() => [w("div", { class: j([M.value.length === 0 ? "flex flex-col items-center justify-center px-3 py-4" : e.centered ? "pt-20 pb-5 px-3 @lg/chat:px-8 space-y-2" : "pt-4 pb-[120px] px-3 @lg/chat:px-8 space-y-2", e.centered ? M.value.length === 0 ? "max-w-[900px] mx-auto w-full" : "max-w-[640px] @5xl/chat:max-w-[720px] mx-auto w-full" : ""]) }, [
5679
+ M.value.length === 0 && !p.value ? (R(), x("div", Oa, [ce(t.$slots, "empty-heading", {
5378
5680
  bot: e.bot,
5379
- isLight: Z.value
5380
- }, () => [T(Ge, {
5681
+ isLight: Q.value
5682
+ }, () => [E(Ke, {
5381
5683
  bot: e.bot,
5382
- "is-light": Z.value,
5684
+ "is-light": Q.value,
5383
5685
  class: "mb-4 size-20 @sm/chat:size-24"
5384
- }, null, 8, ["bot", "is-light"]), x("div", { class: D(["text-base @sm/chat:text-lg font-semibold", Z.value ? "text-theme-900" : "text-white"]) }, B(e.bot.displayName.value), 3)], !0), e.emptyStateMessage === "" ? y("", !0) : (j(), b(m, { key: 0 }, [x("p", { class: D(["mt-1 text-center text-xs @sm/chat:text-sm", dt.value]) }, B(e.emptyStateMessage || "Type your message to get started."), 3), x("div", {
5385
- class: D(["inline-flex items-center gap-1.5 mt-5 px-2.5 py-1 rounded-full text-[11px]", Z.value ? "bg-theme-50 border border-theme-100 text-theme-400" : "bg-white/10 border border-white/20 text-white/40"]),
5686
+ }, null, 8, ["bot", "is-light"]), w("div", { class: j(["text-base @sm/chat:text-lg font-semibold", Q.value ? "text-theme-900" : "text-white"]) }, G(e.bot.displayName.value), 3)], !0), e.emptyStateMessage === "" ? b("", !0) : (R(), x(m, { key: 0 }, [w("p", { class: j(["mt-1 text-center text-xs @sm/chat:text-sm", pt.value]) }, G(e.emptyStateMessage || "Type your message to get started."), 3), w("div", {
5687
+ class: j(["inline-flex items-center gap-1.5 mt-5 px-2.5 py-1 rounded-full text-[11px]", Q.value ? "bg-theme-50 border border-theme-100 text-theme-400" : "bg-white/10 border border-white/20 text-white/40"]),
5386
5688
  title: n.value.tooltip
5387
- }, [x("i", { class: D([n.value.icon, "size-3"]) }, null, 2), x("span", null, B(n.value.label), 1)], 10, oa)], 64))])) : y("", !0),
5388
- (j(!0), b(m, null, N(V.value, (t, n) => (j(), b(m, { key: t.id }, [
5389
- shouldShowTimeDivider(V.value, n) ? (j(), b("div", sa, [
5390
- x("div", { class: D(["flex-1 h-px", ut.value]) }, null, 2),
5391
- x("span", { class: D(["text-[10px] @sm/chat:text-[11px] font-medium shrink-0 tracking-widest uppercase", dt.value]) }, B(shouldShowTimeDivider(V.value, n)), 3),
5392
- x("div", { class: D(["flex-1 h-px", ut.value]) }, null, 2)
5393
- ])) : y("", !0),
5394
- messageWorkJournal(t) ? (j(), b("div", {
5689
+ }, [w("i", { class: j([n.value.icon, "size-3"]) }, null, 2), w("span", null, G(n.value.label), 1)], 10, ka)], 64))])) : b("", !0),
5690
+ (R(!0), x(m, null, V(M.value, (t, n) => (R(), x(m, { key: t.id }, [
5691
+ shouldShowTimeDivider(M.value, n) ? (R(), x("div", Aa, [
5692
+ w("div", { class: j(["flex-1 h-px", ft.value]) }, null, 2),
5693
+ w("span", { class: j(["text-[10px] @sm/chat:text-[11px] font-medium shrink-0 tracking-widest uppercase", pt.value]) }, G(shouldShowTimeDivider(M.value, n)), 3),
5694
+ w("div", { class: j(["flex-1 h-px", ft.value]) }, null, 2)
5695
+ ])) : b("", !0),
5696
+ messageWorkJournal(t) ? (R(), x("div", {
5395
5697
  key: 1,
5396
5698
  "data-test": "messaging-message-tool-activity",
5397
5699
  "data-journal-outcome": messageWorkJournal(t)?.outcome,
5398
5700
  class: "mb-4 w-full"
5399
- }, [T(et, {
5701
+ }, [E(tt, {
5400
5702
  model: messageWorkJournal(t),
5401
- "is-light": Z.value
5402
- }, null, 8, ["model", "is-light"])], 8, ca)) : y("", !0),
5403
- isSystemExplainerMessage(t) ? (j(), b("section", {
5703
+ "is-light": Q.value
5704
+ }, null, 8, ["model", "is-light"])], 8, ja)) : b("", !0),
5705
+ isSystemExplainerMessage(t) ? (R(), x("section", {
5404
5706
  key: 2,
5405
5707
  "data-test": "messaging-system-msg",
5406
5708
  "data-message-id": t.id,
@@ -5412,54 +5714,55 @@ var Bi = ["data-voice-state", "data-voice-activity"], Vi = ["src"], Hi = {
5412
5714
  "data-issue-bucket": t.issue?.bucket,
5413
5715
  "data-issue-action-label": t.issue?.actionLabel,
5414
5716
  "data-issue-action-url": t.issue?.actionUrl,
5415
- "data-streaming": t.id === G.value ? "true" : void 0,
5717
+ "data-streaming": t.id === J.value ? "true" : void 0,
5416
5718
  class: "mb-6 w-full"
5417
- }, [x("div", { class: D(["mb-1.5 text-center text-[10.5px] font-medium", dt.value]) }, "System message", 2), x("div", ua, [
5418
- x("span", {
5719
+ }, [w("div", { class: j(["mb-1.5 text-center text-[10.5px] font-medium", pt.value]) }, "System message", 2), w("div", Na, [
5720
+ w("span", {
5419
5721
  "data-test": "messaging-system-divider-line",
5420
5722
  "aria-hidden": "true",
5421
- class: D(["hidden h-px flex-1 opacity-60 @md/chat:block", ut.value])
5723
+ class: j(["hidden h-px flex-1 opacity-60 @md/chat:block", ft.value])
5422
5724
  }, null, 2),
5423
- x("div", { class: D(["w-[46ch] min-w-0 max-w-full rounded-2xl px-5 py-3.5 text-center text-[13px] ring-1 [&_.chat-msg-rich]:max-w-none [&_.chat-msg-rich]:text-[13px] [&_.chat-msg-rich]:italic [&_.chat-msg-rich]:leading-[1.6]", Z.value ? "text-theme-700 ring-theme-200/50" : "text-white/85 ring-white/10"]) }, [t.text ? (j(), v(bi, {
5725
+ w("div", { class: j(["w-[46ch] min-w-0 max-w-full rounded-2xl px-5 py-3.5 text-center text-[13px] ring-1 [&_.chat-msg-rich]:max-w-none [&_.chat-msg-rich]:text-[13px] [&_.chat-msg-rich]:italic [&_.chat-msg-rich]:leading-[1.6]", Q.value ? "text-theme-700 ring-theme-200/50" : "text-white/85 ring-white/10"]) }, [t.text ? (R(), y(Ci, {
5424
5726
  key: 0,
5425
5727
  text: t.text,
5426
- inverted: !Z.value,
5427
- streaming: t.id === G.value,
5428
- onClick: r[1] || (r[1] = _e(() => {}, ["stop"])),
5728
+ inverted: !Q.value,
5729
+ streaming: t.id === J.value,
5730
+ onClick: r[1] || (r[1] = K(() => {}, ["stop"])),
5429
5731
  onAction: handleCardAction
5430
5732
  }, null, 8, [
5431
5733
  "text",
5432
5734
  "inverted",
5433
5735
  "streaming"
5434
- ])) : t.issue?.help ? (j(), v(bi, {
5736
+ ])) : t.issue?.help ? (R(), y(Ci, {
5435
5737
  key: 1,
5436
5738
  text: t.issue.help,
5437
- inverted: !Z.value
5438
- }, null, 8, ["text", "inverted"])) : y("", !0), t.issue?.actionUrl && !containsMarkdownLink(t.text) ? (j(), b("a", {
5739
+ inverted: !Q.value
5740
+ }, null, 8, ["text", "inverted"])) : b("", !0), t.issue?.actionUrl && !containsMarkdownLink(t.text) ? (R(), x("a", {
5439
5741
  key: 2,
5440
5742
  href: t.issue.actionUrl,
5441
5743
  "data-test": "messaging-system-msg-action",
5442
- class: D(["mt-2 text-[12px] font-medium inline-flex items-center gap-1", Z.value ? "text-theme-900 hover:text-theme-700" : "text-white hover:text-white/80"]),
5443
- onClick: r[2] || (r[2] = _e(() => {}, ["stop"]))
5444
- }, [w(B(t.issue.actionLabel) + " ", 1), r[15] || (r[15] = x("i", { class: "i-tabler-arrow-right size-3" }, null, -1))], 10, da)) : y("", !0)], 2),
5445
- x("span", {
5744
+ class: j(["mt-2 text-[12px] font-medium inline-flex items-center gap-1", Q.value ? "text-theme-900 hover:text-theme-700" : "text-white hover:text-white/80"]),
5745
+ onClick: r[2] || (r[2] = K(() => {}, ["stop"]))
5746
+ }, [T(G(t.issue.actionLabel) + " ", 1), r[16] || (r[16] = w("i", { class: "i-tabler-arrow-right size-3" }, null, -1))], 10, Pa)) : b("", !0)], 2),
5747
+ w("span", {
5446
5748
  "data-test": "messaging-system-divider-line",
5447
5749
  "aria-hidden": "true",
5448
- class: D(["hidden h-px flex-1 opacity-60 @md/chat:block", ut.value])
5750
+ class: j(["hidden h-px flex-1 opacity-60 @md/chat:block", ft.value])
5449
5751
  }, null, 2)
5450
- ])], 8, la)) : t.sender === "system" && t.systemKind === "routine_completed" ? (j(), b("div", {
5752
+ ])], 8, Ma)) : t.sender === "system" && (t.systemKind === "routine_completed" || t.systemKind === "voice_ended") ? (R(), x("div", {
5451
5753
  key: 3,
5452
- "data-test": "messaging-routine-receipt",
5754
+ "data-test": t.systemKind === "routine_completed" ? "messaging-routine-receipt" : "messaging-voice-receipt",
5453
5755
  "data-message-id": t.id,
5454
5756
  "data-message-sender": t.sender,
5455
5757
  "data-conversation-id": t.conversationId,
5456
5758
  "data-message-sequence": t.sequence,
5759
+ "data-system-kind": t.systemKind,
5457
5760
  "data-routine-run-id": t.routine?.run.routineRunId,
5458
- class: D(["mb-6 flex items-center justify-center gap-2 text-[12px] leading-relaxed", Z.value ? "text-theme-400" : "text-white/50"])
5459
- }, [r[16] || (r[16] = x("i", {
5460
- class: "i-tabler-clock size-3.5 shrink-0",
5761
+ class: j(["mb-6 flex items-center justify-center gap-2 text-[12px] leading-relaxed", Q.value ? "text-theme-400" : "text-white/50"])
5762
+ }, [w("i", {
5763
+ class: j(["size-3.5 shrink-0", t.systemKind === "voice_ended" ? "i-tabler-phone-off" : "i-tabler-clock"]),
5461
5764
  "aria-hidden": "true"
5462
- }, null, -1)), x("span", null, B(t.text), 1)], 10, fa)) : t.sender === "system" ? (j(), b("div", {
5765
+ }, null, 2), w("span", null, G(t.text), 1)], 10, Fa)) : t.sender === "system" ? (R(), x("div", {
5463
5766
  key: 4,
5464
5767
  "data-test": "messaging-system-status-msg",
5465
5768
  "data-message-id": t.id,
@@ -5469,16 +5772,16 @@ var Bi = ["data-voice-state", "data-voice-activity"], Vi = ["src"], Hi = {
5469
5772
  "data-system-kind": t.systemKind,
5470
5773
  "data-issue-code": t.issue?.code,
5471
5774
  "data-issue-bucket": t.issue?.bucket,
5472
- "data-streaming": t.id === G.value ? "true" : void 0,
5473
- class: D(["mb-4 flex w-fit max-w-[85%] items-start gap-2 rounded-2xl px-3 py-2 text-[13px] leading-relaxed ring-1", Z.value ? "bg-theme-100 text-theme-600 ring-theme-200" : "bg-white/10 text-white/70 ring-white/10"])
5474
- }, [r[17] || (r[17] = x("i", {
5775
+ "data-streaming": t.id === J.value ? "true" : void 0,
5776
+ class: j(["mb-4 flex w-fit max-w-[85%] items-start gap-2 rounded-2xl px-3 py-2 text-[13px] leading-relaxed ring-1", Q.value ? "bg-theme-100 text-theme-600 ring-theme-200" : "bg-white/10 text-white/70 ring-white/10"])
5777
+ }, [r[17] || (r[17] = w("i", {
5475
5778
  class: "i-tabler-info-circle size-4 mt-0.5 shrink-0",
5476
5779
  "aria-hidden": "true"
5477
- }, null, -1)), T(bi, {
5780
+ }, null, -1)), E(Ci, {
5478
5781
  text: t.text,
5479
- inverted: !Z.value,
5480
- onClick: r[3] || (r[3] = _e(() => {}, ["stop"]))
5481
- }, null, 8, ["text", "inverted"])], 10, pa)) : (j(), b("div", {
5782
+ inverted: !Q.value,
5783
+ onClick: r[3] || (r[3] = K(() => {}, ["stop"]))
5784
+ }, null, 8, ["text", "inverted"])], 10, Ia)) : (R(), x("div", {
5482
5785
  key: 5,
5483
5786
  "data-test": t.sender === "bot" ? "messaging-assistant-msg" : t.sender === "user" ? "messaging-user-msg" : void 0,
5484
5787
  "data-message-id": t.id,
@@ -5486,199 +5789,214 @@ var Bi = ["data-voice-state", "data-voice-activity"], Vi = ["src"], Hi = {
5486
5789
  "data-conversation-id": t.conversationId,
5487
5790
  "data-message-sequence": t.sequence,
5488
5791
  "data-system-kind": t.systemKind,
5489
- "data-streaming": t.id === G.value ? "true" : void 0,
5792
+ "data-streaming": t.id === J.value ? "true" : void 0,
5490
5793
  "data-queued": isQueuedMessage(t.id) ? "true" : void 0,
5491
5794
  "aria-label": isQueuedMessage(t.id) ? "Sent — will be answered after the current work finishes" : void 0,
5492
- class: D(["group/msg flex gap-2 items-end", {
5795
+ class: j(["group/msg flex gap-2 items-end", {
5493
5796
  "justify-end": t.sender === "user",
5494
5797
  "justify-start": t.sender === "bot",
5495
- "mb-6": isGroupEnd(V.value, n),
5798
+ "mb-6": isGroupEnd(M.value, n),
5496
5799
  "opacity-70": isQueuedMessage(t.id)
5497
5800
  }])
5498
- }, [x("div", {
5801
+ }, [w("div", {
5499
5802
  "data-test": "messaging-message-body",
5500
- class: D(t.sender === "user" ? "min-w-0 ml-3 @sm/chat:ml-[2em]" : "w-full min-w-0 pr-3 @sm/chat:pr-[2em]")
5803
+ class: j(t.sender === "user" ? "min-w-0 ml-3 @sm/chat:ml-[2em]" : "w-full min-w-0 pr-3 @sm/chat:pr-[2em]")
5501
5804
  }, [
5502
- t.sender === "bot" && t.routine ? (j(), b("div", {
5805
+ t.sender === "bot" && t.routine ? (R(), x("div", {
5503
5806
  key: 0,
5504
5807
  "data-test": "messaging-routine-label",
5505
5808
  "data-routine-run-id": t.routine.run.routineRunId,
5506
- class: D(["mb-2 flex items-start gap-2 text-[12px] leading-relaxed", Z.value ? "text-theme-400" : "text-white/50"])
5507
- }, [r[18] || (r[18] = x("i", {
5809
+ class: j(["mb-2 flex items-start gap-2 text-[12px] leading-relaxed", Q.value ? "text-theme-400" : "text-white/50"])
5810
+ }, [r[18] || (r[18] = w("i", {
5508
5811
  class: "i-tabler-clock size-3.5 mt-0.5 shrink-0",
5509
5812
  "aria-hidden": "true"
5510
- }, null, -1)), x("span", null, "Ran " + B(t.routine.run.name || t.routine.run.sourceLabel || "a routine"), 1)], 10, ha)) : y("", !0),
5511
- blockAttachmentsForMessage(t).length ? (j(), b("div", {
5813
+ }, null, -1)), w("span", null, "Ran " + G(t.routine.run.name || t.routine.run.sourceLabel || "a routine"), 1)], 10, Ra)) : b("", !0),
5814
+ blockAttachmentsForMessage(t).length ? (R(), x("div", {
5512
5815
  key: 1,
5513
- class: D(["mb-1 space-y-1", t.sender === "user" ? "flex flex-col items-end" : ""])
5514
- }, [(j(!0), b(m, null, N(blockAttachmentsForMessage(t), ({ attachment: e, index: t }) => (j(), b(m, { key: attachmentKey(e, t) }, [e.type === "image" ? (j(), b("img", {
5816
+ class: j(["mb-1 space-y-1", t.sender === "user" ? "flex flex-col items-end" : ""])
5817
+ }, [(R(!0), x(m, null, V(blockAttachmentsForMessage(t), ({ attachment: e, index: t }) => (R(), x(m, { key: attachmentKey(e, t) }, [e.type === "image" ? (R(), x("img", {
5515
5818
  key: 0,
5516
5819
  src: e.src,
5517
5820
  alt: e.filename,
5518
5821
  "data-test": "messaging-attachment",
5519
5822
  "data-attachment-placement": "block",
5520
5823
  class: "rounded-xl object-cover max-h-48 max-w-[240px] @sm/chat:max-w-[320px]"
5521
- }, null, 8, ga)) : e.type === "audio" ? (j(), b("audio", {
5824
+ }, null, 8, za)) : e.type === "audio" ? (R(), x("audio", {
5522
5825
  key: 1,
5523
5826
  src: e.src,
5524
5827
  controls: "",
5525
5828
  "data-test": "messaging-attachment",
5526
5829
  "data-attachment-placement": "block",
5527
5830
  class: "max-w-full"
5528
- }, null, 8, _a)) : (j(), b("a", {
5831
+ }, null, 8, Ba)) : (R(), x("a", {
5529
5832
  key: 2,
5530
5833
  href: e.src,
5531
5834
  target: "_blank",
5532
5835
  rel: "noopener",
5533
5836
  "data-test": "messaging-attachment",
5534
5837
  "data-attachment-placement": "block",
5535
- class: D(["inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", Z.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
5536
- }, [r[19] || (r[19] = x("i", { class: "i-tabler-file size-3.5" }, null, -1)), w(" " + B(e.filename), 1)], 10, va))], 64))), 128))], 2)) : y("", !0),
5537
- messageRenderParts(t).length ? (j(), b("div", {
5838
+ class: j(["inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", Q.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
5839
+ }, [r[19] || (r[19] = w("i", { class: "i-tabler-file size-3.5" }, null, -1)), T(" " + G(e.filename), 1)], 10, Va))], 64))), 128))], 2)) : b("", !0),
5840
+ messageRenderParts(t).length ? (R(), x("div", {
5538
5841
  key: 2,
5539
5842
  "data-test": "messaging-message-content",
5540
- class: D(t.sender === "user" ? Z.value ? "rounded-[14px] px-4 py-2.5 bg-theme-50 text-theme-900" : "rounded-[14px] px-4 py-2.5 bg-white/10 text-white" : Z.value ? "text-theme-800" : "text-white/95")
5541
- }, [(j(!0), b(m, null, N(messageRenderParts(t), (e) => (j(), b(m, { key: e.key }, [e.kind === "text" && e.text ? (j(), b("div", ya, [T(bi, {
5843
+ class: j(t.sender === "user" ? Q.value ? "rounded-[14px] px-4 py-2.5 bg-theme-50 text-theme-900" : "rounded-[14px] px-4 py-2.5 bg-white/10 text-white" : Q.value ? "text-theme-800" : "text-white/95")
5844
+ }, [(R(!0), x(m, null, V(messageRenderParts(t), (e) => (R(), x(m, { key: e.key }, [e.kind === "text" && e.text ? (R(), x("div", Ha, [E(Ci, {
5542
5845
  text: e.text,
5543
- inverted: t.sender === "user" || !Z.value,
5544
- streaming: t.id === G.value,
5545
- onClick: r[4] || (r[4] = _e(() => {}, ["stop"])),
5846
+ inverted: t.sender === "user" || !Q.value,
5847
+ streaming: t.id === J.value,
5848
+ onClick: r[4] || (r[4] = K(() => {}, ["stop"])),
5546
5849
  onAction: handleCardAction
5547
5850
  }, null, 8, [
5548
5851
  "text",
5549
5852
  "inverted",
5550
5853
  "streaming"
5551
- ])])) : e.kind === "attachment" && e.attachment.type === "image" ? (j(), b("img", {
5854
+ ])])) : e.kind === "attachment" && e.attachment.type === "image" ? (R(), x("img", {
5552
5855
  key: 1,
5553
5856
  src: e.attachment.src,
5554
5857
  alt: e.attachment.filename,
5555
5858
  "data-test": "messaging-attachment",
5556
5859
  "data-attachment-placement": e.placement,
5557
5860
  class: "my-2 rounded-xl object-cover max-h-48 max-w-[240px] @sm/chat:max-w-[320px]"
5558
- }, null, 8, ba)) : e.kind === "attachment" && e.attachment.type === "audio" ? (j(), b("audio", {
5861
+ }, null, 8, Ua)) : e.kind === "attachment" && e.attachment.type === "audio" ? (R(), x("audio", {
5559
5862
  key: 2,
5560
5863
  src: e.attachment.src,
5561
5864
  controls: "",
5562
5865
  "data-test": "messaging-attachment",
5563
5866
  "data-attachment-placement": e.placement,
5564
5867
  class: "my-2 max-w-full"
5565
- }, null, 8, xa)) : e.kind === "attachment" ? (j(), b("a", {
5868
+ }, null, 8, Wa)) : e.kind === "attachment" ? (R(), x("a", {
5566
5869
  key: 3,
5567
5870
  href: e.attachment.src,
5568
5871
  target: "_blank",
5569
5872
  rel: "noopener",
5570
5873
  "data-test": "messaging-attachment",
5571
5874
  "data-attachment-placement": e.placement,
5572
- class: D(["my-2 inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", Z.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
5573
- }, [r[20] || (r[20] = x("i", { class: "i-tabler-file size-3.5" }, null, -1)), w(" " + B(e.attachment.filename), 1)], 10, Sa)) : y("", !0)], 64))), 128))], 2)) : y("", !0),
5574
- canCopyMessage(t) ? (j(), b("div", {
5875
+ class: j(["my-2 inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", Q.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
5876
+ }, [r[20] || (r[20] = w("i", { class: "i-tabler-file size-3.5" }, null, -1)), T(" " + G(e.attachment.filename), 1)], 10, Ga)) : b("", !0)], 64))), 128))], 2)) : b("", !0),
5877
+ canCopyMessage(t) ? (R(), x("div", {
5575
5878
  key: 3,
5576
5879
  "data-test": "messaging-message-actions",
5577
- "data-actions-reveal": t.id === Je.value ? "always" : "hover",
5578
- class: D(["-ml-1 flex items-center gap-1 pt-1 transition-opacity", [Z.value ? "text-theme-300" : "text-white/35", t.id === Je.value ? "" : "opacity-0 group-hover/msg:opacity-100 focus-within:opacity-100 pointer-coarse:opacity-100"]])
5579
- }, [x("button", {
5580
- type: "button",
5581
- "data-test": "messaging-message-copy",
5582
- "data-copied": Ke.value === t.id || void 0,
5583
- title: Ke.value === t.id ? "Copied" : "Copy",
5584
- "aria-label": Ke.value === t.id ? "Copied" : "Copy",
5585
- class: D(["grid size-6 cursor-pointer place-items-center transition-colors", Z.value ? "hover:text-theme-800" : "hover:text-white"]),
5586
- onClick: _e((e) => copyMessage(t), ["stop"])
5587
- }, [x("i", {
5588
- class: D(["size-3.5", Ke.value === t.id ? "i-tabler-check" : "i-tabler-copy"]),
5589
- "aria-hidden": "true"
5590
- }, null, 2)], 10, wa), Ye.value ? (j(), b("button", {
5591
- key: 0,
5592
- type: "button",
5593
- "data-test": "messaging-message-report",
5594
- title: "Report",
5595
- "aria-label": "Report",
5596
- class: D(["grid size-6 cursor-pointer place-items-center transition-colors", Z.value ? "hover:text-theme-800" : "hover:text-white"]),
5597
- onClick: _e((n) => e.chatController?.reportMessage(t.id), ["stop"])
5598
- }, [...r[21] || (r[21] = [x("i", {
5599
- class: "i-tabler-flag size-3.5",
5600
- "aria-hidden": "true"
5601
- }, null, -1)])], 10, Ta)) : y("", !0)], 10, Ca)) : y("", !0)
5602
- ], 2)], 10, ma)),
5603
- t.id === ye.value ? (j(), b(m, { key: 6 }, [E.value.length ? (j(!0), b(m, { key: 0 }, N(E.value, (e) => (j(), b(m, { key: e.id }, [e.kind === "work" ? (j(), b("div", {
5880
+ "data-actions-reveal": t.id === Ge.value ? "always" : "hover",
5881
+ class: j(["-ml-1 flex items-center gap-1 pt-1 transition-opacity", [Q.value ? "text-theme-300" : "text-white/35", t.id === Ge.value ? "" : "opacity-0 group-hover/msg:opacity-100 focus-within:opacity-100 pointer-coarse:opacity-100"]])
5882
+ }, [
5883
+ w("button", {
5884
+ type: "button",
5885
+ "data-test": "messaging-message-copy",
5886
+ "data-copied": Ue.value === t.id || void 0,
5887
+ title: Ue.value === t.id ? "Copied" : "Copy",
5888
+ "aria-label": Ue.value === t.id ? "Copied" : "Copy",
5889
+ class: j(["grid size-6 cursor-pointer place-items-center transition-colors", Q.value ? "hover:text-theme-800" : "hover:text-white"]),
5890
+ onClick: K((e) => copyMessage(t), ["stop"])
5891
+ }, [w("i", {
5892
+ class: j(["size-3.5", Ue.value === t.id ? "i-tabler-check" : "i-tabler-copy"]),
5893
+ "aria-hidden": "true"
5894
+ }, null, 2)], 10, qa),
5895
+ Je.value ? (R(), x("button", {
5896
+ key: 0,
5897
+ type: "button",
5898
+ "data-test": "messaging-message-share",
5899
+ title: "Share",
5900
+ "aria-label": "Share",
5901
+ class: j(["grid size-6 cursor-pointer place-items-center transition-colors", Q.value ? "hover:text-theme-800" : "hover:text-white"]),
5902
+ onClick: K((e) => Ye.value = t, ["stop"])
5903
+ }, [...r[21] || (r[21] = [w("i", {
5904
+ class: "i-tabler-share-2 size-3.5",
5905
+ "aria-hidden": "true"
5906
+ }, null, -1)])], 10, Ja)) : b("", !0),
5907
+ qe.value ? (R(), x("button", {
5908
+ key: 1,
5909
+ type: "button",
5910
+ "data-test": "messaging-message-report",
5911
+ title: "Report",
5912
+ "aria-label": "Report",
5913
+ class: j(["grid size-6 cursor-pointer place-items-center transition-colors", Q.value ? "hover:text-theme-800" : "hover:text-white"]),
5914
+ onClick: K((n) => e.chatController?.reportMessage(t.id), ["stop"])
5915
+ }, [...r[22] || (r[22] = [w("i", {
5916
+ class: "i-tabler-flag size-3.5",
5917
+ "aria-hidden": "true"
5918
+ }, null, -1)])], 10, Ya)) : b("", !0)
5919
+ ], 10, Ka)) : b("", !0)
5920
+ ], 2)], 10, La)),
5921
+ t.id === le.value ? (R(), x(m, { key: 6 }, [g.value.length ? (R(!0), x(m, { key: 0 }, V(g.value, (e) => (R(), x(m, { key: e.id }, [e.kind === "work" ? (R(), x("div", {
5604
5922
  key: 0,
5605
5923
  "data-test": "messaging-tool-activity",
5606
5924
  "data-journal-outcome": e.journal.outcome,
5607
5925
  class: "chat-live-enter mb-4 w-full"
5608
- }, [T(et, {
5926
+ }, [E(tt, {
5609
5927
  model: e.journal,
5610
- "is-light": Z.value
5611
- }, null, 8, ["model", "is-light"])], 8, Ea)) : e.kind === "text" && e.content ? (j(), b("div", {
5928
+ "is-light": Q.value
5929
+ }, null, 8, ["model", "is-light"])], 8, Xa)) : e.kind === "text" && e.content ? (R(), x("div", {
5612
5930
  key: 1,
5613
5931
  "data-test": "messaging-live-text-block",
5614
- class: D(["mb-4", Z.value ? "text-theme-800" : "text-white/95"])
5615
- }, [T(bi, {
5932
+ class: j(["mb-4", Q.value ? "text-theme-800" : "text-white/95"])
5933
+ }, [E(Ci, {
5616
5934
  text: e.content,
5617
- inverted: !Z.value,
5618
- streaming: e.id === te.value,
5619
- onClick: r[5] || (r[5] = _e(() => {}, ["stop"])),
5935
+ inverted: !Q.value,
5936
+ streaming: e.id === D.value,
5937
+ onClick: r[5] || (r[5] = K(() => {}, ["stop"])),
5620
5938
  onAction: handleCardAction
5621
5939
  }, null, 8, [
5622
5940
  "text",
5623
5941
  "inverted",
5624
5942
  "streaming"
5625
- ])], 2)) : (j(), b("div", {
5943
+ ])], 2)) : (R(), x("div", {
5626
5944
  key: 2,
5627
5945
  "data-test": "messaging-tool-activity-tail",
5628
5946
  "aria-label": "Assistant is still working",
5629
- class: D(["chat-live-enter mb-4 grid h-[17px] w-5 place-items-center", Z.value ? "text-theme-500" : "text-white/70"])
5630
- }, [...r[22] || (r[22] = [x("span", {
5947
+ class: j(["chat-live-enter mb-4 grid h-[17px] w-5 place-items-center", Q.value ? "text-theme-500" : "text-white/70"])
5948
+ }, [...r[23] || (r[23] = [w("span", {
5631
5949
  class: "chat-dots chat-dots--mini",
5632
5950
  "aria-hidden": "true"
5633
5951
  }, [
5634
- x("span"),
5635
- x("span"),
5636
- x("span")
5637
- ], -1)])], 2))], 64))), 128)) : ve.value ? (j(), b("div", {
5952
+ w("span"),
5953
+ w("span"),
5954
+ w("span")
5955
+ ], -1)])], 2))], 64))), 128)) : H.value ? (R(), x("div", {
5638
5956
  key: 1,
5639
5957
  "data-test": "messaging-tool-activity",
5640
- "data-journal-outcome": ve.value.outcome,
5958
+ "data-journal-outcome": H.value.outcome,
5641
5959
  class: "chat-live-enter mb-4 w-full"
5642
- }, [T(et, {
5643
- model: ve.value,
5644
- "is-light": Z.value
5645
- }, null, 8, ["model", "is-light"])], 8, Da)) : y("", !0)], 64)) : y("", !0)
5960
+ }, [E(tt, {
5961
+ model: H.value,
5962
+ "is-light": Q.value
5963
+ }, null, 8, ["model", "is-light"])], 8, Za)) : b("", !0)], 64)) : b("", !0)
5646
5964
  ], 64))), 128)),
5647
- Se.value ? (j(), b("div", {
5965
+ ye.value ? (R(), x("div", {
5648
5966
  key: 1,
5649
- "data-test": ue.value ? "messaging-working-state" : "messaging-thinking-indicator",
5650
- "data-working-description": ue.value,
5967
+ "data-test": te.value ? "messaging-working-state" : "messaging-thinking-indicator",
5968
+ "data-working-description": te.value,
5651
5969
  role: "status",
5652
5970
  "aria-live": "polite",
5653
- class: D(["chat-live-enter relative mb-4 flex h-[17px] items-center gap-2.5 pl-0.5 text-[13.5px] leading-snug", Z.value ? "text-theme-500" : "text-white/50"])
5654
- }, [r[23] || (r[23] = x("span", {
5971
+ class: j(["chat-live-enter relative mb-4 flex h-[17px] items-center gap-2.5 pl-0.5 text-[13.5px] leading-snug", Q.value ? "text-theme-500" : "text-white/50"])
5972
+ }, [r[24] || (r[24] = w("span", {
5655
5973
  "data-test": "messaging-thinking-dots",
5656
5974
  class: "chat-dots shrink-0",
5657
5975
  "aria-hidden": "true"
5658
5976
  }, [
5659
- x("span"),
5660
- x("span"),
5661
- x("span")
5662
- ], -1)), ue.value ? (j(), b("span", ka, B(ue.value), 1)) : (j(), b("span", Aa, "Thinking"))], 10, Oa)) : y("", !0),
5663
- U.value ? (j(), b("div", {
5977
+ w("span"),
5978
+ w("span"),
5979
+ w("span")
5980
+ ], -1)), te.value ? (R(), x("span", $a, G(te.value), 1)) : (R(), x("span", eo, "Thinking"))], 10, Qa)) : b("", !0),
5981
+ _e.value ? (R(), x("div", {
5664
5982
  key: 2,
5665
5983
  "data-test": "messaging-transient-issue",
5666
- "data-issue-code": U.value.code,
5984
+ "data-issue-code": _e.value.code,
5667
5985
  role: "alert",
5668
- class: D(["chat-live-enter mb-4 flex items-start gap-2 px-2 text-[13px] leading-snug", Z.value ? "text-theme-600" : "text-white/60"])
5986
+ class: j(["chat-live-enter mb-4 flex items-start gap-2 px-2 text-[13px] leading-snug", Q.value ? "text-theme-600" : "text-white/60"])
5669
5987
  }, [
5670
- r[25] || (r[25] = x("i", {
5988
+ r[26] || (r[26] = w("i", {
5671
5989
  class: "i-tabler-alert-circle size-3.5 shrink-0 text-red-500",
5672
5990
  "aria-hidden": "true"
5673
5991
  }, null, -1)),
5674
- x("span", Ma, [x("span", Na, [w(B(U.value.message), 1), U.value.help ? (j(), b(m, { key: 0 }, [w(":")], 64)) : y("", !0)]), U.value.help ? (j(), b(m, { key: 0 }, [r[24] || (r[24] = w(B(" "), -1)), x("span", Pa, B(U.value.help), 1)], 64)) : y("", !0)]),
5675
- U.value.actionUrl && U.value.actionLabel ? (j(), b("a", {
5992
+ w("span", no, [w("span", ro, [T(G(_e.value.message), 1), _e.value.help ? (R(), x(m, { key: 0 }, [T(":")], 64)) : b("", !0)]), _e.value.help ? (R(), x(m, { key: 0 }, [r[25] || (r[25] = T(G(" "), -1)), w("span", io, G(_e.value.help), 1)], 64)) : b("", !0)]),
5993
+ _e.value.actionUrl && _e.value.actionLabel ? (R(), x("a", {
5676
5994
  key: 0,
5677
- href: U.value.actionUrl,
5995
+ href: _e.value.actionUrl,
5678
5996
  class: "shrink-0 underline underline-offset-2",
5679
- onClick: r[6] || (r[6] = _e(() => {}, ["stop"]))
5680
- }, B(U.value.actionLabel), 9, Fa)) : y("", !0)
5681
- ], 10, ja)) : y("", !0)
5997
+ onClick: r[6] || (r[6] = K(() => {}, ["stop"]))
5998
+ }, G(_e.value.actionLabel), 9, ao)) : b("", !0)
5999
+ ], 10, to)) : b("", !0)
5682
6000
  ], 2)]),
5683
6001
  _: 3
5684
6002
  }, 8, [
@@ -5686,42 +6004,42 @@ var Bi = ["data-voice-state", "data-voice-activity"], Vi = ["src"], Hi = {
5686
6004
  "aria-hidden",
5687
6005
  "class"
5688
6006
  ]),
5689
- x("div", {
6007
+ w("div", {
5690
6008
  "data-test": "messaging-composer-footer",
5691
- inert: J.value,
5692
- "aria-hidden": J.value ? "true" : void 0,
5693
- class: D(["left-0 right-0 z-30 px-3 @lg/chat:px-8 pb-[max(env(safe-area-inset-bottom),1rem)]", [
5694
- V.value.length === 0 || e.centered ? "relative shrink-0" : "absolute bottom-0",
5695
- e.centered && V.value.length > 0 ? "pt-0 sm:pb-7" : "pt-3",
5696
- Z.value ? e.centered ? "bg-transparent" : "bg-theme-0" : "bg-gradient-to-t from-black/90 via-black/60 to-transparent"
6009
+ inert: at.value,
6010
+ "aria-hidden": at.value ? "true" : void 0,
6011
+ class: j(["left-0 right-0 z-30 px-3 @lg/chat:px-8 pb-[max(env(safe-area-inset-bottom),1rem)]", [
6012
+ M.value.length === 0 || e.centered ? "relative shrink-0" : "absolute bottom-0",
6013
+ e.centered && M.value.length > 0 ? "pt-0 sm:pb-7" : "pt-3",
6014
+ Q.value ? e.centered ? "bg-transparent" : "bg-theme-0" : "bg-gradient-to-t from-black/90 via-black/60 to-transparent"
5697
6015
  ]])
5698
- }, [ce(t.$slots, "composer", {}, () => [Ae.value ? (j(), b("div", {
6016
+ }, [ce(t.$slots, "composer", {}, () => [De.value ? (R(), x("div", {
5699
6017
  key: 0,
5700
6018
  "data-test": "messaging-seat",
5701
- "data-seat-state": ke.value,
6019
+ "data-seat-state": Ee.value,
5702
6020
  role: "status",
5703
6021
  "aria-live": "polite",
5704
- class: D(["py-3 text-center text-[14px]", Z.value ? "text-theme-500" : "text-white/70"])
5705
- }, B(Ae.value), 11, La)) : (j(), b(m, { key: 1 }, [
5706
- Ne.value.length > 0 ? (j(), b("div", {
6022
+ class: j(["py-3 text-center text-[14px]", Q.value ? "text-theme-500" : "text-white/70"])
6023
+ }, G(De.value), 11, so)) : (R(), x(m, { key: 1 }, [
6024
+ je.value.length > 0 ? (R(), x("div", {
5707
6025
  key: 0,
5708
- class: D(["flex items-center gap-2 px-2 pb-2 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden", e.centered ? "max-w-[640px] @5xl/chat:max-w-[720px] mx-auto" : ""])
5709
- }, [(j(!0), b(m, null, N(Ne.value, (e, t) => (j(), b("div", {
6026
+ class: j(["flex items-center gap-2 px-2 pb-2 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden", e.centered ? "max-w-[640px] @5xl/chat:max-w-[720px] mx-auto" : ""])
6027
+ }, [(R(!0), x(m, null, V(je.value, (e, t) => (R(), x("div", {
5710
6028
  key: t,
5711
6029
  class: "relative shrink-0 group"
5712
- }, [e.type === "image" ? (j(), b("img", {
6030
+ }, [e.type === "image" ? (R(), x("img", {
5713
6031
  key: 0,
5714
6032
  src: e.src,
5715
6033
  alt: e.filename,
5716
- class: D(["size-14 rounded-xl object-cover border", Z.value ? "border-black/10" : "border-white/20"])
5717
- }, null, 10, Ra)) : (j(), b("div", {
6034
+ class: j(["size-14 rounded-xl object-cover border", Q.value ? "border-black/10" : "border-white/20"])
6035
+ }, null, 10, co)) : (R(), x("div", {
5718
6036
  key: 1,
5719
- class: D(["h-14 px-3 rounded-xl flex items-center gap-1.5 text-xs border", Z.value ? "border-black/10 bg-theme-50 text-theme-600" : "border-white/20 bg-white/10 text-white/70"])
5720
- }, [r[26] || (r[26] = x("i", { class: "i-tabler-file size-4" }, null, -1)), x("span", za, B(e.filename), 1)], 2)), x("button", {
6037
+ class: j(["h-14 px-3 rounded-xl flex items-center gap-1.5 text-xs border", Q.value ? "border-black/10 bg-theme-50 text-theme-600" : "border-white/20 bg-white/10 text-white/70"])
6038
+ }, [r[27] || (r[27] = w("i", { class: "i-tabler-file size-4" }, null, -1)), w("span", lo, G(e.filename), 1)], 2)), w("button", {
5721
6039
  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 duration-200 ease-[cubic-bezier(0.25,1,0.33,1)] cursor-pointer",
5722
6040
  onClick: (e) => removeAttachment(t)
5723
- }, [...r[27] || (r[27] = [x("i", { class: "i-tabler-x size-3" }, null, -1)])], 8, Ba)]))), 128)), Pe.value ? (j(), b("div", Va, [T(xe, { class: "size-5" })])) : y("", !0)], 2)) : y("", !0),
5724
- Le.value ? (j(), b("input", {
6041
+ }, [...r[28] || (r[28] = [w("i", { class: "i-tabler-x size-3" }, null, -1)])], 8, uo)]))), 128)), Me.value ? (R(), x("div", fo, [E(Y, { class: "size-5" })])) : b("", !0)], 2)) : b("", !0),
6042
+ Fe.value ? (R(), x("input", {
5725
6043
  key: 1,
5726
6044
  ref_key: "fileInput",
5727
6045
  ref: o,
@@ -5729,25 +6047,25 @@ var Bi = ["data-voice-state", "data-voice-activity"], Vi = ["src"], Hi = {
5729
6047
  accept: "image/*,audio/*,video/*",
5730
6048
  class: "hidden",
5731
6049
  onChange: handleFileSelect
5732
- }, null, 544)) : y("", !0),
5733
- x("div", {
6050
+ }, null, 544)) : b("", !0),
6051
+ w("div", {
5734
6052
  "data-test": "messaging-composer",
5735
- "data-composer-action": Ve.value,
5736
- class: D(["w-full cursor-text rounded-2xl px-4 pb-2.5 pt-4 transition-colors duration-200", [e.centered ? "mx-auto max-w-[640px] @5xl/chat:max-w-[740px] @5xl/chat:px-5 @5xl/chat:pt-3.5 @5xl/chat:pb-3" : "", Z.value ? "bg-white shadow-[0_1px_2px_rgba(15,23,42,0.04),0_12px_32px_rgba(15,23,42,0.07)] ring-1 ring-theme-950/20 hover:ring-theme-950/30 focus-within:ring-theme-950/30" : "bg-white/10 backdrop-blur-xl ring-1 ring-white/15 hover:ring-white/25 focus-within:bg-white/15 focus-within:ring-white/25"]]),
6053
+ "data-composer-action": Le.value,
6054
+ class: j(["w-full cursor-text rounded-2xl px-4 pb-2.5 pt-4 transition-colors duration-200", [e.centered ? "mx-auto max-w-[640px] @5xl/chat:max-w-[740px] @5xl/chat:px-5 @5xl/chat:pt-3.5 @5xl/chat:pb-3" : "", Q.value ? "bg-white shadow-[0_1px_2px_rgba(15,23,42,0.04),0_12px_32px_rgba(15,23,42,0.07)] ring-1 ring-theme-950/20 hover:ring-theme-950/30 focus-within:ring-theme-950/30" : "bg-white/10 backdrop-blur-xl ring-1 ring-white/15 hover:ring-white/25 focus-within:bg-white/15 focus-within:ring-white/25"]]),
5737
6055
  onClick: focusComposer
5738
- }, [Qe.value ? (j(), b("div", {
6056
+ }, [$e.value ? (R(), x("div", {
5739
6057
  key: 1,
5740
6058
  "data-test": "messaging-recording-state",
5741
- class: D(["flex min-w-0 items-center gap-2 py-1", Z.value ? "text-theme-700" : "text-white/80"])
6059
+ class: j(["flex min-w-0 items-center gap-2 py-1", Q.value ? "text-theme-700" : "text-white/80"])
5742
6060
  }, [
5743
- r[28] || (r[28] = x("span", { class: "size-2.5 shrink-0 rounded-full bg-red-500" }, null, -1)),
5744
- x("span", Wa, B(tt.value), 1),
5745
- x("span", { class: D(["min-w-0 truncate text-sm", Z.value ? "text-theme-400" : "text-white/45"]) }, B(nt.value), 3)
5746
- ], 2)) : he((j(), b("textarea", {
6061
+ r[29] || (r[29] = w("span", { class: "size-2.5 shrink-0 rounded-full bg-red-500" }, null, -1)),
6062
+ w("span", ho, G(nt.value), 1),
6063
+ w("span", { class: j(["min-w-0 truncate text-sm", Q.value ? "text-theme-400" : "text-white/45"]) }, G(rt.value), 3)
6064
+ ], 2)) : he((R(), x("textarea", {
5747
6065
  key: 0,
5748
6066
  ref_key: "textarea",
5749
6067
  ref: a,
5750
- "onUpdate:modelValue": r[7] || (r[7] = (e) => Me.value = e),
6068
+ "onUpdate:modelValue": r[7] || (r[7] = (e) => Ae.value = e),
5751
6069
  "data-test": "messaging-input",
5752
6070
  rows: "1",
5753
6071
  enterkeyhint: "send",
@@ -5756,104 +6074,115 @@ var Bi = ["data-voice-state", "data-voice-activity"], Vi = ["src"], Hi = {
5756
6074
  autocapitalize: "sentences",
5757
6075
  autocorrect: "on",
5758
6076
  spellcheck: "true",
5759
- placeholder: De.value,
5760
- disabled: Ee.value,
6077
+ placeholder: Ce.value,
6078
+ disabled: Se.value,
5761
6079
  style: {
5762
6080
  fontSize: "16px",
5763
6081
  resize: "none"
5764
6082
  },
5765
- class: D(["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", Z.value ? "text-theme-900 placeholder-theme-400" : "text-white placeholder-white/50"]),
6083
+ class: j(["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", Q.value ? "text-theme-900 placeholder-theme-400" : "text-white placeholder-white/50"]),
5766
6084
  onKeydown: handleKeydown
5767
- }, null, 42, Ua)), [[fe, Me.value]]), x("div", Ga, [
5768
- x("button", {
5769
- class: D(["-ml-2 flex size-8 items-center justify-center transition-opacity hover:opacity-70 pointer-coarse:size-11", [
5770
- Le.value ? "cursor-pointer" : "cursor-default",
5771
- Z.value ? "text-theme-500" : "text-white/50",
5772
- Pe.value || Ie.value ? "opacity-50 pointer-events-none" : ""
6085
+ }, null, 42, mo)), [[fe, Ae.value]]), w("div", go, [
6086
+ w("button", {
6087
+ class: j(["-ml-2 flex size-8 items-center justify-center transition-opacity hover:opacity-70 pointer-coarse:size-11", [
6088
+ Fe.value ? "cursor-pointer" : "cursor-default",
6089
+ Q.value ? "text-theme-500" : "text-white/50",
6090
+ Me.value || Pe.value ? "opacity-50 pointer-events-none" : ""
5773
6091
  ]]),
5774
- disabled: Ee.value || Pe.value || Ie.value || !Le.value,
5775
- "aria-label": Le.value ? "Attach file" : "File attachments unavailable",
5776
- title: Le.value ? "Attach file" : "File attachments unavailable",
5777
- onClick: r[8] || (r[8] = (e) => Le.value && triggerFileInput())
5778
- }, [Pe.value ? (j(), b("i", qa)) : (j(), b("i", Ja)), x("span", Ya, B(Le.value ? "Attach file" : "File attachments unavailable"), 1)], 10, Ka),
5779
- r[32] || (r[32] = x("div", { class: "flex-1" }, null, -1)),
5780
- x("div", Xa, [
5781
- Qe.value && !$e.value && !J.value ? (j(), b("button", {
6092
+ disabled: Se.value || Me.value || Pe.value || !Fe.value,
6093
+ "aria-label": Fe.value ? "Attach file" : "File attachments unavailable",
6094
+ title: Fe.value ? "Attach file" : "File attachments unavailable",
6095
+ onClick: r[8] || (r[8] = (e) => Fe.value && triggerFileInput())
6096
+ }, [Me.value ? (R(), x("i", vo)) : (R(), x("i", yo)), w("span", bo, G(Fe.value ? "Attach file" : "File attachments unavailable"), 1)], 10, _o),
6097
+ r[33] || (r[33] = w("div", { class: "flex-1" }, null, -1)),
6098
+ w("div", xo, [
6099
+ $e.value && !et.value && !at.value ? (R(), x("button", {
5782
6100
  key: 0,
5783
6101
  "data-test": "messaging-record-discard-btn",
5784
- class: D(["flex size-8 cursor-pointer items-center justify-center transition-opacity hover:opacity-70 pointer-coarse:size-11", Z.value ? "text-theme-400" : "text-white/40"]),
6102
+ class: j(["flex size-8 cursor-pointer items-center justify-center transition-opacity hover:opacity-70 pointer-coarse:size-11", Q.value ? "text-theme-400" : "text-white/40"]),
5785
6103
  "aria-label": "Discard recording",
5786
6104
  title: "Discard recording",
5787
6105
  onClick: r[9] || (r[9] = (e) => finishRecording({ cancelled: !0 }))
5788
- }, [...r[29] || (r[29] = [x("i", {
6106
+ }, [...r[30] || (r[30] = [w("i", {
5789
6107
  class: "i-tabler-x size-[18px]",
5790
6108
  "aria-hidden": "true"
5791
- }, null, -1)])], 2)) : y("", !0),
5792
- (Ze.value || Qe.value) && !$e.value && !J.value ? (j(), b("button", {
6109
+ }, null, -1)])], 2)) : b("", !0),
6110
+ (Qe.value || $e.value) && !et.value && !at.value ? (R(), x("button", {
5793
6111
  key: 1,
5794
6112
  "data-test": "messaging-record-audio-btn",
5795
- class: D(["flex size-8 cursor-pointer items-center justify-center transition-[opacity,transform] duration-200 ease-[cubic-bezier(0.25,1,0.33,1)] hover:opacity-70 pointer-coarse:size-11", Qe.value ? Z.value ? "text-theme-900 scale-110" : "text-white scale-110" : Z.value ? "text-theme-500" : "text-white/60"]),
5796
- "aria-label": rt.value,
5797
- title: rt.value,
5798
- onPointerdown: _e(onRecordPointerDown, ["prevent"]),
5799
- onPointerup: _e(onRecordPointerUp, ["prevent"]),
5800
- onPointercancel: _e(onRecordPointerCancel, ["prevent"]),
6113
+ class: j(["flex size-8 cursor-pointer items-center justify-center transition-[opacity,transform] duration-200 ease-[cubic-bezier(0.25,1,0.33,1)] hover:opacity-70 pointer-coarse:size-11", $e.value ? Q.value ? "text-theme-900 scale-110" : "text-white scale-110" : Q.value ? "text-theme-500" : "text-white/60"]),
6114
+ "aria-label": it.value,
6115
+ title: it.value,
6116
+ onPointerdown: K(onRecordPointerDown, ["prevent"]),
6117
+ onPointerup: K(onRecordPointerUp, ["prevent"]),
6118
+ onPointercancel: K(onRecordPointerCancel, ["prevent"]),
5801
6119
  onClick: onRecordClick,
5802
- onKeydown: r[10] || (r[10] = ge(_e((e) => finishRecording({ cancelled: !0 }), ["prevent"]), ["escape"]))
5803
- }, [x("i", { class: D([Qe.value ? "i-tabler-microphone-filled" : "i-tabler-microphone", "size-[18px]"]) }, null, 2), x("span", Qa, B(rt.value), 1)], 42, Za)) : y("", !0),
5804
- st.value ? (j(), b("button", {
6120
+ onKeydown: r[10] || (r[10] = ge(K((e) => finishRecording({ cancelled: !0 }), ["prevent"]), ["escape"]))
6121
+ }, [w("i", { class: j([$e.value ? "i-tabler-microphone-filled" : "i-tabler-microphone", "size-[18px]"]) }, null, 2), w("span", Co, G(it.value), 1)], 42, So)) : b("", !0),
6122
+ lt.value ? (R(), x("button", {
5805
6123
  key: 2,
5806
6124
  "data-test": "messaging-voice-start-btn",
5807
- class: D(["flex size-8 items-center justify-center rounded-full transition-colors duration-150 pointer-coarse:size-11", [Z.value ? "bg-theme-900 text-theme-0 hover:bg-theme-800" : "bg-theme-0 text-theme-950 hover:bg-theme-100", ct.value ? "cursor-not-allowed opacity-40" : "cursor-pointer"]]),
5808
- disabled: ct.value,
5809
- "aria-label": lt.value,
5810
- title: lt.value,
6125
+ class: j(["flex size-8 items-center justify-center rounded-full transition-colors duration-150 pointer-coarse:size-11", [Q.value ? "bg-theme-900 text-theme-0 hover:bg-theme-800" : "bg-theme-0 text-theme-950 hover:bg-theme-100", ut.value ? "cursor-not-allowed opacity-40" : "cursor-pointer"]]),
6126
+ disabled: ut.value,
6127
+ "aria-label": dt.value,
6128
+ title: dt.value,
5811
6129
  onClick: r[11] || (r[11] = (e) => startVoiceConversation())
5812
- }, [x("span", eo, [(j(), b(m, null, N([
6130
+ }, [w("span", To, [(R(), x(m, null, V([
5813
6131
  7,
5814
6132
  13,
5815
6133
  16,
5816
6134
  11,
5817
6135
  14
5818
- ], (e) => x("span", {
6136
+ ], (e) => w("span", {
5819
6137
  key: e,
5820
6138
  class: "w-[2px] rounded-full bg-current",
5821
- style: A({ height: `${e}px` })
5822
- }, null, 4)), 64))]), r[30] || (r[30] = x("span", { class: "sr-only" }, "Start voice conversation", -1))], 10, $a)) : Qe.value ? y("", !0) : (j(), b(m, { key: 3 }, [Ue.value ? (j(), b("button", {
6139
+ style: N({ height: `${e}px` })
6140
+ }, null, 4)), 64))]), r[31] || (r[31] = w("span", { class: "sr-only" }, "Start voice conversation", -1))], 10, wo)) : $e.value ? b("", !0) : (R(), x(m, { key: 3 }, [Be.value ? (R(), x("button", {
5823
6141
  key: 0,
5824
6142
  "data-test": "messaging-secondary-stop-btn",
5825
- class: D(["mr-2 flex size-8 cursor-pointer items-center justify-center rounded-full transition-colors duration-150 pointer-coarse:size-11", Z.value ? "bg-theme-100 text-theme-700 hover:bg-theme-200" : "bg-white/10 text-white/70 hover:bg-white/15"]),
6143
+ class: j(["mr-2 flex size-8 cursor-pointer items-center justify-center rounded-full transition-colors duration-150 pointer-coarse:size-11", Q.value ? "bg-theme-100 text-theme-700 hover:bg-theme-200" : "bg-white/10 text-white/70 hover:bg-white/15"]),
5826
6144
  "aria-label": "Stop work",
5827
6145
  title: "Stop work",
5828
6146
  onClick: r[12] || (r[12] = (t) => e.chatController?.stopChatTurn())
5829
- }, [...r[31] || (r[31] = [x("i", {
6147
+ }, [...r[32] || (r[32] = [w("i", {
5830
6148
  class: "i-tabler-player-stop-filled size-3.5",
5831
6149
  "aria-hidden": "true"
5832
- }, null, -1), x("span", { class: "sr-only" }, "Stop work", -1)])], 2)) : y("", !0), x("button", {
6150
+ }, null, -1), w("span", { class: "sr-only" }, "Stop work", -1)])], 2)) : b("", !0), w("button", {
5833
6151
  "data-test": "messaging-send-btn",
5834
- "data-composer-action": Ve.value,
5835
- class: D(["flex size-8 items-center justify-center rounded-full transition-colors duration-150 pointer-coarse:size-11", He.value ? Z.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" : Z.value ? "bg-theme-100 text-theme-400" : "bg-white/10 text-white/30"]),
5836
- disabled: !He.value,
5837
- "aria-label": Xe.value,
5838
- title: Xe.value,
6152
+ "data-composer-action": Le.value,
6153
+ class: j(["flex size-8 items-center justify-center rounded-full transition-colors duration-150 pointer-coarse:size-11", ze.value ? Q.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" : Q.value ? "bg-theme-100 text-theme-400" : "bg-white/10 text-white/30"]),
6154
+ disabled: !ze.value,
6155
+ "aria-label": Ze.value,
6156
+ title: Ze.value,
5839
6157
  onClick: r[13] || (r[13] = (e) => handleComposerAction())
5840
- }, [Ve.value === "stop" ? (j(), b("i", no)) : (j(), b("i", ro)), x("span", io, B(Xe.value), 1)], 10, to)], 64))
6158
+ }, [Le.value === "stop" ? (R(), x("i", Do)) : (R(), x("i", Oo)), w("span", ko, G(Ze.value), 1)], 10, Eo)], 64))
5841
6159
  ])
5842
- ])], 10, Ha),
5843
- e.centered && V.value.length > 0 ? (j(), b("p", ao, B(e.bot.displayName.value) + " is AI and can make mistakes. ", 1)) : y("", !0)
5844
- ], 64))], !0)], 10, Ia)
6160
+ ])], 10, po),
6161
+ e.centered && M.value.length > 0 ? (R(), x("p", Ao, G(e.bot.displayName.value) + " is AI and can make mistakes. ", 1)) : b("", !0)
6162
+ ], 64))], !0)], 10, oo),
6163
+ Je.value ? (R(), y(Ki, {
6164
+ key: 4,
6165
+ message: Ye.value,
6166
+ prompt: Xe.value,
6167
+ share: Je.value,
6168
+ onClose: r[14] || (r[14] = (e) => Ye.value = void 0)
6169
+ }, null, 8, [
6170
+ "message",
6171
+ "prompt",
6172
+ "share"
6173
+ ])) : b("", !0)
5845
6174
  ], 2));
5846
6175
  }
5847
- }), [["__scopeId", "data-v-6717f6d3"]]), so = { class: "bot-wrap" }, co = {
6176
+ }), [["__scopeId", "data-v-89d3bf69"]]), Mo = { class: "bot-wrap" }, No = {
5848
6177
  key: 0,
5849
6178
  class: "flex items-center justify-center h-full"
5850
- }, lo = {
6179
+ }, Po = {
5851
6180
  key: 2,
5852
6181
  class: "flex h-full flex-col items-center justify-center gap-4 px-6 text-center",
5853
6182
  role: "status",
5854
6183
  "aria-live": "polite",
5855
6184
  "data-test": "bot-unavailable"
5856
- }, uo = /* @__PURE__ */ E({
6185
+ }, Fo = /* @__PURE__ */ D({
5857
6186
  __name: "BotWrap",
5858
6187
  props: {
5859
6188
  sdk: {},
@@ -5873,7 +6202,7 @@ var Bi = ["data-voice-state", "data-voice-activity"], Vi = ["src"], Hi = {
5873
6202
  let t = o("BotWrap"), r = e, i = r.sdk || n.getInstance({
5874
6203
  isDev: typeof window < "u" ? window.location.hostname === "localhost" || window.location.hostname.includes("127.0.0.1") : !1,
5875
6204
  ...r.apiBase && { apiBase: r.apiBase }
5876
- }), a = R(!r.bot), s = R(r.bot), c = R();
6205
+ }), a = U(!r.bot), s = U(r.bot), c = U();
5877
6206
  async function loadBot() {
5878
6207
  if (r.bot) {
5879
6208
  t.debug("Bot provided via props, skipping fetch", {
@@ -5949,23 +6278,23 @@ var Bi = ["data-voice-state", "data-voice-activity"], Vi = ["src"], Hi = {
5949
6278
  });
5950
6279
  }
5951
6280
  }
5952
- return ne(loadBot), (t, n) => (j(), b("div", so, [a.value ? (j(), b("div", co, [x("div", { class: D(["size-6 animate-spin rounded-full border-b-2", r.bare ? "border-theme-400" : "border-white"]) }, null, 2)])) : s.value ? ce(t.$slots, "default", {
5953
- sdk: V(i),
6281
+ return ne(loadBot), (t, n) => (R(), x("div", Mo, [a.value ? (R(), x("div", No, [w("div", { class: j(["size-6 animate-spin rounded-full border-b-2", r.bare ? "border-theme-400" : "border-white"]) }, null, 2)])) : s.value ? ce(t.$slots, "default", {
6282
+ sdk: le(i),
5954
6283
  bot: s.value,
5955
6284
  context: e.clientContext ?? e.context,
5956
6285
  firstMessage: e.firstMessage,
5957
6286
  buttonText: e.buttonText,
5958
6287
  buttonIcon: e.buttonIcon,
5959
6288
  loading: a.value
5960
- }, void 0, void 0, 1) : c.value ? (j(), b("div", lo, [n[0] || (n[0] = x("p", { class: "text-sm font-medium text-theme-600" }, " This assistant is unavailable right now. ", -1)), x("button", {
6289
+ }, void 0, void 0, 1) : c.value ? (R(), x("div", Po, [n[0] || (n[0] = w("p", { class: "text-sm font-medium text-theme-600" }, " This assistant is unavailable right now. ", -1)), w("button", {
5961
6290
  type: "button",
5962
6291
  class: "min-h-11 rounded-full bg-theme-900 px-5 text-sm font-semibold text-theme-0 transition-colors hover:bg-theme-700",
5963
6292
  "data-test": "bot-unavailable-retry",
5964
6293
  onClick: loadBot
5965
- }, " Try again ")])) : y("", !0)]));
6294
+ }, " Try again ")])) : b("", !0)]));
5966
6295
  }
5967
6296
  });
5968
6297
  //#endregion
5969
- export { Be as a, ke as c, parseButtonTemplate as d, BotChatController as f, bi as i, getBotAvatarUrl as l, ve as m, oo as n, Ne as o, xe as p, Zi as r, je as s, uo as t, handleImageError as u };
6298
+ export { Ci as a, Me as c, handleImageError as d, parseButtonTemplate as f, _e as h, Ni as i, Ae as l, Y as m, jo as n, Ve as o, BotChatController as p, ba as r, Pe as s, Fo as t, getBotAvatarUrl as u };
5970
6299
 
5971
6300
  //# sourceMappingURL=BotWrap.js.map