@pluno/product-agent-web 0.1.83 → 0.1.85
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/README.md +4 -0
- package/dist/index.d.ts +6 -0
- package/dist/product-agent-sdk.js +30 -26
- package/dist/product-agent-widget.js +1230 -1133
- package/dist/widget.d.ts +4 -0
- package/package.json +1 -1
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { PlunoProductAgent as
|
|
2
|
-
const
|
|
3
|
-
function
|
|
4
|
-
const t =
|
|
5
|
-
if (
|
|
1
|
+
import { PlunoProductAgent as pi, getProductAgentOriginAccessErrorMessage as si } from "./product-agent-sdk.js";
|
|
2
|
+
const di = "#7c3aed", ft = "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", wt = "#2c2a1e", An = [253, 250, 241], Nn = 3.5;
|
|
3
|
+
function mo(e) {
|
|
4
|
+
const t = fo(e);
|
|
5
|
+
if (Rn(ot(t), An) >= Nn)
|
|
6
6
|
return t;
|
|
7
|
-
let o =
|
|
8
|
-
const i =
|
|
7
|
+
let o = ot(t);
|
|
8
|
+
const i = ot(wt);
|
|
9
9
|
for (let r = 0; r < 6; r += 1)
|
|
10
|
-
if (o =
|
|
11
|
-
return
|
|
12
|
-
return
|
|
10
|
+
if (o = gi(o, i, 0.22), Rn(o, An) >= Nn)
|
|
11
|
+
return Jt(o);
|
|
12
|
+
return Jt(o);
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function ci() {
|
|
15
15
|
let n = "M 280 120", o = !1, i = 0;
|
|
16
16
|
for (let r = 150; r <= 1170; r += 62) {
|
|
17
17
|
const l = (i % 3 - 1) * 18, p = o ? 280 - l : 1020 + l;
|
|
@@ -19,8 +19,8 @@ function ri() {
|
|
|
19
19
|
}
|
|
20
20
|
return n;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
const t =
|
|
22
|
+
function ui(e) {
|
|
23
|
+
const t = fo(e), n = Qt(ot(t));
|
|
24
24
|
return n > 0.86 ? {
|
|
25
25
|
top: "#ffffff",
|
|
26
26
|
middle: "#f6f6f6",
|
|
@@ -44,90 +44,90 @@ function li(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: le(t, 0.28, -0.03),
|
|
48
|
+
middle: le(t, 0.08, 0.04),
|
|
49
|
+
bottom: le(t, -0.1, 0.02),
|
|
50
|
+
edgeStart: le(t, 0.08, 0.08),
|
|
51
|
+
edgeMiddle: le(t, -0.08, 0.08),
|
|
52
|
+
edgeEnd: le(t, -0.18, 0.05),
|
|
53
|
+
glow: le(t, 0.32, -0.12),
|
|
54
|
+
highlight: le(t, 0.38, -0.18),
|
|
55
|
+
inner: le(t, 0.24, -0.1),
|
|
56
|
+
shadow: le(t, -0.25, -0.08)
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function fo(e) {
|
|
60
60
|
const t = e.trim();
|
|
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()}` :
|
|
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()}` : di;
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function ot(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 Qt([e, t, n]) {
|
|
75
75
|
const o = (i) => {
|
|
76
76
|
const r = i / 255;
|
|
77
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 =
|
|
81
|
+
function Rn(e, t) {
|
|
82
|
+
const n = Qt(e), o = Qt(t), [i, r] = n > o ? [n, o] : [o, n];
|
|
83
83
|
return (i + 0.05) / (r + 0.05);
|
|
84
84
|
}
|
|
85
|
-
function
|
|
86
|
-
const o =
|
|
85
|
+
function gi(e, t, n) {
|
|
86
|
+
const o = en(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, r] =
|
|
95
|
-
return
|
|
93
|
+
function le(e, t, n) {
|
|
94
|
+
const [o, i, r] = hi(ot(e));
|
|
95
|
+
return Jt(mi(o, en(i + n), en(r + t)));
|
|
96
96
|
}
|
|
97
|
-
function
|
|
97
|
+
function hi([e, t, n]) {
|
|
98
98
|
const o = e / 255, i = t / 255, r = n / 255, l = Math.max(o, i, r), p = Math.min(o, i, r), s = (l + p) / 2;
|
|
99
99
|
if (l === p)
|
|
100
100
|
return [0, 0, s];
|
|
101
|
-
const
|
|
102
|
-
return [(l === o ? (i - r) /
|
|
101
|
+
const g = l - p, c = s > 0.5 ? g / (2 - l - p) : g / (l + p);
|
|
102
|
+
return [(l === o ? (i - r) / g + (i < r ? 6 : 0) : l === i ? (r - o) / g + 2 : (o - i) / g + 4) / 6, c, s];
|
|
103
103
|
}
|
|
104
|
-
function
|
|
104
|
+
function mi(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
|
+
Wt(i, o, e + 1 / 3) * 255,
|
|
110
|
+
Wt(i, o, e) * 255,
|
|
111
|
+
Wt(i, o, e - 1 / 3) * 255
|
|
112
112
|
];
|
|
113
113
|
}
|
|
114
|
-
function
|
|
114
|
+
function Wt(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 en(e) {
|
|
119
119
|
return Math.max(0, Math.min(1, e));
|
|
120
120
|
}
|
|
121
|
-
const
|
|
122
|
-
function
|
|
121
|
+
const wo = "suggest_share_on_socials";
|
|
122
|
+
function fi(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 !== wo)
|
|
126
126
|
continue;
|
|
127
|
-
const o =
|
|
127
|
+
const o = Dn(e, t, "assistant");
|
|
128
128
|
if (!o)
|
|
129
129
|
return null;
|
|
130
|
-
const i =
|
|
130
|
+
const i = Dn(e, o.index, "user");
|
|
131
131
|
return i ? {
|
|
132
132
|
id: `share:${n.callId ?? n.id}`,
|
|
133
133
|
userPrompt: i.content,
|
|
@@ -136,13 +136,13 @@ function ci(e) {
|
|
|
136
136
|
}
|
|
137
137
|
return null;
|
|
138
138
|
}
|
|
139
|
-
async function
|
|
140
|
-
const t = await
|
|
139
|
+
async function wi(e) {
|
|
140
|
+
const t = await bi(e);
|
|
141
141
|
if (!navigator.clipboard || typeof ClipboardItem > "u")
|
|
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 Dn(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())
|
|
@@ -150,74 +150,74 @@ function Nn(e, t, n) {
|
|
|
150
150
|
}
|
|
151
151
|
return null;
|
|
152
152
|
}
|
|
153
|
-
async function
|
|
153
|
+
async function bi(e) {
|
|
154
154
|
return await (await fetch(e)).blob();
|
|
155
155
|
}
|
|
156
|
-
const
|
|
157
|
-
function
|
|
156
|
+
const _i = "https://app.pluno.ai", xi = "/api/product-agent/embed/active-users", yi = 1800, vi = 15e3, Ci = 250, Si = 1e3, Ei = 3e4;
|
|
157
|
+
function ki(e, t = {}) {
|
|
158
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 = (c) => {
|
|
162
162
|
n || (i !== null && window.clearTimeout(i), i = window.setTimeout(() => {
|
|
163
|
-
|
|
164
|
-
},
|
|
163
|
+
g();
|
|
164
|
+
}, Ti(c)));
|
|
165
165
|
}, s = (c) => {
|
|
166
166
|
if (l(), o === null) {
|
|
167
167
|
o = c, e(c);
|
|
168
168
|
return;
|
|
169
169
|
}
|
|
170
|
-
const h = o,
|
|
170
|
+
const h = o, C = performance.now();
|
|
171
171
|
r = window.setInterval(() => {
|
|
172
172
|
if (n) {
|
|
173
173
|
l();
|
|
174
174
|
return;
|
|
175
175
|
}
|
|
176
|
-
const
|
|
177
|
-
o = Math.round(h + (c - h) *
|
|
178
|
-
},
|
|
179
|
-
},
|
|
176
|
+
const T = Math.min(1, (performance.now() - C) / yi);
|
|
177
|
+
o = Math.round(h + (c - h) * Ii(T)), e(o), T >= 1 && (o = c, e(c), l());
|
|
178
|
+
}, Ci);
|
|
179
|
+
}, g = async () => {
|
|
180
180
|
try {
|
|
181
|
-
const c = await
|
|
181
|
+
const c = await Li(t);
|
|
182
182
|
if (n)
|
|
183
183
|
return;
|
|
184
184
|
s(c.count), p(c.refreshAfterMs);
|
|
185
185
|
} catch {
|
|
186
|
-
p(
|
|
186
|
+
p(vi);
|
|
187
187
|
}
|
|
188
188
|
};
|
|
189
|
-
return
|
|
189
|
+
return g(), () => {
|
|
190
190
|
n = !0, i !== null && window.clearTimeout(i), l();
|
|
191
191
|
};
|
|
192
192
|
}
|
|
193
|
-
async function
|
|
193
|
+
async function Li(e) {
|
|
194
194
|
if (e.loader)
|
|
195
195
|
return e.loader();
|
|
196
|
-
const n = await (e.fetcher ?? fetch)(new URL(
|
|
196
|
+
const n = await (e.fetcher ?? fetch)(new URL(xi, Pi(e.backendUrl ?? _i)).toString(), {
|
|
197
197
|
cache: "no-store",
|
|
198
198
|
credentials: "omit"
|
|
199
199
|
});
|
|
200
200
|
if (!n.ok)
|
|
201
201
|
throw new Error("Failed to load active users");
|
|
202
|
-
const o = await n.json(), i =
|
|
202
|
+
const o = await n.json(), i = zn(o.count), r = zn(o.refreshAfterMs ?? o.refresh_after_ms);
|
|
203
203
|
if (i === null || r === null)
|
|
204
204
|
throw new Error("Invalid active users response");
|
|
205
205
|
return { count: i, refreshAfterMs: r };
|
|
206
206
|
}
|
|
207
|
-
function
|
|
207
|
+
function zn(e) {
|
|
208
208
|
return typeof e != "number" || !Number.isFinite(e) || e < 0 ? null : Math.round(e);
|
|
209
209
|
}
|
|
210
|
-
function
|
|
210
|
+
function Pi(e) {
|
|
211
211
|
return e.endsWith("/") ? e : `${e}/`;
|
|
212
212
|
}
|
|
213
|
-
function
|
|
214
|
-
return Math.min(
|
|
213
|
+
function Ti(e) {
|
|
214
|
+
return Math.min(Ei, Math.max(Si, e));
|
|
215
215
|
}
|
|
216
|
-
function
|
|
216
|
+
function Ii(e) {
|
|
217
217
|
return e < 0.5 ? 4 * e * e * e : 1 - Math.pow(-2 * e + 2, 3) / 2;
|
|
218
218
|
}
|
|
219
|
-
const
|
|
220
|
-
function
|
|
219
|
+
const Ai = /(`+)(?!`)[\s\S]*?\1(?!`)/g;
|
|
220
|
+
function Ni(e) {
|
|
221
221
|
let t = "", n = "", o = null;
|
|
222
222
|
for (const i of e.split(new RegExp("(?<=\\n)"))) {
|
|
223
223
|
if (o) {
|
|
@@ -228,7 +228,7 @@ function Li(e) {
|
|
|
228
228
|
}
|
|
229
229
|
const r = i.match(/^[ \t]{0,3}(`{3,}|~{3,})/);
|
|
230
230
|
if (r) {
|
|
231
|
-
t +=
|
|
231
|
+
t += Mn(n) + i, n = "", o = {
|
|
232
232
|
marker: r[1][0],
|
|
233
233
|
length: r[1].length
|
|
234
234
|
};
|
|
@@ -236,31 +236,31 @@ function Li(e) {
|
|
|
236
236
|
}
|
|
237
237
|
n += i;
|
|
238
238
|
}
|
|
239
|
-
return t +
|
|
239
|
+
return t + Mn(n);
|
|
240
240
|
}
|
|
241
|
-
function
|
|
241
|
+
function Mn(e) {
|
|
242
242
|
let t = "", n = 0;
|
|
243
|
-
for (const o of e.matchAll(
|
|
243
|
+
for (const o of e.matchAll(Ai)) {
|
|
244
244
|
const i = o.index ?? 0;
|
|
245
|
-
t +=
|
|
245
|
+
t += On(
|
|
246
246
|
e.slice(n, i)
|
|
247
247
|
), t += o[0], n = i + o[0].length;
|
|
248
248
|
}
|
|
249
|
-
return t +
|
|
249
|
+
return t + On(e.slice(n));
|
|
250
250
|
}
|
|
251
|
-
function
|
|
251
|
+
function On(e) {
|
|
252
252
|
return e.replace(
|
|
253
253
|
/\[([^\]\n]*\S[^\]\n]*)\][ \t]+\(([^)\s]+)\)/g,
|
|
254
|
-
(t, n, o, i, r) => r[i - 1] === "!" ||
|
|
254
|
+
(t, n, o, i, r) => r[i - 1] === "!" || Ri(r, i) || Di(r, i, n) ? t : `[${n}](${o})`
|
|
255
255
|
);
|
|
256
256
|
}
|
|
257
|
-
function
|
|
257
|
+
function Ri(e, t) {
|
|
258
258
|
let n = 0;
|
|
259
259
|
for (let o = t - 1; e[o] === "\\"; o -= 1)
|
|
260
260
|
n += 1;
|
|
261
261
|
return n % 2 === 1;
|
|
262
262
|
}
|
|
263
|
-
function
|
|
263
|
+
function Di(e, t, n) {
|
|
264
264
|
if (n !== "x" && n !== "X")
|
|
265
265
|
return !1;
|
|
266
266
|
const o = e.lastIndexOf(`
|
|
@@ -269,7 +269,7 @@ function Ti(e, t, n) {
|
|
|
269
269
|
e.slice(o, t)
|
|
270
270
|
);
|
|
271
271
|
}
|
|
272
|
-
const
|
|
272
|
+
const bo = 100, zi = 1e4, Mi = 5e3, Oi = "product-agent:sdk-preview-socket-connect", Ui = "product-agent:sdk-preview-socket-send", Bi = "product-agent:sdk-preview-socket-close", Fi = "product-agent:sdk-preview-socket-open", Wi = "product-agent:sdk-preview-socket-message", Hi = "product-agent:sdk-preview-socket-error", $i = "product-agent:sdk-preview-socket-closed", Un = "product-agent:sdk-preview-socket-id", Gi = "data-pluno-sdk-preview-channel", _o = "data-pluno-auto-mounted", me = "__plunoProductAgentAutoMountOwner", qi = 1e4, ji = "Failed to load Pluno widget token", Bn = "Timed out loading Pluno widget token", Vi = "pluno.productAgent.widgetClientId.", Ht = /* @__PURE__ */ new Set(), Ki = "product-agent:preview-diagnostic", xo = "pluno.productAgent.sharePromptsDisabled", Yi = 3, Fn = 'dialog[open], [aria-modal="true"], [role="dialog"]', Xi = 400, Zi = 5e3, Ji = 500, Wn = "Close the page's popup to chat", Qi = "No recent chats for this page yet.", pe = {
|
|
273
273
|
launcherLabel: "Ask for anything...",
|
|
274
274
|
accentColor: "#7c3aed",
|
|
275
275
|
colorScheme: "light",
|
|
@@ -277,7 +277,7 @@ const ho = 100, Ii = 1e4, Ai = 5e3, Ni = "product-agent:sdk-preview-socket-conne
|
|
|
277
277
|
scribbleStyle: !0,
|
|
278
278
|
position: "bottom-right",
|
|
279
279
|
movableLauncher: !0
|
|
280
|
-
},
|
|
280
|
+
}, ea = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive', Hn = "pluno-pa-scribble-font", yo = 190, vo = 41, $n = 22, ta = 1, na = 48, cn = 420, oa = 520, ia = 0.24, un = 680, aa = 800, ra = 0.76, A = 8, Ne = 50, Co = "http://www.w3.org/2000/svg", tn = 26, nn = 8, la = 36, on = 16, pa = 4, Gn = [
|
|
281
281
|
{
|
|
282
282
|
ellipseCx: "17.5",
|
|
283
283
|
ellipseCy: "24.5",
|
|
@@ -314,20 +314,22 @@ const ho = 100, Ii = 1e4, Ai = 5e3, Ni = "product-agent:sdk-preview-socket-conne
|
|
|
314
314
|
path: "M18.7 26.8 C21 11.2, 7.1 1.6, 6.3 18.1",
|
|
315
315
|
pathStrokeWidth: "2.45"
|
|
316
316
|
}
|
|
317
|
-
],
|
|
318
|
-
let
|
|
319
|
-
function
|
|
320
|
-
return (t) => new
|
|
317
|
+
], sa = 11, da = 13, an = 4, So = 10, Eo = 40, ca = "movable-launcher-position-v2", ko = "pluno-pa-widget-styles", Lo = "data-pluno-pa-widget-styles";
|
|
318
|
+
let qn = 0;
|
|
319
|
+
function ua(e) {
|
|
320
|
+
return (t) => new fe(t, e);
|
|
321
321
|
}
|
|
322
|
-
async function
|
|
322
|
+
async function ga(e = {}) {
|
|
323
323
|
const t = {
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
324
|
+
layout: e.layout ?? "floating",
|
|
325
|
+
mountTarget: e.mountTarget,
|
|
326
|
+
launcherLabel: e.launcherLabel ?? pe.launcherLabel,
|
|
327
|
+
accentColor: e.accentColor ?? pe.accentColor,
|
|
328
|
+
colorScheme: e.colorScheme ?? pe.colorScheme,
|
|
329
|
+
fontFamily: e.fontFamily ?? pe.fontFamily,
|
|
330
|
+
scribbleStyle: e.scribbleStyle ?? pe.scribbleStyle,
|
|
331
|
+
position: e.position ?? pe.position,
|
|
332
|
+
movableLauncher: e.movableLauncher ?? pe.movableLauncher,
|
|
331
333
|
token: e.token,
|
|
332
334
|
tokenProvider: e.tokenProvider,
|
|
333
335
|
tokenEndpoint: e.tokenEndpoint,
|
|
@@ -337,8 +339,10 @@ async function da(e = {}) {
|
|
|
337
339
|
clientId: e.clientId,
|
|
338
340
|
restorePersistedState: e.restorePersistedState,
|
|
339
341
|
expectedPersistedSessionId: e.expectedPersistedSessionId,
|
|
342
|
+
keepRunsActiveOnSessionNavigation: e.keepRunsActiveOnSessionNavigation === !0,
|
|
340
343
|
webSocketFactory: e.webSocketFactory,
|
|
341
344
|
prepareAttachmentUpload: e.prepareAttachmentUpload,
|
|
345
|
+
attachmentsEnabled: e.attachmentsEnabled !== !1,
|
|
342
346
|
loginRequired: e.loginRequired === !0,
|
|
343
347
|
loginButtonLabel: e.loginButtonLabel ?? "Log in to Pluno",
|
|
344
348
|
loginUrl: e.loginUrl,
|
|
@@ -358,13 +362,15 @@ async function da(e = {}) {
|
|
|
358
362
|
initialDisplayState: e.initialDisplayState,
|
|
359
363
|
onDisplayStateChange: e.onDisplayStateChange,
|
|
360
364
|
onPanelOpenChange: e.onPanelOpenChange,
|
|
361
|
-
|
|
365
|
+
// Customer-embedded floating widgets should offer the same compact launcher state as the
|
|
366
|
+
// extension preview, while programmatic integrations can still opt out explicitly.
|
|
367
|
+
showLauncherMinimizeButton: e.showLauncherMinimizeButton !== !1,
|
|
362
368
|
morningReport: e.morningReport ?? null,
|
|
363
369
|
onMorningReportSnooze: e.onMorningReportSnooze,
|
|
364
370
|
onMorningReportTaskStart: e.onMorningReportTaskStart,
|
|
365
371
|
taskNotifications: e.taskNotifications
|
|
366
372
|
};
|
|
367
|
-
|
|
373
|
+
K(
|
|
368
374
|
"web-sdk.widget",
|
|
369
375
|
"Mounting widget with merged options",
|
|
370
376
|
{
|
|
@@ -380,122 +386,123 @@ async function da(e = {}) {
|
|
|
380
386
|
}
|
|
381
387
|
);
|
|
382
388
|
const n = document.createElement("div");
|
|
383
|
-
n.className = "pluno-pa-widget-host", n.setAttribute("data-pluno-product-agent-ui", "widget"), t.sdkPreviewChannelId && n.setAttribute(
|
|
384
|
-
|
|
389
|
+
n.className = "pluno-pa-widget-host", n.setAttribute("data-pluno-product-agent-ui", "widget"), n.setAttribute("data-pluno-product-agent-layout", t.layout), t.sdkPreviewChannelId && n.setAttribute(
|
|
390
|
+
Gi,
|
|
385
391
|
t.sdkPreviewChannelId
|
|
386
392
|
);
|
|
387
393
|
const o = n.attachShadow({ mode: "open" }), i = document.createElement("div");
|
|
388
|
-
i.className = `pluno-pa-widget pluno-pa-widget--${t.position}`, i.setAttribute("data-pluno-product-agent-ui-root", "widget");
|
|
389
|
-
let r =
|
|
394
|
+
i.className = `pluno-pa-widget pluno-pa-widget--${t.position}`, i.classList.add(`pluno-pa-widget--layout-${t.layout}`), i.setAttribute("data-pluno-product-agent-ui-root", "widget");
|
|
395
|
+
let r = jn(
|
|
390
396
|
t.accentColor,
|
|
391
397
|
t.scribbleStyle
|
|
392
398
|
);
|
|
393
|
-
|
|
399
|
+
Ma(
|
|
394
400
|
i,
|
|
395
401
|
t.launcherLabel,
|
|
396
402
|
r,
|
|
397
403
|
t.movableLauncher,
|
|
398
404
|
t.showLauncherMinimizeButton
|
|
399
405
|
), o.appendChild(i);
|
|
400
|
-
const l =
|
|
401
|
-
|
|
402
|
-
|
|
406
|
+
const l = Rr(t), p = t.layout === "floating" ? t.initialDisplayState ?? Ar(t) : "shown";
|
|
407
|
+
co(t, p);
|
|
408
|
+
let s = t.movableLauncher ? l.launcherPosition : null, g = s !== null, c = l.panelSize, h = null;
|
|
409
|
+
i.classList.add(`pluno-pa-widget--${t.colorScheme}`), t.scribbleStyle && i.classList.add("pluno-pa-widget--scribble"), p === "minimized" && (i.classList.add("pluno-pa-widget--minimized"), Ae(
|
|
403
410
|
i,
|
|
404
411
|
Gt(
|
|
405
412
|
i,
|
|
406
|
-
|
|
413
|
+
s,
|
|
407
414
|
t.position
|
|
408
415
|
)
|
|
409
|
-
)),
|
|
416
|
+
)), so(o, t.accentColor), Vn(i, r, {
|
|
410
417
|
accentColor: t.accentColor,
|
|
411
418
|
colorScheme: t.colorScheme,
|
|
412
419
|
fontFamily: t.fontFamily,
|
|
413
420
|
scribbleStyle: t.scribbleStyle
|
|
414
421
|
});
|
|
415
|
-
const
|
|
422
|
+
const C = t.mountTarget ?? await Ir(), T = C.ownerDocument, I = i.querySelector(
|
|
416
423
|
".pluno-pa-widget__launcher"
|
|
417
424
|
), D = i.querySelector(
|
|
418
425
|
".pluno-pa-widget__launcher-drag-handle"
|
|
419
|
-
),
|
|
426
|
+
), u = i.querySelector(
|
|
420
427
|
".pluno-pa-widget__launcher-input"
|
|
421
|
-
),
|
|
428
|
+
), y = i.querySelector(
|
|
422
429
|
".pluno-pa-widget__launcher-minimize"
|
|
423
|
-
),
|
|
430
|
+
), m = i.querySelector(".pluno-pa-widget__panel"), S = i.querySelector(
|
|
424
431
|
".pluno-pa-widget__scribble-spirals--panel"
|
|
425
|
-
),
|
|
432
|
+
), z = Array.from(
|
|
426
433
|
i.querySelectorAll(".pluno-pa-widget__resize-handle")
|
|
427
|
-
),
|
|
434
|
+
), L = i.querySelector(
|
|
428
435
|
".pluno-pa-widget__close"
|
|
429
|
-
),
|
|
436
|
+
), oe = i.querySelector(
|
|
430
437
|
".pluno-pa-widget__composer"
|
|
431
|
-
),
|
|
438
|
+
), J = i.querySelector(
|
|
432
439
|
".pluno-pa-widget__attachment-error"
|
|
433
|
-
),
|
|
440
|
+
), Re = i.querySelector(
|
|
434
441
|
".pluno-pa-widget__billing-status"
|
|
435
|
-
),
|
|
442
|
+
), U = i.querySelector(
|
|
436
443
|
".pluno-pa-widget__attachments"
|
|
437
|
-
),
|
|
444
|
+
), we = i.querySelector(
|
|
438
445
|
".pluno-pa-widget__attachment-input"
|
|
439
|
-
),
|
|
446
|
+
), B = i.querySelector(
|
|
440
447
|
".pluno-pa-widget__attach"
|
|
441
|
-
),
|
|
448
|
+
), f = i.querySelector(
|
|
442
449
|
".pluno-pa-widget__input"
|
|
443
|
-
),
|
|
450
|
+
), Q = i.querySelector(
|
|
444
451
|
".pluno-pa-widget__send"
|
|
445
|
-
),
|
|
452
|
+
), De = i.querySelector(
|
|
446
453
|
".pluno-pa-widget__top-actions"
|
|
447
|
-
),
|
|
454
|
+
), Ce = i.querySelector(
|
|
448
455
|
".pluno-pa-widget__history"
|
|
449
|
-
),
|
|
456
|
+
), Se = i.querySelector(
|
|
450
457
|
".pluno-pa-widget__history-panel"
|
|
451
|
-
),
|
|
458
|
+
), j = i.querySelector(
|
|
452
459
|
".pluno-pa-widget__history-list"
|
|
453
460
|
), it = i.querySelector(
|
|
454
461
|
".pluno-pa-widget__history-close"
|
|
455
|
-
),
|
|
462
|
+
), ie = i.querySelector(
|
|
456
463
|
".pluno-pa-widget__history-status"
|
|
457
|
-
), oe = i.querySelector(
|
|
458
|
-
".pluno-pa-widget__timeline-jump"
|
|
459
464
|
), x = i.querySelector(
|
|
465
|
+
".pluno-pa-widget__timeline-jump"
|
|
466
|
+
), N = i.querySelector(
|
|
460
467
|
".pluno-pa-widget__active-users-counter"
|
|
461
|
-
),
|
|
468
|
+
), P = i.querySelector(
|
|
462
469
|
".pluno-pa-widget__timeline"
|
|
463
|
-
),
|
|
470
|
+
), ae = i.querySelector(
|
|
464
471
|
".pluno-pa-widget__timeline-bottom-sentinel"
|
|
465
|
-
),
|
|
472
|
+
), H = i.querySelector(
|
|
466
473
|
".pluno-pa-widget__notify-suggestion"
|
|
467
|
-
),
|
|
474
|
+
), v = i.querySelector(
|
|
468
475
|
".pluno-pa-widget__notify-suggestion-enable"
|
|
469
|
-
), P = i.querySelector(
|
|
470
|
-
".pluno-pa-widget__notify-suggestion-later"
|
|
471
476
|
), R = i.querySelector(
|
|
477
|
+
".pluno-pa-widget__notify-suggestion-later"
|
|
478
|
+
), qo = i.querySelector(
|
|
472
479
|
".pluno-pa-widget__notify-suggestion-never"
|
|
473
480
|
);
|
|
474
|
-
if (!
|
|
481
|
+
if (!I || !u || !m || !L || !oe || !J || !Re || !U || !we || !B || !f || !Q || !De || !Ce || !Se || !j || !it || !ie || !x || !N || !P || !ae)
|
|
475
482
|
throw new Error("Failed to mount Pluno widget");
|
|
476
483
|
if (t.movableLauncher && !D)
|
|
477
484
|
throw new Error("Failed to mount Pluno widget drag handle");
|
|
478
|
-
|
|
479
|
-
let q = [],
|
|
480
|
-
const
|
|
481
|
-
|
|
482
|
-
|
|
485
|
+
B.hidden = !t.attachmentsEnabled, we.disabled = !t.attachmentsEnabled, eo(u), eo(f);
|
|
486
|
+
let q = [], ue = null;
|
|
487
|
+
const ze = () => {
|
|
488
|
+
tr(
|
|
489
|
+
U,
|
|
483
490
|
q,
|
|
484
491
|
(a) => {
|
|
485
492
|
q = q.filter(
|
|
486
493
|
(d, _) => _ !== a
|
|
487
|
-
),
|
|
494
|
+
), ze(), W(b.getState()), $();
|
|
488
495
|
}
|
|
489
496
|
);
|
|
490
|
-
},
|
|
491
|
-
if (!t.loginRequired && !t.signupRequired && !t.token && !
|
|
497
|
+
}, fn = t.loginRequired || t.signupRequired || t.token || t.webSocketFactory ? void 0 : t.tokenProvider ?? (t.tokenEndpoint ? async () => $o(t.tokenEndpoint) : void 0);
|
|
498
|
+
if (!t.loginRequired && !t.signupRequired && !t.token && !fn && !t.webSocketFactory)
|
|
492
499
|
throw new Error("Pluno widget requires token or tokenEndpoint");
|
|
493
|
-
const
|
|
500
|
+
const jo = window.fetch.bind(window), vt = Nr(t.clientId);
|
|
494
501
|
let b;
|
|
495
502
|
try {
|
|
496
503
|
const a = {
|
|
497
504
|
token: t.token,
|
|
498
|
-
tokenProvider:
|
|
505
|
+
tokenProvider: fn,
|
|
499
506
|
backendUrl: t.backendUrl,
|
|
500
507
|
metadata: () => ({
|
|
501
508
|
...t.metadata ?? {},
|
|
@@ -505,6 +512,7 @@ async function da(e = {}) {
|
|
|
505
512
|
clientId: vt.clientId,
|
|
506
513
|
restorePersistedState: t.restorePersistedState,
|
|
507
514
|
expectedPersistedSessionId: t.expectedPersistedSessionId,
|
|
515
|
+
keepRunsActiveOnSessionNavigation: t.keepRunsActiveOnSessionNavigation,
|
|
508
516
|
webSocketFactory: t.webSocketFactory,
|
|
509
517
|
prepareAttachmentUpload: t.prepareAttachmentUpload,
|
|
510
518
|
// The launcher is useful before a customer token endpoint responds. The widget owns connection
|
|
@@ -512,11 +520,11 @@ async function da(e = {}) {
|
|
|
512
520
|
autoConnect: !1,
|
|
513
521
|
disableNetworkCapture: !!t.sdkPreviewChannelId
|
|
514
522
|
};
|
|
515
|
-
b = await
|
|
523
|
+
b = await pi.init(a);
|
|
516
524
|
} catch (a) {
|
|
517
525
|
throw vt.release(), n.remove(), a;
|
|
518
526
|
}
|
|
519
|
-
|
|
527
|
+
C.appendChild(n), K(
|
|
520
528
|
"web-sdk.widget",
|
|
521
529
|
"Applied initial widget appearance",
|
|
522
530
|
{
|
|
@@ -526,120 +534,120 @@ async function da(e = {}) {
|
|
|
526
534
|
cssAccent: i.style.getPropertyValue("--pluno-pa-accent")
|
|
527
535
|
}
|
|
528
536
|
);
|
|
529
|
-
const Ct = new Set(l.openToolGroupKeys),
|
|
537
|
+
const Ct = new Set(l.openToolGroupKeys), Me = new Set(
|
|
530
538
|
l.seenShareCandidateIds
|
|
531
|
-
), at = new Set(
|
|
532
|
-
let St = l.sharePromptsDisabled || await
|
|
539
|
+
), at = new Set(Me);
|
|
540
|
+
let St = l.sharePromptsDisabled || await Dr(t), ee = null, re = !1, rt = !(t.loginRequired || t.signupRequired), be = !1, Ee = {
|
|
533
541
|
enabled: !0
|
|
534
|
-
},
|
|
535
|
-
const
|
|
536
|
-
|
|
537
|
-
},
|
|
538
|
-
|
|
539
|
-
},
|
|
540
|
-
|
|
541
|
-
},
|
|
542
|
-
|
|
543
|
-
},
|
|
544
|
-
if (
|
|
542
|
+
}, ke = 0, wn = "", _e = !1, ge = !1, xe = [], Et = null, $e = null;
|
|
543
|
+
const te = (a, d) => {
|
|
544
|
+
Ee = { enabled: a, reason: d };
|
|
545
|
+
}, ne = () => {
|
|
546
|
+
x.hidden = !0;
|
|
547
|
+
}, Vo = () => {
|
|
548
|
+
x.hidden = !1;
|
|
549
|
+
}, Ko = (a = "jump") => {
|
|
550
|
+
te(!0, a), ne(), nt(P, () => Ee.enabled), ke = P.scrollTop;
|
|
551
|
+
}, Le = () => {
|
|
552
|
+
if (Ce.hidden = t.layout === "page" || t.loginRequired, Se.hidden = !_e, Ce.setAttribute("aria-expanded", String(_e)), j.classList.toggle(
|
|
545
553
|
"pluno-pa-widget__history-list--center",
|
|
546
|
-
|
|
547
|
-
),
|
|
554
|
+
ge && xe.length === 0
|
|
555
|
+
), j.replaceChildren(), ge && xe.length === 0) {
|
|
548
556
|
const a = document.createElement("p");
|
|
549
|
-
a.className = "pluno-pa-widget__history-loading", a.textContent = "Loading...",
|
|
557
|
+
a.className = "pluno-pa-widget__history-loading", a.textContent = "Loading...", j.appendChild(a);
|
|
550
558
|
}
|
|
551
|
-
for (const a of
|
|
559
|
+
for (const a of xe) {
|
|
552
560
|
const d = document.createElement("button");
|
|
553
|
-
d.type = "button", d.className = "pluno-pa-widget__history-item", d.disabled =
|
|
561
|
+
d.type = "button", d.className = "pluno-pa-widget__history-item", d.disabled = ge;
|
|
554
562
|
const _ = document.createElement("span");
|
|
555
|
-
_.className = "pluno-pa-widget__history-item-title", _.textContent =
|
|
556
|
-
const
|
|
557
|
-
|
|
563
|
+
_.className = "pluno-pa-widget__history-item-title", _.textContent = Ra(a);
|
|
564
|
+
const k = document.createElement("time");
|
|
565
|
+
k.className = "pluno-pa-widget__history-time", k.dateTime = a.lastActiveAt, k.textContent = za(
|
|
558
566
|
a.lastActiveAt,
|
|
559
567
|
Date.now()
|
|
560
568
|
);
|
|
561
569
|
const M = document.createElement("small");
|
|
562
|
-
M.className = "pluno-pa-widget__history-path", M.textContent =
|
|
563
|
-
|
|
564
|
-
}),
|
|
570
|
+
M.className = "pluno-pa-widget__history-path", M.textContent = Da(a), d.append(_, k, M), d.addEventListener("click", () => {
|
|
571
|
+
_e = !1, $e = null, Le(), te(!0, "newSession"), ne(), b.loadSession(a.id), W(b.getState());
|
|
572
|
+
}), j.appendChild(d);
|
|
565
573
|
}
|
|
566
|
-
if (
|
|
574
|
+
if (ge && xe.length > 0) {
|
|
567
575
|
const a = document.createElement("p");
|
|
568
|
-
a.className = "pluno-pa-widget__history-loading pluno-pa-widget__history-loading--inline", a.textContent = "Loading...",
|
|
576
|
+
a.className = "pluno-pa-widget__history-loading pluno-pa-widget__history-loading--inline", a.textContent = "Loading...", j.appendChild(a);
|
|
569
577
|
}
|
|
570
|
-
|
|
571
|
-
},
|
|
572
|
-
if (!
|
|
573
|
-
|
|
578
|
+
ie.textContent = $e ?? (!ge && xe.length === 0 ? "No recent chats for this page yet." : ""), ie.hidden = ie.textContent.length === 0;
|
|
579
|
+
}, bn = async (a) => {
|
|
580
|
+
if (!ge) {
|
|
581
|
+
ge = !0, $e = null, Le();
|
|
574
582
|
try {
|
|
575
583
|
const d = await b.listSessions({ cursor: a, limit: 20 });
|
|
576
|
-
|
|
584
|
+
xe = a ? [...xe, ...d.sessions] : d.sessions, Et = d.nextCursor;
|
|
577
585
|
} catch (d) {
|
|
578
|
-
|
|
586
|
+
K(
|
|
579
587
|
"web-sdk.widget",
|
|
580
588
|
"Failed to load session history",
|
|
581
589
|
{
|
|
582
590
|
message: d instanceof Error ? d.message : String(d)
|
|
583
591
|
}
|
|
584
|
-
),
|
|
592
|
+
), $e = Qi;
|
|
585
593
|
} finally {
|
|
586
|
-
|
|
594
|
+
ge = !1, Le();
|
|
587
595
|
}
|
|
588
596
|
}
|
|
589
|
-
},
|
|
590
|
-
!Et ||
|
|
591
|
-
},
|
|
592
|
-
|
|
593
|
-
},
|
|
594
|
-
|
|
597
|
+
}, Yo = () => {
|
|
598
|
+
!Et || ge || j.scrollHeight - j.scrollTop - j.clientHeight <= 24 && bn(Et);
|
|
599
|
+
}, _n = () => {
|
|
600
|
+
re || typeof document > "u" || (so(o, t.accentColor), n.isConnected || (t.mountTarget?.isConnected ? t.mountTarget.appendChild(n) : t.mountTarget || T.body?.appendChild(n)));
|
|
601
|
+
}, xn = new MutationObserver(_n);
|
|
602
|
+
xn.observe(T.documentElement, {
|
|
595
603
|
childList: !0,
|
|
596
604
|
subtree: !0
|
|
597
|
-
}),
|
|
598
|
-
const
|
|
605
|
+
}), _n();
|
|
606
|
+
const Ge = (a = !0) => {
|
|
599
607
|
const d = bt(i, a);
|
|
600
|
-
return
|
|
608
|
+
return rn(
|
|
601
609
|
i,
|
|
602
|
-
|
|
610
|
+
s ? Po(s, d) : ya(
|
|
603
611
|
i,
|
|
604
612
|
t.position,
|
|
605
613
|
d
|
|
606
614
|
),
|
|
607
615
|
d
|
|
608
616
|
);
|
|
609
|
-
},
|
|
610
|
-
const a =
|
|
611
|
-
|
|
617
|
+
}, F = () => {
|
|
618
|
+
const a = Pa(o, u, f);
|
|
619
|
+
Mr(t, {
|
|
612
620
|
isOpen: i.classList.contains("pluno-pa-widget--open"),
|
|
613
|
-
composerValue:
|
|
621
|
+
composerValue: f.value,
|
|
614
622
|
focusedInput: a,
|
|
615
623
|
focusedInputAt: a ? Date.now() : null,
|
|
616
624
|
openToolGroupKeys: [...Ct],
|
|
617
|
-
launcherPosition:
|
|
618
|
-
panelSize:
|
|
619
|
-
seenShareCandidateIds: [...
|
|
620
|
-
-
|
|
625
|
+
launcherPosition: g ? s : null,
|
|
626
|
+
panelSize: c,
|
|
627
|
+
seenShareCandidateIds: [...Me].slice(
|
|
628
|
+
-bo
|
|
621
629
|
),
|
|
622
630
|
sharePromptsDisabled: St
|
|
623
631
|
});
|
|
624
632
|
}, lt = (a) => {
|
|
625
633
|
t.onDisplayStateChange?.(a);
|
|
626
634
|
}, qe = (a, d = !0) => {
|
|
627
|
-
if (a === "shown") {
|
|
628
|
-
i.classList.remove("pluno-pa-widget--minimized"),
|
|
635
|
+
if (co(t, a), a === "shown") {
|
|
636
|
+
i.classList.remove("pluno-pa-widget--minimized"), I.removeAttribute("tabindex"), !i.classList.contains("pluno-pa-widget--open") && !i.classList.contains("pluno-pa-widget--closing") && je(!1), d && lt("shown");
|
|
629
637
|
return;
|
|
630
638
|
}
|
|
631
|
-
|
|
639
|
+
ee !== null && (window.clearTimeout(ee), ee = null), i.classList.remove("pluno-pa-widget--open"), i.classList.remove("pluno-pa-widget--closing"), i.classList.add("pluno-pa-widget--minimized"), I.hidden = !1, m.hidden = !0, L.hidden = !0, I.tabIndex = 0, f.value = "", Ae(
|
|
632
640
|
i,
|
|
633
641
|
Gt(
|
|
634
642
|
i,
|
|
635
|
-
|
|
643
|
+
s,
|
|
636
644
|
t.position
|
|
637
645
|
)
|
|
638
|
-
),
|
|
639
|
-
},
|
|
640
|
-
|
|
641
|
-
debugVersion:
|
|
642
|
-
launcherPosition:
|
|
646
|
+
), Zn(i), F(), d && lt("minimized");
|
|
647
|
+
}, Pe = (a, d = {}) => {
|
|
648
|
+
La(a, {
|
|
649
|
+
debugVersion: ca,
|
|
650
|
+
launcherPosition: s,
|
|
643
651
|
rootClasses: i.className,
|
|
644
652
|
rootStyle: {
|
|
645
653
|
left: i.style.left,
|
|
@@ -647,37 +655,40 @@ async function da(e = {}) {
|
|
|
647
655
|
right: i.style.right,
|
|
648
656
|
bottom: i.style.bottom
|
|
649
657
|
},
|
|
650
|
-
rootRect:
|
|
651
|
-
launcherRect:
|
|
652
|
-
panelRect:
|
|
658
|
+
rootRect: jt(i),
|
|
659
|
+
launcherRect: jt(I),
|
|
660
|
+
panelRect: jt(m),
|
|
653
661
|
viewport: Z(),
|
|
654
|
-
panelHidden:
|
|
655
|
-
closeHidden:
|
|
662
|
+
panelHidden: m.hidden,
|
|
663
|
+
closeHidden: L.hidden,
|
|
656
664
|
...d
|
|
657
665
|
});
|
|
658
666
|
}, je = (a = !0) => {
|
|
659
|
-
if (!
|
|
660
|
-
return
|
|
661
|
-
const d =
|
|
662
|
-
return
|
|
667
|
+
if (!s)
|
|
668
|
+
return Ae(i, null), Ge(a);
|
|
669
|
+
const d = Ge(a);
|
|
670
|
+
return Ae(i, d), Pe("Applied stored closed launcher position", {
|
|
663
671
|
visibleLauncherPosition: d
|
|
664
672
|
}), d;
|
|
665
673
|
}, kt = (a, d) => {
|
|
666
674
|
if (!a || !d) {
|
|
667
|
-
|
|
675
|
+
Zn(i);
|
|
668
676
|
return;
|
|
669
677
|
}
|
|
670
|
-
|
|
678
|
+
ka(i, {
|
|
671
679
|
x: a.x - d.x,
|
|
672
680
|
y: a.y - d.y
|
|
673
681
|
});
|
|
674
|
-
},
|
|
682
|
+
}, Lt = () => {
|
|
683
|
+
const a = tt(c).width;
|
|
684
|
+
return t.layout === "page" && m.getBoundingClientRect().width || a;
|
|
685
|
+
}, yn = () => {
|
|
675
686
|
if (i.classList.contains("pluno-pa-widget--minimized")) {
|
|
676
|
-
|
|
687
|
+
Ae(
|
|
677
688
|
i,
|
|
678
689
|
Gt(
|
|
679
690
|
i,
|
|
680
|
-
|
|
691
|
+
s,
|
|
681
692
|
t.position
|
|
682
693
|
)
|
|
683
694
|
);
|
|
@@ -685,162 +696,170 @@ async function da(e = {}) {
|
|
|
685
696
|
}
|
|
686
697
|
const a = je();
|
|
687
698
|
if (i.classList.contains("pluno-pa-widget--open") || i.classList.contains("pluno-pa-widget--closing")) {
|
|
688
|
-
|
|
689
|
-
const d =
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
699
|
+
$t(i, c);
|
|
700
|
+
const d = tt(c);
|
|
701
|
+
Kt(
|
|
702
|
+
S,
|
|
703
|
+
Lt()
|
|
693
704
|
);
|
|
694
705
|
const _ = mt(
|
|
695
|
-
|
|
706
|
+
h ?? qt(
|
|
696
707
|
i,
|
|
697
708
|
a,
|
|
698
709
|
t.position,
|
|
699
|
-
|
|
710
|
+
c
|
|
700
711
|
),
|
|
701
712
|
d
|
|
702
713
|
);
|
|
703
|
-
|
|
714
|
+
h && (h = _), kt(_, a), Pe(
|
|
704
715
|
"Applied open panel position after viewport resize",
|
|
705
716
|
{ openPanelPosition: _ }
|
|
706
717
|
);
|
|
707
|
-
} else
|
|
718
|
+
} else s && Pe(
|
|
708
719
|
"Applied visible launcher position after viewport resize",
|
|
709
720
|
{ visibleLauncherPosition: a }
|
|
710
721
|
);
|
|
711
722
|
};
|
|
712
|
-
let
|
|
723
|
+
let vn = () => {
|
|
713
724
|
};
|
|
714
|
-
window.addEventListener("resize",
|
|
725
|
+
window.addEventListener("resize", yn), t.movableLauncher && D ? (je(), vn = ba({
|
|
715
726
|
root: i,
|
|
716
|
-
launcher:
|
|
727
|
+
launcher: I,
|
|
717
728
|
launcherDragHandle: D,
|
|
718
|
-
getPosition: () =>
|
|
729
|
+
getPosition: () => Ge(),
|
|
719
730
|
setPosition: (a) => {
|
|
720
|
-
const d = a, _ = bt(i),
|
|
731
|
+
const d = a, _ = bt(i), k = rn(
|
|
721
732
|
i,
|
|
722
733
|
a,
|
|
723
734
|
_
|
|
724
735
|
);
|
|
725
|
-
|
|
726
|
-
|
|
736
|
+
s = Ca(
|
|
737
|
+
k,
|
|
727
738
|
_
|
|
728
|
-
),
|
|
739
|
+
), Ae(i, k), Pe("Dragging closed launcher", {
|
|
729
740
|
requestedPosition: d
|
|
730
741
|
});
|
|
731
742
|
},
|
|
732
743
|
persist: () => {
|
|
733
|
-
|
|
744
|
+
g = !0, F(), Pe("Persisted closed launcher drag position");
|
|
734
745
|
}
|
|
735
|
-
})) :
|
|
736
|
-
const
|
|
737
|
-
const a =
|
|
746
|
+
})) : Ae(i, null), $t(i, c);
|
|
747
|
+
const Xo = () => {
|
|
748
|
+
const a = tt(c), d = Ge();
|
|
738
749
|
return {
|
|
739
750
|
position: mt(
|
|
740
|
-
|
|
751
|
+
h ?? qt(
|
|
741
752
|
i,
|
|
742
753
|
d,
|
|
743
754
|
t.position,
|
|
744
|
-
|
|
755
|
+
c
|
|
745
756
|
),
|
|
746
757
|
a
|
|
747
758
|
),
|
|
748
759
|
size: a
|
|
749
760
|
};
|
|
750
|
-
},
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
),
|
|
761
|
+
}, Zo = (a) => {
|
|
762
|
+
c = xt(a.size), $t(i, c), Kt(
|
|
763
|
+
S,
|
|
764
|
+
Lt()
|
|
765
|
+
), h = mt(
|
|
755
766
|
a.position,
|
|
756
|
-
|
|
767
|
+
tt(c)
|
|
757
768
|
);
|
|
758
|
-
const d =
|
|
759
|
-
kt(
|
|
760
|
-
},
|
|
769
|
+
const d = Ge();
|
|
770
|
+
kt(h, d);
|
|
771
|
+
}, Jo = z.length > 0 ? _a({
|
|
761
772
|
root: i,
|
|
762
|
-
handles:
|
|
763
|
-
getBounds:
|
|
764
|
-
setBounds:
|
|
765
|
-
persist:
|
|
773
|
+
handles: z,
|
|
774
|
+
getBounds: Xo,
|
|
775
|
+
setBounds: Zo,
|
|
776
|
+
persist: F
|
|
766
777
|
}) : () => {
|
|
767
778
|
};
|
|
768
|
-
let
|
|
769
|
-
const
|
|
770
|
-
if (!(!t.billingStatusLoader ||
|
|
771
|
-
|
|
779
|
+
let Pt = !1;
|
|
780
|
+
const Cn = async () => {
|
|
781
|
+
if (!(!t.billingStatusLoader || Pt)) {
|
|
782
|
+
Pt = !0;
|
|
772
783
|
try {
|
|
773
784
|
const a = await t.billingStatusLoader();
|
|
774
|
-
|
|
785
|
+
if (re)
|
|
786
|
+
return;
|
|
787
|
+
no(
|
|
775
788
|
t.billingStatus,
|
|
776
789
|
a,
|
|
777
790
|
b.getState().lastErrorCode
|
|
778
|
-
) && (t.billingStatus = a,
|
|
779
|
-
|
|
791
|
+
) && (t.billingStatus = a, Xt(
|
|
792
|
+
Re,
|
|
780
793
|
t.billingStatus,
|
|
781
794
|
b.getState().lastErrorCode
|
|
782
|
-
),
|
|
795
|
+
), $());
|
|
796
|
+
} catch (a) {
|
|
797
|
+
K(
|
|
798
|
+
"web-sdk.widget",
|
|
799
|
+
"Failed to refresh billing status",
|
|
800
|
+
{ message: a instanceof Error ? a.message : String(a) }
|
|
801
|
+
);
|
|
783
802
|
} finally {
|
|
784
|
-
|
|
803
|
+
Pt = !1;
|
|
785
804
|
}
|
|
786
805
|
}
|
|
787
|
-
},
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
806
|
+
}, he = (a = "", d = !0) => {
|
|
807
|
+
Cn(), Ye && (Ye = !1, At()), i.classList.contains("pluno-pa-widget--open") || (h = null), ee !== null && (window.clearTimeout(ee), ee = null), qe("shown", !1), m.hidden = !1, L.hidden = !1, Kt(
|
|
808
|
+
S,
|
|
809
|
+
Lt()
|
|
791
810
|
), i.classList.remove("pluno-pa-widget--closing");
|
|
792
|
-
const _ = je(),
|
|
811
|
+
const _ = je(), k = qt(
|
|
793
812
|
i,
|
|
794
813
|
_,
|
|
795
814
|
t.position,
|
|
796
|
-
|
|
815
|
+
c
|
|
797
816
|
);
|
|
798
|
-
if (kt(
|
|
799
|
-
openPanelPosition:
|
|
817
|
+
if (kt(k, _), Pe("Opening launcher at clamped open panel position", {
|
|
818
|
+
openPanelPosition: k,
|
|
800
819
|
visibleLauncherPosition: _
|
|
801
|
-
}),
|
|
802
|
-
i.classList.add("pluno-pa-widget--open"),
|
|
820
|
+
}), te(!0, "open"), ne(), !d) {
|
|
821
|
+
i.classList.add("pluno-pa-widget--open"), I.hidden = !0, a && (f.value = a, et(f)), nt(P, () => Ee.enabled), ke = P.scrollTop, f.focus(), f.setSelectionRange(f.value.length, f.value.length), F(), lt("shown"), t.onPanelOpenChange?.(!0);
|
|
803
822
|
return;
|
|
804
823
|
}
|
|
805
824
|
window.requestAnimationFrame(() => {
|
|
806
|
-
i.classList.add("pluno-pa-widget--open"), a && (
|
|
807
|
-
|
|
825
|
+
i.classList.add("pluno-pa-widget--open"), a && (f.value = a, et(f)), nt(P, () => Ee.enabled), ke = P.scrollTop, f.focus(), f.setSelectionRange(f.value.length, f.value.length), F(), lt("shown"), t.onPanelOpenChange?.(!0), ee = window.setTimeout(() => {
|
|
826
|
+
I.hidden = !0, nt(P, () => Ee.enabled), ke = P.scrollTop;
|
|
808
827
|
}, 220);
|
|
809
828
|
});
|
|
810
|
-
},
|
|
811
|
-
|
|
812
|
-
|
|
829
|
+
}, Tt = () => {
|
|
830
|
+
ee !== null && (window.clearTimeout(ee), ee = null), I.hidden = !1, s && (je(!1), Pe("Closing launcher at stored position")), i.classList.remove("pluno-pa-widget--open"), i.classList.add("pluno-pa-widget--closing"), F(), t.onPanelOpenChange?.(!1), ee = window.setTimeout(() => {
|
|
831
|
+
m.hidden = !0, L.hidden = !0, h = null, i.classList.remove("pluno-pa-widget--closing");
|
|
813
832
|
}, 220);
|
|
814
833
|
};
|
|
815
|
-
|
|
816
|
-
a.preventDefault(),
|
|
834
|
+
I.addEventListener("submit", (a) => {
|
|
835
|
+
a.preventDefault(), he(u.value), u.value = "";
|
|
817
836
|
}), D?.addEventListener("click", (a) => {
|
|
818
837
|
a.preventDefault(), a.stopPropagation();
|
|
819
|
-
}),
|
|
820
|
-
a.target ===
|
|
821
|
-
}),
|
|
822
|
-
|
|
823
|
-
}),
|
|
824
|
-
if (!
|
|
838
|
+
}), I.addEventListener("click", (a) => {
|
|
839
|
+
a.target === u && !D || (he(u.value), u.value = "");
|
|
840
|
+
}), u.addEventListener("focus", () => {
|
|
841
|
+
he(u.value), u.value = "";
|
|
842
|
+
}), u.addEventListener("input", () => {
|
|
843
|
+
if (!u.value)
|
|
825
844
|
return;
|
|
826
|
-
const a =
|
|
827
|
-
|
|
845
|
+
const a = u.value;
|
|
846
|
+
he(a), u.value = "";
|
|
828
847
|
});
|
|
829
|
-
let
|
|
830
|
-
const
|
|
848
|
+
let It = null, pt = null, Te = null;
|
|
849
|
+
const Sn = (a) => a === u || a === f, Qo = (a) => {
|
|
831
850
|
if (!(a instanceof Element) || a.getRootNode() === i.getRootNode())
|
|
832
851
|
return null;
|
|
833
852
|
let d = a;
|
|
834
853
|
for (; d; ) {
|
|
835
|
-
const _ = d.closest(
|
|
854
|
+
const _ = d.closest(Fn);
|
|
836
855
|
if (_)
|
|
837
856
|
return _;
|
|
838
|
-
const
|
|
839
|
-
d =
|
|
857
|
+
const k = d.getRootNode();
|
|
858
|
+
d = k instanceof ShadowRoot ? k.host : null;
|
|
840
859
|
}
|
|
841
860
|
return null;
|
|
842
|
-
},
|
|
843
|
-
if (!a.isConnected || !a.matches(
|
|
861
|
+
}, ei = (a) => {
|
|
862
|
+
if (!a.isConnected || !a.matches(Fn))
|
|
844
863
|
return !1;
|
|
845
864
|
if (!(a instanceof HTMLElement))
|
|
846
865
|
return !0;
|
|
@@ -850,73 +869,73 @@ async function da(e = {}) {
|
|
|
850
869
|
return a.checkVisibility();
|
|
851
870
|
const d = window.getComputedStyle(a);
|
|
852
871
|
return d.display !== "none" && d.visibility !== "hidden";
|
|
853
|
-
},
|
|
854
|
-
Ke !== a && (Ke = a, i.classList.toggle("pluno-pa-widget--host-modal-conflict", a !== null),
|
|
872
|
+
}, En = (a) => {
|
|
873
|
+
Ke !== a && (Ke = a, i.classList.toggle("pluno-pa-widget--host-modal-conflict", a !== null), Ie(), a !== null ? Te = window.setInterval(() => {
|
|
855
874
|
const d = Ke;
|
|
856
|
-
(!d || !
|
|
857
|
-
},
|
|
858
|
-
},
|
|
859
|
-
|
|
875
|
+
(!d || !ei(d)) && En(null);
|
|
876
|
+
}, Ji) : Te !== null && (window.clearInterval(Te), Te = null, pt = null));
|
|
877
|
+
}, ti = () => {
|
|
878
|
+
Te !== null && (window.clearInterval(Te), Te = null);
|
|
860
879
|
};
|
|
861
880
|
i.addEventListener("focusin", (a) => {
|
|
862
|
-
|
|
881
|
+
Sn(a.target) && (It = Date.now(), F());
|
|
863
882
|
}), i.addEventListener("focusout", (a) => {
|
|
864
|
-
if (!
|
|
883
|
+
if (!Sn(a.target) || Ke !== null)
|
|
865
884
|
return;
|
|
866
|
-
const d =
|
|
867
|
-
if (
|
|
885
|
+
const d = It;
|
|
886
|
+
if (It = null, d === null || Date.now() - d > Xi)
|
|
868
887
|
return;
|
|
869
|
-
const _ =
|
|
888
|
+
const _ = Qo(a.relatedTarget);
|
|
870
889
|
if (!_)
|
|
871
890
|
return;
|
|
872
|
-
const
|
|
873
|
-
if (pt !== null &&
|
|
874
|
-
|
|
891
|
+
const k = Date.now();
|
|
892
|
+
if (pt !== null && k - pt <= Zi) {
|
|
893
|
+
En(_);
|
|
875
894
|
return;
|
|
876
895
|
}
|
|
877
|
-
pt =
|
|
878
|
-
}),
|
|
879
|
-
!i.classList.contains("pluno-pa-widget--minimized") || a.key !== "Enter" && a.key !== " " || (a.preventDefault(),
|
|
880
|
-
}),
|
|
896
|
+
pt = k;
|
|
897
|
+
}), I.addEventListener("keydown", (a) => {
|
|
898
|
+
!i.classList.contains("pluno-pa-widget--minimized") || a.key !== "Enter" && a.key !== " " || (a.preventDefault(), he());
|
|
899
|
+
}), y?.addEventListener("pointerdown", (a) => {
|
|
881
900
|
a.stopPropagation();
|
|
882
|
-
}),
|
|
901
|
+
}), y?.addEventListener("click", (a) => {
|
|
883
902
|
a.preventDefault(), a.stopPropagation(), qe("minimized");
|
|
884
|
-
}),
|
|
885
|
-
|
|
886
|
-
}),
|
|
887
|
-
|
|
903
|
+
}), L.addEventListener("click", Tt), P.addEventListener("scroll", () => {
|
|
904
|
+
P.scrollTop < ke - 1 && te(!1, "userScroll"), ke = P.scrollTop;
|
|
905
|
+
}), x.addEventListener("click", () => {
|
|
906
|
+
Ko();
|
|
888
907
|
});
|
|
889
|
-
const
|
|
908
|
+
const kn = typeof IntersectionObserver > "u" ? null : new IntersectionObserver(
|
|
890
909
|
([a]) => {
|
|
891
|
-
a?.isIntersecting && (
|
|
910
|
+
a?.isIntersecting && (te(!0, "bottom"), ne());
|
|
892
911
|
},
|
|
893
|
-
{ root:
|
|
912
|
+
{ root: P, threshold: 0 }
|
|
894
913
|
);
|
|
895
|
-
|
|
914
|
+
kn?.observe(ae);
|
|
896
915
|
const Ve = () => t.loginRequired || t.signupRequired;
|
|
897
916
|
let Ke = null, Ye = !1;
|
|
898
|
-
const
|
|
899
|
-
const a = Ve(), d = Ke !== null, _ = !a &&
|
|
900
|
-
|
|
901
|
-
},
|
|
902
|
-
|
|
917
|
+
const V = () => rt || b.getState().status !== "connected", Ie = () => {
|
|
918
|
+
const a = Ve(), d = Ke !== null, _ = !a && V();
|
|
919
|
+
u.readOnly = a || d || _, f.readOnly = d || _, u.placeholder = d ? Wn : a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : Ye ? "New update" : t.launcherLabel, f.placeholder = d ? Wn : a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : pe.launcherLabel, oe.hidden = a;
|
|
920
|
+
}, $ = () => {
|
|
921
|
+
Q.disabled = V() || de(t.billingStatus) || !b.getState().isThinking && f.value.trim().length === 0 && q.length === 0, B.disabled = Ve() || V() || de(t.billingStatus);
|
|
903
922
|
};
|
|
904
|
-
|
|
905
|
-
const
|
|
923
|
+
Ie();
|
|
924
|
+
const At = () => {
|
|
906
925
|
const a = b.getState().isThinking;
|
|
907
926
|
i.classList.toggle("pluno-pa-widget--thinking", a), i.classList.toggle(
|
|
908
927
|
"pluno-pa-widget--unread",
|
|
909
928
|
!a && Ye
|
|
910
|
-
),
|
|
929
|
+
), Ie();
|
|
911
930
|
};
|
|
912
|
-
|
|
913
|
-
const
|
|
914
|
-
Ve() ||
|
|
931
|
+
At();
|
|
932
|
+
const Nt = () => {
|
|
933
|
+
Ve() || re || (rt = !0, Ie(), $(), b.connect().then(
|
|
915
934
|
() => {
|
|
916
|
-
|
|
935
|
+
re || (rt = !1, Ie(), $());
|
|
917
936
|
},
|
|
918
937
|
(a) => {
|
|
919
|
-
|
|
938
|
+
re || (rt = !1, Ie(), $(), K(
|
|
920
939
|
"web-sdk.widget",
|
|
921
940
|
"Failed to connect Product Agent widget",
|
|
922
941
|
{
|
|
@@ -926,7 +945,7 @@ async function da(e = {}) {
|
|
|
926
945
|
}
|
|
927
946
|
));
|
|
928
947
|
};
|
|
929
|
-
|
|
948
|
+
oe.addEventListener("submit", (a) => {
|
|
930
949
|
if (a.preventDefault(), t.loginRequired) {
|
|
931
950
|
t.onLoginClick?.();
|
|
932
951
|
return;
|
|
@@ -935,65 +954,65 @@ async function da(e = {}) {
|
|
|
935
954
|
t.onSignupClick?.();
|
|
936
955
|
return;
|
|
937
956
|
}
|
|
938
|
-
|
|
957
|
+
V() || de(t.billingStatus) || (be = !0, te(!0, "send"), ne(), q = Vt(
|
|
939
958
|
b,
|
|
940
|
-
|
|
959
|
+
f,
|
|
941
960
|
q
|
|
942
|
-
),
|
|
961
|
+
), ze(), $());
|
|
943
962
|
});
|
|
944
963
|
let Xe = 0;
|
|
945
|
-
const
|
|
964
|
+
const ni = () => {
|
|
946
965
|
Xe = 0, i.classList.remove("pluno-pa-widget--drag-over");
|
|
947
|
-
},
|
|
948
|
-
|
|
949
|
-
|
|
966
|
+
}, Rt = (a) => {
|
|
967
|
+
ue !== null && window.clearTimeout(ue), J.textContent = a, J.hidden = !1, ue = window.setTimeout(() => {
|
|
968
|
+
J.textContent = "", J.hidden = !0, ue = null;
|
|
950
969
|
}, 3e3);
|
|
951
|
-
},
|
|
952
|
-
|
|
953
|
-
},
|
|
954
|
-
if (a.length === 0)
|
|
970
|
+
}, oi = () => {
|
|
971
|
+
ue !== null && (window.clearTimeout(ue), ue = null), J.textContent = "", J.hidden = !0;
|
|
972
|
+
}, Dt = async (a) => {
|
|
973
|
+
if (!t.attachmentsEnabled || a.length === 0)
|
|
955
974
|
return;
|
|
956
|
-
const d =
|
|
957
|
-
q = [...q, ...d],
|
|
975
|
+
const d = ir(b, a);
|
|
976
|
+
q = [...q, ...d], ze(), oi(), $(), W(b.getState()), i.classList.contains("pluno-pa-widget--open") || he();
|
|
958
977
|
};
|
|
959
|
-
|
|
960
|
-
t.loginRequired ||
|
|
961
|
-
}),
|
|
962
|
-
const a = Array.from(
|
|
963
|
-
|
|
964
|
-
|
|
978
|
+
B.addEventListener("click", () => {
|
|
979
|
+
t.loginRequired || V() || de(t.billingStatus) || we.click();
|
|
980
|
+
}), we.addEventListener("change", () => {
|
|
981
|
+
const a = Array.from(we.files ?? []);
|
|
982
|
+
we.value = "", Dt(a).catch((d) => {
|
|
983
|
+
Rt(
|
|
965
984
|
d instanceof Error ? d.message : "Failed to attach file"
|
|
966
|
-
),
|
|
985
|
+
), K("web-sdk.widget", "Attachment failed", {
|
|
967
986
|
message: d instanceof Error ? d.message : String(d)
|
|
968
987
|
});
|
|
969
988
|
});
|
|
970
989
|
}), i.addEventListener("dragenter", (a) => {
|
|
971
|
-
!ut(a.dataTransfer) || t.loginRequired ||
|
|
990
|
+
!t.attachmentsEnabled || !ut(a.dataTransfer) || t.loginRequired || V() || (a.preventDefault(), a.stopPropagation(), Xe += 1, i.classList.add("pluno-pa-widget--drag-over"));
|
|
972
991
|
}), i.addEventListener("dragover", (a) => {
|
|
973
992
|
const d = a.dataTransfer;
|
|
974
|
-
!ut(d) || t.loginRequired ||
|
|
993
|
+
!t.attachmentsEnabled || !ut(d) || t.loginRequired || V() || (a.preventDefault(), a.stopPropagation(), d.dropEffect = "copy");
|
|
975
994
|
}), i.addEventListener("dragleave", (a) => {
|
|
976
995
|
ut(a.dataTransfer) && (a.stopPropagation(), Xe = Math.max(0, Xe - 1), Xe === 0 && i.classList.remove("pluno-pa-widget--drag-over"));
|
|
977
996
|
}), i.addEventListener("drop", (a) => {
|
|
978
997
|
const d = a.dataTransfer;
|
|
979
|
-
!ut(d) || t.loginRequired ||
|
|
980
|
-
|
|
998
|
+
!t.attachmentsEnabled || !ut(d) || t.loginRequired || V() || (a.preventDefault(), a.stopPropagation(), ni(), Dt(d.files).catch((_) => {
|
|
999
|
+
Rt(
|
|
981
1000
|
_ instanceof Error ? _.message : "Failed to attach file"
|
|
982
|
-
),
|
|
1001
|
+
), K("web-sdk.widget", "Attachment failed", {
|
|
983
1002
|
message: _ instanceof Error ? _.message : String(_)
|
|
984
1003
|
});
|
|
985
1004
|
}));
|
|
986
1005
|
}), i.addEventListener("paste", (a) => {
|
|
987
1006
|
a.stopPropagation();
|
|
988
1007
|
const d = a.clipboardData, _ = Array.from(d?.files ?? []);
|
|
989
|
-
_.length === 0 || t.loginRequired ||
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
),
|
|
993
|
-
message:
|
|
1008
|
+
!t.attachmentsEnabled || _.length === 0 || t.loginRequired || V() || (a.preventDefault(), Dt(_).catch((k) => {
|
|
1009
|
+
Rt(
|
|
1010
|
+
k instanceof Error ? k.message : "Failed to attach file"
|
|
1011
|
+
), K("web-sdk.widget", "Attachment failed", {
|
|
1012
|
+
message: k instanceof Error ? k.message : String(k)
|
|
994
1013
|
});
|
|
995
1014
|
}));
|
|
996
|
-
}),
|
|
1015
|
+
}), Q.addEventListener("click", () => {
|
|
997
1016
|
if (t.loginRequired) {
|
|
998
1017
|
t.onLoginClick?.();
|
|
999
1018
|
return;
|
|
@@ -1002,42 +1021,42 @@ async function da(e = {}) {
|
|
|
1002
1021
|
b.stop();
|
|
1003
1022
|
return;
|
|
1004
1023
|
}
|
|
1005
|
-
|
|
1024
|
+
V() || (be = !0, te(!0, "send"), ne(), q = Vt(
|
|
1006
1025
|
b,
|
|
1007
|
-
|
|
1026
|
+
f,
|
|
1008
1027
|
q
|
|
1009
|
-
),
|
|
1010
|
-
}),
|
|
1011
|
-
|
|
1028
|
+
), ze(), $(), W(b.getState()));
|
|
1029
|
+
}), Ce.addEventListener("click", () => {
|
|
1030
|
+
_e = !_e, $e = null, Le(), _e && xe.length === 0 && bn(null);
|
|
1012
1031
|
}), it.addEventListener("click", () => {
|
|
1013
|
-
|
|
1014
|
-
}),
|
|
1015
|
-
et(
|
|
1016
|
-
}),
|
|
1032
|
+
_e = !1, Le();
|
|
1033
|
+
}), j.addEventListener("scroll", Yo), f.addEventListener("input", () => {
|
|
1034
|
+
et(f), F(), $(), ri();
|
|
1035
|
+
}), f.addEventListener("keydown", (a) => {
|
|
1017
1036
|
if (!(a.key !== "Enter" || a.shiftKey)) {
|
|
1018
1037
|
if (a.preventDefault(), t.loginRequired) {
|
|
1019
1038
|
t.onLoginClick?.();
|
|
1020
1039
|
return;
|
|
1021
1040
|
}
|
|
1022
|
-
|
|
1041
|
+
V() || (be = !0, te(!0, "send"), ne(), q = Vt(
|
|
1023
1042
|
b,
|
|
1024
|
-
|
|
1043
|
+
f,
|
|
1025
1044
|
q
|
|
1026
|
-
),
|
|
1045
|
+
), ze(), $(), W(b.getState()));
|
|
1027
1046
|
}
|
|
1028
1047
|
}), i.addEventListener("click", (a) => {
|
|
1029
|
-
(a.target instanceof Element ? a.target : null)?.closest("a[href]") &&
|
|
1030
|
-
}), l.composerValue && (
|
|
1048
|
+
(a.target instanceof Element ? a.target : null)?.closest("a[href]") && F();
|
|
1049
|
+
}), l.composerValue && (f.value = l.composerValue, et(f)), t.layout === "page" ? he(f.value, !1) : p === "minimized" ? qe("minimized", !1) : t.initialDisplayState === void 0 && l.isOpen && he(f.value, !1), Ta(l, i, u, f);
|
|
1031
1050
|
const st = () => r;
|
|
1032
|
-
let
|
|
1051
|
+
let zt = b.getState().appearance !== null, dt = null, Ze = null, Oe = null, Ln = b.getState().isThinking, Ue = null;
|
|
1033
1052
|
const Je = t.taskNotifications;
|
|
1034
|
-
let
|
|
1035
|
-
const
|
|
1036
|
-
|
|
1053
|
+
let Be = null, Fe = !1;
|
|
1054
|
+
const Pn = () => {
|
|
1055
|
+
Be !== null && (window.clearTimeout(Be), Be = null);
|
|
1037
1056
|
}, ct = () => {
|
|
1038
|
-
|
|
1039
|
-
},
|
|
1040
|
-
if (!Je || !
|
|
1057
|
+
H && (H.hidden = !0);
|
|
1058
|
+
}, Tn = () => b.getState().assistantDraft.trim().length > 0, ii = async () => {
|
|
1059
|
+
if (!Je || !H || Fe || re || !b.getState().isThinking || Tn())
|
|
1041
1060
|
return;
|
|
1042
1061
|
let a;
|
|
1043
1062
|
try {
|
|
@@ -1045,47 +1064,47 @@ async function da(e = {}) {
|
|
|
1045
1064
|
} catch {
|
|
1046
1065
|
return;
|
|
1047
1066
|
}
|
|
1048
|
-
a.enabled || a.neverSuggest || !b.getState().isThinking ||
|
|
1067
|
+
a.enabled || a.neverSuggest || !b.getState().isThinking || Tn() || Fe || re || (H.hidden = !1);
|
|
1049
1068
|
};
|
|
1050
|
-
|
|
1051
|
-
|
|
1069
|
+
v?.addEventListener("click", () => {
|
|
1070
|
+
Fe = !0, ct(), Je?.enable().catch(() => {
|
|
1052
1071
|
});
|
|
1053
|
-
}), P?.addEventListener("click", () => {
|
|
1054
|
-
Oe = !0, ct();
|
|
1055
1072
|
}), R?.addEventListener("click", () => {
|
|
1056
|
-
|
|
1073
|
+
Fe = !0, ct();
|
|
1074
|
+
}), qo?.addEventListener("click", () => {
|
|
1075
|
+
Fe = !0, ct(), Je?.dismissForever().catch(() => {
|
|
1057
1076
|
});
|
|
1058
1077
|
});
|
|
1059
|
-
let
|
|
1078
|
+
let We = null, In = () => {
|
|
1060
1079
|
};
|
|
1061
|
-
const
|
|
1062
|
-
const a =
|
|
1063
|
-
|
|
1080
|
+
const ai = !!t.socialPostDraftHandler, Mt = /* @__PURE__ */ new Map(), Ot = () => f.value.trim().length > 0 || q.length > 0, ri = () => {
|
|
1081
|
+
const a = We !== null && Zt(b.getState(), Ot());
|
|
1082
|
+
N.hidden = !a, a && We !== null && Io(N, We);
|
|
1064
1083
|
};
|
|
1065
|
-
let
|
|
1066
|
-
const
|
|
1067
|
-
|
|
1068
|
-
},
|
|
1069
|
-
if (!a) {
|
|
1070
|
-
|
|
1084
|
+
let He = null;
|
|
1085
|
+
const Ut = (a = {}) => {
|
|
1086
|
+
be = !0, te(!0, "newSession"), ne(), _e = !1, Le(), b.startNewSession(a), Ct.clear(), f.value = "", q = [], ze(), et(f), F(), $(), f.focus(), W(b.getState());
|
|
1087
|
+
}, Bt = (a) => {
|
|
1088
|
+
if (!a || t.layout === "page") {
|
|
1089
|
+
He?.remove(), He = null;
|
|
1071
1090
|
return;
|
|
1072
1091
|
}
|
|
1073
|
-
|
|
1092
|
+
He || (He = yt(
|
|
1074
1093
|
"pluno-pa-widget__new-chat",
|
|
1075
1094
|
"New chat",
|
|
1076
|
-
|
|
1095
|
+
Va(),
|
|
1077
1096
|
!1
|
|
1078
|
-
),
|
|
1079
|
-
},
|
|
1080
|
-
if (
|
|
1081
|
-
|
|
1097
|
+
), He.addEventListener("click", () => Ut()), De.insertBefore(He, Ce));
|
|
1098
|
+
}, W = (a) => {
|
|
1099
|
+
if (Le(), hn(a.lastErrorCode) ? Ue = a.lastErrorCode : t.billingStatus?.creditsUsed !== null && !de(t.billingStatus) && (Ue = null), Xt(
|
|
1100
|
+
Re,
|
|
1082
1101
|
t.billingStatus,
|
|
1083
|
-
|
|
1102
|
+
Ue
|
|
1084
1103
|
), t.loginRequired) {
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1104
|
+
Mt.clear(), ro(
|
|
1105
|
+
P,
|
|
1106
|
+
Q,
|
|
1107
|
+
Bt,
|
|
1089
1108
|
st,
|
|
1090
1109
|
"Log in to use Pluno on this page.",
|
|
1091
1110
|
t.loginButtonLabel,
|
|
@@ -1095,10 +1114,10 @@ async function da(e = {}) {
|
|
|
1095
1114
|
return;
|
|
1096
1115
|
}
|
|
1097
1116
|
if (t.signupRequired) {
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1117
|
+
Mt.clear(), ro(
|
|
1118
|
+
P,
|
|
1119
|
+
Q,
|
|
1120
|
+
Bt,
|
|
1102
1121
|
st,
|
|
1103
1122
|
"Complete signup to unlock your free trial credits.",
|
|
1104
1123
|
t.signupButtonLabel,
|
|
@@ -1107,78 +1126,78 @@ async function da(e = {}) {
|
|
|
1107
1126
|
);
|
|
1108
1127
|
return;
|
|
1109
1128
|
}
|
|
1110
|
-
const d =
|
|
1111
|
-
|
|
1112
|
-
const
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1129
|
+
const d = Aa(a), _ = d !== wn;
|
|
1130
|
+
wn = d;
|
|
1131
|
+
const k = be || Ee.enabled;
|
|
1132
|
+
be = !1, cr(
|
|
1133
|
+
P,
|
|
1134
|
+
ae,
|
|
1135
|
+
Q,
|
|
1136
|
+
Bt,
|
|
1137
|
+
N,
|
|
1119
1138
|
a,
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
() =>
|
|
1139
|
+
We,
|
|
1140
|
+
We !== null && Zt(a, Ot()),
|
|
1141
|
+
k,
|
|
1142
|
+
() => Ee.enabled,
|
|
1124
1143
|
Ct,
|
|
1125
|
-
|
|
1126
|
-
|
|
1144
|
+
Mt,
|
|
1145
|
+
F,
|
|
1127
1146
|
st,
|
|
1128
1147
|
(M) => {
|
|
1129
|
-
if (
|
|
1148
|
+
if (V())
|
|
1130
1149
|
return;
|
|
1131
1150
|
const Qe = t.morningReport !== null;
|
|
1132
|
-
t.morningReport = null, Qe && (t.onMorningReportTaskStart?.(),
|
|
1151
|
+
t.morningReport = null, Qe && (t.onMorningReportTaskStart?.(), Ut()), be = !0, te(!0, "send"), ne(), b.sendMessage(M);
|
|
1133
1152
|
},
|
|
1134
1153
|
() => {
|
|
1135
|
-
|
|
1154
|
+
be = !0, te(!0, "send"), ne(), b.retryLastMessage();
|
|
1136
1155
|
},
|
|
1137
1156
|
t.morningReport,
|
|
1138
1157
|
() => {
|
|
1139
|
-
t.morningReport = null, t.onMorningReportSnooze?.(),
|
|
1158
|
+
t.morningReport = null, t.onMorningReportSnooze?.(), Tt(), W(b.getState());
|
|
1140
1159
|
},
|
|
1141
|
-
|
|
1142
|
-
|
|
1160
|
+
Nt,
|
|
1161
|
+
ai && !St ? {
|
|
1143
1162
|
dismissedCandidateIds: at,
|
|
1144
1163
|
draftingCandidateId: dt,
|
|
1145
1164
|
error: Ze,
|
|
1146
1165
|
characterIconOptions: st(),
|
|
1147
1166
|
onSeen: (M) => {
|
|
1148
|
-
|
|
1167
|
+
Me.add(M.id), F();
|
|
1149
1168
|
},
|
|
1150
1169
|
onDraft: (M) => {
|
|
1151
|
-
|
|
1170
|
+
li(M);
|
|
1152
1171
|
},
|
|
1153
1172
|
onDismiss: (M) => {
|
|
1154
|
-
|
|
1173
|
+
Me.add(M.id), at.add(M.id), F(), Ze = null, W(b.getState());
|
|
1155
1174
|
},
|
|
1156
1175
|
onDisable: (M) => {
|
|
1157
|
-
St = !0,
|
|
1176
|
+
St = !0, Me.add(M.id), at.add(M.id), F(), zr(t, !0), Ze = null, W(b.getState());
|
|
1158
1177
|
}
|
|
1159
1178
|
} : void 0
|
|
1160
|
-
),
|
|
1179
|
+
), k ? (ke = P.scrollTop, ne()) : _ && Na(a) && Vo();
|
|
1161
1180
|
};
|
|
1162
|
-
return
|
|
1181
|
+
return In = ki(
|
|
1163
1182
|
(a) => {
|
|
1164
|
-
|
|
1183
|
+
We = a, !re && Zt(b.getState(), Ot()) && W(b.getState());
|
|
1165
1184
|
},
|
|
1166
1185
|
{
|
|
1167
1186
|
backendUrl: t.backendUrl,
|
|
1168
|
-
fetcher:
|
|
1187
|
+
fetcher: jo,
|
|
1169
1188
|
loader: t.activeUsersLoader
|
|
1170
1189
|
}
|
|
1171
1190
|
), b.on("state", (a) => {
|
|
1172
|
-
const d =
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
},
|
|
1191
|
+
const d = Ln && !a.isThinking;
|
|
1192
|
+
Ln = a.isThinking, a.isThinking && !a.assistantDraft.trim() && Je && !Fe && Be === null && H?.hidden !== !1 && (Be = window.setTimeout(() => {
|
|
1193
|
+
Be = null, ii();
|
|
1194
|
+
}, zi)), (!a.isThinking || a.assistantDraft.trim()) && (Pn(), ct()), d && !i.classList.contains("pluno-pa-widget--open") && (Ye = !0), At(), a.appearance ? (zt = !0, K(
|
|
1176
1195
|
"web-sdk.widget",
|
|
1177
1196
|
"Agent state supplied appearance",
|
|
1178
1197
|
{
|
|
1179
1198
|
appearance: a.appearance
|
|
1180
1199
|
}
|
|
1181
|
-
),
|
|
1200
|
+
), Ft(a.appearance, "agent.state.appearance")) : zt && (zt = !1, K(
|
|
1182
1201
|
"web-sdk.widget",
|
|
1183
1202
|
"Agent state cleared appearance; reverting to configured widget options",
|
|
1184
1203
|
{
|
|
@@ -1186,34 +1205,34 @@ async function da(e = {}) {
|
|
|
1186
1205
|
fallbackColorScheme: t.colorScheme,
|
|
1187
1206
|
fallbackFontFamily: t.fontFamily
|
|
1188
1207
|
}
|
|
1189
|
-
),
|
|
1190
|
-
}),
|
|
1208
|
+
), Ft({}, "agent.state.appearance-cleared")), W(a), $(), d && Cn();
|
|
1209
|
+
}), W(b.getState()), $(), Nt(), {
|
|
1191
1210
|
agent: b,
|
|
1192
|
-
startNewChat:
|
|
1211
|
+
startNewChat: Ut,
|
|
1193
1212
|
host: n,
|
|
1194
1213
|
updateAppearance: (a) => {
|
|
1195
|
-
a.scribbleStyle !== void 0 && (t.scribbleStyle = a.scribbleStyle),
|
|
1214
|
+
a.scribbleStyle !== void 0 && (t.scribbleStyle = a.scribbleStyle), Ft(a, "widgetHandle.updateAppearance");
|
|
1196
1215
|
},
|
|
1197
1216
|
updateBillingStatus: (a) => {
|
|
1198
1217
|
const d = a ?? null;
|
|
1199
|
-
|
|
1218
|
+
no(
|
|
1200
1219
|
t.billingStatus,
|
|
1201
1220
|
d,
|
|
1202
|
-
|
|
1203
|
-
) && (t.billingStatus = d, t.billingStatus?.creditsUsed !== null && !
|
|
1221
|
+
Ue
|
|
1222
|
+
) && (t.billingStatus = d, t.billingStatus?.creditsUsed !== null && !de(t.billingStatus) && (Ue = null), Xt(
|
|
1204
1223
|
i.querySelector(".pluno-pa-widget__billing-status"),
|
|
1205
1224
|
t.billingStatus,
|
|
1206
|
-
|
|
1207
|
-
),
|
|
1225
|
+
Ue
|
|
1226
|
+
), $());
|
|
1208
1227
|
},
|
|
1209
1228
|
updateAuthGate: (a) => {
|
|
1210
1229
|
const d = Ve();
|
|
1211
|
-
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),
|
|
1230
|
+
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), Ie(), W(b.getState()), $(), d && !Ve() && Nt();
|
|
1212
1231
|
},
|
|
1213
1232
|
openPanel: () => {
|
|
1214
|
-
|
|
1233
|
+
he(f.value, !1);
|
|
1215
1234
|
},
|
|
1216
|
-
closePanel:
|
|
1235
|
+
closePanel: Tt,
|
|
1217
1236
|
updateDisplayState: (a) => {
|
|
1218
1237
|
if (a === "shown") {
|
|
1219
1238
|
qe("shown", !1);
|
|
@@ -1222,63 +1241,63 @@ async function da(e = {}) {
|
|
|
1222
1241
|
qe("minimized", !1);
|
|
1223
1242
|
},
|
|
1224
1243
|
updateMorningReport: (a) => {
|
|
1225
|
-
t.morningReport = a ?? null,
|
|
1244
|
+
t.morningReport = a ?? null, W(b.getState());
|
|
1226
1245
|
},
|
|
1227
1246
|
destroy: () => {
|
|
1228
|
-
|
|
1247
|
+
re || (F(), re = !0, xn.disconnect(), kn?.disconnect(), ti(), window.removeEventListener("resize", yn), vn(), Jo(), ue !== null && window.clearTimeout(ue), Pn(), In(), Oe?.remove(), b.destroy(), vt.release(), n.remove());
|
|
1229
1248
|
}
|
|
1230
1249
|
};
|
|
1231
|
-
async function
|
|
1250
|
+
async function li(a) {
|
|
1232
1251
|
if (!dt) {
|
|
1233
|
-
dt = a.id, Ze = null,
|
|
1252
|
+
dt = a.id, Ze = null, W(b.getState());
|
|
1234
1253
|
try {
|
|
1235
1254
|
if (!t.socialPostDraftHandler)
|
|
1236
1255
|
throw new Error("Social post drafting is not available here.");
|
|
1237
1256
|
const d = await t.socialPostDraftHandler(a);
|
|
1238
1257
|
if (!d.linkedinPost || !d.xPost)
|
|
1239
1258
|
throw new Error("Pluno did not return a complete social post draft.");
|
|
1240
|
-
|
|
1259
|
+
Me.add(a.id), at.add(a.id), F(), Oe?.remove(), Oe = _r(d, {
|
|
1241
1260
|
socialPostRewardsUrl: t.socialPostRewardsUrl,
|
|
1242
1261
|
onClose: () => {
|
|
1243
|
-
|
|
1262
|
+
Oe?.remove(), Oe = null;
|
|
1244
1263
|
}
|
|
1245
|
-
}), i.appendChild(
|
|
1264
|
+
}), i.appendChild(Oe);
|
|
1246
1265
|
} catch (d) {
|
|
1247
1266
|
Ze = d instanceof Error ? d.message : "Could not draft social post.";
|
|
1248
1267
|
} finally {
|
|
1249
|
-
dt = null,
|
|
1268
|
+
dt = null, W(b.getState());
|
|
1250
1269
|
}
|
|
1251
1270
|
}
|
|
1252
1271
|
}
|
|
1253
|
-
function
|
|
1254
|
-
const _ = a.accentColor ?? t.accentColor,
|
|
1255
|
-
r =
|
|
1272
|
+
function Ft(a, d) {
|
|
1273
|
+
const _ = a.accentColor ?? t.accentColor, k = a.colorScheme ?? t.colorScheme, M = a.fontFamily ?? t.fontFamily, Qe = a.scribbleStyle ?? t.scribbleStyle;
|
|
1274
|
+
r = jn(
|
|
1256
1275
|
_,
|
|
1257
1276
|
Qe
|
|
1258
|
-
),
|
|
1277
|
+
), Vn(i, r, {
|
|
1259
1278
|
accentColor: _,
|
|
1260
|
-
colorScheme:
|
|
1279
|
+
colorScheme: k,
|
|
1261
1280
|
fontFamily: M,
|
|
1262
1281
|
scribbleStyle: Qe
|
|
1263
|
-
}),
|
|
1282
|
+
}), K("web-sdk.widget", "Updated widget appearance", {
|
|
1264
1283
|
source: d,
|
|
1265
1284
|
inputAppearance: a,
|
|
1266
1285
|
appliedAccentColor: _,
|
|
1267
|
-
appliedColorScheme:
|
|
1286
|
+
appliedColorScheme: k,
|
|
1268
1287
|
appliedFontFamily: M,
|
|
1269
1288
|
appliedScribbleStyle: Qe,
|
|
1270
1289
|
cssAccent: i.style.getPropertyValue("--pluno-pa-accent")
|
|
1271
1290
|
});
|
|
1272
1291
|
}
|
|
1273
1292
|
}
|
|
1274
|
-
function
|
|
1293
|
+
function jn(e, t) {
|
|
1275
1294
|
return { accentColor: e, scribbleStyle: t };
|
|
1276
1295
|
}
|
|
1277
|
-
function
|
|
1278
|
-
const t =
|
|
1279
|
-
return t === null ? "#fafafa" :
|
|
1296
|
+
function ha(e) {
|
|
1297
|
+
const t = ma(e);
|
|
1298
|
+
return t === null ? "#fafafa" : fa(t) > 0.5 ? "#18181b" : "#fafaf9";
|
|
1280
1299
|
}
|
|
1281
|
-
function
|
|
1300
|
+
function ma(e) {
|
|
1282
1301
|
const t = e.trim();
|
|
1283
1302
|
return /^#[0-9a-f]{6}$/i.test(t) ? [
|
|
1284
1303
|
Number.parseInt(t.slice(1, 3), 16),
|
|
@@ -1290,14 +1309,14 @@ function ua(e) {
|
|
|
1290
1309
|
Number.parseInt(t[3] + t[3], 16)
|
|
1291
1310
|
] : null;
|
|
1292
1311
|
}
|
|
1293
|
-
function
|
|
1312
|
+
function fa([e, t, n]) {
|
|
1294
1313
|
const o = (i) => {
|
|
1295
1314
|
const r = i / 255;
|
|
1296
1315
|
return r <= 0.03928 ? r / 12.92 : ((r + 0.055) / 1.055) ** 2.4;
|
|
1297
1316
|
};
|
|
1298
1317
|
return 0.2126 * o(e) + 0.7152 * o(t) + 0.0722 * o(n);
|
|
1299
1318
|
}
|
|
1300
|
-
function
|
|
1319
|
+
function Vn(e, t, n) {
|
|
1301
1320
|
e.classList.toggle(
|
|
1302
1321
|
"pluno-pa-widget--dark",
|
|
1303
1322
|
n.colorScheme === "dark"
|
|
@@ -1305,27 +1324,27 @@ function qn(e, t, n) {
|
|
|
1305
1324
|
"pluno-pa-widget--light",
|
|
1306
1325
|
n.colorScheme !== "dark"
|
|
1307
1326
|
), e.classList.toggle("pluno-pa-widget--scribble", n.scribbleStyle);
|
|
1308
|
-
const o = n.scribbleStyle ?
|
|
1327
|
+
const o = n.scribbleStyle ? mo(n.accentColor) : n.accentColor;
|
|
1309
1328
|
e.style.setProperty("--pluno-pa-accent", o), n.scribbleStyle ? e.style.setProperty(
|
|
1310
1329
|
"--pluno-pa-accent-contrast",
|
|
1311
|
-
|
|
1312
|
-
) : e.style.removeProperty("--pluno-pa-accent-contrast"), e.style.fontFamily = n.scribbleStyle ?
|
|
1330
|
+
ha(o)
|
|
1331
|
+
) : e.style.removeProperty("--pluno-pa-accent-contrast"), e.style.fontFamily = n.scribbleStyle ? ea : n.fontFamily, n.scribbleStyle && wa(e.ownerDocument);
|
|
1313
1332
|
const i = Array.from(
|
|
1314
1333
|
e.querySelectorAll(".pluno-pa-widget__character")
|
|
1315
1334
|
);
|
|
1316
1335
|
for (const r of i)
|
|
1317
1336
|
r.replaceWith(
|
|
1318
|
-
|
|
1337
|
+
ve(
|
|
1319
1338
|
Array.from(r.classList).join(" "),
|
|
1320
1339
|
t
|
|
1321
1340
|
)
|
|
1322
1341
|
);
|
|
1323
1342
|
}
|
|
1324
|
-
function
|
|
1325
|
-
if (e.getElementById(
|
|
1343
|
+
function wa(e) {
|
|
1344
|
+
if (e.getElementById(Hn))
|
|
1326
1345
|
return;
|
|
1327
1346
|
const t = e.createElement("style");
|
|
1328
|
-
t.id =
|
|
1347
|
+
t.id = Hn, t.textContent = `@font-face {
|
|
1329
1348
|
font-family: "Architects Daughter";
|
|
1330
1349
|
font-style: normal;
|
|
1331
1350
|
font-weight: 400;
|
|
@@ -1333,7 +1352,7 @@ function ha(e) {
|
|
|
1333
1352
|
src: url("https://fonts.gstatic.com/s/architectsdaughter/v20/KtkxAKiDZI_td1Lkx62xHZHDtgO_Y-bvTYlg4-7jA-U.woff2") format("woff2");
|
|
1334
1353
|
}`, e.head.appendChild(t), e.fonts?.load('16px "Architects Daughter"');
|
|
1335
1354
|
}
|
|
1336
|
-
function
|
|
1355
|
+
function ba({
|
|
1337
1356
|
root: e,
|
|
1338
1357
|
launcher: t,
|
|
1339
1358
|
launcherDragHandle: n,
|
|
@@ -1341,82 +1360,82 @@ function ma({
|
|
|
1341
1360
|
setPosition: i,
|
|
1342
1361
|
persist: r
|
|
1343
1362
|
}) {
|
|
1344
|
-
let l = null, p = null, s = null,
|
|
1363
|
+
let l = null, p = null, s = null, g = !1, c = null;
|
|
1345
1364
|
const h = () => {
|
|
1346
|
-
l = null, p = null, s = null,
|
|
1347
|
-
},
|
|
1348
|
-
e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing") || (m.preventDefault(), m.stopPropagation(), l = m.pointerId, p = { x: m.clientX, y: m.clientY }, s = o(),
|
|
1349
|
-
},
|
|
1365
|
+
l = null, p = null, s = null, g = !1, e.classList.remove("pluno-pa-widget--dragging");
|
|
1366
|
+
}, C = (m) => {
|
|
1367
|
+
e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing") || (m.preventDefault(), m.stopPropagation(), l = m.pointerId, p = { x: m.clientX, y: m.clientY }, s = o(), g = !1, t.setPointerCapture?.(m.pointerId));
|
|
1368
|
+
}, T = (m) => {
|
|
1350
1369
|
if (l !== m.pointerId || !p || !s)
|
|
1351
1370
|
return;
|
|
1352
1371
|
m.preventDefault();
|
|
1353
|
-
const
|
|
1354
|
-
!
|
|
1372
|
+
const S = m.clientX - p.x, z = m.clientY - p.y;
|
|
1373
|
+
!g && Math.hypot(S, z) < an || (g = !0, e.classList.add("pluno-pa-widget--dragging"), i({ x: s.x + S, y: s.y + z }));
|
|
1374
|
+
}, I = (m) => {
|
|
1375
|
+
l === m.pointerId && (m.preventDefault(), m.stopPropagation(), g && (c = { x: m.clientX, y: m.clientY }, r()), h());
|
|
1355
1376
|
}, D = (m) => {
|
|
1356
|
-
l === m.pointerId && (m.preventDefault(), m.stopPropagation(), u && (c = { x: m.clientX, y: m.clientY }, r()), h());
|
|
1357
|
-
}, C = (m) => {
|
|
1358
1377
|
l === m.pointerId && (m.preventDefault(), h());
|
|
1359
|
-
},
|
|
1378
|
+
}, u = (m) => {
|
|
1360
1379
|
if (!c)
|
|
1361
1380
|
return;
|
|
1362
|
-
const
|
|
1381
|
+
const S = Math.hypot(
|
|
1363
1382
|
m.clientX - c.x,
|
|
1364
1383
|
m.clientY - c.y
|
|
1365
|
-
) <=
|
|
1366
|
-
c = null,
|
|
1384
|
+
) <= an;
|
|
1385
|
+
c = null, S && (m.preventDefault(), m.stopPropagation());
|
|
1367
1386
|
}, y = (m) => {
|
|
1368
1387
|
if (e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing"))
|
|
1369
1388
|
return;
|
|
1370
|
-
const
|
|
1371
|
-
let
|
|
1372
|
-
m.key === "ArrowUp" ?
|
|
1389
|
+
const S = m.shiftKey ? Eo : So, z = o();
|
|
1390
|
+
let L = null;
|
|
1391
|
+
m.key === "ArrowUp" ? L = { x: z.x, y: z.y - S } : m.key === "ArrowDown" ? L = { x: z.x, y: z.y + S } : m.key === "ArrowLeft" ? L = { x: z.x - S, y: z.y } : m.key === "ArrowRight" && (L = { x: z.x + S, y: z.y }), L && (m.preventDefault(), m.stopPropagation(), i(L), r());
|
|
1373
1392
|
};
|
|
1374
|
-
return t.addEventListener("pointerdown",
|
|
1375
|
-
t.removeEventListener("pointerdown",
|
|
1393
|
+
return t.addEventListener("pointerdown", C), t.addEventListener("pointermove", T), t.addEventListener("pointerup", I), t.addEventListener("pointercancel", D), t.addEventListener("click", u, !0), n.addEventListener("keydown", y), () => {
|
|
1394
|
+
t.removeEventListener("pointerdown", C), t.removeEventListener("pointermove", T), t.removeEventListener("pointerup", I), t.removeEventListener("pointercancel", D), t.removeEventListener("click", u, !0), n.removeEventListener("keydown", y);
|
|
1376
1395
|
};
|
|
1377
1396
|
}
|
|
1378
|
-
function
|
|
1397
|
+
function _a({
|
|
1379
1398
|
root: e,
|
|
1380
1399
|
handles: t,
|
|
1381
1400
|
getBounds: n,
|
|
1382
1401
|
setBounds: o,
|
|
1383
1402
|
persist: i
|
|
1384
1403
|
}) {
|
|
1385
|
-
let r = null, l = null, p = null, s = null,
|
|
1404
|
+
let r = null, l = null, p = null, s = null, g = !1;
|
|
1386
1405
|
const c = () => {
|
|
1387
|
-
r = null, l = null, p = null, s = null,
|
|
1388
|
-
}, h = (
|
|
1389
|
-
const y =
|
|
1390
|
-
!e.classList.contains("pluno-pa-widget--open") || !
|
|
1391
|
-
},
|
|
1392
|
-
if (r !==
|
|
1406
|
+
r = null, l = null, p = null, s = null, g = !1, e.classList.remove("pluno-pa-widget--resizing");
|
|
1407
|
+
}, h = (u) => {
|
|
1408
|
+
const y = u.currentTarget, m = y.dataset.resizeDirection;
|
|
1409
|
+
!e.classList.contains("pluno-pa-widget--open") || !Kn(m) || (u.preventDefault(), u.stopPropagation(), r = u.pointerId, l = m, p = { x: u.clientX, y: u.clientY }, s = n(), g = !1, y.setPointerCapture?.(u.pointerId));
|
|
1410
|
+
}, C = (u) => {
|
|
1411
|
+
if (r !== u.pointerId || !l || !p || !s)
|
|
1393
1412
|
return;
|
|
1394
|
-
|
|
1395
|
-
const y =
|
|
1396
|
-
!
|
|
1397
|
-
|
|
1413
|
+
u.preventDefault(), u.stopPropagation();
|
|
1414
|
+
const y = u.clientX - p.x, m = u.clientY - p.y;
|
|
1415
|
+
!g && Math.hypot(y, m) < an || (g = !0, e.classList.add("pluno-pa-widget--resizing"), o(
|
|
1416
|
+
Yn(s, l, y, m)
|
|
1398
1417
|
));
|
|
1399
|
-
},
|
|
1400
|
-
r ===
|
|
1401
|
-
},
|
|
1402
|
-
r ===
|
|
1403
|
-
},
|
|
1404
|
-
const m =
|
|
1405
|
-
let
|
|
1406
|
-
|
|
1418
|
+
}, T = (u) => {
|
|
1419
|
+
r === u.pointerId && (u.preventDefault(), u.stopPropagation(), g && i(), c());
|
|
1420
|
+
}, I = (u) => {
|
|
1421
|
+
r === u.pointerId && (u.preventDefault(), c());
|
|
1422
|
+
}, D = (u) => {
|
|
1423
|
+
const m = u.currentTarget.dataset.resizeDirection, S = u.shiftKey ? Eo : So, z = n();
|
|
1424
|
+
let L = 0, oe = 0;
|
|
1425
|
+
Kn(m) && (u.key === "ArrowLeft" ? L = -S : u.key === "ArrowRight" ? L = S : u.key === "ArrowUp" ? oe = -S : u.key === "ArrowDown" && (oe = S), !(L === 0 && oe === 0) && (u.preventDefault(), u.stopPropagation(), o(Yn(z, m, L, oe)), i()));
|
|
1407
1426
|
};
|
|
1408
|
-
for (const
|
|
1409
|
-
|
|
1427
|
+
for (const u of t)
|
|
1428
|
+
u.addEventListener("pointerdown", h), u.addEventListener("pointermove", C), u.addEventListener("pointerup", T), u.addEventListener("pointercancel", I), u.addEventListener("keydown", D);
|
|
1410
1429
|
return () => {
|
|
1411
|
-
for (const
|
|
1412
|
-
|
|
1430
|
+
for (const u of t)
|
|
1431
|
+
u.removeEventListener("pointerdown", h), u.removeEventListener("pointermove", C), u.removeEventListener("pointerup", T), u.removeEventListener("pointercancel", I), u.removeEventListener("keydown", D);
|
|
1413
1432
|
};
|
|
1414
1433
|
}
|
|
1415
|
-
function
|
|
1434
|
+
function Kn(e) {
|
|
1416
1435
|
return e === "left" || e === "right" || e === "top" || e === "bottom" || e === "top-left" || e === "top-right" || e === "bottom-left" || e === "bottom-right";
|
|
1417
1436
|
}
|
|
1418
|
-
function
|
|
1419
|
-
const i = Z(), r =
|
|
1437
|
+
function Yn(e, t, n, o) {
|
|
1438
|
+
const i = Z(), r = Xn({
|
|
1420
1439
|
leading: e.position.x,
|
|
1421
1440
|
length: e.size.width,
|
|
1422
1441
|
delta: n,
|
|
@@ -1425,20 +1444,20 @@ function Vn(e, t, n, o) {
|
|
|
1425
1444
|
minLeading: A,
|
|
1426
1445
|
maxTrailing: i.width - A,
|
|
1427
1446
|
minLength: Math.min(
|
|
1428
|
-
|
|
1447
|
+
cn,
|
|
1429
1448
|
i.width - A * 2
|
|
1430
1449
|
)
|
|
1431
|
-
}), l =
|
|
1450
|
+
}), l = Xn({
|
|
1432
1451
|
leading: e.position.y,
|
|
1433
1452
|
length: e.size.height,
|
|
1434
1453
|
delta: o,
|
|
1435
1454
|
resizeLeading: t.startsWith("top") || t === "top",
|
|
1436
1455
|
resizeTrailing: t.startsWith("bottom") || t === "bottom",
|
|
1437
|
-
minLeading:
|
|
1456
|
+
minLeading: Ne,
|
|
1438
1457
|
maxTrailing: i.height - A,
|
|
1439
1458
|
minLength: Math.min(
|
|
1440
|
-
|
|
1441
|
-
i.height -
|
|
1459
|
+
un,
|
|
1460
|
+
i.height - Ne - A
|
|
1442
1461
|
)
|
|
1443
1462
|
});
|
|
1444
1463
|
return {
|
|
@@ -1446,7 +1465,7 @@ function Vn(e, t, n, o) {
|
|
|
1446
1465
|
size: { width: r.length, height: l.length }
|
|
1447
1466
|
};
|
|
1448
1467
|
}
|
|
1449
|
-
function
|
|
1468
|
+
function Xn({
|
|
1450
1469
|
leading: e,
|
|
1451
1470
|
length: t,
|
|
1452
1471
|
delta: n,
|
|
@@ -1458,30 +1477,30 @@ function Kn({
|
|
|
1458
1477
|
}) {
|
|
1459
1478
|
const s = e + t;
|
|
1460
1479
|
if (o) {
|
|
1461
|
-
const
|
|
1462
|
-
if (
|
|
1463
|
-
const h = X(
|
|
1480
|
+
const g = e + n;
|
|
1481
|
+
if (g >= r) {
|
|
1482
|
+
const h = X(g, r, s - p);
|
|
1464
1483
|
return { leading: h, length: s - h };
|
|
1465
1484
|
}
|
|
1466
1485
|
const c = X(
|
|
1467
|
-
s + r -
|
|
1486
|
+
s + r - g,
|
|
1468
1487
|
s,
|
|
1469
1488
|
l
|
|
1470
1489
|
);
|
|
1471
1490
|
return { leading: r, length: c - r };
|
|
1472
1491
|
}
|
|
1473
1492
|
if (i) {
|
|
1474
|
-
const
|
|
1475
|
-
if (
|
|
1493
|
+
const g = s + n;
|
|
1494
|
+
if (g <= l) {
|
|
1476
1495
|
const h = X(
|
|
1477
|
-
|
|
1496
|
+
g,
|
|
1478
1497
|
e + p,
|
|
1479
1498
|
l
|
|
1480
1499
|
);
|
|
1481
1500
|
return { leading: e, length: h - e };
|
|
1482
1501
|
}
|
|
1483
1502
|
const c = X(
|
|
1484
|
-
e - (
|
|
1503
|
+
e - (g - l),
|
|
1485
1504
|
r,
|
|
1486
1505
|
e
|
|
1487
1506
|
);
|
|
@@ -1492,39 +1511,36 @@ function Kn({
|
|
|
1492
1511
|
function bt(e, t = !0) {
|
|
1493
1512
|
const n = Z();
|
|
1494
1513
|
if (e.classList.contains("pluno-pa-widget--minimized"))
|
|
1495
|
-
return
|
|
1496
|
-
width: Xi,
|
|
1497
|
-
height: Zi
|
|
1498
|
-
} : { width: Hn, height: Hn };
|
|
1514
|
+
return { width: $n, height: $n };
|
|
1499
1515
|
const o = e.getBoundingClientRect(), i = !e.classList.contains("pluno-pa-widget--open") && !e.classList.contains("pluno-pa-widget--closing");
|
|
1500
1516
|
return {
|
|
1501
|
-
width: t && i && o.width > 0 ? o.width : Math.min(
|
|
1502
|
-
height: t && i && o.height > 0 ? o.height : e.classList.contains("pluno-pa-widget--scribble") ?
|
|
1517
|
+
width: t && i && o.width > 0 ? o.width : Math.min(yo, n.width - 36),
|
|
1518
|
+
height: t && i && o.height > 0 ? o.height : e.classList.contains("pluno-pa-widget--scribble") ? na : vo
|
|
1503
1519
|
};
|
|
1504
1520
|
}
|
|
1505
|
-
function
|
|
1521
|
+
function xa() {
|
|
1506
1522
|
const e = Z();
|
|
1507
1523
|
return {
|
|
1508
1524
|
width: Math.min(
|
|
1509
1525
|
X(
|
|
1510
|
-
e.width *
|
|
1511
|
-
|
|
1512
|
-
|
|
1526
|
+
e.width * ia,
|
|
1527
|
+
cn,
|
|
1528
|
+
oa
|
|
1513
1529
|
),
|
|
1514
1530
|
e.width - A * 2
|
|
1515
1531
|
),
|
|
1516
1532
|
height: Math.min(
|
|
1517
1533
|
X(
|
|
1518
|
-
e.height *
|
|
1519
|
-
|
|
1520
|
-
|
|
1534
|
+
e.height * ra,
|
|
1535
|
+
un,
|
|
1536
|
+
aa
|
|
1521
1537
|
),
|
|
1522
|
-
e.height -
|
|
1538
|
+
e.height - Ne - A
|
|
1523
1539
|
)
|
|
1524
1540
|
};
|
|
1525
1541
|
}
|
|
1526
|
-
function
|
|
1527
|
-
return e ? xt(e) :
|
|
1542
|
+
function tt(e = null) {
|
|
1543
|
+
return e ? xt(e) : xa();
|
|
1528
1544
|
}
|
|
1529
1545
|
function xt(e) {
|
|
1530
1546
|
const t = Z();
|
|
@@ -1532,7 +1548,7 @@ function xt(e) {
|
|
|
1532
1548
|
width: X(
|
|
1533
1549
|
e.width,
|
|
1534
1550
|
Math.min(
|
|
1535
|
-
|
|
1551
|
+
cn,
|
|
1536
1552
|
t.width - A * 2
|
|
1537
1553
|
),
|
|
1538
1554
|
Math.max(
|
|
@@ -1543,17 +1559,17 @@ function xt(e) {
|
|
|
1543
1559
|
height: X(
|
|
1544
1560
|
e.height,
|
|
1545
1561
|
Math.min(
|
|
1546
|
-
|
|
1547
|
-
t.height -
|
|
1562
|
+
un,
|
|
1563
|
+
t.height - Ne - A
|
|
1548
1564
|
),
|
|
1549
1565
|
Math.max(
|
|
1550
1566
|
A,
|
|
1551
|
-
t.height -
|
|
1567
|
+
t.height - Ne - A
|
|
1552
1568
|
)
|
|
1553
1569
|
)
|
|
1554
1570
|
};
|
|
1555
1571
|
}
|
|
1556
|
-
function
|
|
1572
|
+
function $t(e, t) {
|
|
1557
1573
|
if (!t) {
|
|
1558
1574
|
e.style.removeProperty("--pluno-pa-panel-width"), e.style.removeProperty("--pluno-pa-panel-height");
|
|
1559
1575
|
return;
|
|
@@ -1561,7 +1577,7 @@ function Wt(e, t) {
|
|
|
1561
1577
|
const n = xt(t);
|
|
1562
1578
|
e.style.setProperty("--pluno-pa-panel-width", `${n.width}px`), e.style.setProperty("--pluno-pa-panel-height", `${n.height}px`);
|
|
1563
1579
|
}
|
|
1564
|
-
function
|
|
1580
|
+
function ya(e, t, n) {
|
|
1565
1581
|
const o = Number.parseFloat(e.style.left), i = Number.parseFloat(e.style.top);
|
|
1566
1582
|
if (Number.isFinite(o) && Number.isFinite(i))
|
|
1567
1583
|
return { x: o, y: i };
|
|
@@ -1576,21 +1592,21 @@ function ba(e, t, n) {
|
|
|
1576
1592
|
}
|
|
1577
1593
|
function Gt(e, t, n) {
|
|
1578
1594
|
const o = bt(e, !1);
|
|
1579
|
-
return t ?
|
|
1595
|
+
return t ? rn(
|
|
1580
1596
|
e,
|
|
1581
|
-
|
|
1597
|
+
Po(t, o),
|
|
1582
1598
|
o
|
|
1583
|
-
) :
|
|
1599
|
+
) : va(n === "bottom-left" ? "bottom-left" : "bottom-right", o, ta);
|
|
1584
1600
|
}
|
|
1585
|
-
function
|
|
1601
|
+
function va(e, t, n) {
|
|
1586
1602
|
const o = Z();
|
|
1587
1603
|
return {
|
|
1588
1604
|
x: e.endsWith("right") ? Math.max(0, o.width - t.width - n) : n,
|
|
1589
1605
|
y: e.startsWith("bottom") ? Math.max(0, o.height - t.height - n) : n
|
|
1590
1606
|
};
|
|
1591
1607
|
}
|
|
1592
|
-
function
|
|
1593
|
-
const o = Z(), i = A +
|
|
1608
|
+
function rn(e, t, n) {
|
|
1609
|
+
const o = Z(), i = A + Ea(e);
|
|
1594
1610
|
return {
|
|
1595
1611
|
x: X(
|
|
1596
1612
|
t.x,
|
|
@@ -1610,30 +1626,30 @@ function an(e, t, n) {
|
|
|
1610
1626
|
)
|
|
1611
1627
|
};
|
|
1612
1628
|
}
|
|
1613
|
-
function
|
|
1629
|
+
function Po(e, t) {
|
|
1614
1630
|
const n = Z();
|
|
1615
1631
|
return {
|
|
1616
1632
|
x: e.anchor.endsWith("right") ? n.width - t.width - e.x : e.x,
|
|
1617
1633
|
y: e.anchor.startsWith("bottom") ? n.height - t.height - e.y : e.y
|
|
1618
1634
|
};
|
|
1619
1635
|
}
|
|
1620
|
-
function
|
|
1621
|
-
const n =
|
|
1636
|
+
function Ca(e, t) {
|
|
1637
|
+
const n = Sa(e, t), o = Z();
|
|
1622
1638
|
return {
|
|
1623
1639
|
anchor: n,
|
|
1624
1640
|
x: n.endsWith("right") ? o.width - e.x - t.width : e.x,
|
|
1625
1641
|
y: n.startsWith("bottom") ? o.height - e.y - t.height : e.y
|
|
1626
1642
|
};
|
|
1627
1643
|
}
|
|
1628
|
-
function
|
|
1644
|
+
function Sa(e, t) {
|
|
1629
1645
|
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";
|
|
1630
1646
|
return `${r}-${l}`;
|
|
1631
1647
|
}
|
|
1632
|
-
function
|
|
1633
|
-
return e.classList.contains("pluno-pa-widget--scribble") ?
|
|
1648
|
+
function Ea(e) {
|
|
1649
|
+
return e.classList.contains("pluno-pa-widget--scribble") ? da : sa;
|
|
1634
1650
|
}
|
|
1635
|
-
function
|
|
1636
|
-
const i = bt(e), r =
|
|
1651
|
+
function qt(e, t, n, o = null) {
|
|
1652
|
+
const i = bt(e), r = tt(o), l = {
|
|
1637
1653
|
x: n === "bottom-left" ? t.x : t.x + i.width - r.width,
|
|
1638
1654
|
y: t.y + i.height - r.height
|
|
1639
1655
|
};
|
|
@@ -1652,34 +1668,34 @@ function mt(e, t) {
|
|
|
1652
1668
|
),
|
|
1653
1669
|
y: X(
|
|
1654
1670
|
e.y,
|
|
1655
|
-
|
|
1671
|
+
Ne,
|
|
1656
1672
|
Math.max(
|
|
1657
|
-
|
|
1673
|
+
Ne,
|
|
1658
1674
|
n.height - t.height - A
|
|
1659
1675
|
)
|
|
1660
1676
|
)
|
|
1661
1677
|
};
|
|
1662
1678
|
}
|
|
1663
|
-
function
|
|
1679
|
+
function Ae(e, t) {
|
|
1664
1680
|
if (e.classList.toggle("pluno-pa-widget--custom-position", t !== null), !t) {
|
|
1665
1681
|
e.style.removeProperty("left"), e.style.removeProperty("top"), e.style.removeProperty("right"), e.style.removeProperty("bottom");
|
|
1666
1682
|
return;
|
|
1667
1683
|
}
|
|
1668
1684
|
e.style.left = `${t.x}px`, e.style.top = `${t.y}px`, e.style.right = "auto", e.style.bottom = "auto";
|
|
1669
1685
|
}
|
|
1670
|
-
function
|
|
1686
|
+
function ka(e, t) {
|
|
1671
1687
|
e.style.setProperty("--pluno-pa-panel-offset-x", `${t.x}px`), e.style.setProperty("--pluno-pa-panel-offset-y", `${t.y}px`);
|
|
1672
1688
|
}
|
|
1673
|
-
function
|
|
1689
|
+
function Zn(e) {
|
|
1674
1690
|
e.style.removeProperty("--pluno-pa-panel-offset-x"), e.style.removeProperty("--pluno-pa-panel-offset-y");
|
|
1675
1691
|
}
|
|
1676
1692
|
function Z() {
|
|
1677
1693
|
return {
|
|
1678
|
-
width: window.innerWidth || document.documentElement.clientWidth ||
|
|
1679
|
-
height: window.innerHeight || document.documentElement.clientHeight ||
|
|
1694
|
+
width: window.innerWidth || document.documentElement.clientWidth || yo + A * 2,
|
|
1695
|
+
height: window.innerHeight || document.documentElement.clientHeight || vo + A * 2
|
|
1680
1696
|
};
|
|
1681
1697
|
}
|
|
1682
|
-
function
|
|
1698
|
+
function jt(e) {
|
|
1683
1699
|
const t = e.getBoundingClientRect();
|
|
1684
1700
|
return {
|
|
1685
1701
|
x: Math.round(t.x),
|
|
@@ -1691,7 +1707,7 @@ function qt(e) {
|
|
|
1691
1707
|
function X(e, t, n) {
|
|
1692
1708
|
return Math.min(Math.max(e, t), n);
|
|
1693
1709
|
}
|
|
1694
|
-
function
|
|
1710
|
+
function K(e, t, n) {
|
|
1695
1711
|
if (typeof window > "u")
|
|
1696
1712
|
return;
|
|
1697
1713
|
const o = window, i = {
|
|
@@ -1701,31 +1717,31 @@ function ne(e, t, n) {
|
|
|
1701
1717
|
details: n
|
|
1702
1718
|
}, r = o.__plunoProductAgentDiagnostics__ ?? [];
|
|
1703
1719
|
r.push(i), r.length > 120 && r.splice(0, r.length - 120), o.__plunoProductAgentDiagnostics__ = r, o.__PLUNO_PRODUCT_AGENT_DIAGNOSTICS__ = () => [...r], window.dispatchEvent(
|
|
1704
|
-
new CustomEvent(
|
|
1720
|
+
new CustomEvent(Ki, { detail: i })
|
|
1705
1721
|
);
|
|
1706
1722
|
}
|
|
1707
|
-
function
|
|
1708
|
-
|
|
1723
|
+
function La(e, t) {
|
|
1724
|
+
K("web-sdk.widget.position", e, t);
|
|
1709
1725
|
}
|
|
1710
|
-
function
|
|
1726
|
+
function Vt(e, t, n) {
|
|
1711
1727
|
const o = t.value.trim();
|
|
1712
1728
|
return !o && n.length === 0 ? n : (t.value = "", t.style.height = "22px", t.style.overflowY = "hidden", e.sendMessage(o, {
|
|
1713
|
-
attachments: n.length > 0 ? n.map(
|
|
1729
|
+
attachments: n.length > 0 ? n.map(Ia) : void 0
|
|
1714
1730
|
}), t.dispatchEvent(new Event("input", { bubbles: !0 })), []);
|
|
1715
1731
|
}
|
|
1716
|
-
function
|
|
1732
|
+
function Pa(e, t, n) {
|
|
1717
1733
|
const o = e.activeElement;
|
|
1718
1734
|
return o === n ? "composer" : o === t ? "launcher" : null;
|
|
1719
1735
|
}
|
|
1720
|
-
function
|
|
1721
|
-
if (!e.focusedInput || !e.focusedInputAt || Date.now() - e.focusedInputAt >
|
|
1736
|
+
function Ta(e, t, n, o) {
|
|
1737
|
+
if (!e.focusedInput || !e.focusedInputAt || Date.now() - e.focusedInputAt > Mi)
|
|
1722
1738
|
return;
|
|
1723
1739
|
const i = e.focusedInput === "composer" ? o : n;
|
|
1724
1740
|
i === o && !t.classList.contains("pluno-pa-widget--open") || i === n && t.classList.contains("pluno-pa-widget--open") || window.requestAnimationFrame(() => {
|
|
1725
1741
|
!i.isConnected || i.readOnly || (i.focus(), i.setSelectionRange(i.value.length, i.value.length));
|
|
1726
1742
|
});
|
|
1727
1743
|
}
|
|
1728
|
-
function
|
|
1744
|
+
function Ia(e) {
|
|
1729
1745
|
return e;
|
|
1730
1746
|
}
|
|
1731
1747
|
function et(e) {
|
|
@@ -1733,12 +1749,12 @@ function et(e) {
|
|
|
1733
1749
|
const t = Math.max(22, Math.min(e.scrollHeight, 140));
|
|
1734
1750
|
e.style.height = `${t}px`, e.style.overflowY = e.scrollHeight > 140 ? "auto" : "hidden";
|
|
1735
1751
|
}
|
|
1736
|
-
function
|
|
1752
|
+
function nt(e, t = () => !0) {
|
|
1737
1753
|
e.scrollTop = e.scrollHeight, window.requestAnimationFrame(() => {
|
|
1738
1754
|
t() && (e.scrollTop = e.scrollHeight);
|
|
1739
1755
|
});
|
|
1740
1756
|
}
|
|
1741
|
-
function
|
|
1757
|
+
function Aa(e) {
|
|
1742
1758
|
const t = e.messages[e.messages.length - 1];
|
|
1743
1759
|
return [
|
|
1744
1760
|
e.messages.length,
|
|
@@ -1749,13 +1765,13 @@ function Pa(e) {
|
|
|
1749
1765
|
e.lastError ?? ""
|
|
1750
1766
|
].join(":");
|
|
1751
1767
|
}
|
|
1752
|
-
function
|
|
1768
|
+
function Na(e) {
|
|
1753
1769
|
return e.messages.length > 0 || e.assistantDraft.length > 0 || e.isThinking || !!e.lastError;
|
|
1754
1770
|
}
|
|
1755
|
-
function
|
|
1771
|
+
function Ra(e) {
|
|
1756
1772
|
return e.firstUserMessage?.trim() ? e.firstUserMessage : e.title?.trim() ? e.title : "Untitled chat";
|
|
1757
1773
|
}
|
|
1758
|
-
function
|
|
1774
|
+
function Da(e) {
|
|
1759
1775
|
const t = e.currentPage;
|
|
1760
1776
|
if (typeof t?.url == "string" && t.url.trim())
|
|
1761
1777
|
try {
|
|
@@ -1766,7 +1782,7 @@ function Aa(e) {
|
|
|
1766
1782
|
}
|
|
1767
1783
|
return typeof t?.origin == "string" && t.origin.trim() ? t.origin : "Current origin";
|
|
1768
1784
|
}
|
|
1769
|
-
function
|
|
1785
|
+
function za(e, t) {
|
|
1770
1786
|
const n = new Date(e).getTime();
|
|
1771
1787
|
if (!Number.isFinite(n))
|
|
1772
1788
|
return "now";
|
|
@@ -1782,9 +1798,9 @@ function Na(e, t) {
|
|
|
1782
1798
|
}
|
|
1783
1799
|
return "now";
|
|
1784
1800
|
}
|
|
1785
|
-
function
|
|
1786
|
-
e.appendChild(
|
|
1787
|
-
|
|
1801
|
+
function Ma(e, t, n, o, i) {
|
|
1802
|
+
e.appendChild(qa()), e.appendChild(
|
|
1803
|
+
Oa(
|
|
1788
1804
|
t,
|
|
1789
1805
|
n,
|
|
1790
1806
|
o,
|
|
@@ -1794,24 +1810,24 @@ function Ra(e, t, n, o, i) {
|
|
|
1794
1810
|
yt(
|
|
1795
1811
|
"pluno-pa-widget__close",
|
|
1796
1812
|
"Close",
|
|
1797
|
-
|
|
1813
|
+
ja(16),
|
|
1798
1814
|
!0
|
|
1799
1815
|
)
|
|
1800
|
-
), e.appendChild(
|
|
1816
|
+
), e.appendChild(Ua(n));
|
|
1801
1817
|
}
|
|
1802
|
-
function
|
|
1818
|
+
function Oa(e, t, n, o) {
|
|
1803
1819
|
const i = document.createElement("form");
|
|
1804
1820
|
if (i.className = "pluno-pa-widget__launcher", o && i.classList.add("pluno-pa-widget__launcher--minimizable"), n) {
|
|
1805
1821
|
const s = document.createElement("button");
|
|
1806
1822
|
s.type = "button", s.className = "pluno-pa-widget__launcher-drag-handle", s.setAttribute("aria-label", "Move Pluno launcher"), s.title = "Move Pluno launcher", i.appendChild(s);
|
|
1807
1823
|
}
|
|
1808
1824
|
i.appendChild(
|
|
1809
|
-
|
|
1825
|
+
No(
|
|
1810
1826
|
"pluno-pa-widget__scribble-spirals--launcher",
|
|
1811
1827
|
10
|
|
1812
1828
|
)
|
|
1813
1829
|
), i.appendChild(
|
|
1814
|
-
|
|
1830
|
+
ve(
|
|
1815
1831
|
"pluno-pa-widget__character--launcher",
|
|
1816
1832
|
t
|
|
1817
1833
|
)
|
|
@@ -1827,15 +1843,15 @@ function Da(e, t, n, o) {
|
|
|
1827
1843
|
}
|
|
1828
1844
|
return i;
|
|
1829
1845
|
}
|
|
1830
|
-
function
|
|
1846
|
+
function Ua(e) {
|
|
1831
1847
|
const t = document.createElement("section");
|
|
1832
1848
|
t.className = "pluno-pa-widget__panel", t.hidden = !0, t.appendChild(
|
|
1833
|
-
|
|
1849
|
+
No("pluno-pa-widget__scribble-spirals--panel", 16)
|
|
1834
1850
|
);
|
|
1835
1851
|
const n = document.createElement("div");
|
|
1836
1852
|
n.className = "pluno-pa-widget__timeline-wrap";
|
|
1837
1853
|
const o = document.createElement("main");
|
|
1838
|
-
o.className = "pluno-pa-widget__timeline", o.appendChild(
|
|
1854
|
+
o.className = "pluno-pa-widget__timeline", o.appendChild(Ha(e));
|
|
1839
1855
|
const i = document.createElement("div");
|
|
1840
1856
|
i.className = "pluno-pa-widget__timeline-bottom-sentinel", i.setAttribute("aria-hidden", "true"), o.appendChild(i), n.appendChild(o);
|
|
1841
1857
|
const r = document.createElement("div");
|
|
@@ -1846,32 +1862,32 @@ function za(e) {
|
|
|
1846
1862
|
return p.className = "pluno-pa-widget__top-actions", p.appendChild(
|
|
1847
1863
|
yt(
|
|
1848
1864
|
"pluno-pa-widget__history",
|
|
1849
|
-
|
|
1850
|
-
|
|
1865
|
+
ln(),
|
|
1866
|
+
Ka(),
|
|
1851
1867
|
!0
|
|
1852
1868
|
)
|
|
1853
|
-
), n.appendChild(p), n.appendChild(
|
|
1854
|
-
|
|
1855
|
-
), t.appendChild(
|
|
1856
|
-
|
|
1869
|
+
), n.appendChild(p), n.appendChild(Wa()), t.appendChild(n), t.appendChild(Ba()), t.appendChild(Fa()), t.appendChild(ye("left", "Resize Pluno from left")), t.appendChild(
|
|
1870
|
+
ye("right", "Resize Pluno from right")
|
|
1871
|
+
), t.appendChild(ye("top", "Resize Pluno from top")), t.appendChild(
|
|
1872
|
+
ye("bottom", "Resize Pluno from bottom")
|
|
1857
1873
|
), t.appendChild(
|
|
1858
|
-
|
|
1874
|
+
ye("top-left", "Resize Pluno from top left")
|
|
1859
1875
|
), t.appendChild(
|
|
1860
|
-
|
|
1876
|
+
ye("top-right", "Resize Pluno from top right")
|
|
1861
1877
|
), t.appendChild(
|
|
1862
|
-
|
|
1878
|
+
ye("bottom-left", "Resize Pluno from bottom left")
|
|
1863
1879
|
), t.appendChild(
|
|
1864
|
-
|
|
1880
|
+
ye("bottom-right", "Resize Pluno from bottom right")
|
|
1865
1881
|
), t;
|
|
1866
1882
|
}
|
|
1867
|
-
function
|
|
1883
|
+
function ye(e, t) {
|
|
1868
1884
|
const n = document.createElement("button");
|
|
1869
1885
|
return n.type = "button", n.className = [
|
|
1870
1886
|
"pluno-pa-widget__resize-handle",
|
|
1871
1887
|
`pluno-pa-widget__resize-handle--${e}`
|
|
1872
1888
|
].join(" "), n.dataset.resizeDirection = e, n.setAttribute("aria-label", t), n.title = t, n;
|
|
1873
1889
|
}
|
|
1874
|
-
function
|
|
1890
|
+
function Ba() {
|
|
1875
1891
|
const e = document.createElement("div");
|
|
1876
1892
|
e.className = "pluno-pa-widget__notify-suggestion", e.hidden = !0;
|
|
1877
1893
|
const t = document.createElement("span");
|
|
@@ -1885,7 +1901,7 @@ function Ma() {
|
|
|
1885
1901
|
const r = document.createElement("button");
|
|
1886
1902
|
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;
|
|
1887
1903
|
}
|
|
1888
|
-
function
|
|
1904
|
+
function Fa() {
|
|
1889
1905
|
const e = document.createElement("form");
|
|
1890
1906
|
e.className = "pluno-pa-widget__composer";
|
|
1891
1907
|
const t = document.createElement("div");
|
|
@@ -1899,32 +1915,32 @@ function Oa() {
|
|
|
1899
1915
|
const r = document.createElement("input");
|
|
1900
1916
|
r.className = "pluno-pa-widget__attachment-input", r.type = "file", r.multiple = !0, r.tabIndex = -1, r.setAttribute("aria-hidden", "true"), i.appendChild(r);
|
|
1901
1917
|
const l = document.createElement("button");
|
|
1902
|
-
l.type = "button", l.className = "pluno-pa-widget__attach", l.setAttribute("aria-label", "Attach files"), l.title = "Attach files", l.appendChild(
|
|
1918
|
+
l.type = "button", l.className = "pluno-pa-widget__attach", l.setAttribute("aria-label", "Attach files"), l.title = "Attach files", l.appendChild(Xa()), l.appendChild(Za()), i.appendChild(l);
|
|
1903
1919
|
const p = document.createElement("textarea");
|
|
1904
1920
|
p.className = "pluno-pa-widget__input", p.rows = 1, p.placeholder = "Ask for anything...", i.appendChild(p);
|
|
1905
1921
|
const s = document.createElement("button");
|
|
1906
|
-
s.type = "button", s.className = "pluno-pa-widget__send", s.setAttribute("aria-label", "Send"), s.appendChild(
|
|
1907
|
-
const
|
|
1908
|
-
|
|
1922
|
+
s.type = "button", s.className = "pluno-pa-widget__send", s.setAttribute("aria-label", "Send"), s.appendChild(Do()), i.appendChild(s), e.appendChild(i);
|
|
1923
|
+
const g = document.createElement("div");
|
|
1924
|
+
g.className = "pluno-pa-widget__composer-meta";
|
|
1909
1925
|
const c = document.createElement("a");
|
|
1910
|
-
c.className = "pluno-pa-widget__powered-by", c.href = "https://pluno.ai", c.target = "_blank", c.rel = "noopener noreferrer", c.textContent = "Powered by Pluno.ai.",
|
|
1926
|
+
c.className = "pluno-pa-widget__powered-by", c.href = "https://pluno.ai", c.target = "_blank", c.rel = "noopener noreferrer", c.textContent = "Powered by Pluno.ai.", g.appendChild(c);
|
|
1911
1927
|
const h = document.createElement("span");
|
|
1912
|
-
return h.className = "pluno-pa-widget__ai-disclaimer", h.textContent = "AI can make mistakes. Verify outputs.",
|
|
1928
|
+
return h.className = "pluno-pa-widget__ai-disclaimer", h.textContent = "AI can make mistakes. Verify outputs.", g.appendChild(h), e.appendChild(g), e;
|
|
1913
1929
|
}
|
|
1914
|
-
function
|
|
1930
|
+
function ln() {
|
|
1915
1931
|
return location.hostname ? `Recent chats on ${location.hostname}` : "Recent chats";
|
|
1916
1932
|
}
|
|
1917
|
-
function
|
|
1933
|
+
function Wa() {
|
|
1918
1934
|
const e = document.createElement("section");
|
|
1919
|
-
e.className = "pluno-pa-widget__history-panel", e.hidden = !0, e.setAttribute("aria-label",
|
|
1935
|
+
e.className = "pluno-pa-widget__history-panel", e.hidden = !0, e.setAttribute("aria-label", ln());
|
|
1920
1936
|
const t = document.createElement("div");
|
|
1921
1937
|
t.className = "pluno-pa-widget__history-header";
|
|
1922
1938
|
const n = document.createElement("strong");
|
|
1923
|
-
n.textContent =
|
|
1939
|
+
n.textContent = ln();
|
|
1924
1940
|
const o = yt(
|
|
1925
1941
|
"pluno-pa-widget__history-close",
|
|
1926
1942
|
"Close recent chats",
|
|
1927
|
-
|
|
1943
|
+
Ya(),
|
|
1928
1944
|
!1
|
|
1929
1945
|
);
|
|
1930
1946
|
t.append(n, o);
|
|
@@ -1933,20 +1949,20 @@ function Ua() {
|
|
|
1933
1949
|
const r = document.createElement("p");
|
|
1934
1950
|
return r.className = "pluno-pa-widget__history-status", r.hidden = !0, e.append(t, i, r), e;
|
|
1935
1951
|
}
|
|
1936
|
-
function
|
|
1952
|
+
function Ha(e) {
|
|
1937
1953
|
const t = document.createElement("div");
|
|
1938
1954
|
return t.className = "pluno-pa-widget__empty-state", t.appendChild(
|
|
1939
|
-
|
|
1955
|
+
ve(
|
|
1940
1956
|
"pluno-pa-widget__character--empty",
|
|
1941
1957
|
e
|
|
1942
1958
|
)
|
|
1943
|
-
), t.appendChild(
|
|
1959
|
+
), t.appendChild(To()), t;
|
|
1944
1960
|
}
|
|
1945
|
-
function
|
|
1961
|
+
function To() {
|
|
1946
1962
|
const e = document.createElement("div");
|
|
1947
1963
|
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;
|
|
1948
1964
|
}
|
|
1949
|
-
function
|
|
1965
|
+
function Io(e, t) {
|
|
1950
1966
|
e.replaceChildren(), e.setAttribute(
|
|
1951
1967
|
"aria-label",
|
|
1952
1968
|
`${t.toLocaleString("en-US")} users currently active`
|
|
@@ -1958,17 +1974,17 @@ function ko(e, t) {
|
|
|
1958
1974
|
)
|
|
1959
1975
|
);
|
|
1960
1976
|
}
|
|
1961
|
-
function
|
|
1962
|
-
const n = `pluno-pa-character-${
|
|
1963
|
-
|
|
1964
|
-
const o = t.scribbleStyle ?
|
|
1977
|
+
function ve(e, t) {
|
|
1978
|
+
const n = `pluno-pa-character-${qn}`;
|
|
1979
|
+
qn += 1;
|
|
1980
|
+
const o = t.scribbleStyle ? Ga(t.accentColor, n) : $a(t.accentColor, n), i = e.split(/\s+/).filter(Boolean);
|
|
1965
1981
|
return o.setAttribute(
|
|
1966
1982
|
"class",
|
|
1967
1983
|
i.includes("pluno-pa-widget__character") ? e : `pluno-pa-widget__character ${e}`
|
|
1968
1984
|
), o.setAttribute("aria-hidden", "true"), o.setAttribute("focusable", "false"), o.removeAttribute("role"), o.removeAttribute("aria-label"), o;
|
|
1969
1985
|
}
|
|
1970
|
-
function
|
|
1971
|
-
const n =
|
|
1986
|
+
function $a(e, t) {
|
|
1987
|
+
const n = ui(e), o = {
|
|
1972
1988
|
boltFill: `${t}-boltFill`,
|
|
1973
1989
|
boltEdge: `${t}-boltEdge`,
|
|
1974
1990
|
boltGlow: `${t}-boltGlow`,
|
|
@@ -1979,7 +1995,7 @@ function Fa(e, t) {
|
|
|
1979
1995
|
eyeShadow: `${t}-eyeShadow`,
|
|
1980
1996
|
pupilGloss: `${t}-pupilGloss`,
|
|
1981
1997
|
boltClip: `${t}-boltClip`
|
|
1982
|
-
}, i =
|
|
1998
|
+
}, i = Ao(), r = w(i, "defs"), l = w(r, "linearGradient", {
|
|
1983
1999
|
id: o.boltFill,
|
|
1984
2000
|
x1: "420",
|
|
1985
2001
|
y1: "180",
|
|
@@ -1987,8 +2003,8 @@ function Fa(e, t) {
|
|
|
1987
2003
|
y2: "1040",
|
|
1988
2004
|
gradientUnits: "userSpaceOnUse"
|
|
1989
2005
|
});
|
|
1990
|
-
|
|
1991
|
-
const p =
|
|
2006
|
+
O(l, "0", n.top), O(l, "0.36", n.middle), O(l, "0.72", n.bottom), O(l, "1", n.bottom);
|
|
2007
|
+
const p = w(r, "linearGradient", {
|
|
1992
2008
|
id: o.boltEdge,
|
|
1993
2009
|
x1: "470",
|
|
1994
2010
|
y1: "145",
|
|
@@ -1996,29 +2012,29 @@ function Fa(e, t) {
|
|
|
1996
2012
|
y2: "980",
|
|
1997
2013
|
gradientUnits: "userSpaceOnUse"
|
|
1998
2014
|
});
|
|
1999
|
-
|
|
2000
|
-
const s =
|
|
2015
|
+
O(p, "0", n.edgeStart), O(p, "0.32", n.edgeMiddle), O(p, "0.78", n.edgeEnd), O(p, "1", n.edgeEnd);
|
|
2016
|
+
const s = w(r, "radialGradient", {
|
|
2001
2017
|
id: o.boltGlow,
|
|
2002
2018
|
cx: "50%",
|
|
2003
2019
|
cy: "22%",
|
|
2004
2020
|
r: "82%"
|
|
2005
2021
|
});
|
|
2006
|
-
|
|
2007
|
-
const
|
|
2022
|
+
O(s, "0", n.glow, "0.72"), O(s, "0.5", n.middle, "0.44"), O(s, "1", n.bottom, "0");
|
|
2023
|
+
const g = w(r, "radialGradient", {
|
|
2008
2024
|
id: o.eyeWhite,
|
|
2009
2025
|
cx: "35%",
|
|
2010
2026
|
cy: "25%",
|
|
2011
2027
|
r: "70%"
|
|
2012
2028
|
});
|
|
2013
|
-
|
|
2014
|
-
const c =
|
|
2029
|
+
O(g, "0", "#ffffff"), O(g, "0.72", "#ffffff"), O(g, "1", "#e5e5e5");
|
|
2030
|
+
const c = w(r, "radialGradient", {
|
|
2015
2031
|
id: o.pupil,
|
|
2016
2032
|
cx: "42%",
|
|
2017
2033
|
cy: "38%",
|
|
2018
2034
|
r: "65%"
|
|
2019
2035
|
});
|
|
2020
|
-
|
|
2021
|
-
const h =
|
|
2036
|
+
O(c, "0", "#2a1f10"), O(c, "0.52", "#080604"), O(c, "1", "#000000");
|
|
2037
|
+
const h = w(r, "filter", {
|
|
2022
2038
|
id: o.softDropShadow,
|
|
2023
2039
|
x: "-18%",
|
|
2024
2040
|
y: "-12%",
|
|
@@ -2026,14 +2042,14 @@ function Fa(e, t) {
|
|
|
2026
2042
|
height: "136%",
|
|
2027
2043
|
"color-interpolation-filters": "sRGB"
|
|
2028
2044
|
});
|
|
2029
|
-
|
|
2045
|
+
w(h, "feDropShadow", {
|
|
2030
2046
|
dx: "0",
|
|
2031
2047
|
dy: "12",
|
|
2032
2048
|
stdDeviation: "18",
|
|
2033
2049
|
"flood-color": n.shadow,
|
|
2034
2050
|
"flood-opacity": "0.24"
|
|
2035
2051
|
});
|
|
2036
|
-
const
|
|
2052
|
+
const C = w(r, "filter", {
|
|
2037
2053
|
id: o.innerDepth,
|
|
2038
2054
|
x: "-8%",
|
|
2039
2055
|
y: "-8%",
|
|
@@ -2041,32 +2057,32 @@ function Fa(e, t) {
|
|
|
2041
2057
|
height: "116%",
|
|
2042
2058
|
"color-interpolation-filters": "sRGB"
|
|
2043
2059
|
});
|
|
2044
|
-
|
|
2060
|
+
w(C, "feGaussianBlur", {
|
|
2045
2061
|
in: "SourceAlpha",
|
|
2046
2062
|
stdDeviation: "8",
|
|
2047
2063
|
result: "blur"
|
|
2048
|
-
}),
|
|
2064
|
+
}), w(C, "feOffset", {
|
|
2049
2065
|
dx: "-7",
|
|
2050
2066
|
dy: "-9",
|
|
2051
2067
|
result: "topLeft"
|
|
2052
|
-
}),
|
|
2068
|
+
}), w(C, "feComposite", {
|
|
2053
2069
|
in: "topLeft",
|
|
2054
2070
|
in2: "SourceAlpha",
|
|
2055
2071
|
operator: "arithmetic",
|
|
2056
2072
|
k2: "-1",
|
|
2057
2073
|
k3: "1",
|
|
2058
2074
|
result: "innerShadow"
|
|
2059
|
-
}),
|
|
2075
|
+
}), w(C, "feColorMatrix", {
|
|
2060
2076
|
in: "innerShadow",
|
|
2061
2077
|
type: "matrix",
|
|
2062
2078
|
values: "1 0 0 0 1 0 1 0 0 1 0 0 1 0 1 0 0 0 0.42 0",
|
|
2063
2079
|
result: "innerLight"
|
|
2064
|
-
}),
|
|
2080
|
+
}), w(C, "feBlend", {
|
|
2065
2081
|
in: "SourceGraphic",
|
|
2066
2082
|
in2: "innerLight",
|
|
2067
2083
|
mode: "screen"
|
|
2068
2084
|
});
|
|
2069
|
-
const
|
|
2085
|
+
const T = w(r, "filter", {
|
|
2070
2086
|
id: o.eyeShadow,
|
|
2071
2087
|
x: "-24%",
|
|
2072
2088
|
y: "-20%",
|
|
@@ -2074,14 +2090,14 @@ function Fa(e, t) {
|
|
|
2074
2090
|
height: "148%",
|
|
2075
2091
|
"color-interpolation-filters": "sRGB"
|
|
2076
2092
|
});
|
|
2077
|
-
|
|
2093
|
+
w(T, "feDropShadow", {
|
|
2078
2094
|
dx: "0",
|
|
2079
2095
|
dy: "8",
|
|
2080
2096
|
stdDeviation: "5",
|
|
2081
2097
|
"flood-color": n.shadow,
|
|
2082
2098
|
"flood-opacity": "0.3"
|
|
2083
2099
|
});
|
|
2084
|
-
const
|
|
2100
|
+
const I = w(r, "filter", {
|
|
2085
2101
|
id: o.pupilGloss,
|
|
2086
2102
|
x: "-15%",
|
|
2087
2103
|
y: "-15%",
|
|
@@ -2089,51 +2105,51 @@ function Fa(e, t) {
|
|
|
2089
2105
|
height: "130%",
|
|
2090
2106
|
"color-interpolation-filters": "sRGB"
|
|
2091
2107
|
});
|
|
2092
|
-
|
|
2108
|
+
w(I, "feDropShadow", {
|
|
2093
2109
|
dx: "0",
|
|
2094
2110
|
dy: "3",
|
|
2095
2111
|
stdDeviation: "3",
|
|
2096
2112
|
"flood-color": "#000000",
|
|
2097
2113
|
"flood-opacity": "0.22"
|
|
2098
2114
|
});
|
|
2099
|
-
const
|
|
2100
|
-
|
|
2101
|
-
const
|
|
2115
|
+
const D = w(r, "clipPath", { id: o.boltClip });
|
|
2116
|
+
w(D, "path", { d: ft });
|
|
2117
|
+
const u = w(i, "g", {
|
|
2102
2118
|
filter: Y(o.softDropShadow)
|
|
2103
2119
|
});
|
|
2104
|
-
|
|
2120
|
+
w(u, "path", {
|
|
2105
2121
|
d: ft,
|
|
2106
2122
|
fill: Y(o.boltEdge)
|
|
2107
2123
|
});
|
|
2108
2124
|
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";
|
|
2109
|
-
|
|
2125
|
+
w(u, "path", {
|
|
2110
2126
|
d: y,
|
|
2111
2127
|
fill: Y(o.boltFill),
|
|
2112
2128
|
filter: Y(o.innerDepth)
|
|
2113
|
-
}),
|
|
2129
|
+
}), w(u, "path", {
|
|
2114
2130
|
d: y,
|
|
2115
2131
|
fill: Y(o.boltGlow),
|
|
2116
2132
|
opacity: "0.74"
|
|
2117
2133
|
});
|
|
2118
|
-
const m =
|
|
2134
|
+
const m = w(u, "g", {
|
|
2119
2135
|
"clip-path": Y(o.boltClip),
|
|
2120
2136
|
opacity: "0.42"
|
|
2121
2137
|
});
|
|
2122
|
-
|
|
2138
|
+
w(m, "path", {
|
|
2123
2139
|
d: "M523 181 C505 189 496 206 489 232 L400 594 C397 606 400 619 411 626",
|
|
2124
2140
|
fill: "none",
|
|
2125
2141
|
stroke: n.highlight,
|
|
2126
2142
|
"stroke-width": "22",
|
|
2127
2143
|
"stroke-linecap": "round",
|
|
2128
2144
|
opacity: "0.65"
|
|
2129
|
-
}),
|
|
2145
|
+
}), w(m, "path", {
|
|
2130
2146
|
d: "M556 685 L501 994",
|
|
2131
2147
|
fill: "none",
|
|
2132
2148
|
stroke: n.highlight,
|
|
2133
2149
|
"stroke-width": "20",
|
|
2134
2150
|
"stroke-linecap": "round",
|
|
2135
2151
|
opacity: "0.55"
|
|
2136
|
-
}),
|
|
2152
|
+
}), w(m, "path", {
|
|
2137
2153
|
d: "M858 160 C882 166 893 181 883 204",
|
|
2138
2154
|
fill: "none",
|
|
2139
2155
|
stroke: n.inner,
|
|
@@ -2141,9 +2157,9 @@ function Fa(e, t) {
|
|
|
2141
2157
|
"stroke-linecap": "round",
|
|
2142
2158
|
opacity: "0.48"
|
|
2143
2159
|
});
|
|
2144
|
-
const
|
|
2145
|
-
return
|
|
2146
|
-
|
|
2160
|
+
const S = w(i, "g", { filter: Y(o.eyeShadow) });
|
|
2161
|
+
return Jn(
|
|
2162
|
+
S,
|
|
2147
2163
|
"rotate(-2 528 463)",
|
|
2148
2164
|
"528",
|
|
2149
2165
|
"463",
|
|
@@ -2152,8 +2168,8 @@ function Fa(e, t) {
|
|
|
2152
2168
|
"557",
|
|
2153
2169
|
"447",
|
|
2154
2170
|
o
|
|
2155
|
-
),
|
|
2156
|
-
|
|
2171
|
+
), Jn(
|
|
2172
|
+
S,
|
|
2157
2173
|
"rotate(2 717 462)",
|
|
2158
2174
|
"717",
|
|
2159
2175
|
"462",
|
|
@@ -2164,13 +2180,13 @@ function Fa(e, t) {
|
|
|
2164
2180
|
o
|
|
2165
2181
|
), i;
|
|
2166
2182
|
}
|
|
2167
|
-
function
|
|
2168
|
-
const n =
|
|
2183
|
+
function Ga(e, t) {
|
|
2184
|
+
const n = mo(e), o = {
|
|
2169
2185
|
clip: `${t}-scribbleBoltClip`,
|
|
2170
2186
|
wobble: `${t}-scribbleBoltWobble`
|
|
2171
|
-
}, i =
|
|
2172
|
-
|
|
2173
|
-
const p =
|
|
2187
|
+
}, i = Ao(), r = w(i, "defs"), l = w(r, "clipPath", { id: o.clip });
|
|
2188
|
+
w(l, "path", { d: ft });
|
|
2189
|
+
const p = w(r, "filter", {
|
|
2174
2190
|
id: o.wobble,
|
|
2175
2191
|
x: "-10%",
|
|
2176
2192
|
y: "-10%",
|
|
@@ -2178,24 +2194,24 @@ function Ha(e, t) {
|
|
|
2178
2194
|
height: "120%",
|
|
2179
2195
|
"color-interpolation-filters": "sRGB"
|
|
2180
2196
|
});
|
|
2181
|
-
|
|
2197
|
+
w(p, "feTurbulence", {
|
|
2182
2198
|
type: "fractalNoise",
|
|
2183
2199
|
baseFrequency: "0.011",
|
|
2184
2200
|
numOctaves: "3",
|
|
2185
2201
|
seed: "7",
|
|
2186
2202
|
result: "noise"
|
|
2187
|
-
}),
|
|
2203
|
+
}), w(p, "feDisplacementMap", {
|
|
2188
2204
|
in: "SourceGraphic",
|
|
2189
2205
|
in2: "noise",
|
|
2190
2206
|
scale: "16",
|
|
2191
2207
|
xChannelSelector: "R",
|
|
2192
2208
|
yChannelSelector: "G"
|
|
2193
2209
|
});
|
|
2194
|
-
const s =
|
|
2210
|
+
const s = w(i, "g", { filter: Y(o.wobble) }), g = w(s, "g", {
|
|
2195
2211
|
"clip-path": Y(o.clip)
|
|
2196
2212
|
});
|
|
2197
|
-
return
|
|
2198
|
-
d:
|
|
2213
|
+
return w(g, "path", {
|
|
2214
|
+
d: ci(),
|
|
2199
2215
|
fill: "none",
|
|
2200
2216
|
stroke: n,
|
|
2201
2217
|
"stroke-width": "56",
|
|
@@ -2203,13 +2219,13 @@ function Ha(e, t) {
|
|
|
2203
2219
|
"stroke-linejoin": "round",
|
|
2204
2220
|
opacity: "0.9",
|
|
2205
2221
|
transform: "rotate(-14 627 600)"
|
|
2206
|
-
}),
|
|
2222
|
+
}), w(s, "path", {
|
|
2207
2223
|
d: ft,
|
|
2208
2224
|
fill: "none",
|
|
2209
2225
|
stroke: wt,
|
|
2210
2226
|
"stroke-width": "18",
|
|
2211
2227
|
"stroke-linejoin": "round"
|
|
2212
|
-
}),
|
|
2228
|
+
}), Qn(
|
|
2213
2229
|
s,
|
|
2214
2230
|
"rotate(-2 528 463)",
|
|
2215
2231
|
"528",
|
|
@@ -2218,7 +2234,7 @@ function Ha(e, t) {
|
|
|
2218
2234
|
"473",
|
|
2219
2235
|
"557",
|
|
2220
2236
|
"447"
|
|
2221
|
-
),
|
|
2237
|
+
), Qn(
|
|
2222
2238
|
s,
|
|
2223
2239
|
"rotate(2 717 462)",
|
|
2224
2240
|
"717",
|
|
@@ -2229,37 +2245,37 @@ function Ha(e, t) {
|
|
|
2229
2245
|
"447"
|
|
2230
2246
|
), i;
|
|
2231
2247
|
}
|
|
2232
|
-
function
|
|
2233
|
-
return
|
|
2234
|
-
xmlns:
|
|
2248
|
+
function Ao() {
|
|
2249
|
+
return E("svg", {
|
|
2250
|
+
xmlns: Co,
|
|
2235
2251
|
viewBox: "0 0 1254 1254"
|
|
2236
2252
|
});
|
|
2237
2253
|
}
|
|
2238
|
-
function
|
|
2239
|
-
const
|
|
2240
|
-
|
|
2254
|
+
function Jn(e, t, n, o, i, r, l, p, s) {
|
|
2255
|
+
const g = w(e, "g", { transform: t });
|
|
2256
|
+
w(g, "ellipse", {
|
|
2241
2257
|
cx: n,
|
|
2242
2258
|
cy: o,
|
|
2243
2259
|
rx: "73",
|
|
2244
2260
|
ry: "80",
|
|
2245
2261
|
fill: Y(s.eyeWhite)
|
|
2246
|
-
}),
|
|
2262
|
+
}), w(g, "ellipse", {
|
|
2247
2263
|
cx: i,
|
|
2248
2264
|
cy: r,
|
|
2249
2265
|
rx: "49",
|
|
2250
2266
|
ry: "57",
|
|
2251
2267
|
fill: Y(s.pupil),
|
|
2252
2268
|
filter: Y(s.pupilGloss)
|
|
2253
|
-
}),
|
|
2269
|
+
}), w(g, "circle", {
|
|
2254
2270
|
cx: l,
|
|
2255
2271
|
cy: p,
|
|
2256
2272
|
r: "18",
|
|
2257
2273
|
fill: "#ffffff"
|
|
2258
2274
|
});
|
|
2259
2275
|
}
|
|
2260
|
-
function
|
|
2261
|
-
const s =
|
|
2262
|
-
|
|
2276
|
+
function Qn(e, t, n, o, i, r, l, p) {
|
|
2277
|
+
const s = w(e, "g", { transform: t });
|
|
2278
|
+
w(s, "ellipse", {
|
|
2263
2279
|
cx: n,
|
|
2264
2280
|
cy: o,
|
|
2265
2281
|
rx: "73",
|
|
@@ -2267,26 +2283,26 @@ function Zn(e, t, n, o, i, r, l, p) {
|
|
|
2267
2283
|
fill: "#ffffff",
|
|
2268
2284
|
stroke: wt,
|
|
2269
2285
|
"stroke-width": "13"
|
|
2270
|
-
}),
|
|
2286
|
+
}), w(s, "ellipse", {
|
|
2271
2287
|
cx: i,
|
|
2272
2288
|
cy: r,
|
|
2273
2289
|
rx: "45",
|
|
2274
2290
|
ry: "53",
|
|
2275
2291
|
fill: wt
|
|
2276
|
-
}),
|
|
2292
|
+
}), w(s, "circle", {
|
|
2277
2293
|
cx: l,
|
|
2278
2294
|
cy: p,
|
|
2279
2295
|
r: "16",
|
|
2280
2296
|
fill: "#ffffff"
|
|
2281
2297
|
});
|
|
2282
2298
|
}
|
|
2283
|
-
function
|
|
2284
|
-
const o =
|
|
2299
|
+
function w(e, t, n = {}) {
|
|
2300
|
+
const o = E(t, n);
|
|
2285
2301
|
return e.appendChild(o), o;
|
|
2286
2302
|
}
|
|
2287
|
-
function
|
|
2303
|
+
function O(e, t, n, o) {
|
|
2288
2304
|
const i = { offset: t, "stop-color": n };
|
|
2289
|
-
o !== void 0 && (i["stop-opacity"] = o),
|
|
2305
|
+
o !== void 0 && (i["stop-opacity"] = o), w(e, "stop", i);
|
|
2290
2306
|
}
|
|
2291
2307
|
function Y(e) {
|
|
2292
2308
|
return `url(#${e})`;
|
|
@@ -2295,57 +2311,57 @@ function yt(e, t, n, o) {
|
|
|
2295
2311
|
const i = document.createElement("button");
|
|
2296
2312
|
return i.type = "button", i.className = e, i.setAttribute("aria-label", t), i.title = t, i.hidden = o, i.appendChild(n), i;
|
|
2297
2313
|
}
|
|
2298
|
-
function
|
|
2299
|
-
const e =
|
|
2314
|
+
function qa() {
|
|
2315
|
+
const e = E("svg", {
|
|
2300
2316
|
class: "pluno-pa-widget__scribble-defs",
|
|
2301
2317
|
"aria-hidden": "true",
|
|
2302
2318
|
focusable: "false",
|
|
2303
2319
|
width: "0",
|
|
2304
2320
|
height: "0"
|
|
2305
|
-
}), t =
|
|
2306
|
-
return t.appendChild(
|
|
2307
|
-
|
|
2321
|
+
}), t = E("defs");
|
|
2322
|
+
return t.appendChild(Yt("pluno-pa-scribble-wobble", "2", "12")), t.appendChild(
|
|
2323
|
+
Yt("pluno-pa-scribble-wobble-2", "5", "15")
|
|
2308
2324
|
), t.appendChild(
|
|
2309
|
-
|
|
2325
|
+
Yt("pluno-pa-scribble-wobble-3", "9", "19")
|
|
2310
2326
|
), e.appendChild(t), e;
|
|
2311
2327
|
}
|
|
2312
|
-
function
|
|
2313
|
-
const n =
|
|
2328
|
+
function No(e, t) {
|
|
2329
|
+
const n = E("svg", {
|
|
2314
2330
|
class: `pluno-pa-widget__scribble-spirals ${e}`,
|
|
2315
2331
|
preserveAspectRatio: "xMidYMid meet",
|
|
2316
2332
|
"aria-hidden": "true",
|
|
2317
2333
|
focusable: "false"
|
|
2318
2334
|
});
|
|
2319
|
-
return
|
|
2335
|
+
return Ro(n, t), n;
|
|
2320
2336
|
}
|
|
2321
|
-
function
|
|
2337
|
+
function Kt(e, t) {
|
|
2322
2338
|
if (!e)
|
|
2323
2339
|
return;
|
|
2324
2340
|
const n = Math.max(
|
|
2325
2341
|
0,
|
|
2326
|
-
t -
|
|
2342
|
+
t - on * 2
|
|
2327
2343
|
), o = Math.max(
|
|
2328
|
-
|
|
2344
|
+
pa,
|
|
2329
2345
|
Math.floor(
|
|
2330
|
-
(n -
|
|
2346
|
+
(n - nn * 2) / tn
|
|
2331
2347
|
)
|
|
2332
2348
|
);
|
|
2333
|
-
|
|
2349
|
+
Ro(e, o);
|
|
2334
2350
|
}
|
|
2335
|
-
function
|
|
2351
|
+
function Ro(e, t) {
|
|
2336
2352
|
if (e.dataset.spiralCount === `${t}`)
|
|
2337
2353
|
return;
|
|
2338
|
-
const n = t *
|
|
2354
|
+
const n = t * tn + nn * 2;
|
|
2339
2355
|
e.dataset.spiralCount = `${t}`, e.setAttribute(
|
|
2340
2356
|
"viewBox",
|
|
2341
|
-
`0 0 ${n} ${
|
|
2357
|
+
`0 0 ${n} ${la}`
|
|
2342
2358
|
), e.replaceChildren();
|
|
2343
2359
|
for (let o = 0; o < t; o += 1) {
|
|
2344
|
-
const i =
|
|
2345
|
-
transform: `translate(${
|
|
2360
|
+
const i = Gn[o % Gn.length], r = E("g", {
|
|
2361
|
+
transform: `translate(${nn + o * tn} 0)`
|
|
2346
2362
|
});
|
|
2347
2363
|
r.appendChild(
|
|
2348
|
-
|
|
2364
|
+
E("ellipse", {
|
|
2349
2365
|
cx: i.ellipseCx,
|
|
2350
2366
|
cy: i.ellipseCy,
|
|
2351
2367
|
rx: i.ellipseRx,
|
|
@@ -2356,7 +2372,7 @@ function To(e, t) {
|
|
|
2356
2372
|
opacity: "0.8"
|
|
2357
2373
|
})
|
|
2358
2374
|
), r.appendChild(
|
|
2359
|
-
|
|
2375
|
+
E("path", {
|
|
2360
2376
|
d: i.path,
|
|
2361
2377
|
fill: "none",
|
|
2362
2378
|
stroke: "#2c2a1e",
|
|
@@ -2366,8 +2382,8 @@ function To(e, t) {
|
|
|
2366
2382
|
), e.appendChild(r);
|
|
2367
2383
|
}
|
|
2368
2384
|
}
|
|
2369
|
-
function
|
|
2370
|
-
const o =
|
|
2385
|
+
function Yt(e, t, n) {
|
|
2386
|
+
const o = E("filter", {
|
|
2371
2387
|
id: e,
|
|
2372
2388
|
x: "-8%",
|
|
2373
2389
|
y: "-8%",
|
|
@@ -2375,7 +2391,7 @@ function Kt(e, t, n) {
|
|
|
2375
2391
|
height: "116%"
|
|
2376
2392
|
});
|
|
2377
2393
|
return o.appendChild(
|
|
2378
|
-
|
|
2394
|
+
E("feTurbulence", {
|
|
2379
2395
|
type: "fractalNoise",
|
|
2380
2396
|
baseFrequency: "0.012 0.028",
|
|
2381
2397
|
numOctaves: "3",
|
|
@@ -2383,7 +2399,7 @@ function Kt(e, t, n) {
|
|
|
2383
2399
|
result: "stroke-noise"
|
|
2384
2400
|
})
|
|
2385
2401
|
), o.appendChild(
|
|
2386
|
-
|
|
2402
|
+
E("feDisplacementMap", {
|
|
2387
2403
|
in: "SourceGraphic",
|
|
2388
2404
|
in2: "stroke-noise",
|
|
2389
2405
|
scale: "3.5",
|
|
@@ -2392,7 +2408,7 @@ function Kt(e, t, n) {
|
|
|
2392
2408
|
result: "warped"
|
|
2393
2409
|
})
|
|
2394
2410
|
), o.appendChild(
|
|
2395
|
-
|
|
2411
|
+
E("feTurbulence", {
|
|
2396
2412
|
type: "fractalNoise",
|
|
2397
2413
|
baseFrequency: "0.7",
|
|
2398
2414
|
numOctaves: "1",
|
|
@@ -2400,7 +2416,7 @@ function Kt(e, t, n) {
|
|
|
2400
2416
|
result: "ink-noise"
|
|
2401
2417
|
})
|
|
2402
2418
|
), o.appendChild(
|
|
2403
|
-
|
|
2419
|
+
E("feDisplacementMap", {
|
|
2404
2420
|
in: "warped",
|
|
2405
2421
|
in2: "ink-noise",
|
|
2406
2422
|
scale: "0.9",
|
|
@@ -2409,8 +2425,8 @@ function Kt(e, t, n) {
|
|
|
2409
2425
|
})
|
|
2410
2426
|
), o;
|
|
2411
2427
|
}
|
|
2412
|
-
function
|
|
2413
|
-
const t =
|
|
2428
|
+
function ja(e) {
|
|
2429
|
+
const t = ce(
|
|
2414
2430
|
"0 0 24 24",
|
|
2415
2431
|
e,
|
|
2416
2432
|
e,
|
|
@@ -2418,10 +2434,10 @@ function Ga(e) {
|
|
|
2418
2434
|
"currentColor",
|
|
2419
2435
|
"2.25"
|
|
2420
2436
|
);
|
|
2421
|
-
return t.appendChild(
|
|
2437
|
+
return t.appendChild(E("path", { d: "m6 9 6 6 6-6" })), t;
|
|
2422
2438
|
}
|
|
2423
|
-
function
|
|
2424
|
-
const e =
|
|
2439
|
+
function Va() {
|
|
2440
|
+
const e = ce(
|
|
2425
2441
|
"0 0 24 24",
|
|
2426
2442
|
17,
|
|
2427
2443
|
17,
|
|
@@ -2430,17 +2446,17 @@ function $a() {
|
|
|
2430
2446
|
"2.25"
|
|
2431
2447
|
);
|
|
2432
2448
|
return e.appendChild(
|
|
2433
|
-
|
|
2449
|
+
E("path", {
|
|
2434
2450
|
d: "M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"
|
|
2435
2451
|
})
|
|
2436
2452
|
), e.appendChild(
|
|
2437
|
-
|
|
2453
|
+
E("path", {
|
|
2438
2454
|
d: "M18.4 2.6a2.1 2.1 0 0 1 3 3L12 15l-4 1 1-4Z"
|
|
2439
2455
|
})
|
|
2440
2456
|
), e;
|
|
2441
2457
|
}
|
|
2442
|
-
function
|
|
2443
|
-
const e =
|
|
2458
|
+
function Ka() {
|
|
2459
|
+
const e = ce(
|
|
2444
2460
|
"0 0 24 24",
|
|
2445
2461
|
17,
|
|
2446
2462
|
17,
|
|
@@ -2448,10 +2464,10 @@ function qa() {
|
|
|
2448
2464
|
"currentColor",
|
|
2449
2465
|
"2.25"
|
|
2450
2466
|
);
|
|
2451
|
-
return e.appendChild(
|
|
2467
|
+
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;
|
|
2452
2468
|
}
|
|
2453
|
-
function
|
|
2454
|
-
const e =
|
|
2469
|
+
function Ya() {
|
|
2470
|
+
const e = ce(
|
|
2455
2471
|
"0 0 24 24",
|
|
2456
2472
|
15,
|
|
2457
2473
|
15,
|
|
@@ -2459,10 +2475,10 @@ function ja() {
|
|
|
2459
2475
|
"currentColor",
|
|
2460
2476
|
"2.4"
|
|
2461
2477
|
);
|
|
2462
|
-
return e.appendChild(
|
|
2478
|
+
return e.appendChild(E("path", { d: "M18 6 6 18" })), e.appendChild(E("path", { d: "m6 6 12 12" })), e;
|
|
2463
2479
|
}
|
|
2464
|
-
function
|
|
2465
|
-
const e =
|
|
2480
|
+
function Do() {
|
|
2481
|
+
const e = ce(
|
|
2466
2482
|
"0 0 24 24",
|
|
2467
2483
|
14,
|
|
2468
2484
|
14,
|
|
@@ -2471,11 +2487,11 @@ function Io() {
|
|
|
2471
2487
|
"2.75"
|
|
2472
2488
|
);
|
|
2473
2489
|
return e.appendChild(
|
|
2474
|
-
|
|
2475
|
-
), e.appendChild(
|
|
2490
|
+
E("line", { x1: "12", y1: "19", x2: "12", y2: "5" })
|
|
2491
|
+
), e.appendChild(E("polyline", { points: "5 12 12 5 19 12" })), e;
|
|
2476
2492
|
}
|
|
2477
|
-
function
|
|
2478
|
-
const e =
|
|
2493
|
+
function Xa() {
|
|
2494
|
+
const e = ce(
|
|
2479
2495
|
"0 0 24 24",
|
|
2480
2496
|
16,
|
|
2481
2497
|
16,
|
|
@@ -2487,18 +2503,18 @@ function Va() {
|
|
|
2487
2503
|
"class",
|
|
2488
2504
|
"pluno-pa-widget__paperclip-icon pluno-pa-widget__paperclip-icon--standard"
|
|
2489
2505
|
), e.appendChild(
|
|
2490
|
-
|
|
2506
|
+
E("path", {
|
|
2491
2507
|
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"
|
|
2492
2508
|
})
|
|
2493
2509
|
), e;
|
|
2494
2510
|
}
|
|
2495
|
-
function
|
|
2496
|
-
const e =
|
|
2511
|
+
function Za() {
|
|
2512
|
+
const e = ce("0 0 24 24", 19, 19, "none", "currentColor");
|
|
2497
2513
|
return e.setAttribute(
|
|
2498
2514
|
"class",
|
|
2499
2515
|
"pluno-pa-widget__paperclip-icon pluno-pa-widget__paperclip-icon--scribble"
|
|
2500
2516
|
), e.appendChild(
|
|
2501
|
-
|
|
2517
|
+
E("path", {
|
|
2502
2518
|
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",
|
|
2503
2519
|
stroke: "currentColor",
|
|
2504
2520
|
"stroke-width": "2",
|
|
@@ -2507,10 +2523,10 @@ function Ka() {
|
|
|
2507
2523
|
})
|
|
2508
2524
|
), e;
|
|
2509
2525
|
}
|
|
2510
|
-
function
|
|
2511
|
-
const e =
|
|
2526
|
+
function Ja() {
|
|
2527
|
+
const e = ce("0 0 24 24", 18, 18, "currentColor");
|
|
2512
2528
|
return e.appendChild(
|
|
2513
|
-
|
|
2529
|
+
E("rect", {
|
|
2514
2530
|
x: "6",
|
|
2515
2531
|
y: "6",
|
|
2516
2532
|
width: "12",
|
|
@@ -2519,8 +2535,8 @@ function Ya() {
|
|
|
2519
2535
|
})
|
|
2520
2536
|
), e;
|
|
2521
2537
|
}
|
|
2522
|
-
function
|
|
2523
|
-
const e =
|
|
2538
|
+
function Qa() {
|
|
2539
|
+
const e = ce(
|
|
2524
2540
|
"0 0 24 24",
|
|
2525
2541
|
12,
|
|
2526
2542
|
12,
|
|
@@ -2528,10 +2544,10 @@ function Xa() {
|
|
|
2528
2544
|
"currentColor",
|
|
2529
2545
|
"2.4"
|
|
2530
2546
|
);
|
|
2531
|
-
return e.appendChild(
|
|
2547
|
+
return e.appendChild(E("path", { d: "M18 6 6 18" })), e.appendChild(E("path", { d: "m6 6 12 12" })), e;
|
|
2532
2548
|
}
|
|
2533
|
-
function
|
|
2534
|
-
const e =
|
|
2549
|
+
function er() {
|
|
2550
|
+
const e = ce(
|
|
2535
2551
|
"0 0 24 24",
|
|
2536
2552
|
13,
|
|
2537
2553
|
13,
|
|
@@ -2540,7 +2556,7 @@ function Za() {
|
|
|
2540
2556
|
"2.25"
|
|
2541
2557
|
);
|
|
2542
2558
|
return e.appendChild(
|
|
2543
|
-
|
|
2559
|
+
E("rect", {
|
|
2544
2560
|
width: "14",
|
|
2545
2561
|
height: "14",
|
|
2546
2562
|
x: "8",
|
|
@@ -2549,12 +2565,12 @@ function Za() {
|
|
|
2549
2565
|
ry: "2"
|
|
2550
2566
|
})
|
|
2551
2567
|
), e.appendChild(
|
|
2552
|
-
|
|
2568
|
+
E("path", {
|
|
2553
2569
|
d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"
|
|
2554
2570
|
})
|
|
2555
2571
|
), e;
|
|
2556
2572
|
}
|
|
2557
|
-
function
|
|
2573
|
+
function ce(e, t, n, o, i, r) {
|
|
2558
2574
|
const l = {
|
|
2559
2575
|
viewBox: e,
|
|
2560
2576
|
width: String(t),
|
|
@@ -2562,165 +2578,165 @@ function pe(e, t, n, o, i, r) {
|
|
|
2562
2578
|
fill: o,
|
|
2563
2579
|
"aria-hidden": "true"
|
|
2564
2580
|
};
|
|
2565
|
-
return i && (l.stroke = i, l["stroke-linecap"] = "round", l["stroke-linejoin"] = "round"), r && (l["stroke-width"] = r),
|
|
2581
|
+
return i && (l.stroke = i, l["stroke-linecap"] = "round", l["stroke-linejoin"] = "round"), r && (l["stroke-width"] = r), E("svg", l);
|
|
2566
2582
|
}
|
|
2567
|
-
function
|
|
2568
|
-
const n = document.createElementNS(
|
|
2583
|
+
function E(e, t = {}) {
|
|
2584
|
+
const n = document.createElementNS(Co, e);
|
|
2569
2585
|
for (const [o, i] of Object.entries(t))
|
|
2570
2586
|
n.setAttribute(o, i);
|
|
2571
2587
|
return n;
|
|
2572
2588
|
}
|
|
2573
|
-
function
|
|
2589
|
+
function eo(e) {
|
|
2574
2590
|
for (const t of ["keydown", "keypress", "keyup"])
|
|
2575
2591
|
e.addEventListener(t, (n) => {
|
|
2576
2592
|
n.stopPropagation();
|
|
2577
2593
|
});
|
|
2578
2594
|
}
|
|
2579
|
-
function
|
|
2595
|
+
function tr(e, t, n) {
|
|
2580
2596
|
e.replaceChildren(), e.hidden = t.length === 0;
|
|
2581
2597
|
for (const [o, i] of t.entries()) {
|
|
2582
2598
|
const r = document.createElement("div");
|
|
2583
|
-
r.className = "pluno-pa-widget__attachment", r.appendChild(
|
|
2599
|
+
r.className = "pluno-pa-widget__attachment", r.appendChild(nr(i));
|
|
2584
2600
|
const l = document.createElement("span");
|
|
2585
2601
|
l.textContent = i.name, r.appendChild(l);
|
|
2586
2602
|
const p = document.createElement("button");
|
|
2587
|
-
p.type = "button", p.setAttribute("aria-label", `Remove ${i.name}`), p.appendChild(
|
|
2603
|
+
p.type = "button", p.setAttribute("aria-label", `Remove ${i.name}`), p.appendChild(Qa()), p.addEventListener("click", () => n(o)), r.appendChild(p), e.appendChild(r);
|
|
2588
2604
|
}
|
|
2589
2605
|
}
|
|
2590
|
-
function
|
|
2591
|
-
const t =
|
|
2606
|
+
function nr(e) {
|
|
2607
|
+
const t = gn(e), n = zo(e);
|
|
2592
2608
|
if (t === "image" && n) {
|
|
2593
2609
|
const o = document.createElement("img");
|
|
2594
|
-
return o.src = n, o.alt = "", o.setAttribute("aria-hidden", "true"), o.addEventListener("error", () => o.replaceWith(
|
|
2610
|
+
return o.src = n, o.alt = "", o.setAttribute("aria-hidden", "true"), o.addEventListener("error", () => o.replaceWith(se(e))), o;
|
|
2595
2611
|
}
|
|
2596
2612
|
if (t === "video" && n) {
|
|
2597
2613
|
const o = document.createElement("video");
|
|
2598
|
-
return o.src = n, o.muted = !0, o.preload = "metadata", o.setAttribute("aria-hidden", "true"), o.addEventListener("error", () => o.replaceWith(
|
|
2614
|
+
return o.src = n, o.muted = !0, o.preload = "metadata", o.setAttribute("aria-hidden", "true"), o.addEventListener("error", () => o.replaceWith(se(e))), o.addEventListener("stalled", () => o.replaceWith(se(e))), o;
|
|
2599
2615
|
}
|
|
2600
|
-
return
|
|
2616
|
+
return se(e);
|
|
2601
2617
|
}
|
|
2602
|
-
function
|
|
2603
|
-
const t =
|
|
2618
|
+
function or(e) {
|
|
2619
|
+
const t = gn(e), n = zo(e);
|
|
2604
2620
|
if (t === "image" && n) {
|
|
2605
2621
|
const o = document.createElement("img");
|
|
2606
|
-
return o.className = "pluno-pa-widget__message-attachment-preview", o.src = n, o.alt = e.name, o.addEventListener("error", () => o.replaceWith(
|
|
2622
|
+
return o.className = "pluno-pa-widget__message-attachment-preview", o.src = n, o.alt = e.name, o.addEventListener("error", () => o.replaceWith(se(e, "message"))), o;
|
|
2607
2623
|
}
|
|
2608
2624
|
if (t === "pdf" && n) {
|
|
2609
2625
|
const o = document.createElement("object");
|
|
2610
|
-
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(
|
|
2626
|
+
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(se(e, "message"))), o.appendChild(se(e, "message")), o;
|
|
2611
2627
|
}
|
|
2612
2628
|
if (t === "video" && n) {
|
|
2613
2629
|
const o = document.createElement("video");
|
|
2614
|
-
return o.className = "pluno-pa-widget__message-attachment-preview", o.src = n, o.muted = !0, o.preload = "metadata", o.addEventListener("error", () => o.replaceWith(
|
|
2630
|
+
return o.className = "pluno-pa-widget__message-attachment-preview", o.src = n, o.muted = !0, o.preload = "metadata", o.addEventListener("error", () => o.replaceWith(se(e, "message"))), o.addEventListener("stalled", () => o.replaceWith(se(e, "message"))), o;
|
|
2615
2631
|
}
|
|
2616
|
-
return
|
|
2632
|
+
return se(e, "message");
|
|
2617
2633
|
}
|
|
2618
|
-
function
|
|
2634
|
+
function se(e, t = "composer") {
|
|
2619
2635
|
if (t === "composer") {
|
|
2620
2636
|
const r = document.createElement("span");
|
|
2621
|
-
return r.className = "pluno-pa-widget__attachment-file", r.textContent =
|
|
2637
|
+
return r.className = "pluno-pa-widget__attachment-file", r.textContent = to(e), r;
|
|
2622
2638
|
}
|
|
2623
2639
|
const n = document.createElement("div");
|
|
2624
2640
|
n.className = "pluno-pa-widget__message-attachment-file";
|
|
2625
2641
|
const o = document.createElement("span");
|
|
2626
|
-
o.textContent =
|
|
2642
|
+
o.textContent = to(e);
|
|
2627
2643
|
const i = document.createElement("strong");
|
|
2628
2644
|
return i.textContent = e.name, n.append(o, i), n;
|
|
2629
2645
|
}
|
|
2630
|
-
function
|
|
2646
|
+
function gn(e) {
|
|
2631
2647
|
return e.mimeType.startsWith("image/") ? "image" : e.mimeType === "application/pdf" ? "pdf" : e.mimeType.startsWith("video/") ? "video" : "file";
|
|
2632
2648
|
}
|
|
2633
|
-
function
|
|
2649
|
+
function zo(e) {
|
|
2634
2650
|
return "previewUrl" in e && e.previewUrl ? e.previewUrl : e.fileUrl ?? "";
|
|
2635
2651
|
}
|
|
2636
|
-
function
|
|
2637
|
-
const t =
|
|
2652
|
+
function to(e) {
|
|
2653
|
+
const t = gn(e);
|
|
2638
2654
|
return t === "image" ? "IMG" : t === "pdf" ? "PDF" : t === "video" ? "VID" : "FILE";
|
|
2639
2655
|
}
|
|
2640
|
-
function
|
|
2656
|
+
function ir(e, t) {
|
|
2641
2657
|
return t ? Array.from(t).map((o) => ({
|
|
2642
2658
|
...e.createLocalAttachment(o),
|
|
2643
|
-
previewUrl:
|
|
2659
|
+
previewUrl: ar(o)
|
|
2644
2660
|
})) : [];
|
|
2645
2661
|
}
|
|
2646
|
-
function
|
|
2662
|
+
function ar(e) {
|
|
2647
2663
|
return typeof URL.createObjectURL == "function" ? URL.createObjectURL(e) : void 0;
|
|
2648
2664
|
}
|
|
2649
2665
|
function ut(e) {
|
|
2650
2666
|
return !!(e && Array.from(e.types).includes("Files"));
|
|
2651
2667
|
}
|
|
2652
|
-
function
|
|
2653
|
-
if (!e || !
|
|
2668
|
+
function Xt(e, t, n = null) {
|
|
2669
|
+
if (!e || !pn(t, n)) {
|
|
2654
2670
|
e && (e.hidden = !0, e.replaceChildren());
|
|
2655
2671
|
return;
|
|
2656
2672
|
}
|
|
2657
|
-
e.hidden = !1, e.replaceChildren(), e.className = "pluno-pa-widget__billing-status",
|
|
2658
|
-
|
|
2659
|
-
) :
|
|
2673
|
+
e.hidden = !1, e.replaceChildren(), e.className = "pluno-pa-widget__billing-status", de(t) || hn(n) ? e.appendChild(
|
|
2674
|
+
rr(t, n)
|
|
2675
|
+
) : Mo(t) && e.appendChild(lr(t));
|
|
2660
2676
|
}
|
|
2661
|
-
function
|
|
2677
|
+
function rr(e, t) {
|
|
2662
2678
|
const n = document.createElement("div");
|
|
2663
2679
|
n.className = "pluno-pa-widget__billing-action-card";
|
|
2664
2680
|
const o = e.limitExceeded || t === "limit_exceeded", i = document.createElement("strong");
|
|
2665
2681
|
i.textContent = o ? "Credits used up" : "Billing needs attention", n.appendChild(i);
|
|
2666
2682
|
const r = document.createElement("span");
|
|
2667
2683
|
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(
|
|
2668
|
-
|
|
2684
|
+
Oo(
|
|
2669
2685
|
e,
|
|
2670
2686
|
"Upgrade plan",
|
|
2671
2687
|
"pluno-pa-widget__billing-action-card-actions"
|
|
2672
2688
|
)
|
|
2673
2689
|
), n;
|
|
2674
2690
|
}
|
|
2675
|
-
function
|
|
2691
|
+
function lr(e) {
|
|
2676
2692
|
const t = document.createElement("div");
|
|
2677
2693
|
t.className = "pluno-pa-widget__billing-action-card pluno-pa-widget__billing-action-card--low";
|
|
2678
2694
|
const n = document.createElement("strong");
|
|
2679
2695
|
n.textContent = "Credits running low", t.appendChild(n);
|
|
2680
2696
|
const o = document.createElement("span");
|
|
2681
|
-
return o.textContent =
|
|
2682
|
-
|
|
2697
|
+
return o.textContent = sr(e) ?? "Credits are running low for this period.", t.appendChild(o), t.appendChild(
|
|
2698
|
+
Oo(
|
|
2683
2699
|
e,
|
|
2684
2700
|
"Upgrade",
|
|
2685
2701
|
"pluno-pa-widget__billing-action-card-actions"
|
|
2686
2702
|
)
|
|
2687
2703
|
), t;
|
|
2688
2704
|
}
|
|
2689
|
-
function
|
|
2690
|
-
return e !== null && (
|
|
2705
|
+
function pn(e, t) {
|
|
2706
|
+
return e !== null && (de(e) || Mo(e) || hn(t));
|
|
2691
2707
|
}
|
|
2692
|
-
function
|
|
2693
|
-
return
|
|
2708
|
+
function no(e, t, n) {
|
|
2709
|
+
return pn(t, n) || pr(t) ? !0 : !pn(e, n);
|
|
2694
2710
|
}
|
|
2695
|
-
function
|
|
2696
|
-
return e != null && (e.creditsUsed !== null || e.creditLimit !== null || e.creditsRemaining !== null ||
|
|
2711
|
+
function pr(e) {
|
|
2712
|
+
return e != null && (e.creditsUsed !== null || e.creditLimit !== null || e.creditsRemaining !== null || de(e));
|
|
2697
2713
|
}
|
|
2698
|
-
function
|
|
2714
|
+
function de(e) {
|
|
2699
2715
|
return e?.limitExceeded === !0 || !!e?.paymentIssue;
|
|
2700
2716
|
}
|
|
2701
|
-
function
|
|
2717
|
+
function hn(e) {
|
|
2702
2718
|
return e === "limit_exceeded" || e === "subscription_required" || e === "subscription_inactive" || e === "payment_issue" || e === "subscription_invalid" || e === "payment_required";
|
|
2703
2719
|
}
|
|
2704
|
-
function
|
|
2705
|
-
return !
|
|
2720
|
+
function Mo(e) {
|
|
2721
|
+
return !de(e) && e.creditLimit !== null && e.creditLimit > 0 && e.creditsRemaining !== null && e.creditsRemaining > 0 && e.creditsRemaining / e.creditLimit <= 0.2;
|
|
2706
2722
|
}
|
|
2707
|
-
function
|
|
2708
|
-
return e.creditsRemaining === null ? null : `${
|
|
2723
|
+
function sr(e) {
|
|
2724
|
+
return e.creditsRemaining === null ? null : `${dr(e.creditsRemaining)} credits left`;
|
|
2709
2725
|
}
|
|
2710
|
-
function
|
|
2726
|
+
function dr(e) {
|
|
2711
2727
|
return new Intl.NumberFormat("en-US", {
|
|
2712
2728
|
maximumFractionDigits: 0
|
|
2713
2729
|
}).format(Math.ceil(e));
|
|
2714
2730
|
}
|
|
2715
|
-
function
|
|
2731
|
+
function Oo(e, t, n) {
|
|
2716
2732
|
const o = document.createElement("div");
|
|
2717
2733
|
return o.className = n, o.appendChild(
|
|
2718
|
-
|
|
2734
|
+
oo(t, e.pricingUrl)
|
|
2719
2735
|
), o.appendChild(
|
|
2720
|
-
|
|
2736
|
+
oo("Earn credits", e.earnCreditsUrl)
|
|
2721
2737
|
), o;
|
|
2722
2738
|
}
|
|
2723
|
-
function
|
|
2739
|
+
function oo(e, t) {
|
|
2724
2740
|
const n = document.createElement("button");
|
|
2725
2741
|
if (n.type = "button", e === "Earn credits") {
|
|
2726
2742
|
const o = document.createElement("span");
|
|
@@ -2731,142 +2747,148 @@ function to(e, t) {
|
|
|
2731
2747
|
t.trim().length !== 0 && window.open(t, "_blank", "noopener,noreferrer");
|
|
2732
2748
|
}), n;
|
|
2733
2749
|
}
|
|
2734
|
-
function
|
|
2750
|
+
function Zt(e, t) {
|
|
2735
2751
|
return e.messages.filter(
|
|
2736
|
-
(o) => !
|
|
2752
|
+
(o) => !Uo(o)
|
|
2737
2753
|
).length === 0 && !e.assistantDraft && !e.lastError && !e.isThinking && !t;
|
|
2738
2754
|
}
|
|
2739
|
-
function
|
|
2740
|
-
const
|
|
2741
|
-
(x) => !
|
|
2742
|
-
),
|
|
2743
|
-
|
|
2755
|
+
function cr(e, t, n, o, i, r, l, p, s, g, c, h, C, T, I, D, u, y, m, S) {
|
|
2756
|
+
const z = mr(r), L = z.filter(
|
|
2757
|
+
(x) => !Uo(x)
|
|
2758
|
+
), oe = e.scrollTop, J = [], Re = /* @__PURE__ */ new Set(), U = (x) => {
|
|
2759
|
+
J.push(x);
|
|
2744
2760
|
};
|
|
2745
|
-
|
|
2746
|
-
const
|
|
2747
|
-
if (o(
|
|
2761
|
+
Fo(n, r.isThinking), i.hidden = !p, p && l !== null && Io(i, l);
|
|
2762
|
+
const we = L.length > 0 || !!r.assistantDraft || r.isThinking;
|
|
2763
|
+
if (o(we), u || L.length === 0 && !r.assistantDraft && !r.lastError && !r.isThinking) {
|
|
2748
2764
|
const x = document.createElement("div");
|
|
2749
|
-
x.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter" + (
|
|
2750
|
-
const
|
|
2751
|
-
|
|
2752
|
-
const
|
|
2765
|
+
x.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter" + (u ? " pluno-pa-widget__empty-state--morning-report" : "");
|
|
2766
|
+
const N = document.createElement("div");
|
|
2767
|
+
N.className = "pluno-pa-widget__empty-hero";
|
|
2768
|
+
const P = ve(
|
|
2753
2769
|
"pluno-pa-widget__character--empty",
|
|
2754
|
-
|
|
2770
|
+
T()
|
|
2755
2771
|
);
|
|
2756
|
-
if (
|
|
2757
|
-
const
|
|
2758
|
-
|
|
2772
|
+
if (N.appendChild(P), x.appendChild(N), u) {
|
|
2773
|
+
const v = document.createElement("h2");
|
|
2774
|
+
v.className = "pluno-pa-widget__empty pluno-pa-widget__morning-report-title", v.textContent = u.opening, x.appendChild(v);
|
|
2759
2775
|
} else
|
|
2760
|
-
x.appendChild(
|
|
2761
|
-
const
|
|
2762
|
-
if (
|
|
2763
|
-
for (const
|
|
2776
|
+
x.appendChild(To());
|
|
2777
|
+
const ae = u?.prompts ?? r.starterPrompts, H = document.createElement("div");
|
|
2778
|
+
if (H.className = ae.length > 0 ? "pluno-pa-widget__starter-prompts" : "pluno-pa-widget__starter-prompts pluno-pa-widget__starter-prompts--empty", ae.length === 0 && !r.starterPromptsLoading && H.setAttribute("aria-hidden", "true"), ae.length > 0)
|
|
2779
|
+
for (const v of ae) {
|
|
2764
2780
|
const R = document.createElement("button");
|
|
2765
|
-
R.type = "button", R.className = "pluno-pa-widget__starter-prompt", R.textContent = `"${
|
|
2766
|
-
|
|
2767
|
-
}),
|
|
2781
|
+
R.type = "button", R.className = "pluno-pa-widget__starter-prompt", R.textContent = `"${v}"`, R.addEventListener("click", () => {
|
|
2782
|
+
I(v);
|
|
2783
|
+
}), H.appendChild(R);
|
|
2768
2784
|
}
|
|
2769
2785
|
else if (r.starterPromptsLoading) {
|
|
2770
|
-
const
|
|
2771
|
-
|
|
2786
|
+
const v = document.createElement("button");
|
|
2787
|
+
v.type = "button", v.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder pluno-pa-widget__starter-prompt--loading", v.disabled = !0, v.tabIndex = -1, v.textContent = "Generating example tasks...", H.appendChild(v);
|
|
2772
2788
|
} else
|
|
2773
|
-
for (let
|
|
2789
|
+
for (let v = 0; v < Yi; v += 1) {
|
|
2774
2790
|
const R = document.createElement("button");
|
|
2775
|
-
R.type = "button", R.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder", R.disabled = !0, R.tabIndex = -1, R.textContent = "",
|
|
2791
|
+
R.type = "button", R.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder", R.disabled = !0, R.tabIndex = -1, R.textContent = "", H.appendChild(R);
|
|
2776
2792
|
}
|
|
2777
|
-
if (x.appendChild(
|
|
2778
|
-
const
|
|
2779
|
-
|
|
2793
|
+
if (x.appendChild(H), u) {
|
|
2794
|
+
const v = document.createElement("button");
|
|
2795
|
+
v.type = "button", v.className = "pluno-pa-widget__morning-report-snooze", v.textContent = "Snooze morning report", v.addEventListener("click", y), x.appendChild(v);
|
|
2780
2796
|
}
|
|
2781
|
-
h.clear(),
|
|
2797
|
+
h.clear(), U(x), U(t), io(e, J);
|
|
2782
2798
|
return;
|
|
2783
2799
|
}
|
|
2784
|
-
let
|
|
2785
|
-
const
|
|
2786
|
-
if (
|
|
2800
|
+
let B = null, f = null, Q = [];
|
|
2801
|
+
const De = L.length - 1, Ce = De >= 0 && sn(L[De]), Se = () => {
|
|
2802
|
+
if (Q.length === 0)
|
|
2787
2803
|
return !1;
|
|
2788
|
-
const x =
|
|
2789
|
-
|
|
2804
|
+
const x = Sr(
|
|
2805
|
+
Q,
|
|
2790
2806
|
c,
|
|
2791
|
-
|
|
2792
|
-
|
|
2807
|
+
C,
|
|
2808
|
+
T()
|
|
2793
2809
|
);
|
|
2794
|
-
return
|
|
2810
|
+
return U(x), B = null, f = x, Q = [], !0;
|
|
2795
2811
|
};
|
|
2796
|
-
for (let x = 0; x <
|
|
2797
|
-
const
|
|
2798
|
-
if (
|
|
2799
|
-
|
|
2812
|
+
for (let x = 0; x < L.length; x += 1) {
|
|
2813
|
+
const N = L[x];
|
|
2814
|
+
if (N.role === "tool") {
|
|
2815
|
+
Q.push(N);
|
|
2800
2816
|
continue;
|
|
2801
2817
|
}
|
|
2802
|
-
if (
|
|
2803
|
-
if (x !==
|
|
2818
|
+
if (sn(N)) {
|
|
2819
|
+
if (x !== De)
|
|
2804
2820
|
continue;
|
|
2805
|
-
if (
|
|
2821
|
+
if (Se()) {
|
|
2806
2822
|
const R = _t();
|
|
2807
|
-
|
|
2823
|
+
U(R), B = null, f = R;
|
|
2808
2824
|
} else {
|
|
2809
|
-
const R =
|
|
2810
|
-
|
|
2825
|
+
const R = po(T());
|
|
2826
|
+
U(R), B = null, f = R;
|
|
2811
2827
|
}
|
|
2812
2828
|
continue;
|
|
2813
2829
|
}
|
|
2814
|
-
if (
|
|
2830
|
+
if (N.role === "system") {
|
|
2831
|
+
if (N.dataType === "run_error" || N.dataType === "run_status") {
|
|
2832
|
+
Se();
|
|
2833
|
+
const v = document.createElement("div");
|
|
2834
|
+
v.className = "pluno-pa-widget__error", v.textContent = lo(N.content), U(v), B = v, f = null;
|
|
2835
|
+
}
|
|
2815
2836
|
continue;
|
|
2816
|
-
const j = $(), V = yr(E.content);
|
|
2817
|
-
if (E.role === "assistant" && !j) {
|
|
2818
|
-
const P = zo(v());
|
|
2819
|
-
z(P), w = null, O = P;
|
|
2820
2837
|
}
|
|
2821
|
-
const
|
|
2822
|
-
|
|
2838
|
+
const P = Se(), ae = lo(N.content);
|
|
2839
|
+
if (N.role === "assistant" && !P) {
|
|
2840
|
+
const v = Bo(T());
|
|
2841
|
+
U(v), B = null, f = v;
|
|
2842
|
+
}
|
|
2843
|
+
const H = ur(N, ae, h, Re);
|
|
2844
|
+
U(H), B = H, f = null;
|
|
2823
2845
|
}
|
|
2824
|
-
const
|
|
2825
|
-
if (r.isThinking && !
|
|
2826
|
-
if (
|
|
2846
|
+
const j = Se(), it = L[L.length - 1]?.id === "assistant-draft";
|
|
2847
|
+
if (r.isThinking && !it && !Ce)
|
|
2848
|
+
if (j) {
|
|
2827
2849
|
const x = _t();
|
|
2828
|
-
|
|
2850
|
+
U(x), B = null, f = x;
|
|
2829
2851
|
} else {
|
|
2830
|
-
const x =
|
|
2831
|
-
|
|
2852
|
+
const x = po(T());
|
|
2853
|
+
U(x), B = null, f = x;
|
|
2832
2854
|
}
|
|
2833
2855
|
if (r.lastError) {
|
|
2834
2856
|
const x = document.createElement("div");
|
|
2835
2857
|
x.className = "pluno-pa-widget__error";
|
|
2836
|
-
const
|
|
2837
|
-
if (
|
|
2838
|
-
const
|
|
2839
|
-
|
|
2858
|
+
const N = document.createElement("span");
|
|
2859
|
+
if (N.textContent = r.lastError, x.appendChild(N), r.lastErrorCode === "run_recovery_exhausted" || r.lastErrorCode === "transient_model_error" || r.lastErrorCode === "run_still_active" || r.lastErrorCode === "connection_failed") {
|
|
2860
|
+
const P = document.createElement("button");
|
|
2861
|
+
P.type = "button", P.className = "pluno-pa-widget__error-retry", P.textContent = "Try again", P.addEventListener(
|
|
2840
2862
|
"click",
|
|
2841
|
-
r.lastErrorCode === "connection_failed" ? m :
|
|
2842
|
-
), x.appendChild(
|
|
2863
|
+
r.lastErrorCode === "connection_failed" ? m : D
|
|
2864
|
+
), x.appendChild(P);
|
|
2843
2865
|
}
|
|
2844
|
-
|
|
2866
|
+
U(x), B = x, f = null;
|
|
2845
2867
|
}
|
|
2846
|
-
const
|
|
2847
|
-
if (
|
|
2848
|
-
const x =
|
|
2849
|
-
isDrafting:
|
|
2850
|
-
error:
|
|
2851
|
-
characterIconOptions:
|
|
2852
|
-
onDraft:
|
|
2853
|
-
onDismiss:
|
|
2854
|
-
onDisable:
|
|
2868
|
+
const ie = S && !r.isThinking ? fi(z) : null;
|
|
2869
|
+
if (S && ie && !S.dismissedCandidateIds.has(ie.id)) {
|
|
2870
|
+
const x = br(ie, {
|
|
2871
|
+
isDrafting: S.draftingCandidateId === ie.id,
|
|
2872
|
+
error: S.error,
|
|
2873
|
+
characterIconOptions: S.characterIconOptions,
|
|
2874
|
+
onDraft: S.onDraft,
|
|
2875
|
+
onDismiss: S.onDismiss,
|
|
2876
|
+
onDisable: S.onDisable
|
|
2855
2877
|
});
|
|
2856
|
-
|
|
2878
|
+
U(x), S.onSeen(ie), B = null, f = x;
|
|
2857
2879
|
}
|
|
2858
|
-
|
|
2880
|
+
B?.classList.add("pluno-pa-widget__message--bottom-reserve"), f?.classList.add("pluno-pa-widget__bottom-reserve-compact"), U(t), hr(h, Re), io(e, J), s ? nt(e, g) : e.scrollTop = oe;
|
|
2859
2881
|
}
|
|
2860
|
-
function
|
|
2861
|
-
const i =
|
|
2882
|
+
function ur(e, t, n, o) {
|
|
2883
|
+
const i = gr(e, t), r = i ? n.get(i) : void 0;
|
|
2862
2884
|
if (i && r)
|
|
2863
2885
|
return r.classList.remove("pluno-pa-widget__message--bottom-reserve"), o.add(i), r;
|
|
2864
2886
|
const l = document.createElement("div");
|
|
2865
|
-
l.className = `pluno-pa-widget__message pluno-pa-widget__message--${e.role}`, e.role === "assistant" ?
|
|
2887
|
+
l.className = `pluno-pa-widget__message pluno-pa-widget__message--${e.role}`, e.role === "assistant" ? kr(l, t) : l.textContent = t, e.role === "user" && e.attachments?.length && l.appendChild(fr(e.attachments));
|
|
2866
2888
|
const p = document.createElement("div");
|
|
2867
|
-
return p.className = "pluno-pa-widget__message-actions", p.appendChild(
|
|
2889
|
+
return p.className = "pluno-pa-widget__message-actions", p.appendChild(wr(t)), l.appendChild(p), i && (n.set(i, l), o.add(i)), l;
|
|
2868
2890
|
}
|
|
2869
|
-
function
|
|
2891
|
+
function gr(e, t) {
|
|
2870
2892
|
return e.role !== "user" || !e.attachments?.length ? null : JSON.stringify({
|
|
2871
2893
|
id: e.id,
|
|
2872
2894
|
content: t,
|
|
@@ -2884,11 +2906,11 @@ function dr(e, t) {
|
|
|
2884
2906
|
})
|
|
2885
2907
|
});
|
|
2886
2908
|
}
|
|
2887
|
-
function
|
|
2909
|
+
function hr(e, t) {
|
|
2888
2910
|
for (const n of e.keys())
|
|
2889
2911
|
t.has(n) || e.delete(n);
|
|
2890
2912
|
}
|
|
2891
|
-
function
|
|
2913
|
+
function io(e, t) {
|
|
2892
2914
|
let n = e.firstChild;
|
|
2893
2915
|
for (const o of t) {
|
|
2894
2916
|
if (o === n) {
|
|
@@ -2902,7 +2924,7 @@ function no(e, t) {
|
|
|
2902
2924
|
n = n.nextSibling, e.removeChild(o);
|
|
2903
2925
|
}
|
|
2904
2926
|
}
|
|
2905
|
-
function
|
|
2927
|
+
function mr(e) {
|
|
2906
2928
|
if (!e.assistantDraft)
|
|
2907
2929
|
return [...e.messages];
|
|
2908
2930
|
const t = {
|
|
@@ -2922,7 +2944,7 @@ function ur(e) {
|
|
|
2922
2944
|
if (n === -1)
|
|
2923
2945
|
return [...e.messages, t];
|
|
2924
2946
|
const o = e.messages.findIndex(
|
|
2925
|
-
(r, l) => l > n && r.role !== "user" && r.respondsToUserMessageId === t.respondsToUserMessageId &&
|
|
2947
|
+
(r, l) => l > n && r.role !== "user" && r.respondsToUserMessageId === t.respondsToUserMessageId && ao(r, t) && sn(r)
|
|
2926
2948
|
);
|
|
2927
2949
|
if (o !== -1)
|
|
2928
2950
|
return [
|
|
@@ -2931,7 +2953,7 @@ function ur(e) {
|
|
|
2931
2953
|
...e.messages.slice(o + 1)
|
|
2932
2954
|
];
|
|
2933
2955
|
let i = n + 1;
|
|
2934
|
-
for (; i < e.messages.length && e.messages[i].role !== "user" && e.messages[i].respondsToUserMessageId === t.respondsToUserMessageId &&
|
|
2956
|
+
for (; i < e.messages.length && e.messages[i].role !== "user" && e.messages[i].respondsToUserMessageId === t.respondsToUserMessageId && ao(e.messages[i], t); )
|
|
2935
2957
|
i += 1;
|
|
2936
2958
|
return [
|
|
2937
2959
|
...e.messages.slice(0, i),
|
|
@@ -2939,21 +2961,21 @@ function ur(e) {
|
|
|
2939
2961
|
...e.messages.slice(i)
|
|
2940
2962
|
];
|
|
2941
2963
|
}
|
|
2942
|
-
function
|
|
2964
|
+
function sn(e) {
|
|
2943
2965
|
return e.role === "system" && e.dataType === "run_status" && e.loading === !0;
|
|
2944
2966
|
}
|
|
2945
|
-
function
|
|
2967
|
+
function ao(e, t) {
|
|
2946
2968
|
return !e.runId || !t.runId ? !0 : e.runId === t.runId;
|
|
2947
2969
|
}
|
|
2948
|
-
function
|
|
2949
|
-
e.replaceChildren(),
|
|
2970
|
+
function ro(e, t, n, o, i, r, l, p) {
|
|
2971
|
+
e.replaceChildren(), Fo(t, !1), t.disabled = !0, n(!1);
|
|
2950
2972
|
const s = document.createElement("div");
|
|
2951
2973
|
s.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter";
|
|
2952
|
-
const
|
|
2974
|
+
const g = ve(
|
|
2953
2975
|
"pluno-pa-widget__character--empty",
|
|
2954
2976
|
o()
|
|
2955
2977
|
);
|
|
2956
|
-
s.appendChild(
|
|
2978
|
+
s.appendChild(g);
|
|
2957
2979
|
const c = document.createElement("div");
|
|
2958
2980
|
if (c.className = "pluno-pa-widget__empty", c.textContent = i, s.appendChild(c), l) {
|
|
2959
2981
|
const h = document.createElement("a");
|
|
@@ -2964,25 +2986,25 @@ function io(e, t, n, o, i, r, l, p) {
|
|
|
2964
2986
|
}
|
|
2965
2987
|
e.appendChild(s);
|
|
2966
2988
|
}
|
|
2967
|
-
function
|
|
2989
|
+
function fr(e) {
|
|
2968
2990
|
const t = document.createElement("div");
|
|
2969
2991
|
t.className = "pluno-pa-widget__message-attachments";
|
|
2970
2992
|
for (const n of e)
|
|
2971
|
-
t.appendChild(
|
|
2993
|
+
t.appendChild(or(n));
|
|
2972
2994
|
return t;
|
|
2973
2995
|
}
|
|
2974
|
-
function
|
|
2996
|
+
function wr(e) {
|
|
2975
2997
|
const t = document.createElement("button");
|
|
2976
|
-
return t.type = "button", t.className = "pluno-pa-widget__message-copy", t.setAttribute("aria-label", "Copy message"), t.title = "Copy message", t.appendChild(
|
|
2998
|
+
return t.type = "button", t.className = "pluno-pa-widget__message-copy", t.setAttribute("aria-label", "Copy message"), t.title = "Copy message", t.appendChild(er()), t.addEventListener("click", (n) => {
|
|
2977
2999
|
n.preventDefault(), n.stopPropagation(), navigator.clipboard.writeText(e);
|
|
2978
3000
|
}), t;
|
|
2979
3001
|
}
|
|
2980
|
-
function
|
|
3002
|
+
function br(e, t) {
|
|
2981
3003
|
const n = document.createElement("article");
|
|
2982
3004
|
n.className = "pluno-pa-widget__share-prompt";
|
|
2983
3005
|
const o = document.createElement("div");
|
|
2984
3006
|
o.className = "pluno-pa-widget__share-prompt-body", o.appendChild(
|
|
2985
|
-
|
|
3007
|
+
ve(
|
|
2986
3008
|
"pluno-pa-widget__share-prompt-icon",
|
|
2987
3009
|
t.characterIconOptions
|
|
2988
3010
|
)
|
|
@@ -3001,10 +3023,10 @@ function mr(e, t) {
|
|
|
3001
3023
|
p.className = "pluno-pa-widget__share-prompt-actions";
|
|
3002
3024
|
const s = document.createElement("div");
|
|
3003
3025
|
s.className = "pluno-pa-widget__share-prompt-primary-actions";
|
|
3004
|
-
const
|
|
3005
|
-
if (
|
|
3026
|
+
const g = document.createElement("button");
|
|
3027
|
+
if (g.type = "button", g.disabled = t.isDrafting, g.addEventListener("click", () => {
|
|
3006
3028
|
t.onDraft(e);
|
|
3007
|
-
}), t.isDrafting ? (
|
|
3029
|
+
}), t.isDrafting ? (g.appendChild(dn()), g.appendChild(document.createTextNode("Drafting..."))) : g.textContent = "Draft a social post", s.appendChild(g), t.isDrafting)
|
|
3008
3030
|
p.appendChild(s);
|
|
3009
3031
|
else {
|
|
3010
3032
|
const c = document.createElement("button");
|
|
@@ -3018,10 +3040,10 @@ function mr(e, t) {
|
|
|
3018
3040
|
}
|
|
3019
3041
|
return o.appendChild(p), n.appendChild(o), n;
|
|
3020
3042
|
}
|
|
3021
|
-
function
|
|
3043
|
+
function _r(e, t) {
|
|
3022
3044
|
const n = document.createElement("div");
|
|
3023
|
-
n.className = "pluno-pa-widget__share-dialog-backdrop", n.addEventListener("click", (
|
|
3024
|
-
|
|
3045
|
+
n.className = "pluno-pa-widget__share-dialog-backdrop", n.addEventListener("click", (u) => {
|
|
3046
|
+
u.target === n && t.onClose();
|
|
3025
3047
|
});
|
|
3026
3048
|
const o = document.createElement("section");
|
|
3027
3049
|
o.className = "pluno-pa-widget__share-dialog", o.setAttribute("role", "dialog"), o.setAttribute("aria-modal", "true"), o.setAttribute("aria-label", "Draft a social post");
|
|
@@ -3033,56 +3055,56 @@ function fr(e, t) {
|
|
|
3033
3055
|
p.className = "pluno-pa-widget__share-dialog-status", p.hidden = !0;
|
|
3034
3056
|
const s = document.createElement("div");
|
|
3035
3057
|
s.className = "pluno-pa-widget__share-dialog-step";
|
|
3036
|
-
const
|
|
3037
|
-
|
|
3058
|
+
const g = document.createElement("div");
|
|
3059
|
+
g.className = "pluno-pa-widget__share-dialog-step-header";
|
|
3038
3060
|
const c = document.createElement("strong");
|
|
3039
|
-
c.textContent = "1) Copy Screenshot",
|
|
3040
|
-
const h =
|
|
3061
|
+
c.textContent = "1) Copy Screenshot", g.appendChild(c);
|
|
3062
|
+
const h = xr(
|
|
3041
3063
|
"Copy Screenshot",
|
|
3042
3064
|
async () => {
|
|
3043
3065
|
try {
|
|
3044
|
-
return await
|
|
3066
|
+
return await wi(e.screenshotDataUrl ?? ""), p.textContent = "", p.hidden = !0, !0;
|
|
3045
3067
|
} catch {
|
|
3046
3068
|
return p.textContent = "Could not copy screenshot.", p.hidden = !1, !1;
|
|
3047
3069
|
}
|
|
3048
3070
|
}
|
|
3049
3071
|
);
|
|
3050
|
-
if (
|
|
3051
|
-
const
|
|
3052
|
-
|
|
3072
|
+
if (g.appendChild(h), s.appendChild(g), e.screenshotDataUrl) {
|
|
3073
|
+
const u = document.createElement("div");
|
|
3074
|
+
u.className = "pluno-pa-widget__share-dialog-screenshot";
|
|
3053
3075
|
const y = document.createElement("img");
|
|
3054
|
-
y.src = e.screenshotDataUrl, y.alt = "Product page with Pluno open",
|
|
3076
|
+
y.src = e.screenshotDataUrl, y.alt = "Product page with Pluno open", u.appendChild(y), s.appendChild(u);
|
|
3055
3077
|
}
|
|
3056
3078
|
o.appendChild(s), o.appendChild(p);
|
|
3057
|
-
const
|
|
3058
|
-
|
|
3059
|
-
const
|
|
3060
|
-
|
|
3061
|
-
const
|
|
3062
|
-
|
|
3063
|
-
const
|
|
3064
|
-
|
|
3065
|
-
for (const
|
|
3079
|
+
const C = document.createElement("div");
|
|
3080
|
+
C.className = "pluno-pa-widget__share-dialog-step";
|
|
3081
|
+
const T = document.createElement("strong");
|
|
3082
|
+
T.className = "pluno-pa-widget__share-dialog-step-title", T.textContent = "2) Share on", C.appendChild(T);
|
|
3083
|
+
const I = document.createElement("p");
|
|
3084
|
+
I.className = "pluno-pa-widget__share-dialog-hint", I.textContent = "Post draft opens prefilled on supported platforms.", C.appendChild(I);
|
|
3085
|
+
const D = document.createElement("footer");
|
|
3086
|
+
D.className = "pluno-pa-widget__share-dialog-platforms";
|
|
3087
|
+
for (const u of yr(e)) {
|
|
3066
3088
|
const y = document.createElement("a");
|
|
3067
|
-
y.href =
|
|
3089
|
+
y.href = u.href, y.target = "_blank", y.rel = "noopener noreferrer", y.title = u.label, y.setAttribute("aria-label", `Open ${u.label}`), y.appendChild(vr(u.id)), D.appendChild(y);
|
|
3068
3090
|
}
|
|
3069
|
-
if (
|
|
3070
|
-
const
|
|
3071
|
-
|
|
3091
|
+
if (C.appendChild(D), o.appendChild(C), t.socialPostRewardsUrl) {
|
|
3092
|
+
const u = document.createElement("div");
|
|
3093
|
+
u.className = "pluno-pa-widget__share-dialog-step";
|
|
3072
3094
|
const y = document.createElement("strong");
|
|
3073
|
-
y.className = "pluno-pa-widget__share-dialog-step-title", y.textContent = "3) Submit post to get 2000 free credits!",
|
|
3095
|
+
y.className = "pluno-pa-widget__share-dialog-step-title", y.textContent = "3) Submit post to get 2000 free credits!", u.appendChild(y);
|
|
3074
3096
|
const m = document.createElement("a");
|
|
3075
|
-
m.className = "pluno-pa-widget__share-dialog-reward-link", m.href = t.socialPostRewardsUrl, m.target = "_blank", m.rel = "noopener noreferrer", m.appendChild(document.createTextNode("Submit post URL")), m.appendChild(
|
|
3097
|
+
m.className = "pluno-pa-widget__share-dialog-reward-link", m.href = t.socialPostRewardsUrl, m.target = "_blank", m.rel = "noopener noreferrer", m.appendChild(document.createTextNode("Submit post URL")), m.appendChild(Cr()), u.appendChild(m), o.appendChild(u);
|
|
3076
3098
|
}
|
|
3077
3099
|
return n.appendChild(o), n;
|
|
3078
3100
|
}
|
|
3079
|
-
function
|
|
3101
|
+
function xr(e, t) {
|
|
3080
3102
|
const n = document.createElement("button");
|
|
3081
3103
|
return n.type = "button", n.className = "pluno-pa-widget__share-dialog-copy", n.textContent = e, n.addEventListener("click", async (o) => {
|
|
3082
3104
|
o.preventDefault(), o.stopPropagation(), await t() && (n.textContent = "Copied ✓");
|
|
3083
3105
|
}), n;
|
|
3084
3106
|
}
|
|
3085
|
-
function
|
|
3107
|
+
function yr(e) {
|
|
3086
3108
|
const t = e.linkedinPost.trim(), n = e.xPost.trim();
|
|
3087
3109
|
return [
|
|
3088
3110
|
{
|
|
@@ -3102,87 +3124,87 @@ function br(e) {
|
|
|
3102
3124
|
}
|
|
3103
3125
|
];
|
|
3104
3126
|
}
|
|
3105
|
-
function
|
|
3127
|
+
function vr(e) {
|
|
3106
3128
|
const t = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
3107
|
-
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" ? (
|
|
3129
|
+
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" ? (G(t, "M6.7 13.2c.4 4.1.2 8.1.1 12.3"), G(
|
|
3108
3130
|
t,
|
|
3109
3131
|
"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"
|
|
3110
|
-
),
|
|
3132
|
+
), G(t, "M14.4 13.3c.1 3.8.1 7.8 0 11.9"), G(
|
|
3111
3133
|
t,
|
|
3112
3134
|
"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"
|
|
3113
|
-
),
|
|
3135
|
+
), G(t, "M20 18c.1 2.2.1 4.7 0 7.2"), t) : e === "x" ? (G(t, "M7.2 7.4c5.6 6.4 10.9 12.2 17.7 17.2"), G(t, "M24.4 7.2c-5.1 6.3-10.6 11.8-17 17.8"), G(t, "M9.1 8.2c5.1 5.6 9.7 10.8 15 15.5", "0.55"), t) : (G(
|
|
3114
3136
|
t,
|
|
3115
3137
|
"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"
|
|
3116
|
-
),
|
|
3138
|
+
), G(
|
|
3117
3139
|
t,
|
|
3118
3140
|
"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",
|
|
3119
3141
|
"0.48"
|
|
3120
|
-
),
|
|
3142
|
+
), G(
|
|
3121
3143
|
t,
|
|
3122
3144
|
"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"
|
|
3123
|
-
),
|
|
3145
|
+
), G(
|
|
3124
3146
|
t,
|
|
3125
3147
|
"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"
|
|
3126
3148
|
), t);
|
|
3127
3149
|
}
|
|
3128
|
-
function
|
|
3150
|
+
function G(e, t, n) {
|
|
3129
3151
|
const o = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
3130
3152
|
o.setAttribute("d", t), n && o.setAttribute("opacity", n), e.appendChild(o);
|
|
3131
3153
|
}
|
|
3132
|
-
function
|
|
3154
|
+
function Cr() {
|
|
3133
3155
|
const e = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
3134
|
-
return e.setAttribute("class", "pluno-pa-widget__share-dialog-external-icon"), e.setAttribute("viewBox", "0 0 24 24"), e.setAttribute("aria-hidden", "true"),
|
|
3156
|
+
return e.setAttribute("class", "pluno-pa-widget__share-dialog-external-icon"), e.setAttribute("viewBox", "0 0 24 24"), e.setAttribute("aria-hidden", "true"), G(e, "M14 5h5v5"), G(e, "M19 5l-8 8"), G(
|
|
3135
3157
|
e,
|
|
3136
3158
|
"M18 13v5a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1h5"
|
|
3137
3159
|
), e;
|
|
3138
3160
|
}
|
|
3139
|
-
function
|
|
3140
|
-
return e.role === "tool" && e.toolName ===
|
|
3161
|
+
function Uo(e) {
|
|
3162
|
+
return e.role === "tool" && e.toolName === wo;
|
|
3141
3163
|
}
|
|
3142
|
-
function
|
|
3164
|
+
function lo(e) {
|
|
3143
3165
|
return e.replace(/\uE200[^\uE201]*(?:\uE201|$)/g, "");
|
|
3144
3166
|
}
|
|
3145
|
-
function
|
|
3167
|
+
function Sr(e, t, n, o) {
|
|
3146
3168
|
const i = document.createElement("article");
|
|
3147
3169
|
i.className = "pluno-pa-widget__tool-group", i.title = new Date(
|
|
3148
3170
|
e[e.length - 1].createdAt
|
|
3149
3171
|
).toLocaleString(), i.appendChild(
|
|
3150
|
-
|
|
3172
|
+
ve(
|
|
3151
3173
|
"pluno-pa-widget__character--tool-group",
|
|
3152
3174
|
o
|
|
3153
3175
|
)
|
|
3154
3176
|
);
|
|
3155
|
-
const r = document.createElement("details"), l =
|
|
3177
|
+
const r = document.createElement("details"), l = Er(e);
|
|
3156
3178
|
r.open = t.has(l), i.classList.toggle("pluno-pa-widget__tool-group--open", r.open), r.addEventListener("toggle", () => {
|
|
3157
3179
|
i.classList.toggle("pluno-pa-widget__tool-group--open", r.open), r.open ? t.add(l) : t.delete(l), n();
|
|
3158
3180
|
});
|
|
3159
3181
|
const p = document.createElement("summary");
|
|
3160
|
-
p.className = "pluno-pa-widget__tool-summary", e.some((c) => c.loading) && p.appendChild(
|
|
3161
|
-
const
|
|
3162
|
-
if (
|
|
3182
|
+
p.className = "pluno-pa-widget__tool-summary", e.some((c) => c.loading) && p.appendChild(dn());
|
|
3183
|
+
const g = document.createElement("span");
|
|
3184
|
+
if (g.className = "pluno-pa-widget__tool-summary-title", g.textContent = e[e.length - 1].content || "Run tool", p.appendChild(g), r.appendChild(p), e.length > 0) {
|
|
3163
3185
|
const c = document.createElement("div");
|
|
3164
3186
|
c.className = "pluno-pa-widget__tool-lines";
|
|
3165
3187
|
for (const h of e) {
|
|
3166
|
-
const
|
|
3167
|
-
|
|
3168
|
-
const
|
|
3169
|
-
|
|
3188
|
+
const C = document.createElement("div");
|
|
3189
|
+
C.className = "pluno-pa-widget__tool-line", h.loading && C.appendChild(dn());
|
|
3190
|
+
const T = document.createElement("span");
|
|
3191
|
+
T.textContent = h.content || "Run tool", C.appendChild(T), c.appendChild(C);
|
|
3170
3192
|
}
|
|
3171
3193
|
r.appendChild(c);
|
|
3172
3194
|
}
|
|
3173
3195
|
return i.appendChild(r), i;
|
|
3174
3196
|
}
|
|
3175
|
-
function
|
|
3197
|
+
function Bo(e) {
|
|
3176
3198
|
const t = document.createElement("article");
|
|
3177
3199
|
return t.className = "pluno-pa-widget__tool-group pluno-pa-widget__assistant-marker", t.appendChild(
|
|
3178
|
-
|
|
3200
|
+
ve(
|
|
3179
3201
|
"pluno-pa-widget__character--tool-group",
|
|
3180
3202
|
e
|
|
3181
3203
|
)
|
|
3182
3204
|
), t;
|
|
3183
3205
|
}
|
|
3184
|
-
function
|
|
3185
|
-
const t =
|
|
3206
|
+
function po(e) {
|
|
3207
|
+
const t = Bo(e);
|
|
3186
3208
|
return t.classList.add("pluno-pa-widget__thinking-marker"), t.appendChild(_t()), t;
|
|
3187
3209
|
}
|
|
3188
3210
|
function _t(e = "Thinking...") {
|
|
@@ -3193,18 +3215,18 @@ function _t(e = "Thinking...") {
|
|
|
3193
3215
|
const o = document.createElement("span");
|
|
3194
3216
|
return o.textContent = e, t.appendChild(o), t;
|
|
3195
3217
|
}
|
|
3196
|
-
function
|
|
3218
|
+
function Er(e) {
|
|
3197
3219
|
return `tools:${e[0]?.id ?? ""}`;
|
|
3198
3220
|
}
|
|
3199
|
-
function
|
|
3221
|
+
function dn() {
|
|
3200
3222
|
const e = document.createElement("span");
|
|
3201
3223
|
return e.className = "pluno-pa-widget__spinner", e.setAttribute("aria-hidden", "true"), e;
|
|
3202
3224
|
}
|
|
3203
|
-
function
|
|
3204
|
-
e.setAttribute("aria-label", t ? "Stop" : "Send"), e.classList.toggle("pluno-pa-widget__send--stop", t), e.replaceChildren(t ?
|
|
3225
|
+
function Fo(e, t) {
|
|
3226
|
+
e.setAttribute("aria-label", t ? "Stop" : "Send"), e.classList.toggle("pluno-pa-widget__send--stop", t), e.replaceChildren(t ? Ja() : Do());
|
|
3205
3227
|
}
|
|
3206
|
-
function
|
|
3207
|
-
const n =
|
|
3228
|
+
function kr(e, t) {
|
|
3229
|
+
const n = Ni(t).replace(/\r\n/g, `
|
|
3208
3230
|
`).split(`
|
|
3209
3231
|
`);
|
|
3210
3232
|
let o = 0;
|
|
@@ -3219,9 +3241,9 @@ function Sr(e, t) {
|
|
|
3219
3241
|
for (o += 1; o < n.length && !/^```\s*$/.test(n[o]); )
|
|
3220
3242
|
c.push(n[o]), o += 1;
|
|
3221
3243
|
o += o < n.length ? 1 : 0;
|
|
3222
|
-
const h = document.createElement("pre"),
|
|
3223
|
-
|
|
3224
|
-
`), h.appendChild(
|
|
3244
|
+
const h = document.createElement("pre"), C = document.createElement("code");
|
|
3245
|
+
C.textContent = c.join(`
|
|
3246
|
+
`), h.appendChild(C), e.appendChild(h);
|
|
3225
3247
|
continue;
|
|
3226
3248
|
}
|
|
3227
3249
|
const l = i.match(/^(#{1,3})\s+(.+)$/);
|
|
@@ -3252,10 +3274,10 @@ function Sr(e, t) {
|
|
|
3252
3274
|
const s = [i];
|
|
3253
3275
|
for (o += 1; o < n.length && n[o].trim() && !/^```/.test(n[o]) && !/^(#{1,3})\s+/.test(n[o]) && !/^\s*[-*+]\s+/.test(n[o]) && !/^\s*\d+\.\s+/.test(n[o]); )
|
|
3254
3276
|
s.push(n[o]), o += 1;
|
|
3255
|
-
const
|
|
3277
|
+
const g = document.createElement("p");
|
|
3256
3278
|
s.forEach((c, h) => {
|
|
3257
|
-
h > 0 &&
|
|
3258
|
-
}), e.appendChild(
|
|
3279
|
+
h > 0 && g.appendChild(document.createElement("br")), gt(g, c);
|
|
3280
|
+
}), e.appendChild(g);
|
|
3259
3281
|
}
|
|
3260
3282
|
}
|
|
3261
3283
|
function gt(e, t) {
|
|
@@ -3278,7 +3300,7 @@ function gt(e, t) {
|
|
|
3278
3300
|
p.textContent = l.slice(1, -1), e.appendChild(p);
|
|
3279
3301
|
} else {
|
|
3280
3302
|
const p = l.match(/^\[([^\]]+)\]\(([^)\s]+)\)$/);
|
|
3281
|
-
if (p &&
|
|
3303
|
+
if (p && Lr(p[2])) {
|
|
3282
3304
|
const s = document.createElement("a");
|
|
3283
3305
|
s.href = p[2], s.target = "_top", s.rel = "noreferrer", s.textContent = p[1], e.appendChild(s);
|
|
3284
3306
|
} else
|
|
@@ -3288,7 +3310,7 @@ function gt(e, t) {
|
|
|
3288
3310
|
}
|
|
3289
3311
|
o < t.length && e.appendChild(document.createTextNode(t.slice(o)));
|
|
3290
3312
|
}
|
|
3291
|
-
function
|
|
3313
|
+
function Lr(e) {
|
|
3292
3314
|
if (e.startsWith("/") || e.startsWith("#"))
|
|
3293
3315
|
return !0;
|
|
3294
3316
|
try {
|
|
@@ -3298,14 +3320,20 @@ function Er(e) {
|
|
|
3298
3320
|
return !1;
|
|
3299
3321
|
}
|
|
3300
3322
|
}
|
|
3301
|
-
function
|
|
3302
|
-
if (
|
|
3323
|
+
function so(e, t) {
|
|
3324
|
+
if (Pr(e))
|
|
3303
3325
|
return;
|
|
3304
3326
|
const n = `
|
|
3305
3327
|
:host {
|
|
3306
3328
|
all: initial;
|
|
3307
3329
|
color-scheme: light;
|
|
3308
3330
|
}
|
|
3331
|
+
:host([data-pluno-product-agent-layout="page"]) {
|
|
3332
|
+
display: block;
|
|
3333
|
+
width: 100%;
|
|
3334
|
+
height: 100%;
|
|
3335
|
+
min-height: 0;
|
|
3336
|
+
}
|
|
3309
3337
|
*,
|
|
3310
3338
|
*::before,
|
|
3311
3339
|
*::after {
|
|
@@ -3352,7 +3380,7 @@ function ro(e, t) {
|
|
|
3352
3380
|
--pluno-pa-accent-contrast: #fafafa;
|
|
3353
3381
|
position: fixed;
|
|
3354
3382
|
z-index: 2147483645;
|
|
3355
|
-
font-family: ${
|
|
3383
|
+
font-family: ${pe.fontFamily};
|
|
3356
3384
|
font-size: 14px;
|
|
3357
3385
|
color: var(--pluno-pa-text);
|
|
3358
3386
|
width: var(--pluno-pa-launcher-width);
|
|
@@ -3370,6 +3398,30 @@ function ro(e, t) {
|
|
|
3370
3398
|
--pluno-pa-accent-soft: rgba(245, 245, 244, 0.22);
|
|
3371
3399
|
--pluno-pa-accent-contrast: #18181b;
|
|
3372
3400
|
}
|
|
3401
|
+
.pluno-pa-widget--layout-page {
|
|
3402
|
+
position: relative !important;
|
|
3403
|
+
inset: auto !important;
|
|
3404
|
+
width: 100%;
|
|
3405
|
+
height: 100%;
|
|
3406
|
+
min-height: 0;
|
|
3407
|
+
--pluno-pa-panel-width: 100%;
|
|
3408
|
+
--pluno-pa-panel-height: 100%;
|
|
3409
|
+
--pluno-pa-panel-offset-x: 0px;
|
|
3410
|
+
--pluno-pa-panel-offset-y: 0px;
|
|
3411
|
+
}
|
|
3412
|
+
.pluno-pa-widget--layout-page .pluno-pa-widget__launcher,
|
|
3413
|
+
.pluno-pa-widget--layout-page .pluno-pa-widget__close,
|
|
3414
|
+
.pluno-pa-widget--layout-page .pluno-pa-widget__resize-handle {
|
|
3415
|
+
display: none !important;
|
|
3416
|
+
}
|
|
3417
|
+
.pluno-pa-widget--layout-page .pluno-pa-widget__panel {
|
|
3418
|
+
inset: 0 !important;
|
|
3419
|
+
width: 100% !important;
|
|
3420
|
+
height: 100% !important;
|
|
3421
|
+
border-radius: 18px;
|
|
3422
|
+
opacity: 1;
|
|
3423
|
+
transform: none;
|
|
3424
|
+
}
|
|
3373
3425
|
.pluno-pa-widget [hidden] {
|
|
3374
3426
|
display: none !important;
|
|
3375
3427
|
}
|
|
@@ -3583,6 +3635,22 @@ function ro(e, t) {
|
|
|
3583
3635
|
padding: 0;
|
|
3584
3636
|
overflow: visible;
|
|
3585
3637
|
pointer-events: auto;
|
|
3638
|
+
isolation: isolate;
|
|
3639
|
+
}
|
|
3640
|
+
.pluno-pa-widget--minimized .pluno-pa-widget__launcher::before {
|
|
3641
|
+
content: "";
|
|
3642
|
+
position: absolute;
|
|
3643
|
+
inset: 0;
|
|
3644
|
+
z-index: -1;
|
|
3645
|
+
border: 1px solid rgba(40, 36, 20, 0.45);
|
|
3646
|
+
border-radius: 999px;
|
|
3647
|
+
background-color: #fdfaf1;
|
|
3648
|
+
background-image:
|
|
3649
|
+
linear-gradient(rgba(96, 138, 188, 0.22) 1px, transparent 1px),
|
|
3650
|
+
linear-gradient(90deg, rgba(96, 138, 188, 0.22) 1px, transparent 1px);
|
|
3651
|
+
background-size: 22px 22px;
|
|
3652
|
+
filter: url(#pluno-pa-scribble-wobble-3);
|
|
3653
|
+
pointer-events: none;
|
|
3586
3654
|
}
|
|
3587
3655
|
.pluno-pa-widget--minimized .pluno-pa-widget__launcher-input,
|
|
3588
3656
|
.pluno-pa-widget--minimized .pluno-pa-widget__launcher-drag-handle,
|
|
@@ -4434,7 +4502,7 @@ function ro(e, t) {
|
|
|
4434
4502
|
place-items: center;
|
|
4435
4503
|
padding: 18px;
|
|
4436
4504
|
background: rgba(24, 24, 27, 0.28);
|
|
4437
|
-
font-family: var(--pluno-pa-font, ${
|
|
4505
|
+
font-family: var(--pluno-pa-font, ${pe.fontFamily});
|
|
4438
4506
|
color: var(--pluno-pa-text);
|
|
4439
4507
|
}
|
|
4440
4508
|
.pluno-pa-widget__share-dialog {
|
|
@@ -5102,7 +5170,8 @@ function ro(e, t) {
|
|
|
5102
5170
|
.pluno-pa-widget__starter-prompts {
|
|
5103
5171
|
display: grid;
|
|
5104
5172
|
gap: 18px;
|
|
5105
|
-
width
|
|
5173
|
+
/* Personalized tasks should use the available chat width instead of wrapping against an arbitrary cap. */
|
|
5174
|
+
width: 100%;
|
|
5106
5175
|
}
|
|
5107
5176
|
.pluno-pa-widget__empty-state--morning-report .pluno-pa-widget__starter-prompts {
|
|
5108
5177
|
gap: 12px;
|
|
@@ -5257,8 +5326,8 @@ function ro(e, t) {
|
|
|
5257
5326
|
.pluno-pa-widget--scribble .pluno-pa-widget__scribble-spirals--panel {
|
|
5258
5327
|
position: absolute;
|
|
5259
5328
|
top: -16px;
|
|
5260
|
-
left: ${
|
|
5261
|
-
width: calc(100% - ${
|
|
5329
|
+
left: ${on}px;
|
|
5330
|
+
width: calc(100% - ${on * 2}px);
|
|
5262
5331
|
height: 36px;
|
|
5263
5332
|
z-index: 3;
|
|
5264
5333
|
filter: url(#pluno-pa-scribble-wobble-2);
|
|
@@ -5357,18 +5426,10 @@ function ro(e, t) {
|
|
|
5357
5426
|
.pluno-pa-widget--scribble .pluno-pa-widget__history-panel {
|
|
5358
5427
|
border-radius: var(--pluno-pa-scribble-wobble);
|
|
5359
5428
|
}
|
|
5360
|
-
.pluno-pa-widget--scribble.pluno-pa-widget--minimized {
|
|
5361
|
-
--pluno-pa-launcher-width: 16px;
|
|
5362
|
-
--pluno-pa-launcher-height: 24px;
|
|
5363
|
-
}
|
|
5364
|
-
.pluno-pa-widget--scribble.pluno-pa-widget--minimized .pluno-pa-widget__launcher::before,
|
|
5365
|
-
.pluno-pa-widget--scribble.pluno-pa-widget--minimized .pluno-pa-widget__launcher::after {
|
|
5366
|
-
content: none;
|
|
5367
|
-
}
|
|
5368
5429
|
.pluno-pa-widget--scribble.pluno-pa-widget--minimized .pluno-pa-widget__character--launcher {
|
|
5369
|
-
left:
|
|
5370
|
-
width:
|
|
5371
|
-
height:
|
|
5430
|
+
left: 1px;
|
|
5431
|
+
width: 20px;
|
|
5432
|
+
height: 20px;
|
|
5372
5433
|
margin-top: 0;
|
|
5373
5434
|
}
|
|
5374
5435
|
.pluno-pa-widget--scribble .pluno-pa-widget__launcher-minimize {
|
|
@@ -5508,13 +5569,24 @@ function ro(e, t) {
|
|
|
5508
5569
|
}
|
|
5509
5570
|
.pluno-pa-widget--scribble.pluno-pa-widget--minimized .pluno-pa-widget__launcher {
|
|
5510
5571
|
border: 0;
|
|
5572
|
+
border-radius: 999px;
|
|
5511
5573
|
width: var(--pluno-pa-launcher-width);
|
|
5512
5574
|
min-width: 0;
|
|
5513
5575
|
height: var(--pluno-pa-launcher-height);
|
|
5514
5576
|
min-height: 0;
|
|
5515
5577
|
padding: 0;
|
|
5516
5578
|
}
|
|
5517
|
-
.pluno-pa-widget--scribble.pluno-pa-widget--minimized .pluno-pa-widget__launcher::before
|
|
5579
|
+
.pluno-pa-widget--scribble.pluno-pa-widget--minimized .pluno-pa-widget__launcher::before {
|
|
5580
|
+
inset: 0;
|
|
5581
|
+
border: 1px solid var(--pluno-pa-divider);
|
|
5582
|
+
border-radius: 999px;
|
|
5583
|
+
background-color: var(--pluno-pa-bg);
|
|
5584
|
+
background-image:
|
|
5585
|
+
linear-gradient(var(--pluno-pa-scribble-grid-line) 1px, transparent 1px),
|
|
5586
|
+
linear-gradient(90deg, var(--pluno-pa-scribble-grid-line) 1px, transparent 1px);
|
|
5587
|
+
background-size: 22px 22px;
|
|
5588
|
+
filter: url(#pluno-pa-scribble-wobble-3);
|
|
5589
|
+
}
|
|
5518
5590
|
.pluno-pa-widget--scribble.pluno-pa-widget--minimized .pluno-pa-widget__launcher::after {
|
|
5519
5591
|
content: none;
|
|
5520
5592
|
}
|
|
@@ -5615,28 +5687,28 @@ function ro(e, t) {
|
|
|
5615
5687
|
filter: url(#pluno-pa-scribble-wobble-2);
|
|
5616
5688
|
}
|
|
5617
5689
|
`;
|
|
5618
|
-
if (
|
|
5690
|
+
if (Tr(e, n))
|
|
5619
5691
|
return;
|
|
5620
5692
|
const o = e.ownerDocument.createElement("style");
|
|
5621
|
-
o.id =
|
|
5693
|
+
o.id = ko, o.textContent = n, e.appendChild(o), Wo(e);
|
|
5622
5694
|
}
|
|
5623
|
-
function
|
|
5624
|
-
return e.getElementById(
|
|
5695
|
+
function Pr(e) {
|
|
5696
|
+
return e.getElementById(ko) !== null || e.host instanceof HTMLElement && e.host.getAttribute(Lo) === "true";
|
|
5625
5697
|
}
|
|
5626
|
-
function
|
|
5627
|
-
e.host instanceof HTMLElement && e.host.setAttribute(
|
|
5698
|
+
function Wo(e) {
|
|
5699
|
+
e.host instanceof HTMLElement && e.host.setAttribute(Lo, "true");
|
|
5628
5700
|
}
|
|
5629
|
-
function
|
|
5701
|
+
function Tr(e, t) {
|
|
5630
5702
|
if (typeof CSSStyleSheet > "u" || typeof CSSStyleSheet.prototype.replaceSync != "function" || !("adoptedStyleSheets" in e))
|
|
5631
5703
|
return !1;
|
|
5632
5704
|
try {
|
|
5633
5705
|
const n = new CSSStyleSheet();
|
|
5634
|
-
return n.replaceSync(t), e.adoptedStyleSheets = [...e.adoptedStyleSheets, n],
|
|
5706
|
+
return n.replaceSync(t), e.adoptedStyleSheets = [...e.adoptedStyleSheets, n], Wo(e), !0;
|
|
5635
5707
|
} catch {
|
|
5636
5708
|
return !1;
|
|
5637
5709
|
}
|
|
5638
5710
|
}
|
|
5639
|
-
async function
|
|
5711
|
+
async function Ir() {
|
|
5640
5712
|
return document.body ? document.body : await new Promise((e) => {
|
|
5641
5713
|
const t = new MutationObserver(() => {
|
|
5642
5714
|
document.body && (t.disconnect(), e(document.body));
|
|
@@ -5644,10 +5716,35 @@ async function Pr() {
|
|
|
5644
5716
|
t.observe(document.documentElement, { childList: !0 });
|
|
5645
5717
|
});
|
|
5646
5718
|
}
|
|
5647
|
-
function
|
|
5719
|
+
function mn(e) {
|
|
5648
5720
|
return `pluno.productAgent.widgetState.${location.origin}.${e.backendUrl ?? ""}.${e.tokenEndpoint ?? ""}.${e.position ?? ""}`;
|
|
5649
5721
|
}
|
|
5650
|
-
function
|
|
5722
|
+
function Ho(e) {
|
|
5723
|
+
return `${mn(e)}.displayState`;
|
|
5724
|
+
}
|
|
5725
|
+
function Ar(e) {
|
|
5726
|
+
try {
|
|
5727
|
+
return window.sessionStorage.getItem(
|
|
5728
|
+
Ho(e)
|
|
5729
|
+
) === "minimized" ? "minimized" : "shown";
|
|
5730
|
+
} catch {
|
|
5731
|
+
return "shown";
|
|
5732
|
+
}
|
|
5733
|
+
}
|
|
5734
|
+
function co(e, t) {
|
|
5735
|
+
if (e.layout === "floating")
|
|
5736
|
+
try {
|
|
5737
|
+
const n = Ho(e);
|
|
5738
|
+
if (t === "minimized") {
|
|
5739
|
+
window.sessionStorage.setItem(n, t);
|
|
5740
|
+
return;
|
|
5741
|
+
}
|
|
5742
|
+
window.sessionStorage.removeItem(n);
|
|
5743
|
+
} catch {
|
|
5744
|
+
return;
|
|
5745
|
+
}
|
|
5746
|
+
}
|
|
5747
|
+
function Nr(e) {
|
|
5651
5748
|
if (e)
|
|
5652
5749
|
return { clientId: e, release: () => {
|
|
5653
5750
|
} };
|
|
@@ -5655,7 +5752,7 @@ function Tr(e) {
|
|
|
5655
5752
|
for (; Ht.has(t); )
|
|
5656
5753
|
t += 1;
|
|
5657
5754
|
Ht.add(t);
|
|
5658
|
-
const n = `${
|
|
5755
|
+
const n = `${Vi}${t}`;
|
|
5659
5756
|
let o = crypto.randomUUID();
|
|
5660
5757
|
try {
|
|
5661
5758
|
o = window.sessionStorage.getItem(n) ?? o, window.sessionStorage.setItem(n, o);
|
|
@@ -5669,11 +5766,11 @@ function Tr(e) {
|
|
|
5669
5766
|
}
|
|
5670
5767
|
};
|
|
5671
5768
|
}
|
|
5672
|
-
function
|
|
5769
|
+
function Rr(e) {
|
|
5673
5770
|
try {
|
|
5674
|
-
const t = window.localStorage.getItem(
|
|
5771
|
+
const t = window.localStorage.getItem(mn(e));
|
|
5675
5772
|
if (!t)
|
|
5676
|
-
return
|
|
5773
|
+
return uo();
|
|
5677
5774
|
const n = JSON.parse(t);
|
|
5678
5775
|
return {
|
|
5679
5776
|
isOpen: n.isOpen === !0,
|
|
@@ -5683,25 +5780,25 @@ function Ir(e) {
|
|
|
5683
5780
|
openToolGroupKeys: Array.isArray(n.openToolGroupKeys) ? n.openToolGroupKeys.filter(
|
|
5684
5781
|
(o) => typeof o == "string"
|
|
5685
5782
|
) : [],
|
|
5686
|
-
launcherPosition:
|
|
5687
|
-
panelSize:
|
|
5688
|
-
seenShareCandidateIds: Array.isArray(n.seenShareCandidateIds) ? n.seenShareCandidateIds.filter((o) => typeof o == "string").slice(-
|
|
5783
|
+
launcherPosition: Or(n.launcherPosition) ? n.launcherPosition : null,
|
|
5784
|
+
panelSize: Ur(n.panelSize) ? xt(n.panelSize) : null,
|
|
5785
|
+
seenShareCandidateIds: Array.isArray(n.seenShareCandidateIds) ? n.seenShareCandidateIds.filter((o) => typeof o == "string").slice(-bo) : [],
|
|
5689
5786
|
sharePromptsDisabled: n.sharePromptsDisabled === !0
|
|
5690
5787
|
};
|
|
5691
5788
|
} catch {
|
|
5692
|
-
return
|
|
5789
|
+
return uo();
|
|
5693
5790
|
}
|
|
5694
5791
|
}
|
|
5695
|
-
async function
|
|
5792
|
+
async function Dr(e) {
|
|
5696
5793
|
if (e.loadSharePromptsDisabled)
|
|
5697
5794
|
return e.loadSharePromptsDisabled();
|
|
5698
5795
|
try {
|
|
5699
|
-
return window.localStorage.getItem(
|
|
5796
|
+
return window.localStorage.getItem(xo) === "true";
|
|
5700
5797
|
} catch {
|
|
5701
5798
|
return !1;
|
|
5702
5799
|
}
|
|
5703
5800
|
}
|
|
5704
|
-
function
|
|
5801
|
+
function zr(e, t) {
|
|
5705
5802
|
if (e.persistSharePromptsDisabled) {
|
|
5706
5803
|
Promise.resolve(e.persistSharePromptsDisabled(t)).catch(
|
|
5707
5804
|
() => {
|
|
@@ -5710,12 +5807,12 @@ function Nr(e, t) {
|
|
|
5710
5807
|
return;
|
|
5711
5808
|
}
|
|
5712
5809
|
try {
|
|
5713
|
-
t && window.localStorage.setItem(
|
|
5810
|
+
t && window.localStorage.setItem(xo, "true");
|
|
5714
5811
|
} catch {
|
|
5715
5812
|
return;
|
|
5716
5813
|
}
|
|
5717
5814
|
}
|
|
5718
|
-
function
|
|
5815
|
+
function uo() {
|
|
5719
5816
|
return {
|
|
5720
5817
|
isOpen: !1,
|
|
5721
5818
|
composerValue: "",
|
|
@@ -5728,29 +5825,29 @@ function lo() {
|
|
|
5728
5825
|
sharePromptsDisabled: !1
|
|
5729
5826
|
};
|
|
5730
5827
|
}
|
|
5731
|
-
function
|
|
5828
|
+
function Mr(e, t) {
|
|
5732
5829
|
try {
|
|
5733
5830
|
window.localStorage.setItem(
|
|
5734
|
-
|
|
5831
|
+
mn(e),
|
|
5735
5832
|
JSON.stringify(t)
|
|
5736
5833
|
);
|
|
5737
5834
|
} catch {
|
|
5738
5835
|
return;
|
|
5739
5836
|
}
|
|
5740
5837
|
}
|
|
5741
|
-
function
|
|
5838
|
+
function Or(e) {
|
|
5742
5839
|
if (!e || typeof e != "object")
|
|
5743
5840
|
return !1;
|
|
5744
5841
|
const t = e;
|
|
5745
5842
|
return Number.isFinite(t.x) && Number.isFinite(t.y) && (t.anchor === "top-left" || t.anchor === "top-right" || t.anchor === "bottom-left" || t.anchor === "bottom-right");
|
|
5746
5843
|
}
|
|
5747
|
-
function
|
|
5844
|
+
function Ur(e) {
|
|
5748
5845
|
if (!e || typeof e != "object")
|
|
5749
5846
|
return !1;
|
|
5750
5847
|
const t = e;
|
|
5751
5848
|
return typeof t.width == "number" && Number.isFinite(t.width) && typeof t.height == "number" && Number.isFinite(t.height);
|
|
5752
5849
|
}
|
|
5753
|
-
async function
|
|
5850
|
+
async function $o(e, t) {
|
|
5754
5851
|
const n = await fetch(e, {
|
|
5755
5852
|
method: "POST",
|
|
5756
5853
|
credentials: "include",
|
|
@@ -5762,7 +5859,7 @@ async function Bo(e, t) {
|
|
|
5762
5859
|
...t ? { signal: t } : {}
|
|
5763
5860
|
});
|
|
5764
5861
|
if (!n.ok) {
|
|
5765
|
-
const i = await n.text(), r =
|
|
5862
|
+
const i = await n.text(), r = si(i);
|
|
5766
5863
|
throw r ? (console.error(r), new Error(r)) : new Error(`Failed to load Pluno token (${n.status})`);
|
|
5767
5864
|
}
|
|
5768
5865
|
const o = await n.json();
|
|
@@ -5770,29 +5867,29 @@ async function Bo(e, t) {
|
|
|
5770
5867
|
throw new Error("Pluno token endpoint did not return a token");
|
|
5771
5868
|
return o.token;
|
|
5772
5869
|
}
|
|
5773
|
-
function
|
|
5870
|
+
function Br(e) {
|
|
5774
5871
|
let t = !1, n = !1;
|
|
5775
5872
|
const o = async () => {
|
|
5776
5873
|
const i = new AbortController();
|
|
5777
5874
|
let r = !1;
|
|
5778
5875
|
const l = new Promise((p, s) => {
|
|
5779
|
-
const
|
|
5780
|
-
r = !0, i.abort(), s(new Error(
|
|
5781
|
-
},
|
|
5876
|
+
const g = window.setTimeout(() => {
|
|
5877
|
+
r = !0, i.abort(), s(new Error(Bn));
|
|
5878
|
+
}, qi);
|
|
5782
5879
|
i.signal.addEventListener(
|
|
5783
5880
|
"abort",
|
|
5784
|
-
() => window.clearTimeout(
|
|
5881
|
+
() => window.clearTimeout(g),
|
|
5785
5882
|
{ once: !0 }
|
|
5786
5883
|
);
|
|
5787
5884
|
});
|
|
5788
5885
|
try {
|
|
5789
5886
|
const p = await Promise.race([
|
|
5790
|
-
|
|
5887
|
+
$o(e, i.signal),
|
|
5791
5888
|
l
|
|
5792
5889
|
]);
|
|
5793
5890
|
return i.abort(), p;
|
|
5794
5891
|
} catch (p) {
|
|
5795
|
-
throw i.abort(), r ? new Error(
|
|
5892
|
+
throw i.abort(), r ? new Error(Bn) : p instanceof Error && p.message.startsWith("Pluno widget blocked on ") ? p : new Error(ji);
|
|
5796
5893
|
}
|
|
5797
5894
|
};
|
|
5798
5895
|
return {
|
|
@@ -5815,32 +5912,32 @@ function Mr(e) {
|
|
|
5815
5912
|
}
|
|
5816
5913
|
};
|
|
5817
5914
|
}
|
|
5818
|
-
const
|
|
5819
|
-
function
|
|
5915
|
+
const go = /* @__PURE__ */ new WeakSet();
|
|
5916
|
+
function Fr(e) {
|
|
5820
5917
|
return Object.keys(e.dataset).some((t) => t.startsWith("pluno"));
|
|
5821
5918
|
}
|
|
5822
|
-
function
|
|
5919
|
+
function ho(e) {
|
|
5823
5920
|
const t = e.pathname.split("/");
|
|
5824
5921
|
return t[t.length - 1] ?? "";
|
|
5825
5922
|
}
|
|
5826
|
-
function
|
|
5923
|
+
function Wr(e, t) {
|
|
5827
5924
|
const n = new URL(e.src, document.baseURI);
|
|
5828
|
-
return n.href === t.href || n.pathname === t.pathname ? !0 :
|
|
5925
|
+
return n.href === t.href || n.pathname === t.pathname ? !0 : ho(n) === ho(t);
|
|
5829
5926
|
}
|
|
5830
|
-
class
|
|
5927
|
+
class fe extends EventTarget {
|
|
5831
5928
|
constructor(t, n) {
|
|
5832
|
-
super(), this.channelId = n, this.url = t, this.addPreviewListener(
|
|
5833
|
-
this.readyState =
|
|
5834
|
-
}), this.addPreviewListener(
|
|
5929
|
+
super(), this.channelId = n, this.url = t, this.addPreviewListener(Fi, () => {
|
|
5930
|
+
this.readyState = fe.OPEN, this.dispatchEvent(new Event("open"));
|
|
5931
|
+
}), this.addPreviewListener(Wi, (o) => {
|
|
5835
5932
|
const i = o;
|
|
5836
5933
|
this.dispatchEvent(
|
|
5837
5934
|
new MessageEvent("message", { data: i.detail?.data ?? "" })
|
|
5838
5935
|
);
|
|
5839
|
-
}), this.addPreviewListener(
|
|
5840
|
-
this.readyState =
|
|
5841
|
-
}), this.addPreviewListener(
|
|
5936
|
+
}), this.addPreviewListener(Hi, () => {
|
|
5937
|
+
this.readyState = fe.CLOSED, this.dispatchEvent(new Event("error")), this.cleanup();
|
|
5938
|
+
}), this.addPreviewListener($i, (o) => {
|
|
5842
5939
|
const i = o;
|
|
5843
|
-
this.readyState =
|
|
5940
|
+
this.readyState = fe.CLOSED, this.dispatchEvent(
|
|
5844
5941
|
new CloseEvent("close", {
|
|
5845
5942
|
code: i.detail?.code ?? 1e3,
|
|
5846
5943
|
reason: i.detail?.reason ?? "",
|
|
@@ -5850,7 +5947,7 @@ class he extends EventTarget {
|
|
|
5850
5947
|
}), window.dispatchEvent(
|
|
5851
5948
|
new CustomEvent(
|
|
5852
5949
|
ht(
|
|
5853
|
-
|
|
5950
|
+
Oi,
|
|
5854
5951
|
this.channelId
|
|
5855
5952
|
),
|
|
5856
5953
|
{
|
|
@@ -5869,18 +5966,18 @@ class he extends EventTarget {
|
|
|
5869
5966
|
extensions = "";
|
|
5870
5967
|
binaryType = "blob";
|
|
5871
5968
|
bufferedAmount = 0;
|
|
5872
|
-
readyState =
|
|
5873
|
-
socketId =
|
|
5969
|
+
readyState = fe.CONNECTING;
|
|
5970
|
+
socketId = Hr();
|
|
5874
5971
|
listeners = /* @__PURE__ */ new Map();
|
|
5875
5972
|
send(t) {
|
|
5876
|
-
if (this.readyState !==
|
|
5973
|
+
if (this.readyState !== fe.OPEN)
|
|
5877
5974
|
throw new DOMException(
|
|
5878
5975
|
"Pluno preview websocket is not open",
|
|
5879
5976
|
"InvalidStateError"
|
|
5880
5977
|
);
|
|
5881
5978
|
window.dispatchEvent(
|
|
5882
5979
|
new CustomEvent(
|
|
5883
|
-
ht(
|
|
5980
|
+
ht(Ui, this.channelId),
|
|
5884
5981
|
{
|
|
5885
5982
|
detail: {
|
|
5886
5983
|
socketId: this.socketId,
|
|
@@ -5891,9 +5988,9 @@ class he extends EventTarget {
|
|
|
5891
5988
|
);
|
|
5892
5989
|
}
|
|
5893
5990
|
close(t, n) {
|
|
5894
|
-
this.readyState !==
|
|
5991
|
+
this.readyState !== fe.CLOSED && (this.readyState = fe.CLOSING, window.dispatchEvent(
|
|
5895
5992
|
new CustomEvent(
|
|
5896
|
-
ht(
|
|
5993
|
+
ht(Bi, this.channelId),
|
|
5897
5994
|
{
|
|
5898
5995
|
detail: { socketId: this.socketId, code: t, reason: n }
|
|
5899
5996
|
}
|
|
@@ -5915,19 +6012,19 @@ class he extends EventTarget {
|
|
|
5915
6012
|
this.listeners.clear();
|
|
5916
6013
|
}
|
|
5917
6014
|
}
|
|
5918
|
-
function
|
|
6015
|
+
function Hr() {
|
|
5919
6016
|
const e = window.sessionStorage.getItem(
|
|
5920
|
-
|
|
6017
|
+
Un
|
|
5921
6018
|
);
|
|
5922
6019
|
if (e)
|
|
5923
6020
|
return e;
|
|
5924
6021
|
const t = crypto.randomUUID();
|
|
5925
|
-
return window.sessionStorage.setItem(
|
|
6022
|
+
return window.sessionStorage.setItem(Un, t), t;
|
|
5926
6023
|
}
|
|
5927
6024
|
function ht(e, t) {
|
|
5928
6025
|
return `${e}:${t}`;
|
|
5929
6026
|
}
|
|
5930
|
-
function
|
|
6027
|
+
function $r(e) {
|
|
5931
6028
|
const t = document.currentScript;
|
|
5932
6029
|
if (t instanceof HTMLScriptElement)
|
|
5933
6030
|
return [t];
|
|
@@ -5935,35 +6032,35 @@ function Fr(e) {
|
|
|
5935
6032
|
return Array.from(
|
|
5936
6033
|
document.querySelectorAll("script[type='module'][src]")
|
|
5937
6034
|
).filter(
|
|
5938
|
-
(i) => i instanceof HTMLScriptElement &&
|
|
6035
|
+
(i) => i instanceof HTMLScriptElement && Fr(i) && Wr(i, o)
|
|
5939
6036
|
);
|
|
5940
6037
|
}
|
|
5941
|
-
function
|
|
5942
|
-
for (const t of
|
|
5943
|
-
|
|
6038
|
+
function Gr(e) {
|
|
6039
|
+
for (const t of $r(e))
|
|
6040
|
+
go.has(t) || t.dataset.plunoAutoMount === "false" || (go.add(t), Go(t).catch((n) => {
|
|
5944
6041
|
console.error("Failed to mount Pluno widget", n);
|
|
5945
6042
|
}));
|
|
5946
6043
|
}
|
|
5947
|
-
function
|
|
5948
|
-
const t = window, n = t[
|
|
6044
|
+
function Go(e) {
|
|
6045
|
+
const t = window, n = t[me];
|
|
5949
6046
|
if (n) {
|
|
5950
6047
|
if (n.host === null)
|
|
5951
6048
|
return n.mountPromise.catch(() => {
|
|
5952
|
-
const s = t[
|
|
5953
|
-
return s ? s.mountPromise :
|
|
6049
|
+
const s = t[me];
|
|
6050
|
+
return s ? s.mountPromise : Go(e);
|
|
5954
6051
|
});
|
|
5955
|
-
if (
|
|
6052
|
+
if (qr(n.host))
|
|
5956
6053
|
return n.retryPendingTokenFailureOnce?.(), n.mountPromise;
|
|
5957
|
-
n.destroy?.(), delete t[
|
|
6054
|
+
n.destroy?.(), delete t[me];
|
|
5958
6055
|
}
|
|
5959
|
-
const o = e.dataset.plunoPreviewChannel, i = e.dataset.plunoTokenEndpoint, r = !e.dataset.plunoToken && !o && i ?
|
|
6056
|
+
const o = e.dataset.plunoPreviewChannel, i = e.dataset.plunoTokenEndpoint, r = !e.dataset.plunoToken && !o && i ? Br(i) : null;
|
|
5960
6057
|
let l;
|
|
5961
|
-
const p =
|
|
6058
|
+
const p = ga({
|
|
5962
6059
|
token: e.dataset.plunoToken,
|
|
5963
6060
|
tokenProvider: r?.loadToken,
|
|
5964
6061
|
tokenEndpoint: i,
|
|
5965
6062
|
backendUrl: e.dataset.plunoBackendUrl,
|
|
5966
|
-
webSocketFactory: o ?
|
|
6063
|
+
webSocketFactory: o ? ua(o) : void 0,
|
|
5967
6064
|
launcherLabel: e.dataset.plunoLauncherLabel,
|
|
5968
6065
|
accentColor: e.dataset.plunoAccentColor,
|
|
5969
6066
|
colorScheme: e.dataset.plunoColorScheme === "dark" ? "dark" : "light",
|
|
@@ -5971,29 +6068,29 @@ function Fo(e) {
|
|
|
5971
6068
|
scribbleStyle: e.dataset.plunoScribbleStyle === void 0 ? void 0 : e.dataset.plunoScribbleStyle !== "false",
|
|
5972
6069
|
position: e.dataset.plunoPosition === "bottom-left" ? "bottom-left" : "bottom-right"
|
|
5973
6070
|
}).then((s) => {
|
|
5974
|
-
if (t[
|
|
6071
|
+
if (t[me] !== l) {
|
|
5975
6072
|
s.destroy();
|
|
5976
6073
|
return;
|
|
5977
6074
|
}
|
|
5978
|
-
const
|
|
5979
|
-
|
|
5980
|
-
t[
|
|
6075
|
+
const g = s.host;
|
|
6076
|
+
g.setAttribute(_o, "true"), l.host = g, l.destroy = () => {
|
|
6077
|
+
t[me] === l && delete t[me], l.host = null, l.destroy = null, s.destroy();
|
|
5981
6078
|
};
|
|
5982
6079
|
}).catch((s) => {
|
|
5983
|
-
throw t[
|
|
6080
|
+
throw t[me] === l && delete t[me], s;
|
|
5984
6081
|
});
|
|
5985
6082
|
return l = {
|
|
5986
6083
|
mountPromise: p,
|
|
5987
6084
|
host: null,
|
|
5988
6085
|
destroy: null,
|
|
5989
6086
|
retryPendingTokenFailureOnce: r?.retryPendingFailureOnce ?? null
|
|
5990
|
-
}, t[
|
|
6087
|
+
}, t[me] = l, p;
|
|
5991
6088
|
}
|
|
5992
|
-
function
|
|
5993
|
-
return e.isConnected && e.getAttribute(
|
|
6089
|
+
function qr(e) {
|
|
6090
|
+
return e.isConnected && e.getAttribute(_o) === "true" && !!e.shadowRoot?.querySelector(".pluno-pa-widget__launcher") && !!e.shadowRoot?.querySelector(".pluno-pa-widget__panel");
|
|
5994
6091
|
}
|
|
5995
|
-
|
|
6092
|
+
Gr(import.meta.url);
|
|
5996
6093
|
export {
|
|
5997
|
-
|
|
5998
|
-
|
|
6094
|
+
ua as createProductAgentPreviewBridgeWebSocketFactory,
|
|
6095
|
+
ga as mountPlunoProductAgentWidget
|
|
5999
6096
|
};
|