@pluno/product-agent-web 0.1.114 → 0.1.116

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.
@@ -1,26 +1,26 @@
1
- import { PlunoProductAgent as Ci, getProductAgentOriginAccessErrorMessage as Ei } from "./product-agent-sdk.js";
2
- const ki = "#7c3aed", kt = "M547 151 C516 151 493 169 485 199 L382 606 C373 641 396 666 431 666 L523 666 C552 666 568 684 563 713 L491 1028 C486 1054 510 1067 527 1044 L894 487 C915 455 894 432 856 432 L815 432 C784 432 773 411 789 382 L904 205 C922 171 901 145 859 145 Z", Lt = "#2c2a1e", Gn = [253, 250, 241], $n = 3.5;
1
+ import { PlunoProductAgent as Si, getProductAgentOriginAccessErrorMessage as Ci } from "./product-agent-sdk.js";
2
+ const Ei = "#7c3aed", kt = "M547 151 C516 151 493 169 485 199 L382 606 C373 641 396 666 431 666 L523 666 C552 666 568 684 563 713 L491 1028 C486 1054 510 1067 527 1044 L894 487 C915 455 894 432 856 432 L815 432 C784 432 773 411 789 382 L904 205 C922 171 901 145 859 145 Z", Lt = "#2c2a1e", Gn = [253, 250, 241], $n = 3.5;
3
3
  function Lo(e) {
4
4
  const t = To(e);
5
- if (qn(pt(t), Gn) >= $n)
5
+ if (qn(st(t), Gn) >= $n)
6
6
  return t;
7
- let i = pt(t);
8
- const o = pt(Lt);
7
+ let i = st(t);
8
+ const o = st(Lt);
9
9
  for (let r = 0; r < 6; r += 1)
10
- if (i = Ai(i, o, 0.22), qn(i, Gn) >= $n)
10
+ if (i = Ti(i, o, 0.22), qn(i, Gn) >= $n)
11
11
  return dn(i);
12
12
  return dn(i);
13
13
  }
14
- function Li() {
14
+ function ki() {
15
15
  let n = "M 280 120", i = !1, o = 0;
16
16
  for (let r = 150; r <= 1170; r += 62) {
17
- const l = (o % 3 - 1) * 18, p = i ? 280 - l : 1020 + l;
18
- n += ` L ${p} ${r}`, i = !i, o += 1;
17
+ const l = (o % 3 - 1) * 18, s = i ? 280 - l : 1020 + l;
18
+ n += ` L ${s} ${r}`, i = !i, o += 1;
19
19
  }
20
20
  return n;
21
21
  }
22
- function Ti(e) {
23
- const t = To(e), n = cn(pt(t));
22
+ function Li(e) {
23
+ const t = To(e), n = cn(st(t));
24
24
  return n > 0.86 ? {
25
25
  top: "#ffffff",
26
26
  middle: "#f6f6f6",
@@ -44,23 +44,23 @@ function Ti(e) {
44
44
  inner: "#4b4b4b",
45
45
  shadow: "#000000"
46
46
  } : {
47
- top: se(t, 0.28, -0.03),
48
- middle: se(t, 0.08, 0.04),
49
- bottom: se(t, -0.1, 0.02),
50
- edgeStart: se(t, 0.08, 0.08),
51
- edgeMiddle: se(t, -0.08, 0.08),
52
- edgeEnd: se(t, -0.18, 0.05),
53
- glow: se(t, 0.32, -0.12),
54
- highlight: se(t, 0.38, -0.18),
55
- inner: se(t, 0.24, -0.1),
56
- shadow: se(t, -0.25, -0.08)
47
+ top: pe(t, 0.28, -0.03),
48
+ middle: pe(t, 0.08, 0.04),
49
+ bottom: pe(t, -0.1, 0.02),
50
+ edgeStart: pe(t, 0.08, 0.08),
51
+ edgeMiddle: pe(t, -0.08, 0.08),
52
+ edgeEnd: pe(t, -0.18, 0.05),
53
+ glow: pe(t, 0.32, -0.12),
54
+ highlight: pe(t, 0.38, -0.18),
55
+ inner: pe(t, 0.24, -0.1),
56
+ shadow: pe(t, -0.25, -0.08)
57
57
  };
58
58
  }
59
59
  function To(e) {
60
60
  const t = e.trim();
61
- return /^#[0-9a-f]{6}$/i.test(t) ? t.toLowerCase() : /^#[0-9a-f]{3}$/i.test(t) ? `#${t.slice(1).split("").map((n) => n + n).join("").toLowerCase()}` : ki;
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()}` : Ei;
62
62
  }
63
- function pt(e) {
63
+ function st(e) {
64
64
  return [
65
65
  Number.parseInt(e.slice(1, 3), 16),
66
66
  Number.parseInt(e.slice(3, 5), 16),
@@ -82,7 +82,7 @@ function qn(e, t) {
82
82
  const n = cn(e), i = cn(t), [o, r] = n > i ? [n, i] : [i, n];
83
83
  return (o + 0.05) / (r + 0.05);
84
84
  }
85
- function Ai(e, t, n) {
85
+ function Ti(e, t, n) {
86
86
  const i = un(n);
87
87
  return [
88
88
  e[0] + (t[0] - e[0]) * i,
@@ -90,18 +90,18 @@ function Ai(e, t, n) {
90
90
  e[2] + (t[2] - e[2]) * i
91
91
  ];
92
92
  }
93
- function se(e, t, n) {
94
- const [i, o, r] = Ii(pt(e));
95
- return dn(Pi(i, un(o + n), un(r + t)));
93
+ function pe(e, t, n) {
94
+ const [i, o, r] = Ai(st(e));
95
+ return dn(Ii(i, un(o + n), un(r + t)));
96
96
  }
97
- function Ii([e, t, n]) {
98
- const i = e / 255, o = t / 255, r = n / 255, l = Math.max(i, o, r), p = Math.min(i, o, r), s = (l + p) / 2;
99
- if (l === p)
100
- return [0, 0, s];
101
- const c = l - p, g = s > 0.5 ? c / (2 - l - p) : c / (l + p);
102
- return [(l === i ? (o - r) / c + (o < r ? 6 : 0) : l === o ? (r - i) / c + 2 : (i - o) / c + 4) / 6, g, s];
97
+ function Ai([e, t, n]) {
98
+ const i = e / 255, o = t / 255, r = n / 255, l = Math.max(i, o, r), s = Math.min(i, o, r), p = (l + s) / 2;
99
+ if (l === s)
100
+ return [0, 0, p];
101
+ const c = l - s, g = p > 0.5 ? c / (2 - l - s) : c / (l + s);
102
+ return [(l === i ? (o - r) / c + (o < r ? 6 : 0) : l === o ? (r - i) / c + 2 : (i - o) / c + 4) / 6, g, p];
103
103
  }
104
- function Pi(e, t, n) {
104
+ function Ii(e, t, n) {
105
105
  if (t === 0)
106
106
  return [n * 255, n * 255, n * 255];
107
107
  const i = n < 0.5 ? n * (1 + t) : n + t - n * t, o = 2 * n - i;
@@ -119,7 +119,7 @@ function un(e) {
119
119
  return Math.max(0, Math.min(1, e));
120
120
  }
121
121
  const Ao = "suggest_share_on_socials";
122
- function Ni(e) {
122
+ function Pi(e) {
123
123
  for (let t = e.length - 1; t >= 0; t -= 1) {
124
124
  const n = e[t];
125
125
  if (n.role !== "tool" || n.toolName !== Ao)
@@ -136,7 +136,7 @@ function Ni(e) {
136
136
  }
137
137
  return null;
138
138
  }
139
- function Ri(e) {
139
+ function Ni(e) {
140
140
  let t = 2166136261;
141
141
  for (const n of e)
142
142
  t ^= n.charCodeAt(0), t = Math.imul(t, 16777619);
@@ -150,16 +150,16 @@ function jn(e, t, n) {
150
150
  }
151
151
  return null;
152
152
  }
153
- const Mi = "https://app.pluno.ai", zi = "/api/product-agent/embed/active-users", Di = 1800, Oi = 15e3, Ui = 250, Bi = 1e3, Fi = 3e4;
154
- function Wi(e, t = {}) {
153
+ const Ri = "https://app.pluno.ai", zi = "/api/product-agent/embed/active-users", Mi = 1800, Di = 15e3, Oi = 250, Ui = 1e3, Bi = 3e4;
154
+ function Fi(e, t = {}) {
155
155
  let n = !1, i = null, o = null, r = null;
156
156
  const l = () => {
157
157
  r !== null && (window.clearInterval(r), r = null);
158
- }, p = (g) => {
158
+ }, s = (g) => {
159
159
  n || (o !== null && window.clearTimeout(o), o = window.setTimeout(() => {
160
160
  c();
161
- }, $i(g)));
162
- }, s = (g) => {
161
+ }, Gi(g)));
162
+ }, p = (g) => {
163
163
  if (l(), i === null) {
164
164
  i = g, e(g);
165
165
  return;
@@ -170,27 +170,27 @@ function Wi(e, t = {}) {
170
170
  l();
171
171
  return;
172
172
  }
173
- const y = Math.min(1, (performance.now() - m) / Di);
174
- i = Math.round(h + (g - h) * qi(y)), e(i), y >= 1 && (i = g, e(g), l());
175
- }, Ui);
173
+ const v = Math.min(1, (performance.now() - m) / Mi);
174
+ i = Math.round(h + (g - h) * $i(v)), e(i), v >= 1 && (i = g, e(g), l());
175
+ }, Oi);
176
176
  }, c = async () => {
177
177
  try {
178
- const g = await Hi(t);
178
+ const g = await Wi(t);
179
179
  if (n)
180
180
  return;
181
- s(g.count), p(g.refreshAfterMs);
181
+ p(g.count), s(g.refreshAfterMs);
182
182
  } catch {
183
- p(Oi);
183
+ s(Di);
184
184
  }
185
185
  };
186
186
  return c(), () => {
187
187
  n = !0, o !== null && window.clearTimeout(o), l();
188
188
  };
189
189
  }
190
- async function Hi(e) {
190
+ async function Wi(e) {
191
191
  if (e.loader)
192
192
  return e.loader();
193
- const n = await (e.fetcher ?? fetch)(new URL(zi, Gi(e.backendUrl ?? Mi)).toString(), {
193
+ const n = await (e.fetcher ?? fetch)(new URL(zi, Hi(e.backendUrl ?? Ri)).toString(), {
194
194
  cache: "no-store",
195
195
  credentials: "omit"
196
196
  });
@@ -204,16 +204,16 @@ async function Hi(e) {
204
204
  function Kn(e) {
205
205
  return typeof e != "number" || !Number.isFinite(e) || e < 0 ? null : Math.round(e);
206
206
  }
207
- function Gi(e) {
207
+ function Hi(e) {
208
208
  return e.endsWith("/") ? e : `${e}/`;
209
209
  }
210
- function $i(e) {
211
- return Math.min(Fi, Math.max(Bi, e));
210
+ function Gi(e) {
211
+ return Math.min(Bi, Math.max(Ui, e));
212
212
  }
213
- function qi(e) {
213
+ function $i(e) {
214
214
  return e < 0.5 ? 4 * e * e * e : 1 - Math.pow(-2 * e + 2, 3) / 2;
215
215
  }
216
- const ji = [
216
+ const qi = [
217
217
  "a[href]",
218
218
  "button",
219
219
  "input",
@@ -237,27 +237,27 @@ const ji = [
237
237
  ".pluno-pa-widget__message",
238
238
  ".timeline-item"
239
239
  ].join(",");
240
- function Ki(e, t, n) {
241
- return e instanceof Element ? Vi(
240
+ function ji(e, t, n) {
241
+ return e instanceof Element ? Ki(
242
242
  t,
243
243
  n,
244
- e.closest(ji) !== null
244
+ e.closest(qi) !== null
245
245
  ) : !1;
246
246
  }
247
- function Vi(e, t, n) {
247
+ function Ki(e, t, n) {
248
248
  return e === 1 && !t && !n;
249
249
  }
250
- function Yi(e, t, n) {
250
+ function Vi(e, t, n) {
251
251
  return e instanceof Node && t !== null && !t.contains(e) && !n?.contains(e);
252
252
  }
253
- function Xi(e, t = !0) {
253
+ function Yi(e, t = !0) {
254
254
  if (!e || !t || !e.isConnected || e.disabled || e.readOnly)
255
255
  return !1;
256
256
  const n = e.getRootNode();
257
257
  return (n instanceof ShadowRoot ? n.activeElement : e.ownerDocument.activeElement) === e ? !1 : (e.focus({ preventScroll: !0 }), !0);
258
258
  }
259
- const Zi = /(`+)(?!`)[\s\S]*?\1(?!`)/g;
260
- function Ji(e) {
259
+ const Xi = /(`+)(?!`)[\s\S]*?\1(?!`)/g;
260
+ function Zi(e) {
261
261
  let t = "", n = "", i = null;
262
262
  for (const o of e.split(new RegExp("(?<=\\n)"))) {
263
263
  if (i) {
@@ -280,7 +280,7 @@ function Ji(e) {
280
280
  }
281
281
  function Vn(e) {
282
282
  let t = "", n = 0;
283
- for (const i of e.matchAll(Zi)) {
283
+ for (const i of e.matchAll(Xi)) {
284
284
  const o = i.index ?? 0;
285
285
  t += Yn(
286
286
  e.slice(n, o)
@@ -291,16 +291,16 @@ function Vn(e) {
291
291
  function Yn(e) {
292
292
  return e.replace(
293
293
  /\[([^\]\n]*\S[^\]\n]*)\][ \t]+\(([^)\s]+)\)/g,
294
- (t, n, i, o, r) => r[o - 1] === "!" || Qi(r, o) || ea(r, o, n) ? t : `[${n}](${i})`
294
+ (t, n, i, o, r) => r[o - 1] === "!" || Ji(r, o) || Qi(r, o, n) ? t : `[${n}](${i})`
295
295
  );
296
296
  }
297
- function Qi(e, t) {
297
+ function Ji(e, t) {
298
298
  let n = 0;
299
299
  for (let i = t - 1; e[i] === "\\"; i -= 1)
300
300
  n += 1;
301
301
  return n % 2 === 1;
302
302
  }
303
- function ea(e, t, n) {
303
+ function Qi(e, t, n) {
304
304
  if (n !== "x" && n !== "X")
305
305
  return !1;
306
306
  const i = e.lastIndexOf(`
@@ -309,7 +309,7 @@ function ea(e, t, n) {
309
309
  e.slice(i, t)
310
310
  );
311
311
  }
312
- const Io = 100, ta = 1e4, na = 5e3, oa = "product-agent:sdk-preview-socket-connect", ia = "product-agent:sdk-preview-socket-send", aa = "product-agent:sdk-preview-socket-close", ra = "product-agent:sdk-preview-socket-open", la = "product-agent:sdk-preview-socket-message", sa = "product-agent:sdk-preview-socket-error", pa = "product-agent:sdk-preview-socket-closed", Xn = "product-agent:sdk-preview-socket-id", da = "data-pluno-sdk-preview-channel", Po = "data-pluno-auto-mounted", be = "__plunoProductAgentAutoMountOwner", ca = 1e4, ua = "Failed to load Pluno widget token", Zn = "Timed out loading Pluno widget token", ga = "pluno.productAgent.widgetClientId.", Jt = /* @__PURE__ */ new Set(), ha = "product-agent:preview-diagnostic", No = "pluno.productAgent.sharePromptsDisabled", ma = 3, Jn = 'dialog[open], [aria-modal="true"], [role="dialog"]', fa = 400, wa = 5e3, ba = 500, Qn = "Close the page's popup to chat", _a = "No recent chats for this page yet.", _e = {
312
+ const Io = 100, ea = 1e4, ta = 5e3, na = "product-agent:sdk-preview-socket-connect", oa = "product-agent:sdk-preview-socket-send", ia = "product-agent:sdk-preview-socket-close", aa = "product-agent:sdk-preview-socket-open", ra = "product-agent:sdk-preview-socket-message", la = "product-agent:sdk-preview-socket-error", pa = "product-agent:sdk-preview-socket-closed", Xn = "product-agent:sdk-preview-socket-id", sa = "data-pluno-sdk-preview-channel", Po = "data-pluno-auto-mounted", be = "__plunoProductAgentAutoMountOwner", da = 1e4, ca = "Failed to load Pluno widget token", Zn = "Timed out loading Pluno widget token", ua = "pluno.productAgent.widgetClientId.", Jt = /* @__PURE__ */ new Set(), ga = "product-agent:preview-diagnostic", No = "pluno.productAgent.sharePromptsDisabled", ha = 3, Jn = 'dialog[open], [aria-modal="true"], [role="dialog"]', ma = 400, fa = 5e3, wa = 500, Qn = "Close the page's popup to chat", ba = "No recent chats for this page yet.", _e = {
313
313
  launcherLabel: "Ask for anything...",
314
314
  accentColor: "#7c3aed",
315
315
  colorScheme: "light",
@@ -317,7 +317,7 @@ const Io = 100, ta = 1e4, na = 5e3, oa = "product-agent:sdk-preview-socket-conne
317
317
  scribbleStyle: !0,
318
318
  position: "bottom-right",
319
319
  movableLauncher: !0
320
- }, xa = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive', eo = "pluno-pa-scribble-font", Ro = 190, Mo = 41, to = 22, ya = 1, va = 48, vn = 420, Sa = 520, Ca = 0.24, Sn = 680, Ea = 800, ka = 0.76, N = 8, Ue = 50, zo = "http://www.w3.org/2000/svg", gn = 26, hn = 8, La = 36, mn = 16, Ta = 4, no = [
320
+ }, _a = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive', eo = "pluno-pa-scribble-font", Ro = 190, zo = 41, to = 22, xa = 1, ya = 48, vn = 420, va = 520, Sa = 0.24, Sn = 680, Ca = 800, Ea = 0.76, N = 8, Ue = 50, Mo = "http://www.w3.org/2000/svg", gn = 26, hn = 8, ka = 36, mn = 16, La = 4, no = [
321
321
  {
322
322
  ellipseCx: "17.5",
323
323
  ellipseCy: "24.5",
@@ -354,12 +354,12 @@ const Io = 100, ta = 1e4, na = 5e3, oa = "product-agent:sdk-preview-socket-conne
354
354
  path: "M18.7 26.8 C21 11.2, 7.1 1.6, 6.3 18.1",
355
355
  pathStrokeWidth: "2.45"
356
356
  }
357
- ], Aa = 11, Ia = 13, fn = 4, Do = 10, Oo = 40, Pa = "movable-launcher-position-v2", Uo = "pluno-pa-widget-styles", Bo = "data-pluno-pa-widget-styles";
357
+ ], Ta = 11, Aa = 13, fn = 4, Do = 10, Oo = 40, Ia = "movable-launcher-position-v2", Uo = "pluno-pa-widget-styles", Bo = "data-pluno-pa-widget-styles";
358
358
  let oo = 0;
359
- function Na(e) {
359
+ function Pa(e) {
360
360
  return (t) => new xe(t, e);
361
361
  }
362
- async function Ra(e = {}) {
362
+ async function Na(e = {}) {
363
363
  const t = {
364
364
  layout: e.layout ?? "floating",
365
365
  mountTarget: e.mountTarget,
@@ -431,7 +431,7 @@ async function Ra(e = {}) {
431
431
  );
432
432
  const n = document.createElement("div");
433
433
  n.className = "pluno-pa-widget-host", n.setAttribute("data-pluno-product-agent-ui", "widget"), n.setAttribute("data-pluno-product-agent-layout", t.layout), t.sdkPreviewChannelId && n.setAttribute(
434
- da,
434
+ sa,
435
435
  t.sdkPreviewChannelId
436
436
  );
437
437
  const i = n.attachShadow({ mode: "open" }), o = document.createElement("div");
@@ -440,21 +440,21 @@ async function Ra(e = {}) {
440
440
  t.accentColor,
441
441
  t.scribbleStyle
442
442
  );
443
- tr(
443
+ er(
444
444
  o,
445
445
  t.launcherLabel,
446
446
  r,
447
447
  t.movableLauncher,
448
448
  t.showLauncherMinimizeButton
449
449
  ), i.appendChild(o);
450
- const l = il(t), p = t.layout === "floating" ? t.initialDisplayState ?? nl(t) : "shown";
451
- So(t, p);
452
- let s = t.movableLauncher ? l.launcherPosition : null, c = s !== null, g = l.panelSize, h = null;
453
- o.classList.add(`pluno-pa-widget--${t.colorScheme}`), t.scribbleStyle && o.classList.add("pluno-pa-widget--scribble"), p === "minimized" && (o.classList.add("pluno-pa-widget--minimized"), Oe(
450
+ const l = il(t), s = t.layout === "floating" ? t.initialDisplayState ?? nl(t) : "shown";
451
+ So(t, s);
452
+ let p = t.movableLauncher ? l.launcherPosition : null, c = p !== null, g = l.panelSize, h = null;
453
+ o.classList.add(`pluno-pa-widget--${t.colorScheme}`), t.scribbleStyle && o.classList.add("pluno-pa-widget--scribble"), s === "minimized" && (o.classList.add("pluno-pa-widget--minimized"), Oe(
454
454
  o,
455
455
  en(
456
456
  o,
457
- s,
457
+ p,
458
458
  t.position
459
459
  )
460
460
  )), vo(i, t.accentColor), ao(o, r, {
@@ -463,7 +463,7 @@ async function Ra(e = {}) {
463
463
  fontFamily: t.fontFamily,
464
464
  scribbleStyle: t.scribbleStyle
465
465
  });
466
- const m = t.mountTarget ?? await tl(), y = m.ownerDocument, A = o.querySelector(
466
+ const m = t.mountTarget ?? await tl(), v = m.ownerDocument, E = o.querySelector(
467
467
  ".pluno-pa-widget__launcher"
468
468
  ), O = o.querySelector(
469
469
  ".pluno-pa-widget__launcher-drag-handle"
@@ -473,9 +473,9 @@ async function Ra(e = {}) {
473
473
  ".pluno-pa-widget__launcher-minimize"
474
474
  ), w = o.querySelector(".pluno-pa-widget__panel"), R = o.querySelector(
475
475
  ".pluno-pa-widget__scribble-spirals--panel"
476
- ), z = Array.from(
476
+ ), M = Array.from(
477
477
  o.querySelectorAll(".pluno-pa-widget__resize-handle")
478
- ), k = o.querySelector(
478
+ ), L = o.querySelector(
479
479
  ".pluno-pa-widget__close"
480
480
  ), te = o.querySelector(
481
481
  ".pluno-pa-widget__composer"
@@ -489,7 +489,7 @@ async function Ra(e = {}) {
489
489
  ".pluno-pa-widget__attachment-input"
490
490
  ), U = o.querySelector(
491
491
  ".pluno-pa-widget__attach"
492
- ), v = o.querySelector(
492
+ ), y = o.querySelector(
493
493
  ".pluno-pa-widget__input"
494
494
  ), B = o.querySelector(
495
495
  ".pluno-pa-widget__send"
@@ -509,7 +509,7 @@ async function Ra(e = {}) {
509
509
  ".pluno-pa-widget__timeline-jump"
510
510
  ), ge = o.querySelector(
511
511
  ".pluno-pa-widget__active-users-counter"
512
- ), M = o.querySelector(
512
+ ), z = o.querySelector(
513
513
  ".pluno-pa-widget__timeline"
514
514
  ), Xe = o.querySelector(
515
515
  ".pluno-pa-widget__timeline-bottom-sentinel"
@@ -519,7 +519,7 @@ async function Ra(e = {}) {
519
519
  ".pluno-pa-widget__notify-suggestion-enable"
520
520
  ), S = o.querySelector(
521
521
  ".pluno-pa-widget__notify-suggestion-later"
522
- ), L = o.querySelector(
522
+ ), T = o.querySelector(
523
523
  ".pluno-pa-widget__notify-suggestion-never"
524
524
  ), P = o.querySelector(
525
525
  ".pluno-pa-widget__tab-groups-suggestion"
@@ -528,17 +528,17 @@ async function Ra(e = {}) {
528
528
  ), ne = o.querySelector(
529
529
  ".pluno-pa-widget__tab-groups-suggestion-dismiss"
530
530
  );
531
- if (!A || !u || !w || !k || !te || !W || !Ye || !Be || !ce || !U || !v || !B || !$ || !X || !Le || !K || !ct || !Te || !ue || !ge || !M || !Xe)
531
+ if (!E || !u || !w || !L || !te || !W || !Ye || !Be || !ce || !U || !y || !B || !$ || !X || !Le || !K || !ct || !Te || !ue || !ge || !z || !Xe)
532
532
  throw new Error("Failed to mount Pluno widget");
533
533
  if (t.movableLauncher && !O)
534
534
  throw new Error("Failed to mount Pluno widget drag handle");
535
- U.hidden = !t.attachmentsEnabled, ce.disabled = !t.attachmentsEnabled, ho(u), ho(v);
536
- let b = [], E = null;
537
- const q = () => Xi(
538
- v,
535
+ U.hidden = !t.attachmentsEnabled, ce.disabled = !t.attachmentsEnabled, ho(u), ho(y);
536
+ let b = [], k = null;
537
+ const q = () => Yi(
538
+ y,
539
539
  o.classList.contains("pluno-pa-widget--open") && !t.loginRequired && !t.signupRequired && !le(t.billingStatus)
540
540
  ), Fe = () => {
541
- yr(
541
+ xr(
542
542
  Be,
543
543
  b,
544
544
  (a) => {
@@ -547,10 +547,10 @@ async function Ra(e = {}) {
547
547
  ), Fe(), D(_.getState()), j(), q();
548
548
  }
549
549
  );
550
- }, Ln = t.loginRequired || t.signupRequired || t.token || t.webSocketFactory ? void 0 : t.tokenProvider ?? (t.tokenEndpoint ? async () => oi(t.tokenEndpoint) : void 0);
550
+ }, Ln = t.loginRequired || t.signupRequired || t.token || t.webSocketFactory ? void 0 : t.tokenProvider ?? (t.tokenEndpoint ? async () => ni(t.tokenEndpoint) : void 0);
551
551
  if (!t.loginRequired && !t.signupRequired && !t.token && !Ln && !t.webSocketFactory)
552
552
  throw new Error("Pluno widget requires token or tokenEndpoint");
553
- const ai = window.fetch.bind(window), Pt = ol(t.clientId);
553
+ const ii = window.fetch.bind(window), Pt = ol(t.clientId);
554
554
  let _;
555
555
  try {
556
556
  const a = {
@@ -573,7 +573,7 @@ async function Ra(e = {}) {
573
573
  autoConnect: !1,
574
574
  disableNetworkCapture: !!t.sdkPreviewChannelId
575
575
  };
576
- _ = await Ci.init(a);
576
+ _ = await Si.init(a);
577
577
  } catch (a) {
578
578
  throw Pt.release(), n.remove(), a;
579
579
  }
@@ -592,15 +592,15 @@ async function Ra(e = {}) {
592
592
  ), Ze = new Set(Pe);
593
593
  let Rt = l.sharePromptsDisabled || await al(t), oe = null, V = !1, ut = !(t.loginRequired || t.signupRequired), ve = !1, Ne = {
594
594
  enabled: !0
595
- }, Re = 0, Tn = "", Y = !1, he = !1, Se = [], Mt = null, Je = null;
595
+ }, Re = 0, Tn = "", Y = !1, he = !1, Se = [], zt = null, Je = null;
596
596
  const ie = (a, d) => {
597
597
  Ne = { enabled: a, reason: d };
598
598
  }, ae = () => {
599
599
  ue.hidden = !0;
600
- }, ri = () => {
600
+ }, ai = () => {
601
601
  ue.hidden = !1;
602
- }, li = (a = "jump") => {
603
- ie(!0, a), ae(), st(M, () => Ne.enabled), Re = M.scrollTop;
602
+ }, ri = (a = "jump") => {
603
+ ie(!0, a), ae(), pt(z, () => Ne.enabled), Re = z.scrollTop;
604
604
  }, me = () => {
605
605
  if (X.hidden = t.layout === "page" || t.loginRequired, Le.hidden = !Y, X.setAttribute("aria-expanded", String(Y)), K.classList.toggle(
606
606
  "pluno-pa-widget__history-list--center",
@@ -613,14 +613,14 @@ async function Ra(e = {}) {
613
613
  const d = document.createElement("button");
614
614
  d.type = "button", d.className = "pluno-pa-widget__history-item", d.disabled = he;
615
615
  const f = document.createElement("span");
616
- f.className = "pluno-pa-widget__history-item-title", f.textContent = Ja(a);
616
+ f.className = "pluno-pa-widget__history-item-title", f.textContent = Za(a);
617
617
  const C = document.createElement("time");
618
- C.className = "pluno-pa-widget__history-time", C.dateTime = a.lastActiveAt, C.textContent = er(
618
+ C.className = "pluno-pa-widget__history-time", C.dateTime = a.lastActiveAt, C.textContent = Qa(
619
619
  a.lastActiveAt,
620
620
  Date.now()
621
621
  );
622
622
  const I = document.createElement("small");
623
- I.className = "pluno-pa-widget__history-path", I.textContent = Qa(a), d.append(f, C, I), d.addEventListener("click", () => {
623
+ I.className = "pluno-pa-widget__history-path", I.textContent = Ja(a), d.append(f, C, I), d.addEventListener("click", () => {
624
624
  Y = !1, Je = null, me(), ie(!0, "newSession"), ae(), _.loadSession(a.id), D(_.getState()), q();
625
625
  }), K.appendChild(d);
626
626
  }
@@ -634,7 +634,7 @@ async function Ra(e = {}) {
634
634
  he = !0, Je = null, me();
635
635
  try {
636
636
  const d = await _.listSessions({ cursor: a, limit: 20 });
637
- Se = a ? [...Se, ...d.sessions] : d.sessions, Mt = d.nextCursor;
637
+ Se = a ? [...Se, ...d.sessions] : d.sessions, zt = d.nextCursor;
638
638
  } catch (d) {
639
639
  Z(
640
640
  "web-sdk.widget",
@@ -642,17 +642,17 @@ async function Ra(e = {}) {
642
642
  {
643
643
  message: d instanceof Error ? d.message : String(d)
644
644
  }
645
- ), Je = _a;
645
+ ), Je = ba;
646
646
  } finally {
647
647
  he = !1, me();
648
648
  }
649
649
  }
650
- }, si = () => {
651
- !Mt || he || K.scrollHeight - K.scrollTop - K.clientHeight <= 24 && An(Mt);
650
+ }, li = () => {
651
+ !zt || he || K.scrollHeight - K.scrollTop - K.clientHeight <= 24 && An(zt);
652
652
  }, In = () => {
653
- V || typeof document > "u" || (vo(i, t.accentColor), n.isConnected || (t.mountTarget?.isConnected ? t.mountTarget.appendChild(n) : t.mountTarget || y.body?.appendChild(n)));
653
+ V || typeof document > "u" || (vo(i, t.accentColor), n.isConnected || (t.mountTarget?.isConnected ? t.mountTarget.appendChild(n) : t.mountTarget || v.body?.appendChild(n)));
654
654
  }, Pn = new MutationObserver(In);
655
- Pn.observe(y.documentElement, {
655
+ Pn.observe(v.documentElement, {
656
656
  childList: !0,
657
657
  subtree: !0
658
658
  }), In();
@@ -660,7 +660,7 @@ async function Ra(e = {}) {
660
660
  const d = Tt(o, a);
661
661
  return wn(
662
662
  o,
663
- s ? Ct(s, d) : Wa(
663
+ p ? Ct(p, d) : Fa(
664
664
  o,
665
665
  t.position,
666
666
  d
@@ -668,18 +668,18 @@ async function Ra(e = {}) {
668
668
  d
669
669
  );
670
670
  }, H = () => {
671
- const a = Ka(
671
+ const a = ja(
672
672
  i,
673
673
  u,
674
- v
674
+ y
675
675
  );
676
676
  ll(t, {
677
677
  isOpen: o.classList.contains("pluno-pa-widget--open"),
678
- composerValue: v.value,
678
+ composerValue: y.value,
679
679
  focusedInput: a,
680
680
  focusedInputAt: a ? Date.now() : null,
681
681
  openToolGroupKeys: [...Nt],
682
- launcherPosition: c ? s : null,
682
+ launcherPosition: c ? p : null,
683
683
  panelSize: g,
684
684
  seenShareCandidateIds: [...Pe].slice(
685
685
  -Io
@@ -690,21 +690,21 @@ async function Ra(e = {}) {
690
690
  t.onDisplayStateChange?.(a);
691
691
  }, et = (a, d = !0) => {
692
692
  if (So(t, a), a === "shown") {
693
- o.classList.remove("pluno-pa-widget--minimized"), A.removeAttribute("tabindex"), !o.classList.contains("pluno-pa-widget--open") && !o.classList.contains("pluno-pa-widget--closing") && tt(!1), d && gt("shown");
693
+ o.classList.remove("pluno-pa-widget--minimized"), E.removeAttribute("tabindex"), !o.classList.contains("pluno-pa-widget--open") && !o.classList.contains("pluno-pa-widget--closing") && tt(!1), d && gt("shown");
694
694
  return;
695
695
  }
696
- oe !== null && (window.clearTimeout(oe), oe = null), o.classList.remove("pluno-pa-widget--open"), o.classList.remove("pluno-pa-widget--closing"), o.classList.add("pluno-pa-widget--minimized"), A.hidden = !1, w.hidden = !0, k.hidden = !0, A.tabIndex = 0, v.value = "", Oe(
696
+ oe !== null && (window.clearTimeout(oe), oe = null), o.classList.remove("pluno-pa-widget--open"), o.classList.remove("pluno-pa-widget--closing"), o.classList.add("pluno-pa-widget--minimized"), E.hidden = !1, w.hidden = !0, L.hidden = !0, E.tabIndex = 0, y.value = "", Oe(
697
697
  o,
698
698
  en(
699
699
  o,
700
- s,
700
+ p,
701
701
  t.position
702
702
  )
703
703
  ), co(o), H(), d && gt("minimized");
704
- }, Me = (a, d = {}) => {
705
- ja(a, {
706
- debugVersion: Pa,
707
- launcherPosition: s,
704
+ }, ze = (a, d = {}) => {
705
+ qa(a, {
706
+ debugVersion: Ia,
707
+ launcherPosition: p,
708
708
  rootClasses: o.className,
709
709
  rootStyle: {
710
710
  left: o.style.left,
@@ -713,26 +713,26 @@ async function Ra(e = {}) {
713
713
  bottom: o.style.bottom
714
714
  },
715
715
  rootRect: nn(o),
716
- launcherRect: nn(A),
716
+ launcherRect: nn(E),
717
717
  panelRect: nn(w),
718
718
  viewport: ee(),
719
719
  panelHidden: w.hidden,
720
- closeHidden: k.hidden,
720
+ closeHidden: L.hidden,
721
721
  ...d
722
722
  });
723
723
  }, tt = (a = !0) => {
724
- if (!s)
724
+ if (!p)
725
725
  return Oe(o, null), Qe(a);
726
726
  const d = Qe(a);
727
- return Oe(o, d), Me("Applied stored closed launcher position", {
727
+ return Oe(o, d), ze("Applied stored closed launcher position", {
728
728
  visibleLauncherPosition: d
729
729
  }), d;
730
- }, zt = (a, d) => {
730
+ }, Mt = (a, d) => {
731
731
  if (!a || !d) {
732
732
  co(o);
733
733
  return;
734
734
  }
735
- qa(o, {
735
+ $a(o, {
736
736
  x: a.x - d.x,
737
737
  y: a.y - d.y
738
738
  });
@@ -745,7 +745,7 @@ async function Ra(e = {}) {
745
745
  o,
746
746
  en(
747
747
  o,
748
- s,
748
+ p,
749
749
  t.position
750
750
  )
751
751
  );
@@ -768,20 +768,20 @@ async function Ra(e = {}) {
768
768
  ),
769
769
  d
770
770
  );
771
- zt(f, a), Me(
771
+ Mt(f, a), ze(
772
772
  "Applied open panel position after viewport resize",
773
773
  { openPanelPosition: f }
774
774
  );
775
- } else s && Me(
775
+ } else p && ze(
776
776
  "Applied visible launcher position after viewport resize",
777
777
  { visibleLauncherPosition: a }
778
778
  );
779
779
  };
780
780
  let Rn = () => {
781
781
  };
782
- window.addEventListener("resize", Nn), t.movableLauncher && O ? (tt(), Rn = Ua({
782
+ window.addEventListener("resize", Nn), t.movableLauncher && O ? (tt(), Rn = Oa({
783
783
  root: o,
784
- launcher: A,
784
+ launcher: E,
785
785
  launcherDragHandle: O,
786
786
  getPosition: () => Qe(),
787
787
  setPosition: (a) => {
@@ -790,15 +790,15 @@ async function Ra(e = {}) {
790
790
  a,
791
791
  f
792
792
  );
793
- s = po(
793
+ p = so(
794
794
  C,
795
795
  f
796
- ), Oe(o, C), Me("Dragging closed launcher", {
796
+ ), Oe(o, C), ze("Dragging closed launcher", {
797
797
  requestedPosition: d
798
798
  });
799
799
  },
800
800
  persist: () => {
801
- c = !0, H(), Me("Persisted closed launcher drag position");
801
+ c = !0, H(), ze("Persisted closed launcher drag position");
802
802
  }
803
803
  })) : Oe(o, null), Qt(o, g);
804
804
  const pi = () => {
@@ -815,7 +815,7 @@ async function Ra(e = {}) {
815
815
  ),
816
816
  size: a
817
817
  };
818
- }, di = (a) => {
818
+ }, si = (a) => {
819
819
  g = At(a.size), Qt(o, g), an(
820
820
  R,
821
821
  Dt()
@@ -824,22 +824,22 @@ async function Ra(e = {}) {
824
824
  a.position,
825
825
  Ve(g)
826
826
  );
827
- h = po(
827
+ h = so(
828
828
  d,
829
829
  Ve(g)
830
830
  );
831
831
  const f = Qe();
832
- zt(d, f);
833
- }, ci = z.length > 0 ? Ba({
832
+ Mt(d, f);
833
+ }, di = M.length > 0 ? Ua({
834
834
  root: o,
835
- handles: z,
835
+ handles: M,
836
836
  getBounds: pi,
837
- setBounds: di,
837
+ setBounds: si,
838
838
  persist: H
839
839
  }) : () => {
840
840
  };
841
841
  let Ot = !1;
842
- const Mn = async () => {
842
+ const zn = async () => {
843
843
  if (!(!t.billingStatusLoader || Ot)) {
844
844
  Ot = !0;
845
845
  try {
@@ -866,7 +866,7 @@ async function Ra(e = {}) {
866
866
  }
867
867
  }
868
868
  }, fe = (a = "", d = !0, f = !0) => {
869
- Mn(), ot && (ot = !1, Ft()), o.classList.contains("pluno-pa-widget--open") || (h = null), oe !== null && (window.clearTimeout(oe), oe = null), et("shown", !1), w.hidden = !1, k.hidden = !1, an(
869
+ zn(), ot && (ot = !1, Ft()), o.classList.contains("pluno-pa-widget--open") || (h = null), oe !== null && (window.clearTimeout(oe), oe = null), et("shown", !1), w.hidden = !1, L.hidden = !1, an(
870
870
  R,
871
871
  Dt()
872
872
  ), o.classList.remove("pluno-pa-widget--closing");
@@ -876,28 +876,28 @@ async function Ra(e = {}) {
876
876
  t.position,
877
877
  g
878
878
  );
879
- if (zt(I, C), Me("Opening launcher at clamped open panel position", {
879
+ if (Mt(I, C), ze("Opening launcher at clamped open panel position", {
880
880
  openPanelPosition: I,
881
881
  visibleLauncherPosition: C
882
882
  }), ie(!0, "open"), ae(), !d) {
883
- o.classList.add("pluno-pa-widget--open"), A.hidden = !0, a && (v.value = a, lt(v)), st(M, () => Ne.enabled), Re = M.scrollTop, f && (v.focus(), v.setSelectionRange(v.value.length, v.value.length)), H(), gt("shown"), t.onPanelOpenChange?.(!0);
883
+ o.classList.add("pluno-pa-widget--open"), E.hidden = !0, a && (y.value = a, lt(y)), pt(z, () => Ne.enabled), Re = z.scrollTop, f && (y.focus(), y.setSelectionRange(y.value.length, y.value.length)), H(), gt("shown"), t.onPanelOpenChange?.(!0);
884
884
  return;
885
885
  }
886
886
  window.requestAnimationFrame(() => {
887
- o.classList.add("pluno-pa-widget--open"), a && (v.value = a, lt(v)), st(M, () => Ne.enabled), Re = M.scrollTop, f && (v.focus(), v.setSelectionRange(v.value.length, v.value.length)), H(), gt("shown"), t.onPanelOpenChange?.(!0), oe = window.setTimeout(() => {
888
- A.hidden = !0, st(M, () => Ne.enabled), Re = M.scrollTop;
887
+ o.classList.add("pluno-pa-widget--open"), a && (y.value = a, lt(y)), pt(z, () => Ne.enabled), Re = z.scrollTop, f && (y.focus(), y.setSelectionRange(y.value.length, y.value.length)), H(), gt("shown"), t.onPanelOpenChange?.(!0), oe = window.setTimeout(() => {
888
+ E.hidden = !0, pt(z, () => Ne.enabled), Re = z.scrollTop;
889
889
  }, 220);
890
890
  });
891
891
  }, Ut = () => {
892
- oe !== null && (window.clearTimeout(oe), oe = null), A.hidden = !1, s && (tt(!1), Me("Closing launcher at stored position")), o.classList.remove("pluno-pa-widget--open"), o.classList.add("pluno-pa-widget--closing"), H(), t.onPanelOpenChange?.(!1), oe = window.setTimeout(() => {
893
- w.hidden = !0, k.hidden = !0, h = null, o.classList.remove("pluno-pa-widget--closing");
892
+ oe !== null && (window.clearTimeout(oe), oe = null), E.hidden = !1, p && (tt(!1), ze("Closing launcher at stored position")), o.classList.remove("pluno-pa-widget--open"), o.classList.add("pluno-pa-widget--closing"), H(), t.onPanelOpenChange?.(!1), oe = window.setTimeout(() => {
893
+ w.hidden = !0, L.hidden = !0, h = null, o.classList.remove("pluno-pa-widget--closing");
894
894
  }, 220);
895
895
  };
896
- A.addEventListener("submit", (a) => {
896
+ E.addEventListener("submit", (a) => {
897
897
  a.preventDefault(), fe(u.value), u.value = "";
898
898
  }), O?.addEventListener("click", (a) => {
899
899
  a.preventDefault(), a.stopPropagation();
900
- }), A.addEventListener("click", (a) => {
900
+ }), E.addEventListener("click", (a) => {
901
901
  a.target === u && !O || (fe(u.value), u.value = "");
902
902
  }), u.addEventListener("focus", () => {
903
903
  fe(u.value), u.value = "";
@@ -907,8 +907,8 @@ async function Ra(e = {}) {
907
907
  const a = u.value;
908
908
  fe(a), u.value = "";
909
909
  });
910
- let Bt = null, ht = null, ze = null;
911
- const zn = (a) => a === u || a === v, ui = (a) => {
910
+ let Bt = null, ht = null, Me = null;
911
+ const Mn = (a) => a === u || a === y, ci = (a) => {
912
912
  if (!(a instanceof Element) || a.getRootNode() === o.getRootNode())
913
913
  return null;
914
914
  let d = a;
@@ -920,7 +920,7 @@ async function Ra(e = {}) {
920
920
  d = C instanceof ShadowRoot ? C.host : null;
921
921
  }
922
922
  return null;
923
- }, gi = (a) => {
923
+ }, ui = (a) => {
924
924
  if (!a.isConnected || !a.matches(Jn))
925
925
  return !1;
926
926
  if (!(a instanceof HTMLElement))
@@ -935,55 +935,55 @@ async function Ra(e = {}) {
935
935
  We !== a && (We = a, o.classList.toggle(
936
936
  "pluno-pa-widget--host-modal-conflict",
937
937
  a !== null
938
- ), De(), a !== null ? ze = window.setInterval(() => {
938
+ ), De(), a !== null ? Me = window.setInterval(() => {
939
939
  const d = We;
940
- (!d || !gi(d)) && Dn(null);
941
- }, ba) : ze !== null && (window.clearInterval(ze), ze = null, ht = null));
942
- }, hi = () => {
943
- ze !== null && (window.clearInterval(ze), ze = null);
940
+ (!d || !ui(d)) && Dn(null);
941
+ }, wa) : Me !== null && (window.clearInterval(Me), Me = null, ht = null));
942
+ }, gi = () => {
943
+ Me !== null && (window.clearInterval(Me), Me = null);
944
944
  };
945
945
  o.addEventListener("focusin", (a) => {
946
- zn(a.target) && (Bt = Date.now(), H());
946
+ Mn(a.target) && (Bt = Date.now(), H());
947
947
  }), o.addEventListener("focusout", (a) => {
948
- if (!zn(a.target) || We !== null)
948
+ if (!Mn(a.target) || We !== null)
949
949
  return;
950
950
  const d = Bt;
951
- if (Bt = null, d === null || Date.now() - d > fa)
951
+ if (Bt = null, d === null || Date.now() - d > ma)
952
952
  return;
953
- const f = ui(a.relatedTarget);
953
+ const f = ci(a.relatedTarget);
954
954
  if (!f)
955
955
  return;
956
956
  const C = Date.now();
957
- if (ht !== null && C - ht <= wa) {
957
+ if (ht !== null && C - ht <= fa) {
958
958
  Dn(f);
959
959
  return;
960
960
  }
961
961
  ht = C;
962
- }), A.addEventListener("keydown", (a) => {
962
+ }), E.addEventListener("keydown", (a) => {
963
963
  !o.classList.contains("pluno-pa-widget--minimized") || a.key !== "Enter" && a.key !== " " || (a.preventDefault(), fe());
964
964
  }), F?.addEventListener("pointerdown", (a) => {
965
965
  a.stopPropagation();
966
966
  }), F?.addEventListener("click", (a) => {
967
967
  a.preventDefault(), a.stopPropagation(), et("minimized");
968
- }), k.addEventListener("click", Ut), M.addEventListener("scroll", () => {
969
- M.scrollTop < Re - 1 && ie(!1, "userScroll"), Re = M.scrollTop;
968
+ }), L.addEventListener("click", Ut), z.addEventListener("scroll", () => {
969
+ z.scrollTop < Re - 1 && ie(!1, "userScroll"), Re = z.scrollTop;
970
970
  }), ue.addEventListener("click", () => {
971
- li();
971
+ ri();
972
972
  });
973
973
  const On = typeof IntersectionObserver > "u" ? null : new IntersectionObserver(
974
974
  ([a]) => {
975
975
  a?.isIntersecting && (ie(!0, "bottom"), ae());
976
976
  },
977
- { root: M, threshold: 0 }
977
+ { root: z, threshold: 0 }
978
978
  );
979
979
  On?.observe(Xe);
980
980
  const nt = () => t.loginRequired || t.signupRequired;
981
981
  let We = null, ot = !1;
982
982
  const re = () => ut || _.getState().status !== "connected", De = () => {
983
983
  const a = nt(), d = We !== null;
984
- u.readOnly = !1, v.readOnly = !1, u.placeholder = d ? Qn : a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : ot ? "New update" : t.launcherLabel, v.placeholder = d ? Qn : a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : _e.launcherLabel, te.hidden = a;
984
+ u.readOnly = !1, y.readOnly = !1, u.placeholder = d ? Qn : a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : ot ? "New update" : t.launcherLabel, y.placeholder = d ? Qn : a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : _e.launcherLabel, te.hidden = a;
985
985
  }, j = () => {
986
- B.disabled = re() || le(t.billingStatus) || !_.getState().isThinking && v.value.trim().length === 0 && b.length === 0, U.disabled = nt() || re() || le(t.billingStatus);
986
+ B.disabled = re() || le(t.billingStatus) || !_.getState().isThinking && y.value.trim().length === 0 && b.length === 0, U.disabled = nt() || re() || le(t.billingStatus);
987
987
  };
988
988
  De();
989
989
  const Ft = () => {
@@ -1021,37 +1021,37 @@ async function Ra(e = {}) {
1021
1021
  }
1022
1022
  re() || le(t.billingStatus) || (ve = !0, ie(!0, "send"), ae(), b = on(
1023
1023
  _,
1024
- v,
1024
+ y,
1025
1025
  b,
1026
1026
  yt
1027
1027
  ), Fe(), j());
1028
1028
  });
1029
1029
  let it = 0;
1030
- const mi = () => {
1030
+ const hi = () => {
1031
1031
  it = 0, o.classList.remove("pluno-pa-widget--drag-over");
1032
1032
  }, Ht = (a) => {
1033
- E !== null && window.clearTimeout(E), W.textContent = a, W.hidden = !1, E = window.setTimeout(() => {
1034
- W.textContent = "", W.hidden = !0, E = null;
1033
+ k !== null && window.clearTimeout(k), W.textContent = a, W.hidden = !1, k = window.setTimeout(() => {
1034
+ W.textContent = "", W.hidden = !0, k = null;
1035
1035
  }, 3e3);
1036
- }, fi = () => {
1037
- E !== null && (window.clearTimeout(E), E = null), W.textContent = "", W.hidden = !0;
1036
+ }, mi = () => {
1037
+ k !== null && (window.clearTimeout(k), k = null), W.textContent = "", W.hidden = !0;
1038
1038
  }, Gt = async (a) => {
1039
1039
  if (!t.attachmentsEnabled || a.length === 0)
1040
1040
  return;
1041
- const d = Cr(_, a);
1042
- if (b = [...b, ...d], Fe(), fi(), j(), D(_.getState()), !o.classList.contains("pluno-pa-widget--open")) {
1041
+ const d = Sr(_, a);
1042
+ if (b = [...b, ...d], Fe(), mi(), j(), D(_.getState()), !o.classList.contains("pluno-pa-widget--open")) {
1043
1043
  fe();
1044
1044
  return;
1045
1045
  }
1046
1046
  q();
1047
- }, wi = async (a) => {
1048
- await Gt(a), !(a.length === 0 || We !== null) && v.focus();
1047
+ }, fi = async (a) => {
1048
+ await Gt(a), !(a.length === 0 || We !== null) && y.focus();
1049
1049
  };
1050
1050
  U.addEventListener("click", () => {
1051
1051
  t.loginRequired || re() || le(t.billingStatus) || ce.click();
1052
1052
  }), ce.addEventListener("change", () => {
1053
1053
  const a = Array.from(ce.files ?? []);
1054
- ce.value = "", wi(a).catch((d) => {
1054
+ ce.value = "", fi(a).catch((d) => {
1055
1055
  Ht(
1056
1056
  d instanceof Error ? d.message : "Failed to attach file"
1057
1057
  ), Z("web-sdk.widget", "Attachment failed", {
@@ -1067,7 +1067,7 @@ async function Ra(e = {}) {
1067
1067
  vt(a.dataTransfer) && (a.stopPropagation(), it = Math.max(0, it - 1), it === 0 && o.classList.remove("pluno-pa-widget--drag-over"));
1068
1068
  }), o.addEventListener("drop", (a) => {
1069
1069
  const d = a.dataTransfer;
1070
- !t.attachmentsEnabled || !vt(d) || t.loginRequired || re() || (a.preventDefault(), a.stopPropagation(), mi(), Gt(d.files).catch((f) => {
1070
+ !t.attachmentsEnabled || !vt(d) || t.loginRequired || re() || (a.preventDefault(), a.stopPropagation(), hi(), Gt(d.files).catch((f) => {
1071
1071
  Ht(
1072
1072
  f instanceof Error ? f.message : "Failed to attach file"
1073
1073
  ), Z("web-sdk.widget", "Attachment failed", {
@@ -1095,10 +1095,10 @@ async function Ra(e = {}) {
1095
1095
  }
1096
1096
  if (re())
1097
1097
  return;
1098
- const a = v.value.trim().length > 0 || b.length > 0;
1098
+ const a = y.value.trim().length > 0 || b.length > 0;
1099
1099
  ve = !0, ie(!0, "send"), ae(), b = on(
1100
1100
  _,
1101
- v,
1101
+ y,
1102
1102
  b,
1103
1103
  yt
1104
1104
  ), Fe(), j(), D(_.getState()), a && q();
@@ -1106,9 +1106,9 @@ async function Ra(e = {}) {
1106
1106
  Y = !Y, Je = null, me(), Y && Se.length === 0 && An(null), Y || q();
1107
1107
  }), ct.addEventListener("click", () => {
1108
1108
  Y = !1, me(), q();
1109
- }), K.addEventListener("scroll", si), v.addEventListener("input", () => {
1110
- lt(v), H(), j(), xi();
1111
- }), v.addEventListener("keydown", (a) => {
1109
+ }), K.addEventListener("scroll", li), y.addEventListener("input", () => {
1110
+ lt(y), H(), j(), _i();
1111
+ }), y.addEventListener("keydown", (a) => {
1112
1112
  if (!(a.key !== "Enter" || a.shiftKey)) {
1113
1113
  if (a.preventDefault(), t.loginRequired) {
1114
1114
  t.onLoginClick?.();
@@ -1116,16 +1116,16 @@ async function Ra(e = {}) {
1116
1116
  }
1117
1117
  re() || (ve = !0, ie(!0, "send"), ae(), b = on(
1118
1118
  _,
1119
- v,
1119
+ y,
1120
1120
  b,
1121
1121
  yt
1122
1122
  ), Fe(), j(), D(_.getState()));
1123
1123
  }
1124
1124
  }), o.addEventListener("click", (a) => {
1125
1125
  const d = a.target instanceof Element ? a.target : null;
1126
- d?.closest("a[href]") && H(), Y && Yi(d, Le, X) && (Y = !1, me());
1126
+ d?.closest("a[href]") && H(), Y && Vi(d, Le, X) && (Y = !1, me());
1127
1127
  const C = window.getSelection(), I = !!(C && !C.isCollapsed && C.anchorNode && o.contains(C.anchorNode));
1128
- Ki(a.target, a.detail, I) && q();
1128
+ ji(a.target, a.detail, I) && q();
1129
1129
  }), o.addEventListener("copy", (a) => {
1130
1130
  a.clipboardData && window.getSelection() && !window.getSelection()?.isCollapsed && window.getSelection()?.anchorNode && window.getSelection()?.focusNode && o.contains(window.getSelection()?.anchorNode ?? null) && o.contains(window.getSelection()?.focusNode ?? null) && window.getSelection()?.toString() && (a.clipboardData.clearData(), a.clipboardData.setData(
1131
1131
  "text/plain",
@@ -1144,7 +1144,7 @@ async function Ra(e = {}) {
1144
1144
  return;
1145
1145
  }
1146
1146
  a.key !== "Escape" || !Y || (Y = !1, me(), q());
1147
- }), l.composerValue && (v.value = l.composerValue, lt(v)), t.layout === "page" ? fe(v.value, !1) : p === "minimized" ? et("minimized", !1) : t.initialDisplayState === void 0 && l.isOpen && fe(v.value, !1, !1), Va(l, o, u, v);
1147
+ }), l.composerValue && (y.value = l.composerValue, lt(y)), t.layout === "page" ? fe(y.value, !1) : s === "minimized" ? et("minimized", !1) : t.initialDisplayState === void 0 && l.isOpen && fe(y.value, !1, !1), Ka(l, o, u, y);
1148
1148
  const mt = () => r;
1149
1149
  let $t = _.getState().appearance !== null, ft = null, at = null, Un = _.getState().isThinking, He = null;
1150
1150
  const rt = t.taskNotifications;
@@ -1153,7 +1153,7 @@ async function Ra(e = {}) {
1153
1153
  Ge !== null && (window.clearTimeout(Ge), Ge = null);
1154
1154
  }, wt = () => {
1155
1155
  Ae && (Ae.hidden = !0);
1156
- }, Fn = () => _.getState().assistantDraft.trim().length > 0, bi = async () => {
1156
+ }, Fn = () => _.getState().assistantDraft.trim().length > 0, wi = async () => {
1157
1157
  if (!rt || !Ae || $e || V || !_.getState().isThinking || Fn())
1158
1158
  return;
1159
1159
  let a;
@@ -1169,7 +1169,7 @@ async function Ra(e = {}) {
1169
1169
  });
1170
1170
  }), S?.addEventListener("click", () => {
1171
1171
  $e = !0, wt();
1172
- }), L?.addEventListener("click", () => {
1172
+ }), T?.addEventListener("click", () => {
1173
1173
  $e = !0, wt(), rt?.dismissForever().catch(() => {
1174
1174
  });
1175
1175
  });
@@ -1194,12 +1194,12 @@ async function Ra(e = {}) {
1194
1194
  }), _t();
1195
1195
  let je = null, Wn = () => {
1196
1196
  };
1197
- const _i = !!(t.sdkPreviewChannelId && t.referralLinkLoader), qt = /* @__PURE__ */ new Map(), jt = () => v.value.trim().length > 0 || b.length > 0, xi = () => {
1198
- const a = je !== null && sn(_.getState(), jt());
1197
+ const bi = !!(t.sdkPreviewChannelId && t.referralLinkLoader), qt = /* @__PURE__ */ new Map(), jt = () => y.value.trim().length > 0 || b.length > 0, _i = () => {
1198
+ const a = je !== null && pn(_.getState(), jt());
1199
1199
  ge.hidden = !a, a && je !== null && Wo(ge, je);
1200
1200
  };
1201
1201
  let Ke = null;
1202
- const we = /* @__PURE__ */ new Map(), xt = /* @__PURE__ */ new Set(), yi = async (a) => {
1202
+ const we = /* @__PURE__ */ new Map(), xt = /* @__PURE__ */ new Set(), xi = async (a) => {
1203
1203
  if (t.integrationAuthHandler) {
1204
1204
  we.set(a.authRequestId, { status: "connecting" }), D(_.getState());
1205
1205
  try {
@@ -1213,7 +1213,7 @@ async function Ra(e = {}) {
1213
1213
  D(_.getState());
1214
1214
  }
1215
1215
  }, Kt = (a = {}) => {
1216
- ve = !0, ie(!0, "newSession"), ae(), Y = !1, me(), _.startNewSession(a), Nt.clear(), we.clear(), xt.clear(), v.value = "", b = [], Fe(), lt(v), H(), j(), v.focus(), D(_.getState());
1216
+ ve = !0, ie(!0, "newSession"), ae(), Y = !1, me(), _.startNewSession(a), Nt.clear(), we.clear(), xt.clear(), y.value = "", b = [], Fe(), lt(y), H(), j(), y.focus(), D(_.getState());
1217
1217
  }, yt = () => {
1218
1218
  t.morningReport !== null && (t.morningReport = null, t.onMorningReportTaskStart?.(), Kt());
1219
1219
  }, Vt = (a) => {
@@ -1224,7 +1224,7 @@ async function Ra(e = {}) {
1224
1224
  Ke || (Ke = It(
1225
1225
  "pluno-pa-widget__new-chat",
1226
1226
  "New chat",
1227
- gr(),
1227
+ ur(),
1228
1228
  !1
1229
1229
  ), Ke.addEventListener("click", () => Kt()), $.insertBefore(Ke, X));
1230
1230
  }, D = (a) => {
@@ -1234,7 +1234,7 @@ async function Ra(e = {}) {
1234
1234
  He
1235
1235
  ), t.loginRequired) {
1236
1236
  qt.clear(), xo(
1237
- M,
1237
+ z,
1238
1238
  B,
1239
1239
  Vt,
1240
1240
  mt,
@@ -1247,7 +1247,7 @@ async function Ra(e = {}) {
1247
1247
  }
1248
1248
  if (t.signupRequired) {
1249
1249
  qt.clear(), xo(
1250
- M,
1250
+ z,
1251
1251
  B,
1252
1252
  Vt,
1253
1253
  mt,
@@ -1258,18 +1258,18 @@ async function Ra(e = {}) {
1258
1258
  );
1259
1259
  return;
1260
1260
  }
1261
- const d = Xa(a), f = d !== Tn;
1261
+ const d = Ya(a), f = d !== Tn;
1262
1262
  Tn = d;
1263
1263
  const C = ve || Ne.enabled;
1264
- ve = !1, Pr(
1265
- M,
1264
+ ve = !1, Ir(
1265
+ z,
1266
1266
  Xe,
1267
1267
  B,
1268
1268
  Vt,
1269
1269
  ge,
1270
1270
  a,
1271
1271
  je,
1272
- je !== null && sn(a, jt()),
1272
+ je !== null && pn(a, jt()),
1273
1273
  C,
1274
1274
  () => Ne.enabled,
1275
1275
  Nt,
@@ -1292,10 +1292,10 @@ async function Ra(e = {}) {
1292
1292
  states: we,
1293
1293
  initialStatus: t.integrationAuthStatusLoader ? "checking" : "pending",
1294
1294
  onConnect: (I) => {
1295
- yi(I);
1295
+ xi(I);
1296
1296
  }
1297
1297
  } : void 0,
1298
- _i && !Rt ? {
1298
+ bi && !Rt ? {
1299
1299
  dismissedCandidateIds: Ze,
1300
1300
  actionCandidate: ft,
1301
1301
  error: at,
@@ -1305,7 +1305,7 @@ async function Ra(e = {}) {
1305
1305
  Pe.add(I.id), H();
1306
1306
  },
1307
1307
  onReferralCopy: (I) => {
1308
- vi(I);
1308
+ yi(I);
1309
1309
  },
1310
1310
  onSocialShare: (I) => {
1311
1311
  Pe.add(I.id), Ze.add(I.id), H();
@@ -1317,7 +1317,7 @@ async function Ra(e = {}) {
1317
1317
  Rt = !0, Pe.add(I.id), Ze.add(I.id), H(), rl(t, !0), at = null, D(_.getState());
1318
1318
  }
1319
1319
  } : void 0
1320
- ), C ? (Re = M.scrollTop, ae()) : f && Za(a) && ri();
1320
+ ), C ? (Re = z.scrollTop, ae()) : f && Xa(a) && ai();
1321
1321
  }, Hn = async (a) => {
1322
1322
  if (!t.integrationAuthStatusLoader)
1323
1323
  return;
@@ -1346,21 +1346,21 @@ async function Ra(e = {}) {
1346
1346
  })
1347
1347
  );
1348
1348
  };
1349
- return Wn = Wi(
1349
+ return Wn = Fi(
1350
1350
  (a) => {
1351
- je = a, !V && sn(_.getState(), jt()) && D(_.getState());
1351
+ je = a, !V && pn(_.getState(), jt()) && D(_.getState());
1352
1352
  },
1353
1353
  {
1354
1354
  backendUrl: t.backendUrl,
1355
- fetcher: ai,
1355
+ fetcher: ii,
1356
1356
  loader: t.activeUsersLoader
1357
1357
  }
1358
1358
  ), _.on("state", (a) => {
1359
1359
  _t();
1360
1360
  const d = Un && !a.isThinking;
1361
1361
  Un = a.isThinking, a.isThinking && !a.assistantDraft.trim() && rt && !$e && Ge === null && Ae?.hidden !== !1 && (Ge = window.setTimeout(() => {
1362
- Ge = null, bi();
1363
- }, ta)), (!a.isThinking || a.assistantDraft.trim()) && (Bn(), wt()), d && !o.classList.contains("pluno-pa-widget--open") && (ot = !0), Ft(), a.appearance ? ($t = !0, Z(
1362
+ Ge = null, wi();
1363
+ }, ea)), (!a.isThinking || a.assistantDraft.trim()) && (Bn(), wt()), d && !o.classList.contains("pluno-pa-widget--open") && (ot = !0), Ft(), a.appearance ? ($t = !0, Z(
1364
1364
  "web-sdk.widget",
1365
1365
  "Agent state supplied appearance",
1366
1366
  {
@@ -1374,7 +1374,7 @@ async function Ra(e = {}) {
1374
1374
  fallbackColorScheme: t.colorScheme,
1375
1375
  fallbackFontFamily: t.fontFamily
1376
1376
  }
1377
- ), Yt({}, "agent.state.appearance-cleared")), D(a), Hn(a), j(), d && Mn();
1377
+ ), Yt({}, "agent.state.appearance-cleared")), D(a), Hn(a), j(), d && zn();
1378
1378
  }), D(_.getState()), Hn(_.getState()), j(), Wt(), {
1379
1379
  agent: _,
1380
1380
  startNewChat: Kt,
@@ -1399,7 +1399,7 @@ async function Ra(e = {}) {
1399
1399
  t.loginRequired = a.loginRequired === !0, t.signupRequired = a.signupRequired === !0, a.loginButtonLabel !== void 0 && (t.loginButtonLabel = a.loginButtonLabel), a.loginUrl !== void 0 && (t.loginUrl = a.loginUrl), a.signupButtonLabel !== void 0 && (t.signupButtonLabel = a.signupButtonLabel), a.signupUrl !== void 0 && (t.signupUrl = a.signupUrl), De(), D(_.getState()), j(), d && !nt() && Wt();
1400
1400
  },
1401
1401
  openPanel: (a) => {
1402
- const d = typeof a == "string" ? a : v.value, f = typeof a == "object" ? a.focusComposer !== !1 : !0;
1402
+ const d = typeof a == "string" ? a : y.value, f = typeof a == "object" ? a.focusComposer !== !1 : !0;
1403
1403
  fe(d, !1, f);
1404
1404
  },
1405
1405
  closePanel: Ut,
@@ -1414,10 +1414,10 @@ async function Ra(e = {}) {
1414
1414
  t.morningReport = a ?? null, D(_.getState());
1415
1415
  },
1416
1416
  destroy: () => {
1417
- V || (H(), V = !0, Pn.disconnect(), On?.disconnect(), hi(), window.removeEventListener("resize", Nn), Rn(), ci(), E !== null && window.clearTimeout(E), Bn(), Wn(), _.destroy(), Pt.release(), n.remove());
1417
+ V || (H(), V = !0, Pn.disconnect(), On?.disconnect(), gi(), window.removeEventListener("resize", Nn), Rn(), di(), k !== null && window.clearTimeout(k), Bn(), Wn(), _.destroy(), Pt.release(), n.remove());
1418
1418
  }
1419
1419
  };
1420
- async function vi(a) {
1420
+ async function yi(a) {
1421
1421
  if (!ft) {
1422
1422
  ft = a, at = null, D(_.getState());
1423
1423
  try {
@@ -1426,7 +1426,7 @@ async function Ra(e = {}) {
1426
1426
  const d = await t.referralLinkLoader();
1427
1427
  if (!d)
1428
1428
  throw new Error("Pluno did not return a referral link.");
1429
- await Si(d), Pe.add(a.id), Ze.add(a.id), H();
1429
+ await vi(d), Pe.add(a.id), Ze.add(a.id), H();
1430
1430
  } catch (d) {
1431
1431
  at = d instanceof Error ? d.message : "Could not copy referral link.";
1432
1432
  } finally {
@@ -1434,7 +1434,7 @@ async function Ra(e = {}) {
1434
1434
  }
1435
1435
  }
1436
1436
  }
1437
- async function Si(a) {
1437
+ async function vi(a) {
1438
1438
  if (navigator.clipboard?.writeText)
1439
1439
  try {
1440
1440
  await navigator.clipboard.writeText(a);
@@ -1474,9 +1474,9 @@ async function Ra(e = {}) {
1474
1474
  function io(e, t) {
1475
1475
  return { accentColor: e, scribbleStyle: t };
1476
1476
  }
1477
- function Ma(e) {
1477
+ function Ra(e) {
1478
1478
  const t = za(e);
1479
- return t === null ? "#fafafa" : Da(t) > 0.5 ? "#18181b" : "#fafaf9";
1479
+ return t === null ? "#fafafa" : Ma(t) > 0.5 ? "#18181b" : "#fafaf9";
1480
1480
  }
1481
1481
  function za(e) {
1482
1482
  const t = e.trim();
@@ -1490,7 +1490,7 @@ function za(e) {
1490
1490
  Number.parseInt(t[3] + t[3], 16)
1491
1491
  ] : null;
1492
1492
  }
1493
- function Da([e, t, n]) {
1493
+ function Ma([e, t, n]) {
1494
1494
  const i = (o) => {
1495
1495
  const r = o / 255;
1496
1496
  return r <= 0.03928 ? r / 12.92 : ((r + 0.055) / 1.055) ** 2.4;
@@ -1508,8 +1508,8 @@ function ao(e, t, n) {
1508
1508
  const i = n.scribbleStyle ? Lo(n.accentColor) : n.accentColor;
1509
1509
  e.style.setProperty("--pluno-pa-accent", i), n.scribbleStyle ? e.style.setProperty(
1510
1510
  "--pluno-pa-accent-contrast",
1511
- Ma(i)
1512
- ) : e.style.removeProperty("--pluno-pa-accent-contrast"), e.style.fontFamily = n.scribbleStyle ? xa : n.fontFamily, n.scribbleStyle && Oa(e.ownerDocument);
1511
+ Ra(i)
1512
+ ) : e.style.removeProperty("--pluno-pa-accent-contrast"), e.style.fontFamily = n.scribbleStyle ? _a : n.fontFamily, n.scribbleStyle && Da(e.ownerDocument);
1513
1513
  const o = Array.from(
1514
1514
  e.querySelectorAll(".pluno-pa-widget__character")
1515
1515
  );
@@ -1521,7 +1521,7 @@ function ao(e, t, n) {
1521
1521
  )
1522
1522
  );
1523
1523
  }
1524
- function Oa(e) {
1524
+ function Da(e) {
1525
1525
  if (e.getElementById(eo))
1526
1526
  return;
1527
1527
  const t = e.createElement("style");
@@ -1533,7 +1533,7 @@ function Oa(e) {
1533
1533
  src: url("https://fonts.gstatic.com/s/architectsdaughter/v20/KtkxAKiDZI_td1Lkx62xHZHDtgO_Y-bvTYlg4-7jA-U.woff2") format("woff2");
1534
1534
  }`, e.head.appendChild(t), e.fonts?.load('16px "Architects Daughter"');
1535
1535
  }
1536
- function Ua({
1536
+ function Oa({
1537
1537
  root: e,
1538
1538
  launcher: t,
1539
1539
  launcherDragHandle: n,
@@ -1541,18 +1541,18 @@ function Ua({
1541
1541
  setPosition: o,
1542
1542
  persist: r
1543
1543
  }) {
1544
- let l = null, p = null, s = null, c = !1, g = null;
1544
+ let l = null, s = null, p = null, c = !1, g = null;
1545
1545
  const h = () => {
1546
- l = null, p = null, s = null, c = !1, e.classList.remove("pluno-pa-widget--dragging");
1546
+ l = null, s = null, p = null, c = !1, e.classList.remove("pluno-pa-widget--dragging");
1547
1547
  }, m = (w) => {
1548
- e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing") || (w.preventDefault(), w.stopPropagation(), l = w.pointerId, p = { x: w.clientX, y: w.clientY }, s = i(), c = !1, t.setPointerCapture?.(w.pointerId));
1549
- }, y = (w) => {
1550
- if (l !== w.pointerId || !p || !s)
1548
+ e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing") || (w.preventDefault(), w.stopPropagation(), l = w.pointerId, s = { x: w.clientX, y: w.clientY }, p = i(), c = !1, t.setPointerCapture?.(w.pointerId));
1549
+ }, v = (w) => {
1550
+ if (l !== w.pointerId || !s || !p)
1551
1551
  return;
1552
1552
  w.preventDefault();
1553
- const R = w.clientX - p.x, z = w.clientY - p.y;
1554
- !c && Math.hypot(R, z) < fn || (c = !0, e.classList.add("pluno-pa-widget--dragging"), o({ x: s.x + R, y: s.y + z }));
1555
- }, A = (w) => {
1553
+ const R = w.clientX - s.x, M = w.clientY - s.y;
1554
+ !c && Math.hypot(R, M) < fn || (c = !0, e.classList.add("pluno-pa-widget--dragging"), o({ x: p.x + R, y: p.y + M }));
1555
+ }, E = (w) => {
1556
1556
  l === w.pointerId && (w.preventDefault(), w.stopPropagation(), c && (g = { x: w.clientX, y: w.clientY }, r()), h());
1557
1557
  }, O = (w) => {
1558
1558
  l === w.pointerId && (w.preventDefault(), h());
@@ -1567,56 +1567,56 @@ function Ua({
1567
1567
  }, F = (w) => {
1568
1568
  if (e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing"))
1569
1569
  return;
1570
- const R = w.shiftKey ? Oo : Do, z = i();
1571
- let k = null;
1572
- w.key === "ArrowUp" ? k = { x: z.x, y: z.y - R } : w.key === "ArrowDown" ? k = { x: z.x, y: z.y + R } : w.key === "ArrowLeft" ? k = { x: z.x - R, y: z.y } : w.key === "ArrowRight" && (k = { x: z.x + R, y: z.y }), k && (w.preventDefault(), w.stopPropagation(), o(k), r());
1570
+ const R = w.shiftKey ? Oo : Do, M = i();
1571
+ let L = null;
1572
+ w.key === "ArrowUp" ? L = { x: M.x, y: M.y - R } : w.key === "ArrowDown" ? L = { x: M.x, y: M.y + R } : w.key === "ArrowLeft" ? L = { x: M.x - R, y: M.y } : w.key === "ArrowRight" && (L = { x: M.x + R, y: M.y }), L && (w.preventDefault(), w.stopPropagation(), o(L), r());
1573
1573
  };
1574
- return t.addEventListener("pointerdown", m), t.addEventListener("pointermove", y), t.addEventListener("pointerup", A), t.addEventListener("pointercancel", O), t.addEventListener("click", u, !0), n.addEventListener("keydown", F), () => {
1575
- t.removeEventListener("pointerdown", m), t.removeEventListener("pointermove", y), t.removeEventListener("pointerup", A), t.removeEventListener("pointercancel", O), t.removeEventListener("click", u, !0), n.removeEventListener("keydown", F);
1574
+ return t.addEventListener("pointerdown", m), t.addEventListener("pointermove", v), t.addEventListener("pointerup", E), t.addEventListener("pointercancel", O), t.addEventListener("click", u, !0), n.addEventListener("keydown", F), () => {
1575
+ t.removeEventListener("pointerdown", m), t.removeEventListener("pointermove", v), t.removeEventListener("pointerup", E), t.removeEventListener("pointercancel", O), t.removeEventListener("click", u, !0), n.removeEventListener("keydown", F);
1576
1576
  };
1577
1577
  }
1578
- function Ba({
1578
+ function Ua({
1579
1579
  root: e,
1580
1580
  handles: t,
1581
1581
  getBounds: n,
1582
1582
  setBounds: i,
1583
1583
  persist: o
1584
1584
  }) {
1585
- let r = null, l = null, p = null, s = null, c = !1;
1585
+ let r = null, l = null, s = null, p = null, c = !1;
1586
1586
  const g = () => {
1587
- r = null, l = null, p = null, s = null, c = !1, e.classList.remove("pluno-pa-widget--resizing");
1587
+ r = null, l = null, s = null, p = null, c = !1, e.classList.remove("pluno-pa-widget--resizing");
1588
1588
  }, h = (u) => {
1589
1589
  const F = u.currentTarget, w = F.dataset.resizeDirection;
1590
- !e.classList.contains("pluno-pa-widget--open") || !ro(w) || (u.preventDefault(), u.stopPropagation(), r = u.pointerId, l = w, p = { x: u.clientX, y: u.clientY }, s = n(), c = !1, F.setPointerCapture?.(u.pointerId));
1590
+ !e.classList.contains("pluno-pa-widget--open") || !ro(w) || (u.preventDefault(), u.stopPropagation(), r = u.pointerId, l = w, s = { x: u.clientX, y: u.clientY }, p = n(), c = !1, F.setPointerCapture?.(u.pointerId));
1591
1591
  }, m = (u) => {
1592
- if (r !== u.pointerId || !l || !p || !s)
1592
+ if (r !== u.pointerId || !l || !s || !p)
1593
1593
  return;
1594
1594
  u.preventDefault(), u.stopPropagation();
1595
- const F = u.clientX - p.x, w = u.clientY - p.y;
1595
+ const F = u.clientX - s.x, w = u.clientY - s.y;
1596
1596
  !c && Math.hypot(F, w) < fn || (c = !0, e.classList.add("pluno-pa-widget--resizing"), i(
1597
- lo(s, l, F, w)
1597
+ lo(p, l, F, w)
1598
1598
  ));
1599
- }, y = (u) => {
1599
+ }, v = (u) => {
1600
1600
  r === u.pointerId && (u.preventDefault(), u.stopPropagation(), c && o(), g());
1601
- }, A = (u) => {
1601
+ }, E = (u) => {
1602
1602
  r === u.pointerId && (u.preventDefault(), g());
1603
1603
  }, O = (u) => {
1604
- const w = u.currentTarget.dataset.resizeDirection, R = u.shiftKey ? Oo : Do, z = n();
1605
- let k = 0, te = 0;
1606
- ro(w) && (u.key === "ArrowLeft" ? k = -R : u.key === "ArrowRight" ? k = R : u.key === "ArrowUp" ? te = -R : u.key === "ArrowDown" && (te = R), !(k === 0 && te === 0) && (u.preventDefault(), u.stopPropagation(), i(lo(z, w, k, te)), o()));
1604
+ const w = u.currentTarget.dataset.resizeDirection, R = u.shiftKey ? Oo : Do, M = n();
1605
+ let L = 0, te = 0;
1606
+ ro(w) && (u.key === "ArrowLeft" ? L = -R : u.key === "ArrowRight" ? L = R : u.key === "ArrowUp" ? te = -R : u.key === "ArrowDown" && (te = R), !(L === 0 && te === 0) && (u.preventDefault(), u.stopPropagation(), i(lo(M, w, L, te)), o()));
1607
1607
  };
1608
1608
  for (const u of t)
1609
- u.addEventListener("pointerdown", h), u.addEventListener("pointermove", m), u.addEventListener("pointerup", y), u.addEventListener("pointercancel", A), u.addEventListener("keydown", O);
1609
+ u.addEventListener("pointerdown", h), u.addEventListener("pointermove", m), u.addEventListener("pointerup", v), u.addEventListener("pointercancel", E), u.addEventListener("keydown", O);
1610
1610
  return () => {
1611
1611
  for (const u of t)
1612
- u.removeEventListener("pointerdown", h), u.removeEventListener("pointermove", m), u.removeEventListener("pointerup", y), u.removeEventListener("pointercancel", A), u.removeEventListener("keydown", O);
1612
+ u.removeEventListener("pointerdown", h), u.removeEventListener("pointermove", m), u.removeEventListener("pointerup", v), u.removeEventListener("pointercancel", E), u.removeEventListener("keydown", O);
1613
1613
  };
1614
1614
  }
1615
1615
  function ro(e) {
1616
1616
  return e === "left" || e === "right" || e === "top" || e === "bottom" || e === "top-left" || e === "top-right" || e === "bottom-left" || e === "bottom-right";
1617
1617
  }
1618
1618
  function lo(e, t, n, i) {
1619
- const o = ee(), r = so({
1619
+ const o = ee(), r = po({
1620
1620
  leading: e.position.x,
1621
1621
  length: e.size.width,
1622
1622
  delta: n,
@@ -1628,7 +1628,7 @@ function lo(e, t, n, i) {
1628
1628
  vn,
1629
1629
  o.width - N * 2
1630
1630
  )
1631
- }), l = so({
1631
+ }), l = po({
1632
1632
  leading: e.position.y,
1633
1633
  length: e.size.height,
1634
1634
  delta: i,
@@ -1646,7 +1646,7 @@ function lo(e, t, n, i) {
1646
1646
  size: { width: r.length, height: l.length }
1647
1647
  };
1648
1648
  }
1649
- function so({
1649
+ function po({
1650
1650
  leading: e,
1651
1651
  length: t,
1652
1652
  delta: n,
@@ -1654,32 +1654,32 @@ function so({
1654
1654
  resizeTrailing: o,
1655
1655
  minLeading: r,
1656
1656
  maxTrailing: l,
1657
- minLength: p
1657
+ minLength: s
1658
1658
  }) {
1659
- const s = e + t;
1659
+ const p = e + t;
1660
1660
  if (i) {
1661
1661
  const c = e + n;
1662
1662
  if (c >= r) {
1663
1663
  const h = Q(
1664
1664
  c,
1665
1665
  r,
1666
- s - p
1666
+ p - s
1667
1667
  );
1668
- return { leading: h, length: s - h };
1668
+ return { leading: h, length: p - h };
1669
1669
  }
1670
1670
  const g = Q(
1671
- s + r - c,
1672
- s,
1671
+ p + r - c,
1672
+ p,
1673
1673
  l
1674
1674
  );
1675
1675
  return { leading: r, length: g - r };
1676
1676
  }
1677
1677
  if (o) {
1678
- const c = s + n;
1678
+ const c = p + n;
1679
1679
  if (c <= l) {
1680
1680
  const h = Q(
1681
1681
  c,
1682
- e + p,
1682
+ e + s,
1683
1683
  l
1684
1684
  );
1685
1685
  return { leading: e, length: h - e };
@@ -1700,32 +1700,32 @@ function Tt(e, t = !0) {
1700
1700
  const i = e.getBoundingClientRect(), o = !e.classList.contains("pluno-pa-widget--open") && !e.classList.contains("pluno-pa-widget--closing");
1701
1701
  return {
1702
1702
  width: t && o && i.width > 0 ? i.width : Math.min(Ro, n.width - 36),
1703
- height: t && o && i.height > 0 ? i.height : e.classList.contains("pluno-pa-widget--scribble") ? va : Mo
1703
+ height: t && o && i.height > 0 ? i.height : e.classList.contains("pluno-pa-widget--scribble") ? ya : zo
1704
1704
  };
1705
1705
  }
1706
- function Fa() {
1706
+ function Ba() {
1707
1707
  const e = ee();
1708
1708
  return {
1709
1709
  width: Math.min(
1710
1710
  Q(
1711
- e.width * Ca,
1711
+ e.width * Sa,
1712
1712
  vn,
1713
- Sa
1713
+ va
1714
1714
  ),
1715
1715
  e.width - N * 2
1716
1716
  ),
1717
1717
  height: Math.min(
1718
1718
  Q(
1719
- e.height * ka,
1719
+ e.height * Ea,
1720
1720
  Sn,
1721
- Ea
1721
+ Ca
1722
1722
  ),
1723
1723
  e.height - Ue - N
1724
1724
  )
1725
1725
  };
1726
1726
  }
1727
1727
  function Ve(e = null) {
1728
- return e ? At(e) : Fa();
1728
+ return e ? At(e) : Ba();
1729
1729
  }
1730
1730
  function At(e) {
1731
1731
  const t = ee();
@@ -1762,7 +1762,7 @@ function Qt(e, t) {
1762
1762
  const n = At(t);
1763
1763
  e.style.setProperty("--pluno-pa-panel-width", `${n.width}px`), e.style.setProperty("--pluno-pa-panel-height", `${n.height}px`);
1764
1764
  }
1765
- function Wa(e, t, n) {
1765
+ function Fa(e, t, n) {
1766
1766
  const i = Number.parseFloat(e.style.left), o = Number.parseFloat(e.style.top);
1767
1767
  if (Number.isFinite(i) && Number.isFinite(o))
1768
1768
  return { x: i, y: o };
@@ -1781,9 +1781,9 @@ function en(e, t, n) {
1781
1781
  e,
1782
1782
  Ct(t, i),
1783
1783
  i
1784
- ) : Ha(n === "bottom-left" ? "bottom-left" : "bottom-right", i, ya);
1784
+ ) : Wa(n === "bottom-left" ? "bottom-left" : "bottom-right", i, xa);
1785
1785
  }
1786
- function Ha(e, t, n) {
1786
+ function Wa(e, t, n) {
1787
1787
  const i = ee();
1788
1788
  return {
1789
1789
  x: e.endsWith("right") ? Math.max(0, i.width - t.width - n) : n,
@@ -1791,7 +1791,7 @@ function Ha(e, t, n) {
1791
1791
  };
1792
1792
  }
1793
1793
  function wn(e, t, n) {
1794
- const i = ee(), o = N + $a(e);
1794
+ const i = ee(), o = N + Ga(e);
1795
1795
  return {
1796
1796
  x: Q(
1797
1797
  t.x,
@@ -1818,20 +1818,20 @@ function Ct(e, t) {
1818
1818
  y: e.anchor.startsWith("bottom") ? n.height - t.height - e.y : e.y
1819
1819
  };
1820
1820
  }
1821
- function po(e, t) {
1822
- const n = Ga(e, t), i = ee();
1821
+ function so(e, t) {
1822
+ const n = Ha(e, t), i = ee();
1823
1823
  return {
1824
1824
  anchor: n,
1825
1825
  x: n.endsWith("right") ? i.width - e.x - t.width : e.x,
1826
1826
  y: n.startsWith("bottom") ? i.height - e.y - t.height : e.y
1827
1827
  };
1828
1828
  }
1829
- function Ga(e, t) {
1829
+ function Ha(e, t) {
1830
1830
  const n = ee(), i = e.x + t.width / 2, r = e.y + t.height / 2 <= n.height / 2 ? "top" : "bottom", l = i <= n.width / 2 ? "left" : "right";
1831
1831
  return `${r}-${l}`;
1832
1832
  }
1833
- function $a(e) {
1834
- return e.classList.contains("pluno-pa-widget--scribble") ? Ia : Aa;
1833
+ function Ga(e) {
1834
+ return e.classList.contains("pluno-pa-widget--scribble") ? Aa : Ta;
1835
1835
  }
1836
1836
  function tn(e, t, n, i = null) {
1837
1837
  const o = Tt(e), r = Ve(i), l = {
@@ -1868,7 +1868,7 @@ function Oe(e, t) {
1868
1868
  }
1869
1869
  e.style.left = `${t.x}px`, e.style.top = `${t.y}px`, e.style.right = "auto", e.style.bottom = "auto";
1870
1870
  }
1871
- function qa(e, t) {
1871
+ function $a(e, t) {
1872
1872
  e.style.setProperty("--pluno-pa-panel-offset-x", `${t.x}px`), e.style.setProperty("--pluno-pa-panel-offset-y", `${t.y}px`);
1873
1873
  }
1874
1874
  function co(e) {
@@ -1877,7 +1877,7 @@ function co(e) {
1877
1877
  function ee() {
1878
1878
  return {
1879
1879
  width: window.innerWidth || document.documentElement.clientWidth || Ro + N * 2,
1880
- height: window.innerHeight || document.documentElement.clientHeight || Mo + N * 2
1880
+ height: window.innerHeight || document.documentElement.clientHeight || zo + N * 2
1881
1881
  };
1882
1882
  }
1883
1883
  function nn(e) {
@@ -1902,44 +1902,42 @@ function Z(e, t, n) {
1902
1902
  details: n
1903
1903
  }, r = i.__plunoProductAgentDiagnostics__ ?? [];
1904
1904
  r.push(o), r.length > 120 && r.splice(0, r.length - 120), i.__plunoProductAgentDiagnostics__ = r, i.__PLUNO_PRODUCT_AGENT_DIAGNOSTICS__ = () => [...r], window.dispatchEvent(
1905
- new CustomEvent(ha, { detail: o })
1905
+ new CustomEvent(ga, { detail: o })
1906
1906
  );
1907
1907
  }
1908
- function ja(e, t) {
1908
+ function qa(e, t) {
1909
1909
  Z("web-sdk.widget.position", e, t);
1910
1910
  }
1911
1911
  function on(e, t, n, i) {
1912
1912
  const o = t.value.trim();
1913
1913
  return !o && n.length === 0 ? n : (i(), t.value = "", t.style.height = "22px", t.style.overflowY = "hidden", e.sendMessage(o, {
1914
- attachments: n.length > 0 ? n.map(Ya) : void 0
1914
+ attachments: n.length > 0 ? n.map(Va) : void 0
1915
1915
  }), t.dispatchEvent(new Event("input", { bubbles: !0 })), []);
1916
1916
  }
1917
- function Ka(e, t, n) {
1917
+ function ja(e, t, n) {
1918
1918
  const i = e.activeElement;
1919
1919
  return i === n ? "composer" : i === t ? "launcher" : null;
1920
1920
  }
1921
- function Va(e, t, n, i) {
1922
- if (!e.focusedInput || !e.focusedInputAt || Date.now() - e.focusedInputAt > na)
1921
+ function Ka(e, t, n, i) {
1922
+ if (!e.focusedInput || !e.focusedInputAt || Date.now() - e.focusedInputAt > ta)
1923
1923
  return;
1924
1924
  const o = e.focusedInput === "composer" ? i : n;
1925
1925
  o === i && !t.classList.contains("pluno-pa-widget--open") || o === n && t.classList.contains("pluno-pa-widget--open") || window.requestAnimationFrame(() => {
1926
1926
  !o.isConnected || o.readOnly || (o.focus(), o.setSelectionRange(o.value.length, o.value.length));
1927
1927
  });
1928
1928
  }
1929
- function Ya(e) {
1929
+ function Va(e) {
1930
1930
  return e;
1931
1931
  }
1932
1932
  function lt(e) {
1933
- e.style.height = "0px";
1934
- const t = Math.max(22, Math.min(e.scrollHeight, 140));
1935
- e.style.height = `${t}px`, e.style.overflowY = e.scrollHeight > 140 ? "auto" : "hidden";
1933
+ e.style.height = "0px", e.style.height = `${e.scrollHeight}px`, e.style.overflowY = e.scrollHeight > e.clientHeight ? "auto" : "hidden";
1936
1934
  }
1937
- function st(e, t = () => !0) {
1935
+ function pt(e, t = () => !0) {
1938
1936
  e.scrollTop = e.scrollHeight, window.requestAnimationFrame(() => {
1939
1937
  t() && (e.scrollTop = e.scrollHeight);
1940
1938
  });
1941
1939
  }
1942
- function Xa(e) {
1940
+ function Ya(e) {
1943
1941
  const t = e.messages[e.messages.length - 1];
1944
1942
  return [
1945
1943
  e.messages.length,
@@ -1950,13 +1948,13 @@ function Xa(e) {
1950
1948
  e.lastError ?? ""
1951
1949
  ].join(":");
1952
1950
  }
1953
- function Za(e) {
1951
+ function Xa(e) {
1954
1952
  return e.messages.length > 0 || e.assistantDraft.length > 0 || e.isThinking || !!e.lastError;
1955
1953
  }
1956
- function Ja(e) {
1954
+ function Za(e) {
1957
1955
  return e.firstUserMessage?.trim() ? e.firstUserMessage : e.title?.trim() ? e.title : "Untitled chat";
1958
1956
  }
1959
- function Qa(e) {
1957
+ function Ja(e) {
1960
1958
  const t = e.currentPage;
1961
1959
  if (typeof t?.url == "string" && t.url.trim())
1962
1960
  try {
@@ -1967,7 +1965,7 @@ function Qa(e) {
1967
1965
  }
1968
1966
  return typeof t?.origin == "string" && t.origin.trim() ? t.origin : "Current origin";
1969
1967
  }
1970
- function er(e, t) {
1968
+ function Qa(e, t) {
1971
1969
  const n = new Date(e).getTime();
1972
1970
  if (!Number.isFinite(n))
1973
1971
  return "now";
@@ -1978,14 +1976,14 @@ function er(e, t) {
1978
1976
  ];
1979
1977
  for (const [r, l] of o)
1980
1978
  if (i >= l) {
1981
- const p = Math.max(1, Math.floor(i / l));
1982
- return r === "min" ? `${p} min` : `${p} ${r}${p === 1 ? "" : "s"}`;
1979
+ const s = Math.max(1, Math.floor(i / l));
1980
+ return r === "min" ? `${s} min` : `${s} ${r}${s === 1 ? "" : "s"}`;
1983
1981
  }
1984
1982
  return "now";
1985
1983
  }
1986
- function tr(e, t, n, i, o) {
1987
- e.appendChild(cr()), e.appendChild(
1988
- nr(
1984
+ function er(e, t, n, i, o) {
1985
+ e.appendChild(dr()), e.appendChild(
1986
+ tr(
1989
1987
  t,
1990
1988
  n,
1991
1989
  i,
@@ -1995,16 +1993,16 @@ function tr(e, t, n, i, o) {
1995
1993
  It(
1996
1994
  "pluno-pa-widget__close",
1997
1995
  "Close",
1998
- ur(16),
1996
+ cr(16),
1999
1997
  !0
2000
1998
  )
2001
- ), e.appendChild(or(n));
1999
+ ), e.appendChild(nr(n));
2002
2000
  }
2003
- function nr(e, t, n, i) {
2001
+ function tr(e, t, n, i) {
2004
2002
  const o = document.createElement("form");
2005
2003
  if (o.className = "pluno-pa-widget__launcher", i && o.classList.add("pluno-pa-widget__launcher--minimizable"), n) {
2006
- const s = document.createElement("button");
2007
- s.type = "button", s.className = "pluno-pa-widget__launcher-drag-handle", s.setAttribute("aria-label", "Move Pluno launcher"), s.title = "Move Pluno launcher", o.appendChild(s);
2004
+ const p = document.createElement("button");
2005
+ p.type = "button", p.className = "pluno-pa-widget__launcher-drag-handle", p.setAttribute("aria-label", "Move Pluno launcher"), p.title = "Move Pluno launcher", o.appendChild(p);
2008
2006
  }
2009
2007
  o.appendChild(
2010
2008
  Go(
@@ -2021,14 +2019,14 @@ function nr(e, t, n, i) {
2021
2019
  r.className = "pluno-pa-widget__launcher-run-indicator", o.appendChild(r);
2022
2020
  const l = document.createElement("input");
2023
2021
  l.className = "pluno-pa-widget__launcher-input", l.type = "text", l.placeholder = e, l.setAttribute("aria-label", e), o.appendChild(l);
2024
- const p = dt("Working...");
2025
- if (p.classList.add("pluno-pa-widget__status--launcher"), o.appendChild(p), i) {
2026
- const s = document.createElement("button");
2027
- s.type = "button", s.className = "pluno-pa-widget__launcher-minimize", s.textContent = "-", s.setAttribute("aria-label", "Minimize Pluno on this site"), s.title = "Minimize Pluno on this site", o.appendChild(s);
2022
+ const s = dt("Working...");
2023
+ if (s.classList.add("pluno-pa-widget__status--launcher"), o.appendChild(s), i) {
2024
+ const p = document.createElement("button");
2025
+ p.type = "button", p.className = "pluno-pa-widget__launcher-minimize", p.textContent = "-", p.setAttribute("aria-label", "Minimize Pluno on this site"), p.title = "Minimize Pluno on this site", o.appendChild(p);
2028
2026
  }
2029
2027
  return o;
2030
2028
  }
2031
- function or(e) {
2029
+ function nr(e) {
2032
2030
  const t = document.createElement("section");
2033
2031
  t.className = "pluno-pa-widget__panel", t.hidden = !0, t.appendChild(
2034
2032
  Go("pluno-pa-widget__scribble-spirals--panel", 16)
@@ -2036,22 +2034,22 @@ function or(e) {
2036
2034
  const n = document.createElement("div");
2037
2035
  n.className = "pluno-pa-widget__timeline-wrap";
2038
2036
  const i = document.createElement("main");
2039
- i.className = "pluno-pa-widget__timeline", i.appendChild(sr(e));
2037
+ i.className = "pluno-pa-widget__timeline", i.appendChild(lr(e));
2040
2038
  const o = document.createElement("div");
2041
2039
  o.className = "pluno-pa-widget__timeline-bottom-sentinel", o.setAttribute("aria-hidden", "true"), i.appendChild(o), n.appendChild(i);
2042
2040
  const r = document.createElement("div");
2043
2041
  r.className = "pluno-pa-widget__active-users-counter", r.hidden = !0, n.appendChild(r);
2044
2042
  const l = document.createElement("button");
2045
2043
  l.type = "button", l.className = "pluno-pa-widget__timeline-jump", l.textContent = "New messages ↓", l.hidden = !0, n.appendChild(l);
2046
- const p = document.createElement("div");
2047
- return p.className = "pluno-pa-widget__top-actions", p.appendChild(
2044
+ const s = document.createElement("div");
2045
+ return s.className = "pluno-pa-widget__top-actions", s.appendChild(
2048
2046
  It(
2049
2047
  "pluno-pa-widget__history",
2050
2048
  bn(),
2051
- hr(),
2049
+ gr(),
2052
2050
  !0
2053
2051
  )
2054
- ), n.appendChild(p), n.appendChild(lr()), t.appendChild(n), t.appendChild(ir()), t.appendChild(ar()), t.appendChild(rr()), t.appendChild(Ce("left", "Resize Pluno from left")), t.appendChild(
2052
+ ), n.appendChild(s), n.appendChild(rr()), t.appendChild(n), t.appendChild(or()), t.appendChild(ir()), t.appendChild(ar()), t.appendChild(Ce("left", "Resize Pluno from left")), t.appendChild(
2055
2053
  Ce("right", "Resize Pluno from right")
2056
2054
  ), t.appendChild(Ce("top", "Resize Pluno from top")), t.appendChild(
2057
2055
  Ce("bottom", "Resize Pluno from bottom")
@@ -2072,7 +2070,7 @@ function Ce(e, t) {
2072
2070
  `pluno-pa-widget__resize-handle--${e}`
2073
2071
  ].join(" "), n.dataset.resizeDirection = e, n.setAttribute("aria-label", t), n.title = t, n;
2074
2072
  }
2075
- function ir() {
2073
+ function or() {
2076
2074
  const e = document.createElement("div");
2077
2075
  e.className = "pluno-pa-widget__notify-suggestion", e.hidden = !0;
2078
2076
  const t = document.createElement("span");
@@ -2086,7 +2084,7 @@ function ir() {
2086
2084
  const r = document.createElement("button");
2087
2085
  return r.type = "button", r.className = "pluno-pa-widget__notify-suggestion-never", r.textContent = "Never", n.append(i, o, r), e.append(t, n), e;
2088
2086
  }
2089
- function ar() {
2087
+ function ir() {
2090
2088
  const e = document.createElement("div");
2091
2089
  e.className = "pluno-pa-widget__notify-suggestion pluno-pa-widget__tab-groups-suggestion", e.hidden = !0;
2092
2090
  const t = document.createElement("span");
@@ -2098,7 +2096,7 @@ function ar() {
2098
2096
  const o = document.createElement("button");
2099
2097
  return o.type = "button", o.className = "pluno-pa-widget__notify-suggestion-later pluno-pa-widget__tab-groups-suggestion-dismiss", o.textContent = "Not now", n.append(i, o), e.append(t, n), e;
2100
2098
  }
2101
- function rr() {
2099
+ function ar() {
2102
2100
  const e = document.createElement("form");
2103
2101
  e.className = "pluno-pa-widget__composer";
2104
2102
  const t = document.createElement("div");
@@ -2112,11 +2110,11 @@ function rr() {
2112
2110
  const r = document.createElement("input");
2113
2111
  r.className = "pluno-pa-widget__attachment-input", r.type = "file", r.multiple = !0, r.tabIndex = -1, r.setAttribute("aria-hidden", "true"), o.appendChild(r);
2114
2112
  const l = document.createElement("button");
2115
- l.type = "button", l.className = "pluno-pa-widget__attach", l.setAttribute("aria-label", "Attach files"), l.title = "Attach files", l.appendChild(fr()), l.appendChild(wr()), o.appendChild(l);
2116
- const p = document.createElement("textarea");
2117
- p.className = "pluno-pa-widget__input", p.rows = 1, p.placeholder = "Ask for anything...", o.appendChild(p);
2118
- const s = document.createElement("button");
2119
- s.type = "button", s.className = "pluno-pa-widget__send", s.setAttribute("aria-label", "Send"), s.appendChild(qo()), o.appendChild(s), e.appendChild(o);
2113
+ l.type = "button", l.className = "pluno-pa-widget__attach", l.setAttribute("aria-label", "Attach files"), l.title = "Attach files", l.appendChild(mr()), l.appendChild(fr()), o.appendChild(l);
2114
+ const s = document.createElement("textarea");
2115
+ s.className = "pluno-pa-widget__input", s.rows = 1, s.placeholder = "Ask for anything...", o.appendChild(s);
2116
+ const p = document.createElement("button");
2117
+ p.type = "button", p.className = "pluno-pa-widget__send", p.setAttribute("aria-label", "Send"), p.appendChild(qo()), o.appendChild(p), e.appendChild(o);
2120
2118
  const c = document.createElement("div");
2121
2119
  c.className = "pluno-pa-widget__composer-meta";
2122
2120
  const g = document.createElement("a");
@@ -2127,7 +2125,7 @@ function rr() {
2127
2125
  function bn() {
2128
2126
  return location.hostname ? `Recent chats on ${location.hostname}` : "Recent chats";
2129
2127
  }
2130
- function lr() {
2128
+ function rr() {
2131
2129
  const e = document.createElement("section");
2132
2130
  e.className = "pluno-pa-widget__history-panel", e.hidden = !0, e.setAttribute("aria-label", bn());
2133
2131
  const t = document.createElement("div");
@@ -2137,7 +2135,7 @@ function lr() {
2137
2135
  const i = It(
2138
2136
  "pluno-pa-widget__history-close",
2139
2137
  "Close recent chats",
2140
- mr(),
2138
+ hr(),
2141
2139
  !1
2142
2140
  );
2143
2141
  t.append(n, i);
@@ -2146,7 +2144,7 @@ function lr() {
2146
2144
  const r = document.createElement("p");
2147
2145
  return r.className = "pluno-pa-widget__history-status", r.hidden = !0, e.append(t, o, r), e;
2148
2146
  }
2149
- function sr(e) {
2147
+ function lr(e) {
2150
2148
  const t = document.createElement("div");
2151
2149
  return t.className = "pluno-pa-widget__empty-state", t.appendChild(
2152
2150
  ke(
@@ -2174,14 +2172,14 @@ function Wo(e, t) {
2174
2172
  function ke(e, t) {
2175
2173
  const n = `pluno-pa-character-${oo}`;
2176
2174
  oo += 1;
2177
- const i = t.scribbleStyle ? dr(t.accentColor, n) : pr(t.accentColor, n), o = e.split(/\s+/).filter(Boolean);
2175
+ const i = t.scribbleStyle ? sr(t.accentColor, n) : pr(t.accentColor, n), o = e.split(/\s+/).filter(Boolean);
2178
2176
  return i.setAttribute(
2179
2177
  "class",
2180
2178
  o.includes("pluno-pa-widget__character") ? e : `pluno-pa-widget__character ${e}`
2181
2179
  ), i.setAttribute("aria-hidden", "true"), i.setAttribute("focusable", "false"), i.removeAttribute("role"), i.removeAttribute("aria-label"), i;
2182
2180
  }
2183
2181
  function pr(e, t) {
2184
- const n = Ti(e), i = {
2182
+ const n = Li(e), i = {
2185
2183
  boltFill: `${t}-boltFill`,
2186
2184
  boltEdge: `${t}-boltEdge`,
2187
2185
  boltGlow: `${t}-boltGlow`,
@@ -2201,7 +2199,7 @@ function pr(e, t) {
2201
2199
  gradientUnits: "userSpaceOnUse"
2202
2200
  });
2203
2201
  G(l, "0", n.top), G(l, "0.36", n.middle), G(l, "0.72", n.bottom), G(l, "1", n.bottom);
2204
- const p = x(r, "linearGradient", {
2202
+ const s = x(r, "linearGradient", {
2205
2203
  id: i.boltEdge,
2206
2204
  x1: "470",
2207
2205
  y1: "145",
@@ -2209,14 +2207,14 @@ function pr(e, t) {
2209
2207
  y2: "980",
2210
2208
  gradientUnits: "userSpaceOnUse"
2211
2209
  });
2212
- G(p, "0", n.edgeStart), G(p, "0.32", n.edgeMiddle), G(p, "0.78", n.edgeEnd), G(p, "1", n.edgeEnd);
2213
- const s = x(r, "radialGradient", {
2210
+ G(s, "0", n.edgeStart), G(s, "0.32", n.edgeMiddle), G(s, "0.78", n.edgeEnd), G(s, "1", n.edgeEnd);
2211
+ const p = x(r, "radialGradient", {
2214
2212
  id: i.boltGlow,
2215
2213
  cx: "50%",
2216
2214
  cy: "22%",
2217
2215
  r: "82%"
2218
2216
  });
2219
- G(s, "0", n.glow, "0.72"), G(s, "0.5", n.middle, "0.44"), G(s, "1", n.bottom, "0");
2217
+ G(p, "0", n.glow, "0.72"), G(p, "0.5", n.middle, "0.44"), G(p, "1", n.bottom, "0");
2220
2218
  const c = x(r, "radialGradient", {
2221
2219
  id: i.eyeWhite,
2222
2220
  cx: "35%",
@@ -2279,7 +2277,7 @@ function pr(e, t) {
2279
2277
  in2: "innerLight",
2280
2278
  mode: "screen"
2281
2279
  });
2282
- const y = x(r, "filter", {
2280
+ const v = x(r, "filter", {
2283
2281
  id: i.eyeShadow,
2284
2282
  x: "-24%",
2285
2283
  y: "-20%",
@@ -2287,14 +2285,14 @@ function pr(e, t) {
2287
2285
  height: "148%",
2288
2286
  "color-interpolation-filters": "sRGB"
2289
2287
  });
2290
- x(y, "feDropShadow", {
2288
+ x(v, "feDropShadow", {
2291
2289
  dx: "0",
2292
2290
  dy: "8",
2293
2291
  stdDeviation: "5",
2294
2292
  "flood-color": n.shadow,
2295
2293
  "flood-opacity": "0.3"
2296
2294
  });
2297
- const A = x(r, "filter", {
2295
+ const E = x(r, "filter", {
2298
2296
  id: i.pupilGloss,
2299
2297
  x: "-15%",
2300
2298
  y: "-15%",
@@ -2302,7 +2300,7 @@ function pr(e, t) {
2302
2300
  height: "130%",
2303
2301
  "color-interpolation-filters": "sRGB"
2304
2302
  });
2305
- x(A, "feDropShadow", {
2303
+ x(E, "feDropShadow", {
2306
2304
  dx: "0",
2307
2305
  dy: "3",
2308
2306
  stdDeviation: "3",
@@ -2377,13 +2375,13 @@ function pr(e, t) {
2377
2375
  i
2378
2376
  ), o;
2379
2377
  }
2380
- function dr(e, t) {
2378
+ function sr(e, t) {
2381
2379
  const n = Lo(e), i = {
2382
2380
  clip: `${t}-scribbleBoltClip`,
2383
2381
  wobble: `${t}-scribbleBoltWobble`
2384
2382
  }, o = Ho(), r = x(o, "defs"), l = x(r, "clipPath", { id: i.clip });
2385
2383
  x(l, "path", { d: kt });
2386
- const p = x(r, "filter", {
2384
+ const s = x(r, "filter", {
2387
2385
  id: i.wobble,
2388
2386
  x: "-10%",
2389
2387
  y: "-10%",
@@ -2391,24 +2389,24 @@ function dr(e, t) {
2391
2389
  height: "120%",
2392
2390
  "color-interpolation-filters": "sRGB"
2393
2391
  });
2394
- x(p, "feTurbulence", {
2392
+ x(s, "feTurbulence", {
2395
2393
  type: "fractalNoise",
2396
2394
  baseFrequency: "0.011",
2397
2395
  numOctaves: "3",
2398
2396
  seed: "7",
2399
2397
  result: "noise"
2400
- }), x(p, "feDisplacementMap", {
2398
+ }), x(s, "feDisplacementMap", {
2401
2399
  in: "SourceGraphic",
2402
2400
  in2: "noise",
2403
2401
  scale: "16",
2404
2402
  xChannelSelector: "R",
2405
2403
  yChannelSelector: "G"
2406
2404
  });
2407
- const s = x(o, "g", { filter: J(i.wobble) }), c = x(s, "g", {
2405
+ const p = x(o, "g", { filter: J(i.wobble) }), c = x(p, "g", {
2408
2406
  "clip-path": J(i.clip)
2409
2407
  });
2410
2408
  return x(c, "path", {
2411
- d: Li(),
2409
+ d: ki(),
2412
2410
  fill: "none",
2413
2411
  stroke: n,
2414
2412
  "stroke-width": "56",
@@ -2416,14 +2414,14 @@ function dr(e, t) {
2416
2414
  "stroke-linejoin": "round",
2417
2415
  opacity: "0.9",
2418
2416
  transform: "rotate(-14 627 600)"
2419
- }), x(s, "path", {
2417
+ }), x(p, "path", {
2420
2418
  d: kt,
2421
2419
  fill: "none",
2422
2420
  stroke: Lt,
2423
2421
  "stroke-width": "18",
2424
2422
  "stroke-linejoin": "round"
2425
2423
  }), go(
2426
- s,
2424
+ p,
2427
2425
  "rotate(-2 528 463)",
2428
2426
  "528",
2429
2427
  "463",
@@ -2432,7 +2430,7 @@ function dr(e, t) {
2432
2430
  "557",
2433
2431
  "447"
2434
2432
  ), go(
2435
- s,
2433
+ p,
2436
2434
  "rotate(2 717 462)",
2437
2435
  "717",
2438
2436
  "462",
@@ -2443,36 +2441,36 @@ function dr(e, t) {
2443
2441
  ), o;
2444
2442
  }
2445
2443
  function Ho() {
2446
- return T("svg", {
2447
- xmlns: zo,
2444
+ return A("svg", {
2445
+ xmlns: Mo,
2448
2446
  viewBox: "0 0 1254 1254"
2449
2447
  });
2450
2448
  }
2451
- function uo(e, t, n, i, o, r, l, p, s) {
2449
+ function uo(e, t, n, i, o, r, l, s, p) {
2452
2450
  const c = x(e, "g", { transform: t });
2453
2451
  x(c, "ellipse", {
2454
2452
  cx: n,
2455
2453
  cy: i,
2456
2454
  rx: "73",
2457
2455
  ry: "80",
2458
- fill: J(s.eyeWhite)
2456
+ fill: J(p.eyeWhite)
2459
2457
  }), x(c, "ellipse", {
2460
2458
  cx: o,
2461
2459
  cy: r,
2462
2460
  rx: "49",
2463
2461
  ry: "57",
2464
- fill: J(s.pupil),
2465
- filter: J(s.pupilGloss)
2462
+ fill: J(p.pupil),
2463
+ filter: J(p.pupilGloss)
2466
2464
  }), x(c, "circle", {
2467
2465
  cx: l,
2468
- cy: p,
2466
+ cy: s,
2469
2467
  r: "18",
2470
2468
  fill: "#ffffff"
2471
2469
  });
2472
2470
  }
2473
- function go(e, t, n, i, o, r, l, p) {
2474
- const s = x(e, "g", { transform: t });
2475
- x(s, "ellipse", {
2471
+ function go(e, t, n, i, o, r, l, s) {
2472
+ const p = x(e, "g", { transform: t });
2473
+ x(p, "ellipse", {
2476
2474
  cx: n,
2477
2475
  cy: i,
2478
2476
  rx: "73",
@@ -2480,21 +2478,21 @@ function go(e, t, n, i, o, r, l, p) {
2480
2478
  fill: "#ffffff",
2481
2479
  stroke: Lt,
2482
2480
  "stroke-width": "13"
2483
- }), x(s, "ellipse", {
2481
+ }), x(p, "ellipse", {
2484
2482
  cx: o,
2485
2483
  cy: r,
2486
2484
  rx: "45",
2487
2485
  ry: "53",
2488
2486
  fill: Lt
2489
- }), x(s, "circle", {
2487
+ }), x(p, "circle", {
2490
2488
  cx: l,
2491
- cy: p,
2489
+ cy: s,
2492
2490
  r: "16",
2493
2491
  fill: "#ffffff"
2494
2492
  });
2495
2493
  }
2496
2494
  function x(e, t, n = {}) {
2497
- const i = T(t, n);
2495
+ const i = A(t, n);
2498
2496
  return e.appendChild(i), i;
2499
2497
  }
2500
2498
  function G(e, t, n, i) {
@@ -2508,14 +2506,14 @@ function It(e, t, n, i) {
2508
2506
  const o = document.createElement("button");
2509
2507
  return o.type = "button", o.className = e, o.setAttribute("aria-label", t), o.title = t, o.hidden = i, o.appendChild(n), o;
2510
2508
  }
2511
- function cr() {
2512
- const e = T("svg", {
2509
+ function dr() {
2510
+ const e = A("svg", {
2513
2511
  class: "pluno-pa-widget__scribble-defs",
2514
2512
  "aria-hidden": "true",
2515
2513
  focusable: "false",
2516
2514
  width: "0",
2517
2515
  height: "0"
2518
- }), t = T("defs");
2516
+ }), t = A("defs");
2519
2517
  return t.appendChild(rn("pluno-pa-scribble-wobble", "2", "12")), t.appendChild(
2520
2518
  rn("pluno-pa-scribble-wobble-2", "5", "15")
2521
2519
  ), t.appendChild(
@@ -2523,7 +2521,7 @@ function cr() {
2523
2521
  ), e.appendChild(t), e;
2524
2522
  }
2525
2523
  function Go(e, t) {
2526
- const n = T("svg", {
2524
+ const n = A("svg", {
2527
2525
  class: `pluno-pa-widget__scribble-spirals ${e}`,
2528
2526
  preserveAspectRatio: "xMidYMid meet",
2529
2527
  "aria-hidden": "true",
@@ -2538,7 +2536,7 @@ function an(e, t) {
2538
2536
  0,
2539
2537
  t - mn * 2
2540
2538
  ), i = Math.max(
2541
- Ta,
2539
+ La,
2542
2540
  Math.floor(
2543
2541
  (n - hn * 2) / gn
2544
2542
  )
@@ -2551,14 +2549,14 @@ function $o(e, t) {
2551
2549
  const n = t * gn + hn * 2;
2552
2550
  e.dataset.spiralCount = `${t}`, e.setAttribute(
2553
2551
  "viewBox",
2554
- `0 0 ${n} ${La}`
2552
+ `0 0 ${n} ${ka}`
2555
2553
  ), e.replaceChildren();
2556
2554
  for (let i = 0; i < t; i += 1) {
2557
- const o = no[i % no.length], r = T("g", {
2555
+ const o = no[i % no.length], r = A("g", {
2558
2556
  transform: `translate(${hn + i * gn} 0)`
2559
2557
  });
2560
2558
  r.appendChild(
2561
- T("ellipse", {
2559
+ A("ellipse", {
2562
2560
  cx: o.ellipseCx,
2563
2561
  cy: o.ellipseCy,
2564
2562
  rx: o.ellipseRx,
@@ -2569,7 +2567,7 @@ function $o(e, t) {
2569
2567
  opacity: "0.8"
2570
2568
  })
2571
2569
  ), r.appendChild(
2572
- T("path", {
2570
+ A("path", {
2573
2571
  d: o.path,
2574
2572
  fill: "none",
2575
2573
  stroke: "#2c2a1e",
@@ -2580,7 +2578,7 @@ function $o(e, t) {
2580
2578
  }
2581
2579
  }
2582
2580
  function rn(e, t, n) {
2583
- const i = T("filter", {
2581
+ const i = A("filter", {
2584
2582
  id: e,
2585
2583
  x: "-8%",
2586
2584
  y: "-8%",
@@ -2588,7 +2586,7 @@ function rn(e, t, n) {
2588
2586
  height: "116%"
2589
2587
  });
2590
2588
  return i.appendChild(
2591
- T("feTurbulence", {
2589
+ A("feTurbulence", {
2592
2590
  type: "fractalNoise",
2593
2591
  baseFrequency: "0.012 0.028",
2594
2592
  numOctaves: "3",
@@ -2596,7 +2594,7 @@ function rn(e, t, n) {
2596
2594
  result: "stroke-noise"
2597
2595
  })
2598
2596
  ), i.appendChild(
2599
- T("feDisplacementMap", {
2597
+ A("feDisplacementMap", {
2600
2598
  in: "SourceGraphic",
2601
2599
  in2: "stroke-noise",
2602
2600
  scale: "3.5",
@@ -2605,7 +2603,7 @@ function rn(e, t, n) {
2605
2603
  result: "warped"
2606
2604
  })
2607
2605
  ), i.appendChild(
2608
- T("feTurbulence", {
2606
+ A("feTurbulence", {
2609
2607
  type: "fractalNoise",
2610
2608
  baseFrequency: "0.7",
2611
2609
  numOctaves: "1",
@@ -2613,7 +2611,7 @@ function rn(e, t, n) {
2613
2611
  result: "ink-noise"
2614
2612
  })
2615
2613
  ), i.appendChild(
2616
- T("feDisplacementMap", {
2614
+ A("feDisplacementMap", {
2617
2615
  in: "warped",
2618
2616
  in2: "ink-noise",
2619
2617
  scale: "0.9",
@@ -2622,7 +2620,7 @@ function rn(e, t, n) {
2622
2620
  })
2623
2621
  ), i;
2624
2622
  }
2625
- function ur(e) {
2623
+ function cr(e) {
2626
2624
  const t = de(
2627
2625
  "0 0 24 24",
2628
2626
  e,
@@ -2631,9 +2629,9 @@ function ur(e) {
2631
2629
  "currentColor",
2632
2630
  "2.25"
2633
2631
  );
2634
- return t.appendChild(T("path", { d: "m6 9 6 6 6-6" })), t;
2632
+ return t.appendChild(A("path", { d: "m6 9 6 6 6-6" })), t;
2635
2633
  }
2636
- function gr() {
2634
+ function ur() {
2637
2635
  const e = de(
2638
2636
  "0 0 24 24",
2639
2637
  17,
@@ -2643,16 +2641,16 @@ function gr() {
2643
2641
  "2.25"
2644
2642
  );
2645
2643
  return e.appendChild(
2646
- T("path", {
2644
+ A("path", {
2647
2645
  d: "M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"
2648
2646
  })
2649
2647
  ), e.appendChild(
2650
- T("path", {
2648
+ A("path", {
2651
2649
  d: "M18.4 2.6a2.1 2.1 0 0 1 3 3L12 15l-4 1 1-4Z"
2652
2650
  })
2653
2651
  ), e;
2654
2652
  }
2655
- function hr() {
2653
+ function gr() {
2656
2654
  const e = de(
2657
2655
  "0 0 24 24",
2658
2656
  17,
@@ -2661,9 +2659,9 @@ function hr() {
2661
2659
  "currentColor",
2662
2660
  "2.25"
2663
2661
  );
2664
- return e.appendChild(T("path", { d: "M3 12a9 9 0 1 0 3-6.7" })), e.appendChild(T("path", { d: "M3 4v5h5" })), e.appendChild(T("path", { d: "M12 7v5l3 2" })), e;
2662
+ return e.appendChild(A("path", { d: "M3 12a9 9 0 1 0 3-6.7" })), e.appendChild(A("path", { d: "M3 4v5h5" })), e.appendChild(A("path", { d: "M12 7v5l3 2" })), e;
2665
2663
  }
2666
- function mr() {
2664
+ function hr() {
2667
2665
  const e = de(
2668
2666
  "0 0 24 24",
2669
2667
  15,
@@ -2672,7 +2670,7 @@ function mr() {
2672
2670
  "currentColor",
2673
2671
  "2.4"
2674
2672
  );
2675
- return e.appendChild(T("path", { d: "M18 6 6 18" })), e.appendChild(T("path", { d: "m6 6 12 12" })), e;
2673
+ return e.appendChild(A("path", { d: "M18 6 6 18" })), e.appendChild(A("path", { d: "m6 6 12 12" })), e;
2676
2674
  }
2677
2675
  function qo() {
2678
2676
  const e = de(
@@ -2684,10 +2682,10 @@ function qo() {
2684
2682
  "2.75"
2685
2683
  );
2686
2684
  return e.appendChild(
2687
- T("line", { x1: "12", y1: "19", x2: "12", y2: "5" })
2688
- ), e.appendChild(T("polyline", { points: "5 12 12 5 19 12" })), e;
2685
+ A("line", { x1: "12", y1: "19", x2: "12", y2: "5" })
2686
+ ), e.appendChild(A("polyline", { points: "5 12 12 5 19 12" })), e;
2689
2687
  }
2690
- function fr() {
2688
+ function mr() {
2691
2689
  const e = de(
2692
2690
  "0 0 24 24",
2693
2691
  16,
@@ -2700,18 +2698,18 @@ function fr() {
2700
2698
  "class",
2701
2699
  "pluno-pa-widget__paperclip-icon pluno-pa-widget__paperclip-icon--standard"
2702
2700
  ), e.appendChild(
2703
- T("path", {
2701
+ A("path", {
2704
2702
  d: "m21.4 11.6-8.5 8.5a6 6 0 0 1-8.5-8.5l9.2-9.2a4 4 0 0 1 5.7 5.7l-9.2 9.2a2 2 0 0 1-2.8-2.8l8.5-8.5"
2705
2703
  })
2706
2704
  ), e;
2707
2705
  }
2708
- function wr() {
2706
+ function fr() {
2709
2707
  const e = de("0 0 24 24", 19, 19, "none", "currentColor");
2710
2708
  return e.setAttribute(
2711
2709
  "class",
2712
2710
  "pluno-pa-widget__paperclip-icon pluno-pa-widget__paperclip-icon--scribble"
2713
2711
  ), e.appendChild(
2714
- T("path", {
2712
+ A("path", {
2715
2713
  d: "M7.1 15.6 15.2 7.7c1.9-1.8 4.9.8 2.7 3.2l-8.8 8.3c-3.2 3-8-1.1-4.6-4.8l10.1-9.1",
2716
2714
  stroke: "currentColor",
2717
2715
  "stroke-width": "2",
@@ -2720,10 +2718,10 @@ function wr() {
2720
2718
  })
2721
2719
  ), e;
2722
2720
  }
2723
- function br() {
2721
+ function wr() {
2724
2722
  const e = de("0 0 24 24", 18, 18, "currentColor");
2725
2723
  return e.appendChild(
2726
- T("rect", {
2724
+ A("rect", {
2727
2725
  x: "6",
2728
2726
  y: "6",
2729
2727
  width: "12",
@@ -2732,7 +2730,7 @@ function br() {
2732
2730
  })
2733
2731
  ), e;
2734
2732
  }
2735
- function _r() {
2733
+ function br() {
2736
2734
  const e = de(
2737
2735
  "0 0 24 24",
2738
2736
  12,
@@ -2741,9 +2739,9 @@ function _r() {
2741
2739
  "currentColor",
2742
2740
  "2.4"
2743
2741
  );
2744
- return e.appendChild(T("path", { d: "M18 6 6 18" })), e.appendChild(T("path", { d: "m6 6 12 12" })), e;
2742
+ return e.appendChild(A("path", { d: "M18 6 6 18" })), e.appendChild(A("path", { d: "m6 6 12 12" })), e;
2745
2743
  }
2746
- function xr() {
2744
+ function _r() {
2747
2745
  const e = de(
2748
2746
  "0 0 24 24",
2749
2747
  13,
@@ -2753,7 +2751,7 @@ function xr() {
2753
2751
  "2.25"
2754
2752
  );
2755
2753
  return e.appendChild(
2756
- T("rect", {
2754
+ A("rect", {
2757
2755
  width: "14",
2758
2756
  height: "14",
2759
2757
  x: "8",
@@ -2762,7 +2760,7 @@ function xr() {
2762
2760
  ry: "2"
2763
2761
  })
2764
2762
  ), e.appendChild(
2765
- T("path", {
2763
+ A("path", {
2766
2764
  d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"
2767
2765
  })
2768
2766
  ), e;
@@ -2775,10 +2773,10 @@ function de(e, t, n, i, o, r) {
2775
2773
  fill: i,
2776
2774
  "aria-hidden": "true"
2777
2775
  };
2778
- return o && (l.stroke = o, l["stroke-linecap"] = "round", l["stroke-linejoin"] = "round"), r && (l["stroke-width"] = r), T("svg", l);
2776
+ return o && (l.stroke = o, l["stroke-linecap"] = "round", l["stroke-linejoin"] = "round"), r && (l["stroke-width"] = r), A("svg", l);
2779
2777
  }
2780
- function T(e, t = {}) {
2781
- const n = document.createElementNS(zo, e);
2778
+ function A(e, t = {}) {
2779
+ const n = document.createElementNS(Mo, e);
2782
2780
  for (const [i, o] of Object.entries(t))
2783
2781
  n.setAttribute(i, o);
2784
2782
  return n;
@@ -2789,39 +2787,39 @@ function ho(e) {
2789
2787
  n.stopPropagation();
2790
2788
  });
2791
2789
  }
2792
- function yr(e, t, n) {
2790
+ function xr(e, t, n) {
2793
2791
  e.replaceChildren(), e.hidden = t.length === 0;
2794
2792
  for (const [i, o] of t.entries()) {
2795
2793
  const r = document.createElement("div");
2796
- r.className = "pluno-pa-widget__attachment", r.appendChild(vr(o));
2794
+ r.className = "pluno-pa-widget__attachment", r.appendChild(yr(o));
2797
2795
  const l = document.createElement("span");
2798
2796
  l.textContent = o.name, r.appendChild(l);
2799
- const p = document.createElement("button");
2800
- p.type = "button", p.setAttribute("aria-label", `Remove ${o.name}`), p.appendChild(_r()), p.addEventListener("click", () => n(i)), r.appendChild(p), e.appendChild(r);
2797
+ const s = document.createElement("button");
2798
+ s.type = "button", s.setAttribute("aria-label", `Remove ${o.name}`), s.appendChild(br()), s.addEventListener("click", () => n(i)), r.appendChild(s), e.appendChild(r);
2801
2799
  }
2802
2800
  }
2803
- function vr(e) {
2801
+ function yr(e) {
2804
2802
  const t = Cn(e), n = jo(e);
2805
2803
  if (t === "image" && n) {
2806
2804
  const i = document.createElement("img");
2807
2805
  return i.src = n, i.alt = "", i.setAttribute("aria-hidden", "true"), i.addEventListener(
2808
2806
  "error",
2809
- () => i.replaceWith(pe(e))
2807
+ () => i.replaceWith(se(e))
2810
2808
  ), i;
2811
2809
  }
2812
2810
  if (t === "video" && n) {
2813
2811
  const i = document.createElement("video");
2814
2812
  return i.src = n, i.muted = !0, i.preload = "metadata", i.setAttribute("aria-hidden", "true"), i.addEventListener(
2815
2813
  "error",
2816
- () => i.replaceWith(pe(e))
2814
+ () => i.replaceWith(se(e))
2817
2815
  ), i.addEventListener(
2818
2816
  "stalled",
2819
- () => i.replaceWith(pe(e))
2817
+ () => i.replaceWith(se(e))
2820
2818
  ), i;
2821
2819
  }
2822
- return pe(e);
2820
+ return se(e);
2823
2821
  }
2824
- function Sr(e, t) {
2822
+ function vr(e, t) {
2825
2823
  const n = Cn(e), i = jo(e);
2826
2824
  if (n === "image" && i) {
2827
2825
  const o = document.createElement("img");
@@ -2830,7 +2828,7 @@ function Sr(e, t) {
2830
2828
  o.addEventListener(
2831
2829
  "error",
2832
2830
  () => o.replaceWith(
2833
- pe(e, "message")
2831
+ se(e, "message")
2834
2832
  ),
2835
2833
  { once: !0 }
2836
2834
  ), o.src = l ?? i;
@@ -2845,23 +2843,23 @@ function Sr(e, t) {
2845
2843
  return o.className = "pluno-pa-widget__message-attachment-preview pluno-pa-widget__message-attachment-preview--pdf", o.data = i, o.type = "application/pdf", o.setAttribute("aria-label", e.name), o.addEventListener(
2846
2844
  "error",
2847
2845
  () => o.replaceWith(
2848
- pe(e, "message")
2846
+ se(e, "message")
2849
2847
  )
2850
- ), o.appendChild(pe(e, "message")), o;
2848
+ ), o.appendChild(se(e, "message")), o;
2851
2849
  }
2852
2850
  if (n === "video" && i) {
2853
2851
  const o = document.createElement("video");
2854
2852
  return o.className = "pluno-pa-widget__message-attachment-preview", o.src = i, o.muted = !0, o.preload = "metadata", o.addEventListener(
2855
2853
  "error",
2856
- () => o.replaceWith(pe(e, "message"))
2854
+ () => o.replaceWith(se(e, "message"))
2857
2855
  ), o.addEventListener(
2858
2856
  "stalled",
2859
- () => o.replaceWith(pe(e, "message"))
2857
+ () => o.replaceWith(se(e, "message"))
2860
2858
  ), o;
2861
2859
  }
2862
- return pe(e, "message");
2860
+ return se(e, "message");
2863
2861
  }
2864
- function pe(e, t = "composer") {
2862
+ function se(e, t = "composer") {
2865
2863
  if (t === "composer") {
2866
2864
  const r = document.createElement("span");
2867
2865
  return r.className = "pluno-pa-widget__attachment-file", r.textContent = mo(e), r;
@@ -2883,13 +2881,13 @@ function mo(e) {
2883
2881
  const t = Cn(e);
2884
2882
  return t === "image" ? "IMG" : t === "pdf" ? "PDF" : t === "video" ? "VID" : "FILE";
2885
2883
  }
2886
- function Cr(e, t) {
2884
+ function Sr(e, t) {
2887
2885
  return t ? Array.from(t).map((i) => ({
2888
2886
  ...e.createLocalAttachment(i),
2889
- previewUrl: Er(i)
2887
+ previewUrl: Cr(i)
2890
2888
  })) : [];
2891
2889
  }
2892
- function Er(e) {
2890
+ function Cr(e) {
2893
2891
  return typeof URL.createObjectURL == "function" ? URL.createObjectURL(e) : void 0;
2894
2892
  }
2895
2893
  function vt(e) {
@@ -2901,10 +2899,10 @@ function ln(e, t, n = null) {
2901
2899
  return;
2902
2900
  }
2903
2901
  e.hidden = !1, e.replaceChildren(), e.className = "pluno-pa-widget__billing-status", le(t) || En(n) ? e.appendChild(
2904
- kr(t, n)
2905
- ) : Ko(t) && e.appendChild(Lr(t));
2902
+ Er(t, n)
2903
+ ) : Ko(t) && e.appendChild(kr(t));
2906
2904
  }
2907
- function kr(e, t) {
2905
+ function Er(e, t) {
2908
2906
  const n = document.createElement("div");
2909
2907
  n.className = "pluno-pa-widget__billing-action-card";
2910
2908
  const i = e.limitExceeded || t === "limit_exceeded", o = document.createElement("strong");
@@ -2918,13 +2916,13 @@ function kr(e, t) {
2918
2916
  )
2919
2917
  ), n;
2920
2918
  }
2921
- function Lr(e) {
2919
+ function kr(e) {
2922
2920
  const t = document.createElement("div");
2923
2921
  t.className = "pluno-pa-widget__billing-action-card pluno-pa-widget__billing-action-card--low";
2924
2922
  const n = document.createElement("strong");
2925
2923
  n.textContent = "Credits running low", t.appendChild(n);
2926
2924
  const i = document.createElement("span");
2927
- return i.textContent = Ar(e) ?? "Credits are running low for this period.", t.appendChild(i), t.appendChild(
2925
+ return i.textContent = Tr(e) ?? "Credits are running low for this period.", t.appendChild(i), t.appendChild(
2928
2926
  Vo(
2929
2927
  e,
2930
2928
  "Upgrade",
@@ -2936,9 +2934,9 @@ function _n(e, t) {
2936
2934
  return e !== null && (le(e) || Ko(e) || En(t));
2937
2935
  }
2938
2936
  function fo(e, t, n) {
2939
- return _n(t, n) || Tr(t) ? !0 : !_n(e, n);
2937
+ return _n(t, n) || Lr(t) ? !0 : !_n(e, n);
2940
2938
  }
2941
- function Tr(e) {
2939
+ function Lr(e) {
2942
2940
  return e != null && (e.creditsUsed !== null || e.creditLimit !== null || e.creditsRemaining !== null || le(e));
2943
2941
  }
2944
2942
  function le(e) {
@@ -2950,10 +2948,10 @@ function En(e) {
2950
2948
  function Ko(e) {
2951
2949
  return !le(e) && e.creditLimit !== null && e.creditLimit > 0 && e.creditsRemaining !== null && e.creditsRemaining > 0 && e.creditsRemaining / e.creditLimit <= 0.2;
2952
2950
  }
2953
- function Ar(e) {
2954
- return e.creditsRemaining === null ? null : `${Ir(e.creditsRemaining)} credits left`;
2951
+ function Tr(e) {
2952
+ return e.creditsRemaining === null ? null : `${Ar(e.creditsRemaining)} credits left`;
2955
2953
  }
2956
- function Ir(e) {
2954
+ function Ar(e) {
2957
2955
  return new Intl.NumberFormat("en-US", {
2958
2956
  maximumFractionDigits: 0
2959
2957
  }).format(Math.ceil(e));
@@ -2977,29 +2975,29 @@ function wo(e, t) {
2977
2975
  t.trim().length !== 0 && window.open(t, "_blank", "noopener,noreferrer");
2978
2976
  }), n;
2979
2977
  }
2980
- function sn(e, t) {
2978
+ function pn(e, t) {
2981
2979
  return e.messages.filter(
2982
2980
  (i) => !Xo(i)
2983
2981
  ).length === 0 && !e.assistantDraft && !e.lastError && !e.isThinking && !t;
2984
2982
  }
2985
- function Pr(e, t, n, i, o, r, l, p, s, c, g, h, m, y, A, O, u, F, w, R, z, k) {
2986
- const te = Dr(r), W = Or(
2983
+ function Ir(e, t, n, i, o, r, l, s, p, c, g, h, m, v, E, O, u, F, w, R, M, L) {
2984
+ const te = Mr(r), W = Dr(
2987
2985
  te.filter((S) => !Xo(S))
2988
2986
  ), Ye = e.scrollTop, Be = [], ce = /* @__PURE__ */ new Set(), U = (S) => {
2989
2987
  Be.push(S);
2990
2988
  };
2991
- ei(n, r.isThinking), o.hidden = !p, p && l !== null && Wo(o, l);
2992
- const v = W.length > 0 || !!r.assistantDraft || r.isThinking;
2993
- if (i(v), u || W.length === 0 && !r.assistantDraft && !r.lastError && !r.isThinking) {
2989
+ Qo(n, r.isThinking), o.hidden = !s, s && l !== null && Wo(o, l);
2990
+ const y = W.length > 0 || !!r.assistantDraft || r.isThinking;
2991
+ if (i(y), u || W.length === 0 && !r.assistantDraft && !r.lastError && !r.isThinking) {
2994
2992
  const S = document.createElement("div");
2995
2993
  S.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter" + (u ? " pluno-pa-widget__empty-state--morning-report" : "");
2996
- const L = document.createElement("div");
2997
- L.className = "pluno-pa-widget__empty-hero";
2994
+ const T = document.createElement("div");
2995
+ T.className = "pluno-pa-widget__empty-hero";
2998
2996
  const P = ke(
2999
2997
  "pluno-pa-widget__character--empty",
3000
- y()
2998
+ v()
3001
2999
  );
3002
- if (L.appendChild(P), S.appendChild(L), u) {
3000
+ if (T.appendChild(P), S.appendChild(T), u) {
3003
3001
  const b = document.createElement("h2");
3004
3002
  b.className = "pluno-pa-widget__empty pluno-pa-widget__morning-report-title", b.textContent = u.opening, S.appendChild(b);
3005
3003
  } else
@@ -3007,18 +3005,18 @@ function Pr(e, t, n, i, o, r, l, p, s, c, g, h, m, y, A, O, u, F, w, R, z, k) {
3007
3005
  const ye = u?.prompts ?? r.starterPrompts, ne = document.createElement("div");
3008
3006
  if (ne.className = ye.length > 0 ? "pluno-pa-widget__starter-prompts" : "pluno-pa-widget__starter-prompts pluno-pa-widget__starter-prompts--empty", ye.length === 0 && !r.starterPromptsLoading && ne.setAttribute("aria-hidden", "true"), ye.length > 0)
3009
3007
  for (const b of ye) {
3010
- const E = document.createElement("button");
3011
- E.type = "button", E.className = "pluno-pa-widget__starter-prompt", E.textContent = `"${b}"`, E.addEventListener("click", () => {
3012
- A(b);
3013
- }), ne.appendChild(E);
3008
+ const k = document.createElement("button");
3009
+ k.type = "button", k.className = "pluno-pa-widget__starter-prompt", k.textContent = `"${b}"`, k.addEventListener("click", () => {
3010
+ E(b);
3011
+ }), ne.appendChild(k);
3014
3012
  }
3015
3013
  else if (r.starterPromptsLoading) {
3016
3014
  const b = document.createElement("button");
3017
3015
  b.type = "button", b.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder pluno-pa-widget__starter-prompt--loading", b.disabled = !0, b.tabIndex = -1, b.textContent = "Generating example tasks...", ne.appendChild(b);
3018
3016
  } else
3019
- for (let b = 0; b < ma; b += 1) {
3020
- const E = document.createElement("button");
3021
- E.type = "button", E.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder", E.disabled = !0, E.tabIndex = -1, E.textContent = "", ne.appendChild(E);
3017
+ for (let b = 0; b < ha; b += 1) {
3018
+ const k = document.createElement("button");
3019
+ k.type = "button", k.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder", k.disabled = !0, k.tabIndex = -1, k.textContent = "", ne.appendChild(k);
3022
3020
  }
3023
3021
  if (S.appendChild(ne), u) {
3024
3022
  const b = document.createElement("button");
@@ -3028,87 +3026,87 @@ function Pr(e, t, n, i, o, r, l, p, s, c, g, h, m, y, A, O, u, F, w, R, z, k) {
3028
3026
  return;
3029
3027
  }
3030
3028
  let B = null, $ = null, X = [], Le = [];
3031
- const K = W.length - 1, ct = K >= 0 && xn(W[K]), Te = Ur(W);
3029
+ const K = W.length - 1, ct = K >= 0 && xn(W[K]), Te = Or(W);
3032
3030
  let ue = !1;
3033
3031
  const ge = () => {
3034
3032
  if (X.length === 0)
3035
3033
  return ue = !1, !1;
3036
3034
  const S = Te !== null && X.some(
3037
3035
  (P) => Yo(P, Te)
3038
- ), L = jr(
3036
+ ), T = qr(
3039
3037
  X,
3040
3038
  S,
3041
3039
  g,
3042
3040
  m,
3043
- y()
3041
+ v()
3044
3042
  );
3045
- return U(L), B = null, $ = L, X = [], ue = S, !0;
3046
- }, M = () => {
3043
+ return U(T), B = null, $ = T, X = [], ue = S, !0;
3044
+ }, z = () => {
3047
3045
  for (const S of Le)
3048
3046
  U(S), B = null, $ = S;
3049
3047
  Le = [];
3050
3048
  };
3051
3049
  for (let S = 0; S < W.length; S += 1) {
3052
- const L = W[S];
3053
- if (L.role === "tool" && L.integrationAuthRequest && z) {
3054
- const b = Nr(
3055
- L.integrationAuthRequest,
3056
- z.states.get(
3057
- L.integrationAuthRequest.authRequestId
3050
+ const T = W[S];
3051
+ if (T.role === "tool" && T.integrationAuthRequest && M) {
3052
+ const b = Pr(
3053
+ T.integrationAuthRequest,
3054
+ M.states.get(
3055
+ T.integrationAuthRequest.authRequestId
3058
3056
  ) ?? {
3059
- status: z.initialStatus
3057
+ status: M.initialStatus
3060
3058
  },
3061
- z.onConnect
3059
+ M.onConnect
3062
3060
  );
3063
3061
  Le.push(b);
3064
3062
  continue;
3065
3063
  }
3066
- if (L.role === "tool") {
3067
- X.push(L);
3064
+ if (T.role === "tool") {
3065
+ X.push(T);
3068
3066
  continue;
3069
3067
  }
3070
- if (xn(L)) {
3068
+ if (xn(T)) {
3071
3069
  if (S !== K)
3072
3070
  continue;
3073
3071
  if (ge()) {
3074
3072
  if (!ue) {
3075
- const E = dt();
3076
- U(E), B = null, $ = E;
3073
+ const k = dt();
3074
+ U(k), B = null, $ = k;
3077
3075
  }
3078
3076
  } else {
3079
- const E = yo(y());
3080
- U(E), B = null, $ = E;
3077
+ const k = yo(v());
3078
+ U(k), B = null, $ = k;
3081
3079
  }
3082
3080
  continue;
3083
3081
  }
3084
- if (L.role === "system") {
3085
- if (L.dataType === "run_error" || L.dataType === "run_status") {
3082
+ if (T.role === "system") {
3083
+ if (T.dataType === "run_error" || T.dataType === "run_status") {
3086
3084
  ge();
3087
- const b = document.createElement("div"), E = L.dataType === "run_error";
3088
- if (b.className = E ? "pluno-pa-widget__error" : "pluno-pa-widget__status pluno-pa-widget__run-status", b.textContent = yn(
3089
- L.content
3090
- ), E && L.securitySettingsUrl) {
3085
+ const b = document.createElement("div"), k = T.dataType === "run_error";
3086
+ if (b.className = k ? "pluno-pa-widget__error" : "pluno-pa-widget__status pluno-pa-widget__run-status", b.textContent = yn(
3087
+ T.content
3088
+ ), k && T.securitySettingsUrl) {
3091
3089
  const q = document.createElement("a");
3092
- q.className = "pluno-pa-widget__error-retry", q.href = L.securitySettingsUrl, q.target = "_blank", q.rel = "noreferrer", q.textContent = "Security settings", b.appendChild(q);
3090
+ q.className = "pluno-pa-widget__error-retry", q.href = T.securitySettingsUrl, q.target = "_blank", q.rel = "noreferrer", q.textContent = "Security settings", b.appendChild(q);
3093
3091
  }
3094
- U(b), B = E ? b : null, $ = E ? null : b, M();
3092
+ U(b), B = k ? b : null, $ = k ? null : b, z();
3095
3093
  }
3096
3094
  continue;
3097
3095
  }
3098
- L.role === "user" && M();
3099
- const P = ge(), ye = yn(L.content);
3100
- if (L.role === "assistant" && !P) {
3101
- const b = Jo(y());
3096
+ T.role === "user" && z();
3097
+ const P = ge(), ye = yn(T.content);
3098
+ if (T.role === "assistant" && !P) {
3099
+ const b = Jo(v());
3102
3100
  U(b), B = null, $ = b;
3103
3101
  }
3104
- const ne = Rr(
3105
- L,
3102
+ const ne = Nr(
3103
+ T,
3106
3104
  ye,
3107
3105
  h,
3108
3106
  ce,
3109
3107
  R
3110
3108
  );
3111
- U(ne), B = ne, $ = null, L.role === "assistant" && M();
3109
+ U(ne), B = ne, $ = null, T.role === "assistant" && z();
3112
3110
  }
3113
3111
  const Xe = ge(), Ae = W[W.length - 1]?.role === "assistant";
3114
3112
  if (r.isThinking && !Ae && !ct)
@@ -3118,14 +3116,14 @@ function Pr(e, t, n, i, o, r, l, p, s, c, g, h, m, y, A, O, u, F, w, R, z, k) {
3118
3116
  U(S), B = null, $ = S;
3119
3117
  }
3120
3118
  } else {
3121
- const S = yo(y());
3119
+ const S = yo(v());
3122
3120
  U(S), B = null, $ = S;
3123
3121
  }
3124
3122
  if (r.lastError) {
3125
3123
  const S = document.createElement("div");
3126
3124
  S.className = "pluno-pa-widget__error";
3127
- const L = document.createElement("span");
3128
- if (L.textContent = r.lastError, S.appendChild(L), r.lastErrorSecuritySettingsUrl) {
3125
+ const T = document.createElement("span");
3126
+ if (T.textContent = r.lastError, S.appendChild(T), r.lastErrorSecuritySettingsUrl) {
3129
3127
  const P = document.createElement("a");
3130
3128
  P.className = "pluno-pa-widget__error-retry", P.href = r.lastErrorSecuritySettingsUrl, P.target = "_blank", P.rel = "noreferrer", P.textContent = "Security settings", S.appendChild(P);
3131
3129
  }
@@ -3138,30 +3136,30 @@ function Pr(e, t, n, i, o, r, l, p, s, c, g, h, m, y, A, O, u, F, w, R, z, k) {
3138
3136
  }
3139
3137
  U(S), B = S, $ = null;
3140
3138
  }
3141
- const Ie = k ? k.actionCandidate ?? (r.isThinking ? null : Ni(te)) : null;
3142
- if (k && Ie && !k.dismissedCandidateIds.has(Ie.id)) {
3143
- const S = Gr(Ie, {
3144
- isActing: k.actionCandidate?.id === Ie.id,
3145
- error: k.error,
3146
- characterIconOptions: k.characterIconOptions,
3147
- socialPostRewardsUrl: k.socialPostRewardsUrl,
3148
- onReferralCopy: k.onReferralCopy,
3149
- onSocialShare: k.onSocialShare,
3150
- onDismiss: k.onDismiss,
3151
- onDisable: k.onDisable
3139
+ const Ie = L ? L.actionCandidate ?? (r.isThinking ? null : Pi(te)) : null;
3140
+ if (L && Ie && !L.dismissedCandidateIds.has(Ie.id)) {
3141
+ const S = Hr(Ie, {
3142
+ isActing: L.actionCandidate?.id === Ie.id,
3143
+ error: L.error,
3144
+ characterIconOptions: L.characterIconOptions,
3145
+ socialPostRewardsUrl: L.socialPostRewardsUrl,
3146
+ onReferralCopy: L.onReferralCopy,
3147
+ onSocialShare: L.onSocialShare,
3148
+ onDismiss: L.onDismiss,
3149
+ onDisable: L.onDisable
3152
3150
  });
3153
- U(S), k.onSeen(Ie), B = null, $ = S;
3151
+ U(S), L.onSeen(Ie), B = null, $ = S;
3154
3152
  }
3155
- M(), B?.classList.add(
3153
+ z(), B?.classList.add(
3156
3154
  "pluno-pa-widget__message--bottom-reserve"
3157
3155
  ), $?.classList.add(
3158
3156
  "pluno-pa-widget__bottom-reserve-compact"
3159
3157
  ), U(t), zr(
3160
3158
  h,
3161
3159
  ce
3162
- ), bo(e, Be), s ? st(e, c) : e.scrollTop = Ye;
3160
+ ), bo(e, Be), p ? pt(e, c) : e.scrollTop = Ye;
3163
3161
  }
3164
- function Nr(e, t, n) {
3162
+ function Pr(e, t, n) {
3165
3163
  const i = document.createElement("section");
3166
3164
  i.className = "pluno-pa-widget__integration-auth-card", i.setAttribute("aria-label", `Connect ${e.appName}`);
3167
3165
  const o = document.createElement("div");
@@ -3171,33 +3169,33 @@ function Nr(e, t, n) {
3171
3169
  }
3172
3170
  const r = document.createElement("div"), l = document.createElement("strong");
3173
3171
  l.textContent = `Connect ${e.appName}`;
3174
- const p = document.createElement("span");
3175
- if (p.textContent = "Authenticate in this browser so Pluno can continue your task.", r.append(l, p), o.appendChild(r), i.appendChild(o), t.error) {
3172
+ const s = document.createElement("span");
3173
+ if (s.textContent = "Authenticate in this browser so Pluno can continue your task.", r.append(l, s), o.appendChild(r), i.appendChild(o), t.error) {
3176
3174
  const c = document.createElement("div");
3177
3175
  c.className = "pluno-pa-widget__integration-auth-error", c.textContent = t.error, i.appendChild(c);
3178
3176
  }
3179
- const s = document.createElement("button");
3180
- return s.type = "button", s.className = "pluno-pa-widget__integration-auth-button", s.disabled = t.status === "checking" || t.status === "connecting" || t.status === "completed", t.status === "checking" ? s.textContent = "Checking connection..." : t.status === "connecting" ? s.textContent = "Connecting..." : t.status === "completed" ? s.textContent = "Connected" : t.status === "expired" || t.status === "cancelled" ? s.textContent = `Reconnect ${e.appName}` : t.status === "error" ? s.textContent = "Try again" : s.textContent = `Connect ${e.appName}`, s.addEventListener("click", () => n(e)), i.appendChild(s), i;
3177
+ const p = document.createElement("button");
3178
+ return p.type = "button", p.className = "pluno-pa-widget__integration-auth-button", p.disabled = t.status === "checking" || t.status === "connecting" || t.status === "completed", t.status === "checking" ? p.textContent = "Checking connection..." : t.status === "connecting" ? p.textContent = "Connecting..." : t.status === "completed" ? p.textContent = "Connected" : t.status === "expired" || t.status === "cancelled" ? p.textContent = `Reconnect ${e.appName}` : t.status === "error" ? p.textContent = "Try again" : p.textContent = `Connect ${e.appName}`, p.addEventListener("click", () => n(e)), i.appendChild(p), i;
3181
3179
  }
3182
- function Rr(e, t, n, i, o) {
3183
- const r = Mr(e, t), l = r ? n.get(r) : void 0;
3180
+ function Nr(e, t, n, i, o) {
3181
+ const r = Rr(e, t), l = r ? n.get(r) : void 0;
3184
3182
  if (r && l)
3185
3183
  return l.classList.remove(
3186
3184
  "pluno-pa-widget__message--bottom-reserve"
3187
3185
  ), i.add(r), l;
3188
- const p = document.createElement("div");
3189
- if (p.className = `pluno-pa-widget__message pluno-pa-widget__message--${e.role}`, e.role === "assistant" ? (e.phase && (p.dataset.phase = e.phase), Zr(p, t)) : p.textContent = t, e.role === "user" && e.attachments?.length && p.appendChild(
3190
- Wr(
3186
+ const s = document.createElement("div");
3187
+ if (s.className = `pluno-pa-widget__message pluno-pa-widget__message--${e.role}`, e.role === "assistant" ? (e.phase && (s.dataset.phase = e.phase), Zr(s, t)) : s.textContent = t, e.role === "user" && e.attachments?.length && s.appendChild(
3188
+ Fr(
3191
3189
  e.attachments,
3192
3190
  o
3193
3191
  )
3194
3192
  ), e.phase !== "commentary") {
3195
- const s = document.createElement("div");
3196
- s.className = "pluno-pa-widget__message-actions", s.appendChild(Hr(t)), p.appendChild(s);
3193
+ const p = document.createElement("div");
3194
+ p.className = "pluno-pa-widget__message-actions", p.appendChild(Wr(t)), s.appendChild(p);
3197
3195
  }
3198
- return r && (n.set(r, p), i.add(r)), p;
3196
+ return r && (n.set(r, s), i.add(r)), s;
3199
3197
  }
3200
- function Mr(e, t) {
3198
+ function Rr(e, t) {
3201
3199
  return e.role !== "user" || !e.attachments?.length ? null : JSON.stringify({
3202
3200
  id: e.id,
3203
3201
  content: t,
@@ -3233,7 +3231,7 @@ function bo(e, t) {
3233
3231
  n = n.nextSibling, e.removeChild(i);
3234
3232
  }
3235
3233
  }
3236
- function Dr(e) {
3234
+ function Mr(e) {
3237
3235
  if (!e.assistantDraft)
3238
3236
  return [...e.messages];
3239
3237
  const t = {
@@ -3271,26 +3269,26 @@ function Dr(e) {
3271
3269
  ...e.messages.slice(o)
3272
3270
  ];
3273
3271
  }
3274
- function Or(e) {
3272
+ function Dr(e) {
3275
3273
  return e.map(
3276
3274
  (t) => t.role === "assistant" && t.phase === "commentary" ? { ...t, role: "tool" } : t
3277
3275
  );
3278
3276
  }
3279
- function Ur(e) {
3277
+ function Or(e) {
3280
3278
  const t = [...e].reverse().find((n) => n.role === "user");
3281
3279
  for (let n = e.length - 1; n >= 0; n -= 1) {
3282
3280
  const i = e[n];
3283
3281
  if (!(i.role !== "tool" || e.slice(n + 1).some(
3284
- (r) => (Br(r) || Fr(r)) && Yo(i, r)
3282
+ (r) => (Ur(r) || Br(r)) && Yo(i, r)
3285
3283
  )) && (i.loading || i.dataType === "assistant_draft" || t && i.respondsToUserMessageId === t.id))
3286
3284
  return i;
3287
3285
  }
3288
3286
  return null;
3289
3287
  }
3290
- function Br(e) {
3288
+ function Ur(e) {
3291
3289
  return e.role === "assistant" && e.phase !== "commentary";
3292
3290
  }
3293
- function Fr(e) {
3291
+ function Br(e) {
3294
3292
  return e.role === "system" && (e.dataType === "run_error" || e.dataType === "run_status" && e.loading !== !0);
3295
3293
  }
3296
3294
  function Yo(e, t) {
@@ -3302,42 +3300,42 @@ function xn(e) {
3302
3300
  function _o(e, t) {
3303
3301
  return !e.runId || !t.runId ? !0 : e.runId === t.runId;
3304
3302
  }
3305
- function xo(e, t, n, i, o, r, l, p) {
3306
- e.replaceChildren(), ei(t, !1), t.disabled = !0, n(!1);
3307
- const s = document.createElement("div");
3308
- s.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter";
3303
+ function xo(e, t, n, i, o, r, l, s) {
3304
+ e.replaceChildren(), Qo(t, !1), t.disabled = !0, n(!1);
3305
+ const p = document.createElement("div");
3306
+ p.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter";
3309
3307
  const c = ke(
3310
3308
  "pluno-pa-widget__character--empty",
3311
3309
  i()
3312
3310
  );
3313
- s.appendChild(c);
3311
+ p.appendChild(c);
3314
3312
  const g = document.createElement("div");
3315
- if (g.className = "pluno-pa-widget__empty", g.textContent = o, s.appendChild(g), l) {
3313
+ if (g.className = "pluno-pa-widget__empty", g.textContent = o, p.appendChild(g), l) {
3316
3314
  const h = document.createElement("a");
3317
- h.className = "pluno-pa-widget__login", h.href = l, h.target = "_blank", h.rel = "noopener noreferrer", h.textContent = r, s.appendChild(h);
3315
+ h.className = "pluno-pa-widget__login", h.href = l, h.target = "_blank", h.rel = "noopener noreferrer", h.textContent = r, p.appendChild(h);
3318
3316
  } else {
3319
3317
  const h = document.createElement("button");
3320
- h.type = "button", h.className = "pluno-pa-widget__login", h.textContent = r, h.addEventListener("click", () => p?.()), s.appendChild(h);
3318
+ h.type = "button", h.className = "pluno-pa-widget__login", h.textContent = r, h.addEventListener("click", () => s?.()), p.appendChild(h);
3321
3319
  }
3322
- e.appendChild(s);
3320
+ e.appendChild(p);
3323
3321
  }
3324
- function Wr(e, t) {
3322
+ function Fr(e, t) {
3325
3323
  const n = document.createElement("div");
3326
3324
  n.className = "pluno-pa-widget__message-attachments";
3327
3325
  for (const i of e)
3328
3326
  n.appendChild(
3329
- Sr(i, t)
3327
+ vr(i, t)
3330
3328
  );
3331
3329
  return n;
3332
3330
  }
3333
- function Hr(e) {
3331
+ function Wr(e) {
3334
3332
  const t = document.createElement("button");
3335
- return t.type = "button", t.className = "pluno-pa-widget__message-copy", t.setAttribute("aria-label", "Copy message"), t.title = "Copy message", t.appendChild(xr()), t.addEventListener("click", (n) => {
3333
+ return t.type = "button", t.className = "pluno-pa-widget__message-copy", t.setAttribute("aria-label", "Copy message"), t.title = "Copy message", t.appendChild(_r()), t.addEventListener("click", (n) => {
3336
3334
  n.preventDefault(), n.stopPropagation(), navigator.clipboard.writeText(e);
3337
3335
  }), t;
3338
3336
  }
3339
- function Gr(e, t) {
3340
- const n = Ri(e.id), i = document.createElement("article");
3337
+ function Hr(e, t) {
3338
+ const n = Ni(e.id), i = document.createElement("article");
3341
3339
  i.className = "pluno-pa-widget__share-prompt";
3342
3340
  const o = document.createElement("div");
3343
3341
  o.className = "pluno-pa-widget__share-prompt-body", o.appendChild(
@@ -3350,43 +3348,43 @@ function Gr(e, t) {
3350
3348
  r.className = "pluno-pa-widget__share-prompt-copy";
3351
3349
  const l = document.createElement("strong");
3352
3350
  l.textContent = n === "referral" ? "Know someone who'd love this?" : "Share Pluno, earn 2,000 credits", r.appendChild(l);
3353
- const p = document.createElement("span");
3351
+ const s = document.createElement("span");
3354
3352
  if (n === "referral")
3355
- p.textContent = "Give them 2,000 free credits—and earn 2,000 when they try Pluno.";
3353
+ s.textContent = "Give them 2,000 free credits—and earn 2,000 when they try Pluno.";
3356
3354
  else {
3357
- if (p.appendChild(
3355
+ if (s.appendChild(
3358
3356
  document.createTextNode("Post on LinkedIn, X, or Instagram, then ")
3359
3357
  ), t.socialPostRewardsUrl) {
3360
3358
  const m = document.createElement("a");
3361
- m.className = "pluno-pa-widget__share-prompt-reward", m.href = t.socialPostRewardsUrl, m.target = "_blank", m.rel = "noopener noreferrer", m.textContent = "submit your post URL", p.appendChild(m);
3359
+ m.className = "pluno-pa-widget__share-prompt-reward", m.href = t.socialPostRewardsUrl, m.target = "_blank", m.rel = "noopener noreferrer", m.textContent = "submit your post URL", s.appendChild(m);
3362
3360
  } else
3363
- p.appendChild(document.createTextNode("submit your post URL"));
3364
- p.appendChild(document.createTextNode(" for approval."));
3361
+ s.appendChild(document.createTextNode("submit your post URL"));
3362
+ s.appendChild(document.createTextNode(" for approval."));
3365
3363
  }
3366
- if (r.appendChild(p), t.error) {
3364
+ if (r.appendChild(s), t.error) {
3367
3365
  const m = document.createElement("span");
3368
3366
  m.className = "pluno-pa-widget__share-prompt-error", m.textContent = t.error, r.appendChild(m);
3369
3367
  }
3370
3368
  o.appendChild(r);
3371
- const s = document.createElement("div");
3372
- s.className = "pluno-pa-widget__share-prompt-actions";
3369
+ const p = document.createElement("div");
3370
+ p.className = "pluno-pa-widget__share-prompt-actions";
3373
3371
  const c = document.createElement("div");
3374
3372
  if (c.className = "pluno-pa-widget__share-prompt-primary-actions", n === "referral") {
3375
3373
  const m = document.createElement("button");
3376
3374
  m.type = "button", m.className = "pluno-pa-widget__share-prompt-draft", m.disabled = t.isActing, m.addEventListener("click", () => {
3377
3375
  t.onReferralCopy(e);
3378
- }), t.isActing ? (m.appendChild(Qo()), m.appendChild(document.createTextNode("Copying..."))) : m.textContent = "Copy invite link", c.appendChild(m);
3376
+ }), t.isActing ? (m.appendChild(Vr()), m.appendChild(document.createTextNode("Copying..."))) : m.textContent = "Copy invite link", c.appendChild(m);
3379
3377
  } else
3380
- for (const m of $r()) {
3381
- const y = document.createElement("a");
3382
- y.className = "pluno-pa-widget__share-prompt-social", y.href = m.href, y.target = "_blank", y.rel = "noopener noreferrer", y.setAttribute("aria-label", `Open ${m.label}`), y.title = m.label, y.appendChild(qr(m.id)), y.addEventListener("click", () => t.onSocialShare(e)), c.appendChild(y);
3378
+ for (const m of Gr()) {
3379
+ const v = document.createElement("a");
3380
+ v.className = "pluno-pa-widget__share-prompt-social", v.href = m.href, v.target = "_blank", v.rel = "noopener noreferrer", v.setAttribute("aria-label", `Open ${m.label}`), v.title = m.label, v.appendChild($r(m.id)), v.addEventListener("click", () => t.onSocialShare(e)), c.appendChild(v);
3383
3381
  }
3384
3382
  const g = document.createElement("button");
3385
- g.type = "button", g.className = "pluno-pa-widget__share-prompt-dismiss", g.setAttribute("aria-label", "Dismiss share prompt"), g.title = "Dismiss", g.textContent = "Dismiss", g.addEventListener("click", () => t.onDismiss(e)), c.appendChild(g), s.appendChild(c);
3383
+ g.type = "button", g.className = "pluno-pa-widget__share-prompt-dismiss", g.setAttribute("aria-label", "Dismiss share prompt"), g.title = "Dismiss", g.textContent = "Dismiss", g.addEventListener("click", () => t.onDismiss(e)), c.appendChild(g), p.appendChild(c);
3386
3384
  const h = document.createElement("button");
3387
- return h.type = "button", h.className = "pluno-pa-widget__share-prompt-disable", h.textContent = "Don't ask again", h.addEventListener("click", () => t.onDisable(e)), s.appendChild(h), o.appendChild(s), i.appendChild(o), i;
3385
+ return h.type = "button", h.className = "pluno-pa-widget__share-prompt-disable", h.textContent = "Don't ask again", h.addEventListener("click", () => t.onDisable(e)), p.appendChild(h), o.appendChild(p), i.appendChild(o), i;
3388
3386
  }
3389
- function $r() {
3387
+ function Gr() {
3390
3388
  const e = "https://pluno.ai/browser", t = `I just used @pluno_ai to get work done directly inside my tools. Worth trying: ${e}`;
3391
3389
  return [
3392
3390
  {
@@ -3406,7 +3404,7 @@ function $r() {
3406
3404
  }
3407
3405
  ];
3408
3406
  }
3409
- function qr(e) {
3407
+ function $r(e) {
3410
3408
  const t = document.createElementNS("http://www.w3.org/2000/svg", "svg");
3411
3409
  t.setAttribute("class", "pluno-pa-widget__share-prompt-platform-logo"), t.setAttribute("viewBox", "0 0 32 32"), t.setAttribute("aria-hidden", "true");
3412
3410
  const n = (i, o) => {
@@ -3421,7 +3419,7 @@ function Xo(e) {
3421
3419
  function yn(e) {
3422
3420
  return e.replace(/\uE200[^\uE201]*(?:\uE201|$)/g, "");
3423
3421
  }
3424
- function jr(e, t, n, i, o) {
3422
+ function qr(e, t, n, i, o) {
3425
3423
  const r = document.createElement("article");
3426
3424
  r.className = "pluno-pa-widget__tool-group", r.classList.toggle("pluno-pa-widget__tool-group--active", t), r.title = new Date(
3427
3425
  e[e.length - 1].createdAt
@@ -3431,25 +3429,25 @@ function jr(e, t, n, i, o) {
3431
3429
  o
3432
3430
  )
3433
3431
  );
3434
- const l = Kr(e, t);
3432
+ const l = jr(e, t);
3435
3433
  if (t) {
3436
- const y = document.createElement("div");
3437
- return y.className = "pluno-pa-widget__tool-active-content", y.appendChild(dt()), y.appendChild(l), r.appendChild(y), r;
3434
+ const E = document.createElement("div");
3435
+ return E.className = "pluno-pa-widget__tool-active-content", E.appendChild(dt()), E.appendChild(l), r.appendChild(E), r;
3438
3436
  }
3439
- const p = document.createElement("details"), s = Vr(e);
3440
- p.open = n.has(s), r.classList.toggle("pluno-pa-widget__tool-group--open", p.open), p.addEventListener("toggle", () => {
3441
- r.classList.toggle("pluno-pa-widget__tool-group--open", p.open), p.open ? n.add(s) : n.delete(s), i();
3437
+ const s = document.createElement("details"), p = Kr(e);
3438
+ s.open = n.has(p), r.classList.toggle("pluno-pa-widget__tool-group--open", s.open), s.addEventListener("toggle", () => {
3439
+ r.classList.toggle("pluno-pa-widget__tool-group--open", s.open), s.open ? n.add(p) : n.delete(p), i();
3442
3440
  });
3443
3441
  const c = document.createElement("summary");
3444
3442
  c.className = "pluno-pa-widget__tool-summary";
3445
- const g = [...e].reverse().find((y) => y.phase !== "commentary");
3446
- e.some(
3447
- (y) => y.phase !== "commentary" && y.loading
3448
- ) && c.appendChild(Qo());
3449
- const m = document.createElement("span");
3450
- return m.className = "pluno-pa-widget__tool-summary-title", m.textContent = g ? Zo(g.content) : "Activity", c.appendChild(m), p.appendChild(c), p.appendChild(l), r.appendChild(p), r;
3451
- }
3452
- function Kr(e, t) {
3443
+ const g = [...e].reverse().find((E) => E.phase !== "commentary"), h = e.some(
3444
+ (E) => E.phase !== "commentary" && E.loading
3445
+ ), m = document.createElement("span");
3446
+ m.className = "pluno-pa-widget__tool-summary-title";
3447
+ const v = g ? Zo(g.content) : "Activity";
3448
+ return m.textContent = v, h && (m.classList.add("pluno-pa-widget__tool-summary-title--loading"), m.dataset.loadingText = v), c.appendChild(m), s.appendChild(c), s.appendChild(l), r.appendChild(s), r;
3449
+ }
3450
+ function jr(e, t) {
3453
3451
  const n = document.createElement("div");
3454
3452
  n.className = "pluno-pa-widget__tool-lines";
3455
3453
  const i = e[e.length - 1];
@@ -3458,8 +3456,8 @@ function Kr(e, t) {
3458
3456
  r.className = "pluno-pa-widget__tool-line", r.dataset.eventType = o.phase === "commentary" ? "commentary" : "tool";
3459
3457
  const l = document.createElement("span");
3460
3458
  l.className = "pluno-pa-widget__tool-line-text";
3461
- const p = yn(o.content) || (o.phase === "commentary" ? "" : "Run tool"), s = o.phase === "commentary" ? p : Zo(p);
3462
- t && o === i && o.phase !== "commentary" && (l.classList.add("pluno-pa-widget__tool-line-text--loading"), l.dataset.loadingText = s), l.textContent = s, r.appendChild(l), n.appendChild(r);
3459
+ const s = yn(o.content) || (o.phase === "commentary" ? "" : "Run tool"), p = o.phase === "commentary" ? s : Zo(s);
3460
+ t && o === i && o.phase !== "commentary" && (l.classList.add("pluno-pa-widget__tool-line-text--loading"), l.dataset.loadingText = p), l.textContent = p, r.appendChild(l), n.appendChild(r);
3463
3461
  }
3464
3462
  return n;
3465
3463
  }
@@ -3488,17 +3486,17 @@ function dt(e = "Thinking...") {
3488
3486
  const i = document.createElement("span");
3489
3487
  return i.textContent = e, t.appendChild(i), t;
3490
3488
  }
3491
- function Vr(e) {
3489
+ function Kr(e) {
3492
3490
  return `tools:${e[0]?.id ?? ""}`;
3493
3491
  }
3494
- function Qo() {
3492
+ function Vr() {
3495
3493
  const e = document.createElement("span");
3496
3494
  return e.className = "pluno-pa-widget__spinner", e.setAttribute("aria-hidden", "true"), e;
3497
3495
  }
3498
- function ei(e, t) {
3499
- e.setAttribute("aria-label", t ? "Stop" : "Send"), e.classList.toggle("pluno-pa-widget__send--stop", t), e.replaceChildren(t ? br() : qo());
3496
+ function Qo(e, t) {
3497
+ e.setAttribute("aria-label", t ? "Stop" : "Send"), e.classList.toggle("pluno-pa-widget__send--stop", t), e.replaceChildren(t ? wr() : qo());
3500
3498
  }
3501
- function pn(e) {
3499
+ function sn(e) {
3502
3500
  let t = e.trim();
3503
3501
  if (!t.includes("|"))
3504
3502
  return null;
@@ -3517,7 +3515,7 @@ function Yr(e) {
3517
3515
  return t.startsWith(":") && t.endsWith(":") ? "center" : t.endsWith(":") ? "right" : t.startsWith(":") ? "left" : null;
3518
3516
  }
3519
3517
  function Xr(e, t) {
3520
- const n = pn(e[t] ?? ""), i = pn(e[t + 1] ?? "");
3518
+ const n = sn(e[t] ?? ""), i = sn(e[t + 1] ?? "");
3521
3519
  if (!n || !i || n.length !== i.length)
3522
3520
  return null;
3523
3521
  const o = [];
@@ -3529,27 +3527,27 @@ function Xr(e, t) {
3529
3527
  }
3530
3528
  const r = document.createElement("div");
3531
3529
  r.className = "pluno-pa-widget__table-scroll";
3532
- const l = document.createElement("table"), p = document.createElement("thead"), s = document.createElement("tr");
3530
+ const l = document.createElement("table"), s = document.createElement("thead"), p = document.createElement("tr");
3533
3531
  n.forEach((h, m) => {
3534
- const y = document.createElement("th"), A = o[m];
3535
- A && y.classList.add(`pluno-pa-widget__table-cell--${A}`), Ee(y, h), s.appendChild(y);
3536
- }), p.appendChild(s), l.appendChild(p);
3532
+ const v = document.createElement("th"), E = o[m];
3533
+ E && v.classList.add(`pluno-pa-widget__table-cell--${E}`), Ee(v, h), p.appendChild(v);
3534
+ }), s.appendChild(p), l.appendChild(s);
3537
3535
  const c = document.createElement("tbody");
3538
3536
  let g = t + 2;
3539
3537
  for (; g < e.length && e[g].trim(); ) {
3540
- const h = pn(e[g]);
3538
+ const h = sn(e[g]);
3541
3539
  if (!h)
3542
3540
  break;
3543
3541
  const m = document.createElement("tr");
3544
- n.forEach((y, A) => {
3545
- const O = document.createElement("td"), u = o[A];
3546
- u && O.classList.add(`pluno-pa-widget__table-cell--${u}`), Ee(O, h[A] ?? ""), m.appendChild(O);
3542
+ n.forEach((v, E) => {
3543
+ const O = document.createElement("td"), u = o[E];
3544
+ u && O.classList.add(`pluno-pa-widget__table-cell--${u}`), Ee(O, h[E] ?? ""), m.appendChild(O);
3547
3545
  }), c.appendChild(m), g += 1;
3548
3546
  }
3549
3547
  return l.appendChild(c), r.appendChild(l), { element: r, nextIndex: g };
3550
3548
  }
3551
3549
  function Zr(e, t) {
3552
- const n = Ji(t).replace(/\r\n/g, `
3550
+ const n = Zi(t).replace(/\r\n/g, `
3553
3551
  `).split(`
3554
3552
  `);
3555
3553
  let i = 0;
@@ -3564,9 +3562,9 @@ function Zr(e, t) {
3564
3562
  for (i += 1; i < n.length && !/^```\s*$/.test(n[i]); )
3565
3563
  h.push(n[i]), i += 1;
3566
3564
  i += i < n.length ? 1 : 0;
3567
- const m = document.createElement("pre"), y = document.createElement("code");
3568
- y.textContent = h.join(`
3569
- `), m.appendChild(y), e.appendChild(m);
3565
+ const m = document.createElement("pre"), v = document.createElement("code");
3566
+ v.textContent = h.join(`
3567
+ `), m.appendChild(v), e.appendChild(m);
3570
3568
  continue;
3571
3569
  }
3572
3570
  const l = Xr(n, i);
@@ -3574,10 +3572,10 @@ function Zr(e, t) {
3574
3572
  e.appendChild(l.element), i = l.nextIndex;
3575
3573
  continue;
3576
3574
  }
3577
- const p = o.match(/^(#{1,3})\s+(.+)$/);
3578
- if (p) {
3579
- const h = document.createElement(`h${p[1].length + 2}`);
3580
- Ee(h, p[2]), e.appendChild(h), i += 1;
3575
+ const s = o.match(/^(#{1,3})\s+(.+)$/);
3576
+ if (s) {
3577
+ const h = document.createElement(`h${s[1].length + 2}`);
3578
+ Ee(h, s[2]), e.appendChild(h), i += 1;
3581
3579
  continue;
3582
3580
  }
3583
3581
  if (/^\s*[-*+]\s+/.test(o)) {
@@ -3589,10 +3587,10 @@ function Zr(e, t) {
3589
3587
  e.appendChild(h);
3590
3588
  continue;
3591
3589
  }
3592
- const s = o.match(/^\s*(\d+)\.\s+/);
3593
- if (s) {
3590
+ const p = o.match(/^\s*(\d+)\.\s+/);
3591
+ if (p) {
3594
3592
  const h = document.createElement("ol");
3595
- for (h.start = Number(s[1]); i < n.length && /^\s*\d+\.\s+/.test(n[i]); ) {
3593
+ for (h.start = Number(p[1]); i < n.length && /^\s*\d+\.\s+/.test(n[i]); ) {
3596
3594
  const m = document.createElement("li");
3597
3595
  Ee(m, n[i].replace(/^\s*\d+\.\s+/, "")), h.appendChild(m), i += 1;
3598
3596
  }
@@ -3618,19 +3616,19 @@ function Ee(e, t) {
3618
3616
  );
3619
3617
  const l = o[0];
3620
3618
  if (l.startsWith("`")) {
3621
- const p = document.createElement("code");
3622
- p.textContent = l.slice(1, -1), e.appendChild(p);
3619
+ const s = document.createElement("code");
3620
+ s.textContent = l.slice(1, -1), e.appendChild(s);
3623
3621
  } else if (l.startsWith("**")) {
3624
- const p = document.createElement("strong");
3625
- Ee(p, l.slice(2, -2)), e.appendChild(p);
3622
+ const s = document.createElement("strong");
3623
+ Ee(s, l.slice(2, -2)), e.appendChild(s);
3626
3624
  } else if (l.startsWith("*")) {
3627
- const p = document.createElement("em");
3628
- Ee(p, l.slice(1, -1)), e.appendChild(p);
3625
+ const s = document.createElement("em");
3626
+ Ee(s, l.slice(1, -1)), e.appendChild(s);
3629
3627
  } else {
3630
- const p = l.match(/^\[([^\]]+)\]\(([^)\s]+)\)$/);
3631
- if (p && Jr(p[2])) {
3632
- const s = document.createElement("a");
3633
- s.href = p[2], s.target = "_top", s.rel = "noreferrer", s.textContent = p[1], e.appendChild(s);
3628
+ const s = l.match(/^\[([^\]]+)\]\(([^)\s]+)\)$/);
3629
+ if (s && Jr(s[2])) {
3630
+ const p = document.createElement("a");
3631
+ p.href = s[2], p.target = "_top", p.rel = "noreferrer", p.textContent = s[1], e.appendChild(p);
3634
3632
  } else
3635
3633
  e.appendChild(document.createTextNode(l));
3636
3634
  }
@@ -4805,15 +4803,19 @@ function vo(e, t) {
4805
4803
  color: var(--pluno-pa-muted);
4806
4804
  line-height: 1.35;
4807
4805
  }
4808
- .pluno-pa-widget__tool-line-text {
4806
+ .pluno-pa-widget__tool-line-text,
4807
+ .pluno-pa-widget__tool-summary-title--loading {
4809
4808
  position: relative;
4810
4809
  display: inline-block;
4811
- width: fit-content;
4812
4810
  max-width: 100%;
4813
4811
  }
4812
+ .pluno-pa-widget__tool-line-text {
4813
+ width: fit-content;
4814
+ }
4814
4815
  /* Keep the loading sweep inside the glyphs so it reads as changing text,
4815
4816
  without adding a decorative light that competes with the activity. */
4816
- .pluno-pa-widget__tool-line-text--loading::after {
4817
+ .pluno-pa-widget__tool-line-text--loading::after,
4818
+ .pluno-pa-widget__tool-summary-title--loading::after {
4817
4819
  content: attr(data-loading-text);
4818
4820
  position: absolute;
4819
4821
  inset: 0;
@@ -4827,8 +4829,10 @@ function vo(e, t) {
4827
4829
  -webkit-mask-image: linear-gradient(
4828
4830
  90deg,
4829
4831
  transparent 0,
4830
- #000 40px,
4831
- #000 80px,
4832
+ rgba(0, 0, 0, 0.9) 28px,
4833
+ #000 48px,
4834
+ #000 72px,
4835
+ rgba(0, 0, 0, 0.9) 92px,
4832
4836
  transparent 120px
4833
4837
  );
4834
4838
  -webkit-mask-size: 120px 100%;
@@ -4837,8 +4841,10 @@ function vo(e, t) {
4837
4841
  mask-image: linear-gradient(
4838
4842
  90deg,
4839
4843
  transparent 0,
4840
- #000 40px,
4841
- #000 80px,
4844
+ rgba(0, 0, 0, 0.9) 28px,
4845
+ #000 48px,
4846
+ #000 72px,
4847
+ rgba(0, 0, 0, 0.9) 92px,
4842
4848
  transparent 120px
4843
4849
  );
4844
4850
  mask-size: 120px 100%;
@@ -4853,7 +4859,8 @@ function vo(e, t) {
4853
4859
  }
4854
4860
  }
4855
4861
  @media (prefers-reduced-motion: reduce) {
4856
- .pluno-pa-widget__tool-line-text--loading::after {
4862
+ .pluno-pa-widget__tool-line-text--loading::after,
4863
+ .pluno-pa-widget__tool-summary-title--loading::after {
4857
4864
  content: none;
4858
4865
  }
4859
4866
  }
@@ -5277,7 +5284,7 @@ function vo(e, t) {
5277
5284
  width: 100%;
5278
5285
  resize: none;
5279
5286
  min-height: 22px;
5280
- max-height: 160px;
5287
+ max-height: min(40vh, 320px);
5281
5288
  border: 0;
5282
5289
  outline: none;
5283
5290
  background: transparent;
@@ -5291,6 +5298,9 @@ function vo(e, t) {
5291
5298
  scrollbar-color: var(--pluno-pa-divider) transparent;
5292
5299
  scrollbar-width: thin;
5293
5300
  }
5301
+ :host([data-pluno-product-agent-layout="page"]) .pluno-pa-widget__input {
5302
+ max-height: min(50vh, 500px);
5303
+ }
5294
5304
  .pluno-pa-widget__input::placeholder {
5295
5305
  color: var(--pluno-pa-faint);
5296
5306
  }
@@ -5389,8 +5399,18 @@ function vo(e, t) {
5389
5399
  }
5390
5400
  .pluno-pa-widget__empty-state--morning-report {
5391
5401
  --pluno-pa-starter-edge-gap: 18px;
5392
- margin: auto 0;
5393
- padding: 12px 4px;
5402
+ position: relative;
5403
+ isolation: isolate;
5404
+ box-sizing: border-box;
5405
+ width: calc(100% - 12px);
5406
+ max-width: 380px;
5407
+ margin: auto 6px;
5408
+ gap: var(--pluno-pa-starter-edge-gap);
5409
+ padding: 52px 22px 22px;
5410
+ border: 1px solid var(--pluno-pa-divider);
5411
+ border-radius: 4px;
5412
+ background: var(--pluno-pa-surface);
5413
+ box-shadow: 0 18px 36px rgba(24, 24, 27, 0.14);
5394
5414
  }
5395
5415
  .pluno-pa-widget__error-retry {
5396
5416
  display: block;
@@ -5411,6 +5431,19 @@ function vo(e, t) {
5411
5431
  line-height: 1.34;
5412
5432
  text-align: left;
5413
5433
  }
5434
+ .pluno-pa-widget__empty-state--morning-report .pluno-pa-widget__empty-hero {
5435
+ position: absolute;
5436
+ top: -42px;
5437
+ left: 16px;
5438
+ z-index: 2;
5439
+ transform: rotate(-5deg);
5440
+ }
5441
+ .pluno-pa-widget__empty-state--morning-report .pluno-pa-widget__morning-report-title {
5442
+ width: 100%;
5443
+ font-size: 22px;
5444
+ font-weight: 600;
5445
+ line-height: 1.36;
5446
+ }
5414
5447
  .pluno-pa-widget__morning-report-snooze {
5415
5448
  justify-self: end;
5416
5449
  margin-top: calc(var(--pluno-pa-starter-edge-gap) * -0.55);
@@ -5424,7 +5457,7 @@ function vo(e, t) {
5424
5457
  cursor: pointer;
5425
5458
  }
5426
5459
  .pluno-pa-widget__empty-state--morning-report .pluno-pa-widget__morning-report-snooze {
5427
- margin-top: -6px;
5460
+ margin-top: 0;
5428
5461
  }
5429
5462
  .pluno-pa-widget__empty-hero {
5430
5463
  display: inline-flex;
@@ -5488,7 +5521,25 @@ function vo(e, t) {
5488
5521
  width: 100%;
5489
5522
  }
5490
5523
  .pluno-pa-widget__empty-state--morning-report .pluno-pa-widget__starter-prompts {
5491
- gap: 12px;
5524
+ gap: 4px;
5525
+ }
5526
+ .pluno-pa-widget__empty-state--morning-report .pluno-pa-widget__starter-prompt {
5527
+ position: relative;
5528
+ padding: 10px 8px 10px 30px;
5529
+ border-bottom: 1px dashed color-mix(in srgb, var(--pluno-pa-divider) 70%, transparent);
5530
+ border-radius: 4px;
5531
+ transition: color 120ms ease, background 120ms ease, transform 120ms ease;
5532
+ }
5533
+ .pluno-pa-widget__empty-state--morning-report .pluno-pa-widget__starter-prompt::before {
5534
+ content: "→";
5535
+ position: absolute;
5536
+ left: 8px;
5537
+ top: 10px;
5538
+ color: var(--pluno-pa-text);
5539
+ }
5540
+ .pluno-pa-widget__empty-state--morning-report .pluno-pa-widget__starter-prompt:hover {
5541
+ background: color-mix(in srgb, var(--pluno-pa-accent-soft) 68%, transparent);
5542
+ transform: translateX(2px);
5492
5543
  }
5493
5544
  .pluno-pa-widget__starter-prompts--empty {
5494
5545
  pointer-events: none;
@@ -5694,6 +5745,37 @@ function vo(e, t) {
5694
5745
  width: 96px;
5695
5746
  height: 96px;
5696
5747
  }
5748
+ .pluno-pa-widget--scribble .pluno-pa-widget__empty-state--morning-report {
5749
+ border: 2px solid var(--pluno-pa-divider);
5750
+ border-radius: 3px 1px 4px 2px;
5751
+ background: #fffdf5;
5752
+ box-shadow:
5753
+ 6px 8px 0 rgba(44, 42, 30, 0.09),
5754
+ 0 18px 30px rgba(44, 42, 30, 0.14);
5755
+ transform: rotate(-0.3deg);
5756
+ }
5757
+ .pluno-pa-widget--scribble .pluno-pa-widget__empty-state--morning-report::before,
5758
+ .pluno-pa-widget--scribble .pluno-pa-widget__empty-state--morning-report::after {
5759
+ content: "";
5760
+ position: absolute;
5761
+ z-index: 3;
5762
+ width: 72px;
5763
+ height: 20px;
5764
+ border: 1px solid rgba(113, 91, 45, 0.18);
5765
+ background: rgba(224, 199, 139, 0.72);
5766
+ box-shadow: 0 2px 3px rgba(44, 42, 30, 0.08);
5767
+ pointer-events: none;
5768
+ }
5769
+ .pluno-pa-widget--scribble .pluno-pa-widget__empty-state--morning-report::before {
5770
+ top: -7px;
5771
+ right: -17px;
5772
+ transform: rotate(34deg);
5773
+ }
5774
+ .pluno-pa-widget--scribble .pluno-pa-widget__empty-state--morning-report::after {
5775
+ bottom: -8px;
5776
+ left: -18px;
5777
+ transform: rotate(39deg);
5778
+ }
5697
5779
  .pluno-pa-widget--scribble .pluno-pa-widget__character--tool-group {
5698
5780
  width: 60px;
5699
5781
  height: 60px;
@@ -6020,12 +6102,12 @@ function vo(e, t) {
6020
6102
  if (el(e, n))
6021
6103
  return;
6022
6104
  const i = e.ownerDocument.createElement("style");
6023
- i.id = Uo, i.textContent = n, e.appendChild(i), ti(e);
6105
+ i.id = Uo, i.textContent = n, e.appendChild(i), ei(e);
6024
6106
  }
6025
6107
  function Qr(e) {
6026
6108
  return e.getElementById(Uo) !== null || e.host instanceof HTMLElement && e.host.getAttribute(Bo) === "true";
6027
6109
  }
6028
- function ti(e) {
6110
+ function ei(e) {
6029
6111
  e.host instanceof HTMLElement && e.host.setAttribute(Bo, "true");
6030
6112
  }
6031
6113
  function el(e, t) {
@@ -6033,7 +6115,7 @@ function el(e, t) {
6033
6115
  return !1;
6034
6116
  try {
6035
6117
  const n = new CSSStyleSheet();
6036
- return n.replaceSync(t), e.adoptedStyleSheets = [...e.adoptedStyleSheets, n], ti(e), !0;
6118
+ return n.replaceSync(t), e.adoptedStyleSheets = [...e.adoptedStyleSheets, n], ei(e), !0;
6037
6119
  } catch {
6038
6120
  return !1;
6039
6121
  }
@@ -6049,13 +6131,13 @@ async function tl() {
6049
6131
  function kn(e) {
6050
6132
  return `pluno.productAgent.widgetState.${location.origin}.${e.backendUrl ?? ""}.${e.tokenEndpoint ?? ""}.${e.position ?? ""}`;
6051
6133
  }
6052
- function ni(e) {
6134
+ function ti(e) {
6053
6135
  return `${kn(e)}.displayState`;
6054
6136
  }
6055
6137
  function nl(e) {
6056
6138
  try {
6057
6139
  return window.sessionStorage.getItem(
6058
- ni(e)
6140
+ ti(e)
6059
6141
  ) === "minimized" ? "minimized" : "shown";
6060
6142
  } catch {
6061
6143
  return "shown";
@@ -6064,7 +6146,7 @@ function nl(e) {
6064
6146
  function So(e, t) {
6065
6147
  if (e.layout === "floating")
6066
6148
  try {
6067
- const n = ni(e);
6149
+ const n = ti(e);
6068
6150
  if (t === "minimized") {
6069
6151
  window.sessionStorage.setItem(n, t);
6070
6152
  return;
@@ -6082,7 +6164,7 @@ function ol(e) {
6082
6164
  for (; Jt.has(t); )
6083
6165
  t += 1;
6084
6166
  Jt.add(t);
6085
- const n = `${ga}${t}`;
6167
+ const n = `${ua}${t}`;
6086
6168
  let i = crypto.randomUUID();
6087
6169
  try {
6088
6170
  i = window.sessionStorage.getItem(n) ?? i, window.sessionStorage.setItem(n, i);
@@ -6110,8 +6192,8 @@ function il(e) {
6110
6192
  openToolGroupKeys: Array.isArray(n.openToolGroupKeys) ? n.openToolGroupKeys.filter(
6111
6193
  (i) => typeof i == "string"
6112
6194
  ) : [],
6113
- launcherPosition: sl(n.launcherPosition) ? n.launcherPosition : null,
6114
- panelSize: pl(n.panelSize) ? At(n.panelSize) : null,
6195
+ launcherPosition: pl(n.launcherPosition) ? n.launcherPosition : null,
6196
+ panelSize: sl(n.panelSize) ? At(n.panelSize) : null,
6115
6197
  seenShareCandidateIds: Array.isArray(n.seenShareCandidateIds) ? n.seenShareCandidateIds.filter((i) => typeof i == "string").slice(-Io) : [],
6116
6198
  sharePromptsDisabled: n.sharePromptsDisabled === !0
6117
6199
  };
@@ -6165,19 +6247,19 @@ function ll(e, t) {
6165
6247
  return;
6166
6248
  }
6167
6249
  }
6168
- function sl(e) {
6250
+ function pl(e) {
6169
6251
  if (!e || typeof e != "object")
6170
6252
  return !1;
6171
6253
  const t = e;
6172
6254
  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");
6173
6255
  }
6174
- function pl(e) {
6256
+ function sl(e) {
6175
6257
  if (!e || typeof e != "object")
6176
6258
  return !1;
6177
6259
  const t = e;
6178
6260
  return typeof t.width == "number" && Number.isFinite(t.width) && typeof t.height == "number" && Number.isFinite(t.height);
6179
6261
  }
6180
- async function oi(e, t) {
6262
+ async function ni(e, t) {
6181
6263
  const n = await fetch(e, {
6182
6264
  method: "POST",
6183
6265
  credentials: "include",
@@ -6189,7 +6271,7 @@ async function oi(e, t) {
6189
6271
  ...t ? { signal: t } : {}
6190
6272
  });
6191
6273
  if (!n.ok) {
6192
- const o = await n.text(), r = Ei(o);
6274
+ const o = await n.text(), r = Ci(o);
6193
6275
  throw r ? (console.error(r), new Error(r)) : new Error(`Failed to load Pluno token (${n.status})`);
6194
6276
  }
6195
6277
  const i = await n.json();
@@ -6202,10 +6284,10 @@ function dl(e) {
6202
6284
  const i = async () => {
6203
6285
  const o = new AbortController();
6204
6286
  let r = !1;
6205
- const l = new Promise((p, s) => {
6287
+ const l = new Promise((s, p) => {
6206
6288
  const c = window.setTimeout(() => {
6207
- r = !0, o.abort(), s(new Error(Zn));
6208
- }, ca);
6289
+ r = !0, o.abort(), p(new Error(Zn));
6290
+ }, da);
6209
6291
  o.signal.addEventListener(
6210
6292
  "abort",
6211
6293
  () => window.clearTimeout(c),
@@ -6213,13 +6295,13 @@ function dl(e) {
6213
6295
  );
6214
6296
  });
6215
6297
  try {
6216
- const p = await Promise.race([
6217
- oi(e, o.signal),
6298
+ const s = await Promise.race([
6299
+ ni(e, o.signal),
6218
6300
  l
6219
6301
  ]);
6220
- return o.abort(), p;
6221
- } catch (p) {
6222
- throw o.abort(), r ? new Error(Zn) : p instanceof Error && p.message.startsWith("Pluno widget blocked on ") ? p : new Error(ua);
6302
+ return o.abort(), s;
6303
+ } catch (s) {
6304
+ throw o.abort(), r ? new Error(Zn) : s instanceof Error && s.message.startsWith("Pluno widget blocked on ") ? s : new Error(ca);
6223
6305
  }
6224
6306
  };
6225
6307
  return {
@@ -6256,14 +6338,14 @@ function ul(e, t) {
6256
6338
  }
6257
6339
  class xe extends EventTarget {
6258
6340
  constructor(t, n) {
6259
- super(), this.channelId = n, this.url = t, this.addPreviewListener(ra, () => {
6341
+ super(), this.channelId = n, this.url = t, this.addPreviewListener(aa, () => {
6260
6342
  this.readyState = xe.OPEN, this.dispatchEvent(new Event("open"));
6261
- }), this.addPreviewListener(la, (i) => {
6343
+ }), this.addPreviewListener(ra, (i) => {
6262
6344
  const o = i;
6263
6345
  this.dispatchEvent(
6264
6346
  new MessageEvent("message", { data: o.detail?.data ?? "" })
6265
6347
  );
6266
- }), this.addPreviewListener(sa, () => {
6348
+ }), this.addPreviewListener(la, () => {
6267
6349
  this.readyState = xe.CLOSED, this.dispatchEvent(new Event("error")), this.cleanup();
6268
6350
  }), this.addPreviewListener(pa, (i) => {
6269
6351
  const o = i;
@@ -6277,7 +6359,7 @@ class xe extends EventTarget {
6277
6359
  }), window.dispatchEvent(
6278
6360
  new CustomEvent(
6279
6361
  St(
6280
- oa,
6362
+ na,
6281
6363
  this.channelId
6282
6364
  ),
6283
6365
  {
@@ -6307,7 +6389,7 @@ class xe extends EventTarget {
6307
6389
  );
6308
6390
  window.dispatchEvent(
6309
6391
  new CustomEvent(
6310
- St(ia, this.channelId),
6392
+ St(oa, this.channelId),
6311
6393
  {
6312
6394
  detail: {
6313
6395
  socketId: this.socketId,
@@ -6320,7 +6402,7 @@ class xe extends EventTarget {
6320
6402
  close(t, n) {
6321
6403
  this.readyState !== xe.CLOSED && (this.readyState = xe.CLOSING, window.dispatchEvent(
6322
6404
  new CustomEvent(
6323
- St(aa, this.channelId),
6405
+ St(ia, this.channelId),
6324
6406
  {
6325
6407
  detail: { socketId: this.socketId, code: t, reason: n }
6326
6408
  }
@@ -6367,17 +6449,17 @@ function hl(e) {
6367
6449
  }
6368
6450
  function ml(e) {
6369
6451
  for (const t of hl(e))
6370
- Eo.has(t) || t.dataset.plunoAutoMount === "false" || (Eo.add(t), ii(t).catch((n) => {
6452
+ Eo.has(t) || t.dataset.plunoAutoMount === "false" || (Eo.add(t), oi(t).catch((n) => {
6371
6453
  console.error("Failed to mount Pluno widget", n);
6372
6454
  }));
6373
6455
  }
6374
- function ii(e) {
6456
+ function oi(e) {
6375
6457
  const t = window, n = t[be];
6376
6458
  if (n) {
6377
6459
  if (n.host === null)
6378
6460
  return n.mountPromise.catch(() => {
6379
- const s = t[be];
6380
- return s ? s.mountPromise : ii(e);
6461
+ const p = t[be];
6462
+ return p ? p.mountPromise : oi(e);
6381
6463
  });
6382
6464
  if (fl(n.host))
6383
6465
  return n.retryPendingTokenFailureOnce?.(), n.mountPromise;
@@ -6385,42 +6467,42 @@ function ii(e) {
6385
6467
  }
6386
6468
  const i = e.dataset.plunoPreviewChannel, o = e.dataset.plunoTokenEndpoint, r = !e.dataset.plunoToken && !i && o ? dl(o) : null;
6387
6469
  let l;
6388
- const p = Ra({
6470
+ const s = Na({
6389
6471
  token: e.dataset.plunoToken,
6390
6472
  tokenProvider: r?.loadToken,
6391
6473
  tokenEndpoint: o,
6392
6474
  backendUrl: e.dataset.plunoBackendUrl,
6393
- webSocketFactory: i ? Na(i) : void 0,
6475
+ webSocketFactory: i ? Pa(i) : void 0,
6394
6476
  launcherLabel: e.dataset.plunoLauncherLabel,
6395
6477
  accentColor: e.dataset.plunoAccentColor,
6396
6478
  colorScheme: e.dataset.plunoColorScheme === "dark" ? "dark" : "light",
6397
6479
  fontFamily: e.dataset.plunoFontFamily,
6398
6480
  scribbleStyle: e.dataset.plunoScribbleStyle === void 0 ? void 0 : e.dataset.plunoScribbleStyle !== "false",
6399
6481
  position: e.dataset.plunoPosition === "bottom-left" ? "bottom-left" : "bottom-right"
6400
- }).then((s) => {
6482
+ }).then((p) => {
6401
6483
  if (t[be] !== l) {
6402
- s.destroy();
6484
+ p.destroy();
6403
6485
  return;
6404
6486
  }
6405
- const c = s.host;
6487
+ const c = p.host;
6406
6488
  c.setAttribute(Po, "true"), l.host = c, l.destroy = () => {
6407
- t[be] === l && delete t[be], l.host = null, l.destroy = null, s.destroy();
6489
+ t[be] === l && delete t[be], l.host = null, l.destroy = null, p.destroy();
6408
6490
  };
6409
- }).catch((s) => {
6410
- throw t[be] === l && delete t[be], s;
6491
+ }).catch((p) => {
6492
+ throw t[be] === l && delete t[be], p;
6411
6493
  });
6412
6494
  return l = {
6413
- mountPromise: p,
6495
+ mountPromise: s,
6414
6496
  host: null,
6415
6497
  destroy: null,
6416
6498
  retryPendingTokenFailureOnce: r?.retryPendingFailureOnce ?? null
6417
- }, t[be] = l, p;
6499
+ }, t[be] = l, s;
6418
6500
  }
6419
6501
  function fl(e) {
6420
6502
  return e.isConnected && e.getAttribute(Po) === "true" && !!e.shadowRoot?.querySelector(".pluno-pa-widget__launcher") && !!e.shadowRoot?.querySelector(".pluno-pa-widget__panel");
6421
6503
  }
6422
6504
  ml(import.meta.url);
6423
6505
  export {
6424
- Na as createProductAgentPreviewBridgeWebSocketFactory,
6425
- Ra as mountPlunoProductAgentWidget
6506
+ Pa as createProductAgentPreviewBridgeWebSocketFactory,
6507
+ Na as mountPlunoProductAgentWidget
6426
6508
  };