@pluno/product-agent-web 0.1.116 → 0.1.117
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-widget.js +302 -295
- package/dist/widget.d.ts +2 -0
- package/package.json +1 -1
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { PlunoProductAgent as Si, getProductAgentOriginAccessErrorMessage as Ci } from "./product-agent-sdk.js";
|
|
2
|
-
const Ei = "#7c3aed", kt = "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", Lt = "#2c2a1e",
|
|
2
|
+
const Ei = "#7c3aed", kt = "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", Lt = "#2c2a1e", $n = [253, 250, 241], qn = 3.5;
|
|
3
3
|
function Lo(e) {
|
|
4
4
|
const t = To(e);
|
|
5
|
-
if (
|
|
5
|
+
if (jn(st(t), $n) >= qn)
|
|
6
6
|
return t;
|
|
7
7
|
let i = st(t);
|
|
8
8
|
const o = st(Lt);
|
|
9
9
|
for (let r = 0; r < 6; r += 1)
|
|
10
|
-
if (i = Ti(i, o, 0.22),
|
|
10
|
+
if (i = Ti(i, o, 0.22), jn(i, $n) >= qn)
|
|
11
11
|
return dn(i);
|
|
12
12
|
return dn(i);
|
|
13
13
|
}
|
|
14
14
|
function ki() {
|
|
15
15
|
let n = "M 280 120", i = !1, o = 0;
|
|
16
16
|
for (let r = 150; r <= 1170; r += 62) {
|
|
17
|
-
const l = (o % 3 - 1) * 18,
|
|
18
|
-
n += ` L ${
|
|
17
|
+
const l = (o % 3 - 1) * 18, p = i ? 280 - l : 1020 + l;
|
|
18
|
+
n += ` L ${p} ${r}`, i = !i, o += 1;
|
|
19
19
|
}
|
|
20
20
|
return n;
|
|
21
21
|
}
|
|
@@ -78,7 +78,7 @@ function cn([e, t, n]) {
|
|
|
78
78
|
};
|
|
79
79
|
return 0.2126 * i(e) + 0.7152 * i(t) + 0.0722 * i(n);
|
|
80
80
|
}
|
|
81
|
-
function
|
|
81
|
+
function jn(e, t) {
|
|
82
82
|
const n = cn(e), i = cn(t), [o, r] = n > i ? [n, i] : [i, n];
|
|
83
83
|
return (o + 0.05) / (r + 0.05);
|
|
84
84
|
}
|
|
@@ -95,11 +95,11 @@ function pe(e, t, n) {
|
|
|
95
95
|
return dn(Ii(i, un(o + n), un(r + t)));
|
|
96
96
|
}
|
|
97
97
|
function Ai([e, t, n]) {
|
|
98
|
-
const i = e / 255, o = t / 255, r = n / 255, l = Math.max(i, o, r),
|
|
99
|
-
if (l ===
|
|
100
|
-
return [0, 0,
|
|
101
|
-
const c = l -
|
|
102
|
-
return [(l === i ? (o - r) / c + (o < r ? 6 : 0) : l === o ? (r - i) / c + 2 : (i - o) / c + 4) / 6, g,
|
|
98
|
+
const i = e / 255, o = t / 255, r = n / 255, l = Math.max(i, o, r), p = Math.min(i, o, r), s = (l + p) / 2;
|
|
99
|
+
if (l === p)
|
|
100
|
+
return [0, 0, s];
|
|
101
|
+
const c = l - p, g = s > 0.5 ? c / (2 - l - p) : c / (l + p);
|
|
102
|
+
return [(l === i ? (o - r) / c + (o < r ? 6 : 0) : l === o ? (r - i) / c + 2 : (i - o) / c + 4) / 6, g, s];
|
|
103
103
|
}
|
|
104
104
|
function Ii(e, t, n) {
|
|
105
105
|
if (t === 0)
|
|
@@ -124,10 +124,10 @@ function Pi(e) {
|
|
|
124
124
|
const n = e[t];
|
|
125
125
|
if (n.role !== "tool" || n.toolName !== Ao)
|
|
126
126
|
continue;
|
|
127
|
-
const i =
|
|
127
|
+
const i = Kn(e, t, "assistant");
|
|
128
128
|
if (!i)
|
|
129
129
|
return null;
|
|
130
|
-
const o =
|
|
130
|
+
const o = Kn(e, i.index, "user");
|
|
131
131
|
return o ? {
|
|
132
132
|
id: `share:${n.callId ?? n.id}`,
|
|
133
133
|
userPrompt: o.content,
|
|
@@ -142,7 +142,7 @@ function Ni(e) {
|
|
|
142
142
|
t ^= n.charCodeAt(0), t = Math.imul(t, 16777619);
|
|
143
143
|
return (t >>> 0) % 2 === 0 ? "referral" : "social";
|
|
144
144
|
}
|
|
145
|
-
function
|
|
145
|
+
function Kn(e, t, n) {
|
|
146
146
|
for (let i = t - 1; i >= 0; i -= 1) {
|
|
147
147
|
const o = e[i];
|
|
148
148
|
if (o.role === n && o.content.trim())
|
|
@@ -155,11 +155,11 @@ function Fi(e, t = {}) {
|
|
|
155
155
|
let n = !1, i = null, o = null, r = null;
|
|
156
156
|
const l = () => {
|
|
157
157
|
r !== null && (window.clearInterval(r), r = null);
|
|
158
|
-
},
|
|
158
|
+
}, p = (g) => {
|
|
159
159
|
n || (o !== null && window.clearTimeout(o), o = window.setTimeout(() => {
|
|
160
160
|
c();
|
|
161
161
|
}, Gi(g)));
|
|
162
|
-
},
|
|
162
|
+
}, s = (g) => {
|
|
163
163
|
if (l(), i === null) {
|
|
164
164
|
i = g, e(g);
|
|
165
165
|
return;
|
|
@@ -178,9 +178,9 @@ function Fi(e, t = {}) {
|
|
|
178
178
|
const g = await Wi(t);
|
|
179
179
|
if (n)
|
|
180
180
|
return;
|
|
181
|
-
|
|
181
|
+
s(g.count), p(g.refreshAfterMs);
|
|
182
182
|
} catch {
|
|
183
|
-
|
|
183
|
+
p(Di);
|
|
184
184
|
}
|
|
185
185
|
};
|
|
186
186
|
return c(), () => {
|
|
@@ -196,12 +196,12 @@ async function Wi(e) {
|
|
|
196
196
|
});
|
|
197
197
|
if (!n.ok)
|
|
198
198
|
throw new Error("Failed to load active users");
|
|
199
|
-
const i = await n.json(), o =
|
|
199
|
+
const i = await n.json(), o = Vn(i.count), r = Vn(i.refreshAfterMs ?? i.refresh_after_ms);
|
|
200
200
|
if (o === null || r === null)
|
|
201
201
|
throw new Error("Invalid active users response");
|
|
202
202
|
return { count: o, refreshAfterMs: r };
|
|
203
203
|
}
|
|
204
|
-
function
|
|
204
|
+
function Vn(e) {
|
|
205
205
|
return typeof e != "number" || !Number.isFinite(e) || e < 0 ? null : Math.round(e);
|
|
206
206
|
}
|
|
207
207
|
function Hi(e) {
|
|
@@ -268,7 +268,7 @@ function Zi(e) {
|
|
|
268
268
|
}
|
|
269
269
|
const r = o.match(/^[ \t]{0,3}(`{3,}|~{3,})/);
|
|
270
270
|
if (r) {
|
|
271
|
-
t +=
|
|
271
|
+
t += Yn(n) + o, n = "", i = {
|
|
272
272
|
marker: r[1][0],
|
|
273
273
|
length: r[1].length
|
|
274
274
|
};
|
|
@@ -276,19 +276,19 @@ function Zi(e) {
|
|
|
276
276
|
}
|
|
277
277
|
n += o;
|
|
278
278
|
}
|
|
279
|
-
return t +
|
|
279
|
+
return t + Yn(n);
|
|
280
280
|
}
|
|
281
|
-
function
|
|
281
|
+
function Yn(e) {
|
|
282
282
|
let t = "", n = 0;
|
|
283
283
|
for (const i of e.matchAll(Xi)) {
|
|
284
284
|
const o = i.index ?? 0;
|
|
285
|
-
t +=
|
|
285
|
+
t += Xn(
|
|
286
286
|
e.slice(n, o)
|
|
287
287
|
), t += i[0], n = o + i[0].length;
|
|
288
288
|
}
|
|
289
|
-
return t +
|
|
289
|
+
return t + Xn(e.slice(n));
|
|
290
290
|
}
|
|
291
|
-
function
|
|
291
|
+
function Xn(e) {
|
|
292
292
|
return e.replace(
|
|
293
293
|
/\[([^\]\n]*\S[^\]\n]*)\][ \t]+\(([^)\s]+)\)/g,
|
|
294
294
|
(t, n, i, o, r) => r[o - 1] === "!" || Ji(r, o) || Qi(r, o, n) ? t : `[${n}](${i})`
|
|
@@ -309,7 +309,7 @@ function Qi(e, t, n) {
|
|
|
309
309
|
e.slice(i, t)
|
|
310
310
|
);
|
|
311
311
|
}
|
|
312
|
-
const Io = 100, ea = 1e4, ta = 5e3, na = "product-agent:sdk-preview-socket-connect", oa = "product-agent:sdk-preview-socket-send", ia = "product-agent:sdk-preview-socket-close", aa = "product-agent:sdk-preview-socket-open", ra = "product-agent:sdk-preview-socket-message", la = "product-agent:sdk-preview-socket-error", pa = "product-agent:sdk-preview-socket-closed",
|
|
312
|
+
const Io = 100, ea = 1e4, ta = 5e3, na = "product-agent:sdk-preview-socket-connect", oa = "product-agent:sdk-preview-socket-send", ia = "product-agent:sdk-preview-socket-close", aa = "product-agent:sdk-preview-socket-open", ra = "product-agent:sdk-preview-socket-message", la = "product-agent:sdk-preview-socket-error", pa = "product-agent:sdk-preview-socket-closed", Zn = "product-agent:sdk-preview-socket-id", sa = "data-pluno-sdk-preview-channel", Po = "data-pluno-auto-mounted", be = "__plunoProductAgentAutoMountOwner", da = 1e4, ca = "Failed to load Pluno widget token", Jn = "Timed out loading Pluno widget token", ua = "pluno.productAgent.widgetClientId.", Jt = /* @__PURE__ */ new Set(), ga = "product-agent:preview-diagnostic", No = "pluno.productAgent.sharePromptsDisabled", ha = 3, Qn = 'dialog[open], [aria-modal="true"], [role="dialog"]', ma = 400, fa = 5e3, wa = 500, eo = "Close the page's popup to chat", ba = "No recent chats for this page yet.", _e = {
|
|
313
313
|
launcherLabel: "Ask for anything...",
|
|
314
314
|
accentColor: "#7c3aed",
|
|
315
315
|
colorScheme: "light",
|
|
@@ -317,7 +317,7 @@ const Io = 100, ea = 1e4, ta = 5e3, na = "product-agent:sdk-preview-socket-conne
|
|
|
317
317
|
scribbleStyle: !0,
|
|
318
318
|
position: "bottom-right",
|
|
319
319
|
movableLauncher: !0
|
|
320
|
-
}, _a = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive',
|
|
320
|
+
}, _a = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive', to = "pluno-pa-scribble-font", Ro = 190, zo = 41, no = 22, xa = 1, ya = 48, Sn = 420, va = 520, Sa = 0.24, Cn = 680, Ca = 800, Ea = 0.76, N = 8, Ue = 50, Mo = "http://www.w3.org/2000/svg", gn = 26, hn = 8, ka = 36, mn = 16, La = 4, oo = [
|
|
321
321
|
{
|
|
322
322
|
ellipseCx: "17.5",
|
|
323
323
|
ellipseCy: "24.5",
|
|
@@ -355,7 +355,7 @@ const Io = 100, ea = 1e4, ta = 5e3, na = "product-agent:sdk-preview-socket-conne
|
|
|
355
355
|
pathStrokeWidth: "2.45"
|
|
356
356
|
}
|
|
357
357
|
], Ta = 11, Aa = 13, fn = 4, Do = 10, Oo = 40, Ia = "movable-launcher-position-v2", Uo = "pluno-pa-widget-styles", Bo = "data-pluno-pa-widget-styles";
|
|
358
|
-
let
|
|
358
|
+
let io = 0;
|
|
359
359
|
function Pa(e) {
|
|
360
360
|
return (t) => new xe(t, e);
|
|
361
361
|
}
|
|
@@ -436,7 +436,7 @@ async function Na(e = {}) {
|
|
|
436
436
|
);
|
|
437
437
|
const i = n.attachShadow({ mode: "open" }), o = document.createElement("div");
|
|
438
438
|
o.className = `pluno-pa-widget pluno-pa-widget--${t.position}`, o.classList.add(`pluno-pa-widget--layout-${t.layout}`), o.setAttribute("data-pluno-product-agent-ui-root", "widget");
|
|
439
|
-
let r =
|
|
439
|
+
let r = ao(
|
|
440
440
|
t.accentColor,
|
|
441
441
|
t.scribbleStyle
|
|
442
442
|
);
|
|
@@ -447,17 +447,17 @@ async function Na(e = {}) {
|
|
|
447
447
|
t.movableLauncher,
|
|
448
448
|
t.showLauncherMinimizeButton
|
|
449
449
|
), i.appendChild(o);
|
|
450
|
-
const l = il(t),
|
|
451
|
-
So(t,
|
|
452
|
-
let
|
|
453
|
-
o.classList.add(`pluno-pa-widget--${t.colorScheme}`), t.scribbleStyle && o.classList.add("pluno-pa-widget--scribble"),
|
|
450
|
+
const l = il(t), p = t.layout === "floating" ? t.initialDisplayState ?? nl(t) : "shown";
|
|
451
|
+
So(t, p);
|
|
452
|
+
let s = t.movableLauncher ? l.launcherPosition : null, c = s !== null, g = l.panelSize, h = null;
|
|
453
|
+
o.classList.add(`pluno-pa-widget--${t.colorScheme}`), t.scribbleStyle && o.classList.add("pluno-pa-widget--scribble"), p === "minimized" && (o.classList.add("pluno-pa-widget--minimized"), Oe(
|
|
454
454
|
o,
|
|
455
455
|
en(
|
|
456
456
|
o,
|
|
457
|
-
|
|
457
|
+
s,
|
|
458
458
|
t.position
|
|
459
459
|
)
|
|
460
|
-
)), vo(i, t.accentColor),
|
|
460
|
+
)), vo(i, t.accentColor), ro(o, r, {
|
|
461
461
|
accentColor: t.accentColor,
|
|
462
462
|
colorScheme: t.colorScheme,
|
|
463
463
|
fontFamily: t.fontFamily,
|
|
@@ -532,7 +532,7 @@ async function Na(e = {}) {
|
|
|
532
532
|
throw new Error("Failed to mount Pluno widget");
|
|
533
533
|
if (t.movableLauncher && !O)
|
|
534
534
|
throw new Error("Failed to mount Pluno widget drag handle");
|
|
535
|
-
U.hidden = !t.attachmentsEnabled, ce.disabled = !t.attachmentsEnabled,
|
|
535
|
+
U.hidden = !t.attachmentsEnabled, ce.disabled = !t.attachmentsEnabled, mo(u), mo(y);
|
|
536
536
|
let b = [], k = null;
|
|
537
537
|
const q = () => Yi(
|
|
538
538
|
y,
|
|
@@ -547,15 +547,15 @@ async function Na(e = {}) {
|
|
|
547
547
|
), Fe(), D(_.getState()), j(), q();
|
|
548
548
|
}
|
|
549
549
|
);
|
|
550
|
-
},
|
|
551
|
-
if (!t.loginRequired && !t.signupRequired && !t.token && !
|
|
550
|
+
}, Tn = t.loginRequired || t.signupRequired || t.token || t.webSocketFactory ? void 0 : t.tokenProvider ?? (t.tokenEndpoint ? async () => ni(t.tokenEndpoint) : void 0);
|
|
551
|
+
if (!t.loginRequired && !t.signupRequired && !t.token && !Tn && !t.webSocketFactory)
|
|
552
552
|
throw new Error("Pluno widget requires token or tokenEndpoint");
|
|
553
553
|
const ii = window.fetch.bind(window), Pt = ol(t.clientId);
|
|
554
554
|
let _;
|
|
555
555
|
try {
|
|
556
556
|
const a = {
|
|
557
557
|
token: t.token,
|
|
558
|
-
tokenProvider:
|
|
558
|
+
tokenProvider: Tn,
|
|
559
559
|
backendUrl: t.backendUrl,
|
|
560
560
|
metadata: () => ({
|
|
561
561
|
...t.metadata ?? {},
|
|
@@ -592,7 +592,7 @@ async function Na(e = {}) {
|
|
|
592
592
|
), Ze = new Set(Pe);
|
|
593
593
|
let Rt = l.sharePromptsDisabled || await al(t), oe = null, V = !1, ut = !(t.loginRequired || t.signupRequired), ve = !1, Ne = {
|
|
594
594
|
enabled: !0
|
|
595
|
-
}, Re = 0,
|
|
595
|
+
}, Re = 0, An = "", Y = !1, he = !1, Se = [], zt = null, Je = null;
|
|
596
596
|
const ie = (a, d) => {
|
|
597
597
|
Ne = { enabled: a, reason: d };
|
|
598
598
|
}, ae = () => {
|
|
@@ -629,7 +629,7 @@ async function Na(e = {}) {
|
|
|
629
629
|
a.className = "pluno-pa-widget__history-loading pluno-pa-widget__history-loading--inline", a.textContent = "Loading...", K.appendChild(a);
|
|
630
630
|
}
|
|
631
631
|
Te.textContent = Je ?? (!he && Se.length === 0 ? "No recent chats for this page yet." : ""), Te.hidden = Te.textContent.length === 0;
|
|
632
|
-
},
|
|
632
|
+
}, In = async (a) => {
|
|
633
633
|
if (!he) {
|
|
634
634
|
he = !0, Je = null, me();
|
|
635
635
|
try {
|
|
@@ -648,19 +648,19 @@ async function Na(e = {}) {
|
|
|
648
648
|
}
|
|
649
649
|
}
|
|
650
650
|
}, li = () => {
|
|
651
|
-
!zt || he || K.scrollHeight - K.scrollTop - K.clientHeight <= 24 &&
|
|
652
|
-
},
|
|
651
|
+
!zt || he || K.scrollHeight - K.scrollTop - K.clientHeight <= 24 && In(zt);
|
|
652
|
+
}, Pn = () => {
|
|
653
653
|
V || typeof document > "u" || (vo(i, t.accentColor), n.isConnected || (t.mountTarget?.isConnected ? t.mountTarget.appendChild(n) : t.mountTarget || v.body?.appendChild(n)));
|
|
654
|
-
},
|
|
655
|
-
|
|
654
|
+
}, Nn = new MutationObserver(Pn);
|
|
655
|
+
Nn.observe(v.documentElement, {
|
|
656
656
|
childList: !0,
|
|
657
657
|
subtree: !0
|
|
658
|
-
}),
|
|
658
|
+
}), Pn();
|
|
659
659
|
const Qe = (a = !0) => {
|
|
660
660
|
const d = Tt(o, a);
|
|
661
661
|
return wn(
|
|
662
662
|
o,
|
|
663
|
-
|
|
663
|
+
s ? Ct(s, d) : Fa(
|
|
664
664
|
o,
|
|
665
665
|
t.position,
|
|
666
666
|
d
|
|
@@ -679,7 +679,7 @@ async function Na(e = {}) {
|
|
|
679
679
|
focusedInput: a,
|
|
680
680
|
focusedInputAt: a ? Date.now() : null,
|
|
681
681
|
openToolGroupKeys: [...Nt],
|
|
682
|
-
launcherPosition: c ?
|
|
682
|
+
launcherPosition: c ? s : null,
|
|
683
683
|
panelSize: g,
|
|
684
684
|
seenShareCandidateIds: [...Pe].slice(
|
|
685
685
|
-Io
|
|
@@ -697,14 +697,14 @@ async function Na(e = {}) {
|
|
|
697
697
|
o,
|
|
698
698
|
en(
|
|
699
699
|
o,
|
|
700
|
-
|
|
700
|
+
s,
|
|
701
701
|
t.position
|
|
702
702
|
)
|
|
703
|
-
),
|
|
703
|
+
), uo(o), H(), d && gt("minimized");
|
|
704
704
|
}, ze = (a, d = {}) => {
|
|
705
705
|
qa(a, {
|
|
706
706
|
debugVersion: Ia,
|
|
707
|
-
launcherPosition:
|
|
707
|
+
launcherPosition: s,
|
|
708
708
|
rootClasses: o.className,
|
|
709
709
|
rootStyle: {
|
|
710
710
|
left: o.style.left,
|
|
@@ -721,7 +721,7 @@ async function Na(e = {}) {
|
|
|
721
721
|
...d
|
|
722
722
|
});
|
|
723
723
|
}, tt = (a = !0) => {
|
|
724
|
-
if (!
|
|
724
|
+
if (!s)
|
|
725
725
|
return Oe(o, null), Qe(a);
|
|
726
726
|
const d = Qe(a);
|
|
727
727
|
return Oe(o, d), ze("Applied stored closed launcher position", {
|
|
@@ -729,7 +729,7 @@ async function Na(e = {}) {
|
|
|
729
729
|
}), d;
|
|
730
730
|
}, Mt = (a, d) => {
|
|
731
731
|
if (!a || !d) {
|
|
732
|
-
|
|
732
|
+
uo(o);
|
|
733
733
|
return;
|
|
734
734
|
}
|
|
735
735
|
$a(o, {
|
|
@@ -739,13 +739,13 @@ async function Na(e = {}) {
|
|
|
739
739
|
}, Dt = () => {
|
|
740
740
|
const a = Ve(g).width;
|
|
741
741
|
return t.layout === "page" && w.getBoundingClientRect().width || a;
|
|
742
|
-
},
|
|
742
|
+
}, Rn = () => {
|
|
743
743
|
if (o.classList.contains("pluno-pa-widget--minimized")) {
|
|
744
744
|
Oe(
|
|
745
745
|
o,
|
|
746
746
|
en(
|
|
747
747
|
o,
|
|
748
|
-
|
|
748
|
+
s,
|
|
749
749
|
t.position
|
|
750
750
|
)
|
|
751
751
|
);
|
|
@@ -772,14 +772,14 @@ async function Na(e = {}) {
|
|
|
772
772
|
"Applied open panel position after viewport resize",
|
|
773
773
|
{ openPanelPosition: f }
|
|
774
774
|
);
|
|
775
|
-
} else
|
|
775
|
+
} else s && ze(
|
|
776
776
|
"Applied visible launcher position after viewport resize",
|
|
777
777
|
{ visibleLauncherPosition: a }
|
|
778
778
|
);
|
|
779
779
|
};
|
|
780
|
-
let
|
|
780
|
+
let zn = () => {
|
|
781
781
|
};
|
|
782
|
-
window.addEventListener("resize",
|
|
782
|
+
window.addEventListener("resize", Rn), t.movableLauncher && O ? (tt(), zn = Oa({
|
|
783
783
|
root: o,
|
|
784
784
|
launcher: E,
|
|
785
785
|
launcherDragHandle: O,
|
|
@@ -790,7 +790,7 @@ async function Na(e = {}) {
|
|
|
790
790
|
a,
|
|
791
791
|
f
|
|
792
792
|
);
|
|
793
|
-
|
|
793
|
+
s = co(
|
|
794
794
|
C,
|
|
795
795
|
f
|
|
796
796
|
), Oe(o, C), ze("Dragging closed launcher", {
|
|
@@ -824,7 +824,7 @@ async function Na(e = {}) {
|
|
|
824
824
|
a.position,
|
|
825
825
|
Ve(g)
|
|
826
826
|
);
|
|
827
|
-
h =
|
|
827
|
+
h = co(
|
|
828
828
|
d,
|
|
829
829
|
Ve(g)
|
|
830
830
|
);
|
|
@@ -839,14 +839,14 @@ async function Na(e = {}) {
|
|
|
839
839
|
}) : () => {
|
|
840
840
|
};
|
|
841
841
|
let Ot = !1;
|
|
842
|
-
const
|
|
842
|
+
const Mn = async () => {
|
|
843
843
|
if (!(!t.billingStatusLoader || Ot)) {
|
|
844
844
|
Ot = !0;
|
|
845
845
|
try {
|
|
846
846
|
const a = await t.billingStatusLoader();
|
|
847
847
|
if (V)
|
|
848
848
|
return;
|
|
849
|
-
|
|
849
|
+
wo(
|
|
850
850
|
t.billingStatus,
|
|
851
851
|
a,
|
|
852
852
|
_.getState().lastErrorCode
|
|
@@ -866,7 +866,7 @@ async function Na(e = {}) {
|
|
|
866
866
|
}
|
|
867
867
|
}
|
|
868
868
|
}, fe = (a = "", d = !0, f = !0) => {
|
|
869
|
-
|
|
869
|
+
Mn(), ot && (ot = !1, Ft()), o.classList.contains("pluno-pa-widget--open") || (h = null), oe !== null && (window.clearTimeout(oe), oe = null), et("shown", !1), w.hidden = !1, L.hidden = !1, an(
|
|
870
870
|
R,
|
|
871
871
|
Dt()
|
|
872
872
|
), o.classList.remove("pluno-pa-widget--closing");
|
|
@@ -889,7 +889,7 @@ async function Na(e = {}) {
|
|
|
889
889
|
}, 220);
|
|
890
890
|
});
|
|
891
891
|
}, Ut = () => {
|
|
892
|
-
oe !== null && (window.clearTimeout(oe), oe = null), E.hidden = !1,
|
|
892
|
+
oe !== null && (window.clearTimeout(oe), oe = null), E.hidden = !1, s && (tt(!1), ze("Closing launcher at stored position")), o.classList.remove("pluno-pa-widget--open"), o.classList.add("pluno-pa-widget--closing"), H(), t.onPanelOpenChange?.(!1), oe = window.setTimeout(() => {
|
|
893
893
|
w.hidden = !0, L.hidden = !0, h = null, o.classList.remove("pluno-pa-widget--closing");
|
|
894
894
|
}, 220);
|
|
895
895
|
};
|
|
@@ -908,12 +908,12 @@ async function Na(e = {}) {
|
|
|
908
908
|
fe(a), u.value = "";
|
|
909
909
|
});
|
|
910
910
|
let Bt = null, ht = null, Me = null;
|
|
911
|
-
const
|
|
911
|
+
const Dn = (a) => a === u || a === y, ci = (a) => {
|
|
912
912
|
if (!(a instanceof Element) || a.getRootNode() === o.getRootNode())
|
|
913
913
|
return null;
|
|
914
914
|
let d = a;
|
|
915
915
|
for (; d; ) {
|
|
916
|
-
const f = d.closest(
|
|
916
|
+
const f = d.closest(Qn);
|
|
917
917
|
if (f)
|
|
918
918
|
return f;
|
|
919
919
|
const C = d.getRootNode();
|
|
@@ -921,7 +921,7 @@ async function Na(e = {}) {
|
|
|
921
921
|
}
|
|
922
922
|
return null;
|
|
923
923
|
}, ui = (a) => {
|
|
924
|
-
if (!a.isConnected || !a.matches(
|
|
924
|
+
if (!a.isConnected || !a.matches(Qn))
|
|
925
925
|
return !1;
|
|
926
926
|
if (!(a instanceof HTMLElement))
|
|
927
927
|
return !0;
|
|
@@ -931,21 +931,21 @@ async function Na(e = {}) {
|
|
|
931
931
|
return a.checkVisibility();
|
|
932
932
|
const d = window.getComputedStyle(a);
|
|
933
933
|
return d.display !== "none" && d.visibility !== "hidden";
|
|
934
|
-
},
|
|
934
|
+
}, On = (a) => {
|
|
935
935
|
We !== a && (We = a, o.classList.toggle(
|
|
936
936
|
"pluno-pa-widget--host-modal-conflict",
|
|
937
937
|
a !== null
|
|
938
938
|
), De(), a !== null ? Me = window.setInterval(() => {
|
|
939
939
|
const d = We;
|
|
940
|
-
(!d || !ui(d)) &&
|
|
940
|
+
(!d || !ui(d)) && On(null);
|
|
941
941
|
}, wa) : Me !== null && (window.clearInterval(Me), Me = null, ht = null));
|
|
942
942
|
}, gi = () => {
|
|
943
943
|
Me !== null && (window.clearInterval(Me), Me = null);
|
|
944
944
|
};
|
|
945
945
|
o.addEventListener("focusin", (a) => {
|
|
946
|
-
|
|
946
|
+
Dn(a.target) && (Bt = Date.now(), H());
|
|
947
947
|
}), o.addEventListener("focusout", (a) => {
|
|
948
|
-
if (!
|
|
948
|
+
if (!Dn(a.target) || We !== null)
|
|
949
949
|
return;
|
|
950
950
|
const d = Bt;
|
|
951
951
|
if (Bt = null, d === null || Date.now() - d > ma)
|
|
@@ -955,7 +955,7 @@ async function Na(e = {}) {
|
|
|
955
955
|
return;
|
|
956
956
|
const C = Date.now();
|
|
957
957
|
if (ht !== null && C - ht <= fa) {
|
|
958
|
-
|
|
958
|
+
On(f);
|
|
959
959
|
return;
|
|
960
960
|
}
|
|
961
961
|
ht = C;
|
|
@@ -970,18 +970,18 @@ async function Na(e = {}) {
|
|
|
970
970
|
}), ue.addEventListener("click", () => {
|
|
971
971
|
ri();
|
|
972
972
|
});
|
|
973
|
-
const
|
|
973
|
+
const Un = typeof IntersectionObserver > "u" ? null : new IntersectionObserver(
|
|
974
974
|
([a]) => {
|
|
975
975
|
a?.isIntersecting && (ie(!0, "bottom"), ae());
|
|
976
976
|
},
|
|
977
977
|
{ root: z, threshold: 0 }
|
|
978
978
|
);
|
|
979
|
-
|
|
979
|
+
Un?.observe(Xe);
|
|
980
980
|
const nt = () => t.loginRequired || t.signupRequired;
|
|
981
981
|
let We = null, ot = !1;
|
|
982
982
|
const re = () => ut || _.getState().status !== "connected", De = () => {
|
|
983
983
|
const a = nt(), d = We !== null;
|
|
984
|
-
u.readOnly = !1, y.readOnly = !1, u.placeholder = d ?
|
|
984
|
+
u.readOnly = !1, y.readOnly = !1, u.placeholder = d ? eo : a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : ot ? "New update" : t.launcherLabel, y.placeholder = d ? eo : a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : _e.launcherLabel, te.hidden = a;
|
|
985
985
|
}, j = () => {
|
|
986
986
|
B.disabled = re() || le(t.billingStatus) || !_.getState().isThinking && y.value.trim().length === 0 && b.length === 0, U.disabled = nt() || re() || le(t.billingStatus);
|
|
987
987
|
};
|
|
@@ -1103,7 +1103,7 @@ async function Na(e = {}) {
|
|
|
1103
1103
|
yt
|
|
1104
1104
|
), Fe(), j(), D(_.getState()), a && q();
|
|
1105
1105
|
}), X.addEventListener("click", () => {
|
|
1106
|
-
Y = !Y, Je = null, me(), Y && Se.length === 0 &&
|
|
1106
|
+
Y = !Y, Je = null, me(), Y && Se.length === 0 && In(null), Y || q();
|
|
1107
1107
|
}), ct.addEventListener("click", () => {
|
|
1108
1108
|
Y = !1, me(), q();
|
|
1109
1109
|
}), K.addEventListener("scroll", li), y.addEventListener("input", () => {
|
|
@@ -1144,17 +1144,17 @@ async function Na(e = {}) {
|
|
|
1144
1144
|
return;
|
|
1145
1145
|
}
|
|
1146
1146
|
a.key !== "Escape" || !Y || (Y = !1, me(), q());
|
|
1147
|
-
}), l.composerValue && (y.value = l.composerValue, lt(y)), t.layout === "page" ? fe(y.value, !1) :
|
|
1147
|
+
}), l.composerValue && (y.value = l.composerValue, lt(y)), t.layout === "page" ? fe(y.value, !1) : p === "minimized" ? et("minimized", !1) : t.initialDisplayState === void 0 && l.isOpen && fe(y.value, !1, !1), Ka(l, o, u, y);
|
|
1148
1148
|
const mt = () => r;
|
|
1149
|
-
let $t = _.getState().appearance !== null, ft = null, at = null,
|
|
1149
|
+
let $t = _.getState().appearance !== null, ft = null, at = null, Bn = _.getState().isThinking, He = null;
|
|
1150
1150
|
const rt = t.taskNotifications;
|
|
1151
1151
|
let Ge = null, $e = !1;
|
|
1152
|
-
const
|
|
1152
|
+
const Fn = () => {
|
|
1153
1153
|
Ge !== null && (window.clearTimeout(Ge), Ge = null);
|
|
1154
1154
|
}, wt = () => {
|
|
1155
1155
|
Ae && (Ae.hidden = !0);
|
|
1156
|
-
},
|
|
1157
|
-
if (!rt || !Ae || $e || V || !_.getState().isThinking ||
|
|
1156
|
+
}, Wn = () => _.getState().assistantDraft.trim().length > 0, wi = async () => {
|
|
1157
|
+
if (!rt || !Ae || $e || V || !_.getState().isThinking || Wn())
|
|
1158
1158
|
return;
|
|
1159
1159
|
let a;
|
|
1160
1160
|
try {
|
|
@@ -1162,7 +1162,7 @@ async function Na(e = {}) {
|
|
|
1162
1162
|
} catch {
|
|
1163
1163
|
return;
|
|
1164
1164
|
}
|
|
1165
|
-
a.enabled || a.neverSuggest || !_.getState().isThinking ||
|
|
1165
|
+
a.enabled || a.neverSuggest || !_.getState().isThinking || Wn() || $e || V || (Ae.hidden = !1);
|
|
1166
1166
|
};
|
|
1167
1167
|
Ie?.addEventListener("click", () => {
|
|
1168
1168
|
$e = !0, wt(), rt?.enable().catch(() => {
|
|
@@ -1192,7 +1192,7 @@ async function Na(e = {}) {
|
|
|
1192
1192
|
qe = !1, _t();
|
|
1193
1193
|
});
|
|
1194
1194
|
}), _t();
|
|
1195
|
-
let je = null,
|
|
1195
|
+
let je = null, Hn = () => {
|
|
1196
1196
|
};
|
|
1197
1197
|
const bi = !!(t.sdkPreviewChannelId && t.referralLinkLoader), qt = /* @__PURE__ */ new Map(), jt = () => y.value.trim().length > 0 || b.length > 0, _i = () => {
|
|
1198
1198
|
const a = je !== null && pn(_.getState(), jt());
|
|
@@ -1228,7 +1228,7 @@ async function Na(e = {}) {
|
|
|
1228
1228
|
!1
|
|
1229
1229
|
), Ke.addEventListener("click", () => Kt()), $.insertBefore(Ke, X));
|
|
1230
1230
|
}, D = (a) => {
|
|
1231
|
-
if (me(),
|
|
1231
|
+
if (me(), kn(a.lastErrorCode) ? He = a.lastErrorCode : t.billingStatus?.creditsUsed !== null && !le(t.billingStatus) && (He = null), ln(
|
|
1232
1232
|
Ye,
|
|
1233
1233
|
t.billingStatus,
|
|
1234
1234
|
He
|
|
@@ -1258,8 +1258,8 @@ async function Na(e = {}) {
|
|
|
1258
1258
|
);
|
|
1259
1259
|
return;
|
|
1260
1260
|
}
|
|
1261
|
-
const d = Ya(a), f = d !==
|
|
1262
|
-
|
|
1261
|
+
const d = Ya(a), f = d !== An;
|
|
1262
|
+
An = d;
|
|
1263
1263
|
const C = ve || Ne.enabled;
|
|
1264
1264
|
ve = !1, Ir(
|
|
1265
1265
|
z,
|
|
@@ -1318,7 +1318,7 @@ async function Na(e = {}) {
|
|
|
1318
1318
|
}
|
|
1319
1319
|
} : void 0
|
|
1320
1320
|
), C ? (Re = z.scrollTop, ae()) : f && Xa(a) && ai();
|
|
1321
|
-
},
|
|
1321
|
+
}, Gn = async (a) => {
|
|
1322
1322
|
if (!t.integrationAuthStatusLoader)
|
|
1323
1323
|
return;
|
|
1324
1324
|
const d = a.messages.map((f) => f.integrationAuthRequest).filter(
|
|
@@ -1346,7 +1346,7 @@ async function Na(e = {}) {
|
|
|
1346
1346
|
})
|
|
1347
1347
|
);
|
|
1348
1348
|
};
|
|
1349
|
-
return
|
|
1349
|
+
return Hn = Fi(
|
|
1350
1350
|
(a) => {
|
|
1351
1351
|
je = a, !V && pn(_.getState(), jt()) && D(_.getState());
|
|
1352
1352
|
},
|
|
@@ -1357,10 +1357,10 @@ async function Na(e = {}) {
|
|
|
1357
1357
|
}
|
|
1358
1358
|
), _.on("state", (a) => {
|
|
1359
1359
|
_t();
|
|
1360
|
-
const d =
|
|
1361
|
-
|
|
1360
|
+
const d = Bn && !a.isThinking;
|
|
1361
|
+
Bn = a.isThinking, a.isThinking && !a.assistantDraft.trim() && rt && !$e && Ge === null && Ae?.hidden !== !1 && (Ge = window.setTimeout(() => {
|
|
1362
1362
|
Ge = null, wi();
|
|
1363
|
-
}, ea)), (!a.isThinking || a.assistantDraft.trim()) && (
|
|
1363
|
+
}, ea)), (!a.isThinking || a.assistantDraft.trim()) && (Fn(), wt()), d && !o.classList.contains("pluno-pa-widget--open") && (ot = !0), Ft(), a.appearance ? ($t = !0, Z(
|
|
1364
1364
|
"web-sdk.widget",
|
|
1365
1365
|
"Agent state supplied appearance",
|
|
1366
1366
|
{
|
|
@@ -1374,8 +1374,8 @@ async function Na(e = {}) {
|
|
|
1374
1374
|
fallbackColorScheme: t.colorScheme,
|
|
1375
1375
|
fallbackFontFamily: t.fontFamily
|
|
1376
1376
|
}
|
|
1377
|
-
), Yt({}, "agent.state.appearance-cleared")), D(a),
|
|
1378
|
-
}), D(_.getState()),
|
|
1377
|
+
), Yt({}, "agent.state.appearance-cleared")), D(a), Gn(a), j(), d && Mn();
|
|
1378
|
+
}), D(_.getState()), Gn(_.getState()), j(), Wt(), {
|
|
1379
1379
|
agent: _,
|
|
1380
1380
|
startNewChat: Kt,
|
|
1381
1381
|
host: n,
|
|
@@ -1384,7 +1384,7 @@ async function Na(e = {}) {
|
|
|
1384
1384
|
},
|
|
1385
1385
|
updateBillingStatus: (a) => {
|
|
1386
1386
|
const d = a ?? null;
|
|
1387
|
-
|
|
1387
|
+
wo(
|
|
1388
1388
|
t.billingStatus,
|
|
1389
1389
|
d,
|
|
1390
1390
|
He
|
|
@@ -1414,7 +1414,7 @@ async function Na(e = {}) {
|
|
|
1414
1414
|
t.morningReport = a ?? null, D(_.getState());
|
|
1415
1415
|
},
|
|
1416
1416
|
destroy: () => {
|
|
1417
|
-
V || (H(), V = !0,
|
|
1417
|
+
V || (H(), V = !0, Nn.disconnect(), Un?.disconnect(), gi(), window.removeEventListener("resize", Rn), zn(), di(), k !== null && window.clearTimeout(k), Fn(), Hn(), _.destroy(), Pt.release(), n.remove());
|
|
1418
1418
|
}
|
|
1419
1419
|
};
|
|
1420
1420
|
async function yi(a) {
|
|
@@ -1452,10 +1452,10 @@ async function Na(e = {}) {
|
|
|
1452
1452
|
}
|
|
1453
1453
|
function Yt(a, d) {
|
|
1454
1454
|
const f = a.accentColor ?? t.accentColor, C = a.colorScheme ?? t.colorScheme, I = a.fontFamily ?? t.fontFamily, Xt = a.scribbleStyle ?? t.scribbleStyle;
|
|
1455
|
-
r =
|
|
1455
|
+
r = ao(
|
|
1456
1456
|
f,
|
|
1457
1457
|
Xt
|
|
1458
|
-
),
|
|
1458
|
+
), ro(o, r, {
|
|
1459
1459
|
accentColor: f,
|
|
1460
1460
|
colorScheme: C,
|
|
1461
1461
|
fontFamily: I,
|
|
@@ -1471,7 +1471,7 @@ async function Na(e = {}) {
|
|
|
1471
1471
|
});
|
|
1472
1472
|
}
|
|
1473
1473
|
}
|
|
1474
|
-
function
|
|
1474
|
+
function ao(e, t) {
|
|
1475
1475
|
return { accentColor: e, scribbleStyle: t };
|
|
1476
1476
|
}
|
|
1477
1477
|
function Ra(e) {
|
|
@@ -1497,7 +1497,7 @@ function Ma([e, t, n]) {
|
|
|
1497
1497
|
};
|
|
1498
1498
|
return 0.2126 * i(e) + 0.7152 * i(t) + 0.0722 * i(n);
|
|
1499
1499
|
}
|
|
1500
|
-
function
|
|
1500
|
+
function ro(e, t, n) {
|
|
1501
1501
|
e.classList.toggle(
|
|
1502
1502
|
"pluno-pa-widget--dark",
|
|
1503
1503
|
n.colorScheme === "dark"
|
|
@@ -1522,10 +1522,10 @@ function ao(e, t, n) {
|
|
|
1522
1522
|
);
|
|
1523
1523
|
}
|
|
1524
1524
|
function Da(e) {
|
|
1525
|
-
if (e.getElementById(
|
|
1525
|
+
if (e.getElementById(to))
|
|
1526
1526
|
return;
|
|
1527
1527
|
const t = e.createElement("style");
|
|
1528
|
-
t.id =
|
|
1528
|
+
t.id = to, t.textContent = `@font-face {
|
|
1529
1529
|
font-family: "Architects Daughter";
|
|
1530
1530
|
font-style: normal;
|
|
1531
1531
|
font-weight: 400;
|
|
@@ -1541,17 +1541,17 @@ function Oa({
|
|
|
1541
1541
|
setPosition: o,
|
|
1542
1542
|
persist: r
|
|
1543
1543
|
}) {
|
|
1544
|
-
let l = null,
|
|
1544
|
+
let l = null, p = null, s = null, c = !1, g = null;
|
|
1545
1545
|
const h = () => {
|
|
1546
|
-
l = null,
|
|
1546
|
+
l = null, p = null, s = null, c = !1, e.classList.remove("pluno-pa-widget--dragging");
|
|
1547
1547
|
}, m = (w) => {
|
|
1548
|
-
e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing") || (w.preventDefault(), w.stopPropagation(), l = w.pointerId,
|
|
1548
|
+
e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing") || (w.preventDefault(), w.stopPropagation(), l = w.pointerId, p = { x: w.clientX, y: w.clientY }, s = i(), c = !1, t.setPointerCapture?.(w.pointerId));
|
|
1549
1549
|
}, v = (w) => {
|
|
1550
|
-
if (l !== w.pointerId || !
|
|
1550
|
+
if (l !== w.pointerId || !p || !s)
|
|
1551
1551
|
return;
|
|
1552
1552
|
w.preventDefault();
|
|
1553
|
-
const R = w.clientX -
|
|
1554
|
-
!c && Math.hypot(R, M) < fn || (c = !0, e.classList.add("pluno-pa-widget--dragging"), o({ x:
|
|
1553
|
+
const R = w.clientX - p.x, M = w.clientY - p.y;
|
|
1554
|
+
!c && Math.hypot(R, M) < fn || (c = !0, e.classList.add("pluno-pa-widget--dragging"), o({ x: s.x + R, y: s.y + M }));
|
|
1555
1555
|
}, E = (w) => {
|
|
1556
1556
|
l === w.pointerId && (w.preventDefault(), w.stopPropagation(), c && (g = { x: w.clientX, y: w.clientY }, r()), h());
|
|
1557
1557
|
}, O = (w) => {
|
|
@@ -1582,19 +1582,19 @@ function Ua({
|
|
|
1582
1582
|
setBounds: i,
|
|
1583
1583
|
persist: o
|
|
1584
1584
|
}) {
|
|
1585
|
-
let r = null, l = null,
|
|
1585
|
+
let r = null, l = null, p = null, s = null, c = !1;
|
|
1586
1586
|
const g = () => {
|
|
1587
|
-
r = null, l = null,
|
|
1587
|
+
r = null, l = null, p = null, s = null, c = !1, e.classList.remove("pluno-pa-widget--resizing");
|
|
1588
1588
|
}, h = (u) => {
|
|
1589
1589
|
const F = u.currentTarget, w = F.dataset.resizeDirection;
|
|
1590
|
-
!e.classList.contains("pluno-pa-widget--open") || !
|
|
1590
|
+
!e.classList.contains("pluno-pa-widget--open") || !lo(w) || (u.preventDefault(), u.stopPropagation(), r = u.pointerId, l = w, p = { x: u.clientX, y: u.clientY }, s = n(), c = !1, F.setPointerCapture?.(u.pointerId));
|
|
1591
1591
|
}, m = (u) => {
|
|
1592
|
-
if (r !== u.pointerId || !l || !
|
|
1592
|
+
if (r !== u.pointerId || !l || !p || !s)
|
|
1593
1593
|
return;
|
|
1594
1594
|
u.preventDefault(), u.stopPropagation();
|
|
1595
|
-
const F = u.clientX -
|
|
1595
|
+
const F = u.clientX - p.x, w = u.clientY - p.y;
|
|
1596
1596
|
!c && Math.hypot(F, w) < fn || (c = !0, e.classList.add("pluno-pa-widget--resizing"), i(
|
|
1597
|
-
|
|
1597
|
+
po(s, l, F, w)
|
|
1598
1598
|
));
|
|
1599
1599
|
}, v = (u) => {
|
|
1600
1600
|
r === u.pointerId && (u.preventDefault(), u.stopPropagation(), c && o(), g());
|
|
@@ -1603,7 +1603,7 @@ function Ua({
|
|
|
1603
1603
|
}, O = (u) => {
|
|
1604
1604
|
const w = u.currentTarget.dataset.resizeDirection, R = u.shiftKey ? Oo : Do, M = n();
|
|
1605
1605
|
let L = 0, te = 0;
|
|
1606
|
-
|
|
1606
|
+
lo(w) && (u.key === "ArrowLeft" ? L = -R : u.key === "ArrowRight" ? L = R : u.key === "ArrowUp" ? te = -R : u.key === "ArrowDown" && (te = R), !(L === 0 && te === 0) && (u.preventDefault(), u.stopPropagation(), i(po(M, w, L, te)), o()));
|
|
1607
1607
|
};
|
|
1608
1608
|
for (const u of t)
|
|
1609
1609
|
u.addEventListener("pointerdown", h), u.addEventListener("pointermove", m), u.addEventListener("pointerup", v), u.addEventListener("pointercancel", E), u.addEventListener("keydown", O);
|
|
@@ -1612,11 +1612,11 @@ function Ua({
|
|
|
1612
1612
|
u.removeEventListener("pointerdown", h), u.removeEventListener("pointermove", m), u.removeEventListener("pointerup", v), u.removeEventListener("pointercancel", E), u.removeEventListener("keydown", O);
|
|
1613
1613
|
};
|
|
1614
1614
|
}
|
|
1615
|
-
function
|
|
1615
|
+
function lo(e) {
|
|
1616
1616
|
return e === "left" || e === "right" || e === "top" || e === "bottom" || e === "top-left" || e === "top-right" || e === "bottom-left" || e === "bottom-right";
|
|
1617
1617
|
}
|
|
1618
|
-
function
|
|
1619
|
-
const o = ee(), r =
|
|
1618
|
+
function po(e, t, n, i) {
|
|
1619
|
+
const o = ee(), r = so({
|
|
1620
1620
|
leading: e.position.x,
|
|
1621
1621
|
length: e.size.width,
|
|
1622
1622
|
delta: n,
|
|
@@ -1625,10 +1625,10 @@ function lo(e, t, n, i) {
|
|
|
1625
1625
|
minLeading: N,
|
|
1626
1626
|
maxTrailing: o.width - N,
|
|
1627
1627
|
minLength: Math.min(
|
|
1628
|
-
|
|
1628
|
+
Sn,
|
|
1629
1629
|
o.width - N * 2
|
|
1630
1630
|
)
|
|
1631
|
-
}), l =
|
|
1631
|
+
}), l = so({
|
|
1632
1632
|
leading: e.position.y,
|
|
1633
1633
|
length: e.size.height,
|
|
1634
1634
|
delta: i,
|
|
@@ -1637,7 +1637,7 @@ function lo(e, t, n, i) {
|
|
|
1637
1637
|
minLeading: Ue,
|
|
1638
1638
|
maxTrailing: o.height - N,
|
|
1639
1639
|
minLength: Math.min(
|
|
1640
|
-
|
|
1640
|
+
Cn,
|
|
1641
1641
|
o.height - Ue - N
|
|
1642
1642
|
)
|
|
1643
1643
|
});
|
|
@@ -1646,7 +1646,7 @@ function lo(e, t, n, i) {
|
|
|
1646
1646
|
size: { width: r.length, height: l.length }
|
|
1647
1647
|
};
|
|
1648
1648
|
}
|
|
1649
|
-
function
|
|
1649
|
+
function so({
|
|
1650
1650
|
leading: e,
|
|
1651
1651
|
length: t,
|
|
1652
1652
|
delta: n,
|
|
@@ -1654,32 +1654,32 @@ function po({
|
|
|
1654
1654
|
resizeTrailing: o,
|
|
1655
1655
|
minLeading: r,
|
|
1656
1656
|
maxTrailing: l,
|
|
1657
|
-
minLength:
|
|
1657
|
+
minLength: p
|
|
1658
1658
|
}) {
|
|
1659
|
-
const
|
|
1659
|
+
const s = e + t;
|
|
1660
1660
|
if (i) {
|
|
1661
1661
|
const c = e + n;
|
|
1662
1662
|
if (c >= r) {
|
|
1663
1663
|
const h = Q(
|
|
1664
1664
|
c,
|
|
1665
1665
|
r,
|
|
1666
|
-
|
|
1666
|
+
s - p
|
|
1667
1667
|
);
|
|
1668
|
-
return { leading: h, length:
|
|
1668
|
+
return { leading: h, length: s - h };
|
|
1669
1669
|
}
|
|
1670
1670
|
const g = Q(
|
|
1671
|
-
|
|
1672
|
-
|
|
1671
|
+
s + r - c,
|
|
1672
|
+
s,
|
|
1673
1673
|
l
|
|
1674
1674
|
);
|
|
1675
1675
|
return { leading: r, length: g - r };
|
|
1676
1676
|
}
|
|
1677
1677
|
if (o) {
|
|
1678
|
-
const c =
|
|
1678
|
+
const c = s + n;
|
|
1679
1679
|
if (c <= l) {
|
|
1680
1680
|
const h = Q(
|
|
1681
1681
|
c,
|
|
1682
|
-
e +
|
|
1682
|
+
e + p,
|
|
1683
1683
|
l
|
|
1684
1684
|
);
|
|
1685
1685
|
return { leading: e, length: h - e };
|
|
@@ -1696,7 +1696,7 @@ function po({
|
|
|
1696
1696
|
function Tt(e, t = !0) {
|
|
1697
1697
|
const n = ee();
|
|
1698
1698
|
if (e.classList.contains("pluno-pa-widget--minimized"))
|
|
1699
|
-
return { width:
|
|
1699
|
+
return { width: no, height: no };
|
|
1700
1700
|
const i = e.getBoundingClientRect(), o = !e.classList.contains("pluno-pa-widget--open") && !e.classList.contains("pluno-pa-widget--closing");
|
|
1701
1701
|
return {
|
|
1702
1702
|
width: t && o && i.width > 0 ? i.width : Math.min(Ro, n.width - 36),
|
|
@@ -1709,7 +1709,7 @@ function Ba() {
|
|
|
1709
1709
|
width: Math.min(
|
|
1710
1710
|
Q(
|
|
1711
1711
|
e.width * Sa,
|
|
1712
|
-
|
|
1712
|
+
Sn,
|
|
1713
1713
|
va
|
|
1714
1714
|
),
|
|
1715
1715
|
e.width - N * 2
|
|
@@ -1717,7 +1717,7 @@ function Ba() {
|
|
|
1717
1717
|
height: Math.min(
|
|
1718
1718
|
Q(
|
|
1719
1719
|
e.height * Ea,
|
|
1720
|
-
|
|
1720
|
+
Cn,
|
|
1721
1721
|
Ca
|
|
1722
1722
|
),
|
|
1723
1723
|
e.height - Ue - N
|
|
@@ -1733,7 +1733,7 @@ function At(e) {
|
|
|
1733
1733
|
width: Q(
|
|
1734
1734
|
e.width,
|
|
1735
1735
|
Math.min(
|
|
1736
|
-
|
|
1736
|
+
Sn,
|
|
1737
1737
|
t.width - N * 2
|
|
1738
1738
|
),
|
|
1739
1739
|
Math.max(
|
|
@@ -1744,7 +1744,7 @@ function At(e) {
|
|
|
1744
1744
|
height: Q(
|
|
1745
1745
|
e.height,
|
|
1746
1746
|
Math.min(
|
|
1747
|
-
|
|
1747
|
+
Cn,
|
|
1748
1748
|
t.height - Ue - N
|
|
1749
1749
|
),
|
|
1750
1750
|
Math.max(
|
|
@@ -1818,7 +1818,7 @@ function Ct(e, t) {
|
|
|
1818
1818
|
y: e.anchor.startsWith("bottom") ? n.height - t.height - e.y : e.y
|
|
1819
1819
|
};
|
|
1820
1820
|
}
|
|
1821
|
-
function
|
|
1821
|
+
function co(e, t) {
|
|
1822
1822
|
const n = Ha(e, t), i = ee();
|
|
1823
1823
|
return {
|
|
1824
1824
|
anchor: n,
|
|
@@ -1871,7 +1871,7 @@ function Oe(e, t) {
|
|
|
1871
1871
|
function $a(e, t) {
|
|
1872
1872
|
e.style.setProperty("--pluno-pa-panel-offset-x", `${t.x}px`), e.style.setProperty("--pluno-pa-panel-offset-y", `${t.y}px`);
|
|
1873
1873
|
}
|
|
1874
|
-
function
|
|
1874
|
+
function uo(e) {
|
|
1875
1875
|
e.style.removeProperty("--pluno-pa-panel-offset-x"), e.style.removeProperty("--pluno-pa-panel-offset-y");
|
|
1876
1876
|
}
|
|
1877
1877
|
function ee() {
|
|
@@ -1976,8 +1976,8 @@ function Qa(e, t) {
|
|
|
1976
1976
|
];
|
|
1977
1977
|
for (const [r, l] of o)
|
|
1978
1978
|
if (i >= l) {
|
|
1979
|
-
const
|
|
1980
|
-
return r === "min" ? `${
|
|
1979
|
+
const p = Math.max(1, Math.floor(i / l));
|
|
1980
|
+
return r === "min" ? `${p} min` : `${p} ${r}${p === 1 ? "" : "s"}`;
|
|
1981
1981
|
}
|
|
1982
1982
|
return "now";
|
|
1983
1983
|
}
|
|
@@ -2001,8 +2001,8 @@ function er(e, t, n, i, o) {
|
|
|
2001
2001
|
function tr(e, t, n, i) {
|
|
2002
2002
|
const o = document.createElement("form");
|
|
2003
2003
|
if (o.className = "pluno-pa-widget__launcher", i && o.classList.add("pluno-pa-widget__launcher--minimizable"), n) {
|
|
2004
|
-
const
|
|
2005
|
-
|
|
2004
|
+
const s = document.createElement("button");
|
|
2005
|
+
s.type = "button", s.className = "pluno-pa-widget__launcher-drag-handle", s.setAttribute("aria-label", "Move Pluno launcher"), s.title = "Move Pluno launcher", o.appendChild(s);
|
|
2006
2006
|
}
|
|
2007
2007
|
o.appendChild(
|
|
2008
2008
|
Go(
|
|
@@ -2019,10 +2019,10 @@ function tr(e, t, n, i) {
|
|
|
2019
2019
|
r.className = "pluno-pa-widget__launcher-run-indicator", o.appendChild(r);
|
|
2020
2020
|
const l = document.createElement("input");
|
|
2021
2021
|
l.className = "pluno-pa-widget__launcher-input", l.type = "text", l.placeholder = e, l.setAttribute("aria-label", e), o.appendChild(l);
|
|
2022
|
-
const
|
|
2023
|
-
if (
|
|
2024
|
-
const
|
|
2025
|
-
|
|
2022
|
+
const p = dt("Working...");
|
|
2023
|
+
if (p.classList.add("pluno-pa-widget__status--launcher"), o.appendChild(p), i) {
|
|
2024
|
+
const s = document.createElement("button");
|
|
2025
|
+
s.type = "button", s.className = "pluno-pa-widget__launcher-minimize", s.textContent = "-", s.setAttribute("aria-label", "Minimize Pluno on this site"), s.title = "Minimize Pluno on this site", o.appendChild(s);
|
|
2026
2026
|
}
|
|
2027
2027
|
return o;
|
|
2028
2028
|
}
|
|
@@ -2041,15 +2041,15 @@ function nr(e) {
|
|
|
2041
2041
|
r.className = "pluno-pa-widget__active-users-counter", r.hidden = !0, n.appendChild(r);
|
|
2042
2042
|
const l = document.createElement("button");
|
|
2043
2043
|
l.type = "button", l.className = "pluno-pa-widget__timeline-jump", l.textContent = "New messages ↓", l.hidden = !0, n.appendChild(l);
|
|
2044
|
-
const
|
|
2045
|
-
return
|
|
2044
|
+
const p = document.createElement("div");
|
|
2045
|
+
return p.className = "pluno-pa-widget__top-actions", p.appendChild(
|
|
2046
2046
|
It(
|
|
2047
2047
|
"pluno-pa-widget__history",
|
|
2048
2048
|
bn(),
|
|
2049
2049
|
gr(),
|
|
2050
2050
|
!0
|
|
2051
2051
|
)
|
|
2052
|
-
), n.appendChild(
|
|
2052
|
+
), n.appendChild(p), n.appendChild(rr()), t.appendChild(n), t.appendChild(or()), t.appendChild(ir()), t.appendChild(ar()), t.appendChild(Ce("left", "Resize Pluno from left")), t.appendChild(
|
|
2053
2053
|
Ce("right", "Resize Pluno from right")
|
|
2054
2054
|
), t.appendChild(Ce("top", "Resize Pluno from top")), t.appendChild(
|
|
2055
2055
|
Ce("bottom", "Resize Pluno from bottom")
|
|
@@ -2111,10 +2111,10 @@ function ar() {
|
|
|
2111
2111
|
r.className = "pluno-pa-widget__attachment-input", r.type = "file", r.multiple = !0, r.tabIndex = -1, r.setAttribute("aria-hidden", "true"), o.appendChild(r);
|
|
2112
2112
|
const l = document.createElement("button");
|
|
2113
2113
|
l.type = "button", l.className = "pluno-pa-widget__attach", l.setAttribute("aria-label", "Attach files"), l.title = "Attach files", l.appendChild(mr()), l.appendChild(fr()), o.appendChild(l);
|
|
2114
|
-
const
|
|
2115
|
-
|
|
2116
|
-
const
|
|
2117
|
-
|
|
2114
|
+
const p = document.createElement("textarea");
|
|
2115
|
+
p.className = "pluno-pa-widget__input", p.rows = 1, p.placeholder = "Ask for anything...", o.appendChild(p);
|
|
2116
|
+
const s = document.createElement("button");
|
|
2117
|
+
s.type = "button", s.className = "pluno-pa-widget__send", s.setAttribute("aria-label", "Send"), s.appendChild(qo()), o.appendChild(s), e.appendChild(o);
|
|
2118
2118
|
const c = document.createElement("div");
|
|
2119
2119
|
c.className = "pluno-pa-widget__composer-meta";
|
|
2120
2120
|
const g = document.createElement("a");
|
|
@@ -2170,8 +2170,8 @@ function Wo(e, t) {
|
|
|
2170
2170
|
);
|
|
2171
2171
|
}
|
|
2172
2172
|
function ke(e, t) {
|
|
2173
|
-
const n = `pluno-pa-character-${
|
|
2174
|
-
|
|
2173
|
+
const n = `pluno-pa-character-${io}`;
|
|
2174
|
+
io += 1;
|
|
2175
2175
|
const i = t.scribbleStyle ? sr(t.accentColor, n) : pr(t.accentColor, n), o = e.split(/\s+/).filter(Boolean);
|
|
2176
2176
|
return i.setAttribute(
|
|
2177
2177
|
"class",
|
|
@@ -2199,7 +2199,7 @@ function pr(e, t) {
|
|
|
2199
2199
|
gradientUnits: "userSpaceOnUse"
|
|
2200
2200
|
});
|
|
2201
2201
|
G(l, "0", n.top), G(l, "0.36", n.middle), G(l, "0.72", n.bottom), G(l, "1", n.bottom);
|
|
2202
|
-
const
|
|
2202
|
+
const p = x(r, "linearGradient", {
|
|
2203
2203
|
id: i.boltEdge,
|
|
2204
2204
|
x1: "470",
|
|
2205
2205
|
y1: "145",
|
|
@@ -2207,14 +2207,14 @@ function pr(e, t) {
|
|
|
2207
2207
|
y2: "980",
|
|
2208
2208
|
gradientUnits: "userSpaceOnUse"
|
|
2209
2209
|
});
|
|
2210
|
-
G(
|
|
2211
|
-
const
|
|
2210
|
+
G(p, "0", n.edgeStart), G(p, "0.32", n.edgeMiddle), G(p, "0.78", n.edgeEnd), G(p, "1", n.edgeEnd);
|
|
2211
|
+
const s = x(r, "radialGradient", {
|
|
2212
2212
|
id: i.boltGlow,
|
|
2213
2213
|
cx: "50%",
|
|
2214
2214
|
cy: "22%",
|
|
2215
2215
|
r: "82%"
|
|
2216
2216
|
});
|
|
2217
|
-
G(
|
|
2217
|
+
G(s, "0", n.glow, "0.72"), G(s, "0.5", n.middle, "0.44"), G(s, "1", n.bottom, "0");
|
|
2218
2218
|
const c = x(r, "radialGradient", {
|
|
2219
2219
|
id: i.eyeWhite,
|
|
2220
2220
|
cx: "35%",
|
|
@@ -2353,7 +2353,7 @@ function pr(e, t) {
|
|
|
2353
2353
|
opacity: "0.48"
|
|
2354
2354
|
});
|
|
2355
2355
|
const R = x(o, "g", { filter: J(i.eyeShadow) });
|
|
2356
|
-
return
|
|
2356
|
+
return go(
|
|
2357
2357
|
R,
|
|
2358
2358
|
"rotate(-2 528 463)",
|
|
2359
2359
|
"528",
|
|
@@ -2363,7 +2363,7 @@ function pr(e, t) {
|
|
|
2363
2363
|
"557",
|
|
2364
2364
|
"447",
|
|
2365
2365
|
i
|
|
2366
|
-
),
|
|
2366
|
+
), go(
|
|
2367
2367
|
R,
|
|
2368
2368
|
"rotate(2 717 462)",
|
|
2369
2369
|
"717",
|
|
@@ -2381,7 +2381,7 @@ function sr(e, t) {
|
|
|
2381
2381
|
wobble: `${t}-scribbleBoltWobble`
|
|
2382
2382
|
}, o = Ho(), r = x(o, "defs"), l = x(r, "clipPath", { id: i.clip });
|
|
2383
2383
|
x(l, "path", { d: kt });
|
|
2384
|
-
const
|
|
2384
|
+
const p = x(r, "filter", {
|
|
2385
2385
|
id: i.wobble,
|
|
2386
2386
|
x: "-10%",
|
|
2387
2387
|
y: "-10%",
|
|
@@ -2389,20 +2389,20 @@ function sr(e, t) {
|
|
|
2389
2389
|
height: "120%",
|
|
2390
2390
|
"color-interpolation-filters": "sRGB"
|
|
2391
2391
|
});
|
|
2392
|
-
x(
|
|
2392
|
+
x(p, "feTurbulence", {
|
|
2393
2393
|
type: "fractalNoise",
|
|
2394
2394
|
baseFrequency: "0.011",
|
|
2395
2395
|
numOctaves: "3",
|
|
2396
2396
|
seed: "7",
|
|
2397
2397
|
result: "noise"
|
|
2398
|
-
}), x(
|
|
2398
|
+
}), x(p, "feDisplacementMap", {
|
|
2399
2399
|
in: "SourceGraphic",
|
|
2400
2400
|
in2: "noise",
|
|
2401
2401
|
scale: "16",
|
|
2402
2402
|
xChannelSelector: "R",
|
|
2403
2403
|
yChannelSelector: "G"
|
|
2404
2404
|
});
|
|
2405
|
-
const
|
|
2405
|
+
const s = x(o, "g", { filter: J(i.wobble) }), c = x(s, "g", {
|
|
2406
2406
|
"clip-path": J(i.clip)
|
|
2407
2407
|
});
|
|
2408
2408
|
return x(c, "path", {
|
|
@@ -2414,14 +2414,14 @@ function sr(e, t) {
|
|
|
2414
2414
|
"stroke-linejoin": "round",
|
|
2415
2415
|
opacity: "0.9",
|
|
2416
2416
|
transform: "rotate(-14 627 600)"
|
|
2417
|
-
}), x(
|
|
2417
|
+
}), x(s, "path", {
|
|
2418
2418
|
d: kt,
|
|
2419
2419
|
fill: "none",
|
|
2420
2420
|
stroke: Lt,
|
|
2421
2421
|
"stroke-width": "18",
|
|
2422
2422
|
"stroke-linejoin": "round"
|
|
2423
|
-
}),
|
|
2424
|
-
|
|
2423
|
+
}), ho(
|
|
2424
|
+
s,
|
|
2425
2425
|
"rotate(-2 528 463)",
|
|
2426
2426
|
"528",
|
|
2427
2427
|
"463",
|
|
@@ -2429,8 +2429,8 @@ function sr(e, t) {
|
|
|
2429
2429
|
"473",
|
|
2430
2430
|
"557",
|
|
2431
2431
|
"447"
|
|
2432
|
-
),
|
|
2433
|
-
|
|
2432
|
+
), ho(
|
|
2433
|
+
s,
|
|
2434
2434
|
"rotate(2 717 462)",
|
|
2435
2435
|
"717",
|
|
2436
2436
|
"462",
|
|
@@ -2446,31 +2446,31 @@ function Ho() {
|
|
|
2446
2446
|
viewBox: "0 0 1254 1254"
|
|
2447
2447
|
});
|
|
2448
2448
|
}
|
|
2449
|
-
function
|
|
2449
|
+
function go(e, t, n, i, o, r, l, p, s) {
|
|
2450
2450
|
const c = x(e, "g", { transform: t });
|
|
2451
2451
|
x(c, "ellipse", {
|
|
2452
2452
|
cx: n,
|
|
2453
2453
|
cy: i,
|
|
2454
2454
|
rx: "73",
|
|
2455
2455
|
ry: "80",
|
|
2456
|
-
fill: J(
|
|
2456
|
+
fill: J(s.eyeWhite)
|
|
2457
2457
|
}), x(c, "ellipse", {
|
|
2458
2458
|
cx: o,
|
|
2459
2459
|
cy: r,
|
|
2460
2460
|
rx: "49",
|
|
2461
2461
|
ry: "57",
|
|
2462
|
-
fill: J(
|
|
2463
|
-
filter: J(
|
|
2462
|
+
fill: J(s.pupil),
|
|
2463
|
+
filter: J(s.pupilGloss)
|
|
2464
2464
|
}), x(c, "circle", {
|
|
2465
2465
|
cx: l,
|
|
2466
|
-
cy:
|
|
2466
|
+
cy: p,
|
|
2467
2467
|
r: "18",
|
|
2468
2468
|
fill: "#ffffff"
|
|
2469
2469
|
});
|
|
2470
2470
|
}
|
|
2471
|
-
function
|
|
2472
|
-
const
|
|
2473
|
-
x(
|
|
2471
|
+
function ho(e, t, n, i, o, r, l, p) {
|
|
2472
|
+
const s = x(e, "g", { transform: t });
|
|
2473
|
+
x(s, "ellipse", {
|
|
2474
2474
|
cx: n,
|
|
2475
2475
|
cy: i,
|
|
2476
2476
|
rx: "73",
|
|
@@ -2478,15 +2478,15 @@ function go(e, t, n, i, o, r, l, s) {
|
|
|
2478
2478
|
fill: "#ffffff",
|
|
2479
2479
|
stroke: Lt,
|
|
2480
2480
|
"stroke-width": "13"
|
|
2481
|
-
}), x(
|
|
2481
|
+
}), x(s, "ellipse", {
|
|
2482
2482
|
cx: o,
|
|
2483
2483
|
cy: r,
|
|
2484
2484
|
rx: "45",
|
|
2485
2485
|
ry: "53",
|
|
2486
2486
|
fill: Lt
|
|
2487
|
-
}), x(
|
|
2487
|
+
}), x(s, "circle", {
|
|
2488
2488
|
cx: l,
|
|
2489
|
-
cy:
|
|
2489
|
+
cy: p,
|
|
2490
2490
|
r: "16",
|
|
2491
2491
|
fill: "#ffffff"
|
|
2492
2492
|
});
|
|
@@ -2552,7 +2552,7 @@ function $o(e, t) {
|
|
|
2552
2552
|
`0 0 ${n} ${ka}`
|
|
2553
2553
|
), e.replaceChildren();
|
|
2554
2554
|
for (let i = 0; i < t; i += 1) {
|
|
2555
|
-
const o =
|
|
2555
|
+
const o = oo[i % oo.length], r = A("g", {
|
|
2556
2556
|
transform: `translate(${hn + i * gn} 0)`
|
|
2557
2557
|
});
|
|
2558
2558
|
r.appendChild(
|
|
@@ -2781,7 +2781,7 @@ function A(e, t = {}) {
|
|
|
2781
2781
|
n.setAttribute(i, o);
|
|
2782
2782
|
return n;
|
|
2783
2783
|
}
|
|
2784
|
-
function
|
|
2784
|
+
function mo(e) {
|
|
2785
2785
|
for (const t of ["keydown", "keypress", "keyup"])
|
|
2786
2786
|
e.addEventListener(t, (n) => {
|
|
2787
2787
|
n.stopPropagation();
|
|
@@ -2794,12 +2794,12 @@ function xr(e, t, n) {
|
|
|
2794
2794
|
r.className = "pluno-pa-widget__attachment", r.appendChild(yr(o));
|
|
2795
2795
|
const l = document.createElement("span");
|
|
2796
2796
|
l.textContent = o.name, r.appendChild(l);
|
|
2797
|
-
const
|
|
2798
|
-
|
|
2797
|
+
const p = document.createElement("button");
|
|
2798
|
+
p.type = "button", p.setAttribute("aria-label", `Remove ${o.name}`), p.appendChild(br()), p.addEventListener("click", () => n(i)), r.appendChild(p), e.appendChild(r);
|
|
2799
2799
|
}
|
|
2800
2800
|
}
|
|
2801
2801
|
function yr(e) {
|
|
2802
|
-
const t =
|
|
2802
|
+
const t = En(e), n = jo(e);
|
|
2803
2803
|
if (t === "image" && n) {
|
|
2804
2804
|
const i = document.createElement("img");
|
|
2805
2805
|
return i.src = n, i.alt = "", i.setAttribute("aria-hidden", "true"), i.addEventListener(
|
|
@@ -2820,7 +2820,7 @@ function yr(e) {
|
|
|
2820
2820
|
return se(e);
|
|
2821
2821
|
}
|
|
2822
2822
|
function vr(e, t) {
|
|
2823
|
-
const n =
|
|
2823
|
+
const n = En(e), i = jo(e);
|
|
2824
2824
|
if (n === "image" && i) {
|
|
2825
2825
|
const o = document.createElement("img");
|
|
2826
2826
|
o.className = "pluno-pa-widget__message-attachment-preview", o.alt = e.name;
|
|
@@ -2862,23 +2862,23 @@ function vr(e, t) {
|
|
|
2862
2862
|
function se(e, t = "composer") {
|
|
2863
2863
|
if (t === "composer") {
|
|
2864
2864
|
const r = document.createElement("span");
|
|
2865
|
-
return r.className = "pluno-pa-widget__attachment-file", r.textContent =
|
|
2865
|
+
return r.className = "pluno-pa-widget__attachment-file", r.textContent = fo(e), r;
|
|
2866
2866
|
}
|
|
2867
2867
|
const n = document.createElement("div");
|
|
2868
2868
|
n.className = "pluno-pa-widget__message-attachment-file";
|
|
2869
2869
|
const i = document.createElement("span");
|
|
2870
|
-
i.textContent =
|
|
2870
|
+
i.textContent = fo(e);
|
|
2871
2871
|
const o = document.createElement("strong");
|
|
2872
2872
|
return o.textContent = e.name, n.append(i, o), n;
|
|
2873
2873
|
}
|
|
2874
|
-
function
|
|
2874
|
+
function En(e) {
|
|
2875
2875
|
return e.mimeType.startsWith("image/") ? "image" : e.mimeType === "application/pdf" ? "pdf" : e.mimeType.startsWith("video/") ? "video" : "file";
|
|
2876
2876
|
}
|
|
2877
2877
|
function jo(e) {
|
|
2878
2878
|
return "previewUrl" in e && e.previewUrl ? e.previewUrl : e.fileUrl ?? "";
|
|
2879
2879
|
}
|
|
2880
|
-
function
|
|
2881
|
-
const t =
|
|
2880
|
+
function fo(e) {
|
|
2881
|
+
const t = En(e);
|
|
2882
2882
|
return t === "image" ? "IMG" : t === "pdf" ? "PDF" : t === "video" ? "VID" : "FILE";
|
|
2883
2883
|
}
|
|
2884
2884
|
function Sr(e, t) {
|
|
@@ -2898,23 +2898,30 @@ function ln(e, t, n = null) {
|
|
|
2898
2898
|
e && (e.hidden = !0, e.replaceChildren());
|
|
2899
2899
|
return;
|
|
2900
2900
|
}
|
|
2901
|
-
e.hidden = !1, e.replaceChildren(), e.className = "pluno-pa-widget__billing-status", le(t) ||
|
|
2901
|
+
e.hidden = !1, e.replaceChildren(), e.className = "pluno-pa-widget__billing-status", le(t) || kn(n) ? e.appendChild(
|
|
2902
2902
|
Er(t, n)
|
|
2903
2903
|
) : Ko(t) && e.appendChild(kr(t));
|
|
2904
2904
|
}
|
|
2905
2905
|
function Er(e, t) {
|
|
2906
2906
|
const n = document.createElement("div");
|
|
2907
2907
|
n.className = "pluno-pa-widget__billing-action-card";
|
|
2908
|
-
const i = e.limitExceeded || t === "limit_exceeded", o = document.createElement("strong");
|
|
2909
|
-
|
|
2910
|
-
const
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
"
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2908
|
+
const i = e.limitExceeded || t === "limit_exceeded", o = i && e.onboardingIncomplete === !0, r = document.createElement("strong");
|
|
2909
|
+
r.textContent = o ? "Complete onboarding" : i ? "Credits used up" : "Billing needs attention", n.appendChild(r);
|
|
2910
|
+
const l = document.createElement("span");
|
|
2911
|
+
if (l.textContent = o ? "Complete onboarding to unlock credits and start using Pluno." : i ? "Earn bonus credits or upgrade to keep using Pluno on this product." : e.paymentIssue ?? "Open billing to keep using Pluno.", n.appendChild(l), o) {
|
|
2912
|
+
const p = document.createElement("div");
|
|
2913
|
+
p.className = "pluno-pa-widget__billing-action-card-actions", p.appendChild(
|
|
2914
|
+
xn("Complete onboarding", e.onboardingUrl ?? "")
|
|
2915
|
+
), n.appendChild(p);
|
|
2916
|
+
} else
|
|
2917
|
+
n.appendChild(
|
|
2918
|
+
Vo(
|
|
2919
|
+
e,
|
|
2920
|
+
"Upgrade plan",
|
|
2921
|
+
"pluno-pa-widget__billing-action-card-actions"
|
|
2922
|
+
)
|
|
2923
|
+
);
|
|
2924
|
+
return n;
|
|
2918
2925
|
}
|
|
2919
2926
|
function kr(e) {
|
|
2920
2927
|
const t = document.createElement("div");
|
|
@@ -2931,9 +2938,9 @@ function kr(e) {
|
|
|
2931
2938
|
), t;
|
|
2932
2939
|
}
|
|
2933
2940
|
function _n(e, t) {
|
|
2934
|
-
return e !== null && (le(e) || Ko(e) ||
|
|
2941
|
+
return e !== null && (le(e) || Ko(e) || kn(t));
|
|
2935
2942
|
}
|
|
2936
|
-
function
|
|
2943
|
+
function wo(e, t, n) {
|
|
2937
2944
|
return _n(t, n) || Lr(t) ? !0 : !_n(e, n);
|
|
2938
2945
|
}
|
|
2939
2946
|
function Lr(e) {
|
|
@@ -2942,7 +2949,7 @@ function Lr(e) {
|
|
|
2942
2949
|
function le(e) {
|
|
2943
2950
|
return e?.limitExceeded === !0 || !!e?.paymentIssue;
|
|
2944
2951
|
}
|
|
2945
|
-
function
|
|
2952
|
+
function kn(e) {
|
|
2946
2953
|
return e === "limit_exceeded" || e === "subscription_required" || e === "subscription_inactive" || e === "payment_issue" || e === "subscription_invalid" || e === "payment_required";
|
|
2947
2954
|
}
|
|
2948
2955
|
function Ko(e) {
|
|
@@ -2959,12 +2966,12 @@ function Ar(e) {
|
|
|
2959
2966
|
function Vo(e, t, n) {
|
|
2960
2967
|
const i = document.createElement("div");
|
|
2961
2968
|
return i.className = n, i.appendChild(
|
|
2962
|
-
|
|
2969
|
+
xn(t, e.pricingUrl)
|
|
2963
2970
|
), i.appendChild(
|
|
2964
|
-
|
|
2971
|
+
xn("Earn credits", e.earnCreditsUrl)
|
|
2965
2972
|
), i;
|
|
2966
2973
|
}
|
|
2967
|
-
function
|
|
2974
|
+
function xn(e, t) {
|
|
2968
2975
|
const n = document.createElement("button");
|
|
2969
2976
|
if (n.type = "button", e === "Earn credits") {
|
|
2970
2977
|
const i = document.createElement("span");
|
|
@@ -2980,13 +2987,13 @@ function pn(e, t) {
|
|
|
2980
2987
|
(i) => !Xo(i)
|
|
2981
2988
|
).length === 0 && !e.assistantDraft && !e.lastError && !e.isThinking && !t;
|
|
2982
2989
|
}
|
|
2983
|
-
function Ir(e, t, n, i, o, r, l,
|
|
2990
|
+
function Ir(e, t, n, i, o, r, l, p, s, c, g, h, m, v, E, O, u, F, w, R, M, L) {
|
|
2984
2991
|
const te = Mr(r), W = Dr(
|
|
2985
2992
|
te.filter((S) => !Xo(S))
|
|
2986
2993
|
), Ye = e.scrollTop, Be = [], ce = /* @__PURE__ */ new Set(), U = (S) => {
|
|
2987
2994
|
Be.push(S);
|
|
2988
2995
|
};
|
|
2989
|
-
Qo(n, r.isThinking), o.hidden = !
|
|
2996
|
+
Qo(n, r.isThinking), o.hidden = !p, p && l !== null && Wo(o, l);
|
|
2990
2997
|
const y = W.length > 0 || !!r.assistantDraft || r.isThinking;
|
|
2991
2998
|
if (i(y), u || W.length === 0 && !r.assistantDraft && !r.lastError && !r.isThinking) {
|
|
2992
2999
|
const S = document.createElement("div");
|
|
@@ -3026,7 +3033,7 @@ function Ir(e, t, n, i, o, r, l, s, p, c, g, h, m, v, E, O, u, F, w, R, M, L) {
|
|
|
3026
3033
|
return;
|
|
3027
3034
|
}
|
|
3028
3035
|
let B = null, $ = null, X = [], Le = [];
|
|
3029
|
-
const K = W.length - 1, ct = K >= 0 &&
|
|
3036
|
+
const K = W.length - 1, ct = K >= 0 && yn(W[K]), Te = Or(W);
|
|
3030
3037
|
let ue = !1;
|
|
3031
3038
|
const ge = () => {
|
|
3032
3039
|
if (X.length === 0)
|
|
@@ -3065,7 +3072,7 @@ function Ir(e, t, n, i, o, r, l, s, p, c, g, h, m, v, E, O, u, F, w, R, M, L) {
|
|
|
3065
3072
|
X.push(T);
|
|
3066
3073
|
continue;
|
|
3067
3074
|
}
|
|
3068
|
-
if (
|
|
3075
|
+
if (yn(T)) {
|
|
3069
3076
|
if (S !== K)
|
|
3070
3077
|
continue;
|
|
3071
3078
|
if (ge()) {
|
|
@@ -3083,7 +3090,7 @@ function Ir(e, t, n, i, o, r, l, s, p, c, g, h, m, v, E, O, u, F, w, R, M, L) {
|
|
|
3083
3090
|
if (T.dataType === "run_error" || T.dataType === "run_status") {
|
|
3084
3091
|
ge();
|
|
3085
3092
|
const b = document.createElement("div"), k = T.dataType === "run_error";
|
|
3086
|
-
if (b.className = k ? "pluno-pa-widget__error" : "pluno-pa-widget__status pluno-pa-widget__run-status", b.textContent =
|
|
3093
|
+
if (b.className = k ? "pluno-pa-widget__error" : "pluno-pa-widget__status pluno-pa-widget__run-status", b.textContent = vn(
|
|
3087
3094
|
T.content
|
|
3088
3095
|
), k && T.securitySettingsUrl) {
|
|
3089
3096
|
const q = document.createElement("a");
|
|
@@ -3094,7 +3101,7 @@ function Ir(e, t, n, i, o, r, l, s, p, c, g, h, m, v, E, O, u, F, w, R, M, L) {
|
|
|
3094
3101
|
continue;
|
|
3095
3102
|
}
|
|
3096
3103
|
T.role === "user" && z();
|
|
3097
|
-
const P = ge(), ye =
|
|
3104
|
+
const P = ge(), ye = vn(T.content);
|
|
3098
3105
|
if (T.role === "assistant" && !P) {
|
|
3099
3106
|
const b = Jo(v());
|
|
3100
3107
|
U(b), B = null, $ = b;
|
|
@@ -3157,7 +3164,7 @@ function Ir(e, t, n, i, o, r, l, s, p, c, g, h, m, v, E, O, u, F, w, R, M, L) {
|
|
|
3157
3164
|
), U(t), zr(
|
|
3158
3165
|
h,
|
|
3159
3166
|
ce
|
|
3160
|
-
), bo(e, Be),
|
|
3167
|
+
), bo(e, Be), s ? pt(e, c) : e.scrollTop = Ye;
|
|
3161
3168
|
}
|
|
3162
3169
|
function Pr(e, t, n) {
|
|
3163
3170
|
const i = document.createElement("section");
|
|
@@ -3169,13 +3176,13 @@ function Pr(e, t, n) {
|
|
|
3169
3176
|
}
|
|
3170
3177
|
const r = document.createElement("div"), l = document.createElement("strong");
|
|
3171
3178
|
l.textContent = `Connect ${e.appName}`;
|
|
3172
|
-
const
|
|
3173
|
-
if (
|
|
3179
|
+
const p = document.createElement("span");
|
|
3180
|
+
if (p.textContent = "Authenticate in this browser so Pluno can continue your task.", r.append(l, p), o.appendChild(r), i.appendChild(o), t.error) {
|
|
3174
3181
|
const c = document.createElement("div");
|
|
3175
3182
|
c.className = "pluno-pa-widget__integration-auth-error", c.textContent = t.error, i.appendChild(c);
|
|
3176
3183
|
}
|
|
3177
|
-
const
|
|
3178
|
-
return
|
|
3184
|
+
const s = document.createElement("button");
|
|
3185
|
+
return s.type = "button", s.className = "pluno-pa-widget__integration-auth-button", s.disabled = t.status === "checking" || t.status === "connecting" || t.status === "completed", t.status === "checking" ? s.textContent = "Checking connection..." : t.status === "connecting" ? s.textContent = "Connecting..." : t.status === "completed" ? s.textContent = "Connected" : t.status === "expired" || t.status === "cancelled" ? s.textContent = `Reconnect ${e.appName}` : t.status === "error" ? s.textContent = "Try again" : s.textContent = `Connect ${e.appName}`, s.addEventListener("click", () => n(e)), i.appendChild(s), i;
|
|
3179
3186
|
}
|
|
3180
3187
|
function Nr(e, t, n, i, o) {
|
|
3181
3188
|
const r = Rr(e, t), l = r ? n.get(r) : void 0;
|
|
@@ -3183,17 +3190,17 @@ function Nr(e, t, n, i, o) {
|
|
|
3183
3190
|
return l.classList.remove(
|
|
3184
3191
|
"pluno-pa-widget__message--bottom-reserve"
|
|
3185
3192
|
), i.add(r), l;
|
|
3186
|
-
const
|
|
3187
|
-
if (
|
|
3193
|
+
const p = document.createElement("div");
|
|
3194
|
+
if (p.className = `pluno-pa-widget__message pluno-pa-widget__message--${e.role}`, e.role === "assistant" ? (e.phase && (p.dataset.phase = e.phase), Zr(p, t)) : p.textContent = t, e.role === "user" && e.attachments?.length && p.appendChild(
|
|
3188
3195
|
Fr(
|
|
3189
3196
|
e.attachments,
|
|
3190
3197
|
o
|
|
3191
3198
|
)
|
|
3192
3199
|
), e.phase !== "commentary") {
|
|
3193
|
-
const
|
|
3194
|
-
|
|
3200
|
+
const s = document.createElement("div");
|
|
3201
|
+
s.className = "pluno-pa-widget__message-actions", s.appendChild(Wr(t)), p.appendChild(s);
|
|
3195
3202
|
}
|
|
3196
|
-
return r && (n.set(r,
|
|
3203
|
+
return r && (n.set(r, p), i.add(r)), p;
|
|
3197
3204
|
}
|
|
3198
3205
|
function Rr(e, t) {
|
|
3199
3206
|
return e.role !== "user" || !e.attachments?.length ? null : JSON.stringify({
|
|
@@ -3252,7 +3259,7 @@ function Mr(e) {
|
|
|
3252
3259
|
if (n === -1)
|
|
3253
3260
|
return [...e.messages, t];
|
|
3254
3261
|
const i = e.messages.findIndex(
|
|
3255
|
-
(r, l) => l > n && r.role !== "user" && r.respondsToUserMessageId === t.respondsToUserMessageId && _o(r, t) &&
|
|
3262
|
+
(r, l) => l > n && r.role !== "user" && r.respondsToUserMessageId === t.respondsToUserMessageId && _o(r, t) && yn(r)
|
|
3256
3263
|
);
|
|
3257
3264
|
if (i !== -1)
|
|
3258
3265
|
return [
|
|
@@ -3294,30 +3301,30 @@ function Br(e) {
|
|
|
3294
3301
|
function Yo(e, t) {
|
|
3295
3302
|
return e.respondsToUserMessageId && t.respondsToUserMessageId ? e.respondsToUserMessageId === t.respondsToUserMessageId : e.runId && t.runId ? e.runId === t.runId : e.id === t.id;
|
|
3296
3303
|
}
|
|
3297
|
-
function
|
|
3304
|
+
function yn(e) {
|
|
3298
3305
|
return e.role === "system" && e.dataType === "run_status" && e.loading === !0;
|
|
3299
3306
|
}
|
|
3300
3307
|
function _o(e, t) {
|
|
3301
3308
|
return !e.runId || !t.runId ? !0 : e.runId === t.runId;
|
|
3302
3309
|
}
|
|
3303
|
-
function xo(e, t, n, i, o, r, l,
|
|
3310
|
+
function xo(e, t, n, i, o, r, l, p) {
|
|
3304
3311
|
e.replaceChildren(), Qo(t, !1), t.disabled = !0, n(!1);
|
|
3305
|
-
const
|
|
3306
|
-
|
|
3312
|
+
const s = document.createElement("div");
|
|
3313
|
+
s.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter";
|
|
3307
3314
|
const c = ke(
|
|
3308
3315
|
"pluno-pa-widget__character--empty",
|
|
3309
3316
|
i()
|
|
3310
3317
|
);
|
|
3311
|
-
|
|
3318
|
+
s.appendChild(c);
|
|
3312
3319
|
const g = document.createElement("div");
|
|
3313
|
-
if (g.className = "pluno-pa-widget__empty", g.textContent = o,
|
|
3320
|
+
if (g.className = "pluno-pa-widget__empty", g.textContent = o, s.appendChild(g), l) {
|
|
3314
3321
|
const h = document.createElement("a");
|
|
3315
|
-
h.className = "pluno-pa-widget__login", h.href = l, h.target = "_blank", h.rel = "noopener noreferrer", h.textContent = r,
|
|
3322
|
+
h.className = "pluno-pa-widget__login", h.href = l, h.target = "_blank", h.rel = "noopener noreferrer", h.textContent = r, s.appendChild(h);
|
|
3316
3323
|
} else {
|
|
3317
3324
|
const h = document.createElement("button");
|
|
3318
|
-
h.type = "button", h.className = "pluno-pa-widget__login", h.textContent = r, h.addEventListener("click", () =>
|
|
3325
|
+
h.type = "button", h.className = "pluno-pa-widget__login", h.textContent = r, h.addEventListener("click", () => p?.()), s.appendChild(h);
|
|
3319
3326
|
}
|
|
3320
|
-
e.appendChild(
|
|
3327
|
+
e.appendChild(s);
|
|
3321
3328
|
}
|
|
3322
3329
|
function Fr(e, t) {
|
|
3323
3330
|
const n = document.createElement("div");
|
|
@@ -3348,26 +3355,26 @@ function Hr(e, t) {
|
|
|
3348
3355
|
r.className = "pluno-pa-widget__share-prompt-copy";
|
|
3349
3356
|
const l = document.createElement("strong");
|
|
3350
3357
|
l.textContent = n === "referral" ? "Know someone who'd love this?" : "Share Pluno, earn 2,000 credits", r.appendChild(l);
|
|
3351
|
-
const
|
|
3358
|
+
const p = document.createElement("span");
|
|
3352
3359
|
if (n === "referral")
|
|
3353
|
-
|
|
3360
|
+
p.textContent = "Give them 2,000 free credits—and earn 2,000 when they try Pluno.";
|
|
3354
3361
|
else {
|
|
3355
|
-
if (
|
|
3362
|
+
if (p.appendChild(
|
|
3356
3363
|
document.createTextNode("Post on LinkedIn, X, or Instagram, then ")
|
|
3357
3364
|
), t.socialPostRewardsUrl) {
|
|
3358
3365
|
const m = document.createElement("a");
|
|
3359
|
-
m.className = "pluno-pa-widget__share-prompt-reward", m.href = t.socialPostRewardsUrl, m.target = "_blank", m.rel = "noopener noreferrer", m.textContent = "submit your post URL",
|
|
3366
|
+
m.className = "pluno-pa-widget__share-prompt-reward", m.href = t.socialPostRewardsUrl, m.target = "_blank", m.rel = "noopener noreferrer", m.textContent = "submit your post URL", p.appendChild(m);
|
|
3360
3367
|
} else
|
|
3361
|
-
|
|
3362
|
-
|
|
3368
|
+
p.appendChild(document.createTextNode("submit your post URL"));
|
|
3369
|
+
p.appendChild(document.createTextNode(" for approval."));
|
|
3363
3370
|
}
|
|
3364
|
-
if (r.appendChild(
|
|
3371
|
+
if (r.appendChild(p), t.error) {
|
|
3365
3372
|
const m = document.createElement("span");
|
|
3366
3373
|
m.className = "pluno-pa-widget__share-prompt-error", m.textContent = t.error, r.appendChild(m);
|
|
3367
3374
|
}
|
|
3368
3375
|
o.appendChild(r);
|
|
3369
|
-
const
|
|
3370
|
-
|
|
3376
|
+
const s = document.createElement("div");
|
|
3377
|
+
s.className = "pluno-pa-widget__share-prompt-actions";
|
|
3371
3378
|
const c = document.createElement("div");
|
|
3372
3379
|
if (c.className = "pluno-pa-widget__share-prompt-primary-actions", n === "referral") {
|
|
3373
3380
|
const m = document.createElement("button");
|
|
@@ -3380,9 +3387,9 @@ function Hr(e, t) {
|
|
|
3380
3387
|
v.className = "pluno-pa-widget__share-prompt-social", v.href = m.href, v.target = "_blank", v.rel = "noopener noreferrer", v.setAttribute("aria-label", `Open ${m.label}`), v.title = m.label, v.appendChild($r(m.id)), v.addEventListener("click", () => t.onSocialShare(e)), c.appendChild(v);
|
|
3381
3388
|
}
|
|
3382
3389
|
const g = document.createElement("button");
|
|
3383
|
-
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", () => t.onDismiss(e)), c.appendChild(g),
|
|
3390
|
+
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", () => t.onDismiss(e)), c.appendChild(g), s.appendChild(c);
|
|
3384
3391
|
const h = document.createElement("button");
|
|
3385
|
-
return h.type = "button", h.className = "pluno-pa-widget__share-prompt-disable", h.textContent = "Don't ask again", h.addEventListener("click", () => t.onDisable(e)),
|
|
3392
|
+
return h.type = "button", h.className = "pluno-pa-widget__share-prompt-disable", h.textContent = "Don't ask again", h.addEventListener("click", () => t.onDisable(e)), s.appendChild(h), o.appendChild(s), i.appendChild(o), i;
|
|
3386
3393
|
}
|
|
3387
3394
|
function Gr() {
|
|
3388
3395
|
const e = "https://pluno.ai/browser", t = `I just used @pluno_ai to get work done directly inside my tools. Worth trying: ${e}`;
|
|
@@ -3416,7 +3423,7 @@ function $r(e) {
|
|
|
3416
3423
|
function Xo(e) {
|
|
3417
3424
|
return e.role === "tool" && e.toolName === Ao;
|
|
3418
3425
|
}
|
|
3419
|
-
function
|
|
3426
|
+
function vn(e) {
|
|
3420
3427
|
return e.replace(/\uE200[^\uE201]*(?:\uE201|$)/g, "");
|
|
3421
3428
|
}
|
|
3422
3429
|
function qr(e, t, n, i, o) {
|
|
@@ -3434,9 +3441,9 @@ function qr(e, t, n, i, o) {
|
|
|
3434
3441
|
const E = document.createElement("div");
|
|
3435
3442
|
return E.className = "pluno-pa-widget__tool-active-content", E.appendChild(dt()), E.appendChild(l), r.appendChild(E), r;
|
|
3436
3443
|
}
|
|
3437
|
-
const
|
|
3438
|
-
|
|
3439
|
-
r.classList.toggle("pluno-pa-widget__tool-group--open",
|
|
3444
|
+
const p = document.createElement("details"), s = Kr(e);
|
|
3445
|
+
p.open = n.has(s), r.classList.toggle("pluno-pa-widget__tool-group--open", p.open), p.addEventListener("toggle", () => {
|
|
3446
|
+
r.classList.toggle("pluno-pa-widget__tool-group--open", p.open), p.open ? n.add(s) : n.delete(s), i();
|
|
3440
3447
|
});
|
|
3441
3448
|
const c = document.createElement("summary");
|
|
3442
3449
|
c.className = "pluno-pa-widget__tool-summary";
|
|
@@ -3445,7 +3452,7 @@ function qr(e, t, n, i, o) {
|
|
|
3445
3452
|
), m = document.createElement("span");
|
|
3446
3453
|
m.className = "pluno-pa-widget__tool-summary-title";
|
|
3447
3454
|
const v = g ? Zo(g.content) : "Activity";
|
|
3448
|
-
return m.textContent = v, h && (m.classList.add("pluno-pa-widget__tool-summary-title--loading"), m.dataset.loadingText = v), c.appendChild(m),
|
|
3455
|
+
return m.textContent = v, h && (m.classList.add("pluno-pa-widget__tool-summary-title--loading"), m.dataset.loadingText = v), c.appendChild(m), p.appendChild(c), p.appendChild(l), r.appendChild(p), r;
|
|
3449
3456
|
}
|
|
3450
3457
|
function jr(e, t) {
|
|
3451
3458
|
const n = document.createElement("div");
|
|
@@ -3456,8 +3463,8 @@ function jr(e, t) {
|
|
|
3456
3463
|
r.className = "pluno-pa-widget__tool-line", r.dataset.eventType = o.phase === "commentary" ? "commentary" : "tool";
|
|
3457
3464
|
const l = document.createElement("span");
|
|
3458
3465
|
l.className = "pluno-pa-widget__tool-line-text";
|
|
3459
|
-
const
|
|
3460
|
-
t && o === i && o.phase !== "commentary" && (l.classList.add("pluno-pa-widget__tool-line-text--loading"), l.dataset.loadingText =
|
|
3466
|
+
const p = vn(o.content) || (o.phase === "commentary" ? "" : "Run tool"), s = o.phase === "commentary" ? p : Zo(p);
|
|
3467
|
+
t && o === i && o.phase !== "commentary" && (l.classList.add("pluno-pa-widget__tool-line-text--loading"), l.dataset.loadingText = s), l.textContent = s, r.appendChild(l), n.appendChild(r);
|
|
3461
3468
|
}
|
|
3462
3469
|
return n;
|
|
3463
3470
|
}
|
|
@@ -3527,11 +3534,11 @@ function Xr(e, t) {
|
|
|
3527
3534
|
}
|
|
3528
3535
|
const r = document.createElement("div");
|
|
3529
3536
|
r.className = "pluno-pa-widget__table-scroll";
|
|
3530
|
-
const l = document.createElement("table"),
|
|
3537
|
+
const l = document.createElement("table"), p = document.createElement("thead"), s = document.createElement("tr");
|
|
3531
3538
|
n.forEach((h, m) => {
|
|
3532
3539
|
const v = document.createElement("th"), E = o[m];
|
|
3533
|
-
E && v.classList.add(`pluno-pa-widget__table-cell--${E}`), Ee(v, h),
|
|
3534
|
-
}),
|
|
3540
|
+
E && v.classList.add(`pluno-pa-widget__table-cell--${E}`), Ee(v, h), s.appendChild(v);
|
|
3541
|
+
}), p.appendChild(s), l.appendChild(p);
|
|
3535
3542
|
const c = document.createElement("tbody");
|
|
3536
3543
|
let g = t + 2;
|
|
3537
3544
|
for (; g < e.length && e[g].trim(); ) {
|
|
@@ -3572,10 +3579,10 @@ function Zr(e, t) {
|
|
|
3572
3579
|
e.appendChild(l.element), i = l.nextIndex;
|
|
3573
3580
|
continue;
|
|
3574
3581
|
}
|
|
3575
|
-
const
|
|
3576
|
-
if (
|
|
3577
|
-
const h = document.createElement(`h${
|
|
3578
|
-
Ee(h,
|
|
3582
|
+
const p = o.match(/^(#{1,3})\s+(.+)$/);
|
|
3583
|
+
if (p) {
|
|
3584
|
+
const h = document.createElement(`h${p[1].length + 2}`);
|
|
3585
|
+
Ee(h, p[2]), e.appendChild(h), i += 1;
|
|
3579
3586
|
continue;
|
|
3580
3587
|
}
|
|
3581
3588
|
if (/^\s*[-*+]\s+/.test(o)) {
|
|
@@ -3587,10 +3594,10 @@ function Zr(e, t) {
|
|
|
3587
3594
|
e.appendChild(h);
|
|
3588
3595
|
continue;
|
|
3589
3596
|
}
|
|
3590
|
-
const
|
|
3591
|
-
if (
|
|
3597
|
+
const s = o.match(/^\s*(\d+)\.\s+/);
|
|
3598
|
+
if (s) {
|
|
3592
3599
|
const h = document.createElement("ol");
|
|
3593
|
-
for (h.start = Number(
|
|
3600
|
+
for (h.start = Number(s[1]); i < n.length && /^\s*\d+\.\s+/.test(n[i]); ) {
|
|
3594
3601
|
const m = document.createElement("li");
|
|
3595
3602
|
Ee(m, n[i].replace(/^\s*\d+\.\s+/, "")), h.appendChild(m), i += 1;
|
|
3596
3603
|
}
|
|
@@ -3616,19 +3623,19 @@ function Ee(e, t) {
|
|
|
3616
3623
|
);
|
|
3617
3624
|
const l = o[0];
|
|
3618
3625
|
if (l.startsWith("`")) {
|
|
3619
|
-
const
|
|
3620
|
-
|
|
3626
|
+
const p = document.createElement("code");
|
|
3627
|
+
p.textContent = l.slice(1, -1), e.appendChild(p);
|
|
3621
3628
|
} else if (l.startsWith("**")) {
|
|
3622
|
-
const
|
|
3623
|
-
Ee(
|
|
3629
|
+
const p = document.createElement("strong");
|
|
3630
|
+
Ee(p, l.slice(2, -2)), e.appendChild(p);
|
|
3624
3631
|
} else if (l.startsWith("*")) {
|
|
3625
|
-
const
|
|
3626
|
-
Ee(
|
|
3632
|
+
const p = document.createElement("em");
|
|
3633
|
+
Ee(p, l.slice(1, -1)), e.appendChild(p);
|
|
3627
3634
|
} else {
|
|
3628
|
-
const
|
|
3629
|
-
if (
|
|
3630
|
-
const
|
|
3631
|
-
|
|
3635
|
+
const p = l.match(/^\[([^\]]+)\]\(([^)\s]+)\)$/);
|
|
3636
|
+
if (p && Jr(p[2])) {
|
|
3637
|
+
const s = document.createElement("a");
|
|
3638
|
+
s.href = p[2], s.target = "_top", s.rel = "noreferrer", s.textContent = p[1], e.appendChild(s);
|
|
3632
3639
|
} else
|
|
3633
3640
|
e.appendChild(document.createTextNode(l));
|
|
3634
3641
|
}
|
|
@@ -6128,11 +6135,11 @@ async function tl() {
|
|
|
6128
6135
|
t.observe(document.documentElement, { childList: !0 });
|
|
6129
6136
|
});
|
|
6130
6137
|
}
|
|
6131
|
-
function
|
|
6138
|
+
function Ln(e) {
|
|
6132
6139
|
return `pluno.productAgent.widgetState.${location.origin}.${e.backendUrl ?? ""}.${e.tokenEndpoint ?? ""}.${e.position ?? ""}`;
|
|
6133
6140
|
}
|
|
6134
6141
|
function ti(e) {
|
|
6135
|
-
return `${
|
|
6142
|
+
return `${Ln(e)}.displayState`;
|
|
6136
6143
|
}
|
|
6137
6144
|
function nl(e) {
|
|
6138
6145
|
try {
|
|
@@ -6180,7 +6187,7 @@ function ol(e) {
|
|
|
6180
6187
|
}
|
|
6181
6188
|
function il(e) {
|
|
6182
6189
|
try {
|
|
6183
|
-
const t = window.localStorage.getItem(
|
|
6190
|
+
const t = window.localStorage.getItem(Ln(e));
|
|
6184
6191
|
if (!t)
|
|
6185
6192
|
return Co();
|
|
6186
6193
|
const n = JSON.parse(t);
|
|
@@ -6240,7 +6247,7 @@ function Co() {
|
|
|
6240
6247
|
function ll(e, t) {
|
|
6241
6248
|
try {
|
|
6242
6249
|
window.localStorage.setItem(
|
|
6243
|
-
|
|
6250
|
+
Ln(e),
|
|
6244
6251
|
JSON.stringify(t)
|
|
6245
6252
|
);
|
|
6246
6253
|
} catch {
|
|
@@ -6284,9 +6291,9 @@ function dl(e) {
|
|
|
6284
6291
|
const i = async () => {
|
|
6285
6292
|
const o = new AbortController();
|
|
6286
6293
|
let r = !1;
|
|
6287
|
-
const l = new Promise((
|
|
6294
|
+
const l = new Promise((p, s) => {
|
|
6288
6295
|
const c = window.setTimeout(() => {
|
|
6289
|
-
r = !0, o.abort(),
|
|
6296
|
+
r = !0, o.abort(), s(new Error(Jn));
|
|
6290
6297
|
}, da);
|
|
6291
6298
|
o.signal.addEventListener(
|
|
6292
6299
|
"abort",
|
|
@@ -6295,13 +6302,13 @@ function dl(e) {
|
|
|
6295
6302
|
);
|
|
6296
6303
|
});
|
|
6297
6304
|
try {
|
|
6298
|
-
const
|
|
6305
|
+
const p = await Promise.race([
|
|
6299
6306
|
ni(e, o.signal),
|
|
6300
6307
|
l
|
|
6301
6308
|
]);
|
|
6302
|
-
return o.abort(),
|
|
6303
|
-
} catch (
|
|
6304
|
-
throw o.abort(), r ? new Error(
|
|
6309
|
+
return o.abort(), p;
|
|
6310
|
+
} catch (p) {
|
|
6311
|
+
throw o.abort(), r ? new Error(Jn) : p instanceof Error && p.message.startsWith("Pluno widget blocked on ") ? p : new Error(ca);
|
|
6305
6312
|
}
|
|
6306
6313
|
};
|
|
6307
6314
|
return {
|
|
@@ -6426,12 +6433,12 @@ class xe extends EventTarget {
|
|
|
6426
6433
|
}
|
|
6427
6434
|
function gl() {
|
|
6428
6435
|
const e = window.sessionStorage.getItem(
|
|
6429
|
-
|
|
6436
|
+
Zn
|
|
6430
6437
|
);
|
|
6431
6438
|
if (e)
|
|
6432
6439
|
return e;
|
|
6433
6440
|
const t = crypto.randomUUID();
|
|
6434
|
-
return window.sessionStorage.setItem(
|
|
6441
|
+
return window.sessionStorage.setItem(Zn, t), t;
|
|
6435
6442
|
}
|
|
6436
6443
|
function St(e, t) {
|
|
6437
6444
|
return `${e}:${t}`;
|
|
@@ -6458,8 +6465,8 @@ function oi(e) {
|
|
|
6458
6465
|
if (n) {
|
|
6459
6466
|
if (n.host === null)
|
|
6460
6467
|
return n.mountPromise.catch(() => {
|
|
6461
|
-
const
|
|
6462
|
-
return
|
|
6468
|
+
const s = t[be];
|
|
6469
|
+
return s ? s.mountPromise : oi(e);
|
|
6463
6470
|
});
|
|
6464
6471
|
if (fl(n.host))
|
|
6465
6472
|
return n.retryPendingTokenFailureOnce?.(), n.mountPromise;
|
|
@@ -6467,7 +6474,7 @@ function oi(e) {
|
|
|
6467
6474
|
}
|
|
6468
6475
|
const i = e.dataset.plunoPreviewChannel, o = e.dataset.plunoTokenEndpoint, r = !e.dataset.plunoToken && !i && o ? dl(o) : null;
|
|
6469
6476
|
let l;
|
|
6470
|
-
const
|
|
6477
|
+
const p = Na({
|
|
6471
6478
|
token: e.dataset.plunoToken,
|
|
6472
6479
|
tokenProvider: r?.loadToken,
|
|
6473
6480
|
tokenEndpoint: o,
|
|
@@ -6479,24 +6486,24 @@ function oi(e) {
|
|
|
6479
6486
|
fontFamily: e.dataset.plunoFontFamily,
|
|
6480
6487
|
scribbleStyle: e.dataset.plunoScribbleStyle === void 0 ? void 0 : e.dataset.plunoScribbleStyle !== "false",
|
|
6481
6488
|
position: e.dataset.plunoPosition === "bottom-left" ? "bottom-left" : "bottom-right"
|
|
6482
|
-
}).then((
|
|
6489
|
+
}).then((s) => {
|
|
6483
6490
|
if (t[be] !== l) {
|
|
6484
|
-
|
|
6491
|
+
s.destroy();
|
|
6485
6492
|
return;
|
|
6486
6493
|
}
|
|
6487
|
-
const c =
|
|
6494
|
+
const c = s.host;
|
|
6488
6495
|
c.setAttribute(Po, "true"), l.host = c, l.destroy = () => {
|
|
6489
|
-
t[be] === l && delete t[be], l.host = null, l.destroy = null,
|
|
6496
|
+
t[be] === l && delete t[be], l.host = null, l.destroy = null, s.destroy();
|
|
6490
6497
|
};
|
|
6491
|
-
}).catch((
|
|
6492
|
-
throw t[be] === l && delete t[be],
|
|
6498
|
+
}).catch((s) => {
|
|
6499
|
+
throw t[be] === l && delete t[be], s;
|
|
6493
6500
|
});
|
|
6494
6501
|
return l = {
|
|
6495
|
-
mountPromise:
|
|
6502
|
+
mountPromise: p,
|
|
6496
6503
|
host: null,
|
|
6497
6504
|
destroy: null,
|
|
6498
6505
|
retryPendingTokenFailureOnce: r?.retryPendingFailureOnce ?? null
|
|
6499
|
-
}, t[be] = l,
|
|
6506
|
+
}, t[be] = l, p;
|
|
6500
6507
|
}
|
|
6501
6508
|
function fl(e) {
|
|
6502
6509
|
return e.isConnected && e.getAttribute(Po) === "true" && !!e.shadowRoot?.querySelector(".pluno-pa-widget__launcher") && !!e.shadowRoot?.querySelector(".pluno-pa-widget__panel");
|