@pluno/product-agent-web 0.1.101 → 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 +582 -558
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { PlunoProductAgent as wi, getProductAgentOriginAccessErrorMessage as bi } from "./product-agent-sdk.js";
|
|
2
|
-
const _i = "#7c3aed", vt = "M547 151 C516 151 493 169 485 199 L382 606 C373 641 396 666 431 666 L523 666 C552 666 568 684 563 713 L491 1028 C486 1054 510 1067 527 1044 L894 487 C915 455 894 432 856 432 L815 432 C784 432 773 411 789 382 L904 205 C922 171 901 145 859 145 Z",
|
|
2
|
+
const _i = "#7c3aed", vt = "M547 151 C516 151 493 169 485 199 L382 606 C373 641 396 666 431 666 L523 666 C552 666 568 684 563 713 L491 1028 C486 1054 510 1067 527 1044 L894 487 C915 455 894 432 856 432 L815 432 C784 432 773 411 789 382 L904 205 C922 171 901 145 859 145 Z", St = "#2c2a1e", Un = [253, 250, 241], Bn = 3.5;
|
|
3
3
|
function vo(e) {
|
|
4
|
-
const t =
|
|
4
|
+
const t = So(e);
|
|
5
5
|
if (Fn(lt(t), Un) >= Bn)
|
|
6
6
|
return t;
|
|
7
7
|
let i = lt(t);
|
|
8
|
-
const o = lt(
|
|
8
|
+
const o = lt(St);
|
|
9
9
|
for (let r = 0; r < 6; r += 1)
|
|
10
10
|
if (i = vi(i, o, 0.22), Fn(i, Un) >= Bn)
|
|
11
11
|
return rn(i);
|
|
@@ -20,7 +20,7 @@ function xi() {
|
|
|
20
20
|
return n;
|
|
21
21
|
}
|
|
22
22
|
function yi(e) {
|
|
23
|
-
const t =
|
|
23
|
+
const t = So(e), n = ln(lt(t));
|
|
24
24
|
return n > 0.86 ? {
|
|
25
25
|
top: "#ffffff",
|
|
26
26
|
middle: "#f6f6f6",
|
|
@@ -44,19 +44,19 @@ 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
|
-
function
|
|
59
|
+
function So(e) {
|
|
60
60
|
const t = e.trim();
|
|
61
61
|
return /^#[0-9a-f]{6}$/i.test(t) ? t.toLowerCase() : /^#[0-9a-f]{3}$/i.test(t) ? `#${t.slice(1).split("").map((n) => n + n).join("").toLowerCase()}` : _i;
|
|
62
62
|
}
|
|
@@ -90,18 +90,18 @@ function vi(e, t, n) {
|
|
|
90
90
|
e[2] + (t[2] - e[2]) * i
|
|
91
91
|
];
|
|
92
92
|
}
|
|
93
|
-
function
|
|
94
|
-
const [i, o, r] =
|
|
95
|
-
return rn(
|
|
93
|
+
function pe(e, t, n) {
|
|
94
|
+
const [i, o, r] = Si(lt(e));
|
|
95
|
+
return rn(Ci(i, sn(o + n), sn(r + t)));
|
|
96
96
|
}
|
|
97
|
-
function
|
|
97
|
+
function Si([e, t, n]) {
|
|
98
98
|
const i = e / 255, o = t / 255, r = n / 255, l = Math.max(i, o, r), s = Math.min(i, o, r), p = (l + s) / 2;
|
|
99
99
|
if (l === s)
|
|
100
100
|
return [0, 0, p];
|
|
101
101
|
const g = l - s, c = p > 0.5 ? g / (2 - l - s) : g / (l + s);
|
|
102
102
|
return [(l === i ? (o - r) / g + (o < r ? 6 : 0) : l === o ? (r - i) / g + 2 : (i - o) / g + 4) / 6, c, p];
|
|
103
103
|
}
|
|
104
|
-
function
|
|
104
|
+
function Ci(e, t, n) {
|
|
105
105
|
if (t === 0)
|
|
106
106
|
return [n * 255, n * 255, n * 255];
|
|
107
107
|
const i = n < 0.5 ? n * (1 + t) : n + t - n * t, o = 2 * n - i;
|
|
@@ -118,11 +118,11 @@ function Kt(e, t, n) {
|
|
|
118
118
|
function sn(e) {
|
|
119
119
|
return Math.max(0, Math.min(1, e));
|
|
120
120
|
}
|
|
121
|
-
const
|
|
121
|
+
const Co = "suggest_share_on_socials";
|
|
122
122
|
function Ei(e) {
|
|
123
123
|
for (let t = e.length - 1; t >= 0; t -= 1) {
|
|
124
124
|
const n = e[t];
|
|
125
|
-
if (n.role !== "tool" || n.toolName !==
|
|
125
|
+
if (n.role !== "tool" || n.toolName !== Co)
|
|
126
126
|
continue;
|
|
127
127
|
const i = Wn(e, t, "assistant");
|
|
128
128
|
if (!i)
|
|
@@ -153,7 +153,7 @@ function Wn(e, t, n) {
|
|
|
153
153
|
async function Li(e) {
|
|
154
154
|
return await (await fetch(e)).blob();
|
|
155
155
|
}
|
|
156
|
-
const Pi = "https://app.pluno.ai", Ti = "/api/product-agent/embed/active-users",
|
|
156
|
+
const Pi = "https://app.pluno.ai", Ti = "/api/product-agent/embed/active-users", Ni = 1800, Ai = 15e3, Ii = 250, Ri = 1e3, Di = 3e4;
|
|
157
157
|
function zi(e, t = {}) {
|
|
158
158
|
let n = !1, i = null, o = null, r = null;
|
|
159
159
|
const l = () => {
|
|
@@ -173,9 +173,9 @@ function zi(e, t = {}) {
|
|
|
173
173
|
l();
|
|
174
174
|
return;
|
|
175
175
|
}
|
|
176
|
-
const P = Math.min(1, (performance.now() - E) /
|
|
176
|
+
const P = Math.min(1, (performance.now() - E) / Ni);
|
|
177
177
|
i = Math.round(h + (c - h) * Bi(P)), e(i), P >= 1 && (i = c, e(c), l());
|
|
178
|
-
},
|
|
178
|
+
}, Ii);
|
|
179
179
|
}, g = async () => {
|
|
180
180
|
try {
|
|
181
181
|
const c = await Mi(t);
|
|
@@ -183,7 +183,7 @@ function zi(e, t = {}) {
|
|
|
183
183
|
return;
|
|
184
184
|
p(c.count), s(c.refreshAfterMs);
|
|
185
185
|
} catch {
|
|
186
|
-
s(
|
|
186
|
+
s(Ai);
|
|
187
187
|
}
|
|
188
188
|
};
|
|
189
189
|
return g(), () => {
|
|
@@ -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,
|
|
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",
|
|
@@ -353,22 +353,22 @@ const Eo = 100, Yi = 1e4, Xi = 5e3, Zi = "product-agent:sdk-preview-socket-conne
|
|
|
353
353
|
path: "M18.7 26.8 C21 11.2, 7.1 1.6, 6.3 18.1",
|
|
354
354
|
pathStrokeWidth: "2.45"
|
|
355
355
|
}
|
|
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
|
{
|
|
@@ -462,97 +462,97 @@ 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"
|
|
469
|
-
),
|
|
469
|
+
), S = o.querySelector(
|
|
470
470
|
".pluno-pa-widget__launcher-minimize"
|
|
471
|
-
), m = o.querySelector(".pluno-pa-widget__panel"),
|
|
471
|
+
), m = o.querySelector(".pluno-pa-widget__panel"), I = o.querySelector(
|
|
472
472
|
".pluno-pa-widget__scribble-spirals--panel"
|
|
473
473
|
), L = Array.from(
|
|
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
|
-
},
|
|
548
|
-
if (!t.loginRequired && !t.signupRequired && !t.token && !
|
|
547
|
+
}, Sn = t.loginRequired || t.signupRequired || t.token || t.webSocketFactory ? void 0 : t.tokenProvider ?? (t.tokenEndpoint ? async () => Xo(t.tokenEndpoint) : void 0);
|
|
548
|
+
if (!t.loginRequired && !t.signupRequired && !t.token && !Sn && !t.webSocketFactory)
|
|
549
549
|
throw new Error("Pluno widget requires token or tokenEndpoint");
|
|
550
550
|
const ei = window.fetch.bind(window), Pt = Vr(t.clientId);
|
|
551
551
|
let b;
|
|
552
552
|
try {
|
|
553
553
|
const a = {
|
|
554
554
|
token: t.token,
|
|
555
|
-
tokenProvider:
|
|
555
|
+
tokenProvider: Sn,
|
|
556
556
|
backendUrl: t.backendUrl,
|
|
557
557
|
metadata: () => ({
|
|
558
558
|
...t.metadata ?? {},
|
|
@@ -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
|
|
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
|
-
|
|
614
|
-
const
|
|
615
|
-
|
|
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
|
+
const C = document.createElement("time");
|
|
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,20 +641,20 @@ 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
|
-
!
|
|
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,
|
|
654
654
|
subtree: !0
|
|
655
655
|
}), kn();
|
|
656
656
|
const Xe = (a = !0) => {
|
|
657
|
-
const d =
|
|
657
|
+
const d = Ct(o, a);
|
|
658
658
|
return gn(
|
|
659
659
|
o,
|
|
660
660
|
p ? zo(p, d) : za(
|
|
@@ -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"),
|
|
@@ -677,7 +677,7 @@ async function La(e = {}) {
|
|
|
677
677
|
seenShareCandidateIds: [...Oe].slice(
|
|
678
678
|
-Eo
|
|
679
679
|
),
|
|
680
|
-
sharePromptsDisabled:
|
|
680
|
+
sharePromptsDisabled: Nt
|
|
681
681
|
});
|
|
682
682
|
}, ct = (a) => {
|
|
683
683
|
t.onDisplayStateChange?.(a);
|
|
@@ -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,7 +708,7 @@ 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
|
|
@@ -717,10 +717,10 @@ async function La(e = {}) {
|
|
|
717
717
|
if (!p)
|
|
718
718
|
return Ie(o, null), Xe(a);
|
|
719
719
|
const d = Xe(a);
|
|
720
|
-
return Ie(o, d),
|
|
720
|
+
return Ie(o, d), Te("Applied stored closed launcher position", {
|
|
721
721
|
visibleLauncherPosition: d
|
|
722
722
|
}), d;
|
|
723
|
-
},
|
|
723
|
+
}, It = (a, d) => {
|
|
724
724
|
if (!a || !d) {
|
|
725
725
|
io(o);
|
|
726
726
|
return;
|
|
@@ -749,10 +749,10 @@ async function La(e = {}) {
|
|
|
749
749
|
Xt(o, c);
|
|
750
750
|
const d = at(c);
|
|
751
751
|
tn(
|
|
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,37 +761,37 @@ 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
|
-
|
|
788
|
-
|
|
789
|
-
), Ie(o,
|
|
787
|
+
C,
|
|
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 = () => {
|
|
@@ -810,41 +810,41 @@ async function La(e = {}) {
|
|
|
810
810
|
};
|
|
811
811
|
}, ai = (a) => {
|
|
812
812
|
c = kt(a.size), Xt(o, c), tn(
|
|
813
|
-
|
|
813
|
+
I,
|
|
814
814
|
Rt()
|
|
815
815
|
), h = yt(
|
|
816
816
|
a.position,
|
|
817
817
|
at(c)
|
|
818
818
|
);
|
|
819
819
|
const d = Xe();
|
|
820
|
-
|
|
820
|
+
It(h, d);
|
|
821
821
|
}, ri = L.length > 0 ? Ra({
|
|
822
822
|
root: o,
|
|
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;
|
|
830
|
-
const
|
|
830
|
+
const Nn = async () => {
|
|
831
831
|
if (!(!t.billingStatusLoader || Dt)) {
|
|
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,59 +853,59 @@ async function La(e = {}) {
|
|
|
853
853
|
Dt = !1;
|
|
854
854
|
}
|
|
855
855
|
}
|
|
856
|
-
},
|
|
857
|
-
|
|
858
|
-
|
|
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
|
+
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 (
|
|
868
|
-
openPanelPosition:
|
|
869
|
-
visibleLauncherPosition:
|
|
870
|
-
}),
|
|
871
|
-
o.classList.add("pluno-pa-widget--open"), T.hidden = !0, a && (f.value = a, it(f)), rt(
|
|
867
|
+
if (It(C, y), Te("Opening launcher at clamped open panel position", {
|
|
868
|
+
openPanelPosition: C,
|
|
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,
|
|
899
|
-
const
|
|
898
|
+
let Mt = null, ut = null, Ne = null;
|
|
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
|
|
907
|
-
const
|
|
908
|
-
d =
|
|
904
|
+
const y = d.closest(Vn);
|
|
905
|
+
if (y)
|
|
906
|
+
return y;
|
|
907
|
+
const C = d.getRootNode();
|
|
908
|
+
d = C instanceof ShadowRoot ? C.host : null;
|
|
909
909
|
}
|
|
910
910
|
return null;
|
|
911
911
|
}, si = (a) => {
|
|
@@ -919,56 +919,56 @@ async function La(e = {}) {
|
|
|
919
919
|
return a.checkVisibility();
|
|
920
920
|
const d = window.getComputedStyle(a);
|
|
921
921
|
return d.display !== "none" && d.visibility !== "hidden";
|
|
922
|
-
},
|
|
923
|
-
Ue !== a && (Ue = a, o.classList.toggle("pluno-pa-widget--host-modal-conflict", a !== null), Ae(), a !== null ?
|
|
922
|
+
}, In = (a) => {
|
|
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
|
-
(!d || !si(d)) &&
|
|
926
|
-
}, ua) :
|
|
925
|
+
(!d || !si(d)) && In(null);
|
|
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
|
-
|
|
931
|
+
An(a.target) && (Mt = Date.now(), W());
|
|
932
932
|
}), o.addEventListener("focusout", (a) => {
|
|
933
|
-
if (!
|
|
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
|
-
const
|
|
942
|
-
if (ut !== null &&
|
|
943
|
-
|
|
941
|
+
const C = Date.now();
|
|
942
|
+
if (ut !== null && C - ut <= ca) {
|
|
943
|
+
In(y);
|
|
944
944
|
return;
|
|
945
945
|
}
|
|
946
|
-
ut =
|
|
946
|
+
ut = C;
|
|
947
947
|
}), T.addEventListener("keydown", (a) => {
|
|
948
|
-
!o.classList.contains("pluno-pa-widget--minimized") || a.key !== "Enter" && a.key !== " " || (a.preventDefault(),
|
|
949
|
-
}),
|
|
948
|
+
!o.classList.contains("pluno-pa-widget--minimized") || a.key !== "Enter" && a.key !== " " || (a.preventDefault(), we());
|
|
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 = () => {
|
|
@@ -980,12 +980,12 @@ async function La(e = {}) {
|
|
|
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
|
-
|
|
1068
|
-
),
|
|
1069
|
-
message:
|
|
1067
|
+
C instanceof Error ? C.message : "Failed to attach file"
|
|
1068
|
+
), Z("web-sdk.widget", "Attachment failed", {
|
|
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,46 +1078,62 @@ 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
|
|
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
|
-
) &&
|
|
1118
|
-
}), o.addEventListener("
|
|
1119
|
-
a.
|
|
1120
|
-
|
|
1116
|
+
M
|
|
1117
|
+
) && xe();
|
|
1118
|
+
}), o.addEventListener("copy", (a) => {
|
|
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
|
+
"text/plain",
|
|
1121
|
+
window.getSelection()?.toString() ?? ""
|
|
1122
|
+
), a.preventDefault()), a.stopPropagation();
|
|
1123
|
+
});
|
|
1124
|
+
for (const a of ["keypress", "keyup"])
|
|
1125
|
+
o.addEventListener(a, (d) => {
|
|
1126
|
+
(d.metaKey || d.ctrlKey) && d.key.toLowerCase() === "c" && d.stopPropagation();
|
|
1127
|
+
});
|
|
1128
|
+
o.addEventListener("keydown", (a) => {
|
|
1129
|
+
if ((a.metaKey || a.ctrlKey) && a.key.toLowerCase() === "c") {
|
|
1130
|
+
a.defaultPrevented && navigator.clipboard && 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() && navigator.clipboard.writeText(
|
|
1131
|
+
window.getSelection()?.toString() ?? ""
|
|
1132
|
+
), a.stopPropagation();
|
|
1133
|
+
return;
|
|
1134
|
+
}
|
|
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);
|
|
1121
1137
|
const gt = () => r;
|
|
1122
1138
|
let Wt = b.getState().appearance !== null, ht = null, nt = null, Be = null, Dn = b.getState().isThinking, Fe = null;
|
|
1123
1139
|
const ot = t.taskNotifications;
|
|
@@ -1125,9 +1141,9 @@ async function La(e = {}) {
|
|
|
1125
1141
|
const zn = () => {
|
|
1126
1142
|
We !== null && (window.clearTimeout(We), We = null);
|
|
1127
1143
|
}, mt = () => {
|
|
1128
|
-
|
|
1144
|
+
Y && (Y.hidden = !0);
|
|
1129
1145
|
}, Mn = () => b.getState().assistantDraft.trim().length > 0, gi = async () => {
|
|
1130
|
-
if (!ot || !
|
|
1146
|
+
if (!ot || !Y || He || X || !b.getState().isThinking || Mn())
|
|
1131
1147
|
return;
|
|
1132
1148
|
let a;
|
|
1133
1149
|
try {
|
|
@@ -1135,45 +1151,45 @@ async function La(e = {}) {
|
|
|
1135
1151
|
} catch {
|
|
1136
1152
|
return;
|
|
1137
1153
|
}
|
|
1138
|
-
a.enabled || a.neverSuggest || !b.getState().isThinking || Mn() || He ||
|
|
1154
|
+
a.enabled || a.neverSuggest || !b.getState().isThinking || Mn() || He || X || (Y.hidden = !1);
|
|
1139
1155
|
};
|
|
1140
|
-
|
|
1156
|
+
te?.addEventListener("click", () => {
|
|
1141
1157
|
He = !0, mt(), ot?.enable().catch(() => {
|
|
1142
1158
|
});
|
|
1143
1159
|
}), v?.addEventListener("click", () => {
|
|
1144
1160
|
He = !0, mt();
|
|
1145
|
-
}),
|
|
1161
|
+
}), N?.addEventListener("click", () => {
|
|
1146
1162
|
He = !0, mt(), ot?.dismissForever().catch(() => {
|
|
1147
1163
|
});
|
|
1148
1164
|
});
|
|
1149
1165
|
const ft = t.tabGroups;
|
|
1150
1166
|
let Ge = !1;
|
|
1151
1167
|
const wt = async () => {
|
|
1152
|
-
if (!ft || !
|
|
1168
|
+
if (!ft || !V || Ge || X)
|
|
1153
1169
|
return;
|
|
1154
1170
|
const a = await ft.getState().catch(() => null);
|
|
1155
|
-
!a || Ge ||
|
|
1171
|
+
!a || Ge || X || (V.hidden = !a.permissionNeeded);
|
|
1156
1172
|
};
|
|
1157
1173
|
Jo?.addEventListener("click", () => {
|
|
1158
|
-
Ge = !0,
|
|
1174
|
+
Ge = !0, V && (V.hidden = !0), ft?.enable().catch(() => {
|
|
1159
1175
|
}).finally(() => {
|
|
1160
1176
|
Ge = !1, wt();
|
|
1161
1177
|
});
|
|
1162
1178
|
}), Qo?.addEventListener("click", () => {
|
|
1163
|
-
Ge = !0,
|
|
1179
|
+
Ge = !0, V && (V.hidden = !0), ft?.dismiss().catch(() => {
|
|
1164
1180
|
}).finally(() => {
|
|
1165
1181
|
Ge = !1, wt();
|
|
1166
1182
|
});
|
|
1167
1183
|
}), wt();
|
|
1168
1184
|
let $e = null, On = () => {
|
|
1169
1185
|
};
|
|
1170
|
-
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 = () => {
|
|
1171
1187
|
const a = $e !== null && an(b.getState(), Gt());
|
|
1172
1188
|
_.hidden = !a, a && $e !== null && Oo(_, $e);
|
|
1173
1189
|
};
|
|
1174
1190
|
let qe = null;
|
|
1175
1191
|
const $t = (a = {}) => {
|
|
1176
|
-
|
|
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());
|
|
1177
1193
|
}, bt = () => {
|
|
1178
1194
|
t.morningReport !== null && (t.morningReport = null, t.onMorningReportTaskStart?.(), $t());
|
|
1179
1195
|
}, qt = (a) => {
|
|
@@ -1186,16 +1202,16 @@ async function La(e = {}) {
|
|
|
1186
1202
|
"New chat",
|
|
1187
1203
|
sr(),
|
|
1188
1204
|
!1
|
|
1189
|
-
), qe.addEventListener("click", () => $t()),
|
|
1190
|
-
},
|
|
1191
|
-
if (
|
|
1192
|
-
|
|
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,
|
|
1193
1209
|
t.billingStatus,
|
|
1194
1210
|
Fe
|
|
1195
1211
|
), t.loginRequired) {
|
|
1196
1212
|
Ht.clear(), ho(
|
|
1197
|
-
|
|
1198
|
-
|
|
1213
|
+
x,
|
|
1214
|
+
U,
|
|
1199
1215
|
qt,
|
|
1200
1216
|
gt,
|
|
1201
1217
|
"Log in to use Pluno on this page.",
|
|
@@ -1207,8 +1223,8 @@ async function La(e = {}) {
|
|
|
1207
1223
|
}
|
|
1208
1224
|
if (t.signupRequired) {
|
|
1209
1225
|
Ht.clear(), ho(
|
|
1210
|
-
|
|
1211
|
-
|
|
1226
|
+
x,
|
|
1227
|
+
U,
|
|
1212
1228
|
qt,
|
|
1213
1229
|
gt,
|
|
1214
1230
|
"Complete signup to unlock your free trial credits.",
|
|
@@ -1218,59 +1234,59 @@ async function La(e = {}) {
|
|
|
1218
1234
|
);
|
|
1219
1235
|
return;
|
|
1220
1236
|
}
|
|
1221
|
-
const d = qa(a),
|
|
1222
|
-
|
|
1223
|
-
const
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1237
|
+
const d = qa(a), y = d !== Cn;
|
|
1238
|
+
Cn = d;
|
|
1239
|
+
const C = ye || Le.enabled;
|
|
1240
|
+
ye = !1, kr(
|
|
1241
|
+
x,
|
|
1242
|
+
z,
|
|
1243
|
+
U,
|
|
1228
1244
|
qt,
|
|
1229
1245
|
_,
|
|
1230
1246
|
a,
|
|
1231
1247
|
$e,
|
|
1232
1248
|
$e !== null && an(a, Gt()),
|
|
1233
|
-
|
|
1234
|
-
() =>
|
|
1249
|
+
C,
|
|
1250
|
+
() => Le.enabled,
|
|
1235
1251
|
Tt,
|
|
1236
1252
|
Ht,
|
|
1237
|
-
|
|
1253
|
+
W,
|
|
1238
1254
|
gt,
|
|
1239
|
-
(
|
|
1240
|
-
|
|
1255
|
+
(M) => {
|
|
1256
|
+
ae() || (bt(), ye = !0, oe(!0, "send"), ie(), b.sendMessage(M));
|
|
1241
1257
|
},
|
|
1242
1258
|
() => {
|
|
1243
|
-
|
|
1259
|
+
ye = !0, oe(!0, "send"), ie(), b.retryLastMessage();
|
|
1244
1260
|
},
|
|
1245
1261
|
t.morningReport,
|
|
1246
1262
|
() => {
|
|
1247
|
-
t.morningReport = null, t.onMorningReportSnooze?.(), zt(),
|
|
1263
|
+
t.morningReport = null, t.onMorningReportSnooze?.(), zt(), H(b.getState());
|
|
1248
1264
|
},
|
|
1249
1265
|
Ut,
|
|
1250
1266
|
t.attachmentPreviewUrlResolver,
|
|
1251
|
-
hi && !
|
|
1267
|
+
hi && !Nt ? {
|
|
1252
1268
|
dismissedCandidateIds: pt,
|
|
1253
1269
|
draftingCandidate: ht,
|
|
1254
1270
|
error: nt,
|
|
1255
1271
|
characterIconOptions: gt(),
|
|
1256
|
-
onSeen: (
|
|
1257
|
-
Oe.add(
|
|
1272
|
+
onSeen: (M) => {
|
|
1273
|
+
Oe.add(M.id), W();
|
|
1258
1274
|
},
|
|
1259
|
-
onDraft: (
|
|
1260
|
-
fi(
|
|
1275
|
+
onDraft: (M) => {
|
|
1276
|
+
fi(M);
|
|
1261
1277
|
},
|
|
1262
|
-
onDismiss: (
|
|
1263
|
-
Oe.add(
|
|
1278
|
+
onDismiss: (M) => {
|
|
1279
|
+
Oe.add(M.id), pt.add(M.id), W(), nt = null, H(b.getState());
|
|
1264
1280
|
},
|
|
1265
|
-
onDisable: (
|
|
1266
|
-
|
|
1281
|
+
onDisable: (M) => {
|
|
1282
|
+
Nt = !0, Oe.add(M.id), pt.add(M.id), W(), Xr(t, !0), nt = null, H(b.getState());
|
|
1267
1283
|
}
|
|
1268
1284
|
} : void 0
|
|
1269
|
-
),
|
|
1285
|
+
), C ? (Pe = x.scrollTop, ie()) : y && ja(a) && ti();
|
|
1270
1286
|
};
|
|
1271
1287
|
return On = zi(
|
|
1272
1288
|
(a) => {
|
|
1273
|
-
$e = a, !
|
|
1289
|
+
$e = a, !X && an(b.getState(), Gt()) && H(b.getState());
|
|
1274
1290
|
},
|
|
1275
1291
|
{
|
|
1276
1292
|
backendUrl: t.backendUrl,
|
|
@@ -1280,15 +1296,15 @@ async function La(e = {}) {
|
|
|
1280
1296
|
), b.on("state", (a) => {
|
|
1281
1297
|
wt();
|
|
1282
1298
|
const d = Dn && !a.isThinking;
|
|
1283
|
-
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(() => {
|
|
1284
1300
|
We = null, gi();
|
|
1285
|
-
}, 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(
|
|
1286
1302
|
"web-sdk.widget",
|
|
1287
1303
|
"Agent state supplied appearance",
|
|
1288
1304
|
{
|
|
1289
1305
|
appearance: a.appearance
|
|
1290
1306
|
}
|
|
1291
|
-
), jt(a.appearance, "agent.state.appearance")) : Wt && (Wt = !1,
|
|
1307
|
+
), jt(a.appearance, "agent.state.appearance")) : Wt && (Wt = !1, Z(
|
|
1292
1308
|
"web-sdk.widget",
|
|
1293
1309
|
"Agent state cleared appearance; reverting to configured widget options",
|
|
1294
1310
|
{
|
|
@@ -1296,8 +1312,8 @@ async function La(e = {}) {
|
|
|
1296
1312
|
fallbackColorScheme: t.colorScheme,
|
|
1297
1313
|
fallbackFontFamily: t.fontFamily
|
|
1298
1314
|
}
|
|
1299
|
-
), jt({}, "agent.state.appearance-cleared")),
|
|
1300
|
-
}),
|
|
1315
|
+
), jt({}, "agent.state.appearance-cleared")), H(a), q(), d && Nn();
|
|
1316
|
+
}), H(b.getState()), q(), Ut(), {
|
|
1301
1317
|
agent: b,
|
|
1302
1318
|
startNewChat: $t,
|
|
1303
1319
|
host: n,
|
|
@@ -1310,18 +1326,18 @@ async function La(e = {}) {
|
|
|
1310
1326
|
t.billingStatus,
|
|
1311
1327
|
d,
|
|
1312
1328
|
Fe
|
|
1313
|
-
) && (t.billingStatus = d, t.billingStatus?.creditsUsed !== null && !
|
|
1329
|
+
) && (t.billingStatus = d, t.billingStatus?.creditsUsed !== null && !re(t.billingStatus) && (Fe = null), on(
|
|
1314
1330
|
o.querySelector(".pluno-pa-widget__billing-status"),
|
|
1315
1331
|
t.billingStatus,
|
|
1316
1332
|
Fe
|
|
1317
|
-
),
|
|
1333
|
+
), q());
|
|
1318
1334
|
},
|
|
1319
1335
|
updateAuthGate: (a) => {
|
|
1320
1336
|
const d = Qe();
|
|
1321
|
-
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(),
|
|
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();
|
|
1322
1338
|
},
|
|
1323
1339
|
openPanel: () => {
|
|
1324
|
-
|
|
1340
|
+
we(f.value, !1);
|
|
1325
1341
|
},
|
|
1326
1342
|
closePanel: zt,
|
|
1327
1343
|
updateDisplayState: (a) => {
|
|
@@ -1332,22 +1348,22 @@ async function La(e = {}) {
|
|
|
1332
1348
|
Ze("minimized", !1);
|
|
1333
1349
|
},
|
|
1334
1350
|
updateMorningReport: (a) => {
|
|
1335
|
-
t.morningReport = a ?? null,
|
|
1351
|
+
t.morningReport = a ?? null, H(b.getState());
|
|
1336
1352
|
},
|
|
1337
1353
|
destroy: () => {
|
|
1338
|
-
|
|
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());
|
|
1339
1355
|
}
|
|
1340
1356
|
};
|
|
1341
1357
|
async function fi(a) {
|
|
1342
1358
|
if (!ht) {
|
|
1343
|
-
ht = a, nt = null,
|
|
1359
|
+
ht = a, nt = null, H(b.getState());
|
|
1344
1360
|
try {
|
|
1345
1361
|
if (!t.socialPostDraftHandler)
|
|
1346
1362
|
throw new Error("Social post drafting is not available here.");
|
|
1347
1363
|
const d = await t.socialPostDraftHandler(a);
|
|
1348
1364
|
if (!d.linkedinPost || !d.xPost)
|
|
1349
1365
|
throw new Error("Pluno did not return a complete social post draft.");
|
|
1350
|
-
Oe.add(a.id), pt.add(a.id),
|
|
1366
|
+
Oe.add(a.id), pt.add(a.id), W(), Be?.remove(), Be = Dr(d, {
|
|
1351
1367
|
socialPostRewardsUrl: t.socialPostRewardsUrl,
|
|
1352
1368
|
onClose: () => {
|
|
1353
1369
|
Be?.remove(), Be = null;
|
|
@@ -1356,26 +1372,26 @@ async function La(e = {}) {
|
|
|
1356
1372
|
} catch (d) {
|
|
1357
1373
|
nt = d instanceof Error ? d.message : "Could not draft social post.";
|
|
1358
1374
|
} finally {
|
|
1359
|
-
ht = null,
|
|
1375
|
+
ht = null, H(b.getState());
|
|
1360
1376
|
}
|
|
1361
1377
|
}
|
|
1362
1378
|
}
|
|
1363
1379
|
function jt(a, d) {
|
|
1364
|
-
const
|
|
1380
|
+
const y = a.accentColor ?? t.accentColor, C = a.colorScheme ?? t.colorScheme, M = a.fontFamily ?? t.fontFamily, Vt = a.scribbleStyle ?? t.scribbleStyle;
|
|
1365
1381
|
r = Qn(
|
|
1366
|
-
|
|
1382
|
+
y,
|
|
1367
1383
|
Vt
|
|
1368
1384
|
), eo(o, r, {
|
|
1369
|
-
accentColor:
|
|
1370
|
-
colorScheme:
|
|
1371
|
-
fontFamily:
|
|
1385
|
+
accentColor: y,
|
|
1386
|
+
colorScheme: C,
|
|
1387
|
+
fontFamily: M,
|
|
1372
1388
|
scribbleStyle: Vt
|
|
1373
|
-
}),
|
|
1389
|
+
}), Z("web-sdk.widget", "Updated widget appearance", {
|
|
1374
1390
|
source: d,
|
|
1375
1391
|
inputAppearance: a,
|
|
1376
|
-
appliedAccentColor:
|
|
1377
|
-
appliedColorScheme:
|
|
1378
|
-
appliedFontFamily:
|
|
1392
|
+
appliedAccentColor: y,
|
|
1393
|
+
appliedColorScheme: C,
|
|
1394
|
+
appliedFontFamily: M,
|
|
1379
1395
|
appliedScribbleStyle: Vt,
|
|
1380
1396
|
cssAccent: o.style.getPropertyValue("--pluno-pa-accent")
|
|
1381
1397
|
});
|
|
@@ -1386,7 +1402,7 @@ function Qn(e, t) {
|
|
|
1386
1402
|
}
|
|
1387
1403
|
function Pa(e) {
|
|
1388
1404
|
const t = Ta(e);
|
|
1389
|
-
return t === null ? "#fafafa" :
|
|
1405
|
+
return t === null ? "#fafafa" : Na(t) > 0.5 ? "#18181b" : "#fafaf9";
|
|
1390
1406
|
}
|
|
1391
1407
|
function Ta(e) {
|
|
1392
1408
|
const t = e.trim();
|
|
@@ -1400,7 +1416,7 @@ function Ta(e) {
|
|
|
1400
1416
|
Number.parseInt(t[3] + t[3], 16)
|
|
1401
1417
|
] : null;
|
|
1402
1418
|
}
|
|
1403
|
-
function
|
|
1419
|
+
function Na([e, t, n]) {
|
|
1404
1420
|
const i = (o) => {
|
|
1405
1421
|
const r = o / 255;
|
|
1406
1422
|
return r <= 0.03928 ? r / 12.92 : ((r + 0.055) / 1.055) ** 2.4;
|
|
@@ -1419,7 +1435,7 @@ function eo(e, t, n) {
|
|
|
1419
1435
|
e.style.setProperty("--pluno-pa-accent", i), n.scribbleStyle ? e.style.setProperty(
|
|
1420
1436
|
"--pluno-pa-accent-contrast",
|
|
1421
1437
|
Pa(i)
|
|
1422
|
-
) : e.style.removeProperty("--pluno-pa-accent-contrast"), e.style.fontFamily = n.scribbleStyle ? ha : n.fontFamily, n.scribbleStyle &&
|
|
1438
|
+
) : e.style.removeProperty("--pluno-pa-accent-contrast"), e.style.fontFamily = n.scribbleStyle ? ha : n.fontFamily, n.scribbleStyle && Aa(e.ownerDocument);
|
|
1423
1439
|
const o = Array.from(
|
|
1424
1440
|
e.querySelectorAll(".pluno-pa-widget__character")
|
|
1425
1441
|
);
|
|
@@ -1431,7 +1447,7 @@ function eo(e, t, n) {
|
|
|
1431
1447
|
)
|
|
1432
1448
|
);
|
|
1433
1449
|
}
|
|
1434
|
-
function
|
|
1450
|
+
function Aa(e) {
|
|
1435
1451
|
if (e.getElementById(Yn))
|
|
1436
1452
|
return;
|
|
1437
1453
|
const t = e.createElement("style");
|
|
@@ -1443,7 +1459,7 @@ function Ia(e) {
|
|
|
1443
1459
|
src: url("https://fonts.gstatic.com/s/architectsdaughter/v20/KtkxAKiDZI_td1Lkx62xHZHDtgO_Y-bvTYlg4-7jA-U.woff2") format("woff2");
|
|
1444
1460
|
}`, e.head.appendChild(t), e.fonts?.load('16px "Architects Daughter"');
|
|
1445
1461
|
}
|
|
1446
|
-
function
|
|
1462
|
+
function Ia({
|
|
1447
1463
|
root: e,
|
|
1448
1464
|
launcher: t,
|
|
1449
1465
|
launcherDragHandle: n,
|
|
@@ -1460,29 +1476,29 @@ function Na({
|
|
|
1460
1476
|
if (l !== m.pointerId || !s || !p)
|
|
1461
1477
|
return;
|
|
1462
1478
|
m.preventDefault();
|
|
1463
|
-
const
|
|
1464
|
-
!g && Math.hypot(
|
|
1479
|
+
const I = m.clientX - s.x, L = m.clientY - s.y;
|
|
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 }));
|
|
1465
1481
|
}, T = (m) => {
|
|
1466
1482
|
l === m.pointerId && (m.preventDefault(), m.stopPropagation(), g && (c = { x: m.clientX, y: m.clientY }, r()), h());
|
|
1467
|
-
},
|
|
1483
|
+
}, O = (m) => {
|
|
1468
1484
|
l === m.pointerId && (m.preventDefault(), h());
|
|
1469
1485
|
}, u = (m) => {
|
|
1470
1486
|
if (!c)
|
|
1471
1487
|
return;
|
|
1472
|
-
const
|
|
1488
|
+
const I = Math.hypot(
|
|
1473
1489
|
m.clientX - c.x,
|
|
1474
1490
|
m.clientY - c.y
|
|
1475
1491
|
) <= un;
|
|
1476
|
-
c = null,
|
|
1477
|
-
},
|
|
1492
|
+
c = null, I && (m.preventDefault(), m.stopPropagation());
|
|
1493
|
+
}, S = (m) => {
|
|
1478
1494
|
if (e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing"))
|
|
1479
1495
|
return;
|
|
1480
|
-
const
|
|
1496
|
+
const I = m.shiftKey ? Io : Ao, L = i();
|
|
1481
1497
|
let R = null;
|
|
1482
|
-
m.key === "ArrowUp" ? R = { x: L.x, y: L.y -
|
|
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());
|
|
1483
1499
|
};
|
|
1484
|
-
return t.addEventListener("pointerdown", E), t.addEventListener("pointermove", P), t.addEventListener("pointerup", T), t.addEventListener("pointercancel",
|
|
1485
|
-
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);
|
|
1486
1502
|
};
|
|
1487
1503
|
}
|
|
1488
1504
|
function Ra({
|
|
@@ -1496,47 +1512,47 @@ function Ra({
|
|
|
1496
1512
|
const c = () => {
|
|
1497
1513
|
r = null, l = null, s = null, p = null, g = !1, e.classList.remove("pluno-pa-widget--resizing");
|
|
1498
1514
|
}, h = (u) => {
|
|
1499
|
-
const
|
|
1500
|
-
!e.classList.contains("pluno-pa-widget--open") || !to(m) || (u.preventDefault(), u.stopPropagation(), r = u.pointerId, l = m, s = { x: u.clientX, y: u.clientY }, p = n(), g = !1,
|
|
1515
|
+
const S = u.currentTarget, m = S.dataset.resizeDirection;
|
|
1516
|
+
!e.classList.contains("pluno-pa-widget--open") || !to(m) || (u.preventDefault(), u.stopPropagation(), r = u.pointerId, l = m, s = { x: u.clientX, y: u.clientY }, p = n(), g = !1, S.setPointerCapture?.(u.pointerId));
|
|
1501
1517
|
}, E = (u) => {
|
|
1502
1518
|
if (r !== u.pointerId || !l || !s || !p)
|
|
1503
1519
|
return;
|
|
1504
1520
|
u.preventDefault(), u.stopPropagation();
|
|
1505
|
-
const
|
|
1506
|
-
!g && Math.hypot(
|
|
1507
|
-
no(p, l,
|
|
1521
|
+
const S = u.clientX - s.x, m = u.clientY - s.y;
|
|
1522
|
+
!g && Math.hypot(S, m) < un || (g = !0, e.classList.add("pluno-pa-widget--resizing"), i(
|
|
1523
|
+
no(p, l, S, m)
|
|
1508
1524
|
));
|
|
1509
1525
|
}, P = (u) => {
|
|
1510
1526
|
r === u.pointerId && (u.preventDefault(), u.stopPropagation(), g && o(), c());
|
|
1511
1527
|
}, T = (u) => {
|
|
1512
1528
|
r === u.pointerId && (u.preventDefault(), c());
|
|
1513
|
-
},
|
|
1514
|
-
const m = u.currentTarget.dataset.resizeDirection,
|
|
1515
|
-
let R = 0,
|
|
1516
|
-
to(m) && (u.key === "ArrowLeft" ? R = -
|
|
1529
|
+
}, O = (u) => {
|
|
1530
|
+
const m = u.currentTarget.dataset.resizeDirection, I = u.shiftKey ? Io : Ao, L = n();
|
|
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()));
|
|
1517
1533
|
};
|
|
1518
1534
|
for (const u of t)
|
|
1519
|
-
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);
|
|
1520
1536
|
return () => {
|
|
1521
1537
|
for (const u of t)
|
|
1522
|
-
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);
|
|
1523
1539
|
};
|
|
1524
1540
|
}
|
|
1525
1541
|
function to(e) {
|
|
1526
1542
|
return e === "left" || e === "right" || e === "top" || e === "bottom" || e === "top-left" || e === "top-right" || e === "bottom-left" || e === "bottom-right";
|
|
1527
1543
|
}
|
|
1528
1544
|
function no(e, t, n, i) {
|
|
1529
|
-
const o =
|
|
1545
|
+
const o = ee(), r = oo({
|
|
1530
1546
|
leading: e.position.x,
|
|
1531
1547
|
length: e.size.width,
|
|
1532
1548
|
delta: n,
|
|
1533
1549
|
resizeLeading: t.endsWith("left") || t === "left",
|
|
1534
1550
|
resizeTrailing: t.endsWith("right") || t === "right",
|
|
1535
|
-
minLeading:
|
|
1536
|
-
maxTrailing: o.width -
|
|
1551
|
+
minLeading: A,
|
|
1552
|
+
maxTrailing: o.width - A,
|
|
1537
1553
|
minLength: Math.min(
|
|
1538
1554
|
bn,
|
|
1539
|
-
o.width -
|
|
1555
|
+
o.width - A * 2
|
|
1540
1556
|
)
|
|
1541
1557
|
}), l = oo({
|
|
1542
1558
|
leading: e.position.y,
|
|
@@ -1544,11 +1560,11 @@ function no(e, t, n, i) {
|
|
|
1544
1560
|
delta: i,
|
|
1545
1561
|
resizeLeading: t.startsWith("top") || t === "top",
|
|
1546
1562
|
resizeTrailing: t.startsWith("bottom") || t === "bottom",
|
|
1547
|
-
minLeading:
|
|
1548
|
-
maxTrailing: o.height -
|
|
1563
|
+
minLeading: Re,
|
|
1564
|
+
maxTrailing: o.height - A,
|
|
1549
1565
|
minLength: Math.min(
|
|
1550
1566
|
_n,
|
|
1551
|
-
o.height -
|
|
1567
|
+
o.height - Re - A
|
|
1552
1568
|
)
|
|
1553
1569
|
});
|
|
1554
1570
|
return {
|
|
@@ -1570,10 +1586,10 @@ function oo({
|
|
|
1570
1586
|
if (i) {
|
|
1571
1587
|
const g = e + n;
|
|
1572
1588
|
if (g >= r) {
|
|
1573
|
-
const h =
|
|
1589
|
+
const h = Q(g, r, p - s);
|
|
1574
1590
|
return { leading: h, length: p - h };
|
|
1575
1591
|
}
|
|
1576
|
-
const c =
|
|
1592
|
+
const c = Q(
|
|
1577
1593
|
p + r - g,
|
|
1578
1594
|
p,
|
|
1579
1595
|
l
|
|
@@ -1583,14 +1599,14 @@ function oo({
|
|
|
1583
1599
|
if (o) {
|
|
1584
1600
|
const g = p + n;
|
|
1585
1601
|
if (g <= l) {
|
|
1586
|
-
const h =
|
|
1602
|
+
const h = Q(
|
|
1587
1603
|
g,
|
|
1588
1604
|
e + s,
|
|
1589
1605
|
l
|
|
1590
1606
|
);
|
|
1591
1607
|
return { leading: e, length: h - e };
|
|
1592
1608
|
}
|
|
1593
|
-
const c =
|
|
1609
|
+
const c = Q(
|
|
1594
1610
|
e - (g - l),
|
|
1595
1611
|
r,
|
|
1596
1612
|
e
|
|
@@ -1599,8 +1615,8 @@ function oo({
|
|
|
1599
1615
|
}
|
|
1600
1616
|
return { leading: e, length: t };
|
|
1601
1617
|
}
|
|
1602
|
-
function
|
|
1603
|
-
const n =
|
|
1618
|
+
function Ct(e, t = !0) {
|
|
1619
|
+
const n = ee();
|
|
1604
1620
|
if (e.classList.contains("pluno-pa-widget--minimized"))
|
|
1605
1621
|
return { width: Xn, height: Xn };
|
|
1606
1622
|
const i = e.getBoundingClientRect(), o = !e.classList.contains("pluno-pa-widget--open") && !e.classList.contains("pluno-pa-widget--closing");
|
|
@@ -1610,23 +1626,23 @@ function St(e, t = !0) {
|
|
|
1610
1626
|
};
|
|
1611
1627
|
}
|
|
1612
1628
|
function Da() {
|
|
1613
|
-
const e =
|
|
1629
|
+
const e = ee();
|
|
1614
1630
|
return {
|
|
1615
1631
|
width: Math.min(
|
|
1616
|
-
|
|
1632
|
+
Q(
|
|
1617
1633
|
e.width * ba,
|
|
1618
1634
|
bn,
|
|
1619
1635
|
wa
|
|
1620
1636
|
),
|
|
1621
|
-
e.width -
|
|
1637
|
+
e.width - A * 2
|
|
1622
1638
|
),
|
|
1623
1639
|
height: Math.min(
|
|
1624
|
-
|
|
1640
|
+
Q(
|
|
1625
1641
|
e.height * xa,
|
|
1626
1642
|
_n,
|
|
1627
1643
|
_a
|
|
1628
1644
|
),
|
|
1629
|
-
e.height -
|
|
1645
|
+
e.height - Re - A
|
|
1630
1646
|
)
|
|
1631
1647
|
};
|
|
1632
1648
|
}
|
|
@@ -1634,28 +1650,28 @@ function at(e = null) {
|
|
|
1634
1650
|
return e ? kt(e) : Da();
|
|
1635
1651
|
}
|
|
1636
1652
|
function kt(e) {
|
|
1637
|
-
const t =
|
|
1653
|
+
const t = ee();
|
|
1638
1654
|
return {
|
|
1639
|
-
width:
|
|
1655
|
+
width: Q(
|
|
1640
1656
|
e.width,
|
|
1641
1657
|
Math.min(
|
|
1642
1658
|
bn,
|
|
1643
|
-
t.width -
|
|
1659
|
+
t.width - A * 2
|
|
1644
1660
|
),
|
|
1645
1661
|
Math.max(
|
|
1646
|
-
|
|
1647
|
-
t.width -
|
|
1662
|
+
A,
|
|
1663
|
+
t.width - A * 2
|
|
1648
1664
|
)
|
|
1649
1665
|
),
|
|
1650
|
-
height:
|
|
1666
|
+
height: Q(
|
|
1651
1667
|
e.height,
|
|
1652
1668
|
Math.min(
|
|
1653
1669
|
_n,
|
|
1654
|
-
t.height -
|
|
1670
|
+
t.height - Re - A
|
|
1655
1671
|
),
|
|
1656
1672
|
Math.max(
|
|
1657
|
-
|
|
1658
|
-
t.height -
|
|
1673
|
+
A,
|
|
1674
|
+
t.height - Re - A
|
|
1659
1675
|
)
|
|
1660
1676
|
)
|
|
1661
1677
|
};
|
|
@@ -1675,14 +1691,14 @@ function za(e, t, n) {
|
|
|
1675
1691
|
const r = e.getBoundingClientRect();
|
|
1676
1692
|
if (r.width > 0 || r.height > 0)
|
|
1677
1693
|
return { x: r.left, y: r.top };
|
|
1678
|
-
const l =
|
|
1694
|
+
const l = ee();
|
|
1679
1695
|
return {
|
|
1680
1696
|
x: t === "bottom-left" ? 26 : l.width - 26 - n.width,
|
|
1681
1697
|
y: l.height - 24 - n.height
|
|
1682
1698
|
};
|
|
1683
1699
|
}
|
|
1684
1700
|
function Zt(e, t, n) {
|
|
1685
|
-
const i =
|
|
1701
|
+
const i = Ct(e, !1);
|
|
1686
1702
|
return t ? gn(
|
|
1687
1703
|
e,
|
|
1688
1704
|
zo(t, i),
|
|
@@ -1690,42 +1706,42 @@ function Zt(e, t, n) {
|
|
|
1690
1706
|
) : Ma(n === "bottom-left" ? "bottom-left" : "bottom-right", i, ma);
|
|
1691
1707
|
}
|
|
1692
1708
|
function Ma(e, t, n) {
|
|
1693
|
-
const i =
|
|
1709
|
+
const i = ee();
|
|
1694
1710
|
return {
|
|
1695
1711
|
x: e.endsWith("right") ? Math.max(0, i.width - t.width - n) : n,
|
|
1696
1712
|
y: e.startsWith("bottom") ? Math.max(0, i.height - t.height - n) : n
|
|
1697
1713
|
};
|
|
1698
1714
|
}
|
|
1699
1715
|
function gn(e, t, n) {
|
|
1700
|
-
const i =
|
|
1716
|
+
const i = ee(), o = A + Ba(e);
|
|
1701
1717
|
return {
|
|
1702
|
-
x:
|
|
1718
|
+
x: Q(
|
|
1703
1719
|
t.x,
|
|
1704
|
-
|
|
1720
|
+
A,
|
|
1705
1721
|
Math.max(
|
|
1706
|
-
|
|
1707
|
-
i.width - n.width -
|
|
1722
|
+
A,
|
|
1723
|
+
i.width - n.width - A
|
|
1708
1724
|
)
|
|
1709
1725
|
),
|
|
1710
|
-
y:
|
|
1726
|
+
y: Q(
|
|
1711
1727
|
t.y,
|
|
1712
1728
|
o,
|
|
1713
1729
|
Math.max(
|
|
1714
1730
|
o,
|
|
1715
|
-
i.height - n.height -
|
|
1731
|
+
i.height - n.height - A
|
|
1716
1732
|
)
|
|
1717
1733
|
)
|
|
1718
1734
|
};
|
|
1719
1735
|
}
|
|
1720
1736
|
function zo(e, t) {
|
|
1721
|
-
const n =
|
|
1737
|
+
const n = ee();
|
|
1722
1738
|
return {
|
|
1723
1739
|
x: e.anchor.endsWith("right") ? n.width - t.width - e.x : e.x,
|
|
1724
1740
|
y: e.anchor.startsWith("bottom") ? n.height - t.height - e.y : e.y
|
|
1725
1741
|
};
|
|
1726
1742
|
}
|
|
1727
1743
|
function Oa(e, t) {
|
|
1728
|
-
const n = Ua(e, t), i =
|
|
1744
|
+
const n = Ua(e, t), i = ee();
|
|
1729
1745
|
return {
|
|
1730
1746
|
anchor: n,
|
|
1731
1747
|
x: n.endsWith("right") ? i.width - e.x - t.width : e.x,
|
|
@@ -1733,36 +1749,36 @@ function Oa(e, t) {
|
|
|
1733
1749
|
};
|
|
1734
1750
|
}
|
|
1735
1751
|
function Ua(e, t) {
|
|
1736
|
-
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";
|
|
1737
1753
|
return `${r}-${l}`;
|
|
1738
1754
|
}
|
|
1739
1755
|
function Ba(e) {
|
|
1740
|
-
return e.classList.contains("pluno-pa-widget--scribble") ?
|
|
1756
|
+
return e.classList.contains("pluno-pa-widget--scribble") ? Ca : Sa;
|
|
1741
1757
|
}
|
|
1742
1758
|
function Jt(e, t, n, i = null) {
|
|
1743
|
-
const o =
|
|
1759
|
+
const o = Ct(e), r = at(i), l = {
|
|
1744
1760
|
x: n === "bottom-left" ? t.x : t.x + o.width - r.width,
|
|
1745
1761
|
y: t.y + o.height - r.height
|
|
1746
1762
|
};
|
|
1747
1763
|
return yt(l, r);
|
|
1748
1764
|
}
|
|
1749
1765
|
function yt(e, t) {
|
|
1750
|
-
const n =
|
|
1766
|
+
const n = ee();
|
|
1751
1767
|
return {
|
|
1752
|
-
x:
|
|
1768
|
+
x: Q(
|
|
1753
1769
|
e.x,
|
|
1754
|
-
|
|
1770
|
+
A,
|
|
1755
1771
|
Math.max(
|
|
1756
|
-
|
|
1757
|
-
n.width - t.width -
|
|
1772
|
+
A,
|
|
1773
|
+
n.width - t.width - A
|
|
1758
1774
|
)
|
|
1759
1775
|
),
|
|
1760
|
-
y:
|
|
1776
|
+
y: Q(
|
|
1761
1777
|
e.y,
|
|
1762
|
-
|
|
1778
|
+
Re,
|
|
1763
1779
|
Math.max(
|
|
1764
|
-
|
|
1765
|
-
n.height - t.height -
|
|
1780
|
+
Re,
|
|
1781
|
+
n.height - t.height - A
|
|
1766
1782
|
)
|
|
1767
1783
|
)
|
|
1768
1784
|
};
|
|
@@ -1780,10 +1796,10 @@ function Fa(e, t) {
|
|
|
1780
1796
|
function io(e) {
|
|
1781
1797
|
e.style.removeProperty("--pluno-pa-panel-offset-x"), e.style.removeProperty("--pluno-pa-panel-offset-y");
|
|
1782
1798
|
}
|
|
1783
|
-
function
|
|
1799
|
+
function ee() {
|
|
1784
1800
|
return {
|
|
1785
|
-
width: window.innerWidth || document.documentElement.clientWidth || Po +
|
|
1786
|
-
height: window.innerHeight || document.documentElement.clientHeight || To +
|
|
1801
|
+
width: window.innerWidth || document.documentElement.clientWidth || Po + A * 2,
|
|
1802
|
+
height: window.innerHeight || document.documentElement.clientHeight || To + A * 2
|
|
1787
1803
|
};
|
|
1788
1804
|
}
|
|
1789
1805
|
function Qt(e) {
|
|
@@ -1795,10 +1811,10 @@ function Qt(e) {
|
|
|
1795
1811
|
height: Math.round(t.height)
|
|
1796
1812
|
};
|
|
1797
1813
|
}
|
|
1798
|
-
function
|
|
1814
|
+
function Q(e, t, n) {
|
|
1799
1815
|
return Math.min(Math.max(e, t), n);
|
|
1800
1816
|
}
|
|
1801
|
-
function
|
|
1817
|
+
function Z(e, t, n) {
|
|
1802
1818
|
if (typeof window > "u")
|
|
1803
1819
|
return;
|
|
1804
1820
|
const i = window, o = {
|
|
@@ -1812,7 +1828,7 @@ function X(e, t, n) {
|
|
|
1812
1828
|
);
|
|
1813
1829
|
}
|
|
1814
1830
|
function Wa(e, t) {
|
|
1815
|
-
|
|
1831
|
+
Z("web-sdk.widget.position", e, t);
|
|
1816
1832
|
}
|
|
1817
1833
|
function en(e, t, n, i) {
|
|
1818
1834
|
const o = t.value.trim();
|
|
@@ -1957,21 +1973,21 @@ function Ja(e) {
|
|
|
1957
1973
|
pr(),
|
|
1958
1974
|
!0
|
|
1959
1975
|
)
|
|
1960
|
-
), n.appendChild(s), n.appendChild(nr()), t.appendChild(n), t.appendChild(Qa()), t.appendChild(er()), t.appendChild(tr()), t.appendChild(
|
|
1961
|
-
|
|
1962
|
-
), t.appendChild(
|
|
1963
|
-
|
|
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")
|
|
1964
1980
|
), t.appendChild(
|
|
1965
|
-
|
|
1981
|
+
Se("top-left", "Resize Pluno from top left")
|
|
1966
1982
|
), t.appendChild(
|
|
1967
|
-
|
|
1983
|
+
Se("top-right", "Resize Pluno from top right")
|
|
1968
1984
|
), t.appendChild(
|
|
1969
|
-
|
|
1985
|
+
Se("bottom-left", "Resize Pluno from bottom left")
|
|
1970
1986
|
), t.appendChild(
|
|
1971
|
-
|
|
1987
|
+
Se("bottom-right", "Resize Pluno from bottom right")
|
|
1972
1988
|
), t;
|
|
1973
1989
|
}
|
|
1974
|
-
function
|
|
1990
|
+
function Se(e, t) {
|
|
1975
1991
|
const n = document.createElement("button");
|
|
1976
1992
|
return n.type = "button", n.className = [
|
|
1977
1993
|
"pluno-pa-widget__resize-handle",
|
|
@@ -2106,7 +2122,7 @@ function ir(e, t) {
|
|
|
2106
2122
|
y2: "1040",
|
|
2107
2123
|
gradientUnits: "userSpaceOnUse"
|
|
2108
2124
|
});
|
|
2109
|
-
|
|
2125
|
+
F(l, "0", n.top), F(l, "0.36", n.middle), F(l, "0.72", n.bottom), F(l, "1", n.bottom);
|
|
2110
2126
|
const s = w(r, "linearGradient", {
|
|
2111
2127
|
id: i.boltEdge,
|
|
2112
2128
|
x1: "470",
|
|
@@ -2115,28 +2131,28 @@ function ir(e, t) {
|
|
|
2115
2131
|
y2: "980",
|
|
2116
2132
|
gradientUnits: "userSpaceOnUse"
|
|
2117
2133
|
});
|
|
2118
|
-
|
|
2134
|
+
F(s, "0", n.edgeStart), F(s, "0.32", n.edgeMiddle), F(s, "0.78", n.edgeEnd), F(s, "1", n.edgeEnd);
|
|
2119
2135
|
const p = w(r, "radialGradient", {
|
|
2120
2136
|
id: i.boltGlow,
|
|
2121
2137
|
cx: "50%",
|
|
2122
2138
|
cy: "22%",
|
|
2123
2139
|
r: "82%"
|
|
2124
2140
|
});
|
|
2125
|
-
|
|
2141
|
+
F(p, "0", n.glow, "0.72"), F(p, "0.5", n.middle, "0.44"), F(p, "1", n.bottom, "0");
|
|
2126
2142
|
const g = w(r, "radialGradient", {
|
|
2127
2143
|
id: i.eyeWhite,
|
|
2128
2144
|
cx: "35%",
|
|
2129
2145
|
cy: "25%",
|
|
2130
2146
|
r: "70%"
|
|
2131
2147
|
});
|
|
2132
|
-
|
|
2148
|
+
F(g, "0", "#ffffff"), F(g, "0.72", "#ffffff"), F(g, "1", "#e5e5e5");
|
|
2133
2149
|
const c = w(r, "radialGradient", {
|
|
2134
2150
|
id: i.pupil,
|
|
2135
2151
|
cx: "42%",
|
|
2136
2152
|
cy: "38%",
|
|
2137
2153
|
r: "65%"
|
|
2138
2154
|
});
|
|
2139
|
-
|
|
2155
|
+
F(c, "0", "#2a1f10"), F(c, "0.52", "#080604"), F(c, "1", "#000000");
|
|
2140
2156
|
const h = w(r, "filter", {
|
|
2141
2157
|
id: i.softDropShadow,
|
|
2142
2158
|
x: "-18%",
|
|
@@ -2215,27 +2231,27 @@ function ir(e, t) {
|
|
|
2215
2231
|
"flood-color": "#000000",
|
|
2216
2232
|
"flood-opacity": "0.22"
|
|
2217
2233
|
});
|
|
2218
|
-
const
|
|
2219
|
-
w(
|
|
2234
|
+
const O = w(r, "clipPath", { id: i.boltClip });
|
|
2235
|
+
w(O, "path", { d: vt });
|
|
2220
2236
|
const u = w(o, "g", {
|
|
2221
|
-
filter:
|
|
2237
|
+
filter: J(i.softDropShadow)
|
|
2222
2238
|
});
|
|
2223
2239
|
w(u, "path", {
|
|
2224
2240
|
d: vt,
|
|
2225
|
-
fill:
|
|
2241
|
+
fill: J(i.boltEdge)
|
|
2226
2242
|
});
|
|
2227
|
-
const
|
|
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";
|
|
2228
2244
|
w(u, "path", {
|
|
2229
|
-
d:
|
|
2230
|
-
fill:
|
|
2231
|
-
filter:
|
|
2245
|
+
d: S,
|
|
2246
|
+
fill: J(i.boltFill),
|
|
2247
|
+
filter: J(i.innerDepth)
|
|
2232
2248
|
}), w(u, "path", {
|
|
2233
|
-
d:
|
|
2234
|
-
fill:
|
|
2249
|
+
d: S,
|
|
2250
|
+
fill: J(i.boltGlow),
|
|
2235
2251
|
opacity: "0.74"
|
|
2236
2252
|
});
|
|
2237
2253
|
const m = w(u, "g", {
|
|
2238
|
-
"clip-path":
|
|
2254
|
+
"clip-path": J(i.boltClip),
|
|
2239
2255
|
opacity: "0.42"
|
|
2240
2256
|
});
|
|
2241
2257
|
w(m, "path", {
|
|
@@ -2260,9 +2276,9 @@ function ir(e, t) {
|
|
|
2260
2276
|
"stroke-linecap": "round",
|
|
2261
2277
|
opacity: "0.48"
|
|
2262
2278
|
});
|
|
2263
|
-
const
|
|
2279
|
+
const I = w(o, "g", { filter: J(i.eyeShadow) });
|
|
2264
2280
|
return ao(
|
|
2265
|
-
|
|
2281
|
+
I,
|
|
2266
2282
|
"rotate(-2 528 463)",
|
|
2267
2283
|
"528",
|
|
2268
2284
|
"463",
|
|
@@ -2272,7 +2288,7 @@ function ir(e, t) {
|
|
|
2272
2288
|
"447",
|
|
2273
2289
|
i
|
|
2274
2290
|
), ao(
|
|
2275
|
-
|
|
2291
|
+
I,
|
|
2276
2292
|
"rotate(2 717 462)",
|
|
2277
2293
|
"717",
|
|
2278
2294
|
"462",
|
|
@@ -2310,8 +2326,8 @@ function ar(e, t) {
|
|
|
2310
2326
|
xChannelSelector: "R",
|
|
2311
2327
|
yChannelSelector: "G"
|
|
2312
2328
|
});
|
|
2313
|
-
const p = w(o, "g", { filter:
|
|
2314
|
-
"clip-path":
|
|
2329
|
+
const p = w(o, "g", { filter: J(i.wobble) }), g = w(p, "g", {
|
|
2330
|
+
"clip-path": J(i.clip)
|
|
2315
2331
|
});
|
|
2316
2332
|
return w(g, "path", {
|
|
2317
2333
|
d: xi(),
|
|
@@ -2325,7 +2341,7 @@ function ar(e, t) {
|
|
|
2325
2341
|
}), w(p, "path", {
|
|
2326
2342
|
d: vt,
|
|
2327
2343
|
fill: "none",
|
|
2328
|
-
stroke:
|
|
2344
|
+
stroke: St,
|
|
2329
2345
|
"stroke-width": "18",
|
|
2330
2346
|
"stroke-linejoin": "round"
|
|
2331
2347
|
}), ro(
|
|
@@ -2350,7 +2366,7 @@ function ar(e, t) {
|
|
|
2350
2366
|
}
|
|
2351
2367
|
function Uo() {
|
|
2352
2368
|
return k("svg", {
|
|
2353
|
-
xmlns:
|
|
2369
|
+
xmlns: No,
|
|
2354
2370
|
viewBox: "0 0 1254 1254"
|
|
2355
2371
|
});
|
|
2356
2372
|
}
|
|
@@ -2361,14 +2377,14 @@ function ao(e, t, n, i, o, r, l, s, p) {
|
|
|
2361
2377
|
cy: i,
|
|
2362
2378
|
rx: "73",
|
|
2363
2379
|
ry: "80",
|
|
2364
|
-
fill:
|
|
2380
|
+
fill: J(p.eyeWhite)
|
|
2365
2381
|
}), w(g, "ellipse", {
|
|
2366
2382
|
cx: o,
|
|
2367
2383
|
cy: r,
|
|
2368
2384
|
rx: "49",
|
|
2369
2385
|
ry: "57",
|
|
2370
|
-
fill:
|
|
2371
|
-
filter:
|
|
2386
|
+
fill: J(p.pupil),
|
|
2387
|
+
filter: J(p.pupilGloss)
|
|
2372
2388
|
}), w(g, "circle", {
|
|
2373
2389
|
cx: l,
|
|
2374
2390
|
cy: s,
|
|
@@ -2384,14 +2400,14 @@ function ro(e, t, n, i, o, r, l, s) {
|
|
|
2384
2400
|
rx: "73",
|
|
2385
2401
|
ry: "80",
|
|
2386
2402
|
fill: "#ffffff",
|
|
2387
|
-
stroke:
|
|
2403
|
+
stroke: St,
|
|
2388
2404
|
"stroke-width": "13"
|
|
2389
2405
|
}), w(p, "ellipse", {
|
|
2390
2406
|
cx: o,
|
|
2391
2407
|
cy: r,
|
|
2392
2408
|
rx: "45",
|
|
2393
2409
|
ry: "53",
|
|
2394
|
-
fill:
|
|
2410
|
+
fill: St
|
|
2395
2411
|
}), w(p, "circle", {
|
|
2396
2412
|
cx: l,
|
|
2397
2413
|
cy: s,
|
|
@@ -2403,11 +2419,11 @@ function w(e, t, n = {}) {
|
|
|
2403
2419
|
const i = k(t, n);
|
|
2404
2420
|
return e.appendChild(i), i;
|
|
2405
2421
|
}
|
|
2406
|
-
function
|
|
2422
|
+
function F(e, t, n, i) {
|
|
2407
2423
|
const o = { offset: t, "stop-color": n };
|
|
2408
2424
|
i !== void 0 && (o["stop-opacity"] = i), w(e, "stop", o);
|
|
2409
2425
|
}
|
|
2410
|
-
function
|
|
2426
|
+
function J(e) {
|
|
2411
2427
|
return `url(#${e})`;
|
|
2412
2428
|
}
|
|
2413
2429
|
function Lt(e, t, n, i) {
|
|
@@ -2529,7 +2545,7 @@ function nn(e, t, n) {
|
|
|
2529
2545
|
), i;
|
|
2530
2546
|
}
|
|
2531
2547
|
function lr(e) {
|
|
2532
|
-
const t =
|
|
2548
|
+
const t = ue(
|
|
2533
2549
|
"0 0 24 24",
|
|
2534
2550
|
e,
|
|
2535
2551
|
e,
|
|
@@ -2540,7 +2556,7 @@ function lr(e) {
|
|
|
2540
2556
|
return t.appendChild(k("path", { d: "m6 9 6 6 6-6" })), t;
|
|
2541
2557
|
}
|
|
2542
2558
|
function sr() {
|
|
2543
|
-
const e =
|
|
2559
|
+
const e = ue(
|
|
2544
2560
|
"0 0 24 24",
|
|
2545
2561
|
17,
|
|
2546
2562
|
17,
|
|
@@ -2559,7 +2575,7 @@ function sr() {
|
|
|
2559
2575
|
), e;
|
|
2560
2576
|
}
|
|
2561
2577
|
function pr() {
|
|
2562
|
-
const e =
|
|
2578
|
+
const e = ue(
|
|
2563
2579
|
"0 0 24 24",
|
|
2564
2580
|
17,
|
|
2565
2581
|
17,
|
|
@@ -2570,7 +2586,7 @@ function pr() {
|
|
|
2570
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;
|
|
2571
2587
|
}
|
|
2572
2588
|
function dr() {
|
|
2573
|
-
const e =
|
|
2589
|
+
const e = ue(
|
|
2574
2590
|
"0 0 24 24",
|
|
2575
2591
|
15,
|
|
2576
2592
|
15,
|
|
@@ -2581,7 +2597,7 @@ function dr() {
|
|
|
2581
2597
|
return e.appendChild(k("path", { d: "M18 6 6 18" })), e.appendChild(k("path", { d: "m6 6 12 12" })), e;
|
|
2582
2598
|
}
|
|
2583
2599
|
function Wo() {
|
|
2584
|
-
const e =
|
|
2600
|
+
const e = ue(
|
|
2585
2601
|
"0 0 24 24",
|
|
2586
2602
|
14,
|
|
2587
2603
|
14,
|
|
@@ -2594,7 +2610,7 @@ function Wo() {
|
|
|
2594
2610
|
), e.appendChild(k("polyline", { points: "5 12 12 5 19 12" })), e;
|
|
2595
2611
|
}
|
|
2596
2612
|
function cr() {
|
|
2597
|
-
const e =
|
|
2613
|
+
const e = ue(
|
|
2598
2614
|
"0 0 24 24",
|
|
2599
2615
|
16,
|
|
2600
2616
|
16,
|
|
@@ -2612,7 +2628,7 @@ function cr() {
|
|
|
2612
2628
|
), e;
|
|
2613
2629
|
}
|
|
2614
2630
|
function ur() {
|
|
2615
|
-
const e =
|
|
2631
|
+
const e = ue("0 0 24 24", 19, 19, "none", "currentColor");
|
|
2616
2632
|
return e.setAttribute(
|
|
2617
2633
|
"class",
|
|
2618
2634
|
"pluno-pa-widget__paperclip-icon pluno-pa-widget__paperclip-icon--scribble"
|
|
@@ -2627,7 +2643,7 @@ function ur() {
|
|
|
2627
2643
|
), e;
|
|
2628
2644
|
}
|
|
2629
2645
|
function gr() {
|
|
2630
|
-
const e =
|
|
2646
|
+
const e = ue("0 0 24 24", 18, 18, "currentColor");
|
|
2631
2647
|
return e.appendChild(
|
|
2632
2648
|
k("rect", {
|
|
2633
2649
|
x: "6",
|
|
@@ -2639,7 +2655,7 @@ function gr() {
|
|
|
2639
2655
|
), e;
|
|
2640
2656
|
}
|
|
2641
2657
|
function hr() {
|
|
2642
|
-
const e =
|
|
2658
|
+
const e = ue(
|
|
2643
2659
|
"0 0 24 24",
|
|
2644
2660
|
12,
|
|
2645
2661
|
12,
|
|
@@ -2650,7 +2666,7 @@ function hr() {
|
|
|
2650
2666
|
return e.appendChild(k("path", { d: "M18 6 6 18" })), e.appendChild(k("path", { d: "m6 6 12 12" })), e;
|
|
2651
2667
|
}
|
|
2652
2668
|
function mr() {
|
|
2653
|
-
const e =
|
|
2669
|
+
const e = ue(
|
|
2654
2670
|
"0 0 24 24",
|
|
2655
2671
|
13,
|
|
2656
2672
|
13,
|
|
@@ -2673,7 +2689,7 @@ function mr() {
|
|
|
2673
2689
|
})
|
|
2674
2690
|
), e;
|
|
2675
2691
|
}
|
|
2676
|
-
function
|
|
2692
|
+
function ue(e, t, n, i, o, r) {
|
|
2677
2693
|
const l = {
|
|
2678
2694
|
viewBox: e,
|
|
2679
2695
|
width: String(t),
|
|
@@ -2684,7 +2700,7 @@ function ce(e, t, n, i, o, r) {
|
|
|
2684
2700
|
return o && (l.stroke = o, l["stroke-linecap"] = "round", l["stroke-linejoin"] = "round"), r && (l["stroke-width"] = r), k("svg", l);
|
|
2685
2701
|
}
|
|
2686
2702
|
function k(e, t = {}) {
|
|
2687
|
-
const n = document.createElementNS(
|
|
2703
|
+
const n = document.createElementNS(No, e);
|
|
2688
2704
|
for (const [i, o] of Object.entries(t))
|
|
2689
2705
|
n.setAttribute(i, o);
|
|
2690
2706
|
return n;
|
|
@@ -2710,13 +2726,13 @@ function wr(e) {
|
|
|
2710
2726
|
const t = xn(e), n = Ho(e);
|
|
2711
2727
|
if (t === "image" && n) {
|
|
2712
2728
|
const i = document.createElement("img");
|
|
2713
|
-
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;
|
|
2714
2730
|
}
|
|
2715
2731
|
if (t === "video" && n) {
|
|
2716
2732
|
const i = document.createElement("video");
|
|
2717
|
-
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;
|
|
2718
2734
|
}
|
|
2719
|
-
return
|
|
2735
|
+
return ce(e);
|
|
2720
2736
|
}
|
|
2721
2737
|
function br(e, t) {
|
|
2722
2738
|
const n = xn(e), i = Ho(e);
|
|
@@ -2727,7 +2743,7 @@ function br(e, t) {
|
|
|
2727
2743
|
o.addEventListener(
|
|
2728
2744
|
"error",
|
|
2729
2745
|
() => o.replaceWith(
|
|
2730
|
-
|
|
2746
|
+
ce(e, "message")
|
|
2731
2747
|
),
|
|
2732
2748
|
{ once: !0 }
|
|
2733
2749
|
), o.src = l ?? i;
|
|
@@ -2739,15 +2755,15 @@ function br(e, t) {
|
|
|
2739
2755
|
}
|
|
2740
2756
|
if (n === "pdf" && i) {
|
|
2741
2757
|
const o = document.createElement("object");
|
|
2742
|
-
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;
|
|
2743
2759
|
}
|
|
2744
2760
|
if (n === "video" && i) {
|
|
2745
2761
|
const o = document.createElement("video");
|
|
2746
|
-
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;
|
|
2747
2763
|
}
|
|
2748
|
-
return
|
|
2764
|
+
return ce(e, "message");
|
|
2749
2765
|
}
|
|
2750
|
-
function
|
|
2766
|
+
function ce(e, t = "composer") {
|
|
2751
2767
|
if (t === "composer") {
|
|
2752
2768
|
const r = document.createElement("span");
|
|
2753
2769
|
return r.className = "pluno-pa-widget__attachment-file", r.textContent = so(e), r;
|
|
@@ -2786,7 +2802,7 @@ function on(e, t, n = null) {
|
|
|
2786
2802
|
e && (e.hidden = !0, e.replaceChildren());
|
|
2787
2803
|
return;
|
|
2788
2804
|
}
|
|
2789
|
-
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(
|
|
2790
2806
|
yr(t, n)
|
|
2791
2807
|
) : Go(t) && e.appendChild(vr(t));
|
|
2792
2808
|
}
|
|
@@ -2810,7 +2826,7 @@ function vr(e) {
|
|
|
2810
2826
|
const n = document.createElement("strong");
|
|
2811
2827
|
n.textContent = "Credits running low", t.appendChild(n);
|
|
2812
2828
|
const i = document.createElement("span");
|
|
2813
|
-
return i.textContent =
|
|
2829
|
+
return i.textContent = Cr(e) ?? "Credits are running low for this period.", t.appendChild(i), t.appendChild(
|
|
2814
2830
|
$o(
|
|
2815
2831
|
e,
|
|
2816
2832
|
"Upgrade",
|
|
@@ -2819,24 +2835,24 @@ function vr(e) {
|
|
|
2819
2835
|
), t;
|
|
2820
2836
|
}
|
|
2821
2837
|
function mn(e, t) {
|
|
2822
|
-
return e !== null && (
|
|
2838
|
+
return e !== null && (re(e) || Go(e) || yn(t));
|
|
2823
2839
|
}
|
|
2824
2840
|
function po(e, t, n) {
|
|
2825
|
-
return mn(t, n) ||
|
|
2841
|
+
return mn(t, n) || Sr(t) ? !0 : !mn(e, n);
|
|
2826
2842
|
}
|
|
2827
|
-
function
|
|
2828
|
-
return e != null && (e.creditsUsed !== null || e.creditLimit !== null || e.creditsRemaining !== null ||
|
|
2843
|
+
function Sr(e) {
|
|
2844
|
+
return e != null && (e.creditsUsed !== null || e.creditLimit !== null || e.creditsRemaining !== null || re(e));
|
|
2829
2845
|
}
|
|
2830
|
-
function
|
|
2846
|
+
function re(e) {
|
|
2831
2847
|
return e?.limitExceeded === !0 || !!e?.paymentIssue;
|
|
2832
2848
|
}
|
|
2833
2849
|
function yn(e) {
|
|
2834
2850
|
return e === "limit_exceeded" || e === "subscription_required" || e === "subscription_inactive" || e === "payment_issue" || e === "subscription_invalid" || e === "payment_required";
|
|
2835
2851
|
}
|
|
2836
2852
|
function Go(e) {
|
|
2837
|
-
return !
|
|
2853
|
+
return !re(e) && e.creditLimit !== null && e.creditLimit > 0 && e.creditsRemaining !== null && e.creditsRemaining > 0 && e.creditsRemaining / e.creditLimit <= 0.2;
|
|
2838
2854
|
}
|
|
2839
|
-
function
|
|
2855
|
+
function Cr(e) {
|
|
2840
2856
|
return e.creditsRemaining === null ? null : `${Er(e.creditsRemaining)} credits left`;
|
|
2841
2857
|
}
|
|
2842
2858
|
function Er(e) {
|
|
@@ -2868,138 +2884,146 @@ function an(e, t) {
|
|
|
2868
2884
|
(i) => !qo(i)
|
|
2869
2885
|
).length === 0 && !e.assistantDraft && !e.lastError && !e.isThinking && !t;
|
|
2870
2886
|
}
|
|
2871
|
-
function kr(e, t, n, i, o, r, l, s, p, g, c, h, E, P, T,
|
|
2872
|
-
const 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(
|
|
2873
2889
|
(_) => !qo(_)
|
|
2874
|
-
),
|
|
2875
|
-
|
|
2890
|
+
), ge = e.scrollTop, Ee = [], Ve = /* @__PURE__ */ new Set(), D = (_) => {
|
|
2891
|
+
Ee.push(_);
|
|
2876
2892
|
};
|
|
2877
2893
|
Vo(n, r.isThinking), o.hidden = !s, s && l !== null && Oo(o, l);
|
|
2878
|
-
const
|
|
2879
|
-
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) {
|
|
2880
2896
|
const _ = document.createElement("div");
|
|
2881
2897
|
_.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter" + (u ? " pluno-pa-widget__empty-state--morning-report" : "");
|
|
2882
|
-
const
|
|
2883
|
-
|
|
2884
|
-
const
|
|
2898
|
+
const x = document.createElement("div");
|
|
2899
|
+
x.className = "pluno-pa-widget__empty-hero";
|
|
2900
|
+
const z = Ce(
|
|
2885
2901
|
"pluno-pa-widget__character--empty",
|
|
2886
2902
|
P()
|
|
2887
2903
|
);
|
|
2888
|
-
if (
|
|
2904
|
+
if (x.appendChild(z), _.appendChild(x), u) {
|
|
2889
2905
|
const v = document.createElement("h2");
|
|
2890
2906
|
v.className = "pluno-pa-widget__empty pluno-pa-widget__morning-report-title", v.textContent = u.opening, _.appendChild(v);
|
|
2891
2907
|
} else
|
|
2892
2908
|
_.appendChild(Mo());
|
|
2893
|
-
const
|
|
2894
|
-
if (
|
|
2895
|
-
for (const v of
|
|
2896
|
-
const
|
|
2897
|
-
|
|
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
|
+
const N = document.createElement("button");
|
|
2913
|
+
N.type = "button", N.className = "pluno-pa-widget__starter-prompt", N.textContent = `"${v}"`, N.addEventListener("click", () => {
|
|
2898
2914
|
T(v);
|
|
2899
|
-
}),
|
|
2915
|
+
}), te.appendChild(N);
|
|
2900
2916
|
}
|
|
2901
2917
|
else if (r.starterPromptsLoading) {
|
|
2902
2918
|
const v = document.createElement("button");
|
|
2903
|
-
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);
|
|
2904
2920
|
} else
|
|
2905
2921
|
for (let v = 0; v < pa; v += 1) {
|
|
2906
|
-
const
|
|
2907
|
-
|
|
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 = "", te.appendChild(N);
|
|
2908
2924
|
}
|
|
2909
|
-
if (_.appendChild(
|
|
2925
|
+
if (_.appendChild(te), u) {
|
|
2910
2926
|
const v = document.createElement("button");
|
|
2911
|
-
v.type = "button", v.className = "pluno-pa-widget__morning-report-snooze", v.textContent = "Snooze morning report", v.addEventListener("click",
|
|
2927
|
+
v.type = "button", v.className = "pluno-pa-widget__morning-report-snooze", v.textContent = "Snooze morning report", v.addEventListener("click", S), _.appendChild(v);
|
|
2912
2928
|
}
|
|
2913
|
-
h.clear(), D(_), D(t), uo(e,
|
|
2929
|
+
h.clear(), D(_), D(t), uo(e, Ee);
|
|
2914
2930
|
return;
|
|
2915
2931
|
}
|
|
2916
|
-
let f = null,
|
|
2917
|
-
const
|
|
2918
|
-
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)
|
|
2919
2935
|
return !1;
|
|
2920
2936
|
const _ = Br(
|
|
2921
|
-
|
|
2937
|
+
ke,
|
|
2922
2938
|
c,
|
|
2923
2939
|
E,
|
|
2924
2940
|
P()
|
|
2925
2941
|
);
|
|
2926
|
-
return D(_), f = null,
|
|
2942
|
+
return D(_), f = null, U = _, ke = [], !0;
|
|
2927
2943
|
};
|
|
2928
|
-
for (let _ = 0; _ <
|
|
2929
|
-
const
|
|
2930
|
-
if (
|
|
2931
|
-
|
|
2944
|
+
for (let _ = 0; _ < B.length; _ += 1) {
|
|
2945
|
+
const x = B[_];
|
|
2946
|
+
if (x.role === "tool") {
|
|
2947
|
+
ke.push(x);
|
|
2932
2948
|
continue;
|
|
2933
2949
|
}
|
|
2934
|
-
if (fn(
|
|
2935
|
-
if (_ !==
|
|
2950
|
+
if (fn(x)) {
|
|
2951
|
+
if (_ !== le)
|
|
2936
2952
|
continue;
|
|
2937
|
-
if (
|
|
2938
|
-
const
|
|
2939
|
-
D(
|
|
2953
|
+
if (G()) {
|
|
2954
|
+
const N = Et();
|
|
2955
|
+
D(N), f = null, U = N;
|
|
2940
2956
|
} else {
|
|
2941
|
-
const
|
|
2942
|
-
D(
|
|
2957
|
+
const N = fo(P());
|
|
2958
|
+
D(N), f = null, U = N;
|
|
2943
2959
|
}
|
|
2944
2960
|
continue;
|
|
2945
2961
|
}
|
|
2946
|
-
if (
|
|
2947
|
-
if (
|
|
2948
|
-
|
|
2949
|
-
const v = document.createElement("div"),
|
|
2950
|
-
v.className =
|
|
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;
|
|
2951
2971
|
}
|
|
2952
2972
|
continue;
|
|
2953
2973
|
}
|
|
2954
|
-
const
|
|
2955
|
-
if (
|
|
2974
|
+
const z = G(), Y = mo(x.content);
|
|
2975
|
+
if (x.role === "assistant" && !z) {
|
|
2956
2976
|
const v = jo(P());
|
|
2957
|
-
D(v), f = null,
|
|
2977
|
+
D(v), f = null, U = v;
|
|
2958
2978
|
}
|
|
2959
|
-
const
|
|
2960
|
-
|
|
2961
|
-
|
|
2979
|
+
const te = Lr(
|
|
2980
|
+
x,
|
|
2981
|
+
Y,
|
|
2962
2982
|
h,
|
|
2963
2983
|
Ve,
|
|
2964
|
-
|
|
2984
|
+
I
|
|
2965
2985
|
);
|
|
2966
|
-
D(
|
|
2986
|
+
D(te), f = te, U = null;
|
|
2967
2987
|
}
|
|
2968
|
-
const st =
|
|
2969
|
-
if (r.isThinking && !
|
|
2988
|
+
const st = G(), ze = B[B.length - 1]?.id === "assistant-draft";
|
|
2989
|
+
if (r.isThinking && !ze && !Ke)
|
|
2970
2990
|
if (st) {
|
|
2971
2991
|
const _ = Et();
|
|
2972
|
-
D(_), f = null,
|
|
2992
|
+
D(_), f = null, U = _;
|
|
2973
2993
|
} else {
|
|
2974
2994
|
const _ = fo(P());
|
|
2975
|
-
D(_), f = null,
|
|
2995
|
+
D(_), f = null, U = _;
|
|
2976
2996
|
}
|
|
2977
2997
|
if (r.lastError) {
|
|
2978
2998
|
const _ = document.createElement("div");
|
|
2979
2999
|
_.className = "pluno-pa-widget__error";
|
|
2980
|
-
const
|
|
2981
|
-
if (
|
|
2982
|
-
const
|
|
2983
|
-
|
|
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(
|
|
2984
3008
|
"click",
|
|
2985
|
-
r.lastErrorCode === "connection_failed" ? m :
|
|
2986
|
-
), _.appendChild(
|
|
3009
|
+
r.lastErrorCode === "connection_failed" ? m : O
|
|
3010
|
+
), _.appendChild(z);
|
|
2987
3011
|
}
|
|
2988
|
-
D(_), f = _,
|
|
3012
|
+
D(_), f = _, U = null;
|
|
2989
3013
|
}
|
|
2990
|
-
const
|
|
2991
|
-
if (L &&
|
|
2992
|
-
const _ = Rr(
|
|
2993
|
-
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,
|
|
2994
3018
|
error: L.error,
|
|
2995
3019
|
characterIconOptions: L.characterIconOptions,
|
|
2996
3020
|
onDraft: L.onDraft,
|
|
2997
3021
|
onDismiss: L.onDismiss,
|
|
2998
3022
|
onDisable: L.onDisable
|
|
2999
3023
|
});
|
|
3000
|
-
D(_), L.onSeen(
|
|
3024
|
+
D(_), L.onSeen(se), f = null, U = _;
|
|
3001
3025
|
}
|
|
3002
|
-
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;
|
|
3003
3027
|
}
|
|
3004
3028
|
function Lr(e, t, n, i, o) {
|
|
3005
3029
|
const r = Pr(e, t), l = r ? n.get(r) : void 0;
|
|
@@ -3007,13 +3031,13 @@ function Lr(e, t, n, i, o) {
|
|
|
3007
3031
|
return l.classList.remove("pluno-pa-widget__message--bottom-reserve"), i.add(r), l;
|
|
3008
3032
|
const s = document.createElement("div");
|
|
3009
3033
|
s.className = `pluno-pa-widget__message pluno-pa-widget__message--${e.role}`, e.role === "assistant" ? Wr(s, t) : s.textContent = t, e.role === "user" && e.attachments?.length && s.appendChild(
|
|
3010
|
-
|
|
3034
|
+
Ar(
|
|
3011
3035
|
e.attachments,
|
|
3012
3036
|
o
|
|
3013
3037
|
)
|
|
3014
3038
|
);
|
|
3015
3039
|
const p = document.createElement("div");
|
|
3016
|
-
return p.className = "pluno-pa-widget__message-actions", p.appendChild(
|
|
3040
|
+
return p.className = "pluno-pa-widget__message-actions", p.appendChild(Ir(t)), s.appendChild(p), r && (n.set(r, s), i.add(r)), s;
|
|
3017
3041
|
}
|
|
3018
3042
|
function Pr(e, t) {
|
|
3019
3043
|
return e.role !== "user" || !e.attachments?.length ? null : JSON.stringify({
|
|
@@ -3051,7 +3075,7 @@ function uo(e, t) {
|
|
|
3051
3075
|
n = n.nextSibling, e.removeChild(i);
|
|
3052
3076
|
}
|
|
3053
3077
|
}
|
|
3054
|
-
function
|
|
3078
|
+
function Nr(e) {
|
|
3055
3079
|
if (!e.assistantDraft)
|
|
3056
3080
|
return [...e.messages];
|
|
3057
3081
|
const t = {
|
|
@@ -3113,7 +3137,7 @@ function ho(e, t, n, i, o, r, l, s) {
|
|
|
3113
3137
|
}
|
|
3114
3138
|
e.appendChild(p);
|
|
3115
3139
|
}
|
|
3116
|
-
function
|
|
3140
|
+
function Ar(e, t) {
|
|
3117
3141
|
const n = document.createElement("div");
|
|
3118
3142
|
n.className = "pluno-pa-widget__message-attachments";
|
|
3119
3143
|
for (const i of e)
|
|
@@ -3125,7 +3149,7 @@ function Ir(e, t) {
|
|
|
3125
3149
|
);
|
|
3126
3150
|
return n;
|
|
3127
3151
|
}
|
|
3128
|
-
function
|
|
3152
|
+
function Ir(e) {
|
|
3129
3153
|
const t = document.createElement("button");
|
|
3130
3154
|
return t.type = "button", t.className = "pluno-pa-widget__message-copy", t.setAttribute("aria-label", "Copy message"), t.title = "Copy message", t.appendChild(mr()), t.addEventListener("click", (n) => {
|
|
3131
3155
|
n.preventDefault(), n.stopPropagation(), navigator.clipboard.writeText(e);
|
|
@@ -3204,8 +3228,8 @@ function Dr(e, t) {
|
|
|
3204
3228
|
if (g.appendChild(h), p.appendChild(g), e.screenshotDataUrl) {
|
|
3205
3229
|
const u = document.createElement("div");
|
|
3206
3230
|
u.className = "pluno-pa-widget__share-dialog-screenshot";
|
|
3207
|
-
const
|
|
3208
|
-
|
|
3231
|
+
const S = document.createElement("img");
|
|
3232
|
+
S.src = e.screenshotDataUrl, S.alt = "Product page with Pluno open", u.appendChild(S), p.appendChild(u);
|
|
3209
3233
|
}
|
|
3210
3234
|
i.appendChild(p), i.appendChild(s);
|
|
3211
3235
|
const E = document.createElement("div");
|
|
@@ -3214,17 +3238,17 @@ function Dr(e, t) {
|
|
|
3214
3238
|
P.className = "pluno-pa-widget__share-dialog-step-title", P.textContent = "2) Share on", E.appendChild(P);
|
|
3215
3239
|
const T = document.createElement("p");
|
|
3216
3240
|
T.className = "pluno-pa-widget__share-dialog-hint", T.textContent = "Post draft opens prefilled on supported platforms.", E.appendChild(T);
|
|
3217
|
-
const
|
|
3218
|
-
|
|
3241
|
+
const O = document.createElement("footer");
|
|
3242
|
+
O.className = "pluno-pa-widget__share-dialog-platforms";
|
|
3219
3243
|
for (const u of Mr(e)) {
|
|
3220
|
-
const
|
|
3221
|
-
|
|
3244
|
+
const S = document.createElement("a");
|
|
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);
|
|
3222
3246
|
}
|
|
3223
|
-
if (E.appendChild(
|
|
3247
|
+
if (E.appendChild(O), i.appendChild(E), t.socialPostRewardsUrl) {
|
|
3224
3248
|
const u = document.createElement("div");
|
|
3225
3249
|
u.className = "pluno-pa-widget__share-dialog-step";
|
|
3226
|
-
const
|
|
3227
|
-
|
|
3250
|
+
const S = document.createElement("strong");
|
|
3251
|
+
S.className = "pluno-pa-widget__share-dialog-step-title", S.textContent = "3) Submit post to get 2000 free credits!", u.appendChild(S);
|
|
3228
3252
|
const m = document.createElement("a");
|
|
3229
3253
|
m.className = "pluno-pa-widget__share-dialog-reward-link", m.href = t.socialPostRewardsUrl, m.target = "_blank", m.rel = "noopener noreferrer", m.appendChild(document.createTextNode("Submit post URL")), m.appendChild(Ur()), u.appendChild(m), i.appendChild(u);
|
|
3230
3254
|
}
|
|
@@ -3258,40 +3282,40 @@ function Mr(e) {
|
|
|
3258
3282
|
}
|
|
3259
3283
|
function Or(e) {
|
|
3260
3284
|
const t = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
3261
|
-
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(
|
|
3262
3286
|
t,
|
|
3263
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"
|
|
3264
|
-
),
|
|
3288
|
+
), j(t, "M14.4 13.3c.1 3.8.1 7.8 0 11.9"), j(
|
|
3265
3289
|
t,
|
|
3266
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"
|
|
3267
|
-
),
|
|
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(
|
|
3268
3292
|
t,
|
|
3269
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"
|
|
3270
|
-
),
|
|
3294
|
+
), j(
|
|
3271
3295
|
t,
|
|
3272
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",
|
|
3273
3297
|
"0.48"
|
|
3274
|
-
),
|
|
3298
|
+
), j(
|
|
3275
3299
|
t,
|
|
3276
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"
|
|
3277
|
-
),
|
|
3301
|
+
), j(
|
|
3278
3302
|
t,
|
|
3279
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"
|
|
3280
3304
|
), t);
|
|
3281
3305
|
}
|
|
3282
|
-
function
|
|
3306
|
+
function j(e, t, n) {
|
|
3283
3307
|
const i = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
3284
3308
|
i.setAttribute("d", t), n && i.setAttribute("opacity", n), e.appendChild(i);
|
|
3285
3309
|
}
|
|
3286
3310
|
function Ur() {
|
|
3287
3311
|
const e = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
3288
|
-
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(
|
|
3289
3313
|
e,
|
|
3290
3314
|
"M18 13v5a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1h5"
|
|
3291
3315
|
), e;
|
|
3292
3316
|
}
|
|
3293
3317
|
function qo(e) {
|
|
3294
|
-
return e.role === "tool" && e.toolName ===
|
|
3318
|
+
return e.role === "tool" && e.toolName === Co;
|
|
3295
3319
|
}
|
|
3296
3320
|
function mo(e) {
|
|
3297
3321
|
return e.replace(/\uE200[^\uE201]*(?:\uE201|$)/g, "");
|
|
@@ -3512,7 +3536,7 @@ function wo(e, t) {
|
|
|
3512
3536
|
--pluno-pa-accent-contrast: #fafafa;
|
|
3513
3537
|
position: fixed;
|
|
3514
3538
|
z-index: 2147483645;
|
|
3515
|
-
font-family: ${
|
|
3539
|
+
font-family: ${de.fontFamily};
|
|
3516
3540
|
font-size: 14px;
|
|
3517
3541
|
color: var(--pluno-pa-text);
|
|
3518
3542
|
width: var(--pluno-pa-launcher-width);
|
|
@@ -4618,7 +4642,7 @@ function wo(e, t) {
|
|
|
4618
4642
|
place-items: center;
|
|
4619
4643
|
padding: 18px;
|
|
4620
4644
|
background: rgba(24, 24, 27, 0.28);
|
|
4621
|
-
font-family: var(--pluno-pa-font, ${
|
|
4645
|
+
font-family: var(--pluno-pa-font, ${de.fontFamily});
|
|
4622
4646
|
color: var(--pluno-pa-text);
|
|
4623
4647
|
}
|
|
4624
4648
|
.pluno-pa-widget__share-dialog {
|
|
@@ -6023,20 +6047,20 @@ function nl(e, t) {
|
|
|
6023
6047
|
const n = new URL(e.src, document.baseURI);
|
|
6024
6048
|
return n.href === t.href || n.pathname === t.pathname ? !0 : yo(n) === yo(t);
|
|
6025
6049
|
}
|
|
6026
|
-
class
|
|
6050
|
+
class _e extends EventTarget {
|
|
6027
6051
|
constructor(t, n) {
|
|
6028
6052
|
super(), this.channelId = n, this.url = t, this.addPreviewListener(ea, () => {
|
|
6029
|
-
this.readyState =
|
|
6053
|
+
this.readyState = _e.OPEN, this.dispatchEvent(new Event("open"));
|
|
6030
6054
|
}), this.addPreviewListener(ta, (i) => {
|
|
6031
6055
|
const o = i;
|
|
6032
6056
|
this.dispatchEvent(
|
|
6033
6057
|
new MessageEvent("message", { data: o.detail?.data ?? "" })
|
|
6034
6058
|
);
|
|
6035
6059
|
}), this.addPreviewListener(na, () => {
|
|
6036
|
-
this.readyState =
|
|
6060
|
+
this.readyState = _e.CLOSED, this.dispatchEvent(new Event("error")), this.cleanup();
|
|
6037
6061
|
}), this.addPreviewListener(oa, (i) => {
|
|
6038
6062
|
const o = i;
|
|
6039
|
-
this.readyState =
|
|
6063
|
+
this.readyState = _e.CLOSED, this.dispatchEvent(
|
|
6040
6064
|
new CloseEvent("close", {
|
|
6041
6065
|
code: o.detail?.code ?? 1e3,
|
|
6042
6066
|
reason: o.detail?.reason ?? "",
|
|
@@ -6065,11 +6089,11 @@ class be extends EventTarget {
|
|
|
6065
6089
|
extensions = "";
|
|
6066
6090
|
binaryType = "blob";
|
|
6067
6091
|
bufferedAmount = 0;
|
|
6068
|
-
readyState =
|
|
6092
|
+
readyState = _e.CONNECTING;
|
|
6069
6093
|
socketId = ol();
|
|
6070
6094
|
listeners = /* @__PURE__ */ new Map();
|
|
6071
6095
|
send(t) {
|
|
6072
|
-
if (this.readyState !==
|
|
6096
|
+
if (this.readyState !== _e.OPEN)
|
|
6073
6097
|
throw new DOMException(
|
|
6074
6098
|
"Pluno preview websocket is not open",
|
|
6075
6099
|
"InvalidStateError"
|
|
@@ -6087,7 +6111,7 @@ class be extends EventTarget {
|
|
|
6087
6111
|
);
|
|
6088
6112
|
}
|
|
6089
6113
|
close(t, n) {
|
|
6090
|
-
this.readyState !==
|
|
6114
|
+
this.readyState !== _e.CLOSED && (this.readyState = _e.CLOSING, window.dispatchEvent(
|
|
6091
6115
|
new CustomEvent(
|
|
6092
6116
|
xt(Qi, this.channelId),
|
|
6093
6117
|
{
|
|
@@ -6141,16 +6165,16 @@ function al(e) {
|
|
|
6141
6165
|
}));
|
|
6142
6166
|
}
|
|
6143
6167
|
function Zo(e) {
|
|
6144
|
-
const t = window, n = t[
|
|
6168
|
+
const t = window, n = t[be];
|
|
6145
6169
|
if (n) {
|
|
6146
6170
|
if (n.host === null)
|
|
6147
6171
|
return n.mountPromise.catch(() => {
|
|
6148
|
-
const p = t[
|
|
6172
|
+
const p = t[be];
|
|
6149
6173
|
return p ? p.mountPromise : Zo(e);
|
|
6150
6174
|
});
|
|
6151
6175
|
if (rl(n.host))
|
|
6152
6176
|
return n.retryPendingTokenFailureOnce?.(), n.mountPromise;
|
|
6153
|
-
n.destroy?.(), delete t[
|
|
6177
|
+
n.destroy?.(), delete t[be];
|
|
6154
6178
|
}
|
|
6155
6179
|
const i = e.dataset.plunoPreviewChannel, o = e.dataset.plunoTokenEndpoint, r = !e.dataset.plunoToken && !i && o ? el(o) : null;
|
|
6156
6180
|
let l;
|
|
@@ -6167,23 +6191,23 @@ function Zo(e) {
|
|
|
6167
6191
|
scribbleStyle: e.dataset.plunoScribbleStyle === void 0 ? void 0 : e.dataset.plunoScribbleStyle !== "false",
|
|
6168
6192
|
position: e.dataset.plunoPosition === "bottom-left" ? "bottom-left" : "bottom-right"
|
|
6169
6193
|
}).then((p) => {
|
|
6170
|
-
if (t[
|
|
6194
|
+
if (t[be] !== l) {
|
|
6171
6195
|
p.destroy();
|
|
6172
6196
|
return;
|
|
6173
6197
|
}
|
|
6174
6198
|
const g = p.host;
|
|
6175
6199
|
g.setAttribute(ko, "true"), l.host = g, l.destroy = () => {
|
|
6176
|
-
t[
|
|
6200
|
+
t[be] === l && delete t[be], l.host = null, l.destroy = null, p.destroy();
|
|
6177
6201
|
};
|
|
6178
6202
|
}).catch((p) => {
|
|
6179
|
-
throw t[
|
|
6203
|
+
throw t[be] === l && delete t[be], p;
|
|
6180
6204
|
});
|
|
6181
6205
|
return l = {
|
|
6182
6206
|
mountPromise: s,
|
|
6183
6207
|
host: null,
|
|
6184
6208
|
destroy: null,
|
|
6185
6209
|
retryPendingTokenFailureOnce: r?.retryPendingFailureOnce ?? null
|
|
6186
|
-
}, t[
|
|
6210
|
+
}, t[be] = l, s;
|
|
6187
6211
|
}
|
|
6188
6212
|
function rl(e) {
|
|
6189
6213
|
return e.isConnected && e.getAttribute(ko) === "true" && !!e.shadowRoot?.querySelector(".pluno-pa-widget__launcher") && !!e.shadowRoot?.querySelector(".pluno-pa-widget__panel");
|