@pluno/product-agent-web 0.1.112 → 0.1.113
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/product-agent-widget.js +573 -568
- 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 Ci, getProductAgentOriginAccessErrorMessage as Ei } from "./product-agent-sdk.js";
|
|
2
|
+
const ki = "#7c3aed", kt = "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", Lt = "#2c2a1e", Gn = [253, 250, 241], $n = 3.5;
|
|
3
|
+
function Lo(e) {
|
|
4
|
+
const t = To(e);
|
|
5
|
+
if (qn(pt(t), Gn) >= $n)
|
|
6
6
|
return t;
|
|
7
7
|
let i = pt(t);
|
|
8
|
-
const o = pt(
|
|
8
|
+
const o = pt(Lt);
|
|
9
9
|
for (let r = 0; r < 6; r += 1)
|
|
10
|
-
if (i =
|
|
11
|
-
return
|
|
12
|
-
return
|
|
10
|
+
if (i = Ai(i, o, 0.22), qn(i, Gn) >= $n)
|
|
11
|
+
return dn(i);
|
|
12
|
+
return dn(i);
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function Li() {
|
|
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 ki() {
|
|
|
19
19
|
}
|
|
20
20
|
return n;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
const t =
|
|
22
|
+
function Ti(e) {
|
|
23
|
+
const t = To(e), n = cn(pt(t));
|
|
24
24
|
return n > 0.86 ? {
|
|
25
25
|
top: "#ffffff",
|
|
26
26
|
middle: "#f6f6f6",
|
|
@@ -56,9 +56,9 @@ function Li(e) {
|
|
|
56
56
|
shadow: se(t, -0.25, -0.08)
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function To(e) {
|
|
60
60
|
const t = e.trim();
|
|
61
|
-
return /^#[0-9a-f]{6}$/i.test(t) ? t.toLowerCase() : /^#[0-9a-f]{3}$/i.test(t) ? `#${t.slice(1).split("").map((n) => n + n).join("").toLowerCase()}` :
|
|
61
|
+
return /^#[0-9a-f]{6}$/i.test(t) ? t.toLowerCase() : /^#[0-9a-f]{3}$/i.test(t) ? `#${t.slice(1).split("").map((n) => n + n).join("").toLowerCase()}` : ki;
|
|
62
62
|
}
|
|
63
63
|
function pt(e) {
|
|
64
64
|
return [
|
|
@@ -67,23 +67,23 @@ function pt(e) {
|
|
|
67
67
|
Number.parseInt(e.slice(5, 7), 16)
|
|
68
68
|
];
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function dn([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 qn(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 Ai(e, t, n) {
|
|
86
|
+
const i = un(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 Ti(e, t, n) {
|
|
|
91
91
|
];
|
|
92
92
|
}
|
|
93
93
|
function se(e, t, n) {
|
|
94
|
-
const [i, o, r] =
|
|
95
|
-
return
|
|
94
|
+
const [i, o, r] = Ii(pt(e));
|
|
95
|
+
return dn(Pi(i, un(o + n), un(r + t)));
|
|
96
96
|
}
|
|
97
|
-
function
|
|
97
|
+
function Ii([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), s = (l + p) / 2;
|
|
99
99
|
if (l === p)
|
|
100
100
|
return [0, 0, s];
|
|
101
101
|
const c = l - p, g = s > 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, s];
|
|
103
103
|
}
|
|
104
|
-
function
|
|
104
|
+
function Pi(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
|
+
Zt(o, i, e + 1 / 3) * 255,
|
|
110
|
+
Zt(o, i, e) * 255,
|
|
111
|
+
Zt(o, i, e - 1 / 3) * 255
|
|
112
112
|
];
|
|
113
113
|
}
|
|
114
|
-
function
|
|
114
|
+
function Zt(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 un(e) {
|
|
119
119
|
return Math.max(0, Math.min(1, e));
|
|
120
120
|
}
|
|
121
|
-
const
|
|
122
|
-
function
|
|
121
|
+
const Ao = "suggest_share_on_socials";
|
|
122
|
+
function Ni(e) {
|
|
123
123
|
for (let t = e.length - 1; t >= 0; t -= 1) {
|
|
124
124
|
const n = e[t];
|
|
125
|
-
if (n.role !== "tool" || n.toolName !==
|
|
125
|
+
if (n.role !== "tool" || n.toolName !== Ao)
|
|
126
126
|
continue;
|
|
127
|
-
const i =
|
|
127
|
+
const i = jn(e, t, "assistant");
|
|
128
128
|
if (!i)
|
|
129
129
|
return null;
|
|
130
|
-
const o =
|
|
130
|
+
const o = jn(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 Pi(e) {
|
|
|
136
136
|
}
|
|
137
137
|
return null;
|
|
138
138
|
}
|
|
139
|
-
function
|
|
139
|
+
function Ri(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 jn(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 qn(e, t, n) {
|
|
|
150
150
|
}
|
|
151
151
|
return null;
|
|
152
152
|
}
|
|
153
|
-
const
|
|
154
|
-
function
|
|
153
|
+
const Mi = "https://app.pluno.ai", zi = "/api/product-agent/embed/active-users", Di = 1800, Oi = 15e3, Ui = 250, Bi = 1e3, Fi = 3e4;
|
|
154
|
+
function Wi(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
|
+
}, $i(g)));
|
|
162
162
|
}, s = (g) => {
|
|
163
163
|
if (l(), i === null) {
|
|
164
164
|
i = g, e(g);
|
|
@@ -170,50 +170,50 @@ function Fi(e, t = {}) {
|
|
|
170
170
|
l();
|
|
171
171
|
return;
|
|
172
172
|
}
|
|
173
|
-
const y = Math.min(1, (performance.now() - m) /
|
|
174
|
-
i = Math.round(h + (g - h) *
|
|
175
|
-
},
|
|
173
|
+
const y = Math.min(1, (performance.now() - m) / Di);
|
|
174
|
+
i = Math.round(h + (g - h) * qi(y)), e(i), y >= 1 && (i = g, e(g), l());
|
|
175
|
+
}, Ui);
|
|
176
176
|
}, c = async () => {
|
|
177
177
|
try {
|
|
178
|
-
const g = await
|
|
178
|
+
const g = await Hi(t);
|
|
179
179
|
if (n)
|
|
180
180
|
return;
|
|
181
181
|
s(g.count), p(g.refreshAfterMs);
|
|
182
182
|
} catch {
|
|
183
|
-
p(
|
|
183
|
+
p(Oi);
|
|
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 Hi(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(zi, Gi(e.backendUrl ?? Mi)).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 = Kn(i.count), r = Kn(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 Kn(e) {
|
|
205
205
|
return typeof e != "number" || !Number.isFinite(e) || e < 0 ? null : Math.round(e);
|
|
206
206
|
}
|
|
207
|
-
function Hi(e) {
|
|
208
|
-
return e.endsWith("/") ? e : `${e}/`;
|
|
209
|
-
}
|
|
210
207
|
function Gi(e) {
|
|
211
|
-
return
|
|
208
|
+
return e.endsWith("/") ? e : `${e}/`;
|
|
212
209
|
}
|
|
213
210
|
function $i(e) {
|
|
211
|
+
return Math.min(Fi, Math.max(Bi, e));
|
|
212
|
+
}
|
|
213
|
+
function qi(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 ji = [
|
|
217
217
|
"a[href]",
|
|
218
218
|
"button",
|
|
219
219
|
"input",
|
|
@@ -237,27 +237,27 @@ const qi = [
|
|
|
237
237
|
".pluno-pa-widget__message",
|
|
238
238
|
".timeline-item"
|
|
239
239
|
].join(",");
|
|
240
|
-
function
|
|
241
|
-
return e instanceof Element ?
|
|
240
|
+
function Ki(e, t, n) {
|
|
241
|
+
return e instanceof Element ? Vi(
|
|
242
242
|
t,
|
|
243
243
|
n,
|
|
244
|
-
e.closest(
|
|
244
|
+
e.closest(ji) !== null
|
|
245
245
|
) : !1;
|
|
246
246
|
}
|
|
247
|
-
function
|
|
247
|
+
function Vi(e, t, n) {
|
|
248
248
|
return e === 1 && !t && !n;
|
|
249
249
|
}
|
|
250
|
-
function
|
|
250
|
+
function Yi(e, t, n) {
|
|
251
251
|
return e instanceof Node && t !== null && !t.contains(e) && !n?.contains(e);
|
|
252
252
|
}
|
|
253
|
-
function
|
|
253
|
+
function Xi(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 Zi = /(`+)(?!`)[\s\S]*?\1(?!`)/g;
|
|
260
|
+
function Ji(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 Zi(e) {
|
|
|
268
268
|
}
|
|
269
269
|
const r = o.match(/^[ \t]{0,3}(`{3,}|~{3,})/);
|
|
270
270
|
if (r) {
|
|
271
|
-
t +=
|
|
271
|
+
t += Vn(n) + o, n = "", i = {
|
|
272
272
|
marker: r[1][0],
|
|
273
273
|
length: r[1].length
|
|
274
274
|
};
|
|
@@ -276,31 +276,31 @@ function Zi(e) {
|
|
|
276
276
|
}
|
|
277
277
|
n += o;
|
|
278
278
|
}
|
|
279
|
-
return t +
|
|
279
|
+
return t + Vn(n);
|
|
280
280
|
}
|
|
281
|
-
function
|
|
281
|
+
function Vn(e) {
|
|
282
282
|
let t = "", n = 0;
|
|
283
|
-
for (const i of e.matchAll(
|
|
283
|
+
for (const i of e.matchAll(Zi)) {
|
|
284
284
|
const o = i.index ?? 0;
|
|
285
|
-
t +=
|
|
285
|
+
t += Yn(
|
|
286
286
|
e.slice(n, o)
|
|
287
287
|
), t += i[0], n = o + i[0].length;
|
|
288
288
|
}
|
|
289
|
-
return t +
|
|
289
|
+
return t + Yn(e.slice(n));
|
|
290
290
|
}
|
|
291
|
-
function
|
|
291
|
+
function Yn(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] === "!" || Qi(r, o) || ea(r, o, n) ? t : `[${n}](${i})`
|
|
295
295
|
);
|
|
296
296
|
}
|
|
297
|
-
function
|
|
297
|
+
function Qi(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 ea(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 Qi(e, t, n) {
|
|
|
309
309
|
e.slice(i, t)
|
|
310
310
|
);
|
|
311
311
|
}
|
|
312
|
-
const
|
|
312
|
+
const Io = 100, ta = 1e4, na = 5e3, oa = "product-agent:sdk-preview-socket-connect", ia = "product-agent:sdk-preview-socket-send", aa = "product-agent:sdk-preview-socket-close", ra = "product-agent:sdk-preview-socket-open", la = "product-agent:sdk-preview-socket-message", sa = "product-agent:sdk-preview-socket-error", pa = "product-agent:sdk-preview-socket-closed", Xn = "product-agent:sdk-preview-socket-id", da = "data-pluno-sdk-preview-channel", Po = "data-pluno-auto-mounted", be = "__plunoProductAgentAutoMountOwner", ca = 1e4, ua = "Failed to load Pluno widget token", Zn = "Timed out loading Pluno widget token", ga = "pluno.productAgent.widgetClientId.", Jt = /* @__PURE__ */ new Set(), ha = "product-agent:preview-diagnostic", No = "pluno.productAgent.sharePromptsDisabled", ma = 3, Jn = 'dialog[open], [aria-modal="true"], [role="dialog"]', fa = 400, wa = 5e3, ba = 500, Qn = "Close the page's popup to chat", _a = "No recent chats for this page yet.", _e = {
|
|
313
313
|
launcherLabel: "Ask for anything...",
|
|
314
314
|
accentColor: "#7c3aed",
|
|
315
315
|
colorScheme: "light",
|
|
@@ -317,7 +317,7 @@ const To = 100, ea = 1e4, ta = 5e3, na = "product-agent:sdk-preview-socket-conne
|
|
|
317
317
|
scribbleStyle: !0,
|
|
318
318
|
position: "bottom-right",
|
|
319
319
|
movableLauncher: !0
|
|
320
|
-
},
|
|
320
|
+
}, xa = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive', eo = "pluno-pa-scribble-font", Ro = 190, Mo = 41, to = 22, ya = 1, va = 48, vn = 420, Sa = 520, Ca = 0.24, Sn = 680, Ea = 800, ka = 0.76, N = 8, Ue = 50, zo = "http://www.w3.org/2000/svg", gn = 26, hn = 8, La = 36, mn = 16, Ta = 4, no = [
|
|
321
321
|
{
|
|
322
322
|
ellipseCx: "17.5",
|
|
323
323
|
ellipseCy: "24.5",
|
|
@@ -354,12 +354,12 @@ const To = 100, ea = 1e4, ta = 5e3, na = "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
|
+
], Aa = 11, Ia = 13, fn = 4, Do = 10, Oo = 40, Pa = "movable-launcher-position-v2", Uo = "pluno-pa-widget-styles", Bo = "data-pluno-pa-widget-styles";
|
|
358
|
+
let oo = 0;
|
|
359
|
+
function Na(e) {
|
|
360
360
|
return (t) => new xe(t, e);
|
|
361
361
|
}
|
|
362
|
-
async function
|
|
362
|
+
async function Ra(e = {}) {
|
|
363
363
|
const t = {
|
|
364
364
|
layout: e.layout ?? "floating",
|
|
365
365
|
mountTarget: e.mountTarget,
|
|
@@ -431,12 +431,12 @@ async function Na(e = {}) {
|
|
|
431
431
|
);
|
|
432
432
|
const n = document.createElement("div");
|
|
433
433
|
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(
|
|
434
|
-
|
|
434
|
+
da,
|
|
435
435
|
t.sdkPreviewChannelId
|
|
436
436
|
);
|
|
437
437
|
const i = n.attachShadow({ mode: "open" }), o = document.createElement("div");
|
|
438
438
|
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");
|
|
439
|
-
let r =
|
|
439
|
+
let r = io(
|
|
440
440
|
t.accentColor,
|
|
441
441
|
t.scribbleStyle
|
|
442
442
|
);
|
|
@@ -448,16 +448,16 @@ async function Na(e = {}) {
|
|
|
448
448
|
t.showLauncherMinimizeButton
|
|
449
449
|
), i.appendChild(o);
|
|
450
450
|
const l = il(t), p = t.layout === "floating" ? t.initialDisplayState ?? nl(t) : "shown";
|
|
451
|
-
|
|
451
|
+
So(t, p);
|
|
452
452
|
let s = t.movableLauncher ? l.launcherPosition : null, c = s !== null, g = l.panelSize, h = null;
|
|
453
453
|
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"), Oe(
|
|
454
454
|
o,
|
|
455
|
-
|
|
455
|
+
en(
|
|
456
456
|
o,
|
|
457
457
|
s,
|
|
458
458
|
t.position
|
|
459
459
|
)
|
|
460
|
-
)),
|
|
460
|
+
)), vo(i, t.accentColor), ao(o, r, {
|
|
461
461
|
accentColor: t.accentColor,
|
|
462
462
|
colorScheme: t.colorScheme,
|
|
463
463
|
fontFamily: t.fontFamily,
|
|
@@ -481,7 +481,7 @@ async function Na(e = {}) {
|
|
|
481
481
|
".pluno-pa-widget__composer"
|
|
482
482
|
), W = o.querySelector(
|
|
483
483
|
".pluno-pa-widget__attachment-error"
|
|
484
|
-
),
|
|
484
|
+
), Ye = o.querySelector(
|
|
485
485
|
".pluno-pa-widget__billing-status"
|
|
486
486
|
), Be = o.querySelector(
|
|
487
487
|
".pluno-pa-widget__attachments"
|
|
@@ -511,7 +511,7 @@ async function Na(e = {}) {
|
|
|
511
511
|
".pluno-pa-widget__active-users-counter"
|
|
512
512
|
), M = o.querySelector(
|
|
513
513
|
".pluno-pa-widget__timeline"
|
|
514
|
-
),
|
|
514
|
+
), Xe = o.querySelector(
|
|
515
515
|
".pluno-pa-widget__timeline-bottom-sentinel"
|
|
516
516
|
), Ae = o.querySelector(
|
|
517
517
|
".pluno-pa-widget__notify-suggestion"
|
|
@@ -528,13 +528,13 @@ async function Na(e = {}) {
|
|
|
528
528
|
), ne = o.querySelector(
|
|
529
529
|
".pluno-pa-widget__tab-groups-suggestion-dismiss"
|
|
530
530
|
);
|
|
531
|
-
if (!A || !u || !w || !k || !te || !W || !
|
|
531
|
+
if (!A || !u || !w || !k || !te || !W || !Ye || !Be || !ce || !U || !v || !B || !$ || !X || !Le || !K || !ct || !Te || !ue || !ge || !M || !Xe)
|
|
532
532
|
throw new Error("Failed to mount Pluno widget");
|
|
533
533
|
if (t.movableLauncher && !O)
|
|
534
534
|
throw new Error("Failed to mount Pluno widget drag handle");
|
|
535
|
-
U.hidden = !t.attachmentsEnabled, ce.disabled = !t.attachmentsEnabled,
|
|
535
|
+
U.hidden = !t.attachmentsEnabled, ce.disabled = !t.attachmentsEnabled, ho(u), ho(v);
|
|
536
536
|
let b = [], E = null;
|
|
537
|
-
const q = () =>
|
|
537
|
+
const q = () => Xi(
|
|
538
538
|
v,
|
|
539
539
|
o.classList.contains("pluno-pa-widget--open") && !t.loginRequired && !t.signupRequired && !le(t.billingStatus)
|
|
540
540
|
), Fe = () => {
|
|
@@ -547,22 +547,22 @@ async function Na(e = {}) {
|
|
|
547
547
|
), Fe(), D(_.getState()), j(), q();
|
|
548
548
|
}
|
|
549
549
|
);
|
|
550
|
-
},
|
|
551
|
-
if (!t.loginRequired && !t.signupRequired && !t.token && !
|
|
550
|
+
}, Ln = t.loginRequired || t.signupRequired || t.token || t.webSocketFactory ? void 0 : t.tokenProvider ?? (t.tokenEndpoint ? async () => oi(t.tokenEndpoint) : void 0);
|
|
551
|
+
if (!t.loginRequired && !t.signupRequired && !t.token && !Ln && !t.webSocketFactory)
|
|
552
552
|
throw new Error("Pluno widget requires token or tokenEndpoint");
|
|
553
|
-
const
|
|
553
|
+
const ai = window.fetch.bind(window), Pt = ol(t.clientId);
|
|
554
554
|
let _;
|
|
555
555
|
try {
|
|
556
556
|
const a = {
|
|
557
557
|
token: t.token,
|
|
558
|
-
tokenProvider:
|
|
558
|
+
tokenProvider: Ln,
|
|
559
559
|
backendUrl: t.backendUrl,
|
|
560
560
|
metadata: () => ({
|
|
561
561
|
...t.metadata ?? {},
|
|
562
562
|
...!_.getState().sessionId && t.scribbleStyle ? { scribbleStyleStarted: !0 } : {}
|
|
563
563
|
}),
|
|
564
564
|
initialStarterPrompts: t.initialStarterPrompts,
|
|
565
|
-
clientId:
|
|
565
|
+
clientId: Pt.clientId,
|
|
566
566
|
restorePersistedState: t.restorePersistedState,
|
|
567
567
|
expectedPersistedSessionId: t.expectedPersistedSessionId,
|
|
568
568
|
keepRunsActiveOnSessionNavigation: t.keepRunsActiveOnSessionNavigation,
|
|
@@ -573,9 +573,9 @@ async function Na(e = {}) {
|
|
|
573
573
|
autoConnect: !1,
|
|
574
574
|
disableNetworkCapture: !!t.sdkPreviewChannelId
|
|
575
575
|
};
|
|
576
|
-
_ = await
|
|
576
|
+
_ = await Ci.init(a);
|
|
577
577
|
} catch (a) {
|
|
578
|
-
throw
|
|
578
|
+
throw Pt.release(), n.remove(), a;
|
|
579
579
|
}
|
|
580
580
|
m.appendChild(n), Z(
|
|
581
581
|
"web-sdk.widget",
|
|
@@ -587,19 +587,19 @@ async function Na(e = {}) {
|
|
|
587
587
|
cssAccent: o.style.getPropertyValue("--pluno-pa-accent")
|
|
588
588
|
}
|
|
589
589
|
);
|
|
590
|
-
const
|
|
590
|
+
const Nt = new Set(l.openToolGroupKeys), Pe = new Set(
|
|
591
591
|
l.seenShareCandidateIds
|
|
592
|
-
),
|
|
593
|
-
let
|
|
592
|
+
), Ze = new Set(Pe);
|
|
593
|
+
let Rt = l.sharePromptsDisabled || await al(t), oe = null, V = !1, ut = !(t.loginRequired || t.signupRequired), ve = !1, Ne = {
|
|
594
594
|
enabled: !0
|
|
595
|
-
}, Re = 0,
|
|
595
|
+
}, Re = 0, Tn = "", Y = !1, he = !1, Se = [], Mt = null, Je = null;
|
|
596
596
|
const ie = (a, d) => {
|
|
597
597
|
Ne = { enabled: a, reason: d };
|
|
598
598
|
}, ae = () => {
|
|
599
599
|
ue.hidden = !0;
|
|
600
|
-
},
|
|
600
|
+
}, ri = () => {
|
|
601
601
|
ue.hidden = !1;
|
|
602
|
-
},
|
|
602
|
+
}, li = (a = "jump") => {
|
|
603
603
|
ie(!0, a), ae(), st(M, () => Ne.enabled), Re = M.scrollTop;
|
|
604
604
|
}, me = () => {
|
|
605
605
|
if (X.hidden = t.layout === "page" || t.loginRequired, Le.hidden = !Y, X.setAttribute("aria-expanded", String(Y)), K.classList.toggle(
|
|
@@ -621,20 +621,20 @@ async function Na(e = {}) {
|
|
|
621
621
|
);
|
|
622
622
|
const I = document.createElement("small");
|
|
623
623
|
I.className = "pluno-pa-widget__history-path", I.textContent = Qa(a), d.append(f, C, I), d.addEventListener("click", () => {
|
|
624
|
-
Y = !1,
|
|
624
|
+
Y = !1, Je = null, me(), ie(!0, "newSession"), ae(), _.loadSession(a.id), D(_.getState()), q();
|
|
625
625
|
}), K.appendChild(d);
|
|
626
626
|
}
|
|
627
627
|
if (he && Se.length > 0) {
|
|
628
628
|
const a = document.createElement("p");
|
|
629
629
|
a.className = "pluno-pa-widget__history-loading pluno-pa-widget__history-loading--inline", a.textContent = "Loading...", K.appendChild(a);
|
|
630
630
|
}
|
|
631
|
-
Te.textContent =
|
|
632
|
-
},
|
|
631
|
+
Te.textContent = Je ?? (!he && Se.length === 0 ? "No recent chats for this page yet." : ""), Te.hidden = Te.textContent.length === 0;
|
|
632
|
+
}, An = async (a) => {
|
|
633
633
|
if (!he) {
|
|
634
|
-
he = !0,
|
|
634
|
+
he = !0, Je = null, me();
|
|
635
635
|
try {
|
|
636
636
|
const d = await _.listSessions({ cursor: a, limit: 20 });
|
|
637
|
-
Se = a ? [...Se, ...d.sessions] : d.sessions,
|
|
637
|
+
Se = a ? [...Se, ...d.sessions] : d.sessions, Mt = d.nextCursor;
|
|
638
638
|
} catch (d) {
|
|
639
639
|
Z(
|
|
640
640
|
"web-sdk.widget",
|
|
@@ -642,25 +642,25 @@ async function Na(e = {}) {
|
|
|
642
642
|
{
|
|
643
643
|
message: d instanceof Error ? d.message : String(d)
|
|
644
644
|
}
|
|
645
|
-
),
|
|
645
|
+
), Je = _a;
|
|
646
646
|
} finally {
|
|
647
647
|
he = !1, me();
|
|
648
648
|
}
|
|
649
649
|
}
|
|
650
|
-
},
|
|
651
|
-
!
|
|
652
|
-
},
|
|
653
|
-
V || typeof document > "u" || (
|
|
654
|
-
},
|
|
655
|
-
|
|
650
|
+
}, si = () => {
|
|
651
|
+
!Mt || he || K.scrollHeight - K.scrollTop - K.clientHeight <= 24 && An(Mt);
|
|
652
|
+
}, In = () => {
|
|
653
|
+
V || typeof document > "u" || (vo(i, t.accentColor), n.isConnected || (t.mountTarget?.isConnected ? t.mountTarget.appendChild(n) : t.mountTarget || y.body?.appendChild(n)));
|
|
654
|
+
}, Pn = new MutationObserver(In);
|
|
655
|
+
Pn.observe(y.documentElement, {
|
|
656
656
|
childList: !0,
|
|
657
657
|
subtree: !0
|
|
658
|
-
}),
|
|
659
|
-
const
|
|
660
|
-
const d =
|
|
661
|
-
return
|
|
658
|
+
}), In();
|
|
659
|
+
const Qe = (a = !0) => {
|
|
660
|
+
const d = Tt(o, a);
|
|
661
|
+
return wn(
|
|
662
662
|
o,
|
|
663
|
-
s ?
|
|
663
|
+
s ? Ct(s, d) : Wa(
|
|
664
664
|
o,
|
|
665
665
|
t.position,
|
|
666
666
|
d
|
|
@@ -678,32 +678,32 @@ async function Na(e = {}) {
|
|
|
678
678
|
composerValue: v.value,
|
|
679
679
|
focusedInput: a,
|
|
680
680
|
focusedInputAt: a ? Date.now() : null,
|
|
681
|
-
openToolGroupKeys: [...
|
|
681
|
+
openToolGroupKeys: [...Nt],
|
|
682
682
|
launcherPosition: c ? s : null,
|
|
683
683
|
panelSize: g,
|
|
684
684
|
seenShareCandidateIds: [...Pe].slice(
|
|
685
|
-
-
|
|
685
|
+
-Io
|
|
686
686
|
),
|
|
687
|
-
sharePromptsDisabled:
|
|
687
|
+
sharePromptsDisabled: Rt
|
|
688
688
|
});
|
|
689
689
|
}, gt = (a) => {
|
|
690
690
|
t.onDisplayStateChange?.(a);
|
|
691
|
-
},
|
|
692
|
-
if (
|
|
693
|
-
o.classList.remove("pluno-pa-widget--minimized"), A.removeAttribute("tabindex"), !o.classList.contains("pluno-pa-widget--open") && !o.classList.contains("pluno-pa-widget--closing") &&
|
|
691
|
+
}, et = (a, d = !0) => {
|
|
692
|
+
if (So(t, a), a === "shown") {
|
|
693
|
+
o.classList.remove("pluno-pa-widget--minimized"), A.removeAttribute("tabindex"), !o.classList.contains("pluno-pa-widget--open") && !o.classList.contains("pluno-pa-widget--closing") && tt(!1), d && gt("shown");
|
|
694
694
|
return;
|
|
695
695
|
}
|
|
696
696
|
oe !== null && (window.clearTimeout(oe), oe = null), o.classList.remove("pluno-pa-widget--open"), o.classList.remove("pluno-pa-widget--closing"), o.classList.add("pluno-pa-widget--minimized"), A.hidden = !1, w.hidden = !0, k.hidden = !0, A.tabIndex = 0, v.value = "", Oe(
|
|
697
697
|
o,
|
|
698
|
-
|
|
698
|
+
en(
|
|
699
699
|
o,
|
|
700
700
|
s,
|
|
701
701
|
t.position
|
|
702
702
|
)
|
|
703
|
-
),
|
|
703
|
+
), co(o), H(), d && gt("minimized");
|
|
704
704
|
}, Me = (a, d = {}) => {
|
|
705
705
|
ja(a, {
|
|
706
|
-
debugVersion:
|
|
706
|
+
debugVersion: Pa,
|
|
707
707
|
launcherPosition: s,
|
|
708
708
|
rootClasses: o.className,
|
|
709
709
|
rootStyle: {
|
|
@@ -712,38 +712,38 @@ async function Na(e = {}) {
|
|
|
712
712
|
right: o.style.right,
|
|
713
713
|
bottom: o.style.bottom
|
|
714
714
|
},
|
|
715
|
-
rootRect:
|
|
716
|
-
launcherRect:
|
|
717
|
-
panelRect:
|
|
715
|
+
rootRect: nn(o),
|
|
716
|
+
launcherRect: nn(A),
|
|
717
|
+
panelRect: nn(w),
|
|
718
718
|
viewport: ee(),
|
|
719
719
|
panelHidden: w.hidden,
|
|
720
720
|
closeHidden: k.hidden,
|
|
721
721
|
...d
|
|
722
722
|
});
|
|
723
|
-
},
|
|
723
|
+
}, tt = (a = !0) => {
|
|
724
724
|
if (!s)
|
|
725
|
-
return Oe(o, null),
|
|
726
|
-
const d =
|
|
725
|
+
return Oe(o, null), Qe(a);
|
|
726
|
+
const d = Qe(a);
|
|
727
727
|
return Oe(o, d), Me("Applied stored closed launcher position", {
|
|
728
728
|
visibleLauncherPosition: d
|
|
729
729
|
}), d;
|
|
730
|
-
},
|
|
730
|
+
}, zt = (a, d) => {
|
|
731
731
|
if (!a || !d) {
|
|
732
|
-
|
|
732
|
+
co(o);
|
|
733
733
|
return;
|
|
734
734
|
}
|
|
735
735
|
qa(o, {
|
|
736
736
|
x: a.x - d.x,
|
|
737
737
|
y: a.y - d.y
|
|
738
738
|
});
|
|
739
|
-
},
|
|
740
|
-
const a =
|
|
739
|
+
}, Dt = () => {
|
|
740
|
+
const a = Ve(g).width;
|
|
741
741
|
return t.layout === "page" && w.getBoundingClientRect().width || a;
|
|
742
|
-
},
|
|
742
|
+
}, Nn = () => {
|
|
743
743
|
if (o.classList.contains("pluno-pa-widget--minimized")) {
|
|
744
744
|
Oe(
|
|
745
745
|
o,
|
|
746
|
-
|
|
746
|
+
en(
|
|
747
747
|
o,
|
|
748
748
|
s,
|
|
749
749
|
t.position
|
|
@@ -751,16 +751,16 @@ async function Na(e = {}) {
|
|
|
751
751
|
);
|
|
752
752
|
return;
|
|
753
753
|
}
|
|
754
|
-
const a =
|
|
754
|
+
const a = tt();
|
|
755
755
|
if (o.classList.contains("pluno-pa-widget--open") || o.classList.contains("pluno-pa-widget--closing")) {
|
|
756
|
-
|
|
757
|
-
const d =
|
|
758
|
-
|
|
756
|
+
Qt(o, g);
|
|
757
|
+
const d = Ve(g);
|
|
758
|
+
an(
|
|
759
759
|
R,
|
|
760
|
-
|
|
760
|
+
Dt()
|
|
761
761
|
);
|
|
762
|
-
const f =
|
|
763
|
-
h
|
|
762
|
+
const f = Et(
|
|
763
|
+
h ? Ct(h, d) : tn(
|
|
764
764
|
o,
|
|
765
765
|
a,
|
|
766
766
|
t.position,
|
|
@@ -768,7 +768,7 @@ async function Na(e = {}) {
|
|
|
768
768
|
),
|
|
769
769
|
d
|
|
770
770
|
);
|
|
771
|
-
|
|
771
|
+
zt(f, a), Me(
|
|
772
772
|
"Applied open panel position after viewport resize",
|
|
773
773
|
{ openPanelPosition: f }
|
|
774
774
|
);
|
|
@@ -777,20 +777,20 @@ async function Na(e = {}) {
|
|
|
777
777
|
{ visibleLauncherPosition: a }
|
|
778
778
|
);
|
|
779
779
|
};
|
|
780
|
-
let
|
|
780
|
+
let Rn = () => {
|
|
781
781
|
};
|
|
782
|
-
window.addEventListener("resize",
|
|
782
|
+
window.addEventListener("resize", Nn), t.movableLauncher && O ? (tt(), Rn = Ua({
|
|
783
783
|
root: o,
|
|
784
784
|
launcher: A,
|
|
785
785
|
launcherDragHandle: O,
|
|
786
|
-
getPosition: () =>
|
|
786
|
+
getPosition: () => Qe(),
|
|
787
787
|
setPosition: (a) => {
|
|
788
|
-
const d = a, f =
|
|
788
|
+
const d = a, f = Tt(o), C = wn(
|
|
789
789
|
o,
|
|
790
790
|
a,
|
|
791
791
|
f
|
|
792
792
|
);
|
|
793
|
-
s =
|
|
793
|
+
s = po(
|
|
794
794
|
C,
|
|
795
795
|
f
|
|
796
796
|
), Oe(o, C), Me("Dragging closed launcher", {
|
|
@@ -800,12 +800,12 @@ async function Na(e = {}) {
|
|
|
800
800
|
persist: () => {
|
|
801
801
|
c = !0, H(), Me("Persisted closed launcher drag position");
|
|
802
802
|
}
|
|
803
|
-
})) : Oe(o, null),
|
|
804
|
-
const
|
|
805
|
-
const a =
|
|
803
|
+
})) : Oe(o, null), Qt(o, g);
|
|
804
|
+
const pi = () => {
|
|
805
|
+
const a = Ve(g), d = Qe();
|
|
806
806
|
return {
|
|
807
|
-
position:
|
|
808
|
-
h
|
|
807
|
+
position: Et(
|
|
808
|
+
h ? Ct(h, a) : tn(
|
|
809
809
|
o,
|
|
810
810
|
d,
|
|
811
811
|
t.position,
|
|
@@ -815,38 +815,43 @@ async function Na(e = {}) {
|
|
|
815
815
|
),
|
|
816
816
|
size: a
|
|
817
817
|
};
|
|
818
|
-
},
|
|
819
|
-
g =
|
|
818
|
+
}, di = (a) => {
|
|
819
|
+
g = At(a.size), Qt(o, g), an(
|
|
820
820
|
R,
|
|
821
|
-
|
|
822
|
-
)
|
|
821
|
+
Dt()
|
|
822
|
+
);
|
|
823
|
+
const d = Et(
|
|
823
824
|
a.position,
|
|
824
|
-
|
|
825
|
+
Ve(g)
|
|
825
826
|
);
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
827
|
+
h = po(
|
|
828
|
+
d,
|
|
829
|
+
Ve(g)
|
|
830
|
+
);
|
|
831
|
+
const f = Qe();
|
|
832
|
+
zt(d, f);
|
|
833
|
+
}, ci = z.length > 0 ? Ba({
|
|
829
834
|
root: o,
|
|
830
835
|
handles: z,
|
|
831
|
-
getBounds:
|
|
832
|
-
setBounds:
|
|
836
|
+
getBounds: pi,
|
|
837
|
+
setBounds: di,
|
|
833
838
|
persist: H
|
|
834
839
|
}) : () => {
|
|
835
840
|
};
|
|
836
|
-
let
|
|
837
|
-
const
|
|
838
|
-
if (!(!t.billingStatusLoader ||
|
|
839
|
-
|
|
841
|
+
let Ot = !1;
|
|
842
|
+
const Mn = async () => {
|
|
843
|
+
if (!(!t.billingStatusLoader || Ot)) {
|
|
844
|
+
Ot = !0;
|
|
840
845
|
try {
|
|
841
846
|
const a = await t.billingStatusLoader();
|
|
842
847
|
if (V)
|
|
843
848
|
return;
|
|
844
|
-
|
|
849
|
+
fo(
|
|
845
850
|
t.billingStatus,
|
|
846
851
|
a,
|
|
847
852
|
_.getState().lastErrorCode
|
|
848
|
-
) && (t.billingStatus = a,
|
|
849
|
-
|
|
853
|
+
) && (t.billingStatus = a, ln(
|
|
854
|
+
Ye,
|
|
850
855
|
t.billingStatus,
|
|
851
856
|
_.getState().lastErrorCode
|
|
852
857
|
), j());
|
|
@@ -857,34 +862,34 @@ async function Na(e = {}) {
|
|
|
857
862
|
{ message: a instanceof Error ? a.message : String(a) }
|
|
858
863
|
);
|
|
859
864
|
} finally {
|
|
860
|
-
|
|
865
|
+
Ot = !1;
|
|
861
866
|
}
|
|
862
867
|
}
|
|
863
868
|
}, fe = (a = "", d = !0, f = !0) => {
|
|
864
|
-
|
|
869
|
+
Mn(), ot && (ot = !1, Ft()), o.classList.contains("pluno-pa-widget--open") || (h = null), oe !== null && (window.clearTimeout(oe), oe = null), et("shown", !1), w.hidden = !1, k.hidden = !1, an(
|
|
865
870
|
R,
|
|
866
|
-
|
|
871
|
+
Dt()
|
|
867
872
|
), o.classList.remove("pluno-pa-widget--closing");
|
|
868
|
-
const C =
|
|
873
|
+
const C = tt(), I = tn(
|
|
869
874
|
o,
|
|
870
875
|
C,
|
|
871
876
|
t.position,
|
|
872
877
|
g
|
|
873
878
|
);
|
|
874
|
-
if (
|
|
879
|
+
if (zt(I, C), Me("Opening launcher at clamped open panel position", {
|
|
875
880
|
openPanelPosition: I,
|
|
876
881
|
visibleLauncherPosition: C
|
|
877
882
|
}), ie(!0, "open"), ae(), !d) {
|
|
878
|
-
o.classList.add("pluno-pa-widget--open"), A.hidden = !0, a && (v.value = a,
|
|
883
|
+
o.classList.add("pluno-pa-widget--open"), A.hidden = !0, a && (v.value = a, lt(v)), st(M, () => Ne.enabled), Re = M.scrollTop, f && (v.focus(), v.setSelectionRange(v.value.length, v.value.length)), H(), gt("shown"), t.onPanelOpenChange?.(!0);
|
|
879
884
|
return;
|
|
880
885
|
}
|
|
881
886
|
window.requestAnimationFrame(() => {
|
|
882
|
-
o.classList.add("pluno-pa-widget--open"), a && (v.value = a,
|
|
887
|
+
o.classList.add("pluno-pa-widget--open"), a && (v.value = a, lt(v)), st(M, () => Ne.enabled), Re = M.scrollTop, f && (v.focus(), v.setSelectionRange(v.value.length, v.value.length)), H(), gt("shown"), t.onPanelOpenChange?.(!0), oe = window.setTimeout(() => {
|
|
883
888
|
A.hidden = !0, st(M, () => Ne.enabled), Re = M.scrollTop;
|
|
884
889
|
}, 220);
|
|
885
890
|
});
|
|
886
|
-
},
|
|
887
|
-
oe !== null && (window.clearTimeout(oe), oe = null), A.hidden = !1, s && (
|
|
891
|
+
}, Ut = () => {
|
|
892
|
+
oe !== null && (window.clearTimeout(oe), oe = null), A.hidden = !1, s && (tt(!1), Me("Closing launcher at stored position")), o.classList.remove("pluno-pa-widget--open"), o.classList.add("pluno-pa-widget--closing"), H(), t.onPanelOpenChange?.(!1), oe = window.setTimeout(() => {
|
|
888
893
|
w.hidden = !0, k.hidden = !0, h = null, o.classList.remove("pluno-pa-widget--closing");
|
|
889
894
|
}, 220);
|
|
890
895
|
};
|
|
@@ -902,21 +907,21 @@ async function Na(e = {}) {
|
|
|
902
907
|
const a = u.value;
|
|
903
908
|
fe(a), u.value = "";
|
|
904
909
|
});
|
|
905
|
-
let
|
|
906
|
-
const
|
|
910
|
+
let Bt = null, ht = null, ze = null;
|
|
911
|
+
const zn = (a) => a === u || a === v, ui = (a) => {
|
|
907
912
|
if (!(a instanceof Element) || a.getRootNode() === o.getRootNode())
|
|
908
913
|
return null;
|
|
909
914
|
let d = a;
|
|
910
915
|
for (; d; ) {
|
|
911
|
-
const f = d.closest(
|
|
916
|
+
const f = d.closest(Jn);
|
|
912
917
|
if (f)
|
|
913
918
|
return f;
|
|
914
919
|
const C = d.getRootNode();
|
|
915
920
|
d = C instanceof ShadowRoot ? C.host : null;
|
|
916
921
|
}
|
|
917
922
|
return null;
|
|
918
|
-
},
|
|
919
|
-
if (!a.isConnected || !a.matches(
|
|
923
|
+
}, gi = (a) => {
|
|
924
|
+
if (!a.isConnected || !a.matches(Jn))
|
|
920
925
|
return !1;
|
|
921
926
|
if (!(a instanceof HTMLElement))
|
|
922
927
|
return !0;
|
|
@@ -926,31 +931,31 @@ async function Na(e = {}) {
|
|
|
926
931
|
return a.checkVisibility();
|
|
927
932
|
const d = window.getComputedStyle(a);
|
|
928
933
|
return d.display !== "none" && d.visibility !== "hidden";
|
|
929
|
-
},
|
|
934
|
+
}, Dn = (a) => {
|
|
930
935
|
We !== a && (We = a, o.classList.toggle(
|
|
931
936
|
"pluno-pa-widget--host-modal-conflict",
|
|
932
937
|
a !== null
|
|
933
938
|
), De(), a !== null ? ze = window.setInterval(() => {
|
|
934
939
|
const d = We;
|
|
935
|
-
(!d || !
|
|
936
|
-
},
|
|
937
|
-
},
|
|
940
|
+
(!d || !gi(d)) && Dn(null);
|
|
941
|
+
}, ba) : ze !== null && (window.clearInterval(ze), ze = null, ht = null));
|
|
942
|
+
}, hi = () => {
|
|
938
943
|
ze !== null && (window.clearInterval(ze), ze = null);
|
|
939
944
|
};
|
|
940
945
|
o.addEventListener("focusin", (a) => {
|
|
941
|
-
|
|
946
|
+
zn(a.target) && (Bt = Date.now(), H());
|
|
942
947
|
}), o.addEventListener("focusout", (a) => {
|
|
943
|
-
if (!
|
|
948
|
+
if (!zn(a.target) || We !== null)
|
|
944
949
|
return;
|
|
945
|
-
const d =
|
|
946
|
-
if (
|
|
950
|
+
const d = Bt;
|
|
951
|
+
if (Bt = null, d === null || Date.now() - d > fa)
|
|
947
952
|
return;
|
|
948
|
-
const f =
|
|
953
|
+
const f = ui(a.relatedTarget);
|
|
949
954
|
if (!f)
|
|
950
955
|
return;
|
|
951
956
|
const C = Date.now();
|
|
952
|
-
if (ht !== null && C - ht <=
|
|
953
|
-
|
|
957
|
+
if (ht !== null && C - ht <= wa) {
|
|
958
|
+
Dn(f);
|
|
954
959
|
return;
|
|
955
960
|
}
|
|
956
961
|
ht = C;
|
|
@@ -959,38 +964,38 @@ async function Na(e = {}) {
|
|
|
959
964
|
}), F?.addEventListener("pointerdown", (a) => {
|
|
960
965
|
a.stopPropagation();
|
|
961
966
|
}), F?.addEventListener("click", (a) => {
|
|
962
|
-
a.preventDefault(), a.stopPropagation(),
|
|
963
|
-
}), k.addEventListener("click",
|
|
967
|
+
a.preventDefault(), a.stopPropagation(), et("minimized");
|
|
968
|
+
}), k.addEventListener("click", Ut), M.addEventListener("scroll", () => {
|
|
964
969
|
M.scrollTop < Re - 1 && ie(!1, "userScroll"), Re = M.scrollTop;
|
|
965
970
|
}), ue.addEventListener("click", () => {
|
|
966
|
-
|
|
971
|
+
li();
|
|
967
972
|
});
|
|
968
|
-
const
|
|
973
|
+
const On = typeof IntersectionObserver > "u" ? null : new IntersectionObserver(
|
|
969
974
|
([a]) => {
|
|
970
975
|
a?.isIntersecting && (ie(!0, "bottom"), ae());
|
|
971
976
|
},
|
|
972
977
|
{ root: M, threshold: 0 }
|
|
973
978
|
);
|
|
974
|
-
|
|
975
|
-
const
|
|
976
|
-
let We = null,
|
|
979
|
+
On?.observe(Xe);
|
|
980
|
+
const nt = () => t.loginRequired || t.signupRequired;
|
|
981
|
+
let We = null, ot = !1;
|
|
977
982
|
const re = () => ut || _.getState().status !== "connected", De = () => {
|
|
978
|
-
const a =
|
|
979
|
-
u.readOnly = !1, v.readOnly = !1, u.placeholder = d ?
|
|
983
|
+
const a = nt(), d = We !== null;
|
|
984
|
+
u.readOnly = !1, v.readOnly = !1, u.placeholder = d ? Qn : a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : ot ? "New update" : t.launcherLabel, v.placeholder = d ? Qn : a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : _e.launcherLabel, te.hidden = a;
|
|
980
985
|
}, j = () => {
|
|
981
|
-
B.disabled = re() || le(t.billingStatus) || !_.getState().isThinking && v.value.trim().length === 0 && b.length === 0, U.disabled =
|
|
986
|
+
B.disabled = re() || le(t.billingStatus) || !_.getState().isThinking && v.value.trim().length === 0 && b.length === 0, U.disabled = nt() || re() || le(t.billingStatus);
|
|
982
987
|
};
|
|
983
988
|
De();
|
|
984
|
-
const
|
|
989
|
+
const Ft = () => {
|
|
985
990
|
const a = _.getState().isThinking;
|
|
986
991
|
o.classList.toggle("pluno-pa-widget--thinking", a), o.classList.toggle(
|
|
987
992
|
"pluno-pa-widget--unread",
|
|
988
|
-
!a &&
|
|
993
|
+
!a && ot
|
|
989
994
|
), De();
|
|
990
995
|
};
|
|
991
|
-
|
|
992
|
-
const
|
|
993
|
-
|
|
996
|
+
Ft();
|
|
997
|
+
const Wt = () => {
|
|
998
|
+
nt() || V || (ut = !0, De(), j(), _.connect().then(
|
|
994
999
|
() => {
|
|
995
1000
|
V || (ut = !1, De(), j());
|
|
996
1001
|
},
|
|
@@ -1014,56 +1019,56 @@ async function Na(e = {}) {
|
|
|
1014
1019
|
t.onSignupClick?.();
|
|
1015
1020
|
return;
|
|
1016
1021
|
}
|
|
1017
|
-
re() || le(t.billingStatus) || (ve = !0, ie(!0, "send"), ae(), b =
|
|
1022
|
+
re() || le(t.billingStatus) || (ve = !0, ie(!0, "send"), ae(), b = on(
|
|
1018
1023
|
_,
|
|
1019
1024
|
v,
|
|
1020
1025
|
b,
|
|
1021
1026
|
yt
|
|
1022
1027
|
), Fe(), j());
|
|
1023
1028
|
});
|
|
1024
|
-
let
|
|
1025
|
-
const
|
|
1026
|
-
|
|
1027
|
-
},
|
|
1029
|
+
let it = 0;
|
|
1030
|
+
const mi = () => {
|
|
1031
|
+
it = 0, o.classList.remove("pluno-pa-widget--drag-over");
|
|
1032
|
+
}, Ht = (a) => {
|
|
1028
1033
|
E !== null && window.clearTimeout(E), W.textContent = a, W.hidden = !1, E = window.setTimeout(() => {
|
|
1029
1034
|
W.textContent = "", W.hidden = !0, E = null;
|
|
1030
1035
|
}, 3e3);
|
|
1031
|
-
},
|
|
1036
|
+
}, fi = () => {
|
|
1032
1037
|
E !== null && (window.clearTimeout(E), E = null), W.textContent = "", W.hidden = !0;
|
|
1033
|
-
},
|
|
1038
|
+
}, Gt = async (a) => {
|
|
1034
1039
|
if (!t.attachmentsEnabled || a.length === 0)
|
|
1035
1040
|
return;
|
|
1036
1041
|
const d = Cr(_, a);
|
|
1037
|
-
if (b = [...b, ...d], Fe(),
|
|
1042
|
+
if (b = [...b, ...d], Fe(), fi(), j(), D(_.getState()), !o.classList.contains("pluno-pa-widget--open")) {
|
|
1038
1043
|
fe();
|
|
1039
1044
|
return;
|
|
1040
1045
|
}
|
|
1041
1046
|
q();
|
|
1042
|
-
},
|
|
1043
|
-
await
|
|
1047
|
+
}, wi = async (a) => {
|
|
1048
|
+
await Gt(a), !(a.length === 0 || We !== null) && v.focus();
|
|
1044
1049
|
};
|
|
1045
1050
|
U.addEventListener("click", () => {
|
|
1046
1051
|
t.loginRequired || re() || le(t.billingStatus) || ce.click();
|
|
1047
1052
|
}), ce.addEventListener("change", () => {
|
|
1048
1053
|
const a = Array.from(ce.files ?? []);
|
|
1049
|
-
ce.value = "",
|
|
1050
|
-
|
|
1054
|
+
ce.value = "", wi(a).catch((d) => {
|
|
1055
|
+
Ht(
|
|
1051
1056
|
d instanceof Error ? d.message : "Failed to attach file"
|
|
1052
1057
|
), Z("web-sdk.widget", "Attachment failed", {
|
|
1053
1058
|
message: d instanceof Error ? d.message : String(d)
|
|
1054
1059
|
});
|
|
1055
1060
|
});
|
|
1056
1061
|
}), o.addEventListener("dragenter", (a) => {
|
|
1057
|
-
!t.attachmentsEnabled || !vt(a.dataTransfer) || t.loginRequired || re() || (a.preventDefault(), a.stopPropagation(),
|
|
1062
|
+
!t.attachmentsEnabled || !vt(a.dataTransfer) || t.loginRequired || re() || (a.preventDefault(), a.stopPropagation(), it += 1, o.classList.add("pluno-pa-widget--drag-over"));
|
|
1058
1063
|
}), o.addEventListener("dragover", (a) => {
|
|
1059
1064
|
const d = a.dataTransfer;
|
|
1060
1065
|
!t.attachmentsEnabled || !vt(d) || t.loginRequired || re() || (a.preventDefault(), a.stopPropagation(), d.dropEffect = "copy");
|
|
1061
1066
|
}), o.addEventListener("dragleave", (a) => {
|
|
1062
|
-
vt(a.dataTransfer) && (a.stopPropagation(),
|
|
1067
|
+
vt(a.dataTransfer) && (a.stopPropagation(), it = Math.max(0, it - 1), it === 0 && o.classList.remove("pluno-pa-widget--drag-over"));
|
|
1063
1068
|
}), o.addEventListener("drop", (a) => {
|
|
1064
1069
|
const d = a.dataTransfer;
|
|
1065
|
-
!t.attachmentsEnabled || !vt(d) || t.loginRequired || re() || (a.preventDefault(), a.stopPropagation(),
|
|
1066
|
-
|
|
1070
|
+
!t.attachmentsEnabled || !vt(d) || t.loginRequired || re() || (a.preventDefault(), a.stopPropagation(), mi(), Gt(d.files).catch((f) => {
|
|
1071
|
+
Ht(
|
|
1067
1072
|
f instanceof Error ? f.message : "Failed to attach file"
|
|
1068
1073
|
), Z("web-sdk.widget", "Attachment failed", {
|
|
1069
1074
|
message: f instanceof Error ? f.message : String(f)
|
|
@@ -1072,8 +1077,8 @@ async function Na(e = {}) {
|
|
|
1072
1077
|
}), o.addEventListener("paste", (a) => {
|
|
1073
1078
|
a.stopPropagation();
|
|
1074
1079
|
const d = a.clipboardData, f = Array.from(d?.files ?? []);
|
|
1075
|
-
!t.attachmentsEnabled || f.length === 0 || t.loginRequired || re() || (a.preventDefault(),
|
|
1076
|
-
|
|
1080
|
+
!t.attachmentsEnabled || f.length === 0 || t.loginRequired || re() || (a.preventDefault(), Gt(f).catch((C) => {
|
|
1081
|
+
Ht(
|
|
1077
1082
|
C instanceof Error ? C.message : "Failed to attach file"
|
|
1078
1083
|
), Z("web-sdk.widget", "Attachment failed", {
|
|
1079
1084
|
message: C instanceof Error ? C.message : String(C)
|
|
@@ -1091,25 +1096,25 @@ async function Na(e = {}) {
|
|
|
1091
1096
|
if (re())
|
|
1092
1097
|
return;
|
|
1093
1098
|
const a = v.value.trim().length > 0 || b.length > 0;
|
|
1094
|
-
ve = !0, ie(!0, "send"), ae(), b =
|
|
1099
|
+
ve = !0, ie(!0, "send"), ae(), b = on(
|
|
1095
1100
|
_,
|
|
1096
1101
|
v,
|
|
1097
1102
|
b,
|
|
1098
1103
|
yt
|
|
1099
1104
|
), Fe(), j(), D(_.getState()), a && q();
|
|
1100
1105
|
}), X.addEventListener("click", () => {
|
|
1101
|
-
Y = !Y,
|
|
1106
|
+
Y = !Y, Je = null, me(), Y && Se.length === 0 && An(null), Y || q();
|
|
1102
1107
|
}), ct.addEventListener("click", () => {
|
|
1103
1108
|
Y = !1, me(), q();
|
|
1104
|
-
}), K.addEventListener("scroll",
|
|
1105
|
-
|
|
1109
|
+
}), K.addEventListener("scroll", si), v.addEventListener("input", () => {
|
|
1110
|
+
lt(v), H(), j(), xi();
|
|
1106
1111
|
}), v.addEventListener("keydown", (a) => {
|
|
1107
1112
|
if (!(a.key !== "Enter" || a.shiftKey)) {
|
|
1108
1113
|
if (a.preventDefault(), t.loginRequired) {
|
|
1109
1114
|
t.onLoginClick?.();
|
|
1110
1115
|
return;
|
|
1111
1116
|
}
|
|
1112
|
-
re() || (ve = !0, ie(!0, "send"), ae(), b =
|
|
1117
|
+
re() || (ve = !0, ie(!0, "send"), ae(), b = on(
|
|
1113
1118
|
_,
|
|
1114
1119
|
v,
|
|
1115
1120
|
b,
|
|
@@ -1118,9 +1123,9 @@ async function Na(e = {}) {
|
|
|
1118
1123
|
}
|
|
1119
1124
|
}), o.addEventListener("click", (a) => {
|
|
1120
1125
|
const d = a.target instanceof Element ? a.target : null;
|
|
1121
|
-
d?.closest("a[href]") && H(), Y &&
|
|
1126
|
+
d?.closest("a[href]") && H(), Y && Yi(d, Le, X) && (Y = !1, me());
|
|
1122
1127
|
const C = window.getSelection(), I = !!(C && !C.isCollapsed && C.anchorNode && o.contains(C.anchorNode));
|
|
1123
|
-
|
|
1128
|
+
Ki(a.target, a.detail, I) && q();
|
|
1124
1129
|
}), o.addEventListener("copy", (a) => {
|
|
1125
1130
|
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(
|
|
1126
1131
|
"text/plain",
|
|
@@ -1139,33 +1144,33 @@ async function Na(e = {}) {
|
|
|
1139
1144
|
return;
|
|
1140
1145
|
}
|
|
1141
1146
|
a.key !== "Escape" || !Y || (Y = !1, me(), q());
|
|
1142
|
-
}), l.composerValue && (v.value = l.composerValue,
|
|
1147
|
+
}), l.composerValue && (v.value = l.composerValue, lt(v)), t.layout === "page" ? fe(v.value, !1) : p === "minimized" ? et("minimized", !1) : t.initialDisplayState === void 0 && l.isOpen && fe(v.value, !1, !1), Va(l, o, u, v);
|
|
1143
1148
|
const mt = () => r;
|
|
1144
|
-
let
|
|
1145
|
-
const
|
|
1149
|
+
let $t = _.getState().appearance !== null, ft = null, at = null, Un = _.getState().isThinking, He = null;
|
|
1150
|
+
const rt = t.taskNotifications;
|
|
1146
1151
|
let Ge = null, $e = !1;
|
|
1147
|
-
const
|
|
1152
|
+
const Bn = () => {
|
|
1148
1153
|
Ge !== null && (window.clearTimeout(Ge), Ge = null);
|
|
1149
1154
|
}, wt = () => {
|
|
1150
1155
|
Ae && (Ae.hidden = !0);
|
|
1151
|
-
},
|
|
1152
|
-
if (!
|
|
1156
|
+
}, Fn = () => _.getState().assistantDraft.trim().length > 0, bi = async () => {
|
|
1157
|
+
if (!rt || !Ae || $e || V || !_.getState().isThinking || Fn())
|
|
1153
1158
|
return;
|
|
1154
1159
|
let a;
|
|
1155
1160
|
try {
|
|
1156
|
-
a = await
|
|
1161
|
+
a = await rt.getState();
|
|
1157
1162
|
} catch {
|
|
1158
1163
|
return;
|
|
1159
1164
|
}
|
|
1160
|
-
a.enabled || a.neverSuggest || !_.getState().isThinking ||
|
|
1165
|
+
a.enabled || a.neverSuggest || !_.getState().isThinking || Fn() || $e || V || (Ae.hidden = !1);
|
|
1161
1166
|
};
|
|
1162
1167
|
Ie?.addEventListener("click", () => {
|
|
1163
|
-
$e = !0, wt(),
|
|
1168
|
+
$e = !0, wt(), rt?.enable().catch(() => {
|
|
1164
1169
|
});
|
|
1165
1170
|
}), S?.addEventListener("click", () => {
|
|
1166
1171
|
$e = !0, wt();
|
|
1167
1172
|
}), L?.addEventListener("click", () => {
|
|
1168
|
-
$e = !0, wt(),
|
|
1173
|
+
$e = !0, wt(), rt?.dismissForever().catch(() => {
|
|
1169
1174
|
});
|
|
1170
1175
|
});
|
|
1171
1176
|
const bt = t.tabGroups;
|
|
@@ -1187,14 +1192,14 @@ async function Na(e = {}) {
|
|
|
1187
1192
|
qe = !1, _t();
|
|
1188
1193
|
});
|
|
1189
1194
|
}), _t();
|
|
1190
|
-
let je = null,
|
|
1195
|
+
let je = null, Wn = () => {
|
|
1191
1196
|
};
|
|
1192
|
-
const
|
|
1193
|
-
const a = je !== null &&
|
|
1194
|
-
ge.hidden = !a, a && je !== null &&
|
|
1197
|
+
const _i = !!(t.sdkPreviewChannelId && t.referralLinkLoader), qt = /* @__PURE__ */ new Map(), jt = () => v.value.trim().length > 0 || b.length > 0, xi = () => {
|
|
1198
|
+
const a = je !== null && sn(_.getState(), jt());
|
|
1199
|
+
ge.hidden = !a, a && je !== null && Wo(ge, je);
|
|
1195
1200
|
};
|
|
1196
1201
|
let Ke = null;
|
|
1197
|
-
const we = /* @__PURE__ */ new Map(), xt = /* @__PURE__ */ new Set(),
|
|
1202
|
+
const we = /* @__PURE__ */ new Map(), xt = /* @__PURE__ */ new Set(), yi = async (a) => {
|
|
1198
1203
|
if (t.integrationAuthHandler) {
|
|
1199
1204
|
we.set(a.authRequestId, { status: "connecting" }), D(_.getState());
|
|
1200
1205
|
try {
|
|
@@ -1207,31 +1212,31 @@ async function Na(e = {}) {
|
|
|
1207
1212
|
}
|
|
1208
1213
|
D(_.getState());
|
|
1209
1214
|
}
|
|
1210
|
-
},
|
|
1211
|
-
ve = !0, ie(!0, "newSession"), ae(), Y = !1, me(), _.startNewSession(a),
|
|
1215
|
+
}, Kt = (a = {}) => {
|
|
1216
|
+
ve = !0, ie(!0, "newSession"), ae(), Y = !1, me(), _.startNewSession(a), Nt.clear(), we.clear(), xt.clear(), v.value = "", b = [], Fe(), lt(v), H(), j(), v.focus(), D(_.getState());
|
|
1212
1217
|
}, yt = () => {
|
|
1213
|
-
t.morningReport !== null && (t.morningReport = null, t.onMorningReportTaskStart?.(),
|
|
1214
|
-
},
|
|
1218
|
+
t.morningReport !== null && (t.morningReport = null, t.onMorningReportTaskStart?.(), Kt());
|
|
1219
|
+
}, Vt = (a) => {
|
|
1215
1220
|
if (!a || t.layout === "page") {
|
|
1216
1221
|
Ke?.remove(), Ke = null;
|
|
1217
1222
|
return;
|
|
1218
1223
|
}
|
|
1219
|
-
Ke || (Ke =
|
|
1224
|
+
Ke || (Ke = It(
|
|
1220
1225
|
"pluno-pa-widget__new-chat",
|
|
1221
1226
|
"New chat",
|
|
1222
1227
|
gr(),
|
|
1223
1228
|
!1
|
|
1224
|
-
), Ke.addEventListener("click", () =>
|
|
1229
|
+
), Ke.addEventListener("click", () => Kt()), $.insertBefore(Ke, X));
|
|
1225
1230
|
}, D = (a) => {
|
|
1226
|
-
if (me(),
|
|
1227
|
-
|
|
1231
|
+
if (me(), En(a.lastErrorCode) ? He = a.lastErrorCode : t.billingStatus?.creditsUsed !== null && !le(t.billingStatus) && (He = null), ln(
|
|
1232
|
+
Ye,
|
|
1228
1233
|
t.billingStatus,
|
|
1229
1234
|
He
|
|
1230
1235
|
), t.loginRequired) {
|
|
1231
|
-
|
|
1236
|
+
qt.clear(), xo(
|
|
1232
1237
|
M,
|
|
1233
1238
|
B,
|
|
1234
|
-
|
|
1239
|
+
Vt,
|
|
1235
1240
|
mt,
|
|
1236
1241
|
"Log in to use Pluno on this page.",
|
|
1237
1242
|
t.loginButtonLabel,
|
|
@@ -1241,10 +1246,10 @@ async function Na(e = {}) {
|
|
|
1241
1246
|
return;
|
|
1242
1247
|
}
|
|
1243
1248
|
if (t.signupRequired) {
|
|
1244
|
-
|
|
1249
|
+
qt.clear(), xo(
|
|
1245
1250
|
M,
|
|
1246
1251
|
B,
|
|
1247
|
-
|
|
1252
|
+
Vt,
|
|
1248
1253
|
mt,
|
|
1249
1254
|
"Complete signup to unlock your free trial credits.",
|
|
1250
1255
|
t.signupButtonLabel,
|
|
@@ -1253,22 +1258,22 @@ async function Na(e = {}) {
|
|
|
1253
1258
|
);
|
|
1254
1259
|
return;
|
|
1255
1260
|
}
|
|
1256
|
-
const d = Xa(a), f = d !==
|
|
1257
|
-
|
|
1261
|
+
const d = Xa(a), f = d !== Tn;
|
|
1262
|
+
Tn = d;
|
|
1258
1263
|
const C = ve || Ne.enabled;
|
|
1259
1264
|
ve = !1, Pr(
|
|
1260
1265
|
M,
|
|
1261
|
-
|
|
1266
|
+
Xe,
|
|
1262
1267
|
B,
|
|
1263
|
-
|
|
1268
|
+
Vt,
|
|
1264
1269
|
ge,
|
|
1265
1270
|
a,
|
|
1266
1271
|
je,
|
|
1267
|
-
je !== null &&
|
|
1272
|
+
je !== null && sn(a, jt()),
|
|
1268
1273
|
C,
|
|
1269
1274
|
() => Ne.enabled,
|
|
1270
|
-
|
|
1271
|
-
|
|
1275
|
+
Nt,
|
|
1276
|
+
qt,
|
|
1272
1277
|
H,
|
|
1273
1278
|
mt,
|
|
1274
1279
|
(I) => {
|
|
@@ -1279,41 +1284,41 @@ async function Na(e = {}) {
|
|
|
1279
1284
|
},
|
|
1280
1285
|
t.morningReport,
|
|
1281
1286
|
() => {
|
|
1282
|
-
t.morningReport = null, t.onMorningReportSnooze?.(),
|
|
1287
|
+
t.morningReport = null, t.onMorningReportSnooze?.(), Ut(), D(_.getState());
|
|
1283
1288
|
},
|
|
1284
|
-
|
|
1289
|
+
Wt,
|
|
1285
1290
|
t.attachmentPreviewUrlResolver,
|
|
1286
1291
|
t.integrationAuthHandler ? {
|
|
1287
1292
|
states: we,
|
|
1288
1293
|
initialStatus: t.integrationAuthStatusLoader ? "checking" : "pending",
|
|
1289
1294
|
onConnect: (I) => {
|
|
1290
|
-
|
|
1295
|
+
yi(I);
|
|
1291
1296
|
}
|
|
1292
1297
|
} : void 0,
|
|
1293
|
-
|
|
1294
|
-
dismissedCandidateIds:
|
|
1298
|
+
_i && !Rt ? {
|
|
1299
|
+
dismissedCandidateIds: Ze,
|
|
1295
1300
|
actionCandidate: ft,
|
|
1296
|
-
error:
|
|
1301
|
+
error: at,
|
|
1297
1302
|
characterIconOptions: mt(),
|
|
1298
1303
|
socialPostRewardsUrl: t.socialPostRewardsUrl,
|
|
1299
1304
|
onSeen: (I) => {
|
|
1300
1305
|
Pe.add(I.id), H();
|
|
1301
1306
|
},
|
|
1302
1307
|
onReferralCopy: (I) => {
|
|
1303
|
-
|
|
1308
|
+
vi(I);
|
|
1304
1309
|
},
|
|
1305
1310
|
onSocialShare: (I) => {
|
|
1306
|
-
Pe.add(I.id),
|
|
1311
|
+
Pe.add(I.id), Ze.add(I.id), H();
|
|
1307
1312
|
},
|
|
1308
1313
|
onDismiss: (I) => {
|
|
1309
|
-
Pe.add(I.id),
|
|
1314
|
+
Pe.add(I.id), Ze.add(I.id), H(), at = null, D(_.getState());
|
|
1310
1315
|
},
|
|
1311
1316
|
onDisable: (I) => {
|
|
1312
|
-
|
|
1317
|
+
Rt = !0, Pe.add(I.id), Ze.add(I.id), H(), rl(t, !0), at = null, D(_.getState());
|
|
1313
1318
|
}
|
|
1314
1319
|
} : void 0
|
|
1315
|
-
), C ? (Re = M.scrollTop, ae()) : f && Za(a) &&
|
|
1316
|
-
},
|
|
1320
|
+
), C ? (Re = M.scrollTop, ae()) : f && Za(a) && ri();
|
|
1321
|
+
}, Hn = async (a) => {
|
|
1317
1322
|
if (!t.integrationAuthStatusLoader)
|
|
1318
1323
|
return;
|
|
1319
1324
|
const d = a.messages.map((f) => f.integrationAuthRequest).filter(
|
|
@@ -1341,27 +1346,27 @@ async function Na(e = {}) {
|
|
|
1341
1346
|
})
|
|
1342
1347
|
);
|
|
1343
1348
|
};
|
|
1344
|
-
return
|
|
1349
|
+
return Wn = Wi(
|
|
1345
1350
|
(a) => {
|
|
1346
|
-
je = a, !V &&
|
|
1351
|
+
je = a, !V && sn(_.getState(), jt()) && D(_.getState());
|
|
1347
1352
|
},
|
|
1348
1353
|
{
|
|
1349
1354
|
backendUrl: t.backendUrl,
|
|
1350
|
-
fetcher:
|
|
1355
|
+
fetcher: ai,
|
|
1351
1356
|
loader: t.activeUsersLoader
|
|
1352
1357
|
}
|
|
1353
1358
|
), _.on("state", (a) => {
|
|
1354
1359
|
_t();
|
|
1355
|
-
const d =
|
|
1356
|
-
|
|
1357
|
-
Ge = null,
|
|
1358
|
-
},
|
|
1360
|
+
const d = Un && !a.isThinking;
|
|
1361
|
+
Un = a.isThinking, a.isThinking && !a.assistantDraft.trim() && rt && !$e && Ge === null && Ae?.hidden !== !1 && (Ge = window.setTimeout(() => {
|
|
1362
|
+
Ge = null, bi();
|
|
1363
|
+
}, ta)), (!a.isThinking || a.assistantDraft.trim()) && (Bn(), wt()), d && !o.classList.contains("pluno-pa-widget--open") && (ot = !0), Ft(), a.appearance ? ($t = !0, Z(
|
|
1359
1364
|
"web-sdk.widget",
|
|
1360
1365
|
"Agent state supplied appearance",
|
|
1361
1366
|
{
|
|
1362
1367
|
appearance: a.appearance
|
|
1363
1368
|
}
|
|
1364
|
-
),
|
|
1369
|
+
), Yt(a.appearance, "agent.state.appearance")) : $t && ($t = !1, Z(
|
|
1365
1370
|
"web-sdk.widget",
|
|
1366
1371
|
"Agent state cleared appearance; reverting to configured widget options",
|
|
1367
1372
|
{
|
|
@@ -1369,67 +1374,67 @@ async function Na(e = {}) {
|
|
|
1369
1374
|
fallbackColorScheme: t.colorScheme,
|
|
1370
1375
|
fallbackFontFamily: t.fontFamily
|
|
1371
1376
|
}
|
|
1372
|
-
),
|
|
1373
|
-
}), D(_.getState()),
|
|
1377
|
+
), Yt({}, "agent.state.appearance-cleared")), D(a), Hn(a), j(), d && Mn();
|
|
1378
|
+
}), D(_.getState()), Hn(_.getState()), j(), Wt(), {
|
|
1374
1379
|
agent: _,
|
|
1375
|
-
startNewChat:
|
|
1380
|
+
startNewChat: Kt,
|
|
1376
1381
|
host: n,
|
|
1377
1382
|
updateAppearance: (a) => {
|
|
1378
|
-
a.scribbleStyle !== void 0 && (t.scribbleStyle = a.scribbleStyle),
|
|
1383
|
+
a.scribbleStyle !== void 0 && (t.scribbleStyle = a.scribbleStyle), Yt(a, "widgetHandle.updateAppearance");
|
|
1379
1384
|
},
|
|
1380
1385
|
updateBillingStatus: (a) => {
|
|
1381
1386
|
const d = a ?? null;
|
|
1382
|
-
|
|
1387
|
+
fo(
|
|
1383
1388
|
t.billingStatus,
|
|
1384
1389
|
d,
|
|
1385
1390
|
He
|
|
1386
|
-
) && (t.billingStatus = d, t.billingStatus?.creditsUsed !== null && !le(t.billingStatus) && (He = null),
|
|
1391
|
+
) && (t.billingStatus = d, t.billingStatus?.creditsUsed !== null && !le(t.billingStatus) && (He = null), ln(
|
|
1387
1392
|
o.querySelector(".pluno-pa-widget__billing-status"),
|
|
1388
1393
|
t.billingStatus,
|
|
1389
1394
|
He
|
|
1390
1395
|
), j());
|
|
1391
1396
|
},
|
|
1392
1397
|
updateAuthGate: (a) => {
|
|
1393
|
-
const d =
|
|
1394
|
-
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), De(), D(_.getState()), j(), d && !
|
|
1398
|
+
const d = nt();
|
|
1399
|
+
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), De(), D(_.getState()), j(), d && !nt() && Wt();
|
|
1395
1400
|
},
|
|
1396
1401
|
openPanel: (a) => {
|
|
1397
1402
|
const d = typeof a == "string" ? a : v.value, f = typeof a == "object" ? a.focusComposer !== !1 : !0;
|
|
1398
1403
|
fe(d, !1, f);
|
|
1399
1404
|
},
|
|
1400
|
-
closePanel:
|
|
1405
|
+
closePanel: Ut,
|
|
1401
1406
|
updateDisplayState: (a) => {
|
|
1402
1407
|
if (a === "shown") {
|
|
1403
|
-
|
|
1408
|
+
et("shown", !1);
|
|
1404
1409
|
return;
|
|
1405
1410
|
}
|
|
1406
|
-
|
|
1411
|
+
et("minimized", !1);
|
|
1407
1412
|
},
|
|
1408
1413
|
updateMorningReport: (a) => {
|
|
1409
1414
|
t.morningReport = a ?? null, D(_.getState());
|
|
1410
1415
|
},
|
|
1411
1416
|
destroy: () => {
|
|
1412
|
-
V || (H(), V = !0,
|
|
1417
|
+
V || (H(), V = !0, Pn.disconnect(), On?.disconnect(), hi(), window.removeEventListener("resize", Nn), Rn(), ci(), E !== null && window.clearTimeout(E), Bn(), Wn(), _.destroy(), Pt.release(), n.remove());
|
|
1413
1418
|
}
|
|
1414
1419
|
};
|
|
1415
|
-
async function
|
|
1420
|
+
async function vi(a) {
|
|
1416
1421
|
if (!ft) {
|
|
1417
|
-
ft = a,
|
|
1422
|
+
ft = a, at = null, D(_.getState());
|
|
1418
1423
|
try {
|
|
1419
1424
|
if (!t.referralLinkLoader)
|
|
1420
1425
|
throw new Error("Referral sharing is not available here.");
|
|
1421
1426
|
const d = await t.referralLinkLoader();
|
|
1422
1427
|
if (!d)
|
|
1423
1428
|
throw new Error("Pluno did not return a referral link.");
|
|
1424
|
-
await
|
|
1429
|
+
await Si(d), Pe.add(a.id), Ze.add(a.id), H();
|
|
1425
1430
|
} catch (d) {
|
|
1426
|
-
|
|
1431
|
+
at = d instanceof Error ? d.message : "Could not copy referral link.";
|
|
1427
1432
|
} finally {
|
|
1428
1433
|
ft = null, D(_.getState());
|
|
1429
1434
|
}
|
|
1430
1435
|
}
|
|
1431
1436
|
}
|
|
1432
|
-
async function
|
|
1437
|
+
async function Si(a) {
|
|
1433
1438
|
if (navigator.clipboard?.writeText)
|
|
1434
1439
|
try {
|
|
1435
1440
|
await navigator.clipboard.writeText(a);
|
|
@@ -1445,35 +1450,35 @@ async function Na(e = {}) {
|
|
|
1445
1450
|
f.remove(), d?.isConnected && d.focus({ preventScroll: !0 });
|
|
1446
1451
|
}
|
|
1447
1452
|
}
|
|
1448
|
-
function
|
|
1449
|
-
const f = a.accentColor ?? t.accentColor, C = a.colorScheme ?? t.colorScheme, I = a.fontFamily ?? t.fontFamily,
|
|
1450
|
-
r =
|
|
1453
|
+
function Yt(a, d) {
|
|
1454
|
+
const f = a.accentColor ?? t.accentColor, C = a.colorScheme ?? t.colorScheme, I = a.fontFamily ?? t.fontFamily, Xt = a.scribbleStyle ?? t.scribbleStyle;
|
|
1455
|
+
r = io(
|
|
1451
1456
|
f,
|
|
1452
|
-
|
|
1453
|
-
),
|
|
1457
|
+
Xt
|
|
1458
|
+
), ao(o, r, {
|
|
1454
1459
|
accentColor: f,
|
|
1455
1460
|
colorScheme: C,
|
|
1456
1461
|
fontFamily: I,
|
|
1457
|
-
scribbleStyle:
|
|
1462
|
+
scribbleStyle: Xt
|
|
1458
1463
|
}), Z("web-sdk.widget", "Updated widget appearance", {
|
|
1459
1464
|
source: d,
|
|
1460
1465
|
inputAppearance: a,
|
|
1461
1466
|
appliedAccentColor: f,
|
|
1462
1467
|
appliedColorScheme: C,
|
|
1463
1468
|
appliedFontFamily: I,
|
|
1464
|
-
appliedScribbleStyle:
|
|
1469
|
+
appliedScribbleStyle: Xt,
|
|
1465
1470
|
cssAccent: o.style.getPropertyValue("--pluno-pa-accent")
|
|
1466
1471
|
});
|
|
1467
1472
|
}
|
|
1468
1473
|
}
|
|
1469
|
-
function
|
|
1474
|
+
function io(e, t) {
|
|
1470
1475
|
return { accentColor: e, scribbleStyle: t };
|
|
1471
1476
|
}
|
|
1472
|
-
function Ra(e) {
|
|
1473
|
-
const t = Ma(e);
|
|
1474
|
-
return t === null ? "#fafafa" : za(t) > 0.5 ? "#18181b" : "#fafaf9";
|
|
1475
|
-
}
|
|
1476
1477
|
function Ma(e) {
|
|
1478
|
+
const t = za(e);
|
|
1479
|
+
return t === null ? "#fafafa" : Da(t) > 0.5 ? "#18181b" : "#fafaf9";
|
|
1480
|
+
}
|
|
1481
|
+
function za(e) {
|
|
1477
1482
|
const t = e.trim();
|
|
1478
1483
|
return /^#[0-9a-f]{6}$/i.test(t) ? [
|
|
1479
1484
|
Number.parseInt(t.slice(1, 3), 16),
|
|
@@ -1485,14 +1490,14 @@ function Ma(e) {
|
|
|
1485
1490
|
Number.parseInt(t[3] + t[3], 16)
|
|
1486
1491
|
] : null;
|
|
1487
1492
|
}
|
|
1488
|
-
function
|
|
1493
|
+
function Da([e, t, n]) {
|
|
1489
1494
|
const i = (o) => {
|
|
1490
1495
|
const r = o / 255;
|
|
1491
1496
|
return r <= 0.03928 ? r / 12.92 : ((r + 0.055) / 1.055) ** 2.4;
|
|
1492
1497
|
};
|
|
1493
1498
|
return 0.2126 * i(e) + 0.7152 * i(t) + 0.0722 * i(n);
|
|
1494
1499
|
}
|
|
1495
|
-
function
|
|
1500
|
+
function ao(e, t, n) {
|
|
1496
1501
|
e.classList.toggle(
|
|
1497
1502
|
"pluno-pa-widget--dark",
|
|
1498
1503
|
n.colorScheme === "dark"
|
|
@@ -1500,11 +1505,11 @@ function io(e, t, n) {
|
|
|
1500
1505
|
"pluno-pa-widget--light",
|
|
1501
1506
|
n.colorScheme !== "dark"
|
|
1502
1507
|
), e.classList.toggle("pluno-pa-widget--scribble", n.scribbleStyle);
|
|
1503
|
-
const i = n.scribbleStyle ?
|
|
1508
|
+
const i = n.scribbleStyle ? Lo(n.accentColor) : n.accentColor;
|
|
1504
1509
|
e.style.setProperty("--pluno-pa-accent", i), n.scribbleStyle ? e.style.setProperty(
|
|
1505
1510
|
"--pluno-pa-accent-contrast",
|
|
1506
|
-
|
|
1507
|
-
) : e.style.removeProperty("--pluno-pa-accent-contrast"), e.style.fontFamily = n.scribbleStyle ?
|
|
1511
|
+
Ma(i)
|
|
1512
|
+
) : e.style.removeProperty("--pluno-pa-accent-contrast"), e.style.fontFamily = n.scribbleStyle ? xa : n.fontFamily, n.scribbleStyle && Oa(e.ownerDocument);
|
|
1508
1513
|
const o = Array.from(
|
|
1509
1514
|
e.querySelectorAll(".pluno-pa-widget__character")
|
|
1510
1515
|
);
|
|
@@ -1516,11 +1521,11 @@ function io(e, t, n) {
|
|
|
1516
1521
|
)
|
|
1517
1522
|
);
|
|
1518
1523
|
}
|
|
1519
|
-
function
|
|
1520
|
-
if (e.getElementById(
|
|
1524
|
+
function Oa(e) {
|
|
1525
|
+
if (e.getElementById(eo))
|
|
1521
1526
|
return;
|
|
1522
1527
|
const t = e.createElement("style");
|
|
1523
|
-
t.id =
|
|
1528
|
+
t.id = eo, t.textContent = `@font-face {
|
|
1524
1529
|
font-family: "Architects Daughter";
|
|
1525
1530
|
font-style: normal;
|
|
1526
1531
|
font-weight: 400;
|
|
@@ -1528,7 +1533,7 @@ function Da(e) {
|
|
|
1528
1533
|
src: url("https://fonts.gstatic.com/s/architectsdaughter/v20/KtkxAKiDZI_td1Lkx62xHZHDtgO_Y-bvTYlg4-7jA-U.woff2") format("woff2");
|
|
1529
1534
|
}`, e.head.appendChild(t), e.fonts?.load('16px "Architects Daughter"');
|
|
1530
1535
|
}
|
|
1531
|
-
function
|
|
1536
|
+
function Ua({
|
|
1532
1537
|
root: e,
|
|
1533
1538
|
launcher: t,
|
|
1534
1539
|
launcherDragHandle: n,
|
|
@@ -1546,7 +1551,7 @@ function Oa({
|
|
|
1546
1551
|
return;
|
|
1547
1552
|
w.preventDefault();
|
|
1548
1553
|
const R = w.clientX - p.x, z = w.clientY - p.y;
|
|
1549
|
-
!c && Math.hypot(R, z) <
|
|
1554
|
+
!c && Math.hypot(R, z) < fn || (c = !0, e.classList.add("pluno-pa-widget--dragging"), o({ x: s.x + R, y: s.y + z }));
|
|
1550
1555
|
}, A = (w) => {
|
|
1551
1556
|
l === w.pointerId && (w.preventDefault(), w.stopPropagation(), c && (g = { x: w.clientX, y: w.clientY }, r()), h());
|
|
1552
1557
|
}, O = (w) => {
|
|
@@ -1557,12 +1562,12 @@ function Oa({
|
|
|
1557
1562
|
const R = Math.hypot(
|
|
1558
1563
|
w.clientX - g.x,
|
|
1559
1564
|
w.clientY - g.y
|
|
1560
|
-
) <=
|
|
1565
|
+
) <= fn;
|
|
1561
1566
|
g = null, R && (w.preventDefault(), w.stopPropagation());
|
|
1562
1567
|
}, F = (w) => {
|
|
1563
1568
|
if (e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing"))
|
|
1564
1569
|
return;
|
|
1565
|
-
const R = w.shiftKey ?
|
|
1570
|
+
const R = w.shiftKey ? Oo : Do, z = i();
|
|
1566
1571
|
let k = null;
|
|
1567
1572
|
w.key === "ArrowUp" ? k = { x: z.x, y: z.y - R } : w.key === "ArrowDown" ? k = { x: z.x, y: z.y + R } : w.key === "ArrowLeft" ? k = { x: z.x - R, y: z.y } : w.key === "ArrowRight" && (k = { x: z.x + R, y: z.y }), k && (w.preventDefault(), w.stopPropagation(), o(k), r());
|
|
1568
1573
|
};
|
|
@@ -1570,7 +1575,7 @@ function Oa({
|
|
|
1570
1575
|
t.removeEventListener("pointerdown", m), t.removeEventListener("pointermove", y), t.removeEventListener("pointerup", A), t.removeEventListener("pointercancel", O), t.removeEventListener("click", u, !0), n.removeEventListener("keydown", F);
|
|
1571
1576
|
};
|
|
1572
1577
|
}
|
|
1573
|
-
function
|
|
1578
|
+
function Ba({
|
|
1574
1579
|
root: e,
|
|
1575
1580
|
handles: t,
|
|
1576
1581
|
getBounds: n,
|
|
@@ -1582,23 +1587,23 @@ function Ua({
|
|
|
1582
1587
|
r = null, l = null, p = null, s = null, c = !1, e.classList.remove("pluno-pa-widget--resizing");
|
|
1583
1588
|
}, h = (u) => {
|
|
1584
1589
|
const F = u.currentTarget, w = F.dataset.resizeDirection;
|
|
1585
|
-
!e.classList.contains("pluno-pa-widget--open") || !
|
|
1590
|
+
!e.classList.contains("pluno-pa-widget--open") || !ro(w) || (u.preventDefault(), u.stopPropagation(), r = u.pointerId, l = w, p = { x: u.clientX, y: u.clientY }, s = n(), c = !1, F.setPointerCapture?.(u.pointerId));
|
|
1586
1591
|
}, m = (u) => {
|
|
1587
1592
|
if (r !== u.pointerId || !l || !p || !s)
|
|
1588
1593
|
return;
|
|
1589
1594
|
u.preventDefault(), u.stopPropagation();
|
|
1590
1595
|
const F = u.clientX - p.x, w = u.clientY - p.y;
|
|
1591
|
-
!c && Math.hypot(F, w) <
|
|
1592
|
-
|
|
1596
|
+
!c && Math.hypot(F, w) < fn || (c = !0, e.classList.add("pluno-pa-widget--resizing"), i(
|
|
1597
|
+
lo(s, l, F, w)
|
|
1593
1598
|
));
|
|
1594
1599
|
}, y = (u) => {
|
|
1595
1600
|
r === u.pointerId && (u.preventDefault(), u.stopPropagation(), c && o(), g());
|
|
1596
1601
|
}, A = (u) => {
|
|
1597
1602
|
r === u.pointerId && (u.preventDefault(), g());
|
|
1598
1603
|
}, O = (u) => {
|
|
1599
|
-
const w = u.currentTarget.dataset.resizeDirection, R = u.shiftKey ?
|
|
1604
|
+
const w = u.currentTarget.dataset.resizeDirection, R = u.shiftKey ? Oo : Do, z = n();
|
|
1600
1605
|
let k = 0, te = 0;
|
|
1601
|
-
|
|
1606
|
+
ro(w) && (u.key === "ArrowLeft" ? k = -R : u.key === "ArrowRight" ? k = R : u.key === "ArrowUp" ? te = -R : u.key === "ArrowDown" && (te = R), !(k === 0 && te === 0) && (u.preventDefault(), u.stopPropagation(), i(lo(z, w, k, te)), o()));
|
|
1602
1607
|
};
|
|
1603
1608
|
for (const u of t)
|
|
1604
1609
|
u.addEventListener("pointerdown", h), u.addEventListener("pointermove", m), u.addEventListener("pointerup", y), u.addEventListener("pointercancel", A), u.addEventListener("keydown", O);
|
|
@@ -1607,11 +1612,11 @@ function Ua({
|
|
|
1607
1612
|
u.removeEventListener("pointerdown", h), u.removeEventListener("pointermove", m), u.removeEventListener("pointerup", y), u.removeEventListener("pointercancel", A), u.removeEventListener("keydown", O);
|
|
1608
1613
|
};
|
|
1609
1614
|
}
|
|
1610
|
-
function
|
|
1615
|
+
function ro(e) {
|
|
1611
1616
|
return e === "left" || e === "right" || e === "top" || e === "bottom" || e === "top-left" || e === "top-right" || e === "bottom-left" || e === "bottom-right";
|
|
1612
1617
|
}
|
|
1613
|
-
function
|
|
1614
|
-
const o = ee(), r =
|
|
1618
|
+
function lo(e, t, n, i) {
|
|
1619
|
+
const o = ee(), r = so({
|
|
1615
1620
|
leading: e.position.x,
|
|
1616
1621
|
length: e.size.width,
|
|
1617
1622
|
delta: n,
|
|
@@ -1620,10 +1625,10 @@ function ro(e, t, n, i) {
|
|
|
1620
1625
|
minLeading: N,
|
|
1621
1626
|
maxTrailing: o.width - N,
|
|
1622
1627
|
minLength: Math.min(
|
|
1623
|
-
|
|
1628
|
+
vn,
|
|
1624
1629
|
o.width - N * 2
|
|
1625
1630
|
)
|
|
1626
|
-
}), l =
|
|
1631
|
+
}), l = so({
|
|
1627
1632
|
leading: e.position.y,
|
|
1628
1633
|
length: e.size.height,
|
|
1629
1634
|
delta: i,
|
|
@@ -1632,7 +1637,7 @@ function ro(e, t, n, i) {
|
|
|
1632
1637
|
minLeading: Ue,
|
|
1633
1638
|
maxTrailing: o.height - N,
|
|
1634
1639
|
minLength: Math.min(
|
|
1635
|
-
|
|
1640
|
+
Sn,
|
|
1636
1641
|
o.height - Ue - N
|
|
1637
1642
|
)
|
|
1638
1643
|
});
|
|
@@ -1641,7 +1646,7 @@ function ro(e, t, n, i) {
|
|
|
1641
1646
|
size: { width: r.length, height: l.length }
|
|
1642
1647
|
};
|
|
1643
1648
|
}
|
|
1644
|
-
function
|
|
1649
|
+
function so({
|
|
1645
1650
|
leading: e,
|
|
1646
1651
|
length: t,
|
|
1647
1652
|
delta: n,
|
|
@@ -1688,47 +1693,47 @@ function lo({
|
|
|
1688
1693
|
}
|
|
1689
1694
|
return { leading: e, length: t };
|
|
1690
1695
|
}
|
|
1691
|
-
function
|
|
1696
|
+
function Tt(e, t = !0) {
|
|
1692
1697
|
const n = ee();
|
|
1693
1698
|
if (e.classList.contains("pluno-pa-widget--minimized"))
|
|
1694
|
-
return { width:
|
|
1699
|
+
return { width: to, height: to };
|
|
1695
1700
|
const i = e.getBoundingClientRect(), o = !e.classList.contains("pluno-pa-widget--open") && !e.classList.contains("pluno-pa-widget--closing");
|
|
1696
1701
|
return {
|
|
1697
|
-
width: t && o && i.width > 0 ? i.width : Math.min(
|
|
1698
|
-
height: t && o && i.height > 0 ? i.height : e.classList.contains("pluno-pa-widget--scribble") ?
|
|
1702
|
+
width: t && o && i.width > 0 ? i.width : Math.min(Ro, n.width - 36),
|
|
1703
|
+
height: t && o && i.height > 0 ? i.height : e.classList.contains("pluno-pa-widget--scribble") ? va : Mo
|
|
1699
1704
|
};
|
|
1700
1705
|
}
|
|
1701
|
-
function
|
|
1706
|
+
function Fa() {
|
|
1702
1707
|
const e = ee();
|
|
1703
1708
|
return {
|
|
1704
1709
|
width: Math.min(
|
|
1705
1710
|
Q(
|
|
1706
|
-
e.width *
|
|
1707
|
-
|
|
1708
|
-
|
|
1711
|
+
e.width * Ca,
|
|
1712
|
+
vn,
|
|
1713
|
+
Sa
|
|
1709
1714
|
),
|
|
1710
1715
|
e.width - N * 2
|
|
1711
1716
|
),
|
|
1712
1717
|
height: Math.min(
|
|
1713
1718
|
Q(
|
|
1714
|
-
e.height *
|
|
1715
|
-
|
|
1716
|
-
|
|
1719
|
+
e.height * ka,
|
|
1720
|
+
Sn,
|
|
1721
|
+
Ea
|
|
1717
1722
|
),
|
|
1718
1723
|
e.height - Ue - N
|
|
1719
1724
|
)
|
|
1720
1725
|
};
|
|
1721
1726
|
}
|
|
1722
|
-
function
|
|
1723
|
-
return e ?
|
|
1727
|
+
function Ve(e = null) {
|
|
1728
|
+
return e ? At(e) : Fa();
|
|
1724
1729
|
}
|
|
1725
|
-
function
|
|
1730
|
+
function At(e) {
|
|
1726
1731
|
const t = ee();
|
|
1727
1732
|
return {
|
|
1728
1733
|
width: Q(
|
|
1729
1734
|
e.width,
|
|
1730
1735
|
Math.min(
|
|
1731
|
-
|
|
1736
|
+
vn,
|
|
1732
1737
|
t.width - N * 2
|
|
1733
1738
|
),
|
|
1734
1739
|
Math.max(
|
|
@@ -1739,7 +1744,7 @@ function Tt(e) {
|
|
|
1739
1744
|
height: Q(
|
|
1740
1745
|
e.height,
|
|
1741
1746
|
Math.min(
|
|
1742
|
-
|
|
1747
|
+
Sn,
|
|
1743
1748
|
t.height - Ue - N
|
|
1744
1749
|
),
|
|
1745
1750
|
Math.max(
|
|
@@ -1749,15 +1754,15 @@ function Tt(e) {
|
|
|
1749
1754
|
)
|
|
1750
1755
|
};
|
|
1751
1756
|
}
|
|
1752
|
-
function
|
|
1757
|
+
function Qt(e, t) {
|
|
1753
1758
|
if (!t) {
|
|
1754
1759
|
e.style.removeProperty("--pluno-pa-panel-width"), e.style.removeProperty("--pluno-pa-panel-height");
|
|
1755
1760
|
return;
|
|
1756
1761
|
}
|
|
1757
|
-
const n =
|
|
1762
|
+
const n = At(t);
|
|
1758
1763
|
e.style.setProperty("--pluno-pa-panel-width", `${n.width}px`), e.style.setProperty("--pluno-pa-panel-height", `${n.height}px`);
|
|
1759
1764
|
}
|
|
1760
|
-
function
|
|
1765
|
+
function Wa(e, t, n) {
|
|
1761
1766
|
const i = Number.parseFloat(e.style.left), o = Number.parseFloat(e.style.top);
|
|
1762
1767
|
if (Number.isFinite(i) && Number.isFinite(o))
|
|
1763
1768
|
return { x: i, y: o };
|
|
@@ -1770,22 +1775,22 @@ function Fa(e, t, n) {
|
|
|
1770
1775
|
y: l.height - 24 - n.height
|
|
1771
1776
|
};
|
|
1772
1777
|
}
|
|
1773
|
-
function
|
|
1774
|
-
const i =
|
|
1775
|
-
return t ?
|
|
1778
|
+
function en(e, t, n) {
|
|
1779
|
+
const i = Tt(e, !1);
|
|
1780
|
+
return t ? wn(
|
|
1776
1781
|
e,
|
|
1777
|
-
|
|
1782
|
+
Ct(t, i),
|
|
1778
1783
|
i
|
|
1779
|
-
) :
|
|
1784
|
+
) : Ha(n === "bottom-left" ? "bottom-left" : "bottom-right", i, ya);
|
|
1780
1785
|
}
|
|
1781
|
-
function
|
|
1786
|
+
function Ha(e, t, n) {
|
|
1782
1787
|
const i = ee();
|
|
1783
1788
|
return {
|
|
1784
1789
|
x: e.endsWith("right") ? Math.max(0, i.width - t.width - n) : n,
|
|
1785
1790
|
y: e.startsWith("bottom") ? Math.max(0, i.height - t.height - n) : n
|
|
1786
1791
|
};
|
|
1787
1792
|
}
|
|
1788
|
-
function
|
|
1793
|
+
function wn(e, t, n) {
|
|
1789
1794
|
const i = ee(), o = N + $a(e);
|
|
1790
1795
|
return {
|
|
1791
1796
|
x: Q(
|
|
@@ -1806,14 +1811,14 @@ function fn(e, t, n) {
|
|
|
1806
1811
|
)
|
|
1807
1812
|
};
|
|
1808
1813
|
}
|
|
1809
|
-
function
|
|
1814
|
+
function Ct(e, t) {
|
|
1810
1815
|
const n = ee();
|
|
1811
1816
|
return {
|
|
1812
1817
|
x: e.anchor.endsWith("right") ? n.width - t.width - e.x : e.x,
|
|
1813
1818
|
y: e.anchor.startsWith("bottom") ? n.height - t.height - e.y : e.y
|
|
1814
1819
|
};
|
|
1815
1820
|
}
|
|
1816
|
-
function
|
|
1821
|
+
function po(e, t) {
|
|
1817
1822
|
const n = Ga(e, t), i = ee();
|
|
1818
1823
|
return {
|
|
1819
1824
|
anchor: n,
|
|
@@ -1826,16 +1831,16 @@ function Ga(e, t) {
|
|
|
1826
1831
|
return `${r}-${l}`;
|
|
1827
1832
|
}
|
|
1828
1833
|
function $a(e) {
|
|
1829
|
-
return e.classList.contains("pluno-pa-widget--scribble") ?
|
|
1834
|
+
return e.classList.contains("pluno-pa-widget--scribble") ? Ia : Aa;
|
|
1830
1835
|
}
|
|
1831
|
-
function
|
|
1832
|
-
const o =
|
|
1836
|
+
function tn(e, t, n, i = null) {
|
|
1837
|
+
const o = Tt(e), r = Ve(i), l = {
|
|
1833
1838
|
x: n === "bottom-left" ? t.x : t.x + o.width - r.width,
|
|
1834
1839
|
y: t.y + o.height - r.height
|
|
1835
1840
|
};
|
|
1836
|
-
return
|
|
1841
|
+
return Et(l, r);
|
|
1837
1842
|
}
|
|
1838
|
-
function
|
|
1843
|
+
function Et(e, t) {
|
|
1839
1844
|
const n = ee();
|
|
1840
1845
|
return {
|
|
1841
1846
|
x: Q(
|
|
@@ -1866,16 +1871,16 @@ function Oe(e, t) {
|
|
|
1866
1871
|
function qa(e, t) {
|
|
1867
1872
|
e.style.setProperty("--pluno-pa-panel-offset-x", `${t.x}px`), e.style.setProperty("--pluno-pa-panel-offset-y", `${t.y}px`);
|
|
1868
1873
|
}
|
|
1869
|
-
function
|
|
1874
|
+
function co(e) {
|
|
1870
1875
|
e.style.removeProperty("--pluno-pa-panel-offset-x"), e.style.removeProperty("--pluno-pa-panel-offset-y");
|
|
1871
1876
|
}
|
|
1872
1877
|
function ee() {
|
|
1873
1878
|
return {
|
|
1874
|
-
width: window.innerWidth || document.documentElement.clientWidth ||
|
|
1875
|
-
height: window.innerHeight || document.documentElement.clientHeight ||
|
|
1879
|
+
width: window.innerWidth || document.documentElement.clientWidth || Ro + N * 2,
|
|
1880
|
+
height: window.innerHeight || document.documentElement.clientHeight || Mo + N * 2
|
|
1876
1881
|
};
|
|
1877
1882
|
}
|
|
1878
|
-
function
|
|
1883
|
+
function nn(e) {
|
|
1879
1884
|
const t = e.getBoundingClientRect();
|
|
1880
1885
|
return {
|
|
1881
1886
|
x: Math.round(t.x),
|
|
@@ -1897,13 +1902,13 @@ function Z(e, t, n) {
|
|
|
1897
1902
|
details: n
|
|
1898
1903
|
}, r = i.__plunoProductAgentDiagnostics__ ?? [];
|
|
1899
1904
|
r.push(o), r.length > 120 && r.splice(0, r.length - 120), i.__plunoProductAgentDiagnostics__ = r, i.__PLUNO_PRODUCT_AGENT_DIAGNOSTICS__ = () => [...r], window.dispatchEvent(
|
|
1900
|
-
new CustomEvent(
|
|
1905
|
+
new CustomEvent(ha, { detail: o })
|
|
1901
1906
|
);
|
|
1902
1907
|
}
|
|
1903
1908
|
function ja(e, t) {
|
|
1904
1909
|
Z("web-sdk.widget.position", e, t);
|
|
1905
1910
|
}
|
|
1906
|
-
function
|
|
1911
|
+
function on(e, t, n, i) {
|
|
1907
1912
|
const o = t.value.trim();
|
|
1908
1913
|
return !o && n.length === 0 ? n : (i(), t.value = "", t.style.height = "22px", t.style.overflowY = "hidden", e.sendMessage(o, {
|
|
1909
1914
|
attachments: n.length > 0 ? n.map(Ya) : void 0
|
|
@@ -1914,7 +1919,7 @@ function Ka(e, t, n) {
|
|
|
1914
1919
|
return i === n ? "composer" : i === t ? "launcher" : null;
|
|
1915
1920
|
}
|
|
1916
1921
|
function Va(e, t, n, i) {
|
|
1917
|
-
if (!e.focusedInput || !e.focusedInputAt || Date.now() - e.focusedInputAt >
|
|
1922
|
+
if (!e.focusedInput || !e.focusedInputAt || Date.now() - e.focusedInputAt > na)
|
|
1918
1923
|
return;
|
|
1919
1924
|
const o = e.focusedInput === "composer" ? i : n;
|
|
1920
1925
|
o === i && !t.classList.contains("pluno-pa-widget--open") || o === n && t.classList.contains("pluno-pa-widget--open") || window.requestAnimationFrame(() => {
|
|
@@ -1924,7 +1929,7 @@ function Va(e, t, n, i) {
|
|
|
1924
1929
|
function Ya(e) {
|
|
1925
1930
|
return e;
|
|
1926
1931
|
}
|
|
1927
|
-
function
|
|
1932
|
+
function lt(e) {
|
|
1928
1933
|
e.style.height = "0px";
|
|
1929
1934
|
const t = Math.max(22, Math.min(e.scrollHeight, 140));
|
|
1930
1935
|
e.style.height = `${t}px`, e.style.overflowY = e.scrollHeight > 140 ? "auto" : "hidden";
|
|
@@ -1987,7 +1992,7 @@ function tr(e, t, n, i, o) {
|
|
|
1987
1992
|
o
|
|
1988
1993
|
)
|
|
1989
1994
|
), e.appendChild(
|
|
1990
|
-
|
|
1995
|
+
It(
|
|
1991
1996
|
"pluno-pa-widget__close",
|
|
1992
1997
|
"Close",
|
|
1993
1998
|
ur(16),
|
|
@@ -2002,7 +2007,7 @@ function nr(e, t, n, i) {
|
|
|
2002
2007
|
s.type = "button", s.className = "pluno-pa-widget__launcher-drag-handle", s.setAttribute("aria-label", "Move Pluno launcher"), s.title = "Move Pluno launcher", o.appendChild(s);
|
|
2003
2008
|
}
|
|
2004
2009
|
o.appendChild(
|
|
2005
|
-
|
|
2010
|
+
Go(
|
|
2006
2011
|
"pluno-pa-widget__scribble-spirals--launcher",
|
|
2007
2012
|
10
|
|
2008
2013
|
)
|
|
@@ -2026,7 +2031,7 @@ function nr(e, t, n, i) {
|
|
|
2026
2031
|
function or(e) {
|
|
2027
2032
|
const t = document.createElement("section");
|
|
2028
2033
|
t.className = "pluno-pa-widget__panel", t.hidden = !0, t.appendChild(
|
|
2029
|
-
|
|
2034
|
+
Go("pluno-pa-widget__scribble-spirals--panel", 16)
|
|
2030
2035
|
);
|
|
2031
2036
|
const n = document.createElement("div");
|
|
2032
2037
|
n.className = "pluno-pa-widget__timeline-wrap";
|
|
@@ -2040,9 +2045,9 @@ function or(e) {
|
|
|
2040
2045
|
l.type = "button", l.className = "pluno-pa-widget__timeline-jump", l.textContent = "New messages ↓", l.hidden = !0, n.appendChild(l);
|
|
2041
2046
|
const p = document.createElement("div");
|
|
2042
2047
|
return p.className = "pluno-pa-widget__top-actions", p.appendChild(
|
|
2043
|
-
|
|
2048
|
+
It(
|
|
2044
2049
|
"pluno-pa-widget__history",
|
|
2045
|
-
|
|
2050
|
+
bn(),
|
|
2046
2051
|
hr(),
|
|
2047
2052
|
!0
|
|
2048
2053
|
)
|
|
@@ -2111,7 +2116,7 @@ function rr() {
|
|
|
2111
2116
|
const p = document.createElement("textarea");
|
|
2112
2117
|
p.className = "pluno-pa-widget__input", p.rows = 1, p.placeholder = "Ask for anything...", o.appendChild(p);
|
|
2113
2118
|
const s = document.createElement("button");
|
|
2114
|
-
s.type = "button", s.className = "pluno-pa-widget__send", s.setAttribute("aria-label", "Send"), s.appendChild(
|
|
2119
|
+
s.type = "button", s.className = "pluno-pa-widget__send", s.setAttribute("aria-label", "Send"), s.appendChild(qo()), o.appendChild(s), e.appendChild(o);
|
|
2115
2120
|
const c = document.createElement("div");
|
|
2116
2121
|
c.className = "pluno-pa-widget__composer-meta";
|
|
2117
2122
|
const g = document.createElement("a");
|
|
@@ -2119,17 +2124,17 @@ function rr() {
|
|
|
2119
2124
|
const h = document.createElement("span");
|
|
2120
2125
|
return h.className = "pluno-pa-widget__ai-disclaimer", h.textContent = "AI can make mistakes. Verify outputs.", c.appendChild(h), e.appendChild(c), e;
|
|
2121
2126
|
}
|
|
2122
|
-
function
|
|
2127
|
+
function bn() {
|
|
2123
2128
|
return location.hostname ? `Recent chats on ${location.hostname}` : "Recent chats";
|
|
2124
2129
|
}
|
|
2125
2130
|
function lr() {
|
|
2126
2131
|
const e = document.createElement("section");
|
|
2127
|
-
e.className = "pluno-pa-widget__history-panel", e.hidden = !0, e.setAttribute("aria-label",
|
|
2132
|
+
e.className = "pluno-pa-widget__history-panel", e.hidden = !0, e.setAttribute("aria-label", bn());
|
|
2128
2133
|
const t = document.createElement("div");
|
|
2129
2134
|
t.className = "pluno-pa-widget__history-header";
|
|
2130
2135
|
const n = document.createElement("strong");
|
|
2131
|
-
n.textContent =
|
|
2132
|
-
const i =
|
|
2136
|
+
n.textContent = bn();
|
|
2137
|
+
const i = It(
|
|
2133
2138
|
"pluno-pa-widget__history-close",
|
|
2134
2139
|
"Close recent chats",
|
|
2135
2140
|
mr(),
|
|
@@ -2148,13 +2153,13 @@ function sr(e) {
|
|
|
2148
2153
|
"pluno-pa-widget__character--empty",
|
|
2149
2154
|
e
|
|
2150
2155
|
)
|
|
2151
|
-
), t.appendChild(
|
|
2156
|
+
), t.appendChild(Fo()), t;
|
|
2152
2157
|
}
|
|
2153
|
-
function
|
|
2158
|
+
function Fo() {
|
|
2154
2159
|
const e = document.createElement("div");
|
|
2155
2160
|
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;
|
|
2156
2161
|
}
|
|
2157
|
-
function
|
|
2162
|
+
function Wo(e, t) {
|
|
2158
2163
|
e.replaceChildren(), e.setAttribute(
|
|
2159
2164
|
"aria-label",
|
|
2160
2165
|
`${t.toLocaleString("en-US")} users currently active`
|
|
@@ -2167,8 +2172,8 @@ function Fo(e, t) {
|
|
|
2167
2172
|
);
|
|
2168
2173
|
}
|
|
2169
2174
|
function ke(e, t) {
|
|
2170
|
-
const n = `pluno-pa-character-${
|
|
2171
|
-
|
|
2175
|
+
const n = `pluno-pa-character-${oo}`;
|
|
2176
|
+
oo += 1;
|
|
2172
2177
|
const i = t.scribbleStyle ? dr(t.accentColor, n) : pr(t.accentColor, n), o = e.split(/\s+/).filter(Boolean);
|
|
2173
2178
|
return i.setAttribute(
|
|
2174
2179
|
"class",
|
|
@@ -2176,7 +2181,7 @@ function ke(e, t) {
|
|
|
2176
2181
|
), i.setAttribute("aria-hidden", "true"), i.setAttribute("focusable", "false"), i.removeAttribute("role"), i.removeAttribute("aria-label"), i;
|
|
2177
2182
|
}
|
|
2178
2183
|
function pr(e, t) {
|
|
2179
|
-
const n =
|
|
2184
|
+
const n = Ti(e), i = {
|
|
2180
2185
|
boltFill: `${t}-boltFill`,
|
|
2181
2186
|
boltEdge: `${t}-boltEdge`,
|
|
2182
2187
|
boltGlow: `${t}-boltGlow`,
|
|
@@ -2187,7 +2192,7 @@ function pr(e, t) {
|
|
|
2187
2192
|
eyeShadow: `${t}-eyeShadow`,
|
|
2188
2193
|
pupilGloss: `${t}-pupilGloss`,
|
|
2189
2194
|
boltClip: `${t}-boltClip`
|
|
2190
|
-
}, o =
|
|
2195
|
+
}, o = Ho(), r = x(o, "defs"), l = x(r, "linearGradient", {
|
|
2191
2196
|
id: i.boltFill,
|
|
2192
2197
|
x1: "420",
|
|
2193
2198
|
y1: "180",
|
|
@@ -2305,12 +2310,12 @@ function pr(e, t) {
|
|
|
2305
2310
|
"flood-opacity": "0.22"
|
|
2306
2311
|
});
|
|
2307
2312
|
const O = x(r, "clipPath", { id: i.boltClip });
|
|
2308
|
-
x(O, "path", { d:
|
|
2313
|
+
x(O, "path", { d: kt });
|
|
2309
2314
|
const u = x(o, "g", {
|
|
2310
2315
|
filter: J(i.softDropShadow)
|
|
2311
2316
|
});
|
|
2312
2317
|
x(u, "path", {
|
|
2313
|
-
d:
|
|
2318
|
+
d: kt,
|
|
2314
2319
|
fill: J(i.boltEdge)
|
|
2315
2320
|
});
|
|
2316
2321
|
const F = "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";
|
|
@@ -2350,7 +2355,7 @@ function pr(e, t) {
|
|
|
2350
2355
|
opacity: "0.48"
|
|
2351
2356
|
});
|
|
2352
2357
|
const R = x(o, "g", { filter: J(i.eyeShadow) });
|
|
2353
|
-
return
|
|
2358
|
+
return uo(
|
|
2354
2359
|
R,
|
|
2355
2360
|
"rotate(-2 528 463)",
|
|
2356
2361
|
"528",
|
|
@@ -2360,7 +2365,7 @@ function pr(e, t) {
|
|
|
2360
2365
|
"557",
|
|
2361
2366
|
"447",
|
|
2362
2367
|
i
|
|
2363
|
-
),
|
|
2368
|
+
), uo(
|
|
2364
2369
|
R,
|
|
2365
2370
|
"rotate(2 717 462)",
|
|
2366
2371
|
"717",
|
|
@@ -2373,11 +2378,11 @@ function pr(e, t) {
|
|
|
2373
2378
|
), o;
|
|
2374
2379
|
}
|
|
2375
2380
|
function dr(e, t) {
|
|
2376
|
-
const n =
|
|
2381
|
+
const n = Lo(e), i = {
|
|
2377
2382
|
clip: `${t}-scribbleBoltClip`,
|
|
2378
2383
|
wobble: `${t}-scribbleBoltWobble`
|
|
2379
|
-
}, o =
|
|
2380
|
-
x(l, "path", { d:
|
|
2384
|
+
}, o = Ho(), r = x(o, "defs"), l = x(r, "clipPath", { id: i.clip });
|
|
2385
|
+
x(l, "path", { d: kt });
|
|
2381
2386
|
const p = x(r, "filter", {
|
|
2382
2387
|
id: i.wobble,
|
|
2383
2388
|
x: "-10%",
|
|
@@ -2403,7 +2408,7 @@ function dr(e, t) {
|
|
|
2403
2408
|
"clip-path": J(i.clip)
|
|
2404
2409
|
});
|
|
2405
2410
|
return x(c, "path", {
|
|
2406
|
-
d:
|
|
2411
|
+
d: Li(),
|
|
2407
2412
|
fill: "none",
|
|
2408
2413
|
stroke: n,
|
|
2409
2414
|
"stroke-width": "56",
|
|
@@ -2412,12 +2417,12 @@ function dr(e, t) {
|
|
|
2412
2417
|
opacity: "0.9",
|
|
2413
2418
|
transform: "rotate(-14 627 600)"
|
|
2414
2419
|
}), x(s, "path", {
|
|
2415
|
-
d:
|
|
2420
|
+
d: kt,
|
|
2416
2421
|
fill: "none",
|
|
2417
|
-
stroke:
|
|
2422
|
+
stroke: Lt,
|
|
2418
2423
|
"stroke-width": "18",
|
|
2419
2424
|
"stroke-linejoin": "round"
|
|
2420
|
-
}),
|
|
2425
|
+
}), go(
|
|
2421
2426
|
s,
|
|
2422
2427
|
"rotate(-2 528 463)",
|
|
2423
2428
|
"528",
|
|
@@ -2426,7 +2431,7 @@ function dr(e, t) {
|
|
|
2426
2431
|
"473",
|
|
2427
2432
|
"557",
|
|
2428
2433
|
"447"
|
|
2429
|
-
),
|
|
2434
|
+
), go(
|
|
2430
2435
|
s,
|
|
2431
2436
|
"rotate(2 717 462)",
|
|
2432
2437
|
"717",
|
|
@@ -2437,13 +2442,13 @@ function dr(e, t) {
|
|
|
2437
2442
|
"447"
|
|
2438
2443
|
), o;
|
|
2439
2444
|
}
|
|
2440
|
-
function
|
|
2445
|
+
function Ho() {
|
|
2441
2446
|
return T("svg", {
|
|
2442
|
-
xmlns:
|
|
2447
|
+
xmlns: zo,
|
|
2443
2448
|
viewBox: "0 0 1254 1254"
|
|
2444
2449
|
});
|
|
2445
2450
|
}
|
|
2446
|
-
function
|
|
2451
|
+
function uo(e, t, n, i, o, r, l, p, s) {
|
|
2447
2452
|
const c = x(e, "g", { transform: t });
|
|
2448
2453
|
x(c, "ellipse", {
|
|
2449
2454
|
cx: n,
|
|
@@ -2465,7 +2470,7 @@ function po(e, t, n, i, o, r, l, p, s) {
|
|
|
2465
2470
|
fill: "#ffffff"
|
|
2466
2471
|
});
|
|
2467
2472
|
}
|
|
2468
|
-
function
|
|
2473
|
+
function go(e, t, n, i, o, r, l, p) {
|
|
2469
2474
|
const s = x(e, "g", { transform: t });
|
|
2470
2475
|
x(s, "ellipse", {
|
|
2471
2476
|
cx: n,
|
|
@@ -2473,14 +2478,14 @@ function co(e, t, n, i, o, r, l, p) {
|
|
|
2473
2478
|
rx: "73",
|
|
2474
2479
|
ry: "80",
|
|
2475
2480
|
fill: "#ffffff",
|
|
2476
|
-
stroke:
|
|
2481
|
+
stroke: Lt,
|
|
2477
2482
|
"stroke-width": "13"
|
|
2478
2483
|
}), x(s, "ellipse", {
|
|
2479
2484
|
cx: o,
|
|
2480
2485
|
cy: r,
|
|
2481
2486
|
rx: "45",
|
|
2482
2487
|
ry: "53",
|
|
2483
|
-
fill:
|
|
2488
|
+
fill: Lt
|
|
2484
2489
|
}), x(s, "circle", {
|
|
2485
2490
|
cx: l,
|
|
2486
2491
|
cy: p,
|
|
@@ -2499,7 +2504,7 @@ function G(e, t, n, i) {
|
|
|
2499
2504
|
function J(e) {
|
|
2500
2505
|
return `url(#${e})`;
|
|
2501
2506
|
}
|
|
2502
|
-
function
|
|
2507
|
+
function It(e, t, n, i) {
|
|
2503
2508
|
const o = document.createElement("button");
|
|
2504
2509
|
return o.type = "button", o.className = e, o.setAttribute("aria-label", t), o.title = t, o.hidden = i, o.appendChild(n), o;
|
|
2505
2510
|
}
|
|
@@ -2511,46 +2516,46 @@ function cr() {
|
|
|
2511
2516
|
width: "0",
|
|
2512
2517
|
height: "0"
|
|
2513
2518
|
}), t = T("defs");
|
|
2514
|
-
return t.appendChild(
|
|
2515
|
-
|
|
2519
|
+
return t.appendChild(rn("pluno-pa-scribble-wobble", "2", "12")), t.appendChild(
|
|
2520
|
+
rn("pluno-pa-scribble-wobble-2", "5", "15")
|
|
2516
2521
|
), t.appendChild(
|
|
2517
|
-
|
|
2522
|
+
rn("pluno-pa-scribble-wobble-3", "9", "19")
|
|
2518
2523
|
), e.appendChild(t), e;
|
|
2519
2524
|
}
|
|
2520
|
-
function
|
|
2525
|
+
function Go(e, t) {
|
|
2521
2526
|
const n = T("svg", {
|
|
2522
2527
|
class: `pluno-pa-widget__scribble-spirals ${e}`,
|
|
2523
2528
|
preserveAspectRatio: "xMidYMid meet",
|
|
2524
2529
|
"aria-hidden": "true",
|
|
2525
2530
|
focusable: "false"
|
|
2526
2531
|
});
|
|
2527
|
-
return
|
|
2532
|
+
return $o(n, t), n;
|
|
2528
2533
|
}
|
|
2529
|
-
function
|
|
2534
|
+
function an(e, t) {
|
|
2530
2535
|
if (!e)
|
|
2531
2536
|
return;
|
|
2532
2537
|
const n = Math.max(
|
|
2533
2538
|
0,
|
|
2534
|
-
t -
|
|
2539
|
+
t - mn * 2
|
|
2535
2540
|
), i = Math.max(
|
|
2536
|
-
|
|
2541
|
+
Ta,
|
|
2537
2542
|
Math.floor(
|
|
2538
|
-
(n -
|
|
2543
|
+
(n - hn * 2) / gn
|
|
2539
2544
|
)
|
|
2540
2545
|
);
|
|
2541
|
-
|
|
2546
|
+
$o(e, i);
|
|
2542
2547
|
}
|
|
2543
|
-
function
|
|
2548
|
+
function $o(e, t) {
|
|
2544
2549
|
if (e.dataset.spiralCount === `${t}`)
|
|
2545
2550
|
return;
|
|
2546
|
-
const n = t *
|
|
2551
|
+
const n = t * gn + hn * 2;
|
|
2547
2552
|
e.dataset.spiralCount = `${t}`, e.setAttribute(
|
|
2548
2553
|
"viewBox",
|
|
2549
|
-
`0 0 ${n} ${
|
|
2554
|
+
`0 0 ${n} ${La}`
|
|
2550
2555
|
), e.replaceChildren();
|
|
2551
2556
|
for (let i = 0; i < t; i += 1) {
|
|
2552
|
-
const o =
|
|
2553
|
-
transform: `translate(${
|
|
2557
|
+
const o = no[i % no.length], r = T("g", {
|
|
2558
|
+
transform: `translate(${hn + i * gn} 0)`
|
|
2554
2559
|
});
|
|
2555
2560
|
r.appendChild(
|
|
2556
2561
|
T("ellipse", {
|
|
@@ -2574,7 +2579,7 @@ function Go(e, t) {
|
|
|
2574
2579
|
), e.appendChild(r);
|
|
2575
2580
|
}
|
|
2576
2581
|
}
|
|
2577
|
-
function
|
|
2582
|
+
function rn(e, t, n) {
|
|
2578
2583
|
const i = T("filter", {
|
|
2579
2584
|
id: e,
|
|
2580
2585
|
x: "-8%",
|
|
@@ -2669,7 +2674,7 @@ function mr() {
|
|
|
2669
2674
|
);
|
|
2670
2675
|
return e.appendChild(T("path", { d: "M18 6 6 18" })), e.appendChild(T("path", { d: "m6 6 12 12" })), e;
|
|
2671
2676
|
}
|
|
2672
|
-
function
|
|
2677
|
+
function qo() {
|
|
2673
2678
|
const e = de(
|
|
2674
2679
|
"0 0 24 24",
|
|
2675
2680
|
14,
|
|
@@ -2773,12 +2778,12 @@ function de(e, t, n, i, o, r) {
|
|
|
2773
2778
|
return o && (l.stroke = o, l["stroke-linecap"] = "round", l["stroke-linejoin"] = "round"), r && (l["stroke-width"] = r), T("svg", l);
|
|
2774
2779
|
}
|
|
2775
2780
|
function T(e, t = {}) {
|
|
2776
|
-
const n = document.createElementNS(
|
|
2781
|
+
const n = document.createElementNS(zo, e);
|
|
2777
2782
|
for (const [i, o] of Object.entries(t))
|
|
2778
2783
|
n.setAttribute(i, o);
|
|
2779
2784
|
return n;
|
|
2780
2785
|
}
|
|
2781
|
-
function
|
|
2786
|
+
function ho(e) {
|
|
2782
2787
|
for (const t of ["keydown", "keypress", "keyup"])
|
|
2783
2788
|
e.addEventListener(t, (n) => {
|
|
2784
2789
|
n.stopPropagation();
|
|
@@ -2796,7 +2801,7 @@ function yr(e, t, n) {
|
|
|
2796
2801
|
}
|
|
2797
2802
|
}
|
|
2798
2803
|
function vr(e) {
|
|
2799
|
-
const t =
|
|
2804
|
+
const t = Cn(e), n = jo(e);
|
|
2800
2805
|
if (t === "image" && n) {
|
|
2801
2806
|
const i = document.createElement("img");
|
|
2802
2807
|
return i.src = n, i.alt = "", i.setAttribute("aria-hidden", "true"), i.addEventListener(
|
|
@@ -2817,7 +2822,7 @@ function vr(e) {
|
|
|
2817
2822
|
return pe(e);
|
|
2818
2823
|
}
|
|
2819
2824
|
function Sr(e, t) {
|
|
2820
|
-
const n =
|
|
2825
|
+
const n = Cn(e), i = jo(e);
|
|
2821
2826
|
if (n === "image" && i) {
|
|
2822
2827
|
const o = document.createElement("img");
|
|
2823
2828
|
o.className = "pluno-pa-widget__message-attachment-preview", o.alt = e.name;
|
|
@@ -2859,23 +2864,23 @@ function Sr(e, t) {
|
|
|
2859
2864
|
function pe(e, t = "composer") {
|
|
2860
2865
|
if (t === "composer") {
|
|
2861
2866
|
const r = document.createElement("span");
|
|
2862
|
-
return r.className = "pluno-pa-widget__attachment-file", r.textContent =
|
|
2867
|
+
return r.className = "pluno-pa-widget__attachment-file", r.textContent = mo(e), r;
|
|
2863
2868
|
}
|
|
2864
2869
|
const n = document.createElement("div");
|
|
2865
2870
|
n.className = "pluno-pa-widget__message-attachment-file";
|
|
2866
2871
|
const i = document.createElement("span");
|
|
2867
|
-
i.textContent =
|
|
2872
|
+
i.textContent = mo(e);
|
|
2868
2873
|
const o = document.createElement("strong");
|
|
2869
2874
|
return o.textContent = e.name, n.append(i, o), n;
|
|
2870
2875
|
}
|
|
2871
|
-
function
|
|
2876
|
+
function Cn(e) {
|
|
2872
2877
|
return e.mimeType.startsWith("image/") ? "image" : e.mimeType === "application/pdf" ? "pdf" : e.mimeType.startsWith("video/") ? "video" : "file";
|
|
2873
2878
|
}
|
|
2874
|
-
function
|
|
2879
|
+
function jo(e) {
|
|
2875
2880
|
return "previewUrl" in e && e.previewUrl ? e.previewUrl : e.fileUrl ?? "";
|
|
2876
2881
|
}
|
|
2877
|
-
function
|
|
2878
|
-
const t =
|
|
2882
|
+
function mo(e) {
|
|
2883
|
+
const t = Cn(e);
|
|
2879
2884
|
return t === "image" ? "IMG" : t === "pdf" ? "PDF" : t === "video" ? "VID" : "FILE";
|
|
2880
2885
|
}
|
|
2881
2886
|
function Cr(e, t) {
|
|
@@ -2890,14 +2895,14 @@ function Er(e) {
|
|
|
2890
2895
|
function vt(e) {
|
|
2891
2896
|
return !!(e && Array.from(e.types).includes("Files"));
|
|
2892
2897
|
}
|
|
2893
|
-
function
|
|
2894
|
-
if (!e || !
|
|
2898
|
+
function ln(e, t, n = null) {
|
|
2899
|
+
if (!e || !_n(t, n)) {
|
|
2895
2900
|
e && (e.hidden = !0, e.replaceChildren());
|
|
2896
2901
|
return;
|
|
2897
2902
|
}
|
|
2898
|
-
e.hidden = !1, e.replaceChildren(), e.className = "pluno-pa-widget__billing-status", le(t) ||
|
|
2903
|
+
e.hidden = !1, e.replaceChildren(), e.className = "pluno-pa-widget__billing-status", le(t) || En(n) ? e.appendChild(
|
|
2899
2904
|
kr(t, n)
|
|
2900
|
-
) :
|
|
2905
|
+
) : Ko(t) && e.appendChild(Lr(t));
|
|
2901
2906
|
}
|
|
2902
2907
|
function kr(e, t) {
|
|
2903
2908
|
const n = document.createElement("div");
|
|
@@ -2906,7 +2911,7 @@ function kr(e, t) {
|
|
|
2906
2911
|
o.textContent = i ? "Credits used up" : "Billing needs attention", n.appendChild(o);
|
|
2907
2912
|
const r = document.createElement("span");
|
|
2908
2913
|
return r.textContent = i ? "Earn bonus credits or upgrade to keep using Pluno on this product." : e.paymentIssue ?? "Open billing to keep using Pluno.", n.appendChild(r), n.appendChild(
|
|
2909
|
-
|
|
2914
|
+
Vo(
|
|
2910
2915
|
e,
|
|
2911
2916
|
"Upgrade plan",
|
|
2912
2917
|
"pluno-pa-widget__billing-action-card-actions"
|
|
@@ -2920,18 +2925,18 @@ function Lr(e) {
|
|
|
2920
2925
|
n.textContent = "Credits running low", t.appendChild(n);
|
|
2921
2926
|
const i = document.createElement("span");
|
|
2922
2927
|
return i.textContent = Ar(e) ?? "Credits are running low for this period.", t.appendChild(i), t.appendChild(
|
|
2923
|
-
|
|
2928
|
+
Vo(
|
|
2924
2929
|
e,
|
|
2925
2930
|
"Upgrade",
|
|
2926
2931
|
"pluno-pa-widget__billing-action-card-actions"
|
|
2927
2932
|
)
|
|
2928
2933
|
), t;
|
|
2929
2934
|
}
|
|
2930
|
-
function
|
|
2931
|
-
return e !== null && (le(e) ||
|
|
2935
|
+
function _n(e, t) {
|
|
2936
|
+
return e !== null && (le(e) || Ko(e) || En(t));
|
|
2932
2937
|
}
|
|
2933
|
-
function
|
|
2934
|
-
return
|
|
2938
|
+
function fo(e, t, n) {
|
|
2939
|
+
return _n(t, n) || Tr(t) ? !0 : !_n(e, n);
|
|
2935
2940
|
}
|
|
2936
2941
|
function Tr(e) {
|
|
2937
2942
|
return e != null && (e.creditsUsed !== null || e.creditLimit !== null || e.creditsRemaining !== null || le(e));
|
|
@@ -2939,10 +2944,10 @@ function Tr(e) {
|
|
|
2939
2944
|
function le(e) {
|
|
2940
2945
|
return e?.limitExceeded === !0 || !!e?.paymentIssue;
|
|
2941
2946
|
}
|
|
2942
|
-
function
|
|
2947
|
+
function En(e) {
|
|
2943
2948
|
return e === "limit_exceeded" || e === "subscription_required" || e === "subscription_inactive" || e === "payment_issue" || e === "subscription_invalid" || e === "payment_required";
|
|
2944
2949
|
}
|
|
2945
|
-
function
|
|
2950
|
+
function Ko(e) {
|
|
2946
2951
|
return !le(e) && e.creditLimit !== null && e.creditLimit > 0 && e.creditsRemaining !== null && e.creditsRemaining > 0 && e.creditsRemaining / e.creditLimit <= 0.2;
|
|
2947
2952
|
}
|
|
2948
2953
|
function Ar(e) {
|
|
@@ -2953,15 +2958,15 @@ function Ir(e) {
|
|
|
2953
2958
|
maximumFractionDigits: 0
|
|
2954
2959
|
}).format(Math.ceil(e));
|
|
2955
2960
|
}
|
|
2956
|
-
function
|
|
2961
|
+
function Vo(e, t, n) {
|
|
2957
2962
|
const i = document.createElement("div");
|
|
2958
2963
|
return i.className = n, i.appendChild(
|
|
2959
|
-
|
|
2964
|
+
wo(t, e.pricingUrl)
|
|
2960
2965
|
), i.appendChild(
|
|
2961
|
-
|
|
2966
|
+
wo("Earn credits", e.earnCreditsUrl)
|
|
2962
2967
|
), i;
|
|
2963
2968
|
}
|
|
2964
|
-
function
|
|
2969
|
+
function wo(e, t) {
|
|
2965
2970
|
const n = document.createElement("button");
|
|
2966
2971
|
if (n.type = "button", e === "Earn credits") {
|
|
2967
2972
|
const i = document.createElement("span");
|
|
@@ -2972,18 +2977,18 @@ function mo(e, t) {
|
|
|
2972
2977
|
t.trim().length !== 0 && window.open(t, "_blank", "noopener,noreferrer");
|
|
2973
2978
|
}), n;
|
|
2974
2979
|
}
|
|
2975
|
-
function
|
|
2980
|
+
function sn(e, t) {
|
|
2976
2981
|
return e.messages.filter(
|
|
2977
|
-
(i) => !
|
|
2982
|
+
(i) => !Xo(i)
|
|
2978
2983
|
).length === 0 && !e.assistantDraft && !e.lastError && !e.isThinking && !t;
|
|
2979
2984
|
}
|
|
2980
2985
|
function Pr(e, t, n, i, o, r, l, p, s, c, g, h, m, y, A, O, u, F, w, R, z, k) {
|
|
2981
2986
|
const te = Dr(r), W = Or(
|
|
2982
|
-
te.filter((S) => !
|
|
2983
|
-
),
|
|
2987
|
+
te.filter((S) => !Xo(S))
|
|
2988
|
+
), Ye = e.scrollTop, Be = [], ce = /* @__PURE__ */ new Set(), U = (S) => {
|
|
2984
2989
|
Be.push(S);
|
|
2985
2990
|
};
|
|
2986
|
-
|
|
2991
|
+
ei(n, r.isThinking), o.hidden = !p, p && l !== null && Wo(o, l);
|
|
2987
2992
|
const v = W.length > 0 || !!r.assistantDraft || r.isThinking;
|
|
2988
2993
|
if (i(v), u || W.length === 0 && !r.assistantDraft && !r.lastError && !r.isThinking) {
|
|
2989
2994
|
const S = document.createElement("div");
|
|
@@ -2998,7 +3003,7 @@ function Pr(e, t, n, i, o, r, l, p, s, c, g, h, m, y, A, O, u, F, w, R, z, k) {
|
|
|
2998
3003
|
const b = document.createElement("h2");
|
|
2999
3004
|
b.className = "pluno-pa-widget__empty pluno-pa-widget__morning-report-title", b.textContent = u.opening, S.appendChild(b);
|
|
3000
3005
|
} else
|
|
3001
|
-
S.appendChild(
|
|
3006
|
+
S.appendChild(Fo());
|
|
3002
3007
|
const ye = u?.prompts ?? r.starterPrompts, ne = document.createElement("div");
|
|
3003
3008
|
if (ne.className = ye.length > 0 ? "pluno-pa-widget__starter-prompts" : "pluno-pa-widget__starter-prompts pluno-pa-widget__starter-prompts--empty", ye.length === 0 && !r.starterPromptsLoading && ne.setAttribute("aria-hidden", "true"), ye.length > 0)
|
|
3004
3009
|
for (const b of ye) {
|
|
@@ -3011,7 +3016,7 @@ function Pr(e, t, n, i, o, r, l, p, s, c, g, h, m, y, A, O, u, F, w, R, z, k) {
|
|
|
3011
3016
|
const b = document.createElement("button");
|
|
3012
3017
|
b.type = "button", b.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder pluno-pa-widget__starter-prompt--loading", b.disabled = !0, b.tabIndex = -1, b.textContent = "Generating example tasks...", ne.appendChild(b);
|
|
3013
3018
|
} else
|
|
3014
|
-
for (let b = 0; b <
|
|
3019
|
+
for (let b = 0; b < ma; b += 1) {
|
|
3015
3020
|
const E = document.createElement("button");
|
|
3016
3021
|
E.type = "button", E.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder", E.disabled = !0, E.tabIndex = -1, E.textContent = "", ne.appendChild(E);
|
|
3017
3022
|
}
|
|
@@ -3019,17 +3024,17 @@ function Pr(e, t, n, i, o, r, l, p, s, c, g, h, m, y, A, O, u, F, w, R, z, k) {
|
|
|
3019
3024
|
const b = document.createElement("button");
|
|
3020
3025
|
b.type = "button", b.className = "pluno-pa-widget__morning-report-snooze", b.textContent = "Snooze morning report", b.addEventListener("click", F), S.appendChild(b);
|
|
3021
3026
|
}
|
|
3022
|
-
h.clear(), U(S), U(t),
|
|
3027
|
+
h.clear(), U(S), U(t), bo(e, Be);
|
|
3023
3028
|
return;
|
|
3024
3029
|
}
|
|
3025
3030
|
let B = null, $ = null, X = [], Le = [];
|
|
3026
|
-
const K = W.length - 1, ct = K >= 0 &&
|
|
3031
|
+
const K = W.length - 1, ct = K >= 0 && xn(W[K]), Te = Ur(W);
|
|
3027
3032
|
let ue = !1;
|
|
3028
3033
|
const ge = () => {
|
|
3029
3034
|
if (X.length === 0)
|
|
3030
3035
|
return ue = !1, !1;
|
|
3031
3036
|
const S = Te !== null && X.some(
|
|
3032
|
-
(P) =>
|
|
3037
|
+
(P) => Yo(P, Te)
|
|
3033
3038
|
), L = jr(
|
|
3034
3039
|
X,
|
|
3035
3040
|
S,
|
|
@@ -3062,7 +3067,7 @@ function Pr(e, t, n, i, o, r, l, p, s, c, g, h, m, y, A, O, u, F, w, R, z, k) {
|
|
|
3062
3067
|
X.push(L);
|
|
3063
3068
|
continue;
|
|
3064
3069
|
}
|
|
3065
|
-
if (
|
|
3070
|
+
if (xn(L)) {
|
|
3066
3071
|
if (S !== K)
|
|
3067
3072
|
continue;
|
|
3068
3073
|
if (ge()) {
|
|
@@ -3071,7 +3076,7 @@ function Pr(e, t, n, i, o, r, l, p, s, c, g, h, m, y, A, O, u, F, w, R, z, k) {
|
|
|
3071
3076
|
U(E), B = null, $ = E;
|
|
3072
3077
|
}
|
|
3073
3078
|
} else {
|
|
3074
|
-
const E =
|
|
3079
|
+
const E = yo(y());
|
|
3075
3080
|
U(E), B = null, $ = E;
|
|
3076
3081
|
}
|
|
3077
3082
|
continue;
|
|
@@ -3080,7 +3085,7 @@ function Pr(e, t, n, i, o, r, l, p, s, c, g, h, m, y, A, O, u, F, w, R, z, k) {
|
|
|
3080
3085
|
if (L.dataType === "run_error" || L.dataType === "run_status") {
|
|
3081
3086
|
ge();
|
|
3082
3087
|
const b = document.createElement("div"), E = L.dataType === "run_error";
|
|
3083
|
-
if (b.className = E ? "pluno-pa-widget__error" : "pluno-pa-widget__status pluno-pa-widget__run-status", b.textContent =
|
|
3088
|
+
if (b.className = E ? "pluno-pa-widget__error" : "pluno-pa-widget__status pluno-pa-widget__run-status", b.textContent = yn(
|
|
3084
3089
|
L.content
|
|
3085
3090
|
), E && L.securitySettingsUrl) {
|
|
3086
3091
|
const q = document.createElement("a");
|
|
@@ -3091,9 +3096,9 @@ function Pr(e, t, n, i, o, r, l, p, s, c, g, h, m, y, A, O, u, F, w, R, z, k) {
|
|
|
3091
3096
|
continue;
|
|
3092
3097
|
}
|
|
3093
3098
|
L.role === "user" && M();
|
|
3094
|
-
const P = ge(), ye =
|
|
3099
|
+
const P = ge(), ye = yn(L.content);
|
|
3095
3100
|
if (L.role === "assistant" && !P) {
|
|
3096
|
-
const b =
|
|
3101
|
+
const b = Jo(y());
|
|
3097
3102
|
U(b), B = null, $ = b;
|
|
3098
3103
|
}
|
|
3099
3104
|
const ne = Rr(
|
|
@@ -3105,15 +3110,15 @@ function Pr(e, t, n, i, o, r, l, p, s, c, g, h, m, y, A, O, u, F, w, R, z, k) {
|
|
|
3105
3110
|
);
|
|
3106
3111
|
U(ne), B = ne, $ = null, L.role === "assistant" && M();
|
|
3107
3112
|
}
|
|
3108
|
-
const
|
|
3113
|
+
const Xe = ge(), Ae = W[W.length - 1]?.role === "assistant";
|
|
3109
3114
|
if (r.isThinking && !Ae && !ct)
|
|
3110
|
-
if (
|
|
3115
|
+
if (Xe) {
|
|
3111
3116
|
if (!ue) {
|
|
3112
3117
|
const S = dt();
|
|
3113
3118
|
U(S), B = null, $ = S;
|
|
3114
3119
|
}
|
|
3115
3120
|
} else {
|
|
3116
|
-
const S =
|
|
3121
|
+
const S = yo(y());
|
|
3117
3122
|
U(S), B = null, $ = S;
|
|
3118
3123
|
}
|
|
3119
3124
|
if (r.lastError) {
|
|
@@ -3133,7 +3138,7 @@ function Pr(e, t, n, i, o, r, l, p, s, c, g, h, m, y, A, O, u, F, w, R, z, k) {
|
|
|
3133
3138
|
}
|
|
3134
3139
|
U(S), B = S, $ = null;
|
|
3135
3140
|
}
|
|
3136
|
-
const Ie = k ? k.actionCandidate ?? (r.isThinking ? null :
|
|
3141
|
+
const Ie = k ? k.actionCandidate ?? (r.isThinking ? null : Ni(te)) : null;
|
|
3137
3142
|
if (k && Ie && !k.dismissedCandidateIds.has(Ie.id)) {
|
|
3138
3143
|
const S = Gr(Ie, {
|
|
3139
3144
|
isActing: k.actionCandidate?.id === Ie.id,
|
|
@@ -3154,7 +3159,7 @@ function Pr(e, t, n, i, o, r, l, p, s, c, g, h, m, y, A, O, u, F, w, R, z, k) {
|
|
|
3154
3159
|
), U(t), zr(
|
|
3155
3160
|
h,
|
|
3156
3161
|
ce
|
|
3157
|
-
),
|
|
3162
|
+
), bo(e, Be), s ? st(e, c) : e.scrollTop = Ye;
|
|
3158
3163
|
}
|
|
3159
3164
|
function Nr(e, t, n) {
|
|
3160
3165
|
const i = document.createElement("section");
|
|
@@ -3214,7 +3219,7 @@ function zr(e, t) {
|
|
|
3214
3219
|
for (const n of e.keys())
|
|
3215
3220
|
t.has(n) || e.delete(n);
|
|
3216
3221
|
}
|
|
3217
|
-
function
|
|
3222
|
+
function bo(e, t) {
|
|
3218
3223
|
let n = e.firstChild;
|
|
3219
3224
|
for (const i of t) {
|
|
3220
3225
|
if (i === n) {
|
|
@@ -3249,7 +3254,7 @@ function Dr(e) {
|
|
|
3249
3254
|
if (n === -1)
|
|
3250
3255
|
return [...e.messages, t];
|
|
3251
3256
|
const i = e.messages.findIndex(
|
|
3252
|
-
(r, l) => l > n && r.role !== "user" && r.respondsToUserMessageId === t.respondsToUserMessageId &&
|
|
3257
|
+
(r, l) => l > n && r.role !== "user" && r.respondsToUserMessageId === t.respondsToUserMessageId && _o(r, t) && xn(r)
|
|
3253
3258
|
);
|
|
3254
3259
|
if (i !== -1)
|
|
3255
3260
|
return [
|
|
@@ -3258,7 +3263,7 @@ function Dr(e) {
|
|
|
3258
3263
|
...e.messages.slice(i + 1)
|
|
3259
3264
|
];
|
|
3260
3265
|
let o = n + 1;
|
|
3261
|
-
for (; o < e.messages.length && e.messages[o].role !== "user" && e.messages[o].respondsToUserMessageId === t.respondsToUserMessageId &&
|
|
3266
|
+
for (; o < e.messages.length && e.messages[o].role !== "user" && e.messages[o].respondsToUserMessageId === t.respondsToUserMessageId && _o(e.messages[o], t); )
|
|
3262
3267
|
o += 1;
|
|
3263
3268
|
return [
|
|
3264
3269
|
...e.messages.slice(0, o),
|
|
@@ -3276,7 +3281,7 @@ function Ur(e) {
|
|
|
3276
3281
|
for (let n = e.length - 1; n >= 0; n -= 1) {
|
|
3277
3282
|
const i = e[n];
|
|
3278
3283
|
if (!(i.role !== "tool" || e.slice(n + 1).some(
|
|
3279
|
-
(r) => (Br(r) || Fr(r)) &&
|
|
3284
|
+
(r) => (Br(r) || Fr(r)) && Yo(i, r)
|
|
3280
3285
|
)) && (i.loading || i.dataType === "assistant_draft" || t && i.respondsToUserMessageId === t.id))
|
|
3281
3286
|
return i;
|
|
3282
3287
|
}
|
|
@@ -3288,17 +3293,17 @@ function Br(e) {
|
|
|
3288
3293
|
function Fr(e) {
|
|
3289
3294
|
return e.role === "system" && (e.dataType === "run_error" || e.dataType === "run_status" && e.loading !== !0);
|
|
3290
3295
|
}
|
|
3291
|
-
function
|
|
3296
|
+
function Yo(e, t) {
|
|
3292
3297
|
return e.respondsToUserMessageId && t.respondsToUserMessageId ? e.respondsToUserMessageId === t.respondsToUserMessageId : e.runId && t.runId ? e.runId === t.runId : e.id === t.id;
|
|
3293
3298
|
}
|
|
3294
|
-
function
|
|
3299
|
+
function xn(e) {
|
|
3295
3300
|
return e.role === "system" && e.dataType === "run_status" && e.loading === !0;
|
|
3296
3301
|
}
|
|
3297
|
-
function
|
|
3302
|
+
function _o(e, t) {
|
|
3298
3303
|
return !e.runId || !t.runId ? !0 : e.runId === t.runId;
|
|
3299
3304
|
}
|
|
3300
|
-
function
|
|
3301
|
-
e.replaceChildren(),
|
|
3305
|
+
function xo(e, t, n, i, o, r, l, p) {
|
|
3306
|
+
e.replaceChildren(), ei(t, !1), t.disabled = !0, n(!1);
|
|
3302
3307
|
const s = document.createElement("div");
|
|
3303
3308
|
s.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter";
|
|
3304
3309
|
const c = ke(
|
|
@@ -3332,7 +3337,7 @@ function Hr(e) {
|
|
|
3332
3337
|
}), t;
|
|
3333
3338
|
}
|
|
3334
3339
|
function Gr(e, t) {
|
|
3335
|
-
const n =
|
|
3340
|
+
const n = Ri(e.id), i = document.createElement("article");
|
|
3336
3341
|
i.className = "pluno-pa-widget__share-prompt";
|
|
3337
3342
|
const o = document.createElement("div");
|
|
3338
3343
|
o.className = "pluno-pa-widget__share-prompt-body", o.appendChild(
|
|
@@ -3370,7 +3375,7 @@ function Gr(e, t) {
|
|
|
3370
3375
|
const m = document.createElement("button");
|
|
3371
3376
|
m.type = "button", m.className = "pluno-pa-widget__share-prompt-draft", m.disabled = t.isActing, m.addEventListener("click", () => {
|
|
3372
3377
|
t.onReferralCopy(e);
|
|
3373
|
-
}), t.isActing ? (m.appendChild(
|
|
3378
|
+
}), t.isActing ? (m.appendChild(Qo()), m.appendChild(document.createTextNode("Copying..."))) : m.textContent = "Copy invite link", c.appendChild(m);
|
|
3374
3379
|
} else
|
|
3375
3380
|
for (const m of $r()) {
|
|
3376
3381
|
const y = document.createElement("a");
|
|
@@ -3410,10 +3415,10 @@ function qr(e) {
|
|
|
3410
3415
|
};
|
|
3411
3416
|
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);
|
|
3412
3417
|
}
|
|
3413
|
-
function
|
|
3414
|
-
return e.role === "tool" && e.toolName ===
|
|
3418
|
+
function Xo(e) {
|
|
3419
|
+
return e.role === "tool" && e.toolName === Ao;
|
|
3415
3420
|
}
|
|
3416
|
-
function
|
|
3421
|
+
function yn(e) {
|
|
3417
3422
|
return e.replace(/\uE200[^\uE201]*(?:\uE201|$)/g, "");
|
|
3418
3423
|
}
|
|
3419
3424
|
function jr(e, t, n, i, o) {
|
|
@@ -3440,9 +3445,9 @@ function jr(e, t, n, i, o) {
|
|
|
3440
3445
|
const g = [...e].reverse().find((y) => y.phase !== "commentary");
|
|
3441
3446
|
e.some(
|
|
3442
3447
|
(y) => y.phase !== "commentary" && y.loading
|
|
3443
|
-
) && c.appendChild(
|
|
3448
|
+
) && c.appendChild(Qo());
|
|
3444
3449
|
const m = document.createElement("span");
|
|
3445
|
-
return m.className = "pluno-pa-widget__tool-summary-title", m.textContent = g ?
|
|
3450
|
+
return m.className = "pluno-pa-widget__tool-summary-title", m.textContent = g ? Zo(g.content) : "Activity", c.appendChild(m), p.appendChild(c), p.appendChild(l), r.appendChild(p), r;
|
|
3446
3451
|
}
|
|
3447
3452
|
function Kr(e, t) {
|
|
3448
3453
|
const n = document.createElement("div");
|
|
@@ -3453,16 +3458,16 @@ function Kr(e, t) {
|
|
|
3453
3458
|
r.className = "pluno-pa-widget__tool-line", r.dataset.eventType = o.phase === "commentary" ? "commentary" : "tool";
|
|
3454
3459
|
const l = document.createElement("span");
|
|
3455
3460
|
l.className = "pluno-pa-widget__tool-line-text";
|
|
3456
|
-
const p =
|
|
3461
|
+
const p = yn(o.content) || (o.phase === "commentary" ? "" : "Run tool"), s = o.phase === "commentary" ? p : Zo(p);
|
|
3457
3462
|
t && o === i && o.phase !== "commentary" && (l.classList.add("pluno-pa-widget__tool-line-text--loading"), l.dataset.loadingText = s), l.textContent = s, r.appendChild(l), n.appendChild(r);
|
|
3458
3463
|
}
|
|
3459
3464
|
return n;
|
|
3460
3465
|
}
|
|
3461
|
-
function
|
|
3466
|
+
function Zo(e) {
|
|
3462
3467
|
const t = e.trim() || "Run tool", n = t.codePointAt(0) ?? 0;
|
|
3463
3468
|
return n >= 126976 && n <= 129791 || n >= 9728 && n <= 10175 || n >= 127462 && n <= 127487 ? t : `🛠️ ${t}`;
|
|
3464
3469
|
}
|
|
3465
|
-
function
|
|
3470
|
+
function Jo(e) {
|
|
3466
3471
|
const t = document.createElement("article");
|
|
3467
3472
|
return t.className = "pluno-pa-widget__tool-group pluno-pa-widget__assistant-marker", t.appendChild(
|
|
3468
3473
|
ke(
|
|
@@ -3471,8 +3476,8 @@ function Zo(e) {
|
|
|
3471
3476
|
)
|
|
3472
3477
|
), t;
|
|
3473
3478
|
}
|
|
3474
|
-
function
|
|
3475
|
-
const t =
|
|
3479
|
+
function yo(e) {
|
|
3480
|
+
const t = Jo(e);
|
|
3476
3481
|
return t.classList.add("pluno-pa-widget__thinking-marker"), t.appendChild(dt()), t;
|
|
3477
3482
|
}
|
|
3478
3483
|
function dt(e = "Thinking...") {
|
|
@@ -3486,14 +3491,14 @@ function dt(e = "Thinking...") {
|
|
|
3486
3491
|
function Vr(e) {
|
|
3487
3492
|
return `tools:${e[0]?.id ?? ""}`;
|
|
3488
3493
|
}
|
|
3489
|
-
function
|
|
3494
|
+
function Qo() {
|
|
3490
3495
|
const e = document.createElement("span");
|
|
3491
3496
|
return e.className = "pluno-pa-widget__spinner", e.setAttribute("aria-hidden", "true"), e;
|
|
3492
3497
|
}
|
|
3493
|
-
function
|
|
3494
|
-
e.setAttribute("aria-label", t ? "Stop" : "Send"), e.classList.toggle("pluno-pa-widget__send--stop", t), e.replaceChildren(t ? br() :
|
|
3498
|
+
function ei(e, t) {
|
|
3499
|
+
e.setAttribute("aria-label", t ? "Stop" : "Send"), e.classList.toggle("pluno-pa-widget__send--stop", t), e.replaceChildren(t ? br() : qo());
|
|
3495
3500
|
}
|
|
3496
|
-
function
|
|
3501
|
+
function pn(e) {
|
|
3497
3502
|
let t = e.trim();
|
|
3498
3503
|
if (!t.includes("|"))
|
|
3499
3504
|
return null;
|
|
@@ -3512,7 +3517,7 @@ function Yr(e) {
|
|
|
3512
3517
|
return t.startsWith(":") && t.endsWith(":") ? "center" : t.endsWith(":") ? "right" : t.startsWith(":") ? "left" : null;
|
|
3513
3518
|
}
|
|
3514
3519
|
function Xr(e, t) {
|
|
3515
|
-
const n =
|
|
3520
|
+
const n = pn(e[t] ?? ""), i = pn(e[t + 1] ?? "");
|
|
3516
3521
|
if (!n || !i || n.length !== i.length)
|
|
3517
3522
|
return null;
|
|
3518
3523
|
const o = [];
|
|
@@ -3532,7 +3537,7 @@ function Xr(e, t) {
|
|
|
3532
3537
|
const c = document.createElement("tbody");
|
|
3533
3538
|
let g = t + 2;
|
|
3534
3539
|
for (; g < e.length && e[g].trim(); ) {
|
|
3535
|
-
const h =
|
|
3540
|
+
const h = pn(e[g]);
|
|
3536
3541
|
if (!h)
|
|
3537
3542
|
break;
|
|
3538
3543
|
const m = document.createElement("tr");
|
|
@@ -3544,7 +3549,7 @@ function Xr(e, t) {
|
|
|
3544
3549
|
return l.appendChild(c), r.appendChild(l), { element: r, nextIndex: g };
|
|
3545
3550
|
}
|
|
3546
3551
|
function Zr(e, t) {
|
|
3547
|
-
const n =
|
|
3552
|
+
const n = Ji(t).replace(/\r\n/g, `
|
|
3548
3553
|
`).split(`
|
|
3549
3554
|
`);
|
|
3550
3555
|
let i = 0;
|
|
@@ -3643,7 +3648,7 @@ function Jr(e) {
|
|
|
3643
3648
|
return !1;
|
|
3644
3649
|
}
|
|
3645
3650
|
}
|
|
3646
|
-
function
|
|
3651
|
+
function vo(e, t) {
|
|
3647
3652
|
if (Qr(e))
|
|
3648
3653
|
return;
|
|
3649
3654
|
const n = `
|
|
@@ -5635,8 +5640,8 @@ function xo(e, t) {
|
|
|
5635
5640
|
.pluno-pa-widget--scribble .pluno-pa-widget__scribble-spirals--panel {
|
|
5636
5641
|
position: absolute;
|
|
5637
5642
|
top: -16px;
|
|
5638
|
-
left: ${
|
|
5639
|
-
width: calc(100% - ${
|
|
5643
|
+
left: ${mn}px;
|
|
5644
|
+
width: calc(100% - ${mn * 2}px);
|
|
5640
5645
|
height: 36px;
|
|
5641
5646
|
z-index: 3;
|
|
5642
5647
|
filter: url(#pluno-pa-scribble-wobble-2);
|
|
@@ -6015,20 +6020,20 @@ function xo(e, t) {
|
|
|
6015
6020
|
if (el(e, n))
|
|
6016
6021
|
return;
|
|
6017
6022
|
const i = e.ownerDocument.createElement("style");
|
|
6018
|
-
i.id =
|
|
6023
|
+
i.id = Uo, i.textContent = n, e.appendChild(i), ti(e);
|
|
6019
6024
|
}
|
|
6020
6025
|
function Qr(e) {
|
|
6021
|
-
return e.getElementById(
|
|
6026
|
+
return e.getElementById(Uo) !== null || e.host instanceof HTMLElement && e.host.getAttribute(Bo) === "true";
|
|
6022
6027
|
}
|
|
6023
|
-
function
|
|
6024
|
-
e.host instanceof HTMLElement && e.host.setAttribute(
|
|
6028
|
+
function ti(e) {
|
|
6029
|
+
e.host instanceof HTMLElement && e.host.setAttribute(Bo, "true");
|
|
6025
6030
|
}
|
|
6026
6031
|
function el(e, t) {
|
|
6027
6032
|
if (typeof CSSStyleSheet > "u" || typeof CSSStyleSheet.prototype.replaceSync != "function" || !("adoptedStyleSheets" in e))
|
|
6028
6033
|
return !1;
|
|
6029
6034
|
try {
|
|
6030
6035
|
const n = new CSSStyleSheet();
|
|
6031
|
-
return n.replaceSync(t), e.adoptedStyleSheets = [...e.adoptedStyleSheets, n],
|
|
6036
|
+
return n.replaceSync(t), e.adoptedStyleSheets = [...e.adoptedStyleSheets, n], ti(e), !0;
|
|
6032
6037
|
} catch {
|
|
6033
6038
|
return !1;
|
|
6034
6039
|
}
|
|
@@ -6041,25 +6046,25 @@ async function tl() {
|
|
|
6041
6046
|
t.observe(document.documentElement, { childList: !0 });
|
|
6042
6047
|
});
|
|
6043
6048
|
}
|
|
6044
|
-
function
|
|
6049
|
+
function kn(e) {
|
|
6045
6050
|
return `pluno.productAgent.widgetState.${location.origin}.${e.backendUrl ?? ""}.${e.tokenEndpoint ?? ""}.${e.position ?? ""}`;
|
|
6046
6051
|
}
|
|
6047
|
-
function
|
|
6048
|
-
return `${
|
|
6052
|
+
function ni(e) {
|
|
6053
|
+
return `${kn(e)}.displayState`;
|
|
6049
6054
|
}
|
|
6050
6055
|
function nl(e) {
|
|
6051
6056
|
try {
|
|
6052
6057
|
return window.sessionStorage.getItem(
|
|
6053
|
-
|
|
6058
|
+
ni(e)
|
|
6054
6059
|
) === "minimized" ? "minimized" : "shown";
|
|
6055
6060
|
} catch {
|
|
6056
6061
|
return "shown";
|
|
6057
6062
|
}
|
|
6058
6063
|
}
|
|
6059
|
-
function
|
|
6064
|
+
function So(e, t) {
|
|
6060
6065
|
if (e.layout === "floating")
|
|
6061
6066
|
try {
|
|
6062
|
-
const n =
|
|
6067
|
+
const n = ni(e);
|
|
6063
6068
|
if (t === "minimized") {
|
|
6064
6069
|
window.sessionStorage.setItem(n, t);
|
|
6065
6070
|
return;
|
|
@@ -6074,10 +6079,10 @@ function ol(e) {
|
|
|
6074
6079
|
return { clientId: e, release: () => {
|
|
6075
6080
|
} };
|
|
6076
6081
|
let t = 0;
|
|
6077
|
-
for (;
|
|
6082
|
+
for (; Jt.has(t); )
|
|
6078
6083
|
t += 1;
|
|
6079
|
-
|
|
6080
|
-
const n = `${
|
|
6084
|
+
Jt.add(t);
|
|
6085
|
+
const n = `${ga}${t}`;
|
|
6081
6086
|
let i = crypto.randomUUID();
|
|
6082
6087
|
try {
|
|
6083
6088
|
i = window.sessionStorage.getItem(n) ?? i, window.sessionStorage.setItem(n, i);
|
|
@@ -6087,15 +6092,15 @@ function ol(e) {
|
|
|
6087
6092
|
return {
|
|
6088
6093
|
clientId: i,
|
|
6089
6094
|
release: () => {
|
|
6090
|
-
o || (o = !0,
|
|
6095
|
+
o || (o = !0, Jt.delete(t));
|
|
6091
6096
|
}
|
|
6092
6097
|
};
|
|
6093
6098
|
}
|
|
6094
6099
|
function il(e) {
|
|
6095
6100
|
try {
|
|
6096
|
-
const t = window.localStorage.getItem(
|
|
6101
|
+
const t = window.localStorage.getItem(kn(e));
|
|
6097
6102
|
if (!t)
|
|
6098
|
-
return
|
|
6103
|
+
return Co();
|
|
6099
6104
|
const n = JSON.parse(t);
|
|
6100
6105
|
return {
|
|
6101
6106
|
isOpen: n.isOpen === !0,
|
|
@@ -6106,19 +6111,19 @@ function il(e) {
|
|
|
6106
6111
|
(i) => typeof i == "string"
|
|
6107
6112
|
) : [],
|
|
6108
6113
|
launcherPosition: sl(n.launcherPosition) ? n.launcherPosition : null,
|
|
6109
|
-
panelSize: pl(n.panelSize) ?
|
|
6110
|
-
seenShareCandidateIds: Array.isArray(n.seenShareCandidateIds) ? n.seenShareCandidateIds.filter((i) => typeof i == "string").slice(-
|
|
6114
|
+
panelSize: pl(n.panelSize) ? At(n.panelSize) : null,
|
|
6115
|
+
seenShareCandidateIds: Array.isArray(n.seenShareCandidateIds) ? n.seenShareCandidateIds.filter((i) => typeof i == "string").slice(-Io) : [],
|
|
6111
6116
|
sharePromptsDisabled: n.sharePromptsDisabled === !0
|
|
6112
6117
|
};
|
|
6113
6118
|
} catch {
|
|
6114
|
-
return
|
|
6119
|
+
return Co();
|
|
6115
6120
|
}
|
|
6116
6121
|
}
|
|
6117
6122
|
async function al(e) {
|
|
6118
6123
|
if (e.loadSharePromptsDisabled)
|
|
6119
6124
|
return e.loadSharePromptsDisabled();
|
|
6120
6125
|
try {
|
|
6121
|
-
return window.localStorage.getItem(
|
|
6126
|
+
return window.localStorage.getItem(No) === "true";
|
|
6122
6127
|
} catch {
|
|
6123
6128
|
return !1;
|
|
6124
6129
|
}
|
|
@@ -6132,12 +6137,12 @@ function rl(e, t) {
|
|
|
6132
6137
|
return;
|
|
6133
6138
|
}
|
|
6134
6139
|
try {
|
|
6135
|
-
t && window.localStorage.setItem(
|
|
6140
|
+
t && window.localStorage.setItem(No, "true");
|
|
6136
6141
|
} catch {
|
|
6137
6142
|
return;
|
|
6138
6143
|
}
|
|
6139
6144
|
}
|
|
6140
|
-
function
|
|
6145
|
+
function Co() {
|
|
6141
6146
|
return {
|
|
6142
6147
|
isOpen: !1,
|
|
6143
6148
|
composerValue: "",
|
|
@@ -6153,7 +6158,7 @@ function vo() {
|
|
|
6153
6158
|
function ll(e, t) {
|
|
6154
6159
|
try {
|
|
6155
6160
|
window.localStorage.setItem(
|
|
6156
|
-
|
|
6161
|
+
kn(e),
|
|
6157
6162
|
JSON.stringify(t)
|
|
6158
6163
|
);
|
|
6159
6164
|
} catch {
|
|
@@ -6172,7 +6177,7 @@ function pl(e) {
|
|
|
6172
6177
|
const t = e;
|
|
6173
6178
|
return typeof t.width == "number" && Number.isFinite(t.width) && typeof t.height == "number" && Number.isFinite(t.height);
|
|
6174
6179
|
}
|
|
6175
|
-
async function
|
|
6180
|
+
async function oi(e, t) {
|
|
6176
6181
|
const n = await fetch(e, {
|
|
6177
6182
|
method: "POST",
|
|
6178
6183
|
credentials: "include",
|
|
@@ -6184,7 +6189,7 @@ async function ni(e, t) {
|
|
|
6184
6189
|
...t ? { signal: t } : {}
|
|
6185
6190
|
});
|
|
6186
6191
|
if (!n.ok) {
|
|
6187
|
-
const o = await n.text(), r =
|
|
6192
|
+
const o = await n.text(), r = Ei(o);
|
|
6188
6193
|
throw r ? (console.error(r), new Error(r)) : new Error(`Failed to load Pluno token (${n.status})`);
|
|
6189
6194
|
}
|
|
6190
6195
|
const i = await n.json();
|
|
@@ -6199,8 +6204,8 @@ function dl(e) {
|
|
|
6199
6204
|
let r = !1;
|
|
6200
6205
|
const l = new Promise((p, s) => {
|
|
6201
6206
|
const c = window.setTimeout(() => {
|
|
6202
|
-
r = !0, o.abort(), s(new Error(
|
|
6203
|
-
},
|
|
6207
|
+
r = !0, o.abort(), s(new Error(Zn));
|
|
6208
|
+
}, ca);
|
|
6204
6209
|
o.signal.addEventListener(
|
|
6205
6210
|
"abort",
|
|
6206
6211
|
() => window.clearTimeout(c),
|
|
@@ -6209,12 +6214,12 @@ function dl(e) {
|
|
|
6209
6214
|
});
|
|
6210
6215
|
try {
|
|
6211
6216
|
const p = await Promise.race([
|
|
6212
|
-
|
|
6217
|
+
oi(e, o.signal),
|
|
6213
6218
|
l
|
|
6214
6219
|
]);
|
|
6215
6220
|
return o.abort(), p;
|
|
6216
6221
|
} catch (p) {
|
|
6217
|
-
throw o.abort(), r ? new Error(
|
|
6222
|
+
throw o.abort(), r ? new Error(Zn) : p instanceof Error && p.message.startsWith("Pluno widget blocked on ") ? p : new Error(ua);
|
|
6218
6223
|
}
|
|
6219
6224
|
};
|
|
6220
6225
|
return {
|
|
@@ -6237,30 +6242,30 @@ function dl(e) {
|
|
|
6237
6242
|
}
|
|
6238
6243
|
};
|
|
6239
6244
|
}
|
|
6240
|
-
const
|
|
6245
|
+
const Eo = /* @__PURE__ */ new WeakSet();
|
|
6241
6246
|
function cl(e) {
|
|
6242
6247
|
return Object.keys(e.dataset).some((t) => t.startsWith("pluno"));
|
|
6243
6248
|
}
|
|
6244
|
-
function
|
|
6249
|
+
function ko(e) {
|
|
6245
6250
|
const t = e.pathname.split("/");
|
|
6246
6251
|
return t[t.length - 1] ?? "";
|
|
6247
6252
|
}
|
|
6248
6253
|
function ul(e, t) {
|
|
6249
6254
|
const n = new URL(e.src, document.baseURI);
|
|
6250
|
-
return n.href === t.href || n.pathname === t.pathname ? !0 :
|
|
6255
|
+
return n.href === t.href || n.pathname === t.pathname ? !0 : ko(n) === ko(t);
|
|
6251
6256
|
}
|
|
6252
6257
|
class xe extends EventTarget {
|
|
6253
6258
|
constructor(t, n) {
|
|
6254
|
-
super(), this.channelId = n, this.url = t, this.addPreviewListener(
|
|
6259
|
+
super(), this.channelId = n, this.url = t, this.addPreviewListener(ra, () => {
|
|
6255
6260
|
this.readyState = xe.OPEN, this.dispatchEvent(new Event("open"));
|
|
6256
|
-
}), this.addPreviewListener(
|
|
6261
|
+
}), this.addPreviewListener(la, (i) => {
|
|
6257
6262
|
const o = i;
|
|
6258
6263
|
this.dispatchEvent(
|
|
6259
6264
|
new MessageEvent("message", { data: o.detail?.data ?? "" })
|
|
6260
6265
|
);
|
|
6261
|
-
}), this.addPreviewListener(
|
|
6266
|
+
}), this.addPreviewListener(sa, () => {
|
|
6262
6267
|
this.readyState = xe.CLOSED, this.dispatchEvent(new Event("error")), this.cleanup();
|
|
6263
|
-
}), this.addPreviewListener(
|
|
6268
|
+
}), this.addPreviewListener(pa, (i) => {
|
|
6264
6269
|
const o = i;
|
|
6265
6270
|
this.readyState = xe.CLOSED, this.dispatchEvent(
|
|
6266
6271
|
new CloseEvent("close", {
|
|
@@ -6272,7 +6277,7 @@ class xe extends EventTarget {
|
|
|
6272
6277
|
}), window.dispatchEvent(
|
|
6273
6278
|
new CustomEvent(
|
|
6274
6279
|
St(
|
|
6275
|
-
|
|
6280
|
+
oa,
|
|
6276
6281
|
this.channelId
|
|
6277
6282
|
),
|
|
6278
6283
|
{
|
|
@@ -6302,7 +6307,7 @@ class xe extends EventTarget {
|
|
|
6302
6307
|
);
|
|
6303
6308
|
window.dispatchEvent(
|
|
6304
6309
|
new CustomEvent(
|
|
6305
|
-
St(
|
|
6310
|
+
St(ia, this.channelId),
|
|
6306
6311
|
{
|
|
6307
6312
|
detail: {
|
|
6308
6313
|
socketId: this.socketId,
|
|
@@ -6315,7 +6320,7 @@ class xe extends EventTarget {
|
|
|
6315
6320
|
close(t, n) {
|
|
6316
6321
|
this.readyState !== xe.CLOSED && (this.readyState = xe.CLOSING, window.dispatchEvent(
|
|
6317
6322
|
new CustomEvent(
|
|
6318
|
-
St(
|
|
6323
|
+
St(aa, this.channelId),
|
|
6319
6324
|
{
|
|
6320
6325
|
detail: { socketId: this.socketId, code: t, reason: n }
|
|
6321
6326
|
}
|
|
@@ -6339,12 +6344,12 @@ class xe extends EventTarget {
|
|
|
6339
6344
|
}
|
|
6340
6345
|
function gl() {
|
|
6341
6346
|
const e = window.sessionStorage.getItem(
|
|
6342
|
-
|
|
6347
|
+
Xn
|
|
6343
6348
|
);
|
|
6344
6349
|
if (e)
|
|
6345
6350
|
return e;
|
|
6346
6351
|
const t = crypto.randomUUID();
|
|
6347
|
-
return window.sessionStorage.setItem(
|
|
6352
|
+
return window.sessionStorage.setItem(Xn, t), t;
|
|
6348
6353
|
}
|
|
6349
6354
|
function St(e, t) {
|
|
6350
6355
|
return `${e}:${t}`;
|
|
@@ -6362,17 +6367,17 @@ function hl(e) {
|
|
|
6362
6367
|
}
|
|
6363
6368
|
function ml(e) {
|
|
6364
6369
|
for (const t of hl(e))
|
|
6365
|
-
|
|
6370
|
+
Eo.has(t) || t.dataset.plunoAutoMount === "false" || (Eo.add(t), ii(t).catch((n) => {
|
|
6366
6371
|
console.error("Failed to mount Pluno widget", n);
|
|
6367
6372
|
}));
|
|
6368
6373
|
}
|
|
6369
|
-
function
|
|
6374
|
+
function ii(e) {
|
|
6370
6375
|
const t = window, n = t[be];
|
|
6371
6376
|
if (n) {
|
|
6372
6377
|
if (n.host === null)
|
|
6373
6378
|
return n.mountPromise.catch(() => {
|
|
6374
6379
|
const s = t[be];
|
|
6375
|
-
return s ? s.mountPromise :
|
|
6380
|
+
return s ? s.mountPromise : ii(e);
|
|
6376
6381
|
});
|
|
6377
6382
|
if (fl(n.host))
|
|
6378
6383
|
return n.retryPendingTokenFailureOnce?.(), n.mountPromise;
|
|
@@ -6380,12 +6385,12 @@ function oi(e) {
|
|
|
6380
6385
|
}
|
|
6381
6386
|
const i = e.dataset.plunoPreviewChannel, o = e.dataset.plunoTokenEndpoint, r = !e.dataset.plunoToken && !i && o ? dl(o) : null;
|
|
6382
6387
|
let l;
|
|
6383
|
-
const p =
|
|
6388
|
+
const p = Ra({
|
|
6384
6389
|
token: e.dataset.plunoToken,
|
|
6385
6390
|
tokenProvider: r?.loadToken,
|
|
6386
6391
|
tokenEndpoint: o,
|
|
6387
6392
|
backendUrl: e.dataset.plunoBackendUrl,
|
|
6388
|
-
webSocketFactory: i ?
|
|
6393
|
+
webSocketFactory: i ? Na(i) : void 0,
|
|
6389
6394
|
launcherLabel: e.dataset.plunoLauncherLabel,
|
|
6390
6395
|
accentColor: e.dataset.plunoAccentColor,
|
|
6391
6396
|
colorScheme: e.dataset.plunoColorScheme === "dark" ? "dark" : "light",
|
|
@@ -6398,7 +6403,7 @@ function oi(e) {
|
|
|
6398
6403
|
return;
|
|
6399
6404
|
}
|
|
6400
6405
|
const c = s.host;
|
|
6401
|
-
c.setAttribute(
|
|
6406
|
+
c.setAttribute(Po, "true"), l.host = c, l.destroy = () => {
|
|
6402
6407
|
t[be] === l && delete t[be], l.host = null, l.destroy = null, s.destroy();
|
|
6403
6408
|
};
|
|
6404
6409
|
}).catch((s) => {
|
|
@@ -6412,10 +6417,10 @@ function oi(e) {
|
|
|
6412
6417
|
}, t[be] = l, p;
|
|
6413
6418
|
}
|
|
6414
6419
|
function fl(e) {
|
|
6415
|
-
return e.isConnected && e.getAttribute(
|
|
6420
|
+
return e.isConnected && e.getAttribute(Po) === "true" && !!e.shadowRoot?.querySelector(".pluno-pa-widget__launcher") && !!e.shadowRoot?.querySelector(".pluno-pa-widget__panel");
|
|
6416
6421
|
}
|
|
6417
6422
|
ml(import.meta.url);
|
|
6418
6423
|
export {
|
|
6419
|
-
|
|
6420
|
-
|
|
6424
|
+
Na as createProductAgentPreviewBridgeWebSocketFactory,
|
|
6425
|
+
Ra as mountPlunoProductAgentWidget
|
|
6421
6426
|
};
|