@pluno/product-agent-web 0.1.121 → 0.1.124
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -0
- package/dist/product-agent-sdk.js +1053 -704
- package/dist/product-agent-widget.js +894 -842
- package/dist/widget.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { PlunoProductAgent as
|
|
2
|
-
const
|
|
3
|
-
function
|
|
4
|
-
const t =
|
|
5
|
-
if (
|
|
1
|
+
import { PlunoProductAgent as Ui, getProductAgentOriginAccessErrorMessage as Bi } from "./product-agent-sdk.js";
|
|
2
|
+
const Fi = "#7c3aed", Ut = "M547 151 C516 151 493 169 485 199 L382 606 C373 641 396 666 431 666 L523 666 C552 666 568 684 563 713 L491 1028 C486 1054 510 1067 527 1044 L894 487 C915 455 894 432 856 432 L815 432 C784 432 773 411 789 382 L904 205 C922 171 901 145 859 145 Z", Bt = "#2c2a1e", ao = [253, 250, 241], ro = 3.5;
|
|
3
|
+
function Ho(e) {
|
|
4
|
+
const t = $o(e);
|
|
5
|
+
if (lo(ft(t), ao) >= ro)
|
|
6
6
|
return t;
|
|
7
7
|
let i = ft(t);
|
|
8
|
-
const o = ft(
|
|
8
|
+
const o = ft(Bt);
|
|
9
9
|
for (let r = 0; r < 6; r += 1)
|
|
10
|
-
if (i =
|
|
11
|
-
return
|
|
12
|
-
return
|
|
10
|
+
if (i = $i(i, o, 0.22), lo(i, ao) >= ro)
|
|
11
|
+
return Sn(i);
|
|
12
|
+
return Sn(i);
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function Wi() {
|
|
15
15
|
let n = "M 280 120", i = !1, o = 0;
|
|
16
16
|
for (let r = 150; r <= 1170; r += 62) {
|
|
17
17
|
const l = (o % 3 - 1) * 18, p = i ? 280 - l : 1020 + l;
|
|
@@ -19,8 +19,8 @@ function Bi() {
|
|
|
19
19
|
}
|
|
20
20
|
return n;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
const t =
|
|
22
|
+
function Hi(e) {
|
|
23
|
+
const t = $o(e), n = Cn(ft(t));
|
|
24
24
|
return n > 0.86 ? {
|
|
25
25
|
top: "#ffffff",
|
|
26
26
|
middle: "#f6f6f6",
|
|
@@ -56,9 +56,9 @@ function Fi(e) {
|
|
|
56
56
|
shadow: de(t, -0.25, -0.08)
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function $o(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()}` : Fi;
|
|
62
62
|
}
|
|
63
63
|
function ft(e) {
|
|
64
64
|
return [
|
|
@@ -67,23 +67,23 @@ function ft(e) {
|
|
|
67
67
|
Number.parseInt(e.slice(5, 7), 16)
|
|
68
68
|
];
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function Sn([e, t, n]) {
|
|
71
71
|
const i = (o) => Math.max(0, Math.min(255, Math.round(o))).toString(16).padStart(2, "0");
|
|
72
72
|
return `#${i(e)}${i(t)}${i(n)}`;
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function Cn([e, t, n]) {
|
|
75
75
|
const i = (o) => {
|
|
76
76
|
const r = o / 255;
|
|
77
77
|
return r <= 0.04045 ? r / 12.92 : ((r + 0.055) / 1.055) ** 2.4;
|
|
78
78
|
};
|
|
79
79
|
return 0.2126 * i(e) + 0.7152 * i(t) + 0.0722 * i(n);
|
|
80
80
|
}
|
|
81
|
-
function
|
|
82
|
-
const n =
|
|
81
|
+
function lo(e, t) {
|
|
82
|
+
const n = Cn(e), i = Cn(t), [o, r] = n > i ? [n, i] : [i, n];
|
|
83
83
|
return (o + 0.05) / (r + 0.05);
|
|
84
84
|
}
|
|
85
|
-
function
|
|
86
|
-
const i =
|
|
85
|
+
function $i(e, t, n) {
|
|
86
|
+
const i = En(n);
|
|
87
87
|
return [
|
|
88
88
|
e[0] + (t[0] - e[0]) * i,
|
|
89
89
|
e[1] + (t[1] - e[1]) * i,
|
|
@@ -91,43 +91,43 @@ function Wi(e, t, n) {
|
|
|
91
91
|
];
|
|
92
92
|
}
|
|
93
93
|
function de(e, t, n) {
|
|
94
|
-
const [i, o, r] =
|
|
95
|
-
return
|
|
94
|
+
const [i, o, r] = Gi(ft(e));
|
|
95
|
+
return Sn(qi(i, En(o + n), En(r + t)));
|
|
96
96
|
}
|
|
97
|
-
function
|
|
97
|
+
function Gi([e, t, n]) {
|
|
98
98
|
const i = e / 255, o = t / 255, r = n / 255, l = Math.max(i, o, r), p = Math.min(i, o, r), d = (l + p) / 2;
|
|
99
99
|
if (l === p)
|
|
100
100
|
return [0, 0, d];
|
|
101
101
|
const c = l - p, g = d > 0.5 ? c / (2 - l - p) : c / (l + p);
|
|
102
102
|
return [(l === i ? (o - r) / c + (o < r ? 6 : 0) : l === o ? (r - i) / c + 2 : (i - o) / c + 4) / 6, g, d];
|
|
103
103
|
}
|
|
104
|
-
function
|
|
104
|
+
function qi(e, t, n) {
|
|
105
105
|
if (t === 0)
|
|
106
106
|
return [n * 255, n * 255, n * 255];
|
|
107
107
|
const i = n < 0.5 ? n * (1 + t) : n + t - n * t, o = 2 * n - i;
|
|
108
108
|
return [
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
109
|
+
un(o, i, e + 1 / 3) * 255,
|
|
110
|
+
un(o, i, e) * 255,
|
|
111
|
+
un(o, i, e - 1 / 3) * 255
|
|
112
112
|
];
|
|
113
113
|
}
|
|
114
|
-
function
|
|
114
|
+
function un(e, t, n) {
|
|
115
115
|
let i = n;
|
|
116
116
|
return i < 0 && (i += 1), i > 1 && (i -= 1), i < 1 / 6 ? e + (t - e) * 6 * i : i < 1 / 2 ? t : i < 2 / 3 ? e + (t - e) * (2 / 3 - i) * 6 : e;
|
|
117
117
|
}
|
|
118
|
-
function
|
|
118
|
+
function En(e) {
|
|
119
119
|
return Math.max(0, Math.min(1, e));
|
|
120
120
|
}
|
|
121
|
-
const
|
|
122
|
-
function
|
|
121
|
+
const Go = "suggest_share_on_socials";
|
|
122
|
+
function ji(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 !== Go)
|
|
126
126
|
continue;
|
|
127
|
-
const i =
|
|
127
|
+
const i = po(e, t, "assistant");
|
|
128
128
|
if (!i)
|
|
129
129
|
return null;
|
|
130
|
-
const o =
|
|
130
|
+
const o = po(e, i.index, "user");
|
|
131
131
|
return o ? {
|
|
132
132
|
id: `share:${n.callId ?? n.id}`,
|
|
133
133
|
userPrompt: o.content,
|
|
@@ -136,13 +136,13 @@ function Gi(e) {
|
|
|
136
136
|
}
|
|
137
137
|
return null;
|
|
138
138
|
}
|
|
139
|
-
function
|
|
139
|
+
function Vi(e) {
|
|
140
140
|
let t = 2166136261;
|
|
141
141
|
for (const n of e)
|
|
142
142
|
t ^= n.charCodeAt(0), t = Math.imul(t, 16777619);
|
|
143
143
|
return (t >>> 0) % 2 === 0 ? "referral" : "social";
|
|
144
144
|
}
|
|
145
|
-
function
|
|
145
|
+
function po(e, t, n) {
|
|
146
146
|
for (let i = t - 1; i >= 0; i -= 1) {
|
|
147
147
|
const o = e[i];
|
|
148
148
|
if (o.role === n && o.content.trim())
|
|
@@ -150,15 +150,15 @@ function lo(e, t, n) {
|
|
|
150
150
|
}
|
|
151
151
|
return null;
|
|
152
152
|
}
|
|
153
|
-
const
|
|
154
|
-
function
|
|
153
|
+
const Ki = "https://app.pluno.ai", Yi = "/api/product-agent/embed/active-users", Xi = 1800, Zi = 15e3, Ji = 250, Qi = 1e3, ea = 3e4;
|
|
154
|
+
function ta(e, t = {}) {
|
|
155
155
|
let n = !1, i = null, o = null, r = null;
|
|
156
156
|
const l = () => {
|
|
157
157
|
r !== null && (window.clearInterval(r), r = null);
|
|
158
158
|
}, p = (g) => {
|
|
159
159
|
n || (o !== null && window.clearTimeout(o), o = window.setTimeout(() => {
|
|
160
160
|
c();
|
|
161
|
-
},
|
|
161
|
+
}, ia(g)));
|
|
162
162
|
}, d = (g) => {
|
|
163
163
|
if (l(), i === null) {
|
|
164
164
|
i = g, e(g);
|
|
@@ -170,50 +170,50 @@ function Qi(e, t = {}) {
|
|
|
170
170
|
l();
|
|
171
171
|
return;
|
|
172
172
|
}
|
|
173
|
-
const
|
|
174
|
-
i = Math.round(h + (g - h) *
|
|
175
|
-
},
|
|
173
|
+
const b = Math.min(1, (performance.now() - f) / Xi);
|
|
174
|
+
i = Math.round(h + (g - h) * aa(b)), e(i), b >= 1 && (i = g, e(g), l());
|
|
175
|
+
}, Ji);
|
|
176
176
|
}, c = async () => {
|
|
177
177
|
try {
|
|
178
|
-
const g = await
|
|
178
|
+
const g = await na(t);
|
|
179
179
|
if (n)
|
|
180
180
|
return;
|
|
181
181
|
d(g.count), p(g.refreshAfterMs);
|
|
182
182
|
} catch {
|
|
183
|
-
p(
|
|
183
|
+
p(Zi);
|
|
184
184
|
}
|
|
185
185
|
};
|
|
186
186
|
return c(), () => {
|
|
187
187
|
n = !0, o !== null && window.clearTimeout(o), l();
|
|
188
188
|
};
|
|
189
189
|
}
|
|
190
|
-
async function
|
|
190
|
+
async function na(e) {
|
|
191
191
|
if (e.loader)
|
|
192
192
|
return e.loader();
|
|
193
|
-
const n = await (e.fetcher ?? fetch)(new URL(
|
|
193
|
+
const n = await (e.fetcher ?? fetch)(new URL(Yi, oa(e.backendUrl ?? Ki)).toString(), {
|
|
194
194
|
cache: "no-store",
|
|
195
195
|
credentials: "omit"
|
|
196
196
|
});
|
|
197
197
|
if (!n.ok)
|
|
198
198
|
throw new Error("Failed to load active users");
|
|
199
|
-
const i = await n.json(), o =
|
|
199
|
+
const i = await n.json(), o = so(i.count), r = so(i.refreshAfterMs ?? i.refresh_after_ms);
|
|
200
200
|
if (o === null || r === null)
|
|
201
201
|
throw new Error("Invalid active users response");
|
|
202
202
|
return { count: o, refreshAfterMs: r };
|
|
203
203
|
}
|
|
204
|
-
function
|
|
204
|
+
function so(e) {
|
|
205
205
|
return typeof e != "number" || !Number.isFinite(e) || e < 0 ? null : Math.round(e);
|
|
206
206
|
}
|
|
207
|
-
function
|
|
207
|
+
function oa(e) {
|
|
208
208
|
return e.endsWith("/") ? e : `${e}/`;
|
|
209
209
|
}
|
|
210
|
-
function
|
|
211
|
-
return Math.min(
|
|
210
|
+
function ia(e) {
|
|
211
|
+
return Math.min(ea, Math.max(Qi, e));
|
|
212
212
|
}
|
|
213
|
-
function
|
|
213
|
+
function aa(e) {
|
|
214
214
|
return e < 0.5 ? 4 * e * e * e : 1 - Math.pow(-2 * e + 2, 3) / 2;
|
|
215
215
|
}
|
|
216
|
-
const
|
|
216
|
+
const ra = [
|
|
217
217
|
"a[href]",
|
|
218
218
|
"button",
|
|
219
219
|
"input",
|
|
@@ -237,27 +237,27 @@ const ia = [
|
|
|
237
237
|
".pluno-pa-widget__message",
|
|
238
238
|
".timeline-item"
|
|
239
239
|
].join(",");
|
|
240
|
-
function
|
|
241
|
-
return e instanceof Element ?
|
|
240
|
+
function la(e, t, n) {
|
|
241
|
+
return e instanceof Element ? pa(
|
|
242
242
|
t,
|
|
243
243
|
n,
|
|
244
|
-
e.closest(
|
|
244
|
+
e.closest(ra) !== null
|
|
245
245
|
) : !1;
|
|
246
246
|
}
|
|
247
|
-
function
|
|
247
|
+
function pa(e, t, n) {
|
|
248
248
|
return e === 1 && !t && !n;
|
|
249
249
|
}
|
|
250
|
-
function
|
|
250
|
+
function sa(e, t, n) {
|
|
251
251
|
return e instanceof Node && t !== null && !t.contains(e) && !n?.contains(e);
|
|
252
252
|
}
|
|
253
|
-
function
|
|
253
|
+
function da(e, t = !0) {
|
|
254
254
|
if (!e || !t || !e.isConnected || e.disabled || e.readOnly)
|
|
255
255
|
return !1;
|
|
256
256
|
const n = e.getRootNode();
|
|
257
257
|
return (n instanceof ShadowRoot ? n.activeElement : e.ownerDocument.activeElement) === e ? !1 : (e.focus({ preventScroll: !0 }), !0);
|
|
258
258
|
}
|
|
259
|
-
const
|
|
260
|
-
function
|
|
259
|
+
const ca = /(`+)(?!`)[\s\S]*?\1(?!`)/g;
|
|
260
|
+
function ua(e) {
|
|
261
261
|
let t = "", n = "", i = null;
|
|
262
262
|
for (const o of e.split(new RegExp("(?<=\\n)"))) {
|
|
263
263
|
if (i) {
|
|
@@ -268,7 +268,7 @@ function da(e) {
|
|
|
268
268
|
}
|
|
269
269
|
const r = o.match(/^[ \t]{0,3}(`{3,}|~{3,})/);
|
|
270
270
|
if (r) {
|
|
271
|
-
t +=
|
|
271
|
+
t += co(n) + o, n = "", i = {
|
|
272
272
|
marker: r[1][0],
|
|
273
273
|
length: r[1].length
|
|
274
274
|
};
|
|
@@ -276,31 +276,31 @@ function da(e) {
|
|
|
276
276
|
}
|
|
277
277
|
n += o;
|
|
278
278
|
}
|
|
279
|
-
return t +
|
|
279
|
+
return t + co(n);
|
|
280
280
|
}
|
|
281
|
-
function
|
|
281
|
+
function co(e) {
|
|
282
282
|
let t = "", n = 0;
|
|
283
|
-
for (const i of e.matchAll(
|
|
283
|
+
for (const i of e.matchAll(ca)) {
|
|
284
284
|
const o = i.index ?? 0;
|
|
285
|
-
t +=
|
|
285
|
+
t += uo(
|
|
286
286
|
e.slice(n, o)
|
|
287
287
|
), t += i[0], n = o + i[0].length;
|
|
288
288
|
}
|
|
289
|
-
return t +
|
|
289
|
+
return t + uo(e.slice(n));
|
|
290
290
|
}
|
|
291
|
-
function
|
|
291
|
+
function uo(e) {
|
|
292
292
|
return e.replace(
|
|
293
293
|
/\[([^\]\n]*\S[^\]\n]*)\][ \t]+\(([^)\s]+)\)/g,
|
|
294
|
-
(t, n, i, o, r) => r[o - 1] === "!" ||
|
|
294
|
+
(t, n, i, o, r) => r[o - 1] === "!" || ga(r, o) || ha(r, o, n) ? t : `[${n}](${i})`
|
|
295
295
|
);
|
|
296
296
|
}
|
|
297
|
-
function
|
|
297
|
+
function ga(e, t) {
|
|
298
298
|
let n = 0;
|
|
299
299
|
for (let i = t - 1; e[i] === "\\"; i -= 1)
|
|
300
300
|
n += 1;
|
|
301
301
|
return n % 2 === 1;
|
|
302
302
|
}
|
|
303
|
-
function
|
|
303
|
+
function ha(e, t, n) {
|
|
304
304
|
if (n !== "x" && n !== "X")
|
|
305
305
|
return !1;
|
|
306
306
|
const i = e.lastIndexOf(`
|
|
@@ -309,7 +309,7 @@ function ua(e, t, n) {
|
|
|
309
309
|
e.slice(i, t)
|
|
310
310
|
);
|
|
311
311
|
}
|
|
312
|
-
const
|
|
312
|
+
const qo = 100, ma = 1e4, fa = 5e3, wa = "product-agent:sdk-preview-socket-connect", ba = "product-agent:sdk-preview-socket-send", _a = "product-agent:sdk-preview-socket-close", xa = "product-agent:sdk-preview-socket-open", ya = "product-agent:sdk-preview-socket-message", va = "product-agent:sdk-preview-socket-error", Sa = "product-agent:sdk-preview-socket-closed", go = "product-agent:sdk-preview-socket-id", Ca = "data-pluno-sdk-preview-channel", jo = "data-pluno-auto-mounted", ve = "__plunoProductAgentAutoMountOwner", Ea = 1e4, ka = "Failed to load Pluno widget token", ho = "Timed out loading Pluno widget token", La = "pluno.productAgent.widgetClientId.", gn = /* @__PURE__ */ new Set(), Ta = "product-agent:preview-diagnostic", Vo = "pluno.productAgent.sharePromptsDisabled", Pa = 3, mo = 'dialog[open], [aria-modal="true"], [role="dialog"]', fo = 1500, Aa = 5e3, Ia = 500, Na = "No recent chats for this page yet.", Se = {
|
|
313
313
|
launcherLabel: "Ask for anything...",
|
|
314
314
|
accentColor: "#7c3aed",
|
|
315
315
|
colorScheme: "light",
|
|
@@ -317,7 +317,7 @@ const $o = 100, ga = 1e4, ha = 5e3, ma = "product-agent:sdk-preview-socket-conne
|
|
|
317
317
|
scribbleStyle: !0,
|
|
318
318
|
position: "bottom-right",
|
|
319
319
|
movableLauncher: !0
|
|
320
|
-
},
|
|
320
|
+
}, Ra = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive', wo = "pluno-pa-scribble-font", Ko = 190, Yo = 41, za = 22, Ma = 32, Da = 1, Oa = 48, Dn = 420, Ua = 520, Ba = 0.24, On = 680, Fa = 800, Wa = 0.76, N = 8, Ge = 50, Xo = "http://www.w3.org/2000/svg", kn = 26, Ln = 8, Ha = 36, Tn = 16, $a = 4, bo = [
|
|
321
321
|
{
|
|
322
322
|
ellipseCx: "17.5",
|
|
323
323
|
ellipseCy: "24.5",
|
|
@@ -354,12 +354,12 @@ const $o = 100, ga = 1e4, ha = 5e3, ma = "product-agent:sdk-preview-socket-conne
|
|
|
354
354
|
path: "M18.7 26.8 C21 11.2, 7.1 1.6, 6.3 18.1",
|
|
355
355
|
pathStrokeWidth: "2.45"
|
|
356
356
|
}
|
|
357
|
-
],
|
|
358
|
-
let
|
|
359
|
-
function
|
|
357
|
+
], Ga = 11, qa = 13, Pn = 4, Zo = 10, Jo = 40, ja = "movable-launcher-position-v2", Qo = "pluno-pa-widget-styles", ei = "data-pluno-pa-widget-styles";
|
|
358
|
+
let _o = 0;
|
|
359
|
+
function Va(e) {
|
|
360
360
|
return (t) => new Ce(t, e);
|
|
361
361
|
}
|
|
362
|
-
async function
|
|
362
|
+
async function Ka(e = {}) {
|
|
363
363
|
const t = {
|
|
364
364
|
layout: e.layout ?? "floating",
|
|
365
365
|
mountTarget: e.mountTarget,
|
|
@@ -381,6 +381,7 @@ async function ja(e = {}) {
|
|
|
381
381
|
restorePersistedState: e.restorePersistedState,
|
|
382
382
|
expectedPersistedSessionId: e.expectedPersistedSessionId,
|
|
383
383
|
keepRunsActiveOnSessionNavigation: e.keepRunsActiveOnSessionNavigation === !0,
|
|
384
|
+
capturePageContent: e.capturePageContent,
|
|
384
385
|
webSocketFactory: e.webSocketFactory,
|
|
385
386
|
prepareAttachmentUpload: e.prepareAttachmentUpload,
|
|
386
387
|
attachmentPreviewUrlResolver: e.attachmentPreviewUrlResolver,
|
|
@@ -432,42 +433,42 @@ async function ja(e = {}) {
|
|
|
432
433
|
);
|
|
433
434
|
const n = document.createElement("div");
|
|
434
435
|
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(
|
|
435
|
-
|
|
436
|
+
Ca,
|
|
436
437
|
t.sdkPreviewChannelId
|
|
437
438
|
);
|
|
438
439
|
const i = n.attachShadow({ mode: "open" }), o = document.createElement("div");
|
|
439
440
|
o.className = `pluno-pa-widget pluno-pa-widget--${t.position}`, o.classList.add(`pluno-pa-widget--layout-${t.layout}`), o.setAttribute("data-pluno-product-agent-ui-root", "widget");
|
|
440
|
-
let r =
|
|
441
|
+
let r = xo(
|
|
441
442
|
t.accentColor,
|
|
442
443
|
t.scribbleStyle
|
|
443
444
|
);
|
|
444
|
-
|
|
445
|
+
fr(
|
|
445
446
|
o,
|
|
446
447
|
t.launcherLabel,
|
|
447
448
|
r,
|
|
448
449
|
t.movableLauncher,
|
|
449
450
|
t.showLauncherMinimizeButton
|
|
450
451
|
), i.appendChild(o);
|
|
451
|
-
const l =
|
|
452
|
-
|
|
452
|
+
const l = Sl(t), p = t.layout === "floating" ? t.initialDisplayState ?? yl(t) : "shown";
|
|
453
|
+
Uo(t, p);
|
|
453
454
|
let d = t.movableLauncher ? l.launcherPosition : null, c = d !== null, g = l.panelSize, h = null;
|
|
454
455
|
o.style.setProperty(
|
|
455
456
|
"--pluno-pa-mobile-panel-top-offset",
|
|
456
457
|
`${t.mobilePanelTopOffset}px`
|
|
457
458
|
), o.classList.add(`pluno-pa-widget--${t.colorScheme}`), t.scribbleStyle && o.classList.add("pluno-pa-widget--scribble"), p === "minimized" && (o.classList.add("pluno-pa-widget--minimized"), $e(
|
|
458
459
|
o,
|
|
459
|
-
|
|
460
|
+
mn(
|
|
460
461
|
o,
|
|
461
462
|
d,
|
|
462
463
|
t.position
|
|
463
464
|
)
|
|
464
|
-
)),
|
|
465
|
+
)), Oo(i, t.accentColor), yo(o, r, {
|
|
465
466
|
accentColor: t.accentColor,
|
|
466
467
|
colorScheme: t.colorScheme,
|
|
467
468
|
fontFamily: t.fontFamily,
|
|
468
469
|
scribbleStyle: t.scribbleStyle
|
|
469
470
|
});
|
|
470
|
-
const f = t.mountTarget ?? await
|
|
471
|
+
const f = t.mountTarget ?? await xl(), b = f.ownerDocument, y = o.querySelector(
|
|
471
472
|
".pluno-pa-widget__launcher"
|
|
472
473
|
), U = o.querySelector(
|
|
473
474
|
".pluno-pa-widget__launcher-drag-handle"
|
|
@@ -537,51 +538,52 @@ async function ja(e = {}) {
|
|
|
537
538
|
if (t.movableLauncher && !U)
|
|
538
539
|
throw new Error("Failed to mount Pluno widget drag handle");
|
|
539
540
|
let E = !1;
|
|
540
|
-
const
|
|
541
|
-
|
|
541
|
+
const A = (a) => {
|
|
542
|
+
Wt(t.billingStatus) || (E = !1), Fr(
|
|
542
543
|
bt,
|
|
543
544
|
t.billingStatus,
|
|
544
545
|
a,
|
|
545
546
|
E,
|
|
546
547
|
() => {
|
|
547
|
-
E = !0,
|
|
548
|
+
E = !0, A(a);
|
|
548
549
|
}
|
|
549
550
|
);
|
|
550
551
|
};
|
|
551
|
-
B.hidden = !t.attachmentsEnabled, ge.disabled = !t.attachmentsEnabled,
|
|
552
|
+
B.hidden = !t.attachmentsEnabled, ge.disabled = !t.attachmentsEnabled, Po(u), Po(v);
|
|
552
553
|
let M = [], fe = null;
|
|
553
|
-
const ke = () =>
|
|
554
|
+
const ke = () => da(
|
|
554
555
|
v,
|
|
555
556
|
o.classList.contains("pluno-pa-widget--open") && !t.loginRequired && !t.signupRequired && !pe(t.billingStatus)
|
|
556
557
|
), je = () => {
|
|
557
|
-
|
|
558
|
+
Mr(
|
|
558
559
|
qe,
|
|
559
560
|
M,
|
|
560
561
|
(a) => {
|
|
561
562
|
M = M.filter(
|
|
562
563
|
(s, m) => m !== a
|
|
563
|
-
), je(), O(
|
|
564
|
+
), je(), O(_.getState()), V(), ke();
|
|
564
565
|
}
|
|
565
566
|
);
|
|
566
|
-
},
|
|
567
|
-
if (!t.loginRequired && !t.signupRequired && !t.token && !
|
|
567
|
+
}, Wn = t.loginRequired || t.signupRequired || t.token || t.webSocketFactory ? void 0 : t.tokenProvider ?? (t.tokenEndpoint ? async () => wi(t.tokenEndpoint) : void 0);
|
|
568
|
+
if (!t.loginRequired && !t.signupRequired && !t.token && !Wn && !t.webSocketFactory)
|
|
568
569
|
throw new Error("Pluno widget requires token or tokenEndpoint");
|
|
569
|
-
const
|
|
570
|
-
let
|
|
570
|
+
const _i = window.fetch.bind(window), Gt = vl(t.clientId);
|
|
571
|
+
let _;
|
|
571
572
|
try {
|
|
572
573
|
const a = {
|
|
573
574
|
token: t.token,
|
|
574
|
-
tokenProvider:
|
|
575
|
+
tokenProvider: Wn,
|
|
575
576
|
backendUrl: t.backendUrl,
|
|
576
577
|
metadata: () => ({
|
|
577
578
|
...t.metadata ?? {},
|
|
578
|
-
...!
|
|
579
|
+
...!_.getState().sessionId && t.scribbleStyle ? { scribbleStyleStarted: !0 } : {}
|
|
579
580
|
}),
|
|
580
581
|
initialStarterPrompts: t.initialStarterPrompts,
|
|
581
|
-
clientId:
|
|
582
|
+
clientId: Gt.clientId,
|
|
582
583
|
restorePersistedState: t.restorePersistedState,
|
|
583
584
|
expectedPersistedSessionId: t.expectedPersistedSessionId,
|
|
584
585
|
keepRunsActiveOnSessionNavigation: t.keepRunsActiveOnSessionNavigation,
|
|
586
|
+
capturePageContent: t.capturePageContent,
|
|
585
587
|
webSocketFactory: t.webSocketFactory,
|
|
586
588
|
prepareAttachmentUpload: t.prepareAttachmentUpload,
|
|
587
589
|
// The launcher is useful before a customer token endpoint responds. The widget owns connection
|
|
@@ -589,9 +591,9 @@ async function ja(e = {}) {
|
|
|
589
591
|
autoConnect: !1,
|
|
590
592
|
disableNetworkCapture: !!t.sdkPreviewChannelId
|
|
591
593
|
};
|
|
592
|
-
|
|
594
|
+
_ = await Ui.init(a);
|
|
593
595
|
} catch (a) {
|
|
594
|
-
throw
|
|
596
|
+
throw Gt.release(), n.remove(), a;
|
|
595
597
|
}
|
|
596
598
|
f.appendChild(n), J(
|
|
597
599
|
"web-sdk.widget",
|
|
@@ -603,19 +605,19 @@ async function ja(e = {}) {
|
|
|
603
605
|
cssAccent: o.style.getPropertyValue("--pluno-pa-accent")
|
|
604
606
|
}
|
|
605
607
|
);
|
|
606
|
-
const
|
|
608
|
+
const qt = new Set(l.openToolGroupKeys), Ue = new Set(
|
|
607
609
|
l.seenShareCandidateIds
|
|
608
610
|
), nt = new Set(Ue);
|
|
609
|
-
let
|
|
611
|
+
let jt = l.sharePromptsDisabled || await Cl(t), ie = null, Y = !1, xt = !(t.loginRequired || t.signupRequired), Le = !1, Be = {
|
|
610
612
|
enabled: !0
|
|
611
|
-
}, Fe = 0,
|
|
613
|
+
}, Fe = 0, Hn = "", X = !1, we = !1, Te = [], Vt = null, ot = null;
|
|
612
614
|
const ae = (a, s) => {
|
|
613
615
|
Be = { enabled: a, reason: s };
|
|
614
616
|
}, re = () => {
|
|
615
617
|
he.hidden = !0;
|
|
616
|
-
},
|
|
618
|
+
}, xi = () => {
|
|
617
619
|
he.hidden = !1;
|
|
618
|
-
},
|
|
620
|
+
}, yi = (a = "jump") => {
|
|
619
621
|
ae(!0, a), re(), mt(z, () => Be.enabled), Fe = z.scrollTop;
|
|
620
622
|
}, be = () => {
|
|
621
623
|
if (Z.hidden = t.layout === "page" || t.loginRequired, ze.hidden = !X, Z.setAttribute("aria-expanded", String(X)), K.classList.toggle(
|
|
@@ -629,15 +631,15 @@ async function ja(e = {}) {
|
|
|
629
631
|
const s = document.createElement("button");
|
|
630
632
|
s.type = "button", s.className = "pluno-pa-widget__history-item", s.disabled = we;
|
|
631
633
|
const m = document.createElement("span");
|
|
632
|
-
m.className = "pluno-pa-widget__history-item-title", m.textContent =
|
|
634
|
+
m.className = "pluno-pa-widget__history-item-title", m.textContent = gr(a);
|
|
633
635
|
const S = document.createElement("time");
|
|
634
|
-
S.className = "pluno-pa-widget__history-time", S.dateTime = a.lastActiveAt, S.textContent =
|
|
636
|
+
S.className = "pluno-pa-widget__history-time", S.dateTime = a.lastActiveAt, S.textContent = mr(
|
|
635
637
|
a.lastActiveAt,
|
|
636
638
|
Date.now()
|
|
637
639
|
);
|
|
638
640
|
const k = document.createElement("small");
|
|
639
|
-
k.className = "pluno-pa-widget__history-path", k.textContent =
|
|
640
|
-
X = !1, ot = null, be(), ae(!0, "newSession"), re(),
|
|
641
|
+
k.className = "pluno-pa-widget__history-path", k.textContent = hr(a), s.append(m, S, k), s.addEventListener("click", () => {
|
|
642
|
+
X = !1, ot = null, be(), ae(!0, "newSession"), re(), _.loadSession(a.id), O(_.getState()), ke();
|
|
641
643
|
}), K.appendChild(s);
|
|
642
644
|
}
|
|
643
645
|
if (we && Te.length > 0) {
|
|
@@ -645,12 +647,12 @@ async function ja(e = {}) {
|
|
|
645
647
|
a.className = "pluno-pa-widget__history-loading pluno-pa-widget__history-loading--inline", a.textContent = "Loading...", K.appendChild(a);
|
|
646
648
|
}
|
|
647
649
|
Me.textContent = ot ?? (!we && Te.length === 0 ? "No recent chats for this page yet." : ""), Me.hidden = Me.textContent.length === 0;
|
|
648
|
-
},
|
|
650
|
+
}, $n = async (a) => {
|
|
649
651
|
if (!we) {
|
|
650
652
|
we = !0, ot = null, be();
|
|
651
653
|
try {
|
|
652
|
-
const s = await
|
|
653
|
-
Te = a ? [...Te, ...s.sessions] : s.sessions,
|
|
654
|
+
const s = await _.listSessions({ cursor: a, limit: 20 });
|
|
655
|
+
Te = a ? [...Te, ...s.sessions] : s.sessions, Vt = s.nextCursor;
|
|
654
656
|
} catch (s) {
|
|
655
657
|
J(
|
|
656
658
|
"web-sdk.widget",
|
|
@@ -658,25 +660,25 @@ async function ja(e = {}) {
|
|
|
658
660
|
{
|
|
659
661
|
message: s instanceof Error ? s.message : String(s)
|
|
660
662
|
}
|
|
661
|
-
), ot =
|
|
663
|
+
), ot = Na;
|
|
662
664
|
} finally {
|
|
663
665
|
we = !1, be();
|
|
664
666
|
}
|
|
665
667
|
}
|
|
666
|
-
},
|
|
667
|
-
!
|
|
668
|
-
},
|
|
669
|
-
Y || typeof document > "u" || (
|
|
670
|
-
},
|
|
671
|
-
|
|
668
|
+
}, vi = () => {
|
|
669
|
+
!Vt || we || K.scrollHeight - K.scrollTop - K.clientHeight <= 24 && $n(Vt);
|
|
670
|
+
}, Gn = () => {
|
|
671
|
+
Y || typeof document > "u" || (Oo(i, t.accentColor), n.isConnected || (t.mountTarget?.isConnected ? t.mountTarget.appendChild(n) : t.mountTarget || b.body?.appendChild(n)));
|
|
672
|
+
}, qn = new MutationObserver(Gn);
|
|
673
|
+
qn.observe(b.documentElement, {
|
|
672
674
|
childList: !0,
|
|
673
675
|
subtree: !0
|
|
674
|
-
}),
|
|
676
|
+
}), Gn();
|
|
675
677
|
const it = (a = !0) => {
|
|
676
|
-
const s =
|
|
678
|
+
const s = Ft(o, a);
|
|
677
679
|
return An(
|
|
678
680
|
o,
|
|
679
|
-
d ?
|
|
681
|
+
d ? Dt(d, s) : nr(
|
|
680
682
|
o,
|
|
681
683
|
t.position,
|
|
682
684
|
s
|
|
@@ -684,42 +686,42 @@ async function ja(e = {}) {
|
|
|
684
686
|
s
|
|
685
687
|
);
|
|
686
688
|
}, W = () => {
|
|
687
|
-
const a =
|
|
689
|
+
const a = pr(
|
|
688
690
|
i,
|
|
689
691
|
u,
|
|
690
692
|
v
|
|
691
693
|
);
|
|
692
|
-
|
|
694
|
+
kl(t, {
|
|
693
695
|
isOpen: o.classList.contains("pluno-pa-widget--open"),
|
|
694
696
|
composerValue: v.value,
|
|
695
697
|
focusedInput: a,
|
|
696
698
|
focusedInputAt: a ? Date.now() : null,
|
|
697
|
-
openToolGroupKeys: [
|
|
699
|
+
openToolGroupKeys: [...qt],
|
|
698
700
|
launcherPosition: c ? d : null,
|
|
699
701
|
panelSize: g,
|
|
700
702
|
seenShareCandidateIds: [...Ue].slice(
|
|
701
|
-
|
|
703
|
+
-qo
|
|
702
704
|
),
|
|
703
|
-
sharePromptsDisabled:
|
|
705
|
+
sharePromptsDisabled: jt
|
|
704
706
|
});
|
|
705
707
|
}, yt = (a) => {
|
|
706
708
|
t.onDisplayStateChange?.(a);
|
|
707
709
|
}, at = (a, s = !0) => {
|
|
708
|
-
if (
|
|
710
|
+
if (Uo(t, a), a === "shown") {
|
|
709
711
|
o.classList.remove("pluno-pa-widget--minimized"), y.removeAttribute("tabindex"), y.removeAttribute("role"), y.removeAttribute("aria-label"), !o.classList.contains("pluno-pa-widget--open") && !o.classList.contains("pluno-pa-widget--closing") && rt(!1), s && yt("shown");
|
|
710
712
|
return;
|
|
711
713
|
}
|
|
712
714
|
ie !== null && (window.clearTimeout(ie), ie = null), o.classList.remove("pluno-pa-widget--open"), o.classList.remove("pluno-pa-widget--closing"), o.classList.add("pluno-pa-widget--minimized"), y.hidden = !1, y.setAttribute("role", "button"), y.setAttribute("aria-label", "Open Pluno"), w.hidden = !0, L.hidden = !0, y.tabIndex = 0, v.value = "", $e(
|
|
713
715
|
o,
|
|
714
|
-
|
|
716
|
+
mn(
|
|
715
717
|
o,
|
|
716
718
|
d,
|
|
717
719
|
t.position
|
|
718
720
|
)
|
|
719
|
-
),
|
|
721
|
+
), ko(o), W(), s && yt("minimized");
|
|
720
722
|
}, We = (a, s = {}) => {
|
|
721
|
-
|
|
722
|
-
debugVersion:
|
|
723
|
+
lr(a, {
|
|
724
|
+
debugVersion: ja,
|
|
723
725
|
launcherPosition: d,
|
|
724
726
|
rootClasses: o.className,
|
|
725
727
|
rootStyle: {
|
|
@@ -728,9 +730,9 @@ async function ja(e = {}) {
|
|
|
728
730
|
right: o.style.right,
|
|
729
731
|
bottom: o.style.bottom
|
|
730
732
|
},
|
|
731
|
-
rootRect:
|
|
732
|
-
launcherRect:
|
|
733
|
-
panelRect:
|
|
733
|
+
rootRect: wn(o),
|
|
734
|
+
launcherRect: wn(y),
|
|
735
|
+
panelRect: wn(w),
|
|
734
736
|
viewport: te(),
|
|
735
737
|
panelHidden: w.hidden,
|
|
736
738
|
closeHidden: L.hidden,
|
|
@@ -743,23 +745,23 @@ async function ja(e = {}) {
|
|
|
743
745
|
return $e(o, s), We("Applied stored closed launcher position", {
|
|
744
746
|
visibleLauncherPosition: s
|
|
745
747
|
}), s;
|
|
746
|
-
},
|
|
748
|
+
}, Kt = (a, s) => {
|
|
747
749
|
if (!a || !s) {
|
|
748
|
-
|
|
750
|
+
ko(o);
|
|
749
751
|
return;
|
|
750
752
|
}
|
|
751
|
-
|
|
753
|
+
rr(o, {
|
|
752
754
|
x: a.x - s.x,
|
|
753
755
|
y: a.y - s.y
|
|
754
756
|
});
|
|
755
|
-
},
|
|
757
|
+
}, Yt = () => {
|
|
756
758
|
const a = et(g).width;
|
|
757
759
|
return t.layout === "page" && w.getBoundingClientRect().width || a;
|
|
758
|
-
},
|
|
760
|
+
}, jn = () => {
|
|
759
761
|
if (o.classList.contains("pluno-pa-widget--minimized")) {
|
|
760
762
|
$e(
|
|
761
763
|
o,
|
|
762
|
-
|
|
764
|
+
mn(
|
|
763
765
|
o,
|
|
764
766
|
d,
|
|
765
767
|
t.position
|
|
@@ -769,14 +771,14 @@ async function ja(e = {}) {
|
|
|
769
771
|
}
|
|
770
772
|
const a = rt();
|
|
771
773
|
if (o.classList.contains("pluno-pa-widget--open") || o.classList.contains("pluno-pa-widget--closing")) {
|
|
772
|
-
|
|
774
|
+
hn(o, g);
|
|
773
775
|
const s = et(g);
|
|
774
|
-
|
|
776
|
+
_n(
|
|
775
777
|
R,
|
|
776
|
-
|
|
778
|
+
Yt()
|
|
777
779
|
);
|
|
778
|
-
const m =
|
|
779
|
-
h ?
|
|
780
|
+
const m = Ot(
|
|
781
|
+
h ? Dt(h, s) : fn(
|
|
780
782
|
o,
|
|
781
783
|
a,
|
|
782
784
|
t.position,
|
|
@@ -784,7 +786,7 @@ async function ja(e = {}) {
|
|
|
784
786
|
),
|
|
785
787
|
s
|
|
786
788
|
);
|
|
787
|
-
|
|
789
|
+
Kt(m, a), We(
|
|
788
790
|
"Applied open panel position after viewport resize",
|
|
789
791
|
{ openPanelPosition: m }
|
|
790
792
|
);
|
|
@@ -793,20 +795,20 @@ async function ja(e = {}) {
|
|
|
793
795
|
{ visibleLauncherPosition: a }
|
|
794
796
|
);
|
|
795
797
|
};
|
|
796
|
-
let
|
|
798
|
+
let Vn = () => {
|
|
797
799
|
};
|
|
798
|
-
window.addEventListener("resize",
|
|
800
|
+
window.addEventListener("resize", jn), t.movableLauncher && U ? (rt(), Vn = Qa({
|
|
799
801
|
root: o,
|
|
800
802
|
launcher: y,
|
|
801
803
|
launcherDragHandle: U,
|
|
802
804
|
getPosition: () => it(),
|
|
803
805
|
setPosition: (a) => {
|
|
804
|
-
const s = a, m =
|
|
806
|
+
const s = a, m = Ft(o), S = An(
|
|
805
807
|
o,
|
|
806
808
|
a,
|
|
807
809
|
m
|
|
808
810
|
);
|
|
809
|
-
d =
|
|
811
|
+
d = Eo(
|
|
810
812
|
S,
|
|
811
813
|
m
|
|
812
814
|
), $e(o, S), We("Dragging closed launcher", {
|
|
@@ -816,12 +818,12 @@ async function ja(e = {}) {
|
|
|
816
818
|
persist: () => {
|
|
817
819
|
c = !0, W(), We("Persisted closed launcher drag position");
|
|
818
820
|
}
|
|
819
|
-
})) : $e(o, null),
|
|
820
|
-
const
|
|
821
|
+
})) : $e(o, null), hn(o, g);
|
|
822
|
+
const Si = () => {
|
|
821
823
|
const a = et(g), s = it();
|
|
822
824
|
return {
|
|
823
|
-
position:
|
|
824
|
-
h ?
|
|
825
|
+
position: Ot(
|
|
826
|
+
h ? Dt(h, a) : fn(
|
|
825
827
|
o,
|
|
826
828
|
s,
|
|
827
829
|
t.position,
|
|
@@ -831,42 +833,42 @@ async function ja(e = {}) {
|
|
|
831
833
|
),
|
|
832
834
|
size: a
|
|
833
835
|
};
|
|
834
|
-
},
|
|
835
|
-
g =
|
|
836
|
+
}, Ci = (a) => {
|
|
837
|
+
g = Ht(a.size), hn(o, g), _n(
|
|
836
838
|
R,
|
|
837
|
-
|
|
839
|
+
Yt()
|
|
838
840
|
);
|
|
839
|
-
const s =
|
|
841
|
+
const s = Ot(
|
|
840
842
|
a.position,
|
|
841
843
|
et(g)
|
|
842
844
|
);
|
|
843
|
-
h =
|
|
845
|
+
h = Eo(
|
|
844
846
|
s,
|
|
845
847
|
et(g)
|
|
846
848
|
);
|
|
847
849
|
const m = it();
|
|
848
|
-
|
|
849
|
-
},
|
|
850
|
+
Kt(s, m);
|
|
851
|
+
}, Ei = D.length > 0 ? er({
|
|
850
852
|
root: o,
|
|
851
853
|
handles: D,
|
|
852
|
-
getBounds:
|
|
853
|
-
setBounds:
|
|
854
|
+
getBounds: Si,
|
|
855
|
+
setBounds: Ci,
|
|
854
856
|
persist: W
|
|
855
857
|
}) : () => {
|
|
856
858
|
};
|
|
857
|
-
let
|
|
858
|
-
const
|
|
859
|
-
if (!(!t.billingStatusLoader ||
|
|
860
|
-
|
|
859
|
+
let Xt = !1;
|
|
860
|
+
const Kn = async () => {
|
|
861
|
+
if (!(!t.billingStatusLoader || Xt)) {
|
|
862
|
+
Xt = !0;
|
|
861
863
|
try {
|
|
862
864
|
const a = await t.billingStatusLoader();
|
|
863
865
|
if (Y)
|
|
864
866
|
return;
|
|
865
|
-
|
|
867
|
+
Io(
|
|
866
868
|
t.billingStatus,
|
|
867
869
|
a,
|
|
868
|
-
|
|
869
|
-
) && (t.billingStatus = a,
|
|
870
|
+
_.getState().lastErrorCode
|
|
871
|
+
) && (t.billingStatus = a, A(_.getState().lastErrorCode), V());
|
|
870
872
|
} catch (a) {
|
|
871
873
|
J(
|
|
872
874
|
"web-sdk.widget",
|
|
@@ -874,21 +876,21 @@ async function ja(e = {}) {
|
|
|
874
876
|
{ message: a instanceof Error ? a.message : String(a) }
|
|
875
877
|
);
|
|
876
878
|
} finally {
|
|
877
|
-
|
|
879
|
+
Xt = !1;
|
|
878
880
|
}
|
|
879
881
|
}
|
|
880
882
|
}, _e = (a = "", s = !0, m = !0) => {
|
|
881
|
-
|
|
883
|
+
Kn(), dt && (dt = !1, tn()), o.classList.contains("pluno-pa-widget--open") || (h = null), ie !== null && (window.clearTimeout(ie), ie = null), at("shown", !1), w.hidden = !1, L.hidden = !1, _n(
|
|
882
884
|
R,
|
|
883
|
-
|
|
885
|
+
Yt()
|
|
884
886
|
), o.classList.remove("pluno-pa-widget--closing");
|
|
885
|
-
const S = rt(), k =
|
|
887
|
+
const S = rt(), k = fn(
|
|
886
888
|
o,
|
|
887
889
|
S,
|
|
888
890
|
t.position,
|
|
889
891
|
g
|
|
890
892
|
);
|
|
891
|
-
if (
|
|
893
|
+
if (Kt(k, S), We("Opening launcher at clamped open panel position", {
|
|
892
894
|
openPanelPosition: k,
|
|
893
895
|
visibleLauncherPosition: S
|
|
894
896
|
}), ae(!0, "open"), re(), !s) {
|
|
@@ -900,7 +902,7 @@ async function ja(e = {}) {
|
|
|
900
902
|
y.hidden = !0, mt(z, () => Be.enabled), Fe = z.scrollTop;
|
|
901
903
|
}, 220);
|
|
902
904
|
});
|
|
903
|
-
},
|
|
905
|
+
}, Zt = () => {
|
|
904
906
|
ie !== null && (window.clearTimeout(ie), ie = null), y.hidden = !1, d && (rt(!1), We("Closing launcher at stored position")), o.classList.remove("pluno-pa-widget--open"), o.classList.add("pluno-pa-widget--closing"), W(), t.onPanelOpenChange?.(!1), ie = window.setTimeout(() => {
|
|
905
907
|
w.hidden = !0, L.hidden = !0, h = null, o.classList.remove("pluno-pa-widget--closing");
|
|
906
908
|
}, 220);
|
|
@@ -912,17 +914,17 @@ async function ja(e = {}) {
|
|
|
912
914
|
}), y.addEventListener("click", (a) => {
|
|
913
915
|
a.target === u && !U || (_e(u.value), u.value = "");
|
|
914
916
|
});
|
|
915
|
-
const
|
|
917
|
+
const Yn = () => {
|
|
916
918
|
_e(u.value), u.value = "";
|
|
917
919
|
};
|
|
918
|
-
u.addEventListener("focus",
|
|
920
|
+
u.addEventListener("focus", Yn), u.addEventListener("input", () => {
|
|
919
921
|
if (!u.value)
|
|
920
922
|
return;
|
|
921
923
|
const a = u.value;
|
|
922
924
|
_e(a), u.value = "";
|
|
923
925
|
});
|
|
924
|
-
let lt = null,
|
|
925
|
-
const St = (a) => a === u || a === v,
|
|
926
|
+
let lt = null, Pe = null, vt = null, He = null, se = null, q = null;
|
|
927
|
+
const St = (a) => a === u || a === v, Xn = (a) => a.composedPath().find(St) ?? null, ki = (a) => {
|
|
926
928
|
let s = a;
|
|
927
929
|
for (; s; ) {
|
|
928
930
|
if (s.assignedSlot)
|
|
@@ -930,15 +932,15 @@ async function ja(e = {}) {
|
|
|
930
932
|
s = s.parentElement;
|
|
931
933
|
}
|
|
932
934
|
return null;
|
|
933
|
-
},
|
|
935
|
+
}, Jt = (a) => {
|
|
934
936
|
if (!(a instanceof Element) || a.getRootNode() === o.getRootNode())
|
|
935
937
|
return null;
|
|
936
938
|
let s = a;
|
|
937
939
|
for (; s; ) {
|
|
938
|
-
const m = s.closest(
|
|
940
|
+
const m = s.closest(mo);
|
|
939
941
|
if (m)
|
|
940
942
|
return m;
|
|
941
|
-
const S =
|
|
943
|
+
const S = ki(s);
|
|
942
944
|
if (S) {
|
|
943
945
|
s = S;
|
|
944
946
|
continue;
|
|
@@ -947,13 +949,13 @@ async function ja(e = {}) {
|
|
|
947
949
|
s = k instanceof ShadowRoot ? k.host : null;
|
|
948
950
|
}
|
|
949
951
|
return null;
|
|
950
|
-
},
|
|
951
|
-
let a =
|
|
952
|
+
}, Qt = () => {
|
|
953
|
+
let a = b.activeElement;
|
|
952
954
|
for (; a?.shadowRoot?.activeElement; )
|
|
953
955
|
a = a.shadowRoot.activeElement;
|
|
954
956
|
return a;
|
|
955
|
-
},
|
|
956
|
-
if (!a.isConnected || !a.matches(
|
|
957
|
+
}, Li = (a) => {
|
|
958
|
+
if (!a.isConnected || !a.matches(mo))
|
|
957
959
|
return !1;
|
|
958
960
|
if (!(a instanceof HTMLElement))
|
|
959
961
|
return !0;
|
|
@@ -963,82 +965,82 @@ async function ja(e = {}) {
|
|
|
963
965
|
return a.checkVisibility();
|
|
964
966
|
const s = window.getComputedStyle(a);
|
|
965
967
|
return s.display !== "none" && s.visibility !== "hidden";
|
|
966
|
-
},
|
|
968
|
+
}, en = (a, s) => {
|
|
967
969
|
s && (se !== null && window.clearTimeout(se), se = window.setTimeout(() => {
|
|
968
970
|
se = null, xe === a && s.isConnected && s.focus({ preventScroll: !0 });
|
|
969
971
|
}, 0));
|
|
970
972
|
}, pt = (a, s = null) => {
|
|
971
973
|
if (xe === a) {
|
|
972
|
-
a &&
|
|
974
|
+
a && en(a, s);
|
|
973
975
|
return;
|
|
974
976
|
}
|
|
975
|
-
xe = a, a !== null ? (
|
|
977
|
+
xe = a, a !== null ? (en(a, s), He = window.setInterval(() => {
|
|
976
978
|
const m = xe;
|
|
977
|
-
if (!m || !
|
|
979
|
+
if (!m || !Li(m)) {
|
|
978
980
|
pt(null);
|
|
979
981
|
return;
|
|
980
982
|
}
|
|
981
|
-
|
|
982
|
-
},
|
|
983
|
-
},
|
|
983
|
+
en(m, null);
|
|
984
|
+
}, Ia)) : (He !== null && (window.clearInterval(He), He = null), se !== null && (window.clearTimeout(se), se = null), vt = null);
|
|
985
|
+
}, Ti = () => {
|
|
984
986
|
He !== null && (window.clearInterval(He), He = null), se !== null && (window.clearTimeout(se), se = null), q !== null && (window.clearTimeout(q), q = null);
|
|
985
|
-
},
|
|
986
|
-
const s =
|
|
987
|
+
}, Zn = (a) => {
|
|
988
|
+
const s = Xn(a);
|
|
987
989
|
if (!s)
|
|
988
990
|
return;
|
|
989
991
|
const m = Date.now();
|
|
990
|
-
|
|
991
|
-
const S = xe ??
|
|
992
|
+
Pe = m, lt = m, q !== null && window.clearTimeout(q);
|
|
993
|
+
const S = xe ?? Jt(Qt());
|
|
992
994
|
S && (pt(S, s), a.stopImmediatePropagation()), q = window.setTimeout(() => {
|
|
993
|
-
if (q = null,
|
|
995
|
+
if (q = null, Pe !== m)
|
|
994
996
|
return;
|
|
995
|
-
const k =
|
|
997
|
+
const k = Qt();
|
|
996
998
|
if (k === s) {
|
|
997
|
-
|
|
999
|
+
Pe = null;
|
|
998
1000
|
return;
|
|
999
1001
|
}
|
|
1000
|
-
const
|
|
1001
|
-
|
|
1002
|
+
const Ae = Jt(k);
|
|
1003
|
+
Ae && pt(Ae, s);
|
|
1002
1004
|
}, 0);
|
|
1003
1005
|
}, Ct = (a) => {
|
|
1004
|
-
const s =
|
|
1005
|
-
s && (lt = Date.now(), xe !== null && (a.stopImmediatePropagation(),
|
|
1006
|
+
const s = Xn(a);
|
|
1007
|
+
s && (lt = Date.now(), xe !== null && (a.stopImmediatePropagation(), Pe = null, q !== null && (window.clearTimeout(q), q = null), W(), a.type === "focus" && s === u && Yn()));
|
|
1006
1008
|
};
|
|
1007
|
-
|
|
1009
|
+
b.defaultView?.addEventListener(
|
|
1008
1010
|
"pointerdown",
|
|
1009
|
-
|
|
1011
|
+
Zn,
|
|
1010
1012
|
!0
|
|
1011
|
-
),
|
|
1013
|
+
), b.defaultView?.addEventListener(
|
|
1012
1014
|
"focus",
|
|
1013
1015
|
Ct,
|
|
1014
1016
|
!0
|
|
1015
|
-
),
|
|
1017
|
+
), b.defaultView?.addEventListener(
|
|
1016
1018
|
"focusin",
|
|
1017
1019
|
Ct,
|
|
1018
1020
|
!0
|
|
1019
1021
|
), o.addEventListener("pointerdown", (a) => {
|
|
1020
1022
|
St(a.target) && a.stopPropagation();
|
|
1021
1023
|
}), o.addEventListener("focusin", (a) => {
|
|
1022
|
-
St(a.target) && (a.stopPropagation(), lt = Date.now(),
|
|
1024
|
+
St(a.target) && (a.stopPropagation(), lt = Date.now(), Pe = null, q !== null && (window.clearTimeout(q), q = null), W());
|
|
1023
1025
|
}), o.addEventListener("focusout", (a) => {
|
|
1024
1026
|
if (!St(a.target) || xe !== null)
|
|
1025
1027
|
return;
|
|
1026
1028
|
const s = lt;
|
|
1027
|
-
if (lt = null, s === null || Date.now() - s >
|
|
1029
|
+
if (lt = null, s === null || Date.now() - s > fo)
|
|
1028
1030
|
return;
|
|
1029
|
-
const m = a.target, S =
|
|
1030
|
-
|
|
1031
|
-
const k = (
|
|
1032
|
-
const
|
|
1033
|
-
if (!
|
|
1031
|
+
const m = a.target, S = Pe !== null && Date.now() - Pe <= fo;
|
|
1032
|
+
Pe = null, q !== null && (window.clearTimeout(q), q = null);
|
|
1033
|
+
const k = (Ae) => {
|
|
1034
|
+
const cn = Jt(Ae);
|
|
1035
|
+
if (!cn)
|
|
1034
1036
|
return !1;
|
|
1035
1037
|
if (S)
|
|
1036
|
-
return pt(
|
|
1037
|
-
const
|
|
1038
|
-
return vt !== null &&
|
|
1038
|
+
return pt(cn, m), !0;
|
|
1039
|
+
const io = Date.now();
|
|
1040
|
+
return vt !== null && io - vt <= Aa ? (pt(cn, m), !0) : (vt = io, !0);
|
|
1039
1041
|
};
|
|
1040
1042
|
k(a.relatedTarget) || window.setTimeout(() => {
|
|
1041
|
-
xe === null && m.isConnected && k(
|
|
1043
|
+
xe === null && m.isConnected && k(Qt());
|
|
1042
1044
|
}, 0);
|
|
1043
1045
|
}), y.addEventListener("keydown", (a) => {
|
|
1044
1046
|
!o.classList.contains("pluno-pa-widget--minimized") || a.key !== "Enter" && a.key !== " " || (a.preventDefault(), _e());
|
|
@@ -1046,37 +1048,37 @@ async function ja(e = {}) {
|
|
|
1046
1048
|
a.stopPropagation();
|
|
1047
1049
|
}), H?.addEventListener("click", (a) => {
|
|
1048
1050
|
a.preventDefault(), a.stopPropagation(), at("minimized");
|
|
1049
|
-
}), L.addEventListener("click",
|
|
1051
|
+
}), L.addEventListener("click", Zt), z.addEventListener("scroll", () => {
|
|
1050
1052
|
z.scrollTop < Fe - 1 && ae(!1, "userScroll"), Fe = z.scrollTop;
|
|
1051
1053
|
}), he.addEventListener("click", () => {
|
|
1052
|
-
|
|
1054
|
+
yi();
|
|
1053
1055
|
});
|
|
1054
|
-
const
|
|
1056
|
+
const Jn = typeof IntersectionObserver > "u" ? null : new IntersectionObserver(
|
|
1055
1057
|
([a]) => {
|
|
1056
1058
|
a?.isIntersecting && (ae(!0, "bottom"), re());
|
|
1057
1059
|
},
|
|
1058
1060
|
{ root: z, threshold: 0 }
|
|
1059
1061
|
);
|
|
1060
|
-
|
|
1062
|
+
Jn?.observe(tt);
|
|
1061
1063
|
const st = () => t.loginRequired || t.signupRequired;
|
|
1062
1064
|
let xe = null, dt = !1;
|
|
1063
|
-
const le = () => xt ||
|
|
1065
|
+
const le = () => xt || _.getState().status !== "connected", Ve = () => {
|
|
1064
1066
|
const a = st();
|
|
1065
1067
|
u.readOnly = !1, v.readOnly = !1, u.placeholder = a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : dt ? "New update" : t.launcherLabel, v.placeholder = a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : Se.launcherLabel, ne.hidden = a;
|
|
1066
1068
|
}, V = () => {
|
|
1067
|
-
F.disabled = le() || pe(t.billingStatus) || !
|
|
1069
|
+
F.disabled = le() || pe(t.billingStatus) || !_.getState().isThinking && v.value.trim().length === 0 && M.length === 0, B.disabled = st() || le() || pe(t.billingStatus);
|
|
1068
1070
|
};
|
|
1069
1071
|
Ve();
|
|
1070
|
-
const
|
|
1071
|
-
const a =
|
|
1072
|
+
const tn = () => {
|
|
1073
|
+
const a = _.getState().isThinking;
|
|
1072
1074
|
o.classList.toggle("pluno-pa-widget--thinking", a), o.classList.toggle(
|
|
1073
1075
|
"pluno-pa-widget--unread",
|
|
1074
1076
|
!a && dt
|
|
1075
1077
|
), Ve();
|
|
1076
1078
|
};
|
|
1077
|
-
|
|
1078
|
-
const
|
|
1079
|
-
st() || Y || (xt = !0, Ve(), V(),
|
|
1079
|
+
tn();
|
|
1080
|
+
const nn = () => {
|
|
1081
|
+
st() || Y || (xt = !0, Ve(), V(), _.connect().then(
|
|
1080
1082
|
() => {
|
|
1081
1083
|
Y || (xt = !1, Ve(), V());
|
|
1082
1084
|
},
|
|
@@ -1100,56 +1102,56 @@ async function ja(e = {}) {
|
|
|
1100
1102
|
t.onSignupClick?.();
|
|
1101
1103
|
return;
|
|
1102
1104
|
}
|
|
1103
|
-
le() || pe(t.billingStatus) || (Le = !0, ae(!0, "send"), re(), M =
|
|
1104
|
-
|
|
1105
|
+
le() || pe(t.billingStatus) || (Le = !0, ae(!0, "send"), re(), M = bn(
|
|
1106
|
+
_,
|
|
1105
1107
|
v,
|
|
1106
1108
|
M,
|
|
1107
|
-
|
|
1109
|
+
Rt
|
|
1108
1110
|
), je(), V());
|
|
1109
1111
|
});
|
|
1110
1112
|
let ct = 0;
|
|
1111
|
-
const
|
|
1113
|
+
const Pi = () => {
|
|
1112
1114
|
ct = 0, o.classList.remove("pluno-pa-widget--drag-over");
|
|
1113
|
-
},
|
|
1115
|
+
}, on = (a) => {
|
|
1114
1116
|
fe !== null && window.clearTimeout(fe), $.textContent = a, $.hidden = !1, fe = window.setTimeout(() => {
|
|
1115
1117
|
$.textContent = "", $.hidden = !0, fe = null;
|
|
1116
1118
|
}, 3e3);
|
|
1117
|
-
},
|
|
1119
|
+
}, Ai = () => {
|
|
1118
1120
|
fe !== null && (window.clearTimeout(fe), fe = null), $.textContent = "", $.hidden = !0;
|
|
1119
|
-
},
|
|
1121
|
+
}, an = async (a) => {
|
|
1120
1122
|
if (!t.attachmentsEnabled || a.length === 0)
|
|
1121
1123
|
return;
|
|
1122
|
-
const s =
|
|
1123
|
-
if (M = [...M, ...s], je(),
|
|
1124
|
+
const s = Ur(_, a);
|
|
1125
|
+
if (M = [...M, ...s], je(), Ai(), V(), O(_.getState()), !o.classList.contains("pluno-pa-widget--open")) {
|
|
1124
1126
|
_e();
|
|
1125
1127
|
return;
|
|
1126
1128
|
}
|
|
1127
1129
|
ke();
|
|
1128
|
-
},
|
|
1129
|
-
await
|
|
1130
|
+
}, Ii = async (a) => {
|
|
1131
|
+
await an(a), !(a.length === 0 || xe !== null) && v.focus();
|
|
1130
1132
|
};
|
|
1131
1133
|
B.addEventListener("click", () => {
|
|
1132
1134
|
t.loginRequired || le() || pe(t.billingStatus) || ge.click();
|
|
1133
1135
|
}), ge.addEventListener("change", () => {
|
|
1134
1136
|
const a = Array.from(ge.files ?? []);
|
|
1135
|
-
ge.value = "",
|
|
1136
|
-
|
|
1137
|
+
ge.value = "", Ii(a).catch((s) => {
|
|
1138
|
+
on(
|
|
1137
1139
|
s instanceof Error ? s.message : "Failed to attach file"
|
|
1138
1140
|
), J("web-sdk.widget", "Attachment failed", {
|
|
1139
1141
|
message: s instanceof Error ? s.message : String(s)
|
|
1140
1142
|
});
|
|
1141
1143
|
});
|
|
1142
1144
|
}), o.addEventListener("dragenter", (a) => {
|
|
1143
|
-
!t.attachmentsEnabled || !
|
|
1145
|
+
!t.attachmentsEnabled || !zt(a.dataTransfer) || t.loginRequired || le() || (a.preventDefault(), a.stopPropagation(), ct += 1, o.classList.add("pluno-pa-widget--drag-over"));
|
|
1144
1146
|
}), o.addEventListener("dragover", (a) => {
|
|
1145
1147
|
const s = a.dataTransfer;
|
|
1146
|
-
!t.attachmentsEnabled || !
|
|
1148
|
+
!t.attachmentsEnabled || !zt(s) || t.loginRequired || le() || (a.preventDefault(), a.stopPropagation(), s.dropEffect = "copy");
|
|
1147
1149
|
}), o.addEventListener("dragleave", (a) => {
|
|
1148
|
-
|
|
1150
|
+
zt(a.dataTransfer) && (a.stopPropagation(), ct = Math.max(0, ct - 1), ct === 0 && o.classList.remove("pluno-pa-widget--drag-over"));
|
|
1149
1151
|
}), o.addEventListener("drop", (a) => {
|
|
1150
1152
|
const s = a.dataTransfer;
|
|
1151
|
-
!t.attachmentsEnabled || !
|
|
1152
|
-
|
|
1153
|
+
!t.attachmentsEnabled || !zt(s) || t.loginRequired || le() || (a.preventDefault(), a.stopPropagation(), Pi(), an(s.files).catch((m) => {
|
|
1154
|
+
on(
|
|
1153
1155
|
m instanceof Error ? m.message : "Failed to attach file"
|
|
1154
1156
|
), J("web-sdk.widget", "Attachment failed", {
|
|
1155
1157
|
message: m instanceof Error ? m.message : String(m)
|
|
@@ -1158,8 +1160,8 @@ async function ja(e = {}) {
|
|
|
1158
1160
|
}), o.addEventListener("paste", (a) => {
|
|
1159
1161
|
a.stopPropagation();
|
|
1160
1162
|
const s = a.clipboardData, m = Array.from(s?.files ?? []);
|
|
1161
|
-
!t.attachmentsEnabled || m.length === 0 || t.loginRequired || le() || (a.preventDefault(),
|
|
1162
|
-
|
|
1163
|
+
!t.attachmentsEnabled || m.length === 0 || t.loginRequired || le() || (a.preventDefault(), an(m).catch((S) => {
|
|
1164
|
+
on(
|
|
1163
1165
|
S instanceof Error ? S.message : "Failed to attach file"
|
|
1164
1166
|
), J("web-sdk.widget", "Attachment failed", {
|
|
1165
1167
|
message: S instanceof Error ? S.message : String(S)
|
|
@@ -1170,43 +1172,43 @@ async function ja(e = {}) {
|
|
|
1170
1172
|
t.onLoginClick?.();
|
|
1171
1173
|
return;
|
|
1172
1174
|
}
|
|
1173
|
-
if (
|
|
1174
|
-
|
|
1175
|
+
if (_.getState().isThinking) {
|
|
1176
|
+
_.stop();
|
|
1175
1177
|
return;
|
|
1176
1178
|
}
|
|
1177
1179
|
if (le())
|
|
1178
1180
|
return;
|
|
1179
1181
|
const a = v.value.trim().length > 0 || M.length > 0;
|
|
1180
|
-
Le = !0, ae(!0, "send"), re(), M =
|
|
1181
|
-
|
|
1182
|
+
Le = !0, ae(!0, "send"), re(), M = bn(
|
|
1183
|
+
_,
|
|
1182
1184
|
v,
|
|
1183
1185
|
M,
|
|
1184
|
-
|
|
1185
|
-
), je(), V(), O(
|
|
1186
|
+
Rt
|
|
1187
|
+
), je(), V(), O(_.getState()), a && ke();
|
|
1186
1188
|
}), Z.addEventListener("click", () => {
|
|
1187
|
-
X = !X, ot = null, be(), X && Te.length === 0 &&
|
|
1189
|
+
X = !X, ot = null, be(), X && Te.length === 0 && $n(null), X || ke();
|
|
1188
1190
|
}), _t.addEventListener("click", () => {
|
|
1189
1191
|
X = !1, be(), ke();
|
|
1190
|
-
}), K.addEventListener("scroll",
|
|
1191
|
-
ht(v), W(), V(),
|
|
1192
|
+
}), K.addEventListener("scroll", vi), v.addEventListener("input", () => {
|
|
1193
|
+
ht(v), W(), V(), zi();
|
|
1192
1194
|
}), v.addEventListener("keydown", (a) => {
|
|
1193
1195
|
if (!(a.key !== "Enter" || a.shiftKey)) {
|
|
1194
1196
|
if (a.preventDefault(), t.loginRequired) {
|
|
1195
1197
|
t.onLoginClick?.();
|
|
1196
1198
|
return;
|
|
1197
1199
|
}
|
|
1198
|
-
le() || (Le = !0, ae(!0, "send"), re(), M =
|
|
1199
|
-
|
|
1200
|
+
le() || (Le = !0, ae(!0, "send"), re(), M = bn(
|
|
1201
|
+
_,
|
|
1200
1202
|
v,
|
|
1201
1203
|
M,
|
|
1202
|
-
|
|
1203
|
-
), je(), V(), O(
|
|
1204
|
+
Rt
|
|
1205
|
+
), je(), V(), O(_.getState()));
|
|
1204
1206
|
}
|
|
1205
1207
|
}), o.addEventListener("click", (a) => {
|
|
1206
1208
|
const s = a.target instanceof Element ? a.target : null;
|
|
1207
|
-
s?.closest("a[href]") && W(), X &&
|
|
1209
|
+
s?.closest("a[href]") && W(), X && sa(s, ze, Z) && (X = !1, be());
|
|
1208
1210
|
const S = window.getSelection(), k = !!(S && !S.isCollapsed && S.anchorNode && o.contains(S.anchorNode));
|
|
1209
|
-
|
|
1211
|
+
la(a.target, a.detail, k) && ke();
|
|
1210
1212
|
}), o.addEventListener("copy", (a) => {
|
|
1211
1213
|
a.clipboardData && window.getSelection() && !window.getSelection()?.isCollapsed && window.getSelection()?.anchorNode && window.getSelection()?.focusNode && o.contains(window.getSelection()?.anchorNode ?? null) && o.contains(window.getSelection()?.focusNode ?? null) && window.getSelection()?.toString() && (a.clipboardData.clearData(), a.clipboardData.setData(
|
|
1212
1214
|
"text/plain",
|
|
@@ -1225,17 +1227,20 @@ async function ja(e = {}) {
|
|
|
1225
1227
|
return;
|
|
1226
1228
|
}
|
|
1227
1229
|
a.key !== "Escape" || !X || (X = !1, be(), ke());
|
|
1228
|
-
}), l.composerValue && (v.value = l.composerValue, ht(v)), t.layout === "page" ? _e(v.value, !1) : p === "minimized" ? at("minimized", !1) : t.initialDisplayState === void 0 && l.isOpen && _e(v.value, !1, !1),
|
|
1230
|
+
}), l.composerValue && (v.value = l.composerValue, ht(v)), t.layout === "page" ? _e(v.value, !1) : p === "minimized" ? at("minimized", !1) : t.initialDisplayState === void 0 && l.isOpen && _e(v.value, !1, !1), sr(l, o, u, v);
|
|
1229
1231
|
const Et = () => r;
|
|
1230
|
-
let
|
|
1232
|
+
let rn = _.getState().appearance !== null, kt = null, ut = null, Qn = _.getState().isThinking, Ke = null;
|
|
1231
1233
|
const gt = t.taskNotifications;
|
|
1232
1234
|
let Ye = null, Xe = !1;
|
|
1233
|
-
const
|
|
1235
|
+
const eo = () => {
|
|
1234
1236
|
Ye !== null && (window.clearTimeout(Ye), Ye = null);
|
|
1235
1237
|
}, Lt = () => {
|
|
1236
1238
|
De && (De.hidden = !0);
|
|
1237
|
-
},
|
|
1238
|
-
|
|
1239
|
+
}, Tt = () => {
|
|
1240
|
+
const a = _.getState();
|
|
1241
|
+
return a.assistantDraft.trim().length > 0 && a.assistantDraftPhase !== "commentary";
|
|
1242
|
+
}, Ni = async () => {
|
|
1243
|
+
if (!gt || !De || Xe || Y || !_.getState().isThinking || Tt())
|
|
1239
1244
|
return;
|
|
1240
1245
|
let a;
|
|
1241
1246
|
try {
|
|
@@ -1243,7 +1248,7 @@ async function ja(e = {}) {
|
|
|
1243
1248
|
} catch {
|
|
1244
1249
|
return;
|
|
1245
1250
|
}
|
|
1246
|
-
a.enabled || a.neverSuggest || !
|
|
1251
|
+
a.enabled || a.neverSuggest || !_.getState().isThinking || Tt() || Xe || Y || (De.hidden = !1);
|
|
1247
1252
|
};
|
|
1248
1253
|
Oe?.addEventListener("click", () => {
|
|
1249
1254
|
Xe = !0, Lt(), gt?.enable().catch(() => {
|
|
@@ -1254,35 +1259,35 @@ async function ja(e = {}) {
|
|
|
1254
1259
|
Xe = !0, Lt(), gt?.dismissForever().catch(() => {
|
|
1255
1260
|
});
|
|
1256
1261
|
});
|
|
1257
|
-
const
|
|
1262
|
+
const Pt = t.tabGroups;
|
|
1258
1263
|
let Ze = !1;
|
|
1259
1264
|
const At = async () => {
|
|
1260
|
-
if (!
|
|
1265
|
+
if (!Pt || !I || Ze || Y)
|
|
1261
1266
|
return;
|
|
1262
|
-
const a = await
|
|
1267
|
+
const a = await Pt.getState().catch(() => null);
|
|
1263
1268
|
!a || Ze || Y || (I.hidden = !a.permissionNeeded);
|
|
1264
1269
|
};
|
|
1265
1270
|
Ee?.addEventListener("click", () => {
|
|
1266
|
-
Ze = !0, I && (I.hidden = !0),
|
|
1271
|
+
Ze = !0, I && (I.hidden = !0), Pt?.enable().catch(() => {
|
|
1267
1272
|
}).finally(() => {
|
|
1268
1273
|
Ze = !1, At();
|
|
1269
1274
|
});
|
|
1270
1275
|
}), oe?.addEventListener("click", () => {
|
|
1271
|
-
Ze = !0, I && (I.hidden = !0),
|
|
1276
|
+
Ze = !0, I && (I.hidden = !0), Pt?.dismiss().catch(() => {
|
|
1272
1277
|
}).finally(() => {
|
|
1273
1278
|
Ze = !1, At();
|
|
1274
1279
|
});
|
|
1275
1280
|
}), At();
|
|
1276
1281
|
let Je = null, to = () => {
|
|
1277
1282
|
};
|
|
1278
|
-
const
|
|
1279
|
-
const a = Je !== null &&
|
|
1280
|
-
me.hidden = !a, a && Je !== null &&
|
|
1283
|
+
const Ri = !!(t.sdkPreviewChannelId && t.referralLinkLoader), It = /* @__PURE__ */ new Map(), ln = () => v.value.trim().length > 0 || M.length > 0, zi = () => {
|
|
1284
|
+
const a = Je !== null && yn(_.getState(), ln());
|
|
1285
|
+
me.hidden = !a, a && Je !== null && ni(me, Je);
|
|
1281
1286
|
};
|
|
1282
1287
|
let Qe = null;
|
|
1283
|
-
const ye = /* @__PURE__ */ new Map(),
|
|
1288
|
+
const ye = /* @__PURE__ */ new Map(), Nt = /* @__PURE__ */ new Set(), Mi = async (a) => {
|
|
1284
1289
|
if (t.integrationAuthHandler) {
|
|
1285
|
-
ye.set(a.authRequestId, { status: "connecting" }), O(
|
|
1290
|
+
ye.set(a.authRequestId, { status: "connecting" }), O(_.getState());
|
|
1286
1291
|
try {
|
|
1287
1292
|
await t.integrationAuthHandler(a), ye.set(a.authRequestId, { status: "completed" });
|
|
1288
1293
|
} catch (s) {
|
|
@@ -1291,29 +1296,29 @@ async function ja(e = {}) {
|
|
|
1291
1296
|
error: s instanceof Error ? s.message : `Could not connect ${a.appName}.`
|
|
1292
1297
|
});
|
|
1293
1298
|
}
|
|
1294
|
-
O(
|
|
1299
|
+
O(_.getState());
|
|
1295
1300
|
}
|
|
1296
|
-
},
|
|
1297
|
-
Le = !0, ae(!0, "newSession"), re(), X = !1, be(),
|
|
1298
|
-
},
|
|
1299
|
-
t.morningReport !== null && (t.morningReport = null, t.onMorningReportTaskStart?.(),
|
|
1300
|
-
},
|
|
1301
|
+
}, pn = (a = {}) => {
|
|
1302
|
+
Le = !0, ae(!0, "newSession"), re(), X = !1, be(), _.startNewSession(a), qt.clear(), ye.clear(), Nt.clear(), v.value = "", M = [], je(), ht(v), W(), V(), v.focus(), O(_.getState());
|
|
1303
|
+
}, Rt = () => {
|
|
1304
|
+
t.morningReport !== null && (t.morningReport = null, t.onMorningReportTaskStart?.(), pn());
|
|
1305
|
+
}, sn = (a) => {
|
|
1301
1306
|
if (!a || t.layout === "page") {
|
|
1302
1307
|
Qe?.remove(), Qe = null;
|
|
1303
1308
|
return;
|
|
1304
1309
|
}
|
|
1305
|
-
Qe || (Qe =
|
|
1310
|
+
Qe || (Qe = $t(
|
|
1306
1311
|
"pluno-pa-widget__new-chat",
|
|
1307
1312
|
"New chat",
|
|
1308
|
-
|
|
1313
|
+
Tr(),
|
|
1309
1314
|
!1
|
|
1310
|
-
), Qe.addEventListener("click", () =>
|
|
1315
|
+
), Qe.addEventListener("click", () => pn()), j.insertBefore(Qe, Z));
|
|
1311
1316
|
}, O = (a) => {
|
|
1312
|
-
if (be(),
|
|
1313
|
-
|
|
1317
|
+
if (be(), Bn(a.lastErrorCode) ? Ke = a.lastErrorCode : t.billingStatus?.creditsUsed !== null && !pe(t.billingStatus) && (Ke = null), A(Ke), t.loginRequired) {
|
|
1318
|
+
It.clear(), Mo(
|
|
1314
1319
|
z,
|
|
1315
1320
|
F,
|
|
1316
|
-
|
|
1321
|
+
sn,
|
|
1317
1322
|
Et,
|
|
1318
1323
|
"Log in to use Pluno on this page.",
|
|
1319
1324
|
t.loginButtonLabel,
|
|
@@ -1323,10 +1328,10 @@ async function ja(e = {}) {
|
|
|
1323
1328
|
return;
|
|
1324
1329
|
}
|
|
1325
1330
|
if (t.signupRequired) {
|
|
1326
|
-
|
|
1331
|
+
It.clear(), Mo(
|
|
1327
1332
|
z,
|
|
1328
1333
|
F,
|
|
1329
|
-
|
|
1334
|
+
sn,
|
|
1330
1335
|
Et,
|
|
1331
1336
|
"Complete signup to unlock your free trial credits.",
|
|
1332
1337
|
t.signupButtonLabel,
|
|
@@ -1335,44 +1340,44 @@ async function ja(e = {}) {
|
|
|
1335
1340
|
);
|
|
1336
1341
|
return;
|
|
1337
1342
|
}
|
|
1338
|
-
const s =
|
|
1339
|
-
|
|
1343
|
+
const s = cr(a), m = s !== Hn;
|
|
1344
|
+
Hn = s;
|
|
1340
1345
|
const S = Le || Be.enabled;
|
|
1341
|
-
Le = !1,
|
|
1346
|
+
Le = !1, jr(
|
|
1342
1347
|
z,
|
|
1343
1348
|
tt,
|
|
1344
1349
|
F,
|
|
1345
|
-
|
|
1350
|
+
sn,
|
|
1346
1351
|
me,
|
|
1347
1352
|
a,
|
|
1348
1353
|
Je,
|
|
1349
|
-
Je !== null &&
|
|
1354
|
+
Je !== null && yn(a, ln()),
|
|
1350
1355
|
S,
|
|
1351
1356
|
() => Be.enabled,
|
|
1352
|
-
|
|
1353
|
-
|
|
1357
|
+
qt,
|
|
1358
|
+
It,
|
|
1354
1359
|
W,
|
|
1355
1360
|
Et,
|
|
1356
1361
|
(k) => {
|
|
1357
|
-
le() || (
|
|
1362
|
+
le() || (Rt(), Le = !0, ae(!0, "send"), re(), _.sendMessage(k));
|
|
1358
1363
|
},
|
|
1359
1364
|
() => {
|
|
1360
|
-
Le = !0, ae(!0, "send"), re(),
|
|
1365
|
+
Le = !0, ae(!0, "send"), re(), _.retryLastMessage();
|
|
1361
1366
|
},
|
|
1362
1367
|
t.morningReport,
|
|
1363
1368
|
() => {
|
|
1364
|
-
t.morningReport = null, t.onMorningReportSnooze?.(),
|
|
1369
|
+
t.morningReport = null, t.onMorningReportSnooze?.(), Zt(), O(_.getState());
|
|
1365
1370
|
},
|
|
1366
|
-
|
|
1371
|
+
nn,
|
|
1367
1372
|
t.attachmentPreviewUrlResolver,
|
|
1368
1373
|
t.integrationAuthHandler ? {
|
|
1369
1374
|
states: ye,
|
|
1370
1375
|
initialStatus: t.integrationAuthStatusLoader ? "checking" : "pending",
|
|
1371
1376
|
onConnect: (k) => {
|
|
1372
|
-
|
|
1377
|
+
Mi(k);
|
|
1373
1378
|
}
|
|
1374
1379
|
} : void 0,
|
|
1375
|
-
|
|
1380
|
+
Ri && !jt ? {
|
|
1376
1381
|
dismissedCandidateIds: nt,
|
|
1377
1382
|
actionCandidate: kt,
|
|
1378
1383
|
error: ut,
|
|
@@ -1382,20 +1387,27 @@ async function ja(e = {}) {
|
|
|
1382
1387
|
Ue.add(k.id), W();
|
|
1383
1388
|
},
|
|
1384
1389
|
onReferralCopy: (k) => {
|
|
1385
|
-
|
|
1390
|
+
Di(k);
|
|
1386
1391
|
},
|
|
1387
1392
|
onSocialShare: (k) => {
|
|
1388
1393
|
Ue.add(k.id), nt.add(k.id), W();
|
|
1389
1394
|
},
|
|
1390
1395
|
onDismiss: (k) => {
|
|
1391
|
-
Ue.add(k.id), nt.add(k.id), W(), ut = null, O(
|
|
1396
|
+
Ue.add(k.id), nt.add(k.id), W(), ut = null, O(_.getState());
|
|
1392
1397
|
},
|
|
1393
1398
|
onDisable: (k) => {
|
|
1394
|
-
|
|
1399
|
+
jt = !0, Ue.add(k.id), nt.add(k.id), W(), El(t, !0), ut = null, O(_.getState());
|
|
1395
1400
|
}
|
|
1396
1401
|
} : void 0
|
|
1397
|
-
), S ? (Fe = z.scrollTop, re()) : m &&
|
|
1398
|
-
}, no =
|
|
1402
|
+
), S ? (Fe = z.scrollTop, re()) : m && ur(a) && xi();
|
|
1403
|
+
}, no = () => {
|
|
1404
|
+
b.getSelection()?.isCollapsed !== !1 && Jr(It) && O(_.getState());
|
|
1405
|
+
};
|
|
1406
|
+
b.addEventListener(
|
|
1407
|
+
"selectionchange",
|
|
1408
|
+
no
|
|
1409
|
+
);
|
|
1410
|
+
const oo = async (a) => {
|
|
1399
1411
|
if (!t.integrationAuthStatusLoader)
|
|
1400
1412
|
return;
|
|
1401
1413
|
const s = a.messages.map((m) => m.integrationAuthRequest).filter(
|
|
@@ -1403,10 +1415,10 @@ async function ja(e = {}) {
|
|
|
1403
1415
|
);
|
|
1404
1416
|
await Promise.all(
|
|
1405
1417
|
s.map(async (m) => {
|
|
1406
|
-
if (!(ye.has(m.authRequestId) ||
|
|
1407
|
-
|
|
1418
|
+
if (!(ye.has(m.authRequestId) || Nt.has(m.authRequestId))) {
|
|
1419
|
+
Nt.add(m.authRequestId), ye.set(m.authRequestId, {
|
|
1408
1420
|
status: "checking"
|
|
1409
|
-
}), O(
|
|
1421
|
+
}), O(_.getState());
|
|
1410
1422
|
try {
|
|
1411
1423
|
const S = await t.integrationAuthStatusLoader(m);
|
|
1412
1424
|
ye.set(m.authRequestId, { status: S });
|
|
@@ -1416,34 +1428,34 @@ async function ja(e = {}) {
|
|
|
1416
1428
|
error: S instanceof Error ? S.message : `Could not load ${m.appName} connection status.`
|
|
1417
1429
|
});
|
|
1418
1430
|
} finally {
|
|
1419
|
-
|
|
1431
|
+
Nt.delete(m.authRequestId);
|
|
1420
1432
|
}
|
|
1421
|
-
Y || O(
|
|
1433
|
+
Y || O(_.getState());
|
|
1422
1434
|
}
|
|
1423
1435
|
})
|
|
1424
1436
|
);
|
|
1425
1437
|
};
|
|
1426
|
-
return to =
|
|
1438
|
+
return to = ta(
|
|
1427
1439
|
(a) => {
|
|
1428
|
-
Je = a, !Y &&
|
|
1440
|
+
Je = a, !Y && yn(_.getState(), ln()) && O(_.getState());
|
|
1429
1441
|
},
|
|
1430
1442
|
{
|
|
1431
1443
|
backendUrl: t.backendUrl,
|
|
1432
|
-
fetcher:
|
|
1444
|
+
fetcher: _i,
|
|
1433
1445
|
loader: t.activeUsersLoader
|
|
1434
1446
|
}
|
|
1435
|
-
),
|
|
1447
|
+
), _.on("state", (a) => {
|
|
1436
1448
|
At();
|
|
1437
|
-
const s =
|
|
1438
|
-
|
|
1439
|
-
Ye = null,
|
|
1440
|
-
},
|
|
1449
|
+
const s = Qn && !a.isThinking;
|
|
1450
|
+
Qn = a.isThinking, a.isThinking && !Tt() && gt && !Xe && Ye === null && De?.hidden !== !1 && (Ye = window.setTimeout(() => {
|
|
1451
|
+
Ye = null, Ni();
|
|
1452
|
+
}, ma)), (!a.isThinking || Tt()) && (eo(), Lt()), s && !o.classList.contains("pluno-pa-widget--open") && (dt = !0), tn(), a.appearance ? (rn = !0, J(
|
|
1441
1453
|
"web-sdk.widget",
|
|
1442
1454
|
"Agent state supplied appearance",
|
|
1443
1455
|
{
|
|
1444
1456
|
appearance: a.appearance
|
|
1445
1457
|
}
|
|
1446
|
-
),
|
|
1458
|
+
), dn(a.appearance, "agent.state.appearance")) : rn && (rn = !1, J(
|
|
1447
1459
|
"web-sdk.widget",
|
|
1448
1460
|
"Agent state cleared appearance; reverting to configured widget options",
|
|
1449
1461
|
{
|
|
@@ -1451,31 +1463,31 @@ async function ja(e = {}) {
|
|
|
1451
1463
|
fallbackColorScheme: t.colorScheme,
|
|
1452
1464
|
fallbackFontFamily: t.fontFamily
|
|
1453
1465
|
}
|
|
1454
|
-
),
|
|
1455
|
-
}), O(
|
|
1456
|
-
agent:
|
|
1457
|
-
startNewChat:
|
|
1466
|
+
), dn({}, "agent.state.appearance-cleared")), O(a), oo(a), V(), s && Kn();
|
|
1467
|
+
}), O(_.getState()), oo(_.getState()), V(), nn(), {
|
|
1468
|
+
agent: _,
|
|
1469
|
+
startNewChat: pn,
|
|
1458
1470
|
host: n,
|
|
1459
1471
|
updateAppearance: (a) => {
|
|
1460
|
-
a.scribbleStyle !== void 0 && (t.scribbleStyle = a.scribbleStyle),
|
|
1472
|
+
a.scribbleStyle !== void 0 && (t.scribbleStyle = a.scribbleStyle), dn(a, "widgetHandle.updateAppearance");
|
|
1461
1473
|
},
|
|
1462
1474
|
updateBillingStatus: (a) => {
|
|
1463
1475
|
const s = a ?? null;
|
|
1464
|
-
|
|
1476
|
+
Io(
|
|
1465
1477
|
t.billingStatus,
|
|
1466
1478
|
s,
|
|
1467
1479
|
Ke
|
|
1468
|
-
) && (t.billingStatus = s, t.billingStatus?.creditsUsed !== null && !pe(t.billingStatus) && (Ke = null),
|
|
1480
|
+
) && (t.billingStatus = s, t.billingStatus?.creditsUsed !== null && !pe(t.billingStatus) && (Ke = null), A(Ke), V());
|
|
1469
1481
|
},
|
|
1470
1482
|
updateAuthGate: (a) => {
|
|
1471
1483
|
const s = st();
|
|
1472
|
-
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), Ve(), O(
|
|
1484
|
+
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), Ve(), O(_.getState()), V(), s && !st() && nn();
|
|
1473
1485
|
},
|
|
1474
1486
|
openPanel: (a) => {
|
|
1475
1487
|
const s = typeof a == "string" ? a : v.value, m = typeof a == "object" ? a.focusComposer !== !1 : !0;
|
|
1476
1488
|
_e(s, !1, m);
|
|
1477
1489
|
},
|
|
1478
|
-
closePanel:
|
|
1490
|
+
closePanel: Zt,
|
|
1479
1491
|
updateDisplayState: (a) => {
|
|
1480
1492
|
if (a === "shown") {
|
|
1481
1493
|
at("shown", !1);
|
|
@@ -1484,42 +1496,45 @@ async function ja(e = {}) {
|
|
|
1484
1496
|
at("minimized", !1);
|
|
1485
1497
|
},
|
|
1486
1498
|
updateMorningReport: (a) => {
|
|
1487
|
-
t.morningReport = a ?? null, O(
|
|
1499
|
+
t.morningReport = a ?? null, O(_.getState());
|
|
1488
1500
|
},
|
|
1489
1501
|
destroy: () => {
|
|
1490
|
-
Y || (W(), Y = !0,
|
|
1502
|
+
Y || (W(), Y = !0, qn.disconnect(), b.removeEventListener(
|
|
1503
|
+
"selectionchange",
|
|
1504
|
+
no
|
|
1505
|
+
), Jn?.disconnect(), Ti(), b.defaultView?.removeEventListener(
|
|
1491
1506
|
"pointerdown",
|
|
1492
|
-
|
|
1507
|
+
Zn,
|
|
1493
1508
|
!0
|
|
1494
|
-
),
|
|
1509
|
+
), b.defaultView?.removeEventListener(
|
|
1495
1510
|
"focus",
|
|
1496
1511
|
Ct,
|
|
1497
1512
|
!0
|
|
1498
|
-
),
|
|
1513
|
+
), b.defaultView?.removeEventListener(
|
|
1499
1514
|
"focusin",
|
|
1500
1515
|
Ct,
|
|
1501
1516
|
!0
|
|
1502
|
-
), window.removeEventListener("resize",
|
|
1517
|
+
), window.removeEventListener("resize", jn), Vn(), Ei(), fe !== null && window.clearTimeout(fe), eo(), to(), _.destroy(), Gt.release(), n.remove());
|
|
1503
1518
|
}
|
|
1504
1519
|
};
|
|
1505
|
-
async function
|
|
1520
|
+
async function Di(a) {
|
|
1506
1521
|
if (!kt) {
|
|
1507
|
-
kt = a, ut = null, O(
|
|
1522
|
+
kt = a, ut = null, O(_.getState());
|
|
1508
1523
|
try {
|
|
1509
1524
|
if (!t.referralLinkLoader)
|
|
1510
1525
|
throw new Error("Referral sharing is not available here.");
|
|
1511
1526
|
const s = await t.referralLinkLoader();
|
|
1512
1527
|
if (!s)
|
|
1513
1528
|
throw new Error("Pluno did not return a referral link.");
|
|
1514
|
-
await
|
|
1529
|
+
await Oi(s), Ue.add(a.id), nt.add(a.id), W();
|
|
1515
1530
|
} catch (s) {
|
|
1516
1531
|
ut = s instanceof Error ? s.message : "Could not copy referral link.";
|
|
1517
1532
|
} finally {
|
|
1518
|
-
kt = null, O(
|
|
1533
|
+
kt = null, O(_.getState());
|
|
1519
1534
|
}
|
|
1520
1535
|
}
|
|
1521
1536
|
}
|
|
1522
|
-
async function
|
|
1537
|
+
async function Oi(a) {
|
|
1523
1538
|
if (navigator.clipboard?.writeText)
|
|
1524
1539
|
try {
|
|
1525
1540
|
await navigator.clipboard.writeText(a);
|
|
@@ -1535,35 +1550,35 @@ async function ja(e = {}) {
|
|
|
1535
1550
|
m.remove(), s?.isConnected && s.focus({ preventScroll: !0 });
|
|
1536
1551
|
}
|
|
1537
1552
|
}
|
|
1538
|
-
function
|
|
1539
|
-
const m = a.accentColor ?? t.accentColor, S = a.colorScheme ?? t.colorScheme, k = a.fontFamily ?? t.fontFamily,
|
|
1540
|
-
r =
|
|
1553
|
+
function dn(a, s) {
|
|
1554
|
+
const m = a.accentColor ?? t.accentColor, S = a.colorScheme ?? t.colorScheme, k = a.fontFamily ?? t.fontFamily, Ae = a.scribbleStyle ?? t.scribbleStyle;
|
|
1555
|
+
r = xo(
|
|
1541
1556
|
m,
|
|
1542
|
-
|
|
1543
|
-
),
|
|
1557
|
+
Ae
|
|
1558
|
+
), yo(o, r, {
|
|
1544
1559
|
accentColor: m,
|
|
1545
1560
|
colorScheme: S,
|
|
1546
1561
|
fontFamily: k,
|
|
1547
|
-
scribbleStyle:
|
|
1562
|
+
scribbleStyle: Ae
|
|
1548
1563
|
}), J("web-sdk.widget", "Updated widget appearance", {
|
|
1549
1564
|
source: s,
|
|
1550
1565
|
inputAppearance: a,
|
|
1551
1566
|
appliedAccentColor: m,
|
|
1552
1567
|
appliedColorScheme: S,
|
|
1553
1568
|
appliedFontFamily: k,
|
|
1554
|
-
appliedScribbleStyle:
|
|
1569
|
+
appliedScribbleStyle: Ae,
|
|
1555
1570
|
cssAccent: o.style.getPropertyValue("--pluno-pa-accent")
|
|
1556
1571
|
});
|
|
1557
1572
|
}
|
|
1558
1573
|
}
|
|
1559
|
-
function
|
|
1574
|
+
function xo(e, t) {
|
|
1560
1575
|
return { accentColor: e, scribbleStyle: t };
|
|
1561
1576
|
}
|
|
1562
|
-
function
|
|
1563
|
-
const t =
|
|
1564
|
-
return t === null ? "#fafafa" :
|
|
1577
|
+
function Ya(e) {
|
|
1578
|
+
const t = Xa(e);
|
|
1579
|
+
return t === null ? "#fafafa" : Za(t) > 0.5 ? "#18181b" : "#fafaf9";
|
|
1565
1580
|
}
|
|
1566
|
-
function
|
|
1581
|
+
function Xa(e) {
|
|
1567
1582
|
const t = e.trim();
|
|
1568
1583
|
return /^#[0-9a-f]{6}$/i.test(t) ? [
|
|
1569
1584
|
Number.parseInt(t.slice(1, 3), 16),
|
|
@@ -1575,14 +1590,14 @@ function Ka(e) {
|
|
|
1575
1590
|
Number.parseInt(t[3] + t[3], 16)
|
|
1576
1591
|
] : null;
|
|
1577
1592
|
}
|
|
1578
|
-
function
|
|
1593
|
+
function Za([e, t, n]) {
|
|
1579
1594
|
const i = (o) => {
|
|
1580
1595
|
const r = o / 255;
|
|
1581
1596
|
return r <= 0.03928 ? r / 12.92 : ((r + 0.055) / 1.055) ** 2.4;
|
|
1582
1597
|
};
|
|
1583
1598
|
return 0.2126 * i(e) + 0.7152 * i(t) + 0.0722 * i(n);
|
|
1584
1599
|
}
|
|
1585
|
-
function
|
|
1600
|
+
function yo(e, t, n) {
|
|
1586
1601
|
e.classList.toggle(
|
|
1587
1602
|
"pluno-pa-widget--dark",
|
|
1588
1603
|
n.colorScheme === "dark"
|
|
@@ -1590,11 +1605,11 @@ function xo(e, t, n) {
|
|
|
1590
1605
|
"pluno-pa-widget--light",
|
|
1591
1606
|
n.colorScheme !== "dark"
|
|
1592
1607
|
), e.classList.toggle("pluno-pa-widget--scribble", n.scribbleStyle);
|
|
1593
|
-
const i = n.scribbleStyle ?
|
|
1608
|
+
const i = n.scribbleStyle ? Ho(n.accentColor) : n.accentColor;
|
|
1594
1609
|
e.style.setProperty("--pluno-pa-accent", i), n.scribbleStyle ? e.style.setProperty(
|
|
1595
1610
|
"--pluno-pa-accent-contrast",
|
|
1596
|
-
|
|
1597
|
-
) : e.style.removeProperty("--pluno-pa-accent-contrast"), e.style.fontFamily = n.scribbleStyle ?
|
|
1611
|
+
Ya(i)
|
|
1612
|
+
) : e.style.removeProperty("--pluno-pa-accent-contrast"), e.style.fontFamily = n.scribbleStyle ? Ra : n.fontFamily, n.scribbleStyle && Ja(e.ownerDocument);
|
|
1598
1613
|
const o = Array.from(
|
|
1599
1614
|
e.querySelectorAll(".pluno-pa-widget__character")
|
|
1600
1615
|
);
|
|
@@ -1606,11 +1621,11 @@ function xo(e, t, n) {
|
|
|
1606
1621
|
)
|
|
1607
1622
|
);
|
|
1608
1623
|
}
|
|
1609
|
-
function
|
|
1610
|
-
if (e.getElementById(
|
|
1624
|
+
function Ja(e) {
|
|
1625
|
+
if (e.getElementById(wo))
|
|
1611
1626
|
return;
|
|
1612
1627
|
const t = e.createElement("style");
|
|
1613
|
-
t.id =
|
|
1628
|
+
t.id = wo, t.textContent = `@font-face {
|
|
1614
1629
|
font-family: "Architects Daughter";
|
|
1615
1630
|
font-style: normal;
|
|
1616
1631
|
font-weight: 400;
|
|
@@ -1618,7 +1633,7 @@ function Xa(e) {
|
|
|
1618
1633
|
src: url("https://fonts.gstatic.com/s/architectsdaughter/v20/KtkxAKiDZI_td1Lkx62xHZHDtgO_Y-bvTYlg4-7jA-U.woff2") format("woff2");
|
|
1619
1634
|
}`, e.head.appendChild(t), e.fonts?.load('16px "Architects Daughter"');
|
|
1620
1635
|
}
|
|
1621
|
-
function
|
|
1636
|
+
function Qa({
|
|
1622
1637
|
root: e,
|
|
1623
1638
|
launcher: t,
|
|
1624
1639
|
launcherDragHandle: n,
|
|
@@ -1631,12 +1646,12 @@ function Za({
|
|
|
1631
1646
|
l = null, p = null, d = null, c = !1, e.classList.remove("pluno-pa-widget--dragging");
|
|
1632
1647
|
}, f = (w) => {
|
|
1633
1648
|
e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing") || (w.preventDefault(), w.stopPropagation(), l = w.pointerId, p = { x: w.clientX, y: w.clientY }, d = i(), c = !1, t.setPointerCapture?.(w.pointerId));
|
|
1634
|
-
},
|
|
1649
|
+
}, b = (w) => {
|
|
1635
1650
|
if (l !== w.pointerId || !p || !d)
|
|
1636
1651
|
return;
|
|
1637
1652
|
w.preventDefault();
|
|
1638
1653
|
const R = w.clientX - p.x, D = w.clientY - p.y;
|
|
1639
|
-
!c && Math.hypot(R, D) <
|
|
1654
|
+
!c && Math.hypot(R, D) < Pn || (c = !0, e.classList.add("pluno-pa-widget--dragging"), o({ x: d.x + R, y: d.y + D }));
|
|
1640
1655
|
}, y = (w) => {
|
|
1641
1656
|
l === w.pointerId && (w.preventDefault(), w.stopPropagation(), c && (g = { x: w.clientX, y: w.clientY }, r()), h());
|
|
1642
1657
|
}, U = (w) => {
|
|
@@ -1647,20 +1662,20 @@ function Za({
|
|
|
1647
1662
|
const R = Math.hypot(
|
|
1648
1663
|
w.clientX - g.x,
|
|
1649
1664
|
w.clientY - g.y
|
|
1650
|
-
) <=
|
|
1665
|
+
) <= Pn;
|
|
1651
1666
|
g = null, R && (w.preventDefault(), w.stopPropagation());
|
|
1652
1667
|
}, H = (w) => {
|
|
1653
1668
|
if (e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing"))
|
|
1654
1669
|
return;
|
|
1655
|
-
const R = w.shiftKey ?
|
|
1670
|
+
const R = w.shiftKey ? Jo : Zo, D = i();
|
|
1656
1671
|
let L = null;
|
|
1657
1672
|
w.key === "ArrowUp" ? L = { x: D.x, y: D.y - R } : w.key === "ArrowDown" ? L = { x: D.x, y: D.y + R } : w.key === "ArrowLeft" ? L = { x: D.x - R, y: D.y } : w.key === "ArrowRight" && (L = { x: D.x + R, y: D.y }), L && (w.preventDefault(), w.stopPropagation(), o(L), r());
|
|
1658
1673
|
};
|
|
1659
|
-
return t.addEventListener("pointerdown", f), t.addEventListener("pointermove",
|
|
1660
|
-
t.removeEventListener("pointerdown", f), t.removeEventListener("pointermove",
|
|
1674
|
+
return t.addEventListener("pointerdown", f), t.addEventListener("pointermove", b), t.addEventListener("pointerup", y), t.addEventListener("pointercancel", U), t.addEventListener("click", u, !0), n.addEventListener("keydown", H), () => {
|
|
1675
|
+
t.removeEventListener("pointerdown", f), t.removeEventListener("pointermove", b), t.removeEventListener("pointerup", y), t.removeEventListener("pointercancel", U), t.removeEventListener("click", u, !0), n.removeEventListener("keydown", H);
|
|
1661
1676
|
};
|
|
1662
1677
|
}
|
|
1663
|
-
function
|
|
1678
|
+
function er({
|
|
1664
1679
|
root: e,
|
|
1665
1680
|
handles: t,
|
|
1666
1681
|
getBounds: n,
|
|
@@ -1672,36 +1687,36 @@ function Ja({
|
|
|
1672
1687
|
r = null, l = null, p = null, d = null, c = !1, e.classList.remove("pluno-pa-widget--resizing");
|
|
1673
1688
|
}, h = (u) => {
|
|
1674
1689
|
const H = u.currentTarget, w = H.dataset.resizeDirection;
|
|
1675
|
-
!e.classList.contains("pluno-pa-widget--open") || !
|
|
1690
|
+
!e.classList.contains("pluno-pa-widget--open") || !vo(w) || (u.preventDefault(), u.stopPropagation(), r = u.pointerId, l = w, p = { x: u.clientX, y: u.clientY }, d = n(), c = !1, H.setPointerCapture?.(u.pointerId));
|
|
1676
1691
|
}, f = (u) => {
|
|
1677
1692
|
if (r !== u.pointerId || !l || !p || !d)
|
|
1678
1693
|
return;
|
|
1679
1694
|
u.preventDefault(), u.stopPropagation();
|
|
1680
1695
|
const H = u.clientX - p.x, w = u.clientY - p.y;
|
|
1681
|
-
!c && Math.hypot(H, w) <
|
|
1682
|
-
|
|
1696
|
+
!c && Math.hypot(H, w) < Pn || (c = !0, e.classList.add("pluno-pa-widget--resizing"), i(
|
|
1697
|
+
So(d, l, H, w)
|
|
1683
1698
|
));
|
|
1684
|
-
},
|
|
1699
|
+
}, b = (u) => {
|
|
1685
1700
|
r === u.pointerId && (u.preventDefault(), u.stopPropagation(), c && o(), g());
|
|
1686
1701
|
}, y = (u) => {
|
|
1687
1702
|
r === u.pointerId && (u.preventDefault(), g());
|
|
1688
1703
|
}, U = (u) => {
|
|
1689
|
-
const w = u.currentTarget.dataset.resizeDirection, R = u.shiftKey ?
|
|
1704
|
+
const w = u.currentTarget.dataset.resizeDirection, R = u.shiftKey ? Jo : Zo, D = n();
|
|
1690
1705
|
let L = 0, ne = 0;
|
|
1691
|
-
|
|
1706
|
+
vo(w) && (u.key === "ArrowLeft" ? L = -R : u.key === "ArrowRight" ? L = R : u.key === "ArrowUp" ? ne = -R : u.key === "ArrowDown" && (ne = R), !(L === 0 && ne === 0) && (u.preventDefault(), u.stopPropagation(), i(So(D, w, L, ne)), o()));
|
|
1692
1707
|
};
|
|
1693
1708
|
for (const u of t)
|
|
1694
|
-
u.addEventListener("pointerdown", h), u.addEventListener("pointermove", f), u.addEventListener("pointerup",
|
|
1709
|
+
u.addEventListener("pointerdown", h), u.addEventListener("pointermove", f), u.addEventListener("pointerup", b), u.addEventListener("pointercancel", y), u.addEventListener("keydown", U);
|
|
1695
1710
|
return () => {
|
|
1696
1711
|
for (const u of t)
|
|
1697
|
-
u.removeEventListener("pointerdown", h), u.removeEventListener("pointermove", f), u.removeEventListener("pointerup",
|
|
1712
|
+
u.removeEventListener("pointerdown", h), u.removeEventListener("pointermove", f), u.removeEventListener("pointerup", b), u.removeEventListener("pointercancel", y), u.removeEventListener("keydown", U);
|
|
1698
1713
|
};
|
|
1699
1714
|
}
|
|
1700
|
-
function
|
|
1715
|
+
function vo(e) {
|
|
1701
1716
|
return e === "left" || e === "right" || e === "top" || e === "bottom" || e === "top-left" || e === "top-right" || e === "bottom-left" || e === "bottom-right";
|
|
1702
1717
|
}
|
|
1703
|
-
function
|
|
1704
|
-
const o = te(), r =
|
|
1718
|
+
function So(e, t, n, i) {
|
|
1719
|
+
const o = te(), r = Co({
|
|
1705
1720
|
leading: e.position.x,
|
|
1706
1721
|
length: e.size.width,
|
|
1707
1722
|
delta: n,
|
|
@@ -1710,10 +1725,10 @@ function vo(e, t, n, i) {
|
|
|
1710
1725
|
minLeading: N,
|
|
1711
1726
|
maxTrailing: o.width - N,
|
|
1712
1727
|
minLength: Math.min(
|
|
1713
|
-
|
|
1728
|
+
Dn,
|
|
1714
1729
|
o.width - N * 2
|
|
1715
1730
|
)
|
|
1716
|
-
}), l =
|
|
1731
|
+
}), l = Co({
|
|
1717
1732
|
leading: e.position.y,
|
|
1718
1733
|
length: e.size.height,
|
|
1719
1734
|
delta: i,
|
|
@@ -1722,7 +1737,7 @@ function vo(e, t, n, i) {
|
|
|
1722
1737
|
minLeading: Ge,
|
|
1723
1738
|
maxTrailing: o.height - N,
|
|
1724
1739
|
minLength: Math.min(
|
|
1725
|
-
|
|
1740
|
+
On,
|
|
1726
1741
|
o.height - Ge - N
|
|
1727
1742
|
)
|
|
1728
1743
|
});
|
|
@@ -1731,7 +1746,7 @@ function vo(e, t, n, i) {
|
|
|
1731
1746
|
size: { width: r.length, height: l.length }
|
|
1732
1747
|
};
|
|
1733
1748
|
}
|
|
1734
|
-
function
|
|
1749
|
+
function Co({
|
|
1735
1750
|
leading: e,
|
|
1736
1751
|
length: t,
|
|
1737
1752
|
delta: n,
|
|
@@ -1778,49 +1793,49 @@ function So({
|
|
|
1778
1793
|
}
|
|
1779
1794
|
return { leading: e, length: t };
|
|
1780
1795
|
}
|
|
1781
|
-
function
|
|
1796
|
+
function Ft(e, t = !0) {
|
|
1782
1797
|
const n = te();
|
|
1783
1798
|
if (e.classList.contains("pluno-pa-widget--minimized")) {
|
|
1784
|
-
const r = typeof window.matchMedia == "function" && window.matchMedia("(hover: none), (pointer: coarse)").matches ?
|
|
1799
|
+
const r = typeof window.matchMedia == "function" && window.matchMedia("(hover: none), (pointer: coarse)").matches ? Ma : za;
|
|
1785
1800
|
return { width: r, height: r };
|
|
1786
1801
|
}
|
|
1787
1802
|
const i = e.getBoundingClientRect(), o = !e.classList.contains("pluno-pa-widget--open") && !e.classList.contains("pluno-pa-widget--closing");
|
|
1788
1803
|
return {
|
|
1789
|
-
width: t && o && i.width > 0 ? i.width : Math.min(
|
|
1790
|
-
height: t && o && i.height > 0 ? i.height : e.classList.contains("pluno-pa-widget--scribble") ?
|
|
1804
|
+
width: t && o && i.width > 0 ? i.width : Math.min(Ko, n.width - 36),
|
|
1805
|
+
height: t && o && i.height > 0 ? i.height : e.classList.contains("pluno-pa-widget--scribble") ? Oa : Yo
|
|
1791
1806
|
};
|
|
1792
1807
|
}
|
|
1793
|
-
function
|
|
1808
|
+
function tr() {
|
|
1794
1809
|
const e = te();
|
|
1795
1810
|
return {
|
|
1796
1811
|
width: Math.min(
|
|
1797
1812
|
ee(
|
|
1798
|
-
e.width *
|
|
1799
|
-
|
|
1800
|
-
|
|
1813
|
+
e.width * Ba,
|
|
1814
|
+
Dn,
|
|
1815
|
+
Ua
|
|
1801
1816
|
),
|
|
1802
1817
|
e.width - N * 2
|
|
1803
1818
|
),
|
|
1804
1819
|
height: Math.min(
|
|
1805
1820
|
ee(
|
|
1806
|
-
e.height *
|
|
1807
|
-
|
|
1808
|
-
|
|
1821
|
+
e.height * Wa,
|
|
1822
|
+
On,
|
|
1823
|
+
Fa
|
|
1809
1824
|
),
|
|
1810
1825
|
e.height - Ge - N
|
|
1811
1826
|
)
|
|
1812
1827
|
};
|
|
1813
1828
|
}
|
|
1814
1829
|
function et(e = null) {
|
|
1815
|
-
return e ?
|
|
1830
|
+
return e ? Ht(e) : tr();
|
|
1816
1831
|
}
|
|
1817
|
-
function
|
|
1832
|
+
function Ht(e) {
|
|
1818
1833
|
const t = te();
|
|
1819
1834
|
return {
|
|
1820
1835
|
width: ee(
|
|
1821
1836
|
e.width,
|
|
1822
1837
|
Math.min(
|
|
1823
|
-
|
|
1838
|
+
Dn,
|
|
1824
1839
|
t.width - N * 2
|
|
1825
1840
|
),
|
|
1826
1841
|
Math.max(
|
|
@@ -1831,7 +1846,7 @@ function Ft(e) {
|
|
|
1831
1846
|
height: ee(
|
|
1832
1847
|
e.height,
|
|
1833
1848
|
Math.min(
|
|
1834
|
-
|
|
1849
|
+
On,
|
|
1835
1850
|
t.height - Ge - N
|
|
1836
1851
|
),
|
|
1837
1852
|
Math.max(
|
|
@@ -1841,15 +1856,15 @@ function Ft(e) {
|
|
|
1841
1856
|
)
|
|
1842
1857
|
};
|
|
1843
1858
|
}
|
|
1844
|
-
function
|
|
1859
|
+
function hn(e, t) {
|
|
1845
1860
|
if (!t) {
|
|
1846
1861
|
e.style.removeProperty("--pluno-pa-panel-width"), e.style.removeProperty("--pluno-pa-panel-height");
|
|
1847
1862
|
return;
|
|
1848
1863
|
}
|
|
1849
|
-
const n =
|
|
1864
|
+
const n = Ht(t);
|
|
1850
1865
|
e.style.setProperty("--pluno-pa-panel-width", `${n.width}px`), e.style.setProperty("--pluno-pa-panel-height", `${n.height}px`);
|
|
1851
1866
|
}
|
|
1852
|
-
function
|
|
1867
|
+
function nr(e, t, n) {
|
|
1853
1868
|
const i = Number.parseFloat(e.style.left), o = Number.parseFloat(e.style.top);
|
|
1854
1869
|
if (Number.isFinite(i) && Number.isFinite(o))
|
|
1855
1870
|
return { x: i, y: o };
|
|
@@ -1862,15 +1877,15 @@ function er(e, t, n) {
|
|
|
1862
1877
|
y: l.height - 24 - n.height
|
|
1863
1878
|
};
|
|
1864
1879
|
}
|
|
1865
|
-
function
|
|
1866
|
-
const i =
|
|
1880
|
+
function mn(e, t, n) {
|
|
1881
|
+
const i = Ft(e, !1);
|
|
1867
1882
|
return t ? An(
|
|
1868
1883
|
e,
|
|
1869
|
-
|
|
1884
|
+
Dt(t, i),
|
|
1870
1885
|
i
|
|
1871
|
-
) :
|
|
1886
|
+
) : or(n === "bottom-left" ? "bottom-left" : "bottom-right", i, Da);
|
|
1872
1887
|
}
|
|
1873
|
-
function
|
|
1888
|
+
function or(e, t, n) {
|
|
1874
1889
|
const i = te();
|
|
1875
1890
|
return {
|
|
1876
1891
|
x: e.endsWith("right") ? Math.max(0, i.width - t.width - n) : n,
|
|
@@ -1878,7 +1893,7 @@ function tr(e, t, n) {
|
|
|
1878
1893
|
};
|
|
1879
1894
|
}
|
|
1880
1895
|
function An(e, t, n) {
|
|
1881
|
-
const i = te(), o = N +
|
|
1896
|
+
const i = te(), o = N + ar(e);
|
|
1882
1897
|
return {
|
|
1883
1898
|
x: ee(
|
|
1884
1899
|
t.x,
|
|
@@ -1898,36 +1913,36 @@ function An(e, t, n) {
|
|
|
1898
1913
|
)
|
|
1899
1914
|
};
|
|
1900
1915
|
}
|
|
1901
|
-
function
|
|
1916
|
+
function Dt(e, t) {
|
|
1902
1917
|
const n = te();
|
|
1903
1918
|
return {
|
|
1904
1919
|
x: e.anchor.endsWith("right") ? n.width - t.width - e.x : e.x,
|
|
1905
1920
|
y: e.anchor.startsWith("bottom") ? n.height - t.height - e.y : e.y
|
|
1906
1921
|
};
|
|
1907
1922
|
}
|
|
1908
|
-
function
|
|
1909
|
-
const n =
|
|
1923
|
+
function Eo(e, t) {
|
|
1924
|
+
const n = ir(e, t), i = te();
|
|
1910
1925
|
return {
|
|
1911
1926
|
anchor: n,
|
|
1912
1927
|
x: n.endsWith("right") ? i.width - e.x - t.width : e.x,
|
|
1913
1928
|
y: n.startsWith("bottom") ? i.height - e.y - t.height : e.y
|
|
1914
1929
|
};
|
|
1915
1930
|
}
|
|
1916
|
-
function
|
|
1931
|
+
function ir(e, t) {
|
|
1917
1932
|
const n = te(), i = e.x + t.width / 2, r = e.y + t.height / 2 <= n.height / 2 ? "top" : "bottom", l = i <= n.width / 2 ? "left" : "right";
|
|
1918
1933
|
return `${r}-${l}`;
|
|
1919
1934
|
}
|
|
1920
|
-
function
|
|
1921
|
-
return e.classList.contains("pluno-pa-widget--scribble") ?
|
|
1935
|
+
function ar(e) {
|
|
1936
|
+
return e.classList.contains("pluno-pa-widget--scribble") ? qa : Ga;
|
|
1922
1937
|
}
|
|
1923
|
-
function
|
|
1924
|
-
const o =
|
|
1938
|
+
function fn(e, t, n, i = null) {
|
|
1939
|
+
const o = Ft(e), r = et(i), l = {
|
|
1925
1940
|
x: n === "bottom-left" ? t.x : t.x + o.width - r.width,
|
|
1926
1941
|
y: t.y + o.height - r.height
|
|
1927
1942
|
};
|
|
1928
|
-
return
|
|
1943
|
+
return Ot(l, r);
|
|
1929
1944
|
}
|
|
1930
|
-
function
|
|
1945
|
+
function Ot(e, t) {
|
|
1931
1946
|
const n = te();
|
|
1932
1947
|
return {
|
|
1933
1948
|
x: ee(
|
|
@@ -1955,19 +1970,19 @@ function $e(e, t) {
|
|
|
1955
1970
|
}
|
|
1956
1971
|
e.style.left = `${t.x}px`, e.style.top = `${t.y}px`, e.style.right = "auto", e.style.bottom = "auto";
|
|
1957
1972
|
}
|
|
1958
|
-
function
|
|
1973
|
+
function rr(e, t) {
|
|
1959
1974
|
e.style.setProperty("--pluno-pa-panel-offset-x", `${t.x}px`), e.style.setProperty("--pluno-pa-panel-offset-y", `${t.y}px`);
|
|
1960
1975
|
}
|
|
1961
|
-
function
|
|
1976
|
+
function ko(e) {
|
|
1962
1977
|
e.style.removeProperty("--pluno-pa-panel-offset-x"), e.style.removeProperty("--pluno-pa-panel-offset-y");
|
|
1963
1978
|
}
|
|
1964
1979
|
function te() {
|
|
1965
1980
|
return {
|
|
1966
|
-
width: window.innerWidth || document.documentElement.clientWidth ||
|
|
1967
|
-
height: window.innerHeight || document.documentElement.clientHeight ||
|
|
1981
|
+
width: window.innerWidth || document.documentElement.clientWidth || Ko + N * 2,
|
|
1982
|
+
height: window.innerHeight || document.documentElement.clientHeight || Yo + N * 2
|
|
1968
1983
|
};
|
|
1969
1984
|
}
|
|
1970
|
-
function
|
|
1985
|
+
function wn(e) {
|
|
1971
1986
|
const t = e.getBoundingClientRect();
|
|
1972
1987
|
return {
|
|
1973
1988
|
x: Math.round(t.x),
|
|
@@ -1989,31 +2004,31 @@ function J(e, t, n) {
|
|
|
1989
2004
|
details: n
|
|
1990
2005
|
}, r = i.__plunoProductAgentDiagnostics__ ?? [];
|
|
1991
2006
|
r.push(o), r.length > 120 && r.splice(0, r.length - 120), i.__plunoProductAgentDiagnostics__ = r, i.__PLUNO_PRODUCT_AGENT_DIAGNOSTICS__ = () => [...r], window.dispatchEvent(
|
|
1992
|
-
new CustomEvent(
|
|
2007
|
+
new CustomEvent(Ta, { detail: o })
|
|
1993
2008
|
);
|
|
1994
2009
|
}
|
|
1995
|
-
function
|
|
2010
|
+
function lr(e, t) {
|
|
1996
2011
|
J("web-sdk.widget.position", e, t);
|
|
1997
2012
|
}
|
|
1998
|
-
function
|
|
2013
|
+
function bn(e, t, n, i) {
|
|
1999
2014
|
const o = t.value.trim();
|
|
2000
2015
|
return !o && n.length === 0 ? n : (i(), t.value = "", t.style.height = "22px", t.style.overflowY = "hidden", e.sendMessage(o, {
|
|
2001
|
-
attachments: n.length > 0 ? n.map(
|
|
2016
|
+
attachments: n.length > 0 ? n.map(dr) : void 0
|
|
2002
2017
|
}), t.dispatchEvent(new Event("input", { bubbles: !0 })), []);
|
|
2003
2018
|
}
|
|
2004
|
-
function
|
|
2019
|
+
function pr(e, t, n) {
|
|
2005
2020
|
const i = e.activeElement;
|
|
2006
2021
|
return i === n ? "composer" : i === t ? "launcher" : null;
|
|
2007
2022
|
}
|
|
2008
|
-
function
|
|
2009
|
-
if (!e.focusedInput || !e.focusedInputAt || Date.now() - e.focusedInputAt >
|
|
2023
|
+
function sr(e, t, n, i) {
|
|
2024
|
+
if (!e.focusedInput || !e.focusedInputAt || Date.now() - e.focusedInputAt > fa)
|
|
2010
2025
|
return;
|
|
2011
2026
|
const o = e.focusedInput === "composer" ? i : n;
|
|
2012
2027
|
o === i && !t.classList.contains("pluno-pa-widget--open") || o === n && t.classList.contains("pluno-pa-widget--open") || window.requestAnimationFrame(() => {
|
|
2013
2028
|
!o.isConnected || o.readOnly || (o.focus(), o.setSelectionRange(o.value.length, o.value.length));
|
|
2014
2029
|
});
|
|
2015
2030
|
}
|
|
2016
|
-
function
|
|
2031
|
+
function dr(e) {
|
|
2017
2032
|
return e;
|
|
2018
2033
|
}
|
|
2019
2034
|
function ht(e) {
|
|
@@ -2024,7 +2039,7 @@ function mt(e, t = () => !0) {
|
|
|
2024
2039
|
t() && (e.scrollTop = e.scrollHeight);
|
|
2025
2040
|
});
|
|
2026
2041
|
}
|
|
2027
|
-
function
|
|
2042
|
+
function cr(e) {
|
|
2028
2043
|
const t = e.messages[e.messages.length - 1];
|
|
2029
2044
|
return [
|
|
2030
2045
|
e.messages.length,
|
|
@@ -2035,13 +2050,13 @@ function sr(e) {
|
|
|
2035
2050
|
e.lastError ?? ""
|
|
2036
2051
|
].join(":");
|
|
2037
2052
|
}
|
|
2038
|
-
function
|
|
2053
|
+
function ur(e) {
|
|
2039
2054
|
return e.messages.length > 0 || e.assistantDraft.length > 0 || e.isThinking || !!e.lastError;
|
|
2040
2055
|
}
|
|
2041
|
-
function
|
|
2056
|
+
function gr(e) {
|
|
2042
2057
|
return e.firstUserMessage?.trim() ? e.firstUserMessage : e.title?.trim() ? e.title : "Untitled chat";
|
|
2043
2058
|
}
|
|
2044
|
-
function
|
|
2059
|
+
function hr(e) {
|
|
2045
2060
|
const t = e.currentPage;
|
|
2046
2061
|
if (typeof t?.url == "string" && t.url.trim())
|
|
2047
2062
|
try {
|
|
@@ -2052,7 +2067,7 @@ function ur(e) {
|
|
|
2052
2067
|
}
|
|
2053
2068
|
return typeof t?.origin == "string" && t.origin.trim() ? t.origin : "Current origin";
|
|
2054
2069
|
}
|
|
2055
|
-
function
|
|
2070
|
+
function mr(e, t) {
|
|
2056
2071
|
const n = new Date(e).getTime();
|
|
2057
2072
|
if (!Number.isFinite(n))
|
|
2058
2073
|
return "now";
|
|
@@ -2068,24 +2083,24 @@ function gr(e, t) {
|
|
|
2068
2083
|
}
|
|
2069
2084
|
return "now";
|
|
2070
2085
|
}
|
|
2071
|
-
function
|
|
2072
|
-
e.appendChild(
|
|
2073
|
-
|
|
2086
|
+
function fr(e, t, n, i, o) {
|
|
2087
|
+
e.appendChild(kr()), e.appendChild(
|
|
2088
|
+
wr(
|
|
2074
2089
|
t,
|
|
2075
2090
|
n,
|
|
2076
2091
|
i,
|
|
2077
2092
|
o
|
|
2078
2093
|
)
|
|
2079
2094
|
), e.appendChild(
|
|
2080
|
-
|
|
2095
|
+
$t(
|
|
2081
2096
|
"pluno-pa-widget__close",
|
|
2082
2097
|
"Close",
|
|
2083
|
-
|
|
2098
|
+
Lr(16),
|
|
2084
2099
|
!0
|
|
2085
2100
|
)
|
|
2086
|
-
), e.appendChild(
|
|
2101
|
+
), e.appendChild(br(n));
|
|
2087
2102
|
}
|
|
2088
|
-
function
|
|
2103
|
+
function wr(e, t, n, i) {
|
|
2089
2104
|
const o = document.createElement("form");
|
|
2090
2105
|
if (o.className = "pluno-pa-widget__launcher", i && o.classList.add("pluno-pa-widget__launcher--minimizable"), n) {
|
|
2091
2106
|
o.classList.add("pluno-pa-widget__launcher--movable");
|
|
@@ -2093,7 +2108,7 @@ function mr(e, t, n, i) {
|
|
|
2093
2108
|
d.type = "button", d.className = "pluno-pa-widget__launcher-drag-handle", d.setAttribute("aria-label", "Move Pluno launcher"), d.title = "Move Pluno launcher", o.appendChild(d);
|
|
2094
2109
|
}
|
|
2095
2110
|
o.appendChild(
|
|
2096
|
-
|
|
2111
|
+
ii(
|
|
2097
2112
|
"pluno-pa-widget__scribble-spirals--launcher",
|
|
2098
2113
|
10
|
|
2099
2114
|
)
|
|
@@ -2114,15 +2129,15 @@ function mr(e, t, n, i) {
|
|
|
2114
2129
|
}
|
|
2115
2130
|
return o;
|
|
2116
2131
|
}
|
|
2117
|
-
function
|
|
2132
|
+
function br(e) {
|
|
2118
2133
|
const t = document.createElement("section");
|
|
2119
2134
|
t.className = "pluno-pa-widget__panel", t.hidden = !0, t.appendChild(
|
|
2120
|
-
|
|
2135
|
+
ii("pluno-pa-widget__scribble-spirals--panel", 16)
|
|
2121
2136
|
);
|
|
2122
2137
|
const n = document.createElement("div");
|
|
2123
2138
|
n.className = "pluno-pa-widget__timeline-wrap";
|
|
2124
2139
|
const i = document.createElement("main");
|
|
2125
|
-
i.className = "pluno-pa-widget__timeline", i.appendChild(
|
|
2140
|
+
i.className = "pluno-pa-widget__timeline", i.appendChild(Sr(e));
|
|
2126
2141
|
const o = document.createElement("div");
|
|
2127
2142
|
o.className = "pluno-pa-widget__timeline-bottom-sentinel", o.setAttribute("aria-hidden", "true"), i.appendChild(o), n.appendChild(i);
|
|
2128
2143
|
const r = document.createElement("div");
|
|
@@ -2131,13 +2146,13 @@ function fr(e) {
|
|
|
2131
2146
|
l.type = "button", l.className = "pluno-pa-widget__timeline-jump", l.textContent = "New messages ↓", l.hidden = !0, n.appendChild(l);
|
|
2132
2147
|
const p = document.createElement("div");
|
|
2133
2148
|
return p.className = "pluno-pa-widget__top-actions", p.appendChild(
|
|
2134
|
-
|
|
2149
|
+
$t(
|
|
2135
2150
|
"pluno-pa-widget__history",
|
|
2136
|
-
|
|
2137
|
-
|
|
2151
|
+
In(),
|
|
2152
|
+
Pr(),
|
|
2138
2153
|
!0
|
|
2139
2154
|
)
|
|
2140
|
-
), n.appendChild(p), n.appendChild(
|
|
2155
|
+
), n.appendChild(p), n.appendChild(vr()), t.appendChild(n), t.appendChild(_r()), t.appendChild(xr()), t.appendChild(yr()), t.appendChild(Ie("left", "Resize Pluno from left")), t.appendChild(
|
|
2141
2156
|
Ie("right", "Resize Pluno from right")
|
|
2142
2157
|
), t.appendChild(Ie("top", "Resize Pluno from top")), t.appendChild(
|
|
2143
2158
|
Ie("bottom", "Resize Pluno from bottom")
|
|
@@ -2158,7 +2173,7 @@ function Ie(e, t) {
|
|
|
2158
2173
|
`pluno-pa-widget__resize-handle--${e}`
|
|
2159
2174
|
].join(" "), n.dataset.resizeDirection = e, n.setAttribute("aria-label", t), n.title = t, n;
|
|
2160
2175
|
}
|
|
2161
|
-
function
|
|
2176
|
+
function _r() {
|
|
2162
2177
|
const e = document.createElement("div");
|
|
2163
2178
|
e.className = "pluno-pa-widget__notify-suggestion", e.hidden = !0;
|
|
2164
2179
|
const t = document.createElement("span");
|
|
@@ -2172,7 +2187,7 @@ function wr() {
|
|
|
2172
2187
|
const r = document.createElement("button");
|
|
2173
2188
|
return r.type = "button", r.className = "pluno-pa-widget__notify-suggestion-never", r.textContent = "Never", n.append(i, o, r), e.append(t, n), e;
|
|
2174
2189
|
}
|
|
2175
|
-
function
|
|
2190
|
+
function xr() {
|
|
2176
2191
|
const e = document.createElement("div");
|
|
2177
2192
|
e.className = "pluno-pa-widget__notify-suggestion pluno-pa-widget__tab-groups-suggestion", e.hidden = !0;
|
|
2178
2193
|
const t = document.createElement("span");
|
|
@@ -2184,7 +2199,7 @@ function br() {
|
|
|
2184
2199
|
const o = document.createElement("button");
|
|
2185
2200
|
return o.type = "button", o.className = "pluno-pa-widget__notify-suggestion-later pluno-pa-widget__tab-groups-suggestion-dismiss", o.textContent = "Not now", n.append(i, o), e.append(t, n), e;
|
|
2186
2201
|
}
|
|
2187
|
-
function
|
|
2202
|
+
function yr() {
|
|
2188
2203
|
const e = document.createElement("form");
|
|
2189
2204
|
e.className = "pluno-pa-widget__composer";
|
|
2190
2205
|
const t = document.createElement("div");
|
|
@@ -2198,11 +2213,11 @@ function _r() {
|
|
|
2198
2213
|
const r = document.createElement("input");
|
|
2199
2214
|
r.className = "pluno-pa-widget__attachment-input", r.type = "file", r.multiple = !0, r.tabIndex = -1, r.setAttribute("aria-hidden", "true"), o.appendChild(r);
|
|
2200
2215
|
const l = document.createElement("button");
|
|
2201
|
-
l.type = "button", l.className = "pluno-pa-widget__attach", l.setAttribute("aria-label", "Attach files"), l.title = "Attach files", l.appendChild(
|
|
2216
|
+
l.type = "button", l.className = "pluno-pa-widget__attach", l.setAttribute("aria-label", "Attach files"), l.title = "Attach files", l.appendChild(Ar()), l.appendChild(Ir()), o.appendChild(l);
|
|
2202
2217
|
const p = document.createElement("textarea");
|
|
2203
2218
|
p.className = "pluno-pa-widget__input", p.rows = 1, p.placeholder = "Ask for anything...", o.appendChild(p);
|
|
2204
2219
|
const d = document.createElement("button");
|
|
2205
|
-
d.type = "button", d.className = "pluno-pa-widget__send", d.setAttribute("aria-label", "Send"), d.appendChild(
|
|
2220
|
+
d.type = "button", d.className = "pluno-pa-widget__send", d.setAttribute("aria-label", "Send"), d.appendChild(li()), o.appendChild(d), e.appendChild(o);
|
|
2206
2221
|
const c = document.createElement("div");
|
|
2207
2222
|
c.className = "pluno-pa-widget__composer-meta";
|
|
2208
2223
|
const g = document.createElement("a");
|
|
@@ -2210,20 +2225,20 @@ function _r() {
|
|
|
2210
2225
|
const h = document.createElement("span");
|
|
2211
2226
|
return h.className = "pluno-pa-widget__ai-disclaimer", h.textContent = "AI can make mistakes. Verify outputs.", c.appendChild(h), e.appendChild(c), e;
|
|
2212
2227
|
}
|
|
2213
|
-
function
|
|
2228
|
+
function In() {
|
|
2214
2229
|
return location.hostname ? `Recent chats on ${location.hostname}` : "Recent chats";
|
|
2215
2230
|
}
|
|
2216
|
-
function
|
|
2231
|
+
function vr() {
|
|
2217
2232
|
const e = document.createElement("section");
|
|
2218
|
-
e.className = "pluno-pa-widget__history-panel", e.hidden = !0, e.setAttribute("aria-label",
|
|
2233
|
+
e.className = "pluno-pa-widget__history-panel", e.hidden = !0, e.setAttribute("aria-label", In());
|
|
2219
2234
|
const t = document.createElement("div");
|
|
2220
2235
|
t.className = "pluno-pa-widget__history-header";
|
|
2221
2236
|
const n = document.createElement("strong");
|
|
2222
|
-
n.textContent =
|
|
2223
|
-
const i =
|
|
2237
|
+
n.textContent = In();
|
|
2238
|
+
const i = $t(
|
|
2224
2239
|
"pluno-pa-widget__history-close",
|
|
2225
2240
|
"Close recent chats",
|
|
2226
|
-
|
|
2241
|
+
ri(),
|
|
2227
2242
|
!1
|
|
2228
2243
|
);
|
|
2229
2244
|
t.append(n, i);
|
|
@@ -2232,20 +2247,20 @@ function xr() {
|
|
|
2232
2247
|
const r = document.createElement("p");
|
|
2233
2248
|
return r.className = "pluno-pa-widget__history-status", r.hidden = !0, e.append(t, o, r), e;
|
|
2234
2249
|
}
|
|
2235
|
-
function
|
|
2250
|
+
function Sr(e) {
|
|
2236
2251
|
const t = document.createElement("div");
|
|
2237
2252
|
return t.className = "pluno-pa-widget__empty-state", t.appendChild(
|
|
2238
2253
|
Re(
|
|
2239
2254
|
"pluno-pa-widget__character--empty",
|
|
2240
2255
|
e
|
|
2241
2256
|
)
|
|
2242
|
-
), t.appendChild(
|
|
2257
|
+
), t.appendChild(ti()), t;
|
|
2243
2258
|
}
|
|
2244
|
-
function
|
|
2259
|
+
function ti() {
|
|
2245
2260
|
const e = document.createElement("div");
|
|
2246
2261
|
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;
|
|
2247
2262
|
}
|
|
2248
|
-
function
|
|
2263
|
+
function ni(e, t) {
|
|
2249
2264
|
e.replaceChildren(), e.setAttribute(
|
|
2250
2265
|
"aria-label",
|
|
2251
2266
|
`${t.toLocaleString("en-US")} users currently active`
|
|
@@ -2258,16 +2273,16 @@ function ei(e, t) {
|
|
|
2258
2273
|
);
|
|
2259
2274
|
}
|
|
2260
2275
|
function Re(e, t) {
|
|
2261
|
-
const n = `pluno-pa-character-${
|
|
2262
|
-
|
|
2263
|
-
const i = t.scribbleStyle ?
|
|
2276
|
+
const n = `pluno-pa-character-${_o}`;
|
|
2277
|
+
_o += 1;
|
|
2278
|
+
const i = t.scribbleStyle ? Er(t.accentColor, n) : Cr(t.accentColor, n), o = e.split(/\s+/).filter(Boolean);
|
|
2264
2279
|
return i.setAttribute(
|
|
2265
2280
|
"class",
|
|
2266
2281
|
o.includes("pluno-pa-widget__character") ? e : `pluno-pa-widget__character ${e}`
|
|
2267
2282
|
), i.setAttribute("aria-hidden", "true"), i.setAttribute("focusable", "false"), i.removeAttribute("role"), i.removeAttribute("aria-label"), i;
|
|
2268
2283
|
}
|
|
2269
|
-
function
|
|
2270
|
-
const n =
|
|
2284
|
+
function Cr(e, t) {
|
|
2285
|
+
const n = Hi(e), i = {
|
|
2271
2286
|
boltFill: `${t}-boltFill`,
|
|
2272
2287
|
boltEdge: `${t}-boltEdge`,
|
|
2273
2288
|
boltGlow: `${t}-boltGlow`,
|
|
@@ -2278,7 +2293,7 @@ function vr(e, t) {
|
|
|
2278
2293
|
eyeShadow: `${t}-eyeShadow`,
|
|
2279
2294
|
pupilGloss: `${t}-pupilGloss`,
|
|
2280
2295
|
boltClip: `${t}-boltClip`
|
|
2281
|
-
}, o =
|
|
2296
|
+
}, o = oi(), r = x(o, "defs"), l = x(r, "linearGradient", {
|
|
2282
2297
|
id: i.boltFill,
|
|
2283
2298
|
x1: "420",
|
|
2284
2299
|
y1: "180",
|
|
@@ -2287,7 +2302,7 @@ function vr(e, t) {
|
|
|
2287
2302
|
gradientUnits: "userSpaceOnUse"
|
|
2288
2303
|
});
|
|
2289
2304
|
G(l, "0", n.top), G(l, "0.36", n.middle), G(l, "0.72", n.bottom), G(l, "1", n.bottom);
|
|
2290
|
-
const p =
|
|
2305
|
+
const p = x(r, "linearGradient", {
|
|
2291
2306
|
id: i.boltEdge,
|
|
2292
2307
|
x1: "470",
|
|
2293
2308
|
y1: "145",
|
|
@@ -2296,28 +2311,28 @@ function vr(e, t) {
|
|
|
2296
2311
|
gradientUnits: "userSpaceOnUse"
|
|
2297
2312
|
});
|
|
2298
2313
|
G(p, "0", n.edgeStart), G(p, "0.32", n.edgeMiddle), G(p, "0.78", n.edgeEnd), G(p, "1", n.edgeEnd);
|
|
2299
|
-
const d =
|
|
2314
|
+
const d = x(r, "radialGradient", {
|
|
2300
2315
|
id: i.boltGlow,
|
|
2301
2316
|
cx: "50%",
|
|
2302
2317
|
cy: "22%",
|
|
2303
2318
|
r: "82%"
|
|
2304
2319
|
});
|
|
2305
2320
|
G(d, "0", n.glow, "0.72"), G(d, "0.5", n.middle, "0.44"), G(d, "1", n.bottom, "0");
|
|
2306
|
-
const c =
|
|
2321
|
+
const c = x(r, "radialGradient", {
|
|
2307
2322
|
id: i.eyeWhite,
|
|
2308
2323
|
cx: "35%",
|
|
2309
2324
|
cy: "25%",
|
|
2310
2325
|
r: "70%"
|
|
2311
2326
|
});
|
|
2312
2327
|
G(c, "0", "#ffffff"), G(c, "0.72", "#ffffff"), G(c, "1", "#e5e5e5");
|
|
2313
|
-
const g =
|
|
2328
|
+
const g = x(r, "radialGradient", {
|
|
2314
2329
|
id: i.pupil,
|
|
2315
2330
|
cx: "42%",
|
|
2316
2331
|
cy: "38%",
|
|
2317
2332
|
r: "65%"
|
|
2318
2333
|
});
|
|
2319
2334
|
G(g, "0", "#2a1f10"), G(g, "0.52", "#080604"), G(g, "1", "#000000");
|
|
2320
|
-
const h =
|
|
2335
|
+
const h = x(r, "filter", {
|
|
2321
2336
|
id: i.softDropShadow,
|
|
2322
2337
|
x: "-18%",
|
|
2323
2338
|
y: "-12%",
|
|
@@ -2325,14 +2340,14 @@ function vr(e, t) {
|
|
|
2325
2340
|
height: "136%",
|
|
2326
2341
|
"color-interpolation-filters": "sRGB"
|
|
2327
2342
|
});
|
|
2328
|
-
|
|
2343
|
+
x(h, "feDropShadow", {
|
|
2329
2344
|
dx: "0",
|
|
2330
2345
|
dy: "12",
|
|
2331
2346
|
stdDeviation: "18",
|
|
2332
2347
|
"flood-color": n.shadow,
|
|
2333
2348
|
"flood-opacity": "0.24"
|
|
2334
2349
|
});
|
|
2335
|
-
const f =
|
|
2350
|
+
const f = x(r, "filter", {
|
|
2336
2351
|
id: i.innerDepth,
|
|
2337
2352
|
x: "-8%",
|
|
2338
2353
|
y: "-8%",
|
|
@@ -2340,32 +2355,32 @@ function vr(e, t) {
|
|
|
2340
2355
|
height: "116%",
|
|
2341
2356
|
"color-interpolation-filters": "sRGB"
|
|
2342
2357
|
});
|
|
2343
|
-
|
|
2358
|
+
x(f, "feGaussianBlur", {
|
|
2344
2359
|
in: "SourceAlpha",
|
|
2345
2360
|
stdDeviation: "8",
|
|
2346
2361
|
result: "blur"
|
|
2347
|
-
}),
|
|
2362
|
+
}), x(f, "feOffset", {
|
|
2348
2363
|
dx: "-7",
|
|
2349
2364
|
dy: "-9",
|
|
2350
2365
|
result: "topLeft"
|
|
2351
|
-
}),
|
|
2366
|
+
}), x(f, "feComposite", {
|
|
2352
2367
|
in: "topLeft",
|
|
2353
2368
|
in2: "SourceAlpha",
|
|
2354
2369
|
operator: "arithmetic",
|
|
2355
2370
|
k2: "-1",
|
|
2356
2371
|
k3: "1",
|
|
2357
2372
|
result: "innerShadow"
|
|
2358
|
-
}),
|
|
2373
|
+
}), x(f, "feColorMatrix", {
|
|
2359
2374
|
in: "innerShadow",
|
|
2360
2375
|
type: "matrix",
|
|
2361
2376
|
values: "1 0 0 0 1 0 1 0 0 1 0 0 1 0 1 0 0 0 0.42 0",
|
|
2362
2377
|
result: "innerLight"
|
|
2363
|
-
}),
|
|
2378
|
+
}), x(f, "feBlend", {
|
|
2364
2379
|
in: "SourceGraphic",
|
|
2365
2380
|
in2: "innerLight",
|
|
2366
2381
|
mode: "screen"
|
|
2367
2382
|
});
|
|
2368
|
-
const
|
|
2383
|
+
const b = x(r, "filter", {
|
|
2369
2384
|
id: i.eyeShadow,
|
|
2370
2385
|
x: "-24%",
|
|
2371
2386
|
y: "-20%",
|
|
@@ -2373,14 +2388,14 @@ function vr(e, t) {
|
|
|
2373
2388
|
height: "148%",
|
|
2374
2389
|
"color-interpolation-filters": "sRGB"
|
|
2375
2390
|
});
|
|
2376
|
-
|
|
2391
|
+
x(b, "feDropShadow", {
|
|
2377
2392
|
dx: "0",
|
|
2378
2393
|
dy: "8",
|
|
2379
2394
|
stdDeviation: "5",
|
|
2380
2395
|
"flood-color": n.shadow,
|
|
2381
2396
|
"flood-opacity": "0.3"
|
|
2382
2397
|
});
|
|
2383
|
-
const y =
|
|
2398
|
+
const y = x(r, "filter", {
|
|
2384
2399
|
id: i.pupilGloss,
|
|
2385
2400
|
x: "-15%",
|
|
2386
2401
|
y: "-15%",
|
|
@@ -2388,51 +2403,51 @@ function vr(e, t) {
|
|
|
2388
2403
|
height: "130%",
|
|
2389
2404
|
"color-interpolation-filters": "sRGB"
|
|
2390
2405
|
});
|
|
2391
|
-
|
|
2406
|
+
x(y, "feDropShadow", {
|
|
2392
2407
|
dx: "0",
|
|
2393
2408
|
dy: "3",
|
|
2394
2409
|
stdDeviation: "3",
|
|
2395
2410
|
"flood-color": "#000000",
|
|
2396
2411
|
"flood-opacity": "0.22"
|
|
2397
2412
|
});
|
|
2398
|
-
const U =
|
|
2399
|
-
|
|
2400
|
-
const u =
|
|
2413
|
+
const U = x(r, "clipPath", { id: i.boltClip });
|
|
2414
|
+
x(U, "path", { d: Ut });
|
|
2415
|
+
const u = x(o, "g", {
|
|
2401
2416
|
filter: Q(i.softDropShadow)
|
|
2402
2417
|
});
|
|
2403
|
-
|
|
2404
|
-
d:
|
|
2418
|
+
x(u, "path", {
|
|
2419
|
+
d: Ut,
|
|
2405
2420
|
fill: Q(i.boltEdge)
|
|
2406
2421
|
});
|
|
2407
2422
|
const H = "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";
|
|
2408
|
-
|
|
2423
|
+
x(u, "path", {
|
|
2409
2424
|
d: H,
|
|
2410
2425
|
fill: Q(i.boltFill),
|
|
2411
2426
|
filter: Q(i.innerDepth)
|
|
2412
|
-
}),
|
|
2427
|
+
}), x(u, "path", {
|
|
2413
2428
|
d: H,
|
|
2414
2429
|
fill: Q(i.boltGlow),
|
|
2415
2430
|
opacity: "0.74"
|
|
2416
2431
|
});
|
|
2417
|
-
const w =
|
|
2432
|
+
const w = x(u, "g", {
|
|
2418
2433
|
"clip-path": Q(i.boltClip),
|
|
2419
2434
|
opacity: "0.42"
|
|
2420
2435
|
});
|
|
2421
|
-
|
|
2436
|
+
x(w, "path", {
|
|
2422
2437
|
d: "M523 181 C505 189 496 206 489 232 L400 594 C397 606 400 619 411 626",
|
|
2423
2438
|
fill: "none",
|
|
2424
2439
|
stroke: n.highlight,
|
|
2425
2440
|
"stroke-width": "22",
|
|
2426
2441
|
"stroke-linecap": "round",
|
|
2427
2442
|
opacity: "0.65"
|
|
2428
|
-
}),
|
|
2443
|
+
}), x(w, "path", {
|
|
2429
2444
|
d: "M556 685 L501 994",
|
|
2430
2445
|
fill: "none",
|
|
2431
2446
|
stroke: n.highlight,
|
|
2432
2447
|
"stroke-width": "20",
|
|
2433
2448
|
"stroke-linecap": "round",
|
|
2434
2449
|
opacity: "0.55"
|
|
2435
|
-
}),
|
|
2450
|
+
}), x(w, "path", {
|
|
2436
2451
|
d: "M858 160 C882 166 893 181 883 204",
|
|
2437
2452
|
fill: "none",
|
|
2438
2453
|
stroke: n.inner,
|
|
@@ -2440,8 +2455,8 @@ function vr(e, t) {
|
|
|
2440
2455
|
"stroke-linecap": "round",
|
|
2441
2456
|
opacity: "0.48"
|
|
2442
2457
|
});
|
|
2443
|
-
const R =
|
|
2444
|
-
return
|
|
2458
|
+
const R = x(o, "g", { filter: Q(i.eyeShadow) });
|
|
2459
|
+
return Lo(
|
|
2445
2460
|
R,
|
|
2446
2461
|
"rotate(-2 528 463)",
|
|
2447
2462
|
"528",
|
|
@@ -2451,7 +2466,7 @@ function vr(e, t) {
|
|
|
2451
2466
|
"557",
|
|
2452
2467
|
"447",
|
|
2453
2468
|
i
|
|
2454
|
-
),
|
|
2469
|
+
), Lo(
|
|
2455
2470
|
R,
|
|
2456
2471
|
"rotate(2 717 462)",
|
|
2457
2472
|
"717",
|
|
@@ -2463,13 +2478,13 @@ function vr(e, t) {
|
|
|
2463
2478
|
i
|
|
2464
2479
|
), o;
|
|
2465
2480
|
}
|
|
2466
|
-
function
|
|
2467
|
-
const n =
|
|
2481
|
+
function Er(e, t) {
|
|
2482
|
+
const n = Ho(e), i = {
|
|
2468
2483
|
clip: `${t}-scribbleBoltClip`,
|
|
2469
2484
|
wobble: `${t}-scribbleBoltWobble`
|
|
2470
|
-
}, o =
|
|
2471
|
-
|
|
2472
|
-
const p =
|
|
2485
|
+
}, o = oi(), r = x(o, "defs"), l = x(r, "clipPath", { id: i.clip });
|
|
2486
|
+
x(l, "path", { d: Ut });
|
|
2487
|
+
const p = x(r, "filter", {
|
|
2473
2488
|
id: i.wobble,
|
|
2474
2489
|
x: "-10%",
|
|
2475
2490
|
y: "-10%",
|
|
@@ -2477,24 +2492,24 @@ function Sr(e, t) {
|
|
|
2477
2492
|
height: "120%",
|
|
2478
2493
|
"color-interpolation-filters": "sRGB"
|
|
2479
2494
|
});
|
|
2480
|
-
|
|
2495
|
+
x(p, "feTurbulence", {
|
|
2481
2496
|
type: "fractalNoise",
|
|
2482
2497
|
baseFrequency: "0.011",
|
|
2483
2498
|
numOctaves: "3",
|
|
2484
2499
|
seed: "7",
|
|
2485
2500
|
result: "noise"
|
|
2486
|
-
}),
|
|
2501
|
+
}), x(p, "feDisplacementMap", {
|
|
2487
2502
|
in: "SourceGraphic",
|
|
2488
2503
|
in2: "noise",
|
|
2489
2504
|
scale: "16",
|
|
2490
2505
|
xChannelSelector: "R",
|
|
2491
2506
|
yChannelSelector: "G"
|
|
2492
2507
|
});
|
|
2493
|
-
const d =
|
|
2508
|
+
const d = x(o, "g", { filter: Q(i.wobble) }), c = x(d, "g", {
|
|
2494
2509
|
"clip-path": Q(i.clip)
|
|
2495
2510
|
});
|
|
2496
|
-
return
|
|
2497
|
-
d:
|
|
2511
|
+
return x(c, "path", {
|
|
2512
|
+
d: Wi(),
|
|
2498
2513
|
fill: "none",
|
|
2499
2514
|
stroke: n,
|
|
2500
2515
|
"stroke-width": "56",
|
|
@@ -2502,13 +2517,13 @@ function Sr(e, t) {
|
|
|
2502
2517
|
"stroke-linejoin": "round",
|
|
2503
2518
|
opacity: "0.9",
|
|
2504
2519
|
transform: "rotate(-14 627 600)"
|
|
2505
|
-
}),
|
|
2506
|
-
d:
|
|
2520
|
+
}), x(d, "path", {
|
|
2521
|
+
d: Ut,
|
|
2507
2522
|
fill: "none",
|
|
2508
|
-
stroke:
|
|
2523
|
+
stroke: Bt,
|
|
2509
2524
|
"stroke-width": "18",
|
|
2510
2525
|
"stroke-linejoin": "round"
|
|
2511
|
-
}),
|
|
2526
|
+
}), To(
|
|
2512
2527
|
d,
|
|
2513
2528
|
"rotate(-2 528 463)",
|
|
2514
2529
|
"528",
|
|
@@ -2517,7 +2532,7 @@ function Sr(e, t) {
|
|
|
2517
2532
|
"473",
|
|
2518
2533
|
"557",
|
|
2519
2534
|
"447"
|
|
2520
|
-
),
|
|
2535
|
+
), To(
|
|
2521
2536
|
d,
|
|
2522
2537
|
"rotate(2 717 462)",
|
|
2523
2538
|
"717",
|
|
@@ -2528,123 +2543,123 @@ function Sr(e, t) {
|
|
|
2528
2543
|
"447"
|
|
2529
2544
|
), o;
|
|
2530
2545
|
}
|
|
2531
|
-
function
|
|
2532
|
-
return
|
|
2533
|
-
xmlns:
|
|
2546
|
+
function oi() {
|
|
2547
|
+
return P("svg", {
|
|
2548
|
+
xmlns: Xo,
|
|
2534
2549
|
viewBox: "0 0 1254 1254"
|
|
2535
2550
|
});
|
|
2536
2551
|
}
|
|
2537
|
-
function
|
|
2538
|
-
const c =
|
|
2539
|
-
|
|
2552
|
+
function Lo(e, t, n, i, o, r, l, p, d) {
|
|
2553
|
+
const c = x(e, "g", { transform: t });
|
|
2554
|
+
x(c, "ellipse", {
|
|
2540
2555
|
cx: n,
|
|
2541
2556
|
cy: i,
|
|
2542
2557
|
rx: "73",
|
|
2543
2558
|
ry: "80",
|
|
2544
2559
|
fill: Q(d.eyeWhite)
|
|
2545
|
-
}),
|
|
2560
|
+
}), x(c, "ellipse", {
|
|
2546
2561
|
cx: o,
|
|
2547
2562
|
cy: r,
|
|
2548
2563
|
rx: "49",
|
|
2549
2564
|
ry: "57",
|
|
2550
2565
|
fill: Q(d.pupil),
|
|
2551
2566
|
filter: Q(d.pupilGloss)
|
|
2552
|
-
}),
|
|
2567
|
+
}), x(c, "circle", {
|
|
2553
2568
|
cx: l,
|
|
2554
2569
|
cy: p,
|
|
2555
2570
|
r: "18",
|
|
2556
2571
|
fill: "#ffffff"
|
|
2557
2572
|
});
|
|
2558
2573
|
}
|
|
2559
|
-
function
|
|
2560
|
-
const d =
|
|
2561
|
-
|
|
2574
|
+
function To(e, t, n, i, o, r, l, p) {
|
|
2575
|
+
const d = x(e, "g", { transform: t });
|
|
2576
|
+
x(d, "ellipse", {
|
|
2562
2577
|
cx: n,
|
|
2563
2578
|
cy: i,
|
|
2564
2579
|
rx: "73",
|
|
2565
2580
|
ry: "80",
|
|
2566
2581
|
fill: "#ffffff",
|
|
2567
|
-
stroke:
|
|
2582
|
+
stroke: Bt,
|
|
2568
2583
|
"stroke-width": "13"
|
|
2569
|
-
}),
|
|
2584
|
+
}), x(d, "ellipse", {
|
|
2570
2585
|
cx: o,
|
|
2571
2586
|
cy: r,
|
|
2572
2587
|
rx: "45",
|
|
2573
2588
|
ry: "53",
|
|
2574
|
-
fill:
|
|
2575
|
-
}),
|
|
2589
|
+
fill: Bt
|
|
2590
|
+
}), x(d, "circle", {
|
|
2576
2591
|
cx: l,
|
|
2577
2592
|
cy: p,
|
|
2578
2593
|
r: "16",
|
|
2579
2594
|
fill: "#ffffff"
|
|
2580
2595
|
});
|
|
2581
2596
|
}
|
|
2582
|
-
function
|
|
2583
|
-
const i =
|
|
2597
|
+
function x(e, t, n = {}) {
|
|
2598
|
+
const i = P(t, n);
|
|
2584
2599
|
return e.appendChild(i), i;
|
|
2585
2600
|
}
|
|
2586
2601
|
function G(e, t, n, i) {
|
|
2587
2602
|
const o = { offset: t, "stop-color": n };
|
|
2588
|
-
i !== void 0 && (o["stop-opacity"] = i),
|
|
2603
|
+
i !== void 0 && (o["stop-opacity"] = i), x(e, "stop", o);
|
|
2589
2604
|
}
|
|
2590
2605
|
function Q(e) {
|
|
2591
2606
|
return `url(#${e})`;
|
|
2592
2607
|
}
|
|
2593
|
-
function
|
|
2608
|
+
function $t(e, t, n, i) {
|
|
2594
2609
|
const o = document.createElement("button");
|
|
2595
2610
|
return o.type = "button", o.className = e, o.setAttribute("aria-label", t), o.title = t, o.hidden = i, o.appendChild(n), o;
|
|
2596
2611
|
}
|
|
2597
|
-
function
|
|
2598
|
-
const e =
|
|
2612
|
+
function kr() {
|
|
2613
|
+
const e = P("svg", {
|
|
2599
2614
|
class: "pluno-pa-widget__scribble-defs",
|
|
2600
2615
|
"aria-hidden": "true",
|
|
2601
2616
|
focusable: "false",
|
|
2602
2617
|
width: "0",
|
|
2603
2618
|
height: "0"
|
|
2604
|
-
}), t =
|
|
2605
|
-
return t.appendChild(
|
|
2606
|
-
|
|
2619
|
+
}), t = P("defs");
|
|
2620
|
+
return t.appendChild(xn("pluno-pa-scribble-wobble", "2", "12")), t.appendChild(
|
|
2621
|
+
xn("pluno-pa-scribble-wobble-2", "5", "15")
|
|
2607
2622
|
), t.appendChild(
|
|
2608
|
-
|
|
2623
|
+
xn("pluno-pa-scribble-wobble-3", "9", "19")
|
|
2609
2624
|
), e.appendChild(t), e;
|
|
2610
2625
|
}
|
|
2611
|
-
function
|
|
2612
|
-
const n =
|
|
2626
|
+
function ii(e, t) {
|
|
2627
|
+
const n = P("svg", {
|
|
2613
2628
|
class: `pluno-pa-widget__scribble-spirals ${e}`,
|
|
2614
2629
|
preserveAspectRatio: "xMidYMid meet",
|
|
2615
2630
|
"aria-hidden": "true",
|
|
2616
2631
|
focusable: "false"
|
|
2617
2632
|
});
|
|
2618
|
-
return
|
|
2633
|
+
return ai(n, t), n;
|
|
2619
2634
|
}
|
|
2620
|
-
function
|
|
2635
|
+
function _n(e, t) {
|
|
2621
2636
|
if (!e)
|
|
2622
2637
|
return;
|
|
2623
2638
|
const n = Math.max(
|
|
2624
2639
|
0,
|
|
2625
|
-
t -
|
|
2640
|
+
t - Tn * 2
|
|
2626
2641
|
), i = Math.max(
|
|
2627
|
-
|
|
2642
|
+
$a,
|
|
2628
2643
|
Math.floor(
|
|
2629
|
-
(n -
|
|
2644
|
+
(n - Ln * 2) / kn
|
|
2630
2645
|
)
|
|
2631
2646
|
);
|
|
2632
|
-
|
|
2647
|
+
ai(e, i);
|
|
2633
2648
|
}
|
|
2634
|
-
function
|
|
2649
|
+
function ai(e, t) {
|
|
2635
2650
|
if (e.dataset.spiralCount === `${t}`)
|
|
2636
2651
|
return;
|
|
2637
|
-
const n = t *
|
|
2652
|
+
const n = t * kn + Ln * 2;
|
|
2638
2653
|
e.dataset.spiralCount = `${t}`, e.setAttribute(
|
|
2639
2654
|
"viewBox",
|
|
2640
|
-
`0 0 ${n} ${
|
|
2655
|
+
`0 0 ${n} ${Ha}`
|
|
2641
2656
|
), e.replaceChildren();
|
|
2642
2657
|
for (let i = 0; i < t; i += 1) {
|
|
2643
|
-
const o =
|
|
2644
|
-
transform: `translate(${
|
|
2658
|
+
const o = bo[i % bo.length], r = P("g", {
|
|
2659
|
+
transform: `translate(${Ln + i * kn} 0)`
|
|
2645
2660
|
});
|
|
2646
2661
|
r.appendChild(
|
|
2647
|
-
|
|
2662
|
+
P("ellipse", {
|
|
2648
2663
|
cx: o.ellipseCx,
|
|
2649
2664
|
cy: o.ellipseCy,
|
|
2650
2665
|
rx: o.ellipseRx,
|
|
@@ -2655,7 +2670,7 @@ function oi(e, t) {
|
|
|
2655
2670
|
opacity: "0.8"
|
|
2656
2671
|
})
|
|
2657
2672
|
), r.appendChild(
|
|
2658
|
-
|
|
2673
|
+
P("path", {
|
|
2659
2674
|
d: o.path,
|
|
2660
2675
|
fill: "none",
|
|
2661
2676
|
stroke: "#2c2a1e",
|
|
@@ -2665,8 +2680,8 @@ function oi(e, t) {
|
|
|
2665
2680
|
), e.appendChild(r);
|
|
2666
2681
|
}
|
|
2667
2682
|
}
|
|
2668
|
-
function
|
|
2669
|
-
const i =
|
|
2683
|
+
function xn(e, t, n) {
|
|
2684
|
+
const i = P("filter", {
|
|
2670
2685
|
id: e,
|
|
2671
2686
|
x: "-8%",
|
|
2672
2687
|
y: "-8%",
|
|
@@ -2674,7 +2689,7 @@ function _n(e, t, n) {
|
|
|
2674
2689
|
height: "116%"
|
|
2675
2690
|
});
|
|
2676
2691
|
return i.appendChild(
|
|
2677
|
-
|
|
2692
|
+
P("feTurbulence", {
|
|
2678
2693
|
type: "fractalNoise",
|
|
2679
2694
|
baseFrequency: "0.012 0.028",
|
|
2680
2695
|
numOctaves: "3",
|
|
@@ -2682,7 +2697,7 @@ function _n(e, t, n) {
|
|
|
2682
2697
|
result: "stroke-noise"
|
|
2683
2698
|
})
|
|
2684
2699
|
), i.appendChild(
|
|
2685
|
-
|
|
2700
|
+
P("feDisplacementMap", {
|
|
2686
2701
|
in: "SourceGraphic",
|
|
2687
2702
|
in2: "stroke-noise",
|
|
2688
2703
|
scale: "3.5",
|
|
@@ -2691,7 +2706,7 @@ function _n(e, t, n) {
|
|
|
2691
2706
|
result: "warped"
|
|
2692
2707
|
})
|
|
2693
2708
|
), i.appendChild(
|
|
2694
|
-
|
|
2709
|
+
P("feTurbulence", {
|
|
2695
2710
|
type: "fractalNoise",
|
|
2696
2711
|
baseFrequency: "0.7",
|
|
2697
2712
|
numOctaves: "1",
|
|
@@ -2699,7 +2714,7 @@ function _n(e, t, n) {
|
|
|
2699
2714
|
result: "ink-noise"
|
|
2700
2715
|
})
|
|
2701
2716
|
), i.appendChild(
|
|
2702
|
-
|
|
2717
|
+
P("feDisplacementMap", {
|
|
2703
2718
|
in: "warped",
|
|
2704
2719
|
in2: "ink-noise",
|
|
2705
2720
|
scale: "0.9",
|
|
@@ -2708,7 +2723,7 @@ function _n(e, t, n) {
|
|
|
2708
2723
|
})
|
|
2709
2724
|
), i;
|
|
2710
2725
|
}
|
|
2711
|
-
function
|
|
2726
|
+
function Lr(e) {
|
|
2712
2727
|
const t = ue(
|
|
2713
2728
|
"0 0 24 24",
|
|
2714
2729
|
e,
|
|
@@ -2717,9 +2732,9 @@ function Er(e) {
|
|
|
2717
2732
|
"currentColor",
|
|
2718
2733
|
"2.25"
|
|
2719
2734
|
);
|
|
2720
|
-
return t.appendChild(
|
|
2735
|
+
return t.appendChild(P("path", { d: "m6 9 6 6 6-6" })), t;
|
|
2721
2736
|
}
|
|
2722
|
-
function
|
|
2737
|
+
function Tr() {
|
|
2723
2738
|
const e = ue(
|
|
2724
2739
|
"0 0 24 24",
|
|
2725
2740
|
17,
|
|
@@ -2729,16 +2744,16 @@ function kr() {
|
|
|
2729
2744
|
"2.25"
|
|
2730
2745
|
);
|
|
2731
2746
|
return e.appendChild(
|
|
2732
|
-
|
|
2747
|
+
P("path", {
|
|
2733
2748
|
d: "M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"
|
|
2734
2749
|
})
|
|
2735
2750
|
), e.appendChild(
|
|
2736
|
-
|
|
2751
|
+
P("path", {
|
|
2737
2752
|
d: "M18.4 2.6a2.1 2.1 0 0 1 3 3L12 15l-4 1 1-4Z"
|
|
2738
2753
|
})
|
|
2739
2754
|
), e;
|
|
2740
2755
|
}
|
|
2741
|
-
function
|
|
2756
|
+
function Pr() {
|
|
2742
2757
|
const e = ue(
|
|
2743
2758
|
"0 0 24 24",
|
|
2744
2759
|
17,
|
|
@@ -2747,9 +2762,9 @@ function Lr() {
|
|
|
2747
2762
|
"currentColor",
|
|
2748
2763
|
"2.25"
|
|
2749
2764
|
);
|
|
2750
|
-
return e.appendChild(
|
|
2765
|
+
return e.appendChild(P("path", { d: "M3 12a9 9 0 1 0 3-6.7" })), e.appendChild(P("path", { d: "M3 4v5h5" })), e.appendChild(P("path", { d: "M12 7v5l3 2" })), e;
|
|
2751
2766
|
}
|
|
2752
|
-
function
|
|
2767
|
+
function ri() {
|
|
2753
2768
|
const e = ue(
|
|
2754
2769
|
"0 0 24 24",
|
|
2755
2770
|
15,
|
|
@@ -2758,9 +2773,9 @@ function ii() {
|
|
|
2758
2773
|
"currentColor",
|
|
2759
2774
|
"2.4"
|
|
2760
2775
|
);
|
|
2761
|
-
return e.appendChild(
|
|
2776
|
+
return e.appendChild(P("path", { d: "M18 6 6 18" })), e.appendChild(P("path", { d: "m6 6 12 12" })), e;
|
|
2762
2777
|
}
|
|
2763
|
-
function
|
|
2778
|
+
function li() {
|
|
2764
2779
|
const e = ue(
|
|
2765
2780
|
"0 0 24 24",
|
|
2766
2781
|
14,
|
|
@@ -2770,10 +2785,10 @@ function ai() {
|
|
|
2770
2785
|
"2.75"
|
|
2771
2786
|
);
|
|
2772
2787
|
return e.appendChild(
|
|
2773
|
-
|
|
2774
|
-
), e.appendChild(
|
|
2788
|
+
P("line", { x1: "12", y1: "19", x2: "12", y2: "5" })
|
|
2789
|
+
), e.appendChild(P("polyline", { points: "5 12 12 5 19 12" })), e;
|
|
2775
2790
|
}
|
|
2776
|
-
function
|
|
2791
|
+
function Ar() {
|
|
2777
2792
|
const e = ue(
|
|
2778
2793
|
"0 0 24 24",
|
|
2779
2794
|
16,
|
|
@@ -2786,18 +2801,18 @@ function Tr() {
|
|
|
2786
2801
|
"class",
|
|
2787
2802
|
"pluno-pa-widget__paperclip-icon pluno-pa-widget__paperclip-icon--standard"
|
|
2788
2803
|
), e.appendChild(
|
|
2789
|
-
|
|
2804
|
+
P("path", {
|
|
2790
2805
|
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"
|
|
2791
2806
|
})
|
|
2792
2807
|
), e;
|
|
2793
2808
|
}
|
|
2794
|
-
function
|
|
2809
|
+
function Ir() {
|
|
2795
2810
|
const e = ue("0 0 24 24", 19, 19, "none", "currentColor");
|
|
2796
2811
|
return e.setAttribute(
|
|
2797
2812
|
"class",
|
|
2798
2813
|
"pluno-pa-widget__paperclip-icon pluno-pa-widget__paperclip-icon--scribble"
|
|
2799
2814
|
), e.appendChild(
|
|
2800
|
-
|
|
2815
|
+
P("path", {
|
|
2801
2816
|
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",
|
|
2802
2817
|
stroke: "currentColor",
|
|
2803
2818
|
"stroke-width": "2",
|
|
@@ -2806,10 +2821,10 @@ function Ar() {
|
|
|
2806
2821
|
})
|
|
2807
2822
|
), e;
|
|
2808
2823
|
}
|
|
2809
|
-
function
|
|
2824
|
+
function Nr() {
|
|
2810
2825
|
const e = ue("0 0 24 24", 18, 18, "currentColor");
|
|
2811
2826
|
return e.appendChild(
|
|
2812
|
-
|
|
2827
|
+
P("rect", {
|
|
2813
2828
|
x: "6",
|
|
2814
2829
|
y: "6",
|
|
2815
2830
|
width: "12",
|
|
@@ -2818,7 +2833,7 @@ function Pr() {
|
|
|
2818
2833
|
})
|
|
2819
2834
|
), e;
|
|
2820
2835
|
}
|
|
2821
|
-
function
|
|
2836
|
+
function Rr() {
|
|
2822
2837
|
const e = ue(
|
|
2823
2838
|
"0 0 24 24",
|
|
2824
2839
|
12,
|
|
@@ -2827,9 +2842,9 @@ function Ir() {
|
|
|
2827
2842
|
"currentColor",
|
|
2828
2843
|
"2.4"
|
|
2829
2844
|
);
|
|
2830
|
-
return e.appendChild(
|
|
2845
|
+
return e.appendChild(P("path", { d: "M18 6 6 18" })), e.appendChild(P("path", { d: "m6 6 12 12" })), e;
|
|
2831
2846
|
}
|
|
2832
|
-
function
|
|
2847
|
+
function zr() {
|
|
2833
2848
|
const e = ue(
|
|
2834
2849
|
"0 0 24 24",
|
|
2835
2850
|
13,
|
|
@@ -2839,7 +2854,7 @@ function Nr() {
|
|
|
2839
2854
|
"2.25"
|
|
2840
2855
|
);
|
|
2841
2856
|
return e.appendChild(
|
|
2842
|
-
|
|
2857
|
+
P("rect", {
|
|
2843
2858
|
width: "14",
|
|
2844
2859
|
height: "14",
|
|
2845
2860
|
x: "8",
|
|
@@ -2848,7 +2863,7 @@ function Nr() {
|
|
|
2848
2863
|
ry: "2"
|
|
2849
2864
|
})
|
|
2850
2865
|
), e.appendChild(
|
|
2851
|
-
|
|
2866
|
+
P("path", {
|
|
2852
2867
|
d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"
|
|
2853
2868
|
})
|
|
2854
2869
|
), e;
|
|
@@ -2861,33 +2876,33 @@ function ue(e, t, n, i, o, r) {
|
|
|
2861
2876
|
fill: i,
|
|
2862
2877
|
"aria-hidden": "true"
|
|
2863
2878
|
};
|
|
2864
|
-
return o && (l.stroke = o, l["stroke-linecap"] = "round", l["stroke-linejoin"] = "round"), r && (l["stroke-width"] = r),
|
|
2879
|
+
return o && (l.stroke = o, l["stroke-linecap"] = "round", l["stroke-linejoin"] = "round"), r && (l["stroke-width"] = r), P("svg", l);
|
|
2865
2880
|
}
|
|
2866
|
-
function
|
|
2867
|
-
const n = document.createElementNS(
|
|
2881
|
+
function P(e, t = {}) {
|
|
2882
|
+
const n = document.createElementNS(Xo, e);
|
|
2868
2883
|
for (const [i, o] of Object.entries(t))
|
|
2869
2884
|
n.setAttribute(i, o);
|
|
2870
2885
|
return n;
|
|
2871
2886
|
}
|
|
2872
|
-
function
|
|
2887
|
+
function Po(e) {
|
|
2873
2888
|
for (const t of ["keydown", "keypress", "keyup"])
|
|
2874
2889
|
e.addEventListener(t, (n) => {
|
|
2875
2890
|
n.stopPropagation();
|
|
2876
2891
|
});
|
|
2877
2892
|
}
|
|
2878
|
-
function
|
|
2893
|
+
function Mr(e, t, n) {
|
|
2879
2894
|
e.replaceChildren(), e.hidden = t.length === 0;
|
|
2880
2895
|
for (const [i, o] of t.entries()) {
|
|
2881
2896
|
const r = document.createElement("div");
|
|
2882
|
-
r.className = "pluno-pa-widget__attachment", r.appendChild(
|
|
2897
|
+
r.className = "pluno-pa-widget__attachment", r.appendChild(Dr(o));
|
|
2883
2898
|
const l = document.createElement("span");
|
|
2884
2899
|
l.textContent = o.name, r.appendChild(l);
|
|
2885
2900
|
const p = document.createElement("button");
|
|
2886
|
-
p.type = "button", p.setAttribute("aria-label", `Remove ${o.name}`), p.appendChild(
|
|
2901
|
+
p.type = "button", p.setAttribute("aria-label", `Remove ${o.name}`), p.appendChild(Rr()), p.addEventListener("click", () => n(i)), r.appendChild(p), e.appendChild(r);
|
|
2887
2902
|
}
|
|
2888
2903
|
}
|
|
2889
|
-
function
|
|
2890
|
-
const t =
|
|
2904
|
+
function Dr(e) {
|
|
2905
|
+
const t = Un(e), n = pi(e);
|
|
2891
2906
|
if (t === "image" && n) {
|
|
2892
2907
|
const i = document.createElement("img");
|
|
2893
2908
|
return i.src = n, i.alt = "", i.setAttribute("aria-hidden", "true"), i.addEventListener(
|
|
@@ -2907,8 +2922,8 @@ function zr(e) {
|
|
|
2907
2922
|
}
|
|
2908
2923
|
return ce(e);
|
|
2909
2924
|
}
|
|
2910
|
-
function
|
|
2911
|
-
const n =
|
|
2925
|
+
function Or(e, t) {
|
|
2926
|
+
const n = Un(e), i = pi(e);
|
|
2912
2927
|
if (n === "image" && i) {
|
|
2913
2928
|
const o = document.createElement("img");
|
|
2914
2929
|
o.className = "pluno-pa-widget__message-attachment-preview", o.alt = e.name;
|
|
@@ -2959,41 +2974,41 @@ function ce(e, t = "composer") {
|
|
|
2959
2974
|
const o = document.createElement("strong");
|
|
2960
2975
|
return o.textContent = e.name, n.append(i, o), n;
|
|
2961
2976
|
}
|
|
2962
|
-
function
|
|
2977
|
+
function Un(e) {
|
|
2963
2978
|
return e.mimeType.startsWith("image/") ? "image" : e.mimeType === "application/pdf" ? "pdf" : e.mimeType.startsWith("video/") ? "video" : "file";
|
|
2964
2979
|
}
|
|
2965
|
-
function
|
|
2980
|
+
function pi(e) {
|
|
2966
2981
|
return "previewUrl" in e && e.previewUrl ? e.previewUrl : e.fileUrl ?? "";
|
|
2967
2982
|
}
|
|
2968
2983
|
function Ao(e) {
|
|
2969
|
-
const t =
|
|
2984
|
+
const t = Un(e);
|
|
2970
2985
|
return t === "image" ? "IMG" : t === "pdf" ? "PDF" : t === "video" ? "VID" : "FILE";
|
|
2971
2986
|
}
|
|
2972
|
-
function
|
|
2987
|
+
function Ur(e, t) {
|
|
2973
2988
|
return t ? Array.from(t).map((i) => ({
|
|
2974
2989
|
...e.createLocalAttachment(i),
|
|
2975
|
-
previewUrl:
|
|
2990
|
+
previewUrl: Br(i)
|
|
2976
2991
|
})) : [];
|
|
2977
2992
|
}
|
|
2978
|
-
function
|
|
2993
|
+
function Br(e) {
|
|
2979
2994
|
return typeof URL.createObjectURL == "function" ? URL.createObjectURL(e) : void 0;
|
|
2980
2995
|
}
|
|
2981
|
-
function
|
|
2996
|
+
function zt(e) {
|
|
2982
2997
|
return !!(e && Array.from(e.types).includes("Files"));
|
|
2983
2998
|
}
|
|
2984
|
-
function
|
|
2985
|
-
const r = pe(t) ||
|
|
2986
|
-
if (!e || !
|
|
2999
|
+
function Fr(e, t, n = null, i = !1, o) {
|
|
3000
|
+
const r = pe(t) || Bn(n), l = !r && i && Wt(t);
|
|
3001
|
+
if (!e || !Nn(t, n) || l) {
|
|
2987
3002
|
e && (e.hidden = !0, e.replaceChildren());
|
|
2988
3003
|
return;
|
|
2989
3004
|
}
|
|
2990
3005
|
e.hidden = !1, e.replaceChildren(), e.className = "pluno-pa-widget__billing-status", r ? e.appendChild(
|
|
2991
|
-
|
|
2992
|
-
) :
|
|
2993
|
-
|
|
3006
|
+
Wr(t, n)
|
|
3007
|
+
) : Wt(t) && e.appendChild(
|
|
3008
|
+
Hr(t, o)
|
|
2994
3009
|
);
|
|
2995
3010
|
}
|
|
2996
|
-
function
|
|
3011
|
+
function Wr(e, t) {
|
|
2997
3012
|
const n = document.createElement("div");
|
|
2998
3013
|
n.className = "pluno-pa-widget__billing-action-card";
|
|
2999
3014
|
const i = e.limitExceeded || t === "limit_exceeded", o = i && e.onboardingIncomplete === !0, r = document.createElement("strong");
|
|
@@ -3002,11 +3017,11 @@ function Br(e, t) {
|
|
|
3002
3017
|
if (l.textContent = o ? "Complete onboarding to unlock credits and start using Pluno." : i ? "Earn bonus credits or upgrade to keep using Pluno on this product." : e.paymentIssue ?? "Open billing to keep using Pluno.", n.appendChild(l), o) {
|
|
3003
3018
|
const p = document.createElement("div");
|
|
3004
3019
|
p.className = "pluno-pa-widget__billing-action-card-actions", p.appendChild(
|
|
3005
|
-
|
|
3020
|
+
Rn("Complete onboarding", e.onboardingUrl ?? "")
|
|
3006
3021
|
), n.appendChild(p);
|
|
3007
3022
|
} else
|
|
3008
3023
|
n.appendChild(
|
|
3009
|
-
|
|
3024
|
+
si(
|
|
3010
3025
|
e,
|
|
3011
3026
|
"Upgrade plan",
|
|
3012
3027
|
"pluno-pa-widget__billing-action-card-actions"
|
|
@@ -3014,58 +3029,58 @@ function Br(e, t) {
|
|
|
3014
3029
|
);
|
|
3015
3030
|
return n;
|
|
3016
3031
|
}
|
|
3017
|
-
function
|
|
3032
|
+
function Hr(e, t) {
|
|
3018
3033
|
const n = document.createElement("div");
|
|
3019
3034
|
if (n.className = "pluno-pa-widget__billing-action-card pluno-pa-widget__billing-action-card--low", t) {
|
|
3020
3035
|
const r = document.createElement("button");
|
|
3021
|
-
r.type = "button", r.className = "pluno-pa-widget__billing-action-card-dismiss", r.setAttribute("aria-label", "Dismiss low credits warning"), r.title = "Dismiss", r.appendChild(
|
|
3036
|
+
r.type = "button", r.className = "pluno-pa-widget__billing-action-card-dismiss", r.setAttribute("aria-label", "Dismiss low credits warning"), r.title = "Dismiss", r.appendChild(ri()), r.addEventListener("click", t), n.appendChild(r);
|
|
3022
3037
|
}
|
|
3023
3038
|
const i = document.createElement("strong");
|
|
3024
3039
|
i.textContent = "Credits running low", n.appendChild(i);
|
|
3025
3040
|
const o = document.createElement("span");
|
|
3026
|
-
return o.textContent =
|
|
3027
|
-
|
|
3041
|
+
return o.textContent = Gr(e) ?? "Credits are running low for this period.", n.appendChild(o), n.appendChild(
|
|
3042
|
+
si(
|
|
3028
3043
|
e,
|
|
3029
3044
|
"Upgrade",
|
|
3030
3045
|
"pluno-pa-widget__billing-action-card-actions"
|
|
3031
3046
|
)
|
|
3032
3047
|
), n;
|
|
3033
3048
|
}
|
|
3034
|
-
function
|
|
3035
|
-
return e !== null && (pe(e) ||
|
|
3049
|
+
function Nn(e, t) {
|
|
3050
|
+
return e !== null && (pe(e) || Wt(e) || Bn(t));
|
|
3036
3051
|
}
|
|
3037
|
-
function
|
|
3038
|
-
return
|
|
3052
|
+
function Io(e, t, n) {
|
|
3053
|
+
return Nn(t, n) || $r(t) ? !0 : !Nn(e, n);
|
|
3039
3054
|
}
|
|
3040
|
-
function
|
|
3055
|
+
function $r(e) {
|
|
3041
3056
|
return e != null && (e.creditsUsed !== null || e.creditLimit !== null || e.creditsRemaining !== null || pe(e));
|
|
3042
3057
|
}
|
|
3043
3058
|
function pe(e) {
|
|
3044
3059
|
return e?.limitExceeded === !0 || !!e?.paymentIssue;
|
|
3045
3060
|
}
|
|
3046
|
-
function
|
|
3061
|
+
function Bn(e) {
|
|
3047
3062
|
return e === "limit_exceeded" || e === "subscription_required" || e === "subscription_inactive" || e === "payment_issue" || e === "subscription_invalid" || e === "payment_required";
|
|
3048
3063
|
}
|
|
3049
|
-
function
|
|
3064
|
+
function Wt(e) {
|
|
3050
3065
|
return e != null && !pe(e) && e.creditLimit !== null && e.creditLimit > 0 && e.creditsRemaining !== null && e.creditsRemaining > 0 && e.creditsRemaining / e.creditLimit <= 0.2;
|
|
3051
3066
|
}
|
|
3052
|
-
function
|
|
3053
|
-
return e.creditsRemaining === null ? null : `${
|
|
3067
|
+
function Gr(e) {
|
|
3068
|
+
return e.creditsRemaining === null ? null : `${qr(e.creditsRemaining)} credits left`;
|
|
3054
3069
|
}
|
|
3055
|
-
function
|
|
3070
|
+
function qr(e) {
|
|
3056
3071
|
return new Intl.NumberFormat("en-US", {
|
|
3057
3072
|
maximumFractionDigits: 0
|
|
3058
3073
|
}).format(Math.ceil(e));
|
|
3059
3074
|
}
|
|
3060
|
-
function
|
|
3075
|
+
function si(e, t, n) {
|
|
3061
3076
|
const i = document.createElement("div");
|
|
3062
3077
|
return i.className = n, i.appendChild(
|
|
3063
|
-
|
|
3078
|
+
Rn(t, e.pricingUrl)
|
|
3064
3079
|
), i.appendChild(
|
|
3065
|
-
|
|
3080
|
+
Rn("Earn credits", e.earnCreditsUrl)
|
|
3066
3081
|
), i;
|
|
3067
3082
|
}
|
|
3068
|
-
function
|
|
3083
|
+
function Rn(e, t) {
|
|
3069
3084
|
const n = document.createElement("button");
|
|
3070
3085
|
if (n.type = "button", e === "Earn credits") {
|
|
3071
3086
|
const i = document.createElement("span");
|
|
@@ -3076,18 +3091,18 @@ function Nn(e, t) {
|
|
|
3076
3091
|
t.trim().length !== 0 && window.open(t, "_blank", "noopener,noreferrer");
|
|
3077
3092
|
}), n;
|
|
3078
3093
|
}
|
|
3079
|
-
function
|
|
3094
|
+
function yn(e, t) {
|
|
3080
3095
|
return e.messages.filter(
|
|
3081
|
-
(i) => !
|
|
3096
|
+
(i) => !ci(i)
|
|
3082
3097
|
).length === 0 && !e.assistantDraft && !e.lastError && !e.isThinking && !t;
|
|
3083
3098
|
}
|
|
3084
|
-
function
|
|
3085
|
-
const ne =
|
|
3086
|
-
ne.filter((C) => !
|
|
3099
|
+
function jr(e, t, n, i, o, r, l, p, d, c, g, h, f, b, y, U, u, H, w, R, D, L) {
|
|
3100
|
+
const ne = el(r), $ = tl(
|
|
3101
|
+
ne.filter((C) => !ci(C))
|
|
3087
3102
|
), bt = e.scrollTop, qe = [], ge = /* @__PURE__ */ new Set(), B = (C) => {
|
|
3088
3103
|
qe.push(C);
|
|
3089
3104
|
};
|
|
3090
|
-
|
|
3105
|
+
hi(n, r.isThinking), o.hidden = !p, p && l !== null && ni(o, l);
|
|
3091
3106
|
const v = $.length > 0 || !!r.assistantDraft || r.isThinking;
|
|
3092
3107
|
if (i(v), u || $.length === 0 && !r.assistantDraft && !r.lastError && !r.isThinking) {
|
|
3093
3108
|
const C = document.createElement("div");
|
|
@@ -3096,50 +3111,50 @@ function Gr(e, t, n, i, o, r, l, p, d, c, g, h, f, x, y, U, u, H, w, R, D, L) {
|
|
|
3096
3111
|
T.className = "pluno-pa-widget__empty-hero";
|
|
3097
3112
|
const I = Re(
|
|
3098
3113
|
"pluno-pa-widget__character--empty",
|
|
3099
|
-
|
|
3114
|
+
b()
|
|
3100
3115
|
);
|
|
3101
3116
|
if (T.appendChild(I), C.appendChild(T), u) {
|
|
3102
3117
|
const E = document.createElement("h2");
|
|
3103
3118
|
E.className = "pluno-pa-widget__empty pluno-pa-widget__morning-report-title", E.textContent = u.opening, C.appendChild(E);
|
|
3104
3119
|
} else
|
|
3105
|
-
C.appendChild(
|
|
3120
|
+
C.appendChild(ti());
|
|
3106
3121
|
const Ee = u?.prompts ?? r.starterPrompts, oe = document.createElement("div");
|
|
3107
3122
|
if (oe.className = Ee.length > 0 ? "pluno-pa-widget__starter-prompts" : "pluno-pa-widget__starter-prompts pluno-pa-widget__starter-prompts--empty", Ee.length === 0 && !r.starterPromptsLoading && oe.setAttribute("aria-hidden", "true"), Ee.length > 0)
|
|
3108
3123
|
for (const E of Ee) {
|
|
3109
|
-
const
|
|
3110
|
-
|
|
3124
|
+
const A = document.createElement("button");
|
|
3125
|
+
A.type = "button", A.className = "pluno-pa-widget__starter-prompt", A.textContent = `"${E}"`, A.addEventListener("click", () => {
|
|
3111
3126
|
y(E);
|
|
3112
|
-
}), oe.appendChild(
|
|
3127
|
+
}), oe.appendChild(A);
|
|
3113
3128
|
}
|
|
3114
3129
|
else if (r.starterPromptsLoading) {
|
|
3115
3130
|
const E = document.createElement("button");
|
|
3116
3131
|
E.type = "button", E.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder pluno-pa-widget__starter-prompt--loading", E.disabled = !0, E.tabIndex = -1, E.textContent = "Generating example tasks...", oe.appendChild(E);
|
|
3117
3132
|
} else
|
|
3118
|
-
for (let E = 0; E <
|
|
3119
|
-
const
|
|
3120
|
-
|
|
3133
|
+
for (let E = 0; E < Pa; E += 1) {
|
|
3134
|
+
const A = document.createElement("button");
|
|
3135
|
+
A.type = "button", A.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder", A.disabled = !0, A.tabIndex = -1, A.textContent = "", oe.appendChild(A);
|
|
3121
3136
|
}
|
|
3122
3137
|
if (C.appendChild(oe), u) {
|
|
3123
3138
|
const E = document.createElement("button");
|
|
3124
3139
|
E.type = "button", E.className = "pluno-pa-widget__morning-report-snooze", E.textContent = "Snooze morning report", E.addEventListener("click", H), C.appendChild(E);
|
|
3125
3140
|
}
|
|
3126
|
-
h.clear(), B(C), B(t),
|
|
3141
|
+
h.clear(), B(C), B(t), Ro(e, qe);
|
|
3127
3142
|
return;
|
|
3128
3143
|
}
|
|
3129
3144
|
let F = null, j = null, Z = [], ze = [];
|
|
3130
|
-
const K = $.length - 1, _t = K >= 0 &&
|
|
3145
|
+
const K = $.length - 1, _t = K >= 0 && zn($[K]), Me = nl($);
|
|
3131
3146
|
let he = !1;
|
|
3132
3147
|
const me = () => {
|
|
3133
3148
|
if (Z.length === 0)
|
|
3134
3149
|
return he = !1, !1;
|
|
3135
3150
|
const C = Me !== null && Z.some(
|
|
3136
|
-
(I) =>
|
|
3137
|
-
), T =
|
|
3151
|
+
(I) => di(I, Me)
|
|
3152
|
+
), T = dl(
|
|
3138
3153
|
Z,
|
|
3139
3154
|
C,
|
|
3140
3155
|
g,
|
|
3141
3156
|
f,
|
|
3142
|
-
|
|
3157
|
+
b()
|
|
3143
3158
|
);
|
|
3144
3159
|
return B(T), F = null, j = T, Z = [], he = C, !0;
|
|
3145
3160
|
}, z = () => {
|
|
@@ -3150,7 +3165,7 @@ function Gr(e, t, n, i, o, r, l, p, d, c, g, h, f, x, y, U, u, H, w, R, D, L) {
|
|
|
3150
3165
|
for (let C = 0; C < $.length; C += 1) {
|
|
3151
3166
|
const T = $[C];
|
|
3152
3167
|
if (T.role === "tool" && T.integrationAuthRequest && D) {
|
|
3153
|
-
const E =
|
|
3168
|
+
const E = Vr(
|
|
3154
3169
|
T.integrationAuthRequest,
|
|
3155
3170
|
D.states.get(
|
|
3156
3171
|
T.integrationAuthRequest.authRequestId
|
|
@@ -3166,41 +3181,41 @@ function Gr(e, t, n, i, o, r, l, p, d, c, g, h, f, x, y, U, u, H, w, R, D, L) {
|
|
|
3166
3181
|
Z.push(T);
|
|
3167
3182
|
continue;
|
|
3168
3183
|
}
|
|
3169
|
-
if (
|
|
3184
|
+
if (zn(T)) {
|
|
3170
3185
|
if (C !== K)
|
|
3171
3186
|
continue;
|
|
3172
3187
|
if (me()) {
|
|
3173
3188
|
if (!he) {
|
|
3174
|
-
const
|
|
3175
|
-
B(
|
|
3189
|
+
const A = wt();
|
|
3190
|
+
B(A), F = null, j = A;
|
|
3176
3191
|
}
|
|
3177
3192
|
} else {
|
|
3178
|
-
const
|
|
3179
|
-
B(
|
|
3193
|
+
const A = Do(b());
|
|
3194
|
+
B(A), F = null, j = A;
|
|
3180
3195
|
}
|
|
3181
3196
|
continue;
|
|
3182
3197
|
}
|
|
3183
3198
|
if (T.role === "system") {
|
|
3184
3199
|
if (T.dataType === "run_error" || T.dataType === "run_status") {
|
|
3185
3200
|
me();
|
|
3186
|
-
const E = document.createElement("div"),
|
|
3187
|
-
if (E.className =
|
|
3201
|
+
const E = document.createElement("div"), A = T.dataType === "run_error";
|
|
3202
|
+
if (E.className = A ? "pluno-pa-widget__error" : "pluno-pa-widget__status pluno-pa-widget__run-status", E.textContent = Mn(
|
|
3188
3203
|
T.content
|
|
3189
|
-
),
|
|
3204
|
+
), A && T.securitySettingsUrl) {
|
|
3190
3205
|
const M = document.createElement("a");
|
|
3191
3206
|
M.className = "pluno-pa-widget__error-retry", M.href = T.securitySettingsUrl, M.target = "_blank", M.rel = "noreferrer", M.textContent = "Security settings", E.appendChild(M);
|
|
3192
3207
|
}
|
|
3193
|
-
B(E), F =
|
|
3208
|
+
B(E), F = A ? E : null, j = A ? null : E, z();
|
|
3194
3209
|
}
|
|
3195
3210
|
continue;
|
|
3196
3211
|
}
|
|
3197
3212
|
T.role === "user" && z();
|
|
3198
|
-
const I = me(), Ee =
|
|
3213
|
+
const I = me(), Ee = Mn(T.content);
|
|
3199
3214
|
if (T.role === "assistant" && !I) {
|
|
3200
|
-
const E =
|
|
3215
|
+
const E = gi(b());
|
|
3201
3216
|
B(E), F = null, j = E;
|
|
3202
3217
|
}
|
|
3203
|
-
const oe =
|
|
3218
|
+
const oe = Kr(
|
|
3204
3219
|
T,
|
|
3205
3220
|
Ee,
|
|
3206
3221
|
h,
|
|
@@ -3217,7 +3232,7 @@ function Gr(e, t, n, i, o, r, l, p, d, c, g, h, f, x, y, U, u, H, w, R, D, L) {
|
|
|
3217
3232
|
B(C), F = null, j = C;
|
|
3218
3233
|
}
|
|
3219
3234
|
} else {
|
|
3220
|
-
const C =
|
|
3235
|
+
const C = Do(b());
|
|
3221
3236
|
B(C), F = null, j = C;
|
|
3222
3237
|
}
|
|
3223
3238
|
if (r.lastError) {
|
|
@@ -3237,9 +3252,9 @@ function Gr(e, t, n, i, o, r, l, p, d, c, g, h, f, x, y, U, u, H, w, R, D, L) {
|
|
|
3237
3252
|
}
|
|
3238
3253
|
B(C), F = C, j = null;
|
|
3239
3254
|
}
|
|
3240
|
-
const Oe = L ? L.actionCandidate ?? (r.isThinking ? null :
|
|
3255
|
+
const Oe = L ? L.actionCandidate ?? (r.isThinking ? null : ji(ne)) : null;
|
|
3241
3256
|
if (L && Oe && !L.dismissedCandidateIds.has(Oe.id)) {
|
|
3242
|
-
const C =
|
|
3257
|
+
const C = ll(Oe, {
|
|
3243
3258
|
isActing: L.actionCandidate?.id === Oe.id,
|
|
3244
3259
|
error: L.error,
|
|
3245
3260
|
characterIconOptions: L.characterIconOptions,
|
|
@@ -3255,12 +3270,12 @@ function Gr(e, t, n, i, o, r, l, p, d, c, g, h, f, x, y, U, u, H, w, R, D, L) {
|
|
|
3255
3270
|
"pluno-pa-widget__message--bottom-reserve"
|
|
3256
3271
|
), j?.classList.add(
|
|
3257
3272
|
"pluno-pa-widget__bottom-reserve-compact"
|
|
3258
|
-
), B(t),
|
|
3273
|
+
), B(t), Qr(
|
|
3259
3274
|
h,
|
|
3260
3275
|
ge
|
|
3261
|
-
),
|
|
3276
|
+
), Ro(e, qe), d ? mt(e, c) : e.scrollTop = bt;
|
|
3262
3277
|
}
|
|
3263
|
-
function
|
|
3278
|
+
function Vr(e, t, n) {
|
|
3264
3279
|
const i = document.createElement("section");
|
|
3265
3280
|
i.className = "pluno-pa-widget__integration-auth-card", i.setAttribute("aria-label", `Connect ${e.appName}`);
|
|
3266
3281
|
const o = document.createElement("div");
|
|
@@ -3278,29 +3293,52 @@ function qr(e, t, n) {
|
|
|
3278
3293
|
const d = document.createElement("button");
|
|
3279
3294
|
return d.type = "button", d.className = "pluno-pa-widget__integration-auth-button", d.disabled = t.status === "checking" || t.status === "connecting" || t.status === "completed", t.status === "checking" ? d.textContent = "Checking connection..." : t.status === "connecting" ? d.textContent = "Connecting..." : t.status === "completed" ? d.textContent = "Connected" : t.status === "expired" || t.status === "cancelled" ? d.textContent = `Reconnect ${e.appName}` : t.status === "error" ? d.textContent = "Try again" : d.textContent = `Connect ${e.appName}`, d.addEventListener("click", () => n(e)), i.appendChild(d), i;
|
|
3280
3295
|
}
|
|
3281
|
-
function
|
|
3282
|
-
const r =
|
|
3283
|
-
|
|
3284
|
-
|
|
3296
|
+
function Kr(e, t, n, i, o) {
|
|
3297
|
+
const r = Yr(e), l = Xr(
|
|
3298
|
+
e,
|
|
3299
|
+
t
|
|
3300
|
+
), p = n.get(r);
|
|
3301
|
+
if (p)
|
|
3302
|
+
return p.node.classList.remove(
|
|
3285
3303
|
"pluno-pa-widget__message--bottom-reserve"
|
|
3286
|
-
), i.add(r), l
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
e.attachments,
|
|
3304
|
+
), i.add(r), p.renderSignature === l ? (p.renderDeferred = !1, p.node) : Zr(p.node) ? (p.renderDeferred = !0, p.node) : (No(
|
|
3305
|
+
p.node,
|
|
3306
|
+
e,
|
|
3307
|
+
t,
|
|
3291
3308
|
o
|
|
3309
|
+
), p.renderSignature = l, p.renderDeferred = !1, p.node);
|
|
3310
|
+
const d = document.createElement("div");
|
|
3311
|
+
return No(
|
|
3312
|
+
d,
|
|
3313
|
+
e,
|
|
3314
|
+
t,
|
|
3315
|
+
o
|
|
3316
|
+
), n.set(r, {
|
|
3317
|
+
node: d,
|
|
3318
|
+
renderSignature: l
|
|
3319
|
+
}), i.add(r), d;
|
|
3320
|
+
}
|
|
3321
|
+
function No(e, t, n, i) {
|
|
3322
|
+
if (e.className = `pluno-pa-widget__message pluno-pa-widget__message--${t.role}`, e.removeAttribute("data-phase"), t.role === "assistant" ? (t.phase && (e.dataset.phase = t.phase), e.replaceChildren(), fl(e, n)) : e.textContent = n, t.role === "user" && t.attachments?.length && e.appendChild(
|
|
3323
|
+
al(
|
|
3324
|
+
t.attachments,
|
|
3325
|
+
i
|
|
3292
3326
|
)
|
|
3293
|
-
),
|
|
3294
|
-
const
|
|
3295
|
-
|
|
3327
|
+
), t.phase !== "commentary") {
|
|
3328
|
+
const o = document.createElement("div");
|
|
3329
|
+
o.className = "pluno-pa-widget__message-actions", o.appendChild(rl(n)), e.appendChild(o);
|
|
3296
3330
|
}
|
|
3297
|
-
return r && (n.set(r, p), i.add(r)), p;
|
|
3298
3331
|
}
|
|
3299
|
-
function
|
|
3300
|
-
|
|
3301
|
-
|
|
3332
|
+
function Yr(e) {
|
|
3333
|
+
const t = e.assistantDraftItemId;
|
|
3334
|
+
return `${e.role}:${t ?? e.id}`;
|
|
3335
|
+
}
|
|
3336
|
+
function Xr(e, t) {
|
|
3337
|
+
return JSON.stringify({
|
|
3338
|
+
role: e.role,
|
|
3302
3339
|
content: t,
|
|
3303
|
-
|
|
3340
|
+
phase: e.phase ?? null,
|
|
3341
|
+
attachments: (e.attachments ?? []).map((n) => {
|
|
3304
3342
|
const { previewUrl: i } = n;
|
|
3305
3343
|
return {
|
|
3306
3344
|
id: n.id ?? null,
|
|
@@ -3314,11 +3352,25 @@ function Vr(e, t) {
|
|
|
3314
3352
|
})
|
|
3315
3353
|
});
|
|
3316
3354
|
}
|
|
3317
|
-
function
|
|
3355
|
+
function Zr(e) {
|
|
3356
|
+
const t = e.ownerDocument.getSelection();
|
|
3357
|
+
if (!t || t.isCollapsed)
|
|
3358
|
+
return !1;
|
|
3359
|
+
for (let n = 0; n < t.rangeCount; n += 1)
|
|
3360
|
+
if (t.getRangeAt(n).intersectsNode(e))
|
|
3361
|
+
return !0;
|
|
3362
|
+
return !1;
|
|
3363
|
+
}
|
|
3364
|
+
function Jr(e) {
|
|
3365
|
+
return Array.from(e.values()).some(
|
|
3366
|
+
(t) => t.renderDeferred === !0
|
|
3367
|
+
);
|
|
3368
|
+
}
|
|
3369
|
+
function Qr(e, t) {
|
|
3318
3370
|
for (const n of e.keys())
|
|
3319
3371
|
t.has(n) || e.delete(n);
|
|
3320
3372
|
}
|
|
3321
|
-
function
|
|
3373
|
+
function Ro(e, t) {
|
|
3322
3374
|
let n = e.firstChild;
|
|
3323
3375
|
for (const i of t) {
|
|
3324
3376
|
if (i === n) {
|
|
@@ -3332,11 +3384,11 @@ function Io(e, t) {
|
|
|
3332
3384
|
n = n.nextSibling, e.removeChild(i);
|
|
3333
3385
|
}
|
|
3334
3386
|
}
|
|
3335
|
-
function
|
|
3387
|
+
function el(e) {
|
|
3336
3388
|
if (!e.assistantDraft)
|
|
3337
3389
|
return [...e.messages];
|
|
3338
3390
|
const t = {
|
|
3339
|
-
id: "assistant-draft",
|
|
3391
|
+
id: e.assistantDraftItemId ?? "assistant-draft",
|
|
3340
3392
|
role: "assistant",
|
|
3341
3393
|
...e.assistantDraftPhase ? { phase: e.assistantDraftPhase } : {},
|
|
3342
3394
|
content: e.assistantDraft,
|
|
@@ -3353,7 +3405,7 @@ function Yr(e) {
|
|
|
3353
3405
|
if (n === -1)
|
|
3354
3406
|
return [...e.messages, t];
|
|
3355
3407
|
const i = e.messages.findIndex(
|
|
3356
|
-
(r, l) => l > n && r.role !== "user" && r.respondsToUserMessageId === t.respondsToUserMessageId &&
|
|
3408
|
+
(r, l) => l > n && r.role !== "user" && r.respondsToUserMessageId === t.respondsToUserMessageId && zo(r, t) && zn(r)
|
|
3357
3409
|
);
|
|
3358
3410
|
if (i !== -1)
|
|
3359
3411
|
return [
|
|
@@ -3362,7 +3414,7 @@ function Yr(e) {
|
|
|
3362
3414
|
...e.messages.slice(i + 1)
|
|
3363
3415
|
];
|
|
3364
3416
|
let o = n + 1;
|
|
3365
|
-
for (; o < e.messages.length && e.messages[o].role !== "user" && e.messages[o].respondsToUserMessageId === t.respondsToUserMessageId &&
|
|
3417
|
+
for (; o < e.messages.length && e.messages[o].role !== "user" && e.messages[o].respondsToUserMessageId === t.respondsToUserMessageId && zo(e.messages[o], t); )
|
|
3366
3418
|
o += 1;
|
|
3367
3419
|
return [
|
|
3368
3420
|
...e.messages.slice(0, o),
|
|
@@ -3370,39 +3422,39 @@ function Yr(e) {
|
|
|
3370
3422
|
...e.messages.slice(o)
|
|
3371
3423
|
];
|
|
3372
3424
|
}
|
|
3373
|
-
function
|
|
3425
|
+
function tl(e) {
|
|
3374
3426
|
return e.map(
|
|
3375
3427
|
(t) => t.role === "assistant" && t.phase === "commentary" ? { ...t, role: "tool" } : t
|
|
3376
3428
|
);
|
|
3377
3429
|
}
|
|
3378
|
-
function
|
|
3430
|
+
function nl(e) {
|
|
3379
3431
|
const t = [...e].reverse().find((n) => n.role === "user");
|
|
3380
3432
|
for (let n = e.length - 1; n >= 0; n -= 1) {
|
|
3381
3433
|
const i = e[n];
|
|
3382
3434
|
if (!(i.role !== "tool" || e.slice(n + 1).some(
|
|
3383
|
-
(r) => (
|
|
3435
|
+
(r) => (ol(r) || il(r)) && di(i, r)
|
|
3384
3436
|
)) && (i.loading || i.dataType === "assistant_draft" || t && i.respondsToUserMessageId === t.id))
|
|
3385
3437
|
return i;
|
|
3386
3438
|
}
|
|
3387
3439
|
return null;
|
|
3388
3440
|
}
|
|
3389
|
-
function
|
|
3441
|
+
function ol(e) {
|
|
3390
3442
|
return e.role === "assistant" && e.phase !== "commentary";
|
|
3391
3443
|
}
|
|
3392
|
-
function
|
|
3444
|
+
function il(e) {
|
|
3393
3445
|
return e.role === "system" && (e.dataType === "run_error" || e.dataType === "run_status" && e.loading !== !0);
|
|
3394
3446
|
}
|
|
3395
|
-
function
|
|
3447
|
+
function di(e, t) {
|
|
3396
3448
|
return e.respondsToUserMessageId && t.respondsToUserMessageId ? e.respondsToUserMessageId === t.respondsToUserMessageId : e.runId && t.runId ? e.runId === t.runId : e.id === t.id;
|
|
3397
3449
|
}
|
|
3398
|
-
function
|
|
3450
|
+
function zn(e) {
|
|
3399
3451
|
return e.role === "system" && e.dataType === "run_status" && e.loading === !0;
|
|
3400
3452
|
}
|
|
3401
|
-
function
|
|
3453
|
+
function zo(e, t) {
|
|
3402
3454
|
return !e.runId || !t.runId ? !0 : e.runId === t.runId;
|
|
3403
3455
|
}
|
|
3404
|
-
function
|
|
3405
|
-
e.replaceChildren(),
|
|
3456
|
+
function Mo(e, t, n, i, o, r, l, p) {
|
|
3457
|
+
e.replaceChildren(), hi(t, !1), t.disabled = !0, n(!1);
|
|
3406
3458
|
const d = document.createElement("div");
|
|
3407
3459
|
d.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter";
|
|
3408
3460
|
const c = Re(
|
|
@@ -3420,23 +3472,23 @@ function Ro(e, t, n, i, o, r, l, p) {
|
|
|
3420
3472
|
}
|
|
3421
3473
|
e.appendChild(d);
|
|
3422
3474
|
}
|
|
3423
|
-
function
|
|
3475
|
+
function al(e, t) {
|
|
3424
3476
|
const n = document.createElement("div");
|
|
3425
3477
|
n.className = "pluno-pa-widget__message-attachments";
|
|
3426
3478
|
for (const i of e)
|
|
3427
3479
|
n.appendChild(
|
|
3428
|
-
|
|
3480
|
+
Or(i, t)
|
|
3429
3481
|
);
|
|
3430
3482
|
return n;
|
|
3431
3483
|
}
|
|
3432
|
-
function
|
|
3484
|
+
function rl(e) {
|
|
3433
3485
|
const t = document.createElement("button");
|
|
3434
|
-
return t.type = "button", t.className = "pluno-pa-widget__message-copy", t.setAttribute("aria-label", "Copy message"), t.title = "Copy message", t.appendChild(
|
|
3486
|
+
return t.type = "button", t.className = "pluno-pa-widget__message-copy", t.setAttribute("aria-label", "Copy message"), t.title = "Copy message", t.appendChild(zr()), t.addEventListener("click", (n) => {
|
|
3435
3487
|
n.preventDefault(), n.stopPropagation(), navigator.clipboard.writeText(e);
|
|
3436
3488
|
}), t;
|
|
3437
3489
|
}
|
|
3438
|
-
function
|
|
3439
|
-
const n =
|
|
3490
|
+
function ll(e, t) {
|
|
3491
|
+
const n = Vi(e.id), i = document.createElement("article");
|
|
3440
3492
|
i.className = "pluno-pa-widget__share-prompt";
|
|
3441
3493
|
const o = document.createElement("div");
|
|
3442
3494
|
o.className = "pluno-pa-widget__share-prompt-body", o.appendChild(
|
|
@@ -3474,18 +3526,18 @@ function nl(e, t) {
|
|
|
3474
3526
|
const f = document.createElement("button");
|
|
3475
3527
|
f.type = "button", f.className = "pluno-pa-widget__share-prompt-draft", f.disabled = t.isActing, f.addEventListener("click", () => {
|
|
3476
3528
|
t.onReferralCopy(e);
|
|
3477
|
-
}), t.isActing ? (f.appendChild(
|
|
3529
|
+
}), t.isActing ? (f.appendChild(gl()), f.appendChild(document.createTextNode("Copying..."))) : f.textContent = "Copy invite link", c.appendChild(f);
|
|
3478
3530
|
} else
|
|
3479
|
-
for (const f of
|
|
3480
|
-
const
|
|
3481
|
-
|
|
3531
|
+
for (const f of pl()) {
|
|
3532
|
+
const b = document.createElement("a");
|
|
3533
|
+
b.className = "pluno-pa-widget__share-prompt-social", b.href = f.href, b.target = "_blank", b.rel = "noopener noreferrer", b.setAttribute("aria-label", `Open ${f.label}`), b.title = f.label, b.appendChild(sl(f.id)), b.addEventListener("click", () => t.onSocialShare(e)), c.appendChild(b);
|
|
3482
3534
|
}
|
|
3483
3535
|
const g = document.createElement("button");
|
|
3484
3536
|
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", () => t.onDismiss(e)), c.appendChild(g), d.appendChild(c);
|
|
3485
3537
|
const h = document.createElement("button");
|
|
3486
3538
|
return h.type = "button", h.className = "pluno-pa-widget__share-prompt-disable", h.textContent = "Don't ask again", h.addEventListener("click", () => t.onDisable(e)), d.appendChild(h), o.appendChild(d), i.appendChild(o), i;
|
|
3487
3539
|
}
|
|
3488
|
-
function
|
|
3540
|
+
function pl() {
|
|
3489
3541
|
const e = "https://pluno.ai/browser", t = `I just used @pluno_ai to get work done directly inside my tools. Worth trying: ${e}`;
|
|
3490
3542
|
return [
|
|
3491
3543
|
{
|
|
@@ -3505,7 +3557,7 @@ function ol() {
|
|
|
3505
3557
|
}
|
|
3506
3558
|
];
|
|
3507
3559
|
}
|
|
3508
|
-
function
|
|
3560
|
+
function sl(e) {
|
|
3509
3561
|
const t = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
3510
3562
|
t.setAttribute("class", "pluno-pa-widget__share-prompt-platform-logo"), t.setAttribute("viewBox", "0 0 32 32"), t.setAttribute("aria-hidden", "true");
|
|
3511
3563
|
const n = (i, o) => {
|
|
@@ -3514,13 +3566,13 @@ function il(e) {
|
|
|
3514
3566
|
};
|
|
3515
3567
|
return e === "linkedin" ? (n("M6.7 13.2c.4 4.1.2 8.1.1 12.3"), n("M6.4 6.9c.6-.5 1.6-.5 2.1.1.7.7.5 1.8-.2 2.3-.8.5-1.9.2-2.3-.6-.2-.6 0-1.3.4-1.8Z"), n("M14.4 13.3c.1 3.8.1 7.8 0 11.9"), n("M14.8 16.2c1.2-2 3-3.1 5.1-2.9 3.4.3 4.8 2.7 4.8 6.2 0 1.9-.1 3.8-.1 5.8"), n("M20 18c.1 2.2.1 4.7 0 7.2"), t) : e === "x" ? (n("M7.2 7.4c5.6 6.4 10.9 12.2 17.7 17.2"), n("M24.4 7.2c-5.1 6.3-10.6 11.8-17 17.8"), n("M9.1 8.2c5.1 5.6 9.7 10.8 15 15.5", "0.55"), t) : (n("M10.2 6.4c3.8-.3 8-.3 11.6.1 2.5.3 3.8 1.8 4 4 .4 3.3.4 7.4 0 10.9-.3 2.4-1.7 3.8-4 4.1-3.8.4-8.2.4-11.8 0-2.3-.3-3.7-1.8-4-4.1-.4-3.5-.3-7.8.1-11.1.2-2.2 1.8-3.6 4.1-3.9Z"), n("M11 7.3c3.4-.4 7.1-.4 10.2.1 2 .3 3.1 1.4 3.4 3.2.4 3 .4 6.6.1 9.9-.3 2.2-1.3 3.3-3.3 3.7-3.2.5-7.2.5-10.5.1", "0.48"), n("M12.1 16.1c.1-2.4 1.8-4.1 4-4.2 2.4-.1 4.2 1.6 4.3 4 .1 2.3-1.6 4.1-3.9 4.2-2.6.2-4.3-1.5-4.4-4Z"), n("M22 10.7c.3-.1.7 0 .9.3.2.4.1.8-.2 1-.4.2-.8.1-1-.2-.2-.4-.1-.8.3-1.1Z"), t);
|
|
3516
3568
|
}
|
|
3517
|
-
function
|
|
3518
|
-
return e.role === "tool" && e.toolName ===
|
|
3569
|
+
function ci(e) {
|
|
3570
|
+
return e.role === "tool" && e.toolName === Go;
|
|
3519
3571
|
}
|
|
3520
|
-
function
|
|
3572
|
+
function Mn(e) {
|
|
3521
3573
|
return e.replace(/\uE200[^\uE201]*(?:\uE201|$)/g, "");
|
|
3522
3574
|
}
|
|
3523
|
-
function
|
|
3575
|
+
function dl(e, t, n, i, o) {
|
|
3524
3576
|
const r = document.createElement("article");
|
|
3525
3577
|
r.className = "pluno-pa-widget__tool-group", r.classList.toggle("pluno-pa-widget__tool-group--active", t), r.title = new Date(
|
|
3526
3578
|
e[e.length - 1].createdAt
|
|
@@ -3530,12 +3582,12 @@ function al(e, t, n, i, o) {
|
|
|
3530
3582
|
o
|
|
3531
3583
|
)
|
|
3532
3584
|
);
|
|
3533
|
-
const l =
|
|
3585
|
+
const l = cl(e, t);
|
|
3534
3586
|
if (t) {
|
|
3535
3587
|
const y = document.createElement("div");
|
|
3536
3588
|
return y.className = "pluno-pa-widget__tool-active-content", y.appendChild(wt()), y.appendChild(l), r.appendChild(y), r;
|
|
3537
3589
|
}
|
|
3538
|
-
const p = document.createElement("details"), d =
|
|
3590
|
+
const p = document.createElement("details"), d = ul(e);
|
|
3539
3591
|
p.open = n.has(d), r.classList.toggle("pluno-pa-widget__tool-group--open", p.open), p.addEventListener("toggle", () => {
|
|
3540
3592
|
r.classList.toggle("pluno-pa-widget__tool-group--open", p.open), p.open ? n.add(d) : n.delete(d), i();
|
|
3541
3593
|
});
|
|
@@ -3545,10 +3597,10 @@ function al(e, t, n, i, o) {
|
|
|
3545
3597
|
(y) => y.phase !== "commentary" && y.loading
|
|
3546
3598
|
), f = document.createElement("span");
|
|
3547
3599
|
f.className = "pluno-pa-widget__tool-summary-title";
|
|
3548
|
-
const
|
|
3549
|
-
return f.textContent =
|
|
3600
|
+
const b = g ? ui(g.content) : "Activity";
|
|
3601
|
+
return f.textContent = b, h && (f.classList.add("pluno-pa-widget__tool-summary-title--loading"), f.dataset.loadingText = b), c.appendChild(f), p.appendChild(c), p.appendChild(l), r.appendChild(p), r;
|
|
3550
3602
|
}
|
|
3551
|
-
function
|
|
3603
|
+
function cl(e, t) {
|
|
3552
3604
|
const n = document.createElement("div");
|
|
3553
3605
|
n.className = "pluno-pa-widget__tool-lines";
|
|
3554
3606
|
const i = e[e.length - 1];
|
|
@@ -3557,16 +3609,16 @@ function rl(e, t) {
|
|
|
3557
3609
|
r.className = "pluno-pa-widget__tool-line", r.dataset.eventType = o.phase === "commentary" ? "commentary" : "tool";
|
|
3558
3610
|
const l = document.createElement("span");
|
|
3559
3611
|
l.className = "pluno-pa-widget__tool-line-text";
|
|
3560
|
-
const p =
|
|
3612
|
+
const p = Mn(o.content) || (o.phase === "commentary" ? "" : "Run tool"), d = o.phase === "commentary" ? p : ui(p);
|
|
3561
3613
|
t && o === i && o.phase !== "commentary" && (l.classList.add("pluno-pa-widget__tool-line-text--loading"), l.dataset.loadingText = d), l.textContent = d, r.appendChild(l), n.appendChild(r);
|
|
3562
3614
|
}
|
|
3563
3615
|
return n;
|
|
3564
3616
|
}
|
|
3565
|
-
function
|
|
3617
|
+
function ui(e) {
|
|
3566
3618
|
const t = e.trim() || "Run tool", n = t.codePointAt(0) ?? 0;
|
|
3567
3619
|
return n >= 126976 && n <= 129791 || n >= 9728 && n <= 10175 || n >= 127462 && n <= 127487 ? t : `🛠️ ${t}`;
|
|
3568
3620
|
}
|
|
3569
|
-
function
|
|
3621
|
+
function gi(e) {
|
|
3570
3622
|
const t = document.createElement("article");
|
|
3571
3623
|
return t.className = "pluno-pa-widget__tool-group pluno-pa-widget__assistant-marker", t.appendChild(
|
|
3572
3624
|
Re(
|
|
@@ -3575,8 +3627,8 @@ function ci(e) {
|
|
|
3575
3627
|
)
|
|
3576
3628
|
), t;
|
|
3577
3629
|
}
|
|
3578
|
-
function
|
|
3579
|
-
const t =
|
|
3630
|
+
function Do(e) {
|
|
3631
|
+
const t = gi(e);
|
|
3580
3632
|
return t.classList.add("pluno-pa-widget__thinking-marker"), t.appendChild(wt()), t;
|
|
3581
3633
|
}
|
|
3582
3634
|
function wt(e = "Thinking...") {
|
|
@@ -3587,17 +3639,17 @@ function wt(e = "Thinking...") {
|
|
|
3587
3639
|
const i = document.createElement("span");
|
|
3588
3640
|
return i.textContent = e, t.appendChild(i), t;
|
|
3589
3641
|
}
|
|
3590
|
-
function
|
|
3642
|
+
function ul(e) {
|
|
3591
3643
|
return `tools:${e[0]?.id ?? ""}`;
|
|
3592
3644
|
}
|
|
3593
|
-
function
|
|
3645
|
+
function gl() {
|
|
3594
3646
|
const e = document.createElement("span");
|
|
3595
3647
|
return e.className = "pluno-pa-widget__spinner", e.setAttribute("aria-hidden", "true"), e;
|
|
3596
3648
|
}
|
|
3597
|
-
function
|
|
3598
|
-
e.setAttribute("aria-label", t ? "Stop" : "Send"), e.classList.toggle("pluno-pa-widget__send--stop", t), e.replaceChildren(t ?
|
|
3649
|
+
function hi(e, t) {
|
|
3650
|
+
e.setAttribute("aria-label", t ? "Stop" : "Send"), e.classList.toggle("pluno-pa-widget__send--stop", t), e.replaceChildren(t ? Nr() : li());
|
|
3599
3651
|
}
|
|
3600
|
-
function
|
|
3652
|
+
function vn(e) {
|
|
3601
3653
|
let t = e.trim();
|
|
3602
3654
|
if (!t.includes("|"))
|
|
3603
3655
|
return null;
|
|
@@ -3610,18 +3662,18 @@ function yn(e) {
|
|
|
3610
3662
|
}
|
|
3611
3663
|
return n.push(i.trim()), n.length > 1 ? n : null;
|
|
3612
3664
|
}
|
|
3613
|
-
function
|
|
3665
|
+
function hl(e) {
|
|
3614
3666
|
const t = e.trim();
|
|
3615
3667
|
if (/^:?-{3,}:?$/.test(t))
|
|
3616
3668
|
return t.startsWith(":") && t.endsWith(":") ? "center" : t.endsWith(":") ? "right" : t.startsWith(":") ? "left" : null;
|
|
3617
3669
|
}
|
|
3618
|
-
function
|
|
3619
|
-
const n =
|
|
3670
|
+
function ml(e, t) {
|
|
3671
|
+
const n = vn(e[t] ?? ""), i = vn(e[t + 1] ?? "");
|
|
3620
3672
|
if (!n || !i || n.length !== i.length)
|
|
3621
3673
|
return null;
|
|
3622
3674
|
const o = [];
|
|
3623
3675
|
for (const h of i) {
|
|
3624
|
-
const f =
|
|
3676
|
+
const f = hl(h);
|
|
3625
3677
|
if (f === void 0)
|
|
3626
3678
|
return null;
|
|
3627
3679
|
o.push(f);
|
|
@@ -3630,25 +3682,25 @@ function dl(e, t) {
|
|
|
3630
3682
|
r.className = "pluno-pa-widget__table-scroll";
|
|
3631
3683
|
const l = document.createElement("table"), p = document.createElement("thead"), d = document.createElement("tr");
|
|
3632
3684
|
n.forEach((h, f) => {
|
|
3633
|
-
const
|
|
3634
|
-
y &&
|
|
3685
|
+
const b = document.createElement("th"), y = o[f];
|
|
3686
|
+
y && b.classList.add(`pluno-pa-widget__table-cell--${y}`), Ne(b, h), d.appendChild(b);
|
|
3635
3687
|
}), p.appendChild(d), l.appendChild(p);
|
|
3636
3688
|
const c = document.createElement("tbody");
|
|
3637
3689
|
let g = t + 2;
|
|
3638
3690
|
for (; g < e.length && e[g].trim(); ) {
|
|
3639
|
-
const h =
|
|
3691
|
+
const h = vn(e[g]);
|
|
3640
3692
|
if (!h)
|
|
3641
3693
|
break;
|
|
3642
3694
|
const f = document.createElement("tr");
|
|
3643
|
-
n.forEach((
|
|
3695
|
+
n.forEach((b, y) => {
|
|
3644
3696
|
const U = document.createElement("td"), u = o[y];
|
|
3645
3697
|
u && U.classList.add(`pluno-pa-widget__table-cell--${u}`), Ne(U, h[y] ?? ""), f.appendChild(U);
|
|
3646
3698
|
}), c.appendChild(f), g += 1;
|
|
3647
3699
|
}
|
|
3648
3700
|
return l.appendChild(c), r.appendChild(l), { element: r, nextIndex: g };
|
|
3649
3701
|
}
|
|
3650
|
-
function
|
|
3651
|
-
const n =
|
|
3702
|
+
function fl(e, t) {
|
|
3703
|
+
const n = ua(t).replace(/\r\n/g, `
|
|
3652
3704
|
`).split(`
|
|
3653
3705
|
`);
|
|
3654
3706
|
let i = 0;
|
|
@@ -3663,12 +3715,12 @@ function cl(e, t) {
|
|
|
3663
3715
|
for (i += 1; i < n.length && !/^```\s*$/.test(n[i]); )
|
|
3664
3716
|
h.push(n[i]), i += 1;
|
|
3665
3717
|
i += i < n.length ? 1 : 0;
|
|
3666
|
-
const f = document.createElement("pre"),
|
|
3667
|
-
|
|
3668
|
-
`), f.appendChild(
|
|
3718
|
+
const f = document.createElement("pre"), b = document.createElement("code");
|
|
3719
|
+
b.textContent = h.join(`
|
|
3720
|
+
`), f.appendChild(b), e.appendChild(f);
|
|
3669
3721
|
continue;
|
|
3670
3722
|
}
|
|
3671
|
-
const l =
|
|
3723
|
+
const l = ml(n, i);
|
|
3672
3724
|
if (l) {
|
|
3673
3725
|
e.appendChild(l.element), i = l.nextIndex;
|
|
3674
3726
|
continue;
|
|
@@ -3727,7 +3779,7 @@ function Ne(e, t) {
|
|
|
3727
3779
|
Ne(p, l.slice(1, -1)), e.appendChild(p);
|
|
3728
3780
|
} else {
|
|
3729
3781
|
const p = l.match(/^\[([^\]]+)\]\(([^)\s]+)\)$/);
|
|
3730
|
-
if (p &&
|
|
3782
|
+
if (p && wl(p[2])) {
|
|
3731
3783
|
const d = document.createElement("a");
|
|
3732
3784
|
d.href = p[2], d.target = "_top", d.rel = "noreferrer", d.textContent = p[1], e.appendChild(d);
|
|
3733
3785
|
} else
|
|
@@ -3737,7 +3789,7 @@ function Ne(e, t) {
|
|
|
3737
3789
|
}
|
|
3738
3790
|
i < t.length && e.appendChild(document.createTextNode(t.slice(i)));
|
|
3739
3791
|
}
|
|
3740
|
-
function
|
|
3792
|
+
function wl(e) {
|
|
3741
3793
|
if (e.startsWith("/") || e.startsWith("#"))
|
|
3742
3794
|
return !0;
|
|
3743
3795
|
try {
|
|
@@ -3747,8 +3799,8 @@ function ul(e) {
|
|
|
3747
3799
|
return !1;
|
|
3748
3800
|
}
|
|
3749
3801
|
}
|
|
3750
|
-
function
|
|
3751
|
-
if (
|
|
3802
|
+
function Oo(e, t) {
|
|
3803
|
+
if (bl(e))
|
|
3752
3804
|
return;
|
|
3753
3805
|
const n = `
|
|
3754
3806
|
:host {
|
|
@@ -5828,8 +5880,8 @@ function Mo(e, t) {
|
|
|
5828
5880
|
.pluno-pa-widget--scribble .pluno-pa-widget__scribble-spirals--panel {
|
|
5829
5881
|
position: absolute;
|
|
5830
5882
|
top: -16px;
|
|
5831
|
-
left: ${
|
|
5832
|
-
width: calc(100% - ${
|
|
5883
|
+
left: ${Tn}px;
|
|
5884
|
+
width: calc(100% - ${Tn * 2}px);
|
|
5833
5885
|
height: 36px;
|
|
5834
5886
|
z-index: 3;
|
|
5835
5887
|
filter: url(#pluno-pa-scribble-wobble-2);
|
|
@@ -6321,28 +6373,28 @@ function Mo(e, t) {
|
|
|
6321
6373
|
}
|
|
6322
6374
|
}
|
|
6323
6375
|
`;
|
|
6324
|
-
if (
|
|
6376
|
+
if (_l(e, n))
|
|
6325
6377
|
return;
|
|
6326
6378
|
const i = e.ownerDocument.createElement("style");
|
|
6327
|
-
i.id =
|
|
6379
|
+
i.id = Qo, i.textContent = n, e.appendChild(i), mi(e);
|
|
6328
6380
|
}
|
|
6329
|
-
function
|
|
6330
|
-
return e.getElementById(
|
|
6381
|
+
function bl(e) {
|
|
6382
|
+
return e.getElementById(Qo) !== null || e.host instanceof HTMLElement && e.host.getAttribute(ei) === "true";
|
|
6331
6383
|
}
|
|
6332
|
-
function
|
|
6333
|
-
e.host instanceof HTMLElement && e.host.setAttribute(
|
|
6384
|
+
function mi(e) {
|
|
6385
|
+
e.host instanceof HTMLElement && e.host.setAttribute(ei, "true");
|
|
6334
6386
|
}
|
|
6335
|
-
function
|
|
6387
|
+
function _l(e, t) {
|
|
6336
6388
|
if (typeof CSSStyleSheet > "u" || typeof CSSStyleSheet.prototype.replaceSync != "function" || !("adoptedStyleSheets" in e))
|
|
6337
6389
|
return !1;
|
|
6338
6390
|
try {
|
|
6339
6391
|
const n = new CSSStyleSheet();
|
|
6340
|
-
return n.replaceSync(t), e.adoptedStyleSheets = [...e.adoptedStyleSheets, n],
|
|
6392
|
+
return n.replaceSync(t), e.adoptedStyleSheets = [...e.adoptedStyleSheets, n], mi(e), !0;
|
|
6341
6393
|
} catch {
|
|
6342
6394
|
return !1;
|
|
6343
6395
|
}
|
|
6344
6396
|
}
|
|
6345
|
-
async function
|
|
6397
|
+
async function xl() {
|
|
6346
6398
|
return document.body ? document.body : await new Promise((e) => {
|
|
6347
6399
|
const t = new MutationObserver(() => {
|
|
6348
6400
|
document.body && (t.disconnect(), e(document.body));
|
|
@@ -6350,25 +6402,25 @@ async function ml() {
|
|
|
6350
6402
|
t.observe(document.documentElement, { childList: !0 });
|
|
6351
6403
|
});
|
|
6352
6404
|
}
|
|
6353
|
-
function
|
|
6405
|
+
function Fn(e) {
|
|
6354
6406
|
return `pluno.productAgent.widgetState.${location.origin}.${e.backendUrl ?? ""}.${e.tokenEndpoint ?? ""}.${e.position ?? ""}`;
|
|
6355
6407
|
}
|
|
6356
|
-
function
|
|
6357
|
-
return `${
|
|
6408
|
+
function fi(e) {
|
|
6409
|
+
return `${Fn(e)}.displayState`;
|
|
6358
6410
|
}
|
|
6359
|
-
function
|
|
6411
|
+
function yl(e) {
|
|
6360
6412
|
try {
|
|
6361
6413
|
return window.sessionStorage.getItem(
|
|
6362
|
-
|
|
6414
|
+
fi(e)
|
|
6363
6415
|
) === "minimized" ? "minimized" : "shown";
|
|
6364
6416
|
} catch {
|
|
6365
6417
|
return "shown";
|
|
6366
6418
|
}
|
|
6367
6419
|
}
|
|
6368
|
-
function
|
|
6420
|
+
function Uo(e, t) {
|
|
6369
6421
|
if (e.layout === "floating")
|
|
6370
6422
|
try {
|
|
6371
|
-
const n =
|
|
6423
|
+
const n = fi(e);
|
|
6372
6424
|
if (t === "minimized") {
|
|
6373
6425
|
window.sessionStorage.setItem(n, t);
|
|
6374
6426
|
return;
|
|
@@ -6378,15 +6430,15 @@ function Do(e, t) {
|
|
|
6378
6430
|
return;
|
|
6379
6431
|
}
|
|
6380
6432
|
}
|
|
6381
|
-
function
|
|
6433
|
+
function vl(e) {
|
|
6382
6434
|
if (e)
|
|
6383
6435
|
return { clientId: e, release: () => {
|
|
6384
6436
|
} };
|
|
6385
6437
|
let t = 0;
|
|
6386
|
-
for (;
|
|
6438
|
+
for (; gn.has(t); )
|
|
6387
6439
|
t += 1;
|
|
6388
|
-
|
|
6389
|
-
const n = `${
|
|
6440
|
+
gn.add(t);
|
|
6441
|
+
const n = `${La}${t}`;
|
|
6390
6442
|
let i = crypto.randomUUID();
|
|
6391
6443
|
try {
|
|
6392
6444
|
i = window.sessionStorage.getItem(n) ?? i, window.sessionStorage.setItem(n, i);
|
|
@@ -6396,15 +6448,15 @@ function wl(e) {
|
|
|
6396
6448
|
return {
|
|
6397
6449
|
clientId: i,
|
|
6398
6450
|
release: () => {
|
|
6399
|
-
o || (o = !0,
|
|
6451
|
+
o || (o = !0, gn.delete(t));
|
|
6400
6452
|
}
|
|
6401
6453
|
};
|
|
6402
6454
|
}
|
|
6403
|
-
function
|
|
6455
|
+
function Sl(e) {
|
|
6404
6456
|
try {
|
|
6405
|
-
const t = window.localStorage.getItem(
|
|
6457
|
+
const t = window.localStorage.getItem(Fn(e));
|
|
6406
6458
|
if (!t)
|
|
6407
|
-
return
|
|
6459
|
+
return Bo();
|
|
6408
6460
|
const n = JSON.parse(t);
|
|
6409
6461
|
return {
|
|
6410
6462
|
isOpen: n.isOpen === !0,
|
|
@@ -6414,25 +6466,25 @@ function bl(e) {
|
|
|
6414
6466
|
openToolGroupKeys: Array.isArray(n.openToolGroupKeys) ? n.openToolGroupKeys.filter(
|
|
6415
6467
|
(i) => typeof i == "string"
|
|
6416
6468
|
) : [],
|
|
6417
|
-
launcherPosition:
|
|
6418
|
-
panelSize:
|
|
6419
|
-
seenShareCandidateIds: Array.isArray(n.seenShareCandidateIds) ? n.seenShareCandidateIds.filter((i) => typeof i == "string").slice(
|
|
6469
|
+
launcherPosition: Ll(n.launcherPosition) ? n.launcherPosition : null,
|
|
6470
|
+
panelSize: Tl(n.panelSize) ? Ht(n.panelSize) : null,
|
|
6471
|
+
seenShareCandidateIds: Array.isArray(n.seenShareCandidateIds) ? n.seenShareCandidateIds.filter((i) => typeof i == "string").slice(-qo) : [],
|
|
6420
6472
|
sharePromptsDisabled: n.sharePromptsDisabled === !0
|
|
6421
6473
|
};
|
|
6422
6474
|
} catch {
|
|
6423
|
-
return
|
|
6475
|
+
return Bo();
|
|
6424
6476
|
}
|
|
6425
6477
|
}
|
|
6426
|
-
async function
|
|
6478
|
+
async function Cl(e) {
|
|
6427
6479
|
if (e.loadSharePromptsDisabled)
|
|
6428
6480
|
return e.loadSharePromptsDisabled();
|
|
6429
6481
|
try {
|
|
6430
|
-
return window.localStorage.getItem(
|
|
6482
|
+
return window.localStorage.getItem(Vo) === "true";
|
|
6431
6483
|
} catch {
|
|
6432
6484
|
return !1;
|
|
6433
6485
|
}
|
|
6434
6486
|
}
|
|
6435
|
-
function
|
|
6487
|
+
function El(e, t) {
|
|
6436
6488
|
if (e.persistSharePromptsDisabled) {
|
|
6437
6489
|
Promise.resolve(e.persistSharePromptsDisabled(t)).catch(
|
|
6438
6490
|
() => {
|
|
@@ -6441,12 +6493,12 @@ function xl(e, t) {
|
|
|
6441
6493
|
return;
|
|
6442
6494
|
}
|
|
6443
6495
|
try {
|
|
6444
|
-
t && window.localStorage.setItem(
|
|
6496
|
+
t && window.localStorage.setItem(Vo, "true");
|
|
6445
6497
|
} catch {
|
|
6446
6498
|
return;
|
|
6447
6499
|
}
|
|
6448
6500
|
}
|
|
6449
|
-
function
|
|
6501
|
+
function Bo() {
|
|
6450
6502
|
return {
|
|
6451
6503
|
isOpen: !1,
|
|
6452
6504
|
composerValue: "",
|
|
@@ -6459,29 +6511,29 @@ function Oo() {
|
|
|
6459
6511
|
sharePromptsDisabled: !1
|
|
6460
6512
|
};
|
|
6461
6513
|
}
|
|
6462
|
-
function
|
|
6514
|
+
function kl(e, t) {
|
|
6463
6515
|
try {
|
|
6464
6516
|
window.localStorage.setItem(
|
|
6465
|
-
|
|
6517
|
+
Fn(e),
|
|
6466
6518
|
JSON.stringify(t)
|
|
6467
6519
|
);
|
|
6468
6520
|
} catch {
|
|
6469
6521
|
return;
|
|
6470
6522
|
}
|
|
6471
6523
|
}
|
|
6472
|
-
function
|
|
6524
|
+
function Ll(e) {
|
|
6473
6525
|
if (!e || typeof e != "object")
|
|
6474
6526
|
return !1;
|
|
6475
6527
|
const t = e;
|
|
6476
6528
|
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");
|
|
6477
6529
|
}
|
|
6478
|
-
function
|
|
6530
|
+
function Tl(e) {
|
|
6479
6531
|
if (!e || typeof e != "object")
|
|
6480
6532
|
return !1;
|
|
6481
6533
|
const t = e;
|
|
6482
6534
|
return typeof t.width == "number" && Number.isFinite(t.width) && typeof t.height == "number" && Number.isFinite(t.height);
|
|
6483
6535
|
}
|
|
6484
|
-
async function
|
|
6536
|
+
async function wi(e, t) {
|
|
6485
6537
|
const n = await fetch(e, {
|
|
6486
6538
|
method: "POST",
|
|
6487
6539
|
credentials: "include",
|
|
@@ -6493,7 +6545,7 @@ async function mi(e, t) {
|
|
|
6493
6545
|
...t ? { signal: t } : {}
|
|
6494
6546
|
});
|
|
6495
6547
|
if (!n.ok) {
|
|
6496
|
-
const o = await n.text(), r =
|
|
6548
|
+
const o = await n.text(), r = Bi(o);
|
|
6497
6549
|
throw r ? (console.error(r), new Error(r)) : new Error(`Failed to load Pluno token (${n.status})`);
|
|
6498
6550
|
}
|
|
6499
6551
|
const i = await n.json();
|
|
@@ -6501,15 +6553,15 @@ async function mi(e, t) {
|
|
|
6501
6553
|
throw new Error("Pluno token endpoint did not return a token");
|
|
6502
6554
|
return i.token;
|
|
6503
6555
|
}
|
|
6504
|
-
function
|
|
6556
|
+
function Pl(e) {
|
|
6505
6557
|
let t = !1, n = !1;
|
|
6506
6558
|
const i = async () => {
|
|
6507
6559
|
const o = new AbortController();
|
|
6508
6560
|
let r = !1;
|
|
6509
6561
|
const l = new Promise((p, d) => {
|
|
6510
6562
|
const c = window.setTimeout(() => {
|
|
6511
|
-
r = !0, o.abort(), d(new Error(
|
|
6512
|
-
},
|
|
6563
|
+
r = !0, o.abort(), d(new Error(ho));
|
|
6564
|
+
}, Ea);
|
|
6513
6565
|
o.signal.addEventListener(
|
|
6514
6566
|
"abort",
|
|
6515
6567
|
() => window.clearTimeout(c),
|
|
@@ -6518,12 +6570,12 @@ function Cl(e) {
|
|
|
6518
6570
|
});
|
|
6519
6571
|
try {
|
|
6520
6572
|
const p = await Promise.race([
|
|
6521
|
-
|
|
6573
|
+
wi(e, o.signal),
|
|
6522
6574
|
l
|
|
6523
6575
|
]);
|
|
6524
6576
|
return o.abort(), p;
|
|
6525
6577
|
} catch (p) {
|
|
6526
|
-
throw o.abort(), r ? new Error(
|
|
6578
|
+
throw o.abort(), r ? new Error(ho) : p instanceof Error && p.message.startsWith("Pluno widget blocked on ") ? p : new Error(ka);
|
|
6527
6579
|
}
|
|
6528
6580
|
};
|
|
6529
6581
|
return {
|
|
@@ -6546,30 +6598,30 @@ function Cl(e) {
|
|
|
6546
6598
|
}
|
|
6547
6599
|
};
|
|
6548
6600
|
}
|
|
6549
|
-
const
|
|
6550
|
-
function
|
|
6601
|
+
const Fo = /* @__PURE__ */ new WeakSet();
|
|
6602
|
+
function Al(e) {
|
|
6551
6603
|
return Object.keys(e.dataset).some((t) => t.startsWith("pluno"));
|
|
6552
6604
|
}
|
|
6553
|
-
function
|
|
6605
|
+
function Wo(e) {
|
|
6554
6606
|
const t = e.pathname.split("/");
|
|
6555
6607
|
return t[t.length - 1] ?? "";
|
|
6556
6608
|
}
|
|
6557
|
-
function
|
|
6609
|
+
function Il(e, t) {
|
|
6558
6610
|
const n = new URL(e.src, document.baseURI);
|
|
6559
|
-
return n.href === t.href || n.pathname === t.pathname ? !0 :
|
|
6611
|
+
return n.href === t.href || n.pathname === t.pathname ? !0 : Wo(n) === Wo(t);
|
|
6560
6612
|
}
|
|
6561
6613
|
class Ce extends EventTarget {
|
|
6562
6614
|
constructor(t, n) {
|
|
6563
|
-
super(), this.channelId = n, this.url = t, this.addPreviewListener(
|
|
6615
|
+
super(), this.channelId = n, this.url = t, this.addPreviewListener(xa, () => {
|
|
6564
6616
|
this.readyState = Ce.OPEN, this.dispatchEvent(new Event("open"));
|
|
6565
|
-
}), this.addPreviewListener(
|
|
6617
|
+
}), this.addPreviewListener(ya, (i) => {
|
|
6566
6618
|
const o = i;
|
|
6567
6619
|
this.dispatchEvent(
|
|
6568
6620
|
new MessageEvent("message", { data: o.detail?.data ?? "" })
|
|
6569
6621
|
);
|
|
6570
|
-
}), this.addPreviewListener(
|
|
6622
|
+
}), this.addPreviewListener(va, () => {
|
|
6571
6623
|
this.readyState = Ce.CLOSED, this.dispatchEvent(new Event("error")), this.cleanup();
|
|
6572
|
-
}), this.addPreviewListener(
|
|
6624
|
+
}), this.addPreviewListener(Sa, (i) => {
|
|
6573
6625
|
const o = i;
|
|
6574
6626
|
this.readyState = Ce.CLOSED, this.dispatchEvent(
|
|
6575
6627
|
new CloseEvent("close", {
|
|
@@ -6580,8 +6632,8 @@ class Ce extends EventTarget {
|
|
|
6580
6632
|
), this.cleanup();
|
|
6581
6633
|
}), window.dispatchEvent(
|
|
6582
6634
|
new CustomEvent(
|
|
6583
|
-
|
|
6584
|
-
|
|
6635
|
+
Mt(
|
|
6636
|
+
wa,
|
|
6585
6637
|
this.channelId
|
|
6586
6638
|
),
|
|
6587
6639
|
{
|
|
@@ -6601,7 +6653,7 @@ class Ce extends EventTarget {
|
|
|
6601
6653
|
binaryType = "blob";
|
|
6602
6654
|
bufferedAmount = 0;
|
|
6603
6655
|
readyState = Ce.CONNECTING;
|
|
6604
|
-
socketId =
|
|
6656
|
+
socketId = Nl();
|
|
6605
6657
|
listeners = /* @__PURE__ */ new Map();
|
|
6606
6658
|
send(t) {
|
|
6607
6659
|
if (this.readyState !== Ce.OPEN)
|
|
@@ -6611,7 +6663,7 @@ class Ce extends EventTarget {
|
|
|
6611
6663
|
);
|
|
6612
6664
|
window.dispatchEvent(
|
|
6613
6665
|
new CustomEvent(
|
|
6614
|
-
|
|
6666
|
+
Mt(ba, this.channelId),
|
|
6615
6667
|
{
|
|
6616
6668
|
detail: {
|
|
6617
6669
|
socketId: this.socketId,
|
|
@@ -6624,7 +6676,7 @@ class Ce extends EventTarget {
|
|
|
6624
6676
|
close(t, n) {
|
|
6625
6677
|
this.readyState !== Ce.CLOSED && (this.readyState = Ce.CLOSING, window.dispatchEvent(
|
|
6626
6678
|
new CustomEvent(
|
|
6627
|
-
|
|
6679
|
+
Mt(_a, this.channelId),
|
|
6628
6680
|
{
|
|
6629
6681
|
detail: { socketId: this.socketId, code: t, reason: n }
|
|
6630
6682
|
}
|
|
@@ -6632,7 +6684,7 @@ class Ce extends EventTarget {
|
|
|
6632
6684
|
), this.cleanup());
|
|
6633
6685
|
}
|
|
6634
6686
|
addPreviewListener(t, n) {
|
|
6635
|
-
const i =
|
|
6687
|
+
const i = Mt(
|
|
6636
6688
|
t,
|
|
6637
6689
|
this.channelId
|
|
6638
6690
|
), o = (r) => {
|
|
@@ -6646,19 +6698,19 @@ class Ce extends EventTarget {
|
|
|
6646
6698
|
this.listeners.clear();
|
|
6647
6699
|
}
|
|
6648
6700
|
}
|
|
6649
|
-
function
|
|
6701
|
+
function Nl() {
|
|
6650
6702
|
const e = window.sessionStorage.getItem(
|
|
6651
|
-
|
|
6703
|
+
go
|
|
6652
6704
|
);
|
|
6653
6705
|
if (e)
|
|
6654
6706
|
return e;
|
|
6655
6707
|
const t = crypto.randomUUID();
|
|
6656
|
-
return window.sessionStorage.setItem(
|
|
6708
|
+
return window.sessionStorage.setItem(go, t), t;
|
|
6657
6709
|
}
|
|
6658
|
-
function
|
|
6710
|
+
function Mt(e, t) {
|
|
6659
6711
|
return `${e}:${t}`;
|
|
6660
6712
|
}
|
|
6661
|
-
function
|
|
6713
|
+
function Rl(e) {
|
|
6662
6714
|
const t = document.currentScript;
|
|
6663
6715
|
if (t instanceof HTMLScriptElement)
|
|
6664
6716
|
return [t];
|
|
@@ -6666,35 +6718,35 @@ function Tl(e) {
|
|
|
6666
6718
|
return Array.from(
|
|
6667
6719
|
document.querySelectorAll("script[type='module'][src]")
|
|
6668
6720
|
).filter(
|
|
6669
|
-
(o) => o instanceof HTMLScriptElement &&
|
|
6721
|
+
(o) => o instanceof HTMLScriptElement && Al(o) && Il(o, i)
|
|
6670
6722
|
);
|
|
6671
6723
|
}
|
|
6672
|
-
function
|
|
6673
|
-
for (const t of
|
|
6674
|
-
|
|
6724
|
+
function zl(e) {
|
|
6725
|
+
for (const t of Rl(e))
|
|
6726
|
+
Fo.has(t) || t.dataset.plunoAutoMount === "false" || (Fo.add(t), bi(t).catch((n) => {
|
|
6675
6727
|
console.error("Failed to mount Pluno widget", n);
|
|
6676
6728
|
}));
|
|
6677
6729
|
}
|
|
6678
|
-
function
|
|
6730
|
+
function bi(e) {
|
|
6679
6731
|
const t = window, n = t[ve];
|
|
6680
6732
|
if (n) {
|
|
6681
6733
|
if (n.host === null)
|
|
6682
6734
|
return n.mountPromise.catch(() => {
|
|
6683
6735
|
const d = t[ve];
|
|
6684
|
-
return d ? d.mountPromise :
|
|
6736
|
+
return d ? d.mountPromise : bi(e);
|
|
6685
6737
|
});
|
|
6686
|
-
if (
|
|
6738
|
+
if (Ml(n.host))
|
|
6687
6739
|
return n.retryPendingTokenFailureOnce?.(), n.mountPromise;
|
|
6688
6740
|
n.destroy?.(), delete t[ve];
|
|
6689
6741
|
}
|
|
6690
|
-
const i = e.dataset.plunoPreviewChannel, o = e.dataset.plunoTokenEndpoint, r = !e.dataset.plunoToken && !i && o ?
|
|
6742
|
+
const i = e.dataset.plunoPreviewChannel, o = e.dataset.plunoTokenEndpoint, r = !e.dataset.plunoToken && !i && o ? Pl(o) : null;
|
|
6691
6743
|
let l;
|
|
6692
|
-
const p =
|
|
6744
|
+
const p = Ka({
|
|
6693
6745
|
token: e.dataset.plunoToken,
|
|
6694
6746
|
tokenProvider: r?.loadToken,
|
|
6695
6747
|
tokenEndpoint: o,
|
|
6696
6748
|
backendUrl: e.dataset.plunoBackendUrl,
|
|
6697
|
-
webSocketFactory: i ?
|
|
6749
|
+
webSocketFactory: i ? Va(i) : void 0,
|
|
6698
6750
|
launcherLabel: e.dataset.plunoLauncherLabel,
|
|
6699
6751
|
accentColor: e.dataset.plunoAccentColor,
|
|
6700
6752
|
colorScheme: e.dataset.plunoColorScheme === "dark" ? "dark" : "light",
|
|
@@ -6707,7 +6759,7 @@ function fi(e) {
|
|
|
6707
6759
|
return;
|
|
6708
6760
|
}
|
|
6709
6761
|
const c = d.host;
|
|
6710
|
-
c.setAttribute(
|
|
6762
|
+
c.setAttribute(jo, "true"), l.host = c, l.destroy = () => {
|
|
6711
6763
|
t[ve] === l && delete t[ve], l.host = null, l.destroy = null, d.destroy();
|
|
6712
6764
|
};
|
|
6713
6765
|
}).catch((d) => {
|
|
@@ -6720,11 +6772,11 @@ function fi(e) {
|
|
|
6720
6772
|
retryPendingTokenFailureOnce: r?.retryPendingFailureOnce ?? null
|
|
6721
6773
|
}, t[ve] = l, p;
|
|
6722
6774
|
}
|
|
6723
|
-
function
|
|
6724
|
-
return e.isConnected && e.getAttribute(
|
|
6775
|
+
function Ml(e) {
|
|
6776
|
+
return e.isConnected && e.getAttribute(jo) === "true" && !!e.shadowRoot?.querySelector(".pluno-pa-widget__launcher") && !!e.shadowRoot?.querySelector(".pluno-pa-widget__panel");
|
|
6725
6777
|
}
|
|
6726
|
-
|
|
6778
|
+
zl(import.meta.url);
|
|
6727
6779
|
export {
|
|
6728
|
-
|
|
6729
|
-
|
|
6780
|
+
Va as createProductAgentPreviewBridgeWebSocketFactory,
|
|
6781
|
+
Ka as mountPlunoProductAgentWidget
|
|
6730
6782
|
};
|