@pluno/product-agent-web 0.1.71 → 0.1.74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +3 -2
- package/dist/product-agent-sdk.js +674 -557
- package/dist/product-agent-widget.js +1193 -1125
- package/dist/widget.d.ts +9 -0
- package/package.json +1 -1
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { PlunoProductAgent as Jo, getProductAgentOriginAccessErrorMessage as Qo } from "./product-agent-sdk.js";
|
|
2
|
-
const ei = "#7c3aed",
|
|
3
|
-
function
|
|
4
|
-
const t =
|
|
5
|
-
if (
|
|
2
|
+
const ei = "#7c3aed", ut = "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", gt = "#2c2a1e", Cn = [253, 250, 241], Sn = 3.5;
|
|
3
|
+
function no(e) {
|
|
4
|
+
const t = oo(e);
|
|
5
|
+
if (En(Ze(t), Cn) >= Sn)
|
|
6
6
|
return t;
|
|
7
|
-
let o =
|
|
8
|
-
const i =
|
|
9
|
-
for (let
|
|
10
|
-
if (o = oi(o, i, 0.22),
|
|
11
|
-
return
|
|
12
|
-
return
|
|
7
|
+
let o = Ze(t);
|
|
8
|
+
const i = Ze(gt);
|
|
9
|
+
for (let r = 0; r < 6; r += 1)
|
|
10
|
+
if (o = oi(o, i, 0.22), En(o, Cn) >= Sn)
|
|
11
|
+
return jt(o);
|
|
12
|
+
return jt(o);
|
|
13
13
|
}
|
|
14
14
|
function ti() {
|
|
15
15
|
let n = "M 280 120", o = !1, i = 0;
|
|
16
|
-
for (let
|
|
16
|
+
for (let r = 150; r <= 1170; r += 62) {
|
|
17
17
|
const l = (i % 3 - 1) * 18, p = o ? 280 - l : 1020 + l;
|
|
18
|
-
n += ` L ${p} ${
|
|
18
|
+
n += ` L ${p} ${r}`, o = !o, i += 1;
|
|
19
19
|
}
|
|
20
20
|
return n;
|
|
21
21
|
}
|
|
22
22
|
function ni(e) {
|
|
23
|
-
const t =
|
|
23
|
+
const t = oo(e), n = Vt(Ze(t));
|
|
24
24
|
return n > 0.86 ? {
|
|
25
25
|
top: "#ffffff",
|
|
26
26
|
middle: "#f6f6f6",
|
|
@@ -44,90 +44,90 @@ function ni(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: oe(t, 0.28, -0.03),
|
|
48
|
+
middle: oe(t, 0.08, 0.04),
|
|
49
|
+
bottom: oe(t, -0.1, 0.02),
|
|
50
|
+
edgeStart: oe(t, 0.08, 0.08),
|
|
51
|
+
edgeMiddle: oe(t, -0.08, 0.08),
|
|
52
|
+
edgeEnd: oe(t, -0.18, 0.05),
|
|
53
|
+
glow: oe(t, 0.32, -0.12),
|
|
54
|
+
highlight: oe(t, 0.38, -0.18),
|
|
55
|
+
inner: oe(t, 0.24, -0.1),
|
|
56
|
+
shadow: oe(t, -0.25, -0.08)
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function oo(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()}` : ei;
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function Ze(e) {
|
|
64
64
|
return [
|
|
65
65
|
Number.parseInt(e.slice(1, 3), 16),
|
|
66
66
|
Number.parseInt(e.slice(3, 5), 16),
|
|
67
67
|
Number.parseInt(e.slice(5, 7), 16)
|
|
68
68
|
];
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function jt([e, t, n]) {
|
|
71
71
|
const o = (i) => Math.max(0, Math.min(255, Math.round(i))).toString(16).padStart(2, "0");
|
|
72
72
|
return `#${o(e)}${o(t)}${o(n)}`;
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function Vt([e, t, n]) {
|
|
75
75
|
const o = (i) => {
|
|
76
|
-
const
|
|
77
|
-
return
|
|
76
|
+
const r = i / 255;
|
|
77
|
+
return r <= 0.04045 ? r / 12.92 : ((r + 0.055) / 1.055) ** 2.4;
|
|
78
78
|
};
|
|
79
79
|
return 0.2126 * o(e) + 0.7152 * o(t) + 0.0722 * o(n);
|
|
80
80
|
}
|
|
81
|
-
function
|
|
82
|
-
const n =
|
|
83
|
-
return (i + 0.05) / (
|
|
81
|
+
function En(e, t) {
|
|
82
|
+
const n = Vt(e), o = Vt(t), [i, r] = n > o ? [n, o] : [o, n];
|
|
83
|
+
return (i + 0.05) / (r + 0.05);
|
|
84
84
|
}
|
|
85
85
|
function oi(e, t, n) {
|
|
86
|
-
const o =
|
|
86
|
+
const o = Kt(n);
|
|
87
87
|
return [
|
|
88
88
|
e[0] + (t[0] - e[0]) * o,
|
|
89
89
|
e[1] + (t[1] - e[1]) * o,
|
|
90
90
|
e[2] + (t[2] - e[2]) * o
|
|
91
91
|
];
|
|
92
92
|
}
|
|
93
|
-
function
|
|
94
|
-
const [o, i,
|
|
95
|
-
return
|
|
93
|
+
function oe(e, t, n) {
|
|
94
|
+
const [o, i, r] = ii(Ze(e));
|
|
95
|
+
return jt(ai(o, Kt(i + n), Kt(r + t)));
|
|
96
96
|
}
|
|
97
97
|
function ii([e, t, n]) {
|
|
98
|
-
const o = e / 255, i = t / 255,
|
|
98
|
+
const o = e / 255, i = t / 255, r = n / 255, l = Math.max(o, i, r), p = Math.min(o, i, r), d = (l + p) / 2;
|
|
99
99
|
if (l === p)
|
|
100
100
|
return [0, 0, d];
|
|
101
101
|
const c = l - p, u = d > 0.5 ? c / (2 - l - p) : c / (l + p);
|
|
102
|
-
return [(l === o ? (i -
|
|
102
|
+
return [(l === o ? (i - r) / c + (i < r ? 6 : 0) : l === i ? (r - o) / c + 2 : (o - i) / c + 4) / 6, u, d];
|
|
103
103
|
}
|
|
104
104
|
function ai(e, t, n) {
|
|
105
105
|
if (t === 0)
|
|
106
106
|
return [n * 255, n * 255, n * 255];
|
|
107
107
|
const o = n < 0.5 ? n * (1 + t) : n + t - n * t, i = 2 * n - o;
|
|
108
108
|
return [
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
109
|
+
zt(i, o, e + 1 / 3) * 255,
|
|
110
|
+
zt(i, o, e) * 255,
|
|
111
|
+
zt(i, o, e - 1 / 3) * 255
|
|
112
112
|
];
|
|
113
113
|
}
|
|
114
|
-
function
|
|
114
|
+
function zt(e, t, n) {
|
|
115
115
|
let o = n;
|
|
116
116
|
return o < 0 && (o += 1), o > 1 && (o -= 1), o < 1 / 6 ? e + (t - e) * 6 * o : o < 1 / 2 ? t : o < 2 / 3 ? e + (t - e) * (2 / 3 - o) * 6 : e;
|
|
117
117
|
}
|
|
118
|
-
function
|
|
118
|
+
function Kt(e) {
|
|
119
119
|
return Math.max(0, Math.min(1, e));
|
|
120
120
|
}
|
|
121
|
-
const
|
|
121
|
+
const io = "suggest_share_on_socials";
|
|
122
122
|
function ri(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 !== io)
|
|
126
126
|
continue;
|
|
127
|
-
const o =
|
|
127
|
+
const o = kn(e, t, "assistant");
|
|
128
128
|
if (!o)
|
|
129
129
|
return null;
|
|
130
|
-
const i =
|
|
130
|
+
const i = kn(e, o.index, "user");
|
|
131
131
|
return i ? {
|
|
132
132
|
id: `share:${n.callId ?? n.id}`,
|
|
133
133
|
userPrompt: i.content,
|
|
@@ -142,7 +142,7 @@ async function li(e) {
|
|
|
142
142
|
throw new Error("Image copy is not supported in this browser. Download the screenshot instead.");
|
|
143
143
|
await navigator.clipboard.write([new ClipboardItem({ [t.type || "image/png"]: t })]);
|
|
144
144
|
}
|
|
145
|
-
function
|
|
145
|
+
function kn(e, t, n) {
|
|
146
146
|
for (let o = t - 1; o >= 0; o -= 1) {
|
|
147
147
|
const i = e[o];
|
|
148
148
|
if (i.role === n && i.content.trim())
|
|
@@ -155,9 +155,9 @@ async function pi(e) {
|
|
|
155
155
|
}
|
|
156
156
|
const si = "https://app.pluno.ai", di = "/api/product-agent/embed/active-users", ci = 1800, ui = 15e3, gi = 250, hi = 1e3, mi = 3e4;
|
|
157
157
|
function fi(e, t = {}) {
|
|
158
|
-
let n = !1, o = null, i = null,
|
|
158
|
+
let n = !1, o = null, i = null, r = null;
|
|
159
159
|
const l = () => {
|
|
160
|
-
|
|
160
|
+
r !== null && (window.clearInterval(r), r = null);
|
|
161
161
|
}, p = (u) => {
|
|
162
162
|
n || (i !== null && window.clearTimeout(i), i = window.setTimeout(() => {
|
|
163
163
|
c();
|
|
@@ -167,13 +167,13 @@ function fi(e, t = {}) {
|
|
|
167
167
|
o = u, e(u);
|
|
168
168
|
return;
|
|
169
169
|
}
|
|
170
|
-
const m = o,
|
|
171
|
-
|
|
170
|
+
const m = o, k = performance.now();
|
|
171
|
+
r = window.setInterval(() => {
|
|
172
172
|
if (n) {
|
|
173
173
|
l();
|
|
174
174
|
return;
|
|
175
175
|
}
|
|
176
|
-
const v = Math.min(1, (performance.now() -
|
|
176
|
+
const v = Math.min(1, (performance.now() - k) / ci);
|
|
177
177
|
o = Math.round(m + (u - m) * xi(v)), e(o), v >= 1 && (o = u, e(u), l());
|
|
178
178
|
}, gi);
|
|
179
179
|
}, c = async () => {
|
|
@@ -199,12 +199,12 @@ async function wi(e) {
|
|
|
199
199
|
});
|
|
200
200
|
if (!n.ok)
|
|
201
201
|
throw new Error("Failed to load active users");
|
|
202
|
-
const o = await n.json(), i =
|
|
203
|
-
if (i === null ||
|
|
202
|
+
const o = await n.json(), i = Ln(o.count), r = Ln(o.refreshAfterMs ?? o.refresh_after_ms);
|
|
203
|
+
if (i === null || r === null)
|
|
204
204
|
throw new Error("Invalid active users response");
|
|
205
|
-
return { count: i, refreshAfterMs:
|
|
205
|
+
return { count: i, refreshAfterMs: r };
|
|
206
206
|
}
|
|
207
|
-
function
|
|
207
|
+
function Ln(e) {
|
|
208
208
|
return typeof e != "number" || !Number.isFinite(e) || e < 0 ? null : Math.round(e);
|
|
209
209
|
}
|
|
210
210
|
function bi(e) {
|
|
@@ -216,7 +216,7 @@ function _i(e) {
|
|
|
216
216
|
function xi(e) {
|
|
217
217
|
return e < 0.5 ? 4 * e * e * e : 1 - Math.pow(-2 * e + 2, 3) / 2;
|
|
218
218
|
}
|
|
219
|
-
const
|
|
219
|
+
const ao = 100, yi = 1e4, vi = 5e3, Ci = "product-agent:sdk-preview-socket-connect", Si = "product-agent:sdk-preview-socket-send", Ei = "product-agent:sdk-preview-socket-close", ki = "product-agent:sdk-preview-socket-open", Li = "product-agent:sdk-preview-socket-message", Ii = "product-agent:sdk-preview-socket-error", Pi = "product-agent:sdk-preview-socket-closed", In = "product-agent:sdk-preview-socket-id", Ti = "data-pluno-sdk-preview-channel", ro = "data-pluno-auto-mounted", ce = "__plunoProductAgentAutoMountOwner", Ai = 1e4, Ni = "Failed to load Pluno widget token", Pn = "Timed out loading Pluno widget token", Ri = "pluno.productAgent.widgetClientId.", Mt = /* @__PURE__ */ new Set(), Di = "product-agent:preview-diagnostic", lo = "pluno.productAgent.sharePromptsDisabled", zi = 3, Tn = 'dialog[open], [aria-modal="true"], [role="dialog"]', Mi = 400, Oi = 5e3, Ui = 500, An = "Close the page's popup to chat", Bi = "No recent chats for this page yet.", ie = {
|
|
220
220
|
launcherLabel: "Ask for anything...",
|
|
221
221
|
accentColor: "#7c3aed",
|
|
222
222
|
colorScheme: "light",
|
|
@@ -224,7 +224,7 @@ const oo = 100, yi = 1e4, vi = 5e3, Ci = "product-agent:sdk-preview-socket-conne
|
|
|
224
224
|
scribbleStyle: !0,
|
|
225
225
|
position: "bottom-right",
|
|
226
226
|
movableLauncher: !1
|
|
227
|
-
}, Fi = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive',
|
|
227
|
+
}, Fi = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive', Nn = "pluno-pa-scribble-font", po = 190, so = 41, Rn = 22, Hi = 16, Wi = 24, Gi = 1, $i = 48, an = 420, qi = 520, ji = 0.24, rn = 680, Vi = 800, Ki = 0.76, T = 8, Le = 50, co = "http://www.w3.org/2000/svg", Yt = 26, Xt = 8, Yi = 36, Zt = 16, Xi = 4, Dn = [
|
|
228
228
|
{
|
|
229
229
|
ellipseCx: "17.5",
|
|
230
230
|
ellipseCy: "24.5",
|
|
@@ -261,20 +261,20 @@ const oo = 100, yi = 1e4, vi = 5e3, Ci = "product-agent:sdk-preview-socket-conne
|
|
|
261
261
|
path: "M18.7 26.8 C21 11.2, 7.1 1.6, 6.3 18.1",
|
|
262
262
|
pathStrokeWidth: "2.45"
|
|
263
263
|
}
|
|
264
|
-
], Zi = 11, Ji = 13,
|
|
265
|
-
let
|
|
264
|
+
], Zi = 11, Ji = 13, Jt = 4, uo = 10, go = 40, Qi = "movable-launcher-position-v2", ho = "pluno-pa-widget-styles", mo = "data-pluno-pa-widget-styles";
|
|
265
|
+
let zn = 0;
|
|
266
266
|
function ea(e) {
|
|
267
|
-
return (t) => new
|
|
267
|
+
return (t) => new ue(t, e);
|
|
268
268
|
}
|
|
269
269
|
async function ta(e = {}) {
|
|
270
270
|
const t = {
|
|
271
|
-
launcherLabel: e.launcherLabel ??
|
|
272
|
-
accentColor: e.accentColor ??
|
|
273
|
-
colorScheme: e.colorScheme ??
|
|
274
|
-
fontFamily: e.fontFamily ??
|
|
275
|
-
scribbleStyle: e.scribbleStyle ??
|
|
276
|
-
position: e.position ??
|
|
277
|
-
movableLauncher: e.movableLauncher ??
|
|
271
|
+
launcherLabel: e.launcherLabel ?? ie.launcherLabel,
|
|
272
|
+
accentColor: e.accentColor ?? ie.accentColor,
|
|
273
|
+
colorScheme: e.colorScheme ?? ie.colorScheme,
|
|
274
|
+
fontFamily: e.fontFamily ?? ie.fontFamily,
|
|
275
|
+
scribbleStyle: e.scribbleStyle ?? ie.scribbleStyle,
|
|
276
|
+
position: e.position ?? ie.position,
|
|
277
|
+
movableLauncher: e.movableLauncher ?? ie.movableLauncher,
|
|
278
278
|
token: e.token,
|
|
279
279
|
tokenProvider: e.tokenProvider,
|
|
280
280
|
tokenEndpoint: e.tokenEndpoint,
|
|
@@ -306,9 +306,12 @@ async function ta(e = {}) {
|
|
|
306
306
|
onDisplayStateChange: e.onDisplayStateChange,
|
|
307
307
|
onPanelOpenChange: e.onPanelOpenChange,
|
|
308
308
|
showLauncherMinimizeButton: e.showLauncherMinimizeButton === !0,
|
|
309
|
+
morningReport: e.morningReport ?? null,
|
|
310
|
+
onMorningReportSnooze: e.onMorningReportSnooze,
|
|
311
|
+
onMorningReportTaskStart: e.onMorningReportTaskStart,
|
|
309
312
|
taskNotifications: e.taskNotifications
|
|
310
313
|
};
|
|
311
|
-
|
|
314
|
+
ne(
|
|
312
315
|
"web-sdk.widget",
|
|
313
316
|
"Mounting widget with merged options",
|
|
314
317
|
{
|
|
@@ -330,124 +333,124 @@ async function ta(e = {}) {
|
|
|
330
333
|
);
|
|
331
334
|
const o = n.attachShadow({ mode: "open" }), i = document.createElement("div");
|
|
332
335
|
i.className = `pluno-pa-widget pluno-pa-widget--${t.position}`, i.setAttribute("data-pluno-product-agent-ui-root", "widget");
|
|
333
|
-
let
|
|
336
|
+
let r = Mn(
|
|
334
337
|
t.accentColor,
|
|
335
338
|
t.scribbleStyle
|
|
336
339
|
);
|
|
337
340
|
Sa(
|
|
338
341
|
i,
|
|
339
342
|
t.launcherLabel,
|
|
340
|
-
|
|
343
|
+
r,
|
|
341
344
|
t.movableLauncher,
|
|
342
345
|
t.showLauncherMinimizeButton
|
|
343
346
|
), o.appendChild(i);
|
|
344
347
|
const l = yr(t);
|
|
345
348
|
let p = t.movableLauncher ? l.launcherPosition : null, d = p !== null, c = l.panelSize, u = null;
|
|
346
|
-
i.classList.add(`pluno-pa-widget--${t.colorScheme}`), t.scribbleStyle && i.classList.add("pluno-pa-widget--scribble"), t.initialDisplayState === "minimized" && (i.classList.add("pluno-pa-widget--minimized"),
|
|
349
|
+
i.classList.add(`pluno-pa-widget--${t.colorScheme}`), t.scribbleStyle && i.classList.add("pluno-pa-widget--scribble"), t.initialDisplayState === "minimized" && (i.classList.add("pluno-pa-widget--minimized"), ke(
|
|
347
350
|
i,
|
|
348
|
-
|
|
351
|
+
Ut(
|
|
349
352
|
i,
|
|
350
353
|
p,
|
|
351
354
|
t.position
|
|
352
355
|
)
|
|
353
|
-
)),
|
|
356
|
+
)), Jn(o, t.accentColor), On(i, r, {
|
|
354
357
|
accentColor: t.accentColor,
|
|
355
358
|
colorScheme: t.colorScheme,
|
|
356
359
|
fontFamily: t.fontFamily,
|
|
357
360
|
scribbleStyle: t.scribbleStyle
|
|
358
361
|
});
|
|
359
|
-
const m = await _r(),
|
|
362
|
+
const m = await _r(), k = m.ownerDocument, v = i.querySelector(
|
|
360
363
|
".pluno-pa-widget__launcher"
|
|
361
|
-
),
|
|
364
|
+
), R = i.querySelector(
|
|
362
365
|
".pluno-pa-widget__launcher-drag-handle"
|
|
363
|
-
),
|
|
366
|
+
), C = i.querySelector(
|
|
364
367
|
".pluno-pa-widget__launcher-input"
|
|
365
368
|
), g = i.querySelector(
|
|
366
369
|
".pluno-pa-widget__launcher-minimize"
|
|
367
|
-
),
|
|
370
|
+
), y = i.querySelector(".pluno-pa-widget__panel"), h = i.querySelector(
|
|
368
371
|
".pluno-pa-widget__scribble-spirals--panel"
|
|
369
|
-
),
|
|
372
|
+
), A = Array.from(
|
|
370
373
|
i.querySelectorAll(".pluno-pa-widget__resize-handle")
|
|
371
|
-
),
|
|
374
|
+
), L = i.querySelector(
|
|
372
375
|
".pluno-pa-widget__close"
|
|
373
|
-
),
|
|
376
|
+
), M = i.querySelector(
|
|
374
377
|
".pluno-pa-widget__composer"
|
|
375
|
-
),
|
|
378
|
+
), U = i.querySelector(
|
|
376
379
|
".pluno-pa-widget__attachment-error"
|
|
377
|
-
),
|
|
380
|
+
), Ie = i.querySelector(
|
|
378
381
|
".pluno-pa-widget__billing-status"
|
|
379
|
-
),
|
|
382
|
+
), H = i.querySelector(
|
|
380
383
|
".pluno-pa-widget__attachments"
|
|
381
|
-
),
|
|
384
|
+
), xe = i.querySelector(
|
|
382
385
|
".pluno-pa-widget__attachment-input"
|
|
383
|
-
),
|
|
386
|
+
), G = i.querySelector(
|
|
384
387
|
".pluno-pa-widget__attach"
|
|
385
|
-
),
|
|
388
|
+
), w = i.querySelector(
|
|
386
389
|
".pluno-pa-widget__input"
|
|
387
|
-
),
|
|
390
|
+
), J = i.querySelector(
|
|
388
391
|
".pluno-pa-widget__send"
|
|
389
|
-
),
|
|
392
|
+
), Je = i.querySelector(
|
|
390
393
|
".pluno-pa-widget__top-actions"
|
|
391
|
-
),
|
|
394
|
+
), pe = i.querySelector(
|
|
392
395
|
".pluno-pa-widget__history"
|
|
393
|
-
),
|
|
396
|
+
), Qe = i.querySelector(
|
|
394
397
|
".pluno-pa-widget__history-panel"
|
|
395
|
-
),
|
|
398
|
+
), V = i.querySelector(
|
|
396
399
|
".pluno-pa-widget__history-list"
|
|
397
|
-
),
|
|
400
|
+
), ge = i.querySelector(
|
|
398
401
|
".pluno-pa-widget__history-close"
|
|
399
|
-
),
|
|
402
|
+
), x = i.querySelector(
|
|
400
403
|
".pluno-pa-widget__history-status"
|
|
401
|
-
), R = i.querySelector(
|
|
402
|
-
".pluno-pa-widget__timeline-jump"
|
|
403
404
|
), D = i.querySelector(
|
|
405
|
+
".pluno-pa-widget__timeline-jump"
|
|
406
|
+
), $ = i.querySelector(
|
|
404
407
|
".pluno-pa-widget__active-users-counter"
|
|
405
|
-
),
|
|
408
|
+
), P = i.querySelector(
|
|
406
409
|
".pluno-pa-widget__timeline"
|
|
407
|
-
),
|
|
410
|
+
), j = i.querySelector(
|
|
408
411
|
".pluno-pa-widget__timeline-bottom-sentinel"
|
|
409
|
-
),
|
|
412
|
+
), S = i.querySelector(
|
|
410
413
|
".pluno-pa-widget__notify-suggestion"
|
|
411
|
-
),
|
|
414
|
+
), N = i.querySelector(
|
|
412
415
|
".pluno-pa-widget__notify-suggestion-enable"
|
|
413
|
-
),
|
|
416
|
+
), Ro = i.querySelector(
|
|
414
417
|
".pluno-pa-widget__notify-suggestion-later"
|
|
415
418
|
), Do = i.querySelector(
|
|
416
419
|
".pluno-pa-widget__notify-suggestion-never"
|
|
417
420
|
);
|
|
418
|
-
if (!v || !
|
|
421
|
+
if (!v || !C || !y || !L || !M || !U || !Ie || !H || !xe || !G || !w || !J || !Je || !pe || !Qe || !V || !ge || !x || !D || !$ || !P || !j)
|
|
419
422
|
throw new Error("Failed to mount Pluno widget");
|
|
420
|
-
if (t.movableLauncher && !
|
|
423
|
+
if (t.movableLauncher && !R)
|
|
421
424
|
throw new Error("Failed to mount Pluno widget drag handle");
|
|
422
|
-
|
|
423
|
-
let
|
|
424
|
-
const
|
|
425
|
+
$n(C), $n(w);
|
|
426
|
+
let q = [], se = null;
|
|
427
|
+
const Pe = () => {
|
|
425
428
|
Ga(
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
(
|
|
429
|
-
|
|
430
|
-
(s, _) => _ !==
|
|
431
|
-
),
|
|
429
|
+
H,
|
|
430
|
+
q,
|
|
431
|
+
(a) => {
|
|
432
|
+
q = q.filter(
|
|
433
|
+
(s, _) => _ !== a
|
|
434
|
+
), Pe(), F(b.getState()), K();
|
|
432
435
|
}
|
|
433
436
|
);
|
|
434
|
-
},
|
|
437
|
+
}, zo = t.loginRequired || t.signupRequired || t.token || t.webSocketFactory ? void 0 : t.tokenProvider ?? (async () => {
|
|
435
438
|
if (!t.tokenEndpoint)
|
|
436
439
|
throw new Error("Pluno widget requires token or tokenEndpoint");
|
|
437
|
-
return
|
|
438
|
-
}),
|
|
439
|
-
let
|
|
440
|
+
return Ao(t.tokenEndpoint);
|
|
441
|
+
}), Mo = window.fetch.bind(window), bt = xr(t.clientId);
|
|
442
|
+
let b;
|
|
440
443
|
try {
|
|
441
|
-
const
|
|
444
|
+
const a = {
|
|
442
445
|
token: t.token,
|
|
443
|
-
tokenProvider:
|
|
446
|
+
tokenProvider: zo,
|
|
444
447
|
backendUrl: t.backendUrl,
|
|
445
448
|
metadata: () => ({
|
|
446
449
|
...t.metadata ?? {},
|
|
447
|
-
...!
|
|
450
|
+
...!b.getState().sessionId && t.scribbleStyle ? { scribbleStyleStarted: !0 } : {}
|
|
448
451
|
}),
|
|
449
452
|
initialStarterPrompts: t.initialStarterPrompts,
|
|
450
|
-
clientId:
|
|
453
|
+
clientId: bt.clientId,
|
|
451
454
|
restorePersistedState: t.restorePersistedState,
|
|
452
455
|
expectedPersistedSessionId: t.expectedPersistedSessionId,
|
|
453
456
|
webSocketFactory: t.webSocketFactory,
|
|
@@ -455,11 +458,11 @@ async function ta(e = {}) {
|
|
|
455
458
|
autoConnect: t.loginRequired || t.signupRequired ? !1 : void 0,
|
|
456
459
|
disableNetworkCapture: !!t.sdkPreviewChannelId
|
|
457
460
|
};
|
|
458
|
-
|
|
459
|
-
} catch (
|
|
460
|
-
throw
|
|
461
|
+
b = await Jo.init(a);
|
|
462
|
+
} catch (a) {
|
|
463
|
+
throw bt.release(), n.remove(), a;
|
|
461
464
|
}
|
|
462
|
-
m.appendChild(n),
|
|
465
|
+
m.appendChild(n), ne(
|
|
463
466
|
"web-sdk.widget",
|
|
464
467
|
"Applied initial widget appearance",
|
|
465
468
|
{
|
|
@@ -469,118 +472,118 @@ async function ta(e = {}) {
|
|
|
469
472
|
cssAccent: i.style.getPropertyValue("--pluno-pa-accent")
|
|
470
473
|
}
|
|
471
474
|
);
|
|
472
|
-
const
|
|
475
|
+
const _t = new Set(l.openToolGroupKeys), Te = new Set(
|
|
473
476
|
l.seenShareCandidateIds
|
|
474
|
-
),
|
|
475
|
-
let
|
|
477
|
+
), et = new Set(Te);
|
|
478
|
+
let xt = l.sharePromptsDisabled || await vr(t), Q = null, Ae = !1, he = !1, ye = {
|
|
476
479
|
enabled: !0
|
|
477
|
-
},
|
|
478
|
-
const ee = (
|
|
479
|
-
|
|
480
|
+
}, ve = 0, sn = "", me = !1, de = !1, fe = [], yt = null, Be = null;
|
|
481
|
+
const ee = (a, s) => {
|
|
482
|
+
ye = { enabled: a, reason: s };
|
|
480
483
|
}, te = () => {
|
|
481
|
-
|
|
482
|
-
},
|
|
483
|
-
|
|
484
|
-
},
|
|
485
|
-
ee(!0,
|
|
486
|
-
},
|
|
487
|
-
if (
|
|
484
|
+
D.hidden = !0;
|
|
485
|
+
}, Oo = () => {
|
|
486
|
+
D.hidden = !1;
|
|
487
|
+
}, Uo = (a = "jump") => {
|
|
488
|
+
ee(!0, a), te(), Xe(P, () => ye.enabled), ve = P.scrollTop;
|
|
489
|
+
}, Ce = () => {
|
|
490
|
+
if (pe.hidden = t.loginRequired, Qe.hidden = !me, pe.setAttribute("aria-expanded", String(me)), V.classList.toggle(
|
|
488
491
|
"pluno-pa-widget__history-list--center",
|
|
489
|
-
|
|
490
|
-
),
|
|
491
|
-
const
|
|
492
|
-
|
|
492
|
+
de && fe.length === 0
|
|
493
|
+
), V.replaceChildren(), de && fe.length === 0) {
|
|
494
|
+
const a = document.createElement("p");
|
|
495
|
+
a.className = "pluno-pa-widget__history-loading", a.textContent = "Loading...", V.appendChild(a);
|
|
493
496
|
}
|
|
494
|
-
for (const
|
|
497
|
+
for (const a of fe) {
|
|
495
498
|
const s = document.createElement("button");
|
|
496
|
-
s.type = "button", s.className = "pluno-pa-widget__history-item", s.disabled =
|
|
499
|
+
s.type = "button", s.className = "pluno-pa-widget__history-item", s.disabled = de;
|
|
497
500
|
const _ = document.createElement("span");
|
|
498
|
-
_.className = "pluno-pa-widget__history-item-title", _.textContent = ya(
|
|
499
|
-
const
|
|
500
|
-
|
|
501
|
-
|
|
501
|
+
_.className = "pluno-pa-widget__history-item-title", _.textContent = ya(a);
|
|
502
|
+
const I = document.createElement("time");
|
|
503
|
+
I.className = "pluno-pa-widget__history-time", I.dateTime = a.lastActiveAt, I.textContent = Ca(
|
|
504
|
+
a.lastActiveAt,
|
|
502
505
|
Date.now()
|
|
503
506
|
);
|
|
504
|
-
const
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
}),
|
|
508
|
-
}
|
|
509
|
-
if (
|
|
510
|
-
const
|
|
511
|
-
|
|
512
|
-
}
|
|
513
|
-
|
|
514
|
-
},
|
|
515
|
-
if (!
|
|
516
|
-
|
|
507
|
+
const z = document.createElement("small");
|
|
508
|
+
z.className = "pluno-pa-widget__history-path", z.textContent = va(a), s.append(_, I, z), s.addEventListener("click", () => {
|
|
509
|
+
me = !1, Be = null, Ce(), ee(!0, "newSession"), te(), b.loadSession(a.id), F(b.getState());
|
|
510
|
+
}), V.appendChild(s);
|
|
511
|
+
}
|
|
512
|
+
if (de && fe.length > 0) {
|
|
513
|
+
const a = document.createElement("p");
|
|
514
|
+
a.className = "pluno-pa-widget__history-loading pluno-pa-widget__history-loading--inline", a.textContent = "Loading...", V.appendChild(a);
|
|
515
|
+
}
|
|
516
|
+
x.textContent = Be ?? (!de && fe.length === 0 ? "No recent chats for this page yet." : ""), x.hidden = x.textContent.length === 0;
|
|
517
|
+
}, dn = async (a) => {
|
|
518
|
+
if (!de) {
|
|
519
|
+
de = !0, Be = null, Ce();
|
|
517
520
|
try {
|
|
518
|
-
const s = await
|
|
519
|
-
|
|
521
|
+
const s = await b.listSessions({ cursor: a, limit: 20 });
|
|
522
|
+
fe = a ? [...fe, ...s.sessions] : s.sessions, yt = s.nextCursor;
|
|
520
523
|
} catch (s) {
|
|
521
|
-
|
|
524
|
+
ne(
|
|
522
525
|
"web-sdk.widget",
|
|
523
526
|
"Failed to load session history",
|
|
524
527
|
{
|
|
525
528
|
message: s instanceof Error ? s.message : String(s)
|
|
526
529
|
}
|
|
527
|
-
),
|
|
530
|
+
), Be = Bi;
|
|
528
531
|
} finally {
|
|
529
|
-
|
|
532
|
+
de = !1, Ce();
|
|
530
533
|
}
|
|
531
534
|
}
|
|
532
|
-
},
|
|
533
|
-
!
|
|
534
|
-
},
|
|
535
|
-
|
|
536
|
-
},
|
|
537
|
-
|
|
535
|
+
}, Bo = () => {
|
|
536
|
+
!yt || de || V.scrollHeight - V.scrollTop - V.clientHeight <= 24 && dn(yt);
|
|
537
|
+
}, cn = () => {
|
|
538
|
+
Ae || typeof document > "u" || (Jn(o, t.accentColor), n.isConnected || k.body?.appendChild(n));
|
|
539
|
+
}, un = new MutationObserver(cn);
|
|
540
|
+
un.observe(k.documentElement, {
|
|
538
541
|
childList: !0,
|
|
539
542
|
subtree: !0
|
|
540
|
-
}),
|
|
541
|
-
const
|
|
542
|
-
const s =
|
|
543
|
-
return
|
|
543
|
+
}), cn();
|
|
544
|
+
const Fe = (a = !0) => {
|
|
545
|
+
const s = ht(i, a);
|
|
546
|
+
return Qt(
|
|
544
547
|
i,
|
|
545
|
-
p ?
|
|
548
|
+
p ? fo(p, s) : sa(
|
|
546
549
|
i,
|
|
547
550
|
t.position,
|
|
548
551
|
s
|
|
549
552
|
),
|
|
550
553
|
s
|
|
551
554
|
);
|
|
552
|
-
},
|
|
553
|
-
const
|
|
555
|
+
}, B = () => {
|
|
556
|
+
const a = fa(o, C, w);
|
|
554
557
|
Sr(t, {
|
|
555
558
|
isOpen: i.classList.contains("pluno-pa-widget--open"),
|
|
556
|
-
composerValue:
|
|
557
|
-
focusedInput:
|
|
558
|
-
focusedInputAt:
|
|
559
|
-
openToolGroupKeys: [...
|
|
559
|
+
composerValue: w.value,
|
|
560
|
+
focusedInput: a,
|
|
561
|
+
focusedInputAt: a ? Date.now() : null,
|
|
562
|
+
openToolGroupKeys: [..._t],
|
|
560
563
|
launcherPosition: d ? p : null,
|
|
561
564
|
panelSize: c,
|
|
562
|
-
seenShareCandidateIds: [...
|
|
563
|
-
-
|
|
565
|
+
seenShareCandidateIds: [...Te].slice(
|
|
566
|
+
-ao
|
|
564
567
|
),
|
|
565
|
-
sharePromptsDisabled:
|
|
568
|
+
sharePromptsDisabled: xt
|
|
566
569
|
});
|
|
567
|
-
},
|
|
568
|
-
t.onDisplayStateChange?.(
|
|
569
|
-
},
|
|
570
|
-
if (
|
|
571
|
-
i.classList.remove("pluno-pa-widget--minimized"), v.removeAttribute("tabindex"), !i.classList.contains("pluno-pa-widget--open") && !i.classList.contains("pluno-pa-widget--closing") &&
|
|
570
|
+
}, tt = (a) => {
|
|
571
|
+
t.onDisplayStateChange?.(a);
|
|
572
|
+
}, He = (a, s = !0) => {
|
|
573
|
+
if (a === "shown") {
|
|
574
|
+
i.classList.remove("pluno-pa-widget--minimized"), v.removeAttribute("tabindex"), !i.classList.contains("pluno-pa-widget--open") && !i.classList.contains("pluno-pa-widget--closing") && We(!1), s && tt("shown");
|
|
572
575
|
return;
|
|
573
576
|
}
|
|
574
|
-
|
|
577
|
+
Q !== null && (window.clearTimeout(Q), Q = null), i.classList.remove("pluno-pa-widget--open"), i.classList.remove("pluno-pa-widget--closing"), i.classList.add("pluno-pa-widget--minimized"), v.hidden = !1, y.hidden = !0, L.hidden = !0, v.tabIndex = 0, w.value = "", ke(
|
|
575
578
|
i,
|
|
576
|
-
|
|
579
|
+
Ut(
|
|
577
580
|
i,
|
|
578
581
|
p,
|
|
579
582
|
t.position
|
|
580
583
|
)
|
|
581
|
-
),
|
|
582
|
-
},
|
|
583
|
-
ma(
|
|
584
|
+
), Hn(i), B(), s && tt("minimized");
|
|
585
|
+
}, Se = (a, s = {}) => {
|
|
586
|
+
ma(a, {
|
|
584
587
|
debugVersion: Qi,
|
|
585
588
|
launcherPosition: p,
|
|
586
589
|
rootClasses: i.className,
|
|
@@ -590,35 +593,35 @@ async function ta(e = {}) {
|
|
|
590
593
|
right: i.style.right,
|
|
591
594
|
bottom: i.style.bottom
|
|
592
595
|
},
|
|
593
|
-
rootRect:
|
|
594
|
-
launcherRect:
|
|
595
|
-
panelRect:
|
|
596
|
-
viewport:
|
|
597
|
-
panelHidden:
|
|
598
|
-
closeHidden:
|
|
596
|
+
rootRect: Ft(i),
|
|
597
|
+
launcherRect: Ft(v),
|
|
598
|
+
panelRect: Ft(y),
|
|
599
|
+
viewport: Z(),
|
|
600
|
+
panelHidden: y.hidden,
|
|
601
|
+
closeHidden: L.hidden,
|
|
599
602
|
...s
|
|
600
603
|
});
|
|
601
|
-
},
|
|
604
|
+
}, We = (a = !0) => {
|
|
602
605
|
if (!p)
|
|
603
|
-
return
|
|
604
|
-
const s =
|
|
605
|
-
return
|
|
606
|
+
return ke(i, null), Fe(a);
|
|
607
|
+
const s = Fe(a);
|
|
608
|
+
return ke(i, s), Se("Applied stored closed launcher position", {
|
|
606
609
|
visibleLauncherPosition: s
|
|
607
610
|
}), s;
|
|
608
|
-
},
|
|
609
|
-
if (!
|
|
610
|
-
|
|
611
|
+
}, vt = (a, s) => {
|
|
612
|
+
if (!a || !s) {
|
|
613
|
+
Hn(i);
|
|
611
614
|
return;
|
|
612
615
|
}
|
|
613
616
|
ha(i, {
|
|
614
|
-
x:
|
|
615
|
-
y:
|
|
617
|
+
x: a.x - s.x,
|
|
618
|
+
y: a.y - s.y
|
|
616
619
|
});
|
|
617
|
-
},
|
|
620
|
+
}, gn = () => {
|
|
618
621
|
if (i.classList.contains("pluno-pa-widget--minimized")) {
|
|
619
|
-
|
|
622
|
+
ke(
|
|
620
623
|
i,
|
|
621
|
-
|
|
624
|
+
Ut(
|
|
622
625
|
i,
|
|
623
626
|
p,
|
|
624
627
|
t.position
|
|
@@ -626,234 +629,234 @@ async function ta(e = {}) {
|
|
|
626
629
|
);
|
|
627
630
|
return;
|
|
628
631
|
}
|
|
629
|
-
const
|
|
632
|
+
const a = We();
|
|
630
633
|
if (i.classList.contains("pluno-pa-widget--open") || i.classList.contains("pluno-pa-widget--closing")) {
|
|
631
|
-
|
|
632
|
-
const s =
|
|
633
|
-
|
|
634
|
+
Ot(i, c);
|
|
635
|
+
const s = Ue(c);
|
|
636
|
+
Wt(
|
|
634
637
|
h,
|
|
635
638
|
s.width
|
|
636
639
|
);
|
|
637
|
-
const _ =
|
|
638
|
-
u ??
|
|
640
|
+
const _ = ct(
|
|
641
|
+
u ?? Bt(
|
|
639
642
|
i,
|
|
640
|
-
|
|
643
|
+
a,
|
|
641
644
|
t.position,
|
|
642
645
|
c
|
|
643
646
|
),
|
|
644
647
|
s
|
|
645
648
|
);
|
|
646
|
-
u && (u = _),
|
|
649
|
+
u && (u = _), vt(_, a), Se(
|
|
647
650
|
"Applied open panel position after viewport resize",
|
|
648
651
|
{ openPanelPosition: _ }
|
|
649
652
|
);
|
|
650
|
-
} else p &&
|
|
653
|
+
} else p && Se(
|
|
651
654
|
"Applied visible launcher position after viewport resize",
|
|
652
|
-
{ visibleLauncherPosition:
|
|
655
|
+
{ visibleLauncherPosition: a }
|
|
653
656
|
);
|
|
654
657
|
};
|
|
655
|
-
let
|
|
658
|
+
let hn = () => {
|
|
656
659
|
};
|
|
657
|
-
window.addEventListener("resize",
|
|
660
|
+
window.addEventListener("resize", gn), t.movableLauncher && R ? (We(), hn = ra({
|
|
658
661
|
root: i,
|
|
659
662
|
launcher: v,
|
|
660
|
-
launcherDragHandle:
|
|
661
|
-
getPosition: () =>
|
|
662
|
-
setPosition: (
|
|
663
|
-
const s =
|
|
663
|
+
launcherDragHandle: R,
|
|
664
|
+
getPosition: () => Fe(),
|
|
665
|
+
setPosition: (a) => {
|
|
666
|
+
const s = a, _ = ht(i), I = Qt(
|
|
664
667
|
i,
|
|
665
|
-
|
|
668
|
+
a,
|
|
666
669
|
_
|
|
667
670
|
);
|
|
668
671
|
p = ca(
|
|
669
|
-
|
|
672
|
+
I,
|
|
670
673
|
_
|
|
671
|
-
),
|
|
674
|
+
), ke(i, I), Se("Dragging closed launcher", {
|
|
672
675
|
requestedPosition: s
|
|
673
676
|
});
|
|
674
677
|
},
|
|
675
678
|
persist: () => {
|
|
676
|
-
d = !0,
|
|
679
|
+
d = !0, B(), Se("Persisted closed launcher drag position");
|
|
677
680
|
}
|
|
678
|
-
})) :
|
|
679
|
-
const
|
|
680
|
-
const
|
|
681
|
+
})) : ke(i, null), Ot(i, c);
|
|
682
|
+
const Fo = () => {
|
|
683
|
+
const a = Ue(c), s = Fe();
|
|
681
684
|
return {
|
|
682
|
-
position:
|
|
683
|
-
u ??
|
|
685
|
+
position: ct(
|
|
686
|
+
u ?? Bt(
|
|
684
687
|
i,
|
|
685
688
|
s,
|
|
686
689
|
t.position,
|
|
687
690
|
c
|
|
688
691
|
),
|
|
689
|
-
|
|
692
|
+
a
|
|
690
693
|
),
|
|
691
|
-
size:
|
|
694
|
+
size: a
|
|
692
695
|
};
|
|
693
|
-
},
|
|
694
|
-
c =
|
|
696
|
+
}, Ho = (a) => {
|
|
697
|
+
c = ft(a.size), Ot(i, c), Wt(
|
|
695
698
|
h,
|
|
696
|
-
|
|
697
|
-
), u =
|
|
698
|
-
|
|
699
|
-
|
|
699
|
+
Ue(c).width
|
|
700
|
+
), u = ct(
|
|
701
|
+
a.position,
|
|
702
|
+
Ue(c)
|
|
700
703
|
);
|
|
701
|
-
const s =
|
|
702
|
-
|
|
703
|
-
},
|
|
704
|
+
const s = Fe();
|
|
705
|
+
vt(u, s);
|
|
706
|
+
}, Wo = A.length > 0 ? la({
|
|
704
707
|
root: i,
|
|
705
|
-
handles:
|
|
706
|
-
getBounds:
|
|
707
|
-
setBounds:
|
|
708
|
-
persist:
|
|
708
|
+
handles: A,
|
|
709
|
+
getBounds: Fo,
|
|
710
|
+
setBounds: Ho,
|
|
711
|
+
persist: B
|
|
709
712
|
}) : () => {
|
|
710
713
|
};
|
|
711
|
-
let
|
|
712
|
-
const
|
|
713
|
-
if (!(!t.billingStatusLoader ||
|
|
714
|
-
|
|
714
|
+
let Ct = !1;
|
|
715
|
+
const mn = async () => {
|
|
716
|
+
if (!(!t.billingStatusLoader || Ct)) {
|
|
717
|
+
Ct = !0;
|
|
715
718
|
try {
|
|
716
|
-
const
|
|
717
|
-
|
|
719
|
+
const a = await t.billingStatusLoader();
|
|
720
|
+
jn(
|
|
718
721
|
t.billingStatus,
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
) && (t.billingStatus =
|
|
722
|
-
|
|
722
|
+
a,
|
|
723
|
+
b.getState().lastErrorCode
|
|
724
|
+
) && (t.billingStatus = a, $t(
|
|
725
|
+
Ie,
|
|
723
726
|
t.billingStatus,
|
|
724
|
-
|
|
725
|
-
),
|
|
727
|
+
b.getState().lastErrorCode
|
|
728
|
+
), K());
|
|
726
729
|
} finally {
|
|
727
|
-
|
|
730
|
+
Ct = !1;
|
|
728
731
|
}
|
|
729
732
|
}
|
|
730
|
-
},
|
|
731
|
-
|
|
733
|
+
}, we = (a = "", s = !0) => {
|
|
734
|
+
mn(), $e && ($e = !1, kt()), i.classList.contains("pluno-pa-widget--open") || (u = null), Q !== null && (window.clearTimeout(Q), Q = null), He("shown", !1), y.hidden = !1, L.hidden = !1, Wt(
|
|
732
735
|
h,
|
|
733
|
-
|
|
736
|
+
Ue(c).width
|
|
734
737
|
), i.classList.remove("pluno-pa-widget--closing");
|
|
735
|
-
const _ =
|
|
738
|
+
const _ = We(), I = Bt(
|
|
736
739
|
i,
|
|
737
740
|
_,
|
|
738
741
|
t.position,
|
|
739
742
|
c
|
|
740
743
|
);
|
|
741
|
-
if (
|
|
742
|
-
openPanelPosition:
|
|
744
|
+
if (vt(I, _), Se("Opening launcher at clamped open panel position", {
|
|
745
|
+
openPanelPosition: I,
|
|
743
746
|
visibleLauncherPosition: _
|
|
744
747
|
}), ee(!0, "open"), te(), !s) {
|
|
745
|
-
i.classList.add("pluno-pa-widget--open"), v.hidden = !0,
|
|
748
|
+
i.classList.add("pluno-pa-widget--open"), v.hidden = !0, a && (w.value = a, Ye(w)), Xe(P, () => ye.enabled), ve = P.scrollTop, w.focus(), w.setSelectionRange(w.value.length, w.value.length), B(), tt("shown"), t.onPanelOpenChange?.(!0);
|
|
746
749
|
return;
|
|
747
750
|
}
|
|
748
751
|
window.requestAnimationFrame(() => {
|
|
749
|
-
i.classList.add("pluno-pa-widget--open"),
|
|
750
|
-
v.hidden = !0,
|
|
752
|
+
i.classList.add("pluno-pa-widget--open"), a && (w.value = a, Ye(w)), Xe(P, () => ye.enabled), ve = P.scrollTop, w.focus(), w.setSelectionRange(w.value.length, w.value.length), B(), tt("shown"), t.onPanelOpenChange?.(!0), Q = window.setTimeout(() => {
|
|
753
|
+
v.hidden = !0, Xe(P, () => ye.enabled), ve = P.scrollTop;
|
|
751
754
|
}, 220);
|
|
752
755
|
});
|
|
753
|
-
},
|
|
754
|
-
|
|
755
|
-
|
|
756
|
+
}, St = () => {
|
|
757
|
+
Q !== null && (window.clearTimeout(Q), Q = null), v.hidden = !1, p && (We(!1), Se("Closing launcher at stored position")), i.classList.remove("pluno-pa-widget--open"), i.classList.add("pluno-pa-widget--closing"), B(), t.onPanelOpenChange?.(!1), Q = window.setTimeout(() => {
|
|
758
|
+
y.hidden = !0, L.hidden = !0, u = null, i.classList.remove("pluno-pa-widget--closing");
|
|
756
759
|
}, 220);
|
|
757
760
|
};
|
|
758
|
-
v.addEventListener("submit", (
|
|
759
|
-
|
|
760
|
-
}),
|
|
761
|
-
|
|
762
|
-
}), v.addEventListener("click", (
|
|
763
|
-
|
|
764
|
-
}),
|
|
765
|
-
|
|
766
|
-
}),
|
|
767
|
-
if (!
|
|
761
|
+
v.addEventListener("submit", (a) => {
|
|
762
|
+
a.preventDefault(), we(C.value), C.value = "";
|
|
763
|
+
}), R?.addEventListener("click", (a) => {
|
|
764
|
+
a.preventDefault(), a.stopPropagation();
|
|
765
|
+
}), v.addEventListener("click", (a) => {
|
|
766
|
+
a.target === C && !R || (we(C.value), C.value = "");
|
|
767
|
+
}), C.addEventListener("focus", () => {
|
|
768
|
+
we(C.value), C.value = "";
|
|
769
|
+
}), C.addEventListener("input", () => {
|
|
770
|
+
if (!C.value)
|
|
768
771
|
return;
|
|
769
|
-
const
|
|
770
|
-
|
|
772
|
+
const a = C.value;
|
|
773
|
+
we(a), C.value = "";
|
|
771
774
|
});
|
|
772
|
-
let
|
|
773
|
-
const
|
|
774
|
-
if (!(
|
|
775
|
+
let Et = null, nt = null, Ee = null;
|
|
776
|
+
const fn = (a) => a === C || a === w, Go = (a) => {
|
|
777
|
+
if (!(a instanceof Element) || a.getRootNode() === i.getRootNode())
|
|
775
778
|
return null;
|
|
776
|
-
let s =
|
|
779
|
+
let s = a;
|
|
777
780
|
for (; s; ) {
|
|
778
|
-
const _ = s.closest(
|
|
781
|
+
const _ = s.closest(Tn);
|
|
779
782
|
if (_)
|
|
780
783
|
return _;
|
|
781
|
-
const
|
|
782
|
-
s =
|
|
784
|
+
const I = s.getRootNode();
|
|
785
|
+
s = I instanceof ShadowRoot ? I.host : null;
|
|
783
786
|
}
|
|
784
787
|
return null;
|
|
785
|
-
}, $o = (
|
|
786
|
-
if (!
|
|
788
|
+
}, $o = (a) => {
|
|
789
|
+
if (!a.isConnected || !a.matches(Tn))
|
|
787
790
|
return !1;
|
|
788
|
-
if (!(
|
|
791
|
+
if (!(a instanceof HTMLElement))
|
|
789
792
|
return !0;
|
|
790
|
-
if (
|
|
793
|
+
if (a.hidden)
|
|
791
794
|
return !1;
|
|
792
|
-
if (typeof
|
|
793
|
-
return
|
|
794
|
-
const s = window.getComputedStyle(
|
|
795
|
+
if (typeof a.checkVisibility == "function")
|
|
796
|
+
return a.checkVisibility();
|
|
797
|
+
const s = window.getComputedStyle(a);
|
|
795
798
|
return s.display !== "none" && s.visibility !== "hidden";
|
|
796
|
-
},
|
|
797
|
-
|
|
798
|
-
const s =
|
|
799
|
-
(!s || !$o(s)) &&
|
|
800
|
-
}, Ui) :
|
|
799
|
+
}, wn = (a) => {
|
|
800
|
+
Ge !== a && (Ge = a, i.classList.toggle("pluno-pa-widget--host-modal-conflict", a !== null), it(), a !== null ? Ee = window.setInterval(() => {
|
|
801
|
+
const s = Ge;
|
|
802
|
+
(!s || !$o(s)) && wn(null);
|
|
803
|
+
}, Ui) : Ee !== null && (window.clearInterval(Ee), Ee = null, nt = null));
|
|
801
804
|
}, qo = () => {
|
|
802
|
-
|
|
805
|
+
Ee !== null && (window.clearInterval(Ee), Ee = null);
|
|
803
806
|
};
|
|
804
|
-
i.addEventListener("focusin", (
|
|
805
|
-
|
|
806
|
-
}), i.addEventListener("focusout", (
|
|
807
|
-
if (!
|
|
807
|
+
i.addEventListener("focusin", (a) => {
|
|
808
|
+
fn(a.target) && (Et = Date.now(), B());
|
|
809
|
+
}), i.addEventListener("focusout", (a) => {
|
|
810
|
+
if (!fn(a.target) || Ge !== null)
|
|
808
811
|
return;
|
|
809
|
-
const s =
|
|
810
|
-
if (
|
|
812
|
+
const s = Et;
|
|
813
|
+
if (Et = null, s === null || Date.now() - s > Mi)
|
|
811
814
|
return;
|
|
812
|
-
const _ = Go(
|
|
815
|
+
const _ = Go(a.relatedTarget);
|
|
813
816
|
if (!_)
|
|
814
817
|
return;
|
|
815
|
-
const
|
|
816
|
-
if (
|
|
817
|
-
|
|
818
|
+
const I = Date.now();
|
|
819
|
+
if (nt !== null && I - nt <= Oi) {
|
|
820
|
+
wn(_);
|
|
818
821
|
return;
|
|
819
822
|
}
|
|
820
|
-
|
|
821
|
-
}), v.addEventListener("keydown", (
|
|
822
|
-
!i.classList.contains("pluno-pa-widget--minimized") ||
|
|
823
|
-
}), g?.addEventListener("pointerdown", (
|
|
824
|
-
|
|
825
|
-
}), g?.addEventListener("click", (
|
|
826
|
-
|
|
827
|
-
}),
|
|
828
|
-
|
|
829
|
-
}),
|
|
830
|
-
|
|
823
|
+
nt = I;
|
|
824
|
+
}), v.addEventListener("keydown", (a) => {
|
|
825
|
+
!i.classList.contains("pluno-pa-widget--minimized") || a.key !== "Enter" && a.key !== " " || (a.preventDefault(), we());
|
|
826
|
+
}), g?.addEventListener("pointerdown", (a) => {
|
|
827
|
+
a.stopPropagation();
|
|
828
|
+
}), g?.addEventListener("click", (a) => {
|
|
829
|
+
a.preventDefault(), a.stopPropagation(), He("minimized");
|
|
830
|
+
}), L.addEventListener("click", St), P.addEventListener("scroll", () => {
|
|
831
|
+
P.scrollTop < ve - 1 && ee(!1, "userScroll"), ve = P.scrollTop;
|
|
832
|
+
}), D.addEventListener("click", () => {
|
|
833
|
+
Uo();
|
|
831
834
|
});
|
|
832
|
-
const
|
|
833
|
-
([
|
|
834
|
-
|
|
835
|
+
const bn = typeof IntersectionObserver > "u" ? null : new IntersectionObserver(
|
|
836
|
+
([a]) => {
|
|
837
|
+
a?.isIntersecting && (ee(!0, "bottom"), te());
|
|
835
838
|
},
|
|
836
|
-
{ root:
|
|
839
|
+
{ root: P, threshold: 0 }
|
|
837
840
|
);
|
|
838
|
-
|
|
839
|
-
const
|
|
840
|
-
let
|
|
841
|
-
const
|
|
842
|
-
const
|
|
843
|
-
|
|
844
|
-
},
|
|
845
|
-
|
|
841
|
+
bn?.observe(j);
|
|
842
|
+
const ot = () => t.loginRequired || t.signupRequired;
|
|
843
|
+
let Ge = null, $e = !1;
|
|
844
|
+
const it = () => {
|
|
845
|
+
const a = ot(), s = Ge !== null;
|
|
846
|
+
C.readOnly = a || s, w.readOnly = s, C.placeholder = s ? An : a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : $e ? "New update" : t.launcherLabel, w.placeholder = s ? An : a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : ie.launcherLabel, M.hidden = a;
|
|
847
|
+
}, K = () => {
|
|
848
|
+
J.disabled = re(t.billingStatus) || !b.getState().isThinking && w.value.trim().length === 0 && q.length === 0, G.disabled = ot() || re(t.billingStatus);
|
|
846
849
|
};
|
|
847
|
-
|
|
848
|
-
const
|
|
849
|
-
const
|
|
850
|
-
i.classList.toggle("pluno-pa-widget--thinking",
|
|
850
|
+
it();
|
|
851
|
+
const kt = () => {
|
|
852
|
+
const a = b.getState().isThinking;
|
|
853
|
+
i.classList.toggle("pluno-pa-widget--thinking", a), i.classList.toggle(
|
|
851
854
|
"pluno-pa-widget--unread",
|
|
852
|
-
!
|
|
853
|
-
),
|
|
855
|
+
!a && $e
|
|
856
|
+
), it();
|
|
854
857
|
};
|
|
855
|
-
|
|
856
|
-
if (
|
|
858
|
+
kt(), M.addEventListener("submit", (a) => {
|
|
859
|
+
if (a.preventDefault(), t.loginRequired) {
|
|
857
860
|
t.onLoginClick?.();
|
|
858
861
|
return;
|
|
859
862
|
}
|
|
@@ -861,158 +864,158 @@ async function ta(e = {}) {
|
|
|
861
864
|
t.onSignupClick?.();
|
|
862
865
|
return;
|
|
863
866
|
}
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
),
|
|
867
|
+
re(t.billingStatus) || (he = !0, ee(!0, "send"), te(), q = Ht(
|
|
868
|
+
b,
|
|
869
|
+
w,
|
|
870
|
+
q
|
|
871
|
+
), Pe(), K());
|
|
869
872
|
});
|
|
870
|
-
let
|
|
873
|
+
let qe = 0;
|
|
871
874
|
const jo = () => {
|
|
872
|
-
|
|
873
|
-
},
|
|
874
|
-
|
|
875
|
-
|
|
875
|
+
qe = 0, i.classList.remove("pluno-pa-widget--drag-over");
|
|
876
|
+
}, Lt = (a) => {
|
|
877
|
+
se !== null && window.clearTimeout(se), U.textContent = a, U.hidden = !1, se = window.setTimeout(() => {
|
|
878
|
+
U.textContent = "", U.hidden = !0, se = null;
|
|
876
879
|
}, 3e3);
|
|
877
880
|
}, Vo = () => {
|
|
878
|
-
|
|
879
|
-
},
|
|
880
|
-
if (
|
|
881
|
+
se !== null && (window.clearTimeout(se), se = null), U.textContent = "", U.hidden = !0;
|
|
882
|
+
}, It = async (a) => {
|
|
883
|
+
if (a.length === 0)
|
|
881
884
|
return;
|
|
882
|
-
const s = ja(
|
|
883
|
-
|
|
885
|
+
const s = ja(b, a);
|
|
886
|
+
q = [...q, ...s], Pe(), Vo(), K(), F(b.getState()), i.classList.contains("pluno-pa-widget--open") || we();
|
|
884
887
|
};
|
|
885
|
-
|
|
886
|
-
t.loginRequired ||
|
|
887
|
-
}),
|
|
888
|
-
const
|
|
889
|
-
|
|
890
|
-
|
|
888
|
+
G.addEventListener("click", () => {
|
|
889
|
+
t.loginRequired || re(t.billingStatus) || xe.click();
|
|
890
|
+
}), xe.addEventListener("change", () => {
|
|
891
|
+
const a = Array.from(xe.files ?? []);
|
|
892
|
+
xe.value = "", It(a).catch((s) => {
|
|
893
|
+
Lt(
|
|
891
894
|
s instanceof Error ? s.message : "Failed to attach file"
|
|
892
|
-
),
|
|
895
|
+
), ne("web-sdk.widget", "Attachment failed", {
|
|
893
896
|
message: s instanceof Error ? s.message : String(s)
|
|
894
897
|
});
|
|
895
898
|
});
|
|
896
|
-
}), i.addEventListener("dragenter", (
|
|
897
|
-
!
|
|
898
|
-
}), i.addEventListener("dragover", (
|
|
899
|
-
const s =
|
|
900
|
-
!
|
|
901
|
-
}), i.addEventListener("dragleave", (
|
|
902
|
-
|
|
903
|
-
}), i.addEventListener("drop", (
|
|
904
|
-
const s =
|
|
905
|
-
!
|
|
906
|
-
|
|
899
|
+
}), i.addEventListener("dragenter", (a) => {
|
|
900
|
+
!pt(a.dataTransfer) || t.loginRequired || (a.preventDefault(), a.stopPropagation(), qe += 1, i.classList.add("pluno-pa-widget--drag-over"));
|
|
901
|
+
}), i.addEventListener("dragover", (a) => {
|
|
902
|
+
const s = a.dataTransfer;
|
|
903
|
+
!pt(s) || t.loginRequired || (a.preventDefault(), a.stopPropagation(), s.dropEffect = "copy");
|
|
904
|
+
}), i.addEventListener("dragleave", (a) => {
|
|
905
|
+
pt(a.dataTransfer) && (a.stopPropagation(), qe = Math.max(0, qe - 1), qe === 0 && i.classList.remove("pluno-pa-widget--drag-over"));
|
|
906
|
+
}), i.addEventListener("drop", (a) => {
|
|
907
|
+
const s = a.dataTransfer;
|
|
908
|
+
!pt(s) || t.loginRequired || (a.preventDefault(), a.stopPropagation(), jo(), It(s.files).catch((_) => {
|
|
909
|
+
Lt(
|
|
907
910
|
_ instanceof Error ? _.message : "Failed to attach file"
|
|
908
|
-
),
|
|
911
|
+
), ne("web-sdk.widget", "Attachment failed", {
|
|
909
912
|
message: _ instanceof Error ? _.message : String(_)
|
|
910
913
|
});
|
|
911
914
|
}));
|
|
912
|
-
}), i.addEventListener("paste", (
|
|
913
|
-
|
|
914
|
-
const s =
|
|
915
|
-
_.length === 0 || t.loginRequired || (
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
),
|
|
919
|
-
message:
|
|
915
|
+
}), i.addEventListener("paste", (a) => {
|
|
916
|
+
a.stopPropagation();
|
|
917
|
+
const s = a.clipboardData, _ = Array.from(s?.files ?? []);
|
|
918
|
+
_.length === 0 || t.loginRequired || (a.preventDefault(), It(_).catch((I) => {
|
|
919
|
+
Lt(
|
|
920
|
+
I instanceof Error ? I.message : "Failed to attach file"
|
|
921
|
+
), ne("web-sdk.widget", "Attachment failed", {
|
|
922
|
+
message: I instanceof Error ? I.message : String(I)
|
|
920
923
|
});
|
|
921
924
|
}));
|
|
922
|
-
}),
|
|
925
|
+
}), J.addEventListener("click", () => {
|
|
923
926
|
if (t.loginRequired) {
|
|
924
927
|
t.onLoginClick?.();
|
|
925
928
|
return;
|
|
926
929
|
}
|
|
927
|
-
if (
|
|
928
|
-
|
|
930
|
+
if (b.getState().isThinking) {
|
|
931
|
+
b.stop();
|
|
929
932
|
return;
|
|
930
933
|
}
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
),
|
|
936
|
-
}),
|
|
937
|
-
|
|
938
|
-
}),
|
|
939
|
-
|
|
940
|
-
}),
|
|
941
|
-
|
|
942
|
-
}),
|
|
943
|
-
if (!(
|
|
944
|
-
if (
|
|
934
|
+
he = !0, ee(!0, "send"), te(), q = Ht(
|
|
935
|
+
b,
|
|
936
|
+
w,
|
|
937
|
+
q
|
|
938
|
+
), Pe(), K(), F(b.getState());
|
|
939
|
+
}), pe.addEventListener("click", () => {
|
|
940
|
+
me = !me, Be = null, Ce(), me && fe.length === 0 && dn(null);
|
|
941
|
+
}), ge.addEventListener("click", () => {
|
|
942
|
+
me = !1, Ce();
|
|
943
|
+
}), V.addEventListener("scroll", Bo), w.addEventListener("input", () => {
|
|
944
|
+
Ye(w), B(), K(), Xo();
|
|
945
|
+
}), w.addEventListener("keydown", (a) => {
|
|
946
|
+
if (!(a.key !== "Enter" || a.shiftKey)) {
|
|
947
|
+
if (a.preventDefault(), t.loginRequired) {
|
|
945
948
|
t.onLoginClick?.();
|
|
946
949
|
return;
|
|
947
950
|
}
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
),
|
|
953
|
-
}
|
|
954
|
-
}), i.addEventListener("click", (
|
|
955
|
-
(
|
|
956
|
-
}), l.composerValue && (
|
|
957
|
-
const
|
|
958
|
-
let
|
|
959
|
-
const
|
|
960
|
-
let
|
|
961
|
-
const
|
|
962
|
-
|
|
963
|
-
},
|
|
964
|
-
|
|
965
|
-
},
|
|
966
|
-
if (!
|
|
951
|
+
he = !0, ee(!0, "send"), te(), q = Ht(
|
|
952
|
+
b,
|
|
953
|
+
w,
|
|
954
|
+
q
|
|
955
|
+
), Pe(), K(), F(b.getState());
|
|
956
|
+
}
|
|
957
|
+
}), i.addEventListener("click", (a) => {
|
|
958
|
+
(a.target instanceof Element ? a.target : null)?.closest("a[href]") && B();
|
|
959
|
+
}), l.composerValue && (w.value = l.composerValue, Ye(w)), t.initialDisplayState === "minimized" ? He("minimized", !1) : t.initialDisplayState === void 0 && l.isOpen && we(w.value, !1), wa(l, i, C, w);
|
|
960
|
+
const at = () => r;
|
|
961
|
+
let Pt = b.getState().appearance !== null, rt = null, je = null, Ne = null, _n = b.getState().isThinking, Re = null;
|
|
962
|
+
const Ve = t.taskNotifications;
|
|
963
|
+
let De = null, ze = !1;
|
|
964
|
+
const xn = () => {
|
|
965
|
+
De !== null && (window.clearTimeout(De), De = null);
|
|
966
|
+
}, lt = () => {
|
|
967
|
+
S && (S.hidden = !0);
|
|
968
|
+
}, yn = () => b.getState().assistantDraft.trim().length > 0, Ko = async () => {
|
|
969
|
+
if (!Ve || !S || ze || Ae || !b.getState().isThinking || yn())
|
|
967
970
|
return;
|
|
968
|
-
let
|
|
971
|
+
let a;
|
|
969
972
|
try {
|
|
970
|
-
|
|
973
|
+
a = await Ve.getState();
|
|
971
974
|
} catch {
|
|
972
975
|
return;
|
|
973
976
|
}
|
|
974
|
-
|
|
977
|
+
a.enabled || a.neverSuggest || !b.getState().isThinking || yn() || ze || Ae || (S.hidden = !1);
|
|
975
978
|
};
|
|
976
|
-
|
|
977
|
-
|
|
979
|
+
N?.addEventListener("click", () => {
|
|
980
|
+
ze = !0, lt(), Ve?.enable().catch(() => {
|
|
978
981
|
});
|
|
979
|
-
}),
|
|
980
|
-
|
|
982
|
+
}), Ro?.addEventListener("click", () => {
|
|
983
|
+
ze = !0, lt();
|
|
981
984
|
}), Do?.addEventListener("click", () => {
|
|
982
|
-
|
|
985
|
+
ze = !0, lt(), Ve?.dismissForever().catch(() => {
|
|
983
986
|
});
|
|
984
987
|
});
|
|
985
|
-
let
|
|
988
|
+
let Me = null, vn = () => {
|
|
986
989
|
};
|
|
987
|
-
const Yo = !!t.socialPostDraftHandler,
|
|
988
|
-
const
|
|
989
|
-
|
|
990
|
+
const Yo = !!t.socialPostDraftHandler, Tt = /* @__PURE__ */ new Map(), At = () => w.value.trim().length > 0 || q.length > 0, Xo = () => {
|
|
991
|
+
const a = Me !== null && qt(b.getState(), At());
|
|
992
|
+
$.hidden = !a, a && Me !== null && bo($, Me);
|
|
990
993
|
};
|
|
991
|
-
let
|
|
992
|
-
const
|
|
993
|
-
|
|
994
|
-
},
|
|
995
|
-
if (!
|
|
996
|
-
|
|
994
|
+
let Oe = null;
|
|
995
|
+
const Nt = (a = {}) => {
|
|
996
|
+
he = !0, ee(!0, "newSession"), te(), me = !1, Ce(), b.startNewSession(a), _t.clear(), w.value = "", q = [], Pe(), Ye(w), B(), K(), w.focus(), F(b.getState());
|
|
997
|
+
}, Rt = (a) => {
|
|
998
|
+
if (!a) {
|
|
999
|
+
Oe?.remove(), Oe = null;
|
|
997
1000
|
return;
|
|
998
1001
|
}
|
|
999
|
-
|
|
1002
|
+
Oe || (Oe = wt(
|
|
1000
1003
|
"pluno-pa-widget__new-chat",
|
|
1001
1004
|
"New chat",
|
|
1002
1005
|
za(),
|
|
1003
1006
|
!1
|
|
1004
|
-
),
|
|
1005
|
-
},
|
|
1006
|
-
if (
|
|
1007
|
-
|
|
1007
|
+
), Oe.addEventListener("click", () => Nt()), Je.insertBefore(Oe, pe));
|
|
1008
|
+
}, F = (a) => {
|
|
1009
|
+
if (Ce(), pn(a.lastErrorCode) ? Re = a.lastErrorCode : t.billingStatus?.creditsUsed !== null && !re(t.billingStatus) && (Re = null), $t(
|
|
1010
|
+
Ie,
|
|
1008
1011
|
t.billingStatus,
|
|
1009
|
-
|
|
1012
|
+
Re
|
|
1010
1013
|
), t.loginRequired) {
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1014
|
+
Tt.clear(), Xn(
|
|
1015
|
+
P,
|
|
1016
|
+
J,
|
|
1017
|
+
Rt,
|
|
1018
|
+
at,
|
|
1016
1019
|
"Log in to use Pluno on this page.",
|
|
1017
1020
|
t.loginButtonLabel,
|
|
1018
1021
|
t.loginUrl,
|
|
@@ -1021,11 +1024,11 @@ async function ta(e = {}) {
|
|
|
1021
1024
|
return;
|
|
1022
1025
|
}
|
|
1023
1026
|
if (t.signupRequired) {
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1027
|
+
Tt.clear(), Xn(
|
|
1028
|
+
P,
|
|
1029
|
+
J,
|
|
1030
|
+
Rt,
|
|
1031
|
+
at,
|
|
1029
1032
|
"Complete signup to unlock your free trial credits.",
|
|
1030
1033
|
t.signupButtonLabel,
|
|
1031
1034
|
t.signupUrl,
|
|
@@ -1033,67 +1036,75 @@ async function ta(e = {}) {
|
|
|
1033
1036
|
);
|
|
1034
1037
|
return;
|
|
1035
1038
|
}
|
|
1036
|
-
const s = _a(
|
|
1037
|
-
|
|
1038
|
-
const
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
() =>
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
(
|
|
1055
|
-
|
|
1039
|
+
const s = _a(a), _ = s !== sn;
|
|
1040
|
+
sn = s;
|
|
1041
|
+
const I = he || ye.enabled;
|
|
1042
|
+
he = !1, Qa(
|
|
1043
|
+
P,
|
|
1044
|
+
j,
|
|
1045
|
+
J,
|
|
1046
|
+
Rt,
|
|
1047
|
+
$,
|
|
1048
|
+
a,
|
|
1049
|
+
Me,
|
|
1050
|
+
Me !== null && qt(a, At()),
|
|
1051
|
+
I,
|
|
1052
|
+
() => ye.enabled,
|
|
1053
|
+
_t,
|
|
1054
|
+
Tt,
|
|
1055
|
+
B,
|
|
1056
|
+
at,
|
|
1057
|
+
(z) => {
|
|
1058
|
+
const Ke = t.morningReport !== null;
|
|
1059
|
+
t.morningReport = null, Ke && (t.onMorningReportTaskStart?.(), Nt()), he = !0, ee(!0, "send"), te(), b.sendMessage(z);
|
|
1060
|
+
},
|
|
1061
|
+
() => {
|
|
1062
|
+
he = !0, ee(!0, "send"), te(), b.retryLastMessage();
|
|
1056
1063
|
},
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
+
t.morningReport,
|
|
1065
|
+
() => {
|
|
1066
|
+
t.morningReport = null, t.onMorningReportSnooze?.(), St(), F(b.getState());
|
|
1067
|
+
},
|
|
1068
|
+
Yo && !xt ? {
|
|
1069
|
+
dismissedCandidateIds: et,
|
|
1070
|
+
draftingCandidateId: rt,
|
|
1071
|
+
error: je,
|
|
1072
|
+
characterIconOptions: at(),
|
|
1073
|
+
onSeen: (z) => {
|
|
1074
|
+
Te.add(z.id), B();
|
|
1064
1075
|
},
|
|
1065
|
-
onDraft: (
|
|
1066
|
-
Zo(
|
|
1076
|
+
onDraft: (z) => {
|
|
1077
|
+
Zo(z);
|
|
1067
1078
|
},
|
|
1068
|
-
onDismiss: (
|
|
1069
|
-
|
|
1079
|
+
onDismiss: (z) => {
|
|
1080
|
+
Te.add(z.id), et.add(z.id), B(), je = null, F(b.getState());
|
|
1070
1081
|
},
|
|
1071
|
-
onDisable: (
|
|
1072
|
-
|
|
1082
|
+
onDisable: (z) => {
|
|
1083
|
+
xt = !0, Te.add(z.id), et.add(z.id), B(), Cr(t, !0), je = null, F(b.getState());
|
|
1073
1084
|
}
|
|
1074
1085
|
} : void 0
|
|
1075
|
-
),
|
|
1086
|
+
), I ? (ve = P.scrollTop, te()) : _ && xa(a) && Oo();
|
|
1076
1087
|
};
|
|
1077
|
-
return
|
|
1078
|
-
(
|
|
1079
|
-
|
|
1088
|
+
return vn = fi(
|
|
1089
|
+
(a) => {
|
|
1090
|
+
Me = a, !Ae && qt(b.getState(), At()) && F(b.getState());
|
|
1080
1091
|
},
|
|
1081
1092
|
{
|
|
1082
1093
|
backendUrl: t.backendUrl,
|
|
1083
|
-
fetcher:
|
|
1094
|
+
fetcher: Mo,
|
|
1084
1095
|
loader: t.activeUsersLoader
|
|
1085
1096
|
}
|
|
1086
|
-
),
|
|
1087
|
-
const s =
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
}, yi)), (!
|
|
1097
|
+
), b.on("state", (a) => {
|
|
1098
|
+
const s = _n && !a.isThinking;
|
|
1099
|
+
_n = a.isThinking, a.isThinking && !a.assistantDraft.trim() && Ve && !ze && De === null && S?.hidden !== !1 && (De = window.setTimeout(() => {
|
|
1100
|
+
De = null, Ko();
|
|
1101
|
+
}, yi)), (!a.isThinking || a.assistantDraft.trim()) && (xn(), lt()), s && !i.classList.contains("pluno-pa-widget--open") && ($e = !0), kt(), a.appearance ? (Pt = !0, ne(
|
|
1091
1102
|
"web-sdk.widget",
|
|
1092
1103
|
"Agent state supplied appearance",
|
|
1093
1104
|
{
|
|
1094
|
-
appearance:
|
|
1105
|
+
appearance: a.appearance
|
|
1095
1106
|
}
|
|
1096
|
-
),
|
|
1107
|
+
), Dt(a.appearance, "agent.state.appearance")) : Pt && (Pt = !1, ne(
|
|
1097
1108
|
"web-sdk.widget",
|
|
1098
1109
|
"Agent state cleared appearance; reverting to configured widget options",
|
|
1099
1110
|
{
|
|
@@ -1101,30 +1112,30 @@ async function ta(e = {}) {
|
|
|
1101
1112
|
fallbackColorScheme: t.colorScheme,
|
|
1102
1113
|
fallbackFontFamily: t.fontFamily
|
|
1103
1114
|
}
|
|
1104
|
-
),
|
|
1105
|
-
}),
|
|
1106
|
-
agent:
|
|
1107
|
-
startNewChat:
|
|
1115
|
+
), Dt({}, "agent.state.appearance-cleared")), F(a), K(), s && mn();
|
|
1116
|
+
}), F(b.getState()), K(), {
|
|
1117
|
+
agent: b,
|
|
1118
|
+
startNewChat: Nt,
|
|
1108
1119
|
host: n,
|
|
1109
|
-
updateAppearance: (
|
|
1110
|
-
|
|
1120
|
+
updateAppearance: (a) => {
|
|
1121
|
+
a.scribbleStyle !== void 0 && (t.scribbleStyle = a.scribbleStyle), Dt(a, "widgetHandle.updateAppearance");
|
|
1111
1122
|
},
|
|
1112
|
-
updateBillingStatus: (
|
|
1113
|
-
const s =
|
|
1114
|
-
|
|
1123
|
+
updateBillingStatus: (a) => {
|
|
1124
|
+
const s = a ?? null;
|
|
1125
|
+
jn(
|
|
1115
1126
|
t.billingStatus,
|
|
1116
1127
|
s,
|
|
1117
|
-
|
|
1118
|
-
) && (t.billingStatus = s, t.billingStatus?.creditsUsed !== null && !
|
|
1128
|
+
Re
|
|
1129
|
+
) && (t.billingStatus = s, t.billingStatus?.creditsUsed !== null && !re(t.billingStatus) && (Re = null), $t(
|
|
1119
1130
|
i.querySelector(".pluno-pa-widget__billing-status"),
|
|
1120
1131
|
t.billingStatus,
|
|
1121
|
-
|
|
1122
|
-
),
|
|
1132
|
+
Re
|
|
1133
|
+
), K());
|
|
1123
1134
|
},
|
|
1124
|
-
updateAuthGate: (
|
|
1125
|
-
const s =
|
|
1126
|
-
t.loginRequired =
|
|
1127
|
-
|
|
1135
|
+
updateAuthGate: (a) => {
|
|
1136
|
+
const s = ot();
|
|
1137
|
+
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), it(), F(b.getState()), K(), s && !ot() && b.connect().catch((_) => {
|
|
1138
|
+
ne(
|
|
1128
1139
|
"web-sdk.widget",
|
|
1129
1140
|
"Failed to connect after auth gate cleared",
|
|
1130
1141
|
{
|
|
@@ -1134,63 +1145,67 @@ async function ta(e = {}) {
|
|
|
1134
1145
|
});
|
|
1135
1146
|
},
|
|
1136
1147
|
openPanel: () => {
|
|
1137
|
-
|
|
1148
|
+
we(w.value, !1);
|
|
1138
1149
|
},
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1150
|
+
closePanel: St,
|
|
1151
|
+
updateDisplayState: (a) => {
|
|
1152
|
+
if (a === "shown") {
|
|
1153
|
+
He("shown", !1);
|
|
1142
1154
|
return;
|
|
1143
1155
|
}
|
|
1144
|
-
|
|
1156
|
+
He("minimized", !1);
|
|
1157
|
+
},
|
|
1158
|
+
updateMorningReport: (a) => {
|
|
1159
|
+
t.morningReport = a ?? null, F(b.getState());
|
|
1145
1160
|
},
|
|
1146
1161
|
destroy: () => {
|
|
1147
|
-
|
|
1162
|
+
Ae || (B(), Ae = !0, un.disconnect(), bn?.disconnect(), qo(), window.removeEventListener("resize", gn), hn(), Wo(), se !== null && window.clearTimeout(se), xn(), vn(), Ne?.remove(), b.destroy(), bt.release(), n.remove());
|
|
1148
1163
|
}
|
|
1149
1164
|
};
|
|
1150
|
-
async function Zo(
|
|
1151
|
-
if (!
|
|
1152
|
-
|
|
1165
|
+
async function Zo(a) {
|
|
1166
|
+
if (!rt) {
|
|
1167
|
+
rt = a.id, je = null, F(b.getState());
|
|
1153
1168
|
try {
|
|
1154
1169
|
if (!t.socialPostDraftHandler)
|
|
1155
1170
|
throw new Error("Social post drafting is not available here.");
|
|
1156
|
-
const s = await t.socialPostDraftHandler(
|
|
1171
|
+
const s = await t.socialPostDraftHandler(a);
|
|
1157
1172
|
if (!s.linkedinPost || !s.xPost)
|
|
1158
1173
|
throw new Error("Pluno did not return a complete social post draft.");
|
|
1159
|
-
|
|
1174
|
+
Te.add(a.id), et.add(a.id), B(), Ne?.remove(), Ne = lr(s, {
|
|
1160
1175
|
socialPostRewardsUrl: t.socialPostRewardsUrl,
|
|
1161
1176
|
onClose: () => {
|
|
1162
|
-
|
|
1177
|
+
Ne?.remove(), Ne = null;
|
|
1163
1178
|
}
|
|
1164
|
-
}), i.appendChild(
|
|
1179
|
+
}), i.appendChild(Ne);
|
|
1165
1180
|
} catch (s) {
|
|
1166
|
-
|
|
1181
|
+
je = s instanceof Error ? s.message : "Could not draft social post.";
|
|
1167
1182
|
} finally {
|
|
1168
|
-
|
|
1183
|
+
rt = null, F(b.getState());
|
|
1169
1184
|
}
|
|
1170
1185
|
}
|
|
1171
1186
|
}
|
|
1172
|
-
function
|
|
1173
|
-
const _ =
|
|
1174
|
-
|
|
1187
|
+
function Dt(a, s) {
|
|
1188
|
+
const _ = a.accentColor ?? t.accentColor, I = a.colorScheme ?? t.colorScheme, z = a.fontFamily ?? t.fontFamily, Ke = a.scribbleStyle ?? t.scribbleStyle;
|
|
1189
|
+
r = Mn(
|
|
1175
1190
|
_,
|
|
1176
|
-
|
|
1177
|
-
),
|
|
1191
|
+
Ke
|
|
1192
|
+
), On(i, r, {
|
|
1178
1193
|
accentColor: _,
|
|
1179
|
-
colorScheme:
|
|
1180
|
-
fontFamily:
|
|
1181
|
-
scribbleStyle:
|
|
1182
|
-
}),
|
|
1194
|
+
colorScheme: I,
|
|
1195
|
+
fontFamily: z,
|
|
1196
|
+
scribbleStyle: Ke
|
|
1197
|
+
}), ne("web-sdk.widget", "Updated widget appearance", {
|
|
1183
1198
|
source: s,
|
|
1184
|
-
inputAppearance:
|
|
1199
|
+
inputAppearance: a,
|
|
1185
1200
|
appliedAccentColor: _,
|
|
1186
|
-
appliedColorScheme:
|
|
1187
|
-
appliedFontFamily:
|
|
1188
|
-
appliedScribbleStyle:
|
|
1201
|
+
appliedColorScheme: I,
|
|
1202
|
+
appliedFontFamily: z,
|
|
1203
|
+
appliedScribbleStyle: Ke,
|
|
1189
1204
|
cssAccent: i.style.getPropertyValue("--pluno-pa-accent")
|
|
1190
1205
|
});
|
|
1191
1206
|
}
|
|
1192
1207
|
}
|
|
1193
|
-
function
|
|
1208
|
+
function Mn(e, t) {
|
|
1194
1209
|
return { accentColor: e, scribbleStyle: t };
|
|
1195
1210
|
}
|
|
1196
1211
|
function na(e) {
|
|
@@ -1211,12 +1226,12 @@ function oa(e) {
|
|
|
1211
1226
|
}
|
|
1212
1227
|
function ia([e, t, n]) {
|
|
1213
1228
|
const o = (i) => {
|
|
1214
|
-
const
|
|
1215
|
-
return
|
|
1229
|
+
const r = i / 255;
|
|
1230
|
+
return r <= 0.03928 ? r / 12.92 : ((r + 0.055) / 1.055) ** 2.4;
|
|
1216
1231
|
};
|
|
1217
1232
|
return 0.2126 * o(e) + 0.7152 * o(t) + 0.0722 * o(n);
|
|
1218
1233
|
}
|
|
1219
|
-
function
|
|
1234
|
+
function On(e, t, n) {
|
|
1220
1235
|
e.classList.toggle(
|
|
1221
1236
|
"pluno-pa-widget--dark",
|
|
1222
1237
|
n.colorScheme === "dark"
|
|
@@ -1224,7 +1239,7 @@ function zn(e, t, n) {
|
|
|
1224
1239
|
"pluno-pa-widget--light",
|
|
1225
1240
|
n.colorScheme !== "dark"
|
|
1226
1241
|
), e.classList.toggle("pluno-pa-widget--scribble", n.scribbleStyle);
|
|
1227
|
-
const o = n.scribbleStyle ?
|
|
1242
|
+
const o = n.scribbleStyle ? no(n.accentColor) : n.accentColor;
|
|
1228
1243
|
e.style.setProperty("--pluno-pa-accent", o), n.scribbleStyle ? e.style.setProperty(
|
|
1229
1244
|
"--pluno-pa-accent-contrast",
|
|
1230
1245
|
na(o)
|
|
@@ -1232,19 +1247,19 @@ function zn(e, t, n) {
|
|
|
1232
1247
|
const i = Array.from(
|
|
1233
1248
|
e.querySelectorAll(".pluno-pa-widget__character")
|
|
1234
1249
|
);
|
|
1235
|
-
for (const
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
Array.from(
|
|
1250
|
+
for (const r of i)
|
|
1251
|
+
r.replaceWith(
|
|
1252
|
+
_e(
|
|
1253
|
+
Array.from(r.classList).join(" "),
|
|
1239
1254
|
t
|
|
1240
1255
|
)
|
|
1241
1256
|
);
|
|
1242
1257
|
}
|
|
1243
1258
|
function aa(e) {
|
|
1244
|
-
if (e.getElementById(
|
|
1259
|
+
if (e.getElementById(Nn))
|
|
1245
1260
|
return;
|
|
1246
1261
|
const t = e.createElement("style");
|
|
1247
|
-
t.id =
|
|
1262
|
+
t.id = Nn, t.textContent = `@font-face {
|
|
1248
1263
|
font-family: "Architects Daughter";
|
|
1249
1264
|
font-style: normal;
|
|
1250
1265
|
font-weight: 400;
|
|
@@ -1258,40 +1273,40 @@ function ra({
|
|
|
1258
1273
|
launcherDragHandle: n,
|
|
1259
1274
|
getPosition: o,
|
|
1260
1275
|
setPosition: i,
|
|
1261
|
-
persist:
|
|
1276
|
+
persist: r
|
|
1262
1277
|
}) {
|
|
1263
1278
|
let l = null, p = null, d = null, c = !1, u = null;
|
|
1264
1279
|
const m = () => {
|
|
1265
1280
|
l = null, p = null, d = null, c = !1, e.classList.remove("pluno-pa-widget--dragging");
|
|
1266
|
-
},
|
|
1281
|
+
}, k = (h) => {
|
|
1267
1282
|
e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing") || (h.preventDefault(), h.stopPropagation(), l = h.pointerId, p = { x: h.clientX, y: h.clientY }, d = o(), c = !1, t.setPointerCapture?.(h.pointerId));
|
|
1268
1283
|
}, v = (h) => {
|
|
1269
1284
|
if (l !== h.pointerId || !p || !d)
|
|
1270
1285
|
return;
|
|
1271
1286
|
h.preventDefault();
|
|
1272
|
-
const
|
|
1273
|
-
!c && Math.hypot(
|
|
1274
|
-
},
|
|
1275
|
-
l === h.pointerId && (h.preventDefault(), h.stopPropagation(), c && (u = { x: h.clientX, y: h.clientY },
|
|
1276
|
-
},
|
|
1287
|
+
const A = h.clientX - p.x, L = h.clientY - p.y;
|
|
1288
|
+
!c && Math.hypot(A, L) < Jt || (c = !0, e.classList.add("pluno-pa-widget--dragging"), i({ x: d.x + A, y: d.y + L }));
|
|
1289
|
+
}, R = (h) => {
|
|
1290
|
+
l === h.pointerId && (h.preventDefault(), h.stopPropagation(), c && (u = { x: h.clientX, y: h.clientY }, r()), m());
|
|
1291
|
+
}, C = (h) => {
|
|
1277
1292
|
l === h.pointerId && (h.preventDefault(), m());
|
|
1278
1293
|
}, g = (h) => {
|
|
1279
1294
|
if (!u)
|
|
1280
1295
|
return;
|
|
1281
|
-
const
|
|
1296
|
+
const A = Math.hypot(
|
|
1282
1297
|
h.clientX - u.x,
|
|
1283
1298
|
h.clientY - u.y
|
|
1284
|
-
) <=
|
|
1285
|
-
u = null,
|
|
1286
|
-
},
|
|
1299
|
+
) <= Jt;
|
|
1300
|
+
u = null, A && (h.preventDefault(), h.stopPropagation());
|
|
1301
|
+
}, y = (h) => {
|
|
1287
1302
|
if (e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing"))
|
|
1288
1303
|
return;
|
|
1289
|
-
const
|
|
1290
|
-
let
|
|
1291
|
-
h.key === "ArrowUp" ?
|
|
1304
|
+
const A = h.shiftKey ? go : uo, L = o();
|
|
1305
|
+
let M = null;
|
|
1306
|
+
h.key === "ArrowUp" ? M = { x: L.x, y: L.y - A } : h.key === "ArrowDown" ? M = { x: L.x, y: L.y + A } : h.key === "ArrowLeft" ? M = { x: L.x - A, y: L.y } : h.key === "ArrowRight" && (M = { x: L.x + A, y: L.y }), M && (h.preventDefault(), h.stopPropagation(), i(M), r());
|
|
1292
1307
|
};
|
|
1293
|
-
return t.addEventListener("pointerdown",
|
|
1294
|
-
t.removeEventListener("pointerdown",
|
|
1308
|
+
return t.addEventListener("pointerdown", k), t.addEventListener("pointermove", v), t.addEventListener("pointerup", R), t.addEventListener("pointercancel", C), t.addEventListener("click", g, !0), n.addEventListener("keydown", y), () => {
|
|
1309
|
+
t.removeEventListener("pointerdown", k), t.removeEventListener("pointermove", v), t.removeEventListener("pointerup", R), t.removeEventListener("pointercancel", C), t.removeEventListener("click", g, !0), n.removeEventListener("keydown", y);
|
|
1295
1310
|
};
|
|
1296
1311
|
}
|
|
1297
1312
|
function la({
|
|
@@ -1301,243 +1316,243 @@ function la({
|
|
|
1301
1316
|
setBounds: o,
|
|
1302
1317
|
persist: i
|
|
1303
1318
|
}) {
|
|
1304
|
-
let
|
|
1319
|
+
let r = null, l = null, p = null, d = null, c = !1;
|
|
1305
1320
|
const u = () => {
|
|
1306
|
-
|
|
1321
|
+
r = null, l = null, p = null, d = null, c = !1, e.classList.remove("pluno-pa-widget--resizing");
|
|
1307
1322
|
}, m = (g) => {
|
|
1308
|
-
const
|
|
1309
|
-
!e.classList.contains("pluno-pa-widget--open") || !
|
|
1310
|
-
},
|
|
1311
|
-
if (
|
|
1323
|
+
const y = g.currentTarget, h = y.dataset.resizeDirection;
|
|
1324
|
+
!e.classList.contains("pluno-pa-widget--open") || !Un(h) || (g.preventDefault(), g.stopPropagation(), r = g.pointerId, l = h, p = { x: g.clientX, y: g.clientY }, d = n(), c = !1, y.setPointerCapture?.(g.pointerId));
|
|
1325
|
+
}, k = (g) => {
|
|
1326
|
+
if (r !== g.pointerId || !l || !p || !d)
|
|
1312
1327
|
return;
|
|
1313
1328
|
g.preventDefault(), g.stopPropagation();
|
|
1314
|
-
const
|
|
1315
|
-
!c && Math.hypot(
|
|
1316
|
-
|
|
1329
|
+
const y = g.clientX - p.x, h = g.clientY - p.y;
|
|
1330
|
+
!c && Math.hypot(y, h) < Jt || (c = !0, e.classList.add("pluno-pa-widget--resizing"), o(
|
|
1331
|
+
Bn(d, l, y, h)
|
|
1317
1332
|
));
|
|
1318
1333
|
}, v = (g) => {
|
|
1319
|
-
|
|
1320
|
-
},
|
|
1321
|
-
|
|
1322
|
-
},
|
|
1323
|
-
const h = g.currentTarget.dataset.resizeDirection,
|
|
1324
|
-
let
|
|
1325
|
-
|
|
1334
|
+
r === g.pointerId && (g.preventDefault(), g.stopPropagation(), c && i(), u());
|
|
1335
|
+
}, R = (g) => {
|
|
1336
|
+
r === g.pointerId && (g.preventDefault(), u());
|
|
1337
|
+
}, C = (g) => {
|
|
1338
|
+
const h = g.currentTarget.dataset.resizeDirection, A = g.shiftKey ? go : uo, L = n();
|
|
1339
|
+
let M = 0, U = 0;
|
|
1340
|
+
Un(h) && (g.key === "ArrowLeft" ? M = -A : g.key === "ArrowRight" ? M = A : g.key === "ArrowUp" ? U = -A : g.key === "ArrowDown" && (U = A), !(M === 0 && U === 0) && (g.preventDefault(), g.stopPropagation(), o(Bn(L, h, M, U)), i()));
|
|
1326
1341
|
};
|
|
1327
1342
|
for (const g of t)
|
|
1328
|
-
g.addEventListener("pointerdown", m), g.addEventListener("pointermove",
|
|
1343
|
+
g.addEventListener("pointerdown", m), g.addEventListener("pointermove", k), g.addEventListener("pointerup", v), g.addEventListener("pointercancel", R), g.addEventListener("keydown", C);
|
|
1329
1344
|
return () => {
|
|
1330
1345
|
for (const g of t)
|
|
1331
|
-
g.removeEventListener("pointerdown", m), g.removeEventListener("pointermove",
|
|
1346
|
+
g.removeEventListener("pointerdown", m), g.removeEventListener("pointermove", k), g.removeEventListener("pointerup", v), g.removeEventListener("pointercancel", R), g.removeEventListener("keydown", C);
|
|
1332
1347
|
};
|
|
1333
1348
|
}
|
|
1334
|
-
function
|
|
1349
|
+
function Un(e) {
|
|
1335
1350
|
return e === "left" || e === "right" || e === "top" || e === "bottom" || e === "top-left" || e === "top-right" || e === "bottom-left" || e === "bottom-right";
|
|
1336
1351
|
}
|
|
1337
|
-
function
|
|
1338
|
-
const i =
|
|
1352
|
+
function Bn(e, t, n, o) {
|
|
1353
|
+
const i = Z(), r = Fn({
|
|
1339
1354
|
leading: e.position.x,
|
|
1340
1355
|
length: e.size.width,
|
|
1341
1356
|
delta: n,
|
|
1342
1357
|
resizeLeading: t.endsWith("left") || t === "left",
|
|
1343
1358
|
resizeTrailing: t.endsWith("right") || t === "right",
|
|
1344
|
-
minLeading:
|
|
1345
|
-
maxTrailing: i.width -
|
|
1359
|
+
minLeading: T,
|
|
1360
|
+
maxTrailing: i.width - T,
|
|
1346
1361
|
minLength: Math.min(
|
|
1347
|
-
|
|
1348
|
-
i.width -
|
|
1362
|
+
an,
|
|
1363
|
+
i.width - T * 2
|
|
1349
1364
|
)
|
|
1350
|
-
}), l =
|
|
1365
|
+
}), l = Fn({
|
|
1351
1366
|
leading: e.position.y,
|
|
1352
1367
|
length: e.size.height,
|
|
1353
1368
|
delta: o,
|
|
1354
1369
|
resizeLeading: t.startsWith("top") || t === "top",
|
|
1355
1370
|
resizeTrailing: t.startsWith("bottom") || t === "bottom",
|
|
1356
|
-
minLeading:
|
|
1357
|
-
maxTrailing: i.height -
|
|
1371
|
+
minLeading: Le,
|
|
1372
|
+
maxTrailing: i.height - T,
|
|
1358
1373
|
minLength: Math.min(
|
|
1359
|
-
|
|
1360
|
-
i.height -
|
|
1374
|
+
rn,
|
|
1375
|
+
i.height - Le - T
|
|
1361
1376
|
)
|
|
1362
1377
|
});
|
|
1363
1378
|
return {
|
|
1364
|
-
position: { x:
|
|
1365
|
-
size: { width:
|
|
1379
|
+
position: { x: r.leading, y: l.leading },
|
|
1380
|
+
size: { width: r.length, height: l.length }
|
|
1366
1381
|
};
|
|
1367
1382
|
}
|
|
1368
|
-
function
|
|
1383
|
+
function Fn({
|
|
1369
1384
|
leading: e,
|
|
1370
1385
|
length: t,
|
|
1371
1386
|
delta: n,
|
|
1372
1387
|
resizeLeading: o,
|
|
1373
1388
|
resizeTrailing: i,
|
|
1374
|
-
minLeading:
|
|
1389
|
+
minLeading: r,
|
|
1375
1390
|
maxTrailing: l,
|
|
1376
1391
|
minLength: p
|
|
1377
1392
|
}) {
|
|
1378
1393
|
const d = e + t;
|
|
1379
1394
|
if (o) {
|
|
1380
1395
|
const c = e + n;
|
|
1381
|
-
if (c >=
|
|
1382
|
-
const m =
|
|
1396
|
+
if (c >= r) {
|
|
1397
|
+
const m = X(c, r, d - p);
|
|
1383
1398
|
return { leading: m, length: d - m };
|
|
1384
1399
|
}
|
|
1385
|
-
const u =
|
|
1386
|
-
d +
|
|
1400
|
+
const u = X(
|
|
1401
|
+
d + r - c,
|
|
1387
1402
|
d,
|
|
1388
1403
|
l
|
|
1389
1404
|
);
|
|
1390
|
-
return { leading:
|
|
1405
|
+
return { leading: r, length: u - r };
|
|
1391
1406
|
}
|
|
1392
1407
|
if (i) {
|
|
1393
1408
|
const c = d + n;
|
|
1394
1409
|
if (c <= l) {
|
|
1395
|
-
const m =
|
|
1410
|
+
const m = X(
|
|
1396
1411
|
c,
|
|
1397
1412
|
e + p,
|
|
1398
1413
|
l
|
|
1399
1414
|
);
|
|
1400
1415
|
return { leading: e, length: m - e };
|
|
1401
1416
|
}
|
|
1402
|
-
const u =
|
|
1417
|
+
const u = X(
|
|
1403
1418
|
e - (c - l),
|
|
1404
|
-
|
|
1419
|
+
r,
|
|
1405
1420
|
e
|
|
1406
1421
|
);
|
|
1407
1422
|
return { leading: u, length: l - u };
|
|
1408
1423
|
}
|
|
1409
1424
|
return { leading: e, length: t };
|
|
1410
1425
|
}
|
|
1411
|
-
function
|
|
1412
|
-
const n =
|
|
1426
|
+
function ht(e, t = !0) {
|
|
1427
|
+
const n = Z();
|
|
1413
1428
|
if (e.classList.contains("pluno-pa-widget--minimized"))
|
|
1414
1429
|
return e.classList.contains("pluno-pa-widget--scribble") ? {
|
|
1415
1430
|
width: Hi,
|
|
1416
1431
|
height: Wi
|
|
1417
|
-
} : { width:
|
|
1432
|
+
} : { width: Rn, height: Rn };
|
|
1418
1433
|
const o = e.getBoundingClientRect(), i = !e.classList.contains("pluno-pa-widget--open") && !e.classList.contains("pluno-pa-widget--closing");
|
|
1419
1434
|
return {
|
|
1420
|
-
width: t && i && o.width > 0 ? o.width : Math.min(
|
|
1421
|
-
height: t && i && o.height > 0 ? o.height : e.classList.contains("pluno-pa-widget--scribble") ? $i :
|
|
1435
|
+
width: t && i && o.width > 0 ? o.width : Math.min(po, n.width - 36),
|
|
1436
|
+
height: t && i && o.height > 0 ? o.height : e.classList.contains("pluno-pa-widget--scribble") ? $i : so
|
|
1422
1437
|
};
|
|
1423
1438
|
}
|
|
1424
1439
|
function pa() {
|
|
1425
|
-
const e =
|
|
1440
|
+
const e = Z();
|
|
1426
1441
|
return {
|
|
1427
1442
|
width: Math.min(
|
|
1428
|
-
|
|
1443
|
+
X(
|
|
1429
1444
|
e.width * ji,
|
|
1430
|
-
|
|
1445
|
+
an,
|
|
1431
1446
|
qi
|
|
1432
1447
|
),
|
|
1433
|
-
e.width -
|
|
1448
|
+
e.width - T * 2
|
|
1434
1449
|
),
|
|
1435
1450
|
height: Math.min(
|
|
1436
|
-
|
|
1451
|
+
X(
|
|
1437
1452
|
e.height * Ki,
|
|
1438
|
-
|
|
1453
|
+
rn,
|
|
1439
1454
|
Vi
|
|
1440
1455
|
),
|
|
1441
|
-
e.height -
|
|
1456
|
+
e.height - Le - T
|
|
1442
1457
|
)
|
|
1443
1458
|
};
|
|
1444
1459
|
}
|
|
1445
|
-
function
|
|
1446
|
-
return e ?
|
|
1460
|
+
function Ue(e = null) {
|
|
1461
|
+
return e ? ft(e) : pa();
|
|
1447
1462
|
}
|
|
1448
|
-
function
|
|
1449
|
-
const t =
|
|
1463
|
+
function ft(e) {
|
|
1464
|
+
const t = Z();
|
|
1450
1465
|
return {
|
|
1451
|
-
width:
|
|
1466
|
+
width: X(
|
|
1452
1467
|
e.width,
|
|
1453
1468
|
Math.min(
|
|
1454
|
-
|
|
1455
|
-
t.width -
|
|
1469
|
+
an,
|
|
1470
|
+
t.width - T * 2
|
|
1456
1471
|
),
|
|
1457
1472
|
Math.max(
|
|
1458
|
-
|
|
1459
|
-
t.width -
|
|
1473
|
+
T,
|
|
1474
|
+
t.width - T * 2
|
|
1460
1475
|
)
|
|
1461
1476
|
),
|
|
1462
|
-
height:
|
|
1477
|
+
height: X(
|
|
1463
1478
|
e.height,
|
|
1464
1479
|
Math.min(
|
|
1465
|
-
|
|
1466
|
-
t.height -
|
|
1480
|
+
rn,
|
|
1481
|
+
t.height - Le - T
|
|
1467
1482
|
),
|
|
1468
1483
|
Math.max(
|
|
1469
|
-
|
|
1470
|
-
t.height -
|
|
1484
|
+
T,
|
|
1485
|
+
t.height - Le - T
|
|
1471
1486
|
)
|
|
1472
1487
|
)
|
|
1473
1488
|
};
|
|
1474
1489
|
}
|
|
1475
|
-
function
|
|
1490
|
+
function Ot(e, t) {
|
|
1476
1491
|
if (!t) {
|
|
1477
1492
|
e.style.removeProperty("--pluno-pa-panel-width"), e.style.removeProperty("--pluno-pa-panel-height");
|
|
1478
1493
|
return;
|
|
1479
1494
|
}
|
|
1480
|
-
const n =
|
|
1495
|
+
const n = ft(t);
|
|
1481
1496
|
e.style.setProperty("--pluno-pa-panel-width", `${n.width}px`), e.style.setProperty("--pluno-pa-panel-height", `${n.height}px`);
|
|
1482
1497
|
}
|
|
1483
1498
|
function sa(e, t, n) {
|
|
1484
1499
|
const o = Number.parseFloat(e.style.left), i = Number.parseFloat(e.style.top);
|
|
1485
1500
|
if (Number.isFinite(o) && Number.isFinite(i))
|
|
1486
1501
|
return { x: o, y: i };
|
|
1487
|
-
const
|
|
1488
|
-
if (
|
|
1489
|
-
return { x:
|
|
1490
|
-
const l =
|
|
1502
|
+
const r = e.getBoundingClientRect();
|
|
1503
|
+
if (r.width > 0 || r.height > 0)
|
|
1504
|
+
return { x: r.left, y: r.top };
|
|
1505
|
+
const l = Z();
|
|
1491
1506
|
return {
|
|
1492
1507
|
x: t === "bottom-left" ? 26 : l.width - 26 - n.width,
|
|
1493
1508
|
y: l.height - 24 - n.height
|
|
1494
1509
|
};
|
|
1495
1510
|
}
|
|
1496
|
-
function
|
|
1497
|
-
const o =
|
|
1498
|
-
return t ?
|
|
1511
|
+
function Ut(e, t, n) {
|
|
1512
|
+
const o = ht(e, !1);
|
|
1513
|
+
return t ? Qt(
|
|
1499
1514
|
e,
|
|
1500
|
-
|
|
1515
|
+
fo(t, o),
|
|
1501
1516
|
o
|
|
1502
1517
|
) : da(n === "bottom-left" ? "bottom-left" : "bottom-right", o, Gi);
|
|
1503
1518
|
}
|
|
1504
1519
|
function da(e, t, n) {
|
|
1505
|
-
const o =
|
|
1520
|
+
const o = Z();
|
|
1506
1521
|
return {
|
|
1507
1522
|
x: e.endsWith("right") ? Math.max(0, o.width - t.width - n) : n,
|
|
1508
1523
|
y: e.startsWith("bottom") ? Math.max(0, o.height - t.height - n) : n
|
|
1509
1524
|
};
|
|
1510
1525
|
}
|
|
1511
|
-
function
|
|
1512
|
-
const o =
|
|
1526
|
+
function Qt(e, t, n) {
|
|
1527
|
+
const o = Z(), i = T + ga(e);
|
|
1513
1528
|
return {
|
|
1514
|
-
x:
|
|
1529
|
+
x: X(
|
|
1515
1530
|
t.x,
|
|
1516
|
-
|
|
1531
|
+
T,
|
|
1517
1532
|
Math.max(
|
|
1518
|
-
|
|
1519
|
-
o.width - n.width -
|
|
1533
|
+
T,
|
|
1534
|
+
o.width - n.width - T
|
|
1520
1535
|
)
|
|
1521
1536
|
),
|
|
1522
|
-
y:
|
|
1537
|
+
y: X(
|
|
1523
1538
|
t.y,
|
|
1524
1539
|
i,
|
|
1525
1540
|
Math.max(
|
|
1526
1541
|
i,
|
|
1527
|
-
o.height - n.height -
|
|
1542
|
+
o.height - n.height - T
|
|
1528
1543
|
)
|
|
1529
1544
|
)
|
|
1530
1545
|
};
|
|
1531
1546
|
}
|
|
1532
|
-
function
|
|
1533
|
-
const n =
|
|
1547
|
+
function fo(e, t) {
|
|
1548
|
+
const n = Z();
|
|
1534
1549
|
return {
|
|
1535
1550
|
x: e.anchor.endsWith("right") ? n.width - t.width - e.x : e.x,
|
|
1536
1551
|
y: e.anchor.startsWith("bottom") ? n.height - t.height - e.y : e.y
|
|
1537
1552
|
};
|
|
1538
1553
|
}
|
|
1539
1554
|
function ca(e, t) {
|
|
1540
|
-
const n = ua(e, t), o =
|
|
1555
|
+
const n = ua(e, t), o = Z();
|
|
1541
1556
|
return {
|
|
1542
1557
|
anchor: n,
|
|
1543
1558
|
x: n.endsWith("right") ? o.width - e.x - t.width : e.x,
|
|
@@ -1545,41 +1560,41 @@ function ca(e, t) {
|
|
|
1545
1560
|
};
|
|
1546
1561
|
}
|
|
1547
1562
|
function ua(e, t) {
|
|
1548
|
-
const n =
|
|
1549
|
-
return `${
|
|
1563
|
+
const n = Z(), o = e.x + t.width / 2, r = e.y + t.height / 2 <= n.height / 2 ? "top" : "bottom", l = o <= n.width / 2 ? "left" : "right";
|
|
1564
|
+
return `${r}-${l}`;
|
|
1550
1565
|
}
|
|
1551
1566
|
function ga(e) {
|
|
1552
1567
|
return e.classList.contains("pluno-pa-widget--scribble") ? Ji : Zi;
|
|
1553
1568
|
}
|
|
1554
|
-
function
|
|
1555
|
-
const i =
|
|
1556
|
-
x: n === "bottom-left" ? t.x : t.x + i.width -
|
|
1557
|
-
y: t.y + i.height -
|
|
1569
|
+
function Bt(e, t, n, o = null) {
|
|
1570
|
+
const i = ht(e), r = Ue(o), l = {
|
|
1571
|
+
x: n === "bottom-left" ? t.x : t.x + i.width - r.width,
|
|
1572
|
+
y: t.y + i.height - r.height
|
|
1558
1573
|
};
|
|
1559
|
-
return
|
|
1574
|
+
return ct(l, r);
|
|
1560
1575
|
}
|
|
1561
|
-
function
|
|
1562
|
-
const n =
|
|
1576
|
+
function ct(e, t) {
|
|
1577
|
+
const n = Z();
|
|
1563
1578
|
return {
|
|
1564
|
-
x:
|
|
1579
|
+
x: X(
|
|
1565
1580
|
e.x,
|
|
1566
|
-
|
|
1581
|
+
T,
|
|
1567
1582
|
Math.max(
|
|
1568
|
-
|
|
1569
|
-
n.width - t.width -
|
|
1583
|
+
T,
|
|
1584
|
+
n.width - t.width - T
|
|
1570
1585
|
)
|
|
1571
1586
|
),
|
|
1572
|
-
y:
|
|
1587
|
+
y: X(
|
|
1573
1588
|
e.y,
|
|
1574
|
-
|
|
1589
|
+
Le,
|
|
1575
1590
|
Math.max(
|
|
1576
|
-
|
|
1577
|
-
n.height - t.height -
|
|
1591
|
+
Le,
|
|
1592
|
+
n.height - t.height - T
|
|
1578
1593
|
)
|
|
1579
1594
|
)
|
|
1580
1595
|
};
|
|
1581
1596
|
}
|
|
1582
|
-
function
|
|
1597
|
+
function ke(e, t) {
|
|
1583
1598
|
if (e.classList.toggle("pluno-pa-widget--custom-position", t !== null), !t) {
|
|
1584
1599
|
e.style.removeProperty("left"), e.style.removeProperty("top"), e.style.removeProperty("right"), e.style.removeProperty("bottom");
|
|
1585
1600
|
return;
|
|
@@ -1589,16 +1604,16 @@ function Ce(e, t) {
|
|
|
1589
1604
|
function ha(e, t) {
|
|
1590
1605
|
e.style.setProperty("--pluno-pa-panel-offset-x", `${t.x}px`), e.style.setProperty("--pluno-pa-panel-offset-y", `${t.y}px`);
|
|
1591
1606
|
}
|
|
1592
|
-
function
|
|
1607
|
+
function Hn(e) {
|
|
1593
1608
|
e.style.removeProperty("--pluno-pa-panel-offset-x"), e.style.removeProperty("--pluno-pa-panel-offset-y");
|
|
1594
1609
|
}
|
|
1595
|
-
function
|
|
1610
|
+
function Z() {
|
|
1596
1611
|
return {
|
|
1597
|
-
width: window.innerWidth || document.documentElement.clientWidth ||
|
|
1598
|
-
height: window.innerHeight || document.documentElement.clientHeight ||
|
|
1612
|
+
width: window.innerWidth || document.documentElement.clientWidth || po + T * 2,
|
|
1613
|
+
height: window.innerHeight || document.documentElement.clientHeight || so + T * 2
|
|
1599
1614
|
};
|
|
1600
1615
|
}
|
|
1601
|
-
function
|
|
1616
|
+
function Ft(e) {
|
|
1602
1617
|
const t = e.getBoundingClientRect();
|
|
1603
1618
|
return {
|
|
1604
1619
|
x: Math.round(t.x),
|
|
@@ -1607,10 +1622,10 @@ function Ot(e) {
|
|
|
1607
1622
|
height: Math.round(t.height)
|
|
1608
1623
|
};
|
|
1609
1624
|
}
|
|
1610
|
-
function
|
|
1625
|
+
function X(e, t, n) {
|
|
1611
1626
|
return Math.min(Math.max(e, t), n);
|
|
1612
1627
|
}
|
|
1613
|
-
function
|
|
1628
|
+
function ne(e, t, n) {
|
|
1614
1629
|
if (typeof window > "u")
|
|
1615
1630
|
return;
|
|
1616
1631
|
const o = window, i = {
|
|
@@ -1618,15 +1633,15 @@ function J(e, t, n) {
|
|
|
1618
1633
|
source: e,
|
|
1619
1634
|
message: t,
|
|
1620
1635
|
details: n
|
|
1621
|
-
},
|
|
1622
|
-
|
|
1623
|
-
new CustomEvent(
|
|
1636
|
+
}, r = o.__plunoProductAgentDiagnostics__ ?? [];
|
|
1637
|
+
r.push(i), r.length > 120 && r.splice(0, r.length - 120), o.__plunoProductAgentDiagnostics__ = r, o.__PLUNO_PRODUCT_AGENT_DIAGNOSTICS__ = () => [...r], window.dispatchEvent(
|
|
1638
|
+
new CustomEvent(Di, { detail: i })
|
|
1624
1639
|
);
|
|
1625
1640
|
}
|
|
1626
1641
|
function ma(e, t) {
|
|
1627
|
-
|
|
1642
|
+
ne("web-sdk.widget.position", e, t);
|
|
1628
1643
|
}
|
|
1629
|
-
function
|
|
1644
|
+
function Ht(e, t, n) {
|
|
1630
1645
|
const o = t.value.trim();
|
|
1631
1646
|
return !o && n.length === 0 ? n : (t.value = "", t.style.height = "22px", t.style.overflowY = "hidden", e.sendMessage(o, {
|
|
1632
1647
|
attachments: n.length > 0 ? n.map(ba) : void 0
|
|
@@ -1647,12 +1662,12 @@ function wa(e, t, n, o) {
|
|
|
1647
1662
|
function ba(e) {
|
|
1648
1663
|
return e;
|
|
1649
1664
|
}
|
|
1650
|
-
function
|
|
1665
|
+
function Ye(e) {
|
|
1651
1666
|
e.style.height = "0px";
|
|
1652
1667
|
const t = Math.max(22, Math.min(e.scrollHeight, 140));
|
|
1653
1668
|
e.style.height = `${t}px`, e.style.overflowY = e.scrollHeight > 140 ? "auto" : "hidden";
|
|
1654
1669
|
}
|
|
1655
|
-
function
|
|
1670
|
+
function Xe(e, t = () => !0) {
|
|
1656
1671
|
e.scrollTop = e.scrollHeight, window.requestAnimationFrame(() => {
|
|
1657
1672
|
t() && (e.scrollTop = e.scrollHeight);
|
|
1658
1673
|
});
|
|
@@ -1694,15 +1709,15 @@ function Ca(e, t) {
|
|
|
1694
1709
|
["hour", 36e5],
|
|
1695
1710
|
["min", 6e4]
|
|
1696
1711
|
];
|
|
1697
|
-
for (const [
|
|
1712
|
+
for (const [r, l] of i)
|
|
1698
1713
|
if (o >= l) {
|
|
1699
1714
|
const p = Math.max(1, Math.floor(o / l));
|
|
1700
|
-
return
|
|
1715
|
+
return r === "min" ? `${p} min` : `${p} ${r}${p === 1 ? "" : "s"}`;
|
|
1701
1716
|
}
|
|
1702
1717
|
return "now";
|
|
1703
1718
|
}
|
|
1704
1719
|
function Sa(e, t, n, o, i) {
|
|
1705
|
-
e.appendChild(
|
|
1720
|
+
e.appendChild(Ra()), e.appendChild(
|
|
1706
1721
|
Ea(
|
|
1707
1722
|
t,
|
|
1708
1723
|
n,
|
|
@@ -1710,10 +1725,10 @@ function Sa(e, t, n, o, i) {
|
|
|
1710
1725
|
i
|
|
1711
1726
|
)
|
|
1712
1727
|
), e.appendChild(
|
|
1713
|
-
|
|
1728
|
+
wt(
|
|
1714
1729
|
"pluno-pa-widget__close",
|
|
1715
1730
|
"Close",
|
|
1716
|
-
|
|
1731
|
+
Da(16),
|
|
1717
1732
|
!0
|
|
1718
1733
|
)
|
|
1719
1734
|
), e.appendChild(ka(n));
|
|
@@ -1725,21 +1740,21 @@ function Ea(e, t, n, o) {
|
|
|
1725
1740
|
d.type = "button", d.className = "pluno-pa-widget__launcher-drag-handle", d.setAttribute("aria-label", "Move Pluno launcher"), d.title = "Move Pluno launcher", i.appendChild(d);
|
|
1726
1741
|
}
|
|
1727
1742
|
i.appendChild(
|
|
1728
|
-
|
|
1743
|
+
xo(
|
|
1729
1744
|
"pluno-pa-widget__scribble-spirals--launcher",
|
|
1730
1745
|
10
|
|
1731
1746
|
)
|
|
1732
1747
|
), i.appendChild(
|
|
1733
|
-
|
|
1748
|
+
_e(
|
|
1734
1749
|
"pluno-pa-widget__character--launcher",
|
|
1735
1750
|
t
|
|
1736
1751
|
)
|
|
1737
1752
|
);
|
|
1738
|
-
const
|
|
1739
|
-
|
|
1753
|
+
const r = document.createElement("span");
|
|
1754
|
+
r.className = "pluno-pa-widget__launcher-run-indicator", i.appendChild(r);
|
|
1740
1755
|
const l = document.createElement("input");
|
|
1741
1756
|
l.className = "pluno-pa-widget__launcher-input", l.type = "text", l.placeholder = e, l.setAttribute("aria-label", e), i.appendChild(l);
|
|
1742
|
-
const p =
|
|
1757
|
+
const p = mt("Working...");
|
|
1743
1758
|
if (p.classList.add("pluno-pa-widget__status--launcher"), i.appendChild(p), o) {
|
|
1744
1759
|
const d = document.createElement("button");
|
|
1745
1760
|
d.type = "button", d.className = "pluno-pa-widget__launcher-minimize", d.textContent = "-", d.setAttribute("aria-label", "Minimize Pluno on this site"), d.title = "Minimize Pluno on this site", i.appendChild(d);
|
|
@@ -1749,7 +1764,7 @@ function Ea(e, t, n, o) {
|
|
|
1749
1764
|
function ka(e) {
|
|
1750
1765
|
const t = document.createElement("section");
|
|
1751
1766
|
t.className = "pluno-pa-widget__panel", t.hidden = !0, t.appendChild(
|
|
1752
|
-
|
|
1767
|
+
xo("pluno-pa-widget__scribble-spirals--panel", 16)
|
|
1753
1768
|
);
|
|
1754
1769
|
const n = document.createElement("div");
|
|
1755
1770
|
n.className = "pluno-pa-widget__timeline-wrap";
|
|
@@ -1757,33 +1772,33 @@ function ka(e) {
|
|
|
1757
1772
|
o.className = "pluno-pa-widget__timeline", o.appendChild(Ta(e));
|
|
1758
1773
|
const i = document.createElement("div");
|
|
1759
1774
|
i.className = "pluno-pa-widget__timeline-bottom-sentinel", i.setAttribute("aria-hidden", "true"), o.appendChild(i), n.appendChild(o);
|
|
1760
|
-
const
|
|
1761
|
-
|
|
1775
|
+
const r = document.createElement("div");
|
|
1776
|
+
r.className = "pluno-pa-widget__active-users-counter", r.hidden = !0, n.appendChild(r);
|
|
1762
1777
|
const l = document.createElement("button");
|
|
1763
1778
|
l.type = "button", l.className = "pluno-pa-widget__timeline-jump", l.textContent = "New messages ↓", l.hidden = !0, n.appendChild(l);
|
|
1764
1779
|
const p = document.createElement("div");
|
|
1765
1780
|
return p.className = "pluno-pa-widget__top-actions", p.appendChild(
|
|
1766
|
-
|
|
1781
|
+
wt(
|
|
1767
1782
|
"pluno-pa-widget__history",
|
|
1768
|
-
|
|
1783
|
+
en(),
|
|
1769
1784
|
Ma(),
|
|
1770
1785
|
!0
|
|
1771
1786
|
)
|
|
1772
|
-
), n.appendChild(p), n.appendChild(
|
|
1773
|
-
|
|
1774
|
-
), t.appendChild(
|
|
1775
|
-
|
|
1787
|
+
), n.appendChild(p), n.appendChild(Pa()), t.appendChild(n), t.appendChild(La()), t.appendChild(Ia()), t.appendChild(be("left", "Resize Pluno from left")), t.appendChild(
|
|
1788
|
+
be("right", "Resize Pluno from right")
|
|
1789
|
+
), t.appendChild(be("top", "Resize Pluno from top")), t.appendChild(
|
|
1790
|
+
be("bottom", "Resize Pluno from bottom")
|
|
1776
1791
|
), t.appendChild(
|
|
1777
|
-
|
|
1792
|
+
be("top-left", "Resize Pluno from top left")
|
|
1778
1793
|
), t.appendChild(
|
|
1779
|
-
|
|
1794
|
+
be("top-right", "Resize Pluno from top right")
|
|
1780
1795
|
), t.appendChild(
|
|
1781
|
-
|
|
1796
|
+
be("bottom-left", "Resize Pluno from bottom left")
|
|
1782
1797
|
), t.appendChild(
|
|
1783
|
-
|
|
1798
|
+
be("bottom-right", "Resize Pluno from bottom right")
|
|
1784
1799
|
), t;
|
|
1785
1800
|
}
|
|
1786
|
-
function
|
|
1801
|
+
function be(e, t) {
|
|
1787
1802
|
const n = document.createElement("button");
|
|
1788
1803
|
return n.type = "button", n.className = [
|
|
1789
1804
|
"pluno-pa-widget__resize-handle",
|
|
@@ -1801,10 +1816,10 @@ function La() {
|
|
|
1801
1816
|
o.type = "button", o.className = "pluno-pa-widget__notify-suggestion-enable", o.textContent = "Notify me";
|
|
1802
1817
|
const i = document.createElement("button");
|
|
1803
1818
|
i.type = "button", i.className = "pluno-pa-widget__notify-suggestion-later", i.textContent = "Later";
|
|
1804
|
-
const
|
|
1805
|
-
return
|
|
1819
|
+
const r = document.createElement("button");
|
|
1820
|
+
return r.type = "button", r.className = "pluno-pa-widget__notify-suggestion-never", r.textContent = "Never", n.append(o, i, r), e.append(t, n), e;
|
|
1806
1821
|
}
|
|
1807
|
-
function
|
|
1822
|
+
function Ia() {
|
|
1808
1823
|
const e = document.createElement("form");
|
|
1809
1824
|
e.className = "pluno-pa-widget__composer";
|
|
1810
1825
|
const t = document.createElement("div");
|
|
@@ -1815,14 +1830,14 @@ function Pa() {
|
|
|
1815
1830
|
o.className = "pluno-pa-widget__attachments", o.hidden = !0, e.appendChild(o);
|
|
1816
1831
|
const i = document.createElement("div");
|
|
1817
1832
|
i.className = "pluno-pa-widget__composer-inner";
|
|
1818
|
-
const
|
|
1819
|
-
|
|
1833
|
+
const r = document.createElement("input");
|
|
1834
|
+
r.className = "pluno-pa-widget__attachment-input", r.type = "file", r.multiple = !0, r.tabIndex = -1, r.setAttribute("aria-hidden", "true"), i.appendChild(r);
|
|
1820
1835
|
const l = document.createElement("button");
|
|
1821
1836
|
l.type = "button", l.className = "pluno-pa-widget__attach", l.setAttribute("aria-label", "Attach files"), l.title = "Attach files", l.appendChild(Ua()), l.appendChild(Ba()), i.appendChild(l);
|
|
1822
1837
|
const p = document.createElement("textarea");
|
|
1823
1838
|
p.className = "pluno-pa-widget__input", p.rows = 1, p.placeholder = "Ask for anything...", i.appendChild(p);
|
|
1824
1839
|
const d = document.createElement("button");
|
|
1825
|
-
d.type = "button", d.className = "pluno-pa-widget__send", d.setAttribute("aria-label", "Send"), d.appendChild(
|
|
1840
|
+
d.type = "button", d.className = "pluno-pa-widget__send", d.setAttribute("aria-label", "Send"), d.appendChild(vo()), i.appendChild(d), e.appendChild(i);
|
|
1826
1841
|
const c = document.createElement("div");
|
|
1827
1842
|
c.className = "pluno-pa-widget__composer-meta";
|
|
1828
1843
|
const u = document.createElement("a");
|
|
@@ -1830,17 +1845,17 @@ function Pa() {
|
|
|
1830
1845
|
const m = document.createElement("span");
|
|
1831
1846
|
return m.className = "pluno-pa-widget__ai-disclaimer", m.textContent = "AI can make mistakes. Verify outputs.", c.appendChild(m), e.appendChild(c), e;
|
|
1832
1847
|
}
|
|
1833
|
-
function
|
|
1848
|
+
function en() {
|
|
1834
1849
|
return location.hostname ? `Recent chats on ${location.hostname}` : "Recent chats";
|
|
1835
1850
|
}
|
|
1836
|
-
function
|
|
1851
|
+
function Pa() {
|
|
1837
1852
|
const e = document.createElement("section");
|
|
1838
|
-
e.className = "pluno-pa-widget__history-panel", e.hidden = !0, e.setAttribute("aria-label",
|
|
1853
|
+
e.className = "pluno-pa-widget__history-panel", e.hidden = !0, e.setAttribute("aria-label", en());
|
|
1839
1854
|
const t = document.createElement("div");
|
|
1840
1855
|
t.className = "pluno-pa-widget__history-header";
|
|
1841
1856
|
const n = document.createElement("strong");
|
|
1842
|
-
n.textContent =
|
|
1843
|
-
const o =
|
|
1857
|
+
n.textContent = en();
|
|
1858
|
+
const o = wt(
|
|
1844
1859
|
"pluno-pa-widget__history-close",
|
|
1845
1860
|
"Close recent chats",
|
|
1846
1861
|
Oa(),
|
|
@@ -1849,23 +1864,23 @@ function Ia() {
|
|
|
1849
1864
|
t.append(n, o);
|
|
1850
1865
|
const i = document.createElement("div");
|
|
1851
1866
|
i.className = "pluno-pa-widget__history-list";
|
|
1852
|
-
const
|
|
1853
|
-
return
|
|
1867
|
+
const r = document.createElement("p");
|
|
1868
|
+
return r.className = "pluno-pa-widget__history-status", r.hidden = !0, e.append(t, i, r), e;
|
|
1854
1869
|
}
|
|
1855
1870
|
function Ta(e) {
|
|
1856
1871
|
const t = document.createElement("div");
|
|
1857
1872
|
return t.className = "pluno-pa-widget__empty-state", t.appendChild(
|
|
1858
|
-
|
|
1873
|
+
_e(
|
|
1859
1874
|
"pluno-pa-widget__character--empty",
|
|
1860
1875
|
e
|
|
1861
1876
|
)
|
|
1862
|
-
), t.appendChild(
|
|
1877
|
+
), t.appendChild(wo()), t;
|
|
1863
1878
|
}
|
|
1864
|
-
function
|
|
1879
|
+
function wo() {
|
|
1865
1880
|
const e = document.createElement("div");
|
|
1866
1881
|
return e.className = "pluno-pa-widget__empty", e.appendChild(document.createTextNode("Hey there, I'm Pluno 👋")), e.appendChild(document.createElement("br")), e.appendChild(document.createTextNode("What do you want to do today?")), e;
|
|
1867
1882
|
}
|
|
1868
|
-
function
|
|
1883
|
+
function bo(e, t) {
|
|
1869
1884
|
e.replaceChildren(), e.setAttribute(
|
|
1870
1885
|
"aria-label",
|
|
1871
1886
|
`${t.toLocaleString("en-US")} users currently active`
|
|
@@ -1877,9 +1892,9 @@ function fo(e, t) {
|
|
|
1877
1892
|
)
|
|
1878
1893
|
);
|
|
1879
1894
|
}
|
|
1880
|
-
function
|
|
1881
|
-
const n = `pluno-pa-character-${
|
|
1882
|
-
|
|
1895
|
+
function _e(e, t) {
|
|
1896
|
+
const n = `pluno-pa-character-${zn}`;
|
|
1897
|
+
zn += 1;
|
|
1883
1898
|
const o = t.scribbleStyle ? Na(t.accentColor, n) : Aa(t.accentColor, n), i = e.split(/\s+/).filter(Boolean);
|
|
1884
1899
|
return o.setAttribute(
|
|
1885
1900
|
"class",
|
|
@@ -1898,7 +1913,7 @@ function Aa(e, t) {
|
|
|
1898
1913
|
eyeShadow: `${t}-eyeShadow`,
|
|
1899
1914
|
pupilGloss: `${t}-pupilGloss`,
|
|
1900
1915
|
boltClip: `${t}-boltClip`
|
|
1901
|
-
}, i =
|
|
1916
|
+
}, i = _o(), r = f(i, "defs"), l = f(r, "linearGradient", {
|
|
1902
1917
|
id: o.boltFill,
|
|
1903
1918
|
x1: "420",
|
|
1904
1919
|
y1: "180",
|
|
@@ -1907,7 +1922,7 @@ function Aa(e, t) {
|
|
|
1907
1922
|
gradientUnits: "userSpaceOnUse"
|
|
1908
1923
|
});
|
|
1909
1924
|
O(l, "0", n.top), O(l, "0.36", n.middle), O(l, "0.72", n.bottom), O(l, "1", n.bottom);
|
|
1910
|
-
const p = f(
|
|
1925
|
+
const p = f(r, "linearGradient", {
|
|
1911
1926
|
id: o.boltEdge,
|
|
1912
1927
|
x1: "470",
|
|
1913
1928
|
y1: "145",
|
|
@@ -1916,28 +1931,28 @@ function Aa(e, t) {
|
|
|
1916
1931
|
gradientUnits: "userSpaceOnUse"
|
|
1917
1932
|
});
|
|
1918
1933
|
O(p, "0", n.edgeStart), O(p, "0.32", n.edgeMiddle), O(p, "0.78", n.edgeEnd), O(p, "1", n.edgeEnd);
|
|
1919
|
-
const d = f(
|
|
1934
|
+
const d = f(r, "radialGradient", {
|
|
1920
1935
|
id: o.boltGlow,
|
|
1921
1936
|
cx: "50%",
|
|
1922
1937
|
cy: "22%",
|
|
1923
1938
|
r: "82%"
|
|
1924
1939
|
});
|
|
1925
1940
|
O(d, "0", n.glow, "0.72"), O(d, "0.5", n.middle, "0.44"), O(d, "1", n.bottom, "0");
|
|
1926
|
-
const c = f(
|
|
1941
|
+
const c = f(r, "radialGradient", {
|
|
1927
1942
|
id: o.eyeWhite,
|
|
1928
1943
|
cx: "35%",
|
|
1929
1944
|
cy: "25%",
|
|
1930
1945
|
r: "70%"
|
|
1931
1946
|
});
|
|
1932
1947
|
O(c, "0", "#ffffff"), O(c, "0.72", "#ffffff"), O(c, "1", "#e5e5e5");
|
|
1933
|
-
const u = f(
|
|
1948
|
+
const u = f(r, "radialGradient", {
|
|
1934
1949
|
id: o.pupil,
|
|
1935
1950
|
cx: "42%",
|
|
1936
1951
|
cy: "38%",
|
|
1937
1952
|
r: "65%"
|
|
1938
1953
|
});
|
|
1939
1954
|
O(u, "0", "#2a1f10"), O(u, "0.52", "#080604"), O(u, "1", "#000000");
|
|
1940
|
-
const m = f(
|
|
1955
|
+
const m = f(r, "filter", {
|
|
1941
1956
|
id: o.softDropShadow,
|
|
1942
1957
|
x: "-18%",
|
|
1943
1958
|
y: "-12%",
|
|
@@ -1952,7 +1967,7 @@ function Aa(e, t) {
|
|
|
1952
1967
|
"flood-color": n.shadow,
|
|
1953
1968
|
"flood-opacity": "0.24"
|
|
1954
1969
|
});
|
|
1955
|
-
const
|
|
1970
|
+
const k = f(r, "filter", {
|
|
1956
1971
|
id: o.innerDepth,
|
|
1957
1972
|
x: "-8%",
|
|
1958
1973
|
y: "-8%",
|
|
@@ -1960,32 +1975,32 @@ function Aa(e, t) {
|
|
|
1960
1975
|
height: "116%",
|
|
1961
1976
|
"color-interpolation-filters": "sRGB"
|
|
1962
1977
|
});
|
|
1963
|
-
f(
|
|
1978
|
+
f(k, "feGaussianBlur", {
|
|
1964
1979
|
in: "SourceAlpha",
|
|
1965
1980
|
stdDeviation: "8",
|
|
1966
1981
|
result: "blur"
|
|
1967
|
-
}), f(
|
|
1982
|
+
}), f(k, "feOffset", {
|
|
1968
1983
|
dx: "-7",
|
|
1969
1984
|
dy: "-9",
|
|
1970
1985
|
result: "topLeft"
|
|
1971
|
-
}), f(
|
|
1986
|
+
}), f(k, "feComposite", {
|
|
1972
1987
|
in: "topLeft",
|
|
1973
1988
|
in2: "SourceAlpha",
|
|
1974
1989
|
operator: "arithmetic",
|
|
1975
1990
|
k2: "-1",
|
|
1976
1991
|
k3: "1",
|
|
1977
1992
|
result: "innerShadow"
|
|
1978
|
-
}), f(
|
|
1993
|
+
}), f(k, "feColorMatrix", {
|
|
1979
1994
|
in: "innerShadow",
|
|
1980
1995
|
type: "matrix",
|
|
1981
1996
|
values: "1 0 0 0 1 0 1 0 0 1 0 0 1 0 1 0 0 0 0.42 0",
|
|
1982
1997
|
result: "innerLight"
|
|
1983
|
-
}), f(
|
|
1998
|
+
}), f(k, "feBlend", {
|
|
1984
1999
|
in: "SourceGraphic",
|
|
1985
2000
|
in2: "innerLight",
|
|
1986
2001
|
mode: "screen"
|
|
1987
2002
|
});
|
|
1988
|
-
const v = f(
|
|
2003
|
+
const v = f(r, "filter", {
|
|
1989
2004
|
id: o.eyeShadow,
|
|
1990
2005
|
x: "-24%",
|
|
1991
2006
|
y: "-20%",
|
|
@@ -2000,7 +2015,7 @@ function Aa(e, t) {
|
|
|
2000
2015
|
"flood-color": n.shadow,
|
|
2001
2016
|
"flood-opacity": "0.3"
|
|
2002
2017
|
});
|
|
2003
|
-
const
|
|
2018
|
+
const R = f(r, "filter", {
|
|
2004
2019
|
id: o.pupilGloss,
|
|
2005
2020
|
x: "-15%",
|
|
2006
2021
|
y: "-15%",
|
|
@@ -2008,34 +2023,34 @@ function Aa(e, t) {
|
|
|
2008
2023
|
height: "130%",
|
|
2009
2024
|
"color-interpolation-filters": "sRGB"
|
|
2010
2025
|
});
|
|
2011
|
-
f(
|
|
2026
|
+
f(R, "feDropShadow", {
|
|
2012
2027
|
dx: "0",
|
|
2013
2028
|
dy: "3",
|
|
2014
2029
|
stdDeviation: "3",
|
|
2015
2030
|
"flood-color": "#000000",
|
|
2016
2031
|
"flood-opacity": "0.22"
|
|
2017
2032
|
});
|
|
2018
|
-
const
|
|
2019
|
-
f(
|
|
2033
|
+
const C = f(r, "clipPath", { id: o.boltClip });
|
|
2034
|
+
f(C, "path", { d: ut });
|
|
2020
2035
|
const g = f(i, "g", {
|
|
2021
|
-
filter:
|
|
2036
|
+
filter: Y(o.softDropShadow)
|
|
2022
2037
|
});
|
|
2023
2038
|
f(g, "path", {
|
|
2024
|
-
d:
|
|
2025
|
-
fill:
|
|
2039
|
+
d: ut,
|
|
2040
|
+
fill: Y(o.boltEdge)
|
|
2026
2041
|
});
|
|
2027
|
-
const
|
|
2042
|
+
const y = "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";
|
|
2028
2043
|
f(g, "path", {
|
|
2029
|
-
d:
|
|
2030
|
-
fill:
|
|
2031
|
-
filter:
|
|
2044
|
+
d: y,
|
|
2045
|
+
fill: Y(o.boltFill),
|
|
2046
|
+
filter: Y(o.innerDepth)
|
|
2032
2047
|
}), f(g, "path", {
|
|
2033
|
-
d:
|
|
2034
|
-
fill:
|
|
2048
|
+
d: y,
|
|
2049
|
+
fill: Y(o.boltGlow),
|
|
2035
2050
|
opacity: "0.74"
|
|
2036
2051
|
});
|
|
2037
2052
|
const h = f(g, "g", {
|
|
2038
|
-
"clip-path":
|
|
2053
|
+
"clip-path": Y(o.boltClip),
|
|
2039
2054
|
opacity: "0.42"
|
|
2040
2055
|
});
|
|
2041
2056
|
f(h, "path", {
|
|
@@ -2060,9 +2075,9 @@ function Aa(e, t) {
|
|
|
2060
2075
|
"stroke-linecap": "round",
|
|
2061
2076
|
opacity: "0.48"
|
|
2062
2077
|
});
|
|
2063
|
-
const
|
|
2064
|
-
return
|
|
2065
|
-
|
|
2078
|
+
const A = f(i, "g", { filter: Y(o.eyeShadow) });
|
|
2079
|
+
return Wn(
|
|
2080
|
+
A,
|
|
2066
2081
|
"rotate(-2 528 463)",
|
|
2067
2082
|
"528",
|
|
2068
2083
|
"463",
|
|
@@ -2071,8 +2086,8 @@ function Aa(e, t) {
|
|
|
2071
2086
|
"557",
|
|
2072
2087
|
"447",
|
|
2073
2088
|
o
|
|
2074
|
-
),
|
|
2075
|
-
|
|
2089
|
+
), Wn(
|
|
2090
|
+
A,
|
|
2076
2091
|
"rotate(2 717 462)",
|
|
2077
2092
|
"717",
|
|
2078
2093
|
"462",
|
|
@@ -2084,12 +2099,12 @@ function Aa(e, t) {
|
|
|
2084
2099
|
), i;
|
|
2085
2100
|
}
|
|
2086
2101
|
function Na(e, t) {
|
|
2087
|
-
const n =
|
|
2102
|
+
const n = no(e), o = {
|
|
2088
2103
|
clip: `${t}-scribbleBoltClip`,
|
|
2089
2104
|
wobble: `${t}-scribbleBoltWobble`
|
|
2090
|
-
}, i =
|
|
2091
|
-
f(l, "path", { d:
|
|
2092
|
-
const p = f(
|
|
2105
|
+
}, i = _o(), r = f(i, "defs"), l = f(r, "clipPath", { id: o.clip });
|
|
2106
|
+
f(l, "path", { d: ut });
|
|
2107
|
+
const p = f(r, "filter", {
|
|
2093
2108
|
id: o.wobble,
|
|
2094
2109
|
x: "-10%",
|
|
2095
2110
|
y: "-10%",
|
|
@@ -2110,8 +2125,8 @@ function Na(e, t) {
|
|
|
2110
2125
|
xChannelSelector: "R",
|
|
2111
2126
|
yChannelSelector: "G"
|
|
2112
2127
|
});
|
|
2113
|
-
const d = f(i, "g", { filter:
|
|
2114
|
-
"clip-path":
|
|
2128
|
+
const d = f(i, "g", { filter: Y(o.wobble) }), c = f(d, "g", {
|
|
2129
|
+
"clip-path": Y(o.clip)
|
|
2115
2130
|
});
|
|
2116
2131
|
return f(c, "path", {
|
|
2117
2132
|
d: ti(),
|
|
@@ -2123,12 +2138,12 @@ function Na(e, t) {
|
|
|
2123
2138
|
opacity: "0.9",
|
|
2124
2139
|
transform: "rotate(-14 627 600)"
|
|
2125
2140
|
}), f(d, "path", {
|
|
2126
|
-
d:
|
|
2141
|
+
d: ut,
|
|
2127
2142
|
fill: "none",
|
|
2128
|
-
stroke:
|
|
2143
|
+
stroke: gt,
|
|
2129
2144
|
"stroke-width": "18",
|
|
2130
2145
|
"stroke-linejoin": "round"
|
|
2131
|
-
}),
|
|
2146
|
+
}), Gn(
|
|
2132
2147
|
d,
|
|
2133
2148
|
"rotate(-2 528 463)",
|
|
2134
2149
|
"528",
|
|
@@ -2137,7 +2152,7 @@ function Na(e, t) {
|
|
|
2137
2152
|
"473",
|
|
2138
2153
|
"557",
|
|
2139
2154
|
"447"
|
|
2140
|
-
),
|
|
2155
|
+
), Gn(
|
|
2141
2156
|
d,
|
|
2142
2157
|
"rotate(2 717 462)",
|
|
2143
2158
|
"717",
|
|
@@ -2148,27 +2163,27 @@ function Na(e, t) {
|
|
|
2148
2163
|
"447"
|
|
2149
2164
|
), i;
|
|
2150
2165
|
}
|
|
2151
|
-
function
|
|
2152
|
-
return
|
|
2153
|
-
xmlns:
|
|
2166
|
+
function _o() {
|
|
2167
|
+
return E("svg", {
|
|
2168
|
+
xmlns: co,
|
|
2154
2169
|
viewBox: "0 0 1254 1254"
|
|
2155
2170
|
});
|
|
2156
2171
|
}
|
|
2157
|
-
function
|
|
2172
|
+
function Wn(e, t, n, o, i, r, l, p, d) {
|
|
2158
2173
|
const c = f(e, "g", { transform: t });
|
|
2159
2174
|
f(c, "ellipse", {
|
|
2160
2175
|
cx: n,
|
|
2161
2176
|
cy: o,
|
|
2162
2177
|
rx: "73",
|
|
2163
2178
|
ry: "80",
|
|
2164
|
-
fill:
|
|
2179
|
+
fill: Y(d.eyeWhite)
|
|
2165
2180
|
}), f(c, "ellipse", {
|
|
2166
2181
|
cx: i,
|
|
2167
|
-
cy:
|
|
2182
|
+
cy: r,
|
|
2168
2183
|
rx: "49",
|
|
2169
2184
|
ry: "57",
|
|
2170
|
-
fill:
|
|
2171
|
-
filter:
|
|
2185
|
+
fill: Y(d.pupil),
|
|
2186
|
+
filter: Y(d.pupilGloss)
|
|
2172
2187
|
}), f(c, "circle", {
|
|
2173
2188
|
cx: l,
|
|
2174
2189
|
cy: p,
|
|
@@ -2176,7 +2191,7 @@ function Fn(e, t, n, o, i, a, l, p, d) {
|
|
|
2176
2191
|
fill: "#ffffff"
|
|
2177
2192
|
});
|
|
2178
2193
|
}
|
|
2179
|
-
function
|
|
2194
|
+
function Gn(e, t, n, o, i, r, l, p) {
|
|
2180
2195
|
const d = f(e, "g", { transform: t });
|
|
2181
2196
|
f(d, "ellipse", {
|
|
2182
2197
|
cx: n,
|
|
@@ -2184,14 +2199,14 @@ function Hn(e, t, n, o, i, a, l, p) {
|
|
|
2184
2199
|
rx: "73",
|
|
2185
2200
|
ry: "80",
|
|
2186
2201
|
fill: "#ffffff",
|
|
2187
|
-
stroke:
|
|
2202
|
+
stroke: gt,
|
|
2188
2203
|
"stroke-width": "13"
|
|
2189
2204
|
}), f(d, "ellipse", {
|
|
2190
2205
|
cx: i,
|
|
2191
|
-
cy:
|
|
2206
|
+
cy: r,
|
|
2192
2207
|
rx: "45",
|
|
2193
2208
|
ry: "53",
|
|
2194
|
-
fill:
|
|
2209
|
+
fill: gt
|
|
2195
2210
|
}), f(d, "circle", {
|
|
2196
2211
|
cx: l,
|
|
2197
2212
|
cy: p,
|
|
@@ -2200,71 +2215,71 @@ function Hn(e, t, n, o, i, a, l, p) {
|
|
|
2200
2215
|
});
|
|
2201
2216
|
}
|
|
2202
2217
|
function f(e, t, n = {}) {
|
|
2203
|
-
const o =
|
|
2218
|
+
const o = E(t, n);
|
|
2204
2219
|
return e.appendChild(o), o;
|
|
2205
2220
|
}
|
|
2206
2221
|
function O(e, t, n, o) {
|
|
2207
2222
|
const i = { offset: t, "stop-color": n };
|
|
2208
2223
|
o !== void 0 && (i["stop-opacity"] = o), f(e, "stop", i);
|
|
2209
2224
|
}
|
|
2210
|
-
function
|
|
2225
|
+
function Y(e) {
|
|
2211
2226
|
return `url(#${e})`;
|
|
2212
2227
|
}
|
|
2213
|
-
function
|
|
2228
|
+
function wt(e, t, n, o) {
|
|
2214
2229
|
const i = document.createElement("button");
|
|
2215
2230
|
return i.type = "button", i.className = e, i.setAttribute("aria-label", t), i.title = t, i.hidden = o, i.appendChild(n), i;
|
|
2216
2231
|
}
|
|
2217
|
-
function
|
|
2218
|
-
const e =
|
|
2232
|
+
function Ra() {
|
|
2233
|
+
const e = E("svg", {
|
|
2219
2234
|
class: "pluno-pa-widget__scribble-defs",
|
|
2220
2235
|
"aria-hidden": "true",
|
|
2221
2236
|
focusable: "false",
|
|
2222
2237
|
width: "0",
|
|
2223
2238
|
height: "0"
|
|
2224
|
-
}), t =
|
|
2225
|
-
return t.appendChild(
|
|
2226
|
-
|
|
2239
|
+
}), t = E("defs");
|
|
2240
|
+
return t.appendChild(Gt("pluno-pa-scribble-wobble", "2", "12")), t.appendChild(
|
|
2241
|
+
Gt("pluno-pa-scribble-wobble-2", "5", "15")
|
|
2227
2242
|
), t.appendChild(
|
|
2228
|
-
|
|
2243
|
+
Gt("pluno-pa-scribble-wobble-3", "9", "19")
|
|
2229
2244
|
), e.appendChild(t), e;
|
|
2230
2245
|
}
|
|
2231
|
-
function
|
|
2232
|
-
const n =
|
|
2246
|
+
function xo(e, t) {
|
|
2247
|
+
const n = E("svg", {
|
|
2233
2248
|
class: `pluno-pa-widget__scribble-spirals ${e}`,
|
|
2234
2249
|
preserveAspectRatio: "xMidYMid meet",
|
|
2235
2250
|
"aria-hidden": "true",
|
|
2236
2251
|
focusable: "false"
|
|
2237
2252
|
});
|
|
2238
|
-
return
|
|
2253
|
+
return yo(n, t), n;
|
|
2239
2254
|
}
|
|
2240
|
-
function
|
|
2255
|
+
function Wt(e, t) {
|
|
2241
2256
|
if (!e)
|
|
2242
2257
|
return;
|
|
2243
2258
|
const n = Math.max(
|
|
2244
2259
|
0,
|
|
2245
|
-
t -
|
|
2260
|
+
t - Zt * 2
|
|
2246
2261
|
), o = Math.max(
|
|
2247
2262
|
Xi,
|
|
2248
2263
|
Math.floor(
|
|
2249
|
-
(n -
|
|
2264
|
+
(n - Xt * 2) / Yt
|
|
2250
2265
|
)
|
|
2251
2266
|
);
|
|
2252
|
-
|
|
2267
|
+
yo(e, o);
|
|
2253
2268
|
}
|
|
2254
|
-
function
|
|
2269
|
+
function yo(e, t) {
|
|
2255
2270
|
if (e.dataset.spiralCount === `${t}`)
|
|
2256
2271
|
return;
|
|
2257
|
-
const n = t *
|
|
2272
|
+
const n = t * Yt + Xt * 2;
|
|
2258
2273
|
e.dataset.spiralCount = `${t}`, e.setAttribute(
|
|
2259
2274
|
"viewBox",
|
|
2260
2275
|
`0 0 ${n} ${Yi}`
|
|
2261
2276
|
), e.replaceChildren();
|
|
2262
2277
|
for (let o = 0; o < t; o += 1) {
|
|
2263
|
-
const i =
|
|
2264
|
-
transform: `translate(${
|
|
2278
|
+
const i = Dn[o % Dn.length], r = E("g", {
|
|
2279
|
+
transform: `translate(${Xt + o * Yt} 0)`
|
|
2265
2280
|
});
|
|
2266
|
-
|
|
2267
|
-
|
|
2281
|
+
r.appendChild(
|
|
2282
|
+
E("ellipse", {
|
|
2268
2283
|
cx: i.ellipseCx,
|
|
2269
2284
|
cy: i.ellipseCy,
|
|
2270
2285
|
rx: i.ellipseRx,
|
|
@@ -2274,19 +2289,19 @@ function _o(e, t) {
|
|
|
2274
2289
|
"stroke-width": i.strokeWidth,
|
|
2275
2290
|
opacity: "0.8"
|
|
2276
2291
|
})
|
|
2277
|
-
),
|
|
2278
|
-
|
|
2292
|
+
), r.appendChild(
|
|
2293
|
+
E("path", {
|
|
2279
2294
|
d: i.path,
|
|
2280
2295
|
fill: "none",
|
|
2281
2296
|
stroke: "#2c2a1e",
|
|
2282
2297
|
"stroke-width": i.pathStrokeWidth,
|
|
2283
2298
|
"stroke-linecap": "round"
|
|
2284
2299
|
})
|
|
2285
|
-
), e.appendChild(
|
|
2300
|
+
), e.appendChild(r);
|
|
2286
2301
|
}
|
|
2287
2302
|
}
|
|
2288
|
-
function
|
|
2289
|
-
const o =
|
|
2303
|
+
function Gt(e, t, n) {
|
|
2304
|
+
const o = E("filter", {
|
|
2290
2305
|
id: e,
|
|
2291
2306
|
x: "-8%",
|
|
2292
2307
|
y: "-8%",
|
|
@@ -2294,7 +2309,7 @@ function Ft(e, t, n) {
|
|
|
2294
2309
|
height: "116%"
|
|
2295
2310
|
});
|
|
2296
2311
|
return o.appendChild(
|
|
2297
|
-
|
|
2312
|
+
E("feTurbulence", {
|
|
2298
2313
|
type: "fractalNoise",
|
|
2299
2314
|
baseFrequency: "0.012 0.028",
|
|
2300
2315
|
numOctaves: "3",
|
|
@@ -2302,7 +2317,7 @@ function Ft(e, t, n) {
|
|
|
2302
2317
|
result: "stroke-noise"
|
|
2303
2318
|
})
|
|
2304
2319
|
), o.appendChild(
|
|
2305
|
-
|
|
2320
|
+
E("feDisplacementMap", {
|
|
2306
2321
|
in: "SourceGraphic",
|
|
2307
2322
|
in2: "stroke-noise",
|
|
2308
2323
|
scale: "3.5",
|
|
@@ -2311,7 +2326,7 @@ function Ft(e, t, n) {
|
|
|
2311
2326
|
result: "warped"
|
|
2312
2327
|
})
|
|
2313
2328
|
), o.appendChild(
|
|
2314
|
-
|
|
2329
|
+
E("feTurbulence", {
|
|
2315
2330
|
type: "fractalNoise",
|
|
2316
2331
|
baseFrequency: "0.7",
|
|
2317
2332
|
numOctaves: "1",
|
|
@@ -2319,7 +2334,7 @@ function Ft(e, t, n) {
|
|
|
2319
2334
|
result: "ink-noise"
|
|
2320
2335
|
})
|
|
2321
2336
|
), o.appendChild(
|
|
2322
|
-
|
|
2337
|
+
E("feDisplacementMap", {
|
|
2323
2338
|
in: "warped",
|
|
2324
2339
|
in2: "ink-noise",
|
|
2325
2340
|
scale: "0.9",
|
|
@@ -2328,8 +2343,8 @@ function Ft(e, t, n) {
|
|
|
2328
2343
|
})
|
|
2329
2344
|
), o;
|
|
2330
2345
|
}
|
|
2331
|
-
function
|
|
2332
|
-
const t =
|
|
2346
|
+
function Da(e) {
|
|
2347
|
+
const t = le(
|
|
2333
2348
|
"0 0 24 24",
|
|
2334
2349
|
e,
|
|
2335
2350
|
e,
|
|
@@ -2337,10 +2352,10 @@ function Ra(e) {
|
|
|
2337
2352
|
"currentColor",
|
|
2338
2353
|
"2.25"
|
|
2339
2354
|
);
|
|
2340
|
-
return t.appendChild(
|
|
2355
|
+
return t.appendChild(E("path", { d: "m6 9 6 6 6-6" })), t;
|
|
2341
2356
|
}
|
|
2342
2357
|
function za() {
|
|
2343
|
-
const e =
|
|
2358
|
+
const e = le(
|
|
2344
2359
|
"0 0 24 24",
|
|
2345
2360
|
17,
|
|
2346
2361
|
17,
|
|
@@ -2349,17 +2364,17 @@ function za() {
|
|
|
2349
2364
|
"2.25"
|
|
2350
2365
|
);
|
|
2351
2366
|
return e.appendChild(
|
|
2352
|
-
|
|
2367
|
+
E("path", {
|
|
2353
2368
|
d: "M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"
|
|
2354
2369
|
})
|
|
2355
2370
|
), e.appendChild(
|
|
2356
|
-
|
|
2371
|
+
E("path", {
|
|
2357
2372
|
d: "M18.4 2.6a2.1 2.1 0 0 1 3 3L12 15l-4 1 1-4Z"
|
|
2358
2373
|
})
|
|
2359
2374
|
), e;
|
|
2360
2375
|
}
|
|
2361
2376
|
function Ma() {
|
|
2362
|
-
const e =
|
|
2377
|
+
const e = le(
|
|
2363
2378
|
"0 0 24 24",
|
|
2364
2379
|
17,
|
|
2365
2380
|
17,
|
|
@@ -2367,10 +2382,10 @@ function Ma() {
|
|
|
2367
2382
|
"currentColor",
|
|
2368
2383
|
"2.25"
|
|
2369
2384
|
);
|
|
2370
|
-
return e.appendChild(
|
|
2385
|
+
return e.appendChild(E("path", { d: "M3 12a9 9 0 1 0 3-6.7" })), e.appendChild(E("path", { d: "M3 4v5h5" })), e.appendChild(E("path", { d: "M12 7v5l3 2" })), e;
|
|
2371
2386
|
}
|
|
2372
2387
|
function Oa() {
|
|
2373
|
-
const e =
|
|
2388
|
+
const e = le(
|
|
2374
2389
|
"0 0 24 24",
|
|
2375
2390
|
15,
|
|
2376
2391
|
15,
|
|
@@ -2378,10 +2393,10 @@ function Oa() {
|
|
|
2378
2393
|
"currentColor",
|
|
2379
2394
|
"2.4"
|
|
2380
2395
|
);
|
|
2381
|
-
return e.appendChild(
|
|
2396
|
+
return e.appendChild(E("path", { d: "M18 6 6 18" })), e.appendChild(E("path", { d: "m6 6 12 12" })), e;
|
|
2382
2397
|
}
|
|
2383
|
-
function
|
|
2384
|
-
const e =
|
|
2398
|
+
function vo() {
|
|
2399
|
+
const e = le(
|
|
2385
2400
|
"0 0 24 24",
|
|
2386
2401
|
14,
|
|
2387
2402
|
14,
|
|
@@ -2390,11 +2405,11 @@ function xo() {
|
|
|
2390
2405
|
"2.75"
|
|
2391
2406
|
);
|
|
2392
2407
|
return e.appendChild(
|
|
2393
|
-
|
|
2394
|
-
), e.appendChild(
|
|
2408
|
+
E("line", { x1: "12", y1: "19", x2: "12", y2: "5" })
|
|
2409
|
+
), e.appendChild(E("polyline", { points: "5 12 12 5 19 12" })), e;
|
|
2395
2410
|
}
|
|
2396
2411
|
function Ua() {
|
|
2397
|
-
const e =
|
|
2412
|
+
const e = le(
|
|
2398
2413
|
"0 0 24 24",
|
|
2399
2414
|
16,
|
|
2400
2415
|
16,
|
|
@@ -2406,18 +2421,18 @@ function Ua() {
|
|
|
2406
2421
|
"class",
|
|
2407
2422
|
"pluno-pa-widget__paperclip-icon pluno-pa-widget__paperclip-icon--standard"
|
|
2408
2423
|
), e.appendChild(
|
|
2409
|
-
|
|
2424
|
+
E("path", {
|
|
2410
2425
|
d: "m21.4 11.6-8.5 8.5a6 6 0 0 1-8.5-8.5l9.2-9.2a4 4 0 0 1 5.7 5.7l-9.2 9.2a2 2 0 0 1-2.8-2.8l8.5-8.5"
|
|
2411
2426
|
})
|
|
2412
2427
|
), e;
|
|
2413
2428
|
}
|
|
2414
2429
|
function Ba() {
|
|
2415
|
-
const e =
|
|
2430
|
+
const e = le("0 0 24 24", 19, 19, "none", "currentColor");
|
|
2416
2431
|
return e.setAttribute(
|
|
2417
2432
|
"class",
|
|
2418
2433
|
"pluno-pa-widget__paperclip-icon pluno-pa-widget__paperclip-icon--scribble"
|
|
2419
2434
|
), e.appendChild(
|
|
2420
|
-
|
|
2435
|
+
E("path", {
|
|
2421
2436
|
d: "M7.1 15.6 15.2 7.7c1.9-1.8 4.9.8 2.7 3.2l-8.8 8.3c-3.2 3-8-1.1-4.6-4.8l10.1-9.1",
|
|
2422
2437
|
stroke: "currentColor",
|
|
2423
2438
|
"stroke-width": "2",
|
|
@@ -2427,9 +2442,9 @@ function Ba() {
|
|
|
2427
2442
|
), e;
|
|
2428
2443
|
}
|
|
2429
2444
|
function Fa() {
|
|
2430
|
-
const e =
|
|
2445
|
+
const e = le("0 0 24 24", 18, 18, "currentColor");
|
|
2431
2446
|
return e.appendChild(
|
|
2432
|
-
|
|
2447
|
+
E("rect", {
|
|
2433
2448
|
x: "6",
|
|
2434
2449
|
y: "6",
|
|
2435
2450
|
width: "12",
|
|
@@ -2439,7 +2454,7 @@ function Fa() {
|
|
|
2439
2454
|
), e;
|
|
2440
2455
|
}
|
|
2441
2456
|
function Ha() {
|
|
2442
|
-
const e =
|
|
2457
|
+
const e = le(
|
|
2443
2458
|
"0 0 24 24",
|
|
2444
2459
|
12,
|
|
2445
2460
|
12,
|
|
@@ -2447,10 +2462,10 @@ function Ha() {
|
|
|
2447
2462
|
"currentColor",
|
|
2448
2463
|
"2.4"
|
|
2449
2464
|
);
|
|
2450
|
-
return e.appendChild(
|
|
2465
|
+
return e.appendChild(E("path", { d: "M18 6 6 18" })), e.appendChild(E("path", { d: "m6 6 12 12" })), e;
|
|
2451
2466
|
}
|
|
2452
2467
|
function Wa() {
|
|
2453
|
-
const e =
|
|
2468
|
+
const e = le(
|
|
2454
2469
|
"0 0 24 24",
|
|
2455
2470
|
13,
|
|
2456
2471
|
13,
|
|
@@ -2459,7 +2474,7 @@ function Wa() {
|
|
|
2459
2474
|
"2.25"
|
|
2460
2475
|
);
|
|
2461
2476
|
return e.appendChild(
|
|
2462
|
-
|
|
2477
|
+
E("rect", {
|
|
2463
2478
|
width: "14",
|
|
2464
2479
|
height: "14",
|
|
2465
2480
|
x: "8",
|
|
@@ -2468,12 +2483,12 @@ function Wa() {
|
|
|
2468
2483
|
ry: "2"
|
|
2469
2484
|
})
|
|
2470
2485
|
), e.appendChild(
|
|
2471
|
-
|
|
2486
|
+
E("path", {
|
|
2472
2487
|
d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"
|
|
2473
2488
|
})
|
|
2474
2489
|
), e;
|
|
2475
2490
|
}
|
|
2476
|
-
function
|
|
2491
|
+
function le(e, t, n, o, i, r) {
|
|
2477
2492
|
const l = {
|
|
2478
2493
|
viewBox: e,
|
|
2479
2494
|
width: String(t),
|
|
@@ -2481,15 +2496,15 @@ function re(e, t, n, o, i, a) {
|
|
|
2481
2496
|
fill: o,
|
|
2482
2497
|
"aria-hidden": "true"
|
|
2483
2498
|
};
|
|
2484
|
-
return i && (l.stroke = i, l["stroke-linecap"] = "round", l["stroke-linejoin"] = "round"),
|
|
2499
|
+
return i && (l.stroke = i, l["stroke-linecap"] = "round", l["stroke-linejoin"] = "round"), r && (l["stroke-width"] = r), E("svg", l);
|
|
2485
2500
|
}
|
|
2486
|
-
function
|
|
2487
|
-
const n = document.createElementNS(
|
|
2501
|
+
function E(e, t = {}) {
|
|
2502
|
+
const n = document.createElementNS(co, e);
|
|
2488
2503
|
for (const [o, i] of Object.entries(t))
|
|
2489
2504
|
n.setAttribute(o, i);
|
|
2490
2505
|
return n;
|
|
2491
2506
|
}
|
|
2492
|
-
function
|
|
2507
|
+
function $n(e) {
|
|
2493
2508
|
for (const t of ["keydown", "keypress", "keyup"])
|
|
2494
2509
|
e.addEventListener(t, (n) => {
|
|
2495
2510
|
n.stopPropagation();
|
|
@@ -2498,62 +2513,62 @@ function Wn(e) {
|
|
|
2498
2513
|
function Ga(e, t, n) {
|
|
2499
2514
|
e.replaceChildren(), e.hidden = t.length === 0;
|
|
2500
2515
|
for (const [o, i] of t.entries()) {
|
|
2501
|
-
const
|
|
2502
|
-
|
|
2516
|
+
const r = document.createElement("div");
|
|
2517
|
+
r.className = "pluno-pa-widget__attachment", r.appendChild($a(i));
|
|
2503
2518
|
const l = document.createElement("span");
|
|
2504
|
-
l.textContent = i.name,
|
|
2519
|
+
l.textContent = i.name, r.appendChild(l);
|
|
2505
2520
|
const p = document.createElement("button");
|
|
2506
|
-
p.type = "button", p.setAttribute("aria-label", `Remove ${i.name}`), p.appendChild(Ha()), p.addEventListener("click", () => n(o)),
|
|
2521
|
+
p.type = "button", p.setAttribute("aria-label", `Remove ${i.name}`), p.appendChild(Ha()), p.addEventListener("click", () => n(o)), r.appendChild(p), e.appendChild(r);
|
|
2507
2522
|
}
|
|
2508
2523
|
}
|
|
2509
2524
|
function $a(e) {
|
|
2510
|
-
const t =
|
|
2525
|
+
const t = ln(e), n = Co(e);
|
|
2511
2526
|
if (t === "image" && n) {
|
|
2512
2527
|
const o = document.createElement("img");
|
|
2513
|
-
return o.src = n, o.alt = "", o.setAttribute("aria-hidden", "true"), o.addEventListener("error", () => o.replaceWith(
|
|
2528
|
+
return o.src = n, o.alt = "", o.setAttribute("aria-hidden", "true"), o.addEventListener("error", () => o.replaceWith(ae(e))), o;
|
|
2514
2529
|
}
|
|
2515
2530
|
if (t === "video" && n) {
|
|
2516
2531
|
const o = document.createElement("video");
|
|
2517
|
-
return o.src = n, o.muted = !0, o.preload = "metadata", o.setAttribute("aria-hidden", "true"), o.addEventListener("error", () => o.replaceWith(
|
|
2532
|
+
return o.src = n, o.muted = !0, o.preload = "metadata", o.setAttribute("aria-hidden", "true"), o.addEventListener("error", () => o.replaceWith(ae(e))), o.addEventListener("stalled", () => o.replaceWith(ae(e))), o;
|
|
2518
2533
|
}
|
|
2519
|
-
return
|
|
2534
|
+
return ae(e);
|
|
2520
2535
|
}
|
|
2521
2536
|
function qa(e) {
|
|
2522
|
-
const t =
|
|
2537
|
+
const t = ln(e), n = Co(e);
|
|
2523
2538
|
if (t === "image" && n) {
|
|
2524
2539
|
const o = document.createElement("img");
|
|
2525
|
-
return o.className = "pluno-pa-widget__message-attachment-preview", o.src = n, o.alt = e.name, o.addEventListener("error", () => o.replaceWith(
|
|
2540
|
+
return o.className = "pluno-pa-widget__message-attachment-preview", o.src = n, o.alt = e.name, o.addEventListener("error", () => o.replaceWith(ae(e, "message"))), o;
|
|
2526
2541
|
}
|
|
2527
2542
|
if (t === "pdf" && n) {
|
|
2528
2543
|
const o = document.createElement("object");
|
|
2529
|
-
return o.className = "pluno-pa-widget__message-attachment-preview pluno-pa-widget__message-attachment-preview--pdf", o.data = n, o.type = "application/pdf", o.setAttribute("aria-label", e.name), o.addEventListener("error", () => o.replaceWith(
|
|
2544
|
+
return o.className = "pluno-pa-widget__message-attachment-preview pluno-pa-widget__message-attachment-preview--pdf", o.data = n, o.type = "application/pdf", o.setAttribute("aria-label", e.name), o.addEventListener("error", () => o.replaceWith(ae(e, "message"))), o.appendChild(ae(e, "message")), o;
|
|
2530
2545
|
}
|
|
2531
2546
|
if (t === "video" && n) {
|
|
2532
2547
|
const o = document.createElement("video");
|
|
2533
|
-
return o.className = "pluno-pa-widget__message-attachment-preview", o.src = n, o.muted = !0, o.preload = "metadata", o.addEventListener("error", () => o.replaceWith(
|
|
2548
|
+
return o.className = "pluno-pa-widget__message-attachment-preview", o.src = n, o.muted = !0, o.preload = "metadata", o.addEventListener("error", () => o.replaceWith(ae(e, "message"))), o.addEventListener("stalled", () => o.replaceWith(ae(e, "message"))), o;
|
|
2534
2549
|
}
|
|
2535
|
-
return
|
|
2550
|
+
return ae(e, "message");
|
|
2536
2551
|
}
|
|
2537
|
-
function
|
|
2552
|
+
function ae(e, t = "composer") {
|
|
2538
2553
|
if (t === "composer") {
|
|
2539
|
-
const
|
|
2540
|
-
return
|
|
2554
|
+
const r = document.createElement("span");
|
|
2555
|
+
return r.className = "pluno-pa-widget__attachment-file", r.textContent = qn(e), r;
|
|
2541
2556
|
}
|
|
2542
2557
|
const n = document.createElement("div");
|
|
2543
2558
|
n.className = "pluno-pa-widget__message-attachment-file";
|
|
2544
2559
|
const o = document.createElement("span");
|
|
2545
|
-
o.textContent =
|
|
2560
|
+
o.textContent = qn(e);
|
|
2546
2561
|
const i = document.createElement("strong");
|
|
2547
2562
|
return i.textContent = e.name, n.append(o, i), n;
|
|
2548
2563
|
}
|
|
2549
|
-
function
|
|
2564
|
+
function ln(e) {
|
|
2550
2565
|
return e.mimeType.startsWith("image/") ? "image" : e.mimeType === "application/pdf" ? "pdf" : e.mimeType.startsWith("video/") ? "video" : "file";
|
|
2551
2566
|
}
|
|
2552
|
-
function
|
|
2567
|
+
function Co(e) {
|
|
2553
2568
|
return "previewUrl" in e && e.previewUrl ? e.previewUrl : e.fileUrl ?? "";
|
|
2554
2569
|
}
|
|
2555
|
-
function
|
|
2556
|
-
const t =
|
|
2570
|
+
function qn(e) {
|
|
2571
|
+
const t = ln(e);
|
|
2557
2572
|
return t === "image" ? "IMG" : t === "pdf" ? "PDF" : t === "video" ? "VID" : "FILE";
|
|
2558
2573
|
}
|
|
2559
2574
|
function ja(e, t) {
|
|
@@ -2565,26 +2580,26 @@ function ja(e, t) {
|
|
|
2565
2580
|
function Va(e) {
|
|
2566
2581
|
return typeof URL.createObjectURL == "function" ? URL.createObjectURL(e) : void 0;
|
|
2567
2582
|
}
|
|
2568
|
-
function
|
|
2583
|
+
function pt(e) {
|
|
2569
2584
|
return !!(e && Array.from(e.types).includes("Files"));
|
|
2570
2585
|
}
|
|
2571
|
-
function
|
|
2572
|
-
if (!e || !
|
|
2586
|
+
function $t(e, t, n = null) {
|
|
2587
|
+
if (!e || !tn(t, n)) {
|
|
2573
2588
|
e && (e.hidden = !0, e.replaceChildren());
|
|
2574
2589
|
return;
|
|
2575
2590
|
}
|
|
2576
|
-
e.hidden = !1, e.replaceChildren(), e.className = "pluno-pa-widget__billing-status",
|
|
2591
|
+
e.hidden = !1, e.replaceChildren(), e.className = "pluno-pa-widget__billing-status", re(t) || pn(n) ? e.appendChild(
|
|
2577
2592
|
Ka(t, n)
|
|
2578
|
-
) :
|
|
2593
|
+
) : So(t) && e.appendChild(Ya(t));
|
|
2579
2594
|
}
|
|
2580
2595
|
function Ka(e, t) {
|
|
2581
2596
|
const n = document.createElement("div");
|
|
2582
2597
|
n.className = "pluno-pa-widget__billing-action-card";
|
|
2583
2598
|
const o = e.limitExceeded || t === "limit_exceeded", i = document.createElement("strong");
|
|
2584
2599
|
i.textContent = o ? "Credits used up" : "Billing needs attention", n.appendChild(i);
|
|
2585
|
-
const
|
|
2586
|
-
return
|
|
2587
|
-
|
|
2600
|
+
const r = document.createElement("span");
|
|
2601
|
+
return r.textContent = o ? "Earn bonus credits or upgrade to keep using Pluno on this product." : e.paymentIssue ?? "Open billing to keep using Pluno.", n.appendChild(r), n.appendChild(
|
|
2602
|
+
Eo(
|
|
2588
2603
|
e,
|
|
2589
2604
|
"Upgrade plan",
|
|
2590
2605
|
"pluno-pa-widget__billing-action-card-actions"
|
|
@@ -2598,30 +2613,30 @@ function Ya(e) {
|
|
|
2598
2613
|
n.textContent = "Credits running low", t.appendChild(n);
|
|
2599
2614
|
const o = document.createElement("span");
|
|
2600
2615
|
return o.textContent = Za(e) ?? "Credits are running low for this period.", t.appendChild(o), t.appendChild(
|
|
2601
|
-
|
|
2616
|
+
Eo(
|
|
2602
2617
|
e,
|
|
2603
2618
|
"Upgrade",
|
|
2604
2619
|
"pluno-pa-widget__billing-action-card-actions"
|
|
2605
2620
|
)
|
|
2606
2621
|
), t;
|
|
2607
2622
|
}
|
|
2608
|
-
function
|
|
2609
|
-
return e !== null && (
|
|
2623
|
+
function tn(e, t) {
|
|
2624
|
+
return e !== null && (re(e) || So(e) || pn(t));
|
|
2610
2625
|
}
|
|
2611
|
-
function
|
|
2612
|
-
return
|
|
2626
|
+
function jn(e, t, n) {
|
|
2627
|
+
return tn(t, n) || Xa(t) ? !0 : !tn(e, n);
|
|
2613
2628
|
}
|
|
2614
2629
|
function Xa(e) {
|
|
2615
|
-
return e != null && (e.creditsUsed !== null || e.creditLimit !== null || e.creditsRemaining !== null ||
|
|
2630
|
+
return e != null && (e.creditsUsed !== null || e.creditLimit !== null || e.creditsRemaining !== null || re(e));
|
|
2616
2631
|
}
|
|
2617
|
-
function
|
|
2632
|
+
function re(e) {
|
|
2618
2633
|
return e?.limitExceeded === !0 || !!e?.paymentIssue;
|
|
2619
2634
|
}
|
|
2620
|
-
function
|
|
2635
|
+
function pn(e) {
|
|
2621
2636
|
return e === "limit_exceeded" || e === "subscription_required" || e === "subscription_inactive" || e === "payment_issue" || e === "subscription_invalid" || e === "payment_required";
|
|
2622
2637
|
}
|
|
2623
|
-
function
|
|
2624
|
-
return !
|
|
2638
|
+
function So(e) {
|
|
2639
|
+
return !re(e) && e.creditLimit !== null && e.creditLimit > 0 && e.creditsRemaining !== null && e.creditsRemaining > 0 && e.creditsRemaining / e.creditLimit <= 0.2;
|
|
2625
2640
|
}
|
|
2626
2641
|
function Za(e) {
|
|
2627
2642
|
return e.creditsRemaining === null ? null : `${Ja(e.creditsRemaining)} credits left`;
|
|
@@ -2631,15 +2646,15 @@ function Ja(e) {
|
|
|
2631
2646
|
maximumFractionDigits: 0
|
|
2632
2647
|
}).format(Math.ceil(e));
|
|
2633
2648
|
}
|
|
2634
|
-
function
|
|
2649
|
+
function Eo(e, t, n) {
|
|
2635
2650
|
const o = document.createElement("div");
|
|
2636
2651
|
return o.className = n, o.appendChild(
|
|
2637
|
-
|
|
2652
|
+
Vn(t, e.pricingUrl)
|
|
2638
2653
|
), o.appendChild(
|
|
2639
|
-
|
|
2654
|
+
Vn("Earn credits", e.earnCreditsUrl)
|
|
2640
2655
|
), o;
|
|
2641
2656
|
}
|
|
2642
|
-
function
|
|
2657
|
+
function Vn(e, t) {
|
|
2643
2658
|
const n = document.createElement("button");
|
|
2644
2659
|
if (n.type = "button", e === "Earn credits") {
|
|
2645
2660
|
const o = document.createElement("span");
|
|
@@ -2650,117 +2665,131 @@ function qn(e, t) {
|
|
|
2650
2665
|
t.trim().length !== 0 && window.open(t, "_blank", "noopener,noreferrer");
|
|
2651
2666
|
}), n;
|
|
2652
2667
|
}
|
|
2653
|
-
function
|
|
2668
|
+
function qt(e, t) {
|
|
2654
2669
|
return e.messages.filter(
|
|
2655
|
-
(o) => !
|
|
2670
|
+
(o) => !ko(o)
|
|
2656
2671
|
).length === 0 && !e.assistantDraft && !e.lastError && !e.isThinking && !t;
|
|
2657
2672
|
}
|
|
2658
|
-
function Qa(e, t, n, o, i,
|
|
2659
|
-
const
|
|
2660
|
-
(
|
|
2661
|
-
),
|
|
2662
|
-
|
|
2673
|
+
function Qa(e, t, n, o, i, r, l, p, d, c, u, m, k, v, R, C, g, y, h) {
|
|
2674
|
+
const A = or(r), L = A.filter(
|
|
2675
|
+
(x) => !ko(x)
|
|
2676
|
+
), M = e.scrollTop, U = [], Ie = /* @__PURE__ */ new Set(), H = (x) => {
|
|
2677
|
+
U.push(x);
|
|
2663
2678
|
};
|
|
2664
|
-
|
|
2665
|
-
const
|
|
2666
|
-
if (o(
|
|
2667
|
-
const
|
|
2668
|
-
|
|
2669
|
-
const
|
|
2670
|
-
|
|
2671
|
-
const
|
|
2679
|
+
Io(n, r.isThinking), i.hidden = !p, p && l !== null && bo(i, l);
|
|
2680
|
+
const xe = L.length > 0 || !!r.assistantDraft || r.isThinking;
|
|
2681
|
+
if (o(xe), g || L.length === 0 && !r.assistantDraft && !r.lastError && !r.isThinking) {
|
|
2682
|
+
const x = document.createElement("div");
|
|
2683
|
+
x.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter" + (g ? " pluno-pa-widget__empty-state--morning-report" : "");
|
|
2684
|
+
const D = document.createElement("div");
|
|
2685
|
+
D.className = "pluno-pa-widget__empty-hero";
|
|
2686
|
+
const $ = _e(
|
|
2672
2687
|
"pluno-pa-widget__character--empty",
|
|
2673
2688
|
v()
|
|
2674
2689
|
);
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2690
|
+
if (D.appendChild($), x.appendChild(D), g) {
|
|
2691
|
+
const S = document.createElement("h2");
|
|
2692
|
+
S.className = "pluno-pa-widget__empty pluno-pa-widget__morning-report-title", S.textContent = g.opening, x.appendChild(S);
|
|
2693
|
+
} else
|
|
2694
|
+
x.appendChild(wo());
|
|
2695
|
+
const P = g?.prompts ?? r.starterPrompts, j = document.createElement("div");
|
|
2696
|
+
if (j.className = P.length > 0 ? "pluno-pa-widget__starter-prompts" : "pluno-pa-widget__starter-prompts pluno-pa-widget__starter-prompts--empty", P.length === 0 && !r.starterPromptsLoading && j.setAttribute("aria-hidden", "true"), P.length > 0)
|
|
2697
|
+
for (const S of P) {
|
|
2698
|
+
const N = document.createElement("button");
|
|
2699
|
+
N.type = "button", N.className = "pluno-pa-widget__starter-prompt", N.textContent = `"${S}"`, N.addEventListener("click", () => {
|
|
2700
|
+
R(S);
|
|
2701
|
+
}), j.appendChild(N);
|
|
2683
2702
|
}
|
|
2684
|
-
else if (
|
|
2685
|
-
const
|
|
2686
|
-
|
|
2703
|
+
else if (r.starterPromptsLoading) {
|
|
2704
|
+
const S = document.createElement("button");
|
|
2705
|
+
S.type = "button", S.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder pluno-pa-widget__starter-prompt--loading", S.disabled = !0, S.tabIndex = -1, S.textContent = "Generating example tasks...", j.appendChild(S);
|
|
2687
2706
|
} else
|
|
2688
|
-
for (let
|
|
2689
|
-
const
|
|
2690
|
-
|
|
2707
|
+
for (let S = 0; S < zi; S += 1) {
|
|
2708
|
+
const N = document.createElement("button");
|
|
2709
|
+
N.type = "button", N.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder", N.disabled = !0, N.tabIndex = -1, N.textContent = "", j.appendChild(N);
|
|
2691
2710
|
}
|
|
2692
|
-
|
|
2711
|
+
if (x.appendChild(j), g) {
|
|
2712
|
+
const S = document.createElement("button");
|
|
2713
|
+
S.type = "button", S.className = "pluno-pa-widget__morning-report-snooze", S.textContent = "Snooze morning report", S.addEventListener("click", y), x.appendChild(S);
|
|
2714
|
+
}
|
|
2715
|
+
m.clear(), H(x), H(t), Kn(e, U);
|
|
2693
2716
|
return;
|
|
2694
2717
|
}
|
|
2695
|
-
let
|
|
2696
|
-
const
|
|
2697
|
-
if (
|
|
2718
|
+
let G = null, w = null, J = [];
|
|
2719
|
+
const Je = L.some(nn), pe = () => {
|
|
2720
|
+
if (J.length === 0)
|
|
2698
2721
|
return !1;
|
|
2699
|
-
const
|
|
2700
|
-
|
|
2722
|
+
const x = gr(
|
|
2723
|
+
J,
|
|
2701
2724
|
u,
|
|
2702
|
-
|
|
2725
|
+
k,
|
|
2703
2726
|
v()
|
|
2704
2727
|
);
|
|
2705
|
-
return
|
|
2728
|
+
return H(x), G = null, w = x, J = [], !0;
|
|
2706
2729
|
};
|
|
2707
|
-
for (let
|
|
2708
|
-
const
|
|
2709
|
-
if (
|
|
2710
|
-
|
|
2730
|
+
for (let x = 0; x < L.length; x += 1) {
|
|
2731
|
+
const D = L[x];
|
|
2732
|
+
if (D.role === "tool") {
|
|
2733
|
+
J.push(D);
|
|
2711
2734
|
continue;
|
|
2712
2735
|
}
|
|
2713
|
-
if (
|
|
2714
|
-
if (
|
|
2715
|
-
const
|
|
2716
|
-
|
|
2736
|
+
if (nn(D)) {
|
|
2737
|
+
if (pe()) {
|
|
2738
|
+
const N = mt();
|
|
2739
|
+
H(N), G = null, w = N;
|
|
2717
2740
|
} else {
|
|
2718
|
-
const
|
|
2719
|
-
|
|
2741
|
+
const N = Zn(v());
|
|
2742
|
+
H(N), G = null, w = N;
|
|
2720
2743
|
}
|
|
2721
2744
|
continue;
|
|
2722
2745
|
}
|
|
2723
|
-
if (
|
|
2746
|
+
if (D.role === "system")
|
|
2724
2747
|
continue;
|
|
2725
|
-
const
|
|
2726
|
-
if (
|
|
2727
|
-
const
|
|
2728
|
-
|
|
2748
|
+
const $ = pe(), P = ur(D.content);
|
|
2749
|
+
if (D.role === "assistant" && !$) {
|
|
2750
|
+
const S = Lo(v());
|
|
2751
|
+
H(S), G = null, w = S;
|
|
2729
2752
|
}
|
|
2730
|
-
const
|
|
2731
|
-
|
|
2753
|
+
const j = er(D, P, m, Ie);
|
|
2754
|
+
H(j), G = j, w = null;
|
|
2732
2755
|
}
|
|
2733
|
-
const
|
|
2734
|
-
if (
|
|
2735
|
-
if (
|
|
2736
|
-
const
|
|
2737
|
-
|
|
2756
|
+
const Qe = pe(), V = L[L.length - 1]?.id === "assistant-draft";
|
|
2757
|
+
if (r.isThinking && !V && !Je)
|
|
2758
|
+
if (Qe) {
|
|
2759
|
+
const x = mt();
|
|
2760
|
+
H(x), G = null, w = x;
|
|
2738
2761
|
} else {
|
|
2739
|
-
const
|
|
2740
|
-
|
|
2741
|
-
}
|
|
2742
|
-
if (
|
|
2743
|
-
const
|
|
2744
|
-
|
|
2762
|
+
const x = Zn(v());
|
|
2763
|
+
H(x), G = null, w = x;
|
|
2764
|
+
}
|
|
2765
|
+
if (r.lastError) {
|
|
2766
|
+
const x = document.createElement("div");
|
|
2767
|
+
x.className = "pluno-pa-widget__error";
|
|
2768
|
+
const D = document.createElement("span");
|
|
2769
|
+
if (D.textContent = r.lastError, x.appendChild(D), r.lastErrorCode === "run_recovery_exhausted" || r.lastErrorCode === "transient_model_error" || r.lastErrorCode === "run_still_active") {
|
|
2770
|
+
const $ = document.createElement("button");
|
|
2771
|
+
$.type = "button", $.className = "pluno-pa-widget__error-retry", $.textContent = "Try again", $.addEventListener("click", C), x.appendChild($);
|
|
2772
|
+
}
|
|
2773
|
+
H(x), G = x, w = null;
|
|
2745
2774
|
}
|
|
2746
|
-
const
|
|
2747
|
-
if (
|
|
2748
|
-
const
|
|
2749
|
-
isDrafting:
|
|
2750
|
-
error:
|
|
2751
|
-
characterIconOptions:
|
|
2752
|
-
onDraft:
|
|
2753
|
-
onDismiss:
|
|
2754
|
-
onDisable:
|
|
2775
|
+
const ge = h && !r.isThinking ? ri(A) : null;
|
|
2776
|
+
if (h && ge && !h.dismissedCandidateIds.has(ge.id)) {
|
|
2777
|
+
const x = rr(ge, {
|
|
2778
|
+
isDrafting: h.draftingCandidateId === ge.id,
|
|
2779
|
+
error: h.error,
|
|
2780
|
+
characterIconOptions: h.characterIconOptions,
|
|
2781
|
+
onDraft: h.onDraft,
|
|
2782
|
+
onDismiss: h.onDismiss,
|
|
2783
|
+
onDisable: h.onDisable
|
|
2755
2784
|
});
|
|
2756
|
-
|
|
2785
|
+
H(x), h.onSeen(ge), G = null, w = x;
|
|
2757
2786
|
}
|
|
2758
|
-
|
|
2787
|
+
G?.classList.add("pluno-pa-widget__message--bottom-reserve"), w?.classList.add("pluno-pa-widget__bottom-reserve-compact"), H(t), nr(m, Ie), Kn(e, U), d ? Xe(e, c) : e.scrollTop = M;
|
|
2759
2788
|
}
|
|
2760
2789
|
function er(e, t, n, o) {
|
|
2761
|
-
const i = tr(e, t),
|
|
2762
|
-
if (i &&
|
|
2763
|
-
return
|
|
2790
|
+
const i = tr(e, t), r = i ? n.get(i) : void 0;
|
|
2791
|
+
if (i && r)
|
|
2792
|
+
return r.classList.remove("pluno-pa-widget__message--bottom-reserve"), o.add(i), r;
|
|
2764
2793
|
const l = document.createElement("div");
|
|
2765
2794
|
l.className = `pluno-pa-widget__message pluno-pa-widget__message--${e.role}`, e.role === "assistant" ? mr(l, t) : l.textContent = t, e.role === "user" && e.attachments?.length && l.appendChild(ir(e.attachments));
|
|
2766
2795
|
const p = document.createElement("div");
|
|
@@ -2788,7 +2817,7 @@ function nr(e, t) {
|
|
|
2788
2817
|
for (const n of e.keys())
|
|
2789
2818
|
t.has(n) || e.delete(n);
|
|
2790
2819
|
}
|
|
2791
|
-
function
|
|
2820
|
+
function Kn(e, t) {
|
|
2792
2821
|
let n = e.firstChild;
|
|
2793
2822
|
for (const o of t) {
|
|
2794
2823
|
if (o === n) {
|
|
@@ -2817,12 +2846,12 @@ function or(e) {
|
|
|
2817
2846
|
if (!t.respondsToUserMessageId)
|
|
2818
2847
|
return [...e.messages, t];
|
|
2819
2848
|
const n = e.messages.findIndex(
|
|
2820
|
-
(
|
|
2849
|
+
(r) => r.role === "user" && r.id === t.respondsToUserMessageId
|
|
2821
2850
|
);
|
|
2822
2851
|
if (n === -1)
|
|
2823
2852
|
return [...e.messages, t];
|
|
2824
2853
|
const o = e.messages.findIndex(
|
|
2825
|
-
(
|
|
2854
|
+
(r, l) => l > n && r.role !== "user" && r.respondsToUserMessageId === t.respondsToUserMessageId && Yn(r, t) && nn(r)
|
|
2826
2855
|
);
|
|
2827
2856
|
if (o !== -1)
|
|
2828
2857
|
return [
|
|
@@ -2831,7 +2860,7 @@ function or(e) {
|
|
|
2831
2860
|
...e.messages.slice(o + 1)
|
|
2832
2861
|
];
|
|
2833
2862
|
let i = n + 1;
|
|
2834
|
-
for (; i < e.messages.length && e.messages[i].role !== "user" && e.messages[i].respondsToUserMessageId === t.respondsToUserMessageId &&
|
|
2863
|
+
for (; i < e.messages.length && e.messages[i].role !== "user" && e.messages[i].respondsToUserMessageId === t.respondsToUserMessageId && Yn(e.messages[i], t); )
|
|
2835
2864
|
i += 1;
|
|
2836
2865
|
return [
|
|
2837
2866
|
...e.messages.slice(0, i),
|
|
@@ -2839,17 +2868,17 @@ function or(e) {
|
|
|
2839
2868
|
...e.messages.slice(i)
|
|
2840
2869
|
];
|
|
2841
2870
|
}
|
|
2842
|
-
function
|
|
2871
|
+
function nn(e) {
|
|
2843
2872
|
return e.role === "system" && e.dataType === "run_status" && e.loading === !0;
|
|
2844
2873
|
}
|
|
2845
|
-
function
|
|
2874
|
+
function Yn(e, t) {
|
|
2846
2875
|
return !e.runId || !t.runId ? !0 : e.runId === t.runId;
|
|
2847
2876
|
}
|
|
2848
|
-
function
|
|
2849
|
-
e.replaceChildren(),
|
|
2877
|
+
function Xn(e, t, n, o, i, r, l, p) {
|
|
2878
|
+
e.replaceChildren(), Io(t, !1), t.disabled = !0, n(!1);
|
|
2850
2879
|
const d = document.createElement("div");
|
|
2851
2880
|
d.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter";
|
|
2852
|
-
const c =
|
|
2881
|
+
const c = _e(
|
|
2853
2882
|
"pluno-pa-widget__character--empty",
|
|
2854
2883
|
o()
|
|
2855
2884
|
);
|
|
@@ -2857,10 +2886,10 @@ function Kn(e, t, n, o, i, a, l, p) {
|
|
|
2857
2886
|
const u = document.createElement("div");
|
|
2858
2887
|
if (u.className = "pluno-pa-widget__empty", u.textContent = i, d.appendChild(u), l) {
|
|
2859
2888
|
const m = document.createElement("a");
|
|
2860
|
-
m.className = "pluno-pa-widget__login", m.href = l, m.target = "_blank", m.rel = "noopener noreferrer", m.textContent =
|
|
2889
|
+
m.className = "pluno-pa-widget__login", m.href = l, m.target = "_blank", m.rel = "noopener noreferrer", m.textContent = r, d.appendChild(m);
|
|
2861
2890
|
} else {
|
|
2862
2891
|
const m = document.createElement("button");
|
|
2863
|
-
m.type = "button", m.className = "pluno-pa-widget__login", m.textContent =
|
|
2892
|
+
m.type = "button", m.className = "pluno-pa-widget__login", m.textContent = r, m.addEventListener("click", () => p?.()), d.appendChild(m);
|
|
2864
2893
|
}
|
|
2865
2894
|
e.appendChild(d);
|
|
2866
2895
|
}
|
|
@@ -2882,15 +2911,15 @@ function rr(e, t) {
|
|
|
2882
2911
|
n.className = "pluno-pa-widget__share-prompt";
|
|
2883
2912
|
const o = document.createElement("div");
|
|
2884
2913
|
o.className = "pluno-pa-widget__share-prompt-body", o.appendChild(
|
|
2885
|
-
|
|
2914
|
+
_e(
|
|
2886
2915
|
"pluno-pa-widget__share-prompt-icon",
|
|
2887
2916
|
t.characterIconOptions
|
|
2888
2917
|
)
|
|
2889
2918
|
);
|
|
2890
2919
|
const i = document.createElement("div");
|
|
2891
2920
|
i.className = "pluno-pa-widget__share-prompt-copy";
|
|
2892
|
-
const
|
|
2893
|
-
|
|
2921
|
+
const r = document.createElement("strong");
|
|
2922
|
+
r.textContent = "Share this win?", i.appendChild(r);
|
|
2894
2923
|
const l = document.createElement("span");
|
|
2895
2924
|
if (l.textContent = t.isDrafting ? "Drafting social post..." : "Create a screenshot and generate a draft for a social post.", i.appendChild(l), t.error) {
|
|
2896
2925
|
const u = document.createElement("span");
|
|
@@ -2904,7 +2933,7 @@ function rr(e, t) {
|
|
|
2904
2933
|
const c = document.createElement("button");
|
|
2905
2934
|
if (c.type = "button", c.disabled = t.isDrafting, c.addEventListener("click", () => {
|
|
2906
2935
|
t.onDraft(e);
|
|
2907
|
-
}), t.isDrafting ? (c.appendChild(
|
|
2936
|
+
}), t.isDrafting ? (c.appendChild(on()), c.appendChild(document.createTextNode("Drafting..."))) : c.textContent = "Draft a social post", d.appendChild(c), t.isDrafting)
|
|
2908
2937
|
p.appendChild(d);
|
|
2909
2938
|
else {
|
|
2910
2939
|
const u = document.createElement("button");
|
|
@@ -2925,8 +2954,8 @@ function lr(e, t) {
|
|
|
2925
2954
|
});
|
|
2926
2955
|
const o = document.createElement("section");
|
|
2927
2956
|
o.className = "pluno-pa-widget__share-dialog", o.setAttribute("role", "dialog"), o.setAttribute("aria-modal", "true"), o.setAttribute("aria-label", "Draft a social post");
|
|
2928
|
-
const i = document.createElement("header"),
|
|
2929
|
-
|
|
2957
|
+
const i = document.createElement("header"), r = document.createElement("strong");
|
|
2958
|
+
r.textContent = "Share this win", i.appendChild(r);
|
|
2930
2959
|
const l = document.createElement("button");
|
|
2931
2960
|
l.type = "button", l.setAttribute("aria-label", "Close"), l.textContent = "×", l.addEventListener("click", t.onClose), i.appendChild(l), o.appendChild(i);
|
|
2932
2961
|
const p = document.createElement("p");
|
|
@@ -2950,27 +2979,27 @@ function lr(e, t) {
|
|
|
2950
2979
|
if (c.appendChild(m), d.appendChild(c), e.screenshotDataUrl) {
|
|
2951
2980
|
const g = document.createElement("div");
|
|
2952
2981
|
g.className = "pluno-pa-widget__share-dialog-screenshot";
|
|
2953
|
-
const
|
|
2954
|
-
|
|
2982
|
+
const y = document.createElement("img");
|
|
2983
|
+
y.src = e.screenshotDataUrl, y.alt = "Product page with Pluno open", g.appendChild(y), d.appendChild(g);
|
|
2955
2984
|
}
|
|
2956
2985
|
o.appendChild(d), o.appendChild(p);
|
|
2957
|
-
const
|
|
2958
|
-
|
|
2986
|
+
const k = document.createElement("div");
|
|
2987
|
+
k.className = "pluno-pa-widget__share-dialog-step";
|
|
2959
2988
|
const v = document.createElement("strong");
|
|
2960
|
-
v.className = "pluno-pa-widget__share-dialog-step-title", v.textContent = "2) Share on",
|
|
2961
|
-
const
|
|
2962
|
-
|
|
2963
|
-
const
|
|
2964
|
-
|
|
2989
|
+
v.className = "pluno-pa-widget__share-dialog-step-title", v.textContent = "2) Share on", k.appendChild(v);
|
|
2990
|
+
const R = document.createElement("p");
|
|
2991
|
+
R.className = "pluno-pa-widget__share-dialog-hint", R.textContent = "Post draft opens prefilled on supported platforms.", k.appendChild(R);
|
|
2992
|
+
const C = document.createElement("footer");
|
|
2993
|
+
C.className = "pluno-pa-widget__share-dialog-platforms";
|
|
2965
2994
|
for (const g of sr(e)) {
|
|
2966
|
-
const
|
|
2967
|
-
|
|
2995
|
+
const y = document.createElement("a");
|
|
2996
|
+
y.href = g.href, y.target = "_blank", y.rel = "noopener noreferrer", y.title = g.label, y.setAttribute("aria-label", `Open ${g.label}`), y.appendChild(dr(g.id)), C.appendChild(y);
|
|
2968
2997
|
}
|
|
2969
|
-
if (
|
|
2998
|
+
if (k.appendChild(C), o.appendChild(k), t.socialPostRewardsUrl) {
|
|
2970
2999
|
const g = document.createElement("div");
|
|
2971
3000
|
g.className = "pluno-pa-widget__share-dialog-step";
|
|
2972
|
-
const
|
|
2973
|
-
|
|
3001
|
+
const y = document.createElement("strong");
|
|
3002
|
+
y.className = "pluno-pa-widget__share-dialog-step-title", y.textContent = "3) Submit post to get 2000 free credits!", g.appendChild(y);
|
|
2974
3003
|
const h = document.createElement("a");
|
|
2975
3004
|
h.className = "pluno-pa-widget__share-dialog-reward-link", h.href = t.socialPostRewardsUrl, h.target = "_blank", h.rel = "noopener noreferrer", h.appendChild(document.createTextNode("Submit post URL")), h.appendChild(cr()), g.appendChild(h), o.appendChild(g);
|
|
2976
3005
|
}
|
|
@@ -3004,40 +3033,40 @@ function sr(e) {
|
|
|
3004
3033
|
}
|
|
3005
3034
|
function dr(e) {
|
|
3006
3035
|
const t = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
3007
|
-
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" ? (
|
|
3036
|
+
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" ? (W(t, "M6.7 13.2c.4 4.1.2 8.1.1 12.3"), W(
|
|
3008
3037
|
t,
|
|
3009
3038
|
"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"
|
|
3010
|
-
),
|
|
3039
|
+
), W(t, "M14.4 13.3c.1 3.8.1 7.8 0 11.9"), W(
|
|
3011
3040
|
t,
|
|
3012
3041
|
"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"
|
|
3013
|
-
),
|
|
3042
|
+
), W(t, "M20 18c.1 2.2.1 4.7 0 7.2"), t) : e === "x" ? (W(t, "M7.2 7.4c5.6 6.4 10.9 12.2 17.7 17.2"), W(t, "M24.4 7.2c-5.1 6.3-10.6 11.8-17 17.8"), W(t, "M9.1 8.2c5.1 5.6 9.7 10.8 15 15.5", "0.55"), t) : (W(
|
|
3014
3043
|
t,
|
|
3015
3044
|
"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"
|
|
3016
|
-
),
|
|
3045
|
+
), W(
|
|
3017
3046
|
t,
|
|
3018
3047
|
"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",
|
|
3019
3048
|
"0.48"
|
|
3020
|
-
),
|
|
3049
|
+
), W(
|
|
3021
3050
|
t,
|
|
3022
3051
|
"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"
|
|
3023
|
-
),
|
|
3052
|
+
), W(
|
|
3024
3053
|
t,
|
|
3025
3054
|
"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"
|
|
3026
3055
|
), t);
|
|
3027
3056
|
}
|
|
3028
|
-
function
|
|
3057
|
+
function W(e, t, n) {
|
|
3029
3058
|
const o = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
3030
3059
|
o.setAttribute("d", t), n && o.setAttribute("opacity", n), e.appendChild(o);
|
|
3031
3060
|
}
|
|
3032
3061
|
function cr() {
|
|
3033
3062
|
const e = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
3034
|
-
return e.setAttribute("class", "pluno-pa-widget__share-dialog-external-icon"), e.setAttribute("viewBox", "0 0 24 24"), e.setAttribute("aria-hidden", "true"),
|
|
3063
|
+
return e.setAttribute("class", "pluno-pa-widget__share-dialog-external-icon"), e.setAttribute("viewBox", "0 0 24 24"), e.setAttribute("aria-hidden", "true"), W(e, "M14 5h5v5"), W(e, "M19 5l-8 8"), W(
|
|
3035
3064
|
e,
|
|
3036
3065
|
"M18 13v5a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1h5"
|
|
3037
3066
|
), e;
|
|
3038
3067
|
}
|
|
3039
|
-
function
|
|
3040
|
-
return e.role === "tool" && e.toolName ===
|
|
3068
|
+
function ko(e) {
|
|
3069
|
+
return e.role === "tool" && e.toolName === io;
|
|
3041
3070
|
}
|
|
3042
3071
|
function ur(e) {
|
|
3043
3072
|
return e.replace(/\uE200[^\uE201]*(?:\uE201|$)/g, "");
|
|
@@ -3047,45 +3076,45 @@ function gr(e, t, n, o) {
|
|
|
3047
3076
|
i.className = "pluno-pa-widget__tool-group", i.title = new Date(
|
|
3048
3077
|
e[e.length - 1].createdAt
|
|
3049
3078
|
).toLocaleString(), i.appendChild(
|
|
3050
|
-
|
|
3079
|
+
_e(
|
|
3051
3080
|
"pluno-pa-widget__character--tool-group",
|
|
3052
3081
|
o
|
|
3053
3082
|
)
|
|
3054
3083
|
);
|
|
3055
|
-
const
|
|
3056
|
-
|
|
3057
|
-
i.classList.toggle("pluno-pa-widget__tool-group--open",
|
|
3084
|
+
const r = document.createElement("details"), l = hr(e);
|
|
3085
|
+
r.open = t.has(l), i.classList.toggle("pluno-pa-widget__tool-group--open", r.open), r.addEventListener("toggle", () => {
|
|
3086
|
+
i.classList.toggle("pluno-pa-widget__tool-group--open", r.open), r.open ? t.add(l) : t.delete(l), n();
|
|
3058
3087
|
});
|
|
3059
3088
|
const p = document.createElement("summary");
|
|
3060
|
-
p.className = "pluno-pa-widget__tool-summary", e.some((u) => u.loading) && p.appendChild(
|
|
3089
|
+
p.className = "pluno-pa-widget__tool-summary", e.some((u) => u.loading) && p.appendChild(on());
|
|
3061
3090
|
const c = document.createElement("span");
|
|
3062
|
-
if (c.className = "pluno-pa-widget__tool-summary-title", c.textContent = e[e.length - 1].content || "Run tool", p.appendChild(c),
|
|
3091
|
+
if (c.className = "pluno-pa-widget__tool-summary-title", c.textContent = e[e.length - 1].content || "Run tool", p.appendChild(c), r.appendChild(p), e.length > 0) {
|
|
3063
3092
|
const u = document.createElement("div");
|
|
3064
3093
|
u.className = "pluno-pa-widget__tool-lines";
|
|
3065
3094
|
for (const m of e) {
|
|
3066
|
-
const
|
|
3067
|
-
|
|
3095
|
+
const k = document.createElement("div");
|
|
3096
|
+
k.className = "pluno-pa-widget__tool-line", m.loading && k.appendChild(on());
|
|
3068
3097
|
const v = document.createElement("span");
|
|
3069
|
-
v.textContent = m.content || "Run tool",
|
|
3098
|
+
v.textContent = m.content || "Run tool", k.appendChild(v), u.appendChild(k);
|
|
3070
3099
|
}
|
|
3071
|
-
|
|
3100
|
+
r.appendChild(u);
|
|
3072
3101
|
}
|
|
3073
|
-
return i.appendChild(
|
|
3102
|
+
return i.appendChild(r), i;
|
|
3074
3103
|
}
|
|
3075
|
-
function
|
|
3104
|
+
function Lo(e) {
|
|
3076
3105
|
const t = document.createElement("article");
|
|
3077
3106
|
return t.className = "pluno-pa-widget__tool-group pluno-pa-widget__assistant-marker", t.appendChild(
|
|
3078
|
-
|
|
3107
|
+
_e(
|
|
3079
3108
|
"pluno-pa-widget__character--tool-group",
|
|
3080
3109
|
e
|
|
3081
3110
|
)
|
|
3082
3111
|
), t;
|
|
3083
3112
|
}
|
|
3084
|
-
function
|
|
3085
|
-
const t =
|
|
3086
|
-
return t.classList.add("pluno-pa-widget__thinking-marker"), t.appendChild(
|
|
3113
|
+
function Zn(e) {
|
|
3114
|
+
const t = Lo(e);
|
|
3115
|
+
return t.classList.add("pluno-pa-widget__thinking-marker"), t.appendChild(mt()), t;
|
|
3087
3116
|
}
|
|
3088
|
-
function
|
|
3117
|
+
function mt(e = "Thinking...") {
|
|
3089
3118
|
const t = document.createElement("div");
|
|
3090
3119
|
t.className = "pluno-pa-widget__status";
|
|
3091
3120
|
const n = document.createElement("span");
|
|
@@ -3096,12 +3125,12 @@ function ut(e = "Thinking...") {
|
|
|
3096
3125
|
function hr(e) {
|
|
3097
3126
|
return `tools:${e[0]?.id ?? ""}`;
|
|
3098
3127
|
}
|
|
3099
|
-
function
|
|
3128
|
+
function on() {
|
|
3100
3129
|
const e = document.createElement("span");
|
|
3101
3130
|
return e.className = "pluno-pa-widget__spinner", e.setAttribute("aria-hidden", "true"), e;
|
|
3102
3131
|
}
|
|
3103
|
-
function
|
|
3104
|
-
e.setAttribute("aria-label", t ? "Stop" : "Send"), e.classList.toggle("pluno-pa-widget__send--stop", t), e.replaceChildren(t ? Fa() :
|
|
3132
|
+
function Io(e, t) {
|
|
3133
|
+
e.setAttribute("aria-label", t ? "Stop" : "Send"), e.classList.toggle("pluno-pa-widget__send--stop", t), e.replaceChildren(t ? Fa() : vo());
|
|
3105
3134
|
}
|
|
3106
3135
|
function mr(e, t) {
|
|
3107
3136
|
const n = t.replace(/\r\n/g, `
|
|
@@ -3127,14 +3156,14 @@ function mr(e, t) {
|
|
|
3127
3156
|
const l = i.match(/^(#{1,3})\s+(.+)$/);
|
|
3128
3157
|
if (l) {
|
|
3129
3158
|
const c = document.createElement(`h${l[1].length + 2}`);
|
|
3130
|
-
|
|
3159
|
+
st(c, l[2]), e.appendChild(c), o += 1;
|
|
3131
3160
|
continue;
|
|
3132
3161
|
}
|
|
3133
3162
|
if (/^\s*[-*+]\s+/.test(i)) {
|
|
3134
3163
|
const c = document.createElement("ul");
|
|
3135
3164
|
for (; o < n.length && /^\s*[-*+]\s+/.test(n[o]); ) {
|
|
3136
3165
|
const u = document.createElement("li");
|
|
3137
|
-
|
|
3166
|
+
st(u, n[o].replace(/^\s*[-*+]\s+/, "")), c.appendChild(u), o += 1;
|
|
3138
3167
|
}
|
|
3139
3168
|
e.appendChild(c);
|
|
3140
3169
|
continue;
|
|
@@ -3143,7 +3172,7 @@ function mr(e, t) {
|
|
|
3143
3172
|
const c = document.createElement("ol");
|
|
3144
3173
|
for (; o < n.length && /^\s*\d+\.\s+/.test(n[o]); ) {
|
|
3145
3174
|
const u = document.createElement("li");
|
|
3146
|
-
|
|
3175
|
+
st(u, n[o].replace(/^\s*\d+\.\s+/, "")), c.appendChild(u), o += 1;
|
|
3147
3176
|
}
|
|
3148
3177
|
e.appendChild(c);
|
|
3149
3178
|
continue;
|
|
@@ -3153,17 +3182,17 @@ function mr(e, t) {
|
|
|
3153
3182
|
p.push(n[o]), o += 1;
|
|
3154
3183
|
const d = document.createElement("p");
|
|
3155
3184
|
p.forEach((c, u) => {
|
|
3156
|
-
u > 0 && d.appendChild(document.createElement("br")),
|
|
3185
|
+
u > 0 && d.appendChild(document.createElement("br")), st(d, c);
|
|
3157
3186
|
}), e.appendChild(d);
|
|
3158
3187
|
}
|
|
3159
3188
|
}
|
|
3160
|
-
function
|
|
3189
|
+
function st(e, t) {
|
|
3161
3190
|
const n = /(`[^`]+`|\*\*[^*]+\*\*|\*[^*]+\*|\[[^\]]+\]\(([^)\s]+)\))/g;
|
|
3162
3191
|
let o = 0;
|
|
3163
3192
|
for (const i of t.matchAll(n)) {
|
|
3164
|
-
const
|
|
3165
|
-
|
|
3166
|
-
document.createTextNode(t.slice(o,
|
|
3193
|
+
const r = i.index ?? 0;
|
|
3194
|
+
r > o && e.appendChild(
|
|
3195
|
+
document.createTextNode(t.slice(o, r))
|
|
3167
3196
|
);
|
|
3168
3197
|
const l = i[0];
|
|
3169
3198
|
if (l.startsWith("`")) {
|
|
@@ -3183,7 +3212,7 @@ function rt(e, t) {
|
|
|
3183
3212
|
} else
|
|
3184
3213
|
e.appendChild(document.createTextNode(l));
|
|
3185
3214
|
}
|
|
3186
|
-
o =
|
|
3215
|
+
o = r + l.length;
|
|
3187
3216
|
}
|
|
3188
3217
|
o < t.length && e.appendChild(document.createTextNode(t.slice(o)));
|
|
3189
3218
|
}
|
|
@@ -3197,7 +3226,7 @@ function fr(e) {
|
|
|
3197
3226
|
return !1;
|
|
3198
3227
|
}
|
|
3199
3228
|
}
|
|
3200
|
-
function
|
|
3229
|
+
function Jn(e, t) {
|
|
3201
3230
|
if (wr(e))
|
|
3202
3231
|
return;
|
|
3203
3232
|
const n = `
|
|
@@ -3251,7 +3280,7 @@ function Xn(e, t) {
|
|
|
3251
3280
|
--pluno-pa-accent-contrast: #fafafa;
|
|
3252
3281
|
position: fixed;
|
|
3253
3282
|
z-index: 2147483645;
|
|
3254
|
-
font-family: ${
|
|
3283
|
+
font-family: ${ie.fontFamily};
|
|
3255
3284
|
font-size: 14px;
|
|
3256
3285
|
color: var(--pluno-pa-text);
|
|
3257
3286
|
width: var(--pluno-pa-launcher-width);
|
|
@@ -4330,7 +4359,7 @@ function Xn(e, t) {
|
|
|
4330
4359
|
place-items: center;
|
|
4331
4360
|
padding: 18px;
|
|
4332
4361
|
background: rgba(24, 24, 27, 0.28);
|
|
4333
|
-
font-family: var(--pluno-pa-font, ${
|
|
4362
|
+
font-family: var(--pluno-pa-font, ${ie.fontFamily});
|
|
4334
4363
|
color: var(--pluno-pa-text);
|
|
4335
4364
|
}
|
|
4336
4365
|
.pluno-pa-widget__share-dialog {
|
|
@@ -4901,6 +4930,23 @@ function Xn(e, t) {
|
|
|
4901
4930
|
padding: 36px 4px calc(var(--pluno-pa-starter-edge-gap) - 12px);
|
|
4902
4931
|
text-align: left;
|
|
4903
4932
|
}
|
|
4933
|
+
.pluno-pa-widget__empty-state--morning-report {
|
|
4934
|
+
--pluno-pa-starter-edge-gap: 18px;
|
|
4935
|
+
margin: auto 0;
|
|
4936
|
+
padding: 12px 4px;
|
|
4937
|
+
}
|
|
4938
|
+
.pluno-pa-widget__error-retry {
|
|
4939
|
+
display: block;
|
|
4940
|
+
margin-top: 6px;
|
|
4941
|
+
padding: 0;
|
|
4942
|
+
border: 0;
|
|
4943
|
+
background: transparent;
|
|
4944
|
+
color: inherit;
|
|
4945
|
+
font: inherit;
|
|
4946
|
+
font-weight: 700;
|
|
4947
|
+
text-decoration: underline;
|
|
4948
|
+
cursor: pointer;
|
|
4949
|
+
}
|
|
4904
4950
|
.pluno-pa-widget__empty-state--starter .pluno-pa-widget__empty {
|
|
4905
4951
|
color: var(--pluno-pa-text);
|
|
4906
4952
|
font-size: 24px;
|
|
@@ -4908,6 +4954,21 @@ function Xn(e, t) {
|
|
|
4908
4954
|
line-height: 1.34;
|
|
4909
4955
|
text-align: left;
|
|
4910
4956
|
}
|
|
4957
|
+
.pluno-pa-widget__morning-report-snooze {
|
|
4958
|
+
justify-self: end;
|
|
4959
|
+
margin-top: calc(var(--pluno-pa-starter-edge-gap) * -0.55);
|
|
4960
|
+
padding: 4px 8px;
|
|
4961
|
+
border: 0;
|
|
4962
|
+
background: transparent;
|
|
4963
|
+
color: var(--pluno-pa-muted);
|
|
4964
|
+
font: inherit;
|
|
4965
|
+
font-size: 12px;
|
|
4966
|
+
text-decoration: underline;
|
|
4967
|
+
cursor: pointer;
|
|
4968
|
+
}
|
|
4969
|
+
.pluno-pa-widget__empty-state--morning-report .pluno-pa-widget__morning-report-snooze {
|
|
4970
|
+
margin-top: -6px;
|
|
4971
|
+
}
|
|
4911
4972
|
.pluno-pa-widget__empty-hero {
|
|
4912
4973
|
display: inline-flex;
|
|
4913
4974
|
align-items: center;
|
|
@@ -4968,6 +5029,9 @@ function Xn(e, t) {
|
|
|
4968
5029
|
gap: 18px;
|
|
4969
5030
|
width: min(100%, 320px);
|
|
4970
5031
|
}
|
|
5032
|
+
.pluno-pa-widget__empty-state--morning-report .pluno-pa-widget__starter-prompts {
|
|
5033
|
+
gap: 12px;
|
|
5034
|
+
}
|
|
4971
5035
|
.pluno-pa-widget__starter-prompts--empty {
|
|
4972
5036
|
pointer-events: none;
|
|
4973
5037
|
}
|
|
@@ -5118,8 +5182,8 @@ function Xn(e, t) {
|
|
|
5118
5182
|
.pluno-pa-widget--scribble .pluno-pa-widget__scribble-spirals--panel {
|
|
5119
5183
|
position: absolute;
|
|
5120
5184
|
top: -16px;
|
|
5121
|
-
left: ${
|
|
5122
|
-
width: calc(100% - ${
|
|
5185
|
+
left: ${Zt}px;
|
|
5186
|
+
width: calc(100% - ${Zt * 2}px);
|
|
5123
5187
|
height: 36px;
|
|
5124
5188
|
z-index: 3;
|
|
5125
5189
|
filter: url(#pluno-pa-scribble-wobble-2);
|
|
@@ -5163,6 +5227,10 @@ function Xn(e, t) {
|
|
|
5163
5227
|
.pluno-pa-widget--scribble .pluno-pa-widget__empty-state--starter .pluno-pa-widget__character--empty {
|
|
5164
5228
|
margin-bottom: 0;
|
|
5165
5229
|
}
|
|
5230
|
+
.pluno-pa-widget--scribble .pluno-pa-widget__empty-state--morning-report .pluno-pa-widget__character--empty {
|
|
5231
|
+
width: 96px;
|
|
5232
|
+
height: 96px;
|
|
5233
|
+
}
|
|
5166
5234
|
.pluno-pa-widget--scribble .pluno-pa-widget__character--tool-group {
|
|
5167
5235
|
width: 60px;
|
|
5168
5236
|
height: 60px;
|
|
@@ -5470,20 +5538,20 @@ function Xn(e, t) {
|
|
|
5470
5538
|
if (br(e, n))
|
|
5471
5539
|
return;
|
|
5472
5540
|
const o = e.ownerDocument.createElement("style");
|
|
5473
|
-
o.id =
|
|
5541
|
+
o.id = ho, o.textContent = n, e.appendChild(o), Po(e);
|
|
5474
5542
|
}
|
|
5475
5543
|
function wr(e) {
|
|
5476
|
-
return e.getElementById(
|
|
5544
|
+
return e.getElementById(ho) !== null || e.host instanceof HTMLElement && e.host.getAttribute(mo) === "true";
|
|
5477
5545
|
}
|
|
5478
|
-
function
|
|
5479
|
-
e.host instanceof HTMLElement && e.host.setAttribute(
|
|
5546
|
+
function Po(e) {
|
|
5547
|
+
e.host instanceof HTMLElement && e.host.setAttribute(mo, "true");
|
|
5480
5548
|
}
|
|
5481
5549
|
function br(e, t) {
|
|
5482
5550
|
if (typeof CSSStyleSheet > "u" || typeof CSSStyleSheet.prototype.replaceSync != "function" || !("adoptedStyleSheets" in e))
|
|
5483
5551
|
return !1;
|
|
5484
5552
|
try {
|
|
5485
5553
|
const n = new CSSStyleSheet();
|
|
5486
|
-
return n.replaceSync(t), e.adoptedStyleSheets = [...e.adoptedStyleSheets, n],
|
|
5554
|
+
return n.replaceSync(t), e.adoptedStyleSheets = [...e.adoptedStyleSheets, n], Po(e), !0;
|
|
5487
5555
|
} catch {
|
|
5488
5556
|
return !1;
|
|
5489
5557
|
}
|
|
@@ -5496,7 +5564,7 @@ async function _r() {
|
|
|
5496
5564
|
t.observe(document.documentElement, { childList: !0 });
|
|
5497
5565
|
});
|
|
5498
5566
|
}
|
|
5499
|
-
function
|
|
5567
|
+
function To(e) {
|
|
5500
5568
|
return `pluno.productAgent.widgetState.${location.origin}.${e.backendUrl ?? ""}.${e.tokenEndpoint ?? ""}.${e.position ?? ""}`;
|
|
5501
5569
|
}
|
|
5502
5570
|
function xr(e) {
|
|
@@ -5504,10 +5572,10 @@ function xr(e) {
|
|
|
5504
5572
|
return { clientId: e, release: () => {
|
|
5505
5573
|
} };
|
|
5506
5574
|
let t = 0;
|
|
5507
|
-
for (;
|
|
5575
|
+
for (; Mt.has(t); )
|
|
5508
5576
|
t += 1;
|
|
5509
|
-
|
|
5510
|
-
const n = `${
|
|
5577
|
+
Mt.add(t);
|
|
5578
|
+
const n = `${Ri}${t}`;
|
|
5511
5579
|
let o = crypto.randomUUID();
|
|
5512
5580
|
try {
|
|
5513
5581
|
o = window.sessionStorage.getItem(n) ?? o, window.sessionStorage.setItem(n, o);
|
|
@@ -5517,15 +5585,15 @@ function xr(e) {
|
|
|
5517
5585
|
return {
|
|
5518
5586
|
clientId: o,
|
|
5519
5587
|
release: () => {
|
|
5520
|
-
i || (i = !0,
|
|
5588
|
+
i || (i = !0, Mt.delete(t));
|
|
5521
5589
|
}
|
|
5522
5590
|
};
|
|
5523
5591
|
}
|
|
5524
5592
|
function yr(e) {
|
|
5525
5593
|
try {
|
|
5526
|
-
const t = window.localStorage.getItem(
|
|
5594
|
+
const t = window.localStorage.getItem(To(e));
|
|
5527
5595
|
if (!t)
|
|
5528
|
-
return
|
|
5596
|
+
return Qn();
|
|
5529
5597
|
const n = JSON.parse(t);
|
|
5530
5598
|
return {
|
|
5531
5599
|
isOpen: n.isOpen === !0,
|
|
@@ -5536,19 +5604,19 @@ function yr(e) {
|
|
|
5536
5604
|
(o) => typeof o == "string"
|
|
5537
5605
|
) : [],
|
|
5538
5606
|
launcherPosition: Er(n.launcherPosition) ? n.launcherPosition : null,
|
|
5539
|
-
panelSize: kr(n.panelSize) ?
|
|
5540
|
-
seenShareCandidateIds: Array.isArray(n.seenShareCandidateIds) ? n.seenShareCandidateIds.filter((o) => typeof o == "string").slice(-
|
|
5607
|
+
panelSize: kr(n.panelSize) ? ft(n.panelSize) : null,
|
|
5608
|
+
seenShareCandidateIds: Array.isArray(n.seenShareCandidateIds) ? n.seenShareCandidateIds.filter((o) => typeof o == "string").slice(-ao) : [],
|
|
5541
5609
|
sharePromptsDisabled: n.sharePromptsDisabled === !0
|
|
5542
5610
|
};
|
|
5543
5611
|
} catch {
|
|
5544
|
-
return
|
|
5612
|
+
return Qn();
|
|
5545
5613
|
}
|
|
5546
5614
|
}
|
|
5547
5615
|
async function vr(e) {
|
|
5548
5616
|
if (e.loadSharePromptsDisabled)
|
|
5549
5617
|
return e.loadSharePromptsDisabled();
|
|
5550
5618
|
try {
|
|
5551
|
-
return window.localStorage.getItem(
|
|
5619
|
+
return window.localStorage.getItem(lo) === "true";
|
|
5552
5620
|
} catch {
|
|
5553
5621
|
return !1;
|
|
5554
5622
|
}
|
|
@@ -5562,12 +5630,12 @@ function Cr(e, t) {
|
|
|
5562
5630
|
return;
|
|
5563
5631
|
}
|
|
5564
5632
|
try {
|
|
5565
|
-
t && window.localStorage.setItem(
|
|
5633
|
+
t && window.localStorage.setItem(lo, "true");
|
|
5566
5634
|
} catch {
|
|
5567
5635
|
return;
|
|
5568
5636
|
}
|
|
5569
5637
|
}
|
|
5570
|
-
function
|
|
5638
|
+
function Qn() {
|
|
5571
5639
|
return {
|
|
5572
5640
|
isOpen: !1,
|
|
5573
5641
|
composerValue: "",
|
|
@@ -5583,7 +5651,7 @@ function Zn() {
|
|
|
5583
5651
|
function Sr(e, t) {
|
|
5584
5652
|
try {
|
|
5585
5653
|
window.localStorage.setItem(
|
|
5586
|
-
|
|
5654
|
+
To(e),
|
|
5587
5655
|
JSON.stringify(t)
|
|
5588
5656
|
);
|
|
5589
5657
|
} catch {
|
|
@@ -5602,7 +5670,7 @@ function kr(e) {
|
|
|
5602
5670
|
const t = e;
|
|
5603
5671
|
return typeof t.width == "number" && Number.isFinite(t.width) && typeof t.height == "number" && Number.isFinite(t.height);
|
|
5604
5672
|
}
|
|
5605
|
-
async function
|
|
5673
|
+
async function Ao(e, t) {
|
|
5606
5674
|
const n = await fetch(e, {
|
|
5607
5675
|
method: "POST",
|
|
5608
5676
|
credentials: "include",
|
|
@@ -5614,8 +5682,8 @@ async function Io(e, t) {
|
|
|
5614
5682
|
...t ? { signal: t } : {}
|
|
5615
5683
|
});
|
|
5616
5684
|
if (!n.ok) {
|
|
5617
|
-
const i = await n.text(),
|
|
5618
|
-
throw
|
|
5685
|
+
const i = await n.text(), r = Qo(i);
|
|
5686
|
+
throw r ? (console.error(r), new Error(r)) : new Error(`Failed to load Pluno token (${n.status})`);
|
|
5619
5687
|
}
|
|
5620
5688
|
const o = await n.json();
|
|
5621
5689
|
if (!o.token)
|
|
@@ -5626,9 +5694,9 @@ function Lr(e) {
|
|
|
5626
5694
|
return async () => {
|
|
5627
5695
|
const t = new AbortController();
|
|
5628
5696
|
let n = !1;
|
|
5629
|
-
const o = new Promise((i,
|
|
5697
|
+
const o = new Promise((i, r) => {
|
|
5630
5698
|
const l = window.setTimeout(() => {
|
|
5631
|
-
n = !0, t.abort(),
|
|
5699
|
+
n = !0, t.abort(), r(new Error(Pn));
|
|
5632
5700
|
}, Ai);
|
|
5633
5701
|
t.signal.addEventListener(
|
|
5634
5702
|
"abort",
|
|
@@ -5638,41 +5706,41 @@ function Lr(e) {
|
|
|
5638
5706
|
});
|
|
5639
5707
|
try {
|
|
5640
5708
|
const i = await Promise.race([
|
|
5641
|
-
|
|
5709
|
+
Ao(e, t.signal),
|
|
5642
5710
|
o
|
|
5643
5711
|
]);
|
|
5644
5712
|
return t.abort(), i;
|
|
5645
5713
|
} catch (i) {
|
|
5646
|
-
throw t.abort(), n ? new Error(
|
|
5714
|
+
throw t.abort(), n ? new Error(Pn) : i instanceof Error && i.message.startsWith("Pluno widget blocked on ") ? i : new Error(Ni);
|
|
5647
5715
|
}
|
|
5648
5716
|
};
|
|
5649
5717
|
}
|
|
5650
|
-
const
|
|
5651
|
-
function
|
|
5718
|
+
const eo = /* @__PURE__ */ new WeakSet();
|
|
5719
|
+
function Ir(e) {
|
|
5652
5720
|
return Object.keys(e.dataset).some((t) => t.startsWith("pluno"));
|
|
5653
5721
|
}
|
|
5654
|
-
function
|
|
5722
|
+
function to(e) {
|
|
5655
5723
|
const t = e.pathname.split("/");
|
|
5656
5724
|
return t[t.length - 1] ?? "";
|
|
5657
5725
|
}
|
|
5658
|
-
function
|
|
5726
|
+
function Pr(e, t) {
|
|
5659
5727
|
const n = new URL(e.src, document.baseURI);
|
|
5660
|
-
return n.href === t.href || n.pathname === t.pathname ? !0 :
|
|
5728
|
+
return n.href === t.href || n.pathname === t.pathname ? !0 : to(n) === to(t);
|
|
5661
5729
|
}
|
|
5662
|
-
class
|
|
5730
|
+
class ue extends EventTarget {
|
|
5663
5731
|
constructor(t, n) {
|
|
5664
5732
|
super(), this.channelId = n, this.url = t, this.addPreviewListener(ki, () => {
|
|
5665
|
-
this.readyState =
|
|
5733
|
+
this.readyState = ue.OPEN, this.dispatchEvent(new Event("open"));
|
|
5666
5734
|
}), this.addPreviewListener(Li, (o) => {
|
|
5667
5735
|
const i = o;
|
|
5668
5736
|
this.dispatchEvent(
|
|
5669
5737
|
new MessageEvent("message", { data: i.detail?.data ?? "" })
|
|
5670
5738
|
);
|
|
5671
|
-
}), this.addPreviewListener(
|
|
5672
|
-
this.readyState =
|
|
5673
|
-
}), this.addPreviewListener(
|
|
5739
|
+
}), this.addPreviewListener(Ii, () => {
|
|
5740
|
+
this.readyState = ue.CLOSED, this.dispatchEvent(new Event("error")), this.cleanup();
|
|
5741
|
+
}), this.addPreviewListener(Pi, (o) => {
|
|
5674
5742
|
const i = o;
|
|
5675
|
-
this.readyState =
|
|
5743
|
+
this.readyState = ue.CLOSED, this.dispatchEvent(
|
|
5676
5744
|
new CloseEvent("close", {
|
|
5677
5745
|
code: i.detail?.code ?? 1e3,
|
|
5678
5746
|
reason: i.detail?.reason ?? "",
|
|
@@ -5681,7 +5749,7 @@ class de extends EventTarget {
|
|
|
5681
5749
|
), this.cleanup();
|
|
5682
5750
|
}), window.dispatchEvent(
|
|
5683
5751
|
new CustomEvent(
|
|
5684
|
-
|
|
5752
|
+
dt(
|
|
5685
5753
|
Ci,
|
|
5686
5754
|
this.channelId
|
|
5687
5755
|
),
|
|
@@ -5701,18 +5769,18 @@ class de extends EventTarget {
|
|
|
5701
5769
|
extensions = "";
|
|
5702
5770
|
binaryType = "blob";
|
|
5703
5771
|
bufferedAmount = 0;
|
|
5704
|
-
readyState =
|
|
5772
|
+
readyState = ue.CONNECTING;
|
|
5705
5773
|
socketId = Tr();
|
|
5706
5774
|
listeners = /* @__PURE__ */ new Map();
|
|
5707
5775
|
send(t) {
|
|
5708
|
-
if (this.readyState !==
|
|
5776
|
+
if (this.readyState !== ue.OPEN)
|
|
5709
5777
|
throw new DOMException(
|
|
5710
5778
|
"Pluno preview websocket is not open",
|
|
5711
5779
|
"InvalidStateError"
|
|
5712
5780
|
);
|
|
5713
5781
|
window.dispatchEvent(
|
|
5714
5782
|
new CustomEvent(
|
|
5715
|
-
|
|
5783
|
+
dt(Si, this.channelId),
|
|
5716
5784
|
{
|
|
5717
5785
|
detail: {
|
|
5718
5786
|
socketId: this.socketId,
|
|
@@ -5723,9 +5791,9 @@ class de extends EventTarget {
|
|
|
5723
5791
|
);
|
|
5724
5792
|
}
|
|
5725
5793
|
close(t, n) {
|
|
5726
|
-
this.readyState !==
|
|
5794
|
+
this.readyState !== ue.CLOSED && (this.readyState = ue.CLOSING, window.dispatchEvent(
|
|
5727
5795
|
new CustomEvent(
|
|
5728
|
-
|
|
5796
|
+
dt(Ei, this.channelId),
|
|
5729
5797
|
{
|
|
5730
5798
|
detail: { socketId: this.socketId, code: t, reason: n }
|
|
5731
5799
|
}
|
|
@@ -5733,11 +5801,11 @@ class de extends EventTarget {
|
|
|
5733
5801
|
), this.cleanup());
|
|
5734
5802
|
}
|
|
5735
5803
|
addPreviewListener(t, n) {
|
|
5736
|
-
const o =
|
|
5804
|
+
const o = dt(
|
|
5737
5805
|
t,
|
|
5738
5806
|
this.channelId
|
|
5739
|
-
), i = (
|
|
5740
|
-
|
|
5807
|
+
), i = (r) => {
|
|
5808
|
+
r.detail?.socketId === this.socketId && n(r);
|
|
5741
5809
|
};
|
|
5742
5810
|
this.listeners.set(o, i), window.addEventListener(o, i);
|
|
5743
5811
|
}
|
|
@@ -5749,14 +5817,14 @@ class de extends EventTarget {
|
|
|
5749
5817
|
}
|
|
5750
5818
|
function Tr() {
|
|
5751
5819
|
const e = window.sessionStorage.getItem(
|
|
5752
|
-
|
|
5820
|
+
In
|
|
5753
5821
|
);
|
|
5754
5822
|
if (e)
|
|
5755
5823
|
return e;
|
|
5756
5824
|
const t = crypto.randomUUID();
|
|
5757
|
-
return window.sessionStorage.setItem(
|
|
5825
|
+
return window.sessionStorage.setItem(In, t), t;
|
|
5758
5826
|
}
|
|
5759
|
-
function
|
|
5827
|
+
function dt(e, t) {
|
|
5760
5828
|
return `${e}:${t}`;
|
|
5761
5829
|
}
|
|
5762
5830
|
function Ar(e) {
|
|
@@ -5767,29 +5835,29 @@ function Ar(e) {
|
|
|
5767
5835
|
return Array.from(
|
|
5768
5836
|
document.querySelectorAll("script[type='module'][src]")
|
|
5769
5837
|
).filter(
|
|
5770
|
-
(i) => i instanceof HTMLScriptElement &&
|
|
5838
|
+
(i) => i instanceof HTMLScriptElement && Ir(i) && Pr(i, o)
|
|
5771
5839
|
);
|
|
5772
5840
|
}
|
|
5773
5841
|
function Nr(e) {
|
|
5774
5842
|
for (const t of Ar(e))
|
|
5775
|
-
|
|
5843
|
+
eo.has(t) || t.dataset.plunoAutoMount === "false" || (eo.add(t), No(t).catch((n) => {
|
|
5776
5844
|
console.error("Failed to mount Pluno widget", n);
|
|
5777
5845
|
}));
|
|
5778
5846
|
}
|
|
5779
|
-
function
|
|
5780
|
-
const t = window, n = t[
|
|
5847
|
+
function No(e) {
|
|
5848
|
+
const t = window, n = t[ce];
|
|
5781
5849
|
if (n) {
|
|
5782
5850
|
if (n.host === null)
|
|
5783
5851
|
return n.mountPromise.catch(() => {
|
|
5784
|
-
const p = t[
|
|
5785
|
-
return p ? p.mountPromise :
|
|
5852
|
+
const p = t[ce];
|
|
5853
|
+
return p ? p.mountPromise : No(e);
|
|
5786
5854
|
});
|
|
5787
|
-
if (
|
|
5855
|
+
if (Rr(n.host))
|
|
5788
5856
|
return n.mountPromise;
|
|
5789
|
-
n.destroy?.(), delete t[
|
|
5857
|
+
n.destroy?.(), delete t[ce];
|
|
5790
5858
|
}
|
|
5791
5859
|
const o = e.dataset.plunoPreviewChannel, i = e.dataset.plunoTokenEndpoint;
|
|
5792
|
-
let
|
|
5860
|
+
let r;
|
|
5793
5861
|
const l = ta({
|
|
5794
5862
|
token: e.dataset.plunoToken,
|
|
5795
5863
|
tokenProvider: !e.dataset.plunoToken && !o && i ? Lr(i) : void 0,
|
|
@@ -5803,25 +5871,25 @@ function To(e) {
|
|
|
5803
5871
|
scribbleStyle: e.dataset.plunoScribbleStyle === void 0 ? void 0 : e.dataset.plunoScribbleStyle !== "false",
|
|
5804
5872
|
position: e.dataset.plunoPosition === "bottom-left" ? "bottom-left" : "bottom-right"
|
|
5805
5873
|
}).then((p) => {
|
|
5806
|
-
if (t[
|
|
5874
|
+
if (t[ce] !== r) {
|
|
5807
5875
|
p.destroy();
|
|
5808
5876
|
return;
|
|
5809
5877
|
}
|
|
5810
5878
|
const d = p.host;
|
|
5811
|
-
d.setAttribute(
|
|
5812
|
-
t[
|
|
5879
|
+
d.setAttribute(ro, "true"), r.host = d, r.destroy = () => {
|
|
5880
|
+
t[ce] === r && delete t[ce], r.host = null, r.destroy = null, p.destroy();
|
|
5813
5881
|
};
|
|
5814
5882
|
}).catch((p) => {
|
|
5815
|
-
throw t[
|
|
5883
|
+
throw t[ce] === r && delete t[ce], p;
|
|
5816
5884
|
});
|
|
5817
|
-
return
|
|
5885
|
+
return r = {
|
|
5818
5886
|
mountPromise: l,
|
|
5819
5887
|
host: null,
|
|
5820
5888
|
destroy: null
|
|
5821
|
-
}, t[
|
|
5889
|
+
}, t[ce] = r, l;
|
|
5822
5890
|
}
|
|
5823
|
-
function
|
|
5824
|
-
return e.isConnected && e.getAttribute(
|
|
5891
|
+
function Rr(e) {
|
|
5892
|
+
return e.isConnected && e.getAttribute(ro) === "true" && !!e.shadowRoot?.querySelector(".pluno-pa-widget__launcher") && !!e.shadowRoot?.querySelector(".pluno-pa-widget__panel");
|
|
5825
5893
|
}
|
|
5826
5894
|
Nr(import.meta.url);
|
|
5827
5895
|
export {
|