@pluno/product-agent-web 0.1.121 → 0.1.122

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.
@@ -309,7 +309,7 @@ function ua(e, t, n) {
309
309
  e.slice(i, t)
310
310
  );
311
311
  }
312
- const $o = 100, ga = 1e4, ha = 5e3, ma = "product-agent:sdk-preview-socket-connect", fa = "product-agent:sdk-preview-socket-send", wa = "product-agent:sdk-preview-socket-close", ba = "product-agent:sdk-preview-socket-open", _a = "product-agent:sdk-preview-socket-message", xa = "product-agent:sdk-preview-socket-error", ya = "product-agent:sdk-preview-socket-closed", uo = "product-agent:sdk-preview-socket-id", va = "data-pluno-sdk-preview-channel", Go = "data-pluno-auto-mounted", ve = "__plunoProductAgentAutoMountOwner", Sa = 1e4, Ca = "Failed to load Pluno widget token", go = "Timed out loading Pluno widget token", Ea = "pluno.productAgent.widgetClientId.", un = /* @__PURE__ */ new Set(), ka = "product-agent:preview-diagnostic", qo = "pluno.productAgent.sharePromptsDisabled", La = 3, ho = 'dialog[open], [aria-modal="true"], [role="dialog"]', mo = 1500, Ta = 5e3, Aa = 500, Pa = "No recent chats for this page yet.", Se = {
312
+ const $o = 100, ga = 1e4, ha = 5e3, ma = "product-agent:sdk-preview-socket-connect", fa = "product-agent:sdk-preview-socket-send", wa = "product-agent:sdk-preview-socket-close", ba = "product-agent:sdk-preview-socket-open", _a = "product-agent:sdk-preview-socket-message", xa = "product-agent:sdk-preview-socket-error", ya = "product-agent:sdk-preview-socket-closed", uo = "product-agent:sdk-preview-socket-id", va = "data-pluno-sdk-preview-channel", Go = "data-pluno-auto-mounted", ve = "__plunoProductAgentAutoMountOwner", Sa = 1e4, Ca = "Failed to load Pluno widget token", go = "Timed out loading Pluno widget token", Ea = "pluno.productAgent.widgetClientId.", un = /* @__PURE__ */ new Set(), ka = "product-agent:preview-diagnostic", qo = "pluno.productAgent.sharePromptsDisabled", La = 3, ho = 'dialog[open], [aria-modal="true"], [role="dialog"]', mo = 1500, Ta = 5e3, Pa = 500, Aa = "No recent chats for this page yet.", Se = {
313
313
  launcherLabel: "Ask for anything...",
314
314
  accentColor: "#7c3aed",
315
315
  colorScheme: "light",
@@ -381,6 +381,7 @@ async function ja(e = {}) {
381
381
  restorePersistedState: e.restorePersistedState,
382
382
  expectedPersistedSessionId: e.expectedPersistedSessionId,
383
383
  keepRunsActiveOnSessionNavigation: e.keepRunsActiveOnSessionNavigation === !0,
384
+ capturePageContent: e.capturePageContent,
384
385
  webSocketFactory: e.webSocketFactory,
385
386
  prepareAttachmentUpload: e.prepareAttachmentUpload,
386
387
  attachmentPreviewUrlResolver: e.attachmentPreviewUrlResolver,
@@ -537,14 +538,14 @@ async function ja(e = {}) {
537
538
  if (t.movableLauncher && !U)
538
539
  throw new Error("Failed to mount Pluno widget drag handle");
539
540
  let E = !1;
540
- const P = (a) => {
541
+ const A = (a) => {
541
542
  Bt(t.billingStatus) || (E = !1), Ur(
542
543
  bt,
543
544
  t.billingStatus,
544
545
  a,
545
546
  E,
546
547
  () => {
547
- E = !0, P(a);
548
+ E = !0, A(a);
548
549
  }
549
550
  );
550
551
  };
@@ -582,6 +583,7 @@ async function ja(e = {}) {
582
583
  restorePersistedState: t.restorePersistedState,
583
584
  expectedPersistedSessionId: t.expectedPersistedSessionId,
584
585
  keepRunsActiveOnSessionNavigation: t.keepRunsActiveOnSessionNavigation,
586
+ capturePageContent: t.capturePageContent,
585
587
  webSocketFactory: t.webSocketFactory,
586
588
  prepareAttachmentUpload: t.prepareAttachmentUpload,
587
589
  // The launcher is useful before a customer token endpoint responds. The widget owns connection
@@ -658,7 +660,7 @@ async function ja(e = {}) {
658
660
  {
659
661
  message: s instanceof Error ? s.message : String(s)
660
662
  }
661
- ), ot = Pa;
663
+ ), ot = Aa;
662
664
  } finally {
663
665
  we = !1, be();
664
666
  }
@@ -674,7 +676,7 @@ async function ja(e = {}) {
674
676
  }), $n();
675
677
  const it = (a = !0) => {
676
678
  const s = Ut(o, a);
677
- return An(
679
+ return Pn(
678
680
  o,
679
681
  d ? zt(d, s) : er(
680
682
  o,
@@ -801,7 +803,7 @@ async function ja(e = {}) {
801
803
  launcherDragHandle: U,
802
804
  getPosition: () => it(),
803
805
  setPosition: (a) => {
804
- const s = a, m = Ut(o), S = An(
806
+ const s = a, m = Ut(o), S = Pn(
805
807
  o,
806
808
  a,
807
809
  m
@@ -862,11 +864,11 @@ async function ja(e = {}) {
862
864
  const a = await t.billingStatusLoader();
863
865
  if (Y)
864
866
  return;
865
- Po(
867
+ Ao(
866
868
  t.billingStatus,
867
869
  a,
868
870
  b.getState().lastErrorCode
869
- ) && (t.billingStatus = a, P(b.getState().lastErrorCode), V());
871
+ ) && (t.billingStatus = a, A(b.getState().lastErrorCode), V());
870
872
  } catch (a) {
871
873
  J(
872
874
  "web-sdk.widget",
@@ -921,7 +923,7 @@ async function ja(e = {}) {
921
923
  const a = u.value;
922
924
  _e(a), u.value = "";
923
925
  });
924
- let lt = null, Ae = null, vt = null, He = null, se = null, q = null;
926
+ let lt = null, Pe = null, vt = null, He = null, se = null, q = null;
925
927
  const St = (a) => a === u || a === v, Yn = (a) => a.composedPath().find(St) ?? null, Ci = (a) => {
926
928
  let s = a;
927
929
  for (; s; ) {
@@ -979,7 +981,7 @@ async function ja(e = {}) {
979
981
  return;
980
982
  }
981
983
  Jt(m, null);
982
- }, Aa)) : (He !== null && (window.clearInterval(He), He = null), se !== null && (window.clearTimeout(se), se = null), vt = null);
984
+ }, Pa)) : (He !== null && (window.clearInterval(He), He = null), se !== null && (window.clearTimeout(se), se = null), vt = null);
983
985
  }, ki = () => {
984
986
  He !== null && (window.clearInterval(He), He = null), se !== null && (window.clearTimeout(se), se = null), q !== null && (window.clearTimeout(q), q = null);
985
987
  }, Xn = (a) => {
@@ -987,22 +989,22 @@ async function ja(e = {}) {
987
989
  if (!s)
988
990
  return;
989
991
  const m = Date.now();
990
- Ae = m, lt = m, q !== null && window.clearTimeout(q);
992
+ Pe = m, lt = m, q !== null && window.clearTimeout(q);
991
993
  const S = xe ?? Xt(Zt());
992
994
  S && (pt(S, s), a.stopImmediatePropagation()), q = window.setTimeout(() => {
993
- if (q = null, Ae !== m)
995
+ if (q = null, Pe !== m)
994
996
  return;
995
997
  const k = Zt();
996
998
  if (k === s) {
997
- Ae = null;
999
+ Pe = null;
998
1000
  return;
999
1001
  }
1000
- const Pe = Xt(k);
1001
- Pe && pt(Pe, s);
1002
+ const Ae = Xt(k);
1003
+ Ae && pt(Ae, s);
1002
1004
  }, 0);
1003
1005
  }, Ct = (a) => {
1004
1006
  const s = Yn(a);
1005
- s && (lt = Date.now(), xe !== null && (a.stopImmediatePropagation(), Ae = null, q !== null && (window.clearTimeout(q), q = null), W(), a.type === "focus" && s === u && Kn()));
1007
+ s && (lt = Date.now(), xe !== null && (a.stopImmediatePropagation(), Pe = null, q !== null && (window.clearTimeout(q), q = null), W(), a.type === "focus" && s === u && Kn()));
1006
1008
  };
1007
1009
  x.defaultView?.addEventListener(
1008
1010
  "pointerdown",
@@ -1019,17 +1021,17 @@ async function ja(e = {}) {
1019
1021
  ), o.addEventListener("pointerdown", (a) => {
1020
1022
  St(a.target) && a.stopPropagation();
1021
1023
  }), o.addEventListener("focusin", (a) => {
1022
- St(a.target) && (a.stopPropagation(), lt = Date.now(), Ae = null, q !== null && (window.clearTimeout(q), q = null), W());
1024
+ St(a.target) && (a.stopPropagation(), lt = Date.now(), Pe = null, q !== null && (window.clearTimeout(q), q = null), W());
1023
1025
  }), o.addEventListener("focusout", (a) => {
1024
1026
  if (!St(a.target) || xe !== null)
1025
1027
  return;
1026
1028
  const s = lt;
1027
1029
  if (lt = null, s === null || Date.now() - s > mo)
1028
1030
  return;
1029
- const m = a.target, S = Ae !== null && Date.now() - Ae <= mo;
1030
- Ae = null, q !== null && (window.clearTimeout(q), q = null);
1031
- const k = (Pe) => {
1032
- const dn = Xt(Pe);
1031
+ const m = a.target, S = Pe !== null && Date.now() - Pe <= mo;
1032
+ Pe = null, q !== null && (window.clearTimeout(q), q = null);
1033
+ const k = (Ae) => {
1034
+ const dn = Xt(Ae);
1033
1035
  if (!dn)
1034
1036
  return !1;
1035
1037
  if (S)
@@ -1125,14 +1127,14 @@ async function ja(e = {}) {
1125
1127
  return;
1126
1128
  }
1127
1129
  ke();
1128
- }, Ai = async (a) => {
1130
+ }, Pi = async (a) => {
1129
1131
  await nn(a), !(a.length === 0 || xe !== null) && v.focus();
1130
1132
  };
1131
1133
  B.addEventListener("click", () => {
1132
1134
  t.loginRequired || le() || pe(t.billingStatus) || ge.click();
1133
1135
  }), ge.addEventListener("change", () => {
1134
1136
  const a = Array.from(ge.files ?? []);
1135
- ge.value = "", Ai(a).catch((s) => {
1137
+ ge.value = "", Pi(a).catch((s) => {
1136
1138
  tn(
1137
1139
  s instanceof Error ? s.message : "Failed to attach file"
1138
1140
  ), J("web-sdk.widget", "Attachment failed", {
@@ -1234,7 +1236,7 @@ async function ja(e = {}) {
1234
1236
  Ye !== null && (window.clearTimeout(Ye), Ye = null);
1235
1237
  }, Lt = () => {
1236
1238
  De && (De.hidden = !0);
1237
- }, eo = () => b.getState().assistantDraft.trim().length > 0, Pi = async () => {
1239
+ }, eo = () => b.getState().assistantDraft.trim().length > 0, Ai = async () => {
1238
1240
  if (!gt || !De || Xe || Y || !b.getState().isThinking || eo())
1239
1241
  return;
1240
1242
  let a;
@@ -1256,7 +1258,7 @@ async function ja(e = {}) {
1256
1258
  });
1257
1259
  const Tt = t.tabGroups;
1258
1260
  let Ze = !1;
1259
- const At = async () => {
1261
+ const Pt = async () => {
1260
1262
  if (!Tt || !I || Ze || Y)
1261
1263
  return;
1262
1264
  const a = await Tt.getState().catch(() => null);
@@ -1265,14 +1267,14 @@ async function ja(e = {}) {
1265
1267
  Ee?.addEventListener("click", () => {
1266
1268
  Ze = !0, I && (I.hidden = !0), Tt?.enable().catch(() => {
1267
1269
  }).finally(() => {
1268
- Ze = !1, At();
1270
+ Ze = !1, Pt();
1269
1271
  });
1270
1272
  }), oe?.addEventListener("click", () => {
1271
1273
  Ze = !0, I && (I.hidden = !0), Tt?.dismiss().catch(() => {
1272
1274
  }).finally(() => {
1273
- Ze = !1, At();
1275
+ Ze = !1, Pt();
1274
1276
  });
1275
- }), At();
1277
+ }), Pt();
1276
1278
  let Je = null, to = () => {
1277
1279
  };
1278
1280
  const Ii = !!(t.sdkPreviewChannelId && t.referralLinkLoader), an = /* @__PURE__ */ new Map(), rn = () => v.value.trim().length > 0 || M.length > 0, Ni = () => {
@@ -1280,7 +1282,7 @@ async function ja(e = {}) {
1280
1282
  me.hidden = !a, a && Je !== null && ei(me, Je);
1281
1283
  };
1282
1284
  let Qe = null;
1283
- const ye = /* @__PURE__ */ new Map(), Pt = /* @__PURE__ */ new Set(), Ri = async (a) => {
1285
+ const ye = /* @__PURE__ */ new Map(), At = /* @__PURE__ */ new Set(), Ri = async (a) => {
1284
1286
  if (t.integrationAuthHandler) {
1285
1287
  ye.set(a.authRequestId, { status: "connecting" }), O(b.getState());
1286
1288
  try {
@@ -1294,7 +1296,7 @@ async function ja(e = {}) {
1294
1296
  O(b.getState());
1295
1297
  }
1296
1298
  }, ln = (a = {}) => {
1297
- Le = !0, ae(!0, "newSession"), re(), X = !1, be(), b.startNewSession(a), $t.clear(), ye.clear(), Pt.clear(), v.value = "", M = [], je(), ht(v), W(), V(), v.focus(), O(b.getState());
1299
+ Le = !0, ae(!0, "newSession"), re(), X = !1, be(), b.startNewSession(a), $t.clear(), ye.clear(), At.clear(), v.value = "", M = [], je(), ht(v), W(), V(), v.focus(), O(b.getState());
1298
1300
  }, It = () => {
1299
1301
  t.morningReport !== null && (t.morningReport = null, t.onMorningReportTaskStart?.(), ln());
1300
1302
  }, pn = (a) => {
@@ -1309,7 +1311,7 @@ async function ja(e = {}) {
1309
1311
  !1
1310
1312
  ), Qe.addEventListener("click", () => ln()), j.insertBefore(Qe, Z));
1311
1313
  }, O = (a) => {
1312
- if (be(), Un(a.lastErrorCode) ? Ke = a.lastErrorCode : t.billingStatus?.creditsUsed !== null && !pe(t.billingStatus) && (Ke = null), P(Ke), t.loginRequired) {
1314
+ if (be(), Un(a.lastErrorCode) ? Ke = a.lastErrorCode : t.billingStatus?.creditsUsed !== null && !pe(t.billingStatus) && (Ke = null), A(Ke), t.loginRequired) {
1313
1315
  an.clear(), Ro(
1314
1316
  z,
1315
1317
  F,
@@ -1403,8 +1405,8 @@ async function ja(e = {}) {
1403
1405
  );
1404
1406
  await Promise.all(
1405
1407
  s.map(async (m) => {
1406
- if (!(ye.has(m.authRequestId) || Pt.has(m.authRequestId))) {
1407
- Pt.add(m.authRequestId), ye.set(m.authRequestId, {
1408
+ if (!(ye.has(m.authRequestId) || At.has(m.authRequestId))) {
1409
+ At.add(m.authRequestId), ye.set(m.authRequestId, {
1408
1410
  status: "checking"
1409
1411
  }), O(b.getState());
1410
1412
  try {
@@ -1416,7 +1418,7 @@ async function ja(e = {}) {
1416
1418
  error: S instanceof Error ? S.message : `Could not load ${m.appName} connection status.`
1417
1419
  });
1418
1420
  } finally {
1419
- Pt.delete(m.authRequestId);
1421
+ At.delete(m.authRequestId);
1420
1422
  }
1421
1423
  Y || O(b.getState());
1422
1424
  }
@@ -1433,10 +1435,10 @@ async function ja(e = {}) {
1433
1435
  loader: t.activeUsersLoader
1434
1436
  }
1435
1437
  ), b.on("state", (a) => {
1436
- At();
1438
+ Pt();
1437
1439
  const s = Jn && !a.isThinking;
1438
1440
  Jn = a.isThinking, a.isThinking && !a.assistantDraft.trim() && gt && !Xe && Ye === null && De?.hidden !== !1 && (Ye = window.setTimeout(() => {
1439
- Ye = null, Pi();
1441
+ Ye = null, Ai();
1440
1442
  }, ga)), (!a.isThinking || a.assistantDraft.trim()) && (Qn(), Lt()), s && !o.classList.contains("pluno-pa-widget--open") && (dt = !0), Qt(), a.appearance ? (on = !0, J(
1441
1443
  "web-sdk.widget",
1442
1444
  "Agent state supplied appearance",
@@ -1461,11 +1463,11 @@ async function ja(e = {}) {
1461
1463
  },
1462
1464
  updateBillingStatus: (a) => {
1463
1465
  const s = a ?? null;
1464
- Po(
1466
+ Ao(
1465
1467
  t.billingStatus,
1466
1468
  s,
1467
1469
  Ke
1468
- ) && (t.billingStatus = s, t.billingStatus?.creditsUsed !== null && !pe(t.billingStatus) && (Ke = null), P(Ke), V());
1470
+ ) && (t.billingStatus = s, t.billingStatus?.creditsUsed !== null && !pe(t.billingStatus) && (Ke = null), A(Ke), V());
1469
1471
  },
1470
1472
  updateAuthGate: (a) => {
1471
1473
  const s = st();
@@ -1536,22 +1538,22 @@ async function ja(e = {}) {
1536
1538
  }
1537
1539
  }
1538
1540
  function sn(a, s) {
1539
- const m = a.accentColor ?? t.accentColor, S = a.colorScheme ?? t.colorScheme, k = a.fontFamily ?? t.fontFamily, Pe = a.scribbleStyle ?? t.scribbleStyle;
1541
+ const m = a.accentColor ?? t.accentColor, S = a.colorScheme ?? t.colorScheme, k = a.fontFamily ?? t.fontFamily, Ae = a.scribbleStyle ?? t.scribbleStyle;
1540
1542
  r = _o(
1541
1543
  m,
1542
- Pe
1544
+ Ae
1543
1545
  ), xo(o, r, {
1544
1546
  accentColor: m,
1545
1547
  colorScheme: S,
1546
1548
  fontFamily: k,
1547
- scribbleStyle: Pe
1549
+ scribbleStyle: Ae
1548
1550
  }), J("web-sdk.widget", "Updated widget appearance", {
1549
1551
  source: s,
1550
1552
  inputAppearance: a,
1551
1553
  appliedAccentColor: m,
1552
1554
  appliedColorScheme: S,
1553
1555
  appliedFontFamily: k,
1554
- appliedScribbleStyle: Pe,
1556
+ appliedScribbleStyle: Ae,
1555
1557
  cssAccent: o.style.getPropertyValue("--pluno-pa-accent")
1556
1558
  });
1557
1559
  }
@@ -1864,7 +1866,7 @@ function er(e, t, n) {
1864
1866
  }
1865
1867
  function hn(e, t, n) {
1866
1868
  const i = Ut(e, !1);
1867
- return t ? An(
1869
+ return t ? Pn(
1868
1870
  e,
1869
1871
  zt(t, i),
1870
1872
  i
@@ -1877,7 +1879,7 @@ function tr(e, t, n) {
1877
1879
  y: e.startsWith("bottom") ? Math.max(0, i.height - t.height - n) : n
1878
1880
  };
1879
1881
  }
1880
- function An(e, t, n) {
1882
+ function Pn(e, t, n) {
1881
1883
  const i = te(), o = N + or(e);
1882
1884
  return {
1883
1885
  x: ee(
@@ -2133,7 +2135,7 @@ function fr(e) {
2133
2135
  return p.className = "pluno-pa-widget__top-actions", p.appendChild(
2134
2136
  Wt(
2135
2137
  "pluno-pa-widget__history",
2136
- Pn(),
2138
+ An(),
2137
2139
  Lr(),
2138
2140
  !0
2139
2141
  )
@@ -2198,7 +2200,7 @@ function _r() {
2198
2200
  const r = document.createElement("input");
2199
2201
  r.className = "pluno-pa-widget__attachment-input", r.type = "file", r.multiple = !0, r.tabIndex = -1, r.setAttribute("aria-hidden", "true"), o.appendChild(r);
2200
2202
  const l = document.createElement("button");
2201
- l.type = "button", l.className = "pluno-pa-widget__attach", l.setAttribute("aria-label", "Attach files"), l.title = "Attach files", l.appendChild(Tr()), l.appendChild(Ar()), o.appendChild(l);
2203
+ l.type = "button", l.className = "pluno-pa-widget__attach", l.setAttribute("aria-label", "Attach files"), l.title = "Attach files", l.appendChild(Tr()), l.appendChild(Pr()), o.appendChild(l);
2202
2204
  const p = document.createElement("textarea");
2203
2205
  p.className = "pluno-pa-widget__input", p.rows = 1, p.placeholder = "Ask for anything...", o.appendChild(p);
2204
2206
  const d = document.createElement("button");
@@ -2210,16 +2212,16 @@ function _r() {
2210
2212
  const h = document.createElement("span");
2211
2213
  return h.className = "pluno-pa-widget__ai-disclaimer", h.textContent = "AI can make mistakes. Verify outputs.", c.appendChild(h), e.appendChild(c), e;
2212
2214
  }
2213
- function Pn() {
2215
+ function An() {
2214
2216
  return location.hostname ? `Recent chats on ${location.hostname}` : "Recent chats";
2215
2217
  }
2216
2218
  function xr() {
2217
2219
  const e = document.createElement("section");
2218
- e.className = "pluno-pa-widget__history-panel", e.hidden = !0, e.setAttribute("aria-label", Pn());
2220
+ e.className = "pluno-pa-widget__history-panel", e.hidden = !0, e.setAttribute("aria-label", An());
2219
2221
  const t = document.createElement("div");
2220
2222
  t.className = "pluno-pa-widget__history-header";
2221
2223
  const n = document.createElement("strong");
2222
- n.textContent = Pn();
2224
+ n.textContent = An();
2223
2225
  const i = Wt(
2224
2226
  "pluno-pa-widget__history-close",
2225
2227
  "Close recent chats",
@@ -2529,7 +2531,7 @@ function Sr(e, t) {
2529
2531
  ), o;
2530
2532
  }
2531
2533
  function ti() {
2532
- return A("svg", {
2534
+ return P("svg", {
2533
2535
  xmlns: Ko,
2534
2536
  viewBox: "0 0 1254 1254"
2535
2537
  });
@@ -2580,7 +2582,7 @@ function Lo(e, t, n, i, o, r, l, p) {
2580
2582
  });
2581
2583
  }
2582
2584
  function _(e, t, n = {}) {
2583
- const i = A(t, n);
2585
+ const i = P(t, n);
2584
2586
  return e.appendChild(i), i;
2585
2587
  }
2586
2588
  function G(e, t, n, i) {
@@ -2595,13 +2597,13 @@ function Wt(e, t, n, i) {
2595
2597
  return o.type = "button", o.className = e, o.setAttribute("aria-label", t), o.title = t, o.hidden = i, o.appendChild(n), o;
2596
2598
  }
2597
2599
  function Cr() {
2598
- const e = A("svg", {
2600
+ const e = P("svg", {
2599
2601
  class: "pluno-pa-widget__scribble-defs",
2600
2602
  "aria-hidden": "true",
2601
2603
  focusable: "false",
2602
2604
  width: "0",
2603
2605
  height: "0"
2604
- }), t = A("defs");
2606
+ }), t = P("defs");
2605
2607
  return t.appendChild(_n("pluno-pa-scribble-wobble", "2", "12")), t.appendChild(
2606
2608
  _n("pluno-pa-scribble-wobble-2", "5", "15")
2607
2609
  ), t.appendChild(
@@ -2609,7 +2611,7 @@ function Cr() {
2609
2611
  ), e.appendChild(t), e;
2610
2612
  }
2611
2613
  function ni(e, t) {
2612
- const n = A("svg", {
2614
+ const n = P("svg", {
2613
2615
  class: `pluno-pa-widget__scribble-spirals ${e}`,
2614
2616
  preserveAspectRatio: "xMidYMid meet",
2615
2617
  "aria-hidden": "true",
@@ -2640,11 +2642,11 @@ function oi(e, t) {
2640
2642
  `0 0 ${n} ${Fa}`
2641
2643
  ), e.replaceChildren();
2642
2644
  for (let i = 0; i < t; i += 1) {
2643
- const o = wo[i % wo.length], r = A("g", {
2645
+ const o = wo[i % wo.length], r = P("g", {
2644
2646
  transform: `translate(${kn + i * En} 0)`
2645
2647
  });
2646
2648
  r.appendChild(
2647
- A("ellipse", {
2649
+ P("ellipse", {
2648
2650
  cx: o.ellipseCx,
2649
2651
  cy: o.ellipseCy,
2650
2652
  rx: o.ellipseRx,
@@ -2655,7 +2657,7 @@ function oi(e, t) {
2655
2657
  opacity: "0.8"
2656
2658
  })
2657
2659
  ), r.appendChild(
2658
- A("path", {
2660
+ P("path", {
2659
2661
  d: o.path,
2660
2662
  fill: "none",
2661
2663
  stroke: "#2c2a1e",
@@ -2666,7 +2668,7 @@ function oi(e, t) {
2666
2668
  }
2667
2669
  }
2668
2670
  function _n(e, t, n) {
2669
- const i = A("filter", {
2671
+ const i = P("filter", {
2670
2672
  id: e,
2671
2673
  x: "-8%",
2672
2674
  y: "-8%",
@@ -2674,7 +2676,7 @@ function _n(e, t, n) {
2674
2676
  height: "116%"
2675
2677
  });
2676
2678
  return i.appendChild(
2677
- A("feTurbulence", {
2679
+ P("feTurbulence", {
2678
2680
  type: "fractalNoise",
2679
2681
  baseFrequency: "0.012 0.028",
2680
2682
  numOctaves: "3",
@@ -2682,7 +2684,7 @@ function _n(e, t, n) {
2682
2684
  result: "stroke-noise"
2683
2685
  })
2684
2686
  ), i.appendChild(
2685
- A("feDisplacementMap", {
2687
+ P("feDisplacementMap", {
2686
2688
  in: "SourceGraphic",
2687
2689
  in2: "stroke-noise",
2688
2690
  scale: "3.5",
@@ -2691,7 +2693,7 @@ function _n(e, t, n) {
2691
2693
  result: "warped"
2692
2694
  })
2693
2695
  ), i.appendChild(
2694
- A("feTurbulence", {
2696
+ P("feTurbulence", {
2695
2697
  type: "fractalNoise",
2696
2698
  baseFrequency: "0.7",
2697
2699
  numOctaves: "1",
@@ -2699,7 +2701,7 @@ function _n(e, t, n) {
2699
2701
  result: "ink-noise"
2700
2702
  })
2701
2703
  ), i.appendChild(
2702
- A("feDisplacementMap", {
2704
+ P("feDisplacementMap", {
2703
2705
  in: "warped",
2704
2706
  in2: "ink-noise",
2705
2707
  scale: "0.9",
@@ -2717,7 +2719,7 @@ function Er(e) {
2717
2719
  "currentColor",
2718
2720
  "2.25"
2719
2721
  );
2720
- return t.appendChild(A("path", { d: "m6 9 6 6 6-6" })), t;
2722
+ return t.appendChild(P("path", { d: "m6 9 6 6 6-6" })), t;
2721
2723
  }
2722
2724
  function kr() {
2723
2725
  const e = ue(
@@ -2729,11 +2731,11 @@ function kr() {
2729
2731
  "2.25"
2730
2732
  );
2731
2733
  return e.appendChild(
2732
- A("path", {
2734
+ P("path", {
2733
2735
  d: "M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"
2734
2736
  })
2735
2737
  ), e.appendChild(
2736
- A("path", {
2738
+ P("path", {
2737
2739
  d: "M18.4 2.6a2.1 2.1 0 0 1 3 3L12 15l-4 1 1-4Z"
2738
2740
  })
2739
2741
  ), e;
@@ -2747,7 +2749,7 @@ function Lr() {
2747
2749
  "currentColor",
2748
2750
  "2.25"
2749
2751
  );
2750
- 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;
2752
+ return e.appendChild(P("path", { d: "M3 12a9 9 0 1 0 3-6.7" })), e.appendChild(P("path", { d: "M3 4v5h5" })), e.appendChild(P("path", { d: "M12 7v5l3 2" })), e;
2751
2753
  }
2752
2754
  function ii() {
2753
2755
  const e = ue(
@@ -2758,7 +2760,7 @@ function ii() {
2758
2760
  "currentColor",
2759
2761
  "2.4"
2760
2762
  );
2761
- return e.appendChild(A("path", { d: "M18 6 6 18" })), e.appendChild(A("path", { d: "m6 6 12 12" })), e;
2763
+ return e.appendChild(P("path", { d: "M18 6 6 18" })), e.appendChild(P("path", { d: "m6 6 12 12" })), e;
2762
2764
  }
2763
2765
  function ai() {
2764
2766
  const e = ue(
@@ -2770,8 +2772,8 @@ function ai() {
2770
2772
  "2.75"
2771
2773
  );
2772
2774
  return e.appendChild(
2773
- A("line", { x1: "12", y1: "19", x2: "12", y2: "5" })
2774
- ), e.appendChild(A("polyline", { points: "5 12 12 5 19 12" })), e;
2775
+ P("line", { x1: "12", y1: "19", x2: "12", y2: "5" })
2776
+ ), e.appendChild(P("polyline", { points: "5 12 12 5 19 12" })), e;
2775
2777
  }
2776
2778
  function Tr() {
2777
2779
  const e = ue(
@@ -2786,18 +2788,18 @@ function Tr() {
2786
2788
  "class",
2787
2789
  "pluno-pa-widget__paperclip-icon pluno-pa-widget__paperclip-icon--standard"
2788
2790
  ), e.appendChild(
2789
- A("path", {
2791
+ P("path", {
2790
2792
  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"
2791
2793
  })
2792
2794
  ), e;
2793
2795
  }
2794
- function Ar() {
2796
+ function Pr() {
2795
2797
  const e = ue("0 0 24 24", 19, 19, "none", "currentColor");
2796
2798
  return e.setAttribute(
2797
2799
  "class",
2798
2800
  "pluno-pa-widget__paperclip-icon pluno-pa-widget__paperclip-icon--scribble"
2799
2801
  ), e.appendChild(
2800
- A("path", {
2802
+ P("path", {
2801
2803
  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",
2802
2804
  stroke: "currentColor",
2803
2805
  "stroke-width": "2",
@@ -2806,10 +2808,10 @@ function Ar() {
2806
2808
  })
2807
2809
  ), e;
2808
2810
  }
2809
- function Pr() {
2811
+ function Ar() {
2810
2812
  const e = ue("0 0 24 24", 18, 18, "currentColor");
2811
2813
  return e.appendChild(
2812
- A("rect", {
2814
+ P("rect", {
2813
2815
  x: "6",
2814
2816
  y: "6",
2815
2817
  width: "12",
@@ -2827,7 +2829,7 @@ function Ir() {
2827
2829
  "currentColor",
2828
2830
  "2.4"
2829
2831
  );
2830
- return e.appendChild(A("path", { d: "M18 6 6 18" })), e.appendChild(A("path", { d: "m6 6 12 12" })), e;
2832
+ return e.appendChild(P("path", { d: "M18 6 6 18" })), e.appendChild(P("path", { d: "m6 6 12 12" })), e;
2831
2833
  }
2832
2834
  function Nr() {
2833
2835
  const e = ue(
@@ -2839,7 +2841,7 @@ function Nr() {
2839
2841
  "2.25"
2840
2842
  );
2841
2843
  return e.appendChild(
2842
- A("rect", {
2844
+ P("rect", {
2843
2845
  width: "14",
2844
2846
  height: "14",
2845
2847
  x: "8",
@@ -2848,7 +2850,7 @@ function Nr() {
2848
2850
  ry: "2"
2849
2851
  })
2850
2852
  ), e.appendChild(
2851
- A("path", {
2853
+ P("path", {
2852
2854
  d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"
2853
2855
  })
2854
2856
  ), e;
@@ -2861,9 +2863,9 @@ function ue(e, t, n, i, o, r) {
2861
2863
  fill: i,
2862
2864
  "aria-hidden": "true"
2863
2865
  };
2864
- return o && (l.stroke = o, l["stroke-linecap"] = "round", l["stroke-linejoin"] = "round"), r && (l["stroke-width"] = r), A("svg", l);
2866
+ return o && (l.stroke = o, l["stroke-linecap"] = "round", l["stroke-linejoin"] = "round"), r && (l["stroke-width"] = r), P("svg", l);
2865
2867
  }
2866
- function A(e, t = {}) {
2868
+ function P(e, t = {}) {
2867
2869
  const n = document.createElementNS(Ko, e);
2868
2870
  for (const [i, o] of Object.entries(t))
2869
2871
  n.setAttribute(i, o);
@@ -2950,12 +2952,12 @@ function Mr(e, t) {
2950
2952
  function ce(e, t = "composer") {
2951
2953
  if (t === "composer") {
2952
2954
  const r = document.createElement("span");
2953
- return r.className = "pluno-pa-widget__attachment-file", r.textContent = Ao(e), r;
2955
+ return r.className = "pluno-pa-widget__attachment-file", r.textContent = Po(e), r;
2954
2956
  }
2955
2957
  const n = document.createElement("div");
2956
2958
  n.className = "pluno-pa-widget__message-attachment-file";
2957
2959
  const i = document.createElement("span");
2958
- i.textContent = Ao(e);
2960
+ i.textContent = Po(e);
2959
2961
  const o = document.createElement("strong");
2960
2962
  return o.textContent = e.name, n.append(i, o), n;
2961
2963
  }
@@ -2965,7 +2967,7 @@ function On(e) {
2965
2967
  function ri(e) {
2966
2968
  return "previewUrl" in e && e.previewUrl ? e.previewUrl : e.fileUrl ?? "";
2967
2969
  }
2968
- function Ao(e) {
2970
+ function Po(e) {
2969
2971
  const t = On(e);
2970
2972
  return t === "image" ? "IMG" : t === "pdf" ? "PDF" : t === "video" ? "VID" : "FILE";
2971
2973
  }
@@ -3034,7 +3036,7 @@ function Fr(e, t) {
3034
3036
  function In(e, t) {
3035
3037
  return e !== null && (pe(e) || Bt(e) || Un(t));
3036
3038
  }
3037
- function Po(e, t, n) {
3039
+ function Ao(e, t, n) {
3038
3040
  return In(t, n) || Wr(t) ? !0 : !In(e, n);
3039
3041
  }
3040
3042
  function Wr(e) {
@@ -3106,18 +3108,18 @@ function Gr(e, t, n, i, o, r, l, p, d, c, g, h, f, x, y, U, u, H, w, R, D, L) {
3106
3108
  const Ee = u?.prompts ?? r.starterPrompts, oe = document.createElement("div");
3107
3109
  if (oe.className = Ee.length > 0 ? "pluno-pa-widget__starter-prompts" : "pluno-pa-widget__starter-prompts pluno-pa-widget__starter-prompts--empty", Ee.length === 0 && !r.starterPromptsLoading && oe.setAttribute("aria-hidden", "true"), Ee.length > 0)
3108
3110
  for (const E of Ee) {
3109
- const P = document.createElement("button");
3110
- P.type = "button", P.className = "pluno-pa-widget__starter-prompt", P.textContent = `"${E}"`, P.addEventListener("click", () => {
3111
+ const A = document.createElement("button");
3112
+ A.type = "button", A.className = "pluno-pa-widget__starter-prompt", A.textContent = `"${E}"`, A.addEventListener("click", () => {
3111
3113
  y(E);
3112
- }), oe.appendChild(P);
3114
+ }), oe.appendChild(A);
3113
3115
  }
3114
3116
  else if (r.starterPromptsLoading) {
3115
3117
  const E = document.createElement("button");
3116
3118
  E.type = "button", E.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder pluno-pa-widget__starter-prompt--loading", E.disabled = !0, E.tabIndex = -1, E.textContent = "Generating example tasks...", oe.appendChild(E);
3117
3119
  } else
3118
3120
  for (let E = 0; E < La; E += 1) {
3119
- const P = document.createElement("button");
3120
- P.type = "button", P.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder", P.disabled = !0, P.tabIndex = -1, P.textContent = "", oe.appendChild(P);
3121
+ const A = document.createElement("button");
3122
+ A.type = "button", A.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder", A.disabled = !0, A.tabIndex = -1, A.textContent = "", oe.appendChild(A);
3121
3123
  }
3122
3124
  if (C.appendChild(oe), u) {
3123
3125
  const E = document.createElement("button");
@@ -3171,26 +3173,26 @@ function Gr(e, t, n, i, o, r, l, p, d, c, g, h, f, x, y, U, u, H, w, R, D, L) {
3171
3173
  continue;
3172
3174
  if (me()) {
3173
3175
  if (!he) {
3174
- const P = wt();
3175
- B(P), F = null, j = P;
3176
+ const A = wt();
3177
+ B(A), F = null, j = A;
3176
3178
  }
3177
3179
  } else {
3178
- const P = zo(x());
3179
- B(P), F = null, j = P;
3180
+ const A = zo(x());
3181
+ B(A), F = null, j = A;
3180
3182
  }
3181
3183
  continue;
3182
3184
  }
3183
3185
  if (T.role === "system") {
3184
3186
  if (T.dataType === "run_error" || T.dataType === "run_status") {
3185
3187
  me();
3186
- const E = document.createElement("div"), P = T.dataType === "run_error";
3187
- if (E.className = P ? "pluno-pa-widget__error" : "pluno-pa-widget__status pluno-pa-widget__run-status", E.textContent = zn(
3188
+ const E = document.createElement("div"), A = T.dataType === "run_error";
3189
+ if (E.className = A ? "pluno-pa-widget__error" : "pluno-pa-widget__status pluno-pa-widget__run-status", E.textContent = zn(
3188
3190
  T.content
3189
- ), P && T.securitySettingsUrl) {
3191
+ ), A && T.securitySettingsUrl) {
3190
3192
  const M = document.createElement("a");
3191
3193
  M.className = "pluno-pa-widget__error-retry", M.href = T.securitySettingsUrl, M.target = "_blank", M.rel = "noreferrer", M.textContent = "Security settings", E.appendChild(M);
3192
3194
  }
3193
- B(E), F = P ? E : null, j = P ? null : E, z();
3195
+ B(E), F = A ? E : null, j = A ? null : E, z();
3194
3196
  }
3195
3197
  continue;
3196
3198
  }
@@ -3595,7 +3597,7 @@ function pl() {
3595
3597
  return e.className = "pluno-pa-widget__spinner", e.setAttribute("aria-hidden", "true"), e;
3596
3598
  }
3597
3599
  function ui(e, t) {
3598
- e.setAttribute("aria-label", t ? "Stop" : "Send"), e.classList.toggle("pluno-pa-widget__send--stop", t), e.replaceChildren(t ? Pr() : ai());
3600
+ e.setAttribute("aria-label", t ? "Stop" : "Send"), e.classList.toggle("pluno-pa-widget__send--stop", t), e.replaceChildren(t ? Ar() : ai());
3599
3601
  }
3600
3602
  function yn(e) {
3601
3603
  let t = e.trim();
@@ -6669,7 +6671,7 @@ function Tl(e) {
6669
6671
  (o) => o instanceof HTMLScriptElement && El(o) && kl(o, i)
6670
6672
  );
6671
6673
  }
6672
- function Al(e) {
6674
+ function Pl(e) {
6673
6675
  for (const t of Tl(e))
6674
6676
  Uo.has(t) || t.dataset.plunoAutoMount === "false" || (Uo.add(t), fi(t).catch((n) => {
6675
6677
  console.error("Failed to mount Pluno widget", n);
@@ -6683,7 +6685,7 @@ function fi(e) {
6683
6685
  const d = t[ve];
6684
6686
  return d ? d.mountPromise : fi(e);
6685
6687
  });
6686
- if (Pl(n.host))
6688
+ if (Al(n.host))
6687
6689
  return n.retryPendingTokenFailureOnce?.(), n.mountPromise;
6688
6690
  n.destroy?.(), delete t[ve];
6689
6691
  }
@@ -6720,10 +6722,10 @@ function fi(e) {
6720
6722
  retryPendingTokenFailureOnce: r?.retryPendingFailureOnce ?? null
6721
6723
  }, t[ve] = l, p;
6722
6724
  }
6723
- function Pl(e) {
6725
+ function Al(e) {
6724
6726
  return e.isConnected && e.getAttribute(Go) === "true" && !!e.shadowRoot?.querySelector(".pluno-pa-widget__launcher") && !!e.shadowRoot?.querySelector(".pluno-pa-widget__panel");
6725
6727
  }
6726
- Al(import.meta.url);
6728
+ Pl(import.meta.url);
6727
6729
  export {
6728
6730
  qa as createProductAgentPreviewBridgeWebSocketFactory,
6729
6731
  ja as mountPlunoProductAgentWidget