@pluno/product-agent-web 0.1.110 → 0.1.111
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/product-agent-widget.js +1193 -1097
- package/package.json +1 -1
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { PlunoProductAgent as Si, getProductAgentOriginAccessErrorMessage as
|
|
2
|
-
const
|
|
3
|
-
function
|
|
4
|
-
const t =
|
|
5
|
-
if (
|
|
1
|
+
import { PlunoProductAgent as Si, getProductAgentOriginAccessErrorMessage as Ei } from "./product-agent-sdk.js";
|
|
2
|
+
const ki = "#7c3aed", Lt = "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", Tt = "#2c2a1e", Gn = [253, 250, 241], qn = 3.5;
|
|
3
|
+
function Lo(e) {
|
|
4
|
+
const t = To(e);
|
|
5
|
+
if (jn(dt(t), Gn) >= qn)
|
|
6
6
|
return t;
|
|
7
7
|
let o = dt(t);
|
|
8
8
|
const i = dt(Tt);
|
|
9
9
|
for (let r = 0; r < 6; r += 1)
|
|
10
|
-
if (o =
|
|
11
|
-
return
|
|
12
|
-
return
|
|
10
|
+
if (o = Ai(o, i, 0.22), jn(o, Gn) >= qn)
|
|
11
|
+
return cn(o);
|
|
12
|
+
return cn(o);
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function Li() {
|
|
15
15
|
let n = "M 280 120", o = !1, i = 0;
|
|
16
16
|
for (let r = 150; r <= 1170; r += 62) {
|
|
17
|
-
const l = (i % 3 - 1) * 18,
|
|
18
|
-
n += ` L ${
|
|
17
|
+
const l = (i % 3 - 1) * 18, s = o ? 280 - l : 1020 + l;
|
|
18
|
+
n += ` L ${s} ${r}`, o = !o, i += 1;
|
|
19
19
|
}
|
|
20
20
|
return n;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
const t =
|
|
22
|
+
function Ti(e) {
|
|
23
|
+
const t = To(e), n = un(dt(t));
|
|
24
24
|
return n > 0.86 ? {
|
|
25
25
|
top: "#ffffff",
|
|
26
26
|
middle: "#f6f6f6",
|
|
@@ -56,9 +56,9 @@ function Li(e) {
|
|
|
56
56
|
shadow: pe(t, -0.25, -0.08)
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function To(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()}` : ki;
|
|
62
62
|
}
|
|
63
63
|
function dt(e) {
|
|
64
64
|
return [
|
|
@@ -67,23 +67,23 @@ function dt(e) {
|
|
|
67
67
|
Number.parseInt(e.slice(5, 7), 16)
|
|
68
68
|
];
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function cn([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 un([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 jn(e, t) {
|
|
82
|
+
const n = un(e), o = un(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 Ai(e, t, n) {
|
|
86
|
+
const o = gn(n);
|
|
87
87
|
return [
|
|
88
88
|
e[0] + (t[0] - e[0]) * o,
|
|
89
89
|
e[1] + (t[1] - e[1]) * o,
|
|
@@ -91,17 +91,17 @@ function Ti(e, t, n) {
|
|
|
91
91
|
];
|
|
92
92
|
}
|
|
93
93
|
function pe(e, t, n) {
|
|
94
|
-
const [o, i, r] =
|
|
95
|
-
return
|
|
94
|
+
const [o, i, r] = Pi(dt(e));
|
|
95
|
+
return cn(Ii(o, gn(i + n), gn(r + t)));
|
|
96
96
|
}
|
|
97
|
-
function
|
|
98
|
-
const o = e / 255, i = t / 255, r = n / 255, l = Math.max(o, i, r),
|
|
99
|
-
if (l ===
|
|
100
|
-
return [0, 0,
|
|
101
|
-
const
|
|
102
|
-
return [(l === o ? (i - r) /
|
|
97
|
+
function Pi([e, t, n]) {
|
|
98
|
+
const o = e / 255, i = t / 255, r = n / 255, l = Math.max(o, i, r), s = Math.min(o, i, r), p = (l + s) / 2;
|
|
99
|
+
if (l === s)
|
|
100
|
+
return [0, 0, p];
|
|
101
|
+
const u = l - s, g = p > 0.5 ? u / (2 - l - s) : u / (l + s);
|
|
102
|
+
return [(l === o ? (i - r) / u + (i < r ? 6 : 0) : l === i ? (r - o) / u + 2 : (o - i) / u + 4) / 6, g, p];
|
|
103
103
|
}
|
|
104
|
-
function
|
|
104
|
+
function Ii(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;
|
|
@@ -115,19 +115,19 @@ function Jt(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 gn(e) {
|
|
119
119
|
return Math.max(0, Math.min(1, e));
|
|
120
120
|
}
|
|
121
|
-
const
|
|
122
|
-
function
|
|
121
|
+
const Ao = "suggest_share_on_socials";
|
|
122
|
+
function Ni(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 !== Ao)
|
|
126
126
|
continue;
|
|
127
|
-
const o =
|
|
127
|
+
const o = Kn(e, t, "assistant");
|
|
128
128
|
if (!o)
|
|
129
129
|
return null;
|
|
130
|
-
const i =
|
|
130
|
+
const i = Kn(e, o.index, "user");
|
|
131
131
|
return i ? {
|
|
132
132
|
id: `share:${n.callId ?? n.id}`,
|
|
133
133
|
userPrompt: i.content,
|
|
@@ -136,13 +136,13 @@ function Ii(e) {
|
|
|
136
136
|
}
|
|
137
137
|
return null;
|
|
138
138
|
}
|
|
139
|
-
async function
|
|
140
|
-
const t = await
|
|
139
|
+
async function Ri(e) {
|
|
140
|
+
const t = await Di(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 Kn(e, t, n) {
|
|
146
146
|
for (let o = t - 1; o >= 0; o -= 1) {
|
|
147
147
|
const i = e[o];
|
|
148
148
|
if (i.role === n && i.content.trim())
|
|
@@ -150,73 +150,73 @@ function jn(e, t, n) {
|
|
|
150
150
|
}
|
|
151
151
|
return null;
|
|
152
152
|
}
|
|
153
|
-
async function
|
|
153
|
+
async function Di(e) {
|
|
154
154
|
return await (await fetch(e)).blob();
|
|
155
155
|
}
|
|
156
|
-
const
|
|
157
|
-
function
|
|
156
|
+
const zi = "https://app.pluno.ai", Mi = "/api/product-agent/embed/active-users", Oi = 1800, Ui = 15e3, Bi = 250, Fi = 1e3, Wi = 3e4;
|
|
157
|
+
function Hi(e, t = {}) {
|
|
158
158
|
let n = !1, o = null, i = null, r = null;
|
|
159
159
|
const l = () => {
|
|
160
160
|
r !== null && (window.clearInterval(r), r = null);
|
|
161
|
-
},
|
|
161
|
+
}, s = (g) => {
|
|
162
162
|
n || (i !== null && window.clearTimeout(i), i = window.setTimeout(() => {
|
|
163
|
-
|
|
164
|
-
},
|
|
165
|
-
},
|
|
163
|
+
u();
|
|
164
|
+
}, qi(g)));
|
|
165
|
+
}, p = (g) => {
|
|
166
166
|
if (l(), o === null) {
|
|
167
|
-
o =
|
|
167
|
+
o = g, e(g);
|
|
168
168
|
return;
|
|
169
169
|
}
|
|
170
|
-
const h = o,
|
|
170
|
+
const h = o, x = performance.now();
|
|
171
171
|
r = window.setInterval(() => {
|
|
172
172
|
if (n) {
|
|
173
173
|
l();
|
|
174
174
|
return;
|
|
175
175
|
}
|
|
176
|
-
const
|
|
177
|
-
o = Math.round(h + (
|
|
178
|
-
},
|
|
179
|
-
},
|
|
176
|
+
const v = Math.min(1, (performance.now() - x) / Oi);
|
|
177
|
+
o = Math.round(h + (g - h) * ji(v)), e(o), v >= 1 && (o = g, e(g), l());
|
|
178
|
+
}, Bi);
|
|
179
|
+
}, u = async () => {
|
|
180
180
|
try {
|
|
181
|
-
const
|
|
181
|
+
const g = await $i(t);
|
|
182
182
|
if (n)
|
|
183
183
|
return;
|
|
184
|
-
|
|
184
|
+
p(g.count), s(g.refreshAfterMs);
|
|
185
185
|
} catch {
|
|
186
|
-
|
|
186
|
+
s(Ui);
|
|
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 $i(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(Mi, Gi(e.backendUrl ?? zi)).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 = Vn(o.count), r = Vn(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 Vn(e) {
|
|
208
208
|
return typeof e != "number" || !Number.isFinite(e) || e < 0 ? null : Math.round(e);
|
|
209
209
|
}
|
|
210
210
|
function Gi(e) {
|
|
211
211
|
return e.endsWith("/") ? e : `${e}/`;
|
|
212
212
|
}
|
|
213
|
-
function $i(e) {
|
|
214
|
-
return Math.min(Fi, Math.max(Bi, e));
|
|
215
|
-
}
|
|
216
213
|
function qi(e) {
|
|
214
|
+
return Math.min(Wi, Math.max(Fi, e));
|
|
215
|
+
}
|
|
216
|
+
function ji(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 Ki = [
|
|
220
220
|
"a[href]",
|
|
221
221
|
"button",
|
|
222
222
|
"input",
|
|
@@ -240,27 +240,27 @@ const ji = [
|
|
|
240
240
|
".pluno-pa-widget__message",
|
|
241
241
|
".timeline-item"
|
|
242
242
|
].join(",");
|
|
243
|
-
function
|
|
244
|
-
return e instanceof Element ?
|
|
243
|
+
function Vi(e, t, n) {
|
|
244
|
+
return e instanceof Element ? Yi(
|
|
245
245
|
t,
|
|
246
246
|
n,
|
|
247
|
-
e.closest(
|
|
247
|
+
e.closest(Ki) !== null
|
|
248
248
|
) : !1;
|
|
249
249
|
}
|
|
250
|
-
function
|
|
250
|
+
function Yi(e, t, n) {
|
|
251
251
|
return e === 1 && !t && !n;
|
|
252
252
|
}
|
|
253
|
-
function
|
|
253
|
+
function Xi(e, t, n) {
|
|
254
254
|
return e instanceof Node && t !== null && !t.contains(e) && !n?.contains(e);
|
|
255
255
|
}
|
|
256
|
-
function
|
|
256
|
+
function Zi(e, t = !0) {
|
|
257
257
|
if (!e || !t || !e.isConnected || e.disabled || e.readOnly)
|
|
258
258
|
return !1;
|
|
259
259
|
const n = e.getRootNode();
|
|
260
260
|
return (n instanceof ShadowRoot ? n.activeElement : e.ownerDocument.activeElement) === e ? !1 : (e.focus({ preventScroll: !0 }), !0);
|
|
261
261
|
}
|
|
262
|
-
const
|
|
263
|
-
function
|
|
262
|
+
const Ji = /(`+)(?!`)[\s\S]*?\1(?!`)/g;
|
|
263
|
+
function Qi(e) {
|
|
264
264
|
let t = "", n = "", o = null;
|
|
265
265
|
for (const i of e.split(new RegExp("(?<=\\n)"))) {
|
|
266
266
|
if (o) {
|
|
@@ -271,7 +271,7 @@ function Ji(e) {
|
|
|
271
271
|
}
|
|
272
272
|
const r = i.match(/^[ \t]{0,3}(`{3,}|~{3,})/);
|
|
273
273
|
if (r) {
|
|
274
|
-
t +=
|
|
274
|
+
t += Yn(n) + i, n = "", o = {
|
|
275
275
|
marker: r[1][0],
|
|
276
276
|
length: r[1].length
|
|
277
277
|
};
|
|
@@ -279,31 +279,31 @@ function Ji(e) {
|
|
|
279
279
|
}
|
|
280
280
|
n += i;
|
|
281
281
|
}
|
|
282
|
-
return t +
|
|
282
|
+
return t + Yn(n);
|
|
283
283
|
}
|
|
284
|
-
function
|
|
284
|
+
function Yn(e) {
|
|
285
285
|
let t = "", n = 0;
|
|
286
|
-
for (const o of e.matchAll(
|
|
286
|
+
for (const o of e.matchAll(Ji)) {
|
|
287
287
|
const i = o.index ?? 0;
|
|
288
|
-
t +=
|
|
288
|
+
t += Xn(
|
|
289
289
|
e.slice(n, i)
|
|
290
290
|
), t += o[0], n = i + o[0].length;
|
|
291
291
|
}
|
|
292
|
-
return t +
|
|
292
|
+
return t + Xn(e.slice(n));
|
|
293
293
|
}
|
|
294
|
-
function
|
|
294
|
+
function Xn(e) {
|
|
295
295
|
return e.replace(
|
|
296
296
|
/\[([^\]\n]*\S[^\]\n]*)\][ \t]+\(([^)\s]+)\)/g,
|
|
297
|
-
(t, n, o, i, r) => r[i - 1] === "!" ||
|
|
297
|
+
(t, n, o, i, r) => r[i - 1] === "!" || ea(r, i) || ta(r, i, n) ? t : `[${n}](${o})`
|
|
298
298
|
);
|
|
299
299
|
}
|
|
300
|
-
function
|
|
300
|
+
function ea(e, t) {
|
|
301
301
|
let n = 0;
|
|
302
302
|
for (let o = t - 1; e[o] === "\\"; o -= 1)
|
|
303
303
|
n += 1;
|
|
304
304
|
return n % 2 === 1;
|
|
305
305
|
}
|
|
306
|
-
function
|
|
306
|
+
function ta(e, t, n) {
|
|
307
307
|
if (n !== "x" && n !== "X")
|
|
308
308
|
return !1;
|
|
309
309
|
const o = e.lastIndexOf(`
|
|
@@ -312,7 +312,7 @@ function ea(e, t, n) {
|
|
|
312
312
|
e.slice(o, t)
|
|
313
313
|
);
|
|
314
314
|
}
|
|
315
|
-
const
|
|
315
|
+
const Po = 100, na = 1e4, oa = 5e3, ia = "product-agent:sdk-preview-socket-connect", aa = "product-agent:sdk-preview-socket-send", ra = "product-agent:sdk-preview-socket-close", la = "product-agent:sdk-preview-socket-open", sa = "product-agent:sdk-preview-socket-message", pa = "product-agent:sdk-preview-socket-error", da = "product-agent:sdk-preview-socket-closed", Zn = "product-agent:sdk-preview-socket-id", ca = "data-pluno-sdk-preview-channel", Io = "data-pluno-auto-mounted", xe = "__plunoProductAgentAutoMountOwner", ua = 1e4, ga = "Failed to load Pluno widget token", Jn = "Timed out loading Pluno widget token", ha = "pluno.productAgent.widgetClientId.", Qt = /* @__PURE__ */ new Set(), ma = "product-agent:preview-diagnostic", No = "pluno.productAgent.sharePromptsDisabled", fa = 3, Qn = 'dialog[open], [aria-modal="true"], [role="dialog"]', wa = 400, ba = 5e3, _a = 500, eo = "Close the page's popup to chat", xa = "No recent chats for this page yet.", de = {
|
|
316
316
|
launcherLabel: "Ask for anything...",
|
|
317
317
|
accentColor: "#7c3aed",
|
|
318
318
|
colorScheme: "light",
|
|
@@ -320,7 +320,7 @@ const Ao = 100, ta = 1e4, na = 5e3, oa = "product-agent:sdk-preview-socket-conne
|
|
|
320
320
|
scribbleStyle: !0,
|
|
321
321
|
position: "bottom-right",
|
|
322
322
|
movableLauncher: !0
|
|
323
|
-
},
|
|
323
|
+
}, ya = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive', to = "pluno-pa-scribble-font", Ro = 190, Do = 41, no = 22, va = 1, Ca = 48, Cn = 420, Sa = 520, Ea = 0.24, Sn = 680, ka = 800, La = 0.76, R = 8, Ue = 50, zo = "http://www.w3.org/2000/svg", hn = 26, mn = 8, Ta = 36, fn = 16, Aa = 4, oo = [
|
|
324
324
|
{
|
|
325
325
|
ellipseCx: "17.5",
|
|
326
326
|
ellipseCy: "24.5",
|
|
@@ -357,12 +357,12 @@ const Ao = 100, ta = 1e4, na = 5e3, oa = "product-agent:sdk-preview-socket-conne
|
|
|
357
357
|
path: "M18.7 26.8 C21 11.2, 7.1 1.6, 6.3 18.1",
|
|
358
358
|
pathStrokeWidth: "2.45"
|
|
359
359
|
}
|
|
360
|
-
],
|
|
361
|
-
let
|
|
362
|
-
function
|
|
360
|
+
], Pa = 11, Ia = 13, wn = 4, Mo = 10, Oo = 40, Na = "movable-launcher-position-v2", Uo = "pluno-pa-widget-styles", Bo = "data-pluno-pa-widget-styles";
|
|
361
|
+
let io = 0;
|
|
362
|
+
function Ra(e) {
|
|
363
363
|
return (t) => new ye(t, e);
|
|
364
364
|
}
|
|
365
|
-
async function
|
|
365
|
+
async function Da(e = {}) {
|
|
366
366
|
const t = {
|
|
367
367
|
layout: e.layout ?? "floating",
|
|
368
368
|
mountTarget: e.mountTarget,
|
|
@@ -434,51 +434,51 @@ async function Ra(e = {}) {
|
|
|
434
434
|
);
|
|
435
435
|
const n = document.createElement("div");
|
|
436
436
|
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(
|
|
437
|
-
|
|
437
|
+
ca,
|
|
438
438
|
t.sdkPreviewChannelId
|
|
439
439
|
);
|
|
440
440
|
const o = n.attachShadow({ mode: "open" }), i = document.createElement("div");
|
|
441
441
|
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");
|
|
442
|
-
let r =
|
|
442
|
+
let r = ao(
|
|
443
443
|
t.accentColor,
|
|
444
444
|
t.scribbleStyle
|
|
445
445
|
);
|
|
446
|
-
|
|
446
|
+
or(
|
|
447
447
|
i,
|
|
448
448
|
t.launcherLabel,
|
|
449
449
|
r,
|
|
450
450
|
t.movableLauncher,
|
|
451
451
|
t.showLauncherMinimizeButton
|
|
452
452
|
), o.appendChild(i);
|
|
453
|
-
const l =
|
|
454
|
-
|
|
455
|
-
let
|
|
456
|
-
i.classList.add(`pluno-pa-widget--${t.colorScheme}`), t.scribbleStyle && i.classList.add("pluno-pa-widget--scribble"),
|
|
453
|
+
const l = pl(t), s = t.layout === "floating" ? t.initialDisplayState ?? ll(t) : "shown";
|
|
454
|
+
Co(t, s);
|
|
455
|
+
let p = t.movableLauncher ? l.launcherPosition : null, u = p !== null, g = l.panelSize, h = null;
|
|
456
|
+
i.classList.add(`pluno-pa-widget--${t.colorScheme}`), t.scribbleStyle && i.classList.add("pluno-pa-widget--scribble"), s === "minimized" && (i.classList.add("pluno-pa-widget--minimized"), Oe(
|
|
457
457
|
i,
|
|
458
458
|
tn(
|
|
459
459
|
i,
|
|
460
|
-
|
|
460
|
+
p,
|
|
461
461
|
t.position
|
|
462
462
|
)
|
|
463
|
-
)),
|
|
463
|
+
)), vo(o, t.accentColor), ro(i, r, {
|
|
464
464
|
accentColor: t.accentColor,
|
|
465
465
|
colorScheme: t.colorScheme,
|
|
466
466
|
fontFamily: t.fontFamily,
|
|
467
467
|
scribbleStyle: t.scribbleStyle
|
|
468
468
|
});
|
|
469
|
-
const
|
|
469
|
+
const x = t.mountTarget ?? await rl(), v = x.ownerDocument, L = i.querySelector(
|
|
470
470
|
".pluno-pa-widget__launcher"
|
|
471
|
-
),
|
|
471
|
+
), D = i.querySelector(
|
|
472
472
|
".pluno-pa-widget__launcher-drag-handle"
|
|
473
473
|
), c = i.querySelector(
|
|
474
474
|
".pluno-pa-widget__launcher-input"
|
|
475
|
-
),
|
|
475
|
+
), E = i.querySelector(
|
|
476
476
|
".pluno-pa-widget__launcher-minimize"
|
|
477
|
-
), m = i.querySelector(".pluno-pa-widget__panel"),
|
|
477
|
+
), m = i.querySelector(".pluno-pa-widget__panel"), z = i.querySelector(
|
|
478
478
|
".pluno-pa-widget__scribble-spirals--panel"
|
|
479
|
-
),
|
|
479
|
+
), O = Array.from(
|
|
480
480
|
i.querySelectorAll(".pluno-pa-widget__resize-handle")
|
|
481
|
-
),
|
|
481
|
+
), P = i.querySelector(
|
|
482
482
|
".pluno-pa-widget__close"
|
|
483
483
|
), ne = i.querySelector(
|
|
484
484
|
".pluno-pa-widget__composer"
|
|
@@ -486,43 +486,43 @@ async function Ra(e = {}) {
|
|
|
486
486
|
".pluno-pa-widget__attachment-error"
|
|
487
487
|
), Xe = i.querySelector(
|
|
488
488
|
".pluno-pa-widget__billing-status"
|
|
489
|
-
),
|
|
489
|
+
), Be = i.querySelector(
|
|
490
490
|
".pluno-pa-widget__attachments"
|
|
491
491
|
), ge = i.querySelector(
|
|
492
492
|
".pluno-pa-widget__attachment-input"
|
|
493
493
|
), B = i.querySelector(
|
|
494
494
|
".pluno-pa-widget__attach"
|
|
495
|
-
),
|
|
495
|
+
), y = i.querySelector(
|
|
496
496
|
".pluno-pa-widget__input"
|
|
497
497
|
), F = i.querySelector(
|
|
498
498
|
".pluno-pa-widget__send"
|
|
499
|
-
),
|
|
499
|
+
), G = i.querySelector(
|
|
500
500
|
".pluno-pa-widget__top-actions"
|
|
501
501
|
), Z = i.querySelector(
|
|
502
502
|
".pluno-pa-widget__history"
|
|
503
|
-
),
|
|
503
|
+
), Te = i.querySelector(
|
|
504
504
|
".pluno-pa-widget__history-panel"
|
|
505
505
|
), V = i.querySelector(
|
|
506
506
|
".pluno-pa-widget__history-list"
|
|
507
507
|
), ut = i.querySelector(
|
|
508
508
|
".pluno-pa-widget__history-close"
|
|
509
|
-
),
|
|
509
|
+
), Ae = i.querySelector(
|
|
510
510
|
".pluno-pa-widget__history-status"
|
|
511
511
|
), he = i.querySelector(
|
|
512
512
|
".pluno-pa-widget__timeline-jump"
|
|
513
513
|
), me = i.querySelector(
|
|
514
514
|
".pluno-pa-widget__active-users-counter"
|
|
515
|
-
),
|
|
515
|
+
), M = i.querySelector(
|
|
516
516
|
".pluno-pa-widget__timeline"
|
|
517
517
|
), Ze = i.querySelector(
|
|
518
518
|
".pluno-pa-widget__timeline-bottom-sentinel"
|
|
519
|
-
), Ae = i.querySelector(
|
|
520
|
-
".pluno-pa-widget__notify-suggestion"
|
|
521
519
|
), Pe = i.querySelector(
|
|
520
|
+
".pluno-pa-widget__notify-suggestion"
|
|
521
|
+
), Ie = i.querySelector(
|
|
522
522
|
".pluno-pa-widget__notify-suggestion-enable"
|
|
523
|
-
),
|
|
523
|
+
), C = i.querySelector(
|
|
524
524
|
".pluno-pa-widget__notify-suggestion-later"
|
|
525
|
-
),
|
|
525
|
+
), T = i.querySelector(
|
|
526
526
|
".pluno-pa-widget__notify-suggestion-never"
|
|
527
527
|
), I = i.querySelector(
|
|
528
528
|
".pluno-pa-widget__tab-groups-suggestion"
|
|
@@ -531,34 +531,34 @@ async function Ra(e = {}) {
|
|
|
531
531
|
), oe = i.querySelector(
|
|
532
532
|
".pluno-pa-widget__tab-groups-suggestion-dismiss"
|
|
533
533
|
);
|
|
534
|
-
if (!
|
|
534
|
+
if (!L || !c || !m || !P || !ne || !W || !Xe || !Be || !ge || !B || !y || !F || !G || !Z || !Te || !V || !ut || !Ae || !he || !me || !M || !Ze)
|
|
535
535
|
throw new Error("Failed to mount Pluno widget");
|
|
536
|
-
if (t.movableLauncher && !
|
|
536
|
+
if (t.movableLauncher && !D)
|
|
537
537
|
throw new Error("Failed to mount Pluno widget drag handle");
|
|
538
|
-
B.hidden = !t.attachmentsEnabled, ge.disabled = !t.attachmentsEnabled,
|
|
539
|
-
let w = [],
|
|
540
|
-
const q = () =>
|
|
541
|
-
|
|
538
|
+
B.hidden = !t.attachmentsEnabled, ge.disabled = !t.attachmentsEnabled, ho(c), ho(y);
|
|
539
|
+
let w = [], k = null;
|
|
540
|
+
const q = () => Zi(
|
|
541
|
+
y,
|
|
542
542
|
i.classList.contains("pluno-pa-widget--open") && !t.loginRequired && !t.signupRequired && !se(t.billingStatus)
|
|
543
|
-
),
|
|
544
|
-
|
|
545
|
-
|
|
543
|
+
), Fe = () => {
|
|
544
|
+
Cr(
|
|
545
|
+
Be,
|
|
546
546
|
w,
|
|
547
547
|
(a) => {
|
|
548
548
|
w = w.filter(
|
|
549
549
|
(d, f) => f !== a
|
|
550
|
-
),
|
|
550
|
+
), Fe(), U(b.getState()), j(), q();
|
|
551
551
|
}
|
|
552
552
|
);
|
|
553
|
-
},
|
|
554
|
-
if (!t.loginRequired && !t.signupRequired && !t.token && !
|
|
553
|
+
}, Tn = t.loginRequired || t.signupRequired || t.token || t.webSocketFactory ? void 0 : t.tokenProvider ?? (t.tokenEndpoint ? async () => ii(t.tokenEndpoint) : void 0);
|
|
554
|
+
if (!t.loginRequired && !t.signupRequired && !t.token && !Tn && !t.webSocketFactory)
|
|
555
555
|
throw new Error("Pluno widget requires token or tokenEndpoint");
|
|
556
|
-
const
|
|
556
|
+
const ri = window.fetch.bind(window), Nt = sl(t.clientId);
|
|
557
557
|
let b;
|
|
558
558
|
try {
|
|
559
559
|
const a = {
|
|
560
560
|
token: t.token,
|
|
561
|
-
tokenProvider:
|
|
561
|
+
tokenProvider: Tn,
|
|
562
562
|
backendUrl: t.backendUrl,
|
|
563
563
|
metadata: () => ({
|
|
564
564
|
...t.metadata ?? {},
|
|
@@ -580,7 +580,7 @@ async function Ra(e = {}) {
|
|
|
580
580
|
} catch (a) {
|
|
581
581
|
throw Nt.release(), n.remove(), a;
|
|
582
582
|
}
|
|
583
|
-
|
|
583
|
+
x.appendChild(n), J(
|
|
584
584
|
"web-sdk.widget",
|
|
585
585
|
"Applied initial widget appearance",
|
|
586
586
|
{
|
|
@@ -590,54 +590,54 @@ async function Ra(e = {}) {
|
|
|
590
590
|
cssAccent: i.style.getPropertyValue("--pluno-pa-accent")
|
|
591
591
|
}
|
|
592
592
|
);
|
|
593
|
-
const Rt = new Set(l.openToolGroupKeys),
|
|
593
|
+
const Rt = new Set(l.openToolGroupKeys), We = new Set(
|
|
594
594
|
l.seenShareCandidateIds
|
|
595
|
-
), gt = new Set(
|
|
596
|
-
let Dt = l.sharePromptsDisabled || await
|
|
595
|
+
), gt = new Set(We);
|
|
596
|
+
let Dt = l.sharePromptsDisabled || await dl(t), ie = null, Y = !1, ht = !(t.loginRequired || t.signupRequired), Ce = !1, Ne = {
|
|
597
597
|
enabled: !0
|
|
598
|
-
},
|
|
598
|
+
}, Re = 0, An = "", X = !1, fe = !1, Se = [], zt = null, Je = null;
|
|
599
599
|
const ae = (a, d) => {
|
|
600
|
-
|
|
600
|
+
Ne = { enabled: a, reason: d };
|
|
601
601
|
}, re = () => {
|
|
602
602
|
he.hidden = !0;
|
|
603
|
-
},
|
|
603
|
+
}, li = () => {
|
|
604
604
|
he.hidden = !1;
|
|
605
|
-
},
|
|
606
|
-
ae(!0, a), re(), pt(
|
|
605
|
+
}, si = (a = "jump") => {
|
|
606
|
+
ae(!0, a), re(), pt(M, () => Ne.enabled), Re = M.scrollTop;
|
|
607
607
|
}, we = () => {
|
|
608
|
-
if (Z.hidden = t.layout === "page" || t.loginRequired,
|
|
608
|
+
if (Z.hidden = t.layout === "page" || t.loginRequired, Te.hidden = !X, Z.setAttribute("aria-expanded", String(X)), V.classList.toggle(
|
|
609
609
|
"pluno-pa-widget__history-list--center",
|
|
610
|
-
fe &&
|
|
611
|
-
), V.replaceChildren(), fe &&
|
|
610
|
+
fe && Se.length === 0
|
|
611
|
+
), V.replaceChildren(), fe && Se.length === 0) {
|
|
612
612
|
const a = document.createElement("p");
|
|
613
613
|
a.className = "pluno-pa-widget__history-loading", a.textContent = "Loading...", V.appendChild(a);
|
|
614
614
|
}
|
|
615
|
-
for (const a of
|
|
615
|
+
for (const a of Se) {
|
|
616
616
|
const d = document.createElement("button");
|
|
617
617
|
d.type = "button", d.className = "pluno-pa-widget__history-item", d.disabled = fe;
|
|
618
618
|
const f = document.createElement("span");
|
|
619
|
-
f.className = "pluno-pa-widget__history-item-title", f.textContent =
|
|
620
|
-
const
|
|
621
|
-
|
|
619
|
+
f.className = "pluno-pa-widget__history-item-title", f.textContent = er(a);
|
|
620
|
+
const S = document.createElement("time");
|
|
621
|
+
S.className = "pluno-pa-widget__history-time", S.dateTime = a.lastActiveAt, S.textContent = nr(
|
|
622
622
|
a.lastActiveAt,
|
|
623
623
|
Date.now()
|
|
624
624
|
);
|
|
625
625
|
const N = document.createElement("small");
|
|
626
|
-
N.className = "pluno-pa-widget__history-path", N.textContent =
|
|
627
|
-
X = !1, Je = null, we(), ae(!0, "newSession"), re(), b.loadSession(a.id),
|
|
626
|
+
N.className = "pluno-pa-widget__history-path", N.textContent = tr(a), d.append(f, S, N), d.addEventListener("click", () => {
|
|
627
|
+
X = !1, Je = null, we(), ae(!0, "newSession"), re(), b.loadSession(a.id), U(b.getState()), q();
|
|
628
628
|
}), V.appendChild(d);
|
|
629
629
|
}
|
|
630
|
-
if (fe &&
|
|
630
|
+
if (fe && Se.length > 0) {
|
|
631
631
|
const a = document.createElement("p");
|
|
632
632
|
a.className = "pluno-pa-widget__history-loading pluno-pa-widget__history-loading--inline", a.textContent = "Loading...", V.appendChild(a);
|
|
633
633
|
}
|
|
634
|
-
|
|
635
|
-
},
|
|
634
|
+
Ae.textContent = Je ?? (!fe && Se.length === 0 ? "No recent chats for this page yet." : ""), Ae.hidden = Ae.textContent.length === 0;
|
|
635
|
+
}, Pn = async (a) => {
|
|
636
636
|
if (!fe) {
|
|
637
637
|
fe = !0, Je = null, we();
|
|
638
638
|
try {
|
|
639
639
|
const d = await b.listSessions({ cursor: a, limit: 20 });
|
|
640
|
-
|
|
640
|
+
Se = a ? [...Se, ...d.sessions] : d.sessions, zt = d.nextCursor;
|
|
641
641
|
} catch (d) {
|
|
642
642
|
J(
|
|
643
643
|
"web-sdk.widget",
|
|
@@ -645,69 +645,69 @@ async function Ra(e = {}) {
|
|
|
645
645
|
{
|
|
646
646
|
message: d instanceof Error ? d.message : String(d)
|
|
647
647
|
}
|
|
648
|
-
), Je =
|
|
648
|
+
), Je = xa;
|
|
649
649
|
} finally {
|
|
650
650
|
fe = !1, we();
|
|
651
651
|
}
|
|
652
652
|
}
|
|
653
|
-
},
|
|
654
|
-
!zt || fe || V.scrollHeight - V.scrollTop - V.clientHeight <= 24 &&
|
|
655
|
-
},
|
|
656
|
-
Y || typeof document > "u" || (
|
|
657
|
-
},
|
|
658
|
-
|
|
653
|
+
}, pi = () => {
|
|
654
|
+
!zt || fe || V.scrollHeight - V.scrollTop - V.clientHeight <= 24 && Pn(zt);
|
|
655
|
+
}, In = () => {
|
|
656
|
+
Y || typeof document > "u" || (vo(o, t.accentColor), n.isConnected || (t.mountTarget?.isConnected ? t.mountTarget.appendChild(n) : t.mountTarget || v.body?.appendChild(n)));
|
|
657
|
+
}, Nn = new MutationObserver(In);
|
|
658
|
+
Nn.observe(v.documentElement, {
|
|
659
659
|
childList: !0,
|
|
660
660
|
subtree: !0
|
|
661
|
-
}),
|
|
661
|
+
}), In();
|
|
662
662
|
const Qe = (a = !0) => {
|
|
663
663
|
const d = At(i, a);
|
|
664
|
-
return
|
|
664
|
+
return bn(
|
|
665
665
|
i,
|
|
666
|
-
|
|
666
|
+
p ? Fo(p, d) : Ha(
|
|
667
667
|
i,
|
|
668
668
|
t.position,
|
|
669
669
|
d
|
|
670
670
|
),
|
|
671
671
|
d
|
|
672
672
|
);
|
|
673
|
-
},
|
|
674
|
-
const a =
|
|
673
|
+
}, $ = () => {
|
|
674
|
+
const a = Ya(
|
|
675
675
|
o,
|
|
676
676
|
c,
|
|
677
|
-
|
|
677
|
+
y
|
|
678
678
|
);
|
|
679
|
-
|
|
679
|
+
ul(t, {
|
|
680
680
|
isOpen: i.classList.contains("pluno-pa-widget--open"),
|
|
681
|
-
composerValue:
|
|
681
|
+
composerValue: y.value,
|
|
682
682
|
focusedInput: a,
|
|
683
683
|
focusedInputAt: a ? Date.now() : null,
|
|
684
684
|
openToolGroupKeys: [...Rt],
|
|
685
|
-
launcherPosition:
|
|
686
|
-
panelSize:
|
|
687
|
-
seenShareCandidateIds: [...
|
|
688
|
-
-
|
|
685
|
+
launcherPosition: u ? p : null,
|
|
686
|
+
panelSize: g,
|
|
687
|
+
seenShareCandidateIds: [...We].slice(
|
|
688
|
+
-Po
|
|
689
689
|
),
|
|
690
690
|
sharePromptsDisabled: Dt
|
|
691
691
|
});
|
|
692
692
|
}, mt = (a) => {
|
|
693
693
|
t.onDisplayStateChange?.(a);
|
|
694
694
|
}, et = (a, d = !0) => {
|
|
695
|
-
if (
|
|
696
|
-
i.classList.remove("pluno-pa-widget--minimized"),
|
|
695
|
+
if (Co(t, a), a === "shown") {
|
|
696
|
+
i.classList.remove("pluno-pa-widget--minimized"), L.removeAttribute("tabindex"), !i.classList.contains("pluno-pa-widget--open") && !i.classList.contains("pluno-pa-widget--closing") && tt(!1), d && mt("shown");
|
|
697
697
|
return;
|
|
698
698
|
}
|
|
699
|
-
ie !== null && (window.clearTimeout(ie), ie = null), i.classList.remove("pluno-pa-widget--open"), i.classList.remove("pluno-pa-widget--closing"), i.classList.add("pluno-pa-widget--minimized"),
|
|
699
|
+
ie !== null && (window.clearTimeout(ie), ie = null), i.classList.remove("pluno-pa-widget--open"), i.classList.remove("pluno-pa-widget--closing"), i.classList.add("pluno-pa-widget--minimized"), L.hidden = !1, m.hidden = !0, P.hidden = !0, L.tabIndex = 0, y.value = "", Oe(
|
|
700
700
|
i,
|
|
701
701
|
tn(
|
|
702
702
|
i,
|
|
703
|
-
|
|
703
|
+
p,
|
|
704
704
|
t.position
|
|
705
705
|
)
|
|
706
|
-
),
|
|
707
|
-
},
|
|
708
|
-
|
|
709
|
-
debugVersion:
|
|
710
|
-
launcherPosition:
|
|
706
|
+
), co(i), $(), d && mt("minimized");
|
|
707
|
+
}, De = (a, d = {}) => {
|
|
708
|
+
Va(a, {
|
|
709
|
+
debugVersion: Na,
|
|
710
|
+
launcherPosition: p,
|
|
711
711
|
rootClasses: i.className,
|
|
712
712
|
rootStyle: {
|
|
713
713
|
left: i.style.left,
|
|
@@ -716,39 +716,39 @@ async function Ra(e = {}) {
|
|
|
716
716
|
bottom: i.style.bottom
|
|
717
717
|
},
|
|
718
718
|
rootRect: on(i),
|
|
719
|
-
launcherRect: on(
|
|
719
|
+
launcherRect: on(L),
|
|
720
720
|
panelRect: on(m),
|
|
721
721
|
viewport: te(),
|
|
722
722
|
panelHidden: m.hidden,
|
|
723
|
-
closeHidden:
|
|
723
|
+
closeHidden: P.hidden,
|
|
724
724
|
...d
|
|
725
725
|
});
|
|
726
726
|
}, tt = (a = !0) => {
|
|
727
|
-
if (!
|
|
728
|
-
return
|
|
727
|
+
if (!p)
|
|
728
|
+
return Oe(i, null), Qe(a);
|
|
729
729
|
const d = Qe(a);
|
|
730
|
-
return
|
|
730
|
+
return Oe(i, d), De("Applied stored closed launcher position", {
|
|
731
731
|
visibleLauncherPosition: d
|
|
732
732
|
}), d;
|
|
733
733
|
}, Mt = (a, d) => {
|
|
734
734
|
if (!a || !d) {
|
|
735
|
-
|
|
735
|
+
co(i);
|
|
736
736
|
return;
|
|
737
737
|
}
|
|
738
|
-
|
|
738
|
+
Ka(i, {
|
|
739
739
|
x: a.x - d.x,
|
|
740
740
|
y: a.y - d.y
|
|
741
741
|
});
|
|
742
742
|
}, Ot = () => {
|
|
743
|
-
const a = st(
|
|
743
|
+
const a = st(g).width;
|
|
744
744
|
return t.layout === "page" && m.getBoundingClientRect().width || a;
|
|
745
|
-
},
|
|
745
|
+
}, Rn = () => {
|
|
746
746
|
if (i.classList.contains("pluno-pa-widget--minimized")) {
|
|
747
|
-
|
|
747
|
+
Oe(
|
|
748
748
|
i,
|
|
749
749
|
tn(
|
|
750
750
|
i,
|
|
751
|
-
|
|
751
|
+
p,
|
|
752
752
|
t.position
|
|
753
753
|
)
|
|
754
754
|
);
|
|
@@ -756,10 +756,10 @@ async function Ra(e = {}) {
|
|
|
756
756
|
}
|
|
757
757
|
const a = tt();
|
|
758
758
|
if (i.classList.contains("pluno-pa-widget--open") || i.classList.contains("pluno-pa-widget--closing")) {
|
|
759
|
-
en(i,
|
|
760
|
-
const d = st(
|
|
759
|
+
en(i, g);
|
|
760
|
+
const d = st(g);
|
|
761
761
|
rn(
|
|
762
|
-
|
|
762
|
+
z,
|
|
763
763
|
Ot()
|
|
764
764
|
);
|
|
765
765
|
const f = kt(
|
|
@@ -767,84 +767,84 @@ async function Ra(e = {}) {
|
|
|
767
767
|
i,
|
|
768
768
|
a,
|
|
769
769
|
t.position,
|
|
770
|
-
|
|
770
|
+
g
|
|
771
771
|
),
|
|
772
772
|
d
|
|
773
773
|
);
|
|
774
|
-
h && (h = f), Mt(f, a),
|
|
774
|
+
h && (h = f), Mt(f, a), De(
|
|
775
775
|
"Applied open panel position after viewport resize",
|
|
776
776
|
{ openPanelPosition: f }
|
|
777
777
|
);
|
|
778
|
-
} else
|
|
778
|
+
} else p && De(
|
|
779
779
|
"Applied visible launcher position after viewport resize",
|
|
780
780
|
{ visibleLauncherPosition: a }
|
|
781
781
|
);
|
|
782
782
|
};
|
|
783
|
-
let
|
|
783
|
+
let Dn = () => {
|
|
784
784
|
};
|
|
785
|
-
window.addEventListener("resize",
|
|
785
|
+
window.addEventListener("resize", Rn), t.movableLauncher && D ? (tt(), Dn = Ba({
|
|
786
786
|
root: i,
|
|
787
|
-
launcher:
|
|
788
|
-
launcherDragHandle:
|
|
787
|
+
launcher: L,
|
|
788
|
+
launcherDragHandle: D,
|
|
789
789
|
getPosition: () => Qe(),
|
|
790
790
|
setPosition: (a) => {
|
|
791
|
-
const d = a, f = At(i),
|
|
791
|
+
const d = a, f = At(i), S = bn(
|
|
792
792
|
i,
|
|
793
793
|
a,
|
|
794
794
|
f
|
|
795
795
|
);
|
|
796
|
-
|
|
797
|
-
|
|
796
|
+
p = Ga(
|
|
797
|
+
S,
|
|
798
798
|
f
|
|
799
|
-
),
|
|
799
|
+
), Oe(i, S), De("Dragging closed launcher", {
|
|
800
800
|
requestedPosition: d
|
|
801
801
|
});
|
|
802
802
|
},
|
|
803
803
|
persist: () => {
|
|
804
|
-
|
|
804
|
+
u = !0, $(), De("Persisted closed launcher drag position");
|
|
805
805
|
}
|
|
806
|
-
})) :
|
|
807
|
-
const
|
|
808
|
-
const a = st(
|
|
806
|
+
})) : Oe(i, null), en(i, g);
|
|
807
|
+
const di = () => {
|
|
808
|
+
const a = st(g), d = Qe();
|
|
809
809
|
return {
|
|
810
810
|
position: kt(
|
|
811
811
|
h ?? nn(
|
|
812
812
|
i,
|
|
813
813
|
d,
|
|
814
814
|
t.position,
|
|
815
|
-
|
|
815
|
+
g
|
|
816
816
|
),
|
|
817
817
|
a
|
|
818
818
|
),
|
|
819
819
|
size: a
|
|
820
820
|
};
|
|
821
|
-
},
|
|
822
|
-
|
|
823
|
-
|
|
821
|
+
}, ci = (a) => {
|
|
822
|
+
g = Pt(a.size), en(i, g), rn(
|
|
823
|
+
z,
|
|
824
824
|
Ot()
|
|
825
825
|
), h = kt(
|
|
826
826
|
a.position,
|
|
827
|
-
st(
|
|
827
|
+
st(g)
|
|
828
828
|
);
|
|
829
829
|
const d = Qe();
|
|
830
830
|
Mt(h, d);
|
|
831
|
-
},
|
|
831
|
+
}, ui = O.length > 0 ? Fa({
|
|
832
832
|
root: i,
|
|
833
|
-
handles:
|
|
834
|
-
getBounds:
|
|
835
|
-
setBounds:
|
|
836
|
-
persist:
|
|
833
|
+
handles: O,
|
|
834
|
+
getBounds: di,
|
|
835
|
+
setBounds: ci,
|
|
836
|
+
persist: $
|
|
837
837
|
}) : () => {
|
|
838
838
|
};
|
|
839
839
|
let Ut = !1;
|
|
840
|
-
const
|
|
840
|
+
const zn = async () => {
|
|
841
841
|
if (!(!t.billingStatusLoader || Ut)) {
|
|
842
842
|
Ut = !0;
|
|
843
843
|
try {
|
|
844
844
|
const a = await t.billingStatusLoader();
|
|
845
845
|
if (Y)
|
|
846
846
|
return;
|
|
847
|
-
|
|
847
|
+
fo(
|
|
848
848
|
t.billingStatus,
|
|
849
849
|
a,
|
|
850
850
|
b.getState().lastErrorCode
|
|
@@ -864,39 +864,39 @@ async function Ra(e = {}) {
|
|
|
864
864
|
}
|
|
865
865
|
}
|
|
866
866
|
}, be = (a = "", d = !0, f = !0) => {
|
|
867
|
-
|
|
868
|
-
|
|
867
|
+
zn(), ot && (ot = !1, Wt()), i.classList.contains("pluno-pa-widget--open") || (h = null), ie !== null && (window.clearTimeout(ie), ie = null), et("shown", !1), m.hidden = !1, P.hidden = !1, rn(
|
|
868
|
+
z,
|
|
869
869
|
Ot()
|
|
870
870
|
), i.classList.remove("pluno-pa-widget--closing");
|
|
871
|
-
const
|
|
871
|
+
const S = tt(), N = nn(
|
|
872
872
|
i,
|
|
873
|
-
|
|
873
|
+
S,
|
|
874
874
|
t.position,
|
|
875
|
-
|
|
875
|
+
g
|
|
876
876
|
);
|
|
877
|
-
if (Mt(N,
|
|
877
|
+
if (Mt(N, S), De("Opening launcher at clamped open panel position", {
|
|
878
878
|
openPanelPosition: N,
|
|
879
|
-
visibleLauncherPosition:
|
|
879
|
+
visibleLauncherPosition: S
|
|
880
880
|
}), ae(!0, "open"), re(), !d) {
|
|
881
|
-
i.classList.add("pluno-pa-widget--open"),
|
|
881
|
+
i.classList.add("pluno-pa-widget--open"), L.hidden = !0, a && (y.value = a, lt(y)), pt(M, () => Ne.enabled), Re = M.scrollTop, f && (y.focus(), y.setSelectionRange(y.value.length, y.value.length)), $(), mt("shown"), t.onPanelOpenChange?.(!0);
|
|
882
882
|
return;
|
|
883
883
|
}
|
|
884
884
|
window.requestAnimationFrame(() => {
|
|
885
|
-
i.classList.add("pluno-pa-widget--open"), a && (
|
|
886
|
-
|
|
885
|
+
i.classList.add("pluno-pa-widget--open"), a && (y.value = a, lt(y)), pt(M, () => Ne.enabled), Re = M.scrollTop, f && (y.focus(), y.setSelectionRange(y.value.length, y.value.length)), $(), mt("shown"), t.onPanelOpenChange?.(!0), ie = window.setTimeout(() => {
|
|
886
|
+
L.hidden = !0, pt(M, () => Ne.enabled), Re = M.scrollTop;
|
|
887
887
|
}, 220);
|
|
888
888
|
});
|
|
889
889
|
}, Bt = () => {
|
|
890
|
-
ie !== null && (window.clearTimeout(ie), ie = null),
|
|
891
|
-
m.hidden = !0,
|
|
890
|
+
ie !== null && (window.clearTimeout(ie), ie = null), L.hidden = !1, p && (tt(!1), De("Closing launcher at stored position")), i.classList.remove("pluno-pa-widget--open"), i.classList.add("pluno-pa-widget--closing"), $(), t.onPanelOpenChange?.(!1), ie = window.setTimeout(() => {
|
|
891
|
+
m.hidden = !0, P.hidden = !0, h = null, i.classList.remove("pluno-pa-widget--closing");
|
|
892
892
|
}, 220);
|
|
893
893
|
};
|
|
894
|
-
|
|
894
|
+
L.addEventListener("submit", (a) => {
|
|
895
895
|
a.preventDefault(), be(c.value), c.value = "";
|
|
896
|
-
}),
|
|
896
|
+
}), D?.addEventListener("click", (a) => {
|
|
897
897
|
a.preventDefault(), a.stopPropagation();
|
|
898
|
-
}),
|
|
899
|
-
a.target === c && !
|
|
898
|
+
}), L.addEventListener("click", (a) => {
|
|
899
|
+
a.target === c && !D || (be(c.value), c.value = "");
|
|
900
900
|
}), c.addEventListener("focus", () => {
|
|
901
901
|
be(c.value), c.value = "";
|
|
902
902
|
}), c.addEventListener("input", () => {
|
|
@@ -905,21 +905,21 @@ async function Ra(e = {}) {
|
|
|
905
905
|
const a = c.value;
|
|
906
906
|
be(a), c.value = "";
|
|
907
907
|
});
|
|
908
|
-
let Ft = null, ft = null,
|
|
909
|
-
const
|
|
908
|
+
let Ft = null, ft = null, ze = null;
|
|
909
|
+
const Mn = (a) => a === c || a === y, gi = (a) => {
|
|
910
910
|
if (!(a instanceof Element) || a.getRootNode() === i.getRootNode())
|
|
911
911
|
return null;
|
|
912
912
|
let d = a;
|
|
913
913
|
for (; d; ) {
|
|
914
|
-
const f = d.closest(
|
|
914
|
+
const f = d.closest(Qn);
|
|
915
915
|
if (f)
|
|
916
916
|
return f;
|
|
917
|
-
const
|
|
918
|
-
d =
|
|
917
|
+
const S = d.getRootNode();
|
|
918
|
+
d = S instanceof ShadowRoot ? S.host : null;
|
|
919
919
|
}
|
|
920
920
|
return null;
|
|
921
|
-
},
|
|
922
|
-
if (!a.isConnected || !a.matches(
|
|
921
|
+
}, hi = (a) => {
|
|
922
|
+
if (!a.isConnected || !a.matches(Qn))
|
|
923
923
|
return !1;
|
|
924
924
|
if (!(a instanceof HTMLElement))
|
|
925
925
|
return !0;
|
|
@@ -929,76 +929,76 @@ async function Ra(e = {}) {
|
|
|
929
929
|
return a.checkVisibility();
|
|
930
930
|
const d = window.getComputedStyle(a);
|
|
931
931
|
return d.display !== "none" && d.visibility !== "hidden";
|
|
932
|
-
},
|
|
933
|
-
|
|
932
|
+
}, On = (a) => {
|
|
933
|
+
He !== a && (He = a, i.classList.toggle(
|
|
934
934
|
"pluno-pa-widget--host-modal-conflict",
|
|
935
935
|
a !== null
|
|
936
|
-
),
|
|
937
|
-
const d =
|
|
938
|
-
(!d || !
|
|
939
|
-
},
|
|
940
|
-
},
|
|
941
|
-
|
|
936
|
+
), Me(), a !== null ? ze = window.setInterval(() => {
|
|
937
|
+
const d = He;
|
|
938
|
+
(!d || !hi(d)) && On(null);
|
|
939
|
+
}, _a) : ze !== null && (window.clearInterval(ze), ze = null, ft = null));
|
|
940
|
+
}, mi = () => {
|
|
941
|
+
ze !== null && (window.clearInterval(ze), ze = null);
|
|
942
942
|
};
|
|
943
943
|
i.addEventListener("focusin", (a) => {
|
|
944
|
-
|
|
944
|
+
Mn(a.target) && (Ft = Date.now(), $());
|
|
945
945
|
}), i.addEventListener("focusout", (a) => {
|
|
946
|
-
if (!
|
|
946
|
+
if (!Mn(a.target) || He !== null)
|
|
947
947
|
return;
|
|
948
948
|
const d = Ft;
|
|
949
|
-
if (Ft = null, d === null || Date.now() - d >
|
|
949
|
+
if (Ft = null, d === null || Date.now() - d > wa)
|
|
950
950
|
return;
|
|
951
|
-
const f =
|
|
951
|
+
const f = gi(a.relatedTarget);
|
|
952
952
|
if (!f)
|
|
953
953
|
return;
|
|
954
|
-
const
|
|
955
|
-
if (ft !== null &&
|
|
956
|
-
|
|
954
|
+
const S = Date.now();
|
|
955
|
+
if (ft !== null && S - ft <= ba) {
|
|
956
|
+
On(f);
|
|
957
957
|
return;
|
|
958
958
|
}
|
|
959
|
-
ft =
|
|
960
|
-
}),
|
|
959
|
+
ft = S;
|
|
960
|
+
}), L.addEventListener("keydown", (a) => {
|
|
961
961
|
!i.classList.contains("pluno-pa-widget--minimized") || a.key !== "Enter" && a.key !== " " || (a.preventDefault(), be());
|
|
962
|
-
}),
|
|
962
|
+
}), E?.addEventListener("pointerdown", (a) => {
|
|
963
963
|
a.stopPropagation();
|
|
964
|
-
}),
|
|
964
|
+
}), E?.addEventListener("click", (a) => {
|
|
965
965
|
a.preventDefault(), a.stopPropagation(), et("minimized");
|
|
966
|
-
}),
|
|
967
|
-
|
|
966
|
+
}), P.addEventListener("click", Bt), M.addEventListener("scroll", () => {
|
|
967
|
+
M.scrollTop < Re - 1 && ae(!1, "userScroll"), Re = M.scrollTop;
|
|
968
968
|
}), he.addEventListener("click", () => {
|
|
969
|
-
|
|
969
|
+
si();
|
|
970
970
|
});
|
|
971
|
-
const
|
|
971
|
+
const Un = typeof IntersectionObserver > "u" ? null : new IntersectionObserver(
|
|
972
972
|
([a]) => {
|
|
973
973
|
a?.isIntersecting && (ae(!0, "bottom"), re());
|
|
974
974
|
},
|
|
975
|
-
{ root:
|
|
975
|
+
{ root: M, threshold: 0 }
|
|
976
976
|
);
|
|
977
|
-
|
|
977
|
+
Un?.observe(Ze);
|
|
978
978
|
const nt = () => t.loginRequired || t.signupRequired;
|
|
979
|
-
let
|
|
980
|
-
const le = () => ht || b.getState().status !== "connected",
|
|
981
|
-
const a = nt(), d =
|
|
982
|
-
c.readOnly = !1,
|
|
979
|
+
let He = null, ot = !1;
|
|
980
|
+
const le = () => ht || b.getState().status !== "connected", Me = () => {
|
|
981
|
+
const a = nt(), d = He !== null;
|
|
982
|
+
c.readOnly = !1, y.readOnly = !1, c.placeholder = d ? eo : a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : ot ? "New update" : t.launcherLabel, y.placeholder = d ? eo : a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : de.launcherLabel, ne.hidden = a;
|
|
983
983
|
}, j = () => {
|
|
984
|
-
F.disabled = le() || se(t.billingStatus) || !b.getState().isThinking &&
|
|
984
|
+
F.disabled = le() || se(t.billingStatus) || !b.getState().isThinking && y.value.trim().length === 0 && w.length === 0, B.disabled = nt() || le() || se(t.billingStatus);
|
|
985
985
|
};
|
|
986
|
-
|
|
986
|
+
Me();
|
|
987
987
|
const Wt = () => {
|
|
988
988
|
const a = b.getState().isThinking;
|
|
989
989
|
i.classList.toggle("pluno-pa-widget--thinking", a), i.classList.toggle(
|
|
990
990
|
"pluno-pa-widget--unread",
|
|
991
991
|
!a && ot
|
|
992
|
-
),
|
|
992
|
+
), Me();
|
|
993
993
|
};
|
|
994
994
|
Wt();
|
|
995
995
|
const Ht = () => {
|
|
996
|
-
nt() || Y || (ht = !0,
|
|
996
|
+
nt() || Y || (ht = !0, Me(), j(), b.connect().then(
|
|
997
997
|
() => {
|
|
998
|
-
Y || (ht = !1,
|
|
998
|
+
Y || (ht = !1, Me(), j());
|
|
999
999
|
},
|
|
1000
1000
|
(a) => {
|
|
1001
|
-
Y || (ht = !1,
|
|
1001
|
+
Y || (ht = !1, Me(), j(), J(
|
|
1002
1002
|
"web-sdk.widget",
|
|
1003
1003
|
"Failed to connect Product Agent widget",
|
|
1004
1004
|
{
|
|
@@ -1017,56 +1017,56 @@ async function Ra(e = {}) {
|
|
|
1017
1017
|
t.onSignupClick?.();
|
|
1018
1018
|
return;
|
|
1019
1019
|
}
|
|
1020
|
-
le() || se(t.billingStatus) || (
|
|
1020
|
+
le() || se(t.billingStatus) || (Ce = !0, ae(!0, "send"), re(), w = an(
|
|
1021
1021
|
b,
|
|
1022
|
-
|
|
1022
|
+
y,
|
|
1023
1023
|
w,
|
|
1024
|
-
|
|
1025
|
-
),
|
|
1024
|
+
Ct
|
|
1025
|
+
), Fe(), j());
|
|
1026
1026
|
});
|
|
1027
1027
|
let it = 0;
|
|
1028
|
-
const
|
|
1028
|
+
const fi = () => {
|
|
1029
1029
|
it = 0, i.classList.remove("pluno-pa-widget--drag-over");
|
|
1030
|
-
},
|
|
1031
|
-
|
|
1032
|
-
W.textContent = "", W.hidden = !0,
|
|
1030
|
+
}, $t = (a) => {
|
|
1031
|
+
k !== null && window.clearTimeout(k), W.textContent = a, W.hidden = !1, k = window.setTimeout(() => {
|
|
1032
|
+
W.textContent = "", W.hidden = !0, k = null;
|
|
1033
1033
|
}, 3e3);
|
|
1034
|
-
},
|
|
1035
|
-
|
|
1036
|
-
},
|
|
1034
|
+
}, wi = () => {
|
|
1035
|
+
k !== null && (window.clearTimeout(k), k = null), W.textContent = "", W.hidden = !0;
|
|
1036
|
+
}, Gt = async (a) => {
|
|
1037
1037
|
if (!t.attachmentsEnabled || a.length === 0)
|
|
1038
1038
|
return;
|
|
1039
|
-
const d =
|
|
1040
|
-
if (w = [...w, ...d],
|
|
1039
|
+
const d = kr(b, a);
|
|
1040
|
+
if (w = [...w, ...d], Fe(), wi(), j(), U(b.getState()), !i.classList.contains("pluno-pa-widget--open")) {
|
|
1041
1041
|
be();
|
|
1042
1042
|
return;
|
|
1043
1043
|
}
|
|
1044
1044
|
q();
|
|
1045
|
-
},
|
|
1046
|
-
await
|
|
1045
|
+
}, bi = async (a) => {
|
|
1046
|
+
await Gt(a), !(a.length === 0 || He !== null) && y.focus();
|
|
1047
1047
|
};
|
|
1048
1048
|
B.addEventListener("click", () => {
|
|
1049
1049
|
t.loginRequired || le() || se(t.billingStatus) || ge.click();
|
|
1050
1050
|
}), ge.addEventListener("change", () => {
|
|
1051
1051
|
const a = Array.from(ge.files ?? []);
|
|
1052
|
-
ge.value = "",
|
|
1053
|
-
|
|
1052
|
+
ge.value = "", bi(a).catch((d) => {
|
|
1053
|
+
$t(
|
|
1054
1054
|
d instanceof Error ? d.message : "Failed to attach file"
|
|
1055
1055
|
), J("web-sdk.widget", "Attachment failed", {
|
|
1056
1056
|
message: d instanceof Error ? d.message : String(d)
|
|
1057
1057
|
});
|
|
1058
1058
|
});
|
|
1059
1059
|
}), i.addEventListener("dragenter", (a) => {
|
|
1060
|
-
!t.attachmentsEnabled || !
|
|
1060
|
+
!t.attachmentsEnabled || !St(a.dataTransfer) || t.loginRequired || le() || (a.preventDefault(), a.stopPropagation(), it += 1, i.classList.add("pluno-pa-widget--drag-over"));
|
|
1061
1061
|
}), i.addEventListener("dragover", (a) => {
|
|
1062
1062
|
const d = a.dataTransfer;
|
|
1063
|
-
!t.attachmentsEnabled || !
|
|
1063
|
+
!t.attachmentsEnabled || !St(d) || t.loginRequired || le() || (a.preventDefault(), a.stopPropagation(), d.dropEffect = "copy");
|
|
1064
1064
|
}), i.addEventListener("dragleave", (a) => {
|
|
1065
|
-
|
|
1065
|
+
St(a.dataTransfer) && (a.stopPropagation(), it = Math.max(0, it - 1), it === 0 && i.classList.remove("pluno-pa-widget--drag-over"));
|
|
1066
1066
|
}), i.addEventListener("drop", (a) => {
|
|
1067
1067
|
const d = a.dataTransfer;
|
|
1068
|
-
!t.attachmentsEnabled || !
|
|
1069
|
-
|
|
1068
|
+
!t.attachmentsEnabled || !St(d) || t.loginRequired || le() || (a.preventDefault(), a.stopPropagation(), fi(), Gt(d.files).catch((f) => {
|
|
1069
|
+
$t(
|
|
1070
1070
|
f instanceof Error ? f.message : "Failed to attach file"
|
|
1071
1071
|
), J("web-sdk.widget", "Attachment failed", {
|
|
1072
1072
|
message: f instanceof Error ? f.message : String(f)
|
|
@@ -1075,11 +1075,11 @@ async function Ra(e = {}) {
|
|
|
1075
1075
|
}), i.addEventListener("paste", (a) => {
|
|
1076
1076
|
a.stopPropagation();
|
|
1077
1077
|
const d = a.clipboardData, f = Array.from(d?.files ?? []);
|
|
1078
|
-
!t.attachmentsEnabled || f.length === 0 || t.loginRequired || le() || (a.preventDefault(),
|
|
1079
|
-
|
|
1080
|
-
|
|
1078
|
+
!t.attachmentsEnabled || f.length === 0 || t.loginRequired || le() || (a.preventDefault(), Gt(f).catch((S) => {
|
|
1079
|
+
$t(
|
|
1080
|
+
S instanceof Error ? S.message : "Failed to attach file"
|
|
1081
1081
|
), J("web-sdk.widget", "Attachment failed", {
|
|
1082
|
-
message:
|
|
1082
|
+
message: S instanceof Error ? S.message : String(S)
|
|
1083
1083
|
});
|
|
1084
1084
|
}));
|
|
1085
1085
|
}), F.addEventListener("click", () => {
|
|
@@ -1093,37 +1093,37 @@ async function Ra(e = {}) {
|
|
|
1093
1093
|
}
|
|
1094
1094
|
if (le())
|
|
1095
1095
|
return;
|
|
1096
|
-
const a =
|
|
1097
|
-
|
|
1096
|
+
const a = y.value.trim().length > 0 || w.length > 0;
|
|
1097
|
+
Ce = !0, ae(!0, "send"), re(), w = an(
|
|
1098
1098
|
b,
|
|
1099
|
-
|
|
1099
|
+
y,
|
|
1100
1100
|
w,
|
|
1101
|
-
|
|
1102
|
-
),
|
|
1101
|
+
Ct
|
|
1102
|
+
), Fe(), j(), U(b.getState()), a && q();
|
|
1103
1103
|
}), Z.addEventListener("click", () => {
|
|
1104
|
-
X = !X, Je = null, we(), X &&
|
|
1104
|
+
X = !X, Je = null, we(), X && Se.length === 0 && Pn(null), X || q();
|
|
1105
1105
|
}), ut.addEventListener("click", () => {
|
|
1106
1106
|
X = !1, we(), q();
|
|
1107
|
-
}), V.addEventListener("scroll",
|
|
1108
|
-
lt(
|
|
1109
|
-
}),
|
|
1107
|
+
}), V.addEventListener("scroll", pi), y.addEventListener("input", () => {
|
|
1108
|
+
lt(y), $(), j(), yi();
|
|
1109
|
+
}), y.addEventListener("keydown", (a) => {
|
|
1110
1110
|
if (!(a.key !== "Enter" || a.shiftKey)) {
|
|
1111
1111
|
if (a.preventDefault(), t.loginRequired) {
|
|
1112
1112
|
t.onLoginClick?.();
|
|
1113
1113
|
return;
|
|
1114
1114
|
}
|
|
1115
|
-
le() || (
|
|
1115
|
+
le() || (Ce = !0, ae(!0, "send"), re(), w = an(
|
|
1116
1116
|
b,
|
|
1117
|
-
|
|
1117
|
+
y,
|
|
1118
1118
|
w,
|
|
1119
|
-
|
|
1120
|
-
),
|
|
1119
|
+
Ct
|
|
1120
|
+
), Fe(), j(), U(b.getState()));
|
|
1121
1121
|
}
|
|
1122
1122
|
}), i.addEventListener("click", (a) => {
|
|
1123
1123
|
const d = a.target instanceof Element ? a.target : null;
|
|
1124
|
-
d?.closest("a[href]") &&
|
|
1125
|
-
const
|
|
1126
|
-
|
|
1124
|
+
d?.closest("a[href]") && $(), X && Xi(d, Te, Z) && (X = !1, we());
|
|
1125
|
+
const S = window.getSelection(), N = !!(S && !S.isCollapsed && S.anchorNode && i.contains(S.anchorNode));
|
|
1126
|
+
Vi(a.target, a.detail, N) && q();
|
|
1127
1127
|
}), i.addEventListener("copy", (a) => {
|
|
1128
1128
|
a.clipboardData && window.getSelection() && !window.getSelection()?.isCollapsed && window.getSelection()?.anchorNode && window.getSelection()?.focusNode && i.contains(window.getSelection()?.anchorNode ?? null) && i.contains(window.getSelection()?.focusNode ?? null) && window.getSelection()?.toString() && (a.clipboardData.clearData(), a.clipboardData.setData(
|
|
1129
1129
|
"text/plain",
|
|
@@ -1142,17 +1142,17 @@ async function Ra(e = {}) {
|
|
|
1142
1142
|
return;
|
|
1143
1143
|
}
|
|
1144
1144
|
a.key !== "Escape" || !X || (X = !1, we(), q());
|
|
1145
|
-
}), l.composerValue && (
|
|
1145
|
+
}), l.composerValue && (y.value = l.composerValue, lt(y)), t.layout === "page" ? be(y.value, !1) : s === "minimized" ? et("minimized", !1) : t.initialDisplayState === void 0 && l.isOpen && be(y.value, !1, !1), Xa(l, i, c, y);
|
|
1146
1146
|
const wt = () => r;
|
|
1147
|
-
let qt = b.getState().appearance !== null, bt = null, at = null,
|
|
1147
|
+
let qt = b.getState().appearance !== null, bt = null, at = null, $e = null, Bn = b.getState().isThinking, Ge = null;
|
|
1148
1148
|
const rt = t.taskNotifications;
|
|
1149
|
-
let
|
|
1150
|
-
const
|
|
1151
|
-
|
|
1149
|
+
let qe = null, je = !1;
|
|
1150
|
+
const Fn = () => {
|
|
1151
|
+
qe !== null && (window.clearTimeout(qe), qe = null);
|
|
1152
1152
|
}, _t = () => {
|
|
1153
|
-
|
|
1154
|
-
},
|
|
1155
|
-
if (!rt || !
|
|
1153
|
+
Pe && (Pe.hidden = !0);
|
|
1154
|
+
}, Wn = () => b.getState().assistantDraft.trim().length > 0, _i = async () => {
|
|
1155
|
+
if (!rt || !Pe || je || Y || !b.getState().isThinking || Wn())
|
|
1156
1156
|
return;
|
|
1157
1157
|
let a;
|
|
1158
1158
|
try {
|
|
@@ -1160,46 +1160,46 @@ async function Ra(e = {}) {
|
|
|
1160
1160
|
} catch {
|
|
1161
1161
|
return;
|
|
1162
1162
|
}
|
|
1163
|
-
a.enabled || a.neverSuggest || !b.getState().isThinking ||
|
|
1163
|
+
a.enabled || a.neverSuggest || !b.getState().isThinking || Wn() || je || Y || (Pe.hidden = !1);
|
|
1164
1164
|
};
|
|
1165
|
-
|
|
1166
|
-
|
|
1165
|
+
Ie?.addEventListener("click", () => {
|
|
1166
|
+
je = !0, _t(), rt?.enable().catch(() => {
|
|
1167
1167
|
});
|
|
1168
|
-
}),
|
|
1169
|
-
|
|
1170
|
-
}),
|
|
1171
|
-
|
|
1168
|
+
}), C?.addEventListener("click", () => {
|
|
1169
|
+
je = !0, _t();
|
|
1170
|
+
}), T?.addEventListener("click", () => {
|
|
1171
|
+
je = !0, _t(), rt?.dismissForever().catch(() => {
|
|
1172
1172
|
});
|
|
1173
1173
|
});
|
|
1174
1174
|
const xt = t.tabGroups;
|
|
1175
|
-
let
|
|
1175
|
+
let Ke = !1;
|
|
1176
1176
|
const yt = async () => {
|
|
1177
|
-
if (!xt || !I ||
|
|
1177
|
+
if (!xt || !I || Ke || Y)
|
|
1178
1178
|
return;
|
|
1179
1179
|
const a = await xt.getState().catch(() => null);
|
|
1180
|
-
!a ||
|
|
1180
|
+
!a || Ke || Y || (I.hidden = !a.permissionNeeded);
|
|
1181
1181
|
};
|
|
1182
1182
|
ve?.addEventListener("click", () => {
|
|
1183
|
-
|
|
1183
|
+
Ke = !0, I && (I.hidden = !0), xt?.enable().catch(() => {
|
|
1184
1184
|
}).finally(() => {
|
|
1185
|
-
|
|
1185
|
+
Ke = !1, yt();
|
|
1186
1186
|
});
|
|
1187
1187
|
}), oe?.addEventListener("click", () => {
|
|
1188
|
-
|
|
1188
|
+
Ke = !0, I && (I.hidden = !0), xt?.dismiss().catch(() => {
|
|
1189
1189
|
}).finally(() => {
|
|
1190
|
-
|
|
1190
|
+
Ke = !1, yt();
|
|
1191
1191
|
});
|
|
1192
1192
|
}), yt();
|
|
1193
|
-
let
|
|
1193
|
+
let Ve = null, Hn = () => {
|
|
1194
1194
|
};
|
|
1195
|
-
const
|
|
1196
|
-
const a =
|
|
1197
|
-
me.hidden = !a, a &&
|
|
1195
|
+
const xi = !!t.socialPostDraftHandler, jt = /* @__PURE__ */ new Map(), Kt = () => y.value.trim().length > 0 || w.length > 0, yi = () => {
|
|
1196
|
+
const a = Ve !== null && pn(b.getState(), Kt());
|
|
1197
|
+
me.hidden = !a, a && Ve !== null && Ho(me, Ve);
|
|
1198
1198
|
};
|
|
1199
|
-
let
|
|
1200
|
-
const _e = /* @__PURE__ */ new Map(), vt = /* @__PURE__ */ new Set(),
|
|
1199
|
+
let Ye = null;
|
|
1200
|
+
const _e = /* @__PURE__ */ new Map(), vt = /* @__PURE__ */ new Set(), vi = async (a) => {
|
|
1201
1201
|
if (t.integrationAuthHandler) {
|
|
1202
|
-
_e.set(a.authRequestId, { status: "connecting" }),
|
|
1202
|
+
_e.set(a.authRequestId, { status: "connecting" }), U(b.getState());
|
|
1203
1203
|
try {
|
|
1204
1204
|
await t.integrationAuthHandler(a), _e.set(a.authRequestId, { status: "completed" });
|
|
1205
1205
|
} catch (d) {
|
|
@@ -1208,31 +1208,31 @@ async function Ra(e = {}) {
|
|
|
1208
1208
|
error: d instanceof Error ? d.message : `Could not connect ${a.appName}.`
|
|
1209
1209
|
});
|
|
1210
1210
|
}
|
|
1211
|
-
|
|
1211
|
+
U(b.getState());
|
|
1212
1212
|
}
|
|
1213
1213
|
}, Vt = (a = {}) => {
|
|
1214
|
-
|
|
1215
|
-
},
|
|
1214
|
+
Ce = !0, ae(!0, "newSession"), re(), X = !1, we(), b.startNewSession(a), Rt.clear(), _e.clear(), vt.clear(), y.value = "", w = [], Fe(), lt(y), $(), j(), y.focus(), U(b.getState());
|
|
1215
|
+
}, Ct = () => {
|
|
1216
1216
|
t.morningReport !== null && (t.morningReport = null, t.onMorningReportTaskStart?.(), Vt());
|
|
1217
1217
|
}, Yt = (a) => {
|
|
1218
1218
|
if (!a || t.layout === "page") {
|
|
1219
|
-
|
|
1219
|
+
Ye?.remove(), Ye = null;
|
|
1220
1220
|
return;
|
|
1221
1221
|
}
|
|
1222
|
-
|
|
1222
|
+
Ye || (Ye = It(
|
|
1223
1223
|
"pluno-pa-widget__new-chat",
|
|
1224
1224
|
"New chat",
|
|
1225
|
-
|
|
1225
|
+
mr(),
|
|
1226
1226
|
!1
|
|
1227
|
-
),
|
|
1228
|
-
},
|
|
1229
|
-
if (we(),
|
|
1227
|
+
), Ye.addEventListener("click", () => Vt()), G.insertBefore(Ye, Z));
|
|
1228
|
+
}, U = (a) => {
|
|
1229
|
+
if (we(), kn(a.lastErrorCode) ? Ge = a.lastErrorCode : t.billingStatus?.creditsUsed !== null && !se(t.billingStatus) && (Ge = null), sn(
|
|
1230
1230
|
Xe,
|
|
1231
1231
|
t.billingStatus,
|
|
1232
1232
|
Ge
|
|
1233
1233
|
), t.loginRequired) {
|
|
1234
|
-
jt.clear(),
|
|
1235
|
-
|
|
1234
|
+
jt.clear(), xo(
|
|
1235
|
+
M,
|
|
1236
1236
|
F,
|
|
1237
1237
|
Yt,
|
|
1238
1238
|
wt,
|
|
@@ -1244,8 +1244,8 @@ async function Ra(e = {}) {
|
|
|
1244
1244
|
return;
|
|
1245
1245
|
}
|
|
1246
1246
|
if (t.signupRequired) {
|
|
1247
|
-
jt.clear(),
|
|
1248
|
-
|
|
1247
|
+
jt.clear(), xo(
|
|
1248
|
+
M,
|
|
1249
1249
|
F,
|
|
1250
1250
|
Yt,
|
|
1251
1251
|
wt,
|
|
@@ -1256,33 +1256,33 @@ async function Ra(e = {}) {
|
|
|
1256
1256
|
);
|
|
1257
1257
|
return;
|
|
1258
1258
|
}
|
|
1259
|
-
const d =
|
|
1260
|
-
|
|
1261
|
-
const
|
|
1262
|
-
|
|
1263
|
-
|
|
1259
|
+
const d = Ja(a), f = d !== An;
|
|
1260
|
+
An = d;
|
|
1261
|
+
const S = Ce || Ne.enabled;
|
|
1262
|
+
Ce = !1, Rr(
|
|
1263
|
+
M,
|
|
1264
1264
|
Ze,
|
|
1265
1265
|
F,
|
|
1266
1266
|
Yt,
|
|
1267
1267
|
me,
|
|
1268
1268
|
a,
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
() =>
|
|
1269
|
+
Ve,
|
|
1270
|
+
Ve !== null && pn(a, Kt()),
|
|
1271
|
+
S,
|
|
1272
|
+
() => Ne.enabled,
|
|
1273
1273
|
Rt,
|
|
1274
1274
|
jt,
|
|
1275
|
-
|
|
1275
|
+
$,
|
|
1276
1276
|
wt,
|
|
1277
1277
|
(N) => {
|
|
1278
|
-
le() || (
|
|
1278
|
+
le() || (Ct(), Ce = !0, ae(!0, "send"), re(), b.sendMessage(N));
|
|
1279
1279
|
},
|
|
1280
1280
|
() => {
|
|
1281
|
-
|
|
1281
|
+
Ce = !0, ae(!0, "send"), re(), b.retryLastMessage();
|
|
1282
1282
|
},
|
|
1283
1283
|
t.morningReport,
|
|
1284
1284
|
() => {
|
|
1285
|
-
t.morningReport = null, t.onMorningReportSnooze?.(), Bt(),
|
|
1285
|
+
t.morningReport = null, t.onMorningReportSnooze?.(), Bt(), U(b.getState());
|
|
1286
1286
|
},
|
|
1287
1287
|
Ht,
|
|
1288
1288
|
t.attachmentPreviewUrlResolver,
|
|
@@ -1290,29 +1290,29 @@ async function Ra(e = {}) {
|
|
|
1290
1290
|
states: _e,
|
|
1291
1291
|
initialStatus: t.integrationAuthStatusLoader ? "checking" : "pending",
|
|
1292
1292
|
onConnect: (N) => {
|
|
1293
|
-
|
|
1293
|
+
vi(N);
|
|
1294
1294
|
}
|
|
1295
1295
|
} : void 0,
|
|
1296
|
-
|
|
1296
|
+
xi && !Dt ? {
|
|
1297
1297
|
dismissedCandidateIds: gt,
|
|
1298
1298
|
draftingCandidate: bt,
|
|
1299
1299
|
error: at,
|
|
1300
1300
|
characterIconOptions: wt(),
|
|
1301
1301
|
onSeen: (N) => {
|
|
1302
|
-
|
|
1302
|
+
We.add(N.id), $();
|
|
1303
1303
|
},
|
|
1304
1304
|
onDraft: (N) => {
|
|
1305
|
-
|
|
1305
|
+
Ci(N);
|
|
1306
1306
|
},
|
|
1307
1307
|
onDismiss: (N) => {
|
|
1308
|
-
|
|
1308
|
+
We.add(N.id), gt.add(N.id), $(), at = null, U(b.getState());
|
|
1309
1309
|
},
|
|
1310
1310
|
onDisable: (N) => {
|
|
1311
|
-
Dt = !0,
|
|
1311
|
+
Dt = !0, We.add(N.id), gt.add(N.id), $(), cl(t, !0), at = null, U(b.getState());
|
|
1312
1312
|
}
|
|
1313
1313
|
} : void 0
|
|
1314
|
-
),
|
|
1315
|
-
},
|
|
1314
|
+
), S ? (Re = M.scrollTop, re()) : f && Qa(a) && li();
|
|
1315
|
+
}, $n = async (a) => {
|
|
1316
1316
|
if (!t.integrationAuthStatusLoader)
|
|
1317
1317
|
return;
|
|
1318
1318
|
const d = a.messages.map((f) => f.integrationAuthRequest).filter(
|
|
@@ -1323,38 +1323,38 @@ async function Ra(e = {}) {
|
|
|
1323
1323
|
if (!(_e.has(f.authRequestId) || vt.has(f.authRequestId))) {
|
|
1324
1324
|
vt.add(f.authRequestId), _e.set(f.authRequestId, {
|
|
1325
1325
|
status: "checking"
|
|
1326
|
-
}),
|
|
1326
|
+
}), U(b.getState());
|
|
1327
1327
|
try {
|
|
1328
|
-
const
|
|
1329
|
-
_e.set(f.authRequestId, { status:
|
|
1330
|
-
} catch (
|
|
1328
|
+
const S = await t.integrationAuthStatusLoader(f);
|
|
1329
|
+
_e.set(f.authRequestId, { status: S });
|
|
1330
|
+
} catch (S) {
|
|
1331
1331
|
_e.set(f.authRequestId, {
|
|
1332
1332
|
status: "error",
|
|
1333
|
-
error:
|
|
1333
|
+
error: S instanceof Error ? S.message : `Could not load ${f.appName} connection status.`
|
|
1334
1334
|
});
|
|
1335
1335
|
} finally {
|
|
1336
1336
|
vt.delete(f.authRequestId);
|
|
1337
1337
|
}
|
|
1338
|
-
Y ||
|
|
1338
|
+
Y || U(b.getState());
|
|
1339
1339
|
}
|
|
1340
1340
|
})
|
|
1341
1341
|
);
|
|
1342
1342
|
};
|
|
1343
|
-
return
|
|
1343
|
+
return Hn = Hi(
|
|
1344
1344
|
(a) => {
|
|
1345
|
-
|
|
1345
|
+
Ve = a, !Y && pn(b.getState(), Kt()) && U(b.getState());
|
|
1346
1346
|
},
|
|
1347
1347
|
{
|
|
1348
1348
|
backendUrl: t.backendUrl,
|
|
1349
|
-
fetcher:
|
|
1349
|
+
fetcher: ri,
|
|
1350
1350
|
loader: t.activeUsersLoader
|
|
1351
1351
|
}
|
|
1352
1352
|
), b.on("state", (a) => {
|
|
1353
1353
|
yt();
|
|
1354
|
-
const d =
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
},
|
|
1354
|
+
const d = Bn && !a.isThinking;
|
|
1355
|
+
Bn = a.isThinking, a.isThinking && !a.assistantDraft.trim() && rt && !je && qe === null && Pe?.hidden !== !1 && (qe = window.setTimeout(() => {
|
|
1356
|
+
qe = null, _i();
|
|
1357
|
+
}, na)), (!a.isThinking || a.assistantDraft.trim()) && (Fn(), _t()), d && !i.classList.contains("pluno-pa-widget--open") && (ot = !0), Wt(), a.appearance ? (qt = !0, J(
|
|
1358
1358
|
"web-sdk.widget",
|
|
1359
1359
|
"Agent state supplied appearance",
|
|
1360
1360
|
{
|
|
@@ -1368,8 +1368,8 @@ async function Ra(e = {}) {
|
|
|
1368
1368
|
fallbackColorScheme: t.colorScheme,
|
|
1369
1369
|
fallbackFontFamily: t.fontFamily
|
|
1370
1370
|
}
|
|
1371
|
-
), Xt({}, "agent.state.appearance-cleared")),
|
|
1372
|
-
}),
|
|
1371
|
+
), Xt({}, "agent.state.appearance-cleared")), U(a), $n(a), j(), d && zn();
|
|
1372
|
+
}), U(b.getState()), $n(b.getState()), j(), Ht(), {
|
|
1373
1373
|
agent: b,
|
|
1374
1374
|
startNewChat: Vt,
|
|
1375
1375
|
host: n,
|
|
@@ -1378,7 +1378,7 @@ async function Ra(e = {}) {
|
|
|
1378
1378
|
},
|
|
1379
1379
|
updateBillingStatus: (a) => {
|
|
1380
1380
|
const d = a ?? null;
|
|
1381
|
-
|
|
1381
|
+
fo(
|
|
1382
1382
|
t.billingStatus,
|
|
1383
1383
|
d,
|
|
1384
1384
|
Ge
|
|
@@ -1390,10 +1390,10 @@ async function Ra(e = {}) {
|
|
|
1390
1390
|
},
|
|
1391
1391
|
updateAuthGate: (a) => {
|
|
1392
1392
|
const d = nt();
|
|
1393
|
-
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),
|
|
1393
|
+
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), Me(), U(b.getState()), j(), d && !nt() && Ht();
|
|
1394
1394
|
},
|
|
1395
1395
|
openPanel: (a) => {
|
|
1396
|
-
const d = typeof a == "string" ? a :
|
|
1396
|
+
const d = typeof a == "string" ? a : y.value, f = typeof a == "object" ? a.focusComposer !== !1 : !0;
|
|
1397
1397
|
be(d, !1, f);
|
|
1398
1398
|
},
|
|
1399
1399
|
closePanel: Bt,
|
|
@@ -1405,63 +1405,63 @@ async function Ra(e = {}) {
|
|
|
1405
1405
|
et("minimized", !1);
|
|
1406
1406
|
},
|
|
1407
1407
|
updateMorningReport: (a) => {
|
|
1408
|
-
t.morningReport = a ?? null,
|
|
1408
|
+
t.morningReport = a ?? null, U(b.getState());
|
|
1409
1409
|
},
|
|
1410
1410
|
destroy: () => {
|
|
1411
|
-
Y || (
|
|
1411
|
+
Y || ($(), Y = !0, Nn.disconnect(), Un?.disconnect(), mi(), window.removeEventListener("resize", Rn), Dn(), ui(), k !== null && window.clearTimeout(k), Fn(), Hn(), $e?.remove(), b.destroy(), Nt.release(), n.remove());
|
|
1412
1412
|
}
|
|
1413
1413
|
};
|
|
1414
|
-
async function
|
|
1414
|
+
async function Ci(a) {
|
|
1415
1415
|
if (!bt) {
|
|
1416
|
-
bt = a, at = null,
|
|
1416
|
+
bt = a, at = null, U(b.getState());
|
|
1417
1417
|
try {
|
|
1418
1418
|
if (!t.socialPostDraftHandler)
|
|
1419
1419
|
throw new Error("Social post drafting is not available here.");
|
|
1420
1420
|
const d = await t.socialPostDraftHandler(a);
|
|
1421
1421
|
if (!d.linkedinPost || !d.xPost)
|
|
1422
1422
|
throw new Error("Pluno did not return a complete social post draft.");
|
|
1423
|
-
|
|
1423
|
+
We.add(a.id), gt.add(a.id), $(), $e?.remove(), $e = jr(d, {
|
|
1424
1424
|
socialPostRewardsUrl: t.socialPostRewardsUrl,
|
|
1425
1425
|
onClose: () => {
|
|
1426
|
-
|
|
1426
|
+
$e?.remove(), $e = null;
|
|
1427
1427
|
}
|
|
1428
|
-
}), i.appendChild(
|
|
1428
|
+
}), i.appendChild($e);
|
|
1429
1429
|
} catch (d) {
|
|
1430
1430
|
at = d instanceof Error ? d.message : "Could not draft social post.";
|
|
1431
1431
|
} finally {
|
|
1432
|
-
bt = null,
|
|
1432
|
+
bt = null, U(b.getState());
|
|
1433
1433
|
}
|
|
1434
1434
|
}
|
|
1435
1435
|
}
|
|
1436
1436
|
function Xt(a, d) {
|
|
1437
|
-
const f = a.accentColor ?? t.accentColor,
|
|
1438
|
-
r =
|
|
1437
|
+
const f = a.accentColor ?? t.accentColor, S = a.colorScheme ?? t.colorScheme, N = a.fontFamily ?? t.fontFamily, Zt = a.scribbleStyle ?? t.scribbleStyle;
|
|
1438
|
+
r = ao(
|
|
1439
1439
|
f,
|
|
1440
1440
|
Zt
|
|
1441
|
-
),
|
|
1441
|
+
), ro(i, r, {
|
|
1442
1442
|
accentColor: f,
|
|
1443
|
-
colorScheme:
|
|
1443
|
+
colorScheme: S,
|
|
1444
1444
|
fontFamily: N,
|
|
1445
1445
|
scribbleStyle: Zt
|
|
1446
1446
|
}), J("web-sdk.widget", "Updated widget appearance", {
|
|
1447
1447
|
source: d,
|
|
1448
1448
|
inputAppearance: a,
|
|
1449
1449
|
appliedAccentColor: f,
|
|
1450
|
-
appliedColorScheme:
|
|
1450
|
+
appliedColorScheme: S,
|
|
1451
1451
|
appliedFontFamily: N,
|
|
1452
1452
|
appliedScribbleStyle: Zt,
|
|
1453
1453
|
cssAccent: i.style.getPropertyValue("--pluno-pa-accent")
|
|
1454
1454
|
});
|
|
1455
1455
|
}
|
|
1456
1456
|
}
|
|
1457
|
-
function
|
|
1457
|
+
function ao(e, t) {
|
|
1458
1458
|
return { accentColor: e, scribbleStyle: t };
|
|
1459
1459
|
}
|
|
1460
|
-
function Da(e) {
|
|
1461
|
-
const t = za(e);
|
|
1462
|
-
return t === null ? "#fafafa" : Ma(t) > 0.5 ? "#18181b" : "#fafaf9";
|
|
1463
|
-
}
|
|
1464
1460
|
function za(e) {
|
|
1461
|
+
const t = Ma(e);
|
|
1462
|
+
return t === null ? "#fafafa" : Oa(t) > 0.5 ? "#18181b" : "#fafaf9";
|
|
1463
|
+
}
|
|
1464
|
+
function Ma(e) {
|
|
1465
1465
|
const t = e.trim();
|
|
1466
1466
|
return /^#[0-9a-f]{6}$/i.test(t) ? [
|
|
1467
1467
|
Number.parseInt(t.slice(1, 3), 16),
|
|
@@ -1473,14 +1473,14 @@ function za(e) {
|
|
|
1473
1473
|
Number.parseInt(t[3] + t[3], 16)
|
|
1474
1474
|
] : null;
|
|
1475
1475
|
}
|
|
1476
|
-
function
|
|
1476
|
+
function Oa([e, t, n]) {
|
|
1477
1477
|
const o = (i) => {
|
|
1478
1478
|
const r = i / 255;
|
|
1479
1479
|
return r <= 0.03928 ? r / 12.92 : ((r + 0.055) / 1.055) ** 2.4;
|
|
1480
1480
|
};
|
|
1481
1481
|
return 0.2126 * o(e) + 0.7152 * o(t) + 0.0722 * o(n);
|
|
1482
1482
|
}
|
|
1483
|
-
function
|
|
1483
|
+
function ro(e, t, n) {
|
|
1484
1484
|
e.classList.toggle(
|
|
1485
1485
|
"pluno-pa-widget--dark",
|
|
1486
1486
|
n.colorScheme === "dark"
|
|
@@ -1488,27 +1488,27 @@ function ao(e, t, n) {
|
|
|
1488
1488
|
"pluno-pa-widget--light",
|
|
1489
1489
|
n.colorScheme !== "dark"
|
|
1490
1490
|
), e.classList.toggle("pluno-pa-widget--scribble", n.scribbleStyle);
|
|
1491
|
-
const o = n.scribbleStyle ?
|
|
1491
|
+
const o = n.scribbleStyle ? Lo(n.accentColor) : n.accentColor;
|
|
1492
1492
|
e.style.setProperty("--pluno-pa-accent", o), n.scribbleStyle ? e.style.setProperty(
|
|
1493
1493
|
"--pluno-pa-accent-contrast",
|
|
1494
|
-
|
|
1495
|
-
) : e.style.removeProperty("--pluno-pa-accent-contrast"), e.style.fontFamily = n.scribbleStyle ?
|
|
1494
|
+
za(o)
|
|
1495
|
+
) : e.style.removeProperty("--pluno-pa-accent-contrast"), e.style.fontFamily = n.scribbleStyle ? ya : n.fontFamily, n.scribbleStyle && Ua(e.ownerDocument);
|
|
1496
1496
|
const i = Array.from(
|
|
1497
1497
|
e.querySelectorAll(".pluno-pa-widget__character")
|
|
1498
1498
|
);
|
|
1499
1499
|
for (const r of i)
|
|
1500
1500
|
r.replaceWith(
|
|
1501
|
-
|
|
1501
|
+
Le(
|
|
1502
1502
|
Array.from(r.classList).join(" "),
|
|
1503
1503
|
t
|
|
1504
1504
|
)
|
|
1505
1505
|
);
|
|
1506
1506
|
}
|
|
1507
|
-
function
|
|
1508
|
-
if (e.getElementById(
|
|
1507
|
+
function Ua(e) {
|
|
1508
|
+
if (e.getElementById(to))
|
|
1509
1509
|
return;
|
|
1510
1510
|
const t = e.createElement("style");
|
|
1511
|
-
t.id =
|
|
1511
|
+
t.id = to, t.textContent = `@font-face {
|
|
1512
1512
|
font-family: "Architects Daughter";
|
|
1513
1513
|
font-style: normal;
|
|
1514
1514
|
font-weight: 400;
|
|
@@ -1516,7 +1516,7 @@ function Oa(e) {
|
|
|
1516
1516
|
src: url("https://fonts.gstatic.com/s/architectsdaughter/v20/KtkxAKiDZI_td1Lkx62xHZHDtgO_Y-bvTYlg4-7jA-U.woff2") format("woff2");
|
|
1517
1517
|
}`, e.head.appendChild(t), e.fonts?.load('16px "Architects Daughter"');
|
|
1518
1518
|
}
|
|
1519
|
-
function
|
|
1519
|
+
function Ba({
|
|
1520
1520
|
root: e,
|
|
1521
1521
|
launcher: t,
|
|
1522
1522
|
launcherDragHandle: n,
|
|
@@ -1524,82 +1524,82 @@ function Ua({
|
|
|
1524
1524
|
setPosition: i,
|
|
1525
1525
|
persist: r
|
|
1526
1526
|
}) {
|
|
1527
|
-
let l = null,
|
|
1527
|
+
let l = null, s = null, p = null, u = !1, g = null;
|
|
1528
1528
|
const h = () => {
|
|
1529
|
-
l = null,
|
|
1530
|
-
},
|
|
1531
|
-
e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing") || (m.preventDefault(), m.stopPropagation(), l = m.pointerId,
|
|
1532
|
-
},
|
|
1533
|
-
if (l !== m.pointerId || !
|
|
1529
|
+
l = null, s = null, p = null, u = !1, e.classList.remove("pluno-pa-widget--dragging");
|
|
1530
|
+
}, x = (m) => {
|
|
1531
|
+
e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing") || (m.preventDefault(), m.stopPropagation(), l = m.pointerId, s = { x: m.clientX, y: m.clientY }, p = o(), u = !1, t.setPointerCapture?.(m.pointerId));
|
|
1532
|
+
}, v = (m) => {
|
|
1533
|
+
if (l !== m.pointerId || !s || !p)
|
|
1534
1534
|
return;
|
|
1535
1535
|
m.preventDefault();
|
|
1536
|
-
const
|
|
1537
|
-
!
|
|
1538
|
-
},
|
|
1539
|
-
l === m.pointerId && (m.preventDefault(), m.stopPropagation(),
|
|
1540
|
-
},
|
|
1536
|
+
const z = m.clientX - s.x, O = m.clientY - s.y;
|
|
1537
|
+
!u && Math.hypot(z, O) < wn || (u = !0, e.classList.add("pluno-pa-widget--dragging"), i({ x: p.x + z, y: p.y + O }));
|
|
1538
|
+
}, L = (m) => {
|
|
1539
|
+
l === m.pointerId && (m.preventDefault(), m.stopPropagation(), u && (g = { x: m.clientX, y: m.clientY }, r()), h());
|
|
1540
|
+
}, D = (m) => {
|
|
1541
1541
|
l === m.pointerId && (m.preventDefault(), h());
|
|
1542
1542
|
}, c = (m) => {
|
|
1543
|
-
if (!
|
|
1543
|
+
if (!g)
|
|
1544
1544
|
return;
|
|
1545
|
-
const
|
|
1546
|
-
m.clientX -
|
|
1547
|
-
m.clientY -
|
|
1548
|
-
) <=
|
|
1549
|
-
|
|
1550
|
-
},
|
|
1545
|
+
const z = Math.hypot(
|
|
1546
|
+
m.clientX - g.x,
|
|
1547
|
+
m.clientY - g.y
|
|
1548
|
+
) <= wn;
|
|
1549
|
+
g = null, z && (m.preventDefault(), m.stopPropagation());
|
|
1550
|
+
}, E = (m) => {
|
|
1551
1551
|
if (e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing"))
|
|
1552
1552
|
return;
|
|
1553
|
-
const
|
|
1554
|
-
let
|
|
1555
|
-
m.key === "ArrowUp" ?
|
|
1553
|
+
const z = m.shiftKey ? Oo : Mo, O = o();
|
|
1554
|
+
let P = null;
|
|
1555
|
+
m.key === "ArrowUp" ? P = { x: O.x, y: O.y - z } : m.key === "ArrowDown" ? P = { x: O.x, y: O.y + z } : m.key === "ArrowLeft" ? P = { x: O.x - z, y: O.y } : m.key === "ArrowRight" && (P = { x: O.x + z, y: O.y }), P && (m.preventDefault(), m.stopPropagation(), i(P), r());
|
|
1556
1556
|
};
|
|
1557
|
-
return t.addEventListener("pointerdown",
|
|
1558
|
-
t.removeEventListener("pointerdown",
|
|
1557
|
+
return t.addEventListener("pointerdown", x), t.addEventListener("pointermove", v), t.addEventListener("pointerup", L), t.addEventListener("pointercancel", D), t.addEventListener("click", c, !0), n.addEventListener("keydown", E), () => {
|
|
1558
|
+
t.removeEventListener("pointerdown", x), t.removeEventListener("pointermove", v), t.removeEventListener("pointerup", L), t.removeEventListener("pointercancel", D), t.removeEventListener("click", c, !0), n.removeEventListener("keydown", E);
|
|
1559
1559
|
};
|
|
1560
1560
|
}
|
|
1561
|
-
function
|
|
1561
|
+
function Fa({
|
|
1562
1562
|
root: e,
|
|
1563
1563
|
handles: t,
|
|
1564
1564
|
getBounds: n,
|
|
1565
1565
|
setBounds: o,
|
|
1566
1566
|
persist: i
|
|
1567
1567
|
}) {
|
|
1568
|
-
let r = null, l = null,
|
|
1569
|
-
const
|
|
1570
|
-
r = null, l = null,
|
|
1568
|
+
let r = null, l = null, s = null, p = null, u = !1;
|
|
1569
|
+
const g = () => {
|
|
1570
|
+
r = null, l = null, s = null, p = null, u = !1, e.classList.remove("pluno-pa-widget--resizing");
|
|
1571
1571
|
}, h = (c) => {
|
|
1572
|
-
const
|
|
1573
|
-
!e.classList.contains("pluno-pa-widget--open") || !
|
|
1574
|
-
},
|
|
1575
|
-
if (r !== c.pointerId || !l || !
|
|
1572
|
+
const E = c.currentTarget, m = E.dataset.resizeDirection;
|
|
1573
|
+
!e.classList.contains("pluno-pa-widget--open") || !lo(m) || (c.preventDefault(), c.stopPropagation(), r = c.pointerId, l = m, s = { x: c.clientX, y: c.clientY }, p = n(), u = !1, E.setPointerCapture?.(c.pointerId));
|
|
1574
|
+
}, x = (c) => {
|
|
1575
|
+
if (r !== c.pointerId || !l || !s || !p)
|
|
1576
1576
|
return;
|
|
1577
1577
|
c.preventDefault(), c.stopPropagation();
|
|
1578
|
-
const
|
|
1579
|
-
!
|
|
1580
|
-
|
|
1578
|
+
const E = c.clientX - s.x, m = c.clientY - s.y;
|
|
1579
|
+
!u && Math.hypot(E, m) < wn || (u = !0, e.classList.add("pluno-pa-widget--resizing"), o(
|
|
1580
|
+
so(p, l, E, m)
|
|
1581
1581
|
));
|
|
1582
|
-
},
|
|
1583
|
-
r === c.pointerId && (c.preventDefault(), c.stopPropagation(),
|
|
1584
|
-
},
|
|
1585
|
-
r === c.pointerId && (c.preventDefault(),
|
|
1586
|
-
},
|
|
1587
|
-
const m = c.currentTarget.dataset.resizeDirection,
|
|
1588
|
-
let
|
|
1589
|
-
|
|
1582
|
+
}, v = (c) => {
|
|
1583
|
+
r === c.pointerId && (c.preventDefault(), c.stopPropagation(), u && i(), g());
|
|
1584
|
+
}, L = (c) => {
|
|
1585
|
+
r === c.pointerId && (c.preventDefault(), g());
|
|
1586
|
+
}, D = (c) => {
|
|
1587
|
+
const m = c.currentTarget.dataset.resizeDirection, z = c.shiftKey ? Oo : Mo, O = n();
|
|
1588
|
+
let P = 0, ne = 0;
|
|
1589
|
+
lo(m) && (c.key === "ArrowLeft" ? P = -z : c.key === "ArrowRight" ? P = z : c.key === "ArrowUp" ? ne = -z : c.key === "ArrowDown" && (ne = z), !(P === 0 && ne === 0) && (c.preventDefault(), c.stopPropagation(), o(so(O, m, P, ne)), i()));
|
|
1590
1590
|
};
|
|
1591
1591
|
for (const c of t)
|
|
1592
|
-
c.addEventListener("pointerdown", h), c.addEventListener("pointermove",
|
|
1592
|
+
c.addEventListener("pointerdown", h), c.addEventListener("pointermove", x), c.addEventListener("pointerup", v), c.addEventListener("pointercancel", L), c.addEventListener("keydown", D);
|
|
1593
1593
|
return () => {
|
|
1594
1594
|
for (const c of t)
|
|
1595
|
-
c.removeEventListener("pointerdown", h), c.removeEventListener("pointermove",
|
|
1595
|
+
c.removeEventListener("pointerdown", h), c.removeEventListener("pointermove", x), c.removeEventListener("pointerup", v), c.removeEventListener("pointercancel", L), c.removeEventListener("keydown", D);
|
|
1596
1596
|
};
|
|
1597
1597
|
}
|
|
1598
|
-
function
|
|
1598
|
+
function lo(e) {
|
|
1599
1599
|
return e === "left" || e === "right" || e === "top" || e === "bottom" || e === "top-left" || e === "top-right" || e === "bottom-left" || e === "bottom-right";
|
|
1600
1600
|
}
|
|
1601
|
-
function
|
|
1602
|
-
const i = te(), r =
|
|
1601
|
+
function so(e, t, n, o) {
|
|
1602
|
+
const i = te(), r = po({
|
|
1603
1603
|
leading: e.position.x,
|
|
1604
1604
|
length: e.size.width,
|
|
1605
1605
|
delta: n,
|
|
@@ -1608,20 +1608,20 @@ function lo(e, t, n, o) {
|
|
|
1608
1608
|
minLeading: R,
|
|
1609
1609
|
maxTrailing: i.width - R,
|
|
1610
1610
|
minLength: Math.min(
|
|
1611
|
-
|
|
1611
|
+
Cn,
|
|
1612
1612
|
i.width - R * 2
|
|
1613
1613
|
)
|
|
1614
|
-
}), l =
|
|
1614
|
+
}), l = po({
|
|
1615
1615
|
leading: e.position.y,
|
|
1616
1616
|
length: e.size.height,
|
|
1617
1617
|
delta: o,
|
|
1618
1618
|
resizeLeading: t.startsWith("top") || t === "top",
|
|
1619
1619
|
resizeTrailing: t.startsWith("bottom") || t === "bottom",
|
|
1620
|
-
minLeading:
|
|
1620
|
+
minLeading: Ue,
|
|
1621
1621
|
maxTrailing: i.height - R,
|
|
1622
1622
|
minLength: Math.min(
|
|
1623
1623
|
Sn,
|
|
1624
|
-
i.height -
|
|
1624
|
+
i.height - Ue - R
|
|
1625
1625
|
)
|
|
1626
1626
|
});
|
|
1627
1627
|
return {
|
|
@@ -1629,7 +1629,7 @@ function lo(e, t, n, o) {
|
|
|
1629
1629
|
size: { width: r.length, height: l.length }
|
|
1630
1630
|
};
|
|
1631
1631
|
}
|
|
1632
|
-
function
|
|
1632
|
+
function po({
|
|
1633
1633
|
leading: e,
|
|
1634
1634
|
length: t,
|
|
1635
1635
|
delta: n,
|
|
@@ -1637,78 +1637,78 @@ function so({
|
|
|
1637
1637
|
resizeTrailing: i,
|
|
1638
1638
|
minLeading: r,
|
|
1639
1639
|
maxTrailing: l,
|
|
1640
|
-
minLength:
|
|
1640
|
+
minLength: s
|
|
1641
1641
|
}) {
|
|
1642
|
-
const
|
|
1642
|
+
const p = e + t;
|
|
1643
1643
|
if (o) {
|
|
1644
|
-
const
|
|
1645
|
-
if (
|
|
1644
|
+
const u = e + n;
|
|
1645
|
+
if (u >= r) {
|
|
1646
1646
|
const h = ee(
|
|
1647
|
-
|
|
1647
|
+
u,
|
|
1648
1648
|
r,
|
|
1649
|
-
|
|
1649
|
+
p - s
|
|
1650
1650
|
);
|
|
1651
|
-
return { leading: h, length:
|
|
1651
|
+
return { leading: h, length: p - h };
|
|
1652
1652
|
}
|
|
1653
|
-
const
|
|
1654
|
-
|
|
1655
|
-
|
|
1653
|
+
const g = ee(
|
|
1654
|
+
p + r - u,
|
|
1655
|
+
p,
|
|
1656
1656
|
l
|
|
1657
1657
|
);
|
|
1658
|
-
return { leading: r, length:
|
|
1658
|
+
return { leading: r, length: g - r };
|
|
1659
1659
|
}
|
|
1660
1660
|
if (i) {
|
|
1661
|
-
const
|
|
1662
|
-
if (
|
|
1661
|
+
const u = p + n;
|
|
1662
|
+
if (u <= l) {
|
|
1663
1663
|
const h = ee(
|
|
1664
|
-
|
|
1665
|
-
e +
|
|
1664
|
+
u,
|
|
1665
|
+
e + s,
|
|
1666
1666
|
l
|
|
1667
1667
|
);
|
|
1668
1668
|
return { leading: e, length: h - e };
|
|
1669
1669
|
}
|
|
1670
|
-
const
|
|
1671
|
-
e - (
|
|
1670
|
+
const g = ee(
|
|
1671
|
+
e - (u - l),
|
|
1672
1672
|
r,
|
|
1673
1673
|
e
|
|
1674
1674
|
);
|
|
1675
|
-
return { leading:
|
|
1675
|
+
return { leading: g, length: l - g };
|
|
1676
1676
|
}
|
|
1677
1677
|
return { leading: e, length: t };
|
|
1678
1678
|
}
|
|
1679
1679
|
function At(e, t = !0) {
|
|
1680
1680
|
const n = te();
|
|
1681
1681
|
if (e.classList.contains("pluno-pa-widget--minimized"))
|
|
1682
|
-
return { width:
|
|
1682
|
+
return { width: no, height: no };
|
|
1683
1683
|
const o = e.getBoundingClientRect(), i = !e.classList.contains("pluno-pa-widget--open") && !e.classList.contains("pluno-pa-widget--closing");
|
|
1684
1684
|
return {
|
|
1685
|
-
width: t && i && o.width > 0 ? o.width : Math.min(
|
|
1686
|
-
height: t && i && o.height > 0 ? o.height : e.classList.contains("pluno-pa-widget--scribble") ?
|
|
1685
|
+
width: t && i && o.width > 0 ? o.width : Math.min(Ro, n.width - 36),
|
|
1686
|
+
height: t && i && o.height > 0 ? o.height : e.classList.contains("pluno-pa-widget--scribble") ? Ca : Do
|
|
1687
1687
|
};
|
|
1688
1688
|
}
|
|
1689
|
-
function
|
|
1689
|
+
function Wa() {
|
|
1690
1690
|
const e = te();
|
|
1691
1691
|
return {
|
|
1692
1692
|
width: Math.min(
|
|
1693
1693
|
ee(
|
|
1694
|
-
e.width *
|
|
1695
|
-
|
|
1694
|
+
e.width * Ea,
|
|
1695
|
+
Cn,
|
|
1696
1696
|
Sa
|
|
1697
1697
|
),
|
|
1698
1698
|
e.width - R * 2
|
|
1699
1699
|
),
|
|
1700
1700
|
height: Math.min(
|
|
1701
1701
|
ee(
|
|
1702
|
-
e.height *
|
|
1702
|
+
e.height * La,
|
|
1703
1703
|
Sn,
|
|
1704
|
-
|
|
1704
|
+
ka
|
|
1705
1705
|
),
|
|
1706
|
-
e.height -
|
|
1706
|
+
e.height - Ue - R
|
|
1707
1707
|
)
|
|
1708
1708
|
};
|
|
1709
1709
|
}
|
|
1710
1710
|
function st(e = null) {
|
|
1711
|
-
return e ? Pt(e) :
|
|
1711
|
+
return e ? Pt(e) : Wa();
|
|
1712
1712
|
}
|
|
1713
1713
|
function Pt(e) {
|
|
1714
1714
|
const t = te();
|
|
@@ -1716,7 +1716,7 @@ function Pt(e) {
|
|
|
1716
1716
|
width: ee(
|
|
1717
1717
|
e.width,
|
|
1718
1718
|
Math.min(
|
|
1719
|
-
|
|
1719
|
+
Cn,
|
|
1720
1720
|
t.width - R * 2
|
|
1721
1721
|
),
|
|
1722
1722
|
Math.max(
|
|
@@ -1728,11 +1728,11 @@ function Pt(e) {
|
|
|
1728
1728
|
e.height,
|
|
1729
1729
|
Math.min(
|
|
1730
1730
|
Sn,
|
|
1731
|
-
t.height -
|
|
1731
|
+
t.height - Ue - R
|
|
1732
1732
|
),
|
|
1733
1733
|
Math.max(
|
|
1734
1734
|
R,
|
|
1735
|
-
t.height -
|
|
1735
|
+
t.height - Ue - R
|
|
1736
1736
|
)
|
|
1737
1737
|
)
|
|
1738
1738
|
};
|
|
@@ -1745,7 +1745,7 @@ function en(e, t) {
|
|
|
1745
1745
|
const n = Pt(t);
|
|
1746
1746
|
e.style.setProperty("--pluno-pa-panel-width", `${n.width}px`), e.style.setProperty("--pluno-pa-panel-height", `${n.height}px`);
|
|
1747
1747
|
}
|
|
1748
|
-
function
|
|
1748
|
+
function Ha(e, t, n) {
|
|
1749
1749
|
const o = Number.parseFloat(e.style.left), i = Number.parseFloat(e.style.top);
|
|
1750
1750
|
if (Number.isFinite(o) && Number.isFinite(i))
|
|
1751
1751
|
return { x: o, y: i };
|
|
@@ -1760,21 +1760,21 @@ function Wa(e, t, n) {
|
|
|
1760
1760
|
}
|
|
1761
1761
|
function tn(e, t, n) {
|
|
1762
1762
|
const o = At(e, !1);
|
|
1763
|
-
return t ?
|
|
1763
|
+
return t ? bn(
|
|
1764
1764
|
e,
|
|
1765
|
-
|
|
1765
|
+
Fo(t, o),
|
|
1766
1766
|
o
|
|
1767
|
-
) :
|
|
1767
|
+
) : $a(n === "bottom-left" ? "bottom-left" : "bottom-right", o, va);
|
|
1768
1768
|
}
|
|
1769
|
-
function
|
|
1769
|
+
function $a(e, t, n) {
|
|
1770
1770
|
const o = te();
|
|
1771
1771
|
return {
|
|
1772
1772
|
x: e.endsWith("right") ? Math.max(0, o.width - t.width - n) : n,
|
|
1773
1773
|
y: e.startsWith("bottom") ? Math.max(0, o.height - t.height - n) : n
|
|
1774
1774
|
};
|
|
1775
1775
|
}
|
|
1776
|
-
function
|
|
1777
|
-
const o = te(), i = R +
|
|
1776
|
+
function bn(e, t, n) {
|
|
1777
|
+
const o = te(), i = R + ja(e);
|
|
1778
1778
|
return {
|
|
1779
1779
|
x: ee(
|
|
1780
1780
|
t.x,
|
|
@@ -1794,7 +1794,7 @@ function wn(e, t, n) {
|
|
|
1794
1794
|
)
|
|
1795
1795
|
};
|
|
1796
1796
|
}
|
|
1797
|
-
function
|
|
1797
|
+
function Fo(e, t) {
|
|
1798
1798
|
const n = te();
|
|
1799
1799
|
return {
|
|
1800
1800
|
x: e.anchor.endsWith("right") ? n.width - t.width - e.x : e.x,
|
|
@@ -1802,19 +1802,19 @@ function Bo(e, t) {
|
|
|
1802
1802
|
};
|
|
1803
1803
|
}
|
|
1804
1804
|
function Ga(e, t) {
|
|
1805
|
-
const n =
|
|
1805
|
+
const n = qa(e, t), o = te();
|
|
1806
1806
|
return {
|
|
1807
1807
|
anchor: n,
|
|
1808
1808
|
x: n.endsWith("right") ? o.width - e.x - t.width : e.x,
|
|
1809
1809
|
y: n.startsWith("bottom") ? o.height - e.y - t.height : e.y
|
|
1810
1810
|
};
|
|
1811
1811
|
}
|
|
1812
|
-
function
|
|
1812
|
+
function qa(e, t) {
|
|
1813
1813
|
const n = te(), o = e.x + t.width / 2, r = e.y + t.height / 2 <= n.height / 2 ? "top" : "bottom", l = o <= n.width / 2 ? "left" : "right";
|
|
1814
1814
|
return `${r}-${l}`;
|
|
1815
1815
|
}
|
|
1816
|
-
function
|
|
1817
|
-
return e.classList.contains("pluno-pa-widget--scribble") ?
|
|
1816
|
+
function ja(e) {
|
|
1817
|
+
return e.classList.contains("pluno-pa-widget--scribble") ? Ia : Pa;
|
|
1818
1818
|
}
|
|
1819
1819
|
function nn(e, t, n, o = null) {
|
|
1820
1820
|
const i = At(e), r = st(o), l = {
|
|
@@ -1836,31 +1836,31 @@ function kt(e, t) {
|
|
|
1836
1836
|
),
|
|
1837
1837
|
y: ee(
|
|
1838
1838
|
e.y,
|
|
1839
|
-
|
|
1839
|
+
Ue,
|
|
1840
1840
|
Math.max(
|
|
1841
|
-
|
|
1841
|
+
Ue,
|
|
1842
1842
|
n.height - t.height - R
|
|
1843
1843
|
)
|
|
1844
1844
|
)
|
|
1845
1845
|
};
|
|
1846
1846
|
}
|
|
1847
|
-
function
|
|
1847
|
+
function Oe(e, t) {
|
|
1848
1848
|
if (e.classList.toggle("pluno-pa-widget--custom-position", t !== null), !t) {
|
|
1849
1849
|
e.style.removeProperty("left"), e.style.removeProperty("top"), e.style.removeProperty("right"), e.style.removeProperty("bottom");
|
|
1850
1850
|
return;
|
|
1851
1851
|
}
|
|
1852
1852
|
e.style.left = `${t.x}px`, e.style.top = `${t.y}px`, e.style.right = "auto", e.style.bottom = "auto";
|
|
1853
1853
|
}
|
|
1854
|
-
function
|
|
1854
|
+
function Ka(e, t) {
|
|
1855
1855
|
e.style.setProperty("--pluno-pa-panel-offset-x", `${t.x}px`), e.style.setProperty("--pluno-pa-panel-offset-y", `${t.y}px`);
|
|
1856
1856
|
}
|
|
1857
|
-
function
|
|
1857
|
+
function co(e) {
|
|
1858
1858
|
e.style.removeProperty("--pluno-pa-panel-offset-x"), e.style.removeProperty("--pluno-pa-panel-offset-y");
|
|
1859
1859
|
}
|
|
1860
1860
|
function te() {
|
|
1861
1861
|
return {
|
|
1862
|
-
width: window.innerWidth || document.documentElement.clientWidth ||
|
|
1863
|
-
height: window.innerHeight || document.documentElement.clientHeight ||
|
|
1862
|
+
width: window.innerWidth || document.documentElement.clientWidth || Ro + R * 2,
|
|
1863
|
+
height: window.innerHeight || document.documentElement.clientHeight || Do + R * 2
|
|
1864
1864
|
};
|
|
1865
1865
|
}
|
|
1866
1866
|
function on(e) {
|
|
@@ -1885,31 +1885,31 @@ function J(e, t, n) {
|
|
|
1885
1885
|
details: n
|
|
1886
1886
|
}, r = o.__plunoProductAgentDiagnostics__ ?? [];
|
|
1887
1887
|
r.push(i), r.length > 120 && r.splice(0, r.length - 120), o.__plunoProductAgentDiagnostics__ = r, o.__PLUNO_PRODUCT_AGENT_DIAGNOSTICS__ = () => [...r], window.dispatchEvent(
|
|
1888
|
-
new CustomEvent(
|
|
1888
|
+
new CustomEvent(ma, { detail: i })
|
|
1889
1889
|
);
|
|
1890
1890
|
}
|
|
1891
|
-
function
|
|
1891
|
+
function Va(e, t) {
|
|
1892
1892
|
J("web-sdk.widget.position", e, t);
|
|
1893
1893
|
}
|
|
1894
1894
|
function an(e, t, n, o) {
|
|
1895
1895
|
const i = t.value.trim();
|
|
1896
1896
|
return !i && n.length === 0 ? n : (o(), t.value = "", t.style.height = "22px", t.style.overflowY = "hidden", e.sendMessage(i, {
|
|
1897
|
-
attachments: n.length > 0 ? n.map(
|
|
1897
|
+
attachments: n.length > 0 ? n.map(Za) : void 0
|
|
1898
1898
|
}), t.dispatchEvent(new Event("input", { bubbles: !0 })), []);
|
|
1899
1899
|
}
|
|
1900
|
-
function
|
|
1900
|
+
function Ya(e, t, n) {
|
|
1901
1901
|
const o = e.activeElement;
|
|
1902
1902
|
return o === n ? "composer" : o === t ? "launcher" : null;
|
|
1903
1903
|
}
|
|
1904
|
-
function
|
|
1905
|
-
if (!e.focusedInput || !e.focusedInputAt || Date.now() - e.focusedInputAt >
|
|
1904
|
+
function Xa(e, t, n, o) {
|
|
1905
|
+
if (!e.focusedInput || !e.focusedInputAt || Date.now() - e.focusedInputAt > oa)
|
|
1906
1906
|
return;
|
|
1907
1907
|
const i = e.focusedInput === "composer" ? o : n;
|
|
1908
1908
|
i === o && !t.classList.contains("pluno-pa-widget--open") || i === n && t.classList.contains("pluno-pa-widget--open") || window.requestAnimationFrame(() => {
|
|
1909
1909
|
!i.isConnected || i.readOnly || (i.focus(), i.setSelectionRange(i.value.length, i.value.length));
|
|
1910
1910
|
});
|
|
1911
1911
|
}
|
|
1912
|
-
function
|
|
1912
|
+
function Za(e) {
|
|
1913
1913
|
return e;
|
|
1914
1914
|
}
|
|
1915
1915
|
function lt(e) {
|
|
@@ -1922,7 +1922,7 @@ function pt(e, t = () => !0) {
|
|
|
1922
1922
|
t() && (e.scrollTop = e.scrollHeight);
|
|
1923
1923
|
});
|
|
1924
1924
|
}
|
|
1925
|
-
function
|
|
1925
|
+
function Ja(e) {
|
|
1926
1926
|
const t = e.messages[e.messages.length - 1];
|
|
1927
1927
|
return [
|
|
1928
1928
|
e.messages.length,
|
|
@@ -1933,13 +1933,13 @@ function Za(e) {
|
|
|
1933
1933
|
e.lastError ?? ""
|
|
1934
1934
|
].join(":");
|
|
1935
1935
|
}
|
|
1936
|
-
function
|
|
1936
|
+
function Qa(e) {
|
|
1937
1937
|
return e.messages.length > 0 || e.assistantDraft.length > 0 || e.isThinking || !!e.lastError;
|
|
1938
1938
|
}
|
|
1939
|
-
function
|
|
1939
|
+
function er(e) {
|
|
1940
1940
|
return e.firstUserMessage?.trim() ? e.firstUserMessage : e.title?.trim() ? e.title : "Untitled chat";
|
|
1941
1941
|
}
|
|
1942
|
-
function
|
|
1942
|
+
function tr(e) {
|
|
1943
1943
|
const t = e.currentPage;
|
|
1944
1944
|
if (typeof t?.url == "string" && t.url.trim())
|
|
1945
1945
|
try {
|
|
@@ -1950,7 +1950,7 @@ function er(e) {
|
|
|
1950
1950
|
}
|
|
1951
1951
|
return typeof t?.origin == "string" && t.origin.trim() ? t.origin : "Current origin";
|
|
1952
1952
|
}
|
|
1953
|
-
function
|
|
1953
|
+
function nr(e, t) {
|
|
1954
1954
|
const n = new Date(e).getTime();
|
|
1955
1955
|
if (!Number.isFinite(n))
|
|
1956
1956
|
return "now";
|
|
@@ -1961,14 +1961,14 @@ function tr(e, t) {
|
|
|
1961
1961
|
];
|
|
1962
1962
|
for (const [r, l] of i)
|
|
1963
1963
|
if (o >= l) {
|
|
1964
|
-
const
|
|
1965
|
-
return r === "min" ? `${
|
|
1964
|
+
const s = Math.max(1, Math.floor(o / l));
|
|
1965
|
+
return r === "min" ? `${s} min` : `${s} ${r}${s === 1 ? "" : "s"}`;
|
|
1966
1966
|
}
|
|
1967
1967
|
return "now";
|
|
1968
1968
|
}
|
|
1969
|
-
function
|
|
1970
|
-
e.appendChild(
|
|
1971
|
-
|
|
1969
|
+
function or(e, t, n, o, i) {
|
|
1970
|
+
e.appendChild(gr()), e.appendChild(
|
|
1971
|
+
ir(
|
|
1972
1972
|
t,
|
|
1973
1973
|
n,
|
|
1974
1974
|
o,
|
|
@@ -1978,16 +1978,16 @@ function nr(e, t, n, o, i) {
|
|
|
1978
1978
|
It(
|
|
1979
1979
|
"pluno-pa-widget__close",
|
|
1980
1980
|
"Close",
|
|
1981
|
-
|
|
1981
|
+
hr(16),
|
|
1982
1982
|
!0
|
|
1983
1983
|
)
|
|
1984
|
-
), e.appendChild(
|
|
1984
|
+
), e.appendChild(ar(n));
|
|
1985
1985
|
}
|
|
1986
|
-
function
|
|
1986
|
+
function ir(e, t, n, o) {
|
|
1987
1987
|
const i = document.createElement("form");
|
|
1988
1988
|
if (i.className = "pluno-pa-widget__launcher", o && i.classList.add("pluno-pa-widget__launcher--minimizable"), n) {
|
|
1989
|
-
const
|
|
1990
|
-
|
|
1989
|
+
const p = document.createElement("button");
|
|
1990
|
+
p.type = "button", p.className = "pluno-pa-widget__launcher-drag-handle", p.setAttribute("aria-label", "Move Pluno launcher"), p.title = "Move Pluno launcher", i.appendChild(p);
|
|
1991
1991
|
}
|
|
1992
1992
|
i.appendChild(
|
|
1993
1993
|
Go(
|
|
@@ -1995,7 +1995,7 @@ function or(e, t, n, o) {
|
|
|
1995
1995
|
10
|
|
1996
1996
|
)
|
|
1997
1997
|
), i.appendChild(
|
|
1998
|
-
|
|
1998
|
+
Le(
|
|
1999
1999
|
"pluno-pa-widget__character--launcher",
|
|
2000
2000
|
t
|
|
2001
2001
|
)
|
|
@@ -2004,14 +2004,14 @@ function or(e, t, n, o) {
|
|
|
2004
2004
|
r.className = "pluno-pa-widget__launcher-run-indicator", i.appendChild(r);
|
|
2005
2005
|
const l = document.createElement("input");
|
|
2006
2006
|
l.className = "pluno-pa-widget__launcher-input", l.type = "text", l.placeholder = e, l.setAttribute("aria-label", e), i.appendChild(l);
|
|
2007
|
-
const
|
|
2008
|
-
if (
|
|
2009
|
-
const
|
|
2010
|
-
|
|
2007
|
+
const s = ct("Working...");
|
|
2008
|
+
if (s.classList.add("pluno-pa-widget__status--launcher"), i.appendChild(s), o) {
|
|
2009
|
+
const p = document.createElement("button");
|
|
2010
|
+
p.type = "button", p.className = "pluno-pa-widget__launcher-minimize", p.textContent = "-", p.setAttribute("aria-label", "Minimize Pluno on this site"), p.title = "Minimize Pluno on this site", i.appendChild(p);
|
|
2011
2011
|
}
|
|
2012
2012
|
return i;
|
|
2013
2013
|
}
|
|
2014
|
-
function
|
|
2014
|
+
function ar(e) {
|
|
2015
2015
|
const t = document.createElement("section");
|
|
2016
2016
|
t.className = "pluno-pa-widget__panel", t.hidden = !0, t.appendChild(
|
|
2017
2017
|
Go("pluno-pa-widget__scribble-spirals--panel", 16)
|
|
@@ -2019,22 +2019,22 @@ function ir(e) {
|
|
|
2019
2019
|
const n = document.createElement("div");
|
|
2020
2020
|
n.className = "pluno-pa-widget__timeline-wrap";
|
|
2021
2021
|
const o = document.createElement("main");
|
|
2022
|
-
o.className = "pluno-pa-widget__timeline", o.appendChild(
|
|
2022
|
+
o.className = "pluno-pa-widget__timeline", o.appendChild(dr(e));
|
|
2023
2023
|
const i = document.createElement("div");
|
|
2024
2024
|
i.className = "pluno-pa-widget__timeline-bottom-sentinel", i.setAttribute("aria-hidden", "true"), o.appendChild(i), n.appendChild(o);
|
|
2025
2025
|
const r = document.createElement("div");
|
|
2026
2026
|
r.className = "pluno-pa-widget__active-users-counter", r.hidden = !0, n.appendChild(r);
|
|
2027
2027
|
const l = document.createElement("button");
|
|
2028
2028
|
l.type = "button", l.className = "pluno-pa-widget__timeline-jump", l.textContent = "New messages ↓", l.hidden = !0, n.appendChild(l);
|
|
2029
|
-
const
|
|
2030
|
-
return
|
|
2029
|
+
const s = document.createElement("div");
|
|
2030
|
+
return s.className = "pluno-pa-widget__top-actions", s.appendChild(
|
|
2031
2031
|
It(
|
|
2032
2032
|
"pluno-pa-widget__history",
|
|
2033
|
-
|
|
2034
|
-
|
|
2033
|
+
_n(),
|
|
2034
|
+
fr(),
|
|
2035
2035
|
!0
|
|
2036
2036
|
)
|
|
2037
|
-
), n.appendChild(
|
|
2037
|
+
), n.appendChild(s), n.appendChild(pr()), t.appendChild(n), t.appendChild(rr()), t.appendChild(lr()), t.appendChild(sr()), t.appendChild(Ee("left", "Resize Pluno from left")), t.appendChild(
|
|
2038
2038
|
Ee("right", "Resize Pluno from right")
|
|
2039
2039
|
), t.appendChild(Ee("top", "Resize Pluno from top")), t.appendChild(
|
|
2040
2040
|
Ee("bottom", "Resize Pluno from bottom")
|
|
@@ -2055,7 +2055,7 @@ function Ee(e, t) {
|
|
|
2055
2055
|
`pluno-pa-widget__resize-handle--${e}`
|
|
2056
2056
|
].join(" "), n.dataset.resizeDirection = e, n.setAttribute("aria-label", t), n.title = t, n;
|
|
2057
2057
|
}
|
|
2058
|
-
function
|
|
2058
|
+
function rr() {
|
|
2059
2059
|
const e = document.createElement("div");
|
|
2060
2060
|
e.className = "pluno-pa-widget__notify-suggestion", e.hidden = !0;
|
|
2061
2061
|
const t = document.createElement("span");
|
|
@@ -2069,7 +2069,7 @@ function ar() {
|
|
|
2069
2069
|
const r = document.createElement("button");
|
|
2070
2070
|
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;
|
|
2071
2071
|
}
|
|
2072
|
-
function
|
|
2072
|
+
function lr() {
|
|
2073
2073
|
const e = document.createElement("div");
|
|
2074
2074
|
e.className = "pluno-pa-widget__notify-suggestion pluno-pa-widget__tab-groups-suggestion", e.hidden = !0;
|
|
2075
2075
|
const t = document.createElement("span");
|
|
@@ -2081,7 +2081,7 @@ function rr() {
|
|
|
2081
2081
|
const i = document.createElement("button");
|
|
2082
2082
|
return i.type = "button", i.className = "pluno-pa-widget__notify-suggestion-later pluno-pa-widget__tab-groups-suggestion-dismiss", i.textContent = "Not now", n.append(o, i), e.append(t, n), e;
|
|
2083
2083
|
}
|
|
2084
|
-
function
|
|
2084
|
+
function sr() {
|
|
2085
2085
|
const e = document.createElement("form");
|
|
2086
2086
|
e.className = "pluno-pa-widget__composer";
|
|
2087
2087
|
const t = document.createElement("div");
|
|
@@ -2095,32 +2095,32 @@ function lr() {
|
|
|
2095
2095
|
const r = document.createElement("input");
|
|
2096
2096
|
r.className = "pluno-pa-widget__attachment-input", r.type = "file", r.multiple = !0, r.tabIndex = -1, r.setAttribute("aria-hidden", "true"), i.appendChild(r);
|
|
2097
2097
|
const l = document.createElement("button");
|
|
2098
|
-
l.type = "button", l.className = "pluno-pa-widget__attach", l.setAttribute("aria-label", "Attach files"), l.title = "Attach files", l.appendChild(
|
|
2099
|
-
const
|
|
2100
|
-
|
|
2101
|
-
const
|
|
2102
|
-
|
|
2103
|
-
const
|
|
2104
|
-
|
|
2105
|
-
const
|
|
2106
|
-
|
|
2098
|
+
l.type = "button", l.className = "pluno-pa-widget__attach", l.setAttribute("aria-label", "Attach files"), l.title = "Attach files", l.appendChild(br()), l.appendChild(_r()), i.appendChild(l);
|
|
2099
|
+
const s = document.createElement("textarea");
|
|
2100
|
+
s.className = "pluno-pa-widget__input", s.rows = 1, s.placeholder = "Ask for anything...", i.appendChild(s);
|
|
2101
|
+
const p = document.createElement("button");
|
|
2102
|
+
p.type = "button", p.className = "pluno-pa-widget__send", p.setAttribute("aria-label", "Send"), p.appendChild(jo()), i.appendChild(p), e.appendChild(i);
|
|
2103
|
+
const u = document.createElement("div");
|
|
2104
|
+
u.className = "pluno-pa-widget__composer-meta";
|
|
2105
|
+
const g = document.createElement("a");
|
|
2106
|
+
g.className = "pluno-pa-widget__powered-by", g.href = "https://pluno.ai", g.target = "_blank", g.rel = "noopener noreferrer", g.textContent = "Powered by Pluno.ai.", u.appendChild(g);
|
|
2107
2107
|
const h = document.createElement("span");
|
|
2108
|
-
return h.className = "pluno-pa-widget__ai-disclaimer", h.textContent = "AI can make mistakes. Verify outputs.",
|
|
2108
|
+
return h.className = "pluno-pa-widget__ai-disclaimer", h.textContent = "AI can make mistakes. Verify outputs.", u.appendChild(h), e.appendChild(u), e;
|
|
2109
2109
|
}
|
|
2110
|
-
function
|
|
2110
|
+
function _n() {
|
|
2111
2111
|
return location.hostname ? `Recent chats on ${location.hostname}` : "Recent chats";
|
|
2112
2112
|
}
|
|
2113
|
-
function
|
|
2113
|
+
function pr() {
|
|
2114
2114
|
const e = document.createElement("section");
|
|
2115
|
-
e.className = "pluno-pa-widget__history-panel", e.hidden = !0, e.setAttribute("aria-label",
|
|
2115
|
+
e.className = "pluno-pa-widget__history-panel", e.hidden = !0, e.setAttribute("aria-label", _n());
|
|
2116
2116
|
const t = document.createElement("div");
|
|
2117
2117
|
t.className = "pluno-pa-widget__history-header";
|
|
2118
2118
|
const n = document.createElement("strong");
|
|
2119
|
-
n.textContent =
|
|
2119
|
+
n.textContent = _n();
|
|
2120
2120
|
const o = It(
|
|
2121
2121
|
"pluno-pa-widget__history-close",
|
|
2122
2122
|
"Close recent chats",
|
|
2123
|
-
|
|
2123
|
+
wr(),
|
|
2124
2124
|
!1
|
|
2125
2125
|
);
|
|
2126
2126
|
t.append(n, o);
|
|
@@ -2129,20 +2129,20 @@ function sr() {
|
|
|
2129
2129
|
const r = document.createElement("p");
|
|
2130
2130
|
return r.className = "pluno-pa-widget__history-status", r.hidden = !0, e.append(t, i, r), e;
|
|
2131
2131
|
}
|
|
2132
|
-
function
|
|
2132
|
+
function dr(e) {
|
|
2133
2133
|
const t = document.createElement("div");
|
|
2134
2134
|
return t.className = "pluno-pa-widget__empty-state", t.appendChild(
|
|
2135
|
-
|
|
2135
|
+
Le(
|
|
2136
2136
|
"pluno-pa-widget__character--empty",
|
|
2137
2137
|
e
|
|
2138
2138
|
)
|
|
2139
|
-
), t.appendChild(
|
|
2139
|
+
), t.appendChild(Wo()), t;
|
|
2140
2140
|
}
|
|
2141
|
-
function
|
|
2141
|
+
function Wo() {
|
|
2142
2142
|
const e = document.createElement("div");
|
|
2143
2143
|
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;
|
|
2144
2144
|
}
|
|
2145
|
-
function
|
|
2145
|
+
function Ho(e, t) {
|
|
2146
2146
|
e.replaceChildren(), e.setAttribute(
|
|
2147
2147
|
"aria-label",
|
|
2148
2148
|
`${t.toLocaleString("en-US")} users currently active`
|
|
@@ -2154,17 +2154,17 @@ function Wo(e, t) {
|
|
|
2154
2154
|
)
|
|
2155
2155
|
);
|
|
2156
2156
|
}
|
|
2157
|
-
function
|
|
2158
|
-
const n = `pluno-pa-character-${
|
|
2159
|
-
|
|
2160
|
-
const o = t.scribbleStyle ?
|
|
2157
|
+
function Le(e, t) {
|
|
2158
|
+
const n = `pluno-pa-character-${io}`;
|
|
2159
|
+
io += 1;
|
|
2160
|
+
const o = t.scribbleStyle ? ur(t.accentColor, n) : cr(t.accentColor, n), i = e.split(/\s+/).filter(Boolean);
|
|
2161
2161
|
return o.setAttribute(
|
|
2162
2162
|
"class",
|
|
2163
2163
|
i.includes("pluno-pa-widget__character") ? e : `pluno-pa-widget__character ${e}`
|
|
2164
2164
|
), o.setAttribute("aria-hidden", "true"), o.setAttribute("focusable", "false"), o.removeAttribute("role"), o.removeAttribute("aria-label"), o;
|
|
2165
2165
|
}
|
|
2166
|
-
function
|
|
2167
|
-
const n =
|
|
2166
|
+
function cr(e, t) {
|
|
2167
|
+
const n = Ti(e), o = {
|
|
2168
2168
|
boltFill: `${t}-boltFill`,
|
|
2169
2169
|
boltEdge: `${t}-boltEdge`,
|
|
2170
2170
|
boltGlow: `${t}-boltGlow`,
|
|
@@ -2175,7 +2175,7 @@ function dr(e, t) {
|
|
|
2175
2175
|
eyeShadow: `${t}-eyeShadow`,
|
|
2176
2176
|
pupilGloss: `${t}-pupilGloss`,
|
|
2177
2177
|
boltClip: `${t}-boltClip`
|
|
2178
|
-
}, i =
|
|
2178
|
+
}, i = $o(), r = _(i, "defs"), l = _(r, "linearGradient", {
|
|
2179
2179
|
id: o.boltFill,
|
|
2180
2180
|
x1: "420",
|
|
2181
2181
|
y1: "180",
|
|
@@ -2184,7 +2184,7 @@ function dr(e, t) {
|
|
|
2184
2184
|
gradientUnits: "userSpaceOnUse"
|
|
2185
2185
|
});
|
|
2186
2186
|
H(l, "0", n.top), H(l, "0.36", n.middle), H(l, "0.72", n.bottom), H(l, "1", n.bottom);
|
|
2187
|
-
const
|
|
2187
|
+
const s = _(r, "linearGradient", {
|
|
2188
2188
|
id: o.boltEdge,
|
|
2189
2189
|
x1: "470",
|
|
2190
2190
|
y1: "145",
|
|
@@ -2192,28 +2192,28 @@ function dr(e, t) {
|
|
|
2192
2192
|
y2: "980",
|
|
2193
2193
|
gradientUnits: "userSpaceOnUse"
|
|
2194
2194
|
});
|
|
2195
|
-
H(
|
|
2196
|
-
const
|
|
2195
|
+
H(s, "0", n.edgeStart), H(s, "0.32", n.edgeMiddle), H(s, "0.78", n.edgeEnd), H(s, "1", n.edgeEnd);
|
|
2196
|
+
const p = _(r, "radialGradient", {
|
|
2197
2197
|
id: o.boltGlow,
|
|
2198
2198
|
cx: "50%",
|
|
2199
2199
|
cy: "22%",
|
|
2200
2200
|
r: "82%"
|
|
2201
2201
|
});
|
|
2202
|
-
H(
|
|
2203
|
-
const
|
|
2202
|
+
H(p, "0", n.glow, "0.72"), H(p, "0.5", n.middle, "0.44"), H(p, "1", n.bottom, "0");
|
|
2203
|
+
const u = _(r, "radialGradient", {
|
|
2204
2204
|
id: o.eyeWhite,
|
|
2205
2205
|
cx: "35%",
|
|
2206
2206
|
cy: "25%",
|
|
2207
2207
|
r: "70%"
|
|
2208
2208
|
});
|
|
2209
|
-
H(
|
|
2210
|
-
const
|
|
2209
|
+
H(u, "0", "#ffffff"), H(u, "0.72", "#ffffff"), H(u, "1", "#e5e5e5");
|
|
2210
|
+
const g = _(r, "radialGradient", {
|
|
2211
2211
|
id: o.pupil,
|
|
2212
2212
|
cx: "42%",
|
|
2213
2213
|
cy: "38%",
|
|
2214
2214
|
r: "65%"
|
|
2215
2215
|
});
|
|
2216
|
-
H(
|
|
2216
|
+
H(g, "0", "#2a1f10"), H(g, "0.52", "#080604"), H(g, "1", "#000000");
|
|
2217
2217
|
const h = _(r, "filter", {
|
|
2218
2218
|
id: o.softDropShadow,
|
|
2219
2219
|
x: "-18%",
|
|
@@ -2229,7 +2229,7 @@ function dr(e, t) {
|
|
|
2229
2229
|
"flood-color": n.shadow,
|
|
2230
2230
|
"flood-opacity": "0.24"
|
|
2231
2231
|
});
|
|
2232
|
-
const
|
|
2232
|
+
const x = _(r, "filter", {
|
|
2233
2233
|
id: o.innerDepth,
|
|
2234
2234
|
x: "-8%",
|
|
2235
2235
|
y: "-8%",
|
|
@@ -2237,32 +2237,32 @@ function dr(e, t) {
|
|
|
2237
2237
|
height: "116%",
|
|
2238
2238
|
"color-interpolation-filters": "sRGB"
|
|
2239
2239
|
});
|
|
2240
|
-
_(
|
|
2240
|
+
_(x, "feGaussianBlur", {
|
|
2241
2241
|
in: "SourceAlpha",
|
|
2242
2242
|
stdDeviation: "8",
|
|
2243
2243
|
result: "blur"
|
|
2244
|
-
}), _(
|
|
2244
|
+
}), _(x, "feOffset", {
|
|
2245
2245
|
dx: "-7",
|
|
2246
2246
|
dy: "-9",
|
|
2247
2247
|
result: "topLeft"
|
|
2248
|
-
}), _(
|
|
2248
|
+
}), _(x, "feComposite", {
|
|
2249
2249
|
in: "topLeft",
|
|
2250
2250
|
in2: "SourceAlpha",
|
|
2251
2251
|
operator: "arithmetic",
|
|
2252
2252
|
k2: "-1",
|
|
2253
2253
|
k3: "1",
|
|
2254
2254
|
result: "innerShadow"
|
|
2255
|
-
}), _(
|
|
2255
|
+
}), _(x, "feColorMatrix", {
|
|
2256
2256
|
in: "innerShadow",
|
|
2257
2257
|
type: "matrix",
|
|
2258
2258
|
values: "1 0 0 0 1 0 1 0 0 1 0 0 1 0 1 0 0 0 0.42 0",
|
|
2259
2259
|
result: "innerLight"
|
|
2260
|
-
}), _(
|
|
2260
|
+
}), _(x, "feBlend", {
|
|
2261
2261
|
in: "SourceGraphic",
|
|
2262
2262
|
in2: "innerLight",
|
|
2263
2263
|
mode: "screen"
|
|
2264
2264
|
});
|
|
2265
|
-
const
|
|
2265
|
+
const v = _(r, "filter", {
|
|
2266
2266
|
id: o.eyeShadow,
|
|
2267
2267
|
x: "-24%",
|
|
2268
2268
|
y: "-20%",
|
|
@@ -2270,14 +2270,14 @@ function dr(e, t) {
|
|
|
2270
2270
|
height: "148%",
|
|
2271
2271
|
"color-interpolation-filters": "sRGB"
|
|
2272
2272
|
});
|
|
2273
|
-
_(
|
|
2273
|
+
_(v, "feDropShadow", {
|
|
2274
2274
|
dx: "0",
|
|
2275
2275
|
dy: "8",
|
|
2276
2276
|
stdDeviation: "5",
|
|
2277
2277
|
"flood-color": n.shadow,
|
|
2278
2278
|
"flood-opacity": "0.3"
|
|
2279
2279
|
});
|
|
2280
|
-
const
|
|
2280
|
+
const L = _(r, "filter", {
|
|
2281
2281
|
id: o.pupilGloss,
|
|
2282
2282
|
x: "-15%",
|
|
2283
2283
|
y: "-15%",
|
|
@@ -2285,15 +2285,15 @@ function dr(e, t) {
|
|
|
2285
2285
|
height: "130%",
|
|
2286
2286
|
"color-interpolation-filters": "sRGB"
|
|
2287
2287
|
});
|
|
2288
|
-
_(
|
|
2288
|
+
_(L, "feDropShadow", {
|
|
2289
2289
|
dx: "0",
|
|
2290
2290
|
dy: "3",
|
|
2291
2291
|
stdDeviation: "3",
|
|
2292
2292
|
"flood-color": "#000000",
|
|
2293
2293
|
"flood-opacity": "0.22"
|
|
2294
2294
|
});
|
|
2295
|
-
const
|
|
2296
|
-
_(
|
|
2295
|
+
const D = _(r, "clipPath", { id: o.boltClip });
|
|
2296
|
+
_(D, "path", { d: Lt });
|
|
2297
2297
|
const c = _(i, "g", {
|
|
2298
2298
|
filter: Q(o.softDropShadow)
|
|
2299
2299
|
});
|
|
@@ -2301,13 +2301,13 @@ function dr(e, t) {
|
|
|
2301
2301
|
d: Lt,
|
|
2302
2302
|
fill: Q(o.boltEdge)
|
|
2303
2303
|
});
|
|
2304
|
-
const
|
|
2304
|
+
const E = "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";
|
|
2305
2305
|
_(c, "path", {
|
|
2306
|
-
d:
|
|
2306
|
+
d: E,
|
|
2307
2307
|
fill: Q(o.boltFill),
|
|
2308
2308
|
filter: Q(o.innerDepth)
|
|
2309
2309
|
}), _(c, "path", {
|
|
2310
|
-
d:
|
|
2310
|
+
d: E,
|
|
2311
2311
|
fill: Q(o.boltGlow),
|
|
2312
2312
|
opacity: "0.74"
|
|
2313
2313
|
});
|
|
@@ -2337,9 +2337,9 @@ function dr(e, t) {
|
|
|
2337
2337
|
"stroke-linecap": "round",
|
|
2338
2338
|
opacity: "0.48"
|
|
2339
2339
|
});
|
|
2340
|
-
const
|
|
2341
|
-
return
|
|
2342
|
-
|
|
2340
|
+
const z = _(i, "g", { filter: Q(o.eyeShadow) });
|
|
2341
|
+
return uo(
|
|
2342
|
+
z,
|
|
2343
2343
|
"rotate(-2 528 463)",
|
|
2344
2344
|
"528",
|
|
2345
2345
|
"463",
|
|
@@ -2348,8 +2348,8 @@ function dr(e, t) {
|
|
|
2348
2348
|
"557",
|
|
2349
2349
|
"447",
|
|
2350
2350
|
o
|
|
2351
|
-
),
|
|
2352
|
-
|
|
2351
|
+
), uo(
|
|
2352
|
+
z,
|
|
2353
2353
|
"rotate(2 717 462)",
|
|
2354
2354
|
"717",
|
|
2355
2355
|
"462",
|
|
@@ -2360,13 +2360,13 @@ function dr(e, t) {
|
|
|
2360
2360
|
o
|
|
2361
2361
|
), i;
|
|
2362
2362
|
}
|
|
2363
|
-
function
|
|
2364
|
-
const n =
|
|
2363
|
+
function ur(e, t) {
|
|
2364
|
+
const n = Lo(e), o = {
|
|
2365
2365
|
clip: `${t}-scribbleBoltClip`,
|
|
2366
2366
|
wobble: `${t}-scribbleBoltWobble`
|
|
2367
|
-
}, i =
|
|
2367
|
+
}, i = $o(), r = _(i, "defs"), l = _(r, "clipPath", { id: o.clip });
|
|
2368
2368
|
_(l, "path", { d: Lt });
|
|
2369
|
-
const
|
|
2369
|
+
const s = _(r, "filter", {
|
|
2370
2370
|
id: o.wobble,
|
|
2371
2371
|
x: "-10%",
|
|
2372
2372
|
y: "-10%",
|
|
@@ -2374,24 +2374,24 @@ function cr(e, t) {
|
|
|
2374
2374
|
height: "120%",
|
|
2375
2375
|
"color-interpolation-filters": "sRGB"
|
|
2376
2376
|
});
|
|
2377
|
-
_(
|
|
2377
|
+
_(s, "feTurbulence", {
|
|
2378
2378
|
type: "fractalNoise",
|
|
2379
2379
|
baseFrequency: "0.011",
|
|
2380
2380
|
numOctaves: "3",
|
|
2381
2381
|
seed: "7",
|
|
2382
2382
|
result: "noise"
|
|
2383
|
-
}), _(
|
|
2383
|
+
}), _(s, "feDisplacementMap", {
|
|
2384
2384
|
in: "SourceGraphic",
|
|
2385
2385
|
in2: "noise",
|
|
2386
2386
|
scale: "16",
|
|
2387
2387
|
xChannelSelector: "R",
|
|
2388
2388
|
yChannelSelector: "G"
|
|
2389
2389
|
});
|
|
2390
|
-
const
|
|
2390
|
+
const p = _(i, "g", { filter: Q(o.wobble) }), u = _(p, "g", {
|
|
2391
2391
|
"clip-path": Q(o.clip)
|
|
2392
2392
|
});
|
|
2393
|
-
return _(
|
|
2394
|
-
d:
|
|
2393
|
+
return _(u, "path", {
|
|
2394
|
+
d: Li(),
|
|
2395
2395
|
fill: "none",
|
|
2396
2396
|
stroke: n,
|
|
2397
2397
|
"stroke-width": "56",
|
|
@@ -2399,14 +2399,14 @@ function cr(e, t) {
|
|
|
2399
2399
|
"stroke-linejoin": "round",
|
|
2400
2400
|
opacity: "0.9",
|
|
2401
2401
|
transform: "rotate(-14 627 600)"
|
|
2402
|
-
}), _(
|
|
2402
|
+
}), _(p, "path", {
|
|
2403
2403
|
d: Lt,
|
|
2404
2404
|
fill: "none",
|
|
2405
2405
|
stroke: Tt,
|
|
2406
2406
|
"stroke-width": "18",
|
|
2407
2407
|
"stroke-linejoin": "round"
|
|
2408
|
-
}),
|
|
2409
|
-
|
|
2408
|
+
}), go(
|
|
2409
|
+
p,
|
|
2410
2410
|
"rotate(-2 528 463)",
|
|
2411
2411
|
"528",
|
|
2412
2412
|
"463",
|
|
@@ -2414,8 +2414,8 @@ function cr(e, t) {
|
|
|
2414
2414
|
"473",
|
|
2415
2415
|
"557",
|
|
2416
2416
|
"447"
|
|
2417
|
-
),
|
|
2418
|
-
|
|
2417
|
+
), go(
|
|
2418
|
+
p,
|
|
2419
2419
|
"rotate(2 717 462)",
|
|
2420
2420
|
"717",
|
|
2421
2421
|
"462",
|
|
@@ -2425,37 +2425,37 @@ function cr(e, t) {
|
|
|
2425
2425
|
"447"
|
|
2426
2426
|
), i;
|
|
2427
2427
|
}
|
|
2428
|
-
function
|
|
2429
|
-
return
|
|
2430
|
-
xmlns:
|
|
2428
|
+
function $o() {
|
|
2429
|
+
return A("svg", {
|
|
2430
|
+
xmlns: zo,
|
|
2431
2431
|
viewBox: "0 0 1254 1254"
|
|
2432
2432
|
});
|
|
2433
2433
|
}
|
|
2434
|
-
function
|
|
2435
|
-
const
|
|
2436
|
-
_(
|
|
2434
|
+
function uo(e, t, n, o, i, r, l, s, p) {
|
|
2435
|
+
const u = _(e, "g", { transform: t });
|
|
2436
|
+
_(u, "ellipse", {
|
|
2437
2437
|
cx: n,
|
|
2438
2438
|
cy: o,
|
|
2439
2439
|
rx: "73",
|
|
2440
2440
|
ry: "80",
|
|
2441
|
-
fill: Q(
|
|
2442
|
-
}), _(
|
|
2441
|
+
fill: Q(p.eyeWhite)
|
|
2442
|
+
}), _(u, "ellipse", {
|
|
2443
2443
|
cx: i,
|
|
2444
2444
|
cy: r,
|
|
2445
2445
|
rx: "49",
|
|
2446
2446
|
ry: "57",
|
|
2447
|
-
fill: Q(
|
|
2448
|
-
filter: Q(
|
|
2449
|
-
}), _(
|
|
2447
|
+
fill: Q(p.pupil),
|
|
2448
|
+
filter: Q(p.pupilGloss)
|
|
2449
|
+
}), _(u, "circle", {
|
|
2450
2450
|
cx: l,
|
|
2451
|
-
cy:
|
|
2451
|
+
cy: s,
|
|
2452
2452
|
r: "18",
|
|
2453
2453
|
fill: "#ffffff"
|
|
2454
2454
|
});
|
|
2455
2455
|
}
|
|
2456
|
-
function
|
|
2457
|
-
const
|
|
2458
|
-
_(
|
|
2456
|
+
function go(e, t, n, o, i, r, l, s) {
|
|
2457
|
+
const p = _(e, "g", { transform: t });
|
|
2458
|
+
_(p, "ellipse", {
|
|
2459
2459
|
cx: n,
|
|
2460
2460
|
cy: o,
|
|
2461
2461
|
rx: "73",
|
|
@@ -2463,21 +2463,21 @@ function uo(e, t, n, o, i, r, l, p) {
|
|
|
2463
2463
|
fill: "#ffffff",
|
|
2464
2464
|
stroke: Tt,
|
|
2465
2465
|
"stroke-width": "13"
|
|
2466
|
-
}), _(
|
|
2466
|
+
}), _(p, "ellipse", {
|
|
2467
2467
|
cx: i,
|
|
2468
2468
|
cy: r,
|
|
2469
2469
|
rx: "45",
|
|
2470
2470
|
ry: "53",
|
|
2471
2471
|
fill: Tt
|
|
2472
|
-
}), _(
|
|
2472
|
+
}), _(p, "circle", {
|
|
2473
2473
|
cx: l,
|
|
2474
|
-
cy:
|
|
2474
|
+
cy: s,
|
|
2475
2475
|
r: "16",
|
|
2476
2476
|
fill: "#ffffff"
|
|
2477
2477
|
});
|
|
2478
2478
|
}
|
|
2479
2479
|
function _(e, t, n = {}) {
|
|
2480
|
-
const o =
|
|
2480
|
+
const o = A(t, n);
|
|
2481
2481
|
return e.appendChild(o), o;
|
|
2482
2482
|
}
|
|
2483
2483
|
function H(e, t, n, o) {
|
|
@@ -2491,14 +2491,14 @@ function It(e, t, n, o) {
|
|
|
2491
2491
|
const i = document.createElement("button");
|
|
2492
2492
|
return i.type = "button", i.className = e, i.setAttribute("aria-label", t), i.title = t, i.hidden = o, i.appendChild(n), i;
|
|
2493
2493
|
}
|
|
2494
|
-
function
|
|
2495
|
-
const e =
|
|
2494
|
+
function gr() {
|
|
2495
|
+
const e = A("svg", {
|
|
2496
2496
|
class: "pluno-pa-widget__scribble-defs",
|
|
2497
2497
|
"aria-hidden": "true",
|
|
2498
2498
|
focusable: "false",
|
|
2499
2499
|
width: "0",
|
|
2500
2500
|
height: "0"
|
|
2501
|
-
}), t =
|
|
2501
|
+
}), t = A("defs");
|
|
2502
2502
|
return t.appendChild(ln("pluno-pa-scribble-wobble", "2", "12")), t.appendChild(
|
|
2503
2503
|
ln("pluno-pa-scribble-wobble-2", "5", "15")
|
|
2504
2504
|
), t.appendChild(
|
|
@@ -2506,42 +2506,42 @@ function ur() {
|
|
|
2506
2506
|
), e.appendChild(t), e;
|
|
2507
2507
|
}
|
|
2508
2508
|
function Go(e, t) {
|
|
2509
|
-
const n =
|
|
2509
|
+
const n = A("svg", {
|
|
2510
2510
|
class: `pluno-pa-widget__scribble-spirals ${e}`,
|
|
2511
2511
|
preserveAspectRatio: "xMidYMid meet",
|
|
2512
2512
|
"aria-hidden": "true",
|
|
2513
2513
|
focusable: "false"
|
|
2514
2514
|
});
|
|
2515
|
-
return
|
|
2515
|
+
return qo(n, t), n;
|
|
2516
2516
|
}
|
|
2517
2517
|
function rn(e, t) {
|
|
2518
2518
|
if (!e)
|
|
2519
2519
|
return;
|
|
2520
2520
|
const n = Math.max(
|
|
2521
2521
|
0,
|
|
2522
|
-
t -
|
|
2522
|
+
t - fn * 2
|
|
2523
2523
|
), o = Math.max(
|
|
2524
|
-
|
|
2524
|
+
Aa,
|
|
2525
2525
|
Math.floor(
|
|
2526
|
-
(n -
|
|
2526
|
+
(n - mn * 2) / hn
|
|
2527
2527
|
)
|
|
2528
2528
|
);
|
|
2529
|
-
|
|
2529
|
+
qo(e, o);
|
|
2530
2530
|
}
|
|
2531
|
-
function
|
|
2531
|
+
function qo(e, t) {
|
|
2532
2532
|
if (e.dataset.spiralCount === `${t}`)
|
|
2533
2533
|
return;
|
|
2534
|
-
const n = t *
|
|
2534
|
+
const n = t * hn + mn * 2;
|
|
2535
2535
|
e.dataset.spiralCount = `${t}`, e.setAttribute(
|
|
2536
2536
|
"viewBox",
|
|
2537
|
-
`0 0 ${n} ${
|
|
2537
|
+
`0 0 ${n} ${Ta}`
|
|
2538
2538
|
), e.replaceChildren();
|
|
2539
2539
|
for (let o = 0; o < t; o += 1) {
|
|
2540
|
-
const i =
|
|
2541
|
-
transform: `translate(${
|
|
2540
|
+
const i = oo[o % oo.length], r = A("g", {
|
|
2541
|
+
transform: `translate(${mn + o * hn} 0)`
|
|
2542
2542
|
});
|
|
2543
2543
|
r.appendChild(
|
|
2544
|
-
|
|
2544
|
+
A("ellipse", {
|
|
2545
2545
|
cx: i.ellipseCx,
|
|
2546
2546
|
cy: i.ellipseCy,
|
|
2547
2547
|
rx: i.ellipseRx,
|
|
@@ -2552,7 +2552,7 @@ function $o(e, t) {
|
|
|
2552
2552
|
opacity: "0.8"
|
|
2553
2553
|
})
|
|
2554
2554
|
), r.appendChild(
|
|
2555
|
-
|
|
2555
|
+
A("path", {
|
|
2556
2556
|
d: i.path,
|
|
2557
2557
|
fill: "none",
|
|
2558
2558
|
stroke: "#2c2a1e",
|
|
@@ -2563,7 +2563,7 @@ function $o(e, t) {
|
|
|
2563
2563
|
}
|
|
2564
2564
|
}
|
|
2565
2565
|
function ln(e, t, n) {
|
|
2566
|
-
const o =
|
|
2566
|
+
const o = A("filter", {
|
|
2567
2567
|
id: e,
|
|
2568
2568
|
x: "-8%",
|
|
2569
2569
|
y: "-8%",
|
|
@@ -2571,7 +2571,7 @@ function ln(e, t, n) {
|
|
|
2571
2571
|
height: "116%"
|
|
2572
2572
|
});
|
|
2573
2573
|
return o.appendChild(
|
|
2574
|
-
|
|
2574
|
+
A("feTurbulence", {
|
|
2575
2575
|
type: "fractalNoise",
|
|
2576
2576
|
baseFrequency: "0.012 0.028",
|
|
2577
2577
|
numOctaves: "3",
|
|
@@ -2579,7 +2579,7 @@ function ln(e, t, n) {
|
|
|
2579
2579
|
result: "stroke-noise"
|
|
2580
2580
|
})
|
|
2581
2581
|
), o.appendChild(
|
|
2582
|
-
|
|
2582
|
+
A("feDisplacementMap", {
|
|
2583
2583
|
in: "SourceGraphic",
|
|
2584
2584
|
in2: "stroke-noise",
|
|
2585
2585
|
scale: "3.5",
|
|
@@ -2588,7 +2588,7 @@ function ln(e, t, n) {
|
|
|
2588
2588
|
result: "warped"
|
|
2589
2589
|
})
|
|
2590
2590
|
), o.appendChild(
|
|
2591
|
-
|
|
2591
|
+
A("feTurbulence", {
|
|
2592
2592
|
type: "fractalNoise",
|
|
2593
2593
|
baseFrequency: "0.7",
|
|
2594
2594
|
numOctaves: "1",
|
|
@@ -2596,7 +2596,7 @@ function ln(e, t, n) {
|
|
|
2596
2596
|
result: "ink-noise"
|
|
2597
2597
|
})
|
|
2598
2598
|
), o.appendChild(
|
|
2599
|
-
|
|
2599
|
+
A("feDisplacementMap", {
|
|
2600
2600
|
in: "warped",
|
|
2601
2601
|
in2: "ink-noise",
|
|
2602
2602
|
scale: "0.9",
|
|
@@ -2605,7 +2605,7 @@ function ln(e, t, n) {
|
|
|
2605
2605
|
})
|
|
2606
2606
|
), o;
|
|
2607
2607
|
}
|
|
2608
|
-
function
|
|
2608
|
+
function hr(e) {
|
|
2609
2609
|
const t = ue(
|
|
2610
2610
|
"0 0 24 24",
|
|
2611
2611
|
e,
|
|
@@ -2614,9 +2614,9 @@ function gr(e) {
|
|
|
2614
2614
|
"currentColor",
|
|
2615
2615
|
"2.25"
|
|
2616
2616
|
);
|
|
2617
|
-
return t.appendChild(
|
|
2617
|
+
return t.appendChild(A("path", { d: "m6 9 6 6 6-6" })), t;
|
|
2618
2618
|
}
|
|
2619
|
-
function
|
|
2619
|
+
function mr() {
|
|
2620
2620
|
const e = ue(
|
|
2621
2621
|
"0 0 24 24",
|
|
2622
2622
|
17,
|
|
@@ -2626,16 +2626,16 @@ function hr() {
|
|
|
2626
2626
|
"2.25"
|
|
2627
2627
|
);
|
|
2628
2628
|
return e.appendChild(
|
|
2629
|
-
|
|
2629
|
+
A("path", {
|
|
2630
2630
|
d: "M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"
|
|
2631
2631
|
})
|
|
2632
2632
|
), e.appendChild(
|
|
2633
|
-
|
|
2633
|
+
A("path", {
|
|
2634
2634
|
d: "M18.4 2.6a2.1 2.1 0 0 1 3 3L12 15l-4 1 1-4Z"
|
|
2635
2635
|
})
|
|
2636
2636
|
), e;
|
|
2637
2637
|
}
|
|
2638
|
-
function
|
|
2638
|
+
function fr() {
|
|
2639
2639
|
const e = ue(
|
|
2640
2640
|
"0 0 24 24",
|
|
2641
2641
|
17,
|
|
@@ -2644,9 +2644,9 @@ function mr() {
|
|
|
2644
2644
|
"currentColor",
|
|
2645
2645
|
"2.25"
|
|
2646
2646
|
);
|
|
2647
|
-
return e.appendChild(
|
|
2647
|
+
return e.appendChild(A("path", { d: "M3 12a9 9 0 1 0 3-6.7" })), e.appendChild(A("path", { d: "M3 4v5h5" })), e.appendChild(A("path", { d: "M12 7v5l3 2" })), e;
|
|
2648
2648
|
}
|
|
2649
|
-
function
|
|
2649
|
+
function wr() {
|
|
2650
2650
|
const e = ue(
|
|
2651
2651
|
"0 0 24 24",
|
|
2652
2652
|
15,
|
|
@@ -2655,9 +2655,9 @@ function fr() {
|
|
|
2655
2655
|
"currentColor",
|
|
2656
2656
|
"2.4"
|
|
2657
2657
|
);
|
|
2658
|
-
return e.appendChild(
|
|
2658
|
+
return e.appendChild(A("path", { d: "M18 6 6 18" })), e.appendChild(A("path", { d: "m6 6 12 12" })), e;
|
|
2659
2659
|
}
|
|
2660
|
-
function
|
|
2660
|
+
function jo() {
|
|
2661
2661
|
const e = ue(
|
|
2662
2662
|
"0 0 24 24",
|
|
2663
2663
|
14,
|
|
@@ -2667,10 +2667,10 @@ function qo() {
|
|
|
2667
2667
|
"2.75"
|
|
2668
2668
|
);
|
|
2669
2669
|
return e.appendChild(
|
|
2670
|
-
|
|
2671
|
-
), e.appendChild(
|
|
2670
|
+
A("line", { x1: "12", y1: "19", x2: "12", y2: "5" })
|
|
2671
|
+
), e.appendChild(A("polyline", { points: "5 12 12 5 19 12" })), e;
|
|
2672
2672
|
}
|
|
2673
|
-
function
|
|
2673
|
+
function br() {
|
|
2674
2674
|
const e = ue(
|
|
2675
2675
|
"0 0 24 24",
|
|
2676
2676
|
16,
|
|
@@ -2683,18 +2683,18 @@ function wr() {
|
|
|
2683
2683
|
"class",
|
|
2684
2684
|
"pluno-pa-widget__paperclip-icon pluno-pa-widget__paperclip-icon--standard"
|
|
2685
2685
|
), e.appendChild(
|
|
2686
|
-
|
|
2686
|
+
A("path", {
|
|
2687
2687
|
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"
|
|
2688
2688
|
})
|
|
2689
2689
|
), e;
|
|
2690
2690
|
}
|
|
2691
|
-
function
|
|
2691
|
+
function _r() {
|
|
2692
2692
|
const e = ue("0 0 24 24", 19, 19, "none", "currentColor");
|
|
2693
2693
|
return e.setAttribute(
|
|
2694
2694
|
"class",
|
|
2695
2695
|
"pluno-pa-widget__paperclip-icon pluno-pa-widget__paperclip-icon--scribble"
|
|
2696
2696
|
), e.appendChild(
|
|
2697
|
-
|
|
2697
|
+
A("path", {
|
|
2698
2698
|
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",
|
|
2699
2699
|
stroke: "currentColor",
|
|
2700
2700
|
"stroke-width": "2",
|
|
@@ -2703,10 +2703,10 @@ function br() {
|
|
|
2703
2703
|
})
|
|
2704
2704
|
), e;
|
|
2705
2705
|
}
|
|
2706
|
-
function
|
|
2706
|
+
function xr() {
|
|
2707
2707
|
const e = ue("0 0 24 24", 18, 18, "currentColor");
|
|
2708
2708
|
return e.appendChild(
|
|
2709
|
-
|
|
2709
|
+
A("rect", {
|
|
2710
2710
|
x: "6",
|
|
2711
2711
|
y: "6",
|
|
2712
2712
|
width: "12",
|
|
@@ -2715,7 +2715,7 @@ function _r() {
|
|
|
2715
2715
|
})
|
|
2716
2716
|
), e;
|
|
2717
2717
|
}
|
|
2718
|
-
function
|
|
2718
|
+
function yr() {
|
|
2719
2719
|
const e = ue(
|
|
2720
2720
|
"0 0 24 24",
|
|
2721
2721
|
12,
|
|
@@ -2724,9 +2724,9 @@ function xr() {
|
|
|
2724
2724
|
"currentColor",
|
|
2725
2725
|
"2.4"
|
|
2726
2726
|
);
|
|
2727
|
-
return e.appendChild(
|
|
2727
|
+
return e.appendChild(A("path", { d: "M18 6 6 18" })), e.appendChild(A("path", { d: "m6 6 12 12" })), e;
|
|
2728
2728
|
}
|
|
2729
|
-
function
|
|
2729
|
+
function vr() {
|
|
2730
2730
|
const e = ue(
|
|
2731
2731
|
"0 0 24 24",
|
|
2732
2732
|
13,
|
|
@@ -2736,7 +2736,7 @@ function yr() {
|
|
|
2736
2736
|
"2.25"
|
|
2737
2737
|
);
|
|
2738
2738
|
return e.appendChild(
|
|
2739
|
-
|
|
2739
|
+
A("rect", {
|
|
2740
2740
|
width: "14",
|
|
2741
2741
|
height: "14",
|
|
2742
2742
|
x: "8",
|
|
@@ -2745,7 +2745,7 @@ function yr() {
|
|
|
2745
2745
|
ry: "2"
|
|
2746
2746
|
})
|
|
2747
2747
|
), e.appendChild(
|
|
2748
|
-
|
|
2748
|
+
A("path", {
|
|
2749
2749
|
d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"
|
|
2750
2750
|
})
|
|
2751
2751
|
), e;
|
|
@@ -2758,33 +2758,33 @@ function ue(e, t, n, o, i, r) {
|
|
|
2758
2758
|
fill: o,
|
|
2759
2759
|
"aria-hidden": "true"
|
|
2760
2760
|
};
|
|
2761
|
-
return i && (l.stroke = i, l["stroke-linecap"] = "round", l["stroke-linejoin"] = "round"), r && (l["stroke-width"] = r),
|
|
2761
|
+
return i && (l.stroke = i, l["stroke-linecap"] = "round", l["stroke-linejoin"] = "round"), r && (l["stroke-width"] = r), A("svg", l);
|
|
2762
2762
|
}
|
|
2763
|
-
function
|
|
2764
|
-
const n = document.createElementNS(
|
|
2763
|
+
function A(e, t = {}) {
|
|
2764
|
+
const n = document.createElementNS(zo, e);
|
|
2765
2765
|
for (const [o, i] of Object.entries(t))
|
|
2766
2766
|
n.setAttribute(o, i);
|
|
2767
2767
|
return n;
|
|
2768
2768
|
}
|
|
2769
|
-
function
|
|
2769
|
+
function ho(e) {
|
|
2770
2770
|
for (const t of ["keydown", "keypress", "keyup"])
|
|
2771
2771
|
e.addEventListener(t, (n) => {
|
|
2772
2772
|
n.stopPropagation();
|
|
2773
2773
|
});
|
|
2774
2774
|
}
|
|
2775
|
-
function
|
|
2775
|
+
function Cr(e, t, n) {
|
|
2776
2776
|
e.replaceChildren(), e.hidden = t.length === 0;
|
|
2777
2777
|
for (const [o, i] of t.entries()) {
|
|
2778
2778
|
const r = document.createElement("div");
|
|
2779
2779
|
r.className = "pluno-pa-widget__attachment", r.appendChild(Sr(i));
|
|
2780
2780
|
const l = document.createElement("span");
|
|
2781
2781
|
l.textContent = i.name, r.appendChild(l);
|
|
2782
|
-
const
|
|
2783
|
-
|
|
2782
|
+
const s = document.createElement("button");
|
|
2783
|
+
s.type = "button", s.setAttribute("aria-label", `Remove ${i.name}`), s.appendChild(yr()), s.addEventListener("click", () => n(o)), r.appendChild(s), e.appendChild(r);
|
|
2784
2784
|
}
|
|
2785
2785
|
}
|
|
2786
2786
|
function Sr(e) {
|
|
2787
|
-
const t =
|
|
2787
|
+
const t = En(e), n = Ko(e);
|
|
2788
2788
|
if (t === "image" && n) {
|
|
2789
2789
|
const o = document.createElement("img");
|
|
2790
2790
|
return o.src = n, o.alt = "", o.setAttribute("aria-hidden", "true"), o.addEventListener(
|
|
@@ -2804,8 +2804,8 @@ function Sr(e) {
|
|
|
2804
2804
|
}
|
|
2805
2805
|
return ce(e);
|
|
2806
2806
|
}
|
|
2807
|
-
function
|
|
2808
|
-
const n =
|
|
2807
|
+
function Er(e, t) {
|
|
2808
|
+
const n = En(e), o = Ko(e);
|
|
2809
2809
|
if (n === "image" && o) {
|
|
2810
2810
|
const i = document.createElement("img");
|
|
2811
2811
|
i.className = "pluno-pa-widget__message-attachment-preview", i.alt = e.name;
|
|
@@ -2847,109 +2847,109 @@ function Cr(e, t) {
|
|
|
2847
2847
|
function ce(e, t = "composer") {
|
|
2848
2848
|
if (t === "composer") {
|
|
2849
2849
|
const r = document.createElement("span");
|
|
2850
|
-
return r.className = "pluno-pa-widget__attachment-file", r.textContent =
|
|
2850
|
+
return r.className = "pluno-pa-widget__attachment-file", r.textContent = mo(e), r;
|
|
2851
2851
|
}
|
|
2852
2852
|
const n = document.createElement("div");
|
|
2853
2853
|
n.className = "pluno-pa-widget__message-attachment-file";
|
|
2854
2854
|
const o = document.createElement("span");
|
|
2855
|
-
o.textContent =
|
|
2855
|
+
o.textContent = mo(e);
|
|
2856
2856
|
const i = document.createElement("strong");
|
|
2857
2857
|
return i.textContent = e.name, n.append(o, i), n;
|
|
2858
2858
|
}
|
|
2859
|
-
function
|
|
2859
|
+
function En(e) {
|
|
2860
2860
|
return e.mimeType.startsWith("image/") ? "image" : e.mimeType === "application/pdf" ? "pdf" : e.mimeType.startsWith("video/") ? "video" : "file";
|
|
2861
2861
|
}
|
|
2862
|
-
function
|
|
2862
|
+
function Ko(e) {
|
|
2863
2863
|
return "previewUrl" in e && e.previewUrl ? e.previewUrl : e.fileUrl ?? "";
|
|
2864
2864
|
}
|
|
2865
|
-
function
|
|
2866
|
-
const t =
|
|
2865
|
+
function mo(e) {
|
|
2866
|
+
const t = En(e);
|
|
2867
2867
|
return t === "image" ? "IMG" : t === "pdf" ? "PDF" : t === "video" ? "VID" : "FILE";
|
|
2868
2868
|
}
|
|
2869
|
-
function
|
|
2869
|
+
function kr(e, t) {
|
|
2870
2870
|
return t ? Array.from(t).map((o) => ({
|
|
2871
2871
|
...e.createLocalAttachment(o),
|
|
2872
|
-
previewUrl:
|
|
2872
|
+
previewUrl: Lr(o)
|
|
2873
2873
|
})) : [];
|
|
2874
2874
|
}
|
|
2875
|
-
function
|
|
2875
|
+
function Lr(e) {
|
|
2876
2876
|
return typeof URL.createObjectURL == "function" ? URL.createObjectURL(e) : void 0;
|
|
2877
2877
|
}
|
|
2878
|
-
function
|
|
2878
|
+
function St(e) {
|
|
2879
2879
|
return !!(e && Array.from(e.types).includes("Files"));
|
|
2880
2880
|
}
|
|
2881
2881
|
function sn(e, t, n = null) {
|
|
2882
|
-
if (!e || !
|
|
2882
|
+
if (!e || !xn(t, n)) {
|
|
2883
2883
|
e && (e.hidden = !0, e.replaceChildren());
|
|
2884
2884
|
return;
|
|
2885
2885
|
}
|
|
2886
|
-
e.hidden = !1, e.replaceChildren(), e.className = "pluno-pa-widget__billing-status", se(t) ||
|
|
2887
|
-
|
|
2888
|
-
) :
|
|
2886
|
+
e.hidden = !1, e.replaceChildren(), e.className = "pluno-pa-widget__billing-status", se(t) || kn(n) ? e.appendChild(
|
|
2887
|
+
Tr(t, n)
|
|
2888
|
+
) : Vo(t) && e.appendChild(Ar(t));
|
|
2889
2889
|
}
|
|
2890
|
-
function
|
|
2890
|
+
function Tr(e, t) {
|
|
2891
2891
|
const n = document.createElement("div");
|
|
2892
2892
|
n.className = "pluno-pa-widget__billing-action-card";
|
|
2893
2893
|
const o = e.limitExceeded || t === "limit_exceeded", i = document.createElement("strong");
|
|
2894
2894
|
i.textContent = o ? "Credits used up" : "Billing needs attention", n.appendChild(i);
|
|
2895
2895
|
const r = document.createElement("span");
|
|
2896
2896
|
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(
|
|
2897
|
-
|
|
2897
|
+
Yo(
|
|
2898
2898
|
e,
|
|
2899
2899
|
"Upgrade plan",
|
|
2900
2900
|
"pluno-pa-widget__billing-action-card-actions"
|
|
2901
2901
|
)
|
|
2902
2902
|
), n;
|
|
2903
2903
|
}
|
|
2904
|
-
function
|
|
2904
|
+
function Ar(e) {
|
|
2905
2905
|
const t = document.createElement("div");
|
|
2906
2906
|
t.className = "pluno-pa-widget__billing-action-card pluno-pa-widget__billing-action-card--low";
|
|
2907
2907
|
const n = document.createElement("strong");
|
|
2908
2908
|
n.textContent = "Credits running low", t.appendChild(n);
|
|
2909
2909
|
const o = document.createElement("span");
|
|
2910
|
-
return o.textContent =
|
|
2911
|
-
|
|
2910
|
+
return o.textContent = Ir(e) ?? "Credits are running low for this period.", t.appendChild(o), t.appendChild(
|
|
2911
|
+
Yo(
|
|
2912
2912
|
e,
|
|
2913
2913
|
"Upgrade",
|
|
2914
2914
|
"pluno-pa-widget__billing-action-card-actions"
|
|
2915
2915
|
)
|
|
2916
2916
|
), t;
|
|
2917
2917
|
}
|
|
2918
|
-
function
|
|
2919
|
-
return e !== null && (se(e) ||
|
|
2918
|
+
function xn(e, t) {
|
|
2919
|
+
return e !== null && (se(e) || Vo(e) || kn(t));
|
|
2920
2920
|
}
|
|
2921
|
-
function
|
|
2922
|
-
return
|
|
2921
|
+
function fo(e, t, n) {
|
|
2922
|
+
return xn(t, n) || Pr(t) ? !0 : !xn(e, n);
|
|
2923
2923
|
}
|
|
2924
|
-
function
|
|
2924
|
+
function Pr(e) {
|
|
2925
2925
|
return e != null && (e.creditsUsed !== null || e.creditLimit !== null || e.creditsRemaining !== null || se(e));
|
|
2926
2926
|
}
|
|
2927
2927
|
function se(e) {
|
|
2928
2928
|
return e?.limitExceeded === !0 || !!e?.paymentIssue;
|
|
2929
2929
|
}
|
|
2930
|
-
function
|
|
2930
|
+
function kn(e) {
|
|
2931
2931
|
return e === "limit_exceeded" || e === "subscription_required" || e === "subscription_inactive" || e === "payment_issue" || e === "subscription_invalid" || e === "payment_required";
|
|
2932
2932
|
}
|
|
2933
|
-
function
|
|
2933
|
+
function Vo(e) {
|
|
2934
2934
|
return !se(e) && e.creditLimit !== null && e.creditLimit > 0 && e.creditsRemaining !== null && e.creditsRemaining > 0 && e.creditsRemaining / e.creditLimit <= 0.2;
|
|
2935
2935
|
}
|
|
2936
|
-
function Pr(e) {
|
|
2937
|
-
return e.creditsRemaining === null ? null : `${Ir(e.creditsRemaining)} credits left`;
|
|
2938
|
-
}
|
|
2939
2936
|
function Ir(e) {
|
|
2937
|
+
return e.creditsRemaining === null ? null : `${Nr(e.creditsRemaining)} credits left`;
|
|
2938
|
+
}
|
|
2939
|
+
function Nr(e) {
|
|
2940
2940
|
return new Intl.NumberFormat("en-US", {
|
|
2941
2941
|
maximumFractionDigits: 0
|
|
2942
2942
|
}).format(Math.ceil(e));
|
|
2943
2943
|
}
|
|
2944
|
-
function
|
|
2944
|
+
function Yo(e, t, n) {
|
|
2945
2945
|
const o = document.createElement("div");
|
|
2946
2946
|
return o.className = n, o.appendChild(
|
|
2947
|
-
|
|
2947
|
+
wo(t, e.pricingUrl)
|
|
2948
2948
|
), o.appendChild(
|
|
2949
|
-
|
|
2949
|
+
wo("Earn credits", e.earnCreditsUrl)
|
|
2950
2950
|
), o;
|
|
2951
2951
|
}
|
|
2952
|
-
function
|
|
2952
|
+
function wo(e, t) {
|
|
2953
2953
|
const n = document.createElement("button");
|
|
2954
2954
|
if (n.type = "button", e === "Earn credits") {
|
|
2955
2955
|
const o = document.createElement("span");
|
|
@@ -2962,223 +2962,223 @@ function fo(e, t) {
|
|
|
2962
2962
|
}
|
|
2963
2963
|
function pn(e, t) {
|
|
2964
2964
|
return e.messages.filter(
|
|
2965
|
-
(o) => !
|
|
2965
|
+
(o) => !Zo(o)
|
|
2966
2966
|
).length === 0 && !e.assistantDraft && !e.lastError && !e.isThinking && !t;
|
|
2967
2967
|
}
|
|
2968
|
-
function
|
|
2969
|
-
const ne =
|
|
2970
|
-
ne.filter((
|
|
2971
|
-
), Xe = e.scrollTop,
|
|
2972
|
-
|
|
2968
|
+
function Rr(e, t, n, o, i, r, l, s, p, u, g, h, x, v, L, D, c, E, m, z, O, P) {
|
|
2969
|
+
const ne = Ur(r), W = Br(
|
|
2970
|
+
ne.filter((C) => !Zo(C))
|
|
2971
|
+
), Xe = e.scrollTop, Be = [], ge = /* @__PURE__ */ new Set(), B = (C) => {
|
|
2972
|
+
Be.push(C);
|
|
2973
2973
|
};
|
|
2974
|
-
|
|
2975
|
-
const
|
|
2976
|
-
if (o(
|
|
2977
|
-
const
|
|
2978
|
-
|
|
2979
|
-
const
|
|
2980
|
-
|
|
2981
|
-
const I =
|
|
2974
|
+
ti(n, r.isThinking), i.hidden = !s, s && l !== null && Ho(i, l);
|
|
2975
|
+
const y = W.length > 0 || !!r.assistantDraft || r.isThinking;
|
|
2976
|
+
if (o(y), c || W.length === 0 && !r.assistantDraft && !r.lastError && !r.isThinking) {
|
|
2977
|
+
const C = document.createElement("div");
|
|
2978
|
+
C.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter" + (c ? " pluno-pa-widget__empty-state--morning-report" : "");
|
|
2979
|
+
const T = document.createElement("div");
|
|
2980
|
+
T.className = "pluno-pa-widget__empty-hero";
|
|
2981
|
+
const I = Le(
|
|
2982
2982
|
"pluno-pa-widget__character--empty",
|
|
2983
|
-
|
|
2983
|
+
v()
|
|
2984
2984
|
);
|
|
2985
|
-
if (
|
|
2985
|
+
if (T.appendChild(I), C.appendChild(T), c) {
|
|
2986
2986
|
const w = document.createElement("h2");
|
|
2987
|
-
w.className = "pluno-pa-widget__empty pluno-pa-widget__morning-report-title", w.textContent = c.opening,
|
|
2987
|
+
w.className = "pluno-pa-widget__empty pluno-pa-widget__morning-report-title", w.textContent = c.opening, C.appendChild(w);
|
|
2988
2988
|
} else
|
|
2989
|
-
|
|
2989
|
+
C.appendChild(Wo());
|
|
2990
2990
|
const ve = c?.prompts ?? r.starterPrompts, oe = document.createElement("div");
|
|
2991
2991
|
if (oe.className = ve.length > 0 ? "pluno-pa-widget__starter-prompts" : "pluno-pa-widget__starter-prompts pluno-pa-widget__starter-prompts--empty", ve.length === 0 && !r.starterPromptsLoading && oe.setAttribute("aria-hidden", "true"), ve.length > 0)
|
|
2992
2992
|
for (const w of ve) {
|
|
2993
|
-
const
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
}), oe.appendChild(
|
|
2993
|
+
const k = document.createElement("button");
|
|
2994
|
+
k.type = "button", k.className = "pluno-pa-widget__starter-prompt", k.textContent = `"${w}"`, k.addEventListener("click", () => {
|
|
2995
|
+
L(w);
|
|
2996
|
+
}), oe.appendChild(k);
|
|
2997
2997
|
}
|
|
2998
2998
|
else if (r.starterPromptsLoading) {
|
|
2999
2999
|
const w = document.createElement("button");
|
|
3000
3000
|
w.type = "button", w.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder pluno-pa-widget__starter-prompt--loading", w.disabled = !0, w.tabIndex = -1, w.textContent = "Generating example tasks...", oe.appendChild(w);
|
|
3001
3001
|
} else
|
|
3002
|
-
for (let w = 0; w <
|
|
3003
|
-
const
|
|
3004
|
-
|
|
3002
|
+
for (let w = 0; w < fa; w += 1) {
|
|
3003
|
+
const k = document.createElement("button");
|
|
3004
|
+
k.type = "button", k.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder", k.disabled = !0, k.tabIndex = -1, k.textContent = "", oe.appendChild(k);
|
|
3005
3005
|
}
|
|
3006
|
-
if (
|
|
3006
|
+
if (C.appendChild(oe), c) {
|
|
3007
3007
|
const w = document.createElement("button");
|
|
3008
|
-
w.type = "button", w.className = "pluno-pa-widget__morning-report-snooze", w.textContent = "Snooze morning report", w.addEventListener("click",
|
|
3008
|
+
w.type = "button", w.className = "pluno-pa-widget__morning-report-snooze", w.textContent = "Snooze morning report", w.addEventListener("click", E), C.appendChild(w);
|
|
3009
3009
|
}
|
|
3010
|
-
h.clear(), B(
|
|
3010
|
+
h.clear(), B(C), B(t), bo(e, Be);
|
|
3011
3011
|
return;
|
|
3012
3012
|
}
|
|
3013
|
-
let F = null,
|
|
3014
|
-
const V = W.length - 1, ut = V >= 0 &&
|
|
3013
|
+
let F = null, G = null, Z = [], Te = [];
|
|
3014
|
+
const V = W.length - 1, ut = V >= 0 && yn(W[V]), Ae = Fr(W);
|
|
3015
3015
|
let he = !1;
|
|
3016
3016
|
const me = () => {
|
|
3017
3017
|
if (Z.length === 0)
|
|
3018
3018
|
return he = !1, !1;
|
|
3019
|
-
const
|
|
3020
|
-
(I) =>
|
|
3021
|
-
),
|
|
3019
|
+
const C = Ae !== null && Z.some(
|
|
3020
|
+
(I) => Xo(I, Ae)
|
|
3021
|
+
), T = Zr(
|
|
3022
3022
|
Z,
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3023
|
+
C,
|
|
3024
|
+
g,
|
|
3025
|
+
x,
|
|
3026
|
+
v()
|
|
3027
3027
|
);
|
|
3028
|
-
return B(
|
|
3029
|
-
},
|
|
3030
|
-
for (const
|
|
3031
|
-
B(
|
|
3032
|
-
|
|
3028
|
+
return B(T), F = null, G = T, Z = [], he = C, !0;
|
|
3029
|
+
}, M = () => {
|
|
3030
|
+
for (const C of Te)
|
|
3031
|
+
B(C), F = null, G = C;
|
|
3032
|
+
Te = [];
|
|
3033
3033
|
};
|
|
3034
|
-
for (let
|
|
3035
|
-
const
|
|
3036
|
-
if (
|
|
3037
|
-
const w =
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3034
|
+
for (let C = 0; C < W.length; C += 1) {
|
|
3035
|
+
const T = W[C];
|
|
3036
|
+
if (T.role === "tool" && T.integrationAuthRequest && O) {
|
|
3037
|
+
const w = Dr(
|
|
3038
|
+
T.integrationAuthRequest,
|
|
3039
|
+
O.states.get(
|
|
3040
|
+
T.integrationAuthRequest.authRequestId
|
|
3041
3041
|
) ?? {
|
|
3042
|
-
status:
|
|
3042
|
+
status: O.initialStatus
|
|
3043
3043
|
},
|
|
3044
|
-
|
|
3044
|
+
O.onConnect
|
|
3045
3045
|
);
|
|
3046
|
-
|
|
3046
|
+
Te.push(w);
|
|
3047
3047
|
continue;
|
|
3048
3048
|
}
|
|
3049
|
-
if (
|
|
3050
|
-
Z.push(
|
|
3049
|
+
if (T.role === "tool") {
|
|
3050
|
+
Z.push(T);
|
|
3051
3051
|
continue;
|
|
3052
3052
|
}
|
|
3053
|
-
if (
|
|
3054
|
-
if (
|
|
3053
|
+
if (yn(T)) {
|
|
3054
|
+
if (C !== V)
|
|
3055
3055
|
continue;
|
|
3056
3056
|
if (me()) {
|
|
3057
3057
|
if (!he) {
|
|
3058
|
-
const
|
|
3059
|
-
B(
|
|
3058
|
+
const k = ct();
|
|
3059
|
+
B(k), F = null, G = k;
|
|
3060
3060
|
}
|
|
3061
3061
|
} else {
|
|
3062
|
-
const
|
|
3063
|
-
B(
|
|
3062
|
+
const k = yo(v());
|
|
3063
|
+
B(k), F = null, G = k;
|
|
3064
3064
|
}
|
|
3065
3065
|
continue;
|
|
3066
3066
|
}
|
|
3067
|
-
if (
|
|
3068
|
-
if (
|
|
3067
|
+
if (T.role === "system") {
|
|
3068
|
+
if (T.dataType === "run_error" || T.dataType === "run_status") {
|
|
3069
3069
|
me();
|
|
3070
|
-
const w = document.createElement("div"),
|
|
3071
|
-
if (w.className =
|
|
3072
|
-
|
|
3073
|
-
),
|
|
3070
|
+
const w = document.createElement("div"), k = T.dataType === "run_error";
|
|
3071
|
+
if (w.className = k ? "pluno-pa-widget__error" : "pluno-pa-widget__status pluno-pa-widget__run-status", w.textContent = vn(
|
|
3072
|
+
T.content
|
|
3073
|
+
), k && T.securitySettingsUrl) {
|
|
3074
3074
|
const q = document.createElement("a");
|
|
3075
|
-
q.className = "pluno-pa-widget__error-retry", q.href =
|
|
3075
|
+
q.className = "pluno-pa-widget__error-retry", q.href = T.securitySettingsUrl, q.target = "_blank", q.rel = "noreferrer", q.textContent = "Security settings", w.appendChild(q);
|
|
3076
3076
|
}
|
|
3077
|
-
B(w), F =
|
|
3077
|
+
B(w), F = k ? w : null, G = k ? null : w, M();
|
|
3078
3078
|
}
|
|
3079
3079
|
continue;
|
|
3080
3080
|
}
|
|
3081
|
-
|
|
3082
|
-
const I = me(), ve =
|
|
3083
|
-
if (
|
|
3084
|
-
const w =
|
|
3085
|
-
B(w), F = null,
|
|
3081
|
+
T.role === "user" && M();
|
|
3082
|
+
const I = me(), ve = vn(T.content);
|
|
3083
|
+
if (T.role === "assistant" && !I) {
|
|
3084
|
+
const w = Qo(v());
|
|
3085
|
+
B(w), F = null, G = w;
|
|
3086
3086
|
}
|
|
3087
|
-
const oe =
|
|
3088
|
-
|
|
3087
|
+
const oe = zr(
|
|
3088
|
+
T,
|
|
3089
3089
|
ve,
|
|
3090
3090
|
h,
|
|
3091
3091
|
ge,
|
|
3092
|
-
|
|
3092
|
+
z
|
|
3093
3093
|
);
|
|
3094
|
-
B(oe), F = oe,
|
|
3094
|
+
B(oe), F = oe, G = null, T.role === "assistant" && M();
|
|
3095
3095
|
}
|
|
3096
|
-
const Ze = me(),
|
|
3097
|
-
if (r.isThinking && !
|
|
3096
|
+
const Ze = me(), Pe = W[W.length - 1]?.role === "assistant";
|
|
3097
|
+
if (r.isThinking && !Pe && !ut)
|
|
3098
3098
|
if (Ze) {
|
|
3099
3099
|
if (!he) {
|
|
3100
|
-
const
|
|
3101
|
-
B(
|
|
3100
|
+
const C = ct();
|
|
3101
|
+
B(C), F = null, G = C;
|
|
3102
3102
|
}
|
|
3103
3103
|
} else {
|
|
3104
|
-
const
|
|
3105
|
-
B(
|
|
3104
|
+
const C = yo(v());
|
|
3105
|
+
B(C), F = null, G = C;
|
|
3106
3106
|
}
|
|
3107
3107
|
if (r.lastError) {
|
|
3108
|
-
const
|
|
3109
|
-
|
|
3110
|
-
const
|
|
3111
|
-
if (
|
|
3108
|
+
const C = document.createElement("div");
|
|
3109
|
+
C.className = "pluno-pa-widget__error";
|
|
3110
|
+
const T = document.createElement("span");
|
|
3111
|
+
if (T.textContent = r.lastError, C.appendChild(T), r.lastErrorSecuritySettingsUrl) {
|
|
3112
3112
|
const I = document.createElement("a");
|
|
3113
|
-
I.className = "pluno-pa-widget__error-retry", I.href = r.lastErrorSecuritySettingsUrl, I.target = "_blank", I.rel = "noreferrer", I.textContent = "Security settings",
|
|
3113
|
+
I.className = "pluno-pa-widget__error-retry", I.href = r.lastErrorSecuritySettingsUrl, I.target = "_blank", I.rel = "noreferrer", I.textContent = "Security settings", C.appendChild(I);
|
|
3114
3114
|
}
|
|
3115
3115
|
if (r.lastErrorCode === "run_recovery_exhausted" || r.lastErrorCode === "transient_model_error" || r.lastErrorCode === "run_still_active" || r.lastErrorCode === "connection_failed") {
|
|
3116
3116
|
const I = document.createElement("button");
|
|
3117
3117
|
I.type = "button", I.className = "pluno-pa-widget__error-retry", I.textContent = "Try again", I.addEventListener(
|
|
3118
3118
|
"click",
|
|
3119
|
-
r.lastErrorCode === "connection_failed" ? m :
|
|
3120
|
-
),
|
|
3119
|
+
r.lastErrorCode === "connection_failed" ? m : D
|
|
3120
|
+
), C.appendChild(I);
|
|
3121
3121
|
}
|
|
3122
|
-
B(
|
|
3122
|
+
B(C), F = C, G = null;
|
|
3123
3123
|
}
|
|
3124
|
-
const
|
|
3125
|
-
if (
|
|
3126
|
-
const
|
|
3127
|
-
isDrafting:
|
|
3128
|
-
error:
|
|
3129
|
-
characterIconOptions:
|
|
3130
|
-
onDraft:
|
|
3131
|
-
onDismiss:
|
|
3132
|
-
onDisable:
|
|
3124
|
+
const Ie = P ? P.draftingCandidate ?? (r.isThinking ? null : Ni(ne)) : null;
|
|
3125
|
+
if (P && Ie && !P.dismissedCandidateIds.has(Ie.id)) {
|
|
3126
|
+
const C = qr(Ie, {
|
|
3127
|
+
isDrafting: P.draftingCandidate?.id === Ie.id,
|
|
3128
|
+
error: P.error,
|
|
3129
|
+
characterIconOptions: P.characterIconOptions,
|
|
3130
|
+
onDraft: P.onDraft,
|
|
3131
|
+
onDismiss: P.onDismiss,
|
|
3132
|
+
onDisable: P.onDisable
|
|
3133
3133
|
});
|
|
3134
|
-
B(
|
|
3134
|
+
B(C), P.onSeen(Ie), F = null, G = C;
|
|
3135
3135
|
}
|
|
3136
|
-
|
|
3136
|
+
M(), F?.classList.add(
|
|
3137
3137
|
"pluno-pa-widget__message--bottom-reserve"
|
|
3138
|
-
),
|
|
3138
|
+
), G?.classList.add(
|
|
3139
3139
|
"pluno-pa-widget__bottom-reserve-compact"
|
|
3140
|
-
), B(t),
|
|
3140
|
+
), B(t), Or(
|
|
3141
3141
|
h,
|
|
3142
3142
|
ge
|
|
3143
|
-
),
|
|
3143
|
+
), bo(e, Be), p ? pt(e, u) : e.scrollTop = Xe;
|
|
3144
3144
|
}
|
|
3145
|
-
function
|
|
3145
|
+
function Dr(e, t, n) {
|
|
3146
3146
|
const o = document.createElement("section");
|
|
3147
3147
|
o.className = "pluno-pa-widget__integration-auth-card", o.setAttribute("aria-label", `Connect ${e.appName}`);
|
|
3148
3148
|
const i = document.createElement("div");
|
|
3149
3149
|
if (i.className = "pluno-pa-widget__integration-auth-header", e.appLogo) {
|
|
3150
|
-
const
|
|
3151
|
-
|
|
3150
|
+
const u = document.createElement("img");
|
|
3151
|
+
u.className = "pluno-pa-widget__integration-auth-logo", u.src = e.appLogo, u.alt = "", i.appendChild(u);
|
|
3152
3152
|
}
|
|
3153
3153
|
const r = document.createElement("div"), l = document.createElement("strong");
|
|
3154
3154
|
l.textContent = `Connect ${e.appName}`;
|
|
3155
|
-
const
|
|
3156
|
-
if (
|
|
3157
|
-
const
|
|
3158
|
-
|
|
3155
|
+
const s = document.createElement("span");
|
|
3156
|
+
if (s.textContent = "Authenticate in this browser so Pluno can continue your task.", r.append(l, s), i.appendChild(r), o.appendChild(i), t.error) {
|
|
3157
|
+
const u = document.createElement("div");
|
|
3158
|
+
u.className = "pluno-pa-widget__integration-auth-error", u.textContent = t.error, o.appendChild(u);
|
|
3159
3159
|
}
|
|
3160
|
-
const
|
|
3161
|
-
return
|
|
3160
|
+
const p = document.createElement("button");
|
|
3161
|
+
return p.type = "button", p.className = "pluno-pa-widget__integration-auth-button", p.disabled = t.status === "checking" || t.status === "connecting" || t.status === "completed", t.status === "checking" ? p.textContent = "Checking connection..." : t.status === "connecting" ? p.textContent = "Connecting..." : t.status === "completed" ? p.textContent = "Connected" : t.status === "expired" || t.status === "cancelled" ? p.textContent = `Reconnect ${e.appName}` : t.status === "error" ? p.textContent = "Try again" : p.textContent = `Connect ${e.appName}`, p.addEventListener("click", () => n(e)), o.appendChild(p), o;
|
|
3162
3162
|
}
|
|
3163
|
-
function
|
|
3164
|
-
const r =
|
|
3163
|
+
function zr(e, t, n, o, i) {
|
|
3164
|
+
const r = Mr(e, t), l = r ? n.get(r) : void 0;
|
|
3165
3165
|
if (r && l)
|
|
3166
3166
|
return l.classList.remove(
|
|
3167
3167
|
"pluno-pa-widget__message--bottom-reserve"
|
|
3168
3168
|
), o.add(r), l;
|
|
3169
|
-
const
|
|
3170
|
-
if (
|
|
3171
|
-
|
|
3169
|
+
const s = document.createElement("div");
|
|
3170
|
+
if (s.className = `pluno-pa-widget__message pluno-pa-widget__message--${e.role}`, e.role === "assistant" ? (e.phase && (s.dataset.phase = e.phase), nl(s, t)) : s.textContent = t, e.role === "user" && e.attachments?.length && s.appendChild(
|
|
3171
|
+
$r(
|
|
3172
3172
|
e.attachments,
|
|
3173
3173
|
i
|
|
3174
3174
|
)
|
|
3175
3175
|
), e.phase !== "commentary") {
|
|
3176
|
-
const
|
|
3177
|
-
|
|
3176
|
+
const p = document.createElement("div");
|
|
3177
|
+
p.className = "pluno-pa-widget__message-actions", p.appendChild(Gr(t)), s.appendChild(p);
|
|
3178
3178
|
}
|
|
3179
|
-
return r && (n.set(r,
|
|
3179
|
+
return r && (n.set(r, s), o.add(r)), s;
|
|
3180
3180
|
}
|
|
3181
|
-
function
|
|
3181
|
+
function Mr(e, t) {
|
|
3182
3182
|
return e.role !== "user" || !e.attachments?.length ? null : JSON.stringify({
|
|
3183
3183
|
id: e.id,
|
|
3184
3184
|
content: t,
|
|
@@ -3196,11 +3196,11 @@ function zr(e, t) {
|
|
|
3196
3196
|
})
|
|
3197
3197
|
});
|
|
3198
3198
|
}
|
|
3199
|
-
function
|
|
3199
|
+
function Or(e, t) {
|
|
3200
3200
|
for (const n of e.keys())
|
|
3201
3201
|
t.has(n) || e.delete(n);
|
|
3202
3202
|
}
|
|
3203
|
-
function
|
|
3203
|
+
function bo(e, t) {
|
|
3204
3204
|
let n = e.firstChild;
|
|
3205
3205
|
for (const o of t) {
|
|
3206
3206
|
if (o === n) {
|
|
@@ -3214,7 +3214,7 @@ function wo(e, t) {
|
|
|
3214
3214
|
n = n.nextSibling, e.removeChild(o);
|
|
3215
3215
|
}
|
|
3216
3216
|
}
|
|
3217
|
-
function
|
|
3217
|
+
function Ur(e) {
|
|
3218
3218
|
if (!e.assistantDraft)
|
|
3219
3219
|
return [...e.messages];
|
|
3220
3220
|
const t = {
|
|
@@ -3235,7 +3235,7 @@ function Or(e) {
|
|
|
3235
3235
|
if (n === -1)
|
|
3236
3236
|
return [...e.messages, t];
|
|
3237
3237
|
const o = e.messages.findIndex(
|
|
3238
|
-
(r, l) => l > n && r.role !== "user" && r.respondsToUserMessageId === t.respondsToUserMessageId &&
|
|
3238
|
+
(r, l) => l > n && r.role !== "user" && r.respondsToUserMessageId === t.respondsToUserMessageId && _o(r, t) && yn(r)
|
|
3239
3239
|
);
|
|
3240
3240
|
if (o !== -1)
|
|
3241
3241
|
return [
|
|
@@ -3244,7 +3244,7 @@ function Or(e) {
|
|
|
3244
3244
|
...e.messages.slice(o + 1)
|
|
3245
3245
|
];
|
|
3246
3246
|
let i = n + 1;
|
|
3247
|
-
for (; i < e.messages.length && e.messages[i].role !== "user" && e.messages[i].respondsToUserMessageId === t.respondsToUserMessageId &&
|
|
3247
|
+
for (; i < e.messages.length && e.messages[i].role !== "user" && e.messages[i].respondsToUserMessageId === t.respondsToUserMessageId && _o(e.messages[i], t); )
|
|
3248
3248
|
i += 1;
|
|
3249
3249
|
return [
|
|
3250
3250
|
...e.messages.slice(0, i),
|
|
@@ -3252,77 +3252,77 @@ function Or(e) {
|
|
|
3252
3252
|
...e.messages.slice(i)
|
|
3253
3253
|
];
|
|
3254
3254
|
}
|
|
3255
|
-
function
|
|
3255
|
+
function Br(e) {
|
|
3256
3256
|
return e.map(
|
|
3257
3257
|
(t) => t.role === "assistant" && t.phase === "commentary" ? { ...t, role: "tool" } : t
|
|
3258
3258
|
);
|
|
3259
3259
|
}
|
|
3260
|
-
function
|
|
3260
|
+
function Fr(e) {
|
|
3261
3261
|
const t = [...e].reverse().find((n) => n.role === "user");
|
|
3262
3262
|
for (let n = e.length - 1; n >= 0; n -= 1) {
|
|
3263
3263
|
const o = e[n];
|
|
3264
3264
|
if (!(o.role !== "tool" || e.slice(n + 1).some(
|
|
3265
|
-
(r) => (
|
|
3265
|
+
(r) => (Wr(r) || Hr(r)) && Xo(o, r)
|
|
3266
3266
|
)) && (o.loading || o.dataType === "assistant_draft" || t && o.respondsToUserMessageId === t.id))
|
|
3267
3267
|
return o;
|
|
3268
3268
|
}
|
|
3269
3269
|
return null;
|
|
3270
3270
|
}
|
|
3271
|
-
function
|
|
3271
|
+
function Wr(e) {
|
|
3272
3272
|
return e.role === "assistant" && e.phase !== "commentary";
|
|
3273
3273
|
}
|
|
3274
|
-
function
|
|
3274
|
+
function Hr(e) {
|
|
3275
3275
|
return e.role === "system" && (e.dataType === "run_error" || e.dataType === "run_status" && e.loading !== !0);
|
|
3276
3276
|
}
|
|
3277
|
-
function
|
|
3277
|
+
function Xo(e, t) {
|
|
3278
3278
|
return e.respondsToUserMessageId && t.respondsToUserMessageId ? e.respondsToUserMessageId === t.respondsToUserMessageId : e.runId && t.runId ? e.runId === t.runId : e.id === t.id;
|
|
3279
3279
|
}
|
|
3280
|
-
function
|
|
3280
|
+
function yn(e) {
|
|
3281
3281
|
return e.role === "system" && e.dataType === "run_status" && e.loading === !0;
|
|
3282
3282
|
}
|
|
3283
|
-
function
|
|
3283
|
+
function _o(e, t) {
|
|
3284
3284
|
return !e.runId || !t.runId ? !0 : e.runId === t.runId;
|
|
3285
3285
|
}
|
|
3286
|
-
function
|
|
3287
|
-
e.replaceChildren(),
|
|
3288
|
-
const
|
|
3289
|
-
|
|
3290
|
-
const
|
|
3286
|
+
function xo(e, t, n, o, i, r, l, s) {
|
|
3287
|
+
e.replaceChildren(), ti(t, !1), t.disabled = !0, n(!1);
|
|
3288
|
+
const p = document.createElement("div");
|
|
3289
|
+
p.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter";
|
|
3290
|
+
const u = Le(
|
|
3291
3291
|
"pluno-pa-widget__character--empty",
|
|
3292
3292
|
o()
|
|
3293
3293
|
);
|
|
3294
|
-
|
|
3295
|
-
const
|
|
3296
|
-
if (
|
|
3294
|
+
p.appendChild(u);
|
|
3295
|
+
const g = document.createElement("div");
|
|
3296
|
+
if (g.className = "pluno-pa-widget__empty", g.textContent = i, p.appendChild(g), l) {
|
|
3297
3297
|
const h = document.createElement("a");
|
|
3298
|
-
h.className = "pluno-pa-widget__login", h.href = l, h.target = "_blank", h.rel = "noopener noreferrer", h.textContent = r,
|
|
3298
|
+
h.className = "pluno-pa-widget__login", h.href = l, h.target = "_blank", h.rel = "noopener noreferrer", h.textContent = r, p.appendChild(h);
|
|
3299
3299
|
} else {
|
|
3300
3300
|
const h = document.createElement("button");
|
|
3301
|
-
h.type = "button", h.className = "pluno-pa-widget__login", h.textContent = r, h.addEventListener("click", () =>
|
|
3301
|
+
h.type = "button", h.className = "pluno-pa-widget__login", h.textContent = r, h.addEventListener("click", () => s?.()), p.appendChild(h);
|
|
3302
3302
|
}
|
|
3303
|
-
e.appendChild(
|
|
3303
|
+
e.appendChild(p);
|
|
3304
3304
|
}
|
|
3305
|
-
function
|
|
3305
|
+
function $r(e, t) {
|
|
3306
3306
|
const n = document.createElement("div");
|
|
3307
3307
|
n.className = "pluno-pa-widget__message-attachments";
|
|
3308
3308
|
for (const o of e)
|
|
3309
3309
|
n.appendChild(
|
|
3310
|
-
|
|
3310
|
+
Er(o, t)
|
|
3311
3311
|
);
|
|
3312
3312
|
return n;
|
|
3313
3313
|
}
|
|
3314
3314
|
function Gr(e) {
|
|
3315
3315
|
const t = document.createElement("button");
|
|
3316
|
-
return t.type = "button", t.className = "pluno-pa-widget__message-copy", t.setAttribute("aria-label", "Copy message"), t.title = "Copy message", t.appendChild(
|
|
3316
|
+
return t.type = "button", t.className = "pluno-pa-widget__message-copy", t.setAttribute("aria-label", "Copy message"), t.title = "Copy message", t.appendChild(vr()), t.addEventListener("click", (n) => {
|
|
3317
3317
|
n.preventDefault(), n.stopPropagation(), navigator.clipboard.writeText(e);
|
|
3318
3318
|
}), t;
|
|
3319
3319
|
}
|
|
3320
|
-
function
|
|
3320
|
+
function qr(e, t) {
|
|
3321
3321
|
const n = document.createElement("article");
|
|
3322
3322
|
n.className = "pluno-pa-widget__share-prompt";
|
|
3323
3323
|
const o = document.createElement("div");
|
|
3324
3324
|
o.className = "pluno-pa-widget__share-prompt-body", o.appendChild(
|
|
3325
|
-
|
|
3325
|
+
Le(
|
|
3326
3326
|
"pluno-pa-widget__share-prompt-icon",
|
|
3327
3327
|
t.characterIconOptions
|
|
3328
3328
|
)
|
|
@@ -3333,32 +3333,32 @@ function $r(e, t) {
|
|
|
3333
3333
|
r.textContent = "Share this win?", i.appendChild(r);
|
|
3334
3334
|
const l = document.createElement("span");
|
|
3335
3335
|
if (l.textContent = t.isDrafting ? "Drafting social post..." : "Create a screenshot and generate a draft for a social post.", i.appendChild(l), t.error) {
|
|
3336
|
-
const
|
|
3337
|
-
|
|
3336
|
+
const g = document.createElement("span");
|
|
3337
|
+
g.className = "pluno-pa-widget__share-prompt-error", g.textContent = t.error, i.appendChild(g);
|
|
3338
3338
|
}
|
|
3339
3339
|
o.appendChild(i);
|
|
3340
|
-
const p = document.createElement("div");
|
|
3341
|
-
p.className = "pluno-pa-widget__share-prompt-actions";
|
|
3342
3340
|
const s = document.createElement("div");
|
|
3343
|
-
s.className = "pluno-pa-widget__share-prompt-
|
|
3344
|
-
const
|
|
3345
|
-
|
|
3341
|
+
s.className = "pluno-pa-widget__share-prompt-actions";
|
|
3342
|
+
const p = document.createElement("div");
|
|
3343
|
+
p.className = "pluno-pa-widget__share-prompt-primary-actions";
|
|
3344
|
+
const u = document.createElement("button");
|
|
3345
|
+
if (u.type = "button", u.className = "pluno-pa-widget__share-prompt-draft", u.disabled = t.isDrafting, u.addEventListener("click", () => {
|
|
3346
3346
|
t.onDraft(e);
|
|
3347
|
-
}), t.isDrafting ? (
|
|
3348
|
-
|
|
3347
|
+
}), t.isDrafting ? (u.appendChild(ei()), u.appendChild(document.createTextNode("Drafting..."))) : u.textContent = "Draft a social post", p.appendChild(u), t.isDrafting)
|
|
3348
|
+
s.appendChild(p);
|
|
3349
3349
|
else {
|
|
3350
|
-
const
|
|
3351
|
-
|
|
3350
|
+
const g = document.createElement("button");
|
|
3351
|
+
g.type = "button", g.className = "pluno-pa-widget__share-prompt-dismiss", g.setAttribute("aria-label", "Dismiss share prompt"), g.title = "Dismiss", g.textContent = "Dismiss", g.addEventListener("click", () => {
|
|
3352
3352
|
t.onDismiss(e);
|
|
3353
|
-
}),
|
|
3353
|
+
}), p.appendChild(g), s.appendChild(p);
|
|
3354
3354
|
const h = document.createElement("button");
|
|
3355
3355
|
h.type = "button", h.className = "pluno-pa-widget__share-prompt-disable", h.textContent = "Don't ask again", h.addEventListener("click", () => {
|
|
3356
3356
|
t.onDisable(e);
|
|
3357
|
-
}),
|
|
3357
|
+
}), s.appendChild(h);
|
|
3358
3358
|
}
|
|
3359
|
-
return o.appendChild(
|
|
3359
|
+
return o.appendChild(s), n.appendChild(o), n;
|
|
3360
3360
|
}
|
|
3361
|
-
function
|
|
3361
|
+
function jr(e, t) {
|
|
3362
3362
|
const n = document.createElement("div");
|
|
3363
3363
|
n.className = "pluno-pa-widget__share-dialog-backdrop", n.addEventListener("click", (c) => {
|
|
3364
3364
|
c.target === n && t.onClose();
|
|
@@ -3369,60 +3369,60 @@ function qr(e, t) {
|
|
|
3369
3369
|
r.textContent = "Share this win", i.appendChild(r);
|
|
3370
3370
|
const l = document.createElement("button");
|
|
3371
3371
|
l.type = "button", l.className = "pluno-pa-widget__share-dialog-close", l.setAttribute("aria-label", "Close"), l.textContent = "×", l.addEventListener("click", t.onClose), i.appendChild(l), o.appendChild(i);
|
|
3372
|
-
const
|
|
3373
|
-
|
|
3374
|
-
const
|
|
3375
|
-
|
|
3376
|
-
const
|
|
3377
|
-
|
|
3378
|
-
const
|
|
3379
|
-
|
|
3380
|
-
const h =
|
|
3372
|
+
const s = document.createElement("p");
|
|
3373
|
+
s.className = "pluno-pa-widget__share-dialog-status", s.hidden = !0;
|
|
3374
|
+
const p = document.createElement("div");
|
|
3375
|
+
p.className = "pluno-pa-widget__share-dialog-step";
|
|
3376
|
+
const u = document.createElement("div");
|
|
3377
|
+
u.className = "pluno-pa-widget__share-dialog-step-header";
|
|
3378
|
+
const g = document.createElement("strong");
|
|
3379
|
+
g.textContent = "1) Copy Screenshot", u.appendChild(g);
|
|
3380
|
+
const h = Kr(
|
|
3381
3381
|
"Copy Screenshot",
|
|
3382
3382
|
async () => {
|
|
3383
3383
|
try {
|
|
3384
|
-
return await
|
|
3384
|
+
return await Ri(e.screenshotDataUrl ?? ""), s.textContent = "", s.hidden = !0, !0;
|
|
3385
3385
|
} catch {
|
|
3386
|
-
return
|
|
3386
|
+
return s.textContent = "Could not copy screenshot.", s.hidden = !1, !1;
|
|
3387
3387
|
}
|
|
3388
3388
|
}
|
|
3389
3389
|
);
|
|
3390
|
-
if (
|
|
3390
|
+
if (u.appendChild(h), p.appendChild(u), e.screenshotDataUrl) {
|
|
3391
3391
|
const c = document.createElement("div");
|
|
3392
3392
|
c.className = "pluno-pa-widget__share-dialog-screenshot";
|
|
3393
|
-
const
|
|
3394
|
-
|
|
3393
|
+
const E = document.createElement("img");
|
|
3394
|
+
E.src = e.screenshotDataUrl, E.alt = "Product page with Pluno open", c.appendChild(E), p.appendChild(c);
|
|
3395
3395
|
}
|
|
3396
|
-
o.appendChild(
|
|
3397
|
-
const
|
|
3398
|
-
|
|
3399
|
-
const
|
|
3400
|
-
|
|
3401
|
-
const
|
|
3402
|
-
|
|
3403
|
-
const
|
|
3404
|
-
|
|
3405
|
-
for (const c of
|
|
3406
|
-
const
|
|
3407
|
-
|
|
3396
|
+
o.appendChild(p), o.appendChild(s);
|
|
3397
|
+
const x = document.createElement("div");
|
|
3398
|
+
x.className = "pluno-pa-widget__share-dialog-step";
|
|
3399
|
+
const v = document.createElement("strong");
|
|
3400
|
+
v.className = "pluno-pa-widget__share-dialog-step-title", v.textContent = "2) Share on", x.appendChild(v);
|
|
3401
|
+
const L = document.createElement("p");
|
|
3402
|
+
L.className = "pluno-pa-widget__share-dialog-hint", L.textContent = "Post draft opens prefilled on supported platforms.", x.appendChild(L);
|
|
3403
|
+
const D = document.createElement("footer");
|
|
3404
|
+
D.className = "pluno-pa-widget__share-dialog-platforms";
|
|
3405
|
+
for (const c of Vr(e)) {
|
|
3406
|
+
const E = document.createElement("a");
|
|
3407
|
+
E.href = c.href, E.target = "_blank", E.rel = "noopener noreferrer", E.title = c.label, E.setAttribute("aria-label", `Open ${c.label}`), E.appendChild(Yr(c.id)), D.appendChild(E);
|
|
3408
3408
|
}
|
|
3409
|
-
if (
|
|
3409
|
+
if (x.appendChild(D), o.appendChild(x), t.socialPostRewardsUrl) {
|
|
3410
3410
|
const c = document.createElement("div");
|
|
3411
3411
|
c.className = "pluno-pa-widget__share-dialog-step";
|
|
3412
|
-
const
|
|
3413
|
-
|
|
3412
|
+
const E = document.createElement("strong");
|
|
3413
|
+
E.className = "pluno-pa-widget__share-dialog-step-title", E.textContent = "3) Submit post to get 2000 free credits!", c.appendChild(E);
|
|
3414
3414
|
const m = document.createElement("a");
|
|
3415
|
-
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(
|
|
3415
|
+
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(Xr()), c.appendChild(m), o.appendChild(c);
|
|
3416
3416
|
}
|
|
3417
3417
|
return n.appendChild(o), n;
|
|
3418
3418
|
}
|
|
3419
|
-
function
|
|
3419
|
+
function Kr(e, t) {
|
|
3420
3420
|
const n = document.createElement("button");
|
|
3421
3421
|
return n.type = "button", n.className = "pluno-pa-widget__share-dialog-copy", n.textContent = e, n.addEventListener("click", async (o) => {
|
|
3422
3422
|
o.preventDefault(), o.stopPropagation(), await t() && (n.textContent = "Copied ✓");
|
|
3423
3423
|
}), n;
|
|
3424
3424
|
}
|
|
3425
|
-
function
|
|
3425
|
+
function Vr(e) {
|
|
3426
3426
|
const t = e.linkedinPost.trim(), n = e.xPost.trim();
|
|
3427
3427
|
return [
|
|
3428
3428
|
{
|
|
@@ -3442,7 +3442,7 @@ function Kr(e) {
|
|
|
3442
3442
|
}
|
|
3443
3443
|
];
|
|
3444
3444
|
}
|
|
3445
|
-
function
|
|
3445
|
+
function Yr(e) {
|
|
3446
3446
|
const t = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
3447
3447
|
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" ? (K(t, "M6.7 13.2c.4 4.1.2 8.1.1 12.3"), K(
|
|
3448
3448
|
t,
|
|
@@ -3469,48 +3469,48 @@ function K(e, t, n) {
|
|
|
3469
3469
|
const o = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
3470
3470
|
o.setAttribute("d", t), n && o.setAttribute("opacity", n), e.appendChild(o);
|
|
3471
3471
|
}
|
|
3472
|
-
function
|
|
3472
|
+
function Xr() {
|
|
3473
3473
|
const e = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
3474
3474
|
return e.setAttribute("class", "pluno-pa-widget__share-dialog-external-icon"), e.setAttribute("viewBox", "0 0 24 24"), e.setAttribute("aria-hidden", "true"), K(e, "M14 5h5v5"), K(e, "M19 5l-8 8"), K(
|
|
3475
3475
|
e,
|
|
3476
3476
|
"M18 13v5a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1h5"
|
|
3477
3477
|
), e;
|
|
3478
3478
|
}
|
|
3479
|
-
function
|
|
3480
|
-
return e.role === "tool" && e.toolName ===
|
|
3479
|
+
function Zo(e) {
|
|
3480
|
+
return e.role === "tool" && e.toolName === Ao;
|
|
3481
3481
|
}
|
|
3482
|
-
function
|
|
3482
|
+
function vn(e) {
|
|
3483
3483
|
return e.replace(/\uE200[^\uE201]*(?:\uE201|$)/g, "");
|
|
3484
3484
|
}
|
|
3485
|
-
function
|
|
3485
|
+
function Zr(e, t, n, o, i) {
|
|
3486
3486
|
const r = document.createElement("article");
|
|
3487
3487
|
r.className = "pluno-pa-widget__tool-group", r.classList.toggle("pluno-pa-widget__tool-group--active", t), r.title = new Date(
|
|
3488
3488
|
e[e.length - 1].createdAt
|
|
3489
3489
|
).toLocaleString(), r.appendChild(
|
|
3490
|
-
|
|
3490
|
+
Le(
|
|
3491
3491
|
"pluno-pa-widget__character--tool-group",
|
|
3492
3492
|
i
|
|
3493
3493
|
)
|
|
3494
3494
|
);
|
|
3495
|
-
const l =
|
|
3495
|
+
const l = Jr(e, t);
|
|
3496
3496
|
if (t) {
|
|
3497
|
-
const
|
|
3498
|
-
return
|
|
3497
|
+
const v = document.createElement("div");
|
|
3498
|
+
return v.className = "pluno-pa-widget__tool-active-content", v.appendChild(ct()), v.appendChild(l), r.appendChild(v), r;
|
|
3499
3499
|
}
|
|
3500
|
-
const
|
|
3501
|
-
|
|
3502
|
-
r.classList.toggle("pluno-pa-widget__tool-group--open",
|
|
3500
|
+
const s = document.createElement("details"), p = Qr(e);
|
|
3501
|
+
s.open = n.has(p), r.classList.toggle("pluno-pa-widget__tool-group--open", s.open), s.addEventListener("toggle", () => {
|
|
3502
|
+
r.classList.toggle("pluno-pa-widget__tool-group--open", s.open), s.open ? n.add(p) : n.delete(p), o();
|
|
3503
3503
|
});
|
|
3504
|
-
const
|
|
3505
|
-
|
|
3506
|
-
const
|
|
3504
|
+
const u = document.createElement("summary");
|
|
3505
|
+
u.className = "pluno-pa-widget__tool-summary";
|
|
3506
|
+
const g = [...e].reverse().find((v) => v.phase !== "commentary");
|
|
3507
3507
|
e.some(
|
|
3508
|
-
(
|
|
3509
|
-
) &&
|
|
3510
|
-
const
|
|
3511
|
-
return
|
|
3508
|
+
(v) => v.phase !== "commentary" && v.loading
|
|
3509
|
+
) && u.appendChild(ei());
|
|
3510
|
+
const x = document.createElement("span");
|
|
3511
|
+
return x.className = "pluno-pa-widget__tool-summary-title", x.textContent = g ? Jo(g.content) : "Activity", u.appendChild(x), s.appendChild(u), s.appendChild(l), r.appendChild(s), r;
|
|
3512
3512
|
}
|
|
3513
|
-
function
|
|
3513
|
+
function Jr(e, t) {
|
|
3514
3514
|
const n = document.createElement("div");
|
|
3515
3515
|
n.className = "pluno-pa-widget__tool-lines";
|
|
3516
3516
|
const o = e[e.length - 1];
|
|
@@ -3519,26 +3519,26 @@ function Zr(e, t) {
|
|
|
3519
3519
|
r.className = "pluno-pa-widget__tool-line", r.dataset.eventType = i.phase === "commentary" ? "commentary" : "tool";
|
|
3520
3520
|
const l = document.createElement("span");
|
|
3521
3521
|
l.className = "pluno-pa-widget__tool-line-text";
|
|
3522
|
-
const
|
|
3523
|
-
t && i === o && i.phase !== "commentary" && (l.classList.add("pluno-pa-widget__tool-line-text--loading"), l.dataset.loadingText =
|
|
3522
|
+
const s = vn(i.content) || (i.phase === "commentary" ? "" : "Run tool"), p = i.phase === "commentary" ? s : Jo(s);
|
|
3523
|
+
t && i === o && i.phase !== "commentary" && (l.classList.add("pluno-pa-widget__tool-line-text--loading"), l.dataset.loadingText = p), l.textContent = p, r.appendChild(l), n.appendChild(r);
|
|
3524
3524
|
}
|
|
3525
3525
|
return n;
|
|
3526
3526
|
}
|
|
3527
|
-
function
|
|
3527
|
+
function Jo(e) {
|
|
3528
3528
|
const t = e.trim() || "Run tool", n = t.codePointAt(0) ?? 0;
|
|
3529
3529
|
return n >= 126976 && n <= 129791 || n >= 9728 && n <= 10175 || n >= 127462 && n <= 127487 ? t : `🛠️ ${t}`;
|
|
3530
3530
|
}
|
|
3531
|
-
function
|
|
3531
|
+
function Qo(e) {
|
|
3532
3532
|
const t = document.createElement("article");
|
|
3533
3533
|
return t.className = "pluno-pa-widget__tool-group pluno-pa-widget__assistant-marker", t.appendChild(
|
|
3534
|
-
|
|
3534
|
+
Le(
|
|
3535
3535
|
"pluno-pa-widget__character--tool-group",
|
|
3536
3536
|
e
|
|
3537
3537
|
)
|
|
3538
3538
|
), t;
|
|
3539
3539
|
}
|
|
3540
|
-
function
|
|
3541
|
-
const t =
|
|
3540
|
+
function yo(e) {
|
|
3541
|
+
const t = Qo(e);
|
|
3542
3542
|
return t.classList.add("pluno-pa-widget__thinking-marker"), t.appendChild(ct()), t;
|
|
3543
3543
|
}
|
|
3544
3544
|
function ct(e = "Thinking...") {
|
|
@@ -3549,18 +3549,68 @@ function ct(e = "Thinking...") {
|
|
|
3549
3549
|
const o = document.createElement("span");
|
|
3550
3550
|
return o.textContent = e, t.appendChild(o), t;
|
|
3551
3551
|
}
|
|
3552
|
-
function
|
|
3552
|
+
function Qr(e) {
|
|
3553
3553
|
return `tools:${e[0]?.id ?? ""}`;
|
|
3554
3554
|
}
|
|
3555
|
-
function
|
|
3555
|
+
function ei() {
|
|
3556
3556
|
const e = document.createElement("span");
|
|
3557
3557
|
return e.className = "pluno-pa-widget__spinner", e.setAttribute("aria-hidden", "true"), e;
|
|
3558
3558
|
}
|
|
3559
|
-
function
|
|
3560
|
-
e.setAttribute("aria-label", t ? "Stop" : "Send"), e.classList.toggle("pluno-pa-widget__send--stop", t), e.replaceChildren(t ?
|
|
3559
|
+
function ti(e, t) {
|
|
3560
|
+
e.setAttribute("aria-label", t ? "Stop" : "Send"), e.classList.toggle("pluno-pa-widget__send--stop", t), e.replaceChildren(t ? xr() : jo());
|
|
3561
3561
|
}
|
|
3562
|
-
function
|
|
3563
|
-
|
|
3562
|
+
function dn(e) {
|
|
3563
|
+
let t = e.trim();
|
|
3564
|
+
if (!t.includes("|"))
|
|
3565
|
+
return null;
|
|
3566
|
+
t.startsWith("|") && (t = t.slice(1)), t.endsWith("|") && !t.endsWith("\\|") && (t = t.slice(0, -1));
|
|
3567
|
+
const n = [];
|
|
3568
|
+
let o = "";
|
|
3569
|
+
for (let i = 0; i < t.length; i += 1) {
|
|
3570
|
+
const r = t[i];
|
|
3571
|
+
r === "\\" && t[i + 1] === "|" ? (o += "|", i += 1) : r === "|" ? (n.push(o.trim()), o = "") : o += r;
|
|
3572
|
+
}
|
|
3573
|
+
return n.push(o.trim()), n.length > 1 ? n : null;
|
|
3574
|
+
}
|
|
3575
|
+
function el(e) {
|
|
3576
|
+
const t = e.trim();
|
|
3577
|
+
if (/^:?-{3,}:?$/.test(t))
|
|
3578
|
+
return t.startsWith(":") && t.endsWith(":") ? "center" : t.endsWith(":") ? "right" : t.startsWith(":") ? "left" : null;
|
|
3579
|
+
}
|
|
3580
|
+
function tl(e, t) {
|
|
3581
|
+
const n = dn(e[t] ?? ""), o = dn(e[t + 1] ?? "");
|
|
3582
|
+
if (!n || !o || n.length !== o.length)
|
|
3583
|
+
return null;
|
|
3584
|
+
const i = [];
|
|
3585
|
+
for (const h of o) {
|
|
3586
|
+
const x = el(h);
|
|
3587
|
+
if (x === void 0)
|
|
3588
|
+
return null;
|
|
3589
|
+
i.push(x);
|
|
3590
|
+
}
|
|
3591
|
+
const r = document.createElement("div");
|
|
3592
|
+
r.className = "pluno-pa-widget__table-scroll";
|
|
3593
|
+
const l = document.createElement("table"), s = document.createElement("thead"), p = document.createElement("tr");
|
|
3594
|
+
n.forEach((h, x) => {
|
|
3595
|
+
const v = document.createElement("th"), L = i[x];
|
|
3596
|
+
L && v.classList.add(`pluno-pa-widget__table-cell--${L}`), ke(v, h), p.appendChild(v);
|
|
3597
|
+
}), s.appendChild(p), l.appendChild(s);
|
|
3598
|
+
const u = document.createElement("tbody");
|
|
3599
|
+
let g = t + 2;
|
|
3600
|
+
for (; g < e.length && e[g].trim(); ) {
|
|
3601
|
+
const h = dn(e[g]);
|
|
3602
|
+
if (!h)
|
|
3603
|
+
break;
|
|
3604
|
+
const x = document.createElement("tr");
|
|
3605
|
+
n.forEach((v, L) => {
|
|
3606
|
+
const D = document.createElement("td"), c = i[L];
|
|
3607
|
+
c && D.classList.add(`pluno-pa-widget__table-cell--${c}`), ke(D, h[L] ?? ""), x.appendChild(D);
|
|
3608
|
+
}), u.appendChild(x), g += 1;
|
|
3609
|
+
}
|
|
3610
|
+
return l.appendChild(u), r.appendChild(l), { element: r, nextIndex: g };
|
|
3611
|
+
}
|
|
3612
|
+
function nl(e, t) {
|
|
3613
|
+
const n = Qi(t).replace(/\r\n/g, `
|
|
3564
3614
|
`).split(`
|
|
3565
3615
|
`);
|
|
3566
3616
|
let o = 0;
|
|
@@ -3571,50 +3621,55 @@ function Qr(e, t) {
|
|
|
3571
3621
|
continue;
|
|
3572
3622
|
}
|
|
3573
3623
|
if (i.match(/^```(\w+)?\s*$/)) {
|
|
3574
|
-
const
|
|
3624
|
+
const h = [];
|
|
3575
3625
|
for (o += 1; o < n.length && !/^```\s*$/.test(n[o]); )
|
|
3576
|
-
|
|
3626
|
+
h.push(n[o]), o += 1;
|
|
3577
3627
|
o += o < n.length ? 1 : 0;
|
|
3578
|
-
const
|
|
3579
|
-
|
|
3580
|
-
`),
|
|
3628
|
+
const x = document.createElement("pre"), v = document.createElement("code");
|
|
3629
|
+
v.textContent = h.join(`
|
|
3630
|
+
`), x.appendChild(v), e.appendChild(x);
|
|
3581
3631
|
continue;
|
|
3582
3632
|
}
|
|
3583
|
-
const l =
|
|
3633
|
+
const l = tl(n, o);
|
|
3584
3634
|
if (l) {
|
|
3585
|
-
|
|
3586
|
-
|
|
3635
|
+
e.appendChild(l.element), o = l.nextIndex;
|
|
3636
|
+
continue;
|
|
3637
|
+
}
|
|
3638
|
+
const s = i.match(/^(#{1,3})\s+(.+)$/);
|
|
3639
|
+
if (s) {
|
|
3640
|
+
const h = document.createElement(`h${s[1].length + 2}`);
|
|
3641
|
+
ke(h, s[2]), e.appendChild(h), o += 1;
|
|
3587
3642
|
continue;
|
|
3588
3643
|
}
|
|
3589
3644
|
if (/^\s*[-*+]\s+/.test(i)) {
|
|
3590
|
-
const
|
|
3645
|
+
const h = document.createElement("ul");
|
|
3591
3646
|
for (; o < n.length && /^\s*[-*+]\s+/.test(n[o]); ) {
|
|
3592
|
-
const
|
|
3593
|
-
|
|
3647
|
+
const x = document.createElement("li");
|
|
3648
|
+
ke(x, n[o].replace(/^\s*[-*+]\s+/, "")), h.appendChild(x), o += 1;
|
|
3594
3649
|
}
|
|
3595
|
-
e.appendChild(
|
|
3650
|
+
e.appendChild(h);
|
|
3596
3651
|
continue;
|
|
3597
3652
|
}
|
|
3598
3653
|
const p = i.match(/^\s*(\d+)\.\s+/);
|
|
3599
3654
|
if (p) {
|
|
3600
|
-
const
|
|
3601
|
-
for (
|
|
3602
|
-
const
|
|
3603
|
-
|
|
3655
|
+
const h = document.createElement("ol");
|
|
3656
|
+
for (h.start = Number(p[1]); o < n.length && /^\s*\d+\.\s+/.test(n[o]); ) {
|
|
3657
|
+
const x = document.createElement("li");
|
|
3658
|
+
ke(x, n[o].replace(/^\s*\d+\.\s+/, "")), h.appendChild(x), o += 1;
|
|
3604
3659
|
}
|
|
3605
|
-
e.appendChild(
|
|
3660
|
+
e.appendChild(h);
|
|
3606
3661
|
continue;
|
|
3607
3662
|
}
|
|
3608
|
-
const
|
|
3663
|
+
const u = [i];
|
|
3609
3664
|
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]); )
|
|
3610
|
-
|
|
3665
|
+
u.push(n[o]), o += 1;
|
|
3611
3666
|
const g = document.createElement("p");
|
|
3612
|
-
|
|
3613
|
-
|
|
3667
|
+
u.forEach((h, x) => {
|
|
3668
|
+
x > 0 && g.appendChild(document.createElement("br")), ke(g, h);
|
|
3614
3669
|
}), e.appendChild(g);
|
|
3615
3670
|
}
|
|
3616
3671
|
}
|
|
3617
|
-
function
|
|
3672
|
+
function ke(e, t) {
|
|
3618
3673
|
const n = /(`[^`]+`|\*\*[^*]+\*\*|\*[^*]+\*|\[[^\]]+\]\(([^)\s]+)\))/g;
|
|
3619
3674
|
let o = 0;
|
|
3620
3675
|
for (const i of t.matchAll(n)) {
|
|
@@ -3624,19 +3679,19 @@ function Ye(e, t) {
|
|
|
3624
3679
|
);
|
|
3625
3680
|
const l = i[0];
|
|
3626
3681
|
if (l.startsWith("`")) {
|
|
3627
|
-
const
|
|
3628
|
-
|
|
3682
|
+
const s = document.createElement("code");
|
|
3683
|
+
s.textContent = l.slice(1, -1), e.appendChild(s);
|
|
3629
3684
|
} else if (l.startsWith("**")) {
|
|
3630
|
-
const
|
|
3631
|
-
|
|
3685
|
+
const s = document.createElement("strong");
|
|
3686
|
+
ke(s, l.slice(2, -2)), e.appendChild(s);
|
|
3632
3687
|
} else if (l.startsWith("*")) {
|
|
3633
|
-
const
|
|
3634
|
-
|
|
3688
|
+
const s = document.createElement("em");
|
|
3689
|
+
ke(s, l.slice(1, -1)), e.appendChild(s);
|
|
3635
3690
|
} else {
|
|
3636
|
-
const
|
|
3637
|
-
if (
|
|
3638
|
-
const
|
|
3639
|
-
|
|
3691
|
+
const s = l.match(/^\[([^\]]+)\]\(([^)\s]+)\)$/);
|
|
3692
|
+
if (s && ol(s[2])) {
|
|
3693
|
+
const p = document.createElement("a");
|
|
3694
|
+
p.href = s[2], p.target = "_top", p.rel = "noreferrer", p.textContent = s[1], e.appendChild(p);
|
|
3640
3695
|
} else
|
|
3641
3696
|
e.appendChild(document.createTextNode(l));
|
|
3642
3697
|
}
|
|
@@ -3644,7 +3699,7 @@ function Ye(e, t) {
|
|
|
3644
3699
|
}
|
|
3645
3700
|
o < t.length && e.appendChild(document.createTextNode(t.slice(o)));
|
|
3646
3701
|
}
|
|
3647
|
-
function
|
|
3702
|
+
function ol(e) {
|
|
3648
3703
|
if (e.startsWith("/") || e.startsWith("#"))
|
|
3649
3704
|
return !0;
|
|
3650
3705
|
try {
|
|
@@ -3654,8 +3709,8 @@ function el(e) {
|
|
|
3654
3709
|
return !1;
|
|
3655
3710
|
}
|
|
3656
3711
|
}
|
|
3657
|
-
function
|
|
3658
|
-
if (
|
|
3712
|
+
function vo(e, t) {
|
|
3713
|
+
if (il(e))
|
|
3659
3714
|
return;
|
|
3660
3715
|
const n = `
|
|
3661
3716
|
:host {
|
|
@@ -4385,23 +4440,27 @@ function yo(e, t) {
|
|
|
4385
4440
|
}
|
|
4386
4441
|
.pluno-pa-widget__timeline::-webkit-scrollbar,
|
|
4387
4442
|
.pluno-pa-widget__message--assistant pre::-webkit-scrollbar,
|
|
4443
|
+
.pluno-pa-widget__table-scroll::-webkit-scrollbar,
|
|
4388
4444
|
.pluno-pa-widget__input::-webkit-scrollbar {
|
|
4389
4445
|
width: 8px;
|
|
4390
4446
|
height: 8px;
|
|
4391
4447
|
}
|
|
4392
4448
|
.pluno-pa-widget__timeline::-webkit-scrollbar-track,
|
|
4393
4449
|
.pluno-pa-widget__message--assistant pre::-webkit-scrollbar-track,
|
|
4450
|
+
.pluno-pa-widget__table-scroll::-webkit-scrollbar-track,
|
|
4394
4451
|
.pluno-pa-widget__input::-webkit-scrollbar-track {
|
|
4395
4452
|
background: transparent;
|
|
4396
4453
|
}
|
|
4397
4454
|
.pluno-pa-widget__timeline::-webkit-scrollbar-thumb,
|
|
4398
4455
|
.pluno-pa-widget__message--assistant pre::-webkit-scrollbar-thumb,
|
|
4456
|
+
.pluno-pa-widget__table-scroll::-webkit-scrollbar-thumb,
|
|
4399
4457
|
.pluno-pa-widget__input::-webkit-scrollbar-thumb {
|
|
4400
4458
|
background: var(--pluno-pa-divider);
|
|
4401
4459
|
border-radius: 999px;
|
|
4402
4460
|
}
|
|
4403
4461
|
.pluno-pa-widget__timeline::-webkit-scrollbar-corner,
|
|
4404
4462
|
.pluno-pa-widget__message--assistant pre::-webkit-scrollbar-corner,
|
|
4463
|
+
.pluno-pa-widget__table-scroll::-webkit-scrollbar-corner,
|
|
4405
4464
|
.pluno-pa-widget__input::-webkit-scrollbar-corner {
|
|
4406
4465
|
background: transparent;
|
|
4407
4466
|
}
|
|
@@ -4678,6 +4737,43 @@ function yo(e, t) {
|
|
|
4678
4737
|
padding: 0;
|
|
4679
4738
|
white-space: pre-wrap;
|
|
4680
4739
|
}
|
|
4740
|
+
.pluno-pa-widget__table-scroll {
|
|
4741
|
+
width: 100%;
|
|
4742
|
+
margin: 0 0 10px;
|
|
4743
|
+
overflow-x: auto;
|
|
4744
|
+
user-select: text;
|
|
4745
|
+
scrollbar-color: var(--pluno-pa-divider) transparent;
|
|
4746
|
+
scrollbar-width: thin;
|
|
4747
|
+
}
|
|
4748
|
+
.pluno-pa-widget__table-scroll table {
|
|
4749
|
+
width: max-content;
|
|
4750
|
+
min-width: 100%;
|
|
4751
|
+
border-collapse: collapse;
|
|
4752
|
+
color: inherit;
|
|
4753
|
+
font-size: 12px;
|
|
4754
|
+
line-height: 1.4;
|
|
4755
|
+
white-space: normal;
|
|
4756
|
+
}
|
|
4757
|
+
.pluno-pa-widget__table-scroll th,
|
|
4758
|
+
.pluno-pa-widget__table-scroll td {
|
|
4759
|
+
padding: 7px 8px;
|
|
4760
|
+
border: 1px solid var(--pluno-pa-divider);
|
|
4761
|
+
text-align: left;
|
|
4762
|
+
vertical-align: top;
|
|
4763
|
+
white-space: normal;
|
|
4764
|
+
overflow-wrap: anywhere;
|
|
4765
|
+
user-select: text;
|
|
4766
|
+
}
|
|
4767
|
+
.pluno-pa-widget__table-scroll th {
|
|
4768
|
+
background: var(--pluno-pa-bubble);
|
|
4769
|
+
font-weight: 650;
|
|
4770
|
+
}
|
|
4771
|
+
.pluno-pa-widget__table-scroll .pluno-pa-widget__table-cell--center {
|
|
4772
|
+
text-align: center;
|
|
4773
|
+
}
|
|
4774
|
+
.pluno-pa-widget__table-scroll .pluno-pa-widget__table-cell--right {
|
|
4775
|
+
text-align: right;
|
|
4776
|
+
}
|
|
4681
4777
|
.pluno-pa-widget__message--assistant a {
|
|
4682
4778
|
color: var(--pluno-pa-accent);
|
|
4683
4779
|
text-decoration: none;
|
|
@@ -5773,8 +5869,8 @@ function yo(e, t) {
|
|
|
5773
5869
|
.pluno-pa-widget--scribble .pluno-pa-widget__scribble-spirals--panel {
|
|
5774
5870
|
position: absolute;
|
|
5775
5871
|
top: -16px;
|
|
5776
|
-
left: ${
|
|
5777
|
-
width: calc(100% - ${
|
|
5872
|
+
left: ${fn}px;
|
|
5873
|
+
width: calc(100% - ${fn * 2}px);
|
|
5778
5874
|
height: 36px;
|
|
5779
5875
|
z-index: 3;
|
|
5780
5876
|
filter: url(#pluno-pa-scribble-wobble-2);
|
|
@@ -6150,28 +6246,28 @@ function yo(e, t) {
|
|
|
6150
6246
|
filter: url(#pluno-pa-scribble-wobble-2);
|
|
6151
6247
|
}
|
|
6152
6248
|
`;
|
|
6153
|
-
if (
|
|
6249
|
+
if (al(e, n))
|
|
6154
6250
|
return;
|
|
6155
6251
|
const o = e.ownerDocument.createElement("style");
|
|
6156
|
-
o.id =
|
|
6252
|
+
o.id = Uo, o.textContent = n, e.appendChild(o), ni(e);
|
|
6157
6253
|
}
|
|
6158
|
-
function
|
|
6159
|
-
return e.getElementById(
|
|
6254
|
+
function il(e) {
|
|
6255
|
+
return e.getElementById(Uo) !== null || e.host instanceof HTMLElement && e.host.getAttribute(Bo) === "true";
|
|
6160
6256
|
}
|
|
6161
|
-
function
|
|
6162
|
-
e.host instanceof HTMLElement && e.host.setAttribute(
|
|
6257
|
+
function ni(e) {
|
|
6258
|
+
e.host instanceof HTMLElement && e.host.setAttribute(Bo, "true");
|
|
6163
6259
|
}
|
|
6164
|
-
function
|
|
6260
|
+
function al(e, t) {
|
|
6165
6261
|
if (typeof CSSStyleSheet > "u" || typeof CSSStyleSheet.prototype.replaceSync != "function" || !("adoptedStyleSheets" in e))
|
|
6166
6262
|
return !1;
|
|
6167
6263
|
try {
|
|
6168
6264
|
const n = new CSSStyleSheet();
|
|
6169
|
-
return n.replaceSync(t), e.adoptedStyleSheets = [...e.adoptedStyleSheets, n],
|
|
6265
|
+
return n.replaceSync(t), e.adoptedStyleSheets = [...e.adoptedStyleSheets, n], ni(e), !0;
|
|
6170
6266
|
} catch {
|
|
6171
6267
|
return !1;
|
|
6172
6268
|
}
|
|
6173
6269
|
}
|
|
6174
|
-
async function
|
|
6270
|
+
async function rl() {
|
|
6175
6271
|
return document.body ? document.body : await new Promise((e) => {
|
|
6176
6272
|
const t = new MutationObserver(() => {
|
|
6177
6273
|
document.body && (t.disconnect(), e(document.body));
|
|
@@ -6179,25 +6275,25 @@ async function ol() {
|
|
|
6179
6275
|
t.observe(document.documentElement, { childList: !0 });
|
|
6180
6276
|
});
|
|
6181
6277
|
}
|
|
6182
|
-
function
|
|
6278
|
+
function Ln(e) {
|
|
6183
6279
|
return `pluno.productAgent.widgetState.${location.origin}.${e.backendUrl ?? ""}.${e.tokenEndpoint ?? ""}.${e.position ?? ""}`;
|
|
6184
6280
|
}
|
|
6185
|
-
function
|
|
6186
|
-
return `${
|
|
6281
|
+
function oi(e) {
|
|
6282
|
+
return `${Ln(e)}.displayState`;
|
|
6187
6283
|
}
|
|
6188
|
-
function
|
|
6284
|
+
function ll(e) {
|
|
6189
6285
|
try {
|
|
6190
6286
|
return window.sessionStorage.getItem(
|
|
6191
|
-
|
|
6287
|
+
oi(e)
|
|
6192
6288
|
) === "minimized" ? "minimized" : "shown";
|
|
6193
6289
|
} catch {
|
|
6194
6290
|
return "shown";
|
|
6195
6291
|
}
|
|
6196
6292
|
}
|
|
6197
|
-
function
|
|
6293
|
+
function Co(e, t) {
|
|
6198
6294
|
if (e.layout === "floating")
|
|
6199
6295
|
try {
|
|
6200
|
-
const n =
|
|
6296
|
+
const n = oi(e);
|
|
6201
6297
|
if (t === "minimized") {
|
|
6202
6298
|
window.sessionStorage.setItem(n, t);
|
|
6203
6299
|
return;
|
|
@@ -6207,7 +6303,7 @@ function vo(e, t) {
|
|
|
6207
6303
|
return;
|
|
6208
6304
|
}
|
|
6209
6305
|
}
|
|
6210
|
-
function
|
|
6306
|
+
function sl(e) {
|
|
6211
6307
|
if (e)
|
|
6212
6308
|
return { clientId: e, release: () => {
|
|
6213
6309
|
} };
|
|
@@ -6215,7 +6311,7 @@ function al(e) {
|
|
|
6215
6311
|
for (; Qt.has(t); )
|
|
6216
6312
|
t += 1;
|
|
6217
6313
|
Qt.add(t);
|
|
6218
|
-
const n = `${
|
|
6314
|
+
const n = `${ha}${t}`;
|
|
6219
6315
|
let o = crypto.randomUUID();
|
|
6220
6316
|
try {
|
|
6221
6317
|
o = window.sessionStorage.getItem(n) ?? o, window.sessionStorage.setItem(n, o);
|
|
@@ -6229,9 +6325,9 @@ function al(e) {
|
|
|
6229
6325
|
}
|
|
6230
6326
|
};
|
|
6231
6327
|
}
|
|
6232
|
-
function
|
|
6328
|
+
function pl(e) {
|
|
6233
6329
|
try {
|
|
6234
|
-
const t = window.localStorage.getItem(
|
|
6330
|
+
const t = window.localStorage.getItem(Ln(e));
|
|
6235
6331
|
if (!t)
|
|
6236
6332
|
return So();
|
|
6237
6333
|
const n = JSON.parse(t);
|
|
@@ -6243,25 +6339,25 @@ function rl(e) {
|
|
|
6243
6339
|
openToolGroupKeys: Array.isArray(n.openToolGroupKeys) ? n.openToolGroupKeys.filter(
|
|
6244
6340
|
(o) => typeof o == "string"
|
|
6245
6341
|
) : [],
|
|
6246
|
-
launcherPosition:
|
|
6247
|
-
panelSize:
|
|
6248
|
-
seenShareCandidateIds: Array.isArray(n.seenShareCandidateIds) ? n.seenShareCandidateIds.filter((o) => typeof o == "string").slice(-
|
|
6342
|
+
launcherPosition: gl(n.launcherPosition) ? n.launcherPosition : null,
|
|
6343
|
+
panelSize: hl(n.panelSize) ? Pt(n.panelSize) : null,
|
|
6344
|
+
seenShareCandidateIds: Array.isArray(n.seenShareCandidateIds) ? n.seenShareCandidateIds.filter((o) => typeof o == "string").slice(-Po) : [],
|
|
6249
6345
|
sharePromptsDisabled: n.sharePromptsDisabled === !0
|
|
6250
6346
|
};
|
|
6251
6347
|
} catch {
|
|
6252
6348
|
return So();
|
|
6253
6349
|
}
|
|
6254
6350
|
}
|
|
6255
|
-
async function
|
|
6351
|
+
async function dl(e) {
|
|
6256
6352
|
if (e.loadSharePromptsDisabled)
|
|
6257
6353
|
return e.loadSharePromptsDisabled();
|
|
6258
6354
|
try {
|
|
6259
|
-
return window.localStorage.getItem(
|
|
6355
|
+
return window.localStorage.getItem(No) === "true";
|
|
6260
6356
|
} catch {
|
|
6261
6357
|
return !1;
|
|
6262
6358
|
}
|
|
6263
6359
|
}
|
|
6264
|
-
function
|
|
6360
|
+
function cl(e, t) {
|
|
6265
6361
|
if (e.persistSharePromptsDisabled) {
|
|
6266
6362
|
Promise.resolve(e.persistSharePromptsDisabled(t)).catch(
|
|
6267
6363
|
() => {
|
|
@@ -6270,7 +6366,7 @@ function sl(e, t) {
|
|
|
6270
6366
|
return;
|
|
6271
6367
|
}
|
|
6272
6368
|
try {
|
|
6273
|
-
t && window.localStorage.setItem(
|
|
6369
|
+
t && window.localStorage.setItem(No, "true");
|
|
6274
6370
|
} catch {
|
|
6275
6371
|
return;
|
|
6276
6372
|
}
|
|
@@ -6288,29 +6384,29 @@ function So() {
|
|
|
6288
6384
|
sharePromptsDisabled: !1
|
|
6289
6385
|
};
|
|
6290
6386
|
}
|
|
6291
|
-
function
|
|
6387
|
+
function ul(e, t) {
|
|
6292
6388
|
try {
|
|
6293
6389
|
window.localStorage.setItem(
|
|
6294
|
-
|
|
6390
|
+
Ln(e),
|
|
6295
6391
|
JSON.stringify(t)
|
|
6296
6392
|
);
|
|
6297
6393
|
} catch {
|
|
6298
6394
|
return;
|
|
6299
6395
|
}
|
|
6300
6396
|
}
|
|
6301
|
-
function
|
|
6397
|
+
function gl(e) {
|
|
6302
6398
|
if (!e || typeof e != "object")
|
|
6303
6399
|
return !1;
|
|
6304
6400
|
const t = e;
|
|
6305
6401
|
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");
|
|
6306
6402
|
}
|
|
6307
|
-
function
|
|
6403
|
+
function hl(e) {
|
|
6308
6404
|
if (!e || typeof e != "object")
|
|
6309
6405
|
return !1;
|
|
6310
6406
|
const t = e;
|
|
6311
6407
|
return typeof t.width == "number" && Number.isFinite(t.width) && typeof t.height == "number" && Number.isFinite(t.height);
|
|
6312
6408
|
}
|
|
6313
|
-
async function
|
|
6409
|
+
async function ii(e, t) {
|
|
6314
6410
|
const n = await fetch(e, {
|
|
6315
6411
|
method: "POST",
|
|
6316
6412
|
credentials: "include",
|
|
@@ -6322,7 +6418,7 @@ async function oi(e, t) {
|
|
|
6322
6418
|
...t ? { signal: t } : {}
|
|
6323
6419
|
});
|
|
6324
6420
|
if (!n.ok) {
|
|
6325
|
-
const i = await n.text(), r =
|
|
6421
|
+
const i = await n.text(), r = Ei(i);
|
|
6326
6422
|
throw r ? (console.error(r), new Error(r)) : new Error(`Failed to load Pluno token (${n.status})`);
|
|
6327
6423
|
}
|
|
6328
6424
|
const o = await n.json();
|
|
@@ -6330,29 +6426,29 @@ async function oi(e, t) {
|
|
|
6330
6426
|
throw new Error("Pluno token endpoint did not return a token");
|
|
6331
6427
|
return o.token;
|
|
6332
6428
|
}
|
|
6333
|
-
function
|
|
6429
|
+
function ml(e) {
|
|
6334
6430
|
let t = !1, n = !1;
|
|
6335
6431
|
const o = async () => {
|
|
6336
6432
|
const i = new AbortController();
|
|
6337
6433
|
let r = !1;
|
|
6338
|
-
const l = new Promise((
|
|
6339
|
-
const
|
|
6340
|
-
r = !0, i.abort(),
|
|
6341
|
-
},
|
|
6434
|
+
const l = new Promise((s, p) => {
|
|
6435
|
+
const u = window.setTimeout(() => {
|
|
6436
|
+
r = !0, i.abort(), p(new Error(Jn));
|
|
6437
|
+
}, ua);
|
|
6342
6438
|
i.signal.addEventListener(
|
|
6343
6439
|
"abort",
|
|
6344
|
-
() => window.clearTimeout(
|
|
6440
|
+
() => window.clearTimeout(u),
|
|
6345
6441
|
{ once: !0 }
|
|
6346
6442
|
);
|
|
6347
6443
|
});
|
|
6348
6444
|
try {
|
|
6349
|
-
const
|
|
6350
|
-
|
|
6445
|
+
const s = await Promise.race([
|
|
6446
|
+
ii(e, i.signal),
|
|
6351
6447
|
l
|
|
6352
6448
|
]);
|
|
6353
|
-
return i.abort(),
|
|
6354
|
-
} catch (
|
|
6355
|
-
throw i.abort(), r ? new Error(
|
|
6449
|
+
return i.abort(), s;
|
|
6450
|
+
} catch (s) {
|
|
6451
|
+
throw i.abort(), r ? new Error(Jn) : s instanceof Error && s.message.startsWith("Pluno widget blocked on ") ? s : new Error(ga);
|
|
6356
6452
|
}
|
|
6357
6453
|
};
|
|
6358
6454
|
return {
|
|
@@ -6375,30 +6471,30 @@ function ul(e) {
|
|
|
6375
6471
|
}
|
|
6376
6472
|
};
|
|
6377
6473
|
}
|
|
6378
|
-
const
|
|
6379
|
-
function
|
|
6474
|
+
const Eo = /* @__PURE__ */ new WeakSet();
|
|
6475
|
+
function fl(e) {
|
|
6380
6476
|
return Object.keys(e.dataset).some((t) => t.startsWith("pluno"));
|
|
6381
6477
|
}
|
|
6382
|
-
function
|
|
6478
|
+
function ko(e) {
|
|
6383
6479
|
const t = e.pathname.split("/");
|
|
6384
6480
|
return t[t.length - 1] ?? "";
|
|
6385
6481
|
}
|
|
6386
|
-
function
|
|
6482
|
+
function wl(e, t) {
|
|
6387
6483
|
const n = new URL(e.src, document.baseURI);
|
|
6388
|
-
return n.href === t.href || n.pathname === t.pathname ? !0 :
|
|
6484
|
+
return n.href === t.href || n.pathname === t.pathname ? !0 : ko(n) === ko(t);
|
|
6389
6485
|
}
|
|
6390
6486
|
class ye extends EventTarget {
|
|
6391
6487
|
constructor(t, n) {
|
|
6392
|
-
super(), this.channelId = n, this.url = t, this.addPreviewListener(
|
|
6488
|
+
super(), this.channelId = n, this.url = t, this.addPreviewListener(la, () => {
|
|
6393
6489
|
this.readyState = ye.OPEN, this.dispatchEvent(new Event("open"));
|
|
6394
|
-
}), this.addPreviewListener(
|
|
6490
|
+
}), this.addPreviewListener(sa, (o) => {
|
|
6395
6491
|
const i = o;
|
|
6396
6492
|
this.dispatchEvent(
|
|
6397
6493
|
new MessageEvent("message", { data: i.detail?.data ?? "" })
|
|
6398
6494
|
);
|
|
6399
|
-
}), this.addPreviewListener(
|
|
6495
|
+
}), this.addPreviewListener(pa, () => {
|
|
6400
6496
|
this.readyState = ye.CLOSED, this.dispatchEvent(new Event("error")), this.cleanup();
|
|
6401
|
-
}), this.addPreviewListener(
|
|
6497
|
+
}), this.addPreviewListener(da, (o) => {
|
|
6402
6498
|
const i = o;
|
|
6403
6499
|
this.readyState = ye.CLOSED, this.dispatchEvent(
|
|
6404
6500
|
new CloseEvent("close", {
|
|
@@ -6410,7 +6506,7 @@ class ye extends EventTarget {
|
|
|
6410
6506
|
}), window.dispatchEvent(
|
|
6411
6507
|
new CustomEvent(
|
|
6412
6508
|
Et(
|
|
6413
|
-
|
|
6509
|
+
ia,
|
|
6414
6510
|
this.channelId
|
|
6415
6511
|
),
|
|
6416
6512
|
{
|
|
@@ -6430,7 +6526,7 @@ class ye extends EventTarget {
|
|
|
6430
6526
|
binaryType = "blob";
|
|
6431
6527
|
bufferedAmount = 0;
|
|
6432
6528
|
readyState = ye.CONNECTING;
|
|
6433
|
-
socketId =
|
|
6529
|
+
socketId = bl();
|
|
6434
6530
|
listeners = /* @__PURE__ */ new Map();
|
|
6435
6531
|
send(t) {
|
|
6436
6532
|
if (this.readyState !== ye.OPEN)
|
|
@@ -6440,7 +6536,7 @@ class ye extends EventTarget {
|
|
|
6440
6536
|
);
|
|
6441
6537
|
window.dispatchEvent(
|
|
6442
6538
|
new CustomEvent(
|
|
6443
|
-
Et(
|
|
6539
|
+
Et(aa, this.channelId),
|
|
6444
6540
|
{
|
|
6445
6541
|
detail: {
|
|
6446
6542
|
socketId: this.socketId,
|
|
@@ -6453,7 +6549,7 @@ class ye extends EventTarget {
|
|
|
6453
6549
|
close(t, n) {
|
|
6454
6550
|
this.readyState !== ye.CLOSED && (this.readyState = ye.CLOSING, window.dispatchEvent(
|
|
6455
6551
|
new CustomEvent(
|
|
6456
|
-
Et(
|
|
6552
|
+
Et(ra, this.channelId),
|
|
6457
6553
|
{
|
|
6458
6554
|
detail: { socketId: this.socketId, code: t, reason: n }
|
|
6459
6555
|
}
|
|
@@ -6475,19 +6571,19 @@ class ye extends EventTarget {
|
|
|
6475
6571
|
this.listeners.clear();
|
|
6476
6572
|
}
|
|
6477
6573
|
}
|
|
6478
|
-
function
|
|
6574
|
+
function bl() {
|
|
6479
6575
|
const e = window.sessionStorage.getItem(
|
|
6480
|
-
|
|
6576
|
+
Zn
|
|
6481
6577
|
);
|
|
6482
6578
|
if (e)
|
|
6483
6579
|
return e;
|
|
6484
6580
|
const t = crypto.randomUUID();
|
|
6485
|
-
return window.sessionStorage.setItem(
|
|
6581
|
+
return window.sessionStorage.setItem(Zn, t), t;
|
|
6486
6582
|
}
|
|
6487
6583
|
function Et(e, t) {
|
|
6488
6584
|
return `${e}:${t}`;
|
|
6489
6585
|
}
|
|
6490
|
-
function
|
|
6586
|
+
function _l(e) {
|
|
6491
6587
|
const t = document.currentScript;
|
|
6492
6588
|
if (t instanceof HTMLScriptElement)
|
|
6493
6589
|
return [t];
|
|
@@ -6495,65 +6591,65 @@ function fl(e) {
|
|
|
6495
6591
|
return Array.from(
|
|
6496
6592
|
document.querySelectorAll("script[type='module'][src]")
|
|
6497
6593
|
).filter(
|
|
6498
|
-
(i) => i instanceof HTMLScriptElement &&
|
|
6594
|
+
(i) => i instanceof HTMLScriptElement && fl(i) && wl(i, o)
|
|
6499
6595
|
);
|
|
6500
6596
|
}
|
|
6501
|
-
function
|
|
6502
|
-
for (const t of
|
|
6503
|
-
|
|
6597
|
+
function xl(e) {
|
|
6598
|
+
for (const t of _l(e))
|
|
6599
|
+
Eo.has(t) || t.dataset.plunoAutoMount === "false" || (Eo.add(t), ai(t).catch((n) => {
|
|
6504
6600
|
console.error("Failed to mount Pluno widget", n);
|
|
6505
6601
|
}));
|
|
6506
6602
|
}
|
|
6507
|
-
function
|
|
6603
|
+
function ai(e) {
|
|
6508
6604
|
const t = window, n = t[xe];
|
|
6509
6605
|
if (n) {
|
|
6510
6606
|
if (n.host === null)
|
|
6511
6607
|
return n.mountPromise.catch(() => {
|
|
6512
|
-
const
|
|
6513
|
-
return
|
|
6608
|
+
const p = t[xe];
|
|
6609
|
+
return p ? p.mountPromise : ai(e);
|
|
6514
6610
|
});
|
|
6515
|
-
if (
|
|
6611
|
+
if (yl(n.host))
|
|
6516
6612
|
return n.retryPendingTokenFailureOnce?.(), n.mountPromise;
|
|
6517
6613
|
n.destroy?.(), delete t[xe];
|
|
6518
6614
|
}
|
|
6519
|
-
const o = e.dataset.plunoPreviewChannel, i = e.dataset.plunoTokenEndpoint, r = !e.dataset.plunoToken && !o && i ?
|
|
6615
|
+
const o = e.dataset.plunoPreviewChannel, i = e.dataset.plunoTokenEndpoint, r = !e.dataset.plunoToken && !o && i ? ml(i) : null;
|
|
6520
6616
|
let l;
|
|
6521
|
-
const
|
|
6617
|
+
const s = Da({
|
|
6522
6618
|
token: e.dataset.plunoToken,
|
|
6523
6619
|
tokenProvider: r?.loadToken,
|
|
6524
6620
|
tokenEndpoint: i,
|
|
6525
6621
|
backendUrl: e.dataset.plunoBackendUrl,
|
|
6526
|
-
webSocketFactory: o ?
|
|
6622
|
+
webSocketFactory: o ? Ra(o) : void 0,
|
|
6527
6623
|
launcherLabel: e.dataset.plunoLauncherLabel,
|
|
6528
6624
|
accentColor: e.dataset.plunoAccentColor,
|
|
6529
6625
|
colorScheme: e.dataset.plunoColorScheme === "dark" ? "dark" : "light",
|
|
6530
6626
|
fontFamily: e.dataset.plunoFontFamily,
|
|
6531
6627
|
scribbleStyle: e.dataset.plunoScribbleStyle === void 0 ? void 0 : e.dataset.plunoScribbleStyle !== "false",
|
|
6532
6628
|
position: e.dataset.plunoPosition === "bottom-left" ? "bottom-left" : "bottom-right"
|
|
6533
|
-
}).then((
|
|
6629
|
+
}).then((p) => {
|
|
6534
6630
|
if (t[xe] !== l) {
|
|
6535
|
-
|
|
6631
|
+
p.destroy();
|
|
6536
6632
|
return;
|
|
6537
6633
|
}
|
|
6538
|
-
const
|
|
6539
|
-
|
|
6540
|
-
t[xe] === l && delete t[xe], l.host = null, l.destroy = null,
|
|
6634
|
+
const u = p.host;
|
|
6635
|
+
u.setAttribute(Io, "true"), l.host = u, l.destroy = () => {
|
|
6636
|
+
t[xe] === l && delete t[xe], l.host = null, l.destroy = null, p.destroy();
|
|
6541
6637
|
};
|
|
6542
|
-
}).catch((
|
|
6543
|
-
throw t[xe] === l && delete t[xe],
|
|
6638
|
+
}).catch((p) => {
|
|
6639
|
+
throw t[xe] === l && delete t[xe], p;
|
|
6544
6640
|
});
|
|
6545
6641
|
return l = {
|
|
6546
|
-
mountPromise:
|
|
6642
|
+
mountPromise: s,
|
|
6547
6643
|
host: null,
|
|
6548
6644
|
destroy: null,
|
|
6549
6645
|
retryPendingTokenFailureOnce: r?.retryPendingFailureOnce ?? null
|
|
6550
|
-
}, t[xe] = l,
|
|
6646
|
+
}, t[xe] = l, s;
|
|
6551
6647
|
}
|
|
6552
|
-
function
|
|
6553
|
-
return e.isConnected && e.getAttribute(
|
|
6648
|
+
function yl(e) {
|
|
6649
|
+
return e.isConnected && e.getAttribute(Io) === "true" && !!e.shadowRoot?.querySelector(".pluno-pa-widget__launcher") && !!e.shadowRoot?.querySelector(".pluno-pa-widget__panel");
|
|
6554
6650
|
}
|
|
6555
|
-
|
|
6651
|
+
xl(import.meta.url);
|
|
6556
6652
|
export {
|
|
6557
|
-
|
|
6558
|
-
|
|
6653
|
+
Ra as createProductAgentPreviewBridgeWebSocketFactory,
|
|
6654
|
+
Da as mountPlunoProductAgentWidget
|
|
6559
6655
|
};
|