@pluno/product-agent-web 0.1.50 → 0.1.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/product-agent-widget.js +1416 -1209
- package/dist/widget.d.ts +4 -0
- package/package.json +1 -1
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { PlunoProductAgent as
|
|
2
|
-
const
|
|
3
|
-
function
|
|
4
|
-
const t =
|
|
5
|
-
if (
|
|
1
|
+
import { PlunoProductAgent as Vn } from "./product-agent-sdk.js";
|
|
2
|
+
const Yn = "#7c3aed", He = "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", Ge = "#2c2a1e", Nt = [253, 250, 241], Dt = 3.5;
|
|
3
|
+
function dn(e) {
|
|
4
|
+
const t = cn(e);
|
|
5
|
+
if (Rt(Te(t), Nt) >= Dt)
|
|
6
6
|
return t;
|
|
7
|
-
let o =
|
|
8
|
-
const
|
|
9
|
-
for (let
|
|
10
|
-
if (o =
|
|
11
|
-
return
|
|
12
|
-
return
|
|
13
|
-
}
|
|
14
|
-
function
|
|
15
|
-
let n = "M 280 120", o = !1,
|
|
16
|
-
for (let
|
|
17
|
-
const l = (
|
|
18
|
-
n += ` L ${p} ${
|
|
7
|
+
let o = Te(t);
|
|
8
|
+
const i = Te(Ge);
|
|
9
|
+
for (let a = 0; a < 6; a += 1)
|
|
10
|
+
if (o = Zn(o, i, 0.22), Rt(o, Nt) >= Dt)
|
|
11
|
+
return st(o);
|
|
12
|
+
return st(o);
|
|
13
|
+
}
|
|
14
|
+
function Kn() {
|
|
15
|
+
let n = "M 280 120", o = !1, i = 0;
|
|
16
|
+
for (let a = 150; a <= 1170; a += 62) {
|
|
17
|
+
const l = (i % 3 - 1) * 18, p = o ? 280 - l : 1020 + l;
|
|
18
|
+
n += ` L ${p} ${a}`, o = !o, i += 1;
|
|
19
19
|
}
|
|
20
20
|
return n;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
const t =
|
|
22
|
+
function Xn(e) {
|
|
23
|
+
const t = cn(e), n = dt(Te(t));
|
|
24
24
|
return n > 0.86 ? {
|
|
25
25
|
top: "#ffffff",
|
|
26
26
|
middle: "#f6f6f6",
|
|
@@ -44,187 +44,187 @@ function Wn(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: K(t, 0.28, -0.03),
|
|
48
|
+
middle: K(t, 0.08, 0.04),
|
|
49
|
+
bottom: K(t, -0.1, 0.02),
|
|
50
|
+
edgeStart: K(t, 0.08, 0.08),
|
|
51
|
+
edgeMiddle: K(t, -0.08, 0.08),
|
|
52
|
+
edgeEnd: K(t, -0.18, 0.05),
|
|
53
|
+
glow: K(t, 0.32, -0.12),
|
|
54
|
+
highlight: K(t, 0.38, -0.18),
|
|
55
|
+
inner: K(t, 0.24, -0.1),
|
|
56
|
+
shadow: K(t, -0.25, -0.08)
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function cn(e) {
|
|
60
60
|
const t = e.trim();
|
|
61
|
-
return /^#[0-9a-f]{6}$/i.test(t) ? t.toLowerCase() : /^#[0-9a-f]{3}$/i.test(t) ? `#${t.slice(1).split("").map((n) => n + n).join("").toLowerCase()}` :
|
|
61
|
+
return /^#[0-9a-f]{6}$/i.test(t) ? t.toLowerCase() : /^#[0-9a-f]{3}$/i.test(t) ? `#${t.slice(1).split("").map((n) => n + n).join("").toLowerCase()}` : Yn;
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function Te(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 o = (
|
|
70
|
+
function st([e, t, n]) {
|
|
71
|
+
const o = (i) => Math.max(0, Math.min(255, Math.round(i))).toString(16).padStart(2, "0");
|
|
72
72
|
return `#${o(e)}${o(t)}${o(n)}`;
|
|
73
73
|
}
|
|
74
|
-
function
|
|
75
|
-
const o = (
|
|
76
|
-
const
|
|
77
|
-
return
|
|
74
|
+
function dt([e, t, n]) {
|
|
75
|
+
const o = (i) => {
|
|
76
|
+
const a = i / 255;
|
|
77
|
+
return a <= 0.04045 ? a / 12.92 : ((a + 0.055) / 1.055) ** 2.4;
|
|
78
78
|
};
|
|
79
79
|
return 0.2126 * o(e) + 0.7152 * o(t) + 0.0722 * o(n);
|
|
80
80
|
}
|
|
81
|
-
function
|
|
82
|
-
const n =
|
|
83
|
-
return (
|
|
81
|
+
function Rt(e, t) {
|
|
82
|
+
const n = dt(e), o = dt(t), [i, a] = n > o ? [n, o] : [o, n];
|
|
83
|
+
return (i + 0.05) / (a + 0.05);
|
|
84
84
|
}
|
|
85
|
-
function
|
|
86
|
-
const o =
|
|
85
|
+
function Zn(e, t, n) {
|
|
86
|
+
const o = ct(n);
|
|
87
87
|
return [
|
|
88
88
|
e[0] + (t[0] - e[0]) * o,
|
|
89
89
|
e[1] + (t[1] - e[1]) * o,
|
|
90
90
|
e[2] + (t[2] - e[2]) * o
|
|
91
91
|
];
|
|
92
92
|
}
|
|
93
|
-
function
|
|
94
|
-
const [o,
|
|
95
|
-
return
|
|
93
|
+
function K(e, t, n) {
|
|
94
|
+
const [o, i, a] = Jn(Te(e));
|
|
95
|
+
return st(Qn(o, ct(i + n), ct(a + t)));
|
|
96
96
|
}
|
|
97
|
-
function
|
|
98
|
-
const o = e / 255,
|
|
97
|
+
function Jn([e, t, n]) {
|
|
98
|
+
const o = e / 255, i = t / 255, a = n / 255, l = Math.max(o, i, a), p = Math.min(o, i, a), c = (l + p) / 2;
|
|
99
99
|
if (l === p)
|
|
100
100
|
return [0, 0, c];
|
|
101
|
-
const u = l - p,
|
|
102
|
-
return [(l === o ? (
|
|
101
|
+
const u = l - p, d = c > 0.5 ? u / (2 - l - p) : u / (l + p);
|
|
102
|
+
return [(l === o ? (i - a) / u + (i < a ? 6 : 0) : l === i ? (a - o) / u + 2 : (o - i) / u + 4) / 6, d, c];
|
|
103
103
|
}
|
|
104
|
-
function
|
|
104
|
+
function Qn(e, t, n) {
|
|
105
105
|
if (t === 0)
|
|
106
106
|
return [n * 255, n * 255, n * 255];
|
|
107
|
-
const o = n < 0.5 ? n * (1 + t) : n + t - n * t,
|
|
107
|
+
const o = n < 0.5 ? n * (1 + t) : n + t - n * t, i = 2 * n - o;
|
|
108
108
|
return [
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
109
|
+
ot(i, o, e + 1 / 3) * 255,
|
|
110
|
+
ot(i, o, e) * 255,
|
|
111
|
+
ot(i, o, e - 1 / 3) * 255
|
|
112
112
|
];
|
|
113
113
|
}
|
|
114
|
-
function
|
|
114
|
+
function ot(e, t, n) {
|
|
115
115
|
let o = n;
|
|
116
116
|
return o < 0 && (o += 1), o > 1 && (o -= 1), o < 1 / 6 ? e + (t - e) * 6 * o : o < 1 / 2 ? t : o < 2 / 3 ? e + (t - e) * (2 / 3 - o) * 6 : e;
|
|
117
117
|
}
|
|
118
|
-
function
|
|
118
|
+
function ct(e) {
|
|
119
119
|
return Math.max(0, Math.min(1, e));
|
|
120
120
|
}
|
|
121
|
-
const
|
|
122
|
-
function
|
|
121
|
+
const un = "suggest_share_on_socials";
|
|
122
|
+
function eo(e) {
|
|
123
123
|
for (let t = e.length - 1; t >= 0; t -= 1) {
|
|
124
124
|
const n = e[t];
|
|
125
|
-
if (n.role !== "tool" || n.toolName !==
|
|
125
|
+
if (n.role !== "tool" || n.toolName !== un)
|
|
126
126
|
continue;
|
|
127
|
-
const o =
|
|
127
|
+
const o = Mt(e, t, "assistant");
|
|
128
128
|
if (!o)
|
|
129
129
|
return null;
|
|
130
|
-
const
|
|
131
|
-
return
|
|
130
|
+
const i = Mt(e, o.index, "user");
|
|
131
|
+
return i ? {
|
|
132
132
|
id: `share:${n.callId ?? n.id}`,
|
|
133
|
-
userPrompt:
|
|
133
|
+
userPrompt: i.content,
|
|
134
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 to(e) {
|
|
140
|
+
const t = await no(e);
|
|
141
141
|
if (!navigator.clipboard || typeof ClipboardItem > "u")
|
|
142
142
|
throw new Error("Image copy is not supported in this browser. Download the screenshot instead.");
|
|
143
143
|
await navigator.clipboard.write([new ClipboardItem({ [t.type || "image/png"]: t })]);
|
|
144
144
|
}
|
|
145
|
-
function
|
|
145
|
+
function Mt(e, t, n) {
|
|
146
146
|
for (let o = t - 1; o >= 0; o -= 1) {
|
|
147
|
-
const
|
|
148
|
-
if (
|
|
149
|
-
return { index: o, content:
|
|
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 no(e) {
|
|
154
154
|
return await (await fetch(e)).blob();
|
|
155
155
|
}
|
|
156
|
-
const
|
|
157
|
-
function
|
|
158
|
-
let n = !1, o = null,
|
|
156
|
+
const oo = "https://app.pluno.ai", io = "/api/product-agent/embed/active-users", ao = 1800, ro = 15e3, lo = 250, po = 1e3, so = 3e4;
|
|
157
|
+
function co(e, t = {}) {
|
|
158
|
+
let n = !1, o = null, i = null, a = null;
|
|
159
159
|
const l = () => {
|
|
160
|
-
|
|
161
|
-
}, p = (
|
|
162
|
-
n || (
|
|
160
|
+
a !== null && (window.clearInterval(a), a = null);
|
|
161
|
+
}, p = (d) => {
|
|
162
|
+
n || (i !== null && window.clearTimeout(i), i = window.setTimeout(() => {
|
|
163
163
|
u();
|
|
164
|
-
},
|
|
165
|
-
}, c = (
|
|
164
|
+
}, ho(d)));
|
|
165
|
+
}, c = (d) => {
|
|
166
166
|
if (l(), o === null) {
|
|
167
|
-
o =
|
|
167
|
+
o = d, e(d);
|
|
168
168
|
return;
|
|
169
169
|
}
|
|
170
|
-
const
|
|
171
|
-
|
|
170
|
+
const h = o, x = performance.now();
|
|
171
|
+
a = window.setInterval(() => {
|
|
172
172
|
if (n) {
|
|
173
173
|
l();
|
|
174
174
|
return;
|
|
175
175
|
}
|
|
176
|
-
const
|
|
177
|
-
o = Math.round(
|
|
178
|
-
},
|
|
176
|
+
const y = Math.min(1, (performance.now() - x) / ao);
|
|
177
|
+
o = Math.round(h + (d - h) * mo(y)), e(o), y >= 1 && (o = d, e(d), l());
|
|
178
|
+
}, lo);
|
|
179
179
|
}, u = async () => {
|
|
180
180
|
try {
|
|
181
|
-
const
|
|
181
|
+
const d = await uo(t);
|
|
182
182
|
if (n)
|
|
183
183
|
return;
|
|
184
|
-
c(
|
|
184
|
+
c(d.count), p(d.refreshAfterMs);
|
|
185
185
|
} catch {
|
|
186
|
-
p(
|
|
186
|
+
p(ro);
|
|
187
187
|
}
|
|
188
188
|
};
|
|
189
189
|
return u(), () => {
|
|
190
|
-
n = !0,
|
|
190
|
+
n = !0, i !== null && window.clearTimeout(i), l();
|
|
191
191
|
};
|
|
192
192
|
}
|
|
193
|
-
async function
|
|
193
|
+
async function uo(e) {
|
|
194
194
|
if (e.loader)
|
|
195
195
|
return e.loader();
|
|
196
|
-
const n = await (e.fetcher ?? fetch)(new URL(
|
|
196
|
+
const n = await (e.fetcher ?? fetch)(new URL(io, go(e.backendUrl ?? oo)).toString(), {
|
|
197
197
|
cache: "no-store",
|
|
198
198
|
credentials: "omit"
|
|
199
199
|
});
|
|
200
200
|
if (!n.ok)
|
|
201
201
|
throw new Error("Failed to load active users");
|
|
202
|
-
const o = await n.json(),
|
|
203
|
-
if (
|
|
202
|
+
const o = await n.json(), i = zt(o.count), a = zt(o.refreshAfterMs ?? o.refresh_after_ms);
|
|
203
|
+
if (i === null || a === null)
|
|
204
204
|
throw new Error("Invalid active users response");
|
|
205
|
-
return { count:
|
|
205
|
+
return { count: i, refreshAfterMs: a };
|
|
206
206
|
}
|
|
207
|
-
function
|
|
207
|
+
function zt(e) {
|
|
208
208
|
return typeof e != "number" || !Number.isFinite(e) || e < 0 ? null : Math.round(e);
|
|
209
209
|
}
|
|
210
|
-
function
|
|
210
|
+
function go(e) {
|
|
211
211
|
return e.endsWith("/") ? e : `${e}/`;
|
|
212
212
|
}
|
|
213
|
-
function
|
|
214
|
-
return Math.min(
|
|
213
|
+
function ho(e) {
|
|
214
|
+
return Math.min(so, Math.max(po, e));
|
|
215
215
|
}
|
|
216
|
-
function
|
|
216
|
+
function mo(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 gn = 100, bo = "product-agent:sdk-preview-socket-connect", fo = "product-agent:sdk-preview-socket-send", wo = "product-agent:sdk-preview-socket-close", _o = "product-agent:sdk-preview-socket-open", xo = "product-agent:sdk-preview-socket-message", yo = "product-agent:sdk-preview-socket-error", vo = "product-agent:sdk-preview-socket-closed", Bt = "product-agent:sdk-preview-socket-id", Co = "data-pluno-sdk-preview-channel", Eo = "product-agent:preview-diagnostic", hn = "pluno.productAgent.sharePromptsDisabled", We = 10, So = 10 * 1024 * 1024, mn = /* @__PURE__ */ new Set([
|
|
220
220
|
"image/png",
|
|
221
221
|
"image/jpeg",
|
|
222
222
|
"image/webp",
|
|
223
223
|
"image/gif",
|
|
224
224
|
"application/pdf"
|
|
225
|
-
]),
|
|
226
|
-
|
|
227
|
-
).join(","),
|
|
225
|
+
]), ko = Array.from(
|
|
226
|
+
mn
|
|
227
|
+
).join(","), Lo = 3, Ao = "No recent chats for this page yet.", Z = {
|
|
228
228
|
launcherLabel: "Ask for anything...",
|
|
229
229
|
accentColor: "#7c3aed",
|
|
230
230
|
colorScheme: "light",
|
|
@@ -232,7 +232,7 @@ const ln = 100, po = "product-agent:sdk-preview-socket-connect", so = "product-a
|
|
|
232
232
|
scribbleStyle: !1,
|
|
233
233
|
position: "bottom-right",
|
|
234
234
|
movableLauncher: !1
|
|
235
|
-
},
|
|
235
|
+
}, Po = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive', Ot = "pluno-pa-scribble-font", bn = 190, fn = 41, Ut = 22, Io = 16, To = 24, No = 1, Do = 48, Ro = 420, Mo = 520, zo = 0.24, Bo = 680, Oo = 800, Uo = 0.76, W = 8, ut = 50, wn = "http://www.w3.org/2000/svg", Ft = 26, Ht = 8, Fo = 36, Gt = [
|
|
236
236
|
{
|
|
237
237
|
ellipseCx: "17.5",
|
|
238
238
|
ellipseCy: "24.5",
|
|
@@ -269,20 +269,20 @@ const ln = 100, po = "product-agent:sdk-preview-socket-connect", so = "product-a
|
|
|
269
269
|
path: "M18.7 26.8 C21 11.2, 7.1 1.6, 6.3 18.1",
|
|
270
270
|
pathStrokeWidth: "2.45"
|
|
271
271
|
}
|
|
272
|
-
],
|
|
273
|
-
let
|
|
274
|
-
function
|
|
275
|
-
return (t) => new
|
|
272
|
+
], Ho = 11, Go = 13, Wt = 4, Wo = 10, $o = 40, qo = "movable-launcher-position-v2", _n = "pluno-pa-widget-styles", xn = "data-pluno-pa-widget-styles";
|
|
273
|
+
let $t = 0;
|
|
274
|
+
function jo(e) {
|
|
275
|
+
return (t) => new oe(t, e);
|
|
276
276
|
}
|
|
277
|
-
async function
|
|
277
|
+
async function Vo(e = {}) {
|
|
278
278
|
const t = {
|
|
279
|
-
launcherLabel: e.launcherLabel ??
|
|
280
|
-
accentColor: e.accentColor ??
|
|
281
|
-
colorScheme: e.colorScheme ??
|
|
282
|
-
fontFamily: e.fontFamily ??
|
|
283
|
-
scribbleStyle: e.scribbleStyle ??
|
|
284
|
-
position: e.position ??
|
|
285
|
-
movableLauncher: e.movableLauncher ??
|
|
279
|
+
launcherLabel: e.launcherLabel ?? Z.launcherLabel,
|
|
280
|
+
accentColor: e.accentColor ?? Z.accentColor,
|
|
281
|
+
colorScheme: e.colorScheme ?? Z.colorScheme,
|
|
282
|
+
fontFamily: e.fontFamily ?? Z.fontFamily,
|
|
283
|
+
scribbleStyle: e.scribbleStyle ?? Z.scribbleStyle,
|
|
284
|
+
position: e.position ?? Z.position,
|
|
285
|
+
movableLauncher: e.movableLauncher ?? Z.movableLauncher,
|
|
286
286
|
token: e.token,
|
|
287
287
|
tokenProvider: e.tokenProvider,
|
|
288
288
|
tokenEndpoint: e.tokenEndpoint,
|
|
@@ -308,9 +308,12 @@ async function Oo(e = {}) {
|
|
|
308
308
|
socialPostRewardsUrl: e.socialPostRewardsUrl,
|
|
309
309
|
loadSharePromptsDisabled: e.loadSharePromptsDisabled,
|
|
310
310
|
persistSharePromptsDisabled: e.persistSharePromptsDisabled,
|
|
311
|
-
sdkPreviewChannelId: e.sdkPreviewChannelId
|
|
311
|
+
sdkPreviewChannelId: e.sdkPreviewChannelId,
|
|
312
|
+
initialDisplayState: e.initialDisplayState,
|
|
313
|
+
onDisplayStateChange: e.onDisplayStateChange,
|
|
314
|
+
showLauncherMinimizeButton: e.showLauncherMinimizeButton === !0
|
|
312
315
|
};
|
|
313
|
-
|
|
316
|
+
X(
|
|
314
317
|
"web-sdk.widget",
|
|
315
318
|
"Mounting widget with merged options",
|
|
316
319
|
{
|
|
@@ -327,99 +330,112 @@ async function Oo(e = {}) {
|
|
|
327
330
|
);
|
|
328
331
|
const n = document.createElement("div");
|
|
329
332
|
n.className = "pluno-pa-widget-host", n.setAttribute("data-pluno-product-agent-ui", "widget"), t.sdkPreviewChannelId && n.setAttribute(
|
|
330
|
-
|
|
333
|
+
Co,
|
|
331
334
|
t.sdkPreviewChannelId
|
|
332
335
|
);
|
|
333
|
-
const o = n.attachShadow({ mode: "open" }),
|
|
334
|
-
|
|
335
|
-
let
|
|
336
|
+
const o = n.attachShadow({ mode: "open" }), i = document.createElement("div");
|
|
337
|
+
i.className = `pluno-pa-widget pluno-pa-widget--${t.position}`, i.setAttribute("data-pluno-product-agent-ui-root", "widget");
|
|
338
|
+
let a = qt(
|
|
336
339
|
t.accentColor,
|
|
337
340
|
t.scribbleStyle
|
|
338
341
|
);
|
|
339
|
-
|
|
340
|
-
|
|
342
|
+
ui(
|
|
343
|
+
i,
|
|
341
344
|
t.launcherLabel,
|
|
345
|
+
a,
|
|
346
|
+
t.movableLauncher,
|
|
347
|
+
t.showLauncherMinimizeButton
|
|
348
|
+
), o.appendChild(i);
|
|
349
|
+
const l = ca(t);
|
|
350
|
+
let p = t.movableLauncher ? l.launcherPosition : null, c = p !== null;
|
|
351
|
+
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"), me(
|
|
342
352
|
i,
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
353
|
+
it(
|
|
354
|
+
i,
|
|
355
|
+
p,
|
|
356
|
+
t.position
|
|
357
|
+
)
|
|
358
|
+
)), rn(o, t.accentColor), jt(i, a, {
|
|
347
359
|
accentColor: t.accentColor,
|
|
348
360
|
colorScheme: t.colorScheme,
|
|
349
361
|
fontFamily: t.fontFamily,
|
|
350
362
|
scribbleStyle: t.scribbleStyle
|
|
351
|
-
})
|
|
363
|
+
});
|
|
364
|
+
const u = await da(), d = u.ownerDocument;
|
|
365
|
+
u.appendChild(n), X(
|
|
352
366
|
"web-sdk.widget",
|
|
353
367
|
"Applied initial widget appearance",
|
|
354
368
|
{
|
|
355
369
|
accentColor: t.accentColor,
|
|
356
370
|
colorScheme: t.colorScheme,
|
|
357
371
|
fontFamily: t.fontFamily,
|
|
358
|
-
cssAccent:
|
|
372
|
+
cssAccent: i.style.getPropertyValue("--pluno-pa-accent")
|
|
359
373
|
}
|
|
360
374
|
);
|
|
361
|
-
const
|
|
375
|
+
const h = i.querySelector(
|
|
362
376
|
".pluno-pa-widget__launcher"
|
|
363
|
-
),
|
|
377
|
+
), x = i.querySelector(
|
|
364
378
|
".pluno-pa-widget__launcher-drag-handle"
|
|
365
|
-
),
|
|
379
|
+
), y = i.querySelector(
|
|
366
380
|
".pluno-pa-widget__launcher-input"
|
|
367
|
-
),
|
|
381
|
+
), P = i.querySelector(
|
|
382
|
+
".pluno-pa-widget__launcher-minimize"
|
|
383
|
+
), T = i.querySelector(".pluno-pa-widget__panel"), f = i.querySelector(
|
|
368
384
|
".pluno-pa-widget__close"
|
|
369
|
-
),
|
|
385
|
+
), E = i.querySelector(
|
|
370
386
|
".pluno-pa-widget__composer"
|
|
371
|
-
),
|
|
387
|
+
), g = i.querySelector(
|
|
372
388
|
".pluno-pa-widget__attachment-error"
|
|
373
|
-
),
|
|
389
|
+
), S = i.querySelector(
|
|
374
390
|
".pluno-pa-widget__billing-status"
|
|
375
|
-
),
|
|
391
|
+
), k = i.querySelector(
|
|
376
392
|
".pluno-pa-widget__attachments"
|
|
377
|
-
),
|
|
393
|
+
), R = i.querySelector(
|
|
378
394
|
".pluno-pa-widget__attachment-input"
|
|
379
|
-
),
|
|
395
|
+
), Ce = i.querySelector(
|
|
380
396
|
".pluno-pa-widget__attach"
|
|
381
|
-
),
|
|
397
|
+
), b = i.querySelector(
|
|
382
398
|
".pluno-pa-widget__input"
|
|
383
|
-
),
|
|
399
|
+
), ie = i.querySelector(
|
|
384
400
|
".pluno-pa-widget__send"
|
|
385
|
-
),
|
|
401
|
+
), ae = i.querySelector(
|
|
386
402
|
".pluno-pa-widget__top-actions"
|
|
387
|
-
),
|
|
403
|
+
), _ = i.querySelector(
|
|
388
404
|
".pluno-pa-widget__history"
|
|
389
|
-
),
|
|
405
|
+
), N = i.querySelector(
|
|
390
406
|
".pluno-pa-widget__history-panel"
|
|
391
|
-
),
|
|
407
|
+
), F = i.querySelector(
|
|
392
408
|
".pluno-pa-widget__history-list"
|
|
393
|
-
),
|
|
409
|
+
), H = i.querySelector(
|
|
394
410
|
".pluno-pa-widget__history-close"
|
|
395
|
-
),
|
|
411
|
+
), L = i.querySelector(
|
|
396
412
|
".pluno-pa-widget__history-status"
|
|
397
|
-
),
|
|
413
|
+
), I = i.querySelector(
|
|
398
414
|
".pluno-pa-widget__timeline-jump"
|
|
399
|
-
), be =
|
|
415
|
+
), be = i.querySelector(
|
|
400
416
|
".pluno-pa-widget__active-users-counter"
|
|
401
|
-
),
|
|
417
|
+
), A = i.querySelector(
|
|
402
418
|
".pluno-pa-widget__timeline"
|
|
403
|
-
),
|
|
419
|
+
), je = i.querySelector(
|
|
404
420
|
".pluno-pa-widget__timeline-bottom-sentinel"
|
|
405
421
|
);
|
|
406
|
-
if (!
|
|
422
|
+
if (!h || !y || !T || !f || !E || !g || !S || !k || !R || !Ce || !b || !ie || !ae || !_ || !N || !F || !H || !L || !I || !be || !A || !je)
|
|
407
423
|
throw new Error("Failed to mount Pluno widget");
|
|
408
|
-
if (t.movableLauncher && !
|
|
424
|
+
if (t.movableLauncher && !x)
|
|
409
425
|
throw new Error("Failed to mount Pluno widget drag handle");
|
|
410
|
-
|
|
411
|
-
let
|
|
412
|
-
const
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
426
|
+
Zt(y), Zt(b);
|
|
427
|
+
let z = [], te = null;
|
|
428
|
+
const fe = () => {
|
|
429
|
+
Ti(
|
|
430
|
+
k,
|
|
431
|
+
z,
|
|
416
432
|
(r) => {
|
|
417
|
-
|
|
418
|
-
(
|
|
419
|
-
),
|
|
433
|
+
z = z.filter(
|
|
434
|
+
(s, C) => C !== r
|
|
435
|
+
), fe(), O(w.getState()), $();
|
|
420
436
|
}
|
|
421
437
|
);
|
|
422
|
-
},
|
|
438
|
+
}, Mn = t.loginRequired || t.signupRequired || t.token || t.webSocketFactory ? void 0 : t.tokenProvider ?? (async () => {
|
|
423
439
|
if (!t.tokenEndpoint)
|
|
424
440
|
throw new Error("Pluno widget requires token or tokenEndpoint");
|
|
425
441
|
const r = await fetch(t.tokenEndpoint, {
|
|
@@ -433,19 +449,19 @@ async function Oo(e = {}) {
|
|
|
433
449
|
});
|
|
434
450
|
if (!r.ok)
|
|
435
451
|
throw new Error("Failed to load Pluno token");
|
|
436
|
-
const
|
|
437
|
-
if (!
|
|
452
|
+
const s = await r.json();
|
|
453
|
+
if (!s.token)
|
|
438
454
|
throw new Error("Pluno token endpoint did not return a token");
|
|
439
|
-
return
|
|
440
|
-
}),
|
|
441
|
-
let
|
|
442
|
-
|
|
455
|
+
return s.token;
|
|
456
|
+
}), zn = window.fetch.bind(window);
|
|
457
|
+
let w;
|
|
458
|
+
w = await Vn.init({
|
|
443
459
|
token: t.token,
|
|
444
|
-
tokenProvider:
|
|
460
|
+
tokenProvider: Mn,
|
|
445
461
|
backendUrl: t.backendUrl,
|
|
446
462
|
metadata: () => ({
|
|
447
463
|
...t.metadata ?? {},
|
|
448
|
-
...!
|
|
464
|
+
...!w.getState().sessionId && t.scribbleStyle ? { scribbleStyleStarted: !0 } : {}
|
|
449
465
|
}),
|
|
450
466
|
initialStarterPrompts: t.initialStarterPrompts,
|
|
451
467
|
clientId: t.clientId,
|
|
@@ -454,248 +470,280 @@ async function Oo(e = {}) {
|
|
|
454
470
|
webSocketFactory: t.webSocketFactory,
|
|
455
471
|
autoConnect: t.loginRequired || t.signupRequired ? !1 : void 0
|
|
456
472
|
});
|
|
457
|
-
const
|
|
458
|
-
|
|
459
|
-
),
|
|
460
|
-
let
|
|
473
|
+
const Ve = new Set(l.openToolGroupKeys), we = new Set(
|
|
474
|
+
l.seenShareCandidateIds
|
|
475
|
+
), Ne = new Set(we);
|
|
476
|
+
let Ye = l.sharePromptsDisabled || await ua(t), j = null, De = !1, de = !1, ce = {
|
|
461
477
|
enabled: !0
|
|
462
|
-
},
|
|
463
|
-
const
|
|
464
|
-
|
|
465
|
-
},
|
|
466
|
-
|
|
467
|
-
},
|
|
468
|
-
|
|
469
|
-
},
|
|
470
|
-
|
|
471
|
-
},
|
|
472
|
-
if (
|
|
478
|
+
}, ue = 0, _t = "", re = !1, ne = !1, le = [], Ke = null, Ee = null;
|
|
479
|
+
const V = (r, s) => {
|
|
480
|
+
ce = { enabled: r, reason: s };
|
|
481
|
+
}, Y = () => {
|
|
482
|
+
I.hidden = !0;
|
|
483
|
+
}, Bn = () => {
|
|
484
|
+
I.hidden = !1;
|
|
485
|
+
}, On = (r = "jump") => {
|
|
486
|
+
V(!0, r), Y(), Ie(A, () => ce.enabled), ue = A.scrollTop;
|
|
487
|
+
}, ge = () => {
|
|
488
|
+
if (_.hidden = t.loginRequired, N.hidden = !re, _.setAttribute("aria-expanded", String(re)), F.classList.toggle(
|
|
473
489
|
"pluno-pa-widget__history-list--center",
|
|
474
|
-
|
|
475
|
-
),
|
|
490
|
+
ne && le.length === 0
|
|
491
|
+
), F.replaceChildren(), ne && le.length === 0) {
|
|
476
492
|
const r = document.createElement("p");
|
|
477
|
-
r.className = "pluno-pa-widget__history-loading", r.textContent = "Loading...",
|
|
478
|
-
}
|
|
479
|
-
for (const r of
|
|
480
|
-
const
|
|
481
|
-
|
|
482
|
-
const
|
|
483
|
-
|
|
484
|
-
const
|
|
485
|
-
|
|
493
|
+
r.className = "pluno-pa-widget__history-loading", r.textContent = "Loading...", F.appendChild(r);
|
|
494
|
+
}
|
|
495
|
+
for (const r of le) {
|
|
496
|
+
const s = document.createElement("button");
|
|
497
|
+
s.type = "button", s.className = "pluno-pa-widget__history-item", s.disabled = ne;
|
|
498
|
+
const C = document.createElement("span");
|
|
499
|
+
C.className = "pluno-pa-widget__history-item-title", C.textContent = si(r);
|
|
500
|
+
const B = document.createElement("time");
|
|
501
|
+
B.className = "pluno-pa-widget__history-time", B.dateTime = r.lastActiveAt, B.textContent = ci(
|
|
486
502
|
r.lastActiveAt,
|
|
487
503
|
Date.now()
|
|
488
504
|
);
|
|
489
|
-
const
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
}),
|
|
505
|
+
const D = document.createElement("small");
|
|
506
|
+
D.className = "pluno-pa-widget__history-path", D.textContent = di(r), s.append(C, B, D), s.addEventListener("click", () => {
|
|
507
|
+
re = !1, Ee = null, ge(), V(!0, "newSession"), Y(), w.loadSession(r.id), O(w.getState());
|
|
508
|
+
}), F.appendChild(s);
|
|
493
509
|
}
|
|
494
|
-
if (
|
|
510
|
+
if (ne && le.length > 0) {
|
|
495
511
|
const r = document.createElement("p");
|
|
496
|
-
r.className = "pluno-pa-widget__history-loading pluno-pa-widget__history-loading--inline", r.textContent = "Loading...",
|
|
512
|
+
r.className = "pluno-pa-widget__history-loading pluno-pa-widget__history-loading--inline", r.textContent = "Loading...", F.appendChild(r);
|
|
497
513
|
}
|
|
498
|
-
|
|
499
|
-
},
|
|
500
|
-
if (!
|
|
501
|
-
|
|
514
|
+
L.textContent = Ee ?? (!ne && le.length === 0 ? "No recent chats for this page yet." : ""), L.hidden = L.textContent.length === 0;
|
|
515
|
+
}, xt = async (r) => {
|
|
516
|
+
if (!ne) {
|
|
517
|
+
ne = !0, Ee = null, ge();
|
|
502
518
|
try {
|
|
503
|
-
const
|
|
504
|
-
|
|
505
|
-
} catch (
|
|
506
|
-
|
|
519
|
+
const s = await w.listSessions({ cursor: r, limit: 20 });
|
|
520
|
+
le = r ? [...le, ...s.sessions] : s.sessions, Ke = s.nextCursor;
|
|
521
|
+
} catch (s) {
|
|
522
|
+
X(
|
|
507
523
|
"web-sdk.widget",
|
|
508
524
|
"Failed to load session history",
|
|
509
525
|
{
|
|
510
|
-
message:
|
|
526
|
+
message: s instanceof Error ? s.message : String(s)
|
|
511
527
|
}
|
|
512
|
-
),
|
|
528
|
+
), Ee = Ao;
|
|
513
529
|
} finally {
|
|
514
|
-
|
|
530
|
+
ne = !1, ge();
|
|
515
531
|
}
|
|
516
532
|
}
|
|
517
|
-
},
|
|
518
|
-
|
|
519
|
-
},
|
|
520
|
-
|
|
521
|
-
},
|
|
522
|
-
|
|
533
|
+
}, Un = () => {
|
|
534
|
+
!Ke || ne || F.scrollHeight - F.scrollTop - F.clientHeight <= 24 && xt(Ke);
|
|
535
|
+
}, Fn = () => {
|
|
536
|
+
De || typeof document > "u" || (rn(o, t.accentColor), n.isConnected || d.body?.appendChild(n));
|
|
537
|
+
}, yt = new MutationObserver(Fn);
|
|
538
|
+
yt.observe(d.documentElement, {
|
|
523
539
|
childList: !0,
|
|
524
540
|
subtree: !0
|
|
525
541
|
});
|
|
526
|
-
const
|
|
527
|
-
const
|
|
528
|
-
return
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
542
|
+
const Xe = (r = !0) => {
|
|
543
|
+
const s = $e(i, r);
|
|
544
|
+
return gt(
|
|
545
|
+
i,
|
|
546
|
+
p ? vn(p, s) : Qo(
|
|
547
|
+
i,
|
|
532
548
|
t.position,
|
|
533
|
-
|
|
549
|
+
s
|
|
534
550
|
),
|
|
535
|
-
|
|
551
|
+
s
|
|
536
552
|
);
|
|
537
|
-
},
|
|
538
|
-
|
|
539
|
-
isOpen:
|
|
540
|
-
composerValue:
|
|
541
|
-
openToolGroupKeys: [...
|
|
542
|
-
launcherPosition:
|
|
543
|
-
seenShareCandidateIds: [...
|
|
544
|
-
-
|
|
553
|
+
}, G = () => {
|
|
554
|
+
ha(t, {
|
|
555
|
+
isOpen: i.classList.contains("pluno-pa-widget--open"),
|
|
556
|
+
composerValue: b.value,
|
|
557
|
+
openToolGroupKeys: [...Ve],
|
|
558
|
+
launcherPosition: c ? p : null,
|
|
559
|
+
seenShareCandidateIds: [...we].slice(
|
|
560
|
+
-gn
|
|
545
561
|
),
|
|
546
|
-
sharePromptsDisabled:
|
|
562
|
+
sharePromptsDisabled: Ye
|
|
547
563
|
});
|
|
548
|
-
},
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
564
|
+
}, Re = (r) => {
|
|
565
|
+
t.onDisplayStateChange?.(r);
|
|
566
|
+
}, Se = (r, s = !0) => {
|
|
567
|
+
if (r === "shown") {
|
|
568
|
+
i.classList.remove("pluno-pa-widget--minimized"), h.removeAttribute("tabindex"), !i.classList.contains("pluno-pa-widget--open") && !i.classList.contains("pluno-pa-widget--closing") && ke(!1), s && Re("shown");
|
|
569
|
+
return;
|
|
570
|
+
}
|
|
571
|
+
j !== null && (window.clearTimeout(j), j = null), i.classList.remove("pluno-pa-widget--open"), i.classList.remove("pluno-pa-widget--closing"), i.classList.add("pluno-pa-widget--minimized"), h.hidden = !1, T.hidden = !0, f.hidden = !0, h.tabIndex = 0, b.value = "", me(
|
|
572
|
+
i,
|
|
573
|
+
it(
|
|
574
|
+
i,
|
|
575
|
+
p,
|
|
576
|
+
t.position
|
|
577
|
+
)
|
|
578
|
+
), Yt(i), G(), s && Re("minimized");
|
|
579
|
+
}, he = (r, s = {}) => {
|
|
580
|
+
ri(r, {
|
|
581
|
+
debugVersion: qo,
|
|
582
|
+
launcherPosition: p,
|
|
583
|
+
rootClasses: i.className,
|
|
553
584
|
rootStyle: {
|
|
554
|
-
left:
|
|
555
|
-
top:
|
|
556
|
-
right:
|
|
557
|
-
bottom:
|
|
585
|
+
left: i.style.left,
|
|
586
|
+
top: i.style.top,
|
|
587
|
+
right: i.style.right,
|
|
588
|
+
bottom: i.style.bottom
|
|
558
589
|
},
|
|
559
|
-
rootRect:
|
|
560
|
-
launcherRect:
|
|
561
|
-
panelRect:
|
|
562
|
-
viewport:
|
|
563
|
-
panelHidden:
|
|
564
|
-
closeHidden:
|
|
565
|
-
...
|
|
590
|
+
rootRect: at(i),
|
|
591
|
+
launcherRect: at(h),
|
|
592
|
+
panelRect: at(T),
|
|
593
|
+
viewport: Q(),
|
|
594
|
+
panelHidden: T.hidden,
|
|
595
|
+
closeHidden: f.hidden,
|
|
596
|
+
...s
|
|
566
597
|
});
|
|
567
|
-
},
|
|
568
|
-
if (!
|
|
569
|
-
return
|
|
570
|
-
const
|
|
571
|
-
return
|
|
572
|
-
visibleLauncherPosition:
|
|
573
|
-
}),
|
|
574
|
-
},
|
|
575
|
-
if (!r || !
|
|
576
|
-
|
|
598
|
+
}, ke = (r = !0) => {
|
|
599
|
+
if (!p)
|
|
600
|
+
return me(i, null), Xe(r);
|
|
601
|
+
const s = Xe(r);
|
|
602
|
+
return me(i, s), he("Applied stored closed launcher position", {
|
|
603
|
+
visibleLauncherPosition: s
|
|
604
|
+
}), s;
|
|
605
|
+
}, vt = (r, s) => {
|
|
606
|
+
if (!r || !s) {
|
|
607
|
+
Yt(i);
|
|
577
608
|
return;
|
|
578
609
|
}
|
|
579
|
-
|
|
580
|
-
x: r.x -
|
|
581
|
-
y: r.y -
|
|
610
|
+
ai(i, {
|
|
611
|
+
x: r.x - s.x,
|
|
612
|
+
y: r.y - s.y
|
|
582
613
|
});
|
|
583
|
-
},
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
614
|
+
}, Ct = () => {
|
|
615
|
+
if (i.classList.contains("pluno-pa-widget--minimized")) {
|
|
616
|
+
me(
|
|
617
|
+
i,
|
|
618
|
+
it(
|
|
619
|
+
i,
|
|
620
|
+
p,
|
|
621
|
+
t.position
|
|
622
|
+
)
|
|
623
|
+
);
|
|
624
|
+
return;
|
|
625
|
+
}
|
|
626
|
+
const r = ke();
|
|
627
|
+
if (i.classList.contains("pluno-pa-widget--open") || i.classList.contains("pluno-pa-widget--closing")) {
|
|
628
|
+
const s = Vt(
|
|
629
|
+
i,
|
|
588
630
|
r,
|
|
589
631
|
t.position
|
|
590
632
|
);
|
|
591
|
-
|
|
633
|
+
vt(s, r), he(
|
|
592
634
|
"Applied open panel position after viewport resize",
|
|
593
|
-
{ openPanelPosition:
|
|
635
|
+
{ openPanelPosition: s }
|
|
594
636
|
);
|
|
595
|
-
} else
|
|
637
|
+
} else p && he(
|
|
596
638
|
"Applied visible launcher position after viewport resize",
|
|
597
639
|
{ visibleLauncherPosition: r }
|
|
598
640
|
);
|
|
599
641
|
};
|
|
600
|
-
let
|
|
642
|
+
let Et = () => {
|
|
601
643
|
};
|
|
602
|
-
window.addEventListener("resize",
|
|
603
|
-
root:
|
|
604
|
-
launcher:
|
|
605
|
-
launcherDragHandle:
|
|
606
|
-
getPosition: () =>
|
|
644
|
+
window.addEventListener("resize", Ct), t.movableLauncher && x ? (ke(), Et = Jo({
|
|
645
|
+
root: i,
|
|
646
|
+
launcher: h,
|
|
647
|
+
launcherDragHandle: x,
|
|
648
|
+
getPosition: () => Xe(),
|
|
607
649
|
setPosition: (r) => {
|
|
608
|
-
const
|
|
609
|
-
|
|
650
|
+
const s = r, C = $e(i), B = gt(
|
|
651
|
+
i,
|
|
610
652
|
r,
|
|
611
|
-
|
|
653
|
+
C
|
|
612
654
|
);
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
),
|
|
617
|
-
requestedPosition:
|
|
655
|
+
p = ti(
|
|
656
|
+
B,
|
|
657
|
+
C
|
|
658
|
+
), me(i, B), he("Dragging closed launcher", {
|
|
659
|
+
requestedPosition: s
|
|
618
660
|
});
|
|
619
661
|
},
|
|
620
662
|
persist: () => {
|
|
621
|
-
|
|
663
|
+
c = !0, G(), he("Persisted closed launcher drag position");
|
|
622
664
|
}
|
|
623
|
-
})) :
|
|
624
|
-
let
|
|
625
|
-
const
|
|
626
|
-
if (!(!t.billingStatusLoader ||
|
|
627
|
-
|
|
665
|
+
})) : me(i, null);
|
|
666
|
+
let Ze = !1;
|
|
667
|
+
const St = async () => {
|
|
668
|
+
if (!(!t.billingStatusLoader || Ze)) {
|
|
669
|
+
Ze = !0;
|
|
628
670
|
try {
|
|
629
671
|
const r = await t.billingStatusLoader();
|
|
630
|
-
|
|
672
|
+
Qt(
|
|
631
673
|
t.billingStatus,
|
|
632
674
|
r,
|
|
633
|
-
|
|
634
|
-
) && (t.billingStatus = r,
|
|
635
|
-
|
|
675
|
+
w.getState().lastErrorCode
|
|
676
|
+
) && (t.billingStatus = r, pt(
|
|
677
|
+
S,
|
|
636
678
|
t.billingStatus,
|
|
637
|
-
|
|
638
|
-
),
|
|
679
|
+
w.getState().lastErrorCode
|
|
680
|
+
), $());
|
|
639
681
|
} finally {
|
|
640
|
-
|
|
682
|
+
Ze = !1;
|
|
641
683
|
}
|
|
642
684
|
}
|
|
643
|
-
},
|
|
644
|
-
|
|
645
|
-
const
|
|
646
|
-
|
|
647
|
-
|
|
685
|
+
}, pe = (r = "", s = !0) => {
|
|
686
|
+
St(), j !== null && (window.clearTimeout(j), j = null), Se("shown", !1), T.hidden = !1, f.hidden = !1, i.classList.remove("pluno-pa-widget--closing");
|
|
687
|
+
const C = ke(), B = Vt(
|
|
688
|
+
i,
|
|
689
|
+
C,
|
|
648
690
|
t.position
|
|
649
691
|
);
|
|
650
|
-
if (
|
|
651
|
-
openPanelPosition:
|
|
652
|
-
visibleLauncherPosition:
|
|
653
|
-
}),
|
|
654
|
-
|
|
692
|
+
if (vt(B, C), he("Opening launcher at clamped open panel position", {
|
|
693
|
+
openPanelPosition: B,
|
|
694
|
+
visibleLauncherPosition: C
|
|
695
|
+
}), V(!0, "open"), Y(), !s) {
|
|
696
|
+
i.classList.add("pluno-pa-widget--open"), h.hidden = !0, r && (b.value = r, Pe(b)), Ie(A, () => ce.enabled), ue = A.scrollTop, b.focus(), b.setSelectionRange(b.value.length, b.value.length), G(), Re("shown");
|
|
655
697
|
return;
|
|
656
698
|
}
|
|
657
699
|
window.requestAnimationFrame(() => {
|
|
658
|
-
|
|
659
|
-
|
|
700
|
+
i.classList.add("pluno-pa-widget--open"), r && (b.value = r, Pe(b)), Ie(A, () => ce.enabled), ue = A.scrollTop, b.focus(), b.setSelectionRange(b.value.length, b.value.length), G(), Re("shown"), j = window.setTimeout(() => {
|
|
701
|
+
h.hidden = !0, Ie(A, () => ce.enabled), ue = A.scrollTop;
|
|
660
702
|
}, 220);
|
|
661
703
|
});
|
|
662
|
-
},
|
|
663
|
-
|
|
664
|
-
|
|
704
|
+
}, Hn = () => {
|
|
705
|
+
j !== null && (window.clearTimeout(j), j = null), h.hidden = !1, p && (ke(!1), he("Closing launcher at stored position")), i.classList.remove("pluno-pa-widget--open"), i.classList.add("pluno-pa-widget--closing"), G(), j = window.setTimeout(() => {
|
|
706
|
+
T.hidden = !0, f.hidden = !0, i.classList.remove("pluno-pa-widget--closing");
|
|
665
707
|
}, 220);
|
|
666
708
|
};
|
|
667
|
-
|
|
668
|
-
r.preventDefault(),
|
|
669
|
-
}),
|
|
709
|
+
h.addEventListener("submit", (r) => {
|
|
710
|
+
r.preventDefault(), pe(y.value), y.value = "";
|
|
711
|
+
}), x?.addEventListener("click", (r) => {
|
|
670
712
|
r.preventDefault(), r.stopPropagation();
|
|
671
|
-
}),
|
|
672
|
-
r.target ===
|
|
673
|
-
}),
|
|
674
|
-
|
|
675
|
-
}),
|
|
676
|
-
if (!
|
|
713
|
+
}), h.addEventListener("click", (r) => {
|
|
714
|
+
r.target === y && !x || (pe(y.value), y.value = "");
|
|
715
|
+
}), y.addEventListener("focus", () => {
|
|
716
|
+
pe(y.value), y.value = "";
|
|
717
|
+
}), y.addEventListener("input", () => {
|
|
718
|
+
if (!y.value)
|
|
677
719
|
return;
|
|
678
|
-
const r =
|
|
679
|
-
|
|
680
|
-
}),
|
|
681
|
-
|
|
682
|
-
}),
|
|
683
|
-
|
|
720
|
+
const r = y.value;
|
|
721
|
+
pe(r), y.value = "";
|
|
722
|
+
}), h.addEventListener("keydown", (r) => {
|
|
723
|
+
!i.classList.contains("pluno-pa-widget--minimized") || r.key !== "Enter" && r.key !== " " || (r.preventDefault(), pe());
|
|
724
|
+
}), P?.addEventListener("pointerdown", (r) => {
|
|
725
|
+
r.stopPropagation();
|
|
726
|
+
}), P?.addEventListener("click", (r) => {
|
|
727
|
+
r.preventDefault(), r.stopPropagation(), Se("minimized");
|
|
728
|
+
}), f.addEventListener("click", Hn), A.addEventListener("scroll", () => {
|
|
729
|
+
A.scrollTop < ue - 1 && V(!1, "userScroll"), ue = A.scrollTop;
|
|
730
|
+
}), I.addEventListener("click", () => {
|
|
731
|
+
On();
|
|
684
732
|
});
|
|
685
|
-
const
|
|
733
|
+
const kt = typeof IntersectionObserver > "u" ? null : new IntersectionObserver(
|
|
686
734
|
([r]) => {
|
|
687
|
-
r?.isIntersecting && (
|
|
735
|
+
r?.isIntersecting && (V(!0, "bottom"), Y());
|
|
688
736
|
},
|
|
689
|
-
{ root:
|
|
737
|
+
{ root: A, threshold: 0 }
|
|
690
738
|
);
|
|
691
|
-
|
|
692
|
-
const
|
|
693
|
-
const r =
|
|
694
|
-
|
|
695
|
-
},
|
|
696
|
-
|
|
739
|
+
kt?.observe(je);
|
|
740
|
+
const Me = () => t.loginRequired || t.signupRequired, Lt = () => {
|
|
741
|
+
const r = Me();
|
|
742
|
+
y.readOnly = r, y.placeholder = r ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : t.launcherLabel, b.placeholder = r ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : Z.launcherLabel, E.hidden = r;
|
|
743
|
+
}, $ = () => {
|
|
744
|
+
ie.disabled = J(t.billingStatus) || !w.getState().isThinking && b.value.trim().length === 0 && z.length === 0, Ce.disabled = Me() || J(t.billingStatus);
|
|
697
745
|
};
|
|
698
|
-
|
|
746
|
+
Lt(), E.addEventListener("submit", (r) => {
|
|
699
747
|
if (r.preventDefault(), t.loginRequired) {
|
|
700
748
|
t.onLoginClick?.();
|
|
701
749
|
return;
|
|
@@ -704,122 +752,122 @@ async function Oo(e = {}) {
|
|
|
704
752
|
t.onSignupClick?.();
|
|
705
753
|
return;
|
|
706
754
|
}
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
),
|
|
755
|
+
J(t.billingStatus) || (de = !0, V(!0, "send"), Y(), z = rt(
|
|
756
|
+
w,
|
|
757
|
+
b,
|
|
758
|
+
z
|
|
759
|
+
), fe(), $());
|
|
712
760
|
});
|
|
713
|
-
let
|
|
714
|
-
const
|
|
715
|
-
|
|
716
|
-
},
|
|
717
|
-
|
|
718
|
-
|
|
761
|
+
let Le = 0;
|
|
762
|
+
const Gn = () => {
|
|
763
|
+
Le = 0, i.classList.remove("pluno-pa-widget--drag-over");
|
|
764
|
+
}, At = (r) => {
|
|
765
|
+
te !== null && window.clearTimeout(te), g.textContent = r, g.hidden = !1, te = window.setTimeout(() => {
|
|
766
|
+
g.textContent = "", g.hidden = !0, te = null;
|
|
719
767
|
}, 3e3);
|
|
720
|
-
},
|
|
721
|
-
|
|
722
|
-
},
|
|
768
|
+
}, Wn = () => {
|
|
769
|
+
te !== null && (window.clearTimeout(te), te = null), g.textContent = "", g.hidden = !0;
|
|
770
|
+
}, Pt = async (r) => {
|
|
723
771
|
if (r.length === 0)
|
|
724
772
|
return;
|
|
725
|
-
const
|
|
726
|
-
if (
|
|
773
|
+
const s = await Mi(r);
|
|
774
|
+
if (z.length + s.length > We)
|
|
727
775
|
throw new Error(
|
|
728
|
-
`Attach up to ${
|
|
776
|
+
`Attach up to ${We} files per message.`
|
|
729
777
|
);
|
|
730
|
-
|
|
778
|
+
z = [...z, ...s], fe(), Wn(), $(), O(w.getState()), i.classList.contains("pluno-pa-widget--open") || pe();
|
|
731
779
|
};
|
|
732
|
-
|
|
733
|
-
t.loginRequired ||
|
|
734
|
-
}),
|
|
735
|
-
const r = Array.from(
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
),
|
|
740
|
-
message:
|
|
780
|
+
Ce.addEventListener("click", () => {
|
|
781
|
+
t.loginRequired || J(t.billingStatus) || R.click();
|
|
782
|
+
}), R.addEventListener("change", () => {
|
|
783
|
+
const r = Array.from(R.files ?? []);
|
|
784
|
+
R.value = "", Pt(r).catch((s) => {
|
|
785
|
+
At(
|
|
786
|
+
s instanceof Error ? s.message : "Failed to attach file"
|
|
787
|
+
), X("web-sdk.widget", "Attachment failed", {
|
|
788
|
+
message: s instanceof Error ? s.message : String(s)
|
|
741
789
|
});
|
|
742
790
|
});
|
|
743
|
-
}),
|
|
744
|
-
!
|
|
745
|
-
}),
|
|
746
|
-
const
|
|
747
|
-
!
|
|
748
|
-
}),
|
|
749
|
-
|
|
750
|
-
}),
|
|
751
|
-
const
|
|
752
|
-
!
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
),
|
|
756
|
-
message:
|
|
791
|
+
}), i.addEventListener("dragenter", (r) => {
|
|
792
|
+
!Oe(r.dataTransfer) || t.loginRequired || (r.preventDefault(), r.stopPropagation(), Le += 1, i.classList.add("pluno-pa-widget--drag-over"));
|
|
793
|
+
}), i.addEventListener("dragover", (r) => {
|
|
794
|
+
const s = r.dataTransfer;
|
|
795
|
+
!Oe(s) || t.loginRequired || (r.preventDefault(), r.stopPropagation(), s.dropEffect = "copy");
|
|
796
|
+
}), i.addEventListener("dragleave", (r) => {
|
|
797
|
+
Oe(r.dataTransfer) && (r.stopPropagation(), Le = Math.max(0, Le - 1), Le === 0 && i.classList.remove("pluno-pa-widget--drag-over"));
|
|
798
|
+
}), i.addEventListener("drop", (r) => {
|
|
799
|
+
const s = r.dataTransfer;
|
|
800
|
+
!Oe(s) || t.loginRequired || (r.preventDefault(), r.stopPropagation(), Gn(), Pt(s.files).catch((C) => {
|
|
801
|
+
At(
|
|
802
|
+
C instanceof Error ? C.message : "Failed to attach file"
|
|
803
|
+
), X("web-sdk.widget", "Attachment failed", {
|
|
804
|
+
message: C instanceof Error ? C.message : String(C)
|
|
757
805
|
});
|
|
758
806
|
}));
|
|
759
|
-
}),
|
|
807
|
+
}), ie.addEventListener("click", () => {
|
|
760
808
|
if (t.loginRequired) {
|
|
761
809
|
t.onLoginClick?.();
|
|
762
810
|
return;
|
|
763
811
|
}
|
|
764
|
-
if (
|
|
765
|
-
|
|
812
|
+
if (w.getState().isThinking) {
|
|
813
|
+
w.stop();
|
|
766
814
|
return;
|
|
767
815
|
}
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
),
|
|
773
|
-
}),
|
|
774
|
-
|
|
775
|
-
}),
|
|
776
|
-
|
|
777
|
-
}),
|
|
778
|
-
|
|
779
|
-
}),
|
|
816
|
+
de = !0, V(!0, "send"), Y(), z = rt(
|
|
817
|
+
w,
|
|
818
|
+
b,
|
|
819
|
+
z
|
|
820
|
+
), fe(), $(), O(w.getState());
|
|
821
|
+
}), _.addEventListener("click", () => {
|
|
822
|
+
re = !re, Ee = null, ge(), re && le.length === 0 && xt(null);
|
|
823
|
+
}), H.addEventListener("click", () => {
|
|
824
|
+
re = !1, ge();
|
|
825
|
+
}), F.addEventListener("scroll", Un), b.addEventListener("input", () => {
|
|
826
|
+
Pe(b), G(), $(), O(w.getState());
|
|
827
|
+
}), b.addEventListener("keydown", (r) => {
|
|
780
828
|
if (!(r.key !== "Enter" || r.shiftKey)) {
|
|
781
829
|
if (r.preventDefault(), t.loginRequired) {
|
|
782
830
|
t.onLoginClick?.();
|
|
783
831
|
return;
|
|
784
832
|
}
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
),
|
|
790
|
-
}
|
|
791
|
-
}),
|
|
792
|
-
(r.target instanceof Element ? r.target : null)?.closest("a[href]") &&
|
|
793
|
-
}),
|
|
794
|
-
const
|
|
795
|
-
let
|
|
833
|
+
de = !0, V(!0, "send"), Y(), z = rt(
|
|
834
|
+
w,
|
|
835
|
+
b,
|
|
836
|
+
z
|
|
837
|
+
), fe(), $(), O(w.getState());
|
|
838
|
+
}
|
|
839
|
+
}), i.addEventListener("click", (r) => {
|
|
840
|
+
(r.target instanceof Element ? r.target : null)?.closest("a[href]") && G();
|
|
841
|
+
}), l.composerValue && (b.value = l.composerValue, Pe(b)), t.initialDisplayState === "minimized" ? Se("minimized", !1) : l.isOpen && pe(b.value, !1);
|
|
842
|
+
const ze = () => a;
|
|
843
|
+
let Je = w.getState().appearance !== null, Be = null, Ae = null, _e = null, It = w.getState().isThinking, xe = null, Qe = null, Tt = () => {
|
|
796
844
|
};
|
|
797
|
-
const
|
|
798
|
-
let
|
|
799
|
-
const
|
|
800
|
-
|
|
801
|
-
},
|
|
845
|
+
const $n = !!t.socialPostDraftHandler;
|
|
846
|
+
let ye = null;
|
|
847
|
+
const qn = () => {
|
|
848
|
+
de = !0, V(!0, "newSession"), Y(), re = !1, ge(), w.startNewSession(), Ve.clear(), b.value = "", z = [], fe(), Pe(b), G(), $(), b.focus(), O(w.getState());
|
|
849
|
+
}, et = (r) => {
|
|
802
850
|
if (!r) {
|
|
803
|
-
|
|
851
|
+
ye?.remove(), ye = null;
|
|
804
852
|
return;
|
|
805
853
|
}
|
|
806
|
-
|
|
854
|
+
ye || (ye = qe(
|
|
807
855
|
"pluno-pa-widget__new-chat",
|
|
808
856
|
"New chat",
|
|
809
|
-
|
|
857
|
+
Ci(),
|
|
810
858
|
!1
|
|
811
|
-
),
|
|
812
|
-
},
|
|
813
|
-
if (
|
|
814
|
-
|
|
859
|
+
), ye.addEventListener("click", qn), ae.insertBefore(ye, _));
|
|
860
|
+
}, O = (r) => {
|
|
861
|
+
if (ge(), wt(r.lastErrorCode) ? xe = r.lastErrorCode : t.billingStatus?.creditsUsed !== null && !J(t.billingStatus) && (xe = null), pt(
|
|
862
|
+
S,
|
|
815
863
|
t.billingStatus,
|
|
816
|
-
|
|
864
|
+
xe
|
|
817
865
|
), t.loginRequired) {
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
866
|
+
on(
|
|
867
|
+
A,
|
|
868
|
+
ie,
|
|
869
|
+
et,
|
|
870
|
+
ze,
|
|
823
871
|
"Log in to use Pluno on this page.",
|
|
824
872
|
t.loginButtonLabel,
|
|
825
873
|
t.loginUrl,
|
|
@@ -828,11 +876,11 @@ async function Oo(e = {}) {
|
|
|
828
876
|
return;
|
|
829
877
|
}
|
|
830
878
|
if (t.signupRequired) {
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
879
|
+
on(
|
|
880
|
+
A,
|
|
881
|
+
ie,
|
|
882
|
+
et,
|
|
883
|
+
ze,
|
|
836
884
|
"Complete signup to unlock your free trial credits.",
|
|
837
885
|
t.signupButtonLabel,
|
|
838
886
|
t.signupUrl,
|
|
@@ -840,70 +888,70 @@ async function Oo(e = {}) {
|
|
|
840
888
|
);
|
|
841
889
|
return;
|
|
842
890
|
}
|
|
843
|
-
const
|
|
844
|
-
|
|
845
|
-
const
|
|
846
|
-
|
|
847
|
-
k,
|
|
891
|
+
const s = li(r), C = s !== _t;
|
|
892
|
+
_t = s;
|
|
893
|
+
const B = de || ce.enabled;
|
|
894
|
+
de = !1, Vi(
|
|
848
895
|
A,
|
|
849
|
-
|
|
850
|
-
|
|
896
|
+
je,
|
|
897
|
+
ie,
|
|
898
|
+
et,
|
|
851
899
|
be,
|
|
852
900
|
r,
|
|
853
|
-
|
|
854
|
-
|
|
901
|
+
Qe,
|
|
902
|
+
Qe !== null && tn(
|
|
855
903
|
r,
|
|
856
|
-
|
|
904
|
+
b.value.trim().length > 0 || z.length > 0
|
|
857
905
|
),
|
|
858
|
-
|
|
859
|
-
() =>
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
(
|
|
864
|
-
|
|
906
|
+
B,
|
|
907
|
+
() => ce.enabled,
|
|
908
|
+
Ve,
|
|
909
|
+
G,
|
|
910
|
+
ze,
|
|
911
|
+
(D) => {
|
|
912
|
+
de = !0, V(!0, "send"), Y(), w.sendMessage(D);
|
|
865
913
|
},
|
|
866
|
-
|
|
867
|
-
dismissedCandidateIds:
|
|
868
|
-
draftingCandidateId:
|
|
869
|
-
error:
|
|
870
|
-
characterIconOptions:
|
|
871
|
-
onSeen: (
|
|
872
|
-
|
|
914
|
+
$n && !Ye ? {
|
|
915
|
+
dismissedCandidateIds: Ne,
|
|
916
|
+
draftingCandidateId: Be,
|
|
917
|
+
error: Ae,
|
|
918
|
+
characterIconOptions: ze(),
|
|
919
|
+
onSeen: (D) => {
|
|
920
|
+
we.add(D.id), G();
|
|
873
921
|
},
|
|
874
|
-
onDraft: (
|
|
875
|
-
|
|
922
|
+
onDraft: (D) => {
|
|
923
|
+
jn(D);
|
|
876
924
|
},
|
|
877
|
-
onDismiss: (
|
|
878
|
-
|
|
925
|
+
onDismiss: (D) => {
|
|
926
|
+
we.add(D.id), Ne.add(D.id), G(), Ae = null, O(w.getState());
|
|
879
927
|
},
|
|
880
|
-
onDisable: (
|
|
881
|
-
|
|
928
|
+
onDisable: (D) => {
|
|
929
|
+
Ye = !0, we.add(D.id), Ne.add(D.id), G(), ga(t, !0), Ae = null, O(w.getState());
|
|
882
930
|
}
|
|
883
931
|
} : void 0
|
|
884
|
-
),
|
|
932
|
+
), B ? (ue = A.scrollTop, Y()) : C && pi(r) && Bn();
|
|
885
933
|
};
|
|
886
|
-
return
|
|
934
|
+
return Tt = co(
|
|
887
935
|
(r) => {
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
) &&
|
|
936
|
+
Qe = r, !De && tn(
|
|
937
|
+
w.getState(),
|
|
938
|
+
b.value.trim().length > 0 || z.length > 0
|
|
939
|
+
) && O(w.getState());
|
|
892
940
|
},
|
|
893
941
|
{
|
|
894
942
|
backendUrl: t.backendUrl,
|
|
895
|
-
fetcher:
|
|
943
|
+
fetcher: zn,
|
|
896
944
|
loader: t.activeUsersLoader
|
|
897
945
|
}
|
|
898
|
-
),
|
|
899
|
-
const
|
|
900
|
-
|
|
946
|
+
), w.on("state", (r) => {
|
|
947
|
+
const s = It && !r.isThinking;
|
|
948
|
+
It = r.isThinking, r.appearance ? (Je = !0, X(
|
|
901
949
|
"web-sdk.widget",
|
|
902
950
|
"Agent state supplied appearance",
|
|
903
951
|
{
|
|
904
952
|
appearance: r.appearance
|
|
905
953
|
}
|
|
906
|
-
),
|
|
954
|
+
), tt(r.appearance, "agent.state.appearance")) : Je && (Je = !1, X(
|
|
907
955
|
"web-sdk.widget",
|
|
908
956
|
"Agent state cleared appearance; reverting to configured widget options",
|
|
909
957
|
{
|
|
@@ -911,94 +959,101 @@ async function Oo(e = {}) {
|
|
|
911
959
|
fallbackColorScheme: t.colorScheme,
|
|
912
960
|
fallbackFontFamily: t.fontFamily
|
|
913
961
|
}
|
|
914
|
-
),
|
|
915
|
-
}),
|
|
916
|
-
agent:
|
|
962
|
+
), tt({}, "agent.state.appearance-cleared")), O(r), $(), s && St();
|
|
963
|
+
}), O(w.getState()), $(), {
|
|
964
|
+
agent: w,
|
|
917
965
|
updateAppearance: (r) => {
|
|
918
|
-
r.scribbleStyle !== void 0 && (t.scribbleStyle = r.scribbleStyle),
|
|
966
|
+
r.scribbleStyle !== void 0 && (t.scribbleStyle = r.scribbleStyle), tt(r, "widgetHandle.updateAppearance");
|
|
919
967
|
},
|
|
920
968
|
updateBillingStatus: (r) => {
|
|
921
|
-
const
|
|
922
|
-
|
|
969
|
+
const s = r ?? null;
|
|
970
|
+
Qt(
|
|
923
971
|
t.billingStatus,
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
) && (t.billingStatus =
|
|
927
|
-
|
|
972
|
+
s,
|
|
973
|
+
xe
|
|
974
|
+
) && (t.billingStatus = s, t.billingStatus?.creditsUsed !== null && !J(t.billingStatus) && (xe = null), pt(
|
|
975
|
+
i.querySelector(".pluno-pa-widget__billing-status"),
|
|
928
976
|
t.billingStatus,
|
|
929
|
-
|
|
930
|
-
),
|
|
977
|
+
xe
|
|
978
|
+
), $());
|
|
931
979
|
},
|
|
932
980
|
updateAuthGate: (r) => {
|
|
933
|
-
const
|
|
934
|
-
t.loginRequired = r.loginRequired === !0, t.signupRequired = r.signupRequired === !0, r.loginButtonLabel !== void 0 && (t.loginButtonLabel = r.loginButtonLabel), r.loginUrl !== void 0 && (t.loginUrl = r.loginUrl), r.signupButtonLabel !== void 0 && (t.signupButtonLabel = r.signupButtonLabel), r.signupUrl !== void 0 && (t.signupUrl = r.signupUrl),
|
|
935
|
-
|
|
981
|
+
const s = Me();
|
|
982
|
+
t.loginRequired = r.loginRequired === !0, t.signupRequired = r.signupRequired === !0, r.loginButtonLabel !== void 0 && (t.loginButtonLabel = r.loginButtonLabel), r.loginUrl !== void 0 && (t.loginUrl = r.loginUrl), r.signupButtonLabel !== void 0 && (t.signupButtonLabel = r.signupButtonLabel), r.signupUrl !== void 0 && (t.signupUrl = r.signupUrl), Lt(), O(w.getState()), $(), s && !Me() && w.connect().catch((C) => {
|
|
983
|
+
X(
|
|
936
984
|
"web-sdk.widget",
|
|
937
985
|
"Failed to connect after auth gate cleared",
|
|
938
986
|
{
|
|
939
|
-
message:
|
|
987
|
+
message: C instanceof Error ? C.message : String(C)
|
|
940
988
|
}
|
|
941
989
|
);
|
|
942
990
|
});
|
|
943
991
|
},
|
|
944
992
|
openPanel: () => {
|
|
945
|
-
|
|
993
|
+
pe(b.value, !1);
|
|
994
|
+
},
|
|
995
|
+
updateDisplayState: (r) => {
|
|
996
|
+
if (r === "shown") {
|
|
997
|
+
Se("shown", !1);
|
|
998
|
+
return;
|
|
999
|
+
}
|
|
1000
|
+
Se("minimized", !1);
|
|
946
1001
|
},
|
|
947
1002
|
destroy: () => {
|
|
948
|
-
|
|
1003
|
+
De || (De = !0, yt.disconnect(), kt?.disconnect(), window.removeEventListener("resize", Ct), Et(), te !== null && window.clearTimeout(te), Tt(), _e?.remove(), w.destroy(), n.remove());
|
|
949
1004
|
}
|
|
950
1005
|
};
|
|
951
|
-
async function
|
|
952
|
-
if (!
|
|
953
|
-
|
|
1006
|
+
async function jn(r) {
|
|
1007
|
+
if (!Be) {
|
|
1008
|
+
Be = r.id, Ae = null, O(w.getState());
|
|
954
1009
|
try {
|
|
955
1010
|
if (!t.socialPostDraftHandler)
|
|
956
1011
|
throw new Error("Social post drafting is not available here.");
|
|
957
|
-
const
|
|
958
|
-
if (!
|
|
1012
|
+
const s = await t.socialPostDraftHandler(r);
|
|
1013
|
+
if (!s.linkedinPost || !s.xPost)
|
|
959
1014
|
throw new Error("Pluno did not return a complete social post draft.");
|
|
960
|
-
|
|
1015
|
+
we.add(r.id), Ne.add(r.id), G(), _e?.remove(), _e = Ji(s, {
|
|
961
1016
|
socialPostRewardsUrl: t.socialPostRewardsUrl,
|
|
962
1017
|
onClose: () => {
|
|
963
|
-
|
|
1018
|
+
_e?.remove(), _e = null;
|
|
964
1019
|
}
|
|
965
|
-
}),
|
|
966
|
-
} catch (
|
|
967
|
-
|
|
1020
|
+
}), i.appendChild(_e);
|
|
1021
|
+
} catch (s) {
|
|
1022
|
+
Ae = s instanceof Error ? s.message : "Could not draft social post.";
|
|
968
1023
|
} finally {
|
|
969
|
-
|
|
1024
|
+
Be = null, O(w.getState());
|
|
970
1025
|
}
|
|
971
1026
|
}
|
|
972
1027
|
}
|
|
973
|
-
function
|
|
974
|
-
const
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
),
|
|
979
|
-
accentColor:
|
|
980
|
-
colorScheme:
|
|
981
|
-
fontFamily:
|
|
982
|
-
scribbleStyle:
|
|
983
|
-
}),
|
|
984
|
-
source:
|
|
1028
|
+
function tt(r, s) {
|
|
1029
|
+
const C = r.accentColor ?? t.accentColor, B = r.colorScheme ?? t.colorScheme, D = r.fontFamily ?? t.fontFamily, nt = r.scribbleStyle ?? t.scribbleStyle;
|
|
1030
|
+
a = qt(
|
|
1031
|
+
C,
|
|
1032
|
+
nt
|
|
1033
|
+
), jt(i, a, {
|
|
1034
|
+
accentColor: C,
|
|
1035
|
+
colorScheme: B,
|
|
1036
|
+
fontFamily: D,
|
|
1037
|
+
scribbleStyle: nt
|
|
1038
|
+
}), X("web-sdk.widget", "Updated widget appearance", {
|
|
1039
|
+
source: s,
|
|
985
1040
|
inputAppearance: r,
|
|
986
|
-
appliedAccentColor:
|
|
987
|
-
appliedColorScheme:
|
|
988
|
-
appliedFontFamily:
|
|
989
|
-
appliedScribbleStyle:
|
|
990
|
-
cssAccent:
|
|
1041
|
+
appliedAccentColor: C,
|
|
1042
|
+
appliedColorScheme: B,
|
|
1043
|
+
appliedFontFamily: D,
|
|
1044
|
+
appliedScribbleStyle: nt,
|
|
1045
|
+
cssAccent: i.style.getPropertyValue("--pluno-pa-accent")
|
|
991
1046
|
});
|
|
992
1047
|
}
|
|
993
1048
|
}
|
|
994
|
-
function
|
|
1049
|
+
function qt(e, t) {
|
|
995
1050
|
return { accentColor: e, scribbleStyle: t };
|
|
996
1051
|
}
|
|
997
|
-
function
|
|
998
|
-
const t =
|
|
999
|
-
return t === null ? "#fafafa" :
|
|
1052
|
+
function Yo(e) {
|
|
1053
|
+
const t = Ko(e);
|
|
1054
|
+
return t === null ? "#fafafa" : Xo(t) > 0.5 ? "#18181b" : "#fafaf9";
|
|
1000
1055
|
}
|
|
1001
|
-
function
|
|
1056
|
+
function Ko(e) {
|
|
1002
1057
|
const t = e.trim();
|
|
1003
1058
|
return /^#[0-9a-f]{6}$/i.test(t) ? [
|
|
1004
1059
|
Number.parseInt(t.slice(1, 3), 16),
|
|
@@ -1010,14 +1065,14 @@ function Fo(e) {
|
|
|
1010
1065
|
Number.parseInt(t[3] + t[3], 16)
|
|
1011
1066
|
] : null;
|
|
1012
1067
|
}
|
|
1013
|
-
function
|
|
1014
|
-
const o = (
|
|
1015
|
-
const
|
|
1016
|
-
return
|
|
1068
|
+
function Xo([e, t, n]) {
|
|
1069
|
+
const o = (i) => {
|
|
1070
|
+
const a = i / 255;
|
|
1071
|
+
return a <= 0.03928 ? a / 12.92 : ((a + 0.055) / 1.055) ** 2.4;
|
|
1017
1072
|
};
|
|
1018
1073
|
return 0.2126 * o(e) + 0.7152 * o(t) + 0.0722 * o(n);
|
|
1019
1074
|
}
|
|
1020
|
-
function
|
|
1075
|
+
function jt(e, t, n) {
|
|
1021
1076
|
e.classList.toggle(
|
|
1022
1077
|
"pluno-pa-widget--dark",
|
|
1023
1078
|
n.colorScheme === "dark"
|
|
@@ -1025,27 +1080,27 @@ function zt(e, t, n) {
|
|
|
1025
1080
|
"pluno-pa-widget--light",
|
|
1026
1081
|
n.colorScheme !== "dark"
|
|
1027
1082
|
), e.classList.toggle("pluno-pa-widget--scribble", n.scribbleStyle);
|
|
1028
|
-
const o = n.scribbleStyle ?
|
|
1083
|
+
const o = n.scribbleStyle ? dn(n.accentColor) : n.accentColor;
|
|
1029
1084
|
e.style.setProperty("--pluno-pa-accent", o), n.scribbleStyle ? e.style.setProperty(
|
|
1030
1085
|
"--pluno-pa-accent-contrast",
|
|
1031
|
-
|
|
1032
|
-
) : e.style.removeProperty("--pluno-pa-accent-contrast"), e.style.fontFamily = n.scribbleStyle ?
|
|
1033
|
-
const
|
|
1086
|
+
Yo(o)
|
|
1087
|
+
) : e.style.removeProperty("--pluno-pa-accent-contrast"), e.style.fontFamily = n.scribbleStyle ? Po : n.fontFamily, n.scribbleStyle && Zo(e.ownerDocument);
|
|
1088
|
+
const i = Array.from(
|
|
1034
1089
|
e.querySelectorAll(".pluno-pa-widget__character")
|
|
1035
1090
|
);
|
|
1036
|
-
for (const
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
Array.from(
|
|
1091
|
+
for (const a of i)
|
|
1092
|
+
a.replaceWith(
|
|
1093
|
+
se(
|
|
1094
|
+
Array.from(a.classList).join(" "),
|
|
1040
1095
|
t
|
|
1041
1096
|
)
|
|
1042
1097
|
);
|
|
1043
1098
|
}
|
|
1044
|
-
function
|
|
1045
|
-
if (e.getElementById(
|
|
1099
|
+
function Zo(e) {
|
|
1100
|
+
if (e.getElementById(Ot))
|
|
1046
1101
|
return;
|
|
1047
1102
|
const t = e.createElement("style");
|
|
1048
|
-
t.id =
|
|
1103
|
+
t.id = Ot, t.textContent = `@font-face {
|
|
1049
1104
|
font-family: "Architects Daughter";
|
|
1050
1105
|
font-style: normal;
|
|
1051
1106
|
font-weight: 400;
|
|
@@ -1053,180 +1108,201 @@ function Go(e) {
|
|
|
1053
1108
|
src: url("https://fonts.gstatic.com/s/architectsdaughter/v20/KtkxAKiDZI_td1Lkx62xHZHDtgO_Y-bvTYlg4-7jA-U.woff2") format("woff2");
|
|
1054
1109
|
}`, e.head.appendChild(t), e.fonts?.load('16px "Architects Daughter"');
|
|
1055
1110
|
}
|
|
1056
|
-
function
|
|
1111
|
+
function Jo({
|
|
1057
1112
|
root: e,
|
|
1058
1113
|
launcher: t,
|
|
1059
1114
|
launcherDragHandle: n,
|
|
1060
1115
|
getPosition: o,
|
|
1061
|
-
setPosition:
|
|
1062
|
-
persist:
|
|
1116
|
+
setPosition: i,
|
|
1117
|
+
persist: a
|
|
1063
1118
|
}) {
|
|
1064
|
-
let l = null, p = null, c = null, u = !1,
|
|
1065
|
-
const
|
|
1119
|
+
let l = null, p = null, c = null, u = !1, d = null;
|
|
1120
|
+
const h = () => {
|
|
1066
1121
|
l = null, p = null, c = null, u = !1, e.classList.remove("pluno-pa-widget--dragging");
|
|
1067
|
-
},
|
|
1068
|
-
e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing") || (
|
|
1069
|
-
},
|
|
1070
|
-
if (l !==
|
|
1122
|
+
}, x = (g) => {
|
|
1123
|
+
e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing") || (g.preventDefault(), g.stopPropagation(), l = g.pointerId, p = { x: g.clientX, y: g.clientY }, c = o(), u = !1, t.setPointerCapture?.(g.pointerId));
|
|
1124
|
+
}, y = (g) => {
|
|
1125
|
+
if (l !== g.pointerId || !p || !c)
|
|
1071
1126
|
return;
|
|
1072
|
-
|
|
1073
|
-
const
|
|
1074
|
-
!u && Math.hypot(
|
|
1075
|
-
},
|
|
1076
|
-
l ===
|
|
1077
|
-
},
|
|
1078
|
-
l ===
|
|
1079
|
-
},
|
|
1080
|
-
if (!
|
|
1127
|
+
g.preventDefault();
|
|
1128
|
+
const S = g.clientX - p.x, k = g.clientY - p.y;
|
|
1129
|
+
!u && Math.hypot(S, k) < Wt || (u = !0, e.classList.add("pluno-pa-widget--dragging"), i({ x: c.x + S, y: c.y + k }));
|
|
1130
|
+
}, P = (g) => {
|
|
1131
|
+
l === g.pointerId && (g.preventDefault(), g.stopPropagation(), u && (d = { x: g.clientX, y: g.clientY }, a()), h());
|
|
1132
|
+
}, T = (g) => {
|
|
1133
|
+
l === g.pointerId && (g.preventDefault(), h());
|
|
1134
|
+
}, f = (g) => {
|
|
1135
|
+
if (!d)
|
|
1081
1136
|
return;
|
|
1082
|
-
const
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
) <=
|
|
1086
|
-
|
|
1087
|
-
},
|
|
1137
|
+
const S = Math.hypot(
|
|
1138
|
+
g.clientX - d.x,
|
|
1139
|
+
g.clientY - d.y
|
|
1140
|
+
) <= Wt;
|
|
1141
|
+
d = null, S && (g.preventDefault(), g.stopPropagation());
|
|
1142
|
+
}, E = (g) => {
|
|
1088
1143
|
if (e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing"))
|
|
1089
1144
|
return;
|
|
1090
|
-
const
|
|
1091
|
-
let
|
|
1092
|
-
|
|
1145
|
+
const S = g.shiftKey ? $o : Wo, k = o();
|
|
1146
|
+
let R = null;
|
|
1147
|
+
g.key === "ArrowUp" ? R = { x: k.x, y: k.y - S } : g.key === "ArrowDown" ? R = { x: k.x, y: k.y + S } : g.key === "ArrowLeft" ? R = { x: k.x - S, y: k.y } : g.key === "ArrowRight" && (R = { x: k.x + S, y: k.y }), R && (g.preventDefault(), g.stopPropagation(), i(R), a());
|
|
1093
1148
|
};
|
|
1094
|
-
return t.addEventListener("pointerdown",
|
|
1095
|
-
t.removeEventListener("pointerdown",
|
|
1149
|
+
return t.addEventListener("pointerdown", x), t.addEventListener("pointermove", y), t.addEventListener("pointerup", P), t.addEventListener("pointercancel", T), t.addEventListener("click", f, !0), n.addEventListener("keydown", E), () => {
|
|
1150
|
+
t.removeEventListener("pointerdown", x), t.removeEventListener("pointermove", y), t.removeEventListener("pointerup", P), t.removeEventListener("pointercancel", T), t.removeEventListener("click", f, !0), n.removeEventListener("keydown", E);
|
|
1096
1151
|
};
|
|
1097
1152
|
}
|
|
1098
|
-
function
|
|
1099
|
-
const n =
|
|
1153
|
+
function $e(e, t = !0) {
|
|
1154
|
+
const n = Q();
|
|
1155
|
+
if (e.classList.contains("pluno-pa-widget--minimized"))
|
|
1156
|
+
return e.classList.contains("pluno-pa-widget--scribble") ? {
|
|
1157
|
+
width: Io,
|
|
1158
|
+
height: To
|
|
1159
|
+
} : { width: Ut, height: Ut };
|
|
1160
|
+
const o = e.getBoundingClientRect(), i = !e.classList.contains("pluno-pa-widget--open") && !e.classList.contains("pluno-pa-widget--closing");
|
|
1100
1161
|
return {
|
|
1101
|
-
width: t &&
|
|
1102
|
-
height: t &&
|
|
1162
|
+
width: t && i && o.width > 0 ? o.width : Math.min(bn, n.width - 36),
|
|
1163
|
+
height: t && i && o.height > 0 ? o.height : e.classList.contains("pluno-pa-widget--scribble") ? Do : fn
|
|
1103
1164
|
};
|
|
1104
1165
|
}
|
|
1105
|
-
function
|
|
1106
|
-
const e =
|
|
1166
|
+
function yn() {
|
|
1167
|
+
const e = Q();
|
|
1107
1168
|
return {
|
|
1108
1169
|
width: Math.min(
|
|
1109
|
-
|
|
1110
|
-
e.width *
|
|
1111
|
-
|
|
1112
|
-
|
|
1170
|
+
ve(
|
|
1171
|
+
e.width * zo,
|
|
1172
|
+
Ro,
|
|
1173
|
+
Mo
|
|
1113
1174
|
),
|
|
1114
|
-
e.width -
|
|
1175
|
+
e.width - W * 2
|
|
1115
1176
|
),
|
|
1116
1177
|
height: Math.min(
|
|
1117
|
-
|
|
1118
|
-
e.height *
|
|
1119
|
-
|
|
1120
|
-
|
|
1178
|
+
ve(
|
|
1179
|
+
e.height * Uo,
|
|
1180
|
+
Bo,
|
|
1181
|
+
Oo
|
|
1121
1182
|
),
|
|
1122
|
-
e.height -
|
|
1183
|
+
e.height - ut - W
|
|
1123
1184
|
)
|
|
1124
1185
|
};
|
|
1125
1186
|
}
|
|
1126
|
-
function
|
|
1127
|
-
const o = Number.parseFloat(e.style.left),
|
|
1128
|
-
if (Number.isFinite(o) && Number.isFinite(
|
|
1129
|
-
return { x: o, y:
|
|
1130
|
-
const
|
|
1131
|
-
if (
|
|
1132
|
-
return { x:
|
|
1133
|
-
const l =
|
|
1187
|
+
function Qo(e, t, n) {
|
|
1188
|
+
const o = Number.parseFloat(e.style.left), i = Number.parseFloat(e.style.top);
|
|
1189
|
+
if (Number.isFinite(o) && Number.isFinite(i))
|
|
1190
|
+
return { x: o, y: i };
|
|
1191
|
+
const a = e.getBoundingClientRect();
|
|
1192
|
+
if (a.width > 0 || a.height > 0)
|
|
1193
|
+
return { x: a.left, y: a.top };
|
|
1194
|
+
const l = Q();
|
|
1134
1195
|
return {
|
|
1135
1196
|
x: t === "bottom-left" ? 26 : l.width - 26 - n.width,
|
|
1136
1197
|
y: l.height - 24 - n.height
|
|
1137
1198
|
};
|
|
1138
1199
|
}
|
|
1139
|
-
function
|
|
1140
|
-
const o =
|
|
1200
|
+
function it(e, t, n) {
|
|
1201
|
+
const o = $e(e, !1);
|
|
1202
|
+
return t ? gt(
|
|
1203
|
+
e,
|
|
1204
|
+
vn(t, o),
|
|
1205
|
+
o
|
|
1206
|
+
) : ei(n === "bottom-left" ? "bottom-left" : "bottom-right", o, No);
|
|
1207
|
+
}
|
|
1208
|
+
function ei(e, t, n) {
|
|
1209
|
+
const o = Q();
|
|
1210
|
+
return {
|
|
1211
|
+
x: e.endsWith("right") ? Math.max(0, o.width - t.width - n) : n,
|
|
1212
|
+
y: e.startsWith("bottom") ? Math.max(0, o.height - t.height - n) : n
|
|
1213
|
+
};
|
|
1214
|
+
}
|
|
1215
|
+
function gt(e, t, n) {
|
|
1216
|
+
const o = Q(), i = W + oi(e);
|
|
1141
1217
|
return {
|
|
1142
|
-
x:
|
|
1218
|
+
x: ve(
|
|
1143
1219
|
t.x,
|
|
1144
|
-
|
|
1220
|
+
W,
|
|
1145
1221
|
Math.max(
|
|
1146
|
-
|
|
1147
|
-
o.width - n.width -
|
|
1222
|
+
W,
|
|
1223
|
+
o.width - n.width - W
|
|
1148
1224
|
)
|
|
1149
1225
|
),
|
|
1150
|
-
y:
|
|
1226
|
+
y: ve(
|
|
1151
1227
|
t.y,
|
|
1152
|
-
|
|
1228
|
+
i,
|
|
1153
1229
|
Math.max(
|
|
1154
|
-
|
|
1155
|
-
o.height - n.height -
|
|
1230
|
+
i,
|
|
1231
|
+
o.height - n.height - W
|
|
1156
1232
|
)
|
|
1157
1233
|
)
|
|
1158
1234
|
};
|
|
1159
1235
|
}
|
|
1160
|
-
function
|
|
1161
|
-
const n =
|
|
1236
|
+
function vn(e, t) {
|
|
1237
|
+
const n = Q();
|
|
1162
1238
|
return {
|
|
1163
1239
|
x: e.anchor.endsWith("right") ? n.width - t.width - e.x : e.x,
|
|
1164
1240
|
y: e.anchor.startsWith("bottom") ? n.height - t.height - e.y : e.y
|
|
1165
1241
|
};
|
|
1166
1242
|
}
|
|
1167
|
-
function
|
|
1168
|
-
const n =
|
|
1243
|
+
function ti(e, t) {
|
|
1244
|
+
const n = ni(e, t), o = Q();
|
|
1169
1245
|
return {
|
|
1170
1246
|
anchor: n,
|
|
1171
1247
|
x: n.endsWith("right") ? o.width - e.x - t.width : e.x,
|
|
1172
1248
|
y: n.startsWith("bottom") ? o.height - e.y - t.height : e.y
|
|
1173
1249
|
};
|
|
1174
1250
|
}
|
|
1175
|
-
function
|
|
1176
|
-
const n =
|
|
1177
|
-
return `${
|
|
1251
|
+
function ni(e, t) {
|
|
1252
|
+
const n = Q(), o = e.x + t.width / 2, a = e.y + t.height / 2 <= n.height / 2 ? "top" : "bottom", l = o <= n.width / 2 ? "left" : "right";
|
|
1253
|
+
return `${a}-${l}`;
|
|
1178
1254
|
}
|
|
1179
|
-
function
|
|
1180
|
-
return e.classList.contains("pluno-pa-widget--scribble") ?
|
|
1255
|
+
function oi(e) {
|
|
1256
|
+
return e.classList.contains("pluno-pa-widget--scribble") ? Go : Ho;
|
|
1181
1257
|
}
|
|
1182
|
-
function
|
|
1183
|
-
const o =
|
|
1184
|
-
x: n === "bottom-left" ? t.x : t.x + o.width -
|
|
1185
|
-
y: t.y + o.height -
|
|
1258
|
+
function Vt(e, t, n) {
|
|
1259
|
+
const o = $e(e), i = yn(), a = {
|
|
1260
|
+
x: n === "bottom-left" ? t.x : t.x + o.width - i.width,
|
|
1261
|
+
y: t.y + o.height - i.height
|
|
1186
1262
|
};
|
|
1187
|
-
return
|
|
1263
|
+
return ii(a);
|
|
1188
1264
|
}
|
|
1189
|
-
function
|
|
1190
|
-
const t =
|
|
1265
|
+
function ii(e) {
|
|
1266
|
+
const t = Q(), n = yn();
|
|
1191
1267
|
return {
|
|
1192
|
-
x:
|
|
1268
|
+
x: ve(
|
|
1193
1269
|
e.x,
|
|
1194
|
-
|
|
1270
|
+
W,
|
|
1195
1271
|
Math.max(
|
|
1196
|
-
|
|
1197
|
-
t.width - n.width -
|
|
1272
|
+
W,
|
|
1273
|
+
t.width - n.width - W
|
|
1198
1274
|
)
|
|
1199
1275
|
),
|
|
1200
|
-
y:
|
|
1276
|
+
y: ve(
|
|
1201
1277
|
e.y,
|
|
1202
|
-
|
|
1278
|
+
ut,
|
|
1203
1279
|
Math.max(
|
|
1204
|
-
|
|
1205
|
-
t.height - n.height -
|
|
1280
|
+
ut,
|
|
1281
|
+
t.height - n.height - W
|
|
1206
1282
|
)
|
|
1207
1283
|
)
|
|
1208
1284
|
};
|
|
1209
1285
|
}
|
|
1210
|
-
function
|
|
1286
|
+
function me(e, t) {
|
|
1211
1287
|
if (e.classList.toggle("pluno-pa-widget--custom-position", t !== null), !t) {
|
|
1212
1288
|
e.style.removeProperty("left"), e.style.removeProperty("top"), e.style.removeProperty("right"), e.style.removeProperty("bottom");
|
|
1213
1289
|
return;
|
|
1214
1290
|
}
|
|
1215
1291
|
e.style.left = `${t.x}px`, e.style.top = `${t.y}px`, e.style.right = "auto", e.style.bottom = "auto";
|
|
1216
1292
|
}
|
|
1217
|
-
function
|
|
1293
|
+
function ai(e, t) {
|
|
1218
1294
|
e.style.setProperty("--pluno-pa-panel-offset-x", `${t.x}px`), e.style.setProperty("--pluno-pa-panel-offset-y", `${t.y}px`);
|
|
1219
1295
|
}
|
|
1220
|
-
function
|
|
1296
|
+
function Yt(e) {
|
|
1221
1297
|
e.style.removeProperty("--pluno-pa-panel-offset-x"), e.style.removeProperty("--pluno-pa-panel-offset-y");
|
|
1222
1298
|
}
|
|
1223
|
-
function
|
|
1299
|
+
function Q() {
|
|
1224
1300
|
return {
|
|
1225
|
-
width: window.innerWidth || document.documentElement.clientWidth ||
|
|
1226
|
-
height: window.innerHeight || document.documentElement.clientHeight ||
|
|
1301
|
+
width: window.innerWidth || document.documentElement.clientWidth || bn + W * 2,
|
|
1302
|
+
height: window.innerHeight || document.documentElement.clientHeight || fn + W * 2
|
|
1227
1303
|
};
|
|
1228
1304
|
}
|
|
1229
|
-
function
|
|
1305
|
+
function at(e) {
|
|
1230
1306
|
const t = e.getBoundingClientRect();
|
|
1231
1307
|
return {
|
|
1232
1308
|
x: Math.round(t.x),
|
|
@@ -1235,42 +1311,42 @@ function Qe(e) {
|
|
|
1235
1311
|
height: Math.round(t.height)
|
|
1236
1312
|
};
|
|
1237
1313
|
}
|
|
1238
|
-
function
|
|
1314
|
+
function ve(e, t, n) {
|
|
1239
1315
|
return Math.min(Math.max(e, t), n);
|
|
1240
1316
|
}
|
|
1241
|
-
function
|
|
1317
|
+
function X(e, t, n) {
|
|
1242
1318
|
if (typeof window > "u")
|
|
1243
1319
|
return;
|
|
1244
|
-
const o = window,
|
|
1320
|
+
const o = window, i = {
|
|
1245
1321
|
at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1246
1322
|
source: e,
|
|
1247
1323
|
message: t,
|
|
1248
1324
|
details: n
|
|
1249
|
-
},
|
|
1250
|
-
|
|
1251
|
-
new CustomEvent(
|
|
1325
|
+
}, a = o.__plunoProductAgentDiagnostics__ ?? [];
|
|
1326
|
+
a.push(i), a.length > 120 && a.splice(0, a.length - 120), o.__plunoProductAgentDiagnostics__ = a, o.__PLUNO_PRODUCT_AGENT_DIAGNOSTICS__ = () => [...a], window.dispatchEvent(
|
|
1327
|
+
new CustomEvent(Eo, { detail: i })
|
|
1252
1328
|
);
|
|
1253
1329
|
}
|
|
1254
|
-
function
|
|
1255
|
-
|
|
1330
|
+
function ri(e, t) {
|
|
1331
|
+
X("web-sdk.widget.position", e, t);
|
|
1256
1332
|
}
|
|
1257
|
-
function
|
|
1333
|
+
function rt(e, t, n) {
|
|
1258
1334
|
const o = t.value.trim();
|
|
1259
1335
|
return !o && n.length === 0 ? n : (t.value = "", t.style.height = "22px", t.style.overflowY = "hidden", e.sendMessage(o, {
|
|
1260
1336
|
attachments: n.length > 0 ? n : void 0
|
|
1261
1337
|
}), t.dispatchEvent(new Event("input", { bubbles: !0 })), []);
|
|
1262
1338
|
}
|
|
1263
|
-
function
|
|
1339
|
+
function Pe(e) {
|
|
1264
1340
|
e.style.height = "0px";
|
|
1265
1341
|
const t = Math.max(22, Math.min(e.scrollHeight, 140));
|
|
1266
1342
|
e.style.height = `${t}px`, e.style.overflowY = e.scrollHeight > 140 ? "auto" : "hidden";
|
|
1267
1343
|
}
|
|
1268
|
-
function
|
|
1344
|
+
function Ie(e, t = () => !0) {
|
|
1269
1345
|
e.scrollTop = e.scrollHeight, window.requestAnimationFrame(() => {
|
|
1270
1346
|
t() && (e.scrollTop = e.scrollHeight);
|
|
1271
1347
|
});
|
|
1272
1348
|
}
|
|
1273
|
-
function
|
|
1349
|
+
function li(e) {
|
|
1274
1350
|
const t = e.messages[e.messages.length - 1];
|
|
1275
1351
|
return [
|
|
1276
1352
|
e.messages.length,
|
|
@@ -1281,13 +1357,13 @@ function Jo(e) {
|
|
|
1281
1357
|
e.lastError ?? ""
|
|
1282
1358
|
].join(":");
|
|
1283
1359
|
}
|
|
1284
|
-
function
|
|
1360
|
+
function pi(e) {
|
|
1285
1361
|
return e.messages.length > 0 || e.assistantDraft.length > 0 || e.isThinking || !!e.lastError;
|
|
1286
1362
|
}
|
|
1287
|
-
function
|
|
1363
|
+
function si(e) {
|
|
1288
1364
|
return e.firstUserMessage?.trim() ? e.firstUserMessage : e.title?.trim() ? e.title : "Untitled chat";
|
|
1289
1365
|
}
|
|
1290
|
-
function
|
|
1366
|
+
function di(e) {
|
|
1291
1367
|
const t = e.currentPage;
|
|
1292
1368
|
if (typeof t?.url == "string" && t.url.trim())
|
|
1293
1369
|
try {
|
|
@@ -1298,80 +1374,89 @@ function ta(e) {
|
|
|
1298
1374
|
}
|
|
1299
1375
|
return typeof t?.origin == "string" && t.origin.trim() ? t.origin : "Current origin";
|
|
1300
1376
|
}
|
|
1301
|
-
function
|
|
1377
|
+
function ci(e, t) {
|
|
1302
1378
|
const n = new Date(e).getTime();
|
|
1303
1379
|
if (!Number.isFinite(n))
|
|
1304
1380
|
return "now";
|
|
1305
|
-
const o = Math.max(0, t - n),
|
|
1381
|
+
const o = Math.max(0, t - n), i = [
|
|
1306
1382
|
["day", 864e5],
|
|
1307
1383
|
["hour", 36e5],
|
|
1308
1384
|
["min", 6e4]
|
|
1309
1385
|
];
|
|
1310
|
-
for (const [
|
|
1386
|
+
for (const [a, l] of i)
|
|
1311
1387
|
if (o >= l) {
|
|
1312
1388
|
const p = Math.max(1, Math.floor(o / l));
|
|
1313
|
-
return
|
|
1389
|
+
return a === "min" ? `${p} min` : `${p} ${a}${p === 1 ? "" : "s"}`;
|
|
1314
1390
|
}
|
|
1315
1391
|
return "now";
|
|
1316
1392
|
}
|
|
1317
|
-
function
|
|
1318
|
-
e.appendChild(
|
|
1319
|
-
|
|
1393
|
+
function ui(e, t, n, o, i) {
|
|
1394
|
+
e.appendChild(yi()), e.appendChild(
|
|
1395
|
+
gi(
|
|
1396
|
+
t,
|
|
1397
|
+
n,
|
|
1398
|
+
o,
|
|
1399
|
+
i
|
|
1400
|
+
)
|
|
1320
1401
|
), e.appendChild(
|
|
1321
|
-
|
|
1402
|
+
qe(
|
|
1322
1403
|
"pluno-pa-widget__close",
|
|
1323
1404
|
"Close",
|
|
1324
|
-
|
|
1405
|
+
vi(16),
|
|
1325
1406
|
!0
|
|
1326
1407
|
)
|
|
1327
|
-
), e.appendChild(
|
|
1408
|
+
), e.appendChild(hi(n));
|
|
1328
1409
|
}
|
|
1329
|
-
function
|
|
1330
|
-
const
|
|
1331
|
-
if (
|
|
1332
|
-
const
|
|
1333
|
-
|
|
1410
|
+
function gi(e, t, n, o) {
|
|
1411
|
+
const i = document.createElement("form");
|
|
1412
|
+
if (i.className = "pluno-pa-widget__launcher", o && i.classList.add("pluno-pa-widget__launcher--minimizable"), n) {
|
|
1413
|
+
const l = document.createElement("button");
|
|
1414
|
+
l.type = "button", l.className = "pluno-pa-widget__launcher-drag-handle", l.setAttribute("aria-label", "Move Pluno launcher"), l.title = "Move Pluno launcher", i.appendChild(l);
|
|
1334
1415
|
}
|
|
1335
|
-
|
|
1336
|
-
|
|
1416
|
+
i.appendChild(
|
|
1417
|
+
Sn(
|
|
1337
1418
|
"pluno-pa-widget__scribble-spirals--launcher",
|
|
1338
1419
|
10
|
|
1339
1420
|
)
|
|
1340
|
-
),
|
|
1341
|
-
|
|
1421
|
+
), i.appendChild(
|
|
1422
|
+
se(
|
|
1342
1423
|
"pluno-pa-widget__character--launcher",
|
|
1343
1424
|
t
|
|
1344
1425
|
)
|
|
1345
1426
|
);
|
|
1346
1427
|
const a = document.createElement("input");
|
|
1347
|
-
|
|
1428
|
+
if (a.className = "pluno-pa-widget__launcher-input", a.type = "text", a.placeholder = e, a.setAttribute("aria-label", e), i.appendChild(a), o) {
|
|
1429
|
+
const l = document.createElement("button");
|
|
1430
|
+
l.type = "button", l.className = "pluno-pa-widget__launcher-minimize", l.textContent = "-", l.setAttribute("aria-label", "Minimize Pluno on this site"), l.title = "Minimize Pluno on this site", i.appendChild(l);
|
|
1431
|
+
}
|
|
1432
|
+
return i;
|
|
1348
1433
|
}
|
|
1349
|
-
function
|
|
1434
|
+
function hi(e) {
|
|
1350
1435
|
const t = document.createElement("section");
|
|
1351
1436
|
t.className = "pluno-pa-widget__panel", t.hidden = !0, t.appendChild(
|
|
1352
|
-
|
|
1437
|
+
Sn("pluno-pa-widget__scribble-spirals--panel", 16)
|
|
1353
1438
|
);
|
|
1354
1439
|
const n = document.createElement("div");
|
|
1355
1440
|
n.className = "pluno-pa-widget__timeline-wrap";
|
|
1356
1441
|
const o = document.createElement("main");
|
|
1357
|
-
o.className = "pluno-pa-widget__timeline", o.appendChild(
|
|
1358
|
-
const a = document.createElement("div");
|
|
1359
|
-
a.className = "pluno-pa-widget__timeline-bottom-sentinel", a.setAttribute("aria-hidden", "true"), o.appendChild(a), n.appendChild(o);
|
|
1442
|
+
o.className = "pluno-pa-widget__timeline", o.appendChild(fi(e));
|
|
1360
1443
|
const i = document.createElement("div");
|
|
1361
|
-
i.className = "pluno-pa-
|
|
1444
|
+
i.className = "pluno-pa-widget__timeline-bottom-sentinel", i.setAttribute("aria-hidden", "true"), o.appendChild(i), n.appendChild(o);
|
|
1445
|
+
const a = document.createElement("div");
|
|
1446
|
+
a.className = "pluno-pa-widget__active-users-counter", a.hidden = !0, n.appendChild(a);
|
|
1362
1447
|
const l = document.createElement("button");
|
|
1363
1448
|
l.type = "button", l.className = "pluno-pa-widget__timeline-jump", l.textContent = "New messages ↓", l.hidden = !0, n.appendChild(l);
|
|
1364
1449
|
const p = document.createElement("div");
|
|
1365
1450
|
return p.className = "pluno-pa-widget__top-actions", p.appendChild(
|
|
1366
|
-
|
|
1451
|
+
qe(
|
|
1367
1452
|
"pluno-pa-widget__history",
|
|
1368
1453
|
"Recent chats",
|
|
1369
|
-
|
|
1454
|
+
Ei(),
|
|
1370
1455
|
!0
|
|
1371
1456
|
)
|
|
1372
|
-
), n.appendChild(p), n.appendChild(
|
|
1457
|
+
), n.appendChild(p), n.appendChild(bi()), t.appendChild(n), t.appendChild(mi()), t;
|
|
1373
1458
|
}
|
|
1374
|
-
function
|
|
1459
|
+
function mi() {
|
|
1375
1460
|
const e = document.createElement("form");
|
|
1376
1461
|
e.className = "pluno-pa-widget__composer";
|
|
1377
1462
|
const t = document.createElement("div");
|
|
@@ -1380,56 +1465,56 @@ function ra() {
|
|
|
1380
1465
|
n.className = "pluno-pa-widget__attachment-error", n.hidden = !0, e.appendChild(n);
|
|
1381
1466
|
const o = document.createElement("div");
|
|
1382
1467
|
o.className = "pluno-pa-widget__attachments", o.hidden = !0, e.appendChild(o);
|
|
1383
|
-
const
|
|
1384
|
-
|
|
1385
|
-
const
|
|
1386
|
-
|
|
1468
|
+
const i = document.createElement("div");
|
|
1469
|
+
i.className = "pluno-pa-widget__composer-inner";
|
|
1470
|
+
const a = document.createElement("input");
|
|
1471
|
+
a.className = "pluno-pa-widget__attachment-input", a.type = "file", a.accept = ko, a.multiple = !0, a.tabIndex = -1, a.setAttribute("aria-hidden", "true"), i.appendChild(a);
|
|
1387
1472
|
const l = document.createElement("button");
|
|
1388
|
-
l.type = "button", l.className = "pluno-pa-widget__attach", l.setAttribute("aria-label", "Attach files"), l.title = "Attach files", l.appendChild(
|
|
1473
|
+
l.type = "button", l.className = "pluno-pa-widget__attach", l.setAttribute("aria-label", "Attach files"), l.title = "Attach files", l.appendChild(ki()), l.appendChild(Li()), i.appendChild(l);
|
|
1389
1474
|
const p = document.createElement("textarea");
|
|
1390
|
-
p.className = "pluno-pa-widget__input", p.rows = 1, p.placeholder = "Ask for anything...",
|
|
1475
|
+
p.className = "pluno-pa-widget__input", p.rows = 1, p.placeholder = "Ask for anything...", i.appendChild(p);
|
|
1391
1476
|
const c = document.createElement("button");
|
|
1392
|
-
c.type = "button", c.className = "pluno-pa-widget__send", c.setAttribute("aria-label", "Send"), c.appendChild(
|
|
1477
|
+
c.type = "button", c.className = "pluno-pa-widget__send", c.setAttribute("aria-label", "Send"), c.appendChild(kn()), i.appendChild(c), e.appendChild(i);
|
|
1393
1478
|
const u = document.createElement("div");
|
|
1394
1479
|
u.className = "pluno-pa-widget__composer-meta";
|
|
1395
|
-
const
|
|
1396
|
-
|
|
1397
|
-
const
|
|
1398
|
-
return
|
|
1480
|
+
const d = document.createElement("a");
|
|
1481
|
+
d.className = "pluno-pa-widget__powered-by", d.href = "https://pluno.ai", d.target = "_blank", d.rel = "noopener noreferrer", d.textContent = "Powered by Pluno.ai.", u.appendChild(d);
|
|
1482
|
+
const h = document.createElement("span");
|
|
1483
|
+
return h.className = "pluno-pa-widget__ai-disclaimer", h.textContent = "AI can make mistakes. Verify outputs.", u.appendChild(h), e.appendChild(u), e;
|
|
1399
1484
|
}
|
|
1400
|
-
function
|
|
1485
|
+
function bi() {
|
|
1401
1486
|
const e = document.createElement("section");
|
|
1402
1487
|
e.className = "pluno-pa-widget__history-panel", e.hidden = !0, e.setAttribute("aria-label", "Recent chats");
|
|
1403
1488
|
const t = document.createElement("div");
|
|
1404
1489
|
t.className = "pluno-pa-widget__history-header";
|
|
1405
1490
|
const n = document.createElement("strong");
|
|
1406
1491
|
n.textContent = "Recent chats";
|
|
1407
|
-
const o =
|
|
1492
|
+
const o = qe(
|
|
1408
1493
|
"pluno-pa-widget__history-close",
|
|
1409
1494
|
"Close recent chats",
|
|
1410
|
-
|
|
1495
|
+
Si(),
|
|
1411
1496
|
!1
|
|
1412
1497
|
);
|
|
1413
1498
|
t.append(n, o);
|
|
1414
|
-
const
|
|
1415
|
-
|
|
1416
|
-
const
|
|
1417
|
-
return
|
|
1499
|
+
const i = document.createElement("div");
|
|
1500
|
+
i.className = "pluno-pa-widget__history-list";
|
|
1501
|
+
const a = document.createElement("p");
|
|
1502
|
+
return a.className = "pluno-pa-widget__history-status", a.hidden = !0, e.append(t, i, a), e;
|
|
1418
1503
|
}
|
|
1419
|
-
function
|
|
1504
|
+
function fi(e) {
|
|
1420
1505
|
const t = document.createElement("div");
|
|
1421
1506
|
return t.className = "pluno-pa-widget__empty-state", t.appendChild(
|
|
1422
|
-
|
|
1507
|
+
se(
|
|
1423
1508
|
"pluno-pa-widget__character--empty",
|
|
1424
1509
|
e
|
|
1425
1510
|
)
|
|
1426
|
-
), t.appendChild(
|
|
1511
|
+
), t.appendChild(Cn()), t;
|
|
1427
1512
|
}
|
|
1428
|
-
function
|
|
1513
|
+
function Cn() {
|
|
1429
1514
|
const e = document.createElement("div");
|
|
1430
1515
|
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;
|
|
1431
1516
|
}
|
|
1432
|
-
function
|
|
1517
|
+
function wi(e, t) {
|
|
1433
1518
|
e.replaceChildren(), e.setAttribute(
|
|
1434
1519
|
"aria-label",
|
|
1435
1520
|
`${t.toLocaleString("en-US")} users currently active`
|
|
@@ -1441,17 +1526,17 @@ function sa(e, t) {
|
|
|
1441
1526
|
)
|
|
1442
1527
|
);
|
|
1443
1528
|
}
|
|
1444
|
-
function
|
|
1445
|
-
const n = `pluno-pa-character-${
|
|
1446
|
-
|
|
1447
|
-
const o = t.scribbleStyle ?
|
|
1529
|
+
function se(e, t) {
|
|
1530
|
+
const n = `pluno-pa-character-${$t}`;
|
|
1531
|
+
$t += 1;
|
|
1532
|
+
const o = t.scribbleStyle ? xi(t.accentColor, n) : _i(t.accentColor, n), i = e.split(/\s+/).filter(Boolean);
|
|
1448
1533
|
return o.setAttribute(
|
|
1449
1534
|
"class",
|
|
1450
|
-
|
|
1535
|
+
i.includes("pluno-pa-widget__character") ? e : `pluno-pa-widget__character ${e}`
|
|
1451
1536
|
), o.setAttribute("aria-hidden", "true"), o.setAttribute("focusable", "false"), o.removeAttribute("role"), o.removeAttribute("aria-label"), o;
|
|
1452
1537
|
}
|
|
1453
|
-
function
|
|
1454
|
-
const n =
|
|
1538
|
+
function _i(e, t) {
|
|
1539
|
+
const n = Xn(e), o = {
|
|
1455
1540
|
boltFill: `${t}-boltFill`,
|
|
1456
1541
|
boltEdge: `${t}-boltEdge`,
|
|
1457
1542
|
boltGlow: `${t}-boltGlow`,
|
|
@@ -1462,7 +1547,7 @@ function da(e, t) {
|
|
|
1462
1547
|
eyeShadow: `${t}-eyeShadow`,
|
|
1463
1548
|
pupilGloss: `${t}-pupilGloss`,
|
|
1464
1549
|
boltClip: `${t}-boltClip`
|
|
1465
|
-
},
|
|
1550
|
+
}, i = En(), a = m(i, "defs"), l = m(a, "linearGradient", {
|
|
1466
1551
|
id: o.boltFill,
|
|
1467
1552
|
x1: "420",
|
|
1468
1553
|
y1: "180",
|
|
@@ -1470,8 +1555,8 @@ function da(e, t) {
|
|
|
1470
1555
|
y2: "1040",
|
|
1471
1556
|
gradientUnits: "userSpaceOnUse"
|
|
1472
1557
|
});
|
|
1473
|
-
|
|
1474
|
-
const p = m(
|
|
1558
|
+
M(l, "0", n.top), M(l, "0.36", n.middle), M(l, "0.72", n.bottom), M(l, "1", n.bottom);
|
|
1559
|
+
const p = m(a, "linearGradient", {
|
|
1475
1560
|
id: o.boltEdge,
|
|
1476
1561
|
x1: "470",
|
|
1477
1562
|
y1: "145",
|
|
@@ -1479,29 +1564,29 @@ function da(e, t) {
|
|
|
1479
1564
|
y2: "980",
|
|
1480
1565
|
gradientUnits: "userSpaceOnUse"
|
|
1481
1566
|
});
|
|
1482
|
-
|
|
1483
|
-
const c = m(
|
|
1567
|
+
M(p, "0", n.edgeStart), M(p, "0.32", n.edgeMiddle), M(p, "0.78", n.edgeEnd), M(p, "1", n.edgeEnd);
|
|
1568
|
+
const c = m(a, "radialGradient", {
|
|
1484
1569
|
id: o.boltGlow,
|
|
1485
1570
|
cx: "50%",
|
|
1486
1571
|
cy: "22%",
|
|
1487
1572
|
r: "82%"
|
|
1488
1573
|
});
|
|
1489
|
-
|
|
1490
|
-
const u = m(
|
|
1574
|
+
M(c, "0", n.glow, "0.72"), M(c, "0.5", n.middle, "0.44"), M(c, "1", n.bottom, "0");
|
|
1575
|
+
const u = m(a, "radialGradient", {
|
|
1491
1576
|
id: o.eyeWhite,
|
|
1492
1577
|
cx: "35%",
|
|
1493
1578
|
cy: "25%",
|
|
1494
1579
|
r: "70%"
|
|
1495
1580
|
});
|
|
1496
|
-
|
|
1497
|
-
const
|
|
1581
|
+
M(u, "0", "#ffffff"), M(u, "0.72", "#ffffff"), M(u, "1", "#e5e5e5");
|
|
1582
|
+
const d = m(a, "radialGradient", {
|
|
1498
1583
|
id: o.pupil,
|
|
1499
1584
|
cx: "42%",
|
|
1500
1585
|
cy: "38%",
|
|
1501
1586
|
r: "65%"
|
|
1502
1587
|
});
|
|
1503
|
-
|
|
1504
|
-
const
|
|
1588
|
+
M(d, "0", "#2a1f10"), M(d, "0.52", "#080604"), M(d, "1", "#000000");
|
|
1589
|
+
const h = m(a, "filter", {
|
|
1505
1590
|
id: o.softDropShadow,
|
|
1506
1591
|
x: "-18%",
|
|
1507
1592
|
y: "-12%",
|
|
@@ -1509,14 +1594,14 @@ function da(e, t) {
|
|
|
1509
1594
|
height: "136%",
|
|
1510
1595
|
"color-interpolation-filters": "sRGB"
|
|
1511
1596
|
});
|
|
1512
|
-
m(
|
|
1597
|
+
m(h, "feDropShadow", {
|
|
1513
1598
|
dx: "0",
|
|
1514
1599
|
dy: "12",
|
|
1515
1600
|
stdDeviation: "18",
|
|
1516
1601
|
"flood-color": n.shadow,
|
|
1517
1602
|
"flood-opacity": "0.24"
|
|
1518
1603
|
});
|
|
1519
|
-
const
|
|
1604
|
+
const x = m(a, "filter", {
|
|
1520
1605
|
id: o.innerDepth,
|
|
1521
1606
|
x: "-8%",
|
|
1522
1607
|
y: "-8%",
|
|
@@ -1524,32 +1609,32 @@ function da(e, t) {
|
|
|
1524
1609
|
height: "116%",
|
|
1525
1610
|
"color-interpolation-filters": "sRGB"
|
|
1526
1611
|
});
|
|
1527
|
-
m(
|
|
1612
|
+
m(x, "feGaussianBlur", {
|
|
1528
1613
|
in: "SourceAlpha",
|
|
1529
1614
|
stdDeviation: "8",
|
|
1530
1615
|
result: "blur"
|
|
1531
|
-
}), m(
|
|
1616
|
+
}), m(x, "feOffset", {
|
|
1532
1617
|
dx: "-7",
|
|
1533
1618
|
dy: "-9",
|
|
1534
1619
|
result: "topLeft"
|
|
1535
|
-
}), m(
|
|
1620
|
+
}), m(x, "feComposite", {
|
|
1536
1621
|
in: "topLeft",
|
|
1537
1622
|
in2: "SourceAlpha",
|
|
1538
1623
|
operator: "arithmetic",
|
|
1539
1624
|
k2: "-1",
|
|
1540
1625
|
k3: "1",
|
|
1541
1626
|
result: "innerShadow"
|
|
1542
|
-
}), m(
|
|
1627
|
+
}), m(x, "feColorMatrix", {
|
|
1543
1628
|
in: "innerShadow",
|
|
1544
1629
|
type: "matrix",
|
|
1545
1630
|
values: "1 0 0 0 1 0 1 0 0 1 0 0 1 0 1 0 0 0 0.42 0",
|
|
1546
1631
|
result: "innerLight"
|
|
1547
|
-
}), m(
|
|
1632
|
+
}), m(x, "feBlend", {
|
|
1548
1633
|
in: "SourceGraphic",
|
|
1549
1634
|
in2: "innerLight",
|
|
1550
1635
|
mode: "screen"
|
|
1551
1636
|
});
|
|
1552
|
-
const
|
|
1637
|
+
const y = m(a, "filter", {
|
|
1553
1638
|
id: o.eyeShadow,
|
|
1554
1639
|
x: "-24%",
|
|
1555
1640
|
y: "-20%",
|
|
@@ -1557,14 +1642,14 @@ function da(e, t) {
|
|
|
1557
1642
|
height: "148%",
|
|
1558
1643
|
"color-interpolation-filters": "sRGB"
|
|
1559
1644
|
});
|
|
1560
|
-
m(
|
|
1645
|
+
m(y, "feDropShadow", {
|
|
1561
1646
|
dx: "0",
|
|
1562
1647
|
dy: "8",
|
|
1563
1648
|
stdDeviation: "5",
|
|
1564
1649
|
"flood-color": n.shadow,
|
|
1565
1650
|
"flood-opacity": "0.3"
|
|
1566
1651
|
});
|
|
1567
|
-
const
|
|
1652
|
+
const P = m(a, "filter", {
|
|
1568
1653
|
id: o.pupilGloss,
|
|
1569
1654
|
x: "-15%",
|
|
1570
1655
|
y: "-15%",
|
|
@@ -1572,51 +1657,51 @@ function da(e, t) {
|
|
|
1572
1657
|
height: "130%",
|
|
1573
1658
|
"color-interpolation-filters": "sRGB"
|
|
1574
1659
|
});
|
|
1575
|
-
m(
|
|
1660
|
+
m(P, "feDropShadow", {
|
|
1576
1661
|
dx: "0",
|
|
1577
1662
|
dy: "3",
|
|
1578
1663
|
stdDeviation: "3",
|
|
1579
1664
|
"flood-color": "#000000",
|
|
1580
1665
|
"flood-opacity": "0.22"
|
|
1581
1666
|
});
|
|
1582
|
-
const
|
|
1583
|
-
m(
|
|
1584
|
-
const
|
|
1585
|
-
filter:
|
|
1667
|
+
const T = m(a, "clipPath", { id: o.boltClip });
|
|
1668
|
+
m(T, "path", { d: He });
|
|
1669
|
+
const f = m(i, "g", {
|
|
1670
|
+
filter: q(o.softDropShadow)
|
|
1586
1671
|
});
|
|
1587
|
-
m(
|
|
1588
|
-
d:
|
|
1589
|
-
fill:
|
|
1672
|
+
m(f, "path", {
|
|
1673
|
+
d: He,
|
|
1674
|
+
fill: q(o.boltEdge)
|
|
1590
1675
|
});
|
|
1591
|
-
const
|
|
1592
|
-
m(
|
|
1593
|
-
d:
|
|
1594
|
-
fill:
|
|
1595
|
-
filter:
|
|
1596
|
-
}), m(
|
|
1597
|
-
d:
|
|
1598
|
-
fill:
|
|
1676
|
+
const E = "M546 166 C522 166 505 180 499 204 L397 606 C390 630 406 646 432 646 L526 646 C568 646 590 672 581 712 L512 1001 C510 1010 518 1014 524 1006 L875 475 C886 458 878 449 855 449 L814 449 C764 449 745 415 769 374 L884 200 C894 181 883 161 858 161 Z";
|
|
1677
|
+
m(f, "path", {
|
|
1678
|
+
d: E,
|
|
1679
|
+
fill: q(o.boltFill),
|
|
1680
|
+
filter: q(o.innerDepth)
|
|
1681
|
+
}), m(f, "path", {
|
|
1682
|
+
d: E,
|
|
1683
|
+
fill: q(o.boltGlow),
|
|
1599
1684
|
opacity: "0.74"
|
|
1600
1685
|
});
|
|
1601
|
-
const
|
|
1602
|
-
"clip-path":
|
|
1686
|
+
const g = m(f, "g", {
|
|
1687
|
+
"clip-path": q(o.boltClip),
|
|
1603
1688
|
opacity: "0.42"
|
|
1604
1689
|
});
|
|
1605
|
-
m(
|
|
1690
|
+
m(g, "path", {
|
|
1606
1691
|
d: "M523 181 C505 189 496 206 489 232 L400 594 C397 606 400 619 411 626",
|
|
1607
1692
|
fill: "none",
|
|
1608
1693
|
stroke: n.highlight,
|
|
1609
1694
|
"stroke-width": "22",
|
|
1610
1695
|
"stroke-linecap": "round",
|
|
1611
1696
|
opacity: "0.65"
|
|
1612
|
-
}), m(
|
|
1697
|
+
}), m(g, "path", {
|
|
1613
1698
|
d: "M556 685 L501 994",
|
|
1614
1699
|
fill: "none",
|
|
1615
1700
|
stroke: n.highlight,
|
|
1616
1701
|
"stroke-width": "20",
|
|
1617
1702
|
"stroke-linecap": "round",
|
|
1618
1703
|
opacity: "0.55"
|
|
1619
|
-
}), m(
|
|
1704
|
+
}), m(g, "path", {
|
|
1620
1705
|
d: "M858 160 C882 166 893 181 883 204",
|
|
1621
1706
|
fill: "none",
|
|
1622
1707
|
stroke: n.inner,
|
|
@@ -1624,9 +1709,9 @@ function da(e, t) {
|
|
|
1624
1709
|
"stroke-linecap": "round",
|
|
1625
1710
|
opacity: "0.48"
|
|
1626
1711
|
});
|
|
1627
|
-
const
|
|
1628
|
-
return
|
|
1629
|
-
|
|
1712
|
+
const S = m(i, "g", { filter: q(o.eyeShadow) });
|
|
1713
|
+
return Kt(
|
|
1714
|
+
S,
|
|
1630
1715
|
"rotate(-2 528 463)",
|
|
1631
1716
|
"528",
|
|
1632
1717
|
"463",
|
|
@@ -1635,8 +1720,8 @@ function da(e, t) {
|
|
|
1635
1720
|
"557",
|
|
1636
1721
|
"447",
|
|
1637
1722
|
o
|
|
1638
|
-
),
|
|
1639
|
-
|
|
1723
|
+
), Kt(
|
|
1724
|
+
S,
|
|
1640
1725
|
"rotate(2 717 462)",
|
|
1641
1726
|
"717",
|
|
1642
1727
|
"462",
|
|
@@ -1645,15 +1730,15 @@ function da(e, t) {
|
|
|
1645
1730
|
"728",
|
|
1646
1731
|
"447",
|
|
1647
1732
|
o
|
|
1648
|
-
),
|
|
1733
|
+
), i;
|
|
1649
1734
|
}
|
|
1650
|
-
function
|
|
1651
|
-
const n =
|
|
1735
|
+
function xi(e, t) {
|
|
1736
|
+
const n = dn(e), o = {
|
|
1652
1737
|
clip: `${t}-scribbleBoltClip`,
|
|
1653
1738
|
wobble: `${t}-scribbleBoltWobble`
|
|
1654
|
-
},
|
|
1655
|
-
m(l, "path", { d:
|
|
1656
|
-
const p = m(
|
|
1739
|
+
}, i = En(), a = m(i, "defs"), l = m(a, "clipPath", { id: o.clip });
|
|
1740
|
+
m(l, "path", { d: He });
|
|
1741
|
+
const p = m(a, "filter", {
|
|
1657
1742
|
id: o.wobble,
|
|
1658
1743
|
x: "-10%",
|
|
1659
1744
|
y: "-10%",
|
|
@@ -1674,11 +1759,11 @@ function ca(e, t) {
|
|
|
1674
1759
|
xChannelSelector: "R",
|
|
1675
1760
|
yChannelSelector: "G"
|
|
1676
1761
|
});
|
|
1677
|
-
const c = m(
|
|
1678
|
-
"clip-path":
|
|
1762
|
+
const c = m(i, "g", { filter: q(o.wobble) }), u = m(c, "g", {
|
|
1763
|
+
"clip-path": q(o.clip)
|
|
1679
1764
|
});
|
|
1680
1765
|
return m(u, "path", {
|
|
1681
|
-
d:
|
|
1766
|
+
d: Kn(),
|
|
1682
1767
|
fill: "none",
|
|
1683
1768
|
stroke: n,
|
|
1684
1769
|
"stroke-width": "56",
|
|
@@ -1687,12 +1772,12 @@ function ca(e, t) {
|
|
|
1687
1772
|
opacity: "0.9",
|
|
1688
1773
|
transform: "rotate(-14 627 600)"
|
|
1689
1774
|
}), m(c, "path", {
|
|
1690
|
-
d:
|
|
1775
|
+
d: He,
|
|
1691
1776
|
fill: "none",
|
|
1692
|
-
stroke:
|
|
1777
|
+
stroke: Ge,
|
|
1693
1778
|
"stroke-width": "18",
|
|
1694
1779
|
"stroke-linejoin": "round"
|
|
1695
|
-
}),
|
|
1780
|
+
}), Xt(
|
|
1696
1781
|
c,
|
|
1697
1782
|
"rotate(-2 528 463)",
|
|
1698
1783
|
"528",
|
|
@@ -1701,7 +1786,7 @@ function ca(e, t) {
|
|
|
1701
1786
|
"473",
|
|
1702
1787
|
"557",
|
|
1703
1788
|
"447"
|
|
1704
|
-
),
|
|
1789
|
+
), Xt(
|
|
1705
1790
|
c,
|
|
1706
1791
|
"rotate(2 717 462)",
|
|
1707
1792
|
"717",
|
|
@@ -1710,29 +1795,29 @@ function ca(e, t) {
|
|
|
1710
1795
|
"473",
|
|
1711
1796
|
"728",
|
|
1712
1797
|
"447"
|
|
1713
|
-
),
|
|
1798
|
+
), i;
|
|
1714
1799
|
}
|
|
1715
|
-
function
|
|
1800
|
+
function En() {
|
|
1716
1801
|
return v("svg", {
|
|
1717
|
-
xmlns:
|
|
1802
|
+
xmlns: wn,
|
|
1718
1803
|
viewBox: "0 0 1254 1254"
|
|
1719
1804
|
});
|
|
1720
1805
|
}
|
|
1721
|
-
function
|
|
1806
|
+
function Kt(e, t, n, o, i, a, l, p, c) {
|
|
1722
1807
|
const u = m(e, "g", { transform: t });
|
|
1723
1808
|
m(u, "ellipse", {
|
|
1724
1809
|
cx: n,
|
|
1725
1810
|
cy: o,
|
|
1726
1811
|
rx: "73",
|
|
1727
1812
|
ry: "80",
|
|
1728
|
-
fill:
|
|
1813
|
+
fill: q(c.eyeWhite)
|
|
1729
1814
|
}), m(u, "ellipse", {
|
|
1730
|
-
cx:
|
|
1731
|
-
cy:
|
|
1815
|
+
cx: i,
|
|
1816
|
+
cy: a,
|
|
1732
1817
|
rx: "49",
|
|
1733
1818
|
ry: "57",
|
|
1734
|
-
fill:
|
|
1735
|
-
filter:
|
|
1819
|
+
fill: q(c.pupil),
|
|
1820
|
+
filter: q(c.pupilGloss)
|
|
1736
1821
|
}), m(u, "circle", {
|
|
1737
1822
|
cx: l,
|
|
1738
1823
|
cy: p,
|
|
@@ -1740,7 +1825,7 @@ function Wt(e, t, n, o, a, i, l, p, c) {
|
|
|
1740
1825
|
fill: "#ffffff"
|
|
1741
1826
|
});
|
|
1742
1827
|
}
|
|
1743
|
-
function
|
|
1828
|
+
function Xt(e, t, n, o, i, a, l, p) {
|
|
1744
1829
|
const c = m(e, "g", { transform: t });
|
|
1745
1830
|
m(c, "ellipse", {
|
|
1746
1831
|
cx: n,
|
|
@@ -1748,14 +1833,14 @@ function $t(e, t, n, o, a, i, l, p) {
|
|
|
1748
1833
|
rx: "73",
|
|
1749
1834
|
ry: "80",
|
|
1750
1835
|
fill: "#ffffff",
|
|
1751
|
-
stroke:
|
|
1836
|
+
stroke: Ge,
|
|
1752
1837
|
"stroke-width": "13"
|
|
1753
1838
|
}), m(c, "ellipse", {
|
|
1754
|
-
cx:
|
|
1755
|
-
cy:
|
|
1839
|
+
cx: i,
|
|
1840
|
+
cy: a,
|
|
1756
1841
|
rx: "45",
|
|
1757
1842
|
ry: "53",
|
|
1758
|
-
fill:
|
|
1843
|
+
fill: Ge
|
|
1759
1844
|
}), m(c, "circle", {
|
|
1760
1845
|
cx: l,
|
|
1761
1846
|
cy: p,
|
|
@@ -1767,18 +1852,18 @@ function m(e, t, n = {}) {
|
|
|
1767
1852
|
const o = v(t, n);
|
|
1768
1853
|
return e.appendChild(o), o;
|
|
1769
1854
|
}
|
|
1770
|
-
function
|
|
1771
|
-
const
|
|
1772
|
-
o !== void 0 && (
|
|
1855
|
+
function M(e, t, n, o) {
|
|
1856
|
+
const i = { offset: t, "stop-color": n };
|
|
1857
|
+
o !== void 0 && (i["stop-opacity"] = o), m(e, "stop", i);
|
|
1773
1858
|
}
|
|
1774
|
-
function
|
|
1859
|
+
function q(e) {
|
|
1775
1860
|
return `url(#${e})`;
|
|
1776
1861
|
}
|
|
1777
|
-
function
|
|
1778
|
-
const
|
|
1779
|
-
return
|
|
1862
|
+
function qe(e, t, n, o) {
|
|
1863
|
+
const i = document.createElement("button");
|
|
1864
|
+
return i.type = "button", i.className = e, i.setAttribute("aria-label", t), i.title = t, i.hidden = o, i.appendChild(n), i;
|
|
1780
1865
|
}
|
|
1781
|
-
function
|
|
1866
|
+
function yi() {
|
|
1782
1867
|
const e = v("svg", {
|
|
1783
1868
|
class: "pluno-pa-widget__scribble-defs",
|
|
1784
1869
|
"aria-hidden": "true",
|
|
@@ -1786,48 +1871,48 @@ function ua() {
|
|
|
1786
1871
|
width: "0",
|
|
1787
1872
|
height: "0"
|
|
1788
1873
|
}), t = v("defs");
|
|
1789
|
-
return t.appendChild(
|
|
1790
|
-
|
|
1874
|
+
return t.appendChild(lt("pluno-pa-scribble-wobble", "2", "12")), t.appendChild(
|
|
1875
|
+
lt("pluno-pa-scribble-wobble-2", "5", "15")
|
|
1791
1876
|
), t.appendChild(
|
|
1792
|
-
|
|
1877
|
+
lt("pluno-pa-scribble-wobble-3", "9", "19")
|
|
1793
1878
|
), e.appendChild(t), e;
|
|
1794
1879
|
}
|
|
1795
|
-
function
|
|
1796
|
-
const n = t *
|
|
1880
|
+
function Sn(e, t) {
|
|
1881
|
+
const n = t * Ft + Ht * 2, o = v("svg", {
|
|
1797
1882
|
class: `pluno-pa-widget__scribble-spirals ${e}`,
|
|
1798
|
-
viewBox: `0 0 ${n} ${
|
|
1883
|
+
viewBox: `0 0 ${n} ${Fo}`,
|
|
1799
1884
|
preserveAspectRatio: "xMidYMid meet",
|
|
1800
1885
|
"aria-hidden": "true",
|
|
1801
1886
|
focusable: "false"
|
|
1802
1887
|
});
|
|
1803
|
-
for (let
|
|
1804
|
-
const
|
|
1805
|
-
transform: `translate(${
|
|
1888
|
+
for (let i = 0; i < t; i += 1) {
|
|
1889
|
+
const a = Gt[i % Gt.length], l = v("g", {
|
|
1890
|
+
transform: `translate(${Ht + i * Ft} 0)`
|
|
1806
1891
|
});
|
|
1807
1892
|
l.appendChild(
|
|
1808
1893
|
v("ellipse", {
|
|
1809
|
-
cx:
|
|
1810
|
-
cy:
|
|
1811
|
-
rx:
|
|
1812
|
-
ry:
|
|
1894
|
+
cx: a.ellipseCx,
|
|
1895
|
+
cy: a.ellipseCy,
|
|
1896
|
+
rx: a.ellipseRx,
|
|
1897
|
+
ry: a.ellipseRy,
|
|
1813
1898
|
fill: "none",
|
|
1814
1899
|
stroke: "#2c2a1e",
|
|
1815
|
-
"stroke-width":
|
|
1900
|
+
"stroke-width": a.strokeWidth,
|
|
1816
1901
|
opacity: "0.8"
|
|
1817
1902
|
})
|
|
1818
1903
|
), l.appendChild(
|
|
1819
1904
|
v("path", {
|
|
1820
|
-
d:
|
|
1905
|
+
d: a.path,
|
|
1821
1906
|
fill: "none",
|
|
1822
1907
|
stroke: "#2c2a1e",
|
|
1823
|
-
"stroke-width":
|
|
1908
|
+
"stroke-width": a.pathStrokeWidth,
|
|
1824
1909
|
"stroke-linecap": "round"
|
|
1825
1910
|
})
|
|
1826
1911
|
), o.appendChild(l);
|
|
1827
1912
|
}
|
|
1828
1913
|
return o;
|
|
1829
1914
|
}
|
|
1830
|
-
function
|
|
1915
|
+
function lt(e, t, n) {
|
|
1831
1916
|
const o = v("filter", {
|
|
1832
1917
|
id: e,
|
|
1833
1918
|
x: "-8%",
|
|
@@ -1870,8 +1955,8 @@ function tt(e, t, n) {
|
|
|
1870
1955
|
})
|
|
1871
1956
|
), o;
|
|
1872
1957
|
}
|
|
1873
|
-
function
|
|
1874
|
-
const t =
|
|
1958
|
+
function vi(e) {
|
|
1959
|
+
const t = ee(
|
|
1875
1960
|
"0 0 24 24",
|
|
1876
1961
|
e,
|
|
1877
1962
|
e,
|
|
@@ -1881,8 +1966,8 @@ function ga(e) {
|
|
|
1881
1966
|
);
|
|
1882
1967
|
return t.appendChild(v("path", { d: "m6 9 6 6 6-6" })), t;
|
|
1883
1968
|
}
|
|
1884
|
-
function
|
|
1885
|
-
const e =
|
|
1969
|
+
function Ci() {
|
|
1970
|
+
const e = ee(
|
|
1886
1971
|
"0 0 24 24",
|
|
1887
1972
|
17,
|
|
1888
1973
|
17,
|
|
@@ -1900,8 +1985,8 @@ function ha() {
|
|
|
1900
1985
|
})
|
|
1901
1986
|
), e;
|
|
1902
1987
|
}
|
|
1903
|
-
function
|
|
1904
|
-
const e =
|
|
1988
|
+
function Ei() {
|
|
1989
|
+
const e = ee(
|
|
1905
1990
|
"0 0 24 24",
|
|
1906
1991
|
17,
|
|
1907
1992
|
17,
|
|
@@ -1911,8 +1996,8 @@ function ma() {
|
|
|
1911
1996
|
);
|
|
1912
1997
|
return e.appendChild(v("path", { d: "M3 12a9 9 0 1 0 3-6.7" })), e.appendChild(v("path", { d: "M3 4v5h5" })), e.appendChild(v("path", { d: "M12 7v5l3 2" })), e;
|
|
1913
1998
|
}
|
|
1914
|
-
function
|
|
1915
|
-
const e =
|
|
1999
|
+
function Si() {
|
|
2000
|
+
const e = ee(
|
|
1916
2001
|
"0 0 24 24",
|
|
1917
2002
|
15,
|
|
1918
2003
|
15,
|
|
@@ -1922,8 +2007,8 @@ function ba() {
|
|
|
1922
2007
|
);
|
|
1923
2008
|
return e.appendChild(v("path", { d: "M18 6 6 18" })), e.appendChild(v("path", { d: "m6 6 12 12" })), e;
|
|
1924
2009
|
}
|
|
1925
|
-
function
|
|
1926
|
-
const e =
|
|
2010
|
+
function kn() {
|
|
2011
|
+
const e = ee(
|
|
1927
2012
|
"0 0 24 24",
|
|
1928
2013
|
14,
|
|
1929
2014
|
14,
|
|
@@ -1935,8 +2020,8 @@ function _n() {
|
|
|
1935
2020
|
v("line", { x1: "12", y1: "19", x2: "12", y2: "5" })
|
|
1936
2021
|
), e.appendChild(v("polyline", { points: "5 12 12 5 19 12" })), e;
|
|
1937
2022
|
}
|
|
1938
|
-
function
|
|
1939
|
-
const e =
|
|
2023
|
+
function ki() {
|
|
2024
|
+
const e = ee(
|
|
1940
2025
|
"0 0 24 24",
|
|
1941
2026
|
16,
|
|
1942
2027
|
16,
|
|
@@ -1953,8 +2038,8 @@ function fa() {
|
|
|
1953
2038
|
})
|
|
1954
2039
|
), e;
|
|
1955
2040
|
}
|
|
1956
|
-
function
|
|
1957
|
-
const e =
|
|
2041
|
+
function Li() {
|
|
2042
|
+
const e = ee("0 0 24 24", 19, 19, "none", "currentColor");
|
|
1958
2043
|
return e.setAttribute(
|
|
1959
2044
|
"class",
|
|
1960
2045
|
"pluno-pa-widget__paperclip-icon pluno-pa-widget__paperclip-icon--scribble"
|
|
@@ -1968,8 +2053,8 @@ function wa() {
|
|
|
1968
2053
|
})
|
|
1969
2054
|
), e;
|
|
1970
2055
|
}
|
|
1971
|
-
function
|
|
1972
|
-
const e =
|
|
2056
|
+
function Ai() {
|
|
2057
|
+
const e = ee("0 0 24 24", 18, 18, "currentColor");
|
|
1973
2058
|
return e.appendChild(
|
|
1974
2059
|
v("rect", {
|
|
1975
2060
|
x: "6",
|
|
@@ -1980,8 +2065,8 @@ function _a() {
|
|
|
1980
2065
|
})
|
|
1981
2066
|
), e;
|
|
1982
2067
|
}
|
|
1983
|
-
function
|
|
1984
|
-
const e =
|
|
2068
|
+
function Pi() {
|
|
2069
|
+
const e = ee(
|
|
1985
2070
|
"0 0 24 24",
|
|
1986
2071
|
12,
|
|
1987
2072
|
12,
|
|
@@ -1991,8 +2076,8 @@ function xa() {
|
|
|
1991
2076
|
);
|
|
1992
2077
|
return e.appendChild(v("path", { d: "M18 6 6 18" })), e.appendChild(v("path", { d: "m6 6 12 12" })), e;
|
|
1993
2078
|
}
|
|
1994
|
-
function
|
|
1995
|
-
const e =
|
|
2079
|
+
function Ii() {
|
|
2080
|
+
const e = ee(
|
|
1996
2081
|
"0 0 24 24",
|
|
1997
2082
|
13,
|
|
1998
2083
|
13,
|
|
@@ -2015,7 +2100,7 @@ function ya() {
|
|
|
2015
2100
|
})
|
|
2016
2101
|
), e;
|
|
2017
2102
|
}
|
|
2018
|
-
function
|
|
2103
|
+
function ee(e, t, n, o, i, a) {
|
|
2019
2104
|
const l = {
|
|
2020
2105
|
viewBox: e,
|
|
2021
2106
|
width: String(t),
|
|
@@ -2023,43 +2108,43 @@ function Z(e, t, n, o, a, i) {
|
|
|
2023
2108
|
fill: o,
|
|
2024
2109
|
"aria-hidden": "true"
|
|
2025
2110
|
};
|
|
2026
|
-
return
|
|
2111
|
+
return i && (l.stroke = i, l["stroke-linecap"] = "round", l["stroke-linejoin"] = "round"), a && (l["stroke-width"] = a), v("svg", l);
|
|
2027
2112
|
}
|
|
2028
2113
|
function v(e, t = {}) {
|
|
2029
|
-
const n = document.createElementNS(
|
|
2030
|
-
for (const [o,
|
|
2031
|
-
n.setAttribute(o,
|
|
2114
|
+
const n = document.createElementNS(wn, e);
|
|
2115
|
+
for (const [o, i] of Object.entries(t))
|
|
2116
|
+
n.setAttribute(o, i);
|
|
2032
2117
|
return n;
|
|
2033
2118
|
}
|
|
2034
|
-
function
|
|
2119
|
+
function Zt(e) {
|
|
2035
2120
|
for (const t of ["keydown", "keypress", "keyup"])
|
|
2036
2121
|
e.addEventListener(t, (n) => {
|
|
2037
2122
|
n.stopPropagation();
|
|
2038
2123
|
});
|
|
2039
2124
|
}
|
|
2040
|
-
function
|
|
2125
|
+
function Ti(e, t, n) {
|
|
2041
2126
|
e.replaceChildren(), e.hidden = t.length === 0;
|
|
2042
|
-
for (const [o,
|
|
2043
|
-
const
|
|
2044
|
-
|
|
2127
|
+
for (const [o, i] of t.entries()) {
|
|
2128
|
+
const a = document.createElement("div");
|
|
2129
|
+
a.className = "pluno-pa-widget__attachment", a.appendChild(Ni(i));
|
|
2045
2130
|
const l = document.createElement("span");
|
|
2046
|
-
l.textContent =
|
|
2131
|
+
l.textContent = i.name, a.appendChild(l);
|
|
2047
2132
|
const p = document.createElement("button");
|
|
2048
|
-
p.type = "button", p.setAttribute("aria-label", `Remove ${
|
|
2133
|
+
p.type = "button", p.setAttribute("aria-label", `Remove ${i.name}`), p.appendChild(Pi()), p.addEventListener("click", () => n(o)), a.appendChild(p), e.appendChild(a);
|
|
2049
2134
|
}
|
|
2050
2135
|
}
|
|
2051
|
-
function
|
|
2052
|
-
if (
|
|
2136
|
+
function Ni(e) {
|
|
2137
|
+
if (Ln(e)) {
|
|
2053
2138
|
const n = document.createElement("img");
|
|
2054
2139
|
return n.src = e.dataUrl, n.alt = "", n.setAttribute("aria-hidden", "true"), n;
|
|
2055
2140
|
}
|
|
2056
2141
|
const t = document.createElement("span");
|
|
2057
2142
|
return t.className = "pluno-pa-widget__attachment-file", t.textContent = "PDF", t;
|
|
2058
2143
|
}
|
|
2059
|
-
function
|
|
2060
|
-
if (
|
|
2061
|
-
const
|
|
2062
|
-
return
|
|
2144
|
+
function Di(e) {
|
|
2145
|
+
if (Ln(e)) {
|
|
2146
|
+
const i = document.createElement("img");
|
|
2147
|
+
return i.src = e.dataUrl, i.alt = e.name, i;
|
|
2063
2148
|
}
|
|
2064
2149
|
const t = document.createElement("div");
|
|
2065
2150
|
t.className = "pluno-pa-widget__message-attachment-file";
|
|
@@ -2068,88 +2153,88 @@ function Ea(e) {
|
|
|
2068
2153
|
const o = document.createElement("strong");
|
|
2069
2154
|
return o.textContent = e.name, t.append(n, o), t;
|
|
2070
2155
|
}
|
|
2071
|
-
function
|
|
2156
|
+
function Ln(e) {
|
|
2072
2157
|
return e.mimeType.startsWith("image/");
|
|
2073
2158
|
}
|
|
2074
|
-
function
|
|
2159
|
+
function Ri(e) {
|
|
2075
2160
|
return e === "application/pdf" ? "document.pdf" : "image";
|
|
2076
2161
|
}
|
|
2077
|
-
async function
|
|
2162
|
+
async function Mi(e) {
|
|
2078
2163
|
if (!e)
|
|
2079
2164
|
return [];
|
|
2080
2165
|
const t = Array.from(e);
|
|
2081
|
-
if (t.length >
|
|
2166
|
+
if (t.length > We)
|
|
2082
2167
|
throw new Error(
|
|
2083
|
-
`Attach up to ${
|
|
2168
|
+
`Attach up to ${We} files per message.`
|
|
2084
2169
|
);
|
|
2085
2170
|
return Promise.all(
|
|
2086
2171
|
t.map(async (n) => {
|
|
2087
|
-
const o =
|
|
2172
|
+
const o = zi(n);
|
|
2088
2173
|
if (!o)
|
|
2089
2174
|
throw new Error(
|
|
2090
2175
|
"Pluno supports PNG, JPEG, WebP, non-animated GIF, and PDF files."
|
|
2091
2176
|
);
|
|
2092
|
-
if (n.size >
|
|
2177
|
+
if (n.size > So)
|
|
2093
2178
|
throw new Error("Each Pluno attachment can be up to 10 MB.");
|
|
2094
2179
|
if (o === "image/gif") {
|
|
2095
|
-
const
|
|
2096
|
-
if (
|
|
2180
|
+
const i = new Uint8Array(await qi(n));
|
|
2181
|
+
if (Oi(i))
|
|
2097
2182
|
throw new Error("Pluno supports non-animated GIF images.");
|
|
2098
2183
|
}
|
|
2099
2184
|
return {
|
|
2100
|
-
name: n.name ||
|
|
2185
|
+
name: n.name || Ri(o),
|
|
2101
2186
|
mimeType: o,
|
|
2102
2187
|
sizeBytes: n.size,
|
|
2103
|
-
dataUrl:
|
|
2104
|
-
await
|
|
2188
|
+
dataUrl: Bi(
|
|
2189
|
+
await ji(n),
|
|
2105
2190
|
o
|
|
2106
2191
|
)
|
|
2107
2192
|
};
|
|
2108
2193
|
})
|
|
2109
2194
|
);
|
|
2110
2195
|
}
|
|
2111
|
-
function
|
|
2112
|
-
if (
|
|
2196
|
+
function zi(e) {
|
|
2197
|
+
if (mn.has(e.type))
|
|
2113
2198
|
return e.type;
|
|
2114
2199
|
const t = e.name.toLowerCase();
|
|
2115
2200
|
return t.endsWith(".png") ? "image/png" : t.endsWith(".jpg") || t.endsWith(".jpeg") ? "image/jpeg" : t.endsWith(".webp") ? "image/webp" : t.endsWith(".gif") ? "image/gif" : t.endsWith(".pdf") ? "application/pdf" : null;
|
|
2116
2201
|
}
|
|
2117
|
-
function
|
|
2202
|
+
function Bi(e, t) {
|
|
2118
2203
|
const n = `data:${t};base64,`;
|
|
2119
2204
|
return e.startsWith(n) ? e : e.replace(/^data:[^;]*;base64,/, n);
|
|
2120
2205
|
}
|
|
2121
|
-
function
|
|
2122
|
-
if (e.length < 14 || !
|
|
2206
|
+
function Oi(e) {
|
|
2207
|
+
if (e.length < 14 || !Ui(e))
|
|
2123
2208
|
return !1;
|
|
2124
2209
|
const t = e[10];
|
|
2125
2210
|
let n = 13;
|
|
2126
2211
|
t & 128 && (n += 3 * 2 ** ((t & 7) + 1));
|
|
2127
2212
|
let o = 0;
|
|
2128
2213
|
for (; n < e.length; ) {
|
|
2129
|
-
const
|
|
2130
|
-
if (n += 1,
|
|
2214
|
+
const i = e[n];
|
|
2215
|
+
if (n += 1, i === 59)
|
|
2131
2216
|
return !1;
|
|
2132
|
-
if (
|
|
2133
|
-
n += 1, n =
|
|
2217
|
+
if (i === 33) {
|
|
2218
|
+
n += 1, n = Jt(e, n);
|
|
2134
2219
|
continue;
|
|
2135
2220
|
}
|
|
2136
|
-
if (
|
|
2221
|
+
if (i !== 44)
|
|
2137
2222
|
return !1;
|
|
2138
2223
|
if (o += 1, o > 1)
|
|
2139
2224
|
return !0;
|
|
2140
2225
|
if (n + 9 >= e.length)
|
|
2141
2226
|
return !1;
|
|
2142
|
-
const
|
|
2143
|
-
if (n += 9,
|
|
2227
|
+
const a = e[n + 8];
|
|
2228
|
+
if (n += 9, a & 128 && (n += 3 * 2 ** ((a & 7) + 1)), n >= e.length)
|
|
2144
2229
|
return !1;
|
|
2145
|
-
n += 1, n =
|
|
2230
|
+
n += 1, n = Jt(e, n);
|
|
2146
2231
|
}
|
|
2147
2232
|
return !1;
|
|
2148
2233
|
}
|
|
2149
|
-
function
|
|
2234
|
+
function Ui(e) {
|
|
2150
2235
|
return e[0] === 71 && e[1] === 73 && e[2] === 70 && e[3] === 56 && (e[4] === 55 || e[4] === 57) && e[5] === 97;
|
|
2151
2236
|
}
|
|
2152
|
-
function
|
|
2237
|
+
function Jt(e, t) {
|
|
2153
2238
|
for (; t < e.length; ) {
|
|
2154
2239
|
const n = e[t];
|
|
2155
2240
|
if (t += 1, n === 0)
|
|
@@ -2158,81 +2243,81 @@ function jt(e, t) {
|
|
|
2158
2243
|
}
|
|
2159
2244
|
return t;
|
|
2160
2245
|
}
|
|
2161
|
-
function
|
|
2246
|
+
function Oe(e) {
|
|
2162
2247
|
return !!(e && Array.from(e.types).includes("Files"));
|
|
2163
2248
|
}
|
|
2164
|
-
function
|
|
2165
|
-
if (!e || !
|
|
2249
|
+
function pt(e, t, n = null) {
|
|
2250
|
+
if (!e || !ht(t, n)) {
|
|
2166
2251
|
e && (e.hidden = !0, e.replaceChildren());
|
|
2167
2252
|
return;
|
|
2168
2253
|
}
|
|
2169
|
-
e.hidden = !1, e.replaceChildren(), e.className = "pluno-pa-widget__billing-status",
|
|
2170
|
-
|
|
2171
|
-
) :
|
|
2254
|
+
e.hidden = !1, e.replaceChildren(), e.className = "pluno-pa-widget__billing-status", J(t) || wt(n) ? e.appendChild(
|
|
2255
|
+
Fi(t, n)
|
|
2256
|
+
) : An(t) && e.appendChild(Hi(t));
|
|
2172
2257
|
}
|
|
2173
|
-
function
|
|
2258
|
+
function Fi(e, t) {
|
|
2174
2259
|
const n = document.createElement("div");
|
|
2175
2260
|
n.className = "pluno-pa-widget__billing-action-card";
|
|
2176
|
-
const o = e.limitExceeded || t === "limit_exceeded",
|
|
2177
|
-
|
|
2178
|
-
const
|
|
2179
|
-
return
|
|
2180
|
-
|
|
2261
|
+
const o = e.limitExceeded || t === "limit_exceeded", i = document.createElement("strong");
|
|
2262
|
+
i.textContent = o ? "Credits used up" : "Billing needs attention", n.appendChild(i);
|
|
2263
|
+
const a = document.createElement("span");
|
|
2264
|
+
return a.textContent = o ? "Earn bonus credits or upgrade to keep using Pluno on this product." : e.paymentIssue ?? "Open billing to keep using Pluno.", n.appendChild(a), n.appendChild(
|
|
2265
|
+
Pn(
|
|
2181
2266
|
e,
|
|
2182
2267
|
"Upgrade plan",
|
|
2183
2268
|
"pluno-pa-widget__billing-action-card-actions"
|
|
2184
2269
|
)
|
|
2185
2270
|
), n;
|
|
2186
2271
|
}
|
|
2187
|
-
function
|
|
2272
|
+
function Hi(e) {
|
|
2188
2273
|
const t = document.createElement("div");
|
|
2189
2274
|
t.className = "pluno-pa-widget__billing-action-card pluno-pa-widget__billing-action-card--low";
|
|
2190
2275
|
const n = document.createElement("strong");
|
|
2191
2276
|
n.textContent = "Credits running low", t.appendChild(n);
|
|
2192
2277
|
const o = document.createElement("span");
|
|
2193
|
-
return o.textContent =
|
|
2194
|
-
|
|
2278
|
+
return o.textContent = Wi(e) ?? "Credits are running low for this period.", t.appendChild(o), t.appendChild(
|
|
2279
|
+
Pn(
|
|
2195
2280
|
e,
|
|
2196
2281
|
"Upgrade",
|
|
2197
2282
|
"pluno-pa-widget__billing-action-card-actions"
|
|
2198
2283
|
)
|
|
2199
2284
|
), t;
|
|
2200
2285
|
}
|
|
2201
|
-
function
|
|
2202
|
-
return e !== null && (
|
|
2286
|
+
function ht(e, t) {
|
|
2287
|
+
return e !== null && (J(e) || An(e) || wt(t));
|
|
2203
2288
|
}
|
|
2204
|
-
function
|
|
2205
|
-
return
|
|
2289
|
+
function Qt(e, t, n) {
|
|
2290
|
+
return ht(t, n) || Gi(t) ? !0 : !ht(e, n);
|
|
2206
2291
|
}
|
|
2207
|
-
function
|
|
2208
|
-
return e != null && (e.creditsUsed !== null || e.creditLimit !== null || e.creditsRemaining !== null ||
|
|
2292
|
+
function Gi(e) {
|
|
2293
|
+
return e != null && (e.creditsUsed !== null || e.creditLimit !== null || e.creditsRemaining !== null || J(e));
|
|
2209
2294
|
}
|
|
2210
|
-
function
|
|
2295
|
+
function J(e) {
|
|
2211
2296
|
return e?.limitExceeded === !0 || !!e?.paymentIssue;
|
|
2212
2297
|
}
|
|
2213
|
-
function
|
|
2298
|
+
function wt(e) {
|
|
2214
2299
|
return e === "limit_exceeded" || e === "subscription_required" || e === "subscription_inactive" || e === "payment_issue" || e === "subscription_invalid" || e === "payment_required";
|
|
2215
2300
|
}
|
|
2216
|
-
function
|
|
2217
|
-
return !
|
|
2301
|
+
function An(e) {
|
|
2302
|
+
return !J(e) && e.creditLimit !== null && e.creditLimit > 0 && e.creditsRemaining !== null && e.creditsRemaining > 0 && e.creditsRemaining / e.creditLimit <= 0.2;
|
|
2218
2303
|
}
|
|
2219
|
-
function
|
|
2220
|
-
return e.creditsRemaining === null ? null : `${
|
|
2304
|
+
function Wi(e) {
|
|
2305
|
+
return e.creditsRemaining === null ? null : `${$i(e.creditsRemaining)} credits left`;
|
|
2221
2306
|
}
|
|
2222
|
-
function
|
|
2307
|
+
function $i(e) {
|
|
2223
2308
|
return new Intl.NumberFormat("en-US", {
|
|
2224
2309
|
maximumFractionDigits: 0
|
|
2225
2310
|
}).format(Math.ceil(e));
|
|
2226
2311
|
}
|
|
2227
|
-
function
|
|
2312
|
+
function Pn(e, t, n) {
|
|
2228
2313
|
const o = document.createElement("div");
|
|
2229
2314
|
return o.className = n, o.appendChild(
|
|
2230
|
-
|
|
2315
|
+
en(t, e.pricingUrl)
|
|
2231
2316
|
), o.appendChild(
|
|
2232
|
-
|
|
2317
|
+
en("Earn credits", e.earnCreditsUrl)
|
|
2233
2318
|
), o;
|
|
2234
2319
|
}
|
|
2235
|
-
function
|
|
2320
|
+
function en(e, t) {
|
|
2236
2321
|
const n = document.createElement("button");
|
|
2237
2322
|
if (n.type = "button", e === "Earn credits") {
|
|
2238
2323
|
const o = document.createElement("span");
|
|
@@ -2243,7 +2328,7 @@ function Yt(e, t) {
|
|
|
2243
2328
|
t.trim().length !== 0 && window.open(t, "_blank", "noopener,noreferrer");
|
|
2244
2329
|
}), n;
|
|
2245
2330
|
}
|
|
2246
|
-
function
|
|
2331
|
+
function qi(e) {
|
|
2247
2332
|
return new Promise((t, n) => {
|
|
2248
2333
|
const o = new FileReader();
|
|
2249
2334
|
o.addEventListener("load", () => {
|
|
@@ -2257,7 +2342,7 @@ function Ba(e) {
|
|
|
2257
2342
|
}), o.readAsArrayBuffer(e);
|
|
2258
2343
|
});
|
|
2259
2344
|
}
|
|
2260
|
-
function
|
|
2345
|
+
function ji(e) {
|
|
2261
2346
|
return new Promise((t, n) => {
|
|
2262
2347
|
const o = new FileReader();
|
|
2263
2348
|
o.addEventListener("load", () => {
|
|
@@ -2271,118 +2356,118 @@ function Oa(e) {
|
|
|
2271
2356
|
}), o.readAsDataURL(e);
|
|
2272
2357
|
});
|
|
2273
2358
|
}
|
|
2274
|
-
function
|
|
2359
|
+
function tn(e, t) {
|
|
2275
2360
|
return e.messages.filter(
|
|
2276
|
-
(o) => !
|
|
2361
|
+
(o) => !In(o)
|
|
2277
2362
|
).length === 0 && !e.assistantDraft && !e.lastError && !e.isThinking && !t;
|
|
2278
2363
|
}
|
|
2279
|
-
function
|
|
2280
|
-
const
|
|
2281
|
-
(_) => !
|
|
2282
|
-
),
|
|
2283
|
-
e.replaceChildren(),
|
|
2284
|
-
const
|
|
2285
|
-
if (o(
|
|
2364
|
+
function Vi(e, t, n, o, i, a, l, p, c, u, d, h, x, y, P) {
|
|
2365
|
+
const T = Yi(a), f = T.filter(
|
|
2366
|
+
(_) => !In(_)
|
|
2367
|
+
), E = e.scrollTop;
|
|
2368
|
+
e.replaceChildren(), Nn(n, a.isThinking), i.hidden = !p, p && l !== null && wi(i, l);
|
|
2369
|
+
const g = f.length > 0 || !!a.assistantDraft || a.isThinking;
|
|
2370
|
+
if (o(g), f.length === 0 && !a.assistantDraft && !a.lastError && !a.isThinking) {
|
|
2286
2371
|
const _ = document.createElement("div");
|
|
2287
2372
|
_.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter";
|
|
2288
|
-
const
|
|
2289
|
-
|
|
2290
|
-
const
|
|
2373
|
+
const N = document.createElement("div");
|
|
2374
|
+
N.className = "pluno-pa-widget__empty-hero";
|
|
2375
|
+
const F = se(
|
|
2291
2376
|
"pluno-pa-widget__character--empty",
|
|
2292
|
-
|
|
2377
|
+
x()
|
|
2293
2378
|
);
|
|
2294
|
-
|
|
2295
|
-
const
|
|
2296
|
-
if (
|
|
2297
|
-
for (const
|
|
2298
|
-
const
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
}),
|
|
2379
|
+
N.appendChild(F), _.appendChild(N), _.appendChild(Cn());
|
|
2380
|
+
const H = document.createElement("div");
|
|
2381
|
+
if (H.className = a.starterPrompts.length > 0 ? "pluno-pa-widget__starter-prompts" : "pluno-pa-widget__starter-prompts pluno-pa-widget__starter-prompts--empty", a.starterPrompts.length === 0 && !a.starterPromptsLoading && H.setAttribute("aria-hidden", "true"), a.starterPrompts.length > 0)
|
|
2382
|
+
for (const L of a.starterPrompts) {
|
|
2383
|
+
const I = document.createElement("button");
|
|
2384
|
+
I.type = "button", I.className = "pluno-pa-widget__starter-prompt", I.textContent = `"${L}"`, I.addEventListener("click", () => {
|
|
2385
|
+
y(L);
|
|
2386
|
+
}), H.appendChild(I);
|
|
2302
2387
|
}
|
|
2303
|
-
else if (
|
|
2304
|
-
const
|
|
2305
|
-
|
|
2388
|
+
else if (a.starterPromptsLoading) {
|
|
2389
|
+
const L = document.createElement("button");
|
|
2390
|
+
L.type = "button", L.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder pluno-pa-widget__starter-prompt--loading", L.disabled = !0, L.tabIndex = -1, L.textContent = "Generating example tasks...", H.appendChild(L);
|
|
2306
2391
|
} else
|
|
2307
|
-
for (let
|
|
2308
|
-
const
|
|
2309
|
-
|
|
2392
|
+
for (let L = 0; L < Lo; L += 1) {
|
|
2393
|
+
const I = document.createElement("button");
|
|
2394
|
+
I.type = "button", I.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder", I.disabled = !0, I.tabIndex = -1, I.textContent = "", H.appendChild(I);
|
|
2310
2395
|
}
|
|
2311
|
-
_.appendChild(
|
|
2396
|
+
_.appendChild(H), e.appendChild(_), e.appendChild(t);
|
|
2312
2397
|
return;
|
|
2313
2398
|
}
|
|
2314
|
-
let
|
|
2315
|
-
const
|
|
2316
|
-
if (
|
|
2399
|
+
let S = null, k = null, R = [];
|
|
2400
|
+
const Ce = f.some(mt), b = () => {
|
|
2401
|
+
if (R.length === 0)
|
|
2317
2402
|
return !1;
|
|
2318
|
-
const _ =
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2403
|
+
const _ = ia(
|
|
2404
|
+
R,
|
|
2405
|
+
d,
|
|
2406
|
+
h,
|
|
2407
|
+
x()
|
|
2323
2408
|
);
|
|
2324
|
-
return e.appendChild(_),
|
|
2409
|
+
return e.appendChild(_), S = null, k = _, R = [], !0;
|
|
2325
2410
|
};
|
|
2326
|
-
for (let _ = 0; _ <
|
|
2327
|
-
const
|
|
2328
|
-
if (
|
|
2329
|
-
|
|
2411
|
+
for (let _ = 0; _ < f.length; _ += 1) {
|
|
2412
|
+
const N = f[_];
|
|
2413
|
+
if (N.role === "tool") {
|
|
2414
|
+
R.push(N);
|
|
2330
2415
|
continue;
|
|
2331
2416
|
}
|
|
2332
|
-
if (
|
|
2333
|
-
if (
|
|
2334
|
-
const
|
|
2335
|
-
e.appendChild(
|
|
2417
|
+
if (mt(N)) {
|
|
2418
|
+
if (b()) {
|
|
2419
|
+
const A = bt();
|
|
2420
|
+
e.appendChild(A), S = null, k = A;
|
|
2336
2421
|
} else {
|
|
2337
|
-
const
|
|
2338
|
-
e.appendChild(
|
|
2422
|
+
const A = an(x());
|
|
2423
|
+
e.appendChild(A), S = null, k = A;
|
|
2339
2424
|
}
|
|
2340
2425
|
continue;
|
|
2341
2426
|
}
|
|
2342
|
-
if (
|
|
2427
|
+
if (N.role === "system")
|
|
2343
2428
|
continue;
|
|
2344
|
-
const
|
|
2345
|
-
if (
|
|
2346
|
-
const
|
|
2347
|
-
e.appendChild(
|
|
2348
|
-
}
|
|
2349
|
-
const
|
|
2350
|
-
|
|
2351
|
-
const
|
|
2352
|
-
|
|
2429
|
+
const F = b(), H = oa(N.content);
|
|
2430
|
+
if (N.role === "assistant" && !F) {
|
|
2431
|
+
const be = Tn(x());
|
|
2432
|
+
e.appendChild(be), S = null, k = be;
|
|
2433
|
+
}
|
|
2434
|
+
const L = document.createElement("div");
|
|
2435
|
+
L.className = `pluno-pa-widget__message pluno-pa-widget__message--${N.role}`, N.role === "assistant" ? ra(L, H) : L.textContent = H, N.role === "user" && N.attachments?.length && L.appendChild(Ki(N.attachments));
|
|
2436
|
+
const I = document.createElement("div");
|
|
2437
|
+
I.className = "pluno-pa-widget__message-actions", I.appendChild(Xi(H)), L.appendChild(I), e.appendChild(L), S = L, k = null;
|
|
2353
2438
|
}
|
|
2354
|
-
const
|
|
2355
|
-
if (
|
|
2356
|
-
if (
|
|
2357
|
-
const _ =
|
|
2358
|
-
e.appendChild(_),
|
|
2439
|
+
const ie = b();
|
|
2440
|
+
if (a.isThinking && !a.assistantDraft && !Ce)
|
|
2441
|
+
if (ie) {
|
|
2442
|
+
const _ = bt();
|
|
2443
|
+
e.appendChild(_), S = null, k = _;
|
|
2359
2444
|
} else {
|
|
2360
|
-
const _ =
|
|
2361
|
-
e.appendChild(_),
|
|
2445
|
+
const _ = an(x());
|
|
2446
|
+
e.appendChild(_), S = null, k = _;
|
|
2362
2447
|
}
|
|
2363
|
-
if (
|
|
2448
|
+
if (a.lastError) {
|
|
2364
2449
|
const _ = document.createElement("div");
|
|
2365
|
-
_.className = "pluno-pa-widget__error", _.textContent =
|
|
2450
|
+
_.className = "pluno-pa-widget__error", _.textContent = a.lastError, e.appendChild(_), S = _, k = null;
|
|
2366
2451
|
}
|
|
2367
|
-
const
|
|
2368
|
-
if (
|
|
2369
|
-
const _ =
|
|
2370
|
-
isDrafting:
|
|
2371
|
-
error:
|
|
2372
|
-
characterIconOptions:
|
|
2373
|
-
onDraft:
|
|
2374
|
-
onDismiss:
|
|
2375
|
-
onDisable:
|
|
2452
|
+
const ae = P && !a.isThinking ? eo(T) : null;
|
|
2453
|
+
if (P && ae && !P.dismissedCandidateIds.has(ae.id)) {
|
|
2454
|
+
const _ = Zi(ae, {
|
|
2455
|
+
isDrafting: P.draftingCandidateId === ae.id,
|
|
2456
|
+
error: P.error,
|
|
2457
|
+
characterIconOptions: P.characterIconOptions,
|
|
2458
|
+
onDraft: P.onDraft,
|
|
2459
|
+
onDismiss: P.onDismiss,
|
|
2460
|
+
onDisable: P.onDisable
|
|
2376
2461
|
});
|
|
2377
|
-
e.appendChild(_),
|
|
2462
|
+
e.appendChild(_), P.onSeen(ae), S = null, k = _;
|
|
2378
2463
|
}
|
|
2379
|
-
|
|
2464
|
+
S?.classList.add(
|
|
2380
2465
|
"pluno-pa-widget__message--bottom-reserve"
|
|
2381
|
-
),
|
|
2466
|
+
), k?.classList.add(
|
|
2382
2467
|
"pluno-pa-widget__bottom-reserve-compact"
|
|
2383
|
-
), e.appendChild(t), c ?
|
|
2468
|
+
), e.appendChild(t), c ? Ie(e, u) : e.scrollTop = E;
|
|
2384
2469
|
}
|
|
2385
|
-
function
|
|
2470
|
+
function Yi(e) {
|
|
2386
2471
|
if (!e.assistantDraft)
|
|
2387
2472
|
return [...e.messages];
|
|
2388
2473
|
const t = {
|
|
@@ -2397,12 +2482,12 @@ function Fa(e) {
|
|
|
2397
2482
|
if (!t.respondsToUserMessageId)
|
|
2398
2483
|
return [...e.messages, t];
|
|
2399
2484
|
const n = e.messages.findIndex(
|
|
2400
|
-
(
|
|
2485
|
+
(a) => a.role === "user" && a.id === t.respondsToUserMessageId
|
|
2401
2486
|
);
|
|
2402
2487
|
if (n === -1)
|
|
2403
2488
|
return [...e.messages, t];
|
|
2404
2489
|
const o = e.messages.findIndex(
|
|
2405
|
-
(
|
|
2490
|
+
(a, l) => l > n && a.role !== "user" && a.respondsToUserMessageId === t.respondsToUserMessageId && nn(a, t) && mt(a)
|
|
2406
2491
|
);
|
|
2407
2492
|
if (o !== -1)
|
|
2408
2493
|
return [
|
|
@@ -2410,73 +2495,73 @@ function Fa(e) {
|
|
|
2410
2495
|
t,
|
|
2411
2496
|
...e.messages.slice(o + 1)
|
|
2412
2497
|
];
|
|
2413
|
-
let
|
|
2414
|
-
for (;
|
|
2415
|
-
|
|
2498
|
+
let i = n + 1;
|
|
2499
|
+
for (; i < e.messages.length && e.messages[i].role !== "user" && e.messages[i].respondsToUserMessageId === t.respondsToUserMessageId && nn(e.messages[i], t); )
|
|
2500
|
+
i += 1;
|
|
2416
2501
|
return [
|
|
2417
|
-
...e.messages.slice(0,
|
|
2502
|
+
...e.messages.slice(0, i),
|
|
2418
2503
|
t,
|
|
2419
|
-
...e.messages.slice(
|
|
2504
|
+
...e.messages.slice(i)
|
|
2420
2505
|
];
|
|
2421
2506
|
}
|
|
2422
|
-
function
|
|
2507
|
+
function mt(e) {
|
|
2423
2508
|
return e.role === "system" && e.dataType === "run_status" && e.loading === !0;
|
|
2424
2509
|
}
|
|
2425
|
-
function
|
|
2510
|
+
function nn(e, t) {
|
|
2426
2511
|
return !e.runId || !t.runId ? !0 : e.runId === t.runId;
|
|
2427
2512
|
}
|
|
2428
|
-
function
|
|
2429
|
-
e.replaceChildren(),
|
|
2513
|
+
function on(e, t, n, o, i, a, l, p) {
|
|
2514
|
+
e.replaceChildren(), Nn(t, !1), t.disabled = !0, n(!1);
|
|
2430
2515
|
const c = document.createElement("div");
|
|
2431
2516
|
c.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter";
|
|
2432
|
-
const u =
|
|
2517
|
+
const u = se(
|
|
2433
2518
|
"pluno-pa-widget__character--empty",
|
|
2434
2519
|
o()
|
|
2435
2520
|
);
|
|
2436
2521
|
c.appendChild(u);
|
|
2437
|
-
const
|
|
2438
|
-
if (
|
|
2439
|
-
const
|
|
2440
|
-
|
|
2522
|
+
const d = document.createElement("div");
|
|
2523
|
+
if (d.className = "pluno-pa-widget__empty", d.textContent = i, c.appendChild(d), l) {
|
|
2524
|
+
const h = document.createElement("a");
|
|
2525
|
+
h.className = "pluno-pa-widget__login", h.href = l, h.target = "_blank", h.rel = "noopener noreferrer", h.textContent = a, c.appendChild(h);
|
|
2441
2526
|
} else {
|
|
2442
|
-
const
|
|
2443
|
-
|
|
2527
|
+
const h = document.createElement("button");
|
|
2528
|
+
h.type = "button", h.className = "pluno-pa-widget__login", h.textContent = a, h.addEventListener("click", () => p?.()), c.appendChild(h);
|
|
2444
2529
|
}
|
|
2445
2530
|
e.appendChild(c);
|
|
2446
2531
|
}
|
|
2447
|
-
function
|
|
2532
|
+
function Ki(e) {
|
|
2448
2533
|
const t = document.createElement("div");
|
|
2449
2534
|
t.className = "pluno-pa-widget__message-attachments";
|
|
2450
2535
|
for (const n of e)
|
|
2451
|
-
t.appendChild(
|
|
2536
|
+
t.appendChild(Di(n));
|
|
2452
2537
|
return t;
|
|
2453
2538
|
}
|
|
2454
|
-
function
|
|
2539
|
+
function Xi(e) {
|
|
2455
2540
|
const t = document.createElement("button");
|
|
2456
|
-
return t.type = "button", t.className = "pluno-pa-widget__message-copy", t.setAttribute("aria-label", "Copy message"), t.title = "Copy message", t.appendChild(
|
|
2541
|
+
return t.type = "button", t.className = "pluno-pa-widget__message-copy", t.setAttribute("aria-label", "Copy message"), t.title = "Copy message", t.appendChild(Ii()), t.addEventListener("click", (n) => {
|
|
2457
2542
|
n.preventDefault(), n.stopPropagation(), navigator.clipboard.writeText(e);
|
|
2458
2543
|
}), t;
|
|
2459
2544
|
}
|
|
2460
|
-
function
|
|
2545
|
+
function Zi(e, t) {
|
|
2461
2546
|
const n = document.createElement("article");
|
|
2462
2547
|
n.className = "pluno-pa-widget__share-prompt";
|
|
2463
2548
|
const o = document.createElement("div");
|
|
2464
2549
|
o.className = "pluno-pa-widget__share-prompt-body", o.appendChild(
|
|
2465
|
-
|
|
2550
|
+
se(
|
|
2466
2551
|
"pluno-pa-widget__share-prompt-icon",
|
|
2467
2552
|
t.characterIconOptions
|
|
2468
2553
|
)
|
|
2469
2554
|
);
|
|
2470
|
-
const
|
|
2471
|
-
|
|
2472
|
-
const
|
|
2473
|
-
|
|
2555
|
+
const i = document.createElement("div");
|
|
2556
|
+
i.className = "pluno-pa-widget__share-prompt-copy";
|
|
2557
|
+
const a = document.createElement("strong");
|
|
2558
|
+
a.textContent = "Share this win?", i.appendChild(a);
|
|
2474
2559
|
const l = document.createElement("span");
|
|
2475
|
-
if (l.textContent = t.isDrafting ? "Drafting social post..." : "Create a screenshot and generate a draft for a social post.",
|
|
2476
|
-
const
|
|
2477
|
-
|
|
2560
|
+
if (l.textContent = t.isDrafting ? "Drafting social post..." : "Create a screenshot and generate a draft for a social post.", i.appendChild(l), t.error) {
|
|
2561
|
+
const d = document.createElement("span");
|
|
2562
|
+
d.className = "pluno-pa-widget__share-prompt-error", d.textContent = t.error, i.appendChild(d);
|
|
2478
2563
|
}
|
|
2479
|
-
o.appendChild(
|
|
2564
|
+
o.appendChild(i);
|
|
2480
2565
|
const p = document.createElement("div");
|
|
2481
2566
|
p.className = "pluno-pa-widget__share-prompt-actions";
|
|
2482
2567
|
const c = document.createElement("div");
|
|
@@ -2484,85 +2569,85 @@ function Ha(e, t) {
|
|
|
2484
2569
|
const u = document.createElement("button");
|
|
2485
2570
|
if (u.type = "button", u.disabled = t.isDrafting, u.addEventListener("click", () => {
|
|
2486
2571
|
t.onDraft(e);
|
|
2487
|
-
}), t.isDrafting ? (u.appendChild(
|
|
2572
|
+
}), t.isDrafting ? (u.appendChild(ft()), u.appendChild(document.createTextNode("Drafting..."))) : u.textContent = "Draft a social post", c.appendChild(u), t.isDrafting)
|
|
2488
2573
|
p.appendChild(c);
|
|
2489
2574
|
else {
|
|
2490
|
-
const
|
|
2491
|
-
|
|
2575
|
+
const d = document.createElement("button");
|
|
2576
|
+
d.type = "button", d.className = "pluno-pa-widget__share-prompt-dismiss", d.setAttribute("aria-label", "Dismiss share prompt"), d.title = "Dismiss", d.textContent = "Dismiss", d.addEventListener("click", () => {
|
|
2492
2577
|
t.onDismiss(e);
|
|
2493
|
-
}), c.appendChild(
|
|
2494
|
-
const
|
|
2495
|
-
|
|
2578
|
+
}), c.appendChild(d), p.appendChild(c);
|
|
2579
|
+
const h = document.createElement("button");
|
|
2580
|
+
h.type = "button", h.className = "pluno-pa-widget__share-prompt-disable", h.textContent = "Don't ask again", h.addEventListener("click", () => {
|
|
2496
2581
|
t.onDisable(e);
|
|
2497
|
-
}), p.appendChild(
|
|
2582
|
+
}), p.appendChild(h);
|
|
2498
2583
|
}
|
|
2499
2584
|
return o.appendChild(p), n.appendChild(o), n;
|
|
2500
2585
|
}
|
|
2501
|
-
function
|
|
2586
|
+
function Ji(e, t) {
|
|
2502
2587
|
const n = document.createElement("div");
|
|
2503
|
-
n.className = "pluno-pa-widget__share-dialog-backdrop", n.addEventListener("click", (
|
|
2504
|
-
|
|
2588
|
+
n.className = "pluno-pa-widget__share-dialog-backdrop", n.addEventListener("click", (f) => {
|
|
2589
|
+
f.target === n && t.onClose();
|
|
2505
2590
|
});
|
|
2506
2591
|
const o = document.createElement("section");
|
|
2507
2592
|
o.className = "pluno-pa-widget__share-dialog", o.setAttribute("role", "dialog"), o.setAttribute("aria-modal", "true"), o.setAttribute("aria-label", "Draft a social post");
|
|
2508
|
-
const
|
|
2509
|
-
|
|
2593
|
+
const i = document.createElement("header"), a = document.createElement("strong");
|
|
2594
|
+
a.textContent = "Share this win", i.appendChild(a);
|
|
2510
2595
|
const l = document.createElement("button");
|
|
2511
|
-
l.type = "button", l.setAttribute("aria-label", "Close"), l.textContent = "×", l.addEventListener("click", t.onClose),
|
|
2596
|
+
l.type = "button", l.setAttribute("aria-label", "Close"), l.textContent = "×", l.addEventListener("click", t.onClose), i.appendChild(l), o.appendChild(i);
|
|
2512
2597
|
const p = document.createElement("p");
|
|
2513
2598
|
p.className = "pluno-pa-widget__share-dialog-status", p.hidden = !0;
|
|
2514
2599
|
const c = document.createElement("div");
|
|
2515
2600
|
c.className = "pluno-pa-widget__share-dialog-step";
|
|
2516
2601
|
const u = document.createElement("div");
|
|
2517
2602
|
u.className = "pluno-pa-widget__share-dialog-step-header";
|
|
2518
|
-
const
|
|
2519
|
-
|
|
2520
|
-
const
|
|
2603
|
+
const d = document.createElement("strong");
|
|
2604
|
+
d.textContent = "1) Copy Screenshot", u.appendChild(d);
|
|
2605
|
+
const h = Qi(
|
|
2521
2606
|
"Copy Screenshot",
|
|
2522
2607
|
async () => {
|
|
2523
2608
|
try {
|
|
2524
|
-
return await
|
|
2609
|
+
return await to(e.screenshotDataUrl ?? ""), p.textContent = "", p.hidden = !0, !0;
|
|
2525
2610
|
} catch {
|
|
2526
2611
|
return p.textContent = "Could not copy screenshot.", p.hidden = !1, !1;
|
|
2527
2612
|
}
|
|
2528
2613
|
}
|
|
2529
2614
|
);
|
|
2530
|
-
if (u.appendChild(
|
|
2531
|
-
const
|
|
2532
|
-
|
|
2533
|
-
const
|
|
2534
|
-
|
|
2615
|
+
if (u.appendChild(h), c.appendChild(u), e.screenshotDataUrl) {
|
|
2616
|
+
const f = document.createElement("div");
|
|
2617
|
+
f.className = "pluno-pa-widget__share-dialog-screenshot";
|
|
2618
|
+
const E = document.createElement("img");
|
|
2619
|
+
E.src = e.screenshotDataUrl, E.alt = "Product page with Pluno open", f.appendChild(E), c.appendChild(f);
|
|
2535
2620
|
}
|
|
2536
2621
|
o.appendChild(c), o.appendChild(p);
|
|
2537
|
-
const
|
|
2538
|
-
|
|
2539
|
-
const
|
|
2540
|
-
|
|
2541
|
-
const
|
|
2542
|
-
|
|
2543
|
-
const
|
|
2544
|
-
|
|
2545
|
-
for (const
|
|
2546
|
-
const
|
|
2547
|
-
|
|
2622
|
+
const x = document.createElement("div");
|
|
2623
|
+
x.className = "pluno-pa-widget__share-dialog-step";
|
|
2624
|
+
const y = document.createElement("strong");
|
|
2625
|
+
y.className = "pluno-pa-widget__share-dialog-step-title", y.textContent = "2) Share on", x.appendChild(y);
|
|
2626
|
+
const P = document.createElement("p");
|
|
2627
|
+
P.className = "pluno-pa-widget__share-dialog-hint", P.textContent = "Post draft opens prefilled on supported platforms.", x.appendChild(P);
|
|
2628
|
+
const T = document.createElement("footer");
|
|
2629
|
+
T.className = "pluno-pa-widget__share-dialog-platforms";
|
|
2630
|
+
for (const f of ea(e)) {
|
|
2631
|
+
const E = document.createElement("a");
|
|
2632
|
+
E.href = f.href, E.target = "_blank", E.rel = "noopener noreferrer", E.title = f.label, E.setAttribute("aria-label", `Open ${f.label}`), E.appendChild(ta(f.id)), T.appendChild(E);
|
|
2548
2633
|
}
|
|
2549
|
-
if (
|
|
2550
|
-
const
|
|
2551
|
-
|
|
2552
|
-
const
|
|
2553
|
-
|
|
2554
|
-
const
|
|
2555
|
-
|
|
2634
|
+
if (x.appendChild(T), o.appendChild(x), t.socialPostRewardsUrl) {
|
|
2635
|
+
const f = document.createElement("div");
|
|
2636
|
+
f.className = "pluno-pa-widget__share-dialog-step";
|
|
2637
|
+
const E = document.createElement("strong");
|
|
2638
|
+
E.className = "pluno-pa-widget__share-dialog-step-title", E.textContent = "3) Submit post to get 2000 free credits!", f.appendChild(E);
|
|
2639
|
+
const g = document.createElement("a");
|
|
2640
|
+
g.className = "pluno-pa-widget__share-dialog-reward-link", g.href = t.socialPostRewardsUrl, g.target = "_blank", g.rel = "noopener noreferrer", g.appendChild(document.createTextNode("Submit post URL")), g.appendChild(na()), f.appendChild(g), o.appendChild(f);
|
|
2556
2641
|
}
|
|
2557
2642
|
return n.appendChild(o), n;
|
|
2558
2643
|
}
|
|
2559
|
-
function
|
|
2644
|
+
function Qi(e, t) {
|
|
2560
2645
|
const n = document.createElement("button");
|
|
2561
2646
|
return n.type = "button", n.className = "pluno-pa-widget__share-dialog-copy", n.textContent = e, n.addEventListener("click", async (o) => {
|
|
2562
2647
|
o.preventDefault(), o.stopPropagation(), await t() && (n.textContent = "Copied ✓");
|
|
2563
2648
|
}), n;
|
|
2564
2649
|
}
|
|
2565
|
-
function
|
|
2650
|
+
function ea(e) {
|
|
2566
2651
|
const t = e.linkedinPost.trim(), n = e.xPost.trim();
|
|
2567
2652
|
return [
|
|
2568
2653
|
{
|
|
@@ -2582,90 +2667,90 @@ function qa(e) {
|
|
|
2582
2667
|
}
|
|
2583
2668
|
];
|
|
2584
2669
|
}
|
|
2585
|
-
function
|
|
2670
|
+
function ta(e) {
|
|
2586
2671
|
const t = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
2587
|
-
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" ? (
|
|
2672
|
+
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(
|
|
2588
2673
|
t,
|
|
2589
2674
|
"M6.4 6.9c.6-.5 1.6-.5 2.1.1.7.7.5 1.8-.2 2.3-.8.5-1.9.2-2.3-.6-.2-.6 0-1.3.4-1.8Z"
|
|
2590
|
-
),
|
|
2675
|
+
), U(t, "M14.4 13.3c.1 3.8.1 7.8 0 11.9"), U(
|
|
2591
2676
|
t,
|
|
2592
2677
|
"M14.8 16.2c1.2-2 3-3.1 5.1-2.9 3.4.3 4.8 2.7 4.8 6.2 0 1.9-.1 3.8-.1 5.8"
|
|
2593
|
-
),
|
|
2678
|
+
), U(t, "M20 18c.1 2.2.1 4.7 0 7.2"), t) : e === "x" ? (U(t, "M7.2 7.4c5.6 6.4 10.9 12.2 17.7 17.2"), U(t, "M24.4 7.2c-5.1 6.3-10.6 11.8-17 17.8"), U(t, "M9.1 8.2c5.1 5.6 9.7 10.8 15 15.5", "0.55"), t) : (U(
|
|
2594
2679
|
t,
|
|
2595
2680
|
"M10.2 6.4c3.8-.3 8-.3 11.6.1 2.5.3 3.8 1.8 4 4 .4 3.3.4 7.4 0 10.9-.3 2.4-1.7 3.8-4 4.1-3.8.4-8.2.4-11.8 0-2.3-.3-3.7-1.8-4-4.1-.4-3.5-.3-7.8.1-11.1.2-2.2 1.8-3.6 4.1-3.9Z"
|
|
2596
|
-
),
|
|
2681
|
+
), U(
|
|
2597
2682
|
t,
|
|
2598
2683
|
"M11 7.3c3.4-.4 7.1-.4 10.2.1 2 .3 3.1 1.4 3.4 3.2.4 3 .4 6.6.1 9.9-.3 2.2-1.3 3.3-3.3 3.7-3.2.5-7.2.5-10.5.1",
|
|
2599
2684
|
"0.48"
|
|
2600
|
-
),
|
|
2685
|
+
), U(
|
|
2601
2686
|
t,
|
|
2602
2687
|
"M12.1 16.1c.1-2.4 1.8-4.1 4-4.2 2.4-.1 4.2 1.6 4.3 4 .1 2.3-1.6 4.1-3.9 4.2-2.6.2-4.3-1.5-4.4-4Z"
|
|
2603
|
-
),
|
|
2688
|
+
), U(
|
|
2604
2689
|
t,
|
|
2605
2690
|
"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"
|
|
2606
2691
|
), t);
|
|
2607
2692
|
}
|
|
2608
|
-
function
|
|
2693
|
+
function U(e, t, n) {
|
|
2609
2694
|
const o = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
2610
2695
|
o.setAttribute("d", t), n && o.setAttribute("opacity", n), e.appendChild(o);
|
|
2611
2696
|
}
|
|
2612
|
-
function
|
|
2697
|
+
function na() {
|
|
2613
2698
|
const e = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
2614
|
-
return e.setAttribute("class", "pluno-pa-widget__share-dialog-external-icon"), e.setAttribute("viewBox", "0 0 24 24"), e.setAttribute("aria-hidden", "true"),
|
|
2699
|
+
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(
|
|
2615
2700
|
e,
|
|
2616
2701
|
"M18 13v5a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1h5"
|
|
2617
2702
|
), e;
|
|
2618
2703
|
}
|
|
2619
|
-
function
|
|
2620
|
-
return e.role === "tool" && e.toolName ===
|
|
2704
|
+
function In(e) {
|
|
2705
|
+
return e.role === "tool" && e.toolName === un;
|
|
2621
2706
|
}
|
|
2622
|
-
function
|
|
2707
|
+
function oa(e) {
|
|
2623
2708
|
return e.replace(/\uE200[^\uE201]*(?:\uE201|$)/g, "");
|
|
2624
2709
|
}
|
|
2625
|
-
function
|
|
2626
|
-
const
|
|
2627
|
-
|
|
2710
|
+
function ia(e, t, n, o) {
|
|
2711
|
+
const i = document.createElement("article");
|
|
2712
|
+
i.className = "pluno-pa-widget__tool-group", i.title = new Date(
|
|
2628
2713
|
e[e.length - 1].createdAt
|
|
2629
|
-
).toLocaleString(),
|
|
2630
|
-
|
|
2714
|
+
).toLocaleString(), i.appendChild(
|
|
2715
|
+
se(
|
|
2631
2716
|
"pluno-pa-widget__character--tool-group",
|
|
2632
2717
|
o
|
|
2633
2718
|
)
|
|
2634
2719
|
);
|
|
2635
|
-
const
|
|
2636
|
-
|
|
2637
|
-
|
|
2720
|
+
const a = document.createElement("details"), l = aa(e);
|
|
2721
|
+
a.open = t.has(l), i.classList.toggle("pluno-pa-widget__tool-group--open", a.open), a.addEventListener("toggle", () => {
|
|
2722
|
+
i.classList.toggle("pluno-pa-widget__tool-group--open", a.open), a.open ? t.add(l) : t.delete(l), n();
|
|
2638
2723
|
});
|
|
2639
2724
|
const p = document.createElement("summary");
|
|
2640
|
-
p.className = "pluno-pa-widget__tool-summary", e.some((
|
|
2725
|
+
p.className = "pluno-pa-widget__tool-summary", e.some((d) => d.loading) && p.appendChild(ft());
|
|
2641
2726
|
const u = document.createElement("span");
|
|
2642
|
-
if (u.className = "pluno-pa-widget__tool-summary-title", u.textContent = e[e.length - 1].content || "Run tool", p.appendChild(u),
|
|
2643
|
-
const
|
|
2644
|
-
|
|
2645
|
-
for (const
|
|
2646
|
-
const
|
|
2647
|
-
|
|
2648
|
-
const
|
|
2649
|
-
|
|
2650
|
-
}
|
|
2651
|
-
|
|
2727
|
+
if (u.className = "pluno-pa-widget__tool-summary-title", u.textContent = e[e.length - 1].content || "Run tool", p.appendChild(u), a.appendChild(p), e.length > 0) {
|
|
2728
|
+
const d = document.createElement("div");
|
|
2729
|
+
d.className = "pluno-pa-widget__tool-lines";
|
|
2730
|
+
for (const h of e) {
|
|
2731
|
+
const x = document.createElement("div");
|
|
2732
|
+
x.className = "pluno-pa-widget__tool-line", h.loading && x.appendChild(ft());
|
|
2733
|
+
const y = document.createElement("span");
|
|
2734
|
+
y.textContent = h.content || "Run tool", x.appendChild(y), d.appendChild(x);
|
|
2735
|
+
}
|
|
2736
|
+
a.appendChild(d);
|
|
2652
2737
|
}
|
|
2653
|
-
return
|
|
2738
|
+
return i.appendChild(a), i;
|
|
2654
2739
|
}
|
|
2655
|
-
function
|
|
2740
|
+
function Tn(e) {
|
|
2656
2741
|
const t = document.createElement("article");
|
|
2657
2742
|
return t.className = "pluno-pa-widget__tool-group pluno-pa-widget__assistant-marker", t.appendChild(
|
|
2658
|
-
|
|
2743
|
+
se(
|
|
2659
2744
|
"pluno-pa-widget__character--tool-group",
|
|
2660
2745
|
e
|
|
2661
2746
|
)
|
|
2662
2747
|
), t;
|
|
2663
2748
|
}
|
|
2664
|
-
function
|
|
2665
|
-
const t =
|
|
2666
|
-
return t.classList.add("pluno-pa-widget__thinking-marker"), t.appendChild(
|
|
2749
|
+
function an(e) {
|
|
2750
|
+
const t = Tn(e);
|
|
2751
|
+
return t.classList.add("pluno-pa-widget__thinking-marker"), t.appendChild(bt()), t;
|
|
2667
2752
|
}
|
|
2668
|
-
function
|
|
2753
|
+
function bt() {
|
|
2669
2754
|
const e = document.createElement("div");
|
|
2670
2755
|
e.className = "pluno-pa-widget__status";
|
|
2671
2756
|
const t = document.createElement("span");
|
|
@@ -2673,79 +2758,79 @@ function dt() {
|
|
|
2673
2758
|
const n = document.createElement("span");
|
|
2674
2759
|
return n.textContent = "Thinking...", e.appendChild(n), e;
|
|
2675
2760
|
}
|
|
2676
|
-
function
|
|
2761
|
+
function aa(e) {
|
|
2677
2762
|
return `tools:${e[0]?.id ?? ""}`;
|
|
2678
2763
|
}
|
|
2679
|
-
function
|
|
2764
|
+
function ft() {
|
|
2680
2765
|
const e = document.createElement("span");
|
|
2681
2766
|
return e.className = "pluno-pa-widget__spinner", e.setAttribute("aria-hidden", "true"), e;
|
|
2682
2767
|
}
|
|
2683
|
-
function
|
|
2684
|
-
e.setAttribute("aria-label", t ? "Stop" : "Send"), e.classList.toggle("pluno-pa-widget__send--stop", t), e.replaceChildren(t ?
|
|
2768
|
+
function Nn(e, t) {
|
|
2769
|
+
e.setAttribute("aria-label", t ? "Stop" : "Send"), e.classList.toggle("pluno-pa-widget__send--stop", t), e.replaceChildren(t ? Ai() : kn());
|
|
2685
2770
|
}
|
|
2686
|
-
function
|
|
2771
|
+
function ra(e, t) {
|
|
2687
2772
|
const n = t.replace(/\r\n/g, `
|
|
2688
2773
|
`).split(`
|
|
2689
2774
|
`);
|
|
2690
2775
|
let o = 0;
|
|
2691
2776
|
for (; o < n.length; ) {
|
|
2692
|
-
const
|
|
2693
|
-
if (!
|
|
2777
|
+
const i = n[o];
|
|
2778
|
+
if (!i.trim()) {
|
|
2694
2779
|
o += 1;
|
|
2695
2780
|
continue;
|
|
2696
2781
|
}
|
|
2697
|
-
if (
|
|
2782
|
+
if (i.match(/^```(\w+)?\s*$/)) {
|
|
2698
2783
|
const u = [];
|
|
2699
2784
|
for (o += 1; o < n.length && !/^```\s*$/.test(n[o]); )
|
|
2700
2785
|
u.push(n[o]), o += 1;
|
|
2701
2786
|
o += o < n.length ? 1 : 0;
|
|
2702
|
-
const
|
|
2703
|
-
|
|
2704
|
-
`),
|
|
2787
|
+
const d = document.createElement("pre"), h = document.createElement("code");
|
|
2788
|
+
h.textContent = u.join(`
|
|
2789
|
+
`), d.appendChild(h), e.appendChild(d);
|
|
2705
2790
|
continue;
|
|
2706
2791
|
}
|
|
2707
|
-
const l =
|
|
2792
|
+
const l = i.match(/^(#{1,3})\s+(.+)$/);
|
|
2708
2793
|
if (l) {
|
|
2709
2794
|
const u = document.createElement(`h${l[1].length + 2}`);
|
|
2710
|
-
|
|
2795
|
+
Ue(u, l[2]), e.appendChild(u), o += 1;
|
|
2711
2796
|
continue;
|
|
2712
2797
|
}
|
|
2713
|
-
if (/^\s*[-*+]\s+/.test(
|
|
2798
|
+
if (/^\s*[-*+]\s+/.test(i)) {
|
|
2714
2799
|
const u = document.createElement("ul");
|
|
2715
2800
|
for (; o < n.length && /^\s*[-*+]\s+/.test(n[o]); ) {
|
|
2716
|
-
const
|
|
2717
|
-
|
|
2801
|
+
const d = document.createElement("li");
|
|
2802
|
+
Ue(d, n[o].replace(/^\s*[-*+]\s+/, "")), u.appendChild(d), o += 1;
|
|
2718
2803
|
}
|
|
2719
2804
|
e.appendChild(u);
|
|
2720
2805
|
continue;
|
|
2721
2806
|
}
|
|
2722
|
-
if (/^\s*\d+\.\s+/.test(
|
|
2807
|
+
if (/^\s*\d+\.\s+/.test(i)) {
|
|
2723
2808
|
const u = document.createElement("ol");
|
|
2724
2809
|
for (; o < n.length && /^\s*\d+\.\s+/.test(n[o]); ) {
|
|
2725
|
-
const
|
|
2726
|
-
|
|
2810
|
+
const d = document.createElement("li");
|
|
2811
|
+
Ue(d, n[o].replace(/^\s*\d+\.\s+/, "")), u.appendChild(d), o += 1;
|
|
2727
2812
|
}
|
|
2728
2813
|
e.appendChild(u);
|
|
2729
2814
|
continue;
|
|
2730
2815
|
}
|
|
2731
|
-
const p = [
|
|
2816
|
+
const p = [i];
|
|
2732
2817
|
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]); )
|
|
2733
2818
|
p.push(n[o]), o += 1;
|
|
2734
2819
|
const c = document.createElement("p");
|
|
2735
|
-
p.forEach((u,
|
|
2736
|
-
|
|
2820
|
+
p.forEach((u, d) => {
|
|
2821
|
+
d > 0 && c.appendChild(document.createElement("br")), Ue(c, u);
|
|
2737
2822
|
}), e.appendChild(c);
|
|
2738
2823
|
}
|
|
2739
2824
|
}
|
|
2740
|
-
function
|
|
2825
|
+
function Ue(e, t) {
|
|
2741
2826
|
const n = /(`[^`]+`|\*\*[^*]+\*\*|\*[^*]+\*|\[[^\]]+\]\(([^)\s]+)\))/g;
|
|
2742
2827
|
let o = 0;
|
|
2743
|
-
for (const
|
|
2744
|
-
const
|
|
2745
|
-
|
|
2746
|
-
document.createTextNode(t.slice(o,
|
|
2828
|
+
for (const i of t.matchAll(n)) {
|
|
2829
|
+
const a = i.index ?? 0;
|
|
2830
|
+
a > o && e.appendChild(
|
|
2831
|
+
document.createTextNode(t.slice(o, a))
|
|
2747
2832
|
);
|
|
2748
|
-
const l =
|
|
2833
|
+
const l = i[0];
|
|
2749
2834
|
if (l.startsWith("`")) {
|
|
2750
2835
|
const p = document.createElement("code");
|
|
2751
2836
|
p.textContent = l.slice(1, -1), e.appendChild(p);
|
|
@@ -2757,17 +2842,17 @@ function Be(e, t) {
|
|
|
2757
2842
|
p.textContent = l.slice(1, -1), e.appendChild(p);
|
|
2758
2843
|
} else {
|
|
2759
2844
|
const p = l.match(/^\[([^\]]+)\]\(([^)\s]+)\)$/);
|
|
2760
|
-
if (p &&
|
|
2845
|
+
if (p && la(p[2])) {
|
|
2761
2846
|
const c = document.createElement("a");
|
|
2762
2847
|
c.href = p[2], c.target = "_top", c.rel = "noreferrer", c.textContent = p[1], e.appendChild(c);
|
|
2763
2848
|
} else
|
|
2764
2849
|
e.appendChild(document.createTextNode(l));
|
|
2765
2850
|
}
|
|
2766
|
-
o =
|
|
2851
|
+
o = a + l.length;
|
|
2767
2852
|
}
|
|
2768
2853
|
o < t.length && e.appendChild(document.createTextNode(t.slice(o)));
|
|
2769
2854
|
}
|
|
2770
|
-
function
|
|
2855
|
+
function la(e) {
|
|
2771
2856
|
if (e.startsWith("/") || e.startsWith("#"))
|
|
2772
2857
|
return !0;
|
|
2773
2858
|
try {
|
|
@@ -2777,8 +2862,8 @@ function Ja(e) {
|
|
|
2777
2862
|
return !1;
|
|
2778
2863
|
}
|
|
2779
2864
|
}
|
|
2780
|
-
function
|
|
2781
|
-
if (
|
|
2865
|
+
function rn(e, t) {
|
|
2866
|
+
if (pa(e))
|
|
2782
2867
|
return;
|
|
2783
2868
|
const n = `
|
|
2784
2869
|
:host {
|
|
@@ -2831,7 +2916,7 @@ function Qt(e, t) {
|
|
|
2831
2916
|
--pluno-pa-accent-contrast: #fafafa;
|
|
2832
2917
|
position: fixed;
|
|
2833
2918
|
z-index: 2147483645;
|
|
2834
|
-
font-family: ${
|
|
2919
|
+
font-family: ${Z.fontFamily};
|
|
2835
2920
|
font-size: 14px;
|
|
2836
2921
|
color: var(--pluno-pa-text);
|
|
2837
2922
|
width: var(--pluno-pa-launcher-width);
|
|
@@ -2894,7 +2979,7 @@ function Qt(e, t) {
|
|
|
2894
2979
|
right: 0;
|
|
2895
2980
|
bottom: 0;
|
|
2896
2981
|
width: var(--pluno-pa-launcher-width);
|
|
2897
|
-
height:
|
|
2982
|
+
height: var(--pluno-pa-launcher-height);
|
|
2898
2983
|
border: 0;
|
|
2899
2984
|
border-radius: 21px;
|
|
2900
2985
|
background: var(--pluno-pa-surface);
|
|
@@ -2954,19 +3039,94 @@ function Qt(e, t) {
|
|
|
2954
3039
|
}
|
|
2955
3040
|
.pluno-pa-widget__launcher-input {
|
|
2956
3041
|
width: 100%;
|
|
3042
|
+
min-width: 0;
|
|
2957
3043
|
height: 22px;
|
|
2958
3044
|
border: 0;
|
|
2959
3045
|
outline: none;
|
|
2960
3046
|
background: transparent;
|
|
2961
3047
|
color: var(--pluno-pa-text);
|
|
2962
|
-
padding: 0
|
|
3048
|
+
padding: 0 4px 0 46px;
|
|
2963
3049
|
font: inherit;
|
|
2964
3050
|
font-size: 15px;
|
|
2965
3051
|
line-height: 22px;
|
|
3052
|
+
text-overflow: ellipsis;
|
|
2966
3053
|
}
|
|
2967
3054
|
.pluno-pa-widget__launcher-input::placeholder {
|
|
2968
3055
|
color: var(--pluno-pa-faint);
|
|
2969
3056
|
}
|
|
3057
|
+
.pluno-pa-widget__launcher-minimize {
|
|
3058
|
+
position: absolute;
|
|
3059
|
+
top: -6px;
|
|
3060
|
+
right: -6px;
|
|
3061
|
+
z-index: 4;
|
|
3062
|
+
display: inline-flex;
|
|
3063
|
+
align-items: center;
|
|
3064
|
+
justify-content: center;
|
|
3065
|
+
width: 18px;
|
|
3066
|
+
height: 18px;
|
|
3067
|
+
border: 1px solid var(--pluno-pa-divider);
|
|
3068
|
+
border-radius: 999px;
|
|
3069
|
+
background: color-mix(in srgb, var(--pluno-pa-bg) 94%, transparent);
|
|
3070
|
+
color: var(--pluno-pa-muted);
|
|
3071
|
+
box-shadow: 0 6px 14px rgba(24, 24, 27, 0.12);
|
|
3072
|
+
cursor: pointer;
|
|
3073
|
+
font: inherit;
|
|
3074
|
+
font-size: 15px;
|
|
3075
|
+
font-weight: 700;
|
|
3076
|
+
line-height: 1;
|
|
3077
|
+
padding: 0 0 2px;
|
|
3078
|
+
opacity: 0;
|
|
3079
|
+
pointer-events: none;
|
|
3080
|
+
transform: translateY(3px) scale(0.92);
|
|
3081
|
+
transition:
|
|
3082
|
+
opacity 120ms ease,
|
|
3083
|
+
background 120ms ease,
|
|
3084
|
+
color 120ms ease,
|
|
3085
|
+
transform 120ms ease;
|
|
3086
|
+
}
|
|
3087
|
+
.pluno-pa-widget__launcher:hover .pluno-pa-widget__launcher-minimize,
|
|
3088
|
+
.pluno-pa-widget__launcher:focus-within .pluno-pa-widget__launcher-minimize,
|
|
3089
|
+
.pluno-pa-widget__launcher-minimize:focus-visible {
|
|
3090
|
+
opacity: 1;
|
|
3091
|
+
pointer-events: auto;
|
|
3092
|
+
transform: translateY(0) scale(1);
|
|
3093
|
+
}
|
|
3094
|
+
.pluno-pa-widget__launcher-minimize:hover,
|
|
3095
|
+
.pluno-pa-widget__launcher-minimize:focus-visible {
|
|
3096
|
+
background: var(--pluno-pa-surface);
|
|
3097
|
+
color: var(--pluno-pa-text);
|
|
3098
|
+
outline: none;
|
|
3099
|
+
}
|
|
3100
|
+
.pluno-pa-widget--minimized {
|
|
3101
|
+
--pluno-pa-launcher-width: 22px;
|
|
3102
|
+
--pluno-pa-launcher-height: 22px;
|
|
3103
|
+
pointer-events: none;
|
|
3104
|
+
}
|
|
3105
|
+
.pluno-pa-widget--minimized .pluno-pa-widget__launcher {
|
|
3106
|
+
border: 0;
|
|
3107
|
+
border-radius: 999px;
|
|
3108
|
+
background: transparent;
|
|
3109
|
+
box-shadow: none;
|
|
3110
|
+
cursor: pointer;
|
|
3111
|
+
width: var(--pluno-pa-launcher-width);
|
|
3112
|
+
min-width: 0;
|
|
3113
|
+
height: var(--pluno-pa-launcher-height);
|
|
3114
|
+
min-height: 0;
|
|
3115
|
+
padding: 0;
|
|
3116
|
+
overflow: visible;
|
|
3117
|
+
pointer-events: auto;
|
|
3118
|
+
}
|
|
3119
|
+
.pluno-pa-widget--minimized .pluno-pa-widget__launcher-input,
|
|
3120
|
+
.pluno-pa-widget--minimized .pluno-pa-widget__launcher-drag-handle,
|
|
3121
|
+
.pluno-pa-widget--minimized .pluno-pa-widget__launcher-minimize,
|
|
3122
|
+
.pluno-pa-widget--minimized .pluno-pa-widget__scribble-spirals--launcher {
|
|
3123
|
+
display: none;
|
|
3124
|
+
}
|
|
3125
|
+
.pluno-pa-widget--minimized .pluno-pa-widget__character--launcher {
|
|
3126
|
+
left: 1px;
|
|
3127
|
+
width: 20px;
|
|
3128
|
+
height: 20px;
|
|
3129
|
+
}
|
|
2970
3130
|
.pluno-pa-widget--bottom-left .pluno-pa-widget__launcher {
|
|
2971
3131
|
left: 0;
|
|
2972
3132
|
right: auto;
|
|
@@ -2982,6 +3142,10 @@ function Qt(e, t) {
|
|
|
2982
3142
|
0 12px 32px rgba(24, 24, 27, 0.16),
|
|
2983
3143
|
inset 0 0 0 1px var(--pluno-pa-launcher-hairline);
|
|
2984
3144
|
}
|
|
3145
|
+
.pluno-pa-widget--minimized .pluno-pa-widget__launcher:hover,
|
|
3146
|
+
.pluno-pa-widget--minimized .pluno-pa-widget__launcher:focus-within {
|
|
3147
|
+
box-shadow: none;
|
|
3148
|
+
}
|
|
2985
3149
|
.pluno-pa-widget--open .pluno-pa-widget__launcher {
|
|
2986
3150
|
opacity: 0;
|
|
2987
3151
|
pointer-events: none;
|
|
@@ -3051,6 +3215,7 @@ function Qt(e, t) {
|
|
|
3051
3215
|
}
|
|
3052
3216
|
@media (prefers-reduced-motion: reduce) {
|
|
3053
3217
|
.pluno-pa-widget__launcher,
|
|
3218
|
+
.pluno-pa-widget__launcher-minimize,
|
|
3054
3219
|
.pluno-pa-widget__panel,
|
|
3055
3220
|
.pluno-pa-widget__close,
|
|
3056
3221
|
.pluno-pa-widget {
|
|
@@ -3718,7 +3883,7 @@ function Qt(e, t) {
|
|
|
3718
3883
|
place-items: center;
|
|
3719
3884
|
padding: 18px;
|
|
3720
3885
|
background: rgba(24, 24, 27, 0.28);
|
|
3721
|
-
font-family: var(--pluno-pa-font, ${
|
|
3886
|
+
font-family: var(--pluno-pa-font, ${Z.fontFamily});
|
|
3722
3887
|
color: var(--pluno-pa-text);
|
|
3723
3888
|
}
|
|
3724
3889
|
.pluno-pa-widget__share-dialog {
|
|
@@ -4545,6 +4710,26 @@ function Qt(e, t) {
|
|
|
4545
4710
|
.pluno-pa-widget--scribble .pluno-pa-widget__history-panel {
|
|
4546
4711
|
border-radius: var(--pluno-pa-scribble-wobble);
|
|
4547
4712
|
}
|
|
4713
|
+
.pluno-pa-widget--scribble.pluno-pa-widget--minimized {
|
|
4714
|
+
--pluno-pa-launcher-width: 16px;
|
|
4715
|
+
--pluno-pa-launcher-height: 24px;
|
|
4716
|
+
}
|
|
4717
|
+
.pluno-pa-widget--scribble.pluno-pa-widget--minimized .pluno-pa-widget__launcher::before,
|
|
4718
|
+
.pluno-pa-widget--scribble.pluno-pa-widget--minimized .pluno-pa-widget__launcher::after {
|
|
4719
|
+
content: none;
|
|
4720
|
+
}
|
|
4721
|
+
.pluno-pa-widget--scribble.pluno-pa-widget--minimized .pluno-pa-widget__character--launcher {
|
|
4722
|
+
left: -3px;
|
|
4723
|
+
width: 22px;
|
|
4724
|
+
height: 22px;
|
|
4725
|
+
margin-top: 0;
|
|
4726
|
+
}
|
|
4727
|
+
.pluno-pa-widget--scribble .pluno-pa-widget__launcher-minimize {
|
|
4728
|
+
color: var(--pluno-pa-text);
|
|
4729
|
+
font-size: 18px;
|
|
4730
|
+
top: -8px;
|
|
4731
|
+
right: -8px;
|
|
4732
|
+
}
|
|
4548
4733
|
.pluno-pa-widget--scribble .pluno-pa-widget__history-close,
|
|
4549
4734
|
.pluno-pa-widget--scribble .pluno-pa-widget__history-item {
|
|
4550
4735
|
position: relative;
|
|
@@ -4560,6 +4745,7 @@ function Qt(e, t) {
|
|
|
4560
4745
|
.pluno-pa-widget--scribble .pluno-pa-widget__message--user,
|
|
4561
4746
|
.pluno-pa-widget--scribble .pluno-pa-widget__composer-inner,
|
|
4562
4747
|
.pluno-pa-widget--scribble .pluno-pa-widget__launcher,
|
|
4748
|
+
.pluno-pa-widget--scribble .pluno-pa-widget__launcher-minimize,
|
|
4563
4749
|
.pluno-pa-widget--scribble .pluno-pa-widget__send,
|
|
4564
4750
|
.pluno-pa-widget--scribble .pluno-pa-widget__history,
|
|
4565
4751
|
.pluno-pa-widget--scribble .pluno-pa-widget__new-chat,
|
|
@@ -4580,6 +4766,7 @@ function Qt(e, t) {
|
|
|
4580
4766
|
.pluno-pa-widget--scribble .pluno-pa-widget__message--user::before,
|
|
4581
4767
|
.pluno-pa-widget--scribble .pluno-pa-widget__composer-inner::before,
|
|
4582
4768
|
.pluno-pa-widget--scribble .pluno-pa-widget__launcher::before,
|
|
4769
|
+
.pluno-pa-widget--scribble .pluno-pa-widget__launcher-minimize::before,
|
|
4583
4770
|
.pluno-pa-widget--scribble .pluno-pa-widget__send::before,
|
|
4584
4771
|
.pluno-pa-widget--scribble .pluno-pa-widget__history::before,
|
|
4585
4772
|
.pluno-pa-widget--scribble .pluno-pa-widget__new-chat::before,
|
|
@@ -4617,6 +4804,7 @@ function Qt(e, t) {
|
|
|
4617
4804
|
}
|
|
4618
4805
|
.pluno-pa-widget--scribble .pluno-pa-widget__history::before,
|
|
4619
4806
|
.pluno-pa-widget--scribble .pluno-pa-widget__new-chat::before,
|
|
4807
|
+
.pluno-pa-widget--scribble .pluno-pa-widget__launcher-minimize::before,
|
|
4620
4808
|
.pluno-pa-widget--scribble .pluno-pa-widget__history-close::before,
|
|
4621
4809
|
.pluno-pa-widget--scribble .pluno-pa-widget__history-panel::before,
|
|
4622
4810
|
.pluno-pa-widget--scribble .pluno-pa-widget__message-copy::before,
|
|
@@ -4643,6 +4831,7 @@ function Qt(e, t) {
|
|
|
4643
4831
|
border-color: var(--pluno-pa-accent);
|
|
4644
4832
|
}
|
|
4645
4833
|
.pluno-pa-widget--scribble .pluno-pa-widget__send,
|
|
4834
|
+
.pluno-pa-widget--scribble .pluno-pa-widget__launcher-minimize,
|
|
4646
4835
|
.pluno-pa-widget--scribble .pluno-pa-widget__history,
|
|
4647
4836
|
.pluno-pa-widget--scribble .pluno-pa-widget__new-chat,
|
|
4648
4837
|
.pluno-pa-widget--scribble .pluno-pa-widget__message-copy,
|
|
@@ -4652,6 +4841,7 @@ function Qt(e, t) {
|
|
|
4652
4841
|
border-radius: 43% 57% 39% 61% / 59% 41% 58% 42%;
|
|
4653
4842
|
}
|
|
4654
4843
|
.pluno-pa-widget--scribble .pluno-pa-widget__send::after,
|
|
4844
|
+
.pluno-pa-widget--scribble .pluno-pa-widget__launcher-minimize::after,
|
|
4655
4845
|
.pluno-pa-widget--scribble .pluno-pa-widget__history::after,
|
|
4656
4846
|
.pluno-pa-widget--scribble .pluno-pa-widget__new-chat::after,
|
|
4657
4847
|
.pluno-pa-widget--scribble .pluno-pa-widget__message-copy::after,
|
|
@@ -4669,6 +4859,21 @@ function Qt(e, t) {
|
|
|
4669
4859
|
opacity: 0.6;
|
|
4670
4860
|
transform: rotate(5deg);
|
|
4671
4861
|
}
|
|
4862
|
+
.pluno-pa-widget--scribble.pluno-pa-widget--minimized .pluno-pa-widget__launcher {
|
|
4863
|
+
border: 0;
|
|
4864
|
+
width: var(--pluno-pa-launcher-width);
|
|
4865
|
+
min-width: 0;
|
|
4866
|
+
height: var(--pluno-pa-launcher-height);
|
|
4867
|
+
min-height: 0;
|
|
4868
|
+
padding: 0;
|
|
4869
|
+
}
|
|
4870
|
+
.pluno-pa-widget--scribble.pluno-pa-widget--minimized .pluno-pa-widget__launcher::before,
|
|
4871
|
+
.pluno-pa-widget--scribble.pluno-pa-widget--minimized .pluno-pa-widget__launcher::after {
|
|
4872
|
+
content: none;
|
|
4873
|
+
}
|
|
4874
|
+
.pluno-pa-widget--scribble.pluno-pa-widget--minimized .pluno-pa-widget__scribble-spirals {
|
|
4875
|
+
display: none;
|
|
4876
|
+
}
|
|
4672
4877
|
.pluno-pa-widget--scribble .pluno-pa-widget__attach:hover:not(:disabled),
|
|
4673
4878
|
.pluno-pa-widget--scribble .pluno-pa-widget__attach:focus-visible {
|
|
4674
4879
|
background: transparent;
|
|
@@ -4718,14 +4923,16 @@ function Qt(e, t) {
|
|
|
4718
4923
|
height: 48px;
|
|
4719
4924
|
}
|
|
4720
4925
|
.pluno-pa-widget--scribble .pluno-pa-widget__character--launcher {
|
|
4721
|
-
left:
|
|
4926
|
+
left: 4px;
|
|
4722
4927
|
width: 44px;
|
|
4723
4928
|
height: 44px;
|
|
4724
4929
|
margin-top: 3px;
|
|
4725
4930
|
}
|
|
4726
4931
|
.pluno-pa-widget--scribble .pluno-pa-widget__launcher-input {
|
|
4932
|
+
height: 26px;
|
|
4933
|
+
line-height: 26px;
|
|
4727
4934
|
margin-top: 2px;
|
|
4728
|
-
padding-left:
|
|
4935
|
+
padding-left: 46px;
|
|
4729
4936
|
}
|
|
4730
4937
|
.pluno-pa-widget--scribble .pluno-pa-widget__launcher-drag-handle {
|
|
4731
4938
|
top: -13px;
|
|
@@ -4761,28 +4968,28 @@ function Qt(e, t) {
|
|
|
4761
4968
|
filter: url(#pluno-pa-scribble-wobble-2);
|
|
4762
4969
|
}
|
|
4763
4970
|
`;
|
|
4764
|
-
if (
|
|
4971
|
+
if (sa(e, n))
|
|
4765
4972
|
return;
|
|
4766
4973
|
const o = e.ownerDocument.createElement("style");
|
|
4767
|
-
o.id =
|
|
4974
|
+
o.id = _n, o.textContent = n, e.appendChild(o), Dn(e);
|
|
4768
4975
|
}
|
|
4769
|
-
function
|
|
4770
|
-
return e.getElementById(
|
|
4976
|
+
function pa(e) {
|
|
4977
|
+
return e.getElementById(_n) !== null || e.host instanceof HTMLElement && e.host.getAttribute(xn) === "true";
|
|
4771
4978
|
}
|
|
4772
|
-
function
|
|
4773
|
-
e.host instanceof HTMLElement && e.host.setAttribute(
|
|
4979
|
+
function Dn(e) {
|
|
4980
|
+
e.host instanceof HTMLElement && e.host.setAttribute(xn, "true");
|
|
4774
4981
|
}
|
|
4775
|
-
function
|
|
4982
|
+
function sa(e, t) {
|
|
4776
4983
|
if (typeof CSSStyleSheet > "u" || typeof CSSStyleSheet.prototype.replaceSync != "function" || !("adoptedStyleSheets" in e))
|
|
4777
4984
|
return !1;
|
|
4778
4985
|
try {
|
|
4779
4986
|
const n = new CSSStyleSheet();
|
|
4780
|
-
return n.replaceSync(t), e.adoptedStyleSheets = [...e.adoptedStyleSheets, n],
|
|
4987
|
+
return n.replaceSync(t), e.adoptedStyleSheets = [...e.adoptedStyleSheets, n], Dn(e), !0;
|
|
4781
4988
|
} catch {
|
|
4782
4989
|
return !1;
|
|
4783
4990
|
}
|
|
4784
4991
|
}
|
|
4785
|
-
async function
|
|
4992
|
+
async function da() {
|
|
4786
4993
|
return document.body ? document.body : await new Promise((e) => {
|
|
4787
4994
|
const t = new MutationObserver(() => {
|
|
4788
4995
|
document.body && (t.disconnect(), e(document.body));
|
|
@@ -4790,14 +4997,14 @@ async function ti() {
|
|
|
4790
4997
|
t.observe(document.documentElement, { childList: !0 });
|
|
4791
4998
|
});
|
|
4792
4999
|
}
|
|
4793
|
-
function
|
|
5000
|
+
function Rn(e) {
|
|
4794
5001
|
return `pluno.productAgent.widgetState.${location.origin}.${e.backendUrl ?? ""}.${e.tokenEndpoint ?? ""}.${e.position ?? ""}`;
|
|
4795
5002
|
}
|
|
4796
|
-
function
|
|
5003
|
+
function ca(e) {
|
|
4797
5004
|
try {
|
|
4798
|
-
const t = window.localStorage.getItem(
|
|
5005
|
+
const t = window.localStorage.getItem(Rn(e));
|
|
4799
5006
|
if (!t)
|
|
4800
|
-
return
|
|
5007
|
+
return ln();
|
|
4801
5008
|
const n = JSON.parse(t);
|
|
4802
5009
|
return {
|
|
4803
5010
|
isOpen: n.isOpen === !0,
|
|
@@ -4805,24 +5012,24 @@ function ni(e) {
|
|
|
4805
5012
|
openToolGroupKeys: Array.isArray(n.openToolGroupKeys) ? n.openToolGroupKeys.filter(
|
|
4806
5013
|
(o) => typeof o == "string"
|
|
4807
5014
|
) : [],
|
|
4808
|
-
launcherPosition:
|
|
4809
|
-
seenShareCandidateIds: Array.isArray(n.seenShareCandidateIds) ? n.seenShareCandidateIds.filter((o) => typeof o == "string").slice(-
|
|
5015
|
+
launcherPosition: ma(n.launcherPosition) ? n.launcherPosition : null,
|
|
5016
|
+
seenShareCandidateIds: Array.isArray(n.seenShareCandidateIds) ? n.seenShareCandidateIds.filter((o) => typeof o == "string").slice(-gn) : [],
|
|
4810
5017
|
sharePromptsDisabled: n.sharePromptsDisabled === !0
|
|
4811
5018
|
};
|
|
4812
5019
|
} catch {
|
|
4813
|
-
return
|
|
5020
|
+
return ln();
|
|
4814
5021
|
}
|
|
4815
5022
|
}
|
|
4816
|
-
async function
|
|
5023
|
+
async function ua(e) {
|
|
4817
5024
|
if (e.loadSharePromptsDisabled)
|
|
4818
5025
|
return e.loadSharePromptsDisabled();
|
|
4819
5026
|
try {
|
|
4820
|
-
return window.localStorage.getItem(
|
|
5027
|
+
return window.localStorage.getItem(hn) === "true";
|
|
4821
5028
|
} catch {
|
|
4822
5029
|
return !1;
|
|
4823
5030
|
}
|
|
4824
5031
|
}
|
|
4825
|
-
function
|
|
5032
|
+
function ga(e, t) {
|
|
4826
5033
|
if (e.persistSharePromptsDisabled) {
|
|
4827
5034
|
Promise.resolve(e.persistSharePromptsDisabled(t)).catch(
|
|
4828
5035
|
() => {
|
|
@@ -4831,12 +5038,12 @@ function ai(e, t) {
|
|
|
4831
5038
|
return;
|
|
4832
5039
|
}
|
|
4833
5040
|
try {
|
|
4834
|
-
t && window.localStorage.setItem(
|
|
5041
|
+
t && window.localStorage.setItem(hn, "true");
|
|
4835
5042
|
} catch {
|
|
4836
5043
|
return;
|
|
4837
5044
|
}
|
|
4838
5045
|
}
|
|
4839
|
-
function
|
|
5046
|
+
function ln() {
|
|
4840
5047
|
return {
|
|
4841
5048
|
isOpen: !1,
|
|
4842
5049
|
composerValue: "",
|
|
@@ -4846,58 +5053,58 @@ function en() {
|
|
|
4846
5053
|
sharePromptsDisabled: !1
|
|
4847
5054
|
};
|
|
4848
5055
|
}
|
|
4849
|
-
function
|
|
5056
|
+
function ha(e, t) {
|
|
4850
5057
|
try {
|
|
4851
5058
|
window.localStorage.setItem(
|
|
4852
|
-
|
|
5059
|
+
Rn(e),
|
|
4853
5060
|
JSON.stringify(t)
|
|
4854
5061
|
);
|
|
4855
5062
|
} catch {
|
|
4856
5063
|
return;
|
|
4857
5064
|
}
|
|
4858
5065
|
}
|
|
4859
|
-
function
|
|
5066
|
+
function ma(e) {
|
|
4860
5067
|
if (!e || typeof e != "object")
|
|
4861
5068
|
return !1;
|
|
4862
5069
|
const t = e;
|
|
4863
5070
|
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");
|
|
4864
5071
|
}
|
|
4865
|
-
const
|
|
4866
|
-
function
|
|
5072
|
+
const pn = /* @__PURE__ */ new WeakSet();
|
|
5073
|
+
function ba(e) {
|
|
4867
5074
|
return Object.keys(e.dataset).some((t) => t.startsWith("pluno"));
|
|
4868
5075
|
}
|
|
4869
|
-
function
|
|
5076
|
+
function sn(e) {
|
|
4870
5077
|
const t = e.pathname.split("/");
|
|
4871
5078
|
return t[t.length - 1] ?? "";
|
|
4872
5079
|
}
|
|
4873
|
-
function
|
|
5080
|
+
function fa(e, t) {
|
|
4874
5081
|
const n = new URL(e.src, document.baseURI);
|
|
4875
|
-
return n.href === t.href || n.pathname === t.pathname ? !0 :
|
|
5082
|
+
return n.href === t.href || n.pathname === t.pathname ? !0 : sn(n) === sn(t);
|
|
4876
5083
|
}
|
|
4877
|
-
class
|
|
5084
|
+
class oe extends EventTarget {
|
|
4878
5085
|
constructor(t, n) {
|
|
4879
|
-
super(), this.channelId = n, this.url = t, this.addPreviewListener(
|
|
4880
|
-
this.readyState =
|
|
4881
|
-
}), this.addPreviewListener(
|
|
4882
|
-
const
|
|
5086
|
+
super(), this.channelId = n, this.url = t, this.addPreviewListener(_o, () => {
|
|
5087
|
+
this.readyState = oe.OPEN, this.dispatchEvent(new Event("open"));
|
|
5088
|
+
}), this.addPreviewListener(xo, (o) => {
|
|
5089
|
+
const i = o;
|
|
4883
5090
|
this.dispatchEvent(
|
|
4884
|
-
new MessageEvent("message", { data:
|
|
5091
|
+
new MessageEvent("message", { data: i.detail?.data ?? "" })
|
|
4885
5092
|
);
|
|
4886
|
-
}), this.addPreviewListener(
|
|
4887
|
-
this.readyState =
|
|
4888
|
-
}), this.addPreviewListener(
|
|
4889
|
-
const
|
|
4890
|
-
this.readyState =
|
|
5093
|
+
}), this.addPreviewListener(yo, () => {
|
|
5094
|
+
this.readyState = oe.CLOSED, this.dispatchEvent(new Event("error")), this.cleanup();
|
|
5095
|
+
}), this.addPreviewListener(vo, (o) => {
|
|
5096
|
+
const i = o;
|
|
5097
|
+
this.readyState = oe.CLOSED, this.dispatchEvent(
|
|
4891
5098
|
new CloseEvent("close", {
|
|
4892
|
-
code:
|
|
4893
|
-
reason:
|
|
4894
|
-
wasClean:
|
|
5099
|
+
code: i.detail?.code ?? 1e3,
|
|
5100
|
+
reason: i.detail?.reason ?? "",
|
|
5101
|
+
wasClean: i.detail?.wasClean ?? !0
|
|
4895
5102
|
})
|
|
4896
5103
|
), this.cleanup();
|
|
4897
5104
|
}), window.dispatchEvent(
|
|
4898
5105
|
new CustomEvent(
|
|
4899
|
-
|
|
4900
|
-
|
|
5106
|
+
Fe(
|
|
5107
|
+
bo,
|
|
4901
5108
|
this.channelId
|
|
4902
5109
|
),
|
|
4903
5110
|
{
|
|
@@ -4916,18 +5123,18 @@ class ee extends EventTarget {
|
|
|
4916
5123
|
extensions = "";
|
|
4917
5124
|
binaryType = "blob";
|
|
4918
5125
|
bufferedAmount = 0;
|
|
4919
|
-
readyState =
|
|
4920
|
-
socketId =
|
|
5126
|
+
readyState = oe.CONNECTING;
|
|
5127
|
+
socketId = wa();
|
|
4921
5128
|
listeners = /* @__PURE__ */ new Map();
|
|
4922
5129
|
send(t) {
|
|
4923
|
-
if (this.readyState !==
|
|
5130
|
+
if (this.readyState !== oe.OPEN)
|
|
4924
5131
|
throw new DOMException(
|
|
4925
5132
|
"Pluno preview websocket is not open",
|
|
4926
5133
|
"InvalidStateError"
|
|
4927
5134
|
);
|
|
4928
5135
|
window.dispatchEvent(
|
|
4929
5136
|
new CustomEvent(
|
|
4930
|
-
|
|
5137
|
+
Fe(fo, this.channelId),
|
|
4931
5138
|
{
|
|
4932
5139
|
detail: {
|
|
4933
5140
|
socketId: this.socketId,
|
|
@@ -4938,9 +5145,9 @@ class ee extends EventTarget {
|
|
|
4938
5145
|
);
|
|
4939
5146
|
}
|
|
4940
5147
|
close(t, n) {
|
|
4941
|
-
this.readyState !==
|
|
5148
|
+
this.readyState !== oe.CLOSED && (this.readyState = oe.CLOSING, window.dispatchEvent(
|
|
4942
5149
|
new CustomEvent(
|
|
4943
|
-
|
|
5150
|
+
Fe(wo, this.channelId),
|
|
4944
5151
|
{
|
|
4945
5152
|
detail: { socketId: this.socketId, code: t, reason: n }
|
|
4946
5153
|
}
|
|
@@ -4948,13 +5155,13 @@ class ee extends EventTarget {
|
|
|
4948
5155
|
), this.cleanup());
|
|
4949
5156
|
}
|
|
4950
5157
|
addPreviewListener(t, n) {
|
|
4951
|
-
const o =
|
|
5158
|
+
const o = Fe(
|
|
4952
5159
|
t,
|
|
4953
5160
|
this.channelId
|
|
4954
|
-
),
|
|
4955
|
-
|
|
5161
|
+
), i = (a) => {
|
|
5162
|
+
a.detail?.socketId === this.socketId && n(a);
|
|
4956
5163
|
};
|
|
4957
|
-
this.listeners.set(o,
|
|
5164
|
+
this.listeners.set(o, i), window.addEventListener(o, i);
|
|
4958
5165
|
}
|
|
4959
5166
|
cleanup() {
|
|
4960
5167
|
for (const [t, n] of this.listeners.entries())
|
|
@@ -4962,19 +5169,19 @@ class ee extends EventTarget {
|
|
|
4962
5169
|
this.listeners.clear();
|
|
4963
5170
|
}
|
|
4964
5171
|
}
|
|
4965
|
-
function
|
|
5172
|
+
function wa() {
|
|
4966
5173
|
const e = window.sessionStorage.getItem(
|
|
4967
|
-
|
|
5174
|
+
Bt
|
|
4968
5175
|
);
|
|
4969
5176
|
if (e)
|
|
4970
5177
|
return e;
|
|
4971
5178
|
const t = crypto.randomUUID();
|
|
4972
|
-
return window.sessionStorage.setItem(
|
|
5179
|
+
return window.sessionStorage.setItem(Bt, t), t;
|
|
4973
5180
|
}
|
|
4974
|
-
function
|
|
5181
|
+
function Fe(e, t) {
|
|
4975
5182
|
return `${e}:${t}`;
|
|
4976
5183
|
}
|
|
4977
|
-
function
|
|
5184
|
+
function _a(e) {
|
|
4978
5185
|
const t = document.currentScript;
|
|
4979
5186
|
if (t instanceof HTMLScriptElement)
|
|
4980
5187
|
return [t];
|
|
@@ -4982,20 +5189,20 @@ function di(e) {
|
|
|
4982
5189
|
return Array.from(
|
|
4983
5190
|
document.querySelectorAll("script[type='module'][src]")
|
|
4984
5191
|
).filter(
|
|
4985
|
-
(
|
|
5192
|
+
(i) => i instanceof HTMLScriptElement && ba(i) && fa(i, o)
|
|
4986
5193
|
);
|
|
4987
5194
|
}
|
|
4988
|
-
function
|
|
4989
|
-
for (const t of
|
|
4990
|
-
if (
|
|
5195
|
+
function xa(e) {
|
|
5196
|
+
for (const t of _a(e)) {
|
|
5197
|
+
if (pn.has(t) || t.dataset.plunoAutoMount === "false")
|
|
4991
5198
|
continue;
|
|
4992
|
-
|
|
5199
|
+
pn.add(t);
|
|
4993
5200
|
const n = t.dataset.plunoPreviewChannel;
|
|
4994
|
-
|
|
5201
|
+
Vo({
|
|
4995
5202
|
token: t.dataset.plunoToken,
|
|
4996
5203
|
tokenEndpoint: t.dataset.plunoTokenEndpoint,
|
|
4997
5204
|
backendUrl: t.dataset.plunoBackendUrl,
|
|
4998
|
-
webSocketFactory: n ?
|
|
5205
|
+
webSocketFactory: n ? jo(n) : void 0,
|
|
4999
5206
|
launcherLabel: t.dataset.plunoLauncherLabel,
|
|
5000
5207
|
accentColor: t.dataset.plunoAccentColor,
|
|
5001
5208
|
colorScheme: t.dataset.plunoColorScheme === "dark" ? "dark" : "light",
|
|
@@ -5007,8 +5214,8 @@ function ci(e) {
|
|
|
5007
5214
|
});
|
|
5008
5215
|
}
|
|
5009
5216
|
}
|
|
5010
|
-
|
|
5217
|
+
xa(import.meta.url);
|
|
5011
5218
|
export {
|
|
5012
|
-
|
|
5013
|
-
|
|
5219
|
+
jo as createProductAgentPreviewBridgeWebSocketFactory,
|
|
5220
|
+
Vo as mountPlunoProductAgentWidget
|
|
5014
5221
|
};
|