@pagelines/sdk 1.0.897 → 1.0.899
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 +594 -640
- package/dist/BotWrap.js.map +1 -1
- package/dist/bot/BotController.d.ts +2 -40
- package/dist/clients/BotClient.d.ts +1 -1
- package/dist/clients/ChatClient.d.ts +4 -4
- package/dist/sdk.css +1 -1
- package/dist/sdkClient.d.ts +8 -16
- package/dist/sdkClient.js +46 -46
- package/dist/sdkClient.js.map +1 -1
- package/dist/widget.js +115 -115
- package/dist/widget.js.map +1 -1
- package/package.json +1 -1
package/dist/BotWrap.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime.js";
|
|
2
2
|
import { c as t, t as n } from "./sdkClient.js";
|
|
3
|
-
import {
|
|
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 p, parseChatCardFencePayload as m, parseChatVisualFencePayload as h } from "@pagelines/core";
|
|
4
4
|
import { Fragment as g, Transition as _, computed as v, createBlock as b, createCommentVNode as x, createElementBlock as S, createElementVNode as C, createTextVNode as w, createVNode as T, defineComponent as E, nextTick as re, normalizeClass as O, normalizeStyle as k, onBeforeUnmount as ie, onMounted as ae, onUnmounted as oe, openBlock as j, ref as M, renderList as N, renderSlot as se, resolveDynamicComponent as ce, shallowRef as F, toDisplayString as z, unref as B, useTemplateRef as le, vModelText as ue, watch as de, withCtx as he, withDirectives as ge, withKeys as _e, withModifiers as ve } from "vue";
|
|
5
5
|
//#region \0plugin-vue:export-helper
|
|
6
6
|
var ye = /* @__PURE__ */ e((e, t) => {
|
|
@@ -40,7 +40,7 @@ function recorderMimeType() {
|
|
|
40
40
|
"audio/webm"
|
|
41
41
|
].find((e) => MediaRecorder.isTypeSupported?.(e)) || "";
|
|
42
42
|
}
|
|
43
|
-
var H = 400, VoiceRecorderController = class extends
|
|
43
|
+
var H = 400, VoiceRecorderController = class extends i {
|
|
44
44
|
constructor(e) {
|
|
45
45
|
super("VoiceRecorderController", e), t(this, "state", M({
|
|
46
46
|
phase: "idle",
|
|
@@ -324,51 +324,7 @@ function buildLiveTurnBlocks(e) {
|
|
|
324
324
|
}
|
|
325
325
|
//#endregion
|
|
326
326
|
//#region bot/BotController.ts
|
|
327
|
-
var
|
|
328
|
-
...De,
|
|
329
|
-
"EMPTY_STREAM",
|
|
330
|
-
"RATE_LIMIT"
|
|
331
|
-
]), ke = /* @__PURE__ */ new Set(["bot_deleted", "BOT_DELETED"]), Ae = {
|
|
332
|
-
CREDIT_LIMIT: "billing_budget_reached",
|
|
333
|
-
OVERAGE_CAP: "billing_runaway_cap"
|
|
334
|
-
};
|
|
335
|
-
function presentChatStreamError(e) {
|
|
336
|
-
if (!(e.bucket !== void 0 || Oe.has(e.code))) return { surface: "hard" };
|
|
337
|
-
let t = e.bucket ?? (De.has(e.code) ? "account" : "error"), n = {
|
|
338
|
-
...e.actionLabel ? { actionLabel: e.actionLabel } : {},
|
|
339
|
-
...e.actionUrl ? { actionUrl: e.actionUrl } : {},
|
|
340
|
-
...e.help ? { help: e.help } : {}
|
|
341
|
-
};
|
|
342
|
-
return t === "account" ? {
|
|
343
|
-
surface: "transcript",
|
|
344
|
-
issue: {
|
|
345
|
-
code: e.code,
|
|
346
|
-
bucket: t,
|
|
347
|
-
...n
|
|
348
|
-
},
|
|
349
|
-
sendBlockedReason: "account"
|
|
350
|
-
} : ke.has(e.code) ? {
|
|
351
|
-
surface: "transcript",
|
|
352
|
-
issue: {
|
|
353
|
-
code: e.code,
|
|
354
|
-
bucket: t,
|
|
355
|
-
...n
|
|
356
|
-
},
|
|
357
|
-
sendBlockedReason: "bot_deleted"
|
|
358
|
-
} : {
|
|
359
|
-
surface: "transient",
|
|
360
|
-
issue: {
|
|
361
|
-
code: e.code,
|
|
362
|
-
message: e.error,
|
|
363
|
-
...n
|
|
364
|
-
}
|
|
365
|
-
};
|
|
366
|
-
}
|
|
367
|
-
function transcriptMessageForChatStreamError(e) {
|
|
368
|
-
let t = Ae[e.code];
|
|
369
|
-
return t ? r[t].oneLine : e.error;
|
|
370
|
-
}
|
|
371
|
-
var BotChatController = class extends a {
|
|
327
|
+
var BotChatController = class extends i {
|
|
372
328
|
isQueuedMessage(e) {
|
|
373
329
|
return this.queuedMessageIdSet.value.has(e);
|
|
374
330
|
}
|
|
@@ -447,12 +403,6 @@ var BotChatController = class extends a {
|
|
|
447
403
|
let e = this._bot.displayName.value, t = this._bot.state.value.lifecycle;
|
|
448
404
|
return t === "starting" ? `${e} is waking up` : t === "stopped" ? `${e} is asleep` : this._bot.desiredStatus.value === "active" ? `${e} is unavailable` : `${e} is offline`;
|
|
449
405
|
}
|
|
450
|
-
mapChatError(e) {
|
|
451
|
-
return e.includes("429") || e.includes("Too many") ? "Too many messages. Please wait a moment." : e.includes("503") || e.includes("not available") ? "Bot is currently offline." : e.includes("timed out") ? "This request timed out. Try again in a few minutes." : e.includes("starting up") ? "Bot is starting up. Please try again." : e.includes("404") ? "Bot not found." : e.includes("[no-reply]") ? "The reply didn't make it back. Refresh to see if it landed." : e.includes("[stream-open]") || e.includes("[stream-read]") ? "Lost connection mid-reply. Try again." : e.includes("[api]") ? "Couldn't send. Try again." : "Something went wrong. Try again.";
|
|
452
|
-
}
|
|
453
|
-
isTransientError(e) {
|
|
454
|
-
return e.includes("timed out") || e.includes("starting up") || e.includes("503") || e.includes("429") || e.includes("[no-reply]") || e.includes("[stream-open]") || e.includes("[stream-read]") || e.includes("[api]");
|
|
455
|
-
}
|
|
456
406
|
isDuplicateMessage(e, t) {
|
|
457
407
|
let n = `${t}:${e.toLowerCase().trim()}`, r = Date.now(), i = n === this.lastMessage.hash && r - this.lastMessage.time < 500;
|
|
458
408
|
return i || (this.lastMessage = {
|
|
@@ -671,14 +621,13 @@ var BotChatController = class extends a {
|
|
|
671
621
|
}
|
|
672
622
|
});
|
|
673
623
|
}
|
|
674
|
-
handleError(e
|
|
675
|
-
let
|
|
624
|
+
handleError(e) {
|
|
625
|
+
let t = e.message;
|
|
676
626
|
this.logger.error("Conversation error:", {
|
|
677
|
-
message:
|
|
678
|
-
raw: t,
|
|
627
|
+
message: t,
|
|
679
628
|
error: e
|
|
680
|
-
}), this.addMessage(
|
|
681
|
-
error:
|
|
629
|
+
}), this.addMessage(t, "system"), this.resetState(), this.updateState(this.textState, {
|
|
630
|
+
error: t,
|
|
682
631
|
connectionStatus: "error"
|
|
683
632
|
});
|
|
684
633
|
}
|
|
@@ -735,26 +684,26 @@ var BotChatController = class extends a {
|
|
|
735
684
|
this.handleError(/* @__PURE__ */ Error("Bot handle required for chat"));
|
|
736
685
|
return;
|
|
737
686
|
}
|
|
738
|
-
let i = this.textState.value.isThinking,
|
|
687
|
+
let i = this.textState.value.isThinking, o = this.sharedMessages.value.length;
|
|
739
688
|
this.addMessage(e, "user", t);
|
|
740
|
-
let
|
|
741
|
-
i &&
|
|
689
|
+
let s = this.sharedMessages.value.length > o ? this.sharedMessages.value[this.sharedMessages.value.length - 1]?.id : void 0, c = this.turnEpoch, m = ++this.nextStreamToken;
|
|
690
|
+
i && s ? this.queuedMessageIdSet.value = new Set(this.queuedMessageIdSet.value).add(s) : (this.runningStreamToken = m, this.resetWorkJournalTiming(), this.updateState(this.textState, {
|
|
742
691
|
isThinking: !0,
|
|
743
692
|
workingDescription: void 0,
|
|
744
693
|
toolActivities: [],
|
|
745
694
|
transientIssue: void 0,
|
|
746
695
|
turnOutcome: void 0
|
|
747
696
|
}));
|
|
748
|
-
let
|
|
749
|
-
if (
|
|
697
|
+
let h = `stream-${Date.now()}-${m}`, g = !1, _ = !1, isCurrentTurn = () => c === this.turnEpoch && !this.suppressedStreamTokens.has(m), onUserMessage = (e) => {
|
|
698
|
+
if (c !== this.turnEpoch || !s) return;
|
|
750
699
|
let t = this.sharedMessages.value;
|
|
751
|
-
if (this.sharedMessages.value = t.some((t) => t.id === e.id) ? t.filter((t) => t.id !==
|
|
700
|
+
if (this.sharedMessages.value = t.some((t) => t.id === e.id) ? t.filter((t) => t.id !== s || t.id === e.id) : t.map((t) => t.id === s ? e : t), this.queuedMessageIdSet.value.has(s)) {
|
|
752
701
|
let t = new Set(this.queuedMessageIdSet.value);
|
|
753
|
-
t.delete(
|
|
702
|
+
t.delete(s), t.add(e.id), this.queuedMessageIdSet.value = t;
|
|
754
703
|
}
|
|
755
|
-
|
|
704
|
+
s = e.id;
|
|
756
705
|
}, claimLiveTurn = () => {
|
|
757
|
-
this.runningStreamToken !==
|
|
706
|
+
this.runningStreamToken !== m && (this.runningStreamToken = m, this.consumeQueuedThrough(s), this.resetWorkJournalTiming(), this.updateState(this.textState, {
|
|
758
707
|
isThinking: !0,
|
|
759
708
|
workingDescription: void 0,
|
|
760
709
|
toolActivities: [],
|
|
@@ -763,8 +712,8 @@ var BotChatController = class extends a {
|
|
|
763
712
|
}));
|
|
764
713
|
}, onDelta = (e, t = "assistant") => {
|
|
765
714
|
if (!isCurrentTurn()) return;
|
|
766
|
-
claimLiveTurn(), this.updateState(this.textState, { workingDescription: void 0 }), t === "assistant" && (this.lastVisibleProgressAtMs.value = Date.now()),
|
|
767
|
-
id:
|
|
715
|
+
claimLiveTurn(), this.updateState(this.textState, { workingDescription: void 0 }), t === "assistant" && (this.lastVisibleProgressAtMs.value = Date.now()), g || (g = !0, this.liveStreamMessageId.value = h, this.sharedMessages.value = [...this.sharedMessages.value, {
|
|
716
|
+
id: h,
|
|
768
717
|
text: "",
|
|
769
718
|
sender: t === "system" ? "system" : "bot",
|
|
770
719
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
@@ -778,14 +727,14 @@ var BotChatController = class extends a {
|
|
|
778
727
|
content: e
|
|
779
728
|
}];
|
|
780
729
|
let i = this.sharedMessages.value, a = i[i.length - 1];
|
|
781
|
-
a?.id ===
|
|
730
|
+
a?.id === h && (a.text += e, this.sharedMessages.value = [...i]);
|
|
782
731
|
}, onMessage = (e) => {
|
|
783
732
|
if (!isCurrentTurn()) return;
|
|
784
|
-
if (claimLiveTurn(),
|
|
785
|
-
this.liveSegments.value = [], this.liveStreamMessageId.value = void 0, this.sharedMessages.value = this.sharedMessages.value.filter((e) => e.id !==
|
|
733
|
+
if (claimLiveTurn(), _ = !0, e.sender === "bot" && p(e.text)) {
|
|
734
|
+
this.liveSegments.value = [], this.liveStreamMessageId.value = void 0, this.sharedMessages.value = this.sharedMessages.value.filter((e) => e.id !== h);
|
|
786
735
|
return;
|
|
787
736
|
}
|
|
788
|
-
|
|
737
|
+
g = !0;
|
|
789
738
|
let t = e.sender === "system" || e.turnOutcome === "failed" ? "failed" : "completed";
|
|
790
739
|
this.finishToolActivities(t);
|
|
791
740
|
let n = this.textState.value.toolActivities, r = e.toolActivities?.length || !n?.length ? e : {
|
|
@@ -797,29 +746,29 @@ var BotChatController = class extends a {
|
|
|
797
746
|
toolActivities: [],
|
|
798
747
|
turnOutcome: void 0
|
|
799
748
|
});
|
|
800
|
-
let i = this.sharedMessages.value.filter((e) => e.id !==
|
|
749
|
+
let i = this.sharedMessages.value.filter((e) => e.id !== h), a = i.findIndex((e) => e.id === r.id);
|
|
801
750
|
a >= 0 ? this.sharedMessages.value = [
|
|
802
751
|
...i.slice(0, a),
|
|
803
752
|
r,
|
|
804
753
|
...i.slice(a + 1)
|
|
805
|
-
] : this.sharedMessages.value = [...i, r], r.sender === "system" && r.issue?.bucket === "account" ? this.updateState(this.textState, { sendBlockedReason: "account" }) : r.sender === "system" && r.issue?.code
|
|
754
|
+
] : this.sharedMessages.value = [...i, r], r.sender === "system" && r.issue?.bucket === "account" ? this.updateState(this.textState, { sendBlockedReason: "account" }) : r.sender === "system" && r.issue?.code === "BOT_DELETED" && this.updateState(this.textState, { sendBlockedReason: "bot_deleted" });
|
|
806
755
|
}, onDone = (e) => {
|
|
807
756
|
if (!isCurrentTurn()) return;
|
|
808
|
-
if (!
|
|
809
|
-
onError("
|
|
757
|
+
if (!g && !_) {
|
|
758
|
+
onError(a("no-reply", "Assistant returned no content"));
|
|
810
759
|
return;
|
|
811
760
|
}
|
|
812
761
|
this.finishToolActivities("completed");
|
|
813
762
|
let t = this.sharedMessages.value, n = t[t.length - 1];
|
|
814
|
-
n?.id ===
|
|
763
|
+
n?.id === h && n.sender === "bot" && p(n.text) && (this.sharedMessages.value = t.slice(0, -1)), e && (this.conversationId = e), this.updateState(this.textState, {
|
|
815
764
|
isThinking: !1,
|
|
816
765
|
workingDescription: void 0,
|
|
817
766
|
transientIssue: void 0
|
|
818
767
|
}), this.settings.onTurnCompleted?.(e);
|
|
819
768
|
}, onError = (n) => {
|
|
820
769
|
if (!isCurrentTurn()) return;
|
|
821
|
-
if (this.runningStreamToken !==
|
|
822
|
-
this.consumeQueuedThrough(
|
|
770
|
+
if (this.runningStreamToken !== m) {
|
|
771
|
+
this.consumeQueuedThrough(s), this.sharedMessages.value = this.sharedMessages.value.filter((e) => e.id !== s), this.composerState.value.text || (this.composerState.value = {
|
|
823
772
|
...this.composerState.value,
|
|
824
773
|
text: e,
|
|
825
774
|
pendingAttachments: t ?? []
|
|
@@ -831,22 +780,27 @@ var BotChatController = class extends a {
|
|
|
831
780
|
turnOutcome: "failed"
|
|
832
781
|
}), this.finishToolActivities("failed");
|
|
833
782
|
let r = this.sharedMessages.value, i = r[r.length - 1];
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
}
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
783
|
+
i?.id === h && !i.text && (this.sharedMessages.value = r.slice(0, -1)), this.logger.warn("Chat turn failed:", n);
|
|
784
|
+
let { code: a, bucket: o, message: c, actionLabel: p, actionUrl: g, help: _ } = n, v = {
|
|
785
|
+
...p ? { actionLabel: p } : {},
|
|
786
|
+
...g ? { actionUrl: g } : {},
|
|
787
|
+
..._ ? { help: _ } : {}
|
|
788
|
+
}, b = o === "account" ? "account" : a === "BOT_DELETED" ? "bot_deleted" : void 0;
|
|
789
|
+
b ? (this.addMessage(c, "system", void 0, {
|
|
790
|
+
code: a,
|
|
791
|
+
bucket: o,
|
|
792
|
+
...v
|
|
793
|
+
}), this.updateState(this.textState, {
|
|
794
|
+
isThinking: !1,
|
|
795
|
+
sendBlockedReason: b
|
|
796
|
+
})) : this.updateState(this.textState, {
|
|
797
|
+
isThinking: !1,
|
|
798
|
+
transientIssue: {
|
|
799
|
+
code: a,
|
|
800
|
+
message: c,
|
|
801
|
+
...v
|
|
802
|
+
}
|
|
803
|
+
});
|
|
850
804
|
}, onStatus = (e) => {
|
|
851
805
|
if (!isCurrentTurn()) return;
|
|
852
806
|
claimLiveTurn();
|
|
@@ -898,9 +852,9 @@ var BotChatController = class extends a {
|
|
|
898
852
|
onWorkingEnd
|
|
899
853
|
}));
|
|
900
854
|
} catch (e) {
|
|
901
|
-
onError(e.message
|
|
855
|
+
onError(a("api", e instanceof Error ? e.message : "Chat failed", "NETWORK_ERROR"));
|
|
902
856
|
} finally {
|
|
903
|
-
this.runningStreamToken ===
|
|
857
|
+
this.runningStreamToken === m && (this.runningStreamToken = void 0);
|
|
904
858
|
}
|
|
905
859
|
}
|
|
906
860
|
async stopChatTurn() {
|
|
@@ -980,10 +934,10 @@ function parseButtonTemplate(e) {
|
|
|
980
934
|
}
|
|
981
935
|
//#endregion
|
|
982
936
|
//#region bot/ui/ElBotButton.vue?vue&type=script&setup=true&lang.ts
|
|
983
|
-
var
|
|
937
|
+
var De = {
|
|
984
938
|
key: 0,
|
|
985
939
|
class: "absolute inset-0 flex items-center justify-center"
|
|
986
|
-
},
|
|
940
|
+
}, Oe = /* @__PURE__ */ E({
|
|
987
941
|
__name: "ElBotButton",
|
|
988
942
|
props: {
|
|
989
943
|
theme: { default: "primary" },
|
|
@@ -1011,7 +965,7 @@ var je = {
|
|
|
1011
965
|
md: "size-4",
|
|
1012
966
|
lg: "size-5"
|
|
1013
967
|
})[e.size]);
|
|
1014
|
-
return (i, a) => (j(), S("button", { class: O(["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(), S("div",
|
|
968
|
+
return (i, a) => (j(), S("button", { class: O(["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(), S("div", De, [...a[0] || (a[0] = [C("i", { class: "i-svg-spinners-90-ring-with-bg size-5" }, null, -1)])])) : x("", !0), C("span", { class: O(["flex items-center gap-2 transition-opacity duration-200", e.loading ? "opacity-0" : "opacity-100"]) }, [
|
|
1015
969
|
e.icon ? (j(), S("i", {
|
|
1016
970
|
key: 0,
|
|
1017
971
|
class: O([e.icon, r.value])
|
|
@@ -1023,7 +977,7 @@ var je = {
|
|
|
1023
977
|
}, null, 2)) : x("", !0)
|
|
1024
978
|
], 2)], 2));
|
|
1025
979
|
}
|
|
1026
|
-
}),
|
|
980
|
+
}), ke = ["value"], Ae = /* @__PURE__ */ E({
|
|
1027
981
|
__name: "BotInputEmail",
|
|
1028
982
|
props: { modelValue: { default: "" } },
|
|
1029
983
|
emits: ["update:modelValue"],
|
|
@@ -1042,9 +996,9 @@ var je = {
|
|
|
1042
996
|
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",
|
|
1043
997
|
style: { "font-size": "16px" },
|
|
1044
998
|
onInput: r[0] || (r[0] = (e) => n("update:modelValue", e.target.value))
|
|
1045
|
-
}, null, 40,
|
|
999
|
+
}, null, 40, ke));
|
|
1046
1000
|
}
|
|
1047
|
-
}),
|
|
1001
|
+
}), je = ["placeholder", "value"], Me = /* @__PURE__ */ E({
|
|
1048
1002
|
__name: "BotInputOneTimeCode",
|
|
1049
1003
|
props: {
|
|
1050
1004
|
modelValue: {},
|
|
@@ -1077,12 +1031,12 @@ var je = {
|
|
|
1077
1031
|
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",
|
|
1078
1032
|
style: { "font-size": "16px" },
|
|
1079
1033
|
onInput
|
|
1080
|
-
}, null, 40,
|
|
1034
|
+
}, null, 40, je));
|
|
1081
1035
|
}
|
|
1082
|
-
}),
|
|
1036
|
+
}), Ne = { class: "relative flex-shrink-0" }, Pe = ["src", "alt"], Fe = { class: "absolute top-1 right-1" }, Ie = {
|
|
1083
1037
|
key: 1,
|
|
1084
1038
|
class: "size-3 bg-theme-400 rounded-full ring-2 ring-white"
|
|
1085
|
-
},
|
|
1039
|
+
}, Le = { class: "min-w-0" }, ze = /* @__PURE__ */ E({
|
|
1086
1040
|
__name: "ElModeHeader",
|
|
1087
1041
|
props: {
|
|
1088
1042
|
bot: {},
|
|
@@ -1094,17 +1048,17 @@ var je = {
|
|
|
1094
1048
|
layout: { default: "centered" }
|
|
1095
1049
|
},
|
|
1096
1050
|
setup(e) {
|
|
1097
|
-
return (t, n) => (j(), S("div", { class: O(["flex gap-4", [e.layout === "centered" ? "flex-col items-center text-center" : "flex-row items-center justify-center"]]) }, [C("div",
|
|
1051
|
+
return (t, n) => (j(), S("div", { class: O(["flex gap-4", [e.layout === "centered" ? "flex-col items-center text-center" : "flex-row items-center justify-center"]]) }, [C("div", Ne, [C("div", { class: O(["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"]) }, [C("img", {
|
|
1098
1052
|
src: e.bot.avatarUrl.value,
|
|
1099
1053
|
alt: e.bot.displayName.value,
|
|
1100
1054
|
class: "w-full h-full object-cover",
|
|
1101
1055
|
onError: n[0] || (n[0] = (...e) => B(handleImageError) && B(handleImageError)(...e))
|
|
1102
|
-
}, null, 40,
|
|
1056
|
+
}, null, 40, Pe)], 2), C("div", Fe, [e.isOnline ? (j(), S(g, { key: 0 }, [n[1] || (n[1] = C("div", {
|
|
1103
1057
|
class: "size-3 bg-green-500 rounded-full ring-2 ring-white absolute animate-ping",
|
|
1104
1058
|
style: { "animation-duration": "3s" }
|
|
1105
|
-
}, null, -1)), n[2] || (n[2] = C("div", { class: "size-3 bg-green-500 rounded-full ring-2 ring-white" }, null, -1))], 64)) : (j(), S("div",
|
|
1059
|
+
}, null, -1)), n[2] || (n[2] = C("div", { class: "size-3 bg-green-500 rounded-full ring-2 ring-white" }, null, -1))], 64)) : (j(), S("div", Ie))])]), C("div", Le, [C("h1", { class: O(["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" : ""]]) }, z(e.bot.displayName.value), 3), C("p", { class: O(["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"]]) }, z(e.layout === "horizontal" ? e.bot.title.value || "Assistant" : e.bot.title.value), 3)])], 2));
|
|
1106
1060
|
}
|
|
1107
|
-
}),
|
|
1061
|
+
}), Be = { class: "relative shrink-0 rounded-full" }, Ve = ["src", "alt"], He = ["src", "alt"], Ue = ["aria-label"], We = /* @__PURE__ */ E({
|
|
1108
1062
|
__name: "BotAvatar",
|
|
1109
1063
|
props: {
|
|
1110
1064
|
bot: {},
|
|
@@ -1136,25 +1090,25 @@ var je = {
|
|
|
1136
1090
|
top: "calc(14.6% - clamp(3.5px, 7%, 7px))",
|
|
1137
1091
|
right: "calc(14.6% - clamp(3.5px, 7%, 7px))"
|
|
1138
1092
|
}, i = v(() => e.isLight ? "ring-white" : "ring-theme-900");
|
|
1139
|
-
return (t, a) => (j(), S("div",
|
|
1093
|
+
return (t, a) => (j(), S("div", Be, [
|
|
1140
1094
|
C("img", {
|
|
1141
1095
|
src: e.bot.avatarUrl.value,
|
|
1142
1096
|
alt: e.bot.displayName.value,
|
|
1143
1097
|
class: O(["size-full rounded-full object-cover ring-1", e.isLight ? "ring-black/5" : "ring-white/10"])
|
|
1144
|
-
}, null, 10,
|
|
1098
|
+
}, null, 10, Ve),
|
|
1145
1099
|
e.showOwnerMark && e.bot.ownerMarkUrl.value ? (j(), S("img", {
|
|
1146
1100
|
key: 0,
|
|
1147
1101
|
src: e.bot.ownerMarkUrl.value,
|
|
1148
1102
|
alt: e.bot.owner.value?.fullName ? `Owned by ${e.bot.owner.value.fullName}` : "Owner",
|
|
1149
1103
|
class: O(["absolute z-10 size-[36%] -bottom-[3%] -left-[3%] rounded-full object-cover ring-2", i.value])
|
|
1150
|
-
}, null, 10,
|
|
1104
|
+
}, null, 10, He)) : x("", !0),
|
|
1151
1105
|
n.value ? (j(), S("span", {
|
|
1152
1106
|
key: 1,
|
|
1153
1107
|
role: "status",
|
|
1154
1108
|
"aria-label": e.bot.state.value.tooltip,
|
|
1155
1109
|
class: O(["absolute z-10 rounded-full ring-2", [n.value, i.value]]),
|
|
1156
1110
|
style: r
|
|
1157
|
-
}, null, 10,
|
|
1111
|
+
}, null, 10, Ue)) : x("", !0),
|
|
1158
1112
|
n.value && e.bot.state.value.lifecycle === "running" ? (j(), S("span", {
|
|
1159
1113
|
key: 2,
|
|
1160
1114
|
"aria-hidden": "true",
|
|
@@ -1163,21 +1117,21 @@ var je = {
|
|
|
1163
1117
|
}, null, 2)) : x("", !0)
|
|
1164
1118
|
]));
|
|
1165
1119
|
}
|
|
1166
|
-
}),
|
|
1120
|
+
}), Ge = {
|
|
1167
1121
|
key: 0,
|
|
1168
1122
|
class: "sr-only",
|
|
1169
1123
|
role: "status",
|
|
1170
1124
|
"aria-live": "polite"
|
|
1171
|
-
},
|
|
1125
|
+
}, Ke = ["aria-expanded", "disabled"], qe = ["aria-expanded"], Je = {
|
|
1172
1126
|
class: "flex w-5 shrink-0 justify-center self-stretch",
|
|
1173
1127
|
"aria-hidden": "true"
|
|
1174
|
-
},
|
|
1128
|
+
}, Ye = ["data-journal-row"], Xe = {
|
|
1175
1129
|
class: "flex w-5 shrink-0 flex-col items-center self-stretch",
|
|
1176
1130
|
"aria-hidden": "true"
|
|
1177
|
-
},
|
|
1131
|
+
}, Ze = { class: "flex h-[17px] shrink-0 items-center" }, Qe = {
|
|
1178
1132
|
key: 0,
|
|
1179
1133
|
class: "sr-only"
|
|
1180
|
-
},
|
|
1134
|
+
}, $e = /* @__PURE__ */ E({
|
|
1181
1135
|
__name: "BotToolActivityGroup",
|
|
1182
1136
|
props: {
|
|
1183
1137
|
model: {},
|
|
@@ -1257,7 +1211,7 @@ var je = {
|
|
|
1257
1211
|
};
|
|
1258
1212
|
});
|
|
1259
1213
|
return (t, p) => (j(), S("div", { class: O(["w-full py-0.5", s.value.muted]) }, [
|
|
1260
|
-
a.value ? (j(), S("span",
|
|
1214
|
+
a.value ? (j(), S("span", Ge, z(a.value), 1)) : x("", !0),
|
|
1261
1215
|
r.value ? (j(), S("button", {
|
|
1262
1216
|
key: 1,
|
|
1263
1217
|
type: "button",
|
|
@@ -1279,7 +1233,7 @@ var je = {
|
|
|
1279
1233
|
class: O(["size-[13px] shrink-0", [n.value ? "i-tabler-chevron-down" : "i-tabler-chevron-right", s.value.muted]]),
|
|
1280
1234
|
"aria-hidden": "true"
|
|
1281
1235
|
}, null, 2)) : x("", !0)
|
|
1282
|
-
], 10,
|
|
1236
|
+
], 10, Ke)) : i.value ? (j(), S("button", {
|
|
1283
1237
|
key: 2,
|
|
1284
1238
|
type: "button",
|
|
1285
1239
|
"data-test": "messaging-tool-activity-summary",
|
|
@@ -1287,28 +1241,28 @@ var je = {
|
|
|
1287
1241
|
"aria-expanded": n.value,
|
|
1288
1242
|
class: O(["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]),
|
|
1289
1243
|
onClick: toggle
|
|
1290
|
-
}, [C("span",
|
|
1244
|
+
}, [C("span", Je, [C("span", {
|
|
1291
1245
|
"data-journal-spine": "dashed",
|
|
1292
1246
|
class: O(["w-0 border-l border-dashed", s.value.dashed])
|
|
1293
1247
|
}, null, 2)]), C("span", { class: O(["flex min-h-[20px] items-center gap-0.5 pb-2 text-[12px] leading-none", s.value.muted]) }, [w(z(i.value) + " earlier updates ", 1), C("i", {
|
|
1294
1248
|
class: O(["size-3 shrink-0", n.value ? "i-tabler-chevron-down" : "i-tabler-chevron-right"]),
|
|
1295
1249
|
"aria-hidden": "true"
|
|
1296
|
-
}, null, 2)], 2)], 10,
|
|
1250
|
+
}, null, 2)], 2)], 10, qe)) : x("", !0),
|
|
1297
1251
|
(j(!0), S(g, null, N(o.value, (e, t) => (j(), S("div", {
|
|
1298
1252
|
key: e.id,
|
|
1299
1253
|
"data-test": "messaging-tool-activity-row",
|
|
1300
1254
|
"data-journal-row": e.tone,
|
|
1301
1255
|
class: O([r.value ? "pl-[22px]" : "", "flex gap-x-2.5"])
|
|
1302
|
-
}, [C("div",
|
|
1256
|
+
}, [C("div", Xe, [C("span", Ze, [(j(), b(ce(c.value[e.tone].station.tag), {
|
|
1303
1257
|
"data-journal-station": e.tone,
|
|
1304
1258
|
class: O(c.value[e.tone].station.class)
|
|
1305
1259
|
}, null, 8, ["data-journal-station", "class"]))]), t === o.value.length - 1 ? x("", !0) : (j(), S("span", {
|
|
1306
1260
|
key: 0,
|
|
1307
1261
|
class: O(["w-px flex-1", s.value.spine])
|
|
1308
|
-
}, null, 2))]), C("div", { class: O(["min-w-0 flex-1", t === o.value.length - 1 ? "" : "pb-2"]) }, [C("span", { class: O(["relative block leading-snug", c.value[e.tone].label]) }, [w(z(e.label), 1), c.value[e.tone].statusWord ? (j(), S("span",
|
|
1262
|
+
}, null, 2))]), C("div", { class: O(["min-w-0 flex-1", t === o.value.length - 1 ? "" : "pb-2"]) }, [C("span", { class: O(["relative block leading-snug", c.value[e.tone].label]) }, [w(z(e.label), 1), c.value[e.tone].statusWord ? (j(), S("span", Qe, ", " + z(c.value[e.tone].statusWord), 1)) : x("", !0)], 2), e.note ? (j(), S("p", {
|
|
1309
1263
|
key: 0,
|
|
1310
1264
|
class: O(["pt-0.5 text-[11.5px] leading-snug", s.value.muted])
|
|
1311
|
-
}, z(e.note), 3)) : x("", !0)], 2)], 10,
|
|
1265
|
+
}, z(e.note), 3)) : x("", !0)], 2)], 10, Ye))), 128)),
|
|
1312
1266
|
!r.value && e.model.hint ? (j(), S("p", {
|
|
1313
1267
|
key: 3,
|
|
1314
1268
|
"data-test": "messaging-tool-activity-hint",
|
|
@@ -1358,86 +1312,86 @@ function _unsupportedIterableToArray(e, t) {
|
|
|
1358
1312
|
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;
|
|
1359
1313
|
}
|
|
1360
1314
|
}
|
|
1361
|
-
var
|
|
1315
|
+
var et = Object.entries, tt = Object.setPrototypeOf, nt = Object.isFrozen, K = Object.getPrototypeOf, rt = Object.getOwnPropertyDescriptor, q = Object.freeze, J = Object.seal, it = Object.create, at = typeof Reflect < "u" && Reflect, ot = at.apply, st = at.construct;
|
|
1362
1316
|
q || (q = function freeze(e) {
|
|
1363
1317
|
return e;
|
|
1364
1318
|
}), J || (J = function seal(e) {
|
|
1365
1319
|
return e;
|
|
1366
|
-
}),
|
|
1320
|
+
}), ot || (ot = function apply(e, t) {
|
|
1367
1321
|
var n = [...arguments].slice(2);
|
|
1368
1322
|
return e.apply(t, n);
|
|
1369
|
-
}),
|
|
1323
|
+
}), st || (st = function construct(e) {
|
|
1370
1324
|
return new e(...[...arguments].slice(1));
|
|
1371
1325
|
});
|
|
1372
|
-
var
|
|
1326
|
+
var ct = unapply(Array.prototype.forEach), Y = unapply(Array.prototype.lastIndexOf), lt = unapply(Array.prototype.pop), ut = unapply(Array.prototype.push), dt = unapply(Array.prototype.splice), ft = Array.isArray, pt = unapply(String.prototype.toLowerCase), mt = unapply(String.prototype.toString), ht = unapply(String.prototype.match), gt = unapply(String.prototype.replace), _t = unapply(String.prototype.indexOf), vt = unapply(String.prototype.trim), yt = 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), X = unapply(Object.prototype.hasOwnProperty), Tt = unapply(Object.prototype.toString), Et = unapply(RegExp.prototype.test), Dt = unconstruct(TypeError);
|
|
1373
1327
|
function unapply(e) {
|
|
1374
1328
|
return function(t) {
|
|
1375
1329
|
t instanceof RegExp && (t.lastIndex = 0);
|
|
1376
1330
|
var n = [...arguments].slice(1);
|
|
1377
|
-
return
|
|
1331
|
+
return ot(e, t, n);
|
|
1378
1332
|
};
|
|
1379
1333
|
}
|
|
1380
1334
|
function unconstruct(e) {
|
|
1381
1335
|
return function() {
|
|
1382
|
-
return
|
|
1336
|
+
return st(e, [...arguments]);
|
|
1383
1337
|
};
|
|
1384
1338
|
}
|
|
1385
1339
|
function addToSet(e, t) {
|
|
1386
|
-
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] :
|
|
1387
|
-
if (
|
|
1340
|
+
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : pt;
|
|
1341
|
+
if (tt && tt(e, null), !ft(t)) return e;
|
|
1388
1342
|
let r = t.length;
|
|
1389
1343
|
for (; r--;) {
|
|
1390
1344
|
let i = t[r];
|
|
1391
1345
|
if (typeof i == "string") {
|
|
1392
1346
|
let e = n(i);
|
|
1393
|
-
e !== i && (
|
|
1347
|
+
e !== i && (nt(t) || (t[r] = e), i = e);
|
|
1394
1348
|
}
|
|
1395
1349
|
e[i] = !0;
|
|
1396
1350
|
}
|
|
1397
1351
|
return e;
|
|
1398
1352
|
}
|
|
1399
1353
|
function cleanArray(e) {
|
|
1400
|
-
for (let t = 0; t < e.length; t++)
|
|
1354
|
+
for (let t = 0; t < e.length; t++) X(e, t) || (e[t] = null);
|
|
1401
1355
|
return e;
|
|
1402
1356
|
}
|
|
1403
1357
|
function clone(e) {
|
|
1404
|
-
let t =
|
|
1405
|
-
for (let r of
|
|
1358
|
+
let t = it(null);
|
|
1359
|
+
for (let r of et(e)) {
|
|
1406
1360
|
var n = _slicedToArray(r, 2);
|
|
1407
1361
|
let i = n[0], a = n[1];
|
|
1408
|
-
|
|
1362
|
+
X(e, i) && (t[i] = ft(a) ? cleanArray(a) : a && typeof a == "object" && a.constructor === Object ? clone(a) : a);
|
|
1409
1363
|
}
|
|
1410
1364
|
return t;
|
|
1411
1365
|
}
|
|
1412
1366
|
function stringifyValue(e) {
|
|
1413
1367
|
switch (typeof e) {
|
|
1414
1368
|
case "string": return e;
|
|
1415
|
-
case "number": return
|
|
1416
|
-
case "boolean": return
|
|
1417
|
-
case "bigint": return
|
|
1418
|
-
case "symbol": return
|
|
1419
|
-
case "undefined": return
|
|
1369
|
+
case "number": return yt(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);
|
|
1420
1374
|
case "function":
|
|
1421
1375
|
case "object": {
|
|
1422
|
-
if (e === null) return
|
|
1376
|
+
if (e === null) return Tt(e);
|
|
1423
1377
|
let t = e, n = lookupGetter(t, "toString");
|
|
1424
1378
|
if (typeof n == "function") {
|
|
1425
1379
|
let e = n(t);
|
|
1426
|
-
return typeof e == "string" ? e :
|
|
1380
|
+
return typeof e == "string" ? e : Tt(e);
|
|
1427
1381
|
}
|
|
1428
|
-
return
|
|
1382
|
+
return Tt(e);
|
|
1429
1383
|
}
|
|
1430
|
-
default: return
|
|
1384
|
+
default: return Tt(e);
|
|
1431
1385
|
}
|
|
1432
1386
|
}
|
|
1433
1387
|
function lookupGetter(e, t) {
|
|
1434
1388
|
for (; e !== null;) {
|
|
1435
|
-
let n =
|
|
1389
|
+
let n = rt(e, t);
|
|
1436
1390
|
if (n) {
|
|
1437
1391
|
if (n.get) return unapply(n.get);
|
|
1438
1392
|
if (typeof n.value == "function") return unapply(n.value);
|
|
1439
1393
|
}
|
|
1440
|
-
e =
|
|
1394
|
+
e = K(e);
|
|
1441
1395
|
}
|
|
1442
1396
|
function fallbackValue() {
|
|
1443
1397
|
return null;
|
|
@@ -1446,12 +1400,12 @@ function lookupGetter(e, t) {
|
|
|
1446
1400
|
}
|
|
1447
1401
|
function isRegex(e) {
|
|
1448
1402
|
try {
|
|
1449
|
-
return
|
|
1403
|
+
return Et(e, ""), !0;
|
|
1450
1404
|
} catch {
|
|
1451
1405
|
return !1;
|
|
1452
1406
|
}
|
|
1453
1407
|
}
|
|
1454
|
-
var
|
|
1408
|
+
var Ot = q(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr".split(".")), kt = q(/* @__PURE__ */ "svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern".split(".")), At = q([
|
|
1455
1409
|
"feBlend",
|
|
1456
1410
|
"feColorMatrix",
|
|
1457
1411
|
"feComponentTransfer",
|
|
@@ -1477,7 +1431,7 @@ var jt = q(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
1477
1431
|
"feSpotLight",
|
|
1478
1432
|
"feTile",
|
|
1479
1433
|
"feTurbulence"
|
|
1480
|
-
]),
|
|
1434
|
+
]), jt = q([
|
|
1481
1435
|
"animate",
|
|
1482
1436
|
"color-profile",
|
|
1483
1437
|
"cursor",
|
|
@@ -1500,7 +1454,7 @@ var jt = q(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
1500
1454
|
"solidcolor",
|
|
1501
1455
|
"unknown",
|
|
1502
1456
|
"use"
|
|
1503
|
-
]),
|
|
1457
|
+
]), Mt = q(/* @__PURE__ */ "math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts".split(".")), Nt = q([
|
|
1504
1458
|
"maction",
|
|
1505
1459
|
"maligngroup",
|
|
1506
1460
|
"malignmark",
|
|
@@ -1516,13 +1470,13 @@ var jt = q(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
1516
1470
|
"annotation-xml",
|
|
1517
1471
|
"mprescripts",
|
|
1518
1472
|
"none"
|
|
1519
|
-
]),
|
|
1473
|
+
]), Pt = q(["#text"]), Ft = q(/* @__PURE__ */ "accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns".split(".")), It = q(/* @__PURE__ */ "accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan".split(".")), Lt = q(/* @__PURE__ */ "accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns".split(".")), Rt = q([
|
|
1520
1474
|
"xlink:href",
|
|
1521
1475
|
"xml:id",
|
|
1522
1476
|
"xlink:title",
|
|
1523
1477
|
"xml:space",
|
|
1524
1478
|
"xmlns:xlink"
|
|
1525
|
-
]),
|
|
1479
|
+
]), zt = J(/{{[\w\W]*|^[\w\W]*}}/g), Bt = J(/<%[\w\W]*|^[\w\W]*%>/g), Vt = J(/\${[\w\W]*/g), Ht = J(/^data-[\-\w.\u00B7-\uFFFF]+$/), Ut = J(/^aria-[\-\w]+$/), Wt = J(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), Gt = J(/^(?:\w+script|data):/i), Kt = J(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), qt = J(/^html$/i), Jt = J(/^[a-z][.\w]*(-[.\w]+)+$/i), Yt = J(/<[/\w!]/g), Xt = J(/<[/\w]/g), Zt = J(/<\/no(script|embed|frames)/i), Qt = J(/\/>/i), $t = {
|
|
1526
1480
|
element: 1,
|
|
1527
1481
|
attribute: 2,
|
|
1528
1482
|
text: 3,
|
|
@@ -1535,9 +1489,9 @@ var jt = q(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
1535
1489
|
documentType: 10,
|
|
1536
1490
|
documentFragment: 11,
|
|
1537
1491
|
notation: 12
|
|
1538
|
-
},
|
|
1492
|
+
}, en = function getGlobal() {
|
|
1539
1493
|
return typeof window > "u" ? null : window;
|
|
1540
|
-
},
|
|
1494
|
+
}, tn = function _createTrustedTypesPolicy(e, t) {
|
|
1541
1495
|
if (typeof e != "object" || typeof e.createPolicy != "function") return null;
|
|
1542
1496
|
let n = null, r = "data-tt-policy-suffix";
|
|
1543
1497
|
t && t.hasAttribute(r) && (n = t.getAttribute(r));
|
|
@@ -1554,7 +1508,7 @@ var jt = q(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
1554
1508
|
} catch {
|
|
1555
1509
|
return console.warn("TrustedTypes policy " + i + " could not be created."), null;
|
|
1556
1510
|
}
|
|
1557
|
-
},
|
|
1511
|
+
}, nn = function _createHooksMap() {
|
|
1558
1512
|
return {
|
|
1559
1513
|
afterSanitizeAttributes: [],
|
|
1560
1514
|
afterSanitizeElements: [],
|
|
@@ -1566,12 +1520,12 @@ var jt = q(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
1566
1520
|
uponSanitizeElement: [],
|
|
1567
1521
|
uponSanitizeShadowNode: []
|
|
1568
1522
|
};
|
|
1569
|
-
},
|
|
1570
|
-
return
|
|
1523
|
+
}, rn = function _resolveSetOption(e, t, n, r) {
|
|
1524
|
+
return X(e, t) && ft(e[t]) ? addToSet(r.base ? clone(r.base) : {}, e[t], r.transform) : n;
|
|
1571
1525
|
};
|
|
1572
1526
|
function createDOMPurify() {
|
|
1573
|
-
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] :
|
|
1574
|
-
if (DOMPurify.version = "3.4.12", DOMPurify.removed = [], !e || !e.document || e.document.nodeType !==
|
|
1527
|
+
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : en(), DOMPurify = (e) => createDOMPurify(e);
|
|
1528
|
+
if (DOMPurify.version = "3.4.12", DOMPurify.removed = [], !e || !e.document || e.document.nodeType !== $t.document || !e.Element) return DOMPurify.isSupported = !1, DOMPurify;
|
|
1575
1529
|
let t = e.document, n = t, r = n.currentScript;
|
|
1576
1530
|
e.DocumentFragment;
|
|
1577
1531
|
let i = e.HTMLTemplateElement, a = e.Node, o = e.Element, s = e.NodeFilter;
|
|
@@ -1582,7 +1536,7 @@ function createDOMPurify() {
|
|
|
1582
1536
|
e.content && e.content.ownerDocument && (t = e.content.ownerDocument);
|
|
1583
1537
|
}
|
|
1584
1538
|
let T, E = "", re, O = !1, k = 0, ie = function _assertNotInTrustedTypesPolicy() {
|
|
1585
|
-
if (k > 0) throw
|
|
1539
|
+
if (k > 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.");
|
|
1586
1540
|
}, ae = function _createTrustedHTML(e) {
|
|
1587
1541
|
ie(), k++;
|
|
1588
1542
|
try {
|
|
@@ -1598,21 +1552,21 @@ function createDOMPurify() {
|
|
|
1598
1552
|
k--;
|
|
1599
1553
|
}
|
|
1600
1554
|
}, j = function _getDefaultTrustedTypesPolicy() {
|
|
1601
|
-
return O || (re =
|
|
1602
|
-
}, M = t, N = M.implementation, se = M.createNodeIterator, ce = M.createDocumentFragment, F = M.getElementsByTagName, z = n.importNode, B =
|
|
1603
|
-
DOMPurify.isSupported = typeof
|
|
1604
|
-
let le =
|
|
1605
|
-
...
|
|
1555
|
+
return O || (re = tn(p, r), O = !0), re;
|
|
1556
|
+
}, M = t, N = M.implementation, se = M.createNodeIterator, ce = M.createDocumentFragment, F = M.getElementsByTagName, z = n.importNode, B = nn();
|
|
1557
|
+
DOMPurify.isSupported = typeof et == "function" && typeof b == "function" && N && N.createHTMLDocument !== void 0;
|
|
1558
|
+
let le = zt, ue = Bt, de = Vt, he = Ht, ge = Ut, _e = Gt, ve = Kt, ye = Jt, Se = Wt, V = null, Ce = addToSet({}, [
|
|
1559
|
+
...Ot,
|
|
1560
|
+
...kt,
|
|
1561
|
+
...At,
|
|
1606
1562
|
...Mt,
|
|
1607
|
-
...
|
|
1608
|
-
...Ft,
|
|
1609
|
-
...Lt
|
|
1563
|
+
...Pt
|
|
1610
1564
|
]), H = null, W = addToSet({}, [
|
|
1611
|
-
...
|
|
1612
|
-
...
|
|
1613
|
-
...
|
|
1614
|
-
...
|
|
1615
|
-
]), G = Object.seal(
|
|
1565
|
+
...Ft,
|
|
1566
|
+
...It,
|
|
1567
|
+
...Lt,
|
|
1568
|
+
...Rt
|
|
1569
|
+
]), G = Object.seal(it(null, {
|
|
1616
1570
|
tagNameCheck: {
|
|
1617
1571
|
writable: !0,
|
|
1618
1572
|
configurable: !1,
|
|
@@ -1631,7 +1585,7 @@ function createDOMPurify() {
|
|
|
1631
1585
|
enumerable: !0,
|
|
1632
1586
|
value: !1
|
|
1633
1587
|
}
|
|
1634
|
-
})), we = null, Te = null, Ee = Object.seal(
|
|
1588
|
+
})), we = null, Te = null, Ee = Object.seal(it(null, {
|
|
1635
1589
|
tagCheck: {
|
|
1636
1590
|
writable: !0,
|
|
1637
1591
|
configurable: !1,
|
|
@@ -1666,42 +1620,42 @@ function createDOMPurify() {
|
|
|
1666
1620
|
"value",
|
|
1667
1621
|
"style",
|
|
1668
1622
|
"xmlns"
|
|
1669
|
-
]),
|
|
1670
|
-
et,
|
|
1623
|
+
]), tt = "http://www.w3.org/1998/Math/MathML", nt = "http://www.w3.org/2000/svg", K = "http://www.w3.org/1999/xhtml", rt = K, at = !1, ot = null, st = addToSet({}, [
|
|
1671
1624
|
tt,
|
|
1625
|
+
nt,
|
|
1672
1626
|
K
|
|
1673
|
-
],
|
|
1627
|
+
], mt), yt = q([
|
|
1674
1628
|
"mi",
|
|
1675
1629
|
"mo",
|
|
1676
1630
|
"mn",
|
|
1677
1631
|
"ms",
|
|
1678
1632
|
"mtext"
|
|
1679
|
-
]),
|
|
1633
|
+
]), St = addToSet({}, yt), Ct = q(["annotation-xml"]), wt = addToSet({}, Ct), Tt = addToSet({}, [
|
|
1680
1634
|
"title",
|
|
1681
1635
|
"style",
|
|
1682
1636
|
"font",
|
|
1683
1637
|
"a",
|
|
1684
1638
|
"script"
|
|
1685
|
-
]),
|
|
1639
|
+
]), an = null, on = ["application/xhtml+xml", "text/html"], Z = null, sn = null, cn = t.createElement("form"), ln = function isRegexOrFunction(e) {
|
|
1686
1640
|
return e instanceof RegExp || e instanceof Function;
|
|
1687
1641
|
}, un = function _parseConfig() {
|
|
1688
1642
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
1689
|
-
if (
|
|
1690
|
-
(!e || typeof e != "object") && (e = {}), e = clone(e),
|
|
1691
|
-
transform:
|
|
1643
|
+
if (sn && sn === e) return;
|
|
1644
|
+
(!e || typeof e != "object") && (e = {}), e = clone(e), an = on.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, Z = an === "application/xhtml+xml" ? mt : pt, V = rn(e, "ALLOWED_TAGS", Ce, { transform: Z }), H = rn(e, "ALLOWED_ATTR", W, { transform: Z }), ot = rn(e, "ALLOWED_NAMESPACES", st, { transform: mt }), Qe = rn(e, "ADD_URI_SAFE_ATTR", $e, {
|
|
1645
|
+
transform: Z,
|
|
1692
1646
|
base: $e
|
|
1693
|
-
}), Xe =
|
|
1694
|
-
transform:
|
|
1647
|
+
}), Xe = rn(e, "ADD_DATA_URI_TAGS", Ze, {
|
|
1648
|
+
transform: Z,
|
|
1695
1649
|
base: Ze
|
|
1696
|
-
}), Je =
|
|
1697
|
-
let t =
|
|
1698
|
-
if (G =
|
|
1650
|
+
}), Je = rn(e, "FORBID_CONTENTS", Ye, { transform: Z }), we = rn(e, "FORBID_TAGS", clone({}), { transform: Z }), Te = rn(e, "FORBID_ATTR", clone({}), { transform: Z }), qe = X(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, Oe = e.ALLOW_DATA_ATTR !== !1, ke = e.ALLOW_UNKNOWN_PROTOCOLS || !1, Ae = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, je = e.SAFE_FOR_TEMPLATES || !1, Me = e.SAFE_FOR_XML !== !1, Ne = e.WHOLE_DOCUMENT || !1, ze = e.RETURN_DOM || !1, Be = e.RETURN_DOM_FRAGMENT || !1, Ve = e.RETURN_TRUSTED_TYPE || !1, Le = e.FORCE_BODY || !1, He = e.SANITIZE_DOM !== !1, Ue = e.SANITIZE_NAMED_PROPS || !1, Ge = e.KEEP_CONTENT !== !1, Ke = e.IN_PLACE || !1, Se = isRegex(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : Wt, rt = typeof e.NAMESPACE == "string" ? e.NAMESPACE : K, St = X(e, "MATHML_TEXT_INTEGRATION_POINTS") && e.MATHML_TEXT_INTEGRATION_POINTS && typeof e.MATHML_TEXT_INTEGRATION_POINTS == "object" ? clone(e.MATHML_TEXT_INTEGRATION_POINTS) : addToSet({}, yt), wt = X(e, "HTML_INTEGRATION_POINTS") && e.HTML_INTEGRATION_POINTS && typeof e.HTML_INTEGRATION_POINTS == "object" ? clone(e.HTML_INTEGRATION_POINTS) : addToSet({}, Ct);
|
|
1651
|
+
let t = X(e, "CUSTOM_ELEMENT_HANDLING") && e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING == "object" ? clone(e.CUSTOM_ELEMENT_HANDLING) : it(null);
|
|
1652
|
+
if (G = it(null), X(t, "tagNameCheck") && ln(t.tagNameCheck) && (G.tagNameCheck = t.tagNameCheck), X(t, "attributeNameCheck") && ln(t.attributeNameCheck) && (G.attributeNameCheck = t.attributeNameCheck), X(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (G.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), J(G), je && (Oe = !1), Be && (ze = !0), qe && (V = addToSet({}, Pt), H = it(null), qe.html === !0 && (addToSet(V, Ot), addToSet(H, Ft)), qe.svg === !0 && (addToSet(V, kt), addToSet(H, It), addToSet(H, Rt)), qe.svgFilters === !0 && (addToSet(V, At), addToSet(H, It), addToSet(H, Rt)), qe.mathMl === !0 && (addToSet(V, Mt), addToSet(H, Lt), addToSet(H, Rt))), Ee.tagCheck = null, Ee.attributeCheck = null, X(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? Ee.tagCheck = e.ADD_TAGS : ft(e.ADD_TAGS) && (V === Ce && (V = clone(V)), addToSet(V, e.ADD_TAGS, Z))), X(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? Ee.attributeCheck = e.ADD_ATTR : ft(e.ADD_ATTR) && (H === W && (H = clone(H)), addToSet(H, e.ADD_ATTR, Z))), X(e, "ADD_URI_SAFE_ATTR") && ft(e.ADD_URI_SAFE_ATTR) && addToSet(Qe, e.ADD_URI_SAFE_ATTR, Z), X(e, "FORBID_CONTENTS") && ft(e.FORBID_CONTENTS) && (Je === Ye && (Je = clone(Je)), addToSet(Je, e.FORBID_CONTENTS, Z)), X(e, "ADD_FORBID_CONTENTS") && ft(e.ADD_FORBID_CONTENTS) && (Je === Ye && (Je = clone(Je)), addToSet(Je, e.ADD_FORBID_CONTENTS, Z)), Ge && (V["#text"] = !0), Ne && addToSet(V, [
|
|
1699
1653
|
"html",
|
|
1700
1654
|
"head",
|
|
1701
1655
|
"body"
|
|
1702
1656
|
]), V.table && (addToSet(V, ["tbody"]), delete we.tbody), e.TRUSTED_TYPES_POLICY) {
|
|
1703
|
-
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw
|
|
1704
|
-
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw
|
|
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.");
|
|
1705
1659
|
let t = T;
|
|
1706
1660
|
T = e.TRUSTED_TYPES_POLICY;
|
|
1707
1661
|
try {
|
|
@@ -1710,40 +1664,40 @@ function createDOMPurify() {
|
|
|
1710
1664
|
throw T = t, e;
|
|
1711
1665
|
}
|
|
1712
1666
|
} else e.TRUSTED_TYPES_POLICY === null ? (T = void 0, E = "") : (T === void 0 && (T = j()), T && typeof E == "string" && (E = ae("")));
|
|
1713
|
-
q && q(e),
|
|
1667
|
+
q && q(e), sn = e;
|
|
1714
1668
|
}, dn = addToSet({}, [
|
|
1715
|
-
...
|
|
1716
|
-
...
|
|
1717
|
-
...
|
|
1718
|
-
]), fn = addToSet({}, [...
|
|
1719
|
-
return t.namespaceURI === K ? e === "svg" : t.namespaceURI ===
|
|
1669
|
+
...kt,
|
|
1670
|
+
...At,
|
|
1671
|
+
...jt
|
|
1672
|
+
]), fn = addToSet({}, [...Mt, ...Nt]), pn = function _checkSvgNamespace(e, t, n) {
|
|
1673
|
+
return t.namespaceURI === K ? e === "svg" : t.namespaceURI === tt ? e === "svg" && (n === "annotation-xml" || St[n]) : !!dn[e];
|
|
1720
1674
|
}, mn = function _checkMathMlNamespace(e, t, n) {
|
|
1721
|
-
return t.namespaceURI === K ? e === "math" : t.namespaceURI ===
|
|
1675
|
+
return t.namespaceURI === K ? e === "math" : t.namespaceURI === nt ? e === "math" && wt[n] : !!fn[e];
|
|
1722
1676
|
}, hn = function _checkHtmlNamespace(e, t, n) {
|
|
1723
|
-
return t.namespaceURI ===
|
|
1677
|
+
return t.namespaceURI === nt && !wt[n] || t.namespaceURI === tt && !St[n] ? !1 : !fn[e] && (Tt[e] || !dn[e]);
|
|
1724
1678
|
}, gn = function _checkValidNamespace(e) {
|
|
1725
1679
|
let t = b(e);
|
|
1726
1680
|
(!t || !t.tagName) && (t = {
|
|
1727
|
-
namespaceURI:
|
|
1681
|
+
namespaceURI: rt,
|
|
1728
1682
|
tagName: "template"
|
|
1729
1683
|
});
|
|
1730
|
-
let n =
|
|
1731
|
-
return
|
|
1684
|
+
let n = pt(e.tagName), r = pt(t.tagName);
|
|
1685
|
+
return ot[e.namespaceURI] ? e.namespaceURI === nt ? pn(n, t, r) : e.namespaceURI === tt ? mn(n, t, r) : e.namespaceURI === K ? hn(n, t, r) : !!(an === "application/xhtml+xml" && ot[e.namespaceURI]) : !1;
|
|
1732
1686
|
}, _n = function _forceRemove(e) {
|
|
1733
|
-
|
|
1687
|
+
ut(DOMPurify.removed, { element: e });
|
|
1734
1688
|
try {
|
|
1735
1689
|
b(e).removeChild(e);
|
|
1736
1690
|
} catch {
|
|
1737
|
-
if (g(e), !b(e)) throw
|
|
1691
|
+
if (g(e), !b(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");
|
|
1738
1692
|
}
|
|
1739
1693
|
}, vn = function _neutralizeRoot(e) {
|
|
1740
1694
|
xn(e);
|
|
1741
1695
|
let t = v(e);
|
|
1742
1696
|
if (t) {
|
|
1743
1697
|
let e = [];
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
}),
|
|
1698
|
+
ct(t, (t) => {
|
|
1699
|
+
ut(e, t);
|
|
1700
|
+
}), ct(e, (e) => {
|
|
1747
1701
|
try {
|
|
1748
1702
|
g(e);
|
|
1749
1703
|
} catch {}
|
|
@@ -1758,12 +1712,12 @@ function createDOMPurify() {
|
|
|
1758
1712
|
}
|
|
1759
1713
|
}, yn = function _removeAttribute(e, t) {
|
|
1760
1714
|
try {
|
|
1761
|
-
|
|
1715
|
+
ut(DOMPurify.removed, {
|
|
1762
1716
|
attribute: t.getAttributeNode(e),
|
|
1763
1717
|
from: t
|
|
1764
1718
|
});
|
|
1765
1719
|
} catch {
|
|
1766
|
-
|
|
1720
|
+
ut(DOMPurify.removed, {
|
|
1767
1721
|
attribute: null,
|
|
1768
1722
|
from: t
|
|
1769
1723
|
});
|
|
@@ -1780,7 +1734,7 @@ function createDOMPurify() {
|
|
|
1780
1734
|
let t = S(e);
|
|
1781
1735
|
if (t) for (let n = t.length - 1; n >= 0; --n) {
|
|
1782
1736
|
let r = t[n], i = r && r.name;
|
|
1783
|
-
if (!(typeof i != "string" || H[
|
|
1737
|
+
if (!(typeof i != "string" || H[Z(i)])) try {
|
|
1784
1738
|
e.removeAttribute(i);
|
|
1785
1739
|
} catch {}
|
|
1786
1740
|
}
|
|
@@ -1788,7 +1742,7 @@ function createDOMPurify() {
|
|
|
1788
1742
|
let t = [e];
|
|
1789
1743
|
for (; t.length > 0;) {
|
|
1790
1744
|
let e = t.pop();
|
|
1791
|
-
(C ? C(e) : e.nodeType) ===
|
|
1745
|
+
(C ? C(e) : e.nodeType) === $t.element && bn(e);
|
|
1792
1746
|
let n = v(e);
|
|
1793
1747
|
if (n) for (let e = n.length - 1; e >= 0; --e) t.push(n[e]);
|
|
1794
1748
|
}
|
|
@@ -1797,14 +1751,14 @@ function createDOMPurify() {
|
|
|
1797
1751
|
let t = [e];
|
|
1798
1752
|
for (; t.length > 0;) {
|
|
1799
1753
|
let e = t.pop(), n = C ? C(e) : e.nodeType;
|
|
1800
|
-
if (n ===
|
|
1754
|
+
if (n === $t.processingInstruction || n === $t.comment && Et(Xt, e.data)) {
|
|
1801
1755
|
try {
|
|
1802
1756
|
g(e);
|
|
1803
1757
|
} catch {}
|
|
1804
1758
|
continue;
|
|
1805
1759
|
}
|
|
1806
|
-
if (n ===
|
|
1807
|
-
let t = e, n =
|
|
1760
|
+
if (n === $t.element) {
|
|
1761
|
+
let t = e, n = Z(w ? w(e) : e.nodeName);
|
|
1808
1762
|
try {
|
|
1809
1763
|
t.hasAttribute && t.hasAttribute("patchsrc") && t.removeAttribute("patchsrc"), t.hasAttribute && t.hasAttribute("for") && n !== "label" && n !== "output" && t.removeAttribute("for");
|
|
1810
1764
|
} catch {}
|
|
@@ -1816,41 +1770,41 @@ function createDOMPurify() {
|
|
|
1816
1770
|
let n = null, r = null;
|
|
1817
1771
|
if (Le) e = "<remove></remove>" + e;
|
|
1818
1772
|
else {
|
|
1819
|
-
let t =
|
|
1773
|
+
let t = ht(e, /^[\r\n\t ]+/);
|
|
1820
1774
|
r = t && t[0];
|
|
1821
1775
|
}
|
|
1822
|
-
|
|
1776
|
+
an === "application/xhtml+xml" && rt === K && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
|
|
1823
1777
|
let i = T ? ae(e) : e;
|
|
1824
|
-
if (
|
|
1825
|
-
n = new c().parseFromString(i,
|
|
1778
|
+
if (rt === K) try {
|
|
1779
|
+
n = new c().parseFromString(i, an);
|
|
1826
1780
|
} catch {}
|
|
1827
1781
|
if (!n || !n.documentElement) {
|
|
1828
|
-
n = N.createDocument(
|
|
1782
|
+
n = N.createDocument(rt, "template", null);
|
|
1829
1783
|
try {
|
|
1830
|
-
n.documentElement.innerHTML =
|
|
1784
|
+
n.documentElement.innerHTML = at ? E : i;
|
|
1831
1785
|
} catch {}
|
|
1832
1786
|
}
|
|
1833
1787
|
let a = n.body || n.documentElement;
|
|
1834
|
-
return e && r && a.insertBefore(t.createTextNode(r), a.childNodes[0] || null),
|
|
1788
|
+
return e && r && a.insertBefore(t.createTextNode(r), a.childNodes[0] || null), rt === K ? F.call(n, Ne ? "html" : "body")[0] : Ne ? n.documentElement : a;
|
|
1835
1789
|
}, wn = function _createNodeIterator(e) {
|
|
1836
1790
|
return se.call(e.ownerDocument || e, e, s.SHOW_ELEMENT | s.SHOW_COMMENT | s.SHOW_TEXT | s.SHOW_PROCESSING_INSTRUCTION | s.SHOW_CDATA_SECTION, null);
|
|
1837
1791
|
}, Tn = function _stripTemplateExpressions(e) {
|
|
1838
|
-
return e =
|
|
1792
|
+
return e = gt(e, le, " "), e = gt(e, ue, " "), e = gt(e, de, " "), e;
|
|
1839
1793
|
}, En = function _scrubTemplateExpressions(e) {
|
|
1840
1794
|
e.normalize();
|
|
1841
1795
|
let t = se.call(e.ownerDocument || e, e, s.SHOW_TEXT | s.SHOW_COMMENT | s.SHOW_CDATA_SECTION | s.SHOW_PROCESSING_INSTRUCTION, null), n = t.nextNode();
|
|
1842
1796
|
for (; n;) n.data = Tn(n.data), n = t.nextNode();
|
|
1843
1797
|
let r = e.querySelectorAll?.call(e, "template");
|
|
1844
|
-
r &&
|
|
1798
|
+
r && ct(r, (e) => {
|
|
1845
1799
|
On(e.content) && En(e.content);
|
|
1846
1800
|
});
|
|
1847
1801
|
}, Dn = function _isClobbered(e) {
|
|
1848
1802
|
let t = w ? w(e) : null;
|
|
1849
|
-
return typeof t != "string" ||
|
|
1803
|
+
return typeof t != "string" || Z(t) !== "form" ? !1 : typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || e.attributes !== S(e) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function" || e.nodeType !== C(e) || e.childNodes !== v(e);
|
|
1850
1804
|
}, On = function _isDocumentFragment(e) {
|
|
1851
1805
|
if (!C || typeof e != "object" || !e) return !1;
|
|
1852
1806
|
try {
|
|
1853
|
-
return C(e) ===
|
|
1807
|
+
return C(e) === $t.documentFragment;
|
|
1854
1808
|
} catch {
|
|
1855
1809
|
return !1;
|
|
1856
1810
|
}
|
|
@@ -1863,14 +1817,14 @@ function createDOMPurify() {
|
|
|
1863
1817
|
}
|
|
1864
1818
|
};
|
|
1865
1819
|
function _executeHooks(e, t, n) {
|
|
1866
|
-
e.length !== 0 &&
|
|
1867
|
-
e.call(DOMPurify, t, n,
|
|
1820
|
+
e.length !== 0 && ct(e, (e) => {
|
|
1821
|
+
e.call(DOMPurify, t, n, sn);
|
|
1868
1822
|
});
|
|
1869
1823
|
}
|
|
1870
1824
|
let An = function _isUnsafeNode(e, t) {
|
|
1871
|
-
return !!(Me && e.hasChildNodes() && !kn(e.firstElementChild) &&
|
|
1825
|
+
return !!(Me && e.hasChildNodes() && !kn(e.firstElementChild) && Et(Yt, e.textContent) && Et(Yt, e.innerHTML) || Me && e.namespaceURI === K && t === "style" && kn(e.firstElementChild) || e.nodeType === $t.processingInstruction || Me && e.nodeType === $t.comment && Et(Xt, e.data));
|
|
1872
1826
|
}, jn = function _sanitizeDisallowedNode(e, t) {
|
|
1873
|
-
if (!we[t] && Fn(t) && (G.tagNameCheck instanceof RegExp &&
|
|
1827
|
+
if (!we[t] && Fn(t) && (G.tagNameCheck instanceof RegExp && Et(G.tagNameCheck, t) || G.tagNameCheck instanceof Function && G.tagNameCheck(t))) return !1;
|
|
1874
1828
|
if (Ge && !Je[t]) {
|
|
1875
1829
|
let t = b(e), n = v(e);
|
|
1876
1830
|
if (n && t) {
|
|
@@ -1885,7 +1839,7 @@ function createDOMPurify() {
|
|
|
1885
1839
|
}, Mn = function _sanitizeElements(e, t) {
|
|
1886
1840
|
if (_executeHooks(B.beforeSanitizeElements, e, null), e !== t && b(e) === null) return !0;
|
|
1887
1841
|
if (Dn(e)) return _n(e), !0;
|
|
1888
|
-
let n =
|
|
1842
|
+
let n = Z(w ? w(e) : e.nodeName);
|
|
1889
1843
|
if (_executeHooks(B.uponSanitizeElement, e, {
|
|
1890
1844
|
tagName: n,
|
|
1891
1845
|
allowedTags: V
|
|
@@ -1895,19 +1849,19 @@ function createDOMPurify() {
|
|
|
1895
1849
|
let t = jn(e, n);
|
|
1896
1850
|
return t === !1 && _executeHooks(B.afterSanitizeElements, e, null), t;
|
|
1897
1851
|
}
|
|
1898
|
-
if ((C ? C(e) : e.nodeType) ===
|
|
1899
|
-
if (je && e.nodeType ===
|
|
1852
|
+
if ((C ? C(e) : e.nodeType) === $t.element && !gn(e) || (n === "noscript" || n === "noembed" || n === "noframes") && Et(Zt, e.innerHTML)) return _n(e), !0;
|
|
1853
|
+
if (je && e.nodeType === $t.text) {
|
|
1900
1854
|
let t = Tn(e.textContent);
|
|
1901
|
-
e.textContent !== t && (
|
|
1855
|
+
e.textContent !== t && (ut(DOMPurify.removed, { element: e.cloneNode() }), e.textContent = t);
|
|
1902
1856
|
}
|
|
1903
1857
|
return _executeHooks(B.afterSanitizeElements, e, null), !1;
|
|
1904
1858
|
}, Nn = function _isValidAttribute(e, n, r) {
|
|
1905
1859
|
if (Te[n] || Me && n === "patchsrc" || Me && n === "for" && e !== "label" && e !== "output" || He && (n === "id" || n === "name") && (r in t || r in cn)) return !1;
|
|
1906
1860
|
let i = H[n] || Ee.attributeCheck instanceof Function && Ee.attributeCheck(n, e);
|
|
1907
|
-
if (!(Oe &&
|
|
1861
|
+
if (!(Oe && Et(he, n)) && !(De && Et(ge, n))) {
|
|
1908
1862
|
if (!i) {
|
|
1909
|
-
if (!(Fn(e) && (G.tagNameCheck instanceof RegExp &&
|
|
1910
|
-
} else if (!Qe[n] && !
|
|
1863
|
+
if (!(Fn(e) && (G.tagNameCheck instanceof RegExp && Et(G.tagNameCheck, e) || G.tagNameCheck instanceof Function && G.tagNameCheck(e)) && (G.attributeNameCheck instanceof RegExp && Et(G.attributeNameCheck, n) || G.attributeNameCheck instanceof Function && G.attributeNameCheck(n, e)) || n === "is" && G.allowCustomizedBuiltInElements && (G.tagNameCheck instanceof RegExp && Et(G.tagNameCheck, r) || G.tagNameCheck instanceof Function && G.tagNameCheck(r)))) return !1;
|
|
1864
|
+
} else if (!Qe[n] && !Et(Se, gt(r, ve, "")) && (n !== "src" && n !== "xlink:href" && n !== "href" || e === "script" || _t(r, "data:") !== 0 || !Xe[e]) && (!ke || Et(_e, gt(r, ve, ""))) && r) return !1;
|
|
1911
1865
|
}
|
|
1912
1866
|
return !0;
|
|
1913
1867
|
}, Pn = addToSet({}, [
|
|
@@ -1920,7 +1874,7 @@ function createDOMPurify() {
|
|
|
1920
1874
|
"font-face-uri",
|
|
1921
1875
|
"missing-glyph"
|
|
1922
1876
|
]), Fn = function _isBasicCustomElement(e) {
|
|
1923
|
-
return !Pn[
|
|
1877
|
+
return !Pn[pt(e)] && Et(ye, e);
|
|
1924
1878
|
}, In = function _applyTrustedTypesToAttribute(e, t, n, r) {
|
|
1925
1879
|
if (T && typeof p == "object" && typeof p.getAttributeType == "function" && !n) switch (p.getAttributeType(e, t)) {
|
|
1926
1880
|
case "TrustedHTML": return ae(r);
|
|
@@ -1929,7 +1883,7 @@ function createDOMPurify() {
|
|
|
1929
1883
|
return r;
|
|
1930
1884
|
}, Ln = function _setAttributeValue(e, t, n, r) {
|
|
1931
1885
|
try {
|
|
1932
|
-
n ? e.setAttributeNS(n, t, r) : e.setAttribute(t, r), Dn(e) ? _n(e) :
|
|
1886
|
+
n ? e.setAttributeNS(n, t, r) : e.setAttribute(t, r), Dn(e) ? _n(e) : lt(DOMPurify.removed);
|
|
1933
1887
|
} catch {
|
|
1934
1888
|
yn(t, e);
|
|
1935
1889
|
}
|
|
@@ -1943,14 +1897,14 @@ function createDOMPurify() {
|
|
|
1943
1897
|
keepAttr: !0,
|
|
1944
1898
|
allowedAttributes: H,
|
|
1945
1899
|
forceKeepAttr: void 0
|
|
1946
|
-
}, r = t.length, i =
|
|
1900
|
+
}, r = t.length, i = Z(e.nodeName);
|
|
1947
1901
|
for (; r--;) {
|
|
1948
|
-
let a = t[r], o = a.name, s = a.namespaceURI, c = a.value, p =
|
|
1949
|
-
if (n.attrName = p, n.attrValue = h, n.keepAttr = !0, n.forceKeepAttr = void 0, _executeHooks(B.uponSanitizeAttribute, e, n), h = n.attrValue, Ue && (p === "id" || p === "name") &&
|
|
1902
|
+
let a = t[r], o = a.name, s = a.namespaceURI, c = a.value, p = Z(o), m = c, h = o === "value" ? m : vt(m);
|
|
1903
|
+
if (n.attrName = p, n.attrValue = h, n.keepAttr = !0, n.forceKeepAttr = void 0, _executeHooks(B.uponSanitizeAttribute, e, n), h = n.attrValue, Ue && (p === "id" || p === "name") && _t(h, We) !== 0 && (yn(o, e), h = We + h), Me && Et(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, h)) {
|
|
1950
1904
|
yn(o, e);
|
|
1951
1905
|
continue;
|
|
1952
1906
|
}
|
|
1953
|
-
if (p === "attributename" &&
|
|
1907
|
+
if (p === "attributename" && ht(h, "href")) {
|
|
1954
1908
|
yn(o, e);
|
|
1955
1909
|
continue;
|
|
1956
1910
|
}
|
|
@@ -1959,7 +1913,7 @@ function createDOMPurify() {
|
|
|
1959
1913
|
yn(o, e);
|
|
1960
1914
|
continue;
|
|
1961
1915
|
}
|
|
1962
|
-
if (!Ae &&
|
|
1916
|
+
if (!Ae && Et(Qt, h)) {
|
|
1963
1917
|
yn(o, e);
|
|
1964
1918
|
continue;
|
|
1965
1919
|
}
|
|
@@ -1973,7 +1927,7 @@ function createDOMPurify() {
|
|
|
1973
1927
|
_executeHooks(B.afterSanitizeAttributes, e, null);
|
|
1974
1928
|
}, zn = function _sanitizeShadowDOM(e) {
|
|
1975
1929
|
let t = null, n = wn(e);
|
|
1976
|
-
for (_executeHooks(B.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) if (_executeHooks(B.uponSanitizeShadowNode, t, null), Mn(t, e), Rn(t), On(t.content) && zn(t.content), (C ? C(t) : t.nodeType) ===
|
|
1930
|
+
for (_executeHooks(B.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) if (_executeHooks(B.uponSanitizeShadowNode, t, null), Mn(t, e), Rn(t), On(t.content) && zn(t.content), (C ? C(t) : t.nodeType) === $t.element) {
|
|
1977
1931
|
let e = x(t);
|
|
1978
1932
|
On(e) && (Bn(e), zn(e));
|
|
1979
1933
|
}
|
|
@@ -1989,14 +1943,14 @@ function createDOMPurify() {
|
|
|
1989
1943
|
zn(e.shadow);
|
|
1990
1944
|
continue;
|
|
1991
1945
|
}
|
|
1992
|
-
let n = e.node, r = (C ? C(n) : n.nodeType) ===
|
|
1946
|
+
let n = e.node, r = (C ? C(n) : n.nodeType) === $t.element, i = v(n);
|
|
1993
1947
|
if (i) for (let e = i.length - 1; e >= 0; --e) t.push({
|
|
1994
1948
|
node: i[e],
|
|
1995
1949
|
shadow: null
|
|
1996
1950
|
});
|
|
1997
1951
|
if (r) {
|
|
1998
1952
|
let e = w ? w(n) : null;
|
|
1999
|
-
if (typeof e == "string" &&
|
|
1953
|
+
if (typeof e == "string" && Z(e) === "template") {
|
|
2000
1954
|
let e = n.content;
|
|
2001
1955
|
On(e) && t.push({
|
|
2002
1956
|
node: e,
|
|
@@ -2018,7 +1972,7 @@ function createDOMPurify() {
|
|
|
2018
1972
|
};
|
|
2019
1973
|
return DOMPurify.sanitize = function(e) {
|
|
2020
1974
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = null, i = null, a = null, o = null;
|
|
2021
|
-
if (
|
|
1975
|
+
if (at = !e, at && (e = "<!-->"), typeof e != "string" && !kn(e) && (e = stringifyValue(e), typeof e != "string")) throw Dt("dirty is not a string, aborting");
|
|
2022
1976
|
if (!DOMPurify.isSupported) return e;
|
|
2023
1977
|
Pe ? (V = Fe, H = Ie) : un(t), (B.uponSanitizeElement.length > 0 || B.uponSanitizeAttribute.length > 0) && (V = clone(V)), B.uponSanitizeAttribute.length > 0 && (H = clone(H)), DOMPurify.removed = [];
|
|
2024
1978
|
let s = Ke && typeof e != "string" && kn(e);
|
|
@@ -2026,16 +1980,16 @@ function createDOMPurify() {
|
|
|
2026
1980
|
Sn(e);
|
|
2027
1981
|
let t = w ? w(e) : e.nodeName;
|
|
2028
1982
|
if (typeof t == "string") {
|
|
2029
|
-
let n =
|
|
2030
|
-
if (!V[n] || we[n]) throw vn(e),
|
|
1983
|
+
let n = Z(t);
|
|
1984
|
+
if (!V[n] || we[n]) throw vn(e), Dt("root node is forbidden and cannot be sanitized in-place");
|
|
2031
1985
|
}
|
|
2032
|
-
if (Dn(e)) throw vn(e),
|
|
1986
|
+
if (Dn(e)) throw vn(e), Dt("root node is clobbered and cannot be sanitized in-place");
|
|
2033
1987
|
try {
|
|
2034
1988
|
Bn(e);
|
|
2035
1989
|
} catch (t) {
|
|
2036
1990
|
throw vn(e), t;
|
|
2037
1991
|
}
|
|
2038
|
-
} else if (kn(e)) r = Cn("<!---->"), i = r.ownerDocument.importNode(e, !0), i.nodeType ===
|
|
1992
|
+
} else if (kn(e)) r = Cn("<!---->"), i = r.ownerDocument.importNode(e, !0), i.nodeType === $t.element && i.nodeName === "BODY" || i.nodeName === "HTML" ? r = i : r.appendChild(i), Bn(i);
|
|
2039
1993
|
else {
|
|
2040
1994
|
if (!ze && !je && !Ne && e.indexOf("<") === -1) return T && Ve ? ae(e) : e;
|
|
2041
1995
|
if (r = Cn(e), !r) return ze ? null : Ve ? E : "";
|
|
@@ -2045,11 +1999,11 @@ function createDOMPurify() {
|
|
|
2045
1999
|
try {
|
|
2046
2000
|
for (; a = p.nextNode();) Mn(a, c), Rn(a), On(a.content) && zn(a.content);
|
|
2047
2001
|
} catch (t) {
|
|
2048
|
-
throw s && (vn(e),
|
|
2002
|
+
throw s && (vn(e), ct(DOMPurify.removed, (e) => {
|
|
2049
2003
|
e.element && xn(e.element);
|
|
2050
2004
|
})), t;
|
|
2051
2005
|
}
|
|
2052
|
-
if (s) return
|
|
2006
|
+
if (s) return ct(DOMPurify.removed, (e) => {
|
|
2053
2007
|
e.element && xn(e.element);
|
|
2054
2008
|
}), je && En(e), e;
|
|
2055
2009
|
if (ze) {
|
|
@@ -2058,33 +2012,33 @@ function createDOMPurify() {
|
|
|
2058
2012
|
return (H.shadowroot || H.shadowrootmode) && (o = z.call(n, o, !0)), o;
|
|
2059
2013
|
}
|
|
2060
2014
|
let m = Ne ? r.outerHTML : r.innerHTML;
|
|
2061
|
-
return Ne && V["!doctype"] && r.ownerDocument && r.ownerDocument.doctype && r.ownerDocument.doctype.name &&
|
|
2015
|
+
return Ne && V["!doctype"] && r.ownerDocument && r.ownerDocument.doctype && r.ownerDocument.doctype.name && Et(qt, r.ownerDocument.doctype.name) && (m = "<!DOCTYPE " + r.ownerDocument.doctype.name + ">\n" + m), je && (m = Tn(m)), T && Ve ? ae(m) : m;
|
|
2062
2016
|
}, DOMPurify.setConfig = function() {
|
|
2063
2017
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2064
2018
|
un(e), Pe = !0, Fe = V, Ie = H;
|
|
2065
2019
|
}, DOMPurify.clearConfig = function() {
|
|
2066
|
-
|
|
2020
|
+
sn = null, Pe = !1, Fe = null, Ie = null, T = re, E = "";
|
|
2067
2021
|
}, DOMPurify.isValidAttribute = function(e, t, n) {
|
|
2068
|
-
|
|
2069
|
-
let r =
|
|
2022
|
+
sn || un({});
|
|
2023
|
+
let r = Z(e), i = Z(t);
|
|
2070
2024
|
return Nn(r, i, n);
|
|
2071
2025
|
}, DOMPurify.addHook = function(e, t) {
|
|
2072
|
-
typeof t == "function" &&
|
|
2026
|
+
typeof t == "function" && X(B, e) && ut(B[e], t);
|
|
2073
2027
|
}, DOMPurify.removeHook = function(e, t) {
|
|
2074
|
-
if (
|
|
2028
|
+
if (X(B, e)) {
|
|
2075
2029
|
if (t !== void 0) {
|
|
2076
|
-
let n =
|
|
2077
|
-
return n === -1 ? void 0 :
|
|
2030
|
+
let n = Y(B[e], t);
|
|
2031
|
+
return n === -1 ? void 0 : dt(B[e], n, 1)[0];
|
|
2078
2032
|
}
|
|
2079
|
-
return
|
|
2033
|
+
return lt(B[e]);
|
|
2080
2034
|
}
|
|
2081
2035
|
}, DOMPurify.removeHooks = function(e) {
|
|
2082
|
-
|
|
2036
|
+
X(B, e) && (B[e] = []);
|
|
2083
2037
|
}, DOMPurify.removeAllHooks = function() {
|
|
2084
|
-
B =
|
|
2038
|
+
B = nn();
|
|
2085
2039
|
}, DOMPurify;
|
|
2086
2040
|
}
|
|
2087
|
-
var
|
|
2041
|
+
var an = createDOMPurify(), _Class;
|
|
2088
2042
|
function A() {
|
|
2089
2043
|
return {
|
|
2090
2044
|
async: !1,
|
|
@@ -2099,11 +2053,11 @@ function A() {
|
|
|
2099
2053
|
walkTokens: null
|
|
2100
2054
|
};
|
|
2101
2055
|
}
|
|
2102
|
-
var
|
|
2056
|
+
var on = A();
|
|
2103
2057
|
function U(e) {
|
|
2104
|
-
|
|
2058
|
+
on = e;
|
|
2105
2059
|
}
|
|
2106
|
-
var
|
|
2060
|
+
var Z = { exec: () => null };
|
|
2107
2061
|
function I(e) {
|
|
2108
2062
|
let t = [];
|
|
2109
2063
|
return (n) => {
|
|
@@ -2115,19 +2069,19 @@ function d(e, t = "") {
|
|
|
2115
2069
|
let n = typeof e == "string" ? e : e.source, r = {
|
|
2116
2070
|
replace: (e, t) => {
|
|
2117
2071
|
let i = typeof t == "string" ? t : t.source;
|
|
2118
|
-
return i = i.replace(
|
|
2072
|
+
return i = i.replace(cn.caret, "$1"), n = n.replace(e, i), r;
|
|
2119
2073
|
},
|
|
2120
2074
|
getRegex: () => new RegExp(n, t)
|
|
2121
2075
|
};
|
|
2122
2076
|
return r;
|
|
2123
2077
|
}
|
|
2124
|
-
var
|
|
2078
|
+
var sn = ((e = "") => {
|
|
2125
2079
|
try {
|
|
2126
2080
|
return !!RegExp("(?<=1)(?<!1)" + e);
|
|
2127
2081
|
} catch {
|
|
2128
2082
|
return !1;
|
|
2129
2083
|
}
|
|
2130
|
-
})(),
|
|
2084
|
+
})(), cn = {
|
|
2131
2085
|
codeRemoveIndent: /^(?: {0,3}\t| {1,4})/gm,
|
|
2132
2086
|
outputLinkReplace: /\\([\[\]])/g,
|
|
2133
2087
|
indentCodeCompensation: /^(\s+)(?:```)/,
|
|
@@ -2183,119 +2137,119 @@ var dn = ((e = "") => {
|
|
|
2183
2137
|
hrRegex: I((e) => RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),
|
|
2184
2138
|
fencesBeginRegex: I((e) => RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),
|
|
2185
2139
|
headingBeginRegex: I((e) => RegExp(`^ {0,${e}}#`)),
|
|
2186
|
-
htmlBeginRegex: I((e) => RegExp(`^ {0,${e}}(?:</?(?:${
|
|
2140
|
+
htmlBeginRegex: I((e) => RegExp(`^ {0,${e}}(?:</?(?:${Cn})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`, "i")),
|
|
2187
2141
|
blockquoteBeginRegex: I((e) => RegExp(`^ {0,${e}}>`))
|
|
2188
|
-
},
|
|
2189
|
-
blockquote: d(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",
|
|
2190
|
-
code:
|
|
2191
|
-
def:
|
|
2192
|
-
fences:
|
|
2193
|
-
heading:
|
|
2194
|
-
hr:
|
|
2195
|
-
html:
|
|
2196
|
-
lheading:
|
|
2197
|
-
list:
|
|
2198
|
-
newline:
|
|
2199
|
-
paragraph:
|
|
2200
|
-
table:
|
|
2201
|
-
text:
|
|
2202
|
-
},
|
|
2203
|
-
...
|
|
2204
|
-
lheading:
|
|
2205
|
-
table:
|
|
2206
|
-
paragraph: d(
|
|
2207
|
-
},
|
|
2208
|
-
...
|
|
2209
|
-
html: d("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",
|
|
2142
|
+
}, ln = /^(?:[ \t]*(?:\n|$))+/, un = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, dn = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, fn = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, pn = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, mn = / {0,3}(?:[*+-]|\d{1,9}[.)])/, hn = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, gn = d(hn).replace(/bull/g, mn).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(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), _n = d(hn).replace(/bull/g, mn).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(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), vn = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/, yn = /^[^\n]+/, bn = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, xn = d(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", bn).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Sn = d(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, mn).getRegex(), Cn = "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", wn = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Tn = d("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][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", wn).replace("tag", Cn).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), pe = (e) => d(vn).replace("hr", fn).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", Cn).getRegex(), En = pe(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/), Dn = pe(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/), On = {
|
|
2143
|
+
blockquote: d(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Dn).getRegex(),
|
|
2144
|
+
code: un,
|
|
2145
|
+
def: xn,
|
|
2146
|
+
fences: dn,
|
|
2147
|
+
heading: pn,
|
|
2148
|
+
hr: fn,
|
|
2149
|
+
html: Tn,
|
|
2150
|
+
lheading: gn,
|
|
2151
|
+
list: Sn,
|
|
2152
|
+
newline: ln,
|
|
2153
|
+
paragraph: En,
|
|
2154
|
+
table: Z,
|
|
2155
|
+
text: yn
|
|
2156
|
+
}, kn = d("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", fn).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", Cn).getRegex(), An = {
|
|
2157
|
+
...On,
|
|
2158
|
+
lheading: _n,
|
|
2159
|
+
table: kn,
|
|
2160
|
+
paragraph: d(vn).replace("hr", fn).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", kn).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", Cn).getRegex()
|
|
2161
|
+
}, jn = {
|
|
2162
|
+
...On,
|
|
2163
|
+
html: d("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", wn).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(),
|
|
2210
2164
|
def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
|
|
2211
2165
|
heading: /^(#{1,6})(.*)(?:\n+|$)/,
|
|
2212
|
-
fences:
|
|
2166
|
+
fences: Z,
|
|
2213
2167
|
lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
|
|
2214
|
-
paragraph: d(
|
|
2215
|
-
},
|
|
2216
|
-
_backpedal:
|
|
2217
|
-
anyPunctuation:
|
|
2218
|
-
autolink:
|
|
2219
|
-
blockSkip:
|
|
2220
|
-
br:
|
|
2221
|
-
code:
|
|
2222
|
-
del:
|
|
2223
|
-
delLDelim:
|
|
2224
|
-
delRDelim:
|
|
2225
|
-
emStrongLDelim:
|
|
2226
|
-
emStrongRDelimAst:
|
|
2227
|
-
emStrongRDelimUnd:
|
|
2228
|
-
escape:
|
|
2229
|
-
link:
|
|
2230
|
-
nolink:
|
|
2231
|
-
punctuation:
|
|
2232
|
-
reflink:
|
|
2233
|
-
reflinkSearch:
|
|
2234
|
-
tag:
|
|
2235
|
-
text:
|
|
2236
|
-
url:
|
|
2237
|
-
},
|
|
2238
|
-
...
|
|
2239
|
-
emStrongLDelim:
|
|
2240
|
-
emStrongRDelimAst:
|
|
2241
|
-
emStrongRDelimUnd:
|
|
2242
|
-
link: d(/^!?\[(label)\]\((.*?)\)/).replace("label",
|
|
2243
|
-
reflink: d(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",
|
|
2244
|
-
},
|
|
2245
|
-
...
|
|
2246
|
-
emStrongRDelimAst:
|
|
2247
|
-
emStrongLDelim:
|
|
2248
|
-
delLDelim:
|
|
2249
|
-
delRDelim:
|
|
2250
|
-
url: d(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",
|
|
2168
|
+
paragraph: d(vn).replace("hr", fn).replace("heading", " *#{1,6} *[^\n]").replace("lheading", gn).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
|
|
2169
|
+
}, Mn = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Nn = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Pn = /^( {2,}|\\)\n(?!\s*$)[ \t]*/, Fn = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, In = /[\p{P}\p{S}]/u, Ln = /[\s\p{P}\p{S}]/u, Rn = /[^\s\p{P}\p{S}]/u, zn = d(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Ln).getRegex(), Bn = /[\p{Pi}\p{Ps}"']/u, Vn = /(?!~)[\p{P}\p{S}]/u, Hn = /(?!~)[\s\p{P}\p{S}]/u, Un = /(?:[^\s\p{P}\p{S}]|~)/u, Wn = d(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", sn ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), Gn = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, Kn = d(Gn, "u").replace(/punct/g, In).getRegex(), qn = d(Gn, "u").replace(/punct/g, Vn).getRegex(), Jn = d(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/, "u").replace(/openQuote/g, Bn).replace(/punct/g, In).getRegex(), Yn = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Xn = d(Yn, "gu").replace(/notPunctSpace/g, Rn).replace(/punctSpace/g, Ln).replace(/punct/g, In).getRegex(), Zn = d(Yn, "gu").replace(/notPunctSpace/g, Un).replace(/punctSpace/g, Hn).replace(/punct/g, Vn).getRegex(), Qn = d("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Rn).replace(/punctSpace/g, Ln).replace(/punct/g, In).getRegex(), $n = d("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, Rn).replace(/punctSpace/g, Ln).replace(/punct/g, In).getRegex(), er = d("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Rn).replace(/punctSpace/g, Ln).replace(/punct/g, In).getRegex(), tr = d(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, In).getRegex(), nr = d("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Rn).replace(/punctSpace/g, Ln).replace(/punct/g, In).getRegex(), rr = d(/\\(punct)/, "gu").replace(/punct/g, In).getRegex(), ir = d(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), ar = d(wn).replace("(?:-->|$)", "-->").getRegex(), or = d("^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", ar).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), sr = /\[(?:\\[\s\S]|[^\[\]\\])*\]/, cr = d(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets", sr).getRegex(), lr = d(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", cr).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), ur = d(/^!?\[(label)\]\[(ref)\]/).replace("label", cr).replace("ref", bn).getRegex(), dr = d(/^!?\[(ref)\](?:\[\])?/).replace("ref", bn).getRegex(), fr = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/, pr = d(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets", sr).getRegex(), mr = d("reflink|nolink(?!\\()", "g").replace("reflink", d(/^!?\[(label)\]\[(ref)\]/).replace("label", pr).replace("ref", fr).getRegex()).replace("nolink", d(/^!?\[(ref)\](?:\[\])?/).replace("ref", fr).getRegex()).getRegex(), hr = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, gr = {
|
|
2170
|
+
_backpedal: Z,
|
|
2171
|
+
anyPunctuation: rr,
|
|
2172
|
+
autolink: ir,
|
|
2173
|
+
blockSkip: Wn,
|
|
2174
|
+
br: Pn,
|
|
2175
|
+
code: Nn,
|
|
2176
|
+
del: Z,
|
|
2177
|
+
delLDelim: Z,
|
|
2178
|
+
delRDelim: Z,
|
|
2179
|
+
emStrongLDelim: Kn,
|
|
2180
|
+
emStrongRDelimAst: Xn,
|
|
2181
|
+
emStrongRDelimUnd: $n,
|
|
2182
|
+
escape: Mn,
|
|
2183
|
+
link: lr,
|
|
2184
|
+
nolink: dr,
|
|
2185
|
+
punctuation: zn,
|
|
2186
|
+
reflink: ur,
|
|
2187
|
+
reflinkSearch: mr,
|
|
2188
|
+
tag: or,
|
|
2189
|
+
text: Fn,
|
|
2190
|
+
url: Z
|
|
2191
|
+
}, _r = {
|
|
2192
|
+
...gr,
|
|
2193
|
+
emStrongLDelim: Jn,
|
|
2194
|
+
emStrongRDelimAst: Qn,
|
|
2195
|
+
emStrongRDelimUnd: er,
|
|
2196
|
+
link: d(/^!?\[(label)\]\((.*?)\)/).replace("label", cr).getRegex(),
|
|
2197
|
+
reflink: d(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", cr).getRegex()
|
|
2198
|
+
}, vr = {
|
|
2199
|
+
...gr,
|
|
2200
|
+
emStrongRDelimAst: Zn,
|
|
2201
|
+
emStrongLDelim: qn,
|
|
2202
|
+
delLDelim: tr,
|
|
2203
|
+
delRDelim: nr,
|
|
2204
|
+
url: d(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", hr).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),
|
|
2251
2205
|
_backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
|
|
2252
2206
|
del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
|
|
2253
|
-
text: d(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",
|
|
2254
|
-
},
|
|
2255
|
-
...
|
|
2256
|
-
br: d(
|
|
2257
|
-
text: d(
|
|
2258
|
-
},
|
|
2259
|
-
normal:
|
|
2260
|
-
gfm:
|
|
2261
|
-
pedantic:
|
|
2262
|
-
},
|
|
2263
|
-
normal:
|
|
2264
|
-
gfm:
|
|
2265
|
-
breaks:
|
|
2266
|
-
pedantic:
|
|
2267
|
-
},
|
|
2207
|
+
text: d(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", hr).getRegex()
|
|
2208
|
+
}, yr = {
|
|
2209
|
+
...vr,
|
|
2210
|
+
br: d(Pn).replace("{2,}", "*").getRegex(),
|
|
2211
|
+
text: d(vr.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
|
|
2212
|
+
}, br = {
|
|
2213
|
+
normal: On,
|
|
2214
|
+
gfm: An,
|
|
2215
|
+
pedantic: jn
|
|
2216
|
+
}, xr = {
|
|
2217
|
+
normal: gr,
|
|
2218
|
+
gfm: vr,
|
|
2219
|
+
breaks: yr,
|
|
2220
|
+
pedantic: _r
|
|
2221
|
+
}, Sr = {
|
|
2268
2222
|
"&": "&",
|
|
2269
2223
|
"<": "<",
|
|
2270
2224
|
">": ">",
|
|
2271
2225
|
"\"": """,
|
|
2272
2226
|
"'": "'"
|
|
2273
|
-
}, fe = (e) =>
|
|
2227
|
+
}, fe = (e) => Sr[e];
|
|
2274
2228
|
function R(e, t) {
|
|
2275
2229
|
if (t) {
|
|
2276
|
-
if (
|
|
2277
|
-
} else if (
|
|
2230
|
+
if (cn.escapeTest.test(e)) return e.replace(cn.escapeReplace, fe);
|
|
2231
|
+
} else if (cn.escapeTestNoEncode.test(e)) return e.replace(cn.escapeReplaceNoEncode, fe);
|
|
2278
2232
|
return e;
|
|
2279
2233
|
}
|
|
2280
2234
|
function ee(e) {
|
|
2281
2235
|
try {
|
|
2282
|
-
e = encodeURI(e).replace(
|
|
2236
|
+
e = encodeURI(e).replace(cn.percentDecode, "%");
|
|
2283
2237
|
} catch {
|
|
2284
2238
|
return null;
|
|
2285
2239
|
}
|
|
2286
2240
|
return e;
|
|
2287
2241
|
}
|
|
2288
2242
|
function te(e, t) {
|
|
2289
|
-
let n = e.replace(
|
|
2243
|
+
let n = e.replace(cn.findPipe, (e, t, n) => {
|
|
2290
2244
|
let r = !1, i = t;
|
|
2291
2245
|
for (; --i >= 0 && n[i] === "\\";) r = !r;
|
|
2292
2246
|
return r ? "|" : " |";
|
|
2293
|
-
}).split(
|
|
2247
|
+
}).split(cn.splitPipe), r = 0;
|
|
2294
2248
|
if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), t) {
|
|
2295
2249
|
if (n.length > t) n.splice(t);
|
|
2296
2250
|
else for (; n.length < t;) n.push("");
|
|
2297
2251
|
}
|
|
2298
|
-
for (; r < n.length; r++) n[r] = n[r].trim().replace(
|
|
2252
|
+
for (; r < n.length; r++) n[r] = n[r].trim().replace(cn.slashPipe, "|");
|
|
2299
2253
|
return n;
|
|
2300
2254
|
}
|
|
2301
2255
|
function $(e, t, n) {
|
|
@@ -2312,7 +2266,7 @@ function $(e, t, n) {
|
|
|
2312
2266
|
}
|
|
2313
2267
|
function ne(e) {
|
|
2314
2268
|
let t = e.split("\n"), n = t.length - 1;
|
|
2315
|
-
for (; n >= 0 &&
|
|
2269
|
+
for (; n >= 0 && cn.blankLine.test(t[n]);) n--;
|
|
2316
2270
|
return t.length - n <= 2 ? e : t.slice(0, n + 1).join("\n");
|
|
2317
2271
|
}
|
|
2318
2272
|
function D(e) {
|
|
@@ -2392,7 +2346,7 @@ function Re(e, t, n, r) {
|
|
|
2392
2346
|
}
|
|
2393
2347
|
var y = class {
|
|
2394
2348
|
constructor(e) {
|
|
2395
|
-
t(this, "options", void 0), t(this, "rules", void 0), t(this, "lexer", void 0), this.options = e ||
|
|
2349
|
+
t(this, "options", void 0), t(this, "rules", void 0), t(this, "lexer", void 0), this.options = e || on;
|
|
2396
2350
|
}
|
|
2397
2351
|
space(e) {
|
|
2398
2352
|
let t = this.rules.block.newline.exec(e);
|
|
@@ -2853,25 +2807,25 @@ ${a}`, r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
2853
2807
|
};
|
|
2854
2808
|
}
|
|
2855
2809
|
}
|
|
2856
|
-
},
|
|
2810
|
+
}, Cr = class l {
|
|
2857
2811
|
constructor(e) {
|
|
2858
|
-
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 ||
|
|
2812
|
+
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 || on, this.options.tokenizer = this.options.tokenizer || new y(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
|
|
2859
2813
|
inLink: !1,
|
|
2860
2814
|
inRawBlock: !1,
|
|
2861
2815
|
linkEmitted: !1,
|
|
2862
2816
|
top: !0
|
|
2863
2817
|
};
|
|
2864
2818
|
let n = {
|
|
2865
|
-
other:
|
|
2866
|
-
block:
|
|
2867
|
-
inline:
|
|
2819
|
+
other: cn,
|
|
2820
|
+
block: br.normal,
|
|
2821
|
+
inline: xr.normal
|
|
2868
2822
|
};
|
|
2869
|
-
this.options.pedantic ? (n.block =
|
|
2823
|
+
this.options.pedantic ? (n.block = br.pedantic, n.inline = xr.pedantic) : this.options.gfm && (n.block = br.gfm, n.inline = this.options.breaks ? xr.breaks : xr.gfm), this.tokenizer.rules = n;
|
|
2870
2824
|
}
|
|
2871
2825
|
static get rules() {
|
|
2872
2826
|
return {
|
|
2873
|
-
block:
|
|
2874
|
-
inline:
|
|
2827
|
+
block: br,
|
|
2828
|
+
inline: xr
|
|
2875
2829
|
};
|
|
2876
2830
|
}
|
|
2877
2831
|
static lex(e, t) {
|
|
@@ -2881,7 +2835,7 @@ ${a}`, r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
2881
2835
|
return new l(t).inlineTokens(e);
|
|
2882
2836
|
}
|
|
2883
2837
|
lex(e) {
|
|
2884
|
-
e = e.replace(
|
|
2838
|
+
e = e.replace(cn.carriageReturn, "\n"), this.blockTokens(e, this.tokens);
|
|
2885
2839
|
for (let e = 0; e < this.inlineQueue.length; e++) {
|
|
2886
2840
|
let t = this.inlineQueue[e];
|
|
2887
2841
|
this.inlineTokens(t.src, t.tokens);
|
|
@@ -2889,7 +2843,7 @@ ${a}`, r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
2889
2843
|
return this.inlineQueue = [], this.tokens;
|
|
2890
2844
|
}
|
|
2891
2845
|
blockTokens(e, t = [], n = !1) {
|
|
2892
|
-
this.tokenizer.lexer = this, this.options.pedantic && (e = e.replace(
|
|
2846
|
+
this.tokenizer.lexer = this, this.options.pedantic && (e = e.replace(cn.tabCharGlobal, " ").replace(cn.spaceLine, ""));
|
|
2893
2847
|
let r = 1 / 0;
|
|
2894
2848
|
for (; e;) {
|
|
2895
2849
|
if (e.length < r) r = e.length;
|
|
@@ -3091,13 +3045,13 @@ ${a}`, r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
3091
3045
|
}
|
|
3092
3046
|
}, P = class {
|
|
3093
3047
|
constructor(e) {
|
|
3094
|
-
t(this, "options", void 0), t(this, "parser", void 0), this.options = e ||
|
|
3048
|
+
t(this, "options", void 0), t(this, "parser", void 0), this.options = e || on;
|
|
3095
3049
|
}
|
|
3096
3050
|
space(e) {
|
|
3097
3051
|
return "";
|
|
3098
3052
|
}
|
|
3099
3053
|
code({ text: e, lang: t, escaped: n }) {
|
|
3100
|
-
let r = (t || "").match(
|
|
3054
|
+
let r = (t || "").match(cn.notSpaceStart)?.[0], i = e ? e.replace(cn.endingNewline, "") + "\n" : "";
|
|
3101
3055
|
return r ? "<pre><code class=\"language-" + R(r) + "\">" + (n ? i : R(i, !0)) + "</code></pre>\n" : "<pre><code>" + (n ? i : R(i, !0)) + "</code></pre>\n";
|
|
3102
3056
|
}
|
|
3103
3057
|
blockquote({ tokens: e }) {
|
|
@@ -3225,9 +3179,9 @@ ${e}</tr>
|
|
|
3225
3179
|
checkbox({ raw: e }) {
|
|
3226
3180
|
return e;
|
|
3227
3181
|
}
|
|
3228
|
-
},
|
|
3182
|
+
}, wr = class l {
|
|
3229
3183
|
constructor(e) {
|
|
3230
|
-
t(this, "options", void 0), t(this, "renderer", void 0), t(this, "textRenderer", void 0), this.options = e ||
|
|
3184
|
+
t(this, "options", void 0), t(this, "renderer", void 0), t(this, "textRenderer", void 0), this.options = e || on, this.options.renderer = this.options.renderer || new P(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new L();
|
|
3231
3185
|
}
|
|
3232
3186
|
static parse(e, t) {
|
|
3233
3187
|
return new l(t).parse(e);
|
|
@@ -3375,9 +3329,9 @@ ${e}</tr>
|
|
|
3375
3329
|
}
|
|
3376
3330
|
return n;
|
|
3377
3331
|
}
|
|
3378
|
-
},
|
|
3332
|
+
}, Tr = (_Class = class {
|
|
3379
3333
|
constructor(e) {
|
|
3380
|
-
t(this, "options", void 0), t(this, "block", void 0), this.options = e ||
|
|
3334
|
+
t(this, "options", void 0), t(this, "block", void 0), this.options = e || on;
|
|
3381
3335
|
}
|
|
3382
3336
|
preprocess(e) {
|
|
3383
3337
|
return e;
|
|
@@ -3392,10 +3346,10 @@ ${e}</tr>
|
|
|
3392
3346
|
return e;
|
|
3393
3347
|
}
|
|
3394
3348
|
provideLexer(e = this.block) {
|
|
3395
|
-
return e ?
|
|
3349
|
+
return e ? Cr.lex : Cr.lexInline;
|
|
3396
3350
|
}
|
|
3397
3351
|
provideParser(e = this.block) {
|
|
3398
|
-
return e ?
|
|
3352
|
+
return e ? wr.parse : wr.parseInline;
|
|
3399
3353
|
}
|
|
3400
3354
|
}, t(_Class, "passThroughHooks", /* @__PURE__ */ new Set([
|
|
3401
3355
|
"preprocess",
|
|
@@ -3408,7 +3362,7 @@ ${e}</tr>
|
|
|
3408
3362
|
"processAllTokens"
|
|
3409
3363
|
])), _Class), Q = class {
|
|
3410
3364
|
constructor(...e) {
|
|
3411
|
-
t(this, "defaults", A()), t(this, "options", this.setOptions), t(this, "parse", this.parseMarkdown(!0)), t(this, "parseInline", this.parseMarkdown(!1)), t(this, "Parser",
|
|
3365
|
+
t(this, "defaults", A()), t(this, "options", this.setOptions), t(this, "parse", this.parseMarkdown(!0)), t(this, "parseInline", this.parseMarkdown(!1)), t(this, "Parser", wr), t(this, "Renderer", P), t(this, "TextRenderer", L), t(this, "Lexer", Cr), t(this, "Tokenizer", y), t(this, "Hooks", Tr), this.use(...e);
|
|
3412
3366
|
}
|
|
3413
3367
|
walkTokens(e, t) {
|
|
3414
3368
|
let n = [];
|
|
@@ -3487,13 +3441,13 @@ ${e}</tr>
|
|
|
3487
3441
|
n.tokenizer = t;
|
|
3488
3442
|
}
|
|
3489
3443
|
if (e.hooks) {
|
|
3490
|
-
let t = this.defaults.hooks || new
|
|
3444
|
+
let t = this.defaults.hooks || new Tr();
|
|
3491
3445
|
for (let n in e.hooks) {
|
|
3492
3446
|
if (!(n in t)) throw Error(`hook '${n}' does not exist`);
|
|
3493
3447
|
if (["options", "block"].includes(n)) continue;
|
|
3494
3448
|
let r = n, i = e.hooks[r], a = t[r];
|
|
3495
|
-
t[r] =
|
|
3496
|
-
if (this.defaults.async &&
|
|
3449
|
+
t[r] = Tr.passThroughHooks.has(n) ? (e) => {
|
|
3450
|
+
if (this.defaults.async && Tr.passThroughHooksRespectAsync.has(n)) return (async () => {
|
|
3497
3451
|
let n = await i.call(t, e);
|
|
3498
3452
|
return a.call(t, n);
|
|
3499
3453
|
})();
|
|
@@ -3530,10 +3484,10 @@ ${e}</tr>
|
|
|
3530
3484
|
}, this;
|
|
3531
3485
|
}
|
|
3532
3486
|
lexer(e, t) {
|
|
3533
|
-
return
|
|
3487
|
+
return Cr.lex(e, t ?? this.defaults);
|
|
3534
3488
|
}
|
|
3535
3489
|
parser(e, t) {
|
|
3536
|
-
return
|
|
3490
|
+
return wr.parse(e, t ?? this.defaults);
|
|
3537
3491
|
}
|
|
3538
3492
|
parseMarkdown(e) {
|
|
3539
3493
|
return (t, n) => {
|
|
@@ -3545,16 +3499,16 @@ ${e}</tr>
|
|
|
3545
3499
|
if (typeof t > "u" || t === null) return a(/* @__PURE__ */ Error("marked(): input parameter is undefined or null"));
|
|
3546
3500
|
if (typeof t != "string") return a(/* @__PURE__ */ Error("marked(): input parameter is of type " + Object.prototype.toString.call(t) + ", string expected"));
|
|
3547
3501
|
if (i.hooks && (i.hooks.options = i, i.hooks.block = e), i.async) return (async () => {
|
|
3548
|
-
let n = i.hooks ? await i.hooks.preprocess(t) : t, r = await (i.hooks ? await i.hooks.provideLexer(e) : e ?
|
|
3502
|
+
let n = i.hooks ? await i.hooks.preprocess(t) : t, r = await (i.hooks ? await i.hooks.provideLexer(e) : e ? Cr.lex : Cr.lexInline)(n, i), a = i.hooks ? await i.hooks.processAllTokens(r) : r;
|
|
3549
3503
|
i.walkTokens && await Promise.all(this.walkTokens(a, i.walkTokens));
|
|
3550
|
-
let o = await (i.hooks ? await i.hooks.provideParser(e) : e ?
|
|
3504
|
+
let o = await (i.hooks ? await i.hooks.provideParser(e) : e ? wr.parse : wr.parseInline)(a, i);
|
|
3551
3505
|
return i.hooks ? await i.hooks.postprocess(o) : o;
|
|
3552
3506
|
})().catch(a);
|
|
3553
3507
|
try {
|
|
3554
3508
|
i.hooks && (t = i.hooks.preprocess(t));
|
|
3555
|
-
let n = (i.hooks ? i.hooks.provideLexer(e) : e ?
|
|
3509
|
+
let n = (i.hooks ? i.hooks.provideLexer(e) : e ? Cr.lex : Cr.lexInline)(t, i);
|
|
3556
3510
|
i.hooks && (n = i.hooks.processAllTokens(n)), i.walkTokens && this.walkTokens(n, i.walkTokens);
|
|
3557
|
-
let r = (i.hooks ? i.hooks.provideParser(e) : e ?
|
|
3511
|
+
let r = (i.hooks ? i.hooks.provideParser(e) : e ? wr.parse : wr.parseInline)(n, i);
|
|
3558
3512
|
return i.hooks && (r = i.hooks.postprocess(r)), r;
|
|
3559
3513
|
} catch (e) {
|
|
3560
3514
|
return a(e);
|
|
@@ -3571,22 +3525,22 @@ ${e}</tr>
|
|
|
3571
3525
|
throw n;
|
|
3572
3526
|
};
|
|
3573
3527
|
}
|
|
3574
|
-
},
|
|
3528
|
+
}, Er = new Q();
|
|
3575
3529
|
function f(e, t) {
|
|
3576
|
-
return
|
|
3530
|
+
return Er.parse(e, t);
|
|
3577
3531
|
}
|
|
3578
3532
|
f.options = f.setOptions = function(e) {
|
|
3579
|
-
return
|
|
3580
|
-
}, f.getDefaults = A, f.defaults =
|
|
3533
|
+
return Er.setOptions(e), f.defaults = Er.defaults, U(f.defaults), f;
|
|
3534
|
+
}, f.getDefaults = A, f.defaults = on;
|
|
3581
3535
|
function bt(...e) {
|
|
3582
|
-
return
|
|
3536
|
+
return Er.use(...e), f.defaults = Er.defaults, U(f.defaults), f;
|
|
3583
3537
|
}
|
|
3584
3538
|
f.use = bt, f.walkTokens = function(e, t) {
|
|
3585
|
-
return
|
|
3586
|
-
}, f.parseInline =
|
|
3539
|
+
return Er.walkTokens(e, t);
|
|
3540
|
+
}, f.parseInline = Er.parseInline, f.Parser = wr, f.parser = wr.parse, f.Renderer = P, f.TextRenderer = L, f.Lexer = Cr, f.lexer = Cr.lex, f.Tokenizer = y, f.Hooks = Tr, f.parse = f, f.options, f.setOptions, f.walkTokens, f.parseInline, wr.parse, Cr.lex;
|
|
3587
3541
|
//#endregion
|
|
3588
3542
|
//#region bot/ui/ChatCardBlock.vue?vue&type=script&setup=true&lang.ts
|
|
3589
|
-
var
|
|
3543
|
+
var Dr = ["aria-label"], Or = { class: "px-4 pb-2 pt-4" }, kr = ["innerHTML"], Ar = ["onClick"], jr = /* @__PURE__ */ E({
|
|
3590
3544
|
__name: "ChatCardBlock",
|
|
3591
3545
|
props: {
|
|
3592
3546
|
spec: {},
|
|
@@ -3597,7 +3551,7 @@ var jr = ["aria-label"], Mr = { class: "px-4 pb-2 pt-4" }, Nr = ["innerHTML"], P
|
|
|
3597
3551
|
let n = e, r = t, i = v(() => {
|
|
3598
3552
|
if (!n.spec.body) return "";
|
|
3599
3553
|
let e = f.parse(n.spec.body, { async: !1 });
|
|
3600
|
-
return
|
|
3554
|
+
return an.sanitize(e, { ADD_ATTR: ["target"] });
|
|
3601
3555
|
}), 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)"), p = 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)`), m = v(() => n.inverted ? "transparent" : "var(--color-theme-0)");
|
|
3602
3556
|
function actionStyle(e) {
|
|
3603
3557
|
return e === "primary" || e === "destructive" ? {
|
|
@@ -3617,7 +3571,7 @@ var jr = ["aria-label"], Mr = { class: "px-4 pb-2 pt-4" }, Nr = ["innerHTML"], P
|
|
|
3617
3571
|
}),
|
|
3618
3572
|
"aria-label": e.spec.title
|
|
3619
3573
|
}, [
|
|
3620
|
-
C("div",
|
|
3574
|
+
C("div", Or, [C("div", {
|
|
3621
3575
|
class: "text-[14px] font-semibold leading-tight",
|
|
3622
3576
|
style: k({ color: s.value })
|
|
3623
3577
|
}, z(e.spec.title), 5)]),
|
|
@@ -3626,7 +3580,7 @@ var jr = ["aria-label"], Mr = { class: "px-4 pb-2 pt-4" }, Nr = ["innerHTML"], P
|
|
|
3626
3580
|
class: "chat-msg-prose px-4 pb-4 pt-2 text-[14px] leading-relaxed",
|
|
3627
3581
|
style: k({ color: c.value }),
|
|
3628
3582
|
innerHTML: i.value
|
|
3629
|
-
}, null, 12,
|
|
3583
|
+
}, null, 12, kr)) : x("", !0),
|
|
3630
3584
|
e.spec.actions?.length ? (j(), S("div", {
|
|
3631
3585
|
key: 1,
|
|
3632
3586
|
class: "flex flex-wrap items-center gap-2 px-3 py-2.5",
|
|
@@ -3638,15 +3592,15 @@ var jr = ["aria-label"], Mr = { class: "px-4 pb-2 pt-4" }, Nr = ["innerHTML"], P
|
|
|
3638
3592
|
class: "inline-flex h-10 items-center justify-center rounded-full px-5 text-[14px] font-semibold transition-colors duration-150 active:opacity-80",
|
|
3639
3593
|
style: k(actionStyle(e.style)),
|
|
3640
3594
|
onClick: (t) => r("action", e.reply)
|
|
3641
|
-
}, z(e.label), 13,
|
|
3642
|
-
], 12,
|
|
3595
|
+
}, z(e.label), 13, Ar))), 128))], 4)) : x("", !0)
|
|
3596
|
+
], 12, Dr));
|
|
3643
3597
|
}
|
|
3644
|
-
}),
|
|
3598
|
+
}), Mr = 112, Nr = 52, Pr = 14, Fr = 54, Ir = 34, Lr = 260;
|
|
3645
3599
|
function nodeWidthFor(e) {
|
|
3646
3600
|
let { orientation: t, maxRows: n, maxWidth: r } = e;
|
|
3647
|
-
if (t === "horizontal" || !r) return
|
|
3648
|
-
let i = r - 28 - (n - 1) *
|
|
3649
|
-
return Math.min(
|
|
3601
|
+
if (t === "horizontal" || !r) return Mr;
|
|
3602
|
+
let i = r - 28 - (n - 1) * Fr;
|
|
3603
|
+
return Math.min(Lr, Math.max(Mr, Math.floor(i / n)));
|
|
3650
3604
|
}
|
|
3651
3605
|
function orientationFor(e) {
|
|
3652
3606
|
return e.layout === "left-to-right" || e.layout === "radial" ? "horizontal" : e.layout === "top-to-bottom" ? "vertical" : e.diagramType === "sequence" ? "horizontal" : "vertical";
|
|
@@ -3683,11 +3637,11 @@ function buildLayout(e, t, n) {
|
|
|
3683
3637
|
orientation: t,
|
|
3684
3638
|
maxRows: o,
|
|
3685
3639
|
...n === void 0 ? {} : { maxWidth: n }
|
|
3686
|
-
}), p = t === "horizontal" ? 28 + s * c + (s - 1) *
|
|
3640
|
+
}), p = t === "horizontal" ? 28 + s * c + (s - 1) * Fr : 28 + o * c + (o - 1) * Fr, m = t === "horizontal" ? 28 + o * Nr + (o - 1) * Ir : 28 + s * Nr + (s - 1) * Ir, h = [];
|
|
3687
3641
|
for (let [e, [, n]] of a.entries()) {
|
|
3688
|
-
let r = (o - n.length) * (t === "horizontal" ? 86 : c +
|
|
3642
|
+
let r = (o - n.length) * (t === "horizontal" ? 86 : c + Fr) / 2;
|
|
3689
3643
|
for (let [i, a] of n.entries()) {
|
|
3690
|
-
let n = t === "horizontal" ?
|
|
3644
|
+
let n = t === "horizontal" ? Pr + e * (c + Fr) : Pr + r + i * (c + Fr), o = t === "horizontal" ? Pr + r + i * 86 : Pr + e * 86;
|
|
3691
3645
|
h.push({
|
|
3692
3646
|
id: a.id,
|
|
3693
3647
|
label: a.label,
|
|
@@ -3696,7 +3650,7 @@ function buildLayout(e, t, n) {
|
|
|
3696
3650
|
x: n,
|
|
3697
3651
|
y: o,
|
|
3698
3652
|
width: c,
|
|
3699
|
-
height:
|
|
3653
|
+
height: Nr
|
|
3700
3654
|
});
|
|
3701
3655
|
}
|
|
3702
3656
|
}
|
|
@@ -3773,14 +3727,14 @@ function formatChatVisualTick(e) {
|
|
|
3773
3727
|
let { prefix: r, suffix: i } = affixes(n);
|
|
3774
3728
|
return `${r}${formatChatVisualValue({ value: t })}${i}`;
|
|
3775
3729
|
}
|
|
3776
|
-
var
|
|
3730
|
+
var Rr = 5.4, zr = 10, Br = 15, Vr = 16;
|
|
3777
3731
|
function planChatVisualXLabels(e) {
|
|
3778
3732
|
let { labels: t, plotWidth: n } = e;
|
|
3779
3733
|
if (!t.length || n <= 0) return {
|
|
3780
3734
|
mode: "horizontal",
|
|
3781
3735
|
entries: []
|
|
3782
3736
|
};
|
|
3783
|
-
let r = t.map((e) => e.length >
|
|
3737
|
+
let r = t.map((e) => e.length > Vr ? `${e.slice(0, 15).trimEnd()}\u2026` : e), i = t.length - 1;
|
|
3784
3738
|
if (i === 0) return {
|
|
3785
3739
|
mode: "horizontal",
|
|
3786
3740
|
entries: [{
|
|
@@ -3788,14 +3742,14 @@ function planChatVisualXLabels(e) {
|
|
|
3788
3742
|
text: r[0]
|
|
3789
3743
|
}]
|
|
3790
3744
|
};
|
|
3791
|
-
if ((Math.max(...r.map((e) => e.length *
|
|
3745
|
+
if ((Math.max(...r.map((e) => e.length * Rr)) + zr) * t.length <= n) return {
|
|
3792
3746
|
mode: "horizontal",
|
|
3793
3747
|
entries: r.map((e, t) => ({
|
|
3794
3748
|
index: t,
|
|
3795
3749
|
text: e
|
|
3796
3750
|
}))
|
|
3797
3751
|
};
|
|
3798
|
-
let a = Math.max(2, Math.floor(n /
|
|
3752
|
+
let a = Math.max(2, Math.floor(n / Br));
|
|
3799
3753
|
if (t.length <= a) return {
|
|
3800
3754
|
mode: "angled",
|
|
3801
3755
|
entries: r.map((e, t) => ({
|
|
@@ -3815,22 +3769,22 @@ function planChatVisualXLabels(e) {
|
|
|
3815
3769
|
}
|
|
3816
3770
|
//#endregion
|
|
3817
3771
|
//#region bot/ui/ChatVisualBlock.vue?vue&type=script&setup=true&lang.ts
|
|
3818
|
-
var
|
|
3772
|
+
var Hr = [
|
|
3819
3773
|
"data-visual-type",
|
|
3820
3774
|
"data-chart-type",
|
|
3821
3775
|
"data-stacking",
|
|
3822
3776
|
"data-diagram-type",
|
|
3823
3777
|
"aria-label"
|
|
3824
|
-
],
|
|
3778
|
+
], Ur = { class: "mb-2.5" }, Wr = ["aria-label"], Gr = {
|
|
3825
3779
|
key: 0,
|
|
3826
3780
|
"data-test": "chat-visual-horizontal-bars",
|
|
3827
3781
|
class: "grid gap-3"
|
|
3828
|
-
},
|
|
3782
|
+
}, Kr = { class: "mb-1 flex items-start justify-between gap-3 text-[12px]" }, qr = ["viewBox"], Jr = [
|
|
3829
3783
|
"x1",
|
|
3830
3784
|
"x2",
|
|
3831
3785
|
"y1",
|
|
3832
3786
|
"y2"
|
|
3833
|
-
],
|
|
3787
|
+
], Yr = ["x", "y"], Xr = [
|
|
3834
3788
|
"data-row-index",
|
|
3835
3789
|
"data-series-index",
|
|
3836
3790
|
"data-data-key",
|
|
@@ -3838,35 +3792,35 @@ var Kr = [
|
|
|
3838
3792
|
"y",
|
|
3839
3793
|
"width",
|
|
3840
3794
|
"height"
|
|
3841
|
-
],
|
|
3795
|
+
], Zr = ["data-trend-key", "d"], Qr = ["d"], $r = ["cx", "cy"], ei = ["cx", "cy"], ti = [
|
|
3842
3796
|
"x",
|
|
3843
3797
|
"y",
|
|
3844
3798
|
"text-anchor",
|
|
3845
3799
|
"transform"
|
|
3846
|
-
],
|
|
3800
|
+
], ni = {
|
|
3847
3801
|
key: 2,
|
|
3848
3802
|
class: "mt-2.5 flex flex-wrap items-center gap-x-4 gap-y-1.5"
|
|
3849
|
-
},
|
|
3803
|
+
}, ri = {
|
|
3850
3804
|
key: 1,
|
|
3851
3805
|
class: "grid gap-3"
|
|
3852
|
-
},
|
|
3806
|
+
}, ii = { class: "mb-1 flex items-baseline justify-between gap-3 text-[12px]" }, ai = { class: "shrink-0 tabular-nums" }, oi = {
|
|
3853
3807
|
key: 2,
|
|
3854
3808
|
class: "overflow-x-auto"
|
|
3855
|
-
},
|
|
3809
|
+
}, si = ["viewBox", "aria-label"], ci = [
|
|
3856
3810
|
"data-from",
|
|
3857
3811
|
"data-to",
|
|
3858
3812
|
"x1",
|
|
3859
3813
|
"y1",
|
|
3860
3814
|
"x2",
|
|
3861
3815
|
"y2"
|
|
3862
|
-
],
|
|
3816
|
+
], li = ["cx", "cy"], ui = ["x", "y"], di = [
|
|
3863
3817
|
"data-node-id",
|
|
3864
3818
|
"data-node-kind",
|
|
3865
3819
|
"transform"
|
|
3866
|
-
],
|
|
3820
|
+
], fi = ["points"], pi = ["width", "height"], mi = ["width", "height"], hi = {
|
|
3867
3821
|
xmlns: "http://www.w3.org/1999/xhtml",
|
|
3868
3822
|
class: "flex h-full min-w-0 flex-col items-center justify-center text-center"
|
|
3869
|
-
},
|
|
3823
|
+
}, gi = /* @__PURE__ */ E({
|
|
3870
3824
|
__name: "ChatVisualBlock",
|
|
3871
3825
|
props: {
|
|
3872
3826
|
result: {},
|
|
@@ -4171,7 +4125,7 @@ var Kr = [
|
|
|
4171
4125
|
}),
|
|
4172
4126
|
"aria-label": o.value.meta.title
|
|
4173
4127
|
}, [
|
|
4174
|
-
C("header",
|
|
4128
|
+
C("header", Ur, [C("h4", {
|
|
4175
4129
|
class: "text-[13px] font-semibold leading-tight",
|
|
4176
4130
|
style: k({ color: ye.value })
|
|
4177
4131
|
}, z(o.value.meta.title), 5), o.value.meta.description ? (j(), S("p", {
|
|
@@ -4186,11 +4140,11 @@ var Kr = [
|
|
|
4186
4140
|
key: 0,
|
|
4187
4141
|
role: "img",
|
|
4188
4142
|
"aria-label": o.value.meta.title
|
|
4189
|
-
}, [le.value.length ? (j(), S("div",
|
|
4143
|
+
}, [le.value.length ? (j(), S("div", Gr, [(j(!0), S(g, null, N(le.value, (e) => (j(), S("div", {
|
|
4190
4144
|
key: e.key,
|
|
4191
4145
|
"data-test": "chat-visual-horizontal-bar",
|
|
4192
4146
|
class: "min-w-0"
|
|
4193
|
-
}, [C("div",
|
|
4147
|
+
}, [C("div", Kr, [C("span", {
|
|
4194
4148
|
class: "line-clamp-2 min-w-0 font-medium leading-snug",
|
|
4195
4149
|
style: k({ color: ye.value })
|
|
4196
4150
|
}, z(e.label), 5), C("span", {
|
|
@@ -4222,7 +4176,7 @@ var Kr = [
|
|
|
4222
4176
|
"stroke-width": "1",
|
|
4223
4177
|
"vector-effect": "non-scaling-stroke",
|
|
4224
4178
|
style: k({ stroke: e === 0 ? H.value : Ce.value })
|
|
4225
|
-
}, null, 12,
|
|
4179
|
+
}, null, 12, Jr))), 128)),
|
|
4226
4180
|
C("g", null, [(j(!0), S(g, null, N(T.value.ticks, (e) => (j(), S("text", {
|
|
4227
4181
|
key: `y-${e}`,
|
|
4228
4182
|
x: O.value.left - 7,
|
|
@@ -4233,7 +4187,7 @@ var Kr = [
|
|
|
4233
4187
|
}, z(B(formatChatVisualTick)({
|
|
4234
4188
|
value: e,
|
|
4235
4189
|
shared: E.value
|
|
4236
|
-
})), 13,
|
|
4190
|
+
})), 13, Yr))), 128))]),
|
|
4237
4191
|
m.value.chartType === "bar" ? (j(!0), S(g, { key: 0 }, N(se.value, (e) => (j(), S("rect", {
|
|
4238
4192
|
key: e.key,
|
|
4239
4193
|
"data-test": "chat-visual-bar",
|
|
@@ -4246,7 +4200,7 @@ var Kr = [
|
|
|
4246
4200
|
height: e.height,
|
|
4247
4201
|
rx: "2.5",
|
|
4248
4202
|
style: k({ fill: seriesColor(e.seriesIndex) })
|
|
4249
|
-
}, null, 12,
|
|
4203
|
+
}, null, 12, Xr))), 128)) : (j(), S(g, { key: 1 }, [
|
|
4250
4204
|
oe.value ? (j(), S("path", {
|
|
4251
4205
|
key: 0,
|
|
4252
4206
|
"data-test": "chat-visual-trend-line",
|
|
@@ -4259,7 +4213,7 @@ var Kr = [
|
|
|
4259
4213
|
"stroke-dasharray": "4 3",
|
|
4260
4214
|
"vector-effect": "non-scaling-stroke",
|
|
4261
4215
|
style: k({ stroke: seriesColor(oe.value.seriesIndex) })
|
|
4262
|
-
}, null, 12,
|
|
4216
|
+
}, null, 12, Zr)) : x("", !0),
|
|
4263
4217
|
(j(!0), S(g, null, N(h.value, (e, t) => (j(), S("g", { key: e.dataKey }, [m.value.chartType === "line" ? (j(), S("path", {
|
|
4264
4218
|
key: 0,
|
|
4265
4219
|
d: pathForSeries(e.dataKey),
|
|
@@ -4269,20 +4223,20 @@ var Kr = [
|
|
|
4269
4223
|
"stroke-linejoin": "round",
|
|
4270
4224
|
"vector-effect": "non-scaling-stroke",
|
|
4271
4225
|
style: k({ stroke: seriesColor(t) })
|
|
4272
|
-
}, null, 12,
|
|
4226
|
+
}, null, 12, Qr)) : x("", !0), (j(!0), S(g, null, N(p.value, (n, r) => (j(), S(g, { key: `${e.dataKey}-${r}` }, [m.value.chartType === "scatter" ? (j(), S("circle", {
|
|
4273
4227
|
key: 0,
|
|
4274
4228
|
cx: xForIndex(r, p.value.length),
|
|
4275
4229
|
cy: yForValue(numericValue(n[e.dataKey]) ?? 0),
|
|
4276
4230
|
r: "2.6",
|
|
4277
4231
|
style: k({ fill: seriesColor(t) })
|
|
4278
|
-
}, null, 12,
|
|
4232
|
+
}, null, 12, $r)) : x("", !0)], 64))), 128))]))), 128)),
|
|
4279
4233
|
(j(!0), S(g, null, N(de.value, (e) => (j(), S("circle", {
|
|
4280
4234
|
key: `marker-${e.key}`,
|
|
4281
4235
|
cx: e.cx,
|
|
4282
4236
|
cy: e.cy,
|
|
4283
4237
|
r: "3",
|
|
4284
4238
|
style: k({ fill: seriesColor(e.seriesIndex) })
|
|
4285
|
-
}, null, 12,
|
|
4239
|
+
}, null, 12, ei))), 128))
|
|
4286
4240
|
], 64)),
|
|
4287
4241
|
(j(!0), S(g, null, N(ce.value, (e) => (j(), S("text", {
|
|
4288
4242
|
key: e.key,
|
|
@@ -4292,8 +4246,8 @@ var Kr = [
|
|
|
4292
4246
|
"font-size": "9.5",
|
|
4293
4247
|
transform: e.angled ? `rotate(${B(-40)} ${e.x} ${O.value.height - O.value.bottom + 12})` : void 0,
|
|
4294
4248
|
style: k({ fill: V.value })
|
|
4295
|
-
}, z(e.label), 13,
|
|
4296
|
-
], 12,
|
|
4249
|
+
}, z(e.label), 13, ti))), 128))
|
|
4250
|
+
], 12, qr)), ue.value.length > 1 || m.value.chartType !== "bar" ? (j(), S("div", ni, [(j(!0), S(g, null, N(ue.value, (e) => (j(), S("div", {
|
|
4297
4251
|
key: e.key,
|
|
4298
4252
|
class: "inline-flex items-center gap-1.5 text-[11.5px] leading-none"
|
|
4299
4253
|
}, [
|
|
@@ -4306,10 +4260,10 @@ var Kr = [
|
|
|
4306
4260
|
class: "font-semibold tabular-nums",
|
|
4307
4261
|
style: k({ color: ye.value })
|
|
4308
4262
|
}, z(e.value), 5)
|
|
4309
|
-
]))), 128))])) : x("", !0)], 8,
|
|
4263
|
+
]))), 128))])) : x("", !0)], 8, Wr)) : _.value ? (j(), S("div", ri, [(j(!0), S(g, null, N(he.value, (e, t) => (j(), S("div", { key: e.key }, [C("div", ii, [C("span", {
|
|
4310
4264
|
class: "truncate font-medium",
|
|
4311
4265
|
style: k({ color: ye.value })
|
|
4312
|
-
}, z(e.name), 5), C("span",
|
|
4266
|
+
}, z(e.name), 5), C("span", ai, [C("span", {
|
|
4313
4267
|
class: "font-semibold",
|
|
4314
4268
|
style: k({ color: ye.value })
|
|
4315
4269
|
}, z(e.display), 5), C("span", {
|
|
@@ -4324,7 +4278,7 @@ var Kr = [
|
|
|
4324
4278
|
width: `${Math.max(2, e.percent * 100)}%`,
|
|
4325
4279
|
background: seriesColor(t)
|
|
4326
4280
|
})
|
|
4327
|
-
}, null, 4)], 4)]))), 128))])) : c.value && ge.value ? (j(), S("div",
|
|
4281
|
+
}, null, 4)], 4)]))), 128))])) : c.value && ge.value ? (j(), S("div", oi, [(j(), S("svg", {
|
|
4328
4282
|
"data-test": "chat-visual-diagram-svg",
|
|
4329
4283
|
class: "block h-auto overflow-visible",
|
|
4330
4284
|
viewBox: `0 0 ${ge.value.width} ${ge.value.height}`,
|
|
@@ -4348,14 +4302,14 @@ var Kr = [
|
|
|
4348
4302
|
"stroke-linecap": "round",
|
|
4349
4303
|
"vector-effect": "non-scaling-stroke",
|
|
4350
4304
|
style: k({ stroke: Te.value })
|
|
4351
|
-
}, null, 12,
|
|
4305
|
+
}, null, 12, ci))), 128)),
|
|
4352
4306
|
(j(!0), S(g, null, N(ge.value.edges, (e) => (j(), S("circle", {
|
|
4353
4307
|
key: `${e.key}-dot`,
|
|
4354
4308
|
cx: e.x2,
|
|
4355
4309
|
cy: e.y2,
|
|
4356
4310
|
r: "2.4",
|
|
4357
4311
|
style: k({ fill: Te.value })
|
|
4358
|
-
}, null, 12,
|
|
4312
|
+
}, null, 12, li))), 128)),
|
|
4359
4313
|
(j(!0), S(g, null, N(ge.value.edges.filter((e) => e.label), (e) => (j(), S("foreignObject", {
|
|
4360
4314
|
key: `${e.key}-label`,
|
|
4361
4315
|
x: e.labelX - 55,
|
|
@@ -4369,7 +4323,7 @@ var Kr = [
|
|
|
4369
4323
|
color: Se.value,
|
|
4370
4324
|
background: t.inverted ? "var(--color-theme-900)" : "var(--color-theme-0)"
|
|
4371
4325
|
})
|
|
4372
|
-
}, z(e.label), 5)], 8,
|
|
4326
|
+
}, z(e.label), 5)], 8, ui))), 128)),
|
|
4373
4327
|
(j(!0), S(g, null, N(ge.value.nodes, (e) => (j(), S("g", {
|
|
4374
4328
|
key: e.id,
|
|
4375
4329
|
"data-test": "chat-visual-diagram-node",
|
|
@@ -4385,7 +4339,7 @@ var Kr = [
|
|
|
4385
4339
|
fill: diagramNodeFill(e.kind),
|
|
4386
4340
|
stroke: diagramNodeStroke(e.kind)
|
|
4387
4341
|
})
|
|
4388
|
-
}, null, 12,
|
|
4342
|
+
}, null, 12, fi)) : (j(), S("rect", {
|
|
4389
4343
|
key: 1,
|
|
4390
4344
|
width: e.width,
|
|
4391
4345
|
height: e.height,
|
|
@@ -4396,28 +4350,28 @@ var Kr = [
|
|
|
4396
4350
|
fill: diagramNodeFill(e.kind),
|
|
4397
4351
|
stroke: diagramNodeStroke(e.kind)
|
|
4398
4352
|
})
|
|
4399
|
-
}, null, 12,
|
|
4353
|
+
}, null, 12, pi)), (j(), S("foreignObject", {
|
|
4400
4354
|
x: "8",
|
|
4401
4355
|
y: "5",
|
|
4402
4356
|
width: e.width - 16,
|
|
4403
4357
|
height: e.height - 10
|
|
4404
|
-
}, [C("div",
|
|
4358
|
+
}, [C("div", hi, [C("div", {
|
|
4405
4359
|
class: "line-clamp-2 text-[13px] font-medium leading-snug",
|
|
4406
4360
|
style: k({ color: ye.value })
|
|
4407
4361
|
}, z(e.label), 5), e.detail ? (j(), S("div", {
|
|
4408
4362
|
key: 0,
|
|
4409
4363
|
class: "mt-0.5 line-clamp-1 text-[10.5px] leading-none",
|
|
4410
4364
|
style: k({ color: Se.value })
|
|
4411
|
-
}, z(e.detail), 5)) : x("", !0)])], 8,
|
|
4412
|
-
], 12,
|
|
4365
|
+
}, z(e.detail), 5)) : x("", !0)])], 8, mi))], 8, di))), 128))
|
|
4366
|
+
], 12, si))])) : x("", !0)], 512),
|
|
4413
4367
|
o.value.meta.footer ? (j(), S("footer", {
|
|
4414
4368
|
key: 0,
|
|
4415
4369
|
class: "mt-3 text-[11px] leading-snug",
|
|
4416
4370
|
style: k({ color: V.value })
|
|
4417
4371
|
}, z(o.value.meta.footer), 5)) : x("", !0)
|
|
4418
|
-
], 12,
|
|
4372
|
+
], 12, Hr)) : x("", !0);
|
|
4419
4373
|
}
|
|
4420
|
-
}),
|
|
4374
|
+
}), _i = ["innerHTML"], vi = /* @__PURE__ */ E({
|
|
4421
4375
|
__name: "ChatRichText",
|
|
4422
4376
|
props: {
|
|
4423
4377
|
text: {},
|
|
@@ -4457,7 +4411,7 @@ var Kr = [
|
|
|
4457
4411
|
function renderMarkdown(e) {
|
|
4458
4412
|
if (!e) return "";
|
|
4459
4413
|
let t = f.parse(e, { async: !1 });
|
|
4460
|
-
return
|
|
4414
|
+
return an.sanitize(t, {
|
|
4461
4415
|
ADD_ATTR: ["target"],
|
|
4462
4416
|
ADD_DATA_URI_TAGS: ["img"]
|
|
4463
4417
|
});
|
|
@@ -4595,11 +4549,11 @@ var Kr = [
|
|
|
4595
4549
|
key: 0,
|
|
4596
4550
|
class: O(["chat-msg-prose", e.inverted ? "chat-msg-prose-invert" : ""]),
|
|
4597
4551
|
innerHTML: t.html
|
|
4598
|
-
}, null, 10,
|
|
4552
|
+
}, null, 10, _i)) : t.kind === "visual" ? (j(), b(gi, {
|
|
4599
4553
|
key: 1,
|
|
4600
4554
|
result: t.result,
|
|
4601
4555
|
inverted: e.inverted
|
|
4602
|
-
}, null, 8, ["result", "inverted"])) : t.kind === "card" ? (j(), b(
|
|
4556
|
+
}, null, 8, ["result", "inverted"])) : t.kind === "card" ? (j(), b(jr, {
|
|
4603
4557
|
key: 2,
|
|
4604
4558
|
spec: t.spec,
|
|
4605
4559
|
inverted: e.inverted,
|
|
@@ -4619,7 +4573,7 @@ var Kr = [
|
|
|
4619
4573
|
style: { background: "currentcolor" }
|
|
4620
4574
|
}, null, -1), w(" Preparing chart… ", -1)])], 4))], 64))), 128))], 32));
|
|
4621
4575
|
}
|
|
4622
|
-
}),
|
|
4576
|
+
}), yi = 80, bi = 600, xi = /* @__PURE__ */ E({
|
|
4623
4577
|
__name: "ChatScroller",
|
|
4624
4578
|
setup(e, { expose: t }) {
|
|
4625
4579
|
let n = M(), r = M(), i = M(!0), a, o, s = 0;
|
|
@@ -4629,10 +4583,10 @@ var Kr = [
|
|
|
4629
4583
|
}
|
|
4630
4584
|
function onScroll() {
|
|
4631
4585
|
let e = n.value;
|
|
4632
|
-
e && (i.value = e.scrollHeight - e.scrollTop - e.clientHeight <=
|
|
4586
|
+
e && (i.value = e.scrollHeight - e.scrollTop - e.clientHeight <= yi);
|
|
4633
4587
|
}
|
|
4634
4588
|
function markUserGesture() {
|
|
4635
|
-
s = Date.now() +
|
|
4589
|
+
s = Date.now() + bi;
|
|
4636
4590
|
}
|
|
4637
4591
|
function followPinned() {
|
|
4638
4592
|
i.value && Date.now() > s && scrollToBottom();
|
|
@@ -4664,7 +4618,7 @@ var Kr = [
|
|
|
4664
4618
|
class: "flex-1 flex flex-col"
|
|
4665
4619
|
}, [se(e.$slots, "default")], 512)], 34));
|
|
4666
4620
|
}
|
|
4667
|
-
}),
|
|
4621
|
+
}), Si = {
|
|
4668
4622
|
VOICE_MIC_UNAVAILABLE: "I couldn't reach your microphone. Check that this site is allowed to use it, then try again.",
|
|
4669
4623
|
VOICE_BOT_UNAVAILABLE: "Your assistant didn't pick up. Give it a moment and start the call again.",
|
|
4670
4624
|
VOICE_CONNECT_TIMEOUT: "The call took too long to connect. Try again in a moment.",
|
|
@@ -4673,21 +4627,21 @@ var Kr = [
|
|
|
4673
4627
|
VOICE_UNAVAILABLE: "Voice isn't available right now. You can keep going by typing.",
|
|
4674
4628
|
VOICE_MINT_INVALID: "That call couldn't be started. Refresh the page and try again.",
|
|
4675
4629
|
VOICE_PROVIDER_ERROR: "The call ended unexpectedly. Try again, or keep going by typing."
|
|
4676
|
-
},
|
|
4630
|
+
}, Ci = "The call ended unexpectedly. Try again, or keep going by typing.";
|
|
4677
4631
|
function voiceErrorMessage(e) {
|
|
4678
|
-
return e &&
|
|
4632
|
+
return e && Si[e] || Ci;
|
|
4679
4633
|
}
|
|
4680
4634
|
//#endregion
|
|
4681
4635
|
//#region bot/ui/VoiceHistogramController.ts
|
|
4682
|
-
var
|
|
4636
|
+
var wi = [
|
|
4683
4637
|
0,
|
|
4684
4638
|
2,
|
|
4685
4639
|
4,
|
|
4686
4640
|
6,
|
|
4687
4641
|
8
|
|
4688
|
-
],
|
|
4642
|
+
], Ti = 5, Ei = 33, Di = .7, Oi = .1, ki = 60, Ai = 320, ji = .55, Mi = .1, Ni = .32, Pi = .9, Fi = wi.map(() => 0), Ii = wi.map(() => Ti), VoiceHistogramController = class {
|
|
4689
4643
|
constructor(e = typeof window > "u" ? void 0 : window) {
|
|
4690
|
-
t(this, "browser", void 0), t(this, "heights", F(
|
|
4644
|
+
t(this, "browser", void 0), t(this, "heights", F(Ii)), t(this, "targetBars", Fi), t(this, "displayBars", Fi), t(this, "level", {
|
|
4691
4645
|
source: "mic",
|
|
4692
4646
|
level: 0
|
|
4693
4647
|
}), t(this, "isMuted", !1), t(this, "usesIdleWave", !1), t(this, "frameId", 0), t(this, "lastFrameAt", 0), t(this, "easeFrame", (e) => {
|
|
@@ -4696,12 +4650,12 @@ var Oi = [
|
|
|
4696
4650
|
this.frameId = 0;
|
|
4697
4651
|
let n = Math.min(64, Math.max(0, e - this.lastFrameAt));
|
|
4698
4652
|
this.lastFrameAt = e;
|
|
4699
|
-
let r = this.usesIdleWave ?
|
|
4700
|
-
let r = e / 1e3 *
|
|
4701
|
-
return
|
|
4653
|
+
let r = this.usesIdleWave ? wi.map((t, n) => {
|
|
4654
|
+
let r = e / 1e3 * ji * 2 * Math.PI - n * Pi;
|
|
4655
|
+
return Mi + Ni * (Math.sin(r) + 1) / 2;
|
|
4702
4656
|
}) : this.targetBars;
|
|
4703
4657
|
this.displayBars = this.displayBars.map((e, t) => {
|
|
4704
|
-
let i = r[t] ?? 0, a = i > e ?
|
|
4658
|
+
let i = r[t] ?? 0, a = i > e ? ki : Ai;
|
|
4705
4659
|
return e + (i - e) * (1 - Math.exp(-n / a));
|
|
4706
4660
|
}), this.publish();
|
|
4707
4661
|
let i = this.displayBars.every((e, t) => Math.abs((r[t] ?? 0) - e) <= 5e-4);
|
|
@@ -4721,20 +4675,20 @@ var Oi = [
|
|
|
4721
4675
|
this.frameId && this.browser?.cancelAnimationFrame(this.frameId), this.frameId = 0;
|
|
4722
4676
|
}
|
|
4723
4677
|
updateTargets() {
|
|
4724
|
-
let gate = (e) => Math.max(0, e -
|
|
4725
|
-
this.targetBars =
|
|
4678
|
+
let gate = (e) => Math.max(0, e - Oi) / .9, e = this.isMuted && this.level.source === "mic";
|
|
4679
|
+
this.targetBars = wi.map((t) => e ? 0 : gate(Math.min(1, Math.max(0, this.level.bands?.[t] ?? this.level.level)))), this.start();
|
|
4726
4680
|
}
|
|
4727
4681
|
start() {
|
|
4728
4682
|
if (!this.browser || this.browser.matchMedia("(prefers-reduced-motion: reduce)").matches) {
|
|
4729
|
-
this.displayBars = this.usesIdleWave ?
|
|
4683
|
+
this.displayBars = this.usesIdleWave ? Fi : this.targetBars, this.publish();
|
|
4730
4684
|
return;
|
|
4731
4685
|
}
|
|
4732
4686
|
this.frameId || (this.lastFrameAt = this.browser.performance.now(), this.frameId = this.browser.requestAnimationFrame(this.easeFrame));
|
|
4733
4687
|
}
|
|
4734
4688
|
publish() {
|
|
4735
|
-
this.heights.value = this.displayBars.map((e) => Math.round((
|
|
4689
|
+
this.heights.value = this.displayBars.map((e) => Math.round((Ti + Math.min(1, Math.max(0, e)) ** Di * Ei) * 10) / 10);
|
|
4736
4690
|
}
|
|
4737
|
-
},
|
|
4691
|
+
}, Li = {
|
|
4738
4692
|
connecting: {
|
|
4739
4693
|
label: "Connecting",
|
|
4740
4694
|
tone: "bg-amber-500",
|
|
@@ -4772,7 +4726,7 @@ function deriveActivity(e) {
|
|
|
4772
4726
|
return e.hadError ? "error" : e.sessionState === "live" ? e.speaking.bot ? "speaking" : e.speaking.user ? "listening" : e.work.active ? "working" : e.providerThinking ? "thinking" : "listening" : "connecting";
|
|
4773
4727
|
}
|
|
4774
4728
|
function deriveVoiceModePresentation(e) {
|
|
4775
|
-
let t = deriveActivity(e), n =
|
|
4729
|
+
let t = deriveActivity(e), n = Li[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} ${W.slowHint}` : i;
|
|
4776
4730
|
return {
|
|
4777
4731
|
activity: t,
|
|
4778
4732
|
label: a ? o : r,
|
|
@@ -4784,32 +4738,32 @@ function deriveVoiceModePresentation(e) {
|
|
|
4784
4738
|
}
|
|
4785
4739
|
//#endregion
|
|
4786
4740
|
//#region bot/ui/VoiceMode.vue?vue&type=script&setup=true&lang.ts
|
|
4787
|
-
var
|
|
4741
|
+
var Ri = ["data-voice-state", "data-voice-activity"], zi = ["src"], Bi = {
|
|
4788
4742
|
key: 1,
|
|
4789
4743
|
"data-test": "voice-background-fallback",
|
|
4790
4744
|
"aria-hidden": "true",
|
|
4791
4745
|
class: "pointer-events-none absolute inset-0 bg-[#0A1522]"
|
|
4792
|
-
},
|
|
4746
|
+
}, Vi = {
|
|
4793
4747
|
"data-test": "voice-stage",
|
|
4794
4748
|
class: "relative z-10 flex flex-1 flex-col items-center px-8"
|
|
4795
|
-
},
|
|
4749
|
+
}, Hi = { "data-voice-assistant-avatar": "" }, Ui = {
|
|
4796
4750
|
"data-test": "voice-lower-stage",
|
|
4797
4751
|
class: "flex flex-1 flex-col items-center pt-10"
|
|
4798
|
-
},
|
|
4752
|
+
}, Wi = {
|
|
4799
4753
|
"data-test": "voice-histogram",
|
|
4800
4754
|
"aria-hidden": "true",
|
|
4801
4755
|
class: "flex h-[38px] items-center gap-[5px]"
|
|
4802
|
-
},
|
|
4756
|
+
}, Gi = {
|
|
4803
4757
|
"data-test": "voice-presence-status",
|
|
4804
4758
|
role: "status",
|
|
4805
4759
|
"aria-live": "polite",
|
|
4806
4760
|
class: "sr-only"
|
|
4807
|
-
},
|
|
4761
|
+
}, Ki = ["data-taking-longer"], qi = { 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" }, Ji = [
|
|
4808
4762
|
"disabled",
|
|
4809
4763
|
"aria-label",
|
|
4810
4764
|
"aria-pressed",
|
|
4811
4765
|
"title"
|
|
4812
|
-
],
|
|
4766
|
+
], Yi = /* @__PURE__ */ E({
|
|
4813
4767
|
__name: "VoiceMode",
|
|
4814
4768
|
props: {
|
|
4815
4769
|
bot: {},
|
|
@@ -4901,42 +4855,42 @@ var Hi = ["data-voice-state", "data-voice-activity"], Ui = ["src"], Wi = {
|
|
|
4901
4855
|
"aria-hidden": "true",
|
|
4902
4856
|
draggable: "false",
|
|
4903
4857
|
class: "pointer-events-none absolute inset-0 size-full object-cover"
|
|
4904
|
-
}, null, 8,
|
|
4858
|
+
}, null, 8, zi)) : (j(), S("div", Bi)),
|
|
4905
4859
|
n[2] || (n[2] = C("div", {
|
|
4906
4860
|
"data-test": "voice-background-overlay",
|
|
4907
4861
|
"aria-hidden": "true",
|
|
4908
4862
|
class: "pointer-events-none absolute inset-0 bg-gradient-to-b from-[#050F19]/82 via-[#050F19]/90 to-[#050F19]/99"
|
|
4909
4863
|
}, null, -1)),
|
|
4910
|
-
C("div",
|
|
4864
|
+
C("div", Vi, [
|
|
4911
4865
|
n[0] || (n[0] = C("div", {
|
|
4912
4866
|
"data-test": "voice-stage-spacer",
|
|
4913
4867
|
"aria-hidden": "true",
|
|
4914
4868
|
class: "flex-1"
|
|
4915
4869
|
}, null, -1)),
|
|
4916
|
-
C("div",
|
|
4870
|
+
C("div", Hi, [T(We, {
|
|
4917
4871
|
bot: e.bot,
|
|
4918
4872
|
"show-status": !1,
|
|
4919
4873
|
"show-owner-mark": !1,
|
|
4920
4874
|
"is-light": !1,
|
|
4921
4875
|
class: "size-32"
|
|
4922
4876
|
}, null, 8, ["bot"])]),
|
|
4923
|
-
C("div",
|
|
4924
|
-
C("div",
|
|
4877
|
+
C("div", Ui, [
|
|
4878
|
+
C("div", Wi, [(j(!0), S(g, null, N(B(x), (e, t) => (j(), S("span", {
|
|
4925
4879
|
key: t,
|
|
4926
4880
|
"data-test": "voice-histogram-bar",
|
|
4927
4881
|
class: O(["w-[5px] rounded-full transition-colors duration-150", se.value.tone]),
|
|
4928
4882
|
style: k({ height: `${e}px` })
|
|
4929
4883
|
}, null, 6))), 128))]),
|
|
4930
|
-
C("div",
|
|
4884
|
+
C("div", Gi, z(se.value.label), 1),
|
|
4931
4885
|
C("p", {
|
|
4932
4886
|
"data-test": "voice-visible-status",
|
|
4933
4887
|
"data-taking-longer": se.value.takingLonger || void 0,
|
|
4934
4888
|
"aria-hidden": "true",
|
|
4935
4889
|
class: "mt-5 min-h-5 text-center text-sm font-medium tracking-wide text-white/80"
|
|
4936
|
-
}, z(se.value.visibleStatus), 9,
|
|
4890
|
+
}, z(se.value.visibleStatus), 9, Ki)
|
|
4937
4891
|
])
|
|
4938
4892
|
]),
|
|
4939
|
-
C("div",
|
|
4893
|
+
C("div", qi, [C("button", {
|
|
4940
4894
|
ref_key: "endButton",
|
|
4941
4895
|
ref: w,
|
|
4942
4896
|
type: "button",
|
|
@@ -4962,27 +4916,27 @@ var Hi = ["data-voice-state", "data-voice-activity"], Ui = ["src"], Wi = {
|
|
|
4962
4916
|
}, [C("i", {
|
|
4963
4917
|
class: O([_.value ? "i-tabler-microphone-off" : "i-tabler-microphone", "size-[25px]"]),
|
|
4964
4918
|
"aria-hidden": "true"
|
|
4965
|
-
}, null, 2)], 10,
|
|
4966
|
-
], 40,
|
|
4919
|
+
}, null, 2)], 10, Ji)])
|
|
4920
|
+
], 40, Ri));
|
|
4967
4921
|
}
|
|
4968
|
-
}),
|
|
4922
|
+
}), Xi = {
|
|
4969
4923
|
key: 0,
|
|
4970
4924
|
class: "pb-4"
|
|
4971
|
-
},
|
|
4925
|
+
}, Zi = {
|
|
4972
4926
|
key: 1,
|
|
4973
4927
|
"data-test": "messaging-sdk-header",
|
|
4974
4928
|
class: "shrink-0 border-b border-theme-100 px-4 py-3"
|
|
4975
|
-
},
|
|
4929
|
+
}, Qi = { class: "min-w-0 flex-1" }, $i = { class: "truncate text-base font-semibold leading-tight text-theme-900" }, ea = { class: "mt-1 truncate text-sm leading-tight text-theme-500" }, ta = {
|
|
4976
4930
|
key: 0,
|
|
4977
4931
|
class: "shrink-0 rounded-full bg-theme-50 px-2.5 py-1 font-mono text-[11px] font-medium text-theme-500"
|
|
4978
|
-
},
|
|
4932
|
+
}, na = ["aria-label"], ra = {
|
|
4979
4933
|
key: 0,
|
|
4980
4934
|
"data-test": "messaging-empty-state",
|
|
4981
4935
|
class: "flex flex-col items-center justify-center px-4"
|
|
4982
|
-
},
|
|
4936
|
+
}, ia = ["title"], aa = {
|
|
4983
4937
|
key: 0,
|
|
4984
4938
|
class: "flex items-center gap-3 py-3 px-2"
|
|
4985
|
-
},
|
|
4939
|
+
}, oa = ["data-journal-outcome"], sa = [
|
|
4986
4940
|
"data-message-id",
|
|
4987
4941
|
"data-message-sender",
|
|
4988
4942
|
"data-conversation-id",
|
|
@@ -4993,7 +4947,7 @@ var Hi = ["data-voice-state", "data-voice-activity"], Ui = ["src"], Wi = {
|
|
|
4993
4947
|
"data-issue-action-label",
|
|
4994
4948
|
"data-issue-action-url",
|
|
4995
4949
|
"data-streaming"
|
|
4996
|
-
],
|
|
4950
|
+
], ca = { class: "flex items-center gap-3" }, la = ["href"], ua = [
|
|
4997
4951
|
"data-message-id",
|
|
4998
4952
|
"data-message-sender",
|
|
4999
4953
|
"data-conversation-id",
|
|
@@ -5002,7 +4956,7 @@ var Hi = ["data-voice-state", "data-voice-activity"], Ui = ["src"], Wi = {
|
|
|
5002
4956
|
"data-issue-code",
|
|
5003
4957
|
"data-issue-bucket",
|
|
5004
4958
|
"data-streaming"
|
|
5005
|
-
],
|
|
4959
|
+
], da = [
|
|
5006
4960
|
"data-test",
|
|
5007
4961
|
"data-message-id",
|
|
5008
4962
|
"data-message-sender",
|
|
@@ -5012,63 +4966,63 @@ var Hi = ["data-voice-state", "data-voice-activity"], Ui = ["src"], Wi = {
|
|
|
5012
4966
|
"data-streaming",
|
|
5013
4967
|
"data-queued",
|
|
5014
4968
|
"aria-label"
|
|
5015
|
-
],
|
|
4969
|
+
], fa = ["src", "alt"], pa = ["src"], ma = ["href"], ha = {
|
|
5016
4970
|
key: 0,
|
|
5017
4971
|
"data-test": "messaging-message-text-part"
|
|
5018
|
-
},
|
|
4972
|
+
}, ga = [
|
|
5019
4973
|
"src",
|
|
5020
4974
|
"alt",
|
|
5021
4975
|
"data-attachment-placement"
|
|
5022
|
-
],
|
|
4976
|
+
], _a = ["src", "data-attachment-placement"], va = ["href", "data-attachment-placement"], ya = ["data-actions-reveal"], ba = [
|
|
5023
4977
|
"data-copied",
|
|
5024
4978
|
"title",
|
|
5025
4979
|
"aria-label",
|
|
5026
4980
|
"onClick"
|
|
5027
|
-
],
|
|
4981
|
+
], xa = ["onClick"], Sa = ["data-journal-outcome"], Ca = ["data-journal-outcome"], wa = ["data-test", "data-working-description"], Ta = {
|
|
5028
4982
|
key: 0,
|
|
5029
4983
|
class: "truncate"
|
|
5030
|
-
},
|
|
4984
|
+
}, Ea = {
|
|
5031
4985
|
key: 1,
|
|
5032
4986
|
class: "sr-only"
|
|
5033
|
-
},
|
|
4987
|
+
}, Da = ["data-issue-code"], Oa = { class: "min-w-0 flex-1" }, ka = {
|
|
5034
4988
|
"data-test": "messaging-transient-issue-title",
|
|
5035
4989
|
class: "font-medium"
|
|
5036
|
-
},
|
|
4990
|
+
}, Aa = { "data-test": "messaging-transient-issue-help" }, ja = ["href"], Ma = ["inert", "aria-hidden"], Na = ["data-seat-state"], Pa = ["src", "alt"], Fa = { class: "max-w-20 truncate" }, Ia = ["onClick"], La = {
|
|
5037
4991
|
key: 0,
|
|
5038
4992
|
class: "shrink-0 flex items-center justify-center size-14"
|
|
5039
|
-
},
|
|
4993
|
+
}, Ra = ["data-composer-action"], za = ["placeholder", "disabled"], Ba = { class: "font-mono text-sm tabular-nums" }, Va = { class: "mt-2.5 flex items-center" }, Ha = [
|
|
5040
4994
|
"disabled",
|
|
5041
4995
|
"aria-label",
|
|
5042
4996
|
"title"
|
|
5043
|
-
],
|
|
4997
|
+
], Ua = {
|
|
5044
4998
|
key: 0,
|
|
5045
4999
|
class: "i-svg-spinners-ring-resize size-5"
|
|
5046
|
-
},
|
|
5000
|
+
}, Wa = {
|
|
5047
5001
|
key: 1,
|
|
5048
5002
|
class: "i-tabler-plus size-5"
|
|
5049
|
-
},
|
|
5003
|
+
}, Ga = { class: "sr-only" }, Ka = { class: "flex items-center gap-2" }, qa = ["aria-label", "title"], Ja = { class: "sr-only" }, Ya = [
|
|
5050
5004
|
"disabled",
|
|
5051
5005
|
"aria-label",
|
|
5052
5006
|
"title"
|
|
5053
|
-
],
|
|
5007
|
+
], Xa = {
|
|
5054
5008
|
class: "flex h-4 items-center gap-[2px]",
|
|
5055
5009
|
"aria-hidden": "true"
|
|
5056
|
-
},
|
|
5010
|
+
}, Za = [
|
|
5057
5011
|
"data-composer-action",
|
|
5058
5012
|
"disabled",
|
|
5059
5013
|
"aria-label",
|
|
5060
5014
|
"title"
|
|
5061
|
-
],
|
|
5015
|
+
], Qa = {
|
|
5062
5016
|
key: 0,
|
|
5063
5017
|
class: "i-tabler-player-stop-filled size-3.5"
|
|
5064
|
-
},
|
|
5018
|
+
}, $a = {
|
|
5065
5019
|
key: 1,
|
|
5066
5020
|
class: "i-tabler-arrow-up size-[17px]"
|
|
5067
|
-
},
|
|
5021
|
+
}, eo = { class: "sr-only" }, to = {
|
|
5068
5022
|
key: 2,
|
|
5069
5023
|
"data-test": "messaging-ai-notice",
|
|
5070
5024
|
class: "mx-auto max-w-[640px] @5xl/chat:max-w-[720px] pt-3 text-center text-[11.5px] leading-none text-theme-300"
|
|
5071
|
-
},
|
|
5025
|
+
}, no = /*#__PURE__*/ ye(/* @__PURE__ */ E({
|
|
5072
5026
|
__name: "ElBotChat",
|
|
5073
5027
|
props: {
|
|
5074
5028
|
chatController: {},
|
|
@@ -5108,7 +5062,7 @@ var Hi = ["data-voice-state", "data-voice-activity"], Ui = ["src"], Wi = {
|
|
|
5108
5062
|
}, n = v(() => {
|
|
5109
5063
|
let n = { ...t[e.scope] };
|
|
5110
5064
|
return e.scope === "org" && e.scopeName && (n.label = e.scopeName, n.tooltip = `Visible to ${e.scopeName} members`), n;
|
|
5111
|
-
}),
|
|
5065
|
+
}), i = M(), a = M(), o = M();
|
|
5112
5066
|
function containsMarkdownLink(e) {
|
|
5113
5067
|
return e ? /\[[^\]]+\]\([^)]+\)/.test(e) : !1;
|
|
5114
5068
|
}
|
|
@@ -5202,7 +5156,7 @@ var Hi = ["data-voice-state", "data-voice-activity"], Ui = ["src"], Wi = {
|
|
|
5202
5156
|
}), G = v(() => !m.value || le.value || ye.value || E.value.length ? !1 : W.value === void 0), we = v(() => !!le.value || G.value), Te = v(() => c.value?.sendBlockedReason), Ee = v(() => Te.value === "bot_deleted"), De = v(() => h.value ? "Connecting..." : Te.value === "bot_deleted" ? "This assistant was deleted" : "Send a message"), Oe = v(() => s(e.bot.state.value)), ke = v(() => {
|
|
5203
5157
|
if (K.value || !Oe.value || Oe.value === "awake") return;
|
|
5204
5158
|
let t = e.bot.displayName.value || e.bot.name.value || "Your assistant";
|
|
5205
|
-
return Oe.value === "changing" ? `${t} will be right back…` : Oe.value === "stuck" ? `${t} needs attention.` : `${t} is ${
|
|
5159
|
+
return Oe.value === "changing" ? `${t} will be right back…` : Oe.value === "stuck" ? `${t} needs attention.` : `${t} is ${r[Oe.value].toLowerCase()}.`;
|
|
5206
5160
|
}), Ae = v(() => e.chatController?.composerState?.value ?? {
|
|
5207
5161
|
text: "",
|
|
5208
5162
|
pendingAttachments: [],
|
|
@@ -5210,45 +5164,45 @@ var Hi = ["data-voice-state", "data-voice-activity"], Ui = ["src"], Wi = {
|
|
|
5210
5164
|
}), je = v({
|
|
5211
5165
|
get: () => Ae.value.text,
|
|
5212
5166
|
set: (t) => e.chatController?.setComposerText?.({ text: t })
|
|
5213
|
-
}), Me = v(() => Ae.value.pendingAttachments), Ne = v(() => Ae.value.isUploading), Pe = v(() => e.chatController?.voiceRecorder), Fe = v(() => Pe.value?.isBusy.value ?? !1), Ie = v(() => e.chatController?.canAttachFile?.value ?? !1), Le = v(() => e.chatController?.canRecordAudio?.value ?? !1),
|
|
5167
|
+
}), Me = v(() => Ae.value.pendingAttachments), Ne = v(() => Ae.value.isUploading), Pe = v(() => e.chatController?.voiceRecorder), Fe = v(() => Pe.value?.isBusy.value ?? !1), Ie = v(() => e.chatController?.canAttachFile?.value ?? !1), Le = v(() => e.chatController?.canRecordAudio?.value ?? !1), Be = v(() => e.chatController?.composerAction?.value ?? "idle"), Ve = v(() => Be.value !== "idle"), He = v(() => e.chatController?.composerShowsSecondaryStop?.value ?? !1), Ue = v(() => e.chatController?.queuedMessageIds?.value);
|
|
5214
5168
|
function isQueuedMessage(e) {
|
|
5215
|
-
return
|
|
5169
|
+
return Ue.value?.has(e) ?? !1;
|
|
5216
5170
|
}
|
|
5217
|
-
let
|
|
5171
|
+
let Ge = M(), Ke;
|
|
5218
5172
|
function canCopyMessage(e) {
|
|
5219
5173
|
return e.sender === "bot" && e.id !== W.value && !!e.text?.trim();
|
|
5220
5174
|
}
|
|
5221
|
-
let
|
|
5175
|
+
let qe = v(() => [...B.value].reverse().find(canCopyMessage)?.id);
|
|
5222
5176
|
async function copyMessage(t) {
|
|
5223
5177
|
try {
|
|
5224
|
-
await navigator.clipboard.writeText(t.text),
|
|
5225
|
-
|
|
5178
|
+
await navigator.clipboard.writeText(t.text), Ge.value = t.id, clearTimeout(Ke), Ke = setTimeout(() => {
|
|
5179
|
+
Ge.value = void 0;
|
|
5226
5180
|
}, 1500);
|
|
5227
5181
|
} catch (t) {
|
|
5228
5182
|
console.warn("ElBotChat: copy to clipboard rejected", t), e.chatController?.notify?.("Could not copy that message.");
|
|
5229
5183
|
}
|
|
5230
5184
|
}
|
|
5231
|
-
oe(() => clearTimeout(
|
|
5232
|
-
let
|
|
5185
|
+
oe(() => clearTimeout(Ke));
|
|
5186
|
+
let Je = v(() => e.chatController?.canReportMessages ?? !1), Ye = v(() => Be.value === "stop" ? "Stop reply" : He.value ? "Send — answered after current work" : "Send message"), Xe = v(() => Le.value && !Fe.value && !!Pe.value?.canUseBrowserRecording), Ze = v(() => Pe.value?.isActive.value ?? !1), Qe = v(() => Pe.value?.state.value.phase === "sending"), et = v(() => Pe.value?.elapsedLabel.value ?? "0:00"), tt = v(() => {
|
|
5233
5187
|
let e = Pe.value?.state.value.phase;
|
|
5234
5188
|
return e === "preparing" || e === "sending" ? Pe.value?.statusText.value ?? "Starting microphone" : dt.value ? "Release to send" : "Click mic to send";
|
|
5235
|
-
}),
|
|
5236
|
-
de([() => e.bot.avatar.value?.src,
|
|
5237
|
-
let n = ++
|
|
5238
|
-
if (
|
|
5189
|
+
}), nt = v(() => Pe.value?.state.value.phase === "sending" ? "Sending voice message" : Ze.value ? dt.value ? "Release to send voice message" : "Stop and send voice message" : "Record voice message"), K = M(!1), rt = M(), q = M(), J = M(), it = 0, at = v(() => e.chatController?.canStartVoice?.value ?? !1);
|
|
5190
|
+
de([() => e.bot.avatar.value?.src, at], ([e, t]) => {
|
|
5191
|
+
let n = ++it;
|
|
5192
|
+
if (J.value = void 0, !t || !e || typeof Image > "u") return;
|
|
5239
5193
|
let r = new Image();
|
|
5240
5194
|
r.onload = () => {
|
|
5241
|
-
n ===
|
|
5195
|
+
n === it && (J.value = e);
|
|
5242
5196
|
}, r.src = e;
|
|
5243
5197
|
}, { immediate: !0 });
|
|
5244
|
-
let
|
|
5198
|
+
let ot = v(() => at.value && !K.value && !Ze.value && Be.value === "idle"), st = v(() => !p.value), ct = v(() => st.value ? `Voice available when ${e.bot.displayName.value || e.bot.name.value || "the assistant"} is awake` : "Start voice conversation");
|
|
5245
5199
|
function startVoiceConversation() {
|
|
5246
|
-
|
|
5200
|
+
ot.value && !st.value && (q.value = J.value, K.value = !0);
|
|
5247
5201
|
}
|
|
5248
5202
|
async function endVoiceConversation() {
|
|
5249
5203
|
if (!K.value) return;
|
|
5250
5204
|
let t = rt.value;
|
|
5251
|
-
K.value = !1,
|
|
5205
|
+
K.value = !1, q.value = void 0, await re(), await t?.end(), window.matchMedia("(pointer: coarse)").matches || a.value?.focus(), await e.chatController?.refreshMessages();
|
|
5252
5206
|
}
|
|
5253
5207
|
let Y = v(() => e.variant === "light"), lt = v(() => Y.value ? "bg-theme-200/70" : "bg-white/15"), ut = v(() => Y.value ? "text-theme-300" : "text-white/30");
|
|
5254
5208
|
ae(async () => {
|
|
@@ -5257,17 +5211,17 @@ var Hi = ["data-voice-state", "data-voice-activity"], Ui = ["src"], Wi = {
|
|
|
5257
5211
|
e.chatController?.voiceRecorder?.teardown();
|
|
5258
5212
|
});
|
|
5259
5213
|
async function sendMessage() {
|
|
5260
|
-
e.chatController &&
|
|
5214
|
+
e.chatController && Be.value === "send" && (a.value && (a.value.style.height = "auto", window.matchMedia("(pointer: coarse)").matches ? (a.value.blur(), requestAnimationFrame(() => {
|
|
5261
5215
|
let e = document.activeElement;
|
|
5262
5216
|
e && (e.tagName === "TEXTAREA" || e.tagName === "INPUT") && e.blur();
|
|
5263
|
-
})) : a.value.focus()),
|
|
5217
|
+
})) : a.value.focus()), i.value?.pin(), await e.chatController.sendComposerMessage());
|
|
5264
5218
|
}
|
|
5265
5219
|
async function handleCardAction(t) {
|
|
5266
|
-
e.chatController && !Ee.value && (
|
|
5220
|
+
e.chatController && !Ee.value && (i.value?.pin(), await e.chatController.sendChatMessage(t));
|
|
5267
5221
|
}
|
|
5268
5222
|
async function handleComposerAction() {
|
|
5269
5223
|
if (e.chatController) {
|
|
5270
|
-
if (
|
|
5224
|
+
if (Be.value === "send") {
|
|
5271
5225
|
await sendMessage();
|
|
5272
5226
|
return;
|
|
5273
5227
|
}
|
|
@@ -5347,21 +5301,21 @@ var Hi = ["data-voice-state", "data-voice-activity"], Ui = ["src"], Wi = {
|
|
|
5347
5301
|
...o ? {} : { year: "numeric" }
|
|
5348
5302
|
})}, ${a}`;
|
|
5349
5303
|
}
|
|
5350
|
-
return (t,
|
|
5304
|
+
return (t, r) => (j(), S("div", {
|
|
5351
5305
|
"data-test": "messaging-root",
|
|
5352
5306
|
class: O(["@container/chat relative flex h-full flex-col", B.value.length === 0 ? "min-h-0 [justify-content:safe_center] overflow-y-auto" : ""])
|
|
5353
5307
|
}, [
|
|
5354
|
-
e.showHeader && !Y.value ? (j(), S("div",
|
|
5308
|
+
e.showHeader && !Y.value ? (j(), S("div", Xi, [T(ze, {
|
|
5355
5309
|
bot: e.bot,
|
|
5356
5310
|
"is-online": p.value
|
|
5357
|
-
}, null, 8, ["bot", "is-online"])])) : e.showHeader ? (j(), S("div",
|
|
5358
|
-
T(
|
|
5311
|
+
}, null, 8, ["bot", "is-online"])])) : e.showHeader ? (j(), S("div", Zi, [C("div", { class: O(["flex items-center gap-3", e.centered ? "max-w-[640px] @5xl/chat:max-w-[720px] mx-auto" : ""]) }, [
|
|
5312
|
+
T(We, {
|
|
5359
5313
|
bot: e.bot,
|
|
5360
5314
|
"is-light": Y.value,
|
|
5361
5315
|
class: "size-10"
|
|
5362
5316
|
}, null, 8, ["bot", "is-light"]),
|
|
5363
|
-
C("div",
|
|
5364
|
-
e.headerMeta ? (j(), S("span",
|
|
5317
|
+
C("div", Qi, [C("div", $i, z(e.bot.displayName.value), 1), C("div", ea, z(e.bot.title.value || "Assistant"), 1)]),
|
|
5318
|
+
e.headerMeta ? (j(), S("span", ta, z(e.headerMeta), 1)) : x("", !0)
|
|
5365
5319
|
], 2)])) : x("", !0),
|
|
5366
5320
|
T(_, { name: "voice-call" }, {
|
|
5367
5321
|
default: he(() => [K.value ? (j(), S("div", {
|
|
@@ -5371,13 +5325,13 @@ var Hi = ["data-voice-state", "data-voice-activity"], Ui = ["src"], Wi = {
|
|
|
5371
5325
|
"aria-modal": "true",
|
|
5372
5326
|
"aria-label": `Voice conversation with ${e.bot.displayName.value}`,
|
|
5373
5327
|
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",
|
|
5374
|
-
onKeydown:
|
|
5375
|
-
}, [T(
|
|
5328
|
+
onKeydown: r[0] || (r[0] = _e((e) => endVoiceConversation(), ["esc"]))
|
|
5329
|
+
}, [T(Yi, {
|
|
5376
5330
|
ref_key: "voiceMode",
|
|
5377
5331
|
ref: rt,
|
|
5378
5332
|
bot: e.bot,
|
|
5379
5333
|
"chat-controller": e.chatController,
|
|
5380
|
-
"backdrop-src":
|
|
5334
|
+
"backdrop-src": q.value,
|
|
5381
5335
|
"is-light": !1,
|
|
5382
5336
|
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)]",
|
|
5383
5337
|
onEnd: endVoiceConversation
|
|
@@ -5385,7 +5339,7 @@ var Hi = ["data-voice-state", "data-voice-activity"], Ui = ["src"], Wi = {
|
|
|
5385
5339
|
"bot",
|
|
5386
5340
|
"chat-controller",
|
|
5387
5341
|
"backdrop-src"
|
|
5388
|
-
])], 40,
|
|
5342
|
+
])], 40, na)) : x("", !0)]),
|
|
5389
5343
|
_: 1
|
|
5390
5344
|
}),
|
|
5391
5345
|
h.value ? (j(), S("div", {
|
|
@@ -5394,28 +5348,28 @@ var Hi = ["data-voice-state", "data-voice-activity"], Ui = ["src"], Wi = {
|
|
|
5394
5348
|
}, [T(Ce, { class: "size-4" })], 2)) : e.setupHint ? (j(), S("div", {
|
|
5395
5349
|
key: 3,
|
|
5396
5350
|
class: O(["flex items-center justify-center gap-1.5 py-2 text-[11px]", ut.value])
|
|
5397
|
-
}, [
|
|
5398
|
-
T(
|
|
5351
|
+
}, [r[14] || (r[14] = C("i", { class: "i-tabler-tool size-3" }, null, -1)), C("span", null, z(e.setupHint), 1)], 2)) : x("", !0),
|
|
5352
|
+
T(xi, {
|
|
5399
5353
|
ref_key: "chatScroller",
|
|
5400
|
-
ref:
|
|
5354
|
+
ref: i,
|
|
5401
5355
|
inert: K.value,
|
|
5402
5356
|
"aria-hidden": K.value ? "true" : void 0,
|
|
5403
5357
|
class: O(B.value.length === 0 ? "flex-none" : "flex-1")
|
|
5404
5358
|
}, {
|
|
5405
5359
|
default: he(() => [C("div", { class: O([B.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 ? B.value.length === 0 ? "max-w-[900px] mx-auto w-full" : "max-w-[640px] @5xl/chat:max-w-[720px] mx-auto w-full" : ""]) }, [
|
|
5406
|
-
B.value.length === 0 && !h.value ? (j(), S("div",
|
|
5360
|
+
B.value.length === 0 && !h.value ? (j(), S("div", ra, [se(t.$slots, "empty-heading", {
|
|
5407
5361
|
bot: e.bot,
|
|
5408
5362
|
isLight: Y.value
|
|
5409
|
-
}, () => [T(
|
|
5363
|
+
}, () => [T(We, {
|
|
5410
5364
|
bot: e.bot,
|
|
5411
5365
|
"is-light": Y.value,
|
|
5412
5366
|
class: "mb-4 size-20 @sm/chat:size-24"
|
|
5413
5367
|
}, null, 8, ["bot", "is-light"]), C("div", { class: O(["text-base @sm/chat:text-lg font-semibold", Y.value ? "text-theme-900" : "text-white"]) }, z(e.bot.displayName.value), 3)], !0), e.emptyStateMessage === "" ? x("", !0) : (j(), S(g, { key: 0 }, [C("p", { class: O(["mt-1 text-center text-xs @sm/chat:text-sm", ut.value]) }, z(e.emptyStateMessage || "Type your message to get started."), 3), C("div", {
|
|
5414
5368
|
class: O(["inline-flex items-center gap-1.5 mt-5 px-2.5 py-1 rounded-full text-[11px]", Y.value ? "bg-theme-50 border border-theme-100 text-theme-400" : "bg-white/10 border border-white/20 text-white/40"]),
|
|
5415
5369
|
title: n.value.tooltip
|
|
5416
|
-
}, [C("i", { class: O([n.value.icon, "size-3"]) }, null, 2), C("span", null, z(n.value.label), 1)], 10,
|
|
5370
|
+
}, [C("i", { class: O([n.value.icon, "size-3"]) }, null, 2), C("span", null, z(n.value.label), 1)], 10, ia)], 64))])) : x("", !0),
|
|
5417
5371
|
(j(!0), S(g, null, N(B.value, (t, n) => (j(), S(g, { key: t.id }, [
|
|
5418
|
-
shouldShowTimeDivider(B.value, n) ? (j(), S("div",
|
|
5372
|
+
shouldShowTimeDivider(B.value, n) ? (j(), S("div", aa, [
|
|
5419
5373
|
C("div", { class: O(["flex-1 h-px", lt.value]) }, null, 2),
|
|
5420
5374
|
C("span", { class: O(["text-[10px] @sm/chat:text-[11px] font-medium shrink-0 tracking-widest uppercase", ut.value]) }, z(shouldShowTimeDivider(B.value, n)), 3),
|
|
5421
5375
|
C("div", { class: O(["flex-1 h-px", lt.value]) }, null, 2)
|
|
@@ -5425,10 +5379,10 @@ var Hi = ["data-voice-state", "data-voice-activity"], Ui = ["src"], Wi = {
|
|
|
5425
5379
|
"data-test": "messaging-message-tool-activity",
|
|
5426
5380
|
"data-journal-outcome": messageWorkJournal(t)?.outcome,
|
|
5427
5381
|
class: "mb-4 w-full"
|
|
5428
|
-
}, [T(
|
|
5382
|
+
}, [T($e, {
|
|
5429
5383
|
model: messageWorkJournal(t),
|
|
5430
5384
|
"is-light": Y.value
|
|
5431
|
-
}, null, 8, ["model", "is-light"])], 8,
|
|
5385
|
+
}, null, 8, ["model", "is-light"])], 8, oa)) : x("", !0),
|
|
5432
5386
|
isSystemExplainerMessage(t) ? (j(), S("section", {
|
|
5433
5387
|
key: 2,
|
|
5434
5388
|
"data-test": "messaging-system-msg",
|
|
@@ -5443,24 +5397,24 @@ var Hi = ["data-voice-state", "data-voice-activity"], Ui = ["src"], Wi = {
|
|
|
5443
5397
|
"data-issue-action-url": t.issue?.actionUrl,
|
|
5444
5398
|
"data-streaming": t.id === W.value ? "true" : void 0,
|
|
5445
5399
|
class: "mb-6 w-full"
|
|
5446
|
-
}, [C("div", { class: O(["mb-1.5 text-center text-[10.5px] font-medium", ut.value]) }, "System message", 2), C("div",
|
|
5400
|
+
}, [C("div", { class: O(["mb-1.5 text-center text-[10.5px] font-medium", ut.value]) }, "System message", 2), C("div", ca, [
|
|
5447
5401
|
C("span", {
|
|
5448
5402
|
"data-test": "messaging-system-divider-line",
|
|
5449
5403
|
"aria-hidden": "true",
|
|
5450
5404
|
class: O(["hidden h-px flex-1 opacity-60 @md/chat:block", lt.value])
|
|
5451
5405
|
}, null, 2),
|
|
5452
|
-
C("div", { class: O(["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]", Y.value ? "text-theme-700 ring-theme-200/50" : "text-white/85 ring-white/10"]) }, [t.text ? (j(), b(
|
|
5406
|
+
C("div", { class: O(["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]", Y.value ? "text-theme-700 ring-theme-200/50" : "text-white/85 ring-white/10"]) }, [t.text ? (j(), b(vi, {
|
|
5453
5407
|
key: 0,
|
|
5454
5408
|
text: t.text,
|
|
5455
5409
|
inverted: !Y.value,
|
|
5456
5410
|
streaming: t.id === W.value,
|
|
5457
|
-
onClick:
|
|
5411
|
+
onClick: r[1] || (r[1] = ve(() => {}, ["stop"])),
|
|
5458
5412
|
onAction: handleCardAction
|
|
5459
5413
|
}, null, 8, [
|
|
5460
5414
|
"text",
|
|
5461
5415
|
"inverted",
|
|
5462
5416
|
"streaming"
|
|
5463
|
-
])) : t.issue?.help ? (j(), b(
|
|
5417
|
+
])) : t.issue?.help ? (j(), b(vi, {
|
|
5464
5418
|
key: 1,
|
|
5465
5419
|
text: t.issue.help,
|
|
5466
5420
|
inverted: !Y.value
|
|
@@ -5469,14 +5423,14 @@ var Hi = ["data-voice-state", "data-voice-activity"], Ui = ["src"], Wi = {
|
|
|
5469
5423
|
href: t.issue.actionUrl,
|
|
5470
5424
|
"data-test": "messaging-system-msg-action",
|
|
5471
5425
|
class: O(["mt-2 text-[12px] font-medium inline-flex items-center gap-1", Y.value ? "text-theme-900 hover:text-theme-700" : "text-white hover:text-white/80"]),
|
|
5472
|
-
onClick:
|
|
5473
|
-
}, [w(z(t.issue.actionLabel) + " ", 1),
|
|
5426
|
+
onClick: r[2] || (r[2] = ve(() => {}, ["stop"]))
|
|
5427
|
+
}, [w(z(t.issue.actionLabel) + " ", 1), r[15] || (r[15] = C("i", { class: "i-tabler-arrow-right size-3" }, null, -1))], 10, la)) : x("", !0)], 2),
|
|
5474
5428
|
C("span", {
|
|
5475
5429
|
"data-test": "messaging-system-divider-line",
|
|
5476
5430
|
"aria-hidden": "true",
|
|
5477
5431
|
class: O(["hidden h-px flex-1 opacity-60 @md/chat:block", lt.value])
|
|
5478
5432
|
}, null, 2)
|
|
5479
|
-
])], 8,
|
|
5433
|
+
])], 8, sa)) : t.sender === "system" ? (j(), S("div", {
|
|
5480
5434
|
key: 3,
|
|
5481
5435
|
"data-test": "messaging-system-status-msg",
|
|
5482
5436
|
"data-message-id": t.id,
|
|
@@ -5488,14 +5442,14 @@ var Hi = ["data-voice-state", "data-voice-activity"], Ui = ["src"], Wi = {
|
|
|
5488
5442
|
"data-issue-bucket": t.issue?.bucket,
|
|
5489
5443
|
"data-streaming": t.id === W.value ? "true" : void 0,
|
|
5490
5444
|
class: O(["mb-4 flex w-fit max-w-[85%] items-start gap-2 rounded-2xl px-3 py-2 text-[13px] leading-relaxed ring-1", Y.value ? "bg-theme-100 text-theme-600 ring-theme-200" : "bg-white/10 text-white/70 ring-white/10"])
|
|
5491
|
-
}, [
|
|
5445
|
+
}, [r[16] || (r[16] = C("i", {
|
|
5492
5446
|
class: "i-tabler-info-circle size-4 mt-0.5 shrink-0",
|
|
5493
5447
|
"aria-hidden": "true"
|
|
5494
|
-
}, null, -1)), T(
|
|
5448
|
+
}, null, -1)), T(vi, {
|
|
5495
5449
|
text: t.text,
|
|
5496
5450
|
inverted: !Y.value,
|
|
5497
|
-
onClick:
|
|
5498
|
-
}, null, 8, ["text", "inverted"])], 10,
|
|
5451
|
+
onClick: r[3] || (r[3] = ve(() => {}, ["stop"]))
|
|
5452
|
+
}, null, 8, ["text", "inverted"])], 10, ua)) : (j(), S("div", {
|
|
5499
5453
|
key: 4,
|
|
5500
5454
|
"data-test": t.sender === "bot" ? "messaging-assistant-msg" : t.sender === "user" ? "messaging-user-msg" : void 0,
|
|
5501
5455
|
"data-message-id": t.id,
|
|
@@ -5526,14 +5480,14 @@ var Hi = ["data-voice-state", "data-voice-activity"], Ui = ["src"], Wi = {
|
|
|
5526
5480
|
"data-test": "messaging-attachment",
|
|
5527
5481
|
"data-attachment-placement": "block",
|
|
5528
5482
|
class: "rounded-xl object-cover max-h-48 max-w-[240px] @sm/chat:max-w-[320px]"
|
|
5529
|
-
}, null, 8,
|
|
5483
|
+
}, null, 8, fa)) : e.type === "audio" ? (j(), S("audio", {
|
|
5530
5484
|
key: 1,
|
|
5531
5485
|
src: e.src,
|
|
5532
5486
|
controls: "",
|
|
5533
5487
|
"data-test": "messaging-attachment",
|
|
5534
5488
|
"data-attachment-placement": "block",
|
|
5535
5489
|
class: "max-w-full"
|
|
5536
|
-
}, null, 8,
|
|
5490
|
+
}, null, 8, pa)) : (j(), S("a", {
|
|
5537
5491
|
key: 2,
|
|
5538
5492
|
href: e.src,
|
|
5539
5493
|
target: "_blank",
|
|
@@ -5541,16 +5495,16 @@ var Hi = ["data-voice-state", "data-voice-activity"], Ui = ["src"], Wi = {
|
|
|
5541
5495
|
"data-test": "messaging-attachment",
|
|
5542
5496
|
"data-attachment-placement": "block",
|
|
5543
5497
|
class: O(["inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", Y.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
|
|
5544
|
-
}, [
|
|
5498
|
+
}, [r[17] || (r[17] = C("i", { class: "i-tabler-file size-3.5" }, null, -1)), w(" " + z(e.filename), 1)], 10, ma))], 64))), 128))], 2)) : x("", !0),
|
|
5545
5499
|
messageRenderParts(t).length ? (j(), S("div", {
|
|
5546
5500
|
key: 1,
|
|
5547
5501
|
"data-test": "messaging-message-content",
|
|
5548
5502
|
class: O(t.sender === "user" ? Y.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" : Y.value ? "text-theme-800" : "text-white/95")
|
|
5549
|
-
}, [(j(!0), S(g, null, N(messageRenderParts(t), (e) => (j(), S(g, { key: e.key }, [e.kind === "text" && e.text ? (j(), S("div",
|
|
5503
|
+
}, [(j(!0), S(g, null, N(messageRenderParts(t), (e) => (j(), S(g, { key: e.key }, [e.kind === "text" && e.text ? (j(), S("div", ha, [T(vi, {
|
|
5550
5504
|
text: e.text,
|
|
5551
5505
|
inverted: t.sender === "user" || !Y.value,
|
|
5552
5506
|
streaming: t.id === W.value,
|
|
5553
|
-
onClick:
|
|
5507
|
+
onClick: r[4] || (r[4] = ve(() => {}, ["stop"])),
|
|
5554
5508
|
onAction: handleCardAction
|
|
5555
5509
|
}, null, 8, [
|
|
5556
5510
|
"text",
|
|
@@ -5563,14 +5517,14 @@ var Hi = ["data-voice-state", "data-voice-activity"], Ui = ["src"], Wi = {
|
|
|
5563
5517
|
"data-test": "messaging-attachment",
|
|
5564
5518
|
"data-attachment-placement": e.placement,
|
|
5565
5519
|
class: "my-2 rounded-xl object-cover max-h-48 max-w-[240px] @sm/chat:max-w-[320px]"
|
|
5566
|
-
}, null, 8,
|
|
5520
|
+
}, null, 8, ga)) : e.kind === "attachment" && e.attachment.type === "audio" ? (j(), S("audio", {
|
|
5567
5521
|
key: 2,
|
|
5568
5522
|
src: e.attachment.src,
|
|
5569
5523
|
controls: "",
|
|
5570
5524
|
"data-test": "messaging-attachment",
|
|
5571
5525
|
"data-attachment-placement": e.placement,
|
|
5572
5526
|
class: "my-2 max-w-full"
|
|
5573
|
-
}, null, 8,
|
|
5527
|
+
}, null, 8, _a)) : e.kind === "attachment" ? (j(), S("a", {
|
|
5574
5528
|
key: 3,
|
|
5575
5529
|
href: e.attachment.src,
|
|
5576
5530
|
target: "_blank",
|
|
@@ -5578,24 +5532,24 @@ var Hi = ["data-voice-state", "data-voice-activity"], Ui = ["src"], Wi = {
|
|
|
5578
5532
|
"data-test": "messaging-attachment",
|
|
5579
5533
|
"data-attachment-placement": e.placement,
|
|
5580
5534
|
class: O(["my-2 inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", Y.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
|
|
5581
|
-
}, [
|
|
5535
|
+
}, [r[18] || (r[18] = C("i", { class: "i-tabler-file size-3.5" }, null, -1)), w(" " + z(e.attachment.filename), 1)], 10, va)) : x("", !0)], 64))), 128))], 2)) : x("", !0),
|
|
5582
5536
|
canCopyMessage(t) ? (j(), S("div", {
|
|
5583
5537
|
key: 2,
|
|
5584
5538
|
"data-test": "messaging-message-actions",
|
|
5585
|
-
"data-actions-reveal": t.id ===
|
|
5586
|
-
class: O(["-ml-1 flex items-center gap-1 pt-1 transition-opacity", [Y.value ? "text-theme-300" : "text-white/35", t.id ===
|
|
5539
|
+
"data-actions-reveal": t.id === qe.value ? "always" : "hover",
|
|
5540
|
+
class: O(["-ml-1 flex items-center gap-1 pt-1 transition-opacity", [Y.value ? "text-theme-300" : "text-white/35", t.id === qe.value ? "" : "opacity-0 group-hover/msg:opacity-100 focus-within:opacity-100 pointer-coarse:opacity-100"]])
|
|
5587
5541
|
}, [C("button", {
|
|
5588
5542
|
type: "button",
|
|
5589
5543
|
"data-test": "messaging-message-copy",
|
|
5590
|
-
"data-copied":
|
|
5591
|
-
title:
|
|
5592
|
-
"aria-label":
|
|
5544
|
+
"data-copied": Ge.value === t.id || void 0,
|
|
5545
|
+
title: Ge.value === t.id ? "Copied" : "Copy",
|
|
5546
|
+
"aria-label": Ge.value === t.id ? "Copied" : "Copy",
|
|
5593
5547
|
class: O(["grid size-6 cursor-pointer place-items-center transition-colors", Y.value ? "hover:text-theme-800" : "hover:text-white"]),
|
|
5594
5548
|
onClick: ve((e) => copyMessage(t), ["stop"])
|
|
5595
5549
|
}, [C("i", {
|
|
5596
|
-
class: O(["size-3.5",
|
|
5550
|
+
class: O(["size-3.5", Ge.value === t.id ? "i-tabler-check" : "i-tabler-copy"]),
|
|
5597
5551
|
"aria-hidden": "true"
|
|
5598
|
-
}, null, 2)], 10,
|
|
5552
|
+
}, null, 2)], 10, ba), Je.value ? (j(), S("button", {
|
|
5599
5553
|
key: 0,
|
|
5600
5554
|
type: "button",
|
|
5601
5555
|
"data-test": "messaging-message-report",
|
|
@@ -5603,28 +5557,28 @@ var Hi = ["data-voice-state", "data-voice-activity"], Ui = ["src"], Wi = {
|
|
|
5603
5557
|
"aria-label": "Report",
|
|
5604
5558
|
class: O(["grid size-6 cursor-pointer place-items-center transition-colors", Y.value ? "hover:text-theme-800" : "hover:text-white"]),
|
|
5605
5559
|
onClick: ve((n) => e.chatController?.reportMessage(t.id), ["stop"])
|
|
5606
|
-
}, [...
|
|
5560
|
+
}, [...r[19] || (r[19] = [C("i", {
|
|
5607
5561
|
class: "i-tabler-flag size-3.5",
|
|
5608
5562
|
"aria-hidden": "true"
|
|
5609
|
-
}, null, -1)])], 10,
|
|
5610
|
-
], 2)], 10,
|
|
5563
|
+
}, null, -1)])], 10, xa)) : x("", !0)], 10, ya)) : x("", !0)
|
|
5564
|
+
], 2)], 10, da)),
|
|
5611
5565
|
t.id === Se.value ? (j(), S(g, { key: 5 }, [E.value.length ? (j(!0), S(g, { key: 0 }, N(E.value, (e) => (j(), S(g, { key: e.id }, [e.kind === "work" ? (j(), S("div", {
|
|
5612
5566
|
key: 0,
|
|
5613
5567
|
"data-test": "messaging-tool-activity",
|
|
5614
5568
|
"data-journal-outcome": e.journal.outcome,
|
|
5615
5569
|
class: "chat-live-enter mb-4 w-full"
|
|
5616
|
-
}, [T(
|
|
5570
|
+
}, [T($e, {
|
|
5617
5571
|
model: e.journal,
|
|
5618
5572
|
"is-light": Y.value
|
|
5619
|
-
}, null, 8, ["model", "is-light"])], 8,
|
|
5573
|
+
}, null, 8, ["model", "is-light"])], 8, Sa)) : e.kind === "text" && e.content ? (j(), S("div", {
|
|
5620
5574
|
key: 1,
|
|
5621
5575
|
"data-test": "messaging-live-text-block",
|
|
5622
5576
|
class: O(["mb-4", Y.value ? "text-theme-800" : "text-white/95"])
|
|
5623
|
-
}, [T(
|
|
5577
|
+
}, [T(vi, {
|
|
5624
5578
|
text: e.content,
|
|
5625
5579
|
inverted: !Y.value,
|
|
5626
5580
|
streaming: e.id === ie.value,
|
|
5627
|
-
onClick:
|
|
5581
|
+
onClick: r[5] || (r[5] = ve(() => {}, ["stop"])),
|
|
5628
5582
|
onAction: handleCardAction
|
|
5629
5583
|
}, null, 8, [
|
|
5630
5584
|
"text",
|
|
@@ -5635,7 +5589,7 @@ var Hi = ["data-voice-state", "data-voice-activity"], Ui = ["src"], Wi = {
|
|
|
5635
5589
|
"data-test": "messaging-tool-activity-tail",
|
|
5636
5590
|
"aria-label": "Assistant is still working",
|
|
5637
5591
|
class: O(["chat-live-enter mb-4 grid h-[17px] w-5 place-items-center", Y.value ? "text-theme-500" : "text-white/70"])
|
|
5638
|
-
}, [...
|
|
5592
|
+
}, [...r[20] || (r[20] = [C("span", {
|
|
5639
5593
|
class: "chat-dots chat-dots--mini",
|
|
5640
5594
|
"aria-hidden": "true"
|
|
5641
5595
|
}, [
|
|
@@ -5647,10 +5601,10 @@ var Hi = ["data-voice-state", "data-voice-activity"], Ui = ["src"], Wi = {
|
|
|
5647
5601
|
"data-test": "messaging-tool-activity",
|
|
5648
5602
|
"data-journal-outcome": ye.value.outcome,
|
|
5649
5603
|
class: "chat-live-enter mb-4 w-full"
|
|
5650
|
-
}, [T(
|
|
5604
|
+
}, [T($e, {
|
|
5651
5605
|
model: ye.value,
|
|
5652
5606
|
"is-light": Y.value
|
|
5653
|
-
}, null, 8, ["model", "is-light"])], 8,
|
|
5607
|
+
}, null, 8, ["model", "is-light"])], 8, Ca)) : x("", !0)], 64)) : x("", !0)
|
|
5654
5608
|
], 64))), 128)),
|
|
5655
5609
|
we.value ? (j(), S("div", {
|
|
5656
5610
|
key: 1,
|
|
@@ -5659,7 +5613,7 @@ var Hi = ["data-voice-state", "data-voice-activity"], Ui = ["src"], Wi = {
|
|
|
5659
5613
|
role: "status",
|
|
5660
5614
|
"aria-live": "polite",
|
|
5661
5615
|
class: O(["chat-live-enter relative mb-4 flex h-[17px] items-center gap-2.5 pl-0.5 text-[13.5px] leading-snug", Y.value ? "text-theme-500" : "text-white/50"])
|
|
5662
|
-
}, [
|
|
5616
|
+
}, [r[21] || (r[21] = C("span", {
|
|
5663
5617
|
"data-test": "messaging-thinking-dots",
|
|
5664
5618
|
class: "chat-dots shrink-0",
|
|
5665
5619
|
"aria-hidden": "true"
|
|
@@ -5667,7 +5621,7 @@ var Hi = ["data-voice-state", "data-voice-activity"], Ui = ["src"], Wi = {
|
|
|
5667
5621
|
C("span"),
|
|
5668
5622
|
C("span"),
|
|
5669
5623
|
C("span")
|
|
5670
|
-
], -1)), le.value ? (j(), S("span",
|
|
5624
|
+
], -1)), le.value ? (j(), S("span", Ta, z(le.value), 1)) : (j(), S("span", Ea, "Thinking"))], 10, wa)) : x("", !0),
|
|
5671
5625
|
H.value ? (j(), S("div", {
|
|
5672
5626
|
key: 2,
|
|
5673
5627
|
"data-test": "messaging-transient-issue",
|
|
@@ -5675,18 +5629,18 @@ var Hi = ["data-voice-state", "data-voice-activity"], Ui = ["src"], Wi = {
|
|
|
5675
5629
|
role: "alert",
|
|
5676
5630
|
class: O(["chat-live-enter mb-4 flex items-start gap-2 px-2 text-[13px] leading-snug", Y.value ? "text-theme-600" : "text-white/60"])
|
|
5677
5631
|
}, [
|
|
5678
|
-
|
|
5632
|
+
r[23] || (r[23] = C("i", {
|
|
5679
5633
|
class: "i-tabler-alert-circle size-3.5 shrink-0 text-red-500",
|
|
5680
5634
|
"aria-hidden": "true"
|
|
5681
5635
|
}, null, -1)),
|
|
5682
|
-
C("span",
|
|
5636
|
+
C("span", Oa, [C("span", ka, [w(z(H.value.message), 1), H.value.help ? (j(), S(g, { key: 0 }, [w(":")], 64)) : x("", !0)]), H.value.help ? (j(), S(g, { key: 0 }, [r[22] || (r[22] = w(z(" "), -1)), C("span", Aa, z(H.value.help), 1)], 64)) : x("", !0)]),
|
|
5683
5637
|
H.value.actionUrl && H.value.actionLabel ? (j(), S("a", {
|
|
5684
5638
|
key: 0,
|
|
5685
5639
|
href: H.value.actionUrl,
|
|
5686
5640
|
class: "shrink-0 underline underline-offset-2",
|
|
5687
|
-
onClick:
|
|
5688
|
-
}, z(H.value.actionLabel), 9,
|
|
5689
|
-
], 10,
|
|
5641
|
+
onClick: r[6] || (r[6] = ve(() => {}, ["stop"]))
|
|
5642
|
+
}, z(H.value.actionLabel), 9, ja)) : x("", !0)
|
|
5643
|
+
], 10, Da)) : x("", !0)
|
|
5690
5644
|
], 2)]),
|
|
5691
5645
|
_: 3
|
|
5692
5646
|
}, 8, [
|
|
@@ -5710,7 +5664,7 @@ var Hi = ["data-voice-state", "data-voice-activity"], Ui = ["src"], Wi = {
|
|
|
5710
5664
|
role: "status",
|
|
5711
5665
|
"aria-live": "polite",
|
|
5712
5666
|
class: O(["py-3 text-center text-[14px]", Y.value ? "text-theme-500" : "text-white/70"])
|
|
5713
|
-
}, z(ke.value), 11,
|
|
5667
|
+
}, z(ke.value), 11, Na)) : (j(), S(g, { key: 1 }, [
|
|
5714
5668
|
Me.value.length > 0 ? (j(), S("div", {
|
|
5715
5669
|
key: 0,
|
|
5716
5670
|
class: O(["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" : ""])
|
|
@@ -5722,13 +5676,13 @@ var Hi = ["data-voice-state", "data-voice-activity"], Ui = ["src"], Wi = {
|
|
|
5722
5676
|
src: e.src,
|
|
5723
5677
|
alt: e.filename,
|
|
5724
5678
|
class: O(["size-14 rounded-xl object-cover border", Y.value ? "border-black/10" : "border-white/20"])
|
|
5725
|
-
}, null, 10,
|
|
5679
|
+
}, null, 10, Pa)) : (j(), S("div", {
|
|
5726
5680
|
key: 1,
|
|
5727
5681
|
class: O(["h-14 px-3 rounded-xl flex items-center gap-1.5 text-xs border", Y.value ? "border-black/10 bg-theme-50 text-theme-600" : "border-white/20 bg-white/10 text-white/70"])
|
|
5728
|
-
}, [
|
|
5682
|
+
}, [r[24] || (r[24] = C("i", { class: "i-tabler-file size-4" }, null, -1)), C("span", Fa, z(e.filename), 1)], 2)), C("button", {
|
|
5729
5683
|
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",
|
|
5730
5684
|
onClick: (e) => removeAttachment(t)
|
|
5731
|
-
}, [...
|
|
5685
|
+
}, [...r[25] || (r[25] = [C("i", { class: "i-tabler-x size-3" }, null, -1)])], 8, Ia)]))), 128)), Ne.value ? (j(), S("div", La, [T(Ce, { class: "size-5" })])) : x("", !0)], 2)) : x("", !0),
|
|
5732
5686
|
Ie.value ? (j(), S("input", {
|
|
5733
5687
|
key: 1,
|
|
5734
5688
|
ref_key: "fileInput",
|
|
@@ -5740,7 +5694,7 @@ var Hi = ["data-voice-state", "data-voice-activity"], Ui = ["src"], Wi = {
|
|
|
5740
5694
|
}, null, 544)) : x("", !0),
|
|
5741
5695
|
C("div", {
|
|
5742
5696
|
"data-test": "messaging-composer",
|
|
5743
|
-
"data-composer-action":
|
|
5697
|
+
"data-composer-action": Be.value,
|
|
5744
5698
|
class: O(["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" : "", Y.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"]]),
|
|
5745
5699
|
onClick: focusComposer
|
|
5746
5700
|
}, [Ze.value ? (j(), S("div", {
|
|
@@ -5748,14 +5702,14 @@ var Hi = ["data-voice-state", "data-voice-activity"], Ui = ["src"], Wi = {
|
|
|
5748
5702
|
"data-test": "messaging-recording-state",
|
|
5749
5703
|
class: O(["flex min-w-0 items-center gap-2 py-1", Y.value ? "text-theme-700" : "text-white/80"])
|
|
5750
5704
|
}, [
|
|
5751
|
-
|
|
5752
|
-
C("span",
|
|
5753
|
-
C("span", { class: O(["min-w-0 truncate text-sm", Y.value ? "text-theme-400" : "text-white/45"]) }, z(
|
|
5705
|
+
r[26] || (r[26] = C("span", { class: "size-2.5 shrink-0 rounded-full bg-red-500" }, null, -1)),
|
|
5706
|
+
C("span", Ba, z(et.value), 1),
|
|
5707
|
+
C("span", { class: O(["min-w-0 truncate text-sm", Y.value ? "text-theme-400" : "text-white/45"]) }, z(tt.value), 3)
|
|
5754
5708
|
], 2)) : ge((j(), S("textarea", {
|
|
5755
5709
|
key: 0,
|
|
5756
5710
|
ref_key: "textarea",
|
|
5757
5711
|
ref: a,
|
|
5758
|
-
"onUpdate:modelValue":
|
|
5712
|
+
"onUpdate:modelValue": r[7] || (r[7] = (e) => je.value = e),
|
|
5759
5713
|
"data-test": "messaging-input",
|
|
5760
5714
|
rows: "1",
|
|
5761
5715
|
enterkeyhint: "send",
|
|
@@ -5772,7 +5726,7 @@ var Hi = ["data-voice-state", "data-voice-activity"], Ui = ["src"], Wi = {
|
|
|
5772
5726
|
},
|
|
5773
5727
|
class: O(["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", Y.value ? "text-theme-900 placeholder-theme-400" : "text-white placeholder-white/50"]),
|
|
5774
5728
|
onKeydown: handleKeydown
|
|
5775
|
-
}, null, 42,
|
|
5729
|
+
}, null, 42, za)), [[ue, je.value]]), C("div", Va, [
|
|
5776
5730
|
C("button", {
|
|
5777
5731
|
class: O(["-ml-2 flex size-8 items-center justify-center transition-opacity hover:opacity-70 pointer-coarse:size-11", [
|
|
5778
5732
|
Ie.value ? "cursor-pointer" : "cursor-default",
|
|
@@ -5782,18 +5736,18 @@ var Hi = ["data-voice-state", "data-voice-activity"], Ui = ["src"], Wi = {
|
|
|
5782
5736
|
disabled: Ee.value || Ne.value || Fe.value || !Ie.value,
|
|
5783
5737
|
"aria-label": Ie.value ? "Attach file" : "File attachments unavailable",
|
|
5784
5738
|
title: Ie.value ? "Attach file" : "File attachments unavailable",
|
|
5785
|
-
onClick:
|
|
5786
|
-
}, [Ne.value ? (j(), S("i",
|
|
5787
|
-
|
|
5788
|
-
C("div",
|
|
5739
|
+
onClick: r[8] || (r[8] = (e) => Ie.value && triggerFileInput())
|
|
5740
|
+
}, [Ne.value ? (j(), S("i", Ua)) : (j(), S("i", Wa)), C("span", Ga, z(Ie.value ? "Attach file" : "File attachments unavailable"), 1)], 10, Ha),
|
|
5741
|
+
r[30] || (r[30] = C("div", { class: "flex-1" }, null, -1)),
|
|
5742
|
+
C("div", Ka, [
|
|
5789
5743
|
Ze.value && !Qe.value && !K.value ? (j(), S("button", {
|
|
5790
5744
|
key: 0,
|
|
5791
5745
|
"data-test": "messaging-record-discard-btn",
|
|
5792
5746
|
class: O(["flex size-8 cursor-pointer items-center justify-center transition-opacity hover:opacity-70 pointer-coarse:size-11", Y.value ? "text-theme-400" : "text-white/40"]),
|
|
5793
5747
|
"aria-label": "Discard recording",
|
|
5794
5748
|
title: "Discard recording",
|
|
5795
|
-
onClick:
|
|
5796
|
-
}, [...
|
|
5749
|
+
onClick: r[9] || (r[9] = (e) => finishRecording({ cancelled: !0 }))
|
|
5750
|
+
}, [...r[27] || (r[27] = [C("i", {
|
|
5797
5751
|
class: "i-tabler-x size-[18px]",
|
|
5798
5752
|
"aria-hidden": "true"
|
|
5799
5753
|
}, null, -1)])], 2)) : x("", !0),
|
|
@@ -5801,23 +5755,23 @@ var Hi = ["data-voice-state", "data-voice-activity"], Ui = ["src"], Wi = {
|
|
|
5801
5755
|
key: 1,
|
|
5802
5756
|
"data-test": "messaging-record-audio-btn",
|
|
5803
5757
|
class: O(["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", Ze.value ? Y.value ? "text-theme-900 scale-110" : "text-white scale-110" : Y.value ? "text-theme-500" : "text-white/60"]),
|
|
5804
|
-
"aria-label":
|
|
5805
|
-
title:
|
|
5758
|
+
"aria-label": nt.value,
|
|
5759
|
+
title: nt.value,
|
|
5806
5760
|
onPointerdown: ve(onRecordPointerDown, ["prevent"]),
|
|
5807
5761
|
onPointerup: ve(onRecordPointerUp, ["prevent"]),
|
|
5808
5762
|
onPointercancel: ve(onRecordPointerCancel, ["prevent"]),
|
|
5809
5763
|
onClick: onRecordClick,
|
|
5810
|
-
onKeydown:
|
|
5811
|
-
}, [C("i", { class: O([Ze.value ? "i-tabler-microphone-filled" : "i-tabler-microphone", "size-[18px]"]) }, null, 2), C("span",
|
|
5812
|
-
|
|
5764
|
+
onKeydown: r[10] || (r[10] = _e(ve((e) => finishRecording({ cancelled: !0 }), ["prevent"]), ["escape"]))
|
|
5765
|
+
}, [C("i", { class: O([Ze.value ? "i-tabler-microphone-filled" : "i-tabler-microphone", "size-[18px]"]) }, null, 2), C("span", Ja, z(nt.value), 1)], 42, qa)) : x("", !0),
|
|
5766
|
+
ot.value ? (j(), S("button", {
|
|
5813
5767
|
key: 2,
|
|
5814
5768
|
"data-test": "messaging-voice-start-btn",
|
|
5815
|
-
class: O(["flex size-8 items-center justify-center rounded-full transition-colors duration-150 pointer-coarse:size-11", [Y.value ? "bg-theme-900 text-theme-0 hover:bg-theme-800" : "bg-theme-0 text-theme-950 hover:bg-theme-100",
|
|
5816
|
-
disabled:
|
|
5769
|
+
class: O(["flex size-8 items-center justify-center rounded-full transition-colors duration-150 pointer-coarse:size-11", [Y.value ? "bg-theme-900 text-theme-0 hover:bg-theme-800" : "bg-theme-0 text-theme-950 hover:bg-theme-100", st.value ? "cursor-not-allowed opacity-40" : "cursor-pointer"]]),
|
|
5770
|
+
disabled: st.value,
|
|
5817
5771
|
"aria-label": ct.value,
|
|
5818
5772
|
title: ct.value,
|
|
5819
|
-
onClick:
|
|
5820
|
-
}, [C("span",
|
|
5773
|
+
onClick: r[11] || (r[11] = (e) => startVoiceConversation())
|
|
5774
|
+
}, [C("span", Xa, [(j(), S(g, null, N([
|
|
5821
5775
|
7,
|
|
5822
5776
|
13,
|
|
5823
5777
|
16,
|
|
@@ -5827,41 +5781,41 @@ var Hi = ["data-voice-state", "data-voice-activity"], Ui = ["src"], Wi = {
|
|
|
5827
5781
|
key: e,
|
|
5828
5782
|
class: "w-[2px] rounded-full bg-current",
|
|
5829
5783
|
style: k({ height: `${e}px` })
|
|
5830
|
-
}, null, 4)), 64))]),
|
|
5784
|
+
}, null, 4)), 64))]), r[28] || (r[28] = C("span", { class: "sr-only" }, "Start voice conversation", -1))], 10, Ya)) : Ze.value ? x("", !0) : (j(), S(g, { key: 3 }, [He.value ? (j(), S("button", {
|
|
5831
5785
|
key: 0,
|
|
5832
5786
|
"data-test": "messaging-secondary-stop-btn",
|
|
5833
5787
|
class: O(["mr-2 flex size-8 cursor-pointer items-center justify-center rounded-full transition-colors duration-150 pointer-coarse:size-11", Y.value ? "bg-theme-100 text-theme-700 hover:bg-theme-200" : "bg-white/10 text-white/70 hover:bg-white/15"]),
|
|
5834
5788
|
"aria-label": "Stop work",
|
|
5835
5789
|
title: "Stop work",
|
|
5836
|
-
onClick:
|
|
5837
|
-
}, [...
|
|
5790
|
+
onClick: r[12] || (r[12] = (t) => e.chatController?.stopChatTurn())
|
|
5791
|
+
}, [...r[29] || (r[29] = [C("i", {
|
|
5838
5792
|
class: "i-tabler-player-stop-filled size-3.5",
|
|
5839
5793
|
"aria-hidden": "true"
|
|
5840
5794
|
}, null, -1), C("span", { class: "sr-only" }, "Stop work", -1)])], 2)) : x("", !0), C("button", {
|
|
5841
5795
|
"data-test": "messaging-send-btn",
|
|
5842
|
-
"data-composer-action":
|
|
5843
|
-
class: O(["flex size-8 items-center justify-center rounded-full transition-colors duration-150 pointer-coarse:size-11",
|
|
5844
|
-
disabled: !
|
|
5796
|
+
"data-composer-action": Be.value,
|
|
5797
|
+
class: O(["flex size-8 items-center justify-center rounded-full transition-colors duration-150 pointer-coarse:size-11", Ve.value ? Y.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" : Y.value ? "bg-theme-100 text-theme-400" : "bg-white/10 text-white/30"]),
|
|
5798
|
+
disabled: !Ve.value,
|
|
5845
5799
|
"aria-label": Ye.value,
|
|
5846
5800
|
title: Ye.value,
|
|
5847
|
-
onClick:
|
|
5848
|
-
}, [
|
|
5801
|
+
onClick: r[13] || (r[13] = (e) => handleComposerAction())
|
|
5802
|
+
}, [Be.value === "stop" ? (j(), S("i", Qa)) : (j(), S("i", $a)), C("span", eo, z(Ye.value), 1)], 10, Za)], 64))
|
|
5849
5803
|
])
|
|
5850
|
-
])], 10,
|
|
5851
|
-
e.centered && B.value.length > 0 ? (j(), S("p",
|
|
5852
|
-
], 64))], !0)], 10,
|
|
5804
|
+
])], 10, Ra),
|
|
5805
|
+
e.centered && B.value.length > 0 ? (j(), S("p", to, z(e.bot.displayName.value) + " is AI and can make mistakes. ", 1)) : x("", !0)
|
|
5806
|
+
], 64))], !0)], 10, Ma)
|
|
5853
5807
|
], 2));
|
|
5854
5808
|
}
|
|
5855
|
-
}), [["__scopeId", "data-v-
|
|
5809
|
+
}), [["__scopeId", "data-v-5450b422"]]), ro = { class: "bot-wrap" }, io = {
|
|
5856
5810
|
key: 0,
|
|
5857
5811
|
class: "flex items-center justify-center h-full"
|
|
5858
|
-
},
|
|
5812
|
+
}, ao = {
|
|
5859
5813
|
key: 2,
|
|
5860
5814
|
class: "flex h-full flex-col items-center justify-center gap-4 px-6 text-center",
|
|
5861
5815
|
role: "status",
|
|
5862
5816
|
"aria-live": "polite",
|
|
5863
5817
|
"data-test": "bot-unavailable"
|
|
5864
|
-
},
|
|
5818
|
+
}, oo = /* @__PURE__ */ E({
|
|
5865
5819
|
__name: "BotWrap",
|
|
5866
5820
|
props: {
|
|
5867
5821
|
sdk: {},
|
|
@@ -5957,7 +5911,7 @@ var Hi = ["data-voice-state", "data-voice-activity"], Ui = ["src"], Wi = {
|
|
|
5957
5911
|
});
|
|
5958
5912
|
}
|
|
5959
5913
|
}
|
|
5960
|
-
return ae(loadBot), (t, n) => (j(), S("div",
|
|
5914
|
+
return ae(loadBot), (t, n) => (j(), S("div", ro, [a.value ? (j(), S("div", io, [C("div", { class: O(["size-6 animate-spin rounded-full border-b-2", r.bare ? "border-theme-400" : "border-white"]) }, null, 2)])) : s.value ? se(t.$slots, "default", {
|
|
5961
5915
|
sdk: B(i),
|
|
5962
5916
|
bot: s.value,
|
|
5963
5917
|
context: e.clientContext ?? e.context,
|
|
@@ -5965,7 +5919,7 @@ var Hi = ["data-voice-state", "data-voice-activity"], Ui = ["src"], Wi = {
|
|
|
5965
5919
|
buttonText: e.buttonText,
|
|
5966
5920
|
buttonIcon: e.buttonIcon,
|
|
5967
5921
|
loading: a.value
|
|
5968
|
-
}, void 0, void 0, 1) : c.value ? (j(), S("div",
|
|
5922
|
+
}, void 0, void 0, 1) : c.value ? (j(), S("div", ao, [n[0] || (n[0] = C("p", { class: "text-sm font-medium text-theme-600" }, " This assistant is unavailable right now. ", -1)), C("button", {
|
|
5969
5923
|
type: "button",
|
|
5970
5924
|
class: "min-h-11 rounded-full bg-theme-900 px-5 text-sm font-semibold text-theme-0 transition-colors hover:bg-theme-700",
|
|
5971
5925
|
"data-test": "bot-unavailable-retry",
|
|
@@ -5974,6 +5928,6 @@ var Hi = ["data-voice-state", "data-voice-activity"], Ui = ["src"], Wi = {
|
|
|
5974
5928
|
}
|
|
5975
5929
|
});
|
|
5976
5930
|
//#endregion
|
|
5977
|
-
export {
|
|
5931
|
+
export { ze as a, Oe as c, parseButtonTemplate as d, BotChatController as f, vi as i, getBotAvatarUrl as l, ye as m, no as n, Me as o, Ce as p, Yi as r, Ae as s, oo as t, handleImageError as u };
|
|
5978
5932
|
|
|
5979
5933
|
//# sourceMappingURL=BotWrap.js.map
|