@pluno/product-agent-web 0.1.232 → 0.1.233
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/product-agent-sdk.js +50 -50
- package/dist/product-agent-widget.js +160 -156
- package/package.json +1 -1
|
@@ -317,7 +317,7 @@ function Lc(t, e) {
|
|
|
317
317
|
};
|
|
318
318
|
}
|
|
319
319
|
const Or = (t) => t.selectedModel ?? t.historyModel ?? t.defaultModel, ep = (t, e) => t.scopes[e];
|
|
320
|
-
function
|
|
320
|
+
function an(t) {
|
|
321
321
|
return t?.execution_message_ids ?? t?.user_message_ids ?? [];
|
|
322
322
|
}
|
|
323
323
|
function $t(t) {
|
|
@@ -390,7 +390,7 @@ function ar(t, e) {
|
|
|
390
390
|
if (e.conversation_id !== t.sessionId) throw new Error("Execution belongs to another conversation.");
|
|
391
391
|
if (As(e.version), t.execution && e.version <= t.execution.version) return t;
|
|
392
392
|
const n = { ...t.executionByUserMessage };
|
|
393
|
-
for (const i of
|
|
393
|
+
for (const i of an(e)) n[i] = { version: e.version, phase: e.phase };
|
|
394
394
|
return { ...t, execution: e, executionByUserMessage: n };
|
|
395
395
|
}
|
|
396
396
|
function tp(t) {
|
|
@@ -586,9 +586,9 @@ function np(t, e, n, i) {
|
|
|
586
586
|
}
|
|
587
587
|
case "conversation.stop": {
|
|
588
588
|
if (n.clients[e.clientScopeId] !== e.conversationScopeId) return { state: t, effects: o };
|
|
589
|
-
const r = n.selections[e.conversationScopeId].sessionId, l = r ? t.sessions[r]?.execution : null, u = Object.values(t.submissions).filter((f) => (r ? f.sessionId === r : f.conversationScopeId === e.conversationScopeId) && (!e.userMessageIds || e.userMessageIds.includes(f.userMessageId))), p = u.filter((f) => !f.cancelled && (f.delivery !== "failed" || t.deliveries[f.userMessageId]?.phase === "paused") && (f.delivery !== "accepted" || f.executionVersion === null)), c = p.length > 0, h = l && ["queued", "thinking", "steering", "stopping"].includes(l.phase) && (!e.userMessageIds ||
|
|
589
|
+
const r = n.selections[e.conversationScopeId].sessionId, l = r ? t.sessions[r]?.execution : null, u = Object.values(t.submissions).filter((f) => (r ? f.sessionId === r : f.conversationScopeId === e.conversationScopeId) && (!e.userMessageIds || e.userMessageIds.includes(f.userMessageId))), p = u.filter((f) => !f.cancelled && (f.delivery !== "failed" || t.deliveries[f.userMessageId]?.phase === "paused") && (f.delivery !== "accepted" || f.executionVersion === null)), c = p.length > 0, h = l && ["queued", "thinking", "steering", "stopping"].includes(l.phase) && (!e.userMessageIds || an(l).some((f) => e.userMessageIds.includes(f)));
|
|
590
590
|
if (!c && !h && (l || !e.userMessageIds?.length)) return { state: t, effects: o };
|
|
591
|
-
const g = Array.from(new Set(e.userMessageIds ?? [...p.map((f) => f.userMessageId), ...h ?
|
|
591
|
+
const g = Array.from(new Set(e.userMessageIds ?? [...p.map((f) => f.userMessageId), ...h ? an(l) : []])), y = { ...t.submissions };
|
|
592
592
|
for (const f of u)
|
|
593
593
|
g.includes(f.userMessageId) && f.delivery !== "accepted" && (y[f.userMessageId] = { ...f, cancelled: !0 });
|
|
594
594
|
s = { ...t, submissions: y, stops: { ...t.stops, [e.conversationScopeId]: {
|
|
@@ -783,7 +783,7 @@ function ur(t) {
|
|
|
783
783
|
};
|
|
784
784
|
for (const [a, r] of Object.entries(e.stops))
|
|
785
785
|
for (const l of r.userMessageIds) {
|
|
786
|
-
const u = e.submissions[l], p = u?.sessionId ?? Object.values(e.sessions).find((h) =>
|
|
786
|
+
const u = e.submissions[l], p = u?.sessionId ?? Object.values(e.sessions).find((h) => an(h.execution).includes(l))?.sessionId, c = u?.delivery === "accepted" || p && an(e.sessions[p]?.execution).includes(l);
|
|
787
787
|
p && c && o(`stop:${a}:${r.requestId}:${l}`, p, l, r.reason);
|
|
788
788
|
}
|
|
789
789
|
for (const a of Object.values(e.submissions))
|
|
@@ -1584,12 +1584,12 @@ function Bn(t, e, n) {
|
|
|
1584
1584
|
}
|
|
1585
1585
|
const c = o?.execution, h = a.filter((x) => !x.cancelled && x.delivery !== "failed"), g = h.filter((x) => x.delivery !== "accepted" && x.executionVersion === null), y = h.filter((x) => x.delivery === "accepted" && x.executionVersion === null), f = h[h.length - 1], w = g.length > 0, _ = f !== void 0 && y.includes(f);
|
|
1586
1586
|
let I = w ? "submitting" : _ ? "awaiting_execution" : c?.phase ?? "idle";
|
|
1587
|
-
const T = Object.entries(t.stops).filter(([x]) => x === n || s !== null && e.selections[x]?.sessionId === s).map(([, x]) => x).find((x) => (!a.length || x.userMessageIds.includes(a[a.length - 1].userMessageId) || !w && !_ &&
|
|
1588
|
-
T && b && !w && (!c || !["thinking", "steering", "queued", "stopping"].includes(c.phase) ||
|
|
1587
|
+
const T = Object.entries(t.stops).filter(([x]) => x === n || s !== null && e.selections[x]?.sessionId === s).map(([, x]) => x).find((x) => (!a.length || x.userMessageIds.includes(a[a.length - 1].userMessageId) || !w && !_ && an(c).some((D) => x.userMessageIds.includes(D))) && (!c || c.version <= x.executionVersion || ["thinking", "steering", "queued", "stopping"].includes(c.phase) || a.some((D) => D.cancelled && D.executionVersion === null && x.userMessageIds.includes(D.userMessageId)))), b = c && ["thinking", "steering", "queued", "stopping"].includes(c.phase) || a.some((x) => x.delivery === "accepted" && x.executionVersion === null && T?.userMessageIds.includes(x.userMessageId));
|
|
1588
|
+
T && b && !w && (!c || !["thinking", "steering", "queued", "stopping"].includes(c.phase) || an(c).every((x) => T.userMessageIds.includes(x))) && (I = "stopping"), T && !b && !w && a.some((x) => x.cancelled && x.executionVersion === null && T.userMessageIds.includes(x.userMessageId)) && (I = a.some((x) => T.userMessageIds.includes(x.userMessageId) && ["sending", "uncertain"].includes(x.delivery)) ? "stopping" : "stopped");
|
|
1589
1589
|
const q = ["thinking", "steering", "queued"].includes(I), F = t.stops[n] ?? T, M = F?.userMessageIds.filter((x) => !["completed", "failed"].includes(o?.executionByUserMessage[x]?.phase ?? "")) ?? [], Z = M.some((x) => {
|
|
1590
1590
|
const D = a.find((Y) => Y.userMessageId === x);
|
|
1591
|
-
return !Object.values(t.operations).some((Y) => Y.command.type === "run.stop" && Y.command.payload.expectedUserMessageId === x && Y.phase === "done") && (D?.executionVersion === null && ["sending", "uncertain", "accepted"].includes(D.delivery) || !!(c &&
|
|
1592
|
-
}), L =
|
|
1591
|
+
return !Object.values(t.operations).some((Y) => Y.command.type === "run.stop" && Y.command.payload.expectedUserMessageId === x && Y.phase === "done") && (D?.executionVersion === null && ["sending", "uncertain", "accepted"].includes(D.delivery) || !!(c && an(c).includes(x) && ["thinking", "steering", "queued", "stopping"].includes(c.phase)));
|
|
1592
|
+
}), L = c?.user_message_ids ?? [], de = w || _ ? f?.userMessageId ?? null : L[L.length - 1] ?? null, se = p.find((x) => x.userMessageId === de), ge = q ? [...se?.activityIds ?? []].reverse().find((x) => u[x] === "open") ?? null : null, te = s !== null && !!e.selections[n]?.provisionalId && r.length === 0 && a.length === 0 && // The first persisted idle snapshot already has a positive synchronization version.
|
|
1593
1593
|
(!o?.execution || o.execution.phase === "idle" && o.execution.user_message_ids.length === 0) && Object.values(t.operations).some((x) => x.conversationScopeId === n && x.phase === "done" && ["runtime.warmup", "attachment.prepare"].includes(x.command.type) && !x.command.payload.sessionId && x.result?.sessionId === s);
|
|
1594
1594
|
return Pt({
|
|
1595
1595
|
selectionKey: n ? JSON.stringify([t.authorityId, t.generation, n]) : void 0,
|
|
@@ -8686,7 +8686,7 @@ function lf() {
|
|
|
8686
8686
|
if (!Ln(I, T, y?.body)) {
|
|
8687
8687
|
const q = {
|
|
8688
8688
|
requestId: Ho("fetch"),
|
|
8689
|
-
url:
|
|
8689
|
+
url: Ft(I, zo),
|
|
8690
8690
|
method: (y?.method ?? _?.method ?? "GET").toUpperCase(),
|
|
8691
8691
|
requestHeaders: T,
|
|
8692
8692
|
requestBody: Vl(y?.body),
|
|
@@ -8706,7 +8706,7 @@ function lf() {
|
|
|
8706
8706
|
(F) => {
|
|
8707
8707
|
e({
|
|
8708
8708
|
...q,
|
|
8709
|
-
errorText:
|
|
8709
|
+
errorText: Ft(F instanceof Error ? F.message : String(F)),
|
|
8710
8710
|
durationMs: Date.now() - f
|
|
8711
8711
|
});
|
|
8712
8712
|
}
|
|
@@ -8720,7 +8720,7 @@ function lf() {
|
|
|
8720
8720
|
return $o.set(this, {
|
|
8721
8721
|
requestId: Ho("xhr"),
|
|
8722
8722
|
method: String(g ?? "GET").toUpperCase(),
|
|
8723
|
-
url:
|
|
8723
|
+
url: Ft(T, zo),
|
|
8724
8724
|
requestHeaders: {},
|
|
8725
8725
|
startedAtMs: Date.now(),
|
|
8726
8726
|
startedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -8789,7 +8789,7 @@ function lf() {
|
|
|
8789
8789
|
const f = performance.timeOrigin + y.startTime;
|
|
8790
8790
|
e({
|
|
8791
8791
|
requestId: Ho("resource"),
|
|
8792
|
-
url:
|
|
8792
|
+
url: Ft(y.name, zo),
|
|
8793
8793
|
method: "GET",
|
|
8794
8794
|
resourceType: "resource",
|
|
8795
8795
|
responseStatus: y.responseStatus,
|
|
@@ -9543,7 +9543,7 @@ function jf(t, e) {
|
|
|
9543
9543
|
createdAt: typeof n.createdAt == "string" ? n.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
|
|
9544
9544
|
...Be(s) !== null ? { displaySequence: Be(s) } : {},
|
|
9545
9545
|
...nt(s) !== null ? { causalSequence: nt(s) } : {},
|
|
9546
|
-
respondsToUserMessageId:
|
|
9546
|
+
respondsToUserMessageId: nn(s) ?? void 0,
|
|
9547
9547
|
...ze(s) ? { runId: ze(s) } : {},
|
|
9548
9548
|
dataType: "assistant_draft",
|
|
9549
9549
|
...s.steered === !0 ? { steered: !0 } : {}
|
|
@@ -9560,7 +9560,7 @@ function jf(t, e) {
|
|
|
9560
9560
|
createdAt: typeof n.createdAt == "string" ? n.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
|
|
9561
9561
|
...Be(s) !== null ? { displaySequence: Be(s) } : {},
|
|
9562
9562
|
...nt(s) !== null ? { causalSequence: nt(s) } : {},
|
|
9563
|
-
respondsToUserMessageId:
|
|
9563
|
+
respondsToUserMessageId: nn(s) ?? void 0,
|
|
9564
9564
|
...ze(s) ? { runId: ze(s) } : {},
|
|
9565
9565
|
attachments: bd(s.attachments, e),
|
|
9566
9566
|
...s.steered === !0 ? { steered: !0 } : {}
|
|
@@ -9585,7 +9585,7 @@ function jf(t, e) {
|
|
|
9585
9585
|
content: "",
|
|
9586
9586
|
createdAt: typeof n.createdAt == "string" ? n.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
|
|
9587
9587
|
...Be(s) !== null ? { displaySequence: Be(s) } : {},
|
|
9588
|
-
respondsToUserMessageId:
|
|
9588
|
+
respondsToUserMessageId: nn(s) ?? void 0,
|
|
9589
9589
|
...ze(s) ? { runId: ze(s) } : {},
|
|
9590
9590
|
dataType: "function_call_output",
|
|
9591
9591
|
toolName: Ms,
|
|
@@ -9600,7 +9600,7 @@ function jf(t, e) {
|
|
|
9600
9600
|
content: "",
|
|
9601
9601
|
createdAt: typeof n.createdAt == "string" ? n.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
|
|
9602
9602
|
...Be(s) !== null ? { displaySequence: Be(s) } : {},
|
|
9603
|
-
respondsToUserMessageId:
|
|
9603
|
+
respondsToUserMessageId: nn(s) ?? void 0,
|
|
9604
9604
|
...ze(s) ? { runId: ze(s) } : {},
|
|
9605
9605
|
dataType: "scheduled_check_in",
|
|
9606
9606
|
toolName: dd,
|
|
@@ -9616,7 +9616,7 @@ function jf(t, e) {
|
|
|
9616
9616
|
createdAt: typeof n.createdAt == "string" ? n.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
|
|
9617
9617
|
...Be(s) !== null ? { displaySequence: Be(s) } : {},
|
|
9618
9618
|
...nt(s) !== null ? { causalSequence: nt(s) } : {},
|
|
9619
|
-
respondsToUserMessageId:
|
|
9619
|
+
respondsToUserMessageId: nn(s) ?? void 0,
|
|
9620
9620
|
...ze(s) ? { runId: ze(s) } : {},
|
|
9621
9621
|
dataType: "function_call_output",
|
|
9622
9622
|
toolName: "authenticate_pipedream_app",
|
|
@@ -9629,7 +9629,7 @@ function jf(t, e) {
|
|
|
9629
9629
|
createdAt: typeof n.createdAt == "string" ? n.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
|
|
9630
9630
|
...Be(s) !== null ? { displaySequence: Be(s) } : {},
|
|
9631
9631
|
...nt(s) !== null ? { causalSequence: nt(s) } : {},
|
|
9632
|
-
respondsToUserMessageId:
|
|
9632
|
+
respondsToUserMessageId: nn(s) ?? void 0,
|
|
9633
9633
|
...ze(s) ? { runId: ze(s) } : {},
|
|
9634
9634
|
dataType: "function_call_output",
|
|
9635
9635
|
toolName: "request_personal_channel_connection",
|
|
@@ -9644,7 +9644,7 @@ function jf(t, e) {
|
|
|
9644
9644
|
createdAt: typeof n.createdAt == "string" ? n.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
|
|
9645
9645
|
...Be(s) !== null ? { displaySequence: Be(s) } : {},
|
|
9646
9646
|
...nt(s) !== null ? { causalSequence: nt(s) } : {},
|
|
9647
|
-
respondsToUserMessageId:
|
|
9647
|
+
respondsToUserMessageId: nn(s) ?? void 0,
|
|
9648
9648
|
...ze(s) ? { runId: ze(s) } : {},
|
|
9649
9649
|
dataType: String(s.type),
|
|
9650
9650
|
toolName: s.type === "tab_lifecycle_decision" ? "tab_lifecycle_decision" : typeof s.name == "string" ? s.name : void 0,
|
|
@@ -9658,7 +9658,7 @@ function jf(t, e) {
|
|
|
9658
9658
|
createdAt: typeof n.createdAt == "string" ? n.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
|
|
9659
9659
|
...Be(s) !== null ? { displaySequence: Be(s) } : {},
|
|
9660
9660
|
...nt(s) !== null ? { causalSequence: nt(s) } : {},
|
|
9661
|
-
respondsToUserMessageId:
|
|
9661
|
+
respondsToUserMessageId: nn(s) ?? void 0,
|
|
9662
9662
|
...ze(s) ? { runId: ze(s) } : {},
|
|
9663
9663
|
dataType: String(s.type),
|
|
9664
9664
|
loading: s.steered !== !0 && s.type === "run_status" && (s.status === "running" || s.status === "retrying"),
|
|
@@ -9967,7 +9967,7 @@ function rm(t) {
|
|
|
9967
9967
|
} = t;
|
|
9968
9968
|
return o;
|
|
9969
9969
|
}
|
|
9970
|
-
function
|
|
9970
|
+
function nn(t) {
|
|
9971
9971
|
const e = t.respondsToUserMessageId;
|
|
9972
9972
|
return typeof e == "string" && e ? e : null;
|
|
9973
9973
|
}
|
|
@@ -9991,7 +9991,7 @@ function xd(t) {
|
|
|
9991
9991
|
return e;
|
|
9992
9992
|
}
|
|
9993
9993
|
function Yr(t, e) {
|
|
9994
|
-
return Pd(t) ? Ls :
|
|
9994
|
+
return Pd(t) ? Ls : Ft(_s(e), ef);
|
|
9995
9995
|
}
|
|
9996
9996
|
function lm(t, e) {
|
|
9997
9997
|
return typeof t == "string" ? t : t instanceof URL ? t.toString() : e?.url ?? "";
|
|
@@ -10025,10 +10025,10 @@ async function dm(t) {
|
|
|
10025
10025
|
return;
|
|
10026
10026
|
const { done: l, value: u } = r;
|
|
10027
10027
|
if (l)
|
|
10028
|
-
return
|
|
10028
|
+
return Ft(o + s.decode());
|
|
10029
10029
|
const p = Wr - a;
|
|
10030
10030
|
if (u.byteLength > p)
|
|
10031
|
-
return o += s.decode(u.subarray(0, Math.max(p, 0)), { stream: !0 }), e.cancel(), `${
|
|
10031
|
+
return o += s.decode(u.subarray(0, Math.max(p, 0)), { stream: !0 }), e.cancel(), `${Ft(o)}... [truncated]`;
|
|
10032
10032
|
a += u.byteLength, o += s.decode(u, { stream: !0 });
|
|
10033
10033
|
}
|
|
10034
10034
|
} catch {
|
|
@@ -10041,14 +10041,14 @@ async function dm(t) {
|
|
|
10041
10041
|
function um(t, e) {
|
|
10042
10042
|
if (kd(new Headers(e)))
|
|
10043
10043
|
try {
|
|
10044
|
-
return t.responseType === "" || t.responseType === "text" ?
|
|
10044
|
+
return t.responseType === "" || t.responseType === "text" ? Ft(t.responseText ?? "") : void 0;
|
|
10045
10045
|
} catch {
|
|
10046
10046
|
return;
|
|
10047
10047
|
}
|
|
10048
10048
|
}
|
|
10049
10049
|
function Vl(t) {
|
|
10050
10050
|
if (typeof t == "string")
|
|
10051
|
-
return
|
|
10051
|
+
return Ft(t);
|
|
10052
10052
|
}
|
|
10053
10053
|
function pm(t) {
|
|
10054
10054
|
return it({
|
|
@@ -10117,7 +10117,7 @@ function fm(t) {
|
|
|
10117
10117
|
}
|
|
10118
10118
|
return e;
|
|
10119
10119
|
}
|
|
10120
|
-
function
|
|
10120
|
+
function Ft(t, e = Wr) {
|
|
10121
10121
|
return t.length <= e ? t : `${t.slice(0, e)}... [truncated ${t.length - e} chars]`;
|
|
10122
10122
|
}
|
|
10123
10123
|
function Ho(t) {
|
|
@@ -10156,7 +10156,7 @@ function bm(t) {
|
|
|
10156
10156
|
function _m(t) {
|
|
10157
10157
|
return t === 401 || t === 403;
|
|
10158
10158
|
}
|
|
10159
|
-
const Ls = "[REDACTED_SECRET]",
|
|
10159
|
+
const Ls = "[REDACTED_SECRET]", jt = "[REDACTED_TOKEN]", vm = "[REDACTED_SIGNED_URL]", Sm = 20, Im = /^(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, Cd = /\bBearer\s+[A-Za-z0-9._~+/=-]{12,}/gi, Ad = /\bBasic\s+[A-Za-z0-9+/=-]{12,}/gi, Td = /\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\b/g, Rd = /\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, xm = /\bhttps?:\/\/[^\s"'<>]+(?:X-Amz-Signature|X-Goog-Signature|Signature|sig=)[^\s"'<>]*/gi, km = /\bhttps?:\/\/[^\s"'<>]+/gi, Em = /[),.;\]]+$/;
|
|
10160
10160
|
function it(t) {
|
|
10161
10161
|
return bs(t, 0, /* @__PURE__ */ new WeakSet());
|
|
10162
10162
|
}
|
|
@@ -10187,17 +10187,17 @@ function Md(t) {
|
|
|
10187
10187
|
try {
|
|
10188
10188
|
const e = new URL(t, location.href);
|
|
10189
10189
|
for (const n of Array.from(e.searchParams.keys()))
|
|
10190
|
-
Im.test(n) && e.searchParams.set(n,
|
|
10191
|
-
return e.username && (e.username =
|
|
10190
|
+
Im.test(n) && e.searchParams.set(n, jt);
|
|
10191
|
+
return e.username && (e.username = jt), e.password && (e.password = jt), e.toString();
|
|
10192
10192
|
} catch {
|
|
10193
10193
|
return Am(t);
|
|
10194
10194
|
}
|
|
10195
10195
|
}
|
|
10196
10196
|
function _s(t) {
|
|
10197
|
-
return t.replace(xm, vm).replace(km, Tm).replace(Cd, `Bearer ${
|
|
10197
|
+
return t.replace(xm, vm).replace(km, Tm).replace(Cd, `Bearer ${jt}`).replace(Ad, `Basic ${jt}`).replace(Td, jt).replace(Rd, (e, n) => `${n}: ${Ls}`);
|
|
10198
10198
|
}
|
|
10199
10199
|
function Am(t) {
|
|
10200
|
-
return t.replace(Cd, `Bearer ${
|
|
10200
|
+
return t.replace(Cd, `Bearer ${jt}`).replace(Ad, `Basic ${jt}`).replace(Td, jt).replace(Rd, (e, n) => `${n}: ${Ls}`);
|
|
10201
10201
|
}
|
|
10202
10202
|
function Tm(t) {
|
|
10203
10203
|
const e = t.match(Em)?.[0] ?? "", n = e ? t.slice(0, -e.length) : t;
|
|
@@ -10507,7 +10507,7 @@ function Qm(t) {
|
|
|
10507
10507
|
e ^= t.charCodeAt(n), e = Math.imul(e, 16777619);
|
|
10508
10508
|
return `fnv1a-${(e >>> 0).toString(16).padStart(8, "0")}`;
|
|
10509
10509
|
}
|
|
10510
|
-
const Zm = "0.1.
|
|
10510
|
+
const Zm = "0.1.233", ey = 80, ty = 64e3, ec = 60, Ko = 160;
|
|
10511
10511
|
function ny(t, e, n, i) {
|
|
10512
10512
|
const s = /* @__PURE__ */ new Map(), o = [], a = [];
|
|
10513
10513
|
let r = 0, l = 0, u = 0, p = crypto.randomUUID(), c = i.getState(), h = c.user?.id, g = null, y = "", f = "", w = "";
|
|
@@ -10867,7 +10867,7 @@ async function Dy(t = {}) {
|
|
|
10867
10867
|
r.style.setProperty(
|
|
10868
10868
|
"--pluno-pa-mobile-panel-top-offset",
|
|
10869
10869
|
`${e.mobilePanelTopOffset}px`
|
|
10870
|
-
), r.classList.add(`pluno-pa-widget--${e.colorScheme}`), e.scribbleStyle && r.classList.add("pluno-pa-widget--scribble"), p === "minimized" && (r.classList.add("pluno-pa-widget--minimized"),
|
|
10870
|
+
), r.classList.add(`pluno-pa-widget--${e.colorScheme}`), e.scribbleStyle && r.classList.add("pluno-pa-widget--scribble"), p === "minimized" && (r.classList.add("pluno-pa-widget--minimized"), sn(
|
|
10871
10871
|
r,
|
|
10872
10872
|
Jo(
|
|
10873
10873
|
r,
|
|
@@ -10996,7 +10996,7 @@ async function Dy(t = {}) {
|
|
|
10996
10996
|
throw new Error("Failed to mount Pluno widget drag handle");
|
|
10997
10997
|
if (e.movableLauncher && !Z)
|
|
10998
10998
|
throw new Error("Failed to mount Pluno widget panel drag handle");
|
|
10999
|
-
let
|
|
10999
|
+
let Ht = null, cn = !1, An = null, We = "idle";
|
|
11000
11000
|
const Ri = () => {
|
|
11001
11001
|
if (!(H !== null && !H.hidden && !r.classList.contains("pluno-pa-widget--proactive-suggestion-in-panel") && e.layout === "floating")) {
|
|
11002
11002
|
r.classList.remove("pluno-pa-widget--proactive-suggestion-below");
|
|
@@ -11012,13 +11012,13 @@ async function Dy(t = {}) {
|
|
|
11012
11012
|
}, lt = () => {
|
|
11013
11013
|
if (!H || !we || !Ce || !aa || !St || !Kn || !Ti)
|
|
11014
11014
|
return;
|
|
11015
|
-
const d = e.proactiveSuggestion ??
|
|
11015
|
+
const d = e.proactiveSuggestion ?? Ht, m = d !== null && !C.getState().isThinking, S = M.querySelector(
|
|
11016
11016
|
".pluno-pa-widget__proactive-suggestion-slot"
|
|
11017
11017
|
), k = !M.hidden && !r.classList.contains("pluno-pa-widget--closing"), P = m && k && S !== null;
|
|
11018
11018
|
P ? H.parentElement !== S && S.appendChild(H) : H.parentElement !== r && r.insertBefore(H, se), H.hidden = !m, r.classList.toggle("pluno-pa-widget--proactive-suggestion", m), r.classList.toggle(
|
|
11019
11019
|
"pluno-pa-widget--proactive-suggestion-in-panel",
|
|
11020
11020
|
P
|
|
11021
|
-
), we.textContent = d?.question ?? "", Ce.hidden = e.proactiveSuggestion === null || cn, aa.hidden =
|
|
11021
|
+
), we.textContent = d?.question ?? "", Ce.hidden = e.proactiveSuggestion === null || cn, aa.hidden = Ht === null;
|
|
11022
11022
|
const ne = We === "success";
|
|
11023
11023
|
St.hidden = ne, Kn.hidden = ne, Kn.disabled = We === "submitting" || St.value.trim().length === 0, Kn.textContent = We === "submitting" ? "Sending…" : "Send feedback", Ti.textContent = We === "success" ? "Thanks — this helps improve your suggestions." : We === "error" ? "Couldn’t send feedback. Please try again." : "Tell Pluno what made this suggestion miss the mark.", Ti.classList.toggle(
|
|
11024
11024
|
"pluno-pa-widget__proactive-suggestion-feedback-status--success",
|
|
@@ -11049,9 +11049,9 @@ async function Dy(t = {}) {
|
|
|
11049
11049
|
for (const d of Vn.values()) URL.revokeObjectURL?.(d);
|
|
11050
11050
|
Vn.clear();
|
|
11051
11051
|
};
|
|
11052
|
-
let ct = 0,
|
|
11052
|
+
let ct = 0, Wt = 0, ca = 0;
|
|
11053
11053
|
const It = /* @__PURE__ */ new Map();
|
|
11054
|
-
let
|
|
11054
|
+
let Kt = null, Mt = null;
|
|
11055
11055
|
const zs = (d) => d === R ? "widget_composer" : d === b ? "widget_launcher" : d && a.contains(d) ? "widget_control" : d === _.body ? "body" : d === _.documentElement ? "document" : d ? "host_page" : "none", dn = (d, m, S = {}) => {
|
|
11056
11056
|
const k = ts(_), P = S.skipIfAlreadyFocused === !0 && k === d;
|
|
11057
11057
|
P || (S.preventScroll ? d.focus({ preventScroll: !0 }) : d.focus());
|
|
@@ -11077,7 +11077,7 @@ async function Dy(t = {}) {
|
|
|
11077
11077
|
isThinking: C.getState().isThinking
|
|
11078
11078
|
}
|
|
11079
11079
|
), !P && ne === d;
|
|
11080
|
-
},
|
|
11080
|
+
}, Vt = (d) => !R.isConnected || R.disabled || R.readOnly || !r.classList.contains("pluno-pa-widget--open") || e.loginRequired || e.signupRequired || qn(e.billingStatus) ? !1 : dn(R, d, {
|
|
11081
11081
|
preventScroll: !0,
|
|
11082
11082
|
skipIfAlreadyFocused: !0
|
|
11083
11083
|
}), Gn = () => {
|
|
@@ -11085,9 +11085,9 @@ async function Dy(t = {}) {
|
|
|
11085
11085
|
Y,
|
|
11086
11086
|
Qe,
|
|
11087
11087
|
(d) => {
|
|
11088
|
-
|
|
11088
|
+
Wt++, Qe = Qe.filter(
|
|
11089
11089
|
(m, S) => S !== d
|
|
11090
|
-
), Gn(), _e(C.getState()), Te(),
|
|
11090
|
+
), Gn(), _e(C.getState()), Te(), Vt("remove_attachment");
|
|
11091
11091
|
}
|
|
11092
11092
|
);
|
|
11093
11093
|
}, da = e.loginRequired || e.signupRequired || e.token || e.webSocketFactory ? void 0 : e.tokenProvider ?? (e.tokenEndpoint ? async (d) => mb(
|
|
@@ -11193,9 +11193,9 @@ async function Dy(t = {}) {
|
|
|
11193
11193
|
}
|
|
11194
11194
|
);
|
|
11195
11195
|
const Ws = new Set(u.openToolGroupKeys);
|
|
11196
|
-
let dt = null,
|
|
11196
|
+
let dt = null, Gt = null, qe = !1, Jt = !1, qt = {
|
|
11197
11197
|
enabled: !0
|
|
11198
|
-
},
|
|
11198
|
+
}, Yt = 0, Ks = null, un = null, pn = null, Mi = null, Yn = !1, be = null;
|
|
11199
11199
|
const qi = /* @__PURE__ */ new Set();
|
|
11200
11200
|
let Li = "", $e = !1, Ze = null, ga = location.origin, fa = C.getState().sessionId, ma = C.getState().user?.id ?? null, Vs = C.getState().status, Lt = () => {
|
|
11201
11201
|
}, Gs = "", et = C.getSessionHistoryState();
|
|
@@ -11216,9 +11216,9 @@ async function Dy(t = {}) {
|
|
|
11216
11216
|
current: be.observedWelcome
|
|
11217
11217
|
}), be = null);
|
|
11218
11218
|
}, hu = (d = "jump") => {
|
|
11219
|
-
tt(!0, d), ut(), Dn(A, () => qt.enabled),
|
|
11219
|
+
tt(!0, d), ut(), Dn(A, () => qt.enabled), Yt = A.scrollTop;
|
|
11220
11220
|
}, Oi = (d) => {
|
|
11221
|
-
Ks = d, d === "up" && A.scrollTop <
|
|
11221
|
+
Ks = d, d === "up" && A.scrollTop < Yt - 1 && (Yn = !0, tt(!1, "userScroll")), un !== null && window.clearTimeout(un), un = window.setTimeout(() => {
|
|
11222
11222
|
Ks = null, un = null;
|
|
11223
11223
|
}, 500);
|
|
11224
11224
|
};
|
|
@@ -11267,7 +11267,7 @@ async function Dy(t = {}) {
|
|
|
11267
11267
|
);
|
|
11268
11268
|
const gt = document.createElement("small");
|
|
11269
11269
|
gt.className = "pluno-pa-widget__history-path", gt.textContent = tw(k), P.append(Ae, ye, gt), P.addEventListener("click", () => {
|
|
11270
|
-
$e = !1, Lt(), be = null, Yn = !1, qi.clear(), tt(!0, "newSession"), ut(), C.loadSession(k.id), ti = null, _e(C.getState()),
|
|
11270
|
+
$e = !1, Lt(), be = null, Yn = !1, qi.clear(), tt(!0, "newSession"), ut(), C.loadSession(k.id), ti = null, _e(C.getState()), Vt("history_session_selected");
|
|
11271
11271
|
}), O.appendChild(P);
|
|
11272
11272
|
}
|
|
11273
11273
|
if (m && d.length > 0) {
|
|
@@ -11321,7 +11321,7 @@ async function Dy(t = {}) {
|
|
|
11321
11321
|
r.classList.remove("pluno-pa-widget--minimized"), I.removeAttribute("tabindex"), I.removeAttribute("role"), I.removeAttribute("aria-label"), !r.classList.contains("pluno-pa-widget--open") && !r.classList.contains("pluno-pa-widget--closing") && Zn(!1), m && Ni("shown", S);
|
|
11322
11322
|
return;
|
|
11323
11323
|
}
|
|
11324
|
-
dt !== null && (window.clearTimeout(dt), dt = null), r.classList.remove("pluno-pa-widget--open"), r.classList.remove("pluno-pa-widget--closing"), r.classList.add("pluno-pa-widget--minimized"), I.hidden = !1, I.setAttribute("role", "button"), I.setAttribute("aria-label", "Open Pluno"), M.hidden = !0, se.hidden = !0, I.tabIndex = 0, R.value = "", lt(),
|
|
11324
|
+
dt !== null && (window.clearTimeout(dt), dt = null), r.classList.remove("pluno-pa-widget--open"), r.classList.remove("pluno-pa-widget--closing"), r.classList.add("pluno-pa-widget--minimized"), I.hidden = !1, I.setAttribute("role", "button"), I.setAttribute("aria-label", "Open Pluno"), M.hidden = !0, se.hidden = !0, I.tabIndex = 0, R.value = "", lt(), sn(
|
|
11325
11325
|
r,
|
|
11326
11326
|
Jo(
|
|
11327
11327
|
r,
|
|
@@ -11350,12 +11350,12 @@ async function Dy(t = {}) {
|
|
|
11350
11350
|
});
|
|
11351
11351
|
}, Zn = (d = !0) => {
|
|
11352
11352
|
if (!c) {
|
|
11353
|
-
|
|
11353
|
+
sn(r, null);
|
|
11354
11354
|
const S = Xn(d);
|
|
11355
11355
|
return Ri(), S;
|
|
11356
11356
|
}
|
|
11357
11357
|
const m = Xn(d);
|
|
11358
|
-
return
|
|
11358
|
+
return sn(r, m), Ri(), hn("Applied stored closed launcher position", {
|
|
11359
11359
|
visibleLauncherPosition: m
|
|
11360
11360
|
}), m;
|
|
11361
11361
|
}, Ui = (d, m) => {
|
|
@@ -11372,7 +11372,7 @@ async function Dy(t = {}) {
|
|
|
11372
11372
|
return M.getBoundingClientRect().width || d;
|
|
11373
11373
|
}, va = () => {
|
|
11374
11374
|
if (r.classList.contains("pluno-pa-widget--minimized")) {
|
|
11375
|
-
|
|
11375
|
+
sn(
|
|
11376
11376
|
r,
|
|
11377
11377
|
Jo(
|
|
11378
11378
|
r,
|
|
@@ -11424,14 +11424,14 @@ async function Dy(t = {}) {
|
|
|
11424
11424
|
c = Yo(
|
|
11425
11425
|
k,
|
|
11426
11426
|
S
|
|
11427
|
-
), y = null,
|
|
11427
|
+
), y = null, sn(r, k), Ri(), hn("Dragging closed launcher", {
|
|
11428
11428
|
requestedPosition: m
|
|
11429
11429
|
});
|
|
11430
11430
|
},
|
|
11431
11431
|
persist: () => {
|
|
11432
11432
|
h = !0, Ke(), hn("Persisted closed launcher drag position");
|
|
11433
11433
|
}
|
|
11434
|
-
})) :
|
|
11434
|
+
})) : sn(r, null), Go(r, g);
|
|
11435
11435
|
const Ia = () => {
|
|
11436
11436
|
const d = Sn(g), m = Xn();
|
|
11437
11437
|
return {
|
|
@@ -11478,7 +11478,7 @@ async function Dy(t = {}) {
|
|
|
11478
11478
|
c = Yo(
|
|
11479
11479
|
P,
|
|
11480
11480
|
k
|
|
11481
|
-
), h = !0, y = null,
|
|
11481
|
+
), h = !0, y = null, sn(r, P), Ui(S, P);
|
|
11482
11482
|
}, yu = e.movableLauncher && Z ? $y({
|
|
11483
11483
|
root: r,
|
|
11484
11484
|
handle: Z,
|
|
@@ -11551,15 +11551,15 @@ async function Dy(t = {}) {
|
|
|
11551
11551
|
openPanelPosition: ye,
|
|
11552
11552
|
visibleLauncherPosition: Ae
|
|
11553
11553
|
}), tt(!0, "open"), ut(), !ne && e.layout === "floating" && C.recordWidgetLifecycle("opened", P), !m) {
|
|
11554
|
-
r.classList.add("pluno-pa-widget--open"), ne || Js(), I.hidden = !0, d && (R.value = d, mi(R)), Dn(A, () => qt.enabled),
|
|
11554
|
+
r.classList.add("pluno-pa-widget--open"), ne || Js(), I.hidden = !0, d && (R.value = d, mi(R)), Dn(A, () => qt.enabled), Yt = A.scrollTop, S && (dn(R, "panel_open_immediate"), R.setSelectionRange(R.value.length, R.value.length)), Ke(), Ni("shown", P), e.onPanelOpenChange?.(!0, P);
|
|
11555
11555
|
return;
|
|
11556
11556
|
}
|
|
11557
11557
|
const gt = Date.now();
|
|
11558
11558
|
window.requestAnimationFrame(() => {
|
|
11559
|
-
r.classList.add("pluno-pa-widget--open"), ne || Js(), d && (R.value = d, mi(R)), Dn(A, () => qt.enabled),
|
|
11559
|
+
r.classList.add("pluno-pa-widget--open"), ne || Js(), d && (R.value = d, mi(R)), Dn(A, () => qt.enabled), Yt = A.scrollTop, S && (dn(R, "panel_open_animation", {
|
|
11560
11560
|
scheduledAt: gt
|
|
11561
11561
|
}), R.setSelectionRange(R.value.length, R.value.length)), Ke(), Ni("shown", P), e.onPanelOpenChange?.(!0, P), dt = window.setTimeout(() => {
|
|
11562
|
-
I.hidden = !0, Dn(A, () => qt.enabled),
|
|
11562
|
+
I.hidden = !0, Dn(A, () => qt.enabled), Yt = A.scrollTop;
|
|
11563
11563
|
}, 220);
|
|
11564
11564
|
});
|
|
11565
11565
|
}, eo = (d = "external_request") => {
|
|
@@ -11584,7 +11584,7 @@ async function Dy(t = {}) {
|
|
|
11584
11584
|
const d = b.value;
|
|
11585
11585
|
pt(d, !0, !0, !0, "launcher_input"), b.value = "";
|
|
11586
11586
|
});
|
|
11587
|
-
let ni = null,
|
|
11587
|
+
let ni = null, Xt = null, Bi = null, yn = null, kt = null, Le = null;
|
|
11588
11588
|
const zi = (d) => d === b || d === R, Aa = (d) => d.composedPath().find(zi) ?? null, bu = (d) => {
|
|
11589
11589
|
let m = d;
|
|
11590
11590
|
for (; m; ) {
|
|
@@ -11652,14 +11652,14 @@ async function Dy(t = {}) {
|
|
|
11652
11652
|
if (!m)
|
|
11653
11653
|
return;
|
|
11654
11654
|
const S = Date.now();
|
|
11655
|
-
|
|
11655
|
+
Xt = S, ni = S, Le !== null && window.clearTimeout(Le);
|
|
11656
11656
|
const k = Ot ?? to(no());
|
|
11657
11657
|
k && (ii(k, m), d.stopImmediatePropagation()), Le = window.setTimeout(() => {
|
|
11658
|
-
if (Le = null,
|
|
11658
|
+
if (Le = null, Xt !== S)
|
|
11659
11659
|
return;
|
|
11660
11660
|
const P = no();
|
|
11661
11661
|
if (P === m) {
|
|
11662
|
-
|
|
11662
|
+
Xt = null;
|
|
11663
11663
|
return;
|
|
11664
11664
|
}
|
|
11665
11665
|
const ne = to(P);
|
|
@@ -11667,7 +11667,7 @@ async function Dy(t = {}) {
|
|
|
11667
11667
|
}, 0);
|
|
11668
11668
|
}, $i = (d) => {
|
|
11669
11669
|
const m = Aa(d);
|
|
11670
|
-
m && (ni = Date.now(), Ot !== null && (d.stopImmediatePropagation(),
|
|
11670
|
+
m && (ni = Date.now(), Ot !== null && (d.stopImmediatePropagation(), Xt = null, Le !== null && (window.clearTimeout(Le), Le = null), Ke(), d.type === "focus" && m === b && Ca()));
|
|
11671
11671
|
};
|
|
11672
11672
|
_.defaultView?.addEventListener(
|
|
11673
11673
|
"pointerdown",
|
|
@@ -11684,15 +11684,15 @@ async function Dy(t = {}) {
|
|
|
11684
11684
|
), r.addEventListener("pointerdown", (d) => {
|
|
11685
11685
|
zi(d.target) && d.stopPropagation();
|
|
11686
11686
|
}), r.addEventListener("focusin", (d) => {
|
|
11687
|
-
zi(d.target) && (d.stopPropagation(), ni = Date.now(),
|
|
11687
|
+
zi(d.target) && (d.stopPropagation(), ni = Date.now(), Xt = null, Le !== null && (window.clearTimeout(Le), Le = null), Ke());
|
|
11688
11688
|
}), r.addEventListener("focusout", (d) => {
|
|
11689
11689
|
if (!zi(d.target) || Ot !== null)
|
|
11690
11690
|
return;
|
|
11691
11691
|
const m = ni;
|
|
11692
11692
|
if (ni = null, m === null || Date.now() - m > ic)
|
|
11693
11693
|
return;
|
|
11694
|
-
const S = d.target, k =
|
|
11695
|
-
|
|
11694
|
+
const S = d.target, k = Xt !== null && Date.now() - Xt <= ic;
|
|
11695
|
+
Xt = null, Le !== null && (window.clearTimeout(Le), Le = null);
|
|
11696
11696
|
const P = (ne) => {
|
|
11697
11697
|
const Ae = to(ne);
|
|
11698
11698
|
if (!Ae)
|
|
@@ -11729,7 +11729,7 @@ async function Dy(t = {}) {
|
|
|
11729
11729
|
}), A.addEventListener("keydown", (d) => {
|
|
11730
11730
|
(d.key === "ArrowUp" || d.key === "PageUp" || d.key === "Home") && Oi("up");
|
|
11731
11731
|
}), A.addEventListener("scroll", () => {
|
|
11732
|
-
A.scrollTop <
|
|
11732
|
+
A.scrollTop < Yt - 1 && Ks === "up" && (Yn = !0, tt(!1, "userScroll")), Yt = A.scrollTop;
|
|
11733
11733
|
}), he.addEventListener("click", () => {
|
|
11734
11734
|
hu();
|
|
11735
11735
|
});
|
|
@@ -11760,7 +11760,7 @@ async function Dy(t = {}) {
|
|
|
11760
11760
|
}, Rn = () => {
|
|
11761
11761
|
const d = Dt(), m = C.getState(), S = !m.isThinking && !m.pendingMessageStatus && !!m.lastError;
|
|
11762
11762
|
b.readOnly = !1, R.readOnly = !1, b.placeholder = d ? e.signupRequired ? e.signupButtonLabel : e.loginButtonLabel : S ? "Needs attention" : si ? "New update" : e.launcherLabel, R.placeholder = d ? e.signupRequired ? e.signupButtonLabel : e.loginButtonLabel : Bt.launcherLabel, ge.hidden = d;
|
|
11763
|
-
}, ao = () => [...It.values()].some((d) => d.revision ===
|
|
11763
|
+
}, ao = () => [...It.values()].some((d) => d.revision === Wt && d.generation === ct), qa = () => {
|
|
11764
11764
|
const d = C.getState(), m = e.billingStatus;
|
|
11765
11765
|
return {
|
|
11766
11766
|
submissionAllowed: m?.submissionGate?.allowed === !0,
|
|
@@ -11773,19 +11773,19 @@ async function Dy(t = {}) {
|
|
|
11773
11773
|
// Delivery belongs to an earlier immutable input; only the current composer handoff blocks Send.
|
|
11774
11774
|
hasPendingMessage: !1
|
|
11775
11775
|
};
|
|
11776
|
-
},
|
|
11777
|
-
const d = C.getState(), m = !Fi() && [...It.values()].some((S) => S.revision ===
|
|
11776
|
+
}, Qt = () => e.productVariant === "personal" ? il(qa()) : !ro() && !qn(e.billingStatus) && !ao(), La = () => {
|
|
11777
|
+
const d = C.getState(), m = !Fi() && [...It.values()].some((S) => S.revision === Wt && S.generation === ct);
|
|
11778
11778
|
return $u({
|
|
11779
11779
|
hasRunningAssistantTurn: m || d.isThinking || d.turnPhase !== null || d.pendingMessageStatus !== null,
|
|
11780
11780
|
// Retained text already submitted by this revision must not hide Stop behind a disabled Send.
|
|
11781
11781
|
hasDraftMessage: !m && R.value.trim().length > 0,
|
|
11782
11782
|
hasPreSubmittedAttachment: Qe.length > 0,
|
|
11783
|
-
canSubmitMessage:
|
|
11783
|
+
canSubmitMessage: Qt()
|
|
11784
11784
|
});
|
|
11785
11785
|
}, Te = () => {
|
|
11786
11786
|
const d = La();
|
|
11787
|
-
sa(xe, d.action === "stop"), xe.disabled = d.disabled, e.productVariant === "personal" && (B && (B.disabled = !
|
|
11788
|
-
m.disabled = !
|
|
11787
|
+
sa(xe, d.action === "stop"), xe.disabled = d.disabled, e.productVariant === "personal" && (B && (B.disabled = !Qt()), r.querySelectorAll(".pluno-pa-widget__starter-prompt").forEach((m) => {
|
|
11788
|
+
m.disabled = !Qt();
|
|
11789
11789
|
})), ue.disabled = Dt() || wn() || e.productVariant !== "personal" && qn(e.billingStatus);
|
|
11790
11790
|
};
|
|
11791
11791
|
Rn();
|
|
@@ -11819,7 +11819,7 @@ async function Dy(t = {}) {
|
|
|
11819
11819
|
}, 3e3);
|
|
11820
11820
|
}, uo = (d, m) => {
|
|
11821
11821
|
const S = It.get(d);
|
|
11822
|
-
if (!S || m !== void 0 && S.submittedAt !== m || (It.delete(d), S.generation !== ct || S.revision !==
|
|
11822
|
+
if (!S || m !== void 0 && S.submittedAt !== m || (It.delete(d), S.generation !== ct || S.revision !== Wt)) return;
|
|
11823
11823
|
const k = new Set(S.attachments);
|
|
11824
11824
|
Qe = Qe.filter((P) => !k.has(P)), R.value = "", R.dispatchEvent(new Event("input", { bubbles: !0 })), Gn(), Te();
|
|
11825
11825
|
}, Da = (d) => {
|
|
@@ -11843,17 +11843,17 @@ async function Dy(t = {}) {
|
|
|
11843
11843
|
m === ct && Te();
|
|
11844
11844
|
});
|
|
11845
11845
|
}, Oa = () => {
|
|
11846
|
-
if (qe || !
|
|
11846
|
+
if (qe || !Kt || e.productVariant === "personal" && !il({ ...qa(), isSubmitting: !1 }) || C.getState().status !== "connected" || Dt() || qn(e.billingStatus))
|
|
11847
11847
|
return;
|
|
11848
|
-
const d =
|
|
11849
|
-
|
|
11848
|
+
const d = Kt;
|
|
11849
|
+
Kt = null, Da(d);
|
|
11850
11850
|
}, po = () => {
|
|
11851
11851
|
const d = R.value, m = d.trim(), S = [...Qe];
|
|
11852
|
-
if (
|
|
11852
|
+
if (Kt !== null || ao() || e.productVariant === "personal" && !Qt() || !m && S.length === 0)
|
|
11853
11853
|
return;
|
|
11854
11854
|
for (const P of S)
|
|
11855
11855
|
P.id && P.previewUrl && Vn.set(P.id, P.previewUrl);
|
|
11856
|
-
if ([...It.values()].some((P) => P.revision ===
|
|
11856
|
+
if ([...It.values()].some((P) => P.revision === Wt && P.generation === ct)) return;
|
|
11857
11857
|
const k = {
|
|
11858
11858
|
inputValue: d,
|
|
11859
11859
|
value: m,
|
|
@@ -11861,13 +11861,13 @@ async function Dy(t = {}) {
|
|
|
11861
11861
|
clientMessageId: crypto.randomUUID(),
|
|
11862
11862
|
submittedAt: Math.max(Date.now(), ca + 1)
|
|
11863
11863
|
};
|
|
11864
|
-
if (ca = k.submittedAt, It.set(k.clientMessageId, { ...k, revision:
|
|
11864
|
+
if (ca = k.submittedAt, It.set(k.clientMessageId, { ...k, revision: Wt, generation: ct }), Te(), be = {
|
|
11865
11865
|
clientMessageId: k.clientMessageId,
|
|
11866
11866
|
observedConversation: null,
|
|
11867
11867
|
observedWelcome: null,
|
|
11868
11868
|
pendingSubmission: !0
|
|
11869
11869
|
}, Fi()) {
|
|
11870
|
-
|
|
11870
|
+
Kt = k;
|
|
11871
11871
|
return;
|
|
11872
11872
|
}
|
|
11873
11873
|
Da(k);
|
|
@@ -11881,10 +11881,10 @@ async function Dy(t = {}) {
|
|
|
11881
11881
|
e.onSignupClick?.();
|
|
11882
11882
|
return;
|
|
11883
11883
|
}
|
|
11884
|
-
(e.productVariant === "personal" ? !
|
|
11884
|
+
(e.productVariant === "personal" ? !Qt() : ro() || qn(e.billingStatus)) || (Jt = !0, tt(!0, "send"), ut(), po());
|
|
11885
11885
|
});
|
|
11886
11886
|
let oi = 0;
|
|
11887
|
-
const
|
|
11887
|
+
const Zt = () => {
|
|
11888
11888
|
oi = 0, r.classList.remove("pluno-pa-widget--drag-over");
|
|
11889
11889
|
}, Su = () => {
|
|
11890
11890
|
Mt !== null && (window.clearTimeout(Mt), Mt = null), te.textContent = "", te.hidden = !0;
|
|
@@ -11896,11 +11896,11 @@ async function Dy(t = {}) {
|
|
|
11896
11896
|
d,
|
|
11897
11897
|
e.productVariant === "customer_embedded"
|
|
11898
11898
|
);
|
|
11899
|
-
if (
|
|
11899
|
+
if (Wt++, Qe = [...Qe, ...m], Gn(), Su(), Te(), _e(C.getState()), !r.classList.contains("pluno-pa-widget--open")) {
|
|
11900
11900
|
pt("", !0, !0, !0, "attachment_drop");
|
|
11901
11901
|
return;
|
|
11902
11902
|
}
|
|
11903
|
-
|
|
11903
|
+
Vt("attachment_added");
|
|
11904
11904
|
}, Iu = async (d) => {
|
|
11905
11905
|
await ho(d), !(d.length === 0 || Ot !== null) && dn(R, "attachment_picker_completed");
|
|
11906
11906
|
};
|
|
@@ -11924,15 +11924,15 @@ async function Dy(t = {}) {
|
|
|
11924
11924
|
ns(d.dataTransfer) && (d.stopPropagation(), oi = Math.max(0, oi - 1), oi === 0 && r.classList.remove("pluno-pa-widget--drag-over"));
|
|
11925
11925
|
});
|
|
11926
11926
|
const Na = (d) => {
|
|
11927
|
-
r.classList.contains("pluno-pa-widget--drag-over") && !d.composedPath().includes(r) &&
|
|
11927
|
+
r.classList.contains("pluno-pa-widget--drag-over") && !d.composedPath().includes(r) && Zt();
|
|
11928
11928
|
};
|
|
11929
11929
|
_.addEventListener(
|
|
11930
11930
|
"dragover",
|
|
11931
11931
|
Na,
|
|
11932
11932
|
!0
|
|
11933
|
-
), _.addEventListener("drop",
|
|
11933
|
+
), _.addEventListener("drop", Zt, !0), _.addEventListener("dragend", Zt, !0), _.defaultView?.addEventListener("blur", Zt), r.addEventListener("drop", (d) => {
|
|
11934
11934
|
const m = d.dataTransfer;
|
|
11935
|
-
!e.attachmentsEnabled || !ns(m) || e.loginRequired || wn() || (d.preventDefault(), d.stopPropagation(),
|
|
11935
|
+
!e.attachmentsEnabled || !ns(m) || e.loginRequired || wn() || (d.preventDefault(), d.stopPropagation(), Zt(), ho(m.files).catch((S) => {
|
|
11936
11936
|
ji(
|
|
11937
11937
|
S instanceof Error ? S.message : "Failed to attach file"
|
|
11938
11938
|
), Ye("web-sdk.widget", "Attachment failed", {
|
|
@@ -11958,30 +11958,30 @@ async function Dy(t = {}) {
|
|
|
11958
11958
|
if (d.disabled)
|
|
11959
11959
|
return;
|
|
11960
11960
|
if (d.action === "stop") {
|
|
11961
|
-
It.clear(),
|
|
11961
|
+
It.clear(), Kt = null, be = null, C.stop(), Te();
|
|
11962
11962
|
return;
|
|
11963
11963
|
}
|
|
11964
11964
|
const m = R.value.trim().length > 0 || Qe.length > 0;
|
|
11965
|
-
|
|
11965
|
+
Jt = !0, tt(!0, "send"), ut(), po(), _e(C.getState()), Te(), m && Vt("send_button_submit");
|
|
11966
11966
|
}), ie.addEventListener("click", () => {
|
|
11967
|
-
$e = !$e, Lt(), $e && et.data === null && et.status !== "loading" && wa(), $e ||
|
|
11967
|
+
$e = !$e, Lt(), $e && et.data === null && et.status !== "loading" && wa(), $e || Vt("history_closed");
|
|
11968
11968
|
}), ae.addEventListener("click", () => {
|
|
11969
|
-
$e = !1, Lt(),
|
|
11969
|
+
$e = !1, Lt(), Vt("history_closed");
|
|
11970
11970
|
}), O.addEventListener("scroll", gu), R.addEventListener("input", () => {
|
|
11971
|
-
|
|
11971
|
+
Wt++, R.value.trim() && Ea("composer_input"), mi(R), Ke(), Te(), Wa();
|
|
11972
11972
|
}), R.addEventListener("keydown", (d) => {
|
|
11973
|
-
if (!(d.key !== "Enter" || d.shiftKey)) {
|
|
11973
|
+
if (!(d.key !== "Enter" || d.shiftKey || d.isComposing || d.keyCode === 229)) {
|
|
11974
11974
|
if (d.preventDefault(), e.loginRequired) {
|
|
11975
11975
|
e.onLoginClick?.();
|
|
11976
11976
|
return;
|
|
11977
11977
|
}
|
|
11978
|
-
(e.productVariant === "personal" ? !
|
|
11978
|
+
(e.productVariant === "personal" ? !Qt() : ro()) || (Jt = !0, tt(!0, "send"), ut(), po(), _e(C.getState()), Te());
|
|
11979
11979
|
}
|
|
11980
11980
|
}), r.addEventListener("click", (d) => {
|
|
11981
11981
|
const m = d.target instanceof Element ? d.target : null;
|
|
11982
11982
|
m?.closest("a[href]") && Ke(), $e && $m(m, re, ie) && ($e = !1, Lt());
|
|
11983
11983
|
const k = window.getSelection(), P = !!(k && !k.isCollapsed && k.anchorNode && r.contains(k.anchorNode));
|
|
11984
|
-
Bm(d.target, d.detail, P) &&
|
|
11984
|
+
Bm(d.target, d.detail, P) && Vt("passive_surface_click");
|
|
11985
11985
|
});
|
|
11986
11986
|
let Ua = !1;
|
|
11987
11987
|
const Ba = (d) => {
|
|
@@ -12032,7 +12032,7 @@ async function Dy(t = {}) {
|
|
|
12032
12032
|
Zd(d), d.stopPropagation();
|
|
12033
12033
|
return;
|
|
12034
12034
|
}
|
|
12035
|
-
d.key !== "Escape" || !$e || ($e = !1, Lt(),
|
|
12035
|
+
d.key !== "Escape" || !$e || ($e = !1, Lt(), Vt("history_escape"));
|
|
12036
12036
|
}), u.composerValue && (R.value = u.composerValue, mi(R)), e.layout === "page" ? pt(R.value, !1, !0, !1, "external_request") : p === "minimized" ? Qn("minimized", !1) : e.initialDisplayState === void 0 && u.isOpen && pt(R.value, !1, !1, !1, "restored_state");
|
|
12037
12037
|
const ri = () => l;
|
|
12038
12038
|
let go = C.getState().appearance !== null, Hi = null, ai = null, Et = C.getInteractions();
|
|
@@ -12107,7 +12107,7 @@ async function Dy(t = {}) {
|
|
|
12107
12107
|
const m = le("personal_channel_connection");
|
|
12108
12108
|
m?.payload.request.requestId === d.requestId && await De(m, "connect");
|
|
12109
12109
|
}, li = (d = {}) => {
|
|
12110
|
-
ct++, It.clear(), la(),
|
|
12110
|
+
ct++, It.clear(), la(), Kt = null, be = null, Yn = !1, qi.clear(), Jt = !0, tt(!0, "newSession"), ut(), $e = !1, Lt();
|
|
12111
12111
|
const m = Promise.resolve(C.startNewSession(d));
|
|
12112
12112
|
return ti = null, Ws.clear(), Ki.clear(), R.value = "", Qe = [], Gn(), mi(R), Ke(), Te(), dn(R, "new_chat"), _e(C.getState()), m;
|
|
12113
12113
|
}, Ka = (d) => {
|
|
@@ -12121,19 +12121,19 @@ async function Dy(t = {}) {
|
|
|
12121
12121
|
);
|
|
12122
12122
|
B?.addEventListener("click", async () => {
|
|
12123
12123
|
const d = e.proactiveSuggestion;
|
|
12124
|
-
if (!d || (e.productVariant === "personal" ? !
|
|
12124
|
+
if (!d || (e.productVariant === "personal" ? !Qt() : oo()))
|
|
12125
12125
|
return;
|
|
12126
|
-
|
|
12126
|
+
Ht = null, cn = !1, An = null, e.proactiveSuggestion = null;
|
|
12127
12127
|
const m = Va();
|
|
12128
12128
|
await li(), pt("", !0, !1, !0, "proactive_suggestion"), Ka(m), C.sendMessage("Yes", {
|
|
12129
12129
|
proactiveSuggestionQuestion: d.question
|
|
12130
12130
|
});
|
|
12131
12131
|
});
|
|
12132
12132
|
const Ga = () => {
|
|
12133
|
-
if (!(e.proactiveSuggestion ??
|
|
12133
|
+
if (!(e.proactiveSuggestion ?? Ht))
|
|
12134
12134
|
return;
|
|
12135
12135
|
const m = e.proactiveSuggestion !== null;
|
|
12136
|
-
if (e.proactiveSuggestion = null,
|
|
12136
|
+
if (e.proactiveSuggestion = null, Ht = null, cn = !1, An = null, We = "idle", St && (St.value = ""), m) {
|
|
12137
12137
|
const S = le("proactive_suggestion");
|
|
12138
12138
|
S && De(S, "dismiss").catch(() => {
|
|
12139
12139
|
});
|
|
@@ -12144,7 +12144,7 @@ async function Dy(t = {}) {
|
|
|
12144
12144
|
const d = e.proactiveSuggestion;
|
|
12145
12145
|
if (!d)
|
|
12146
12146
|
return;
|
|
12147
|
-
|
|
12147
|
+
Ht = null, cn = !0, An = d, e.proactiveSuggestion = null;
|
|
12148
12148
|
const m = Va();
|
|
12149
12149
|
await li(), C.stageProactiveSuggestionQuestion(d.question);
|
|
12150
12150
|
const S = le("proactive_suggestion");
|
|
@@ -12156,14 +12156,14 @@ async function Dy(t = {}) {
|
|
|
12156
12156
|
const d = e.proactiveSuggestion;
|
|
12157
12157
|
if (!d)
|
|
12158
12158
|
return;
|
|
12159
|
-
|
|
12159
|
+
Ht = d, cn = !1, An = null, We = "idle", St && (St.value = ""), e.proactiveSuggestion = null;
|
|
12160
12160
|
const m = le("proactive_suggestion");
|
|
12161
12161
|
m && De(m, "never").catch(() => {
|
|
12162
12162
|
}), lt(), window.requestAnimationFrame(() => St?.focus());
|
|
12163
12163
|
}), St?.addEventListener("input", () => {
|
|
12164
12164
|
We === "error" && (We = "idle"), lt();
|
|
12165
12165
|
}), Kn?.addEventListener("click", async () => {
|
|
12166
|
-
const d =
|
|
12166
|
+
const d = Ht, m = St?.value.trim() ?? "";
|
|
12167
12167
|
if (!(!d || !m || We === "submitting")) {
|
|
12168
12168
|
We = "submitting", lt();
|
|
12169
12169
|
try {
|
|
@@ -12193,16 +12193,16 @@ async function Dy(t = {}) {
|
|
|
12193
12193
|
Nt.className = "pluno-pa-widget__error";
|
|
12194
12194
|
const bo = document.createTextNode("");
|
|
12195
12195
|
Nt.appendChild(bo);
|
|
12196
|
-
const
|
|
12197
|
-
|
|
12196
|
+
const en = document.createElement("a");
|
|
12197
|
+
en.className = "pluno-pa-widget__error-retry", en.target = "_blank", en.rel = "noreferrer", en.textContent = "Security settings";
|
|
12198
12198
|
const ht = document.createElement("button");
|
|
12199
12199
|
ht.type = "button", ht.className = "pluno-pa-widget__error-retry";
|
|
12200
12200
|
const Ja = $n(), Ya = document.createTextNode("Try again");
|
|
12201
12201
|
ht.append(Ja, Ya);
|
|
12202
|
-
let Xa = "",
|
|
12202
|
+
let Xa = "", tn = !1;
|
|
12203
12203
|
const Cu = async () => {
|
|
12204
|
-
if (
|
|
12205
|
-
|
|
12204
|
+
if (tn) return;
|
|
12205
|
+
tn = !0, _e(C.getState());
|
|
12206
12206
|
let d;
|
|
12207
12207
|
try {
|
|
12208
12208
|
await Promise.race([
|
|
@@ -12212,7 +12212,7 @@ async function Dy(t = {}) {
|
|
|
12212
12212
|
})
|
|
12213
12213
|
]);
|
|
12214
12214
|
} finally {
|
|
12215
|
-
clearTimeout(d),
|
|
12215
|
+
clearTimeout(d), tn = !1, qe || _e(C.getState());
|
|
12216
12216
|
}
|
|
12217
12217
|
};
|
|
12218
12218
|
ht.addEventListener("click", () => {
|
|
@@ -12230,18 +12230,18 @@ async function Dy(t = {}) {
|
|
|
12230
12230
|
...Object.getOwnPropertyDescriptors(z),
|
|
12231
12231
|
attachments: { value: ft, enumerable: !0, configurable: !0 }
|
|
12232
12232
|
});
|
|
12233
|
-
}) }, Tn(),
|
|
12233
|
+
}) }, Tn(), Gt !== null && (window.clearTimeout(Gt), Gt = null), Lt(), lt(), Bs(), D.hidden = !e.loginRequired && !e.signupRequired, D.hidden && D.replaceChildren();
|
|
12234
12234
|
const S = JSON.stringify([
|
|
12235
12235
|
!!(e.loginRequired || e.signupRequired),
|
|
12236
12236
|
d.lastError,
|
|
12237
12237
|
d.lastErrorCode,
|
|
12238
12238
|
d.lastErrorSecuritySettingsUrl,
|
|
12239
|
-
|
|
12239
|
+
tn
|
|
12240
12240
|
]);
|
|
12241
12241
|
if (Xa !== S) {
|
|
12242
12242
|
Xa = S, V.hidden = !!(e.loginRequired || e.signupRequired) || !d.lastError || Si(d.lastErrorCode) !== "bottom_notice";
|
|
12243
12243
|
const z = V.hidden ? "" : d.lastError ?? "";
|
|
12244
|
-
bo.data !== z && (bo.data = z), V.hidden ? Nt.remove() : Nt.parentElement !== V && V.appendChild(Nt), d.lastErrorSecuritySettingsUrl ? (
|
|
12244
|
+
bo.data !== z && (bo.data = z), V.hidden ? Nt.remove() : Nt.parentElement !== V && V.appendChild(Nt), d.lastErrorSecuritySettingsUrl ? (en.href = d.lastErrorSecuritySettingsUrl, en.parentElement !== Nt && Nt.insertBefore(en, ht.parentElement ? ht : null)) : en.remove(), d.lastErrorCode === "connection_failed" || d.lastErrorCode === "auth_reconnecting" ? (ht.disabled = tn, ht.setAttribute("aria-busy", String(tn)), Ja.hidden = !tn, Ya.data = tn ? "Retrying" : "Try again", ht.parentElement !== Nt && Nt.appendChild(ht)) : ht.remove();
|
|
12245
12245
|
}
|
|
12246
12246
|
if (e.loginRequired) {
|
|
12247
12247
|
Li = "", Wi.clear(), yo.clear(), wo.clear(), A.replaceChildren();
|
|
@@ -12305,8 +12305,8 @@ async function Dy(t = {}) {
|
|
|
12305
12305
|
Fi()
|
|
12306
12306
|
]), P = k !== Li;
|
|
12307
12307
|
Li = k;
|
|
12308
|
-
const ne =
|
|
12309
|
-
|
|
12308
|
+
const ne = Jt || qt.enabled;
|
|
12309
|
+
Jt = !1, (P || m.skipUnchangedTimeline !== !0) && Dw(
|
|
12310
12310
|
A,
|
|
12311
12311
|
j,
|
|
12312
12312
|
xe,
|
|
@@ -12324,10 +12324,10 @@ async function Dy(t = {}) {
|
|
|
12324
12324
|
Ke,
|
|
12325
12325
|
ri,
|
|
12326
12326
|
(z) => {
|
|
12327
|
-
(e.productVariant === "personal" ? !
|
|
12327
|
+
(e.productVariant === "personal" ? !Qt() : oo()) || (Jt = !0, tt(!0, "send"), ut(), C.sendMessage(z));
|
|
12328
12328
|
},
|
|
12329
12329
|
() => {
|
|
12330
|
-
|
|
12330
|
+
Jt = !0, tt(!0, "send"), ut(), C.retryLastMessage();
|
|
12331
12331
|
},
|
|
12332
12332
|
e.morningReport,
|
|
12333
12333
|
() => {
|
|
@@ -12393,12 +12393,12 @@ async function Dy(t = {}) {
|
|
|
12393
12393
|
);
|
|
12394
12394
|
be && !be.observedWelcome && !Ae && hc(d) && (be.observedConversation = nl(A, d)), ya(), Te(), lt();
|
|
12395
12395
|
const ye = Array.isArray(d.activeScheduledFollowUps) ? d.activeScheduledFollowUps : null, gt = (ye !== null ? ye.map((z) => z.dueAt) : d.messages.map((z) => z.scheduledCheckInAt)).filter((z) => !!z).filter((z) => jn(z) !== null).sort((z, ft) => Date.parse(z) - Date.parse(ft))[0] ?? null, Oe = gt ? yg(gt) : null;
|
|
12396
|
-
Oe !== null && (
|
|
12396
|
+
Oe !== null && (Gt = window.setTimeout(
|
|
12397
12397
|
() => {
|
|
12398
|
-
|
|
12398
|
+
Gt = null, qe || _e(C.getState());
|
|
12399
12399
|
},
|
|
12400
12400
|
Math.min(Oe, 2147483647)
|
|
12401
|
-
)), ne ? (
|
|
12401
|
+
)), ne ? (Yt = A.scrollTop, ut()) : P && hc(d) && pu();
|
|
12402
12402
|
}, Qa = () => {
|
|
12403
12403
|
_.getSelection()?.isCollapsed !== !1 && $w(Wi) && _e(C.getState());
|
|
12404
12404
|
};
|
|
@@ -12438,7 +12438,7 @@ async function Dy(t = {}) {
|
|
|
12438
12438
|
const ye = C.getModel(), gt = Pm(ye) ? ye : vs[0].value;
|
|
12439
12439
|
gt !== xt && (xt = gt, Tn());
|
|
12440
12440
|
}
|
|
12441
|
-
Za(d), d.status === "connected" && (so = !0,
|
|
12441
|
+
Za(d), d.status === "connected" && (so = !0, Kt && queueMicrotask(() => {
|
|
12442
12442
|
Oa();
|
|
12443
12443
|
})), ja();
|
|
12444
12444
|
const S = fo && !d.isThinking, k = ga !== location.origin || fa !== d.sessionId || ma !== (d.user?.id ?? null), P = fo !== d.isThinking, ne = Vs !== "connected" && d.status === "connected", Ae = Vs === "connected" && d.status !== "connected";
|
|
@@ -12515,10 +12515,10 @@ async function Dy(t = {}) {
|
|
|
12515
12515
|
"dragover",
|
|
12516
12516
|
Na,
|
|
12517
12517
|
!0
|
|
12518
|
-
), _.removeEventListener("drop",
|
|
12518
|
+
), _.removeEventListener("drop", Zt, !0), _.removeEventListener("dragend", Zt, !0), _.defaultView?.removeEventListener(
|
|
12519
12519
|
"blur",
|
|
12520
|
-
|
|
12521
|
-
), window.removeEventListener("resize", va), Sa(), yu(), wu(), Mt !== null && window.clearTimeout(Mt), Ze !== null && (window.clearTimeout(Ze), Ze = null), uu(), un !== null && (window.clearTimeout(un), un = null),
|
|
12520
|
+
Zt
|
|
12521
|
+
), window.removeEventListener("resize", va), Sa(), yu(), wu(), Mt !== null && window.clearTimeout(Mt), Ze !== null && (window.clearTimeout(Ze), Ze = null), uu(), un !== null && (window.clearTimeout(un), un = null), Gt !== null && (window.clearTimeout(Gt), Gt = null), Pi?.clear(), ua && C.destroy(), $s?.release(), o.remove());
|
|
12522
12522
|
}
|
|
12523
12523
|
};
|
|
12524
12524
|
async function qu(d) {
|
|
@@ -13017,7 +13017,7 @@ function _i(t, e) {
|
|
|
13017
13017
|
)
|
|
13018
13018
|
};
|
|
13019
13019
|
}
|
|
13020
|
-
function
|
|
13020
|
+
function sn(t, e) {
|
|
13021
13021
|
if (t.classList.toggle("pluno-pa-widget--custom-position", e !== null), t.classList.toggle(
|
|
13022
13022
|
"pluno-pa-widget--proactive-suggestion-left-aligned",
|
|
13023
13023
|
e !== null && e.x < Ge().width / 2
|
|
@@ -13249,21 +13249,21 @@ function sw(t, e) {
|
|
|
13249
13249
|
)
|
|
13250
13250
|
), s.appendChild(g), s.appendChild(cw()), n.appendChild(s);
|
|
13251
13251
|
const y = document.createElement("div");
|
|
13252
|
-
return y.className = "pluno-pa-widget__proactive-suggestion-slot", n.appendChild(y), n.appendChild(lw()), n.appendChild(
|
|
13253
|
-
|
|
13254
|
-
), n.appendChild(
|
|
13255
|
-
|
|
13252
|
+
return y.className = "pluno-pa-widget__proactive-suggestion-slot", n.appendChild(y), n.appendChild(lw()), n.appendChild(on("left", "Resize Pluno from left")), n.appendChild(
|
|
13253
|
+
on("right", "Resize Pluno from right")
|
|
13254
|
+
), n.appendChild(on("top", "Resize Pluno from top")), n.appendChild(
|
|
13255
|
+
on("bottom", "Resize Pluno from bottom")
|
|
13256
13256
|
), n.appendChild(
|
|
13257
|
-
|
|
13257
|
+
on("top-left", "Resize Pluno from top left")
|
|
13258
13258
|
), n.appendChild(
|
|
13259
|
-
|
|
13259
|
+
on("top-right", "Resize Pluno from top right")
|
|
13260
13260
|
), n.appendChild(
|
|
13261
|
-
|
|
13261
|
+
on("bottom-left", "Resize Pluno from bottom left")
|
|
13262
13262
|
), n.appendChild(
|
|
13263
|
-
|
|
13263
|
+
on("bottom-right", "Resize Pluno from bottom right")
|
|
13264
13264
|
), n;
|
|
13265
13265
|
}
|
|
13266
|
-
function
|
|
13266
|
+
function on(t, e) {
|
|
13267
13267
|
const n = document.createElement("button");
|
|
13268
13268
|
return n.type = "button", n.className = [
|
|
13269
13269
|
"pluno-pa-widget__resize-handle",
|
|
@@ -14811,11 +14811,12 @@ function Bw(t, e) {
|
|
|
14811
14811
|
});
|
|
14812
14812
|
}
|
|
14813
14813
|
function zw(t) {
|
|
14814
|
-
const
|
|
14815
|
-
if (!
|
|
14814
|
+
const n = t.getRootNode().getSelection?.() ?? t.ownerDocument.getSelection();
|
|
14815
|
+
if (!n || n.isCollapsed)
|
|
14816
14816
|
return !1;
|
|
14817
|
-
|
|
14818
|
-
|
|
14817
|
+
if (t.contains(n.anchorNode) || t.contains(n.focusNode)) return !0;
|
|
14818
|
+
for (let i = 0; i < n.rangeCount; i += 1)
|
|
14819
|
+
if (n.getRangeAt(i).intersectsNode(t))
|
|
14819
14820
|
return !0;
|
|
14820
14821
|
return !1;
|
|
14821
14822
|
}
|
|
@@ -14837,17 +14838,20 @@ function Hw(t, e) {
|
|
|
14837
14838
|
e.has(n) || t.delete(n);
|
|
14838
14839
|
}
|
|
14839
14840
|
function At(t, e) {
|
|
14840
|
-
|
|
14841
|
-
for (const
|
|
14842
|
-
|
|
14843
|
-
|
|
14841
|
+
const n = new Set(e);
|
|
14842
|
+
for (const s of Array.from(t.childNodes))
|
|
14843
|
+
n.has(s) || t.removeChild(s);
|
|
14844
|
+
let i = t.firstChild;
|
|
14845
|
+
for (const s of e) {
|
|
14846
|
+
if (s === i) {
|
|
14847
|
+
i = i.nextSibling;
|
|
14844
14848
|
continue;
|
|
14845
14849
|
}
|
|
14846
|
-
t.insertBefore(
|
|
14850
|
+
t.insertBefore(s, i);
|
|
14847
14851
|
}
|
|
14848
|
-
for (;
|
|
14849
|
-
const
|
|
14850
|
-
|
|
14852
|
+
for (; i; ) {
|
|
14853
|
+
const s = i;
|
|
14854
|
+
i = i.nextSibling, t.removeChild(s);
|
|
14851
14855
|
}
|
|
14852
14856
|
}
|
|
14853
14857
|
function Ww(t) {
|
|
@@ -15265,7 +15269,7 @@ function ob(t, e) {
|
|
|
15265
15269
|
const a = document.createElement("table"), r = document.createElement("thead"), l = document.createElement("tr");
|
|
15266
15270
|
n.forEach((c, h) => {
|
|
15267
15271
|
const g = document.createElement("th"), y = s[h];
|
|
15268
|
-
y && g.classList.add(`pluno-pa-widget__table-cell--${y}`),
|
|
15272
|
+
y && g.classList.add(`pluno-pa-widget__table-cell--${y}`), rn(g, c), l.appendChild(g);
|
|
15269
15273
|
}), r.appendChild(l), a.appendChild(r);
|
|
15270
15274
|
const u = document.createElement("tbody");
|
|
15271
15275
|
let p = e + 2;
|
|
@@ -15276,7 +15280,7 @@ function ob(t, e) {
|
|
|
15276
15280
|
const h = document.createElement("tr");
|
|
15277
15281
|
n.forEach((g, y) => {
|
|
15278
15282
|
const f = document.createElement("td"), w = s[y];
|
|
15279
|
-
w && f.classList.add(`pluno-pa-widget__table-cell--${w}`),
|
|
15283
|
+
w && f.classList.add(`pluno-pa-widget__table-cell--${w}`), rn(f, c[y] ?? ""), h.appendChild(f);
|
|
15280
15284
|
}), u.appendChild(h), p += 1;
|
|
15281
15285
|
}
|
|
15282
15286
|
return a.appendChild(u), o.appendChild(a), { element: o, nextIndex: p };
|
|
@@ -15310,14 +15314,14 @@ function oa(t, e) {
|
|
|
15310
15314
|
const r = s.match(/^(#{1,6})\s+(.+)$/);
|
|
15311
15315
|
if (r) {
|
|
15312
15316
|
const c = document.createElement(`h${r[1].length}`);
|
|
15313
|
-
|
|
15317
|
+
rn(c, r[2]), t.appendChild(c), i += 1;
|
|
15314
15318
|
continue;
|
|
15315
15319
|
}
|
|
15316
15320
|
if (/^\s*[-*+]\s+/.test(s)) {
|
|
15317
15321
|
const c = document.createElement("ul");
|
|
15318
15322
|
for (; i < n.length && /^\s*[-*+]\s+/.test(n[i]); ) {
|
|
15319
15323
|
const h = document.createElement("li");
|
|
15320
|
-
|
|
15324
|
+
rn(h, n[i].replace(/^\s*[-*+]\s+/, "")), c.appendChild(h), i += 1;
|
|
15321
15325
|
}
|
|
15322
15326
|
t.appendChild(c);
|
|
15323
15327
|
continue;
|
|
@@ -15327,7 +15331,7 @@ function oa(t, e) {
|
|
|
15327
15331
|
const c = document.createElement("ol");
|
|
15328
15332
|
for (c.start = Number(l[1]); i < n.length && /^\s*\d+\.\s+/.test(n[i]); ) {
|
|
15329
15333
|
const h = document.createElement("li");
|
|
15330
|
-
|
|
15334
|
+
rn(h, n[i].replace(/^\s*\d+\.\s+/, "")), c.appendChild(h), i += 1;
|
|
15331
15335
|
}
|
|
15332
15336
|
t.appendChild(c);
|
|
15333
15337
|
continue;
|
|
@@ -15337,11 +15341,11 @@ function oa(t, e) {
|
|
|
15337
15341
|
u.push(n[i]), i += 1;
|
|
15338
15342
|
const p = document.createElement("p");
|
|
15339
15343
|
u.forEach((c, h) => {
|
|
15340
|
-
h > 0 && p.appendChild(document.createElement("br")),
|
|
15344
|
+
h > 0 && p.appendChild(document.createElement("br")), rn(p, c);
|
|
15341
15345
|
}), t.appendChild(p);
|
|
15342
15346
|
}
|
|
15343
15347
|
}
|
|
15344
|
-
function
|
|
15348
|
+
function rn(t, e) {
|
|
15345
15349
|
const n = /(`[^`]+`|\*\*[^*]+\*\*|\*[^*]+\*|\[[^\]]+\]\(([^)\s]+)\))/g;
|
|
15346
15350
|
let i = 0;
|
|
15347
15351
|
for (const s of e.matchAll(n)) {
|
|
@@ -15355,10 +15359,10 @@ function an(t, e) {
|
|
|
15355
15359
|
r.textContent = a.slice(1, -1), t.appendChild(r);
|
|
15356
15360
|
} else if (a.startsWith("**")) {
|
|
15357
15361
|
const r = document.createElement("strong");
|
|
15358
|
-
|
|
15362
|
+
rn(r, a.slice(2, -2)), t.appendChild(r);
|
|
15359
15363
|
} else if (a.startsWith("*")) {
|
|
15360
15364
|
const r = document.createElement("em");
|
|
15361
|
-
|
|
15365
|
+
rn(r, a.slice(1, -1)), t.appendChild(r);
|
|
15362
15366
|
} else {
|
|
15363
15367
|
const r = a.match(/^\[([^\]]+)\]\(([^)\s]+)\)$/);
|
|
15364
15368
|
if (r && rb(r[2])) {
|