@8wave/ai-elements 0.125.0-beta.17 → 0.125.0-beta.19
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/README.md +1 -0
- package/dist/_chunks/{PkChatbotFilePreview-xDlDvl5m.js → PkChatbotFilePreview-CFGqa-tX.js} +2 -2
- package/dist/_chunks/{PkChatbotFilePreview-xDlDvl5m.js.map → PkChatbotFilePreview-CFGqa-tX.js.map} +1 -1
- package/dist/_chunks/{PkFilePreview-BIFkMsAC.js → PkFilePreview-BzNLupQS.js} +318 -315
- package/dist/_chunks/PkFilePreview-BzNLupQS.js.map +1 -0
- package/dist/_chunks/{PkFilePreviewDialog-NLk4gZMd.js → PkFilePreviewDialog-BfZFgdOi.js} +2 -2
- package/dist/_chunks/{PkFilePreviewDialog-NLk4gZMd.js.map → PkFilePreviewDialog-BfZFgdOi.js.map} +1 -1
- package/dist/_chunks/{PkStreamingMarkdown-BFTTLuPc.js → PkStreamingMarkdown-CqLpNWQv.js} +2 -2
- package/dist/_chunks/{PkStreamingMarkdown-BFTTLuPc.js.map → PkStreamingMarkdown-CqLpNWQv.js.map} +1 -1
- package/dist/_chunks/{PkToolChatFile-Buv7Qkes.js → PkToolChatFile-iE4ZokYD.js} +2 -2
- package/dist/_chunks/{PkToolChatFile-Buv7Qkes.js.map → PkToolChatFile-iE4ZokYD.js.map} +1 -1
- package/dist/_chunks/{PkToolShareDocument-kB0qoQda.js → PkToolShareDocument-lTHNZodf.js} +2 -2
- package/dist/_chunks/{PkToolShareDocument-kB0qoQda.js.map → PkToolShareDocument-lTHNZodf.js.map} +1 -1
- package/dist/_chunks/{PkToolShowArtifact-ClYqvIqB.js → PkToolShowArtifact-BNQrM5fY.js} +2 -2
- package/dist/_chunks/{PkToolShowArtifact-ClYqvIqB.js.map → PkToolShowArtifact-BNQrM5fY.js.map} +1 -1
- package/dist/_chunks/{PkToolShowContactForm-C0ABjvtZ.js → PkToolShowContactForm-CvQoLumn.js} +2 -2
- package/dist/_chunks/{PkToolShowContactForm-C0ABjvtZ.js.map → PkToolShowContactForm-CvQoLumn.js.map} +1 -1
- package/dist/_chunks/{PkToolShowDiagram-BZbHtEs5.js → PkToolShowDiagram-COt1Z3q9.js} +2 -2
- package/dist/_chunks/{PkToolShowDiagram-BZbHtEs5.js.map → PkToolShowDiagram-COt1Z3q9.js.map} +1 -1
- package/dist/_chunks/{PkToolShowForm-DUjR-9o1.js → PkToolShowForm-DcPccCEU.js} +2 -2
- package/dist/_chunks/{PkToolShowForm-DUjR-9o1.js.map → PkToolShowForm-DcPccCEU.js.map} +1 -1
- package/dist/_chunks/{PkToolShowImageGallery-CNU2Zvso.js → PkToolShowImageGallery-DefXra8-.js} +2 -2
- package/dist/_chunks/{PkToolShowImageGallery-CNU2Zvso.js.map → PkToolShowImageGallery-DefXra8-.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSources-DhDjNIFa.js → PkToolShowSources-BE3Zv_uz.js} +2 -2
- package/dist/_chunks/{PkToolShowSources-DhDjNIFa.js.map → PkToolShowSources-BE3Zv_uz.js.map} +1 -1
- package/dist/_chunks/{useLightbox-BEEzZ0qT.js → useLightbox-D2Zi-Fpe.js} +72 -13
- package/dist/_chunks/useLightbox-D2Zi-Fpe.js.map +1 -0
- package/dist/ai-elements.es.js +461 -429
- 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/PkChatbotViewConversations.js +1 -1
- package/dist-vue/PkChatbotViewFiles.js +1 -1
- package/dist-vue/PkChatbotViewProfile.js +1 -1
- package/dist-vue/_chunks/{PkChatbot-BtUaZ-LR.js → PkChatbot-BVZgvanv.js} +7 -7
- package/dist-vue/_chunks/{PkChatbot-BtUaZ-LR.js.map → PkChatbot-BVZgvanv.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotEmptyState-DJIkAskP.js → PkChatbotEmptyState-COya3H3C.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotEmptyState-DJIkAskP.js.map → PkChatbotEmptyState-COya3H3C.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotFilePreview-BpVM850N.js → PkChatbotFilePreview-BsvT6orx.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotFilePreview-BpVM850N.js.map → PkChatbotFilePreview-BsvT6orx.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotInput-DzqaW3EE.js → PkChatbotInput-D0KUEkAs.js} +5 -4
- package/dist-vue/_chunks/PkChatbotInput-D0KUEkAs.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotMessages-vkbq5p1X.js → PkChatbotMessages-l-IzEWsN.js} +17 -17
- package/dist-vue/_chunks/{PkChatbotMessages-vkbq5p1X.js.map → PkChatbotMessages-l-IzEWsN.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotSteps-D5yz8lut.js → PkChatbotSteps-_Aqft0em.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotSteps-D5yz8lut.js.map → PkChatbotSteps-_Aqft0em.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewChat-DCPRePrE.js → PkChatbotViewChat-C1uzFQCJ.js} +458 -453
- package/dist-vue/_chunks/PkChatbotViewChat-C1uzFQCJ.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotViewConversations-BBd3XMmM.js → PkChatbotViewConversations-DjhiHp8-.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewConversations-BBd3XMmM.js.map → PkChatbotViewConversations-DjhiHp8-.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewFiles-BiQzDqJg.js → PkChatbotViewFiles-CtOhnFCc.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewFiles-BiQzDqJg.js.map → PkChatbotViewFiles-CtOhnFCc.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewProfile-7266UiRM.js → PkChatbotViewProfile-NfTamy9j.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewProfile-7266UiRM.js.map → PkChatbotViewProfile-NfTamy9j.js.map} +1 -1
- package/dist-vue/_chunks/{PkFilePreview-DLo9nI2g.js → PkFilePreview-C2VOU99H.js} +469 -466
- package/dist-vue/_chunks/PkFilePreview-C2VOU99H.js.map +1 -0
- package/dist-vue/_chunks/{PkFilePreviewDialog-CgDJQgIJ.js → PkFilePreviewDialog-C6QQMntW.js} +2 -2
- package/dist-vue/_chunks/{PkFilePreviewDialog-CgDJQgIJ.js.map → PkFilePreviewDialog-C6QQMntW.js.map} +1 -1
- package/dist-vue/_chunks/{PkStreamingMarkdown-C3UGCEXm.js → PkStreamingMarkdown-2FN4WMQD.js} +2 -2
- package/dist-vue/_chunks/{PkStreamingMarkdown-C3UGCEXm.js.map → PkStreamingMarkdown-2FN4WMQD.js.map} +1 -1
- package/dist-vue/_chunks/{PkSvgViewer-DmkElalq.js → PkSvgViewer-BsdSOBpH.js} +2 -2
- package/dist-vue/_chunks/{PkSvgViewer-DmkElalq.js.map → PkSvgViewer-BsdSOBpH.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolChatFile-Dy0rGC29.js → PkToolChatFile-DAT1tv52.js} +2 -2
- package/dist-vue/_chunks/{PkToolChatFile-Dy0rGC29.js.map → PkToolChatFile-DAT1tv52.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShareDocument-BIZkgcJ3.js → PkToolShareDocument-Qb2Lu5vh.js} +2 -2
- package/dist-vue/_chunks/{PkToolShareDocument-BIZkgcJ3.js.map → PkToolShareDocument-Qb2Lu5vh.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowArtifact-B7udnhpb.js → PkToolShowArtifact-Bskomw05.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowArtifact-B7udnhpb.js.map → PkToolShowArtifact-Bskomw05.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowContactForm-0SEgxn2S.js → PkToolShowContactForm-iQrlqv7j.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowContactForm-0SEgxn2S.js.map → PkToolShowContactForm-iQrlqv7j.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowDiagram-BqHBhZgd.js → PkToolShowDiagram-C-43uUoh.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowDiagram-BqHBhZgd.js.map → PkToolShowDiagram-C-43uUoh.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowForm-C4n_3mFL.js → PkToolShowForm-CKXpqQxy.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowForm-C4n_3mFL.js.map → PkToolShowForm-CKXpqQxy.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowImageGallery-DEpdtLns.js → PkToolShowImageGallery-DLTn6JmU.js} +3 -3
- package/dist-vue/_chunks/{PkToolShowImageGallery-DEpdtLns.js.map → PkToolShowImageGallery-DLTn6JmU.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowLocation-DCPaDtBI.js → PkToolShowLocation-B8FE_Sqd.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowLocation-DCPaDtBI.js.map → PkToolShowLocation-B8FE_Sqd.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowProductList-Bm2NLUGS.js → PkToolShowProductList-hhSBAQVC.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowProductList-Bm2NLUGS.js.map → PkToolShowProductList-hhSBAQVC.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSources-DwFqlit2.js → PkToolShowSources-BiP9fVV2.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowSources-DwFqlit2.js.map → PkToolShowSources-BiP9fVV2.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowVideo-BLEJ8tng.js → PkToolShowVideo-DJhsbDuX.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowVideo-BLEJ8tng.js.map → PkToolShowVideo-DJhsbDuX.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowWebPages-CeAXllAF.js → PkToolShowWebPages-BAv66f5H.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowWebPages-CeAXllAF.js.map → PkToolShowWebPages-BAv66f5H.js.map} +1 -1
- package/dist-vue/_chunks/{createChatbotApiClient-BPN6cLGF.js → createChatbotApiClient-DO4_I5hT.js} +8 -1
- package/dist-vue/_chunks/createChatbotApiClient-DO4_I5hT.js.map +1 -0
- package/dist-vue/_chunks/{useChatbotStore-C4xhJtrb.js → useChatbotStore-BZ1n3Hyx.js} +662 -649
- package/dist-vue/_chunks/useChatbotStore-BZ1n3Hyx.js.map +1 -0
- package/dist-vue/_chunks/{useLightbox-gSzoBgNv.js → useLightbox-FDyQrPWe.js} +72 -13
- package/dist-vue/_chunks/useLightbox-FDyQrPWe.js.map +1 -0
- package/dist-vue/api.js +1 -1
- package/dist-vue/composables.js +8 -2
- package/dist-vue/composables.js.map +1 -1
- package/dist-vue/index.js +25 -25
- package/dist-vue/locales.js +6 -0
- package/dist-vue/packages/components/src/chat/PkChatbotInput.d.ts +2 -0
- package/dist-vue/packages/composable/src/chatbot/api/createChatbotApiClient.d.ts +6 -0
- package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +4 -1
- package/package.json +1 -1
- package/dist/_chunks/PkFilePreview-BIFkMsAC.js.map +0 -1
- package/dist/_chunks/useLightbox-BEEzZ0qT.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotInput-DzqaW3EE.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotViewChat-DCPRePrE.js.map +0 -1
- package/dist-vue/_chunks/PkFilePreview-DLo9nI2g.js.map +0 -1
- package/dist-vue/_chunks/createChatbotApiClient-BPN6cLGF.js.map +0 -1
- package/dist-vue/_chunks/useChatbotStore-C4xhJtrb.js.map +0 -1
- package/dist-vue/_chunks/useLightbox-gSzoBgNv.js.map +0 -1
package/dist/ai-elements.es.js
CHANGED
|
@@ -3,7 +3,7 @@ import { C as e, E as t, S as n, T as r, _ as i, a, b as o, d as s, f as c, g as
|
|
|
3
3
|
import { $ as ee, A as w, B as te, C as T, Ct as E, D as ne, Dt as re, E as D, Et as O, F as k, H as ie, I as ae, J as A, L as oe, N as se, O as ce, Ot as le, P as ue, Q as j, R as de, S as M, St as N, T as fe, Tt as P, V as pe, W as F, X as me, Y as he, _ as I, at as ge, b as _e, bt as ve, ct as ye, d as be, dt as xe, f as L, ft as Se, g as R, gt as z, h as B, i as Ce, it as we, k as V, kt as H, l as Te, lt as Ee, mt as De, n as Oe, nt as ke, ot as U, p as Ae, pt as je, q as Me, r as Ne, t as W, tt as G, u as Pe, ut as Fe, v as K, vt as Ie, w as q, wt as J, x as Le, xt as Re, y as Y, yt as ze, z as X } from "./_chunks/vue.runtime.esm-bundler-C2U5uTqB.js";
|
|
4
4
|
import { n as Be, r as Ve, t as He } from "./_chunks/vue-i18n-POtLvOl1.js";
|
|
5
5
|
import { i as Ue, n as We, r as Ge } from "./_chunks/iconify-oSMMdRMF.js";
|
|
6
|
-
import { t as Ke } from "./_chunks/PkStreamingMarkdown-
|
|
6
|
+
import { t as Ke } from "./_chunks/PkStreamingMarkdown-CqLpNWQv.js";
|
|
7
7
|
import { A as qe, B as Je, D as Ye, E as Xe, F as Ze, I as Qe, L as $e, M as et, N as tt, O as nt, R as rt, S as it, T as at, _ as Z, a as ot, b as st, c as ct, d as lt, g as ut, h as dt, i as ft, j as pt, k as mt, l as ht, n as gt, o as _t, r as vt, s as yt, u as bt, w as xt, x as St } from "./_chunks/Agent-CCBs3D5I.js";
|
|
8
8
|
import { a as Ct, i as wt, n as Tt, t as Et } from "./_chunks/markdown-Ou0WulrH.js";
|
|
9
9
|
import { n as Dt } from "./_chunks/src-JJyCGvqH.js";
|
|
@@ -18,8 +18,8 @@ import { t as Gn } from "./_chunks/useImageFallback-BePGTrF3.js";
|
|
|
18
18
|
import { n as Kn, t as qn } from "./_chunks/PkSelectionActions-CUymhwsG.js";
|
|
19
19
|
import { t as Jn } from "./_chunks/_plugin-vue_export-helper-Djzt4Yr7.js";
|
|
20
20
|
import { t as Yn } from "./_chunks/chatImagePolicy-Df31QSRJ.js";
|
|
21
|
-
import { t as Xn } from "./_chunks/useLightbox-
|
|
22
|
-
import { t as Zn } from "./_chunks/PkChatbotFilePreview-
|
|
21
|
+
import { t as Xn } from "./_chunks/useLightbox-D2Zi-Fpe.js";
|
|
22
|
+
import { t as Zn } from "./_chunks/PkChatbotFilePreview-CFGqa-tX.js";
|
|
23
23
|
// ../../node_modules/.pnpm/pinia@4.1.0_@vue+devtools-api@8.2.1_typescript@6.0.3_vue@3.5.44_typescript@6.0.3_/node_modules/pinia/dist/pinia.js
|
|
24
24
|
V(), U();
|
|
25
25
|
var Qn = typeof window < "u", $n, er = (e) => $n = e, tr = Symbol();
|
|
@@ -1492,6 +1492,9 @@ var jr = {
|
|
|
1492
1492
|
noHeadings: "Il documento non ha titoli."
|
|
1493
1493
|
},
|
|
1494
1494
|
lightbox: {
|
|
1495
|
+
copy: "Copia immagine",
|
|
1496
|
+
copied: "Immagine copiata",
|
|
1497
|
+
copyFailed: "Non è stato possibile copiare l'immagine",
|
|
1495
1498
|
openInNewTab: "Apri in una nuova scheda",
|
|
1496
1499
|
zoom: "Ingrandisci o riduci"
|
|
1497
1500
|
},
|
|
@@ -3641,6 +3644,9 @@ var jr = {
|
|
|
3641
3644
|
noHeadings: "The document has no headings."
|
|
3642
3645
|
},
|
|
3643
3646
|
lightbox: {
|
|
3647
|
+
copy: "Copy image",
|
|
3648
|
+
copied: "Image copied",
|
|
3649
|
+
copyFailed: "The image could not be copied",
|
|
3644
3650
|
openInNewTab: "Open in a new tab",
|
|
3645
3651
|
zoom: "Zoom in or out"
|
|
3646
3652
|
},
|
|
@@ -7188,6 +7194,13 @@ function Lc(e) {
|
|
|
7188
7194
|
}
|
|
7189
7195
|
return o.json();
|
|
7190
7196
|
},
|
|
7197
|
+
async discardMedia(e) {
|
|
7198
|
+
await i("/medias/discard", {
|
|
7199
|
+
method: "POST",
|
|
7200
|
+
headers: { "Content-Type": "application/json" },
|
|
7201
|
+
body: JSON.stringify(e)
|
|
7202
|
+
}, "void");
|
|
7203
|
+
},
|
|
7191
7204
|
getChatEndpoint(e, t = "chat") {
|
|
7192
7205
|
return `${n}/agents/${encodeURIComponent(e)}/${t === "reasoning" ? "reasoning-chat" : "chat"}`;
|
|
7193
7206
|
},
|
|
@@ -11108,7 +11121,7 @@ function ep(e) {
|
|
|
11108
11121
|
Ye.value.includes(e) || (Ye.value = [...Ye.value, e]), Qe.set(e, Date.now()), n ? et.add(e) : et.delete(e), t && (Ze.value = {
|
|
11109
11122
|
...Ze.value,
|
|
11110
11123
|
[e]: t
|
|
11111
|
-
}),
|
|
11124
|
+
}), Nn || In();
|
|
11112
11125
|
}
|
|
11113
11126
|
function rt(e) {
|
|
11114
11127
|
Ze.value = Object.fromEntries(Object.entries(Ze.value).filter(([t]) => t !== e));
|
|
@@ -11168,15 +11181,15 @@ function ep(e) {
|
|
|
11168
11181
|
},
|
|
11169
11182
|
onFinish: () => {
|
|
11170
11183
|
let e = F.value;
|
|
11171
|
-
!fe.value && !ft.value.some((t) => t.id === e) &&
|
|
11184
|
+
!fe.value && !ft.value.some((t) => t.id === e) && Jt(o.value);
|
|
11172
11185
|
}
|
|
11173
11186
|
})), Z = B(() => De(at)), ot = () => Z.value.messages[Z.value.messages.length - 1];
|
|
11174
11187
|
j(F, (e, t) => {
|
|
11175
|
-
if (t && !fe.value && (
|
|
11188
|
+
if (t && !fe.value && (on() || We?.chatId === t)) {
|
|
11176
11189
|
let e = Z.value.messages.filter((e) => e.role === "user"), n = e[e.length - 1];
|
|
11177
11190
|
nt(t, n ? Kt(n) ?? "" : "", Z.value.status === "streaming" || We?.chatId === t);
|
|
11178
11191
|
}
|
|
11179
|
-
it(e), Ke = void 0, clearTimeout(
|
|
11192
|
+
it(e), Ke = void 0, clearTimeout(kn), On.value = !1, Z.value.stop();
|
|
11180
11193
|
}, { flush: "sync" });
|
|
11181
11194
|
let st = B(() => {
|
|
11182
11195
|
let e = u.value?.initialMessage;
|
|
@@ -11211,29 +11224,29 @@ function ep(e) {
|
|
|
11211
11224
|
}), dt = B(() => {
|
|
11212
11225
|
let e = u.value?.messagePlaceholder;
|
|
11213
11226
|
return e?.[r.value] ? e[r.value] : n("placeholder.askAnything") ? t("placeholder.askAnything") : "";
|
|
11214
|
-
}), ft = z([]), ht = z(!1), gt = z(1), _t = z(!1), vt = z(!1), yt, bt = z([]), xt = z(!1), St = z("chat"), Ct = z(0), wt = z([]), Tt = z(), Et = z(!1), Ot = z(!1), kt = z(), At = z(!1), jt = z(!1), Mt = z(), Nt = z(""), Pt = z([]), Ft = z(""), It =
|
|
11215
|
-
function
|
|
11216
|
-
let n = Object.fromEntries(Object.entries(
|
|
11217
|
-
|
|
11227
|
+
}), ft = z([]), ht = z(!1), gt = z(1), _t = z(!1), vt = z(!1), yt, bt = z([]), xt = z(!1), St = z("chat"), Ct = z(0), wt = z([]), Tt = z(), Et = z(!1), Ot = z(!1), kt = z(), At = z(!1), jt = z(!1), Mt = z(), Nt = z(""), Pt = z([]), Ft = z(""), It = z(!0), Lt = Ie(), Rt = z(0), zt = Bn(B(() => `${o.value}-queue`), {}), Bt = B(() => zt.value[F.value] ?? []), Vt = B(() => !fe.value);
|
|
11228
|
+
function Ht(e, t) {
|
|
11229
|
+
let n = Object.fromEntries(Object.entries(zt.value).filter(([t]) => t !== e));
|
|
11230
|
+
zt.value = t.length > 0 ? {
|
|
11218
11231
|
...n,
|
|
11219
11232
|
[e]: t
|
|
11220
11233
|
} : n;
|
|
11221
11234
|
}
|
|
11222
|
-
function Ht(e) {
|
|
11223
|
-
let t = (Rt.value[e] ?? []).join(Xf);
|
|
11224
|
-
return Vt(e, []), t;
|
|
11225
|
-
}
|
|
11226
11235
|
function Ut(e) {
|
|
11227
|
-
|
|
11236
|
+
let t = (zt.value[e] ?? []).join(Xf);
|
|
11237
|
+
return Ht(e, []), t;
|
|
11228
11238
|
}
|
|
11229
11239
|
function Wt(e) {
|
|
11230
|
-
|
|
11240
|
+
e && (Nt.value = Nt.value ? `${Nt.value}${Xf}${e}` : e);
|
|
11231
11241
|
}
|
|
11232
11242
|
function Gt(e) {
|
|
11233
|
-
|
|
11234
|
-
Wt(e), Ut(t ?? "");
|
|
11243
|
+
Ht(F.value, Bt.value.filter((t, n) => n !== e));
|
|
11235
11244
|
}
|
|
11236
|
-
|
|
11245
|
+
function qt(e) {
|
|
11246
|
+
let t = Bt.value[e];
|
|
11247
|
+
Gt(e), Wt(t ?? "");
|
|
11248
|
+
}
|
|
11249
|
+
async function Jt(e) {
|
|
11237
11250
|
if (fe.value) ft.value = [];
|
|
11238
11251
|
else {
|
|
11239
11252
|
ht.value = !0;
|
|
@@ -11259,10 +11272,10 @@ function ep(e) {
|
|
|
11259
11272
|
} finally {
|
|
11260
11273
|
ht.value = !1;
|
|
11261
11274
|
}
|
|
11262
|
-
|
|
11275
|
+
Ln([.../* @__PURE__ */ new Set([...jn(), ...ft.value.map((e) => e.id)])]);
|
|
11263
11276
|
}
|
|
11264
11277
|
}
|
|
11265
|
-
async function
|
|
11278
|
+
async function Yt() {
|
|
11266
11279
|
if (!_t.value || vt.value || fe.value) return;
|
|
11267
11280
|
vt.value = !0;
|
|
11268
11281
|
let e = yt;
|
|
@@ -11275,10 +11288,10 @@ function ep(e) {
|
|
|
11275
11288
|
vt.value = !1;
|
|
11276
11289
|
}
|
|
11277
11290
|
}
|
|
11278
|
-
async function
|
|
11291
|
+
async function Xt(e) {
|
|
11279
11292
|
return fe.value ? [] : Ee.value.getConversations(o.value, l.value, { search: e });
|
|
11280
11293
|
}
|
|
11281
|
-
async function
|
|
11294
|
+
async function Zt() {
|
|
11282
11295
|
let e = F.value;
|
|
11283
11296
|
if (!e) bt.value = [];
|
|
11284
11297
|
else {
|
|
@@ -11292,33 +11305,33 @@ function ep(e) {
|
|
|
11292
11305
|
}
|
|
11293
11306
|
}
|
|
11294
11307
|
}
|
|
11295
|
-
function
|
|
11308
|
+
function Qt(e, t = !1) {
|
|
11296
11309
|
return Ee.value.getChatFileDownloadUrl(e, t);
|
|
11297
11310
|
}
|
|
11298
|
-
function
|
|
11311
|
+
function $t(e) {
|
|
11299
11312
|
return Ee.value.getChatFilePreviewUrl(e);
|
|
11300
11313
|
}
|
|
11301
|
-
async function
|
|
11314
|
+
async function en(e) {
|
|
11302
11315
|
await Ee.value.deleteChatFile(e);
|
|
11303
11316
|
let t = bt.value.find((t) => t.documentId === e), n = t?.kind === "spreadsheet" ? t.sourceAttachmentId ?? t.documentId : void 0;
|
|
11304
11317
|
bt.value = bt.value.filter((t) => t.documentId !== e && (!n || t.documentId !== n && t.sourceAttachmentId !== n));
|
|
11305
11318
|
}
|
|
11306
|
-
async function
|
|
11319
|
+
async function tn(e, t) {
|
|
11307
11320
|
if (!fe.value) try {
|
|
11308
11321
|
let n = await Ee.value.getChat(e, t);
|
|
11309
11322
|
if (t !== F.value || Z.value.status !== "ready" || Z.value.messages.length > 0) return;
|
|
11310
|
-
n && (Z.value.messages = n.messages, we.value = n.blocked ?? !1,
|
|
11323
|
+
n && (Z.value.messages = n.messages, we.value = n.blocked ?? !1, nn(e, t, n.turnInProgress === !0));
|
|
11311
11324
|
} catch {}
|
|
11312
11325
|
}
|
|
11313
|
-
async function
|
|
11314
|
-
n && (await
|
|
11326
|
+
async function nn(e, t, n) {
|
|
11327
|
+
n && (await rn(t), t !== F.value || on()) || (await an(e, t), t === F.value && await dn());
|
|
11315
11328
|
}
|
|
11316
|
-
async function
|
|
11329
|
+
async function rn(e) {
|
|
11317
11330
|
let t = { chatId: e };
|
|
11318
11331
|
We = t, Ge.value = e;
|
|
11319
11332
|
let n = () => We === t && e === F.value, r = Date.now() + Hf;
|
|
11320
11333
|
try {
|
|
11321
|
-
for (; n() && !
|
|
11334
|
+
for (; n() && !on() && Date.now() < r;) {
|
|
11322
11335
|
Ue = !0;
|
|
11323
11336
|
try {
|
|
11324
11337
|
await Z.value.resumeStream();
|
|
@@ -11328,7 +11341,7 @@ function ep(e) {
|
|
|
11328
11341
|
if (!n()) return;
|
|
11329
11342
|
Z.value.clearError();
|
|
11330
11343
|
let t = await Ee.value.getChat(o.value, e).catch(() => null);
|
|
11331
|
-
if (!t || !n() ||
|
|
11344
|
+
if (!t || !n() || on()) return;
|
|
11332
11345
|
if (!t.turnInProgress) {
|
|
11333
11346
|
Z.value.messages = t.messages;
|
|
11334
11347
|
return;
|
|
@@ -11339,7 +11352,7 @@ function ep(e) {
|
|
|
11339
11352
|
We === t && (We = void 0, Ge.value = void 0);
|
|
11340
11353
|
}
|
|
11341
11354
|
}
|
|
11342
|
-
async function
|
|
11355
|
+
async function an(e, t) {
|
|
11343
11356
|
let n;
|
|
11344
11357
|
try {
|
|
11345
11358
|
n = Number(sessionStorage.getItem(Bc)), sessionStorage.removeItem(Bc);
|
|
@@ -11372,75 +11385,75 @@ function ep(e) {
|
|
|
11372
11385
|
}
|
|
11373
11386
|
}
|
|
11374
11387
|
}
|
|
11375
|
-
let
|
|
11388
|
+
let on = () => {
|
|
11376
11389
|
let e = Z.value.status;
|
|
11377
11390
|
return e === "submitted" || e === "streaming";
|
|
11378
|
-
},
|
|
11391
|
+
}, sn = () => on() || We?.chatId === F.value || w.value > 0, ln = () => {
|
|
11379
11392
|
let e = ot();
|
|
11380
11393
|
return Ae.value !== void 0 || Lf(e) || Qf(e);
|
|
11381
|
-
},
|
|
11382
|
-
async function
|
|
11394
|
+
}, un = /* @__PURE__ */ new Set();
|
|
11395
|
+
async function dn() {
|
|
11383
11396
|
let e = F.value;
|
|
11384
|
-
if (!(
|
|
11385
|
-
if (
|
|
11397
|
+
if (!(un.has(e) || Bt.value.length === 0 || sn() || Ce.value)) {
|
|
11398
|
+
if (ln()) Wt(Ut(e));
|
|
11386
11399
|
else {
|
|
11387
|
-
|
|
11400
|
+
un.add(e);
|
|
11388
11401
|
try {
|
|
11389
11402
|
let t = Date.now() + qf;
|
|
11390
11403
|
for (; Date.now() < t && (await Promise.race([Ee.value.getRunningTurns(o.value, [e]).catch(() => []), new Promise((t) => setTimeout(() => t([e]), Yf))])).includes(e);) await new Promise((e) => setTimeout(e, Jf));
|
|
11391
|
-
if (e !== F.value ||
|
|
11392
|
-
let n =
|
|
11393
|
-
n &&
|
|
11404
|
+
if (e !== F.value || sn()) return;
|
|
11405
|
+
let n = Ut(e);
|
|
11406
|
+
n && Cn(n);
|
|
11394
11407
|
} finally {
|
|
11395
|
-
|
|
11408
|
+
un.delete(e);
|
|
11396
11409
|
}
|
|
11397
11410
|
}
|
|
11398
11411
|
}
|
|
11399
11412
|
}
|
|
11400
|
-
let
|
|
11401
|
-
async function
|
|
11402
|
-
if (fe.value ||
|
|
11403
|
-
let e = F.value, t =
|
|
11413
|
+
let fn = 0, pn = 0;
|
|
11414
|
+
async function mn() {
|
|
11415
|
+
if (fe.value || on()) return "indeterminate";
|
|
11416
|
+
let e = F.value, t = fn += 1;
|
|
11404
11417
|
try {
|
|
11405
11418
|
let n = await Ee.value.getChat(o.value, e);
|
|
11406
|
-
if (!n || e !== F.value ||
|
|
11407
|
-
|
|
11419
|
+
if (!n || e !== F.value || on() || t <= pn) return "indeterminate";
|
|
11420
|
+
pn = t;
|
|
11408
11421
|
let r = n.messages, i = Vf(r, Z.value.messages);
|
|
11409
11422
|
return Z.value.messages = [...r, ...i], we.value = n.blocked ?? !1, i.length > 0 ? "pending" : "caught-up";
|
|
11410
11423
|
} catch {}
|
|
11411
11424
|
return "indeterminate";
|
|
11412
11425
|
}
|
|
11413
|
-
function
|
|
11426
|
+
function hn(e) {
|
|
11414
11427
|
Z.value.messages = [...Z.value.messages, e];
|
|
11415
11428
|
}
|
|
11416
|
-
async function
|
|
11429
|
+
async function gn(e) {
|
|
11417
11430
|
try {
|
|
11418
11431
|
wt.value = await Ee.value.getMessageFeedbacks(e);
|
|
11419
11432
|
} catch {
|
|
11420
11433
|
wt.value = [];
|
|
11421
11434
|
}
|
|
11422
11435
|
}
|
|
11423
|
-
function
|
|
11436
|
+
function _n(e) {
|
|
11424
11437
|
let t = wt.value.findIndex((t) => t.messageId === e.messageId);
|
|
11425
11438
|
t >= 0 ? wt.value[t] = e : wt.value.push(e);
|
|
11426
11439
|
}
|
|
11427
|
-
function
|
|
11440
|
+
function vn(e) {
|
|
11428
11441
|
let t = ut.value, n = t.findIndex((t) => t.id === e.id), r = Kt(e) ?? "", i = t.slice(0, n).reverse().find((e) => e.role === "user");
|
|
11429
11442
|
return {
|
|
11430
11443
|
userQuestion: Kt(i ?? e) ?? "",
|
|
11431
11444
|
assistantMessage: r
|
|
11432
11445
|
};
|
|
11433
11446
|
}
|
|
11434
|
-
async function
|
|
11447
|
+
async function yn(e, t) {
|
|
11435
11448
|
await Promise.all([
|
|
11436
|
-
|
|
11437
|
-
|
|
11438
|
-
|
|
11449
|
+
tn(e, t),
|
|
11450
|
+
Jt(e),
|
|
11451
|
+
gn(t)
|
|
11439
11452
|
]), Oe.value || ai((e, t) => Ee.value.reverseGeocode(e, t, r.value)).then((e) => {
|
|
11440
11453
|
e && (Oe.value = e);
|
|
11441
11454
|
});
|
|
11442
11455
|
}
|
|
11443
|
-
async function
|
|
11456
|
+
async function bn() {
|
|
11444
11457
|
let e = Nt.value.trim(), t = Pt.value.filter((e) => e.state === "done" && e.mediaSource !== void 0).map((e) => ({
|
|
11445
11458
|
type: "file",
|
|
11446
11459
|
mediaType: e.mediaSource.mimeType,
|
|
@@ -11448,14 +11461,14 @@ function ep(e) {
|
|
|
11448
11461
|
filename: e.mediaSource.name,
|
|
11449
11462
|
providerMetadata: { "8bot": { media: e.mediaSource } }
|
|
11450
11463
|
})), n = xe.value ? ie.value : void 0;
|
|
11451
|
-
!fe.value &&
|
|
11464
|
+
!fe.value && sn() ? e && t.length === 0 && !n && (Ht(F.value, [...Bt.value, e]), Nt.value = "") : (fe.value && ut.value.length > 0 && await Wn(), Cn(e, t, n && { pagePointer: n }), Nt.value = "", ie.value = void 0, Un());
|
|
11452
11465
|
}
|
|
11453
|
-
function
|
|
11466
|
+
function xn(e, t) {
|
|
11454
11467
|
let n = e.trim();
|
|
11455
|
-
return !n || we.value ||
|
|
11468
|
+
return !n || we.value || sn() || Z.value.status !== "ready" ? !1 : (Cn(n, [], t, { toInput: !1 }), !0);
|
|
11456
11469
|
}
|
|
11457
|
-
function
|
|
11458
|
-
Be(), Ft.value =
|
|
11470
|
+
function Cn(e, t = [], n, { toInput: r = !0 } = {}) {
|
|
11471
|
+
Be(), Ft.value = e, It.value = r, Lt.value = r && n && "pagePointer" in n ? n.pagePointer : void 0, Rt.value = Z.value.messages.length;
|
|
11459
11472
|
let i = Z.value.sendMessage;
|
|
11460
11473
|
i({
|
|
11461
11474
|
text: e,
|
|
@@ -11463,7 +11476,7 @@ function ep(e) {
|
|
|
11463
11476
|
...n && { metadata: n }
|
|
11464
11477
|
});
|
|
11465
11478
|
}
|
|
11466
|
-
function
|
|
11479
|
+
function wn(e) {
|
|
11467
11480
|
let t = e.trim();
|
|
11468
11481
|
if (!t) return;
|
|
11469
11482
|
if (Z.value.status !== "ready") {
|
|
@@ -11473,25 +11486,25 @@ function ep(e) {
|
|
|
11473
11486
|
let n = Z.value.sendMessage;
|
|
11474
11487
|
Be(), n({ text: t });
|
|
11475
11488
|
}
|
|
11476
|
-
async function
|
|
11477
|
-
let e = Z.value.messages.slice(
|
|
11489
|
+
async function Tn() {
|
|
11490
|
+
let e = Z.value.messages.slice(Rt.value).some((e) => e.parts.some($e)), t = Ft.value, n = It.value, r = Lt.value, i = t.length > 0 && !e, a = F.value, s = Rt.value, c = We?.chatId === a, l = Ke, u = Ut(a), d = (e = "") => {
|
|
11478
11491
|
Nt.value = [
|
|
11479
11492
|
e,
|
|
11480
|
-
|
|
11493
|
+
u,
|
|
11481
11494
|
Nt.value
|
|
11482
11495
|
].filter(Boolean).join(Xf);
|
|
11483
|
-
},
|
|
11496
|
+
}, f = () => a === F.value && !on() && Rt.value === s ? !1 : (u && Ht(a, [u, ...zt.value[a] ?? []]), !0);
|
|
11484
11497
|
We = void 0, Ge.value = void 0, Be(), await Z.value.stop();
|
|
11485
|
-
let
|
|
11486
|
-
if (!
|
|
11487
|
-
if (
|
|
11488
|
-
if (await
|
|
11489
|
-
if (
|
|
11490
|
-
Ft.value = "",
|
|
11498
|
+
let p = fe.value || e && !c || await Ee.value.stopChatTurn(o.value, a, l).catch(() => !0);
|
|
11499
|
+
if (!f()) {
|
|
11500
|
+
if (c || !p) {
|
|
11501
|
+
if (await mn(), f()) return;
|
|
11502
|
+
if (c || Z.value.messages.length > Rt.value) {
|
|
11503
|
+
Ft.value = "", d();
|
|
11491
11504
|
return;
|
|
11492
11505
|
}
|
|
11493
11506
|
}
|
|
11494
|
-
|
|
11507
|
+
i ? (d(n ? t : ""), ie.value ??= r, Z.value.messages = Z.value.messages.slice(0, Rt.value), Ft.value = "") : d();
|
|
11495
11508
|
}
|
|
11496
11509
|
}
|
|
11497
11510
|
j(() => Z.value.messages, (e) => {
|
|
@@ -11500,92 +11513,92 @@ function ep(e) {
|
|
|
11500
11513
|
}), j(() => Z.value.status, (e) => {
|
|
11501
11514
|
e === "submitted" && (le.value++, Ke = void 0);
|
|
11502
11515
|
});
|
|
11503
|
-
let
|
|
11516
|
+
let En;
|
|
11504
11517
|
j(() => [
|
|
11505
11518
|
Z.value.status,
|
|
11506
11519
|
w.value,
|
|
11507
11520
|
te.value
|
|
11508
11521
|
], ([e, t, n]) => {
|
|
11509
|
-
clearTimeout(
|
|
11522
|
+
clearTimeout(En), e === "ready" && t === 0 && n === 0 && (En = setTimeout(() => {
|
|
11510
11523
|
ce.value = !1;
|
|
11511
11524
|
}, 1500));
|
|
11512
11525
|
});
|
|
11513
|
-
let
|
|
11514
|
-
j(() => !Ae.value && !Lf(ot()) && (
|
|
11515
|
-
clearTimeout(
|
|
11516
|
-
|
|
11526
|
+
let On = z(!1), kn;
|
|
11527
|
+
j(() => !Ae.value && !Lf(ot()) && (on() || w.value > 0), (e) => {
|
|
11528
|
+
clearTimeout(kn), e ? On.value = !0 : kn = setTimeout(() => {
|
|
11529
|
+
On.value = !1;
|
|
11517
11530
|
}, 400);
|
|
11518
11531
|
}, { immediate: !0 });
|
|
11519
|
-
let
|
|
11532
|
+
let An = B(() => {
|
|
11520
11533
|
let e = Je.value.filter((e) => e !== F.value);
|
|
11521
|
-
return
|
|
11522
|
-
}),
|
|
11523
|
-
function
|
|
11524
|
-
clearTimeout(
|
|
11525
|
-
|
|
11534
|
+
return On.value || Ge.value === F.value ? [...e, F.value] : e;
|
|
11535
|
+
}), jn = () => [.../* @__PURE__ */ new Set([...Je.value, ...Ye.value])], Mn = Sn(), Nn, Pn = 0, Fn = 0;
|
|
11536
|
+
function In() {
|
|
11537
|
+
clearTimeout(Nn), Nn = void 0, jn().length !== 0 && Mn.value === "visible" && (Nn = setTimeout(() => {
|
|
11538
|
+
Nn = void 0, Ln(jn());
|
|
11526
11539
|
}, Wf));
|
|
11527
11540
|
}
|
|
11528
|
-
async function
|
|
11541
|
+
async function Ln(e) {
|
|
11529
11542
|
let t = e.slice(0, Gf);
|
|
11530
11543
|
if (fe.value || t.length === 0) {
|
|
11531
|
-
|
|
11544
|
+
In();
|
|
11532
11545
|
return;
|
|
11533
11546
|
}
|
|
11534
|
-
let n =
|
|
11547
|
+
let n = Pn += 1, r;
|
|
11535
11548
|
try {
|
|
11536
11549
|
r = await Ee.value.getRunningTurns(o.value, t);
|
|
11537
11550
|
} catch {
|
|
11538
|
-
|
|
11551
|
+
In();
|
|
11539
11552
|
return;
|
|
11540
11553
|
}
|
|
11541
|
-
if (n <=
|
|
11542
|
-
|
|
11554
|
+
if (n <= Fn) return;
|
|
11555
|
+
Fn = n;
|
|
11543
11556
|
for (let e of r) et.add(e);
|
|
11544
|
-
let i = new Set(t), a =
|
|
11557
|
+
let i = new Set(t), a = jn().filter((e) => i.has(e) && !r.includes(e)), s = (e) => Ye.value.includes(e) && !et.has(e), c = a.filter((e) => s(e) && Date.now() - (Qe.get(e) ?? 0) > Kf), l = a.filter((e) => !s(e));
|
|
11545
11558
|
Je.value = [...Je.value.filter((e) => !i.has(e)), ...r];
|
|
11546
11559
|
let u = l.filter((e) => Ye.value.includes(e));
|
|
11547
|
-
(u.length > 0 || c.length > 0) && (Ye.value = Ye.value.filter((e) => !u.includes(e) && !c.includes(e)), Xe.value = [...Xe.value, ...u.filter((e) => e !== F.value && !Xe.value.includes(e))]), l.length > 0 &&
|
|
11560
|
+
(u.length > 0 || c.length > 0) && (Ye.value = Ye.value.filter((e) => !u.includes(e) && !c.includes(e)), Xe.value = [...Xe.value, ...u.filter((e) => e !== F.value && !Xe.value.includes(e))]), l.length > 0 && Jt(o.value), In();
|
|
11548
11561
|
}
|
|
11549
|
-
j(
|
|
11550
|
-
e === "visible" ?
|
|
11551
|
-
}), je(() => clearTimeout(
|
|
11552
|
-
let
|
|
11562
|
+
j(Mn, (e) => {
|
|
11563
|
+
e === "visible" ? Ln(jn()) : (clearTimeout(Nn), Nn = void 0);
|
|
11564
|
+
}), je(() => clearTimeout(Nn));
|
|
11565
|
+
let Rn = B(() => Xe.value.map((e) => ({
|
|
11553
11566
|
chatId: e,
|
|
11554
11567
|
title: ft.value.find((t) => t.id === e)?.title || Ze.value[e] || void 0
|
|
11555
11568
|
})));
|
|
11556
|
-
function Rn(e) {
|
|
11557
|
-
it(e), F.value = e, lr("chat");
|
|
11558
|
-
}
|
|
11559
11569
|
function zn(e) {
|
|
11570
|
+
it(e), F.value = e, fr("chat");
|
|
11571
|
+
}
|
|
11572
|
+
function Vn(e) {
|
|
11560
11573
|
Xe.value = Xe.value.filter((t) => t !== e), rt(e);
|
|
11561
11574
|
}
|
|
11562
11575
|
j(() => [Z.value.status, Z.value.id], ([e, t], [n, r]) => {
|
|
11563
11576
|
if (t === r) {
|
|
11564
|
-
if (e === "error") We?.chatId !== F.value && Ut(
|
|
11577
|
+
if (e === "error") We?.chatId !== F.value && Wt(Ut(F.value));
|
|
11565
11578
|
else if (e === "ready" && (n === "streaming" || n === "submitted")) {
|
|
11566
|
-
if (
|
|
11567
|
-
Ut(
|
|
11579
|
+
if (ln()) {
|
|
11580
|
+
Wt(Ut(F.value));
|
|
11568
11581
|
return;
|
|
11569
11582
|
}
|
|
11570
|
-
|
|
11583
|
+
dn();
|
|
11571
11584
|
}
|
|
11572
11585
|
}
|
|
11573
11586
|
}), j(w, (e) => {
|
|
11574
|
-
e === 0 && Z.value.status === "ready" &&
|
|
11587
|
+
e === 0 && Z.value.status === "ready" && dn();
|
|
11575
11588
|
}), j(() => Z.value.status, (e) => {
|
|
11576
11589
|
e === "ready" && Ft.value.length > 0 && (Ft.value = "");
|
|
11577
11590
|
});
|
|
11578
|
-
function
|
|
11591
|
+
function Un(e = !1) {
|
|
11579
11592
|
for (let t of Pt.value) (e || t.state !== "done") && URL.revokeObjectURL(t.localUrl);
|
|
11580
|
-
Pt.value = [],
|
|
11593
|
+
Pt.value = [], $n.value = null;
|
|
11581
11594
|
}
|
|
11582
|
-
async function
|
|
11583
|
-
return Ft.value = "", oe.value = {}, se.value = {}, F.value = Fl(), await k(), Z.value.clearError(), Ce.value = void 0, we.value = !1,
|
|
11595
|
+
async function Wn() {
|
|
11596
|
+
return Ft.value = "", oe.value = {}, se.value = {}, F.value = Fl(), await k(), Z.value.clearError(), Ce.value = void 0, we.value = !1, Un(!0), fr("chat"), F.value;
|
|
11584
11597
|
}
|
|
11585
|
-
async function
|
|
11586
|
-
Z.value.status !== "ready" && (Ft.value = "", await
|
|
11598
|
+
async function Gn(e) {
|
|
11599
|
+
Z.value.status !== "ready" && (Ft.value = "", await Tn()), Be(), await Z.value.regenerate(e);
|
|
11587
11600
|
}
|
|
11588
|
-
function
|
|
11601
|
+
function Kn(e) {
|
|
11589
11602
|
if (e.tool === "requestGeolocation") {
|
|
11590
11603
|
let t = e.output;
|
|
11591
11604
|
"latitude" in t && (Oe.value = {
|
|
@@ -11597,23 +11610,23 @@ function ep(e) {
|
|
|
11597
11610
|
}
|
|
11598
11611
|
Z.value.addToolOutput(e);
|
|
11599
11612
|
}
|
|
11600
|
-
function
|
|
11613
|
+
function qn(e) {
|
|
11601
11614
|
Z.value.addToolApprovalResponse(e);
|
|
11602
11615
|
}
|
|
11603
|
-
let
|
|
11604
|
-
|
|
11616
|
+
let Jn = B(() => Z.value.messages.reduce((e, t) => e + t.parts.filter((e) => e.type === "file").length, 0)), Yn = B(() => _.value?.maxFilesPerMessage ?? 5), Xn = B(() => _.value?.maxFilesPerChat ?? 20), Zn = B(() => Math.max(0, Math.min(Yn.value - Pt.value.length, Xn.value - Jn.value - Pt.value.length))), Qn = B(() => Zn.value <= 0), $n = z(null), er = () => {
|
|
11617
|
+
$n.value = null;
|
|
11605
11618
|
};
|
|
11606
|
-
j(
|
|
11607
|
-
e || (
|
|
11619
|
+
j(Qn, (e) => {
|
|
11620
|
+
e || ($n.value = null);
|
|
11608
11621
|
});
|
|
11609
|
-
async function
|
|
11610
|
-
if (
|
|
11611
|
-
|
|
11622
|
+
async function tr(e) {
|
|
11623
|
+
if (Qn.value) {
|
|
11624
|
+
$n.value = Xn.value - Jn.value - Pt.value.length <= Yn.value - Pt.value.length ? {
|
|
11612
11625
|
reason: "per-chat",
|
|
11613
|
-
max:
|
|
11626
|
+
max: Xn.value
|
|
11614
11627
|
} : {
|
|
11615
11628
|
reason: "per-message",
|
|
11616
|
-
max:
|
|
11629
|
+
max: Yn.value
|
|
11617
11630
|
};
|
|
11618
11631
|
return;
|
|
11619
11632
|
}
|
|
@@ -11626,6 +11639,10 @@ function ep(e) {
|
|
|
11626
11639
|
Pt.value = [...Pt.value, n];
|
|
11627
11640
|
try {
|
|
11628
11641
|
let n = await Ee.value.uploadMedia(o.value, F.value, e);
|
|
11642
|
+
if (!Pt.value.some((e) => e.id === t)) {
|
|
11643
|
+
await rr(n);
|
|
11644
|
+
return;
|
|
11645
|
+
}
|
|
11629
11646
|
Pt.value = Pt.value.map((e) => e.id === t ? {
|
|
11630
11647
|
...e,
|
|
11631
11648
|
state: "done",
|
|
@@ -11640,9 +11657,17 @@ function ep(e) {
|
|
|
11640
11657
|
} : e);
|
|
11641
11658
|
}
|
|
11642
11659
|
}
|
|
11643
|
-
async function
|
|
11644
|
-
|
|
11645
|
-
|
|
11660
|
+
async function nr(e) {
|
|
11661
|
+
e.mediaSource && await rr(e.mediaSource);
|
|
11662
|
+
}
|
|
11663
|
+
async function rr(e) {
|
|
11664
|
+
try {
|
|
11665
|
+
await Ee.value.discardMedia(e);
|
|
11666
|
+
} catch {}
|
|
11667
|
+
}
|
|
11668
|
+
async function ir(e, t) {
|
|
11669
|
+
let { userQuestion: n, assistantMessage: r } = vn(e);
|
|
11670
|
+
_n(await Ee.value.submitMessageFeedback({
|
|
11646
11671
|
messageId: e.id,
|
|
11647
11672
|
chatId: F.value,
|
|
11648
11673
|
agentId: o.value,
|
|
@@ -11651,34 +11676,34 @@ function ep(e) {
|
|
|
11651
11676
|
assistantMessage: r
|
|
11652
11677
|
}));
|
|
11653
11678
|
}
|
|
11654
|
-
async function
|
|
11655
|
-
await
|
|
11679
|
+
async function ar(e) {
|
|
11680
|
+
await ir(e, "upvote");
|
|
11656
11681
|
}
|
|
11657
|
-
async function
|
|
11658
|
-
await
|
|
11682
|
+
async function or(e) {
|
|
11683
|
+
await ir(e, "downvote");
|
|
11659
11684
|
}
|
|
11660
|
-
function
|
|
11685
|
+
function sr(e) {
|
|
11661
11686
|
Ot.value = !1, kt.value = void 0, Tt.value = e;
|
|
11662
11687
|
}
|
|
11663
|
-
async function
|
|
11688
|
+
async function cr(e) {
|
|
11664
11689
|
if (Tt.value) try {
|
|
11665
11690
|
Et.value = !0, Ot.value = !1, kt.value = void 0;
|
|
11666
|
-
let { userQuestion: t, assistantMessage: n } =
|
|
11667
|
-
|
|
11691
|
+
let { userQuestion: t, assistantMessage: n } = vn(Tt.value);
|
|
11692
|
+
_n(await Ee.value.submitMessageFeedback({
|
|
11668
11693
|
messageId: Tt.value.id,
|
|
11669
11694
|
chatId: F.value,
|
|
11670
11695
|
agentId: o.value,
|
|
11671
11696
|
userQuestion: t,
|
|
11672
11697
|
assistantMessage: n,
|
|
11673
11698
|
comment: e
|
|
11674
|
-
})), Ot.value = !0, await
|
|
11699
|
+
})), Ot.value = !0, await gn(F.value);
|
|
11675
11700
|
} catch {
|
|
11676
11701
|
kt.value = n("message.feedbackSubmitError") ? t("message.feedbackSubmitError") : "Failed to submit feedback";
|
|
11677
11702
|
} finally {
|
|
11678
11703
|
Et.value = !1;
|
|
11679
11704
|
}
|
|
11680
11705
|
}
|
|
11681
|
-
async function
|
|
11706
|
+
async function lr(e) {
|
|
11682
11707
|
try {
|
|
11683
11708
|
jt.value = !0, At.value = !1, Mt.value = void 0, await Ee.value.submitLead({
|
|
11684
11709
|
agentId: o.value,
|
|
@@ -11691,33 +11716,33 @@ function ep(e) {
|
|
|
11691
11716
|
jt.value = !1;
|
|
11692
11717
|
}
|
|
11693
11718
|
}
|
|
11694
|
-
async function
|
|
11719
|
+
async function ur(e, t) {
|
|
11695
11720
|
let n = await Ee.value.updateChatTitle(o.value, e, t);
|
|
11696
11721
|
ft.value = ft.value.map((t) => t.id === e ? {
|
|
11697
11722
|
...t,
|
|
11698
11723
|
title: n.title
|
|
11699
11724
|
} : t);
|
|
11700
11725
|
}
|
|
11701
|
-
async function
|
|
11702
|
-
await Ee.value.deleteChat(o.value, e), ft.value = ft.value.filter((t) => t.id !== e), F.value === e && await
|
|
11726
|
+
async function dr(e) {
|
|
11727
|
+
await Ee.value.deleteChat(o.value, e), ft.value = ft.value.filter((t) => t.id !== e), F.value === e && await Wn();
|
|
11703
11728
|
}
|
|
11704
|
-
function
|
|
11729
|
+
function fr(e) {
|
|
11705
11730
|
St.value = e;
|
|
11706
11731
|
}
|
|
11707
|
-
function
|
|
11708
|
-
|
|
11732
|
+
function pr() {
|
|
11733
|
+
fr("chat"), Ct.value++;
|
|
11709
11734
|
}
|
|
11710
|
-
let
|
|
11711
|
-
function
|
|
11735
|
+
let mr;
|
|
11736
|
+
function hr(e) {
|
|
11712
11737
|
let t = () => Ee.value.getChat(o.value, e).then((e) => e !== null);
|
|
11713
11738
|
return t().catch(() => t().catch(() => !1));
|
|
11714
11739
|
}
|
|
11715
11740
|
return j(l, async (e) => {
|
|
11716
|
-
if (!e || e ===
|
|
11717
|
-
let t =
|
|
11718
|
-
if (
|
|
11719
|
-
let n = F.value, r = !fe.value && await
|
|
11720
|
-
l.value === e && F.value === n && (r ?
|
|
11741
|
+
if (!e || e === mr) return;
|
|
11742
|
+
let t = mr;
|
|
11743
|
+
if (mr = e, t === void 0) return;
|
|
11744
|
+
let n = F.value, r = !fe.value && await hr(n);
|
|
11745
|
+
l.value === e && F.value === n && (r ? Jt(o.value) : (ft.value = [], wt.value = [], bt.value = [], Je.value = [], Ye.value = [], Xe.value = [], Ze.value = {}, await Wn(), Nt.value = ""));
|
|
11721
11746
|
}), {
|
|
11722
11747
|
apiClient: Ee,
|
|
11723
11748
|
baseUrl: i,
|
|
@@ -11749,7 +11774,7 @@ function ep(e) {
|
|
|
11749
11774
|
hostStepTitles: oe,
|
|
11750
11775
|
hostStepChanges: se,
|
|
11751
11776
|
pageControlActive: ce,
|
|
11752
|
-
isWorking:
|
|
11777
|
+
isWorking: On,
|
|
11753
11778
|
stopHostActions: X,
|
|
11754
11779
|
voicePageTools: Y,
|
|
11755
11780
|
cancelVoicePageCalls: ze,
|
|
@@ -11762,7 +11787,7 @@ function ep(e) {
|
|
|
11762
11787
|
setPageAccessOff: He,
|
|
11763
11788
|
agentConfirmations: E,
|
|
11764
11789
|
agentSelectionActions: ne,
|
|
11765
|
-
sendSelection:
|
|
11790
|
+
sendSelection: xn,
|
|
11766
11791
|
confirmationsAvailable: ve,
|
|
11767
11792
|
confirmationMode: ye,
|
|
11768
11793
|
setConfirmationMode: be,
|
|
@@ -11783,20 +11808,20 @@ function ep(e) {
|
|
|
11783
11808
|
isLoadingChatFiles: xt,
|
|
11784
11809
|
input: Nt,
|
|
11785
11810
|
pendingAttachments: Pt,
|
|
11786
|
-
isAttachmentLimitReached:
|
|
11787
|
-
fileLimitError:
|
|
11811
|
+
isAttachmentLimitReached: Qn,
|
|
11812
|
+
fileLimitError: $n,
|
|
11788
11813
|
localChatId: F,
|
|
11789
11814
|
isConversationBlocked: we,
|
|
11790
11815
|
inputMessagePlaceholder: dt,
|
|
11791
11816
|
chatError: Ce,
|
|
11792
|
-
runningChatIds:
|
|
11793
|
-
backgroundAnswers:
|
|
11794
|
-
openBackgroundAnswer:
|
|
11795
|
-
dismissBackgroundAnswer:
|
|
11796
|
-
canQueue:
|
|
11797
|
-
queuedMessages:
|
|
11798
|
-
removeQueuedMessage:
|
|
11799
|
-
editQueuedMessage:
|
|
11817
|
+
runningChatIds: An,
|
|
11818
|
+
backgroundAnswers: Rn,
|
|
11819
|
+
openBackgroundAnswer: zn,
|
|
11820
|
+
dismissBackgroundAnswer: Vn,
|
|
11821
|
+
canQueue: Vt,
|
|
11822
|
+
queuedMessages: Bt,
|
|
11823
|
+
removeQueuedMessage: Gt,
|
|
11824
|
+
editQueuedMessage: qt,
|
|
11800
11825
|
activeView: St,
|
|
11801
11826
|
inputFocusRequest: Ct,
|
|
11802
11827
|
messageFeedbacks: wt,
|
|
@@ -11808,35 +11833,36 @@ function ep(e) {
|
|
|
11808
11833
|
isLoadingSubmitLead: jt,
|
|
11809
11834
|
submitLeadError: Mt,
|
|
11810
11835
|
buildDeviceContext: ke,
|
|
11811
|
-
initialize:
|
|
11812
|
-
loadConversations:
|
|
11813
|
-
loadMoreConversations:
|
|
11814
|
-
searchConversations:
|
|
11815
|
-
loadChatFiles:
|
|
11816
|
-
refreshMessages:
|
|
11817
|
-
appendMessage:
|
|
11818
|
-
getChatFileUrl:
|
|
11819
|
-
getChatFilePreviewUrl:
|
|
11820
|
-
deleteChatFile:
|
|
11821
|
-
handleSubmit:
|
|
11822
|
-
sendMessage:
|
|
11823
|
-
stopGeneration:
|
|
11824
|
-
startNewChat:
|
|
11825
|
-
regenerate:
|
|
11826
|
-
addToolOutput:
|
|
11827
|
-
addToolApprovalResponse:
|
|
11828
|
-
handleFileSelect:
|
|
11829
|
-
|
|
11830
|
-
|
|
11831
|
-
|
|
11832
|
-
|
|
11833
|
-
|
|
11834
|
-
|
|
11835
|
-
|
|
11836
|
-
|
|
11837
|
-
|
|
11838
|
-
|
|
11839
|
-
|
|
11836
|
+
initialize: yn,
|
|
11837
|
+
loadConversations: Jt,
|
|
11838
|
+
loadMoreConversations: Yt,
|
|
11839
|
+
searchConversations: Xt,
|
|
11840
|
+
loadChatFiles: Zt,
|
|
11841
|
+
refreshMessages: mn,
|
|
11842
|
+
appendMessage: hn,
|
|
11843
|
+
getChatFileUrl: Qt,
|
|
11844
|
+
getChatFilePreviewUrl: $t,
|
|
11845
|
+
deleteChatFile: en,
|
|
11846
|
+
handleSubmit: bn,
|
|
11847
|
+
sendMessage: wn,
|
|
11848
|
+
stopGeneration: Tn,
|
|
11849
|
+
startNewChat: Wn,
|
|
11850
|
+
regenerate: Gn,
|
|
11851
|
+
addToolOutput: Kn,
|
|
11852
|
+
addToolApprovalResponse: qn,
|
|
11853
|
+
handleFileSelect: tr,
|
|
11854
|
+
discardPendingAttachment: nr,
|
|
11855
|
+
clearFileLimitError: er,
|
|
11856
|
+
clearPendingAttachments: Un,
|
|
11857
|
+
onUpvote: ar,
|
|
11858
|
+
onDownvote: or,
|
|
11859
|
+
onFeedback: sr,
|
|
11860
|
+
onFeedbackSubmit: cr,
|
|
11861
|
+
onLeadSubmit: lr,
|
|
11862
|
+
navigate: fr,
|
|
11863
|
+
focusInput: pr,
|
|
11864
|
+
renameChatTitle: ur,
|
|
11865
|
+
deleteChat: dr
|
|
11840
11866
|
};
|
|
11841
11867
|
})();
|
|
11842
11868
|
}
|
|
@@ -15710,21 +15736,21 @@ var vy = ["datetime"], yy = 6e4, by = /* @__PURE__ */ q({
|
|
|
15710
15736
|
V();
|
|
15711
15737
|
var xy = {
|
|
15712
15738
|
requestOAuthConnection: T(() => import("./_chunks/PkToolRequestOAuthConnection-CoK7s1HA.js")),
|
|
15713
|
-
shareDocument: T(() => import("./_chunks/PkToolShareDocument-
|
|
15714
|
-
showArtifact: T(() => import("./_chunks/PkToolShowArtifact-
|
|
15739
|
+
shareDocument: T(() => import("./_chunks/PkToolShareDocument-lTHNZodf.js")),
|
|
15740
|
+
showArtifact: T(() => import("./_chunks/PkToolShowArtifact-BNQrM5fY.js")),
|
|
15715
15741
|
showCalendarEvent: T(() => import("./_chunks/PkToolShowCalendarEvent-Cq_ApwVL.js")),
|
|
15716
15742
|
showComparison: T(() => import("./_chunks/PkToolShowComparison-CmIDi-5O.js")),
|
|
15717
|
-
showContactForm: T(() => import("./_chunks/PkToolShowContactForm-
|
|
15718
|
-
showDiagram: T(() => import("./_chunks/PkToolShowDiagram-
|
|
15743
|
+
showContactForm: T(() => import("./_chunks/PkToolShowContactForm-CvQoLumn.js")),
|
|
15744
|
+
showDiagram: T(() => import("./_chunks/PkToolShowDiagram-COt1Z3q9.js")),
|
|
15719
15745
|
showEmail: T(() => import("./_chunks/PkToolShowEmail-Cdwe_01-.js")),
|
|
15720
|
-
showImageGallery: T(() => import("./_chunks/PkToolShowImageGallery-
|
|
15746
|
+
showImageGallery: T(() => import("./_chunks/PkToolShowImageGallery-DefXra8-.js")),
|
|
15721
15747
|
showLocation: T(() => import("./_chunks/PkToolShowLocation-7Uqe4JnF.js")),
|
|
15722
15748
|
showMessage: T(() => import("./_chunks/PkToolShowMessage-BPugVukY.js")),
|
|
15723
|
-
showForm: T(() => import("./_chunks/PkToolShowForm-
|
|
15724
|
-
showMultipleChoice: T(() => import("./_chunks/PkToolShowForm-
|
|
15749
|
+
showForm: T(() => import("./_chunks/PkToolShowForm-DcPccCEU.js")),
|
|
15750
|
+
showMultipleChoice: T(() => import("./_chunks/PkToolShowForm-DcPccCEU.js")),
|
|
15725
15751
|
showProductList: T(() => import("./_chunks/PkToolShowProductList-D6Df6dtq.js")),
|
|
15726
15752
|
showQrCode: T(() => import("./_chunks/PkToolShowQrCode-QcJxu2vI.js")),
|
|
15727
|
-
showSources: T(() => import("./_chunks/PkToolShowSources-
|
|
15753
|
+
showSources: T(() => import("./_chunks/PkToolShowSources-BE3Zv_uz.js")),
|
|
15728
15754
|
showSuggestedReply: T(() => import("./_chunks/PkToolShowSuggestedReply-B-s_ERZF.js")),
|
|
15729
15755
|
showVideo: T(() => import("./_chunks/PkToolShowVideo-CKpJ1O7O.js")),
|
|
15730
15756
|
showWeather: T(() => import("./_chunks/PkToolShowWeather-B9HWOU7p.js")),
|
|
@@ -17456,6 +17482,7 @@ var zx = { class: "pk-chatbot-input" }, Bx = {
|
|
|
17456
17482
|
"submit",
|
|
17457
17483
|
"stop-generation",
|
|
17458
17484
|
"file-select",
|
|
17485
|
+
"remove-attachment",
|
|
17459
17486
|
"dismiss-attachment-notice",
|
|
17460
17487
|
"dismiss-page-notice",
|
|
17461
17488
|
"open-answer-notice",
|
|
@@ -17496,7 +17523,7 @@ var zx = { class: "pk-chatbot-input" }, Bx = {
|
|
|
17496
17523
|
ce(Array.from(t.files ?? [])), t.value = "";
|
|
17497
17524
|
}, de = (e) => {
|
|
17498
17525
|
let t = i.value.find((t) => t.id === e);
|
|
17499
|
-
t && URL.revokeObjectURL(t.localUrl), i.value = i.value.filter((t) => t.id !== e);
|
|
17526
|
+
t && (URL.revokeObjectURL(t.localUrl), i.value = i.value.filter((t) => t.id !== e), a("remove-attachment", t));
|
|
17500
17527
|
}, N = z(!0), fe = () => {
|
|
17501
17528
|
N.value = !1;
|
|
17502
17529
|
}, P = B(() => {
|
|
@@ -18312,7 +18339,7 @@ var jS = { class: "pk-chatbot-view-chat__input-stage" }, MS = {
|
|
|
18312
18339
|
"selection-action"
|
|
18313
18340
|
],
|
|
18314
18341
|
setup(e, { emit: t }) {
|
|
18315
|
-
let n = T(() => import("./_chunks/PkToolShowForm-
|
|
18342
|
+
let n = T(() => import("./_chunks/PkToolShowForm-DcPccCEU.js")), r = T(() => import("./_chunks/PkToolShowContactForm-CvQoLumn.js")), i = T(() => import("./_chunks/PkToolShowSuggestedReply-B-s_ERZF.js")), a = T(() => import("./_chunks/PkToolShowSources-BE3Zv_uz.js")), o = T(() => import("./_chunks/PkToolRequestGeolocation-CUXB6Lkw.js")), s = T(() => import("./_chunks/PkToolRequestOAuthConnection-CoK7s1HA.js")), c = T(() => import("./_chunks/PkToolShowLocation-7Uqe4JnF.js")), l = T(() => import("./_chunks/PkToolShowDiagram-COt1Z3q9.js")), u = T(() => import("./_chunks/PkToolChatFile-iE4ZokYD.js")), d = T(() => import("./_chunks/PkToolShareDocument-lTHNZodf.js")), f = T(() => import("./_chunks/PkFilePreview-BzNLupQS.js").then((e) => e.n)), p = T(() => import("./_chunks/PkFilePreviewDialog-BfZFgdOi.js")), m = e, h = t, g = ep(m.agentId), { agentInterface: _, agentFileUpload: v, agentType: y, agentVoice: b, actions: x, revisedAnswers: S, messages: C, chat: ee, messageFeedbacks: w, feedbackDialogMessage: E, isFeedbackSubmitting: ne, isFeedbackSubmitted: re, feedbackSubmitError: D, isLeadSubmitted: k, isLoadingSubmitLead: ie, submitLeadError: A, input: oe, inputMessagePlaceholder: se, isConversationBlocked: ce, baseUrl: le, pendingAttachments: ue, isAttachmentLimitReached: de, fileLimitError: N, apiClient: fe, isDark: P, hostToolsPending: pe, pageNoticeLevel: F, hostConfirmation: he, agentPageAccess: ge, hostStepTitles: ve, hostStepChanges: ye, confirmationMode: be, canQueue: xe, queuedMessages: L, backgroundAnswers: Se, inputFocusRequest: Ce, pagePointer: we, pagePointerAvailable: V, pagePointing: Te, agentSelectionActions: Ee } = Ar(g);
|
|
18316
18343
|
te(un, ve), te(sn, ye);
|
|
18317
18344
|
let De = me("inputEl");
|
|
18318
18345
|
j(Ce, () => {
|
|
@@ -18323,184 +18350,187 @@ var jS = { class: "pk-chatbot-view-chat__input-stage" }, MS = {
|
|
|
18323
18350
|
let Oe = B(() => we.value ? {
|
|
18324
18351
|
kind: we.value.kind,
|
|
18325
18352
|
label: we.value.label
|
|
18326
|
-
} : void 0), ke = B(() => y.value === "reasoning" ? void 0 : v.value), U = (e) => fe.value.getMediaDownloadUrl(m.agentId, g.localChatId, e), { handleSubmit: je, stopGeneration: Me, regenerate: Ne, onUpvote: Pe, onDownvote: Ie, onFeedback: q, onFeedbackSubmit: Le, onLeadSubmit: Re, startNewChat: ze, addToolOutput: Be, addToolApprovalResponse: He, handleFileSelect: Ue,
|
|
18353
|
+
} : void 0), ke = B(() => y.value === "reasoning" ? void 0 : v.value), U = (e) => fe.value.getMediaDownloadUrl(m.agentId, g.localChatId, e), { handleSubmit: je, stopGeneration: Me, regenerate: Ne, onUpvote: Pe, onDownvote: Ie, onFeedback: q, onFeedbackSubmit: Le, onLeadSubmit: Re, startNewChat: ze, addToolOutput: Be, addToolApprovalResponse: He, handleFileSelect: Ue, discardPendingAttachment: We, clearFileLimitError: Ge, refreshMessages: Ke, appendMessage: qe, closePageNotice: Je, respondHostConfirmation: Ye, editQueuedMessage: Ze, removeQueuedMessage: Qe, openBackgroundAnswer: $e, dismissBackgroundAnswer: et } = g, { t: tt } = Ve({ useScope: "global" }), nt = B(() => pe.value > 0), rt = B(() => nt.value && ee.value.status === "ready" ? "streaming" : ee.value.status), it = Vn(() => ge.value?.notice), at = B(() => F.value ? it.value || tt(`message.pageAccessNotice.${F.value}`) : void 0), Z = B(() => {
|
|
18327
18354
|
let e = N.value;
|
|
18328
|
-
if (e) return e.reason === "per-chat" ?
|
|
18329
|
-
}),
|
|
18355
|
+
if (e) return e.reason === "per-chat" ? tt("message.fileLimitPerChat", { max: e.max }) : tt("message.fileLimitPerMessage", { max: e.max });
|
|
18356
|
+
}), ot = B(() => Se.value.map(({ chatId: e, title: t }) => ({
|
|
18330
18357
|
id: e,
|
|
18331
|
-
text: t ?
|
|
18332
|
-
}))),
|
|
18333
|
-
On([
|
|
18358
|
+
text: t ? tt("message.backgroundAnswerReady", { title: t }) : tt("message.backgroundAnswerReadyUntitled")
|
|
18359
|
+
}))), st = Vn(() => _.value?.dismissableNotice), ct = B(() => C.value.some((e) => e.role === "user")), lt = B(() => m.modifier === "fullscreen" && !ct.value), ut = fp(_, () => m.userName), dt = me("chatViewEl"), ft = wS(), pt = B(() => !!ft?.value), mt = B(() => ft?.value ?? "body"), ht = z(0), gt = z(0);
|
|
18360
|
+
On([dt, B(() => ft?.value ?? void 0)], (e) => {
|
|
18334
18361
|
for (let t of e) {
|
|
18335
18362
|
let e = t.borderBoxSize?.[0]?.inlineSize ?? t.contentRect.width;
|
|
18336
|
-
t.target ===
|
|
18363
|
+
t.target === dt.value ? ht.value = e : gt.value = e;
|
|
18337
18364
|
}
|
|
18338
18365
|
}, { box: "border-box" });
|
|
18339
|
-
let
|
|
18366
|
+
let _t = B(() => ht.value + (pt.value ? gt.value : 0) >= IS), vt = B(() => ht.value > 0 && ht.value < 576), { target: yt, preview: bt, loading: xt, error: St, open: Ct, close: wt, reset: Tt } = AS((e) => fe.value.getChatFilePreview(m.agentId, g.localChatId, e)), Et = z({}), Dt = (e) => {
|
|
18340
18367
|
let t = (e) => e?.fileId ?? e?.storedFileName;
|
|
18341
|
-
return t(e) !== t(
|
|
18342
|
-
},
|
|
18343
|
-
|
|
18344
|
-
},
|
|
18368
|
+
return t(e) !== t(yt.value) && (Et.value = {}), Ct(e);
|
|
18369
|
+
}, Ot = z(!1), kt = B(() => !!yt.value && _t.value && !Ot.value), At = () => {
|
|
18370
|
+
wt(), Ot.value = !1;
|
|
18371
|
+
}, jt = /* @__PURE__ */ new Set([
|
|
18345
18372
|
"tool-editSpreadsheet",
|
|
18346
18373
|
"tool-editWordDocument",
|
|
18347
18374
|
"tool-createSpreadsheet",
|
|
18348
18375
|
"tool-createWordDocument"
|
|
18349
|
-
]),
|
|
18376
|
+
]), Mt = B(() => {
|
|
18350
18377
|
let e = /* @__PURE__ */ new Map();
|
|
18351
18378
|
for (let t of C.value) for (let n of t.parts) {
|
|
18352
18379
|
let { type: t, state: r, output: i } = n;
|
|
18353
|
-
if (
|
|
18380
|
+
if (jt.has(t) && r === "output-available" && i?.fileId && i.version && i.storedFileName) {
|
|
18354
18381
|
let t = e.get(i.fileId) ?? /* @__PURE__ */ new Map();
|
|
18355
18382
|
t.set(i.version, i.storedFileName), e.set(i.fileId, t);
|
|
18356
18383
|
}
|
|
18357
18384
|
}
|
|
18358
18385
|
for (let [t, n] of e) n.has(1) || n.set(1, t);
|
|
18359
18386
|
return e;
|
|
18360
|
-
}),
|
|
18361
|
-
let t =
|
|
18362
|
-
t && n &&
|
|
18387
|
+
}), Nt = B(() => [...Mt.value.get(yt.value?.fileId ?? "")?.keys() ?? []].sort((e, t) => e - t)), Pt = (e) => {
|
|
18388
|
+
let t = yt.value, n = Mt.value.get(t?.fileId ?? "")?.get(e);
|
|
18389
|
+
t && n && Dt({
|
|
18363
18390
|
...t,
|
|
18364
18391
|
version: e,
|
|
18365
18392
|
storedFileName: n
|
|
18366
18393
|
});
|
|
18367
|
-
},
|
|
18368
|
-
let e =
|
|
18369
|
-
return !!
|
|
18370
|
-
}),
|
|
18371
|
-
let e =
|
|
18372
|
-
e?.fileId && e.version && (
|
|
18394
|
+
}, Ft = B(() => {
|
|
18395
|
+
let e = yt.value, t = Nt.value;
|
|
18396
|
+
return !!Mn.value && !!e?.fileId && !!e.version && t.length > 0 && e.version < t[t.length - 1];
|
|
18397
|
+
}), It = () => {
|
|
18398
|
+
let e = yt.value;
|
|
18399
|
+
e?.fileId && e.version && (Mn.value?.({
|
|
18373
18400
|
fileId: e.fileId,
|
|
18374
18401
|
version: e.version,
|
|
18375
18402
|
filename: e.filename
|
|
18376
|
-
}),
|
|
18403
|
+
}), At());
|
|
18377
18404
|
};
|
|
18378
|
-
j(() => g.localChatId,
|
|
18379
|
-
let
|
|
18380
|
-
|
|
18381
|
-
|
|
18382
|
-
|
|
18405
|
+
j(() => g.localChatId, Tt), j(() => {
|
|
18406
|
+
let e = yt.value?.fileId;
|
|
18407
|
+
return e ? {
|
|
18408
|
+
fileId: e,
|
|
18409
|
+
newest: Math.max(0, ...Nt.value)
|
|
18410
|
+
} : void 0;
|
|
18411
|
+
}, (e, t) => {
|
|
18412
|
+
e && t && e.fileId === t.fileId && e.newest > t.newest && yt.value?.version === t.newest && Pt(e.newest);
|
|
18383
18413
|
});
|
|
18384
|
-
let
|
|
18414
|
+
let Lt = B(() => {
|
|
18385
18415
|
let e = ee.value?.status;
|
|
18386
|
-
if (!(ce.value || e === "submitted" || e === "streaming")) return
|
|
18387
|
-
}),
|
|
18416
|
+
if (!(ce.value || e === "submitted" || e === "streaming")) return yt.value?.kind === "word" ? Ee.value?.word : Ee.value?.excel;
|
|
18417
|
+
}), Rt = (e, t, n) => {
|
|
18388
18418
|
g.sendSelection(e, { filePointer: t }) && h("selection-action", {
|
|
18389
18419
|
surface: t.format === "docx" ? "word" : "excel",
|
|
18390
18420
|
action: n.id,
|
|
18391
18421
|
state: "chat",
|
|
18392
18422
|
size: String(n.size)
|
|
18393
18423
|
});
|
|
18394
|
-
},
|
|
18424
|
+
}, zt = async (e) => (await fe.value.expandSourceContext(m.agentId, e.documentId, e.chunkIndex)).content, Bt = async (e) => {
|
|
18395
18425
|
let t = await fe.value.downloadSourceDocument(m.agentId, e);
|
|
18396
18426
|
window.open(t.downloadUrl, "_blank");
|
|
18397
|
-
}, { isOverDropZone:
|
|
18427
|
+
}, { isOverDropZone: Ht } = Tn(dt, {
|
|
18398
18428
|
dataTypes: (e) => Xe(e, ke.value?.allowedMimeTypes ?? []),
|
|
18399
18429
|
onDrop: (e) => {
|
|
18400
18430
|
if (ke.value?.enabled && e) for (let t of e) Ue(t);
|
|
18401
18431
|
}
|
|
18402
|
-
}),
|
|
18432
|
+
}), Ut = z(!1), Wt = !1, Gt = z(!1), Kt = [
|
|
18403
18433
|
3e3,
|
|
18404
18434
|
5e3,
|
|
18405
18435
|
1e4
|
|
18406
|
-
],
|
|
18407
|
-
function
|
|
18408
|
-
clearTimeout(
|
|
18436
|
+
], qt, Jt, Yt = !1, Xt = 0, Zt = !1;
|
|
18437
|
+
function Qt() {
|
|
18438
|
+
clearTimeout(qt), qt = void 0, Jt = void 0, Yt = !1, Xt = 0, Gt.value = !1;
|
|
18409
18439
|
}
|
|
18410
|
-
function
|
|
18411
|
-
|
|
18412
|
-
|
|
18440
|
+
function en(e) {
|
|
18441
|
+
Wt || (clearTimeout(qt), qt = setTimeout(() => {
|
|
18442
|
+
tn();
|
|
18413
18443
|
}, e));
|
|
18414
18444
|
}
|
|
18415
|
-
async function
|
|
18416
|
-
if (
|
|
18417
|
-
|
|
18445
|
+
async function tn() {
|
|
18446
|
+
if (Wt || Zt) return;
|
|
18447
|
+
Zt = !0;
|
|
18418
18448
|
let e;
|
|
18419
18449
|
try {
|
|
18420
|
-
e = await
|
|
18450
|
+
e = await Ke();
|
|
18421
18451
|
} finally {
|
|
18422
|
-
|
|
18452
|
+
Zt = !1;
|
|
18423
18453
|
}
|
|
18424
|
-
if (
|
|
18425
|
-
if (e === "caught-up" && (
|
|
18426
|
-
|
|
18454
|
+
if (Wt) return;
|
|
18455
|
+
if (e === "caught-up" && (Gt.value = !1, Un()), an.isActive.value) {
|
|
18456
|
+
Jt = void 0, Yt = !1, Xt = 0, en(LS);
|
|
18427
18457
|
return;
|
|
18428
18458
|
}
|
|
18429
|
-
|
|
18430
|
-
let t = Date.now() -
|
|
18431
|
-
if (e === "caught-up" && t >= (
|
|
18432
|
-
|
|
18459
|
+
Jt === void 0 && (Jt = Date.now(), Yt = !!an.error.value);
|
|
18460
|
+
let t = Date.now() - Jt;
|
|
18461
|
+
if (e === "caught-up" && t >= (Yt ? zS : RS) || t >= BS) {
|
|
18462
|
+
Qt(), Wn();
|
|
18433
18463
|
return;
|
|
18434
18464
|
}
|
|
18435
|
-
let n =
|
|
18436
|
-
|
|
18465
|
+
let n = Kt[Math.min(Xt, Kt.length - 1)];
|
|
18466
|
+
Xt += 1, en(n);
|
|
18437
18467
|
}
|
|
18438
|
-
let
|
|
18439
|
-
|
|
18440
|
-
},
|
|
18468
|
+
let nn = (e = 1200) => {
|
|
18469
|
+
en(e);
|
|
18470
|
+
}, rn, an = SS({
|
|
18441
18471
|
fetchGrant: async () => {
|
|
18442
|
-
|
|
18472
|
+
rn = g.voicePageTools();
|
|
18443
18473
|
let e = await fe.value.createVoiceSession(m.agentId, g.localChatId, {
|
|
18444
18474
|
deviceContext: g.buildDeviceContext(),
|
|
18445
18475
|
externalContext: g.externalContext,
|
|
18446
|
-
pageTools:
|
|
18476
|
+
pageTools: rn?.declaration,
|
|
18447
18477
|
...g.confirmationMode === "automatic" && { confirmations: "automatic" }
|
|
18448
18478
|
});
|
|
18449
18479
|
return e.chatId !== g.localChatId && (g.localChatId = e.chatId), e;
|
|
18450
18480
|
},
|
|
18451
18481
|
closeGrant: (e) => fe.value.closeVoiceSession(m.agentId, e),
|
|
18452
|
-
clientTools: () =>
|
|
18482
|
+
clientTools: () => rn?.clientTools,
|
|
18453
18483
|
onTranscript: (e) => {
|
|
18454
|
-
e.role === "user" ? (
|
|
18484
|
+
e.role === "user" ? (Gt.value = !0, Hn(), qe({
|
|
18455
18485
|
id: `${Ff}user-${Fl()}`,
|
|
18456
18486
|
role: "user",
|
|
18457
18487
|
parts: [{
|
|
18458
18488
|
type: "text",
|
|
18459
18489
|
text: e.text
|
|
18460
18490
|
}]
|
|
18461
|
-
})) :
|
|
18491
|
+
})) : Gt.value = !1;
|
|
18462
18492
|
},
|
|
18463
18493
|
onTurnEnd: () => {
|
|
18464
|
-
|
|
18494
|
+
nn();
|
|
18465
18495
|
}
|
|
18466
18496
|
});
|
|
18467
|
-
j(() =>
|
|
18497
|
+
j(() => an.isActive.value, (e) => {
|
|
18468
18498
|
e || g.cancelVoicePageCalls();
|
|
18469
|
-
}), j(() =>
|
|
18470
|
-
e && (
|
|
18499
|
+
}), j(() => an.error.value, (e) => {
|
|
18500
|
+
e && (Gt.value = !1);
|
|
18471
18501
|
});
|
|
18472
|
-
let
|
|
18473
|
-
let e =
|
|
18474
|
-
if (e) return /took too long/i.test(e) ?
|
|
18475
|
-
}),
|
|
18476
|
-
|
|
18477
|
-
},
|
|
18478
|
-
|
|
18479
|
-
},
|
|
18480
|
-
|
|
18481
|
-
},
|
|
18482
|
-
|
|
18483
|
-
},
|
|
18484
|
-
|
|
18502
|
+
let cn = B(() => b.value?.enabled === !0), dn = B(() => an.error.value ? "error" : an.isConnecting.value ? "connecting" : an.isSpeaking.value ? "speaking" : an.isActive.value ? "listening" : "idle"), fn = B(() => {
|
|
18503
|
+
let e = an.error.value;
|
|
18504
|
+
if (e) return /took too long/i.test(e) ? tt("message.voiceTookTooLong") : /cascade|no response|custom_llm_error/i.test(e) ? tt("message.voiceNoAnswer") : tt("message.voiceInterrupted");
|
|
18505
|
+
}), pn = B(() => an.isSpeaking.value ? "output" : "input"), mn = () => an.readLevel(pn.value), hn = () => an.readSpectrum(pn.value), gn = async () => {
|
|
18506
|
+
Ut.value = !1, await an.start(), an.isActive.value && (Qt(), en(LS));
|
|
18507
|
+
}, _n = async () => {
|
|
18508
|
+
Gt.value = !1, await an.stop(), !Wt && nn(0);
|
|
18509
|
+
}, yn = () => {
|
|
18510
|
+
an.dismissError();
|
|
18511
|
+
}, bn = async () => {
|
|
18512
|
+
an.dismissError(), await an.stop(), await gn();
|
|
18513
|
+
}, xn = (e) => e?.toolCallId ?? "", Sn = z(/* @__PURE__ */ new Set()), Cn = (e) => Sn.value.has(xn(e)), wn = z(/* @__PURE__ */ new Map()), En = (e, t) => an.isActive.value ? (an.sendUserMessage(t) && (Sn.value = new Set(Sn.value).add(xn(e)), nn()), !0) : !1, Dn = (e, t, n) => {
|
|
18514
|
+
En(t, $t(t, n)) || Be({
|
|
18485
18515
|
tool: e,
|
|
18486
|
-
toolCallId:
|
|
18516
|
+
toolCallId: xn(t),
|
|
18487
18517
|
output: n
|
|
18488
18518
|
});
|
|
18489
|
-
},
|
|
18490
|
-
let t = e.confirmed ?
|
|
18491
|
-
|
|
18519
|
+
}, kn = (e) => {
|
|
18520
|
+
let t = e.confirmed ? tt("message.voiceConfirmed") : tt("message.voiceCancelled");
|
|
18521
|
+
En({ toolCallId: e.toolCallId }, t) ? Sn.value.has(e.toolCallId) && (wn.value = new Map(wn.value).set(e.toolCallId, e.confirmed)) : Be({
|
|
18492
18522
|
tool: "requestConfirm",
|
|
18493
18523
|
toolCallId: e.toolCallId,
|
|
18494
18524
|
output: e.confirmed ? "confirmed" : "cancelled"
|
|
18495
18525
|
});
|
|
18496
|
-
},
|
|
18526
|
+
}, An = B(() => {
|
|
18497
18527
|
let e = /* @__PURE__ */ new Map();
|
|
18498
18528
|
for (let t of C.value) for (let n of t.parts) {
|
|
18499
18529
|
let { type: t, state: r, output: i } = n;
|
|
18500
|
-
|
|
18530
|
+
jt.has(t) && r === "output-available" && i?.fileId && i.version && e.set(i.fileId, Math.max(e.get(i.fileId) ?? 0, i.version));
|
|
18501
18531
|
}
|
|
18502
18532
|
return e;
|
|
18503
|
-
}),
|
|
18533
|
+
}), jn = B(() => {
|
|
18504
18534
|
let e = /* @__PURE__ */ new Map(), t = (t, n) => {
|
|
18505
18535
|
if (t && n) {
|
|
18506
18536
|
let r = t.toLowerCase();
|
|
@@ -18513,62 +18543,62 @@ var jS = { class: "pk-chatbot-view-chat__input-stage" }, MS = {
|
|
|
18513
18543
|
continue;
|
|
18514
18544
|
}
|
|
18515
18545
|
let { type: e, state: r, output: i } = n;
|
|
18516
|
-
|
|
18546
|
+
jt.has(e) && r === "output-available" && i?.filename && t(on(i.filename, i.version), i.fileId);
|
|
18517
18547
|
}
|
|
18518
18548
|
return e;
|
|
18519
|
-
}),
|
|
18520
|
-
let t = (
|
|
18521
|
-
oe.value =
|
|
18522
|
-
}),
|
|
18523
|
-
|
|
18524
|
-
},
|
|
18525
|
-
let n = t.error ?
|
|
18526
|
-
|
|
18549
|
+
}), Mn = B(() => ce.value ? void 0 : (e) => {
|
|
18550
|
+
let t = (jn.value.get(e.filename.toLowerCase())?.size ?? 0) > 1;
|
|
18551
|
+
oe.value = tt(t ? "messagePart.chatFileRestoreRequestById" : "messagePart.chatFileRestoreRequest", e), je();
|
|
18552
|
+
}), Nn = (e, t) => {
|
|
18553
|
+
En(e, t) || (oe.value = t, je());
|
|
18554
|
+
}, Pn = (e, t) => {
|
|
18555
|
+
let n = t.error ? tt("message.voiceLocationRefused") : tt("message.voiceLocationShared", { place: t.displayName ?? `${t.latitude}, ${t.longitude}` });
|
|
18556
|
+
En(e, n) || Be({
|
|
18527
18557
|
tool: "requestGeolocation",
|
|
18528
|
-
toolCallId:
|
|
18558
|
+
toolCallId: xn(e),
|
|
18529
18559
|
output: t
|
|
18530
18560
|
});
|
|
18531
|
-
},
|
|
18532
|
-
|
|
18561
|
+
}, Fn = (e, t) => {
|
|
18562
|
+
En(e, tt("message.voiceConnectionDone")) || Be({
|
|
18533
18563
|
tool: "requestOAuthConnection",
|
|
18534
|
-
toolCallId:
|
|
18564
|
+
toolCallId: xn(e),
|
|
18535
18565
|
output: {
|
|
18536
18566
|
connected: !0,
|
|
18537
18567
|
mcpServerId: t
|
|
18538
18568
|
}
|
|
18539
18569
|
});
|
|
18540
|
-
},
|
|
18541
|
-
|
|
18570
|
+
}, In = () => {
|
|
18571
|
+
Ut.value = !Ut.value, an.setMuted(Ut.value);
|
|
18542
18572
|
};
|
|
18543
18573
|
ae(() => {
|
|
18544
|
-
|
|
18574
|
+
Wt = !0, Qt();
|
|
18545
18575
|
});
|
|
18546
|
-
let { pendingWakeup:
|
|
18576
|
+
let { pendingWakeup: Rn, isStopping: zn, stop: Bn, spokenTurnStarted: Hn, spokenTurnsWritten: Un, forgetSpokenTurns: Wn } = kS({
|
|
18547
18577
|
agentId: () => m.agentId,
|
|
18548
18578
|
chatId: () => g.localChatId,
|
|
18549
18579
|
apiClient: () => fe.value,
|
|
18550
18580
|
messages: () => C.value,
|
|
18551
|
-
refreshMessages:
|
|
18581
|
+
refreshMessages: Ke,
|
|
18552
18582
|
status: () => ee.value.status
|
|
18553
18583
|
});
|
|
18554
18584
|
return (t, v) => {
|
|
18555
18585
|
let y = Ln;
|
|
18556
18586
|
return X(), Y("div", {
|
|
18557
18587
|
ref_key: "chatViewEl",
|
|
18558
|
-
ref:
|
|
18588
|
+
ref: dt,
|
|
18559
18589
|
class: O(["pk-chatbot-view-chat", {
|
|
18560
|
-
"pk-chatbot-view-chat--dragover": J(
|
|
18561
|
-
"pk-chatbot-view-chat--empty":
|
|
18562
|
-
"pk-chatbot-view-chat--with-preview":
|
|
18590
|
+
"pk-chatbot-view-chat--dragover": J(Ht) && ke.value?.enabled,
|
|
18591
|
+
"pk-chatbot-view-chat--empty": lt.value,
|
|
18592
|
+
"pk-chatbot-view-chat--with-preview": kt.value && !pt.value
|
|
18563
18593
|
}])
|
|
18564
18594
|
}, [
|
|
18565
18595
|
M(W, {
|
|
18566
18596
|
name: "pk-chatbot-view-chat-fade",
|
|
18567
18597
|
mode: "out-in"
|
|
18568
18598
|
}, {
|
|
18569
|
-
default: G(() => [
|
|
18599
|
+
default: G(() => [lt.value ? (X(), I(sS, {
|
|
18570
18600
|
key: 0,
|
|
18571
|
-
greeting: J(
|
|
18601
|
+
greeting: J(ut),
|
|
18572
18602
|
logo: J(_)?.logo,
|
|
18573
18603
|
name: J(g).name
|
|
18574
18604
|
}, null, 8, [
|
|
@@ -18580,7 +18610,7 @@ var jS = { class: "pk-chatbot-view-chat__input-stage" }, MS = {
|
|
|
18580
18610
|
class: "flex flex-col flex-1 min-h-0 p-md overflow-y-auto",
|
|
18581
18611
|
interactive: "",
|
|
18582
18612
|
messages: J(C),
|
|
18583
|
-
"confirm-verdicts-on-call":
|
|
18613
|
+
"confirm-verdicts-on-call": wn.value,
|
|
18584
18614
|
status: J(ee).status,
|
|
18585
18615
|
error: J(ee).error,
|
|
18586
18616
|
"main-color": J(_)?.mainColor,
|
|
@@ -18594,8 +18624,8 @@ var jS = { class: "pk-chatbot-view-chat__input-stage" }, MS = {
|
|
|
18594
18624
|
"feedback-error": J(D),
|
|
18595
18625
|
"show-extended-steps": J(_)?.showExtendedSteps,
|
|
18596
18626
|
"hide-reasoning": J(_)?.showReasoning === !1,
|
|
18597
|
-
"awaiting-spoken-answer":
|
|
18598
|
-
"host-working":
|
|
18627
|
+
"awaiting-spoken-answer": Gt.value,
|
|
18628
|
+
"host-working": nt.value,
|
|
18599
18629
|
"host-confirmation": J(he),
|
|
18600
18630
|
"is-dark": J(P),
|
|
18601
18631
|
"show-scroll-to-bottom": e.modifier === "fullscreen",
|
|
@@ -18610,8 +18640,8 @@ var jS = { class: "pk-chatbot-view-chat__input-stage" }, MS = {
|
|
|
18610
18640
|
onDownvote: J(Ie),
|
|
18611
18641
|
onFeedback: J(q),
|
|
18612
18642
|
onApprovalRespond: J(He),
|
|
18613
|
-
onConfirmRespond:
|
|
18614
|
-
onHostConfirmRespond: J(
|
|
18643
|
+
onConfirmRespond: kn,
|
|
18644
|
+
onHostConfirmRespond: J(Ye)
|
|
18615
18645
|
}, {
|
|
18616
18646
|
"tool-showContactForm": G(({ part: e }) => [M(J(r), {
|
|
18617
18647
|
part: e,
|
|
@@ -18632,18 +18662,18 @@ var jS = { class: "pk-chatbot-view-chat__input-stage" }, MS = {
|
|
|
18632
18662
|
])]),
|
|
18633
18663
|
"tool-showSuggestedReply": G(({ part: e }) => [M(J(i), {
|
|
18634
18664
|
part: e,
|
|
18635
|
-
onSelect: (t) =>
|
|
18665
|
+
onSelect: (t) => Nn(e, t)
|
|
18636
18666
|
}, null, 8, ["part", "onSelect"])]),
|
|
18637
18667
|
"tool-showSources": G(({ part: e }) => [M(J(a), {
|
|
18638
18668
|
part: e,
|
|
18639
|
-
"on-expand-context":
|
|
18640
|
-
"on-download":
|
|
18669
|
+
"on-expand-context": zt,
|
|
18670
|
+
"on-download": Bt
|
|
18641
18671
|
}, null, 8, ["part"])]),
|
|
18642
18672
|
"tool-showForm": G(({ part: e }) => [M(W, { mode: "out-in" }, {
|
|
18643
18673
|
default: G(() => [M(J(n), {
|
|
18644
18674
|
part: e,
|
|
18645
|
-
answered:
|
|
18646
|
-
onSelect: (t) =>
|
|
18675
|
+
answered: Cn(e),
|
|
18676
|
+
onSelect: (t) => Dn("showForm", e, t)
|
|
18647
18677
|
}, null, 8, [
|
|
18648
18678
|
"part",
|
|
18649
18679
|
"answered",
|
|
@@ -18655,8 +18685,8 @@ var jS = { class: "pk-chatbot-view-chat__input-stage" }, MS = {
|
|
|
18655
18685
|
default: G(() => [M(J(n), {
|
|
18656
18686
|
part: e,
|
|
18657
18687
|
"allow-custom-answer": "",
|
|
18658
|
-
answered:
|
|
18659
|
-
onSelect: (t) =>
|
|
18688
|
+
answered: Cn(e),
|
|
18689
|
+
onSelect: (t) => Dn("showMultipleChoice", e, t)
|
|
18660
18690
|
}, null, 8, [
|
|
18661
18691
|
"part",
|
|
18662
18692
|
"answered",
|
|
@@ -18669,7 +18699,7 @@ var jS = { class: "pk-chatbot-view-chat__input-stage" }, MS = {
|
|
|
18669
18699
|
"backend-url": J(le),
|
|
18670
18700
|
"resolve-connection": (e) => J(fe).getOAuthAuthorizeUrl(m.agentId, e),
|
|
18671
18701
|
"check-connection": (e) => J(fe).getOAuthConnectionStatus(m.agentId, e),
|
|
18672
|
-
onConnected: (t) =>
|
|
18702
|
+
onConnected: (t) => Fn(e, t)
|
|
18673
18703
|
}, null, 8, [
|
|
18674
18704
|
"part",
|
|
18675
18705
|
"backend-url",
|
|
@@ -18679,9 +18709,9 @@ var jS = { class: "pk-chatbot-view-chat__input-stage" }, MS = {
|
|
|
18679
18709
|
])]),
|
|
18680
18710
|
"tool-requestGeolocation": G(({ part: e }) => [M(J(o), {
|
|
18681
18711
|
part: e,
|
|
18682
|
-
"call-live": J(
|
|
18712
|
+
"call-live": J(an).isActive.value,
|
|
18683
18713
|
"reverse-geocode": (e, t) => J(fe).reverseGeocode(e, t),
|
|
18684
|
-
onResult: (t) =>
|
|
18714
|
+
onResult: (t) => Pn(e, t)
|
|
18685
18715
|
}, null, 8, [
|
|
18686
18716
|
"part",
|
|
18687
18717
|
"call-live",
|
|
@@ -18707,9 +18737,9 @@ var jS = { class: "pk-chatbot-view-chat__input-stage" }, MS = {
|
|
|
18707
18737
|
key: J(vn)(e),
|
|
18708
18738
|
part: e,
|
|
18709
18739
|
"file-url": U,
|
|
18710
|
-
preview:
|
|
18711
|
-
"latest-versions":
|
|
18712
|
-
restore:
|
|
18740
|
+
preview: Dt,
|
|
18741
|
+
"latest-versions": An.value,
|
|
18742
|
+
restore: Mn.value
|
|
18713
18743
|
}, null, 8, [
|
|
18714
18744
|
"part",
|
|
18715
18745
|
"latest-versions",
|
|
@@ -18719,9 +18749,9 @@ var jS = { class: "pk-chatbot-view-chat__input-stage" }, MS = {
|
|
|
18719
18749
|
key: J(vn)(e),
|
|
18720
18750
|
part: e,
|
|
18721
18751
|
"file-url": U,
|
|
18722
|
-
preview:
|
|
18723
|
-
"latest-versions":
|
|
18724
|
-
restore:
|
|
18752
|
+
preview: Dt,
|
|
18753
|
+
"latest-versions": An.value,
|
|
18754
|
+
restore: Mn.value
|
|
18725
18755
|
}, null, 8, [
|
|
18726
18756
|
"part",
|
|
18727
18757
|
"latest-versions",
|
|
@@ -18731,9 +18761,9 @@ var jS = { class: "pk-chatbot-view-chat__input-stage" }, MS = {
|
|
|
18731
18761
|
key: J(vn)(e),
|
|
18732
18762
|
part: e,
|
|
18733
18763
|
"file-url": U,
|
|
18734
|
-
preview:
|
|
18735
|
-
"latest-versions":
|
|
18736
|
-
restore:
|
|
18764
|
+
preview: Dt,
|
|
18765
|
+
"latest-versions": An.value,
|
|
18766
|
+
restore: Mn.value
|
|
18737
18767
|
}, null, 8, [
|
|
18738
18768
|
"part",
|
|
18739
18769
|
"latest-versions",
|
|
@@ -18743,9 +18773,9 @@ var jS = { class: "pk-chatbot-view-chat__input-stage" }, MS = {
|
|
|
18743
18773
|
key: J(vn)(e),
|
|
18744
18774
|
part: e,
|
|
18745
18775
|
"file-url": U,
|
|
18746
|
-
preview:
|
|
18747
|
-
"latest-versions":
|
|
18748
|
-
restore:
|
|
18776
|
+
preview: Dt,
|
|
18777
|
+
"latest-versions": An.value,
|
|
18778
|
+
restore: Mn.value
|
|
18749
18779
|
}, null, 8, [
|
|
18750
18780
|
"part",
|
|
18751
18781
|
"latest-versions",
|
|
@@ -18754,7 +18784,7 @@ var jS = { class: "pk-chatbot-view-chat__input-stage" }, MS = {
|
|
|
18754
18784
|
"tool-shareDocument": G(({ part: e }) => [(X(), I(J(d), {
|
|
18755
18785
|
key: J(vn)(e),
|
|
18756
18786
|
part: e,
|
|
18757
|
-
"on-download":
|
|
18787
|
+
"on-download": Bt
|
|
18758
18788
|
}, null, 8, ["part"]))]),
|
|
18759
18789
|
_: 1
|
|
18760
18790
|
}, 8, /* @__PURE__ */ "messages.confirm-verdicts-on-call.status.error.main-color.text-color.revised-answers.actions.message-feedbacks.feedback-message-id.feedback-loading.feedback-submitted.feedback-error.show-extended-steps.hide-reasoning.awaiting-spoken-answer.host-working.host-confirmation.is-dark.show-scroll-to-bottom.onRegenerate.onAutoRetry.onResetChat.onUpvote.onDownvote.onFeedback.onApprovalRespond.onHostConfirmRespond".split(".")))]),
|
|
@@ -18763,8 +18793,8 @@ var jS = { class: "pk-chatbot-view-chat__input-stage" }, MS = {
|
|
|
18763
18793
|
J(L).length ? (X(), I(aS, {
|
|
18764
18794
|
key: 0,
|
|
18765
18795
|
messages: J(L),
|
|
18766
|
-
onEdit: J(
|
|
18767
|
-
onRemove: J(
|
|
18796
|
+
onEdit: J(Ze),
|
|
18797
|
+
onRemove: J(Qe)
|
|
18768
18798
|
}, null, 8, [
|
|
18769
18799
|
"messages",
|
|
18770
18800
|
"onEdit",
|
|
@@ -18772,7 +18802,7 @@ var jS = { class: "pk-chatbot-view-chat__input-stage" }, MS = {
|
|
|
18772
18802
|
])) : K("", !0),
|
|
18773
18803
|
R("div", jS, [
|
|
18774
18804
|
M(W, { name: "pk-chatbot-view-chat-fade" }, {
|
|
18775
|
-
default: G(() => [
|
|
18805
|
+
default: G(() => [lt.value ? (X(), I(Hv, {
|
|
18776
18806
|
key: 0,
|
|
18777
18807
|
class: "pk-chatbot-view-chat__aurora",
|
|
18778
18808
|
"source-selector": ".pk-chatbot-input__form",
|
|
@@ -18786,17 +18816,17 @@ var jS = { class: "pk-chatbot-view-chat__input-stage" }, MS = {
|
|
|
18786
18816
|
])) : K("", !0)]),
|
|
18787
18817
|
_: 1
|
|
18788
18818
|
}),
|
|
18789
|
-
J(
|
|
18819
|
+
J(Rn) && !J(ce) ? (X(), I(xS, {
|
|
18790
18820
|
key: 0,
|
|
18791
|
-
pending: J(
|
|
18792
|
-
stopping: J(
|
|
18793
|
-
onStop: J(
|
|
18821
|
+
pending: J(Rn),
|
|
18822
|
+
stopping: J(zn),
|
|
18823
|
+
onStop: J(Bn)
|
|
18794
18824
|
}, null, 8, [
|
|
18795
18825
|
"pending",
|
|
18796
18826
|
"stopping",
|
|
18797
18827
|
"onStop"
|
|
18798
18828
|
])) : K("", !0),
|
|
18799
|
-
J(ce) ? (X(), Y("div", MS, H(J(
|
|
18829
|
+
J(ce) ? (X(), Y("div", MS, H(J(tt)("message.chatErrorConversationBlocked")), 1)) : dn.value === "idle" ? (X(), I(eS, {
|
|
18800
18830
|
key: 3,
|
|
18801
18831
|
ref_key: "inputEl",
|
|
18802
18832
|
ref: De,
|
|
@@ -18805,16 +18835,16 @@ var jS = { class: "pk-chatbot-view-chat__input-stage" }, MS = {
|
|
|
18805
18835
|
"pending-attachments": J(ue),
|
|
18806
18836
|
"onUpdate:pendingAttachments": v[5] ||= (e) => Fe(ue) ? ue.value = e : null,
|
|
18807
18837
|
placeholder: J(se),
|
|
18808
|
-
"dismissable-notice": J(
|
|
18809
|
-
"page-notice":
|
|
18810
|
-
status:
|
|
18838
|
+
"dismissable-notice": J(st) && J(ee).messages.length <= 1 ? J(st) : void 0,
|
|
18839
|
+
"page-notice": at.value,
|
|
18840
|
+
status: rt.value,
|
|
18811
18841
|
"max-message-length": J(_)?.maxMessageLength,
|
|
18812
18842
|
"file-upload": ke.value,
|
|
18813
18843
|
"attachment-limit-reached": J(de),
|
|
18814
|
-
"attachment-notice":
|
|
18815
|
-
"voice-enabled":
|
|
18844
|
+
"attachment-notice": Z.value,
|
|
18845
|
+
"voice-enabled": cn.value,
|
|
18816
18846
|
"queue-enabled": J(xe),
|
|
18817
|
-
"answer-notices":
|
|
18847
|
+
"answer-notices": ot.value,
|
|
18818
18848
|
"pointer-available": J(V),
|
|
18819
18849
|
pointing: J(Te),
|
|
18820
18850
|
pointer: Oe.value,
|
|
@@ -18825,11 +18855,12 @@ var jS = { class: "pk-chatbot-view-chat__input-stage" }, MS = {
|
|
|
18825
18855
|
onStopGeneration: J(Me),
|
|
18826
18856
|
onSubmit: J(je),
|
|
18827
18857
|
onFileSelect: J(Ue),
|
|
18828
|
-
|
|
18829
|
-
|
|
18830
|
-
|
|
18831
|
-
|
|
18832
|
-
|
|
18858
|
+
onRemoveAttachment: J(We),
|
|
18859
|
+
onDismissAttachmentNotice: J(Ge),
|
|
18860
|
+
onDismissPageNotice: J(Je),
|
|
18861
|
+
onOpenAnswerNotice: J($e),
|
|
18862
|
+
onDismissAnswerNotice: J(et),
|
|
18863
|
+
onVoiceStart: gn
|
|
18833
18864
|
}, _e({ _: 2 }, [e.modifier === "fullscreen" ? {
|
|
18834
18865
|
name: "prepend",
|
|
18835
18866
|
fn: G(() => [R("span", NS, [M(Rv, {
|
|
@@ -18859,25 +18890,26 @@ var jS = { class: "pk-chatbot-view-chat__input-stage" }, MS = {
|
|
|
18859
18890
|
"onStopGeneration",
|
|
18860
18891
|
"onSubmit",
|
|
18861
18892
|
"onFileSelect",
|
|
18893
|
+
"onRemoveAttachment",
|
|
18862
18894
|
"onDismissAttachmentNotice",
|
|
18863
18895
|
"onDismissPageNotice",
|
|
18864
18896
|
"onOpenAnswerNotice",
|
|
18865
18897
|
"onDismissAnswerNotice"
|
|
18866
18898
|
])) : (X(), I(_S, {
|
|
18867
18899
|
key: 2,
|
|
18868
|
-
state:
|
|
18869
|
-
sample:
|
|
18870
|
-
spectrum:
|
|
18871
|
-
"remaining-seconds": J(
|
|
18872
|
-
muted:
|
|
18873
|
-
error:
|
|
18874
|
-
"raw-error": J(
|
|
18875
|
-
live: J(
|
|
18900
|
+
state: dn.value,
|
|
18901
|
+
sample: mn,
|
|
18902
|
+
spectrum: hn,
|
|
18903
|
+
"remaining-seconds": J(an).remainingSeconds.value,
|
|
18904
|
+
muted: Ut.value,
|
|
18905
|
+
error: fn.value,
|
|
18906
|
+
"raw-error": J(an).error.value,
|
|
18907
|
+
live: J(an).isActive.value,
|
|
18876
18908
|
class: "pk-chatbot-view-chat__voice",
|
|
18877
|
-
onToggleMute:
|
|
18878
|
-
onHangUp:
|
|
18879
|
-
onRetry:
|
|
18880
|
-
onDismiss:
|
|
18909
|
+
onToggleMute: In,
|
|
18910
|
+
onHangUp: _n,
|
|
18911
|
+
onRetry: bn,
|
|
18912
|
+
onDismiss: yn
|
|
18881
18913
|
}, null, 8, [
|
|
18882
18914
|
"state",
|
|
18883
18915
|
"remaining-seconds",
|
|
@@ -18888,44 +18920,44 @@ var jS = { class: "pk-chatbot-view-chat__input-stage" }, MS = {
|
|
|
18888
18920
|
]))
|
|
18889
18921
|
]),
|
|
18890
18922
|
M(W, null, {
|
|
18891
|
-
default: G(() => [J(
|
|
18923
|
+
default: G(() => [J(Ht) && ke.value?.enabled ? (X(), Y("div", FS, [M(y, {
|
|
18892
18924
|
name: "ri:upload-cloud-2-line",
|
|
18893
18925
|
class: "pk-chatbot-view-chat__drop-overlay-icon"
|
|
18894
|
-
}), R("span", null, H(J(
|
|
18926
|
+
}), R("span", null, H(J(tt)("action.dropFile")), 1)])) : K("", !0)]),
|
|
18895
18927
|
_: 1
|
|
18896
18928
|
}),
|
|
18897
|
-
|
|
18929
|
+
kt.value ? (X(), I(Ae, {
|
|
18898
18930
|
key: 1,
|
|
18899
|
-
to:
|
|
18900
|
-
disabled: !
|
|
18901
|
-
}, [R("aside", { class: O(["pk-chatbot-view-chat__preview", { "pk-chatbot-view-chat__preview--docked":
|
|
18931
|
+
to: mt.value,
|
|
18932
|
+
disabled: !pt.value
|
|
18933
|
+
}, [R("aside", { class: O(["pk-chatbot-view-chat__preview", { "pk-chatbot-view-chat__preview--docked": pt.value }]) }, [J(yt) ? (X(), I(J(f), {
|
|
18902
18934
|
key: 0,
|
|
18903
|
-
mode:
|
|
18904
|
-
"onUpdate:mode": v[9] ||= (e) =>
|
|
18905
|
-
sheet:
|
|
18906
|
-
"onUpdate:sheet": v[10] ||= (e) =>
|
|
18907
|
-
zoom:
|
|
18908
|
-
"onUpdate:zoom": v[11] ||= (e) =>
|
|
18909
|
-
fit:
|
|
18910
|
-
"onUpdate:fit": v[12] ||= (e) =>
|
|
18911
|
-
kind: J(
|
|
18912
|
-
filename: J(
|
|
18913
|
-
version: J(
|
|
18914
|
-
versions:
|
|
18915
|
-
"download-url": U(J(
|
|
18916
|
-
preview: J(
|
|
18917
|
-
loading: J(
|
|
18918
|
-
error: J(
|
|
18919
|
-
restorable:
|
|
18935
|
+
mode: Et.value.mode,
|
|
18936
|
+
"onUpdate:mode": v[9] ||= (e) => Et.value.mode = e,
|
|
18937
|
+
sheet: Et.value.sheet,
|
|
18938
|
+
"onUpdate:sheet": v[10] ||= (e) => Et.value.sheet = e,
|
|
18939
|
+
zoom: Et.value.zoom,
|
|
18940
|
+
"onUpdate:zoom": v[11] ||= (e) => Et.value.zoom = e,
|
|
18941
|
+
fit: Et.value.fit,
|
|
18942
|
+
"onUpdate:fit": v[12] ||= (e) => Et.value.fit = e,
|
|
18943
|
+
kind: J(yt).kind,
|
|
18944
|
+
filename: J(yt).filename,
|
|
18945
|
+
version: J(yt).version,
|
|
18946
|
+
versions: Nt.value,
|
|
18947
|
+
"download-url": U(J(yt).storedFileName),
|
|
18948
|
+
preview: J(bt),
|
|
18949
|
+
loading: J(xt),
|
|
18950
|
+
error: J(St),
|
|
18951
|
+
restorable: Ft.value,
|
|
18920
18952
|
resize: "expand",
|
|
18921
|
-
"file-id": J(
|
|
18922
|
-
"stored-file-name": J(
|
|
18923
|
-
"selection-actions":
|
|
18924
|
-
onVersion:
|
|
18925
|
-
onRestore:
|
|
18926
|
-
onResize: v[13] ||= (e) =>
|
|
18927
|
-
onSelectionSend:
|
|
18928
|
-
onClose:
|
|
18953
|
+
"file-id": J(yt).fileId,
|
|
18954
|
+
"stored-file-name": J(yt).storedFileName,
|
|
18955
|
+
"selection-actions": Lt.value,
|
|
18956
|
+
onVersion: Pt,
|
|
18957
|
+
onRestore: It,
|
|
18958
|
+
onResize: v[13] ||= (e) => Ot.value = !0,
|
|
18959
|
+
onSelectionSend: Rt,
|
|
18960
|
+
onClose: At
|
|
18929
18961
|
}, null, 8, [
|
|
18930
18962
|
"mode",
|
|
18931
18963
|
"sheet",
|
|
@@ -18944,31 +18976,31 @@ var jS = { class: "pk-chatbot-view-chat__input-stage" }, MS = {
|
|
|
18944
18976
|
"stored-file-name",
|
|
18945
18977
|
"selection-actions"
|
|
18946
18978
|
])) : K("", !0)], 2)], 8, ["to", "disabled"])) : K("", !0),
|
|
18947
|
-
J(
|
|
18979
|
+
J(yt) && !kt.value ? (X(), I(J(p), {
|
|
18948
18980
|
key: 2,
|
|
18949
|
-
mode:
|
|
18950
|
-
"onUpdate:mode": v[14] ||= (e) =>
|
|
18951
|
-
sheet:
|
|
18952
|
-
"onUpdate:sheet": v[15] ||= (e) =>
|
|
18953
|
-
zoom:
|
|
18954
|
-
"onUpdate:zoom": v[16] ||= (e) =>
|
|
18955
|
-
fit:
|
|
18956
|
-
"onUpdate:fit": v[17] ||= (e) =>
|
|
18957
|
-
target: J(
|
|
18958
|
-
versions:
|
|
18959
|
-
"download-url": U(J(
|
|
18960
|
-
preview: J(
|
|
18961
|
-
loading: J(
|
|
18962
|
-
error: J(
|
|
18963
|
-
restorable:
|
|
18964
|
-
resize:
|
|
18965
|
-
fullscreen:
|
|
18966
|
-
"selection-actions":
|
|
18967
|
-
onVersion:
|
|
18968
|
-
onRestore:
|
|
18969
|
-
onResize: v[18] ||= (e) =>
|
|
18970
|
-
onSelectionSend:
|
|
18971
|
-
onClose:
|
|
18981
|
+
mode: Et.value.mode,
|
|
18982
|
+
"onUpdate:mode": v[14] ||= (e) => Et.value.mode = e,
|
|
18983
|
+
sheet: Et.value.sheet,
|
|
18984
|
+
"onUpdate:sheet": v[15] ||= (e) => Et.value.sheet = e,
|
|
18985
|
+
zoom: Et.value.zoom,
|
|
18986
|
+
"onUpdate:zoom": v[16] ||= (e) => Et.value.zoom = e,
|
|
18987
|
+
fit: Et.value.fit,
|
|
18988
|
+
"onUpdate:fit": v[17] ||= (e) => Et.value.fit = e,
|
|
18989
|
+
target: J(yt),
|
|
18990
|
+
versions: Nt.value,
|
|
18991
|
+
"download-url": U(J(yt).storedFileName),
|
|
18992
|
+
preview: J(bt),
|
|
18993
|
+
loading: J(xt),
|
|
18994
|
+
error: J(St),
|
|
18995
|
+
restorable: Ft.value,
|
|
18996
|
+
resize: _t.value ? "shrink" : void 0,
|
|
18997
|
+
fullscreen: vt.value,
|
|
18998
|
+
"selection-actions": Lt.value,
|
|
18999
|
+
onVersion: Pt,
|
|
19000
|
+
onRestore: It,
|
|
19001
|
+
onResize: v[18] ||= (e) => Ot.value = !1,
|
|
19002
|
+
onSelectionSend: Rt,
|
|
19003
|
+
onClose: At
|
|
18972
19004
|
}, null, 8, [
|
|
18973
19005
|
"mode",
|
|
18974
19006
|
"sheet",
|