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