@pluno/product-agent-web 0.1.150 → 0.1.151
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/index.d.ts +3 -0
- package/dist/product-agent-sdk.js +378 -371
- package/dist/product-agent-widget.js +723 -716
- package/package.json +1 -1
|
@@ -196,7 +196,7 @@ function Ca(t, e, n, i) {
|
|
|
196
196
|
const gi = "pluno.productAgent.transportId", ka = "pluno.productAgent.transportIdentity", hi = "pluno.productAgent.transportIdentity.event", Aa = 50, Ra = globalThis.setTimeout.bind(globalThis);
|
|
197
197
|
let Bt = null;
|
|
198
198
|
const En = /* @__PURE__ */ new Set(), fi = /* @__PURE__ */ new Map();
|
|
199
|
-
async function
|
|
199
|
+
async function Ma(t = Vr()) {
|
|
200
200
|
const e = t.randomUUID(), n = t.storage.getItem(gi);
|
|
201
201
|
let i = n ?? t.randomUUID(), o = !1, r = !1;
|
|
202
202
|
const s = t.channel.subscribe((p) => {
|
|
@@ -232,8 +232,8 @@ async function Pa(t = Vr()) {
|
|
|
232
232
|
}
|
|
233
233
|
};
|
|
234
234
|
}
|
|
235
|
-
async function
|
|
236
|
-
Bt || (Bt =
|
|
235
|
+
async function Pa() {
|
|
236
|
+
Bt || (Bt = Ma(Vr()), Bt.then((i) => {
|
|
237
237
|
const o = (r) => {
|
|
238
238
|
r.persisted || (i.release(), Bt = null, En.clear(), window.removeEventListener("pagehide", o));
|
|
239
239
|
};
|
|
@@ -352,7 +352,7 @@ function Ba(t) {
|
|
|
352
352
|
const n = e;
|
|
353
353
|
return n.ok !== !0 || n.toolName !== Xr || typeof n.dueAt != "string" || Number.isNaN(Date.parse(n.dueAt)) ? null : n.dueAt;
|
|
354
354
|
}
|
|
355
|
-
function
|
|
355
|
+
function Mn(t, e = /* @__PURE__ */ new Date()) {
|
|
356
356
|
const n = new Date(t), i = n.getTime() - e.getTime();
|
|
357
357
|
if (!Number.isFinite(i) || i <= 0)
|
|
358
358
|
return null;
|
|
@@ -373,21 +373,21 @@ function Pn(t, e = /* @__PURE__ */ new Date()) {
|
|
|
373
373
|
day: "numeric"
|
|
374
374
|
})} ${r}`;
|
|
375
375
|
}
|
|
376
|
-
function
|
|
377
|
-
const n =
|
|
376
|
+
function Fa(t, e = /* @__PURE__ */ new Date()) {
|
|
377
|
+
const n = Mn(t, e), i = Date.parse(t) - e.getTime();
|
|
378
378
|
if (!n || !Number.isFinite(i) || i <= 0)
|
|
379
379
|
return null;
|
|
380
380
|
let o = 1, r = 0, s = Math.ceil(i);
|
|
381
381
|
for (; o < s; ) {
|
|
382
382
|
const l = Math.floor((o + s) / 2);
|
|
383
|
-
|
|
383
|
+
Mn(
|
|
384
384
|
t,
|
|
385
385
|
new Date(e.getTime() + l)
|
|
386
386
|
) === n ? (r = l, o = l + 1) : s = l;
|
|
387
387
|
}
|
|
388
388
|
return Math.max(1, r + 1);
|
|
389
389
|
}
|
|
390
|
-
const
|
|
390
|
+
const qa = globalThis.fetch.bind(globalThis), Di = '.pluno-pa-widget-host[data-pluno-product-agent-ui="widget"]', Wa = '.pluno-pa-widget[data-pluno-product-agent-ui-root="widget"]', Ha = ".pluno-pa-widget__panel", $a = ".pluno-pa-widget__timeline", Go = `${Di}[data-pluno-sdk-preview-channel]`;
|
|
391
391
|
let ja = 0;
|
|
392
392
|
function Ko(t) {
|
|
393
393
|
const e = {};
|
|
@@ -421,18 +421,18 @@ function mi(t, e, n) {
|
|
|
421
421
|
};
|
|
422
422
|
window.dispatchEvent(new CustomEvent("product-agent:trace", { detail: o }));
|
|
423
423
|
}
|
|
424
|
-
const Ga = "https://app.pluno.ai", Ka = "gpt-5.6-terra", Va = 2e4, Xa = 1e4, Ya = 1e4, Ja = 1e4, Za = 1e4, Qa = 1e3, Vo = 3e4, Xo = 0.2, Yo = 6e4, el = 15e3, _n = 8, tl =
|
|
424
|
+
const Ga = "https://app.pluno.ai", Ka = "gpt-5.6-terra", Va = 2e4, Xa = 1e4, Ya = 1e4, Ja = 1e4, Za = 1e4, Qa = 1e3, Vo = 3e4, Xo = 0.2, Yo = 6e4, el = 15e3, _n = 8, tl = "Pluno could not finish this message. Try it again.", nl = "Browser connection was interrupted.", il = 15e3, ol = 2e3, rl = 1e3, sl = 100, Jo = 8e3, Zo = 3, al = [300, 1e3], no = 64e3, wi = 4e3, io = 30, ll = 2e3, pl = 1e3, Yr = "Image is too large for model vision input.", cl = 100, Jr = "pluno.productAgent.state.", Ui = "pluno.productAgent.pendingEvents.", Bn = "pluno.productAgent.activeToolCalls.", dl = 100;
|
|
425
425
|
function yn(t, e = 0) {
|
|
426
426
|
const n = t === 0 ? 0 : Math.min(3e4, 1e3 * 2 ** (t - 1));
|
|
427
427
|
return Math.max(e, n);
|
|
428
428
|
}
|
|
429
429
|
const Cn = /* @__PURE__ */ new Set();
|
|
430
430
|
let xn = null;
|
|
431
|
-
function
|
|
431
|
+
function ul(t, e = Math.random) {
|
|
432
432
|
const n = Math.min(Vo, Qa * 2 ** t), i = 1 - Xo + e() * Xo * 2;
|
|
433
433
|
return Math.min(Vo, Math.round(n * i));
|
|
434
434
|
}
|
|
435
|
-
function
|
|
435
|
+
function gl(t, e, n) {
|
|
436
436
|
return new Promise((i, o) => {
|
|
437
437
|
const r = setTimeout(() => o(new Error(n)), e);
|
|
438
438
|
t.then(
|
|
@@ -449,9 +449,9 @@ class oo {
|
|
|
449
449
|
constructor(e, n) {
|
|
450
450
|
this.options = e, this.transportIdentity = n, this.state = {
|
|
451
451
|
...this.state,
|
|
452
|
-
starterPrompts:
|
|
452
|
+
starterPrompts: Kl(e.initialStarterPrompts)
|
|
453
453
|
};
|
|
454
|
-
const i = e.restorePersistedState === !1 ? null :
|
|
454
|
+
const i = e.restorePersistedState === !1 ? null : Dp(e.clientId, e.expectedPersistedSessionId);
|
|
455
455
|
i && (this.state = {
|
|
456
456
|
...this.state,
|
|
457
457
|
...i,
|
|
@@ -464,10 +464,10 @@ class oo {
|
|
|
464
464
|
assistantDraftRunId: null,
|
|
465
465
|
isThinking: !1,
|
|
466
466
|
lastError: null
|
|
467
|
-
}), this.queuedClientEvents =
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
),
|
|
467
|
+
}), this.queuedClientEvents = Wp(
|
|
468
|
+
Op(e.clientId),
|
|
469
|
+
Bp(e.clientId)
|
|
470
|
+
), qt(e.clientId, this.queuedClientEvents);
|
|
471
471
|
}
|
|
472
472
|
options;
|
|
473
473
|
listeners = {};
|
|
@@ -504,6 +504,7 @@ class oo {
|
|
|
504
504
|
runAckResyncRetryTimer = null;
|
|
505
505
|
activeClientMessageId = null;
|
|
506
506
|
activeUserMessageEvent = null;
|
|
507
|
+
browserConnectionInterruptedClientMessageIds = /* @__PURE__ */ new Set();
|
|
507
508
|
latestRecoverableClientMessageId = null;
|
|
508
509
|
lastUserMessagePageUrl = null;
|
|
509
510
|
thinkingWatchdogResyncAttemptsByClientMessageId = {};
|
|
@@ -541,12 +542,12 @@ class oo {
|
|
|
541
542
|
lastErrorSecuritySettingsUrl: null
|
|
542
543
|
};
|
|
543
544
|
static async init(e) {
|
|
544
|
-
const n = await
|
|
545
|
+
const n = await Pa(), i = new oo({
|
|
545
546
|
...e,
|
|
546
|
-
backendUrl:
|
|
547
|
-
clientId: e.clientId ??
|
|
547
|
+
backendUrl: Ll(e.backendUrl ?? Ga),
|
|
548
|
+
clientId: e.clientId ?? Zl(),
|
|
548
549
|
model: e.model ?? Ka,
|
|
549
|
-
entrySurface:
|
|
550
|
+
entrySurface: Nl(e.entrySurface)
|
|
550
551
|
}, n);
|
|
551
552
|
try {
|
|
552
553
|
fa().catch((o) => {
|
|
@@ -580,11 +581,11 @@ class oo {
|
|
|
580
581
|
this.state.status === "reconnecting" ? { status: "reconnecting" } : { status: "connecting", lastError: null }
|
|
581
582
|
);
|
|
582
583
|
try {
|
|
583
|
-
if (this.token = this.options.token ?? (this.options.tokenProvider ? await
|
|
584
|
+
if (this.token = this.options.token ?? (this.options.tokenProvider ? await gl(this.options.tokenProvider(), Ya, "Pluno token provider timed out") : null), e !== this.connectionAttemptId || this.state.status === "closed")
|
|
584
585
|
return;
|
|
585
586
|
if (!this.token && !this.options.webSocketFactory)
|
|
586
587
|
throw new Error("Pluno requires a token or tokenProvider");
|
|
587
|
-
const n =
|
|
588
|
+
const n = Ul(this.options.backendUrl), i = this.options.webSocketFactory?.(n) ?? new WebSocket(n);
|
|
588
589
|
this.socket = i, this.socketConnectTimer = window.setTimeout(() => {
|
|
589
590
|
this.socket === i && i.readyState === WebSocket.CONNECTING && (Z("web-sdk.agent", "Pluno socket opening timed out; reconnecting"), this.replaceTimedOutSocket(i));
|
|
590
591
|
}, Ja), i.addEventListener("open", () => {
|
|
@@ -601,9 +602,9 @@ class oo {
|
|
|
601
602
|
this.socket === i && (Z("web-sdk.agent", "Pluno socket authentication timed out; reconnecting"), this.replaceTimedOutSocket(i));
|
|
602
603
|
}, Za));
|
|
603
604
|
}), i.addEventListener("message", (o) => {
|
|
604
|
-
this.socket === i && this.handleServerEvent(
|
|
605
|
+
this.socket === i && this.handleServerEvent(Gl(o.data));
|
|
605
606
|
}), i.addEventListener("close", (o) => {
|
|
606
|
-
this.socket === i && (this.clearSocketPhaseTimers(), this.stopHeartbeat(), this.socket = null, this.state.status !== "closed" && (Z("web-sdk.agent", "Pluno socket closed; scheduling reconnect", {
|
|
607
|
+
this.socket === i && (this.clearSocketPhaseTimers(), this.stopHeartbeat(), this.socket = null, this.state.status !== "closed" && (this.rememberBrowserConnectionInterruptionForActiveRun(), Z("web-sdk.agent", "Pluno socket closed; scheduling reconnect", {
|
|
607
608
|
code: typeof o?.code == "number" ? o.code : null,
|
|
608
609
|
reason: typeof o?.reason == "string" ? o.reason : "",
|
|
609
610
|
wasClean: typeof o?.wasClean == "boolean" ? o.wasClean : null,
|
|
@@ -614,7 +615,7 @@ class oo {
|
|
|
614
615
|
this.socket !== i || this.state.status === "closed" || (Z("web-sdk.agent", "Pluno socket error; scheduling reconnect", {
|
|
615
616
|
queuedClientEventCount: this.queuedClientEvents.length,
|
|
616
617
|
isThinking: this.state.isThinking
|
|
617
|
-
}), this.clearSocketPhaseTimers(), this.stopHeartbeat(), this.socket = null, this.setReconnectingState(), this.scheduleReconnect(), i.readyState !== WebSocket.CLOSED && i.readyState !== WebSocket.CLOSING && i.close());
|
|
618
|
+
}), this.clearSocketPhaseTimers(), this.stopHeartbeat(), this.socket = null, this.rememberBrowserConnectionInterruptionForActiveRun(), this.setReconnectingState(), this.scheduleReconnect(), i.readyState !== WebSocket.CLOSED && i.readyState !== WebSocket.CLOSING && i.close());
|
|
618
619
|
});
|
|
619
620
|
} catch (n) {
|
|
620
621
|
if (e === this.connectionAttemptId && this.state.status !== "closed") {
|
|
@@ -634,7 +635,7 @@ class oo {
|
|
|
634
635
|
this.connectionAttemptId += 1, this.setState({ status: "closed", isThinking: !1 }), this.clearSocketPhaseTimers(), this.stopHeartbeat(), this.clearStarterPromptUrlRefreshTimer(), this.clearRetryTimers(), this.clearThinkingWatchdog(), this.rejectPendingSessionHistoryRequests("Pluno disconnected."), this.rejectPendingSessionMutationRequests(this.pendingSessionPinRequests, "Pluno disconnected."), this.rejectPendingSessionMutationRequests(this.pendingSessionRenameRequests, "Pluno disconnected."), this.reconnectTimer !== null && (window.clearTimeout(this.reconnectTimer), this.reconnectTimer = null), this.queuedClientEvents = [], this.pendingWarmupEvent = null, this.nonTranscriptToolCallIds.clear(), this.socket?.close(), this.socket = null;
|
|
635
636
|
}
|
|
636
637
|
destroy() {
|
|
637
|
-
this.disconnect(), this.locationChangeCleanup?.(), this.locationChangeCleanup = null, this.cleanupSessionUserFilesApi(), this.pageLifecycleCleanup?.(), this.pageLifecycleCleanup = null, this.activeBrowserToolCalls.clear(),
|
|
638
|
+
this.disconnect(), this.locationChangeCleanup?.(), this.locationChangeCleanup = null, this.cleanupSessionUserFilesApi(), this.pageLifecycleCleanup?.(), this.pageLifecycleCleanup = null, this.activeBrowserToolCalls.clear(), Hp(this.options.clientId), this.transportIdentity.release(), this.networkCaptureCleanup?.(), this.networkCaptureCleanup = null, this.networkBatchTimer !== null && (window.clearTimeout(this.networkBatchTimer), this.networkBatchTimer = null), this.queuedNetworkEvents = [];
|
|
638
639
|
for (const e of Object.values(this.listeners))
|
|
639
640
|
e?.clear();
|
|
640
641
|
}
|
|
@@ -653,7 +654,7 @@ class oo {
|
|
|
653
654
|
let r = o.map(lo);
|
|
654
655
|
if (!i && r.length === 0)
|
|
655
656
|
return null;
|
|
656
|
-
const s = Ce(), l = n.clientMessageId ??
|
|
657
|
+
const s = Ce(), l = n.clientMessageId ?? Ft(), p = {
|
|
657
658
|
id: `local-${l}`,
|
|
658
659
|
role: "user",
|
|
659
660
|
content: i,
|
|
@@ -704,7 +705,7 @@ class oo {
|
|
|
704
705
|
sessionId: this.state.sessionId ?? void 0,
|
|
705
706
|
clientMessageId: l,
|
|
706
707
|
initiatedBy: n.initiatedBy,
|
|
707
|
-
invocation:
|
|
708
|
+
invocation: Dl(n.invocation ?? n.initiatedBy),
|
|
708
709
|
entrySurface: this.options.entrySurface,
|
|
709
710
|
content: i,
|
|
710
711
|
pageContent: w && ro() || void 0,
|
|
@@ -713,14 +714,14 @@ class oo {
|
|
|
713
714
|
model: this.options.model,
|
|
714
715
|
metadata: Qo(this.options.metadata)
|
|
715
716
|
};
|
|
716
|
-
return n.initiatedBy || (this.lastUserMessagePageUrl = s.url), this.activeClientMessageId = l, this.activeUserMessageEvent = m, this.markThinkingProgress(), this.send(m), l;
|
|
717
|
+
return n.initiatedBy || (this.lastUserMessagePageUrl = s.url), this.activeClientMessageId = l, this.activeUserMessageEvent = m, this.browserConnectionInterruptedClientMessageIds.delete(l), this.markThinkingProgress(), this.send(m), l;
|
|
717
718
|
}
|
|
718
719
|
retryLastMessage() {
|
|
719
720
|
const e = this.state.sessionId, n = this.retryableClientMessageId;
|
|
720
|
-
return !e || !n ? !1 : (this.retryAttemptsByClientMessageId[n] = 0, this.retryableClientMessageId = null, this.activeClientMessageId = n, this.latestRecoverableClientMessageId = n, this.setState({ status: "connected", isThinking: !0, lastError: null, lastErrorCode: null }), this.markThinkingProgress(), this.send({ type: "chat.retry_last_user_message", sessionId: e, clientMessageId: n, automatic: !1 }), !0);
|
|
721
|
+
return !e || !n ? !1 : (this.retryAttemptsByClientMessageId[n] = 0, this.retryableClientMessageId = null, this.activeClientMessageId = n, this.browserConnectionInterruptedClientMessageIds.delete(n), this.latestRecoverableClientMessageId = n, this.setState({ status: "connected", isThinking: !0, lastError: null, lastErrorCode: null }), this.markThinkingProgress(), this.send({ type: "chat.retry_last_user_message", sessionId: e, clientMessageId: n, automatic: !1 }), !0);
|
|
721
722
|
}
|
|
722
723
|
createLocalAttachment(e) {
|
|
723
|
-
const n =
|
|
724
|
+
const n = Ft(), i = {
|
|
724
725
|
id: n,
|
|
725
726
|
name: e.name || "attachment",
|
|
726
727
|
mimeType: pr(e),
|
|
@@ -824,7 +825,7 @@ class oo {
|
|
|
824
825
|
const i = await this.fetchEmbedAttachmentUpload(e);
|
|
825
826
|
if (i.ok)
|
|
826
827
|
return await i.json();
|
|
827
|
-
if (
|
|
828
|
+
if (rc(i.status) && this.options.tokenProvider && !n) {
|
|
828
829
|
n = !0;
|
|
829
830
|
const o = await this.fetchEmbedAttachmentUpload(e);
|
|
830
831
|
if (o.ok)
|
|
@@ -868,7 +869,7 @@ class oo {
|
|
|
868
869
|
});
|
|
869
870
|
}
|
|
870
871
|
listSessions(e = {}) {
|
|
871
|
-
const n =
|
|
872
|
+
const n = Ft(), i = new Promise((r, s) => {
|
|
872
873
|
const l = window.setTimeout(() => {
|
|
873
874
|
this.pendingSessionHistoryRequests.delete(n), s(new Error("Session history did not respond in time"));
|
|
874
875
|
}, Jo);
|
|
@@ -890,14 +891,14 @@ class oo {
|
|
|
890
891
|
setSessionPinned(e, n) {
|
|
891
892
|
return this.sendSessionMutation(
|
|
892
893
|
this.pendingSessionPinRequests,
|
|
893
|
-
{ type: "session.pin", requestId:
|
|
894
|
+
{ type: "session.pin", requestId: Ft(), sessionId: e, pinned: n },
|
|
894
895
|
"Session pin did not respond in time"
|
|
895
896
|
);
|
|
896
897
|
}
|
|
897
898
|
renameSession(e, n) {
|
|
898
899
|
return this.sendSessionMutation(
|
|
899
900
|
this.pendingSessionRenameRequests,
|
|
900
|
-
{ type: "session.rename", requestId:
|
|
901
|
+
{ type: "session.rename", requestId: Ft(), sessionId: e, title: n },
|
|
901
902
|
"Session rename did not respond in time"
|
|
902
903
|
);
|
|
903
904
|
}
|
|
@@ -919,7 +920,7 @@ class oo {
|
|
|
919
920
|
});
|
|
920
921
|
}
|
|
921
922
|
send(e) {
|
|
922
|
-
this.sendNow(Ae(e)) || (this.queuedClientEvents.push(e),
|
|
923
|
+
this.sendNow(Ae(e)) || (this.queuedClientEvents.push(e), qt(this.options.clientId, this.queuedClientEvents), this.setState({ status: "reconnecting" }), this.scheduleReconnect());
|
|
923
924
|
}
|
|
924
925
|
async getUploadToken() {
|
|
925
926
|
const e = this.options.token ?? await this.options.tokenProvider?.() ?? this.token ?? null;
|
|
@@ -945,7 +946,7 @@ class oo {
|
|
|
945
946
|
if (this.state.starterPromptsLoading || this.transientStarterPromptsRequestInFlight || this.transientStarterPromptsRequestAttempted)
|
|
946
947
|
return;
|
|
947
948
|
this.transientStarterPromptsRequestInFlight = !0, this.transientStarterPromptsRequestAttempted = !0, this.setState({ starterPromptsLoading: !0 });
|
|
948
|
-
const e =
|
|
949
|
+
const e = Ol();
|
|
949
950
|
this.sendNow(
|
|
950
951
|
Ae({
|
|
951
952
|
type: "starter_prompts.page_context",
|
|
@@ -956,13 +957,13 @@ class oo {
|
|
|
956
957
|
) || (this.transientStarterPromptsRequestInFlight = !1, this.transientStarterPromptsRequestAttempted = !1, this.setState({ starterPromptsLoading: !1 }));
|
|
957
958
|
}
|
|
958
959
|
startStarterPromptUrlWatcher() {
|
|
959
|
-
this.locationChangeCleanup || (this.locationChangeCleanup =
|
|
960
|
+
this.locationChangeCleanup || (this.locationChangeCleanup = zl(() => this.handleStarterPromptUrlChange()));
|
|
960
961
|
}
|
|
961
962
|
handleStarterPromptUrlChange() {
|
|
962
963
|
const e = location.href;
|
|
963
964
|
e !== this.lastStarterPromptPageUrl && (this.lastStarterPromptPageUrl = e, this.clearStarterPromptUrlRefreshTimer(), this.starterPromptUrlRefreshTimer = window.setTimeout(() => {
|
|
964
965
|
this.starterPromptUrlRefreshTimer = null, this.refreshStarterPromptsForCurrentUrl();
|
|
965
|
-
},
|
|
966
|
+
}, dl));
|
|
966
967
|
}
|
|
967
968
|
refreshStarterPromptsForCurrentUrl() {
|
|
968
969
|
this.socket?.readyState !== WebSocket.OPEN || this.state.status === "closed" || (this.setState({ starterPromptsLoading: this.state.messages.length === 0 }), this.sendNow({
|
|
@@ -977,14 +978,14 @@ class oo {
|
|
|
977
978
|
if (this.socket?.readyState !== WebSocket.OPEN || this.queuedClientEvents.length === 0)
|
|
978
979
|
return;
|
|
979
980
|
const e = this.queuedClientEvents.splice(0, this.queuedClientEvents.length);
|
|
980
|
-
|
|
981
|
+
qt(this.options.clientId, this.queuedClientEvents);
|
|
981
982
|
for (let n = 0; n < e.length; n += 1) {
|
|
982
983
|
const i = e[n];
|
|
983
984
|
if (!this.sendNow(Ae(i))) {
|
|
984
|
-
this.queuedClientEvents.unshift(i, ...e.slice(n + 1)),
|
|
985
|
+
this.queuedClientEvents.unshift(i, ...e.slice(n + 1)), qt(this.options.clientId, this.queuedClientEvents);
|
|
985
986
|
return;
|
|
986
987
|
}
|
|
987
|
-
|
|
988
|
+
qt(this.options.clientId, this.queuedClientEvents);
|
|
988
989
|
}
|
|
989
990
|
}
|
|
990
991
|
flushPendingWarmupEvent() {
|
|
@@ -1012,20 +1013,20 @@ class oo {
|
|
|
1012
1013
|
this.clearHeartbeatAckTimer();
|
|
1013
1014
|
return;
|
|
1014
1015
|
}
|
|
1015
|
-
if (
|
|
1016
|
+
if (ml(e) && this.markThinkingProgress(), e.type === "auth.ok") {
|
|
1016
1017
|
this.clearSocketAuthTimer(), this.reconnectAttempts = 0, this.flushQueuedClientEvents(), this.flushPendingWarmupEvent(), this.startHeartbeat();
|
|
1017
|
-
const n =
|
|
1018
|
+
const n = Vl(e), i = Object.prototype.hasOwnProperty.call(e, "appearance");
|
|
1018
1019
|
Z("web-sdk.agent", "Received auth.ok appearance", {
|
|
1019
1020
|
hasAppearance: i,
|
|
1020
1021
|
rawAppearance: e.appearance,
|
|
1021
1022
|
normalizedAppearance: n
|
|
1022
|
-
}), this.runtimeHelperJavascript =
|
|
1023
|
+
}), this.runtimeHelperJavascript = Xl(e.runtimeHelpers)?.javascript ?? null;
|
|
1023
1024
|
const o = nr(e, "starterPrompts"), r = Object.prototype.hasOwnProperty.call(e, "starterPrompts"), s = e.starterPromptsLoading === !0, l = {
|
|
1024
|
-
user:
|
|
1025
|
+
user: Ql(e.user),
|
|
1025
1026
|
status: "connected",
|
|
1026
1027
|
...this.state.lastErrorCode === "connection_failed" ? { lastError: null, lastErrorCode: null } : {}
|
|
1027
1028
|
};
|
|
1028
|
-
(r || this.state.starterPrompts.length === 0) && (l.starterPrompts = o, l.starterPromptsLoading = o.length > 0 ? !1 : s), r && o.length > 0 && (this.transientStarterPromptsRequestInFlight = !1, this.transientStarterPromptsRequestAttempted = !0), (i || n) && (l.appearance = n), this.setState(l), r && o.length === 0 && !s && !
|
|
1029
|
+
(r || this.state.starterPrompts.length === 0) && (l.starterPrompts = o, l.starterPromptsLoading = o.length > 0 ? !1 : s), r && o.length > 0 && (this.transientStarterPromptsRequestInFlight = !1, this.transientStarterPromptsRequestAttempted = !0), (i || n) && (l.appearance = n), this.setState(l), r && o.length === 0 && !s && !Fl() && this.requestTransientStarterPrompts(), this.state.sessionId && this.send({
|
|
1029
1030
|
type: "page.upsert",
|
|
1030
1031
|
sessionId: this.state.sessionId,
|
|
1031
1032
|
page: Ce(),
|
|
@@ -1041,13 +1042,13 @@ class oo {
|
|
|
1041
1042
|
return;
|
|
1042
1043
|
}
|
|
1043
1044
|
if (e.type === "conversation.state") {
|
|
1044
|
-
const n = Array.isArray(e.items) ? e.items : [], i =
|
|
1045
|
+
const n = Array.isArray(e.items) ? e.items : [], i = ap(
|
|
1045
1046
|
e.assistantDraft
|
|
1046
1047
|
), o = i !== void 0;
|
|
1047
1048
|
this.rememberUserMessageClientMessageIds(n);
|
|
1048
|
-
const r =
|
|
1049
|
+
const r = Sp(n);
|
|
1049
1050
|
if (r) {
|
|
1050
|
-
const u =
|
|
1051
|
+
const u = Ip(n, r);
|
|
1051
1052
|
this.retryAttemptsByClientMessageId[r] = Math.max(
|
|
1052
1053
|
this.retryAttemptsByClientMessageId[r] ?? 0,
|
|
1053
1054
|
u
|
|
@@ -1055,10 +1056,10 @@ class oo {
|
|
|
1055
1056
|
}
|
|
1056
1057
|
const s = n.filter((u) => {
|
|
1057
1058
|
const x = St(u);
|
|
1058
|
-
return !or(x) && (!r || !
|
|
1059
|
-
}), l =
|
|
1059
|
+
return !or(x) && (!r || !Fi(x));
|
|
1060
|
+
}), l = mp(
|
|
1060
1061
|
this.state.messages,
|
|
1061
|
-
|
|
1062
|
+
ep(s, this.options.backendUrl)
|
|
1062
1063
|
), p = ir(l), d = !o && n.some(
|
|
1063
1064
|
(u) => sr(
|
|
1064
1065
|
St(u),
|
|
@@ -1067,11 +1068,11 @@ class oo {
|
|
|
1067
1068
|
this.state.assistantDraftRespondsToUserMessageId,
|
|
1068
1069
|
this.state.assistantDraftRunId
|
|
1069
1070
|
)
|
|
1070
|
-
), g = o ? i?.content ?? "" : this.state.assistantDraft, c = !!i?.content, f = p && (!g || d), b =
|
|
1071
|
-
if (!p &&
|
|
1071
|
+
), g = o ? i?.content ?? "" : this.state.assistantDraft, c = !!i?.content, f = p && (!g || d), b = yp(l), w = f && b;
|
|
1072
|
+
if (!p && vp(this.state.messages, n))
|
|
1072
1073
|
return;
|
|
1073
|
-
this.lastUserMessagePageUrl =
|
|
1074
|
-
const m = f ? null :
|
|
1074
|
+
this.lastUserMessagePageUrl = xp(n);
|
|
1075
|
+
const m = f ? null : qi(n);
|
|
1075
1076
|
if (this.latestRecoverableClientMessageId = m, b && this.clearRetryTimers(), this.setState({
|
|
1076
1077
|
sessionId: de(e.session, "id") ?? this.state.sessionId,
|
|
1077
1078
|
messages: l,
|
|
@@ -1112,7 +1113,7 @@ class oo {
|
|
|
1112
1113
|
if (e.type === "sessions.page") {
|
|
1113
1114
|
const n = typeof e.requestId == "string" ? e.requestId : null, i = n ? this.pendingSessionHistoryRequests.get(n) : null;
|
|
1114
1115
|
n && i && (window.clearTimeout(i.timeout), this.pendingSessionHistoryRequests.delete(n), i.resolve({
|
|
1115
|
-
sessions:
|
|
1116
|
+
sessions: tp(e.sessions),
|
|
1116
1117
|
nextCursor: typeof e.nextCursor == "string" ? e.nextCursor : null
|
|
1117
1118
|
}));
|
|
1118
1119
|
return;
|
|
@@ -1132,7 +1133,7 @@ class oo {
|
|
|
1132
1133
|
if (e.type === "session.item") {
|
|
1133
1134
|
this.rememberUserMessageClientMessageIds([e.item]);
|
|
1134
1135
|
const n = St(e.item);
|
|
1135
|
-
if (
|
|
1136
|
+
if (Fi(n)) {
|
|
1136
1137
|
typeof n?.runId == "string" && this.retryableFailureRunIdsAwaitingDone.add(n.runId);
|
|
1137
1138
|
const o = de(e.item, "sessionId") ?? this.state.sessionId, r = n ? Qe(n) : null, s = r ? this.clientMessageIdsByUserMessageItemId.get(r) : null, l = typeof n?.clientMessageId == "string" ? n.clientMessageId : s ?? (r ? null : this.activeClientMessageId ?? this.latestRecoverableClientMessageId);
|
|
1138
1139
|
if (o && l) {
|
|
@@ -1151,7 +1152,7 @@ class oo {
|
|
|
1151
1152
|
const o = i.callId ? this.pendingToolLoadingByCallId.get(i.callId) : void 0;
|
|
1152
1153
|
i.callId && o !== void 0 && (i.loading = o, this.pendingToolLoadingByCallId.delete(i.callId)), tt(i) && (this.retryableClientMessageId = null, this.clearRetryTimers(), this.clearRunAckResyncRetryTimer());
|
|
1153
1154
|
const r = e.item.data;
|
|
1154
|
-
|
|
1155
|
+
Ep(r) && this.clearRunAckResyncRetryTimer();
|
|
1155
1156
|
const s = Oi(this.state.messages, i), l = ir(s), p = sr(
|
|
1156
1157
|
r,
|
|
1157
1158
|
this.state.assistantDraft,
|
|
@@ -1213,7 +1214,7 @@ class oo {
|
|
|
1213
1214
|
return;
|
|
1214
1215
|
const s = [...this.state.messages].reverse().find((d) => d.role === "user")?.id, l = !i || !s || i === s, p = Ca(
|
|
1215
1216
|
this.state.messages.filter(
|
|
1216
|
-
(d) => d.dataType !== "assistant_draft" || !
|
|
1217
|
+
(d) => d.dataType !== "assistant_draft" || !cp(
|
|
1217
1218
|
d,
|
|
1218
1219
|
i,
|
|
1219
1220
|
o
|
|
@@ -1225,7 +1226,7 @@ class oo {
|
|
|
1225
1226
|
);
|
|
1226
1227
|
this.setState({
|
|
1227
1228
|
sessionId: n,
|
|
1228
|
-
messages:
|
|
1229
|
+
messages: dp(
|
|
1229
1230
|
p,
|
|
1230
1231
|
typeof e.responseId == "string" ? e.responseId : null,
|
|
1231
1232
|
i,
|
|
@@ -1246,9 +1247,9 @@ class oo {
|
|
|
1246
1247
|
if (n)
|
|
1247
1248
|
this.nonTranscriptToolCallIds.add(n);
|
|
1248
1249
|
else {
|
|
1249
|
-
const i =
|
|
1250
|
+
const i = hp(e);
|
|
1250
1251
|
if (i) {
|
|
1251
|
-
const o =
|
|
1252
|
+
const o = up(
|
|
1252
1253
|
this.state.messages,
|
|
1253
1254
|
i
|
|
1254
1255
|
);
|
|
@@ -1304,7 +1305,7 @@ class oo {
|
|
|
1304
1305
|
}
|
|
1305
1306
|
}
|
|
1306
1307
|
shouldIgnoreBackgroundSessionEvent(e) {
|
|
1307
|
-
if (!this.options.keepRunsActiveOnSessionNavigation || !
|
|
1308
|
+
if (!this.options.keepRunsActiveOnSessionNavigation || !wl(e))
|
|
1308
1309
|
return !1;
|
|
1309
1310
|
const n = _i(e);
|
|
1310
1311
|
return n ? this.deferredSessionUpdatedSessionIds.has(n) ? !0 : this.state.sessionId ? n !== this.state.sessionId : this.backgroundSessionIds.has(n) : !1;
|
|
@@ -1351,7 +1352,7 @@ class oo {
|
|
|
1351
1352
|
if (i >= _n) {
|
|
1352
1353
|
this.retryableClientMessageId = n, this.setState({
|
|
1353
1354
|
isThinking: !1,
|
|
1354
|
-
lastError:
|
|
1355
|
+
lastError: this.getRunRecoveryExhaustedErrorMessage(n),
|
|
1355
1356
|
lastErrorCode: "run_recovery_exhausted"
|
|
1356
1357
|
}), this.clearThinkingWatchdog();
|
|
1357
1358
|
return;
|
|
@@ -1411,7 +1412,7 @@ class oo {
|
|
|
1411
1412
|
}, e);
|
|
1412
1413
|
}
|
|
1413
1414
|
clearThinkingWatchdog() {
|
|
1414
|
-
this.thinkingWatchdogTimer !== null && (window.clearTimeout(this.thinkingWatchdogTimer), this.thinkingWatchdogTimer = null), this.clearRunAckTimers(), this.activeClientMessageId = null, this.activeUserMessageEvent = null;
|
|
1415
|
+
this.thinkingWatchdogTimer !== null && (window.clearTimeout(this.thinkingWatchdogTimer), this.thinkingWatchdogTimer = null), this.clearRunAckTimers(), this.activeClientMessageId && this.browserConnectionInterruptedClientMessageIds.delete(this.activeClientMessageId), this.activeClientMessageId = null, this.activeUserMessageEvent = null;
|
|
1415
1416
|
}
|
|
1416
1417
|
handleRunAck(e) {
|
|
1417
1418
|
const n = typeof e.clientMessageId == "string" ? e.clientMessageId : null;
|
|
@@ -1423,7 +1424,7 @@ class oo {
|
|
|
1423
1424
|
handleRunSteered(e) {
|
|
1424
1425
|
const n = typeof e.respondsToUserMessageId == "string" ? e.respondsToUserMessageId : null;
|
|
1425
1426
|
!this.state.isThinking || !n || this.setState({
|
|
1426
|
-
messages:
|
|
1427
|
+
messages: kp(
|
|
1427
1428
|
this.state.messages,
|
|
1428
1429
|
n
|
|
1429
1430
|
)
|
|
@@ -1432,7 +1433,7 @@ class oo {
|
|
|
1432
1433
|
scheduleRunAckWatchdog(e) {
|
|
1433
1434
|
this.runAckWatchdogTimer !== null && window.clearTimeout(this.runAckWatchdogTimer), this.runAckWatchdogTimer = window.setTimeout(() => {
|
|
1434
1435
|
this.runAckWatchdogTimer = null, this.recoverMissedRunAck(e);
|
|
1435
|
-
},
|
|
1436
|
+
}, il);
|
|
1436
1437
|
}
|
|
1437
1438
|
recoverMissedRunAck(e) {
|
|
1438
1439
|
!this.state.isThinking || this.state.status === "closed" || this.activeClientMessageId !== e || (Z("web-sdk.agent", "Pluno run ack missed; resyncing session", {
|
|
@@ -1457,7 +1458,7 @@ class oo {
|
|
|
1457
1458
|
clientMessageId: e,
|
|
1458
1459
|
automatic: !0
|
|
1459
1460
|
}) : this.activeUserMessageEvent && this.send(this.activeUserMessageEvent), this.scheduleThinkingWatchdog(Yo)));
|
|
1460
|
-
}, yn(n,
|
|
1461
|
+
}, yn(n, ol)));
|
|
1461
1462
|
}
|
|
1462
1463
|
clearRunAckResyncRetryTimer() {
|
|
1463
1464
|
this.runAckResyncRetryTimer !== null && (window.clearTimeout(this.runAckResyncRetryTimer), this.runAckResyncRetryTimer = null);
|
|
@@ -1474,7 +1475,7 @@ class oo {
|
|
|
1474
1475
|
sessionId: this.state.sessionId
|
|
1475
1476
|
}), this.setState({
|
|
1476
1477
|
isThinking: !1,
|
|
1477
|
-
lastError:
|
|
1478
|
+
lastError: this.getRunRecoveryExhaustedErrorMessage(null),
|
|
1478
1479
|
lastErrorCode: "run_recovery_exhausted"
|
|
1479
1480
|
}), this.clearThinkingWatchdog();
|
|
1480
1481
|
return;
|
|
@@ -1486,7 +1487,7 @@ class oo {
|
|
|
1486
1487
|
clientMessageId: e
|
|
1487
1488
|
}), this.retryableClientMessageId = e, this.setState({
|
|
1488
1489
|
isThinking: !1,
|
|
1489
|
-
lastError:
|
|
1490
|
+
lastError: this.getRunRecoveryExhaustedErrorMessage(e),
|
|
1490
1491
|
lastErrorCode: "run_recovery_exhausted"
|
|
1491
1492
|
}), this.clearThinkingWatchdog();
|
|
1492
1493
|
return;
|
|
@@ -1531,7 +1532,7 @@ class oo {
|
|
|
1531
1532
|
if (!n || !i || !o)
|
|
1532
1533
|
return;
|
|
1533
1534
|
const l = o === "execute_code", p = o === "execute_code_in_browser_tab" && s !== null && typeof s == "object" && s.tabId === "local:current";
|
|
1534
|
-
if (!l && !p || !
|
|
1535
|
+
if (!l && !p || !Kp(s)) {
|
|
1535
1536
|
this.setToolMessageLoading(i, !1), this.send({
|
|
1536
1537
|
type: "tool.result",
|
|
1537
1538
|
sessionId: n,
|
|
@@ -1563,7 +1564,7 @@ class oo {
|
|
|
1563
1564
|
});
|
|
1564
1565
|
return;
|
|
1565
1566
|
}
|
|
1566
|
-
const d =
|
|
1567
|
+
const d = yl(this.state.messages);
|
|
1567
1568
|
this.activeBrowserToolCalls.set(i, {
|
|
1568
1569
|
event: {
|
|
1569
1570
|
type: "tool.result",
|
|
@@ -1581,7 +1582,7 @@ class oo {
|
|
|
1581
1582
|
let g = null, c;
|
|
1582
1583
|
g = await this.executeRuntimeHelper(), c = await er(
|
|
1583
1584
|
s,
|
|
1584
|
-
|
|
1585
|
+
Ml(e.runtimeContext, this.options.backendUrl)
|
|
1585
1586
|
).catch((f) => ({
|
|
1586
1587
|
ok: !1,
|
|
1587
1588
|
exception: {
|
|
@@ -1594,11 +1595,11 @@ class oo {
|
|
|
1594
1595
|
toolName: o,
|
|
1595
1596
|
summary: s.summary,
|
|
1596
1597
|
rawInput: Ae(s),
|
|
1597
|
-
rawOutput: Ae(
|
|
1598
|
-
}),
|
|
1598
|
+
rawOutput: Ae(Yl(c, g))
|
|
1599
|
+
}), zp(this.options.clientId, this.activeBrowserToolCalls.values());
|
|
1599
1600
|
}
|
|
1600
1601
|
setToolMessageLoading(e, n) {
|
|
1601
|
-
const i =
|
|
1602
|
+
const i = gp(
|
|
1602
1603
|
this.state.messages,
|
|
1603
1604
|
e,
|
|
1604
1605
|
n
|
|
@@ -1616,10 +1617,10 @@ class oo {
|
|
|
1616
1617
|
};
|
|
1617
1618
|
}
|
|
1618
1619
|
installSessionUserFilesApi(e) {
|
|
1619
|
-
this.cleanupSessionUserFilesApi(), this.sessionUserFilesApiCleanup =
|
|
1620
|
+
this.cleanupSessionUserFilesApi(), this.sessionUserFilesApiCleanup = xl(e, this.attachmentFiles, this.attachmentBlobCache);
|
|
1620
1621
|
}
|
|
1621
1622
|
cleanupSessionUserFilesApi() {
|
|
1622
|
-
this.sessionUserFilesApiCleanup && (
|
|
1623
|
+
this.sessionUserFilesApiCleanup && (Al(this.sessionUserFilesApiCleanup), this.sessionUserFilesApiCleanup = null);
|
|
1623
1624
|
}
|
|
1624
1625
|
async executeRuntimeHelper() {
|
|
1625
1626
|
if (!this.runtimeHelperJavascript?.trim())
|
|
@@ -1627,15 +1628,15 @@ class oo {
|
|
|
1627
1628
|
const e = await er({
|
|
1628
1629
|
javascript: this.runtimeHelperJavascript
|
|
1629
1630
|
});
|
|
1630
|
-
return e.ok === !1 ?
|
|
1631
|
+
return e.ok === !1 ? Jl(e) : null;
|
|
1631
1632
|
}
|
|
1632
1633
|
enableNetworkCapture() {
|
|
1633
|
-
this.networkCaptureCleanup || (this.networkCaptureCleanup =
|
|
1634
|
-
|
|
1634
|
+
this.networkCaptureCleanup || (this.networkCaptureCleanup = hl((e) => {
|
|
1635
|
+
Qp(e.url, this.options.backendUrl) || this.enqueueNetworkEvent(e);
|
|
1635
1636
|
}));
|
|
1636
1637
|
}
|
|
1637
1638
|
enqueueNetworkEvent(e) {
|
|
1638
|
-
this.queuedNetworkEvents.length >=
|
|
1639
|
+
this.queuedNetworkEvents.length >= sl || (this.queuedNetworkEvents.push(Zp(e)), this.networkBatchTimer === null && (this.networkBatchTimer = window.setTimeout(() => {
|
|
1639
1640
|
this.networkBatchTimer = null;
|
|
1640
1641
|
const n = this.queuedNetworkEvents.splice(0, this.queuedNetworkEvents.length);
|
|
1641
1642
|
n.length === 0 || this.socket?.readyState !== WebSocket.OPEN || this.sendNow({
|
|
@@ -1644,12 +1645,12 @@ class oo {
|
|
|
1644
1645
|
page: Ce(),
|
|
1645
1646
|
events: n
|
|
1646
1647
|
});
|
|
1647
|
-
},
|
|
1648
|
+
}, rl)));
|
|
1648
1649
|
}
|
|
1649
1650
|
scheduleReconnect() {
|
|
1650
1651
|
if (this.reconnectTimer !== null || this.state.status === "closed")
|
|
1651
1652
|
return;
|
|
1652
|
-
const e =
|
|
1653
|
+
const e = ul(this.reconnectAttempts);
|
|
1653
1654
|
this.reconnectAttempts += 1, this.reconnectTimer = window.setTimeout(() => {
|
|
1654
1655
|
this.reconnectTimer = null, this.connect().catch((n) => {
|
|
1655
1656
|
Z("web-sdk.agent", "Pluno reconnect failed; retrying", {
|
|
@@ -1684,7 +1685,7 @@ class oo {
|
|
|
1684
1685
|
this.clearSocketConnectTimer(), this.clearSocketAuthTimer();
|
|
1685
1686
|
}
|
|
1686
1687
|
replaceTimedOutSocket(e) {
|
|
1687
|
-
this.socket !== e || this.state.status === "closed" || (this.clearSocketPhaseTimers(), this.stopHeartbeat(), this.socket = null, this.setReconnectingState(), this.scheduleReconnect(), e.readyState !== WebSocket.CLOSED && e.readyState !== WebSocket.CLOSING && e.close());
|
|
1688
|
+
this.socket !== e || this.state.status === "closed" || (this.clearSocketPhaseTimers(), this.stopHeartbeat(), this.socket = null, this.rememberBrowserConnectionInterruptionForActiveRun(), this.setReconnectingState(), this.scheduleReconnect(), e.readyState !== WebSocket.CLOSED && e.readyState !== WebSocket.CLOSING && e.close());
|
|
1688
1689
|
}
|
|
1689
1690
|
setState(e) {
|
|
1690
1691
|
this.state = {
|
|
@@ -1692,7 +1693,7 @@ class oo {
|
|
|
1692
1693
|
...e,
|
|
1693
1694
|
...e.lastError === null && e.lastErrorCode === void 0 ? { lastErrorCode: null } : {},
|
|
1694
1695
|
...e.lastError !== void 0 && e.lastErrorSecuritySettingsUrl === void 0 ? { lastErrorSecuritySettingsUrl: null } : {}
|
|
1695
|
-
},
|
|
1696
|
+
}, Up(this.options.clientId, this.state), this.emit("state", this.getState()), mi("state", this.state.status, {
|
|
1696
1697
|
status: this.state.status,
|
|
1697
1698
|
sessionId: this.state.sessionId,
|
|
1698
1699
|
messageCount: this.state.messages.length,
|
|
@@ -1705,18 +1706,24 @@ class oo {
|
|
|
1705
1706
|
const e = this.state.lastError !== null && !this.state.isThinking && this.state.lastErrorCode !== "connection_failed";
|
|
1706
1707
|
this.setState(e ? { status: "reconnecting" } : { status: "reconnecting", lastError: null });
|
|
1707
1708
|
}
|
|
1709
|
+
rememberBrowserConnectionInterruptionForActiveRun() {
|
|
1710
|
+
this.state.isThinking && this.activeClientMessageId && this.browserConnectionInterruptedClientMessageIds.add(this.activeClientMessageId);
|
|
1711
|
+
}
|
|
1712
|
+
getRunRecoveryExhaustedErrorMessage(e) {
|
|
1713
|
+
return e && this.browserConnectionInterruptedClientMessageIds.has(e) ? nl : tl;
|
|
1714
|
+
}
|
|
1708
1715
|
emit(e, n) {
|
|
1709
1716
|
this.listeners[e]?.forEach((o) => o(n));
|
|
1710
1717
|
}
|
|
1711
1718
|
}
|
|
1712
1719
|
const bi = /* @__PURE__ */ new WeakMap();
|
|
1713
|
-
function
|
|
1714
|
-
const e = window.__plunoProductAgentNetworkCapture ??
|
|
1720
|
+
function hl(t) {
|
|
1721
|
+
const e = window.__plunoProductAgentNetworkCapture ?? fl();
|
|
1715
1722
|
return e.subscribers.add(t), () => {
|
|
1716
1723
|
e.subscribers.delete(t), !(e.subscribers.size > 0) && (e.destroy(), window.__plunoProductAgentNetworkCapture === e && delete window.__plunoProductAgentNetworkCapture);
|
|
1717
1724
|
};
|
|
1718
1725
|
}
|
|
1719
|
-
function
|
|
1726
|
+
function fl() {
|
|
1720
1727
|
const t = /* @__PURE__ */ new Set(), e = (f) => {
|
|
1721
1728
|
t.forEach((b) => {
|
|
1722
1729
|
try {
|
|
@@ -1733,7 +1740,7 @@ function gl() {
|
|
|
1733
1740
|
throw x;
|
|
1734
1741
|
}
|
|
1735
1742
|
try {
|
|
1736
|
-
const x = b instanceof Request ? b : null, y =
|
|
1743
|
+
const x = b instanceof Request ? b : null, y = Vp(b, x), A = ds(w?.headers ?? x?.headers);
|
|
1737
1744
|
if (!xt(y, A, w?.body)) {
|
|
1738
1745
|
const L = {
|
|
1739
1746
|
requestId: vi("fetch"),
|
|
@@ -1746,7 +1753,7 @@ function gl() {
|
|
|
1746
1753
|
};
|
|
1747
1754
|
u.then(
|
|
1748
1755
|
(z) => {
|
|
1749
|
-
|
|
1756
|
+
Xp(z, L, m, e).catch(() => {
|
|
1750
1757
|
e({
|
|
1751
1758
|
...L,
|
|
1752
1759
|
responseStatus: z.status,
|
|
@@ -1788,7 +1795,7 @@ function gl() {
|
|
|
1788
1795
|
() => {
|
|
1789
1796
|
queueMicrotask(() => {
|
|
1790
1797
|
try {
|
|
1791
|
-
const m =
|
|
1798
|
+
const m = tc(this.getAllResponseHeaders());
|
|
1792
1799
|
e({
|
|
1793
1800
|
requestId: w.requestId,
|
|
1794
1801
|
url: w.url,
|
|
@@ -1798,7 +1805,7 @@ function gl() {
|
|
|
1798
1805
|
resourceType: "xhr",
|
|
1799
1806
|
responseStatus: this.status,
|
|
1800
1807
|
responseHeaders: m,
|
|
1801
|
-
responseBody:
|
|
1808
|
+
responseBody: Jp(this, m),
|
|
1802
1809
|
errorText: this.status === 0 ? "XHR request failed or was aborted" : void 0,
|
|
1803
1810
|
startedAt: w.startedAt,
|
|
1804
1811
|
durationMs: Date.now() - w.startedAtMs
|
|
@@ -1894,10 +1901,10 @@ function Qo(t) {
|
|
|
1894
1901
|
const e = typeof t == "function" ? t() : t;
|
|
1895
1902
|
return e && Object.keys(e).length > 0 ? e : void 0;
|
|
1896
1903
|
}
|
|
1897
|
-
function
|
|
1904
|
+
function ml(t) {
|
|
1898
1905
|
return t.type === "conversation.state" || t.type === "session.updated" || t.type === "session.item" || t.type === "chat.assistant_delta" || t.type === "chat.assistant_done" || t.type === "tool.call";
|
|
1899
1906
|
}
|
|
1900
|
-
function
|
|
1907
|
+
function wl(t) {
|
|
1901
1908
|
return t.type === "run.steered" || t.type === "run.ack" || t.type === "conversation.state" || t.type === "session.updated" || t.type === "session.item" || t.type === "chat.assistant_delta" || t.type === "chat.assistant_done" || t.type === "tool.call" || t.type === "tool.status" || t.type === "error" && typeof t.requestId != "string";
|
|
1902
1909
|
}
|
|
1903
1910
|
function _i(t) {
|
|
@@ -1915,8 +1922,8 @@ function _i(t) {
|
|
|
1915
1922
|
}
|
|
1916
1923
|
return null;
|
|
1917
1924
|
}
|
|
1918
|
-
const
|
|
1919
|
-
function
|
|
1925
|
+
const bl = 5e3, _l = 12e4;
|
|
1926
|
+
function yl(t) {
|
|
1920
1927
|
const e = [];
|
|
1921
1928
|
for (const n of t)
|
|
1922
1929
|
n.role !== "user" || !n.attachments?.length || n.attachments.forEach((i, o) => {
|
|
@@ -1927,26 +1934,26 @@ function bl(t) {
|
|
|
1927
1934
|
});
|
|
1928
1935
|
return e;
|
|
1929
1936
|
}
|
|
1930
|
-
function
|
|
1937
|
+
function xl(t, e = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map()) {
|
|
1931
1938
|
const i = [
|
|
1932
|
-
|
|
1933
|
-
|
|
1939
|
+
Sl(),
|
|
1940
|
+
vl()
|
|
1934
1941
|
].filter((o) => typeof o == "function");
|
|
1935
1942
|
return () => {
|
|
1936
1943
|
for (const o of i.reverse())
|
|
1937
1944
|
o();
|
|
1938
1945
|
};
|
|
1939
1946
|
}
|
|
1940
|
-
function
|
|
1947
|
+
function vl() {
|
|
1941
1948
|
return Kr(globalThis, "getPageSnapshot", async () => ro());
|
|
1942
1949
|
}
|
|
1943
|
-
function
|
|
1950
|
+
function Sl() {
|
|
1944
1951
|
return Kr(globalThis, "pageImages", {
|
|
1945
|
-
inspectImage: async (e, n) => await
|
|
1952
|
+
inspectImage: async (e, n) => await Il(e, n)
|
|
1946
1953
|
});
|
|
1947
1954
|
}
|
|
1948
|
-
async function
|
|
1949
|
-
const n =
|
|
1955
|
+
async function Il(t, e = {}) {
|
|
1956
|
+
const n = kl(e.name), i = await Tl(t);
|
|
1950
1957
|
return i.ok ? i.sizeBytes > 8 * 1024 * 1024 ? {
|
|
1951
1958
|
type: "pluno.pageImages.inspectImage",
|
|
1952
1959
|
imageAttached: !1,
|
|
@@ -1964,15 +1971,15 @@ async function vl(t, e = {}) {
|
|
|
1964
1971
|
imageAttachmentError: i.error
|
|
1965
1972
|
};
|
|
1966
1973
|
}
|
|
1967
|
-
async function
|
|
1974
|
+
async function Tl(t) {
|
|
1968
1975
|
return t instanceof Blob ? t.type.startsWith("image/") ? t.size === 0 ? { ok: !1, error: "Page image is empty." } : t.size > 8 * 1024 * 1024 ? { ok: !1, error: Yr } : {
|
|
1969
1976
|
ok: !0,
|
|
1970
1977
|
mimeType: t.type,
|
|
1971
1978
|
sizeBytes: t.size,
|
|
1972
|
-
dataUrl: await
|
|
1973
|
-
} : { ok: !1, error: "Page image must be an image Blob or complete data:image/* URL." } : typeof t != "string" ? { ok: !1, error: "Page image must be an image Blob or complete data:image/* URL." } :
|
|
1979
|
+
dataUrl: await Rl(t)
|
|
1980
|
+
} : { ok: !1, error: "Page image must be an image Blob or complete data:image/* URL." } : typeof t != "string" ? { ok: !1, error: "Page image must be an image Blob or complete data:image/* URL." } : El(t);
|
|
1974
1981
|
}
|
|
1975
|
-
function
|
|
1982
|
+
function El(t) {
|
|
1976
1983
|
if (!t.startsWith("data:") || !t.includes(","))
|
|
1977
1984
|
return { ok: !1, error: "Page image must be a complete data:image/* URL, not bare base64." };
|
|
1978
1985
|
const [e, n] = t.slice(5).split(",", 2), i = e.split(";").map((l) => l.trim()).filter(Boolean), o = i[0] ?? "";
|
|
@@ -1983,7 +1990,7 @@ function Il(t) {
|
|
|
1983
1990
|
const r = n.replace(/[ \t\r\n\f]+/g, "");
|
|
1984
1991
|
if (!/^[A-Za-z0-9+/]*={0,2}$/.test(r))
|
|
1985
1992
|
return { ok: !1, error: "Page image data URL has invalid base64." };
|
|
1986
|
-
const s =
|
|
1993
|
+
const s = Cl(r);
|
|
1987
1994
|
return s === null ? { ok: !1, error: "Page image data URL has invalid base64." } : s === 0 ? { ok: !1, error: "Page image is empty." } : {
|
|
1988
1995
|
ok: !0,
|
|
1989
1996
|
mimeType: o,
|
|
@@ -1991,22 +1998,22 @@ function Il(t) {
|
|
|
1991
1998
|
dataUrl: `data:${o};base64,${r}`
|
|
1992
1999
|
};
|
|
1993
2000
|
}
|
|
1994
|
-
function
|
|
2001
|
+
function Cl(t) {
|
|
1995
2002
|
if (t.length === 0 || t.length % 4 !== 0)
|
|
1996
2003
|
return null;
|
|
1997
2004
|
const e = t.length - t.replace(/=+$/, "").length;
|
|
1998
2005
|
return e > 2 ? null : t.length / 4 * 3 - e;
|
|
1999
2006
|
}
|
|
2000
|
-
function
|
|
2007
|
+
function kl(t) {
|
|
2001
2008
|
return (typeof t == "string" ? t.trim() : "") || "Page image";
|
|
2002
2009
|
}
|
|
2003
|
-
function
|
|
2010
|
+
function Al(t) {
|
|
2004
2011
|
try {
|
|
2005
2012
|
t();
|
|
2006
2013
|
} catch {
|
|
2007
2014
|
}
|
|
2008
2015
|
}
|
|
2009
|
-
function
|
|
2016
|
+
function Rl(t) {
|
|
2010
2017
|
return new Promise((e, n) => {
|
|
2011
2018
|
const i = new FileReader();
|
|
2012
2019
|
i.onload = () => {
|
|
@@ -2020,7 +2027,7 @@ function kl(t) {
|
|
|
2020
2027
|
}
|
|
2021
2028
|
async function er(t, e) {
|
|
2022
2029
|
const n = Object.getPrototypeOf(async function() {
|
|
2023
|
-
}).constructor, i = t.timeoutMs ??
|
|
2030
|
+
}).constructor, i = t.timeoutMs ?? bl, o = Date.now(), r = [];
|
|
2024
2031
|
let s;
|
|
2025
2032
|
const l = {
|
|
2026
2033
|
log: console.log,
|
|
@@ -2038,7 +2045,7 @@ async function er(t, e) {
|
|
|
2038
2045
|
s = window.setTimeout(() => c(d), i);
|
|
2039
2046
|
})
|
|
2040
2047
|
]);
|
|
2041
|
-
return g === d ?
|
|
2048
|
+
return g === d ? Pl(i) : {
|
|
2042
2049
|
ok: !0,
|
|
2043
2050
|
result: g,
|
|
2044
2051
|
console: r,
|
|
@@ -2067,7 +2074,7 @@ async function er(t, e) {
|
|
|
2067
2074
|
e?.deactivate(), s !== void 0 && window.clearTimeout(s), console.log = l.log, console.info = l.info, console.warn = l.warn, console.error = l.error;
|
|
2068
2075
|
}
|
|
2069
2076
|
}
|
|
2070
|
-
function
|
|
2077
|
+
function Ml(t, e) {
|
|
2071
2078
|
if (!t || typeof t != "object")
|
|
2072
2079
|
return;
|
|
2073
2080
|
const n = t.sandboxFilesToken;
|
|
@@ -2077,7 +2084,7 @@ function Al(t, e) {
|
|
|
2077
2084
|
const o = () => {
|
|
2078
2085
|
if (!i)
|
|
2079
2086
|
throw new Error("sandboxFiles is only available during browser-code execution");
|
|
2080
|
-
}, r = async (l, p) => await
|
|
2087
|
+
}, r = async (l, p) => await qa(`${e.replace(/\/$/, "")}${l}`, p);
|
|
2081
2088
|
return {
|
|
2082
2089
|
value: Object.freeze({
|
|
2083
2090
|
upload: async (l) => {
|
|
@@ -2111,7 +2118,7 @@ function Al(t, e) {
|
|
|
2111
2118
|
}
|
|
2112
2119
|
};
|
|
2113
2120
|
}
|
|
2114
|
-
function
|
|
2121
|
+
function Pl(t) {
|
|
2115
2122
|
return {
|
|
2116
2123
|
ok: !1,
|
|
2117
2124
|
exception: {
|
|
@@ -2125,10 +2132,10 @@ function Rl(t) {
|
|
|
2125
2132
|
}
|
|
2126
2133
|
};
|
|
2127
2134
|
}
|
|
2128
|
-
function
|
|
2135
|
+
function Ll(t) {
|
|
2129
2136
|
return t.replace(/\/+$/, "");
|
|
2130
2137
|
}
|
|
2131
|
-
function
|
|
2138
|
+
function Nl(t) {
|
|
2132
2139
|
const e = {
|
|
2133
2140
|
sidepanel: "extension_sidepanel",
|
|
2134
2141
|
browser_extension_page_ui: "extension_widget",
|
|
@@ -2140,13 +2147,13 @@ function Ml(t) {
|
|
|
2140
2147
|
};
|
|
2141
2148
|
return t && t in e ? e[t] : t ?? "embedded_custom_ui";
|
|
2142
2149
|
}
|
|
2143
|
-
function
|
|
2150
|
+
function Dl(t) {
|
|
2144
2151
|
return t === "pluno" ? "scheduled_continuation" : t ?? "user";
|
|
2145
2152
|
}
|
|
2146
2153
|
function Zr(t, e = location.origin) {
|
|
2147
2154
|
return /origin (?:is not allowed|does not match browser origin)/i.test(t) ? `Pluno widget blocked on ${e}: this domain is not allowed. Add ${e} in Pluno under Integration > Domains.` : null;
|
|
2148
2155
|
}
|
|
2149
|
-
function
|
|
2156
|
+
function Ul(t) {
|
|
2150
2157
|
const e = new URL("/api/product-agent/embed/ws", t);
|
|
2151
2158
|
return e.protocol = e.protocol === "https:" ? "wss:" : "ws:", e.toString();
|
|
2152
2159
|
}
|
|
@@ -2159,19 +2166,19 @@ function Ce() {
|
|
|
2159
2166
|
...t ? { plunoProductAgentUi: t } : {}
|
|
2160
2167
|
};
|
|
2161
2168
|
}
|
|
2162
|
-
function
|
|
2169
|
+
function Ol() {
|
|
2163
2170
|
return {
|
|
2164
2171
|
pageUrl: location.href,
|
|
2165
2172
|
pageTitle: document.title,
|
|
2166
2173
|
htmlContent: ro()
|
|
2167
2174
|
};
|
|
2168
2175
|
}
|
|
2169
|
-
function
|
|
2170
|
-
return Cn.add(t), xn || (xn =
|
|
2176
|
+
function zl(t) {
|
|
2177
|
+
return Cn.add(t), xn || (xn = Bl()), () => {
|
|
2171
2178
|
Cn.delete(t), Cn.size === 0 && (xn?.(), xn = null);
|
|
2172
2179
|
};
|
|
2173
2180
|
}
|
|
2174
|
-
function
|
|
2181
|
+
function Bl() {
|
|
2175
2182
|
const t = () => {
|
|
2176
2183
|
for (const r of Array.from(Cn))
|
|
2177
2184
|
r();
|
|
@@ -2186,7 +2193,7 @@ function Ol() {
|
|
|
2186
2193
|
window.history.pushState === i && (window.history.pushState = e), window.history.replaceState === o && (window.history.replaceState = n), window.removeEventListener("popstate", t), window.removeEventListener("hashchange", t);
|
|
2187
2194
|
};
|
|
2188
2195
|
}
|
|
2189
|
-
function
|
|
2196
|
+
function Fl() {
|
|
2190
2197
|
return ns()?.surface === "browser_extension_sdk_preview";
|
|
2191
2198
|
}
|
|
2192
2199
|
function ro() {
|
|
@@ -2202,12 +2209,12 @@ function ro() {
|
|
|
2202
2209
|
);
|
|
2203
2210
|
for (const m of o.slice(0, 3))
|
|
2204
2211
|
n("Active overlay", yi(jt(m), e));
|
|
2205
|
-
const r =
|
|
2212
|
+
const r = ql(), s = r ? yi(jt(r), e) : "";
|
|
2206
2213
|
n("Main page content", s), n("Additional visible page text", yi(jt(document.body), e));
|
|
2207
2214
|
const l = t.map(([m, u]) => `${m}:
|
|
2208
2215
|
${u}`).join(`
|
|
2209
2216
|
|
|
2210
|
-
`).trim().slice(0, 12e3), p =
|
|
2217
|
+
`).trim().slice(0, 12e3), p = Wl(o, r).trim(), d = `Simplified DOM outline:
|
|
2211
2218
|
`, g = `
|
|
2212
2219
|
|
|
2213
2220
|
Visible page text:
|
|
@@ -2235,10 +2242,10 @@ function Qr(t) {
|
|
|
2235
2242
|
const e = window.getComputedStyle(t);
|
|
2236
2243
|
return e.display !== "none" && e.visibility !== "hidden" && t.getClientRects().length > 0;
|
|
2237
2244
|
}
|
|
2238
|
-
function
|
|
2245
|
+
function ql() {
|
|
2239
2246
|
return Array.from(document.querySelectorAll("main, [role='main'], article")).filter(Qr).sort((t, e) => jt(e).length - jt(t).length)[0] ?? null;
|
|
2240
2247
|
}
|
|
2241
|
-
function
|
|
2248
|
+
function Wl(t, e) {
|
|
2242
2249
|
const n = /* @__PURE__ */ new Set([
|
|
2243
2250
|
"main",
|
|
2244
2251
|
"nav",
|
|
@@ -2318,7 +2325,7 @@ function ql(t, e) {
|
|
|
2318
2325
|
"data-test",
|
|
2319
2326
|
"data-qa",
|
|
2320
2327
|
"data-cy"
|
|
2321
|
-
], d = ["aria-label", "placeholder", "data-testid", "data-test", "data-qa", "data-cy"], { priorityElements: g, priorityTargets: c } =
|
|
2328
|
+
], d = ["aria-label", "placeholder", "data-testid", "data-test", "data-qa", "data-cy"], { priorityElements: g, priorityTargets: c } = Hl(), f = new Set(t);
|
|
2322
2329
|
e && f.add(e);
|
|
2323
2330
|
let b = 0;
|
|
2324
2331
|
const w = (A) => {
|
|
@@ -2329,11 +2336,11 @@ function ql(t, e) {
|
|
|
2329
2336
|
return `${A.tagName.toLowerCase()}|${w(A)}|${U}`;
|
|
2330
2337
|
}, u = (A, U, L) => {
|
|
2331
2338
|
const z = (B, W) => {
|
|
2332
|
-
const te = B.tagName.toLowerCase(),
|
|
2333
|
-
if (b >= 1e3 && !ae || L.has(B) || r.has(te) || B.matches(".pluno-pa-widget-host, [data-pluno-product-agent-widget]") ||
|
|
2339
|
+
const te = B.tagName.toLowerCase(), Me = window.getComputedStyle(B), ae = g.has(B);
|
|
2340
|
+
if (b >= 1e3 && !ae || L.has(B) || r.has(te) || B.matches(".pluno-pa-widget-host, [data-pluno-product-agent-widget]") || Me.display === "none" || Me.visibility === "hidden")
|
|
2334
2341
|
return { lines: [], hasUsefulContent: !1, textPreview: "", containsTextElement: !1 };
|
|
2335
2342
|
b += 1;
|
|
2336
|
-
const
|
|
2343
|
+
const F = w(B), v = ts(B), H = l.has(F) || ["button", "input", "textarea", "select", "iframe", "canvas"].includes(te) || te === "a" && B.hasAttribute("href"), K = Array.from(B.children).filter((T) => T instanceof HTMLElement), V = /* @__PURE__ */ new Map();
|
|
2337
2344
|
for (const T of K) {
|
|
2338
2345
|
const O = m(T);
|
|
2339
2346
|
V.set(O, (V.get(O) ?? 0) + 1);
|
|
@@ -2357,11 +2364,11 @@ function ql(t, e) {
|
|
|
2357
2364
|
if (B.shadowRoot)
|
|
2358
2365
|
for (const T of Array.from(B.shadowRoot.children))
|
|
2359
2366
|
T instanceof HTMLElement && $.push(z(T, W + 1));
|
|
2360
|
-
const
|
|
2361
|
-
[v, ...
|
|
2362
|
-
).slice(0, 180), C = B.hasAttribute("contenteditable") && (v.length > 0 || !B.querySelector("[contenteditable]")), j = d.some((T) => B.hasAttribute(T)) || !!
|
|
2367
|
+
const Pe = [...ge, ...$], re = v.length > 0 || H || Pe.some((T) => T.hasUsefulContent), I = It(
|
|
2368
|
+
[v, ...Pe.map((T) => T.textPreview)].filter(Boolean).join(" ")
|
|
2369
|
+
).slice(0, 180), C = B.hasAttribute("contenteditable") && (v.length > 0 || !B.querySelector("[contenteditable]")), j = d.some((T) => B.hasAttribute(T)) || !!F || C, Q = (B.getClientRects().length > 0 || Me.display === "contents") && (n.has(te) || j || ae) && (re || ae) && (!o.has(te) || re || j || ae), le = Q ? 1 : 0, D = [];
|
|
2363
2370
|
if (Q) {
|
|
2364
|
-
const T =
|
|
2371
|
+
const T = Pe.some((Le) => Le.containsTextElement), O = i.has(te) && !T ? I : v;
|
|
2365
2372
|
D.push(es(B, p, s, O.slice(0, 180)));
|
|
2366
2373
|
}
|
|
2367
2374
|
for (const T of oe)
|
|
@@ -2381,14 +2388,14 @@ function ql(t, e) {
|
|
|
2381
2388
|
lines: D,
|
|
2382
2389
|
hasUsefulContent: re,
|
|
2383
2390
|
textPreview: I,
|
|
2384
|
-
containsTextElement: i.has(te) ||
|
|
2391
|
+
containsTextElement: i.has(te) || Pe.some((T) => T.containsTextElement)
|
|
2385
2392
|
};
|
|
2386
2393
|
};
|
|
2387
2394
|
return [`--- ${U} ---`, ...z(A, 0).lines].join(`
|
|
2388
2395
|
`);
|
|
2389
2396
|
}, x = [], y = It(window.getSelection()?.toString() ?? "");
|
|
2390
2397
|
y && x.push(`--- selected text ---
|
|
2391
|
-
${JSON.stringify(y)}`), c.length > 0 && x.push(
|
|
2398
|
+
${JSON.stringify(y)}`), c.length > 0 && x.push($l(c, n, p, s));
|
|
2392
2399
|
for (const A of t.slice(0, 3))
|
|
2393
2400
|
x.push(u(A, "active overlay DOM", /* @__PURE__ */ new Set()));
|
|
2394
2401
|
if (e && x.push(u(e, "main DOM", /* @__PURE__ */ new Set())), document.body) {
|
|
@@ -2403,7 +2410,7 @@ function es(t, e, n, i) {
|
|
|
2403
2410
|
const o = t.tagName.toLowerCase();
|
|
2404
2411
|
let r = o;
|
|
2405
2412
|
const s = t.getAttribute("id");
|
|
2406
|
-
s &&
|
|
2413
|
+
s && jl(s) && (r += `#${s}`);
|
|
2407
2414
|
for (const l of e) {
|
|
2408
2415
|
const p = t.getAttribute(l);
|
|
2409
2416
|
p && p.length <= 160 && (l !== "role" || !n.has(p)) && (r += `[${l}=${JSON.stringify(p)}]`);
|
|
@@ -2416,7 +2423,7 @@ function es(t, e, n, i) {
|
|
|
2416
2423
|
t.hasAttribute(l) && (r += `[${l}]`);
|
|
2417
2424
|
return `${r}${i ? ` ${JSON.stringify(i)}` : ""}`;
|
|
2418
2425
|
}
|
|
2419
|
-
function
|
|
2426
|
+
function Hl() {
|
|
2420
2427
|
const t = /* @__PURE__ */ new Set(), e = /* @__PURE__ */ new Map(), n = (l, p) => {
|
|
2421
2428
|
if (!l)
|
|
2422
2429
|
return;
|
|
@@ -2459,7 +2466,7 @@ function Fl() {
|
|
|
2459
2466
|
priorityTargets: Array.from(e, ([l, p]) => ({ element: l, labels: Array.from(p) }))
|
|
2460
2467
|
};
|
|
2461
2468
|
}
|
|
2462
|
-
function
|
|
2469
|
+
function $l(t, e, n, i) {
|
|
2463
2470
|
const o = ["--- active/current elements ---"];
|
|
2464
2471
|
for (const r of t) {
|
|
2465
2472
|
const s = [];
|
|
@@ -2495,7 +2502,7 @@ function ts(t) {
|
|
|
2495
2502
|
Array.from(t.childNodes).filter((e) => e.nodeType === Node.TEXT_NODE).map((e) => e.textContent ?? "").join(" ")
|
|
2496
2503
|
);
|
|
2497
2504
|
}
|
|
2498
|
-
function
|
|
2505
|
+
function jl(t) {
|
|
2499
2506
|
return t.length <= 64 && /^[A-Za-z_][A-Za-z0-9_:.-]*$/.test(t) && !/[a-f0-9]{12,}/i.test(t) && !/:r[0-9a-z]+:/i.test(t);
|
|
2500
2507
|
}
|
|
2501
2508
|
function ns() {
|
|
@@ -2530,7 +2537,7 @@ function ns() {
|
|
|
2530
2537
|
]
|
|
2531
2538
|
};
|
|
2532
2539
|
}
|
|
2533
|
-
function
|
|
2540
|
+
function Gl(t) {
|
|
2534
2541
|
try {
|
|
2535
2542
|
const e = JSON.parse(t);
|
|
2536
2543
|
return e && typeof e == "object" ? e : { type: "error", message: "Invalid server event" };
|
|
@@ -2544,10 +2551,10 @@ function nr(t, e) {
|
|
|
2544
2551
|
const n = t[e];
|
|
2545
2552
|
return Array.isArray(n) ? n.filter((i) => typeof i == "string" && i.trim().length > 0) : [];
|
|
2546
2553
|
}
|
|
2547
|
-
function
|
|
2554
|
+
function Kl(t) {
|
|
2548
2555
|
return Array.isArray(t) ? t.filter((e) => typeof e == "string" && e.trim().length > 0) : [];
|
|
2549
2556
|
}
|
|
2550
|
-
function
|
|
2557
|
+
function Vl(t) {
|
|
2551
2558
|
if (!t || typeof t != "object")
|
|
2552
2559
|
return null;
|
|
2553
2560
|
const e = t, n = e.appearance, i = n && typeof n == "object" ? n : e, o = typeof i.accentColor == "string" ? i.accentColor : null, r = i.colorScheme === "dark" ? "dark" : i.colorScheme === "light" ? "light" : null, s = typeof i.fontFamily == "string" && i.fontFamily.trim() ? i.fontFamily : null, l = typeof i.scribbleStyle == "boolean" ? i.scribbleStyle : null;
|
|
@@ -2558,13 +2565,13 @@ function Gl(t) {
|
|
|
2558
2565
|
...l !== null ? { scribbleStyle: l } : {}
|
|
2559
2566
|
};
|
|
2560
2567
|
}
|
|
2561
|
-
function
|
|
2568
|
+
function Xl(t) {
|
|
2562
2569
|
if (!t || typeof t != "object")
|
|
2563
2570
|
return null;
|
|
2564
2571
|
const e = t.javascript;
|
|
2565
2572
|
return typeof e != "string" || !e.trim() ? null : { javascript: e };
|
|
2566
2573
|
}
|
|
2567
|
-
function
|
|
2574
|
+
function Yl(t, e) {
|
|
2568
2575
|
return e ? t && typeof t == "object" ? {
|
|
2569
2576
|
...t,
|
|
2570
2577
|
helperError: e
|
|
@@ -2574,23 +2581,23 @@ function Vl(t, e) {
|
|
|
2574
2581
|
helperError: e
|
|
2575
2582
|
} : t;
|
|
2576
2583
|
}
|
|
2577
|
-
function
|
|
2584
|
+
function Jl(t) {
|
|
2578
2585
|
if (!t || typeof t != "object")
|
|
2579
2586
|
return t;
|
|
2580
2587
|
const e = t;
|
|
2581
2588
|
return typeof e.exception?.message == "string" ? e.exception.message : typeof e.error == "string" ? e.error : t;
|
|
2582
2589
|
}
|
|
2583
|
-
function
|
|
2590
|
+
function Zl() {
|
|
2584
2591
|
const t = "pluno.productAgent.clientId", e = window.localStorage.getItem(t);
|
|
2585
2592
|
if (e)
|
|
2586
2593
|
return e;
|
|
2587
2594
|
const n = crypto.randomUUID();
|
|
2588
2595
|
return window.localStorage.setItem(t, n), n;
|
|
2589
2596
|
}
|
|
2590
|
-
function
|
|
2597
|
+
function Ft() {
|
|
2591
2598
|
return crypto.randomUUID();
|
|
2592
2599
|
}
|
|
2593
|
-
function
|
|
2600
|
+
function Ql(t) {
|
|
2594
2601
|
if (!t || typeof t != "object")
|
|
2595
2602
|
return null;
|
|
2596
2603
|
const e = t, n = typeof e.id == "string" ? e.id : null;
|
|
@@ -2601,12 +2608,12 @@ function Jl(t) {
|
|
|
2601
2608
|
avatarUrl: typeof e.avatarUrl == "string" ? e.avatarUrl : null
|
|
2602
2609
|
} : null;
|
|
2603
2610
|
}
|
|
2604
|
-
function
|
|
2611
|
+
function ep(t, e) {
|
|
2605
2612
|
return Array.isArray(t) ? Wi(
|
|
2606
2613
|
t.map((n) => is(n, e)).filter((n) => n !== null)
|
|
2607
2614
|
) : [];
|
|
2608
2615
|
}
|
|
2609
|
-
function
|
|
2616
|
+
function tp(t) {
|
|
2610
2617
|
return Array.isArray(t) ? t.flatMap((e) => {
|
|
2611
2618
|
if (!e || typeof e != "object")
|
|
2612
2619
|
return [];
|
|
@@ -2642,7 +2649,7 @@ function is(t, e) {
|
|
|
2642
2649
|
role: r,
|
|
2643
2650
|
...o.phase === "commentary" || o.phase === "final_answer" ? { phase: o.phase } : {},
|
|
2644
2651
|
content: xa(
|
|
2645
|
-
|
|
2652
|
+
lp(o.content),
|
|
2646
2653
|
e
|
|
2647
2654
|
),
|
|
2648
2655
|
createdAt: typeof n.createdAt == "string" ? n.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -2673,7 +2680,7 @@ function is(t, e) {
|
|
|
2673
2680
|
callId: xi(o) ?? void 0,
|
|
2674
2681
|
scheduledCheckInAt: r
|
|
2675
2682
|
};
|
|
2676
|
-
const s =
|
|
2683
|
+
const s = ip(o.output);
|
|
2677
2684
|
return s ? {
|
|
2678
2685
|
id: String(n.id ?? crypto.randomUUID()),
|
|
2679
2686
|
role: "tool",
|
|
@@ -2690,7 +2697,7 @@ function is(t, e) {
|
|
|
2690
2697
|
return o.type === "function_call" || o.type === "tool_call" || o.type === "web_search_call" || o.type === "mcp_call" || o.type === "tab_lifecycle_decision" ? {
|
|
2691
2698
|
id: String(n.id ?? crypto.randomUUID()),
|
|
2692
2699
|
role: "tool",
|
|
2693
|
-
content: o.type === "mcp_call" ?
|
|
2700
|
+
content: o.type === "mcp_call" ? np(o) : rp(o),
|
|
2694
2701
|
createdAt: typeof n.createdAt == "string" ? n.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
|
|
2695
2702
|
respondsToUserMessageId: Qe(o) ?? void 0,
|
|
2696
2703
|
...ke(o) ? { runId: ke(o) } : {},
|
|
@@ -2701,7 +2708,7 @@ function is(t, e) {
|
|
|
2701
2708
|
} : o.type === "run_status" || o.type === "run_error" ? o.type === "run_error" && o.stage === "tool_execution" ? null : {
|
|
2702
2709
|
id: String(n.id ?? crypto.randomUUID()),
|
|
2703
2710
|
role: "system",
|
|
2704
|
-
content:
|
|
2711
|
+
content: op(o),
|
|
2705
2712
|
createdAt: typeof n.createdAt == "string" ? n.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
|
|
2706
2713
|
respondsToUserMessageId: Qe(o) ?? void 0,
|
|
2707
2714
|
...ke(o) ? { runId: ke(o) } : {},
|
|
@@ -2712,11 +2719,11 @@ function is(t, e) {
|
|
|
2712
2719
|
...typeof o.securitySettingsUrl == "string" ? { securitySettingsUrl: o.securitySettingsUrl } : {}
|
|
2713
2720
|
} : null;
|
|
2714
2721
|
}
|
|
2715
|
-
function
|
|
2722
|
+
function np(t) {
|
|
2716
2723
|
const n = (typeof t.server_label == "string" ? t.server_label : "").replace(/^pipedream_/, "").split(/[_-]+/).filter(Boolean).map((i) => `${i.charAt(0).toUpperCase()}${i.slice(1)}`).join(" ");
|
|
2717
2724
|
return n ? `🔌 Using ${n}` : "🔌 Using connected integration";
|
|
2718
2725
|
}
|
|
2719
|
-
function
|
|
2726
|
+
function ip(t) {
|
|
2720
2727
|
if (typeof t != "string")
|
|
2721
2728
|
return null;
|
|
2722
2729
|
try {
|
|
@@ -2733,10 +2740,10 @@ function tp(t) {
|
|
|
2733
2740
|
return null;
|
|
2734
2741
|
}
|
|
2735
2742
|
}
|
|
2736
|
-
function
|
|
2743
|
+
function op(t) {
|
|
2737
2744
|
return t.type === "run_status" && t.status === "stopped" ? "Run stopped by user" : t.type === "run_status" && t.status === "steered" ? "Steered" : typeof t.message == "string" && t.message.trim().length > 0 ? t.message.replace(/Product Agent/g, "Pluno") : t.type === "run_status" && t.status === "interrupted" ? "Pluno was interrupted before it could finish this message." : "Pluno run status changed.";
|
|
2738
2745
|
}
|
|
2739
|
-
function
|
|
2746
|
+
function rp(t) {
|
|
2740
2747
|
if (t.type === "web_search_call") {
|
|
2741
2748
|
const e = t.action;
|
|
2742
2749
|
if (e && typeof e == "object") {
|
|
@@ -2748,9 +2755,9 @@ function ip(t) {
|
|
|
2748
2755
|
}
|
|
2749
2756
|
return "🔎 Searching the web";
|
|
2750
2757
|
}
|
|
2751
|
-
return
|
|
2758
|
+
return sp(t);
|
|
2752
2759
|
}
|
|
2753
|
-
function
|
|
2760
|
+
function sp(t) {
|
|
2754
2761
|
if (typeof t.summary == "string" && t.summary.trim().length > 0)
|
|
2755
2762
|
return vt(t.summary);
|
|
2756
2763
|
if (typeof t.arguments == "string")
|
|
@@ -2767,7 +2774,7 @@ function vt(t) {
|
|
|
2767
2774
|
const e = t.trim() || "Run tool", n = e.codePointAt(0) ?? 0;
|
|
2768
2775
|
return n >= 126976 && n <= 129791 || n >= 9728 && n <= 10175 || n >= 127462 && n <= 127487 ? e : `🛠️ ${e}`;
|
|
2769
2776
|
}
|
|
2770
|
-
function
|
|
2777
|
+
function ap(t) {
|
|
2771
2778
|
if (t == null)
|
|
2772
2779
|
return t;
|
|
2773
2780
|
if (typeof t != "object")
|
|
@@ -2786,7 +2793,7 @@ function xi(t) {
|
|
|
2786
2793
|
const e = t.callId ?? t.call_id;
|
|
2787
2794
|
return typeof e == "string" && e ? e : null;
|
|
2788
2795
|
}
|
|
2789
|
-
function
|
|
2796
|
+
function lp(t) {
|
|
2790
2797
|
return typeof t == "string" ? t : Array.isArray(t) ? t.map((e) => {
|
|
2791
2798
|
if (!e || typeof e != "object")
|
|
2792
2799
|
return "";
|
|
@@ -2795,9 +2802,9 @@ function sp(t) {
|
|
|
2795
2802
|
}).filter(Boolean).join("") : "";
|
|
2796
2803
|
}
|
|
2797
2804
|
function Oi(t, e) {
|
|
2798
|
-
const n = rs(t, e), i =
|
|
2799
|
-
|
|
2800
|
-
|
|
2805
|
+
const n = rs(t, e), i = fp(
|
|
2806
|
+
pp(
|
|
2807
|
+
_p(t, e),
|
|
2801
2808
|
n
|
|
2802
2809
|
),
|
|
2803
2810
|
n
|
|
@@ -2809,16 +2816,16 @@ function Oi(t, e) {
|
|
|
2809
2816
|
const r = [...i];
|
|
2810
2817
|
return r[o] = n, Wi(r);
|
|
2811
2818
|
}
|
|
2812
|
-
function
|
|
2819
|
+
function pp(t, e) {
|
|
2813
2820
|
const n = e.assistantDraftItemId;
|
|
2814
2821
|
return n ? t.map(
|
|
2815
2822
|
(i) => i.dataType === "assistant_draft" && i.id === n ? e : i
|
|
2816
2823
|
) : t;
|
|
2817
2824
|
}
|
|
2818
|
-
function
|
|
2825
|
+
function cp(t, e, n) {
|
|
2819
2826
|
return e !== null ? t.respondsToUserMessageId === e : n !== null && t.runId === n;
|
|
2820
2827
|
}
|
|
2821
|
-
function
|
|
2828
|
+
function dp(t, e, n, i) {
|
|
2822
2829
|
if (n === null) return t;
|
|
2823
2830
|
let o = -1;
|
|
2824
2831
|
for (let s = t.length - 1; s >= 0; s -= 1) {
|
|
@@ -2835,7 +2842,7 @@ function pp(t, e, n, i) {
|
|
|
2835
2842
|
respondsToUserMessageId: n
|
|
2836
2843
|
}, r;
|
|
2837
2844
|
}
|
|
2838
|
-
function
|
|
2845
|
+
function up(t, e) {
|
|
2839
2846
|
const n = t.findIndex(
|
|
2840
2847
|
(o) => !o.id.startsWith("transient-activity:") && o.callId === e.callId
|
|
2841
2848
|
);
|
|
@@ -2852,12 +2859,12 @@ function cp(t, e) {
|
|
|
2852
2859
|
...i[n].runId ? {} : { runId: e.runId }
|
|
2853
2860
|
}, i;
|
|
2854
2861
|
}
|
|
2855
|
-
function
|
|
2862
|
+
function gp(t, e, n) {
|
|
2856
2863
|
let i = !1;
|
|
2857
2864
|
const o = t.map((r) => r.callId !== e || r.loading === n ? r : (i = !0, { ...r, loading: n }));
|
|
2858
2865
|
return i ? o : t;
|
|
2859
2866
|
}
|
|
2860
|
-
function
|
|
2867
|
+
function hp(t) {
|
|
2861
2868
|
if (t.hiddenFromTranscript === !0)
|
|
2862
2869
|
return null;
|
|
2863
2870
|
const e = typeof t.callId == "string" ? t.callId : null, n = typeof t.toolName == "string" ? t.toolName : null;
|
|
@@ -2876,7 +2883,7 @@ function up(t) {
|
|
|
2876
2883
|
loading: !0
|
|
2877
2884
|
};
|
|
2878
2885
|
}
|
|
2879
|
-
function
|
|
2886
|
+
function fp(t, e) {
|
|
2880
2887
|
if (e.id.startsWith("transient-activity:"))
|
|
2881
2888
|
return t;
|
|
2882
2889
|
const n = e.toolName === "tab_lifecycle";
|
|
@@ -2884,7 +2891,7 @@ function gp(t, e) {
|
|
|
2884
2891
|
(i) => !(i.id === `transient-activity:${e.callId}` && i.callId === e.callId || n && i.id.startsWith("transient-activity:") && i.toolName === "browser_tabs" && i.runId && i.runId === e.runId)
|
|
2885
2892
|
);
|
|
2886
2893
|
}
|
|
2887
|
-
function
|
|
2894
|
+
function mp(t, e) {
|
|
2888
2895
|
return Ea(
|
|
2889
2896
|
t,
|
|
2890
2897
|
e.map(
|
|
@@ -2920,19 +2927,19 @@ function rs(t, e) {
|
|
|
2920
2927
|
if (!n?.attachments?.length)
|
|
2921
2928
|
return e;
|
|
2922
2929
|
const i = e.attachments.map((o) => {
|
|
2923
|
-
const r =
|
|
2924
|
-
return r ?
|
|
2930
|
+
const r = wp(n.attachments ?? [], o);
|
|
2931
|
+
return r ? bp(o, r) : o;
|
|
2925
2932
|
});
|
|
2926
2933
|
return { ...e, attachments: i };
|
|
2927
2934
|
}
|
|
2928
|
-
function
|
|
2935
|
+
function wp(t, e) {
|
|
2929
2936
|
return e.id ? t.find((n) => n.id === e.id) ?? null : null;
|
|
2930
2937
|
}
|
|
2931
|
-
function
|
|
2938
|
+
function bp(t, e) {
|
|
2932
2939
|
const { previewUrl: n } = e;
|
|
2933
2940
|
return n ? { ...t, previewUrl: n } : t;
|
|
2934
2941
|
}
|
|
2935
|
-
function
|
|
2942
|
+
function _p(t, e) {
|
|
2936
2943
|
if (e.role !== "user")
|
|
2937
2944
|
return t;
|
|
2938
2945
|
const n = t.findIndex(
|
|
@@ -2981,7 +2988,7 @@ function ir(t) {
|
|
|
2981
2988
|
}
|
|
2982
2989
|
return !1;
|
|
2983
2990
|
}
|
|
2984
|
-
function
|
|
2991
|
+
function yp(t) {
|
|
2985
2992
|
const e = as(t);
|
|
2986
2993
|
if (e === null)
|
|
2987
2994
|
return t.some(tt);
|
|
@@ -2999,7 +3006,7 @@ function as(t) {
|
|
|
2999
3006
|
function Bi(t) {
|
|
3000
3007
|
return tt(t) ? !0 : t.role !== "system" ? !1 : t.dataType === "run_error" ? !0 : t.dataType === "run_status" && t.loading !== !0;
|
|
3001
3008
|
}
|
|
3002
|
-
function
|
|
3009
|
+
function Fn(t) {
|
|
3003
3010
|
for (let e = t.length - 1; e >= 0; e -= 1) {
|
|
3004
3011
|
const n = t[e];
|
|
3005
3012
|
if (!n || typeof n != "object")
|
|
@@ -3013,8 +3020,8 @@ function qn(t) {
|
|
|
3013
3020
|
}
|
|
3014
3021
|
return null;
|
|
3015
3022
|
}
|
|
3016
|
-
function
|
|
3017
|
-
const e =
|
|
3023
|
+
function xp(t) {
|
|
3024
|
+
const e = Fn(t);
|
|
3018
3025
|
if (e === null)
|
|
3019
3026
|
return null;
|
|
3020
3027
|
const i = St(t[e])?.page;
|
|
@@ -3029,14 +3036,14 @@ function St(t) {
|
|
|
3029
3036
|
const e = t.data;
|
|
3030
3037
|
return e && typeof e == "object" ? e : null;
|
|
3031
3038
|
}
|
|
3032
|
-
function
|
|
3039
|
+
function Fi(t) {
|
|
3033
3040
|
return t?.retryable !== !0 ? !1 : t.type === "run_error" ? !0 : t.type === "run_status" && t.status === "interrupted";
|
|
3034
3041
|
}
|
|
3035
3042
|
function or(t) {
|
|
3036
3043
|
return t?.type === "run_status" && t.status === "interrupted" && t.reason === "backend_restart";
|
|
3037
3044
|
}
|
|
3038
|
-
function
|
|
3039
|
-
const n =
|
|
3045
|
+
function vp(t, e) {
|
|
3046
|
+
const n = Fn(e);
|
|
3040
3047
|
if (n === null)
|
|
3041
3048
|
return !1;
|
|
3042
3049
|
const i = e[n], o = i && typeof i == "object" ? i.id : null;
|
|
@@ -3047,8 +3054,8 @@ function yp(t, e) {
|
|
|
3047
3054
|
(s) => s.respondsToUserMessageId === o && Bi(s)
|
|
3048
3055
|
) : t.slice(r + 1).some(Bi);
|
|
3049
3056
|
}
|
|
3050
|
-
function
|
|
3051
|
-
const e =
|
|
3057
|
+
function qi(t) {
|
|
3058
|
+
const e = Fn(t);
|
|
3052
3059
|
if (e === null)
|
|
3053
3060
|
return null;
|
|
3054
3061
|
const n = t[e];
|
|
@@ -3060,8 +3067,8 @@ function Fi(t) {
|
|
|
3060
3067
|
const o = i.clientMessageId;
|
|
3061
3068
|
return typeof o == "string" ? o : null;
|
|
3062
3069
|
}
|
|
3063
|
-
function
|
|
3064
|
-
const e =
|
|
3070
|
+
function Sp(t) {
|
|
3071
|
+
const e = Fn(t);
|
|
3065
3072
|
if (e === null)
|
|
3066
3073
|
return null;
|
|
3067
3074
|
for (let n = t.length - 1; n > e; n -= 1) {
|
|
@@ -3075,9 +3082,9 @@ function xp(t) {
|
|
|
3075
3082
|
if (r.type === "message" && r.role === "assistant")
|
|
3076
3083
|
return null;
|
|
3077
3084
|
if (r.type === "run_error")
|
|
3078
|
-
return r.retryable !== !0 ? null : rr(t, r) ??
|
|
3085
|
+
return r.retryable !== !0 ? null : rr(t, r) ?? qi(t);
|
|
3079
3086
|
if (r.type === "run_status")
|
|
3080
|
-
return r.status === "interrupted" && r.retryable === !0 ? rr(t, r) ??
|
|
3087
|
+
return r.status === "interrupted" && r.retryable === !0 ? rr(t, r) ?? qi(t) : null;
|
|
3081
3088
|
}
|
|
3082
3089
|
return null;
|
|
3083
3090
|
}
|
|
@@ -3090,7 +3097,7 @@ function rr(t, e) {
|
|
|
3090
3097
|
const i = t.find((r) => de(r, "id") === n), o = St(i);
|
|
3091
3098
|
return o?.type === "message" && o.role === "user" && typeof o.clientMessageId == "string" ? o.clientMessageId : null;
|
|
3092
3099
|
}
|
|
3093
|
-
function
|
|
3100
|
+
function Ip(t, e) {
|
|
3094
3101
|
let n = 0;
|
|
3095
3102
|
for (const i of t) {
|
|
3096
3103
|
if (!i || typeof i != "object")
|
|
@@ -3104,12 +3111,12 @@ function vp(t, e) {
|
|
|
3104
3111
|
return n;
|
|
3105
3112
|
}
|
|
3106
3113
|
function sr(t, e, n, i, o) {
|
|
3107
|
-
if (!e || !
|
|
3114
|
+
if (!e || !Tp(t))
|
|
3108
3115
|
return !1;
|
|
3109
3116
|
const r = t;
|
|
3110
|
-
return !(
|
|
3117
|
+
return !(Fi(r) || n !== null && typeof r.id == "string" && r.id !== n || (i !== null ? Qe(r) !== i : o !== null && ke(r) !== o));
|
|
3111
3118
|
}
|
|
3112
|
-
function
|
|
3119
|
+
function Tp(t) {
|
|
3113
3120
|
if (!t || typeof t != "object")
|
|
3114
3121
|
return !1;
|
|
3115
3122
|
const e = t;
|
|
@@ -3118,24 +3125,24 @@ function Sp(t) {
|
|
|
3118
3125
|
function tt(t) {
|
|
3119
3126
|
return t.role === "assistant" && t.phase !== "commentary";
|
|
3120
3127
|
}
|
|
3121
|
-
function
|
|
3128
|
+
function Ep(t) {
|
|
3122
3129
|
if (!t || typeof t != "object")
|
|
3123
3130
|
return !1;
|
|
3124
3131
|
const e = t;
|
|
3125
3132
|
return e.type === "message" && e.role === "user" ? !1 : e.type === "message" || e.type === "function_call" || e.type === "function_call_output" || e.type === "run_error" || e.type === "run_status";
|
|
3126
3133
|
}
|
|
3127
3134
|
function Wi(t) {
|
|
3128
|
-
return t.filter((e, n) =>
|
|
3135
|
+
return t.filter((e, n) => qn(e) ? !Np(t, n) && !Pp(t, n) && !Lp(t, n) : Cp(e) ? e.retryable === !0 && Mp(t, n) ? !1 : !Rp(t, n) : !0);
|
|
3129
3136
|
}
|
|
3130
|
-
function
|
|
3137
|
+
function Cp(t) {
|
|
3131
3138
|
return t.role === "system" && (t.dataType === "run_error" || t.dataType === "run_status" && t.steered !== !0);
|
|
3132
3139
|
}
|
|
3133
|
-
function
|
|
3140
|
+
function qn(t) {
|
|
3134
3141
|
return t.role === "system" && t.dataType === "run_status" && t.loading === !0;
|
|
3135
3142
|
}
|
|
3136
|
-
function
|
|
3143
|
+
function kp(t, e) {
|
|
3137
3144
|
const n = [...t].reverse().find(
|
|
3138
|
-
(i) => i.respondsToUserMessageId !== void 0 && i.respondsToUserMessageId !== e && ar(i) && !
|
|
3145
|
+
(i) => i.respondsToUserMessageId !== void 0 && i.respondsToUserMessageId !== e && ar(i) && !Ap(
|
|
3139
3146
|
t,
|
|
3140
3147
|
i.respondsToUserMessageId
|
|
3141
3148
|
)
|
|
@@ -3145,14 +3152,14 @@ function Ep(t, e) {
|
|
|
3145
3152
|
) : t;
|
|
3146
3153
|
}
|
|
3147
3154
|
function ar(t) {
|
|
3148
|
-
return t.role === "tool" ||
|
|
3155
|
+
return t.role === "tool" || qn(t) ? !0 : t.role === "assistant" && t.phase === "commentary";
|
|
3149
3156
|
}
|
|
3150
|
-
function
|
|
3157
|
+
function Ap(t, e) {
|
|
3151
3158
|
return t.some(
|
|
3152
3159
|
(n) => n.respondsToUserMessageId === e && (tt(n) || n.role === "system" && (n.dataType === "run_error" || n.dataType === "run_status" && n.loading !== !0))
|
|
3153
3160
|
);
|
|
3154
3161
|
}
|
|
3155
|
-
function
|
|
3162
|
+
function Rp(t, e) {
|
|
3156
3163
|
const n = t[e];
|
|
3157
3164
|
for (let i = e + 1; i < t.length; i += 1) {
|
|
3158
3165
|
const o = t[i];
|
|
@@ -3161,7 +3168,7 @@ function kp(t, e) {
|
|
|
3161
3168
|
}
|
|
3162
3169
|
return !1;
|
|
3163
3170
|
}
|
|
3164
|
-
function
|
|
3171
|
+
function Mp(t, e) {
|
|
3165
3172
|
const n = t[e];
|
|
3166
3173
|
if (!n.respondsToUserMessageId)
|
|
3167
3174
|
return !1;
|
|
@@ -3169,27 +3176,27 @@ function Ap(t, e) {
|
|
|
3169
3176
|
const o = t[i];
|
|
3170
3177
|
if (o.role === "user")
|
|
3171
3178
|
return !1;
|
|
3172
|
-
if (o.respondsToUserMessageId === n.respondsToUserMessageId && (o.role === "assistant" || o.role === "tool" ||
|
|
3179
|
+
if (o.respondsToUserMessageId === n.respondsToUserMessageId && (o.role === "assistant" || o.role === "tool" || qn(o)))
|
|
3173
3180
|
return !0;
|
|
3174
3181
|
}
|
|
3175
3182
|
return !1;
|
|
3176
3183
|
}
|
|
3177
|
-
function
|
|
3184
|
+
function Pp(t, e) {
|
|
3178
3185
|
const n = t[e];
|
|
3179
3186
|
return t.some(
|
|
3180
3187
|
(i, o) => o !== e && i.role === "assistant" && Wn(n, i)
|
|
3181
3188
|
);
|
|
3182
3189
|
}
|
|
3183
|
-
function
|
|
3190
|
+
function Lp(t, e) {
|
|
3184
3191
|
const n = t[e];
|
|
3185
3192
|
return t.some(
|
|
3186
3193
|
(i, o) => o !== e && i.role === "tool" && Wn(n, i)
|
|
3187
3194
|
);
|
|
3188
3195
|
}
|
|
3189
|
-
function
|
|
3196
|
+
function Np(t, e) {
|
|
3190
3197
|
const n = t[e];
|
|
3191
3198
|
for (let i = e + 1; i < t.length; i += 1)
|
|
3192
|
-
if (
|
|
3199
|
+
if (qn(t[i]) && Wn(n, t[i]))
|
|
3193
3200
|
return !0;
|
|
3194
3201
|
return !1;
|
|
3195
3202
|
}
|
|
@@ -3199,7 +3206,7 @@ function Wn(t, e) {
|
|
|
3199
3206
|
function de(t, e) {
|
|
3200
3207
|
return t && typeof t == "object" && typeof t[e] == "string" ? t[e] : null;
|
|
3201
3208
|
}
|
|
3202
|
-
function
|
|
3209
|
+
function Dp(t, e) {
|
|
3203
3210
|
try {
|
|
3204
3211
|
const n = window.localStorage.getItem(`${Jr}${t}`);
|
|
3205
3212
|
if (!n)
|
|
@@ -3207,7 +3214,7 @@ function Lp(t, e) {
|
|
|
3207
3214
|
const i = JSON.parse(n), o = typeof i.sessionId == "string" ? i.sessionId : null;
|
|
3208
3215
|
if (e !== void 0 && o !== e)
|
|
3209
3216
|
return null;
|
|
3210
|
-
const r = Array.isArray(i.messages) ? i.messages.map(
|
|
3217
|
+
const r = Array.isArray(i.messages) ? i.messages.map(jp).filter((s) => !!s) : [];
|
|
3211
3218
|
return {
|
|
3212
3219
|
sessionId: o,
|
|
3213
3220
|
messages: r
|
|
@@ -3216,20 +3223,20 @@ function Lp(t, e) {
|
|
|
3216
3223
|
return null;
|
|
3217
3224
|
}
|
|
3218
3225
|
}
|
|
3219
|
-
function
|
|
3226
|
+
function Up(t, e) {
|
|
3220
3227
|
try {
|
|
3221
3228
|
window.localStorage.setItem(
|
|
3222
3229
|
`${Jr}${t}`,
|
|
3223
3230
|
JSON.stringify({
|
|
3224
3231
|
sessionId: e.sessionId,
|
|
3225
|
-
messages: e.messages.slice(-
|
|
3232
|
+
messages: e.messages.slice(-cl).map(Gp)
|
|
3226
3233
|
})
|
|
3227
3234
|
);
|
|
3228
3235
|
} catch {
|
|
3229
3236
|
return;
|
|
3230
3237
|
}
|
|
3231
3238
|
}
|
|
3232
|
-
function
|
|
3239
|
+
function Op(t) {
|
|
3233
3240
|
try {
|
|
3234
3241
|
const e = window.localStorage.getItem(`${Ui}${t}`);
|
|
3235
3242
|
if (!e)
|
|
@@ -3240,7 +3247,7 @@ function Dp(t) {
|
|
|
3240
3247
|
return [];
|
|
3241
3248
|
}
|
|
3242
3249
|
}
|
|
3243
|
-
function
|
|
3250
|
+
function qt(t, e) {
|
|
3244
3251
|
try {
|
|
3245
3252
|
const n = e.filter(ao);
|
|
3246
3253
|
if (n.length === 0) {
|
|
@@ -3271,7 +3278,7 @@ function ls(t, e) {
|
|
|
3271
3278
|
} catch {
|
|
3272
3279
|
}
|
|
3273
3280
|
}
|
|
3274
|
-
function
|
|
3281
|
+
function zp(t, e) {
|
|
3275
3282
|
try {
|
|
3276
3283
|
if (window.sessionStorage.getItem(`${Bn}${t}`) === null)
|
|
3277
3284
|
return;
|
|
@@ -3280,19 +3287,19 @@ function Up(t, e) {
|
|
|
3280
3287
|
}
|
|
3281
3288
|
ls(t, e);
|
|
3282
3289
|
}
|
|
3283
|
-
function
|
|
3290
|
+
function Bp(t) {
|
|
3284
3291
|
try {
|
|
3285
3292
|
const e = `${Bn}${t}`, n = window.sessionStorage.getItem(e);
|
|
3286
3293
|
if (window.sessionStorage.removeItem(e), !n)
|
|
3287
3294
|
return [];
|
|
3288
3295
|
const i = JSON.parse(n);
|
|
3289
|
-
return Array.isArray(i) ? i.flatMap((o) =>
|
|
3296
|
+
return Array.isArray(i) ? i.flatMap((o) => qp(o) ? [{
|
|
3290
3297
|
...o.event,
|
|
3291
3298
|
page: Ce(),
|
|
3292
3299
|
rawOutput: {
|
|
3293
3300
|
pageContextRestarted: !0,
|
|
3294
3301
|
outcome: "unknown",
|
|
3295
|
-
message:
|
|
3302
|
+
message: Fp(location.href),
|
|
3296
3303
|
currentUrl: location.href,
|
|
3297
3304
|
console: [],
|
|
3298
3305
|
metadata: {
|
|
@@ -3309,17 +3316,17 @@ function Op(t) {
|
|
|
3309
3316
|
return [];
|
|
3310
3317
|
}
|
|
3311
3318
|
}
|
|
3312
|
-
function
|
|
3319
|
+
function Fp(t) {
|
|
3313
3320
|
return `The page context restarted. This is expected when the action included page navigation. Otherwise, it's unknown whether the action completed.
|
|
3314
3321
|
Current URL: ${t}`;
|
|
3315
3322
|
}
|
|
3316
|
-
function
|
|
3323
|
+
function qp(t) {
|
|
3317
3324
|
if (!t || typeof t != "object")
|
|
3318
3325
|
return !1;
|
|
3319
3326
|
const e = t, n = e.event;
|
|
3320
3327
|
return typeof e.startedAtMs == "number" && typeof e.startedAtUrl == "string" && e.startedAtOrigin === location.origin && e.unloadOrigin === location.origin && typeof e.unloadUrl == "string" && ao(n) && n.type === "tool.result";
|
|
3321
3328
|
}
|
|
3322
|
-
function
|
|
3329
|
+
function Wp(t, e) {
|
|
3323
3330
|
const n = new Set(
|
|
3324
3331
|
t.flatMap((i) => i.type === "tool.result" ? [i.callId] : [])
|
|
3325
3332
|
);
|
|
@@ -3328,7 +3335,7 @@ function qp(t, e) {
|
|
|
3328
3335
|
...e.filter((i) => !n.has(i.callId))
|
|
3329
3336
|
];
|
|
3330
3337
|
}
|
|
3331
|
-
function
|
|
3338
|
+
function Hp(t) {
|
|
3332
3339
|
try {
|
|
3333
3340
|
window.sessionStorage.removeItem(`${Bn}${t}`);
|
|
3334
3341
|
} catch {
|
|
@@ -3365,13 +3372,13 @@ function cs(t, e) {
|
|
|
3365
3372
|
} : t;
|
|
3366
3373
|
}
|
|
3367
3374
|
function pr(t) {
|
|
3368
|
-
return t.type ||
|
|
3375
|
+
return t.type || $p(t.name) || "application/octet-stream";
|
|
3369
3376
|
}
|
|
3370
|
-
function
|
|
3377
|
+
function $p(t) {
|
|
3371
3378
|
const e = t.toLowerCase();
|
|
3372
3379
|
return e.endsWith(".png") ? "image/png" : e.endsWith(".jpg") || e.endsWith(".jpeg") ? "image/jpeg" : e.endsWith(".webp") ? "image/webp" : e.endsWith(".gif") ? "image/gif" : e.endsWith(".pdf") ? "application/pdf" : null;
|
|
3373
3380
|
}
|
|
3374
|
-
function
|
|
3381
|
+
function jp(t) {
|
|
3375
3382
|
if (!t || typeof t != "object")
|
|
3376
3383
|
return null;
|
|
3377
3384
|
const e = t;
|
|
@@ -3389,7 +3396,7 @@ function Hp(t) {
|
|
|
3389
3396
|
loading: typeof e.loading == "boolean" ? e.loading : void 0
|
|
3390
3397
|
};
|
|
3391
3398
|
}
|
|
3392
|
-
function
|
|
3399
|
+
function Gp(t) {
|
|
3393
3400
|
return t.attachments?.length ? {
|
|
3394
3401
|
...t,
|
|
3395
3402
|
attachments: t.attachments.map(lo)
|
|
@@ -3412,9 +3419,9 @@ function ke(t) {
|
|
|
3412
3419
|
const e = t.runId;
|
|
3413
3420
|
return typeof e == "string" && e ? e : null;
|
|
3414
3421
|
}
|
|
3415
|
-
function
|
|
3422
|
+
function Kp(t) {
|
|
3416
3423
|
const e = t?.timeoutMs;
|
|
3417
|
-
return !!t && typeof t == "object" && typeof t.summary == "string" && typeof t.javascript == "string" && (e === void 0 || typeof e == "number" && Number.isInteger(e) && e > 0 && e <=
|
|
3424
|
+
return !!t && typeof t == "object" && typeof t.summary == "string" && typeof t.javascript == "string" && (e === void 0 || typeof e == "number" && Number.isInteger(e) && e > 0 && e <= _l);
|
|
3418
3425
|
}
|
|
3419
3426
|
function ds(t) {
|
|
3420
3427
|
const e = {};
|
|
@@ -3428,22 +3435,22 @@ function ds(t) {
|
|
|
3428
3435
|
return e;
|
|
3429
3436
|
}
|
|
3430
3437
|
function po(t, e) {
|
|
3431
|
-
return ws(t) ? Hn : je(Ln(e),
|
|
3438
|
+
return ws(t) ? Hn : je(Ln(e), ll);
|
|
3432
3439
|
}
|
|
3433
|
-
function
|
|
3440
|
+
function Vp(t, e) {
|
|
3434
3441
|
return typeof t == "string" ? t : t instanceof URL ? t.toString() : e?.url ?? "";
|
|
3435
3442
|
}
|
|
3436
|
-
async function
|
|
3443
|
+
async function Xp(t, e, n, i) {
|
|
3437
3444
|
const o = ds(t.headers);
|
|
3438
3445
|
i({
|
|
3439
3446
|
...e,
|
|
3440
3447
|
responseStatus: t.status,
|
|
3441
3448
|
responseHeaders: o,
|
|
3442
|
-
responseBody: await
|
|
3449
|
+
responseBody: await Yp(t),
|
|
3443
3450
|
durationMs: Date.now() - n
|
|
3444
3451
|
});
|
|
3445
3452
|
}
|
|
3446
|
-
async function
|
|
3453
|
+
async function Yp(t) {
|
|
3447
3454
|
if (!us(t.headers))
|
|
3448
3455
|
return;
|
|
3449
3456
|
let e = null, n = null;
|
|
@@ -3453,7 +3460,7 @@ async function Vp(t) {
|
|
|
3453
3460
|
const i = new Promise((l) => {
|
|
3454
3461
|
n = window.setTimeout(() => {
|
|
3455
3462
|
e?.cancel(), l("timeout");
|
|
3456
|
-
},
|
|
3463
|
+
}, pl);
|
|
3457
3464
|
}), o = new TextDecoder();
|
|
3458
3465
|
let r = "", s = 0;
|
|
3459
3466
|
for (; ; ) {
|
|
@@ -3475,7 +3482,7 @@ async function Vp(t) {
|
|
|
3475
3482
|
n !== null && window.clearTimeout(n);
|
|
3476
3483
|
}
|
|
3477
3484
|
}
|
|
3478
|
-
function
|
|
3485
|
+
function Jp(t, e) {
|
|
3479
3486
|
if (us(new Headers(e)))
|
|
3480
3487
|
try {
|
|
3481
3488
|
return t.responseType === "" || t.responseType === "text" ? je(t.responseText ?? "") : void 0;
|
|
@@ -3487,7 +3494,7 @@ function cr(t) {
|
|
|
3487
3494
|
if (typeof t == "string")
|
|
3488
3495
|
return je(t);
|
|
3489
3496
|
}
|
|
3490
|
-
function
|
|
3497
|
+
function Zp(t) {
|
|
3491
3498
|
return Ae({
|
|
3492
3499
|
...t,
|
|
3493
3500
|
requestBody: dr(t.requestBody),
|
|
@@ -3513,7 +3520,7 @@ function us(t) {
|
|
|
3513
3520
|
return n !== null && Number.isInteger(i) && i >= 0 && i <= no && (e.startsWith("text/") || e.includes("json") || e.includes("javascript"));
|
|
3514
3521
|
}
|
|
3515
3522
|
function xt(t, e = {}, n) {
|
|
3516
|
-
if (
|
|
3523
|
+
if (ec(n))
|
|
3517
3524
|
return !0;
|
|
3518
3525
|
const i = Object.entries(e).find(([o]) => o.toLowerCase() === "content-type")?.[1]?.toLowerCase();
|
|
3519
3526
|
if (i?.includes("multipart/form-data") || i?.includes("application/octet-stream"))
|
|
@@ -3528,7 +3535,7 @@ function xt(t, e = {}, n) {
|
|
|
3528
3535
|
return !0;
|
|
3529
3536
|
}
|
|
3530
3537
|
}
|
|
3531
|
-
function
|
|
3538
|
+
function Qp(t, e) {
|
|
3532
3539
|
if (xt(t))
|
|
3533
3540
|
return !0;
|
|
3534
3541
|
try {
|
|
@@ -3538,10 +3545,10 @@ function Jp(t, e) {
|
|
|
3538
3545
|
return !0;
|
|
3539
3546
|
}
|
|
3540
3547
|
}
|
|
3541
|
-
function
|
|
3548
|
+
function ec(t) {
|
|
3542
3549
|
return t instanceof FormData || t instanceof Blob || t instanceof ArrayBuffer || ArrayBuffer.isView(t) || typeof ReadableStream < "u" && t instanceof ReadableStream;
|
|
3543
3550
|
}
|
|
3544
|
-
function
|
|
3551
|
+
function tc(t) {
|
|
3545
3552
|
const e = {};
|
|
3546
3553
|
for (const n of t.trim().split(/[\r\n]+/)) {
|
|
3547
3554
|
const i = n.indexOf(":");
|
|
@@ -3572,74 +3579,74 @@ async function Sn(t, e) {
|
|
|
3572
3579
|
try {
|
|
3573
3580
|
return await t();
|
|
3574
3581
|
} catch (o) {
|
|
3575
|
-
if (n = o, i >= Zo - 1 || !
|
|
3582
|
+
if (n = o, i >= Zo - 1 || !ic(o))
|
|
3576
3583
|
throw o;
|
|
3577
|
-
await
|
|
3584
|
+
await nc(i);
|
|
3578
3585
|
}
|
|
3579
3586
|
throw n instanceof Error ? n : new Error(e);
|
|
3580
3587
|
}
|
|
3581
|
-
function
|
|
3588
|
+
function nc(t) {
|
|
3582
3589
|
return new Promise((e) => {
|
|
3583
|
-
window.setTimeout(e,
|
|
3590
|
+
window.setTimeout(e, al[t] ?? 0);
|
|
3584
3591
|
});
|
|
3585
3592
|
}
|
|
3586
|
-
function
|
|
3587
|
-
return t instanceof kn ?
|
|
3593
|
+
function ic(t) {
|
|
3594
|
+
return t instanceof kn ? oc(t.status) : t instanceof TypeError;
|
|
3588
3595
|
}
|
|
3589
|
-
function
|
|
3596
|
+
function oc(t) {
|
|
3590
3597
|
return t === 408 || t === 409 || t === 429 || t >= 500;
|
|
3591
3598
|
}
|
|
3592
|
-
function
|
|
3599
|
+
function rc(t) {
|
|
3593
3600
|
return t === 401 || t === 403;
|
|
3594
3601
|
}
|
|
3595
|
-
const Hn = "[REDACTED_SECRET]", Ge = "[REDACTED_TOKEN]",
|
|
3602
|
+
const Hn = "[REDACTED_SECRET]", Ge = "[REDACTED_TOKEN]", sc = "[REDACTED_SIGNED_URL]", ac = 20, lc = /^(access_token|accessToken|refresh_token|refreshToken|id_token|idToken|authToken|token|api_key|apiKey|apikey|key|secret|signature|sig|password|passwd|pwd|code|state|session|jwt|csrf|csrfToken|xsrf|xsrfToken)$/i, gs = /\bBearer\s+[A-Za-z0-9._~+/=-]{12,}/gi, hs = /\bBasic\s+[A-Za-z0-9+/=-]{12,}/gi, fs = /\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\b/g, ms = /\b(access_token|accessToken|refresh_token|refreshToken|id_token|idToken|authToken|api_key|apiKey|apikey|client_secret|clientSecret|password|secret|token|jwt|csrf|csrfToken|xsrf|xsrfToken)\b\s*[:=]\s*["']?[^"',&\s}]+/gi, pc = /\bhttps?:\/\/[^\s"'<>]+(?:X-Amz-Signature|X-Goog-Signature|Signature|sig=)[^\s"'<>]*/gi, cc = /\bhttps?:\/\/[^\s"'<>]+/gi, dc = /[),.;\]]+$/;
|
|
3596
3603
|
function Ae(t) {
|
|
3597
|
-
return
|
|
3604
|
+
return Pn(t, 0, /* @__PURE__ */ new WeakSet());
|
|
3598
3605
|
}
|
|
3599
|
-
function
|
|
3606
|
+
function Pn(t, e, n) {
|
|
3600
3607
|
if (typeof t == "string")
|
|
3601
3608
|
return t.startsWith("data:image/") || t.startsWith("data:application/pdf;") ? t : Ln(t);
|
|
3602
3609
|
if (t === null || typeof t != "object")
|
|
3603
3610
|
return t;
|
|
3604
|
-
if (e >=
|
|
3611
|
+
if (e >= ac)
|
|
3605
3612
|
return "[REDACTED_MAX_DEPTH]";
|
|
3606
3613
|
if (n.has(t))
|
|
3607
3614
|
return "[REDACTED_CIRCULAR]";
|
|
3608
3615
|
if (n.add(t), Array.isArray(t))
|
|
3609
|
-
return t.map((o) =>
|
|
3616
|
+
return t.map((o) => Pn(o, e + 1, n));
|
|
3610
3617
|
const i = {};
|
|
3611
3618
|
for (const [o, r] of Object.entries(t))
|
|
3612
|
-
o === "pageContent" ? i[o] = r : ws(o) ? i[o] = Hn : i[o] = o.toLowerCase() === "url" ?
|
|
3619
|
+
o === "pageContent" ? i[o] = r : ws(o) ? i[o] = Hn : i[o] = o.toLowerCase() === "url" ? uc(r) : Pn(r, e + 1, n);
|
|
3613
3620
|
return i;
|
|
3614
3621
|
}
|
|
3615
3622
|
function ws(t) {
|
|
3616
3623
|
const e = t.replace(/[^a-z0-9]/gi, "").toLowerCase();
|
|
3617
3624
|
return e.includes("authorization") || e.includes("cookie") || e.includes("password") || e.includes("passwd") || e === "pwd" || e.includes("secret") || e === "token" || e.endsWith("token") || e.includes("apikey") || e.includes("csrf") || e.includes("xsrf") || e === "jwt" || e === "session" || e === "signature" || e.includes("privatekey");
|
|
3618
3625
|
}
|
|
3619
|
-
function
|
|
3620
|
-
return typeof t == "string" ? bs(t) :
|
|
3626
|
+
function uc(t) {
|
|
3627
|
+
return typeof t == "string" ? bs(t) : Pn(t, 0, /* @__PURE__ */ new WeakSet());
|
|
3621
3628
|
}
|
|
3622
3629
|
function bs(t) {
|
|
3623
3630
|
try {
|
|
3624
3631
|
const e = new URL(t, location.href);
|
|
3625
3632
|
for (const n of Array.from(e.searchParams.keys()))
|
|
3626
|
-
|
|
3633
|
+
lc.test(n) && e.searchParams.set(n, Ge);
|
|
3627
3634
|
return e.username && (e.username = Ge), e.password && (e.password = Ge), e.toString();
|
|
3628
3635
|
} catch {
|
|
3629
|
-
return
|
|
3636
|
+
return gc(t);
|
|
3630
3637
|
}
|
|
3631
3638
|
}
|
|
3632
3639
|
function Ln(t) {
|
|
3633
|
-
return t.replace(
|
|
3640
|
+
return t.replace(pc, sc).replace(cc, hc).replace(gs, `Bearer ${Ge}`).replace(hs, `Basic ${Ge}`).replace(fs, Ge).replace(ms, (e, n) => `${n}: ${Hn}`);
|
|
3634
3641
|
}
|
|
3635
|
-
function
|
|
3642
|
+
function gc(t) {
|
|
3636
3643
|
return t.replace(gs, `Bearer ${Ge}`).replace(hs, `Basic ${Ge}`).replace(fs, Ge).replace(ms, (e, n) => `${n}: ${Hn}`);
|
|
3637
3644
|
}
|
|
3638
|
-
function
|
|
3639
|
-
const e = t.match(
|
|
3645
|
+
function hc(t) {
|
|
3646
|
+
const e = t.match(dc)?.[0] ?? "", n = e ? t.slice(0, -e.length) : t;
|
|
3640
3647
|
return `${bs(n)}${e}`;
|
|
3641
3648
|
}
|
|
3642
|
-
const
|
|
3649
|
+
const fc = "#7c3aed", Nn = "M547 151 C516 151 493 169 485 199 L382 606 C373 641 396 666 431 666 L523 666 C552 666 568 684 563 713 L491 1028 C486 1054 510 1067 527 1044 L894 487 C915 455 894 432 856 432 L815 432 C784 432 773 411 789 382 L904 205 C922 171 901 145 859 145 Z", Dn = "#2c2a1e", ur = [253, 250, 241], gr = 3.5;
|
|
3643
3650
|
function _s(t) {
|
|
3644
3651
|
const e = ys(t);
|
|
3645
3652
|
if (hr(Gt(e), ur) >= gr)
|
|
@@ -3647,11 +3654,11 @@ function _s(t) {
|
|
|
3647
3654
|
let i = Gt(e);
|
|
3648
3655
|
const o = Gt(Dn);
|
|
3649
3656
|
for (let r = 0; r < 6; r += 1)
|
|
3650
|
-
if (i =
|
|
3657
|
+
if (i = bc(i, o, 0.22), hr(i, ur) >= gr)
|
|
3651
3658
|
return Hi(i);
|
|
3652
3659
|
return Hi(i);
|
|
3653
3660
|
}
|
|
3654
|
-
function
|
|
3661
|
+
function mc() {
|
|
3655
3662
|
let n = "M 280 120", i = !1, o = 0;
|
|
3656
3663
|
for (let r = 150; r <= 1170; r += 62) {
|
|
3657
3664
|
const s = (o % 3 - 1) * 18, l = i ? 280 - s : 1020 + s;
|
|
@@ -3659,7 +3666,7 @@ function hc() {
|
|
|
3659
3666
|
}
|
|
3660
3667
|
return n;
|
|
3661
3668
|
}
|
|
3662
|
-
function
|
|
3669
|
+
function wc(t) {
|
|
3663
3670
|
const e = ys(t), n = $i(Gt(e));
|
|
3664
3671
|
return n > 0.86 ? {
|
|
3665
3672
|
top: "#ffffff",
|
|
@@ -3698,7 +3705,7 @@ function fc(t) {
|
|
|
3698
3705
|
}
|
|
3699
3706
|
function ys(t) {
|
|
3700
3707
|
const e = t.trim();
|
|
3701
|
-
return /^#[0-9a-f]{6}$/i.test(e) ? e.toLowerCase() : /^#[0-9a-f]{3}$/i.test(e) ? `#${e.slice(1).split("").map((n) => n + n).join("").toLowerCase()}` :
|
|
3708
|
+
return /^#[0-9a-f]{6}$/i.test(e) ? e.toLowerCase() : /^#[0-9a-f]{3}$/i.test(e) ? `#${e.slice(1).split("").map((n) => n + n).join("").toLowerCase()}` : fc;
|
|
3702
3709
|
}
|
|
3703
3710
|
function Gt(t) {
|
|
3704
3711
|
return [
|
|
@@ -3722,7 +3729,7 @@ function hr(t, e) {
|
|
|
3722
3729
|
const n = $i(t), i = $i(e), [o, r] = n > i ? [n, i] : [i, n];
|
|
3723
3730
|
return (o + 0.05) / (r + 0.05);
|
|
3724
3731
|
}
|
|
3725
|
-
function
|
|
3732
|
+
function bc(t, e, n) {
|
|
3726
3733
|
const i = ji(n);
|
|
3727
3734
|
return [
|
|
3728
3735
|
t[0] + (e[0] - t[0]) * i,
|
|
@@ -3731,17 +3738,17 @@ function mc(t, e, n) {
|
|
|
3731
3738
|
];
|
|
3732
3739
|
}
|
|
3733
3740
|
function Ue(t, e, n) {
|
|
3734
|
-
const [i, o, r] =
|
|
3735
|
-
return Hi(
|
|
3741
|
+
const [i, o, r] = _c(Gt(t));
|
|
3742
|
+
return Hi(yc(i, ji(o + n), ji(r + e)));
|
|
3736
3743
|
}
|
|
3737
|
-
function
|
|
3744
|
+
function _c([t, e, n]) {
|
|
3738
3745
|
const i = t / 255, o = e / 255, r = n / 255, s = Math.max(i, o, r), l = Math.min(i, o, r), p = (s + l) / 2;
|
|
3739
3746
|
if (s === l)
|
|
3740
3747
|
return [0, 0, p];
|
|
3741
3748
|
const d = s - l, g = p > 0.5 ? d / (2 - s - l) : d / (s + l);
|
|
3742
3749
|
return [(s === i ? (o - r) / d + (o < r ? 6 : 0) : s === o ? (r - i) / d + 2 : (i - o) / d + 4) / 6, g, p];
|
|
3743
3750
|
}
|
|
3744
|
-
function
|
|
3751
|
+
function yc(t, e, n) {
|
|
3745
3752
|
if (e === 0)
|
|
3746
3753
|
return [n * 255, n * 255, n * 255];
|
|
3747
3754
|
const i = n < 0.5 ? n * (1 + e) : n + e - n * e, o = 2 * n - i;
|
|
@@ -3759,7 +3766,7 @@ function ji(t) {
|
|
|
3759
3766
|
return Math.max(0, Math.min(1, t));
|
|
3760
3767
|
}
|
|
3761
3768
|
const xs = "suggest_share_on_socials";
|
|
3762
|
-
function
|
|
3769
|
+
function xc(t) {
|
|
3763
3770
|
for (let e = t.length - 1; e >= 0; e -= 1) {
|
|
3764
3771
|
const n = t[e];
|
|
3765
3772
|
if (n.role !== "tool" || n.toolName !== xs)
|
|
@@ -3776,7 +3783,7 @@ function _c(t) {
|
|
|
3776
3783
|
}
|
|
3777
3784
|
return null;
|
|
3778
3785
|
}
|
|
3779
|
-
function
|
|
3786
|
+
function vc(t) {
|
|
3780
3787
|
let e = 2166136261;
|
|
3781
3788
|
for (const n of t)
|
|
3782
3789
|
e ^= n.charCodeAt(0), e = Math.imul(e, 16777619);
|
|
@@ -3790,15 +3797,15 @@ function fr(t, e, n) {
|
|
|
3790
3797
|
}
|
|
3791
3798
|
return null;
|
|
3792
3799
|
}
|
|
3793
|
-
const
|
|
3794
|
-
function
|
|
3800
|
+
const Sc = "https://app.pluno.ai", Ic = "/api/product-agent/embed/active-users", Tc = 1800, Ec = 15e3, Cc = 250, kc = 1e3, Ac = 3e4;
|
|
3801
|
+
function Rc(t, e = {}) {
|
|
3795
3802
|
let n = !1, i = null, o = null, r = null;
|
|
3796
3803
|
const s = () => {
|
|
3797
3804
|
r !== null && (window.clearInterval(r), r = null);
|
|
3798
3805
|
}, l = (g) => {
|
|
3799
3806
|
n || (o !== null && window.clearTimeout(o), o = window.setTimeout(() => {
|
|
3800
3807
|
d();
|
|
3801
|
-
},
|
|
3808
|
+
}, Lc(g)));
|
|
3802
3809
|
}, p = (g) => {
|
|
3803
3810
|
if (s(), i === null) {
|
|
3804
3811
|
i = g, t(g);
|
|
@@ -3810,27 +3817,27 @@ function kc(t, e = {}) {
|
|
|
3810
3817
|
s();
|
|
3811
3818
|
return;
|
|
3812
3819
|
}
|
|
3813
|
-
const b = Math.min(1, (performance.now() - f) /
|
|
3814
|
-
i = Math.round(c + (g - c) *
|
|
3815
|
-
},
|
|
3820
|
+
const b = Math.min(1, (performance.now() - f) / Tc);
|
|
3821
|
+
i = Math.round(c + (g - c) * Nc(b)), t(i), b >= 1 && (i = g, t(g), s());
|
|
3822
|
+
}, Cc);
|
|
3816
3823
|
}, d = async () => {
|
|
3817
3824
|
try {
|
|
3818
|
-
const g = await
|
|
3825
|
+
const g = await Mc(e);
|
|
3819
3826
|
if (n)
|
|
3820
3827
|
return;
|
|
3821
3828
|
p(g.count), l(g.refreshAfterMs);
|
|
3822
3829
|
} catch {
|
|
3823
|
-
l(
|
|
3830
|
+
l(Ec);
|
|
3824
3831
|
}
|
|
3825
3832
|
};
|
|
3826
3833
|
return d(), () => {
|
|
3827
3834
|
n = !0, o !== null && window.clearTimeout(o), s();
|
|
3828
3835
|
};
|
|
3829
3836
|
}
|
|
3830
|
-
async function
|
|
3837
|
+
async function Mc(t) {
|
|
3831
3838
|
if (t.loader)
|
|
3832
3839
|
return t.loader();
|
|
3833
|
-
const n = await (t.fetcher ?? fetch)(new URL(
|
|
3840
|
+
const n = await (t.fetcher ?? fetch)(new URL(Ic, Pc(t.backendUrl ?? Sc)).toString(), {
|
|
3834
3841
|
cache: "no-store",
|
|
3835
3842
|
credentials: "omit"
|
|
3836
3843
|
});
|
|
@@ -3844,16 +3851,16 @@ async function Ac(t) {
|
|
|
3844
3851
|
function mr(t) {
|
|
3845
3852
|
return typeof t != "number" || !Number.isFinite(t) || t < 0 ? null : Math.round(t);
|
|
3846
3853
|
}
|
|
3847
|
-
function
|
|
3854
|
+
function Pc(t) {
|
|
3848
3855
|
return t.endsWith("/") ? t : `${t}/`;
|
|
3849
3856
|
}
|
|
3850
|
-
function
|
|
3851
|
-
return Math.min(
|
|
3857
|
+
function Lc(t) {
|
|
3858
|
+
return Math.min(Ac, Math.max(kc, t));
|
|
3852
3859
|
}
|
|
3853
|
-
function
|
|
3860
|
+
function Nc(t) {
|
|
3854
3861
|
return t < 0.5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) / 2;
|
|
3855
3862
|
}
|
|
3856
|
-
const
|
|
3863
|
+
const Dc = [
|
|
3857
3864
|
"a[href]",
|
|
3858
3865
|
"button",
|
|
3859
3866
|
"input",
|
|
@@ -3877,20 +3884,20 @@ const Lc = [
|
|
|
3877
3884
|
".pluno-pa-widget__message",
|
|
3878
3885
|
".timeline-item"
|
|
3879
3886
|
].join(",");
|
|
3880
|
-
function
|
|
3881
|
-
return t instanceof Element ?
|
|
3887
|
+
function Uc(t, e, n) {
|
|
3888
|
+
return t instanceof Element ? Oc(
|
|
3882
3889
|
e,
|
|
3883
3890
|
n,
|
|
3884
|
-
t.closest(
|
|
3891
|
+
t.closest(Dc) !== null
|
|
3885
3892
|
) : !1;
|
|
3886
3893
|
}
|
|
3887
|
-
function
|
|
3894
|
+
function Oc(t, e, n) {
|
|
3888
3895
|
return t === 1 && !e && !n;
|
|
3889
3896
|
}
|
|
3890
|
-
function
|
|
3897
|
+
function zc(t, e, n) {
|
|
3891
3898
|
return t instanceof Node && e !== null && !e.contains(t) && !n?.contains(t);
|
|
3892
3899
|
}
|
|
3893
|
-
function
|
|
3900
|
+
function Bc(t, e = !0) {
|
|
3894
3901
|
if (!t || !e || !t.isConnected || t.disabled || t.readOnly)
|
|
3895
3902
|
return !1;
|
|
3896
3903
|
const n = t.getRootNode();
|
|
@@ -3899,7 +3906,7 @@ function Oc(t, e = !0) {
|
|
|
3899
3906
|
function wr(t, e) {
|
|
3900
3907
|
return t.getFullYear() === e.getFullYear() && t.getMonth() === e.getMonth() && t.getDate() === e.getDate();
|
|
3901
3908
|
}
|
|
3902
|
-
function
|
|
3909
|
+
function Fc(t, e = Date.now(), n) {
|
|
3903
3910
|
const i = new Date(t), o = new Date(e), r = new Intl.DateTimeFormat(n, {
|
|
3904
3911
|
hour: "2-digit",
|
|
3905
3912
|
minute: "2-digit",
|
|
@@ -3923,7 +3930,7 @@ function zc(t, e = Date.now(), n) {
|
|
|
3923
3930
|
year: "numeric"
|
|
3924
3931
|
}).format(i)}, ${p}`;
|
|
3925
3932
|
}
|
|
3926
|
-
const
|
|
3933
|
+
const qc = 6e4, vs = 100, Wc = 1e4, Hc = 5e3, $c = "product-agent:sdk-preview-socket-connect", jc = "product-agent:sdk-preview-socket-send", Gc = "product-agent:sdk-preview-socket-close", Kc = "product-agent:sdk-preview-socket-open", Vc = "product-agent:sdk-preview-socket-message", Xc = "product-agent:sdk-preview-socket-error", Yc = "product-agent:sdk-preview-socket-closed", br = "product-agent:sdk-preview-socket-id", Jc = "data-pluno-sdk-preview-channel", Ss = "data-pluno-auto-mounted", We = "__plunoProductAgentAutoMountOwner", Zc = 1e4, Qc = "Failed to load Pluno widget token", _r = "Timed out loading Pluno widget token", ed = "pluno.productAgent.widgetClientId.", Ii = /* @__PURE__ */ new Set(), td = "product-agent:preview-diagnostic", Is = "pluno.productAgent.sharePromptsDisabled", nd = 3, yr = 'dialog[open], [aria-modal="true"], [role="dialog"]', xr = 1500, id = 5e3, od = 500, rd = "No recent chats for this page yet.", He = {
|
|
3927
3934
|
launcherLabel: "Ask for anything...",
|
|
3928
3935
|
accentColor: "#7c3aed",
|
|
3929
3936
|
colorScheme: "light",
|
|
@@ -3931,7 +3938,7 @@ const Bc = 6e4, vs = 100, qc = 1e4, Fc = 5e3, Wc = "product-agent:sdk-preview-so
|
|
|
3931
3938
|
scribbleStyle: !0,
|
|
3932
3939
|
position: "bottom-right",
|
|
3933
3940
|
movableLauncher: !0
|
|
3934
|
-
},
|
|
3941
|
+
}, sd = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive', vr = "pluno-pa-scribble-font", Ts = 190, Es = 41, ad = 22, ld = 32, pd = 1, cd = 48, co = 420, dd = 520, ud = 0.24, uo = 680, gd = 800, hd = 0.76, q = 8, gt = 50, Cs = "http://www.w3.org/2000/svg", Gi = 26, Ki = 8, fd = 36, Vi = 16, md = 4, Sr = [
|
|
3935
3942
|
{
|
|
3936
3943
|
ellipseCx: "17.5",
|
|
3937
3944
|
ellipseCy: "24.5",
|
|
@@ -3968,12 +3975,12 @@ const Bc = 6e4, vs = 100, qc = 1e4, Fc = 5e3, Wc = "product-agent:sdk-preview-so
|
|
|
3968
3975
|
path: "M18.7 26.8 C21 11.2, 7.1 1.6, 6.3 18.1",
|
|
3969
3976
|
pathStrokeWidth: "2.45"
|
|
3970
3977
|
}
|
|
3971
|
-
],
|
|
3978
|
+
], wd = 11, bd = 13, Un = 4, go = 10, ho = 40, _d = "movable-launcher-position-v2", ks = "pluno-pa-widget-styles", As = "data-pluno-pa-widget-styles";
|
|
3972
3979
|
let Ir = 0;
|
|
3973
|
-
function
|
|
3980
|
+
function yd(t) {
|
|
3974
3981
|
return (e) => new $e(e, t);
|
|
3975
3982
|
}
|
|
3976
|
-
async function
|
|
3983
|
+
async function xd(t = {}) {
|
|
3977
3984
|
const e = {
|
|
3978
3985
|
layout: t.layout ?? "floating",
|
|
3979
3986
|
mountTarget: t.mountTarget,
|
|
@@ -4053,7 +4060,7 @@ async function _d(t = {}) {
|
|
|
4053
4060
|
);
|
|
4054
4061
|
const n = document.createElement("div");
|
|
4055
4062
|
n.className = "pluno-pa-widget-host", n.setAttribute("data-pluno-product-agent-ui", "widget"), n.setAttribute("data-pluno-product-agent-layout", e.layout), e.sdkPreviewChannelId && n.setAttribute(
|
|
4056
|
-
|
|
4063
|
+
Jc,
|
|
4057
4064
|
e.sdkPreviewChannelId
|
|
4058
4065
|
);
|
|
4059
4066
|
const i = n.attachShadow({ mode: "open" }), o = document.createElement("div");
|
|
@@ -4062,14 +4069,14 @@ async function _d(t = {}) {
|
|
|
4062
4069
|
e.accentColor,
|
|
4063
4070
|
e.scribbleStyle
|
|
4064
4071
|
);
|
|
4065
|
-
|
|
4072
|
+
Gd(
|
|
4066
4073
|
o,
|
|
4067
4074
|
e.launcherLabel,
|
|
4068
4075
|
r,
|
|
4069
4076
|
e.movableLauncher,
|
|
4070
4077
|
e.showLauncherMinimizeButton
|
|
4071
4078
|
), i.appendChild(o);
|
|
4072
|
-
const s =
|
|
4079
|
+
const s = ig(e), l = e.layout === "floating" ? e.initialDisplayState ?? tg(e) : "shown";
|
|
4073
4080
|
Hr(e, l);
|
|
4074
4081
|
let p = e.movableLauncher ? s.launcherPosition : null, d = p !== null, g = s.panelSize, c = null;
|
|
4075
4082
|
o.style.setProperty(
|
|
@@ -4088,7 +4095,7 @@ async function _d(t = {}) {
|
|
|
4088
4095
|
fontFamily: e.fontFamily,
|
|
4089
4096
|
scribbleStyle: e.scribbleStyle
|
|
4090
4097
|
});
|
|
4091
|
-
const f = e.mountTarget ?? await
|
|
4098
|
+
const f = e.mountTarget ?? await eg(), b = f.ownerDocument, w = o.querySelector(
|
|
4092
4099
|
".pluno-pa-widget__launcher"
|
|
4093
4100
|
), m = o.querySelector(
|
|
4094
4101
|
".pluno-pa-widget__launcher-drag-handle"
|
|
@@ -4110,11 +4117,11 @@ async function _d(t = {}) {
|
|
|
4110
4117
|
".pluno-pa-widget__attachment-error"
|
|
4111
4118
|
), te = o.querySelector(
|
|
4112
4119
|
".pluno-pa-widget__billing-status"
|
|
4113
|
-
),
|
|
4120
|
+
), Me = o.querySelector(
|
|
4114
4121
|
".pluno-pa-widget__attachments"
|
|
4115
4122
|
), ae = o.querySelector(
|
|
4116
4123
|
".pluno-pa-widget__attachment-input"
|
|
4117
|
-
),
|
|
4124
|
+
), F = o.querySelector(
|
|
4118
4125
|
".pluno-pa-widget__attach"
|
|
4119
4126
|
), v = o.querySelector(
|
|
4120
4127
|
".pluno-pa-widget__input"
|
|
@@ -4138,7 +4145,7 @@ async function _d(t = {}) {
|
|
|
4138
4145
|
".pluno-pa-widget__active-users-counter"
|
|
4139
4146
|
), $ = o.querySelector(
|
|
4140
4147
|
".pluno-pa-widget__timeline"
|
|
4141
|
-
),
|
|
4148
|
+
), Pe = o.querySelector(
|
|
4142
4149
|
".pluno-pa-widget__timeline-bottom-sentinel"
|
|
4143
4150
|
), re = o.querySelector(
|
|
4144
4151
|
".pluno-pa-widget__notify-suggestion"
|
|
@@ -4167,7 +4174,7 @@ async function _d(t = {}) {
|
|
|
4167
4174
|
), Yt = o.querySelector(
|
|
4168
4175
|
".pluno-pa-widget__proactive-suggestion-never-show"
|
|
4169
4176
|
);
|
|
4170
|
-
if (!w || !u || !y || !z || !B || !W || !te || !
|
|
4177
|
+
if (!w || !u || !y || !z || !B || !W || !te || !Me || !ae || !F || !v || !H || !K || !V || !ve || !ie || !ot || !ue || !oe || !ge || !$ || !Pe)
|
|
4171
4178
|
throw new Error("Failed to mount Pluno widget");
|
|
4172
4179
|
if (e.movableLauncher && !m)
|
|
4173
4180
|
throw new Error("Failed to mount Pluno widget drag handle");
|
|
@@ -4178,7 +4185,7 @@ async function _d(t = {}) {
|
|
|
4178
4185
|
};
|
|
4179
4186
|
let Gn = !1;
|
|
4180
4187
|
const Jt = (a) => {
|
|
4181
|
-
On(e.billingStatus) || (Gn = !1),
|
|
4188
|
+
On(e.billingStatus) || (Gn = !1), _u(
|
|
4182
4189
|
te,
|
|
4183
4190
|
e.billingStatus,
|
|
4184
4191
|
a,
|
|
@@ -4188,14 +4195,14 @@ async function _d(t = {}) {
|
|
|
4188
4195
|
}
|
|
4189
4196
|
);
|
|
4190
4197
|
};
|
|
4191
|
-
|
|
4198
|
+
F.hidden = !e.attachmentsEnabled, ae.disabled = !e.attachmentsEnabled, Lr(u), Lr(v);
|
|
4192
4199
|
let se = [], Zt = !1, ze = null;
|
|
4193
|
-
const Ke = () =>
|
|
4200
|
+
const Ke = () => Bc(
|
|
4194
4201
|
v,
|
|
4195
4202
|
o.classList.contains("pluno-pa-widget--open") && !e.loginRequired && !e.signupRequired && !Re(e.billingStatus)
|
|
4196
4203
|
), Et = () => {
|
|
4197
|
-
|
|
4198
|
-
|
|
4204
|
+
hu(
|
|
4205
|
+
Me,
|
|
4199
4206
|
se,
|
|
4200
4207
|
(a) => {
|
|
4201
4208
|
se = se.filter(
|
|
@@ -4206,7 +4213,7 @@ async function _d(t = {}) {
|
|
|
4206
4213
|
}, _o = e.loginRequired || e.signupRequired || e.token || e.webSocketFactory ? void 0 : e.tokenProvider ?? (e.tokenEndpoint ? async () => $s(e.tokenEndpoint) : void 0);
|
|
4207
4214
|
if (!e.loginRequired && !e.signupRequired && !e.token && !_o && !e.webSocketFactory)
|
|
4208
4215
|
throw new Error("Pluno widget requires token or tokenEndpoint");
|
|
4209
|
-
const Gs = window.fetch.bind(window), Kn =
|
|
4216
|
+
const Gs = window.fetch.bind(window), Kn = ng(e.clientId);
|
|
4210
4217
|
let S;
|
|
4211
4218
|
try {
|
|
4212
4219
|
const a = {
|
|
@@ -4249,7 +4256,7 @@ async function _d(t = {}) {
|
|
|
4249
4256
|
const Vn = new Set(s.openToolGroupKeys), rt = new Set(
|
|
4250
4257
|
s.seenShareCandidateIds
|
|
4251
4258
|
), Ct = new Set(rt);
|
|
4252
|
-
let Xn = s.sharePromptsDisabled || await
|
|
4259
|
+
let Xn = s.sharePromptsDisabled || await og(e), Se = null, Ve = null, J = !1, Qt = !(e.loginRequired || e.signupRequired), Xe = !1, st = {
|
|
4253
4260
|
enabled: !0
|
|
4254
4261
|
}, at = 0, yo = "", ce = !1, he = !1, Ne = [], kt = null, lt = null, en = !1, pt = 0, fe = null, xo = location.origin, vo = S.getState().sessionId, So = S.getState().user?.id ?? null, Yn = S.getState().status;
|
|
4255
4262
|
const Ie = (a, h) => {
|
|
@@ -4272,14 +4279,14 @@ async function _d(t = {}) {
|
|
|
4272
4279
|
const h = document.createElement("button");
|
|
4273
4280
|
h.type = "button", h.className = "pluno-pa-widget__history-item", h.disabled = he;
|
|
4274
4281
|
const _ = document.createElement("span");
|
|
4275
|
-
_.className = "pluno-pa-widget__history-item-title", _.textContent =
|
|
4282
|
+
_.className = "pluno-pa-widget__history-item-title", _.textContent = Hd(a);
|
|
4276
4283
|
const k = document.createElement("time");
|
|
4277
|
-
k.className = "pluno-pa-widget__history-time", k.dateTime = a.lastActiveAt, k.textContent =
|
|
4284
|
+
k.className = "pluno-pa-widget__history-time", k.dateTime = a.lastActiveAt, k.textContent = jd(
|
|
4278
4285
|
a.lastActiveAt,
|
|
4279
4286
|
Date.now()
|
|
4280
4287
|
);
|
|
4281
|
-
const
|
|
4282
|
-
|
|
4288
|
+
const M = document.createElement("small");
|
|
4289
|
+
M.className = "pluno-pa-widget__history-path", M.textContent = $d(a), h.append(_, k, M), h.addEventListener("click", () => {
|
|
4283
4290
|
ce = !1, lt = null, Ee(), Ie(!0, "newSession"), Te(), S.loadSession(a.id), G(S.getState()), Ke();
|
|
4284
4291
|
}), ie.appendChild(h);
|
|
4285
4292
|
}
|
|
@@ -4305,7 +4312,7 @@ async function _d(t = {}) {
|
|
|
4305
4312
|
{
|
|
4306
4313
|
message: _ instanceof Error ? _.message : String(_)
|
|
4307
4314
|
}
|
|
4308
|
-
), lt =
|
|
4315
|
+
), lt = rd;
|
|
4309
4316
|
} finally {
|
|
4310
4317
|
if (h !== pt || J)
|
|
4311
4318
|
return;
|
|
@@ -4331,7 +4338,7 @@ async function _d(t = {}) {
|
|
|
4331
4338
|
const h = Kt(o, a);
|
|
4332
4339
|
return An(
|
|
4333
4340
|
o,
|
|
4334
|
-
p ? Rn(p, h) :
|
|
4341
|
+
p ? Rn(p, h) : Rd(
|
|
4335
4342
|
o,
|
|
4336
4343
|
e.position,
|
|
4337
4344
|
h
|
|
@@ -4339,12 +4346,12 @@ async function _d(t = {}) {
|
|
|
4339
4346
|
h
|
|
4340
4347
|
);
|
|
4341
4348
|
}, X = () => {
|
|
4342
|
-
const a =
|
|
4349
|
+
const a = zd(
|
|
4343
4350
|
i,
|
|
4344
4351
|
u,
|
|
4345
4352
|
v
|
|
4346
4353
|
);
|
|
4347
|
-
|
|
4354
|
+
sg(e, {
|
|
4348
4355
|
isOpen: o.classList.contains("pluno-pa-widget--open"),
|
|
4349
4356
|
composerValue: v.value,
|
|
4350
4357
|
focusedInput: a,
|
|
@@ -4361,7 +4368,7 @@ async function _d(t = {}) {
|
|
|
4361
4368
|
e.onDisplayStateChange?.(a);
|
|
4362
4369
|
}, Rt = (a, h = !0) => {
|
|
4363
4370
|
if (Hr(e, a), a === "shown") {
|
|
4364
|
-
o.classList.remove("pluno-pa-widget--minimized"), w.removeAttribute("tabindex"), w.removeAttribute("role"), w.removeAttribute("aria-label"), !o.classList.contains("pluno-pa-widget--open") && !o.classList.contains("pluno-pa-widget--closing") &&
|
|
4371
|
+
o.classList.remove("pluno-pa-widget--minimized"), w.removeAttribute("tabindex"), w.removeAttribute("role"), w.removeAttribute("aria-label"), !o.classList.contains("pluno-pa-widget--open") && !o.classList.contains("pluno-pa-widget--closing") && Mt(!1), h && nn("shown");
|
|
4365
4372
|
return;
|
|
4366
4373
|
}
|
|
4367
4374
|
Se !== null && (window.clearTimeout(Se), Se = null), o.classList.remove("pluno-pa-widget--open"), o.classList.remove("pluno-pa-widget--closing"), o.classList.add("pluno-pa-widget--minimized"), w.hidden = !1, w.setAttribute("role", "button"), w.setAttribute("aria-label", "Open Pluno"), y.hidden = !0, z.hidden = !0, w.tabIndex = 0, v.value = "", Je(
|
|
@@ -4373,8 +4380,8 @@ async function _d(t = {}) {
|
|
|
4373
4380
|
)
|
|
4374
4381
|
), Rr(o), X(), h && nn("minimized");
|
|
4375
4382
|
}, ct = (a, h = {}) => {
|
|
4376
|
-
|
|
4377
|
-
debugVersion:
|
|
4383
|
+
Ud(a, {
|
|
4384
|
+
debugVersion: _d,
|
|
4378
4385
|
launcherPosition: p,
|
|
4379
4386
|
rootClasses: o.className,
|
|
4380
4387
|
rootStyle: {
|
|
@@ -4391,7 +4398,7 @@ async function _d(t = {}) {
|
|
|
4391
4398
|
closeHidden: z.hidden,
|
|
4392
4399
|
...h
|
|
4393
4400
|
});
|
|
4394
|
-
},
|
|
4401
|
+
}, Mt = (a = !0) => {
|
|
4395
4402
|
if (!p)
|
|
4396
4403
|
return Je(o, null), At(a);
|
|
4397
4404
|
const h = At(a);
|
|
@@ -4403,7 +4410,7 @@ async function _d(t = {}) {
|
|
|
4403
4410
|
Rr(o);
|
|
4404
4411
|
return;
|
|
4405
4412
|
}
|
|
4406
|
-
|
|
4413
|
+
Dd(o, {
|
|
4407
4414
|
x: a.x - h.x,
|
|
4408
4415
|
y: a.y - h.y
|
|
4409
4416
|
});
|
|
@@ -4422,7 +4429,7 @@ async function _d(t = {}) {
|
|
|
4422
4429
|
);
|
|
4423
4430
|
return;
|
|
4424
4431
|
}
|
|
4425
|
-
const a =
|
|
4432
|
+
const a = Mt();
|
|
4426
4433
|
if (o.classList.contains("pluno-pa-widget--open") || o.classList.contains("pluno-pa-widget--closing")) {
|
|
4427
4434
|
Ti(o, g);
|
|
4428
4435
|
const h = ut(g);
|
|
@@ -4450,7 +4457,7 @@ async function _d(t = {}) {
|
|
|
4450
4457
|
};
|
|
4451
4458
|
let Ao = () => {
|
|
4452
4459
|
};
|
|
4453
|
-
window.addEventListener("resize", ko), e.movableLauncher && m ? (
|
|
4460
|
+
window.addEventListener("resize", ko), e.movableLauncher && m ? (Mt(), Ao = Ed({
|
|
4454
4461
|
root: o,
|
|
4455
4462
|
launcher: w,
|
|
4456
4463
|
launcherDragHandle: m,
|
|
@@ -4505,9 +4512,9 @@ async function _d(t = {}) {
|
|
|
4505
4512
|
const h = ut(g), _ = Ht(
|
|
4506
4513
|
a,
|
|
4507
4514
|
h
|
|
4508
|
-
), k = Kt(o),
|
|
4515
|
+
), k = Kt(o), M = An(
|
|
4509
4516
|
o,
|
|
4510
|
-
|
|
4517
|
+
Nd(
|
|
4511
4518
|
_,
|
|
4512
4519
|
h,
|
|
4513
4520
|
k,
|
|
@@ -4516,17 +4523,17 @@ async function _d(t = {}) {
|
|
|
4516
4523
|
k
|
|
4517
4524
|
);
|
|
4518
4525
|
p = Ci(
|
|
4519
|
-
|
|
4526
|
+
M,
|
|
4520
4527
|
k
|
|
4521
|
-
), d = !0, c = null, Je(o,
|
|
4522
|
-
}, Zs = e.movableLauncher && A ?
|
|
4528
|
+
), d = !0, c = null, Je(o, M), on(_, M);
|
|
4529
|
+
}, Zs = e.movableLauncher && A ? Cd({
|
|
4523
4530
|
root: o,
|
|
4524
4531
|
handle: A,
|
|
4525
4532
|
getPosition: () => Ro().position,
|
|
4526
4533
|
setPosition: Js,
|
|
4527
4534
|
persist: X
|
|
4528
4535
|
}) : () => {
|
|
4529
|
-
}, Qs = L.length > 0 ?
|
|
4536
|
+
}, Qs = L.length > 0 ? kd({
|
|
4530
4537
|
root: o,
|
|
4531
4538
|
handles: L,
|
|
4532
4539
|
getBounds: Ro,
|
|
@@ -4535,7 +4542,7 @@ async function _d(t = {}) {
|
|
|
4535
4542
|
}) : () => {
|
|
4536
4543
|
};
|
|
4537
4544
|
let Zn = !1;
|
|
4538
|
-
const
|
|
4545
|
+
const Mo = async () => {
|
|
4539
4546
|
if (!(!e.billingStatusLoader || Zn)) {
|
|
4540
4547
|
Zn = !0;
|
|
4541
4548
|
try {
|
|
@@ -4559,35 +4566,35 @@ async function _d(t = {}) {
|
|
|
4559
4566
|
}
|
|
4560
4567
|
};
|
|
4561
4568
|
let Qn = null;
|
|
4562
|
-
const
|
|
4569
|
+
const Po = (a) => {
|
|
4563
4570
|
const h = Date.now(), _ = S.getState().sessionId ?? "draft";
|
|
4564
|
-
a === "composer_input" && Qn?.scope === _ && h - Qn.requestedAt <
|
|
4571
|
+
a === "composer_input" && Qn?.scope === _ && h - Qn.requestedAt < qc || (a === "composer_input" && (Qn = { scope: _, requestedAt: h }), S.warmup(a));
|
|
4565
4572
|
}, Be = (a = "", h = !0, _ = !0, k = !0) => {
|
|
4566
|
-
const
|
|
4567
|
-
!
|
|
4573
|
+
const M = o.classList.contains("pluno-pa-widget--open");
|
|
4574
|
+
!M && k && Po("panel_open"), Mo(), Dt && (Dt = !1, oi()), o.classList.contains("pluno-pa-widget--open") || (c = null), Se !== null && (window.clearTimeout(Se), Se = null), Rt("shown", !1), y.hidden = !1, z.hidden = !1, Ri(
|
|
4568
4575
|
U,
|
|
4569
4576
|
Jn()
|
|
4570
4577
|
), o.classList.remove("pluno-pa-widget--closing");
|
|
4571
|
-
const Y =
|
|
4578
|
+
const Y = Mt(), P = ki(
|
|
4572
4579
|
o,
|
|
4573
4580
|
Y,
|
|
4574
4581
|
e.position,
|
|
4575
4582
|
g
|
|
4576
4583
|
);
|
|
4577
|
-
if (on(
|
|
4578
|
-
openPanelPosition:
|
|
4584
|
+
if (on(P, Y), ct("Opening launcher at clamped open panel position", {
|
|
4585
|
+
openPanelPosition: P,
|
|
4579
4586
|
visibleLauncherPosition: Y
|
|
4580
4587
|
}), Ie(!0, "open"), Te(), !h) {
|
|
4581
|
-
o.classList.add("pluno-pa-widget--open"),
|
|
4588
|
+
o.classList.add("pluno-pa-widget--open"), M || tn(), w.hidden = !0, a && (v.value = a, Wt(v)), $t($, () => st.enabled), at = $.scrollTop, _ && (v.focus(), v.setSelectionRange(v.value.length, v.value.length)), X(), nn("shown"), e.onPanelOpenChange?.(!0);
|
|
4582
4589
|
return;
|
|
4583
4590
|
}
|
|
4584
4591
|
window.requestAnimationFrame(() => {
|
|
4585
|
-
o.classList.add("pluno-pa-widget--open"),
|
|
4592
|
+
o.classList.add("pluno-pa-widget--open"), M || tn(), a && (v.value = a, Wt(v)), $t($, () => st.enabled), at = $.scrollTop, _ && (v.focus(), v.setSelectionRange(v.value.length, v.value.length)), X(), nn("shown"), e.onPanelOpenChange?.(!0), Se = window.setTimeout(() => {
|
|
4586
4593
|
w.hidden = !0, $t($, () => st.enabled), at = $.scrollTop;
|
|
4587
4594
|
}, 220);
|
|
4588
4595
|
});
|
|
4589
4596
|
}, ei = () => {
|
|
4590
|
-
Se !== null && (window.clearTimeout(Se), Se = null), w.hidden = !1, p && (
|
|
4597
|
+
Se !== null && (window.clearTimeout(Se), Se = null), w.hidden = !1, p && (Mt(!1), ct("Closing launcher at stored position")), o.classList.remove("pluno-pa-widget--open"), o.classList.add("pluno-pa-widget--closing"), X(), e.onPanelOpenChange?.(!1), Se = window.setTimeout(() => {
|
|
4591
4598
|
y.hidden = !0, z.hidden = !0, c = null, o.classList.remove("pluno-pa-widget--closing");
|
|
4592
4599
|
}, 220);
|
|
4593
4600
|
};
|
|
@@ -4607,7 +4614,7 @@ async function _d(t = {}) {
|
|
|
4607
4614
|
const a = u.value;
|
|
4608
4615
|
Be(a), u.value = "";
|
|
4609
4616
|
});
|
|
4610
|
-
let
|
|
4617
|
+
let Pt = null, Ye = null, rn = null, dt = null, De = null, ne = null;
|
|
4611
4618
|
const sn = (a) => a === u || a === v, No = (a) => a.composedPath().find(sn) ?? null, ea = (a) => {
|
|
4612
4619
|
let h = a;
|
|
4613
4620
|
for (; h; ) {
|
|
@@ -4629,8 +4636,8 @@ async function _d(t = {}) {
|
|
|
4629
4636
|
h = k;
|
|
4630
4637
|
continue;
|
|
4631
4638
|
}
|
|
4632
|
-
const
|
|
4633
|
-
h =
|
|
4639
|
+
const M = h.getRootNode();
|
|
4640
|
+
h = M instanceof ShadowRoot ? M.host : null;
|
|
4634
4641
|
}
|
|
4635
4642
|
return null;
|
|
4636
4643
|
}, ni = () => {
|
|
@@ -4651,21 +4658,21 @@ async function _d(t = {}) {
|
|
|
4651
4658
|
return h.display !== "none" && h.visibility !== "hidden";
|
|
4652
4659
|
}, ii = (a, h) => {
|
|
4653
4660
|
h && (De !== null && window.clearTimeout(De), De = window.setTimeout(() => {
|
|
4654
|
-
De = null,
|
|
4661
|
+
De = null, Fe === a && h.isConnected && h.focus({ preventScroll: !0 });
|
|
4655
4662
|
}, 0));
|
|
4656
4663
|
}, Lt = (a, h = null) => {
|
|
4657
|
-
if (
|
|
4664
|
+
if (Fe === a) {
|
|
4658
4665
|
a && ii(a, h);
|
|
4659
4666
|
return;
|
|
4660
4667
|
}
|
|
4661
|
-
|
|
4662
|
-
const _ =
|
|
4668
|
+
Fe = a, a !== null ? (ii(a, h), dt = window.setInterval(() => {
|
|
4669
|
+
const _ = Fe;
|
|
4663
4670
|
if (!_ || !ta(_)) {
|
|
4664
4671
|
Lt(null);
|
|
4665
4672
|
return;
|
|
4666
4673
|
}
|
|
4667
4674
|
ii(_, null);
|
|
4668
|
-
},
|
|
4675
|
+
}, od)) : (dt !== null && (window.clearInterval(dt), dt = null), De !== null && (window.clearTimeout(De), De = null), rn = null);
|
|
4669
4676
|
}, na = () => {
|
|
4670
4677
|
dt !== null && (window.clearInterval(dt), dt = null), De !== null && (window.clearTimeout(De), De = null), ne !== null && (window.clearTimeout(ne), ne = null);
|
|
4671
4678
|
}, Do = (a) => {
|
|
@@ -4673,22 +4680,22 @@ async function _d(t = {}) {
|
|
|
4673
4680
|
if (!h)
|
|
4674
4681
|
return;
|
|
4675
4682
|
const _ = Date.now();
|
|
4676
|
-
Ye = _,
|
|
4677
|
-
const k =
|
|
4683
|
+
Ye = _, Pt = _, ne !== null && window.clearTimeout(ne);
|
|
4684
|
+
const k = Fe ?? ti(ni());
|
|
4678
4685
|
k && (Lt(k, h), a.stopImmediatePropagation()), ne = window.setTimeout(() => {
|
|
4679
4686
|
if (ne = null, Ye !== _)
|
|
4680
4687
|
return;
|
|
4681
|
-
const
|
|
4682
|
-
if (
|
|
4688
|
+
const M = ni();
|
|
4689
|
+
if (M === h) {
|
|
4683
4690
|
Ye = null;
|
|
4684
4691
|
return;
|
|
4685
4692
|
}
|
|
4686
|
-
const Y = ti(
|
|
4693
|
+
const Y = ti(M);
|
|
4687
4694
|
Y && Lt(Y, h);
|
|
4688
4695
|
}, 0);
|
|
4689
4696
|
}, an = (a) => {
|
|
4690
4697
|
const h = No(a);
|
|
4691
|
-
h && (
|
|
4698
|
+
h && (Pt = Date.now(), Fe !== null && (a.stopImmediatePropagation(), Ye = null, ne !== null && (window.clearTimeout(ne), ne = null), X(), a.type === "focus" && h === u && Lo()));
|
|
4692
4699
|
};
|
|
4693
4700
|
b.defaultView?.addEventListener(
|
|
4694
4701
|
"pointerdown",
|
|
@@ -4705,26 +4712,26 @@ async function _d(t = {}) {
|
|
|
4705
4712
|
), o.addEventListener("pointerdown", (a) => {
|
|
4706
4713
|
sn(a.target) && a.stopPropagation();
|
|
4707
4714
|
}), o.addEventListener("focusin", (a) => {
|
|
4708
|
-
sn(a.target) && (a.stopPropagation(),
|
|
4715
|
+
sn(a.target) && (a.stopPropagation(), Pt = Date.now(), Ye = null, ne !== null && (window.clearTimeout(ne), ne = null), X());
|
|
4709
4716
|
}), o.addEventListener("focusout", (a) => {
|
|
4710
|
-
if (!sn(a.target) ||
|
|
4717
|
+
if (!sn(a.target) || Fe !== null)
|
|
4711
4718
|
return;
|
|
4712
|
-
const h =
|
|
4713
|
-
if (
|
|
4719
|
+
const h = Pt;
|
|
4720
|
+
if (Pt = null, h === null || Date.now() - h > xr)
|
|
4714
4721
|
return;
|
|
4715
4722
|
const _ = a.target, k = Ye !== null && Date.now() - Ye <= xr;
|
|
4716
4723
|
Ye = null, ne !== null && (window.clearTimeout(ne), ne = null);
|
|
4717
|
-
const
|
|
4718
|
-
const
|
|
4719
|
-
if (!
|
|
4724
|
+
const M = (Y) => {
|
|
4725
|
+
const P = ti(Y);
|
|
4726
|
+
if (!P)
|
|
4720
4727
|
return !1;
|
|
4721
4728
|
if (k)
|
|
4722
|
-
return Lt(
|
|
4729
|
+
return Lt(P, _), !0;
|
|
4723
4730
|
const bn = Date.now();
|
|
4724
|
-
return rn !== null && bn - rn <=
|
|
4731
|
+
return rn !== null && bn - rn <= id ? (Lt(P, _), !0) : (rn = bn, !0);
|
|
4725
4732
|
};
|
|
4726
|
-
|
|
4727
|
-
|
|
4733
|
+
M(a.relatedTarget) || window.setTimeout(() => {
|
|
4734
|
+
Fe === null && _.isConnected && M(ni());
|
|
4728
4735
|
}, 0);
|
|
4729
4736
|
}), w.addEventListener("keydown", (a) => {
|
|
4730
4737
|
!o.classList.contains("pluno-pa-widget--minimized") || a.key !== "Enter" && a.key !== " " || (a.preventDefault(), Be());
|
|
@@ -4743,15 +4750,15 @@ async function _d(t = {}) {
|
|
|
4743
4750
|
},
|
|
4744
4751
|
{ root: $, threshold: 0 }
|
|
4745
4752
|
);
|
|
4746
|
-
Uo?.observe(
|
|
4753
|
+
Uo?.observe(Pe);
|
|
4747
4754
|
const Nt = () => e.loginRequired || e.signupRequired;
|
|
4748
|
-
let
|
|
4755
|
+
let Fe = null, Dt = !1;
|
|
4749
4756
|
const me = () => Qt || S.getState().status !== "connected", ht = () => {
|
|
4750
4757
|
const a = Nt();
|
|
4751
4758
|
u.readOnly = !1, v.readOnly = !1, u.placeholder = a ? e.signupRequired ? e.signupButtonLabel : e.loginButtonLabel : Dt ? "New update" : e.launcherLabel, v.placeholder = a ? e.signupRequired ? e.signupButtonLabel : e.loginButtonLabel : He.launcherLabel, B.hidden = a;
|
|
4752
4759
|
}, pe = () => {
|
|
4753
4760
|
const a = S.getState().isThinking;
|
|
4754
|
-
H.disabled = me() || Re(e.billingStatus) || Zt && !a || !a && v.value.trim().length === 0 && se.length === 0,
|
|
4761
|
+
H.disabled = me() || Re(e.billingStatus) || Zt && !a || !a && v.value.trim().length === 0 && se.length === 0, F.disabled = Nt() || me() || Re(e.billingStatus);
|
|
4755
4762
|
};
|
|
4756
4763
|
ht();
|
|
4757
4764
|
const oi = () => {
|
|
@@ -4788,19 +4795,19 @@ async function _d(t = {}) {
|
|
|
4788
4795
|
Zt = !0;
|
|
4789
4796
|
const k = new Set(_);
|
|
4790
4797
|
se = se.filter(
|
|
4791
|
-
(
|
|
4792
|
-
), v.value === a && (v.value = "", v.style.height = "22px", v.style.overflowY = "hidden", v.dispatchEvent(new Event("input", { bubbles: !0 }))), Et(), pe(),
|
|
4798
|
+
(M) => !k.has(M)
|
|
4799
|
+
), v.value === a && (v.value = "", v.style.height = "22px", v.style.overflowY = "hidden", v.dispatchEvent(new Event("input", { bubbles: !0 }))), Et(), pe(), Od(
|
|
4793
4800
|
S,
|
|
4794
4801
|
h,
|
|
4795
4802
|
_,
|
|
4796
4803
|
Bo
|
|
4797
|
-
).catch((
|
|
4798
|
-
const Y = new Set(se.map((
|
|
4804
|
+
).catch((M) => {
|
|
4805
|
+
const Y = new Set(se.map((P) => P.id));
|
|
4799
4806
|
se = [
|
|
4800
|
-
..._.filter((
|
|
4807
|
+
..._.filter((P) => !Y.has(P.id)),
|
|
4801
4808
|
...se
|
|
4802
4809
|
], v.value || (v.value = a, v.dispatchEvent(new Event("input", { bubbles: !0 }))), Et(), ln(
|
|
4803
|
-
|
|
4810
|
+
M instanceof Error ? M.message : "Failed to upload attachment"
|
|
4804
4811
|
);
|
|
4805
4812
|
}).finally(() => {
|
|
4806
4813
|
Zt = !1, pe();
|
|
@@ -4825,16 +4832,16 @@ async function _d(t = {}) {
|
|
|
4825
4832
|
}, ai = async (a) => {
|
|
4826
4833
|
if (!e.attachmentsEnabled || a.length === 0)
|
|
4827
4834
|
return;
|
|
4828
|
-
const h =
|
|
4835
|
+
const h = wu(S, a);
|
|
4829
4836
|
if (se = [...se, ...h], Et(), oa(), pe(), G(S.getState()), !o.classList.contains("pluno-pa-widget--open")) {
|
|
4830
4837
|
Be();
|
|
4831
4838
|
return;
|
|
4832
4839
|
}
|
|
4833
4840
|
Ke();
|
|
4834
4841
|
}, ra = async (a) => {
|
|
4835
|
-
await ai(a), !(a.length === 0 ||
|
|
4842
|
+
await ai(a), !(a.length === 0 || Fe !== null) && v.focus();
|
|
4836
4843
|
};
|
|
4837
|
-
|
|
4844
|
+
F.addEventListener("click", () => {
|
|
4838
4845
|
e.loginRequired || me() || Re(e.billingStatus) || ae.click();
|
|
4839
4846
|
}), ae.addEventListener("change", () => {
|
|
4840
4847
|
const a = Array.from(ae.files ?? []);
|
|
@@ -4889,7 +4896,7 @@ async function _d(t = {}) {
|
|
|
4889
4896
|
}), ot.addEventListener("click", () => {
|
|
4890
4897
|
ce = !1, Ee(), Ke();
|
|
4891
4898
|
}), ie.addEventListener("scroll", Xs), v.addEventListener("input", () => {
|
|
4892
|
-
v.value.trim() &&
|
|
4899
|
+
v.value.trim() && Po("composer_input"), Wt(v), X(), pe(), la();
|
|
4893
4900
|
}), v.addEventListener("keydown", (a) => {
|
|
4894
4901
|
if (!(a.key !== "Enter" || a.shiftKey)) {
|
|
4895
4902
|
if (a.preventDefault(), e.loginRequired) {
|
|
@@ -4900,9 +4907,9 @@ async function _d(t = {}) {
|
|
|
4900
4907
|
}
|
|
4901
4908
|
}), o.addEventListener("click", (a) => {
|
|
4902
4909
|
const h = a.target instanceof Element ? a.target : null;
|
|
4903
|
-
h?.closest("a[href]") && X(), ce &&
|
|
4904
|
-
const k = window.getSelection(),
|
|
4905
|
-
|
|
4910
|
+
h?.closest("a[href]") && X(), ce && zc(h, ve, V) && (ce = !1, Ee());
|
|
4911
|
+
const k = window.getSelection(), M = !!(k && !k.isCollapsed && k.anchorNode && o.contains(k.anchorNode));
|
|
4912
|
+
Uc(a.target, a.detail, M) && Ke();
|
|
4906
4913
|
}), o.addEventListener("copy", (a) => {
|
|
4907
4914
|
a.clipboardData && window.getSelection() && !window.getSelection()?.isCollapsed && window.getSelection()?.anchorNode && window.getSelection()?.focusNode && o.contains(window.getSelection()?.anchorNode ?? null) && o.contains(window.getSelection()?.focusNode ?? null) && window.getSelection()?.toString() && (a.clipboardData.clearData(), a.clipboardData.setData(
|
|
4908
4915
|
"text/plain",
|
|
@@ -4921,7 +4928,7 @@ async function _d(t = {}) {
|
|
|
4921
4928
|
return;
|
|
4922
4929
|
}
|
|
4923
4930
|
a.key !== "Escape" || !ce || (ce = !1, Ee(), Ke());
|
|
4924
|
-
}), s.composerValue && (v.value = s.composerValue, Wt(v)), e.layout === "page" ? Be(v.value, !1, !0, !1) : l === "minimized" ? Rt("minimized", !1) : e.initialDisplayState === void 0 && s.isOpen && Be(v.value, !1, !1, !1),
|
|
4931
|
+
}), s.composerValue && (v.value = s.composerValue, Wt(v)), e.layout === "page" ? Be(v.value, !1, !0, !1) : l === "minimized" ? Rt("minimized", !1) : e.initialDisplayState === void 0 && s.isOpen && Be(v.value, !1, !1, !1), Bd(s, o, u, v);
|
|
4925
4932
|
const pn = () => r;
|
|
4926
4933
|
let li = S.getState().appearance !== null, cn = null, Ot = null, pi = S.getState().isThinking, ft = null;
|
|
4927
4934
|
const zt = e.taskNotifications;
|
|
@@ -4975,17 +4982,17 @@ async function _d(t = {}) {
|
|
|
4975
4982
|
let _t = null, zo = () => {
|
|
4976
4983
|
};
|
|
4977
4984
|
const aa = !!(e.sdkPreviewChannelId && e.referralLinkLoader), fn = /* @__PURE__ */ new Map(), ci = () => v.value.trim().length > 0 || se.length > 0, la = () => {
|
|
4978
|
-
const a = _t !== null &&
|
|
4979
|
-
ge.hidden = !a, a && _t !== null &&
|
|
4985
|
+
const a = _t !== null && Pi(S.getState(), ci());
|
|
4986
|
+
ge.hidden = !a, a && _t !== null && Ms(ge, _t);
|
|
4980
4987
|
};
|
|
4981
4988
|
let yt = null;
|
|
4982
|
-
const
|
|
4989
|
+
const qe = /* @__PURE__ */ new Map(), mn = /* @__PURE__ */ new Set(), pa = async (a) => {
|
|
4983
4990
|
if (e.integrationAuthHandler) {
|
|
4984
|
-
|
|
4991
|
+
qe.set(a.authRequestId, { status: "connecting" }), G(S.getState());
|
|
4985
4992
|
try {
|
|
4986
|
-
await e.integrationAuthHandler(a),
|
|
4993
|
+
await e.integrationAuthHandler(a), qe.set(a.authRequestId, { status: "completed" });
|
|
4987
4994
|
} catch (h) {
|
|
4988
|
-
|
|
4995
|
+
qe.set(a.authRequestId, {
|
|
4989
4996
|
status: "error",
|
|
4990
4997
|
error: h instanceof Error ? h.message : `Could not connect ${a.appName}.`
|
|
4991
4998
|
});
|
|
@@ -4993,7 +5000,7 @@ async function _d(t = {}) {
|
|
|
4993
5000
|
G(S.getState());
|
|
4994
5001
|
}
|
|
4995
5002
|
}, wn = (a = {}) => {
|
|
4996
|
-
Xe = !0, Ie(!0, "newSession"), Te(), ce = !1, Ee(), S.startNewSession(a), Vn.clear(),
|
|
5003
|
+
Xe = !0, Ie(!0, "newSession"), Te(), ce = !1, Ee(), S.startNewSession(a), Vn.clear(), qe.clear(), mn.clear(), v.value = "", se = [], Et(), Wt(v), X(), pe(), v.focus(), G(S.getState());
|
|
4997
5004
|
};
|
|
4998
5005
|
O?.addEventListener("click", () => {
|
|
4999
5006
|
const a = e.proactiveSuggestion;
|
|
@@ -5018,12 +5025,12 @@ async function _d(t = {}) {
|
|
|
5018
5025
|
yt || (yt = jn(
|
|
5019
5026
|
"pluno-pa-widget__new-chat",
|
|
5020
5027
|
"New chat",
|
|
5021
|
-
|
|
5028
|
+
ru(),
|
|
5022
5029
|
!1
|
|
5023
5030
|
), yt.addEventListener("click", () => wn()), K.insertBefore(yt, V));
|
|
5024
5031
|
}, G = (a) => {
|
|
5025
5032
|
if (Ve !== null && (window.clearTimeout(Ve), Ve = null), Ee(), Tt(), mo(a.lastErrorCode) ? ft = a.lastErrorCode : e.billingStatus?.creditsUsed !== null && !Re(e.billingStatus) && (ft = null), Jt(ft), e.loginRequired) {
|
|
5026
|
-
fn.clear(),
|
|
5033
|
+
fn.clear(), Fr(
|
|
5027
5034
|
$,
|
|
5028
5035
|
H,
|
|
5029
5036
|
di,
|
|
@@ -5036,7 +5043,7 @@ async function _d(t = {}) {
|
|
|
5036
5043
|
return;
|
|
5037
5044
|
}
|
|
5038
5045
|
if (e.signupRequired) {
|
|
5039
|
-
fn.clear(),
|
|
5046
|
+
fn.clear(), Fr(
|
|
5040
5047
|
$,
|
|
5041
5048
|
H,
|
|
5042
5049
|
di,
|
|
@@ -5048,26 +5055,26 @@ async function _d(t = {}) {
|
|
|
5048
5055
|
);
|
|
5049
5056
|
return;
|
|
5050
5057
|
}
|
|
5051
|
-
const h =
|
|
5058
|
+
const h = qd(a), _ = h !== yo;
|
|
5052
5059
|
yo = h;
|
|
5053
5060
|
const k = Xe || st.enabled;
|
|
5054
|
-
Xe = !1,
|
|
5061
|
+
Xe = !1, Tu(
|
|
5055
5062
|
$,
|
|
5056
|
-
|
|
5063
|
+
Pe,
|
|
5057
5064
|
H,
|
|
5058
5065
|
di,
|
|
5059
5066
|
ge,
|
|
5060
5067
|
a,
|
|
5061
5068
|
_t,
|
|
5062
|
-
_t !== null &&
|
|
5069
|
+
_t !== null && Pi(a, ci()),
|
|
5063
5070
|
k,
|
|
5064
5071
|
() => st.enabled,
|
|
5065
5072
|
Vn,
|
|
5066
5073
|
fn,
|
|
5067
5074
|
X,
|
|
5068
5075
|
pn,
|
|
5069
|
-
(
|
|
5070
|
-
me() || (Bo(), Xe = !0, Ie(!0, "send"), Te(), S.sendMessage(
|
|
5076
|
+
(P) => {
|
|
5077
|
+
me() || (Bo(), Xe = !0, Ie(!0, "send"), Te(), S.sendMessage(P));
|
|
5071
5078
|
},
|
|
5072
5079
|
() => {
|
|
5073
5080
|
Xe = !0, Ie(!0, "send"), Te(), S.retryLastMessage();
|
|
@@ -5079,10 +5086,10 @@ async function _d(t = {}) {
|
|
|
5079
5086
|
ri,
|
|
5080
5087
|
e.attachmentPreviewUrlResolver,
|
|
5081
5088
|
e.integrationAuthHandler ? {
|
|
5082
|
-
states:
|
|
5089
|
+
states: qe,
|
|
5083
5090
|
initialStatus: e.integrationAuthStatusLoader ? "checking" : "pending",
|
|
5084
|
-
onConnect: (
|
|
5085
|
-
pa(
|
|
5091
|
+
onConnect: (P) => {
|
|
5092
|
+
pa(P);
|
|
5086
5093
|
}
|
|
5087
5094
|
} : void 0,
|
|
5088
5095
|
aa && !Xn ? {
|
|
@@ -5091,38 +5098,38 @@ async function _d(t = {}) {
|
|
|
5091
5098
|
error: Ot,
|
|
5092
5099
|
characterIconOptions: pn(),
|
|
5093
5100
|
socialPostRewardsUrl: e.socialPostRewardsUrl,
|
|
5094
|
-
onSeen: (
|
|
5095
|
-
rt.add(
|
|
5101
|
+
onSeen: (P) => {
|
|
5102
|
+
rt.add(P.id), X();
|
|
5096
5103
|
},
|
|
5097
|
-
onReferralCopy: (
|
|
5098
|
-
ca(
|
|
5104
|
+
onReferralCopy: (P) => {
|
|
5105
|
+
ca(P);
|
|
5099
5106
|
},
|
|
5100
|
-
onSocialShare: (
|
|
5101
|
-
rt.add(
|
|
5107
|
+
onSocialShare: (P) => {
|
|
5108
|
+
rt.add(P.id), Ct.add(P.id), X();
|
|
5102
5109
|
},
|
|
5103
|
-
onDismiss: (
|
|
5104
|
-
rt.add(
|
|
5110
|
+
onDismiss: (P) => {
|
|
5111
|
+
rt.add(P.id), Ct.add(P.id), X(), Ot = null, G(S.getState());
|
|
5105
5112
|
},
|
|
5106
|
-
onDisable: (
|
|
5107
|
-
Xn = !0, rt.add(
|
|
5113
|
+
onDisable: (P) => {
|
|
5114
|
+
Xn = !0, rt.add(P.id), Ct.add(P.id), X(), rg(e, !0), Ot = null, G(S.getState());
|
|
5108
5115
|
}
|
|
5109
5116
|
} : void 0
|
|
5110
5117
|
);
|
|
5111
|
-
const
|
|
5118
|
+
const M = a.isThinking ? null : a.messages.map((P) => P.scheduledCheckInAt).filter((P) => !!P).filter((P) => Mn(P) !== null).sort((P, bn) => Date.parse(P) - Date.parse(bn))[0] ?? null, Y = M ? Fa(M) : null;
|
|
5112
5119
|
Y !== null && (Ve = window.setTimeout(
|
|
5113
5120
|
() => {
|
|
5114
5121
|
Ve = null, J || G(S.getState());
|
|
5115
5122
|
},
|
|
5116
5123
|
Math.min(Y, 2147483647)
|
|
5117
|
-
)), k ? (at = $.scrollTop, Te()) : _ &&
|
|
5118
|
-
},
|
|
5119
|
-
b.getSelection()?.isCollapsed !== !1 &&
|
|
5124
|
+
)), k ? (at = $.scrollTop, Te()) : _ && Wd(a) && Ks();
|
|
5125
|
+
}, Fo = () => {
|
|
5126
|
+
b.getSelection()?.isCollapsed !== !1 && Mu(fn) && G(S.getState());
|
|
5120
5127
|
};
|
|
5121
5128
|
b.addEventListener(
|
|
5122
5129
|
"selectionchange",
|
|
5123
|
-
|
|
5130
|
+
Fo
|
|
5124
5131
|
);
|
|
5125
|
-
const
|
|
5132
|
+
const qo = async (a) => {
|
|
5126
5133
|
if (!e.integrationAuthStatusLoader)
|
|
5127
5134
|
return;
|
|
5128
5135
|
const h = a.messages.map((_) => _.integrationAuthRequest).filter(
|
|
@@ -5130,15 +5137,15 @@ async function _d(t = {}) {
|
|
|
5130
5137
|
);
|
|
5131
5138
|
await Promise.all(
|
|
5132
5139
|
h.map(async (_) => {
|
|
5133
|
-
if (!(
|
|
5134
|
-
mn.add(_.authRequestId),
|
|
5140
|
+
if (!(qe.has(_.authRequestId) || mn.has(_.authRequestId))) {
|
|
5141
|
+
mn.add(_.authRequestId), qe.set(_.authRequestId, {
|
|
5135
5142
|
status: "checking"
|
|
5136
5143
|
}), G(S.getState());
|
|
5137
5144
|
try {
|
|
5138
5145
|
const k = await e.integrationAuthStatusLoader(_);
|
|
5139
|
-
|
|
5146
|
+
qe.set(_.authRequestId, { status: k });
|
|
5140
5147
|
} catch (k) {
|
|
5141
|
-
|
|
5148
|
+
qe.set(_.authRequestId, {
|
|
5142
5149
|
status: "error",
|
|
5143
5150
|
error: k instanceof Error ? k.message : `Could not load ${_.appName} connection status.`
|
|
5144
5151
|
});
|
|
@@ -5150,9 +5157,9 @@ async function _d(t = {}) {
|
|
|
5150
5157
|
})
|
|
5151
5158
|
);
|
|
5152
5159
|
};
|
|
5153
|
-
return zo =
|
|
5160
|
+
return zo = Rc(
|
|
5154
5161
|
(a) => {
|
|
5155
|
-
_t = a, !J &&
|
|
5162
|
+
_t = a, !J && Pi(S.getState(), ci()) && G(S.getState());
|
|
5156
5163
|
},
|
|
5157
5164
|
{
|
|
5158
5165
|
backendUrl: e.backendUrl,
|
|
@@ -5161,10 +5168,10 @@ async function _d(t = {}) {
|
|
|
5161
5168
|
}
|
|
5162
5169
|
), S.on("state", (a) => {
|
|
5163
5170
|
hn();
|
|
5164
|
-
const h = pi && !a.isThinking, _ = xo !== location.origin || vo !== a.sessionId || So !== (a.user?.id ?? null), k = pi !== a.isThinking,
|
|
5165
|
-
xo = location.origin, vo = a.sessionId, So = a.user?.id ?? null, Yn = a.status, pi = a.isThinking, Y && (fe !== null && (window.clearTimeout(fe), fe = null), pt += 1, he = !1, Ne = [], kt = null, lt = null, en = !1, Ee()), o.classList.contains("pluno-pa-widget--open") && a.status === "connected" && (_ || k ||
|
|
5171
|
+
const h = pi && !a.isThinking, _ = xo !== location.origin || vo !== a.sessionId || So !== (a.user?.id ?? null), k = pi !== a.isThinking, M = Yn !== "connected" && a.status === "connected", Y = Yn === "connected" && a.status !== "connected";
|
|
5172
|
+
xo = location.origin, vo = a.sessionId, So = a.user?.id ?? null, Yn = a.status, pi = a.isThinking, Y && (fe !== null && (window.clearTimeout(fe), fe = null), pt += 1, he = !1, Ne = [], kt = null, lt = null, en = !1, Ee()), o.classList.contains("pluno-pa-widget--open") && a.status === "connected" && (_ || k || M) && tn(), a.isThinking && !un() && zt && !wt && mt === null && re?.hidden !== !1 && (mt = window.setTimeout(() => {
|
|
5166
5173
|
mt = null, sa();
|
|
5167
|
-
},
|
|
5174
|
+
}, Wc)), (!a.isThinking || un()) && (Oo(), dn()), h && !o.classList.contains("pluno-pa-widget--open") && (Dt = !0), oi(), a.appearance ? (li = !0, we(
|
|
5168
5175
|
"web-sdk.widget",
|
|
5169
5176
|
"Agent state supplied appearance",
|
|
5170
5177
|
{
|
|
@@ -5178,8 +5185,8 @@ async function _d(t = {}) {
|
|
|
5178
5185
|
fallbackColorScheme: e.colorScheme,
|
|
5179
5186
|
fallbackFontFamily: e.fontFamily
|
|
5180
5187
|
}
|
|
5181
|
-
), ui({}, "agent.state.appearance-cleared")), G(a),
|
|
5182
|
-
}), G(S.getState()),
|
|
5188
|
+
), ui({}, "agent.state.appearance-cleared")), G(a), qo(a), pe(), h && Mo();
|
|
5189
|
+
}), G(S.getState()), qo(S.getState()), pe(), ri(), {
|
|
5183
5190
|
agent: S,
|
|
5184
5191
|
startNewChat: wn,
|
|
5185
5192
|
host: n,
|
|
@@ -5219,7 +5226,7 @@ async function _d(t = {}) {
|
|
|
5219
5226
|
destroy: () => {
|
|
5220
5227
|
J || (X(), J = !0, Co.disconnect(), b.removeEventListener(
|
|
5221
5228
|
"selectionchange",
|
|
5222
|
-
|
|
5229
|
+
Fo
|
|
5223
5230
|
), Uo?.disconnect(), na(), b.defaultView?.removeEventListener(
|
|
5224
5231
|
"pointerdown",
|
|
5225
5232
|
Do,
|
|
@@ -5269,21 +5276,21 @@ async function _d(t = {}) {
|
|
|
5269
5276
|
}
|
|
5270
5277
|
}
|
|
5271
5278
|
function ui(a, h) {
|
|
5272
|
-
const _ = a.accentColor ?? e.accentColor, k = a.colorScheme ?? e.colorScheme,
|
|
5279
|
+
const _ = a.accentColor ?? e.accentColor, k = a.colorScheme ?? e.colorScheme, M = a.fontFamily ?? e.fontFamily, Y = a.scribbleStyle ?? e.scribbleStyle;
|
|
5273
5280
|
r = Tr(
|
|
5274
5281
|
_,
|
|
5275
5282
|
Y
|
|
5276
5283
|
), Er(o, r, {
|
|
5277
5284
|
accentColor: _,
|
|
5278
5285
|
colorScheme: k,
|
|
5279
|
-
fontFamily:
|
|
5286
|
+
fontFamily: M,
|
|
5280
5287
|
scribbleStyle: Y
|
|
5281
5288
|
}), we("web-sdk.widget", "Updated widget appearance", {
|
|
5282
5289
|
source: h,
|
|
5283
5290
|
inputAppearance: a,
|
|
5284
5291
|
appliedAccentColor: _,
|
|
5285
5292
|
appliedColorScheme: k,
|
|
5286
|
-
appliedFontFamily:
|
|
5293
|
+
appliedFontFamily: M,
|
|
5287
5294
|
appliedScribbleStyle: Y,
|
|
5288
5295
|
cssAccent: o.style.getPropertyValue("--pluno-pa-accent")
|
|
5289
5296
|
});
|
|
@@ -5292,11 +5299,11 @@ async function _d(t = {}) {
|
|
|
5292
5299
|
function Tr(t, e) {
|
|
5293
5300
|
return { accentColor: t, scribbleStyle: e };
|
|
5294
5301
|
}
|
|
5295
|
-
function
|
|
5296
|
-
const e =
|
|
5297
|
-
return e === null ? "#fafafa" :
|
|
5302
|
+
function vd(t) {
|
|
5303
|
+
const e = Sd(t);
|
|
5304
|
+
return e === null ? "#fafafa" : Id(e) > 0.5 ? "#18181b" : "#fafaf9";
|
|
5298
5305
|
}
|
|
5299
|
-
function
|
|
5306
|
+
function Sd(t) {
|
|
5300
5307
|
const e = t.trim();
|
|
5301
5308
|
return /^#[0-9a-f]{6}$/i.test(e) ? [
|
|
5302
5309
|
Number.parseInt(e.slice(1, 3), 16),
|
|
@@ -5308,7 +5315,7 @@ function xd(t) {
|
|
|
5308
5315
|
Number.parseInt(e[3] + e[3], 16)
|
|
5309
5316
|
] : null;
|
|
5310
5317
|
}
|
|
5311
|
-
function
|
|
5318
|
+
function Id([t, e, n]) {
|
|
5312
5319
|
const i = (o) => {
|
|
5313
5320
|
const r = o / 255;
|
|
5314
5321
|
return r <= 0.03928 ? r / 12.92 : ((r + 0.055) / 1.055) ** 2.4;
|
|
@@ -5326,8 +5333,8 @@ function Er(t, e, n) {
|
|
|
5326
5333
|
const i = n.scribbleStyle ? _s(n.accentColor) : n.accentColor;
|
|
5327
5334
|
t.style.setProperty("--pluno-pa-accent", i), n.scribbleStyle ? t.style.setProperty(
|
|
5328
5335
|
"--pluno-pa-accent-contrast",
|
|
5329
|
-
|
|
5330
|
-
) : t.style.removeProperty("--pluno-pa-accent-contrast"), t.style.fontFamily = n.scribbleStyle ?
|
|
5336
|
+
vd(i)
|
|
5337
|
+
) : t.style.removeProperty("--pluno-pa-accent-contrast"), t.style.fontFamily = n.scribbleStyle ? sd : n.fontFamily, n.scribbleStyle && Td(t.ownerDocument);
|
|
5331
5338
|
const o = Array.from(
|
|
5332
5339
|
t.querySelectorAll(".pluno-pa-widget__character")
|
|
5333
5340
|
);
|
|
@@ -5339,7 +5346,7 @@ function Er(t, e, n) {
|
|
|
5339
5346
|
)
|
|
5340
5347
|
);
|
|
5341
5348
|
}
|
|
5342
|
-
function
|
|
5349
|
+
function Td(t) {
|
|
5343
5350
|
if (t.getElementById(vr))
|
|
5344
5351
|
return;
|
|
5345
5352
|
const e = t.createElement("style");
|
|
@@ -5351,7 +5358,7 @@ function Sd(t) {
|
|
|
5351
5358
|
src: url("https://fonts.gstatic.com/s/architectsdaughter/v20/KtkxAKiDZI_td1Lkx62xHZHDtgO_Y-bvTYlg4-7jA-U.woff2") format("woff2");
|
|
5352
5359
|
}`, t.head.appendChild(e), t.fonts?.load('16px "Architects Daughter"');
|
|
5353
5360
|
}
|
|
5354
|
-
function
|
|
5361
|
+
function Ed({
|
|
5355
5362
|
root: t,
|
|
5356
5363
|
launcher: e,
|
|
5357
5364
|
launcherDragHandle: n,
|
|
@@ -5393,7 +5400,7 @@ function Id({
|
|
|
5393
5400
|
e.removeEventListener("pointerdown", f), e.removeEventListener("pointermove", b), e.removeEventListener("pointerup", w), e.removeEventListener("pointercancel", m), e.removeEventListener("click", u, !0), n.removeEventListener("keydown", x);
|
|
5394
5401
|
};
|
|
5395
5402
|
}
|
|
5396
|
-
function
|
|
5403
|
+
function Cd({
|
|
5397
5404
|
root: t,
|
|
5398
5405
|
handle: e,
|
|
5399
5406
|
getPosition: n,
|
|
@@ -5424,7 +5431,7 @@ function Td({
|
|
|
5424
5431
|
e.removeEventListener("pointerdown", g), e.removeEventListener("pointermove", c), e.removeEventListener("pointerup", f), e.removeEventListener("pointercancel", b), e.removeEventListener("keydown", w);
|
|
5425
5432
|
};
|
|
5426
5433
|
}
|
|
5427
|
-
function
|
|
5434
|
+
function kd({
|
|
5428
5435
|
root: t,
|
|
5429
5436
|
handles: e,
|
|
5430
5437
|
getBounds: n,
|
|
@@ -5471,11 +5478,11 @@ function kr(t, e, n, i) {
|
|
|
5471
5478
|
delta: n,
|
|
5472
5479
|
resizeLeading: e.endsWith("left") || e === "left",
|
|
5473
5480
|
resizeTrailing: e.endsWith("right") || e === "right",
|
|
5474
|
-
minLeading:
|
|
5475
|
-
maxTrailing: o.width -
|
|
5481
|
+
minLeading: q,
|
|
5482
|
+
maxTrailing: o.width - q,
|
|
5476
5483
|
minLength: Math.min(
|
|
5477
5484
|
co,
|
|
5478
|
-
o.width -
|
|
5485
|
+
o.width - q * 2
|
|
5479
5486
|
)
|
|
5480
5487
|
}), s = Ar({
|
|
5481
5488
|
leading: t.position.y,
|
|
@@ -5484,10 +5491,10 @@ function kr(t, e, n, i) {
|
|
|
5484
5491
|
resizeLeading: e.startsWith("top") || e === "top",
|
|
5485
5492
|
resizeTrailing: e.startsWith("bottom") || e === "bottom",
|
|
5486
5493
|
minLeading: gt,
|
|
5487
|
-
maxTrailing: o.height -
|
|
5494
|
+
maxTrailing: o.height - q,
|
|
5488
5495
|
minLength: Math.min(
|
|
5489
5496
|
uo,
|
|
5490
|
-
o.height - gt -
|
|
5497
|
+
o.height - gt - q
|
|
5491
5498
|
)
|
|
5492
5499
|
});
|
|
5493
5500
|
return {
|
|
@@ -5545,38 +5552,38 @@ function Ar({
|
|
|
5545
5552
|
function Kt(t, e = !0) {
|
|
5546
5553
|
const n = ye();
|
|
5547
5554
|
if (t.classList.contains("pluno-pa-widget--minimized")) {
|
|
5548
|
-
const r = typeof window.matchMedia == "function" && window.matchMedia("(hover: none), (pointer: coarse)").matches ?
|
|
5555
|
+
const r = typeof window.matchMedia == "function" && window.matchMedia("(hover: none), (pointer: coarse)").matches ? ld : ad;
|
|
5549
5556
|
return { width: r, height: r };
|
|
5550
5557
|
}
|
|
5551
5558
|
const i = t.getBoundingClientRect(), o = !t.classList.contains("pluno-pa-widget--open") && !t.classList.contains("pluno-pa-widget--closing");
|
|
5552
5559
|
return {
|
|
5553
5560
|
width: e && o && i.width > 0 ? i.width : Math.min(Ts, n.width - 36),
|
|
5554
|
-
height: e && o && i.height > 0 ? i.height : t.classList.contains("pluno-pa-widget--scribble") ?
|
|
5561
|
+
height: e && o && i.height > 0 ? i.height : t.classList.contains("pluno-pa-widget--scribble") ? cd : Es
|
|
5555
5562
|
};
|
|
5556
5563
|
}
|
|
5557
|
-
function
|
|
5564
|
+
function Ad() {
|
|
5558
5565
|
const t = ye();
|
|
5559
5566
|
return {
|
|
5560
5567
|
width: Math.min(
|
|
5561
5568
|
_e(
|
|
5562
|
-
t.width *
|
|
5569
|
+
t.width * ud,
|
|
5563
5570
|
co,
|
|
5564
|
-
|
|
5571
|
+
dd
|
|
5565
5572
|
),
|
|
5566
|
-
t.width -
|
|
5573
|
+
t.width - q * 2
|
|
5567
5574
|
),
|
|
5568
5575
|
height: Math.min(
|
|
5569
5576
|
_e(
|
|
5570
|
-
t.height *
|
|
5577
|
+
t.height * hd,
|
|
5571
5578
|
uo,
|
|
5572
|
-
|
|
5579
|
+
gd
|
|
5573
5580
|
),
|
|
5574
|
-
t.height - gt -
|
|
5581
|
+
t.height - gt - q
|
|
5575
5582
|
)
|
|
5576
5583
|
};
|
|
5577
5584
|
}
|
|
5578
5585
|
function ut(t = null) {
|
|
5579
|
-
return t ? $n(t) :
|
|
5586
|
+
return t ? $n(t) : Ad();
|
|
5580
5587
|
}
|
|
5581
5588
|
function $n(t) {
|
|
5582
5589
|
const e = ye();
|
|
@@ -5585,22 +5592,22 @@ function $n(t) {
|
|
|
5585
5592
|
t.width,
|
|
5586
5593
|
Math.min(
|
|
5587
5594
|
co,
|
|
5588
|
-
e.width -
|
|
5595
|
+
e.width - q * 2
|
|
5589
5596
|
),
|
|
5590
5597
|
Math.max(
|
|
5591
|
-
|
|
5592
|
-
e.width -
|
|
5598
|
+
q,
|
|
5599
|
+
e.width - q * 2
|
|
5593
5600
|
)
|
|
5594
5601
|
),
|
|
5595
5602
|
height: _e(
|
|
5596
5603
|
t.height,
|
|
5597
5604
|
Math.min(
|
|
5598
5605
|
uo,
|
|
5599
|
-
e.height - gt -
|
|
5606
|
+
e.height - gt - q
|
|
5600
5607
|
),
|
|
5601
5608
|
Math.max(
|
|
5602
|
-
|
|
5603
|
-
e.height - gt -
|
|
5609
|
+
q,
|
|
5610
|
+
e.height - gt - q
|
|
5604
5611
|
)
|
|
5605
5612
|
)
|
|
5606
5613
|
};
|
|
@@ -5613,7 +5620,7 @@ function Ti(t, e) {
|
|
|
5613
5620
|
const n = $n(e);
|
|
5614
5621
|
t.style.setProperty("--pluno-pa-panel-width", `${n.width}px`), t.style.setProperty("--pluno-pa-panel-height", `${n.height}px`);
|
|
5615
5622
|
}
|
|
5616
|
-
function
|
|
5623
|
+
function Rd(t, e, n) {
|
|
5617
5624
|
const i = Number.parseFloat(t.style.left), o = Number.parseFloat(t.style.top);
|
|
5618
5625
|
if (Number.isFinite(i) && Number.isFinite(o))
|
|
5619
5626
|
return { x: i, y: o };
|
|
@@ -5632,9 +5639,9 @@ function Ei(t, e, n) {
|
|
|
5632
5639
|
t,
|
|
5633
5640
|
Rn(e, i),
|
|
5634
5641
|
i
|
|
5635
|
-
) :
|
|
5642
|
+
) : Md(n === "bottom-left" ? "bottom-left" : "bottom-right", i, pd);
|
|
5636
5643
|
}
|
|
5637
|
-
function
|
|
5644
|
+
function Md(t, e, n) {
|
|
5638
5645
|
const i = ye();
|
|
5639
5646
|
return {
|
|
5640
5647
|
x: t.endsWith("right") ? Math.max(0, i.width - e.width - n) : n,
|
|
@@ -5642,14 +5649,14 @@ function Ad(t, e, n) {
|
|
|
5642
5649
|
};
|
|
5643
5650
|
}
|
|
5644
5651
|
function An(t, e, n) {
|
|
5645
|
-
const i = ye(), o =
|
|
5652
|
+
const i = ye(), o = q + Ld(t);
|
|
5646
5653
|
return {
|
|
5647
5654
|
x: _e(
|
|
5648
5655
|
e.x,
|
|
5649
|
-
|
|
5656
|
+
q,
|
|
5650
5657
|
Math.max(
|
|
5651
|
-
|
|
5652
|
-
i.width - n.width -
|
|
5658
|
+
q,
|
|
5659
|
+
i.width - n.width - q
|
|
5653
5660
|
)
|
|
5654
5661
|
),
|
|
5655
5662
|
y: _e(
|
|
@@ -5657,7 +5664,7 @@ function An(t, e, n) {
|
|
|
5657
5664
|
o,
|
|
5658
5665
|
Math.max(
|
|
5659
5666
|
o,
|
|
5660
|
-
i.height - n.height -
|
|
5667
|
+
i.height - n.height - q
|
|
5661
5668
|
)
|
|
5662
5669
|
)
|
|
5663
5670
|
};
|
|
@@ -5670,19 +5677,19 @@ function Rn(t, e) {
|
|
|
5670
5677
|
};
|
|
5671
5678
|
}
|
|
5672
5679
|
function Ci(t, e) {
|
|
5673
|
-
const n =
|
|
5680
|
+
const n = Pd(t, e), i = ye();
|
|
5674
5681
|
return {
|
|
5675
5682
|
anchor: n,
|
|
5676
5683
|
x: n.endsWith("right") ? i.width - t.x - e.width : t.x,
|
|
5677
5684
|
y: n.startsWith("bottom") ? i.height - t.y - e.height : t.y
|
|
5678
5685
|
};
|
|
5679
5686
|
}
|
|
5680
|
-
function
|
|
5687
|
+
function Pd(t, e) {
|
|
5681
5688
|
const n = ye(), i = t.x + e.width / 2, r = t.y + e.height / 2 <= n.height / 2 ? "top" : "bottom", s = i <= n.width / 2 ? "left" : "right";
|
|
5682
5689
|
return `${r}-${s}`;
|
|
5683
5690
|
}
|
|
5684
|
-
function
|
|
5685
|
-
return t.classList.contains("pluno-pa-widget--scribble") ?
|
|
5691
|
+
function Ld(t) {
|
|
5692
|
+
return t.classList.contains("pluno-pa-widget--scribble") ? bd : wd;
|
|
5686
5693
|
}
|
|
5687
5694
|
function ki(t, e, n, i = null) {
|
|
5688
5695
|
const o = Kt(t), r = ut(i), s = {
|
|
@@ -5691,7 +5698,7 @@ function ki(t, e, n, i = null) {
|
|
|
5691
5698
|
};
|
|
5692
5699
|
return Ht(s, r);
|
|
5693
5700
|
}
|
|
5694
|
-
function
|
|
5701
|
+
function Nd(t, e, n, i) {
|
|
5695
5702
|
return {
|
|
5696
5703
|
x: i === "bottom-left" ? t.x : t.x + e.width - n.width,
|
|
5697
5704
|
y: t.y + e.height - n.height
|
|
@@ -5702,10 +5709,10 @@ function Ht(t, e) {
|
|
|
5702
5709
|
return {
|
|
5703
5710
|
x: _e(
|
|
5704
5711
|
t.x,
|
|
5705
|
-
|
|
5712
|
+
q,
|
|
5706
5713
|
Math.max(
|
|
5707
|
-
|
|
5708
|
-
n.width - e.width -
|
|
5714
|
+
q,
|
|
5715
|
+
n.width - e.width - q
|
|
5709
5716
|
)
|
|
5710
5717
|
),
|
|
5711
5718
|
y: _e(
|
|
@@ -5713,7 +5720,7 @@ function Ht(t, e) {
|
|
|
5713
5720
|
gt,
|
|
5714
5721
|
Math.max(
|
|
5715
5722
|
gt,
|
|
5716
|
-
n.height - e.height -
|
|
5723
|
+
n.height - e.height - q
|
|
5717
5724
|
)
|
|
5718
5725
|
)
|
|
5719
5726
|
};
|
|
@@ -5725,7 +5732,7 @@ function Je(t, e) {
|
|
|
5725
5732
|
}
|
|
5726
5733
|
t.style.left = `${e.x}px`, t.style.top = `${e.y}px`, t.style.right = "auto", t.style.bottom = "auto";
|
|
5727
5734
|
}
|
|
5728
|
-
function
|
|
5735
|
+
function Dd(t, e) {
|
|
5729
5736
|
t.style.setProperty("--pluno-pa-panel-offset-x", `${e.x}px`), t.style.setProperty("--pluno-pa-panel-offset-y", `${e.y}px`);
|
|
5730
5737
|
}
|
|
5731
5738
|
function Rr(t) {
|
|
@@ -5733,8 +5740,8 @@ function Rr(t) {
|
|
|
5733
5740
|
}
|
|
5734
5741
|
function ye() {
|
|
5735
5742
|
return {
|
|
5736
|
-
width: window.innerWidth || document.documentElement.clientWidth || Ts +
|
|
5737
|
-
height: window.innerHeight || document.documentElement.clientHeight || Es +
|
|
5743
|
+
width: window.innerWidth || document.documentElement.clientWidth || Ts + q * 2,
|
|
5744
|
+
height: window.innerHeight || document.documentElement.clientHeight || Es + q * 2
|
|
5738
5745
|
};
|
|
5739
5746
|
}
|
|
5740
5747
|
function Ai(t) {
|
|
@@ -5759,30 +5766,30 @@ function we(t, e, n) {
|
|
|
5759
5766
|
details: n
|
|
5760
5767
|
}, r = i.__plunoProductAgentDiagnostics__ ?? [];
|
|
5761
5768
|
r.push(o), r.length > 120 && r.splice(0, r.length - 120), i.__plunoProductAgentDiagnostics__ = r, i.__PLUNO_PRODUCT_AGENT_DIAGNOSTICS__ = () => [...r], window.dispatchEvent(
|
|
5762
|
-
new CustomEvent(
|
|
5769
|
+
new CustomEvent(td, { detail: o })
|
|
5763
5770
|
);
|
|
5764
5771
|
}
|
|
5765
|
-
function
|
|
5772
|
+
function Ud(t, e) {
|
|
5766
5773
|
we("web-sdk.widget.position", t, e);
|
|
5767
5774
|
}
|
|
5768
|
-
async function
|
|
5775
|
+
async function Od(t, e, n, i) {
|
|
5769
5776
|
i(), await t.sendMessage(e, {
|
|
5770
|
-
attachments: n.length > 0 ? n.map(
|
|
5777
|
+
attachments: n.length > 0 ? n.map(Fd) : void 0
|
|
5771
5778
|
});
|
|
5772
5779
|
}
|
|
5773
|
-
function
|
|
5780
|
+
function zd(t, e, n) {
|
|
5774
5781
|
const i = t.activeElement;
|
|
5775
5782
|
return i === n ? "composer" : i === e ? "launcher" : null;
|
|
5776
5783
|
}
|
|
5777
|
-
function
|
|
5778
|
-
if (!t.focusedInput || !t.focusedInputAt || Date.now() - t.focusedInputAt >
|
|
5784
|
+
function Bd(t, e, n, i) {
|
|
5785
|
+
if (!t.focusedInput || !t.focusedInputAt || Date.now() - t.focusedInputAt > Hc)
|
|
5779
5786
|
return;
|
|
5780
5787
|
const o = t.focusedInput === "composer" ? i : n;
|
|
5781
5788
|
o === i && !e.classList.contains("pluno-pa-widget--open") || o === n && e.classList.contains("pluno-pa-widget--open") || window.requestAnimationFrame(() => {
|
|
5782
5789
|
!o.isConnected || o.readOnly || (o.focus(), o.setSelectionRange(o.value.length, o.value.length));
|
|
5783
5790
|
});
|
|
5784
5791
|
}
|
|
5785
|
-
function
|
|
5792
|
+
function Fd(t) {
|
|
5786
5793
|
return t;
|
|
5787
5794
|
}
|
|
5788
5795
|
function Wt(t) {
|
|
@@ -5793,7 +5800,7 @@ function $t(t, e = () => !0) {
|
|
|
5793
5800
|
e() && (t.scrollTop = t.scrollHeight);
|
|
5794
5801
|
});
|
|
5795
5802
|
}
|
|
5796
|
-
function
|
|
5803
|
+
function qd(t) {
|
|
5797
5804
|
const e = t.messages[t.messages.length - 1];
|
|
5798
5805
|
return [
|
|
5799
5806
|
t.messages.length,
|
|
@@ -5804,13 +5811,13 @@ function Bd(t) {
|
|
|
5804
5811
|
t.lastError ?? ""
|
|
5805
5812
|
].join(":");
|
|
5806
5813
|
}
|
|
5807
|
-
function
|
|
5814
|
+
function Wd(t) {
|
|
5808
5815
|
return t.messages.length > 0 || t.assistantDraft.length > 0 || t.isThinking || !!t.lastError;
|
|
5809
5816
|
}
|
|
5810
|
-
function
|
|
5817
|
+
function Hd(t) {
|
|
5811
5818
|
return t.firstUserMessage?.trim() ? t.firstUserMessage : t.title?.trim() ? t.title : "Untitled chat";
|
|
5812
5819
|
}
|
|
5813
|
-
function
|
|
5820
|
+
function $d(t) {
|
|
5814
5821
|
const e = t.currentPage;
|
|
5815
5822
|
if (typeof e?.url == "string" && e.url.trim())
|
|
5816
5823
|
try {
|
|
@@ -5821,7 +5828,7 @@ function Wd(t) {
|
|
|
5821
5828
|
}
|
|
5822
5829
|
return typeof e?.origin == "string" && e.origin.trim() ? e.origin : "Current origin";
|
|
5823
5830
|
}
|
|
5824
|
-
function
|
|
5831
|
+
function jd(t, e) {
|
|
5825
5832
|
const n = new Date(t).getTime();
|
|
5826
5833
|
if (!Number.isFinite(n))
|
|
5827
5834
|
return "now";
|
|
@@ -5837,9 +5844,9 @@ function Hd(t, e) {
|
|
|
5837
5844
|
}
|
|
5838
5845
|
return "now";
|
|
5839
5846
|
}
|
|
5840
|
-
function
|
|
5841
|
-
t.appendChild(
|
|
5842
|
-
|
|
5847
|
+
function Gd(t, e, n, i, o) {
|
|
5848
|
+
t.appendChild(iu()), t.appendChild(
|
|
5849
|
+
Kd(
|
|
5843
5850
|
e,
|
|
5844
5851
|
n,
|
|
5845
5852
|
i,
|
|
@@ -5849,12 +5856,12 @@ function $d(t, e, n, i, o) {
|
|
|
5849
5856
|
jn(
|
|
5850
5857
|
"pluno-pa-widget__close",
|
|
5851
5858
|
"Close",
|
|
5852
|
-
|
|
5859
|
+
ou(16),
|
|
5853
5860
|
!0
|
|
5854
5861
|
)
|
|
5855
|
-
), t.appendChild(
|
|
5862
|
+
), t.appendChild(Vd(n, i));
|
|
5856
5863
|
}
|
|
5857
|
-
function
|
|
5864
|
+
function Kd(t, e, n, i) {
|
|
5858
5865
|
const o = document.createElement("form");
|
|
5859
5866
|
if (o.className = "pluno-pa-widget__launcher", i && o.classList.add("pluno-pa-widget__launcher--minimizable"), n) {
|
|
5860
5867
|
o.classList.add("pluno-pa-widget__launcher--movable");
|
|
@@ -5883,7 +5890,7 @@ function jd(t, e, n, i) {
|
|
|
5883
5890
|
}
|
|
5884
5891
|
return o;
|
|
5885
5892
|
}
|
|
5886
|
-
function
|
|
5893
|
+
function Vd(t, e) {
|
|
5887
5894
|
const n = document.createElement("section");
|
|
5888
5895
|
if (n.className = "pluno-pa-widget__panel", n.hidden = !0, n.appendChild(
|
|
5889
5896
|
Ls("pluno-pa-widget__scribble-spirals--panel", 16)
|
|
@@ -5894,7 +5901,7 @@ function Gd(t, e) {
|
|
|
5894
5901
|
const i = document.createElement("div");
|
|
5895
5902
|
i.className = "pluno-pa-widget__timeline-wrap";
|
|
5896
5903
|
const o = document.createElement("main");
|
|
5897
|
-
o.className = "pluno-pa-widget__timeline", o.appendChild(
|
|
5904
|
+
o.className = "pluno-pa-widget__timeline", o.appendChild(eu(t));
|
|
5898
5905
|
const r = document.createElement("div");
|
|
5899
5906
|
r.className = "pluno-pa-widget__timeline-bottom-sentinel", r.setAttribute("aria-hidden", "true"), o.appendChild(r), i.appendChild(o);
|
|
5900
5907
|
const s = document.createElement("div");
|
|
@@ -5906,10 +5913,10 @@ function Gd(t, e) {
|
|
|
5906
5913
|
jn(
|
|
5907
5914
|
"pluno-pa-widget__history",
|
|
5908
5915
|
Xi(),
|
|
5909
|
-
|
|
5916
|
+
au(),
|
|
5910
5917
|
!0
|
|
5911
5918
|
)
|
|
5912
|
-
), i.appendChild(p), i.appendChild(
|
|
5919
|
+
), i.appendChild(p), i.appendChild(Qd()), n.appendChild(i), n.appendChild(Xd()), n.appendChild(Yd()), n.appendChild(Jd()), n.appendChild(Zd()), n.appendChild(Ze("left", "Resize Pluno from left")), n.appendChild(
|
|
5913
5920
|
Ze("right", "Resize Pluno from right")
|
|
5914
5921
|
), n.appendChild(Ze("top", "Resize Pluno from top")), n.appendChild(
|
|
5915
5922
|
Ze("bottom", "Resize Pluno from bottom")
|
|
@@ -5930,7 +5937,7 @@ function Ze(t, e) {
|
|
|
5930
5937
|
`pluno-pa-widget__resize-handle--${t}`
|
|
5931
5938
|
].join(" "), n.dataset.resizeDirection = t, n.setAttribute("aria-label", e), n.title = e, n;
|
|
5932
5939
|
}
|
|
5933
|
-
function
|
|
5940
|
+
function Xd() {
|
|
5934
5941
|
const t = document.createElement("div");
|
|
5935
5942
|
t.className = "pluno-pa-widget__notify-suggestion", t.hidden = !0;
|
|
5936
5943
|
const e = document.createElement("span");
|
|
@@ -5944,7 +5951,7 @@ function Kd() {
|
|
|
5944
5951
|
const r = document.createElement("button");
|
|
5945
5952
|
return r.type = "button", r.className = "pluno-pa-widget__notify-suggestion-never", r.textContent = "Never", n.append(i, o, r), t.append(e, n), t;
|
|
5946
5953
|
}
|
|
5947
|
-
function
|
|
5954
|
+
function Yd() {
|
|
5948
5955
|
const t = document.createElement("div");
|
|
5949
5956
|
t.className = "pluno-pa-widget__notify-suggestion pluno-pa-widget__tab-groups-suggestion", t.hidden = !0;
|
|
5950
5957
|
const e = document.createElement("span");
|
|
@@ -5956,7 +5963,7 @@ function Vd() {
|
|
|
5956
5963
|
const o = document.createElement("button");
|
|
5957
5964
|
return o.type = "button", o.className = "pluno-pa-widget__notify-suggestion-later pluno-pa-widget__tab-groups-suggestion-dismiss", o.textContent = "Not now", n.append(i, o), t.append(e, n), t;
|
|
5958
5965
|
}
|
|
5959
|
-
function
|
|
5966
|
+
function Jd() {
|
|
5960
5967
|
const t = document.createElement("aside");
|
|
5961
5968
|
t.className = "pluno-pa-widget__proactive-suggestion", t.hidden = !0;
|
|
5962
5969
|
const e = document.createElement("span");
|
|
@@ -5968,13 +5975,13 @@ function Xd() {
|
|
|
5968
5975
|
const o = document.createElement("button");
|
|
5969
5976
|
o.type = "button", o.className = "pluno-pa-widget__proactive-suggestion-dismiss", o.textContent = "Dismiss";
|
|
5970
5977
|
const r = document.createElement("button");
|
|
5971
|
-
r.type = "button", r.className = "pluno-pa-widget__proactive-suggestion-edit", r.setAttribute("aria-label", "Edit suggestion"), r.title = "Edit suggestion", r.appendChild(
|
|
5978
|
+
r.type = "button", r.className = "pluno-pa-widget__proactive-suggestion-edit", r.setAttribute("aria-label", "Edit suggestion"), r.title = "Edit suggestion", r.appendChild(su());
|
|
5972
5979
|
const s = document.createElement("button");
|
|
5973
5980
|
s.type = "button", s.className = "pluno-pa-widget__proactive-suggestion-never-show", s.textContent = "Never show this suggestion again";
|
|
5974
5981
|
const l = document.createElement("button");
|
|
5975
5982
|
return l.type = "button", l.className = "pluno-pa-widget__proactive-suggestion-run", l.textContent = "Let Pluno handle it", i.append(o, r, l, s), t.append(e, n, i), t;
|
|
5976
5983
|
}
|
|
5977
|
-
function
|
|
5984
|
+
function Zd() {
|
|
5978
5985
|
const t = document.createElement("form");
|
|
5979
5986
|
t.className = "pluno-pa-widget__composer";
|
|
5980
5987
|
const e = document.createElement("div");
|
|
@@ -5988,7 +5995,7 @@ function Yd() {
|
|
|
5988
5995
|
const r = document.createElement("input");
|
|
5989
5996
|
r.className = "pluno-pa-widget__attachment-input", r.type = "file", r.multiple = !0, r.tabIndex = -1, r.setAttribute("aria-hidden", "true"), o.appendChild(r);
|
|
5990
5997
|
const s = document.createElement("button");
|
|
5991
|
-
s.type = "button", s.className = "pluno-pa-widget__attach", s.setAttribute("aria-label", "Attach files"), s.title = "Attach files", s.appendChild(
|
|
5998
|
+
s.type = "button", s.className = "pluno-pa-widget__attach", s.setAttribute("aria-label", "Attach files"), s.title = "Attach files", s.appendChild(pu()), s.appendChild(cu()), o.appendChild(s);
|
|
5992
5999
|
const l = document.createElement("textarea");
|
|
5993
6000
|
l.className = "pluno-pa-widget__input", l.rows = 1, l.placeholder = "Ask for anything...", o.appendChild(l);
|
|
5994
6001
|
const p = document.createElement("button");
|
|
@@ -6003,7 +6010,7 @@ function Yd() {
|
|
|
6003
6010
|
function Xi() {
|
|
6004
6011
|
return location.hostname ? `Recent chats on ${location.hostname}` : "Recent chats";
|
|
6005
6012
|
}
|
|
6006
|
-
function
|
|
6013
|
+
function Qd() {
|
|
6007
6014
|
const t = document.createElement("section");
|
|
6008
6015
|
t.className = "pluno-pa-widget__history-panel", t.hidden = !0, t.setAttribute("aria-label", Xi());
|
|
6009
6016
|
const e = document.createElement("div");
|
|
@@ -6022,7 +6029,7 @@ function Jd() {
|
|
|
6022
6029
|
const r = document.createElement("p");
|
|
6023
6030
|
return r.className = "pluno-pa-widget__history-status", r.hidden = !0, t.append(e, o, r), t;
|
|
6024
6031
|
}
|
|
6025
|
-
function
|
|
6032
|
+
function eu(t) {
|
|
6026
6033
|
const e = document.createElement("div");
|
|
6027
6034
|
return e.className = "pluno-pa-widget__empty-state", e.appendChild(
|
|
6028
6035
|
it(
|
|
@@ -6035,7 +6042,7 @@ function Rs() {
|
|
|
6035
6042
|
const t = document.createElement("div");
|
|
6036
6043
|
return t.className = "pluno-pa-widget__empty", t.appendChild(document.createTextNode("Hey there, I'm Pluno 👋")), t.appendChild(document.createElement("br")), t.appendChild(document.createTextNode("What do you want to do today?")), t;
|
|
6037
6044
|
}
|
|
6038
|
-
function
|
|
6045
|
+
function Ms(t, e) {
|
|
6039
6046
|
t.replaceChildren(), t.setAttribute(
|
|
6040
6047
|
"aria-label",
|
|
6041
6048
|
`${e.toLocaleString("en-US")} users currently active`
|
|
@@ -6050,14 +6057,14 @@ function Ps(t, e) {
|
|
|
6050
6057
|
function it(t, e) {
|
|
6051
6058
|
const n = `pluno-pa-character-${Ir}`;
|
|
6052
6059
|
Ir += 1;
|
|
6053
|
-
const i = e.scribbleStyle ?
|
|
6060
|
+
const i = e.scribbleStyle ? nu(e.accentColor, n) : tu(e.accentColor, n), o = t.split(/\s+/).filter(Boolean);
|
|
6054
6061
|
return i.setAttribute(
|
|
6055
6062
|
"class",
|
|
6056
6063
|
o.includes("pluno-pa-widget__character") ? t : `pluno-pa-widget__character ${t}`
|
|
6057
6064
|
), i.setAttribute("aria-hidden", "true"), i.setAttribute("focusable", "false"), i.removeAttribute("role"), i.removeAttribute("aria-label"), i;
|
|
6058
6065
|
}
|
|
6059
|
-
function
|
|
6060
|
-
const n =
|
|
6066
|
+
function tu(t, e) {
|
|
6067
|
+
const n = wc(t), i = {
|
|
6061
6068
|
boltFill: `${e}-boltFill`,
|
|
6062
6069
|
boltEdge: `${e}-boltEdge`,
|
|
6063
6070
|
boltGlow: `${e}-boltGlow`,
|
|
@@ -6068,7 +6075,7 @@ function Qd(t, e) {
|
|
|
6068
6075
|
eyeShadow: `${e}-eyeShadow`,
|
|
6069
6076
|
pupilGloss: `${e}-pupilGloss`,
|
|
6070
6077
|
boltClip: `${e}-boltClip`
|
|
6071
|
-
}, o =
|
|
6078
|
+
}, o = Ps(), r = E(o, "defs"), s = E(r, "linearGradient", {
|
|
6072
6079
|
id: i.boltFill,
|
|
6073
6080
|
x1: "420",
|
|
6074
6081
|
y1: "180",
|
|
@@ -6231,7 +6238,7 @@ function Qd(t, e) {
|
|
|
6231
6238
|
opacity: "0.48"
|
|
6232
6239
|
});
|
|
6233
6240
|
const A = E(o, "g", { filter: be(i.eyeShadow) });
|
|
6234
|
-
return
|
|
6241
|
+
return Mr(
|
|
6235
6242
|
A,
|
|
6236
6243
|
"rotate(-2 528 463)",
|
|
6237
6244
|
"528",
|
|
@@ -6241,7 +6248,7 @@ function Qd(t, e) {
|
|
|
6241
6248
|
"557",
|
|
6242
6249
|
"447",
|
|
6243
6250
|
i
|
|
6244
|
-
),
|
|
6251
|
+
), Mr(
|
|
6245
6252
|
A,
|
|
6246
6253
|
"rotate(2 717 462)",
|
|
6247
6254
|
"717",
|
|
@@ -6253,11 +6260,11 @@ function Qd(t, e) {
|
|
|
6253
6260
|
i
|
|
6254
6261
|
), o;
|
|
6255
6262
|
}
|
|
6256
|
-
function
|
|
6263
|
+
function nu(t, e) {
|
|
6257
6264
|
const n = _s(t), i = {
|
|
6258
6265
|
clip: `${e}-scribbleBoltClip`,
|
|
6259
6266
|
wobble: `${e}-scribbleBoltWobble`
|
|
6260
|
-
}, o =
|
|
6267
|
+
}, o = Ps(), r = E(o, "defs"), s = E(r, "clipPath", { id: i.clip });
|
|
6261
6268
|
E(s, "path", { d: Nn });
|
|
6262
6269
|
const l = E(r, "filter", {
|
|
6263
6270
|
id: i.wobble,
|
|
@@ -6284,7 +6291,7 @@ function eu(t, e) {
|
|
|
6284
6291
|
"clip-path": be(i.clip)
|
|
6285
6292
|
});
|
|
6286
6293
|
return E(d, "path", {
|
|
6287
|
-
d:
|
|
6294
|
+
d: mc(),
|
|
6288
6295
|
fill: "none",
|
|
6289
6296
|
stroke: n,
|
|
6290
6297
|
"stroke-width": "56",
|
|
@@ -6298,7 +6305,7 @@ function eu(t, e) {
|
|
|
6298
6305
|
stroke: Dn,
|
|
6299
6306
|
"stroke-width": "18",
|
|
6300
6307
|
"stroke-linejoin": "round"
|
|
6301
|
-
}),
|
|
6308
|
+
}), Pr(
|
|
6302
6309
|
p,
|
|
6303
6310
|
"rotate(-2 528 463)",
|
|
6304
6311
|
"528",
|
|
@@ -6307,7 +6314,7 @@ function eu(t, e) {
|
|
|
6307
6314
|
"473",
|
|
6308
6315
|
"557",
|
|
6309
6316
|
"447"
|
|
6310
|
-
),
|
|
6317
|
+
), Pr(
|
|
6311
6318
|
p,
|
|
6312
6319
|
"rotate(2 717 462)",
|
|
6313
6320
|
"717",
|
|
@@ -6318,13 +6325,13 @@ function eu(t, e) {
|
|
|
6318
6325
|
"447"
|
|
6319
6326
|
), o;
|
|
6320
6327
|
}
|
|
6321
|
-
function
|
|
6328
|
+
function Ps() {
|
|
6322
6329
|
return N("svg", {
|
|
6323
6330
|
xmlns: Cs,
|
|
6324
6331
|
viewBox: "0 0 1254 1254"
|
|
6325
6332
|
});
|
|
6326
6333
|
}
|
|
6327
|
-
function
|
|
6334
|
+
function Mr(t, e, n, i, o, r, s, l, p) {
|
|
6328
6335
|
const d = E(t, "g", { transform: e });
|
|
6329
6336
|
E(d, "ellipse", {
|
|
6330
6337
|
cx: n,
|
|
@@ -6346,7 +6353,7 @@ function Pr(t, e, n, i, o, r, s, l, p) {
|
|
|
6346
6353
|
fill: "#ffffff"
|
|
6347
6354
|
});
|
|
6348
6355
|
}
|
|
6349
|
-
function
|
|
6356
|
+
function Pr(t, e, n, i, o, r, s, l) {
|
|
6350
6357
|
const p = E(t, "g", { transform: e });
|
|
6351
6358
|
E(p, "ellipse", {
|
|
6352
6359
|
cx: n,
|
|
@@ -6384,7 +6391,7 @@ function jn(t, e, n, i) {
|
|
|
6384
6391
|
const o = document.createElement("button");
|
|
6385
6392
|
return o.type = "button", o.className = t, o.setAttribute("aria-label", e), o.title = e, o.hidden = i, o.appendChild(n), o;
|
|
6386
6393
|
}
|
|
6387
|
-
function
|
|
6394
|
+
function iu() {
|
|
6388
6395
|
const t = N("svg", {
|
|
6389
6396
|
class: "pluno-pa-widget__scribble-defs",
|
|
6390
6397
|
"aria-hidden": "true",
|
|
@@ -6392,10 +6399,10 @@ function tu() {
|
|
|
6392
6399
|
width: "0",
|
|
6393
6400
|
height: "0"
|
|
6394
6401
|
}), e = N("defs");
|
|
6395
|
-
return e.appendChild(
|
|
6396
|
-
|
|
6402
|
+
return e.appendChild(Mi("pluno-pa-scribble-wobble", "2", "12")), e.appendChild(
|
|
6403
|
+
Mi("pluno-pa-scribble-wobble-2", "5", "15")
|
|
6397
6404
|
), e.appendChild(
|
|
6398
|
-
|
|
6405
|
+
Mi("pluno-pa-scribble-wobble-3", "9", "19")
|
|
6399
6406
|
), t.appendChild(e), t;
|
|
6400
6407
|
}
|
|
6401
6408
|
function Ls(t, e) {
|
|
@@ -6414,7 +6421,7 @@ function Ri(t, e) {
|
|
|
6414
6421
|
0,
|
|
6415
6422
|
e - Vi * 2
|
|
6416
6423
|
), i = Math.max(
|
|
6417
|
-
|
|
6424
|
+
md,
|
|
6418
6425
|
Math.floor(
|
|
6419
6426
|
(n - Ki * 2) / Gi
|
|
6420
6427
|
)
|
|
@@ -6427,7 +6434,7 @@ function Ns(t, e) {
|
|
|
6427
6434
|
const n = e * Gi + Ki * 2;
|
|
6428
6435
|
t.dataset.spiralCount = `${e}`, t.setAttribute(
|
|
6429
6436
|
"viewBox",
|
|
6430
|
-
`0 0 ${n} ${
|
|
6437
|
+
`0 0 ${n} ${fd}`
|
|
6431
6438
|
), t.replaceChildren();
|
|
6432
6439
|
for (let i = 0; i < e; i += 1) {
|
|
6433
6440
|
const o = Sr[i % Sr.length], r = N("g", {
|
|
@@ -6455,7 +6462,7 @@ function Ns(t, e) {
|
|
|
6455
6462
|
), t.appendChild(r);
|
|
6456
6463
|
}
|
|
6457
6464
|
}
|
|
6458
|
-
function
|
|
6465
|
+
function Mi(t, e, n) {
|
|
6459
6466
|
const i = N("filter", {
|
|
6460
6467
|
id: t,
|
|
6461
6468
|
x: "-8%",
|
|
@@ -6498,7 +6505,7 @@ function Pi(t, e, n) {
|
|
|
6498
6505
|
})
|
|
6499
6506
|
), i;
|
|
6500
6507
|
}
|
|
6501
|
-
function
|
|
6508
|
+
function ou(t) {
|
|
6502
6509
|
const e = xe(
|
|
6503
6510
|
"0 0 24 24",
|
|
6504
6511
|
t,
|
|
@@ -6509,7 +6516,7 @@ function nu(t) {
|
|
|
6509
6516
|
);
|
|
6510
6517
|
return e.appendChild(N("path", { d: "m6 9 6 6 6-6" })), e;
|
|
6511
6518
|
}
|
|
6512
|
-
function
|
|
6519
|
+
function ru() {
|
|
6513
6520
|
const t = xe(
|
|
6514
6521
|
"0 0 24 24",
|
|
6515
6522
|
17,
|
|
@@ -6528,7 +6535,7 @@ function iu() {
|
|
|
6528
6535
|
})
|
|
6529
6536
|
), t;
|
|
6530
6537
|
}
|
|
6531
|
-
function
|
|
6538
|
+
function su() {
|
|
6532
6539
|
const t = xe(
|
|
6533
6540
|
"0 0 24 24",
|
|
6534
6541
|
14,
|
|
@@ -6547,7 +6554,7 @@ function ou() {
|
|
|
6547
6554
|
})
|
|
6548
6555
|
), t;
|
|
6549
6556
|
}
|
|
6550
|
-
function
|
|
6557
|
+
function au() {
|
|
6551
6558
|
const t = xe(
|
|
6552
6559
|
"0 0 24 24",
|
|
6553
6560
|
17,
|
|
@@ -6558,7 +6565,7 @@ function ru() {
|
|
|
6558
6565
|
);
|
|
6559
6566
|
return t.appendChild(N("path", { d: "M3 12a9 9 0 1 0 3-6.7" })), t.appendChild(N("path", { d: "M3 4v5h5" })), t.appendChild(N("path", { d: "M12 7v5l3 2" })), t;
|
|
6560
6567
|
}
|
|
6561
|
-
function
|
|
6568
|
+
function lu(t) {
|
|
6562
6569
|
const e = xe(
|
|
6563
6570
|
"0 0 16 16",
|
|
6564
6571
|
14,
|
|
@@ -6599,7 +6606,7 @@ function Us() {
|
|
|
6599
6606
|
N("line", { x1: "12", y1: "19", x2: "12", y2: "5" })
|
|
6600
6607
|
), t.appendChild(N("polyline", { points: "5 12 12 5 19 12" })), t;
|
|
6601
6608
|
}
|
|
6602
|
-
function
|
|
6609
|
+
function pu() {
|
|
6603
6610
|
const t = xe(
|
|
6604
6611
|
"0 0 24 24",
|
|
6605
6612
|
16,
|
|
@@ -6617,7 +6624,7 @@ function au() {
|
|
|
6617
6624
|
})
|
|
6618
6625
|
), t;
|
|
6619
6626
|
}
|
|
6620
|
-
function
|
|
6627
|
+
function cu() {
|
|
6621
6628
|
const t = xe("0 0 24 24", 19, 19, "none", "currentColor");
|
|
6622
6629
|
return t.setAttribute(
|
|
6623
6630
|
"class",
|
|
@@ -6632,7 +6639,7 @@ function lu() {
|
|
|
6632
6639
|
})
|
|
6633
6640
|
), t;
|
|
6634
6641
|
}
|
|
6635
|
-
function
|
|
6642
|
+
function du() {
|
|
6636
6643
|
const t = xe("0 0 24 24", 18, 18, "currentColor");
|
|
6637
6644
|
return t.appendChild(
|
|
6638
6645
|
N("rect", {
|
|
@@ -6644,7 +6651,7 @@ function pu() {
|
|
|
6644
6651
|
})
|
|
6645
6652
|
), t;
|
|
6646
6653
|
}
|
|
6647
|
-
function
|
|
6654
|
+
function uu() {
|
|
6648
6655
|
const t = xe(
|
|
6649
6656
|
"0 0 24 24",
|
|
6650
6657
|
12,
|
|
@@ -6655,7 +6662,7 @@ function cu() {
|
|
|
6655
6662
|
);
|
|
6656
6663
|
return t.appendChild(N("path", { d: "M18 6 6 18" })), t.appendChild(N("path", { d: "m6 6 12 12" })), t;
|
|
6657
6664
|
}
|
|
6658
|
-
function
|
|
6665
|
+
function gu() {
|
|
6659
6666
|
const t = xe(
|
|
6660
6667
|
"0 0 24 24",
|
|
6661
6668
|
13,
|
|
@@ -6701,18 +6708,18 @@ function Lr(t) {
|
|
|
6701
6708
|
n.stopPropagation();
|
|
6702
6709
|
});
|
|
6703
6710
|
}
|
|
6704
|
-
function
|
|
6711
|
+
function hu(t, e, n) {
|
|
6705
6712
|
t.replaceChildren(), t.hidden = e.length === 0;
|
|
6706
6713
|
for (let i = 0; i < e.length; i += 1) {
|
|
6707
6714
|
const o = e[i], r = document.createElement("div");
|
|
6708
|
-
r.className = "pluno-pa-widget__attachment", r.appendChild(
|
|
6715
|
+
r.className = "pluno-pa-widget__attachment", r.appendChild(fu(o));
|
|
6709
6716
|
const s = document.createElement("span");
|
|
6710
6717
|
s.textContent = o.name, r.appendChild(s);
|
|
6711
6718
|
const l = document.createElement("button");
|
|
6712
|
-
l.type = "button", l.setAttribute("aria-label", `Remove ${o.name}`), l.appendChild(
|
|
6719
|
+
l.type = "button", l.setAttribute("aria-label", `Remove ${o.name}`), l.appendChild(uu()), l.addEventListener("click", () => n(i)), r.appendChild(l), t.appendChild(r);
|
|
6713
6720
|
}
|
|
6714
6721
|
}
|
|
6715
|
-
function
|
|
6722
|
+
function fu(t) {
|
|
6716
6723
|
const e = fo(t), n = Os(t);
|
|
6717
6724
|
if (e === "image" && n) {
|
|
6718
6725
|
const i = document.createElement("img");
|
|
@@ -6733,7 +6740,7 @@ function gu(t) {
|
|
|
6733
6740
|
}
|
|
6734
6741
|
return Oe(t);
|
|
6735
6742
|
}
|
|
6736
|
-
function
|
|
6743
|
+
function mu(t, e) {
|
|
6737
6744
|
const n = fo(t), i = Os(t);
|
|
6738
6745
|
if (n === "image" && i) {
|
|
6739
6746
|
const o = document.createElement("img");
|
|
@@ -6795,31 +6802,31 @@ function Nr(t) {
|
|
|
6795
6802
|
const e = fo(t);
|
|
6796
6803
|
return e === "image" ? "IMG" : e === "pdf" ? "PDF" : e === "video" ? "VID" : "FILE";
|
|
6797
6804
|
}
|
|
6798
|
-
function
|
|
6805
|
+
function wu(t, e) {
|
|
6799
6806
|
return e ? Array.from(e).map((i) => ({
|
|
6800
6807
|
...t.createLocalAttachment(i),
|
|
6801
|
-
previewUrl:
|
|
6808
|
+
previewUrl: bu(i)
|
|
6802
6809
|
})) : [];
|
|
6803
6810
|
}
|
|
6804
|
-
function
|
|
6811
|
+
function bu(t) {
|
|
6805
6812
|
return typeof URL.createObjectURL == "function" ? URL.createObjectURL(t) : void 0;
|
|
6806
6813
|
}
|
|
6807
6814
|
function In(t) {
|
|
6808
6815
|
return !!(t && Array.from(t.types).includes("Files"));
|
|
6809
6816
|
}
|
|
6810
|
-
function
|
|
6817
|
+
function _u(t, e, n = null, i = !1, o) {
|
|
6811
6818
|
const r = Re(e) || mo(n), s = !r && i && On(e);
|
|
6812
6819
|
if (!t || !Yi(e, n) || s) {
|
|
6813
6820
|
t && (t.hidden = !0, t.replaceChildren());
|
|
6814
6821
|
return;
|
|
6815
6822
|
}
|
|
6816
6823
|
t.hidden = !1, t.replaceChildren(), t.className = "pluno-pa-widget__billing-status", r ? t.appendChild(
|
|
6817
|
-
|
|
6824
|
+
yu(e, n)
|
|
6818
6825
|
) : On(e) && t.appendChild(
|
|
6819
|
-
|
|
6826
|
+
xu(e, o)
|
|
6820
6827
|
);
|
|
6821
6828
|
}
|
|
6822
|
-
function
|
|
6829
|
+
function yu(t, e) {
|
|
6823
6830
|
const n = document.createElement("div");
|
|
6824
6831
|
n.className = "pluno-pa-widget__billing-action-card";
|
|
6825
6832
|
const i = t.limitExceeded || e === "limit_exceeded", o = i && t.onboardingIncomplete === !0, r = document.createElement("strong");
|
|
@@ -6840,7 +6847,7 @@ function bu(t, e) {
|
|
|
6840
6847
|
);
|
|
6841
6848
|
return n;
|
|
6842
6849
|
}
|
|
6843
|
-
function
|
|
6850
|
+
function xu(t, e) {
|
|
6844
6851
|
const n = document.createElement("div");
|
|
6845
6852
|
if (n.className = "pluno-pa-widget__billing-action-card pluno-pa-widget__billing-action-card--low", e) {
|
|
6846
6853
|
const r = document.createElement("button");
|
|
@@ -6849,7 +6856,7 @@ function _u(t, e) {
|
|
|
6849
6856
|
const i = document.createElement("strong");
|
|
6850
6857
|
i.textContent = "Credits running low", n.appendChild(i);
|
|
6851
6858
|
const o = document.createElement("span");
|
|
6852
|
-
return o.textContent =
|
|
6859
|
+
return o.textContent = Su(t) ?? "Credits are running low for this period.", n.appendChild(o), n.appendChild(
|
|
6853
6860
|
zs(
|
|
6854
6861
|
t,
|
|
6855
6862
|
"Upgrade",
|
|
@@ -6861,9 +6868,9 @@ function Yi(t, e) {
|
|
|
6861
6868
|
return t !== null && (Re(t) || On(t) || mo(e));
|
|
6862
6869
|
}
|
|
6863
6870
|
function Dr(t, e, n) {
|
|
6864
|
-
return Yi(e, n) ||
|
|
6871
|
+
return Yi(e, n) || vu(e) ? !0 : !Yi(t, n);
|
|
6865
6872
|
}
|
|
6866
|
-
function
|
|
6873
|
+
function vu(t) {
|
|
6867
6874
|
return t != null && (t.creditsUsed !== null || t.creditLimit !== null || t.creditsRemaining !== null || Re(t));
|
|
6868
6875
|
}
|
|
6869
6876
|
function Re(t) {
|
|
@@ -6875,10 +6882,10 @@ function mo(t) {
|
|
|
6875
6882
|
function On(t) {
|
|
6876
6883
|
return t != null && !Re(t) && t.creditLimit !== null && t.creditLimit > 0 && t.creditsRemaining !== null && t.creditsRemaining > 0 && t.creditsRemaining / t.creditLimit <= 0.2;
|
|
6877
6884
|
}
|
|
6878
|
-
function
|
|
6879
|
-
return t.creditsRemaining === null ? null : `${
|
|
6885
|
+
function Su(t) {
|
|
6886
|
+
return t.creditsRemaining === null ? null : `${Iu(t.creditsRemaining)} credits left`;
|
|
6880
6887
|
}
|
|
6881
|
-
function
|
|
6888
|
+
function Iu(t) {
|
|
6882
6889
|
return new Intl.NumberFormat("en-US", {
|
|
6883
6890
|
maximumFractionDigits: 0
|
|
6884
6891
|
}).format(Math.ceil(t));
|
|
@@ -6902,23 +6909,23 @@ function Ji(t, e) {
|
|
|
6902
6909
|
e.trim().length !== 0 && window.open(e, "_blank", "noopener,noreferrer");
|
|
6903
6910
|
}), n;
|
|
6904
6911
|
}
|
|
6905
|
-
function
|
|
6912
|
+
function Pi(t, e) {
|
|
6906
6913
|
return t.messages.filter(
|
|
6907
6914
|
(i) => !Bs(i)
|
|
6908
6915
|
).length === 0 && !t.assistantDraft && !t.lastError && !t.isThinking && !e;
|
|
6909
6916
|
}
|
|
6910
|
-
function
|
|
6911
|
-
const z =
|
|
6912
|
-
const C = I.scheduledCheckInAt ?
|
|
6917
|
+
function Tu(t, e, n, i, o, r, s, l, p, d, g, c, f, b, w, m, u, x, y, A, U, L) {
|
|
6918
|
+
const z = Lu(r), B = r.isThinking ? null : z.flatMap((I) => {
|
|
6919
|
+
const C = I.scheduledCheckInAt ? Mn(I.scheduledCheckInAt) : null;
|
|
6913
6920
|
return C && I.scheduledCheckInAt ? [{ message: I, dueAt: I.scheduledCheckInAt, label: C }] : [];
|
|
6914
|
-
}).sort((I, C) => Date.parse(I.dueAt) - Date.parse(C.dueAt))[0] ?? null, W =
|
|
6921
|
+
}).sort((I, C) => Date.parse(I.dueAt) - Date.parse(C.dueAt))[0] ?? null, W = Nu(
|
|
6915
6922
|
z.filter(
|
|
6916
6923
|
(I) => !Bs(I) && !I.scheduledCheckInAt
|
|
6917
6924
|
)
|
|
6918
|
-
), te = t.scrollTop,
|
|
6919
|
-
|
|
6925
|
+
), te = t.scrollTop, Me = [], ae = /* @__PURE__ */ new Set(), F = (I) => {
|
|
6926
|
+
Me.push(I);
|
|
6920
6927
|
};
|
|
6921
|
-
|
|
6928
|
+
qs(n, r.isThinking), o.hidden = !l, l && s !== null && Ms(o, s);
|
|
6922
6929
|
const v = W.length > 0 || !!r.assistantDraft || r.isThinking;
|
|
6923
6930
|
if (i(v), u || W.length === 0 && !r.assistantDraft && !r.lastError && !r.isThinking) {
|
|
6924
6931
|
const I = document.createElement("div");
|
|
@@ -6946,7 +6953,7 @@ function Su(t, e, n, i, o, r, s, l, p, d, g, c, f, b, w, m, u, x, y, A, U, L) {
|
|
|
6946
6953
|
const D = document.createElement("button");
|
|
6947
6954
|
D.type = "button", D.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder pluno-pa-widget__starter-prompt--loading", D.disabled = !0, D.tabIndex = -1, D.textContent = "Finding example tasks...", le.appendChild(D);
|
|
6948
6955
|
} else
|
|
6949
|
-
for (let D = 0; D <
|
|
6956
|
+
for (let D = 0; D < nd; D += 1) {
|
|
6950
6957
|
const R = document.createElement("button");
|
|
6951
6958
|
R.type = "button", R.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder", R.disabled = !0, R.tabIndex = -1, R.textContent = "", le.appendChild(R);
|
|
6952
6959
|
}
|
|
@@ -6954,7 +6961,7 @@ function Su(t, e, n, i, o, r, s, l, p, d, g, c, f, b, w, m, u, x, y, A, U, L) {
|
|
|
6954
6961
|
const D = document.createElement("button");
|
|
6955
6962
|
D.type = "button", D.className = "pluno-pa-widget__morning-report-snooze", D.textContent = "Snooze morning report", D.addEventListener("click", x), I.appendChild(D);
|
|
6956
6963
|
}
|
|
6957
|
-
c.clear(),
|
|
6964
|
+
c.clear(), F(I), F(e), Or(t, Me);
|
|
6958
6965
|
return;
|
|
6959
6966
|
}
|
|
6960
6967
|
let H = null, K = null, V = [], ve = [];
|
|
@@ -6967,23 +6974,23 @@ function Su(t, e, n, i, o, r, s, l, p, d, g, c, f, b, w, m, u, x, y, A, U, L) {
|
|
|
6967
6974
|
return ue = !1, !1;
|
|
6968
6975
|
const I = V.some(
|
|
6969
6976
|
(j) => zr(j, W)
|
|
6970
|
-
), C =
|
|
6977
|
+
), C = Hu(
|
|
6971
6978
|
V,
|
|
6972
6979
|
I,
|
|
6973
6980
|
g,
|
|
6974
6981
|
f,
|
|
6975
6982
|
b()
|
|
6976
6983
|
);
|
|
6977
|
-
return
|
|
6984
|
+
return F(C), H = null, K = C, V = [], ue = I, !0;
|
|
6978
6985
|
}, ge = () => {
|
|
6979
6986
|
for (const I of ve)
|
|
6980
|
-
|
|
6987
|
+
F(I), H = null, K = I;
|
|
6981
6988
|
ve = [];
|
|
6982
6989
|
};
|
|
6983
6990
|
for (let I = 0; I < W.length; I += 1) {
|
|
6984
6991
|
const C = W[I];
|
|
6985
6992
|
if (C.role === "tool" && C.integrationAuthRequest && U) {
|
|
6986
|
-
const R =
|
|
6993
|
+
const R = Eu(
|
|
6987
6994
|
C.integrationAuthRequest,
|
|
6988
6995
|
U.states.get(
|
|
6989
6996
|
C.integrationAuthRequest.authRequestId
|
|
@@ -7001,8 +7008,8 @@ function Su(t, e, n, i, o, r, s, l, p, d, g, c, f, b, w, m, u, x, y, A, U, L) {
|
|
|
7001
7008
|
}
|
|
7002
7009
|
if (C.role === "system" && C.dataType === "run_status" && C.steered === !0) {
|
|
7003
7010
|
if (!oe()) {
|
|
7004
|
-
const T =
|
|
7005
|
-
|
|
7011
|
+
const T = ju(b());
|
|
7012
|
+
F(T), H = null, K = T;
|
|
7006
7013
|
}
|
|
7007
7014
|
continue;
|
|
7008
7015
|
}
|
|
@@ -7010,11 +7017,11 @@ function Su(t, e, n, i, o, r, s, l, p, d, g, c, f, b, w, m, u, x, y, A, U, L) {
|
|
|
7010
7017
|
if (oe()) {
|
|
7011
7018
|
if (!ue) {
|
|
7012
7019
|
const T = Vt();
|
|
7013
|
-
|
|
7020
|
+
F(T), H = null, K = T;
|
|
7014
7021
|
}
|
|
7015
7022
|
} else {
|
|
7016
|
-
const T =
|
|
7017
|
-
|
|
7023
|
+
const T = qr(b());
|
|
7024
|
+
F(T), H = null, K = T;
|
|
7018
7025
|
}
|
|
7019
7026
|
continue;
|
|
7020
7027
|
}
|
|
@@ -7028,7 +7035,7 @@ function Su(t, e, n, i, o, r, s, l, p, d, g, c, f, b, w, m, u, x, y, A, U, L) {
|
|
|
7028
7035
|
const O = document.createElement("a");
|
|
7029
7036
|
O.className = "pluno-pa-widget__error-retry", O.href = C.securitySettingsUrl, O.target = "_blank", O.rel = "noreferrer", O.textContent = "Security settings", R.appendChild(O);
|
|
7030
7037
|
}
|
|
7031
|
-
|
|
7038
|
+
F(R), H = T ? R : null, K = T ? null : R, ge();
|
|
7032
7039
|
}
|
|
7033
7040
|
continue;
|
|
7034
7041
|
}
|
|
@@ -7038,34 +7045,34 @@ function Su(t, e, n, i, o, r, s, l, p, d, g, c, f, b, w, m, u, x, y, A, U, L) {
|
|
|
7038
7045
|
);
|
|
7039
7046
|
if (C.role === "assistant" && !j && !le) {
|
|
7040
7047
|
const R = wo(b());
|
|
7041
|
-
|
|
7048
|
+
F(R), H = null, K = R;
|
|
7042
7049
|
}
|
|
7043
|
-
const D =
|
|
7050
|
+
const D = Cu(
|
|
7044
7051
|
C,
|
|
7045
7052
|
Q,
|
|
7046
7053
|
c,
|
|
7047
7054
|
ae,
|
|
7048
7055
|
A
|
|
7049
7056
|
);
|
|
7050
|
-
if (
|
|
7057
|
+
if (F(D), H = D, K = null, B && C.role === "assistant" && C.phase !== "commentary" && nt(C, B.message)) {
|
|
7051
7058
|
const R = document.createElement("div");
|
|
7052
7059
|
R.className = "pluno-pa-widget__next-check-in", R.append(
|
|
7053
|
-
|
|
7060
|
+
lu(B.dueAt),
|
|
7054
7061
|
document.createTextNode(B.label)
|
|
7055
|
-
),
|
|
7062
|
+
), F(R), H = null, K = R;
|
|
7056
7063
|
}
|
|
7057
7064
|
C.role === "assistant" && ge();
|
|
7058
7065
|
}
|
|
7059
|
-
const $ = oe(),
|
|
7060
|
-
if (r.isThinking && !r.assistantDraft && !ot && !
|
|
7066
|
+
const $ = oe(), Pe = W[W.length - 1]?.role === "assistant";
|
|
7067
|
+
if (r.isThinking && !r.assistantDraft && !ot && !Pe && !ie)
|
|
7061
7068
|
if ($) {
|
|
7062
7069
|
if (!ue) {
|
|
7063
7070
|
const I = Vt();
|
|
7064
|
-
|
|
7071
|
+
F(I), H = null, K = I;
|
|
7065
7072
|
}
|
|
7066
7073
|
} else {
|
|
7067
|
-
const I =
|
|
7068
|
-
|
|
7074
|
+
const I = qr(b());
|
|
7075
|
+
F(I), H = null, K = I;
|
|
7069
7076
|
}
|
|
7070
7077
|
if (r.lastError) {
|
|
7071
7078
|
const I = document.createElement("div");
|
|
@@ -7082,11 +7089,11 @@ function Su(t, e, n, i, o, r, s, l, p, d, g, c, f, b, w, m, u, x, y, A, U, L) {
|
|
|
7082
7089
|
r.lastErrorCode === "connection_failed" ? y : m
|
|
7083
7090
|
), I.appendChild(j);
|
|
7084
7091
|
}
|
|
7085
|
-
|
|
7092
|
+
F(I), H = I, K = null;
|
|
7086
7093
|
}
|
|
7087
|
-
const re = L ? L.actionCandidate ?? (r.isThinking ? null :
|
|
7094
|
+
const re = L ? L.actionCandidate ?? (r.isThinking ? null : xc(z)) : null;
|
|
7088
7095
|
if (L && re && !L.dismissedCandidateIds.has(re.id)) {
|
|
7089
|
-
const I =
|
|
7096
|
+
const I = Fu(re, {
|
|
7090
7097
|
isActing: L.actionCandidate?.id === re.id,
|
|
7091
7098
|
error: L.error,
|
|
7092
7099
|
characterIconOptions: L.characterIconOptions,
|
|
@@ -7096,18 +7103,18 @@ function Su(t, e, n, i, o, r, s, l, p, d, g, c, f, b, w, m, u, x, y, A, U, L) {
|
|
|
7096
7103
|
onDismiss: L.onDismiss,
|
|
7097
7104
|
onDisable: L.onDisable
|
|
7098
7105
|
});
|
|
7099
|
-
|
|
7106
|
+
F(I), L.onSeen(re), H = null, K = I;
|
|
7100
7107
|
}
|
|
7101
7108
|
ge(), H?.classList.add(
|
|
7102
7109
|
"pluno-pa-widget__message--bottom-reserve"
|
|
7103
7110
|
), K?.classList.add(
|
|
7104
7111
|
"pluno-pa-widget__bottom-reserve-compact"
|
|
7105
|
-
),
|
|
7112
|
+
), F(e), Pu(
|
|
7106
7113
|
c,
|
|
7107
7114
|
ae
|
|
7108
|
-
), Or(t,
|
|
7115
|
+
), Or(t, Me), p ? $t(t, d) : t.scrollTop = te;
|
|
7109
7116
|
}
|
|
7110
|
-
function
|
|
7117
|
+
function Eu(t, e, n) {
|
|
7111
7118
|
const i = document.createElement("section");
|
|
7112
7119
|
i.className = "pluno-pa-widget__integration-auth-card", i.setAttribute("aria-label", `Connect ${t.appName}`);
|
|
7113
7120
|
const o = document.createElement("div");
|
|
@@ -7125,15 +7132,15 @@ function Iu(t, e, n) {
|
|
|
7125
7132
|
const p = document.createElement("button");
|
|
7126
7133
|
return p.type = "button", p.className = "pluno-pa-widget__integration-auth-button", p.disabled = e.status === "checking" || e.status === "connecting" || e.status === "completed", e.status === "checking" ? p.textContent = "Checking connection..." : e.status === "connecting" ? p.textContent = "Connecting..." : e.status === "completed" ? p.textContent = "Connected" : e.status === "expired" || e.status === "cancelled" ? p.textContent = `Reconnect ${t.appName}` : e.status === "error" ? p.textContent = "Try again" : p.textContent = `Connect ${t.appName}`, p.addEventListener("click", () => n(t)), i.appendChild(p), i;
|
|
7127
7134
|
}
|
|
7128
|
-
function
|
|
7129
|
-
const r =
|
|
7135
|
+
function Cu(t, e, n, i, o) {
|
|
7136
|
+
const r = ku(t), s = Au(
|
|
7130
7137
|
t,
|
|
7131
7138
|
e
|
|
7132
7139
|
), l = n.get(r);
|
|
7133
7140
|
if (l)
|
|
7134
7141
|
return l.node.classList.remove(
|
|
7135
7142
|
"pluno-pa-widget__message--bottom-reserve"
|
|
7136
|
-
), i.add(r), l.renderSignature === s ? (l.renderDeferred = !1, l.node) :
|
|
7143
|
+
), i.add(r), l.renderSignature === s ? (l.renderDeferred = !1, l.node) : Ru(l.node) ? (l.renderDeferred = !0, l.node) : (Ur(
|
|
7137
7144
|
l.node,
|
|
7138
7145
|
t,
|
|
7139
7146
|
e,
|
|
@@ -7151,23 +7158,23 @@ function Tu(t, e, n, i, o) {
|
|
|
7151
7158
|
}), i.add(r), p;
|
|
7152
7159
|
}
|
|
7153
7160
|
function Ur(t, e, n, i) {
|
|
7154
|
-
if (t.className = `pluno-pa-widget__message pluno-pa-widget__message--${e.role}`, t.removeAttribute("data-phase"), e.role === "assistant" ? (e.phase && (t.dataset.phase = e.phase), t.replaceChildren(),
|
|
7155
|
-
|
|
7161
|
+
if (t.className = `pluno-pa-widget__message pluno-pa-widget__message--${e.role}`, t.removeAttribute("data-phase"), e.role === "assistant" ? (e.phase && (t.dataset.phase = e.phase), t.replaceChildren(), Yu(t, n)) : t.textContent = n, e.role === "user" && e.attachments?.length && t.appendChild(
|
|
7162
|
+
Ou(
|
|
7156
7163
|
e.attachments,
|
|
7157
7164
|
i
|
|
7158
7165
|
)
|
|
7159
7166
|
), e.phase !== "commentary" && (e.role === "user" || e.dataType !== "assistant_draft")) {
|
|
7160
7167
|
const o = document.createElement("div");
|
|
7161
7168
|
o.className = "pluno-pa-widget__message-actions";
|
|
7162
|
-
const r =
|
|
7169
|
+
const r = Bu(e.createdAt), s = zu(n);
|
|
7163
7170
|
e.role === "user" ? o.append(r, s) : o.append(s, r), t.appendChild(o);
|
|
7164
7171
|
}
|
|
7165
7172
|
}
|
|
7166
|
-
function
|
|
7173
|
+
function ku(t) {
|
|
7167
7174
|
const e = t.assistantDraftItemId;
|
|
7168
7175
|
return `${t.role}:${e ?? t.id}`;
|
|
7169
7176
|
}
|
|
7170
|
-
function
|
|
7177
|
+
function Au(t, e) {
|
|
7171
7178
|
return JSON.stringify({
|
|
7172
7179
|
role: t.role,
|
|
7173
7180
|
content: e,
|
|
@@ -7187,7 +7194,7 @@ function Cu(t, e) {
|
|
|
7187
7194
|
})
|
|
7188
7195
|
});
|
|
7189
7196
|
}
|
|
7190
|
-
function
|
|
7197
|
+
function Ru(t) {
|
|
7191
7198
|
const e = t.ownerDocument.getSelection();
|
|
7192
7199
|
if (!e || e.isCollapsed)
|
|
7193
7200
|
return !1;
|
|
@@ -7196,12 +7203,12 @@ function ku(t) {
|
|
|
7196
7203
|
return !0;
|
|
7197
7204
|
return !1;
|
|
7198
7205
|
}
|
|
7199
|
-
function
|
|
7206
|
+
function Mu(t) {
|
|
7200
7207
|
return Array.from(t.values()).some(
|
|
7201
7208
|
(e) => e.renderDeferred === !0
|
|
7202
7209
|
);
|
|
7203
7210
|
}
|
|
7204
|
-
function
|
|
7211
|
+
function Pu(t, e) {
|
|
7205
7212
|
for (const n of t.keys())
|
|
7206
7213
|
e.has(n) || t.delete(n);
|
|
7207
7214
|
}
|
|
@@ -7219,7 +7226,7 @@ function Or(t, e) {
|
|
|
7219
7226
|
n = n.nextSibling, t.removeChild(i);
|
|
7220
7227
|
}
|
|
7221
7228
|
}
|
|
7222
|
-
function
|
|
7229
|
+
function Lu(t) {
|
|
7223
7230
|
if (!t.assistantDraft)
|
|
7224
7231
|
return [...t.messages];
|
|
7225
7232
|
if (t.assistantDraftItemId && t.messages.some(
|
|
@@ -7260,7 +7267,7 @@ function Pu(t) {
|
|
|
7260
7267
|
...t.messages.slice(o)
|
|
7261
7268
|
];
|
|
7262
7269
|
}
|
|
7263
|
-
function
|
|
7270
|
+
function Nu(t) {
|
|
7264
7271
|
const e = t.map((c, f) => ({
|
|
7265
7272
|
message: c.role === "assistant" && c.phase === "commentary" ? { ...c, role: "tool" } : c,
|
|
7266
7273
|
originalIndex: f
|
|
@@ -7316,13 +7323,13 @@ function Mu(t) {
|
|
|
7316
7323
|
}
|
|
7317
7324
|
function zr(t, e) {
|
|
7318
7325
|
return !t.respondsToUserMessageId || t.steered === !0 ? !1 : !e.some(
|
|
7319
|
-
(n) => (
|
|
7326
|
+
(n) => (Du(n) || Uu(n)) && nt(t, n)
|
|
7320
7327
|
);
|
|
7321
7328
|
}
|
|
7322
|
-
function
|
|
7329
|
+
function Du(t) {
|
|
7323
7330
|
return t.role === "assistant" && t.phase !== "commentary";
|
|
7324
7331
|
}
|
|
7325
|
-
function
|
|
7332
|
+
function Uu(t) {
|
|
7326
7333
|
return t.role === "system" && t.retryable !== !0 && (t.dataType === "run_error" || t.dataType === "run_status" && t.loading !== !0);
|
|
7327
7334
|
}
|
|
7328
7335
|
function nt(t, e) {
|
|
@@ -7334,8 +7341,8 @@ function Br(t) {
|
|
|
7334
7341
|
function Zi(t) {
|
|
7335
7342
|
return t.role === "system" && t.dataType === "run_status" && t.loading === !0;
|
|
7336
7343
|
}
|
|
7337
|
-
function
|
|
7338
|
-
t.replaceChildren(),
|
|
7344
|
+
function Fr(t, e, n, i, o, r, s, l) {
|
|
7345
|
+
t.replaceChildren(), qs(e, !1), e.disabled = !0, n(!1);
|
|
7339
7346
|
const p = document.createElement("div");
|
|
7340
7347
|
p.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter";
|
|
7341
7348
|
const d = it(
|
|
@@ -7353,27 +7360,27 @@ function qr(t, e, n, i, o, r, s, l) {
|
|
|
7353
7360
|
}
|
|
7354
7361
|
t.appendChild(p);
|
|
7355
7362
|
}
|
|
7356
|
-
function
|
|
7363
|
+
function Ou(t, e) {
|
|
7357
7364
|
const n = document.createElement("div");
|
|
7358
7365
|
n.className = "pluno-pa-widget__message-attachments";
|
|
7359
7366
|
for (const i of t)
|
|
7360
7367
|
n.appendChild(
|
|
7361
|
-
|
|
7368
|
+
mu(i, e)
|
|
7362
7369
|
);
|
|
7363
7370
|
return n;
|
|
7364
7371
|
}
|
|
7365
|
-
function
|
|
7372
|
+
function zu(t) {
|
|
7366
7373
|
const e = document.createElement("button");
|
|
7367
|
-
return e.type = "button", e.className = "pluno-pa-widget__message-copy", e.setAttribute("aria-label", "Copy message"), e.title = "Copy message", e.appendChild(
|
|
7374
|
+
return e.type = "button", e.className = "pluno-pa-widget__message-copy", e.setAttribute("aria-label", "Copy message"), e.title = "Copy message", e.appendChild(gu()), e.addEventListener("click", (n) => {
|
|
7368
7375
|
n.preventDefault(), n.stopPropagation(), navigator.clipboard.writeText(t);
|
|
7369
7376
|
}), e;
|
|
7370
7377
|
}
|
|
7371
|
-
function
|
|
7378
|
+
function Bu(t) {
|
|
7372
7379
|
const e = document.createElement("time");
|
|
7373
|
-
return e.className = "pluno-pa-widget__message-timestamp", e.dateTime = t, e.textContent =
|
|
7380
|
+
return e.className = "pluno-pa-widget__message-timestamp", e.dateTime = t, e.textContent = Fc(t), e;
|
|
7374
7381
|
}
|
|
7375
|
-
function
|
|
7376
|
-
const n =
|
|
7382
|
+
function Fu(t, e) {
|
|
7383
|
+
const n = vc(t.id), i = document.createElement("article");
|
|
7377
7384
|
i.className = "pluno-pa-widget__share-prompt";
|
|
7378
7385
|
const o = document.createElement("div");
|
|
7379
7386
|
o.className = "pluno-pa-widget__share-prompt-body", o.appendChild(
|
|
@@ -7411,18 +7418,18 @@ function zu(t, e) {
|
|
|
7411
7418
|
const f = document.createElement("button");
|
|
7412
7419
|
f.type = "button", f.className = "pluno-pa-widget__share-prompt-draft", f.disabled = e.isActing, f.addEventListener("click", () => {
|
|
7413
7420
|
e.onReferralCopy(t);
|
|
7414
|
-
}), e.isActing ? (f.appendChild(
|
|
7421
|
+
}), e.isActing ? (f.appendChild(Ku()), f.appendChild(document.createTextNode("Copying..."))) : f.textContent = "Copy invite link", d.appendChild(f);
|
|
7415
7422
|
} else
|
|
7416
|
-
for (const f of
|
|
7423
|
+
for (const f of qu()) {
|
|
7417
7424
|
const b = document.createElement("a");
|
|
7418
|
-
b.className = "pluno-pa-widget__share-prompt-social", b.href = f.href, b.target = "_blank", b.rel = "noopener noreferrer", b.setAttribute("aria-label", `Open ${f.label}`), b.title = f.label, b.appendChild(
|
|
7425
|
+
b.className = "pluno-pa-widget__share-prompt-social", b.href = f.href, b.target = "_blank", b.rel = "noopener noreferrer", b.setAttribute("aria-label", `Open ${f.label}`), b.title = f.label, b.appendChild(Wu(f.id)), b.addEventListener("click", () => e.onSocialShare(t)), d.appendChild(b);
|
|
7419
7426
|
}
|
|
7420
7427
|
const g = document.createElement("button");
|
|
7421
7428
|
g.type = "button", g.className = "pluno-pa-widget__share-prompt-dismiss", g.setAttribute("aria-label", "Dismiss share prompt"), g.title = "Dismiss", g.textContent = "Dismiss", g.addEventListener("click", () => e.onDismiss(t)), d.appendChild(g), p.appendChild(d);
|
|
7422
7429
|
const c = document.createElement("button");
|
|
7423
7430
|
return c.type = "button", c.className = "pluno-pa-widget__share-prompt-disable", c.textContent = "Don't ask again", c.addEventListener("click", () => e.onDisable(t)), p.appendChild(c), o.appendChild(p), i.appendChild(o), i;
|
|
7424
7431
|
}
|
|
7425
|
-
function
|
|
7432
|
+
function qu() {
|
|
7426
7433
|
const t = "https://pluno.ai/browser", e = `I just used @pluno_ai to get work done directly inside my tools. Worth trying: ${t}`;
|
|
7427
7434
|
return [
|
|
7428
7435
|
{
|
|
@@ -7442,7 +7449,7 @@ function Bu() {
|
|
|
7442
7449
|
}
|
|
7443
7450
|
];
|
|
7444
7451
|
}
|
|
7445
|
-
function
|
|
7452
|
+
function Wu(t) {
|
|
7446
7453
|
const e = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
7447
7454
|
e.setAttribute("class", "pluno-pa-widget__share-prompt-platform-logo"), e.setAttribute("viewBox", "0 0 32 32"), e.setAttribute("aria-hidden", "true");
|
|
7448
7455
|
const n = (i, o) => {
|
|
@@ -7457,7 +7464,7 @@ function Bs(t) {
|
|
|
7457
7464
|
function zn(t) {
|
|
7458
7465
|
return t.replace(/\uE200[^\uE201]*(?:\uE201|$)/g, "");
|
|
7459
7466
|
}
|
|
7460
|
-
function
|
|
7467
|
+
function Hu(t, e, n, i, o) {
|
|
7461
7468
|
const r = t.length > 0 && t.every((m) => m.steered === !0);
|
|
7462
7469
|
e = e && !r;
|
|
7463
7470
|
const s = document.createElement("article");
|
|
@@ -7469,12 +7476,12 @@ function Fu(t, e, n, i, o) {
|
|
|
7469
7476
|
o
|
|
7470
7477
|
)
|
|
7471
7478
|
);
|
|
7472
|
-
const l =
|
|
7479
|
+
const l = $u(t, e);
|
|
7473
7480
|
if (e) {
|
|
7474
7481
|
const m = document.createElement("div");
|
|
7475
7482
|
return m.className = "pluno-pa-widget__tool-active-content", m.appendChild(Vt()), m.appendChild(l), s.appendChild(m), s;
|
|
7476
7483
|
}
|
|
7477
|
-
const p = document.createElement("details"), d =
|
|
7484
|
+
const p = document.createElement("details"), d = Gu(t);
|
|
7478
7485
|
p.open = n.has(d), s.classList.toggle("pluno-pa-widget__tool-group--open", p.open), p.addEventListener("toggle", () => {
|
|
7479
7486
|
s.classList.toggle("pluno-pa-widget__tool-group--open", p.open), p.open ? n.add(d) : n.delete(d), i();
|
|
7480
7487
|
});
|
|
@@ -7484,10 +7491,10 @@ function Fu(t, e, n, i, o) {
|
|
|
7484
7491
|
f.className = "pluno-pa-widget__tool-summary-title";
|
|
7485
7492
|
const b = zn(
|
|
7486
7493
|
c.content
|
|
7487
|
-
).trim(), w = b ? c.phase === "commentary" ? b :
|
|
7494
|
+
).trim(), w = b ? c.phase === "commentary" ? b : Fs(b) : r ? "Steered" : "Thinking...";
|
|
7488
7495
|
return f.textContent = w, g.appendChild(f), p.appendChild(g), p.appendChild(l), s.appendChild(p), s;
|
|
7489
7496
|
}
|
|
7490
|
-
function
|
|
7497
|
+
function $u(t, e) {
|
|
7491
7498
|
const n = document.createElement("div");
|
|
7492
7499
|
n.className = "pluno-pa-widget__tool-lines";
|
|
7493
7500
|
const i = [...t].reverse().find((o) => o.phase !== "commentary");
|
|
@@ -7496,12 +7503,12 @@ function Wu(t, e) {
|
|
|
7496
7503
|
r.className = "pluno-pa-widget__tool-line", r.dataset.eventType = o.phase === "commentary" ? "commentary" : "tool";
|
|
7497
7504
|
const s = document.createElement("span");
|
|
7498
7505
|
s.className = "pluno-pa-widget__tool-line-text";
|
|
7499
|
-
const l = zn(o.content) || (o.phase === "commentary" ? "" : "Run tool"), p = o.phase === "commentary" ? l :
|
|
7506
|
+
const l = zn(o.content) || (o.phase === "commentary" ? "" : "Run tool"), p = o.phase === "commentary" ? l : Fs(l);
|
|
7500
7507
|
e && o === i && o.loading !== !1 && (s.classList.add("pluno-pa-widget__tool-line-text--loading"), s.dataset.loadingText = p), s.textContent = p, r.appendChild(s), n.appendChild(r);
|
|
7501
7508
|
}
|
|
7502
7509
|
return n;
|
|
7503
7510
|
}
|
|
7504
|
-
function
|
|
7511
|
+
function Fs(t) {
|
|
7505
7512
|
const e = t.trim() || "Run tool", n = e.codePointAt(0) ?? 0;
|
|
7506
7513
|
return n >= 126976 && n <= 129791 || n >= 9728 && n <= 10175 || n >= 127462 && n <= 127487 ? e : `🛠️ ${e}`;
|
|
7507
7514
|
}
|
|
@@ -7514,11 +7521,11 @@ function wo(t) {
|
|
|
7514
7521
|
)
|
|
7515
7522
|
), e;
|
|
7516
7523
|
}
|
|
7517
|
-
function
|
|
7524
|
+
function qr(t) {
|
|
7518
7525
|
const e = wo(t);
|
|
7519
7526
|
return e.classList.add("pluno-pa-widget__thinking-marker"), e.appendChild(Vt()), e;
|
|
7520
7527
|
}
|
|
7521
|
-
function
|
|
7528
|
+
function ju(t) {
|
|
7522
7529
|
const e = wo(t), n = document.createElement("div");
|
|
7523
7530
|
return n.className = "pluno-pa-widget__status", n.textContent = "Steered", e.appendChild(n), e;
|
|
7524
7531
|
}
|
|
@@ -7530,15 +7537,15 @@ function Vt(t = "Thinking...") {
|
|
|
7530
7537
|
const i = document.createElement("span");
|
|
7531
7538
|
return i.textContent = t, e.appendChild(i), e;
|
|
7532
7539
|
}
|
|
7533
|
-
function
|
|
7540
|
+
function Gu(t) {
|
|
7534
7541
|
return `tools:${t[0]?.id ?? ""}`;
|
|
7535
7542
|
}
|
|
7536
|
-
function
|
|
7543
|
+
function Ku() {
|
|
7537
7544
|
const t = document.createElement("span");
|
|
7538
7545
|
return t.className = "pluno-pa-widget__spinner", t.setAttribute("aria-hidden", "true"), t;
|
|
7539
7546
|
}
|
|
7540
|
-
function
|
|
7541
|
-
t.setAttribute("aria-label", e ? "Stop" : "Send"), t.classList.toggle("pluno-pa-widget__send--stop", e), t.replaceChildren(e ?
|
|
7547
|
+
function qs(t, e) {
|
|
7548
|
+
t.setAttribute("aria-label", e ? "Stop" : "Send"), t.classList.toggle("pluno-pa-widget__send--stop", e), t.replaceChildren(e ? du() : Us());
|
|
7542
7549
|
}
|
|
7543
7550
|
function Li(t) {
|
|
7544
7551
|
let e = t.trim();
|
|
@@ -7553,18 +7560,18 @@ function Li(t) {
|
|
|
7553
7560
|
}
|
|
7554
7561
|
return n.push(i.trim()), n.length > 1 ? n : null;
|
|
7555
7562
|
}
|
|
7556
|
-
function
|
|
7563
|
+
function Vu(t) {
|
|
7557
7564
|
const e = t.trim();
|
|
7558
7565
|
if (/^:?-{3,}:?$/.test(e))
|
|
7559
7566
|
return e.startsWith(":") && e.endsWith(":") ? "center" : e.endsWith(":") ? "right" : e.startsWith(":") ? "left" : null;
|
|
7560
7567
|
}
|
|
7561
|
-
function
|
|
7568
|
+
function Xu(t, e) {
|
|
7562
7569
|
const n = Li(t[e] ?? ""), i = Li(t[e + 1] ?? "");
|
|
7563
7570
|
if (!n || !i || n.length !== i.length)
|
|
7564
7571
|
return null;
|
|
7565
7572
|
const o = [];
|
|
7566
7573
|
for (const c of i) {
|
|
7567
|
-
const f =
|
|
7574
|
+
const f = Vu(c);
|
|
7568
7575
|
if (f === void 0)
|
|
7569
7576
|
return null;
|
|
7570
7577
|
o.push(f);
|
|
@@ -7590,7 +7597,7 @@ function Ku(t, e) {
|
|
|
7590
7597
|
}
|
|
7591
7598
|
return s.appendChild(d), r.appendChild(s), { element: r, nextIndex: g };
|
|
7592
7599
|
}
|
|
7593
|
-
function
|
|
7600
|
+
function Yu(t, e) {
|
|
7594
7601
|
const n = Sa(e).replace(/\r\n/g, `
|
|
7595
7602
|
`).split(`
|
|
7596
7603
|
`);
|
|
@@ -7611,7 +7618,7 @@ function Vu(t, e) {
|
|
|
7611
7618
|
`), f.appendChild(b), t.appendChild(f);
|
|
7612
7619
|
continue;
|
|
7613
7620
|
}
|
|
7614
|
-
const s =
|
|
7621
|
+
const s = Xu(n, i);
|
|
7615
7622
|
if (s) {
|
|
7616
7623
|
t.appendChild(s.element), i = s.nextIndex;
|
|
7617
7624
|
continue;
|
|
@@ -7670,7 +7677,7 @@ function et(t, e) {
|
|
|
7670
7677
|
et(l, s.slice(1, -1)), t.appendChild(l);
|
|
7671
7678
|
} else {
|
|
7672
7679
|
const l = s.match(/^\[([^\]]+)\]\(([^)\s]+)\)$/);
|
|
7673
|
-
if (l &&
|
|
7680
|
+
if (l && Ju(l[2])) {
|
|
7674
7681
|
const p = document.createElement("a");
|
|
7675
7682
|
p.href = l[2], p.target = va(l[2]) ? "_blank" : "_top", p.rel = "noreferrer", p.textContent = l[1], t.appendChild(p);
|
|
7676
7683
|
} else
|
|
@@ -7680,7 +7687,7 @@ function et(t, e) {
|
|
|
7680
7687
|
}
|
|
7681
7688
|
i < e.length && t.appendChild(document.createTextNode(e.slice(i)));
|
|
7682
7689
|
}
|
|
7683
|
-
function
|
|
7690
|
+
function Ju(t) {
|
|
7684
7691
|
if (t.startsWith("/") || t.startsWith("#"))
|
|
7685
7692
|
return !0;
|
|
7686
7693
|
try {
|
|
@@ -7691,7 +7698,7 @@ function Xu(t) {
|
|
|
7691
7698
|
}
|
|
7692
7699
|
}
|
|
7693
7700
|
function Wr(t, e) {
|
|
7694
|
-
if (
|
|
7701
|
+
if (Zu(t))
|
|
7695
7702
|
return;
|
|
7696
7703
|
const n = `
|
|
7697
7704
|
:host {
|
|
@@ -10464,18 +10471,18 @@ function Wr(t, e) {
|
|
|
10464
10471
|
}
|
|
10465
10472
|
}
|
|
10466
10473
|
`;
|
|
10467
|
-
if (
|
|
10474
|
+
if (Qu(t, n))
|
|
10468
10475
|
return;
|
|
10469
10476
|
const i = t.ownerDocument.createElement("style");
|
|
10470
10477
|
i.id = ks, i.textContent = n, t.appendChild(i), Ws(t);
|
|
10471
10478
|
}
|
|
10472
|
-
function
|
|
10479
|
+
function Zu(t) {
|
|
10473
10480
|
return t.getElementById(ks) !== null || t.host instanceof HTMLElement && t.host.getAttribute(As) === "true";
|
|
10474
10481
|
}
|
|
10475
10482
|
function Ws(t) {
|
|
10476
10483
|
t.host instanceof HTMLElement && t.host.setAttribute(As, "true");
|
|
10477
10484
|
}
|
|
10478
|
-
function
|
|
10485
|
+
function Qu(t, e) {
|
|
10479
10486
|
if (typeof CSSStyleSheet > "u" || typeof CSSStyleSheet.prototype.replaceSync != "function" || !("adoptedStyleSheets" in t))
|
|
10480
10487
|
return !1;
|
|
10481
10488
|
try {
|
|
@@ -10485,7 +10492,7 @@ function Ju(t, e) {
|
|
|
10485
10492
|
return !1;
|
|
10486
10493
|
}
|
|
10487
10494
|
}
|
|
10488
|
-
async function
|
|
10495
|
+
async function eg() {
|
|
10489
10496
|
return document.body ? document.body : await new Promise((t) => {
|
|
10490
10497
|
const e = new MutationObserver(() => {
|
|
10491
10498
|
document.body && (e.disconnect(), t(document.body));
|
|
@@ -10499,7 +10506,7 @@ function bo(t) {
|
|
|
10499
10506
|
function Hs(t) {
|
|
10500
10507
|
return `${bo(t)}.displayState`;
|
|
10501
10508
|
}
|
|
10502
|
-
function
|
|
10509
|
+
function tg(t) {
|
|
10503
10510
|
try {
|
|
10504
10511
|
return window.sessionStorage.getItem(
|
|
10505
10512
|
Hs(t)
|
|
@@ -10521,7 +10528,7 @@ function Hr(t, e) {
|
|
|
10521
10528
|
return;
|
|
10522
10529
|
}
|
|
10523
10530
|
}
|
|
10524
|
-
function
|
|
10531
|
+
function ng(t) {
|
|
10525
10532
|
if (t)
|
|
10526
10533
|
return { clientId: t, release: () => {
|
|
10527
10534
|
} };
|
|
@@ -10529,7 +10536,7 @@ function eg(t) {
|
|
|
10529
10536
|
for (; Ii.has(e); )
|
|
10530
10537
|
e += 1;
|
|
10531
10538
|
Ii.add(e);
|
|
10532
|
-
const n = `${
|
|
10539
|
+
const n = `${ed}${e}`;
|
|
10533
10540
|
let i = crypto.randomUUID();
|
|
10534
10541
|
try {
|
|
10535
10542
|
i = window.sessionStorage.getItem(n) ?? i, window.sessionStorage.setItem(n, i);
|
|
@@ -10543,7 +10550,7 @@ function eg(t) {
|
|
|
10543
10550
|
}
|
|
10544
10551
|
};
|
|
10545
10552
|
}
|
|
10546
|
-
function
|
|
10553
|
+
function ig(t) {
|
|
10547
10554
|
try {
|
|
10548
10555
|
const e = window.localStorage.getItem(bo(t));
|
|
10549
10556
|
if (!e)
|
|
@@ -10557,8 +10564,8 @@ function tg(t) {
|
|
|
10557
10564
|
openToolGroupKeys: Array.isArray(n.openToolGroupKeys) ? n.openToolGroupKeys.filter(
|
|
10558
10565
|
(i) => typeof i == "string"
|
|
10559
10566
|
) : [],
|
|
10560
|
-
launcherPosition:
|
|
10561
|
-
panelSize:
|
|
10567
|
+
launcherPosition: ag(n.launcherPosition) ? n.launcherPosition : null,
|
|
10568
|
+
panelSize: lg(n.panelSize) ? $n(n.panelSize) : null,
|
|
10562
10569
|
seenShareCandidateIds: Array.isArray(n.seenShareCandidateIds) ? n.seenShareCandidateIds.filter((i) => typeof i == "string").slice(-vs) : [],
|
|
10563
10570
|
sharePromptsDisabled: n.sharePromptsDisabled === !0
|
|
10564
10571
|
};
|
|
@@ -10566,7 +10573,7 @@ function tg(t) {
|
|
|
10566
10573
|
return $r();
|
|
10567
10574
|
}
|
|
10568
10575
|
}
|
|
10569
|
-
async function
|
|
10576
|
+
async function og(t) {
|
|
10570
10577
|
if (t.loadSharePromptsDisabled)
|
|
10571
10578
|
return t.loadSharePromptsDisabled();
|
|
10572
10579
|
try {
|
|
@@ -10575,7 +10582,7 @@ async function ng(t) {
|
|
|
10575
10582
|
return !1;
|
|
10576
10583
|
}
|
|
10577
10584
|
}
|
|
10578
|
-
function
|
|
10585
|
+
function rg(t, e) {
|
|
10579
10586
|
if (t.persistSharePromptsDisabled) {
|
|
10580
10587
|
Promise.resolve(t.persistSharePromptsDisabled(e)).catch(
|
|
10581
10588
|
() => {
|
|
@@ -10602,7 +10609,7 @@ function $r() {
|
|
|
10602
10609
|
sharePromptsDisabled: !1
|
|
10603
10610
|
};
|
|
10604
10611
|
}
|
|
10605
|
-
function
|
|
10612
|
+
function sg(t, e) {
|
|
10606
10613
|
try {
|
|
10607
10614
|
window.localStorage.setItem(
|
|
10608
10615
|
bo(t),
|
|
@@ -10612,13 +10619,13 @@ function og(t, e) {
|
|
|
10612
10619
|
return;
|
|
10613
10620
|
}
|
|
10614
10621
|
}
|
|
10615
|
-
function
|
|
10622
|
+
function ag(t) {
|
|
10616
10623
|
if (!t || typeof t != "object")
|
|
10617
10624
|
return !1;
|
|
10618
10625
|
const e = t;
|
|
10619
10626
|
return Number.isFinite(e.x) && Number.isFinite(e.y) && (e.anchor === "top-left" || e.anchor === "top-right" || e.anchor === "bottom-left" || e.anchor === "bottom-right");
|
|
10620
10627
|
}
|
|
10621
|
-
function
|
|
10628
|
+
function lg(t) {
|
|
10622
10629
|
if (!t || typeof t != "object")
|
|
10623
10630
|
return !1;
|
|
10624
10631
|
const e = t;
|
|
@@ -10644,7 +10651,7 @@ async function $s(t, e) {
|
|
|
10644
10651
|
throw new Error("Pluno token endpoint did not return a token");
|
|
10645
10652
|
return i.token;
|
|
10646
10653
|
}
|
|
10647
|
-
function
|
|
10654
|
+
function pg(t) {
|
|
10648
10655
|
let e = !1, n = !1;
|
|
10649
10656
|
const i = async () => {
|
|
10650
10657
|
const o = new AbortController();
|
|
@@ -10652,7 +10659,7 @@ function ag(t) {
|
|
|
10652
10659
|
const s = new Promise((l, p) => {
|
|
10653
10660
|
const d = window.setTimeout(() => {
|
|
10654
10661
|
r = !0, o.abort(), p(new Error(_r));
|
|
10655
|
-
},
|
|
10662
|
+
}, Zc);
|
|
10656
10663
|
o.signal.addEventListener(
|
|
10657
10664
|
"abort",
|
|
10658
10665
|
() => window.clearTimeout(d),
|
|
@@ -10666,7 +10673,7 @@ function ag(t) {
|
|
|
10666
10673
|
]);
|
|
10667
10674
|
return o.abort(), l;
|
|
10668
10675
|
} catch (l) {
|
|
10669
|
-
throw o.abort(), r ? new Error(_r) : l instanceof Error && l.message.startsWith("Pluno widget blocked on ") ? l : new Error(
|
|
10676
|
+
throw o.abort(), r ? new Error(_r) : l instanceof Error && l.message.startsWith("Pluno widget blocked on ") ? l : new Error(Qc);
|
|
10670
10677
|
}
|
|
10671
10678
|
};
|
|
10672
10679
|
return {
|
|
@@ -10690,29 +10697,29 @@ function ag(t) {
|
|
|
10690
10697
|
};
|
|
10691
10698
|
}
|
|
10692
10699
|
const jr = /* @__PURE__ */ new WeakSet();
|
|
10693
|
-
function
|
|
10700
|
+
function cg(t) {
|
|
10694
10701
|
return Object.keys(t.dataset).some((e) => e.startsWith("pluno"));
|
|
10695
10702
|
}
|
|
10696
10703
|
function Gr(t) {
|
|
10697
10704
|
const e = t.pathname.split("/");
|
|
10698
10705
|
return e[e.length - 1] ?? "";
|
|
10699
10706
|
}
|
|
10700
|
-
function
|
|
10707
|
+
function dg(t, e) {
|
|
10701
10708
|
const n = new URL(t.src, document.baseURI);
|
|
10702
10709
|
return n.href === e.href || n.pathname === e.pathname ? !0 : Gr(n) === Gr(e);
|
|
10703
10710
|
}
|
|
10704
10711
|
class $e extends EventTarget {
|
|
10705
10712
|
constructor(e, n) {
|
|
10706
|
-
super(), this.channelId = n, this.url = e, this.addPreviewListener(
|
|
10713
|
+
super(), this.channelId = n, this.url = e, this.addPreviewListener(Kc, () => {
|
|
10707
10714
|
this.readyState = $e.OPEN, this.dispatchEvent(new Event("open"));
|
|
10708
|
-
}), this.addPreviewListener(
|
|
10715
|
+
}), this.addPreviewListener(Vc, (i) => {
|
|
10709
10716
|
const o = i;
|
|
10710
10717
|
this.dispatchEvent(
|
|
10711
10718
|
new MessageEvent("message", { data: o.detail?.data ?? "" })
|
|
10712
10719
|
);
|
|
10713
|
-
}), this.addPreviewListener(
|
|
10720
|
+
}), this.addPreviewListener(Xc, () => {
|
|
10714
10721
|
this.readyState = $e.CLOSED, this.dispatchEvent(new Event("error")), this.cleanup();
|
|
10715
|
-
}), this.addPreviewListener(
|
|
10722
|
+
}), this.addPreviewListener(Yc, (i) => {
|
|
10716
10723
|
const o = i;
|
|
10717
10724
|
this.readyState = $e.CLOSED, this.dispatchEvent(
|
|
10718
10725
|
new CloseEvent("close", {
|
|
@@ -10724,7 +10731,7 @@ class $e extends EventTarget {
|
|
|
10724
10731
|
}), window.dispatchEvent(
|
|
10725
10732
|
new CustomEvent(
|
|
10726
10733
|
Tn(
|
|
10727
|
-
|
|
10734
|
+
$c,
|
|
10728
10735
|
this.channelId
|
|
10729
10736
|
),
|
|
10730
10737
|
{
|
|
@@ -10744,7 +10751,7 @@ class $e extends EventTarget {
|
|
|
10744
10751
|
binaryType = "blob";
|
|
10745
10752
|
bufferedAmount = 0;
|
|
10746
10753
|
readyState = $e.CONNECTING;
|
|
10747
|
-
socketId =
|
|
10754
|
+
socketId = ug();
|
|
10748
10755
|
listeners = /* @__PURE__ */ new Map();
|
|
10749
10756
|
send(e) {
|
|
10750
10757
|
if (this.readyState !== $e.OPEN)
|
|
@@ -10754,7 +10761,7 @@ class $e extends EventTarget {
|
|
|
10754
10761
|
);
|
|
10755
10762
|
window.dispatchEvent(
|
|
10756
10763
|
new CustomEvent(
|
|
10757
|
-
Tn(
|
|
10764
|
+
Tn(jc, this.channelId),
|
|
10758
10765
|
{
|
|
10759
10766
|
detail: {
|
|
10760
10767
|
socketId: this.socketId,
|
|
@@ -10767,7 +10774,7 @@ class $e extends EventTarget {
|
|
|
10767
10774
|
close(e, n) {
|
|
10768
10775
|
this.readyState !== $e.CLOSED && (this.readyState = $e.CLOSING, window.dispatchEvent(
|
|
10769
10776
|
new CustomEvent(
|
|
10770
|
-
Tn(
|
|
10777
|
+
Tn(Gc, this.channelId),
|
|
10771
10778
|
{
|
|
10772
10779
|
detail: { socketId: this.socketId, code: e, reason: n }
|
|
10773
10780
|
}
|
|
@@ -10789,7 +10796,7 @@ class $e extends EventTarget {
|
|
|
10789
10796
|
this.listeners.clear();
|
|
10790
10797
|
}
|
|
10791
10798
|
}
|
|
10792
|
-
function
|
|
10799
|
+
function ug() {
|
|
10793
10800
|
const t = window.sessionStorage.getItem(
|
|
10794
10801
|
br
|
|
10795
10802
|
);
|
|
@@ -10801,7 +10808,7 @@ function cg() {
|
|
|
10801
10808
|
function Tn(t, e) {
|
|
10802
10809
|
return `${t}:${e}`;
|
|
10803
10810
|
}
|
|
10804
|
-
function
|
|
10811
|
+
function gg(t) {
|
|
10805
10812
|
const e = document.currentScript;
|
|
10806
10813
|
if (e instanceof HTMLScriptElement)
|
|
10807
10814
|
return [e];
|
|
@@ -10809,11 +10816,11 @@ function dg(t) {
|
|
|
10809
10816
|
return Array.from(
|
|
10810
10817
|
document.querySelectorAll("script[type='module'][src]")
|
|
10811
10818
|
).filter(
|
|
10812
|
-
(o) => o instanceof HTMLScriptElement &&
|
|
10819
|
+
(o) => o instanceof HTMLScriptElement && cg(o) && dg(o, i)
|
|
10813
10820
|
);
|
|
10814
10821
|
}
|
|
10815
|
-
function
|
|
10816
|
-
for (const e of
|
|
10822
|
+
function hg(t) {
|
|
10823
|
+
for (const e of gg(t))
|
|
10817
10824
|
jr.has(e) || e.dataset.plunoAutoMount === "false" || (jr.add(e), js(e).catch((n) => {
|
|
10818
10825
|
console.error("Failed to mount Pluno widget", n);
|
|
10819
10826
|
}));
|
|
@@ -10826,18 +10833,18 @@ function js(t) {
|
|
|
10826
10833
|
const p = e[We];
|
|
10827
10834
|
return p ? p.mountPromise : js(t);
|
|
10828
10835
|
});
|
|
10829
|
-
if (
|
|
10836
|
+
if (fg(n.host))
|
|
10830
10837
|
return n.retryPendingTokenFailureOnce?.(), n.mountPromise;
|
|
10831
10838
|
n.destroy?.(), delete e[We];
|
|
10832
10839
|
}
|
|
10833
|
-
const i = t.dataset.plunoPreviewChannel, o = t.dataset.plunoTokenEndpoint, r = !t.dataset.plunoToken && !i && o ?
|
|
10840
|
+
const i = t.dataset.plunoPreviewChannel, o = t.dataset.plunoTokenEndpoint, r = !t.dataset.plunoToken && !i && o ? pg(o) : null;
|
|
10834
10841
|
let s;
|
|
10835
|
-
const l =
|
|
10842
|
+
const l = xd({
|
|
10836
10843
|
token: t.dataset.plunoToken,
|
|
10837
10844
|
tokenProvider: r?.loadToken,
|
|
10838
10845
|
tokenEndpoint: o,
|
|
10839
10846
|
backendUrl: t.dataset.plunoBackendUrl,
|
|
10840
|
-
webSocketFactory: i ?
|
|
10847
|
+
webSocketFactory: i ? yd(i) : void 0,
|
|
10841
10848
|
launcherLabel: t.dataset.plunoLauncherLabel,
|
|
10842
10849
|
accentColor: t.dataset.plunoAccentColor,
|
|
10843
10850
|
colorScheme: t.dataset.plunoColorScheme === "dark" ? "dark" : "light",
|
|
@@ -10863,11 +10870,11 @@ function js(t) {
|
|
|
10863
10870
|
retryPendingTokenFailureOnce: r?.retryPendingFailureOnce ?? null
|
|
10864
10871
|
}, e[We] = s, l;
|
|
10865
10872
|
}
|
|
10866
|
-
function
|
|
10873
|
+
function fg(t) {
|
|
10867
10874
|
return t.isConnected && t.getAttribute(Ss) === "true" && !!t.shadowRoot?.querySelector(".pluno-pa-widget__launcher") && !!t.shadowRoot?.querySelector(".pluno-pa-widget__panel");
|
|
10868
10875
|
}
|
|
10869
|
-
|
|
10876
|
+
hg(import.meta.url);
|
|
10870
10877
|
export {
|
|
10871
|
-
|
|
10872
|
-
|
|
10878
|
+
yd as createProductAgentPreviewBridgeWebSocketFactory,
|
|
10879
|
+
xd as mountPlunoProductAgentWidget
|
|
10873
10880
|
};
|