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