@8wave/ai-elements 0.117.0-beta.14 → 0.117.0-beta.22
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/ai-elements.es.js +599 -569
- package/dist/ai-elements.es.js.map +1 -1
- package/dist-vue/PkChatbot.js +1 -1
- package/dist-vue/PkChatbotAudioTranscript.js +1 -1
- package/dist-vue/PkChatbotMessages.js +1 -1
- package/dist-vue/PkChatbotViewChat.js +1 -1
- package/dist-vue/_chunks/{PkChatbot-CSMWib9A.js → PkChatbot-BEnC7_hV.js} +2 -2
- package/dist-vue/_chunks/{PkChatbot-CSMWib9A.js.map → PkChatbot-BEnC7_hV.js.map} +1 -1
- package/dist-vue/_chunks/PkChatbotAudioTranscript-BUxBHanA.js +80 -0
- package/dist-vue/_chunks/PkChatbotAudioTranscript-BUxBHanA.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotMessages-DJmRPFB8.js → PkChatbotMessages-DnoohZxu.js} +276 -276
- package/dist-vue/_chunks/PkChatbotMessages-DnoohZxu.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotViewChat-C7eA7hef.js → PkChatbotViewChat-BM51ovrp.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotViewChat-C7eA7hef.js.map → PkChatbotViewChat-BM51ovrp.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowDiagram-BKz7OPHC.js → PkToolShowDiagram-DzE-X06t.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowDiagram-BKz7OPHC.js.map → PkToolShowDiagram-DzE-X06t.js.map} +1 -1
- package/dist-vue/index.js +3 -3
- package/dist-vue/style.css +1 -1
- package/package.json +1 -1
- package/dist-vue/_chunks/PkChatbotAudioTranscript-B-cSKvWR.js +0 -52
- package/dist-vue/_chunks/PkChatbotAudioTranscript-B-cSKvWR.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotMessages-DJmRPFB8.js.map +0 -1
|
@@ -4,53 +4,53 @@ import { k as o } from "./Agent-CNJ3b9Je.js";
|
|
|
4
4
|
import { t as s } from "./PkStreamingMarkdown-NWO3WTw9.js";
|
|
5
5
|
import "./src-DCfvejyT.js";
|
|
6
6
|
import { c, i as l, l as u, n as d, o as f, s as p, t as m } from "./message-BOiF6Bt5.js";
|
|
7
|
-
import { t as h } from "./
|
|
8
|
-
import { t as g } from "./
|
|
9
|
-
import {
|
|
10
|
-
import { t as ue } from "./
|
|
11
|
-
import { t as de } from "./
|
|
12
|
-
import { t as fe } from "./
|
|
13
|
-
import { t as pe } from "./
|
|
7
|
+
import { t as h } from "./PkChatbotAudioTranscript-BUxBHanA.js";
|
|
8
|
+
import { t as g } from "./PkChatbotError-CRGbK09-.js";
|
|
9
|
+
import { t as _ } from "./PkRelativeTime--1cIphlA.js";
|
|
10
|
+
import { C as v, S as y, a as ee, b, d as te, f as ne, i as re, l as ie, m as x, n as ae, p as oe, t as se, v as ce, w as le, x as ue } from "./utils-DxuGvgWg.js";
|
|
11
|
+
import { t as de } from "./PkChatbotFilePreview-DIP8KLkS.js";
|
|
12
|
+
import { t as fe } from "./PkChatbotFeedbackForm-DrPKjh-0.js";
|
|
13
|
+
import { t as pe } from "./PkChatbotMessageFeedback-BYmrVaCE.js";
|
|
14
14
|
import { n as me, t as he } from "./PkChatbotSteps-qyUOh42z.js";
|
|
15
15
|
import { t as ge } from "./PkChatbotOutlineRail-np4g6vsz.js";
|
|
16
16
|
import { VvButton as _e, VvButtonGroup as ve, VvIcon as ye } from "@volverjs/ui-vue/components";
|
|
17
|
-
import { Fragment as S, Transition as C, computed as w, createBlock as T, createCommentVNode as E, createElementBlock as D, createElementVNode as O, createTextVNode as be, createVNode as k, defineAsyncComponent as A, defineComponent as
|
|
18
|
-
import { useI18n as
|
|
17
|
+
import { Fragment as S, Transition as C, computed as w, createBlock as T, createCommentVNode as E, createElementBlock as D, createElementVNode as O, createTextVNode as be, createVNode as k, defineAsyncComponent as A, defineComponent as xe, mergeProps as Se, nextTick as j, normalizeClass as M, normalizeStyle as N, onBeforeUnmount as P, onMounted as Ce, openBlock as F, ref as I, renderList as we, renderSlot as Te, resolveDynamicComponent as Ee, toDisplayString as L, unref as R, useSlots as De, useTemplateRef as Oe, watch as z, withCtx as B, withModifiers as V } from "vue";
|
|
18
|
+
import { useI18n as ke } from "vue-i18n";
|
|
19
19
|
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/iso.js
|
|
20
|
-
function
|
|
20
|
+
function H(e) {
|
|
21
21
|
return t(n, e);
|
|
22
22
|
}
|
|
23
23
|
r({
|
|
24
24
|
platform: i(),
|
|
25
25
|
threadId: i()
|
|
26
26
|
});
|
|
27
|
-
var
|
|
27
|
+
var Ae = r({
|
|
28
28
|
wakeId: e(),
|
|
29
|
-
dueAt:
|
|
29
|
+
dueAt: H(),
|
|
30
30
|
reason: i()
|
|
31
31
|
});
|
|
32
|
-
r({ pendingWakeup:
|
|
33
|
-
var
|
|
32
|
+
r({ pendingWakeup: Ae.nullable() }), r({ wakeId: e() });
|
|
33
|
+
var U = (e) => e?.role === "user" && !!e.metadata?.wakeup, je = /* @__PURE__ */ new Set([
|
|
34
34
|
"input-streaming",
|
|
35
35
|
"input-available",
|
|
36
36
|
"approval-requested"
|
|
37
|
-
]),
|
|
37
|
+
]), Me = (e) => {
|
|
38
38
|
if (e?.role !== "assistant") return !1;
|
|
39
39
|
let t = !1;
|
|
40
40
|
for (let n of e.parts) {
|
|
41
41
|
if (n.type === "text" && n.text.trim() || n.type === "file") return !1;
|
|
42
42
|
let e = n.state;
|
|
43
|
-
if (e &&
|
|
43
|
+
if (e && je.has(e)) return !1;
|
|
44
44
|
n.type === "tool-scheduleWakeup" && (t = e === "output-available" && n.input?.noop === !0);
|
|
45
45
|
}
|
|
46
46
|
return t;
|
|
47
|
-
},
|
|
47
|
+
}, W = (e) => e.normalize("NFD").replace(/[\u0300-\u036f]/g, ""), Ne = (e) => e ? e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").replace(/[-_]+/g, " ") : "", Pe = (e) => e ? W(e).replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/[^a-zA-Z0-9]+/g, "-").toLowerCase() : "", Fe = (e) => e ? W(e).replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/[^a-zA-Z0-9]+/g, "_").toLowerCase() : "", G = (e) => e ? e.charAt(0).toUpperCase() + e.slice(1) : "", Ie = {
|
|
48
48
|
requestOAuthConnection: A(() => import("./PkToolRequestOAuthConnection-B262JqNh.js")),
|
|
49
49
|
showArtifact: A(() => import("./PkToolShowArtifact-Dr0NHXDG.js").then((e) => e.n)),
|
|
50
50
|
showCalendarEvent: A(() => import("./PkToolShowCalendarEvent-Dv_rss26.js").then((e) => e.n)),
|
|
51
51
|
showComparison: A(() => import("./PkToolShowComparison-DQs3E6-k.js").then((e) => e.n)),
|
|
52
52
|
showContactForm: A(() => import("./PkToolShowContactForm-BDm1w3UK.js").then((e) => e.n)),
|
|
53
|
-
showDiagram: A(() => import("./PkToolShowDiagram-
|
|
53
|
+
showDiagram: A(() => import("./PkToolShowDiagram-DzE-X06t.js")),
|
|
54
54
|
showEmail: A(() => import("./PkToolShowEmail-C591LR5N.js").then((e) => e.n)),
|
|
55
55
|
showImageGallery: A(() => import("./PkToolShowImageGallery-DsAQhyOq.js").then((e) => e.n)),
|
|
56
56
|
showLocation: A(() => import("./PkToolShowLocation-Dyz6h_0n.js").then((e) => e.n)),
|
|
@@ -64,10 +64,10 @@ var W = (e) => e?.role === "user" && !!e.metadata?.wakeup, Ae = /* @__PURE__ */
|
|
|
64
64
|
showVideo: A(() => import("./PkToolShowVideo-BAqSAfdq.js")),
|
|
65
65
|
showWeather: A(() => import("./PkToolShowWeather-BH-FtLpk.js")),
|
|
66
66
|
showWebPages: A(() => import("./PkToolShowWebPages-BeMJqIkW.js").then((e) => e.n))
|
|
67
|
-
},
|
|
67
|
+
}, Le = {
|
|
68
68
|
key: 0,
|
|
69
69
|
class: "text-12 text-word-3 m-0 mb-xs"
|
|
70
|
-
},
|
|
70
|
+
}, Re = /* @__PURE__ */ xe({
|
|
71
71
|
__name: "PkToolApprovalPreviewMessage",
|
|
72
72
|
props: { input: {} },
|
|
73
73
|
setup(e) {
|
|
@@ -75,12 +75,12 @@ var W = (e) => e?.role === "user" && !!e.metadata?.wakeup, Ae = /* @__PURE__ */
|
|
|
75
75
|
let e = t.input;
|
|
76
76
|
return typeof e?.message == "string" ? e.message : "";
|
|
77
77
|
});
|
|
78
|
-
return (e, t) => n.value ? (
|
|
78
|
+
return (e, t) => n.value ? (F(), D("p", Le, L(n.value), 1)) : E("", !0);
|
|
79
79
|
}
|
|
80
|
-
}),
|
|
80
|
+
}), ze = { [se]: Re }, Be = {
|
|
81
81
|
key: 0,
|
|
82
82
|
class: "text-12 text-word-3 m-0 mb-xs"
|
|
83
|
-
},
|
|
83
|
+
}, Ve = /* @__PURE__ */ xe({
|
|
84
84
|
__name: "PkToolApprovalCard",
|
|
85
85
|
props: {
|
|
86
86
|
part: {},
|
|
@@ -89,7 +89,7 @@ var W = (e) => e?.role === "user" && !!e.metadata?.wakeup, Ae = /* @__PURE__ */
|
|
|
89
89
|
},
|
|
90
90
|
emits: ["respond"],
|
|
91
91
|
setup(e, { emit: t }) {
|
|
92
|
-
let n = e, r = t, { t: i } =
|
|
92
|
+
let n = e, r = t, { t: i } = ke({ useScope: "global" }), a = w(() => n.part), s = w(() => l(n.part)), c = w(() => s.value === se), u = w(() => c.value ? (a.value.state === "input-available" || o(a.value.output)) && n.callVerdict === void 0 : a.value.state === "approval-requested"), d = w(() => u.value && n.actionable === !0), f = w(() => u.value && n.actionable !== !0), p = w(() => c.value ? a.value.output === "confirmed" || n.callVerdict === !0 : a.value.approval?.approved === !0), m = w(() => c.value ? a.value.output === "cancelled" || n.callVerdict === !1 : a.value.approval?.approved === !1 || a.value.state === "output-denied"), h = w(() => ze[s.value]), g = w(() => {
|
|
93
93
|
if (f.value) return {
|
|
94
94
|
icon: "ri:time-line",
|
|
95
95
|
message: i("toolApproval.expired")
|
|
@@ -105,36 +105,36 @@ var W = (e) => e?.role === "user" && !!e.metadata?.wakeup, Ae = /* @__PURE__ */
|
|
|
105
105
|
}), _ = w(() => !!g.value && !h.value);
|
|
106
106
|
return (t, n) => {
|
|
107
107
|
let o = _e, s = ve, l = ye;
|
|
108
|
-
return
|
|
108
|
+
return F(), D("div", { class: M(["w-full overflow-hidden transition-all duration-300", { "bg-surface p-sm rounded-xl border border-surface-3": !_.value }]) }, [
|
|
109
109
|
k(C, null, {
|
|
110
|
-
default:
|
|
110
|
+
default: B(() => [!c.value && u.value ? (F(), D("p", Be, L(R(i)("toolApproval.prompt")), 1)) : E("", !0)]),
|
|
111
111
|
_: 1
|
|
112
112
|
}),
|
|
113
|
-
h.value ? (
|
|
113
|
+
h.value ? (F(), T(Ee(h.value), {
|
|
114
114
|
key: 0,
|
|
115
115
|
part: e.part,
|
|
116
116
|
input: a.value.input
|
|
117
117
|
}, null, 8, ["part", "input"])) : E("", !0),
|
|
118
118
|
k(C, { mode: "out-in" }, {
|
|
119
|
-
default:
|
|
119
|
+
default: B(() => [g.value ? (F(), D("p", {
|
|
120
120
|
key: 1,
|
|
121
|
-
class:
|
|
121
|
+
class: M(["flex items-center gap-4 text-12 text-word-3 m-0", { "mt-xs": h.value }])
|
|
122
122
|
}, [k(l, {
|
|
123
123
|
name: g.value.icon,
|
|
124
124
|
class: "shrink-0"
|
|
125
|
-
}, null, 8, ["name"]), be(" " +
|
|
126
|
-
default:
|
|
125
|
+
}, null, 8, ["name"]), be(" " + L(g.value.message), 1)], 2)) : (F(), T(s, { key: 0 }, {
|
|
126
|
+
default: B(() => [k(o, {
|
|
127
127
|
modifiers: "primary-small",
|
|
128
128
|
disabled: !d.value,
|
|
129
129
|
icon: "ri:check-line",
|
|
130
|
-
label:
|
|
131
|
-
onClick: n[0] ||=
|
|
130
|
+
label: R(i)("action.proceed"),
|
|
131
|
+
onClick: n[0] ||= V((e) => r("respond", !0), ["stop"])
|
|
132
132
|
}, null, 8, ["disabled", "label"]), k(o, {
|
|
133
133
|
modifiers: "action-quiet-small",
|
|
134
134
|
disabled: !d.value,
|
|
135
135
|
icon: "ri:close-line",
|
|
136
|
-
label:
|
|
137
|
-
onClick: n[1] ||=
|
|
136
|
+
label: R(i)("action.cancel"),
|
|
137
|
+
onClick: n[1] ||= V((e) => r("respond", !1), ["stop"])
|
|
138
138
|
}, null, 8, ["disabled", "label"])]),
|
|
139
139
|
_: 1
|
|
140
140
|
}))]),
|
|
@@ -143,72 +143,72 @@ var W = (e) => e?.role === "user" && !!e.metadata?.wakeup, Ae = /* @__PURE__ */
|
|
|
143
143
|
], 2);
|
|
144
144
|
};
|
|
145
145
|
}
|
|
146
|
-
}),
|
|
147
|
-
function
|
|
148
|
-
let { scrollEl: t, status: n, messagesLength: r, lastMessageRole: i, contentEl: a, beforeNewMessageScroll: o, onScrollUp: s, onScrollDown: c } = e, l =
|
|
146
|
+
}), He = 30, K = 500;
|
|
147
|
+
function Ue(e) {
|
|
148
|
+
let { scrollEl: t, status: n, messagesLength: r, lastMessageRole: i, contentEl: a, beforeNewMessageScroll: o, onScrollUp: s, onScrollDown: c } = e, l = I(!1), u = I(!0), d = !1, f = null, p = null, m = null, h = null, g = 0, _ = (e = "smooth") => {
|
|
149
149
|
!t.value || l.value ? d = !1 : (d = !0, t.value.scrollTo({
|
|
150
150
|
top: t.value.scrollHeight,
|
|
151
151
|
behavior: e
|
|
152
152
|
}), setTimeout(() => {
|
|
153
153
|
d = !1;
|
|
154
|
-
}, e === "instant" ? 0 :
|
|
155
|
-
},
|
|
154
|
+
}, e === "instant" ? 0 : K));
|
|
155
|
+
}, v = (e) => {
|
|
156
156
|
e.deltaY < 0 && (l.value = !0);
|
|
157
|
-
},
|
|
158
|
-
|
|
159
|
-
},
|
|
157
|
+
}, y = 0, ee = (e) => {
|
|
158
|
+
y = e.touches[0]?.clientY ?? 0;
|
|
159
|
+
}, b = (e) => {
|
|
160
160
|
let t = e.touches[0]?.clientY ?? 0;
|
|
161
|
-
t >
|
|
162
|
-
},
|
|
161
|
+
t > y && (l.value = !0), y = t;
|
|
162
|
+
}, te = () => {
|
|
163
163
|
if (!t.value) return;
|
|
164
164
|
let { scrollTop: e, scrollHeight: n, clientHeight: r } = t.value;
|
|
165
|
-
u.value = n - r - e <
|
|
166
|
-
},
|
|
165
|
+
u.value = n - r - e < He, d || (e < g && s?.(), e > g && (u.value && (l.value = !1), c?.())), g = e;
|
|
166
|
+
}, ne = () => {
|
|
167
167
|
if (d || l.value || !t.value) return;
|
|
168
168
|
let e = t.value, n = e.scrollHeight - e.clientHeight;
|
|
169
169
|
n <= e.scrollTop || (u.value = !0, d = !0, e.scrollTop = n, requestAnimationFrame(() => {
|
|
170
170
|
d = !1;
|
|
171
171
|
}));
|
|
172
|
-
},
|
|
173
|
-
!f && t.value && (f = new MutationObserver(
|
|
172
|
+
}, re = () => {
|
|
173
|
+
!f && t.value && (f = new MutationObserver(ne), f.observe(t.value, {
|
|
174
174
|
childList: !0,
|
|
175
175
|
subtree: !0,
|
|
176
176
|
characterData: !0
|
|
177
177
|
}));
|
|
178
|
-
},
|
|
178
|
+
}, ie = () => {
|
|
179
179
|
f?.disconnect(), f = null;
|
|
180
180
|
};
|
|
181
|
-
|
|
182
|
-
e === "streaming" || e === "submitted" ?
|
|
183
|
-
}),
|
|
181
|
+
z(n, (e, t) => {
|
|
182
|
+
e === "streaming" || e === "submitted" ? re() : (e !== "ready" || t !== "streaming") && ie();
|
|
183
|
+
}), z(r, async () => {
|
|
184
184
|
if (r() && i() !== "assistant") {
|
|
185
|
-
|
|
185
|
+
oe(), l.value = !1, d = !0;
|
|
186
186
|
try {
|
|
187
|
-
await
|
|
187
|
+
await j(), await o?.(), await j();
|
|
188
188
|
} finally {
|
|
189
189
|
_();
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
192
|
});
|
|
193
|
-
let
|
|
194
|
-
t.value && (t.value.scrollHeight <= t.value.clientHeight || (t.value.scrollTop = t.value.scrollHeight,
|
|
195
|
-
},
|
|
196
|
-
p?.disconnect(), p = null, m?.disconnect(), m = null,
|
|
193
|
+
let x = null, ae = () => {
|
|
194
|
+
t.value && (t.value.scrollHeight <= t.value.clientHeight || (t.value.scrollTop = t.value.scrollHeight, x && clearTimeout(x), x = setTimeout(oe, 300)));
|
|
195
|
+
}, oe = () => {
|
|
196
|
+
p?.disconnect(), p = null, m?.disconnect(), m = null, x &&= (clearTimeout(x), null);
|
|
197
197
|
};
|
|
198
|
-
return
|
|
198
|
+
return Ce(() => {
|
|
199
199
|
if (!t.value) return;
|
|
200
|
-
t.value.addEventListener("wheel",
|
|
200
|
+
t.value.addEventListener("wheel", v, { passive: !0 }), t.value.addEventListener("touchstart", ee, { passive: !0 }), t.value.addEventListener("touchmove", b, { passive: !0 });
|
|
201
201
|
let e = n() === "submitted" || n() === "streaming";
|
|
202
|
-
e ?
|
|
202
|
+
e ? re() : (p = new ResizeObserver(ae), p.observe(t.value), m = new MutationObserver(ae), m.observe(t.value, {
|
|
203
203
|
childList: !0,
|
|
204
204
|
subtree: !0
|
|
205
205
|
}));
|
|
206
206
|
let r = a?.() ?? t.value.firstElementChild;
|
|
207
|
-
r && (h = new ResizeObserver(
|
|
208
|
-
}),
|
|
209
|
-
t.value?.removeEventListener("wheel",
|
|
207
|
+
r && (h = new ResizeObserver(ne), h.observe(r)), e || ae();
|
|
208
|
+
}), P(() => {
|
|
209
|
+
t.value?.removeEventListener("wheel", v), t.value?.removeEventListener("touchstart", ee), t.value?.removeEventListener("touchmove", b), h?.disconnect(), h = null, ie(), oe();
|
|
210
210
|
}), {
|
|
211
|
-
handleScroll:
|
|
211
|
+
handleScroll: te,
|
|
212
212
|
scrollToBottom: _,
|
|
213
213
|
userScrolledUp: l,
|
|
214
214
|
isAtBottom: u
|
|
@@ -216,13 +216,13 @@ function He(e) {
|
|
|
216
216
|
}
|
|
217
217
|
//#endregion
|
|
218
218
|
//#region ../../packages/components/src/chat/wakeupFeed.ts
|
|
219
|
-
function
|
|
220
|
-
let n = (e) =>
|
|
219
|
+
function We(e, t = () => !1) {
|
|
220
|
+
let n = (e) => Me(e) && !t(e), r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Map(), a = 0;
|
|
221
221
|
for (; a < e.length;) {
|
|
222
222
|
let t = e[a];
|
|
223
|
-
if (
|
|
223
|
+
if (U(t) && n(e[a + 1])) {
|
|
224
224
|
let o = t.id, s = 0, c;
|
|
225
|
-
for (;
|
|
225
|
+
for (; U(e[a]) && n(e[a + 1]);) s += 1, c = e[a].metadata?.createdAt ?? c, r.add(e[a].id), r.add(e[a + 1].id), a += 2;
|
|
226
226
|
i.set(o, {
|
|
227
227
|
count: s,
|
|
228
228
|
lastAt: c
|
|
@@ -236,40 +236,40 @@ function Ue(e, t = () => !1) {
|
|
|
236
236
|
}
|
|
237
237
|
//#endregion
|
|
238
238
|
//#region ../../packages/components/src/chat/PkChatbotMessages.vue?vue&type=script&setup=true&lang.ts
|
|
239
|
-
var
|
|
239
|
+
var Ge = ["aria-busy"], Ke = {
|
|
240
240
|
key: 0,
|
|
241
241
|
class: "pk-chatbot-messages__outline"
|
|
242
|
-
},
|
|
242
|
+
}, qe = {
|
|
243
243
|
key: 0,
|
|
244
244
|
class: "pk-chatbot-divider vv-separator"
|
|
245
|
-
},
|
|
245
|
+
}, Je = { class: "pk-chatbot-divider__label" }, Ye = {
|
|
246
246
|
key: 1,
|
|
247
247
|
class: "pk-chatbot-wakeup"
|
|
248
|
-
},
|
|
248
|
+
}, Xe = ["title"], Ze = { class: "pk-chatbot-message__text" }, Qe = ["title"], $e = {
|
|
249
249
|
key: 0,
|
|
250
250
|
class: "pk-chatbot-message__reaction-emoji"
|
|
251
|
-
}, $e = {
|
|
252
|
-
key: 0,
|
|
253
|
-
class: "flex flex-col gap-8"
|
|
254
251
|
}, et = {
|
|
252
|
+
key: 0,
|
|
253
|
+
class: "flex flex-col items-end gap-8 w-full"
|
|
254
|
+
}, tt = {
|
|
255
255
|
key: 0,
|
|
256
256
|
class: "pk-chatbot-message__loading-info"
|
|
257
|
-
},
|
|
257
|
+
}, nt = { class: "flex gap-8 items-center" }, rt = { class: "font-mono rounded text-12" }, it = { class: "flex gap-8 items-center" }, at = {
|
|
258
258
|
key: 0,
|
|
259
259
|
class: "pk-chatbot-message__footer"
|
|
260
|
-
},
|
|
260
|
+
}, ot = {
|
|
261
261
|
key: 0,
|
|
262
262
|
class: "pk-chatbot-message__hover-meta"
|
|
263
|
-
},
|
|
263
|
+
}, st = ["datetime", "title"], ct = { class: "truncate" }, lt = {
|
|
264
264
|
key: 0,
|
|
265
265
|
class: "flex items-center gap-4 min-w-0"
|
|
266
|
-
},
|
|
266
|
+
}, ut = { class: "truncate" }, dt = ["title"], ft = {
|
|
267
267
|
key: 2,
|
|
268
268
|
class: "flex items-center gap-4 text-12 text-word-3"
|
|
269
|
-
},
|
|
269
|
+
}, pt = { class: "truncate" }, mt = ["datetime"], ht = { class: "truncate" }, gt = {
|
|
270
270
|
key: 4,
|
|
271
271
|
class: "flex items-center gap-4 text-12 text-word-3"
|
|
272
|
-
},
|
|
272
|
+
}, _t = { class: "pk-chatbot-message__loading-info" }, vt = { class: "flex gap-8 items-center" }, yt = { class: "text-12" }, bt = ["title", "aria-label"], xt = /* @__PURE__ */ xe({
|
|
273
273
|
__name: "PkChatbotMessages",
|
|
274
274
|
props: {
|
|
275
275
|
status: {},
|
|
@@ -314,8 +314,8 @@ var We = ["aria-busy"], Ge = {
|
|
|
314
314
|
"confirm-respond"
|
|
315
315
|
],
|
|
316
316
|
setup(e, { emit: t }) {
|
|
317
|
-
let n = e, r = t, { t: i, d: o, n:
|
|
318
|
-
if (
|
|
317
|
+
let n = e, r = t, { t: i, d: o, n: se } = ke({ useScope: "global" }), A = De(), xe = (e, t) => {
|
|
318
|
+
if (ue(e)) {
|
|
319
319
|
let n = e.toolCallId;
|
|
320
320
|
n && r("confirm-respond", {
|
|
321
321
|
toolCallId: n,
|
|
@@ -328,88 +328,88 @@ var We = ["aria-busy"], Ge = {
|
|
|
328
328
|
id: n,
|
|
329
329
|
approved: t
|
|
330
330
|
});
|
|
331
|
-
},
|
|
332
|
-
scrollEl:
|
|
331
|
+
}, P = Oe("scrollEl"), H = Oe("wrapperEl"), Ae = w(() => le(n.textColor, n.mainColor)), { handleScroll: je, scrollToBottom: Me, userScrolledUp: W, isAtBottom: Ne } = Ue({
|
|
332
|
+
scrollEl: P,
|
|
333
333
|
status: () => n.status,
|
|
334
334
|
messagesLength: () => n.messages?.length,
|
|
335
335
|
lastMessageRole: () => n.messages?.[n.messages.length - 1]?.role,
|
|
336
|
-
contentEl: () =>
|
|
337
|
-
beforeNewMessageScroll: () =>
|
|
336
|
+
contentEl: () => H.value,
|
|
337
|
+
beforeNewMessageScroll: () => St(),
|
|
338
338
|
onScrollUp: () => r("scroll-up"),
|
|
339
339
|
onScrollDown: () => r("scroll-down")
|
|
340
|
-
}),
|
|
341
|
-
|
|
342
|
-
},
|
|
340
|
+
}), Fe = () => {
|
|
341
|
+
W.value = !1, Me();
|
|
342
|
+
}, G = w(() => (n.messages ?? []).filter((e) => e.role === "user" && !U(e)).map((e) => ({
|
|
343
343
|
id: e.id,
|
|
344
344
|
preview: e.parts.find(c)?.text.trim().slice(0, 120) || "…"
|
|
345
|
-
}))),
|
|
346
|
-
let e =
|
|
345
|
+
}))), Le = I(), Re = () => P.value?.querySelectorAll(".pk-chatbot-message--user") ?? [], ze = () => {
|
|
346
|
+
let e = P.value;
|
|
347
347
|
if (!e || !n.showScrollToBottom) return;
|
|
348
|
-
let t = e.getBoundingClientRect().top + e.clientHeight / 2, r =
|
|
349
|
-
|
|
350
|
-
e.getBoundingClientRect().top <= t && (r =
|
|
351
|
-
}),
|
|
348
|
+
let t = e.getBoundingClientRect().top + e.clientHeight / 2, r = G.value[0]?.id;
|
|
349
|
+
Re().forEach((e, n) => {
|
|
350
|
+
e.getBoundingClientRect().top <= t && (r = G.value[n]?.id);
|
|
351
|
+
}), Le.value = r;
|
|
352
352
|
};
|
|
353
|
-
|
|
354
|
-
await
|
|
353
|
+
z(G, async () => {
|
|
354
|
+
await j(), ze();
|
|
355
355
|
});
|
|
356
|
-
let
|
|
357
|
-
|
|
358
|
-
},
|
|
359
|
-
let t =
|
|
360
|
-
t && r && (
|
|
356
|
+
let Be = () => {
|
|
357
|
+
je(), ze();
|
|
358
|
+
}, He = (e) => {
|
|
359
|
+
let t = P.value, n = G.value.findIndex((t) => t.id === e), r = Re()[n];
|
|
360
|
+
t && r && (W.value = !0, t.scrollTo({
|
|
361
361
|
top: t.scrollTop + r.getBoundingClientRect().top - t.getBoundingClientRect().top - Number.parseFloat(getComputedStyle(t).paddingTop),
|
|
362
362
|
behavior: "smooth"
|
|
363
363
|
}));
|
|
364
|
-
},
|
|
364
|
+
}, K = I(0), xt = I(!1), St = async () => {
|
|
365
365
|
let e = n.messages;
|
|
366
|
-
if (!e?.length || n.disableHeightAdjustment || e[e.length - 1].role !== "user" && n.status !== "submitted" && n.status !== "streaming" || (
|
|
367
|
-
let { paddingTop: t, paddingBottom: r } = getComputedStyle(
|
|
368
|
-
i > 0 && (
|
|
366
|
+
if (!e?.length || n.disableHeightAdjustment || e[e.length - 1].role !== "user" && n.status !== "submitted" && n.status !== "streaming" || (xt.value = !1, await j(), !P.value)) return;
|
|
367
|
+
let { paddingTop: t, paddingBottom: r } = getComputedStyle(P.value), i = P.value.clientHeight - Number.parseFloat(t) - Number.parseFloat(r), a = H.value && Number.parseFloat(getComputedStyle(H.value).rowGap) || 0, o = Re(), s = i - (o[o.length - 1]?.clientHeight ?? 0) - a;
|
|
368
|
+
i > 0 && (K.value = Math.max(s, 0)), await j();
|
|
369
369
|
};
|
|
370
|
-
|
|
371
|
-
(n.status === "submitted" || n.status === "streaming" || n.awaitingSpokenAnswer) &&
|
|
372
|
-
}),
|
|
373
|
-
(e === "ready" || e === "error") && (
|
|
370
|
+
z(() => [n.messages?.length, n.messages?.[n.messages.length - 1]?.id], () => St()), Ce(() => {
|
|
371
|
+
(n.status === "submitted" || n.status === "streaming" || n.awaitingSpokenAnswer) && St();
|
|
372
|
+
}), z(() => n.status, (e) => {
|
|
373
|
+
(e === "ready" || e === "error") && (xt.value = !0, K.value = 0);
|
|
374
374
|
});
|
|
375
|
-
let
|
|
376
|
-
let t =
|
|
375
|
+
let Ct = (e) => n.revisedAnswers?.some((t) => t.messageId === e), q = (e) => n.messageFeedbacks?.find((t) => t.messageId === e), wt = (e, t) => !n.readonlyFeedback && Vt(e, t), Tt = (e) => n.readonlyFeedback ? q(e) : void 0, Et = (e) => Tt(e)?.vote, Dt = (e) => {
|
|
376
|
+
let t = Tt(e);
|
|
377
377
|
if (t?.vote) return;
|
|
378
378
|
let n = t?.metadata?.reactionEmoji;
|
|
379
379
|
return typeof n == "string" && /\p{Extended_Pictographic}/u.test(n) ? n : void 0;
|
|
380
|
-
},
|
|
381
|
-
if (
|
|
382
|
-
let t =
|
|
380
|
+
}, Ot = (e) => !!(Et(e) || Dt(e)), kt = (e) => {
|
|
381
|
+
if (Dt(e)) return "pk-chatbot-message__reaction--neutral";
|
|
382
|
+
let t = Et(e);
|
|
383
383
|
return t === "upvote" ? "pk-chatbot-message__reaction--positive" : t === "downvote" ? "pk-chatbot-message__reaction--negative" : "pk-chatbot-message__reaction--neutral";
|
|
384
|
-
}, kt = (e) => {
|
|
385
|
-
let t = Tt(e);
|
|
386
|
-
return i(t === "upvote" ? "hint.userFeedbackPositive" : t === "downvote" ? "hint.userFeedbackNegative" : "hint.userFeedbackReaction");
|
|
387
384
|
}, At = (e) => {
|
|
388
|
-
let t =
|
|
385
|
+
let t = Et(e);
|
|
386
|
+
return i(t === "upvote" ? "hint.userFeedbackPositive" : t === "downvote" ? "hint.userFeedbackNegative" : "hint.userFeedbackReaction");
|
|
387
|
+
}, jt = (e) => {
|
|
388
|
+
let t = Pt(e);
|
|
389
389
|
for (let e = t.length - 1; e >= 0; --e) if (c(t[e])) return e;
|
|
390
390
|
return -1;
|
|
391
|
-
},
|
|
392
|
-
let e =
|
|
391
|
+
}, Mt = w(() => n.messages?.[n.messages.length - 1]), J = w(() => {
|
|
392
|
+
let e = Mt.value;
|
|
393
393
|
return e ? e.parts[e.parts.length - 1] : null;
|
|
394
|
-
}),
|
|
394
|
+
}), Nt = w(() => {
|
|
395
395
|
let e = /* @__PURE__ */ new Map();
|
|
396
|
-
for (let t of n.messages ?? []) t.role === "assistant" && e.set(t.id,
|
|
396
|
+
for (let t of n.messages ?? []) t.role === "assistant" && e.set(t.id, v(re(y(t.parts))));
|
|
397
397
|
return e;
|
|
398
|
-
}),
|
|
399
|
-
let e =
|
|
400
|
-
return
|
|
398
|
+
}), Pt = (e) => Nt.value.get(e.id) ?? e.parts, Y = w(() => n.status === "submitted" || n.status === "streaming"), X = w(() => n.status === "error"), Ft = w(() => n.awaitingSpokenAnswer === !0 && !Y.value), It = w(() => Ft.value && Mt.value?.role === "user" && !X.value), Lt = w(() => {
|
|
399
|
+
let e = J.value;
|
|
400
|
+
return x(i, e);
|
|
401
401
|
}), Rt = w(() => {
|
|
402
|
-
let e =
|
|
403
|
-
return
|
|
402
|
+
let e = J.value;
|
|
403
|
+
return te(e);
|
|
404
404
|
}), zt = (e) => n.messages?.findIndex((t) => t.id === e), Z = (e) => e === void 0 || !n.messages ? !1 : e === n.messages.length - 1, Bt = (e) => Z(e) && n.status === "ready" && !!n.actions?.includes("regenerate"), Vt = (e, t) => (!Z(t) || n.status === "ready") && !!n.actions?.includes(e), Ht = (e) => {
|
|
405
405
|
let t = e.parts[e.parts.length - 1];
|
|
406
406
|
return c(t);
|
|
407
|
-
}, Ut = (e) => e.parts.some((e) => p(e) || u(e)), Wt = (e) => !!n.showExtendedSteps && Q(e) && Ut(e), Gt = (e) => u(e) && !
|
|
407
|
+
}, Ut = (e) => e.parts.some((e) => p(e) || u(e)), Wt = (e) => !!n.showExtendedSteps && Q(e) && Ut(e), Gt = (e) => u(e) && !b(e) && !!(Ie[l(e)] || A[e.type] || n.showAllMessageParts), Kt = (e) => e.parts.some((e) => c(e) && !!e.text.trim() || f(e) || ce(e) && !b(e) || Gt(e)), Q = (e) => e.role === "assistant", qt = (e) => e.role === "user", Jt = (e) => n.messages?.slice(0, e).reverse().find((e) => Q(e)), Yt = (e) => n.messages?.slice(e + 1).find((e) => Q(e)), Xt = (e) => {
|
|
408
408
|
let t = Jt(e)?.metadata?.createdAt, n = Yt(e)?.metadata?.createdAt;
|
|
409
409
|
if (!t || !n) return;
|
|
410
410
|
let r = new Date(t), i = new Date(n);
|
|
411
411
|
return r.toDateString() === i.toDateString() ? void 0 : i;
|
|
412
|
-
}, $ = w(() => n.showAllMessageParts ?
|
|
412
|
+
}, $ = w(() => n.showAllMessageParts ? We([]) : We(n.messages ?? [], Kt)), Zt = w(() => {
|
|
413
413
|
let e = 0;
|
|
414
414
|
return (n.messages ?? []).map((t) => t.parts.length > 0 ? ++e : void 0);
|
|
415
415
|
}), Qt = (e, t) => t === 0 || e.role !== "assistant" ? !1 : !!(n.actions?.length || n.showMessageNumber || n.showMessageDateTime && e.metadata?.createdAt !== void 0 || e.metadata?.completedAt !== void 0 || n.showMessageTokensCount && e.metadata?.totalTokens !== void 0), $t = (e) => {
|
|
@@ -417,71 +417,71 @@ var We = ["aria-busy"], Ge = {
|
|
|
417
417
|
return o(t, n ? "time" : "date-time");
|
|
418
418
|
}, en = (e) => {
|
|
419
419
|
let { createdAt: t, completedAt: n } = e.metadata ?? {};
|
|
420
|
-
if (t && n) return ie(
|
|
421
|
-
}, tn =
|
|
422
|
-
return
|
|
423
|
-
if (await
|
|
420
|
+
if (t && n) return ie(se, n - t);
|
|
421
|
+
}, tn = Oe("feedbackMessageEl");
|
|
422
|
+
return z(() => n.feedbackMessageId, async () => {
|
|
423
|
+
if (await j(), !n.feedbackMessageId) return;
|
|
424
424
|
let e = tn.value?.[0]?.$el;
|
|
425
|
-
e && (Z(zt(n.feedbackMessageId)) ?
|
|
425
|
+
e && (Z(zt(n.feedbackMessageId)) ? Me() : e.scrollIntoView({
|
|
426
426
|
behavior: "smooth",
|
|
427
427
|
block: "center"
|
|
428
428
|
}));
|
|
429
429
|
}), (t, n) => {
|
|
430
430
|
let r = ye, u = _e, p = ve;
|
|
431
|
-
return
|
|
431
|
+
return F(), D("div", {
|
|
432
432
|
ref_key: "scrollEl",
|
|
433
|
-
ref:
|
|
434
|
-
class:
|
|
433
|
+
ref: P,
|
|
434
|
+
class: M(["pk-chatbot-messages scrollbar-thin", { "pk-chatbot-messages--settling": xt.value }]),
|
|
435
435
|
role: "log",
|
|
436
436
|
"aria-live": "polite",
|
|
437
437
|
"aria-relevant": "additions text",
|
|
438
|
-
"aria-busy":
|
|
439
|
-
style:
|
|
438
|
+
"aria-busy": Y.value,
|
|
439
|
+
style: N({
|
|
440
440
|
"--chatbot-main-color": e.mainColor,
|
|
441
|
-
"--chatbot-contrast-color":
|
|
441
|
+
"--chatbot-contrast-color": Ae.value
|
|
442
442
|
}),
|
|
443
|
-
onScroll:
|
|
443
|
+
onScroll: Be
|
|
444
444
|
}, [
|
|
445
|
-
e.showScrollToBottom &&
|
|
446
|
-
items:
|
|
447
|
-
"active-id":
|
|
448
|
-
onSelect:
|
|
445
|
+
e.showScrollToBottom && G.value.length > 1 ? (F(), D("div", Ke, [k(ge, {
|
|
446
|
+
items: G.value,
|
|
447
|
+
"active-id": Le.value,
|
|
448
|
+
onSelect: He
|
|
449
449
|
}, null, 8, ["items", "active-id"])])) : E("", !0),
|
|
450
450
|
O("div", {
|
|
451
451
|
ref_key: "wrapperEl",
|
|
452
|
-
ref:
|
|
452
|
+
ref: H,
|
|
453
453
|
class: "pk-chatbot-messages__wrapper"
|
|
454
454
|
}, [
|
|
455
|
-
(
|
|
456
|
-
qt(
|
|
457
|
-
$.value.quietRuns.has(
|
|
455
|
+
(F(!0), D(S, null, we(e.messages, (g, v) => (F(), D(S, { key: g.id }, [
|
|
456
|
+
qt(g) && Xt(v) ? (F(), D("div", qe, [O("span", Je, L(R(o)(Xt(v), "short")), 1)])) : E("", !0),
|
|
457
|
+
$.value.quietRuns.has(g.id) ? (F(), D("div", Ye, [k(r, {
|
|
458
458
|
name: "ri:alarm-line",
|
|
459
459
|
class: "shrink-0"
|
|
460
|
-
}), O("span", null, R(
|
|
461
|
-
count: $.value.quietRuns.get(
|
|
462
|
-
time:
|
|
463
|
-
}, $.value.quietRuns.get(
|
|
460
|
+
}), O("span", null, L(R(i)("label.wakeupQuietRun", {
|
|
461
|
+
count: $.value.quietRuns.get(g.id).count,
|
|
462
|
+
time: R(o)($.value.quietRuns.get(g.id).lastAt ?? Date.now(), "time")
|
|
463
|
+
}, $.value.quietRuns.get(g.id).count)), 1)])) : R(U)(g) && !$.value.hidden.has(g.id) && !e.showAllMessageParts ? (F(), D("div", {
|
|
464
464
|
key: 2,
|
|
465
465
|
class: "pk-chatbot-wakeup",
|
|
466
|
-
title:
|
|
466
|
+
title: g.metadata?.wakeup?.reason
|
|
467
467
|
}, [k(r, {
|
|
468
468
|
name: "ri:alarm-line",
|
|
469
469
|
class: "shrink-0"
|
|
470
|
-
}), O("span", null, [be(R(
|
|
471
|
-
(!
|
|
470
|
+
}), O("span", null, [be(L(R(i)("label.wakeupCheck")) + " ", 1), g.metadata?.createdAt ? (F(), D(S, { key: 0 }, [be(" · " + L(R(o)(g.metadata.createdAt, "time")), 1)], 64)) : E("", !0)])], 8, Xe)) : E("", !0),
|
|
471
|
+
(!R(U)(g) || e.showAllMessageParts) && (!$.value.hidden.has(g.id) || Y.value && Z(v)) && (g.parts.length || Z(v) && Y.value && Q(g)) ? (F(), D("div", {
|
|
472
472
|
key: 3,
|
|
473
|
-
class:
|
|
474
|
-
style:
|
|
473
|
+
class: M(["pk-chatbot-message", [`pk-chatbot-message--${g.role}`, { "pk-chatbot-message--loading": Y.value && Z(v) && Q(g) }]]),
|
|
474
|
+
style: N({ minHeight: Z(v) && Q(g) && !X.value ? `${K.value}px` : void 0 })
|
|
475
475
|
}, [
|
|
476
476
|
k(C, {
|
|
477
477
|
appear: "",
|
|
478
478
|
name: "pk-chatbot-part"
|
|
479
479
|
}, {
|
|
480
|
-
default:
|
|
480
|
+
default: B(() => [Wt(g) ? (F(), T(he, {
|
|
481
481
|
key: 0,
|
|
482
|
-
message:
|
|
483
|
-
"is-streaming":
|
|
484
|
-
"has-content": Kt(
|
|
482
|
+
message: g,
|
|
483
|
+
"is-streaming": Y.value && Z(v),
|
|
484
|
+
"has-content": Kt(g),
|
|
485
485
|
"is-dark": e.isDark
|
|
486
486
|
}, null, 8, [
|
|
487
487
|
"message",
|
|
@@ -491,64 +491,64 @@ var We = ["aria-busy"], Ge = {
|
|
|
491
491
|
])) : E("", !0)]),
|
|
492
492
|
_: 2
|
|
493
493
|
}, 1024),
|
|
494
|
-
(
|
|
494
|
+
(F(!0), D(S, null, we(Pt(g), (n, i) => (F(), D(S, { key: R(ee)(n, i) }, [R(c)(n) && n.text.trim() ? (F(), T(C, {
|
|
495
495
|
key: 0,
|
|
496
496
|
appear: "",
|
|
497
497
|
name: "pk-chatbot-part"
|
|
498
498
|
}, {
|
|
499
|
-
default:
|
|
500
|
-
message:
|
|
499
|
+
default: B(() => [O("div", Ze, [Te(t.$slots, "text", Se({ ref_for: !0 }, {
|
|
500
|
+
message: g,
|
|
501
501
|
part: n,
|
|
502
|
-
index:
|
|
503
|
-
isLoading:
|
|
504
|
-
}), () => [Q(
|
|
502
|
+
index: v,
|
|
503
|
+
isLoading: Y.value
|
|
504
|
+
}), () => [Q(g) ? (F(), T(s, {
|
|
505
505
|
key: 0,
|
|
506
506
|
class: "wysiwyg",
|
|
507
507
|
markdown: n.text,
|
|
508
508
|
"is-dark": e.isDark,
|
|
509
|
-
loading: Z(
|
|
509
|
+
loading: Z(v) && e.status === "streaming"
|
|
510
510
|
}, null, 8, [
|
|
511
511
|
"markdown",
|
|
512
512
|
"is-dark",
|
|
513
513
|
"loading"
|
|
514
|
-
])) : (
|
|
514
|
+
])) : (F(), D(S, { key: 1 }, [be(L(n.text), 1)], 64))]), Ot(g.id) && !q(g.id)?.comment && i === jt(g) ? (F(), D("span", {
|
|
515
515
|
key: 0,
|
|
516
|
-
class:
|
|
517
|
-
title:
|
|
518
|
-
}, [
|
|
516
|
+
class: M(["pk-chatbot-message__reaction", kt(g.id)]),
|
|
517
|
+
title: At(g.id)
|
|
518
|
+
}, [Dt(g.id) ? (F(), D("span", $e, L(Dt(g.id)), 1)) : (F(), T(r, {
|
|
519
519
|
key: 1,
|
|
520
|
-
name:
|
|
521
|
-
}, null, 8, ["name"]))], 10,
|
|
520
|
+
name: Et(g.id) === "downvote" ? "ri:thumb-down-fill" : "ri:thumb-up-fill"
|
|
521
|
+
}, null, 8, ["name"]))], 10, Qe)) : E("", !0)])]),
|
|
522
522
|
_: 2
|
|
523
|
-
}, 1024)) :
|
|
523
|
+
}, 1024)) : R(f)(n) ? (F(), T(C, {
|
|
524
524
|
key: 1,
|
|
525
525
|
appear: "",
|
|
526
526
|
name: "pk-chatbot-part"
|
|
527
527
|
}, {
|
|
528
|
-
default:
|
|
528
|
+
default: B(() => [R(a)(n.filename, n.mediaType) ? (F(), D("div", et, [k(de, {
|
|
529
529
|
"media-type": n.mediaType,
|
|
530
530
|
url: n.url,
|
|
531
531
|
filename: n.filename,
|
|
532
|
-
size:
|
|
532
|
+
size: R(m)(n)?.bytesCount
|
|
533
533
|
}, null, 8, [
|
|
534
534
|
"media-type",
|
|
535
535
|
"url",
|
|
536
536
|
"filename",
|
|
537
537
|
"size"
|
|
538
|
-
]), k(
|
|
538
|
+
]), k(h, {
|
|
539
539
|
url: n.url,
|
|
540
|
-
transcript:
|
|
541
|
-
pending: e.status === "submitted" && Z(
|
|
540
|
+
transcript: R(d)(n),
|
|
541
|
+
pending: e.status === "submitted" && Z(v)
|
|
542
542
|
}, null, 8, [
|
|
543
543
|
"url",
|
|
544
544
|
"transcript",
|
|
545
545
|
"pending"
|
|
546
|
-
])])) : (
|
|
546
|
+
])])) : (F(), T(de, {
|
|
547
547
|
key: 1,
|
|
548
548
|
"media-type": n.mediaType,
|
|
549
549
|
url: n.url,
|
|
550
550
|
filename: n.filename,
|
|
551
|
-
size:
|
|
551
|
+
size: R(m)(n)?.bytesCount
|
|
552
552
|
}, null, 8, [
|
|
553
553
|
"media-type",
|
|
554
554
|
"url",
|
|
@@ -556,17 +556,17 @@ var We = ["aria-busy"], Ge = {
|
|
|
556
556
|
"size"
|
|
557
557
|
]))]),
|
|
558
558
|
_: 2
|
|
559
|
-
}, 1024)) :
|
|
559
|
+
}, 1024)) : R(ce)(n) && !R(b)(n) ? (F(), T(C, {
|
|
560
560
|
key: 2,
|
|
561
561
|
appear: "",
|
|
562
562
|
name: "pk-chatbot-part"
|
|
563
563
|
}, {
|
|
564
|
-
default:
|
|
564
|
+
default: B(() => [(F(), T(Ve, {
|
|
565
565
|
key: `approval-${i}`,
|
|
566
566
|
part: n,
|
|
567
|
-
actionable: e.interactive === !0 && (
|
|
567
|
+
actionable: e.interactive === !0 && (R(ue)(n) || Z(v)),
|
|
568
568
|
"call-verdict": e.confirmVerdictsOnCall?.get(n.toolCallId ?? ""),
|
|
569
|
-
onRespond: (e) =>
|
|
569
|
+
onRespond: (e) => xe(n, e)
|
|
570
570
|
}, null, 8, [
|
|
571
571
|
"part",
|
|
572
572
|
"actionable",
|
|
@@ -574,29 +574,29 @@ var We = ["aria-busy"], Ge = {
|
|
|
574
574
|
"onRespond"
|
|
575
575
|
]))]),
|
|
576
576
|
_: 2
|
|
577
|
-
}, 1024)) : Gt(n) ? (
|
|
577
|
+
}, 1024)) : Gt(n) ? (F(), T(C, {
|
|
578
578
|
key: 3,
|
|
579
579
|
appear: "",
|
|
580
580
|
name: "pk-chatbot-part"
|
|
581
581
|
}, {
|
|
582
|
-
default:
|
|
583
|
-
key: `component-${i}-${
|
|
582
|
+
default: B(() => [!R(A)[n.type] && R(Ie)[R(l)(n)] ? (F(), T(Ee(R(Ie)[R(l)(n)]), {
|
|
583
|
+
key: `component-${i}-${R(ne)(n)}`,
|
|
584
584
|
part: n
|
|
585
|
-
}, null, 8, ["part"])) :
|
|
586
|
-
message:
|
|
585
|
+
}, null, 8, ["part"])) : Te(t.$slots, n.type, Se({ ref_for: !0 }, {
|
|
586
|
+
message: g,
|
|
587
587
|
part: n,
|
|
588
|
-
index:
|
|
589
|
-
isLoading:
|
|
590
|
-
}), () => [e.showAllMessageParts ? (
|
|
588
|
+
index: v,
|
|
589
|
+
isLoading: Y.value
|
|
590
|
+
}), () => [e.showAllMessageParts ? (F(), D("div", tt, [O("div", nt, [R(te)(n) ? (F(), T(r, {
|
|
591
591
|
key: 0,
|
|
592
|
-
name:
|
|
592
|
+
name: R(te)(n),
|
|
593
593
|
class: "shrink-0"
|
|
594
|
-
}, null, 8, ["name"])) : E("", !0), O("code",
|
|
594
|
+
}, null, 8, ["name"])) : E("", !0), O("code", rt, L(R(Pe)(n.type)), 1)])])) : E("", !0)], void 0, 1)]),
|
|
595
595
|
_: 2
|
|
596
596
|
}, 1024)) : E("", !0), k(C, { mode: "out-in" }, {
|
|
597
|
-
default:
|
|
597
|
+
default: B(() => [i === jt(g) && e.readonlyFeedback && q(g.id)?.comment ? (F(), T(pe, {
|
|
598
598
|
key: 0,
|
|
599
|
-
feedback:
|
|
599
|
+
feedback: q(g.id)
|
|
600
600
|
}, null, 8, ["feedback"])) : E("", !0)]),
|
|
601
601
|
_: 2
|
|
602
602
|
}, 1024)], 64))), 128)),
|
|
@@ -604,16 +604,16 @@ var We = ["aria-busy"], Ge = {
|
|
|
604
604
|
name: "fade-in",
|
|
605
605
|
mode: "out-in"
|
|
606
606
|
}, {
|
|
607
|
-
default:
|
|
608
|
-
key: `loading-info-${
|
|
607
|
+
default: B(() => [Y.value && Z(v) && !Ht(g) && Q(g) && (!Wt(g) || Kt(g)) ? (F(), D("div", {
|
|
608
|
+
key: `loading-info-${g.id}`,
|
|
609
609
|
class: "pk-chatbot-message__loading-info"
|
|
610
|
-
}, [O("div",
|
|
610
|
+
}, [O("div", it, [
|
|
611
611
|
k(r, {
|
|
612
612
|
name: "loading-loop",
|
|
613
613
|
class: "shrink-0"
|
|
614
614
|
}),
|
|
615
615
|
k(C, { mode: "out-in" }, {
|
|
616
|
-
default:
|
|
616
|
+
default: B(() => [Rt.value ? (F(), T(r, {
|
|
617
617
|
key: Rt.value,
|
|
618
618
|
class: "shrink-0",
|
|
619
619
|
name: Rt.value
|
|
@@ -621,21 +621,21 @@ var We = ["aria-busy"], Ge = {
|
|
|
621
621
|
_: 1
|
|
622
622
|
}),
|
|
623
623
|
k(C, { mode: "out-in" }, {
|
|
624
|
-
default:
|
|
624
|
+
default: B(() => [Lt.value ? (F(), D("span", {
|
|
625
625
|
key: Lt.value,
|
|
626
626
|
class: "text-12"
|
|
627
|
-
},
|
|
627
|
+
}, L(Lt.value), 1)) : E("", !0)]),
|
|
628
628
|
_: 1
|
|
629
629
|
})
|
|
630
630
|
]), k(C, {
|
|
631
631
|
name: "fade-in",
|
|
632
632
|
mode: "out-in"
|
|
633
633
|
}, {
|
|
634
|
-
default:
|
|
634
|
+
default: B(() => [!Wt(g) && J.value && "text" in J.value && J.value.text.trim() ? (F(), T(me, {
|
|
635
635
|
key: 0,
|
|
636
|
-
markdown:
|
|
636
|
+
markdown: J.value.text,
|
|
637
637
|
"is-dark": e.isDark,
|
|
638
|
-
"tail-length":
|
|
638
|
+
"tail-length": R(ae),
|
|
639
639
|
"inner-class": "wysiwyg",
|
|
640
640
|
class: "border border-surface-3 rounded-md p-4 mt-8 bg-surface-1 max-h-64 text-12 w-full"
|
|
641
641
|
}, null, 8, [
|
|
@@ -648,31 +648,31 @@ var We = ["aria-busy"], Ge = {
|
|
|
648
648
|
_: 2
|
|
649
649
|
}, 1024),
|
|
650
650
|
k(C, { mode: "out-in" }, {
|
|
651
|
-
default:
|
|
651
|
+
default: B(() => [Qt(g, v) ? (F(), D("div", at, [
|
|
652
652
|
k(p, {
|
|
653
653
|
modifiers: "compact",
|
|
654
654
|
class: "mr-auto shrink-0"
|
|
655
655
|
}, {
|
|
656
|
-
default:
|
|
656
|
+
default: B(() => [
|
|
657
657
|
k(C, { mode: "out-in" }, {
|
|
658
|
-
default:
|
|
658
|
+
default: B(() => [Bt(v) ? (F(), T(u, {
|
|
659
659
|
key: 0,
|
|
660
660
|
icon: "ri:reset-right-line",
|
|
661
661
|
modifiers: "action-quiet-small",
|
|
662
|
-
title:
|
|
663
|
-
"aria-label":
|
|
664
|
-
onClick: n[0] ||=
|
|
662
|
+
title: R(i)("action.regenerate"),
|
|
663
|
+
"aria-label": R(i)("action.regenerate"),
|
|
664
|
+
onClick: n[0] ||= V((e) => t.$emit("regenerate"), ["stop"])
|
|
665
665
|
}, null, 8, ["title", "aria-label"])) : E("", !0)]),
|
|
666
666
|
_: 2
|
|
667
667
|
}, 1024),
|
|
668
668
|
k(C, { mode: "out-in" }, {
|
|
669
|
-
default:
|
|
669
|
+
default: B(() => [Vt("show-info", v) ? (F(), T(u, {
|
|
670
670
|
key: 0,
|
|
671
671
|
icon: "ri:information-line",
|
|
672
|
-
title:
|
|
673
|
-
"aria-label":
|
|
672
|
+
title: R(i)("action.getMoreInfo"),
|
|
673
|
+
"aria-label": R(i)("action.getMoreInfo"),
|
|
674
674
|
modifiers: "action-quiet-small",
|
|
675
|
-
onClick:
|
|
675
|
+
onClick: V((e) => t.$emit("show-info", g), ["stop"])
|
|
676
676
|
}, null, 8, [
|
|
677
677
|
"title",
|
|
678
678
|
"aria-label",
|
|
@@ -681,14 +681,14 @@ var We = ["aria-busy"], Ge = {
|
|
|
681
681
|
_: 2
|
|
682
682
|
}, 1024),
|
|
683
683
|
k(C, { mode: "out-in" }, {
|
|
684
|
-
default:
|
|
684
|
+
default: B(() => [Vt("revise", v) ? (F(), T(u, {
|
|
685
685
|
key: 0,
|
|
686
|
-
icon:
|
|
687
|
-
title:
|
|
688
|
-
"aria-label":
|
|
686
|
+
icon: Ct(g.id) ? "ri:file-edit-fill" : "ri:file-edit-line",
|
|
687
|
+
title: Ct(g.id) ? R(i)("action.editRevise") : R(i)("action.createRevise"),
|
|
688
|
+
"aria-label": Ct(g.id) ? R(i)("action.editRevise") : R(i)("action.createRevise"),
|
|
689
689
|
modifiers: "action-quiet-small",
|
|
690
|
-
class:
|
|
691
|
-
onClick:
|
|
690
|
+
class: M({ "text-brand-graphic": Ct(g.id) }),
|
|
691
|
+
onClick: V((e) => t.$emit("revise", g), ["stop"])
|
|
692
692
|
}, null, 8, [
|
|
693
693
|
"icon",
|
|
694
694
|
"title",
|
|
@@ -699,13 +699,13 @@ var We = ["aria-busy"], Ge = {
|
|
|
699
699
|
_: 2
|
|
700
700
|
}, 1024),
|
|
701
701
|
k(C, { mode: "out-in" }, {
|
|
702
|
-
default:
|
|
702
|
+
default: B(() => [wt("upvote", v) ? (F(), T(u, {
|
|
703
703
|
key: 0,
|
|
704
|
-
icon:
|
|
705
|
-
title:
|
|
706
|
-
"aria-label":
|
|
704
|
+
icon: q(g.id)?.vote === "upvote" ? "ri:thumb-up-fill" : "ri:thumb-up-line",
|
|
705
|
+
title: R(i)("action.upvote"),
|
|
706
|
+
"aria-label": R(i)("action.upvote"),
|
|
707
707
|
modifiers: "action-quiet-small",
|
|
708
|
-
onClick:
|
|
708
|
+
onClick: V((e) => t.$emit("upvote", g), ["stop"])
|
|
709
709
|
}, null, 8, [
|
|
710
710
|
"icon",
|
|
711
711
|
"title",
|
|
@@ -715,13 +715,13 @@ var We = ["aria-busy"], Ge = {
|
|
|
715
715
|
_: 2
|
|
716
716
|
}, 1024),
|
|
717
717
|
k(C, { mode: "out-in" }, {
|
|
718
|
-
default:
|
|
718
|
+
default: B(() => [wt("downvote", v) ? (F(), T(u, {
|
|
719
719
|
key: 0,
|
|
720
|
-
icon:
|
|
721
|
-
title:
|
|
722
|
-
"aria-label":
|
|
720
|
+
icon: q(g.id)?.vote === "downvote" ? "ri:thumb-down-fill" : "ri:thumb-down-line",
|
|
721
|
+
title: R(i)("action.downvote"),
|
|
722
|
+
"aria-label": R(i)("action.downvote"),
|
|
723
723
|
modifiers: "action-quiet-small",
|
|
724
|
-
onClick:
|
|
724
|
+
onClick: V((e) => t.$emit("downvote", g), ["stop"])
|
|
725
725
|
}, null, 8, [
|
|
726
726
|
"icon",
|
|
727
727
|
"title",
|
|
@@ -731,13 +731,13 @@ var We = ["aria-busy"], Ge = {
|
|
|
731
731
|
_: 2
|
|
732
732
|
}, 1024),
|
|
733
733
|
k(C, { mode: "out-in" }, {
|
|
734
|
-
default:
|
|
734
|
+
default: B(() => [wt("feedback", v) ? (F(), T(u, {
|
|
735
735
|
key: 0,
|
|
736
|
-
icon:
|
|
737
|
-
title:
|
|
738
|
-
"aria-label":
|
|
736
|
+
icon: q(g.id)?.comment ? "ri:feedback-fill" : "ri:feedback-line",
|
|
737
|
+
title: R(i)("action.feedback"),
|
|
738
|
+
"aria-label": R(i)("action.feedback"),
|
|
739
739
|
modifiers: "action-quiet-small",
|
|
740
|
-
onClick:
|
|
740
|
+
onClick: V((e) => t.$emit("feedback", g), ["stop"])
|
|
741
741
|
}, null, 8, [
|
|
742
742
|
"icon",
|
|
743
743
|
"title",
|
|
@@ -749,47 +749,47 @@ var We = ["aria-busy"], Ge = {
|
|
|
749
749
|
]),
|
|
750
750
|
_: 2
|
|
751
751
|
}, 1024),
|
|
752
|
-
!e.showMessageDateTime &&
|
|
753
|
-
datetime: new Date(
|
|
754
|
-
title:
|
|
752
|
+
!e.showMessageDateTime && g.metadata?.createdAt && g.metadata?.completedAt ? (F(), D("div", ot, [O("time", {
|
|
753
|
+
datetime: new Date(g.metadata.createdAt).toISOString(),
|
|
754
|
+
title: R(o)(new Date(g.metadata.createdAt), "date-time"),
|
|
755
755
|
class: "flex items-center gap-4 min-w-0"
|
|
756
756
|
}, [k(r, {
|
|
757
757
|
name: "ri:time-line",
|
|
758
758
|
class: "shrink-0"
|
|
759
|
-
}), O("span",
|
|
759
|
+
}), O("span", ct, L($t(g.metadata.createdAt)), 1)], 8, st), en(g) ? (F(), D("span", lt, [k(r, {
|
|
760
760
|
name: "ri:hourglass-line",
|
|
761
761
|
class: "shrink-0"
|
|
762
|
-
}), O("span",
|
|
763
|
-
e.showMessageNumber ? (
|
|
762
|
+
}), O("span", ut, L(en(g)), 1)])) : E("", !0)])) : E("", !0),
|
|
763
|
+
e.showMessageNumber ? (F(), D("span", {
|
|
764
764
|
key: 1,
|
|
765
|
-
title:
|
|
765
|
+
title: R(i)("label.messageNumber", { n: Zt.value[v] }),
|
|
766
766
|
class: "text-12 text-word-3 tabular-nums"
|
|
767
|
-
}, " #" +
|
|
768
|
-
e.showMessageTokensCount &&
|
|
767
|
+
}, " #" + L(Zt.value[v]), 9, dt)) : E("", !0),
|
|
768
|
+
e.showMessageTokensCount && g.metadata?.totalTokens ? (F(), D("span", ft, [k(r, {
|
|
769
769
|
name: "ri:ai-generate-2-line",
|
|
770
770
|
class: "shrink-0"
|
|
771
|
-
}), O("span",
|
|
772
|
-
e.showMessageDateTime &&
|
|
771
|
+
}), O("span", pt, L(R(se)(g.metadata.totalTokens, "integer")) + " " + L(R(i)("label.tokens")), 1)])) : E("", !0),
|
|
772
|
+
e.showMessageDateTime && g.metadata?.createdAt ? (F(), D("time", {
|
|
773
773
|
key: 3,
|
|
774
|
-
datetime: new Date(
|
|
774
|
+
datetime: new Date(g.metadata?.createdAt).toISOString(),
|
|
775
775
|
class: "flex items-center gap-4 text-12 text-word-3"
|
|
776
776
|
}, [k(r, {
|
|
777
777
|
name: "ri:time-line",
|
|
778
778
|
class: "shrink-0"
|
|
779
|
-
}), O("span",
|
|
780
|
-
e.showMessageDateTime &&
|
|
779
|
+
}), O("span", ht, L(R(o)(new Date(g.metadata?.createdAt), "date-time")), 1)], 8, mt)) : E("", !0),
|
|
780
|
+
e.showMessageDateTime && g?.metadata?.completedAt && g?.metadata?.createdAt ? (F(), D("div", gt, [k(r, {
|
|
781
781
|
name: "ri:hourglass-line",
|
|
782
782
|
class: "shrink-0"
|
|
783
|
-
}), k(
|
|
783
|
+
}), k(_, {
|
|
784
784
|
class: "truncate",
|
|
785
|
-
date:
|
|
786
|
-
"end-date":
|
|
785
|
+
date: g.metadata?.createdAt,
|
|
786
|
+
"end-date": g.metadata?.completedAt
|
|
787
787
|
}, null, 8, ["date", "end-date"])])) : E("", !0)
|
|
788
788
|
])) : E("", !0)]),
|
|
789
789
|
_: 2
|
|
790
790
|
}, 1024),
|
|
791
791
|
k(C, { mode: "out-in" }, {
|
|
792
|
-
default:
|
|
792
|
+
default: B(() => [g.id === e.feedbackMessageId ? (F(), T(fe, {
|
|
793
793
|
key: 0,
|
|
794
794
|
ref_for: !0,
|
|
795
795
|
ref_key: "feedbackMessageEl",
|
|
@@ -812,21 +812,21 @@ var We = ["aria-busy"], Ge = {
|
|
|
812
812
|
appear: "",
|
|
813
813
|
name: "pk-chatbot-part"
|
|
814
814
|
}, {
|
|
815
|
-
default:
|
|
815
|
+
default: B(() => [Ft.value ? (F(), D("div", {
|
|
816
816
|
key: 0,
|
|
817
817
|
class: "pk-chatbot-message pk-chatbot-message--assistant pk-chatbot-message--loading",
|
|
818
|
-
style:
|
|
819
|
-
}, [O("div",
|
|
818
|
+
style: N({ minHeight: It.value ? `${K.value}px` : void 0 })
|
|
819
|
+
}, [O("div", _t, [O("div", vt, [k(r, {
|
|
820
820
|
name: "loading-loop",
|
|
821
821
|
class: "shrink-0"
|
|
822
|
-
}), O("span",
|
|
822
|
+
}), O("span", yt, L(R(i)("label.answeringOnTheCall")), 1)])])], 4)) : E("", !0)]),
|
|
823
823
|
_: 1
|
|
824
824
|
}),
|
|
825
825
|
k(C, {
|
|
826
826
|
appear: "",
|
|
827
827
|
name: "pk-chatbot-part"
|
|
828
828
|
}, {
|
|
829
|
-
default:
|
|
829
|
+
default: B(() => [X.value ? (F(), T(g, {
|
|
830
830
|
key: 0,
|
|
831
831
|
error: e.error,
|
|
832
832
|
onRetry: n[3] ||= (e) => t.$emit("auto-retry"),
|
|
@@ -834,28 +834,28 @@ var We = ["aria-busy"], Ge = {
|
|
|
834
834
|
}, null, 8, ["error"])) : E("", !0)]),
|
|
835
835
|
_: 1
|
|
836
836
|
}),
|
|
837
|
-
|
|
837
|
+
Mt.value?.role === "user" && !It.value || X.value ? (F(), D("div", {
|
|
838
838
|
key: 0,
|
|
839
839
|
class: "pk-chatbot-messages__spacer",
|
|
840
|
-
style:
|
|
840
|
+
style: N({ minHeight: `${K.value}px` })
|
|
841
841
|
}, null, 4)) : E("", !0)
|
|
842
842
|
], 512),
|
|
843
843
|
k(C, { name: "pk-chatbot-messages-fab" }, {
|
|
844
|
-
default:
|
|
844
|
+
default: B(() => [e.showScrollToBottom && (R(W) || !R(Ne)) ? (F(), D("button", {
|
|
845
845
|
key: 0,
|
|
846
846
|
type: "button",
|
|
847
847
|
class: "pk-chatbot-messages__scroll-to-bottom",
|
|
848
|
-
title:
|
|
849
|
-
"aria-label":
|
|
850
|
-
onClick:
|
|
851
|
-
}, [k(r, { name: "ri:arrow-down-line" })], 8,
|
|
848
|
+
title: R(i)("action.scrollToBottom"),
|
|
849
|
+
"aria-label": R(i)("action.scrollToBottom"),
|
|
850
|
+
onClick: Fe
|
|
851
|
+
}, [k(r, { name: "ri:arrow-down-line" })], 8, bt)) : E("", !0)]),
|
|
852
852
|
_: 1
|
|
853
853
|
})
|
|
854
|
-
], 46,
|
|
854
|
+
], 46, Ge);
|
|
855
855
|
};
|
|
856
856
|
}
|
|
857
857
|
});
|
|
858
858
|
//#endregion
|
|
859
|
-
export {
|
|
859
|
+
export { Fe as a, Pe as i, G as n, Ne as r, xt as t };
|
|
860
860
|
|
|
861
|
-
//# sourceMappingURL=PkChatbotMessages-
|
|
861
|
+
//# sourceMappingURL=PkChatbotMessages-DnoohZxu.js.map
|