@pluno/product-agent-web 0.1.116 → 0.1.117

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,21 +1,21 @@
1
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;
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", $n = [253, 250, 241], qn = 3.5;
3
3
  function Lo(e) {
4
4
  const t = To(e);
5
- if (qn(st(t), Gn) >= $n)
5
+ if (jn(st(t), $n) >= qn)
6
6
  return t;
7
7
  let i = st(t);
8
8
  const o = st(Lt);
9
9
  for (let r = 0; r < 6; r += 1)
10
- if (i = Ti(i, o, 0.22), qn(i, Gn) >= $n)
10
+ if (i = Ti(i, o, 0.22), jn(i, $n) >= qn)
11
11
  return dn(i);
12
12
  return dn(i);
13
13
  }
14
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, s = i ? 280 - l : 1020 + l;
18
- n += ` L ${s} ${r}`, i = !i, o += 1;
17
+ const l = (o % 3 - 1) * 18, p = i ? 280 - l : 1020 + l;
18
+ n += ` L ${p} ${r}`, i = !i, o += 1;
19
19
  }
20
20
  return n;
21
21
  }
@@ -78,7 +78,7 @@ function cn([e, t, n]) {
78
78
  };
79
79
  return 0.2126 * i(e) + 0.7152 * i(t) + 0.0722 * i(n);
80
80
  }
81
- function qn(e, t) {
81
+ function jn(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
  }
@@ -95,11 +95,11 @@ function pe(e, t, n) {
95
95
  return dn(Ii(i, un(o + n), un(r + t)));
96
96
  }
97
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];
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];
103
103
  }
104
104
  function Ii(e, t, n) {
105
105
  if (t === 0)
@@ -124,10 +124,10 @@ function Pi(e) {
124
124
  const n = e[t];
125
125
  if (n.role !== "tool" || n.toolName !== Ao)
126
126
  continue;
127
- const i = jn(e, t, "assistant");
127
+ const i = Kn(e, t, "assistant");
128
128
  if (!i)
129
129
  return null;
130
- const o = jn(e, i.index, "user");
130
+ const o = Kn(e, i.index, "user");
131
131
  return o ? {
132
132
  id: `share:${n.callId ?? n.id}`,
133
133
  userPrompt: o.content,
@@ -142,7 +142,7 @@ function Ni(e) {
142
142
  t ^= n.charCodeAt(0), t = Math.imul(t, 16777619);
143
143
  return (t >>> 0) % 2 === 0 ? "referral" : "social";
144
144
  }
145
- function jn(e, t, n) {
145
+ function Kn(e, t, n) {
146
146
  for (let i = t - 1; i >= 0; i -= 1) {
147
147
  const o = e[i];
148
148
  if (o.role === n && o.content.trim())
@@ -155,11 +155,11 @@ 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
- }, s = (g) => {
158
+ }, p = (g) => {
159
159
  n || (o !== null && window.clearTimeout(o), o = window.setTimeout(() => {
160
160
  c();
161
161
  }, Gi(g)));
162
- }, p = (g) => {
162
+ }, s = (g) => {
163
163
  if (l(), i === null) {
164
164
  i = g, e(g);
165
165
  return;
@@ -178,9 +178,9 @@ function Fi(e, t = {}) {
178
178
  const g = await Wi(t);
179
179
  if (n)
180
180
  return;
181
- p(g.count), s(g.refreshAfterMs);
181
+ s(g.count), p(g.refreshAfterMs);
182
182
  } catch {
183
- s(Di);
183
+ p(Di);
184
184
  }
185
185
  };
186
186
  return c(), () => {
@@ -196,12 +196,12 @@ async function Wi(e) {
196
196
  });
197
197
  if (!n.ok)
198
198
  throw new Error("Failed to load active users");
199
- const i = await n.json(), o = Kn(i.count), r = Kn(i.refreshAfterMs ?? i.refresh_after_ms);
199
+ const i = await n.json(), o = Vn(i.count), r = Vn(i.refreshAfterMs ?? i.refresh_after_ms);
200
200
  if (o === null || r === null)
201
201
  throw new Error("Invalid active users response");
202
202
  return { count: o, refreshAfterMs: r };
203
203
  }
204
- function Kn(e) {
204
+ function Vn(e) {
205
205
  return typeof e != "number" || !Number.isFinite(e) || e < 0 ? null : Math.round(e);
206
206
  }
207
207
  function Hi(e) {
@@ -268,7 +268,7 @@ function Zi(e) {
268
268
  }
269
269
  const r = o.match(/^[ \t]{0,3}(`{3,}|~{3,})/);
270
270
  if (r) {
271
- t += Vn(n) + o, n = "", i = {
271
+ t += Yn(n) + o, n = "", i = {
272
272
  marker: r[1][0],
273
273
  length: r[1].length
274
274
  };
@@ -276,19 +276,19 @@ function Zi(e) {
276
276
  }
277
277
  n += o;
278
278
  }
279
- return t + Vn(n);
279
+ return t + Yn(n);
280
280
  }
281
- function Vn(e) {
281
+ function Yn(e) {
282
282
  let t = "", n = 0;
283
283
  for (const i of e.matchAll(Xi)) {
284
284
  const o = i.index ?? 0;
285
- t += Yn(
285
+ t += Xn(
286
286
  e.slice(n, o)
287
287
  ), t += i[0], n = o + i[0].length;
288
288
  }
289
- return t + Yn(e.slice(n));
289
+ return t + Xn(e.slice(n));
290
290
  }
291
- function Yn(e) {
291
+ function Xn(e) {
292
292
  return e.replace(
293
293
  /\[([^\]\n]*\S[^\]\n]*)\][ \t]+\(([^)\s]+)\)/g,
294
294
  (t, n, i, o, r) => r[o - 1] === "!" || Ji(r, o) || Qi(r, o, n) ? t : `[${n}](${i})`
@@ -309,7 +309,7 @@ function Qi(e, t, n) {
309
309
  e.slice(i, t)
310
310
  );
311
311
  }
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 = {
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", Zn = "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", Jn = "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, Qn = 'dialog[open], [aria-modal="true"], [role="dialog"]', ma = 400, fa = 5e3, wa = 500, eo = "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, ea = 1e4, ta = 5e3, na = "product-agent:sdk-preview-socket-conne
317
317
  scribbleStyle: !0,
318
318
  position: "bottom-right",
319
319
  movableLauncher: !0
320
- }, _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 = [
320
+ }, _a = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive', to = "pluno-pa-scribble-font", Ro = 190, zo = 41, no = 22, xa = 1, ya = 48, Sn = 420, va = 520, Sa = 0.24, Cn = 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, oo = [
321
321
  {
322
322
  ellipseCx: "17.5",
323
323
  ellipseCy: "24.5",
@@ -355,7 +355,7 @@ const Io = 100, ea = 1e4, ta = 5e3, na = "product-agent:sdk-preview-socket-conne
355
355
  pathStrokeWidth: "2.45"
356
356
  }
357
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
- let oo = 0;
358
+ let io = 0;
359
359
  function Pa(e) {
360
360
  return (t) => new xe(t, e);
361
361
  }
@@ -436,7 +436,7 @@ async function Na(e = {}) {
436
436
  );
437
437
  const i = n.attachShadow({ mode: "open" }), o = document.createElement("div");
438
438
  o.className = `pluno-pa-widget pluno-pa-widget--${t.position}`, o.classList.add(`pluno-pa-widget--layout-${t.layout}`), o.setAttribute("data-pluno-product-agent-ui-root", "widget");
439
- let r = io(
439
+ let r = ao(
440
440
  t.accentColor,
441
441
  t.scribbleStyle
442
442
  );
@@ -447,17 +447,17 @@ async function Na(e = {}) {
447
447
  t.movableLauncher,
448
448
  t.showLauncherMinimizeButton
449
449
  ), i.appendChild(o);
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(
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(
454
454
  o,
455
455
  en(
456
456
  o,
457
- p,
457
+ s,
458
458
  t.position
459
459
  )
460
- )), vo(i, t.accentColor), ao(o, r, {
460
+ )), vo(i, t.accentColor), ro(o, r, {
461
461
  accentColor: t.accentColor,
462
462
  colorScheme: t.colorScheme,
463
463
  fontFamily: t.fontFamily,
@@ -532,7 +532,7 @@ async function Na(e = {}) {
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(y);
535
+ U.hidden = !t.attachmentsEnabled, ce.disabled = !t.attachmentsEnabled, mo(u), mo(y);
536
536
  let b = [], k = null;
537
537
  const q = () => Yi(
538
538
  y,
@@ -547,15 +547,15 @@ async function Na(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 () => ni(t.tokenEndpoint) : void 0);
551
- if (!t.loginRequired && !t.signupRequired && !t.token && !Ln && !t.webSocketFactory)
550
+ }, Tn = t.loginRequired || t.signupRequired || t.token || t.webSocketFactory ? void 0 : t.tokenProvider ?? (t.tokenEndpoint ? async () => ni(t.tokenEndpoint) : void 0);
551
+ if (!t.loginRequired && !t.signupRequired && !t.token && !Tn && !t.webSocketFactory)
552
552
  throw new Error("Pluno widget requires token or tokenEndpoint");
553
553
  const ii = window.fetch.bind(window), Pt = ol(t.clientId);
554
554
  let _;
555
555
  try {
556
556
  const a = {
557
557
  token: t.token,
558
- tokenProvider: Ln,
558
+ tokenProvider: Tn,
559
559
  backendUrl: t.backendUrl,
560
560
  metadata: () => ({
561
561
  ...t.metadata ?? {},
@@ -592,7 +592,7 @@ async function Na(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 = [], zt = null, Je = null;
595
+ }, Re = 0, An = "", 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 = () => {
@@ -629,7 +629,7 @@ async function Na(e = {}) {
629
629
  a.className = "pluno-pa-widget__history-loading pluno-pa-widget__history-loading--inline", a.textContent = "Loading...", K.appendChild(a);
630
630
  }
631
631
  Te.textContent = Je ?? (!he && Se.length === 0 ? "No recent chats for this page yet." : ""), Te.hidden = Te.textContent.length === 0;
632
- }, An = async (a) => {
632
+ }, In = async (a) => {
633
633
  if (!he) {
634
634
  he = !0, Je = null, me();
635
635
  try {
@@ -648,19 +648,19 @@ async function Na(e = {}) {
648
648
  }
649
649
  }
650
650
  }, li = () => {
651
- !zt || he || K.scrollHeight - K.scrollTop - K.clientHeight <= 24 && An(zt);
652
- }, In = () => {
651
+ !zt || he || K.scrollHeight - K.scrollTop - K.clientHeight <= 24 && In(zt);
652
+ }, Pn = () => {
653
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
- }, Pn = new MutationObserver(In);
655
- Pn.observe(v.documentElement, {
654
+ }, Nn = new MutationObserver(Pn);
655
+ Nn.observe(v.documentElement, {
656
656
  childList: !0,
657
657
  subtree: !0
658
- }), In();
658
+ }), Pn();
659
659
  const Qe = (a = !0) => {
660
660
  const d = Tt(o, a);
661
661
  return wn(
662
662
  o,
663
- p ? Ct(p, d) : Fa(
663
+ s ? Ct(s, d) : Fa(
664
664
  o,
665
665
  t.position,
666
666
  d
@@ -679,7 +679,7 @@ async function Na(e = {}) {
679
679
  focusedInput: a,
680
680
  focusedInputAt: a ? Date.now() : null,
681
681
  openToolGroupKeys: [...Nt],
682
- launcherPosition: c ? p : null,
682
+ launcherPosition: c ? s : null,
683
683
  panelSize: g,
684
684
  seenShareCandidateIds: [...Pe].slice(
685
685
  -Io
@@ -697,14 +697,14 @@ async function Na(e = {}) {
697
697
  o,
698
698
  en(
699
699
  o,
700
- p,
700
+ s,
701
701
  t.position
702
702
  )
703
- ), co(o), H(), d && gt("minimized");
703
+ ), uo(o), H(), d && gt("minimized");
704
704
  }, ze = (a, d = {}) => {
705
705
  qa(a, {
706
706
  debugVersion: Ia,
707
- launcherPosition: p,
707
+ launcherPosition: s,
708
708
  rootClasses: o.className,
709
709
  rootStyle: {
710
710
  left: o.style.left,
@@ -721,7 +721,7 @@ async function Na(e = {}) {
721
721
  ...d
722
722
  });
723
723
  }, tt = (a = !0) => {
724
- if (!p)
724
+ if (!s)
725
725
  return Oe(o, null), Qe(a);
726
726
  const d = Qe(a);
727
727
  return Oe(o, d), ze("Applied stored closed launcher position", {
@@ -729,7 +729,7 @@ async function Na(e = {}) {
729
729
  }), d;
730
730
  }, Mt = (a, d) => {
731
731
  if (!a || !d) {
732
- co(o);
732
+ uo(o);
733
733
  return;
734
734
  }
735
735
  $a(o, {
@@ -739,13 +739,13 @@ async function Na(e = {}) {
739
739
  }, Dt = () => {
740
740
  const a = Ve(g).width;
741
741
  return t.layout === "page" && w.getBoundingClientRect().width || a;
742
- }, Nn = () => {
742
+ }, Rn = () => {
743
743
  if (o.classList.contains("pluno-pa-widget--minimized")) {
744
744
  Oe(
745
745
  o,
746
746
  en(
747
747
  o,
748
- p,
748
+ s,
749
749
  t.position
750
750
  )
751
751
  );
@@ -772,14 +772,14 @@ async function Na(e = {}) {
772
772
  "Applied open panel position after viewport resize",
773
773
  { openPanelPosition: f }
774
774
  );
775
- } else p && ze(
775
+ } else s && ze(
776
776
  "Applied visible launcher position after viewport resize",
777
777
  { visibleLauncherPosition: a }
778
778
  );
779
779
  };
780
- let Rn = () => {
780
+ let zn = () => {
781
781
  };
782
- window.addEventListener("resize", Nn), t.movableLauncher && O ? (tt(), Rn = Oa({
782
+ window.addEventListener("resize", Rn), t.movableLauncher && O ? (tt(), zn = Oa({
783
783
  root: o,
784
784
  launcher: E,
785
785
  launcherDragHandle: O,
@@ -790,7 +790,7 @@ async function Na(e = {}) {
790
790
  a,
791
791
  f
792
792
  );
793
- p = so(
793
+ s = co(
794
794
  C,
795
795
  f
796
796
  ), Oe(o, C), ze("Dragging closed launcher", {
@@ -824,7 +824,7 @@ async function Na(e = {}) {
824
824
  a.position,
825
825
  Ve(g)
826
826
  );
827
- h = so(
827
+ h = co(
828
828
  d,
829
829
  Ve(g)
830
830
  );
@@ -839,14 +839,14 @@ async function Na(e = {}) {
839
839
  }) : () => {
840
840
  };
841
841
  let Ot = !1;
842
- const zn = async () => {
842
+ const Mn = async () => {
843
843
  if (!(!t.billingStatusLoader || Ot)) {
844
844
  Ot = !0;
845
845
  try {
846
846
  const a = await t.billingStatusLoader();
847
847
  if (V)
848
848
  return;
849
- fo(
849
+ wo(
850
850
  t.billingStatus,
851
851
  a,
852
852
  _.getState().lastErrorCode
@@ -866,7 +866,7 @@ async function Na(e = {}) {
866
866
  }
867
867
  }
868
868
  }, fe = (a = "", d = !0, f = !0) => {
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(
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, L.hidden = !1, an(
870
870
  R,
871
871
  Dt()
872
872
  ), o.classList.remove("pluno-pa-widget--closing");
@@ -889,7 +889,7 @@ async function Na(e = {}) {
889
889
  }, 220);
890
890
  });
891
891
  }, Ut = () => {
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(() => {
892
+ oe !== null && (window.clearTimeout(oe), oe = null), E.hidden = !1, s && (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
893
  w.hidden = !0, L.hidden = !0, h = null, o.classList.remove("pluno-pa-widget--closing");
894
894
  }, 220);
895
895
  };
@@ -908,12 +908,12 @@ async function Na(e = {}) {
908
908
  fe(a), u.value = "";
909
909
  });
910
910
  let Bt = null, ht = null, Me = null;
911
- const Mn = (a) => a === u || a === y, ci = (a) => {
911
+ const Dn = (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;
915
915
  for (; d; ) {
916
- const f = d.closest(Jn);
916
+ const f = d.closest(Qn);
917
917
  if (f)
918
918
  return f;
919
919
  const C = d.getRootNode();
@@ -921,7 +921,7 @@ async function Na(e = {}) {
921
921
  }
922
922
  return null;
923
923
  }, ui = (a) => {
924
- if (!a.isConnected || !a.matches(Jn))
924
+ if (!a.isConnected || !a.matches(Qn))
925
925
  return !1;
926
926
  if (!(a instanceof HTMLElement))
927
927
  return !0;
@@ -931,21 +931,21 @@ async function Na(e = {}) {
931
931
  return a.checkVisibility();
932
932
  const d = window.getComputedStyle(a);
933
933
  return d.display !== "none" && d.visibility !== "hidden";
934
- }, Dn = (a) => {
934
+ }, On = (a) => {
935
935
  We !== a && (We = a, o.classList.toggle(
936
936
  "pluno-pa-widget--host-modal-conflict",
937
937
  a !== null
938
938
  ), De(), a !== null ? Me = window.setInterval(() => {
939
939
  const d = We;
940
- (!d || !ui(d)) && Dn(null);
940
+ (!d || !ui(d)) && On(null);
941
941
  }, wa) : Me !== null && (window.clearInterval(Me), Me = null, ht = null));
942
942
  }, gi = () => {
943
943
  Me !== null && (window.clearInterval(Me), Me = null);
944
944
  };
945
945
  o.addEventListener("focusin", (a) => {
946
- Mn(a.target) && (Bt = Date.now(), H());
946
+ Dn(a.target) && (Bt = Date.now(), H());
947
947
  }), o.addEventListener("focusout", (a) => {
948
- if (!Mn(a.target) || We !== null)
948
+ if (!Dn(a.target) || We !== null)
949
949
  return;
950
950
  const d = Bt;
951
951
  if (Bt = null, d === null || Date.now() - d > ma)
@@ -955,7 +955,7 @@ async function Na(e = {}) {
955
955
  return;
956
956
  const C = Date.now();
957
957
  if (ht !== null && C - ht <= fa) {
958
- Dn(f);
958
+ On(f);
959
959
  return;
960
960
  }
961
961
  ht = C;
@@ -970,18 +970,18 @@ async function Na(e = {}) {
970
970
  }), ue.addEventListener("click", () => {
971
971
  ri();
972
972
  });
973
- const On = typeof IntersectionObserver > "u" ? null : new IntersectionObserver(
973
+ const Un = typeof IntersectionObserver > "u" ? null : new IntersectionObserver(
974
974
  ([a]) => {
975
975
  a?.isIntersecting && (ie(!0, "bottom"), ae());
976
976
  },
977
977
  { root: z, threshold: 0 }
978
978
  );
979
- On?.observe(Xe);
979
+ Un?.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, 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;
984
+ u.readOnly = !1, y.readOnly = !1, u.placeholder = d ? eo : a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : ot ? "New update" : t.launcherLabel, y.placeholder = d ? eo : a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : _e.launcherLabel, te.hidden = a;
985
985
  }, j = () => {
986
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
  };
@@ -1103,7 +1103,7 @@ async function Na(e = {}) {
1103
1103
  yt
1104
1104
  ), Fe(), j(), D(_.getState()), a && q();
1105
1105
  }), X.addEventListener("click", () => {
1106
- Y = !Y, Je = null, me(), Y && Se.length === 0 && An(null), Y || q();
1106
+ Y = !Y, Je = null, me(), Y && Se.length === 0 && In(null), Y || q();
1107
1107
  }), ct.addEventListener("click", () => {
1108
1108
  Y = !1, me(), q();
1109
1109
  }), K.addEventListener("scroll", li), y.addEventListener("input", () => {
@@ -1144,17 +1144,17 @@ async function Na(e = {}) {
1144
1144
  return;
1145
1145
  }
1146
1146
  a.key !== "Escape" || !Y || (Y = !1, me(), q());
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);
1147
+ }), l.composerValue && (y.value = l.composerValue, lt(y)), t.layout === "page" ? fe(y.value, !1) : p === "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
- let $t = _.getState().appearance !== null, ft = null, at = null, Un = _.getState().isThinking, He = null;
1149
+ let $t = _.getState().appearance !== null, ft = null, at = null, Bn = _.getState().isThinking, He = null;
1150
1150
  const rt = t.taskNotifications;
1151
1151
  let Ge = null, $e = !1;
1152
- const Bn = () => {
1152
+ const Fn = () => {
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, wi = async () => {
1157
- if (!rt || !Ae || $e || V || !_.getState().isThinking || Fn())
1156
+ }, Wn = () => _.getState().assistantDraft.trim().length > 0, wi = async () => {
1157
+ if (!rt || !Ae || $e || V || !_.getState().isThinking || Wn())
1158
1158
  return;
1159
1159
  let a;
1160
1160
  try {
@@ -1162,7 +1162,7 @@ async function Na(e = {}) {
1162
1162
  } catch {
1163
1163
  return;
1164
1164
  }
1165
- a.enabled || a.neverSuggest || !_.getState().isThinking || Fn() || $e || V || (Ae.hidden = !1);
1165
+ a.enabled || a.neverSuggest || !_.getState().isThinking || Wn() || $e || V || (Ae.hidden = !1);
1166
1166
  };
1167
1167
  Ie?.addEventListener("click", () => {
1168
1168
  $e = !0, wt(), rt?.enable().catch(() => {
@@ -1192,7 +1192,7 @@ async function Na(e = {}) {
1192
1192
  qe = !1, _t();
1193
1193
  });
1194
1194
  }), _t();
1195
- let je = null, Wn = () => {
1195
+ let je = null, Hn = () => {
1196
1196
  };
1197
1197
  const bi = !!(t.sdkPreviewChannelId && t.referralLinkLoader), qt = /* @__PURE__ */ new Map(), jt = () => y.value.trim().length > 0 || b.length > 0, _i = () => {
1198
1198
  const a = je !== null && pn(_.getState(), jt());
@@ -1228,7 +1228,7 @@ async function Na(e = {}) {
1228
1228
  !1
1229
1229
  ), Ke.addEventListener("click", () => Kt()), $.insertBefore(Ke, X));
1230
1230
  }, D = (a) => {
1231
- if (me(), En(a.lastErrorCode) ? He = a.lastErrorCode : t.billingStatus?.creditsUsed !== null && !le(t.billingStatus) && (He = null), ln(
1231
+ if (me(), kn(a.lastErrorCode) ? He = a.lastErrorCode : t.billingStatus?.creditsUsed !== null && !le(t.billingStatus) && (He = null), ln(
1232
1232
  Ye,
1233
1233
  t.billingStatus,
1234
1234
  He
@@ -1258,8 +1258,8 @@ async function Na(e = {}) {
1258
1258
  );
1259
1259
  return;
1260
1260
  }
1261
- const d = Ya(a), f = d !== Tn;
1262
- Tn = d;
1261
+ const d = Ya(a), f = d !== An;
1262
+ An = d;
1263
1263
  const C = ve || Ne.enabled;
1264
1264
  ve = !1, Ir(
1265
1265
  z,
@@ -1318,7 +1318,7 @@ async function Na(e = {}) {
1318
1318
  }
1319
1319
  } : void 0
1320
1320
  ), C ? (Re = z.scrollTop, ae()) : f && Xa(a) && ai();
1321
- }, Hn = async (a) => {
1321
+ }, Gn = async (a) => {
1322
1322
  if (!t.integrationAuthStatusLoader)
1323
1323
  return;
1324
1324
  const d = a.messages.map((f) => f.integrationAuthRequest).filter(
@@ -1346,7 +1346,7 @@ async function Na(e = {}) {
1346
1346
  })
1347
1347
  );
1348
1348
  };
1349
- return Wn = Fi(
1349
+ return Hn = Fi(
1350
1350
  (a) => {
1351
1351
  je = a, !V && pn(_.getState(), jt()) && D(_.getState());
1352
1352
  },
@@ -1357,10 +1357,10 @@ async function Na(e = {}) {
1357
1357
  }
1358
1358
  ), _.on("state", (a) => {
1359
1359
  _t();
1360
- const d = Un && !a.isThinking;
1361
- Un = a.isThinking, a.isThinking && !a.assistantDraft.trim() && rt && !$e && Ge === null && Ae?.hidden !== !1 && (Ge = window.setTimeout(() => {
1360
+ const d = Bn && !a.isThinking;
1361
+ Bn = a.isThinking, a.isThinking && !a.assistantDraft.trim() && rt && !$e && Ge === null && Ae?.hidden !== !1 && (Ge = window.setTimeout(() => {
1362
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(
1363
+ }, ea)), (!a.isThinking || a.assistantDraft.trim()) && (Fn(), 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,8 +1374,8 @@ async function Na(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 && zn();
1378
- }), D(_.getState()), Hn(_.getState()), j(), Wt(), {
1377
+ ), Yt({}, "agent.state.appearance-cleared")), D(a), Gn(a), j(), d && Mn();
1378
+ }), D(_.getState()), Gn(_.getState()), j(), Wt(), {
1379
1379
  agent: _,
1380
1380
  startNewChat: Kt,
1381
1381
  host: n,
@@ -1384,7 +1384,7 @@ async function Na(e = {}) {
1384
1384
  },
1385
1385
  updateBillingStatus: (a) => {
1386
1386
  const d = a ?? null;
1387
- fo(
1387
+ wo(
1388
1388
  t.billingStatus,
1389
1389
  d,
1390
1390
  He
@@ -1414,7 +1414,7 @@ async function Na(e = {}) {
1414
1414
  t.morningReport = a ?? null, D(_.getState());
1415
1415
  },
1416
1416
  destroy: () => {
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());
1417
+ V || (H(), V = !0, Nn.disconnect(), Un?.disconnect(), gi(), window.removeEventListener("resize", Rn), zn(), di(), k !== null && window.clearTimeout(k), Fn(), Hn(), _.destroy(), Pt.release(), n.remove());
1418
1418
  }
1419
1419
  };
1420
1420
  async function yi(a) {
@@ -1452,10 +1452,10 @@ async function Na(e = {}) {
1452
1452
  }
1453
1453
  function Yt(a, d) {
1454
1454
  const f = a.accentColor ?? t.accentColor, C = a.colorScheme ?? t.colorScheme, I = a.fontFamily ?? t.fontFamily, Xt = a.scribbleStyle ?? t.scribbleStyle;
1455
- r = io(
1455
+ r = ao(
1456
1456
  f,
1457
1457
  Xt
1458
- ), ao(o, r, {
1458
+ ), ro(o, r, {
1459
1459
  accentColor: f,
1460
1460
  colorScheme: C,
1461
1461
  fontFamily: I,
@@ -1471,7 +1471,7 @@ async function Na(e = {}) {
1471
1471
  });
1472
1472
  }
1473
1473
  }
1474
- function io(e, t) {
1474
+ function ao(e, t) {
1475
1475
  return { accentColor: e, scribbleStyle: t };
1476
1476
  }
1477
1477
  function Ra(e) {
@@ -1497,7 +1497,7 @@ function Ma([e, t, n]) {
1497
1497
  };
1498
1498
  return 0.2126 * i(e) + 0.7152 * i(t) + 0.0722 * i(n);
1499
1499
  }
1500
- function ao(e, t, n) {
1500
+ function ro(e, t, n) {
1501
1501
  e.classList.toggle(
1502
1502
  "pluno-pa-widget--dark",
1503
1503
  n.colorScheme === "dark"
@@ -1522,10 +1522,10 @@ function ao(e, t, n) {
1522
1522
  );
1523
1523
  }
1524
1524
  function Da(e) {
1525
- if (e.getElementById(eo))
1525
+ if (e.getElementById(to))
1526
1526
  return;
1527
1527
  const t = e.createElement("style");
1528
- t.id = eo, t.textContent = `@font-face {
1528
+ t.id = to, t.textContent = `@font-face {
1529
1529
  font-family: "Architects Daughter";
1530
1530
  font-style: normal;
1531
1531
  font-weight: 400;
@@ -1541,17 +1541,17 @@ function Oa({
1541
1541
  setPosition: o,
1542
1542
  persist: r
1543
1543
  }) {
1544
- let l = null, s = null, p = null, c = !1, g = null;
1544
+ let l = null, p = null, s = null, c = !1, g = null;
1545
1545
  const h = () => {
1546
- l = null, s = null, p = null, c = !1, e.classList.remove("pluno-pa-widget--dragging");
1546
+ l = null, p = null, s = 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, s = { x: w.clientX, y: w.clientY }, p = i(), c = !1, t.setPointerCapture?.(w.pointerId));
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
1549
  }, v = (w) => {
1550
- if (l !== w.pointerId || !s || !p)
1550
+ if (l !== w.pointerId || !p || !s)
1551
1551
  return;
1552
1552
  w.preventDefault();
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 }));
1553
+ const R = w.clientX - p.x, M = w.clientY - p.y;
1554
+ !c && Math.hypot(R, M) < fn || (c = !0, e.classList.add("pluno-pa-widget--dragging"), o({ x: s.x + R, y: s.y + M }));
1555
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) => {
@@ -1582,19 +1582,19 @@ function Ua({
1582
1582
  setBounds: i,
1583
1583
  persist: o
1584
1584
  }) {
1585
- let r = null, l = null, s = null, p = null, c = !1;
1585
+ let r = null, l = null, p = null, s = null, c = !1;
1586
1586
  const g = () => {
1587
- r = null, l = null, s = null, p = null, c = !1, e.classList.remove("pluno-pa-widget--resizing");
1587
+ r = null, l = null, p = null, s = 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, s = { x: u.clientX, y: u.clientY }, p = n(), c = !1, F.setPointerCapture?.(u.pointerId));
1590
+ !e.classList.contains("pluno-pa-widget--open") || !lo(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));
1591
1591
  }, m = (u) => {
1592
- if (r !== u.pointerId || !l || !s || !p)
1592
+ if (r !== u.pointerId || !l || !p || !s)
1593
1593
  return;
1594
1594
  u.preventDefault(), u.stopPropagation();
1595
- const F = u.clientX - s.x, w = u.clientY - s.y;
1595
+ const F = u.clientX - p.x, w = u.clientY - p.y;
1596
1596
  !c && Math.hypot(F, w) < fn || (c = !0, e.classList.add("pluno-pa-widget--resizing"), i(
1597
- lo(p, l, F, w)
1597
+ po(s, l, F, w)
1598
1598
  ));
1599
1599
  }, v = (u) => {
1600
1600
  r === u.pointerId && (u.preventDefault(), u.stopPropagation(), c && o(), g());
@@ -1603,7 +1603,7 @@ function Ua({
1603
1603
  }, O = (u) => {
1604
1604
  const w = u.currentTarget.dataset.resizeDirection, R = u.shiftKey ? Oo : Do, M = n();
1605
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()));
1606
+ lo(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(po(M, w, L, te)), o()));
1607
1607
  };
1608
1608
  for (const u of t)
1609
1609
  u.addEventListener("pointerdown", h), u.addEventListener("pointermove", m), u.addEventListener("pointerup", v), u.addEventListener("pointercancel", E), u.addEventListener("keydown", O);
@@ -1612,11 +1612,11 @@ function Ua({
1612
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
- function ro(e) {
1615
+ function lo(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
- function lo(e, t, n, i) {
1619
- const o = ee(), r = po({
1618
+ function po(e, t, n, i) {
1619
+ const o = ee(), r = so({
1620
1620
  leading: e.position.x,
1621
1621
  length: e.size.width,
1622
1622
  delta: n,
@@ -1625,10 +1625,10 @@ function lo(e, t, n, i) {
1625
1625
  minLeading: N,
1626
1626
  maxTrailing: o.width - N,
1627
1627
  minLength: Math.min(
1628
- vn,
1628
+ Sn,
1629
1629
  o.width - N * 2
1630
1630
  )
1631
- }), l = po({
1631
+ }), l = so({
1632
1632
  leading: e.position.y,
1633
1633
  length: e.size.height,
1634
1634
  delta: i,
@@ -1637,7 +1637,7 @@ function lo(e, t, n, i) {
1637
1637
  minLeading: Ue,
1638
1638
  maxTrailing: o.height - N,
1639
1639
  minLength: Math.min(
1640
- Sn,
1640
+ Cn,
1641
1641
  o.height - Ue - N
1642
1642
  )
1643
1643
  });
@@ -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 po({
1649
+ function so({
1650
1650
  leading: e,
1651
1651
  length: t,
1652
1652
  delta: n,
@@ -1654,32 +1654,32 @@ function po({
1654
1654
  resizeTrailing: o,
1655
1655
  minLeading: r,
1656
1656
  maxTrailing: l,
1657
- minLength: s
1657
+ minLength: p
1658
1658
  }) {
1659
- const p = e + t;
1659
+ const s = 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
- p - s
1666
+ s - p
1667
1667
  );
1668
- return { leading: h, length: p - h };
1668
+ return { leading: h, length: s - h };
1669
1669
  }
1670
1670
  const g = Q(
1671
- p + r - c,
1672
- p,
1671
+ s + r - c,
1672
+ s,
1673
1673
  l
1674
1674
  );
1675
1675
  return { leading: r, length: g - r };
1676
1676
  }
1677
1677
  if (o) {
1678
- const c = p + n;
1678
+ const c = s + n;
1679
1679
  if (c <= l) {
1680
1680
  const h = Q(
1681
1681
  c,
1682
- e + s,
1682
+ e + p,
1683
1683
  l
1684
1684
  );
1685
1685
  return { leading: e, length: h - e };
@@ -1696,7 +1696,7 @@ function po({
1696
1696
  function Tt(e, t = !0) {
1697
1697
  const n = ee();
1698
1698
  if (e.classList.contains("pluno-pa-widget--minimized"))
1699
- return { width: to, height: to };
1699
+ return { width: no, height: no };
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),
@@ -1709,7 +1709,7 @@ function Ba() {
1709
1709
  width: Math.min(
1710
1710
  Q(
1711
1711
  e.width * Sa,
1712
- vn,
1712
+ Sn,
1713
1713
  va
1714
1714
  ),
1715
1715
  e.width - N * 2
@@ -1717,7 +1717,7 @@ function Ba() {
1717
1717
  height: Math.min(
1718
1718
  Q(
1719
1719
  e.height * Ea,
1720
- Sn,
1720
+ Cn,
1721
1721
  Ca
1722
1722
  ),
1723
1723
  e.height - Ue - N
@@ -1733,7 +1733,7 @@ function At(e) {
1733
1733
  width: Q(
1734
1734
  e.width,
1735
1735
  Math.min(
1736
- vn,
1736
+ Sn,
1737
1737
  t.width - N * 2
1738
1738
  ),
1739
1739
  Math.max(
@@ -1744,7 +1744,7 @@ function At(e) {
1744
1744
  height: Q(
1745
1745
  e.height,
1746
1746
  Math.min(
1747
- Sn,
1747
+ Cn,
1748
1748
  t.height - Ue - N
1749
1749
  ),
1750
1750
  Math.max(
@@ -1818,7 +1818,7 @@ 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 so(e, t) {
1821
+ function co(e, t) {
1822
1822
  const n = Ha(e, t), i = ee();
1823
1823
  return {
1824
1824
  anchor: n,
@@ -1871,7 +1871,7 @@ function Oe(e, t) {
1871
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
- function co(e) {
1874
+ function uo(e) {
1875
1875
  e.style.removeProperty("--pluno-pa-panel-offset-x"), e.style.removeProperty("--pluno-pa-panel-offset-y");
1876
1876
  }
1877
1877
  function ee() {
@@ -1976,8 +1976,8 @@ function Qa(e, t) {
1976
1976
  ];
1977
1977
  for (const [r, l] of o)
1978
1978
  if (i >= l) {
1979
- const s = Math.max(1, Math.floor(i / l));
1980
- return r === "min" ? `${s} min` : `${s} ${r}${s === 1 ? "" : "s"}`;
1979
+ const p = Math.max(1, Math.floor(i / l));
1980
+ return r === "min" ? `${p} min` : `${p} ${r}${p === 1 ? "" : "s"}`;
1981
1981
  }
1982
1982
  return "now";
1983
1983
  }
@@ -2001,8 +2001,8 @@ function er(e, t, n, i, o) {
2001
2001
  function tr(e, t, n, i) {
2002
2002
  const o = document.createElement("form");
2003
2003
  if (o.className = "pluno-pa-widget__launcher", i && o.classList.add("pluno-pa-widget__launcher--minimizable"), n) {
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);
2004
+ const s = document.createElement("button");
2005
+ 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);
2006
2006
  }
2007
2007
  o.appendChild(
2008
2008
  Go(
@@ -2019,10 +2019,10 @@ function tr(e, t, n, i) {
2019
2019
  r.className = "pluno-pa-widget__launcher-run-indicator", o.appendChild(r);
2020
2020
  const l = document.createElement("input");
2021
2021
  l.className = "pluno-pa-widget__launcher-input", l.type = "text", l.placeholder = e, l.setAttribute("aria-label", e), o.appendChild(l);
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);
2022
+ const p = dt("Working...");
2023
+ if (p.classList.add("pluno-pa-widget__status--launcher"), o.appendChild(p), i) {
2024
+ const s = document.createElement("button");
2025
+ 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);
2026
2026
  }
2027
2027
  return o;
2028
2028
  }
@@ -2041,15 +2041,15 @@ function nr(e) {
2041
2041
  r.className = "pluno-pa-widget__active-users-counter", r.hidden = !0, n.appendChild(r);
2042
2042
  const l = document.createElement("button");
2043
2043
  l.type = "button", l.className = "pluno-pa-widget__timeline-jump", l.textContent = "New messages ↓", l.hidden = !0, n.appendChild(l);
2044
- const s = document.createElement("div");
2045
- return s.className = "pluno-pa-widget__top-actions", s.appendChild(
2044
+ const p = document.createElement("div");
2045
+ return p.className = "pluno-pa-widget__top-actions", p.appendChild(
2046
2046
  It(
2047
2047
  "pluno-pa-widget__history",
2048
2048
  bn(),
2049
2049
  gr(),
2050
2050
  !0
2051
2051
  )
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(
2052
+ ), n.appendChild(p), 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(
2053
2053
  Ce("right", "Resize Pluno from right")
2054
2054
  ), t.appendChild(Ce("top", "Resize Pluno from top")), t.appendChild(
2055
2055
  Ce("bottom", "Resize Pluno from bottom")
@@ -2111,10 +2111,10 @@ function ar() {
2111
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);
2112
2112
  const l = document.createElement("button");
2113
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);
2114
+ const p = document.createElement("textarea");
2115
+ p.className = "pluno-pa-widget__input", p.rows = 1, p.placeholder = "Ask for anything...", o.appendChild(p);
2116
+ const s = document.createElement("button");
2117
+ s.type = "button", s.className = "pluno-pa-widget__send", s.setAttribute("aria-label", "Send"), s.appendChild(qo()), o.appendChild(s), e.appendChild(o);
2118
2118
  const c = document.createElement("div");
2119
2119
  c.className = "pluno-pa-widget__composer-meta";
2120
2120
  const g = document.createElement("a");
@@ -2170,8 +2170,8 @@ function Wo(e, t) {
2170
2170
  );
2171
2171
  }
2172
2172
  function ke(e, t) {
2173
- const n = `pluno-pa-character-${oo}`;
2174
- oo += 1;
2173
+ const n = `pluno-pa-character-${io}`;
2174
+ io += 1;
2175
2175
  const i = t.scribbleStyle ? sr(t.accentColor, n) : pr(t.accentColor, n), o = e.split(/\s+/).filter(Boolean);
2176
2176
  return i.setAttribute(
2177
2177
  "class",
@@ -2199,7 +2199,7 @@ function pr(e, t) {
2199
2199
  gradientUnits: "userSpaceOnUse"
2200
2200
  });
2201
2201
  G(l, "0", n.top), G(l, "0.36", n.middle), G(l, "0.72", n.bottom), G(l, "1", n.bottom);
2202
- const s = x(r, "linearGradient", {
2202
+ const p = x(r, "linearGradient", {
2203
2203
  id: i.boltEdge,
2204
2204
  x1: "470",
2205
2205
  y1: "145",
@@ -2207,14 +2207,14 @@ function pr(e, t) {
2207
2207
  y2: "980",
2208
2208
  gradientUnits: "userSpaceOnUse"
2209
2209
  });
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", {
2210
+ G(p, "0", n.edgeStart), G(p, "0.32", n.edgeMiddle), G(p, "0.78", n.edgeEnd), G(p, "1", n.edgeEnd);
2211
+ const s = x(r, "radialGradient", {
2212
2212
  id: i.boltGlow,
2213
2213
  cx: "50%",
2214
2214
  cy: "22%",
2215
2215
  r: "82%"
2216
2216
  });
2217
- G(p, "0", n.glow, "0.72"), G(p, "0.5", n.middle, "0.44"), G(p, "1", n.bottom, "0");
2217
+ G(s, "0", n.glow, "0.72"), G(s, "0.5", n.middle, "0.44"), G(s, "1", n.bottom, "0");
2218
2218
  const c = x(r, "radialGradient", {
2219
2219
  id: i.eyeWhite,
2220
2220
  cx: "35%",
@@ -2353,7 +2353,7 @@ function pr(e, t) {
2353
2353
  opacity: "0.48"
2354
2354
  });
2355
2355
  const R = x(o, "g", { filter: J(i.eyeShadow) });
2356
- return uo(
2356
+ return go(
2357
2357
  R,
2358
2358
  "rotate(-2 528 463)",
2359
2359
  "528",
@@ -2363,7 +2363,7 @@ function pr(e, t) {
2363
2363
  "557",
2364
2364
  "447",
2365
2365
  i
2366
- ), uo(
2366
+ ), go(
2367
2367
  R,
2368
2368
  "rotate(2 717 462)",
2369
2369
  "717",
@@ -2381,7 +2381,7 @@ function sr(e, t) {
2381
2381
  wobble: `${t}-scribbleBoltWobble`
2382
2382
  }, o = Ho(), r = x(o, "defs"), l = x(r, "clipPath", { id: i.clip });
2383
2383
  x(l, "path", { d: kt });
2384
- const s = x(r, "filter", {
2384
+ const p = x(r, "filter", {
2385
2385
  id: i.wobble,
2386
2386
  x: "-10%",
2387
2387
  y: "-10%",
@@ -2389,20 +2389,20 @@ function sr(e, t) {
2389
2389
  height: "120%",
2390
2390
  "color-interpolation-filters": "sRGB"
2391
2391
  });
2392
- x(s, "feTurbulence", {
2392
+ x(p, "feTurbulence", {
2393
2393
  type: "fractalNoise",
2394
2394
  baseFrequency: "0.011",
2395
2395
  numOctaves: "3",
2396
2396
  seed: "7",
2397
2397
  result: "noise"
2398
- }), x(s, "feDisplacementMap", {
2398
+ }), x(p, "feDisplacementMap", {
2399
2399
  in: "SourceGraphic",
2400
2400
  in2: "noise",
2401
2401
  scale: "16",
2402
2402
  xChannelSelector: "R",
2403
2403
  yChannelSelector: "G"
2404
2404
  });
2405
- const p = x(o, "g", { filter: J(i.wobble) }), c = x(p, "g", {
2405
+ const s = x(o, "g", { filter: J(i.wobble) }), c = x(s, "g", {
2406
2406
  "clip-path": J(i.clip)
2407
2407
  });
2408
2408
  return x(c, "path", {
@@ -2414,14 +2414,14 @@ function sr(e, t) {
2414
2414
  "stroke-linejoin": "round",
2415
2415
  opacity: "0.9",
2416
2416
  transform: "rotate(-14 627 600)"
2417
- }), x(p, "path", {
2417
+ }), x(s, "path", {
2418
2418
  d: kt,
2419
2419
  fill: "none",
2420
2420
  stroke: Lt,
2421
2421
  "stroke-width": "18",
2422
2422
  "stroke-linejoin": "round"
2423
- }), go(
2424
- p,
2423
+ }), ho(
2424
+ s,
2425
2425
  "rotate(-2 528 463)",
2426
2426
  "528",
2427
2427
  "463",
@@ -2429,8 +2429,8 @@ function sr(e, t) {
2429
2429
  "473",
2430
2430
  "557",
2431
2431
  "447"
2432
- ), go(
2433
- p,
2432
+ ), ho(
2433
+ s,
2434
2434
  "rotate(2 717 462)",
2435
2435
  "717",
2436
2436
  "462",
@@ -2446,31 +2446,31 @@ function Ho() {
2446
2446
  viewBox: "0 0 1254 1254"
2447
2447
  });
2448
2448
  }
2449
- function uo(e, t, n, i, o, r, l, s, p) {
2449
+ function go(e, t, n, i, o, r, l, p, s) {
2450
2450
  const c = x(e, "g", { transform: t });
2451
2451
  x(c, "ellipse", {
2452
2452
  cx: n,
2453
2453
  cy: i,
2454
2454
  rx: "73",
2455
2455
  ry: "80",
2456
- fill: J(p.eyeWhite)
2456
+ fill: J(s.eyeWhite)
2457
2457
  }), x(c, "ellipse", {
2458
2458
  cx: o,
2459
2459
  cy: r,
2460
2460
  rx: "49",
2461
2461
  ry: "57",
2462
- fill: J(p.pupil),
2463
- filter: J(p.pupilGloss)
2462
+ fill: J(s.pupil),
2463
+ filter: J(s.pupilGloss)
2464
2464
  }), x(c, "circle", {
2465
2465
  cx: l,
2466
- cy: s,
2466
+ cy: p,
2467
2467
  r: "18",
2468
2468
  fill: "#ffffff"
2469
2469
  });
2470
2470
  }
2471
- function go(e, t, n, i, o, r, l, s) {
2472
- const p = x(e, "g", { transform: t });
2473
- x(p, "ellipse", {
2471
+ function ho(e, t, n, i, o, r, l, p) {
2472
+ const s = x(e, "g", { transform: t });
2473
+ x(s, "ellipse", {
2474
2474
  cx: n,
2475
2475
  cy: i,
2476
2476
  rx: "73",
@@ -2478,15 +2478,15 @@ function go(e, t, n, i, o, r, l, s) {
2478
2478
  fill: "#ffffff",
2479
2479
  stroke: Lt,
2480
2480
  "stroke-width": "13"
2481
- }), x(p, "ellipse", {
2481
+ }), x(s, "ellipse", {
2482
2482
  cx: o,
2483
2483
  cy: r,
2484
2484
  rx: "45",
2485
2485
  ry: "53",
2486
2486
  fill: Lt
2487
- }), x(p, "circle", {
2487
+ }), x(s, "circle", {
2488
2488
  cx: l,
2489
- cy: s,
2489
+ cy: p,
2490
2490
  r: "16",
2491
2491
  fill: "#ffffff"
2492
2492
  });
@@ -2552,7 +2552,7 @@ function $o(e, t) {
2552
2552
  `0 0 ${n} ${ka}`
2553
2553
  ), e.replaceChildren();
2554
2554
  for (let i = 0; i < t; i += 1) {
2555
- const o = no[i % no.length], r = A("g", {
2555
+ const o = oo[i % oo.length], r = A("g", {
2556
2556
  transform: `translate(${hn + i * gn} 0)`
2557
2557
  });
2558
2558
  r.appendChild(
@@ -2781,7 +2781,7 @@ function A(e, t = {}) {
2781
2781
  n.setAttribute(i, o);
2782
2782
  return n;
2783
2783
  }
2784
- function ho(e) {
2784
+ function mo(e) {
2785
2785
  for (const t of ["keydown", "keypress", "keyup"])
2786
2786
  e.addEventListener(t, (n) => {
2787
2787
  n.stopPropagation();
@@ -2794,12 +2794,12 @@ function xr(e, t, n) {
2794
2794
  r.className = "pluno-pa-widget__attachment", r.appendChild(yr(o));
2795
2795
  const l = document.createElement("span");
2796
2796
  l.textContent = o.name, r.appendChild(l);
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);
2797
+ const p = document.createElement("button");
2798
+ p.type = "button", p.setAttribute("aria-label", `Remove ${o.name}`), p.appendChild(br()), p.addEventListener("click", () => n(i)), r.appendChild(p), e.appendChild(r);
2799
2799
  }
2800
2800
  }
2801
2801
  function yr(e) {
2802
- const t = Cn(e), n = jo(e);
2802
+ const t = En(e), n = jo(e);
2803
2803
  if (t === "image" && n) {
2804
2804
  const i = document.createElement("img");
2805
2805
  return i.src = n, i.alt = "", i.setAttribute("aria-hidden", "true"), i.addEventListener(
@@ -2820,7 +2820,7 @@ function yr(e) {
2820
2820
  return se(e);
2821
2821
  }
2822
2822
  function vr(e, t) {
2823
- const n = Cn(e), i = jo(e);
2823
+ const n = En(e), i = jo(e);
2824
2824
  if (n === "image" && i) {
2825
2825
  const o = document.createElement("img");
2826
2826
  o.className = "pluno-pa-widget__message-attachment-preview", o.alt = e.name;
@@ -2862,23 +2862,23 @@ function vr(e, t) {
2862
2862
  function se(e, t = "composer") {
2863
2863
  if (t === "composer") {
2864
2864
  const r = document.createElement("span");
2865
- return r.className = "pluno-pa-widget__attachment-file", r.textContent = mo(e), r;
2865
+ return r.className = "pluno-pa-widget__attachment-file", r.textContent = fo(e), r;
2866
2866
  }
2867
2867
  const n = document.createElement("div");
2868
2868
  n.className = "pluno-pa-widget__message-attachment-file";
2869
2869
  const i = document.createElement("span");
2870
- i.textContent = mo(e);
2870
+ i.textContent = fo(e);
2871
2871
  const o = document.createElement("strong");
2872
2872
  return o.textContent = e.name, n.append(i, o), n;
2873
2873
  }
2874
- function Cn(e) {
2874
+ function En(e) {
2875
2875
  return e.mimeType.startsWith("image/") ? "image" : e.mimeType === "application/pdf" ? "pdf" : e.mimeType.startsWith("video/") ? "video" : "file";
2876
2876
  }
2877
2877
  function jo(e) {
2878
2878
  return "previewUrl" in e && e.previewUrl ? e.previewUrl : e.fileUrl ?? "";
2879
2879
  }
2880
- function mo(e) {
2881
- const t = Cn(e);
2880
+ function fo(e) {
2881
+ const t = En(e);
2882
2882
  return t === "image" ? "IMG" : t === "pdf" ? "PDF" : t === "video" ? "VID" : "FILE";
2883
2883
  }
2884
2884
  function Sr(e, t) {
@@ -2898,23 +2898,30 @@ function ln(e, t, n = null) {
2898
2898
  e && (e.hidden = !0, e.replaceChildren());
2899
2899
  return;
2900
2900
  }
2901
- e.hidden = !1, e.replaceChildren(), e.className = "pluno-pa-widget__billing-status", le(t) || En(n) ? e.appendChild(
2901
+ e.hidden = !1, e.replaceChildren(), e.className = "pluno-pa-widget__billing-status", le(t) || kn(n) ? e.appendChild(
2902
2902
  Er(t, n)
2903
2903
  ) : Ko(t) && e.appendChild(kr(t));
2904
2904
  }
2905
2905
  function Er(e, t) {
2906
2906
  const n = document.createElement("div");
2907
2907
  n.className = "pluno-pa-widget__billing-action-card";
2908
- const i = e.limitExceeded || t === "limit_exceeded", o = document.createElement("strong");
2909
- o.textContent = i ? "Credits used up" : "Billing needs attention", n.appendChild(o);
2910
- const r = document.createElement("span");
2911
- return r.textContent = i ? "Earn bonus credits or upgrade to keep using Pluno on this product." : e.paymentIssue ?? "Open billing to keep using Pluno.", n.appendChild(r), n.appendChild(
2912
- Vo(
2913
- e,
2914
- "Upgrade plan",
2915
- "pluno-pa-widget__billing-action-card-actions"
2916
- )
2917
- ), n;
2908
+ const i = e.limitExceeded || t === "limit_exceeded", o = i && e.onboardingIncomplete === !0, r = document.createElement("strong");
2909
+ r.textContent = o ? "Complete onboarding" : i ? "Credits used up" : "Billing needs attention", n.appendChild(r);
2910
+ const l = document.createElement("span");
2911
+ if (l.textContent = o ? "Complete onboarding to unlock credits and start using Pluno." : i ? "Earn bonus credits or upgrade to keep using Pluno on this product." : e.paymentIssue ?? "Open billing to keep using Pluno.", n.appendChild(l), o) {
2912
+ const p = document.createElement("div");
2913
+ p.className = "pluno-pa-widget__billing-action-card-actions", p.appendChild(
2914
+ xn("Complete onboarding", e.onboardingUrl ?? "")
2915
+ ), n.appendChild(p);
2916
+ } else
2917
+ n.appendChild(
2918
+ Vo(
2919
+ e,
2920
+ "Upgrade plan",
2921
+ "pluno-pa-widget__billing-action-card-actions"
2922
+ )
2923
+ );
2924
+ return n;
2918
2925
  }
2919
2926
  function kr(e) {
2920
2927
  const t = document.createElement("div");
@@ -2931,9 +2938,9 @@ function kr(e) {
2931
2938
  ), t;
2932
2939
  }
2933
2940
  function _n(e, t) {
2934
- return e !== null && (le(e) || Ko(e) || En(t));
2941
+ return e !== null && (le(e) || Ko(e) || kn(t));
2935
2942
  }
2936
- function fo(e, t, n) {
2943
+ function wo(e, t, n) {
2937
2944
  return _n(t, n) || Lr(t) ? !0 : !_n(e, n);
2938
2945
  }
2939
2946
  function Lr(e) {
@@ -2942,7 +2949,7 @@ function Lr(e) {
2942
2949
  function le(e) {
2943
2950
  return e?.limitExceeded === !0 || !!e?.paymentIssue;
2944
2951
  }
2945
- function En(e) {
2952
+ function kn(e) {
2946
2953
  return e === "limit_exceeded" || e === "subscription_required" || e === "subscription_inactive" || e === "payment_issue" || e === "subscription_invalid" || e === "payment_required";
2947
2954
  }
2948
2955
  function Ko(e) {
@@ -2959,12 +2966,12 @@ function Ar(e) {
2959
2966
  function Vo(e, t, n) {
2960
2967
  const i = document.createElement("div");
2961
2968
  return i.className = n, i.appendChild(
2962
- wo(t, e.pricingUrl)
2969
+ xn(t, e.pricingUrl)
2963
2970
  ), i.appendChild(
2964
- wo("Earn credits", e.earnCreditsUrl)
2971
+ xn("Earn credits", e.earnCreditsUrl)
2965
2972
  ), i;
2966
2973
  }
2967
- function wo(e, t) {
2974
+ function xn(e, t) {
2968
2975
  const n = document.createElement("button");
2969
2976
  if (n.type = "button", e === "Earn credits") {
2970
2977
  const i = document.createElement("span");
@@ -2980,13 +2987,13 @@ function pn(e, t) {
2980
2987
  (i) => !Xo(i)
2981
2988
  ).length === 0 && !e.assistantDraft && !e.lastError && !e.isThinking && !t;
2982
2989
  }
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) {
2990
+ function Ir(e, t, n, i, o, r, l, p, s, c, g, h, m, v, E, O, u, F, w, R, M, L) {
2984
2991
  const te = Mr(r), W = Dr(
2985
2992
  te.filter((S) => !Xo(S))
2986
2993
  ), Ye = e.scrollTop, Be = [], ce = /* @__PURE__ */ new Set(), U = (S) => {
2987
2994
  Be.push(S);
2988
2995
  };
2989
- Qo(n, r.isThinking), o.hidden = !s, s && l !== null && Wo(o, l);
2996
+ Qo(n, r.isThinking), o.hidden = !p, p && l !== null && Wo(o, l);
2990
2997
  const y = W.length > 0 || !!r.assistantDraft || r.isThinking;
2991
2998
  if (i(y), u || W.length === 0 && !r.assistantDraft && !r.lastError && !r.isThinking) {
2992
2999
  const S = document.createElement("div");
@@ -3026,7 +3033,7 @@ function Ir(e, t, n, i, o, r, l, s, p, c, g, h, m, v, E, O, u, F, w, R, M, L) {
3026
3033
  return;
3027
3034
  }
3028
3035
  let B = null, $ = null, X = [], Le = [];
3029
- const K = W.length - 1, ct = K >= 0 && xn(W[K]), Te = Or(W);
3036
+ const K = W.length - 1, ct = K >= 0 && yn(W[K]), Te = Or(W);
3030
3037
  let ue = !1;
3031
3038
  const ge = () => {
3032
3039
  if (X.length === 0)
@@ -3065,7 +3072,7 @@ function Ir(e, t, n, i, o, r, l, s, p, c, g, h, m, v, E, O, u, F, w, R, M, L) {
3065
3072
  X.push(T);
3066
3073
  continue;
3067
3074
  }
3068
- if (xn(T)) {
3075
+ if (yn(T)) {
3069
3076
  if (S !== K)
3070
3077
  continue;
3071
3078
  if (ge()) {
@@ -3083,7 +3090,7 @@ function Ir(e, t, n, i, o, r, l, s, p, c, g, h, m, v, E, O, u, F, w, R, M, L) {
3083
3090
  if (T.dataType === "run_error" || T.dataType === "run_status") {
3084
3091
  ge();
3085
3092
  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(
3093
+ if (b.className = k ? "pluno-pa-widget__error" : "pluno-pa-widget__status pluno-pa-widget__run-status", b.textContent = vn(
3087
3094
  T.content
3088
3095
  ), k && T.securitySettingsUrl) {
3089
3096
  const q = document.createElement("a");
@@ -3094,7 +3101,7 @@ function Ir(e, t, n, i, o, r, l, s, p, c, g, h, m, v, E, O, u, F, w, R, M, L) {
3094
3101
  continue;
3095
3102
  }
3096
3103
  T.role === "user" && z();
3097
- const P = ge(), ye = yn(T.content);
3104
+ const P = ge(), ye = vn(T.content);
3098
3105
  if (T.role === "assistant" && !P) {
3099
3106
  const b = Jo(v());
3100
3107
  U(b), B = null, $ = b;
@@ -3157,7 +3164,7 @@ function Ir(e, t, n, i, o, r, l, s, p, c, g, h, m, v, E, O, u, F, w, R, M, L) {
3157
3164
  ), U(t), zr(
3158
3165
  h,
3159
3166
  ce
3160
- ), bo(e, Be), p ? pt(e, c) : e.scrollTop = Ye;
3167
+ ), bo(e, Be), s ? pt(e, c) : e.scrollTop = Ye;
3161
3168
  }
3162
3169
  function Pr(e, t, n) {
3163
3170
  const i = document.createElement("section");
@@ -3169,13 +3176,13 @@ function Pr(e, t, n) {
3169
3176
  }
3170
3177
  const r = document.createElement("div"), l = document.createElement("strong");
3171
3178
  l.textContent = `Connect ${e.appName}`;
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) {
3179
+ const p = document.createElement("span");
3180
+ 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) {
3174
3181
  const c = document.createElement("div");
3175
3182
  c.className = "pluno-pa-widget__integration-auth-error", c.textContent = t.error, i.appendChild(c);
3176
3183
  }
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;
3184
+ const s = document.createElement("button");
3185
+ 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;
3179
3186
  }
3180
3187
  function Nr(e, t, n, i, o) {
3181
3188
  const r = Rr(e, t), l = r ? n.get(r) : void 0;
@@ -3183,17 +3190,17 @@ function Nr(e, t, n, i, o) {
3183
3190
  return l.classList.remove(
3184
3191
  "pluno-pa-widget__message--bottom-reserve"
3185
3192
  ), i.add(r), l;
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(
3193
+ const p = document.createElement("div");
3194
+ 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(
3188
3195
  Fr(
3189
3196
  e.attachments,
3190
3197
  o
3191
3198
  )
3192
3199
  ), e.phase !== "commentary") {
3193
- const p = document.createElement("div");
3194
- p.className = "pluno-pa-widget__message-actions", p.appendChild(Wr(t)), s.appendChild(p);
3200
+ const s = document.createElement("div");
3201
+ s.className = "pluno-pa-widget__message-actions", s.appendChild(Wr(t)), p.appendChild(s);
3195
3202
  }
3196
- return r && (n.set(r, s), i.add(r)), s;
3203
+ return r && (n.set(r, p), i.add(r)), p;
3197
3204
  }
3198
3205
  function Rr(e, t) {
3199
3206
  return e.role !== "user" || !e.attachments?.length ? null : JSON.stringify({
@@ -3252,7 +3259,7 @@ function Mr(e) {
3252
3259
  if (n === -1)
3253
3260
  return [...e.messages, t];
3254
3261
  const i = e.messages.findIndex(
3255
- (r, l) => l > n && r.role !== "user" && r.respondsToUserMessageId === t.respondsToUserMessageId && _o(r, t) && xn(r)
3262
+ (r, l) => l > n && r.role !== "user" && r.respondsToUserMessageId === t.respondsToUserMessageId && _o(r, t) && yn(r)
3256
3263
  );
3257
3264
  if (i !== -1)
3258
3265
  return [
@@ -3294,30 +3301,30 @@ function Br(e) {
3294
3301
  function Yo(e, t) {
3295
3302
  return e.respondsToUserMessageId && t.respondsToUserMessageId ? e.respondsToUserMessageId === t.respondsToUserMessageId : e.runId && t.runId ? e.runId === t.runId : e.id === t.id;
3296
3303
  }
3297
- function xn(e) {
3304
+ function yn(e) {
3298
3305
  return e.role === "system" && e.dataType === "run_status" && e.loading === !0;
3299
3306
  }
3300
3307
  function _o(e, t) {
3301
3308
  return !e.runId || !t.runId ? !0 : e.runId === t.runId;
3302
3309
  }
3303
- function xo(e, t, n, i, o, r, l, s) {
3310
+ function xo(e, t, n, i, o, r, l, p) {
3304
3311
  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";
3312
+ const s = document.createElement("div");
3313
+ s.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter";
3307
3314
  const c = ke(
3308
3315
  "pluno-pa-widget__character--empty",
3309
3316
  i()
3310
3317
  );
3311
- p.appendChild(c);
3318
+ s.appendChild(c);
3312
3319
  const g = document.createElement("div");
3313
- if (g.className = "pluno-pa-widget__empty", g.textContent = o, p.appendChild(g), l) {
3320
+ if (g.className = "pluno-pa-widget__empty", g.textContent = o, s.appendChild(g), l) {
3314
3321
  const h = document.createElement("a");
3315
- h.className = "pluno-pa-widget__login", h.href = l, h.target = "_blank", h.rel = "noopener noreferrer", h.textContent = r, p.appendChild(h);
3322
+ h.className = "pluno-pa-widget__login", h.href = l, h.target = "_blank", h.rel = "noopener noreferrer", h.textContent = r, s.appendChild(h);
3316
3323
  } else {
3317
3324
  const h = document.createElement("button");
3318
- h.type = "button", h.className = "pluno-pa-widget__login", h.textContent = r, h.addEventListener("click", () => s?.()), p.appendChild(h);
3325
+ h.type = "button", h.className = "pluno-pa-widget__login", h.textContent = r, h.addEventListener("click", () => p?.()), s.appendChild(h);
3319
3326
  }
3320
- e.appendChild(p);
3327
+ e.appendChild(s);
3321
3328
  }
3322
3329
  function Fr(e, t) {
3323
3330
  const n = document.createElement("div");
@@ -3348,26 +3355,26 @@ function Hr(e, t) {
3348
3355
  r.className = "pluno-pa-widget__share-prompt-copy";
3349
3356
  const l = document.createElement("strong");
3350
3357
  l.textContent = n === "referral" ? "Know someone who'd love this?" : "Share Pluno, earn 2,000 credits", r.appendChild(l);
3351
- const s = document.createElement("span");
3358
+ const p = document.createElement("span");
3352
3359
  if (n === "referral")
3353
- s.textContent = "Give them 2,000 free credits—and earn 2,000 when they try Pluno.";
3360
+ p.textContent = "Give them 2,000 free credits—and earn 2,000 when they try Pluno.";
3354
3361
  else {
3355
- if (s.appendChild(
3362
+ if (p.appendChild(
3356
3363
  document.createTextNode("Post on LinkedIn, X, or Instagram, then ")
3357
3364
  ), t.socialPostRewardsUrl) {
3358
3365
  const m = document.createElement("a");
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);
3366
+ 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);
3360
3367
  } else
3361
- s.appendChild(document.createTextNode("submit your post URL"));
3362
- s.appendChild(document.createTextNode(" for approval."));
3368
+ p.appendChild(document.createTextNode("submit your post URL"));
3369
+ p.appendChild(document.createTextNode(" for approval."));
3363
3370
  }
3364
- if (r.appendChild(s), t.error) {
3371
+ if (r.appendChild(p), t.error) {
3365
3372
  const m = document.createElement("span");
3366
3373
  m.className = "pluno-pa-widget__share-prompt-error", m.textContent = t.error, r.appendChild(m);
3367
3374
  }
3368
3375
  o.appendChild(r);
3369
- const p = document.createElement("div");
3370
- p.className = "pluno-pa-widget__share-prompt-actions";
3376
+ const s = document.createElement("div");
3377
+ s.className = "pluno-pa-widget__share-prompt-actions";
3371
3378
  const c = document.createElement("div");
3372
3379
  if (c.className = "pluno-pa-widget__share-prompt-primary-actions", n === "referral") {
3373
3380
  const m = document.createElement("button");
@@ -3380,9 +3387,9 @@ function Hr(e, t) {
3380
3387
  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);
3381
3388
  }
3382
3389
  const g = document.createElement("button");
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);
3390
+ 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);
3384
3391
  const h = document.createElement("button");
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;
3392
+ 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;
3386
3393
  }
3387
3394
  function Gr() {
3388
3395
  const e = "https://pluno.ai/browser", t = `I just used @pluno_ai to get work done directly inside my tools. Worth trying: ${e}`;
@@ -3416,7 +3423,7 @@ function $r(e) {
3416
3423
  function Xo(e) {
3417
3424
  return e.role === "tool" && e.toolName === Ao;
3418
3425
  }
3419
- function yn(e) {
3426
+ function vn(e) {
3420
3427
  return e.replace(/\uE200[^\uE201]*(?:\uE201|$)/g, "");
3421
3428
  }
3422
3429
  function qr(e, t, n, i, o) {
@@ -3434,9 +3441,9 @@ function qr(e, t, n, i, o) {
3434
3441
  const E = document.createElement("div");
3435
3442
  return E.className = "pluno-pa-widget__tool-active-content", E.appendChild(dt()), E.appendChild(l), r.appendChild(E), r;
3436
3443
  }
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();
3444
+ const p = document.createElement("details"), s = Kr(e);
3445
+ p.open = n.has(s), r.classList.toggle("pluno-pa-widget__tool-group--open", p.open), p.addEventListener("toggle", () => {
3446
+ r.classList.toggle("pluno-pa-widget__tool-group--open", p.open), p.open ? n.add(s) : n.delete(s), i();
3440
3447
  });
3441
3448
  const c = document.createElement("summary");
3442
3449
  c.className = "pluno-pa-widget__tool-summary";
@@ -3445,7 +3452,7 @@ function qr(e, t, n, i, o) {
3445
3452
  ), m = document.createElement("span");
3446
3453
  m.className = "pluno-pa-widget__tool-summary-title";
3447
3454
  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;
3455
+ return m.textContent = v, h && (m.classList.add("pluno-pa-widget__tool-summary-title--loading"), m.dataset.loadingText = v), c.appendChild(m), p.appendChild(c), p.appendChild(l), r.appendChild(p), r;
3449
3456
  }
3450
3457
  function jr(e, t) {
3451
3458
  const n = document.createElement("div");
@@ -3456,8 +3463,8 @@ function jr(e, t) {
3456
3463
  r.className = "pluno-pa-widget__tool-line", r.dataset.eventType = o.phase === "commentary" ? "commentary" : "tool";
3457
3464
  const l = document.createElement("span");
3458
3465
  l.className = "pluno-pa-widget__tool-line-text";
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);
3466
+ const p = vn(o.content) || (o.phase === "commentary" ? "" : "Run tool"), s = o.phase === "commentary" ? p : Zo(p);
3467
+ 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);
3461
3468
  }
3462
3469
  return n;
3463
3470
  }
@@ -3527,11 +3534,11 @@ function Xr(e, t) {
3527
3534
  }
3528
3535
  const r = document.createElement("div");
3529
3536
  r.className = "pluno-pa-widget__table-scroll";
3530
- const l = document.createElement("table"), s = document.createElement("thead"), p = document.createElement("tr");
3537
+ const l = document.createElement("table"), p = document.createElement("thead"), s = document.createElement("tr");
3531
3538
  n.forEach((h, m) => {
3532
3539
  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);
3540
+ E && v.classList.add(`pluno-pa-widget__table-cell--${E}`), Ee(v, h), s.appendChild(v);
3541
+ }), p.appendChild(s), l.appendChild(p);
3535
3542
  const c = document.createElement("tbody");
3536
3543
  let g = t + 2;
3537
3544
  for (; g < e.length && e[g].trim(); ) {
@@ -3572,10 +3579,10 @@ function Zr(e, t) {
3572
3579
  e.appendChild(l.element), i = l.nextIndex;
3573
3580
  continue;
3574
3581
  }
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;
3582
+ const p = o.match(/^(#{1,3})\s+(.+)$/);
3583
+ if (p) {
3584
+ const h = document.createElement(`h${p[1].length + 2}`);
3585
+ Ee(h, p[2]), e.appendChild(h), i += 1;
3579
3586
  continue;
3580
3587
  }
3581
3588
  if (/^\s*[-*+]\s+/.test(o)) {
@@ -3587,10 +3594,10 @@ function Zr(e, t) {
3587
3594
  e.appendChild(h);
3588
3595
  continue;
3589
3596
  }
3590
- const p = o.match(/^\s*(\d+)\.\s+/);
3591
- if (p) {
3597
+ const s = o.match(/^\s*(\d+)\.\s+/);
3598
+ if (s) {
3592
3599
  const h = document.createElement("ol");
3593
- for (h.start = Number(p[1]); i < n.length && /^\s*\d+\.\s+/.test(n[i]); ) {
3600
+ for (h.start = Number(s[1]); i < n.length && /^\s*\d+\.\s+/.test(n[i]); ) {
3594
3601
  const m = document.createElement("li");
3595
3602
  Ee(m, n[i].replace(/^\s*\d+\.\s+/, "")), h.appendChild(m), i += 1;
3596
3603
  }
@@ -3616,19 +3623,19 @@ function Ee(e, t) {
3616
3623
  );
3617
3624
  const l = o[0];
3618
3625
  if (l.startsWith("`")) {
3619
- const s = document.createElement("code");
3620
- s.textContent = l.slice(1, -1), e.appendChild(s);
3626
+ const p = document.createElement("code");
3627
+ p.textContent = l.slice(1, -1), e.appendChild(p);
3621
3628
  } else if (l.startsWith("**")) {
3622
- const s = document.createElement("strong");
3623
- Ee(s, l.slice(2, -2)), e.appendChild(s);
3629
+ const p = document.createElement("strong");
3630
+ Ee(p, l.slice(2, -2)), e.appendChild(p);
3624
3631
  } else if (l.startsWith("*")) {
3625
- const s = document.createElement("em");
3626
- Ee(s, l.slice(1, -1)), e.appendChild(s);
3632
+ const p = document.createElement("em");
3633
+ Ee(p, l.slice(1, -1)), e.appendChild(p);
3627
3634
  } else {
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);
3635
+ const p = l.match(/^\[([^\]]+)\]\(([^)\s]+)\)$/);
3636
+ if (p && Jr(p[2])) {
3637
+ const s = document.createElement("a");
3638
+ s.href = p[2], s.target = "_top", s.rel = "noreferrer", s.textContent = p[1], e.appendChild(s);
3632
3639
  } else
3633
3640
  e.appendChild(document.createTextNode(l));
3634
3641
  }
@@ -6128,11 +6135,11 @@ async function tl() {
6128
6135
  t.observe(document.documentElement, { childList: !0 });
6129
6136
  });
6130
6137
  }
6131
- function kn(e) {
6138
+ function Ln(e) {
6132
6139
  return `pluno.productAgent.widgetState.${location.origin}.${e.backendUrl ?? ""}.${e.tokenEndpoint ?? ""}.${e.position ?? ""}`;
6133
6140
  }
6134
6141
  function ti(e) {
6135
- return `${kn(e)}.displayState`;
6142
+ return `${Ln(e)}.displayState`;
6136
6143
  }
6137
6144
  function nl(e) {
6138
6145
  try {
@@ -6180,7 +6187,7 @@ function ol(e) {
6180
6187
  }
6181
6188
  function il(e) {
6182
6189
  try {
6183
- const t = window.localStorage.getItem(kn(e));
6190
+ const t = window.localStorage.getItem(Ln(e));
6184
6191
  if (!t)
6185
6192
  return Co();
6186
6193
  const n = JSON.parse(t);
@@ -6240,7 +6247,7 @@ function Co() {
6240
6247
  function ll(e, t) {
6241
6248
  try {
6242
6249
  window.localStorage.setItem(
6243
- kn(e),
6250
+ Ln(e),
6244
6251
  JSON.stringify(t)
6245
6252
  );
6246
6253
  } catch {
@@ -6284,9 +6291,9 @@ function dl(e) {
6284
6291
  const i = async () => {
6285
6292
  const o = new AbortController();
6286
6293
  let r = !1;
6287
- const l = new Promise((s, p) => {
6294
+ const l = new Promise((p, s) => {
6288
6295
  const c = window.setTimeout(() => {
6289
- r = !0, o.abort(), p(new Error(Zn));
6296
+ r = !0, o.abort(), s(new Error(Jn));
6290
6297
  }, da);
6291
6298
  o.signal.addEventListener(
6292
6299
  "abort",
@@ -6295,13 +6302,13 @@ function dl(e) {
6295
6302
  );
6296
6303
  });
6297
6304
  try {
6298
- const s = await Promise.race([
6305
+ const p = await Promise.race([
6299
6306
  ni(e, o.signal),
6300
6307
  l
6301
6308
  ]);
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);
6309
+ return o.abort(), p;
6310
+ } catch (p) {
6311
+ throw o.abort(), r ? new Error(Jn) : p instanceof Error && p.message.startsWith("Pluno widget blocked on ") ? p : new Error(ca);
6305
6312
  }
6306
6313
  };
6307
6314
  return {
@@ -6426,12 +6433,12 @@ class xe extends EventTarget {
6426
6433
  }
6427
6434
  function gl() {
6428
6435
  const e = window.sessionStorage.getItem(
6429
- Xn
6436
+ Zn
6430
6437
  );
6431
6438
  if (e)
6432
6439
  return e;
6433
6440
  const t = crypto.randomUUID();
6434
- return window.sessionStorage.setItem(Xn, t), t;
6441
+ return window.sessionStorage.setItem(Zn, t), t;
6435
6442
  }
6436
6443
  function St(e, t) {
6437
6444
  return `${e}:${t}`;
@@ -6458,8 +6465,8 @@ function oi(e) {
6458
6465
  if (n) {
6459
6466
  if (n.host === null)
6460
6467
  return n.mountPromise.catch(() => {
6461
- const p = t[be];
6462
- return p ? p.mountPromise : oi(e);
6468
+ const s = t[be];
6469
+ return s ? s.mountPromise : oi(e);
6463
6470
  });
6464
6471
  if (fl(n.host))
6465
6472
  return n.retryPendingTokenFailureOnce?.(), n.mountPromise;
@@ -6467,7 +6474,7 @@ function oi(e) {
6467
6474
  }
6468
6475
  const i = e.dataset.plunoPreviewChannel, o = e.dataset.plunoTokenEndpoint, r = !e.dataset.plunoToken && !i && o ? dl(o) : null;
6469
6476
  let l;
6470
- const s = Na({
6477
+ const p = Na({
6471
6478
  token: e.dataset.plunoToken,
6472
6479
  tokenProvider: r?.loadToken,
6473
6480
  tokenEndpoint: o,
@@ -6479,24 +6486,24 @@ function oi(e) {
6479
6486
  fontFamily: e.dataset.plunoFontFamily,
6480
6487
  scribbleStyle: e.dataset.plunoScribbleStyle === void 0 ? void 0 : e.dataset.plunoScribbleStyle !== "false",
6481
6488
  position: e.dataset.plunoPosition === "bottom-left" ? "bottom-left" : "bottom-right"
6482
- }).then((p) => {
6489
+ }).then((s) => {
6483
6490
  if (t[be] !== l) {
6484
- p.destroy();
6491
+ s.destroy();
6485
6492
  return;
6486
6493
  }
6487
- const c = p.host;
6494
+ const c = s.host;
6488
6495
  c.setAttribute(Po, "true"), l.host = c, l.destroy = () => {
6489
- t[be] === l && delete t[be], l.host = null, l.destroy = null, p.destroy();
6496
+ t[be] === l && delete t[be], l.host = null, l.destroy = null, s.destroy();
6490
6497
  };
6491
- }).catch((p) => {
6492
- throw t[be] === l && delete t[be], p;
6498
+ }).catch((s) => {
6499
+ throw t[be] === l && delete t[be], s;
6493
6500
  });
6494
6501
  return l = {
6495
- mountPromise: s,
6502
+ mountPromise: p,
6496
6503
  host: null,
6497
6504
  destroy: null,
6498
6505
  retryPendingTokenFailureOnce: r?.retryPendingFailureOnce ?? null
6499
- }, t[be] = l, s;
6506
+ }, t[be] = l, p;
6500
6507
  }
6501
6508
  function fl(e) {
6502
6509
  return e.isConnected && e.getAttribute(Po) === "true" && !!e.shadowRoot?.querySelector(".pluno-pa-widget__launcher") && !!e.shadowRoot?.querySelector(".pluno-pa-widget__panel");