@8wave/ai-elements 0.121.0-beta.47 → 0.121.0-beta.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai-elements.es.js +1466 -1461
- package/dist/ai-elements.es.js.map +1 -1
- package/dist-vue/PkChatbot.js +1 -1
- package/dist-vue/PkChatbotViewChat.js +1 -1
- package/dist-vue/_chunks/{PkChatbot-DI4aTSTJ.js → PkChatbot-DonyiJn3.js} +2 -2
- package/dist-vue/_chunks/{PkChatbot-DI4aTSTJ.js.map → PkChatbot-DonyiJn3.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewChat-DDf8UaBR.js → PkChatbotViewChat-10NIwiUP.js} +168 -163
- package/dist-vue/_chunks/PkChatbotViewChat-10NIwiUP.js.map +1 -0
- package/dist-vue/index.js +4 -4
- package/dist-vue/index.js.map +1 -1
- package/dist-vue/packages/components/src/chat/useWakeupWatch.d.ts +5 -1
- package/package.json +1 -1
- package/dist-vue/_chunks/PkChatbotViewChat-DDf8UaBR.js.map +0 -1
|
@@ -160,14 +160,14 @@ var ge = {
|
|
|
160
160
|
key: 0,
|
|
161
161
|
class: "pk-voice-session__badge",
|
|
162
162
|
"aria-hidden": "true"
|
|
163
|
-
},
|
|
163
|
+
}, Se = {
|
|
164
164
|
class: "pk-voice-session__status",
|
|
165
165
|
role: "status"
|
|
166
|
-
},
|
|
166
|
+
}, z = {
|
|
167
167
|
key: 0,
|
|
168
168
|
class: "pk-voice-session__live-dot",
|
|
169
169
|
"aria-hidden": "true"
|
|
170
|
-
},
|
|
170
|
+
}, Ce = ["title"], we = ["title"], Te = { class: "pk-voice-session__actions" }, Ee = /* @__PURE__ */ E({
|
|
171
171
|
__name: "PkVoiceSession",
|
|
172
172
|
props: {
|
|
173
173
|
state: {},
|
|
@@ -206,18 +206,18 @@ var ge = {
|
|
|
206
206
|
"sample",
|
|
207
207
|
"spectrum"
|
|
208
208
|
])),
|
|
209
|
-
C("div",
|
|
209
|
+
C("div", Se, [C("span", { class: D(["pk-voice-session__state", l.value && `pk-voice-session__state--${l.value}`]) }, [c.value ? (k(), S("span", z)) : x("", !0), te(" " + j(a.value), 1)], 2), e.error ? (k(), S("p", {
|
|
210
210
|
key: 0,
|
|
211
211
|
class: "pk-voice-session__detail",
|
|
212
212
|
title: e.rawError ?? e.error
|
|
213
|
-
}, j(e.error), 9,
|
|
213
|
+
}, j(e.error), 9, Ce)) : x("", !0)]),
|
|
214
214
|
o.value ? (k(), S("span", {
|
|
215
215
|
key: 2,
|
|
216
216
|
class: D(["pk-voice-session__timer", { "pk-voice-session__timer--warning": s.value }]),
|
|
217
217
|
title: M(i)("hint.voiceRemaining"),
|
|
218
218
|
"aria-hidden": "true"
|
|
219
|
-
}, j(o.value), 11,
|
|
220
|
-
C("div",
|
|
219
|
+
}, j(o.value), 11, we)) : x("", !0),
|
|
220
|
+
C("div", Te, [e.error ? (k(), S(_, { key: 0 }, [w(d, {
|
|
221
221
|
icon: "ri:refresh-line",
|
|
222
222
|
label: M(i)("action.retry"),
|
|
223
223
|
onClick: n[0] ||= (e) => r("retry")
|
|
@@ -254,7 +254,7 @@ var ge = {
|
|
|
254
254
|
], 2);
|
|
255
255
|
};
|
|
256
256
|
}
|
|
257
|
-
}),
|
|
257
|
+
}), De = (e) => {
|
|
258
258
|
let t = le(), n = A("disconnected"), r = A("listening"), i = A(), o = A([]), s = A(), c = A(), l, u, d = 0, f = !1, p = () => {
|
|
259
259
|
u &&= (clearInterval(u), void 0), s.value = void 0;
|
|
260
260
|
}, m = (e) => {
|
|
@@ -378,12 +378,12 @@ var ge = {
|
|
|
378
378
|
readLevel: S,
|
|
379
379
|
readSpectrum: C
|
|
380
380
|
};
|
|
381
|
-
},
|
|
381
|
+
}, Oe = 4e3, ke = [
|
|
382
382
|
3e3,
|
|
383
383
|
5e3,
|
|
384
384
|
1e4
|
|
385
|
-
],
|
|
386
|
-
function
|
|
385
|
+
], Ae = 12e4, je = 3e4;
|
|
386
|
+
function Me(e) {
|
|
387
387
|
let t = A(null), n = A(!1), r, i = !1, a = () => {
|
|
388
388
|
clearTimeout(r), r = void 0;
|
|
389
389
|
}, o = (e, t) => {
|
|
@@ -401,12 +401,12 @@ function je(e) {
|
|
|
401
401
|
}
|
|
402
402
|
let r = t.value;
|
|
403
403
|
if (r) {
|
|
404
|
-
let e = Date.parse(r.dueAt) - Date.now() +
|
|
405
|
-
o(Math.max(
|
|
404
|
+
let e = Date.parse(r.dueAt) - Date.now() + Oe;
|
|
405
|
+
o(Math.max(Oe, e), () => l(r.wakeId, Date.now(), 0));
|
|
406
406
|
}
|
|
407
407
|
}
|
|
408
408
|
async function l(t, n, r) {
|
|
409
|
-
await e.refreshMessages(), !i && (s(t) || Date.now() - n >=
|
|
409
|
+
await e.refreshMessages(), !i && (s(t) || Date.now() - n >= Ae ? await c() : o(ke[Math.min(r, ke.length - 1)], () => l(t, n, r + 1)));
|
|
410
410
|
}
|
|
411
411
|
async function u() {
|
|
412
412
|
n.value = !0;
|
|
@@ -420,15 +420,23 @@ function je(e) {
|
|
|
420
420
|
function d() {
|
|
421
421
|
a(), t.value = null;
|
|
422
422
|
}
|
|
423
|
-
let f;
|
|
424
|
-
|
|
423
|
+
let f = y(() => e.messages().some((e) => e.role === "user"));
|
|
424
|
+
N([e.chatId, f], ([, t]) => {
|
|
425
|
+
d();
|
|
426
|
+
let n = e.status();
|
|
427
|
+
t && n !== "submitted" && n !== "streaming" && c();
|
|
428
|
+
}, { immediate: !0 }), N(e.status, (e, t) => {
|
|
429
|
+
e === "ready" && t !== "ready" && f.value && c();
|
|
430
|
+
});
|
|
431
|
+
let p;
|
|
432
|
+
function m() {
|
|
425
433
|
t.value && document.visibilityState === "visible" && e.apiClient().markChatWakeupPresence(e.agentId(), e.chatId()).catch(() => void 0);
|
|
426
434
|
}
|
|
427
|
-
let
|
|
428
|
-
return document.addEventListener("visibilitychange",
|
|
429
|
-
clearInterval(
|
|
435
|
+
let h = () => m();
|
|
436
|
+
return document.addEventListener("visibilitychange", h), N(() => t.value?.wakeId, (e) => {
|
|
437
|
+
clearInterval(p), p = void 0, e && !i && (m(), p = setInterval(m, je));
|
|
430
438
|
}), O(() => {
|
|
431
|
-
i = !0, a(), clearInterval(
|
|
439
|
+
i = !0, a(), clearInterval(p), document.removeEventListener("visibilitychange", h);
|
|
432
440
|
}), {
|
|
433
441
|
pendingWakeup: t,
|
|
434
442
|
isStopping: n,
|
|
@@ -439,16 +447,16 @@ function je(e) {
|
|
|
439
447
|
}
|
|
440
448
|
//#endregion
|
|
441
449
|
//#region ../../packages/components/src/chat/PkChatbotViewChat.vue?vue&type=script&setup=true&lang.ts
|
|
442
|
-
var
|
|
450
|
+
var Ne = { class: "pk-chatbot-view-chat__input-stage" }, Pe = {
|
|
443
451
|
key: 1,
|
|
444
452
|
class: "p-md border-t border-surface-3 text-center text-12 text-danger bg-surface-danger"
|
|
445
|
-
},
|
|
453
|
+
}, Fe = { class: "pk-chatbot-view-chat__agent-chip" }, Ie = {
|
|
446
454
|
key: 0,
|
|
447
455
|
class: "pk-chatbot-view-chat__agent-chip-name"
|
|
448
|
-
},
|
|
456
|
+
}, Le = {
|
|
449
457
|
key: 0,
|
|
450
458
|
class: "pk-chatbot-view-chat__drop-overlay"
|
|
451
|
-
},
|
|
459
|
+
}, Re = 3e3, ze = 6e4, Be = 3e5, Ve = 6e5, He = /* @__PURE__ */ E({
|
|
452
460
|
__name: "PkChatbotViewChat",
|
|
453
461
|
props: {
|
|
454
462
|
agentId: {},
|
|
@@ -457,121 +465,121 @@ var Me = { class: "pk-chatbot-view-chat__input-stage" }, Ne = {
|
|
|
457
465
|
},
|
|
458
466
|
emits: ["show-info", "revise"],
|
|
459
467
|
setup(a, { emit: d }) {
|
|
460
|
-
let _ = T(() => import("./PkToolShowForm-LR8mW4SY.js").then((e) => e.n)), te = T(() => import("./PkToolShowContactForm-DKkapC2s.js").then((e) => e.n)), E = T(() => import("./PkToolShowSuggestedReply-Dw-yePEO.js").then((e) => e.n)), re = T(() => import("./PkToolShowSources-DeplEks2.js").then((e) => e.n)), ie = T(() => import("./PkToolRequestGeolocation-jkEuN6_1.js")), ae = T(() => import("./PkToolRequestOAuthConnection-BTNd8Urz.js")), oe = T(() => import("./PkToolShowLocation-BipZrvw7.js").then((e) => e.n)), ce = T(() => import("./PkToolShowDiagram-BI-fI2vG.js")), le = T(() => import("./PkToolEditedFile-DsiNIHAR.js")), ue = T(() => import("./PkToolShareDocument-C8sPmh0k.js").then((e) => e.n)), F = a, ge = d, I = r(F.agentId), { agentInterface: L, agentFileUpload: _e, agentType: R, agentVoice: ye, actions: be, revisedAnswers: xe, messages:
|
|
461
|
-
se(c,
|
|
462
|
-
let
|
|
463
|
-
let e =
|
|
464
|
-
if (e) return e.reason === "per-chat" ?
|
|
465
|
-
}),
|
|
468
|
+
let _ = T(() => import("./PkToolShowForm-LR8mW4SY.js").then((e) => e.n)), te = T(() => import("./PkToolShowContactForm-DKkapC2s.js").then((e) => e.n)), E = T(() => import("./PkToolShowSuggestedReply-Dw-yePEO.js").then((e) => e.n)), re = T(() => import("./PkToolShowSources-DeplEks2.js").then((e) => e.n)), ie = T(() => import("./PkToolRequestGeolocation-jkEuN6_1.js")), ae = T(() => import("./PkToolRequestOAuthConnection-BTNd8Urz.js")), oe = T(() => import("./PkToolShowLocation-BipZrvw7.js").then((e) => e.n)), ce = T(() => import("./PkToolShowDiagram-BI-fI2vG.js")), le = T(() => import("./PkToolEditedFile-DsiNIHAR.js")), ue = T(() => import("./PkToolShareDocument-C8sPmh0k.js").then((e) => e.n)), F = a, ge = d, I = r(F.agentId), { agentInterface: L, agentFileUpload: _e, agentType: R, agentVoice: ye, actions: be, revisedAnswers: xe, messages: Se, chat: z, messageFeedbacks: Ce, feedbackDialogMessage: we, isFeedbackSubmitting: Te, isFeedbackSubmitted: Oe, feedbackSubmitError: ke, isLeadSubmitted: Ae, isLoadingSubmitLead: je, submitLeadError: He, input: Ue, inputMessagePlaceholder: We, isConversationBlocked: Ge, baseUrl: Ke, pendingAttachments: qe, isAttachmentLimitReached: Je, fileLimitError: Ye, apiClient: B, isDark: Xe, hostToolsPending: Ze, pageNoticeLevel: Qe, hostConfirmation: $e, agentPageAccess: et, hostStepTitles: tt, canQueue: nt, queuedMessages: rt, backgroundAnswers: it } = me(I);
|
|
469
|
+
se(c, tt);
|
|
470
|
+
let V = y(() => R.value === "reasoning" ? void 0 : _e.value), at = (e) => B.value.getMediaDownloadUrl(F.agentId, I.localChatId, e), { handleSubmit: ot, stopGeneration: st, regenerate: ct, onUpvote: lt, onDownvote: ut, onFeedback: dt, onFeedbackSubmit: ft, onLeadSubmit: pt, startNewChat: mt, addToolOutput: H, addToolApprovalResponse: ht, handleFileSelect: gt, clearFileLimitError: _t, refreshMessages: vt, appendMessage: yt, closePageNotice: bt, respondHostConfirmation: xt, editQueuedMessage: St, removeQueuedMessage: Ct, openBackgroundAnswer: wt, dismissBackgroundAnswer: Tt } = I, { t: U } = fe({ useScope: "global" }), Et = y(() => Ze.value > 0), Dt = y(() => Et.value && z.value.status === "ready" ? "streaming" : z.value.status), Ot = l(() => et.value?.notice), kt = y(() => Qe.value ? Ot.value || U(`message.pageAccessNotice.${Qe.value}`) : void 0), At = y(() => {
|
|
471
|
+
let e = Ye.value;
|
|
472
|
+
if (e) return e.reason === "per-chat" ? U("message.fileLimitPerChat", { max: e.max }) : U("message.fileLimitPerMessage", { max: e.max });
|
|
473
|
+
}), jt = y(() => it.value.map(({ chatId: e, title: t }) => ({
|
|
466
474
|
id: e,
|
|
467
|
-
text: t ?
|
|
468
|
-
}))),
|
|
469
|
-
let t = await
|
|
475
|
+
text: t ? U("message.backgroundAnswerReady", { title: t }) : U("message.backgroundAnswerReadyUntitled")
|
|
476
|
+
}))), Mt = l(() => L.value?.dismissableNotice), Nt = y(() => Se.value.some((e) => e.role === "user")), Pt = y(() => F.modifier === "fullscreen" && !Nt.value), Ft = he(L, () => F.userName), It = de("chatViewEl"), Lt = async (e) => (await B.value.expandSourceContext(F.agentId, e.documentId, e.chunkIndex)).content, Rt = async (e) => {
|
|
477
|
+
let t = await B.value.downloadSourceDocument(F.agentId, e);
|
|
470
478
|
window.open(t.downloadUrl, "_blank");
|
|
471
|
-
}, { isOverDropZone:
|
|
472
|
-
dataTypes: (e) => t(e,
|
|
479
|
+
}, { isOverDropZone: zt } = pe(It, {
|
|
480
|
+
dataTypes: (e) => t(e, V.value?.allowedMimeTypes ?? []),
|
|
473
481
|
onDrop: (e) => {
|
|
474
|
-
if (
|
|
482
|
+
if (V.value?.enabled && e) for (let t of e) gt(t);
|
|
475
483
|
}
|
|
476
|
-
}),
|
|
484
|
+
}), W = A(!1), G = !1, K = A(!1), Bt = [
|
|
477
485
|
3e3,
|
|
478
486
|
5e3,
|
|
479
487
|
1e4
|
|
480
|
-
],
|
|
481
|
-
function
|
|
482
|
-
clearTimeout(
|
|
488
|
+
], q, J, Y = !1, X = 0, Vt = !1;
|
|
489
|
+
function Ht() {
|
|
490
|
+
clearTimeout(q), q = void 0, J = void 0, Y = !1, X = 0, K.value = !1;
|
|
483
491
|
}
|
|
484
|
-
function
|
|
485
|
-
|
|
492
|
+
function Ut(e) {
|
|
493
|
+
G || (clearTimeout(q), q = setTimeout(() => {
|
|
486
494
|
Wt();
|
|
487
495
|
}, e));
|
|
488
496
|
}
|
|
489
497
|
async function Wt() {
|
|
490
|
-
if (
|
|
491
|
-
|
|
498
|
+
if (G || Vt) return;
|
|
499
|
+
Vt = !0;
|
|
492
500
|
let e;
|
|
493
501
|
try {
|
|
494
|
-
e = await
|
|
502
|
+
e = await vt();
|
|
495
503
|
} finally {
|
|
496
|
-
|
|
504
|
+
Vt = !1;
|
|
497
505
|
}
|
|
498
|
-
if (
|
|
499
|
-
if (e === "caught-up" && (
|
|
500
|
-
J = void 0,
|
|
506
|
+
if (G) return;
|
|
507
|
+
if (e === "caught-up" && (K.value = !1), Z.isActive.value) {
|
|
508
|
+
J = void 0, Y = !1, X = 0, Ut(Re);
|
|
501
509
|
return;
|
|
502
510
|
}
|
|
503
|
-
J === void 0 && (J = Date.now(),
|
|
511
|
+
J === void 0 && (J = Date.now(), Y = !!Z.error.value);
|
|
504
512
|
let t = Date.now() - J;
|
|
505
|
-
if (e === "caught-up" && t >= (
|
|
506
|
-
|
|
513
|
+
if (e === "caught-up" && t >= (Y ? Be : ze) || t >= Ve) {
|
|
514
|
+
Ht();
|
|
507
515
|
return;
|
|
508
516
|
}
|
|
509
|
-
let n =
|
|
510
|
-
|
|
517
|
+
let n = Bt[Math.min(X, Bt.length - 1)];
|
|
518
|
+
X += 1, Ut(n);
|
|
511
519
|
}
|
|
512
520
|
let Gt = (e = 1200) => {
|
|
513
|
-
|
|
514
|
-
}, Z =
|
|
521
|
+
Ut(e);
|
|
522
|
+
}, Z = De({
|
|
515
523
|
fetchGrant: async () => {
|
|
516
|
-
let e = await
|
|
524
|
+
let e = await B.value.createVoiceSession(F.agentId, I.localChatId, {
|
|
517
525
|
deviceContext: I.buildDeviceContext(),
|
|
518
526
|
externalContext: I.externalContext
|
|
519
527
|
});
|
|
520
528
|
return e.chatId !== I.localChatId && (I.localChatId = e.chatId), e;
|
|
521
529
|
},
|
|
522
|
-
closeGrant: (e) =>
|
|
530
|
+
closeGrant: (e) => B.value.closeVoiceSession(F.agentId, e),
|
|
523
531
|
onTranscript: (e) => {
|
|
524
|
-
e.role === "user" ? (
|
|
532
|
+
e.role === "user" ? (K.value = !0, yt({
|
|
525
533
|
id: `${i}user-${n()}`,
|
|
526
534
|
role: "user",
|
|
527
535
|
parts: [{
|
|
528
536
|
type: "text",
|
|
529
537
|
text: e.text
|
|
530
538
|
}]
|
|
531
|
-
})) :
|
|
539
|
+
})) : K.value = !1;
|
|
532
540
|
},
|
|
533
541
|
onTurnEnd: () => {
|
|
534
542
|
Gt();
|
|
535
543
|
}
|
|
536
544
|
});
|
|
537
545
|
N(() => Z.error.value, (e) => {
|
|
538
|
-
e && (
|
|
546
|
+
e && (K.value = !1);
|
|
539
547
|
});
|
|
540
548
|
let Kt = y(() => ye.value?.enabled === !0), qt = y(() => Z.error.value ? "error" : Z.isConnecting.value ? "connecting" : Z.isSpeaking.value ? "speaking" : Z.isActive.value ? "listening" : "idle"), Jt = y(() => {
|
|
541
549
|
let e = Z.error.value;
|
|
542
|
-
if (e) return /took too long/i.test(e) ?
|
|
550
|
+
if (e) return /took too long/i.test(e) ? U("message.voiceTookTooLong") : /cascade|no response|custom_llm_error/i.test(e) ? U("message.voiceNoAnswer") : U("message.voiceInterrupted");
|
|
543
551
|
}), Yt = y(() => Z.isSpeaking.value ? "output" : "input"), Xt = () => Z.readLevel(Yt.value), Zt = () => Z.readSpectrum(Yt.value), Qt = async () => {
|
|
544
|
-
|
|
552
|
+
W.value = !1, await Z.start(), Z.isActive.value && (Ht(), Ut(Re));
|
|
545
553
|
}, $t = async () => {
|
|
546
|
-
|
|
554
|
+
K.value = !1, await Z.stop(), !G && Gt(0);
|
|
547
555
|
}, en = () => {
|
|
548
556
|
Z.dismissError();
|
|
549
557
|
}, tn = async () => {
|
|
550
558
|
Z.dismissError(), await Z.stop(), await Qt();
|
|
551
559
|
}, Q = (e) => e?.toolCallId ?? "", nn = A(/* @__PURE__ */ new Set()), rn = (e) => nn.value.has(Q(e)), an = A(/* @__PURE__ */ new Map()), $ = (e, t) => Z.isActive.value ? (Z.sendUserMessage(t) && (nn.value = new Set(nn.value).add(Q(e)), Gt()), !0) : !1, on = (e, t, n) => {
|
|
552
|
-
$(t, o(t, n)) ||
|
|
560
|
+
$(t, o(t, n)) || H({
|
|
553
561
|
tool: e,
|
|
554
562
|
toolCallId: Q(t),
|
|
555
563
|
output: n
|
|
556
564
|
});
|
|
557
565
|
}, sn = (e) => {
|
|
558
|
-
let t = e.confirmed ?
|
|
559
|
-
$({ toolCallId: e.toolCallId }, t) ? nn.value.has(e.toolCallId) && (an.value = new Map(an.value).set(e.toolCallId, e.confirmed)) :
|
|
566
|
+
let t = e.confirmed ? U("message.voiceConfirmed") : U("message.voiceCancelled");
|
|
567
|
+
$({ toolCallId: e.toolCallId }, t) ? nn.value.has(e.toolCallId) && (an.value = new Map(an.value).set(e.toolCallId, e.confirmed)) : H({
|
|
560
568
|
tool: "requestConfirm",
|
|
561
569
|
toolCallId: e.toolCallId,
|
|
562
570
|
output: e.confirmed ? "confirmed" : "cancelled"
|
|
563
571
|
});
|
|
564
572
|
}, cn = (e, t) => {
|
|
565
|
-
$(e, t) || (
|
|
573
|
+
$(e, t) || (Ue.value = t, ot());
|
|
566
574
|
}, ln = (e, t) => {
|
|
567
|
-
let n = t.error ?
|
|
568
|
-
$(e, n) ||
|
|
575
|
+
let n = t.error ? U("message.voiceLocationRefused") : U("message.voiceLocationShared", { place: t.displayName ?? `${t.latitude}, ${t.longitude}` });
|
|
576
|
+
$(e, n) || H({
|
|
569
577
|
tool: "requestGeolocation",
|
|
570
578
|
toolCallId: Q(e),
|
|
571
579
|
output: t
|
|
572
580
|
});
|
|
573
581
|
}, un = (e, t) => {
|
|
574
|
-
$(e,
|
|
582
|
+
$(e, U("message.voiceConnectionDone")) || H({
|
|
575
583
|
tool: "requestOAuthConnection",
|
|
576
584
|
toolCallId: Q(e),
|
|
577
585
|
output: {
|
|
@@ -580,39 +588,36 @@ var Me = { class: "pk-chatbot-view-chat__input-stage" }, Ne = {
|
|
|
580
588
|
}
|
|
581
589
|
});
|
|
582
590
|
}, dn = () => {
|
|
583
|
-
|
|
591
|
+
W.value = !W.value, Z.setMuted(W.value);
|
|
584
592
|
};
|
|
585
593
|
O(() => {
|
|
586
|
-
|
|
594
|
+
G = !0, Ht();
|
|
587
595
|
});
|
|
588
|
-
let { pendingWakeup: fn, isStopping: pn,
|
|
596
|
+
let { pendingWakeup: fn, isStopping: pn, stop: mn } = Me({
|
|
589
597
|
agentId: () => F.agentId,
|
|
590
598
|
chatId: () => I.localChatId,
|
|
591
|
-
apiClient: () =>
|
|
592
|
-
messages: () =>
|
|
593
|
-
refreshMessages:
|
|
599
|
+
apiClient: () => B.value,
|
|
600
|
+
messages: () => Se.value,
|
|
601
|
+
refreshMessages: vt,
|
|
602
|
+
status: () => z.value.status
|
|
594
603
|
});
|
|
595
|
-
return
|
|
596
|
-
hn(), e && mn();
|
|
597
|
-
}, { immediate: !0 }), N(() => B.value.status, (e, t) => {
|
|
598
|
-
e === "ready" && t !== "ready" && Mt.value && mn();
|
|
599
|
-
}), (t, n) => {
|
|
604
|
+
return (t, n) => {
|
|
600
605
|
let r = g;
|
|
601
606
|
return k(), S("div", {
|
|
602
607
|
ref_key: "chatViewEl",
|
|
603
|
-
ref:
|
|
608
|
+
ref: It,
|
|
604
609
|
class: D(["pk-chatbot-view-chat", {
|
|
605
|
-
"pk-chatbot-view-chat--dragover": M(
|
|
606
|
-
"pk-chatbot-view-chat--empty":
|
|
610
|
+
"pk-chatbot-view-chat--dragover": M(zt) && V.value?.enabled,
|
|
611
|
+
"pk-chatbot-view-chat--empty": Pt.value
|
|
607
612
|
}])
|
|
608
613
|
}, [
|
|
609
614
|
w(v, {
|
|
610
615
|
name: "pk-chatbot-view-chat-fade",
|
|
611
616
|
mode: "out-in"
|
|
612
617
|
}, {
|
|
613
|
-
default: P(() => [
|
|
618
|
+
default: P(() => [Pt.value ? (k(), b(m, {
|
|
614
619
|
key: 0,
|
|
615
|
-
greeting: M(
|
|
620
|
+
greeting: M(Ft),
|
|
616
621
|
logo: M(L)?.logo,
|
|
617
622
|
name: M(I).name
|
|
618
623
|
}, null, 8, [
|
|
@@ -623,47 +628,47 @@ var Me = { class: "pk-chatbot-view-chat__input-stage" }, Ne = {
|
|
|
623
628
|
key: 1,
|
|
624
629
|
class: "flex flex-col flex-1 min-h-0 p-md overflow-y-auto",
|
|
625
630
|
interactive: "",
|
|
626
|
-
messages: M(
|
|
631
|
+
messages: M(Se),
|
|
627
632
|
"confirm-verdicts-on-call": an.value,
|
|
628
|
-
status: M(
|
|
629
|
-
error: M(
|
|
633
|
+
status: M(z).status,
|
|
634
|
+
error: M(z).error,
|
|
630
635
|
"main-color": M(L)?.mainColor,
|
|
631
636
|
"text-color": M(L)?.textColor,
|
|
632
637
|
"revised-answers": M(xe),
|
|
633
638
|
actions: M(be),
|
|
634
|
-
"message-feedbacks": M(
|
|
635
|
-
"feedback-message-id": M(
|
|
636
|
-
"feedback-loading": M(
|
|
637
|
-
"feedback-submitted": M(
|
|
638
|
-
"feedback-error": M(
|
|
639
|
+
"message-feedbacks": M(Ce),
|
|
640
|
+
"feedback-message-id": M(we)?.id,
|
|
641
|
+
"feedback-loading": M(Te),
|
|
642
|
+
"feedback-submitted": M(Oe),
|
|
643
|
+
"feedback-error": M(ke),
|
|
639
644
|
"show-extended-steps": M(L)?.showExtendedSteps,
|
|
640
|
-
"awaiting-spoken-answer":
|
|
641
|
-
"host-working":
|
|
642
|
-
"host-confirmation": M(
|
|
643
|
-
"is-dark": M(
|
|
645
|
+
"awaiting-spoken-answer": K.value,
|
|
646
|
+
"host-working": Et.value,
|
|
647
|
+
"host-confirmation": M($e),
|
|
648
|
+
"is-dark": M(Xe),
|
|
644
649
|
"show-scroll-to-bottom": a.modifier === "fullscreen",
|
|
645
|
-
onFeedbackSubmit: n[0] ||= (e) => M(
|
|
646
|
-
onFeedbackClose: n[1] ||= (e) =>
|
|
647
|
-
onRegenerate: M(
|
|
648
|
-
onAutoRetry: M(
|
|
649
|
-
onResetChat: M(
|
|
650
|
+
onFeedbackSubmit: n[0] ||= (e) => M(ft)(e),
|
|
651
|
+
onFeedbackClose: n[1] ||= (e) => we.value = void 0,
|
|
652
|
+
onRegenerate: M(ct),
|
|
653
|
+
onAutoRetry: M(ct),
|
|
654
|
+
onResetChat: M(mt),
|
|
650
655
|
onShowInfo: n[2] ||= (e) => ge("show-info", e),
|
|
651
656
|
onRevise: n[3] ||= (e) => ge("revise", e),
|
|
652
|
-
onUpvote: M(
|
|
653
|
-
onDownvote: M(
|
|
654
|
-
onFeedback: M(
|
|
655
|
-
onApprovalRespond: M(
|
|
657
|
+
onUpvote: M(lt),
|
|
658
|
+
onDownvote: M(ut),
|
|
659
|
+
onFeedback: M(dt),
|
|
660
|
+
onApprovalRespond: M(ht),
|
|
656
661
|
onConfirmRespond: sn,
|
|
657
|
-
onHostConfirmRespond: M(
|
|
662
|
+
onHostConfirmRespond: M(xt)
|
|
658
663
|
}, {
|
|
659
664
|
"tool-showContactForm": P(({ part: e }) => [w(M(te), {
|
|
660
665
|
part: e,
|
|
661
|
-
readonly: !M(
|
|
662
|
-
submitted: M(
|
|
663
|
-
loading: M(
|
|
664
|
-
error: M(
|
|
666
|
+
readonly: !M(Ke),
|
|
667
|
+
submitted: M(Ae),
|
|
668
|
+
loading: M(je),
|
|
669
|
+
error: M(He),
|
|
665
670
|
"privacy-policy-notice": M(L)?.privacyPolicyNotice,
|
|
666
|
-
onSubmit: M(
|
|
671
|
+
onSubmit: M(pt)
|
|
667
672
|
}, null, 8, [
|
|
668
673
|
"part",
|
|
669
674
|
"readonly",
|
|
@@ -679,8 +684,8 @@ var Me = { class: "pk-chatbot-view-chat__input-stage" }, Ne = {
|
|
|
679
684
|
}, null, 8, ["part", "onSelect"])]),
|
|
680
685
|
"tool-showSources": P(({ part: e }) => [w(M(re), {
|
|
681
686
|
part: e,
|
|
682
|
-
"on-expand-context":
|
|
683
|
-
"on-download":
|
|
687
|
+
"on-expand-context": Lt,
|
|
688
|
+
"on-download": Rt
|
|
684
689
|
}, null, 8, ["part"])]),
|
|
685
690
|
"tool-showForm": P(({ part: e }) => [w(v, { mode: "out-in" }, {
|
|
686
691
|
default: P(() => [w(M(_), {
|
|
@@ -709,9 +714,9 @@ var Me = { class: "pk-chatbot-view-chat__input-stage" }, Ne = {
|
|
|
709
714
|
}, 1024)]),
|
|
710
715
|
"tool-requestOAuthConnection": P(({ part: e }) => [w(M(ae), {
|
|
711
716
|
part: e,
|
|
712
|
-
"backend-url": M(
|
|
713
|
-
"resolve-connection": (e) => M(
|
|
714
|
-
"check-connection": (e) => M(
|
|
717
|
+
"backend-url": M(Ke),
|
|
718
|
+
"resolve-connection": (e) => M(B).getOAuthAuthorizeUrl(F.agentId, e),
|
|
719
|
+
"check-connection": (e) => M(B).getOAuthConnectionStatus(F.agentId, e),
|
|
715
720
|
onConnected: (t) => un(e, t)
|
|
716
721
|
}, null, 8, [
|
|
717
722
|
"part",
|
|
@@ -723,7 +728,7 @@ var Me = { class: "pk-chatbot-view-chat__input-stage" }, Ne = {
|
|
|
723
728
|
"tool-requestGeolocation": P(({ part: e }) => [w(M(ie), {
|
|
724
729
|
part: e,
|
|
725
730
|
"call-live": M(Z).isActive.value,
|
|
726
|
-
"reverse-geocode": (e, t) => M(
|
|
731
|
+
"reverse-geocode": (e, t) => M(B).reverseGeocode(e, t),
|
|
727
732
|
onResult: (t) => ln(e, t)
|
|
728
733
|
}, null, 8, [
|
|
729
734
|
"part",
|
|
@@ -733,9 +738,9 @@ var Me = { class: "pk-chatbot-view-chat__input-stage" }, Ne = {
|
|
|
733
738
|
])]),
|
|
734
739
|
"tool-showLocation": P(({ part: e }) => [w(M(oe), {
|
|
735
740
|
part: e,
|
|
736
|
-
"is-dark": M(
|
|
741
|
+
"is-dark": M(Xe),
|
|
737
742
|
"main-color": M(L)?.mainColor,
|
|
738
|
-
"forward-geocode": (e, t) => M(
|
|
743
|
+
"forward-geocode": (e, t) => M(B).forwardGeocode(e, t)
|
|
739
744
|
}, null, 8, [
|
|
740
745
|
"part",
|
|
741
746
|
"is-dark",
|
|
@@ -744,89 +749,89 @@ var Me = { class: "pk-chatbot-view-chat__input-stage" }, Ne = {
|
|
|
744
749
|
])]),
|
|
745
750
|
"tool-showDiagram": P(({ part: e }) => [w(M(ce), {
|
|
746
751
|
part: e,
|
|
747
|
-
"is-dark": M(
|
|
752
|
+
"is-dark": M(Xe)
|
|
748
753
|
}, null, 8, ["part", "is-dark"])]),
|
|
749
754
|
"tool-editSpreadsheet": P(({ part: e }) => [(k(), b(M(le), {
|
|
750
755
|
key: M(s)(e),
|
|
751
756
|
part: e,
|
|
752
|
-
"file-url":
|
|
757
|
+
"file-url": at
|
|
753
758
|
}, null, 8, ["part"]))]),
|
|
754
759
|
"tool-editWordDocument": P(({ part: e }) => [(k(), b(M(le), {
|
|
755
760
|
key: M(s)(e),
|
|
756
761
|
part: e,
|
|
757
|
-
"file-url":
|
|
762
|
+
"file-url": at
|
|
758
763
|
}, null, 8, ["part"]))]),
|
|
759
764
|
"tool-shareDocument": P(({ part: e }) => [(k(), b(M(ue), {
|
|
760
765
|
key: M(s)(e),
|
|
761
766
|
part: e,
|
|
762
|
-
"on-download":
|
|
767
|
+
"on-download": Rt
|
|
763
768
|
}, null, 8, ["part"]))]),
|
|
764
769
|
_: 1
|
|
765
770
|
}, 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.awaiting-spoken-answer.host-working.host-confirmation.is-dark.show-scroll-to-bottom.onRegenerate.onAutoRetry.onResetChat.onUpvote.onDownvote.onFeedback.onApprovalRespond.onHostConfirmRespond".split(".")))]),
|
|
766
771
|
_: 1
|
|
767
772
|
}),
|
|
768
|
-
M(
|
|
773
|
+
M(rt).length ? (k(), b(p, {
|
|
769
774
|
key: 0,
|
|
770
|
-
messages: M(
|
|
771
|
-
onEdit: M(
|
|
772
|
-
onRemove: M(
|
|
775
|
+
messages: M(rt),
|
|
776
|
+
onEdit: M(St),
|
|
777
|
+
onRemove: M(Ct)
|
|
773
778
|
}, null, 8, [
|
|
774
779
|
"messages",
|
|
775
780
|
"onEdit",
|
|
776
781
|
"onRemove"
|
|
777
782
|
])) : x("", !0),
|
|
778
|
-
C("div",
|
|
783
|
+
C("div", Ne, [
|
|
779
784
|
w(v, { name: "pk-chatbot-view-chat-fade" }, {
|
|
780
|
-
default: P(() => [
|
|
785
|
+
default: P(() => [Pt.value ? (k(), b(ve, {
|
|
781
786
|
key: 0,
|
|
782
787
|
class: "pk-chatbot-view-chat__aurora",
|
|
783
788
|
"source-selector": ".pk-chatbot-input__form"
|
|
784
789
|
})) : x("", !0)]),
|
|
785
790
|
_: 1
|
|
786
791
|
}),
|
|
787
|
-
M(fn) && !M(
|
|
792
|
+
M(fn) && !M(Ge) ? (k(), b(h, {
|
|
788
793
|
key: 0,
|
|
789
794
|
pending: M(fn),
|
|
790
795
|
stopping: M(pn),
|
|
791
|
-
onStop: M(
|
|
796
|
+
onStop: M(mn)
|
|
792
797
|
}, null, 8, [
|
|
793
798
|
"pending",
|
|
794
799
|
"stopping",
|
|
795
800
|
"onStop"
|
|
796
801
|
])) : x("", !0),
|
|
797
|
-
M(
|
|
802
|
+
M(Ge) ? (k(), S("div", Pe, j(M(U)("message.chatErrorConversationBlocked")), 1)) : qt.value === "idle" ? (k(), b(f, {
|
|
798
803
|
key: 3,
|
|
799
|
-
modelValue: M(
|
|
800
|
-
"onUpdate:modelValue": n[4] ||= (e) => ne(
|
|
801
|
-
"pending-attachments": M(
|
|
802
|
-
"onUpdate:pendingAttachments": n[5] ||= (e) => ne(
|
|
803
|
-
placeholder: M(
|
|
804
|
-
"dismissable-notice": M(
|
|
805
|
-
"page-notice":
|
|
806
|
-
status:
|
|
804
|
+
modelValue: M(Ue),
|
|
805
|
+
"onUpdate:modelValue": n[4] ||= (e) => ne(Ue) ? Ue.value = e : null,
|
|
806
|
+
"pending-attachments": M(qe),
|
|
807
|
+
"onUpdate:pendingAttachments": n[5] ||= (e) => ne(qe) ? qe.value = e : null,
|
|
808
|
+
placeholder: M(We),
|
|
809
|
+
"dismissable-notice": M(Mt) && M(z).messages.length <= 1 ? M(Mt) : void 0,
|
|
810
|
+
"page-notice": kt.value,
|
|
811
|
+
status: Dt.value,
|
|
807
812
|
"max-message-length": M(L)?.maxMessageLength,
|
|
808
|
-
"file-upload":
|
|
809
|
-
"attachment-limit-reached": M(
|
|
810
|
-
"attachment-notice":
|
|
813
|
+
"file-upload": V.value,
|
|
814
|
+
"attachment-limit-reached": M(Je),
|
|
815
|
+
"attachment-notice": At.value,
|
|
811
816
|
"voice-enabled": Kt.value,
|
|
812
|
-
"queue-enabled": M(
|
|
813
|
-
"answer-notices":
|
|
814
|
-
onStopGeneration: M(
|
|
815
|
-
onSubmit: M(
|
|
816
|
-
onFileSelect: M(
|
|
817
|
-
onDismissAttachmentNotice: M(
|
|
818
|
-
onDismissPageNotice: M(
|
|
819
|
-
onOpenAnswerNotice: M(
|
|
820
|
-
onDismissAnswerNotice: M(
|
|
817
|
+
"queue-enabled": M(nt),
|
|
818
|
+
"answer-notices": jt.value,
|
|
819
|
+
onStopGeneration: M(st),
|
|
820
|
+
onSubmit: M(ot),
|
|
821
|
+
onFileSelect: M(gt),
|
|
822
|
+
onDismissAttachmentNotice: M(_t),
|
|
823
|
+
onDismissPageNotice: M(bt),
|
|
824
|
+
onOpenAnswerNotice: M(wt),
|
|
825
|
+
onDismissAnswerNotice: M(Tt),
|
|
821
826
|
onVoiceStart: Qt
|
|
822
827
|
}, ee({ _: 2 }, [a.modifier === "fullscreen" ? {
|
|
823
828
|
name: "prepend",
|
|
824
|
-
fn: P(() => [C("span",
|
|
829
|
+
fn: P(() => [C("span", Fe, [w(u, {
|
|
825
830
|
modifiers: "surface",
|
|
826
831
|
class: "pk-chatbot-view-chat__agent-chip-avatar",
|
|
827
832
|
"img-src": M(L)?.logo,
|
|
828
833
|
name: M(I).name
|
|
829
|
-
}, null, 8, ["img-src", "name"]), M(I).name ? (k(), S("strong",
|
|
834
|
+
}, null, 8, ["img-src", "name"]), M(I).name ? (k(), S("strong", Ie, j(M(I).name), 1)) : x("", !0)])]),
|
|
830
835
|
key: "0"
|
|
831
836
|
} : void 0]), 1032, [
|
|
832
837
|
"modelValue",
|
|
@@ -849,13 +854,13 @@ var Me = { class: "pk-chatbot-view-chat__input-stage" }, Ne = {
|
|
|
849
854
|
"onDismissPageNotice",
|
|
850
855
|
"onOpenAnswerNotice",
|
|
851
856
|
"onDismissAnswerNotice"
|
|
852
|
-
])) : (k(), b(
|
|
857
|
+
])) : (k(), b(Ee, {
|
|
853
858
|
key: 2,
|
|
854
859
|
state: qt.value,
|
|
855
860
|
sample: Xt,
|
|
856
861
|
spectrum: Zt,
|
|
857
862
|
"remaining-seconds": M(Z).remainingSeconds.value,
|
|
858
|
-
muted:
|
|
863
|
+
muted: W.value,
|
|
859
864
|
error: Jt.value,
|
|
860
865
|
"raw-error": M(Z).error.value,
|
|
861
866
|
live: M(Z).isActive.value,
|
|
@@ -874,10 +879,10 @@ var Me = { class: "pk-chatbot-view-chat__input-stage" }, Ne = {
|
|
|
874
879
|
]))
|
|
875
880
|
]),
|
|
876
881
|
w(v, null, {
|
|
877
|
-
default: P(() => [M(
|
|
882
|
+
default: P(() => [M(zt) && V.value?.enabled ? (k(), S("div", Le, [w(r, {
|
|
878
883
|
name: "ri:upload-cloud-2-line",
|
|
879
884
|
class: "pk-chatbot-view-chat__drop-overlay-icon"
|
|
880
|
-
}), C("span", null, j(M(
|
|
885
|
+
}), C("span", null, j(M(U)("action.dropFile")), 1)])) : x("", !0)]),
|
|
881
886
|
_: 1
|
|
882
887
|
})
|
|
883
888
|
], 2);
|
|
@@ -885,6 +890,6 @@ var Me = { class: "pk-chatbot-view-chat__input-stage" }, Ne = {
|
|
|
885
890
|
}
|
|
886
891
|
});
|
|
887
892
|
//#endregion
|
|
888
|
-
export { ve as i,
|
|
893
|
+
export { ve as i, Ee as n, be as r, He as t };
|
|
889
894
|
|
|
890
|
-
//# sourceMappingURL=PkChatbotViewChat-
|
|
895
|
+
//# sourceMappingURL=PkChatbotViewChat-10NIwiUP.js.map
|