@pagelines/sdk 1.0.758 → 1.0.760
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/AgentProvider.js +251 -235
- package/dist/AgentProvider.js.map +1 -1
- package/dist/AgentWidgetModal.js +184 -29
- package/dist/AgentWidgetModal.js.map +1 -1
- package/dist/AgentWrap.js +821 -613
- package/dist/AgentWrap.js.map +1 -1
- package/dist/agent/AgentController.d.ts +82 -22
- package/dist/agent/index.d.ts +4 -2
- package/dist/agent/schema.d.ts +2 -17
- package/dist/agent/ui/AgentAvatar.vue.d.ts +2 -0
- package/dist/agent/ui/AgentChat.vue.d.ts +7 -0
- package/dist/agent/ui/AgentProvider.vue.d.ts +4 -0
- package/dist/agent/ui/ElCreateAgent.vue.d.ts +8 -0
- package/dist/agent/ui/{AgentModal.vue.d.ts → VoiceMode.vue.d.ts} +7 -10
- package/dist/agent/utils.d.ts +0 -4
- package/dist/agent/voice/provider.d.ts +28 -0
- package/dist/agent/voice/providers/elevenlabs/provider.d.ts +30 -0
- package/dist/agent/voice/providers/livekit/provider.d.ts +55 -0
- package/dist/agent/voice/voice-session-client.d.ts +49 -0
- package/dist/agent.js +168 -74
- package/dist/agent.js.map +1 -1
- package/dist/clients/ChatClient.d.ts +1 -9
- package/dist/contract.js +1756 -1664
- package/dist/contract.js.map +1 -1
- package/dist/demo/index.d.ts +4 -0
- package/dist/provider.js +40 -0
- package/dist/provider.js.map +1 -0
- package/dist/provider2.js +16451 -0
- package/dist/provider2.js.map +1 -0
- package/dist/provider3.js +18439 -0
- package/dist/provider3.js.map +1 -0
- package/dist/sdk.css +1 -1
- package/dist/sdkClient.d.ts +17 -0
- package/dist/sdkClient.js +37 -47
- package/dist/sdkClient.js.map +1 -1
- package/dist/widget/composables/useWidgetState.d.ts +12 -0
- package/dist/widget.js +23 -23
- package/package.json +3 -1
- package/dist/FModal.js +0 -165
- package/dist/FModal.js.map +0 -1
package/dist/AgentWrap.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import "./rolldown-runtime.js";
|
|
2
2
|
import { s as e, t } from "./sdkClient.js";
|
|
3
3
|
import { Agent as n, CHAT_ISSUE_COPY as r, SettingsObject as i, createLogger as a, getDefaultAvatarUrl as o, isAssistantSilenceControl as s, parseChatCardFencePayload as c, parseChatVisualFencePayload as u } from "@pagelines/core";
|
|
4
|
-
import { Fragment as f, computed as p, createBlock as m, createCommentVNode as h, createElementBlock as _, createElementVNode as v, createTextVNode as
|
|
4
|
+
import { Fragment as f, computed as p, createBlock as m, createCommentVNode as h, createElementBlock as _, createElementVNode as v, createTextVNode as b, createVNode as x, defineComponent as S, nextTick as C, normalizeClass as T, normalizeStyle as k, onBeforeUnmount as te, onMounted as ne, onUnmounted as re, openBlock as A, ref as j, renderList as M, renderSlot as ie, resolveDynamicComponent as P, shallowRef as ae, toDisplayString as F, unref as oe, vModelText as se, watch as ce, withCtx as I, withDirectives as ue, withKeys as de, withModifiers as pe } from "vue";
|
|
5
5
|
//#region ui/FSpinner.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
-
var
|
|
6
|
+
var R = { class: "spinner max-w-sm" }, B = {
|
|
7
7
|
class: "ring-circular h-full w-full origin-center",
|
|
8
8
|
viewBox: "25 25 50 50"
|
|
9
|
-
},
|
|
9
|
+
}, he = /* @__PURE__ */ S({
|
|
10
10
|
__name: "FSpinner",
|
|
11
11
|
props: {
|
|
12
12
|
width: {
|
|
@@ -19,8 +19,8 @@ var I = { class: "spinner max-w-sm" }, R = {
|
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
21
|
setup(e) {
|
|
22
|
-
return (t, n) => (
|
|
23
|
-
class:
|
|
22
|
+
return (t, n) => (A(), _("div", R, [(A(), _("svg", B, [v("circle", {
|
|
23
|
+
class: T([e.colorMode, "ring-path"]),
|
|
24
24
|
cx: "50",
|
|
25
25
|
cy: "50",
|
|
26
26
|
r: "20",
|
|
@@ -30,7 +30,7 @@ var I = { class: "spinner max-w-sm" }, R = {
|
|
|
30
30
|
"stroke-miterlimit": "30"
|
|
31
31
|
}, null, 2)]))]));
|
|
32
32
|
}
|
|
33
|
-
}),
|
|
33
|
+
}), _e = [
|
|
34
34
|
{
|
|
35
35
|
mode: "self",
|
|
36
36
|
label: "Overview",
|
|
@@ -70,7 +70,7 @@ function recorderMimeType() {
|
|
|
70
70
|
}
|
|
71
71
|
var VoiceRecorderController = class extends i {
|
|
72
72
|
constructor(t) {
|
|
73
|
-
super("VoiceRecorderController", t), e(this, "state",
|
|
73
|
+
super("VoiceRecorderController", t), e(this, "state", j({
|
|
74
74
|
phase: "idle",
|
|
75
75
|
elapsedMs: 0
|
|
76
76
|
})), e(this, "isActive", p(() => this.state.value.phase !== "idle")), e(this, "isBusy", p(() => this.state.value.phase !== "idle")), e(this, "elapsedLabel", p(() => formatVoiceRecordingDuration({ ms: this.state.value.elapsedMs }))), e(this, "statusText", p(() => this.state.value.phase === "preparing" ? "Starting microphone" : this.state.value.phase === "sending" ? "Sending voice message" : "Release to send")), e(this, "recorder", void 0), e(this, "stream", void 0), e(this, "chunks", []), e(this, "timer", void 0), e(this, "startedAt", 0), e(this, "cancelOnStop", !1), e(this, "stopAfterStart", !1), e(this, "startToken", 0);
|
|
@@ -185,7 +185,7 @@ var VoiceRecorderController = class extends i {
|
|
|
185
185
|
function durableJournalOutcome(e) {
|
|
186
186
|
return e.turnOutcome === "failed" ? "failed" : e.turnOutcome === "stopped" ? "stopped" : e.sender === "system" ? "failed" : "completed";
|
|
187
187
|
}
|
|
188
|
-
var
|
|
188
|
+
var H = {
|
|
189
189
|
waiting: "Waiting for results",
|
|
190
190
|
finishing: "Finishing up",
|
|
191
191
|
completed: "Work complete",
|
|
@@ -193,7 +193,7 @@ var B = {
|
|
|
193
193
|
stopped: "Stopped",
|
|
194
194
|
notifyHint: "Taking longer than usual. You can leave and I’ll notify you when it’s ready.",
|
|
195
195
|
leaveHint: "Taking longer than usual. You can leave this chat while I work."
|
|
196
|
-
},
|
|
196
|
+
}, ve = 15e3, U = 6e4, ye = 3;
|
|
197
197
|
function toMs(e) {
|
|
198
198
|
if (!e) return;
|
|
199
199
|
let t = Date.parse(e);
|
|
@@ -209,7 +209,7 @@ function milestoneRows(e, t) {
|
|
|
209
209
|
let n = e.filter((e) => e.status === "completed" || e.status === "failed" && !!e.note).filter((e) => !t.has(e.activityId)).slice().sort(byEvent), r = [];
|
|
210
210
|
for (let e of n) {
|
|
211
211
|
let t = e.status === "completed" ? "done" : "failed", n = r[r.length - 1];
|
|
212
|
-
if (t === "done" && n?.tone === "done" && n.label === e.label && eventMs(e) - n.lastMs <=
|
|
212
|
+
if (t === "done" && n?.tone === "done" && n.label === e.label && eventMs(e) - n.lastMs <= ve) {
|
|
213
213
|
n.count += 1, n.lastMs = eventMs(e);
|
|
214
214
|
continue;
|
|
215
215
|
}
|
|
@@ -230,12 +230,12 @@ function milestoneRows(e, t) {
|
|
|
230
230
|
}));
|
|
231
231
|
}
|
|
232
232
|
function splitRows(e) {
|
|
233
|
-
return e.length <=
|
|
233
|
+
return e.length <= ye ? {
|
|
234
234
|
visibleRows: e,
|
|
235
235
|
hiddenRows: []
|
|
236
236
|
} : {
|
|
237
|
-
visibleRows: e.slice(e.length -
|
|
238
|
-
hiddenRows: e.slice(0, e.length -
|
|
237
|
+
visibleRows: e.slice(e.length - ye),
|
|
238
|
+
hiddenRows: e.slice(0, e.length - ye)
|
|
239
239
|
};
|
|
240
240
|
}
|
|
241
241
|
function buildWorkJournalModel(e) {
|
|
@@ -247,7 +247,7 @@ function buildWorkJournalModel(e) {
|
|
|
247
247
|
terminal: {
|
|
248
248
|
id: "work-complete",
|
|
249
249
|
tone: "completed",
|
|
250
|
-
label:
|
|
250
|
+
label: H.completed
|
|
251
251
|
}
|
|
252
252
|
};
|
|
253
253
|
if (n === "failed") {
|
|
@@ -261,7 +261,7 @@ function buildWorkJournalModel(e) {
|
|
|
261
261
|
terminal: {
|
|
262
262
|
id: "work-failed",
|
|
263
263
|
tone: "failed",
|
|
264
|
-
label:
|
|
264
|
+
label: H.failed,
|
|
265
265
|
...o && e?.note ? { note: e.note } : {}
|
|
266
266
|
}
|
|
267
267
|
};
|
|
@@ -275,25 +275,25 @@ function buildWorkJournalModel(e) {
|
|
|
275
275
|
terminal: {
|
|
276
276
|
id: "work-stopped",
|
|
277
277
|
tone: "stopped",
|
|
278
|
-
label:
|
|
278
|
+
label: H.stopped
|
|
279
279
|
}
|
|
280
280
|
};
|
|
281
281
|
}
|
|
282
282
|
let { visibleRows: s, hiddenRows: c } = splitRows(milestoneRows(t, /* @__PURE__ */ new Set())), u = t.filter((e) => e.status === "started").sort(byEvent).pop(), f = t.reduce((e, t) => Math.max(e, eventMs(t)), a ?? -Infinity), p = Number.isFinite(f) ? f : r, m = t.reduce((e, t) => {
|
|
283
283
|
let n = toMs(t.startedAt) ?? toMs(t.endedAt);
|
|
284
284
|
return n === void 0 ? e : Math.min(e, n);
|
|
285
|
-
}, Infinity), h = p +
|
|
285
|
+
}, Infinity), h = p + ve, _ = (Number.isFinite(m) ? m : p) + U, v = r >= h, b = u || v ? {
|
|
286
286
|
id: u?.activityId ?? "work-active",
|
|
287
287
|
tone: "active",
|
|
288
|
-
label: v ? u ?
|
|
289
|
-
} : void 0,
|
|
288
|
+
label: v ? u ? H.waiting : H.finishing : u.label
|
|
289
|
+
} : void 0, x = v && r >= _ ? i ? H.notifyHint : H.leaveHint : void 0, S = [h, _].filter((e) => e > r).sort((e, t) => e - t)[0];
|
|
290
290
|
return {
|
|
291
291
|
outcome: n,
|
|
292
292
|
visibleRows: s,
|
|
293
293
|
hiddenRows: c,
|
|
294
|
-
...
|
|
295
|
-
...
|
|
296
|
-
...
|
|
294
|
+
...b ? { terminal: b } : {},
|
|
295
|
+
...x ? { hint: x } : {},
|
|
296
|
+
...S === void 0 ? {} : { nextBoundaryAtMs: S }
|
|
297
297
|
};
|
|
298
298
|
}
|
|
299
299
|
function buildLiveTurnBlocks(e) {
|
|
@@ -352,17 +352,17 @@ function buildLiveTurnBlocks(e) {
|
|
|
352
352
|
}
|
|
353
353
|
//#endregion
|
|
354
354
|
//#region agent/AgentController.ts
|
|
355
|
-
var
|
|
356
|
-
...
|
|
355
|
+
var W = /* @__PURE__ */ new Set(["CREDIT_LIMIT", "OVERAGE_CAP"]), be = /* @__PURE__ */ new Set([
|
|
356
|
+
...W,
|
|
357
357
|
"EMPTY_STREAM",
|
|
358
358
|
"RATE_LIMIT"
|
|
359
|
-
]),
|
|
359
|
+
]), G = /* @__PURE__ */ new Set(["agent_deleted", "AGENT_DELETED"]), Se = {
|
|
360
360
|
CREDIT_LIMIT: "billing_budget_reached",
|
|
361
361
|
OVERAGE_CAP: "billing_runaway_cap"
|
|
362
362
|
};
|
|
363
363
|
function presentChatStreamError(e) {
|
|
364
|
-
if (!(e.bucket !== void 0 ||
|
|
365
|
-
let t = e.bucket ?? (
|
|
364
|
+
if (!(e.bucket !== void 0 || be.has(e.code))) return { surface: "hard" };
|
|
365
|
+
let t = e.bucket ?? (W.has(e.code) ? "account" : "error"), n = {
|
|
366
366
|
...e.actionLabel ? { actionLabel: e.actionLabel } : {},
|
|
367
367
|
...e.actionUrl ? { actionUrl: e.actionUrl } : {},
|
|
368
368
|
...e.help ? { help: e.help } : {}
|
|
@@ -375,7 +375,7 @@ function presentChatStreamError(e) {
|
|
|
375
375
|
...n
|
|
376
376
|
},
|
|
377
377
|
sendBlockedReason: "account"
|
|
378
|
-
} :
|
|
378
|
+
} : G.has(e.code) ? {
|
|
379
379
|
surface: "transcript",
|
|
380
380
|
issue: {
|
|
381
381
|
code: e.code,
|
|
@@ -393,20 +393,43 @@ function presentChatStreamError(e) {
|
|
|
393
393
|
};
|
|
394
394
|
}
|
|
395
395
|
function transcriptMessageForChatStreamError(e) {
|
|
396
|
-
let t =
|
|
396
|
+
let t = Se[e.code];
|
|
397
397
|
return t ? r[t].oneLine : e.error;
|
|
398
398
|
}
|
|
399
399
|
var AgentChatController = class extends i {
|
|
400
|
+
isQueuedMessage(e) {
|
|
401
|
+
return this.queuedMessageIdSet.value.has(e);
|
|
402
|
+
}
|
|
403
|
+
consumeQueuedThrough(e) {
|
|
404
|
+
if (!e || this.queuedMessageIdSet.value.size === 0) return;
|
|
405
|
+
let t = new Set(this.queuedMessageIdSet.value), n = this.sharedMessages.value.findIndex((t) => t.id === e);
|
|
406
|
+
n < 0 ? t.delete(e) : this.sharedMessages.value.slice(0, n + 1).forEach((e) => t.delete(e.id)), this.queuedMessageIdSet.value = t;
|
|
407
|
+
}
|
|
408
|
+
get activeConversationId() {
|
|
409
|
+
return this.conversationId;
|
|
410
|
+
}
|
|
411
|
+
createVoiceClient(e) {
|
|
412
|
+
let { sdk: t, createVoiceClientFn: n } = this.settings, r = this._agent.agentId.value, i = this._agent.orgId.value;
|
|
413
|
+
if (!(!t?.activeUser.value || !r || !i)) return n?.({
|
|
414
|
+
agentId: r,
|
|
415
|
+
orgId: i,
|
|
416
|
+
conversationId: this.conversationId,
|
|
417
|
+
handlers: e
|
|
418
|
+
});
|
|
419
|
+
}
|
|
420
|
+
async refreshMessages() {
|
|
421
|
+
await this.settings.refreshMessagesFn?.();
|
|
422
|
+
}
|
|
400
423
|
constructor(t) {
|
|
401
424
|
super("AgentChatController", t), e(this, "isTextMode", !1), e(this, "lastMessage", {
|
|
402
425
|
hash: "",
|
|
403
426
|
time: 0
|
|
404
|
-
}), e(this, "isConnecting", !1), e(this, "
|
|
427
|
+
}), e(this, "isConnecting", !1), e(this, "turnEpoch", 0), e(this, "nextStreamToken", 0), e(this, "runningStreamToken", void 0), e(this, "suppressedStreamTokens", /* @__PURE__ */ new Set()), e(this, "queuedMessageIdSet", j(/* @__PURE__ */ new Set())), e(this, "queuedMessageIds", p(() => this.queuedMessageIdSet.value)), e(this, "boundaryTimer", void 0), e(this, "nowMs", ae(Date.now())), e(this, "toolActivityTiming", ae({})), e(this, "lastVisibleProgressAtMs", ae()), e(this, "liveSegments", ae([])), e(this, "liveStreamMessageId", ae(void 0)), e(this, "conversationId", void 0), e(this, "textState", j({
|
|
405
428
|
isActive: !1,
|
|
406
429
|
isConnected: !1,
|
|
407
430
|
isThinking: !1,
|
|
408
431
|
connectionStatus: "disconnected"
|
|
409
|
-
})), e(this, "agentMode",
|
|
432
|
+
})), e(this, "agentMode", j("self")), e(this, "sharedMessages", j([])), e(this, "composerState", j({
|
|
410
433
|
text: "",
|
|
411
434
|
pendingAttachments: [],
|
|
412
435
|
isUploading: !1
|
|
@@ -431,14 +454,17 @@ var AgentChatController = class extends i {
|
|
|
431
454
|
canNotifyOnCompletion: !1,
|
|
432
455
|
lastVisibleProgressAtMs: this.lastVisibleProgressAtMs.value
|
|
433
456
|
});
|
|
434
|
-
})), e(this, "canUseComposer", p(() => this.textState.value.sendBlockedReason !== "agent_deleted" && !this.composerState.value.isUploading
|
|
457
|
+
})), e(this, "canUseComposer", p(() => this.textState.value.sendBlockedReason !== "agent_deleted" && !this.composerState.value.isUploading)), e(this, "canAttachFile", p(() => !!this.settings.uploadFileFn)), e(this, "canRecordAudio", p(() => this.canAttachFile.value && this.canUseComposer.value && !this.composerState.value.text.trim() && this.composerState.value.pendingAttachments.length === 0)), e(this, "voiceRecorder", new VoiceRecorderController({
|
|
435
458
|
getCanRecord: () => this.canRecordAudio.value,
|
|
436
459
|
getUploadFn: () => {
|
|
437
460
|
let e = this.settings.uploadFileFn;
|
|
438
461
|
return e ? (t) => e({ file: t }) : void 0;
|
|
439
462
|
},
|
|
440
463
|
getChatController: () => this
|
|
441
|
-
})), e(this, "canSend", p(() => (this.composerState.value.text.trim().length > 0 || this.composerState.value.pendingAttachments.length > 0) && this.canUseComposer.value && !this.voiceRecorder.isBusy.value)), e(this, "canStop", p(() => this.textState.value.isThinking && !this.composerState.value.isUploading && !this.voiceRecorder.isBusy.value)), e(this, "composerAction", p(() => this.
|
|
464
|
+
})), e(this, "canSend", p(() => (this.composerState.value.text.trim().length > 0 || this.composerState.value.pendingAttachments.length > 0) && this.canUseComposer.value && !this.voiceRecorder.isBusy.value)), e(this, "canStop", p(() => this.textState.value.isThinking && !this.composerState.value.isUploading && !this.voiceRecorder.isBusy.value)), e(this, "composerAction", p(() => this.canSend.value ? "send" : this.canStop.value ? "stop" : "idle")), e(this, "composerShowsSecondaryStop", p(() => this.canStop.value && this.composerAction.value === "send")), e(this, "canStartVoice", p(() => {
|
|
465
|
+
let e = this.settings.sdk;
|
|
466
|
+
return this.textState.value.sendBlockedReason !== "agent_deleted" && !!e?.activeUser.value && !!this._agent.agentId.value && !!this._agent.orgId.value && !!this.settings.createVoiceClientFn && voiceBrowserSupported();
|
|
467
|
+
})), e(this, "_agent", void 0), e(this, "localMessageSeq", 0), this._agent = t.agent instanceof n ? t.agent : new n({ config: t.agent }), this.setupModeWatcher(), this.setupAvailabilityWatcher(), this.setupBoundaryWatcher();
|
|
442
468
|
}
|
|
443
469
|
get chatEnabled() {
|
|
444
470
|
let e = this._agent.state.value.lifecycle;
|
|
@@ -464,7 +490,7 @@ var AgentChatController = class extends i {
|
|
|
464
490
|
}
|
|
465
491
|
addMessage(e, t, n, r) {
|
|
466
492
|
this.isDuplicateMessage(e, t) || (this.sharedMessages.value = [...this.sharedMessages.value, {
|
|
467
|
-
id:
|
|
493
|
+
id: this.nextLocalMessageId(),
|
|
468
494
|
text: e,
|
|
469
495
|
sender: t,
|
|
470
496
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -472,6 +498,9 @@ var AgentChatController = class extends i {
|
|
|
472
498
|
...r ? { issue: r } : {}
|
|
473
499
|
}]);
|
|
474
500
|
}
|
|
501
|
+
nextLocalMessageId() {
|
|
502
|
+
return `${Date.now()}-${++this.localMessageSeq}`;
|
|
503
|
+
}
|
|
475
504
|
notify(e) {
|
|
476
505
|
e && this.addMessage(e, "system");
|
|
477
506
|
}
|
|
@@ -577,7 +606,7 @@ Current User:
|
|
|
577
606
|
});
|
|
578
607
|
}
|
|
579
608
|
setupBoundaryWatcher() {
|
|
580
|
-
|
|
609
|
+
ce(() => this.workJournal.value?.nextBoundaryAtMs, (e) => {
|
|
581
610
|
this.scheduleBoundary(e);
|
|
582
611
|
});
|
|
583
612
|
}
|
|
@@ -639,12 +668,12 @@ Current User:
|
|
|
639
668
|
});
|
|
640
669
|
}
|
|
641
670
|
setupModeWatcher() {
|
|
642
|
-
|
|
671
|
+
ce(this.agentMode, async (e, t) => {
|
|
643
672
|
this.logger.info(`Mode changed from ${t} to ${e}`), this.isTextMode && (t === "talk" || t === "chat") && await this.endConversation();
|
|
644
673
|
});
|
|
645
674
|
}
|
|
646
675
|
setupAvailabilityWatcher() {
|
|
647
|
-
|
|
676
|
+
ce(() => this.chatEnabled, (e) => {
|
|
648
677
|
if (!(!this.isTextMode || this.isConnecting)) {
|
|
649
678
|
if (e) {
|
|
650
679
|
this.textState.value.isConnected || this.updateState(this.textState, {
|
|
@@ -703,7 +732,7 @@ Current User:
|
|
|
703
732
|
}
|
|
704
733
|
}
|
|
705
734
|
async endConversation() {
|
|
706
|
-
if (this.
|
|
735
|
+
if (this.turnEpoch += 1, this.runningStreamToken = void 0, this.suppressedStreamTokens.clear(), this.queuedMessageIdSet.value = /* @__PURE__ */ new Set(), !this.isTextMode) {
|
|
707
736
|
this.resetState();
|
|
708
737
|
return;
|
|
709
738
|
}
|
|
@@ -720,23 +749,34 @@ Current User:
|
|
|
720
749
|
this.addOfflineSystemReply();
|
|
721
750
|
return;
|
|
722
751
|
}
|
|
723
|
-
if (this.textState.value.sendBlockedReason === "agent_deleted"
|
|
752
|
+
if (this.textState.value.sendBlockedReason === "agent_deleted") return;
|
|
724
753
|
let { sdk: r } = this.settings;
|
|
725
754
|
if (!n && !this._agent.handle.value) {
|
|
726
755
|
this.handleError(/* @__PURE__ */ Error("Agent handle required for chat"));
|
|
727
756
|
return;
|
|
728
757
|
}
|
|
729
|
-
|
|
758
|
+
let i = this.textState.value.isThinking, a = this.sharedMessages.value.length;
|
|
759
|
+
this.addMessage(e, "user", t);
|
|
760
|
+
let o = this.sharedMessages.value.length > a ? this.sharedMessages.value[this.sharedMessages.value.length - 1]?.id : void 0, c = this.turnEpoch, u = ++this.nextStreamToken;
|
|
761
|
+
i && o ? this.queuedMessageIdSet.value = new Set(this.queuedMessageIdSet.value).add(o) : (this.runningStreamToken = u, this.resetWorkJournalTiming(), this.updateState(this.textState, {
|
|
730
762
|
isThinking: !0,
|
|
731
763
|
workingDescription: void 0,
|
|
732
764
|
toolActivities: [],
|
|
733
765
|
transientIssue: void 0,
|
|
734
766
|
turnOutcome: void 0
|
|
735
|
-
});
|
|
736
|
-
let
|
|
767
|
+
}));
|
|
768
|
+
let f = `stream-${Date.now()}-${u}`, p = !1, m = !1, isCurrentTurn = () => c === this.turnEpoch && !this.suppressedStreamTokens.has(u), claimLiveTurn = () => {
|
|
769
|
+
this.runningStreamToken !== u && (this.runningStreamToken = u, this.consumeQueuedThrough(o), this.resetWorkJournalTiming(), this.updateState(this.textState, {
|
|
770
|
+
isThinking: !0,
|
|
771
|
+
workingDescription: void 0,
|
|
772
|
+
toolActivities: [],
|
|
773
|
+
transientIssue: void 0,
|
|
774
|
+
turnOutcome: void 0
|
|
775
|
+
}));
|
|
776
|
+
}, onDelta = (e, t = "assistant") => {
|
|
737
777
|
if (!isCurrentTurn()) return;
|
|
738
|
-
this.updateState(this.textState, { workingDescription: void 0 }), t === "assistant" && (this.lastVisibleProgressAtMs.value = Date.now()),
|
|
739
|
-
id:
|
|
778
|
+
claimLiveTurn(), this.updateState(this.textState, { workingDescription: void 0 }), t === "assistant" && (this.lastVisibleProgressAtMs.value = Date.now()), p || (p = !0, this.liveStreamMessageId.value = f, this.sharedMessages.value = [...this.sharedMessages.value, {
|
|
779
|
+
id: f,
|
|
740
780
|
text: "",
|
|
741
781
|
sender: t === "system" ? "system" : "agent",
|
|
742
782
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
@@ -749,15 +789,15 @@ Current User:
|
|
|
749
789
|
kind: "text",
|
|
750
790
|
content: e
|
|
751
791
|
}];
|
|
752
|
-
let i = this.sharedMessages.value,
|
|
753
|
-
|
|
792
|
+
let i = this.sharedMessages.value, a = i[i.length - 1];
|
|
793
|
+
a?.id === f && (a.text += e, this.sharedMessages.value = [...i]);
|
|
754
794
|
}, onMessage = (e) => {
|
|
755
795
|
if (!isCurrentTurn()) return;
|
|
756
|
-
if (
|
|
757
|
-
this.liveSegments.value = [], this.liveStreamMessageId.value = void 0, this.sharedMessages.value = this.sharedMessages.value.filter((e) => e.id !==
|
|
796
|
+
if (claimLiveTurn(), m = !0, e.sender === "agent" && s(e.text)) {
|
|
797
|
+
this.liveSegments.value = [], this.liveStreamMessageId.value = void 0, this.sharedMessages.value = this.sharedMessages.value.filter((e) => e.id !== f);
|
|
758
798
|
return;
|
|
759
799
|
}
|
|
760
|
-
|
|
800
|
+
p = !0;
|
|
761
801
|
let t = e.sender === "system" || e.turnOutcome === "failed" ? "failed" : "completed";
|
|
762
802
|
this.finishToolActivities(t);
|
|
763
803
|
let n = this.textState.value.toolActivities, r = e.toolActivities?.length || !n?.length ? e : {
|
|
@@ -769,48 +809,37 @@ Current User:
|
|
|
769
809
|
toolActivities: [],
|
|
770
810
|
turnOutcome: void 0
|
|
771
811
|
});
|
|
772
|
-
let i = this.sharedMessages.value,
|
|
773
|
-
if (
|
|
774
|
-
...i.slice(0,
|
|
812
|
+
let i = this.sharedMessages.value, a = i.findIndex((e) => e.id === r.id);
|
|
813
|
+
if (a >= 0) this.sharedMessages.value = [
|
|
814
|
+
...i.slice(0, a),
|
|
775
815
|
r,
|
|
776
|
-
...i.slice(
|
|
816
|
+
...i.slice(a + 1)
|
|
777
817
|
];
|
|
778
818
|
else {
|
|
779
819
|
let e = i[i.length - 1];
|
|
780
|
-
this.sharedMessages.value = e?.id ===
|
|
820
|
+
this.sharedMessages.value = e?.id === f ? [...i.slice(0, -1), r] : [...i, r];
|
|
781
821
|
}
|
|
782
|
-
r.sender === "system" && r.issue?.bucket === "account" ? this.updateState(this.textState, { sendBlockedReason: "account" }) : r.sender === "system" && r.issue?.code &&
|
|
822
|
+
r.sender === "system" && r.issue?.bucket === "account" ? this.updateState(this.textState, { sendBlockedReason: "account" }) : r.sender === "system" && r.issue?.code && G.has(r.issue.code) && this.updateState(this.textState, { sendBlockedReason: "agent_deleted" });
|
|
783
823
|
}, onDone = (e) => {
|
|
784
824
|
if (!isCurrentTurn()) return;
|
|
785
|
-
if (!
|
|
825
|
+
if (!p && !m) {
|
|
786
826
|
onError("empty_stream — assistant returned no content");
|
|
787
827
|
return;
|
|
788
828
|
}
|
|
789
829
|
this.finishToolActivities("completed");
|
|
790
830
|
let t = this.sharedMessages.value, n = t[t.length - 1];
|
|
791
|
-
n?.id ===
|
|
831
|
+
n?.id === f && n.sender === "agent" && s(n.text) && (this.sharedMessages.value = t.slice(0, -1)), e && (this.conversationId = e), this.updateState(this.textState, {
|
|
792
832
|
isThinking: !1,
|
|
793
833
|
workingDescription: void 0,
|
|
794
834
|
transientIssue: void 0
|
|
795
|
-
});
|
|
835
|
+
}), this.settings.onTurnCompleted?.(e);
|
|
796
836
|
}, onError = (n) => {
|
|
797
837
|
if (!isCurrentTurn()) return;
|
|
798
|
-
if (
|
|
799
|
-
|
|
800
|
-
for (let t = r.length - 1; t >= 0; t--) if (r[t].sender === "user" && r[t].text === e) {
|
|
801
|
-
this.sharedMessages.value = [...r.slice(0, t), ...r.slice(t + 1)];
|
|
802
|
-
break;
|
|
803
|
-
}
|
|
804
|
-
this.composerState.value.text || (this.composerState.value = {
|
|
838
|
+
if (this.runningStreamToken !== u) {
|
|
839
|
+
this.consumeQueuedThrough(o), this.sharedMessages.value = this.sharedMessages.value.filter((e) => e.id !== o), this.composerState.value.text || (this.composerState.value = {
|
|
805
840
|
...this.composerState.value,
|
|
806
841
|
text: e,
|
|
807
842
|
pendingAttachments: t ?? []
|
|
808
|
-
}), this.updateState(this.textState, {
|
|
809
|
-
isThinking: !1,
|
|
810
|
-
transientIssue: {
|
|
811
|
-
code: n.code,
|
|
812
|
-
message: n.error
|
|
813
|
-
}
|
|
814
843
|
});
|
|
815
844
|
return;
|
|
816
845
|
}
|
|
@@ -819,7 +848,7 @@ Current User:
|
|
|
819
848
|
turnOutcome: "failed"
|
|
820
849
|
}), this.finishToolActivities("failed");
|
|
821
850
|
let r = this.sharedMessages.value, i = r[r.length - 1];
|
|
822
|
-
if (i?.id ===
|
|
851
|
+
if (i?.id === f && !i.text && (this.sharedMessages.value = r.slice(0, -1)), typeof n == "object" && n.code && n.error) {
|
|
823
852
|
let e = presentChatStreamError(n);
|
|
824
853
|
e.surface === "transient" ? this.updateState(this.textState, {
|
|
825
854
|
isThinking: !1,
|
|
@@ -830,18 +859,19 @@ Current User:
|
|
|
830
859
|
})) : this.handleError(Error(n.error));
|
|
831
860
|
return;
|
|
832
861
|
}
|
|
833
|
-
let
|
|
834
|
-
this.isTransientError(
|
|
835
|
-
raw:
|
|
862
|
+
let a = typeof n == "string" ? n : n.error, s = this.mapChatError(a);
|
|
863
|
+
this.isTransientError(a) ? (this.logger.warn("Chat turn failed (transient):", {
|
|
864
|
+
raw: a,
|
|
836
865
|
friendly: s
|
|
837
|
-
}), this.addMessage(s, "system"), this.updateState(this.textState, { isThinking: !1 })) : this.handleError(Error(s),
|
|
866
|
+
}), this.addMessage(s, "system"), this.updateState(this.textState, { isThinking: !1 })) : this.handleError(Error(s), a);
|
|
838
867
|
}, onStatus = (e) => {
|
|
839
868
|
if (!isCurrentTurn()) return;
|
|
869
|
+
claimLiveTurn();
|
|
840
870
|
let t = e.trim();
|
|
841
871
|
this.updateState(this.textState, { workingDescription: t || void 0 });
|
|
842
872
|
}, onToolActivity = (e) => {
|
|
843
873
|
if (isCurrentTurn()) {
|
|
844
|
-
if (this.lastVisibleProgressAtMs.value = Date.now(), e.status === "started") {
|
|
874
|
+
if (claimLiveTurn(), this.lastVisibleProgressAtMs.value = Date.now(), e.status === "started") {
|
|
845
875
|
let t = this.liveSegments.value, n = t[t.length - 1];
|
|
846
876
|
n?.kind === "work" ? n.activityIds.includes(e.activityId) || (this.liveSegments.value = [...t.slice(0, -1), {
|
|
847
877
|
kind: "work",
|
|
@@ -857,7 +887,7 @@ Current User:
|
|
|
857
887
|
isCurrentTurn() && this.updateState(this.textState, { workingDescription: void 0 });
|
|
858
888
|
};
|
|
859
889
|
try {
|
|
860
|
-
await (n ? n({
|
|
890
|
+
this.settings.onTurnStarted?.(), await (n ? n({
|
|
861
891
|
message: e,
|
|
862
892
|
attachments: t,
|
|
863
893
|
conversationId: this.conversationId,
|
|
@@ -889,7 +919,7 @@ Current User:
|
|
|
889
919
|
}
|
|
890
920
|
async stopChatTurn() {
|
|
891
921
|
if (this.textState.value.isThinking) {
|
|
892
|
-
this.
|
|
922
|
+
this.runningStreamToken !== void 0 && this.suppressedStreamTokens.add(this.runningStreamToken), this.runningStreamToken = void 0, this.updateState(this.textState, {
|
|
893
923
|
isThinking: !1,
|
|
894
924
|
turnOutcome: "stopped",
|
|
895
925
|
workingDescription: void 0,
|
|
@@ -931,6 +961,9 @@ function parseToolActivityMs(e) {
|
|
|
931
961
|
let t = Date.parse(e);
|
|
932
962
|
return Number.isFinite(t) ? t : void 0;
|
|
933
963
|
}
|
|
964
|
+
function voiceBrowserSupported() {
|
|
965
|
+
return typeof navigator < "u" && !!navigator.mediaDevices?.getUserMedia && typeof RTCPeerConnection < "u";
|
|
966
|
+
}
|
|
934
967
|
//#endregion
|
|
935
968
|
//#region agent/utils.ts
|
|
936
969
|
function getImageSrc(e) {
|
|
@@ -949,10 +982,10 @@ function parseButtonTemplate(e) {
|
|
|
949
982
|
}
|
|
950
983
|
//#endregion
|
|
951
984
|
//#region agent/ui/ElAgentButton.vue?vue&type=script&setup=true&lang.ts
|
|
952
|
-
var
|
|
985
|
+
var Ce = {
|
|
953
986
|
key: 0,
|
|
954
987
|
class: "absolute inset-0 flex items-center justify-center"
|
|
955
|
-
},
|
|
988
|
+
}, we = /* @__PURE__ */ S({
|
|
956
989
|
__name: "ElAgentButton",
|
|
957
990
|
props: {
|
|
958
991
|
theme: { default: "primary" },
|
|
@@ -980,25 +1013,25 @@ var we = {
|
|
|
980
1013
|
md: "size-4",
|
|
981
1014
|
lg: "size-5"
|
|
982
1015
|
})[e.size]);
|
|
983
|
-
return (i, a) => (
|
|
984
|
-
e.icon ? (
|
|
1016
|
+
return (i, a) => (A(), _("button", { class: T(["relative inline-flex items-center justify-center gap-2 font-medium rounded-full backdrop-blur-sm border-2 text-white transition-all duration-200 focus:outline-none active:opacity-80 disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer", [t.value, n.value]]) }, [e.loading ? (A(), _("div", Ce, [...a[0] || (a[0] = [v("i", { class: "i-svg-spinners-90-ring-with-bg size-5" }, null, -1)])])) : h("", !0), v("span", { class: T(["flex items-center gap-2 transition-opacity duration-200", e.loading ? "opacity-0" : "opacity-100"]) }, [
|
|
1017
|
+
e.icon ? (A(), _("i", {
|
|
985
1018
|
key: 0,
|
|
986
|
-
class:
|
|
1019
|
+
class: T([e.icon, r.value])
|
|
987
1020
|
}, null, 2)) : h("", !0),
|
|
988
|
-
|
|
989
|
-
e.iconAfter ? (
|
|
1021
|
+
ie(i.$slots, "default"),
|
|
1022
|
+
e.iconAfter ? (A(), _("i", {
|
|
990
1023
|
key: 1,
|
|
991
|
-
class:
|
|
1024
|
+
class: T([e.iconAfter, r.value])
|
|
992
1025
|
}, null, 2)) : h("", !0)
|
|
993
1026
|
], 2)], 2));
|
|
994
1027
|
}
|
|
995
|
-
}),
|
|
1028
|
+
}), Te = ["value"], Ee = /* @__PURE__ */ S({
|
|
996
1029
|
__name: "AgentInputEmail",
|
|
997
1030
|
props: { modelValue: { default: "" } },
|
|
998
1031
|
emits: ["update:modelValue"],
|
|
999
1032
|
setup(e, { emit: t }) {
|
|
1000
1033
|
let n = t;
|
|
1001
|
-
return (t, r) => (
|
|
1034
|
+
return (t, r) => (A(), _("input", {
|
|
1002
1035
|
name: "username",
|
|
1003
1036
|
type: "email",
|
|
1004
1037
|
inputmode: "email",
|
|
@@ -1011,9 +1044,9 @@ var we = {
|
|
|
1011
1044
|
class: "w-full px-6 py-3 text-theme-900 placeholder-theme-500 bg-white border border-white rounded-full focus:outline-none transition-colors",
|
|
1012
1045
|
style: { "font-size": "16px" },
|
|
1013
1046
|
onInput: r[0] || (r[0] = (e) => n("update:modelValue", e.target.value))
|
|
1014
|
-
}, null, 40,
|
|
1047
|
+
}, null, 40, Te));
|
|
1015
1048
|
}
|
|
1016
|
-
}),
|
|
1049
|
+
}), De = ["placeholder", "value"], Oe = /* @__PURE__ */ S({
|
|
1017
1050
|
__name: "AgentInputOneTimeCode",
|
|
1018
1051
|
props: {
|
|
1019
1052
|
modelValue: {},
|
|
@@ -1022,15 +1055,15 @@ var we = {
|
|
|
1022
1055
|
},
|
|
1023
1056
|
emits: ["update:modelValue", "autoSubmit"],
|
|
1024
1057
|
setup(e, { emit: t }) {
|
|
1025
|
-
let n = e, r = t, i =
|
|
1026
|
-
|
|
1058
|
+
let n = e, r = t, i = j(null), a = p(() => "0".repeat(n.length));
|
|
1059
|
+
ne(() => {
|
|
1027
1060
|
n.focusFirst && !("ontouchstart" in window) && i.value?.focus();
|
|
1028
1061
|
});
|
|
1029
1062
|
function onInput(e) {
|
|
1030
1063
|
let t = e.target.value.replace(/\D/g, "").slice(0, n.length);
|
|
1031
1064
|
r("update:modelValue", t), t.length === n.length && r("autoSubmit", t);
|
|
1032
1065
|
}
|
|
1033
|
-
return (t, n) => (
|
|
1066
|
+
return (t, n) => (A(), _("input", {
|
|
1034
1067
|
ref_key: "input",
|
|
1035
1068
|
ref: i,
|
|
1036
1069
|
name: "one-time-code",
|
|
@@ -1046,12 +1079,12 @@ var we = {
|
|
|
1046
1079
|
class: "w-full px-6 py-3 text-center font-mono tracking-[0.35em] text-theme-900 placeholder-theme-500 bg-white border border-white rounded-full focus:outline-none transition-colors",
|
|
1047
1080
|
style: { "font-size": "16px" },
|
|
1048
1081
|
onInput
|
|
1049
|
-
}, null, 40,
|
|
1082
|
+
}, null, 40, De));
|
|
1050
1083
|
}
|
|
1051
|
-
}),
|
|
1084
|
+
}), ke = { class: "relative flex-shrink-0" }, Ae = ["src", "alt"], je = { class: "absolute top-1 right-1" }, Me = {
|
|
1052
1085
|
key: 1,
|
|
1053
1086
|
class: "size-3 bg-theme-400 rounded-full ring-2 ring-white"
|
|
1054
|
-
}, Ne = { class: "min-w-0" }, Pe = /* @__PURE__ */
|
|
1087
|
+
}, Ne = { class: "min-w-0" }, Pe = /* @__PURE__ */ S({
|
|
1055
1088
|
__name: "ElModeHeader",
|
|
1056
1089
|
props: {
|
|
1057
1090
|
agent: {},
|
|
@@ -1063,17 +1096,17 @@ var we = {
|
|
|
1063
1096
|
layout: { default: "centered" }
|
|
1064
1097
|
},
|
|
1065
1098
|
setup(e) {
|
|
1066
|
-
return (t, n) => (
|
|
1099
|
+
return (t, n) => (A(), _("div", { class: T(["flex gap-4", [e.layout === "centered" ? "flex-col items-center text-center" : "flex-row items-center justify-center"]]) }, [v("div", ke, [v("div", { class: T(["rounded-full overflow-hidden border-white", e.size === "lg" ? "w-20 h-20 sm:w-24 sm:h-24 border-4" : "w-16 sm:size-16 border-2"]) }, [v("img", {
|
|
1067
1100
|
src: e.agent.avatarUrl.value,
|
|
1068
1101
|
alt: e.agent.displayName.value,
|
|
1069
1102
|
class: "w-full h-full object-cover",
|
|
1070
|
-
onError: n[0] || (n[0] = (...e) =>
|
|
1071
|
-
}, null, 40,
|
|
1103
|
+
onError: n[0] || (n[0] = (...e) => oe(handleImageError) && oe(handleImageError)(...e))
|
|
1104
|
+
}, null, 40, Ae)], 2), v("div", je, [e.isOnline ? (A(), _(f, { key: 0 }, [n[1] || (n[1] = v("div", {
|
|
1072
1105
|
class: "size-3 bg-green-500 rounded-full ring-2 ring-white absolute animate-ping",
|
|
1073
1106
|
style: { "animation-duration": "3s" }
|
|
1074
|
-
}, null, -1)), n[2] || (n[2] = v("div", { class: "size-3 bg-green-500 rounded-full ring-2 ring-white" }, null, -1))], 64)) : (
|
|
1107
|
+
}, null, -1)), n[2] || (n[2] = v("div", { class: "size-3 bg-green-500 rounded-full ring-2 ring-white" }, null, -1))], 64)) : (A(), _("div", Me))])]), v("div", Ne, [v("h1", { class: T(["font-light text-white mb-1 truncate", [e.size === "lg" ? "text-3xl mb-2" : "text-xl sm:text-2xl tracking-wide leading-tight", e.layout === "horizontal" ? "text-white/95" : ""]]) }, F(e.agent.displayName.value), 3), v("p", { class: T(["font-light line-clamp-1", [e.size === "lg" ? "text-base text-white/60" : "text-sm sm:text-base", e.layout === "horizontal" ? "text-white/70 truncate" : "text-white/60"]]) }, F(e.layout === "horizontal" ? e.agent.title.value || "Assistant" : e.agent.title.value), 3)])], 2));
|
|
1075
1108
|
}
|
|
1076
|
-
}), Fe = { class: "relative shrink-0 rounded-full" }, Ie = ["src", "alt"], Le = ["src", "alt"], Re = ["aria-label"], ze = /* @__PURE__ */
|
|
1109
|
+
}), Fe = { class: "relative shrink-0 rounded-full" }, Ie = ["src", "alt"], Le = ["src", "alt"], Re = ["aria-label"], ze = /* @__PURE__ */ S({
|
|
1077
1110
|
__name: "AgentAvatar",
|
|
1078
1111
|
props: {
|
|
1079
1112
|
agent: {},
|
|
@@ -1081,6 +1114,10 @@ var we = {
|
|
|
1081
1114
|
type: Boolean,
|
|
1082
1115
|
default: !0
|
|
1083
1116
|
},
|
|
1117
|
+
showOwnerMark: {
|
|
1118
|
+
type: Boolean,
|
|
1119
|
+
default: !0
|
|
1120
|
+
},
|
|
1084
1121
|
isLight: {
|
|
1085
1122
|
type: Boolean,
|
|
1086
1123
|
default: !0
|
|
@@ -1101,29 +1138,29 @@ var we = {
|
|
|
1101
1138
|
top: "calc(14.6% - clamp(3.5px, 7%, 7px))",
|
|
1102
1139
|
right: "calc(14.6% - clamp(3.5px, 7%, 7px))"
|
|
1103
1140
|
}, i = p(() => e.isLight ? "ring-white" : "ring-theme-900");
|
|
1104
|
-
return (t, a) => (
|
|
1141
|
+
return (t, a) => (A(), _("div", Fe, [
|
|
1105
1142
|
v("img", {
|
|
1106
1143
|
src: e.agent.avatarUrl.value,
|
|
1107
1144
|
alt: e.agent.displayName.value,
|
|
1108
|
-
class:
|
|
1145
|
+
class: T(["size-full rounded-full object-cover ring-1", e.isLight ? "ring-black/5" : "ring-white/10"])
|
|
1109
1146
|
}, null, 10, Ie),
|
|
1110
|
-
e.agent.ownerMarkUrl.value ? (
|
|
1147
|
+
e.showOwnerMark && e.agent.ownerMarkUrl.value ? (A(), _("img", {
|
|
1111
1148
|
key: 0,
|
|
1112
1149
|
src: e.agent.ownerMarkUrl.value,
|
|
1113
1150
|
alt: e.agent.owner.value?.fullName ? `Owned by ${e.agent.owner.value.fullName}` : "Owner",
|
|
1114
|
-
class:
|
|
1151
|
+
class: T(["absolute z-10 size-[36%] -bottom-[3%] -left-[3%] rounded-full object-cover ring-2", i.value])
|
|
1115
1152
|
}, null, 10, Le)) : h("", !0),
|
|
1116
|
-
n.value ? (
|
|
1153
|
+
n.value ? (A(), _("span", {
|
|
1117
1154
|
key: 1,
|
|
1118
1155
|
role: "status",
|
|
1119
1156
|
"aria-label": e.agent.state.value.tooltip,
|
|
1120
|
-
class:
|
|
1157
|
+
class: T(["absolute z-10 rounded-full ring-2", [n.value, i.value]]),
|
|
1121
1158
|
style: r
|
|
1122
1159
|
}, null, 10, Re)) : h("", !0),
|
|
1123
|
-
n.value && e.agent.state.value.lifecycle === "running" ? (
|
|
1160
|
+
n.value && e.agent.state.value.lifecycle === "running" ? (A(), _("span", {
|
|
1124
1161
|
key: 2,
|
|
1125
1162
|
"aria-hidden": "true",
|
|
1126
|
-
class:
|
|
1163
|
+
class: T(["pointer-events-none absolute rounded-full animate-ping opacity-50 [animation-duration:3s]", n.value]),
|
|
1127
1164
|
style: r
|
|
1128
1165
|
}, null, 2)) : h("", !0)
|
|
1129
1166
|
]));
|
|
@@ -1133,23 +1170,23 @@ var we = {
|
|
|
1133
1170
|
class: "sr-only",
|
|
1134
1171
|
role: "status",
|
|
1135
1172
|
"aria-live": "polite"
|
|
1136
|
-
}, Ve = ["aria-expanded", "disabled"],
|
|
1173
|
+
}, Ve = ["aria-expanded", "disabled"], He = ["aria-expanded"], Ue = {
|
|
1137
1174
|
class: "flex w-5 shrink-0 justify-center self-stretch",
|
|
1138
1175
|
"aria-hidden": "true"
|
|
1139
|
-
},
|
|
1176
|
+
}, We = ["data-journal-row"], Ge = {
|
|
1140
1177
|
class: "flex w-5 shrink-0 flex-col items-center self-stretch",
|
|
1141
1178
|
"aria-hidden": "true"
|
|
1142
|
-
},
|
|
1179
|
+
}, Ke = { class: "flex h-[17px] shrink-0 items-center" }, qe = {
|
|
1143
1180
|
key: 0,
|
|
1144
1181
|
class: "sr-only"
|
|
1145
|
-
},
|
|
1182
|
+
}, Je = /* @__PURE__ */ S({
|
|
1146
1183
|
__name: "AgentToolActivityGroup",
|
|
1147
1184
|
props: {
|
|
1148
1185
|
model: {},
|
|
1149
1186
|
isLight: { type: Boolean }
|
|
1150
1187
|
},
|
|
1151
1188
|
setup(e) {
|
|
1152
|
-
let t = e, n =
|
|
1189
|
+
let t = e, n = ae(!1);
|
|
1153
1190
|
function toggle() {
|
|
1154
1191
|
n.value = !n.value;
|
|
1155
1192
|
}
|
|
@@ -1219,16 +1256,16 @@ var we = {
|
|
|
1219
1256
|
}
|
|
1220
1257
|
};
|
|
1221
1258
|
});
|
|
1222
|
-
return (t, u) => (
|
|
1223
|
-
a.value ? (
|
|
1224
|
-
r.value ? (
|
|
1259
|
+
return (t, u) => (A(), _("div", { class: T(["w-full py-0.5", s.value.muted]) }, [
|
|
1260
|
+
a.value ? (A(), _("span", Be, F(a.value), 1)) : h("", !0),
|
|
1261
|
+
r.value ? (A(), _("button", {
|
|
1225
1262
|
key: 1,
|
|
1226
1263
|
type: "button",
|
|
1227
1264
|
"data-test": "messaging-tool-activity-summary",
|
|
1228
1265
|
"data-journal-disclosure": "",
|
|
1229
1266
|
"aria-expanded": n.value,
|
|
1230
1267
|
disabled: i.value === 0,
|
|
1231
|
-
class:
|
|
1268
|
+
class: T(["flex min-h-11 items-center gap-x-2 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-default", s.value.ring]),
|
|
1232
1269
|
onClick: toggle
|
|
1233
1270
|
}, [
|
|
1234
1271
|
u[0] || (u[0] = v("i", {
|
|
@@ -1236,47 +1273,47 @@ var we = {
|
|
|
1236
1273
|
class: "i-tabler-circle-check size-3.5 shrink-0 text-green-600",
|
|
1237
1274
|
"aria-hidden": "true"
|
|
1238
1275
|
}, null, -1)),
|
|
1239
|
-
v("span", { class:
|
|
1240
|
-
i.value ? (
|
|
1276
|
+
v("span", { class: T(["text-[12.5px] font-medium leading-none", s.value.muted]) }, F(e.model.terminal?.label), 3),
|
|
1277
|
+
i.value ? (A(), _("i", {
|
|
1241
1278
|
key: 0,
|
|
1242
|
-
class:
|
|
1279
|
+
class: T(["size-[13px] shrink-0", [n.value ? "i-tabler-chevron-down" : "i-tabler-chevron-right", s.value.muted]]),
|
|
1243
1280
|
"aria-hidden": "true"
|
|
1244
1281
|
}, null, 2)) : h("", !0)
|
|
1245
|
-
], 10, Ve)) : i.value ? (
|
|
1282
|
+
], 10, Ve)) : i.value ? (A(), _("button", {
|
|
1246
1283
|
key: 2,
|
|
1247
1284
|
type: "button",
|
|
1248
1285
|
"data-test": "messaging-tool-activity-summary",
|
|
1249
1286
|
"data-journal-disclosure": "",
|
|
1250
1287
|
"aria-expanded": n.value,
|
|
1251
|
-
class:
|
|
1288
|
+
class: T(["flex min-h-11 w-full gap-x-2.5 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2", s.value.ring]),
|
|
1252
1289
|
onClick: toggle
|
|
1253
|
-
}, [v("span",
|
|
1290
|
+
}, [v("span", Ue, [v("span", {
|
|
1254
1291
|
"data-journal-spine": "dashed",
|
|
1255
|
-
class:
|
|
1256
|
-
}, null, 2)]), v("span", { class:
|
|
1257
|
-
class:
|
|
1292
|
+
class: T(["w-0 border-l border-dashed", s.value.dashed])
|
|
1293
|
+
}, null, 2)]), v("span", { class: T(["flex min-h-[20px] items-center gap-0.5 pb-2 text-[12px] leading-none", s.value.muted]) }, [b(F(i.value) + " earlier updates ", 1), v("i", {
|
|
1294
|
+
class: T(["size-3 shrink-0", n.value ? "i-tabler-chevron-down" : "i-tabler-chevron-right"]),
|
|
1258
1295
|
"aria-hidden": "true"
|
|
1259
|
-
}, null, 2)], 2)], 10,
|
|
1260
|
-
(
|
|
1296
|
+
}, null, 2)], 2)], 10, He)) : h("", !0),
|
|
1297
|
+
(A(!0), _(f, null, M(o.value, (e, t) => (A(), _("div", {
|
|
1261
1298
|
key: e.id,
|
|
1262
1299
|
"data-test": "messaging-tool-activity-row",
|
|
1263
1300
|
"data-journal-row": e.tone,
|
|
1264
|
-
class:
|
|
1265
|
-
}, [v("div",
|
|
1301
|
+
class: T([r.value ? "pl-[22px]" : "", "flex gap-x-2.5"])
|
|
1302
|
+
}, [v("div", Ge, [v("span", Ke, [(A(), m(P(c.value[e.tone].station.tag), {
|
|
1266
1303
|
"data-journal-station": e.tone,
|
|
1267
|
-
class:
|
|
1268
|
-
}, null, 8, ["data-journal-station", "class"]))]), t === o.value.length - 1 ? h("", !0) : (
|
|
1304
|
+
class: T(c.value[e.tone].station.class)
|
|
1305
|
+
}, null, 8, ["data-journal-station", "class"]))]), t === o.value.length - 1 ? h("", !0) : (A(), _("span", {
|
|
1269
1306
|
key: 0,
|
|
1270
|
-
class:
|
|
1271
|
-
}, null, 2))]), v("div", { class:
|
|
1307
|
+
class: T(["w-px flex-1", s.value.spine])
|
|
1308
|
+
}, null, 2))]), v("div", { class: T(["min-w-0 flex-1", t === o.value.length - 1 ? "" : "pb-2"]) }, [v("span", { class: T(["relative block leading-snug", c.value[e.tone].label]) }, [b(F(e.label), 1), c.value[e.tone].statusWord ? (A(), _("span", qe, ", " + F(c.value[e.tone].statusWord), 1)) : h("", !0)], 2), e.note ? (A(), _("p", {
|
|
1272
1309
|
key: 0,
|
|
1273
|
-
class:
|
|
1274
|
-
},
|
|
1275
|
-
!r.value && e.model.hint ? (
|
|
1310
|
+
class: T(["pt-0.5 text-[11.5px] leading-snug", s.value.muted])
|
|
1311
|
+
}, F(e.note), 3)) : h("", !0)], 2)], 10, We))), 128)),
|
|
1312
|
+
!r.value && e.model.hint ? (A(), _("p", {
|
|
1276
1313
|
key: 3,
|
|
1277
1314
|
"data-test": "messaging-tool-activity-hint",
|
|
1278
|
-
class:
|
|
1279
|
-
},
|
|
1315
|
+
class: T(["pl-[30px] pt-2.5 text-[12px] leading-snug", s.value.muted])
|
|
1316
|
+
}, F(e.model.hint), 3)) : h("", !0)
|
|
1280
1317
|
], 2));
|
|
1281
1318
|
}
|
|
1282
1319
|
});
|
|
@@ -1321,7 +1358,7 @@ function _unsupportedIterableToArray(e, t) {
|
|
|
1321
1358
|
return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? _arrayLikeToArray(e, t) : void 0;
|
|
1322
1359
|
}
|
|
1323
1360
|
}
|
|
1324
|
-
var
|
|
1361
|
+
var Ye = Object.entries, K = Object.setPrototypeOf, Xe = Object.isFrozen, Ze = Object.getPrototypeOf, Qe = Object.getOwnPropertyDescriptor, q = Object.freeze, J = Object.seal, $e = Object.create, et = typeof Reflect < "u" && Reflect, tt = et.apply, nt = et.construct;
|
|
1325
1362
|
q || (q = function freeze(e) {
|
|
1326
1363
|
return e;
|
|
1327
1364
|
}), J || (J = function seal(e) {
|
|
@@ -1347,7 +1384,7 @@ function unconstruct(e) {
|
|
|
1347
1384
|
}
|
|
1348
1385
|
function addToSet(e, t) {
|
|
1349
1386
|
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ut;
|
|
1350
|
-
if (
|
|
1387
|
+
if (K && K(e, null), !lt(t)) return e;
|
|
1351
1388
|
let r = t.length;
|
|
1352
1389
|
for (; r--;) {
|
|
1353
1390
|
let i = t[r];
|
|
@@ -1365,7 +1402,7 @@ function cleanArray(e) {
|
|
|
1365
1402
|
}
|
|
1366
1403
|
function clone(e) {
|
|
1367
1404
|
let t = $e(null);
|
|
1368
|
-
for (let r of
|
|
1405
|
+
for (let r of Ye(e)) {
|
|
1369
1406
|
var n = _slicedToArray(r, 2);
|
|
1370
1407
|
let i = n[0], a = n[1];
|
|
1371
1408
|
X(e, i) && (lt(a) ? t[i] = cleanArray(a) : a && typeof a == "object" && a.constructor === Object ? t[i] = clone(a) : t[i] = a);
|
|
@@ -1539,43 +1576,43 @@ function createDOMPurify() {
|
|
|
1539
1576
|
e.DocumentFragment;
|
|
1540
1577
|
let i = e.HTMLTemplateElement, a = e.Node, o = e.Element, s = e.NodeFilter;
|
|
1541
1578
|
e.NamedNodeMap === void 0 && (e.NamedNodeMap || e.MozNamedAttrMap), e.HTMLFormElement;
|
|
1542
|
-
let c = e.DOMParser, u = e.trustedTypes, f = o.prototype, p = lookupGetter(f, "cloneNode"), m = lookupGetter(f, "remove"), h = lookupGetter(f, "nextSibling"), _ = lookupGetter(f, "childNodes"), v = lookupGetter(f, "parentNode"),
|
|
1579
|
+
let c = e.DOMParser, u = e.trustedTypes, f = o.prototype, p = lookupGetter(f, "cloneNode"), m = lookupGetter(f, "remove"), h = lookupGetter(f, "nextSibling"), _ = lookupGetter(f, "childNodes"), v = lookupGetter(f, "parentNode"), b = lookupGetter(f, "shadowRoot"), x = lookupGetter(f, "attributes"), S = a && a.prototype ? lookupGetter(a.prototype, "nodeType") : null, C = a && a.prototype ? lookupGetter(a.prototype, "nodeName") : null;
|
|
1543
1580
|
if (typeof i == "function") {
|
|
1544
1581
|
let e = t.createElement("template");
|
|
1545
1582
|
e.content && e.content.ownerDocument && (t = e.content.ownerDocument);
|
|
1546
1583
|
}
|
|
1547
|
-
let
|
|
1548
|
-
if (
|
|
1549
|
-
},
|
|
1550
|
-
|
|
1584
|
+
let T, k = "", te, ne = !1, re = 0, A = function _assertNotInTrustedTypesPolicy() {
|
|
1585
|
+
if (re > 0) throw xt("A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the \"DOMPurify and Trusted Types\" section of the README.");
|
|
1586
|
+
}, j = function _createTrustedHTML(e) {
|
|
1587
|
+
A(), re++;
|
|
1551
1588
|
try {
|
|
1552
|
-
return
|
|
1589
|
+
return T.createHTML(e);
|
|
1553
1590
|
} finally {
|
|
1554
|
-
|
|
1591
|
+
re--;
|
|
1555
1592
|
}
|
|
1556
|
-
},
|
|
1557
|
-
|
|
1593
|
+
}, M = function _createTrustedScriptURL(e) {
|
|
1594
|
+
A(), re++;
|
|
1558
1595
|
try {
|
|
1559
|
-
return
|
|
1596
|
+
return T.createScriptURL(e);
|
|
1560
1597
|
} finally {
|
|
1561
|
-
|
|
1598
|
+
re--;
|
|
1562
1599
|
}
|
|
1563
|
-
},
|
|
1564
|
-
return
|
|
1565
|
-
},
|
|
1566
|
-
DOMPurify.isSupported = typeof
|
|
1567
|
-
let
|
|
1600
|
+
}, ie = function _getDefaultTrustedTypesPolicy() {
|
|
1601
|
+
return ne || (te = Yt(u, r), ne = !0), te;
|
|
1602
|
+
}, P = t, ae = P.implementation, F = P.createNodeIterator, oe = P.createDocumentFragment, se = P.getElementsByTagName, ce = n.importNode, I = Xt();
|
|
1603
|
+
DOMPurify.isSupported = typeof Ye == "function" && typeof v == "function" && ae && ae.createHTMLDocument !== void 0;
|
|
1604
|
+
let ue = Nt, de = Pt, pe = Ft, R = It, B = Lt, he = zt, _e = Bt, H = Ht, ve = Rt, U = null, ye = addToSet({}, [
|
|
1568
1605
|
...St,
|
|
1569
1606
|
...Ct,
|
|
1570
1607
|
...wt,
|
|
1571
1608
|
...Et,
|
|
1572
1609
|
...Ot
|
|
1573
|
-
]),
|
|
1610
|
+
]), W = null, be = addToSet({}, [
|
|
1574
1611
|
...kt,
|
|
1575
1612
|
...At,
|
|
1576
1613
|
...jt,
|
|
1577
1614
|
...Mt
|
|
1578
|
-
]),
|
|
1615
|
+
]), G = Object.seal($e(null, {
|
|
1579
1616
|
tagNameCheck: {
|
|
1580
1617
|
writable: !0,
|
|
1581
1618
|
configurable: !1,
|
|
@@ -1594,7 +1631,7 @@ function createDOMPurify() {
|
|
|
1594
1631
|
enumerable: !0,
|
|
1595
1632
|
value: !1
|
|
1596
1633
|
}
|
|
1597
|
-
})),
|
|
1634
|
+
})), Se = null, Ce = null, we = Object.seal($e(null, {
|
|
1598
1635
|
tagCheck: {
|
|
1599
1636
|
writable: !0,
|
|
1600
1637
|
configurable: !1,
|
|
@@ -1607,14 +1644,14 @@ function createDOMPurify() {
|
|
|
1607
1644
|
enumerable: !0,
|
|
1608
1645
|
value: null
|
|
1609
1646
|
}
|
|
1610
|
-
})),
|
|
1647
|
+
})), Te = !0, Ee = !0, De = !1, Oe = !0, ke = !1, Ae = !0, je = !1, Me = !1, Ne = null, Pe = null, Fe = !1, Ie = !1, Le = !1, Re = !1, ze = !0, Be = !1, Ve = "user-content-", He = !0, Ue = !1, We = {}, Ge = null, Ke = addToSet({}, /* @__PURE__ */ "annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp".split(".")), qe = null, Je = addToSet({}, [
|
|
1611
1648
|
"audio",
|
|
1612
1649
|
"video",
|
|
1613
1650
|
"img",
|
|
1614
1651
|
"source",
|
|
1615
1652
|
"image",
|
|
1616
1653
|
"track"
|
|
1617
|
-
]),
|
|
1654
|
+
]), K = null, Xe = addToSet({}, [
|
|
1618
1655
|
"alt",
|
|
1619
1656
|
"class",
|
|
1620
1657
|
"for",
|
|
@@ -1650,29 +1687,29 @@ function createDOMPurify() {
|
|
|
1650
1687
|
}, on = function _parseConfig() {
|
|
1651
1688
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
1652
1689
|
if (nn && nn === e) return;
|
|
1653
|
-
(!e || typeof e != "object") && (e = {}), e = clone(e), en = tn.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, Q = en === "application/xhtml+xml" ? dt : ut,
|
|
1690
|
+
(!e || typeof e != "object") && (e = {}), e = clone(e), en = tn.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, Q = en === "application/xhtml+xml" ? dt : ut, U = Zt(e, "ALLOWED_TAGS", ye, { transform: Q }), W = Zt(e, "ALLOWED_ATTR", be, { transform: Q }), gt = Zt(e, "ALLOWED_NAMESPACES", _t, { transform: dt }), K = Zt(e, "ADD_URI_SAFE_ATTR", Xe, {
|
|
1654
1691
|
transform: Q,
|
|
1655
1692
|
base: Xe
|
|
1656
|
-
}),
|
|
1693
|
+
}), qe = Zt(e, "ADD_DATA_URI_TAGS", Je, {
|
|
1657
1694
|
transform: Q,
|
|
1658
|
-
base:
|
|
1659
|
-
}),
|
|
1695
|
+
base: Je
|
|
1696
|
+
}), Ge = Zt(e, "FORBID_CONTENTS", Ke, { transform: Q }), Se = Zt(e, "FORBID_TAGS", clone({}), { transform: Q }), Ce = Zt(e, "FORBID_ATTR", clone({}), { transform: Q }), We = X(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? clone(e.USE_PROFILES) : e.USE_PROFILES : !1, Te = e.ALLOW_ARIA_ATTR !== !1, Ee = e.ALLOW_DATA_ATTR !== !1, De = e.ALLOW_UNKNOWN_PROTOCOLS || !1, Oe = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, ke = e.SAFE_FOR_TEMPLATES || !1, Ae = e.SAFE_FOR_XML !== !1, je = e.WHOLE_DOCUMENT || !1, Ie = e.RETURN_DOM || !1, Le = e.RETURN_DOM_FRAGMENT || !1, Re = e.RETURN_TRUSTED_TYPE || !1, Fe = e.FORCE_BODY || !1, ze = e.SANITIZE_DOM !== !1, Be = e.SANITIZE_NAMED_PROPS || !1, He = e.KEEP_CONTENT !== !1, Ue = e.IN_PLACE || !1, ve = isRegex(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : Rt, tt = typeof e.NAMESPACE == "string" ? e.NAMESPACE : et, yt = X(e, "MATHML_TEXT_INTEGRATION_POINTS") && e.MATHML_TEXT_INTEGRATION_POINTS && typeof e.MATHML_TEXT_INTEGRATION_POINTS == "object" ? clone(e.MATHML_TEXT_INTEGRATION_POINTS) : addToSet({}, vt), Qt = X(e, "HTML_INTEGRATION_POINTS") && e.HTML_INTEGRATION_POINTS && typeof e.HTML_INTEGRATION_POINTS == "object" ? clone(e.HTML_INTEGRATION_POINTS) : addToSet({}, bt);
|
|
1660
1697
|
let t = X(e, "CUSTOM_ELEMENT_HANDLING") && e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING == "object" ? clone(e.CUSTOM_ELEMENT_HANDLING) : $e(null);
|
|
1661
|
-
if (
|
|
1698
|
+
if (G = $e(null), X(t, "tagNameCheck") && an(t.tagNameCheck) && (G.tagNameCheck = t.tagNameCheck), X(t, "attributeNameCheck") && an(t.attributeNameCheck) && (G.attributeNameCheck = t.attributeNameCheck), X(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (G.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), J(G), ke && (Ee = !1), Le && (Ie = !0), We && (U = addToSet({}, Ot), W = $e(null), We.html === !0 && (addToSet(U, St), addToSet(W, kt)), We.svg === !0 && (addToSet(U, Ct), addToSet(W, At), addToSet(W, Mt)), We.svgFilters === !0 && (addToSet(U, wt), addToSet(W, At), addToSet(W, Mt)), We.mathMl === !0 && (addToSet(U, Et), addToSet(W, jt), addToSet(W, Mt))), we.tagCheck = null, we.attributeCheck = null, X(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? we.tagCheck = e.ADD_TAGS : lt(e.ADD_TAGS) && (U === ye && (U = clone(U)), addToSet(U, e.ADD_TAGS, Q))), X(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? we.attributeCheck = e.ADD_ATTR : lt(e.ADD_ATTR) && (W === be && (W = clone(W)), addToSet(W, e.ADD_ATTR, Q))), X(e, "ADD_URI_SAFE_ATTR") && lt(e.ADD_URI_SAFE_ATTR) && addToSet(K, e.ADD_URI_SAFE_ATTR, Q), X(e, "FORBID_CONTENTS") && lt(e.FORBID_CONTENTS) && (Ge === Ke && (Ge = clone(Ge)), addToSet(Ge, e.FORBID_CONTENTS, Q)), X(e, "ADD_FORBID_CONTENTS") && lt(e.ADD_FORBID_CONTENTS) && (Ge === Ke && (Ge = clone(Ge)), addToSet(Ge, e.ADD_FORBID_CONTENTS, Q)), He && (U["#text"] = !0), je && addToSet(U, [
|
|
1662
1699
|
"html",
|
|
1663
1700
|
"head",
|
|
1664
1701
|
"body"
|
|
1665
|
-
]),
|
|
1702
|
+
]), U.table && (addToSet(U, ["tbody"]), delete Se.tbody), e.TRUSTED_TYPES_POLICY) {
|
|
1666
1703
|
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw xt("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
|
|
1667
1704
|
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw xt("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
|
|
1668
|
-
let t =
|
|
1669
|
-
|
|
1705
|
+
let t = T;
|
|
1706
|
+
T = e.TRUSTED_TYPES_POLICY;
|
|
1670
1707
|
try {
|
|
1671
|
-
|
|
1708
|
+
k = j("");
|
|
1672
1709
|
} catch (e) {
|
|
1673
|
-
throw
|
|
1710
|
+
throw T = t, e;
|
|
1674
1711
|
}
|
|
1675
|
-
} else e.TRUSTED_TYPES_POLICY === null ? (
|
|
1712
|
+
} else e.TRUSTED_TYPES_POLICY === null ? (T = void 0, k = "") : (T === void 0 && (T = ie()), T && typeof k == "string" && (k = j("")));
|
|
1676
1713
|
q && q(e), nn = e;
|
|
1677
1714
|
}, sn = addToSet({}, [
|
|
1678
1715
|
...Ct,
|
|
@@ -1712,7 +1749,7 @@ function createDOMPurify() {
|
|
|
1712
1749
|
} catch {}
|
|
1713
1750
|
});
|
|
1714
1751
|
}
|
|
1715
|
-
let n =
|
|
1752
|
+
let n = x(e);
|
|
1716
1753
|
if (n) for (let t = n.length - 1; t >= 0; --t) {
|
|
1717
1754
|
let r = n[t], i = r && r.name;
|
|
1718
1755
|
if (typeof i == "string") try {
|
|
@@ -1738,10 +1775,10 @@ function createDOMPurify() {
|
|
|
1738
1775
|
t.setAttribute(e, "");
|
|
1739
1776
|
} catch {}
|
|
1740
1777
|
}, gn = function _stripDisallowedAttributes(e) {
|
|
1741
|
-
let t =
|
|
1778
|
+
let t = x(e);
|
|
1742
1779
|
if (t) for (let n = t.length - 1; n >= 0; --n) {
|
|
1743
1780
|
let r = t[n], i = r && r.name;
|
|
1744
|
-
if (!(typeof i != "string" ||
|
|
1781
|
+
if (!(typeof i != "string" || W[Q(i)])) try {
|
|
1745
1782
|
e.removeAttribute(i);
|
|
1746
1783
|
} catch {}
|
|
1747
1784
|
}
|
|
@@ -1749,15 +1786,15 @@ function createDOMPurify() {
|
|
|
1749
1786
|
let t = [e];
|
|
1750
1787
|
for (; t.length > 0;) {
|
|
1751
1788
|
let e = t.pop();
|
|
1752
|
-
(
|
|
1789
|
+
(S ? S(e) : e.nodeType) === qt.element && gn(e);
|
|
1753
1790
|
let n = _(e);
|
|
1754
1791
|
if (n) for (let e = n.length - 1; e >= 0; --e) t.push(n[e]);
|
|
1755
1792
|
}
|
|
1756
1793
|
}, vn = function _neutralizePatchLinkage(e) {
|
|
1757
|
-
if (!
|
|
1794
|
+
if (!Ae) return;
|
|
1758
1795
|
let t = [e];
|
|
1759
1796
|
for (; t.length > 0;) {
|
|
1760
|
-
let e = t.pop(), n =
|
|
1797
|
+
let e = t.pop(), n = S ? S(e) : e.nodeType;
|
|
1761
1798
|
if (n === qt.processingInstruction || n === qt.comment && Z(Wt, e.data)) {
|
|
1762
1799
|
try {
|
|
1763
1800
|
m(e);
|
|
@@ -1765,7 +1802,7 @@ function createDOMPurify() {
|
|
|
1765
1802
|
continue;
|
|
1766
1803
|
}
|
|
1767
1804
|
if (n === qt.element) {
|
|
1768
|
-
let t = e, n = Q(
|
|
1805
|
+
let t = e, n = Q(C ? C(e) : e.nodeName);
|
|
1769
1806
|
try {
|
|
1770
1807
|
t.hasAttribute && t.hasAttribute("patchsrc") && t.removeAttribute("patchsrc"), t.hasAttribute && t.hasAttribute("for") && n !== "label" && n !== "output" && t.removeAttribute("for");
|
|
1771
1808
|
} catch {}
|
|
@@ -1781,44 +1818,44 @@ function createDOMPurify() {
|
|
|
1781
1818
|
r = t && t[0];
|
|
1782
1819
|
}
|
|
1783
1820
|
en === "application/xhtml+xml" && tt === et && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
|
|
1784
|
-
let i =
|
|
1821
|
+
let i = T ? j(e) : e;
|
|
1785
1822
|
if (tt === et) try {
|
|
1786
1823
|
n = new c().parseFromString(i, en);
|
|
1787
1824
|
} catch {}
|
|
1788
1825
|
if (!n || !n.documentElement) {
|
|
1789
|
-
n =
|
|
1826
|
+
n = ae.createDocument(tt, "template", null);
|
|
1790
1827
|
try {
|
|
1791
|
-
n.documentElement.innerHTML = nt ?
|
|
1828
|
+
n.documentElement.innerHTML = nt ? k : i;
|
|
1792
1829
|
} catch {}
|
|
1793
1830
|
}
|
|
1794
1831
|
let a = n.body || n.documentElement;
|
|
1795
|
-
return e && r && a.insertBefore(t.createTextNode(r), a.childNodes[0] || null), tt === et ?
|
|
1832
|
+
return e && r && a.insertBefore(t.createTextNode(r), a.childNodes[0] || null), tt === et ? se.call(n, je ? "html" : "body")[0] : je ? n.documentElement : a;
|
|
1796
1833
|
}, bn = function _createNodeIterator(e) {
|
|
1797
|
-
return
|
|
1834
|
+
return F.call(e.ownerDocument || e, e, s.SHOW_ELEMENT | s.SHOW_COMMENT | s.SHOW_TEXT | s.SHOW_PROCESSING_INSTRUCTION | s.SHOW_CDATA_SECTION, null);
|
|
1798
1835
|
}, xn = function _stripTemplateExpressions(e) {
|
|
1799
|
-
return e = pt(e,
|
|
1836
|
+
return e = pt(e, ue, " "), e = pt(e, de, " "), e = pt(e, pe, " "), e;
|
|
1800
1837
|
}, Sn = function _scrubTemplateExpressions(e) {
|
|
1801
1838
|
e.normalize();
|
|
1802
|
-
let t =
|
|
1839
|
+
let t = F.call(e.ownerDocument || e, e, s.SHOW_TEXT | s.SHOW_COMMENT | s.SHOW_CDATA_SECTION | s.SHOW_PROCESSING_INSTRUCTION, null), n = t.nextNode();
|
|
1803
1840
|
for (; n;) n.data = xn(n.data), n = t.nextNode();
|
|
1804
1841
|
let r = e.querySelectorAll?.call(e, "template");
|
|
1805
1842
|
r && rt(r, (e) => {
|
|
1806
1843
|
wn(e.content) && Sn(e.content);
|
|
1807
1844
|
});
|
|
1808
1845
|
}, Cn = function _isClobbered(e) {
|
|
1809
|
-
let t =
|
|
1810
|
-
return typeof t != "string" || Q(t) !== "form" ? !1 : typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || e.attributes !==
|
|
1846
|
+
let t = C ? C(e) : null;
|
|
1847
|
+
return typeof t != "string" || Q(t) !== "form" ? !1 : typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || e.attributes !== x(e) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function" || e.nodeType !== S(e) || e.childNodes !== _(e);
|
|
1811
1848
|
}, wn = function _isDocumentFragment(e) {
|
|
1812
|
-
if (!
|
|
1849
|
+
if (!S || typeof e != "object" || !e) return !1;
|
|
1813
1850
|
try {
|
|
1814
|
-
return
|
|
1851
|
+
return S(e) === qt.documentFragment;
|
|
1815
1852
|
} catch {
|
|
1816
1853
|
return !1;
|
|
1817
1854
|
}
|
|
1818
1855
|
}, Tn = function _isNode(e) {
|
|
1819
|
-
if (!
|
|
1856
|
+
if (!S || typeof e != "object" || !e) return !1;
|
|
1820
1857
|
try {
|
|
1821
|
-
return typeof
|
|
1858
|
+
return typeof S(e) == "number";
|
|
1822
1859
|
} catch {
|
|
1823
1860
|
return !1;
|
|
1824
1861
|
}
|
|
@@ -1829,46 +1866,46 @@ function createDOMPurify() {
|
|
|
1829
1866
|
});
|
|
1830
1867
|
}
|
|
1831
1868
|
let En = function _isUnsafeNode(e, t) {
|
|
1832
|
-
return !!(
|
|
1869
|
+
return !!(Ae && e.hasChildNodes() && !Tn(e.firstElementChild) && Z(Ut, e.textContent) && Z(Ut, e.innerHTML) || Ae && e.namespaceURI === et && t === "style" && Tn(e.firstElementChild) || e.nodeType === qt.processingInstruction || Ae && e.nodeType === qt.comment && Z(Wt, e.data));
|
|
1833
1870
|
}, Dn = function _sanitizeDisallowedNode(e, t) {
|
|
1834
|
-
if (!
|
|
1835
|
-
if (
|
|
1871
|
+
if (!Se[t] && jn(t) && (G.tagNameCheck instanceof RegExp && Z(G.tagNameCheck, t) || G.tagNameCheck instanceof Function && G.tagNameCheck(t))) return !1;
|
|
1872
|
+
if (He && !Ge[t]) {
|
|
1836
1873
|
let t = v(e), n = _(e);
|
|
1837
1874
|
if (n && t) {
|
|
1838
1875
|
let r = n.length;
|
|
1839
1876
|
for (let i = r - 1; i >= 0; --i) {
|
|
1840
|
-
let r =
|
|
1877
|
+
let r = Ue ? n[i] : p(n[i], !0);
|
|
1841
1878
|
t.insertBefore(r, h(e));
|
|
1842
1879
|
}
|
|
1843
1880
|
}
|
|
1844
1881
|
}
|
|
1845
1882
|
return pn(e), !0;
|
|
1846
1883
|
}, On = function _sanitizeElements(e, t) {
|
|
1847
|
-
if (_executeHooks(
|
|
1884
|
+
if (_executeHooks(I.beforeSanitizeElements, e, null), e !== t && v(e) === null) return !0;
|
|
1848
1885
|
if (Cn(e)) return pn(e), !0;
|
|
1849
|
-
let n = Q(
|
|
1850
|
-
if (_executeHooks(
|
|
1886
|
+
let n = Q(C ? C(e) : e.nodeName);
|
|
1887
|
+
if (_executeHooks(I.uponSanitizeElement, e, {
|
|
1851
1888
|
tagName: n,
|
|
1852
|
-
allowedTags:
|
|
1889
|
+
allowedTags: U
|
|
1853
1890
|
}), e !== t && v(e) === null) return !0;
|
|
1854
1891
|
if (En(e, n)) return pn(e), !0;
|
|
1855
|
-
if (
|
|
1892
|
+
if (Se[n] || !(we.tagCheck instanceof Function && we.tagCheck(n)) && !U[n]) {
|
|
1856
1893
|
let t = Dn(e, n);
|
|
1857
|
-
return t === !1 && _executeHooks(
|
|
1894
|
+
return t === !1 && _executeHooks(I.afterSanitizeElements, e, null), t;
|
|
1858
1895
|
}
|
|
1859
|
-
if ((
|
|
1860
|
-
if (
|
|
1896
|
+
if ((S ? S(e) : e.nodeType) === qt.element && !fn(e) || (n === "noscript" || n === "noembed" || n === "noframes") && Z(Gt, e.innerHTML)) return pn(e), !0;
|
|
1897
|
+
if (ke && e.nodeType === qt.text) {
|
|
1861
1898
|
let t = xn(e.textContent);
|
|
1862
1899
|
e.textContent !== t && (st(DOMPurify.removed, { element: e.cloneNode() }), e.textContent = t);
|
|
1863
1900
|
}
|
|
1864
|
-
return _executeHooks(
|
|
1901
|
+
return _executeHooks(I.afterSanitizeElements, e, null), !1;
|
|
1865
1902
|
}, kn = function _isValidAttribute(e, n, r) {
|
|
1866
|
-
if (
|
|
1867
|
-
let i =
|
|
1868
|
-
if (!(
|
|
1903
|
+
if (Ce[n] || Ae && n === "patchsrc" || Ae && n === "for" && e !== "label" && e !== "output" || ze && (n === "id" || n === "name") && (r in t || r in rn)) return !1;
|
|
1904
|
+
let i = W[n] || we.attributeCheck instanceof Function && we.attributeCheck(n, e);
|
|
1905
|
+
if (!(Ee && Z(R, n)) && !(Te && Z(B, n))) {
|
|
1869
1906
|
if (!i) {
|
|
1870
|
-
if (!(jn(e) && (
|
|
1871
|
-
} else if (!
|
|
1907
|
+
if (!(jn(e) && (G.tagNameCheck instanceof RegExp && Z(G.tagNameCheck, e) || G.tagNameCheck instanceof Function && G.tagNameCheck(e)) && (G.attributeNameCheck instanceof RegExp && Z(G.attributeNameCheck, n) || G.attributeNameCheck instanceof Function && G.attributeNameCheck(n, e)) || n === "is" && G.allowCustomizedBuiltInElements && (G.tagNameCheck instanceof RegExp && Z(G.tagNameCheck, r) || G.tagNameCheck instanceof Function && G.tagNameCheck(r)))) return !1;
|
|
1908
|
+
} else if (!K[n] && !Z(ve, pt(r, _e, "")) && !((n === "src" || n === "xlink:href" || n === "href") && e !== "script" && mt(r, "data:") === 0 && qe[e]) && !(De && !Z(he, pt(r, _e, ""))) && r) return !1;
|
|
1872
1909
|
}
|
|
1873
1910
|
return !0;
|
|
1874
1911
|
}, An = addToSet({}, [
|
|
@@ -1881,11 +1918,11 @@ function createDOMPurify() {
|
|
|
1881
1918
|
"font-face-uri",
|
|
1882
1919
|
"missing-glyph"
|
|
1883
1920
|
]), jn = function _isBasicCustomElement(e) {
|
|
1884
|
-
return !An[ut(e)] && Z(
|
|
1921
|
+
return !An[ut(e)] && Z(H, e);
|
|
1885
1922
|
}, Mn = function _applyTrustedTypesToAttribute(e, t, n, r) {
|
|
1886
|
-
if (
|
|
1887
|
-
case "TrustedHTML": return
|
|
1888
|
-
case "TrustedScriptURL": return
|
|
1923
|
+
if (T && typeof u == "object" && typeof u.getAttributeType == "function" && !n) switch (u.getAttributeType(e, t)) {
|
|
1924
|
+
case "TrustedHTML": return j(r);
|
|
1925
|
+
case "TrustedScriptURL": return M(r);
|
|
1889
1926
|
}
|
|
1890
1927
|
return r;
|
|
1891
1928
|
}, Nn = function _setAttributeValue(e, t, n, r) {
|
|
@@ -1895,19 +1932,19 @@ function createDOMPurify() {
|
|
|
1895
1932
|
hn(t, e);
|
|
1896
1933
|
}
|
|
1897
1934
|
}, Pn = function _sanitizeAttributes(e) {
|
|
1898
|
-
_executeHooks(
|
|
1935
|
+
_executeHooks(I.beforeSanitizeAttributes, e, null);
|
|
1899
1936
|
let t = e.attributes;
|
|
1900
1937
|
if (!t || Cn(e)) return;
|
|
1901
1938
|
let n = {
|
|
1902
1939
|
attrName: "",
|
|
1903
1940
|
attrValue: "",
|
|
1904
1941
|
keepAttr: !0,
|
|
1905
|
-
allowedAttributes:
|
|
1942
|
+
allowedAttributes: W,
|
|
1906
1943
|
forceKeepAttr: void 0
|
|
1907
1944
|
}, r = t.length, i = Q(e.nodeName);
|
|
1908
1945
|
for (; r--;) {
|
|
1909
1946
|
let a = t[r], o = a.name, s = a.namespaceURI, c = a.value, u = Q(o), f = c, p = o === "value" ? f : ht(f);
|
|
1910
|
-
if (n.attrName = u, n.attrValue = p, n.keepAttr = !0, n.forceKeepAttr = void 0, _executeHooks(
|
|
1947
|
+
if (n.attrName = u, n.attrValue = p, n.keepAttr = !0, n.forceKeepAttr = void 0, _executeHooks(I.uponSanitizeAttribute, e, n), p = n.attrValue, Be && (u === "id" || u === "name") && mt(p, Ve) !== 0 && (hn(o, e), p = Ve + p), Ae && Z(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, p)) {
|
|
1911
1948
|
hn(o, e);
|
|
1912
1949
|
continue;
|
|
1913
1950
|
}
|
|
@@ -1920,25 +1957,25 @@ function createDOMPurify() {
|
|
|
1920
1957
|
hn(o, e);
|
|
1921
1958
|
continue;
|
|
1922
1959
|
}
|
|
1923
|
-
if (!
|
|
1960
|
+
if (!Oe && Z(Kt, p)) {
|
|
1924
1961
|
hn(o, e);
|
|
1925
1962
|
continue;
|
|
1926
1963
|
}
|
|
1927
|
-
if (
|
|
1964
|
+
if (ke && (p = xn(p)), !kn(i, u, p)) {
|
|
1928
1965
|
hn(o, e);
|
|
1929
1966
|
continue;
|
|
1930
1967
|
}
|
|
1931
1968
|
p = Mn(i, u, s, p), p !== f && Nn(e, o, s, p);
|
|
1932
1969
|
}
|
|
1933
1970
|
}
|
|
1934
|
-
_executeHooks(
|
|
1971
|
+
_executeHooks(I.afterSanitizeAttributes, e, null);
|
|
1935
1972
|
}, Fn = function _sanitizeShadowDOM(e) {
|
|
1936
1973
|
let t = null, n = bn(e);
|
|
1937
|
-
for (_executeHooks(
|
|
1938
|
-
let e =
|
|
1974
|
+
for (_executeHooks(I.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) if (_executeHooks(I.uponSanitizeShadowNode, t, null), On(t, e), Pn(t), wn(t.content) && Fn(t.content), (S ? S(t) : t.nodeType) === qt.element) {
|
|
1975
|
+
let e = b(t);
|
|
1939
1976
|
wn(e) && (In(e), Fn(e));
|
|
1940
1977
|
}
|
|
1941
|
-
_executeHooks(
|
|
1978
|
+
_executeHooks(I.afterSanitizeShadowDOM, e, null);
|
|
1942
1979
|
}, In = function _sanitizeAttachedShadowRoots(e) {
|
|
1943
1980
|
let t = [{
|
|
1944
1981
|
node: e,
|
|
@@ -1950,13 +1987,13 @@ function createDOMPurify() {
|
|
|
1950
1987
|
Fn(e.shadow);
|
|
1951
1988
|
continue;
|
|
1952
1989
|
}
|
|
1953
|
-
let n = e.node, r = (
|
|
1990
|
+
let n = e.node, r = (S ? S(n) : n.nodeType) === qt.element, i = _(n);
|
|
1954
1991
|
if (i) for (let e = i.length - 1; e >= 0; --e) t.push({
|
|
1955
1992
|
node: i[e],
|
|
1956
1993
|
shadow: null
|
|
1957
1994
|
});
|
|
1958
1995
|
if (r) {
|
|
1959
|
-
let e =
|
|
1996
|
+
let e = C ? C(n) : null;
|
|
1960
1997
|
if (typeof e == "string" && Q(e) === "template") {
|
|
1961
1998
|
let e = n.content;
|
|
1962
1999
|
wn(e) && t.push({
|
|
@@ -1966,7 +2003,7 @@ function createDOMPurify() {
|
|
|
1966
2003
|
}
|
|
1967
2004
|
}
|
|
1968
2005
|
if (r) {
|
|
1969
|
-
let e =
|
|
2006
|
+
let e = b(n);
|
|
1970
2007
|
wn(e) && t.push({
|
|
1971
2008
|
node: null,
|
|
1972
2009
|
shadow: e
|
|
@@ -1981,14 +2018,14 @@ function createDOMPurify() {
|
|
|
1981
2018
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = null, i = null, a = null, o = null;
|
|
1982
2019
|
if (nt = !e, nt && (e = "<!-->"), typeof e != "string" && !Tn(e) && (e = stringifyValue(e), typeof e != "string")) throw xt("dirty is not a string, aborting");
|
|
1983
2020
|
if (!DOMPurify.isSupported) return e;
|
|
1984
|
-
Me ? (
|
|
1985
|
-
let s =
|
|
2021
|
+
Me ? (U = Ne, W = Pe) : on(t), (I.uponSanitizeElement.length > 0 || I.uponSanitizeAttribute.length > 0) && (U = clone(U)), I.uponSanitizeAttribute.length > 0 && (W = clone(W)), DOMPurify.removed = [];
|
|
2022
|
+
let s = Ue && typeof e != "string" && Tn(e);
|
|
1986
2023
|
if (s) {
|
|
1987
2024
|
vn(e);
|
|
1988
|
-
let t =
|
|
2025
|
+
let t = C ? C(e) : e.nodeName;
|
|
1989
2026
|
if (typeof t == "string") {
|
|
1990
2027
|
let n = Q(t);
|
|
1991
|
-
if (!
|
|
2028
|
+
if (!U[n] || Se[n]) throw mn(e), xt("root node is forbidden and cannot be sanitized in-place");
|
|
1992
2029
|
}
|
|
1993
2030
|
if (Cn(e)) throw mn(e), xt("root node is clobbered and cannot be sanitized in-place");
|
|
1994
2031
|
try {
|
|
@@ -1998,8 +2035,8 @@ function createDOMPurify() {
|
|
|
1998
2035
|
}
|
|
1999
2036
|
} else if (Tn(e)) r = yn("<!---->"), i = r.ownerDocument.importNode(e, !0), i.nodeType === qt.element && i.nodeName === "BODY" || i.nodeName === "HTML" ? r = i : r.appendChild(i), In(i);
|
|
2000
2037
|
else {
|
|
2001
|
-
if (!Ie && !
|
|
2002
|
-
if (r = yn(e), !r) return Ie ? null : Re ?
|
|
2038
|
+
if (!Ie && !ke && !je && e.indexOf("<") === -1) return T && Re ? j(e) : e;
|
|
2039
|
+
if (r = yn(e), !r) return Ie ? null : Re ? k : "";
|
|
2003
2040
|
}
|
|
2004
2041
|
r && Fe && pn(r.firstChild);
|
|
2005
2042
|
let c = s ? e : r, u = bn(c);
|
|
@@ -2012,37 +2049,37 @@ function createDOMPurify() {
|
|
|
2012
2049
|
}
|
|
2013
2050
|
if (s) return rt(DOMPurify.removed, (e) => {
|
|
2014
2051
|
e.element && _n(e.element);
|
|
2015
|
-
}),
|
|
2052
|
+
}), ke && Sn(e), e;
|
|
2016
2053
|
if (Ie) {
|
|
2017
|
-
if (
|
|
2054
|
+
if (ke && Sn(r), Le) for (o = oe.call(r.ownerDocument); r.firstChild;) o.appendChild(r.firstChild);
|
|
2018
2055
|
else o = r;
|
|
2019
|
-
return (
|
|
2056
|
+
return (W.shadowroot || W.shadowrootmode) && (o = ce.call(n, o, !0)), o;
|
|
2020
2057
|
}
|
|
2021
2058
|
let f = je ? r.outerHTML : r.innerHTML;
|
|
2022
|
-
return je &&
|
|
2059
|
+
return je && U["!doctype"] && r.ownerDocument && r.ownerDocument.doctype && r.ownerDocument.doctype.name && Z(Vt, r.ownerDocument.doctype.name) && (f = "<!DOCTYPE " + r.ownerDocument.doctype.name + ">\n" + f), ke && (f = xn(f)), T && Re ? j(f) : f;
|
|
2023
2060
|
}, DOMPurify.setConfig = function() {
|
|
2024
2061
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2025
|
-
on(e), Me = !0, Ne =
|
|
2062
|
+
on(e), Me = !0, Ne = U, Pe = W;
|
|
2026
2063
|
}, DOMPurify.clearConfig = function() {
|
|
2027
|
-
nn = null, Me = !1, Ne = null, Pe = null,
|
|
2064
|
+
nn = null, Me = !1, Ne = null, Pe = null, T = te, k = "";
|
|
2028
2065
|
}, DOMPurify.isValidAttribute = function(e, t, n) {
|
|
2029
2066
|
nn || on({});
|
|
2030
2067
|
let r = Q(e), i = Q(t);
|
|
2031
2068
|
return kn(r, i, n);
|
|
2032
2069
|
}, DOMPurify.addHook = function(e, t) {
|
|
2033
|
-
typeof t == "function" && X(
|
|
2070
|
+
typeof t == "function" && X(I, e) && st(I[e], t);
|
|
2034
2071
|
}, DOMPurify.removeHook = function(e, t) {
|
|
2035
|
-
if (X(
|
|
2072
|
+
if (X(I, e)) {
|
|
2036
2073
|
if (t !== void 0) {
|
|
2037
|
-
let n = it(
|
|
2038
|
-
return n === -1 ? void 0 : ct(
|
|
2074
|
+
let n = it(I[e], t);
|
|
2075
|
+
return n === -1 ? void 0 : ct(I[e], n, 1)[0];
|
|
2039
2076
|
}
|
|
2040
|
-
return at(
|
|
2077
|
+
return at(I[e]);
|
|
2041
2078
|
}
|
|
2042
2079
|
}, DOMPurify.removeHooks = function(e) {
|
|
2043
|
-
X(
|
|
2080
|
+
X(I, e) && (I[e] = []);
|
|
2044
2081
|
}, DOMPurify.removeAllHooks = function() {
|
|
2045
|
-
|
|
2082
|
+
I = Xt();
|
|
2046
2083
|
}, DOMPurify;
|
|
2047
2084
|
}
|
|
2048
2085
|
var Qt = createDOMPurify(), _Class;
|
|
@@ -3472,7 +3509,7 @@ g.options = g.setOptions = function(e) {
|
|
|
3472
3509
|
}, g.parseInline = pr.parseInline, g.Parser = dr, g.parser = dr.parse, g.Renderer = y, g.TextRenderer = L, g.Lexer = ur, g.lexer = ur.lex, g.Tokenizer = w, g.Hooks = fr, g.parse = g, g.options, g.setOptions, g.use, g.walkTokens, g.parseInline, dr.parse, ur.lex;
|
|
3473
3510
|
//#endregion
|
|
3474
3511
|
//#region agent/ui/ChatCardBlock.vue?vue&type=script&setup=true&lang.ts
|
|
3475
|
-
var mr = ["aria-label"], hr = { class: "px-4 pb-2 pt-4" }, gr = ["innerHTML"], _r = ["onClick"], vr = /* @__PURE__ */
|
|
3512
|
+
var mr = ["aria-label"], hr = { class: "px-4 pb-2 pt-4" }, gr = ["innerHTML"], _r = ["onClick"], vr = /* @__PURE__ */ S({
|
|
3476
3513
|
__name: "ChatCardBlock",
|
|
3477
3514
|
props: {
|
|
3478
3515
|
spec: {},
|
|
@@ -3494,10 +3531,10 @@ var mr = ["aria-label"], hr = { class: "px-4 pb-2 pt-4" }, gr = ["innerHTML"], _
|
|
|
3494
3531
|
color: s.value
|
|
3495
3532
|
};
|
|
3496
3533
|
}
|
|
3497
|
-
return (t, n) => (
|
|
3534
|
+
return (t, n) => (A(), _("div", {
|
|
3498
3535
|
"data-test": "chat-card",
|
|
3499
3536
|
class: "my-6 w-full max-w-[55ch] self-start overflow-hidden rounded-2xl",
|
|
3500
|
-
style:
|
|
3537
|
+
style: k({
|
|
3501
3538
|
background: m.value,
|
|
3502
3539
|
boxShadow: u.value
|
|
3503
3540
|
}),
|
|
@@ -3505,26 +3542,26 @@ var mr = ["aria-label"], hr = { class: "px-4 pb-2 pt-4" }, gr = ["innerHTML"], _
|
|
|
3505
3542
|
}, [
|
|
3506
3543
|
v("div", hr, [v("div", {
|
|
3507
3544
|
class: "text-[14px] font-semibold leading-tight",
|
|
3508
|
-
style:
|
|
3509
|
-
},
|
|
3510
|
-
i.value ? (
|
|
3545
|
+
style: k({ color: s.value })
|
|
3546
|
+
}, F(e.spec.title), 5)]),
|
|
3547
|
+
i.value ? (A(), _("div", {
|
|
3511
3548
|
key: 0,
|
|
3512
3549
|
class: "chat-msg-prose px-4 pb-4 pt-2 text-[14px] leading-relaxed",
|
|
3513
|
-
style:
|
|
3550
|
+
style: k({ color: c.value }),
|
|
3514
3551
|
innerHTML: i.value
|
|
3515
3552
|
}, null, 12, gr)) : h("", !0),
|
|
3516
|
-
e.spec.actions?.length ? (
|
|
3553
|
+
e.spec.actions?.length ? (A(), _("div", {
|
|
3517
3554
|
key: 1,
|
|
3518
3555
|
class: "flex flex-wrap items-center gap-2 px-3 py-2.5",
|
|
3519
|
-
style:
|
|
3520
|
-
}, [(
|
|
3556
|
+
style: k({ borderTop: `1px solid ${o.value}` })
|
|
3557
|
+
}, [(A(!0), _(f, null, M(e.spec.actions, (e) => (A(), _("button", {
|
|
3521
3558
|
key: e.label,
|
|
3522
3559
|
type: "button",
|
|
3523
3560
|
"data-test": "chat-card-action",
|
|
3524
3561
|
class: "inline-flex h-10 items-center justify-center rounded-full px-5 text-[14px] font-semibold transition-colors duration-150 active:opacity-80",
|
|
3525
|
-
style:
|
|
3562
|
+
style: k(actionStyle(e.style)),
|
|
3526
3563
|
onClick: (t) => r("action", e.reply)
|
|
3527
|
-
},
|
|
3564
|
+
}, F(e.label), 13, _r))), 128))], 4)) : h("", !0)
|
|
3528
3565
|
], 12, mr));
|
|
3529
3566
|
}
|
|
3530
3567
|
}), yr = 112, br = 52, xr = 14, Sr = 54, Cr = 34, wr = 260;
|
|
@@ -3752,20 +3789,20 @@ var kr = [
|
|
|
3752
3789
|
], $r = ["points"], ei = ["width", "height"], ti = ["width", "height"], ni = {
|
|
3753
3790
|
xmlns: "http://www.w3.org/1999/xhtml",
|
|
3754
3791
|
class: "flex h-full min-w-0 flex-col items-center justify-center text-center"
|
|
3755
|
-
}, ri = /* @__PURE__ */
|
|
3792
|
+
}, ri = /* @__PURE__ */ S({
|
|
3756
3793
|
__name: "ChatVisualBlock",
|
|
3757
3794
|
props: {
|
|
3758
3795
|
result: {},
|
|
3759
3796
|
inverted: { type: Boolean }
|
|
3760
3797
|
},
|
|
3761
3798
|
setup(e) {
|
|
3762
|
-
let t = e, n =
|
|
3763
|
-
|
|
3799
|
+
let t = e, n = j(), r = ae(360), i;
|
|
3800
|
+
ne(() => {
|
|
3764
3801
|
typeof ResizeObserver > "u" || !n.value || (i = new ResizeObserver((e) => {
|
|
3765
3802
|
let t = e[0]?.contentRect.width;
|
|
3766
3803
|
t && (r.value = Math.round(t));
|
|
3767
3804
|
}), i.observe(n.value));
|
|
3768
|
-
}),
|
|
3805
|
+
}), te(() => i?.disconnect());
|
|
3769
3806
|
let a = p(() => Math.min(720, Math.max(280, r.value))), o = p(() => t.result.ok ? t.result.spec : null), s = p(() => o.value?.visualType === "chart" ? o.value : null), c = p(() => o.value?.visualType === "diagram" ? o.value : null);
|
|
3770
3807
|
function isCartesianChart(e) {
|
|
3771
3808
|
return e?.chartType === "bar" || e?.chartType === "line" || e?.chartType === "scatter";
|
|
@@ -3773,7 +3810,7 @@ var kr = [
|
|
|
3773
3810
|
function isPieChart(e) {
|
|
3774
3811
|
return e?.chartType === "pie";
|
|
3775
3812
|
}
|
|
3776
|
-
let u = p(() => s.value?.data ?? []), m = p(() => isCartesianChart(s.value) ? s.value : null),
|
|
3813
|
+
let u = p(() => s.value?.data ?? []), m = p(() => isCartesianChart(s.value) ? s.value : null), b = p(() => m.value?.series ?? []), x = p(() => isPieChart(s.value) ? s.value : null), S = p(() => m.value?.chartType === "bar" && m.value.stacking === "stacked");
|
|
3777
3814
|
function numericValue(e) {
|
|
3778
3815
|
return typeof e == "number" && Number.isFinite(e) ? e : null;
|
|
3779
3816
|
}
|
|
@@ -3805,7 +3842,7 @@ var kr = [
|
|
|
3805
3842
|
intercept: (r - s * n) / t
|
|
3806
3843
|
};
|
|
3807
3844
|
}
|
|
3808
|
-
let
|
|
3845
|
+
let C = p(() => {
|
|
3809
3846
|
let e = [], t = m.value;
|
|
3810
3847
|
if (!t) return e;
|
|
3811
3848
|
if (t.chartType === "bar" && t.stacking === "stacked") for (let n of t.data) {
|
|
@@ -3835,8 +3872,8 @@ var kr = [
|
|
|
3835
3872
|
let n = e > 0 ? e : 1, r = Math.floor(Math.log10(n)), i = n / 10 ** r, a;
|
|
3836
3873
|
return a = t ? i < 1.5 ? 1 : i < 3 ? 2 : i < 7 ? 5 : 10 : i <= 1 ? 1 : i <= 2 ? 2 : i <= 5 ? 5 : 10, a * 10 ** r;
|
|
3837
3874
|
}
|
|
3838
|
-
let
|
|
3839
|
-
let e =
|
|
3875
|
+
let T = p(() => {
|
|
3876
|
+
let e = C.value, t = e.length ? Math.max(0, ...e) : 1, n = e.length ? Math.min(0, ...e) : 0;
|
|
3840
3877
|
if (n === t) return {
|
|
3841
3878
|
min: 0,
|
|
3842
3879
|
max: t || 1,
|
|
@@ -3849,7 +3886,7 @@ var kr = [
|
|
|
3849
3886
|
max: a,
|
|
3850
3887
|
ticks: o
|
|
3851
3888
|
};
|
|
3852
|
-
}),
|
|
3889
|
+
}), re = p(() => resolveSharedSeriesFormat({ series: b.value })), ie = p(() => {
|
|
3853
3890
|
let e = m.value;
|
|
3854
3891
|
if (!e) return {
|
|
3855
3892
|
mode: "horizontal",
|
|
@@ -3860,8 +3897,8 @@ var kr = [
|
|
|
3860
3897
|
labels: e.data.map((e) => String(e?.[t] ?? "")),
|
|
3861
3898
|
plotWidth: Math.max(200, a.value - 42)
|
|
3862
3899
|
});
|
|
3863
|
-
}),
|
|
3864
|
-
let e =
|
|
3900
|
+
}), P = p(() => {
|
|
3901
|
+
let e = re.value?.valueFormat, t = !!(re.value && (e === "currency" || e === "percent" || re.value.valuePrefix || re.value.valueSuffix)), n = e === "duration" ? 46 : t ? 38 : 30, r = ie.value.mode === "angled";
|
|
3865
3902
|
return {
|
|
3866
3903
|
width: a.value,
|
|
3867
3904
|
height: 168 + (r ? 36 : 0),
|
|
@@ -3872,7 +3909,7 @@ var kr = [
|
|
|
3872
3909
|
};
|
|
3873
3910
|
});
|
|
3874
3911
|
function labelCenterX(e, t) {
|
|
3875
|
-
let n = m.value, r =
|
|
3912
|
+
let n = m.value, r = P.value;
|
|
3876
3913
|
if (n?.chartType === "bar") {
|
|
3877
3914
|
let n = r.width - r.left - r.right;
|
|
3878
3915
|
return r.left + (e + .5) * (n / Math.max(t, 1));
|
|
@@ -3880,11 +3917,11 @@ var kr = [
|
|
|
3880
3917
|
return xForIndex(e, t);
|
|
3881
3918
|
}
|
|
3882
3919
|
function xForIndex(e, t) {
|
|
3883
|
-
let n =
|
|
3920
|
+
let n = P.value, r = n.width - n.left - n.right;
|
|
3884
3921
|
return t <= 1 ? n.left + r / 2 : n.left + r * e / (t - 1);
|
|
3885
3922
|
}
|
|
3886
3923
|
function yForValue(e) {
|
|
3887
|
-
let { min: t, max: n } =
|
|
3924
|
+
let { min: t, max: n } = T.value, r = P.value, i = r.height - r.top - r.bottom;
|
|
3888
3925
|
return r.top + (n - e) / (n - t || 1) * i;
|
|
3889
3926
|
}
|
|
3890
3927
|
function pathForSeries(e) {
|
|
@@ -3894,7 +3931,7 @@ var kr = [
|
|
|
3894
3931
|
return `${r === 0 ? "M" : "L"} ${xForIndex(r, t.data.length).toFixed(1)} ${yForValue(i).toFixed(1)}`;
|
|
3895
3932
|
}).join(" ") : "";
|
|
3896
3933
|
}
|
|
3897
|
-
let
|
|
3934
|
+
let se = p(() => {
|
|
3898
3935
|
let e = m.value;
|
|
3899
3936
|
if (!e?.trendLine || e.chartType !== "line" && e.chartType !== "scatter") return null;
|
|
3900
3937
|
let t = trendLinePoints(e, e.trendLine.dataKey), n = linearTrend(t);
|
|
@@ -3905,11 +3942,11 @@ var kr = [
|
|
|
3905
3942
|
dataKey: e.trendLine.dataKey,
|
|
3906
3943
|
seriesIndex: s
|
|
3907
3944
|
};
|
|
3908
|
-
}),
|
|
3945
|
+
}), ce = p(() => {
|
|
3909
3946
|
let e = m.value;
|
|
3910
3947
|
if (!e || e.chartType !== "bar") return [];
|
|
3911
|
-
let t =
|
|
3912
|
-
if (
|
|
3948
|
+
let t = P.value, n = (t.width - t.left - t.right) / Math.max(e.data.length, 1), r = yForValue(0);
|
|
3949
|
+
if (S.value) {
|
|
3913
3950
|
let r = Math.max(4, Math.min(24, n * .42));
|
|
3914
3951
|
return e.data.flatMap((i, a) => {
|
|
3915
3952
|
let o = 0, s = 0, c = t.left + a * n + (n - r) / 2;
|
|
@@ -3942,12 +3979,12 @@ var kr = [
|
|
|
3942
3979
|
dataKey: e.dataKey
|
|
3943
3980
|
};
|
|
3944
3981
|
}));
|
|
3945
|
-
}),
|
|
3982
|
+
}), I = p(() => {
|
|
3946
3983
|
let e = m.value;
|
|
3947
3984
|
if (!e) return [];
|
|
3948
3985
|
let t = e.data;
|
|
3949
3986
|
if (!t.length) return [];
|
|
3950
|
-
let n = t.length - 1, r =
|
|
3987
|
+
let n = t.length - 1, r = ie.value, i = r.mode === "angled";
|
|
3951
3988
|
return r.entries.map(({ index: e, text: r }) => ({
|
|
3952
3989
|
key: `${e}`,
|
|
3953
3990
|
label: r,
|
|
@@ -3955,9 +3992,9 @@ var kr = [
|
|
|
3955
3992
|
anchor: i ? "end" : e === 0 ? "start" : e === n ? "end" : "middle",
|
|
3956
3993
|
angled: i
|
|
3957
3994
|
})).filter((e) => e.label);
|
|
3958
|
-
}),
|
|
3995
|
+
}), ue = p(() => {
|
|
3959
3996
|
let e = m.value;
|
|
3960
|
-
if (!e || e.chartType !== "bar" || e.series.length !== 1 ||
|
|
3997
|
+
if (!e || e.chartType !== "bar" || e.series.length !== 1 || S.value) return [];
|
|
3961
3998
|
let t = e.series[0], n = e.data.map((n, r) => {
|
|
3962
3999
|
let i = categoryLabel(n, e.xKey), a = numericValue(n[t.dataKey]);
|
|
3963
4000
|
return !i || a === null ? null : {
|
|
@@ -3978,7 +4015,7 @@ var kr = [
|
|
|
3978
4015
|
width: e.rawValue <= 0 ? 0 : Math.max(2, e.rawValue / r * 100),
|
|
3979
4016
|
seriesIndex: 0
|
|
3980
4017
|
}));
|
|
3981
|
-
}),
|
|
4018
|
+
}), de = p(() => {
|
|
3982
4019
|
let e = m.value;
|
|
3983
4020
|
if (!e?.data.length) return [];
|
|
3984
4021
|
let t = e.data[e.data.length - 1];
|
|
@@ -3994,7 +4031,7 @@ var kr = [
|
|
|
3994
4031
|
seriesIndex: n
|
|
3995
4032
|
};
|
|
3996
4033
|
});
|
|
3997
|
-
}),
|
|
4034
|
+
}), pe = p(() => {
|
|
3998
4035
|
let e = m.value;
|
|
3999
4036
|
if (!e?.data.length || e.chartType !== "line") return [];
|
|
4000
4037
|
let t = e.data.length - 1, n = e.data[t];
|
|
@@ -4007,8 +4044,8 @@ var kr = [
|
|
|
4007
4044
|
seriesIndex: i
|
|
4008
4045
|
};
|
|
4009
4046
|
}).filter((e) => e !== null);
|
|
4010
|
-
}),
|
|
4011
|
-
let e =
|
|
4047
|
+
}), R = p(() => {
|
|
4048
|
+
let e = x.value;
|
|
4012
4049
|
if (!e) return [];
|
|
4013
4050
|
let t = e.data.map((t) => ({
|
|
4014
4051
|
name: String(t[e.nameKey] ?? ""),
|
|
@@ -4023,104 +4060,104 @@ var kr = [
|
|
|
4023
4060
|
series: r
|
|
4024
4061
|
})
|
|
4025
4062
|
}));
|
|
4026
|
-
}),
|
|
4063
|
+
}), B = p(() => c.value ? layoutChatDiagram(c.value, { maxWidth: r.value }) : null), he = [
|
|
4027
4064
|
"var(--color-theme-900)",
|
|
4028
4065
|
"var(--color-primary-500)",
|
|
4029
4066
|
"color-mix(in oklch, var(--color-primary-500) 55%, var(--color-theme-500))"
|
|
4030
|
-
],
|
|
4067
|
+
], _e = [
|
|
4031
4068
|
"rgba(255, 255, 255, 0.92)",
|
|
4032
4069
|
"color-mix(in oklch, white 30%, var(--color-primary-500))",
|
|
4033
4070
|
"rgba(255, 255, 255, 0.55)"
|
|
4034
4071
|
];
|
|
4035
4072
|
function seriesColor(e) {
|
|
4036
|
-
let n = t.inverted ?
|
|
4073
|
+
let n = t.inverted ? _e : he;
|
|
4037
4074
|
return n[e % n.length];
|
|
4038
4075
|
}
|
|
4039
4076
|
function diagramNodeFill(e) {
|
|
4040
4077
|
return t.inverted ? e === "decision" ? "rgba(255, 255, 255, 0.1)" : "rgba(255, 255, 255, 0.06)" : e === "decision" ? "color-mix(in oklch, var(--color-primary-500) 9%, var(--color-theme-0))" : e === "output" ? "color-mix(in oklch, var(--color-theme-900) 5%, var(--color-theme-0))" : "var(--color-theme-0)";
|
|
4041
4078
|
}
|
|
4042
4079
|
function diagramNodeStroke(e) {
|
|
4043
|
-
return e === "decision" ? t.inverted ? "rgba(255, 255, 255, 0.26)" : "color-mix(in oklch, var(--color-primary-500) 32%, var(--color-theme-300))" :
|
|
4080
|
+
return e === "decision" ? t.inverted ? "rgba(255, 255, 255, 0.26)" : "color-mix(in oklch, var(--color-primary-500) 32%, var(--color-theme-300))" : be.value;
|
|
4044
4081
|
}
|
|
4045
|
-
let
|
|
4046
|
-
return (e, r) => o.value ? (
|
|
4082
|
+
let H = p(() => t.inverted ? "rgba(255, 255, 255, 0.95)" : "var(--color-theme-900)"), ve = p(() => t.inverted ? "rgba(255, 255, 255, 0.6)" : "var(--color-theme-500)"), U = p(() => t.inverted ? "rgba(255, 255, 255, 0.45)" : "color-mix(in oklch, var(--color-theme-900) 42%, transparent)"), ye = p(() => t.inverted ? "rgba(255, 255, 255, 0.1)" : "color-mix(in oklch, var(--color-theme-900) 8%, transparent)"), W = p(() => t.inverted ? "rgba(255, 255, 255, 0.24)" : "color-mix(in oklch, var(--color-theme-900) 18%, transparent)"), be = p(() => t.inverted ? "rgba(255, 255, 255, 0.16)" : "color-mix(in oklch, var(--color-theme-300) 55%, transparent)"), G = p(() => t.inverted ? "rgba(255, 255, 255, 0.14)" : "color-mix(in oklch, var(--color-theme-900) 10%, transparent)"), Se = p(() => t.inverted ? "transparent" : "var(--color-theme-0)"), Ce = p(() => t.inverted ? "rgba(255, 255, 255, 0.18)" : "color-mix(in oklch, var(--color-theme-900) 16%, transparent)"), we = p(() => t.inverted ? "rgba(255, 255, 255, 0.12)" : "color-mix(in oklch, var(--color-theme-900) 9%, transparent)");
|
|
4083
|
+
return (e, r) => o.value ? (A(), _("section", {
|
|
4047
4084
|
key: 0,
|
|
4048
4085
|
"data-test": "chat-visual",
|
|
4049
4086
|
"data-visual-type": o.value.visualType,
|
|
4050
4087
|
"data-chart-type": s.value?.chartType,
|
|
4051
|
-
"data-stacking":
|
|
4088
|
+
"data-stacking": S.value ? "stacked" : void 0,
|
|
4052
4089
|
"data-diagram-type": c.value?.diagramType,
|
|
4053
4090
|
class: "my-6 w-full rounded-[20px] px-4 pb-3.5 pt-4",
|
|
4054
|
-
style:
|
|
4055
|
-
background:
|
|
4056
|
-
boxShadow: `inset 0 0 0 1px ${
|
|
4091
|
+
style: k({
|
|
4092
|
+
background: Se.value,
|
|
4093
|
+
boxShadow: `inset 0 0 0 1px ${G.value}`
|
|
4057
4094
|
}),
|
|
4058
4095
|
"aria-label": o.value.meta.title
|
|
4059
4096
|
}, [
|
|
4060
4097
|
v("header", Ar, [v("h4", {
|
|
4061
4098
|
class: "text-[13px] font-semibold leading-tight",
|
|
4062
|
-
style:
|
|
4063
|
-
},
|
|
4099
|
+
style: k({ color: H.value })
|
|
4100
|
+
}, F(o.value.meta.title), 5), o.value.meta.description ? (A(), _("p", {
|
|
4064
4101
|
key: 0,
|
|
4065
4102
|
class: "mt-0.5 text-[12px] leading-snug",
|
|
4066
|
-
style:
|
|
4067
|
-
},
|
|
4103
|
+
style: k({ color: ve.value })
|
|
4104
|
+
}, F(o.value.meta.description), 5)) : h("", !0)]),
|
|
4068
4105
|
v("div", {
|
|
4069
4106
|
ref_key: "bodyEl",
|
|
4070
4107
|
ref: n
|
|
4071
|
-
}, [m.value ? (
|
|
4108
|
+
}, [m.value ? (A(), _("div", {
|
|
4072
4109
|
key: 0,
|
|
4073
4110
|
role: "img",
|
|
4074
4111
|
"aria-label": o.value.meta.title
|
|
4075
|
-
}, [
|
|
4112
|
+
}, [ue.value.length ? (A(), _("div", Mr, [(A(!0), _(f, null, M(ue.value, (e) => (A(), _("div", {
|
|
4076
4113
|
key: e.key,
|
|
4077
4114
|
"data-test": "chat-visual-horizontal-bar",
|
|
4078
4115
|
class: "min-w-0"
|
|
4079
4116
|
}, [v("div", Nr, [v("span", {
|
|
4080
4117
|
class: "line-clamp-2 min-w-0 font-medium leading-snug",
|
|
4081
|
-
style:
|
|
4082
|
-
},
|
|
4118
|
+
style: k({ color: H.value })
|
|
4119
|
+
}, F(e.label), 5), v("span", {
|
|
4083
4120
|
class: "shrink-0 font-semibold tabular-nums",
|
|
4084
|
-
style:
|
|
4085
|
-
},
|
|
4121
|
+
style: k({ color: H.value })
|
|
4122
|
+
}, F(e.value), 5)]), v("div", {
|
|
4086
4123
|
class: "h-2 w-full overflow-hidden rounded-full",
|
|
4087
|
-
style:
|
|
4124
|
+
style: k({ background: we.value })
|
|
4088
4125
|
}, [v("div", {
|
|
4089
4126
|
class: "h-full rounded-full",
|
|
4090
|
-
style:
|
|
4127
|
+
style: k({
|
|
4091
4128
|
width: `${e.width}%`,
|
|
4092
4129
|
background: seriesColor(e.seriesIndex)
|
|
4093
4130
|
})
|
|
4094
|
-
}, null, 4)], 4)]))), 128))])) : (
|
|
4131
|
+
}, null, 4)], 4)]))), 128))])) : (A(), _("svg", {
|
|
4095
4132
|
key: 1,
|
|
4096
4133
|
class: "block h-auto w-full overflow-visible",
|
|
4097
|
-
viewBox: `0 0 ${
|
|
4098
|
-
style:
|
|
4134
|
+
viewBox: `0 0 ${P.value.width} ${P.value.height}`,
|
|
4135
|
+
style: k({ aspectRatio: `${P.value.width} / ${P.value.height}` }),
|
|
4099
4136
|
preserveAspectRatio: "xMidYMid meet",
|
|
4100
4137
|
"aria-hidden": "true"
|
|
4101
4138
|
}, [
|
|
4102
|
-
(
|
|
4139
|
+
(A(!0), _(f, null, M(T.value.ticks, (e) => (A(), _("line", {
|
|
4103
4140
|
key: `grid-${e}`,
|
|
4104
|
-
x1:
|
|
4105
|
-
x2:
|
|
4141
|
+
x1: P.value.left,
|
|
4142
|
+
x2: P.value.width - P.value.right,
|
|
4106
4143
|
y1: yForValue(e),
|
|
4107
4144
|
y2: yForValue(e),
|
|
4108
4145
|
"stroke-width": "1",
|
|
4109
4146
|
"vector-effect": "non-scaling-stroke",
|
|
4110
|
-
style:
|
|
4147
|
+
style: k({ stroke: e === 0 ? W.value : ye.value })
|
|
4111
4148
|
}, null, 12, Fr))), 128)),
|
|
4112
|
-
v("g", null, [(
|
|
4149
|
+
v("g", null, [(A(!0), _(f, null, M(T.value.ticks, (e) => (A(), _("text", {
|
|
4113
4150
|
key: `y-${e}`,
|
|
4114
|
-
x:
|
|
4151
|
+
x: P.value.left - 7,
|
|
4115
4152
|
y: yForValue(e) + 3,
|
|
4116
4153
|
"text-anchor": "end",
|
|
4117
4154
|
"font-size": "9.5",
|
|
4118
|
-
style:
|
|
4119
|
-
},
|
|
4155
|
+
style: k({ fill: U.value })
|
|
4156
|
+
}, F(oe(formatChatVisualTick)({
|
|
4120
4157
|
value: e,
|
|
4121
|
-
shared:
|
|
4158
|
+
shared: re.value
|
|
4122
4159
|
})), 13, Ir))), 128))]),
|
|
4123
|
-
m.value.chartType === "bar" ? (
|
|
4160
|
+
m.value.chartType === "bar" ? (A(!0), _(f, { key: 0 }, M(ce.value, (e) => (A(), _("rect", {
|
|
4124
4161
|
key: e.key,
|
|
4125
4162
|
"data-test": "chat-visual-bar",
|
|
4126
4163
|
"data-row-index": e.rowIndex,
|
|
@@ -4131,22 +4168,22 @@ var kr = [
|
|
|
4131
4168
|
width: e.width,
|
|
4132
4169
|
height: e.height,
|
|
4133
4170
|
rx: "2.5",
|
|
4134
|
-
style:
|
|
4135
|
-
}, null, 12, Lr))), 128)) : (
|
|
4136
|
-
|
|
4171
|
+
style: k({ fill: seriesColor(e.seriesIndex) })
|
|
4172
|
+
}, null, 12, Lr))), 128)) : (A(), _(f, { key: 1 }, [
|
|
4173
|
+
se.value ? (A(), _("path", {
|
|
4137
4174
|
key: 0,
|
|
4138
4175
|
"data-test": "chat-visual-trend-line",
|
|
4139
|
-
"data-trend-key":
|
|
4140
|
-
d:
|
|
4176
|
+
"data-trend-key": se.value.dataKey,
|
|
4177
|
+
d: se.value.path,
|
|
4141
4178
|
fill: "none",
|
|
4142
4179
|
"stroke-width": "1.4",
|
|
4143
4180
|
"stroke-linecap": "round",
|
|
4144
4181
|
"stroke-linejoin": "round",
|
|
4145
4182
|
"stroke-dasharray": "4 3",
|
|
4146
4183
|
"vector-effect": "non-scaling-stroke",
|
|
4147
|
-
style:
|
|
4184
|
+
style: k({ stroke: seriesColor(se.value.seriesIndex) })
|
|
4148
4185
|
}, null, 12, Rr)) : h("", !0),
|
|
4149
|
-
(
|
|
4186
|
+
(A(!0), _(f, null, M(b.value, (e, t) => (A(), _("g", { key: e.dataKey }, [m.value.chartType === "line" ? (A(), _("path", {
|
|
4150
4187
|
key: 0,
|
|
4151
4188
|
d: pathForSeries(e.dataKey),
|
|
4152
4189
|
fill: "none",
|
|
@@ -4154,74 +4191,74 @@ var kr = [
|
|
|
4154
4191
|
"stroke-linecap": "round",
|
|
4155
4192
|
"stroke-linejoin": "round",
|
|
4156
4193
|
"vector-effect": "non-scaling-stroke",
|
|
4157
|
-
style:
|
|
4158
|
-
}, null, 12, zr)) : h("", !0), (
|
|
4194
|
+
style: k({ stroke: seriesColor(t) })
|
|
4195
|
+
}, null, 12, zr)) : h("", !0), (A(!0), _(f, null, M(u.value, (n, r) => (A(), _(f, { key: `${e.dataKey}-${r}` }, [m.value.chartType === "scatter" ? (A(), _("circle", {
|
|
4159
4196
|
key: 0,
|
|
4160
4197
|
cx: xForIndex(r, u.value.length),
|
|
4161
4198
|
cy: yForValue(numericValue(n[e.dataKey]) ?? 0),
|
|
4162
4199
|
r: "2.6",
|
|
4163
|
-
style:
|
|
4200
|
+
style: k({ fill: seriesColor(t) })
|
|
4164
4201
|
}, null, 12, Br)) : h("", !0)], 64))), 128))]))), 128)),
|
|
4165
|
-
(
|
|
4202
|
+
(A(!0), _(f, null, M(pe.value, (e) => (A(), _("circle", {
|
|
4166
4203
|
key: `marker-${e.key}`,
|
|
4167
4204
|
cx: e.cx,
|
|
4168
4205
|
cy: e.cy,
|
|
4169
4206
|
r: "3",
|
|
4170
|
-
style:
|
|
4207
|
+
style: k({ fill: seriesColor(e.seriesIndex) })
|
|
4171
4208
|
}, null, 12, Vr))), 128))
|
|
4172
4209
|
], 64)),
|
|
4173
|
-
(
|
|
4210
|
+
(A(!0), _(f, null, M(I.value, (e) => (A(), _("text", {
|
|
4174
4211
|
key: e.key,
|
|
4175
4212
|
x: e.x,
|
|
4176
|
-
y: e.angled ?
|
|
4213
|
+
y: e.angled ? P.value.height - P.value.bottom + 12 : P.value.height - 6,
|
|
4177
4214
|
"text-anchor": e.anchor,
|
|
4178
4215
|
"font-size": "9.5",
|
|
4179
|
-
transform: e.angled ? `rotate(${
|
|
4180
|
-
style:
|
|
4181
|
-
},
|
|
4182
|
-
], 12, Pr)),
|
|
4216
|
+
transform: e.angled ? `rotate(${oe(-40)} ${e.x} ${P.value.height - P.value.bottom + 12})` : void 0,
|
|
4217
|
+
style: k({ fill: U.value })
|
|
4218
|
+
}, F(e.label), 13, Hr))), 128))
|
|
4219
|
+
], 12, Pr)), de.value.length > 1 || m.value.chartType !== "bar" ? (A(), _("div", Ur, [(A(!0), _(f, null, M(de.value, (e) => (A(), _("div", {
|
|
4183
4220
|
key: e.key,
|
|
4184
4221
|
class: "inline-flex items-center gap-1.5 text-[11.5px] leading-none"
|
|
4185
4222
|
}, [
|
|
4186
4223
|
v("span", {
|
|
4187
4224
|
class: "size-2.5 shrink-0 rounded-full",
|
|
4188
|
-
style:
|
|
4225
|
+
style: k({ background: seriesColor(e.seriesIndex) })
|
|
4189
4226
|
}, null, 4),
|
|
4190
|
-
v("span", { style:
|
|
4227
|
+
v("span", { style: k({ color: ve.value }) }, F(e.label), 5),
|
|
4191
4228
|
v("span", {
|
|
4192
4229
|
class: "font-semibold tabular-nums",
|
|
4193
|
-
style:
|
|
4194
|
-
},
|
|
4195
|
-
]))), 128))])) : h("", !0)], 8, jr)) :
|
|
4230
|
+
style: k({ color: H.value })
|
|
4231
|
+
}, F(e.value), 5)
|
|
4232
|
+
]))), 128))])) : h("", !0)], 8, jr)) : x.value ? (A(), _("div", Wr, [(A(!0), _(f, null, M(R.value, (e, t) => (A(), _("div", { key: e.key }, [v("div", Gr, [v("span", {
|
|
4196
4233
|
class: "truncate font-medium",
|
|
4197
|
-
style:
|
|
4198
|
-
},
|
|
4234
|
+
style: k({ color: H.value })
|
|
4235
|
+
}, F(e.name), 5), v("span", Kr, [v("span", {
|
|
4199
4236
|
class: "font-semibold",
|
|
4200
|
-
style:
|
|
4201
|
-
},
|
|
4237
|
+
style: k({ color: H.value })
|
|
4238
|
+
}, F(e.display), 5), v("span", {
|
|
4202
4239
|
class: "ml-1.5",
|
|
4203
|
-
style:
|
|
4204
|
-
},
|
|
4240
|
+
style: k({ color: ve.value })
|
|
4241
|
+
}, F(Math.round(e.percent * 100)) + "%", 5)])]), v("div", {
|
|
4205
4242
|
class: "h-1.5 w-full overflow-hidden rounded-full",
|
|
4206
|
-
style:
|
|
4243
|
+
style: k({ background: we.value })
|
|
4207
4244
|
}, [v("div", {
|
|
4208
4245
|
class: "h-full rounded-full",
|
|
4209
|
-
style:
|
|
4246
|
+
style: k({
|
|
4210
4247
|
width: `${Math.max(2, e.percent * 100)}%`,
|
|
4211
4248
|
background: seriesColor(t)
|
|
4212
4249
|
})
|
|
4213
|
-
}, null, 4)], 4)]))), 128))])) : c.value &&
|
|
4250
|
+
}, null, 4)], 4)]))), 128))])) : c.value && B.value ? (A(), _("div", qr, [(A(), _("svg", {
|
|
4214
4251
|
"data-test": "chat-visual-diagram-svg",
|
|
4215
4252
|
class: "block h-auto overflow-visible",
|
|
4216
|
-
viewBox: `0 0 ${
|
|
4217
|
-
style:
|
|
4218
|
-
width: `${
|
|
4219
|
-
aspectRatio: `${
|
|
4253
|
+
viewBox: `0 0 ${B.value.width} ${B.value.height}`,
|
|
4254
|
+
style: k({
|
|
4255
|
+
width: `${B.value.width}px`,
|
|
4256
|
+
aspectRatio: `${B.value.width} / ${B.value.height}`
|
|
4220
4257
|
}),
|
|
4221
4258
|
role: "img",
|
|
4222
4259
|
"aria-label": o.value.meta.title
|
|
4223
4260
|
}, [
|
|
4224
|
-
(
|
|
4261
|
+
(A(!0), _(f, null, M(B.value.edges, (e) => (A(), _("line", {
|
|
4225
4262
|
key: e.key,
|
|
4226
4263
|
"data-test": "chat-visual-diagram-edge",
|
|
4227
4264
|
"data-from": e.from,
|
|
@@ -4233,16 +4270,16 @@ var kr = [
|
|
|
4233
4270
|
"stroke-width": "1.4",
|
|
4234
4271
|
"stroke-linecap": "round",
|
|
4235
4272
|
"vector-effect": "non-scaling-stroke",
|
|
4236
|
-
style:
|
|
4273
|
+
style: k({ stroke: Ce.value })
|
|
4237
4274
|
}, null, 12, Yr))), 128)),
|
|
4238
|
-
(
|
|
4275
|
+
(A(!0), _(f, null, M(B.value.edges, (e) => (A(), _("circle", {
|
|
4239
4276
|
key: `${e.key}-dot`,
|
|
4240
4277
|
cx: e.x2,
|
|
4241
4278
|
cy: e.y2,
|
|
4242
4279
|
r: "2.4",
|
|
4243
|
-
style:
|
|
4280
|
+
style: k({ fill: Ce.value })
|
|
4244
4281
|
}, null, 12, Xr))), 128)),
|
|
4245
|
-
(
|
|
4282
|
+
(A(!0), _(f, null, M(B.value.edges.filter((e) => e.label), (e) => (A(), _("foreignObject", {
|
|
4246
4283
|
key: `${e.key}-label`,
|
|
4247
4284
|
x: e.labelX - 55,
|
|
4248
4285
|
y: e.labelY - 12,
|
|
@@ -4251,59 +4288,59 @@ var kr = [
|
|
|
4251
4288
|
}, [v("div", {
|
|
4252
4289
|
xmlns: "http://www.w3.org/1999/xhtml",
|
|
4253
4290
|
class: "flex h-full items-center justify-center px-1 text-center text-[10.5px] font-medium leading-none",
|
|
4254
|
-
style:
|
|
4255
|
-
color:
|
|
4291
|
+
style: k({
|
|
4292
|
+
color: ve.value,
|
|
4256
4293
|
background: t.inverted ? "var(--color-theme-900)" : "var(--color-theme-0)"
|
|
4257
4294
|
})
|
|
4258
|
-
},
|
|
4259
|
-
(
|
|
4295
|
+
}, F(e.label), 5)], 8, Zr))), 128)),
|
|
4296
|
+
(A(!0), _(f, null, M(B.value.nodes, (e) => (A(), _("g", {
|
|
4260
4297
|
key: e.id,
|
|
4261
4298
|
"data-test": "chat-visual-diagram-node",
|
|
4262
4299
|
"data-node-id": e.id,
|
|
4263
4300
|
"data-node-kind": e.kind,
|
|
4264
4301
|
transform: `translate(${e.x} ${e.y})`
|
|
4265
|
-
}, [e.kind === "decision" ? (
|
|
4302
|
+
}, [e.kind === "decision" ? (A(), _("polygon", {
|
|
4266
4303
|
key: 0,
|
|
4267
4304
|
points: `${e.width / 2},0 ${e.width},${e.height / 2} ${e.width / 2},${e.height} 0,${e.height / 2}`,
|
|
4268
4305
|
"stroke-width": "1",
|
|
4269
4306
|
"vector-effect": "non-scaling-stroke",
|
|
4270
|
-
style:
|
|
4307
|
+
style: k({
|
|
4271
4308
|
fill: diagramNodeFill(e.kind),
|
|
4272
4309
|
stroke: diagramNodeStroke(e.kind)
|
|
4273
4310
|
})
|
|
4274
|
-
}, null, 12, $r)) : (
|
|
4311
|
+
}, null, 12, $r)) : (A(), _("rect", {
|
|
4275
4312
|
key: 1,
|
|
4276
4313
|
width: e.width,
|
|
4277
4314
|
height: e.height,
|
|
4278
4315
|
rx: "12",
|
|
4279
4316
|
"stroke-width": "1",
|
|
4280
4317
|
"vector-effect": "non-scaling-stroke",
|
|
4281
|
-
style:
|
|
4318
|
+
style: k({
|
|
4282
4319
|
fill: diagramNodeFill(e.kind),
|
|
4283
4320
|
stroke: diagramNodeStroke(e.kind)
|
|
4284
4321
|
})
|
|
4285
|
-
}, null, 12, ei)), (
|
|
4322
|
+
}, null, 12, ei)), (A(), _("foreignObject", {
|
|
4286
4323
|
x: "8",
|
|
4287
4324
|
y: "5",
|
|
4288
4325
|
width: e.width - 16,
|
|
4289
4326
|
height: e.height - 10
|
|
4290
4327
|
}, [v("div", ni, [v("div", {
|
|
4291
4328
|
class: "line-clamp-2 text-[13px] font-semibold leading-tight",
|
|
4292
|
-
style:
|
|
4293
|
-
},
|
|
4329
|
+
style: k({ color: H.value })
|
|
4330
|
+
}, F(e.label), 5), e.detail ? (A(), _("div", {
|
|
4294
4331
|
key: 0,
|
|
4295
4332
|
class: "mt-0.5 line-clamp-1 text-[10.5px] leading-none",
|
|
4296
|
-
style:
|
|
4297
|
-
},
|
|
4333
|
+
style: k({ color: ve.value })
|
|
4334
|
+
}, F(e.detail), 5)) : h("", !0)])], 8, ti))], 8, Qr))), 128))
|
|
4298
4335
|
], 12, Jr))])) : h("", !0)], 512),
|
|
4299
|
-
o.value.meta.footer ? (
|
|
4336
|
+
o.value.meta.footer ? (A(), _("footer", {
|
|
4300
4337
|
key: 0,
|
|
4301
4338
|
class: "mt-3 text-[11px] leading-snug",
|
|
4302
|
-
style:
|
|
4303
|
-
},
|
|
4339
|
+
style: k({ color: U.value })
|
|
4340
|
+
}, F(o.value.meta.footer), 5)) : h("", !0)
|
|
4304
4341
|
], 12, kr)) : h("", !0);
|
|
4305
4342
|
}
|
|
4306
|
-
}), ii = ["innerHTML"], ai = /* @__PURE__ */
|
|
4343
|
+
}), ii = ["innerHTML"], ai = /* @__PURE__ */ S({
|
|
4307
4344
|
__name: "ChatRichText",
|
|
4308
4345
|
props: {
|
|
4309
4346
|
text: {},
|
|
@@ -4312,8 +4349,8 @@ var kr = [
|
|
|
4312
4349
|
},
|
|
4313
4350
|
emits: ["action"],
|
|
4314
4351
|
setup(e, { emit: t }) {
|
|
4315
|
-
let n = e, r = t, i =
|
|
4316
|
-
|
|
4352
|
+
let n = e, r = t, i = ae(n.text), a;
|
|
4353
|
+
ce([() => n.text, () => n.streaming], ([e, t]) => {
|
|
4317
4354
|
if (!t) {
|
|
4318
4355
|
a !== void 0 && (cancelAnimationFrame(a), a = void 0), i.value = e;
|
|
4319
4356
|
return;
|
|
@@ -4321,7 +4358,7 @@ var kr = [
|
|
|
4321
4358
|
a === void 0 && (a = requestAnimationFrame(() => {
|
|
4322
4359
|
a = void 0, i.value = n.text;
|
|
4323
4360
|
}));
|
|
4324
|
-
}),
|
|
4361
|
+
}), te(() => {
|
|
4325
4362
|
a !== void 0 && cancelAnimationFrame(a);
|
|
4326
4363
|
});
|
|
4327
4364
|
let o = new g.Renderer();
|
|
@@ -4474,28 +4511,28 @@ var kr = [
|
|
|
4474
4511
|
streaming: !!n.streaming
|
|
4475
4512
|
}) : [];
|
|
4476
4513
|
});
|
|
4477
|
-
return (t, n) => (
|
|
4514
|
+
return (t, n) => (A(), _("div", {
|
|
4478
4515
|
class: "chat-msg-rich break-words text-[14px] leading-relaxed @sm/chat:max-w-[65ch] @sm/chat:text-[16px] @sm/chat:leading-relaxed",
|
|
4479
4516
|
onErrorCapture: onRichTextAssetError
|
|
4480
|
-
}, [(
|
|
4517
|
+
}, [(A(!0), _(f, null, M(h.value, (t) => (A(), _(f, { key: t.key }, [t.kind === "markdown" ? (A(), _("div", {
|
|
4481
4518
|
key: 0,
|
|
4482
|
-
class:
|
|
4519
|
+
class: T(["chat-msg-prose", e.inverted ? "chat-msg-prose-invert" : ""]),
|
|
4483
4520
|
innerHTML: t.html
|
|
4484
|
-
}, null, 10, ii)) : t.kind === "visual" ? (
|
|
4521
|
+
}, null, 10, ii)) : t.kind === "visual" ? (A(), m(ri, {
|
|
4485
4522
|
key: 1,
|
|
4486
4523
|
result: t.result,
|
|
4487
4524
|
inverted: e.inverted
|
|
4488
|
-
}, null, 8, ["result", "inverted"])) : t.kind === "card" ? (
|
|
4525
|
+
}, null, 8, ["result", "inverted"])) : t.kind === "card" ? (A(), m(vr, {
|
|
4489
4526
|
key: 2,
|
|
4490
4527
|
spec: t.spec,
|
|
4491
4528
|
inverted: e.inverted,
|
|
4492
4529
|
onAction: n[0] || (n[0] = (e) => r("action", e))
|
|
4493
|
-
}, null, 8, ["spec", "inverted"])) : (
|
|
4530
|
+
}, null, 8, ["spec", "inverted"])) : (A(), _("div", {
|
|
4494
4531
|
key: 3,
|
|
4495
4532
|
"data-test": "chat-visual-pending",
|
|
4496
4533
|
role: "status",
|
|
4497
4534
|
class: "my-6 flex items-center gap-2.5 rounded-[20px] px-4 py-5 text-[12px] font-medium",
|
|
4498
|
-
style:
|
|
4535
|
+
style: k({
|
|
4499
4536
|
background: e.inverted ? "transparent" : "var(--color-theme-0)",
|
|
4500
4537
|
boxShadow: `inset 0 0 0 1px ${e.inverted ? "rgba(255, 255, 255, 0.14)" : "color-mix(in oklch, var(--color-theme-900) 8%, transparent)"}`,
|
|
4501
4538
|
color: e.inverted ? "rgba(255, 255, 255, 0.6)" : "var(--color-theme-500)"
|
|
@@ -4503,12 +4540,12 @@ var kr = [
|
|
|
4503
4540
|
}, [...n[1] || (n[1] = [v("span", {
|
|
4504
4541
|
class: "size-2 shrink-0 animate-pulse rounded-full",
|
|
4505
4542
|
style: { background: "currentcolor" }
|
|
4506
|
-
}, null, -1),
|
|
4543
|
+
}, null, -1), b(" Preparing chart… ", -1)])], 4))], 64))), 128))], 32));
|
|
4507
4544
|
}
|
|
4508
|
-
}), oi = 80, si = 600, ci = /* @__PURE__ */
|
|
4545
|
+
}), oi = 80, si = 600, ci = /* @__PURE__ */ S({
|
|
4509
4546
|
__name: "ChatScroller",
|
|
4510
4547
|
setup(e, { expose: t }) {
|
|
4511
|
-
let n =
|
|
4548
|
+
let n = j(), r = j(), i = j(!0), a, o = 0;
|
|
4512
4549
|
function scrollToBottom() {
|
|
4513
4550
|
let e = n.value;
|
|
4514
4551
|
e && (e.scrollTop = e.scrollHeight);
|
|
@@ -4523,18 +4560,18 @@ var kr = [
|
|
|
4523
4560
|
function pin() {
|
|
4524
4561
|
i.value = !0, scrollToBottom();
|
|
4525
4562
|
}
|
|
4526
|
-
return t({ pin }),
|
|
4563
|
+
return t({ pin }), ne(() => {
|
|
4527
4564
|
requestAnimationFrame(() => {
|
|
4528
4565
|
scrollToBottom(), requestAnimationFrame(scrollToBottom);
|
|
4529
4566
|
}), r.value && (a = new ResizeObserver(() => {
|
|
4530
4567
|
i.value && Date.now() > o && scrollToBottom();
|
|
4531
4568
|
}), a.observe(r.value), n.value && a.observe(n.value));
|
|
4532
|
-
}),
|
|
4569
|
+
}), te(() => {
|
|
4533
4570
|
a?.disconnect();
|
|
4534
|
-
}), (e, t) => (
|
|
4571
|
+
}), (e, t) => (A(), _("div", {
|
|
4535
4572
|
ref_key: "viewport",
|
|
4536
4573
|
ref: n,
|
|
4537
|
-
class:
|
|
4574
|
+
class: T(["overflow-y-auto overscroll-contain overflow-x-hidden min-h-0 flex flex-col [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden", i.value ? "[overflow-anchor:none]" : ""]),
|
|
4538
4575
|
onScrollPassive: onScroll,
|
|
4539
4576
|
onWheelPassive: markUserGesture,
|
|
4540
4577
|
onTouchstartPassive: markUserGesture
|
|
@@ -4542,26 +4579,125 @@ var kr = [
|
|
|
4542
4579
|
ref_key: "content",
|
|
4543
4580
|
ref: r,
|
|
4544
4581
|
class: "flex-1 flex flex-col"
|
|
4545
|
-
}, [
|
|
4582
|
+
}, [ie(e.$slots, "default")], 512)], 34));
|
|
4583
|
+
}
|
|
4584
|
+
}), li = ["data-voice-state", "data-voice-activity"], ui = { class: "flex flex-1 flex-col items-center justify-center pb-8" }, di = { "data-voice-assistant-avatar": "" }, fi = {
|
|
4585
|
+
"data-test": "voice-histogram",
|
|
4586
|
+
"aria-hidden": "true",
|
|
4587
|
+
class: "mt-10 flex h-4 items-center gap-[3px]"
|
|
4588
|
+
}, pi = {
|
|
4589
|
+
"data-test": "voice-presence-status",
|
|
4590
|
+
role: "status",
|
|
4591
|
+
"aria-live": "polite",
|
|
4592
|
+
class: "sr-only"
|
|
4593
|
+
}, mi = .1, hi = 60, gi = 320, _i = /* @__PURE__ */ S({
|
|
4594
|
+
__name: "VoiceMode",
|
|
4595
|
+
props: {
|
|
4596
|
+
agent: {},
|
|
4597
|
+
chatController: {},
|
|
4598
|
+
isLight: {
|
|
4599
|
+
type: Boolean,
|
|
4600
|
+
default: !0
|
|
4601
|
+
}
|
|
4602
|
+
},
|
|
4603
|
+
emits: ["end"],
|
|
4604
|
+
setup(e, { emit: t }) {
|
|
4605
|
+
let n = t, r = j(0), i = j("mic"), a = j("idle"), o = j(!1), s = ae(), c = !1, u, m = p(() => o.value ? "error" : a.value === "live" ? i.value === "playback" && r.value > .01 ? "speaking" : "listening" : "connecting"), h = [
|
|
4606
|
+
0,
|
|
4607
|
+
2,
|
|
4608
|
+
4,
|
|
4609
|
+
6,
|
|
4610
|
+
8
|
|
4611
|
+
], b = h.map(() => 0), S = j(b), C = j(b), te = typeof window < "u" && typeof window.matchMedia == "function" ? window.matchMedia("(prefers-reduced-motion: reduce)") : void 0, ie = typeof window < "u" && typeof window.requestAnimationFrame == "function" ? (e) => window.requestAnimationFrame(e) : (e) => setTimeout(() => e(performance.now()), 16), P = 0, oe = 0;
|
|
4612
|
+
function easeFrame(e) {
|
|
4613
|
+
P = 0;
|
|
4614
|
+
let t = Math.min(64, Math.max(0, e - oe));
|
|
4615
|
+
oe = e;
|
|
4616
|
+
let ease = (e, n) => {
|
|
4617
|
+
let r = n > e ? hi : gi;
|
|
4618
|
+
return e + (n - e) * (1 - Math.exp(-t / r));
|
|
4619
|
+
};
|
|
4620
|
+
C.value = C.value.map((e, t) => ease(e, S.value[t] ?? 0)), !C.value.every((e, t) => Math.abs((S.value[t] ?? 0) - e) <= 5e-4) || S.value.some((e) => e > 0) ? P = ie(easeFrame) : C.value = b;
|
|
4621
|
+
}
|
|
4622
|
+
function followLevel(e) {
|
|
4623
|
+
let gate = (e) => Math.max(0, e - mi) / (1 - mi);
|
|
4624
|
+
if (S.value = h.map((t) => gate(Math.min(1, Math.max(0, e?.[t] ?? r.value)))), te?.matches) {
|
|
4625
|
+
C.value = S.value;
|
|
4626
|
+
return;
|
|
4627
|
+
}
|
|
4628
|
+
P || (oe = performance.now(), P = ie(easeFrame));
|
|
4629
|
+
}
|
|
4630
|
+
let se = p(() => C.value.map((e) => Math.round((2 + Math.sqrt(Math.min(1, Math.max(0, e))) * 14) * 10) / 10)), ce = p(() => m.value === "error" ? "bg-red-500" : m.value === "connecting" ? "bg-amber-500" : m.value === "speaking" ? "bg-primary-500" : "bg-green-500"), I = {
|
|
4631
|
+
connecting: "Connecting",
|
|
4632
|
+
listening: "Listening",
|
|
4633
|
+
speaking: "Speaking",
|
|
4634
|
+
error: "Connection problem"
|
|
4635
|
+
}, ue = p(() => I[m.value]);
|
|
4636
|
+
function emitEnd() {
|
|
4637
|
+
c || (c = !0, n("end"));
|
|
4638
|
+
}
|
|
4639
|
+
return ne(async () => {
|
|
4640
|
+
let t = e.chatController?.createVoiceClient({
|
|
4641
|
+
onLevel: (e) => {
|
|
4642
|
+
i.value = e.source, r.value = e.level, followLevel(e.bands);
|
|
4643
|
+
},
|
|
4644
|
+
onStateChange: (e) => {
|
|
4645
|
+
a.value = e, e === "ended" && (o.value ? u = setTimeout(emitEnd, 1600) : emitEnd());
|
|
4646
|
+
},
|
|
4647
|
+
onError: (t) => {
|
|
4648
|
+
o.value = !0, e.chatController?.notify?.(t.message);
|
|
4649
|
+
}
|
|
4650
|
+
});
|
|
4651
|
+
if (!t) {
|
|
4652
|
+
emitEnd();
|
|
4653
|
+
return;
|
|
4654
|
+
}
|
|
4655
|
+
s.value = t, await t.start();
|
|
4656
|
+
}), re(() => {
|
|
4657
|
+
c = !0, u && clearTimeout(u), P && typeof window < "u" && typeof window.cancelAnimationFrame == "function" && window.cancelAnimationFrame(P), P = 0, s.value?.end();
|
|
4658
|
+
}), (t, n) => (A(), _("div", {
|
|
4659
|
+
"data-test": "voice-mode",
|
|
4660
|
+
"data-voice-state": a.value,
|
|
4661
|
+
"data-voice-activity": m.value,
|
|
4662
|
+
class: "relative flex min-h-0 flex-1 flex-col px-4 pt-8 pb-5"
|
|
4663
|
+
}, [v("div", ui, [
|
|
4664
|
+
v("div", di, [x(ze, {
|
|
4665
|
+
agent: e.agent,
|
|
4666
|
+
"show-status": !1,
|
|
4667
|
+
"show-owner-mark": !1,
|
|
4668
|
+
"is-light": e.isLight,
|
|
4669
|
+
class: "size-28"
|
|
4670
|
+
}, null, 8, ["agent", "is-light"])]),
|
|
4671
|
+
v("div", fi, [(A(!0), _(f, null, M(se.value, (e, t) => (A(), _("span", {
|
|
4672
|
+
key: t,
|
|
4673
|
+
"data-test": "voice-histogram-bar",
|
|
4674
|
+
class: T(["w-[2.5px] rounded-full transition-colors duration-150", [ce.value, m.value === "connecting" ? "pl-voice-bar-wave" : ""]]),
|
|
4675
|
+
style: k({
|
|
4676
|
+
height: `${e}px`,
|
|
4677
|
+
...m.value === "connecting" ? { animationDelay: `${t * 90}ms` } : {}
|
|
4678
|
+
})
|
|
4679
|
+
}, null, 6))), 128))]),
|
|
4680
|
+
v("div", pi, F(ue.value), 1)
|
|
4681
|
+
])], 8, li));
|
|
4546
4682
|
}
|
|
4547
|
-
}),
|
|
4683
|
+
}), vi = {
|
|
4548
4684
|
key: 0,
|
|
4549
4685
|
class: "pb-4"
|
|
4550
|
-
},
|
|
4686
|
+
}, yi = {
|
|
4551
4687
|
key: 1,
|
|
4552
4688
|
"data-test": "messaging-sdk-header",
|
|
4553
4689
|
class: "shrink-0 border-b border-theme-100 px-4 py-3"
|
|
4554
|
-
},
|
|
4690
|
+
}, bi = { class: "min-w-0 flex-1" }, xi = { class: "truncate text-base font-semibold leading-tight text-theme-900" }, Si = { class: "mt-1 truncate text-sm leading-tight text-theme-500" }, Ci = {
|
|
4555
4691
|
key: 0,
|
|
4556
4692
|
class: "shrink-0 rounded-full bg-theme-50 px-2.5 py-1 font-mono text-[11px] font-medium text-theme-500"
|
|
4557
|
-
},
|
|
4693
|
+
}, wi = {
|
|
4558
4694
|
key: 0,
|
|
4559
4695
|
"data-test": "messaging-empty-state",
|
|
4560
4696
|
class: "flex flex-col items-center justify-center px-4"
|
|
4561
|
-
},
|
|
4697
|
+
}, Ti = ["title"], Ei = {
|
|
4562
4698
|
key: 0,
|
|
4563
4699
|
class: "flex items-center gap-3 py-3 px-2"
|
|
4564
|
-
},
|
|
4700
|
+
}, Di = ["data-journal-outcome"], Oi = [
|
|
4565
4701
|
"data-message-id",
|
|
4566
4702
|
"data-message-sender",
|
|
4567
4703
|
"data-conversation-id",
|
|
@@ -4572,7 +4708,7 @@ var kr = [
|
|
|
4572
4708
|
"data-issue-action-label",
|
|
4573
4709
|
"data-issue-action-url",
|
|
4574
4710
|
"data-streaming"
|
|
4575
|
-
],
|
|
4711
|
+
], ki = { class: "max-w-[85%] min-w-0" }, Ai = ["href"], ji = [
|
|
4576
4712
|
"data-message-id",
|
|
4577
4713
|
"data-message-sender",
|
|
4578
4714
|
"data-conversation-id",
|
|
@@ -4581,62 +4717,71 @@ var kr = [
|
|
|
4581
4717
|
"data-issue-code",
|
|
4582
4718
|
"data-issue-bucket",
|
|
4583
4719
|
"data-streaming"
|
|
4584
|
-
],
|
|
4720
|
+
], Mi = [
|
|
4585
4721
|
"data-test",
|
|
4586
4722
|
"data-message-id",
|
|
4587
4723
|
"data-message-sender",
|
|
4588
4724
|
"data-conversation-id",
|
|
4589
4725
|
"data-message-sequence",
|
|
4590
4726
|
"data-system-kind",
|
|
4591
|
-
"data-streaming"
|
|
4592
|
-
|
|
4727
|
+
"data-streaming",
|
|
4728
|
+
"data-queued",
|
|
4729
|
+
"aria-label"
|
|
4730
|
+
], Ni = ["src", "alt"], Pi = ["src"], Fi = ["href"], Ii = {
|
|
4593
4731
|
key: 0,
|
|
4594
4732
|
"data-test": "messaging-message-text-part"
|
|
4595
|
-
},
|
|
4733
|
+
}, Li = [
|
|
4596
4734
|
"src",
|
|
4597
4735
|
"alt",
|
|
4598
4736
|
"data-attachment-placement"
|
|
4599
|
-
],
|
|
4737
|
+
], Ri = ["src", "data-attachment-placement"], zi = ["href", "data-attachment-placement"], Bi = ["data-journal-outcome"], Vi = {
|
|
4600
4738
|
key: 2,
|
|
4601
4739
|
"data-test": "messaging-tool-activity-tail",
|
|
4602
4740
|
"aria-label": "Assistant is still working",
|
|
4603
4741
|
class: "mb-4 grid h-[17px] w-5 place-items-center"
|
|
4604
|
-
},
|
|
4742
|
+
}, Hi = ["data-journal-outcome"], Ui = ["data-test", "data-working-description"], Wi = {
|
|
4605
4743
|
class: "flex items-center gap-[5px]",
|
|
4606
4744
|
"aria-hidden": "true"
|
|
4607
|
-
},
|
|
4745
|
+
}, Gi = { class: "truncate" }, Ki = ["data-issue-code"], qi = ["href"], Ji = ["src", "alt"], Yi = { class: "max-w-20 truncate" }, Xi = ["onClick"], Zi = {
|
|
4608
4746
|
key: 0,
|
|
4609
4747
|
class: "shrink-0 flex items-center justify-center size-14"
|
|
4610
|
-
},
|
|
4748
|
+
}, Qi = ["data-composer-action"], $i = ["placeholder", "disabled"], ea = { class: "font-mono text-sm tabular-nums" }, ta = { class: "mt-2.5 flex items-center" }, na = [
|
|
4611
4749
|
"disabled",
|
|
4612
4750
|
"aria-label",
|
|
4613
4751
|
"title"
|
|
4614
|
-
],
|
|
4752
|
+
], ra = {
|
|
4615
4753
|
key: 0,
|
|
4616
4754
|
class: "i-svg-spinners-ring-resize size-5"
|
|
4617
|
-
},
|
|
4755
|
+
}, ia = {
|
|
4618
4756
|
key: 1,
|
|
4619
4757
|
class: "i-tabler-plus size-5"
|
|
4620
|
-
},
|
|
4758
|
+
}, aa = { class: "sr-only" }, oa = { class: "flex items-center gap-2" }, sa = ["aria-label", "title"], ca = { class: "sr-only" }, la = [
|
|
4759
|
+
"disabled",
|
|
4760
|
+
"aria-label",
|
|
4761
|
+
"title"
|
|
4762
|
+
], ua = {
|
|
4763
|
+
class: "flex h-4 items-center gap-[2px]",
|
|
4764
|
+
"aria-hidden": "true"
|
|
4765
|
+
}, da = [
|
|
4621
4766
|
"data-composer-action",
|
|
4622
4767
|
"disabled",
|
|
4623
4768
|
"aria-label",
|
|
4624
4769
|
"title"
|
|
4625
|
-
],
|
|
4770
|
+
], fa = {
|
|
4626
4771
|
key: 0,
|
|
4627
4772
|
class: "i-tabler-player-stop-filled size-3.5"
|
|
4628
|
-
},
|
|
4773
|
+
}, pa = {
|
|
4629
4774
|
key: 1,
|
|
4630
4775
|
class: "i-tabler-arrow-up size-[17px]"
|
|
4631
|
-
},
|
|
4776
|
+
}, ma = { class: "sr-only" }, ha = {
|
|
4632
4777
|
key: 2,
|
|
4633
4778
|
"data-test": "messaging-ai-disclosure",
|
|
4634
4779
|
class: "mt-2.5 text-center text-[12px] text-theme-300"
|
|
4635
|
-
},
|
|
4780
|
+
}, ga = {
|
|
4636
4781
|
key: 3,
|
|
4637
4782
|
"data-test": "messaging-suggested-prompts",
|
|
4638
|
-
class: "mt-
|
|
4639
|
-
},
|
|
4783
|
+
class: "mt-3 w-full sm:mx-auto sm:mt-5 sm:max-w-[720px]"
|
|
4784
|
+
}, _a = { class: "flex flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-center sm:justify-center" }, va = ["disabled", "onClick"], ya = ["aria-expanded"], ba = /* @__PURE__ */ S({
|
|
4640
4785
|
__name: "ElAgentChat",
|
|
4641
4786
|
props: {
|
|
4642
4787
|
chatController: {},
|
|
@@ -4677,34 +4822,34 @@ var kr = [
|
|
|
4677
4822
|
}, n = p(() => {
|
|
4678
4823
|
let n = { ...t[e.scope] };
|
|
4679
4824
|
return e.scope === "org" && e.scopeName && (n.label = e.scopeName, n.tooltip = `Visible to ${e.scopeName} members`), n;
|
|
4680
|
-
}), r =
|
|
4825
|
+
}), r = j(), i = j(), a = j();
|
|
4681
4826
|
function containsMarkdownLink(e) {
|
|
4682
4827
|
return e ? /\[[^\]]+\]\([^)]+\)/.test(e) : !1;
|
|
4683
4828
|
}
|
|
4684
4829
|
function isSystemExplainerMessage(e) {
|
|
4685
|
-
return e.sender === "system" && (!!e.issue || e.id ===
|
|
4830
|
+
return e.sender === "system" && (!!e.issue || e.id === ye.value);
|
|
4686
4831
|
}
|
|
4687
4832
|
function isGroupEnd(e, t) {
|
|
4688
4833
|
let n = e[t], r = e[t + 1];
|
|
4689
4834
|
return !r || r.sender !== n.sender;
|
|
4690
4835
|
}
|
|
4691
|
-
let o = p(() => e.chatController?.textState.value), s = p(() => o.value?.isConnected ?? !1), c = p(() => o.value?.isThinking ?? !1), u = p(() => o.value?.connectionStatus === "disconnected" && !!o.value?.error),
|
|
4692
|
-
for (let e =
|
|
4693
|
-
let t =
|
|
4836
|
+
let o = p(() => e.chatController?.textState.value), s = p(() => o.value?.isConnected ?? !1), c = p(() => o.value?.isThinking ?? !1), u = p(() => o.value?.connectionStatus === "disconnected" && !!o.value?.error), S = p(() => o.value?.connectionStatus !== "connected" && !o.value?.error), te = j(!1), P = p(() => e.chatController?.liveTurnBlocks?.value ?? []), ae = p(() => {
|
|
4837
|
+
for (let e = P.value.length - 1; e >= 0; e--) {
|
|
4838
|
+
let t = P.value[e];
|
|
4694
4839
|
if (t?.kind === "text") return t.id;
|
|
4695
4840
|
}
|
|
4696
|
-
}),
|
|
4841
|
+
}), oe = p(() => e.chatController?.liveStreamMessageId?.value), R = p(() => {
|
|
4697
4842
|
let t = e.chatController?.sharedMessages.value ?? [];
|
|
4698
|
-
return
|
|
4699
|
-
}),
|
|
4843
|
+
return P.value.length && oe.value ? t.filter((e) => e.id !== oe.value) : t;
|
|
4844
|
+
}), B = p(() => {
|
|
4700
4845
|
if (!e.chatController?.workJournal?.value) return o.value?.workingDescription?.trim() || void 0;
|
|
4701
|
-
}),
|
|
4702
|
-
if (!
|
|
4703
|
-
let e =
|
|
4846
|
+
}), _e = p(() => e.chatController?.workJournal?.value), H = p(() => {
|
|
4847
|
+
if (!_e.value && !P.value.length) return;
|
|
4848
|
+
let e = R.value, t = e[e.length - 1];
|
|
4704
4849
|
if (t) return t.sender === "agent" || t.sender === "system" ? e.length >= 2 ? e[e.length - 2].id : void 0 : t.id;
|
|
4705
|
-
}),
|
|
4850
|
+
}), ve = p(() => {
|
|
4706
4851
|
let t = {};
|
|
4707
|
-
for (let n of
|
|
4852
|
+
for (let n of R.value) {
|
|
4708
4853
|
if (n.sender === "user" || !n.toolActivities?.length) continue;
|
|
4709
4854
|
let r = e.chatController?.workJournalFor?.({
|
|
4710
4855
|
activities: n.toolActivities,
|
|
@@ -4716,7 +4861,7 @@ var kr = [
|
|
|
4716
4861
|
return t;
|
|
4717
4862
|
});
|
|
4718
4863
|
function messageWorkJournal(e) {
|
|
4719
|
-
return
|
|
4864
|
+
return ve.value[e.id];
|
|
4720
4865
|
}
|
|
4721
4866
|
function inlineOffset(e, t) {
|
|
4722
4867
|
return e.placement?.kind !== "inline" || !Number.isFinite(e.placement.offset) ? null : Math.max(0, Math.min(t.length, Math.trunc(e.placement.offset)));
|
|
@@ -4764,21 +4909,32 @@ var kr = [
|
|
|
4764
4909
|
text: t.slice(i)
|
|
4765
4910
|
}), r;
|
|
4766
4911
|
}
|
|
4767
|
-
let
|
|
4912
|
+
let U = p(() => o.value?.transientIssue), ye = p(() => {
|
|
4768
4913
|
if (!c.value) return;
|
|
4769
|
-
let e =
|
|
4914
|
+
let e = R.value, t = e[e.length - 1];
|
|
4770
4915
|
return t?.sender === "agent" || t?.sender === "system" ? t.id : void 0;
|
|
4771
|
-
}),
|
|
4916
|
+
}), W = p(() => !c.value || B.value || _e.value || P.value.length ? !1 : ye.value === void 0), be = p(() => B.value ?? (W.value ? "Thinking…" : void 0)), G = p(() => o.value?.sendBlockedReason), Se = p(() => G.value === "agent_deleted"), Ce = p(() => u.value ? `${e.agent.displayName.value || e.agent.name.value || "Assistant"} is offline` : S.value ? "Connecting..." : G.value === "agent_deleted" ? "This assistant was deleted" : `Message ${e.agent.displayName.value || e.agent.name.value || "assistant"}`), we = p(() => e.chatController?.composerState?.value ?? {
|
|
4772
4917
|
text: "",
|
|
4773
4918
|
pendingAttachments: [],
|
|
4774
4919
|
isUploading: !1
|
|
4775
|
-
}),
|
|
4776
|
-
get: () =>
|
|
4920
|
+
}), Te = p({
|
|
4921
|
+
get: () => we.value.text,
|
|
4777
4922
|
set: (t) => e.chatController?.setComposerText?.({ text: t })
|
|
4778
|
-
}),
|
|
4779
|
-
|
|
4923
|
+
}), Ee = p(() => we.value.pendingAttachments), De = p(() => we.value.isUploading), Oe = p(() => e.chatController?.voiceRecorder), ke = p(() => Oe.value?.isBusy.value ?? !1), Ae = p(() => e.chatController?.canAttachFile?.value ?? !1), je = p(() => e.chatController?.canRecordAudio?.value ?? !1), Me = p(() => e.chatController?.composerAction?.value ?? "idle"), Ne = p(() => Me.value !== "idle"), Fe = p(() => e.chatController?.composerShowsSecondaryStop?.value ?? !1), Ie = p(() => e.chatController?.queuedMessageIds?.value);
|
|
4924
|
+
function isQueuedMessage(e) {
|
|
4925
|
+
return Ie.value?.has(e) ?? !1;
|
|
4926
|
+
}
|
|
4927
|
+
let Le = p(() => Me.value === "stop" ? "Stop reply" : Fe.value ? "Send — answered after current work" : "Send message"), Re = p(() => je.value && !ke.value && !!Oe.value?.canUseBrowserRecording), Be = p(() => Oe.value?.isActive.value ?? !1), Ve = p(() => Oe.value?.elapsedLabel.value ?? "0:00"), He = p(() => Oe.value?.statusText.value ?? "Release to send"), Ue = p(() => Oe.value?.state.value.phase === "sending" ? "Sending voice message" : Be.value ? "Release to send voice message" : "Hold to record voice message"), We = j(!1), Ge = p(() => e.chatController?.canStartVoice?.value ?? !1), Ke = p(() => Ge.value && !We.value && !Be.value && Me.value === "idle"), qe = p(() => !s.value), Ye = p(() => qe.value ? `Voice available when ${e.agent.displayName.value || e.agent.name.value || "the assistant"} is awake` : "Start voice conversation");
|
|
4928
|
+
function startVoiceConversation() {
|
|
4929
|
+
!Ke.value || qe.value || (We.value = !0);
|
|
4930
|
+
}
|
|
4931
|
+
async function endVoiceConversation() {
|
|
4932
|
+
We.value && (We.value = !1, await C(), i.value?.focus(), await e.chatController?.refreshMessages());
|
|
4933
|
+
}
|
|
4934
|
+
let K = p(() => e.variant === "light"), Xe = p(() => K.value ? "bg-gradient-to-r from-transparent via-black/5 to-transparent" : "bg-gradient-to-r from-transparent via-white/5 to-transparent"), Ze = p(() => K.value ? "text-theme-300" : "text-white/30");
|
|
4935
|
+
ne(async () => {
|
|
4780
4936
|
e.chatController && !s.value && await e.chatController.startTextConversation();
|
|
4781
|
-
}),
|
|
4937
|
+
}), re(() => {
|
|
4782
4938
|
e.chatController?.voiceRecorder?.teardown();
|
|
4783
4939
|
});
|
|
4784
4940
|
async function sendMessage() {
|
|
@@ -4788,10 +4944,10 @@ var kr = [
|
|
|
4788
4944
|
window.matchMedia("(hover: none) and (pointer: coarse)").matches && i.value?.blur(), await t;
|
|
4789
4945
|
}
|
|
4790
4946
|
async function handleCardAction(t) {
|
|
4791
|
-
!e.chatController ||
|
|
4947
|
+
!e.chatController || Se.value || (r.value?.pin(), await e.chatController.sendChatMessage(t));
|
|
4792
4948
|
}
|
|
4793
4949
|
async function sendSuggestedPrompt(t) {
|
|
4794
|
-
!e.chatController ||
|
|
4950
|
+
!e.chatController || Se.value || (r.value?.pin(), await e.chatController.sendChatMessage(t.prompt));
|
|
4795
4951
|
}
|
|
4796
4952
|
async function handleComposerAction() {
|
|
4797
4953
|
if (e.chatController) {
|
|
@@ -4806,27 +4962,27 @@ var kr = [
|
|
|
4806
4962
|
e.isComposing || e.key === "Enter" && !e.shiftKey && (e.preventDefault(), await sendMessage());
|
|
4807
4963
|
}
|
|
4808
4964
|
function focusComposer(e) {
|
|
4809
|
-
|
|
4965
|
+
Be.value || Se.value || e.target instanceof Element && e.target.closest("button, a, textarea") || i.value?.focus();
|
|
4810
4966
|
}
|
|
4811
4967
|
function adjustTextareaHeight() {
|
|
4812
4968
|
i.value && (i.value.style.height = "auto", i.value.style.height = `${Math.min(i.value.scrollHeight, 150)}px`);
|
|
4813
4969
|
}
|
|
4814
|
-
|
|
4970
|
+
ce(Te, () => C(() => adjustTextareaHeight()));
|
|
4815
4971
|
function triggerFileInput() {
|
|
4816
4972
|
a.value?.click();
|
|
4817
4973
|
}
|
|
4818
4974
|
async function handleFileSelect(t) {
|
|
4819
4975
|
let n = t.target, r = n.files?.[0];
|
|
4820
|
-
!r || !e.chatController ||
|
|
4976
|
+
!r || !e.chatController || ke.value || (await e.chatController.attachFile({ file: r }), n.value = "");
|
|
4821
4977
|
}
|
|
4822
4978
|
function removeAttachment(t) {
|
|
4823
4979
|
e.chatController?.removeAttachment({ index: t });
|
|
4824
4980
|
}
|
|
4825
4981
|
function startRecording() {
|
|
4826
|
-
|
|
4982
|
+
Oe.value?.start();
|
|
4827
4983
|
}
|
|
4828
4984
|
function finishRecording(e) {
|
|
4829
|
-
|
|
4985
|
+
Oe.value?.finish(e);
|
|
4830
4986
|
}
|
|
4831
4987
|
function shouldShowTimeDivider(e, t) {
|
|
4832
4988
|
if (t === 0) {
|
|
@@ -4855,62 +5011,71 @@ var kr = [
|
|
|
4855
5011
|
...o ? {} : { year: "numeric" }
|
|
4856
5012
|
})}, ${a}`;
|
|
4857
5013
|
}
|
|
4858
|
-
return (t, o) => (
|
|
5014
|
+
return (t, o) => (A(), _("div", {
|
|
4859
5015
|
"data-test": "messaging-root",
|
|
4860
|
-
class:
|
|
5016
|
+
class: T(["@container/chat relative flex h-full flex-col", R.value.length === 0 ? "min-h-0 [justify-content:safe_center] overflow-y-auto" : ""])
|
|
4861
5017
|
}, [
|
|
4862
|
-
e.showHeader && !K.value ? (
|
|
5018
|
+
e.showHeader && !K.value ? (A(), _("div", vi, [x(Pe, {
|
|
4863
5019
|
agent: e.agent,
|
|
4864
5020
|
"is-online": s.value
|
|
4865
|
-
}, null, 8, ["agent", "is-online"])])) : e.showHeader ? (
|
|
4866
|
-
|
|
5021
|
+
}, null, 8, ["agent", "is-online"])])) : e.showHeader ? (A(), _("div", yi, [v("div", { class: T(["flex items-center gap-3", e.centered ? "max-w-[720px] mx-auto" : ""]) }, [
|
|
5022
|
+
x(ze, {
|
|
4867
5023
|
agent: e.agent,
|
|
4868
5024
|
"is-light": K.value,
|
|
4869
5025
|
class: "size-10"
|
|
4870
5026
|
}, null, 8, ["agent", "is-light"]),
|
|
4871
|
-
v("div",
|
|
4872
|
-
e.headerMeta ? (
|
|
5027
|
+
v("div", bi, [v("div", xi, F(e.agent.displayName.value), 1), v("div", Si, F(e.agent.title.value || "Assistant"), 1)]),
|
|
5028
|
+
e.headerMeta ? (A(), _("span", Ci, F(e.headerMeta), 1)) : h("", !0)
|
|
4873
5029
|
], 2)])) : h("", !0),
|
|
4874
|
-
|
|
5030
|
+
We.value ? (A(), m(_i, {
|
|
4875
5031
|
key: 2,
|
|
4876
|
-
|
|
4877
|
-
|
|
4878
|
-
|
|
4879
|
-
|
|
4880
|
-
},
|
|
4881
|
-
|
|
5032
|
+
agent: e.agent,
|
|
5033
|
+
"chat-controller": e.chatController,
|
|
5034
|
+
"is-light": K.value,
|
|
5035
|
+
onEnd: endVoiceConversation
|
|
5036
|
+
}, null, 8, [
|
|
5037
|
+
"agent",
|
|
5038
|
+
"chat-controller",
|
|
5039
|
+
"is-light"
|
|
5040
|
+
])) : (A(), _(f, { key: 3 }, [S.value ? (A(), _("div", {
|
|
5041
|
+
key: 0,
|
|
5042
|
+
class: T(["py-16 flex flex-col items-center justify-center gap-2 text-sm", K.value ? "text-theme-400" : "text-theme-600"])
|
|
5043
|
+
}, [x(he, { class: "size-4" })], 2)) : e.setupHint ? (A(), _("div", {
|
|
5044
|
+
key: 1,
|
|
5045
|
+
class: T(["flex items-center justify-center gap-1.5 py-2 text-[11px]", Ze.value])
|
|
5046
|
+
}, [o[21] || (o[21] = v("i", { class: "i-tabler-tool size-3" }, null, -1)), v("span", null, F(e.setupHint), 1)], 2)) : h("", !0), x(ci, {
|
|
4882
5047
|
ref_key: "chatScroller",
|
|
4883
5048
|
ref: r,
|
|
4884
|
-
class:
|
|
5049
|
+
class: T(R.value.length === 0 ? "flex-none" : "flex-1")
|
|
4885
5050
|
}, {
|
|
4886
|
-
default:
|
|
4887
|
-
|
|
5051
|
+
default: I(() => [v("div", { class: T([R.value.length === 0 ? "flex flex-col items-center justify-center px-3 py-4" : e.centered ? "pt-20 pb-5 px-3 space-y-2" : "pt-4 pb-[120px] px-3 space-y-2", e.centered ? R.value.length === 0 ? "max-w-[900px] mx-auto w-full" : "max-w-[720px] mx-auto w-full" : ""]) }, [
|
|
5052
|
+
R.value.length === 0 && !S.value ? (A(), _("div", wi, [ie(t.$slots, "empty-heading", {
|
|
4888
5053
|
agent: e.agent,
|
|
4889
5054
|
isLight: K.value
|
|
4890
|
-
}, () => [
|
|
5055
|
+
}, () => [x(ze, {
|
|
4891
5056
|
agent: e.agent,
|
|
4892
5057
|
"is-light": K.value,
|
|
4893
5058
|
class: "mb-4 size-20 @sm/chat:size-24"
|
|
4894
|
-
}, null, 8, ["agent", "is-light"]), v("div", { class:
|
|
4895
|
-
class:
|
|
5059
|
+
}, null, 8, ["agent", "is-light"]), v("div", { class: T(["text-base @sm/chat:text-lg font-semibold", K.value ? "text-theme-900" : "text-white"]) }, F(e.agent.displayName.value), 3)]), e.emptyStateMessage === "" ? h("", !0) : (A(), _(f, { key: 0 }, [v("p", { class: T(["mt-1 text-center text-xs @sm/chat:text-sm", Ze.value]) }, F(e.emptyStateMessage || "Type your message to get started."), 3), v("div", {
|
|
5060
|
+
class: T(["inline-flex items-center gap-1.5 mt-5 px-2.5 py-1 rounded-full text-[11px]", K.value ? "bg-theme-50 border border-theme-100 text-theme-400" : "bg-white/10 border border-white/20 text-white/40"]),
|
|
4896
5061
|
title: n.value.tooltip
|
|
4897
|
-
}, [v("i", { class:
|
|
4898
|
-
(
|
|
4899
|
-
shouldShowTimeDivider(
|
|
4900
|
-
v("div", { class:
|
|
4901
|
-
v("span", { class:
|
|
4902
|
-
v("div", { class:
|
|
5062
|
+
}, [v("i", { class: T([n.value.icon, "size-3"]) }, null, 2), v("span", null, F(n.value.label), 1)], 10, Ti)], 64))])) : h("", !0),
|
|
5063
|
+
(A(!0), _(f, null, M(R.value, (e, t) => (A(), _(f, { key: e.id }, [
|
|
5064
|
+
shouldShowTimeDivider(R.value, t) ? (A(), _("div", Ei, [
|
|
5065
|
+
v("div", { class: T(["flex-1 h-px", Xe.value]) }, null, 2),
|
|
5066
|
+
v("span", { class: T(["text-[10px] @sm/chat:text-[11px] font-medium shrink-0 tracking-widest uppercase", Ze.value]) }, F(shouldShowTimeDivider(R.value, t)), 3),
|
|
5067
|
+
v("div", { class: T(["flex-1 h-px", Xe.value]) }, null, 2)
|
|
4903
5068
|
])) : h("", !0),
|
|
4904
|
-
messageWorkJournal(e) ? (
|
|
5069
|
+
messageWorkJournal(e) ? (A(), _("div", {
|
|
4905
5070
|
key: 1,
|
|
4906
5071
|
"data-test": "messaging-message-tool-activity",
|
|
4907
5072
|
"data-journal-outcome": messageWorkJournal(e)?.outcome,
|
|
4908
5073
|
class: "mb-4 w-full"
|
|
4909
|
-
}, [
|
|
5074
|
+
}, [x(Je, {
|
|
4910
5075
|
model: messageWorkJournal(e),
|
|
4911
5076
|
"is-light": K.value
|
|
4912
|
-
}, null, 8, ["model", "is-light"])], 8,
|
|
4913
|
-
isSystemExplainerMessage(e) ? (
|
|
5077
|
+
}, null, 8, ["model", "is-light"])], 8, Di)) : h("", !0),
|
|
5078
|
+
isSystemExplainerMessage(e) ? (A(), _("div", {
|
|
4914
5079
|
key: 2,
|
|
4915
5080
|
"data-test": "messaging-system-msg",
|
|
4916
5081
|
"data-message-id": e.id,
|
|
@@ -4922,30 +5087,30 @@ var kr = [
|
|
|
4922
5087
|
"data-issue-bucket": e.issue?.bucket,
|
|
4923
5088
|
"data-issue-action-label": e.issue?.actionLabel,
|
|
4924
5089
|
"data-issue-action-url": e.issue?.actionUrl,
|
|
4925
|
-
"data-streaming": e.id ===
|
|
5090
|
+
"data-streaming": e.id === ye.value ? "true" : void 0,
|
|
4926
5091
|
class: "flex gap-2 items-end justify-start mb-4"
|
|
4927
|
-
}, [v("div",
|
|
5092
|
+
}, [v("div", ki, [v("div", { class: T(["mb-1 pl-1 text-[11px] font-medium", K.value ? "text-theme-500" : "text-white/45"]) }, " System Message ", 2), v("div", { class: T(["pl-1", K.value ? "text-theme-700" : "text-white/85"]) }, [e.text ? (A(), m(ai, {
|
|
4928
5093
|
key: 0,
|
|
4929
5094
|
text: e.text,
|
|
4930
5095
|
inverted: !K.value,
|
|
4931
|
-
streaming: e.id ===
|
|
4932
|
-
onClick: o[0] || (o[0] =
|
|
5096
|
+
streaming: e.id === ye.value,
|
|
5097
|
+
onClick: o[0] || (o[0] = pe(() => {}, ["stop"])),
|
|
4933
5098
|
onAction: handleCardAction
|
|
4934
5099
|
}, null, 8, [
|
|
4935
5100
|
"text",
|
|
4936
5101
|
"inverted",
|
|
4937
5102
|
"streaming"
|
|
4938
|
-
])) : e.issue?.help ? (
|
|
5103
|
+
])) : e.issue?.help ? (A(), m(ai, {
|
|
4939
5104
|
key: 1,
|
|
4940
5105
|
text: e.issue.help,
|
|
4941
5106
|
inverted: !K.value
|
|
4942
|
-
}, null, 8, ["text", "inverted"])) : h("", !0), e.issue?.actionUrl && !containsMarkdownLink(e.text) ? (
|
|
5107
|
+
}, null, 8, ["text", "inverted"])) : h("", !0), e.issue?.actionUrl && !containsMarkdownLink(e.text) ? (A(), _("a", {
|
|
4943
5108
|
key: 2,
|
|
4944
5109
|
href: e.issue.actionUrl,
|
|
4945
5110
|
"data-test": "messaging-system-msg-action",
|
|
4946
|
-
class:
|
|
4947
|
-
onClick: o[1] || (o[1] =
|
|
4948
|
-
}, [
|
|
5111
|
+
class: T(["mt-2 text-[12px] font-medium inline-flex items-center gap-1", K.value ? "text-theme-900 hover:text-theme-700" : "text-white hover:text-white/80"]),
|
|
5112
|
+
onClick: o[1] || (o[1] = pe(() => {}, ["stop"]))
|
|
5113
|
+
}, [b(F(e.issue.actionLabel) + " ", 1), o[22] || (o[22] = v("i", { class: "i-tabler-arrow-right size-3" }, null, -1))], 10, Ai)) : h("", !0)], 2)])], 8, Oi)) : e.sender === "system" ? (A(), _("div", {
|
|
4949
5114
|
key: 3,
|
|
4950
5115
|
"data-test": "messaging-system-status-msg",
|
|
4951
5116
|
"data-message-id": e.id,
|
|
@@ -4955,13 +5120,16 @@ var kr = [
|
|
|
4955
5120
|
"data-system-kind": e.systemKind,
|
|
4956
5121
|
"data-issue-code": e.issue?.code,
|
|
4957
5122
|
"data-issue-bucket": e.issue?.bucket,
|
|
4958
|
-
"data-streaming": e.id ===
|
|
4959
|
-
class:
|
|
4960
|
-
}, [o[
|
|
5123
|
+
"data-streaming": e.id === ye.value ? "true" : void 0,
|
|
5124
|
+
class: T(["mb-4 flex w-fit max-w-[85%] items-start gap-2 rounded-2xl px-3 py-2 text-[13px] leading-relaxed ring-1", K.value ? "bg-theme-100 text-theme-600 ring-theme-200" : "bg-white/10 text-white/70 ring-white/10"])
|
|
5125
|
+
}, [o[23] || (o[23] = v("i", {
|
|
5126
|
+
class: "i-tabler-info-circle size-4 mt-0.5 shrink-0",
|
|
5127
|
+
"aria-hidden": "true"
|
|
5128
|
+
}, null, -1)), x(ai, {
|
|
4961
5129
|
text: e.text,
|
|
4962
5130
|
inverted: !K.value,
|
|
4963
|
-
onClick: o[2] || (o[2] =
|
|
4964
|
-
}, null, 8, ["text", "inverted"])], 10,
|
|
5131
|
+
onClick: o[2] || (o[2] = pe(() => {}, ["stop"]))
|
|
5132
|
+
}, null, 8, ["text", "inverted"])], 10, ji)) : (A(), _("div", {
|
|
4965
5133
|
key: 4,
|
|
4966
5134
|
"data-test": e.sender === "agent" ? "messaging-assistant-msg" : e.sender === "user" ? "messaging-user-msg" : void 0,
|
|
4967
5135
|
"data-message-id": e.id,
|
|
@@ -4969,170 +5137,173 @@ var kr = [
|
|
|
4969
5137
|
"data-conversation-id": e.conversationId,
|
|
4970
5138
|
"data-message-sequence": e.sequence,
|
|
4971
5139
|
"data-system-kind": e.systemKind,
|
|
4972
|
-
"data-streaming": e.id ===
|
|
4973
|
-
|
|
5140
|
+
"data-streaming": e.id === ye.value ? "true" : void 0,
|
|
5141
|
+
"data-queued": isQueuedMessage(e.id) ? "true" : void 0,
|
|
5142
|
+
"aria-label": isQueuedMessage(e.id) ? "Sent — will be answered after the current work finishes" : void 0,
|
|
5143
|
+
class: T(["flex gap-2 items-end", {
|
|
4974
5144
|
"justify-end": e.sender === "user",
|
|
4975
5145
|
"justify-start": e.sender === "agent",
|
|
4976
|
-
"mb-6": isGroupEnd(
|
|
5146
|
+
"mb-6": isGroupEnd(R.value, t),
|
|
5147
|
+
"opacity-70": isQueuedMessage(e.id)
|
|
4977
5148
|
}])
|
|
4978
5149
|
}, [v("div", {
|
|
4979
5150
|
"data-test": "messaging-message-body",
|
|
4980
|
-
class:
|
|
4981
|
-
}, [blockAttachmentsForMessage(e).length ? (
|
|
5151
|
+
class: T(e.sender === "user" ? "max-w-[min(78%,30rem)]" : "w-full min-w-0 @sm/chat:pr-[1em] @lg/chat:pr-[2em]")
|
|
5152
|
+
}, [blockAttachmentsForMessage(e).length ? (A(), _("div", {
|
|
4982
5153
|
key: 0,
|
|
4983
|
-
class:
|
|
4984
|
-
}, [(
|
|
5154
|
+
class: T(["mb-1 space-y-1", e.sender === "user" ? "flex flex-col items-end" : ""])
|
|
5155
|
+
}, [(A(!0), _(f, null, M(blockAttachmentsForMessage(e), ({ attachment: e, index: t }) => (A(), _(f, { key: attachmentKey(e, t) }, [e.type === "image" ? (A(), _("img", {
|
|
4985
5156
|
key: 0,
|
|
4986
5157
|
src: e.src,
|
|
4987
5158
|
alt: e.filename,
|
|
4988
5159
|
"data-test": "messaging-attachment",
|
|
4989
5160
|
"data-attachment-placement": "block",
|
|
4990
5161
|
class: "rounded-xl object-cover max-h-48 max-w-[240px] @sm/chat:max-w-[320px]"
|
|
4991
|
-
}, null, 8,
|
|
5162
|
+
}, null, 8, Ni)) : e.type === "audio" ? (A(), _("audio", {
|
|
4992
5163
|
key: 1,
|
|
4993
5164
|
src: e.src,
|
|
4994
5165
|
controls: "",
|
|
4995
5166
|
"data-test": "messaging-attachment",
|
|
4996
5167
|
"data-attachment-placement": "block",
|
|
4997
5168
|
class: "max-w-full"
|
|
4998
|
-
}, null, 8,
|
|
5169
|
+
}, null, 8, Pi)) : (A(), _("a", {
|
|
4999
5170
|
key: 2,
|
|
5000
5171
|
href: e.src,
|
|
5001
5172
|
target: "_blank",
|
|
5002
5173
|
rel: "noopener",
|
|
5003
5174
|
"data-test": "messaging-attachment",
|
|
5004
5175
|
"data-attachment-placement": "block",
|
|
5005
|
-
class:
|
|
5006
|
-
}, [o[
|
|
5176
|
+
class: T(["inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", K.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
|
|
5177
|
+
}, [o[24] || (o[24] = v("i", { class: "i-tabler-file size-3.5" }, null, -1)), b(" " + F(e.filename), 1)], 10, Fi))], 64))), 128))], 2)) : h("", !0), messageRenderParts(e).length ? (A(), _("div", {
|
|
5007
5178
|
key: 1,
|
|
5008
5179
|
"data-test": "messaging-message-content",
|
|
5009
|
-
class:
|
|
5010
|
-
}, [(
|
|
5180
|
+
class: T(e.sender === "user" ? K.value ? "rounded-[14px] px-4 py-2.5 bg-theme-100 text-theme-900" : "rounded-[14px] px-4 py-2.5 bg-white/10 text-white" : K.value ? "text-theme-800" : "text-white/95")
|
|
5181
|
+
}, [(A(!0), _(f, null, M(messageRenderParts(e), (t) => (A(), _(f, { key: t.key }, [t.kind === "text" && t.text ? (A(), _("div", Ii, [x(ai, {
|
|
5011
5182
|
text: t.text,
|
|
5012
5183
|
inverted: e.sender === "user" || !K.value,
|
|
5013
|
-
streaming: e.id ===
|
|
5014
|
-
onClick: o[3] || (o[3] =
|
|
5184
|
+
streaming: e.id === ye.value,
|
|
5185
|
+
onClick: o[3] || (o[3] = pe(() => {}, ["stop"])),
|
|
5015
5186
|
onAction: handleCardAction
|
|
5016
5187
|
}, null, 8, [
|
|
5017
5188
|
"text",
|
|
5018
5189
|
"inverted",
|
|
5019
5190
|
"streaming"
|
|
5020
|
-
])])) : t.kind === "attachment" && t.attachment.type === "image" ? (
|
|
5191
|
+
])])) : t.kind === "attachment" && t.attachment.type === "image" ? (A(), _("img", {
|
|
5021
5192
|
key: 1,
|
|
5022
5193
|
src: t.attachment.src,
|
|
5023
5194
|
alt: t.attachment.filename,
|
|
5024
5195
|
"data-test": "messaging-attachment",
|
|
5025
5196
|
"data-attachment-placement": t.placement,
|
|
5026
5197
|
class: "my-2 rounded-xl object-cover max-h-48 max-w-[240px] @sm/chat:max-w-[320px]"
|
|
5027
|
-
}, null, 8,
|
|
5198
|
+
}, null, 8, Li)) : t.kind === "attachment" && t.attachment.type === "audio" ? (A(), _("audio", {
|
|
5028
5199
|
key: 2,
|
|
5029
5200
|
src: t.attachment.src,
|
|
5030
5201
|
controls: "",
|
|
5031
5202
|
"data-test": "messaging-attachment",
|
|
5032
5203
|
"data-attachment-placement": t.placement,
|
|
5033
5204
|
class: "my-2 max-w-full"
|
|
5034
|
-
}, null, 8,
|
|
5205
|
+
}, null, 8, Ri)) : t.kind === "attachment" ? (A(), _("a", {
|
|
5035
5206
|
key: 3,
|
|
5036
5207
|
href: t.attachment.src,
|
|
5037
5208
|
target: "_blank",
|
|
5038
5209
|
rel: "noopener",
|
|
5039
5210
|
"data-test": "messaging-attachment",
|
|
5040
5211
|
"data-attachment-placement": t.placement,
|
|
5041
|
-
class:
|
|
5042
|
-
}, [o[
|
|
5043
|
-
e.id ===
|
|
5212
|
+
class: T(["my-2 inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", K.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
|
|
5213
|
+
}, [o[25] || (o[25] = v("i", { class: "i-tabler-file size-3.5" }, null, -1)), b(" " + F(t.attachment.filename), 1)], 10, zi)) : h("", !0)], 64))), 128))], 2)) : h("", !0)], 2)], 10, Mi)),
|
|
5214
|
+
e.id === H.value ? (A(), _(f, { key: 5 }, [P.value.length ? (A(!0), _(f, { key: 0 }, M(P.value, (e) => (A(), _(f, { key: e.id }, [e.kind === "work" ? (A(), _("div", {
|
|
5044
5215
|
key: 0,
|
|
5045
5216
|
"data-test": "messaging-tool-activity",
|
|
5046
5217
|
"data-journal-outcome": e.journal.outcome,
|
|
5047
5218
|
class: "mb-4 w-full"
|
|
5048
|
-
}, [
|
|
5219
|
+
}, [x(Je, {
|
|
5049
5220
|
model: e.journal,
|
|
5050
5221
|
"is-light": K.value
|
|
5051
|
-
}, null, 8, ["model", "is-light"])], 8,
|
|
5222
|
+
}, null, 8, ["model", "is-light"])], 8, Bi)) : e.kind === "text" && e.content ? (A(), _("div", {
|
|
5052
5223
|
key: 1,
|
|
5053
5224
|
"data-test": "messaging-live-text-block",
|
|
5054
|
-
class:
|
|
5055
|
-
}, [
|
|
5225
|
+
class: T(["mb-4 @sm/chat:pr-[1em] @lg/chat:pr-[2em]", K.value ? "text-theme-800" : "text-white/95"])
|
|
5226
|
+
}, [x(ai, {
|
|
5056
5227
|
text: e.content,
|
|
5057
5228
|
inverted: !K.value,
|
|
5058
|
-
streaming: e.id ===
|
|
5059
|
-
onClick: o[4] || (o[4] =
|
|
5229
|
+
streaming: e.id === ae.value,
|
|
5230
|
+
onClick: o[4] || (o[4] = pe(() => {}, ["stop"])),
|
|
5060
5231
|
onAction: handleCardAction
|
|
5061
5232
|
}, null, 8, [
|
|
5062
5233
|
"text",
|
|
5063
5234
|
"inverted",
|
|
5064
5235
|
"streaming"
|
|
5065
|
-
])], 2)) : (
|
|
5236
|
+
])], 2)) : (A(), _("div", Vi, [x(he, { class: T(["size-3.5", K.value ? "text-theme-500" : "text-white/70"]) }, null, 8, ["class"])]))], 64))), 128)) : _e.value ? (A(), _("div", {
|
|
5066
5237
|
key: 1,
|
|
5067
5238
|
"data-test": "messaging-tool-activity",
|
|
5068
|
-
"data-journal-outcome":
|
|
5239
|
+
"data-journal-outcome": _e.value.outcome,
|
|
5069
5240
|
class: "mb-4 w-full"
|
|
5070
|
-
}, [
|
|
5071
|
-
model:
|
|
5241
|
+
}, [x(Je, {
|
|
5242
|
+
model: _e.value,
|
|
5072
5243
|
"is-light": K.value
|
|
5073
|
-
}, null, 8, ["model", "is-light"])], 8,
|
|
5244
|
+
}, null, 8, ["model", "is-light"])], 8, Hi)) : h("", !0)], 64)) : h("", !0)
|
|
5074
5245
|
], 64))), 128)),
|
|
5075
|
-
|
|
5246
|
+
be.value ? (A(), _("div", {
|
|
5076
5247
|
key: 1,
|
|
5077
|
-
"data-test":
|
|
5078
|
-
"data-working-description":
|
|
5248
|
+
"data-test": B.value ? "messaging-working-state" : "messaging-thinking-indicator",
|
|
5249
|
+
"data-working-description": B.value,
|
|
5079
5250
|
role: "status",
|
|
5080
5251
|
"aria-live": "polite",
|
|
5081
|
-
class:
|
|
5082
|
-
}, [v("span",
|
|
5252
|
+
class: T(["mb-4 flex items-center gap-2.5 pl-0.5 text-[13.5px] leading-none", K.value ? "text-theme-500" : "text-white/50"])
|
|
5253
|
+
}, [v("span", Wi, [(A(), _(f, null, M(3, (e) => v("span", {
|
|
5083
5254
|
key: e,
|
|
5084
5255
|
"data-test": "messaging-thinking-dot",
|
|
5085
5256
|
class: "chat-working-dot size-1.5 rounded-full bg-current",
|
|
5086
|
-
style:
|
|
5087
|
-
}, null, 4)), 64))]), v("span",
|
|
5088
|
-
|
|
5257
|
+
style: k({ animationDelay: `${(e - 1) * .18}s` })
|
|
5258
|
+
}, null, 4)), 64))]), v("span", Gi, F(be.value), 1)], 10, Ui)) : h("", !0),
|
|
5259
|
+
U.value ? (A(), _("div", {
|
|
5089
5260
|
key: 2,
|
|
5090
5261
|
"data-test": "messaging-transient-issue",
|
|
5091
|
-
"data-issue-code":
|
|
5092
|
-
class:
|
|
5262
|
+
"data-issue-code": U.value.code,
|
|
5263
|
+
class: T(["flex items-center gap-1.5 pl-2 pr-3 pb-1 mb-3 text-[12px] leading-snug", K.value ? "text-theme-600" : "text-white/60"])
|
|
5093
5264
|
}, [
|
|
5094
|
-
o[
|
|
5265
|
+
o[26] || (o[26] = v("i", {
|
|
5095
5266
|
class: "i-tabler-alert-circle size-3.5 shrink-0 text-red-500",
|
|
5096
5267
|
"aria-hidden": "true"
|
|
5097
5268
|
}, null, -1)),
|
|
5098
|
-
v("span", null, [
|
|
5099
|
-
|
|
5269
|
+
v("span", null, [b(F(U.value.message), 1), U.value.help ? (A(), _(f, { key: 0 }, [b(F(U.value.help), 1)], 64)) : h("", !0)]),
|
|
5270
|
+
U.value.actionUrl && U.value.actionLabel ? (A(), _("a", {
|
|
5100
5271
|
key: 0,
|
|
5101
|
-
href:
|
|
5272
|
+
href: U.value.actionUrl,
|
|
5102
5273
|
class: "shrink-0 underline underline-offset-2",
|
|
5103
|
-
onClick: o[5] || (o[5] =
|
|
5104
|
-
},
|
|
5105
|
-
], 10,
|
|
5274
|
+
onClick: o[5] || (o[5] = pe(() => {}, ["stop"]))
|
|
5275
|
+
}, F(U.value.actionLabel), 9, qi)) : h("", !0)
|
|
5276
|
+
], 10, Ki)) : h("", !0)
|
|
5106
5277
|
], 2)]),
|
|
5107
5278
|
_: 3
|
|
5108
|
-
}, 8, ["class"]),
|
|
5279
|
+
}, 8, ["class"])], 64)),
|
|
5109
5280
|
v("div", {
|
|
5110
5281
|
"data-test": "messaging-composer-footer",
|
|
5111
|
-
class:
|
|
5112
|
-
|
|
5113
|
-
e.centered &&
|
|
5282
|
+
class: T(["left-0 right-0 z-30 px-5 pb-[max(env(safe-area-inset-bottom),1rem)]", [
|
|
5283
|
+
R.value.length === 0 || e.centered ? "relative shrink-0" : "absolute bottom-0",
|
|
5284
|
+
e.centered && R.value.length > 0 ? "pt-0" : "pt-3",
|
|
5114
5285
|
K.value ? e.centered ? "bg-theme-25/50" : "bg-gradient-to-t from-theme-0/90 via-theme-0/55 to-transparent" : "bg-gradient-to-t from-black/90 via-black/60 to-transparent"
|
|
5115
5286
|
]])
|
|
5116
5287
|
}, [
|
|
5117
|
-
|
|
5288
|
+
Ee.value.length > 0 ? (A(), _("div", {
|
|
5118
5289
|
key: 0,
|
|
5119
|
-
class:
|
|
5120
|
-
}, [(
|
|
5290
|
+
class: T(["flex items-center gap-2 px-2 pb-2 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden", e.centered ? "max-w-[720px] mx-auto" : ""])
|
|
5291
|
+
}, [(A(!0), _(f, null, M(Ee.value, (e, t) => (A(), _("div", {
|
|
5121
5292
|
key: t,
|
|
5122
5293
|
class: "relative shrink-0 group"
|
|
5123
|
-
}, [e.type === "image" ? (
|
|
5294
|
+
}, [e.type === "image" ? (A(), _("img", {
|
|
5124
5295
|
key: 0,
|
|
5125
5296
|
src: e.src,
|
|
5126
5297
|
alt: e.filename,
|
|
5127
|
-
class:
|
|
5128
|
-
}, null, 10,
|
|
5298
|
+
class: T(["size-14 rounded-xl object-cover border", K.value ? "border-black/10" : "border-white/20"])
|
|
5299
|
+
}, null, 10, Ji)) : (A(), _("div", {
|
|
5129
5300
|
key: 1,
|
|
5130
|
-
class:
|
|
5131
|
-
}, [o[
|
|
5301
|
+
class: T(["h-14 px-3 rounded-xl flex items-center gap-1.5 text-xs border", K.value ? "border-black/10 bg-theme-50 text-theme-600" : "border-white/20 bg-white/10 text-white/70"])
|
|
5302
|
+
}, [o[27] || (o[27] = v("i", { class: "i-tabler-file size-4" }, null, -1)), v("span", Yi, F(e.filename), 1)], 2)), v("button", {
|
|
5132
5303
|
class: "absolute -top-1.5 -right-1.5 size-5 flex items-center justify-center rounded-full bg-theme-800 text-white text-xs scale-0 group-hover:scale-100 transition-transform cursor-pointer",
|
|
5133
5304
|
onClick: (e) => removeAttachment(t)
|
|
5134
|
-
}, [...o[
|
|
5135
|
-
|
|
5305
|
+
}, [...o[28] || (o[28] = [v("i", { class: "i-tabler-x size-3" }, null, -1)])], 8, Xi)]))), 128)), De.value ? (A(), _("div", Zi, [x(he, { class: "size-5" })])) : h("", !0)], 2)) : h("", !0),
|
|
5306
|
+
Ae.value ? (A(), _("input", {
|
|
5136
5307
|
key: 1,
|
|
5137
5308
|
ref_key: "fileInput",
|
|
5138
5309
|
ref: a,
|
|
@@ -5144,21 +5315,21 @@ var kr = [
|
|
|
5144
5315
|
v("div", {
|
|
5145
5316
|
"data-test": "messaging-composer",
|
|
5146
5317
|
"data-composer-action": Me.value,
|
|
5147
|
-
class:
|
|
5318
|
+
class: T(["w-full cursor-text rounded-2xl px-4 pb-2.5 pt-3 transition-colors duration-200", [e.centered ? "max-w-[720px] mx-auto @lg/chat:pb-5 @lg/chat:pt-5" : "", K.value ? "bg-white shadow-[0_1px_2px_rgba(15,23,42,0.05),0_8px_24px_rgba(15,23,42,0.05)] ring-1 ring-theme-200 hover:ring-theme-300 focus-within:ring-theme-300" : "bg-white/10 backdrop-blur-xl ring-1 ring-white/15 hover:ring-white/25 focus-within:bg-white/15 focus-within:ring-white/25"]]),
|
|
5148
5319
|
onClick: focusComposer
|
|
5149
|
-
}, [
|
|
5320
|
+
}, [Be.value ? (A(), _("div", {
|
|
5150
5321
|
key: 1,
|
|
5151
5322
|
"data-test": "messaging-recording-state",
|
|
5152
|
-
class:
|
|
5323
|
+
class: T(["flex min-w-0 items-center gap-2 py-1", K.value ? "text-theme-700" : "text-white/80"])
|
|
5153
5324
|
}, [
|
|
5154
|
-
o[
|
|
5155
|
-
v("span",
|
|
5156
|
-
v("span", { class:
|
|
5157
|
-
], 2)) :
|
|
5325
|
+
o[29] || (o[29] = v("span", { class: "size-2.5 shrink-0 rounded-full bg-red-500" }, null, -1)),
|
|
5326
|
+
v("span", ea, F(Ve.value), 1),
|
|
5327
|
+
v("span", { class: T(["min-w-0 truncate text-sm", K.value ? "text-theme-400" : "text-white/45"]) }, F(He.value), 3)
|
|
5328
|
+
], 2)) : ue((A(), _("textarea", {
|
|
5158
5329
|
key: 0,
|
|
5159
5330
|
ref_key: "textarea",
|
|
5160
5331
|
ref: i,
|
|
5161
|
-
"onUpdate:modelValue": o[6] || (o[6] = (e) =>
|
|
5332
|
+
"onUpdate:modelValue": o[6] || (o[6] = (e) => Te.value = e),
|
|
5162
5333
|
"data-test": "messaging-input",
|
|
5163
5334
|
rows: "1",
|
|
5164
5335
|
enterkeyhint: "send",
|
|
@@ -5167,82 +5338,119 @@ var kr = [
|
|
|
5167
5338
|
autocapitalize: "sentences",
|
|
5168
5339
|
autocorrect: "on",
|
|
5169
5340
|
spellcheck: "true",
|
|
5170
|
-
placeholder:
|
|
5171
|
-
disabled:
|
|
5341
|
+
placeholder: Ce.value,
|
|
5342
|
+
disabled: Se.value,
|
|
5172
5343
|
style: {
|
|
5173
5344
|
fontSize: "16px",
|
|
5174
5345
|
resize: "none"
|
|
5175
5346
|
},
|
|
5176
|
-
class:
|
|
5347
|
+
class: T(["block w-full bg-transparent leading-snug focus:outline-none disabled:opacity-50 overflow-y-auto [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden", K.value ? "text-theme-900 placeholder-theme-400" : "text-white placeholder-white/50"]),
|
|
5177
5348
|
onKeydown: handleKeydown
|
|
5178
|
-
}, null, 42,
|
|
5349
|
+
}, null, 42, $i)), [[se, Te.value]]), v("div", ta, [
|
|
5179
5350
|
v("button", {
|
|
5180
|
-
class:
|
|
5181
|
-
|
|
5351
|
+
class: T(["-ml-2 flex size-11 items-center justify-center transition-opacity hover:opacity-70", [
|
|
5352
|
+
Ae.value ? "cursor-pointer" : "cursor-default",
|
|
5182
5353
|
K.value ? "text-theme-500" : "text-white/50",
|
|
5183
|
-
|
|
5354
|
+
De.value || ke.value ? "opacity-50 pointer-events-none" : ""
|
|
5184
5355
|
]]),
|
|
5185
|
-
disabled:
|
|
5186
|
-
"aria-label":
|
|
5187
|
-
title:
|
|
5188
|
-
onClick: o[7] || (o[7] = (e) =>
|
|
5189
|
-
}, [
|
|
5190
|
-
o[
|
|
5191
|
-
v("div",
|
|
5356
|
+
disabled: Se.value || De.value || ke.value || !Ae.value,
|
|
5357
|
+
"aria-label": Ae.value ? "Attach file" : "File attachments unavailable",
|
|
5358
|
+
title: Ae.value ? "Attach file" : "File attachments unavailable",
|
|
5359
|
+
onClick: o[7] || (o[7] = (e) => Ae.value && triggerFileInput())
|
|
5360
|
+
}, [De.value ? (A(), _("i", ra)) : (A(), _("i", ia)), v("span", aa, F(Ae.value ? "Attach file" : "File attachments unavailable"), 1)], 10, na),
|
|
5361
|
+
o[33] || (o[33] = v("div", { class: "flex-1" }, null, -1)),
|
|
5362
|
+
v("div", oa, [(Re.value || Be.value) && !We.value ? (A(), _("button", {
|
|
5192
5363
|
key: 0,
|
|
5193
5364
|
"data-test": "messaging-record-audio-btn",
|
|
5194
|
-
class:
|
|
5195
|
-
"aria-label":
|
|
5196
|
-
title:
|
|
5197
|
-
onPointerdown: o[8] || (o[8] =
|
|
5198
|
-
onPointerup: o[9] || (o[9] =
|
|
5199
|
-
onPointercancel: o[10] || (o[10] =
|
|
5365
|
+
class: T(["flex size-11 cursor-pointer items-center justify-center transition-[opacity,transform] duration-200 hover:opacity-70", Be.value ? K.value ? "text-theme-900 scale-110" : "text-white scale-110" : K.value ? "text-theme-500" : "text-white/60"]),
|
|
5366
|
+
"aria-label": Ue.value,
|
|
5367
|
+
title: Ue.value,
|
|
5368
|
+
onPointerdown: o[8] || (o[8] = pe((e) => startRecording(), ["prevent"])),
|
|
5369
|
+
onPointerup: o[9] || (o[9] = pe((e) => finishRecording({ cancelled: !1 }), ["prevent"])),
|
|
5370
|
+
onPointercancel: o[10] || (o[10] = pe((e) => finishRecording({ cancelled: !0 }), ["prevent"])),
|
|
5200
5371
|
onKeydown: [
|
|
5201
|
-
o[11] || (o[11] =
|
|
5202
|
-
o[13] || (o[13] =
|
|
5203
|
-
o[15] || (o[15] =
|
|
5372
|
+
o[11] || (o[11] = de(pe((e) => startRecording(), ["prevent"]), ["enter"])),
|
|
5373
|
+
o[13] || (o[13] = de(pe((e) => startRecording(), ["prevent"]), ["space"])),
|
|
5374
|
+
o[15] || (o[15] = de(pe((e) => finishRecording({ cancelled: !0 }), ["prevent"]), ["escape"]))
|
|
5204
5375
|
],
|
|
5205
|
-
onKeyup: [o[12] || (o[12] =
|
|
5206
|
-
}, [v("i", { class:
|
|
5376
|
+
onKeyup: [o[12] || (o[12] = de(pe((e) => finishRecording({ cancelled: !1 }), ["prevent"]), ["enter"])), o[14] || (o[14] = de(pe((e) => finishRecording({ cancelled: !1 }), ["prevent"]), ["space"]))]
|
|
5377
|
+
}, [v("i", { class: T([Be.value ? "i-tabler-microphone-filled" : "i-tabler-microphone", "size-[18px]"]) }, null, 2), v("span", ca, F(Ue.value), 1)], 42, sa)) : h("", !0), We.value ? (A(), _("button", {
|
|
5207
5378
|
key: 1,
|
|
5379
|
+
"data-test": "messaging-voice-end-btn",
|
|
5380
|
+
class: "flex size-11 cursor-pointer items-center justify-center rounded-full bg-red-600 text-white transition-colors duration-150 hover:bg-red-700",
|
|
5381
|
+
"aria-label": "End voice conversation",
|
|
5382
|
+
title: "End voice conversation",
|
|
5383
|
+
onClick: o[16] || (o[16] = (e) => endVoiceConversation())
|
|
5384
|
+
}, [...o[30] || (o[30] = [v("i", {
|
|
5385
|
+
class: "i-tabler-x size-[18px]",
|
|
5386
|
+
"aria-hidden": "true"
|
|
5387
|
+
}, null, -1), v("span", { class: "sr-only" }, "End voice conversation", -1)])])) : Ke.value ? (A(), _("button", {
|
|
5388
|
+
key: 2,
|
|
5389
|
+
"data-test": "messaging-voice-start-btn",
|
|
5390
|
+
class: T(["flex size-11 items-center justify-center rounded-full transition-colors duration-150", [K.value ? "bg-theme-900 text-theme-0 hover:bg-theme-800" : "bg-theme-0 text-theme-950 hover:bg-theme-100", qe.value ? "cursor-not-allowed opacity-40" : "cursor-pointer"]]),
|
|
5391
|
+
disabled: qe.value,
|
|
5392
|
+
"aria-label": Ye.value,
|
|
5393
|
+
title: Ye.value,
|
|
5394
|
+
onClick: o[17] || (o[17] = (e) => startVoiceConversation())
|
|
5395
|
+
}, [v("span", ua, [(A(), _(f, null, M([
|
|
5396
|
+
7,
|
|
5397
|
+
13,
|
|
5398
|
+
16,
|
|
5399
|
+
11,
|
|
5400
|
+
14
|
|
5401
|
+
], (e) => v("span", {
|
|
5402
|
+
key: e,
|
|
5403
|
+
class: "w-[2px] rounded-full bg-current",
|
|
5404
|
+
style: k({ height: `${e}px` })
|
|
5405
|
+
}, null, 4)), 64))]), o[31] || (o[31] = v("span", { class: "sr-only" }, "Start voice conversation", -1))], 10, la)) : Be.value ? h("", !0) : (A(), _(f, { key: 3 }, [Fe.value ? (A(), _("button", {
|
|
5406
|
+
key: 0,
|
|
5407
|
+
"data-test": "messaging-secondary-stop-btn",
|
|
5408
|
+
class: T(["mr-2 flex size-11 cursor-pointer items-center justify-center rounded-full transition-colors duration-150", K.value ? "bg-theme-100 text-theme-700 hover:bg-theme-200" : "bg-white/10 text-white/70 hover:bg-white/15"]),
|
|
5409
|
+
"aria-label": "Stop work",
|
|
5410
|
+
title: "Stop work",
|
|
5411
|
+
onClick: o[18] || (o[18] = (t) => e.chatController?.stopChatTurn())
|
|
5412
|
+
}, [...o[32] || (o[32] = [v("i", {
|
|
5413
|
+
class: "i-tabler-player-stop-filled size-3.5",
|
|
5414
|
+
"aria-hidden": "true"
|
|
5415
|
+
}, null, -1), v("span", { class: "sr-only" }, "Stop work", -1)])], 2)) : h("", !0), v("button", {
|
|
5208
5416
|
"data-test": "messaging-send-btn",
|
|
5209
5417
|
"data-composer-action": Me.value,
|
|
5210
|
-
class:
|
|
5418
|
+
class: T(["flex size-11 items-center justify-center rounded-full transition-colors duration-150", Ne.value ? K.value ? "bg-theme-900 text-theme-0 hover:bg-theme-800 cursor-pointer" : "bg-theme-0 text-theme-950 hover:bg-theme-100 cursor-pointer" : K.value ? "bg-theme-100 text-theme-400" : "bg-white/10 text-white/30"]),
|
|
5211
5419
|
disabled: !Ne.value,
|
|
5212
|
-
"aria-label":
|
|
5213
|
-
title:
|
|
5214
|
-
onClick: o[
|
|
5215
|
-
}, [Me.value === "stop" ? (
|
|
5216
|
-
])], 10,
|
|
5217
|
-
K.value && e.centered && e.scope === "private" ? (
|
|
5218
|
-
|
|
5420
|
+
"aria-label": Le.value,
|
|
5421
|
+
title: Le.value,
|
|
5422
|
+
onClick: o[19] || (o[19] = (e) => handleComposerAction())
|
|
5423
|
+
}, [Me.value === "stop" ? (A(), _("i", fa)) : (A(), _("i", pa)), v("span", ma, F(Le.value), 1)], 10, da)], 64))])
|
|
5424
|
+
])], 10, Qi),
|
|
5425
|
+
K.value && e.centered && e.scope === "private" ? (A(), _("div", ha, F(e.agent.displayName.value) + " is AI and can make mistakes. ", 1)) : h("", !0),
|
|
5426
|
+
!We.value && R.value.length === 0 && e.suggestedPrompts.length > 0 ? (A(), _("div", ga, [v("div", _a, [(A(!0), _(f, null, M(e.suggestedPrompts, (e, t) => (A(), _("button", {
|
|
5219
5427
|
key: e.id,
|
|
5220
5428
|
type: "button",
|
|
5221
|
-
disabled:
|
|
5429
|
+
disabled: Se.value,
|
|
5222
5430
|
"data-test": "messaging-suggested-prompt",
|
|
5223
|
-
class:
|
|
5431
|
+
class: T(["w-full rounded-2xl bg-theme-50 px-4 py-3 text-left text-[14.5px] font-medium transition-colors sm:w-auto sm:rounded-full sm:py-2 sm:text-center sm:text-[14px]", [Se.value ? "cursor-not-allowed text-theme-300" : "cursor-pointer text-theme-600 hover:bg-theme-100 hover:text-theme-900", !te.value && t >= 3 ? "max-sm:hidden" : ""]]),
|
|
5224
5432
|
onClick: (t) => sendSuggestedPrompt(e)
|
|
5225
|
-
},
|
|
5433
|
+
}, F(e.label), 11, va))), 128)), e.suggestedPrompts.length > 3 ? (A(), _("button", {
|
|
5226
5434
|
key: 0,
|
|
5227
5435
|
type: "button",
|
|
5228
5436
|
"data-test": "messaging-suggested-prompts-more",
|
|
5229
|
-
"aria-expanded":
|
|
5437
|
+
"aria-expanded": te.value,
|
|
5230
5438
|
class: "flex w-full cursor-pointer items-center justify-center gap-1.5 rounded-2xl px-4 py-3 text-[14px] font-medium text-theme-600 ring-1 ring-theme-200 transition-colors hover:bg-theme-50 hover:text-theme-900 sm:hidden",
|
|
5231
|
-
onClick: o[
|
|
5232
|
-
}, [
|
|
5439
|
+
onClick: o[20] || (o[20] = (e) => te.value = !te.value)
|
|
5440
|
+
}, [b(F(te.value ? "See less" : "See more") + " ", 1), v("i", { class: T(["i-tabler-chevron-down size-4 transition-transform", te.value ? "rotate-180" : ""]) }, null, 2)], 8, ya)) : h("", !0)])])) : h("", !0)
|
|
5233
5441
|
], 2)
|
|
5234
5442
|
], 2));
|
|
5235
5443
|
}
|
|
5236
|
-
}),
|
|
5444
|
+
}), xa = { class: "agent-wrap" }, Sa = {
|
|
5237
5445
|
key: 0,
|
|
5238
5446
|
class: "flex items-center justify-center h-full"
|
|
5239
|
-
},
|
|
5447
|
+
}, Ca = {
|
|
5240
5448
|
key: 2,
|
|
5241
5449
|
class: "flex h-full flex-col items-center justify-center gap-4 px-6 text-center",
|
|
5242
5450
|
role: "status",
|
|
5243
5451
|
"aria-live": "polite",
|
|
5244
5452
|
"data-test": "agent-unavailable"
|
|
5245
|
-
},
|
|
5453
|
+
}, wa = /* @__PURE__ */ S({
|
|
5246
5454
|
__name: "AgentWrap",
|
|
5247
5455
|
props: {
|
|
5248
5456
|
sdk: {},
|
|
@@ -5262,7 +5470,7 @@ var kr = [
|
|
|
5262
5470
|
let r = a("AgentWrap"), i = e, o = i.sdk || t.getInstance({
|
|
5263
5471
|
isDev: typeof window < "u" ? window.location.hostname === "localhost" || window.location.hostname.includes("127.0.0.1") : !1,
|
|
5264
5472
|
...i.apiBase && { apiBase: i.apiBase }
|
|
5265
|
-
}), s =
|
|
5473
|
+
}), s = ae(!i.agent), c = ae(i.agent ? new n({ config: i.agent }) : void 0), u = ae();
|
|
5266
5474
|
async function loadAgent() {
|
|
5267
5475
|
if (i.agent) {
|
|
5268
5476
|
r.debug("Agent provided via props, skipping fetch", {
|
|
@@ -5338,15 +5546,15 @@ var kr = [
|
|
|
5338
5546
|
});
|
|
5339
5547
|
}
|
|
5340
5548
|
}
|
|
5341
|
-
return
|
|
5342
|
-
sdk:
|
|
5549
|
+
return ne(loadAgent), (t, n) => (A(), _("div", xa, [s.value ? (A(), _("div", Sa, [v("div", { class: T(["size-6 animate-spin rounded-full border-b-2", i.bare ? "border-theme-400" : "border-white"]) }, null, 2)])) : c.value ? ie(t.$slots, "default", {
|
|
5550
|
+
sdk: oe(o),
|
|
5343
5551
|
agent: c.value,
|
|
5344
5552
|
context: e.clientContext ?? e.context,
|
|
5345
5553
|
firstMessage: e.firstMessage,
|
|
5346
5554
|
buttonText: e.buttonText,
|
|
5347
5555
|
buttonIcon: e.buttonIcon,
|
|
5348
5556
|
loading: s.value
|
|
5349
|
-
}, void 0, void 0, 1) : u.value ? (
|
|
5557
|
+
}, void 0, void 0, 1) : u.value ? (A(), _("div", Ca, [n[0] || (n[0] = v("p", { class: "text-sm font-medium text-theme-600" }, " This assistant is unavailable right now. ", -1)), v("button", {
|
|
5350
5558
|
type: "button",
|
|
5351
5559
|
class: "min-h-11 rounded-full bg-theme-900 px-5 text-sm font-semibold text-theme-0 transition-colors hover:bg-theme-700",
|
|
5352
5560
|
"data-test": "agent-unavailable-retry",
|
|
@@ -5355,6 +5563,6 @@ var kr = [
|
|
|
5355
5563
|
}
|
|
5356
5564
|
});
|
|
5357
5565
|
//#endregion
|
|
5358
|
-
export {
|
|
5566
|
+
export { Pe as a, we as c, parseButtonTemplate as d, AgentChatController as f, he as h, ai as i, getAgentAvatarUrl as l, n as m, ba as n, Oe as o, _e as p, _i as r, Ee as s, wa as t, handleImageError as u };
|
|
5359
5567
|
|
|
5360
5568
|
//# sourceMappingURL=AgentWrap.js.map
|