@8wave/ai-elements 0.123.0-beta.2 → 0.123.0-beta.4
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-BcmcalNN.js → Agent-C0JtGK2t.js} +3 -2
- package/dist/_chunks/{Agent-BcmcalNN.js.map → Agent-C0JtGK2t.js.map} +1 -1
- package/dist/_chunks/{PkStreamingMarkdown-Dc0R0GHe.js → PkStreamingMarkdown-De3ihxaM.js} +3 -3
- package/dist/_chunks/{PkStreamingMarkdown-Dc0R0GHe.js.map → PkStreamingMarkdown-De3ihxaM.js.map} +1 -1
- package/dist/_chunks/{PkToolChatFile-3fYhbFSi.js → PkToolChatFile-CRp81vG5.js} +2 -2
- package/dist/_chunks/{PkToolChatFile-3fYhbFSi.js.map → PkToolChatFile-CRp81vG5.js.map} +1 -1
- package/dist/_chunks/{PkToolRequestGeolocation-n1W_drCv.js → PkToolRequestGeolocation-GlUmGHpD.js} +2 -2
- package/dist/_chunks/{PkToolRequestGeolocation-n1W_drCv.js.map → PkToolRequestGeolocation-GlUmGHpD.js.map} +1 -1
- package/dist/_chunks/{PkToolRequestOAuthConnection-DmMeSF2m.js → PkToolRequestOAuthConnection-7OvDQZe5.js} +2 -2
- package/dist/_chunks/{PkToolRequestOAuthConnection-DmMeSF2m.js.map → PkToolRequestOAuthConnection-7OvDQZe5.js.map} +1 -1
- package/dist/_chunks/{PkToolShowArtifact-BUnSqAWQ.js → PkToolShowArtifact-DmVWtJit.js} +2 -2
- package/dist/_chunks/{PkToolShowArtifact-BUnSqAWQ.js.map → PkToolShowArtifact-DmVWtJit.js.map} +1 -1
- package/dist/_chunks/{PkToolShowContactForm-YX1BuolZ.js → PkToolShowContactForm-9Kv-ZdN9.js} +2 -2
- package/dist/_chunks/{PkToolShowContactForm-YX1BuolZ.js.map → PkToolShowContactForm-9Kv-ZdN9.js.map} +1 -1
- package/dist/_chunks/{PkToolShowForm-CkpMsrEo.js → PkToolShowForm-CbKhYut7.js} +3 -3
- package/dist/_chunks/{PkToolShowForm-CkpMsrEo.js.map → PkToolShowForm-CbKhYut7.js.map} +1 -1
- package/dist/_chunks/{PkToolShowImageGallery-BnUnjFeU.js → PkToolShowImageGallery-6rZZHDOj.js} +2 -2
- package/dist/_chunks/{PkToolShowImageGallery-BnUnjFeU.js.map → PkToolShowImageGallery-6rZZHDOj.js.map} +1 -1
- package/dist/_chunks/{PkToolShowProductList-CPqmqS-Q.js → PkToolShowProductList-U9hglluW.js} +2 -2
- package/dist/_chunks/{PkToolShowProductList-CPqmqS-Q.js.map → PkToolShowProductList-U9hglluW.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSources-BO1IhnmO.js → PkToolShowSources-BB7w_tMo.js} +3 -3
- package/dist/_chunks/{PkToolShowSources-BO1IhnmO.js.map → PkToolShowSources-BB7w_tMo.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSuggestedReply-79UAjTL4.js → PkToolShowSuggestedReply-BxCeHVdn.js} +2 -2
- package/dist/_chunks/{PkToolShowSuggestedReply-79UAjTL4.js.map → PkToolShowSuggestedReply-BxCeHVdn.js.map} +1 -1
- package/dist/_chunks/{PkToolShowVideo-DYnH3VIc.js → PkToolShowVideo-BnLOMaQn.js} +2 -2
- package/dist/_chunks/{PkToolShowVideo-DYnH3VIc.js.map → PkToolShowVideo-BnLOMaQn.js.map} +1 -1
- package/dist/_chunks/{PkToolShowWebPages-Ci_Yut6X.js → PkToolShowWebPages-CBAQf2pg.js} +2 -2
- package/dist/_chunks/{PkToolShowWebPages-Ci_Yut6X.js.map → PkToolShowWebPages-CBAQf2pg.js.map} +1 -1
- package/dist/_chunks/{chatImagePolicy-B5-NwmIR.js → chatImagePolicy-B3-RzU9W.js} +2 -2
- package/dist/_chunks/{chatImagePolicy-B5-NwmIR.js.map → chatImagePolicy-B3-RzU9W.js.map} +1 -1
- package/dist/_chunks/{markdown-_sL6w03k.js → markdown-BxOlM5SY.js} +2 -2
- package/dist/_chunks/{markdown-_sL6w03k.js.map → markdown-BxOlM5SY.js.map} +1 -1
- package/dist/ai-elements.es.js +2674 -2593
- 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-BWwjGG2f.js → Agent-Dsi_xGvV.js} +10 -9
- package/dist-vue/_chunks/{Agent-BWwjGG2f.js.map → Agent-Dsi_xGvV.js.map} +1 -1
- package/dist-vue/_chunks/{Document-DvRaziIf.js → Document-B5R1PJnc.js} +2 -2
- package/dist-vue/_chunks/{Document-DvRaziIf.js.map → Document-B5R1PJnc.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbot-D3KGDerg.js → PkChatbot-B0EC0aOA.js} +8 -8
- package/dist-vue/_chunks/{PkChatbot-D3KGDerg.js.map → PkChatbot-B0EC0aOA.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotEmptyState-B76oD7fB.js → PkChatbotEmptyState-yO8Z-3p4.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotEmptyState-B76oD7fB.js.map → PkChatbotEmptyState-yO8Z-3p4.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotInput-BT51V-v4.js → PkChatbotInput-CiNeclez.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotInput-BT51V-v4.js.map → PkChatbotInput-CiNeclez.js.map} +1 -1
- package/dist-vue/_chunks/PkChatbotMessages-CcR2PKp3.js +982 -0
- package/dist-vue/_chunks/PkChatbotMessages-CcR2PKp3.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotStepPayload-BYChvULZ.js → PkChatbotStepPayload-CWJmmF6k.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotStepPayload-BYChvULZ.js.map → PkChatbotStepPayload-CWJmmF6k.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-BysPl2ko.js → PkChatbotStepToolDetail-gT-CpGZH.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-BysPl2ko.js.map → PkChatbotStepToolDetail-gT-CpGZH.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotSteps-p8-SuGGe.js → PkChatbotSteps-CUznAYXB.js} +5 -5
- package/dist-vue/_chunks/{PkChatbotSteps-p8-SuGGe.js.map → PkChatbotSteps-CUznAYXB.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewChat-BNaSv86u.js → PkChatbotViewChat-DDnJ-2Ic.js} +377 -371
- package/dist-vue/_chunks/PkChatbotViewChat-DDnJ-2Ic.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotViewConversations-C1vl8z4o.js → PkChatbotViewConversations-D0I6g4QO.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotViewConversations-C1vl8z4o.js.map → PkChatbotViewConversations-D0I6g4QO.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewFiles-DiKHsdPE.js → PkChatbotViewFiles-UjuW1UGm.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotViewFiles-DiKHsdPE.js.map → PkChatbotViewFiles-UjuW1UGm.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewProfile-CuQ0MAX7.js → PkChatbotViewProfile-Dvqk0e3I.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewProfile-CuQ0MAX7.js.map → PkChatbotViewProfile-Dvqk0e3I.js.map} +1 -1
- package/dist-vue/_chunks/{PkStreamingMarkdown-B-sEx8BP.js → PkStreamingMarkdown-C_4h85DA.js} +3 -3
- package/dist-vue/_chunks/{PkStreamingMarkdown-B-sEx8BP.js.map → PkStreamingMarkdown-C_4h85DA.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolChatFile-BJsDSu1Q.js → PkToolChatFile-CMcJl0hu.js} +2 -2
- package/dist-vue/_chunks/{PkToolChatFile-BJsDSu1Q.js.map → PkToolChatFile-CMcJl0hu.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolRequestGeolocation-e8vyxTI_.js → PkToolRequestGeolocation-Bzu1fQ-X.js} +2 -2
- package/dist-vue/_chunks/{PkToolRequestGeolocation-e8vyxTI_.js.map → PkToolRequestGeolocation-Bzu1fQ-X.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolRequestOAuthConnection-3zLvNF_c.js → PkToolRequestOAuthConnection-C8t_5YtB.js} +2 -2
- package/dist-vue/_chunks/{PkToolRequestOAuthConnection-3zLvNF_c.js.map → PkToolRequestOAuthConnection-C8t_5YtB.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowArtifact-BRwa5pGY.js → PkToolShowArtifact-Pvi63K3m.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowArtifact-BRwa5pGY.js.map → PkToolShowArtifact-Pvi63K3m.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowContactForm-xHBTmITM.js → PkToolShowContactForm-BNta1jh0.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowContactForm-xHBTmITM.js.map → PkToolShowContactForm-BNta1jh0.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowDiagram-DrJs92dg.js → PkToolShowDiagram-BRHpp_P-.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowDiagram-DrJs92dg.js.map → PkToolShowDiagram-BRHpp_P-.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowForm-Fv4iV0VY.js → PkToolShowForm-DuX1By1C.js} +4 -4
- package/dist-vue/_chunks/{PkToolShowForm-Fv4iV0VY.js.map → PkToolShowForm-DuX1By1C.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowImageGallery-DD_RGcL6.js → PkToolShowImageGallery-9n-B5Jqo.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowImageGallery-DD_RGcL6.js.map → PkToolShowImageGallery-9n-B5Jqo.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowProductList-8UQSQvRr.js → PkToolShowProductList-BE_nXuEa.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowProductList-8UQSQvRr.js.map → PkToolShowProductList-BE_nXuEa.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSources-C4rKpypf.js → PkToolShowSources-89OXReX8.js} +3 -3
- package/dist-vue/_chunks/{PkToolShowSources-C4rKpypf.js.map → PkToolShowSources-89OXReX8.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-Bnhgsh4l.js → PkToolShowSuggestedReply-CxOyvAB6.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-Bnhgsh4l.js.map → PkToolShowSuggestedReply-CxOyvAB6.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowVideo-NOwtZPgI.js → PkToolShowVideo-C3SbJ3Zb.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowVideo-NOwtZPgI.js.map → PkToolShowVideo-C3SbJ3Zb.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowWebPages-DcPboNwp.js → PkToolShowWebPages-CjNhdQbq.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowWebPages-DcPboNwp.js.map → PkToolShowWebPages-CjNhdQbq.js.map} +1 -1
- package/dist-vue/_chunks/{createChatbotApiClient-DAh91HyT.js → createChatbotApiClient-CesweDUX.js} +4 -3
- package/dist-vue/_chunks/{createChatbotApiClient-DAh91HyT.js.map → createChatbotApiClient-CesweDUX.js.map} +1 -1
- package/dist-vue/_chunks/{useChatbotStore-D1U24qc8.js → useChatbotStore-CNcPLoPf.js} +695 -635
- package/dist-vue/_chunks/useChatbotStore-CNcPLoPf.js.map +1 -0
- package/dist-vue/_chunks/{utils-DaAIWTtt.js → utils-PU7OuUYN.js} +2 -2
- package/dist-vue/_chunks/{utils-DaAIWTtt.js.map → utils-PU7OuUYN.js.map} +1 -1
- package/dist-vue/api.js +1 -1
- package/dist-vue/composables.js +4 -4
- package/dist-vue/index.js +24 -24
- package/dist-vue/packages/components/src/chat/useVoiceSession.d.ts +6 -0
- package/dist-vue/packages/composable/src/chatbot/api/createChatbotApiClient.d.ts +2 -0
- package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +61 -1
- package/dist-vue/packages/models/src/schema/Agent.d.ts +1 -0
- package/package.json +1 -1
- package/dist-vue/_chunks/PkChatbotMessages-qkodgdDE.js +0 -968
- package/dist-vue/_chunks/PkChatbotMessages-qkodgdDE.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotViewChat-BNaSv86u.js.map +0 -1
- package/dist-vue/_chunks/useChatbotStore-D1U24qc8.js.map +0 -1
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { t as e } from "./PkChatbotMessages-
|
|
1
|
+
import { t as e } from "./PkChatbotMessages-CcR2PKp3.js";
|
|
2
2
|
import { o as t } from "./Media-DylqhvaF.js";
|
|
3
|
-
import { a as n, n as r, t as i } from "./useChatbotStore-
|
|
3
|
+
import { a as n, n as r, t as i } from "./useChatbotStore-CNcPLoPf.js";
|
|
4
4
|
import { n as a } from "./src-B-ZKEhTU.js";
|
|
5
|
-
import { c as o, h as s, n as c } from "./utils-
|
|
5
|
+
import { c as o, h as s, n as c } from "./utils-PU7OuUYN.js";
|
|
6
6
|
import { t as l } from "./useLocalizedString-Dmn92nix.js";
|
|
7
7
|
import { t as u } from "./PkAvatar-DwtZWSW4.js";
|
|
8
|
-
import { n as d, t as f } from "./PkChatbotInput-
|
|
8
|
+
import { n as d, t as f } from "./PkChatbotInput-CiNeclez.js";
|
|
9
9
|
import { t as p } from "./PkChatbotQueuedMessages-CIJFAvE2.js";
|
|
10
|
-
import { t as ee } from "./PkChatbotEmptyState-
|
|
10
|
+
import { t as ee } from "./PkChatbotEmptyState-yO8Z-3p4.js";
|
|
11
11
|
import { t as m } from "./PkChatbotWakeupBar-DEP-d-Fp.js";
|
|
12
12
|
import { VvDialog as h, VvIcon as g } from "@volverjs/ui-vue/components";
|
|
13
|
-
import { Fragment as _, Transition as v, computed as y, createBlock as b, createCommentVNode as x, createElementBlock as S, createElementVNode as C, createSlots as te, createTextVNode as ne, createVNode as w, defineAsyncComponent as T, defineComponent as
|
|
14
|
-
import { useI18n as
|
|
15
|
-
import { useDropZone as
|
|
16
|
-
import { storeToRefs as
|
|
13
|
+
import { Fragment as _, Transition as v, computed as y, createBlock as b, createCommentVNode as x, createElementBlock as S, createElementVNode as C, createSlots as te, createTextVNode as ne, createVNode as w, defineAsyncComponent as T, defineComponent as re, isRef as ie, nextTick as ae, normalizeClass as E, onBeforeUnmount as oe, onMounted as se, onScopeDispose as ce, onUnmounted as le, openBlock as D, provide as ue, ref as O, renderList as de, shallowRef as k, toDisplayString as A, toValue as fe, unref as j, useTemplateRef as pe, watch as M, withCtx as N } from "vue";
|
|
14
|
+
import { useI18n as me } from "vue-i18n";
|
|
15
|
+
import { useDropZone as he, useElementSize as ge } from "@vueuse/core";
|
|
16
|
+
import { storeToRefs as _e } from "pinia";
|
|
17
17
|
// ../../packages/composable/src/chatbot/useGreeting.ts
|
|
18
|
-
function _e(e, t) {
|
|
19
|
-
let { locale: n, t: r, te: i } = pe({ useScope: "global" });
|
|
20
|
-
return y(() => ve(de(e)?.greeting?.[0]?.[n.value] ?? "", de(t)) || (i("message.defaultAgentWelcome") ? r("message.defaultAgentWelcome") : ""));
|
|
21
|
-
}
|
|
22
18
|
function ve(e, t) {
|
|
19
|
+
let { locale: n, t: r, te: i } = me({ useScope: "global" });
|
|
20
|
+
return y(() => ye(fe(e)?.greeting?.[0]?.[n.value] ?? "", fe(t)) || (i("message.defaultAgentWelcome") ? r("message.defaultAgentWelcome") : ""));
|
|
21
|
+
}
|
|
22
|
+
function ye(e, t) {
|
|
23
23
|
return (t ? e.replace(/\{name\}/g, t) : e.replace(/[,\s]*\{name\}[!?]?/g, "")).trim();
|
|
24
24
|
}
|
|
25
25
|
// ../../packages/components/src/chat/PkAuroraCanvas.vue?vue&type=script&setup=true&lang.ts
|
|
26
|
-
var
|
|
26
|
+
var P = {
|
|
27
27
|
class: "pk-aurora",
|
|
28
28
|
"aria-hidden": "true"
|
|
29
|
-
},
|
|
29
|
+
}, be = {
|
|
30
30
|
key: 1,
|
|
31
31
|
class: "pk-aurora__fallback"
|
|
32
|
-
},
|
|
32
|
+
}, F = "\nattribute vec2 a_position;\nvoid main() {\n gl_Position = vec4(a_position, 0.0, 1.0);\n}", I = "\nprecision mediump float;\nuniform vec2 u_resolution;\nuniform float u_time;\nuniform vec3 u_color;\nuniform vec2 u_center;\nuniform vec2 u_half;\nuniform float u_spread;\n\nvec3 permute(vec3 x) { return mod(((x * 34.0) + 1.0) * x, 289.0); }\n\nfloat snoise(vec2 v) {\n const vec4 C = vec4(0.211324865405187, 0.366025403784439,\n -0.577350269189626, 0.024390243902439);\n vec2 i = floor(v + dot(v, C.yy));\n vec2 x0 = v - i + dot(i, C.xx);\n vec2 i1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);\n vec4 x12 = x0.xyxy + C.xxzz;\n x12.xy -= i1;\n i = mod(i, 289.0);\n vec3 p = permute(permute(i.y + vec3(0.0, i1.y, 1.0))\n + i.x + vec3(0.0, i1.x, 1.0));\n vec3 m = max(0.5 - vec3(dot(x0, x0), dot(x12.xy, x12.xy),\n dot(x12.zw, x12.zw)), 0.0);\n m = m * m;\n m = m * m;\n vec3 x = 2.0 * fract(p * C.www) - 1.0;\n vec3 h = abs(x) - 0.5;\n vec3 ox = floor(x + 0.5);\n vec3 a0 = x - ox;\n m *= 1.79284291400159 - 0.85373472095314 * (a0 * a0 + h * h);\n vec3 g;\n g.x = a0.x * x0.x + h.x * x0.y;\n g.yz = a0.yz * x12.xz + h.yz * x12.yw;\n return 130.0 * dot(m, g);\n}\n\nvoid main() {\n vec2 px = gl_FragCoord.xy;\n vec2 rel = px - u_center;\n\n // Ignition: the ellipse lights up expanding from the center on mount\n float intro = smoothstep(0.0, 1.4, u_time);\n\n // Breathing: size and brightness oscillate gently but visibly\n float breath = 1.0\n + 0.12 * sin(u_time * 0.55)\n + 0.06 * snoise(vec2(u_time * 0.1, 3.7));\n float pulse = 1.0 + 0.2 * sin(u_time * 0.55 + 1.3);\n\n // Keep it simple (Gemini-style): one huge soft elliptical glow\n // centered on the pill\n vec2 radii = vec2(u_half.x * 0.95, u_half.y * 6.5)\n * u_spread\n * breath\n * mix(0.15, 1.0, intro);\n float r = length(rel / max(radii, vec2(1.0)));\n float glow = exp(-r * r * 2.2);\n\n // Never cut hard against the canvas bounds\n vec2 m = min(px, u_resolution - px);\n glow *= smoothstep(0.0, 32.0, min(m.x, m.y));\n\n // Dither: breaks the 8-bit banding rings of the very soft gradient\n // (no CSS blur on the canvas, the noise must fully mask the bands)\n glow = max(glow + (snoise(px * 0.9) - 0.5) * 0.03, 0.0);\n\n float alpha = glow * 0.2 * pulse * intro;\n\n // Premultiplied alpha (default canvas compositing)\n gl_FragColor = vec4(u_color * alpha, alpha);\n}", xe = /* @__PURE__ */ re({
|
|
33
33
|
__name: "PkAuroraCanvas",
|
|
34
34
|
props: { sourceSelector: {} },
|
|
35
35
|
setup(e) {
|
|
36
|
-
let t = e, n =
|
|
36
|
+
let t = e, n = pe("canvasEl"), r = O(!1), i = null, a = 0, o = null, s = null, c = null, l = null, u = null, d = null, f = performance.now(), p = (e, t) => {
|
|
37
37
|
if (!i) return null;
|
|
38
38
|
let n = i.createShader(e);
|
|
39
39
|
return !n || (i.shaderSource(n, t), i.compileShader(n), !i.getShaderParameter(n, i.COMPILE_STATUS)) ? null : n;
|
|
@@ -62,7 +62,7 @@ var F = {
|
|
|
62
62
|
}, _ = () => {
|
|
63
63
|
g(), a = requestAnimationFrame(_);
|
|
64
64
|
};
|
|
65
|
-
return
|
|
65
|
+
return se(() => {
|
|
66
66
|
let e = n.value;
|
|
67
67
|
i = e?.getContext("webgl", { alpha: !0 }) ?? null;
|
|
68
68
|
let t = ee();
|
|
@@ -70,7 +70,7 @@ var F = {
|
|
|
70
70
|
r.value = !0;
|
|
71
71
|
return;
|
|
72
72
|
}
|
|
73
|
-
let a = p(i.VERTEX_SHADER,
|
|
73
|
+
let a = p(i.VERTEX_SHADER, F), f = p(i.FRAGMENT_SHADER, I), v = i.createProgram();
|
|
74
74
|
if (!a || !f || !v || (i.attachShader(v, a), i.attachShader(v, f), i.linkProgram(v), !i.getProgramParameter(v, i.LINK_STATUS))) {
|
|
75
75
|
r.value = !0;
|
|
76
76
|
return;
|
|
@@ -88,22 +88,22 @@ var F = {
|
|
|
88
88
|
1
|
|
89
89
|
]), i.STATIC_DRAW);
|
|
90
90
|
let b = i.getAttribLocation(v, "a_position");
|
|
91
|
-
i.enableVertexAttribArray(b), i.vertexAttribPointer(b, 2, i.FLOAT, !1, 0, 0), s = i.getUniformLocation(v, "u_time"), c = i.getUniformLocation(v, "u_resolution"), l = i.getUniformLocation(v, "u_center"), u = i.getUniformLocation(v, "u_half"), d = i.getUniformLocation(v, "u_spread"), i.uniform3f(i.getUniformLocation(v, "u_color"), ...t), o = new ResizeObserver(m), o.observe(e), m(),
|
|
92
|
-
}),
|
|
91
|
+
i.enableVertexAttribArray(b), i.vertexAttribPointer(b, 2, i.FLOAT, !1, 0, 0), s = i.getUniformLocation(v, "u_time"), c = i.getUniformLocation(v, "u_resolution"), l = i.getUniformLocation(v, "u_center"), u = i.getUniformLocation(v, "u_half"), d = i.getUniformLocation(v, "u_spread"), i.uniform3f(i.getUniformLocation(v, "u_color"), ...t), o = new ResizeObserver(m), o.observe(e), m(), ae(m), h() ? g(10) : _();
|
|
92
|
+
}), oe(() => {
|
|
93
93
|
cancelAnimationFrame(a), o?.disconnect();
|
|
94
|
-
}),
|
|
94
|
+
}), le(() => {
|
|
95
95
|
let e = i;
|
|
96
96
|
i = null, setTimeout(() => {
|
|
97
97
|
e?.getExtension("WEBGL_lose_context")?.loseContext();
|
|
98
98
|
}, 150);
|
|
99
|
-
}), (e, t) => (
|
|
99
|
+
}), (e, t) => (D(), S("div", P, [r.value ? (D(), S("div", be)) : (D(), S("canvas", {
|
|
100
100
|
key: 0,
|
|
101
101
|
ref_key: "canvasEl",
|
|
102
102
|
ref: n,
|
|
103
103
|
class: "pk-aurora__canvas"
|
|
104
104
|
}, null, 512))]));
|
|
105
105
|
}
|
|
106
|
-
}),
|
|
106
|
+
}), L = .18, Se = .35, Ce = /* @__PURE__ */ re({
|
|
107
107
|
__name: "PkVoiceOrb",
|
|
108
108
|
props: {
|
|
109
109
|
sample: {},
|
|
@@ -115,20 +115,20 @@ var F = {
|
|
|
115
115
|
bars: { default: 5 }
|
|
116
116
|
},
|
|
117
117
|
setup(e) {
|
|
118
|
-
let t = e, n =
|
|
118
|
+
let t = e, n = pe("barsEl"), r = Array.from({ length: t.bars }, () => L), i, a = () => typeof window < "u" && window.matchMedia?.("(prefers-reduced-motion: reduce)").matches === !0, o = () => {
|
|
119
119
|
let e = Math.min(1, Math.max(0, t.sample())), n = t.spectrum?.(), i = r.length;
|
|
120
120
|
if (!n?.length) {
|
|
121
121
|
let t = Date.now() / 260;
|
|
122
122
|
return Array.from({ length: i }, (n, r) => {
|
|
123
123
|
let i = .65 + .35 * Math.sin(t + r * .9);
|
|
124
|
-
return
|
|
124
|
+
return L + e * 2.4 * i;
|
|
125
125
|
});
|
|
126
126
|
}
|
|
127
127
|
let a = Math.max(1, Math.floor(n.length / 2)), o = Math.max(1, Math.floor(a / i));
|
|
128
128
|
return Array.from({ length: i }, (e, t) => {
|
|
129
129
|
let r = 0;
|
|
130
130
|
for (let e = 0; e < o; e += 1) r += n[t * o + e] ?? 0;
|
|
131
|
-
return
|
|
131
|
+
return L + r / o / 255 * 2.2;
|
|
132
132
|
});
|
|
133
133
|
}, s = () => {
|
|
134
134
|
let e = n.value?.children;
|
|
@@ -137,36 +137,36 @@ var F = {
|
|
|
137
137
|
});
|
|
138
138
|
}, c = () => {
|
|
139
139
|
let e = o();
|
|
140
|
-
r = r.map((t, n) => t + (Math.min(1, Math.max(
|
|
140
|
+
r = r.map((t, n) => t + (Math.min(1, Math.max(L, e[n] ?? L)) - t) * Se), s(), i = requestAnimationFrame(c);
|
|
141
141
|
}, l = () => {
|
|
142
142
|
i !== void 0 && (cancelAnimationFrame(i), i = void 0);
|
|
143
143
|
};
|
|
144
|
-
return
|
|
145
|
-
e !== "listening" && e !== "speaking" || a() ? (l(), r = r.map(() =>
|
|
146
|
-
}, { immediate: !0 }),
|
|
147
|
-
class:
|
|
144
|
+
return M(() => t.state, async (e) => {
|
|
145
|
+
e !== "listening" && e !== "speaking" || a() ? (l(), r = r.map(() => L * 1.6), await ae(), s()) : i === void 0 && (i = requestAnimationFrame(c));
|
|
146
|
+
}, { immediate: !0 }), oe(l), (t, r) => (D(), S("div", {
|
|
147
|
+
class: E(["pk-voice-orb", `pk-voice-orb--${e.state}`]),
|
|
148
148
|
"aria-hidden": "true"
|
|
149
149
|
}, [C("div", {
|
|
150
150
|
ref_key: "barsEl",
|
|
151
151
|
ref: n,
|
|
152
152
|
class: "pk-voice-orb__bars"
|
|
153
|
-
}, [(
|
|
153
|
+
}, [(D(!0), S(_, null, de(e.bars, (e) => (D(), S("span", {
|
|
154
154
|
key: e,
|
|
155
155
|
class: "pk-voice-orb__bar"
|
|
156
156
|
}))), 128))], 512)], 2));
|
|
157
157
|
}
|
|
158
|
-
}),
|
|
158
|
+
}), we = {
|
|
159
159
|
key: 0,
|
|
160
160
|
class: "pk-voice-session__badge",
|
|
161
161
|
"aria-hidden": "true"
|
|
162
|
-
},
|
|
162
|
+
}, Te = {
|
|
163
163
|
class: "pk-voice-session__status",
|
|
164
164
|
role: "status"
|
|
165
|
-
},
|
|
165
|
+
}, R = {
|
|
166
166
|
key: 0,
|
|
167
167
|
class: "pk-voice-session__live-dot",
|
|
168
168
|
"aria-hidden": "true"
|
|
169
|
-
},
|
|
169
|
+
}, z = ["title"], Ee = ["title"], De = { class: "pk-voice-session__actions" }, Oe = /* @__PURE__ */ re({
|
|
170
170
|
__name: "PkVoiceSession",
|
|
171
171
|
props: {
|
|
172
172
|
state: {},
|
|
@@ -185,7 +185,7 @@ var F = {
|
|
|
185
185
|
"dismiss"
|
|
186
186
|
],
|
|
187
187
|
setup(e, { emit: t }) {
|
|
188
|
-
let n = e, r = t, { t: i } =
|
|
188
|
+
let n = e, r = t, { t: i } = me({ useScope: "global" }), a = y(() => n.error ? i("message.voiceFailed") : n.state === "connecting" ? i("message.voiceConnecting") : n.state === "speaking" ? i("message.voiceSpeaking") : n.muted ? i("message.voiceMuted") : i("message.voiceListening")), o = y(() => {
|
|
189
189
|
if (n.remainingSeconds === void 0) return;
|
|
190
190
|
let e = Math.floor(n.remainingSeconds / 60), t = n.remainingSeconds % 60;
|
|
191
191
|
return `${e}:${String(t).padStart(2, "0")}`;
|
|
@@ -194,8 +194,8 @@ var F = {
|
|
|
194
194
|
});
|
|
195
195
|
return (t, n) => {
|
|
196
196
|
let u = g;
|
|
197
|
-
return
|
|
198
|
-
e.error ? (
|
|
197
|
+
return D(), S("div", { class: E(["pk-voice-session", { "pk-voice-session--failed": !!e.error }]) }, [
|
|
198
|
+
e.error ? (D(), S("span", we, [w(u, { name: "ri:error-warning-line" })])) : (D(), b(Ce, {
|
|
199
199
|
key: 1,
|
|
200
200
|
state: e.state,
|
|
201
201
|
sample: e.sample,
|
|
@@ -205,37 +205,37 @@ var F = {
|
|
|
205
205
|
"sample",
|
|
206
206
|
"spectrum"
|
|
207
207
|
])),
|
|
208
|
-
C("div",
|
|
208
|
+
C("div", Te, [C("span", { class: E(["pk-voice-session__state", l.value && `pk-voice-session__state--${l.value}`]) }, [c.value ? (D(), S("span", R)) : x("", !0), ne(" " + A(a.value), 1)], 2), e.error ? (D(), S("p", {
|
|
209
209
|
key: 0,
|
|
210
210
|
class: "pk-voice-session__detail",
|
|
211
211
|
title: e.rawError ?? e.error
|
|
212
|
-
},
|
|
213
|
-
o.value ? (
|
|
212
|
+
}, A(e.error), 9, z)) : x("", !0)]),
|
|
213
|
+
o.value ? (D(), S("span", {
|
|
214
214
|
key: 2,
|
|
215
|
-
class:
|
|
216
|
-
title:
|
|
215
|
+
class: E(["pk-voice-session__timer", { "pk-voice-session__timer--warning": s.value }]),
|
|
216
|
+
title: j(i)("hint.voiceRemaining"),
|
|
217
217
|
"aria-hidden": "true"
|
|
218
|
-
},
|
|
219
|
-
C("div",
|
|
218
|
+
}, A(o.value), 11, Ee)) : x("", !0),
|
|
219
|
+
C("div", De, [e.error ? (D(), S(_, { key: 0 }, [w(d, {
|
|
220
220
|
icon: "ri:refresh-line",
|
|
221
|
-
label:
|
|
221
|
+
label: j(i)("action.retry"),
|
|
222
222
|
onClick: n[0] ||= (e) => r("retry")
|
|
223
|
-
}, null, 8, ["label"]), e.live ? (
|
|
223
|
+
}, null, 8, ["label"]), e.live ? (D(), b(d, {
|
|
224
224
|
key: 0,
|
|
225
225
|
icon: "ri:stop-circle-line",
|
|
226
226
|
modifiers: "danger",
|
|
227
|
-
title:
|
|
228
|
-
"aria-label":
|
|
227
|
+
title: j(i)("action.hangUp"),
|
|
228
|
+
"aria-label": j(i)("action.hangUp"),
|
|
229
229
|
onClick: n[1] ||= (e) => r("hang-up")
|
|
230
|
-
}, null, 8, ["title", "aria-label"])) : (
|
|
230
|
+
}, null, 8, ["title", "aria-label"])) : (D(), b(d, {
|
|
231
231
|
key: 1,
|
|
232
232
|
icon: "ri:close-line",
|
|
233
|
-
label:
|
|
233
|
+
label: j(i)("action.close"),
|
|
234
234
|
onClick: n[2] ||= (e) => r("dismiss")
|
|
235
|
-
}, null, 8, ["label"]))], 64)) : (
|
|
235
|
+
}, null, 8, ["label"]))], 64)) : (D(), S(_, { key: 1 }, [w(d, {
|
|
236
236
|
icon: e.muted ? "ri:mic-off-line" : "ri:mic-line",
|
|
237
|
-
title: e.muted ?
|
|
238
|
-
"aria-label": e.muted ?
|
|
237
|
+
title: e.muted ? j(i)("action.unmute") : j(i)("action.mute"),
|
|
238
|
+
"aria-label": e.muted ? j(i)("action.unmute") : j(i)("action.mute"),
|
|
239
239
|
"aria-pressed": e.muted,
|
|
240
240
|
onClick: n[3] ||= (e) => r("toggle-mute")
|
|
241
241
|
}, null, 8, [
|
|
@@ -246,15 +246,15 @@ var F = {
|
|
|
246
246
|
]), w(d, {
|
|
247
247
|
icon: "ri:stop-circle-line",
|
|
248
248
|
modifiers: "danger",
|
|
249
|
-
title:
|
|
250
|
-
"aria-label":
|
|
249
|
+
title: j(i)("action.hangUp"),
|
|
250
|
+
"aria-label": j(i)("action.hangUp"),
|
|
251
251
|
onClick: n[4] ||= (e) => r("hang-up")
|
|
252
252
|
}, null, 8, ["title", "aria-label"])], 64))])
|
|
253
253
|
], 2);
|
|
254
254
|
};
|
|
255
255
|
}
|
|
256
|
-
}),
|
|
257
|
-
let t =
|
|
256
|
+
}), ke = (e) => {
|
|
257
|
+
let t = k(), n = O("disconnected"), r = O("listening"), i = O(), o = O([]), s = O(), c = O(), l, u, d = 0, f = !1, p = () => {
|
|
258
258
|
u &&= (clearInterval(u), void 0), s.value = void 0;
|
|
259
259
|
}, ee = (e) => {
|
|
260
260
|
let t = Date.now() + e * 1e3, n = () => {
|
|
@@ -291,6 +291,7 @@ var F = {
|
|
|
291
291
|
let h = await f.startSession({
|
|
292
292
|
signedUrl: d.signedUrl,
|
|
293
293
|
customLlmExtraBody: { voice_session_id: d.sessionId },
|
|
294
|
+
clientTools: e.clientTools?.() ?? {},
|
|
294
295
|
onStatusChange: ({ status: e }) => {
|
|
295
296
|
s() && (n.value = e);
|
|
296
297
|
},
|
|
@@ -356,7 +357,7 @@ var F = {
|
|
|
356
357
|
let r = t.value;
|
|
357
358
|
t.value = void 0, r?.endSession().catch(() => void 0), n.value = "disconnected";
|
|
358
359
|
};
|
|
359
|
-
return typeof window < "u" && window.addEventListener("pagehide", C),
|
|
360
|
+
return typeof window < "u" && window.addEventListener("pagehide", C), ce(() => {
|
|
360
361
|
f = !0, typeof window < "u" && window.removeEventListener("pagehide", C), h();
|
|
361
362
|
}), {
|
|
362
363
|
status: n,
|
|
@@ -377,13 +378,13 @@ var F = {
|
|
|
377
378
|
readLevel: x,
|
|
378
379
|
readSpectrum: S
|
|
379
380
|
};
|
|
380
|
-
},
|
|
381
|
+
}, Ae = 4e3, je = [
|
|
381
382
|
3e3,
|
|
382
383
|
5e3,
|
|
383
384
|
1e4
|
|
384
|
-
],
|
|
385
|
-
function
|
|
386
|
-
let t =
|
|
385
|
+
], Me = 12e4, Ne = 3e4;
|
|
386
|
+
function Pe(e) {
|
|
387
|
+
let t = O(null), n = O(!1), r, i = !1, a = () => {
|
|
387
388
|
clearTimeout(r), r = void 0;
|
|
388
389
|
}, o = (e, t) => {
|
|
389
390
|
a(), i || (r = setTimeout(() => void t(), e));
|
|
@@ -400,12 +401,12 @@ function Ne(e) {
|
|
|
400
401
|
}
|
|
401
402
|
let r = t.value;
|
|
402
403
|
if (r) {
|
|
403
|
-
let e = Date.parse(r.dueAt) - Date.now() +
|
|
404
|
-
o(Math.max(
|
|
404
|
+
let e = Date.parse(r.dueAt) - Date.now() + Ae;
|
|
405
|
+
o(Math.max(Ae, e), () => l(r.wakeId, Date.now(), 0));
|
|
405
406
|
}
|
|
406
407
|
}
|
|
407
408
|
async function l(t, n, r) {
|
|
408
|
-
await e.refreshMessages(), !i && (s(t) || Date.now() - n >=
|
|
409
|
+
await e.refreshMessages(), !i && (s(t) || Date.now() - n >= Me ? await c() : o(je[Math.min(r, je.length - 1)], () => l(t, n, r + 1)));
|
|
409
410
|
}
|
|
410
411
|
async function u() {
|
|
411
412
|
n.value = !0;
|
|
@@ -430,11 +431,11 @@ function Ne(e) {
|
|
|
430
431
|
f = void 0;
|
|
431
432
|
}
|
|
432
433
|
let h = y(() => e.messages().some((e) => e.role === "user"));
|
|
433
|
-
|
|
434
|
+
M([e.chatId, h], ([, t]) => {
|
|
434
435
|
d();
|
|
435
436
|
let n = e.status(), r = n === "submitted" || n === "streaming" || f === e.chatId();
|
|
436
437
|
t && !r && c();
|
|
437
|
-
}, { immediate: !0 }),
|
|
438
|
+
}, { immediate: !0 }), M(e.status, (e, t) => {
|
|
438
439
|
e === "ready" && t !== "ready" && h.value && c();
|
|
439
440
|
});
|
|
440
441
|
let g;
|
|
@@ -442,9 +443,9 @@ function Ne(e) {
|
|
|
442
443
|
t.value && document.visibilityState === "visible" && e.apiClient().markChatWakeupPresence(e.agentId(), e.chatId()).catch(() => void 0);
|
|
443
444
|
}
|
|
444
445
|
let v = () => _();
|
|
445
|
-
return document.addEventListener("visibilitychange", v),
|
|
446
|
-
clearInterval(g), g = void 0, e && !i && (_(), g = setInterval(_,
|
|
447
|
-
}),
|
|
446
|
+
return document.addEventListener("visibilitychange", v), M(() => t.value?.wakeId, (e) => {
|
|
447
|
+
clearInterval(g), g = void 0, e && !i && (_(), g = setInterval(_, Ne));
|
|
448
|
+
}), oe(() => {
|
|
448
449
|
i = !0, a(), clearInterval(g), document.removeEventListener("visibilitychange", v);
|
|
449
450
|
}), {
|
|
450
451
|
pendingWakeup: t,
|
|
@@ -458,19 +459,19 @@ function Ne(e) {
|
|
|
458
459
|
};
|
|
459
460
|
}
|
|
460
461
|
// ../../packages/components/src/chat/PkChatbotViewChat.vue?vue&type=script&setup=true&lang.ts
|
|
461
|
-
var
|
|
462
|
+
var Fe = { class: "pk-chatbot-view-chat__input-stage" }, Ie = {
|
|
462
463
|
key: 1,
|
|
463
464
|
class: "p-md border-t border-surface-3 text-center text-12 text-danger bg-surface-danger"
|
|
464
|
-
},
|
|
465
|
+
}, Le = { class: "pk-chatbot-view-chat__agent-chip" }, Re = {
|
|
465
466
|
key: 0,
|
|
466
467
|
class: "pk-chatbot-view-chat__agent-chip-name"
|
|
467
|
-
},
|
|
468
|
+
}, ze = {
|
|
468
469
|
key: 0,
|
|
469
470
|
class: "pk-chatbot-view-chat__drop-overlay"
|
|
470
|
-
},
|
|
471
|
+
}, Be = {
|
|
471
472
|
key: 1,
|
|
472
473
|
class: "pk-chatbot-view-chat__preview"
|
|
473
|
-
},
|
|
474
|
+
}, Ve = 1e3, He = 3e3, Ue = 6e4, We = 3e5, Ge = 6e5, Ke = /* @__PURE__ */ re({
|
|
474
475
|
__name: "PkChatbotViewChat",
|
|
475
476
|
props: {
|
|
476
477
|
agentId: {},
|
|
@@ -479,258 +480,263 @@ var Pe = { class: "pk-chatbot-view-chat__input-stage" }, Fe = {
|
|
|
479
480
|
},
|
|
480
481
|
emits: ["show-info", "revise"],
|
|
481
482
|
setup(a, { emit: d }) {
|
|
482
|
-
let _ = T(() => import("./PkToolShowForm-
|
|
483
|
-
|
|
484
|
-
let
|
|
485
|
-
|
|
486
|
-
|
|
483
|
+
let _ = T(() => import("./PkToolShowForm-DuX1By1C.js").then((e) => e.n)), ne = T(() => import("./PkToolShowContactForm-BNta1jh0.js").then((e) => e.n)), re = T(() => import("./PkToolShowSuggestedReply-CxOyvAB6.js").then((e) => e.n)), ae = T(() => import("./PkToolShowSources-89OXReX8.js").then((e) => e.n)), se = T(() => import("./PkToolRequestGeolocation-Bzu1fQ-X.js")), ce = T(() => import("./PkToolRequestOAuthConnection-C8t_5YtB.js")), le = T(() => import("./PkToolShowLocation-Cq0IXye1.js").then((e) => e.n)), de = T(() => import("./PkToolShowDiagram-BRHpp_P-.js")), k = T(() => import("./PkToolChatFile-CMcJl0hu.js")), fe = T(() => import("./PkToolShareDocument-CRghPfep.js").then((e) => e.n)), ye = T(() => import("./PkFilePreview-Cx6jmJCD.js")), P = a, be = d, F = r(P.agentId), { agentInterface: I, agentFileUpload: L, agentType: Se, agentVoice: Ce, actions: we, revisedAnswers: Te, messages: R, chat: z, messageFeedbacks: Ee, feedbackDialogMessage: De, isFeedbackSubmitting: Ae, isFeedbackSubmitted: je, feedbackSubmitError: Me, isLeadSubmitted: Ne, isLoadingSubmitLead: Ke, submitLeadError: qe, input: B, inputMessagePlaceholder: Je, isConversationBlocked: Ye, baseUrl: Xe, pendingAttachments: Ze, isAttachmentLimitReached: Qe, fileLimitError: $e, apiClient: V, isDark: et, hostToolsPending: tt, pageNoticeLevel: nt, hostConfirmation: rt, agentPageAccess: it, hostStepTitles: at, canQueue: ot, queuedMessages: st, backgroundAnswers: ct, inputFocusRequest: lt } = _e(F);
|
|
484
|
+
ue(c, at);
|
|
485
|
+
let ut = pe("inputEl");
|
|
486
|
+
M(lt, () => {
|
|
487
|
+
ut.value?.focus();
|
|
487
488
|
});
|
|
488
|
-
let
|
|
489
|
-
let e =
|
|
490
|
-
if (e) return e.reason === "per-chat" ?
|
|
491
|
-
}),
|
|
489
|
+
let H = y(() => Se.value === "reasoning" ? void 0 : L.value), U = (e) => V.value.getMediaDownloadUrl(P.agentId, F.localChatId, e), { handleSubmit: dt, stopGeneration: ft, regenerate: pt, onUpvote: mt, onDownvote: ht, onFeedback: gt, onFeedbackSubmit: _t, onLeadSubmit: vt, startNewChat: yt, addToolOutput: bt, addToolApprovalResponse: xt, handleFileSelect: St, clearFileLimitError: Ct, refreshMessages: wt, appendMessage: Tt, closePageNotice: Et, respondHostConfirmation: Dt, editQueuedMessage: Ot, removeQueuedMessage: kt, openBackgroundAnswer: At, dismissBackgroundAnswer: jt } = F, { t: W } = me({ useScope: "global" }), Mt = y(() => tt.value > 0), Nt = y(() => Mt.value && z.value.status === "ready" ? "streaming" : z.value.status), Pt = l(() => it.value?.notice), Ft = y(() => nt.value ? Pt.value || W(`message.pageAccessNotice.${nt.value}`) : void 0), It = y(() => {
|
|
490
|
+
let e = $e.value;
|
|
491
|
+
if (e) return e.reason === "per-chat" ? W("message.fileLimitPerChat", { max: e.max }) : W("message.fileLimitPerMessage", { max: e.max });
|
|
492
|
+
}), Lt = y(() => ct.value.map(({ chatId: e, title: t }) => ({
|
|
492
493
|
id: e,
|
|
493
|
-
text: t ?
|
|
494
|
-
}))),
|
|
494
|
+
text: t ? W("message.backgroundAnswerReady", { title: t }) : W("message.backgroundAnswerReadyUntitled")
|
|
495
|
+
}))), Rt = l(() => I.value?.dismissableNotice), zt = y(() => R.value.some((e) => e.role === "user")), Bt = y(() => P.modifier === "fullscreen" && !zt.value), Vt = ve(I, () => P.userName), Ht = pe("chatViewEl"), { width: Ut } = ge(Ht, {
|
|
495
496
|
width: 0,
|
|
496
497
|
height: 0
|
|
497
|
-
}, { box: "border-box" }),
|
|
498
|
-
|
|
499
|
-
let t =
|
|
500
|
-
if (
|
|
501
|
-
|
|
502
|
-
let n = () =>
|
|
498
|
+
}, { box: "border-box" }), Wt = y(() => Ut.value >= Ve), Gt = y(() => Ut.value > 0 && Ut.value < 576), G = O(), Kt = O(), K = O(!1), qt = O(!1), Jt = /* @__PURE__ */ new Map(), Yt = async (e) => {
|
|
499
|
+
G.value = e, qt.value = !1;
|
|
500
|
+
let t = Jt.get(e.storedFileName);
|
|
501
|
+
if (Kt.value = t, K.value = !1, t) return;
|
|
502
|
+
K.value = !0;
|
|
503
|
+
let n = () => G.value?.storedFileName === e.storedFileName;
|
|
503
504
|
try {
|
|
504
|
-
let t = await
|
|
505
|
-
|
|
505
|
+
let t = await V.value.getChatFilePreview(P.agentId, F.localChatId, e.storedFileName);
|
|
506
|
+
Jt.set(e.storedFileName, t), n() && (Kt.value = t);
|
|
506
507
|
} catch {
|
|
507
|
-
n() && (
|
|
508
|
+
n() && (qt.value = !0);
|
|
508
509
|
} finally {
|
|
509
|
-
n() && (
|
|
510
|
+
n() && (K.value = !1);
|
|
510
511
|
}
|
|
511
|
-
},
|
|
512
|
-
|
|
513
|
-
},
|
|
514
|
-
get: () => !!
|
|
512
|
+
}, Xt = () => {
|
|
513
|
+
G.value = void 0;
|
|
514
|
+
}, Zt = y({
|
|
515
|
+
get: () => !!G.value && !Wt.value,
|
|
515
516
|
set: (e) => {
|
|
516
|
-
e ||
|
|
517
|
+
e || Xt();
|
|
517
518
|
}
|
|
518
519
|
});
|
|
519
|
-
|
|
520
|
-
|
|
520
|
+
M(() => F.localChatId, () => {
|
|
521
|
+
Xt(), Jt.clear();
|
|
521
522
|
});
|
|
522
|
-
let
|
|
523
|
-
let t = await
|
|
523
|
+
let Qt = async (e) => (await V.value.expandSourceContext(P.agentId, e.documentId, e.chunkIndex)).content, $t = async (e) => {
|
|
524
|
+
let t = await V.value.downloadSourceDocument(P.agentId, e);
|
|
524
525
|
window.open(t.downloadUrl, "_blank");
|
|
525
|
-
}, { isOverDropZone:
|
|
526
|
-
dataTypes: (e) => t(e,
|
|
526
|
+
}, { isOverDropZone: en } = he(Ht, {
|
|
527
|
+
dataTypes: (e) => t(e, H.value?.allowedMimeTypes ?? []),
|
|
527
528
|
onDrop: (e) => {
|
|
528
|
-
if (
|
|
529
|
+
if (H.value?.enabled && e) for (let t of e) St(t);
|
|
529
530
|
}
|
|
530
|
-
}),
|
|
531
|
+
}), q = O(!1), J = !1, Y = O(!1), tn = [
|
|
531
532
|
3e3,
|
|
532
533
|
5e3,
|
|
533
534
|
1e4
|
|
534
|
-
],
|
|
535
|
-
function
|
|
536
|
-
clearTimeout(
|
|
535
|
+
], nn, X, rn = !1, an = 0, on = !1;
|
|
536
|
+
function sn() {
|
|
537
|
+
clearTimeout(nn), nn = void 0, X = void 0, rn = !1, an = 0, Y.value = !1;
|
|
537
538
|
}
|
|
538
|
-
function
|
|
539
|
-
|
|
540
|
-
|
|
539
|
+
function cn(e) {
|
|
540
|
+
J || (clearTimeout(nn), nn = setTimeout(() => {
|
|
541
|
+
ln();
|
|
541
542
|
}, e));
|
|
542
543
|
}
|
|
543
|
-
async function
|
|
544
|
-
if (
|
|
545
|
-
|
|
544
|
+
async function ln() {
|
|
545
|
+
if (J || on) return;
|
|
546
|
+
on = !0;
|
|
546
547
|
let e;
|
|
547
548
|
try {
|
|
548
|
-
e = await
|
|
549
|
+
e = await wt();
|
|
549
550
|
} finally {
|
|
550
|
-
|
|
551
|
+
on = !1;
|
|
551
552
|
}
|
|
552
|
-
if (
|
|
553
|
-
if (e === "caught-up" && (
|
|
554
|
-
|
|
553
|
+
if (J) return;
|
|
554
|
+
if (e === "caught-up" && (Y.value = !1, Rn()), Z.isActive.value) {
|
|
555
|
+
X = void 0, rn = !1, an = 0, cn(He);
|
|
555
556
|
return;
|
|
556
557
|
}
|
|
557
|
-
|
|
558
|
-
let t = Date.now() -
|
|
559
|
-
if (e === "caught-up" && t >= (
|
|
560
|
-
|
|
558
|
+
X === void 0 && (X = Date.now(), rn = !!Z.error.value);
|
|
559
|
+
let t = Date.now() - X;
|
|
560
|
+
if (e === "caught-up" && t >= (rn ? We : Ue) || t >= Ge) {
|
|
561
|
+
sn(), zn();
|
|
561
562
|
return;
|
|
562
563
|
}
|
|
563
|
-
let n =
|
|
564
|
-
|
|
564
|
+
let n = tn[Math.min(an, tn.length - 1)];
|
|
565
|
+
an += 1, cn(n);
|
|
565
566
|
}
|
|
566
|
-
let
|
|
567
|
-
|
|
568
|
-
},
|
|
567
|
+
let un = (e = 1200) => {
|
|
568
|
+
cn(e);
|
|
569
|
+
}, dn, Z = ke({
|
|
569
570
|
fetchGrant: async () => {
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
571
|
+
dn = F.voicePageTools();
|
|
572
|
+
let e = await V.value.createVoiceSession(P.agentId, F.localChatId, {
|
|
573
|
+
deviceContext: F.buildDeviceContext(),
|
|
574
|
+
externalContext: F.externalContext,
|
|
575
|
+
pageTools: dn?.declaration
|
|
573
576
|
});
|
|
574
|
-
return e.chatId !==
|
|
577
|
+
return e.chatId !== F.localChatId && (F.localChatId = e.chatId), e;
|
|
575
578
|
},
|
|
576
|
-
closeGrant: (e) =>
|
|
579
|
+
closeGrant: (e) => V.value.closeVoiceSession(P.agentId, e),
|
|
580
|
+
clientTools: () => dn?.clientTools,
|
|
577
581
|
onTranscript: (e) => {
|
|
578
|
-
e.role === "user" ? (
|
|
582
|
+
e.role === "user" ? (Y.value = !0, Ln(), Tt({
|
|
579
583
|
id: `${i}user-${n()}`,
|
|
580
584
|
role: "user",
|
|
581
585
|
parts: [{
|
|
582
586
|
type: "text",
|
|
583
587
|
text: e.text
|
|
584
588
|
}]
|
|
585
|
-
})) :
|
|
589
|
+
})) : Y.value = !1;
|
|
586
590
|
},
|
|
587
591
|
onTurnEnd: () => {
|
|
588
|
-
|
|
592
|
+
un();
|
|
589
593
|
}
|
|
590
594
|
});
|
|
591
|
-
|
|
592
|
-
e
|
|
595
|
+
M(() => Z.isActive.value, (e) => {
|
|
596
|
+
e || F.cancelVoicePageCalls();
|
|
597
|
+
}), M(() => Z.error.value, (e) => {
|
|
598
|
+
e && (Y.value = !1);
|
|
593
599
|
});
|
|
594
|
-
let
|
|
595
|
-
let e =
|
|
596
|
-
if (e) return /took too long/i.test(e) ?
|
|
597
|
-
}),
|
|
598
|
-
|
|
599
|
-
}, _n = async () => {
|
|
600
|
-
X.value = !1, await Q.stop(), !Y && ln(0);
|
|
601
|
-
}, vn = () => {
|
|
602
|
-
Q.dismissError();
|
|
600
|
+
let fn = y(() => Ce.value?.enabled === !0), pn = y(() => Z.error.value ? "error" : Z.isConnecting.value ? "connecting" : Z.isSpeaking.value ? "speaking" : Z.isActive.value ? "listening" : "idle"), mn = y(() => {
|
|
601
|
+
let e = Z.error.value;
|
|
602
|
+
if (e) return /took too long/i.test(e) ? W("message.voiceTookTooLong") : /cascade|no response|custom_llm_error/i.test(e) ? W("message.voiceNoAnswer") : W("message.voiceInterrupted");
|
|
603
|
+
}), hn = y(() => Z.isSpeaking.value ? "output" : "input"), gn = () => Z.readLevel(hn.value), _n = () => Z.readSpectrum(hn.value), vn = async () => {
|
|
604
|
+
q.value = !1, await Z.start(), Z.isActive.value && (sn(), cn(He));
|
|
603
605
|
}, yn = async () => {
|
|
604
|
-
|
|
605
|
-
},
|
|
606
|
-
|
|
606
|
+
Y.value = !1, await Z.stop(), !J && un(0);
|
|
607
|
+
}, bn = () => {
|
|
608
|
+
Z.dismissError();
|
|
609
|
+
}, xn = async () => {
|
|
610
|
+
Z.dismissError(), await Z.stop(), await vn();
|
|
611
|
+
}, Q = (e) => e?.toolCallId ?? "", Sn = O(/* @__PURE__ */ new Set()), Cn = (e) => Sn.value.has(Q(e)), wn = O(/* @__PURE__ */ new Map()), $ = (e, t) => Z.isActive.value ? (Z.sendUserMessage(t) && (Sn.value = new Set(Sn.value).add(Q(e)), un()), !0) : !1, Tn = (e, t, n) => {
|
|
612
|
+
$(t, o(t, n)) || bt({
|
|
607
613
|
tool: e,
|
|
608
|
-
toolCallId:
|
|
614
|
+
toolCallId: Q(t),
|
|
609
615
|
output: n
|
|
610
616
|
});
|
|
611
|
-
},
|
|
612
|
-
let t = e.confirmed ?
|
|
613
|
-
|
|
617
|
+
}, En = (e) => {
|
|
618
|
+
let t = e.confirmed ? W("message.voiceConfirmed") : W("message.voiceCancelled");
|
|
619
|
+
$({ toolCallId: e.toolCallId }, t) ? Sn.value.has(e.toolCallId) && (wn.value = new Map(wn.value).set(e.toolCallId, e.confirmed)) : bt({
|
|
614
620
|
tool: "requestConfirm",
|
|
615
621
|
toolCallId: e.toolCallId,
|
|
616
622
|
output: e.confirmed ? "confirmed" : "cancelled"
|
|
617
623
|
});
|
|
618
|
-
},
|
|
624
|
+
}, Dn = /* @__PURE__ */ new Set([
|
|
619
625
|
"tool-editSpreadsheet",
|
|
620
626
|
"tool-editWordDocument",
|
|
621
627
|
"tool-createSpreadsheet",
|
|
622
628
|
"tool-createWordDocument"
|
|
623
|
-
]),
|
|
629
|
+
]), On = y(() => {
|
|
624
630
|
let e = /* @__PURE__ */ new Map();
|
|
625
|
-
for (let t of
|
|
631
|
+
for (let t of R.value) for (let n of t.parts) {
|
|
626
632
|
let { type: t, state: r, output: i } = n;
|
|
627
|
-
|
|
633
|
+
Dn.has(t) && r === "output-available" && i?.fileId && i.version && e.set(i.fileId, Math.max(e.get(i.fileId) ?? 0, i.version));
|
|
628
634
|
}
|
|
629
635
|
return e;
|
|
630
|
-
}),
|
|
631
|
-
|
|
632
|
-
}),
|
|
633
|
-
|
|
634
|
-
},
|
|
635
|
-
let n = t.error ?
|
|
636
|
-
|
|
636
|
+
}), kn = y(() => Ye.value ? void 0 : (e) => {
|
|
637
|
+
B.value = W("messagePart.chatFileRestoreRequest", e), dt();
|
|
638
|
+
}), An = (e, t) => {
|
|
639
|
+
$(e, t) || (B.value = t, dt());
|
|
640
|
+
}, jn = (e, t) => {
|
|
641
|
+
let n = t.error ? W("message.voiceLocationRefused") : W("message.voiceLocationShared", { place: t.displayName ?? `${t.latitude}, ${t.longitude}` });
|
|
642
|
+
$(e, n) || bt({
|
|
637
643
|
tool: "requestGeolocation",
|
|
638
|
-
toolCallId:
|
|
644
|
+
toolCallId: Q(e),
|
|
639
645
|
output: t
|
|
640
646
|
});
|
|
641
|
-
},
|
|
642
|
-
|
|
647
|
+
}, Mn = (e, t) => {
|
|
648
|
+
$(e, W("message.voiceConnectionDone")) || bt({
|
|
643
649
|
tool: "requestOAuthConnection",
|
|
644
|
-
toolCallId:
|
|
650
|
+
toolCallId: Q(e),
|
|
645
651
|
output: {
|
|
646
652
|
connected: !0,
|
|
647
653
|
mcpServerId: t
|
|
648
654
|
}
|
|
649
655
|
});
|
|
650
|
-
},
|
|
651
|
-
|
|
656
|
+
}, Nn = () => {
|
|
657
|
+
q.value = !q.value, Z.setMuted(q.value);
|
|
652
658
|
};
|
|
653
|
-
|
|
654
|
-
|
|
659
|
+
oe(() => {
|
|
660
|
+
J = !0, sn();
|
|
655
661
|
});
|
|
656
|
-
let { pendingWakeup:
|
|
657
|
-
agentId: () =>
|
|
658
|
-
chatId: () =>
|
|
659
|
-
apiClient: () =>
|
|
660
|
-
messages: () =>
|
|
661
|
-
refreshMessages:
|
|
662
|
-
status: () =>
|
|
662
|
+
let { pendingWakeup: Pn, isStopping: Fn, stop: In, spokenTurnStarted: Ln, spokenTurnsWritten: Rn, forgetSpokenTurns: zn } = Pe({
|
|
663
|
+
agentId: () => P.agentId,
|
|
664
|
+
chatId: () => F.localChatId,
|
|
665
|
+
apiClient: () => V.value,
|
|
666
|
+
messages: () => R.value,
|
|
667
|
+
refreshMessages: wt,
|
|
668
|
+
status: () => z.value.status
|
|
663
669
|
});
|
|
664
670
|
return (t, n) => {
|
|
665
671
|
let r = g, i = h;
|
|
666
|
-
return
|
|
672
|
+
return D(), S("div", {
|
|
667
673
|
ref_key: "chatViewEl",
|
|
668
|
-
ref:
|
|
669
|
-
class:
|
|
670
|
-
"pk-chatbot-view-chat--dragover":
|
|
671
|
-
"pk-chatbot-view-chat--empty":
|
|
672
|
-
"pk-chatbot-view-chat--with-preview": !!
|
|
674
|
+
ref: Ht,
|
|
675
|
+
class: E(["pk-chatbot-view-chat", {
|
|
676
|
+
"pk-chatbot-view-chat--dragover": j(en) && H.value?.enabled,
|
|
677
|
+
"pk-chatbot-view-chat--empty": Bt.value,
|
|
678
|
+
"pk-chatbot-view-chat--with-preview": !!G.value && Wt.value
|
|
673
679
|
}])
|
|
674
680
|
}, [
|
|
675
681
|
w(v, {
|
|
676
682
|
name: "pk-chatbot-view-chat-fade",
|
|
677
683
|
mode: "out-in"
|
|
678
684
|
}, {
|
|
679
|
-
default:
|
|
685
|
+
default: N(() => [Bt.value ? (D(), b(ee, {
|
|
680
686
|
key: 0,
|
|
681
|
-
greeting:
|
|
682
|
-
logo:
|
|
683
|
-
name:
|
|
687
|
+
greeting: j(Vt),
|
|
688
|
+
logo: j(I)?.logo,
|
|
689
|
+
name: j(F).name
|
|
684
690
|
}, null, 8, [
|
|
685
691
|
"greeting",
|
|
686
692
|
"logo",
|
|
687
693
|
"name"
|
|
688
|
-
])) : (
|
|
694
|
+
])) : (D(), b(e, {
|
|
689
695
|
key: 1,
|
|
690
696
|
class: "flex flex-col flex-1 min-h-0 p-md overflow-y-auto",
|
|
691
697
|
interactive: "",
|
|
692
|
-
messages:
|
|
693
|
-
"confirm-verdicts-on-call":
|
|
694
|
-
status:
|
|
695
|
-
error:
|
|
696
|
-
"main-color":
|
|
697
|
-
"text-color":
|
|
698
|
-
"revised-answers":
|
|
699
|
-
actions:
|
|
700
|
-
"message-feedbacks":
|
|
701
|
-
"feedback-message-id":
|
|
702
|
-
"feedback-loading":
|
|
703
|
-
"feedback-submitted":
|
|
704
|
-
"feedback-error":
|
|
705
|
-
"show-extended-steps":
|
|
706
|
-
"hide-reasoning":
|
|
707
|
-
"awaiting-spoken-answer":
|
|
708
|
-
"host-working":
|
|
709
|
-
"host-confirmation":
|
|
710
|
-
"is-dark":
|
|
698
|
+
messages: j(R),
|
|
699
|
+
"confirm-verdicts-on-call": wn.value,
|
|
700
|
+
status: j(z).status,
|
|
701
|
+
error: j(z).error,
|
|
702
|
+
"main-color": j(I)?.mainColor,
|
|
703
|
+
"text-color": j(I)?.textColor,
|
|
704
|
+
"revised-answers": j(Te),
|
|
705
|
+
actions: j(we),
|
|
706
|
+
"message-feedbacks": j(Ee),
|
|
707
|
+
"feedback-message-id": j(De)?.id,
|
|
708
|
+
"feedback-loading": j(Ae),
|
|
709
|
+
"feedback-submitted": j(je),
|
|
710
|
+
"feedback-error": j(Me),
|
|
711
|
+
"show-extended-steps": j(I)?.showExtendedSteps,
|
|
712
|
+
"hide-reasoning": j(I)?.showReasoning === !1,
|
|
713
|
+
"awaiting-spoken-answer": Y.value,
|
|
714
|
+
"host-working": Mt.value,
|
|
715
|
+
"host-confirmation": j(rt),
|
|
716
|
+
"is-dark": j(et),
|
|
711
717
|
"show-scroll-to-bottom": a.modifier === "fullscreen",
|
|
712
|
-
onFeedbackSubmit: n[0] ||= (e) =>
|
|
713
|
-
onFeedbackClose: n[1] ||= (e) =>
|
|
714
|
-
onRegenerate:
|
|
715
|
-
onAutoRetry:
|
|
716
|
-
onResetChat:
|
|
717
|
-
onShowInfo: n[2] ||= (e) =>
|
|
718
|
-
onRevise: n[3] ||= (e) =>
|
|
719
|
-
onUpvote:
|
|
720
|
-
onDownvote:
|
|
721
|
-
onFeedback:
|
|
722
|
-
onApprovalRespond:
|
|
723
|
-
onConfirmRespond:
|
|
724
|
-
onHostConfirmRespond:
|
|
718
|
+
onFeedbackSubmit: n[0] ||= (e) => j(_t)(e),
|
|
719
|
+
onFeedbackClose: n[1] ||= (e) => De.value = void 0,
|
|
720
|
+
onRegenerate: j(pt),
|
|
721
|
+
onAutoRetry: j(pt),
|
|
722
|
+
onResetChat: j(yt),
|
|
723
|
+
onShowInfo: n[2] ||= (e) => be("show-info", e),
|
|
724
|
+
onRevise: n[3] ||= (e) => be("revise", e),
|
|
725
|
+
onUpvote: j(mt),
|
|
726
|
+
onDownvote: j(ht),
|
|
727
|
+
onFeedback: j(gt),
|
|
728
|
+
onApprovalRespond: j(xt),
|
|
729
|
+
onConfirmRespond: En,
|
|
730
|
+
onHostConfirmRespond: j(Dt)
|
|
725
731
|
}, {
|
|
726
|
-
"tool-showContactForm":
|
|
732
|
+
"tool-showContactForm": N(({ part: e }) => [w(j(ne), {
|
|
727
733
|
part: e,
|
|
728
|
-
readonly: !
|
|
729
|
-
submitted:
|
|
730
|
-
loading:
|
|
731
|
-
error:
|
|
732
|
-
"privacy-policy-notice":
|
|
733
|
-
onSubmit:
|
|
734
|
+
readonly: !j(Xe),
|
|
735
|
+
submitted: j(Ne),
|
|
736
|
+
loading: j(Ke),
|
|
737
|
+
error: j(qe),
|
|
738
|
+
"privacy-policy-notice": j(I)?.privacyPolicyNotice,
|
|
739
|
+
onSubmit: j(vt)
|
|
734
740
|
}, null, 8, [
|
|
735
741
|
"part",
|
|
736
742
|
"readonly",
|
|
@@ -740,20 +746,20 @@ var Pe = { class: "pk-chatbot-view-chat__input-stage" }, Fe = {
|
|
|
740
746
|
"privacy-policy-notice",
|
|
741
747
|
"onSubmit"
|
|
742
748
|
])]),
|
|
743
|
-
"tool-showSuggestedReply":
|
|
749
|
+
"tool-showSuggestedReply": N(({ part: e }) => [w(j(re), {
|
|
744
750
|
part: e,
|
|
745
|
-
onSelect: (t) =>
|
|
751
|
+
onSelect: (t) => An(e, t)
|
|
746
752
|
}, null, 8, ["part", "onSelect"])]),
|
|
747
|
-
"tool-showSources":
|
|
753
|
+
"tool-showSources": N(({ part: e }) => [w(j(ae), {
|
|
748
754
|
part: e,
|
|
749
|
-
"on-expand-context":
|
|
750
|
-
"on-download":
|
|
755
|
+
"on-expand-context": Qt,
|
|
756
|
+
"on-download": $t
|
|
751
757
|
}, null, 8, ["part"])]),
|
|
752
|
-
"tool-showForm":
|
|
753
|
-
default:
|
|
758
|
+
"tool-showForm": N(({ part: e }) => [w(v, { mode: "out-in" }, {
|
|
759
|
+
default: N(() => [w(j(_), {
|
|
754
760
|
part: e,
|
|
755
|
-
answered:
|
|
756
|
-
onSelect: (t) =>
|
|
761
|
+
answered: Cn(e),
|
|
762
|
+
onSelect: (t) => Tn("showForm", e, t)
|
|
757
763
|
}, null, 8, [
|
|
758
764
|
"part",
|
|
759
765
|
"answered",
|
|
@@ -761,12 +767,12 @@ var Pe = { class: "pk-chatbot-view-chat__input-stage" }, Fe = {
|
|
|
761
767
|
])]),
|
|
762
768
|
_: 2
|
|
763
769
|
}, 1024)]),
|
|
764
|
-
"tool-showMultipleChoice":
|
|
765
|
-
default:
|
|
770
|
+
"tool-showMultipleChoice": N(({ part: e }) => [w(v, { mode: "out-in" }, {
|
|
771
|
+
default: N(() => [w(j(_), {
|
|
766
772
|
part: e,
|
|
767
773
|
"allow-custom-answer": "",
|
|
768
|
-
answered:
|
|
769
|
-
onSelect: (t) =>
|
|
774
|
+
answered: Cn(e),
|
|
775
|
+
onSelect: (t) => Tn("showMultipleChoice", e, t)
|
|
770
776
|
}, null, 8, [
|
|
771
777
|
"part",
|
|
772
778
|
"answered",
|
|
@@ -774,12 +780,12 @@ var Pe = { class: "pk-chatbot-view-chat__input-stage" }, Fe = {
|
|
|
774
780
|
])]),
|
|
775
781
|
_: 2
|
|
776
782
|
}, 1024)]),
|
|
777
|
-
"tool-requestOAuthConnection":
|
|
783
|
+
"tool-requestOAuthConnection": N(({ part: e }) => [w(j(ce), {
|
|
778
784
|
part: e,
|
|
779
|
-
"backend-url":
|
|
780
|
-
"resolve-connection": (e) =>
|
|
781
|
-
"check-connection": (e) =>
|
|
782
|
-
onConnected: (t) =>
|
|
785
|
+
"backend-url": j(Xe),
|
|
786
|
+
"resolve-connection": (e) => j(V).getOAuthAuthorizeUrl(P.agentId, e),
|
|
787
|
+
"check-connection": (e) => j(V).getOAuthConnectionStatus(P.agentId, e),
|
|
788
|
+
onConnected: (t) => Mn(e, t)
|
|
783
789
|
}, null, 8, [
|
|
784
790
|
"part",
|
|
785
791
|
"backend-url",
|
|
@@ -787,152 +793,152 @@ var Pe = { class: "pk-chatbot-view-chat__input-stage" }, Fe = {
|
|
|
787
793
|
"check-connection",
|
|
788
794
|
"onConnected"
|
|
789
795
|
])]),
|
|
790
|
-
"tool-requestGeolocation":
|
|
796
|
+
"tool-requestGeolocation": N(({ part: e }) => [w(j(se), {
|
|
791
797
|
part: e,
|
|
792
|
-
"call-live":
|
|
793
|
-
"reverse-geocode": (e, t) =>
|
|
794
|
-
onResult: (t) =>
|
|
798
|
+
"call-live": j(Z).isActive.value,
|
|
799
|
+
"reverse-geocode": (e, t) => j(V).reverseGeocode(e, t),
|
|
800
|
+
onResult: (t) => jn(e, t)
|
|
795
801
|
}, null, 8, [
|
|
796
802
|
"part",
|
|
797
803
|
"call-live",
|
|
798
804
|
"reverse-geocode",
|
|
799
805
|
"onResult"
|
|
800
806
|
])]),
|
|
801
|
-
"tool-showLocation":
|
|
807
|
+
"tool-showLocation": N(({ part: e }) => [w(j(le), {
|
|
802
808
|
part: e,
|
|
803
|
-
"is-dark":
|
|
804
|
-
"main-color":
|
|
805
|
-
"forward-geocode": (e, t) =>
|
|
809
|
+
"is-dark": j(et),
|
|
810
|
+
"main-color": j(I)?.mainColor,
|
|
811
|
+
"forward-geocode": (e, t) => j(V).forwardGeocode(e, t)
|
|
806
812
|
}, null, 8, [
|
|
807
813
|
"part",
|
|
808
814
|
"is-dark",
|
|
809
815
|
"main-color",
|
|
810
816
|
"forward-geocode"
|
|
811
817
|
])]),
|
|
812
|
-
"tool-showDiagram":
|
|
818
|
+
"tool-showDiagram": N(({ part: e }) => [w(j(de), {
|
|
813
819
|
part: e,
|
|
814
|
-
"is-dark":
|
|
820
|
+
"is-dark": j(et)
|
|
815
821
|
}, null, 8, ["part", "is-dark"])]),
|
|
816
|
-
"tool-editSpreadsheet":
|
|
817
|
-
key:
|
|
822
|
+
"tool-editSpreadsheet": N(({ part: e }) => [(D(), b(j(k), {
|
|
823
|
+
key: j(s)(e),
|
|
818
824
|
part: e,
|
|
819
|
-
"file-url":
|
|
820
|
-
preview:
|
|
821
|
-
"latest-versions":
|
|
822
|
-
restore:
|
|
825
|
+
"file-url": U,
|
|
826
|
+
preview: Yt,
|
|
827
|
+
"latest-versions": On.value,
|
|
828
|
+
restore: kn.value
|
|
823
829
|
}, null, 8, [
|
|
824
830
|
"part",
|
|
825
831
|
"latest-versions",
|
|
826
832
|
"restore"
|
|
827
833
|
]))]),
|
|
828
|
-
"tool-editWordDocument":
|
|
829
|
-
key:
|
|
834
|
+
"tool-editWordDocument": N(({ part: e }) => [(D(), b(j(k), {
|
|
835
|
+
key: j(s)(e),
|
|
830
836
|
part: e,
|
|
831
|
-
"file-url":
|
|
832
|
-
preview:
|
|
833
|
-
"latest-versions":
|
|
834
|
-
restore:
|
|
837
|
+
"file-url": U,
|
|
838
|
+
preview: Yt,
|
|
839
|
+
"latest-versions": On.value,
|
|
840
|
+
restore: kn.value
|
|
835
841
|
}, null, 8, [
|
|
836
842
|
"part",
|
|
837
843
|
"latest-versions",
|
|
838
844
|
"restore"
|
|
839
845
|
]))]),
|
|
840
|
-
"tool-createSpreadsheet":
|
|
841
|
-
key:
|
|
846
|
+
"tool-createSpreadsheet": N(({ part: e }) => [(D(), b(j(k), {
|
|
847
|
+
key: j(s)(e),
|
|
842
848
|
part: e,
|
|
843
|
-
"file-url":
|
|
844
|
-
preview:
|
|
845
|
-
"latest-versions":
|
|
846
|
-
restore:
|
|
849
|
+
"file-url": U,
|
|
850
|
+
preview: Yt,
|
|
851
|
+
"latest-versions": On.value,
|
|
852
|
+
restore: kn.value
|
|
847
853
|
}, null, 8, [
|
|
848
854
|
"part",
|
|
849
855
|
"latest-versions",
|
|
850
856
|
"restore"
|
|
851
857
|
]))]),
|
|
852
|
-
"tool-createWordDocument":
|
|
853
|
-
key:
|
|
858
|
+
"tool-createWordDocument": N(({ part: e }) => [(D(), b(j(k), {
|
|
859
|
+
key: j(s)(e),
|
|
854
860
|
part: e,
|
|
855
|
-
"file-url":
|
|
856
|
-
preview:
|
|
857
|
-
"latest-versions":
|
|
858
|
-
restore:
|
|
861
|
+
"file-url": U,
|
|
862
|
+
preview: Yt,
|
|
863
|
+
"latest-versions": On.value,
|
|
864
|
+
restore: kn.value
|
|
859
865
|
}, null, 8, [
|
|
860
866
|
"part",
|
|
861
867
|
"latest-versions",
|
|
862
868
|
"restore"
|
|
863
869
|
]))]),
|
|
864
|
-
"tool-shareDocument":
|
|
865
|
-
key:
|
|
870
|
+
"tool-shareDocument": N(({ part: e }) => [(D(), b(j(fe), {
|
|
871
|
+
key: j(s)(e),
|
|
866
872
|
part: e,
|
|
867
|
-
"on-download":
|
|
873
|
+
"on-download": $t
|
|
868
874
|
}, null, 8, ["part"]))]),
|
|
869
875
|
_: 1
|
|
870
876
|
}, 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(".")))]),
|
|
871
877
|
_: 1
|
|
872
878
|
}),
|
|
873
|
-
|
|
879
|
+
j(st).length ? (D(), b(p, {
|
|
874
880
|
key: 0,
|
|
875
|
-
messages:
|
|
876
|
-
onEdit:
|
|
877
|
-
onRemove:
|
|
881
|
+
messages: j(st),
|
|
882
|
+
onEdit: j(Ot),
|
|
883
|
+
onRemove: j(kt)
|
|
878
884
|
}, null, 8, [
|
|
879
885
|
"messages",
|
|
880
886
|
"onEdit",
|
|
881
887
|
"onRemove"
|
|
882
888
|
])) : x("", !0),
|
|
883
|
-
C("div",
|
|
889
|
+
C("div", Fe, [
|
|
884
890
|
w(v, { name: "pk-chatbot-view-chat-fade" }, {
|
|
885
|
-
default:
|
|
891
|
+
default: N(() => [Bt.value ? (D(), b(xe, {
|
|
886
892
|
key: 0,
|
|
887
893
|
class: "pk-chatbot-view-chat__aurora",
|
|
888
894
|
"source-selector": ".pk-chatbot-input__form"
|
|
889
895
|
})) : x("", !0)]),
|
|
890
896
|
_: 1
|
|
891
897
|
}),
|
|
892
|
-
|
|
898
|
+
j(Pn) && !j(Ye) ? (D(), b(m, {
|
|
893
899
|
key: 0,
|
|
894
|
-
pending:
|
|
895
|
-
stopping:
|
|
896
|
-
onStop:
|
|
900
|
+
pending: j(Pn),
|
|
901
|
+
stopping: j(Fn),
|
|
902
|
+
onStop: j(In)
|
|
897
903
|
}, null, 8, [
|
|
898
904
|
"pending",
|
|
899
905
|
"stopping",
|
|
900
906
|
"onStop"
|
|
901
907
|
])) : x("", !0),
|
|
902
|
-
|
|
908
|
+
j(Ye) ? (D(), S("div", Ie, A(j(W)("message.chatErrorConversationBlocked")), 1)) : pn.value === "idle" ? (D(), b(f, {
|
|
903
909
|
key: 3,
|
|
904
910
|
ref_key: "inputEl",
|
|
905
|
-
ref:
|
|
906
|
-
modelValue:
|
|
907
|
-
"onUpdate:modelValue": n[4] ||= (e) =>
|
|
908
|
-
"pending-attachments":
|
|
909
|
-
"onUpdate:pendingAttachments": n[5] ||= (e) =>
|
|
910
|
-
placeholder:
|
|
911
|
-
"dismissable-notice":
|
|
912
|
-
"page-notice":
|
|
913
|
-
status:
|
|
914
|
-
"max-message-length":
|
|
915
|
-
"file-upload":
|
|
916
|
-
"attachment-limit-reached":
|
|
917
|
-
"attachment-notice":
|
|
918
|
-
"voice-enabled":
|
|
919
|
-
"queue-enabled":
|
|
920
|
-
"answer-notices":
|
|
921
|
-
onStopGeneration:
|
|
922
|
-
onSubmit:
|
|
923
|
-
onFileSelect:
|
|
924
|
-
onDismissAttachmentNotice:
|
|
925
|
-
onDismissPageNotice:
|
|
926
|
-
onOpenAnswerNotice:
|
|
927
|
-
onDismissAnswerNotice:
|
|
928
|
-
onVoiceStart:
|
|
911
|
+
ref: ut,
|
|
912
|
+
modelValue: j(B),
|
|
913
|
+
"onUpdate:modelValue": n[4] ||= (e) => ie(B) ? B.value = e : null,
|
|
914
|
+
"pending-attachments": j(Ze),
|
|
915
|
+
"onUpdate:pendingAttachments": n[5] ||= (e) => ie(Ze) ? Ze.value = e : null,
|
|
916
|
+
placeholder: j(Je),
|
|
917
|
+
"dismissable-notice": j(Rt) && j(z).messages.length <= 1 ? j(Rt) : void 0,
|
|
918
|
+
"page-notice": Ft.value,
|
|
919
|
+
status: Nt.value,
|
|
920
|
+
"max-message-length": j(I)?.maxMessageLength,
|
|
921
|
+
"file-upload": H.value,
|
|
922
|
+
"attachment-limit-reached": j(Qe),
|
|
923
|
+
"attachment-notice": It.value,
|
|
924
|
+
"voice-enabled": fn.value,
|
|
925
|
+
"queue-enabled": j(ot),
|
|
926
|
+
"answer-notices": Lt.value,
|
|
927
|
+
onStopGeneration: j(ft),
|
|
928
|
+
onSubmit: j(dt),
|
|
929
|
+
onFileSelect: j(St),
|
|
930
|
+
onDismissAttachmentNotice: j(Ct),
|
|
931
|
+
onDismissPageNotice: j(Et),
|
|
932
|
+
onOpenAnswerNotice: j(At),
|
|
933
|
+
onDismissAnswerNotice: j(jt),
|
|
934
|
+
onVoiceStart: vn
|
|
929
935
|
}, te({ _: 2 }, [a.modifier === "fullscreen" ? {
|
|
930
936
|
name: "prepend",
|
|
931
|
-
fn:
|
|
937
|
+
fn: N(() => [C("span", Le, [w(u, {
|
|
932
938
|
class: "pk-chatbot-view-chat__agent-chip-avatar",
|
|
933
|
-
"img-src":
|
|
934
|
-
name:
|
|
935
|
-
}, null, 8, ["img-src", "name"]),
|
|
939
|
+
"img-src": j(I)?.logo,
|
|
940
|
+
name: j(F).name
|
|
941
|
+
}, null, 8, ["img-src", "name"]), j(F).name ? (D(), S("strong", Re, A(j(F).name), 1)) : x("", !0)])]),
|
|
936
942
|
key: "0"
|
|
937
943
|
} : void 0]), 1032, [
|
|
938
944
|
"modelValue",
|
|
@@ -955,21 +961,21 @@ var Pe = { class: "pk-chatbot-view-chat__input-stage" }, Fe = {
|
|
|
955
961
|
"onDismissPageNotice",
|
|
956
962
|
"onOpenAnswerNotice",
|
|
957
963
|
"onDismissAnswerNotice"
|
|
958
|
-
])) : (
|
|
964
|
+
])) : (D(), b(Oe, {
|
|
959
965
|
key: 2,
|
|
960
|
-
state:
|
|
961
|
-
sample:
|
|
962
|
-
spectrum:
|
|
963
|
-
"remaining-seconds":
|
|
964
|
-
muted:
|
|
965
|
-
error:
|
|
966
|
-
"raw-error":
|
|
967
|
-
live:
|
|
966
|
+
state: pn.value,
|
|
967
|
+
sample: gn,
|
|
968
|
+
spectrum: _n,
|
|
969
|
+
"remaining-seconds": j(Z).remainingSeconds.value,
|
|
970
|
+
muted: q.value,
|
|
971
|
+
error: mn.value,
|
|
972
|
+
"raw-error": j(Z).error.value,
|
|
973
|
+
live: j(Z).isActive.value,
|
|
968
974
|
class: "pk-chatbot-view-chat__voice",
|
|
969
|
-
onToggleMute:
|
|
970
|
-
onHangUp:
|
|
971
|
-
onRetry:
|
|
972
|
-
onDismiss:
|
|
975
|
+
onToggleMute: Nn,
|
|
976
|
+
onHangUp: yn,
|
|
977
|
+
onRetry: xn,
|
|
978
|
+
onDismiss: bn
|
|
973
979
|
}, null, 8, [
|
|
974
980
|
"state",
|
|
975
981
|
"remaining-seconds",
|
|
@@ -980,22 +986,22 @@ var Pe = { class: "pk-chatbot-view-chat__input-stage" }, Fe = {
|
|
|
980
986
|
]))
|
|
981
987
|
]),
|
|
982
988
|
w(v, null, {
|
|
983
|
-
default:
|
|
989
|
+
default: N(() => [j(en) && H.value?.enabled ? (D(), S("div", ze, [w(r, {
|
|
984
990
|
name: "ri:upload-cloud-2-line",
|
|
985
991
|
class: "pk-chatbot-view-chat__drop-overlay-icon"
|
|
986
|
-
}), C("span", null, j(
|
|
992
|
+
}), C("span", null, A(j(W)("action.dropFile")), 1)])) : x("", !0)]),
|
|
987
993
|
_: 1
|
|
988
994
|
}),
|
|
989
|
-
|
|
995
|
+
G.value && Wt.value ? (D(), S("aside", Be, [w(j(ye), {
|
|
990
996
|
closable: "",
|
|
991
|
-
kind:
|
|
992
|
-
filename:
|
|
993
|
-
version:
|
|
994
|
-
"download-url":
|
|
995
|
-
preview:
|
|
996
|
-
loading:
|
|
997
|
-
error:
|
|
998
|
-
onClose:
|
|
997
|
+
kind: G.value.kind,
|
|
998
|
+
filename: G.value.filename,
|
|
999
|
+
version: G.value.version,
|
|
1000
|
+
"download-url": U(G.value.storedFileName),
|
|
1001
|
+
preview: Kt.value,
|
|
1002
|
+
loading: K.value,
|
|
1003
|
+
error: qt.value,
|
|
1004
|
+
onClose: Xt
|
|
999
1005
|
}, null, 8, [
|
|
1000
1006
|
"kind",
|
|
1001
1007
|
"filename",
|
|
@@ -1005,23 +1011,23 @@ var Pe = { class: "pk-chatbot-view-chat__input-stage" }, Fe = {
|
|
|
1005
1011
|
"loading",
|
|
1006
1012
|
"error"
|
|
1007
1013
|
])])) : x("", !0),
|
|
1008
|
-
|
|
1014
|
+
G.value && !Wt.value ? (D(), b(i, {
|
|
1009
1015
|
key: 2,
|
|
1010
|
-
modelValue:
|
|
1011
|
-
"onUpdate:modelValue": n[6] ||= (e) =>
|
|
1012
|
-
title:
|
|
1013
|
-
"label-close":
|
|
1014
|
-
modifiers:
|
|
1016
|
+
modelValue: Zt.value,
|
|
1017
|
+
"onUpdate:modelValue": n[6] ||= (e) => Zt.value = e,
|
|
1018
|
+
title: G.value.filename,
|
|
1019
|
+
"label-close": j(W)("chatFilePreview.close"),
|
|
1020
|
+
modifiers: Gt.value ? "fullscreen" : void 0,
|
|
1015
1021
|
class: "pk-chatbot-view-chat__preview-dialog"
|
|
1016
1022
|
}, {
|
|
1017
|
-
default:
|
|
1018
|
-
kind:
|
|
1019
|
-
filename:
|
|
1020
|
-
version:
|
|
1021
|
-
"download-url":
|
|
1022
|
-
preview:
|
|
1023
|
-
loading:
|
|
1024
|
-
error:
|
|
1023
|
+
default: N(() => [w(j(ye), {
|
|
1024
|
+
kind: G.value.kind,
|
|
1025
|
+
filename: G.value.filename,
|
|
1026
|
+
version: G.value.version,
|
|
1027
|
+
"download-url": U(G.value.storedFileName),
|
|
1028
|
+
preview: Kt.value,
|
|
1029
|
+
loading: K.value,
|
|
1030
|
+
error: qt.value
|
|
1025
1031
|
}, null, 8, [
|
|
1026
1032
|
"kind",
|
|
1027
1033
|
"filename",
|
|
@@ -1042,6 +1048,6 @@ var Pe = { class: "pk-chatbot-view-chat__input-stage" }, Fe = {
|
|
|
1042
1048
|
};
|
|
1043
1049
|
}
|
|
1044
1050
|
});
|
|
1045
|
-
export {
|
|
1051
|
+
export { xe as i, Oe as n, Ce as r, Ke as t };
|
|
1046
1052
|
|
|
1047
|
-
//# sourceMappingURL=PkChatbotViewChat-
|
|
1053
|
+
//# sourceMappingURL=PkChatbotViewChat-DDnJ-2Ic.js.map
|