@8wave/ai-elements 0.125.0-beta.10 → 0.125.0-beta.11
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/_chunks/{PkChatbotFilePreview-DuvRnOes.js → PkChatbotFilePreview-fbgRmR9n.js} +58 -55
- package/dist/_chunks/PkChatbotFilePreview-fbgRmR9n.js.map +1 -0
- package/dist/_chunks/{PkStreamingMarkdown-BM-DSTPr.js → PkStreamingMarkdown-CfdkyZqP.js} +803 -799
- package/dist/_chunks/PkStreamingMarkdown-CfdkyZqP.js.map +1 -0
- package/dist/_chunks/{PkToolChatFile-DbeOmRPh.js → PkToolChatFile-ClZrtYIz.js} +2 -2
- package/dist/_chunks/{PkToolChatFile-DbeOmRPh.js.map → PkToolChatFile-ClZrtYIz.js.map} +1 -1
- package/dist/_chunks/{PkToolShareDocument-Buzu27rQ.js → PkToolShareDocument-DLRwzPaL.js} +2 -2
- package/dist/_chunks/{PkToolShareDocument-Buzu27rQ.js.map → PkToolShareDocument-DLRwzPaL.js.map} +1 -1
- package/dist/_chunks/{PkToolShowArtifact-utxGuLLt.js → PkToolShowArtifact-Dc4YM786.js} +2 -2
- package/dist/_chunks/{PkToolShowArtifact-utxGuLLt.js.map → PkToolShowArtifact-Dc4YM786.js.map} +1 -1
- package/dist/_chunks/{PkToolShowContactForm-DTtE93D3.js → PkToolShowContactForm-CU1Sv3DA.js} +2 -2
- package/dist/_chunks/{PkToolShowContactForm-DTtE93D3.js.map → PkToolShowContactForm-CU1Sv3DA.js.map} +1 -1
- package/dist/_chunks/{PkToolShowDiagram-BHd-C_cx.js → PkToolShowDiagram-BDrdT_AB.js} +4 -2
- package/dist/_chunks/PkToolShowDiagram-BDrdT_AB.js.map +1 -0
- package/dist/_chunks/{PkToolShowForm-I4pKopEI.js → PkToolShowForm-DDgEmFRc.js} +2 -2
- package/dist/_chunks/{PkToolShowForm-I4pKopEI.js.map → PkToolShowForm-DDgEmFRc.js.map} +1 -1
- package/dist/_chunks/{PkToolShowImageGallery-skV87BlD.js → PkToolShowImageGallery-BCSO1iSG.js} +9 -4
- package/dist/_chunks/PkToolShowImageGallery-BCSO1iSG.js.map +1 -0
- package/dist/_chunks/{PkToolShowSources-DLmVS3bL.js → PkToolShowSources-DDI2s76O.js} +2 -2
- package/dist/_chunks/{PkToolShowSources-DLmVS3bL.js.map → PkToolShowSources-DDI2s76O.js.map} +1 -1
- package/dist/_chunks/{useLightbox-BigL4WLe.js → useLightbox-BEEzZ0qT.js} +112 -41
- package/dist/_chunks/useLightbox-BEEzZ0qT.js.map +1 -0
- package/dist/ai-elements.es.js +2420 -2409
- package/dist/ai-elements.es.js.map +1 -1
- package/dist-vue/PkChatbot.js +1 -1
- package/dist-vue/PkChatbotEmptyState.js +1 -1
- package/dist-vue/PkChatbotFilePreview.js +1 -1
- package/dist-vue/PkChatbotInput.js +1 -1
- package/dist-vue/PkChatbotMessages.js +1 -1
- package/dist-vue/PkChatbotSteps.js +1 -1
- package/dist-vue/PkChatbotViewChat.js +1 -1
- package/dist-vue/_chunks/{PkChatbot-CLOfTLQy.js → PkChatbot-D4SNWH_2.js} +3 -3
- package/dist-vue/_chunks/{PkChatbot-CLOfTLQy.js.map → PkChatbot-D4SNWH_2.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotEmptyState-C9aUiynZ.js → PkChatbotEmptyState-BnCCmm10.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotEmptyState-C9aUiynZ.js.map → PkChatbotEmptyState-BnCCmm10.js.map} +1 -1
- package/dist-vue/_chunks/PkChatbotFilePreview-BpVM850N.js +291 -0
- package/dist-vue/_chunks/PkChatbotFilePreview-BpVM850N.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotInput-Bs8nn-Jz.js → PkChatbotInput-COjn57UP.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotInput-Bs8nn-Jz.js.map → PkChatbotInput-COjn57UP.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotMessages-BxkCGmqV.js → PkChatbotMessages-D-m0cOqM.js} +282 -279
- package/dist-vue/_chunks/PkChatbotMessages-D-m0cOqM.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotSteps-MTSA_RrY.js → PkChatbotSteps-BWKjM1Z4.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotSteps-MTSA_RrY.js.map → PkChatbotSteps-BWKjM1Z4.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewChat-BwXOt2WW.js → PkChatbotViewChat-DIh2wVa_.js} +5 -5
- package/dist-vue/_chunks/{PkChatbotViewChat-BwXOt2WW.js.map → PkChatbotViewChat-DIh2wVa_.js.map} +1 -1
- package/dist-vue/_chunks/{PkStreamingMarkdown-DlcTV5je.js → PkStreamingMarkdown-BZPAHAni.js} +760 -757
- package/dist-vue/_chunks/PkStreamingMarkdown-BZPAHAni.js.map +1 -0
- package/dist-vue/_chunks/{PkSvgViewer-DBYr0CUi.js → PkSvgViewer-DmkElalq.js} +4 -2
- package/dist-vue/_chunks/PkSvgViewer-DmkElalq.js.map +1 -0
- package/dist-vue/_chunks/{PkToolChatFile-HWGjtuaT.js → PkToolChatFile-BGH2cQuM.js} +2 -2
- package/dist-vue/_chunks/{PkToolChatFile-HWGjtuaT.js.map → PkToolChatFile-BGH2cQuM.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShareDocument-CsS5OTDj.js → PkToolShareDocument-BIZkgcJ3.js} +2 -2
- package/dist-vue/_chunks/{PkToolShareDocument-CsS5OTDj.js.map → PkToolShareDocument-BIZkgcJ3.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowArtifact-C8OIF_sy.js → PkToolShowArtifact-DCe8yizN.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowArtifact-C8OIF_sy.js.map → PkToolShowArtifact-DCe8yizN.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowContactForm-K6Z5MUXk.js → PkToolShowContactForm-4bO4fM5O.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowContactForm-K6Z5MUXk.js.map → PkToolShowContactForm-4bO4fM5O.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowDiagram-DrlGh_v6.js → PkToolShowDiagram-DNRUCCt8.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowDiagram-DrlGh_v6.js.map → PkToolShowDiagram-DNRUCCt8.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowForm-DzsXJfOl.js → PkToolShowForm-CQwXQwgt.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowForm-DzsXJfOl.js.map → PkToolShowForm-CQwXQwgt.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowImageGallery-sCyrPOIT.js → PkToolShowImageGallery-CgDng1Gr.js} +17 -12
- package/dist-vue/_chunks/PkToolShowImageGallery-CgDng1Gr.js.map +1 -0
- package/dist-vue/_chunks/{PkToolShowLocation-DAQEuCuQ.js → PkToolShowLocation-DCPaDtBI.js} +3 -3
- package/dist-vue/_chunks/PkToolShowLocation-DCPaDtBI.js.map +1 -0
- package/dist-vue/_chunks/{PkToolShowProductList-DPDDeVu4.js → PkToolShowProductList-DyPyz1pU.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowProductList-DPDDeVu4.js.map → PkToolShowProductList-DyPyz1pU.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSources-D4zjssdh.js → PkToolShowSources-C3JjevRj.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowSources-D4zjssdh.js.map → PkToolShowSources-C3JjevRj.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowVideo-C77DAqoZ.js → PkToolShowVideo--qiiAK7R.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowVideo-C77DAqoZ.js.map → PkToolShowVideo--qiiAK7R.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowWebPages-D_tqGI6o.js → PkToolShowWebPages-Cw9FPQuL.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowWebPages-D_tqGI6o.js.map → PkToolShowWebPages-Cw9FPQuL.js.map} +1 -1
- package/dist-vue/_chunks/useLightbox-gSzoBgNv.js +190 -0
- package/dist-vue/_chunks/useLightbox-gSzoBgNv.js.map +1 -0
- package/dist-vue/composables.js +8 -0
- package/dist-vue/composables.js.map +1 -1
- package/dist-vue/index.js +2899 -2898
- package/dist-vue/index.js.map +1 -1
- package/dist-vue/locales.js +10 -0
- package/dist-vue/packages/components/src/composables/useLightbox.d.ts +33 -3
- package/dist-vue/style.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/PkChatbotFilePreview-DuvRnOes.js.map +0 -1
- package/dist/_chunks/PkStreamingMarkdown-BM-DSTPr.js.map +0 -1
- package/dist/_chunks/PkToolShowDiagram-BHd-C_cx.js.map +0 -1
- package/dist/_chunks/PkToolShowImageGallery-skV87BlD.js.map +0 -1
- package/dist/_chunks/useLightbox-BigL4WLe.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotFilePreview-KxVpL0UT.js +0 -391
- package/dist-vue/_chunks/PkChatbotFilePreview-KxVpL0UT.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotMessages-BxkCGmqV.js.map +0 -1
- package/dist-vue/_chunks/PkStreamingMarkdown-DlcTV5je.js.map +0 -1
- package/dist-vue/_chunks/PkSvgViewer-DBYr0CUi.js.map +0 -1
- package/dist-vue/_chunks/PkToolShowImageGallery-sCyrPOIT.js.map +0 -1
- package/dist-vue/_chunks/PkToolShowLocation-DAQEuCuQ.js.map +0 -1
- package/dist-vue/_chunks/cdn-css-C3_zuSx6.js +0 -15
- package/dist-vue/_chunks/cdn-css-C3_zuSx6.js.map +0 -1
|
@@ -2,83 +2,84 @@ import { A as e, E as t, S as n, n as r, v as i } from "./schemas-BO5QlXAp.js";
|
|
|
2
2
|
import { c as a } from "./Media-DylqhvaF.js";
|
|
3
3
|
import { A as o, H as s, _ as c, k as l, r as u } from "./Agent-BtXBSGy6.js";
|
|
4
4
|
import { t as d } from "./VvButtonLocalized-C-vx25u4.js";
|
|
5
|
-
import { t as f } from "./
|
|
5
|
+
import { t as f } from "./useLightbox-gSzoBgNv.js";
|
|
6
|
+
import { t as p } from "./PkStreamingMarkdown-BZPAHAni.js";
|
|
6
7
|
import "./src-nb8MU1sh.js";
|
|
7
|
-
import { c as
|
|
8
|
-
import { t as
|
|
9
|
-
import { A as
|
|
10
|
-
import { t as
|
|
11
|
-
import { t as
|
|
12
|
-
import { t as be } from "./PkChatbotFilePreview-KxVpL0UT.js";
|
|
8
|
+
import { c as m, i as h, l as g, n as _, o as ee, s as v, t as y, u as b } from "./message-DuibQyHy.js";
|
|
9
|
+
import { t as te } from "./PkChatbotAudioTranscript-SSTh074Z.js";
|
|
10
|
+
import { A as x, D as ne, I as re, N as S, O as ie, P as ae, S as oe, b as se, d as ce, g as C, h as le, i as ue, j as de, n as fe, r as pe, t as w, u as me, v as he, x as ge, y as _e, z as ve } from "./utils-CX4JuhXz.js";
|
|
11
|
+
import { t as ye } from "./PkChatbotError-BS84xuiu.js";
|
|
12
|
+
import { t as be } from "./PkRelativeTime-CZF5CYHv.js";
|
|
13
13
|
import { t as xe } from "./PkChatbotFeedbackForm-Bh3tvNUW.js";
|
|
14
14
|
import { t as Se } from "./PkChatbotMessageFeedback-DltXugdR.js";
|
|
15
|
-
import {
|
|
16
|
-
import { t as Ee } from "./
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
15
|
+
import { t as Ce } from "./PkChatbotFilePreview-BpVM850N.js";
|
|
16
|
+
import { n as we, r as Te, t as Ee } from "./PkChatbotSteps-BWKjM1Z4.js";
|
|
17
|
+
import { t as De } from "./PkChatbotOutlineRail-BI-DMvZi.js";
|
|
18
|
+
import { VvAccordion as Oe, VvButtonGroup as ke, VvIcon as Ae } from "@volverjs/ui-vue/components";
|
|
19
|
+
import { Fragment as T, Transition as E, computed as D, createBlock as O, createCommentVNode as k, createElementBlock as A, createElementVNode as j, createTextVNode as je, createVNode as M, defineAsyncComponent as N, defineComponent as P, inject as Me, mergeProps as Ne, nextTick as F, normalizeClass as I, normalizeStyle as Pe, onBeforeUnmount as L, onMounted as Fe, openBlock as R, ref as z, renderList as Ie, renderSlot as Le, resolveDynamicComponent as Re, shallowRef as ze, toDisplayString as B, unref as V, useSlots as Be, useTemplateRef as Ve, watch as H, withCtx as U, withModifiers as W } from "vue";
|
|
20
|
+
import { useI18n as He } from "vue-i18n";
|
|
21
|
+
import { useResizeObserver as Ue } from "@vueuse/core";
|
|
21
22
|
// ../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/iso.js
|
|
22
|
-
function
|
|
23
|
+
function We(t) {
|
|
23
24
|
return e(r, t);
|
|
24
25
|
}
|
|
25
26
|
i({
|
|
26
27
|
platform: n(),
|
|
27
28
|
threadId: n()
|
|
28
29
|
});
|
|
29
|
-
var
|
|
30
|
+
var Ge = i({
|
|
30
31
|
wakeId: t(),
|
|
31
|
-
dueAt:
|
|
32
|
+
dueAt: We(),
|
|
32
33
|
reason: n()
|
|
33
34
|
});
|
|
34
|
-
i({ pendingWakeup:
|
|
35
|
-
var G = (e) => e?.role === "user" && !!e.metadata?.wakeup,
|
|
35
|
+
i({ pendingWakeup: Ge.nullable() }), i({ wakeId: t() });
|
|
36
|
+
var G = (e) => e?.role === "user" && !!e.metadata?.wakeup, Ke = /* @__PURE__ */ new Set([
|
|
36
37
|
"input-streaming",
|
|
37
38
|
"input-available",
|
|
38
39
|
"approval-requested"
|
|
39
|
-
]),
|
|
40
|
+
]), qe = /* @__PURE__ */ new Set([
|
|
40
41
|
...o,
|
|
41
42
|
...l,
|
|
42
43
|
...c
|
|
43
44
|
]);
|
|
44
45
|
[...l, u.ShowContactForm];
|
|
45
|
-
var
|
|
46
|
+
var Je = (e) => e.state, Ye = (e) => e.type.startsWith("tool-") ? e.type.slice(5) : void 0, K = (e) => e?.role === "assistant" && e.parts.some((e) => {
|
|
46
47
|
if (e.type === "text") return e.text.trim().length > 0;
|
|
47
48
|
if (e.type === "file") return !0;
|
|
48
|
-
let t =
|
|
49
|
-
if (t &&
|
|
50
|
-
let n =
|
|
51
|
-
return n !== void 0 &&
|
|
52
|
-
}),
|
|
49
|
+
let t = Je(e);
|
|
50
|
+
if (t && Ke.has(t)) return !0;
|
|
51
|
+
let n = Ye(e);
|
|
52
|
+
return n !== void 0 && qe.has(n) && t === "output-available";
|
|
53
|
+
}), Xe = (e) => {
|
|
53
54
|
if (e?.role !== "assistant" || K(e)) return !1;
|
|
54
55
|
let t = !1;
|
|
55
|
-
for (let n of e.parts) n.type === "tool-scheduleWakeup" && (t =
|
|
56
|
+
for (let n of e.parts) n.type === "tool-scheduleWakeup" && (t = Je(n) === "output-available" && n.input?.noop === !0);
|
|
56
57
|
return t;
|
|
57
|
-
},
|
|
58
|
+
}, Ze = {
|
|
58
59
|
requestOAuthConnection: N(() => import("./PkToolRequestOAuthConnection-DAAYyufP.js")),
|
|
59
|
-
shareDocument: N(() => import("./PkToolShareDocument-
|
|
60
|
-
showArtifact: N(() => import("./PkToolShowArtifact-
|
|
60
|
+
shareDocument: N(() => import("./PkToolShareDocument-BIZkgcJ3.js").then((e) => e.n)),
|
|
61
|
+
showArtifact: N(() => import("./PkToolShowArtifact-DCe8yizN.js").then((e) => e.n)),
|
|
61
62
|
showCalendarEvent: N(() => import("./PkToolShowCalendarEvent-CAejFLQI.js").then((e) => e.n)),
|
|
62
63
|
showComparison: N(() => import("./PkToolShowComparison-BEHyRNXE.js").then((e) => e.n)),
|
|
63
|
-
showContactForm: N(() => import("./PkToolShowContactForm-
|
|
64
|
-
showDiagram: N(() => import("./PkToolShowDiagram-
|
|
64
|
+
showContactForm: N(() => import("./PkToolShowContactForm-4bO4fM5O.js").then((e) => e.n)),
|
|
65
|
+
showDiagram: N(() => import("./PkToolShowDiagram-DNRUCCt8.js")),
|
|
65
66
|
showEmail: N(() => import("./PkToolShowEmail-BehvoNsz.js").then((e) => e.n)),
|
|
66
|
-
showImageGallery: N(() => import("./PkToolShowImageGallery-
|
|
67
|
-
showLocation: N(() => import("./PkToolShowLocation-
|
|
67
|
+
showImageGallery: N(() => import("./PkToolShowImageGallery-CgDng1Gr.js").then((e) => e.n)),
|
|
68
|
+
showLocation: N(() => import("./PkToolShowLocation-DCPaDtBI.js").then((e) => e.n)),
|
|
68
69
|
showMessage: N(() => import("./PkToolShowMessage-Cca7K7GQ.js").then((e) => e.n)),
|
|
69
|
-
showForm: N(() => import("./PkToolShowForm-
|
|
70
|
-
showMultipleChoice: N(() => import("./PkToolShowForm-
|
|
71
|
-
showProductList: N(() => import("./PkToolShowProductList-
|
|
70
|
+
showForm: N(() => import("./PkToolShowForm-CQwXQwgt.js").then((e) => e.n)),
|
|
71
|
+
showMultipleChoice: N(() => import("./PkToolShowForm-CQwXQwgt.js").then((e) => e.n)),
|
|
72
|
+
showProductList: N(() => import("./PkToolShowProductList-DyPyz1pU.js").then((e) => e.n)),
|
|
72
73
|
showQrCode: N(() => import("./PkToolShowQrCode-96KzD1rX.js").then((e) => e.n)),
|
|
73
|
-
showSources: N(() => import("./PkToolShowSources-
|
|
74
|
+
showSources: N(() => import("./PkToolShowSources-C3JjevRj.js").then((e) => e.n)),
|
|
74
75
|
showSuggestedReply: N(() => import("./PkToolShowSuggestedReply-smfC1hlT.js").then((e) => e.n)),
|
|
75
|
-
showVideo: N(() => import("./PkToolShowVideo
|
|
76
|
+
showVideo: N(() => import("./PkToolShowVideo--qiiAK7R.js")),
|
|
76
77
|
showWeather: N(() => import("./PkToolShowWeather-BC-Rx-sI.js")),
|
|
77
|
-
showWebPages: N(() => import("./PkToolShowWebPages-
|
|
78
|
-
},
|
|
78
|
+
showWebPages: N(() => import("./PkToolShowWebPages-Cw9FPQuL.js").then((e) => e.n))
|
|
79
|
+
}, Qe = {
|
|
79
80
|
key: 0,
|
|
80
81
|
class: "text-12 text-word-3 m-0 mb-xs"
|
|
81
|
-
},
|
|
82
|
+
}, $e = /* @__PURE__ */ P({
|
|
82
83
|
__name: "PkToolApprovalPreviewMessage",
|
|
83
84
|
props: { input: {} },
|
|
84
85
|
setup(e) {
|
|
@@ -86,12 +87,12 @@ var qe = (e) => e.state, Je = (e) => e.type.startsWith("tool-") ? e.type.slice(5
|
|
|
86
87
|
let e = t.input;
|
|
87
88
|
return typeof e?.message == "string" ? e.message : "";
|
|
88
89
|
});
|
|
89
|
-
return (e, t) => n.value ? (R(), A("p",
|
|
90
|
+
return (e, t) => n.value ? (R(), A("p", Qe, B(n.value), 1)) : k("", !0);
|
|
90
91
|
}
|
|
91
|
-
}),
|
|
92
|
+
}), et = { [w]: $e }, tt = {
|
|
92
93
|
key: 0,
|
|
93
94
|
class: "text-12 text-word-3 m-0 mb-xs"
|
|
94
|
-
},
|
|
95
|
+
}, nt = /* @__PURE__ */ P({
|
|
95
96
|
__name: "PkToolApprovalCard",
|
|
96
97
|
props: {
|
|
97
98
|
part: {},
|
|
@@ -100,15 +101,15 @@ var qe = (e) => e.state, Je = (e) => e.type.startsWith("tool-") ? e.type.slice(5
|
|
|
100
101
|
},
|
|
101
102
|
emits: ["respond"],
|
|
102
103
|
setup(e, { emit: t }) {
|
|
103
|
-
let n = e, r = t, { t: i, te: a } =
|
|
104
|
+
let n = e, r = t, { t: i, te: a } = He({ useScope: "global" }), o = D(() => n.part), c = D(() => h(n.part)), l = D(() => c.value === w), u = D(() => l.value ? (o.value.state === "input-available" || s(o.value.output)) && n.callVerdict === void 0 : o.value.state === "approval-requested"), f = D(() => u.value && n.actionable === !0), p = D(() => u.value && n.actionable !== !0), m = D(() => l.value ? o.value.output === "confirmed" || n.callVerdict === !0 : o.value.approval?.approved === !0), g = D(() => l.value ? o.value.output === "cancelled" || n.callVerdict === !1 : o.value.approval?.approved === !1 || o.value.state === "output-denied"), _ = D(() => et[c.value]), ee = D(() => _.value ? i("toolApproval.prompt") : i("toolApproval.promptNamed", { tool: ve(c.value, {
|
|
104
105
|
t: i,
|
|
105
106
|
te: a
|
|
106
|
-
}) })),
|
|
107
|
+
}) })), v = D(() => {
|
|
107
108
|
if (p.value) return {
|
|
108
109
|
icon: "ri:time-line",
|
|
109
110
|
message: i("toolApproval.expired")
|
|
110
111
|
};
|
|
111
|
-
if (
|
|
112
|
+
if (m.value) return {
|
|
112
113
|
icon: "ri:check-line",
|
|
113
114
|
message: i(l.value ? "toolApproval.confirmed" : "toolApproval.approved")
|
|
114
115
|
};
|
|
@@ -116,27 +117,27 @@ var qe = (e) => e.state, Je = (e) => e.type.startsWith("tool-") ? e.type.slice(5
|
|
|
116
117
|
icon: "ri:close-line",
|
|
117
118
|
message: i(l.value ? "toolApproval.cancelled" : "toolApproval.denied")
|
|
118
119
|
};
|
|
119
|
-
}),
|
|
120
|
+
}), y = D(() => !!v.value && !_.value);
|
|
120
121
|
return (t, n) => {
|
|
121
|
-
let a = d, s =
|
|
122
|
-
return R(), A("div", { class: I(["w-full overflow-hidden transition-all duration-300", { "bg-surface p-sm rounded-xl border border-surface-3": !
|
|
122
|
+
let a = d, s = ke, c = Ae;
|
|
123
|
+
return R(), A("div", { class: I(["w-full overflow-hidden transition-all duration-300", { "bg-surface p-sm rounded-xl border border-surface-3": !y.value }]) }, [
|
|
123
124
|
M(E, null, {
|
|
124
|
-
default: U(() => [!l.value && u.value ? (R(), A("p",
|
|
125
|
+
default: U(() => [!l.value && u.value ? (R(), A("p", tt, B(ee.value), 1)) : k("", !0)]),
|
|
125
126
|
_: 1
|
|
126
127
|
}),
|
|
127
|
-
_.value ? (R(), O(
|
|
128
|
+
_.value ? (R(), O(Re(_.value), {
|
|
128
129
|
key: 0,
|
|
129
130
|
part: e.part,
|
|
130
131
|
input: o.value.input
|
|
131
132
|
}, null, 8, ["part", "input"])) : k("", !0),
|
|
132
133
|
M(E, { mode: "out-in" }, {
|
|
133
|
-
default: U(() => [
|
|
134
|
+
default: U(() => [v.value ? (R(), A("p", {
|
|
134
135
|
key: 1,
|
|
135
136
|
class: I(["flex items-center gap-4 text-12 text-word-3 m-0", { "mt-xs": _.value }])
|
|
136
137
|
}, [M(c, {
|
|
137
|
-
name:
|
|
138
|
+
name: v.value.icon,
|
|
138
139
|
class: "shrink-0"
|
|
139
|
-
}, null, 8, ["name"]),
|
|
140
|
+
}, null, 8, ["name"]), je(" " + B(v.value.message), 1)], 2)) : (R(), O(s, { key: 0 }, {
|
|
140
141
|
default: U(() => [M(a, {
|
|
141
142
|
modifiers: "primary-small",
|
|
142
143
|
disabled: !f.value,
|
|
@@ -157,16 +158,16 @@ var qe = (e) => e.state, Je = (e) => e.type.startsWith("tool-") ? e.type.slice(5
|
|
|
157
158
|
], 2);
|
|
158
159
|
};
|
|
159
160
|
}
|
|
160
|
-
}), q = { class: "pk-host-call-confirm-card w-full bg-surface p-sm rounded-xl border border-surface-3" }, J = { class: "text-14 text-word-2 m-0 mb-xs" },
|
|
161
|
+
}), q = { class: "pk-host-call-confirm-card w-full bg-surface p-sm rounded-xl border border-surface-3" }, J = { class: "text-14 text-word-2 m-0 mb-xs" }, rt = {
|
|
161
162
|
key: 1,
|
|
162
163
|
class: "pk-host-call-confirm-card__details text-14 m-0 mb-xs"
|
|
163
|
-
},
|
|
164
|
+
}, it = {
|
|
164
165
|
key: 0,
|
|
165
166
|
class: "text-word-3 truncate"
|
|
166
|
-
},
|
|
167
|
+
}, at = {
|
|
167
168
|
key: 2,
|
|
168
169
|
class: "text-12 text-word-3 m-0 mb-xs"
|
|
169
|
-
},
|
|
170
|
+
}, ot = { class: "pk-host-call-confirm-card__details text-12 m-0" }, st = { class: "text-word-3" }, ct = { class: "text-word-2 m-0" }, lt = /* @__PURE__ */ P({
|
|
170
171
|
__name: "PkHostCallConfirmCard",
|
|
171
172
|
props: {
|
|
172
173
|
question: {},
|
|
@@ -177,21 +178,21 @@ var qe = (e) => e.state, Je = (e) => e.type.startsWith("tool-") ? e.type.slice(5
|
|
|
177
178
|
setup(e, { emit: t }) {
|
|
178
179
|
let n = e, r = t, i = D(() => n.details?.some((e) => e.before !== void 0) ?? !1);
|
|
179
180
|
return (t, n) => {
|
|
180
|
-
let a =
|
|
181
|
+
let a = Oe, o = d, s = ke;
|
|
181
182
|
return R(), A("div", q, [
|
|
182
183
|
j("p", J, B(e.question), 1),
|
|
183
|
-
e.details?.length && i.value ? (R(), O(
|
|
184
|
+
e.details?.length && i.value ? (R(), O(Te, {
|
|
184
185
|
key: 0,
|
|
185
186
|
changes: e.details,
|
|
186
187
|
class: "mb-xs"
|
|
187
|
-
}, null, 8, ["changes"])) : e.details?.length ? (R(), A("dl",
|
|
188
|
+
}, null, 8, ["changes"])) : e.details?.length ? (R(), A("dl", rt, [(R(!0), A(T, null, Ie(e.details, (e, t) => (R(), A(T, { key: t }, [e.label ? (R(), A("dt", it, B(e.label), 1)) : k("", !0), j("dd", { class: I(["text-word-1 m-0 truncate", { "pk-host-call-confirm-card__alone": !e.label }]) }, B(e.value), 3)], 64))), 128))])) : e.unchanged?.length ? (R(), A("p", at, B(t.$t("toolApproval.noChanges")), 1)) : k("", !0),
|
|
188
189
|
e.unchanged?.length ? (R(), O(a, {
|
|
189
190
|
key: 3,
|
|
190
191
|
title: t.$t("toolApproval.unchangedFields", e.unchanged.length),
|
|
191
192
|
modifiers: "compact",
|
|
192
193
|
class: "mb-xs"
|
|
193
194
|
}, {
|
|
194
|
-
default: U(() => [j("dl",
|
|
195
|
+
default: U(() => [j("dl", ot, [(R(!0), A(T, null, Ie(e.unchanged, (e, t) => (R(), A(T, { key: t }, [j("dt", st, B(e.label), 1), j("dd", ct, B(e.value), 1)], 64))), 128))])]),
|
|
195
196
|
_: 1
|
|
196
197
|
}, 8, ["title"])) : k("", !0),
|
|
197
198
|
M(s, null, {
|
|
@@ -211,8 +212,8 @@ var qe = (e) => e.state, Je = (e) => e.type.startsWith("tool-") ? e.type.slice(5
|
|
|
211
212
|
]);
|
|
212
213
|
};
|
|
213
214
|
}
|
|
214
|
-
}),
|
|
215
|
-
function
|
|
215
|
+
}), ut = 30, Y = 500;
|
|
216
|
+
function dt(e) {
|
|
216
217
|
let { scrollEl: t, status: n, messagesLength: r, lastMessageRole: i, contentEl: a, beforeNewMessageScroll: o, onScrollUp: s, onScrollDown: c } = e, l = z(!1), u = z(!0), d = !1, f = null, p = null, m = null, h = null, g = 0, _ = (e = "smooth") => {
|
|
217
218
|
!t.value || l.value ? d = !1 : (d = !0, t.value.scrollTo({
|
|
218
219
|
top: t.value.scrollHeight,
|
|
@@ -220,25 +221,25 @@ function ut(e) {
|
|
|
220
221
|
}), setTimeout(() => {
|
|
221
222
|
d = !1;
|
|
222
223
|
}, e === "instant" ? 0 : Y));
|
|
223
|
-
}, v = (e) => {
|
|
224
|
-
e.deltaY < 0 && (l.value = !0);
|
|
225
|
-
}, y = 0, b = (e) => {
|
|
226
|
-
y = e.touches[0]?.clientY ?? 0;
|
|
227
224
|
}, ee = (e) => {
|
|
225
|
+
e.deltaY < 0 && (l.value = !0);
|
|
226
|
+
}, v = 0, y = (e) => {
|
|
227
|
+
v = e.touches[0]?.clientY ?? 0;
|
|
228
|
+
}, b = (e) => {
|
|
228
229
|
let t = e.touches[0]?.clientY ?? 0;
|
|
229
|
-
t >
|
|
230
|
+
t > v && (l.value = !0), v = t;
|
|
230
231
|
}, te = () => {
|
|
231
232
|
if (!t.value) return;
|
|
232
233
|
let { scrollTop: e, scrollHeight: n, clientHeight: r } = t.value;
|
|
233
|
-
u.value = n - r - e <
|
|
234
|
-
},
|
|
234
|
+
u.value = n - r - e < ut, d || (e < g && s?.(), e > g && (u.value && (l.value = !1), c?.())), g = e;
|
|
235
|
+
}, x = () => {
|
|
235
236
|
if (d || l.value || !t.value) return;
|
|
236
237
|
let e = t.value, n = e.scrollHeight - e.clientHeight;
|
|
237
238
|
n <= e.scrollTop || (u.value = !0, d = !0, e.scrollTop = n, requestAnimationFrame(() => {
|
|
238
239
|
d = !1;
|
|
239
240
|
}));
|
|
240
|
-
},
|
|
241
|
-
!f && t.value && (f = new MutationObserver(
|
|
241
|
+
}, ne = () => {
|
|
242
|
+
!f && t.value && (f = new MutationObserver(x), f.observe(t.value, {
|
|
242
243
|
childList: !0,
|
|
243
244
|
subtree: !0,
|
|
244
245
|
characterData: !0
|
|
@@ -247,10 +248,10 @@ function ut(e) {
|
|
|
247
248
|
f?.disconnect(), f = null;
|
|
248
249
|
};
|
|
249
250
|
H(n, (e, t) => {
|
|
250
|
-
e === "streaming" || e === "submitted" ?
|
|
251
|
+
e === "streaming" || e === "submitted" ? ne() : (e !== "ready" || t !== "streaming") && re();
|
|
251
252
|
}), H(r, async () => {
|
|
252
253
|
if (r() && i() !== "assistant") {
|
|
253
|
-
|
|
254
|
+
ae(), l.value = !1, d = !0;
|
|
254
255
|
try {
|
|
255
256
|
await F(), await o?.(), await F();
|
|
256
257
|
} finally {
|
|
@@ -259,22 +260,22 @@ function ut(e) {
|
|
|
259
260
|
}
|
|
260
261
|
});
|
|
261
262
|
let S = null, ie = () => {
|
|
262
|
-
t.value && (t.value.scrollHeight <= t.value.clientHeight || (t.value.scrollTop = t.value.scrollHeight, S && clearTimeout(S), S = setTimeout(
|
|
263
|
-
},
|
|
263
|
+
t.value && (t.value.scrollHeight <= t.value.clientHeight || (t.value.scrollTop = t.value.scrollHeight, S && clearTimeout(S), S = setTimeout(ae, 300)));
|
|
264
|
+
}, ae = () => {
|
|
264
265
|
p?.disconnect(), p = null, m?.disconnect(), m = null, S &&= (clearTimeout(S), null);
|
|
265
266
|
};
|
|
266
|
-
return
|
|
267
|
+
return Fe(() => {
|
|
267
268
|
if (!t.value) return;
|
|
268
|
-
t.value.addEventListener("wheel",
|
|
269
|
+
t.value.addEventListener("wheel", ee, { passive: !0 }), t.value.addEventListener("touchstart", y, { passive: !0 }), t.value.addEventListener("touchmove", b, { passive: !0 });
|
|
269
270
|
let e = n() === "submitted" || n() === "streaming";
|
|
270
|
-
e ?
|
|
271
|
+
e ? ne() : (p = new ResizeObserver(ie), p.observe(t.value), m = new MutationObserver(ie), m.observe(t.value, {
|
|
271
272
|
childList: !0,
|
|
272
273
|
subtree: !0
|
|
273
274
|
}));
|
|
274
275
|
let r = a?.() ?? t.value.firstElementChild;
|
|
275
|
-
r && (h = new ResizeObserver(
|
|
276
|
+
r && (h = new ResizeObserver(x), h.observe(r)), e || ie();
|
|
276
277
|
}), L(() => {
|
|
277
|
-
t.value?.removeEventListener("wheel",
|
|
278
|
+
t.value?.removeEventListener("wheel", ee), t.value?.removeEventListener("touchstart", y), t.value?.removeEventListener("touchmove", b), h?.disconnect(), h = null, re(), ae();
|
|
278
279
|
}), {
|
|
279
280
|
handleScroll: te,
|
|
280
281
|
scrollToBottom: _,
|
|
@@ -283,8 +284,8 @@ function ut(e) {
|
|
|
283
284
|
};
|
|
284
285
|
}
|
|
285
286
|
// ../../packages/components/src/chat/wakeupFeed.ts
|
|
286
|
-
function
|
|
287
|
-
let n = (e) =>
|
|
287
|
+
function ft(e, t = () => !1) {
|
|
288
|
+
let n = (e) => Xe(e) && !t(e), r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Map(), a = 0;
|
|
288
289
|
for (; a < e.length;) {
|
|
289
290
|
let t = e[a];
|
|
290
291
|
if (G(t) && n(e[a + 1])) {
|
|
@@ -302,46 +303,46 @@ function dt(e, t = () => !1) {
|
|
|
302
303
|
};
|
|
303
304
|
}
|
|
304
305
|
// ../../packages/components/src/chat/PkChatbotMessages.vue?vue&type=script&setup=true&lang.ts
|
|
305
|
-
var
|
|
306
|
+
var pt = ["aria-busy"], mt = {
|
|
306
307
|
key: 0,
|
|
307
308
|
class: "pk-chatbot-messages__outline"
|
|
308
|
-
},
|
|
309
|
+
}, ht = {
|
|
309
310
|
key: 0,
|
|
310
311
|
class: "pk-chatbot-divider vv-separator"
|
|
311
|
-
},
|
|
312
|
+
}, gt = { class: "pk-chatbot-divider__label" }, _t = {
|
|
312
313
|
key: 1,
|
|
313
314
|
class: "pk-chatbot-wakeup"
|
|
314
|
-
},
|
|
315
|
+
}, vt = ["title"], yt = { class: "pk-chatbot-message__text" }, bt = ["title"], xt = {
|
|
315
316
|
key: 0,
|
|
316
317
|
class: "pk-chatbot-message__reaction-emoji"
|
|
317
|
-
},
|
|
318
|
+
}, St = {
|
|
318
319
|
key: 0,
|
|
319
320
|
class: "flex flex-col items-end gap-8 w-full"
|
|
320
|
-
},
|
|
321
|
+
}, Ct = { class: "pk-chatbot-message__host-step" }, wt = { class: "pk-chatbot-message__host-call" }, Tt = { class: "pk-chatbot-message__host-call-label" }, Et = {
|
|
321
322
|
key: 0,
|
|
322
323
|
class: "pk-chatbot-message__host-call-outcome"
|
|
323
|
-
},
|
|
324
|
+
}, Dt = {
|
|
324
325
|
key: 0,
|
|
325
326
|
class: "pk-chatbot-message__loading-info"
|
|
326
|
-
},
|
|
327
|
+
}, Ot = { class: "flex gap-8 items-center" }, kt = { class: "text-12" }, At = ["title"], jt = { class: "pk-chatbot-message__pointer-label" }, Mt = { class: "flex gap-8 items-center" }, Nt = {
|
|
327
328
|
key: 0,
|
|
328
329
|
class: "pk-chatbot-message__footer"
|
|
329
|
-
},
|
|
330
|
+
}, Pt = {
|
|
330
331
|
key: 0,
|
|
331
332
|
class: "pk-chatbot-message__hover-meta"
|
|
332
|
-
},
|
|
333
|
+
}, Ft = ["datetime", "title"], It = { class: "truncate" }, Lt = {
|
|
333
334
|
key: 0,
|
|
334
335
|
class: "flex items-center gap-4 min-w-0"
|
|
335
|
-
},
|
|
336
|
+
}, Rt = { class: "truncate" }, zt = ["title"], Bt = {
|
|
336
337
|
key: 2,
|
|
337
338
|
class: "flex items-center gap-4 text-12 text-word-3"
|
|
338
|
-
},
|
|
339
|
+
}, Vt = { class: "truncate" }, Ht = ["datetime"], Ut = { class: "truncate" }, Wt = {
|
|
339
340
|
key: 4,
|
|
340
341
|
class: "flex items-center gap-4 text-12 text-word-3"
|
|
341
|
-
},
|
|
342
|
+
}, Gt = { class: "pk-chatbot-message__loading-info" }, Kt = { class: "flex gap-8 items-center" }, qt = { class: "text-12" }, Jt = {
|
|
342
343
|
key: 0,
|
|
343
344
|
class: "pk-chatbot-message pk-chatbot-message--assistant"
|
|
344
|
-
},
|
|
345
|
+
}, Yt = ["title", "aria-label"], Xt = /* @__PURE__ */ P({
|
|
345
346
|
__name: "PkChatbotMessages",
|
|
346
347
|
props: {
|
|
347
348
|
status: {},
|
|
@@ -391,11 +392,11 @@ var ft = ["aria-busy"], pt = {
|
|
|
391
392
|
"host-confirm-respond"
|
|
392
393
|
],
|
|
393
394
|
setup(e, { emit: t }) {
|
|
394
|
-
let n = e, r = t, { t: i, te: o, d: s, n: c } =
|
|
395
|
+
let n = e, r = t, { t: i, te: o, d: s, n: c } = He({ useScope: "global" }), l = Me(pe, void 0), u = Me(fe, void 0), w = (e) => {
|
|
395
396
|
let t = e.toolCallId;
|
|
396
397
|
return typeof t == "string" ? u?.value[t]?.details : void 0;
|
|
397
|
-
},
|
|
398
|
-
if (
|
|
398
|
+
}, ve = Be(), N = (e, t) => {
|
|
399
|
+
if (de(e)) {
|
|
399
400
|
let n = e.toolCallId;
|
|
400
401
|
n && r("confirm-respond", {
|
|
401
402
|
toolCallId: n,
|
|
@@ -403,169 +404,171 @@ var ft = ["aria-busy"], pt = {
|
|
|
403
404
|
});
|
|
404
405
|
return;
|
|
405
406
|
}
|
|
406
|
-
let n =
|
|
407
|
+
let n = ge(e);
|
|
407
408
|
n && r("approval-respond", {
|
|
408
409
|
id: n,
|
|
409
410
|
approved: t
|
|
410
411
|
});
|
|
411
|
-
}, P =
|
|
412
|
+
}, P = Ve("scrollEl"), L = Ve("wrapperEl"), We = D(() => re(n.textColor, n.mainColor));
|
|
413
|
+
f(L);
|
|
414
|
+
let { handleScroll: Ge, scrollToBottom: Ke, userScrolledUp: qe, isAtBottom: Je } = dt({
|
|
412
415
|
scrollEl: P,
|
|
413
416
|
status: () => n.status,
|
|
414
417
|
messagesLength: () => n.messages?.length,
|
|
415
418
|
lastMessageRole: () => n.messages?.[n.messages.length - 1]?.role,
|
|
416
419
|
contentEl: () => L.value,
|
|
417
|
-
beforeNewMessageScroll: () =>
|
|
420
|
+
beforeNewMessageScroll: () => ct(),
|
|
418
421
|
onScrollUp: () => r("scroll-up"),
|
|
419
422
|
onScrollDown: () => r("scroll-down")
|
|
420
|
-
}),
|
|
421
|
-
|
|
423
|
+
}), Ye = () => {
|
|
424
|
+
qe.value = !1, Ke();
|
|
422
425
|
}, K = D(() => (n.messages ?? []).filter((e) => e.role === "user" && !G(e)).map((e) => ({
|
|
423
426
|
id: e.id,
|
|
424
|
-
preview: e.parts.find(
|
|
425
|
-
}))),
|
|
427
|
+
preview: e.parts.find(g)?.text.trim().slice(0, 120) || "…"
|
|
428
|
+
}))), Xe = z(), Qe = () => P.value?.querySelectorAll(".pk-chatbot-message--user") ?? [], $e = () => {
|
|
426
429
|
let e = P.value;
|
|
427
430
|
if (!e || !n.showScrollToBottom) return;
|
|
428
431
|
let t = e.getBoundingClientRect().top + e.clientHeight / 2, r = K.value[0]?.id;
|
|
429
|
-
|
|
432
|
+
Qe().forEach((e, n) => {
|
|
430
433
|
e.getBoundingClientRect().top <= t && (r = K.value[n]?.id);
|
|
431
|
-
}),
|
|
434
|
+
}), Xe.value = r;
|
|
432
435
|
};
|
|
433
436
|
H(K, async () => {
|
|
434
|
-
await F(),
|
|
437
|
+
await F(), $e();
|
|
435
438
|
});
|
|
436
|
-
let
|
|
437
|
-
|
|
438
|
-
},
|
|
439
|
-
let t = P.value, n = K.value.findIndex((t) => t.id === e), r =
|
|
440
|
-
t && r && (
|
|
439
|
+
let et = () => {
|
|
440
|
+
Ge(), $e();
|
|
441
|
+
}, tt = (e) => {
|
|
442
|
+
let t = P.value, n = K.value.findIndex((t) => t.id === e), r = Qe()[n];
|
|
443
|
+
t && r && (qe.value = !0, t.scrollTo({
|
|
441
444
|
top: t.scrollTop + r.getBoundingClientRect().top - t.getBoundingClientRect().top - Number.parseFloat(getComputedStyle(t).paddingTop),
|
|
442
445
|
behavior: "smooth"
|
|
443
446
|
}));
|
|
444
|
-
}, q = D(() => n.status === "submitted" || n.status === "streaming" || n.hostWorking === !0), J = z(0),
|
|
445
|
-
|
|
446
|
-
},
|
|
447
|
+
}, q = D(() => n.status === "submitted" || n.status === "streaming" || n.hostWorking === !0), J = z(0), rt = z(!1), it = !1, at = ze(), ot = () => n.messages?.[n.messages.length - 1]?.role === "user" || q.value, st = () => {
|
|
448
|
+
it = !1, rt.value = !0, J.value = 0;
|
|
449
|
+
}, ct = async () => {
|
|
447
450
|
if (!n.messages?.length || n.disableHeightAdjustment) return;
|
|
448
|
-
if (!
|
|
449
|
-
|
|
451
|
+
if (!ot()) {
|
|
452
|
+
it && (await F(), P.value?.scrollHeight, ot() || st());
|
|
450
453
|
return;
|
|
451
454
|
}
|
|
452
|
-
if (
|
|
453
|
-
let { paddingTop: e, paddingBottom: t } = getComputedStyle(P.value), r = P.value.clientHeight - Number.parseFloat(e) - Number.parseFloat(t), i = L.value && Number.parseFloat(getComputedStyle(L.value).rowGap) || 0, a =
|
|
454
|
-
|
|
455
|
-
let o = r - (
|
|
455
|
+
if (it = !0, rt.value = !1, await F(), !P.value) return;
|
|
456
|
+
let { paddingTop: e, paddingBottom: t } = getComputedStyle(P.value), r = P.value.clientHeight - Number.parseFloat(e) - Number.parseFloat(t), i = L.value && Number.parseFloat(getComputedStyle(L.value).rowGap) || 0, a = Qe();
|
|
457
|
+
at.value = a[a.length - 1];
|
|
458
|
+
let o = r - (at.value?.clientHeight ?? 0) - i;
|
|
456
459
|
r > 0 && (J.value = Math.max(o, 0)), await F();
|
|
457
460
|
};
|
|
458
|
-
H([() => n.messages?.length, () => n.messages?.[n.messages.length - 1]?.id], () =>
|
|
459
|
-
|
|
460
|
-
}),
|
|
461
|
-
(q.value || n.awaitingSpokenAnswer) &&
|
|
461
|
+
H([() => n.messages?.length, () => n.messages?.[n.messages.length - 1]?.id], () => ct()), Ue([P, at], () => {
|
|
462
|
+
it && ct();
|
|
463
|
+
}), Fe(() => {
|
|
464
|
+
(q.value || n.awaitingSpokenAnswer) && ct();
|
|
462
465
|
}), H(q, (e) => {
|
|
463
|
-
e ||
|
|
466
|
+
e || st();
|
|
464
467
|
});
|
|
465
|
-
let
|
|
468
|
+
let ut = (e) => n.revisedAnswers?.some((t) => t.messageId === e), Y = (e) => n.messageFeedbacks?.find((t) => t.messageId === e), Xt = /* @__PURE__ */ new Set([
|
|
466
469
|
"showContactForm",
|
|
467
470
|
"showForm",
|
|
468
471
|
"showMultipleChoice",
|
|
469
472
|
"showSuggestedReply"
|
|
470
|
-
]),
|
|
471
|
-
let t =
|
|
473
|
+
]), Zt = /* @__PURE__ */ new Set(["showDiagram", "showLocation"]), Qt = (e) => {
|
|
474
|
+
let t = h(e);
|
|
472
475
|
return {
|
|
473
|
-
...!n.interactive &&
|
|
474
|
-
...
|
|
476
|
+
...!n.interactive && Xt.has(t) ? { record: !0 } : {},
|
|
477
|
+
...Zt.has(t) ? { isDark: n.isDark } : {}
|
|
475
478
|
};
|
|
476
|
-
},
|
|
477
|
-
let t =
|
|
479
|
+
}, $t = (e, t) => !n.readonlyFeedback && yn(e, t), en = (e) => n.readonlyFeedback ? Y(e) : void 0, tn = (e) => en(e)?.vote, nn = (e) => {
|
|
480
|
+
let t = en(e);
|
|
478
481
|
if (t?.vote) return;
|
|
479
482
|
let n = t?.metadata?.reactionEmoji;
|
|
480
483
|
return typeof n == "string" && /\p{Extended_Pictographic}/u.test(n) ? n : void 0;
|
|
481
|
-
},
|
|
482
|
-
if (
|
|
483
|
-
let t =
|
|
484
|
+
}, rn = (e) => !!(tn(e) || nn(e)), an = (e) => {
|
|
485
|
+
if (nn(e)) return "pk-chatbot-message__reaction--neutral";
|
|
486
|
+
let t = tn(e);
|
|
484
487
|
return t === "upvote" ? "pk-chatbot-message__reaction--positive" : t === "downvote" ? "pk-chatbot-message__reaction--negative" : "pk-chatbot-message__reaction--neutral";
|
|
485
|
-
}, an = (e) => {
|
|
486
|
-
let t = en(e);
|
|
487
|
-
return i(t === "upvote" ? "hint.userFeedbackPositive" : t === "downvote" ? "hint.userFeedbackNegative" : "hint.userFeedbackReaction");
|
|
488
488
|
}, on = (e) => {
|
|
489
|
-
let t =
|
|
490
|
-
|
|
489
|
+
let t = tn(e);
|
|
490
|
+
return i(t === "upvote" ? "hint.userFeedbackPositive" : t === "downvote" ? "hint.userFeedbackNegative" : "hint.userFeedbackReaction");
|
|
491
|
+
}, sn = (e) => {
|
|
492
|
+
let t = un(e);
|
|
493
|
+
for (let e = t.length - 1; e >= 0; --e) if (g(t[e])) return e;
|
|
491
494
|
return -1;
|
|
492
|
-
},
|
|
493
|
-
let e =
|
|
495
|
+
}, cn = D(() => n.messages?.[n.messages.length - 1]), X = D(() => {
|
|
496
|
+
let e = cn.value;
|
|
494
497
|
return e ? e.parts[e.parts.length - 1] : null;
|
|
495
|
-
}),
|
|
498
|
+
}), ln = D(() => {
|
|
496
499
|
let e = /* @__PURE__ */ new Map();
|
|
497
|
-
for (let t of n.messages ?? []) t.role === "assistant" && e.set(t.id,
|
|
500
|
+
for (let t of n.messages ?? []) t.role === "assistant" && e.set(t.id, ae(me(S(t.parts))));
|
|
498
501
|
return e;
|
|
499
|
-
}),
|
|
502
|
+
}), un = (e) => ln.value.get(e.id) ?? e.parts, dn = D(() => n.status === "error"), fn = D(() => n.awaitingSpokenAnswer === !0 && !q.value), pn = D(() => fn.value && cn.value?.role === "user" && !dn.value), mn = (e, t) => t(), hn = D(() => {
|
|
500
503
|
let e = X.value;
|
|
501
|
-
return
|
|
502
|
-
}),
|
|
504
|
+
return oe(i, e, l?.value);
|
|
505
|
+
}), gn = D(() => {
|
|
503
506
|
let e = X.value;
|
|
504
|
-
return
|
|
505
|
-
}),
|
|
507
|
+
return he(e);
|
|
508
|
+
}), _n = (e) => n.messages?.findIndex((t) => t.id === e), Z = (e) => e === void 0 || !n.messages ? !1 : e === n.messages.length - 1, vn = (e) => Z(e) && n.status === "ready" && !n.hostWorking && !!n.actions?.includes("regenerate"), yn = (e, t) => (!Z(t) || n.status === "ready" && !n.hostWorking) && !!n.actions?.includes(e), bn = (e) => {
|
|
506
509
|
let t = e.parts[e.parts.length - 1];
|
|
507
|
-
return
|
|
508
|
-
},
|
|
509
|
-
if (!
|
|
510
|
-
let i =
|
|
511
|
-
return i && r ===
|
|
512
|
-
},
|
|
513
|
-
let n =
|
|
514
|
-
return n?.state === "output-error" ? i(n.errorText === "The user refused this call. Do not repeat it unless the user asks." ? "toolApproval.denied" : "messagePart.hostToolFailed") : n?.state === "input-available" && !
|
|
515
|
-
},
|
|
516
|
-
let t =
|
|
510
|
+
return g(t);
|
|
511
|
+
}, xn = (e) => e.parts.some((e) => m(e) || b(e) || !!C(e)), Sn = (e) => !!n.showExtendedSteps && Q(e) && xn(e), Cn = (e) => n.hostConfirmation !== void 0 && C(e) !== void 0 && e.toolCallId === n.hostConfirmation.toolCallId, wn = D(() => n.hostConfirmation !== void 0 && !n.messages?.some((e) => e.parts.some(Cn))), Tn = (e, t) => q.value && Z(e) && C(t)?.state === "input-available", En = (e, t, n, r) => {
|
|
512
|
+
if (!C(n) || Sn(e)) return !1;
|
|
513
|
+
let i = Tn(t, n);
|
|
514
|
+
return i && r === un(e).length - 1 ? !1 : i || ie(n) || !ee(e);
|
|
515
|
+
}, Dn = (e, t) => {
|
|
516
|
+
let n = C(t);
|
|
517
|
+
return n?.state === "output-error" ? i(n.errorText === "The user refused this call. Do not repeat it unless the user asks." ? "toolApproval.denied" : "messagePart.hostToolFailed") : n?.state === "input-available" && !Tn(e, t) ? i("messagePart.hostToolNoAnswer") : void 0;
|
|
518
|
+
}, On = (e) => b(e) && !x(e) && !!(Ze[h(e)] || ve[e.type] || n.showAllMessageParts), kn = (e) => e.parts.some((e) => g(e) && !!e.text.trim() || v(e) || ne(e) && !x(e) || On(e)), Q = (e) => e.role === "assistant", An = (e) => e.role === "user", jn = (e) => n.messages?.slice(0, e).reverse().find((e) => Q(e)), Mn = (e) => n.messages?.slice(e + 1).find((e) => Q(e)), Nn = (e) => {
|
|
519
|
+
let t = jn(e)?.metadata?.createdAt, n = Mn(e)?.metadata?.createdAt;
|
|
517
520
|
if (!t || !n) return;
|
|
518
521
|
let r = new Date(t), i = new Date(n);
|
|
519
522
|
return r.toDateString() === i.toDateString() ? void 0 : i;
|
|
520
|
-
}, $ = D(() => n.showAllMessageParts ?
|
|
523
|
+
}, $ = D(() => n.showAllMessageParts ? ft([]) : ft(n.messages ?? [], kn)), Pn = D(() => {
|
|
521
524
|
let e = 0;
|
|
522
525
|
return (n.messages ?? []).map((t) => t.parts.length > 0 ? ++e : void 0);
|
|
523
|
-
}),
|
|
526
|
+
}), Fn = (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), In = (e) => {
|
|
524
527
|
let t = new Date(e), n = t.toDateString() === (/* @__PURE__ */ new Date()).toDateString();
|
|
525
528
|
return s(t, n ? "time" : "date-time");
|
|
526
|
-
},
|
|
529
|
+
}, Ln = (e) => {
|
|
527
530
|
let { createdAt: t, completedAt: n } = e.metadata ?? {};
|
|
528
|
-
if (t && n) return
|
|
529
|
-
},
|
|
531
|
+
if (t && n) return le(c, n - t);
|
|
532
|
+
}, Rn = Ve("feedbackMessageEl");
|
|
530
533
|
return H(() => n.feedbackMessageId, async () => {
|
|
531
534
|
if (await F(), !n.feedbackMessageId) return;
|
|
532
|
-
let e =
|
|
533
|
-
e && (Z(
|
|
535
|
+
let e = Rn.value?.[0]?.$el;
|
|
536
|
+
e && (Z(_n(n.feedbackMessageId)) ? Ke() : e.scrollIntoView({
|
|
534
537
|
behavior: "smooth",
|
|
535
538
|
block: "center"
|
|
536
539
|
}));
|
|
537
540
|
}), (t, n) => {
|
|
538
|
-
let u =
|
|
541
|
+
let u = Ae, f = Oe, m = d, ee = ke;
|
|
539
542
|
return R(), A("div", {
|
|
540
543
|
ref_key: "scrollEl",
|
|
541
544
|
ref: P,
|
|
542
545
|
class: I(["pk-chatbot-messages scrollbar-thin", {
|
|
543
|
-
"pk-chatbot-messages--settling":
|
|
546
|
+
"pk-chatbot-messages--settling": rt.value,
|
|
544
547
|
"pk-chatbot-messages--parent-scrolls": e.parentScrolls
|
|
545
548
|
}]),
|
|
546
549
|
role: "log",
|
|
547
550
|
"aria-live": "polite",
|
|
548
551
|
"aria-relevant": "additions text",
|
|
549
552
|
"aria-busy": q.value,
|
|
550
|
-
style:
|
|
553
|
+
style: Pe({
|
|
551
554
|
"--chatbot-main-color": e.mainColor,
|
|
552
|
-
"--chatbot-contrast-color":
|
|
555
|
+
"--chatbot-contrast-color": We.value
|
|
553
556
|
}),
|
|
554
|
-
onScroll:
|
|
557
|
+
onScroll: et
|
|
555
558
|
}, [
|
|
556
|
-
e.showScrollToBottom && K.value.length > 1 ? (R(), A("div",
|
|
559
|
+
e.showScrollToBottom && K.value.length > 1 ? (R(), A("div", mt, [M(De, {
|
|
557
560
|
items: K.value,
|
|
558
|
-
"active-id":
|
|
559
|
-
onSelect:
|
|
561
|
+
"active-id": Xe.value,
|
|
562
|
+
onSelect: tt
|
|
560
563
|
}, null, 8, ["items", "active-id"])])) : k("", !0),
|
|
561
564
|
j("div", {
|
|
562
565
|
ref_key: "wrapperEl",
|
|
563
566
|
ref: L,
|
|
564
567
|
class: "pk-chatbot-messages__wrapper"
|
|
565
568
|
}, [
|
|
566
|
-
(R(!0), A(T, null,
|
|
567
|
-
|
|
568
|
-
$.value.quietRuns.has(d.id) ? (R(), A("div",
|
|
569
|
+
(R(!0), A(T, null, Ie(e.messages, (d, b) => (R(), A(T, { key: d.id }, [
|
|
570
|
+
An(d) && Nn(b) ? (R(), A("div", ht, [j("span", gt, B(V(s)(Nn(b), "short")), 1)])) : k("", !0),
|
|
571
|
+
$.value.quietRuns.has(d.id) ? (R(), A("div", _t, [M(u, {
|
|
569
572
|
name: "ri:alarm-line",
|
|
570
573
|
class: "shrink-0"
|
|
571
574
|
}), j("span", null, B(V(i)("label.wakeupQuietRun", {
|
|
@@ -578,21 +581,21 @@ var ft = ["aria-busy"], pt = {
|
|
|
578
581
|
}, [M(u, {
|
|
579
582
|
name: "ri:alarm-line",
|
|
580
583
|
class: "shrink-0"
|
|
581
|
-
}), j("span", null, [
|
|
582
|
-
(!V(G)(d) || e.showAllMessageParts) && (!$.value.hidden.has(d.id) || q.value && Z(
|
|
584
|
+
}), j("span", null, [je(B(V(i)("label.wakeupCheck")) + " ", 1), d.metadata?.createdAt ? (R(), A(T, { key: 0 }, [je(" · " + B(V(s)(d.metadata.createdAt, "time")), 1)], 64)) : k("", !0)])], 8, vt)) : k("", !0),
|
|
585
|
+
(!V(G)(d) || e.showAllMessageParts) && (!$.value.hidden.has(d.id) || q.value && Z(b)) && (d.parts.length || Z(b) && q.value && Q(d)) ? (R(), A("div", {
|
|
583
586
|
key: 3,
|
|
584
|
-
class: I(["pk-chatbot-message", [`pk-chatbot-message--${d.role}`, { "pk-chatbot-message--loading": q.value && Z(
|
|
585
|
-
style:
|
|
587
|
+
class: I(["pk-chatbot-message", [`pk-chatbot-message--${d.role}`, { "pk-chatbot-message--loading": q.value && Z(b) && Q(d) }]]),
|
|
588
|
+
style: Pe({ minHeight: Z(b) && Q(d) && !dn.value ? `${J.value}px` : void 0 })
|
|
586
589
|
}, [
|
|
587
590
|
M(E, {
|
|
588
591
|
appear: "",
|
|
589
592
|
name: "pk-chatbot-part"
|
|
590
593
|
}, {
|
|
591
|
-
default: U(() => [
|
|
594
|
+
default: U(() => [Sn(d) ? (R(), O(Ee, {
|
|
592
595
|
key: 0,
|
|
593
596
|
message: d,
|
|
594
|
-
"is-streaming": q.value && Z(
|
|
595
|
-
"has-content":
|
|
597
|
+
"is-streaming": q.value && Z(b),
|
|
598
|
+
"has-content": kn(d),
|
|
596
599
|
"hide-reasoning": e.hideReasoning,
|
|
597
600
|
"is-dark": e.isDark
|
|
598
601
|
}, null, 8, [
|
|
@@ -604,41 +607,41 @@ var ft = ["aria-busy"], pt = {
|
|
|
604
607
|
])) : k("", !0)]),
|
|
605
608
|
_: 2
|
|
606
609
|
}, 1024),
|
|
607
|
-
(R(!0), A(T, null,
|
|
610
|
+
(R(!0), A(T, null, Ie(un(d), (s, c) => (R(), A(T, { key: V(ce)(s, c) }, [V(g)(s) && s.text.trim() ? (R(), O(E, {
|
|
608
611
|
key: 0,
|
|
609
612
|
appear: "",
|
|
610
613
|
name: "pk-chatbot-part"
|
|
611
614
|
}, {
|
|
612
|
-
default: U(() => [j("div",
|
|
615
|
+
default: U(() => [j("div", yt, [Le(t.$slots, "text", Ne({ ref_for: !0 }, {
|
|
613
616
|
message: d,
|
|
614
617
|
part: s,
|
|
615
|
-
index:
|
|
618
|
+
index: b,
|
|
616
619
|
isLoading: q.value
|
|
617
|
-
}), () => [Q(d) ? (R(), O(
|
|
620
|
+
}), () => [Q(d) ? (R(), O(p, {
|
|
618
621
|
key: 0,
|
|
619
622
|
class: "wysiwyg",
|
|
620
623
|
markdown: s.text,
|
|
621
624
|
"is-dark": e.isDark,
|
|
622
|
-
loading: Z(
|
|
625
|
+
loading: Z(b) && e.status === "streaming"
|
|
623
626
|
}, null, 8, [
|
|
624
627
|
"markdown",
|
|
625
628
|
"is-dark",
|
|
626
629
|
"loading"
|
|
627
|
-
])) : (R(), A(T, { key: 1 }, [
|
|
630
|
+
])) : (R(), A(T, { key: 1 }, [je(B(s.text), 1)], 64))]), rn(d.id) && !Y(d.id)?.comment && c === sn(d) ? (R(), A("span", {
|
|
628
631
|
key: 0,
|
|
629
|
-
class: I(["pk-chatbot-message__reaction",
|
|
630
|
-
title:
|
|
631
|
-
}, [
|
|
632
|
+
class: I(["pk-chatbot-message__reaction", an(d.id)]),
|
|
633
|
+
title: on(d.id)
|
|
634
|
+
}, [nn(d.id) ? (R(), A("span", xt, B(nn(d.id)), 1)) : (R(), O(u, {
|
|
632
635
|
key: 1,
|
|
633
|
-
name:
|
|
634
|
-
}, null, 8, ["name"]))], 10,
|
|
636
|
+
name: tn(d.id) === "downvote" ? "ri:thumb-down-fill" : "ri:thumb-up-fill"
|
|
637
|
+
}, null, 8, ["name"]))], 10, bt)) : k("", !0)])]),
|
|
635
638
|
_: 2
|
|
636
639
|
}, 1024)) : V(v)(s) ? (R(), O(E, {
|
|
637
640
|
key: 1,
|
|
638
641
|
appear: "",
|
|
639
642
|
name: "pk-chatbot-part"
|
|
640
643
|
}, {
|
|
641
|
-
default: U(() => [V(a)(s.filename, s.mediaType) ? (R(), A("div",
|
|
644
|
+
default: U(() => [V(a)(s.filename, s.mediaType) ? (R(), A("div", St, [M(Ce, {
|
|
642
645
|
"media-type": s.mediaType,
|
|
643
646
|
url: s.url,
|
|
644
647
|
filename: s.filename,
|
|
@@ -648,15 +651,15 @@ var ft = ["aria-busy"], pt = {
|
|
|
648
651
|
"url",
|
|
649
652
|
"filename",
|
|
650
653
|
"size"
|
|
651
|
-
]), M(
|
|
654
|
+
]), M(te, {
|
|
652
655
|
url: s.url,
|
|
653
|
-
transcript: V(
|
|
654
|
-
pending: e.status === "submitted" && Z(
|
|
656
|
+
transcript: V(_)(s),
|
|
657
|
+
pending: e.status === "submitted" && Z(b)
|
|
655
658
|
}, null, 8, [
|
|
656
659
|
"url",
|
|
657
660
|
"transcript",
|
|
658
661
|
"pending"
|
|
659
|
-
])])) : (R(), O(
|
|
662
|
+
])])) : (R(), O(Ce, {
|
|
660
663
|
key: 1,
|
|
661
664
|
"media-type": s.mediaType,
|
|
662
665
|
url: s.url,
|
|
@@ -669,15 +672,15 @@ var ft = ["aria-busy"], pt = {
|
|
|
669
672
|
"size"
|
|
670
673
|
]))]),
|
|
671
674
|
_: 2
|
|
672
|
-
}, 1024)) : V(ne)(s) && !V(
|
|
675
|
+
}, 1024)) : V(ne)(s) && !V(x)(s) ? (R(), O(E, {
|
|
673
676
|
key: 2,
|
|
674
677
|
appear: "",
|
|
675
678
|
name: "pk-chatbot-part"
|
|
676
679
|
}, {
|
|
677
|
-
default: U(() => [(R(), O(
|
|
680
|
+
default: U(() => [(R(), O(nt, {
|
|
678
681
|
key: `approval-${c}`,
|
|
679
682
|
part: s,
|
|
680
|
-
actionable: e.interactive === !0 && (V(
|
|
683
|
+
actionable: e.interactive === !0 && (V(de)(s) || Z(b)),
|
|
681
684
|
"call-verdict": e.confirmVerdictsOnCall?.get(s.toolCallId ?? ""),
|
|
682
685
|
onRespond: (e) => N(s, e)
|
|
683
686
|
}, null, 8, [
|
|
@@ -687,13 +690,13 @@ var ft = ["aria-busy"], pt = {
|
|
|
687
690
|
"onRespond"
|
|
688
691
|
]))]),
|
|
689
692
|
_: 2
|
|
690
|
-
}, 1024)) :
|
|
693
|
+
}, 1024)) : Cn(s) ? (R(), O(E, {
|
|
691
694
|
key: 3,
|
|
692
695
|
appear: "",
|
|
693
696
|
name: "pk-chatbot-part"
|
|
694
697
|
}, {
|
|
695
|
-
default: U(() => [M(
|
|
696
|
-
question: e.hostConfirmation?.question ?? V(i)("toolApproval.hostCall", { name: V(
|
|
698
|
+
default: U(() => [M(lt, {
|
|
699
|
+
question: e.hostConfirmation?.question ?? V(i)("toolApproval.hostCall", { name: V(oe)(V(i), s) }),
|
|
697
700
|
details: e.hostConfirmation?.details,
|
|
698
701
|
unchanged: e.hostConfirmation?.unchanged,
|
|
699
702
|
onRespond: n[0] ||= (e) => r("host-confirm-respond", e)
|
|
@@ -703,101 +706,101 @@ var ft = ["aria-busy"], pt = {
|
|
|
703
706
|
"unchanged"
|
|
704
707
|
])]),
|
|
705
708
|
_: 2
|
|
706
|
-
}, 1024)) :
|
|
709
|
+
}, 1024)) : En(d, b, s, c) ? (R(), O(E, {
|
|
707
710
|
key: 4,
|
|
708
711
|
appear: "",
|
|
709
712
|
name: "pk-chatbot-part"
|
|
710
713
|
}, {
|
|
711
|
-
default: U(() => [j("div",
|
|
714
|
+
default: U(() => [j("div", Ct, [j("div", wt, [
|
|
712
715
|
M(u, {
|
|
713
|
-
name:
|
|
716
|
+
name: Tn(b, s) ? "loading-loop" : V(he)(s) ?? "ri:apps-line",
|
|
714
717
|
class: "shrink-0"
|
|
715
718
|
}, null, 8, ["name"]),
|
|
716
|
-
j("span",
|
|
717
|
-
|
|
718
|
-
]),
|
|
719
|
+
j("span", Tt, B(V(oe)(V(i), s, V(l))), 1),
|
|
720
|
+
Dn(b, s) ? (R(), A("span", Et, " · " + B(Dn(b, s)), 1)) : k("", !0)
|
|
721
|
+
]), w(s)?.length ? (R(), O(f, {
|
|
719
722
|
key: 0,
|
|
720
|
-
title: V(i)("toolApproval.changesCount",
|
|
723
|
+
title: V(i)("toolApproval.changesCount", w(s).length),
|
|
721
724
|
modifiers: "compact",
|
|
722
725
|
class: "pk-chatbot-message__host-changes"
|
|
723
726
|
}, {
|
|
724
|
-
default: U(() => [M(
|
|
727
|
+
default: U(() => [M(Te, { changes: w(s) }, null, 8, ["changes"])]),
|
|
725
728
|
_: 2
|
|
726
729
|
}, 1032, ["title"])) : k("", !0)])]),
|
|
727
730
|
_: 2
|
|
728
|
-
}, 1024)) :
|
|
731
|
+
}, 1024)) : On(s) ? (R(), O(E, {
|
|
729
732
|
key: 5,
|
|
730
733
|
appear: "",
|
|
731
734
|
name: "pk-chatbot-part"
|
|
732
735
|
}, {
|
|
733
|
-
default: U(() => [!V(
|
|
734
|
-
key: `component-${c}-${V(
|
|
736
|
+
default: U(() => [!V(ve)[s.type] && V(Ze)[V(h)(s)] ? (R(), O(Re(V(Ze)[V(h)(s)]), Ne({
|
|
737
|
+
key: `component-${c}-${V(_e)(s)}`,
|
|
735
738
|
part: s
|
|
736
|
-
}, { ref_for: !0 },
|
|
739
|
+
}, { ref_for: !0 }, Qt(s)), null, 16, ["part"])) : Le(t.$slots, s.type, Ne({ ref_for: !0 }, {
|
|
737
740
|
message: d,
|
|
738
741
|
part: s,
|
|
739
|
-
index:
|
|
742
|
+
index: b,
|
|
740
743
|
isLoading: q.value
|
|
741
|
-
}), () => [e.showAllMessageParts ? (R(), A("div",
|
|
744
|
+
}), () => [e.showAllMessageParts ? (R(), A("div", Dt, [j("div", Ot, [V(he)(s) ? (R(), O(u, {
|
|
742
745
|
key: 0,
|
|
743
|
-
name: V(
|
|
746
|
+
name: V(he)(s),
|
|
744
747
|
class: "shrink-0"
|
|
745
|
-
}, null, 8, ["name"])) : k("", !0), j("span",
|
|
748
|
+
}, null, 8, ["name"])) : k("", !0), j("span", kt, B(V(se)(s, {
|
|
746
749
|
t: V(i),
|
|
747
750
|
te: V(o)
|
|
748
751
|
})), 1)])])) : k("", !0)], void 0, 1)]),
|
|
749
752
|
_: 2
|
|
750
753
|
}, 1024)) : k("", !0), M(E, { mode: "out-in" }, {
|
|
751
|
-
default: U(() => [c ===
|
|
754
|
+
default: U(() => [c === sn(d) && e.readonlyFeedback && Y(d.id)?.comment ? (R(), O(Se, {
|
|
752
755
|
key: 0,
|
|
753
756
|
feedback: Y(d.id)
|
|
754
757
|
}, null, 8, ["feedback"])) : k("", !0)]),
|
|
755
758
|
_: 2
|
|
756
759
|
}, 1024)], 64))), 128)),
|
|
757
|
-
|
|
760
|
+
An(d) && d.metadata?.pagePointer ? (R(), A("div", {
|
|
758
761
|
key: 0,
|
|
759
762
|
class: "pk-chatbot-message__pointer",
|
|
760
763
|
title: d.metadata.pagePointer.kind === "text" ? V(i)("pagePointer.selected") : V(i)("pagePointer.pointed")
|
|
761
764
|
}, [M(u, {
|
|
762
765
|
name: d.metadata.pagePointer.kind === "text" ? "ri:double-quotes-l" : "ri:focus-3-line",
|
|
763
766
|
class: "pk-chatbot-message__pointer-icon"
|
|
764
|
-
}, null, 8, ["name"]), j("span",
|
|
767
|
+
}, null, 8, ["name"]), j("span", jt, B(d.metadata.pagePointer.kind === "text" ? `«${d.metadata.pagePointer.label}»` : d.metadata.pagePointer.label), 1)], 8, At)) : k("", !0),
|
|
765
768
|
M(E, {
|
|
766
769
|
name: "fade-in",
|
|
767
770
|
mode: "out-in"
|
|
768
771
|
}, {
|
|
769
|
-
default: U(() => [q.value && Z(
|
|
772
|
+
default: U(() => [q.value && Z(b) && !bn(d) && !e.hostConfirmation && Q(d) && (!Sn(d) || kn(d)) ? (R(), A("div", {
|
|
770
773
|
key: `loading-info-${d.id}`,
|
|
771
774
|
class: "pk-chatbot-message__loading-info"
|
|
772
|
-
}, [j("div",
|
|
775
|
+
}, [j("div", Mt, [
|
|
773
776
|
M(u, {
|
|
774
777
|
name: "loading-loop",
|
|
775
778
|
class: "shrink-0"
|
|
776
779
|
}),
|
|
777
780
|
M(E, { mode: "out-in" }, {
|
|
778
|
-
default: U(() => [
|
|
779
|
-
key:
|
|
781
|
+
default: U(() => [gn.value ? (R(), O(u, {
|
|
782
|
+
key: gn.value,
|
|
780
783
|
class: "shrink-0",
|
|
781
|
-
name:
|
|
784
|
+
name: gn.value
|
|
782
785
|
}, null, 8, ["name"])) : k("", !0)]),
|
|
783
786
|
_: 1
|
|
784
787
|
}),
|
|
785
788
|
M(E, { mode: "out-in" }, {
|
|
786
|
-
default: U(() => [
|
|
787
|
-
key:
|
|
789
|
+
default: U(() => [hn.value ? (R(), A("span", {
|
|
790
|
+
key: hn.value,
|
|
788
791
|
class: "text-12"
|
|
789
|
-
}, B(
|
|
792
|
+
}, B(hn.value), 1)) : k("", !0)]),
|
|
790
793
|
_: 1
|
|
791
794
|
})
|
|
792
795
|
]), M(E, {
|
|
793
796
|
name: "fade-in",
|
|
794
797
|
mode: "out-in"
|
|
795
798
|
}, {
|
|
796
|
-
default: U(() => [!e.hideReasoning && !
|
|
799
|
+
default: U(() => [!e.hideReasoning && !Sn(d) && X.value && "text" in X.value && X.value.text.trim() ? (R(), O(we, {
|
|
797
800
|
key: 0,
|
|
798
801
|
markdown: X.value.text,
|
|
799
802
|
"is-dark": e.isDark,
|
|
800
|
-
"tail-length": V(
|
|
803
|
+
"tail-length": V(ue),
|
|
801
804
|
"inner-class": "wysiwyg",
|
|
802
805
|
class: "border border-surface-3 rounded-md p-4 mt-8 bg-surface-1 max-h-64 text-12 w-full"
|
|
803
806
|
}, null, 8, [
|
|
@@ -810,14 +813,14 @@ var ft = ["aria-busy"], pt = {
|
|
|
810
813
|
_: 2
|
|
811
814
|
}, 1024),
|
|
812
815
|
M(E, { mode: "out-in" }, {
|
|
813
|
-
default: U(() => [
|
|
814
|
-
M(
|
|
816
|
+
default: U(() => [Fn(d, b) ? (R(), A("div", Nt, [
|
|
817
|
+
M(ee, {
|
|
815
818
|
modifiers: "compact",
|
|
816
819
|
class: "mr-auto shrink-0"
|
|
817
820
|
}, {
|
|
818
821
|
default: U(() => [
|
|
819
822
|
M(E, { mode: "out-in" }, {
|
|
820
|
-
default: U(() => [
|
|
823
|
+
default: U(() => [vn(b) ? (R(), O(m, {
|
|
821
824
|
key: 0,
|
|
822
825
|
icon: "ri:reset-right-line",
|
|
823
826
|
modifiers: "action-quiet-small",
|
|
@@ -828,7 +831,7 @@ var ft = ["aria-busy"], pt = {
|
|
|
828
831
|
_: 2
|
|
829
832
|
}, 1024),
|
|
830
833
|
M(E, { mode: "out-in" }, {
|
|
831
|
-
default: U(() => [
|
|
834
|
+
default: U(() => [yn("show-info", b) ? (R(), O(m, {
|
|
832
835
|
key: 0,
|
|
833
836
|
icon: "ri:information-line",
|
|
834
837
|
title: V(i)("action.getMoreInfo"),
|
|
@@ -843,13 +846,13 @@ var ft = ["aria-busy"], pt = {
|
|
|
843
846
|
_: 2
|
|
844
847
|
}, 1024),
|
|
845
848
|
M(E, { mode: "out-in" }, {
|
|
846
|
-
default: U(() => [
|
|
849
|
+
default: U(() => [yn("revise", b) ? (R(), O(m, {
|
|
847
850
|
key: 0,
|
|
848
|
-
icon:
|
|
849
|
-
title:
|
|
850
|
-
"aria-label":
|
|
851
|
+
icon: ut(d.id) ? "ri:file-edit-fill" : "ri:file-edit-line",
|
|
852
|
+
title: ut(d.id) ? V(i)("action.editRevise") : V(i)("action.createRevise"),
|
|
853
|
+
"aria-label": ut(d.id) ? V(i)("action.editRevise") : V(i)("action.createRevise"),
|
|
851
854
|
modifiers: "action-quiet-small",
|
|
852
|
-
class: I({ "text-brand-graphic":
|
|
855
|
+
class: I({ "text-brand-graphic": ut(d.id) }),
|
|
853
856
|
onClick: W((e) => t.$emit("revise", d), ["stop"])
|
|
854
857
|
}, null, 8, [
|
|
855
858
|
"icon",
|
|
@@ -861,7 +864,7 @@ var ft = ["aria-busy"], pt = {
|
|
|
861
864
|
_: 2
|
|
862
865
|
}, 1024),
|
|
863
866
|
M(E, { mode: "out-in" }, {
|
|
864
|
-
default: U(() => [
|
|
867
|
+
default: U(() => [$t("upvote", b) ? (R(), O(m, {
|
|
865
868
|
key: 0,
|
|
866
869
|
icon: Y(d.id)?.vote === "upvote" ? "ri:thumb-up-fill" : "ri:thumb-up-line",
|
|
867
870
|
title: V(i)("action.upvote"),
|
|
@@ -877,7 +880,7 @@ var ft = ["aria-busy"], pt = {
|
|
|
877
880
|
_: 2
|
|
878
881
|
}, 1024),
|
|
879
882
|
M(E, { mode: "out-in" }, {
|
|
880
|
-
default: U(() => [
|
|
883
|
+
default: U(() => [$t("downvote", b) ? (R(), O(m, {
|
|
881
884
|
key: 0,
|
|
882
885
|
icon: Y(d.id)?.vote === "downvote" ? "ri:thumb-down-fill" : "ri:thumb-down-line",
|
|
883
886
|
title: V(i)("action.downvote"),
|
|
@@ -893,7 +896,7 @@ var ft = ["aria-busy"], pt = {
|
|
|
893
896
|
_: 2
|
|
894
897
|
}, 1024),
|
|
895
898
|
M(E, { mode: "out-in" }, {
|
|
896
|
-
default: U(() => [
|
|
899
|
+
default: U(() => [$t("feedback", b) ? (R(), O(m, {
|
|
897
900
|
key: 0,
|
|
898
901
|
icon: Y(d.id)?.comment ? "ri:feedback-fill" : "ri:feedback-line",
|
|
899
902
|
title: V(i)("action.feedback"),
|
|
@@ -911,26 +914,26 @@ var ft = ["aria-busy"], pt = {
|
|
|
911
914
|
]),
|
|
912
915
|
_: 2
|
|
913
916
|
}, 1024),
|
|
914
|
-
!e.showMessageDateTime && d.metadata?.createdAt && d.metadata?.completedAt ? (R(), A("div",
|
|
917
|
+
!e.showMessageDateTime && d.metadata?.createdAt && d.metadata?.completedAt ? (R(), A("div", Pt, [j("time", {
|
|
915
918
|
datetime: new Date(d.metadata.createdAt).toISOString(),
|
|
916
919
|
title: V(s)(new Date(d.metadata.createdAt), "date-time"),
|
|
917
920
|
class: "flex items-center gap-4 min-w-0"
|
|
918
921
|
}, [M(u, {
|
|
919
922
|
name: "ri:time-line",
|
|
920
923
|
class: "shrink-0"
|
|
921
|
-
}), j("span",
|
|
924
|
+
}), j("span", It, B(In(d.metadata.createdAt)), 1)], 8, Ft), Ln(d) ? (R(), A("span", Lt, [M(u, {
|
|
922
925
|
name: "ri:hourglass-line",
|
|
923
926
|
class: "shrink-0"
|
|
924
|
-
}), j("span",
|
|
927
|
+
}), j("span", Rt, B(Ln(d)), 1)])) : k("", !0)])) : k("", !0),
|
|
925
928
|
e.showMessageNumber ? (R(), A("span", {
|
|
926
929
|
key: 1,
|
|
927
|
-
title: V(i)("label.messageNumber", { n:
|
|
930
|
+
title: V(i)("label.messageNumber", { n: Pn.value[b] }),
|
|
928
931
|
class: "text-12 text-word-3 tabular-nums"
|
|
929
|
-
}, " #" + B(
|
|
930
|
-
e.showMessageTokensCount && d.metadata?.totalTokens ? (R(), A("span",
|
|
932
|
+
}, " #" + B(Pn.value[b]), 9, zt)) : k("", !0),
|
|
933
|
+
e.showMessageTokensCount && d.metadata?.totalTokens ? (R(), A("span", Bt, [M(u, {
|
|
931
934
|
name: "ri:ai-generate-2-line",
|
|
932
935
|
class: "shrink-0"
|
|
933
|
-
}), j("span",
|
|
936
|
+
}), j("span", Vt, B(V(c)(d.metadata.totalTokens, "integer")) + " " + B(V(i)("label.tokens")), 1)])) : k("", !0),
|
|
934
937
|
e.showMessageDateTime && d.metadata?.createdAt ? (R(), A("time", {
|
|
935
938
|
key: 3,
|
|
936
939
|
datetime: new Date(d.metadata?.createdAt).toISOString(),
|
|
@@ -938,11 +941,11 @@ var ft = ["aria-busy"], pt = {
|
|
|
938
941
|
}, [M(u, {
|
|
939
942
|
name: "ri:time-line",
|
|
940
943
|
class: "shrink-0"
|
|
941
|
-
}), j("span",
|
|
942
|
-
e.showMessageDateTime && d?.metadata?.completedAt && d?.metadata?.createdAt ? (R(), A("div",
|
|
944
|
+
}), j("span", Ut, B(V(s)(new Date(d.metadata?.createdAt), "date-time")), 1)], 8, Ht)) : k("", !0),
|
|
945
|
+
e.showMessageDateTime && d?.metadata?.completedAt && d?.metadata?.createdAt ? (R(), A("div", Wt, [M(u, {
|
|
943
946
|
name: "ri:hourglass-line",
|
|
944
947
|
class: "shrink-0"
|
|
945
|
-
}), M(
|
|
948
|
+
}), M(be, {
|
|
946
949
|
class: "truncate",
|
|
947
950
|
date: d.metadata?.createdAt,
|
|
948
951
|
"end-date": d.metadata?.completedAt
|
|
@@ -955,7 +958,7 @@ var ft = ["aria-busy"], pt = {
|
|
|
955
958
|
key: 0,
|
|
956
959
|
ref_for: !0,
|
|
957
960
|
ref_key: "feedbackMessageEl",
|
|
958
|
-
ref:
|
|
961
|
+
ref: Rn,
|
|
959
962
|
loading: e.feedbackLoading,
|
|
960
963
|
submitted: e.feedbackSubmitted,
|
|
961
964
|
error: e.feedbackError,
|
|
@@ -973,23 +976,23 @@ var ft = ["aria-busy"], pt = {
|
|
|
973
976
|
M(E, {
|
|
974
977
|
appear: "",
|
|
975
978
|
name: "pk-chatbot-part",
|
|
976
|
-
onLeave:
|
|
979
|
+
onLeave: mn
|
|
977
980
|
}, {
|
|
978
|
-
default: U(() => [
|
|
981
|
+
default: U(() => [fn.value ? (R(), A("div", {
|
|
979
982
|
key: 0,
|
|
980
983
|
class: "pk-chatbot-message pk-chatbot-message--assistant pk-chatbot-message--loading",
|
|
981
|
-
style:
|
|
982
|
-
}, [j("div",
|
|
984
|
+
style: Pe({ minHeight: pn.value ? `${J.value}px` : void 0 })
|
|
985
|
+
}, [j("div", Gt, [j("div", Kt, [M(u, {
|
|
983
986
|
name: "loading-loop",
|
|
984
987
|
class: "shrink-0"
|
|
985
|
-
}), j("span",
|
|
988
|
+
}), j("span", qt, B(V(i)("label.answeringOnTheCall")), 1)])])], 4)) : k("", !0)]),
|
|
986
989
|
_: 1
|
|
987
990
|
}),
|
|
988
991
|
M(E, {
|
|
989
992
|
appear: "",
|
|
990
993
|
name: "pk-chatbot-part"
|
|
991
994
|
}, {
|
|
992
|
-
default: U(() => [
|
|
995
|
+
default: U(() => [wn.value ? (R(), A("div", Jt, [M(lt, {
|
|
993
996
|
question: e.hostConfirmation?.question ?? V(i)("toolApproval.prompt"),
|
|
994
997
|
details: e.hostConfirmation?.details,
|
|
995
998
|
unchanged: e.hostConfirmation?.unchanged,
|
|
@@ -1005,7 +1008,7 @@ var ft = ["aria-busy"], pt = {
|
|
|
1005
1008
|
appear: "",
|
|
1006
1009
|
name: "pk-chatbot-part"
|
|
1007
1010
|
}, {
|
|
1008
|
-
default: U(() => [
|
|
1011
|
+
default: U(() => [dn.value ? (R(), O(ye, {
|
|
1009
1012
|
key: 0,
|
|
1010
1013
|
error: e.error,
|
|
1011
1014
|
onRetry: n[5] ||= (e) => t.$emit("auto-retry"),
|
|
@@ -1013,27 +1016,27 @@ var ft = ["aria-busy"], pt = {
|
|
|
1013
1016
|
}, null, 8, ["error"])) : k("", !0)]),
|
|
1014
1017
|
_: 1
|
|
1015
1018
|
}),
|
|
1016
|
-
|
|
1019
|
+
cn.value?.role === "user" && !pn.value || dn.value ? (R(), A("div", {
|
|
1017
1020
|
key: 0,
|
|
1018
1021
|
class: "pk-chatbot-messages__spacer",
|
|
1019
|
-
style:
|
|
1022
|
+
style: Pe({ minHeight: `${J.value}px` })
|
|
1020
1023
|
}, null, 4)) : k("", !0)
|
|
1021
1024
|
], 512),
|
|
1022
1025
|
M(E, { name: "pk-chatbot-messages-fab" }, {
|
|
1023
|
-
default: U(() => [e.showScrollToBottom && (V(
|
|
1026
|
+
default: U(() => [e.showScrollToBottom && (V(qe) || !V(Je)) ? (R(), A("button", {
|
|
1024
1027
|
key: 0,
|
|
1025
1028
|
type: "button",
|
|
1026
1029
|
class: "pk-chatbot-messages__scroll-to-bottom",
|
|
1027
1030
|
title: V(i)("action.scrollToBottom"),
|
|
1028
1031
|
"aria-label": V(i)("action.scrollToBottom"),
|
|
1029
|
-
onClick:
|
|
1030
|
-
}, [M(u, { name: "ri:arrow-down-line" })], 8,
|
|
1032
|
+
onClick: Ye
|
|
1033
|
+
}, [M(u, { name: "ri:arrow-down-line" })], 8, Yt)) : k("", !0)]),
|
|
1031
1034
|
_: 1
|
|
1032
1035
|
})
|
|
1033
|
-
], 46,
|
|
1036
|
+
], 46, pt);
|
|
1034
1037
|
};
|
|
1035
1038
|
}
|
|
1036
1039
|
});
|
|
1037
|
-
export {
|
|
1040
|
+
export { Xt as t };
|
|
1038
1041
|
|
|
1039
|
-
//# sourceMappingURL=PkChatbotMessages-
|
|
1042
|
+
//# sourceMappingURL=PkChatbotMessages-D-m0cOqM.js.map
|