@pluno/product-agent-web 0.1.102 → 0.1.103
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -0
- package/dist/product-agent-sdk.js +34 -29
- package/dist/product-agent-widget.js +454 -446
- package/package.json +1 -1
|
@@ -44,16 +44,16 @@ function yi(e) {
|
|
|
44
44
|
inner: "#4b4b4b",
|
|
45
45
|
shadow: "#000000"
|
|
46
46
|
} : {
|
|
47
|
-
top:
|
|
48
|
-
middle:
|
|
49
|
-
bottom:
|
|
50
|
-
edgeStart:
|
|
51
|
-
edgeMiddle:
|
|
52
|
-
edgeEnd:
|
|
53
|
-
glow:
|
|
54
|
-
highlight:
|
|
55
|
-
inner:
|
|
56
|
-
shadow:
|
|
47
|
+
top: pe(t, 0.28, -0.03),
|
|
48
|
+
middle: pe(t, 0.08, 0.04),
|
|
49
|
+
bottom: pe(t, -0.1, 0.02),
|
|
50
|
+
edgeStart: pe(t, 0.08, 0.08),
|
|
51
|
+
edgeMiddle: pe(t, -0.08, 0.08),
|
|
52
|
+
edgeEnd: pe(t, -0.18, 0.05),
|
|
53
|
+
glow: pe(t, 0.32, -0.12),
|
|
54
|
+
highlight: pe(t, 0.38, -0.18),
|
|
55
|
+
inner: pe(t, 0.24, -0.1),
|
|
56
|
+
shadow: pe(t, -0.25, -0.08)
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
59
|
function So(e) {
|
|
@@ -90,7 +90,7 @@ function vi(e, t, n) {
|
|
|
90
90
|
e[2] + (t[2] - e[2]) * i
|
|
91
91
|
];
|
|
92
92
|
}
|
|
93
|
-
function
|
|
93
|
+
function pe(e, t, n) {
|
|
94
94
|
const [i, o, r] = Si(lt(e));
|
|
95
95
|
return rn(Ci(i, sn(o + n), sn(r + t)));
|
|
96
96
|
}
|
|
@@ -308,7 +308,7 @@ function Ki(e, t, n) {
|
|
|
308
308
|
e.slice(i, t)
|
|
309
309
|
);
|
|
310
310
|
}
|
|
311
|
-
const Eo = 100, Yi = 1e4, Xi = 5e3, Zi = "product-agent:sdk-preview-socket-connect", Ji = "product-agent:sdk-preview-socket-send", Qi = "product-agent:sdk-preview-socket-close", ea = "product-agent:sdk-preview-socket-open", ta = "product-agent:sdk-preview-socket-message", na = "product-agent:sdk-preview-socket-error", oa = "product-agent:sdk-preview-socket-closed", qn = "product-agent:sdk-preview-socket-id", ia = "data-pluno-sdk-preview-channel", ko = "data-pluno-auto-mounted",
|
|
311
|
+
const Eo = 100, Yi = 1e4, Xi = 5e3, Zi = "product-agent:sdk-preview-socket-connect", Ji = "product-agent:sdk-preview-socket-send", Qi = "product-agent:sdk-preview-socket-close", ea = "product-agent:sdk-preview-socket-open", ta = "product-agent:sdk-preview-socket-message", na = "product-agent:sdk-preview-socket-error", oa = "product-agent:sdk-preview-socket-closed", qn = "product-agent:sdk-preview-socket-id", ia = "data-pluno-sdk-preview-channel", ko = "data-pluno-auto-mounted", be = "__plunoProductAgentAutoMountOwner", aa = 1e4, ra = "Failed to load Pluno widget token", jn = "Timed out loading Pluno widget token", la = "pluno.productAgent.widgetClientId.", Yt = /* @__PURE__ */ new Set(), sa = "product-agent:preview-diagnostic", Lo = "pluno.productAgent.sharePromptsDisabled", pa = 3, Vn = 'dialog[open], [aria-modal="true"], [role="dialog"]', da = 400, ca = 5e3, ua = 500, Kn = "Close the page's popup to chat", ga = "No recent chats for this page yet.", de = {
|
|
312
312
|
launcherLabel: "Ask for anything...",
|
|
313
313
|
accentColor: "#7c3aed",
|
|
314
314
|
colorScheme: "light",
|
|
@@ -316,7 +316,7 @@ const Eo = 100, Yi = 1e4, Xi = 5e3, Zi = "product-agent:sdk-preview-socket-conne
|
|
|
316
316
|
scribbleStyle: !0,
|
|
317
317
|
position: "bottom-right",
|
|
318
318
|
movableLauncher: !0
|
|
319
|
-
}, ha = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive', Yn = "pluno-pa-scribble-font", Po = 190, To = 41, Xn = 22, ma = 1, fa = 48, bn = 420, wa = 520, ba = 0.24, _n = 680, _a = 800, xa = 0.76, A = 8,
|
|
319
|
+
}, ha = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive', Yn = "pluno-pa-scribble-font", Po = 190, To = 41, Xn = 22, ma = 1, fa = 48, bn = 420, wa = 520, ba = 0.24, _n = 680, _a = 800, xa = 0.76, A = 8, Re = 50, No = "http://www.w3.org/2000/svg", pn = 26, dn = 8, ya = 36, cn = 16, va = 4, Zn = [
|
|
320
320
|
{
|
|
321
321
|
ellipseCx: "17.5",
|
|
322
322
|
ellipseCy: "24.5",
|
|
@@ -356,19 +356,19 @@ const Eo = 100, Yi = 1e4, Xi = 5e3, Zi = "product-agent:sdk-preview-socket-conne
|
|
|
356
356
|
], Sa = 11, Ca = 13, un = 4, Ao = 10, Io = 40, Ea = "movable-launcher-position-v2", Ro = "pluno-pa-widget-styles", Do = "data-pluno-pa-widget-styles";
|
|
357
357
|
let Jn = 0;
|
|
358
358
|
function ka(e) {
|
|
359
|
-
return (t) => new
|
|
359
|
+
return (t) => new _e(t, e);
|
|
360
360
|
}
|
|
361
361
|
async function La(e = {}) {
|
|
362
362
|
const t = {
|
|
363
363
|
layout: e.layout ?? "floating",
|
|
364
364
|
mountTarget: e.mountTarget,
|
|
365
|
-
launcherLabel: e.launcherLabel ??
|
|
366
|
-
accentColor: e.accentColor ??
|
|
367
|
-
colorScheme: e.colorScheme ??
|
|
368
|
-
fontFamily: e.fontFamily ??
|
|
369
|
-
scribbleStyle: e.scribbleStyle ??
|
|
370
|
-
position: e.position ??
|
|
371
|
-
movableLauncher: e.movableLauncher ??
|
|
365
|
+
launcherLabel: e.launcherLabel ?? de.launcherLabel,
|
|
366
|
+
accentColor: e.accentColor ?? de.accentColor,
|
|
367
|
+
colorScheme: e.colorScheme ?? de.colorScheme,
|
|
368
|
+
fontFamily: e.fontFamily ?? de.fontFamily,
|
|
369
|
+
scribbleStyle: e.scribbleStyle ?? de.scribbleStyle,
|
|
370
|
+
position: e.position ?? de.position,
|
|
371
|
+
movableLauncher: e.movableLauncher ?? de.movableLauncher,
|
|
372
372
|
token: e.token,
|
|
373
373
|
tokenProvider: e.tokenProvider,
|
|
374
374
|
tokenEndpoint: e.tokenEndpoint,
|
|
@@ -411,7 +411,7 @@ async function La(e = {}) {
|
|
|
411
411
|
taskNotifications: e.taskNotifications,
|
|
412
412
|
tabGroups: e.tabGroups
|
|
413
413
|
};
|
|
414
|
-
|
|
414
|
+
Z(
|
|
415
415
|
"web-sdk.widget",
|
|
416
416
|
"Mounting widget with merged options",
|
|
417
417
|
{
|
|
@@ -447,7 +447,7 @@ async function La(e = {}) {
|
|
|
447
447
|
const l = Kr(t), s = t.layout === "floating" ? t.initialDisplayState ?? jr(t) : "shown";
|
|
448
448
|
bo(t, s);
|
|
449
449
|
let p = t.movableLauncher ? l.launcherPosition : null, g = p !== null, c = l.panelSize, h = null;
|
|
450
|
-
o.classList.add(`pluno-pa-widget--${t.colorScheme}`), t.scribbleStyle && o.classList.add("pluno-pa-widget--scribble"), s === "minimized" && (o.classList.add("pluno-pa-widget--minimized"),
|
|
450
|
+
o.classList.add(`pluno-pa-widget--${t.colorScheme}`), t.scribbleStyle && o.classList.add("pluno-pa-widget--scribble"), s === "minimized" && (o.classList.add("pluno-pa-widget--minimized"), Ie(
|
|
451
451
|
o,
|
|
452
452
|
Zt(
|
|
453
453
|
o,
|
|
@@ -462,7 +462,7 @@ async function La(e = {}) {
|
|
|
462
462
|
});
|
|
463
463
|
const E = t.mountTarget ?? await qr(), P = E.ownerDocument, T = o.querySelector(
|
|
464
464
|
".pluno-pa-widget__launcher"
|
|
465
|
-
),
|
|
465
|
+
), O = o.querySelector(
|
|
466
466
|
".pluno-pa-widget__launcher-drag-handle"
|
|
467
467
|
), u = o.querySelector(
|
|
468
468
|
".pluno-pa-widget__launcher-input"
|
|
@@ -474,74 +474,74 @@ async function La(e = {}) {
|
|
|
474
474
|
o.querySelectorAll(".pluno-pa-widget__resize-handle")
|
|
475
475
|
), R = o.querySelector(
|
|
476
476
|
".pluno-pa-widget__close"
|
|
477
|
-
),
|
|
477
|
+
), B = o.querySelector(
|
|
478
478
|
".pluno-pa-widget__composer"
|
|
479
|
-
),
|
|
479
|
+
), ge = o.querySelector(
|
|
480
480
|
".pluno-pa-widget__attachment-error"
|
|
481
|
-
),
|
|
481
|
+
), Ee = o.querySelector(
|
|
482
482
|
".pluno-pa-widget__billing-status"
|
|
483
483
|
), Ve = o.querySelector(
|
|
484
484
|
".pluno-pa-widget__attachments"
|
|
485
485
|
), D = o.querySelector(
|
|
486
486
|
".pluno-pa-widget__attachment-input"
|
|
487
|
-
),
|
|
487
|
+
), De = o.querySelector(
|
|
488
488
|
".pluno-pa-widget__attach"
|
|
489
489
|
), f = o.querySelector(
|
|
490
490
|
".pluno-pa-widget__input"
|
|
491
|
-
),
|
|
491
|
+
), U = o.querySelector(
|
|
492
492
|
".pluno-pa-widget__send"
|
|
493
|
-
),
|
|
493
|
+
), ke = o.querySelector(
|
|
494
494
|
".pluno-pa-widget__top-actions"
|
|
495
|
-
),
|
|
495
|
+
), le = o.querySelector(
|
|
496
496
|
".pluno-pa-widget__history"
|
|
497
497
|
), Ke = o.querySelector(
|
|
498
498
|
".pluno-pa-widget__history-panel"
|
|
499
|
-
),
|
|
499
|
+
), G = o.querySelector(
|
|
500
500
|
".pluno-pa-widget__history-list"
|
|
501
501
|
), st = o.querySelector(
|
|
502
502
|
".pluno-pa-widget__history-close"
|
|
503
|
-
),
|
|
503
|
+
), ze = o.querySelector(
|
|
504
504
|
".pluno-pa-widget__history-status"
|
|
505
|
-
),
|
|
505
|
+
), se = o.querySelector(
|
|
506
506
|
".pluno-pa-widget__timeline-jump"
|
|
507
507
|
), _ = o.querySelector(
|
|
508
508
|
".pluno-pa-widget__active-users-counter"
|
|
509
|
-
),
|
|
509
|
+
), x = o.querySelector(
|
|
510
510
|
".pluno-pa-widget__timeline"
|
|
511
|
-
),
|
|
511
|
+
), z = o.querySelector(
|
|
512
512
|
".pluno-pa-widget__timeline-bottom-sentinel"
|
|
513
|
-
),
|
|
513
|
+
), Y = o.querySelector(
|
|
514
514
|
".pluno-pa-widget__notify-suggestion"
|
|
515
|
-
),
|
|
515
|
+
), te = o.querySelector(
|
|
516
516
|
".pluno-pa-widget__notify-suggestion-enable"
|
|
517
517
|
), v = o.querySelector(
|
|
518
518
|
".pluno-pa-widget__notify-suggestion-later"
|
|
519
519
|
), N = o.querySelector(
|
|
520
520
|
".pluno-pa-widget__notify-suggestion-never"
|
|
521
|
-
),
|
|
521
|
+
), V = o.querySelector(
|
|
522
522
|
".pluno-pa-widget__tab-groups-suggestion"
|
|
523
523
|
), Jo = o.querySelector(
|
|
524
524
|
".pluno-pa-widget__tab-groups-suggestion-enable"
|
|
525
525
|
), Qo = o.querySelector(
|
|
526
526
|
".pluno-pa-widget__tab-groups-suggestion-dismiss"
|
|
527
527
|
);
|
|
528
|
-
if (!T || !u || !m || !R || !
|
|
528
|
+
if (!T || !u || !m || !R || !B || !ge || !Ee || !Ve || !D || !De || !f || !U || !ke || !le || !Ke || !G || !st || !ze || !se || !_ || !x || !z)
|
|
529
529
|
throw new Error("Failed to mount Pluno widget");
|
|
530
|
-
if (t.movableLauncher && !
|
|
530
|
+
if (t.movableLauncher && !O)
|
|
531
531
|
throw new Error("Failed to mount Pluno widget drag handle");
|
|
532
|
-
|
|
533
|
-
let
|
|
534
|
-
const
|
|
532
|
+
De.hidden = !t.attachmentsEnabled, D.disabled = !t.attachmentsEnabled, lo(u), lo(f);
|
|
533
|
+
let $ = [], he = null;
|
|
534
|
+
const xe = () => $i(
|
|
535
535
|
f,
|
|
536
|
-
o.classList.contains("pluno-pa-widget--open") && !t.loginRequired && !t.signupRequired && !
|
|
536
|
+
o.classList.contains("pluno-pa-widget--open") && !t.loginRequired && !t.signupRequired && !re(t.billingStatus)
|
|
537
537
|
), Me = () => {
|
|
538
538
|
fr(
|
|
539
539
|
Ve,
|
|
540
|
-
|
|
540
|
+
$,
|
|
541
541
|
(a) => {
|
|
542
|
-
|
|
543
|
-
(d,
|
|
544
|
-
), Me(),
|
|
542
|
+
$ = $.filter(
|
|
543
|
+
(d, y) => y !== a
|
|
544
|
+
), Me(), H(b.getState()), q(), xe();
|
|
545
545
|
}
|
|
546
546
|
);
|
|
547
547
|
}, Sn = t.loginRequired || t.signupRequired || t.token || t.webSocketFactory ? void 0 : t.tokenProvider ?? (t.tokenEndpoint ? async () => Xo(t.tokenEndpoint) : void 0);
|
|
@@ -574,7 +574,7 @@ async function La(e = {}) {
|
|
|
574
574
|
} catch (a) {
|
|
575
575
|
throw Pt.release(), n.remove(), a;
|
|
576
576
|
}
|
|
577
|
-
E.appendChild(n),
|
|
577
|
+
E.appendChild(n), Z(
|
|
578
578
|
"web-sdk.widget",
|
|
579
579
|
"Applied initial widget appearance",
|
|
580
580
|
{
|
|
@@ -587,53 +587,53 @@ async function La(e = {}) {
|
|
|
587
587
|
const Tt = new Set(l.openToolGroupKeys), Oe = new Set(
|
|
588
588
|
l.seenShareCandidateIds
|
|
589
589
|
), pt = new Set(Oe);
|
|
590
|
-
let Nt = l.sharePromptsDisabled || await Yr(t),
|
|
590
|
+
let Nt = l.sharePromptsDisabled || await Yr(t), ne = null, X = !1, dt = !(t.loginRequired || t.signupRequired), ye = !1, Le = {
|
|
591
591
|
enabled: !0
|
|
592
|
-
},
|
|
593
|
-
const
|
|
594
|
-
|
|
595
|
-
},
|
|
596
|
-
|
|
592
|
+
}, Pe = 0, Cn = "", K = !1, me = !1, ve = [], At = null, Ye = null;
|
|
593
|
+
const oe = (a, d) => {
|
|
594
|
+
Le = { enabled: a, reason: d };
|
|
595
|
+
}, ie = () => {
|
|
596
|
+
se.hidden = !0;
|
|
597
597
|
}, ti = () => {
|
|
598
|
-
|
|
598
|
+
se.hidden = !1;
|
|
599
599
|
}, ni = (a = "jump") => {
|
|
600
|
-
|
|
601
|
-
},
|
|
602
|
-
if (
|
|
600
|
+
oe(!0, a), ie(), rt(x, () => Le.enabled), Pe = x.scrollTop;
|
|
601
|
+
}, fe = () => {
|
|
602
|
+
if (le.hidden = t.layout === "page" || t.loginRequired, Ke.hidden = !K, le.setAttribute("aria-expanded", String(K)), G.classList.toggle(
|
|
603
603
|
"pluno-pa-widget__history-list--center",
|
|
604
|
-
|
|
605
|
-
),
|
|
604
|
+
me && ve.length === 0
|
|
605
|
+
), G.replaceChildren(), me && ve.length === 0) {
|
|
606
606
|
const a = document.createElement("p");
|
|
607
|
-
a.className = "pluno-pa-widget__history-loading", a.textContent = "Loading...",
|
|
607
|
+
a.className = "pluno-pa-widget__history-loading", a.textContent = "Loading...", G.appendChild(a);
|
|
608
608
|
}
|
|
609
|
-
for (const a of
|
|
609
|
+
for (const a of ve) {
|
|
610
610
|
const d = document.createElement("button");
|
|
611
|
-
d.type = "button", d.className = "pluno-pa-widget__history-item", d.disabled =
|
|
612
|
-
const
|
|
613
|
-
|
|
611
|
+
d.type = "button", d.className = "pluno-pa-widget__history-item", d.disabled = me;
|
|
612
|
+
const y = document.createElement("span");
|
|
613
|
+
y.className = "pluno-pa-widget__history-item-title", y.textContent = Va(a);
|
|
614
614
|
const C = document.createElement("time");
|
|
615
615
|
C.className = "pluno-pa-widget__history-time", C.dateTime = a.lastActiveAt, C.textContent = Ya(
|
|
616
616
|
a.lastActiveAt,
|
|
617
617
|
Date.now()
|
|
618
618
|
);
|
|
619
|
-
const
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
}),
|
|
619
|
+
const M = document.createElement("small");
|
|
620
|
+
M.className = "pluno-pa-widget__history-path", M.textContent = Ka(a), d.append(y, C, M), d.addEventListener("click", () => {
|
|
621
|
+
K = !1, Ye = null, fe(), oe(!0, "newSession"), ie(), b.loadSession(a.id), H(b.getState()), xe();
|
|
622
|
+
}), G.appendChild(d);
|
|
623
623
|
}
|
|
624
|
-
if (
|
|
624
|
+
if (me && ve.length > 0) {
|
|
625
625
|
const a = document.createElement("p");
|
|
626
|
-
a.className = "pluno-pa-widget__history-loading pluno-pa-widget__history-loading--inline", a.textContent = "Loading...",
|
|
626
|
+
a.className = "pluno-pa-widget__history-loading pluno-pa-widget__history-loading--inline", a.textContent = "Loading...", G.appendChild(a);
|
|
627
627
|
}
|
|
628
|
-
|
|
628
|
+
ze.textContent = Ye ?? (!me && ve.length === 0 ? "No recent chats for this page yet." : ""), ze.hidden = ze.textContent.length === 0;
|
|
629
629
|
}, En = async (a) => {
|
|
630
|
-
if (!
|
|
631
|
-
|
|
630
|
+
if (!me) {
|
|
631
|
+
me = !0, Ye = null, fe();
|
|
632
632
|
try {
|
|
633
633
|
const d = await b.listSessions({ cursor: a, limit: 20 });
|
|
634
|
-
|
|
634
|
+
ve = a ? [...ve, ...d.sessions] : d.sessions, At = d.nextCursor;
|
|
635
635
|
} catch (d) {
|
|
636
|
-
|
|
636
|
+
Z(
|
|
637
637
|
"web-sdk.widget",
|
|
638
638
|
"Failed to load session history",
|
|
639
639
|
{
|
|
@@ -641,13 +641,13 @@ async function La(e = {}) {
|
|
|
641
641
|
}
|
|
642
642
|
), Ye = ga;
|
|
643
643
|
} finally {
|
|
644
|
-
|
|
644
|
+
me = !1, fe();
|
|
645
645
|
}
|
|
646
646
|
}
|
|
647
647
|
}, oi = () => {
|
|
648
|
-
!At ||
|
|
648
|
+
!At || me || G.scrollHeight - G.scrollTop - G.clientHeight <= 24 && En(At);
|
|
649
649
|
}, kn = () => {
|
|
650
|
-
|
|
650
|
+
X || typeof document > "u" || (wo(i, t.accentColor), n.isConnected || (t.mountTarget?.isConnected ? t.mountTarget.appendChild(n) : t.mountTarget || P.body?.appendChild(n)));
|
|
651
651
|
}, Ln = new MutationObserver(kn);
|
|
652
652
|
Ln.observe(P.documentElement, {
|
|
653
653
|
childList: !0,
|
|
@@ -664,7 +664,7 @@ async function La(e = {}) {
|
|
|
664
664
|
),
|
|
665
665
|
d
|
|
666
666
|
);
|
|
667
|
-
},
|
|
667
|
+
}, W = () => {
|
|
668
668
|
const a = Ha(i, u, f);
|
|
669
669
|
Zr(t, {
|
|
670
670
|
isOpen: o.classList.contains("pluno-pa-widget--open"),
|
|
@@ -686,15 +686,15 @@ async function La(e = {}) {
|
|
|
686
686
|
o.classList.remove("pluno-pa-widget--minimized"), T.removeAttribute("tabindex"), !o.classList.contains("pluno-pa-widget--open") && !o.classList.contains("pluno-pa-widget--closing") && Je(!1), d && ct("shown");
|
|
687
687
|
return;
|
|
688
688
|
}
|
|
689
|
-
|
|
689
|
+
ne !== null && (window.clearTimeout(ne), ne = null), o.classList.remove("pluno-pa-widget--open"), o.classList.remove("pluno-pa-widget--closing"), o.classList.add("pluno-pa-widget--minimized"), T.hidden = !1, m.hidden = !0, R.hidden = !0, T.tabIndex = 0, f.value = "", Ie(
|
|
690
690
|
o,
|
|
691
691
|
Zt(
|
|
692
692
|
o,
|
|
693
693
|
p,
|
|
694
694
|
t.position
|
|
695
695
|
)
|
|
696
|
-
), io(o),
|
|
697
|
-
},
|
|
696
|
+
), io(o), W(), d && ct("minimized");
|
|
697
|
+
}, Te = (a, d = {}) => {
|
|
698
698
|
Wa(a, {
|
|
699
699
|
debugVersion: Ea,
|
|
700
700
|
launcherPosition: p,
|
|
@@ -708,16 +708,16 @@ async function La(e = {}) {
|
|
|
708
708
|
rootRect: Qt(o),
|
|
709
709
|
launcherRect: Qt(T),
|
|
710
710
|
panelRect: Qt(m),
|
|
711
|
-
viewport:
|
|
711
|
+
viewport: ee(),
|
|
712
712
|
panelHidden: m.hidden,
|
|
713
713
|
closeHidden: R.hidden,
|
|
714
714
|
...d
|
|
715
715
|
});
|
|
716
716
|
}, Je = (a = !0) => {
|
|
717
717
|
if (!p)
|
|
718
|
-
return
|
|
718
|
+
return Ie(o, null), Xe(a);
|
|
719
719
|
const d = Xe(a);
|
|
720
|
-
return
|
|
720
|
+
return Ie(o, d), Te("Applied stored closed launcher position", {
|
|
721
721
|
visibleLauncherPosition: d
|
|
722
722
|
}), d;
|
|
723
723
|
}, It = (a, d) => {
|
|
@@ -734,7 +734,7 @@ async function La(e = {}) {
|
|
|
734
734
|
return t.layout === "page" && m.getBoundingClientRect().width || a;
|
|
735
735
|
}, Pn = () => {
|
|
736
736
|
if (o.classList.contains("pluno-pa-widget--minimized")) {
|
|
737
|
-
|
|
737
|
+
Ie(
|
|
738
738
|
o,
|
|
739
739
|
Zt(
|
|
740
740
|
o,
|
|
@@ -752,7 +752,7 @@ async function La(e = {}) {
|
|
|
752
752
|
I,
|
|
753
753
|
Rt()
|
|
754
754
|
);
|
|
755
|
-
const
|
|
755
|
+
const y = yt(
|
|
756
756
|
h ?? Jt(
|
|
757
757
|
o,
|
|
758
758
|
a,
|
|
@@ -761,39 +761,39 @@ async function La(e = {}) {
|
|
|
761
761
|
),
|
|
762
762
|
d
|
|
763
763
|
);
|
|
764
|
-
h && (h =
|
|
764
|
+
h && (h = y), It(y, a), Te(
|
|
765
765
|
"Applied open panel position after viewport resize",
|
|
766
|
-
{ openPanelPosition:
|
|
766
|
+
{ openPanelPosition: y }
|
|
767
767
|
);
|
|
768
|
-
} else p &&
|
|
768
|
+
} else p && Te(
|
|
769
769
|
"Applied visible launcher position after viewport resize",
|
|
770
770
|
{ visibleLauncherPosition: a }
|
|
771
771
|
);
|
|
772
772
|
};
|
|
773
773
|
let Tn = () => {
|
|
774
774
|
};
|
|
775
|
-
window.addEventListener("resize", Pn), t.movableLauncher &&
|
|
775
|
+
window.addEventListener("resize", Pn), t.movableLauncher && O ? (Je(), Tn = Ia({
|
|
776
776
|
root: o,
|
|
777
777
|
launcher: T,
|
|
778
|
-
launcherDragHandle:
|
|
778
|
+
launcherDragHandle: O,
|
|
779
779
|
getPosition: () => Xe(),
|
|
780
780
|
setPosition: (a) => {
|
|
781
|
-
const d = a,
|
|
781
|
+
const d = a, y = Ct(o), C = gn(
|
|
782
782
|
o,
|
|
783
783
|
a,
|
|
784
|
-
|
|
784
|
+
y
|
|
785
785
|
);
|
|
786
786
|
p = Oa(
|
|
787
787
|
C,
|
|
788
|
-
|
|
789
|
-
),
|
|
788
|
+
y
|
|
789
|
+
), Ie(o, C), Te("Dragging closed launcher", {
|
|
790
790
|
requestedPosition: d
|
|
791
791
|
});
|
|
792
792
|
},
|
|
793
793
|
persist: () => {
|
|
794
|
-
g = !0,
|
|
794
|
+
g = !0, W(), Te("Persisted closed launcher drag position");
|
|
795
795
|
}
|
|
796
|
-
})) :
|
|
796
|
+
})) : Ie(o, null), Xt(o, c);
|
|
797
797
|
const ii = () => {
|
|
798
798
|
const a = at(c), d = Xe();
|
|
799
799
|
return {
|
|
@@ -823,7 +823,7 @@ async function La(e = {}) {
|
|
|
823
823
|
handles: L,
|
|
824
824
|
getBounds: ii,
|
|
825
825
|
setBounds: ai,
|
|
826
|
-
persist:
|
|
826
|
+
persist: W
|
|
827
827
|
}) : () => {
|
|
828
828
|
};
|
|
829
829
|
let Dt = !1;
|
|
@@ -832,19 +832,19 @@ async function La(e = {}) {
|
|
|
832
832
|
Dt = !0;
|
|
833
833
|
try {
|
|
834
834
|
const a = await t.billingStatusLoader();
|
|
835
|
-
if (
|
|
835
|
+
if (X)
|
|
836
836
|
return;
|
|
837
837
|
po(
|
|
838
838
|
t.billingStatus,
|
|
839
839
|
a,
|
|
840
840
|
b.getState().lastErrorCode
|
|
841
841
|
) && (t.billingStatus = a, on(
|
|
842
|
-
|
|
842
|
+
Ee,
|
|
843
843
|
t.billingStatus,
|
|
844
844
|
b.getState().lastErrorCode
|
|
845
|
-
),
|
|
845
|
+
), q());
|
|
846
846
|
} catch (a) {
|
|
847
|
-
|
|
847
|
+
Z(
|
|
848
848
|
"web-sdk.widget",
|
|
849
849
|
"Failed to refresh billing status",
|
|
850
850
|
{ message: a instanceof Error ? a.message : String(a) }
|
|
@@ -853,57 +853,57 @@ async function La(e = {}) {
|
|
|
853
853
|
Dt = !1;
|
|
854
854
|
}
|
|
855
855
|
}
|
|
856
|
-
},
|
|
857
|
-
Nn(), et && (et = !1, Ot()), o.classList.contains("pluno-pa-widget--open") || (h = null),
|
|
856
|
+
}, we = (a = "", d = !0) => {
|
|
857
|
+
Nn(), et && (et = !1, Ot()), o.classList.contains("pluno-pa-widget--open") || (h = null), ne !== null && (window.clearTimeout(ne), ne = null), Ze("shown", !1), m.hidden = !1, R.hidden = !1, tn(
|
|
858
858
|
I,
|
|
859
859
|
Rt()
|
|
860
860
|
), o.classList.remove("pluno-pa-widget--closing");
|
|
861
|
-
const
|
|
861
|
+
const y = Je(), C = Jt(
|
|
862
862
|
o,
|
|
863
|
-
|
|
863
|
+
y,
|
|
864
864
|
t.position,
|
|
865
865
|
c
|
|
866
866
|
);
|
|
867
|
-
if (It(C,
|
|
867
|
+
if (It(C, y), Te("Opening launcher at clamped open panel position", {
|
|
868
868
|
openPanelPosition: C,
|
|
869
|
-
visibleLauncherPosition:
|
|
870
|
-
}),
|
|
871
|
-
o.classList.add("pluno-pa-widget--open"), T.hidden = !0, a && (f.value = a, it(f)), rt(
|
|
869
|
+
visibleLauncherPosition: y
|
|
870
|
+
}), oe(!0, "open"), ie(), !d) {
|
|
871
|
+
o.classList.add("pluno-pa-widget--open"), T.hidden = !0, a && (f.value = a, it(f)), rt(x, () => Le.enabled), Pe = x.scrollTop, f.focus(), f.setSelectionRange(f.value.length, f.value.length), W(), ct("shown"), t.onPanelOpenChange?.(!0);
|
|
872
872
|
return;
|
|
873
873
|
}
|
|
874
874
|
window.requestAnimationFrame(() => {
|
|
875
|
-
o.classList.add("pluno-pa-widget--open"), a && (f.value = a, it(f)), rt(
|
|
876
|
-
T.hidden = !0, rt(
|
|
875
|
+
o.classList.add("pluno-pa-widget--open"), a && (f.value = a, it(f)), rt(x, () => Le.enabled), Pe = x.scrollTop, f.focus(), f.setSelectionRange(f.value.length, f.value.length), W(), ct("shown"), t.onPanelOpenChange?.(!0), ne = window.setTimeout(() => {
|
|
876
|
+
T.hidden = !0, rt(x, () => Le.enabled), Pe = x.scrollTop;
|
|
877
877
|
}, 220);
|
|
878
878
|
});
|
|
879
879
|
}, zt = () => {
|
|
880
|
-
|
|
880
|
+
ne !== null && (window.clearTimeout(ne), ne = null), T.hidden = !1, p && (Je(!1), Te("Closing launcher at stored position")), o.classList.remove("pluno-pa-widget--open"), o.classList.add("pluno-pa-widget--closing"), W(), t.onPanelOpenChange?.(!1), ne = window.setTimeout(() => {
|
|
881
881
|
m.hidden = !0, R.hidden = !0, h = null, o.classList.remove("pluno-pa-widget--closing");
|
|
882
882
|
}, 220);
|
|
883
883
|
};
|
|
884
884
|
T.addEventListener("submit", (a) => {
|
|
885
|
-
a.preventDefault(),
|
|
886
|
-
}),
|
|
885
|
+
a.preventDefault(), we(u.value), u.value = "";
|
|
886
|
+
}), O?.addEventListener("click", (a) => {
|
|
887
887
|
a.preventDefault(), a.stopPropagation();
|
|
888
888
|
}), T.addEventListener("click", (a) => {
|
|
889
|
-
a.target === u && !
|
|
889
|
+
a.target === u && !O || (we(u.value), u.value = "");
|
|
890
890
|
}), u.addEventListener("focus", () => {
|
|
891
|
-
|
|
891
|
+
we(u.value), u.value = "";
|
|
892
892
|
}), u.addEventListener("input", () => {
|
|
893
893
|
if (!u.value)
|
|
894
894
|
return;
|
|
895
895
|
const a = u.value;
|
|
896
|
-
|
|
896
|
+
we(a), u.value = "";
|
|
897
897
|
});
|
|
898
|
-
let Mt = null, ut = null,
|
|
898
|
+
let Mt = null, ut = null, Ne = null;
|
|
899
899
|
const An = (a) => a === u || a === f, li = (a) => {
|
|
900
900
|
if (!(a instanceof Element) || a.getRootNode() === o.getRootNode())
|
|
901
901
|
return null;
|
|
902
902
|
let d = a;
|
|
903
903
|
for (; d; ) {
|
|
904
|
-
const
|
|
905
|
-
if (
|
|
906
|
-
return
|
|
904
|
+
const y = d.closest(Vn);
|
|
905
|
+
if (y)
|
|
906
|
+
return y;
|
|
907
907
|
const C = d.getRootNode();
|
|
908
908
|
d = C instanceof ShadowRoot ? C.host : null;
|
|
909
909
|
}
|
|
@@ -920,72 +920,72 @@ async function La(e = {}) {
|
|
|
920
920
|
const d = window.getComputedStyle(a);
|
|
921
921
|
return d.display !== "none" && d.visibility !== "hidden";
|
|
922
922
|
}, In = (a) => {
|
|
923
|
-
Ue !== a && (Ue = a, o.classList.toggle("pluno-pa-widget--host-modal-conflict", a !== null),
|
|
923
|
+
Ue !== a && (Ue = a, o.classList.toggle("pluno-pa-widget--host-modal-conflict", a !== null), Ae(), a !== null ? Ne = window.setInterval(() => {
|
|
924
924
|
const d = Ue;
|
|
925
925
|
(!d || !si(d)) && In(null);
|
|
926
|
-
}, ua) :
|
|
926
|
+
}, ua) : Ne !== null && (window.clearInterval(Ne), Ne = null, ut = null));
|
|
927
927
|
}, pi = () => {
|
|
928
|
-
|
|
928
|
+
Ne !== null && (window.clearInterval(Ne), Ne = null);
|
|
929
929
|
};
|
|
930
930
|
o.addEventListener("focusin", (a) => {
|
|
931
|
-
An(a.target) && (Mt = Date.now(),
|
|
931
|
+
An(a.target) && (Mt = Date.now(), W());
|
|
932
932
|
}), o.addEventListener("focusout", (a) => {
|
|
933
933
|
if (!An(a.target) || Ue !== null)
|
|
934
934
|
return;
|
|
935
935
|
const d = Mt;
|
|
936
936
|
if (Mt = null, d === null || Date.now() - d > da)
|
|
937
937
|
return;
|
|
938
|
-
const
|
|
939
|
-
if (!
|
|
938
|
+
const y = li(a.relatedTarget);
|
|
939
|
+
if (!y)
|
|
940
940
|
return;
|
|
941
941
|
const C = Date.now();
|
|
942
942
|
if (ut !== null && C - ut <= ca) {
|
|
943
|
-
In(
|
|
943
|
+
In(y);
|
|
944
944
|
return;
|
|
945
945
|
}
|
|
946
946
|
ut = C;
|
|
947
947
|
}), T.addEventListener("keydown", (a) => {
|
|
948
|
-
!o.classList.contains("pluno-pa-widget--minimized") || a.key !== "Enter" && a.key !== " " || (a.preventDefault(),
|
|
948
|
+
!o.classList.contains("pluno-pa-widget--minimized") || a.key !== "Enter" && a.key !== " " || (a.preventDefault(), we());
|
|
949
949
|
}), S?.addEventListener("pointerdown", (a) => {
|
|
950
950
|
a.stopPropagation();
|
|
951
951
|
}), S?.addEventListener("click", (a) => {
|
|
952
952
|
a.preventDefault(), a.stopPropagation(), Ze("minimized");
|
|
953
|
-
}), R.addEventListener("click", zt),
|
|
954
|
-
|
|
955
|
-
}),
|
|
953
|
+
}), R.addEventListener("click", zt), x.addEventListener("scroll", () => {
|
|
954
|
+
x.scrollTop < Pe - 1 && oe(!1, "userScroll"), Pe = x.scrollTop;
|
|
955
|
+
}), se.addEventListener("click", () => {
|
|
956
956
|
ni();
|
|
957
957
|
});
|
|
958
958
|
const Rn = typeof IntersectionObserver > "u" ? null : new IntersectionObserver(
|
|
959
959
|
([a]) => {
|
|
960
|
-
a?.isIntersecting && (
|
|
960
|
+
a?.isIntersecting && (oe(!0, "bottom"), ie());
|
|
961
961
|
},
|
|
962
|
-
{ root:
|
|
962
|
+
{ root: x, threshold: 0 }
|
|
963
963
|
);
|
|
964
|
-
Rn?.observe(
|
|
964
|
+
Rn?.observe(z);
|
|
965
965
|
const Qe = () => t.loginRequired || t.signupRequired;
|
|
966
966
|
let Ue = null, et = !1;
|
|
967
|
-
const
|
|
967
|
+
const ae = () => dt || b.getState().status !== "connected", Ae = () => {
|
|
968
968
|
const a = Qe(), d = Ue !== null;
|
|
969
|
-
u.readOnly = !1, f.readOnly = !1, u.placeholder = d ? Kn : a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : et ? "New update" : t.launcherLabel, f.placeholder = d ? Kn : a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel :
|
|
970
|
-
},
|
|
971
|
-
|
|
969
|
+
u.readOnly = !1, f.readOnly = !1, u.placeholder = d ? Kn : a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : et ? "New update" : t.launcherLabel, f.placeholder = d ? Kn : a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : de.launcherLabel, B.hidden = a;
|
|
970
|
+
}, q = () => {
|
|
971
|
+
U.disabled = ae() || re(t.billingStatus) || !b.getState().isThinking && f.value.trim().length === 0 && $.length === 0, De.disabled = Qe() || ae() || re(t.billingStatus);
|
|
972
972
|
};
|
|
973
|
-
|
|
973
|
+
Ae();
|
|
974
974
|
const Ot = () => {
|
|
975
975
|
const a = b.getState().isThinking;
|
|
976
976
|
o.classList.toggle("pluno-pa-widget--thinking", a), o.classList.toggle(
|
|
977
977
|
"pluno-pa-widget--unread",
|
|
978
978
|
!a && et
|
|
979
|
-
),
|
|
979
|
+
), Ae();
|
|
980
980
|
};
|
|
981
981
|
Ot();
|
|
982
982
|
const Ut = () => {
|
|
983
|
-
Qe() ||
|
|
983
|
+
Qe() || X || (dt = !0, Ae(), q(), b.connect().then(
|
|
984
984
|
() => {
|
|
985
|
-
|
|
985
|
+
X || (dt = !1, Ae(), q());
|
|
986
986
|
},
|
|
987
987
|
(a) => {
|
|
988
|
-
|
|
988
|
+
X || (dt = !1, Ae(), q(), Z(
|
|
989
989
|
"web-sdk.widget",
|
|
990
990
|
"Failed to connect Product Agent widget",
|
|
991
991
|
{
|
|
@@ -995,7 +995,7 @@ async function La(e = {}) {
|
|
|
995
995
|
}
|
|
996
996
|
));
|
|
997
997
|
};
|
|
998
|
-
|
|
998
|
+
B.addEventListener("submit", (a) => {
|
|
999
999
|
if (a.preventDefault(), t.loginRequired) {
|
|
1000
1000
|
t.onLoginClick?.();
|
|
1001
1001
|
return;
|
|
@@ -1004,72 +1004,72 @@ async function La(e = {}) {
|
|
|
1004
1004
|
t.onSignupClick?.();
|
|
1005
1005
|
return;
|
|
1006
1006
|
}
|
|
1007
|
-
|
|
1007
|
+
ae() || re(t.billingStatus) || (ye = !0, oe(!0, "send"), ie(), $ = en(
|
|
1008
1008
|
b,
|
|
1009
1009
|
f,
|
|
1010
|
-
|
|
1010
|
+
$,
|
|
1011
1011
|
bt
|
|
1012
|
-
), Me(),
|
|
1012
|
+
), Me(), q());
|
|
1013
1013
|
});
|
|
1014
1014
|
let tt = 0;
|
|
1015
1015
|
const di = () => {
|
|
1016
1016
|
tt = 0, o.classList.remove("pluno-pa-widget--drag-over");
|
|
1017
1017
|
}, Bt = (a) => {
|
|
1018
|
-
|
|
1019
|
-
|
|
1018
|
+
he !== null && window.clearTimeout(he), ge.textContent = a, ge.hidden = !1, he = window.setTimeout(() => {
|
|
1019
|
+
ge.textContent = "", ge.hidden = !0, he = null;
|
|
1020
1020
|
}, 3e3);
|
|
1021
1021
|
}, ci = () => {
|
|
1022
|
-
|
|
1022
|
+
he !== null && (window.clearTimeout(he), he = null), ge.textContent = "", ge.hidden = !0;
|
|
1023
1023
|
}, Ft = async (a) => {
|
|
1024
1024
|
if (!t.attachmentsEnabled || a.length === 0)
|
|
1025
1025
|
return;
|
|
1026
1026
|
const d = _r(b, a);
|
|
1027
|
-
if (
|
|
1028
|
-
|
|
1027
|
+
if ($ = [...$, ...d], Me(), ci(), q(), H(b.getState()), !o.classList.contains("pluno-pa-widget--open")) {
|
|
1028
|
+
we();
|
|
1029
1029
|
return;
|
|
1030
1030
|
}
|
|
1031
|
-
|
|
1031
|
+
xe();
|
|
1032
1032
|
}, ui = async (a) => {
|
|
1033
1033
|
await Ft(a), !(a.length === 0 || Ue !== null) && f.focus();
|
|
1034
1034
|
};
|
|
1035
|
-
|
|
1036
|
-
t.loginRequired ||
|
|
1035
|
+
De.addEventListener("click", () => {
|
|
1036
|
+
t.loginRequired || ae() || re(t.billingStatus) || D.click();
|
|
1037
1037
|
}), D.addEventListener("change", () => {
|
|
1038
1038
|
const a = Array.from(D.files ?? []);
|
|
1039
1039
|
D.value = "", ui(a).catch((d) => {
|
|
1040
1040
|
Bt(
|
|
1041
1041
|
d instanceof Error ? d.message : "Failed to attach file"
|
|
1042
|
-
),
|
|
1042
|
+
), Z("web-sdk.widget", "Attachment failed", {
|
|
1043
1043
|
message: d instanceof Error ? d.message : String(d)
|
|
1044
1044
|
});
|
|
1045
1045
|
});
|
|
1046
1046
|
}), o.addEventListener("dragenter", (a) => {
|
|
1047
|
-
!t.attachmentsEnabled || !_t(a.dataTransfer) || t.loginRequired ||
|
|
1047
|
+
!t.attachmentsEnabled || !_t(a.dataTransfer) || t.loginRequired || ae() || (a.preventDefault(), a.stopPropagation(), tt += 1, o.classList.add("pluno-pa-widget--drag-over"));
|
|
1048
1048
|
}), o.addEventListener("dragover", (a) => {
|
|
1049
1049
|
const d = a.dataTransfer;
|
|
1050
|
-
!t.attachmentsEnabled || !_t(d) || t.loginRequired ||
|
|
1050
|
+
!t.attachmentsEnabled || !_t(d) || t.loginRequired || ae() || (a.preventDefault(), a.stopPropagation(), d.dropEffect = "copy");
|
|
1051
1051
|
}), o.addEventListener("dragleave", (a) => {
|
|
1052
1052
|
_t(a.dataTransfer) && (a.stopPropagation(), tt = Math.max(0, tt - 1), tt === 0 && o.classList.remove("pluno-pa-widget--drag-over"));
|
|
1053
1053
|
}), o.addEventListener("drop", (a) => {
|
|
1054
1054
|
const d = a.dataTransfer;
|
|
1055
|
-
!t.attachmentsEnabled || !_t(d) || t.loginRequired ||
|
|
1055
|
+
!t.attachmentsEnabled || !_t(d) || t.loginRequired || ae() || (a.preventDefault(), a.stopPropagation(), di(), Ft(d.files).catch((y) => {
|
|
1056
1056
|
Bt(
|
|
1057
|
-
|
|
1058
|
-
),
|
|
1059
|
-
message:
|
|
1057
|
+
y instanceof Error ? y.message : "Failed to attach file"
|
|
1058
|
+
), Z("web-sdk.widget", "Attachment failed", {
|
|
1059
|
+
message: y instanceof Error ? y.message : String(y)
|
|
1060
1060
|
});
|
|
1061
1061
|
}));
|
|
1062
1062
|
}), o.addEventListener("paste", (a) => {
|
|
1063
1063
|
a.stopPropagation();
|
|
1064
|
-
const d = a.clipboardData,
|
|
1065
|
-
!t.attachmentsEnabled ||
|
|
1064
|
+
const d = a.clipboardData, y = Array.from(d?.files ?? []);
|
|
1065
|
+
!t.attachmentsEnabled || y.length === 0 || t.loginRequired || ae() || (a.preventDefault(), Ft(y).catch((C) => {
|
|
1066
1066
|
Bt(
|
|
1067
1067
|
C instanceof Error ? C.message : "Failed to attach file"
|
|
1068
|
-
),
|
|
1068
|
+
), Z("web-sdk.widget", "Attachment failed", {
|
|
1069
1069
|
message: C instanceof Error ? C.message : String(C)
|
|
1070
1070
|
});
|
|
1071
1071
|
}));
|
|
1072
|
-
}),
|
|
1072
|
+
}), U.addEventListener("click", () => {
|
|
1073
1073
|
if (t.loginRequired) {
|
|
1074
1074
|
t.onLoginClick?.();
|
|
1075
1075
|
return;
|
|
@@ -1078,43 +1078,43 @@ async function La(e = {}) {
|
|
|
1078
1078
|
b.stop();
|
|
1079
1079
|
return;
|
|
1080
1080
|
}
|
|
1081
|
-
if (
|
|
1081
|
+
if (ae())
|
|
1082
1082
|
return;
|
|
1083
|
-
const a = f.value.trim().length > 0 ||
|
|
1084
|
-
|
|
1083
|
+
const a = f.value.trim().length > 0 || $.length > 0;
|
|
1084
|
+
ye = !0, oe(!0, "send"), ie(), $ = en(
|
|
1085
1085
|
b,
|
|
1086
1086
|
f,
|
|
1087
|
-
|
|
1087
|
+
$,
|
|
1088
1088
|
bt
|
|
1089
|
-
), Me(),
|
|
1090
|
-
}),
|
|
1091
|
-
|
|
1089
|
+
), Me(), q(), H(b.getState()), a && xe();
|
|
1090
|
+
}), le.addEventListener("click", () => {
|
|
1091
|
+
K = !K, Ye = null, fe(), K && ve.length === 0 && En(null), K || xe();
|
|
1092
1092
|
}), st.addEventListener("click", () => {
|
|
1093
|
-
|
|
1094
|
-
}),
|
|
1095
|
-
it(f),
|
|
1093
|
+
K = !1, fe(), xe();
|
|
1094
|
+
}), G.addEventListener("scroll", oi), f.addEventListener("input", () => {
|
|
1095
|
+
it(f), W(), q(), mi();
|
|
1096
1096
|
}), f.addEventListener("keydown", (a) => {
|
|
1097
1097
|
if (!(a.key !== "Enter" || a.shiftKey)) {
|
|
1098
1098
|
if (a.preventDefault(), t.loginRequired) {
|
|
1099
1099
|
t.onLoginClick?.();
|
|
1100
1100
|
return;
|
|
1101
1101
|
}
|
|
1102
|
-
|
|
1102
|
+
ae() || (ye = !0, oe(!0, "send"), ie(), $ = en(
|
|
1103
1103
|
b,
|
|
1104
1104
|
f,
|
|
1105
|
-
|
|
1105
|
+
$,
|
|
1106
1106
|
bt
|
|
1107
|
-
), Me(),
|
|
1107
|
+
), Me(), q(), H(b.getState()));
|
|
1108
1108
|
}
|
|
1109
1109
|
}), o.addEventListener("click", (a) => {
|
|
1110
1110
|
const d = a.target instanceof Element ? a.target : null;
|
|
1111
|
-
d?.closest("a[href]") &&
|
|
1112
|
-
const C = window.getSelection(),
|
|
1111
|
+
d?.closest("a[href]") && W(), K && Gi(d, Ke, le) && (K = !1, fe());
|
|
1112
|
+
const C = window.getSelection(), M = !!(C && !C.isCollapsed && C.anchorNode && o.contains(C.anchorNode));
|
|
1113
1113
|
Wi(
|
|
1114
1114
|
a.target,
|
|
1115
1115
|
a.detail,
|
|
1116
|
-
|
|
1117
|
-
) &&
|
|
1116
|
+
M
|
|
1117
|
+
) && xe();
|
|
1118
1118
|
}), o.addEventListener("copy", (a) => {
|
|
1119
1119
|
a.clipboardData && window.getSelection() && !window.getSelection()?.isCollapsed && window.getSelection()?.anchorNode && window.getSelection()?.focusNode && o.contains(window.getSelection()?.anchorNode ?? null) && o.contains(window.getSelection()?.focusNode ?? null) && window.getSelection()?.toString() && (a.clipboardData.clearData(), a.clipboardData.setData(
|
|
1120
1120
|
"text/plain",
|
|
@@ -1132,8 +1132,8 @@ async function La(e = {}) {
|
|
|
1132
1132
|
), a.stopPropagation();
|
|
1133
1133
|
return;
|
|
1134
1134
|
}
|
|
1135
|
-
a.key !== "Escape" || !
|
|
1136
|
-
}), l.composerValue && (f.value = l.composerValue, it(f)), t.layout === "page" ?
|
|
1135
|
+
a.key !== "Escape" || !K || (K = !1, fe(), xe());
|
|
1136
|
+
}), l.composerValue && (f.value = l.composerValue, it(f)), t.layout === "page" ? we(f.value, !1) : s === "minimized" ? Ze("minimized", !1) : t.initialDisplayState === void 0 && l.isOpen && we(f.value, !1), Ga(l, o, u, f);
|
|
1137
1137
|
const gt = () => r;
|
|
1138
1138
|
let Wt = b.getState().appearance !== null, ht = null, nt = null, Be = null, Dn = b.getState().isThinking, Fe = null;
|
|
1139
1139
|
const ot = t.taskNotifications;
|
|
@@ -1141,9 +1141,9 @@ async function La(e = {}) {
|
|
|
1141
1141
|
const zn = () => {
|
|
1142
1142
|
We !== null && (window.clearTimeout(We), We = null);
|
|
1143
1143
|
}, mt = () => {
|
|
1144
|
-
|
|
1144
|
+
Y && (Y.hidden = !0);
|
|
1145
1145
|
}, Mn = () => b.getState().assistantDraft.trim().length > 0, gi = async () => {
|
|
1146
|
-
if (!ot || !
|
|
1146
|
+
if (!ot || !Y || He || X || !b.getState().isThinking || Mn())
|
|
1147
1147
|
return;
|
|
1148
1148
|
let a;
|
|
1149
1149
|
try {
|
|
@@ -1151,9 +1151,9 @@ async function La(e = {}) {
|
|
|
1151
1151
|
} catch {
|
|
1152
1152
|
return;
|
|
1153
1153
|
}
|
|
1154
|
-
a.enabled || a.neverSuggest || !b.getState().isThinking || Mn() || He ||
|
|
1154
|
+
a.enabled || a.neverSuggest || !b.getState().isThinking || Mn() || He || X || (Y.hidden = !1);
|
|
1155
1155
|
};
|
|
1156
|
-
|
|
1156
|
+
te?.addEventListener("click", () => {
|
|
1157
1157
|
He = !0, mt(), ot?.enable().catch(() => {
|
|
1158
1158
|
});
|
|
1159
1159
|
}), v?.addEventListener("click", () => {
|
|
@@ -1165,31 +1165,31 @@ async function La(e = {}) {
|
|
|
1165
1165
|
const ft = t.tabGroups;
|
|
1166
1166
|
let Ge = !1;
|
|
1167
1167
|
const wt = async () => {
|
|
1168
|
-
if (!ft || !
|
|
1168
|
+
if (!ft || !V || Ge || X)
|
|
1169
1169
|
return;
|
|
1170
1170
|
const a = await ft.getState().catch(() => null);
|
|
1171
|
-
!a || Ge ||
|
|
1171
|
+
!a || Ge || X || (V.hidden = !a.permissionNeeded);
|
|
1172
1172
|
};
|
|
1173
1173
|
Jo?.addEventListener("click", () => {
|
|
1174
|
-
Ge = !0,
|
|
1174
|
+
Ge = !0, V && (V.hidden = !0), ft?.enable().catch(() => {
|
|
1175
1175
|
}).finally(() => {
|
|
1176
1176
|
Ge = !1, wt();
|
|
1177
1177
|
});
|
|
1178
1178
|
}), Qo?.addEventListener("click", () => {
|
|
1179
|
-
Ge = !0,
|
|
1179
|
+
Ge = !0, V && (V.hidden = !0), ft?.dismiss().catch(() => {
|
|
1180
1180
|
}).finally(() => {
|
|
1181
1181
|
Ge = !1, wt();
|
|
1182
1182
|
});
|
|
1183
1183
|
}), wt();
|
|
1184
1184
|
let $e = null, On = () => {
|
|
1185
1185
|
};
|
|
1186
|
-
const hi = !!t.socialPostDraftHandler, Ht = /* @__PURE__ */ new Map(), Gt = () => f.value.trim().length > 0 ||
|
|
1186
|
+
const hi = !!t.socialPostDraftHandler, Ht = /* @__PURE__ */ new Map(), Gt = () => f.value.trim().length > 0 || $.length > 0, mi = () => {
|
|
1187
1187
|
const a = $e !== null && an(b.getState(), Gt());
|
|
1188
1188
|
_.hidden = !a, a && $e !== null && Oo(_, $e);
|
|
1189
1189
|
};
|
|
1190
1190
|
let qe = null;
|
|
1191
1191
|
const $t = (a = {}) => {
|
|
1192
|
-
|
|
1192
|
+
ye = !0, oe(!0, "newSession"), ie(), K = !1, fe(), b.startNewSession(a), Tt.clear(), f.value = "", $ = [], Me(), it(f), W(), q(), f.focus(), H(b.getState());
|
|
1193
1193
|
}, bt = () => {
|
|
1194
1194
|
t.morningReport !== null && (t.morningReport = null, t.onMorningReportTaskStart?.(), $t());
|
|
1195
1195
|
}, qt = (a) => {
|
|
@@ -1202,16 +1202,16 @@ async function La(e = {}) {
|
|
|
1202
1202
|
"New chat",
|
|
1203
1203
|
sr(),
|
|
1204
1204
|
!1
|
|
1205
|
-
), qe.addEventListener("click", () => $t()),
|
|
1206
|
-
},
|
|
1207
|
-
if (
|
|
1208
|
-
|
|
1205
|
+
), qe.addEventListener("click", () => $t()), ke.insertBefore(qe, le));
|
|
1206
|
+
}, H = (a) => {
|
|
1207
|
+
if (fe(), yn(a.lastErrorCode) ? Fe = a.lastErrorCode : t.billingStatus?.creditsUsed !== null && !re(t.billingStatus) && (Fe = null), on(
|
|
1208
|
+
Ee,
|
|
1209
1209
|
t.billingStatus,
|
|
1210
1210
|
Fe
|
|
1211
1211
|
), t.loginRequired) {
|
|
1212
1212
|
Ht.clear(), ho(
|
|
1213
|
-
|
|
1214
|
-
|
|
1213
|
+
x,
|
|
1214
|
+
U,
|
|
1215
1215
|
qt,
|
|
1216
1216
|
gt,
|
|
1217
1217
|
"Log in to use Pluno on this page.",
|
|
@@ -1223,8 +1223,8 @@ async function La(e = {}) {
|
|
|
1223
1223
|
}
|
|
1224
1224
|
if (t.signupRequired) {
|
|
1225
1225
|
Ht.clear(), ho(
|
|
1226
|
-
|
|
1227
|
-
|
|
1226
|
+
x,
|
|
1227
|
+
U,
|
|
1228
1228
|
qt,
|
|
1229
1229
|
gt,
|
|
1230
1230
|
"Complete signup to unlock your free trial credits.",
|
|
@@ -1234,33 +1234,33 @@ async function La(e = {}) {
|
|
|
1234
1234
|
);
|
|
1235
1235
|
return;
|
|
1236
1236
|
}
|
|
1237
|
-
const d = qa(a),
|
|
1237
|
+
const d = qa(a), y = d !== Cn;
|
|
1238
1238
|
Cn = d;
|
|
1239
|
-
const C =
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1239
|
+
const C = ye || Le.enabled;
|
|
1240
|
+
ye = !1, kr(
|
|
1241
|
+
x,
|
|
1242
|
+
z,
|
|
1243
|
+
U,
|
|
1244
1244
|
qt,
|
|
1245
1245
|
_,
|
|
1246
1246
|
a,
|
|
1247
1247
|
$e,
|
|
1248
1248
|
$e !== null && an(a, Gt()),
|
|
1249
1249
|
C,
|
|
1250
|
-
() =>
|
|
1250
|
+
() => Le.enabled,
|
|
1251
1251
|
Tt,
|
|
1252
1252
|
Ht,
|
|
1253
|
-
|
|
1253
|
+
W,
|
|
1254
1254
|
gt,
|
|
1255
|
-
(
|
|
1256
|
-
|
|
1255
|
+
(M) => {
|
|
1256
|
+
ae() || (bt(), ye = !0, oe(!0, "send"), ie(), b.sendMessage(M));
|
|
1257
1257
|
},
|
|
1258
1258
|
() => {
|
|
1259
|
-
|
|
1259
|
+
ye = !0, oe(!0, "send"), ie(), b.retryLastMessage();
|
|
1260
1260
|
},
|
|
1261
1261
|
t.morningReport,
|
|
1262
1262
|
() => {
|
|
1263
|
-
t.morningReport = null, t.onMorningReportSnooze?.(), zt(),
|
|
1263
|
+
t.morningReport = null, t.onMorningReportSnooze?.(), zt(), H(b.getState());
|
|
1264
1264
|
},
|
|
1265
1265
|
Ut,
|
|
1266
1266
|
t.attachmentPreviewUrlResolver,
|
|
@@ -1269,24 +1269,24 @@ async function La(e = {}) {
|
|
|
1269
1269
|
draftingCandidate: ht,
|
|
1270
1270
|
error: nt,
|
|
1271
1271
|
characterIconOptions: gt(),
|
|
1272
|
-
onSeen: (
|
|
1273
|
-
Oe.add(
|
|
1272
|
+
onSeen: (M) => {
|
|
1273
|
+
Oe.add(M.id), W();
|
|
1274
1274
|
},
|
|
1275
|
-
onDraft: (
|
|
1276
|
-
fi(
|
|
1275
|
+
onDraft: (M) => {
|
|
1276
|
+
fi(M);
|
|
1277
1277
|
},
|
|
1278
|
-
onDismiss: (
|
|
1279
|
-
Oe.add(
|
|
1278
|
+
onDismiss: (M) => {
|
|
1279
|
+
Oe.add(M.id), pt.add(M.id), W(), nt = null, H(b.getState());
|
|
1280
1280
|
},
|
|
1281
|
-
onDisable: (
|
|
1282
|
-
Nt = !0, Oe.add(
|
|
1281
|
+
onDisable: (M) => {
|
|
1282
|
+
Nt = !0, Oe.add(M.id), pt.add(M.id), W(), Xr(t, !0), nt = null, H(b.getState());
|
|
1283
1283
|
}
|
|
1284
1284
|
} : void 0
|
|
1285
|
-
), C ? (
|
|
1285
|
+
), C ? (Pe = x.scrollTop, ie()) : y && ja(a) && ti();
|
|
1286
1286
|
};
|
|
1287
1287
|
return On = zi(
|
|
1288
1288
|
(a) => {
|
|
1289
|
-
$e = a, !
|
|
1289
|
+
$e = a, !X && an(b.getState(), Gt()) && H(b.getState());
|
|
1290
1290
|
},
|
|
1291
1291
|
{
|
|
1292
1292
|
backendUrl: t.backendUrl,
|
|
@@ -1296,15 +1296,15 @@ async function La(e = {}) {
|
|
|
1296
1296
|
), b.on("state", (a) => {
|
|
1297
1297
|
wt();
|
|
1298
1298
|
const d = Dn && !a.isThinking;
|
|
1299
|
-
Dn = a.isThinking, a.isThinking && !a.assistantDraft.trim() && ot && !He && We === null &&
|
|
1299
|
+
Dn = a.isThinking, a.isThinking && !a.assistantDraft.trim() && ot && !He && We === null && Y?.hidden !== !1 && (We = window.setTimeout(() => {
|
|
1300
1300
|
We = null, gi();
|
|
1301
|
-
}, Yi)), (!a.isThinking || a.assistantDraft.trim()) && (zn(), mt()), d && !o.classList.contains("pluno-pa-widget--open") && (et = !0), Ot(), a.appearance ? (Wt = !0,
|
|
1301
|
+
}, Yi)), (!a.isThinking || a.assistantDraft.trim()) && (zn(), mt()), d && !o.classList.contains("pluno-pa-widget--open") && (et = !0), Ot(), a.appearance ? (Wt = !0, Z(
|
|
1302
1302
|
"web-sdk.widget",
|
|
1303
1303
|
"Agent state supplied appearance",
|
|
1304
1304
|
{
|
|
1305
1305
|
appearance: a.appearance
|
|
1306
1306
|
}
|
|
1307
|
-
), jt(a.appearance, "agent.state.appearance")) : Wt && (Wt = !1,
|
|
1307
|
+
), jt(a.appearance, "agent.state.appearance")) : Wt && (Wt = !1, Z(
|
|
1308
1308
|
"web-sdk.widget",
|
|
1309
1309
|
"Agent state cleared appearance; reverting to configured widget options",
|
|
1310
1310
|
{
|
|
@@ -1312,8 +1312,8 @@ async function La(e = {}) {
|
|
|
1312
1312
|
fallbackColorScheme: t.colorScheme,
|
|
1313
1313
|
fallbackFontFamily: t.fontFamily
|
|
1314
1314
|
}
|
|
1315
|
-
), jt({}, "agent.state.appearance-cleared")),
|
|
1316
|
-
}),
|
|
1315
|
+
), jt({}, "agent.state.appearance-cleared")), H(a), q(), d && Nn();
|
|
1316
|
+
}), H(b.getState()), q(), Ut(), {
|
|
1317
1317
|
agent: b,
|
|
1318
1318
|
startNewChat: $t,
|
|
1319
1319
|
host: n,
|
|
@@ -1326,18 +1326,18 @@ async function La(e = {}) {
|
|
|
1326
1326
|
t.billingStatus,
|
|
1327
1327
|
d,
|
|
1328
1328
|
Fe
|
|
1329
|
-
) && (t.billingStatus = d, t.billingStatus?.creditsUsed !== null && !
|
|
1329
|
+
) && (t.billingStatus = d, t.billingStatus?.creditsUsed !== null && !re(t.billingStatus) && (Fe = null), on(
|
|
1330
1330
|
o.querySelector(".pluno-pa-widget__billing-status"),
|
|
1331
1331
|
t.billingStatus,
|
|
1332
1332
|
Fe
|
|
1333
|
-
),
|
|
1333
|
+
), q());
|
|
1334
1334
|
},
|
|
1335
1335
|
updateAuthGate: (a) => {
|
|
1336
1336
|
const d = Qe();
|
|
1337
|
-
t.loginRequired = a.loginRequired === !0, t.signupRequired = a.signupRequired === !0, a.loginButtonLabel !== void 0 && (t.loginButtonLabel = a.loginButtonLabel), a.loginUrl !== void 0 && (t.loginUrl = a.loginUrl), a.signupButtonLabel !== void 0 && (t.signupButtonLabel = a.signupButtonLabel), a.signupUrl !== void 0 && (t.signupUrl = a.signupUrl),
|
|
1337
|
+
t.loginRequired = a.loginRequired === !0, t.signupRequired = a.signupRequired === !0, a.loginButtonLabel !== void 0 && (t.loginButtonLabel = a.loginButtonLabel), a.loginUrl !== void 0 && (t.loginUrl = a.loginUrl), a.signupButtonLabel !== void 0 && (t.signupButtonLabel = a.signupButtonLabel), a.signupUrl !== void 0 && (t.signupUrl = a.signupUrl), Ae(), H(b.getState()), q(), d && !Qe() && Ut();
|
|
1338
1338
|
},
|
|
1339
1339
|
openPanel: () => {
|
|
1340
|
-
|
|
1340
|
+
we(f.value, !1);
|
|
1341
1341
|
},
|
|
1342
1342
|
closePanel: zt,
|
|
1343
1343
|
updateDisplayState: (a) => {
|
|
@@ -1348,22 +1348,22 @@ async function La(e = {}) {
|
|
|
1348
1348
|
Ze("minimized", !1);
|
|
1349
1349
|
},
|
|
1350
1350
|
updateMorningReport: (a) => {
|
|
1351
|
-
t.morningReport = a ?? null,
|
|
1351
|
+
t.morningReport = a ?? null, H(b.getState());
|
|
1352
1352
|
},
|
|
1353
1353
|
destroy: () => {
|
|
1354
|
-
|
|
1354
|
+
X || (W(), X = !0, Ln.disconnect(), Rn?.disconnect(), pi(), window.removeEventListener("resize", Pn), Tn(), ri(), he !== null && window.clearTimeout(he), zn(), On(), Be?.remove(), b.destroy(), Pt.release(), n.remove());
|
|
1355
1355
|
}
|
|
1356
1356
|
};
|
|
1357
1357
|
async function fi(a) {
|
|
1358
1358
|
if (!ht) {
|
|
1359
|
-
ht = a, nt = null,
|
|
1359
|
+
ht = a, nt = null, H(b.getState());
|
|
1360
1360
|
try {
|
|
1361
1361
|
if (!t.socialPostDraftHandler)
|
|
1362
1362
|
throw new Error("Social post drafting is not available here.");
|
|
1363
1363
|
const d = await t.socialPostDraftHandler(a);
|
|
1364
1364
|
if (!d.linkedinPost || !d.xPost)
|
|
1365
1365
|
throw new Error("Pluno did not return a complete social post draft.");
|
|
1366
|
-
Oe.add(a.id), pt.add(a.id),
|
|
1366
|
+
Oe.add(a.id), pt.add(a.id), W(), Be?.remove(), Be = Dr(d, {
|
|
1367
1367
|
socialPostRewardsUrl: t.socialPostRewardsUrl,
|
|
1368
1368
|
onClose: () => {
|
|
1369
1369
|
Be?.remove(), Be = null;
|
|
@@ -1372,26 +1372,26 @@ async function La(e = {}) {
|
|
|
1372
1372
|
} catch (d) {
|
|
1373
1373
|
nt = d instanceof Error ? d.message : "Could not draft social post.";
|
|
1374
1374
|
} finally {
|
|
1375
|
-
ht = null,
|
|
1375
|
+
ht = null, H(b.getState());
|
|
1376
1376
|
}
|
|
1377
1377
|
}
|
|
1378
1378
|
}
|
|
1379
1379
|
function jt(a, d) {
|
|
1380
|
-
const
|
|
1380
|
+
const y = a.accentColor ?? t.accentColor, C = a.colorScheme ?? t.colorScheme, M = a.fontFamily ?? t.fontFamily, Vt = a.scribbleStyle ?? t.scribbleStyle;
|
|
1381
1381
|
r = Qn(
|
|
1382
|
-
|
|
1382
|
+
y,
|
|
1383
1383
|
Vt
|
|
1384
1384
|
), eo(o, r, {
|
|
1385
|
-
accentColor:
|
|
1385
|
+
accentColor: y,
|
|
1386
1386
|
colorScheme: C,
|
|
1387
|
-
fontFamily:
|
|
1387
|
+
fontFamily: M,
|
|
1388
1388
|
scribbleStyle: Vt
|
|
1389
|
-
}),
|
|
1389
|
+
}), Z("web-sdk.widget", "Updated widget appearance", {
|
|
1390
1390
|
source: d,
|
|
1391
1391
|
inputAppearance: a,
|
|
1392
|
-
appliedAccentColor:
|
|
1392
|
+
appliedAccentColor: y,
|
|
1393
1393
|
appliedColorScheme: C,
|
|
1394
|
-
appliedFontFamily:
|
|
1394
|
+
appliedFontFamily: M,
|
|
1395
1395
|
appliedScribbleStyle: Vt,
|
|
1396
1396
|
cssAccent: o.style.getPropertyValue("--pluno-pa-accent")
|
|
1397
1397
|
});
|
|
@@ -1441,7 +1441,7 @@ function eo(e, t, n) {
|
|
|
1441
1441
|
);
|
|
1442
1442
|
for (const r of o)
|
|
1443
1443
|
r.replaceWith(
|
|
1444
|
-
|
|
1444
|
+
Ce(
|
|
1445
1445
|
Array.from(r.classList).join(" "),
|
|
1446
1446
|
t
|
|
1447
1447
|
)
|
|
@@ -1480,7 +1480,7 @@ function Ia({
|
|
|
1480
1480
|
!g && Math.hypot(I, L) < un || (g = !0, e.classList.add("pluno-pa-widget--dragging"), o({ x: p.x + I, y: p.y + L }));
|
|
1481
1481
|
}, T = (m) => {
|
|
1482
1482
|
l === m.pointerId && (m.preventDefault(), m.stopPropagation(), g && (c = { x: m.clientX, y: m.clientY }, r()), h());
|
|
1483
|
-
},
|
|
1483
|
+
}, O = (m) => {
|
|
1484
1484
|
l === m.pointerId && (m.preventDefault(), h());
|
|
1485
1485
|
}, u = (m) => {
|
|
1486
1486
|
if (!c)
|
|
@@ -1497,8 +1497,8 @@ function Ia({
|
|
|
1497
1497
|
let R = null;
|
|
1498
1498
|
m.key === "ArrowUp" ? R = { x: L.x, y: L.y - I } : m.key === "ArrowDown" ? R = { x: L.x, y: L.y + I } : m.key === "ArrowLeft" ? R = { x: L.x - I, y: L.y } : m.key === "ArrowRight" && (R = { x: L.x + I, y: L.y }), R && (m.preventDefault(), m.stopPropagation(), o(R), r());
|
|
1499
1499
|
};
|
|
1500
|
-
return t.addEventListener("pointerdown", E), t.addEventListener("pointermove", P), t.addEventListener("pointerup", T), t.addEventListener("pointercancel",
|
|
1501
|
-
t.removeEventListener("pointerdown", E), t.removeEventListener("pointermove", P), t.removeEventListener("pointerup", T), t.removeEventListener("pointercancel",
|
|
1500
|
+
return t.addEventListener("pointerdown", E), t.addEventListener("pointermove", P), t.addEventListener("pointerup", T), t.addEventListener("pointercancel", O), t.addEventListener("click", u, !0), n.addEventListener("keydown", S), () => {
|
|
1501
|
+
t.removeEventListener("pointerdown", E), t.removeEventListener("pointermove", P), t.removeEventListener("pointerup", T), t.removeEventListener("pointercancel", O), t.removeEventListener("click", u, !0), n.removeEventListener("keydown", S);
|
|
1502
1502
|
};
|
|
1503
1503
|
}
|
|
1504
1504
|
function Ra({
|
|
@@ -1526,23 +1526,23 @@ function Ra({
|
|
|
1526
1526
|
r === u.pointerId && (u.preventDefault(), u.stopPropagation(), g && o(), c());
|
|
1527
1527
|
}, T = (u) => {
|
|
1528
1528
|
r === u.pointerId && (u.preventDefault(), c());
|
|
1529
|
-
},
|
|
1529
|
+
}, O = (u) => {
|
|
1530
1530
|
const m = u.currentTarget.dataset.resizeDirection, I = u.shiftKey ? Io : Ao, L = n();
|
|
1531
|
-
let R = 0,
|
|
1532
|
-
to(m) && (u.key === "ArrowLeft" ? R = -I : u.key === "ArrowRight" ? R = I : u.key === "ArrowUp" ?
|
|
1531
|
+
let R = 0, B = 0;
|
|
1532
|
+
to(m) && (u.key === "ArrowLeft" ? R = -I : u.key === "ArrowRight" ? R = I : u.key === "ArrowUp" ? B = -I : u.key === "ArrowDown" && (B = I), !(R === 0 && B === 0) && (u.preventDefault(), u.stopPropagation(), i(no(L, m, R, B)), o()));
|
|
1533
1533
|
};
|
|
1534
1534
|
for (const u of t)
|
|
1535
|
-
u.addEventListener("pointerdown", h), u.addEventListener("pointermove", E), u.addEventListener("pointerup", P), u.addEventListener("pointercancel", T), u.addEventListener("keydown",
|
|
1535
|
+
u.addEventListener("pointerdown", h), u.addEventListener("pointermove", E), u.addEventListener("pointerup", P), u.addEventListener("pointercancel", T), u.addEventListener("keydown", O);
|
|
1536
1536
|
return () => {
|
|
1537
1537
|
for (const u of t)
|
|
1538
|
-
u.removeEventListener("pointerdown", h), u.removeEventListener("pointermove", E), u.removeEventListener("pointerup", P), u.removeEventListener("pointercancel", T), u.removeEventListener("keydown",
|
|
1538
|
+
u.removeEventListener("pointerdown", h), u.removeEventListener("pointermove", E), u.removeEventListener("pointerup", P), u.removeEventListener("pointercancel", T), u.removeEventListener("keydown", O);
|
|
1539
1539
|
};
|
|
1540
1540
|
}
|
|
1541
1541
|
function to(e) {
|
|
1542
1542
|
return e === "left" || e === "right" || e === "top" || e === "bottom" || e === "top-left" || e === "top-right" || e === "bottom-left" || e === "bottom-right";
|
|
1543
1543
|
}
|
|
1544
1544
|
function no(e, t, n, i) {
|
|
1545
|
-
const o =
|
|
1545
|
+
const o = ee(), r = oo({
|
|
1546
1546
|
leading: e.position.x,
|
|
1547
1547
|
length: e.size.width,
|
|
1548
1548
|
delta: n,
|
|
@@ -1560,11 +1560,11 @@ function no(e, t, n, i) {
|
|
|
1560
1560
|
delta: i,
|
|
1561
1561
|
resizeLeading: t.startsWith("top") || t === "top",
|
|
1562
1562
|
resizeTrailing: t.startsWith("bottom") || t === "bottom",
|
|
1563
|
-
minLeading:
|
|
1563
|
+
minLeading: Re,
|
|
1564
1564
|
maxTrailing: o.height - A,
|
|
1565
1565
|
minLength: Math.min(
|
|
1566
1566
|
_n,
|
|
1567
|
-
o.height -
|
|
1567
|
+
o.height - Re - A
|
|
1568
1568
|
)
|
|
1569
1569
|
});
|
|
1570
1570
|
return {
|
|
@@ -1586,10 +1586,10 @@ function oo({
|
|
|
1586
1586
|
if (i) {
|
|
1587
1587
|
const g = e + n;
|
|
1588
1588
|
if (g >= r) {
|
|
1589
|
-
const h =
|
|
1589
|
+
const h = Q(g, r, p - s);
|
|
1590
1590
|
return { leading: h, length: p - h };
|
|
1591
1591
|
}
|
|
1592
|
-
const c =
|
|
1592
|
+
const c = Q(
|
|
1593
1593
|
p + r - g,
|
|
1594
1594
|
p,
|
|
1595
1595
|
l
|
|
@@ -1599,14 +1599,14 @@ function oo({
|
|
|
1599
1599
|
if (o) {
|
|
1600
1600
|
const g = p + n;
|
|
1601
1601
|
if (g <= l) {
|
|
1602
|
-
const h =
|
|
1602
|
+
const h = Q(
|
|
1603
1603
|
g,
|
|
1604
1604
|
e + s,
|
|
1605
1605
|
l
|
|
1606
1606
|
);
|
|
1607
1607
|
return { leading: e, length: h - e };
|
|
1608
1608
|
}
|
|
1609
|
-
const c =
|
|
1609
|
+
const c = Q(
|
|
1610
1610
|
e - (g - l),
|
|
1611
1611
|
r,
|
|
1612
1612
|
e
|
|
@@ -1616,7 +1616,7 @@ function oo({
|
|
|
1616
1616
|
return { leading: e, length: t };
|
|
1617
1617
|
}
|
|
1618
1618
|
function Ct(e, t = !0) {
|
|
1619
|
-
const n =
|
|
1619
|
+
const n = ee();
|
|
1620
1620
|
if (e.classList.contains("pluno-pa-widget--minimized"))
|
|
1621
1621
|
return { width: Xn, height: Xn };
|
|
1622
1622
|
const i = e.getBoundingClientRect(), o = !e.classList.contains("pluno-pa-widget--open") && !e.classList.contains("pluno-pa-widget--closing");
|
|
@@ -1626,10 +1626,10 @@ function Ct(e, t = !0) {
|
|
|
1626
1626
|
};
|
|
1627
1627
|
}
|
|
1628
1628
|
function Da() {
|
|
1629
|
-
const e =
|
|
1629
|
+
const e = ee();
|
|
1630
1630
|
return {
|
|
1631
1631
|
width: Math.min(
|
|
1632
|
-
|
|
1632
|
+
Q(
|
|
1633
1633
|
e.width * ba,
|
|
1634
1634
|
bn,
|
|
1635
1635
|
wa
|
|
@@ -1637,12 +1637,12 @@ function Da() {
|
|
|
1637
1637
|
e.width - A * 2
|
|
1638
1638
|
),
|
|
1639
1639
|
height: Math.min(
|
|
1640
|
-
|
|
1640
|
+
Q(
|
|
1641
1641
|
e.height * xa,
|
|
1642
1642
|
_n,
|
|
1643
1643
|
_a
|
|
1644
1644
|
),
|
|
1645
|
-
e.height -
|
|
1645
|
+
e.height - Re - A
|
|
1646
1646
|
)
|
|
1647
1647
|
};
|
|
1648
1648
|
}
|
|
@@ -1650,9 +1650,9 @@ function at(e = null) {
|
|
|
1650
1650
|
return e ? kt(e) : Da();
|
|
1651
1651
|
}
|
|
1652
1652
|
function kt(e) {
|
|
1653
|
-
const t =
|
|
1653
|
+
const t = ee();
|
|
1654
1654
|
return {
|
|
1655
|
-
width:
|
|
1655
|
+
width: Q(
|
|
1656
1656
|
e.width,
|
|
1657
1657
|
Math.min(
|
|
1658
1658
|
bn,
|
|
@@ -1663,15 +1663,15 @@ function kt(e) {
|
|
|
1663
1663
|
t.width - A * 2
|
|
1664
1664
|
)
|
|
1665
1665
|
),
|
|
1666
|
-
height:
|
|
1666
|
+
height: Q(
|
|
1667
1667
|
e.height,
|
|
1668
1668
|
Math.min(
|
|
1669
1669
|
_n,
|
|
1670
|
-
t.height -
|
|
1670
|
+
t.height - Re - A
|
|
1671
1671
|
),
|
|
1672
1672
|
Math.max(
|
|
1673
1673
|
A,
|
|
1674
|
-
t.height -
|
|
1674
|
+
t.height - Re - A
|
|
1675
1675
|
)
|
|
1676
1676
|
)
|
|
1677
1677
|
};
|
|
@@ -1691,7 +1691,7 @@ function za(e, t, n) {
|
|
|
1691
1691
|
const r = e.getBoundingClientRect();
|
|
1692
1692
|
if (r.width > 0 || r.height > 0)
|
|
1693
1693
|
return { x: r.left, y: r.top };
|
|
1694
|
-
const l =
|
|
1694
|
+
const l = ee();
|
|
1695
1695
|
return {
|
|
1696
1696
|
x: t === "bottom-left" ? 26 : l.width - 26 - n.width,
|
|
1697
1697
|
y: l.height - 24 - n.height
|
|
@@ -1706,16 +1706,16 @@ function Zt(e, t, n) {
|
|
|
1706
1706
|
) : Ma(n === "bottom-left" ? "bottom-left" : "bottom-right", i, ma);
|
|
1707
1707
|
}
|
|
1708
1708
|
function Ma(e, t, n) {
|
|
1709
|
-
const i =
|
|
1709
|
+
const i = ee();
|
|
1710
1710
|
return {
|
|
1711
1711
|
x: e.endsWith("right") ? Math.max(0, i.width - t.width - n) : n,
|
|
1712
1712
|
y: e.startsWith("bottom") ? Math.max(0, i.height - t.height - n) : n
|
|
1713
1713
|
};
|
|
1714
1714
|
}
|
|
1715
1715
|
function gn(e, t, n) {
|
|
1716
|
-
const i =
|
|
1716
|
+
const i = ee(), o = A + Ba(e);
|
|
1717
1717
|
return {
|
|
1718
|
-
x:
|
|
1718
|
+
x: Q(
|
|
1719
1719
|
t.x,
|
|
1720
1720
|
A,
|
|
1721
1721
|
Math.max(
|
|
@@ -1723,7 +1723,7 @@ function gn(e, t, n) {
|
|
|
1723
1723
|
i.width - n.width - A
|
|
1724
1724
|
)
|
|
1725
1725
|
),
|
|
1726
|
-
y:
|
|
1726
|
+
y: Q(
|
|
1727
1727
|
t.y,
|
|
1728
1728
|
o,
|
|
1729
1729
|
Math.max(
|
|
@@ -1734,14 +1734,14 @@ function gn(e, t, n) {
|
|
|
1734
1734
|
};
|
|
1735
1735
|
}
|
|
1736
1736
|
function zo(e, t) {
|
|
1737
|
-
const n =
|
|
1737
|
+
const n = ee();
|
|
1738
1738
|
return {
|
|
1739
1739
|
x: e.anchor.endsWith("right") ? n.width - t.width - e.x : e.x,
|
|
1740
1740
|
y: e.anchor.startsWith("bottom") ? n.height - t.height - e.y : e.y
|
|
1741
1741
|
};
|
|
1742
1742
|
}
|
|
1743
1743
|
function Oa(e, t) {
|
|
1744
|
-
const n = Ua(e, t), i =
|
|
1744
|
+
const n = Ua(e, t), i = ee();
|
|
1745
1745
|
return {
|
|
1746
1746
|
anchor: n,
|
|
1747
1747
|
x: n.endsWith("right") ? i.width - e.x - t.width : e.x,
|
|
@@ -1749,7 +1749,7 @@ function Oa(e, t) {
|
|
|
1749
1749
|
};
|
|
1750
1750
|
}
|
|
1751
1751
|
function Ua(e, t) {
|
|
1752
|
-
const n =
|
|
1752
|
+
const n = ee(), i = e.x + t.width / 2, r = e.y + t.height / 2 <= n.height / 2 ? "top" : "bottom", l = i <= n.width / 2 ? "left" : "right";
|
|
1753
1753
|
return `${r}-${l}`;
|
|
1754
1754
|
}
|
|
1755
1755
|
function Ba(e) {
|
|
@@ -1763,9 +1763,9 @@ function Jt(e, t, n, i = null) {
|
|
|
1763
1763
|
return yt(l, r);
|
|
1764
1764
|
}
|
|
1765
1765
|
function yt(e, t) {
|
|
1766
|
-
const n =
|
|
1766
|
+
const n = ee();
|
|
1767
1767
|
return {
|
|
1768
|
-
x:
|
|
1768
|
+
x: Q(
|
|
1769
1769
|
e.x,
|
|
1770
1770
|
A,
|
|
1771
1771
|
Math.max(
|
|
@@ -1773,17 +1773,17 @@ function yt(e, t) {
|
|
|
1773
1773
|
n.width - t.width - A
|
|
1774
1774
|
)
|
|
1775
1775
|
),
|
|
1776
|
-
y:
|
|
1776
|
+
y: Q(
|
|
1777
1777
|
e.y,
|
|
1778
|
-
|
|
1778
|
+
Re,
|
|
1779
1779
|
Math.max(
|
|
1780
|
-
|
|
1780
|
+
Re,
|
|
1781
1781
|
n.height - t.height - A
|
|
1782
1782
|
)
|
|
1783
1783
|
)
|
|
1784
1784
|
};
|
|
1785
1785
|
}
|
|
1786
|
-
function
|
|
1786
|
+
function Ie(e, t) {
|
|
1787
1787
|
if (e.classList.toggle("pluno-pa-widget--custom-position", t !== null), !t) {
|
|
1788
1788
|
e.style.removeProperty("left"), e.style.removeProperty("top"), e.style.removeProperty("right"), e.style.removeProperty("bottom");
|
|
1789
1789
|
return;
|
|
@@ -1796,7 +1796,7 @@ function Fa(e, t) {
|
|
|
1796
1796
|
function io(e) {
|
|
1797
1797
|
e.style.removeProperty("--pluno-pa-panel-offset-x"), e.style.removeProperty("--pluno-pa-panel-offset-y");
|
|
1798
1798
|
}
|
|
1799
|
-
function
|
|
1799
|
+
function ee() {
|
|
1800
1800
|
return {
|
|
1801
1801
|
width: window.innerWidth || document.documentElement.clientWidth || Po + A * 2,
|
|
1802
1802
|
height: window.innerHeight || document.documentElement.clientHeight || To + A * 2
|
|
@@ -1811,10 +1811,10 @@ function Qt(e) {
|
|
|
1811
1811
|
height: Math.round(t.height)
|
|
1812
1812
|
};
|
|
1813
1813
|
}
|
|
1814
|
-
function
|
|
1814
|
+
function Q(e, t, n) {
|
|
1815
1815
|
return Math.min(Math.max(e, t), n);
|
|
1816
1816
|
}
|
|
1817
|
-
function
|
|
1817
|
+
function Z(e, t, n) {
|
|
1818
1818
|
if (typeof window > "u")
|
|
1819
1819
|
return;
|
|
1820
1820
|
const i = window, o = {
|
|
@@ -1828,7 +1828,7 @@ function X(e, t, n) {
|
|
|
1828
1828
|
);
|
|
1829
1829
|
}
|
|
1830
1830
|
function Wa(e, t) {
|
|
1831
|
-
|
|
1831
|
+
Z("web-sdk.widget.position", e, t);
|
|
1832
1832
|
}
|
|
1833
1833
|
function en(e, t, n, i) {
|
|
1834
1834
|
const o = t.value.trim();
|
|
@@ -1934,7 +1934,7 @@ function Za(e, t, n, i) {
|
|
|
1934
1934
|
10
|
|
1935
1935
|
)
|
|
1936
1936
|
), o.appendChild(
|
|
1937
|
-
|
|
1937
|
+
Ce(
|
|
1938
1938
|
"pluno-pa-widget__character--launcher",
|
|
1939
1939
|
t
|
|
1940
1940
|
)
|
|
@@ -1973,21 +1973,21 @@ function Ja(e) {
|
|
|
1973
1973
|
pr(),
|
|
1974
1974
|
!0
|
|
1975
1975
|
)
|
|
1976
|
-
), n.appendChild(s), n.appendChild(nr()), t.appendChild(n), t.appendChild(Qa()), t.appendChild(er()), t.appendChild(tr()), t.appendChild(
|
|
1977
|
-
|
|
1978
|
-
), t.appendChild(
|
|
1979
|
-
|
|
1976
|
+
), n.appendChild(s), n.appendChild(nr()), t.appendChild(n), t.appendChild(Qa()), t.appendChild(er()), t.appendChild(tr()), t.appendChild(Se("left", "Resize Pluno from left")), t.appendChild(
|
|
1977
|
+
Se("right", "Resize Pluno from right")
|
|
1978
|
+
), t.appendChild(Se("top", "Resize Pluno from top")), t.appendChild(
|
|
1979
|
+
Se("bottom", "Resize Pluno from bottom")
|
|
1980
1980
|
), t.appendChild(
|
|
1981
|
-
|
|
1981
|
+
Se("top-left", "Resize Pluno from top left")
|
|
1982
1982
|
), t.appendChild(
|
|
1983
|
-
|
|
1983
|
+
Se("top-right", "Resize Pluno from top right")
|
|
1984
1984
|
), t.appendChild(
|
|
1985
|
-
|
|
1985
|
+
Se("bottom-left", "Resize Pluno from bottom left")
|
|
1986
1986
|
), t.appendChild(
|
|
1987
|
-
|
|
1987
|
+
Se("bottom-right", "Resize Pluno from bottom right")
|
|
1988
1988
|
), t;
|
|
1989
1989
|
}
|
|
1990
|
-
function
|
|
1990
|
+
function Se(e, t) {
|
|
1991
1991
|
const n = document.createElement("button");
|
|
1992
1992
|
return n.type = "button", n.className = [
|
|
1993
1993
|
"pluno-pa-widget__resize-handle",
|
|
@@ -2071,7 +2071,7 @@ function nr() {
|
|
|
2071
2071
|
function or(e) {
|
|
2072
2072
|
const t = document.createElement("div");
|
|
2073
2073
|
return t.className = "pluno-pa-widget__empty-state", t.appendChild(
|
|
2074
|
-
|
|
2074
|
+
Ce(
|
|
2075
2075
|
"pluno-pa-widget__character--empty",
|
|
2076
2076
|
e
|
|
2077
2077
|
)
|
|
@@ -2093,7 +2093,7 @@ function Oo(e, t) {
|
|
|
2093
2093
|
)
|
|
2094
2094
|
);
|
|
2095
2095
|
}
|
|
2096
|
-
function
|
|
2096
|
+
function Ce(e, t) {
|
|
2097
2097
|
const n = `pluno-pa-character-${Jn}`;
|
|
2098
2098
|
Jn += 1;
|
|
2099
2099
|
const i = t.scribbleStyle ? ar(t.accentColor, n) : ir(t.accentColor, n), o = e.split(/\s+/).filter(Boolean);
|
|
@@ -2122,7 +2122,7 @@ function ir(e, t) {
|
|
|
2122
2122
|
y2: "1040",
|
|
2123
2123
|
gradientUnits: "userSpaceOnUse"
|
|
2124
2124
|
});
|
|
2125
|
-
|
|
2125
|
+
F(l, "0", n.top), F(l, "0.36", n.middle), F(l, "0.72", n.bottom), F(l, "1", n.bottom);
|
|
2126
2126
|
const s = w(r, "linearGradient", {
|
|
2127
2127
|
id: i.boltEdge,
|
|
2128
2128
|
x1: "470",
|
|
@@ -2131,28 +2131,28 @@ function ir(e, t) {
|
|
|
2131
2131
|
y2: "980",
|
|
2132
2132
|
gradientUnits: "userSpaceOnUse"
|
|
2133
2133
|
});
|
|
2134
|
-
|
|
2134
|
+
F(s, "0", n.edgeStart), F(s, "0.32", n.edgeMiddle), F(s, "0.78", n.edgeEnd), F(s, "1", n.edgeEnd);
|
|
2135
2135
|
const p = w(r, "radialGradient", {
|
|
2136
2136
|
id: i.boltGlow,
|
|
2137
2137
|
cx: "50%",
|
|
2138
2138
|
cy: "22%",
|
|
2139
2139
|
r: "82%"
|
|
2140
2140
|
});
|
|
2141
|
-
|
|
2141
|
+
F(p, "0", n.glow, "0.72"), F(p, "0.5", n.middle, "0.44"), F(p, "1", n.bottom, "0");
|
|
2142
2142
|
const g = w(r, "radialGradient", {
|
|
2143
2143
|
id: i.eyeWhite,
|
|
2144
2144
|
cx: "35%",
|
|
2145
2145
|
cy: "25%",
|
|
2146
2146
|
r: "70%"
|
|
2147
2147
|
});
|
|
2148
|
-
|
|
2148
|
+
F(g, "0", "#ffffff"), F(g, "0.72", "#ffffff"), F(g, "1", "#e5e5e5");
|
|
2149
2149
|
const c = w(r, "radialGradient", {
|
|
2150
2150
|
id: i.pupil,
|
|
2151
2151
|
cx: "42%",
|
|
2152
2152
|
cy: "38%",
|
|
2153
2153
|
r: "65%"
|
|
2154
2154
|
});
|
|
2155
|
-
|
|
2155
|
+
F(c, "0", "#2a1f10"), F(c, "0.52", "#080604"), F(c, "1", "#000000");
|
|
2156
2156
|
const h = w(r, "filter", {
|
|
2157
2157
|
id: i.softDropShadow,
|
|
2158
2158
|
x: "-18%",
|
|
@@ -2231,27 +2231,27 @@ function ir(e, t) {
|
|
|
2231
2231
|
"flood-color": "#000000",
|
|
2232
2232
|
"flood-opacity": "0.22"
|
|
2233
2233
|
});
|
|
2234
|
-
const
|
|
2235
|
-
w(
|
|
2234
|
+
const O = w(r, "clipPath", { id: i.boltClip });
|
|
2235
|
+
w(O, "path", { d: vt });
|
|
2236
2236
|
const u = w(o, "g", {
|
|
2237
|
-
filter:
|
|
2237
|
+
filter: J(i.softDropShadow)
|
|
2238
2238
|
});
|
|
2239
2239
|
w(u, "path", {
|
|
2240
2240
|
d: vt,
|
|
2241
|
-
fill:
|
|
2241
|
+
fill: J(i.boltEdge)
|
|
2242
2242
|
});
|
|
2243
2243
|
const S = "M546 166 C522 166 505 180 499 204 L397 606 C390 630 406 646 432 646 L526 646 C568 646 590 672 581 712 L512 1001 C510 1010 518 1014 524 1006 L875 475 C886 458 878 449 855 449 L814 449 C764 449 745 415 769 374 L884 200 C894 181 883 161 858 161 Z";
|
|
2244
2244
|
w(u, "path", {
|
|
2245
2245
|
d: S,
|
|
2246
|
-
fill:
|
|
2247
|
-
filter:
|
|
2246
|
+
fill: J(i.boltFill),
|
|
2247
|
+
filter: J(i.innerDepth)
|
|
2248
2248
|
}), w(u, "path", {
|
|
2249
2249
|
d: S,
|
|
2250
|
-
fill:
|
|
2250
|
+
fill: J(i.boltGlow),
|
|
2251
2251
|
opacity: "0.74"
|
|
2252
2252
|
});
|
|
2253
2253
|
const m = w(u, "g", {
|
|
2254
|
-
"clip-path":
|
|
2254
|
+
"clip-path": J(i.boltClip),
|
|
2255
2255
|
opacity: "0.42"
|
|
2256
2256
|
});
|
|
2257
2257
|
w(m, "path", {
|
|
@@ -2276,7 +2276,7 @@ function ir(e, t) {
|
|
|
2276
2276
|
"stroke-linecap": "round",
|
|
2277
2277
|
opacity: "0.48"
|
|
2278
2278
|
});
|
|
2279
|
-
const I = w(o, "g", { filter:
|
|
2279
|
+
const I = w(o, "g", { filter: J(i.eyeShadow) });
|
|
2280
2280
|
return ao(
|
|
2281
2281
|
I,
|
|
2282
2282
|
"rotate(-2 528 463)",
|
|
@@ -2326,8 +2326,8 @@ function ar(e, t) {
|
|
|
2326
2326
|
xChannelSelector: "R",
|
|
2327
2327
|
yChannelSelector: "G"
|
|
2328
2328
|
});
|
|
2329
|
-
const p = w(o, "g", { filter:
|
|
2330
|
-
"clip-path":
|
|
2329
|
+
const p = w(o, "g", { filter: J(i.wobble) }), g = w(p, "g", {
|
|
2330
|
+
"clip-path": J(i.clip)
|
|
2331
2331
|
});
|
|
2332
2332
|
return w(g, "path", {
|
|
2333
2333
|
d: xi(),
|
|
@@ -2377,14 +2377,14 @@ function ao(e, t, n, i, o, r, l, s, p) {
|
|
|
2377
2377
|
cy: i,
|
|
2378
2378
|
rx: "73",
|
|
2379
2379
|
ry: "80",
|
|
2380
|
-
fill:
|
|
2380
|
+
fill: J(p.eyeWhite)
|
|
2381
2381
|
}), w(g, "ellipse", {
|
|
2382
2382
|
cx: o,
|
|
2383
2383
|
cy: r,
|
|
2384
2384
|
rx: "49",
|
|
2385
2385
|
ry: "57",
|
|
2386
|
-
fill:
|
|
2387
|
-
filter:
|
|
2386
|
+
fill: J(p.pupil),
|
|
2387
|
+
filter: J(p.pupilGloss)
|
|
2388
2388
|
}), w(g, "circle", {
|
|
2389
2389
|
cx: l,
|
|
2390
2390
|
cy: s,
|
|
@@ -2419,11 +2419,11 @@ function w(e, t, n = {}) {
|
|
|
2419
2419
|
const i = k(t, n);
|
|
2420
2420
|
return e.appendChild(i), i;
|
|
2421
2421
|
}
|
|
2422
|
-
function
|
|
2422
|
+
function F(e, t, n, i) {
|
|
2423
2423
|
const o = { offset: t, "stop-color": n };
|
|
2424
2424
|
i !== void 0 && (o["stop-opacity"] = i), w(e, "stop", o);
|
|
2425
2425
|
}
|
|
2426
|
-
function
|
|
2426
|
+
function J(e) {
|
|
2427
2427
|
return `url(#${e})`;
|
|
2428
2428
|
}
|
|
2429
2429
|
function Lt(e, t, n, i) {
|
|
@@ -2545,7 +2545,7 @@ function nn(e, t, n) {
|
|
|
2545
2545
|
), i;
|
|
2546
2546
|
}
|
|
2547
2547
|
function lr(e) {
|
|
2548
|
-
const t =
|
|
2548
|
+
const t = ue(
|
|
2549
2549
|
"0 0 24 24",
|
|
2550
2550
|
e,
|
|
2551
2551
|
e,
|
|
@@ -2556,7 +2556,7 @@ function lr(e) {
|
|
|
2556
2556
|
return t.appendChild(k("path", { d: "m6 9 6 6 6-6" })), t;
|
|
2557
2557
|
}
|
|
2558
2558
|
function sr() {
|
|
2559
|
-
const e =
|
|
2559
|
+
const e = ue(
|
|
2560
2560
|
"0 0 24 24",
|
|
2561
2561
|
17,
|
|
2562
2562
|
17,
|
|
@@ -2575,7 +2575,7 @@ function sr() {
|
|
|
2575
2575
|
), e;
|
|
2576
2576
|
}
|
|
2577
2577
|
function pr() {
|
|
2578
|
-
const e =
|
|
2578
|
+
const e = ue(
|
|
2579
2579
|
"0 0 24 24",
|
|
2580
2580
|
17,
|
|
2581
2581
|
17,
|
|
@@ -2586,7 +2586,7 @@ function pr() {
|
|
|
2586
2586
|
return e.appendChild(k("path", { d: "M3 12a9 9 0 1 0 3-6.7" })), e.appendChild(k("path", { d: "M3 4v5h5" })), e.appendChild(k("path", { d: "M12 7v5l3 2" })), e;
|
|
2587
2587
|
}
|
|
2588
2588
|
function dr() {
|
|
2589
|
-
const e =
|
|
2589
|
+
const e = ue(
|
|
2590
2590
|
"0 0 24 24",
|
|
2591
2591
|
15,
|
|
2592
2592
|
15,
|
|
@@ -2597,7 +2597,7 @@ function dr() {
|
|
|
2597
2597
|
return e.appendChild(k("path", { d: "M18 6 6 18" })), e.appendChild(k("path", { d: "m6 6 12 12" })), e;
|
|
2598
2598
|
}
|
|
2599
2599
|
function Wo() {
|
|
2600
|
-
const e =
|
|
2600
|
+
const e = ue(
|
|
2601
2601
|
"0 0 24 24",
|
|
2602
2602
|
14,
|
|
2603
2603
|
14,
|
|
@@ -2610,7 +2610,7 @@ function Wo() {
|
|
|
2610
2610
|
), e.appendChild(k("polyline", { points: "5 12 12 5 19 12" })), e;
|
|
2611
2611
|
}
|
|
2612
2612
|
function cr() {
|
|
2613
|
-
const e =
|
|
2613
|
+
const e = ue(
|
|
2614
2614
|
"0 0 24 24",
|
|
2615
2615
|
16,
|
|
2616
2616
|
16,
|
|
@@ -2628,7 +2628,7 @@ function cr() {
|
|
|
2628
2628
|
), e;
|
|
2629
2629
|
}
|
|
2630
2630
|
function ur() {
|
|
2631
|
-
const e =
|
|
2631
|
+
const e = ue("0 0 24 24", 19, 19, "none", "currentColor");
|
|
2632
2632
|
return e.setAttribute(
|
|
2633
2633
|
"class",
|
|
2634
2634
|
"pluno-pa-widget__paperclip-icon pluno-pa-widget__paperclip-icon--scribble"
|
|
@@ -2643,7 +2643,7 @@ function ur() {
|
|
|
2643
2643
|
), e;
|
|
2644
2644
|
}
|
|
2645
2645
|
function gr() {
|
|
2646
|
-
const e =
|
|
2646
|
+
const e = ue("0 0 24 24", 18, 18, "currentColor");
|
|
2647
2647
|
return e.appendChild(
|
|
2648
2648
|
k("rect", {
|
|
2649
2649
|
x: "6",
|
|
@@ -2655,7 +2655,7 @@ function gr() {
|
|
|
2655
2655
|
), e;
|
|
2656
2656
|
}
|
|
2657
2657
|
function hr() {
|
|
2658
|
-
const e =
|
|
2658
|
+
const e = ue(
|
|
2659
2659
|
"0 0 24 24",
|
|
2660
2660
|
12,
|
|
2661
2661
|
12,
|
|
@@ -2666,7 +2666,7 @@ function hr() {
|
|
|
2666
2666
|
return e.appendChild(k("path", { d: "M18 6 6 18" })), e.appendChild(k("path", { d: "m6 6 12 12" })), e;
|
|
2667
2667
|
}
|
|
2668
2668
|
function mr() {
|
|
2669
|
-
const e =
|
|
2669
|
+
const e = ue(
|
|
2670
2670
|
"0 0 24 24",
|
|
2671
2671
|
13,
|
|
2672
2672
|
13,
|
|
@@ -2689,7 +2689,7 @@ function mr() {
|
|
|
2689
2689
|
})
|
|
2690
2690
|
), e;
|
|
2691
2691
|
}
|
|
2692
|
-
function
|
|
2692
|
+
function ue(e, t, n, i, o, r) {
|
|
2693
2693
|
const l = {
|
|
2694
2694
|
viewBox: e,
|
|
2695
2695
|
width: String(t),
|
|
@@ -2726,13 +2726,13 @@ function wr(e) {
|
|
|
2726
2726
|
const t = xn(e), n = Ho(e);
|
|
2727
2727
|
if (t === "image" && n) {
|
|
2728
2728
|
const i = document.createElement("img");
|
|
2729
|
-
return i.src = n, i.alt = "", i.setAttribute("aria-hidden", "true"), i.addEventListener("error", () => i.replaceWith(
|
|
2729
|
+
return i.src = n, i.alt = "", i.setAttribute("aria-hidden", "true"), i.addEventListener("error", () => i.replaceWith(ce(e))), i;
|
|
2730
2730
|
}
|
|
2731
2731
|
if (t === "video" && n) {
|
|
2732
2732
|
const i = document.createElement("video");
|
|
2733
|
-
return i.src = n, i.muted = !0, i.preload = "metadata", i.setAttribute("aria-hidden", "true"), i.addEventListener("error", () => i.replaceWith(
|
|
2733
|
+
return i.src = n, i.muted = !0, i.preload = "metadata", i.setAttribute("aria-hidden", "true"), i.addEventListener("error", () => i.replaceWith(ce(e))), i.addEventListener("stalled", () => i.replaceWith(ce(e))), i;
|
|
2734
2734
|
}
|
|
2735
|
-
return
|
|
2735
|
+
return ce(e);
|
|
2736
2736
|
}
|
|
2737
2737
|
function br(e, t) {
|
|
2738
2738
|
const n = xn(e), i = Ho(e);
|
|
@@ -2743,7 +2743,7 @@ function br(e, t) {
|
|
|
2743
2743
|
o.addEventListener(
|
|
2744
2744
|
"error",
|
|
2745
2745
|
() => o.replaceWith(
|
|
2746
|
-
|
|
2746
|
+
ce(e, "message")
|
|
2747
2747
|
),
|
|
2748
2748
|
{ once: !0 }
|
|
2749
2749
|
), o.src = l ?? i;
|
|
@@ -2755,15 +2755,15 @@ function br(e, t) {
|
|
|
2755
2755
|
}
|
|
2756
2756
|
if (n === "pdf" && i) {
|
|
2757
2757
|
const o = document.createElement("object");
|
|
2758
|
-
return o.className = "pluno-pa-widget__message-attachment-preview pluno-pa-widget__message-attachment-preview--pdf", o.data = i, o.type = "application/pdf", o.setAttribute("aria-label", e.name), o.addEventListener("error", () => o.replaceWith(
|
|
2758
|
+
return o.className = "pluno-pa-widget__message-attachment-preview pluno-pa-widget__message-attachment-preview--pdf", o.data = i, o.type = "application/pdf", o.setAttribute("aria-label", e.name), o.addEventListener("error", () => o.replaceWith(ce(e, "message"))), o.appendChild(ce(e, "message")), o;
|
|
2759
2759
|
}
|
|
2760
2760
|
if (n === "video" && i) {
|
|
2761
2761
|
const o = document.createElement("video");
|
|
2762
|
-
return o.className = "pluno-pa-widget__message-attachment-preview", o.src = i, o.muted = !0, o.preload = "metadata", o.addEventListener("error", () => o.replaceWith(
|
|
2762
|
+
return o.className = "pluno-pa-widget__message-attachment-preview", o.src = i, o.muted = !0, o.preload = "metadata", o.addEventListener("error", () => o.replaceWith(ce(e, "message"))), o.addEventListener("stalled", () => o.replaceWith(ce(e, "message"))), o;
|
|
2763
2763
|
}
|
|
2764
|
-
return
|
|
2764
|
+
return ce(e, "message");
|
|
2765
2765
|
}
|
|
2766
|
-
function
|
|
2766
|
+
function ce(e, t = "composer") {
|
|
2767
2767
|
if (t === "composer") {
|
|
2768
2768
|
const r = document.createElement("span");
|
|
2769
2769
|
return r.className = "pluno-pa-widget__attachment-file", r.textContent = so(e), r;
|
|
@@ -2802,7 +2802,7 @@ function on(e, t, n = null) {
|
|
|
2802
2802
|
e && (e.hidden = !0, e.replaceChildren());
|
|
2803
2803
|
return;
|
|
2804
2804
|
}
|
|
2805
|
-
e.hidden = !1, e.replaceChildren(), e.className = "pluno-pa-widget__billing-status",
|
|
2805
|
+
e.hidden = !1, e.replaceChildren(), e.className = "pluno-pa-widget__billing-status", re(t) || yn(n) ? e.appendChild(
|
|
2806
2806
|
yr(t, n)
|
|
2807
2807
|
) : Go(t) && e.appendChild(vr(t));
|
|
2808
2808
|
}
|
|
@@ -2835,22 +2835,22 @@ function vr(e) {
|
|
|
2835
2835
|
), t;
|
|
2836
2836
|
}
|
|
2837
2837
|
function mn(e, t) {
|
|
2838
|
-
return e !== null && (
|
|
2838
|
+
return e !== null && (re(e) || Go(e) || yn(t));
|
|
2839
2839
|
}
|
|
2840
2840
|
function po(e, t, n) {
|
|
2841
2841
|
return mn(t, n) || Sr(t) ? !0 : !mn(e, n);
|
|
2842
2842
|
}
|
|
2843
2843
|
function Sr(e) {
|
|
2844
|
-
return e != null && (e.creditsUsed !== null || e.creditLimit !== null || e.creditsRemaining !== null ||
|
|
2844
|
+
return e != null && (e.creditsUsed !== null || e.creditLimit !== null || e.creditsRemaining !== null || re(e));
|
|
2845
2845
|
}
|
|
2846
|
-
function
|
|
2846
|
+
function re(e) {
|
|
2847
2847
|
return e?.limitExceeded === !0 || !!e?.paymentIssue;
|
|
2848
2848
|
}
|
|
2849
2849
|
function yn(e) {
|
|
2850
2850
|
return e === "limit_exceeded" || e === "subscription_required" || e === "subscription_inactive" || e === "payment_issue" || e === "subscription_invalid" || e === "payment_required";
|
|
2851
2851
|
}
|
|
2852
2852
|
function Go(e) {
|
|
2853
|
-
return !
|
|
2853
|
+
return !re(e) && e.creditLimit !== null && e.creditLimit > 0 && e.creditsRemaining !== null && e.creditsRemaining > 0 && e.creditsRemaining / e.creditLimit <= 0.2;
|
|
2854
2854
|
}
|
|
2855
2855
|
function Cr(e) {
|
|
2856
2856
|
return e.creditsRemaining === null ? null : `${Er(e.creditsRemaining)} credits left`;
|
|
@@ -2884,138 +2884,146 @@ function an(e, t) {
|
|
|
2884
2884
|
(i) => !qo(i)
|
|
2885
2885
|
).length === 0 && !e.assistantDraft && !e.lastError && !e.isThinking && !t;
|
|
2886
2886
|
}
|
|
2887
|
-
function kr(e, t, n, i, o, r, l, s, p, g, c, h, E, P, T,
|
|
2888
|
-
const R = Nr(r),
|
|
2887
|
+
function kr(e, t, n, i, o, r, l, s, p, g, c, h, E, P, T, O, u, S, m, I, L) {
|
|
2888
|
+
const R = Nr(r), B = R.filter(
|
|
2889
2889
|
(_) => !qo(_)
|
|
2890
|
-
),
|
|
2891
|
-
|
|
2890
|
+
), ge = e.scrollTop, Ee = [], Ve = /* @__PURE__ */ new Set(), D = (_) => {
|
|
2891
|
+
Ee.push(_);
|
|
2892
2892
|
};
|
|
2893
2893
|
Vo(n, r.isThinking), o.hidden = !s, s && l !== null && Oo(o, l);
|
|
2894
|
-
const
|
|
2895
|
-
if (i(
|
|
2894
|
+
const De = B.length > 0 || !!r.assistantDraft || r.isThinking;
|
|
2895
|
+
if (i(De), u || B.length === 0 && !r.assistantDraft && !r.lastError && !r.isThinking) {
|
|
2896
2896
|
const _ = document.createElement("div");
|
|
2897
2897
|
_.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter" + (u ? " pluno-pa-widget__empty-state--morning-report" : "");
|
|
2898
|
-
const
|
|
2899
|
-
|
|
2900
|
-
const
|
|
2898
|
+
const x = document.createElement("div");
|
|
2899
|
+
x.className = "pluno-pa-widget__empty-hero";
|
|
2900
|
+
const z = Ce(
|
|
2901
2901
|
"pluno-pa-widget__character--empty",
|
|
2902
2902
|
P()
|
|
2903
2903
|
);
|
|
2904
|
-
if (
|
|
2904
|
+
if (x.appendChild(z), _.appendChild(x), u) {
|
|
2905
2905
|
const v = document.createElement("h2");
|
|
2906
2906
|
v.className = "pluno-pa-widget__empty pluno-pa-widget__morning-report-title", v.textContent = u.opening, _.appendChild(v);
|
|
2907
2907
|
} else
|
|
2908
2908
|
_.appendChild(Mo());
|
|
2909
|
-
const
|
|
2910
|
-
if (
|
|
2911
|
-
for (const v of
|
|
2909
|
+
const Y = u?.prompts ?? r.starterPrompts, te = document.createElement("div");
|
|
2910
|
+
if (te.className = Y.length > 0 ? "pluno-pa-widget__starter-prompts" : "pluno-pa-widget__starter-prompts pluno-pa-widget__starter-prompts--empty", Y.length === 0 && !r.starterPromptsLoading && te.setAttribute("aria-hidden", "true"), Y.length > 0)
|
|
2911
|
+
for (const v of Y) {
|
|
2912
2912
|
const N = document.createElement("button");
|
|
2913
2913
|
N.type = "button", N.className = "pluno-pa-widget__starter-prompt", N.textContent = `"${v}"`, N.addEventListener("click", () => {
|
|
2914
2914
|
T(v);
|
|
2915
|
-
}),
|
|
2915
|
+
}), te.appendChild(N);
|
|
2916
2916
|
}
|
|
2917
2917
|
else if (r.starterPromptsLoading) {
|
|
2918
2918
|
const v = document.createElement("button");
|
|
2919
|
-
v.type = "button", v.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder pluno-pa-widget__starter-prompt--loading", v.disabled = !0, v.tabIndex = -1, v.textContent = "Generating example tasks...",
|
|
2919
|
+
v.type = "button", v.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder pluno-pa-widget__starter-prompt--loading", v.disabled = !0, v.tabIndex = -1, v.textContent = "Generating example tasks...", te.appendChild(v);
|
|
2920
2920
|
} else
|
|
2921
2921
|
for (let v = 0; v < pa; v += 1) {
|
|
2922
2922
|
const N = document.createElement("button");
|
|
2923
|
-
N.type = "button", N.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder", N.disabled = !0, N.tabIndex = -1, N.textContent = "",
|
|
2923
|
+
N.type = "button", N.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder", N.disabled = !0, N.tabIndex = -1, N.textContent = "", te.appendChild(N);
|
|
2924
2924
|
}
|
|
2925
|
-
if (_.appendChild(
|
|
2925
|
+
if (_.appendChild(te), u) {
|
|
2926
2926
|
const v = document.createElement("button");
|
|
2927
2927
|
v.type = "button", v.className = "pluno-pa-widget__morning-report-snooze", v.textContent = "Snooze morning report", v.addEventListener("click", S), _.appendChild(v);
|
|
2928
2928
|
}
|
|
2929
|
-
h.clear(), D(_), D(t), uo(e,
|
|
2929
|
+
h.clear(), D(_), D(t), uo(e, Ee);
|
|
2930
2930
|
return;
|
|
2931
2931
|
}
|
|
2932
|
-
let f = null,
|
|
2933
|
-
const
|
|
2934
|
-
if (
|
|
2932
|
+
let f = null, U = null, ke = [];
|
|
2933
|
+
const le = B.length - 1, Ke = le >= 0 && fn(B[le]), G = () => {
|
|
2934
|
+
if (ke.length === 0)
|
|
2935
2935
|
return !1;
|
|
2936
2936
|
const _ = Br(
|
|
2937
|
-
|
|
2937
|
+
ke,
|
|
2938
2938
|
c,
|
|
2939
2939
|
E,
|
|
2940
2940
|
P()
|
|
2941
2941
|
);
|
|
2942
|
-
return D(_), f = null,
|
|
2942
|
+
return D(_), f = null, U = _, ke = [], !0;
|
|
2943
2943
|
};
|
|
2944
|
-
for (let _ = 0; _ <
|
|
2945
|
-
const
|
|
2946
|
-
if (
|
|
2947
|
-
|
|
2944
|
+
for (let _ = 0; _ < B.length; _ += 1) {
|
|
2945
|
+
const x = B[_];
|
|
2946
|
+
if (x.role === "tool") {
|
|
2947
|
+
ke.push(x);
|
|
2948
2948
|
continue;
|
|
2949
2949
|
}
|
|
2950
|
-
if (fn(
|
|
2951
|
-
if (_ !==
|
|
2950
|
+
if (fn(x)) {
|
|
2951
|
+
if (_ !== le)
|
|
2952
2952
|
continue;
|
|
2953
|
-
if (
|
|
2953
|
+
if (G()) {
|
|
2954
2954
|
const N = Et();
|
|
2955
|
-
D(N), f = null,
|
|
2955
|
+
D(N), f = null, U = N;
|
|
2956
2956
|
} else {
|
|
2957
2957
|
const N = fo(P());
|
|
2958
|
-
D(N), f = null,
|
|
2958
|
+
D(N), f = null, U = N;
|
|
2959
2959
|
}
|
|
2960
2960
|
continue;
|
|
2961
2961
|
}
|
|
2962
|
-
if (
|
|
2963
|
-
if (
|
|
2964
|
-
|
|
2965
|
-
const v = document.createElement("div"), N =
|
|
2966
|
-
v.className = N ? "pluno-pa-widget__error" : "pluno-pa-widget__status pluno-pa-widget__run-status", v.textContent = mo(
|
|
2962
|
+
if (x.role === "system") {
|
|
2963
|
+
if (x.dataType === "run_error" || x.dataType === "run_status") {
|
|
2964
|
+
G();
|
|
2965
|
+
const v = document.createElement("div"), N = x.dataType === "run_error";
|
|
2966
|
+
if (v.className = N ? "pluno-pa-widget__error" : "pluno-pa-widget__status pluno-pa-widget__run-status", v.textContent = mo(x.content), N && x.securitySettingsUrl) {
|
|
2967
|
+
const V = document.createElement("a");
|
|
2968
|
+
V.className = "pluno-pa-widget__error-retry", V.href = x.securitySettingsUrl, V.target = "_blank", V.rel = "noreferrer", V.textContent = "Security settings", v.appendChild(V);
|
|
2969
|
+
}
|
|
2970
|
+
D(v), f = N ? v : null, U = N ? null : v;
|
|
2967
2971
|
}
|
|
2968
2972
|
continue;
|
|
2969
2973
|
}
|
|
2970
|
-
const
|
|
2971
|
-
if (
|
|
2974
|
+
const z = G(), Y = mo(x.content);
|
|
2975
|
+
if (x.role === "assistant" && !z) {
|
|
2972
2976
|
const v = jo(P());
|
|
2973
|
-
D(v), f = null,
|
|
2977
|
+
D(v), f = null, U = v;
|
|
2974
2978
|
}
|
|
2975
|
-
const
|
|
2976
|
-
|
|
2977
|
-
|
|
2979
|
+
const te = Lr(
|
|
2980
|
+
x,
|
|
2981
|
+
Y,
|
|
2978
2982
|
h,
|
|
2979
2983
|
Ve,
|
|
2980
2984
|
I
|
|
2981
2985
|
);
|
|
2982
|
-
D(
|
|
2986
|
+
D(te), f = te, U = null;
|
|
2983
2987
|
}
|
|
2984
|
-
const st =
|
|
2985
|
-
if (r.isThinking && !
|
|
2988
|
+
const st = G(), ze = B[B.length - 1]?.id === "assistant-draft";
|
|
2989
|
+
if (r.isThinking && !ze && !Ke)
|
|
2986
2990
|
if (st) {
|
|
2987
2991
|
const _ = Et();
|
|
2988
|
-
D(_), f = null,
|
|
2992
|
+
D(_), f = null, U = _;
|
|
2989
2993
|
} else {
|
|
2990
2994
|
const _ = fo(P());
|
|
2991
|
-
D(_), f = null,
|
|
2995
|
+
D(_), f = null, U = _;
|
|
2992
2996
|
}
|
|
2993
2997
|
if (r.lastError) {
|
|
2994
2998
|
const _ = document.createElement("div");
|
|
2995
2999
|
_.className = "pluno-pa-widget__error";
|
|
2996
|
-
const
|
|
2997
|
-
if (
|
|
2998
|
-
const
|
|
2999
|
-
|
|
3000
|
+
const x = document.createElement("span");
|
|
3001
|
+
if (x.textContent = r.lastError, _.appendChild(x), r.lastErrorSecuritySettingsUrl) {
|
|
3002
|
+
const z = document.createElement("a");
|
|
3003
|
+
z.className = "pluno-pa-widget__error-retry", z.href = r.lastErrorSecuritySettingsUrl, z.target = "_blank", z.rel = "noreferrer", z.textContent = "Security settings", _.appendChild(z);
|
|
3004
|
+
}
|
|
3005
|
+
if (r.lastErrorCode === "run_recovery_exhausted" || r.lastErrorCode === "transient_model_error" || r.lastErrorCode === "run_still_active" || r.lastErrorCode === "connection_failed") {
|
|
3006
|
+
const z = document.createElement("button");
|
|
3007
|
+
z.type = "button", z.className = "pluno-pa-widget__error-retry", z.textContent = "Try again", z.addEventListener(
|
|
3000
3008
|
"click",
|
|
3001
|
-
r.lastErrorCode === "connection_failed" ? m :
|
|
3002
|
-
), _.appendChild(
|
|
3009
|
+
r.lastErrorCode === "connection_failed" ? m : O
|
|
3010
|
+
), _.appendChild(z);
|
|
3003
3011
|
}
|
|
3004
|
-
D(_), f = _,
|
|
3012
|
+
D(_), f = _, U = null;
|
|
3005
3013
|
}
|
|
3006
|
-
const
|
|
3007
|
-
if (L &&
|
|
3008
|
-
const _ = Rr(
|
|
3009
|
-
isDrafting: L.draftingCandidate?.id ===
|
|
3014
|
+
const se = L ? L.draftingCandidate ?? (r.isThinking ? null : Ei(R)) : null;
|
|
3015
|
+
if (L && se && !L.dismissedCandidateIds.has(se.id)) {
|
|
3016
|
+
const _ = Rr(se, {
|
|
3017
|
+
isDrafting: L.draftingCandidate?.id === se.id,
|
|
3010
3018
|
error: L.error,
|
|
3011
3019
|
characterIconOptions: L.characterIconOptions,
|
|
3012
3020
|
onDraft: L.onDraft,
|
|
3013
3021
|
onDismiss: L.onDismiss,
|
|
3014
3022
|
onDisable: L.onDisable
|
|
3015
3023
|
});
|
|
3016
|
-
D(_), L.onSeen(
|
|
3024
|
+
D(_), L.onSeen(se), f = null, U = _;
|
|
3017
3025
|
}
|
|
3018
|
-
f?.classList.add("pluno-pa-widget__message--bottom-reserve"),
|
|
3026
|
+
f?.classList.add("pluno-pa-widget__message--bottom-reserve"), U?.classList.add("pluno-pa-widget__bottom-reserve-compact"), D(t), Tr(h, Ve), uo(e, Ee), p ? rt(e, g) : e.scrollTop = ge;
|
|
3019
3027
|
}
|
|
3020
3028
|
function Lr(e, t, n, i, o) {
|
|
3021
3029
|
const r = Pr(e, t), l = r ? n.get(r) : void 0;
|
|
@@ -3114,7 +3122,7 @@ function ho(e, t, n, i, o, r, l, s) {
|
|
|
3114
3122
|
e.replaceChildren(), Vo(t, !1), t.disabled = !0, n(!1);
|
|
3115
3123
|
const p = document.createElement("div");
|
|
3116
3124
|
p.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter";
|
|
3117
|
-
const g =
|
|
3125
|
+
const g = Ce(
|
|
3118
3126
|
"pluno-pa-widget__character--empty",
|
|
3119
3127
|
i()
|
|
3120
3128
|
);
|
|
@@ -3152,7 +3160,7 @@ function Rr(e, t) {
|
|
|
3152
3160
|
n.className = "pluno-pa-widget__share-prompt";
|
|
3153
3161
|
const i = document.createElement("div");
|
|
3154
3162
|
i.className = "pluno-pa-widget__share-prompt-body", i.appendChild(
|
|
3155
|
-
|
|
3163
|
+
Ce(
|
|
3156
3164
|
"pluno-pa-widget__share-prompt-icon",
|
|
3157
3165
|
t.characterIconOptions
|
|
3158
3166
|
)
|
|
@@ -3230,13 +3238,13 @@ function Dr(e, t) {
|
|
|
3230
3238
|
P.className = "pluno-pa-widget__share-dialog-step-title", P.textContent = "2) Share on", E.appendChild(P);
|
|
3231
3239
|
const T = document.createElement("p");
|
|
3232
3240
|
T.className = "pluno-pa-widget__share-dialog-hint", T.textContent = "Post draft opens prefilled on supported platforms.", E.appendChild(T);
|
|
3233
|
-
const
|
|
3234
|
-
|
|
3241
|
+
const O = document.createElement("footer");
|
|
3242
|
+
O.className = "pluno-pa-widget__share-dialog-platforms";
|
|
3235
3243
|
for (const u of Mr(e)) {
|
|
3236
3244
|
const S = document.createElement("a");
|
|
3237
|
-
S.href = u.href, S.target = "_blank", S.rel = "noopener noreferrer", S.title = u.label, S.setAttribute("aria-label", `Open ${u.label}`), S.appendChild(Or(u.id)),
|
|
3245
|
+
S.href = u.href, S.target = "_blank", S.rel = "noopener noreferrer", S.title = u.label, S.setAttribute("aria-label", `Open ${u.label}`), S.appendChild(Or(u.id)), O.appendChild(S);
|
|
3238
3246
|
}
|
|
3239
|
-
if (E.appendChild(
|
|
3247
|
+
if (E.appendChild(O), i.appendChild(E), t.socialPostRewardsUrl) {
|
|
3240
3248
|
const u = document.createElement("div");
|
|
3241
3249
|
u.className = "pluno-pa-widget__share-dialog-step";
|
|
3242
3250
|
const S = document.createElement("strong");
|
|
@@ -3274,34 +3282,34 @@ function Mr(e) {
|
|
|
3274
3282
|
}
|
|
3275
3283
|
function Or(e) {
|
|
3276
3284
|
const t = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
3277
|
-
return t.setAttribute("class", "pluno-pa-widget__share-dialog-platform-logo"), t.setAttribute("viewBox", "0 0 32 32"), t.setAttribute("aria-hidden", "true"), e === "linkedin" ? (
|
|
3285
|
+
return t.setAttribute("class", "pluno-pa-widget__share-dialog-platform-logo"), t.setAttribute("viewBox", "0 0 32 32"), t.setAttribute("aria-hidden", "true"), e === "linkedin" ? (j(t, "M6.7 13.2c.4 4.1.2 8.1.1 12.3"), j(
|
|
3278
3286
|
t,
|
|
3279
3287
|
"M6.4 6.9c.6-.5 1.6-.5 2.1.1.7.7.5 1.8-.2 2.3-.8.5-1.9.2-2.3-.6-.2-.6 0-1.3.4-1.8Z"
|
|
3280
|
-
),
|
|
3288
|
+
), j(t, "M14.4 13.3c.1 3.8.1 7.8 0 11.9"), j(
|
|
3281
3289
|
t,
|
|
3282
3290
|
"M14.8 16.2c1.2-2 3-3.1 5.1-2.9 3.4.3 4.8 2.7 4.8 6.2 0 1.9-.1 3.8-.1 5.8"
|
|
3283
|
-
),
|
|
3291
|
+
), j(t, "M20 18c.1 2.2.1 4.7 0 7.2"), t) : e === "x" ? (j(t, "M7.2 7.4c5.6 6.4 10.9 12.2 17.7 17.2"), j(t, "M24.4 7.2c-5.1 6.3-10.6 11.8-17 17.8"), j(t, "M9.1 8.2c5.1 5.6 9.7 10.8 15 15.5", "0.55"), t) : (j(
|
|
3284
3292
|
t,
|
|
3285
3293
|
"M10.2 6.4c3.8-.3 8-.3 11.6.1 2.5.3 3.8 1.8 4 4 .4 3.3.4 7.4 0 10.9-.3 2.4-1.7 3.8-4 4.1-3.8.4-8.2.4-11.8 0-2.3-.3-3.7-1.8-4-4.1-.4-3.5-.3-7.8.1-11.1.2-2.2 1.8-3.6 4.1-3.9Z"
|
|
3286
|
-
),
|
|
3294
|
+
), j(
|
|
3287
3295
|
t,
|
|
3288
3296
|
"M11 7.3c3.4-.4 7.1-.4 10.2.1 2 .3 3.1 1.4 3.4 3.2.4 3 .4 6.6.1 9.9-.3 2.2-1.3 3.3-3.3 3.7-3.2.5-7.2.5-10.5.1",
|
|
3289
3297
|
"0.48"
|
|
3290
|
-
),
|
|
3298
|
+
), j(
|
|
3291
3299
|
t,
|
|
3292
3300
|
"M12.1 16.1c.1-2.4 1.8-4.1 4-4.2 2.4-.1 4.2 1.6 4.3 4 .1 2.3-1.6 4.1-3.9 4.2-2.6.2-4.3-1.5-4.4-4Z"
|
|
3293
|
-
),
|
|
3301
|
+
), j(
|
|
3294
3302
|
t,
|
|
3295
3303
|
"M22 10.7c.3-.1.7 0 .9.3.2.4.1.8-.2 1-.4.2-.8.1-1-.2-.2-.4-.1-.8.3-1.1Z"
|
|
3296
3304
|
), t);
|
|
3297
3305
|
}
|
|
3298
|
-
function
|
|
3306
|
+
function j(e, t, n) {
|
|
3299
3307
|
const i = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
3300
3308
|
i.setAttribute("d", t), n && i.setAttribute("opacity", n), e.appendChild(i);
|
|
3301
3309
|
}
|
|
3302
3310
|
function Ur() {
|
|
3303
3311
|
const e = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
3304
|
-
return e.setAttribute("class", "pluno-pa-widget__share-dialog-external-icon"), e.setAttribute("viewBox", "0 0 24 24"), e.setAttribute("aria-hidden", "true"),
|
|
3312
|
+
return e.setAttribute("class", "pluno-pa-widget__share-dialog-external-icon"), e.setAttribute("viewBox", "0 0 24 24"), e.setAttribute("aria-hidden", "true"), j(e, "M14 5h5v5"), j(e, "M19 5l-8 8"), j(
|
|
3305
3313
|
e,
|
|
3306
3314
|
"M18 13v5a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1h5"
|
|
3307
3315
|
), e;
|
|
@@ -3317,7 +3325,7 @@ function Br(e, t, n, i) {
|
|
|
3317
3325
|
o.className = "pluno-pa-widget__tool-group", o.title = new Date(
|
|
3318
3326
|
e[e.length - 1].createdAt
|
|
3319
3327
|
).toLocaleString(), o.appendChild(
|
|
3320
|
-
|
|
3328
|
+
Ce(
|
|
3321
3329
|
"pluno-pa-widget__character--tool-group",
|
|
3322
3330
|
i
|
|
3323
3331
|
)
|
|
@@ -3345,7 +3353,7 @@ function Br(e, t, n, i) {
|
|
|
3345
3353
|
function jo(e) {
|
|
3346
3354
|
const t = document.createElement("article");
|
|
3347
3355
|
return t.className = "pluno-pa-widget__tool-group pluno-pa-widget__assistant-marker", t.appendChild(
|
|
3348
|
-
|
|
3356
|
+
Ce(
|
|
3349
3357
|
"pluno-pa-widget__character--tool-group",
|
|
3350
3358
|
e
|
|
3351
3359
|
)
|
|
@@ -3528,7 +3536,7 @@ function wo(e, t) {
|
|
|
3528
3536
|
--pluno-pa-accent-contrast: #fafafa;
|
|
3529
3537
|
position: fixed;
|
|
3530
3538
|
z-index: 2147483645;
|
|
3531
|
-
font-family: ${
|
|
3539
|
+
font-family: ${de.fontFamily};
|
|
3532
3540
|
font-size: 14px;
|
|
3533
3541
|
color: var(--pluno-pa-text);
|
|
3534
3542
|
width: var(--pluno-pa-launcher-width);
|
|
@@ -4634,7 +4642,7 @@ function wo(e, t) {
|
|
|
4634
4642
|
place-items: center;
|
|
4635
4643
|
padding: 18px;
|
|
4636
4644
|
background: rgba(24, 24, 27, 0.28);
|
|
4637
|
-
font-family: var(--pluno-pa-font, ${
|
|
4645
|
+
font-family: var(--pluno-pa-font, ${de.fontFamily});
|
|
4638
4646
|
color: var(--pluno-pa-text);
|
|
4639
4647
|
}
|
|
4640
4648
|
.pluno-pa-widget__share-dialog {
|
|
@@ -6039,20 +6047,20 @@ function nl(e, t) {
|
|
|
6039
6047
|
const n = new URL(e.src, document.baseURI);
|
|
6040
6048
|
return n.href === t.href || n.pathname === t.pathname ? !0 : yo(n) === yo(t);
|
|
6041
6049
|
}
|
|
6042
|
-
class
|
|
6050
|
+
class _e extends EventTarget {
|
|
6043
6051
|
constructor(t, n) {
|
|
6044
6052
|
super(), this.channelId = n, this.url = t, this.addPreviewListener(ea, () => {
|
|
6045
|
-
this.readyState =
|
|
6053
|
+
this.readyState = _e.OPEN, this.dispatchEvent(new Event("open"));
|
|
6046
6054
|
}), this.addPreviewListener(ta, (i) => {
|
|
6047
6055
|
const o = i;
|
|
6048
6056
|
this.dispatchEvent(
|
|
6049
6057
|
new MessageEvent("message", { data: o.detail?.data ?? "" })
|
|
6050
6058
|
);
|
|
6051
6059
|
}), this.addPreviewListener(na, () => {
|
|
6052
|
-
this.readyState =
|
|
6060
|
+
this.readyState = _e.CLOSED, this.dispatchEvent(new Event("error")), this.cleanup();
|
|
6053
6061
|
}), this.addPreviewListener(oa, (i) => {
|
|
6054
6062
|
const o = i;
|
|
6055
|
-
this.readyState =
|
|
6063
|
+
this.readyState = _e.CLOSED, this.dispatchEvent(
|
|
6056
6064
|
new CloseEvent("close", {
|
|
6057
6065
|
code: o.detail?.code ?? 1e3,
|
|
6058
6066
|
reason: o.detail?.reason ?? "",
|
|
@@ -6081,11 +6089,11 @@ class be extends EventTarget {
|
|
|
6081
6089
|
extensions = "";
|
|
6082
6090
|
binaryType = "blob";
|
|
6083
6091
|
bufferedAmount = 0;
|
|
6084
|
-
readyState =
|
|
6092
|
+
readyState = _e.CONNECTING;
|
|
6085
6093
|
socketId = ol();
|
|
6086
6094
|
listeners = /* @__PURE__ */ new Map();
|
|
6087
6095
|
send(t) {
|
|
6088
|
-
if (this.readyState !==
|
|
6096
|
+
if (this.readyState !== _e.OPEN)
|
|
6089
6097
|
throw new DOMException(
|
|
6090
6098
|
"Pluno preview websocket is not open",
|
|
6091
6099
|
"InvalidStateError"
|
|
@@ -6103,7 +6111,7 @@ class be extends EventTarget {
|
|
|
6103
6111
|
);
|
|
6104
6112
|
}
|
|
6105
6113
|
close(t, n) {
|
|
6106
|
-
this.readyState !==
|
|
6114
|
+
this.readyState !== _e.CLOSED && (this.readyState = _e.CLOSING, window.dispatchEvent(
|
|
6107
6115
|
new CustomEvent(
|
|
6108
6116
|
xt(Qi, this.channelId),
|
|
6109
6117
|
{
|
|
@@ -6157,16 +6165,16 @@ function al(e) {
|
|
|
6157
6165
|
}));
|
|
6158
6166
|
}
|
|
6159
6167
|
function Zo(e) {
|
|
6160
|
-
const t = window, n = t[
|
|
6168
|
+
const t = window, n = t[be];
|
|
6161
6169
|
if (n) {
|
|
6162
6170
|
if (n.host === null)
|
|
6163
6171
|
return n.mountPromise.catch(() => {
|
|
6164
|
-
const p = t[
|
|
6172
|
+
const p = t[be];
|
|
6165
6173
|
return p ? p.mountPromise : Zo(e);
|
|
6166
6174
|
});
|
|
6167
6175
|
if (rl(n.host))
|
|
6168
6176
|
return n.retryPendingTokenFailureOnce?.(), n.mountPromise;
|
|
6169
|
-
n.destroy?.(), delete t[
|
|
6177
|
+
n.destroy?.(), delete t[be];
|
|
6170
6178
|
}
|
|
6171
6179
|
const i = e.dataset.plunoPreviewChannel, o = e.dataset.plunoTokenEndpoint, r = !e.dataset.plunoToken && !i && o ? el(o) : null;
|
|
6172
6180
|
let l;
|
|
@@ -6183,23 +6191,23 @@ function Zo(e) {
|
|
|
6183
6191
|
scribbleStyle: e.dataset.plunoScribbleStyle === void 0 ? void 0 : e.dataset.plunoScribbleStyle !== "false",
|
|
6184
6192
|
position: e.dataset.plunoPosition === "bottom-left" ? "bottom-left" : "bottom-right"
|
|
6185
6193
|
}).then((p) => {
|
|
6186
|
-
if (t[
|
|
6194
|
+
if (t[be] !== l) {
|
|
6187
6195
|
p.destroy();
|
|
6188
6196
|
return;
|
|
6189
6197
|
}
|
|
6190
6198
|
const g = p.host;
|
|
6191
6199
|
g.setAttribute(ko, "true"), l.host = g, l.destroy = () => {
|
|
6192
|
-
t[
|
|
6200
|
+
t[be] === l && delete t[be], l.host = null, l.destroy = null, p.destroy();
|
|
6193
6201
|
};
|
|
6194
6202
|
}).catch((p) => {
|
|
6195
|
-
throw t[
|
|
6203
|
+
throw t[be] === l && delete t[be], p;
|
|
6196
6204
|
});
|
|
6197
6205
|
return l = {
|
|
6198
6206
|
mountPromise: s,
|
|
6199
6207
|
host: null,
|
|
6200
6208
|
destroy: null,
|
|
6201
6209
|
retryPendingTokenFailureOnce: r?.retryPendingFailureOnce ?? null
|
|
6202
|
-
}, t[
|
|
6210
|
+
}, t[be] = l, s;
|
|
6203
6211
|
}
|
|
6204
6212
|
function rl(e) {
|
|
6205
6213
|
return e.isConnected && e.getAttribute(ko) === "true" && !!e.shadowRoot?.querySelector(".pluno-pa-widget__launcher") && !!e.shadowRoot?.querySelector(".pluno-pa-widget__panel");
|