@pluno/product-agent-web 0.1.64 → 0.1.66
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -0
- package/dist/product-agent-sdk.js +153 -149
- package/dist/product-agent-widget.js +1772 -1442
- package/package.json +1 -1
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { PlunoProductAgent as
|
|
2
|
-
const
|
|
3
|
-
function
|
|
4
|
-
const t =
|
|
5
|
-
if (
|
|
1
|
+
import { PlunoProductAgent as qo, getProductAgentOriginAccessErrorMessage as jo } from "./product-agent-sdk.js";
|
|
2
|
+
const Vo = "#7c3aed", pt = "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", st = "#2c2a1e", fn = [253, 250, 241], wn = 3.5;
|
|
3
|
+
function Kn(e) {
|
|
4
|
+
const t = Yn(e);
|
|
5
|
+
if (bn(Ke(t), fn) >= wn)
|
|
6
6
|
return t;
|
|
7
|
-
let
|
|
8
|
-
const i =
|
|
7
|
+
let o = Ke(t);
|
|
8
|
+
const i = Ke(st);
|
|
9
9
|
for (let r = 0; r < 6; r += 1)
|
|
10
|
-
if (
|
|
11
|
-
return
|
|
12
|
-
return
|
|
10
|
+
if (o = Xo(o, i, 0.22), bn(o, fn) >= wn)
|
|
11
|
+
return Ft(o);
|
|
12
|
+
return Ft(o);
|
|
13
13
|
}
|
|
14
|
-
function
|
|
15
|
-
let
|
|
14
|
+
function Ko() {
|
|
15
|
+
let n = "M 280 120", o = !1, i = 0;
|
|
16
16
|
for (let r = 150; r <= 1170; r += 62) {
|
|
17
|
-
const l = (i % 3 - 1) * 18, p =
|
|
18
|
-
|
|
17
|
+
const l = (i % 3 - 1) * 18, p = o ? 280 - l : 1020 + l;
|
|
18
|
+
n += ` L ${p} ${r}`, o = !o, i += 1;
|
|
19
19
|
}
|
|
20
|
-
return
|
|
20
|
+
return n;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
const t =
|
|
24
|
-
return
|
|
22
|
+
function Yo(e) {
|
|
23
|
+
const t = Yn(e), n = Ht(Ke(t));
|
|
24
|
+
return n > 0.86 ? {
|
|
25
25
|
top: "#ffffff",
|
|
26
26
|
middle: "#f6f6f6",
|
|
27
27
|
bottom: "#e7e7e7",
|
|
@@ -32,7 +32,7 @@ function Lo(e) {
|
|
|
32
32
|
highlight: "#ffffff",
|
|
33
33
|
inner: "#f4f4f4",
|
|
34
34
|
shadow: "#9d9d9d"
|
|
35
|
-
} :
|
|
35
|
+
} : n < 0.05 ? {
|
|
36
36
|
top: "#3d3d3d",
|
|
37
37
|
middle: "#171717",
|
|
38
38
|
bottom: "#030303",
|
|
@@ -44,179 +44,179 @@ function Lo(e) {
|
|
|
44
44
|
inner: "#4b4b4b",
|
|
45
45
|
shadow: "#000000"
|
|
46
46
|
} : {
|
|
47
|
-
top:
|
|
48
|
-
middle:
|
|
49
|
-
bottom:
|
|
50
|
-
edgeStart:
|
|
51
|
-
edgeMiddle:
|
|
52
|
-
edgeEnd:
|
|
53
|
-
glow:
|
|
54
|
-
highlight:
|
|
55
|
-
inner:
|
|
56
|
-
shadow:
|
|
47
|
+
top: ne(t, 0.28, -0.03),
|
|
48
|
+
middle: ne(t, 0.08, 0.04),
|
|
49
|
+
bottom: ne(t, -0.1, 0.02),
|
|
50
|
+
edgeStart: ne(t, 0.08, 0.08),
|
|
51
|
+
edgeMiddle: ne(t, -0.08, 0.08),
|
|
52
|
+
edgeEnd: ne(t, -0.18, 0.05),
|
|
53
|
+
glow: ne(t, 0.32, -0.12),
|
|
54
|
+
highlight: ne(t, 0.38, -0.18),
|
|
55
|
+
inner: ne(t, 0.24, -0.1),
|
|
56
|
+
shadow: ne(t, -0.25, -0.08)
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function Yn(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((
|
|
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()}` : Vo;
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function Ke(e) {
|
|
64
64
|
return [
|
|
65
65
|
Number.parseInt(e.slice(1, 3), 16),
|
|
66
66
|
Number.parseInt(e.slice(3, 5), 16),
|
|
67
67
|
Number.parseInt(e.slice(5, 7), 16)
|
|
68
68
|
];
|
|
69
69
|
}
|
|
70
|
-
function
|
|
71
|
-
const
|
|
72
|
-
return `#${
|
|
70
|
+
function Ft([e, t, n]) {
|
|
71
|
+
const o = (i) => Math.max(0, Math.min(255, Math.round(i))).toString(16).padStart(2, "0");
|
|
72
|
+
return `#${o(e)}${o(t)}${o(n)}`;
|
|
73
73
|
}
|
|
74
|
-
function
|
|
75
|
-
const
|
|
74
|
+
function Ht([e, t, n]) {
|
|
75
|
+
const o = (i) => {
|
|
76
76
|
const r = i / 255;
|
|
77
77
|
return r <= 0.04045 ? r / 12.92 : ((r + 0.055) / 1.055) ** 2.4;
|
|
78
78
|
};
|
|
79
|
-
return 0.2126 *
|
|
79
|
+
return 0.2126 * o(e) + 0.7152 * o(t) + 0.0722 * o(n);
|
|
80
80
|
}
|
|
81
|
-
function
|
|
82
|
-
const
|
|
81
|
+
function bn(e, t) {
|
|
82
|
+
const n = Ht(e), o = Ht(t), [i, r] = n > o ? [n, o] : [o, n];
|
|
83
83
|
return (i + 0.05) / (r + 0.05);
|
|
84
84
|
}
|
|
85
|
-
function
|
|
86
|
-
const
|
|
85
|
+
function Xo(e, t, n) {
|
|
86
|
+
const o = Wt(n);
|
|
87
87
|
return [
|
|
88
|
-
e[0] + (t[0] - e[0]) *
|
|
89
|
-
e[1] + (t[1] - e[1]) *
|
|
90
|
-
e[2] + (t[2] - e[2]) *
|
|
88
|
+
e[0] + (t[0] - e[0]) * o,
|
|
89
|
+
e[1] + (t[1] - e[1]) * o,
|
|
90
|
+
e[2] + (t[2] - e[2]) * o
|
|
91
91
|
];
|
|
92
92
|
}
|
|
93
|
-
function
|
|
94
|
-
const [
|
|
95
|
-
return
|
|
93
|
+
function ne(e, t, n) {
|
|
94
|
+
const [o, i, r] = Zo(Ke(e));
|
|
95
|
+
return Ft(Jo(o, Wt(i + n), Wt(r + t)));
|
|
96
96
|
}
|
|
97
|
-
function
|
|
98
|
-
const
|
|
97
|
+
function Zo([e, t, n]) {
|
|
98
|
+
const o = e / 255, i = t / 255, r = n / 255, l = Math.max(o, i, r), p = Math.min(o, i, r), d = (l + p) / 2;
|
|
99
99
|
if (l === p)
|
|
100
100
|
return [0, 0, d];
|
|
101
|
-
const
|
|
102
|
-
return [(l ===
|
|
101
|
+
const c = l - p, u = d > 0.5 ? c / (2 - l - p) : c / (l + p);
|
|
102
|
+
return [(l === o ? (i - r) / c + (i < r ? 6 : 0) : l === i ? (r - o) / c + 2 : (o - i) / c + 4) / 6, u, d];
|
|
103
103
|
}
|
|
104
|
-
function
|
|
104
|
+
function Jo(e, t, n) {
|
|
105
105
|
if (t === 0)
|
|
106
|
-
return [
|
|
107
|
-
const
|
|
106
|
+
return [n * 255, n * 255, n * 255];
|
|
107
|
+
const o = n < 0.5 ? n * (1 + t) : n + t - n * t, i = 2 * n - o;
|
|
108
108
|
return [
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
109
|
+
At(i, o, e + 1 / 3) * 255,
|
|
110
|
+
At(i, o, e) * 255,
|
|
111
|
+
At(i, o, e - 1 / 3) * 255
|
|
112
112
|
];
|
|
113
113
|
}
|
|
114
|
-
function
|
|
115
|
-
let
|
|
116
|
-
return
|
|
114
|
+
function At(e, t, n) {
|
|
115
|
+
let o = n;
|
|
116
|
+
return o < 0 && (o += 1), o > 1 && (o -= 1), o < 1 / 6 ? e + (t - e) * 6 * o : o < 1 / 2 ? t : o < 2 / 3 ? e + (t - e) * (2 / 3 - o) * 6 : e;
|
|
117
117
|
}
|
|
118
|
-
function
|
|
118
|
+
function Wt(e) {
|
|
119
119
|
return Math.max(0, Math.min(1, e));
|
|
120
120
|
}
|
|
121
|
-
const
|
|
122
|
-
function
|
|
121
|
+
const Xn = "suggest_share_on_socials";
|
|
122
|
+
function Qo(e) {
|
|
123
123
|
for (let t = e.length - 1; t >= 0; t -= 1) {
|
|
124
|
-
const
|
|
125
|
-
if (
|
|
124
|
+
const n = e[t];
|
|
125
|
+
if (n.role !== "tool" || n.toolName !== Xn)
|
|
126
126
|
continue;
|
|
127
|
-
const
|
|
128
|
-
if (!
|
|
127
|
+
const o = _n(e, t, "assistant");
|
|
128
|
+
if (!o)
|
|
129
129
|
return null;
|
|
130
|
-
const i =
|
|
130
|
+
const i = _n(e, o.index, "user");
|
|
131
131
|
return i ? {
|
|
132
|
-
id: `share:${
|
|
132
|
+
id: `share:${n.callId ?? n.id}`,
|
|
133
133
|
userPrompt: i.content,
|
|
134
|
-
assistantAnswer:
|
|
134
|
+
assistantAnswer: o.content
|
|
135
135
|
} : null;
|
|
136
136
|
}
|
|
137
137
|
return null;
|
|
138
138
|
}
|
|
139
|
-
async function
|
|
140
|
-
const t = await
|
|
139
|
+
async function ei(e) {
|
|
140
|
+
const t = await ti(e);
|
|
141
141
|
if (!navigator.clipboard || typeof ClipboardItem > "u")
|
|
142
142
|
throw new Error("Image copy is not supported in this browser. Download the screenshot instead.");
|
|
143
143
|
await navigator.clipboard.write([new ClipboardItem({ [t.type || "image/png"]: t })]);
|
|
144
144
|
}
|
|
145
|
-
function
|
|
146
|
-
for (let
|
|
147
|
-
const i = e[
|
|
148
|
-
if (i.role ===
|
|
149
|
-
return { index:
|
|
145
|
+
function _n(e, t, n) {
|
|
146
|
+
for (let o = t - 1; o >= 0; o -= 1) {
|
|
147
|
+
const i = e[o];
|
|
148
|
+
if (i.role === n && i.content.trim())
|
|
149
|
+
return { index: o, content: i.content.trim() };
|
|
150
150
|
}
|
|
151
151
|
return null;
|
|
152
152
|
}
|
|
153
|
-
async function
|
|
153
|
+
async function ti(e) {
|
|
154
154
|
return await (await fetch(e)).blob();
|
|
155
155
|
}
|
|
156
|
-
const
|
|
157
|
-
function
|
|
158
|
-
let
|
|
156
|
+
const ni = "https://app.pluno.ai", oi = "/api/product-agent/embed/active-users", ii = 1800, ai = 15e3, ri = 250, li = 1e3, pi = 3e4;
|
|
157
|
+
function si(e, t = {}) {
|
|
158
|
+
let n = !1, o = null, i = null, r = null;
|
|
159
159
|
const l = () => {
|
|
160
160
|
r !== null && (window.clearInterval(r), r = null);
|
|
161
|
-
}, p = (
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
},
|
|
165
|
-
}, d = (
|
|
166
|
-
if (l(),
|
|
167
|
-
|
|
161
|
+
}, p = (u) => {
|
|
162
|
+
n || (i !== null && window.clearTimeout(i), i = window.setTimeout(() => {
|
|
163
|
+
c();
|
|
164
|
+
}, ui(u)));
|
|
165
|
+
}, d = (u) => {
|
|
166
|
+
if (l(), o === null) {
|
|
167
|
+
o = u, e(u);
|
|
168
168
|
return;
|
|
169
169
|
}
|
|
170
|
-
const
|
|
170
|
+
const m = o, k = performance.now();
|
|
171
171
|
r = window.setInterval(() => {
|
|
172
|
-
if (
|
|
172
|
+
if (n) {
|
|
173
173
|
l();
|
|
174
174
|
return;
|
|
175
175
|
}
|
|
176
|
-
const
|
|
177
|
-
|
|
178
|
-
},
|
|
179
|
-
},
|
|
176
|
+
const v = Math.min(1, (performance.now() - k) / ii);
|
|
177
|
+
o = Math.round(m + (u - m) * gi(v)), e(o), v >= 1 && (o = u, e(u), l());
|
|
178
|
+
}, ri);
|
|
179
|
+
}, c = async () => {
|
|
180
180
|
try {
|
|
181
|
-
const
|
|
182
|
-
if (
|
|
181
|
+
const u = await di(t);
|
|
182
|
+
if (n)
|
|
183
183
|
return;
|
|
184
|
-
d(
|
|
184
|
+
d(u.count), p(u.refreshAfterMs);
|
|
185
185
|
} catch {
|
|
186
|
-
p(
|
|
186
|
+
p(ai);
|
|
187
187
|
}
|
|
188
188
|
};
|
|
189
|
-
return
|
|
190
|
-
|
|
189
|
+
return c(), () => {
|
|
190
|
+
n = !0, i !== null && window.clearTimeout(i), l();
|
|
191
191
|
};
|
|
192
192
|
}
|
|
193
|
-
async function
|
|
193
|
+
async function di(e) {
|
|
194
194
|
if (e.loader)
|
|
195
195
|
return e.loader();
|
|
196
|
-
const
|
|
196
|
+
const n = await (e.fetcher ?? fetch)(new URL(oi, ci(e.backendUrl ?? ni)).toString(), {
|
|
197
197
|
cache: "no-store",
|
|
198
198
|
credentials: "omit"
|
|
199
199
|
});
|
|
200
|
-
if (!
|
|
200
|
+
if (!n.ok)
|
|
201
201
|
throw new Error("Failed to load active users");
|
|
202
|
-
const
|
|
202
|
+
const o = await n.json(), i = xn(o.count), r = xn(o.refreshAfterMs ?? o.refresh_after_ms);
|
|
203
203
|
if (i === null || r === null)
|
|
204
204
|
throw new Error("Invalid active users response");
|
|
205
205
|
return { count: i, refreshAfterMs: r };
|
|
206
206
|
}
|
|
207
|
-
function
|
|
207
|
+
function xn(e) {
|
|
208
208
|
return typeof e != "number" || !Number.isFinite(e) || e < 0 ? null : Math.round(e);
|
|
209
209
|
}
|
|
210
|
-
function
|
|
210
|
+
function ci(e) {
|
|
211
211
|
return e.endsWith("/") ? e : `${e}/`;
|
|
212
212
|
}
|
|
213
|
-
function
|
|
214
|
-
return Math.min(
|
|
213
|
+
function ui(e) {
|
|
214
|
+
return Math.min(pi, Math.max(li, e));
|
|
215
215
|
}
|
|
216
|
-
function
|
|
216
|
+
function gi(e) {
|
|
217
217
|
return e < 0.5 ? 4 * e * e * e : 1 - Math.pow(-2 * e + 2, 3) / 2;
|
|
218
218
|
}
|
|
219
|
-
const
|
|
219
|
+
const Zn = 100, hi = 1e4, mi = 5e3, fi = "product-agent:sdk-preview-socket-connect", wi = "product-agent:sdk-preview-socket-send", bi = "product-agent:sdk-preview-socket-close", _i = "product-agent:sdk-preview-socket-open", xi = "product-agent:sdk-preview-socket-message", yi = "product-agent:sdk-preview-socket-error", vi = "product-agent:sdk-preview-socket-closed", yn = "product-agent:sdk-preview-socket-id", Ci = "data-pluno-sdk-preview-channel", Si = "product-agent:preview-diagnostic", Jn = "pluno.productAgent.sharePromptsDisabled", Ei = 3, vn = 'dialog[open], [aria-modal="true"], [role="dialog"]', ki = 400, Li = 5e3, Pi = 500, Cn = "Close the page's popup to chat", Ii = "No recent chats for this page yet.", oe = {
|
|
220
220
|
launcherLabel: "Ask for anything...",
|
|
221
221
|
accentColor: "#7c3aed",
|
|
222
222
|
colorScheme: "light",
|
|
@@ -224,7 +224,7 @@ const On = 100, jo = 1e4, Vo = 5e3, Ko = "product-agent:sdk-preview-socket-conne
|
|
|
224
224
|
scribbleStyle: !1,
|
|
225
225
|
position: "bottom-right",
|
|
226
226
|
movableLauncher: !1
|
|
227
|
-
},
|
|
227
|
+
}, Ai = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive', Sn = "pluno-pa-scribble-font", Qn = 190, eo = 41, En = 22, Ni = 16, Ti = 24, Di = 1, Ri = 48, Jt = 420, zi = 520, Mi = 0.24, Qt = 680, Oi = 800, Bi = 0.76, I = 8, Ce = 50, to = "http://www.w3.org/2000/svg", Gt = 26, $t = 8, Ui = 36, qt = 16, Fi = 4, kn = [
|
|
228
228
|
{
|
|
229
229
|
ellipseCx: "17.5",
|
|
230
230
|
ellipseCy: "24.5",
|
|
@@ -261,20 +261,20 @@ const On = 100, jo = 1e4, Vo = 5e3, Ko = "product-agent:sdk-preview-socket-conne
|
|
|
261
261
|
path: "M18.7 26.8 C21 11.2, 7.1 1.6, 6.3 18.1",
|
|
262
262
|
pathStrokeWidth: "2.45"
|
|
263
263
|
}
|
|
264
|
-
],
|
|
265
|
-
let
|
|
266
|
-
function
|
|
267
|
-
return (t) => new
|
|
264
|
+
], Hi = 11, Wi = 13, jt = 4, no = 10, oo = 40, Gi = "movable-launcher-position-v2", io = "pluno-pa-widget-styles", ao = "data-pluno-pa-widget-styles";
|
|
265
|
+
let Ln = 0;
|
|
266
|
+
function $i(e) {
|
|
267
|
+
return (t) => new se(t, e);
|
|
268
268
|
}
|
|
269
|
-
async function
|
|
269
|
+
async function qi(e = {}) {
|
|
270
270
|
const t = {
|
|
271
|
-
launcherLabel: e.launcherLabel ??
|
|
272
|
-
accentColor: e.accentColor ??
|
|
273
|
-
colorScheme: e.colorScheme ??
|
|
274
|
-
fontFamily: e.fontFamily ??
|
|
275
|
-
scribbleStyle: e.scribbleStyle ??
|
|
276
|
-
position: e.position ??
|
|
277
|
-
movableLauncher: e.movableLauncher ??
|
|
271
|
+
launcherLabel: e.launcherLabel ?? oe.launcherLabel,
|
|
272
|
+
accentColor: e.accentColor ?? oe.accentColor,
|
|
273
|
+
colorScheme: e.colorScheme ?? oe.colorScheme,
|
|
274
|
+
fontFamily: e.fontFamily ?? oe.fontFamily,
|
|
275
|
+
scribbleStyle: e.scribbleStyle ?? oe.scribbleStyle,
|
|
276
|
+
position: e.position ?? oe.position,
|
|
277
|
+
movableLauncher: e.movableLauncher ?? oe.movableLauncher,
|
|
278
278
|
token: e.token,
|
|
279
279
|
tokenProvider: e.tokenProvider,
|
|
280
280
|
tokenEndpoint: e.tokenEndpoint,
|
|
@@ -308,7 +308,7 @@ async function ki(e = {}) {
|
|
|
308
308
|
showLauncherMinimizeButton: e.showLauncherMinimizeButton === !0,
|
|
309
309
|
taskNotifications: e.taskNotifications
|
|
310
310
|
};
|
|
311
|
-
|
|
311
|
+
J(
|
|
312
312
|
"web-sdk.widget",
|
|
313
313
|
"Mounting widget with merged options",
|
|
314
314
|
{
|
|
@@ -323,41 +323,41 @@ async function ki(e = {}) {
|
|
|
323
323
|
initialStarterPromptCount: t.initialStarterPrompts?.length ?? 0
|
|
324
324
|
}
|
|
325
325
|
);
|
|
326
|
-
const
|
|
327
|
-
|
|
328
|
-
|
|
326
|
+
const n = document.createElement("div");
|
|
327
|
+
n.className = "pluno-pa-widget-host", n.setAttribute("data-pluno-product-agent-ui", "widget"), t.sdkPreviewChannelId && n.setAttribute(
|
|
328
|
+
Ci,
|
|
329
329
|
t.sdkPreviewChannelId
|
|
330
330
|
);
|
|
331
|
-
const
|
|
331
|
+
const o = n.attachShadow({ mode: "open" }), i = document.createElement("div");
|
|
332
332
|
i.className = `pluno-pa-widget pluno-pa-widget--${t.position}`, i.setAttribute("data-pluno-product-agent-ui-root", "widget");
|
|
333
|
-
let r =
|
|
333
|
+
let r = Pn(
|
|
334
334
|
t.accentColor,
|
|
335
335
|
t.scribbleStyle
|
|
336
336
|
);
|
|
337
|
-
|
|
337
|
+
ha(
|
|
338
338
|
i,
|
|
339
339
|
t.launcherLabel,
|
|
340
340
|
r,
|
|
341
341
|
t.movableLauncher,
|
|
342
342
|
t.showLauncherMinimizeButton
|
|
343
|
-
),
|
|
344
|
-
const l =
|
|
345
|
-
let p = t.movableLauncher ? l.launcherPosition : null, d = p !== null;
|
|
346
|
-
i.classList.add(`pluno-pa-widget--${t.colorScheme}`), t.scribbleStyle && i.classList.add("pluno-pa-widget--scribble"), t.initialDisplayState === "minimized" && (i.classList.add("pluno-pa-widget--minimized"),
|
|
343
|
+
), o.appendChild(i);
|
|
344
|
+
const l = dr(t);
|
|
345
|
+
let p = t.movableLauncher ? l.launcherPosition : null, d = p !== null, c = l.panelSize, u = null;
|
|
346
|
+
i.classList.add(`pluno-pa-widget--${t.colorScheme}`), t.scribbleStyle && i.classList.add("pluno-pa-widget--scribble"), t.initialDisplayState === "minimized" && (i.classList.add("pluno-pa-widget--minimized"), ve(
|
|
347
347
|
i,
|
|
348
|
-
|
|
348
|
+
Tt(
|
|
349
349
|
i,
|
|
350
350
|
p,
|
|
351
351
|
t.position
|
|
352
352
|
)
|
|
353
|
-
)),
|
|
353
|
+
)), $n(o, t.accentColor), In(i, r, {
|
|
354
354
|
accentColor: t.accentColor,
|
|
355
355
|
colorScheme: t.colorScheme,
|
|
356
356
|
fontFamily: t.fontFamily,
|
|
357
357
|
scribbleStyle: t.scribbleStyle
|
|
358
358
|
});
|
|
359
|
-
const
|
|
360
|
-
|
|
359
|
+
const m = await sr(), k = m.ownerDocument;
|
|
360
|
+
m.appendChild(n), J(
|
|
361
361
|
"web-sdk.widget",
|
|
362
362
|
"Applied initial widget appearance",
|
|
363
363
|
{
|
|
@@ -367,78 +367,82 @@ async function ki(e = {}) {
|
|
|
367
367
|
cssAccent: i.style.getPropertyValue("--pluno-pa-accent")
|
|
368
368
|
}
|
|
369
369
|
);
|
|
370
|
-
const
|
|
370
|
+
const v = i.querySelector(
|
|
371
371
|
".pluno-pa-widget__launcher"
|
|
372
|
-
),
|
|
372
|
+
), z = i.querySelector(
|
|
373
373
|
".pluno-pa-widget__launcher-drag-handle"
|
|
374
|
-
),
|
|
374
|
+
), _ = i.querySelector(
|
|
375
375
|
".pluno-pa-widget__launcher-input"
|
|
376
|
-
),
|
|
376
|
+
), g = i.querySelector(
|
|
377
377
|
".pluno-pa-widget__launcher-minimize"
|
|
378
|
-
),
|
|
378
|
+
), b = i.querySelector(".pluno-pa-widget__panel"), h = i.querySelector(
|
|
379
|
+
".pluno-pa-widget__scribble-spirals--panel"
|
|
380
|
+
), P = Array.from(
|
|
381
|
+
i.querySelectorAll(".pluno-pa-widget__resize-handle")
|
|
382
|
+
), A = i.querySelector(
|
|
379
383
|
".pluno-pa-widget__close"
|
|
380
|
-
),
|
|
384
|
+
), L = i.querySelector(
|
|
381
385
|
".pluno-pa-widget__composer"
|
|
382
|
-
),
|
|
386
|
+
), F = i.querySelector(
|
|
383
387
|
".pluno-pa-widget__attachment-error"
|
|
384
|
-
),
|
|
388
|
+
), H = i.querySelector(
|
|
385
389
|
".pluno-pa-widget__billing-status"
|
|
386
|
-
),
|
|
390
|
+
), $ = i.querySelector(
|
|
387
391
|
".pluno-pa-widget__attachments"
|
|
388
|
-
),
|
|
392
|
+
), Q = i.querySelector(
|
|
389
393
|
".pluno-pa-widget__attachment-input"
|
|
390
|
-
),
|
|
394
|
+
), ze = i.querySelector(
|
|
391
395
|
".pluno-pa-widget__attach"
|
|
392
|
-
),
|
|
396
|
+
), x = i.querySelector(
|
|
393
397
|
".pluno-pa-widget__input"
|
|
394
|
-
),
|
|
398
|
+
), de = i.querySelector(
|
|
395
399
|
".pluno-pa-widget__send"
|
|
396
|
-
),
|
|
400
|
+
), Ye = i.querySelector(
|
|
397
401
|
".pluno-pa-widget__top-actions"
|
|
398
|
-
),
|
|
402
|
+
), X = i.querySelector(
|
|
399
403
|
".pluno-pa-widget__history"
|
|
400
|
-
),
|
|
404
|
+
), C = i.querySelector(
|
|
401
405
|
".pluno-pa-widget__history-panel"
|
|
402
|
-
),
|
|
406
|
+
), T = i.querySelector(
|
|
403
407
|
".pluno-pa-widget__history-list"
|
|
404
|
-
),
|
|
408
|
+
), Se = i.querySelector(
|
|
405
409
|
".pluno-pa-widget__history-close"
|
|
406
|
-
),
|
|
410
|
+
), q = i.querySelector(
|
|
407
411
|
".pluno-pa-widget__history-status"
|
|
408
|
-
),
|
|
412
|
+
), R = i.querySelector(
|
|
409
413
|
".pluno-pa-widget__timeline-jump"
|
|
410
|
-
),
|
|
414
|
+
), D = i.querySelector(
|
|
411
415
|
".pluno-pa-widget__active-users-counter"
|
|
412
|
-
),
|
|
416
|
+
), N = i.querySelector(
|
|
413
417
|
".pluno-pa-widget__timeline"
|
|
414
|
-
),
|
|
418
|
+
), ht = i.querySelector(
|
|
415
419
|
".pluno-pa-widget__timeline-bottom-sentinel"
|
|
416
|
-
),
|
|
420
|
+
), Me = i.querySelector(
|
|
417
421
|
".pluno-pa-widget__notify-suggestion"
|
|
418
|
-
),
|
|
422
|
+
), vo = i.querySelector(
|
|
419
423
|
".pluno-pa-widget__notify-suggestion-enable"
|
|
420
|
-
),
|
|
424
|
+
), Co = i.querySelector(
|
|
421
425
|
".pluno-pa-widget__notify-suggestion-later"
|
|
422
|
-
),
|
|
426
|
+
), So = i.querySelector(
|
|
423
427
|
".pluno-pa-widget__notify-suggestion-never"
|
|
424
428
|
);
|
|
425
|
-
if (!
|
|
429
|
+
if (!v || !_ || !b || !A || !L || !F || !H || !$ || !Q || !ze || !x || !de || !Ye || !X || !C || !T || !Se || !q || !R || !D || !N || !ht)
|
|
426
430
|
throw new Error("Failed to mount Pluno widget");
|
|
427
|
-
if (t.movableLauncher && !
|
|
431
|
+
if (t.movableLauncher && !z)
|
|
428
432
|
throw new Error("Failed to mount Pluno widget drag handle");
|
|
429
|
-
|
|
430
|
-
let
|
|
431
|
-
const
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
433
|
+
Mn(_), Mn(x);
|
|
434
|
+
let W = [], le = null;
|
|
435
|
+
const Ee = () => {
|
|
436
|
+
Da(
|
|
437
|
+
$,
|
|
438
|
+
W,
|
|
435
439
|
(a) => {
|
|
436
|
-
|
|
437
|
-
(s,
|
|
438
|
-
),
|
|
440
|
+
W = W.filter(
|
|
441
|
+
(s, w) => w !== a
|
|
442
|
+
), Ee(), G(y.getState()), j();
|
|
439
443
|
}
|
|
440
444
|
);
|
|
441
|
-
},
|
|
445
|
+
}, Eo = t.loginRequired || t.signupRequired || t.token || t.webSocketFactory ? void 0 : t.tokenProvider ?? (async () => {
|
|
442
446
|
if (!t.tokenEndpoint)
|
|
443
447
|
throw new Error("Pluno widget requires token or tokenEndpoint");
|
|
444
448
|
const a = await fetch(t.tokenEndpoint, {
|
|
@@ -450,21 +454,23 @@ async function ki(e = {}) {
|
|
|
450
454
|
url: location.href
|
|
451
455
|
})
|
|
452
456
|
});
|
|
453
|
-
if (!a.ok)
|
|
454
|
-
|
|
457
|
+
if (!a.ok) {
|
|
458
|
+
const w = await a.text(), S = jo(w);
|
|
459
|
+
throw S ? (console.error(S), new Error(S)) : new Error(`Failed to load Pluno token (${a.status})`);
|
|
460
|
+
}
|
|
455
461
|
const s = await a.json();
|
|
456
462
|
if (!s.token)
|
|
457
463
|
throw new Error("Pluno token endpoint did not return a token");
|
|
458
464
|
return s.token;
|
|
459
|
-
}),
|
|
460
|
-
let
|
|
461
|
-
|
|
465
|
+
}), ko = window.fetch.bind(window);
|
|
466
|
+
let y;
|
|
467
|
+
y = await qo.init({
|
|
462
468
|
token: t.token,
|
|
463
|
-
tokenProvider:
|
|
469
|
+
tokenProvider: Eo,
|
|
464
470
|
backendUrl: t.backendUrl,
|
|
465
471
|
metadata: () => ({
|
|
466
472
|
...t.metadata ?? {},
|
|
467
|
-
...!
|
|
473
|
+
...!y.getState().sessionId && t.scribbleStyle ? { scribbleStyleStarted: !0 } : {}
|
|
468
474
|
}),
|
|
469
475
|
initialStarterPrompts: t.initialStarterPrompts,
|
|
470
476
|
clientId: t.clientId,
|
|
@@ -474,118 +480,119 @@ async function ki(e = {}) {
|
|
|
474
480
|
prepareAttachmentUpload: t.prepareAttachmentUpload,
|
|
475
481
|
autoConnect: t.loginRequired || t.signupRequired ? !1 : void 0
|
|
476
482
|
});
|
|
477
|
-
const
|
|
483
|
+
const mt = new Set(l.openToolGroupKeys), ke = new Set(
|
|
478
484
|
l.seenShareCandidateIds
|
|
479
|
-
),
|
|
480
|
-
let
|
|
485
|
+
), Xe = new Set(ke);
|
|
486
|
+
let ft = l.sharePromptsDisabled || await cr(t), Z = null, Le = !1, fe = !1, we = {
|
|
481
487
|
enabled: !0
|
|
482
|
-
},
|
|
483
|
-
const
|
|
484
|
-
|
|
485
|
-
},
|
|
486
|
-
|
|
487
|
-
},
|
|
488
|
-
|
|
489
|
-
},
|
|
490
|
-
|
|
491
|
-
},
|
|
492
|
-
if (
|
|
488
|
+
}, be = 0, nn = "", ce = !1, pe = !1, ue = [], wt = null, Oe = null;
|
|
489
|
+
const ee = (a, s) => {
|
|
490
|
+
we = { enabled: a, reason: s };
|
|
491
|
+
}, te = () => {
|
|
492
|
+
R.hidden = !0;
|
|
493
|
+
}, Lo = () => {
|
|
494
|
+
R.hidden = !1;
|
|
495
|
+
}, Po = (a = "jump") => {
|
|
496
|
+
ee(!0, a), te(), Ve(N, () => we.enabled), be = N.scrollTop;
|
|
497
|
+
}, _e = () => {
|
|
498
|
+
if (X.hidden = t.loginRequired, C.hidden = !ce, X.setAttribute("aria-expanded", String(ce)), T.classList.toggle(
|
|
493
499
|
"pluno-pa-widget__history-list--center",
|
|
494
|
-
|
|
495
|
-
),
|
|
500
|
+
pe && ue.length === 0
|
|
501
|
+
), T.replaceChildren(), pe && ue.length === 0) {
|
|
496
502
|
const a = document.createElement("p");
|
|
497
|
-
a.className = "pluno-pa-widget__history-loading", a.textContent = "Loading...",
|
|
503
|
+
a.className = "pluno-pa-widget__history-loading", a.textContent = "Loading...", T.appendChild(a);
|
|
498
504
|
}
|
|
499
|
-
for (const a of
|
|
505
|
+
for (const a of ue) {
|
|
500
506
|
const s = document.createElement("button");
|
|
501
|
-
s.type = "button", s.className = "pluno-pa-widget__history-item", s.disabled =
|
|
502
|
-
const
|
|
503
|
-
|
|
504
|
-
const
|
|
505
|
-
|
|
507
|
+
s.type = "button", s.className = "pluno-pa-widget__history-item", s.disabled = pe;
|
|
508
|
+
const w = document.createElement("span");
|
|
509
|
+
w.className = "pluno-pa-widget__history-item-title", w.textContent = ca(a);
|
|
510
|
+
const S = document.createElement("time");
|
|
511
|
+
S.className = "pluno-pa-widget__history-time", S.dateTime = a.lastActiveAt, S.textContent = ga(
|
|
506
512
|
a.lastActiveAt,
|
|
507
513
|
Date.now()
|
|
508
514
|
);
|
|
509
|
-
const
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
}),
|
|
515
|
+
const M = document.createElement("small");
|
|
516
|
+
M.className = "pluno-pa-widget__history-path", M.textContent = ua(a), s.append(w, S, M), s.addEventListener("click", () => {
|
|
517
|
+
ce = !1, Oe = null, _e(), ee(!0, "newSession"), te(), y.loadSession(a.id), G(y.getState());
|
|
518
|
+
}), T.appendChild(s);
|
|
513
519
|
}
|
|
514
|
-
if (
|
|
520
|
+
if (pe && ue.length > 0) {
|
|
515
521
|
const a = document.createElement("p");
|
|
516
|
-
a.className = "pluno-pa-widget__history-loading pluno-pa-widget__history-loading--inline", a.textContent = "Loading...",
|
|
522
|
+
a.className = "pluno-pa-widget__history-loading pluno-pa-widget__history-loading--inline", a.textContent = "Loading...", T.appendChild(a);
|
|
517
523
|
}
|
|
518
|
-
|
|
519
|
-
},
|
|
520
|
-
if (!
|
|
521
|
-
|
|
524
|
+
q.textContent = Oe ?? (!pe && ue.length === 0 ? "No recent chats for this page yet." : ""), q.hidden = q.textContent.length === 0;
|
|
525
|
+
}, on = async (a) => {
|
|
526
|
+
if (!pe) {
|
|
527
|
+
pe = !0, Oe = null, _e();
|
|
522
528
|
try {
|
|
523
|
-
const s = await
|
|
524
|
-
|
|
529
|
+
const s = await y.listSessions({ cursor: a, limit: 20 });
|
|
530
|
+
ue = a ? [...ue, ...s.sessions] : s.sessions, wt = s.nextCursor;
|
|
525
531
|
} catch (s) {
|
|
526
|
-
|
|
532
|
+
J(
|
|
527
533
|
"web-sdk.widget",
|
|
528
534
|
"Failed to load session history",
|
|
529
535
|
{
|
|
530
536
|
message: s instanceof Error ? s.message : String(s)
|
|
531
537
|
}
|
|
532
|
-
),
|
|
538
|
+
), Oe = Ii;
|
|
533
539
|
} finally {
|
|
534
|
-
|
|
540
|
+
pe = !1, _e();
|
|
535
541
|
}
|
|
536
542
|
}
|
|
537
|
-
},
|
|
538
|
-
!
|
|
539
|
-
},
|
|
540
|
-
|
|
541
|
-
},
|
|
542
|
-
|
|
543
|
+
}, Io = () => {
|
|
544
|
+
!wt || pe || T.scrollHeight - T.scrollTop - T.clientHeight <= 24 && on(wt);
|
|
545
|
+
}, Ao = () => {
|
|
546
|
+
Le || typeof document > "u" || ($n(o, t.accentColor), n.isConnected || k.body?.appendChild(n));
|
|
547
|
+
}, an = new MutationObserver(Ao);
|
|
548
|
+
an.observe(k.documentElement, {
|
|
543
549
|
childList: !0,
|
|
544
550
|
subtree: !0
|
|
545
551
|
});
|
|
546
|
-
const
|
|
547
|
-
const s =
|
|
548
|
-
return
|
|
552
|
+
const Be = (a = !0) => {
|
|
553
|
+
const s = dt(i, a);
|
|
554
|
+
return Vt(
|
|
549
555
|
i,
|
|
550
|
-
p ?
|
|
556
|
+
p ? ro(p, s) : Qi(
|
|
551
557
|
i,
|
|
552
558
|
t.position,
|
|
553
559
|
s
|
|
554
560
|
),
|
|
555
561
|
s
|
|
556
562
|
);
|
|
557
|
-
},
|
|
558
|
-
const a =
|
|
559
|
-
|
|
563
|
+
}, B = () => {
|
|
564
|
+
const a = ra(o, _, x);
|
|
565
|
+
gr(t, {
|
|
560
566
|
isOpen: i.classList.contains("pluno-pa-widget--open"),
|
|
561
|
-
composerValue:
|
|
567
|
+
composerValue: x.value,
|
|
562
568
|
focusedInput: a,
|
|
563
569
|
focusedInputAt: a ? Date.now() : null,
|
|
564
|
-
openToolGroupKeys: [...
|
|
570
|
+
openToolGroupKeys: [...mt],
|
|
565
571
|
launcherPosition: d ? p : null,
|
|
566
|
-
|
|
567
|
-
|
|
572
|
+
panelSize: c,
|
|
573
|
+
seenShareCandidateIds: [...ke].slice(
|
|
574
|
+
-Zn
|
|
568
575
|
),
|
|
569
|
-
sharePromptsDisabled:
|
|
576
|
+
sharePromptsDisabled: ft
|
|
570
577
|
});
|
|
571
|
-
},
|
|
578
|
+
}, Ze = (a) => {
|
|
572
579
|
t.onDisplayStateChange?.(a);
|
|
573
|
-
},
|
|
580
|
+
}, Ue = (a, s = !0) => {
|
|
574
581
|
if (a === "shown") {
|
|
575
|
-
i.classList.remove("pluno-pa-widget--minimized"),
|
|
582
|
+
i.classList.remove("pluno-pa-widget--minimized"), v.removeAttribute("tabindex"), !i.classList.contains("pluno-pa-widget--open") && !i.classList.contains("pluno-pa-widget--closing") && Fe(!1), s && Ze("shown");
|
|
576
583
|
return;
|
|
577
584
|
}
|
|
578
|
-
|
|
585
|
+
Z !== null && (window.clearTimeout(Z), Z = null), i.classList.remove("pluno-pa-widget--open"), i.classList.remove("pluno-pa-widget--closing"), i.classList.add("pluno-pa-widget--minimized"), v.hidden = !1, b.hidden = !0, A.hidden = !0, v.tabIndex = 0, x.value = "", ve(
|
|
579
586
|
i,
|
|
580
|
-
|
|
587
|
+
Tt(
|
|
581
588
|
i,
|
|
582
589
|
p,
|
|
583
590
|
t.position
|
|
584
591
|
)
|
|
585
|
-
),
|
|
586
|
-
},
|
|
587
|
-
|
|
588
|
-
debugVersion:
|
|
592
|
+
), Dn(i), B(), s && Ze("minimized");
|
|
593
|
+
}, xe = (a, s = {}) => {
|
|
594
|
+
aa(a, {
|
|
595
|
+
debugVersion: Gi,
|
|
589
596
|
launcherPosition: p,
|
|
590
597
|
rootClasses: i.className,
|
|
591
598
|
rootStyle: {
|
|
@@ -594,35 +601,35 @@ async function ki(e = {}) {
|
|
|
594
601
|
right: i.style.right,
|
|
595
602
|
bottom: i.style.bottom
|
|
596
603
|
},
|
|
597
|
-
rootRect:
|
|
598
|
-
launcherRect:
|
|
599
|
-
panelRect:
|
|
600
|
-
viewport:
|
|
601
|
-
panelHidden:
|
|
602
|
-
closeHidden:
|
|
604
|
+
rootRect: Rt(i),
|
|
605
|
+
launcherRect: Rt(v),
|
|
606
|
+
panelRect: Rt(b),
|
|
607
|
+
viewport: Y(),
|
|
608
|
+
panelHidden: b.hidden,
|
|
609
|
+
closeHidden: A.hidden,
|
|
603
610
|
...s
|
|
604
611
|
});
|
|
605
|
-
},
|
|
612
|
+
}, Fe = (a = !0) => {
|
|
606
613
|
if (!p)
|
|
607
|
-
return
|
|
608
|
-
const s =
|
|
609
|
-
return
|
|
614
|
+
return ve(i, null), Be(a);
|
|
615
|
+
const s = Be(a);
|
|
616
|
+
return ve(i, s), xe("Applied stored closed launcher position", {
|
|
610
617
|
visibleLauncherPosition: s
|
|
611
618
|
}), s;
|
|
612
|
-
},
|
|
619
|
+
}, bt = (a, s) => {
|
|
613
620
|
if (!a || !s) {
|
|
614
|
-
|
|
621
|
+
Dn(i);
|
|
615
622
|
return;
|
|
616
623
|
}
|
|
617
|
-
|
|
624
|
+
ia(i, {
|
|
618
625
|
x: a.x - s.x,
|
|
619
626
|
y: a.y - s.y
|
|
620
627
|
});
|
|
621
|
-
},
|
|
628
|
+
}, rn = () => {
|
|
622
629
|
if (i.classList.contains("pluno-pa-widget--minimized")) {
|
|
623
|
-
|
|
630
|
+
ve(
|
|
624
631
|
i,
|
|
625
|
-
|
|
632
|
+
Tt(
|
|
626
633
|
i,
|
|
627
634
|
p,
|
|
628
635
|
t.position
|
|
@@ -630,118 +637,164 @@ async function ki(e = {}) {
|
|
|
630
637
|
);
|
|
631
638
|
return;
|
|
632
639
|
}
|
|
633
|
-
const a =
|
|
640
|
+
const a = Fe();
|
|
634
641
|
if (i.classList.contains("pluno-pa-widget--open") || i.classList.contains("pluno-pa-widget--closing")) {
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
642
|
+
Nt(i, c);
|
|
643
|
+
const s = Re(c);
|
|
644
|
+
Mt(
|
|
645
|
+
h,
|
|
646
|
+
s.width
|
|
647
|
+
);
|
|
648
|
+
const w = lt(
|
|
649
|
+
u ?? Dt(
|
|
650
|
+
i,
|
|
651
|
+
a,
|
|
652
|
+
t.position,
|
|
653
|
+
c
|
|
654
|
+
),
|
|
655
|
+
s
|
|
639
656
|
);
|
|
640
|
-
|
|
657
|
+
u && (u = w), bt(w, a), xe(
|
|
641
658
|
"Applied open panel position after viewport resize",
|
|
642
|
-
{ openPanelPosition:
|
|
659
|
+
{ openPanelPosition: w }
|
|
643
660
|
);
|
|
644
|
-
} else p &&
|
|
661
|
+
} else p && xe(
|
|
645
662
|
"Applied visible launcher position after viewport resize",
|
|
646
663
|
{ visibleLauncherPosition: a }
|
|
647
664
|
);
|
|
648
665
|
};
|
|
649
|
-
let
|
|
666
|
+
let ln = () => {
|
|
650
667
|
};
|
|
651
|
-
window.addEventListener("resize",
|
|
668
|
+
window.addEventListener("resize", rn), t.movableLauncher && z ? (Fe(), ln = Xi({
|
|
652
669
|
root: i,
|
|
653
|
-
launcher:
|
|
654
|
-
launcherDragHandle:
|
|
655
|
-
getPosition: () =>
|
|
670
|
+
launcher: v,
|
|
671
|
+
launcherDragHandle: z,
|
|
672
|
+
getPosition: () => Be(),
|
|
656
673
|
setPosition: (a) => {
|
|
657
|
-
const s = a,
|
|
674
|
+
const s = a, w = dt(i), S = Vt(
|
|
658
675
|
i,
|
|
659
676
|
a,
|
|
660
|
-
|
|
677
|
+
w
|
|
661
678
|
);
|
|
662
|
-
p =
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
),
|
|
679
|
+
p = ta(
|
|
680
|
+
S,
|
|
681
|
+
w
|
|
682
|
+
), ve(i, S), xe("Dragging closed launcher", {
|
|
666
683
|
requestedPosition: s
|
|
667
684
|
});
|
|
668
685
|
},
|
|
669
686
|
persist: () => {
|
|
670
|
-
d = !0,
|
|
687
|
+
d = !0, B(), xe("Persisted closed launcher drag position");
|
|
671
688
|
}
|
|
672
|
-
})) :
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
689
|
+
})) : ve(i, null), Nt(i, c);
|
|
690
|
+
const No = () => {
|
|
691
|
+
const a = Re(c), s = Be();
|
|
692
|
+
return {
|
|
693
|
+
position: lt(
|
|
694
|
+
u ?? Dt(
|
|
695
|
+
i,
|
|
696
|
+
s,
|
|
697
|
+
t.position,
|
|
698
|
+
c
|
|
699
|
+
),
|
|
700
|
+
a
|
|
701
|
+
),
|
|
702
|
+
size: a
|
|
703
|
+
};
|
|
704
|
+
}, To = (a) => {
|
|
705
|
+
c = ut(a.size), Nt(i, c), Mt(
|
|
706
|
+
h,
|
|
707
|
+
Re(c).width
|
|
708
|
+
), u = lt(
|
|
709
|
+
a.position,
|
|
710
|
+
Re(c)
|
|
711
|
+
);
|
|
712
|
+
const s = Be();
|
|
713
|
+
bt(u, s);
|
|
714
|
+
}, Do = P.length > 0 ? Zi({
|
|
715
|
+
root: i,
|
|
716
|
+
handles: P,
|
|
717
|
+
getBounds: No,
|
|
718
|
+
setBounds: To,
|
|
719
|
+
persist: B
|
|
720
|
+
}) : () => {
|
|
721
|
+
};
|
|
722
|
+
let _t = !1;
|
|
723
|
+
const pn = async () => {
|
|
724
|
+
if (!(!t.billingStatusLoader || _t)) {
|
|
725
|
+
_t = !0;
|
|
677
726
|
try {
|
|
678
727
|
const a = await t.billingStatusLoader();
|
|
679
|
-
|
|
728
|
+
Bn(
|
|
680
729
|
t.billingStatus,
|
|
681
730
|
a,
|
|
682
|
-
|
|
683
|
-
) && (t.billingStatus = a,
|
|
684
|
-
|
|
731
|
+
y.getState().lastErrorCode
|
|
732
|
+
) && (t.billingStatus = a, Bt(
|
|
733
|
+
H,
|
|
685
734
|
t.billingStatus,
|
|
686
|
-
|
|
687
|
-
),
|
|
735
|
+
y.getState().lastErrorCode
|
|
736
|
+
), j());
|
|
688
737
|
} finally {
|
|
689
|
-
|
|
738
|
+
_t = !1;
|
|
690
739
|
}
|
|
691
740
|
}
|
|
692
|
-
},
|
|
693
|
-
|
|
694
|
-
|
|
741
|
+
}, ge = (a = "", s = !0) => {
|
|
742
|
+
pn(), We && (We = !1, yt()), i.classList.contains("pluno-pa-widget--open") || (u = null), Z !== null && (window.clearTimeout(Z), Z = null), Ue("shown", !1), b.hidden = !1, A.hidden = !1, Mt(
|
|
743
|
+
h,
|
|
744
|
+
Re(c).width
|
|
745
|
+
), i.classList.remove("pluno-pa-widget--closing");
|
|
746
|
+
const w = Fe(), S = Dt(
|
|
695
747
|
i,
|
|
696
|
-
|
|
697
|
-
t.position
|
|
748
|
+
w,
|
|
749
|
+
t.position,
|
|
750
|
+
c
|
|
698
751
|
);
|
|
699
|
-
if (
|
|
700
|
-
openPanelPosition:
|
|
701
|
-
visibleLauncherPosition:
|
|
702
|
-
}),
|
|
703
|
-
i.classList.add("pluno-pa-widget--open"),
|
|
752
|
+
if (bt(S, w), xe("Opening launcher at clamped open panel position", {
|
|
753
|
+
openPanelPosition: S,
|
|
754
|
+
visibleLauncherPosition: w
|
|
755
|
+
}), ee(!0, "open"), te(), !s) {
|
|
756
|
+
i.classList.add("pluno-pa-widget--open"), v.hidden = !0, a && (x.value = a, je(x)), Ve(N, () => we.enabled), be = N.scrollTop, x.focus(), x.setSelectionRange(x.value.length, x.value.length), B(), Ze("shown"), t.onPanelOpenChange?.(!0);
|
|
704
757
|
return;
|
|
705
758
|
}
|
|
706
759
|
window.requestAnimationFrame(() => {
|
|
707
|
-
i.classList.add("pluno-pa-widget--open"), a && (
|
|
708
|
-
|
|
760
|
+
i.classList.add("pluno-pa-widget--open"), a && (x.value = a, je(x)), Ve(N, () => we.enabled), be = N.scrollTop, x.focus(), x.setSelectionRange(x.value.length, x.value.length), B(), Ze("shown"), t.onPanelOpenChange?.(!0), Z = window.setTimeout(() => {
|
|
761
|
+
v.hidden = !0, Ve(N, () => we.enabled), be = N.scrollTop;
|
|
709
762
|
}, 220);
|
|
710
763
|
});
|
|
711
|
-
},
|
|
712
|
-
|
|
713
|
-
|
|
764
|
+
}, Ro = () => {
|
|
765
|
+
Z !== null && (window.clearTimeout(Z), Z = null), v.hidden = !1, p && (Fe(!1), xe("Closing launcher at stored position")), i.classList.remove("pluno-pa-widget--open"), i.classList.add("pluno-pa-widget--closing"), B(), t.onPanelOpenChange?.(!1), Z = window.setTimeout(() => {
|
|
766
|
+
b.hidden = !0, A.hidden = !0, u = null, i.classList.remove("pluno-pa-widget--closing");
|
|
714
767
|
}, 220);
|
|
715
768
|
};
|
|
716
|
-
|
|
717
|
-
a.preventDefault(),
|
|
718
|
-
}),
|
|
769
|
+
v.addEventListener("submit", (a) => {
|
|
770
|
+
a.preventDefault(), ge(_.value), _.value = "";
|
|
771
|
+
}), z?.addEventListener("click", (a) => {
|
|
719
772
|
a.preventDefault(), a.stopPropagation();
|
|
720
|
-
}),
|
|
721
|
-
a.target ===
|
|
722
|
-
}),
|
|
723
|
-
|
|
724
|
-
}),
|
|
725
|
-
if (!
|
|
773
|
+
}), v.addEventListener("click", (a) => {
|
|
774
|
+
a.target === _ && !z || (ge(_.value), _.value = "");
|
|
775
|
+
}), _.addEventListener("focus", () => {
|
|
776
|
+
ge(_.value), _.value = "";
|
|
777
|
+
}), _.addEventListener("input", () => {
|
|
778
|
+
if (!_.value)
|
|
726
779
|
return;
|
|
727
|
-
const a =
|
|
728
|
-
|
|
780
|
+
const a = _.value;
|
|
781
|
+
ge(a), _.value = "";
|
|
729
782
|
});
|
|
730
|
-
let
|
|
731
|
-
const
|
|
783
|
+
let xt = null, Je = null, ye = null;
|
|
784
|
+
const sn = (a) => a === _ || a === x, zo = (a) => {
|
|
732
785
|
if (!(a instanceof Element) || a.getRootNode() === i.getRootNode())
|
|
733
786
|
return null;
|
|
734
787
|
let s = a;
|
|
735
788
|
for (; s; ) {
|
|
736
|
-
const
|
|
737
|
-
if (
|
|
738
|
-
return
|
|
739
|
-
const
|
|
740
|
-
s =
|
|
789
|
+
const w = s.closest(vn);
|
|
790
|
+
if (w)
|
|
791
|
+
return w;
|
|
792
|
+
const S = s.getRootNode();
|
|
793
|
+
s = S instanceof ShadowRoot ? S.host : null;
|
|
741
794
|
}
|
|
742
795
|
return null;
|
|
743
|
-
},
|
|
744
|
-
if (!a.isConnected || !a.matches(
|
|
796
|
+
}, Mo = (a) => {
|
|
797
|
+
if (!a.isConnected || !a.matches(vn))
|
|
745
798
|
return !1;
|
|
746
799
|
if (!(a instanceof HTMLElement))
|
|
747
800
|
return !0;
|
|
@@ -751,66 +804,66 @@ async function ki(e = {}) {
|
|
|
751
804
|
return a.checkVisibility();
|
|
752
805
|
const s = window.getComputedStyle(a);
|
|
753
806
|
return s.display !== "none" && s.visibility !== "hidden";
|
|
754
|
-
},
|
|
755
|
-
|
|
756
|
-
const s =
|
|
757
|
-
(!s || !
|
|
758
|
-
},
|
|
759
|
-
},
|
|
760
|
-
|
|
807
|
+
}, dn = (a) => {
|
|
808
|
+
He !== a && (He = a, i.classList.toggle("pluno-pa-widget--host-modal-conflict", a !== null), et(), a !== null ? ye = window.setInterval(() => {
|
|
809
|
+
const s = He;
|
|
810
|
+
(!s || !Mo(s)) && dn(null);
|
|
811
|
+
}, Pi) : ye !== null && (window.clearInterval(ye), ye = null, Je = null));
|
|
812
|
+
}, Oo = () => {
|
|
813
|
+
ye !== null && (window.clearInterval(ye), ye = null);
|
|
761
814
|
};
|
|
762
815
|
i.addEventListener("focusin", (a) => {
|
|
763
|
-
|
|
816
|
+
sn(a.target) && (xt = Date.now(), B());
|
|
764
817
|
}), i.addEventListener("focusout", (a) => {
|
|
765
|
-
if (!
|
|
818
|
+
if (!sn(a.target) || He !== null)
|
|
766
819
|
return;
|
|
767
|
-
const s =
|
|
768
|
-
if (
|
|
820
|
+
const s = xt;
|
|
821
|
+
if (xt = null, s === null || Date.now() - s > ki)
|
|
769
822
|
return;
|
|
770
|
-
const
|
|
771
|
-
if (!
|
|
823
|
+
const w = zo(a.relatedTarget);
|
|
824
|
+
if (!w)
|
|
772
825
|
return;
|
|
773
|
-
const
|
|
774
|
-
if (
|
|
775
|
-
|
|
826
|
+
const S = Date.now();
|
|
827
|
+
if (Je !== null && S - Je <= Li) {
|
|
828
|
+
dn(w);
|
|
776
829
|
return;
|
|
777
830
|
}
|
|
778
|
-
|
|
779
|
-
}),
|
|
780
|
-
!i.classList.contains("pluno-pa-widget--minimized") || a.key !== "Enter" && a.key !== " " || (a.preventDefault(),
|
|
781
|
-
}),
|
|
831
|
+
Je = S;
|
|
832
|
+
}), v.addEventListener("keydown", (a) => {
|
|
833
|
+
!i.classList.contains("pluno-pa-widget--minimized") || a.key !== "Enter" && a.key !== " " || (a.preventDefault(), ge());
|
|
834
|
+
}), g?.addEventListener("pointerdown", (a) => {
|
|
782
835
|
a.stopPropagation();
|
|
783
|
-
}),
|
|
784
|
-
a.preventDefault(), a.stopPropagation(),
|
|
785
|
-
}),
|
|
786
|
-
|
|
787
|
-
}),
|
|
788
|
-
|
|
836
|
+
}), g?.addEventListener("click", (a) => {
|
|
837
|
+
a.preventDefault(), a.stopPropagation(), Ue("minimized");
|
|
838
|
+
}), A.addEventListener("click", Ro), N.addEventListener("scroll", () => {
|
|
839
|
+
N.scrollTop < be - 1 && ee(!1, "userScroll"), be = N.scrollTop;
|
|
840
|
+
}), R.addEventListener("click", () => {
|
|
841
|
+
Po();
|
|
789
842
|
});
|
|
790
|
-
const
|
|
843
|
+
const cn = typeof IntersectionObserver > "u" ? null : new IntersectionObserver(
|
|
791
844
|
([a]) => {
|
|
792
|
-
a?.isIntersecting && (
|
|
845
|
+
a?.isIntersecting && (ee(!0, "bottom"), te());
|
|
793
846
|
},
|
|
794
|
-
{ root:
|
|
847
|
+
{ root: N, threshold: 0 }
|
|
795
848
|
);
|
|
796
|
-
|
|
797
|
-
const
|
|
798
|
-
let
|
|
799
|
-
const
|
|
800
|
-
const a =
|
|
801
|
-
|
|
802
|
-
},
|
|
803
|
-
|
|
849
|
+
cn?.observe(ht);
|
|
850
|
+
const Qe = () => t.loginRequired || t.signupRequired;
|
|
851
|
+
let He = null, We = !1;
|
|
852
|
+
const et = () => {
|
|
853
|
+
const a = Qe(), s = He !== null;
|
|
854
|
+
_.readOnly = a || s, x.readOnly = s, _.placeholder = s ? Cn : a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : We ? "New update" : t.launcherLabel, x.placeholder = s ? Cn : a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : oe.launcherLabel, L.hidden = a;
|
|
855
|
+
}, j = () => {
|
|
856
|
+
de.disabled = ae(t.billingStatus) || !y.getState().isThinking && x.value.trim().length === 0 && W.length === 0, ze.disabled = Qe() || ae(t.billingStatus);
|
|
804
857
|
};
|
|
805
|
-
|
|
806
|
-
const
|
|
807
|
-
const a =
|
|
858
|
+
et();
|
|
859
|
+
const yt = () => {
|
|
860
|
+
const a = y.getState().isThinking;
|
|
808
861
|
i.classList.toggle("pluno-pa-widget--thinking", a), i.classList.toggle(
|
|
809
862
|
"pluno-pa-widget--unread",
|
|
810
|
-
!a &&
|
|
811
|
-
),
|
|
863
|
+
!a && We
|
|
864
|
+
), et();
|
|
812
865
|
};
|
|
813
|
-
|
|
866
|
+
yt(), L.addEventListener("submit", (a) => {
|
|
814
867
|
if (a.preventDefault(), t.loginRequired) {
|
|
815
868
|
t.onLoginClick?.();
|
|
816
869
|
return;
|
|
@@ -819,157 +872,157 @@ async function ki(e = {}) {
|
|
|
819
872
|
t.onSignupClick?.();
|
|
820
873
|
return;
|
|
821
874
|
}
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
),
|
|
875
|
+
ae(t.billingStatus) || (fe = !0, ee(!0, "send"), te(), W = zt(
|
|
876
|
+
y,
|
|
877
|
+
x,
|
|
878
|
+
W
|
|
879
|
+
), Ee(), j());
|
|
827
880
|
});
|
|
828
|
-
let
|
|
829
|
-
const
|
|
830
|
-
|
|
831
|
-
},
|
|
832
|
-
|
|
833
|
-
|
|
881
|
+
let Ge = 0;
|
|
882
|
+
const Bo = () => {
|
|
883
|
+
Ge = 0, i.classList.remove("pluno-pa-widget--drag-over");
|
|
884
|
+
}, vt = (a) => {
|
|
885
|
+
le !== null && window.clearTimeout(le), F.textContent = a, F.hidden = !1, le = window.setTimeout(() => {
|
|
886
|
+
F.textContent = "", F.hidden = !0, le = null;
|
|
834
887
|
}, 3e3);
|
|
835
|
-
},
|
|
836
|
-
|
|
837
|
-
},
|
|
888
|
+
}, Uo = () => {
|
|
889
|
+
le !== null && (window.clearTimeout(le), le = null), F.textContent = "", F.hidden = !0;
|
|
890
|
+
}, Ct = async (a) => {
|
|
838
891
|
if (a.length === 0)
|
|
839
892
|
return;
|
|
840
|
-
const s =
|
|
841
|
-
|
|
893
|
+
const s = Ma(y, a);
|
|
894
|
+
W = [...W, ...s], Ee(), Uo(), j(), G(y.getState()), i.classList.contains("pluno-pa-widget--open") || ge();
|
|
842
895
|
};
|
|
843
|
-
|
|
844
|
-
t.loginRequired ||
|
|
845
|
-
}),
|
|
846
|
-
const a = Array.from(
|
|
847
|
-
|
|
848
|
-
|
|
896
|
+
ze.addEventListener("click", () => {
|
|
897
|
+
t.loginRequired || ae(t.billingStatus) || Q.click();
|
|
898
|
+
}), Q.addEventListener("change", () => {
|
|
899
|
+
const a = Array.from(Q.files ?? []);
|
|
900
|
+
Q.value = "", Ct(a).catch((s) => {
|
|
901
|
+
vt(
|
|
849
902
|
s instanceof Error ? s.message : "Failed to attach file"
|
|
850
|
-
),
|
|
903
|
+
), J("web-sdk.widget", "Attachment failed", {
|
|
851
904
|
message: s instanceof Error ? s.message : String(s)
|
|
852
905
|
});
|
|
853
906
|
});
|
|
854
907
|
}), i.addEventListener("dragenter", (a) => {
|
|
855
|
-
!
|
|
908
|
+
!it(a.dataTransfer) || t.loginRequired || (a.preventDefault(), a.stopPropagation(), Ge += 1, i.classList.add("pluno-pa-widget--drag-over"));
|
|
856
909
|
}), i.addEventListener("dragover", (a) => {
|
|
857
910
|
const s = a.dataTransfer;
|
|
858
|
-
!
|
|
911
|
+
!it(s) || t.loginRequired || (a.preventDefault(), a.stopPropagation(), s.dropEffect = "copy");
|
|
859
912
|
}), i.addEventListener("dragleave", (a) => {
|
|
860
|
-
|
|
913
|
+
it(a.dataTransfer) && (a.stopPropagation(), Ge = Math.max(0, Ge - 1), Ge === 0 && i.classList.remove("pluno-pa-widget--drag-over"));
|
|
861
914
|
}), i.addEventListener("drop", (a) => {
|
|
862
915
|
const s = a.dataTransfer;
|
|
863
|
-
!
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
),
|
|
867
|
-
message:
|
|
916
|
+
!it(s) || t.loginRequired || (a.preventDefault(), a.stopPropagation(), Bo(), Ct(s.files).catch((w) => {
|
|
917
|
+
vt(
|
|
918
|
+
w instanceof Error ? w.message : "Failed to attach file"
|
|
919
|
+
), J("web-sdk.widget", "Attachment failed", {
|
|
920
|
+
message: w instanceof Error ? w.message : String(w)
|
|
868
921
|
});
|
|
869
922
|
}));
|
|
870
923
|
}), i.addEventListener("paste", (a) => {
|
|
871
|
-
const s = a.clipboardData,
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
),
|
|
876
|
-
message:
|
|
924
|
+
const s = a.clipboardData, w = Array.from(s?.files ?? []);
|
|
925
|
+
w.length === 0 || t.loginRequired || (a.preventDefault(), a.stopPropagation(), Ct(w).catch((S) => {
|
|
926
|
+
vt(
|
|
927
|
+
S instanceof Error ? S.message : "Failed to attach file"
|
|
928
|
+
), J("web-sdk.widget", "Attachment failed", {
|
|
929
|
+
message: S instanceof Error ? S.message : String(S)
|
|
877
930
|
});
|
|
878
931
|
}));
|
|
879
|
-
}),
|
|
932
|
+
}), de.addEventListener("click", () => {
|
|
880
933
|
if (t.loginRequired) {
|
|
881
934
|
t.onLoginClick?.();
|
|
882
935
|
return;
|
|
883
936
|
}
|
|
884
|
-
if (
|
|
885
|
-
|
|
937
|
+
if (y.getState().isThinking) {
|
|
938
|
+
y.stop();
|
|
886
939
|
return;
|
|
887
940
|
}
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
),
|
|
893
|
-
}),
|
|
894
|
-
|
|
895
|
-
}),
|
|
896
|
-
|
|
897
|
-
}),
|
|
898
|
-
|
|
899
|
-
}),
|
|
941
|
+
fe = !0, ee(!0, "send"), te(), W = zt(
|
|
942
|
+
y,
|
|
943
|
+
x,
|
|
944
|
+
W
|
|
945
|
+
), Ee(), j(), G(y.getState());
|
|
946
|
+
}), X.addEventListener("click", () => {
|
|
947
|
+
ce = !ce, Oe = null, _e(), ce && ue.length === 0 && on(null);
|
|
948
|
+
}), Se.addEventListener("click", () => {
|
|
949
|
+
ce = !1, _e();
|
|
950
|
+
}), T.addEventListener("scroll", Io), x.addEventListener("input", () => {
|
|
951
|
+
je(x), B(), j(), Wo();
|
|
952
|
+
}), x.addEventListener("keydown", (a) => {
|
|
900
953
|
if (!(a.key !== "Enter" || a.shiftKey)) {
|
|
901
954
|
if (a.preventDefault(), t.loginRequired) {
|
|
902
955
|
t.onLoginClick?.();
|
|
903
956
|
return;
|
|
904
957
|
}
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
),
|
|
958
|
+
fe = !0, ee(!0, "send"), te(), W = zt(
|
|
959
|
+
y,
|
|
960
|
+
x,
|
|
961
|
+
W
|
|
962
|
+
), Ee(), j(), G(y.getState());
|
|
910
963
|
}
|
|
911
964
|
}), i.addEventListener("click", (a) => {
|
|
912
|
-
(a.target instanceof Element ? a.target : null)?.closest("a[href]") &&
|
|
913
|
-
}), l.composerValue && (
|
|
914
|
-
const
|
|
915
|
-
let
|
|
916
|
-
const
|
|
917
|
-
let
|
|
918
|
-
const
|
|
919
|
-
|
|
920
|
-
},
|
|
921
|
-
|
|
922
|
-
},
|
|
923
|
-
if (!
|
|
965
|
+
(a.target instanceof Element ? a.target : null)?.closest("a[href]") && B();
|
|
966
|
+
}), l.composerValue && (x.value = l.composerValue, je(x)), t.initialDisplayState === "minimized" ? Ue("minimized", !1) : t.initialDisplayState === void 0 && l.isOpen && ge(x.value, !1), la(l, i, _, x);
|
|
967
|
+
const tt = () => r;
|
|
968
|
+
let St = y.getState().appearance !== null, nt = null, $e = null, Pe = null, un = y.getState().isThinking, Ie = null;
|
|
969
|
+
const qe = t.taskNotifications;
|
|
970
|
+
let Ae = null, Ne = !1;
|
|
971
|
+
const gn = () => {
|
|
972
|
+
Ae !== null && (window.clearTimeout(Ae), Ae = null);
|
|
973
|
+
}, ot = () => {
|
|
974
|
+
Me && (Me.hidden = !0);
|
|
975
|
+
}, hn = () => y.getState().assistantDraft.trim().length > 0, Fo = async () => {
|
|
976
|
+
if (!qe || !Me || Ne || Le || !y.getState().isThinking || hn())
|
|
924
977
|
return;
|
|
925
978
|
let a;
|
|
926
979
|
try {
|
|
927
|
-
a = await
|
|
980
|
+
a = await qe.getState();
|
|
928
981
|
} catch {
|
|
929
982
|
return;
|
|
930
983
|
}
|
|
931
|
-
a.enabled || a.neverSuggest || !
|
|
984
|
+
a.enabled || a.neverSuggest || !y.getState().isThinking || hn() || Ne || Le || (Me.hidden = !1);
|
|
932
985
|
};
|
|
933
|
-
|
|
934
|
-
|
|
986
|
+
vo?.addEventListener("click", () => {
|
|
987
|
+
Ne = !0, ot(), qe?.enable().catch(() => {
|
|
935
988
|
});
|
|
936
|
-
}),
|
|
937
|
-
|
|
938
|
-
}),
|
|
939
|
-
|
|
989
|
+
}), Co?.addEventListener("click", () => {
|
|
990
|
+
Ne = !0, ot();
|
|
991
|
+
}), So?.addEventListener("click", () => {
|
|
992
|
+
Ne = !0, ot(), qe?.dismissForever().catch(() => {
|
|
940
993
|
});
|
|
941
994
|
});
|
|
942
|
-
let
|
|
995
|
+
let Te = null, mn = () => {
|
|
943
996
|
};
|
|
944
|
-
const
|
|
945
|
-
const a =
|
|
946
|
-
|
|
997
|
+
const Ho = !!t.socialPostDraftHandler, Et = /* @__PURE__ */ new Map(), kt = () => x.value.trim().length > 0 || W.length > 0, Wo = () => {
|
|
998
|
+
const a = Te !== null && Ut(y.getState(), kt());
|
|
999
|
+
D.hidden = !a, a && Te !== null && po(D, Te);
|
|
947
1000
|
};
|
|
948
|
-
let
|
|
949
|
-
const
|
|
950
|
-
|
|
951
|
-
},
|
|
1001
|
+
let De = null;
|
|
1002
|
+
const Go = () => {
|
|
1003
|
+
fe = !0, ee(!0, "newSession"), te(), ce = !1, _e(), y.startNewSession(), mt.clear(), x.value = "", W = [], Ee(), je(x), B(), j(), x.focus(), G(y.getState());
|
|
1004
|
+
}, Lt = (a) => {
|
|
952
1005
|
if (!a) {
|
|
953
|
-
|
|
1006
|
+
De?.remove(), De = null;
|
|
954
1007
|
return;
|
|
955
1008
|
}
|
|
956
|
-
|
|
1009
|
+
De || (De = gt(
|
|
957
1010
|
"pluno-pa-widget__new-chat",
|
|
958
1011
|
"New chat",
|
|
959
|
-
|
|
1012
|
+
Ea(),
|
|
960
1013
|
!1
|
|
961
|
-
),
|
|
962
|
-
},
|
|
963
|
-
if (
|
|
964
|
-
|
|
1014
|
+
), De.addEventListener("click", Go), Ye.insertBefore(De, X));
|
|
1015
|
+
}, G = (a) => {
|
|
1016
|
+
if (_e(), tn(a.lastErrorCode) ? Ie = a.lastErrorCode : t.billingStatus?.creditsUsed !== null && !ae(t.billingStatus) && (Ie = null), Bt(
|
|
1017
|
+
H,
|
|
965
1018
|
t.billingStatus,
|
|
966
|
-
|
|
1019
|
+
Ie
|
|
967
1020
|
), t.loginRequired) {
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
1021
|
+
Et.clear(), Wn(
|
|
1022
|
+
N,
|
|
1023
|
+
de,
|
|
1024
|
+
Lt,
|
|
1025
|
+
tt,
|
|
973
1026
|
"Log in to use Pluno on this page.",
|
|
974
1027
|
t.loginButtonLabel,
|
|
975
1028
|
t.loginUrl,
|
|
@@ -978,11 +1031,11 @@ async function ki(e = {}) {
|
|
|
978
1031
|
return;
|
|
979
1032
|
}
|
|
980
1033
|
if (t.signupRequired) {
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
1034
|
+
Et.clear(), Wn(
|
|
1035
|
+
N,
|
|
1036
|
+
de,
|
|
1037
|
+
Lt,
|
|
1038
|
+
tt,
|
|
986
1039
|
"Complete signup to unlock your free trial credits.",
|
|
987
1040
|
t.signupButtonLabel,
|
|
988
1041
|
t.signupUrl,
|
|
@@ -990,67 +1043,67 @@ async function ki(e = {}) {
|
|
|
990
1043
|
);
|
|
991
1044
|
return;
|
|
992
1045
|
}
|
|
993
|
-
const s =
|
|
994
|
-
|
|
995
|
-
const
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1046
|
+
const s = sa(a), w = s !== nn;
|
|
1047
|
+
nn = s;
|
|
1048
|
+
const S = fe || we.enabled;
|
|
1049
|
+
fe = !1, Ga(
|
|
1050
|
+
N,
|
|
1051
|
+
ht,
|
|
1052
|
+
de,
|
|
1053
|
+
Lt,
|
|
1054
|
+
D,
|
|
1002
1055
|
a,
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
() =>
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
(
|
|
1012
|
-
|
|
1056
|
+
Te,
|
|
1057
|
+
Te !== null && Ut(a, kt()),
|
|
1058
|
+
S,
|
|
1059
|
+
() => we.enabled,
|
|
1060
|
+
mt,
|
|
1061
|
+
Et,
|
|
1062
|
+
B,
|
|
1063
|
+
tt,
|
|
1064
|
+
(M) => {
|
|
1065
|
+
fe = !0, ee(!0, "send"), te(), y.sendMessage(M);
|
|
1013
1066
|
},
|
|
1014
|
-
|
|
1015
|
-
dismissedCandidateIds:
|
|
1016
|
-
draftingCandidateId:
|
|
1017
|
-
error:
|
|
1018
|
-
characterIconOptions:
|
|
1019
|
-
onSeen: (
|
|
1020
|
-
|
|
1067
|
+
Ho && !ft ? {
|
|
1068
|
+
dismissedCandidateIds: Xe,
|
|
1069
|
+
draftingCandidateId: nt,
|
|
1070
|
+
error: $e,
|
|
1071
|
+
characterIconOptions: tt(),
|
|
1072
|
+
onSeen: (M) => {
|
|
1073
|
+
ke.add(M.id), B();
|
|
1021
1074
|
},
|
|
1022
|
-
onDraft: (
|
|
1023
|
-
|
|
1075
|
+
onDraft: (M) => {
|
|
1076
|
+
$o(M);
|
|
1024
1077
|
},
|
|
1025
|
-
onDismiss: (
|
|
1026
|
-
|
|
1078
|
+
onDismiss: (M) => {
|
|
1079
|
+
ke.add(M.id), Xe.add(M.id), B(), $e = null, G(y.getState());
|
|
1027
1080
|
},
|
|
1028
|
-
onDisable: (
|
|
1029
|
-
|
|
1081
|
+
onDisable: (M) => {
|
|
1082
|
+
ft = !0, ke.add(M.id), Xe.add(M.id), B(), ur(t, !0), $e = null, G(y.getState());
|
|
1030
1083
|
}
|
|
1031
1084
|
} : void 0
|
|
1032
|
-
),
|
|
1085
|
+
), S ? (be = N.scrollTop, te()) : w && da(a) && Lo();
|
|
1033
1086
|
};
|
|
1034
|
-
return
|
|
1087
|
+
return mn = si(
|
|
1035
1088
|
(a) => {
|
|
1036
|
-
|
|
1089
|
+
Te = a, !Le && Ut(y.getState(), kt()) && G(y.getState());
|
|
1037
1090
|
},
|
|
1038
1091
|
{
|
|
1039
1092
|
backendUrl: t.backendUrl,
|
|
1040
|
-
fetcher:
|
|
1093
|
+
fetcher: ko,
|
|
1041
1094
|
loader: t.activeUsersLoader
|
|
1042
1095
|
}
|
|
1043
|
-
),
|
|
1044
|
-
const s =
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
},
|
|
1096
|
+
), y.on("state", (a) => {
|
|
1097
|
+
const s = un && !a.isThinking;
|
|
1098
|
+
un = a.isThinking, a.isThinking && !a.assistantDraft.trim() && qe && !Ne && Ae === null && Me?.hidden !== !1 && (Ae = window.setTimeout(() => {
|
|
1099
|
+
Ae = null, Fo();
|
|
1100
|
+
}, hi)), (!a.isThinking || a.assistantDraft.trim()) && (gn(), ot()), s && !i.classList.contains("pluno-pa-widget--open") && (We = !0), yt(), a.appearance ? (St = !0, J(
|
|
1048
1101
|
"web-sdk.widget",
|
|
1049
1102
|
"Agent state supplied appearance",
|
|
1050
1103
|
{
|
|
1051
1104
|
appearance: a.appearance
|
|
1052
1105
|
}
|
|
1053
|
-
),
|
|
1106
|
+
), Pt(a.appearance, "agent.state.appearance")) : St && (St = !1, J(
|
|
1054
1107
|
"web-sdk.widget",
|
|
1055
1108
|
"Agent state cleared appearance; reverting to configured widget options",
|
|
1056
1109
|
{
|
|
@@ -1058,101 +1111,101 @@ async function ki(e = {}) {
|
|
|
1058
1111
|
fallbackColorScheme: t.colorScheme,
|
|
1059
1112
|
fallbackFontFamily: t.fontFamily
|
|
1060
1113
|
}
|
|
1061
|
-
),
|
|
1062
|
-
}),
|
|
1063
|
-
agent:
|
|
1114
|
+
), Pt({}, "agent.state.appearance-cleared")), G(a), j(), s && pn();
|
|
1115
|
+
}), G(y.getState()), j(), {
|
|
1116
|
+
agent: y,
|
|
1064
1117
|
updateAppearance: (a) => {
|
|
1065
|
-
a.scribbleStyle !== void 0 && (t.scribbleStyle = a.scribbleStyle),
|
|
1118
|
+
a.scribbleStyle !== void 0 && (t.scribbleStyle = a.scribbleStyle), Pt(a, "widgetHandle.updateAppearance");
|
|
1066
1119
|
},
|
|
1067
1120
|
updateBillingStatus: (a) => {
|
|
1068
1121
|
const s = a ?? null;
|
|
1069
|
-
|
|
1122
|
+
Bn(
|
|
1070
1123
|
t.billingStatus,
|
|
1071
1124
|
s,
|
|
1072
|
-
|
|
1073
|
-
) && (t.billingStatus = s, t.billingStatus?.creditsUsed !== null && !
|
|
1125
|
+
Ie
|
|
1126
|
+
) && (t.billingStatus = s, t.billingStatus?.creditsUsed !== null && !ae(t.billingStatus) && (Ie = null), Bt(
|
|
1074
1127
|
i.querySelector(".pluno-pa-widget__billing-status"),
|
|
1075
1128
|
t.billingStatus,
|
|
1076
|
-
|
|
1077
|
-
),
|
|
1129
|
+
Ie
|
|
1130
|
+
), j());
|
|
1078
1131
|
},
|
|
1079
1132
|
updateAuthGate: (a) => {
|
|
1080
|
-
const s =
|
|
1081
|
-
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),
|
|
1082
|
-
|
|
1133
|
+
const s = Qe();
|
|
1134
|
+
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), et(), G(y.getState()), j(), s && !Qe() && y.connect().catch((w) => {
|
|
1135
|
+
J(
|
|
1083
1136
|
"web-sdk.widget",
|
|
1084
1137
|
"Failed to connect after auth gate cleared",
|
|
1085
1138
|
{
|
|
1086
|
-
message:
|
|
1139
|
+
message: w instanceof Error ? w.message : String(w)
|
|
1087
1140
|
}
|
|
1088
1141
|
);
|
|
1089
1142
|
});
|
|
1090
1143
|
},
|
|
1091
1144
|
openPanel: () => {
|
|
1092
|
-
|
|
1145
|
+
ge(x.value, !1);
|
|
1093
1146
|
},
|
|
1094
1147
|
updateDisplayState: (a) => {
|
|
1095
1148
|
if (a === "shown") {
|
|
1096
|
-
|
|
1149
|
+
Ue("shown", !1);
|
|
1097
1150
|
return;
|
|
1098
1151
|
}
|
|
1099
|
-
|
|
1152
|
+
Ue("minimized", !1);
|
|
1100
1153
|
},
|
|
1101
1154
|
destroy: () => {
|
|
1102
|
-
|
|
1155
|
+
Le || (B(), Le = !0, an.disconnect(), cn?.disconnect(), Oo(), window.removeEventListener("resize", rn), ln(), Do(), le !== null && window.clearTimeout(le), gn(), mn(), Pe?.remove(), y.destroy(), n.remove());
|
|
1103
1156
|
}
|
|
1104
1157
|
};
|
|
1105
|
-
async function
|
|
1106
|
-
if (!
|
|
1107
|
-
|
|
1158
|
+
async function $o(a) {
|
|
1159
|
+
if (!nt) {
|
|
1160
|
+
nt = a.id, $e = null, G(y.getState());
|
|
1108
1161
|
try {
|
|
1109
1162
|
if (!t.socialPostDraftHandler)
|
|
1110
1163
|
throw new Error("Social post drafting is not available here.");
|
|
1111
1164
|
const s = await t.socialPostDraftHandler(a);
|
|
1112
1165
|
if (!s.linkedinPost || !s.xPost)
|
|
1113
1166
|
throw new Error("Pluno did not return a complete social post draft.");
|
|
1114
|
-
|
|
1167
|
+
ke.add(a.id), Xe.add(a.id), B(), Pe?.remove(), Pe = Za(s, {
|
|
1115
1168
|
socialPostRewardsUrl: t.socialPostRewardsUrl,
|
|
1116
1169
|
onClose: () => {
|
|
1117
|
-
|
|
1170
|
+
Pe?.remove(), Pe = null;
|
|
1118
1171
|
}
|
|
1119
|
-
}), i.appendChild(
|
|
1172
|
+
}), i.appendChild(Pe);
|
|
1120
1173
|
} catch (s) {
|
|
1121
|
-
|
|
1174
|
+
$e = s instanceof Error ? s.message : "Could not draft social post.";
|
|
1122
1175
|
} finally {
|
|
1123
|
-
|
|
1176
|
+
nt = null, G(y.getState());
|
|
1124
1177
|
}
|
|
1125
1178
|
}
|
|
1126
1179
|
}
|
|
1127
|
-
function
|
|
1128
|
-
const
|
|
1129
|
-
r =
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
),
|
|
1133
|
-
accentColor:
|
|
1134
|
-
colorScheme:
|
|
1135
|
-
fontFamily:
|
|
1136
|
-
scribbleStyle:
|
|
1137
|
-
}),
|
|
1180
|
+
function Pt(a, s) {
|
|
1181
|
+
const w = a.accentColor ?? t.accentColor, S = a.colorScheme ?? t.colorScheme, M = a.fontFamily ?? t.fontFamily, It = a.scribbleStyle ?? t.scribbleStyle;
|
|
1182
|
+
r = Pn(
|
|
1183
|
+
w,
|
|
1184
|
+
It
|
|
1185
|
+
), In(i, r, {
|
|
1186
|
+
accentColor: w,
|
|
1187
|
+
colorScheme: S,
|
|
1188
|
+
fontFamily: M,
|
|
1189
|
+
scribbleStyle: It
|
|
1190
|
+
}), J("web-sdk.widget", "Updated widget appearance", {
|
|
1138
1191
|
source: s,
|
|
1139
1192
|
inputAppearance: a,
|
|
1140
|
-
appliedAccentColor:
|
|
1141
|
-
appliedColorScheme:
|
|
1142
|
-
appliedFontFamily:
|
|
1143
|
-
appliedScribbleStyle:
|
|
1193
|
+
appliedAccentColor: w,
|
|
1194
|
+
appliedColorScheme: S,
|
|
1195
|
+
appliedFontFamily: M,
|
|
1196
|
+
appliedScribbleStyle: It,
|
|
1144
1197
|
cssAccent: i.style.getPropertyValue("--pluno-pa-accent")
|
|
1145
1198
|
});
|
|
1146
1199
|
}
|
|
1147
1200
|
}
|
|
1148
|
-
function
|
|
1201
|
+
function Pn(e, t) {
|
|
1149
1202
|
return { accentColor: e, scribbleStyle: t };
|
|
1150
1203
|
}
|
|
1151
|
-
function
|
|
1152
|
-
const t =
|
|
1153
|
-
return t === null ? "#fafafa" :
|
|
1204
|
+
function ji(e) {
|
|
1205
|
+
const t = Vi(e);
|
|
1206
|
+
return t === null ? "#fafafa" : Ki(t) > 0.5 ? "#18181b" : "#fafaf9";
|
|
1154
1207
|
}
|
|
1155
|
-
function
|
|
1208
|
+
function Vi(e) {
|
|
1156
1209
|
const t = e.trim();
|
|
1157
1210
|
return /^#[0-9a-f]{6}$/i.test(t) ? [
|
|
1158
1211
|
Number.parseInt(t.slice(1, 3), 16),
|
|
@@ -1164,42 +1217,42 @@ function Ii(e) {
|
|
|
1164
1217
|
Number.parseInt(t[3] + t[3], 16)
|
|
1165
1218
|
] : null;
|
|
1166
1219
|
}
|
|
1167
|
-
function
|
|
1168
|
-
const
|
|
1220
|
+
function Ki([e, t, n]) {
|
|
1221
|
+
const o = (i) => {
|
|
1169
1222
|
const r = i / 255;
|
|
1170
1223
|
return r <= 0.03928 ? r / 12.92 : ((r + 0.055) / 1.055) ** 2.4;
|
|
1171
1224
|
};
|
|
1172
|
-
return 0.2126 *
|
|
1225
|
+
return 0.2126 * o(e) + 0.7152 * o(t) + 0.0722 * o(n);
|
|
1173
1226
|
}
|
|
1174
|
-
function
|
|
1227
|
+
function In(e, t, n) {
|
|
1175
1228
|
e.classList.toggle(
|
|
1176
1229
|
"pluno-pa-widget--dark",
|
|
1177
|
-
|
|
1230
|
+
n.colorScheme === "dark"
|
|
1178
1231
|
), e.classList.toggle(
|
|
1179
1232
|
"pluno-pa-widget--light",
|
|
1180
|
-
|
|
1181
|
-
), e.classList.toggle("pluno-pa-widget--scribble",
|
|
1182
|
-
const
|
|
1183
|
-
e.style.setProperty("--pluno-pa-accent",
|
|
1233
|
+
n.colorScheme !== "dark"
|
|
1234
|
+
), e.classList.toggle("pluno-pa-widget--scribble", n.scribbleStyle);
|
|
1235
|
+
const o = n.scribbleStyle ? Kn(n.accentColor) : n.accentColor;
|
|
1236
|
+
e.style.setProperty("--pluno-pa-accent", o), n.scribbleStyle ? e.style.setProperty(
|
|
1184
1237
|
"--pluno-pa-accent-contrast",
|
|
1185
|
-
|
|
1186
|
-
) : e.style.removeProperty("--pluno-pa-accent-contrast"), e.style.fontFamily =
|
|
1238
|
+
ji(o)
|
|
1239
|
+
) : e.style.removeProperty("--pluno-pa-accent-contrast"), e.style.fontFamily = n.scribbleStyle ? Ai : n.fontFamily, n.scribbleStyle && Yi(e.ownerDocument);
|
|
1187
1240
|
const i = Array.from(
|
|
1188
1241
|
e.querySelectorAll(".pluno-pa-widget__character")
|
|
1189
1242
|
);
|
|
1190
1243
|
for (const r of i)
|
|
1191
1244
|
r.replaceWith(
|
|
1192
|
-
|
|
1245
|
+
me(
|
|
1193
1246
|
Array.from(r.classList).join(" "),
|
|
1194
1247
|
t
|
|
1195
1248
|
)
|
|
1196
1249
|
);
|
|
1197
1250
|
}
|
|
1198
|
-
function
|
|
1199
|
-
if (e.getElementById(
|
|
1251
|
+
function Yi(e) {
|
|
1252
|
+
if (e.getElementById(Sn))
|
|
1200
1253
|
return;
|
|
1201
1254
|
const t = e.createElement("style");
|
|
1202
|
-
t.id =
|
|
1255
|
+
t.id = Sn, t.textContent = `@font-face {
|
|
1203
1256
|
font-family: "Architects Daughter";
|
|
1204
1257
|
font-style: normal;
|
|
1205
1258
|
font-weight: 400;
|
|
@@ -1207,201 +1260,353 @@ function Ni(e) {
|
|
|
1207
1260
|
src: url("https://fonts.gstatic.com/s/architectsdaughter/v20/KtkxAKiDZI_td1Lkx62xHZHDtgO_Y-bvTYlg4-7jA-U.woff2") format("woff2");
|
|
1208
1261
|
}`, e.head.appendChild(t), e.fonts?.load('16px "Architects Daughter"');
|
|
1209
1262
|
}
|
|
1210
|
-
function
|
|
1263
|
+
function Xi({
|
|
1211
1264
|
root: e,
|
|
1212
1265
|
launcher: t,
|
|
1213
|
-
launcherDragHandle:
|
|
1214
|
-
getPosition:
|
|
1266
|
+
launcherDragHandle: n,
|
|
1267
|
+
getPosition: o,
|
|
1215
1268
|
setPosition: i,
|
|
1216
1269
|
persist: r
|
|
1217
1270
|
}) {
|
|
1218
|
-
let l = null, p = null, d = null,
|
|
1219
|
-
const
|
|
1220
|
-
l = null, p = null, d = null,
|
|
1221
|
-
},
|
|
1222
|
-
e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing") || (h.preventDefault(), h.stopPropagation(), l = h.pointerId, p = { x: h.clientX, y: h.clientY }, d =
|
|
1223
|
-
},
|
|
1271
|
+
let l = null, p = null, d = null, c = !1, u = null;
|
|
1272
|
+
const m = () => {
|
|
1273
|
+
l = null, p = null, d = null, c = !1, e.classList.remove("pluno-pa-widget--dragging");
|
|
1274
|
+
}, k = (h) => {
|
|
1275
|
+
e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing") || (h.preventDefault(), h.stopPropagation(), l = h.pointerId, p = { x: h.clientX, y: h.clientY }, d = o(), c = !1, t.setPointerCapture?.(h.pointerId));
|
|
1276
|
+
}, v = (h) => {
|
|
1224
1277
|
if (l !== h.pointerId || !p || !d)
|
|
1225
1278
|
return;
|
|
1226
1279
|
h.preventDefault();
|
|
1227
|
-
const
|
|
1228
|
-
!
|
|
1229
|
-
},
|
|
1230
|
-
l === h.pointerId && (h.preventDefault(), h.stopPropagation(),
|
|
1231
|
-
},
|
|
1232
|
-
l === h.pointerId && (h.preventDefault(),
|
|
1233
|
-
},
|
|
1234
|
-
if (!
|
|
1280
|
+
const P = h.clientX - p.x, A = h.clientY - p.y;
|
|
1281
|
+
!c && Math.hypot(P, A) < jt || (c = !0, e.classList.add("pluno-pa-widget--dragging"), i({ x: d.x + P, y: d.y + A }));
|
|
1282
|
+
}, z = (h) => {
|
|
1283
|
+
l === h.pointerId && (h.preventDefault(), h.stopPropagation(), c && (u = { x: h.clientX, y: h.clientY }, r()), m());
|
|
1284
|
+
}, _ = (h) => {
|
|
1285
|
+
l === h.pointerId && (h.preventDefault(), m());
|
|
1286
|
+
}, g = (h) => {
|
|
1287
|
+
if (!u)
|
|
1235
1288
|
return;
|
|
1236
|
-
const
|
|
1237
|
-
h.clientX -
|
|
1238
|
-
h.clientY -
|
|
1239
|
-
) <=
|
|
1240
|
-
|
|
1241
|
-
},
|
|
1289
|
+
const P = Math.hypot(
|
|
1290
|
+
h.clientX - u.x,
|
|
1291
|
+
h.clientY - u.y
|
|
1292
|
+
) <= jt;
|
|
1293
|
+
u = null, P && (h.preventDefault(), h.stopPropagation());
|
|
1294
|
+
}, b = (h) => {
|
|
1242
1295
|
if (e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing"))
|
|
1243
1296
|
return;
|
|
1244
|
-
const
|
|
1297
|
+
const P = h.shiftKey ? oo : no, A = o();
|
|
1245
1298
|
let L = null;
|
|
1246
|
-
h.key === "ArrowUp" ? L = { x:
|
|
1299
|
+
h.key === "ArrowUp" ? L = { x: A.x, y: A.y - P } : h.key === "ArrowDown" ? L = { x: A.x, y: A.y + P } : h.key === "ArrowLeft" ? L = { x: A.x - P, y: A.y } : h.key === "ArrowRight" && (L = { x: A.x + P, y: A.y }), L && (h.preventDefault(), h.stopPropagation(), i(L), r());
|
|
1300
|
+
};
|
|
1301
|
+
return t.addEventListener("pointerdown", k), t.addEventListener("pointermove", v), t.addEventListener("pointerup", z), t.addEventListener("pointercancel", _), t.addEventListener("click", g, !0), n.addEventListener("keydown", b), () => {
|
|
1302
|
+
t.removeEventListener("pointerdown", k), t.removeEventListener("pointermove", v), t.removeEventListener("pointerup", z), t.removeEventListener("pointercancel", _), t.removeEventListener("click", g, !0), n.removeEventListener("keydown", b);
|
|
1303
|
+
};
|
|
1304
|
+
}
|
|
1305
|
+
function Zi({
|
|
1306
|
+
root: e,
|
|
1307
|
+
handles: t,
|
|
1308
|
+
getBounds: n,
|
|
1309
|
+
setBounds: o,
|
|
1310
|
+
persist: i
|
|
1311
|
+
}) {
|
|
1312
|
+
let r = null, l = null, p = null, d = null, c = !1;
|
|
1313
|
+
const u = () => {
|
|
1314
|
+
r = null, l = null, p = null, d = null, c = !1, e.classList.remove("pluno-pa-widget--resizing");
|
|
1315
|
+
}, m = (g) => {
|
|
1316
|
+
const b = g.currentTarget, h = b.dataset.resizeDirection;
|
|
1317
|
+
!e.classList.contains("pluno-pa-widget--open") || !An(h) || (g.preventDefault(), g.stopPropagation(), r = g.pointerId, l = h, p = { x: g.clientX, y: g.clientY }, d = n(), c = !1, b.setPointerCapture?.(g.pointerId));
|
|
1318
|
+
}, k = (g) => {
|
|
1319
|
+
if (r !== g.pointerId || !l || !p || !d)
|
|
1320
|
+
return;
|
|
1321
|
+
g.preventDefault(), g.stopPropagation();
|
|
1322
|
+
const b = g.clientX - p.x, h = g.clientY - p.y;
|
|
1323
|
+
!c && Math.hypot(b, h) < jt || (c = !0, e.classList.add("pluno-pa-widget--resizing"), o(
|
|
1324
|
+
Nn(d, l, b, h)
|
|
1325
|
+
));
|
|
1326
|
+
}, v = (g) => {
|
|
1327
|
+
r === g.pointerId && (g.preventDefault(), g.stopPropagation(), c && i(), u());
|
|
1328
|
+
}, z = (g) => {
|
|
1329
|
+
r === g.pointerId && (g.preventDefault(), u());
|
|
1330
|
+
}, _ = (g) => {
|
|
1331
|
+
const h = g.currentTarget.dataset.resizeDirection, P = g.shiftKey ? oo : no, A = n();
|
|
1332
|
+
let L = 0, F = 0;
|
|
1333
|
+
An(h) && (g.key === "ArrowLeft" ? L = -P : g.key === "ArrowRight" ? L = P : g.key === "ArrowUp" ? F = -P : g.key === "ArrowDown" && (F = P), !(L === 0 && F === 0) && (g.preventDefault(), g.stopPropagation(), o(Nn(A, h, L, F)), i()));
|
|
1247
1334
|
};
|
|
1248
|
-
|
|
1249
|
-
|
|
1335
|
+
for (const g of t)
|
|
1336
|
+
g.addEventListener("pointerdown", m), g.addEventListener("pointermove", k), g.addEventListener("pointerup", v), g.addEventListener("pointercancel", z), g.addEventListener("keydown", _);
|
|
1337
|
+
return () => {
|
|
1338
|
+
for (const g of t)
|
|
1339
|
+
g.removeEventListener("pointerdown", m), g.removeEventListener("pointermove", k), g.removeEventListener("pointerup", v), g.removeEventListener("pointercancel", z), g.removeEventListener("keydown", _);
|
|
1250
1340
|
};
|
|
1251
1341
|
}
|
|
1252
|
-
function
|
|
1253
|
-
|
|
1342
|
+
function An(e) {
|
|
1343
|
+
return e === "left" || e === "right" || e === "top" || e === "bottom" || e === "top-left" || e === "top-right" || e === "bottom-left" || e === "bottom-right";
|
|
1344
|
+
}
|
|
1345
|
+
function Nn(e, t, n, o) {
|
|
1346
|
+
const i = Y(), r = Tn({
|
|
1347
|
+
leading: e.position.x,
|
|
1348
|
+
length: e.size.width,
|
|
1349
|
+
delta: n,
|
|
1350
|
+
resizeLeading: t.endsWith("left") || t === "left",
|
|
1351
|
+
resizeTrailing: t.endsWith("right") || t === "right",
|
|
1352
|
+
minLeading: I,
|
|
1353
|
+
maxTrailing: i.width - I,
|
|
1354
|
+
minLength: Math.min(
|
|
1355
|
+
Jt,
|
|
1356
|
+
i.width - I * 2
|
|
1357
|
+
)
|
|
1358
|
+
}), l = Tn({
|
|
1359
|
+
leading: e.position.y,
|
|
1360
|
+
length: e.size.height,
|
|
1361
|
+
delta: o,
|
|
1362
|
+
resizeLeading: t.startsWith("top") || t === "top",
|
|
1363
|
+
resizeTrailing: t.startsWith("bottom") || t === "bottom",
|
|
1364
|
+
minLeading: Ce,
|
|
1365
|
+
maxTrailing: i.height - I,
|
|
1366
|
+
minLength: Math.min(
|
|
1367
|
+
Qt,
|
|
1368
|
+
i.height - Ce - I
|
|
1369
|
+
)
|
|
1370
|
+
});
|
|
1371
|
+
return {
|
|
1372
|
+
position: { x: r.leading, y: l.leading },
|
|
1373
|
+
size: { width: r.length, height: l.length }
|
|
1374
|
+
};
|
|
1375
|
+
}
|
|
1376
|
+
function Tn({
|
|
1377
|
+
leading: e,
|
|
1378
|
+
length: t,
|
|
1379
|
+
delta: n,
|
|
1380
|
+
resizeLeading: o,
|
|
1381
|
+
resizeTrailing: i,
|
|
1382
|
+
minLeading: r,
|
|
1383
|
+
maxTrailing: l,
|
|
1384
|
+
minLength: p
|
|
1385
|
+
}) {
|
|
1386
|
+
const d = e + t;
|
|
1387
|
+
if (o) {
|
|
1388
|
+
const c = e + n;
|
|
1389
|
+
if (c >= r) {
|
|
1390
|
+
const m = K(c, r, d - p);
|
|
1391
|
+
return { leading: m, length: d - m };
|
|
1392
|
+
}
|
|
1393
|
+
const u = K(
|
|
1394
|
+
d + r - c,
|
|
1395
|
+
d,
|
|
1396
|
+
l
|
|
1397
|
+
);
|
|
1398
|
+
return { leading: r, length: u - r };
|
|
1399
|
+
}
|
|
1400
|
+
if (i) {
|
|
1401
|
+
const c = d + n;
|
|
1402
|
+
if (c <= l) {
|
|
1403
|
+
const m = K(
|
|
1404
|
+
c,
|
|
1405
|
+
e + p,
|
|
1406
|
+
l
|
|
1407
|
+
);
|
|
1408
|
+
return { leading: e, length: m - e };
|
|
1409
|
+
}
|
|
1410
|
+
const u = K(
|
|
1411
|
+
e - (c - l),
|
|
1412
|
+
r,
|
|
1413
|
+
e
|
|
1414
|
+
);
|
|
1415
|
+
return { leading: u, length: l - u };
|
|
1416
|
+
}
|
|
1417
|
+
return { leading: e, length: t };
|
|
1418
|
+
}
|
|
1419
|
+
function dt(e, t = !0) {
|
|
1420
|
+
const n = Y();
|
|
1254
1421
|
if (e.classList.contains("pluno-pa-widget--minimized"))
|
|
1255
1422
|
return e.classList.contains("pluno-pa-widget--scribble") ? {
|
|
1256
|
-
width:
|
|
1257
|
-
height:
|
|
1258
|
-
} : { width:
|
|
1259
|
-
const
|
|
1423
|
+
width: Ni,
|
|
1424
|
+
height: Ti
|
|
1425
|
+
} : { width: En, height: En };
|
|
1426
|
+
const o = e.getBoundingClientRect(), i = !e.classList.contains("pluno-pa-widget--open") && !e.classList.contains("pluno-pa-widget--closing");
|
|
1260
1427
|
return {
|
|
1261
|
-
width: t && i &&
|
|
1262
|
-
height: t && i &&
|
|
1428
|
+
width: t && i && o.width > 0 ? o.width : Math.min(Qn, n.width - 36),
|
|
1429
|
+
height: t && i && o.height > 0 ? o.height : e.classList.contains("pluno-pa-widget--scribble") ? Ri : eo
|
|
1263
1430
|
};
|
|
1264
1431
|
}
|
|
1265
|
-
function
|
|
1266
|
-
const e =
|
|
1432
|
+
function Ji() {
|
|
1433
|
+
const e = Y();
|
|
1267
1434
|
return {
|
|
1268
1435
|
width: Math.min(
|
|
1269
|
-
|
|
1270
|
-
e.width *
|
|
1271
|
-
|
|
1272
|
-
|
|
1436
|
+
K(
|
|
1437
|
+
e.width * Mi,
|
|
1438
|
+
Jt,
|
|
1439
|
+
zi
|
|
1273
1440
|
),
|
|
1274
|
-
e.width -
|
|
1441
|
+
e.width - I * 2
|
|
1275
1442
|
),
|
|
1276
1443
|
height: Math.min(
|
|
1277
|
-
|
|
1278
|
-
e.height *
|
|
1279
|
-
|
|
1280
|
-
|
|
1444
|
+
K(
|
|
1445
|
+
e.height * Bi,
|
|
1446
|
+
Qt,
|
|
1447
|
+
Oi
|
|
1448
|
+
),
|
|
1449
|
+
e.height - Ce - I
|
|
1450
|
+
)
|
|
1451
|
+
};
|
|
1452
|
+
}
|
|
1453
|
+
function Re(e = null) {
|
|
1454
|
+
return e ? ut(e) : Ji();
|
|
1455
|
+
}
|
|
1456
|
+
function ut(e) {
|
|
1457
|
+
const t = Y();
|
|
1458
|
+
return {
|
|
1459
|
+
width: K(
|
|
1460
|
+
e.width,
|
|
1461
|
+
Math.min(
|
|
1462
|
+
Jt,
|
|
1463
|
+
t.width - I * 2
|
|
1281
1464
|
),
|
|
1282
|
-
|
|
1465
|
+
Math.max(
|
|
1466
|
+
I,
|
|
1467
|
+
t.width - I * 2
|
|
1468
|
+
)
|
|
1469
|
+
),
|
|
1470
|
+
height: K(
|
|
1471
|
+
e.height,
|
|
1472
|
+
Math.min(
|
|
1473
|
+
Qt,
|
|
1474
|
+
t.height - Ce - I
|
|
1475
|
+
),
|
|
1476
|
+
Math.max(
|
|
1477
|
+
I,
|
|
1478
|
+
t.height - Ce - I
|
|
1479
|
+
)
|
|
1283
1480
|
)
|
|
1284
1481
|
};
|
|
1285
1482
|
}
|
|
1286
|
-
function
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
return
|
|
1483
|
+
function Nt(e, t) {
|
|
1484
|
+
if (!t) {
|
|
1485
|
+
e.style.removeProperty("--pluno-pa-panel-width"), e.style.removeProperty("--pluno-pa-panel-height");
|
|
1486
|
+
return;
|
|
1487
|
+
}
|
|
1488
|
+
const n = ut(t);
|
|
1489
|
+
e.style.setProperty("--pluno-pa-panel-width", `${n.width}px`), e.style.setProperty("--pluno-pa-panel-height", `${n.height}px`);
|
|
1490
|
+
}
|
|
1491
|
+
function Qi(e, t, n) {
|
|
1492
|
+
const o = Number.parseFloat(e.style.left), i = Number.parseFloat(e.style.top);
|
|
1493
|
+
if (Number.isFinite(o) && Number.isFinite(i))
|
|
1494
|
+
return { x: o, y: i };
|
|
1290
1495
|
const r = e.getBoundingClientRect();
|
|
1291
1496
|
if (r.width > 0 || r.height > 0)
|
|
1292
1497
|
return { x: r.left, y: r.top };
|
|
1293
|
-
const l =
|
|
1498
|
+
const l = Y();
|
|
1294
1499
|
return {
|
|
1295
|
-
x: t === "bottom-left" ? 26 : l.width - 26 -
|
|
1296
|
-
y: l.height - 24 -
|
|
1500
|
+
x: t === "bottom-left" ? 26 : l.width - 26 - n.width,
|
|
1501
|
+
y: l.height - 24 - n.height
|
|
1297
1502
|
};
|
|
1298
1503
|
}
|
|
1299
|
-
function
|
|
1300
|
-
const
|
|
1301
|
-
return t ?
|
|
1504
|
+
function Tt(e, t, n) {
|
|
1505
|
+
const o = dt(e, !1);
|
|
1506
|
+
return t ? Vt(
|
|
1302
1507
|
e,
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
) :
|
|
1508
|
+
ro(t, o),
|
|
1509
|
+
o
|
|
1510
|
+
) : ea(n === "bottom-left" ? "bottom-left" : "bottom-right", o, Di);
|
|
1306
1511
|
}
|
|
1307
|
-
function
|
|
1308
|
-
const
|
|
1512
|
+
function ea(e, t, n) {
|
|
1513
|
+
const o = Y();
|
|
1309
1514
|
return {
|
|
1310
|
-
x: e.endsWith("right") ? Math.max(0,
|
|
1311
|
-
y: e.startsWith("bottom") ? Math.max(0,
|
|
1515
|
+
x: e.endsWith("right") ? Math.max(0, o.width - t.width - n) : n,
|
|
1516
|
+
y: e.startsWith("bottom") ? Math.max(0, o.height - t.height - n) : n
|
|
1312
1517
|
};
|
|
1313
1518
|
}
|
|
1314
|
-
function
|
|
1315
|
-
const
|
|
1519
|
+
function Vt(e, t, n) {
|
|
1520
|
+
const o = Y(), i = I + oa(e);
|
|
1316
1521
|
return {
|
|
1317
|
-
x:
|
|
1522
|
+
x: K(
|
|
1318
1523
|
t.x,
|
|
1319
|
-
|
|
1524
|
+
I,
|
|
1320
1525
|
Math.max(
|
|
1321
|
-
|
|
1322
|
-
|
|
1526
|
+
I,
|
|
1527
|
+
o.width - n.width - I
|
|
1323
1528
|
)
|
|
1324
1529
|
),
|
|
1325
|
-
y:
|
|
1530
|
+
y: K(
|
|
1326
1531
|
t.y,
|
|
1327
1532
|
i,
|
|
1328
1533
|
Math.max(
|
|
1329
1534
|
i,
|
|
1330
|
-
|
|
1535
|
+
o.height - n.height - I
|
|
1331
1536
|
)
|
|
1332
1537
|
)
|
|
1333
1538
|
};
|
|
1334
1539
|
}
|
|
1335
|
-
function
|
|
1336
|
-
const
|
|
1540
|
+
function ro(e, t) {
|
|
1541
|
+
const n = Y();
|
|
1337
1542
|
return {
|
|
1338
|
-
x: e.anchor.endsWith("right") ?
|
|
1339
|
-
y: e.anchor.startsWith("bottom") ?
|
|
1543
|
+
x: e.anchor.endsWith("right") ? n.width - t.width - e.x : e.x,
|
|
1544
|
+
y: e.anchor.startsWith("bottom") ? n.height - t.height - e.y : e.y
|
|
1340
1545
|
};
|
|
1341
1546
|
}
|
|
1342
|
-
function
|
|
1343
|
-
const
|
|
1547
|
+
function ta(e, t) {
|
|
1548
|
+
const n = na(e, t), o = Y();
|
|
1344
1549
|
return {
|
|
1345
|
-
anchor:
|
|
1346
|
-
x:
|
|
1347
|
-
y:
|
|
1550
|
+
anchor: n,
|
|
1551
|
+
x: n.endsWith("right") ? o.width - e.x - t.width : e.x,
|
|
1552
|
+
y: n.startsWith("bottom") ? o.height - e.y - t.height : e.y
|
|
1348
1553
|
};
|
|
1349
1554
|
}
|
|
1350
|
-
function
|
|
1351
|
-
const
|
|
1555
|
+
function na(e, t) {
|
|
1556
|
+
const n = Y(), o = e.x + t.width / 2, r = e.y + t.height / 2 <= n.height / 2 ? "top" : "bottom", l = o <= n.width / 2 ? "left" : "right";
|
|
1352
1557
|
return `${r}-${l}`;
|
|
1353
1558
|
}
|
|
1354
|
-
function
|
|
1355
|
-
return e.classList.contains("pluno-pa-widget--scribble") ?
|
|
1559
|
+
function oa(e) {
|
|
1560
|
+
return e.classList.contains("pluno-pa-widget--scribble") ? Wi : Hi;
|
|
1356
1561
|
}
|
|
1357
|
-
function
|
|
1358
|
-
const
|
|
1359
|
-
x:
|
|
1360
|
-
y: t.y +
|
|
1562
|
+
function Dt(e, t, n, o = null) {
|
|
1563
|
+
const i = dt(e), r = Re(o), l = {
|
|
1564
|
+
x: n === "bottom-left" ? t.x : t.x + i.width - r.width,
|
|
1565
|
+
y: t.y + i.height - r.height
|
|
1361
1566
|
};
|
|
1362
|
-
return
|
|
1567
|
+
return lt(l, r);
|
|
1363
1568
|
}
|
|
1364
|
-
function
|
|
1365
|
-
const
|
|
1569
|
+
function lt(e, t) {
|
|
1570
|
+
const n = Y();
|
|
1366
1571
|
return {
|
|
1367
|
-
x:
|
|
1572
|
+
x: K(
|
|
1368
1573
|
e.x,
|
|
1369
|
-
|
|
1574
|
+
I,
|
|
1370
1575
|
Math.max(
|
|
1371
|
-
|
|
1372
|
-
|
|
1576
|
+
I,
|
|
1577
|
+
n.width - t.width - I
|
|
1373
1578
|
)
|
|
1374
1579
|
),
|
|
1375
|
-
y:
|
|
1580
|
+
y: K(
|
|
1376
1581
|
e.y,
|
|
1377
|
-
|
|
1582
|
+
Ce,
|
|
1378
1583
|
Math.max(
|
|
1379
|
-
|
|
1380
|
-
|
|
1584
|
+
Ce,
|
|
1585
|
+
n.height - t.height - I
|
|
1381
1586
|
)
|
|
1382
1587
|
)
|
|
1383
1588
|
};
|
|
1384
1589
|
}
|
|
1385
|
-
function
|
|
1590
|
+
function ve(e, t) {
|
|
1386
1591
|
if (e.classList.toggle("pluno-pa-widget--custom-position", t !== null), !t) {
|
|
1387
1592
|
e.style.removeProperty("left"), e.style.removeProperty("top"), e.style.removeProperty("right"), e.style.removeProperty("bottom");
|
|
1388
1593
|
return;
|
|
1389
1594
|
}
|
|
1390
1595
|
e.style.left = `${t.x}px`, e.style.top = `${t.y}px`, e.style.right = "auto", e.style.bottom = "auto";
|
|
1391
1596
|
}
|
|
1392
|
-
function
|
|
1597
|
+
function ia(e, t) {
|
|
1393
1598
|
e.style.setProperty("--pluno-pa-panel-offset-x", `${t.x}px`), e.style.setProperty("--pluno-pa-panel-offset-y", `${t.y}px`);
|
|
1394
1599
|
}
|
|
1395
|
-
function
|
|
1600
|
+
function Dn(e) {
|
|
1396
1601
|
e.style.removeProperty("--pluno-pa-panel-offset-x"), e.style.removeProperty("--pluno-pa-panel-offset-y");
|
|
1397
1602
|
}
|
|
1398
|
-
function
|
|
1603
|
+
function Y() {
|
|
1399
1604
|
return {
|
|
1400
|
-
width: window.innerWidth || document.documentElement.clientWidth ||
|
|
1401
|
-
height: window.innerHeight || document.documentElement.clientHeight ||
|
|
1605
|
+
width: window.innerWidth || document.documentElement.clientWidth || Qn + I * 2,
|
|
1606
|
+
height: window.innerHeight || document.documentElement.clientHeight || eo + I * 2
|
|
1402
1607
|
};
|
|
1403
1608
|
}
|
|
1404
|
-
function
|
|
1609
|
+
function Rt(e) {
|
|
1405
1610
|
const t = e.getBoundingClientRect();
|
|
1406
1611
|
return {
|
|
1407
1612
|
x: Math.round(t.x),
|
|
@@ -1410,57 +1615,57 @@ function St(e) {
|
|
|
1410
1615
|
height: Math.round(t.height)
|
|
1411
1616
|
};
|
|
1412
1617
|
}
|
|
1413
|
-
function
|
|
1414
|
-
return Math.min(Math.max(e, t),
|
|
1618
|
+
function K(e, t, n) {
|
|
1619
|
+
return Math.min(Math.max(e, t), n);
|
|
1415
1620
|
}
|
|
1416
|
-
function
|
|
1621
|
+
function J(e, t, n) {
|
|
1417
1622
|
if (typeof window > "u")
|
|
1418
1623
|
return;
|
|
1419
|
-
const
|
|
1624
|
+
const o = window, i = {
|
|
1420
1625
|
at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1421
1626
|
source: e,
|
|
1422
1627
|
message: t,
|
|
1423
|
-
details:
|
|
1424
|
-
}, r =
|
|
1425
|
-
r.push(i), r.length > 120 && r.splice(0, r.length - 120),
|
|
1426
|
-
new CustomEvent(
|
|
1628
|
+
details: n
|
|
1629
|
+
}, r = o.__plunoProductAgentDiagnostics__ ?? [];
|
|
1630
|
+
r.push(i), r.length > 120 && r.splice(0, r.length - 120), o.__plunoProductAgentDiagnostics__ = r, o.__PLUNO_PRODUCT_AGENT_DIAGNOSTICS__ = () => [...r], window.dispatchEvent(
|
|
1631
|
+
new CustomEvent(Si, { detail: i })
|
|
1427
1632
|
);
|
|
1428
1633
|
}
|
|
1429
|
-
function
|
|
1430
|
-
|
|
1634
|
+
function aa(e, t) {
|
|
1635
|
+
J("web-sdk.widget.position", e, t);
|
|
1431
1636
|
}
|
|
1432
|
-
function
|
|
1433
|
-
const
|
|
1434
|
-
return !
|
|
1435
|
-
attachments:
|
|
1637
|
+
function zt(e, t, n) {
|
|
1638
|
+
const o = t.value.trim();
|
|
1639
|
+
return !o && n.length === 0 ? n : (t.value = "", t.style.height = "22px", t.style.overflowY = "hidden", e.sendMessage(o, {
|
|
1640
|
+
attachments: n.length > 0 ? n.map(pa) : void 0
|
|
1436
1641
|
}), t.dispatchEvent(new Event("input", { bubbles: !0 })), []);
|
|
1437
1642
|
}
|
|
1438
|
-
function
|
|
1439
|
-
const
|
|
1440
|
-
return
|
|
1643
|
+
function ra(e, t, n) {
|
|
1644
|
+
const o = e.activeElement;
|
|
1645
|
+
return o === n ? "composer" : o === t ? "launcher" : null;
|
|
1441
1646
|
}
|
|
1442
|
-
function
|
|
1443
|
-
if (!e.focusedInput || !e.focusedInputAt || Date.now() - e.focusedInputAt >
|
|
1647
|
+
function la(e, t, n, o) {
|
|
1648
|
+
if (!e.focusedInput || !e.focusedInputAt || Date.now() - e.focusedInputAt > mi)
|
|
1444
1649
|
return;
|
|
1445
|
-
const i = e.focusedInput === "composer" ?
|
|
1446
|
-
i ===
|
|
1650
|
+
const i = e.focusedInput === "composer" ? o : n;
|
|
1651
|
+
i === o && !t.classList.contains("pluno-pa-widget--open") || i === n && t.classList.contains("pluno-pa-widget--open") || window.requestAnimationFrame(() => {
|
|
1447
1652
|
!i.isConnected || i.readOnly || (i.focus(), i.setSelectionRange(i.value.length, i.value.length));
|
|
1448
1653
|
});
|
|
1449
1654
|
}
|
|
1450
|
-
function
|
|
1655
|
+
function pa(e) {
|
|
1451
1656
|
return e;
|
|
1452
1657
|
}
|
|
1453
|
-
function
|
|
1658
|
+
function je(e) {
|
|
1454
1659
|
e.style.height = "0px";
|
|
1455
1660
|
const t = Math.max(22, Math.min(e.scrollHeight, 140));
|
|
1456
1661
|
e.style.height = `${t}px`, e.style.overflowY = e.scrollHeight > 140 ? "auto" : "hidden";
|
|
1457
1662
|
}
|
|
1458
|
-
function
|
|
1663
|
+
function Ve(e, t = () => !0) {
|
|
1459
1664
|
e.scrollTop = e.scrollHeight, window.requestAnimationFrame(() => {
|
|
1460
1665
|
t() && (e.scrollTop = e.scrollHeight);
|
|
1461
1666
|
});
|
|
1462
1667
|
}
|
|
1463
|
-
function
|
|
1668
|
+
function sa(e) {
|
|
1464
1669
|
const t = e.messages[e.messages.length - 1];
|
|
1465
1670
|
return [
|
|
1466
1671
|
e.messages.length,
|
|
@@ -1471,69 +1676,69 @@ function Gi(e) {
|
|
|
1471
1676
|
e.lastError ?? ""
|
|
1472
1677
|
].join(":");
|
|
1473
1678
|
}
|
|
1474
|
-
function
|
|
1679
|
+
function da(e) {
|
|
1475
1680
|
return e.messages.length > 0 || e.assistantDraft.length > 0 || e.isThinking || !!e.lastError;
|
|
1476
1681
|
}
|
|
1477
|
-
function
|
|
1682
|
+
function ca(e) {
|
|
1478
1683
|
return e.firstUserMessage?.trim() ? e.firstUserMessage : e.title?.trim() ? e.title : "Untitled chat";
|
|
1479
1684
|
}
|
|
1480
|
-
function
|
|
1685
|
+
function ua(e) {
|
|
1481
1686
|
const t = e.currentPage;
|
|
1482
1687
|
if (typeof t?.url == "string" && t.url.trim())
|
|
1483
1688
|
try {
|
|
1484
|
-
const
|
|
1485
|
-
return `${
|
|
1689
|
+
const n = new URL(t.url);
|
|
1690
|
+
return `${n.pathname || "/"}${n.search}`;
|
|
1486
1691
|
} catch {
|
|
1487
1692
|
return t.url;
|
|
1488
1693
|
}
|
|
1489
1694
|
return typeof t?.origin == "string" && t.origin.trim() ? t.origin : "Current origin";
|
|
1490
1695
|
}
|
|
1491
|
-
function
|
|
1492
|
-
const
|
|
1493
|
-
if (!Number.isFinite(
|
|
1696
|
+
function ga(e, t) {
|
|
1697
|
+
const n = new Date(e).getTime();
|
|
1698
|
+
if (!Number.isFinite(n))
|
|
1494
1699
|
return "now";
|
|
1495
|
-
const
|
|
1700
|
+
const o = Math.max(0, t - n), i = [
|
|
1496
1701
|
["day", 864e5],
|
|
1497
1702
|
["hour", 36e5],
|
|
1498
1703
|
["min", 6e4]
|
|
1499
1704
|
];
|
|
1500
1705
|
for (const [r, l] of i)
|
|
1501
|
-
if (
|
|
1502
|
-
const p = Math.max(1, Math.floor(
|
|
1706
|
+
if (o >= l) {
|
|
1707
|
+
const p = Math.max(1, Math.floor(o / l));
|
|
1503
1708
|
return r === "min" ? `${p} min` : `${p} ${r}${p === 1 ? "" : "s"}`;
|
|
1504
1709
|
}
|
|
1505
1710
|
return "now";
|
|
1506
1711
|
}
|
|
1507
|
-
function
|
|
1508
|
-
e.appendChild(
|
|
1509
|
-
|
|
1712
|
+
function ha(e, t, n, o, i) {
|
|
1713
|
+
e.appendChild(Ca()), e.appendChild(
|
|
1714
|
+
ma(
|
|
1510
1715
|
t,
|
|
1511
|
-
o,
|
|
1512
1716
|
n,
|
|
1717
|
+
o,
|
|
1513
1718
|
i
|
|
1514
1719
|
)
|
|
1515
1720
|
), e.appendChild(
|
|
1516
|
-
|
|
1721
|
+
gt(
|
|
1517
1722
|
"pluno-pa-widget__close",
|
|
1518
1723
|
"Close",
|
|
1519
|
-
|
|
1724
|
+
Sa(16),
|
|
1520
1725
|
!0
|
|
1521
1726
|
)
|
|
1522
|
-
), e.appendChild(
|
|
1727
|
+
), e.appendChild(fa(n));
|
|
1523
1728
|
}
|
|
1524
|
-
function
|
|
1729
|
+
function ma(e, t, n, o) {
|
|
1525
1730
|
const i = document.createElement("form");
|
|
1526
|
-
if (i.className = "pluno-pa-widget__launcher",
|
|
1731
|
+
if (i.className = "pluno-pa-widget__launcher", o && i.classList.add("pluno-pa-widget__launcher--minimizable"), n) {
|
|
1527
1732
|
const d = document.createElement("button");
|
|
1528
1733
|
d.type = "button", d.className = "pluno-pa-widget__launcher-drag-handle", d.setAttribute("aria-label", "Move Pluno launcher"), d.title = "Move Pluno launcher", i.appendChild(d);
|
|
1529
1734
|
}
|
|
1530
1735
|
i.appendChild(
|
|
1531
|
-
|
|
1736
|
+
co(
|
|
1532
1737
|
"pluno-pa-widget__scribble-spirals--launcher",
|
|
1533
1738
|
10
|
|
1534
1739
|
)
|
|
1535
1740
|
), i.appendChild(
|
|
1536
|
-
|
|
1741
|
+
me(
|
|
1537
1742
|
"pluno-pa-widget__character--launcher",
|
|
1538
1743
|
t
|
|
1539
1744
|
)
|
|
@@ -1542,136 +1747,155 @@ function Yi(e, t, o, n) {
|
|
|
1542
1747
|
r.className = "pluno-pa-widget__launcher-run-indicator", i.appendChild(r);
|
|
1543
1748
|
const l = document.createElement("input");
|
|
1544
1749
|
l.className = "pluno-pa-widget__launcher-input", l.type = "text", l.placeholder = e, l.setAttribute("aria-label", e), i.appendChild(l);
|
|
1545
|
-
const p =
|
|
1546
|
-
if (p.classList.add("pluno-pa-widget__status--launcher"), i.appendChild(p),
|
|
1750
|
+
const p = ct("Working...");
|
|
1751
|
+
if (p.classList.add("pluno-pa-widget__status--launcher"), i.appendChild(p), o) {
|
|
1547
1752
|
const d = document.createElement("button");
|
|
1548
1753
|
d.type = "button", d.className = "pluno-pa-widget__launcher-minimize", d.textContent = "-", d.setAttribute("aria-label", "Minimize Pluno on this site"), d.title = "Minimize Pluno on this site", i.appendChild(d);
|
|
1549
1754
|
}
|
|
1550
1755
|
return i;
|
|
1551
1756
|
}
|
|
1552
|
-
function
|
|
1757
|
+
function fa(e) {
|
|
1553
1758
|
const t = document.createElement("section");
|
|
1554
1759
|
t.className = "pluno-pa-widget__panel", t.hidden = !0, t.appendChild(
|
|
1555
|
-
|
|
1760
|
+
co("pluno-pa-widget__scribble-spirals--panel", 16)
|
|
1556
1761
|
);
|
|
1557
|
-
const
|
|
1558
|
-
|
|
1559
|
-
const
|
|
1560
|
-
|
|
1762
|
+
const n = document.createElement("div");
|
|
1763
|
+
n.className = "pluno-pa-widget__timeline-wrap";
|
|
1764
|
+
const o = document.createElement("main");
|
|
1765
|
+
o.className = "pluno-pa-widget__timeline", o.appendChild(xa(e));
|
|
1561
1766
|
const i = document.createElement("div");
|
|
1562
|
-
i.className = "pluno-pa-widget__timeline-bottom-sentinel", i.setAttribute("aria-hidden", "true"),
|
|
1767
|
+
i.className = "pluno-pa-widget__timeline-bottom-sentinel", i.setAttribute("aria-hidden", "true"), o.appendChild(i), n.appendChild(o);
|
|
1563
1768
|
const r = document.createElement("div");
|
|
1564
|
-
r.className = "pluno-pa-widget__active-users-counter", r.hidden = !0,
|
|
1769
|
+
r.className = "pluno-pa-widget__active-users-counter", r.hidden = !0, n.appendChild(r);
|
|
1565
1770
|
const l = document.createElement("button");
|
|
1566
|
-
l.type = "button", l.className = "pluno-pa-widget__timeline-jump", l.textContent = "New messages ↓", l.hidden = !0,
|
|
1771
|
+
l.type = "button", l.className = "pluno-pa-widget__timeline-jump", l.textContent = "New messages ↓", l.hidden = !0, n.appendChild(l);
|
|
1567
1772
|
const p = document.createElement("div");
|
|
1568
1773
|
return p.className = "pluno-pa-widget__top-actions", p.appendChild(
|
|
1569
|
-
|
|
1774
|
+
gt(
|
|
1570
1775
|
"pluno-pa-widget__history",
|
|
1571
|
-
|
|
1572
|
-
|
|
1776
|
+
Kt(),
|
|
1777
|
+
ka(),
|
|
1573
1778
|
!0
|
|
1574
1779
|
)
|
|
1575
|
-
),
|
|
1780
|
+
), n.appendChild(p), n.appendChild(_a()), t.appendChild(n), t.appendChild(wa()), t.appendChild(ba()), t.appendChild(he("left", "Resize Pluno from left")), t.appendChild(
|
|
1781
|
+
he("right", "Resize Pluno from right")
|
|
1782
|
+
), t.appendChild(he("top", "Resize Pluno from top")), t.appendChild(
|
|
1783
|
+
he("bottom", "Resize Pluno from bottom")
|
|
1784
|
+
), t.appendChild(
|
|
1785
|
+
he("top-left", "Resize Pluno from top left")
|
|
1786
|
+
), t.appendChild(
|
|
1787
|
+
he("top-right", "Resize Pluno from top right")
|
|
1788
|
+
), t.appendChild(
|
|
1789
|
+
he("bottom-left", "Resize Pluno from bottom left")
|
|
1790
|
+
), t.appendChild(
|
|
1791
|
+
he("bottom-right", "Resize Pluno from bottom right")
|
|
1792
|
+
), t;
|
|
1576
1793
|
}
|
|
1577
|
-
function
|
|
1794
|
+
function he(e, t) {
|
|
1795
|
+
const n = document.createElement("button");
|
|
1796
|
+
return n.type = "button", n.className = [
|
|
1797
|
+
"pluno-pa-widget__resize-handle",
|
|
1798
|
+
`pluno-pa-widget__resize-handle--${e}`
|
|
1799
|
+
].join(" "), n.dataset.resizeDirection = e, n.setAttribute("aria-label", t), n.title = t, n;
|
|
1800
|
+
}
|
|
1801
|
+
function wa() {
|
|
1578
1802
|
const e = document.createElement("div");
|
|
1579
1803
|
e.className = "pluno-pa-widget__notify-suggestion", e.hidden = !0;
|
|
1580
1804
|
const t = document.createElement("span");
|
|
1581
1805
|
t.className = "pluno-pa-widget__notify-suggestion-label", t.textContent = "This may take a moment. Get notified when it's done?";
|
|
1582
|
-
const
|
|
1583
|
-
|
|
1584
|
-
const
|
|
1585
|
-
|
|
1806
|
+
const n = document.createElement("div");
|
|
1807
|
+
n.className = "pluno-pa-widget__notify-suggestion-actions";
|
|
1808
|
+
const o = document.createElement("button");
|
|
1809
|
+
o.type = "button", o.className = "pluno-pa-widget__notify-suggestion-enable", o.textContent = "Notify me";
|
|
1586
1810
|
const i = document.createElement("button");
|
|
1587
1811
|
i.type = "button", i.className = "pluno-pa-widget__notify-suggestion-later", i.textContent = "Later";
|
|
1588
1812
|
const r = document.createElement("button");
|
|
1589
|
-
return r.type = "button", r.className = "pluno-pa-widget__notify-suggestion-never", r.textContent = "Never",
|
|
1813
|
+
return r.type = "button", r.className = "pluno-pa-widget__notify-suggestion-never", r.textContent = "Never", n.append(o, i, r), e.append(t, n), e;
|
|
1590
1814
|
}
|
|
1591
|
-
function
|
|
1815
|
+
function ba() {
|
|
1592
1816
|
const e = document.createElement("form");
|
|
1593
1817
|
e.className = "pluno-pa-widget__composer";
|
|
1594
1818
|
const t = document.createElement("div");
|
|
1595
1819
|
t.className = "pluno-pa-widget__billing-status", t.hidden = !0, e.appendChild(t);
|
|
1596
|
-
const o = document.createElement("div");
|
|
1597
|
-
o.className = "pluno-pa-widget__attachment-error", o.hidden = !0, e.appendChild(o);
|
|
1598
1820
|
const n = document.createElement("div");
|
|
1599
|
-
n.className = "pluno-pa-
|
|
1821
|
+
n.className = "pluno-pa-widget__attachment-error", n.hidden = !0, e.appendChild(n);
|
|
1822
|
+
const o = document.createElement("div");
|
|
1823
|
+
o.className = "pluno-pa-widget__attachments", o.hidden = !0, e.appendChild(o);
|
|
1600
1824
|
const i = document.createElement("div");
|
|
1601
1825
|
i.className = "pluno-pa-widget__composer-inner";
|
|
1602
1826
|
const r = document.createElement("input");
|
|
1603
1827
|
r.className = "pluno-pa-widget__attachment-input", r.type = "file", r.multiple = !0, r.tabIndex = -1, r.setAttribute("aria-hidden", "true"), i.appendChild(r);
|
|
1604
1828
|
const l = document.createElement("button");
|
|
1605
|
-
l.type = "button", l.className = "pluno-pa-widget__attach", l.setAttribute("aria-label", "Attach files"), l.title = "Attach files", l.appendChild(
|
|
1829
|
+
l.type = "button", l.className = "pluno-pa-widget__attach", l.setAttribute("aria-label", "Attach files"), l.title = "Attach files", l.appendChild(Pa()), l.appendChild(Ia()), i.appendChild(l);
|
|
1606
1830
|
const p = document.createElement("textarea");
|
|
1607
1831
|
p.className = "pluno-pa-widget__input", p.rows = 1, p.placeholder = "Ask for anything...", i.appendChild(p);
|
|
1608
1832
|
const d = document.createElement("button");
|
|
1609
|
-
d.type = "button", d.className = "pluno-pa-widget__send", d.setAttribute("aria-label", "Send"), d.appendChild(
|
|
1610
|
-
const
|
|
1611
|
-
|
|
1612
|
-
const
|
|
1613
|
-
|
|
1614
|
-
const
|
|
1615
|
-
return
|
|
1833
|
+
d.type = "button", d.className = "pluno-pa-widget__send", d.setAttribute("aria-label", "Send"), d.appendChild(go()), i.appendChild(d), e.appendChild(i);
|
|
1834
|
+
const c = document.createElement("div");
|
|
1835
|
+
c.className = "pluno-pa-widget__composer-meta";
|
|
1836
|
+
const u = document.createElement("a");
|
|
1837
|
+
u.className = "pluno-pa-widget__powered-by", u.href = "https://pluno.ai", u.target = "_blank", u.rel = "noopener noreferrer", u.textContent = "Powered by Pluno.ai.", c.appendChild(u);
|
|
1838
|
+
const m = document.createElement("span");
|
|
1839
|
+
return m.className = "pluno-pa-widget__ai-disclaimer", m.textContent = "AI can make mistakes. Verify outputs.", c.appendChild(m), e.appendChild(c), e;
|
|
1616
1840
|
}
|
|
1617
|
-
function
|
|
1841
|
+
function Kt() {
|
|
1618
1842
|
return location.hostname ? `Recent chats on ${location.hostname}` : "Recent chats";
|
|
1619
1843
|
}
|
|
1620
|
-
function
|
|
1844
|
+
function _a() {
|
|
1621
1845
|
const e = document.createElement("section");
|
|
1622
|
-
e.className = "pluno-pa-widget__history-panel", e.hidden = !0, e.setAttribute("aria-label",
|
|
1846
|
+
e.className = "pluno-pa-widget__history-panel", e.hidden = !0, e.setAttribute("aria-label", Kt());
|
|
1623
1847
|
const t = document.createElement("div");
|
|
1624
1848
|
t.className = "pluno-pa-widget__history-header";
|
|
1625
|
-
const
|
|
1626
|
-
|
|
1627
|
-
const
|
|
1849
|
+
const n = document.createElement("strong");
|
|
1850
|
+
n.textContent = Kt();
|
|
1851
|
+
const o = gt(
|
|
1628
1852
|
"pluno-pa-widget__history-close",
|
|
1629
1853
|
"Close recent chats",
|
|
1630
|
-
|
|
1854
|
+
La(),
|
|
1631
1855
|
!1
|
|
1632
1856
|
);
|
|
1633
|
-
t.append(
|
|
1857
|
+
t.append(n, o);
|
|
1634
1858
|
const i = document.createElement("div");
|
|
1635
1859
|
i.className = "pluno-pa-widget__history-list";
|
|
1636
1860
|
const r = document.createElement("p");
|
|
1637
1861
|
return r.className = "pluno-pa-widget__history-status", r.hidden = !0, e.append(t, i, r), e;
|
|
1638
1862
|
}
|
|
1639
|
-
function
|
|
1863
|
+
function xa(e) {
|
|
1640
1864
|
const t = document.createElement("div");
|
|
1641
1865
|
return t.className = "pluno-pa-widget__empty-state", t.appendChild(
|
|
1642
|
-
|
|
1866
|
+
me(
|
|
1643
1867
|
"pluno-pa-widget__character--empty",
|
|
1644
1868
|
e
|
|
1645
1869
|
)
|
|
1646
|
-
), t.appendChild(
|
|
1870
|
+
), t.appendChild(lo()), t;
|
|
1647
1871
|
}
|
|
1648
|
-
function
|
|
1872
|
+
function lo() {
|
|
1649
1873
|
const e = document.createElement("div");
|
|
1650
1874
|
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;
|
|
1651
1875
|
}
|
|
1652
|
-
function
|
|
1876
|
+
function po(e, t) {
|
|
1653
1877
|
e.replaceChildren(), e.setAttribute(
|
|
1654
1878
|
"aria-label",
|
|
1655
1879
|
`${t.toLocaleString("en-US")} users currently active`
|
|
1656
1880
|
);
|
|
1657
|
-
const
|
|
1658
|
-
|
|
1881
|
+
const n = document.createElement("span");
|
|
1882
|
+
n.className = "pluno-pa-widget__active-users-counter-dot", n.setAttribute("aria-hidden", "true"), e.appendChild(n), e.appendChild(
|
|
1659
1883
|
document.createTextNode(
|
|
1660
1884
|
`${t.toLocaleString("en-US")} users currently active`
|
|
1661
1885
|
)
|
|
1662
1886
|
);
|
|
1663
1887
|
}
|
|
1664
|
-
function
|
|
1665
|
-
const
|
|
1666
|
-
|
|
1667
|
-
const
|
|
1668
|
-
return
|
|
1888
|
+
function me(e, t) {
|
|
1889
|
+
const n = `pluno-pa-character-${Ln}`;
|
|
1890
|
+
Ln += 1;
|
|
1891
|
+
const o = t.scribbleStyle ? va(t.accentColor, n) : ya(t.accentColor, n), i = e.split(/\s+/).filter(Boolean);
|
|
1892
|
+
return o.setAttribute(
|
|
1669
1893
|
"class",
|
|
1670
1894
|
i.includes("pluno-pa-widget__character") ? e : `pluno-pa-widget__character ${e}`
|
|
1671
|
-
),
|
|
1895
|
+
), o.setAttribute("aria-hidden", "true"), o.setAttribute("focusable", "false"), o.removeAttribute("role"), o.removeAttribute("aria-label"), o;
|
|
1672
1896
|
}
|
|
1673
|
-
function
|
|
1674
|
-
const
|
|
1897
|
+
function ya(e, t) {
|
|
1898
|
+
const n = Yo(e), o = {
|
|
1675
1899
|
boltFill: `${t}-boltFill`,
|
|
1676
1900
|
boltEdge: `${t}-boltEdge`,
|
|
1677
1901
|
boltGlow: `${t}-boltGlow`,
|
|
@@ -1682,171 +1906,171 @@ function ta(e, t) {
|
|
|
1682
1906
|
eyeShadow: `${t}-eyeShadow`,
|
|
1683
1907
|
pupilGloss: `${t}-pupilGloss`,
|
|
1684
1908
|
boltClip: `${t}-boltClip`
|
|
1685
|
-
}, i =
|
|
1686
|
-
id:
|
|
1909
|
+
}, i = so(), r = f(i, "defs"), l = f(r, "linearGradient", {
|
|
1910
|
+
id: o.boltFill,
|
|
1687
1911
|
x1: "420",
|
|
1688
1912
|
y1: "180",
|
|
1689
1913
|
x2: "790",
|
|
1690
1914
|
y2: "1040",
|
|
1691
1915
|
gradientUnits: "userSpaceOnUse"
|
|
1692
1916
|
});
|
|
1693
|
-
|
|
1694
|
-
const p =
|
|
1695
|
-
id:
|
|
1917
|
+
O(l, "0", n.top), O(l, "0.36", n.middle), O(l, "0.72", n.bottom), O(l, "1", n.bottom);
|
|
1918
|
+
const p = f(r, "linearGradient", {
|
|
1919
|
+
id: o.boltEdge,
|
|
1696
1920
|
x1: "470",
|
|
1697
1921
|
y1: "145",
|
|
1698
1922
|
x2: "900",
|
|
1699
1923
|
y2: "980",
|
|
1700
1924
|
gradientUnits: "userSpaceOnUse"
|
|
1701
1925
|
});
|
|
1702
|
-
|
|
1703
|
-
const d =
|
|
1704
|
-
id:
|
|
1926
|
+
O(p, "0", n.edgeStart), O(p, "0.32", n.edgeMiddle), O(p, "0.78", n.edgeEnd), O(p, "1", n.edgeEnd);
|
|
1927
|
+
const d = f(r, "radialGradient", {
|
|
1928
|
+
id: o.boltGlow,
|
|
1705
1929
|
cx: "50%",
|
|
1706
1930
|
cy: "22%",
|
|
1707
1931
|
r: "82%"
|
|
1708
1932
|
});
|
|
1709
|
-
|
|
1710
|
-
const
|
|
1711
|
-
id:
|
|
1933
|
+
O(d, "0", n.glow, "0.72"), O(d, "0.5", n.middle, "0.44"), O(d, "1", n.bottom, "0");
|
|
1934
|
+
const c = f(r, "radialGradient", {
|
|
1935
|
+
id: o.eyeWhite,
|
|
1712
1936
|
cx: "35%",
|
|
1713
1937
|
cy: "25%",
|
|
1714
1938
|
r: "70%"
|
|
1715
1939
|
});
|
|
1716
|
-
|
|
1717
|
-
const
|
|
1718
|
-
id:
|
|
1940
|
+
O(c, "0", "#ffffff"), O(c, "0.72", "#ffffff"), O(c, "1", "#e5e5e5");
|
|
1941
|
+
const u = f(r, "radialGradient", {
|
|
1942
|
+
id: o.pupil,
|
|
1719
1943
|
cx: "42%",
|
|
1720
1944
|
cy: "38%",
|
|
1721
1945
|
r: "65%"
|
|
1722
1946
|
});
|
|
1723
|
-
|
|
1724
|
-
const
|
|
1725
|
-
id:
|
|
1947
|
+
O(u, "0", "#2a1f10"), O(u, "0.52", "#080604"), O(u, "1", "#000000");
|
|
1948
|
+
const m = f(r, "filter", {
|
|
1949
|
+
id: o.softDropShadow,
|
|
1726
1950
|
x: "-18%",
|
|
1727
1951
|
y: "-12%",
|
|
1728
1952
|
width: "136%",
|
|
1729
1953
|
height: "136%",
|
|
1730
1954
|
"color-interpolation-filters": "sRGB"
|
|
1731
1955
|
});
|
|
1732
|
-
m
|
|
1956
|
+
f(m, "feDropShadow", {
|
|
1733
1957
|
dx: "0",
|
|
1734
1958
|
dy: "12",
|
|
1735
1959
|
stdDeviation: "18",
|
|
1736
|
-
"flood-color":
|
|
1960
|
+
"flood-color": n.shadow,
|
|
1737
1961
|
"flood-opacity": "0.24"
|
|
1738
1962
|
});
|
|
1739
|
-
const
|
|
1740
|
-
id:
|
|
1963
|
+
const k = f(r, "filter", {
|
|
1964
|
+
id: o.innerDepth,
|
|
1741
1965
|
x: "-8%",
|
|
1742
1966
|
y: "-8%",
|
|
1743
1967
|
width: "116%",
|
|
1744
1968
|
height: "116%",
|
|
1745
1969
|
"color-interpolation-filters": "sRGB"
|
|
1746
1970
|
});
|
|
1747
|
-
|
|
1971
|
+
f(k, "feGaussianBlur", {
|
|
1748
1972
|
in: "SourceAlpha",
|
|
1749
1973
|
stdDeviation: "8",
|
|
1750
1974
|
result: "blur"
|
|
1751
|
-
}),
|
|
1975
|
+
}), f(k, "feOffset", {
|
|
1752
1976
|
dx: "-7",
|
|
1753
1977
|
dy: "-9",
|
|
1754
1978
|
result: "topLeft"
|
|
1755
|
-
}),
|
|
1979
|
+
}), f(k, "feComposite", {
|
|
1756
1980
|
in: "topLeft",
|
|
1757
1981
|
in2: "SourceAlpha",
|
|
1758
1982
|
operator: "arithmetic",
|
|
1759
1983
|
k2: "-1",
|
|
1760
1984
|
k3: "1",
|
|
1761
1985
|
result: "innerShadow"
|
|
1762
|
-
}),
|
|
1986
|
+
}), f(k, "feColorMatrix", {
|
|
1763
1987
|
in: "innerShadow",
|
|
1764
1988
|
type: "matrix",
|
|
1765
1989
|
values: "1 0 0 0 1 0 1 0 0 1 0 0 1 0 1 0 0 0 0.42 0",
|
|
1766
1990
|
result: "innerLight"
|
|
1767
|
-
}),
|
|
1991
|
+
}), f(k, "feBlend", {
|
|
1768
1992
|
in: "SourceGraphic",
|
|
1769
1993
|
in2: "innerLight",
|
|
1770
1994
|
mode: "screen"
|
|
1771
1995
|
});
|
|
1772
|
-
const
|
|
1773
|
-
id:
|
|
1996
|
+
const v = f(r, "filter", {
|
|
1997
|
+
id: o.eyeShadow,
|
|
1774
1998
|
x: "-24%",
|
|
1775
1999
|
y: "-20%",
|
|
1776
2000
|
width: "148%",
|
|
1777
2001
|
height: "148%",
|
|
1778
2002
|
"color-interpolation-filters": "sRGB"
|
|
1779
2003
|
});
|
|
1780
|
-
|
|
2004
|
+
f(v, "feDropShadow", {
|
|
1781
2005
|
dx: "0",
|
|
1782
2006
|
dy: "8",
|
|
1783
2007
|
stdDeviation: "5",
|
|
1784
|
-
"flood-color":
|
|
2008
|
+
"flood-color": n.shadow,
|
|
1785
2009
|
"flood-opacity": "0.3"
|
|
1786
2010
|
});
|
|
1787
|
-
const
|
|
1788
|
-
id:
|
|
2011
|
+
const z = f(r, "filter", {
|
|
2012
|
+
id: o.pupilGloss,
|
|
1789
2013
|
x: "-15%",
|
|
1790
2014
|
y: "-15%",
|
|
1791
2015
|
width: "130%",
|
|
1792
2016
|
height: "130%",
|
|
1793
2017
|
"color-interpolation-filters": "sRGB"
|
|
1794
2018
|
});
|
|
1795
|
-
|
|
2019
|
+
f(z, "feDropShadow", {
|
|
1796
2020
|
dx: "0",
|
|
1797
2021
|
dy: "3",
|
|
1798
2022
|
stdDeviation: "3",
|
|
1799
2023
|
"flood-color": "#000000",
|
|
1800
2024
|
"flood-opacity": "0.22"
|
|
1801
2025
|
});
|
|
1802
|
-
const
|
|
1803
|
-
|
|
1804
|
-
const
|
|
1805
|
-
filter:
|
|
2026
|
+
const _ = f(r, "clipPath", { id: o.boltClip });
|
|
2027
|
+
f(_, "path", { d: pt });
|
|
2028
|
+
const g = f(i, "g", {
|
|
2029
|
+
filter: V(o.softDropShadow)
|
|
1806
2030
|
});
|
|
1807
|
-
|
|
1808
|
-
d:
|
|
1809
|
-
fill:
|
|
2031
|
+
f(g, "path", {
|
|
2032
|
+
d: pt,
|
|
2033
|
+
fill: V(o.boltEdge)
|
|
1810
2034
|
});
|
|
1811
|
-
const
|
|
1812
|
-
|
|
1813
|
-
d:
|
|
1814
|
-
fill:
|
|
1815
|
-
filter:
|
|
1816
|
-
}),
|
|
1817
|
-
d:
|
|
1818
|
-
fill:
|
|
2035
|
+
const b = "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";
|
|
2036
|
+
f(g, "path", {
|
|
2037
|
+
d: b,
|
|
2038
|
+
fill: V(o.boltFill),
|
|
2039
|
+
filter: V(o.innerDepth)
|
|
2040
|
+
}), f(g, "path", {
|
|
2041
|
+
d: b,
|
|
2042
|
+
fill: V(o.boltGlow),
|
|
1819
2043
|
opacity: "0.74"
|
|
1820
2044
|
});
|
|
1821
|
-
const h =
|
|
1822
|
-
"clip-path":
|
|
2045
|
+
const h = f(g, "g", {
|
|
2046
|
+
"clip-path": V(o.boltClip),
|
|
1823
2047
|
opacity: "0.42"
|
|
1824
2048
|
});
|
|
1825
|
-
|
|
2049
|
+
f(h, "path", {
|
|
1826
2050
|
d: "M523 181 C505 189 496 206 489 232 L400 594 C397 606 400 619 411 626",
|
|
1827
2051
|
fill: "none",
|
|
1828
|
-
stroke:
|
|
2052
|
+
stroke: n.highlight,
|
|
1829
2053
|
"stroke-width": "22",
|
|
1830
2054
|
"stroke-linecap": "round",
|
|
1831
2055
|
opacity: "0.65"
|
|
1832
|
-
}),
|
|
2056
|
+
}), f(h, "path", {
|
|
1833
2057
|
d: "M556 685 L501 994",
|
|
1834
2058
|
fill: "none",
|
|
1835
|
-
stroke:
|
|
2059
|
+
stroke: n.highlight,
|
|
1836
2060
|
"stroke-width": "20",
|
|
1837
2061
|
"stroke-linecap": "round",
|
|
1838
2062
|
opacity: "0.55"
|
|
1839
|
-
}),
|
|
2063
|
+
}), f(h, "path", {
|
|
1840
2064
|
d: "M858 160 C882 166 893 181 883 204",
|
|
1841
2065
|
fill: "none",
|
|
1842
|
-
stroke:
|
|
2066
|
+
stroke: n.inner,
|
|
1843
2067
|
"stroke-width": "18",
|
|
1844
2068
|
"stroke-linecap": "round",
|
|
1845
2069
|
opacity: "0.48"
|
|
1846
2070
|
});
|
|
1847
|
-
const
|
|
1848
|
-
return
|
|
1849
|
-
|
|
2071
|
+
const P = f(i, "g", { filter: V(o.eyeShadow) });
|
|
2072
|
+
return Rn(
|
|
2073
|
+
P,
|
|
1850
2074
|
"rotate(-2 528 463)",
|
|
1851
2075
|
"528",
|
|
1852
2076
|
"463",
|
|
@@ -1854,9 +2078,9 @@ function ta(e, t) {
|
|
|
1854
2078
|
"473",
|
|
1855
2079
|
"557",
|
|
1856
2080
|
"447",
|
|
1857
|
-
|
|
1858
|
-
),
|
|
1859
|
-
|
|
2081
|
+
o
|
|
2082
|
+
), Rn(
|
|
2083
|
+
P,
|
|
1860
2084
|
"rotate(2 717 462)",
|
|
1861
2085
|
"717",
|
|
1862
2086
|
"462",
|
|
@@ -1864,55 +2088,55 @@ function ta(e, t) {
|
|
|
1864
2088
|
"473",
|
|
1865
2089
|
"728",
|
|
1866
2090
|
"447",
|
|
1867
|
-
|
|
2091
|
+
o
|
|
1868
2092
|
), i;
|
|
1869
2093
|
}
|
|
1870
|
-
function
|
|
1871
|
-
const
|
|
2094
|
+
function va(e, t) {
|
|
2095
|
+
const n = Kn(e), o = {
|
|
1872
2096
|
clip: `${t}-scribbleBoltClip`,
|
|
1873
2097
|
wobble: `${t}-scribbleBoltWobble`
|
|
1874
|
-
}, i =
|
|
1875
|
-
|
|
1876
|
-
const p =
|
|
1877
|
-
id:
|
|
2098
|
+
}, i = so(), r = f(i, "defs"), l = f(r, "clipPath", { id: o.clip });
|
|
2099
|
+
f(l, "path", { d: pt });
|
|
2100
|
+
const p = f(r, "filter", {
|
|
2101
|
+
id: o.wobble,
|
|
1878
2102
|
x: "-10%",
|
|
1879
2103
|
y: "-10%",
|
|
1880
2104
|
width: "120%",
|
|
1881
2105
|
height: "120%",
|
|
1882
2106
|
"color-interpolation-filters": "sRGB"
|
|
1883
2107
|
});
|
|
1884
|
-
|
|
2108
|
+
f(p, "feTurbulence", {
|
|
1885
2109
|
type: "fractalNoise",
|
|
1886
2110
|
baseFrequency: "0.011",
|
|
1887
2111
|
numOctaves: "3",
|
|
1888
2112
|
seed: "7",
|
|
1889
2113
|
result: "noise"
|
|
1890
|
-
}),
|
|
2114
|
+
}), f(p, "feDisplacementMap", {
|
|
1891
2115
|
in: "SourceGraphic",
|
|
1892
2116
|
in2: "noise",
|
|
1893
2117
|
scale: "16",
|
|
1894
2118
|
xChannelSelector: "R",
|
|
1895
2119
|
yChannelSelector: "G"
|
|
1896
2120
|
});
|
|
1897
|
-
const d =
|
|
1898
|
-
"clip-path":
|
|
2121
|
+
const d = f(i, "g", { filter: V(o.wobble) }), c = f(d, "g", {
|
|
2122
|
+
"clip-path": V(o.clip)
|
|
1899
2123
|
});
|
|
1900
|
-
return
|
|
1901
|
-
d:
|
|
2124
|
+
return f(c, "path", {
|
|
2125
|
+
d: Ko(),
|
|
1902
2126
|
fill: "none",
|
|
1903
|
-
stroke:
|
|
2127
|
+
stroke: n,
|
|
1904
2128
|
"stroke-width": "56",
|
|
1905
2129
|
"stroke-linecap": "round",
|
|
1906
2130
|
"stroke-linejoin": "round",
|
|
1907
2131
|
opacity: "0.9",
|
|
1908
2132
|
transform: "rotate(-14 627 600)"
|
|
1909
|
-
}),
|
|
1910
|
-
d:
|
|
2133
|
+
}), f(d, "path", {
|
|
2134
|
+
d: pt,
|
|
1911
2135
|
fill: "none",
|
|
1912
|
-
stroke:
|
|
2136
|
+
stroke: st,
|
|
1913
2137
|
"stroke-width": "18",
|
|
1914
2138
|
"stroke-linejoin": "round"
|
|
1915
|
-
}),
|
|
2139
|
+
}), zn(
|
|
1916
2140
|
d,
|
|
1917
2141
|
"rotate(-2 528 463)",
|
|
1918
2142
|
"528",
|
|
@@ -1921,7 +2145,7 @@ function na(e, t) {
|
|
|
1921
2145
|
"473",
|
|
1922
2146
|
"557",
|
|
1923
2147
|
"447"
|
|
1924
|
-
),
|
|
2148
|
+
), zn(
|
|
1925
2149
|
d,
|
|
1926
2150
|
"rotate(2 717 462)",
|
|
1927
2151
|
"717",
|
|
@@ -1932,139 +2156,161 @@ function na(e, t) {
|
|
|
1932
2156
|
"447"
|
|
1933
2157
|
), i;
|
|
1934
2158
|
}
|
|
1935
|
-
function
|
|
1936
|
-
return
|
|
1937
|
-
xmlns:
|
|
2159
|
+
function so() {
|
|
2160
|
+
return E("svg", {
|
|
2161
|
+
xmlns: to,
|
|
1938
2162
|
viewBox: "0 0 1254 1254"
|
|
1939
2163
|
});
|
|
1940
2164
|
}
|
|
1941
|
-
function
|
|
1942
|
-
const
|
|
1943
|
-
|
|
1944
|
-
cx:
|
|
1945
|
-
cy:
|
|
2165
|
+
function Rn(e, t, n, o, i, r, l, p, d) {
|
|
2166
|
+
const c = f(e, "g", { transform: t });
|
|
2167
|
+
f(c, "ellipse", {
|
|
2168
|
+
cx: n,
|
|
2169
|
+
cy: o,
|
|
1946
2170
|
rx: "73",
|
|
1947
2171
|
ry: "80",
|
|
1948
|
-
fill:
|
|
1949
|
-
}),
|
|
2172
|
+
fill: V(d.eyeWhite)
|
|
2173
|
+
}), f(c, "ellipse", {
|
|
1950
2174
|
cx: i,
|
|
1951
2175
|
cy: r,
|
|
1952
2176
|
rx: "49",
|
|
1953
2177
|
ry: "57",
|
|
1954
|
-
fill:
|
|
1955
|
-
filter:
|
|
1956
|
-
}),
|
|
2178
|
+
fill: V(d.pupil),
|
|
2179
|
+
filter: V(d.pupilGloss)
|
|
2180
|
+
}), f(c, "circle", {
|
|
1957
2181
|
cx: l,
|
|
1958
2182
|
cy: p,
|
|
1959
2183
|
r: "18",
|
|
1960
2184
|
fill: "#ffffff"
|
|
1961
2185
|
});
|
|
1962
2186
|
}
|
|
1963
|
-
function
|
|
1964
|
-
const d =
|
|
1965
|
-
|
|
1966
|
-
cx:
|
|
1967
|
-
cy:
|
|
2187
|
+
function zn(e, t, n, o, i, r, l, p) {
|
|
2188
|
+
const d = f(e, "g", { transform: t });
|
|
2189
|
+
f(d, "ellipse", {
|
|
2190
|
+
cx: n,
|
|
2191
|
+
cy: o,
|
|
1968
2192
|
rx: "73",
|
|
1969
2193
|
ry: "80",
|
|
1970
2194
|
fill: "#ffffff",
|
|
1971
|
-
stroke:
|
|
2195
|
+
stroke: st,
|
|
1972
2196
|
"stroke-width": "13"
|
|
1973
|
-
}),
|
|
2197
|
+
}), f(d, "ellipse", {
|
|
1974
2198
|
cx: i,
|
|
1975
2199
|
cy: r,
|
|
1976
2200
|
rx: "45",
|
|
1977
2201
|
ry: "53",
|
|
1978
|
-
fill:
|
|
1979
|
-
}),
|
|
2202
|
+
fill: st
|
|
2203
|
+
}), f(d, "circle", {
|
|
1980
2204
|
cx: l,
|
|
1981
2205
|
cy: p,
|
|
1982
2206
|
r: "16",
|
|
1983
2207
|
fill: "#ffffff"
|
|
1984
2208
|
});
|
|
1985
2209
|
}
|
|
1986
|
-
function
|
|
1987
|
-
const
|
|
1988
|
-
return e.appendChild(
|
|
2210
|
+
function f(e, t, n = {}) {
|
|
2211
|
+
const o = E(t, n);
|
|
2212
|
+
return e.appendChild(o), o;
|
|
1989
2213
|
}
|
|
1990
|
-
function
|
|
1991
|
-
const i = { offset: t, "stop-color":
|
|
1992
|
-
|
|
2214
|
+
function O(e, t, n, o) {
|
|
2215
|
+
const i = { offset: t, "stop-color": n };
|
|
2216
|
+
o !== void 0 && (i["stop-opacity"] = o), f(e, "stop", i);
|
|
1993
2217
|
}
|
|
1994
|
-
function
|
|
2218
|
+
function V(e) {
|
|
1995
2219
|
return `url(#${e})`;
|
|
1996
2220
|
}
|
|
1997
|
-
function
|
|
2221
|
+
function gt(e, t, n, o) {
|
|
1998
2222
|
const i = document.createElement("button");
|
|
1999
|
-
return i.type = "button", i.className = e, i.setAttribute("aria-label", t), i.title = t, i.hidden =
|
|
2223
|
+
return i.type = "button", i.className = e, i.setAttribute("aria-label", t), i.title = t, i.hidden = o, i.appendChild(n), i;
|
|
2000
2224
|
}
|
|
2001
|
-
function
|
|
2002
|
-
const e =
|
|
2225
|
+
function Ca() {
|
|
2226
|
+
const e = E("svg", {
|
|
2003
2227
|
class: "pluno-pa-widget__scribble-defs",
|
|
2004
2228
|
"aria-hidden": "true",
|
|
2005
2229
|
focusable: "false",
|
|
2006
2230
|
width: "0",
|
|
2007
2231
|
height: "0"
|
|
2008
|
-
}), t =
|
|
2009
|
-
return t.appendChild(
|
|
2010
|
-
|
|
2232
|
+
}), t = E("defs");
|
|
2233
|
+
return t.appendChild(Ot("pluno-pa-scribble-wobble", "2", "12")), t.appendChild(
|
|
2234
|
+
Ot("pluno-pa-scribble-wobble-2", "5", "15")
|
|
2011
2235
|
), t.appendChild(
|
|
2012
|
-
|
|
2236
|
+
Ot("pluno-pa-scribble-wobble-3", "9", "19")
|
|
2013
2237
|
), e.appendChild(t), e;
|
|
2014
2238
|
}
|
|
2015
|
-
function
|
|
2016
|
-
const
|
|
2239
|
+
function co(e, t) {
|
|
2240
|
+
const n = E("svg", {
|
|
2017
2241
|
class: `pluno-pa-widget__scribble-spirals ${e}`,
|
|
2018
|
-
viewBox: `0 0 ${o} ${_i}`,
|
|
2019
2242
|
preserveAspectRatio: "xMidYMid meet",
|
|
2020
2243
|
"aria-hidden": "true",
|
|
2021
2244
|
focusable: "false"
|
|
2022
2245
|
});
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2246
|
+
return uo(n, t), n;
|
|
2247
|
+
}
|
|
2248
|
+
function Mt(e, t) {
|
|
2249
|
+
if (!e)
|
|
2250
|
+
return;
|
|
2251
|
+
const n = Math.max(
|
|
2252
|
+
0,
|
|
2253
|
+
t - qt * 2
|
|
2254
|
+
), o = Math.max(
|
|
2255
|
+
Fi,
|
|
2256
|
+
Math.floor(
|
|
2257
|
+
(n - $t * 2) / Gt
|
|
2258
|
+
)
|
|
2259
|
+
);
|
|
2260
|
+
uo(e, o);
|
|
2261
|
+
}
|
|
2262
|
+
function uo(e, t) {
|
|
2263
|
+
if (e.dataset.spiralCount === `${t}`)
|
|
2264
|
+
return;
|
|
2265
|
+
const n = t * Gt + $t * 2;
|
|
2266
|
+
e.dataset.spiralCount = `${t}`, e.setAttribute(
|
|
2267
|
+
"viewBox",
|
|
2268
|
+
`0 0 ${n} ${Ui}`
|
|
2269
|
+
), e.replaceChildren();
|
|
2270
|
+
for (let o = 0; o < t; o += 1) {
|
|
2271
|
+
const i = kn[o % kn.length], r = E("g", {
|
|
2272
|
+
transform: `translate(${$t + o * Gt} 0)`
|
|
2026
2273
|
});
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
cx:
|
|
2030
|
-
cy:
|
|
2031
|
-
rx:
|
|
2032
|
-
ry:
|
|
2274
|
+
r.appendChild(
|
|
2275
|
+
E("ellipse", {
|
|
2276
|
+
cx: i.ellipseCx,
|
|
2277
|
+
cy: i.ellipseCy,
|
|
2278
|
+
rx: i.ellipseRx,
|
|
2279
|
+
ry: i.ellipseRy,
|
|
2033
2280
|
fill: "none",
|
|
2034
2281
|
stroke: "#2c2a1e",
|
|
2035
|
-
"stroke-width":
|
|
2282
|
+
"stroke-width": i.strokeWidth,
|
|
2036
2283
|
opacity: "0.8"
|
|
2037
2284
|
})
|
|
2038
|
-
),
|
|
2039
|
-
|
|
2040
|
-
d:
|
|
2285
|
+
), r.appendChild(
|
|
2286
|
+
E("path", {
|
|
2287
|
+
d: i.path,
|
|
2041
2288
|
fill: "none",
|
|
2042
2289
|
stroke: "#2c2a1e",
|
|
2043
|
-
"stroke-width":
|
|
2290
|
+
"stroke-width": i.pathStrokeWidth,
|
|
2044
2291
|
"stroke-linecap": "round"
|
|
2045
2292
|
})
|
|
2046
|
-
),
|
|
2293
|
+
), e.appendChild(r);
|
|
2047
2294
|
}
|
|
2048
|
-
return n;
|
|
2049
2295
|
}
|
|
2050
|
-
function
|
|
2051
|
-
const
|
|
2296
|
+
function Ot(e, t, n) {
|
|
2297
|
+
const o = E("filter", {
|
|
2052
2298
|
id: e,
|
|
2053
2299
|
x: "-8%",
|
|
2054
2300
|
y: "-8%",
|
|
2055
2301
|
width: "116%",
|
|
2056
2302
|
height: "116%"
|
|
2057
2303
|
});
|
|
2058
|
-
return
|
|
2059
|
-
|
|
2304
|
+
return o.appendChild(
|
|
2305
|
+
E("feTurbulence", {
|
|
2060
2306
|
type: "fractalNoise",
|
|
2061
2307
|
baseFrequency: "0.012 0.028",
|
|
2062
2308
|
numOctaves: "3",
|
|
2063
2309
|
seed: t,
|
|
2064
2310
|
result: "stroke-noise"
|
|
2065
2311
|
})
|
|
2066
|
-
),
|
|
2067
|
-
|
|
2312
|
+
), o.appendChild(
|
|
2313
|
+
E("feDisplacementMap", {
|
|
2068
2314
|
in: "SourceGraphic",
|
|
2069
2315
|
in2: "stroke-noise",
|
|
2070
2316
|
scale: "3.5",
|
|
@@ -2072,26 +2318,26 @@ function kt(e, t, o) {
|
|
|
2072
2318
|
yChannelSelector: "G",
|
|
2073
2319
|
result: "warped"
|
|
2074
2320
|
})
|
|
2075
|
-
),
|
|
2076
|
-
|
|
2321
|
+
), o.appendChild(
|
|
2322
|
+
E("feTurbulence", {
|
|
2077
2323
|
type: "fractalNoise",
|
|
2078
2324
|
baseFrequency: "0.7",
|
|
2079
2325
|
numOctaves: "1",
|
|
2080
|
-
seed:
|
|
2326
|
+
seed: n,
|
|
2081
2327
|
result: "ink-noise"
|
|
2082
2328
|
})
|
|
2083
|
-
),
|
|
2084
|
-
|
|
2329
|
+
), o.appendChild(
|
|
2330
|
+
E("feDisplacementMap", {
|
|
2085
2331
|
in: "warped",
|
|
2086
2332
|
in2: "ink-noise",
|
|
2087
2333
|
scale: "0.9",
|
|
2088
2334
|
xChannelSelector: "R",
|
|
2089
2335
|
yChannelSelector: "G"
|
|
2090
2336
|
})
|
|
2091
|
-
),
|
|
2337
|
+
), o;
|
|
2092
2338
|
}
|
|
2093
|
-
function
|
|
2094
|
-
const t =
|
|
2339
|
+
function Sa(e) {
|
|
2340
|
+
const t = re(
|
|
2095
2341
|
"0 0 24 24",
|
|
2096
2342
|
e,
|
|
2097
2343
|
e,
|
|
@@ -2099,10 +2345,10 @@ function ia(e) {
|
|
|
2099
2345
|
"currentColor",
|
|
2100
2346
|
"2.25"
|
|
2101
2347
|
);
|
|
2102
|
-
return t.appendChild(
|
|
2348
|
+
return t.appendChild(E("path", { d: "m6 9 6 6 6-6" })), t;
|
|
2103
2349
|
}
|
|
2104
|
-
function
|
|
2105
|
-
const e =
|
|
2350
|
+
function Ea() {
|
|
2351
|
+
const e = re(
|
|
2106
2352
|
"0 0 24 24",
|
|
2107
2353
|
17,
|
|
2108
2354
|
17,
|
|
@@ -2111,17 +2357,17 @@ function aa() {
|
|
|
2111
2357
|
"2.25"
|
|
2112
2358
|
);
|
|
2113
2359
|
return e.appendChild(
|
|
2114
|
-
|
|
2360
|
+
E("path", {
|
|
2115
2361
|
d: "M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"
|
|
2116
2362
|
})
|
|
2117
2363
|
), e.appendChild(
|
|
2118
|
-
|
|
2364
|
+
E("path", {
|
|
2119
2365
|
d: "M18.4 2.6a2.1 2.1 0 0 1 3 3L12 15l-4 1 1-4Z"
|
|
2120
2366
|
})
|
|
2121
2367
|
), e;
|
|
2122
2368
|
}
|
|
2123
|
-
function
|
|
2124
|
-
const e =
|
|
2369
|
+
function ka() {
|
|
2370
|
+
const e = re(
|
|
2125
2371
|
"0 0 24 24",
|
|
2126
2372
|
17,
|
|
2127
2373
|
17,
|
|
@@ -2129,10 +2375,10 @@ function ra() {
|
|
|
2129
2375
|
"currentColor",
|
|
2130
2376
|
"2.25"
|
|
2131
2377
|
);
|
|
2132
|
-
return e.appendChild(
|
|
2378
|
+
return e.appendChild(E("path", { d: "M3 12a9 9 0 1 0 3-6.7" })), e.appendChild(E("path", { d: "M3 4v5h5" })), e.appendChild(E("path", { d: "M12 7v5l3 2" })), e;
|
|
2133
2379
|
}
|
|
2134
|
-
function
|
|
2135
|
-
const e =
|
|
2380
|
+
function La() {
|
|
2381
|
+
const e = re(
|
|
2136
2382
|
"0 0 24 24",
|
|
2137
2383
|
15,
|
|
2138
2384
|
15,
|
|
@@ -2140,10 +2386,10 @@ function la() {
|
|
|
2140
2386
|
"currentColor",
|
|
2141
2387
|
"2.4"
|
|
2142
2388
|
);
|
|
2143
|
-
return e.appendChild(
|
|
2389
|
+
return e.appendChild(E("path", { d: "M18 6 6 18" })), e.appendChild(E("path", { d: "m6 6 12 12" })), e;
|
|
2144
2390
|
}
|
|
2145
|
-
function
|
|
2146
|
-
const e =
|
|
2391
|
+
function go() {
|
|
2392
|
+
const e = re(
|
|
2147
2393
|
"0 0 24 24",
|
|
2148
2394
|
14,
|
|
2149
2395
|
14,
|
|
@@ -2152,11 +2398,11 @@ function Xn() {
|
|
|
2152
2398
|
"2.75"
|
|
2153
2399
|
);
|
|
2154
2400
|
return e.appendChild(
|
|
2155
|
-
|
|
2156
|
-
), e.appendChild(
|
|
2401
|
+
E("line", { x1: "12", y1: "19", x2: "12", y2: "5" })
|
|
2402
|
+
), e.appendChild(E("polyline", { points: "5 12 12 5 19 12" })), e;
|
|
2157
2403
|
}
|
|
2158
|
-
function
|
|
2159
|
-
const e =
|
|
2404
|
+
function Pa() {
|
|
2405
|
+
const e = re(
|
|
2160
2406
|
"0 0 24 24",
|
|
2161
2407
|
16,
|
|
2162
2408
|
16,
|
|
@@ -2168,18 +2414,18 @@ function pa() {
|
|
|
2168
2414
|
"class",
|
|
2169
2415
|
"pluno-pa-widget__paperclip-icon pluno-pa-widget__paperclip-icon--standard"
|
|
2170
2416
|
), e.appendChild(
|
|
2171
|
-
|
|
2417
|
+
E("path", {
|
|
2172
2418
|
d: "m21.4 11.6-8.5 8.5a6 6 0 0 1-8.5-8.5l9.2-9.2a4 4 0 0 1 5.7 5.7l-9.2 9.2a2 2 0 0 1-2.8-2.8l8.5-8.5"
|
|
2173
2419
|
})
|
|
2174
2420
|
), e;
|
|
2175
2421
|
}
|
|
2176
|
-
function
|
|
2177
|
-
const e =
|
|
2422
|
+
function Ia() {
|
|
2423
|
+
const e = re("0 0 24 24", 19, 19, "none", "currentColor");
|
|
2178
2424
|
return e.setAttribute(
|
|
2179
2425
|
"class",
|
|
2180
2426
|
"pluno-pa-widget__paperclip-icon pluno-pa-widget__paperclip-icon--scribble"
|
|
2181
2427
|
), e.appendChild(
|
|
2182
|
-
|
|
2428
|
+
E("path", {
|
|
2183
2429
|
d: "M7.1 15.6 15.2 7.7c1.9-1.8 4.9.8 2.7 3.2l-8.8 8.3c-3.2 3-8-1.1-4.6-4.8l10.1-9.1",
|
|
2184
2430
|
stroke: "currentColor",
|
|
2185
2431
|
"stroke-width": "2",
|
|
@@ -2188,10 +2434,10 @@ function sa() {
|
|
|
2188
2434
|
})
|
|
2189
2435
|
), e;
|
|
2190
2436
|
}
|
|
2191
|
-
function
|
|
2192
|
-
const e =
|
|
2437
|
+
function Aa() {
|
|
2438
|
+
const e = re("0 0 24 24", 18, 18, "currentColor");
|
|
2193
2439
|
return e.appendChild(
|
|
2194
|
-
|
|
2440
|
+
E("rect", {
|
|
2195
2441
|
x: "6",
|
|
2196
2442
|
y: "6",
|
|
2197
2443
|
width: "12",
|
|
@@ -2200,8 +2446,8 @@ function da() {
|
|
|
2200
2446
|
})
|
|
2201
2447
|
), e;
|
|
2202
2448
|
}
|
|
2203
|
-
function
|
|
2204
|
-
const e =
|
|
2449
|
+
function Na() {
|
|
2450
|
+
const e = re(
|
|
2205
2451
|
"0 0 24 24",
|
|
2206
2452
|
12,
|
|
2207
2453
|
12,
|
|
@@ -2209,10 +2455,10 @@ function ca() {
|
|
|
2209
2455
|
"currentColor",
|
|
2210
2456
|
"2.4"
|
|
2211
2457
|
);
|
|
2212
|
-
return e.appendChild(
|
|
2458
|
+
return e.appendChild(E("path", { d: "M18 6 6 18" })), e.appendChild(E("path", { d: "m6 6 12 12" })), e;
|
|
2213
2459
|
}
|
|
2214
|
-
function
|
|
2215
|
-
const e =
|
|
2460
|
+
function Ta() {
|
|
2461
|
+
const e = re(
|
|
2216
2462
|
"0 0 24 24",
|
|
2217
2463
|
13,
|
|
2218
2464
|
13,
|
|
@@ -2221,7 +2467,7 @@ function ua() {
|
|
|
2221
2467
|
"2.25"
|
|
2222
2468
|
);
|
|
2223
2469
|
return e.appendChild(
|
|
2224
|
-
|
|
2470
|
+
E("rect", {
|
|
2225
2471
|
width: "14",
|
|
2226
2472
|
height: "14",
|
|
2227
2473
|
x: "8",
|
|
@@ -2230,341 +2476,341 @@ function ua() {
|
|
|
2230
2476
|
ry: "2"
|
|
2231
2477
|
})
|
|
2232
2478
|
), e.appendChild(
|
|
2233
|
-
|
|
2479
|
+
E("path", {
|
|
2234
2480
|
d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"
|
|
2235
2481
|
})
|
|
2236
2482
|
), e;
|
|
2237
2483
|
}
|
|
2238
|
-
function
|
|
2484
|
+
function re(e, t, n, o, i, r) {
|
|
2239
2485
|
const l = {
|
|
2240
2486
|
viewBox: e,
|
|
2241
2487
|
width: String(t),
|
|
2242
|
-
height: String(
|
|
2243
|
-
fill:
|
|
2488
|
+
height: String(n),
|
|
2489
|
+
fill: o,
|
|
2244
2490
|
"aria-hidden": "true"
|
|
2245
2491
|
};
|
|
2246
|
-
return i && (l.stroke = i, l["stroke-linecap"] = "round", l["stroke-linejoin"] = "round"), r && (l["stroke-width"] = r),
|
|
2492
|
+
return i && (l.stroke = i, l["stroke-linecap"] = "round", l["stroke-linejoin"] = "round"), r && (l["stroke-width"] = r), E("svg", l);
|
|
2247
2493
|
}
|
|
2248
|
-
function
|
|
2249
|
-
const
|
|
2250
|
-
for (const [
|
|
2251
|
-
|
|
2252
|
-
return
|
|
2494
|
+
function E(e, t = {}) {
|
|
2495
|
+
const n = document.createElementNS(to, e);
|
|
2496
|
+
for (const [o, i] of Object.entries(t))
|
|
2497
|
+
n.setAttribute(o, i);
|
|
2498
|
+
return n;
|
|
2253
2499
|
}
|
|
2254
|
-
function
|
|
2500
|
+
function Mn(e) {
|
|
2255
2501
|
for (const t of ["keydown", "keypress", "keyup"])
|
|
2256
|
-
e.addEventListener(t, (
|
|
2257
|
-
|
|
2502
|
+
e.addEventListener(t, (n) => {
|
|
2503
|
+
n.stopPropagation();
|
|
2258
2504
|
});
|
|
2259
2505
|
}
|
|
2260
|
-
function
|
|
2506
|
+
function Da(e, t, n) {
|
|
2261
2507
|
e.replaceChildren(), e.hidden = t.length === 0;
|
|
2262
|
-
for (const [
|
|
2508
|
+
for (const [o, i] of t.entries()) {
|
|
2263
2509
|
const r = document.createElement("div");
|
|
2264
|
-
r.className = "pluno-pa-widget__attachment", r.appendChild(
|
|
2510
|
+
r.className = "pluno-pa-widget__attachment", r.appendChild(Ra(i));
|
|
2265
2511
|
const l = document.createElement("span");
|
|
2266
2512
|
l.textContent = i.name, r.appendChild(l);
|
|
2267
2513
|
const p = document.createElement("button");
|
|
2268
|
-
p.type = "button", p.setAttribute("aria-label", `Remove ${i.name}`), p.appendChild(
|
|
2514
|
+
p.type = "button", p.setAttribute("aria-label", `Remove ${i.name}`), p.appendChild(Na()), p.addEventListener("click", () => n(o)), r.appendChild(p), e.appendChild(r);
|
|
2269
2515
|
}
|
|
2270
2516
|
}
|
|
2271
|
-
function
|
|
2272
|
-
const t =
|
|
2273
|
-
if (t === "image" &&
|
|
2274
|
-
const
|
|
2275
|
-
return
|
|
2517
|
+
function Ra(e) {
|
|
2518
|
+
const t = en(e), n = ho(e);
|
|
2519
|
+
if (t === "image" && n) {
|
|
2520
|
+
const o = document.createElement("img");
|
|
2521
|
+
return o.src = n, o.alt = "", o.setAttribute("aria-hidden", "true"), o.addEventListener("error", () => o.replaceWith(ie(e))), o;
|
|
2276
2522
|
}
|
|
2277
|
-
if (t === "video" &&
|
|
2278
|
-
const
|
|
2279
|
-
return
|
|
2523
|
+
if (t === "video" && n) {
|
|
2524
|
+
const o = document.createElement("video");
|
|
2525
|
+
return o.src = n, o.muted = !0, o.preload = "metadata", o.setAttribute("aria-hidden", "true"), o.addEventListener("error", () => o.replaceWith(ie(e))), o.addEventListener("stalled", () => o.replaceWith(ie(e))), o;
|
|
2280
2526
|
}
|
|
2281
|
-
return
|
|
2527
|
+
return ie(e);
|
|
2282
2528
|
}
|
|
2283
|
-
function
|
|
2284
|
-
const t =
|
|
2285
|
-
if (t === "image" &&
|
|
2286
|
-
const
|
|
2287
|
-
return
|
|
2529
|
+
function za(e) {
|
|
2530
|
+
const t = en(e), n = ho(e);
|
|
2531
|
+
if (t === "image" && n) {
|
|
2532
|
+
const o = document.createElement("img");
|
|
2533
|
+
return o.className = "pluno-pa-widget__message-attachment-preview", o.src = n, o.alt = e.name, o.addEventListener("error", () => o.replaceWith(ie(e, "message"))), o;
|
|
2288
2534
|
}
|
|
2289
|
-
if (t === "pdf" &&
|
|
2290
|
-
const
|
|
2291
|
-
return
|
|
2535
|
+
if (t === "pdf" && n) {
|
|
2536
|
+
const o = document.createElement("object");
|
|
2537
|
+
return o.className = "pluno-pa-widget__message-attachment-preview pluno-pa-widget__message-attachment-preview--pdf", o.data = n, o.type = "application/pdf", o.setAttribute("aria-label", e.name), o.addEventListener("error", () => o.replaceWith(ie(e, "message"))), o.appendChild(ie(e, "message")), o;
|
|
2292
2538
|
}
|
|
2293
|
-
if (t === "video" &&
|
|
2294
|
-
const
|
|
2295
|
-
return
|
|
2539
|
+
if (t === "video" && n) {
|
|
2540
|
+
const o = document.createElement("video");
|
|
2541
|
+
return o.className = "pluno-pa-widget__message-attachment-preview", o.src = n, o.muted = !0, o.preload = "metadata", o.addEventListener("error", () => o.replaceWith(ie(e, "message"))), o.addEventListener("stalled", () => o.replaceWith(ie(e, "message"))), o;
|
|
2296
2542
|
}
|
|
2297
|
-
return
|
|
2543
|
+
return ie(e, "message");
|
|
2298
2544
|
}
|
|
2299
|
-
function
|
|
2545
|
+
function ie(e, t = "composer") {
|
|
2300
2546
|
if (t === "composer") {
|
|
2301
2547
|
const r = document.createElement("span");
|
|
2302
|
-
return r.className = "pluno-pa-widget__attachment-file", r.textContent =
|
|
2548
|
+
return r.className = "pluno-pa-widget__attachment-file", r.textContent = On(e), r;
|
|
2303
2549
|
}
|
|
2304
|
-
const
|
|
2305
|
-
|
|
2306
|
-
const
|
|
2307
|
-
|
|
2550
|
+
const n = document.createElement("div");
|
|
2551
|
+
n.className = "pluno-pa-widget__message-attachment-file";
|
|
2552
|
+
const o = document.createElement("span");
|
|
2553
|
+
o.textContent = On(e);
|
|
2308
2554
|
const i = document.createElement("strong");
|
|
2309
|
-
return i.textContent = e.name,
|
|
2555
|
+
return i.textContent = e.name, n.append(o, i), n;
|
|
2310
2556
|
}
|
|
2311
|
-
function
|
|
2557
|
+
function en(e) {
|
|
2312
2558
|
return e.mimeType.startsWith("image/") ? "image" : e.mimeType === "application/pdf" ? "pdf" : e.mimeType.startsWith("video/") ? "video" : "file";
|
|
2313
2559
|
}
|
|
2314
|
-
function
|
|
2560
|
+
function ho(e) {
|
|
2315
2561
|
return "previewUrl" in e && e.previewUrl ? e.previewUrl : e.fileUrl ?? "";
|
|
2316
2562
|
}
|
|
2317
|
-
function
|
|
2318
|
-
const t =
|
|
2563
|
+
function On(e) {
|
|
2564
|
+
const t = en(e);
|
|
2319
2565
|
return t === "image" ? "IMG" : t === "pdf" ? "PDF" : t === "video" ? "VID" : "FILE";
|
|
2320
2566
|
}
|
|
2321
|
-
function
|
|
2322
|
-
return t ? Array.from(t).map((
|
|
2323
|
-
...e.createLocalAttachment(
|
|
2324
|
-
previewUrl:
|
|
2567
|
+
function Ma(e, t) {
|
|
2568
|
+
return t ? Array.from(t).map((o) => ({
|
|
2569
|
+
...e.createLocalAttachment(o),
|
|
2570
|
+
previewUrl: Oa(o)
|
|
2325
2571
|
})) : [];
|
|
2326
2572
|
}
|
|
2327
|
-
function
|
|
2573
|
+
function Oa(e) {
|
|
2328
2574
|
return typeof URL.createObjectURL == "function" ? URL.createObjectURL(e) : void 0;
|
|
2329
2575
|
}
|
|
2330
|
-
function
|
|
2576
|
+
function it(e) {
|
|
2331
2577
|
return !!(e && Array.from(e.types).includes("Files"));
|
|
2332
2578
|
}
|
|
2333
|
-
function
|
|
2334
|
-
if (!e || !
|
|
2579
|
+
function Bt(e, t, n = null) {
|
|
2580
|
+
if (!e || !Yt(t, n)) {
|
|
2335
2581
|
e && (e.hidden = !0, e.replaceChildren());
|
|
2336
2582
|
return;
|
|
2337
2583
|
}
|
|
2338
|
-
e.hidden = !1, e.replaceChildren(), e.className = "pluno-pa-widget__billing-status",
|
|
2339
|
-
|
|
2340
|
-
) :
|
|
2584
|
+
e.hidden = !1, e.replaceChildren(), e.className = "pluno-pa-widget__billing-status", ae(t) || tn(n) ? e.appendChild(
|
|
2585
|
+
Ba(t, n)
|
|
2586
|
+
) : mo(t) && e.appendChild(Ua(t));
|
|
2341
2587
|
}
|
|
2342
|
-
function
|
|
2343
|
-
const
|
|
2344
|
-
|
|
2345
|
-
const
|
|
2346
|
-
i.textContent =
|
|
2588
|
+
function Ba(e, t) {
|
|
2589
|
+
const n = document.createElement("div");
|
|
2590
|
+
n.className = "pluno-pa-widget__billing-action-card";
|
|
2591
|
+
const o = e.limitExceeded || t === "limit_exceeded", i = document.createElement("strong");
|
|
2592
|
+
i.textContent = o ? "Credits used up" : "Billing needs attention", n.appendChild(i);
|
|
2347
2593
|
const r = document.createElement("span");
|
|
2348
|
-
return r.textContent =
|
|
2349
|
-
|
|
2594
|
+
return r.textContent = o ? "Earn bonus credits or upgrade to keep using Pluno on this product." : e.paymentIssue ?? "Open billing to keep using Pluno.", n.appendChild(r), n.appendChild(
|
|
2595
|
+
fo(
|
|
2350
2596
|
e,
|
|
2351
2597
|
"Upgrade plan",
|
|
2352
2598
|
"pluno-pa-widget__billing-action-card-actions"
|
|
2353
2599
|
)
|
|
2354
|
-
),
|
|
2600
|
+
), n;
|
|
2355
2601
|
}
|
|
2356
|
-
function
|
|
2602
|
+
function Ua(e) {
|
|
2357
2603
|
const t = document.createElement("div");
|
|
2358
2604
|
t.className = "pluno-pa-widget__billing-action-card pluno-pa-widget__billing-action-card--low";
|
|
2359
|
-
const
|
|
2360
|
-
|
|
2361
|
-
const
|
|
2362
|
-
return
|
|
2363
|
-
|
|
2605
|
+
const n = document.createElement("strong");
|
|
2606
|
+
n.textContent = "Credits running low", t.appendChild(n);
|
|
2607
|
+
const o = document.createElement("span");
|
|
2608
|
+
return o.textContent = Ha(e) ?? "Credits are running low for this period.", t.appendChild(o), t.appendChild(
|
|
2609
|
+
fo(
|
|
2364
2610
|
e,
|
|
2365
2611
|
"Upgrade",
|
|
2366
2612
|
"pluno-pa-widget__billing-action-card-actions"
|
|
2367
2613
|
)
|
|
2368
2614
|
), t;
|
|
2369
2615
|
}
|
|
2370
|
-
function
|
|
2371
|
-
return e !== null && (
|
|
2616
|
+
function Yt(e, t) {
|
|
2617
|
+
return e !== null && (ae(e) || mo(e) || tn(t));
|
|
2372
2618
|
}
|
|
2373
|
-
function
|
|
2374
|
-
return
|
|
2619
|
+
function Bn(e, t, n) {
|
|
2620
|
+
return Yt(t, n) || Fa(t) ? !0 : !Yt(e, n);
|
|
2375
2621
|
}
|
|
2376
|
-
function
|
|
2377
|
-
return e != null && (e.creditsUsed !== null || e.creditLimit !== null || e.creditsRemaining !== null ||
|
|
2622
|
+
function Fa(e) {
|
|
2623
|
+
return e != null && (e.creditsUsed !== null || e.creditLimit !== null || e.creditsRemaining !== null || ae(e));
|
|
2378
2624
|
}
|
|
2379
|
-
function
|
|
2625
|
+
function ae(e) {
|
|
2380
2626
|
return e?.limitExceeded === !0 || !!e?.paymentIssue;
|
|
2381
2627
|
}
|
|
2382
|
-
function
|
|
2628
|
+
function tn(e) {
|
|
2383
2629
|
return e === "limit_exceeded" || e === "subscription_required" || e === "subscription_inactive" || e === "payment_issue" || e === "subscription_invalid" || e === "payment_required";
|
|
2384
2630
|
}
|
|
2385
|
-
function
|
|
2386
|
-
return !
|
|
2631
|
+
function mo(e) {
|
|
2632
|
+
return !ae(e) && e.creditLimit !== null && e.creditLimit > 0 && e.creditsRemaining !== null && e.creditsRemaining > 0 && e.creditsRemaining / e.creditLimit <= 0.2;
|
|
2387
2633
|
}
|
|
2388
|
-
function
|
|
2389
|
-
return e.creditsRemaining === null ? null : `${
|
|
2634
|
+
function Ha(e) {
|
|
2635
|
+
return e.creditsRemaining === null ? null : `${Wa(e.creditsRemaining)} credits left`;
|
|
2390
2636
|
}
|
|
2391
|
-
function
|
|
2637
|
+
function Wa(e) {
|
|
2392
2638
|
return new Intl.NumberFormat("en-US", {
|
|
2393
2639
|
maximumFractionDigits: 0
|
|
2394
2640
|
}).format(Math.ceil(e));
|
|
2395
2641
|
}
|
|
2396
|
-
function
|
|
2397
|
-
const
|
|
2398
|
-
return
|
|
2399
|
-
|
|
2400
|
-
),
|
|
2401
|
-
|
|
2402
|
-
),
|
|
2642
|
+
function fo(e, t, n) {
|
|
2643
|
+
const o = document.createElement("div");
|
|
2644
|
+
return o.className = n, o.appendChild(
|
|
2645
|
+
Un(t, e.pricingUrl)
|
|
2646
|
+
), o.appendChild(
|
|
2647
|
+
Un("Earn credits", e.earnCreditsUrl)
|
|
2648
|
+
), o;
|
|
2403
2649
|
}
|
|
2404
|
-
function
|
|
2405
|
-
const
|
|
2406
|
-
if (
|
|
2407
|
-
const
|
|
2408
|
-
|
|
2650
|
+
function Un(e, t) {
|
|
2651
|
+
const n = document.createElement("button");
|
|
2652
|
+
if (n.type = "button", e === "Earn credits") {
|
|
2653
|
+
const o = document.createElement("span");
|
|
2654
|
+
o.className = "pluno-pa-widget__billing-action-card-earn-credits-label", o.textContent = e, n.appendChild(o);
|
|
2409
2655
|
} else
|
|
2410
|
-
|
|
2411
|
-
return
|
|
2656
|
+
n.textContent = e;
|
|
2657
|
+
return n.disabled = t.trim().length === 0, n.addEventListener("click", () => {
|
|
2412
2658
|
t.trim().length !== 0 && window.open(t, "_blank", "noopener,noreferrer");
|
|
2413
|
-
}),
|
|
2659
|
+
}), n;
|
|
2414
2660
|
}
|
|
2415
|
-
function
|
|
2661
|
+
function Ut(e, t) {
|
|
2416
2662
|
return e.messages.filter(
|
|
2417
|
-
(
|
|
2663
|
+
(o) => !wo(o)
|
|
2418
2664
|
).length === 0 && !e.assistantDraft && !e.lastError && !e.isThinking && !t;
|
|
2419
2665
|
}
|
|
2420
|
-
function
|
|
2421
|
-
const
|
|
2422
|
-
(
|
|
2423
|
-
), h = e.scrollTop,
|
|
2424
|
-
|
|
2666
|
+
function Ga(e, t, n, o, i, r, l, p, d, c, u, m, k, v, z, _) {
|
|
2667
|
+
const g = Va(r), b = g.filter(
|
|
2668
|
+
(C) => !wo(C)
|
|
2669
|
+
), h = e.scrollTop, P = [], A = /* @__PURE__ */ new Set(), L = (C) => {
|
|
2670
|
+
P.push(C);
|
|
2425
2671
|
};
|
|
2426
|
-
|
|
2427
|
-
const
|
|
2428
|
-
if (
|
|
2429
|
-
const
|
|
2430
|
-
|
|
2431
|
-
const
|
|
2432
|
-
|
|
2433
|
-
const
|
|
2672
|
+
_o(n, r.isThinking), i.hidden = !p, p && l !== null && po(i, l);
|
|
2673
|
+
const F = b.length > 0 || !!r.assistantDraft || r.isThinking;
|
|
2674
|
+
if (o(F), b.length === 0 && !r.assistantDraft && !r.lastError && !r.isThinking) {
|
|
2675
|
+
const C = document.createElement("div");
|
|
2676
|
+
C.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter";
|
|
2677
|
+
const T = document.createElement("div");
|
|
2678
|
+
T.className = "pluno-pa-widget__empty-hero";
|
|
2679
|
+
const Se = me(
|
|
2434
2680
|
"pluno-pa-widget__character--empty",
|
|
2435
|
-
|
|
2681
|
+
v()
|
|
2436
2682
|
);
|
|
2437
|
-
|
|
2438
|
-
const
|
|
2439
|
-
if (
|
|
2440
|
-
for (const
|
|
2441
|
-
const
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
}),
|
|
2683
|
+
T.appendChild(Se), C.appendChild(T), C.appendChild(lo());
|
|
2684
|
+
const q = document.createElement("div");
|
|
2685
|
+
if (q.className = r.starterPrompts.length > 0 ? "pluno-pa-widget__starter-prompts" : "pluno-pa-widget__starter-prompts pluno-pa-widget__starter-prompts--empty", r.starterPrompts.length === 0 && !r.starterPromptsLoading && q.setAttribute("aria-hidden", "true"), r.starterPrompts.length > 0)
|
|
2686
|
+
for (const R of r.starterPrompts) {
|
|
2687
|
+
const D = document.createElement("button");
|
|
2688
|
+
D.type = "button", D.className = "pluno-pa-widget__starter-prompt", D.textContent = `"${R}"`, D.addEventListener("click", () => {
|
|
2689
|
+
z(R);
|
|
2690
|
+
}), q.appendChild(D);
|
|
2445
2691
|
}
|
|
2446
2692
|
else if (r.starterPromptsLoading) {
|
|
2447
|
-
const
|
|
2448
|
-
|
|
2693
|
+
const R = document.createElement("button");
|
|
2694
|
+
R.type = "button", R.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder pluno-pa-widget__starter-prompt--loading", R.disabled = !0, R.tabIndex = -1, R.textContent = "Generating example tasks...", q.appendChild(R);
|
|
2449
2695
|
} else
|
|
2450
|
-
for (let
|
|
2451
|
-
const
|
|
2452
|
-
|
|
2696
|
+
for (let R = 0; R < Ei; R += 1) {
|
|
2697
|
+
const D = document.createElement("button");
|
|
2698
|
+
D.type = "button", D.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder", D.disabled = !0, D.tabIndex = -1, D.textContent = "", q.appendChild(D);
|
|
2453
2699
|
}
|
|
2454
|
-
|
|
2700
|
+
C.appendChild(q), m.clear(), L(C), L(t), Fn(e, P);
|
|
2455
2701
|
return;
|
|
2456
2702
|
}
|
|
2457
|
-
let
|
|
2458
|
-
const
|
|
2459
|
-
if (
|
|
2703
|
+
let H = null, $ = null, Q = [];
|
|
2704
|
+
const ze = b.some(Xt), x = () => {
|
|
2705
|
+
if (Q.length === 0)
|
|
2460
2706
|
return !1;
|
|
2461
|
-
const
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2707
|
+
const C = or(
|
|
2708
|
+
Q,
|
|
2709
|
+
u,
|
|
2710
|
+
k,
|
|
2711
|
+
v()
|
|
2466
2712
|
);
|
|
2467
|
-
return L(
|
|
2713
|
+
return L(C), H = null, $ = C, Q = [], !0;
|
|
2468
2714
|
};
|
|
2469
|
-
for (let
|
|
2470
|
-
const
|
|
2471
|
-
if (
|
|
2472
|
-
|
|
2715
|
+
for (let C = 0; C < b.length; C += 1) {
|
|
2716
|
+
const T = b[C];
|
|
2717
|
+
if (T.role === "tool") {
|
|
2718
|
+
Q.push(T);
|
|
2473
2719
|
continue;
|
|
2474
2720
|
}
|
|
2475
|
-
if (
|
|
2476
|
-
if (
|
|
2477
|
-
const
|
|
2478
|
-
L(
|
|
2721
|
+
if (Xt(T)) {
|
|
2722
|
+
if (x()) {
|
|
2723
|
+
const N = ct();
|
|
2724
|
+
L(N), H = null, $ = N;
|
|
2479
2725
|
} else {
|
|
2480
|
-
const
|
|
2481
|
-
L(
|
|
2726
|
+
const N = Gn(v());
|
|
2727
|
+
L(N), H = null, $ = N;
|
|
2482
2728
|
}
|
|
2483
2729
|
continue;
|
|
2484
2730
|
}
|
|
2485
|
-
if (
|
|
2731
|
+
if (T.role === "system")
|
|
2486
2732
|
continue;
|
|
2487
|
-
const
|
|
2488
|
-
if (
|
|
2489
|
-
const
|
|
2490
|
-
L(
|
|
2733
|
+
const Se = x(), q = nr(T.content);
|
|
2734
|
+
if (T.role === "assistant" && !Se) {
|
|
2735
|
+
const D = bo(v());
|
|
2736
|
+
L(D), H = null, $ = D;
|
|
2491
2737
|
}
|
|
2492
|
-
const
|
|
2493
|
-
L(
|
|
2738
|
+
const R = $a(T, q, m, A);
|
|
2739
|
+
L(R), H = R, $ = null;
|
|
2494
2740
|
}
|
|
2495
|
-
const
|
|
2496
|
-
if (r.isThinking &&
|
|
2497
|
-
if (
|
|
2498
|
-
const
|
|
2499
|
-
L(
|
|
2741
|
+
const de = x(), Ye = b[b.length - 1]?.id === "assistant-draft";
|
|
2742
|
+
if (r.isThinking && !Ye && !ze)
|
|
2743
|
+
if (de) {
|
|
2744
|
+
const C = ct();
|
|
2745
|
+
L(C), H = null, $ = C;
|
|
2500
2746
|
} else {
|
|
2501
|
-
const
|
|
2502
|
-
L(
|
|
2747
|
+
const C = Gn(v());
|
|
2748
|
+
L(C), H = null, $ = C;
|
|
2503
2749
|
}
|
|
2504
2750
|
if (r.lastError) {
|
|
2505
|
-
const
|
|
2506
|
-
|
|
2751
|
+
const C = document.createElement("div");
|
|
2752
|
+
C.className = "pluno-pa-widget__error", C.textContent = r.lastError, L(C), H = C, $ = null;
|
|
2507
2753
|
}
|
|
2508
|
-
const
|
|
2509
|
-
if (
|
|
2510
|
-
const
|
|
2511
|
-
isDrafting:
|
|
2512
|
-
error:
|
|
2513
|
-
characterIconOptions:
|
|
2514
|
-
onDraft:
|
|
2515
|
-
onDismiss:
|
|
2516
|
-
onDisable:
|
|
2754
|
+
const X = _ && !r.isThinking ? Qo(g) : null;
|
|
2755
|
+
if (_ && X && !_.dismissedCandidateIds.has(X.id)) {
|
|
2756
|
+
const C = Xa(X, {
|
|
2757
|
+
isDrafting: _.draftingCandidateId === X.id,
|
|
2758
|
+
error: _.error,
|
|
2759
|
+
characterIconOptions: _.characterIconOptions,
|
|
2760
|
+
onDraft: _.onDraft,
|
|
2761
|
+
onDismiss: _.onDismiss,
|
|
2762
|
+
onDisable: _.onDisable
|
|
2517
2763
|
});
|
|
2518
|
-
L(
|
|
2764
|
+
L(C), _.onSeen(X), H = null, $ = C;
|
|
2519
2765
|
}
|
|
2520
|
-
|
|
2766
|
+
H?.classList.add("pluno-pa-widget__message--bottom-reserve"), $?.classList.add("pluno-pa-widget__bottom-reserve-compact"), L(t), ja(m, A), Fn(e, P), d ? Ve(e, c) : e.scrollTop = h;
|
|
2521
2767
|
}
|
|
2522
|
-
function
|
|
2523
|
-
const i =
|
|
2768
|
+
function $a(e, t, n, o) {
|
|
2769
|
+
const i = qa(e, t), r = i ? n.get(i) : void 0;
|
|
2524
2770
|
if (i && r)
|
|
2525
|
-
return r.classList.remove("pluno-pa-widget__message--bottom-reserve"),
|
|
2771
|
+
return r.classList.remove("pluno-pa-widget__message--bottom-reserve"), o.add(i), r;
|
|
2526
2772
|
const l = document.createElement("div");
|
|
2527
|
-
l.className = `pluno-pa-widget__message pluno-pa-widget__message--${e.role}`, e.role === "assistant" ?
|
|
2773
|
+
l.className = `pluno-pa-widget__message pluno-pa-widget__message--${e.role}`, e.role === "assistant" ? ar(l, t) : l.textContent = t, e.role === "user" && e.attachments?.length && l.appendChild(Ka(e.attachments));
|
|
2528
2774
|
const p = document.createElement("div");
|
|
2529
|
-
return p.className = "pluno-pa-widget__message-actions", p.appendChild(
|
|
2775
|
+
return p.className = "pluno-pa-widget__message-actions", p.appendChild(Ya(t)), l.appendChild(p), i && (n.set(i, l), o.add(i)), l;
|
|
2530
2776
|
}
|
|
2531
|
-
function
|
|
2777
|
+
function qa(e, t) {
|
|
2532
2778
|
return e.role !== "user" || !e.attachments?.length ? null : JSON.stringify({
|
|
2533
2779
|
id: e.id,
|
|
2534
2780
|
content: t,
|
|
2535
|
-
attachments: e.attachments.map((
|
|
2536
|
-
const { previewUrl:
|
|
2781
|
+
attachments: e.attachments.map((n) => {
|
|
2782
|
+
const { previewUrl: o } = n;
|
|
2537
2783
|
return {
|
|
2538
|
-
id:
|
|
2539
|
-
name:
|
|
2540
|
-
mimeType:
|
|
2541
|
-
sizeBytes:
|
|
2542
|
-
previewUrl:
|
|
2543
|
-
fileUrl:
|
|
2544
|
-
gcsPath:
|
|
2784
|
+
id: n.id ?? null,
|
|
2785
|
+
name: n.name,
|
|
2786
|
+
mimeType: n.mimeType,
|
|
2787
|
+
sizeBytes: n.sizeBytes,
|
|
2788
|
+
previewUrl: o ?? null,
|
|
2789
|
+
fileUrl: n.fileUrl ?? null,
|
|
2790
|
+
gcsPath: n.gcsPath ?? null
|
|
2545
2791
|
};
|
|
2546
2792
|
})
|
|
2547
2793
|
});
|
|
2548
2794
|
}
|
|
2549
|
-
function
|
|
2550
|
-
for (const
|
|
2551
|
-
t.has(
|
|
2552
|
-
}
|
|
2553
|
-
function
|
|
2554
|
-
let
|
|
2555
|
-
for (const
|
|
2556
|
-
if (
|
|
2557
|
-
|
|
2795
|
+
function ja(e, t) {
|
|
2796
|
+
for (const n of e.keys())
|
|
2797
|
+
t.has(n) || e.delete(n);
|
|
2798
|
+
}
|
|
2799
|
+
function Fn(e, t) {
|
|
2800
|
+
let n = e.firstChild;
|
|
2801
|
+
for (const o of t) {
|
|
2802
|
+
if (o === n) {
|
|
2803
|
+
n = n.nextSibling;
|
|
2558
2804
|
continue;
|
|
2559
2805
|
}
|
|
2560
|
-
e.insertBefore(
|
|
2806
|
+
e.insertBefore(o, n);
|
|
2561
2807
|
}
|
|
2562
|
-
for (;
|
|
2563
|
-
const
|
|
2564
|
-
|
|
2808
|
+
for (; n; ) {
|
|
2809
|
+
const o = n;
|
|
2810
|
+
n = n.nextSibling, e.removeChild(o);
|
|
2565
2811
|
}
|
|
2566
2812
|
}
|
|
2567
|
-
function
|
|
2813
|
+
function Va(e) {
|
|
2568
2814
|
if (!e.assistantDraft)
|
|
2569
2815
|
return [...e.messages];
|
|
2570
2816
|
const t = {
|
|
@@ -2578,22 +2824,22 @@ function La(e) {
|
|
|
2578
2824
|
};
|
|
2579
2825
|
if (!t.respondsToUserMessageId)
|
|
2580
2826
|
return [...e.messages, t];
|
|
2581
|
-
const
|
|
2827
|
+
const n = e.messages.findIndex(
|
|
2582
2828
|
(r) => r.role === "user" && r.id === t.respondsToUserMessageId
|
|
2583
2829
|
);
|
|
2584
|
-
if (
|
|
2830
|
+
if (n === -1)
|
|
2585
2831
|
return [...e.messages, t];
|
|
2586
|
-
const
|
|
2587
|
-
(r, l) => l >
|
|
2832
|
+
const o = e.messages.findIndex(
|
|
2833
|
+
(r, l) => l > n && r.role !== "user" && r.respondsToUserMessageId === t.respondsToUserMessageId && Hn(r, t) && Xt(r)
|
|
2588
2834
|
);
|
|
2589
|
-
if (
|
|
2835
|
+
if (o !== -1)
|
|
2590
2836
|
return [
|
|
2591
|
-
...e.messages.slice(0,
|
|
2837
|
+
...e.messages.slice(0, o),
|
|
2592
2838
|
t,
|
|
2593
|
-
...e.messages.slice(
|
|
2839
|
+
...e.messages.slice(o + 1)
|
|
2594
2840
|
];
|
|
2595
|
-
let i =
|
|
2596
|
-
for (; i < e.messages.length && e.messages[i].role !== "user" && e.messages[i].respondsToUserMessageId === t.respondsToUserMessageId &&
|
|
2841
|
+
let i = n + 1;
|
|
2842
|
+
for (; i < e.messages.length && e.messages[i].role !== "user" && e.messages[i].respondsToUserMessageId === t.respondsToUserMessageId && Hn(e.messages[i], t); )
|
|
2597
2843
|
i += 1;
|
|
2598
2844
|
return [
|
|
2599
2845
|
...e.messages.slice(0, i),
|
|
@@ -2601,50 +2847,50 @@ function La(e) {
|
|
|
2601
2847
|
...e.messages.slice(i)
|
|
2602
2848
|
];
|
|
2603
2849
|
}
|
|
2604
|
-
function
|
|
2850
|
+
function Xt(e) {
|
|
2605
2851
|
return e.role === "system" && e.dataType === "run_status" && e.loading === !0;
|
|
2606
2852
|
}
|
|
2607
|
-
function
|
|
2853
|
+
function Hn(e, t) {
|
|
2608
2854
|
return !e.runId || !t.runId ? !0 : e.runId === t.runId;
|
|
2609
2855
|
}
|
|
2610
|
-
function
|
|
2611
|
-
e.replaceChildren(),
|
|
2856
|
+
function Wn(e, t, n, o, i, r, l, p) {
|
|
2857
|
+
e.replaceChildren(), _o(t, !1), t.disabled = !0, n(!1);
|
|
2612
2858
|
const d = document.createElement("div");
|
|
2613
2859
|
d.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter";
|
|
2614
|
-
const
|
|
2860
|
+
const c = me(
|
|
2615
2861
|
"pluno-pa-widget__character--empty",
|
|
2616
|
-
|
|
2862
|
+
o()
|
|
2617
2863
|
);
|
|
2618
|
-
d.appendChild(
|
|
2619
|
-
const
|
|
2620
|
-
if (
|
|
2621
|
-
const
|
|
2622
|
-
|
|
2864
|
+
d.appendChild(c);
|
|
2865
|
+
const u = document.createElement("div");
|
|
2866
|
+
if (u.className = "pluno-pa-widget__empty", u.textContent = i, d.appendChild(u), l) {
|
|
2867
|
+
const m = document.createElement("a");
|
|
2868
|
+
m.className = "pluno-pa-widget__login", m.href = l, m.target = "_blank", m.rel = "noopener noreferrer", m.textContent = r, d.appendChild(m);
|
|
2623
2869
|
} else {
|
|
2624
|
-
const
|
|
2625
|
-
|
|
2870
|
+
const m = document.createElement("button");
|
|
2871
|
+
m.type = "button", m.className = "pluno-pa-widget__login", m.textContent = r, m.addEventListener("click", () => p?.()), d.appendChild(m);
|
|
2626
2872
|
}
|
|
2627
2873
|
e.appendChild(d);
|
|
2628
2874
|
}
|
|
2629
|
-
function
|
|
2875
|
+
function Ka(e) {
|
|
2630
2876
|
const t = document.createElement("div");
|
|
2631
2877
|
t.className = "pluno-pa-widget__message-attachments";
|
|
2632
|
-
for (const
|
|
2633
|
-
t.appendChild(
|
|
2878
|
+
for (const n of e)
|
|
2879
|
+
t.appendChild(za(n));
|
|
2634
2880
|
return t;
|
|
2635
2881
|
}
|
|
2636
|
-
function
|
|
2882
|
+
function Ya(e) {
|
|
2637
2883
|
const t = document.createElement("button");
|
|
2638
|
-
return t.type = "button", t.className = "pluno-pa-widget__message-copy", t.setAttribute("aria-label", "Copy message"), t.title = "Copy message", t.appendChild(
|
|
2639
|
-
|
|
2884
|
+
return t.type = "button", t.className = "pluno-pa-widget__message-copy", t.setAttribute("aria-label", "Copy message"), t.title = "Copy message", t.appendChild(Ta()), t.addEventListener("click", (n) => {
|
|
2885
|
+
n.preventDefault(), n.stopPropagation(), navigator.clipboard.writeText(e);
|
|
2640
2886
|
}), t;
|
|
2641
2887
|
}
|
|
2642
|
-
function
|
|
2643
|
-
const
|
|
2644
|
-
|
|
2645
|
-
const
|
|
2646
|
-
|
|
2647
|
-
|
|
2888
|
+
function Xa(e, t) {
|
|
2889
|
+
const n = document.createElement("article");
|
|
2890
|
+
n.className = "pluno-pa-widget__share-prompt";
|
|
2891
|
+
const o = document.createElement("div");
|
|
2892
|
+
o.className = "pluno-pa-widget__share-prompt-body", o.appendChild(
|
|
2893
|
+
me(
|
|
2648
2894
|
"pluno-pa-widget__share-prompt-icon",
|
|
2649
2895
|
t.characterIconOptions
|
|
2650
2896
|
)
|
|
@@ -2655,97 +2901,97 @@ function Na(e, t) {
|
|
|
2655
2901
|
r.textContent = "Share this win?", i.appendChild(r);
|
|
2656
2902
|
const l = document.createElement("span");
|
|
2657
2903
|
if (l.textContent = t.isDrafting ? "Drafting social post..." : "Create a screenshot and generate a draft for a social post.", i.appendChild(l), t.error) {
|
|
2658
|
-
const
|
|
2659
|
-
|
|
2904
|
+
const u = document.createElement("span");
|
|
2905
|
+
u.className = "pluno-pa-widget__share-prompt-error", u.textContent = t.error, i.appendChild(u);
|
|
2660
2906
|
}
|
|
2661
|
-
|
|
2907
|
+
o.appendChild(i);
|
|
2662
2908
|
const p = document.createElement("div");
|
|
2663
2909
|
p.className = "pluno-pa-widget__share-prompt-actions";
|
|
2664
2910
|
const d = document.createElement("div");
|
|
2665
2911
|
d.className = "pluno-pa-widget__share-prompt-primary-actions";
|
|
2666
|
-
const
|
|
2667
|
-
if (
|
|
2912
|
+
const c = document.createElement("button");
|
|
2913
|
+
if (c.type = "button", c.disabled = t.isDrafting, c.addEventListener("click", () => {
|
|
2668
2914
|
t.onDraft(e);
|
|
2669
|
-
}), t.isDrafting ? (
|
|
2915
|
+
}), t.isDrafting ? (c.appendChild(Zt()), c.appendChild(document.createTextNode("Drafting..."))) : c.textContent = "Draft a social post", d.appendChild(c), t.isDrafting)
|
|
2670
2916
|
p.appendChild(d);
|
|
2671
2917
|
else {
|
|
2672
|
-
const
|
|
2673
|
-
|
|
2918
|
+
const u = document.createElement("button");
|
|
2919
|
+
u.type = "button", u.className = "pluno-pa-widget__share-prompt-dismiss", u.setAttribute("aria-label", "Dismiss share prompt"), u.title = "Dismiss", u.textContent = "Dismiss", u.addEventListener("click", () => {
|
|
2674
2920
|
t.onDismiss(e);
|
|
2675
|
-
}), d.appendChild(
|
|
2676
|
-
const
|
|
2677
|
-
|
|
2921
|
+
}), d.appendChild(u), p.appendChild(d);
|
|
2922
|
+
const m = document.createElement("button");
|
|
2923
|
+
m.type = "button", m.className = "pluno-pa-widget__share-prompt-disable", m.textContent = "Don't ask again", m.addEventListener("click", () => {
|
|
2678
2924
|
t.onDisable(e);
|
|
2679
|
-
}), p.appendChild(
|
|
2925
|
+
}), p.appendChild(m);
|
|
2680
2926
|
}
|
|
2681
|
-
return
|
|
2927
|
+
return o.appendChild(p), n.appendChild(o), n;
|
|
2682
2928
|
}
|
|
2683
|
-
function
|
|
2684
|
-
const
|
|
2685
|
-
|
|
2686
|
-
|
|
2929
|
+
function Za(e, t) {
|
|
2930
|
+
const n = document.createElement("div");
|
|
2931
|
+
n.className = "pluno-pa-widget__share-dialog-backdrop", n.addEventListener("click", (g) => {
|
|
2932
|
+
g.target === n && t.onClose();
|
|
2687
2933
|
});
|
|
2688
|
-
const
|
|
2689
|
-
|
|
2934
|
+
const o = document.createElement("section");
|
|
2935
|
+
o.className = "pluno-pa-widget__share-dialog", o.setAttribute("role", "dialog"), o.setAttribute("aria-modal", "true"), o.setAttribute("aria-label", "Draft a social post");
|
|
2690
2936
|
const i = document.createElement("header"), r = document.createElement("strong");
|
|
2691
2937
|
r.textContent = "Share this win", i.appendChild(r);
|
|
2692
2938
|
const l = document.createElement("button");
|
|
2693
|
-
l.type = "button", l.setAttribute("aria-label", "Close"), l.textContent = "×", l.addEventListener("click", t.onClose), i.appendChild(l),
|
|
2939
|
+
l.type = "button", l.setAttribute("aria-label", "Close"), l.textContent = "×", l.addEventListener("click", t.onClose), i.appendChild(l), o.appendChild(i);
|
|
2694
2940
|
const p = document.createElement("p");
|
|
2695
2941
|
p.className = "pluno-pa-widget__share-dialog-status", p.hidden = !0;
|
|
2696
2942
|
const d = document.createElement("div");
|
|
2697
2943
|
d.className = "pluno-pa-widget__share-dialog-step";
|
|
2698
|
-
const
|
|
2699
|
-
|
|
2700
|
-
const
|
|
2701
|
-
|
|
2702
|
-
const
|
|
2944
|
+
const c = document.createElement("div");
|
|
2945
|
+
c.className = "pluno-pa-widget__share-dialog-step-header";
|
|
2946
|
+
const u = document.createElement("strong");
|
|
2947
|
+
u.textContent = "1) Copy Screenshot", c.appendChild(u);
|
|
2948
|
+
const m = Ja(
|
|
2703
2949
|
"Copy Screenshot",
|
|
2704
2950
|
async () => {
|
|
2705
2951
|
try {
|
|
2706
|
-
return await
|
|
2952
|
+
return await ei(e.screenshotDataUrl ?? ""), p.textContent = "", p.hidden = !0, !0;
|
|
2707
2953
|
} catch {
|
|
2708
2954
|
return p.textContent = "Could not copy screenshot.", p.hidden = !1, !1;
|
|
2709
2955
|
}
|
|
2710
2956
|
}
|
|
2711
2957
|
);
|
|
2712
|
-
if (
|
|
2713
|
-
const
|
|
2714
|
-
|
|
2715
|
-
const
|
|
2716
|
-
|
|
2958
|
+
if (c.appendChild(m), d.appendChild(c), e.screenshotDataUrl) {
|
|
2959
|
+
const g = document.createElement("div");
|
|
2960
|
+
g.className = "pluno-pa-widget__share-dialog-screenshot";
|
|
2961
|
+
const b = document.createElement("img");
|
|
2962
|
+
b.src = e.screenshotDataUrl, b.alt = "Product page with Pluno open", g.appendChild(b), d.appendChild(g);
|
|
2717
2963
|
}
|
|
2718
|
-
|
|
2719
|
-
const
|
|
2720
|
-
|
|
2721
|
-
const
|
|
2722
|
-
|
|
2723
|
-
const
|
|
2724
|
-
|
|
2725
|
-
const
|
|
2726
|
-
|
|
2727
|
-
for (const
|
|
2728
|
-
const
|
|
2729
|
-
|
|
2964
|
+
o.appendChild(d), o.appendChild(p);
|
|
2965
|
+
const k = document.createElement("div");
|
|
2966
|
+
k.className = "pluno-pa-widget__share-dialog-step";
|
|
2967
|
+
const v = document.createElement("strong");
|
|
2968
|
+
v.className = "pluno-pa-widget__share-dialog-step-title", v.textContent = "2) Share on", k.appendChild(v);
|
|
2969
|
+
const z = document.createElement("p");
|
|
2970
|
+
z.className = "pluno-pa-widget__share-dialog-hint", z.textContent = "Post draft opens prefilled on supported platforms.", k.appendChild(z);
|
|
2971
|
+
const _ = document.createElement("footer");
|
|
2972
|
+
_.className = "pluno-pa-widget__share-dialog-platforms";
|
|
2973
|
+
for (const g of Qa(e)) {
|
|
2974
|
+
const b = document.createElement("a");
|
|
2975
|
+
b.href = g.href, b.target = "_blank", b.rel = "noopener noreferrer", b.title = g.label, b.setAttribute("aria-label", `Open ${g.label}`), b.appendChild(er(g.id)), _.appendChild(b);
|
|
2730
2976
|
}
|
|
2731
|
-
if (
|
|
2732
|
-
const
|
|
2733
|
-
|
|
2734
|
-
const
|
|
2735
|
-
|
|
2977
|
+
if (k.appendChild(_), o.appendChild(k), t.socialPostRewardsUrl) {
|
|
2978
|
+
const g = document.createElement("div");
|
|
2979
|
+
g.className = "pluno-pa-widget__share-dialog-step";
|
|
2980
|
+
const b = document.createElement("strong");
|
|
2981
|
+
b.className = "pluno-pa-widget__share-dialog-step-title", b.textContent = "3) Submit post to get 2000 free credits!", g.appendChild(b);
|
|
2736
2982
|
const h = document.createElement("a");
|
|
2737
|
-
h.className = "pluno-pa-widget__share-dialog-reward-link", h.href = t.socialPostRewardsUrl, h.target = "_blank", h.rel = "noopener noreferrer", h.appendChild(document.createTextNode("Submit post URL")), h.appendChild(
|
|
2983
|
+
h.className = "pluno-pa-widget__share-dialog-reward-link", h.href = t.socialPostRewardsUrl, h.target = "_blank", h.rel = "noopener noreferrer", h.appendChild(document.createTextNode("Submit post URL")), h.appendChild(tr()), g.appendChild(h), o.appendChild(g);
|
|
2738
2984
|
}
|
|
2739
|
-
return
|
|
2985
|
+
return n.appendChild(o), n;
|
|
2740
2986
|
}
|
|
2741
|
-
function
|
|
2742
|
-
const
|
|
2743
|
-
return
|
|
2744
|
-
|
|
2745
|
-
}),
|
|
2987
|
+
function Ja(e, t) {
|
|
2988
|
+
const n = document.createElement("button");
|
|
2989
|
+
return n.type = "button", n.className = "pluno-pa-widget__share-dialog-copy", n.textContent = e, n.addEventListener("click", async (o) => {
|
|
2990
|
+
o.preventDefault(), o.stopPropagation(), await t() && (n.textContent = "Copied ✓");
|
|
2991
|
+
}), n;
|
|
2746
2992
|
}
|
|
2747
|
-
function
|
|
2748
|
-
const t = e.linkedinPost.trim(),
|
|
2993
|
+
function Qa(e) {
|
|
2994
|
+
const t = e.linkedinPost.trim(), n = e.xPost.trim();
|
|
2749
2995
|
return [
|
|
2750
2996
|
{
|
|
2751
2997
|
id: "linkedin",
|
|
@@ -2755,7 +3001,7 @@ function Da(e) {
|
|
|
2755
3001
|
{
|
|
2756
3002
|
id: "x",
|
|
2757
3003
|
label: "X",
|
|
2758
|
-
href: `https://twitter.com/intent/tweet?text=${encodeURIComponent(
|
|
3004
|
+
href: `https://twitter.com/intent/tweet?text=${encodeURIComponent(n)}`
|
|
2759
3005
|
},
|
|
2760
3006
|
{
|
|
2761
3007
|
id: "instagram",
|
|
@@ -2764,7 +3010,7 @@ function Da(e) {
|
|
|
2764
3010
|
}
|
|
2765
3011
|
];
|
|
2766
3012
|
}
|
|
2767
|
-
function
|
|
3013
|
+
function er(e) {
|
|
2768
3014
|
const t = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
2769
3015
|
return t.setAttribute("class", "pluno-pa-widget__share-dialog-platform-logo"), t.setAttribute("viewBox", "0 0 32 32"), t.setAttribute("aria-hidden", "true"), e === "linkedin" ? (U(t, "M6.7 13.2c.4 4.1.2 8.1.1 12.3"), U(
|
|
2770
3016
|
t,
|
|
@@ -2787,145 +3033,145 @@ function Ra(e) {
|
|
|
2787
3033
|
"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"
|
|
2788
3034
|
), t);
|
|
2789
3035
|
}
|
|
2790
|
-
function U(e, t,
|
|
2791
|
-
const
|
|
2792
|
-
|
|
3036
|
+
function U(e, t, n) {
|
|
3037
|
+
const o = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
3038
|
+
o.setAttribute("d", t), n && o.setAttribute("opacity", n), e.appendChild(o);
|
|
2793
3039
|
}
|
|
2794
|
-
function
|
|
3040
|
+
function tr() {
|
|
2795
3041
|
const e = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
2796
3042
|
return e.setAttribute("class", "pluno-pa-widget__share-dialog-external-icon"), e.setAttribute("viewBox", "0 0 24 24"), e.setAttribute("aria-hidden", "true"), U(e, "M14 5h5v5"), U(e, "M19 5l-8 8"), U(
|
|
2797
3043
|
e,
|
|
2798
3044
|
"M18 13v5a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1h5"
|
|
2799
3045
|
), e;
|
|
2800
3046
|
}
|
|
2801
|
-
function
|
|
2802
|
-
return e.role === "tool" && e.toolName ===
|
|
3047
|
+
function wo(e) {
|
|
3048
|
+
return e.role === "tool" && e.toolName === Xn;
|
|
2803
3049
|
}
|
|
2804
|
-
function
|
|
3050
|
+
function nr(e) {
|
|
2805
3051
|
return e.replace(/\uE200[^\uE201]*(?:\uE201|$)/g, "");
|
|
2806
3052
|
}
|
|
2807
|
-
function
|
|
3053
|
+
function or(e, t, n, o) {
|
|
2808
3054
|
const i = document.createElement("article");
|
|
2809
3055
|
i.className = "pluno-pa-widget__tool-group", i.title = new Date(
|
|
2810
3056
|
e[e.length - 1].createdAt
|
|
2811
3057
|
).toLocaleString(), i.appendChild(
|
|
2812
|
-
|
|
3058
|
+
me(
|
|
2813
3059
|
"pluno-pa-widget__character--tool-group",
|
|
2814
|
-
|
|
3060
|
+
o
|
|
2815
3061
|
)
|
|
2816
3062
|
);
|
|
2817
|
-
const r = document.createElement("details"), l =
|
|
3063
|
+
const r = document.createElement("details"), l = ir(e);
|
|
2818
3064
|
r.open = t.has(l), i.classList.toggle("pluno-pa-widget__tool-group--open", r.open), r.addEventListener("toggle", () => {
|
|
2819
|
-
i.classList.toggle("pluno-pa-widget__tool-group--open", r.open), r.open ? t.add(l) : t.delete(l),
|
|
3065
|
+
i.classList.toggle("pluno-pa-widget__tool-group--open", r.open), r.open ? t.add(l) : t.delete(l), n();
|
|
2820
3066
|
});
|
|
2821
3067
|
const p = document.createElement("summary");
|
|
2822
|
-
p.className = "pluno-pa-widget__tool-summary", e.some((
|
|
2823
|
-
const
|
|
2824
|
-
if (
|
|
2825
|
-
const
|
|
2826
|
-
|
|
2827
|
-
for (const
|
|
2828
|
-
const
|
|
2829
|
-
|
|
2830
|
-
const
|
|
2831
|
-
|
|
2832
|
-
}
|
|
2833
|
-
r.appendChild(
|
|
3068
|
+
p.className = "pluno-pa-widget__tool-summary", e.some((u) => u.loading) && p.appendChild(Zt());
|
|
3069
|
+
const c = document.createElement("span");
|
|
3070
|
+
if (c.className = "pluno-pa-widget__tool-summary-title", c.textContent = e[e.length - 1].content || "Run tool", p.appendChild(c), r.appendChild(p), e.length > 0) {
|
|
3071
|
+
const u = document.createElement("div");
|
|
3072
|
+
u.className = "pluno-pa-widget__tool-lines";
|
|
3073
|
+
for (const m of e) {
|
|
3074
|
+
const k = document.createElement("div");
|
|
3075
|
+
k.className = "pluno-pa-widget__tool-line", m.loading && k.appendChild(Zt());
|
|
3076
|
+
const v = document.createElement("span");
|
|
3077
|
+
v.textContent = m.content || "Run tool", k.appendChild(v), u.appendChild(k);
|
|
3078
|
+
}
|
|
3079
|
+
r.appendChild(u);
|
|
2834
3080
|
}
|
|
2835
3081
|
return i.appendChild(r), i;
|
|
2836
3082
|
}
|
|
2837
|
-
function
|
|
3083
|
+
function bo(e) {
|
|
2838
3084
|
const t = document.createElement("article");
|
|
2839
3085
|
return t.className = "pluno-pa-widget__tool-group pluno-pa-widget__assistant-marker", t.appendChild(
|
|
2840
|
-
|
|
3086
|
+
me(
|
|
2841
3087
|
"pluno-pa-widget__character--tool-group",
|
|
2842
3088
|
e
|
|
2843
3089
|
)
|
|
2844
3090
|
), t;
|
|
2845
3091
|
}
|
|
2846
|
-
function
|
|
2847
|
-
const t =
|
|
2848
|
-
return t.classList.add("pluno-pa-widget__thinking-marker"), t.appendChild(
|
|
3092
|
+
function Gn(e) {
|
|
3093
|
+
const t = bo(e);
|
|
3094
|
+
return t.classList.add("pluno-pa-widget__thinking-marker"), t.appendChild(ct()), t;
|
|
2849
3095
|
}
|
|
2850
|
-
function
|
|
3096
|
+
function ct(e = "Thinking...") {
|
|
2851
3097
|
const t = document.createElement("div");
|
|
2852
3098
|
t.className = "pluno-pa-widget__status";
|
|
2853
|
-
const o = document.createElement("span");
|
|
2854
|
-
o.className = "pluno-pa-widget__thinking-dot", o.setAttribute("aria-hidden", "true"), t.appendChild(o);
|
|
2855
3099
|
const n = document.createElement("span");
|
|
2856
|
-
|
|
3100
|
+
n.className = "pluno-pa-widget__thinking-dot", n.setAttribute("aria-hidden", "true"), t.appendChild(n);
|
|
3101
|
+
const o = document.createElement("span");
|
|
3102
|
+
return o.textContent = e, t.appendChild(o), t;
|
|
2857
3103
|
}
|
|
2858
|
-
function
|
|
3104
|
+
function ir(e) {
|
|
2859
3105
|
return `tools:${e[0]?.id ?? ""}`;
|
|
2860
3106
|
}
|
|
2861
|
-
function
|
|
3107
|
+
function Zt() {
|
|
2862
3108
|
const e = document.createElement("span");
|
|
2863
3109
|
return e.className = "pluno-pa-widget__spinner", e.setAttribute("aria-hidden", "true"), e;
|
|
2864
3110
|
}
|
|
2865
|
-
function
|
|
2866
|
-
e.setAttribute("aria-label", t ? "Stop" : "Send"), e.classList.toggle("pluno-pa-widget__send--stop", t), e.replaceChildren(t ?
|
|
3111
|
+
function _o(e, t) {
|
|
3112
|
+
e.setAttribute("aria-label", t ? "Stop" : "Send"), e.classList.toggle("pluno-pa-widget__send--stop", t), e.replaceChildren(t ? Aa() : go());
|
|
2867
3113
|
}
|
|
2868
|
-
function
|
|
2869
|
-
const
|
|
3114
|
+
function ar(e, t) {
|
|
3115
|
+
const n = t.replace(/\r\n/g, `
|
|
2870
3116
|
`).split(`
|
|
2871
3117
|
`);
|
|
2872
|
-
let
|
|
2873
|
-
for (;
|
|
2874
|
-
const i = o
|
|
3118
|
+
let o = 0;
|
|
3119
|
+
for (; o < n.length; ) {
|
|
3120
|
+
const i = n[o];
|
|
2875
3121
|
if (!i.trim()) {
|
|
2876
|
-
|
|
3122
|
+
o += 1;
|
|
2877
3123
|
continue;
|
|
2878
3124
|
}
|
|
2879
3125
|
if (i.match(/^```(\w+)?\s*$/)) {
|
|
2880
|
-
const
|
|
2881
|
-
for (
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
const
|
|
2885
|
-
|
|
2886
|
-
`),
|
|
3126
|
+
const c = [];
|
|
3127
|
+
for (o += 1; o < n.length && !/^```\s*$/.test(n[o]); )
|
|
3128
|
+
c.push(n[o]), o += 1;
|
|
3129
|
+
o += o < n.length ? 1 : 0;
|
|
3130
|
+
const u = document.createElement("pre"), m = document.createElement("code");
|
|
3131
|
+
m.textContent = c.join(`
|
|
3132
|
+
`), u.appendChild(m), e.appendChild(u);
|
|
2887
3133
|
continue;
|
|
2888
3134
|
}
|
|
2889
3135
|
const l = i.match(/^(#{1,3})\s+(.+)$/);
|
|
2890
3136
|
if (l) {
|
|
2891
|
-
const
|
|
2892
|
-
|
|
3137
|
+
const c = document.createElement(`h${l[1].length + 2}`);
|
|
3138
|
+
at(c, l[2]), e.appendChild(c), o += 1;
|
|
2893
3139
|
continue;
|
|
2894
3140
|
}
|
|
2895
3141
|
if (/^\s*[-*+]\s+/.test(i)) {
|
|
2896
|
-
const
|
|
2897
|
-
for (;
|
|
2898
|
-
const
|
|
2899
|
-
|
|
3142
|
+
const c = document.createElement("ul");
|
|
3143
|
+
for (; o < n.length && /^\s*[-*+]\s+/.test(n[o]); ) {
|
|
3144
|
+
const u = document.createElement("li");
|
|
3145
|
+
at(u, n[o].replace(/^\s*[-*+]\s+/, "")), c.appendChild(u), o += 1;
|
|
2900
3146
|
}
|
|
2901
|
-
e.appendChild(
|
|
3147
|
+
e.appendChild(c);
|
|
2902
3148
|
continue;
|
|
2903
3149
|
}
|
|
2904
3150
|
if (/^\s*\d+\.\s+/.test(i)) {
|
|
2905
|
-
const
|
|
2906
|
-
for (;
|
|
2907
|
-
const
|
|
2908
|
-
|
|
3151
|
+
const c = document.createElement("ol");
|
|
3152
|
+
for (; o < n.length && /^\s*\d+\.\s+/.test(n[o]); ) {
|
|
3153
|
+
const u = document.createElement("li");
|
|
3154
|
+
at(u, n[o].replace(/^\s*\d+\.\s+/, "")), c.appendChild(u), o += 1;
|
|
2909
3155
|
}
|
|
2910
|
-
e.appendChild(
|
|
3156
|
+
e.appendChild(c);
|
|
2911
3157
|
continue;
|
|
2912
3158
|
}
|
|
2913
3159
|
const p = [i];
|
|
2914
|
-
for (
|
|
2915
|
-
p.push(o
|
|
3160
|
+
for (o += 1; o < n.length && n[o].trim() && !/^```/.test(n[o]) && !/^(#{1,3})\s+/.test(n[o]) && !/^\s*[-*+]\s+/.test(n[o]) && !/^\s*\d+\.\s+/.test(n[o]); )
|
|
3161
|
+
p.push(n[o]), o += 1;
|
|
2916
3162
|
const d = document.createElement("p");
|
|
2917
|
-
p.forEach((
|
|
2918
|
-
|
|
3163
|
+
p.forEach((c, u) => {
|
|
3164
|
+
u > 0 && d.appendChild(document.createElement("br")), at(d, c);
|
|
2919
3165
|
}), e.appendChild(d);
|
|
2920
3166
|
}
|
|
2921
3167
|
}
|
|
2922
|
-
function
|
|
2923
|
-
const
|
|
2924
|
-
let
|
|
2925
|
-
for (const i of t.matchAll(
|
|
3168
|
+
function at(e, t) {
|
|
3169
|
+
const n = /(`[^`]+`|\*\*[^*]+\*\*|\*[^*]+\*|\[[^\]]+\]\(([^)\s]+)\))/g;
|
|
3170
|
+
let o = 0;
|
|
3171
|
+
for (const i of t.matchAll(n)) {
|
|
2926
3172
|
const r = i.index ?? 0;
|
|
2927
|
-
r >
|
|
2928
|
-
document.createTextNode(t.slice(
|
|
3173
|
+
r > o && e.appendChild(
|
|
3174
|
+
document.createTextNode(t.slice(o, r))
|
|
2929
3175
|
);
|
|
2930
3176
|
const l = i[0];
|
|
2931
3177
|
if (l.startsWith("`")) {
|
|
@@ -2939,17 +3185,17 @@ function et(e, t) {
|
|
|
2939
3185
|
p.textContent = l.slice(1, -1), e.appendChild(p);
|
|
2940
3186
|
} else {
|
|
2941
3187
|
const p = l.match(/^\[([^\]]+)\]\(([^)\s]+)\)$/);
|
|
2942
|
-
if (p &&
|
|
3188
|
+
if (p && rr(p[2])) {
|
|
2943
3189
|
const d = document.createElement("a");
|
|
2944
3190
|
d.href = p[2], d.target = "_top", d.rel = "noreferrer", d.textContent = p[1], e.appendChild(d);
|
|
2945
3191
|
} else
|
|
2946
3192
|
e.appendChild(document.createTextNode(l));
|
|
2947
3193
|
}
|
|
2948
|
-
|
|
3194
|
+
o = r + l.length;
|
|
2949
3195
|
}
|
|
2950
|
-
|
|
3196
|
+
o < t.length && e.appendChild(document.createTextNode(t.slice(o)));
|
|
2951
3197
|
}
|
|
2952
|
-
function
|
|
3198
|
+
function rr(e) {
|
|
2953
3199
|
if (e.startsWith("/") || e.startsWith("#"))
|
|
2954
3200
|
return !0;
|
|
2955
3201
|
try {
|
|
@@ -2959,10 +3205,10 @@ function Fa(e) {
|
|
|
2959
3205
|
return !1;
|
|
2960
3206
|
}
|
|
2961
3207
|
}
|
|
2962
|
-
function
|
|
2963
|
-
if (
|
|
3208
|
+
function $n(e, t) {
|
|
3209
|
+
if (lr(e))
|
|
2964
3210
|
return;
|
|
2965
|
-
const
|
|
3211
|
+
const n = `
|
|
2966
3212
|
:host {
|
|
2967
3213
|
all: initial;
|
|
2968
3214
|
color-scheme: light;
|
|
@@ -3013,7 +3259,7 @@ function Nn(e, t) {
|
|
|
3013
3259
|
--pluno-pa-accent-contrast: #fafafa;
|
|
3014
3260
|
position: fixed;
|
|
3015
3261
|
z-index: 2147483645;
|
|
3016
|
-
font-family: ${
|
|
3262
|
+
font-family: ${oe.fontFamily};
|
|
3017
3263
|
font-size: 14px;
|
|
3018
3264
|
color: var(--pluno-pa-text);
|
|
3019
3265
|
width: var(--pluno-pa-launcher-width);
|
|
@@ -3307,6 +3553,82 @@ function Nn(e, t) {
|
|
|
3307
3553
|
opacity: 1;
|
|
3308
3554
|
transform: translateY(0) scale(1);
|
|
3309
3555
|
}
|
|
3556
|
+
.pluno-pa-widget__resize-handle {
|
|
3557
|
+
position: absolute;
|
|
3558
|
+
z-index: 3;
|
|
3559
|
+
border: 0;
|
|
3560
|
+
background: transparent;
|
|
3561
|
+
padding: 0;
|
|
3562
|
+
opacity: 0;
|
|
3563
|
+
touch-action: none;
|
|
3564
|
+
}
|
|
3565
|
+
.pluno-pa-widget__resize-handle:focus-visible {
|
|
3566
|
+
opacity: 1;
|
|
3567
|
+
outline: 2px solid var(--pluno-pa-accent);
|
|
3568
|
+
outline-offset: 2px;
|
|
3569
|
+
}
|
|
3570
|
+
.pluno-pa-widget__resize-handle--left,
|
|
3571
|
+
.pluno-pa-widget__resize-handle--right {
|
|
3572
|
+
top: 14px;
|
|
3573
|
+
bottom: 14px;
|
|
3574
|
+
width: 12px;
|
|
3575
|
+
cursor: ew-resize;
|
|
3576
|
+
}
|
|
3577
|
+
.pluno-pa-widget__resize-handle--left {
|
|
3578
|
+
left: -6px;
|
|
3579
|
+
}
|
|
3580
|
+
.pluno-pa-widget__resize-handle--right {
|
|
3581
|
+
right: -6px;
|
|
3582
|
+
}
|
|
3583
|
+
.pluno-pa-widget__resize-handle--top,
|
|
3584
|
+
.pluno-pa-widget__resize-handle--bottom {
|
|
3585
|
+
left: 14px;
|
|
3586
|
+
right: 14px;
|
|
3587
|
+
height: 12px;
|
|
3588
|
+
cursor: ns-resize;
|
|
3589
|
+
}
|
|
3590
|
+
.pluno-pa-widget__resize-handle--top {
|
|
3591
|
+
top: -6px;
|
|
3592
|
+
}
|
|
3593
|
+
.pluno-pa-widget__resize-handle--bottom {
|
|
3594
|
+
bottom: -6px;
|
|
3595
|
+
}
|
|
3596
|
+
.pluno-pa-widget__resize-handle--top-left,
|
|
3597
|
+
.pluno-pa-widget__resize-handle--top-right,
|
|
3598
|
+
.pluno-pa-widget__resize-handle--bottom-left,
|
|
3599
|
+
.pluno-pa-widget__resize-handle--bottom-right {
|
|
3600
|
+
width: 18px;
|
|
3601
|
+
height: 18px;
|
|
3602
|
+
}
|
|
3603
|
+
.pluno-pa-widget__resize-handle--top-left {
|
|
3604
|
+
top: -7px;
|
|
3605
|
+
left: -7px;
|
|
3606
|
+
cursor: nwse-resize;
|
|
3607
|
+
}
|
|
3608
|
+
.pluno-pa-widget__resize-handle--top-right {
|
|
3609
|
+
top: -7px;
|
|
3610
|
+
right: -7px;
|
|
3611
|
+
cursor: nesw-resize;
|
|
3612
|
+
}
|
|
3613
|
+
.pluno-pa-widget__resize-handle--bottom-left {
|
|
3614
|
+
bottom: -7px;
|
|
3615
|
+
left: -7px;
|
|
3616
|
+
cursor: nesw-resize;
|
|
3617
|
+
}
|
|
3618
|
+
.pluno-pa-widget__resize-handle--bottom-right {
|
|
3619
|
+
bottom: -7px;
|
|
3620
|
+
right: -7px;
|
|
3621
|
+
cursor: nwse-resize;
|
|
3622
|
+
}
|
|
3623
|
+
.pluno-pa-widget--resizing,
|
|
3624
|
+
.pluno-pa-widget--resizing .pluno-pa-widget__panel,
|
|
3625
|
+
.pluno-pa-widget--resizing .pluno-pa-widget__timeline,
|
|
3626
|
+
.pluno-pa-widget--resizing .pluno-pa-widget__input {
|
|
3627
|
+
user-select: none;
|
|
3628
|
+
}
|
|
3629
|
+
.pluno-pa-widget--resizing .pluno-pa-widget__panel {
|
|
3630
|
+
transition: none;
|
|
3631
|
+
}
|
|
3310
3632
|
.pluno-pa-widget__close {
|
|
3311
3633
|
position: absolute;
|
|
3312
3634
|
left: calc(var(--pluno-pa-panel-offset-x) + var(--pluno-pa-panel-width) - 32px);
|
|
@@ -4016,7 +4338,7 @@ function Nn(e, t) {
|
|
|
4016
4338
|
place-items: center;
|
|
4017
4339
|
padding: 18px;
|
|
4018
4340
|
background: rgba(24, 24, 27, 0.28);
|
|
4019
|
-
font-family: var(--pluno-pa-font, ${
|
|
4341
|
+
font-family: var(--pluno-pa-font, ${oe.fontFamily});
|
|
4020
4342
|
color: var(--pluno-pa-text);
|
|
4021
4343
|
}
|
|
4022
4344
|
.pluno-pa-widget__share-dialog {
|
|
@@ -4804,8 +5126,8 @@ function Nn(e, t) {
|
|
|
4804
5126
|
.pluno-pa-widget--scribble .pluno-pa-widget__scribble-spirals--panel {
|
|
4805
5127
|
position: absolute;
|
|
4806
5128
|
top: -16px;
|
|
4807
|
-
left:
|
|
4808
|
-
width:
|
|
5129
|
+
left: ${qt}px;
|
|
5130
|
+
width: calc(100% - ${qt * 2}px);
|
|
4809
5131
|
height: 36px;
|
|
4810
5132
|
z-index: 3;
|
|
4811
5133
|
filter: url(#pluno-pa-scribble-wobble-2);
|
|
@@ -5153,28 +5475,28 @@ function Nn(e, t) {
|
|
|
5153
5475
|
filter: url(#pluno-pa-scribble-wobble-2);
|
|
5154
5476
|
}
|
|
5155
5477
|
`;
|
|
5156
|
-
if (
|
|
5478
|
+
if (pr(e, n))
|
|
5157
5479
|
return;
|
|
5158
|
-
const
|
|
5159
|
-
|
|
5480
|
+
const o = e.ownerDocument.createElement("style");
|
|
5481
|
+
o.id = io, o.textContent = n, e.appendChild(o), xo(e);
|
|
5160
5482
|
}
|
|
5161
|
-
function
|
|
5162
|
-
return e.getElementById(
|
|
5483
|
+
function lr(e) {
|
|
5484
|
+
return e.getElementById(io) !== null || e.host instanceof HTMLElement && e.host.getAttribute(ao) === "true";
|
|
5163
5485
|
}
|
|
5164
|
-
function
|
|
5165
|
-
e.host instanceof HTMLElement && e.host.setAttribute(
|
|
5486
|
+
function xo(e) {
|
|
5487
|
+
e.host instanceof HTMLElement && e.host.setAttribute(ao, "true");
|
|
5166
5488
|
}
|
|
5167
|
-
function
|
|
5489
|
+
function pr(e, t) {
|
|
5168
5490
|
if (typeof CSSStyleSheet > "u" || typeof CSSStyleSheet.prototype.replaceSync != "function" || !("adoptedStyleSheets" in e))
|
|
5169
5491
|
return !1;
|
|
5170
5492
|
try {
|
|
5171
|
-
const
|
|
5172
|
-
return
|
|
5493
|
+
const n = new CSSStyleSheet();
|
|
5494
|
+
return n.replaceSync(t), e.adoptedStyleSheets = [...e.adoptedStyleSheets, n], xo(e), !0;
|
|
5173
5495
|
} catch {
|
|
5174
5496
|
return !1;
|
|
5175
5497
|
}
|
|
5176
5498
|
}
|
|
5177
|
-
async function
|
|
5499
|
+
async function sr() {
|
|
5178
5500
|
return document.body ? document.body : await new Promise((e) => {
|
|
5179
5501
|
const t = new MutationObserver(() => {
|
|
5180
5502
|
document.body && (t.disconnect(), e(document.body));
|
|
@@ -5182,41 +5504,42 @@ async function Ga() {
|
|
|
5182
5504
|
t.observe(document.documentElement, { childList: !0 });
|
|
5183
5505
|
});
|
|
5184
5506
|
}
|
|
5185
|
-
function
|
|
5507
|
+
function yo(e) {
|
|
5186
5508
|
return `pluno.productAgent.widgetState.${location.origin}.${e.backendUrl ?? ""}.${e.tokenEndpoint ?? ""}.${e.position ?? ""}`;
|
|
5187
5509
|
}
|
|
5188
|
-
function
|
|
5510
|
+
function dr(e) {
|
|
5189
5511
|
try {
|
|
5190
|
-
const t = window.localStorage.getItem(
|
|
5512
|
+
const t = window.localStorage.getItem(yo(e));
|
|
5191
5513
|
if (!t)
|
|
5192
|
-
return
|
|
5193
|
-
const
|
|
5514
|
+
return qn();
|
|
5515
|
+
const n = JSON.parse(t);
|
|
5194
5516
|
return {
|
|
5195
|
-
isOpen:
|
|
5196
|
-
composerValue: typeof
|
|
5197
|
-
focusedInput:
|
|
5198
|
-
focusedInputAt: typeof
|
|
5199
|
-
openToolGroupKeys: Array.isArray(
|
|
5200
|
-
(
|
|
5517
|
+
isOpen: n.isOpen === !0,
|
|
5518
|
+
composerValue: typeof n.composerValue == "string" ? n.composerValue : "",
|
|
5519
|
+
focusedInput: n.focusedInput === "composer" || n.focusedInput === "launcher" ? n.focusedInput : null,
|
|
5520
|
+
focusedInputAt: typeof n.focusedInputAt == "number" ? n.focusedInputAt : null,
|
|
5521
|
+
openToolGroupKeys: Array.isArray(n.openToolGroupKeys) ? n.openToolGroupKeys.filter(
|
|
5522
|
+
(o) => typeof o == "string"
|
|
5201
5523
|
) : [],
|
|
5202
|
-
launcherPosition:
|
|
5203
|
-
|
|
5204
|
-
|
|
5524
|
+
launcherPosition: hr(n.launcherPosition) ? n.launcherPosition : null,
|
|
5525
|
+
panelSize: mr(n.panelSize) ? ut(n.panelSize) : null,
|
|
5526
|
+
seenShareCandidateIds: Array.isArray(n.seenShareCandidateIds) ? n.seenShareCandidateIds.filter((o) => typeof o == "string").slice(-Zn) : [],
|
|
5527
|
+
sharePromptsDisabled: n.sharePromptsDisabled === !0
|
|
5205
5528
|
};
|
|
5206
5529
|
} catch {
|
|
5207
|
-
return
|
|
5530
|
+
return qn();
|
|
5208
5531
|
}
|
|
5209
5532
|
}
|
|
5210
|
-
async function
|
|
5533
|
+
async function cr(e) {
|
|
5211
5534
|
if (e.loadSharePromptsDisabled)
|
|
5212
5535
|
return e.loadSharePromptsDisabled();
|
|
5213
5536
|
try {
|
|
5214
|
-
return window.localStorage.getItem(
|
|
5537
|
+
return window.localStorage.getItem(Jn) === "true";
|
|
5215
5538
|
} catch {
|
|
5216
5539
|
return !1;
|
|
5217
5540
|
}
|
|
5218
5541
|
}
|
|
5219
|
-
function
|
|
5542
|
+
function ur(e, t) {
|
|
5220
5543
|
if (e.persistSharePromptsDisabled) {
|
|
5221
5544
|
Promise.resolve(e.persistSharePromptsDisabled(t)).catch(
|
|
5222
5545
|
() => {
|
|
@@ -5225,12 +5548,12 @@ function ja(e, t) {
|
|
|
5225
5548
|
return;
|
|
5226
5549
|
}
|
|
5227
5550
|
try {
|
|
5228
|
-
t && window.localStorage.setItem(
|
|
5551
|
+
t && window.localStorage.setItem(Jn, "true");
|
|
5229
5552
|
} catch {
|
|
5230
5553
|
return;
|
|
5231
5554
|
}
|
|
5232
5555
|
}
|
|
5233
|
-
function
|
|
5556
|
+
function qn() {
|
|
5234
5557
|
return {
|
|
5235
5558
|
isOpen: !1,
|
|
5236
5559
|
composerValue: "",
|
|
@@ -5238,52 +5561,59 @@ function Tn() {
|
|
|
5238
5561
|
focusedInputAt: null,
|
|
5239
5562
|
openToolGroupKeys: [],
|
|
5240
5563
|
launcherPosition: null,
|
|
5564
|
+
panelSize: null,
|
|
5241
5565
|
seenShareCandidateIds: [],
|
|
5242
5566
|
sharePromptsDisabled: !1
|
|
5243
5567
|
};
|
|
5244
5568
|
}
|
|
5245
|
-
function
|
|
5569
|
+
function gr(e, t) {
|
|
5246
5570
|
try {
|
|
5247
5571
|
window.localStorage.setItem(
|
|
5248
|
-
|
|
5572
|
+
yo(e),
|
|
5249
5573
|
JSON.stringify(t)
|
|
5250
5574
|
);
|
|
5251
5575
|
} catch {
|
|
5252
5576
|
return;
|
|
5253
5577
|
}
|
|
5254
5578
|
}
|
|
5255
|
-
function
|
|
5579
|
+
function hr(e) {
|
|
5256
5580
|
if (!e || typeof e != "object")
|
|
5257
5581
|
return !1;
|
|
5258
5582
|
const t = e;
|
|
5259
5583
|
return Number.isFinite(t.x) && Number.isFinite(t.y) && (t.anchor === "top-left" || t.anchor === "top-right" || t.anchor === "bottom-left" || t.anchor === "bottom-right");
|
|
5260
5584
|
}
|
|
5261
|
-
|
|
5262
|
-
|
|
5585
|
+
function mr(e) {
|
|
5586
|
+
if (!e || typeof e != "object")
|
|
5587
|
+
return !1;
|
|
5588
|
+
const t = e;
|
|
5589
|
+
return typeof t.width == "number" && Number.isFinite(t.width) && typeof t.height == "number" && Number.isFinite(t.height);
|
|
5590
|
+
}
|
|
5591
|
+
const jn = /* @__PURE__ */ new WeakSet();
|
|
5592
|
+
function fr(e) {
|
|
5263
5593
|
return Object.keys(e.dataset).some((t) => t.startsWith("pluno"));
|
|
5264
5594
|
}
|
|
5265
|
-
function
|
|
5595
|
+
function Vn(e) {
|
|
5266
5596
|
const t = e.pathname.split("/");
|
|
5267
5597
|
return t[t.length - 1] ?? "";
|
|
5268
5598
|
}
|
|
5269
|
-
function
|
|
5270
|
-
const
|
|
5271
|
-
return
|
|
5272
|
-
}
|
|
5273
|
-
class
|
|
5274
|
-
constructor(t,
|
|
5275
|
-
super(), this.channelId =
|
|
5276
|
-
this.readyState =
|
|
5277
|
-
}), this.addPreviewListener(
|
|
5278
|
-
const i =
|
|
5599
|
+
function wr(e, t) {
|
|
5600
|
+
const n = new URL(e.src, document.baseURI);
|
|
5601
|
+
return n.href === t.href || n.pathname === t.pathname ? !0 : Vn(n) === Vn(t);
|
|
5602
|
+
}
|
|
5603
|
+
class se extends EventTarget {
|
|
5604
|
+
constructor(t, n) {
|
|
5605
|
+
super(), this.channelId = n, this.url = t, this.addPreviewListener(_i, () => {
|
|
5606
|
+
this.readyState = se.OPEN, this.dispatchEvent(new Event("open"));
|
|
5607
|
+
}), this.addPreviewListener(xi, (o) => {
|
|
5608
|
+
const i = o;
|
|
5279
5609
|
this.dispatchEvent(
|
|
5280
5610
|
new MessageEvent("message", { data: i.detail?.data ?? "" })
|
|
5281
5611
|
);
|
|
5282
|
-
}), this.addPreviewListener(
|
|
5283
|
-
this.readyState =
|
|
5284
|
-
}), this.addPreviewListener(
|
|
5285
|
-
const i =
|
|
5286
|
-
this.readyState =
|
|
5612
|
+
}), this.addPreviewListener(yi, () => {
|
|
5613
|
+
this.readyState = se.CLOSED, this.dispatchEvent(new Event("error")), this.cleanup();
|
|
5614
|
+
}), this.addPreviewListener(vi, (o) => {
|
|
5615
|
+
const i = o;
|
|
5616
|
+
this.readyState = se.CLOSED, this.dispatchEvent(
|
|
5287
5617
|
new CloseEvent("close", {
|
|
5288
5618
|
code: i.detail?.code ?? 1e3,
|
|
5289
5619
|
reason: i.detail?.reason ?? "",
|
|
@@ -5292,8 +5622,8 @@ class re extends EventTarget {
|
|
|
5292
5622
|
), this.cleanup();
|
|
5293
5623
|
}), window.dispatchEvent(
|
|
5294
5624
|
new CustomEvent(
|
|
5295
|
-
|
|
5296
|
-
|
|
5625
|
+
rt(
|
|
5626
|
+
fi,
|
|
5297
5627
|
this.channelId
|
|
5298
5628
|
),
|
|
5299
5629
|
{
|
|
@@ -5312,18 +5642,18 @@ class re extends EventTarget {
|
|
|
5312
5642
|
extensions = "";
|
|
5313
5643
|
binaryType = "blob";
|
|
5314
5644
|
bufferedAmount = 0;
|
|
5315
|
-
readyState =
|
|
5316
|
-
socketId =
|
|
5645
|
+
readyState = se.CONNECTING;
|
|
5646
|
+
socketId = br();
|
|
5317
5647
|
listeners = /* @__PURE__ */ new Map();
|
|
5318
5648
|
send(t) {
|
|
5319
|
-
if (this.readyState !==
|
|
5649
|
+
if (this.readyState !== se.OPEN)
|
|
5320
5650
|
throw new DOMException(
|
|
5321
5651
|
"Pluno preview websocket is not open",
|
|
5322
5652
|
"InvalidStateError"
|
|
5323
5653
|
);
|
|
5324
5654
|
window.dispatchEvent(
|
|
5325
5655
|
new CustomEvent(
|
|
5326
|
-
|
|
5656
|
+
rt(wi, this.channelId),
|
|
5327
5657
|
{
|
|
5328
5658
|
detail: {
|
|
5329
5659
|
socketId: this.socketId,
|
|
@@ -5333,78 +5663,78 @@ class re extends EventTarget {
|
|
|
5333
5663
|
)
|
|
5334
5664
|
);
|
|
5335
5665
|
}
|
|
5336
|
-
close(t,
|
|
5337
|
-
this.readyState !==
|
|
5666
|
+
close(t, n) {
|
|
5667
|
+
this.readyState !== se.CLOSED && (this.readyState = se.CLOSING, window.dispatchEvent(
|
|
5338
5668
|
new CustomEvent(
|
|
5339
|
-
|
|
5669
|
+
rt(bi, this.channelId),
|
|
5340
5670
|
{
|
|
5341
|
-
detail: { socketId: this.socketId, code: t, reason:
|
|
5671
|
+
detail: { socketId: this.socketId, code: t, reason: n }
|
|
5342
5672
|
}
|
|
5343
5673
|
)
|
|
5344
5674
|
), this.cleanup());
|
|
5345
5675
|
}
|
|
5346
|
-
addPreviewListener(t,
|
|
5347
|
-
const
|
|
5676
|
+
addPreviewListener(t, n) {
|
|
5677
|
+
const o = rt(
|
|
5348
5678
|
t,
|
|
5349
5679
|
this.channelId
|
|
5350
5680
|
), i = (r) => {
|
|
5351
|
-
r.detail?.socketId === this.socketId &&
|
|
5681
|
+
r.detail?.socketId === this.socketId && n(r);
|
|
5352
5682
|
};
|
|
5353
|
-
this.listeners.set(
|
|
5683
|
+
this.listeners.set(o, i), window.addEventListener(o, i);
|
|
5354
5684
|
}
|
|
5355
5685
|
cleanup() {
|
|
5356
|
-
for (const [t,
|
|
5357
|
-
window.removeEventListener(t,
|
|
5686
|
+
for (const [t, n] of this.listeners.entries())
|
|
5687
|
+
window.removeEventListener(t, n);
|
|
5358
5688
|
this.listeners.clear();
|
|
5359
5689
|
}
|
|
5360
5690
|
}
|
|
5361
|
-
function
|
|
5691
|
+
function br() {
|
|
5362
5692
|
const e = window.sessionStorage.getItem(
|
|
5363
|
-
|
|
5693
|
+
yn
|
|
5364
5694
|
);
|
|
5365
5695
|
if (e)
|
|
5366
5696
|
return e;
|
|
5367
5697
|
const t = crypto.randomUUID();
|
|
5368
|
-
return window.sessionStorage.setItem(
|
|
5698
|
+
return window.sessionStorage.setItem(yn, t), t;
|
|
5369
5699
|
}
|
|
5370
|
-
function
|
|
5700
|
+
function rt(e, t) {
|
|
5371
5701
|
return `${e}:${t}`;
|
|
5372
5702
|
}
|
|
5373
|
-
function
|
|
5703
|
+
function _r(e) {
|
|
5374
5704
|
const t = document.currentScript;
|
|
5375
5705
|
if (t instanceof HTMLScriptElement)
|
|
5376
5706
|
return [t];
|
|
5377
|
-
const
|
|
5707
|
+
const n = new URL(e, document.baseURI).href, o = new URL(n);
|
|
5378
5708
|
return Array.from(
|
|
5379
5709
|
document.querySelectorAll("script[type='module'][src]")
|
|
5380
5710
|
).filter(
|
|
5381
|
-
(i) => i instanceof HTMLScriptElement &&
|
|
5711
|
+
(i) => i instanceof HTMLScriptElement && fr(i) && wr(i, o)
|
|
5382
5712
|
);
|
|
5383
5713
|
}
|
|
5384
|
-
function
|
|
5385
|
-
for (const t of
|
|
5386
|
-
if (
|
|
5714
|
+
function xr(e) {
|
|
5715
|
+
for (const t of _r(e)) {
|
|
5716
|
+
if (jn.has(t) || t.dataset.plunoAutoMount === "false")
|
|
5387
5717
|
continue;
|
|
5388
|
-
|
|
5389
|
-
const
|
|
5390
|
-
|
|
5718
|
+
jn.add(t);
|
|
5719
|
+
const n = t.dataset.plunoPreviewChannel;
|
|
5720
|
+
qi({
|
|
5391
5721
|
token: t.dataset.plunoToken,
|
|
5392
5722
|
tokenEndpoint: t.dataset.plunoTokenEndpoint,
|
|
5393
5723
|
backendUrl: t.dataset.plunoBackendUrl,
|
|
5394
|
-
webSocketFactory:
|
|
5724
|
+
webSocketFactory: n ? $i(n) : void 0,
|
|
5395
5725
|
launcherLabel: t.dataset.plunoLauncherLabel,
|
|
5396
5726
|
accentColor: t.dataset.plunoAccentColor,
|
|
5397
5727
|
colorScheme: t.dataset.plunoColorScheme === "dark" ? "dark" : "light",
|
|
5398
5728
|
fontFamily: t.dataset.plunoFontFamily,
|
|
5399
5729
|
scribbleStyle: t.dataset.plunoScribbleStyle === "true",
|
|
5400
5730
|
position: t.dataset.plunoPosition === "bottom-left" ? "bottom-left" : "bottom-right"
|
|
5401
|
-
}).catch((
|
|
5402
|
-
console.error("Failed to mount Pluno widget",
|
|
5731
|
+
}).catch((o) => {
|
|
5732
|
+
console.error("Failed to mount Pluno widget", o);
|
|
5403
5733
|
});
|
|
5404
5734
|
}
|
|
5405
5735
|
}
|
|
5406
|
-
|
|
5736
|
+
xr(import.meta.url);
|
|
5407
5737
|
export {
|
|
5408
|
-
|
|
5409
|
-
|
|
5738
|
+
$i as createProductAgentPreviewBridgeWebSocketFactory,
|
|
5739
|
+
qi as mountPlunoProductAgentWidget
|
|
5410
5740
|
};
|