@pluno/product-agent-web 0.1.200 → 0.1.201

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.
@@ -220,18 +220,18 @@ function fd(t, e, n) {
220
220
  ({ identity: w }) => w.isActivity && !w.isTransient ? w.activityKeys ?? [] : []
221
221
  )
222
222
  ), o = i.filter(
223
- ({ identity: w }) => !(w.isTransient && w.activityKeys?.some((b) => s.has(b)))
224
- ), a = new Map(o.map(({ item: w, identity: b }) => [b.id, w])), r = new Map(
223
+ ({ identity: w }) => !(w.isTransient && w.activityKeys?.some((y) => s.has(y)))
224
+ ), a = new Map(o.map(({ item: w, identity: y }) => [y.id, w])), r = new Map(
225
225
  o.flatMap(
226
- ({ item: w, identity: b }) => b.optimisticKey ? [[b.optimisticKey, w]] : []
226
+ ({ item: w, identity: y }) => y.optimisticKey ? [[y.optimisticKey, w]] : []
227
227
  )
228
228
  ), d = new Map(
229
229
  o.flatMap(
230
- ({ item: w, identity: b }) => b.assistantDraftKey ? [[b.assistantDraftKey, w]] : []
230
+ ({ item: w, identity: y }) => y.assistantDraftKey ? [[y.assistantDraftKey, w]] : []
231
231
  )
232
232
  ), c = /* @__PURE__ */ new Map();
233
- for (const { item: w, identity: b } of o)
234
- for (const f of b.activityKeys ?? []) {
233
+ for (const { item: w, identity: y } of o)
234
+ for (const f of y.activityKeys ?? []) {
235
235
  const _ = c.get(f);
236
236
  (!_ || n(_).isTransient) && c.set(f, w);
237
237
  }
@@ -239,14 +239,14 @@ function fd(t, e, n) {
239
239
  o.flatMap(({ identity: w }) => w.runId ? [w.runId] : [])
240
240
  ), m = /* @__PURE__ */ new Set(), g = [];
241
241
  for (const w of t) {
242
- const b = n(w);
243
- let f = a.get(b.id);
244
- if (b.isOptimistic && b.optimisticKey ? f = r.get(b.optimisticKey) : b.isAssistantDraft && b.assistantDraftKey ? f = d.get(b.assistantDraftKey) : b.isActivity && (f = b.activityKeys?.map((S) => c.get(S)).find((S) => S !== void 0) ?? f), f && !m.has(f)) {
242
+ const y = n(w);
243
+ let f = a.get(y.id);
244
+ if (y.isOptimistic && y.optimisticKey ? f = r.get(y.optimisticKey) : y.isAssistantDraft && y.assistantDraftKey ? f = d.get(y.assistantDraftKey) : y.isActivity && (f = y.activityKeys?.map((S) => c.get(S)).find((S) => S !== void 0) ?? f), f && !m.has(f)) {
245
245
  g.push(f), m.add(f);
246
246
  continue;
247
247
  }
248
- const _ = b.respondsToUserMessageId !== void 0 && p.has(b.respondsToUserMessageId) || b.runId !== void 0 && h.has(b.runId);
249
- (b.isOptimistic || (b.isAssistantDraft || b.isActivity) && _) && g.push(w);
248
+ const _ = y.respondsToUserMessageId !== void 0 && p.has(y.respondsToUserMessageId) || y.runId !== void 0 && h.has(y.runId);
249
+ (y.isOptimistic || (y.isAssistantDraft || y.isActivity) && _) && g.push(w);
250
250
  }
251
251
  for (const { item: w } of o)
252
252
  m.has(w) || g.push(w);
@@ -604,7 +604,7 @@ function Rd(t) {
604
604
  function Ld(t, e) {
605
605
  return e === "limit_exceeded" ? { allowed: !1, reason: "credits_exhausted", actions: ["upgrade", "earn_credits"] } : e === "subscription_required" || e === "subscription_inactive" || e === "payment_issue" || e === "subscription_invalid" || e === "payment_required" ? { allowed: !1, reason: "payment_issue", actions: ["upgrade"] } : t ?? { allowed: !0, reason: "allowed", actions: [] };
606
606
  }
607
- function Dd(t) {
607
+ function Ud(t) {
608
608
  if (!t || typeof t != "object") return !1;
609
609
  const e = t.paidCreditFallbackModel;
610
610
  return typeof e == "string" && e.length > 0;
@@ -612,7 +612,7 @@ function Dd(t) {
612
612
  function io(t) {
613
613
  return t ? t.submissionGate?.allowed === !1 ? { state: "action_required", reason: t.submissionGate.reason } : t.usingPaidCreditFallback === !0 ? { state: "paid_credit_fallback" } : t.creditLimit !== null && t.creditLimit > 0 && t.creditsRemaining !== null && t.creditsRemaining > 0 && t.creditsRemaining / t.creditLimit <= 0.2 ? { state: "low_credits" } : t.creditsUsed !== null ? { state: "usage" } : { state: "hidden" } : { state: "hidden" };
614
614
  }
615
- function Ud(t) {
615
+ function Dd(t) {
616
616
  const e = t.hasDraftMessage || t.hasPreSubmittedAttachment;
617
617
  return t.hasRunningAssistantTurn && !e ? {
618
618
  action: "stop",
@@ -978,13 +978,13 @@ const Bd = {
978
978
  completed: "✅",
979
979
  failed: "❗",
980
980
  stopped: "⏹️"
981
- }, Fd = /^(?:⌛|⏳|✅|❗|⏹️) Pluno(?:: )?/;
982
- function Wd(t, e) {
981
+ }, Wd = /^(?:⌛|⏳|✅|❗|⏹️) Pluno(?:: )?/;
982
+ function Hd(t, e) {
983
983
  if (!e) return hi(t);
984
984
  const n = hi(t), i = `${Bd[e]} Pluno`;
985
985
  return n ? `${i}: ${n}` : i;
986
986
  }
987
- class Hd {
987
+ class Fd {
988
988
  constructor(e) {
989
989
  this.titleDocument = e;
990
990
  }
@@ -1018,7 +1018,7 @@ class Hd {
1018
1018
  applyTitle() {
1019
1019
  if (!this.status)
1020
1020
  return;
1021
- const e = Wd(this.baseTitle, this.status);
1021
+ const e = Hd(this.baseTitle, this.status);
1022
1022
  this.lastAppliedTitle = e, this.titleDocument.getTitle() !== e && this.titleDocument.setTitle(e);
1023
1023
  }
1024
1024
  }
@@ -1039,7 +1039,7 @@ function $d(t) {
1039
1039
  };
1040
1040
  }
1041
1041
  function hi(t) {
1042
- return t.replace(Fd, "");
1042
+ return t.replace(Wd, "");
1043
1043
  }
1044
1044
  const jd = globalThis.fetch.bind(globalThis), gr = '.pluno-pa-widget-host[data-pluno-product-agent-ui="widget"]', Gd = '.pluno-pa-widget[data-pluno-product-agent-ui-root="widget"]', Kd = ".pluno-pa-widget__panel", Vd = ".pluno-pa-widget__timeline", Yd = "__plunoExtensionWidgetOwner";
1045
1045
  function Xd(t) {
@@ -1342,7 +1342,7 @@ class ro {
1342
1342
  n.skipStoredTransportIdentityCollisionCheck === !0
1343
1343
  ), s = new ro({
1344
1344
  ...e,
1345
- backendUrl: Hc(e.backendUrl ?? Zd),
1345
+ backendUrl: Fc(e.backendUrl ?? Zd),
1346
1346
  clientId: e.clientId ?? lu(),
1347
1347
  productVariant: e.productVariant ?? "customer_embedded",
1348
1348
  entrySurface: $c(e.entrySurface)
@@ -1520,7 +1520,7 @@ class ro {
1520
1520
  content: i,
1521
1521
  createdAt: (/* @__PURE__ */ new Date()).toISOString(),
1522
1522
  ...s.length > 0 ? { attachments: s } : {}
1523
- }, m = this.state.messages.some((E) => E.id === h.id || E.clientMessageId === r), g = this.state.isThinking, w = this.state.taskStatus, b = this.state.pendingMessageStatus, f = this.state.turnPhase, _ = this.state.messages, S = m ? this.state.messages : [
1523
+ }, m = this.state.messages.some((E) => E.id === h.id || E.clientMessageId === r), g = this.state.isThinking, w = this.state.taskStatus, y = this.state.pendingMessageStatus, f = this.state.turnPhase, _ = this.state.messages, S = m ? this.state.messages : [
1524
1524
  ...this.state.messages.map(
1525
1525
  (E) => c && E.id === c.id ? {
1526
1526
  ...E,
@@ -1581,13 +1581,13 @@ class ro {
1581
1581
  throw m || this.sessionHistoryManager.removeOptimistic(h.id), this.setState({
1582
1582
  ...m ? {} : { messages: _ },
1583
1583
  ...g ? {} : { ...v, isThinking: !1 },
1584
- pendingMessageStatus: b,
1584
+ pendingMessageStatus: y,
1585
1585
  turnPhase: f,
1586
1586
  taskStatus: w
1587
1587
  }), E;
1588
1588
  }
1589
1589
  this.retryableClientMessageId = null;
1590
- const U = !n.initiatedBy && this.options.capturePageContent !== !1 && this.lastUserMessagePageUrl !== a.url, B = {
1590
+ const D = !n.initiatedBy && this.options.capturePageContent !== !1 && this.lastUserMessagePageUrl !== a.url, B = {
1591
1591
  type: "chat.user_message",
1592
1592
  sessionId: this.state.sessionId ?? void 0,
1593
1593
  clientMessageId: r,
@@ -1596,7 +1596,7 @@ class ro {
1596
1596
  entrySurface: this.options.entrySurface,
1597
1597
  content: i,
1598
1598
  proactiveSuggestionQuestion: n.proactiveSuggestionQuestion,
1599
- pageContent: U && ao() || void 0,
1599
+ pageContent: D && ao() || void 0,
1600
1600
  attachments: o.length > 0 ? o.map(mi) : void 0,
1601
1601
  page: a,
1602
1602
  model: this.options.model,
@@ -1630,7 +1630,7 @@ class ro {
1630
1630
  const n = Qe(), i = {
1631
1631
  id: n,
1632
1632
  name: e.name || "attachment",
1633
- mimeType: Fs(e),
1633
+ mimeType: Ws(e),
1634
1634
  sizeBytes: e.size
1635
1635
  };
1636
1636
  this.attachmentFiles.set(n, e);
@@ -1664,7 +1664,7 @@ class ro {
1664
1664
  file: e,
1665
1665
  attachment: n
1666
1666
  }) {
1667
- const i = this.state.sessionId, s = Fs(e), o = {
1667
+ const i = this.state.sessionId, s = Ws(e), o = {
1668
1668
  sessionId: i ?? void 0,
1669
1669
  attachmentId: n.id,
1670
1670
  clientId: this.options.clientId,
@@ -1783,7 +1783,7 @@ class ro {
1783
1783
  for (const [n, i] of this.activeBrowserToolCalls)
1784
1784
  i.event.sessionId === this.state.sessionId && this.activeBrowserToolCalls.delete(n);
1785
1785
  Or(this.options.clientId, this.activeBrowserToolCalls.values()), this.setState({
1786
- messages: Dr(
1786
+ messages: Ur(
1787
1787
  this.state.messages,
1788
1788
  e.clientMessageId,
1789
1789
  e.runId
@@ -2067,7 +2067,7 @@ class ro {
2067
2067
  loadSession(e) {
2068
2068
  const n = Qe(), i = this.activeComposerWarmupId;
2069
2069
  this.state.sessionId && this.rememberSessionTimeline(this.state.sessionId, this.state.messages);
2070
- const s = this.getCachedSessionTimeline(e), o = [...s ?? []].reverse().find((r) => r.dataType === "assistant_draft" && r.steered !== !0), a = Uu(s ?? []);
2070
+ const s = this.getCachedSessionTimeline(e), o = [...s ?? []].reverse().find((r) => r.dataType === "assistant_draft" && r.steered !== !0), a = Du(s ?? []);
2071
2071
  !this.options.keepRunsActiveOnSessionNavigation && this.state.sessionId !== e && this.rememberCurrentRunAsDetached(), this.detachedSessionIds.delete(e), this.deferredDetachedSessionEvents.delete(e), !this.options.keepRunsActiveOnSessionNavigation && this.state.sessionId && (this.state.isThinking || this.state.pendingMessageStatus !== null) && this.send({ type: "run.stop", sessionId: this.state.sessionId, reason: "session_switch" }), this.options.keepRunsActiveOnSessionNavigation && (this.rememberCurrentRunAsBackground(), this.backgroundSessionIds.delete(e), this.deferredSessionUpdatedSessionIds.delete(e)), this.clearPendingComposerWarmup(), i && this.send({
2072
2072
  type: "session.reset",
2073
2073
  warmupId: i,
@@ -2391,7 +2391,7 @@ class ro {
2391
2391
  findStoppedTurnForEvent(e) {
2392
2392
  const n = e.type === "session.item" ? we(e.item) : null;
2393
2393
  return this.findStoppedTurn(
2394
- xt(e) ?? this.state.sessionId,
2394
+ It(e) ?? this.state.sessionId,
2395
2395
  n ?? e
2396
2396
  );
2397
2397
  }
@@ -2461,7 +2461,7 @@ class ro {
2461
2461
  this.pendingSessionSubscription = null, n.resolve(!1), i && (this.sessionHistoryHydration = null, this.handleServerEvent({ ...e, requestId: i.requestId }));
2462
2462
  return;
2463
2463
  }
2464
- if (this.sessionHistoryHydration && bn(e) && xt(e) === this.sessionHistoryHydration.sessionId) {
2464
+ if (this.sessionHistoryHydration && bn(e) && It(e) === this.sessionHistoryHydration.sessionId) {
2465
2465
  this.sessionHistoryHydration.bufferedEvents.push(e);
2466
2466
  return;
2467
2467
  }
@@ -2485,14 +2485,14 @@ class ro {
2485
2485
  if (e.type === "run.ack") {
2486
2486
  if (this.shouldIgnoreStoppedTurnEvent(e))
2487
2487
  return;
2488
- const n = xt(e), i = typeof e.clientMessageId == "string" ? e.clientMessageId : null, s = n ? this.deferredDetachedSessionEvents.get(n) ?? [] : [];
2488
+ const n = It(e), i = typeof e.clientMessageId == "string" ? e.clientMessageId : null, s = n ? this.deferredDetachedSessionEvents.get(n) ?? [] : [];
2489
2489
  n && this.deferredDetachedSessionEvents.delete(n), n && i && this.backgroundClientMessageIds.delete(i) ? (this.backgroundSessionIds.add(n), this.deferredSessionUpdatedSessionIds.delete(n)) : n && (i === this.activeClientMessageId || i === this.pendingClientMessageId) && this.deferredSessionUpdatedSessionIds.delete(n) && this.state.sessionId === null && this.setState({ sessionId: n }), this.handleRunAck(e);
2490
2490
  for (const o of s)
2491
2491
  this.handleServerEvent(o);
2492
2492
  return;
2493
2493
  }
2494
2494
  if (e.type === "session.updated" && this.options.keepRunsActiveOnSessionNavigation && this.state.sessionId === null && this.backgroundClientMessageIds.size > 0) {
2495
- const n = xt(e);
2495
+ const n = It(e);
2496
2496
  if (n) {
2497
2497
  this.deferredSessionUpdatedSessionIds.add(n);
2498
2498
  return;
@@ -2572,7 +2572,7 @@ class ro {
2572
2572
  clientMessageId: p?.clientMessageId,
2573
2573
  respondsToUserMessageId: J(c, "id"),
2574
2574
  runId: p?.runId
2575
- }), m = this.filterStoppedSnapshotItems(i, o), g = e.pendingMessageStatus === "sending" ? "sending" : e.pendingMessageStatus === "queued" ? "reconnecting" : null, w = typeof e.pendingClientMessageId == "string" ? e.pendingClientMessageId : null, b = e.isRetrying === !0, f = e.turnPhase === "sending" || e.turnPhase === "starting" || e.turnPhase === "thinking" ? e.turnPhase : null;
2575
+ }), m = this.filterStoppedSnapshotItems(i, o), g = e.pendingMessageStatus === "sending" ? "sending" : e.pendingMessageStatus === "queued" ? "reconnecting" : null, w = typeof e.pendingClientMessageId == "string" ? e.pendingClientMessageId : null, y = e.isRetrying === !0, f = e.turnPhase === "sending" || e.turnPhase === "starting" || e.turnPhase === "thinking" ? e.turnPhase : null;
2576
2576
  g && w && (this.pendingClientMessageId = w);
2577
2577
  let _ = wu(
2578
2578
  e.assistantDraft
@@ -2583,22 +2583,22 @@ class ro {
2583
2583
  }) && (_ = void 0);
2584
2584
  const S = _ !== void 0;
2585
2585
  this.rememberUserMessageClientMessageIds(m);
2586
- const v = Mu(m), U = m.filter((ie) => {
2586
+ const v = Mu(m), D = m.filter((ie) => {
2587
2587
  const G = we(ie);
2588
2588
  return Eu(G) ? !1 : !G || !v || !kn(G) ? !0 : Os(m, G) !== v;
2589
- }), E = Ds(
2589
+ }), E = Us(
2590
2590
  this.state.messages,
2591
- ys(U, this.options.backendUrl)
2592
- ), R = Pr(E), j = S ? _?.content ?? "" : this.state.assistantDraft, D = S ? _?.itemId ?? null : this.state.assistantDraftItemId, ee = S ? _?.respondsToUserMessageId ?? null : this.state.assistantDraftRespondsToUserMessageId, le = S ? _?.runId ?? null : this.state.assistantDraftRunId, te = m.some(
2591
+ ys(D, this.options.backendUrl)
2592
+ ), R = Pr(E), j = S ? _?.content ?? "" : this.state.assistantDraft, U = S ? _?.itemId ?? null : this.state.assistantDraftItemId, ee = S ? _?.respondsToUserMessageId ?? null : this.state.assistantDraftRespondsToUserMessageId, le = S ? _?.runId ?? null : this.state.assistantDraftRunId, te = m.some(
2593
2593
  (ie, G) => Rr(
2594
2594
  we(ie),
2595
2595
  j,
2596
- D,
2596
+ U,
2597
2597
  ee,
2598
2598
  le,
2599
2599
  Pu(m, G)
2600
2600
  )
2601
- ), Ee = S ? _?.content ?? "" : this.state.assistantDraft, We = !!_?.content && !te, O = R && (!Ee || te), re = ku(E), W = O && re ? "completed" : h ? "stopped" : O ? "failed" : null;
2601
+ ), Ee = S ? _?.content ?? "" : this.state.assistantDraft, He = !!_?.content && !te, O = R && (!Ee || te), re = ku(E), H = O && re ? "completed" : h ? "stopped" : O ? "failed" : null;
2602
2602
  if (!R && Au(this.state.messages, m))
2603
2603
  return;
2604
2604
  this.lastUserMessagePageUrl = Cu(m);
@@ -2614,9 +2614,9 @@ class ro {
2614
2614
  isLoadingSession: !1,
2615
2615
  ...g ? { pendingMessageStatus: g } : {},
2616
2616
  ...f ? { turnPhase: f } : {},
2617
- isRetrying: b,
2617
+ isRetrying: y,
2618
2618
  ...f ? { taskStatus: "working" } : {},
2619
- ...W && this.state.taskStatus === "working" ? { taskStatus: W } : {},
2619
+ ...H && this.state.taskStatus === "working" ? { taskStatus: H } : {},
2620
2620
  ...te ? {
2621
2621
  assistantDraft: "",
2622
2622
  assistantDraftItemId: null,
@@ -2630,7 +2630,7 @@ class ro {
2630
2630
  assistantDraftRespondsToUserMessageId: _?.respondsToUserMessageId ?? null,
2631
2631
  assistantDraftRunId: _?.runId ?? null
2632
2632
  } : {},
2633
- ...We ? {
2633
+ ...He ? {
2634
2634
  isThinking: !0,
2635
2635
  turnPhase: "thinking",
2636
2636
  lastError: null
@@ -2652,7 +2652,7 @@ class ro {
2652
2652
  } : {}
2653
2653
  }), O)
2654
2654
  this.retryableClientMessageId = v, this.clearThinkingWatchdog();
2655
- else if (!h && (We || ye)) {
2655
+ else if (!h && (He || ye)) {
2656
2656
  if (ye) {
2657
2657
  this.activeClientMessageId = ye;
2658
2658
  const ie = nn(m), G = ie === null ? null : m[ie];
@@ -2724,7 +2724,7 @@ class ro {
2724
2724
  this.state.assistantDraftItemId,
2725
2725
  this.state.assistantDraftRespondsToUserMessageId,
2726
2726
  this.state.assistantDraftRunId,
2727
- Fa(
2727
+ Wa(
2728
2728
  a,
2729
2729
  a.findIndex((h) => h.id === i.id)
2730
2730
  )
@@ -2796,7 +2796,7 @@ class ro {
2796
2796
  ),
2797
2797
  i,
2798
2798
  s,
2799
- Us
2799
+ Ds
2800
2800
  );
2801
2801
  this.setState({
2802
2802
  sessionId: n,
@@ -2889,7 +2889,7 @@ class ro {
2889
2889
  a && s && o && (this.retryableClientMessageId = o);
2890
2890
  const r = new Error(typeof e.message == "string" ? e.message : "Pluno error"), d = La(r.message);
2891
2891
  d && console.error(d);
2892
- const c = o ?? this.activeClientMessageId, p = typeof e.runId == "string" ? e.runId : null, h = Dr(
2892
+ const c = o ?? this.activeClientMessageId, p = typeof e.runId == "string" ? e.runId : null, h = Ur(
2893
2893
  this.state.messages,
2894
2894
  c,
2895
2895
  p
@@ -2936,7 +2936,7 @@ class ro {
2936
2936
  this.options.model = ai(i) ? i : "gpt-5.6-sol";
2937
2937
  }
2938
2938
  updateAccountFallbackFromSession(e) {
2939
- const n = e && typeof e == "object" ? e.metadata : null, i = Dd(n);
2939
+ const n = e && typeof e == "object" ? e.metadata : null, i = Ud(n);
2940
2940
  if (this.usingPaidCreditFallback !== i && (this.usingPaidCreditFallback = i, !!this.account)) {
2941
2941
  this.account = { ...this.account, usingPaidCreditFallback: i };
2942
2942
  for (const s of this.accountListeners) s(this.getAccount());
@@ -2945,13 +2945,13 @@ class ro {
2945
2945
  shouldIgnoreBackgroundSessionEvent(e) {
2946
2946
  if (!this.options.keepRunsActiveOnSessionNavigation || !bn(e))
2947
2947
  return !1;
2948
- const n = xt(e);
2948
+ const n = It(e);
2949
2949
  return n ? this.deferredSessionUpdatedSessionIds.has(n) ? !0 : this.state.sessionId ? n !== this.state.sessionId : this.backgroundSessionIds.has(n) : !1;
2950
2950
  }
2951
2951
  updateInactiveSessionTimelineCache(e) {
2952
2952
  if (!bn(e))
2953
2953
  return;
2954
- const n = xt(e);
2954
+ const n = It(e);
2955
2955
  if (!n || n === this.state.sessionId)
2956
2956
  return;
2957
2957
  const i = this.sessionTimelineCache.get(n);
@@ -2964,7 +2964,7 @@ class ro {
2964
2964
  );
2965
2965
  (i || o.length > 0) && this.rememberSessionTimeline(
2966
2966
  n,
2967
- i ? Ds(i, o) : o
2967
+ i ? Us(i, o) : o
2968
2968
  );
2969
2969
  return;
2970
2970
  }
@@ -3026,7 +3026,7 @@ class ro {
3026
3026
  ),
3027
3027
  s,
3028
3028
  o,
3029
- Us
3029
+ Ds
3030
3030
  );
3031
3031
  this.rememberSessionTimeline(
3032
3032
  n,
@@ -3045,7 +3045,7 @@ class ro {
3045
3045
  return;
3046
3046
  this.rememberSessionTimeline(
3047
3047
  n,
3048
- Ur(
3048
+ Dr(
3049
3049
  i,
3050
3050
  s,
3051
3051
  null,
@@ -3063,13 +3063,13 @@ class ro {
3063
3063
  shouldIgnoreDetachedSessionEvent(e) {
3064
3064
  if (this.options.keepRunsActiveOnSessionNavigation || !bn(e))
3065
3065
  return !1;
3066
- const n = xt(e);
3066
+ const n = It(e);
3067
3067
  return !!(n && this.detachedSessionIds.has(n));
3068
3068
  }
3069
3069
  shouldDeferDetachedSessionEvent(e) {
3070
3070
  if (this.options.keepRunsActiveOnSessionNavigation || e.type === "run.ack" || !bn(e))
3071
3071
  return !1;
3072
- const n = xt(e);
3072
+ const n = It(e);
3073
3073
  if (!n || n === this.state.sessionId || this.detachedClientMessageIds.size === 0 && !this.deferredDetachedSessionEvents.has(n))
3074
3074
  return !1;
3075
3075
  const i = this.deferredDetachedSessionEvents.get(n) ?? [];
@@ -3248,7 +3248,7 @@ class ro {
3248
3248
  if (this.state.isThinking && n) {
3249
3249
  const o = this.state.assistantDraftRespondsToUserMessageId !== null && this.state.assistantDraftRespondsToUserMessageId !== n;
3250
3250
  this.setState({
3251
- messages: Ur(
3251
+ messages: Dr(
3252
3252
  this.state.messages,
3253
3253
  n,
3254
3254
  i,
@@ -3299,7 +3299,7 @@ class ro {
3299
3299
  reason: "missing_client_message_id"
3300
3300
  }), this.setState({
3301
3301
  messages: this.state.messages.filter(
3302
- (i) => !At(i)
3302
+ (i) => !Et(i)
3303
3303
  ),
3304
3304
  isThinking: !1,
3305
3305
  taskStatus: "failed",
@@ -3379,7 +3379,7 @@ class ro {
3379
3379
  let c = null, p;
3380
3380
  c = await this.executeRuntimeHelper(), p = await vr(
3381
3381
  a,
3382
- Fc(e.runtimeContext, this.options.backendUrl)
3382
+ Wc(e.runtimeContext, this.options.backendUrl)
3383
3383
  ).catch((h) => ({
3384
3384
  ok: !1,
3385
3385
  exception: {
@@ -3407,7 +3407,7 @@ class ro {
3407
3407
  if (this.pageLifecycleCleanup)
3408
3408
  return;
3409
3409
  const e = () => {
3410
- Ha(this.options.clientId, this.activeBrowserToolCalls.values());
3410
+ Fa(this.options.clientId, this.activeBrowserToolCalls.values());
3411
3411
  };
3412
3412
  window.addEventListener("pagehide", e), window.addEventListener("beforeunload", e), this.pageLifecycleCleanup = () => {
3413
3413
  window.removeEventListener("pagehide", e), window.removeEventListener("beforeunload", e);
@@ -3576,7 +3576,7 @@ function Cc() {
3576
3576
  }
3577
3577
  });
3578
3578
  }, n = window.fetch, i = XMLHttpRequest.prototype.open, s = XMLHttpRequest.prototype.setRequestHeader, o = XMLHttpRequest.prototype.send, a = function(g, w) {
3579
- const b = Date.now();
3579
+ const y = Date.now();
3580
3580
  let f;
3581
3581
  try {
3582
3582
  f = n.call(this, g, w);
@@ -3593,15 +3593,15 @@ function Cc() {
3593
3593
  requestHeaders: v,
3594
3594
  requestBody: zr(w?.body),
3595
3595
  resourceType: "fetch",
3596
- startedAt: new Date(b).toISOString()
3596
+ startedAt: new Date(y).toISOString()
3597
3597
  };
3598
3598
  f.then(
3599
3599
  (E) => {
3600
- ap(E, B, b, e).catch(() => {
3600
+ ap(E, B, y, e).catch(() => {
3601
3601
  e({
3602
3602
  ...B,
3603
3603
  responseStatus: E.status,
3604
- durationMs: Date.now() - b
3604
+ durationMs: Date.now() - y
3605
3605
  });
3606
3606
  });
3607
3607
  },
@@ -3609,7 +3609,7 @@ function Cc() {
3609
3609
  e({
3610
3610
  ...B,
3611
3611
  errorText: gt(E instanceof Error ? E.message : String(E)),
3612
- durationMs: Date.now() - b
3612
+ durationMs: Date.now() - y
3613
3613
  });
3614
3614
  }
3615
3615
  );
@@ -3617,8 +3617,8 @@ function Cc() {
3617
3617
  } catch {
3618
3618
  }
3619
3619
  return f;
3620
- }, r = function(g, w, b, f, _) {
3621
- const S = i.call(this, g, w, b ?? !0, f ?? void 0, _ ?? void 0), v = typeof w == "string" ? w : w.toString();
3620
+ }, r = function(g, w, y, f, _) {
3621
+ const S = i.call(this, g, w, y ?? !0, f ?? void 0, _ ?? void 0), v = typeof w == "string" ? w : w.toString();
3622
3622
  return fs.set(this, {
3623
3623
  requestId: bs("xhr"),
3624
3624
  method: String(g ?? "GET").toUpperCase(),
@@ -3629,8 +3629,8 @@ function Cc() {
3629
3629
  excluded: Qt(v)
3630
3630
  }), S;
3631
3631
  }, d = function(g, w) {
3632
- const b = s.call(this, g, w), f = fs.get(this);
3633
- return f && Object.keys(f.requestHeaders).length < oo && (f.requestHeaders[g] = uo(g, w), f.excluded = f.excluded || Qt(f.url, f.requestHeaders)), b;
3632
+ const y = s.call(this, g, w), f = fs.get(this);
3633
+ return f && Object.keys(f.requestHeaders).length < oo && (f.requestHeaders[g] = uo(g, w), f.excluded = f.excluded || Qt(f.url, f.requestHeaders)), y;
3634
3634
  }, c = function(g) {
3635
3635
  try {
3636
3636
  const w = fs.get(this);
@@ -3639,7 +3639,7 @@ function Cc() {
3639
3639
  () => {
3640
3640
  queueMicrotask(() => {
3641
3641
  try {
3642
- const b = gp(this.getAllResponseHeaders());
3642
+ const y = gp(this.getAllResponseHeaders());
3643
3643
  e({
3644
3644
  requestId: w.requestId,
3645
3645
  url: w.url,
@@ -3648,8 +3648,8 @@ function Cc() {
3648
3648
  requestBody: w.requestBody,
3649
3649
  resourceType: "xhr",
3650
3650
  responseStatus: this.status,
3651
- responseHeaders: b,
3652
- responseBody: dp(this, b),
3651
+ responseHeaders: y,
3652
+ responseBody: dp(this, y),
3653
3653
  errorText: this.status === 0 ? "XHR request failed or was aborted" : void 0,
3654
3654
  startedAt: w.startedAt,
3655
3655
  durationMs: Date.now() - w.startedAtMs
@@ -3688,14 +3688,14 @@ function Cc() {
3688
3688
  const w = g;
3689
3689
  if (w.initiatorType === "fetch" || w.initiatorType === "xmlhttprequest" || Qt(w.name))
3690
3690
  continue;
3691
- const b = performance.timeOrigin + w.startTime;
3691
+ const y = performance.timeOrigin + w.startTime;
3692
3692
  e({
3693
3693
  requestId: bs("resource"),
3694
3694
  url: gt(w.name, hs),
3695
3695
  method: "GET",
3696
3696
  resourceType: "resource",
3697
3697
  responseStatus: w.responseStatus,
3698
- startedAt: new Date(b).toISOString(),
3698
+ startedAt: new Date(y).toISOString(),
3699
3699
  durationMs: w.duration
3700
3700
  });
3701
3701
  }
@@ -3751,7 +3751,7 @@ function Ec(t) {
3751
3751
  function bn(t) {
3752
3752
  return t.type === "run.steered" || t.type === "run.ack" || t.type === "run.model_started" || t.type === "conversation.state" || t.type === "scheduled_follow_ups.updated" || t.type === "session.updated" || t.type === "session.item" || t.type === "chat.assistant_delta" || t.type === "chat.assistant_done" || t.type === "tool.call" || t.type === "tool.status" || t.type === "error" && typeof t.requestId != "string";
3753
3753
  }
3754
- function xt(t) {
3754
+ function It(t) {
3755
3755
  if (typeof t.sessionId == "string")
3756
3756
  return t.sessionId;
3757
3757
  if (t.session && typeof t.session == "object") {
@@ -3782,11 +3782,11 @@ function Rc() {
3782
3782
  }
3783
3783
  function Lc() {
3784
3784
  return _a(globalThis, "pageImages", {
3785
- inspectImage: async (e, n) => await Dc(e, n)
3785
+ inspectImage: async (e, n) => await Uc(e, n)
3786
3786
  });
3787
3787
  }
3788
- async function Dc(t, e = {}) {
3789
- const n = qc(e.name), i = await Uc(t);
3788
+ async function Uc(t, e = {}) {
3789
+ const n = qc(e.name), i = await Dc(t);
3790
3790
  return i.ok ? i.sizeBytes > 8 * 1024 * 1024 ? {
3791
3791
  type: "pluno.pageImages.inspectImage",
3792
3792
  imageAttached: !1,
@@ -3804,7 +3804,7 @@ async function Dc(t, e = {}) {
3804
3804
  imageAttachmentError: i.error
3805
3805
  };
3806
3806
  }
3807
- async function Uc(t) {
3807
+ async function Dc(t) {
3808
3808
  return t instanceof Blob ? t.type.startsWith("image/") ? t.size === 0 ? { ok: !1, error: "Page image is empty." } : t.size > 8 * 1024 * 1024 ? { ok: !1, error: Pa } : {
3809
3809
  ok: !0,
3810
3810
  mimeType: t.type,
@@ -3878,7 +3878,7 @@ async function vr(t, e) {
3878
3878
  a = window.setTimeout(() => h(c), i);
3879
3879
  })
3880
3880
  ]);
3881
- return p === c ? Wc(i) : {
3881
+ return p === c ? Hc(i) : {
3882
3882
  ok: !0,
3883
3883
  result: p,
3884
3884
  console: o,
@@ -3907,7 +3907,7 @@ async function vr(t, e) {
3907
3907
  e?.deactivate(), a !== void 0 && window.clearTimeout(a), console.log = r.log, console.info = r.info, console.warn = r.warn, console.error = r.error;
3908
3908
  }
3909
3909
  }
3910
- function Fc(t, e) {
3910
+ function Wc(t, e) {
3911
3911
  if (!t || typeof t != "object")
3912
3912
  return;
3913
3913
  const n = t.sandboxFilesToken;
@@ -3951,7 +3951,7 @@ function Fc(t, e) {
3951
3951
  }
3952
3952
  };
3953
3953
  }
3954
- function Wc(t) {
3954
+ function Hc(t) {
3955
3955
  return {
3956
3956
  ok: !1,
3957
3957
  exception: {
@@ -3965,7 +3965,7 @@ function Wc(t) {
3965
3965
  }
3966
3966
  };
3967
3967
  }
3968
- function Hc(t) {
3968
+ function Fc(t) {
3969
3969
  return t.replace(/\/+$/, "");
3970
3970
  }
3971
3971
  function $c(t) {
@@ -4032,19 +4032,19 @@ function ms() {
4032
4032
  function ao() {
4033
4033
  if (!document.body)
4034
4034
  return "";
4035
- const t = [], e = [], n = (b, f) => {
4035
+ const t = [], e = [], n = (y, f) => {
4036
4036
  const _ = tn(f);
4037
- !_ || e.includes(_) || (t.push([b, _]), e.push(_));
4037
+ !_ || e.includes(_) || (t.push([y, _]), e.push(_));
4038
4038
  };
4039
4039
  n("Selected text", window.getSelection()?.toString() ?? "");
4040
4040
  const i = "[role='dialog'], [role='alertdialog'], dialog[open], [aria-modal='true']", s = Array.from(document.querySelectorAll(i)).filter(
4041
- (b) => Da(b) && !b.parentElement?.closest(i)
4041
+ (y) => Ua(y) && !y.parentElement?.closest(i)
4042
4042
  );
4043
- for (const b of s.slice(0, 3))
4044
- n("Active overlay", ws(Tn(b), e));
4043
+ for (const y of s.slice(0, 3))
4044
+ n("Active overlay", ws(Tn(y), e));
4045
4045
  const o = Xc(), a = o ? ws(Tn(o), e) : "";
4046
4046
  n("Main page content", a), n("Additional visible page text", ws(Tn(document.body), e));
4047
- const r = t.map(([b, f]) => `${b}:
4047
+ const r = t.map(([y, f]) => `${y}:
4048
4048
  ${f}`).join(`
4049
4049
 
4050
4050
  `).trim().slice(0, 12e3), d = Qc(s, o).trim(), c = `Simplified DOM outline:
@@ -4071,12 +4071,12 @@ function ws(t, e) {
4071
4071
  n = n.replace(i, "");
4072
4072
  return tn(n);
4073
4073
  }
4074
- function Da(t) {
4074
+ function Ua(t) {
4075
4075
  const e = window.getComputedStyle(t);
4076
4076
  return e.display !== "none" && e.visibility !== "hidden" && t.getClientRects().length > 0;
4077
4077
  }
4078
4078
  function Xc() {
4079
- return Array.from(document.querySelectorAll("main, [role='main'], article")).filter(Da).sort((t, e) => Tn(e).length - Tn(t).length)[0] ?? null;
4079
+ return Array.from(document.querySelectorAll("main, [role='main'], article")).filter(Ua).sort((t, e) => Tn(e).length - Tn(t).length)[0] ?? null;
4080
4080
  }
4081
4081
  function Qc(t, e) {
4082
4082
  const n = /* @__PURE__ */ new Set([
@@ -4162,47 +4162,47 @@ function Qc(t, e) {
4162
4162
  e && m.add(e);
4163
4163
  let g = 0;
4164
4164
  const w = (v) => {
4165
- const U = v.getAttribute("role");
4166
- return U && !a.has(U) ? U : "";
4167
- }, b = (v) => {
4168
- const U = v.getAttribute("data-testid") || v.getAttribute("data-test") || v.getAttribute("data-qa") || v.getAttribute("data-cy") || "";
4169
- return `${v.tagName.toLowerCase()}|${w(v)}|${U}`;
4170
- }, f = (v, U, B) => {
4165
+ const D = v.getAttribute("role");
4166
+ return D && !a.has(D) ? D : "";
4167
+ }, y = (v) => {
4168
+ const D = v.getAttribute("data-testid") || v.getAttribute("data-test") || v.getAttribute("data-qa") || v.getAttribute("data-cy") || "";
4169
+ return `${v.tagName.toLowerCase()}|${w(v)}|${D}`;
4170
+ }, f = (v, D, B) => {
4171
4171
  const E = (R, j) => {
4172
- const D = R.tagName.toLowerCase(), ee = window.getComputedStyle(R), le = p.has(R);
4173
- if (g >= 1e3 && !le || B.has(R) || o.has(D) || R.matches(".pluno-pa-widget-host, [data-pluno-product-agent-widget]") || ee.display === "none" || ee.visibility === "hidden")
4172
+ const U = R.tagName.toLowerCase(), ee = window.getComputedStyle(R), le = p.has(R);
4173
+ if (g >= 1e3 && !le || B.has(R) || o.has(U) || R.matches(".pluno-pa-widget-host, [data-pluno-product-agent-widget]") || ee.display === "none" || ee.visibility === "hidden")
4174
4174
  return { lines: [], hasUsefulContent: !1, textPreview: "", containsTextElement: !1 };
4175
4175
  g += 1;
4176
- const te = w(R), Ee = Na(R), We = r.has(te) || ["button", "input", "textarea", "select", "iframe", "canvas"].includes(D) || D === "a" && R.hasAttribute("href"), O = Array.from(R.children).filter((L) => L instanceof HTMLElement), re = /* @__PURE__ */ new Map();
4176
+ const te = w(R), Ee = Na(R), He = r.has(te) || ["button", "input", "textarea", "select", "iframe", "canvas"].includes(U) || U === "a" && R.hasAttribute("href"), O = Array.from(R.children).filter((L) => L instanceof HTMLElement), re = /* @__PURE__ */ new Map();
4177
4177
  for (const L of O) {
4178
- const Y = b(L);
4178
+ const Y = y(L);
4179
4179
  re.set(Y, (re.get(Y) ?? 0) + 1);
4180
4180
  }
4181
- const T = /* @__PURE__ */ new Map(), W = /* @__PURE__ */ new Map();
4181
+ const T = /* @__PURE__ */ new Map(), H = /* @__PURE__ */ new Map();
4182
4182
  for (const L of O) {
4183
- const Y = b(L), _e = W.get(Y) ?? 0;
4184
- W.set(Y, _e + 1), (re.get(Y) ?? 0) > 8 && _e >= 6 && !p.has(L) && T.set(Y, (T.get(Y) ?? 0) + 1);
4183
+ const Y = y(L), _e = H.get(Y) ?? 0;
4184
+ H.set(Y, _e + 1), (re.get(Y) ?? 0) > 8 && _e >= 6 && !p.has(L) && T.set(Y, (T.get(Y) ?? 0) + 1);
4185
4185
  }
4186
- const ye = /* @__PURE__ */ new Map(), ie = /* @__PURE__ */ new Set(), G = [], H = [];
4186
+ const ye = /* @__PURE__ */ new Map(), ie = /* @__PURE__ */ new Set(), G = [], F = [];
4187
4187
  for (const L of O) {
4188
- const Y = b(L), _e = re.get(Y) ?? 0, Ue = ye.get(Y) ?? 0;
4189
- if (ye.set(Y, Ue + 1), _e > 8 && Ue >= 6 && !p.has(L)) {
4188
+ const Y = y(L), _e = re.get(Y) ?? 0, De = ye.get(Y) ?? 0;
4189
+ if (ye.set(Y, De + 1), _e > 8 && De >= 6 && !p.has(L)) {
4190
4190
  ie.has(Y) || (G.push([`… ${T.get(Y) ?? 0} similar siblings omitted`]), ie.add(Y));
4191
4191
  continue;
4192
4192
  }
4193
4193
  const x = E(L, j);
4194
- H.push(x), G.push(x.lines);
4194
+ F.push(x), G.push(x.lines);
4195
4195
  }
4196
4196
  const Ae = [];
4197
4197
  if (R.shadowRoot)
4198
4198
  for (const L of Array.from(R.shadowRoot.children))
4199
4199
  L instanceof HTMLElement && Ae.push(E(L, j + 1));
4200
- const Z = [...H, ...Ae], F = Ee.length > 0 || We || Z.some((L) => L.hasUsefulContent), Me = tn(
4200
+ const Z = [...F, ...Ae], W = Ee.length > 0 || He || Z.some((L) => L.hasUsefulContent), Me = tn(
4201
4201
  [Ee, ...Z.map((L) => L.textPreview)].filter(Boolean).join(" ")
4202
- ).slice(0, 180), He = R.hasAttribute("contenteditable") && (Ee.length > 0 || !R.querySelector("[contenteditable]")), ot = c.some((L) => R.hasAttribute(L)) || !!te || He, $e = (R.getClientRects().length > 0 || ee.display === "contents") && (n.has(D) || ot || le) && (F || le) && (!s.has(D) || F || ot || le), N = $e ? 1 : 0, be = [];
4202
+ ).slice(0, 180), Fe = R.hasAttribute("contenteditable") && (Ee.length > 0 || !R.querySelector("[contenteditable]")), ot = c.some((L) => R.hasAttribute(L)) || !!te || Fe, $e = (R.getClientRects().length > 0 || ee.display === "contents") && (n.has(U) || ot || le) && (W || le) && (!s.has(U) || W || ot || le), N = $e ? 1 : 0, be = [];
4203
4203
  if ($e) {
4204
- const L = Z.some((_e) => _e.containsTextElement), Y = i.has(D) && !L ? Me : Ee;
4205
- be.push(Ua(R, d, a, Y.slice(0, 180)));
4204
+ const L = Z.some((_e) => _e.containsTextElement), Y = i.has(U) && !L ? Me : Ee;
4205
+ be.push(Da(R, d, a, Y.slice(0, 180)));
4206
4206
  }
4207
4207
  for (const L of G)
4208
4208
  be.push(...Zn(L, N));
@@ -4210,21 +4210,21 @@ function Qc(t, e) {
4210
4210
  if (pe.length > 0) {
4211
4211
  const L = pe.slice(0, 20);
4212
4212
  pe.length > L.length && L.push("… shadow DOM omitted");
4213
- const Y = D.includes("tooltip") || D.includes("popper") || D.includes("loader");
4213
+ const Y = U.includes("tooltip") || U.includes("popper") || U.includes("loader");
4214
4214
  if (j < 2 && !Y) {
4215
- const _e = $e ? "#shadow-root" : `${D} #shadow-root`;
4215
+ const _e = $e ? "#shadow-root" : `${U} #shadow-root`;
4216
4216
  be.push(...Zn([_e, ...Zn(L, 1)], N));
4217
4217
  } else
4218
4218
  be.push(...Zn(L, N));
4219
4219
  }
4220
4220
  return {
4221
4221
  lines: be,
4222
- hasUsefulContent: F,
4222
+ hasUsefulContent: W,
4223
4223
  textPreview: Me,
4224
- containsTextElement: i.has(D) || Z.some((L) => L.containsTextElement)
4224
+ containsTextElement: i.has(U) || Z.some((L) => L.containsTextElement)
4225
4225
  };
4226
4226
  };
4227
- return [`--- ${U} ---`, ...E(v, 0).lines].join(`
4227
+ return [`--- ${D} ---`, ...E(v, 0).lines].join(`
4228
4228
  `);
4229
4229
  }, _ = [], S = tn(window.getSelection()?.toString() ?? "");
4230
4230
  S && _.push(`--- selected text ---
@@ -4239,7 +4239,7 @@ ${JSON.stringify(S)}`), h.length > 0 && _.push(Zc(h, n, d, a));
4239
4239
 
4240
4240
  `);
4241
4241
  }
4242
- function Ua(t, e, n, i) {
4242
+ function Da(t, e, n, i) {
4243
4243
  const s = t.tagName.toLowerCase();
4244
4244
  let o = s;
4245
4245
  const a = t.getAttribute("id");
@@ -4310,7 +4310,7 @@ function Zc(t, e, n, i) {
4310
4310
  const h = r.getRootNode();
4311
4311
  r = r.parentElement ?? (h instanceof ShadowRoot && h.host instanceof HTMLElement ? h.host : null);
4312
4312
  }
4313
- const d = a.length > 6 ? [a[0], ...a.slice(-5)] : a, c = d.map((p, h) => Ua(
4313
+ const d = a.length > 6 ? [a[0], ...a.slice(-5)] : a, c = d.map((p, h) => Da(
4314
4314
  p,
4315
4315
  n,
4316
4316
  i,
@@ -4854,7 +4854,7 @@ function _u(t, e) {
4854
4854
  const i = (o) => o.id === `transient-activity:${e.callId}` && o.callId === e.callId || n && o.id.startsWith("transient-activity:") && o.toolName === "browser_tabs" && !!o.runId && o.runId === e.runId, s = t.findIndex(i);
4855
4855
  return s === -1 ? t : t.flatMap((o, a) => i(o) ? a === s ? [e] : [] : o.id === e.id ? [] : [o]);
4856
4856
  }
4857
- function Ds(t, e) {
4857
+ function Us(t, e) {
4858
4858
  const n = [];
4859
4859
  for (const i of e) {
4860
4860
  const s = [...t, ...n];
@@ -4868,7 +4868,7 @@ function Ds(t, e) {
4868
4868
  return fd(
4869
4869
  t,
4870
4870
  n,
4871
- Us
4871
+ Ds
4872
4872
  );
4873
4873
  }
4874
4874
  function Su(t, e) {
@@ -4877,7 +4877,7 @@ function Su(t, e) {
4877
4877
  );
4878
4878
  for (const o of i)
4879
4879
  n.set(o.id, o);
4880
- const s = Ds(
4880
+ const s = Us(
4881
4881
  t,
4882
4882
  [...n.values()]
4883
4883
  );
@@ -4892,8 +4892,8 @@ function Su(t, e) {
4892
4892
  }
4893
4893
  return s;
4894
4894
  }
4895
- function Us(t) {
4896
- const e = Wt(t) ?? void 0, n = t.assistantDraftItemId, i = t.dataType === "function_call_output" || t.dataType === "scheduled_check_in", s = [
4895
+ function Ds(t) {
4896
+ const e = Ht(t) ?? void 0, n = t.assistantDraftItemId, i = t.dataType === "function_call_output" || t.dataType === "scheduled_check_in", s = [
4897
4897
  // Output-backed cards and their visible calls are separate durable rows. A distinct key keeps activity hydration
4898
4898
  // from substituting the call for its output and then appending a duplicate output at the end of the timeline.
4899
4899
  ...t.callId ? [`${i ? "call-output" : "call"}:${t.callId}`] : [],
@@ -4923,7 +4923,7 @@ function qa(t, e) {
4923
4923
  const i = e.attachments.map((a) => {
4924
4924
  const r = vu(n.attachments ?? [], a);
4925
4925
  return r ? Iu(a, r) : a;
4926
- }), s = { ...e, attachments: i }, o = Wt(e);
4926
+ }), s = { ...e, attachments: i }, o = Ht(e);
4927
4927
  return o && Object.defineProperty(s, "clientMessageId", {
4928
4928
  value: o,
4929
4929
  enumerable: !1
@@ -4948,13 +4948,13 @@ function xu(t, e) {
4948
4948
  return i.splice(n, 1), i;
4949
4949
  }
4950
4950
  function za(t, e) {
4951
- const n = Wt(t), i = Wt(e);
4951
+ const n = Ht(t), i = Ht(e);
4952
4952
  return n && i ? n === i : t.content === e.content;
4953
4953
  }
4954
4954
  function Ti(t) {
4955
4955
  return t.role === "user" && (t.id.startsWith("local-") || t.id.startsWith("optimistic-user-message:"));
4956
4956
  }
4957
- function Wt(t) {
4957
+ function Ht(t) {
4958
4958
  const e = t.clientMessageId;
4959
4959
  if (e)
4960
4960
  return e;
@@ -4990,7 +4990,7 @@ function Pr(t) {
4990
4990
  function Tu(t, e, n) {
4991
4991
  const i = new Set(
4992
4992
  t.filter(
4993
- (s) => s.role === "user" && e !== null && Wt(s) === e
4993
+ (s) => s.role === "user" && e !== null && Ht(s) === e
4994
4994
  ).map((s) => s.id)
4995
4995
  );
4996
4996
  return t.some((s, o) => {
@@ -5001,7 +5001,7 @@ function Tu(t, e, n) {
5001
5001
  if (n && s.runId === n) {
5002
5002
  if (i.size === 0)
5003
5003
  return !0;
5004
- const a = Fa(t, o);
5004
+ const a = Wa(t, o);
5005
5005
  return !s.respondsToUserMessageId && a !== null && i.has(a);
5006
5006
  }
5007
5007
  return !1;
@@ -5133,7 +5133,7 @@ function Pu(t, e) {
5133
5133
  }
5134
5134
  return null;
5135
5135
  }
5136
- function Fa(t, e) {
5136
+ function Wa(t, e) {
5137
5137
  for (let n = e - 1; n >= 0; n -= 1)
5138
5138
  if (t[n].role === "user")
5139
5139
  return t[n].id;
@@ -5155,18 +5155,18 @@ function Lu(t) {
5155
5155
  return e.type === "message" && e.role === "user" ? !1 : e.type === "message" || e.type === "function_call" || e.type === "function_call_output" || e.type === "run_error" || e.type === "run_status";
5156
5156
  }
5157
5157
  function qs(t) {
5158
- return t.filter((e, n) => At(e) ? !Gu(t, n) && !Wa(t, n) && !$u(t, n) && !ju(t, n) : Du(e) ? e.retryable === !0 && Hu(t, n) ? !1 : !Wu(t, n) : !0);
5158
+ return t.filter((e, n) => Et(e) ? !Gu(t, n) && !Ha(t, n) && !$u(t, n) && !ju(t, n) : Uu(e) ? e.retryable === !0 && Fu(t, n) ? !1 : !Hu(t, n) : !0);
5159
5159
  }
5160
- function Du(t) {
5160
+ function Uu(t) {
5161
5161
  return t.role === "system" && (t.dataType === "run_error" || t.dataType === "run_status" && t.steered !== !0);
5162
5162
  }
5163
- function At(t) {
5163
+ function Et(t) {
5164
5164
  return t.role === "system" && t.dataType === "run_status" && t.loading === !0;
5165
5165
  }
5166
5166
  function zs(t) {
5167
5167
  return t.steered !== !0 && (t.dataType === "assistant_draft" || t.loading === !0);
5168
5168
  }
5169
- function Uu(t) {
5169
+ function Du(t) {
5170
5170
  return t.some(zs);
5171
5171
  }
5172
5172
  function Lr(t, e) {
@@ -5174,16 +5174,16 @@ function Lr(t, e) {
5174
5174
  }
5175
5175
  function Nu(t, e) {
5176
5176
  const n = [...t].reverse().find(zs), i = typeof e.respondsToUserMessageId == "string" ? e.respondsToUserMessageId : n?.respondsToUserMessageId ?? null, s = typeof e.runId == "string" ? e.runId : n?.runId ?? null;
5177
- return t.flatMap((o) => (i ? o.respondsToUserMessageId === i || !o.respondsToUserMessageId && s !== null && o.runId === s : s ? o.runId === s : zs(o)) ? o.dataType === "assistant_draft" || At(o) ? [] : o.loading === !0 ? [{ ...o, loading: !1 }] : [o] : [o]);
5177
+ return t.flatMap((o) => (i ? o.respondsToUserMessageId === i || !o.respondsToUserMessageId && s !== null && o.runId === s : s ? o.runId === s : zs(o)) ? o.dataType === "assistant_draft" || Et(o) ? [] : o.loading === !0 ? [{ ...o, loading: !1 }] : [o] : [o]);
5178
5178
  }
5179
5179
  function Ou(t, e, n, i) {
5180
5180
  const s = t.findIndex(
5181
- (d, c) => At(d) && !Wa(t, c)
5181
+ (d, c) => Et(d) && !Ha(t, c)
5182
5182
  ), o = s === -1 ? null : t[s], a = e ?? o?.respondsToUserMessageId ?? null, r = a ? t.find(
5183
5183
  (d) => d.role === "user" && d.id === a
5184
5184
  ) : null;
5185
5185
  return {
5186
- clientMessageId: r ? Wt(r) : a ? null : i,
5186
+ clientMessageId: r ? Ht(r) : a ? null : i,
5187
5187
  respondsToUserMessageId: a,
5188
5188
  runId: n ?? o?.runId ?? null
5189
5189
  };
@@ -5194,17 +5194,17 @@ function di(t) {
5194
5194
  function qu(t, e) {
5195
5195
  return ft(e) ? "completed" : di(t) ? "stopped" : !kn(t) && (t?.type === "run_error" || t?.type === "run_status" && (t.status === "failed" || t.status === "interrupted")) ? "failed" : null;
5196
5196
  }
5197
- function Dr(t, e, n) {
5197
+ function Ur(t, e, n) {
5198
5198
  const i = new Set(
5199
5199
  t.filter(
5200
- (s) => s.role === "user" && e !== null && Wt(s) === e
5200
+ (s) => s.role === "user" && e !== null && Ht(s) === e
5201
5201
  ).map((s) => s.id)
5202
5202
  );
5203
5203
  return t.filter(
5204
- (s) => !At(s) || (i.size > 0 ? !s.respondsToUserMessageId || !i.has(s.respondsToUserMessageId) : !n || s.runId !== n)
5204
+ (s) => !Et(s) || (i.size > 0 ? !s.respondsToUserMessageId || !i.has(s.respondsToUserMessageId) : !n || s.runId !== n)
5205
5205
  );
5206
5206
  }
5207
- function Wa(t, e) {
5207
+ function Ha(t, e) {
5208
5208
  return t.some(
5209
5209
  (n, i) => i !== e && n.role === "system" && (n.dataType === "run_error" || n.dataType === "run_status" && n.loading !== !0 && n.steered !== !0) && zu(
5210
5210
  t,
@@ -5224,9 +5224,9 @@ function zu(t, e, n) {
5224
5224
  return t[o].id === i.respondsToUserMessageId;
5225
5225
  return !1;
5226
5226
  }
5227
- function Ur(t, e, n, i) {
5227
+ function Dr(t, e, n, i) {
5228
5228
  const s = (n && n !== e ? n : null) ?? [...t].reverse().find(
5229
- (d) => d.respondsToUserMessageId !== void 0 && d.respondsToUserMessageId !== e && Nr(d) && !Fu(
5229
+ (d) => d.respondsToUserMessageId !== void 0 && d.respondsToUserMessageId !== e && Nr(d) && !Wu(
5230
5230
  t,
5231
5231
  d.respondsToUserMessageId
5232
5232
  )
@@ -5271,14 +5271,14 @@ function Bu(t, e) {
5271
5271
  return null;
5272
5272
  }
5273
5273
  function Nr(t) {
5274
- return t.role === "tool" || At(t) ? !0 : t.role === "assistant" && t.phase === "commentary";
5274
+ return t.role === "tool" || Et(t) ? !0 : t.role === "assistant" && t.phase === "commentary";
5275
5275
  }
5276
- function Fu(t, e) {
5276
+ function Wu(t, e) {
5277
5277
  return t.some(
5278
5278
  (n) => n.respondsToUserMessageId === e && (ft(n) || n.role === "system" && (n.dataType === "run_error" || n.dataType === "run_status" && n.loading !== !0))
5279
5279
  );
5280
5280
  }
5281
- function Wu(t, e) {
5281
+ function Hu(t, e) {
5282
5282
  const n = t[e];
5283
5283
  for (let i = e + 1; i < t.length; i += 1) {
5284
5284
  const s = t[i];
@@ -5287,7 +5287,7 @@ function Wu(t, e) {
5287
5287
  }
5288
5288
  return !1;
5289
5289
  }
5290
- function Hu(t, e) {
5290
+ function Fu(t, e) {
5291
5291
  const n = t[e];
5292
5292
  if (!n.respondsToUserMessageId)
5293
5293
  return !1;
@@ -5295,7 +5295,7 @@ function Hu(t, e) {
5295
5295
  const s = t[i];
5296
5296
  if (s.role === "user")
5297
5297
  return !1;
5298
- if (s.respondsToUserMessageId === n.respondsToUserMessageId && (s.role === "assistant" || s.role === "tool" || At(s)))
5298
+ if (s.respondsToUserMessageId === n.respondsToUserMessageId && (s.role === "assistant" || s.role === "tool" || Et(s)))
5299
5299
  return !0;
5300
5300
  }
5301
5301
  return !1;
@@ -5315,7 +5315,7 @@ function ju(t, e) {
5315
5315
  function Gu(t, e) {
5316
5316
  const n = t[e];
5317
5317
  for (let i = e + 1; i < t.length; i += 1)
5318
- if (At(t[i]) && Mn(n, t[i]))
5318
+ if (Et(t[i]) && Mn(n, t[i]))
5319
5319
  return !0;
5320
5320
  return !1;
5321
5321
  }
@@ -5386,7 +5386,7 @@ function zt(t, e) {
5386
5386
  return;
5387
5387
  }
5388
5388
  }
5389
- function Ha(t, e) {
5389
+ function Fa(t, e) {
5390
5390
  try {
5391
5391
  const n = `${xi}${t}`, i = location.href, s = location.origin, o = Array.from(e, (a) => ({
5392
5392
  ...a,
@@ -5409,7 +5409,7 @@ function Or(t, e) {
5409
5409
  } catch {
5410
5410
  return;
5411
5411
  }
5412
- Ha(t, e);
5412
+ Fa(t, e);
5413
5413
  }
5414
5414
  function Xu(t) {
5415
5415
  try {
@@ -5495,13 +5495,13 @@ function ja(t, e) {
5495
5495
  fileUrl: new URL(t.fileUrl, e).toString()
5496
5496
  } : t;
5497
5497
  }
5498
- function Fs(t) {
5498
+ function Ws(t) {
5499
5499
  return t.type || np(t.name) || "application/octet-stream";
5500
5500
  }
5501
5501
  function Ga(t) {
5502
5502
  Ka({
5503
5503
  name: t.name,
5504
- mimeType: Fs(t),
5504
+ mimeType: Ws(t),
5505
5505
  sizeBytes: t.size
5506
5506
  });
5507
5507
  }
@@ -5795,17 +5795,17 @@ function kp(t) {
5795
5795
  }
5796
5796
  const Cp = Object.freeze({
5797
5797
  init: (t) => ro.init(t)
5798
- }), Ep = "#7c3aed", bi = "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", _i = "#2c2a1e", Fr = [253, 250, 241], Wr = 3.5;
5798
+ }), Ep = "#7c3aed", bi = "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", _i = "#2c2a1e", Wr = [253, 250, 241], Hr = 3.5;
5799
5799
  function nl(t) {
5800
5800
  const e = il(t);
5801
- if (Hr(Cn(e), Fr) >= Wr)
5801
+ if (Fr(Cn(e), Wr) >= Hr)
5802
5802
  return e;
5803
5803
  let i = Cn(e);
5804
5804
  const s = Cn(_i);
5805
5805
  for (let o = 0; o < 6; o += 1)
5806
- if (i = Pp(i, s, 0.22), Hr(i, Fr) >= Wr)
5807
- return Ws(i);
5808
- return Ws(i);
5806
+ if (i = Pp(i, s, 0.22), Fr(i, Wr) >= Hr)
5807
+ return Hs(i);
5808
+ return Hs(i);
5809
5809
  }
5810
5810
  function Ap() {
5811
5811
  let n = "M 280 120", i = !1, s = 0;
@@ -5816,7 +5816,7 @@ function Ap() {
5816
5816
  return n;
5817
5817
  }
5818
5818
  function Mp(t) {
5819
- const e = il(t), n = Hs(Cn(e));
5819
+ const e = il(t), n = Fs(Cn(e));
5820
5820
  return n > 0.86 ? {
5821
5821
  top: "#ffffff",
5822
5822
  middle: "#f6f6f6",
@@ -5863,19 +5863,19 @@ function Cn(t) {
5863
5863
  Number.parseInt(t.slice(5, 7), 16)
5864
5864
  ];
5865
5865
  }
5866
- function Ws([t, e, n]) {
5866
+ function Hs([t, e, n]) {
5867
5867
  const i = (s) => Math.max(0, Math.min(255, Math.round(s))).toString(16).padStart(2, "0");
5868
5868
  return `#${i(t)}${i(e)}${i(n)}`;
5869
5869
  }
5870
- function Hs([t, e, n]) {
5870
+ function Fs([t, e, n]) {
5871
5871
  const i = (s) => {
5872
5872
  const o = s / 255;
5873
5873
  return o <= 0.04045 ? o / 12.92 : ((o + 0.055) / 1.055) ** 2.4;
5874
5874
  };
5875
5875
  return 0.2126 * i(t) + 0.7152 * i(e) + 0.0722 * i(n);
5876
5876
  }
5877
- function Hr(t, e) {
5878
- const n = Hs(t), i = Hs(e), [s, o] = n > i ? [n, i] : [i, n];
5877
+ function Fr(t, e) {
5878
+ const n = Fs(t), i = Fs(e), [s, o] = n > i ? [n, i] : [i, n];
5879
5879
  return (s + 0.05) / (o + 0.05);
5880
5880
  }
5881
5881
  function Pp(t, e, n) {
@@ -5888,7 +5888,7 @@ function Pp(t, e, n) {
5888
5888
  }
5889
5889
  function it(t, e, n) {
5890
5890
  const [i, s, o] = Rp(Cn(t));
5891
- return Ws(Lp(i, $s(s + n), $s(o + e)));
5891
+ return Hs(Lp(i, $s(s + n), $s(o + e)));
5892
5892
  }
5893
5893
  function Rp([t, e, n]) {
5894
5894
  const i = t / 255, s = e / 255, o = n / 255, a = Math.max(i, s, o), r = Math.min(i, s, o), d = (a + r) / 2;
@@ -5914,8 +5914,8 @@ function _s(t, e, n) {
5914
5914
  function $s(t) {
5915
5915
  return Math.max(0, Math.min(1, t));
5916
5916
  }
5917
- const Dp = "https://app.pluno.ai", Up = "/api/product-agent/embed/active-users", Np = 1800, Op = 15e3, qp = 250, zp = 1e3, Bp = 3e4;
5918
- function Fp(t, e = {}) {
5917
+ const Up = "https://app.pluno.ai", Dp = "/api/product-agent/embed/active-users", Np = 1800, Op = 15e3, qp = 250, zp = 1e3, Bp = 3e4;
5918
+ function Wp(t, e = {}) {
5919
5919
  let n = !1, i = null, s = null, o = null;
5920
5920
  const a = () => {
5921
5921
  o !== null && (window.clearInterval(o), o = null);
@@ -5939,7 +5939,7 @@ function Fp(t, e = {}) {
5939
5939
  }, qp);
5940
5940
  }, c = async () => {
5941
5941
  try {
5942
- const p = await Wp(e);
5942
+ const p = await Hp(e);
5943
5943
  if (n)
5944
5944
  return;
5945
5945
  d(p.count), r(p.refreshAfterMs);
@@ -5951,10 +5951,10 @@ function Fp(t, e = {}) {
5951
5951
  n = !0, s !== null && window.clearTimeout(s), a();
5952
5952
  };
5953
5953
  }
5954
- async function Wp(t) {
5954
+ async function Hp(t) {
5955
5955
  if (t.loader)
5956
5956
  return t.loader();
5957
- const n = await (t.fetcher ?? fetch)(new URL(Up, Hp(t.backendUrl ?? Dp)).toString(), {
5957
+ const n = await (t.fetcher ?? fetch)(new URL(Dp, Fp(t.backendUrl ?? Up)).toString(), {
5958
5958
  cache: "no-store",
5959
5959
  credentials: "omit"
5960
5960
  });
@@ -5968,7 +5968,7 @@ async function Wp(t) {
5968
5968
  function $r(t) {
5969
5969
  return typeof t != "number" || !Number.isFinite(t) || t < 0 ? null : Math.round(t);
5970
5970
  }
5971
- function Hp(t) {
5971
+ function Fp(t) {
5972
5972
  return t.endsWith("/") ? t : `${t}/`;
5973
5973
  }
5974
5974
  function $p(t) {
@@ -6067,9 +6067,9 @@ function eg(t, e) {
6067
6067
  (i, s) => e && s === n && !i.terminal
6068
6068
  );
6069
6069
  }
6070
- const tg = 6e4, ng = [100, 500, 1500, 4e3], ig = 5e3;
6071
- let sg = 0;
6072
- const og = "product-agent:sdk-preview-socket-connect", rg = "product-agent:sdk-preview-socket-send", ag = "product-agent:sdk-preview-socket-close", lg = "product-agent:sdk-preview-socket-open", dg = "product-agent:sdk-preview-socket-message", cg = "product-agent:sdk-preview-socket-error", ug = "product-agent:sdk-preview-socket-closed", Gr = "product-agent:sdk-preview-socket-id", ol = "data-pluno-auto-mounted", ct = "__plunoProductAgentAutoMountOwner", pg = 1e4, gg = "Failed to load Pluno widget token", Kr = "Timed out loading Pluno widget token", hg = "pluno.productAgent.widgetClientId.", Ss = /* @__PURE__ */ new Set(), fg = "product-agent:preview-diagnostic", mg = 3, Vr = 'dialog[open], [aria-modal="true"], [role="dialog"]', Yr = 1500, wg = 5e3, yg = 500, bg = "No recent chats for this page yet.", ut = {
6070
+ const tg = 6e4, ng = [100, 500, 1500, 4e3];
6071
+ let ig = 0;
6072
+ const sg = "product-agent:sdk-preview-socket-connect", og = "product-agent:sdk-preview-socket-send", rg = "product-agent:sdk-preview-socket-close", ag = "product-agent:sdk-preview-socket-open", lg = "product-agent:sdk-preview-socket-message", dg = "product-agent:sdk-preview-socket-error", cg = "product-agent:sdk-preview-socket-closed", Gr = "product-agent:sdk-preview-socket-id", ol = "data-pluno-auto-mounted", ct = "__plunoProductAgentAutoMountOwner", ug = 1e4, pg = "Failed to load Pluno widget token", Kr = "Timed out loading Pluno widget token", gg = "pluno.productAgent.widgetClientId.", Ss = /* @__PURE__ */ new Set(), hg = "product-agent:preview-diagnostic", fg = 3, Vr = 'dialog[open], [aria-modal="true"], [role="dialog"]', Yr = 1500, mg = 5e3, wg = 500, yg = "No recent chats for this page yet.", ut = {
6073
6073
  launcherLabel: "Ask for anything...",
6074
6074
  accentColor: "#7c3aed",
6075
6075
  colorScheme: "light",
@@ -6077,7 +6077,7 @@ const og = "product-agent:sdk-preview-socket-connect", rg = "product-agent:sdk-p
6077
6077
  scribbleStyle: !0,
6078
6078
  position: "bottom-right",
6079
6079
  movableLauncher: !0
6080
- }, _g = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive', Xr = "pluno-pa-scribble-font", rl = 190, al = 41, Sg = 22, vg = 32, Ig = 1, xg = 48, po = 420, Tg = 520, kg = 0.24, go = 680, Cg = 800, Eg = 0.76, V = 8, Ht = 50, js = 12, ll = "http://www.w3.org/2000/svg", Gs = 26, Ks = 8, Ag = 36, Vs = 16, Mg = 4, Qr = [
6080
+ }, bg = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive', Xr = "pluno-pa-scribble-font", rl = 190, al = 41, _g = 22, Sg = 32, vg = 1, Ig = 48, po = 420, xg = 520, Tg = 0.24, go = 680, kg = 800, Cg = 0.76, V = 8, Ft = 50, js = 12, ll = "http://www.w3.org/2000/svg", Gs = 26, Ks = 8, Eg = 36, Vs = 16, Ag = 4, Qr = [
6081
6081
  {
6082
6082
  ellipseCx: "17.5",
6083
6083
  ellipseCy: "24.5",
@@ -6114,12 +6114,12 @@ const og = "product-agent:sdk-preview-socket-connect", rg = "product-agent:sdk-p
6114
6114
  path: "M18.7 26.8 C21 11.2, 7.1 1.6, 6.3 18.1",
6115
6115
  pathStrokeWidth: "2.45"
6116
6116
  }
6117
- ], Pg = 11, Rg = 13, Si = 4, ho = 10, fo = 40, Lg = "movable-launcher-position-v2", dl = "pluno-pa-widget-styles", cl = "data-pluno-pa-widget-styles", Dg = "__plunoExtensionWidgetOwner";
6117
+ ], Mg = 11, Pg = 13, Si = 4, ho = 10, fo = 40, Rg = "movable-launcher-position-v2", dl = "pluno-pa-widget-styles", cl = "data-pluno-pa-widget-styles", Lg = "__plunoExtensionWidgetOwner";
6118
6118
  let Jr = 0;
6119
6119
  function Ug(t) {
6120
6120
  return (e) => new pt(e, t);
6121
6121
  }
6122
- async function Ng(t = {}) {
6122
+ async function Dg(t = {}) {
6123
6123
  const e = {
6124
6124
  layout: t.layout ?? "floating",
6125
6125
  mountTarget: t.mountTarget,
@@ -6184,8 +6184,8 @@ async function Ng(t = {}) {
6184
6184
  e.loginRequired = u?.allowed === !1 && u.reason === "authentication_required", e.signupRequired = u?.allowed === !1 && (u.reason === "workspace_required" || u.reason === "onboarding_required"), e.loginUrl = l?.actionUrls?.login ?? e.loginUrl, e.signupUrl = l?.actionUrls?.create_workspace ?? l?.actionUrls?.complete_onboarding ?? e.signupUrl;
6185
6185
  };
6186
6186
  t.billingStatus && n(t.billingStatus);
6187
- const i = ++sg, s = Date.now();
6188
- De(
6187
+ const i = ++ig, s = Date.now();
6188
+ Ue(
6189
6189
  "web-sdk.widget",
6190
6190
  "Mounting widget with merged options",
6191
6191
  {
@@ -6201,7 +6201,7 @@ async function Ng(t = {}) {
6201
6201
  }
6202
6202
  );
6203
6203
  const o = document.createElement("div");
6204
- o.className = "pluno-pa-widget-host", o.style.setProperty("display", "block", "important"), o.setAttribute("data-pluno-product-agent-ui", "widget"), o.setAttribute("data-pluno-product-agent-layout", e.layout), e.extensionRuntime && (e.extensionRuntime.markHostOwner?.(o), Object.defineProperty(o, Dg, {
6204
+ o.className = "pluno-pa-widget-host", o.style.setProperty("display", "block", "important"), o.setAttribute("data-pluno-product-agent-ui", "widget"), o.setAttribute("data-pluno-product-agent-layout", e.layout), e.extensionRuntime && (e.extensionRuntime.markHostOwner?.(o), Object.defineProperty(o, Lg, {
6205
6205
  configurable: !0,
6206
6206
  value: e.extensionRuntime.ownerId
6207
6207
  }));
@@ -6211,20 +6211,20 @@ async function Ng(t = {}) {
6211
6211
  e.accentColor,
6212
6212
  e.scribbleStyle
6213
6213
  );
6214
- lh(
6214
+ oh(
6215
6215
  r,
6216
6216
  e.launcherLabel,
6217
6217
  d,
6218
6218
  e.movableLauncher,
6219
6219
  e.showLauncherMinimizeButton
6220
6220
  ), a.appendChild(r);
6221
- const c = xf(e), p = e.layout === "floating" ? e.initialDisplayState ?? vf(e) : "shown";
6221
+ const c = Sf(e), p = e.layout === "floating" ? e.initialDisplayState ?? bf(e) : "shown";
6222
6222
  ma(e, p);
6223
6223
  let h = e.movableLauncher ? c.launcherPosition : null, m = h !== null, g = c.panelSize, w = null;
6224
6224
  r.style.setProperty(
6225
6225
  "--pluno-pa-mobile-panel-top-offset",
6226
6226
  `${e.mobilePanelTopOffset}px`
6227
- ), r.classList.add(`pluno-pa-widget--${e.colorScheme}`), e.scribbleStyle && r.classList.add("pluno-pa-widget--scribble"), p === "minimized" && (r.classList.add("pluno-pa-widget--minimized"), Tt(
6227
+ ), r.classList.add(`pluno-pa-widget--${e.colorScheme}`), e.scribbleStyle && r.classList.add("pluno-pa-widget--scribble"), p === "minimized" && (r.classList.add("pluno-pa-widget--minimized"), xt(
6228
6228
  r,
6229
6229
  Is(
6230
6230
  r,
@@ -6237,13 +6237,13 @@ async function Ng(t = {}) {
6237
6237
  fontFamily: e.fontFamily,
6238
6238
  scribbleStyle: e.scribbleStyle
6239
6239
  });
6240
- const b = e.mountTarget ?? await Sf(), f = b.ownerDocument, _ = r.querySelector(
6240
+ const y = e.mountTarget ?? await yf(), f = y.ownerDocument, _ = r.querySelector(
6241
6241
  ".pluno-pa-widget__launcher"
6242
6242
  ), S = r.querySelector(
6243
6243
  ".pluno-pa-widget__launcher-drag-handle"
6244
6244
  ), v = r.querySelector(
6245
6245
  ".pluno-pa-widget__launcher-input"
6246
- ), U = r.querySelector(
6246
+ ), D = r.querySelector(
6247
6247
  ".pluno-pa-widget__status--launcher"
6248
6248
  ), B = r.querySelector(
6249
6249
  ".pluno-pa-widget__launcher-minimize"
@@ -6251,7 +6251,7 @@ async function Ng(t = {}) {
6251
6251
  ".pluno-pa-widget__panel-drag-handle"
6252
6252
  ), j = r.querySelector(
6253
6253
  ".pluno-pa-widget__scribble-spirals--panel"
6254
- ), D = Array.from(
6254
+ ), U = Array.from(
6255
6255
  r.querySelectorAll(".pluno-pa-widget__resize-handle")
6256
6256
  ), ee = r.querySelector(
6257
6257
  ".pluno-pa-widget__close"
@@ -6261,7 +6261,7 @@ async function Ng(t = {}) {
6261
6261
  ".pluno-pa-widget__attachment-error"
6262
6262
  ), Ee = r.querySelector(
6263
6263
  ".pluno-pa-widget__billing-status"
6264
- ), We = r.querySelector(
6264
+ ), He = r.querySelector(
6265
6265
  ".pluno-pa-widget__attachments"
6266
6266
  ), O = r.querySelector(
6267
6267
  ".pluno-pa-widget__attachment-input"
@@ -6269,7 +6269,7 @@ async function Ng(t = {}) {
6269
6269
  ".pluno-pa-widget__attach"
6270
6270
  ), T = r.querySelector(
6271
6271
  ".pluno-pa-widget__input"
6272
- ), W = r.querySelector(
6272
+ ), H = r.querySelector(
6273
6273
  ".pluno-pa-widget__model-picker"
6274
6274
  ), ye = r.querySelector(
6275
6275
  ".pluno-pa-widget__model-trigger span"
@@ -6277,17 +6277,17 @@ async function Ng(t = {}) {
6277
6277
  r.querySelectorAll(".pluno-pa-widget__model-option")
6278
6278
  ), G = r.querySelector(
6279
6279
  ".pluno-pa-widget__send"
6280
- ), H = r.querySelector(
6280
+ ), F = r.querySelector(
6281
6281
  ".pluno-pa-widget__top-actions"
6282
6282
  ), Ae = r.querySelector(
6283
6283
  ".pluno-pa-widget__history"
6284
6284
  ), Z = r.querySelector(
6285
6285
  ".pluno-pa-widget__history-panel"
6286
- ), F = r.querySelector(
6286
+ ), W = r.querySelector(
6287
6287
  ".pluno-pa-widget__history-list"
6288
6288
  ), Me = r.querySelector(
6289
6289
  ".pluno-pa-widget__history-close"
6290
- ), He = r.querySelector(
6290
+ ), Fe = r.querySelector(
6291
6291
  ".pluno-pa-widget__history-status"
6292
6292
  ), ot = r.querySelector(
6293
6293
  ".pluno-pa-widget__timeline-jump"
@@ -6305,7 +6305,7 @@ async function Ng(t = {}) {
6305
6305
  ".pluno-pa-widget__notify-suggestion-enable"
6306
6306
  ), _e = r.querySelector(
6307
6307
  ".pluno-pa-widget__notify-suggestion-later"
6308
- ), Ue = r.querySelector(
6308
+ ), De = r.querySelector(
6309
6309
  ".pluno-pa-widget__notify-suggestion-never"
6310
6310
  ), x = r.querySelector(
6311
6311
  ".pluno-pa-widget__tab-groups-suggestion"
@@ -6340,13 +6340,13 @@ async function Ng(t = {}) {
6340
6340
  ), Pn = r.querySelector(
6341
6341
  ".pluno-pa-widget__proactive-suggestion-feedback-status"
6342
6342
  );
6343
- if (!_ || !v || !E || !ee || !le || !te || !Ee || !We || !O || !re || !T || !W || !ye || !G || !H || !Ae || !Z || !F || !Me || !He || !ot || !$e || !N || !be)
6343
+ if (!_ || !v || !E || !ee || !le || !te || !Ee || !He || !O || !re || !T || !H || !ye || !G || !F || !Ae || !Z || !W || !Me || !Fe || !ot || !$e || !N || !be)
6344
6344
  throw new Error("Failed to mount Pluno widget");
6345
6345
  if (e.movableLauncher && !S)
6346
6346
  throw new Error("Failed to mount Pluno widget drag handle");
6347
6347
  if (e.movableLauncher && !R)
6348
6348
  throw new Error("Failed to mount Pluno widget panel drag handle");
6349
- let rt = null, Mt = !1, jt = null, Ie = "idle";
6349
+ let rt = null, At = !1, jt = null, Ie = "idle";
6350
6350
  const Rn = () => {
6351
6351
  if (!(Pe !== null && !Pe.hidden && !r.classList.contains("pluno-pa-widget--proactive-suggestion-in-panel") && e.layout === "floating")) {
6352
6352
  r.classList.remove("pluno-pa-widget--proactive-suggestion-below");
@@ -6354,7 +6354,7 @@ async function Ng(t = {}) {
6354
6354
  }
6355
6355
  r.classList.toggle(
6356
6356
  "pluno-pa-widget--proactive-suggestion-below",
6357
- Kg(
6357
+ Gg(
6358
6358
  _.getBoundingClientRect(),
6359
6359
  Pe.getBoundingClientRect().height
6360
6360
  )
@@ -6362,13 +6362,13 @@ async function Ng(t = {}) {
6362
6362
  }, je = () => {
6363
6363
  if (!Pe || !Re || !So || !vo || !Ze || !sn || !Pn)
6364
6364
  return;
6365
- const l = e.proactiveSuggestion ?? rt, u = l !== null && !k.getState().isThinking, y = N.querySelector(
6365
+ const l = e.proactiveSuggestion ?? rt, u = l !== null && !k.getState().isThinking, b = N.querySelector(
6366
6366
  ".pluno-pa-widget__proactive-suggestion-slot"
6367
- ), I = !E.hidden && !r.classList.contains("pluno-pa-widget--closing"), A = u && I && y !== null;
6368
- A ? y.appendChild(Pe) : Pe.parentElement !== r && r.insertBefore(Pe, ee), Pe.hidden = !u, r.classList.toggle("pluno-pa-widget--proactive-suggestion", u), r.classList.toggle(
6367
+ ), I = !E.hidden && !r.classList.contains("pluno-pa-widget--closing"), A = u && I && b !== null;
6368
+ A ? b.appendChild(Pe) : Pe.parentElement !== r && r.insertBefore(Pe, ee), Pe.hidden = !u, r.classList.toggle("pluno-pa-widget--proactive-suggestion", u), r.classList.toggle(
6369
6369
  "pluno-pa-widget--proactive-suggestion-in-panel",
6370
6370
  A
6371
- ), Re.textContent = l?.question ?? "", So.hidden = e.proactiveSuggestion === null || Mt, vo.hidden = rt === null;
6371
+ ), Re.textContent = l?.question ?? "", So.hidden = e.proactiveSuggestion === null || At, vo.hidden = rt === null;
6372
6372
  const z = Ie === "success";
6373
6373
  Ze.hidden = z, sn.hidden = z, sn.disabled = Ie === "submitting" || Ze.value.trim().length === 0, sn.textContent = Ie === "submitting" ? "Sending…" : "Send feedback", Pn.textContent = Ie === "success" ? "Thanks — this helps improve your suggestions." : Ie === "error" ? "Couldn’t send feedback. Please try again." : "Tell Pluno what made this suggestion miss the mark.", Pn.classList.toggle(
6374
6374
  "pluno-pa-widget__proactive-suggestion-feedback-status--success",
@@ -6380,7 +6380,7 @@ async function Ng(t = {}) {
6380
6380
  };
6381
6381
  let Mi = !1;
6382
6382
  const Pi = () => {
6383
- e.billingStatus?.usingPaidCreditFallback !== !0 && (Mi = !1), Uh(
6383
+ e.billingStatus?.usingPaidCreditFallback !== !0 && (Mi = !1), Rh(
6384
6384
  Ee,
6385
6385
  e.billingStatus,
6386
6386
  Mi,
@@ -6391,19 +6391,18 @@ async function Ng(t = {}) {
6391
6391
  };
6392
6392
  re.hidden = !e.attachmentsEnabled, O.disabled = !e.attachmentsEnabled, O.accept = e.productVariant === "personal" ? "" : wc, la(v), la(T);
6393
6393
  let fe = [], Ln = !1, on = null, at = null;
6394
- const Ri = (l) => l === T ? "widget_composer" : l === v ? "widget_launcher" : l && a.contains(l) ? "widget_control" : l === f.body ? "body" : l === f.documentElement ? "document" : l ? "host_page" : "none", wt = (l, u, y = {}) => {
6395
- const I = ni(f), A = y.skipIfAlreadyFocused === !0 && I === l;
6396
- A || (y.preventScroll ? l.focus({ preventScroll: !0 }) : l.focus());
6394
+ const Ri = (l) => l === T ? "widget_composer" : l === v ? "widget_launcher" : l && a.contains(l) ? "widget_control" : l === f.body ? "body" : l === f.documentElement ? "document" : l ? "host_page" : "none", Mt = (l, u, b = {}) => {
6395
+ const I = ni(f), A = b.skipIfAlreadyFocused === !0 && I === l;
6396
+ A || (b.preventScroll ? l.focus({ preventScroll: !0 }) : l.focus());
6397
6397
  const z = ni(f);
6398
- return De(
6398
+ return Ue(
6399
6399
  "web-sdk.widget.focus",
6400
6400
  "Programmatic widget focus",
6401
6401
  {
6402
6402
  reason: u,
6403
6403
  mountId: i,
6404
6404
  widgetAgeMs: Date.now() - s,
6405
- scheduledDelayMs: y.scheduledAt === void 0 ? null : Date.now() - y.scheduledAt,
6406
- persistedFocusAgeMs: y.persistedFocusAgeMs ?? null,
6405
+ scheduledDelayMs: b.scheduledAt === void 0 ? null : Date.now() - b.scheduledAt,
6407
6406
  previousFocus: Ri(I),
6408
6407
  requestedFocus: Ri(l),
6409
6408
  resultingFocus: Ri(z),
@@ -6417,23 +6416,23 @@ async function Ng(t = {}) {
6417
6416
  isThinking: k.getState().isThinking
6418
6417
  }
6419
6418
  ), !A && z === l;
6420
- }, yt = (l) => !T.isConnected || T.disabled || T.readOnly || !r.classList.contains("pluno-pa-widget--open") || e.loginRequired || e.signupRequired || Xt(e.billingStatus) ? !1 : wt(T, l, {
6419
+ }, wt = (l) => !T.isConnected || T.disabled || T.readOnly || !r.classList.contains("pluno-pa-widget--open") || e.loginRequired || e.signupRequired || Xt(e.billingStatus) ? !1 : Mt(T, l, {
6421
6420
  preventScroll: !0,
6422
6421
  skipIfAlreadyFocused: !0
6423
6422
  }), rn = () => {
6424
- Ah(
6425
- We,
6423
+ kh(
6424
+ He,
6426
6425
  fe,
6427
6426
  (l) => {
6428
6427
  fe = fe.filter(
6429
- (u, y) => y !== l
6430
- ), rn(), ae(k.getState()), me(), yt("remove_attachment");
6428
+ (u, b) => b !== l
6429
+ ), rn(), ae(k.getState()), me(), wt("remove_attachment");
6431
6430
  }
6432
6431
  );
6433
6432
  }, Io = e.loginRequired || e.signupRequired || e.token || e.webSocketFactory ? void 0 : e.tokenProvider ?? (e.tokenEndpoint ? async () => kl(e.tokenEndpoint) : void 0);
6434
6433
  if (!e.loginRequired && !e.signupRequired && !e.token && !Io && !e.webSocketFactory && !e.runtimeClient)
6435
6434
  throw new Error("Pluno widget requires token or tokenEndpoint");
6436
- const El = window.fetch.bind(window), xo = e.runtimeClient === void 0, Li = xo ? If(e.clientId) : null;
6435
+ const El = window.fetch.bind(window), xo = e.runtimeClient === void 0, Li = xo ? _f(e.clientId) : null;
6437
6436
  let k;
6438
6437
  try {
6439
6438
  if (e.runtimeClient)
@@ -6481,43 +6480,43 @@ async function Ng(t = {}) {
6481
6480
  (l) => l.value === e.model
6482
6481
  )?.value ?? gi[0].value, an = !1;
6483
6482
  const To = e.productVariant === "personal" && e.onModelChange !== void 0;
6484
- W.hidden = !To;
6483
+ H.hidden = !To;
6485
6484
  const Gt = () => {
6486
- const l = ri.find((y) => y.value === et), u = an;
6487
- ye.textContent = l?.label ?? et, W.dataset.loading = String(u), W.setAttribute("aria-disabled", String(u));
6488
- for (const y of ie) {
6489
- const I = y.dataset.model === et;
6490
- y.classList.toggle("is-selected", I), y.setAttribute("aria-selected", String(I)), y.disabled = u;
6485
+ const l = ri.find((b) => b.value === et), u = an;
6486
+ ye.textContent = l?.label ?? et, H.dataset.loading = String(u), H.setAttribute("aria-disabled", String(u));
6487
+ for (const b of ie) {
6488
+ const I = b.dataset.model === et;
6489
+ b.classList.toggle("is-selected", I), b.setAttribute("aria-selected", String(I)), b.disabled = u;
6491
6490
  }
6492
6491
  }, Al = (l) => {
6493
6492
  et = l, k.setModel(l), Gt();
6494
6493
  };
6495
- Gt(), W.addEventListener("toggle", () => {
6496
- W.open && an && (W.open = !1), W.open || W.querySelector(".pluno-pa-widget__model-more")?.removeAttribute("open");
6494
+ Gt(), H.addEventListener("toggle", () => {
6495
+ H.open && an && (H.open = !1), H.open || H.querySelector(".pluno-pa-widget__model-more")?.removeAttribute("open");
6497
6496
  });
6498
6497
  const ko = (l) => {
6499
- W.open && !l.composedPath().includes(W) && (W.open = !1);
6498
+ H.open && !l.composedPath().includes(H) && (H.open = !1);
6500
6499
  };
6501
6500
  f.addEventListener("pointerdown", ko, !0);
6502
6501
  for (const l of ie)
6503
6502
  l.addEventListener("click", () => {
6504
6503
  const u = ri.find((I) => I.value === l.dataset.model);
6505
6504
  if (!u || u.value === et && k.getModel() === u.value || an) {
6506
- W.open = !1;
6505
+ H.open = !1;
6507
6506
  return;
6508
6507
  }
6509
- const y = et;
6510
- et = u.value, an = !0, W.open = !1, W.title = "", Gt(), Promise.resolve(e.onModelChange?.(u.value)).then(() => Al(u.value)).catch(() => {
6511
- et = y, W.title = "Could not change model";
6508
+ const b = et;
6509
+ et = u.value, an = !0, H.open = !1, H.title = "", Gt(), Promise.resolve(e.onModelChange?.(u.value)).then(() => Al(u.value)).catch(() => {
6510
+ et = b, H.title = "Could not change model";
6512
6511
  }).finally(() => {
6513
6512
  an = !1, Gt();
6514
6513
  });
6515
6514
  });
6516
- b.appendChild(o);
6517
- const Dn = e.manageTaskPageTitle && e.productVariant === "personal" && e.entrySurface === "main_web_chat" ? new Hd(
6515
+ y.appendChild(o);
6516
+ const Un = e.manageTaskPageTitle && e.productVariant === "personal" && e.entrySurface === "main_web_chat" ? new Fd(
6518
6517
  $d(f)
6519
6518
  ) : null;
6520
- De(
6519
+ Ue(
6521
6520
  "web-sdk.widget",
6522
6521
  "Applied initial widget appearance",
6523
6522
  {
@@ -6527,10 +6526,10 @@ async function Ng(t = {}) {
6527
6526
  cssAccent: r.style.getPropertyValue("--pluno-pa-accent")
6528
6527
  }
6529
6528
  );
6530
- const Di = new Set(c.openToolGroupKeys);
6531
- let Ge = null, bt = null, Ne = !1, _t = !1, Pt = {
6529
+ const Ui = new Set(c.openToolGroupKeys);
6530
+ let Ge = null, yt = null, Ne = !1, bt = !1, Pt = {
6532
6531
  enabled: !0
6533
- }, Rt = 0, Ui = null, Lt = null, Dt = null, Un = null, Co = "", Le = !1, Oe = null, Eo = location.origin, Ao = k.getState().sessionId, Mo = k.getState().user?.id ?? null, Ni = k.getState().status, lt = () => {
6532
+ }, Rt = 0, Di = null, Lt = null, Ut = null, Dn = null, Co = "", Le = !1, Oe = null, Eo = location.origin, Ao = k.getState().sessionId, Mo = k.getState().user?.id ?? null, Ni = k.getState().status, lt = () => {
6534
6533
  }, tt = k.getSessionHistoryState();
6535
6534
  const Ml = k.subscribeSessionHistory((l) => {
6536
6535
  tt = l, Ne || lt();
@@ -6543,39 +6542,39 @@ async function Ng(t = {}) {
6543
6542
  }, Rl = (l = "jump") => {
6544
6543
  Ke(!0, l), Ve(), xn(N, () => Pt.enabled), Rt = N.scrollTop;
6545
6544
  }, Nn = (l) => {
6546
- Ui = l, Lt !== null && window.clearTimeout(Lt), Lt = window.setTimeout(() => {
6547
- Ui = null, Lt = null;
6545
+ Di = l, Lt !== null && window.clearTimeout(Lt), Lt = window.setTimeout(() => {
6546
+ Di = null, Lt = null;
6548
6547
  }, 500);
6549
6548
  };
6550
6549
  lt = () => {
6551
6550
  const l = Rd(tt.data), u = tt.status === "loading" || tt.status === "refreshing" || tt.status === "loading_more";
6552
- if (Ae.hidden = e.layout === "page" || e.loginRequired, Z.hidden = !Le, Ae.setAttribute("aria-expanded", String(Le)), F.classList.toggle(
6551
+ if (Ae.hidden = e.layout === "page" || e.loginRequired, Z.hidden = !Le, Ae.setAttribute("aria-expanded", String(Le)), W.classList.toggle(
6553
6552
  "pluno-pa-widget__history-list--center",
6554
6553
  u && l.length === 0
6555
- ), F.replaceChildren(), u && l.length === 0) {
6556
- const y = document.createElement("p");
6557
- y.className = "pluno-pa-widget__history-loading", y.textContent = "Loading...", F.appendChild(y);
6554
+ ), W.replaceChildren(), u && l.length === 0) {
6555
+ const b = document.createElement("p");
6556
+ b.className = "pluno-pa-widget__history-loading", b.textContent = "Loading...", W.appendChild(b);
6558
6557
  }
6559
- for (const y of l) {
6558
+ for (const b of l) {
6560
6559
  const I = document.createElement("button");
6561
6560
  I.type = "button", I.className = "pluno-pa-widget__history-item", I.disabled = u;
6562
6561
  const A = document.createElement("span");
6563
- A.className = "pluno-pa-widget__history-item-title", A.textContent = oh(y);
6562
+ A.className = "pluno-pa-widget__history-item-title", A.textContent = nh(b);
6564
6563
  const z = document.createElement("time");
6565
- z.className = "pluno-pa-widget__history-time", z.dateTime = y.lastActiveAt, z.textContent = ah(
6566
- y.lastActiveAt,
6564
+ z.className = "pluno-pa-widget__history-time", z.dateTime = b.lastActiveAt, z.textContent = sh(
6565
+ b.lastActiveAt,
6567
6566
  Date.now()
6568
6567
  );
6569
6568
  const ce = document.createElement("small");
6570
- ce.className = "pluno-pa-widget__history-path", ce.textContent = rh(y), I.append(A, z, ce), I.addEventListener("click", () => {
6571
- Le = !1, lt(), Ke(!0, "newSession"), Ve(), k.loadSession(y.id), un = null, ae(k.getState()), yt("history_session_selected");
6572
- }), F.appendChild(I);
6569
+ ce.className = "pluno-pa-widget__history-path", ce.textContent = ih(b), I.append(A, z, ce), I.addEventListener("click", () => {
6570
+ Le = !1, lt(), Ke(!0, "newSession"), Ve(), k.loadSession(b.id), un = null, ae(k.getState()), wt("history_session_selected");
6571
+ }), W.appendChild(I);
6573
6572
  }
6574
6573
  if (u && l.length > 0) {
6575
- const y = document.createElement("p");
6576
- y.className = "pluno-pa-widget__history-loading pluno-pa-widget__history-loading--inline", y.textContent = "Loading...", F.appendChild(y);
6574
+ const b = document.createElement("p");
6575
+ b.className = "pluno-pa-widget__history-loading pluno-pa-widget__history-loading--inline", b.textContent = "Loading...", W.appendChild(b);
6577
6576
  }
6578
- He.textContent = (tt.status === "error" ? bg : null) ?? (!u && l.length === 0 ? "No recent chats for this page yet." : ""), He.hidden = He.textContent.length === 0;
6577
+ Fe.textContent = (tt.status === "error" ? yg : null) ?? (!u && l.length === 0 ? "No recent chats for this page yet." : ""), Fe.hidden = Fe.textContent.length === 0;
6579
6578
  };
6580
6579
  const Po = () => {
6581
6580
  Oe !== null && (window.clearTimeout(Oe), Oe = null), !(e.layout === "page" || e.loginRequired || e.signupRequired) && k.refreshSessionHistory();
@@ -6585,7 +6584,7 @@ async function Ng(t = {}) {
6585
6584
  }, 0));
6586
6585
  }, Ll = () => {
6587
6586
  const l = tt.data?.nextCursor ?? null;
6588
- tt.status === "loading_more" || !l || F.scrollHeight - F.scrollTop - F.clientHeight <= 24 && k.loadMoreSessionHistory();
6587
+ tt.status === "loading_more" || !l || W.scrollHeight - W.scrollTop - W.clientHeight <= 24 && k.loadMoreSessionHistory();
6589
6588
  }, Ro = () => {
6590
6589
  Ne || typeof document > "u" || (fa(a, e.accentColor), o.isConnected || (e.mountTarget?.isConnected ? e.mountTarget.appendChild(o) : e.mountTarget || f.body?.appendChild(o)));
6591
6590
  }, Lo = new MutationObserver(Ro);
@@ -6597,7 +6596,7 @@ async function Ng(t = {}) {
6597
6596
  const u = En(r, l);
6598
6597
  return ui(
6599
6598
  r,
6600
- h ? pi(h, u) : jg(
6599
+ h ? pi(h, u) : $g(
6601
6600
  r,
6602
6601
  e.position,
6603
6602
  u
@@ -6605,39 +6604,32 @@ async function Ng(t = {}) {
6605
6604
  u
6606
6605
  );
6607
6606
  }, xe = () => {
6608
- const l = eh(
6609
- a,
6610
- v,
6611
- T
6612
- );
6613
- Tf(e, {
6607
+ vf(e, {
6614
6608
  isOpen: r.classList.contains("pluno-pa-widget--open"),
6615
6609
  composerValue: T.value,
6616
- focusedInput: l,
6617
- focusedInputAt: l ? Date.now() : null,
6618
- openToolGroupKeys: [...Di],
6610
+ openToolGroupKeys: [...Ui],
6619
6611
  launcherPosition: m ? h : null,
6620
6612
  panelSize: g
6621
6613
  });
6622
6614
  }, On = (l, u) => {
6623
6615
  e.onDisplayStateChange?.(l, u);
6624
- }, dn = (l, u = !0, y = "external_request") => {
6616
+ }, dn = (l, u = !0, b = "external_request") => {
6625
6617
  const I = r.classList.contains("pluno-pa-widget--minimized");
6626
6618
  if (ma(e, l), l === "shown") {
6627
- r.classList.remove("pluno-pa-widget--minimized"), _.removeAttribute("tabindex"), _.removeAttribute("role"), _.removeAttribute("aria-label"), !r.classList.contains("pluno-pa-widget--open") && !r.classList.contains("pluno-pa-widget--closing") && cn(!1), u && On("shown", y);
6619
+ r.classList.remove("pluno-pa-widget--minimized"), _.removeAttribute("tabindex"), _.removeAttribute("role"), _.removeAttribute("aria-label"), !r.classList.contains("pluno-pa-widget--open") && !r.classList.contains("pluno-pa-widget--closing") && cn(!1), u && On("shown", b);
6628
6620
  return;
6629
6621
  }
6630
- Ge !== null && (window.clearTimeout(Ge), Ge = null), r.classList.remove("pluno-pa-widget--open"), r.classList.remove("pluno-pa-widget--closing"), r.classList.add("pluno-pa-widget--minimized"), _.hidden = !1, _.setAttribute("role", "button"), _.setAttribute("aria-label", "Open Pluno"), E.hidden = !0, ee.hidden = !0, _.tabIndex = 0, T.value = "", je(), Tt(
6622
+ Ge !== null && (window.clearTimeout(Ge), Ge = null), r.classList.remove("pluno-pa-widget--open"), r.classList.remove("pluno-pa-widget--closing"), r.classList.add("pluno-pa-widget--minimized"), _.hidden = !1, _.setAttribute("role", "button"), _.setAttribute("aria-label", "Open Pluno"), E.hidden = !0, ee.hidden = !0, _.tabIndex = 0, T.value = "", je(), xt(
6631
6623
  r,
6632
6624
  Is(
6633
6625
  r,
6634
6626
  h,
6635
6627
  e.position
6636
6628
  )
6637
- ), sa(r), xe(), !I && e.layout === "floating" && k.recordWidgetLifecycle("minimized", y), u && On("minimized", y);
6638
- }, Ut = (l, u = {}) => {
6639
- Jg(l, {
6640
- debugVersion: Lg,
6629
+ ), sa(r), xe(), !I && e.layout === "floating" && k.recordWidgetLifecycle("minimized", b), u && On("minimized", b);
6630
+ }, Dt = (l, u = {}) => {
6631
+ Qg(l, {
6632
+ debugVersion: Rg,
6641
6633
  launcherPosition: h,
6642
6634
  rootClasses: r.className,
6643
6635
  rootStyle: {
@@ -6656,12 +6648,12 @@ async function Ng(t = {}) {
6656
6648
  });
6657
6649
  }, cn = (l = !0) => {
6658
6650
  if (!h) {
6659
- Tt(r, null);
6660
- const y = ln(l);
6661
- return Rn(), y;
6651
+ xt(r, null);
6652
+ const b = ln(l);
6653
+ return Rn(), b;
6662
6654
  }
6663
6655
  const u = ln(l);
6664
- return Tt(r, u), Rn(), Ut("Applied stored closed launcher position", {
6656
+ return xt(r, u), Rn(), Dt("Applied stored closed launcher position", {
6665
6657
  visibleLauncherPosition: u
6666
6658
  }), u;
6667
6659
  }, qn = (l, u) => {
@@ -6669,16 +6661,16 @@ async function Ng(t = {}) {
6669
6661
  sa(r);
6670
6662
  return;
6671
6663
  }
6672
- Qg(r, {
6664
+ Xg(r, {
6673
6665
  x: l.x - u.x,
6674
6666
  y: l.y - u.y
6675
6667
  });
6676
6668
  }, qi = () => {
6677
6669
  const l = Bt(g).width;
6678
6670
  return E.getBoundingClientRect().width || l;
6679
- }, Do = () => {
6671
+ }, Uo = () => {
6680
6672
  if (r.classList.contains("pluno-pa-widget--minimized")) {
6681
- Tt(
6673
+ xt(
6682
6674
  r,
6683
6675
  Is(
6684
6676
  r,
@@ -6696,7 +6688,7 @@ async function Ng(t = {}) {
6696
6688
  j,
6697
6689
  qi()
6698
6690
  );
6699
- const y = In(
6691
+ const b = In(
6700
6692
  w ? pi(w, u) : Ts(
6701
6693
  r,
6702
6694
  l,
@@ -6705,39 +6697,39 @@ async function Ng(t = {}) {
6705
6697
  ),
6706
6698
  u
6707
6699
  );
6708
- qn(y, l), Ut(
6700
+ qn(b, l), Dt(
6709
6701
  "Applied open panel position after viewport resize",
6710
- { openPanelPosition: y }
6702
+ { openPanelPosition: b }
6711
6703
  );
6712
- } else h && Ut(
6704
+ } else h && Dt(
6713
6705
  "Applied visible launcher position after viewport resize",
6714
6706
  { visibleLauncherPosition: l }
6715
6707
  );
6716
6708
  };
6717
- let Uo = () => {
6709
+ let Do = () => {
6718
6710
  };
6719
- window.addEventListener("resize", Do), e.movableLauncher && S ? (cn(), Uo = Fg({
6711
+ window.addEventListener("resize", Uo), e.movableLauncher && S ? (cn(), Do = Bg({
6720
6712
  root: r,
6721
6713
  launcher: _,
6722
6714
  launcherDragHandle: S,
6723
6715
  getPosition: () => ln(),
6724
6716
  setPosition: (l) => {
6725
- const u = l, y = En(r), I = ui(
6717
+ const u = l, b = En(r), I = ui(
6726
6718
  r,
6727
6719
  l,
6728
- y
6720
+ b
6729
6721
  );
6730
6722
  h = xs(
6731
6723
  I,
6732
- y
6733
- ), w = null, Tt(r, I), Rn(), Ut("Dragging closed launcher", {
6724
+ b
6725
+ ), w = null, xt(r, I), Rn(), Dt("Dragging closed launcher", {
6734
6726
  requestedPosition: u
6735
6727
  });
6736
6728
  },
6737
6729
  persist: () => {
6738
- m = !0, xe(), Ut("Persisted closed launcher drag position");
6730
+ m = !0, xe(), Dt("Persisted closed launcher drag position");
6739
6731
  }
6740
- })) : Tt(r, null), vs(r, g);
6732
+ })) : xt(r, null), vs(r, g);
6741
6733
  const No = () => {
6742
6734
  const l = Bt(g), u = ln();
6743
6735
  return {
@@ -6752,7 +6744,7 @@ async function Ng(t = {}) {
6752
6744
  ),
6753
6745
  size: l
6754
6746
  };
6755
- }, Dl = (l) => {
6747
+ }, Ul = (l) => {
6756
6748
  g = Ci(l.size), vs(r, g), Cs(
6757
6749
  j,
6758
6750
  qi()
@@ -6765,16 +6757,16 @@ async function Ng(t = {}) {
6765
6757
  u,
6766
6758
  Bt(g)
6767
6759
  );
6768
- const y = ln();
6769
- qn(u, y);
6770
- }, Ul = (l) => {
6771
- const u = Bt(g), y = In(
6760
+ const b = ln();
6761
+ qn(u, b);
6762
+ }, Dl = (l) => {
6763
+ const u = Bt(g), b = In(
6772
6764
  l,
6773
6765
  u
6774
6766
  ), I = En(r), A = ui(
6775
6767
  r,
6776
- Xg(
6777
- y,
6768
+ Yg(
6769
+ b,
6778
6770
  u,
6779
6771
  I,
6780
6772
  e.position
@@ -6784,26 +6776,26 @@ async function Ng(t = {}) {
6784
6776
  h = xs(
6785
6777
  A,
6786
6778
  I
6787
- ), m = !0, w = null, Tt(r, A), qn(y, A);
6779
+ ), m = !0, w = null, xt(r, A), qn(b, A);
6788
6780
  }, Nl = e.movableLauncher && R ? Wg({
6789
6781
  root: r,
6790
6782
  handle: R,
6791
6783
  getPosition: () => No().position,
6792
- setPosition: Ul,
6784
+ setPosition: Dl,
6793
6785
  persist: xe
6794
6786
  }) : () => {
6795
- }, Ol = D.length > 0 ? Hg({
6787
+ }, Ol = U.length > 0 ? Hg({
6796
6788
  root: r,
6797
- handles: D,
6789
+ handles: U,
6798
6790
  getBounds: No,
6799
- setBounds: Dl,
6791
+ setBounds: Ul,
6800
6792
  persist: xe
6801
6793
  }) : () => {
6802
6794
  }, Oo = async () => {
6803
6795
  try {
6804
6796
  await k.refreshAccount();
6805
6797
  } catch (l) {
6806
- De(
6798
+ Ue(
6807
6799
  "web-sdk.widget",
6808
6800
  "Failed to refresh billing status",
6809
6801
  { message: l instanceof Error ? l.message : String(l) }
@@ -6814,15 +6806,15 @@ async function Ng(t = {}) {
6814
6806
  const qo = (l) => {
6815
6807
  if (Ot())
6816
6808
  return;
6817
- const u = Date.now(), y = window.location.href;
6818
- l === "composer_input" && un?.scope === y && u - un.requestedAt < tg || (l === "composer_input" && (un = { scope: y, requestedAt: u }), Promise.resolve(k.warmup(l)).catch((I) => {
6819
- De(
6809
+ const u = Date.now(), b = window.location.href;
6810
+ l === "composer_input" && un?.scope === b && u - un.requestedAt < tg || (l === "composer_input" && (un = { scope: b, requestedAt: u }), Promise.resolve(k.warmup(l)).catch((I) => {
6811
+ Ue(
6820
6812
  "web-sdk.widget",
6821
6813
  "Failed to warm Product Agent sandbox",
6822
6814
  { message: I instanceof Error ? I.message : String(I) }
6823
6815
  );
6824
6816
  }));
6825
- }, Ye = (l = "", u = !0, y = !0, I = !0, A = "external_request") => {
6817
+ }, Ye = (l = "", u = !0, b = !0, I = !0, A = "external_request") => {
6826
6818
  const z = r.classList.contains("pluno-pa-widget--open") || !E.hidden && !r.classList.contains("pluno-pa-widget--closing");
6827
6819
  !z && I && qo("panel_open"), Oo(), hn && (hn = !1, Gi()), r.classList.contains("pluno-pa-widget--open") || (w = null), Ge !== null && (window.clearTimeout(Ge), Ge = null), dn("shown", !1), E.hidden = !1, ee.hidden = !1, Cs(
6828
6820
  j,
@@ -6834,16 +6826,16 @@ async function Ng(t = {}) {
6834
6826
  e.position,
6835
6827
  g
6836
6828
  );
6837
- if (qn(Xe, ce), Ut("Opening launcher at clamped open panel position", {
6829
+ if (qn(Xe, ce), Dt("Opening launcher at clamped open panel position", {
6838
6830
  openPanelPosition: Xe,
6839
6831
  visibleLauncherPosition: ce
6840
6832
  }), Ke(!0, "open"), Ve(), !z && e.layout === "floating" && k.recordWidgetLifecycle("opened", A), !u) {
6841
- r.classList.add("pluno-pa-widget--open"), z || Oi(), _.hidden = !0, l && (T.value = l, Sn(T)), xn(N, () => Pt.enabled), Rt = N.scrollTop, y && (wt(T, "panel_open_immediate"), T.setSelectionRange(T.value.length, T.value.length)), xe(), On("shown", A), e.onPanelOpenChange?.(!0, A);
6833
+ r.classList.add("pluno-pa-widget--open"), z || Oi(), _.hidden = !0, l && (T.value = l, Sn(T)), xn(N, () => Pt.enabled), Rt = N.scrollTop, b && (Mt(T, "panel_open_immediate"), T.setSelectionRange(T.value.length, T.value.length)), xe(), On("shown", A), e.onPanelOpenChange?.(!0, A);
6842
6834
  return;
6843
6835
  }
6844
6836
  const $ = Date.now();
6845
6837
  window.requestAnimationFrame(() => {
6846
- r.classList.add("pluno-pa-widget--open"), z || Oi(), l && (T.value = l, Sn(T)), xn(N, () => Pt.enabled), Rt = N.scrollTop, y && (wt(T, "panel_open_animation", {
6838
+ r.classList.add("pluno-pa-widget--open"), z || Oi(), l && (T.value = l, Sn(T)), xn(N, () => Pt.enabled), Rt = N.scrollTop, b && (Mt(T, "panel_open_animation", {
6847
6839
  scheduledAt: $
6848
6840
  }), T.setSelectionRange(T.value.length, T.value.length)), xe(), On("shown", A), e.onPanelOpenChange?.(!0, A), Ge = window.setTimeout(() => {
6849
6841
  _.hidden = !0, xn(N, () => Pt.enabled), Rt = N.scrollTop;
@@ -6851,7 +6843,7 @@ async function Ng(t = {}) {
6851
6843
  });
6852
6844
  }, zi = (l = "external_request") => {
6853
6845
  const u = r.classList.contains("pluno-pa-widget--open") || !E.hidden && !r.classList.contains("pluno-pa-widget--closing");
6854
- Ge !== null && (window.clearTimeout(Ge), Ge = null), _.hidden = !1, h && (cn(!1), Ut("Closing launcher at stored position")), r.classList.remove("pluno-pa-widget--open"), r.classList.add("pluno-pa-widget--closing"), je(), xe(), u && e.layout === "floating" && k.recordWidgetLifecycle("closed", l), e.onPanelOpenChange?.(!1, l), Ge = window.setTimeout(() => {
6846
+ Ge !== null && (window.clearTimeout(Ge), Ge = null), _.hidden = !1, h && (cn(!1), Dt("Closing launcher at stored position")), r.classList.remove("pluno-pa-widget--open"), r.classList.add("pluno-pa-widget--closing"), je(), xe(), u && e.layout === "floating" && k.recordWidgetLifecycle("closed", l), e.onPanelOpenChange?.(!1, l), Ge = window.setTimeout(() => {
6855
6847
  E.hidden = !0, ee.hidden = !0, w = null, r.classList.remove("pluno-pa-widget--closing");
6856
6848
  }, 220);
6857
6849
  };
@@ -6871,7 +6863,7 @@ async function Ng(t = {}) {
6871
6863
  const l = v.value;
6872
6864
  Ye(l, !0, !0, !0, "launcher_input"), v.value = "";
6873
6865
  });
6874
- let pn = null, St = null, zn = null, Nt = null, nt = null, ge = null;
6866
+ let pn = null, _t = null, zn = null, Nt = null, nt = null, ge = null;
6875
6867
  const Bn = (l) => l === v || l === T, Bo = (l) => l.composedPath().find(Bn) ?? null, ql = (l) => {
6876
6868
  let u = l;
6877
6869
  for (; u; ) {
@@ -6885,9 +6877,9 @@ async function Ng(t = {}) {
6885
6877
  return null;
6886
6878
  let u = l;
6887
6879
  for (; u; ) {
6888
- const y = u.closest(Vr);
6889
- if (y)
6890
- return y;
6880
+ const b = u.closest(Vr);
6881
+ if (b)
6882
+ return b;
6891
6883
  const I = ql(u);
6892
6884
  if (I) {
6893
6885
  u = I;
@@ -6897,7 +6889,7 @@ async function Ng(t = {}) {
6897
6889
  u = A instanceof ShadowRoot ? A.host : null;
6898
6890
  }
6899
6891
  return null;
6900
- }, Fi = () => ni(f), zl = (l) => {
6892
+ }, Wi = () => ni(f), zl = (l) => {
6901
6893
  if (!l.isConnected || !l.matches(Vr))
6902
6894
  return !1;
6903
6895
  if (!(l instanceof HTMLElement))
@@ -6908,89 +6900,89 @@ async function Ng(t = {}) {
6908
6900
  return l.checkVisibility();
6909
6901
  const u = window.getComputedStyle(l);
6910
6902
  return u.display !== "none" && u.visibility !== "hidden";
6911
- }, Wi = (l, u) => {
6903
+ }, Hi = (l, u) => {
6912
6904
  if (!u)
6913
6905
  return;
6914
6906
  nt !== null && window.clearTimeout(nt);
6915
- const y = Date.now();
6907
+ const b = Date.now();
6916
6908
  nt = window.setTimeout(() => {
6917
- nt = null, dt === l && u.isConnected && wt(u, "host_modal_recovery", {
6909
+ nt = null, dt === l && u.isConnected && Mt(u, "host_modal_recovery", {
6918
6910
  preventScroll: !0,
6919
- scheduledAt: y
6911
+ scheduledAt: b
6920
6912
  });
6921
6913
  }, 0);
6922
6914
  }, gn = (l, u = null) => {
6923
6915
  if (dt === l) {
6924
- l && Wi(l, u);
6916
+ l && Hi(l, u);
6925
6917
  return;
6926
6918
  }
6927
- dt = l, l !== null ? (Wi(l, u), Nt = window.setInterval(() => {
6928
- const y = dt;
6929
- if (!y || !zl(y)) {
6919
+ dt = l, l !== null ? (Hi(l, u), Nt = window.setInterval(() => {
6920
+ const b = dt;
6921
+ if (!b || !zl(b)) {
6930
6922
  gn(null);
6931
6923
  return;
6932
6924
  }
6933
- Wi(y, null);
6934
- }, yg)) : (Nt !== null && (window.clearInterval(Nt), Nt = null), nt !== null && (window.clearTimeout(nt), nt = null), zn = null);
6925
+ Hi(b, null);
6926
+ }, wg)) : (Nt !== null && (window.clearInterval(Nt), Nt = null), nt !== null && (window.clearTimeout(nt), nt = null), zn = null);
6935
6927
  }, Bl = () => {
6936
6928
  Nt !== null && (window.clearInterval(Nt), Nt = null), nt !== null && (window.clearTimeout(nt), nt = null), ge !== null && (window.clearTimeout(ge), ge = null);
6937
- }, Fo = (l) => {
6929
+ }, Wo = (l) => {
6938
6930
  const u = Bo(l);
6939
6931
  if (!u)
6940
6932
  return;
6941
- const y = Date.now();
6942
- St = y, pn = y, ge !== null && window.clearTimeout(ge);
6943
- const I = dt ?? Bi(Fi());
6933
+ const b = Date.now();
6934
+ _t = b, pn = b, ge !== null && window.clearTimeout(ge);
6935
+ const I = dt ?? Bi(Wi());
6944
6936
  I && (gn(I, u), l.stopImmediatePropagation()), ge = window.setTimeout(() => {
6945
- if (ge = null, St !== y)
6937
+ if (ge = null, _t !== b)
6946
6938
  return;
6947
- const A = Fi();
6939
+ const A = Wi();
6948
6940
  if (A === u) {
6949
- St = null;
6941
+ _t = null;
6950
6942
  return;
6951
6943
  }
6952
6944
  const z = Bi(A);
6953
6945
  z && gn(z, u);
6954
6946
  }, 0);
6955
- }, Fn = (l) => {
6947
+ }, Wn = (l) => {
6956
6948
  const u = Bo(l);
6957
- u && (pn = Date.now(), dt !== null && (l.stopImmediatePropagation(), St = null, ge !== null && (window.clearTimeout(ge), ge = null), xe(), l.type === "focus" && u === v && zo()));
6949
+ u && (pn = Date.now(), dt !== null && (l.stopImmediatePropagation(), _t = null, ge !== null && (window.clearTimeout(ge), ge = null), xe(), l.type === "focus" && u === v && zo()));
6958
6950
  };
6959
6951
  f.defaultView?.addEventListener(
6960
6952
  "pointerdown",
6961
- Fo,
6953
+ Wo,
6962
6954
  !0
6963
6955
  ), f.defaultView?.addEventListener(
6964
6956
  "focus",
6965
- Fn,
6957
+ Wn,
6966
6958
  !0
6967
6959
  ), f.defaultView?.addEventListener(
6968
6960
  "focusin",
6969
- Fn,
6961
+ Wn,
6970
6962
  !0
6971
6963
  ), r.addEventListener("pointerdown", (l) => {
6972
6964
  Bn(l.target) && l.stopPropagation();
6973
6965
  }), r.addEventListener("focusin", (l) => {
6974
- Bn(l.target) && (l.stopPropagation(), pn = Date.now(), St = null, ge !== null && (window.clearTimeout(ge), ge = null), xe());
6966
+ Bn(l.target) && (l.stopPropagation(), pn = Date.now(), _t = null, ge !== null && (window.clearTimeout(ge), ge = null), xe());
6975
6967
  }), r.addEventListener("focusout", (l) => {
6976
6968
  if (!Bn(l.target) || dt !== null)
6977
6969
  return;
6978
6970
  const u = pn;
6979
6971
  if (pn = null, u === null || Date.now() - u > Yr)
6980
6972
  return;
6981
- const y = l.target, I = St !== null && Date.now() - St <= Yr;
6982
- St = null, ge !== null && (window.clearTimeout(ge), ge = null);
6973
+ const b = l.target, I = _t !== null && Date.now() - _t <= Yr;
6974
+ _t = null, ge !== null && (window.clearTimeout(ge), ge = null);
6983
6975
  const A = (z) => {
6984
6976
  const ce = Bi(z);
6985
6977
  if (!ce)
6986
6978
  return !1;
6987
6979
  if (I)
6988
- return gn(ce, y), !0;
6980
+ return gn(ce, b), !0;
6989
6981
  const Xe = Date.now();
6990
- return zn !== null && Xe - zn <= wg ? (gn(ce, y), !0) : (zn = Xe, !0);
6982
+ return zn !== null && Xe - zn <= mg ? (gn(ce, b), !0) : (zn = Xe, !0);
6991
6983
  };
6992
6984
  A(l.relatedTarget) || window.setTimeout(() => {
6993
- dt === null && y.isConnected && A(Fi());
6985
+ dt === null && b.isConnected && A(Wi());
6994
6986
  }, 0);
6995
6987
  }), _.addEventListener("keydown", (l) => {
6996
6988
  !r.classList.contains("pluno-pa-widget--minimized") || l.key !== "Enter" && l.key !== " " || (l.preventDefault(), Ye("", !0, !0, !0, "minimized_launcher"));
@@ -7001,46 +6993,46 @@ async function Ng(t = {}) {
7001
6993
  }), ee.addEventListener("click", () => zi("close_button")), N.addEventListener("wheel", (l) => {
7002
6994
  Nn(l.deltaY < 0 ? "up" : null);
7003
6995
  }), N.addEventListener("pointerdown", (l) => {
7004
- Dt = l.target === N ? l.clientY : null;
6996
+ Ut = l.target === N ? l.clientY : null;
7005
6997
  }), N.addEventListener("pointermove", (l) => {
7006
- Dt !== null && l.clientY < Dt - 1 && Nn("up"), Dt !== null && (Dt = l.clientY);
6998
+ Ut !== null && l.clientY < Ut - 1 && Nn("up"), Ut !== null && (Ut = l.clientY);
7007
6999
  }), N.addEventListener("pointerup", () => {
7008
- Dt = null;
7000
+ Ut = null;
7009
7001
  }), N.addEventListener("pointercancel", () => {
7010
- Dt = null;
7002
+ Ut = null;
7011
7003
  }), N.addEventListener("touchstart", (l) => {
7012
- Un = l.touches[0]?.clientY ?? null;
7004
+ Dn = l.touches[0]?.clientY ?? null;
7013
7005
  }), N.addEventListener("touchmove", (l) => {
7014
7006
  const u = l.touches[0]?.clientY ?? null;
7015
- u !== null && Un !== null && Nn(u > Un ? "up" : null), Un = u;
7007
+ u !== null && Dn !== null && Nn(u > Dn ? "up" : null), Dn = u;
7016
7008
  }), N.addEventListener("keydown", (l) => {
7017
7009
  (l.key === "ArrowUp" || l.key === "PageUp" || l.key === "Home") && Nn("up");
7018
7010
  }), N.addEventListener("scroll", () => {
7019
- N.scrollTop < Rt - 1 && Ui === "up" && Ke(!1, "userScroll"), Rt = N.scrollTop;
7011
+ N.scrollTop < Rt - 1 && Di === "up" && Ke(!1, "userScroll"), Rt = N.scrollTop;
7020
7012
  }), ot.addEventListener("click", () => {
7021
7013
  Rl();
7022
7014
  });
7023
- const Wo = typeof IntersectionObserver > "u" ? null : new IntersectionObserver(
7015
+ const Ho = typeof IntersectionObserver > "u" ? null : new IntersectionObserver(
7024
7016
  ([l]) => {
7025
7017
  l?.isIntersecting && (Ke(!0, "bottom"), Ve());
7026
7018
  },
7027
7019
  { root: N, threshold: 0 }
7028
7020
  );
7029
- Wo?.observe(be);
7021
+ Ho?.observe(be);
7030
7022
  const Ot = () => e.loginRequired || e.signupRequired;
7031
- let dt = null, hn = !1, Hi = k.getState().status === "connected";
7023
+ let dt = null, hn = !1, Fi = k.getState().status === "connected";
7032
7024
  const $i = () => {
7033
7025
  const l = k.getState().status;
7034
- return !Hi && (l === "idle" || l === "connecting" || l === "reconnecting");
7035
- }, vt = () => k.getState().status !== "connected", ji = () => {
7026
+ return !Fi && (l === "idle" || l === "connecting" || l === "reconnecting");
7027
+ }, St = () => k.getState().status !== "connected", ji = () => {
7036
7028
  const l = k.getState().status;
7037
- return $i() ? !1 : l !== "connected" && !(Hi && l === "reconnecting");
7029
+ return $i() ? !1 : l !== "connected" && !(Fi && l === "reconnecting");
7038
7030
  }, Kt = () => {
7039
- const l = Ot(), u = k.getState(), y = !u.isThinking && !u.pendingMessageStatus && !!u.lastError;
7040
- v.readOnly = !1, T.readOnly = !1, v.placeholder = l ? e.signupRequired ? e.signupButtonLabel : e.loginButtonLabel : y ? "Needs attention" : hn ? "New update" : e.launcherLabel, T.placeholder = l ? e.signupRequired ? e.signupButtonLabel : e.loginButtonLabel : ut.launcherLabel, le.hidden = l;
7041
- }, Ho = () => {
7031
+ const l = Ot(), u = k.getState(), b = !u.isThinking && !u.pendingMessageStatus && !!u.lastError;
7032
+ v.readOnly = !1, T.readOnly = !1, v.placeholder = l ? e.signupRequired ? e.signupButtonLabel : e.loginButtonLabel : b ? "Needs attention" : hn ? "New update" : e.launcherLabel, T.placeholder = l ? e.signupRequired ? e.signupButtonLabel : e.loginButtonLabel : ut.launcherLabel, le.hidden = l;
7033
+ }, Fo = () => {
7042
7034
  const l = k.getState();
7043
- return Ud({
7035
+ return Dd({
7044
7036
  hasRunningAssistantTurn: l.isThinking,
7045
7037
  hasDraftMessage: T.value.trim().length > 0,
7046
7038
  hasPreSubmittedAttachment: fe.length > 0,
@@ -7048,15 +7040,15 @@ async function Ng(t = {}) {
7048
7040
  canSubmitMessage: !ji() && !Xt(e.billingStatus) && l.pendingMessageStatus === null && !Ln
7049
7041
  });
7050
7042
  }, me = () => {
7051
- const l = Ho();
7052
- yo(G, l.action === "stop"), G.disabled = l.disabled, re.disabled = Ot() || vt() || Xt(e.billingStatus);
7043
+ const l = Fo();
7044
+ yo(G, l.action === "stop"), G.disabled = l.disabled, re.disabled = Ot() || St() || Xt(e.billingStatus);
7053
7045
  };
7054
7046
  Kt();
7055
7047
  const Gi = () => {
7056
- const l = k.getState(), u = l.isThinking, y = l.turnPhase !== null, I = l.turnPhase === "sending", A = U?.lastElementChild;
7048
+ const l = k.getState(), u = l.isThinking, b = l.turnPhase !== null, I = l.turnPhase === "sending", A = D?.lastElementChild;
7057
7049
  A && (A.textContent = "Working..."), r.classList.toggle("pluno-pa-widget--thinking", u), r.classList.toggle("pluno-pa-widget--sending", I), r.classList.toggle(
7058
7050
  "pluno-pa-widget--unread",
7059
- !y && (hn || !!l.lastError)
7051
+ !b && (hn || !!l.lastError)
7060
7052
  ), Kt();
7061
7053
  };
7062
7054
  Gi();
@@ -7066,7 +7058,7 @@ async function Ng(t = {}) {
7066
7058
  Ne || (Kt(), me());
7067
7059
  },
7068
7060
  (l) => {
7069
- Ne || (Kt(), me(), De(
7061
+ Ne || (Kt(), me(), Ue(
7070
7062
  "web-sdk.widget",
7071
7063
  "Failed to connect Product Agent widget",
7072
7064
  {
@@ -7075,27 +7067,27 @@ async function Ng(t = {}) {
7075
7067
  ));
7076
7068
  }
7077
7069
  ));
7078
- }, Wn = (l) => {
7070
+ }, Hn = (l) => {
7079
7071
  at !== null && window.clearTimeout(at), te.textContent = l, te.hidden = !1, at = window.setTimeout(() => {
7080
7072
  te.textContent = "", te.hidden = !0, at = null;
7081
7073
  }, 3e3);
7082
7074
  }, $o = (l) => {
7083
- const u = Mt ? jt : null;
7084
- Zg(
7075
+ const u = At ? jt : null;
7076
+ Jg(
7085
7077
  k,
7086
7078
  l.value,
7087
7079
  l.attachments,
7088
7080
  Zo,
7089
7081
  u?.question
7090
7082
  ).then(() => {
7091
- u && (Mt = !1, jt = null, e.proactiveSuggestion = null, je());
7092
- }).catch((y) => {
7083
+ u && (At = !1, jt = null, e.proactiveSuggestion = null, je());
7084
+ }).catch((b) => {
7093
7085
  const I = new Set(fe.map((A) => A.id));
7094
7086
  fe = [
7095
7087
  ...l.attachments.filter((A) => !I.has(A.id)),
7096
7088
  ...fe
7097
- ], T.value || (T.value = l.inputValue, T.dispatchEvent(new Event("input", { bubbles: !0 }))), rn(), Wn(
7098
- y instanceof Error ? y.message : "Failed to upload attachment"
7089
+ ], T.value || (T.value = l.inputValue, T.dispatchEvent(new Event("input", { bubbles: !0 }))), rn(), Hn(
7090
+ b instanceof Error ? b.message : "Failed to upload attachment"
7099
7091
  );
7100
7092
  }).finally(() => {
7101
7093
  Ln = !1, me();
@@ -7106,18 +7098,18 @@ async function Ng(t = {}) {
7106
7098
  const l = on;
7107
7099
  on = null, $o(l);
7108
7100
  }, Vi = () => {
7109
- const l = T.value, u = l.trim(), y = [...fe];
7110
- if (Ln || !u && y.length === 0)
7101
+ const l = T.value, u = l.trim(), b = [...fe];
7102
+ if (Ln || !u && b.length === 0)
7111
7103
  return;
7112
7104
  Ln = !0;
7113
- const I = new Set(y);
7105
+ const I = new Set(b);
7114
7106
  fe = fe.filter(
7115
7107
  (z) => !I.has(z)
7116
7108
  ), T.value === l && (T.value = "", T.style.height = "22px", T.style.overflowY = "hidden", T.dispatchEvent(new Event("input", { bubbles: !0 }))), rn(), me();
7117
7109
  const A = {
7118
7110
  inputValue: l,
7119
7111
  value: u,
7120
- attachments: y
7112
+ attachments: b
7121
7113
  };
7122
7114
  if ($i()) {
7123
7115
  on = A;
@@ -7134,71 +7126,71 @@ async function Ng(t = {}) {
7134
7126
  e.onSignupClick?.();
7135
7127
  return;
7136
7128
  }
7137
- ji() || Xt(e.billingStatus) || (_t = !0, Ke(!0, "send"), Ve(), Vi());
7129
+ ji() || Xt(e.billingStatus) || (bt = !0, Ke(!0, "send"), Ve(), Vi());
7138
7130
  });
7139
7131
  let fn = 0;
7140
- const It = () => {
7132
+ const vt = () => {
7141
7133
  fn = 0, r.classList.remove("pluno-pa-widget--drag-over");
7142
- }, Fl = () => {
7134
+ }, Wl = () => {
7143
7135
  at !== null && (window.clearTimeout(at), at = null), te.textContent = "", te.hidden = !0;
7144
7136
  }, Yi = async (l) => {
7145
7137
  if (!e.attachmentsEnabled || l.length === 0)
7146
7138
  return;
7147
- const u = Lh(
7139
+ const u = Mh(
7148
7140
  k,
7149
7141
  l,
7150
7142
  e.productVariant === "customer_embedded"
7151
7143
  );
7152
- if (fe = [...fe, ...u], rn(), Fl(), me(), ae(k.getState()), !r.classList.contains("pluno-pa-widget--open")) {
7144
+ if (fe = [...fe, ...u], rn(), Wl(), me(), ae(k.getState()), !r.classList.contains("pluno-pa-widget--open")) {
7153
7145
  Ye("", !0, !0, !0, "attachment_drop");
7154
7146
  return;
7155
7147
  }
7156
- yt("attachment_added");
7157
- }, Wl = async (l) => {
7158
- await Yi(l), !(l.length === 0 || dt !== null) && wt(T, "attachment_picker_completed");
7148
+ wt("attachment_added");
7149
+ }, Hl = async (l) => {
7150
+ await Yi(l), !(l.length === 0 || dt !== null) && Mt(T, "attachment_picker_completed");
7159
7151
  };
7160
7152
  re.addEventListener("click", () => {
7161
- e.loginRequired || vt() || Xt(e.billingStatus) || O.click();
7153
+ e.loginRequired || St() || Xt(e.billingStatus) || O.click();
7162
7154
  }), O.addEventListener("change", () => {
7163
7155
  const l = Array.from(O.files ?? []);
7164
- O.value = "", Wl(l).catch((u) => {
7165
- Wn(
7156
+ O.value = "", Hl(l).catch((u) => {
7157
+ Hn(
7166
7158
  u instanceof Error ? u.message : "Failed to attach file"
7167
- ), De("web-sdk.widget", "Attachment failed", {
7159
+ ), Ue("web-sdk.widget", "Attachment failed", {
7168
7160
  message: u instanceof Error ? u.message : String(u)
7169
7161
  });
7170
7162
  });
7171
7163
  }), r.addEventListener("dragenter", (l) => {
7172
- !e.attachmentsEnabled || !ii(l.dataTransfer) || e.loginRequired || vt() || (l.preventDefault(), l.stopPropagation(), fn += 1, r.classList.add("pluno-pa-widget--drag-over"));
7164
+ !e.attachmentsEnabled || !ii(l.dataTransfer) || e.loginRequired || St() || (l.preventDefault(), l.stopPropagation(), fn += 1, r.classList.add("pluno-pa-widget--drag-over"));
7173
7165
  }), r.addEventListener("dragover", (l) => {
7174
7166
  const u = l.dataTransfer;
7175
- !e.attachmentsEnabled || !ii(u) || e.loginRequired || vt() || (l.preventDefault(), l.stopPropagation(), u.dropEffect = "copy");
7167
+ !e.attachmentsEnabled || !ii(u) || e.loginRequired || St() || (l.preventDefault(), l.stopPropagation(), u.dropEffect = "copy");
7176
7168
  }), r.addEventListener("dragleave", (l) => {
7177
7169
  ii(l.dataTransfer) && (l.stopPropagation(), fn = Math.max(0, fn - 1), fn === 0 && r.classList.remove("pluno-pa-widget--drag-over"));
7178
7170
  });
7179
7171
  const Go = (l) => {
7180
- r.classList.contains("pluno-pa-widget--drag-over") && !l.composedPath().includes(r) && It();
7172
+ r.classList.contains("pluno-pa-widget--drag-over") && !l.composedPath().includes(r) && vt();
7181
7173
  };
7182
7174
  f.addEventListener(
7183
7175
  "dragover",
7184
7176
  Go,
7185
7177
  !0
7186
- ), f.addEventListener("drop", It, !0), f.addEventListener("dragend", It, !0), f.defaultView?.addEventListener("blur", It), r.addEventListener("drop", (l) => {
7178
+ ), f.addEventListener("drop", vt, !0), f.addEventListener("dragend", vt, !0), f.defaultView?.addEventListener("blur", vt), r.addEventListener("drop", (l) => {
7187
7179
  const u = l.dataTransfer;
7188
- !e.attachmentsEnabled || !ii(u) || e.loginRequired || vt() || (l.preventDefault(), l.stopPropagation(), It(), Yi(u.files).catch((y) => {
7189
- Wn(
7190
- y instanceof Error ? y.message : "Failed to attach file"
7191
- ), De("web-sdk.widget", "Attachment failed", {
7192
- message: y instanceof Error ? y.message : String(y)
7180
+ !e.attachmentsEnabled || !ii(u) || e.loginRequired || St() || (l.preventDefault(), l.stopPropagation(), vt(), Yi(u.files).catch((b) => {
7181
+ Hn(
7182
+ b instanceof Error ? b.message : "Failed to attach file"
7183
+ ), Ue("web-sdk.widget", "Attachment failed", {
7184
+ message: b instanceof Error ? b.message : String(b)
7193
7185
  });
7194
7186
  }));
7195
7187
  }), r.addEventListener("paste", (l) => {
7196
7188
  l.stopPropagation();
7197
- const u = l.clipboardData, y = Array.from(u?.files ?? []);
7198
- !e.attachmentsEnabled || y.length === 0 || e.loginRequired || vt() || (l.preventDefault(), Yi(y).catch((I) => {
7199
- Wn(
7189
+ const u = l.clipboardData, b = Array.from(u?.files ?? []);
7190
+ !e.attachmentsEnabled || b.length === 0 || e.loginRequired || St() || (l.preventDefault(), Yi(b).catch((I) => {
7191
+ Hn(
7200
7192
  I instanceof Error ? I.message : "Failed to attach file"
7201
- ), De("web-sdk.widget", "Attachment failed", {
7193
+ ), Ue("web-sdk.widget", "Attachment failed", {
7202
7194
  message: I instanceof Error ? I.message : String(I)
7203
7195
  });
7204
7196
  }));
@@ -7207,7 +7199,7 @@ async function Ng(t = {}) {
7207
7199
  e.onLoginClick?.();
7208
7200
  return;
7209
7201
  }
7210
- const l = Ho();
7202
+ const l = Fo();
7211
7203
  if (l.disabled)
7212
7204
  return;
7213
7205
  if (l.action === "stop") {
@@ -7215,26 +7207,26 @@ async function Ng(t = {}) {
7215
7207
  return;
7216
7208
  }
7217
7209
  const u = T.value.trim().length > 0 || fe.length > 0;
7218
- _t = !0, Ke(!0, "send"), Ve(), Vi(), ae(k.getState()), me(), u && yt("send_button_submit");
7210
+ bt = !0, Ke(!0, "send"), Ve(), Vi(), ae(k.getState()), me(), u && wt("send_button_submit");
7219
7211
  }), Ae.addEventListener("click", () => {
7220
- Le = !Le, lt(), Le && tt.data === null && tt.status !== "loading" && Po(), Le || yt("history_closed");
7212
+ Le = !Le, lt(), Le && tt.data === null && tt.status !== "loading" && Po(), Le || wt("history_closed");
7221
7213
  }), Me.addEventListener("click", () => {
7222
- Le = !1, lt(), yt("history_closed");
7223
- }), F.addEventListener("scroll", Ll), T.addEventListener("input", () => {
7224
- T.value.trim() && qo("composer_input"), Sn(T), xe(), me(), Hl();
7214
+ Le = !1, lt(), wt("history_closed");
7215
+ }), W.addEventListener("scroll", Ll), T.addEventListener("input", () => {
7216
+ T.value.trim() && qo("composer_input"), Sn(T), xe(), me(), Fl();
7225
7217
  }), T.addEventListener("keydown", (l) => {
7226
7218
  if (!(l.key !== "Enter" || l.shiftKey)) {
7227
7219
  if (l.preventDefault(), e.loginRequired) {
7228
7220
  e.onLoginClick?.();
7229
7221
  return;
7230
7222
  }
7231
- ji() || (_t = !0, Ke(!0, "send"), Ve(), Vi(), ae(k.getState()), me());
7223
+ ji() || (bt = !0, Ke(!0, "send"), Ve(), Vi(), ae(k.getState()), me());
7232
7224
  }
7233
7225
  }), r.addEventListener("click", (l) => {
7234
7226
  const u = l.target instanceof Element ? l.target : null;
7235
7227
  u?.closest("a[href]") && xe(), Le && Vp(u, Z, Ae) && (Le = !1, lt());
7236
7228
  const I = window.getSelection(), A = !!(I && !I.isCollapsed && I.anchorNode && r.contains(I.anchorNode));
7237
- Gp(l.target, l.detail, A) && yt("passive_surface_click");
7229
+ Gp(l.target, l.detail, A) && wt("passive_surface_click");
7238
7230
  });
7239
7231
  let Ko = !1;
7240
7232
  const Vo = (l) => {
@@ -7242,15 +7234,15 @@ async function Ng(t = {}) {
7242
7234
  }, Yo = (l) => {
7243
7235
  if (!Ko || E.hidden || r.classList.contains("pluno-pa-widget--closing"))
7244
7236
  return;
7245
- const u = a.activeElement ?? f.activeElement, y = Xp(l, u);
7246
- if (!y || T.disabled || T.readOnly)
7237
+ const u = a.activeElement ?? f.activeElement, b = Xp(l, u);
7238
+ if (!b || T.disabled || T.readOnly)
7247
7239
  return;
7248
7240
  l.preventDefault();
7249
7241
  const I = Qp(
7250
7242
  T.value,
7251
7243
  T.selectionStart,
7252
7244
  T.selectionEnd,
7253
- y
7245
+ b
7254
7246
  );
7255
7247
  T.value = I.value, T.dispatchEvent(new Event("input", { bubbles: !0 })), Yp(T), T.setSelectionRange(I.caret, I.caret);
7256
7248
  };
@@ -7285,36 +7277,24 @@ async function Ng(t = {}) {
7285
7277
  bl(l), l.stopPropagation();
7286
7278
  return;
7287
7279
  }
7288
- l.key !== "Escape" || !Le || (Le = !1, lt(), yt("history_escape"));
7289
- }), c.composerValue && (T.value = c.composerValue, Sn(T)), e.layout === "page" ? Ye(T.value, !1, !0, !1, "external_request") : p === "minimized" ? dn("minimized", !1) : e.initialDisplayState === void 0 && c.isOpen && Ye(T.value, !1, !1, !1, "restored_state"), th(
7290
- c,
7291
- r,
7292
- v,
7293
- T,
7294
- (l, u, y) => {
7295
- wt(l, "persisted_focus_restore", {
7296
- preventScroll: !0,
7297
- persistedFocusAgeMs: u,
7298
- scheduledAt: y
7299
- });
7300
- }
7301
- );
7302
- const Hn = () => d;
7280
+ l.key !== "Escape" || !Le || (Le = !1, lt(), wt("history_escape"));
7281
+ }), c.composerValue && (T.value = c.composerValue, Sn(T)), e.layout === "page" ? Ye(T.value, !1, !0, !1, "external_request") : p === "minimized" ? dn("minimized", !1) : e.initialDisplayState === void 0 && c.isOpen && Ye(T.value, !1, !1, !1, "restored_state");
7282
+ const Fn = () => d;
7303
7283
  let Xi = k.getState().appearance !== null, $n = null, mn = null, Vt = k.getInteractions();
7304
7284
  const K = (l) => Vt.find(
7305
7285
  (u) => u.kind === l && u.eligible && u.status === "presentable"
7306
7286
  ), jn = (l) => Vt.find((u) => u.kind === l), Xo = () => {
7307
7287
  const l = K("task_notifications");
7308
- l && (L && (L.textContent = l.presentation.body), Y && (Y.textContent = l.presentation.actionLabels.enable ?? "Notify me"), _e && (_e.textContent = l.presentation.actionLabels.later ?? "Later"), Ue && (Ue.textContent = l.presentation.actionLabels.never ?? "Never"));
7288
+ l && (L && (L.textContent = l.presentation.body), Y && (Y.textContent = l.presentation.actionLabels.enable ?? "Notify me"), _e && (_e.textContent = l.presentation.actionLabels.later ?? "Later"), De && (De.textContent = l.presentation.actionLabels.never ?? "Never"));
7309
7289
  const u = K("tab_group_permission");
7310
7290
  u && (C && (C.textContent = u.presentation.body), ne && (ne.textContent = u.presentation.actionLabels.enable ?? "Enable grouping"), Q && (Q.textContent = u.presentation.actionLabels.later ?? "Not now"));
7311
7291
  };
7312
7292
  Xo();
7313
- const de = (l, u, y) => l ? k.actOnInteraction(
7293
+ const de = (l, u, b) => l ? k.actOnInteraction(
7314
7294
  l.id,
7315
7295
  u,
7316
7296
  l.revision,
7317
- y
7297
+ b
7318
7298
  ) : Promise.resolve();
7319
7299
  let Qi = k.getState().isThinking;
7320
7300
  const Ji = () => {
@@ -7328,7 +7308,7 @@ async function Ng(t = {}) {
7328
7308
  const l = K("task_notifications");
7329
7309
  Ji(), de(l, "later").catch(() => {
7330
7310
  });
7331
- }), Ue?.addEventListener("click", () => {
7311
+ }), De?.addEventListener("click", () => {
7332
7312
  const l = K("task_notifications");
7333
7313
  Ji(), de(l, "never").catch(() => {
7334
7314
  });
@@ -7347,7 +7327,7 @@ async function Ng(t = {}) {
7347
7327
  }), Qo();
7348
7328
  let qt = null, Gn = () => {
7349
7329
  }, Kn = !1;
7350
- const Vn = /* @__PURE__ */ new Map(), Zi = /* @__PURE__ */ new Map(), es = /* @__PURE__ */ new Map(), ts = () => T.value.trim().length > 0 || fe.length > 0, Hl = () => {
7330
+ const Vn = /* @__PURE__ */ new Map(), Zi = /* @__PURE__ */ new Map(), es = /* @__PURE__ */ new Map(), ts = () => T.value.trim().length > 0 || fe.length > 0, Fl = () => {
7351
7331
  const l = qt !== null && As(k.getState(), ts());
7352
7332
  $e.hidden = !l, l && qt !== null && pl($e, qt);
7353
7333
  };
@@ -7365,11 +7345,11 @@ async function Ng(t = {}) {
7365
7345
  const u = K("personal_channel_connection");
7366
7346
  u?.payload.request.requestId === l.requestId && await de(u, "connect");
7367
7347
  }, wn = (l = {}) => {
7368
- _t = !0, Ke(!0, "newSession"), Ve(), Le = !1, lt(), k.startNewSession(l), un = null, Di.clear(), Yn.clear(), T.value = "", fe = [], rn(), Sn(T), xe(), me(), wt(T, "new_chat"), ae(k.getState());
7348
+ bt = !0, Ke(!0, "newSession"), Ve(), Le = !1, lt(), k.startNewSession(l), un = null, Ui.clear(), Yn.clear(), T.value = "", fe = [], rn(), Sn(T), xe(), me(), Mt(T, "new_chat"), ae(k.getState());
7369
7349
  };
7370
7350
  P?.addEventListener("click", () => {
7371
7351
  const l = e.proactiveSuggestion;
7372
- !l || vt() || (rt = null, Mt = !1, jt = null, e.proactiveSuggestion = null, wn(), Ye("", !0, !1, !0, "proactive_suggestion"), k.sendMessage("Yes", {
7352
+ !l || St() || (rt = null, At = !1, jt = null, e.proactiveSuggestion = null, wn(), Ye("", !0, !1, !0, "proactive_suggestion"), k.sendMessage("Yes", {
7373
7353
  proactiveSuggestionQuestion: l.question
7374
7354
  }));
7375
7355
  });
@@ -7377,9 +7357,9 @@ async function Ng(t = {}) {
7377
7357
  if (!(e.proactiveSuggestion ?? rt))
7378
7358
  return;
7379
7359
  const u = e.proactiveSuggestion !== null;
7380
- if (e.proactiveSuggestion = null, rt = null, Mt = !1, jt = null, Ie = "idle", Ze && (Ze.value = ""), u) {
7381
- const y = K("proactive_suggestion");
7382
- y && de(y, "dismiss").catch(() => {
7360
+ if (e.proactiveSuggestion = null, rt = null, At = !1, jt = null, Ie = "idle", Ze && (Ze.value = ""), u) {
7361
+ const b = K("proactive_suggestion");
7362
+ b && de(b, "dismiss").catch(() => {
7383
7363
  });
7384
7364
  }
7385
7365
  je();
@@ -7388,7 +7368,7 @@ async function Ng(t = {}) {
7388
7368
  const l = e.proactiveSuggestion;
7389
7369
  if (!l)
7390
7370
  return;
7391
- rt = null, Mt = !0, jt = l, e.proactiveSuggestion = null, wn(), k.stageProactiveSuggestionQuestion(l.question);
7371
+ rt = null, At = !0, jt = l, e.proactiveSuggestion = null, wn(), k.stageProactiveSuggestionQuestion(l.question);
7392
7372
  const u = K("proactive_suggestion");
7393
7373
  u && de(u, "edit").catch(() => {
7394
7374
  }), Ye("Yes, but ", !0, !0, !0, "proactive_suggestion"), window.requestAnimationFrame(() => {
@@ -7398,7 +7378,7 @@ async function Ng(t = {}) {
7398
7378
  const l = e.proactiveSuggestion;
7399
7379
  if (!l)
7400
7380
  return;
7401
- rt = l, Mt = !1, jt = null, Ie = "idle", Ze && (Ze.value = ""), e.proactiveSuggestion = null;
7381
+ rt = l, At = !1, jt = null, Ie = "idle", Ze && (Ze.value = ""), e.proactiveSuggestion = null;
7402
7382
  const u = K("proactive_suggestion");
7403
7383
  u && de(u, "never").catch(() => {
7404
7384
  }), je(), window.requestAnimationFrame(() => Ze?.focus());
@@ -7410,7 +7390,7 @@ async function Ng(t = {}) {
7410
7390
  Ie = "submitting", je();
7411
7391
  try {
7412
7392
  await de(
7413
- Vt.find((y) => y.kind === "proactive_suggestion" && y.payload.suggestion.id === l.id),
7393
+ Vt.find((b) => b.kind === "proactive_suggestion" && b.payload.suggestion.id === l.id),
7414
7394
  "submit_feedback",
7415
7395
  { feedback: u }
7416
7396
  ), Ie = "success";
@@ -7434,16 +7414,16 @@ async function Ng(t = {}) {
7434
7414
  Yt || (Yt = Ei(
7435
7415
  "pluno-pa-widget__new-chat",
7436
7416
  "New chat",
7437
- _h(),
7417
+ wh(),
7438
7418
  !1
7439
- ), Yt.addEventListener("click", () => wn()), H.insertBefore(Yt, Ae));
7419
+ ), Yt.addEventListener("click", () => wn()), F.insertBefore(Yt, Ae));
7440
7420
  }, ae = (l, u = {}) => {
7441
- if (Gt(), bt !== null && (window.clearTimeout(bt), bt = null), lt(), je(), Pi(), e.loginRequired) {
7421
+ if (Gt(), yt !== null && (window.clearTimeout(yt), yt = null), lt(), je(), Pi(), e.loginRequired) {
7442
7422
  Vn.clear(), Zi.clear(), es.clear(), pa(
7443
7423
  N,
7444
7424
  G,
7445
7425
  ns,
7446
- Hn,
7426
+ Fn,
7447
7427
  "Log in to use Pluno on this page.",
7448
7428
  e.loginButtonLabel,
7449
7429
  e.loginUrl,
@@ -7457,7 +7437,7 @@ async function Ng(t = {}) {
7457
7437
  N,
7458
7438
  G,
7459
7439
  ns,
7460
- Hn,
7440
+ Fn,
7461
7441
  "Complete signup to unlock your free trial credits.",
7462
7442
  e.signupButtonLabel,
7463
7443
  e.signupUrl,
@@ -7466,10 +7446,10 @@ async function Ng(t = {}) {
7466
7446
  );
7467
7447
  return;
7468
7448
  }
7469
- const y = ih(l), I = y !== Co;
7470
- Co = y;
7471
- const A = _t || Pt.enabled;
7472
- _t = !1, (I || u.skipUnchangedTimeline !== !0) && Bh(
7449
+ const b = eh(l), I = b !== Co;
7450
+ Co = b;
7451
+ const A = bt || Pt.enabled;
7452
+ bt = !1, (I || u.skipUnchangedTimeline !== !0) && Oh(
7473
7453
  N,
7474
7454
  be,
7475
7455
  G,
@@ -7481,17 +7461,17 @@ async function Ng(t = {}) {
7481
7461
  qt !== null && As(l, ts()),
7482
7462
  A,
7483
7463
  () => Pt.enabled,
7484
- Di,
7464
+ Ui,
7485
7465
  Vn,
7486
7466
  Zi,
7487
7467
  es,
7488
7468
  xe,
7489
- Hn,
7469
+ Fn,
7490
7470
  ($) => {
7491
- vt() || (Zo(), _t = !0, Ke(!0, "send"), Ve(), k.sendMessage($));
7471
+ St() || (Zo(), bt = !0, Ke(!0, "send"), Ve(), k.sendMessage($));
7492
7472
  },
7493
7473
  () => {
7494
- _t = !0, Ke(!0, "send"), Ve(), k.retryLastMessage();
7474
+ bt = !0, Ke(!0, "send"), Ve(), k.retryLastMessage();
7495
7475
  },
7496
7476
  e.morningReport,
7497
7477
  () => {
@@ -7521,7 +7501,7 @@ async function Ng(t = {}) {
7521
7501
  dismissedCandidateIds: /* @__PURE__ */ new Set(),
7522
7502
  actionCandidate: $n,
7523
7503
  error: mn,
7524
- characterIconOptions: Hn(),
7504
+ characterIconOptions: Fn(),
7525
7505
  socialPostRewardsUrl: e.socialPostRewardsUrl,
7526
7506
  onSeen: () => {
7527
7507
  },
@@ -7547,14 +7527,14 @@ async function Ng(t = {}) {
7547
7527
  e.proactiveSuggestion !== null || rt !== null
7548
7528
  ), me(), je();
7549
7529
  const z = Array.isArray(l.activeScheduledFollowUps) ? l.activeScheduledFollowUps : null, ce = (z !== null ? z.map(($) => $.dueAt) : l.messages.map(($) => $.scheduledCheckInAt)).filter(($) => !!$).filter(($) => An($) !== null).sort(($, rs) => Date.parse($) - Date.parse(rs))[0] ?? null, Xe = ce ? Ed(ce) : null;
7550
- Xe !== null && (bt = window.setTimeout(
7530
+ Xe !== null && (yt = window.setTimeout(
7551
7531
  () => {
7552
- bt = null, Ne || ae(k.getState());
7532
+ yt = null, Ne || ae(k.getState());
7553
7533
  },
7554
7534
  Math.min(Xe, 2147483647)
7555
- )), A ? (Rt = N.scrollTop, Ve()) : I && sh(l) && Pl();
7535
+ )), A ? (Rt = N.scrollTop, Ve()) : I && th(l) && Pl();
7556
7536
  }, er = () => {
7557
- f.getSelection()?.isCollapsed !== !1 && Yh(Vn) && ae(k.getState());
7537
+ f.getSelection()?.isCollapsed !== !1 && Gh(Vn) && ae(k.getState());
7558
7538
  };
7559
7539
  f.addEventListener(
7560
7540
  "selectionchange",
@@ -7566,9 +7546,9 @@ async function Ng(t = {}) {
7566
7546
  }, Kn = !1), qt = null, $e.hidden = !0;
7567
7547
  return;
7568
7548
  }
7569
- Kn || (Kn = !0, Gn = Fp(
7570
- (y) => {
7571
- qt = y, !Ne && As(k.getState(), ts()) && ae(k.getState());
7549
+ Kn || (Kn = !0, Gn = Wp(
7550
+ (b) => {
7551
+ qt = b, !Ne && As(k.getState(), ts()) && ae(k.getState());
7572
7552
  },
7573
7553
  {
7574
7554
  backendUrl: e.backendUrl,
@@ -7595,17 +7575,17 @@ async function Ng(t = {}) {
7595
7575
  const ce = k.getModel(), Xe = ai(ce) ? ce : gi[0].value;
7596
7576
  Xe !== et && (et = Xe, Gt());
7597
7577
  }
7598
- l.taskStatus ? Dn?.setStatus(l.taskStatus) : Dn?.clear(), l.status === "connected" && (Hi = !0, on && queueMicrotask(() => {
7578
+ l.taskStatus ? Un?.setStatus(l.taskStatus) : Un?.clear(), l.status === "connected" && (Fi = !0, on && queueMicrotask(() => {
7599
7579
  jo();
7600
7580
  })), Qo();
7601
- const u = Qi && !l.isThinking, y = Eo !== location.origin || Ao !== l.sessionId || Mo !== (l.user?.id ?? null), I = Qi !== l.isThinking, A = Ni !== "connected" && l.status === "connected", z = Ni === "connected" && l.status !== "connected";
7602
- Eo = location.origin, Ao = l.sessionId, Mo = l.user?.id ?? null, Ni = l.status, Qi = l.isThinking, z && Oe !== null && (window.clearTimeout(Oe), Oe = null), r.classList.contains("pluno-pa-widget--open") && l.status === "connected" && (y || I || A) && Oi(), pe && (pe.hidden = K("task_notifications") === void 0), x && (x.hidden = K("tab_group_permission") === void 0), u && !r.classList.contains("pluno-pa-widget--open") && (hn = !0), Gi(), l.appearance ? (Xi = !0, De(
7581
+ const u = Qi && !l.isThinking, b = Eo !== location.origin || Ao !== l.sessionId || Mo !== (l.user?.id ?? null), I = Qi !== l.isThinking, A = Ni !== "connected" && l.status === "connected", z = Ni === "connected" && l.status !== "connected";
7582
+ Eo = location.origin, Ao = l.sessionId, Mo = l.user?.id ?? null, Ni = l.status, Qi = l.isThinking, z && Oe !== null && (window.clearTimeout(Oe), Oe = null), r.classList.contains("pluno-pa-widget--open") && l.status === "connected" && (b || I || A) && Oi(), pe && (pe.hidden = K("task_notifications") === void 0), x && (x.hidden = K("tab_group_permission") === void 0), u && !r.classList.contains("pluno-pa-widget--open") && (hn = !0), Gi(), l.appearance ? (Xi = !0, Ue(
7603
7583
  "web-sdk.widget",
7604
7584
  "Agent state supplied appearance",
7605
7585
  {
7606
7586
  appearance: l.appearance
7607
7587
  }
7608
- ), os(l.appearance, "agent.state.appearance")) : Xi && (Xi = !1, De(
7588
+ ), os(l.appearance, "agent.state.appearance")) : Xi && (Xi = !1, Ue(
7609
7589
  "web-sdk.widget",
7610
7590
  "Agent state cleared appearance; reverting to configured widget options",
7611
7591
  {
@@ -7616,7 +7596,7 @@ async function Ng(t = {}) {
7616
7596
  ), os({}, "agent.state.appearance-cleared")), ae(l, { skipUnchangedTimeline: !0 }), me(), u && Oo();
7617
7597
  });
7618
7598
  const ss = k.getState();
7619
- return ss.taskStatus && Dn?.setStatus(ss.taskStatus), ae(ss), me(), Ki(), {
7599
+ return ss.taskStatus && Un?.setStatus(ss.taskStatus), ae(ss), me(), Ki(), {
7620
7600
  agent: k,
7621
7601
  startNewChat: wn,
7622
7602
  host: o,
@@ -7624,8 +7604,8 @@ async function Ng(t = {}) {
7624
7604
  l.scribbleStyle !== void 0 && (e.scribbleStyle = l.scribbleStyle), os(l, "widgetHandle.updateAppearance");
7625
7605
  },
7626
7606
  openPanel: (l) => {
7627
- const u = typeof l == "string" ? l : T.value, y = typeof l == "object" ? l.focusComposer !== !1 : !0, I = typeof l == "object" ? l.trigger ?? "external_request" : "external_request";
7628
- Ye(u, !1, y, !0, I);
7607
+ const u = typeof l == "string" ? l : T.value, b = typeof l == "object" ? l.focusComposer !== !1 : !0, I = typeof l == "object" ? l.trigger ?? "external_request" : "external_request";
7608
+ Ye(u, !1, b, !0, I);
7629
7609
  },
7630
7610
  closePanel: zi,
7631
7611
  updateDisplayState: (l) => {
@@ -7646,26 +7626,26 @@ async function Ng(t = {}) {
7646
7626
  ), f.removeEventListener(
7647
7627
  "keydown",
7648
7628
  Yo
7649
- ), Wo?.disconnect(), Bl(), f.defaultView?.removeEventListener(
7629
+ ), Ho?.disconnect(), Bl(), f.defaultView?.removeEventListener(
7650
7630
  "pointerdown",
7651
- Fo,
7631
+ Wo,
7652
7632
  !0
7653
7633
  ), f.defaultView?.removeEventListener(
7654
7634
  "focus",
7655
- Fn,
7635
+ Wn,
7656
7636
  !0
7657
7637
  ), f.defaultView?.removeEventListener(
7658
7638
  "focusin",
7659
- Fn,
7639
+ Wn,
7660
7640
  !0
7661
7641
  ), f.removeEventListener(
7662
7642
  "dragover",
7663
7643
  Go,
7664
7644
  !0
7665
- ), f.removeEventListener("drop", It, !0), f.removeEventListener("dragend", It, !0), f.defaultView?.removeEventListener(
7645
+ ), f.removeEventListener("drop", vt, !0), f.removeEventListener("dragend", vt, !0), f.defaultView?.removeEventListener(
7666
7646
  "blur",
7667
- It
7668
- ), window.removeEventListener("resize", Do), Uo(), Nl(), Ol(), at !== null && window.clearTimeout(at), Oe !== null && (window.clearTimeout(Oe), Oe = null), Ml(), Lt !== null && (window.clearTimeout(Lt), Lt = null), bt !== null && (window.clearTimeout(bt), bt = null), Gn(), Dn?.clear(), xo && k.destroy(), Li?.release(), o.remove());
7647
+ vt
7648
+ ), window.removeEventListener("resize", Uo), Do(), Nl(), Ol(), at !== null && window.clearTimeout(at), Oe !== null && (window.clearTimeout(Oe), Oe = null), Ml(), Lt !== null && (window.clearTimeout(Lt), Lt = null), yt !== null && (window.clearTimeout(yt), yt = null), Gn(), Un?.clear(), xo && k.destroy(), Li?.release(), o.remove());
7669
7649
  }
7670
7650
  };
7671
7651
  async function Vl(l) {
@@ -7678,9 +7658,9 @@ async function Ng(t = {}) {
7678
7658
  if (!u)
7679
7659
  throw new Error("Pluno did not return a referral link.");
7680
7660
  await Yl(u);
7681
- const y = K("social_share");
7682
- if (y) {
7683
- await de(y, "dismiss");
7661
+ const b = K("social_share");
7662
+ if (b) {
7663
+ await de(b, "dismiss");
7684
7664
  return;
7685
7665
  }
7686
7666
  } catch (u) {
@@ -7697,31 +7677,31 @@ async function Ng(t = {}) {
7697
7677
  return;
7698
7678
  } catch {
7699
7679
  }
7700
- const u = ni(f), y = u instanceof HTMLElement ? u : null, I = document.createElement("textarea");
7680
+ const u = ni(f), b = u instanceof HTMLElement ? u : null, I = document.createElement("textarea");
7701
7681
  I.value = l, I.readOnly = !0, I.setAttribute("aria-hidden", "true"), I.style.position = "fixed", I.style.left = "-9999px", I.style.opacity = "0", document.body.appendChild(I);
7702
7682
  try {
7703
7683
  if (I.select(), I.setSelectionRange(0, l.length), !document.execCommand("copy"))
7704
7684
  throw new Error("Could not copy referral link.");
7705
7685
  } finally {
7706
- I.remove(), y?.isConnected && wt(y, "referral_copy_restore", {
7686
+ I.remove(), b?.isConnected && Mt(b, "referral_copy_restore", {
7707
7687
  preventScroll: !0
7708
7688
  });
7709
7689
  }
7710
7690
  }
7711
7691
  function os(l, u) {
7712
- const y = l.accentColor ?? e.accentColor, I = l.colorScheme ?? e.colorScheme, A = l.fontFamily ?? e.fontFamily, z = l.scribbleStyle ?? e.scribbleStyle;
7692
+ const b = l.accentColor ?? e.accentColor, I = l.colorScheme ?? e.colorScheme, A = l.fontFamily ?? e.fontFamily, z = l.scribbleStyle ?? e.scribbleStyle;
7713
7693
  d = Zr(
7714
- y,
7694
+ b,
7715
7695
  z
7716
7696
  ), ea(r, d, {
7717
- accentColor: y,
7697
+ accentColor: b,
7718
7698
  colorScheme: I,
7719
7699
  fontFamily: A,
7720
7700
  scribbleStyle: z
7721
- }), De("web-sdk.widget", "Updated widget appearance", {
7701
+ }), Ue("web-sdk.widget", "Updated widget appearance", {
7722
7702
  source: u,
7723
7703
  inputAppearance: l,
7724
- appliedAccentColor: y,
7704
+ appliedAccentColor: b,
7725
7705
  appliedColorScheme: I,
7726
7706
  appliedFontFamily: A,
7727
7707
  appliedScribbleStyle: z,
@@ -7732,11 +7712,11 @@ async function Ng(t = {}) {
7732
7712
  function Zr(t, e) {
7733
7713
  return { accentColor: t, scribbleStyle: e };
7734
7714
  }
7735
- function Og(t) {
7736
- const e = qg(t);
7737
- return e === null ? "#fafafa" : zg(e) > 0.5 ? "#18181b" : "#fafaf9";
7715
+ function Ng(t) {
7716
+ const e = Og(t);
7717
+ return e === null ? "#fafafa" : qg(e) > 0.5 ? "#18181b" : "#fafaf9";
7738
7718
  }
7739
- function qg(t) {
7719
+ function Og(t) {
7740
7720
  const e = t.trim();
7741
7721
  return /^#[0-9a-f]{6}$/i.test(e) ? [
7742
7722
  Number.parseInt(e.slice(1, 3), 16),
@@ -7748,7 +7728,7 @@ function qg(t) {
7748
7728
  Number.parseInt(e[3] + e[3], 16)
7749
7729
  ] : null;
7750
7730
  }
7751
- function zg([t, e, n]) {
7731
+ function qg([t, e, n]) {
7752
7732
  const i = (s) => {
7753
7733
  const o = s / 255;
7754
7734
  return o <= 0.03928 ? o / 12.92 : ((o + 0.055) / 1.055) ** 2.4;
@@ -7766,8 +7746,8 @@ function ea(t, e, n) {
7766
7746
  const i = n.scribbleStyle ? nl(n.accentColor) : n.accentColor;
7767
7747
  t.style.setProperty("--pluno-pa-accent", i), n.scribbleStyle ? t.style.setProperty(
7768
7748
  "--pluno-pa-accent-contrast",
7769
- Og(i)
7770
- ) : t.style.removeProperty("--pluno-pa-accent-contrast"), t.style.fontFamily = n.scribbleStyle ? _g : n.fontFamily, n.scribbleStyle && Bg(t.ownerDocument);
7749
+ Ng(i)
7750
+ ) : t.style.removeProperty("--pluno-pa-accent-contrast"), t.style.fontFamily = n.scribbleStyle ? bg : n.fontFamily, n.scribbleStyle && zg(t.ownerDocument);
7771
7751
  const s = Array.from(
7772
7752
  t.querySelectorAll(".pluno-pa-widget__character")
7773
7753
  );
@@ -7779,7 +7759,7 @@ function ea(t, e, n) {
7779
7759
  )
7780
7760
  );
7781
7761
  }
7782
- function Bg(t) {
7762
+ function zg(t) {
7783
7763
  if (t.getElementById(Xr))
7784
7764
  return;
7785
7765
  const e = t.createElement("style");
@@ -7791,7 +7771,7 @@ function Bg(t) {
7791
7771
  src: url("https://fonts.gstatic.com/s/architectsdaughter/v20/KtkxAKiDZI_td1Lkx62xHZHDtgO_Y-bvTYlg4-7jA-U.woff2") format("woff2");
7792
7772
  }`, t.head.appendChild(e), t.fonts?.load('16px "Architects Daughter"');
7793
7773
  }
7794
- function Fg({
7774
+ function Bg({
7795
7775
  root: t,
7796
7776
  launcher: e,
7797
7777
  launcherDragHandle: n,
@@ -7808,11 +7788,11 @@ function Fg({
7808
7788
  if (a !== S.pointerId || !r || !d)
7809
7789
  return;
7810
7790
  S.preventDefault();
7811
- const v = S.clientX - r.x, U = S.clientY - r.y;
7812
- !c && Math.hypot(v, U) < Si || (c = !0, t.classList.add("pluno-pa-widget--dragging"), s({ x: d.x + v, y: d.y + U }));
7791
+ const v = S.clientX - r.x, D = S.clientY - r.y;
7792
+ !c && Math.hypot(v, D) < Si || (c = !0, t.classList.add("pluno-pa-widget--dragging"), s({ x: d.x + v, y: d.y + D }));
7813
7793
  }, w = (S) => {
7814
7794
  a === S.pointerId && (S.preventDefault(), S.stopPropagation(), c && (p = { x: S.clientX, y: S.clientY }, o()), h());
7815
- }, b = (S) => {
7795
+ }, y = (S) => {
7816
7796
  a === S.pointerId && (S.preventDefault(), h());
7817
7797
  }, f = (S) => {
7818
7798
  if (!p)
@@ -7825,12 +7805,12 @@ function Fg({
7825
7805
  }, _ = (S) => {
7826
7806
  if (t.classList.contains("pluno-pa-widget--open") || t.classList.contains("pluno-pa-widget--closing"))
7827
7807
  return;
7828
- const v = S.shiftKey ? fo : ho, U = i();
7808
+ const v = S.shiftKey ? fo : ho, D = i();
7829
7809
  let B = null;
7830
- S.key === "ArrowUp" ? B = { x: U.x, y: U.y - v } : S.key === "ArrowDown" ? B = { x: U.x, y: U.y + v } : S.key === "ArrowLeft" ? B = { x: U.x - v, y: U.y } : S.key === "ArrowRight" && (B = { x: U.x + v, y: U.y }), B && (S.preventDefault(), S.stopPropagation(), s(B), o());
7810
+ S.key === "ArrowUp" ? B = { x: D.x, y: D.y - v } : S.key === "ArrowDown" ? B = { x: D.x, y: D.y + v } : S.key === "ArrowLeft" ? B = { x: D.x - v, y: D.y } : S.key === "ArrowRight" && (B = { x: D.x + v, y: D.y }), B && (S.preventDefault(), S.stopPropagation(), s(B), o());
7831
7811
  };
7832
- return e.addEventListener("pointerdown", m), e.addEventListener("pointermove", g), e.addEventListener("pointerup", w), e.addEventListener("pointercancel", b), e.addEventListener("click", f, !0), n.addEventListener("keydown", _), () => {
7833
- e.removeEventListener("pointerdown", m), e.removeEventListener("pointermove", g), e.removeEventListener("pointerup", w), e.removeEventListener("pointercancel", b), e.removeEventListener("click", f, !0), n.removeEventListener("keydown", _);
7812
+ return e.addEventListener("pointerdown", m), e.addEventListener("pointermove", g), e.addEventListener("pointerup", w), e.addEventListener("pointercancel", y), e.addEventListener("click", f, !0), n.addEventListener("keydown", _), () => {
7813
+ e.removeEventListener("pointerdown", m), e.removeEventListener("pointermove", g), e.removeEventListener("pointerup", w), e.removeEventListener("pointercancel", y), e.removeEventListener("click", f, !0), n.removeEventListener("keydown", _);
7834
7814
  };
7835
7815
  }
7836
7816
  function Wg({
@@ -7843,22 +7823,22 @@ function Wg({
7843
7823
  let o = null, a = null, r = null, d = !1;
7844
7824
  const c = () => {
7845
7825
  o = null, a = null, r = null, d = !1, t.classList.remove("pluno-pa-widget--panel-dragging");
7846
- }, p = (b) => {
7847
- t.classList.contains("pluno-pa-widget--open") && (b.preventDefault(), b.stopPropagation(), o = b.pointerId, a = { x: b.clientX, y: b.clientY }, r = n(), d = !1, e.setPointerCapture?.(b.pointerId));
7848
- }, h = (b) => {
7849
- if (o !== b.pointerId || !a || !r)
7826
+ }, p = (y) => {
7827
+ t.classList.contains("pluno-pa-widget--open") && (y.preventDefault(), y.stopPropagation(), o = y.pointerId, a = { x: y.clientX, y: y.clientY }, r = n(), d = !1, e.setPointerCapture?.(y.pointerId));
7828
+ }, h = (y) => {
7829
+ if (o !== y.pointerId || !a || !r)
7850
7830
  return;
7851
- b.preventDefault(), b.stopPropagation();
7852
- const f = b.clientX - a.x, _ = b.clientY - a.y;
7831
+ y.preventDefault(), y.stopPropagation();
7832
+ const f = y.clientX - a.x, _ = y.clientY - a.y;
7853
7833
  !d && Math.hypot(f, _) < Si || (d = !0, t.classList.add("pluno-pa-widget--panel-dragging"), i({ x: r.x + f, y: r.y + _ }));
7854
- }, m = (b) => {
7855
- o === b.pointerId && (b.preventDefault(), b.stopPropagation(), d && s(), c());
7856
- }, g = (b) => {
7857
- o === b.pointerId && (b.preventDefault(), c());
7858
- }, w = (b) => {
7859
- const f = b.shiftKey ? fo : ho, _ = n();
7834
+ }, m = (y) => {
7835
+ o === y.pointerId && (y.preventDefault(), y.stopPropagation(), d && s(), c());
7836
+ }, g = (y) => {
7837
+ o === y.pointerId && (y.preventDefault(), c());
7838
+ }, w = (y) => {
7839
+ const f = y.shiftKey ? fo : ho, _ = n();
7860
7840
  let S = null;
7861
- b.key === "ArrowUp" ? S = { x: _.x, y: _.y - f } : b.key === "ArrowDown" ? S = { x: _.x, y: _.y + f } : b.key === "ArrowLeft" ? S = { x: _.x - f, y: _.y } : b.key === "ArrowRight" && (S = { x: _.x + f, y: _.y }), S && (b.preventDefault(), b.stopPropagation(), i(S), s());
7841
+ y.key === "ArrowUp" ? S = { x: _.x, y: _.y - f } : y.key === "ArrowDown" ? S = { x: _.x, y: _.y + f } : y.key === "ArrowLeft" ? S = { x: _.x - f, y: _.y } : y.key === "ArrowRight" && (S = { x: _.x + f, y: _.y }), S && (y.preventDefault(), y.stopPropagation(), i(S), s());
7862
7842
  };
7863
7843
  return e.addEventListener("pointerdown", p), e.addEventListener("pointermove", h), e.addEventListener("pointerup", m), e.addEventListener("pointercancel", g), e.addEventListener("keydown", w), () => {
7864
7844
  e.removeEventListener("pointerdown", p), e.removeEventListener("pointermove", h), e.removeEventListener("pointerup", m), e.removeEventListener("pointercancel", g), e.removeEventListener("keydown", w);
@@ -7889,16 +7869,16 @@ function Hg({
7889
7869
  o === f.pointerId && (f.preventDefault(), f.stopPropagation(), c && s(), p());
7890
7870
  }, w = (f) => {
7891
7871
  o === f.pointerId && (f.preventDefault(), p());
7892
- }, b = (f) => {
7893
- const S = f.currentTarget.dataset.resizeDirection, v = f.shiftKey ? fo : ho, U = n();
7872
+ }, y = (f) => {
7873
+ const S = f.currentTarget.dataset.resizeDirection, v = f.shiftKey ? fo : ho, D = n();
7894
7874
  let B = 0, E = 0;
7895
- ta(S) && (f.key === "ArrowLeft" ? B = -v : f.key === "ArrowRight" ? B = v : f.key === "ArrowUp" ? E = -v : f.key === "ArrowDown" && (E = v), !(B === 0 && E === 0) && (f.preventDefault(), f.stopPropagation(), i(na(U, S, B, E)), s()));
7875
+ ta(S) && (f.key === "ArrowLeft" ? B = -v : f.key === "ArrowRight" ? B = v : f.key === "ArrowUp" ? E = -v : f.key === "ArrowDown" && (E = v), !(B === 0 && E === 0) && (f.preventDefault(), f.stopPropagation(), i(na(D, S, B, E)), s()));
7896
7876
  };
7897
7877
  for (const f of e)
7898
- f.addEventListener("pointerdown", h), f.addEventListener("pointermove", m), f.addEventListener("pointerup", g), f.addEventListener("pointercancel", w), f.addEventListener("keydown", b);
7878
+ f.addEventListener("pointerdown", h), f.addEventListener("pointermove", m), f.addEventListener("pointerup", g), f.addEventListener("pointercancel", w), f.addEventListener("keydown", y);
7899
7879
  return () => {
7900
7880
  for (const f of e)
7901
- f.removeEventListener("pointerdown", h), f.removeEventListener("pointermove", m), f.removeEventListener("pointerup", g), f.removeEventListener("pointercancel", w), f.removeEventListener("keydown", b);
7881
+ f.removeEventListener("pointerdown", h), f.removeEventListener("pointermove", m), f.removeEventListener("pointerup", g), f.removeEventListener("pointercancel", w), f.removeEventListener("keydown", y);
7902
7882
  };
7903
7883
  }
7904
7884
  function ta(t) {
@@ -7923,11 +7903,11 @@ function na(t, e, n, i) {
7923
7903
  delta: i,
7924
7904
  resizeLeading: e.startsWith("top") || e === "top",
7925
7905
  resizeTrailing: e.startsWith("bottom") || e === "bottom",
7926
- minLeading: Ht,
7906
+ minLeading: Ft,
7927
7907
  maxTrailing: s.height - V,
7928
7908
  minLength: Math.min(
7929
7909
  go,
7930
- s.height - Ht - V
7910
+ s.height - Ft - V
7931
7911
  )
7932
7912
  });
7933
7913
  return {
@@ -7985,38 +7965,38 @@ function ia({
7985
7965
  function En(t, e = !0) {
7986
7966
  const n = Ce();
7987
7967
  if (t.classList.contains("pluno-pa-widget--minimized")) {
7988
- const o = typeof window.matchMedia == "function" && window.matchMedia("(hover: none), (pointer: coarse)").matches ? vg : Sg;
7968
+ const o = typeof window.matchMedia == "function" && window.matchMedia("(hover: none), (pointer: coarse)").matches ? Sg : _g;
7989
7969
  return { width: o, height: o };
7990
7970
  }
7991
7971
  const i = t.getBoundingClientRect(), s = !t.classList.contains("pluno-pa-widget--open") && !t.classList.contains("pluno-pa-widget--closing");
7992
7972
  return {
7993
7973
  width: e && s && i.width > 0 ? i.width : Math.min(rl, n.width - 36),
7994
- height: e && s && i.height > 0 ? i.height : t.classList.contains("pluno-pa-widget--scribble") ? xg : al
7974
+ height: e && s && i.height > 0 ? i.height : t.classList.contains("pluno-pa-widget--scribble") ? Ig : al
7995
7975
  };
7996
7976
  }
7997
- function $g() {
7977
+ function Fg() {
7998
7978
  const t = Ce();
7999
7979
  return {
8000
7980
  width: Math.min(
8001
7981
  Be(
8002
- t.width * kg,
7982
+ t.width * Tg,
8003
7983
  po,
8004
- Tg
7984
+ xg
8005
7985
  ),
8006
7986
  t.width - V * 2
8007
7987
  ),
8008
7988
  height: Math.min(
8009
7989
  Be(
8010
- t.height * Eg,
7990
+ t.height * Cg,
8011
7991
  go,
8012
- Cg
7992
+ kg
8013
7993
  ),
8014
- t.height - Ht - V
7994
+ t.height - Ft - V
8015
7995
  )
8016
7996
  };
8017
7997
  }
8018
7998
  function Bt(t = null) {
8019
- return t ? Ci(t) : $g();
7999
+ return t ? Ci(t) : Fg();
8020
8000
  }
8021
8001
  function Ci(t) {
8022
8002
  const e = Ce();
@@ -8036,11 +8016,11 @@ function Ci(t) {
8036
8016
  t.height,
8037
8017
  Math.min(
8038
8018
  go,
8039
- e.height - Ht - V
8019
+ e.height - Ft - V
8040
8020
  ),
8041
8021
  Math.max(
8042
8022
  V,
8043
- e.height - Ht - V
8023
+ e.height - Ft - V
8044
8024
  )
8045
8025
  )
8046
8026
  };
@@ -8053,7 +8033,7 @@ function vs(t, e) {
8053
8033
  const n = Ci(e);
8054
8034
  t.style.setProperty("--pluno-pa-panel-width", `${n.width}px`), t.style.setProperty("--pluno-pa-panel-height", `${n.height}px`);
8055
8035
  }
8056
- function jg(t, e, n) {
8036
+ function $g(t, e, n) {
8057
8037
  const i = Number.parseFloat(t.style.left), s = Number.parseFloat(t.style.top);
8058
8038
  if (Number.isFinite(i) && Number.isFinite(s))
8059
8039
  return { x: i, y: s };
@@ -8072,9 +8052,9 @@ function Is(t, e, n) {
8072
8052
  t,
8073
8053
  pi(e, i),
8074
8054
  i
8075
- ) : Gg(n === "bottom-left" ? "bottom-left" : "bottom-right", i, Ig);
8055
+ ) : jg(n === "bottom-left" ? "bottom-left" : "bottom-right", i, vg);
8076
8056
  }
8077
- function Gg(t, e, n) {
8057
+ function jg(t, e, n) {
8078
8058
  const i = Ce();
8079
8059
  return {
8080
8060
  x: t.endsWith("right") ? Math.max(0, i.width - e.width - n) : n,
@@ -8082,7 +8062,7 @@ function Gg(t, e, n) {
8082
8062
  };
8083
8063
  }
8084
8064
  function ui(t, e, n) {
8085
- const i = Ce(), s = V + Yg(t);
8065
+ const i = Ce(), s = V + Vg(t);
8086
8066
  return {
8087
8067
  x: Be(
8088
8068
  e.x,
@@ -8102,7 +8082,7 @@ function ui(t, e, n) {
8102
8082
  )
8103
8083
  };
8104
8084
  }
8105
- function Kg(t, e) {
8085
+ function Gg(t, e) {
8106
8086
  if (e <= 0)
8107
8087
  return !1;
8108
8088
  const n = Ce(), i = t.top - V - js, s = n.height - t.bottom - V - js;
@@ -8116,19 +8096,19 @@ function pi(t, e) {
8116
8096
  };
8117
8097
  }
8118
8098
  function xs(t, e) {
8119
- const n = Vg(t, e), i = Ce();
8099
+ const n = Kg(t, e), i = Ce();
8120
8100
  return {
8121
8101
  anchor: n,
8122
8102
  x: n.endsWith("right") ? i.width - t.x - e.width : t.x,
8123
8103
  y: n.startsWith("bottom") ? i.height - t.y - e.height : t.y
8124
8104
  };
8125
8105
  }
8126
- function Vg(t, e) {
8106
+ function Kg(t, e) {
8127
8107
  const n = Ce(), i = t.x + e.width / 2, o = t.y + e.height / 2 <= n.height / 2 ? "top" : "bottom", a = i <= n.width / 2 ? "left" : "right";
8128
8108
  return `${o}-${a}`;
8129
8109
  }
8130
- function Yg(t) {
8131
- return t.classList.contains("pluno-pa-widget--scribble") ? Rg : Pg;
8110
+ function Vg(t) {
8111
+ return t.classList.contains("pluno-pa-widget--scribble") ? Pg : Mg;
8132
8112
  }
8133
8113
  function Ts(t, e, n, i = null) {
8134
8114
  const s = En(t), o = Bt(i), a = {
@@ -8137,7 +8117,7 @@ function Ts(t, e, n, i = null) {
8137
8117
  };
8138
8118
  return In(a, o);
8139
8119
  }
8140
- function Xg(t, e, n, i) {
8120
+ function Yg(t, e, n, i) {
8141
8121
  return {
8142
8122
  x: i === "bottom-left" ? t.x : t.x + e.width - n.width,
8143
8123
  y: t.y + e.height - n.height
@@ -8156,15 +8136,15 @@ function In(t, e) {
8156
8136
  ),
8157
8137
  y: Be(
8158
8138
  t.y,
8159
- Ht,
8139
+ Ft,
8160
8140
  Math.max(
8161
- Ht,
8141
+ Ft,
8162
8142
  n.height - e.height - V
8163
8143
  )
8164
8144
  )
8165
8145
  };
8166
8146
  }
8167
- function Tt(t, e) {
8147
+ function xt(t, e) {
8168
8148
  if (t.classList.toggle("pluno-pa-widget--custom-position", e !== null), t.classList.toggle(
8169
8149
  "pluno-pa-widget--proactive-suggestion-left-aligned",
8170
8150
  e !== null && e.x < Ce().width / 2
@@ -8174,7 +8154,7 @@ function Tt(t, e) {
8174
8154
  }
8175
8155
  t.style.left = `${e.x}px`, t.style.top = `${e.y}px`, t.style.right = "auto", t.style.bottom = "auto";
8176
8156
  }
8177
- function Qg(t, e) {
8157
+ function Xg(t, e) {
8178
8158
  t.style.setProperty("--pluno-pa-panel-offset-x", `${e.x}px`), t.style.setProperty("--pluno-pa-panel-offset-y", `${e.y}px`);
8179
8159
  }
8180
8160
  function sa(t) {
@@ -8198,7 +8178,7 @@ function ks(t) {
8198
8178
  function Be(t, e, n) {
8199
8179
  return Math.min(Math.max(t, e), n);
8200
8180
  }
8201
- function De(t, e, n) {
8181
+ function Ue(t, e, n) {
8202
8182
  if (typeof window > "u")
8203
8183
  return;
8204
8184
  const i = window, s = {
@@ -8208,31 +8188,16 @@ function De(t, e, n) {
8208
8188
  details: n
8209
8189
  }, o = i.__plunoProductAgentDiagnostics__ ?? [];
8210
8190
  o.push(s), o.length > 120 && o.splice(0, o.length - 120), i.__plunoProductAgentDiagnostics__ = o, i.__PLUNO_PRODUCT_AGENT_DIAGNOSTICS__ = () => [...o], window.dispatchEvent(
8211
- new CustomEvent(fg, { detail: s })
8191
+ new CustomEvent(hg, { detail: s })
8212
8192
  );
8213
8193
  }
8214
- function Jg(t, e) {
8215
- De("web-sdk.widget.position", t, e);
8194
+ function Qg(t, e) {
8195
+ Ue("web-sdk.widget.position", t, e);
8216
8196
  }
8217
- async function Zg(t, e, n, i, s) {
8197
+ async function Jg(t, e, n, i, s) {
8218
8198
  i(), await t.sendMessage(e, {
8219
8199
  proactiveSuggestionQuestion: s,
8220
- attachments: n.length > 0 ? n.map(nh) : void 0
8221
- });
8222
- }
8223
- function eh(t, e, n) {
8224
- const i = t.activeElement;
8225
- return i === n ? "composer" : i === e ? "launcher" : null;
8226
- }
8227
- function th(t, e, n, i, s) {
8228
- if (!t.focusedInput || !t.focusedInputAt || Date.now() - t.focusedInputAt > ig)
8229
- return;
8230
- const o = t.focusedInput === "composer" ? i : n;
8231
- if (o === i && !e.classList.contains("pluno-pa-widget--open") || o === n && e.classList.contains("pluno-pa-widget--open"))
8232
- return;
8233
- const a = Date.now(), r = t.focusedInputAt;
8234
- window.requestAnimationFrame(() => {
8235
- !o.isConnected || o.readOnly || (s(o, Date.now() - r, a), o.setSelectionRange(o.value.length, o.value.length));
8200
+ attachments: n.length > 0 ? n.map(Zg) : void 0
8236
8201
  });
8237
8202
  }
8238
8203
  function ni(t) {
@@ -8241,7 +8206,7 @@ function ni(t) {
8241
8206
  e = e.shadowRoot.activeElement;
8242
8207
  return e;
8243
8208
  }
8244
- function nh(t) {
8209
+ function Zg(t) {
8245
8210
  return t;
8246
8211
  }
8247
8212
  function Sn(t) {
@@ -8252,7 +8217,7 @@ function xn(t, e = () => !0) {
8252
8217
  e() && (t.scrollTop = t.scrollHeight);
8253
8218
  });
8254
8219
  }
8255
- function ih(t) {
8220
+ function eh(t) {
8256
8221
  return JSON.stringify({
8257
8222
  sessionId: t.sessionId,
8258
8223
  messages: t.messages.map((e) => ({
@@ -8286,13 +8251,13 @@ function ih(t) {
8286
8251
  appearance: t.appearance
8287
8252
  });
8288
8253
  }
8289
- function sh(t) {
8254
+ function th(t) {
8290
8255
  return t.messages.length > 0 || t.assistantDraft.length > 0 || t.pendingMessageStatus !== null || t.isThinking || !!t.lastError;
8291
8256
  }
8292
- function oh(t) {
8257
+ function nh(t) {
8293
8258
  return t.firstUserMessage?.trim() ? t.firstUserMessage : t.title?.trim() ? t.title : "Untitled chat";
8294
8259
  }
8295
- function rh(t) {
8260
+ function ih(t) {
8296
8261
  const e = t.currentPage;
8297
8262
  if (typeof e?.url == "string" && e.url.trim())
8298
8263
  try {
@@ -8303,7 +8268,7 @@ function rh(t) {
8303
8268
  }
8304
8269
  return typeof e?.origin == "string" && e.origin.trim() ? e.origin : "Current origin";
8305
8270
  }
8306
- function ah(t, e) {
8271
+ function sh(t, e) {
8307
8272
  const n = new Date(t).getTime();
8308
8273
  if (!Number.isFinite(n))
8309
8274
  return "now";
@@ -8319,24 +8284,24 @@ function ah(t, e) {
8319
8284
  }
8320
8285
  return "now";
8321
8286
  }
8322
- function lh(t, e, n, i, s) {
8323
- t.appendChild(bh()), t.appendChild(
8324
- dh(
8287
+ function oh(t, e, n, i, s) {
8288
+ t.appendChild(mh()), t.appendChild(
8289
+ rh(
8325
8290
  e,
8326
8291
  n,
8327
8292
  i,
8328
8293
  s
8329
8294
  )
8330
- ), t.appendChild(gh()), t.appendChild(
8295
+ ), t.appendChild(ch()), t.appendChild(
8331
8296
  Ei(
8332
8297
  "pluno-pa-widget__close",
8333
8298
  "Close",
8334
8299
  Xs(16),
8335
8300
  !0
8336
8301
  )
8337
- ), t.appendChild(ch(n, i));
8302
+ ), t.appendChild(ah(n, i));
8338
8303
  }
8339
- function dh(t, e, n, i) {
8304
+ function rh(t, e, n, i) {
8340
8305
  const s = document.createElement("form");
8341
8306
  s.className = "pluno-pa-widget__launcher";
8342
8307
  const o = document.createElement("span");
@@ -8367,7 +8332,7 @@ function dh(t, e, n, i) {
8367
8332
  }
8368
8333
  return s;
8369
8334
  }
8370
- function ch(t, e) {
8335
+ function ah(t, e) {
8371
8336
  const n = document.createElement("section");
8372
8337
  n.className = "pluno-pa-widget__panel", n.hidden = !0, n.appendChild(
8373
8338
  hl("pluno-pa-widget__scribble-spirals--panel", 16)
@@ -8380,7 +8345,7 @@ function ch(t, e) {
8380
8345
  const s = document.createElement("div");
8381
8346
  s.className = "pluno-pa-widget__timeline-wrap";
8382
8347
  const o = document.createElement("main");
8383
- o.className = "pluno-pa-widget__timeline", o.appendChild(mh(t));
8348
+ o.className = "pluno-pa-widget__timeline", o.appendChild(gh(t));
8384
8349
  const a = document.createElement("div");
8385
8350
  a.className = "pluno-pa-widget__timeline-bottom-sentinel", a.setAttribute("aria-hidden", "true"), o.appendChild(a), s.appendChild(o);
8386
8351
  const r = document.createElement("div");
@@ -8392,31 +8357,31 @@ function ch(t, e) {
8392
8357
  Ei(
8393
8358
  "pluno-pa-widget__history",
8394
8359
  Ys(),
8395
- vh(),
8360
+ bh(),
8396
8361
  !0
8397
8362
  )
8398
- ), s.appendChild(c), s.appendChild(fh()), n.appendChild(s), n.appendChild(uh()), n.appendChild(ph()), n.appendChild(hh()), n.appendChild(kt("left", "Resize Pluno from left")), n.appendChild(
8399
- kt("right", "Resize Pluno from right")
8400
- ), n.appendChild(kt("top", "Resize Pluno from top")), n.appendChild(
8401
- kt("bottom", "Resize Pluno from bottom")
8363
+ ), s.appendChild(c), s.appendChild(ph()), n.appendChild(s), n.appendChild(lh()), n.appendChild(dh()), n.appendChild(uh()), n.appendChild(Tt("left", "Resize Pluno from left")), n.appendChild(
8364
+ Tt("right", "Resize Pluno from right")
8365
+ ), n.appendChild(Tt("top", "Resize Pluno from top")), n.appendChild(
8366
+ Tt("bottom", "Resize Pluno from bottom")
8402
8367
  ), n.appendChild(
8403
- kt("top-left", "Resize Pluno from top left")
8368
+ Tt("top-left", "Resize Pluno from top left")
8404
8369
  ), n.appendChild(
8405
- kt("top-right", "Resize Pluno from top right")
8370
+ Tt("top-right", "Resize Pluno from top right")
8406
8371
  ), n.appendChild(
8407
- kt("bottom-left", "Resize Pluno from bottom left")
8372
+ Tt("bottom-left", "Resize Pluno from bottom left")
8408
8373
  ), n.appendChild(
8409
- kt("bottom-right", "Resize Pluno from bottom right")
8374
+ Tt("bottom-right", "Resize Pluno from bottom right")
8410
8375
  ), n;
8411
8376
  }
8412
- function kt(t, e) {
8377
+ function Tt(t, e) {
8413
8378
  const n = document.createElement("button");
8414
8379
  return n.type = "button", n.className = [
8415
8380
  "pluno-pa-widget__resize-handle",
8416
8381
  `pluno-pa-widget__resize-handle--${t}`
8417
8382
  ].join(" "), n.dataset.resizeDirection = t, n.setAttribute("aria-label", e), n.title = e, n;
8418
8383
  }
8419
- function uh() {
8384
+ function lh() {
8420
8385
  const t = document.createElement("div");
8421
8386
  t.className = "pluno-pa-widget__notify-suggestion", t.hidden = !0;
8422
8387
  const e = document.createElement("span");
@@ -8430,7 +8395,7 @@ function uh() {
8430
8395
  const o = document.createElement("button");
8431
8396
  return o.type = "button", o.className = "pluno-pa-widget__notify-suggestion-never", o.textContent = "Never", n.append(i, s, o), t.append(e, n), t;
8432
8397
  }
8433
- function ph() {
8398
+ function dh() {
8434
8399
  const t = document.createElement("div");
8435
8400
  t.className = "pluno-pa-widget__notify-suggestion pluno-pa-widget__tab-groups-suggestion", t.hidden = !0;
8436
8401
  const e = document.createElement("span");
@@ -8442,7 +8407,7 @@ function ph() {
8442
8407
  const s = document.createElement("button");
8443
8408
  return s.type = "button", s.className = "pluno-pa-widget__notify-suggestion-later pluno-pa-widget__tab-groups-suggestion-dismiss", s.textContent = "Not now", n.append(i, s), t.append(e, n), t;
8444
8409
  }
8445
- function gh() {
8410
+ function ch() {
8446
8411
  const t = document.createElement("aside");
8447
8412
  t.className = "pluno-pa-widget__proactive-suggestion", t.hidden = !0;
8448
8413
  const e = document.createElement("button");
@@ -8454,7 +8419,7 @@ function gh() {
8454
8419
  const s = document.createElement("div");
8455
8420
  s.className = "pluno-pa-widget__proactive-suggestion-actions";
8456
8421
  const o = document.createElement("button");
8457
- o.type = "button", o.className = "pluno-pa-widget__proactive-suggestion-edit", o.setAttribute("aria-label", "Edit suggestion"), o.title = "Edit suggestion", o.appendChild(Sh());
8422
+ o.type = "button", o.className = "pluno-pa-widget__proactive-suggestion-edit", o.setAttribute("aria-label", "Edit suggestion"), o.title = "Edit suggestion", o.appendChild(yh());
8458
8423
  const a = document.createElement("button");
8459
8424
  a.type = "button", a.className = "pluno-pa-widget__proactive-suggestion-never-show", a.textContent = "Never";
8460
8425
  const r = document.createElement("button");
@@ -8470,7 +8435,7 @@ function gh() {
8470
8435
  const m = document.createElement("button");
8471
8436
  return m.type = "button", m.className = "pluno-pa-widget__proactive-suggestion-feedback-submit", m.textContent = "Send feedback", m.disabled = !0, d.append(c, p, h, m), t.append(e, i, s, d), t;
8472
8437
  }
8473
- function hh() {
8438
+ function uh() {
8474
8439
  const t = document.createElement("form");
8475
8440
  t.className = "pluno-pa-widget__composer";
8476
8441
  const e = document.createElement("div");
@@ -8484,7 +8449,7 @@ function hh() {
8484
8449
  const o = document.createElement("input");
8485
8450
  o.className = "pluno-pa-widget__attachment-input", o.type = "file", o.multiple = !0, o.tabIndex = -1, o.setAttribute("aria-hidden", "true"), s.appendChild(o);
8486
8451
  const a = document.createElement("button");
8487
- a.type = "button", a.className = "pluno-pa-widget__attach", a.setAttribute("aria-label", "Attach files"), a.title = "Attach files", a.appendChild(xh()), a.appendChild(Th()), s.appendChild(a);
8452
+ a.type = "button", a.className = "pluno-pa-widget__attach", a.setAttribute("aria-label", "Attach files"), a.title = "Attach files", a.appendChild(Sh()), a.appendChild(vh()), s.appendChild(a);
8488
8453
  const r = document.createElement("textarea");
8489
8454
  r.className = "pluno-pa-widget__input", r.rows = 1, r.placeholder = "Ask for anything...", s.appendChild(r);
8490
8455
  const d = document.createElement("button");
@@ -8503,10 +8468,10 @@ function hh() {
8503
8468
  g.appendChild(oa(B));
8504
8469
  const w = document.createElement("details");
8505
8470
  w.className = "pluno-pa-widget__model-more";
8506
- const b = document.createElement("summary"), f = document.createElement("span");
8471
+ const y = document.createElement("summary"), f = document.createElement("span");
8507
8472
  f.textContent = "More";
8508
8473
  const _ = Xs(12);
8509
- _.classList.add("pluno-pa-widget__model-more-chevron"), b.append(f, _), w.appendChild(b);
8474
+ _.classList.add("pluno-pa-widget__model-more-chevron"), y.append(f, _), w.appendChild(y);
8510
8475
  for (const B of Ta) {
8511
8476
  const E = oa(B);
8512
8477
  E.classList.add("pluno-pa-widget__model-more-option"), w.appendChild(E);
@@ -8516,8 +8481,8 @@ function hh() {
8516
8481
  S.className = "pluno-pa-widget__composer-meta";
8517
8482
  const v = document.createElement("a");
8518
8483
  v.className = "pluno-pa-widget__powered-by", v.href = "https://pluno.ai", v.target = "_blank", v.rel = "noopener noreferrer", v.textContent = "Powered by Pluno.ai.", S.appendChild(v);
8519
- const U = document.createElement("span");
8520
- return U.className = "pluno-pa-widget__ai-disclaimer", U.textContent = "AI can make mistakes. Verify outputs.", S.appendChild(U), c.appendChild(S), t.appendChild(c), t;
8484
+ const D = document.createElement("span");
8485
+ return D.className = "pluno-pa-widget__ai-disclaimer", D.textContent = "AI can make mistakes. Verify outputs.", S.appendChild(D), c.appendChild(S), t.appendChild(c), t;
8521
8486
  }
8522
8487
  function oa(t) {
8523
8488
  const e = document.createElement("button");
@@ -8530,7 +8495,7 @@ function oa(t) {
8530
8495
  function Ys() {
8531
8496
  return location.hostname ? `Recent chats on ${location.hostname}` : "Recent chats";
8532
8497
  }
8533
- function fh() {
8498
+ function ph() {
8534
8499
  const t = document.createElement("section");
8535
8500
  t.className = "pluno-pa-widget__history-panel", t.hidden = !0, t.setAttribute("aria-label", Ys());
8536
8501
  const e = document.createElement("div");
@@ -8549,7 +8514,7 @@ function fh() {
8549
8514
  const o = document.createElement("p");
8550
8515
  return o.className = "pluno-pa-widget__history-status", o.hidden = !0, t.append(e, s, o), t;
8551
8516
  }
8552
- function mh(t) {
8517
+ function gh(t) {
8553
8518
  const e = document.createElement("div");
8554
8519
  return e.className = "pluno-pa-widget__empty-state", e.appendChild(
8555
8520
  st(
@@ -8577,13 +8542,13 @@ function pl(t, e) {
8577
8542
  function st(t, e) {
8578
8543
  const n = `pluno-pa-character-${Jr}`;
8579
8544
  Jr += 1;
8580
- const i = e.scribbleStyle ? yh(e.accentColor, n) : wh(e.accentColor, n), s = t.split(/\s+/).filter(Boolean);
8545
+ const i = e.scribbleStyle ? fh(e.accentColor, n) : hh(e.accentColor, n), s = t.split(/\s+/).filter(Boolean);
8581
8546
  return i.setAttribute(
8582
8547
  "class",
8583
8548
  s.includes("pluno-pa-widget__character") ? t : `pluno-pa-widget__character ${t}`
8584
8549
  ), i.setAttribute("aria-hidden", "true"), i.setAttribute("focusable", "false"), i.removeAttribute("role"), i.removeAttribute("aria-label"), i;
8585
8550
  }
8586
- function wh(t, e) {
8551
+ function hh(t, e) {
8587
8552
  const n = Mp(t), i = {
8588
8553
  boltFill: `${e}-boltFill`,
8589
8554
  boltEdge: `${e}-boltEdge`,
@@ -8712,8 +8677,8 @@ function wh(t, e) {
8712
8677
  "flood-color": "#000000",
8713
8678
  "flood-opacity": "0.22"
8714
8679
  });
8715
- const b = M(o, "clipPath", { id: i.boltClip });
8716
- M(b, "path", { d: bi });
8680
+ const y = M(o, "clipPath", { id: i.boltClip });
8681
+ M(y, "path", { d: bi });
8717
8682
  const f = M(s, "g", {
8718
8683
  filter: ze(i.softDropShadow)
8719
8684
  });
@@ -8780,7 +8745,7 @@ function wh(t, e) {
8780
8745
  i
8781
8746
  ), s;
8782
8747
  }
8783
- function yh(t, e) {
8748
+ function fh(t, e) {
8784
8749
  const n = nl(t), i = {
8785
8750
  clip: `${e}-scribbleBoltClip`,
8786
8751
  wobble: `${e}-scribbleBoltWobble`
@@ -8911,7 +8876,7 @@ function Ei(t, e, n, i) {
8911
8876
  const s = document.createElement("button");
8912
8877
  return s.type = "button", s.className = t, s.setAttribute("aria-label", e), s.title = e, s.hidden = i, s.appendChild(n), s;
8913
8878
  }
8914
- function bh() {
8879
+ function mh() {
8915
8880
  const t = q("svg", {
8916
8881
  class: "pluno-pa-widget__scribble-defs",
8917
8882
  "aria-hidden": "true",
@@ -8941,7 +8906,7 @@ function Cs(t, e) {
8941
8906
  0,
8942
8907
  e - Vs * 2
8943
8908
  ), i = Math.max(
8944
- Mg,
8909
+ Ag,
8945
8910
  Math.floor(
8946
8911
  (n - Ks * 2) / Gs
8947
8912
  )
@@ -8954,7 +8919,7 @@ function fl(t, e) {
8954
8919
  const n = e * Gs + Ks * 2;
8955
8920
  t.dataset.spiralCount = `${e}`, t.setAttribute(
8956
8921
  "viewBox",
8957
- `0 0 ${n} ${Ag}`
8922
+ `0 0 ${n} ${Eg}`
8958
8923
  ), t.replaceChildren();
8959
8924
  for (let i = 0; i < e; i += 1) {
8960
8925
  const s = Qr[i % Qr.length], o = q("g", {
@@ -9026,7 +8991,7 @@ function Es(t, e, n) {
9026
8991
  ), i;
9027
8992
  }
9028
8993
  function Xs(t) {
9029
- const e = Fe(
8994
+ const e = We(
9030
8995
  "0 0 24 24",
9031
8996
  t,
9032
8997
  t,
@@ -9036,8 +9001,8 @@ function Xs(t) {
9036
9001
  );
9037
9002
  return e.appendChild(q("path", { d: "m6 9 6 6 6-6" })), e;
9038
9003
  }
9039
- function _h() {
9040
- const t = Fe(
9004
+ function wh() {
9005
+ const t = We(
9041
9006
  "0 0 24 24",
9042
9007
  17,
9043
9008
  17,
@@ -9055,8 +9020,8 @@ function _h() {
9055
9020
  })
9056
9021
  ), t;
9057
9022
  }
9058
- function Sh() {
9059
- const t = Fe(
9023
+ function yh() {
9024
+ const t = We(
9060
9025
  "0 0 24 24",
9061
9026
  14,
9062
9027
  14,
@@ -9070,8 +9035,8 @@ function Sh() {
9070
9035
  })
9071
9036
  ), t.appendChild(q("path", { d: "m15 5 4 4" })), t;
9072
9037
  }
9073
- function vh() {
9074
- const t = Fe(
9038
+ function bh() {
9039
+ const t = We(
9075
9040
  "0 0 24 24",
9076
9041
  17,
9077
9042
  17,
@@ -9081,8 +9046,8 @@ function vh() {
9081
9046
  );
9082
9047
  return t.appendChild(q("path", { d: "M3 12a9 9 0 1 0 3-6.7" })), t.appendChild(q("path", { d: "M3 4v5h5" })), t.appendChild(q("path", { d: "M12 7v5l3 2" })), t;
9083
9048
  }
9084
- function Ih(t) {
9085
- const e = Fe(
9049
+ function _h(t) {
9050
+ const e = We(
9086
9051
  "0 0 16 16",
9087
9052
  14,
9088
9053
  14,
@@ -9099,7 +9064,7 @@ function Ih(t) {
9099
9064
  return e;
9100
9065
  }
9101
9066
  function mo() {
9102
- const t = Fe(
9067
+ const t = We(
9103
9068
  "0 0 24 24",
9104
9069
  15,
9105
9070
  15,
@@ -9110,7 +9075,7 @@ function mo() {
9110
9075
  return t.appendChild(q("path", { d: "M18 6 6 18" })), t.appendChild(q("path", { d: "m6 6 12 12" })), t;
9111
9076
  }
9112
9077
  function ml() {
9113
- const t = Fe(
9078
+ const t = We(
9114
9079
  "0 0 24 24",
9115
9080
  14,
9116
9081
  14,
@@ -9122,8 +9087,8 @@ function ml() {
9122
9087
  q("line", { x1: "12", y1: "19", x2: "12", y2: "5" })
9123
9088
  ), t.appendChild(q("polyline", { points: "5 12 12 5 19 12" })), t;
9124
9089
  }
9125
- function xh() {
9126
- const t = Fe(
9090
+ function Sh() {
9091
+ const t = We(
9127
9092
  "0 0 24 24",
9128
9093
  16,
9129
9094
  16,
@@ -9140,8 +9105,8 @@ function xh() {
9140
9105
  })
9141
9106
  ), t;
9142
9107
  }
9143
- function Th() {
9144
- const t = Fe("0 0 24 24", 19, 19, "none", "currentColor");
9108
+ function vh() {
9109
+ const t = We("0 0 24 24", 19, 19, "none", "currentColor");
9145
9110
  return t.setAttribute(
9146
9111
  "class",
9147
9112
  "pluno-pa-widget__paperclip-icon pluno-pa-widget__paperclip-icon--scribble"
@@ -9155,8 +9120,8 @@ function Th() {
9155
9120
  })
9156
9121
  ), t;
9157
9122
  }
9158
- function kh() {
9159
- const t = Fe("0 0 24 24", 18, 18, "currentColor");
9123
+ function Ih() {
9124
+ const t = We("0 0 24 24", 18, 18, "currentColor");
9160
9125
  return t.appendChild(
9161
9126
  q("rect", {
9162
9127
  x: "6",
@@ -9167,8 +9132,8 @@ function kh() {
9167
9132
  })
9168
9133
  ), t;
9169
9134
  }
9170
- function Ch() {
9171
- const t = Fe(
9135
+ function xh() {
9136
+ const t = We(
9172
9137
  "0 0 24 24",
9173
9138
  12,
9174
9139
  12,
@@ -9178,8 +9143,8 @@ function Ch() {
9178
9143
  );
9179
9144
  return t.appendChild(q("path", { d: "M18 6 6 18" })), t.appendChild(q("path", { d: "m6 6 12 12" })), t;
9180
9145
  }
9181
- function Eh() {
9182
- const t = Fe(
9146
+ function Th() {
9147
+ const t = We(
9183
9148
  "0 0 24 24",
9184
9149
  13,
9185
9150
  13,
@@ -9202,7 +9167,7 @@ function Eh() {
9202
9167
  })
9203
9168
  ), t;
9204
9169
  }
9205
- function Fe(t, e, n, i, s, o) {
9170
+ function We(t, e, n, i, s, o) {
9206
9171
  const a = {
9207
9172
  viewBox: t,
9208
9173
  width: String(e),
@@ -9253,39 +9218,39 @@ function bl(t) {
9253
9218
  e.input.value === n && e.input.selectionStart === e.start && e.input.selectionEnd === e.end && yl(e);
9254
9219
  });
9255
9220
  }
9256
- function Ah(t, e, n) {
9221
+ function kh(t, e, n) {
9257
9222
  t.replaceChildren(), t.hidden = e.length === 0;
9258
9223
  for (let i = 0; i < e.length; i += 1) {
9259
9224
  const s = e[i], o = document.createElement("div");
9260
- o.className = "pluno-pa-widget__attachment", o.appendChild(Mh(s));
9225
+ o.className = "pluno-pa-widget__attachment", o.appendChild(Ch(s));
9261
9226
  const a = document.createElement("span");
9262
9227
  a.textContent = s.name, o.appendChild(a);
9263
9228
  const r = document.createElement("button");
9264
- r.type = "button", r.setAttribute("aria-label", `Remove ${s.name}`), r.appendChild(Ch()), r.addEventListener("click", () => n(i)), o.appendChild(r), t.appendChild(o);
9229
+ r.type = "button", r.setAttribute("aria-label", `Remove ${s.name}`), r.appendChild(xh()), r.addEventListener("click", () => n(i)), o.appendChild(r), t.appendChild(o);
9265
9230
  }
9266
9231
  }
9267
- function Mh(t) {
9232
+ function Ch(t) {
9268
9233
  const e = wo(t), n = vi(t);
9269
9234
  if (e === "image" && n) {
9270
9235
  const i = document.createElement("img");
9271
9236
  return i.src = n, i.alt = "", i.setAttribute("aria-hidden", "true"), i.addEventListener(
9272
9237
  "error",
9273
- () => i.replaceWith(Ft(t))
9238
+ () => i.replaceWith(Wt(t))
9274
9239
  ), i;
9275
9240
  }
9276
9241
  if (e === "video" && n) {
9277
9242
  const i = document.createElement("video");
9278
9243
  return i.src = n, i.muted = !0, i.preload = "metadata", i.setAttribute("aria-hidden", "true"), i.addEventListener(
9279
9244
  "error",
9280
- () => i.replaceWith(Ft(t))
9245
+ () => i.replaceWith(Wt(t))
9281
9246
  ), i.addEventListener(
9282
9247
  "stalled",
9283
- () => i.replaceWith(Ft(t))
9248
+ () => i.replaceWith(Wt(t))
9284
9249
  ), i;
9285
9250
  }
9286
- return Ft(t);
9251
+ return Wt(t);
9287
9252
  }
9288
- function Ph(t, e) {
9253
+ function Eh(t, e) {
9289
9254
  const n = wo(t), i = vi(t);
9290
9255
  if (n === "image" && i) {
9291
9256
  const s = document.createElement("img");
@@ -9293,7 +9258,7 @@ function Ph(t, e) {
9293
9258
  let o = t;
9294
9259
  return s.updateProductAgentAttachment = (a) => {
9295
9260
  o = a;
9296
- }, Rh(
9261
+ }, Ah(
9297
9262
  s,
9298
9263
  () => o,
9299
9264
  i,
@@ -9319,18 +9284,18 @@ function Ph(t, e) {
9319
9284
  return;
9320
9285
  }
9321
9286
  s.replaceWith(
9322
- Ft(o, "message")
9287
+ Wt(o, "message")
9323
9288
  );
9324
9289
  };
9325
9290
  return s.addEventListener("error", r), s.addEventListener("stalled", r), s;
9326
9291
  }
9327
- return Ft(t, "message");
9292
+ return Wt(t, "message");
9328
9293
  }
9329
- function Rh(t, e, n, i, s, o) {
9294
+ function Ah(t, e, n, i, s, o) {
9330
9295
  let a = n;
9331
9296
  const r = n.startsWith("data:") || n.startsWith(`blob:${window.location.origin}/`), d = () => {
9332
9297
  t.isConnected && t.replaceWith(
9333
- Ft(e(), "message")
9298
+ Wt(e(), "message")
9334
9299
  );
9335
9300
  }, c = () => {
9336
9301
  const g = vi(e());
@@ -9375,7 +9340,7 @@ function Rh(t, e, n, i, s, o) {
9375
9340
  };
9376
9341
  h();
9377
9342
  }
9378
- function Ft(t, e = "composer") {
9343
+ function Wt(t, e = "composer") {
9379
9344
  if (e === "composer") {
9380
9345
  const o = document.createElement("span");
9381
9346
  return o.className = "pluno-pa-widget__attachment-file", o.textContent = da(t), o;
@@ -9397,37 +9362,37 @@ function da(t) {
9397
9362
  const e = wo(t);
9398
9363
  return e === "image" ? "IMG" : e === "pdf" ? "PDF" : e === "video" ? "VID" : "FILE";
9399
9364
  }
9400
- function Lh(t, e, n) {
9365
+ function Mh(t, e, n) {
9401
9366
  if (!e)
9402
9367
  return [];
9403
9368
  const i = Array.from(e);
9404
9369
  return n && i.forEach(Ga), i.map((s) => ({
9405
9370
  ...t.createLocalAttachment(s),
9406
- previewUrl: Dh(s)
9371
+ previewUrl: Ph(s)
9407
9372
  }));
9408
9373
  }
9409
- function Dh(t) {
9374
+ function Ph(t) {
9410
9375
  return typeof URL.createObjectURL == "function" ? URL.createObjectURL(t) : void 0;
9411
9376
  }
9412
9377
  function ii(t) {
9413
9378
  return !!(t && Array.from(t.types).includes("Files"));
9414
9379
  }
9415
- function Uh(t, e, n = !1, i) {
9380
+ function Rh(t, e, n = !1, i) {
9416
9381
  const s = io(e), o = s.state === "action_required", a = s.state === "paid_credit_fallback", r = !o && a && n;
9417
- if (!t || !qh(e) || r) {
9382
+ if (!t || !Dh(e) || r) {
9418
9383
  t && (t.hidden = !0, t.replaceChildren());
9419
9384
  return;
9420
9385
  }
9421
9386
  t.hidden = !1, t.replaceChildren(), t.className = "pluno-pa-widget__billing-status", o ? t.appendChild(
9422
- Oh(e)
9387
+ Uh(e)
9423
9388
  ) : a && t.appendChild(
9424
- Nh(
9389
+ Lh(
9425
9390
  e,
9426
9391
  i
9427
9392
  )
9428
9393
  );
9429
9394
  }
9430
- function Nh(t, e) {
9395
+ function Lh(t, e) {
9431
9396
  const n = document.createElement("div");
9432
9397
  if (n.className = "pluno-pa-widget__billing-action-card pluno-pa-widget__billing-action-card--fallback", e) {
9433
9398
  const o = document.createElement("button");
@@ -9438,7 +9403,7 @@ function Nh(t, e) {
9438
9403
  const s = document.createElement("a");
9439
9404
  return s.href = t.pricingUrl, s.target = "_blank", s.rel = "noopener noreferrer", s.textContent = "upgrade here", i.appendChild(s), n.appendChild(i), n;
9440
9405
  }
9441
- function Oh(t) {
9406
+ function Uh(t) {
9442
9407
  const e = document.createElement("div");
9443
9408
  e.className = "pluno-pa-widget__billing-action-card";
9444
9409
  const n = t.submissionGate?.reason, i = n === "credits_exhausted", s = n === "onboarding_required", o = document.createElement("strong");
@@ -9451,7 +9416,7 @@ function Oh(t) {
9451
9416
  ), e.appendChild(r);
9452
9417
  } else
9453
9418
  e.appendChild(
9454
- zh(
9419
+ Nh(
9455
9420
  t,
9456
9421
  "Upgrade plan",
9457
9422
  "pluno-pa-widget__billing-action-card-actions"
@@ -9459,14 +9424,14 @@ function Oh(t) {
9459
9424
  );
9460
9425
  return e;
9461
9426
  }
9462
- function qh(t) {
9427
+ function Dh(t) {
9463
9428
  const e = io(t);
9464
9429
  return t !== null && (e.state === "paid_credit_fallback" || e.state === "action_required");
9465
9430
  }
9466
9431
  function Xt(t) {
9467
9432
  return io(t).state === "action_required";
9468
9433
  }
9469
- function zh(t, e, n) {
9434
+ function Nh(t, e, n) {
9470
9435
  const i = document.createElement("div");
9471
9436
  return i.className = n, i.appendChild(
9472
9437
  Qs(e, t.pricingUrl)
@@ -9490,8 +9455,8 @@ function As(t, e) {
9490
9455
  (i) => !_l(i)
9491
9456
  ).length === 0 && !t.assistantDraft && !t.lastError && !t.isThinking && !e;
9492
9457
  }
9493
- function Bh(t, e, n, i, s, o, a, r, d, c, p, h, m, g, w, b, f, _, S, v, U, B, E, R, j, D, ee = !1) {
9494
- const le = Zh(o), te = Array.isArray(o.activeScheduledFollowUps) ? o.activeScheduledFollowUps : null, Ee = /* @__PURE__ */ new Map();
9458
+ function Oh(t, e, n, i, s, o, a, r, d, c, p, h, m, g, w, y, f, _, S, v, D, B, E, R, j, U, ee = !1) {
9459
+ const le = Xh(o), te = Array.isArray(o.activeScheduledFollowUps) ? o.activeScheduledFollowUps : null, Ee = /* @__PURE__ */ new Map();
9495
9460
  if (te !== null)
9496
9461
  for (const x of te) {
9497
9462
  const C = An(x.dueAt);
@@ -9508,7 +9473,7 @@ function Bh(t, e, n, i, s, o, a, r, d, c, p, h, m, g, w, b, f, _, S, v, U, B, E,
9508
9473
  label: C
9509
9474
  });
9510
9475
  }
9511
- const We = [...Ee.values()].sort((x, C) => Date.parse(x.dueAt) - Date.parse(C.dueAt)), O = ef(
9476
+ const He = [...Ee.values()].sort((x, C) => Date.parse(x.dueAt) - Date.parse(C.dueAt)), O = Qh(
9512
9477
  le.filter(
9513
9478
  (x) => !_l(x) && !x.scheduledCheckInAt
9514
9479
  )
@@ -9529,20 +9494,20 @@ function Bh(t, e, n, i, s, o, a, r, d, c, p, h, m, g, w, b, f, _, S, v, U, B, E,
9529
9494
  loading: !0
9530
9495
  });
9531
9496
  }
9532
- const T = t.scrollTop, W = [], ye = /* @__PURE__ */ new Set(), ie = /* @__PURE__ */ new Set(), G = /* @__PURE__ */ new Set(), H = (x) => {
9533
- W.push(x);
9497
+ const T = t.scrollTop, H = [], ye = /* @__PURE__ */ new Set(), ie = /* @__PURE__ */ new Set(), G = /* @__PURE__ */ new Set(), F = (x) => {
9498
+ H.push(x);
9534
9499
  };
9535
9500
  yo(n, o.isThinking), n.disabled = o.pendingMessageStatus !== null, s.hidden = !d, d && r !== null && pl(s, r);
9536
- const Ae = O.length > 0 || We.length > 0 || !!o.assistantDraft || o.pendingMessageStatus !== null || o.isThinking;
9501
+ const Ae = O.length > 0 || He.length > 0 || !!o.assistantDraft || o.pendingMessageStatus !== null || o.isThinking;
9537
9502
  if (i(Ae), o.isLoadingSession && !Ae) {
9538
9503
  const x = document.createElement("div");
9539
- x.className = "pluno-pa-widget__transcript-loading", x.setAttribute("role", "status"), x.textContent = "Loading chat...", m.clear(), g.clear(), w.clear(), H(x), H(e), ht(t, W);
9504
+ x.className = "pluno-pa-widget__transcript-loading", x.setAttribute("role", "status"), x.textContent = "Loading chat...", m.clear(), g.clear(), w.clear(), F(x), F(e), ht(t, H);
9540
9505
  return;
9541
9506
  }
9542
- if (v || O.length === 0 && We.length === 0 && !o.assistantDraft && !o.lastError && !o.pendingMessageStatus && !o.isThinking) {
9507
+ if (v || O.length === 0 && He.length === 0 && !o.assistantDraft && !o.lastError && !o.pendingMessageStatus && !o.isThinking) {
9543
9508
  if (!v && ee) {
9544
9509
  const P = en(f()), X = document.createElement("div");
9545
- X.className = "pluno-pa-widget__proactive-suggestion-slot", H(P), H(X), H(e), ht(t, W);
9510
+ X.className = "pluno-pa-widget__proactive-suggestion-slot", F(P), F(X), F(e), ht(t, H);
9546
9511
  return;
9547
9512
  }
9548
9513
  const x = document.createElement("div");
@@ -9573,18 +9538,18 @@ function Bh(t, e, n, i, s, o, a, r, d, c, p, h, m, g, w, b, f, _, S, v, U, B, E,
9573
9538
  const P = document.createElement("button");
9574
9539
  P.type = "button", P.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder pluno-pa-widget__starter-prompt--loading", P.disabled = !0, P.tabIndex = -1, P.textContent = "Finding example tasks...", Re.appendChild(P);
9575
9540
  } else
9576
- for (let P = 0; P < mg; P += 1) {
9541
+ for (let P = 0; P < fg; P += 1) {
9577
9542
  const X = document.createElement("button");
9578
9543
  X.type = "button", X.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder", X.disabled = !0, X.tabIndex = -1, X.textContent = "", Re.appendChild(X);
9579
9544
  }
9580
9545
  if (x.appendChild(Re), v) {
9581
9546
  const P = document.createElement("button");
9582
- P.type = "button", P.className = "pluno-pa-widget__morning-report-snooze", P.textContent = "Snooze morning report", P.addEventListener("click", U), x.appendChild(P);
9547
+ P.type = "button", P.className = "pluno-pa-widget__morning-report-snooze", P.textContent = "Snooze morning report", P.addEventListener("click", D), x.appendChild(P);
9583
9548
  }
9584
- m.clear(), g.clear(), w.clear(), H(x), H(e), ht(t, W);
9549
+ m.clear(), g.clear(), w.clear(), F(x), F(e), ht(t, H);
9585
9550
  return;
9586
9551
  }
9587
- let Z = null, F = null, Me = [], He = [];
9552
+ let Z = null, W = null, Me = [], Fe = [];
9588
9553
  const ot = O.some(Js), $e = O.some(
9589
9554
  (x) => x.role === "tool" && ua(x, O, o.lastError === null)
9590
9555
  ), N = o.turnPhase ? Zp(o.turnPhase) : "Thinking...";
@@ -9594,25 +9559,25 @@ function Bh(t, e, n, i, s, o, a, r, d, c, p, h, m, g, w, b, f, _, S, v, U, B, E,
9594
9559
  return be = !1, !1;
9595
9560
  const x = Me.some(
9596
9561
  (ne) => ua(ne, O, o.lastError === null)
9597
- ), C = cf(
9562
+ ), C = af(
9598
9563
  Me,
9599
9564
  x,
9600
9565
  h,
9601
9566
  g,
9602
9567
  ie,
9603
- b,
9568
+ y,
9604
9569
  f()
9605
9570
  );
9606
- return H(C), Z = null, F = C, Me = [], be = x, !0;
9571
+ return F(C), Z = null, W = C, Me = [], be = x, !0;
9607
9572
  }, L = () => {
9608
- for (const x of He)
9609
- H(x), Z = null, F = x;
9610
- He = [];
9573
+ for (const x of Fe)
9574
+ F(x), Z = null, W = x;
9575
+ Fe = [];
9611
9576
  };
9612
9577
  for (let x = 0; x < O.length; x += 1) {
9613
9578
  const C = O[x];
9614
9579
  if (C.role === "tool" && C.integrationAuthRequest && R) {
9615
- const P = Fh(
9580
+ const P = qh(
9616
9581
  C.integrationAuthRequest,
9617
9582
  R.states.get(
9618
9583
  C.integrationAuthRequest.authRequestId
@@ -9622,12 +9587,12 @@ function Bh(t, e, n, i, s, o, a, r, d, c, p, h, m, g, w, b, f, _, S, v, U, B, E,
9622
9587
  R.onConnect,
9623
9588
  R.presentation
9624
9589
  );
9625
- He.push(P);
9590
+ Fe.push(P);
9626
9591
  continue;
9627
9592
  }
9628
9593
  if (C.role === "tool" && C.personalChannelConnectionRequest && j) {
9629
- He.push(
9630
- Wh(
9594
+ Fe.push(
9595
+ zh(
9631
9596
  C.personalChannelConnectionRequest,
9632
9597
  j.onConnect,
9633
9598
  j.presentation
@@ -9636,13 +9601,13 @@ function Bh(t, e, n, i, s, o, a, r, d, c, p, h, m, g, w, b, f, _, S, v, U, B, E,
9636
9601
  continue;
9637
9602
  }
9638
9603
  if (C.role === "tool") {
9639
- Me.length > 0 && !Et(Me[0], C) && pe(), Me.push(C);
9604
+ Me.length > 0 && !Ct(Me[0], C) && pe(), Me.push(C);
9640
9605
  continue;
9641
9606
  }
9642
9607
  if (C.role === "system" && C.dataType === "run_status" && C.steered === !0) {
9643
9608
  if (!pe()) {
9644
- const X = gf(f());
9645
- H(X), Z = null, F = X;
9609
+ const X = cf(f());
9610
+ F(X), Z = null, W = X;
9646
9611
  }
9647
9612
  continue;
9648
9613
  }
@@ -9658,7 +9623,7 @@ function Bh(t, e, n, i, s, o, a, r, d, c, p, h, m, g, w, b, f, _, S, v, U, B, E,
9658
9623
  X,
9659
9624
  N
9660
9625
  );
9661
- H(Se), Z = null, F = Se;
9626
+ F(Se), Z = null, W = Se;
9662
9627
  }
9663
9628
  } else {
9664
9629
  const Se = ga(
@@ -9668,18 +9633,18 @@ function Bh(t, e, n, i, s, o, a, r, d, c, p, h, m, g, w, b, f, _, S, v, U, B, E,
9668
9633
  f(),
9669
9634
  N
9670
9635
  );
9671
- H(Se), Z = null, F = Se;
9636
+ F(Se), Z = null, W = Se;
9672
9637
  }
9673
9638
  continue;
9674
9639
  }
9675
9640
  if (C.role === "system") {
9676
9641
  if (C.dataType === "run_error" || C.dataType === "run_status") {
9677
9642
  const P = pe(), X = O.some(
9678
- (ve) => ve.role === "tool" && Et(ve, C)
9643
+ (ve) => ve.role === "tool" && Ct(ve, C)
9679
9644
  );
9680
9645
  if (!P && !X) {
9681
9646
  const ve = en(f());
9682
- ve.classList.add("pluno-pa-widget__terminal-marker"), H(ve);
9647
+ ve.classList.add("pluno-pa-widget__terminal-marker"), F(ve);
9683
9648
  }
9684
9649
  const Se = document.createElement("div"), $t = C.dataType === "run_error";
9685
9650
  if (Se.className = $t ? "pluno-pa-widget__error" : "pluno-pa-widget__status pluno-pa-widget__run-status", Se.textContent = Ii(
@@ -9688,26 +9653,26 @@ function Bh(t, e, n, i, s, o, a, r, d, c, p, h, m, g, w, b, f, _, S, v, U, B, E,
9688
9653
  const ve = document.createElement("a");
9689
9654
  ve.className = "pluno-pa-widget__error-retry", ve.href = C.securitySettingsUrl, ve.target = "_blank", ve.rel = "noreferrer", ve.textContent = "Security settings", Se.appendChild(ve);
9690
9655
  }
9691
- H(Se), Z = $t ? Se : null, F = $t ? null : Se, L();
9656
+ F(Se), Z = $t ? Se : null, W = $t ? null : Se, L();
9692
9657
  }
9693
9658
  continue;
9694
9659
  }
9695
9660
  C.role === "user" && L();
9696
9661
  const ne = pe(), Q = Ii(C.content), Pe = C.role === "assistant" && O.some(
9697
- (P) => P.role === "tool" && Et(P, C)
9662
+ (P) => P.role === "tool" && Ct(P, C)
9698
9663
  );
9699
9664
  if (C.role === "assistant" && !ne && !Pe) {
9700
9665
  const P = en(f());
9701
- H(P), Z = null, F = P;
9666
+ F(P), Z = null, W = P;
9702
9667
  }
9703
- const Re = Hh(
9668
+ const Re = Bh(
9704
9669
  C,
9705
9670
  Q,
9706
9671
  m,
9707
9672
  ye,
9708
9673
  E
9709
9674
  );
9710
- H(Re), Z = Re, F = null, C.role === "assistant" && L();
9675
+ F(Re), Z = Re, W = null, C.role === "assistant" && L();
9711
9676
  }
9712
9677
  const Y = pe(), _e = O[O.length - 1]?.role === "assistant";
9713
9678
  if (o.turnPhase && !o.assistantDraft && !$e && !_e && !ot) {
@@ -9720,7 +9685,7 @@ function Bh(t, e, n, i, s, o, a, r, d, c, p, h, m, g, w, b, f, _, S, v, U, B, E,
9720
9685
  x,
9721
9686
  N
9722
9687
  );
9723
- H(C), Z = null, F = C;
9688
+ F(C), Z = null, W = C;
9724
9689
  }
9725
9690
  } else {
9726
9691
  const C = ga(
@@ -9730,7 +9695,7 @@ function Bh(t, e, n, i, s, o, a, r, d, c, p, h, m, g, w, b, f, _, S, v, U, B, E,
9730
9695
  f(),
9731
9696
  N
9732
9697
  );
9733
- H(C), Z = null, F = C;
9698
+ F(C), Z = null, W = C;
9734
9699
  }
9735
9700
  }
9736
9701
  if (o.lastError) {
@@ -9750,47 +9715,47 @@ function Bh(t, e, n, i, s, o, a, r, d, c, p, h, m, g, w, b, f, _, S, v, U, B, E,
9750
9715
  o.lastErrorCode === "connection_failed" ? B : S
9751
9716
  ), C.appendChild(Q);
9752
9717
  }
9753
- x.appendChild(C), H(x), Z = null, F = x;
9754
- }
9755
- const Ue = D ? D.actionCandidate ?? D.candidate ?? (o.isThinking ? null : va(le)) : null;
9756
- if (D && Ue && !D.dismissedCandidateIds.has(Ue.id)) {
9757
- const x = af(Ue, {
9758
- isActing: D.actionCandidate?.id === Ue.id,
9759
- error: D.error,
9760
- characterIconOptions: D.characterIconOptions,
9761
- socialPostRewardsUrl: D.socialPostRewardsUrl,
9762
- presentation: D.presentation,
9763
- onReferralCopy: D.onReferralCopy,
9764
- onSocialShare: D.onSocialShare,
9765
- onDismiss: D.onDismiss,
9766
- onDisable: D.onDisable
9718
+ x.appendChild(C), F(x), Z = null, W = x;
9719
+ }
9720
+ const De = U ? U.actionCandidate ?? U.candidate ?? (o.isThinking ? null : va(le)) : null;
9721
+ if (U && De && !U.dismissedCandidateIds.has(De.id)) {
9722
+ const x = sf(De, {
9723
+ isActing: U.actionCandidate?.id === De.id,
9724
+ error: U.error,
9725
+ characterIconOptions: U.characterIconOptions,
9726
+ socialPostRewardsUrl: U.socialPostRewardsUrl,
9727
+ presentation: U.presentation,
9728
+ onReferralCopy: U.onReferralCopy,
9729
+ onSocialShare: U.onSocialShare,
9730
+ onDismiss: U.onDismiss,
9731
+ onDisable: U.onDisable
9767
9732
  });
9768
- H(x), D.onSeen(Ue), Z = null, F = x;
9733
+ F(x), U.onSeen(De), Z = null, W = x;
9769
9734
  }
9770
9735
  L();
9771
- for (const x of We) {
9736
+ for (const x of He) {
9772
9737
  const C = document.createElement("div");
9773
9738
  C.className = "pluno-pa-widget__next-check-in", C.append(
9774
- Ih(x.dueAt),
9739
+ _h(x.dueAt),
9775
9740
  document.createTextNode(x.label)
9776
- ), H(C), Z = null, F = C;
9741
+ ), F(C), Z = null, W = C;
9777
9742
  }
9778
9743
  Z?.classList.add(
9779
9744
  "pluno-pa-widget__message--bottom-reserve"
9780
- ), F?.classList.add(
9745
+ ), W?.classList.add(
9781
9746
  "pluno-pa-widget__bottom-reserve-compact"
9782
- ), H(e), Xh(
9747
+ ), F(e), Kh(
9783
9748
  m,
9784
9749
  ye
9785
- ), Qh(
9750
+ ), Vh(
9786
9751
  g,
9787
9752
  ie
9788
- ), Jh(
9753
+ ), Yh(
9789
9754
  w,
9790
9755
  G
9791
- ), ht(t, W), c ? xn(t, p) : t.scrollTop = T;
9756
+ ), ht(t, H), c ? xn(t, p) : t.scrollTop = T;
9792
9757
  }
9793
- function Fh(t, e, n, i) {
9758
+ function qh(t, e, n, i) {
9794
9759
  const s = document.createElement("section");
9795
9760
  s.className = "pluno-pa-widget__integration-auth-card", s.setAttribute("aria-label", i?.title ?? `Connect ${t.appName}`);
9796
9761
  const o = document.createElement("div");
@@ -9808,7 +9773,7 @@ function Fh(t, e, n, i) {
9808
9773
  const c = document.createElement("button");
9809
9774
  return c.type = "button", c.className = "pluno-pa-widget__integration-auth-button", c.disabled = e.status === "checking" || e.status === "connecting" || e.status === "completed", e.status === "checking" ? c.textContent = "Checking connection..." : e.status === "connecting" ? c.textContent = "Connecting..." : e.status === "completed" ? c.textContent = "Connected" : e.status === "expired" || e.status === "cancelled" ? c.textContent = `Reconnect ${t.appName}` : e.status === "error" ? c.textContent = "Try again" : c.textContent = i?.actionLabels.connect ?? `Connect ${t.appName}`, c.addEventListener("click", () => n(t)), s.appendChild(c), s;
9810
9775
  }
9811
- function Wh(t, e, n) {
9776
+ function zh(t, e, n) {
9812
9777
  const i = document.createElement("section");
9813
9778
  i.className = "pluno-pa-widget__integration-auth-card", i.setAttribute("aria-label", n?.title ?? "Connect WhatsApp");
9814
9779
  const s = document.createElement("div");
@@ -9820,18 +9785,18 @@ function Wh(t, e, n) {
9820
9785
  const d = document.createElement("button");
9821
9786
  return d.type = "button", d.className = "pluno-pa-widget__integration-auth-button", d.textContent = n?.actionLabels.connect ?? "Pair WhatsApp", d.addEventListener("click", () => e(t)), i.appendChild(d), i;
9822
9787
  }
9823
- function Hh(t, e, n, i, s) {
9824
- const o = jh(t), a = Kh(
9788
+ function Bh(t, e, n, i, s) {
9789
+ const o = Hh(t), a = $h(
9825
9790
  t,
9826
9791
  e
9827
9792
  ), r = n.get(o);
9828
9793
  if (r)
9829
- return $h(
9794
+ return Wh(
9830
9795
  r.node,
9831
9796
  t.attachments ?? []
9832
9797
  ), r.node.classList.remove(
9833
9798
  "pluno-pa-widget__message--bottom-reserve"
9834
- ), i.add(o), r.renderSignature === a ? (r.renderDeferred = !1, r.node) : Vh(r.node) ? (r.renderDeferred = !0, r.node) : (ca(
9799
+ ), i.add(o), r.renderSignature === a ? (r.renderDeferred = !1, r.node) : jh(r.node) ? (r.renderDeferred = !0, r.node) : (ca(
9835
9800
  r.node,
9836
9801
  t,
9837
9802
  e,
@@ -9850,18 +9815,18 @@ function Hh(t, e, n, i, s) {
9850
9815
  }
9851
9816
  function ca(t, e, n, i) {
9852
9817
  if (t.className = `pluno-pa-widget__message pluno-pa-widget__message--${e.role}`, t.removeAttribute("data-phase"), e.role === "assistant" ? (e.phase && (t.dataset.phase = e.phase), t.replaceChildren(), bo(t, n)) : t.textContent = n, e.role === "user" && e.attachments?.length && t.appendChild(
9853
- sf(
9818
+ ef(
9854
9819
  e.attachments,
9855
9820
  i
9856
9821
  )
9857
9822
  ), e.phase !== "commentary" && (e.role === "user" || e.dataType !== "assistant_draft")) {
9858
9823
  const s = document.createElement("div");
9859
9824
  s.className = "pluno-pa-widget__message-actions";
9860
- const o = rf(e.createdAt), a = of(n);
9825
+ const o = nf(e.createdAt), a = tf(n);
9861
9826
  e.role === "user" ? s.append(o, a) : s.append(a, o), t.appendChild(s);
9862
9827
  }
9863
9828
  }
9864
- function $h(t, e) {
9829
+ function Wh(t, e) {
9865
9830
  const n = t.querySelector(
9866
9831
  ".pluno-pa-widget__message-attachments"
9867
9832
  );
@@ -9869,11 +9834,11 @@ function $h(t, e) {
9869
9834
  for (let i = 0; i < e.length; i += 1)
9870
9835
  n.children[i]?.firstElementChild?.updateProductAgentAttachment?.(e[i]);
9871
9836
  }
9872
- function jh(t) {
9873
- const e = Gh(t), n = t.assistantDraftItemId;
9837
+ function Hh(t) {
9838
+ const e = Fh(t), n = t.assistantDraftItemId;
9874
9839
  return `${t.role}:${e ?? n ?? t.id}`;
9875
9840
  }
9876
- function Gh(t) {
9841
+ function Fh(t) {
9877
9842
  const e = t.clientMessageId;
9878
9843
  if (e)
9879
9844
  return e;
@@ -9882,7 +9847,7 @@ function Gh(t) {
9882
9847
  );
9883
9848
  return n ? t.id.slice(n.length) : null;
9884
9849
  }
9885
- function Kh(t, e) {
9850
+ function $h(t, e) {
9886
9851
  return JSON.stringify({
9887
9852
  role: t.role,
9888
9853
  content: e,
@@ -9904,7 +9869,7 @@ function Kh(t, e) {
9904
9869
  })
9905
9870
  });
9906
9871
  }
9907
- function Vh(t) {
9872
+ function jh(t) {
9908
9873
  const e = t.ownerDocument.getSelection();
9909
9874
  if (!e || e.isCollapsed)
9910
9875
  return !1;
@@ -9913,20 +9878,20 @@ function Vh(t) {
9913
9878
  return !0;
9914
9879
  return !1;
9915
9880
  }
9916
- function Yh(t) {
9881
+ function Gh(t) {
9917
9882
  return Array.from(t.values()).some(
9918
9883
  (e) => e.renderDeferred === !0
9919
9884
  );
9920
9885
  }
9921
- function Xh(t, e) {
9886
+ function Kh(t, e) {
9922
9887
  for (const n of t.keys())
9923
9888
  e.has(n) || t.delete(n);
9924
9889
  }
9925
- function Qh(t, e) {
9890
+ function Vh(t, e) {
9926
9891
  for (const n of t.keys())
9927
9892
  e.has(n) || t.delete(n);
9928
9893
  }
9929
- function Jh(t, e) {
9894
+ function Yh(t, e) {
9930
9895
  for (const n of t.keys())
9931
9896
  e.has(n) || t.delete(n);
9932
9897
  }
@@ -9944,7 +9909,7 @@ function ht(t, e) {
9944
9909
  n = n.nextSibling, t.removeChild(i);
9945
9910
  }
9946
9911
  }
9947
- function Zh(t) {
9912
+ function Xh(t) {
9948
9913
  if (!t.assistantDraft)
9949
9914
  return [...t.messages];
9950
9915
  if (t.messages.some(
@@ -9964,7 +9929,7 @@ function Zh(t) {
9964
9929
  if (!n.respondsToUserMessageId)
9965
9930
  return [...t.messages, n];
9966
9931
  const i = t.messages.findIndex(
9967
- (a) => Et(a, n) && Js(a)
9932
+ (a) => Ct(a, n) && Js(a)
9968
9933
  );
9969
9934
  if (i !== -1)
9970
9935
  return [
@@ -9974,7 +9939,7 @@ function Zh(t) {
9974
9939
  ];
9975
9940
  let s = -1;
9976
9941
  for (let a = t.messages.length - 1; a >= 0; a -= 1)
9977
- if (Et(t.messages[a], n)) {
9942
+ if (Ct(t.messages[a], n)) {
9978
9943
  s = a;
9979
9944
  break;
9980
9945
  }
@@ -9985,7 +9950,7 @@ function Zh(t) {
9985
9950
  ...t.messages.slice(o)
9986
9951
  ];
9987
9952
  }
9988
- function ef(t) {
9953
+ function Qh(t) {
9989
9954
  const e = t.map(
9990
9955
  (g) => g.role === "assistant" && g.phase === "commentary" ? { ...g, role: "tool" } : g
9991
9956
  ), n = /* @__PURE__ */ new Map();
@@ -9997,8 +9962,8 @@ function ef(t) {
9997
9962
  const i = e.filter((g) => {
9998
9963
  const w = n.get(
9999
9964
  Zt(g)
10000
- ), b = g.role === "system" && g.dataType === "run_status" && (g.loading === !0 || g.steered === !0);
10001
- return w === void 0 || !b || g === w;
9965
+ ), y = g.role === "system" && g.dataType === "run_status" && (g.loading === !0 || g.steered === !0);
9966
+ return w === void 0 || !y || g === w;
10002
9967
  }), s = /* @__PURE__ */ new Map(), o = i.map((g) => {
10003
9968
  g.runId && g.respondsToUserMessageId && s.set(
10004
9969
  g.runId,
@@ -10015,10 +9980,10 @@ function ef(t) {
10015
9980
  const w = g.role === "system" && g.dataType === "run_status" && g.content === "Steered";
10016
9981
  if (g.role !== "tool" && !w || g.role === "tool" && (g.integrationAuthRequest || g.personalChannelConnectionRequest) || !g.respondsToUserMessageId || !a.has(g.respondsToUserMessageId))
10017
9982
  continue;
10018
- const b = r.get(g.respondsToUserMessageId) ?? [];
10019
- b.push(g), r.set(
9983
+ const y = r.get(g.respondsToUserMessageId) ?? [];
9984
+ y.push(g), r.set(
10020
9985
  g.respondsToUserMessageId,
10021
- b
9986
+ y
10022
9987
  );
10023
9988
  }
10024
9989
  const d = o.flatMap((g) => {
@@ -10028,19 +9993,19 @@ function ef(t) {
10028
9993
  (g) => g.role === "system" && g.dataType === "run_status" && g.steered === !0
10029
9994
  ), p = /* @__PURE__ */ new Map();
10030
9995
  for (let g = 0; g < d.length; g += 1) {
10031
- const w = d[g], b = w.role === "tool" && c.some(
10032
- (S) => Et(w, S)
9996
+ const w = d[g], y = w.role === "tool" && c.some(
9997
+ (S) => Ct(w, S)
10033
9998
  ) ? { ...w, steered: !0 } : w;
10034
- if (b.role !== "tool" || b.integrationAuthRequest || b.personalChannelConnectionRequest)
9999
+ if (y.role !== "tool" || y.integrationAuthRequest || y.personalChannelConnectionRequest)
10035
10000
  continue;
10036
- const f = Zt(b), _ = p.get(f) ?? [];
10037
- _.push(b), p.set(f, _);
10001
+ const f = Zt(y), _ = p.get(f) ?? [];
10002
+ _.push(y), p.set(f, _);
10038
10003
  }
10039
10004
  const h = /* @__PURE__ */ new Set(), m = [];
10040
10005
  for (const g of d) {
10041
10006
  if (g.role === "system" && g.dataType === "run_status" && g.steered === !0 && [...p.values()].some(
10042
- (b) => b.some(
10043
- (f) => Et(f, g)
10007
+ (y) => y.some(
10008
+ (f) => Ct(f, g)
10044
10009
  )
10045
10010
  ))
10046
10011
  continue;
@@ -10055,16 +10020,16 @@ function ef(t) {
10055
10020
  }
10056
10021
  function ua(t, e, n) {
10057
10022
  return !n || !t.respondsToUserMessageId || t.steered === !0 ? !1 : !e.some(
10058
- (i) => (tf(i) || nf(i)) && Et(t, i)
10023
+ (i) => (Jh(i) || Zh(i)) && Ct(t, i)
10059
10024
  );
10060
10025
  }
10061
- function tf(t) {
10026
+ function Jh(t) {
10062
10027
  return t.role === "assistant" && t.phase !== "commentary";
10063
10028
  }
10064
- function nf(t) {
10029
+ function Zh(t) {
10065
10030
  return t.role === "system" && (t.dataType === "run_error" || t.dataType === "run_status" && t.loading !== !0);
10066
10031
  }
10067
- function Et(t, e) {
10032
+ function Ct(t, e) {
10068
10033
  return t.respondsToUserMessageId && e.respondsToUserMessageId ? t.respondsToUserMessageId === e.respondsToUserMessageId : !!(t.runId && t.runId === e.runId);
10069
10034
  }
10070
10035
  function Zt(t) {
@@ -10092,28 +10057,28 @@ function pa(t, e, n, i, s, o, a, r, d) {
10092
10057
  }
10093
10058
  t.appendChild(c);
10094
10059
  }
10095
- function sf(t, e) {
10060
+ function ef(t, e) {
10096
10061
  const n = document.createElement("div");
10097
10062
  n.className = "pluno-pa-widget__message-attachments";
10098
10063
  for (const i of t) {
10099
10064
  const s = document.createElement("div");
10100
10065
  s.className = "pluno-pa-widget__message-attachment", s.appendChild(
10101
- Ph(i, e)
10066
+ Eh(i, e)
10102
10067
  ), n.appendChild(s);
10103
10068
  }
10104
10069
  return n;
10105
10070
  }
10106
- function of(t) {
10071
+ function tf(t) {
10107
10072
  const e = document.createElement("button");
10108
- return e.type = "button", e.className = "pluno-pa-widget__message-copy", e.setAttribute("aria-label", "Copy message"), e.title = "Copy message", e.appendChild(Eh()), e.addEventListener("click", (n) => {
10073
+ return e.type = "button", e.className = "pluno-pa-widget__message-copy", e.setAttribute("aria-label", "Copy message"), e.title = "Copy message", e.appendChild(Th()), e.addEventListener("click", (n) => {
10109
10074
  n.preventDefault(), n.stopPropagation(), navigator.clipboard.writeText(t), n.detail > 0 && e.blur();
10110
10075
  }), e;
10111
10076
  }
10112
- function rf(t) {
10077
+ function nf(t) {
10113
10078
  const e = document.createElement("time");
10114
10079
  return e.className = "pluno-pa-widget__message-timestamp", e.dateTime = t, e.textContent = Jp(t), e;
10115
10080
  }
10116
- function af(t, e) {
10081
+ function sf(t, e) {
10117
10082
  const n = ud(t.id), i = document.createElement("article");
10118
10083
  i.className = "pluno-pa-widget__share-prompt";
10119
10084
  const s = document.createElement("div");
@@ -10154,18 +10119,18 @@ function af(t, e) {
10154
10119
  const m = document.createElement("button");
10155
10120
  m.type = "button", m.className = "pluno-pa-widget__share-prompt-draft", m.disabled = e.isActing, m.addEventListener("click", () => {
10156
10121
  e.onReferralCopy(t);
10157
- }), e.isActing ? (m.appendChild(ff()), m.appendChild(document.createTextNode("Copying..."))) : m.textContent = "Copy invite link", c.appendChild(m);
10122
+ }), e.isActing ? (m.appendChild(pf()), m.appendChild(document.createTextNode("Copying..."))) : m.textContent = "Copy invite link", c.appendChild(m);
10158
10123
  } else
10159
- for (const m of lf()) {
10124
+ for (const m of of()) {
10160
10125
  const g = document.createElement("a");
10161
- g.className = "pluno-pa-widget__share-prompt-social", g.href = m.href, g.target = "_blank", g.rel = "noopener noreferrer", g.setAttribute("aria-label", `Open ${m.label}`), g.title = m.label, g.appendChild(df(m.id)), g.addEventListener("click", () => e.onSocialShare(t)), c.appendChild(g);
10126
+ g.className = "pluno-pa-widget__share-prompt-social", g.href = m.href, g.target = "_blank", g.rel = "noopener noreferrer", g.setAttribute("aria-label", `Open ${m.label}`), g.title = m.label, g.appendChild(rf(m.id)), g.addEventListener("click", () => e.onSocialShare(t)), c.appendChild(g);
10162
10127
  }
10163
10128
  const p = document.createElement("button");
10164
10129
  p.type = "button", p.className = "pluno-pa-widget__share-prompt-dismiss", p.setAttribute("aria-label", "Dismiss share prompt"), p.title = "Dismiss", p.textContent = e.presentation?.actionLabels.dismiss ?? "Dismiss", p.addEventListener("click", () => e.onDismiss(t)), c.appendChild(p), d.appendChild(c);
10165
10130
  const h = document.createElement("button");
10166
10131
  return h.type = "button", h.className = "pluno-pa-widget__share-prompt-disable", h.textContent = e.presentation?.actionLabels.dont_show_again ?? "Don't ask again", h.addEventListener("click", () => e.onDisable(t)), d.appendChild(h), s.appendChild(d), i.appendChild(s), i;
10167
10132
  }
10168
- function lf() {
10133
+ function of() {
10169
10134
  const t = "https://pluno.ai/browser", e = `I just used @pluno_ai to get work done directly inside my tools. Worth trying: ${t}`;
10170
10135
  return [
10171
10136
  {
@@ -10185,7 +10150,7 @@ function lf() {
10185
10150
  }
10186
10151
  ];
10187
10152
  }
10188
- function df(t) {
10153
+ function rf(t) {
10189
10154
  const e = document.createElementNS("http://www.w3.org/2000/svg", "svg");
10190
10155
  e.setAttribute("class", "pluno-pa-widget__share-prompt-platform-logo"), e.setAttribute("viewBox", "0 0 32 32"), e.setAttribute("aria-hidden", "true");
10191
10156
  const n = (i, s) => {
@@ -10200,40 +10165,40 @@ function _l(t) {
10200
10165
  function Ii(t) {
10201
10166
  return t.replace(/\uE200[^\uE201]*(?:\uE201|$)/g, "");
10202
10167
  }
10203
- function cf(t, e, n, i, s, o, a) {
10168
+ function af(t, e, n, i, s, o, a) {
10204
10169
  const r = t.length > 0 && t.every((v) => v.steered === !0);
10205
10170
  e = e && !r;
10206
- const d = hf(t);
10171
+ const d = uf(t);
10207
10172
  s.add(d);
10208
- let c = pf(
10173
+ let c = df(
10209
10174
  i,
10210
10175
  d,
10211
10176
  t
10212
10177
  );
10213
10178
  if (!c) {
10214
- const v = document.createElement("article"), U = st(
10179
+ const v = document.createElement("article"), D = st(
10215
10180
  "pluno-pa-widget__character--tool-group",
10216
10181
  a
10217
10182
  ), B = JSON.stringify(a), E = document.createElement("div");
10218
10183
  E.className = "pluno-pa-widget__tool-active-content";
10219
- const R = Ai(), j = document.createElement("details"), D = document.createElement("summary");
10220
- D.className = "pluno-pa-widget__tool-summary";
10184
+ const R = Ai(), j = document.createElement("details"), U = document.createElement("summary");
10185
+ U.className = "pluno-pa-widget__tool-summary";
10221
10186
  const ee = document.createElement("div");
10222
- ee.className = "pluno-pa-widget__tool-summary-title", D.appendChild(ee), D.addEventListener("click", () => {
10187
+ ee.className = "pluno-pa-widget__tool-summary-title", U.appendChild(ee), U.addEventListener("click", () => {
10223
10188
  ee.textContent = j.open ? v.dataset.collapsedActivityTitle ?? "Activities" : "Activities";
10224
- }), j.appendChild(D);
10189
+ }), j.appendChild(U);
10225
10190
  const le = document.createElement("div");
10226
10191
  le.className = "pluno-pa-widget__tool-lines", j.addEventListener("toggle", () => {
10227
10192
  const te = v.dataset.responseGroupKey ?? d;
10228
10193
  v.classList.toggle("pluno-pa-widget__tool-group--open", j.open), ee.textContent = j.open ? "Activities" : v.dataset.collapsedActivityTitle ?? "Activities", j.open ? n.add(te) : n.delete(te), o();
10229
10194
  }), c = {
10230
10195
  node: v,
10231
- character: U,
10196
+ character: D,
10232
10197
  characterSignature: B,
10233
10198
  activeContent: E,
10234
10199
  thinkingStatus: R,
10235
10200
  details: j,
10236
- summary: D,
10201
+ summary: U,
10237
10202
  summaryTitle: ee,
10238
10203
  lines: le,
10239
10204
  lineNodes: /* @__PURE__ */ new Map()
@@ -10248,7 +10213,7 @@ function cf(t, e, n, i, s, o, a) {
10248
10213
  m.className = "pluno-pa-widget__tool-group", m.dataset.responseGroupKey = d, m.classList.toggle("pluno-pa-widget__tool-group--active", e), m.title = new Date(
10249
10214
  t[t.length - 1].createdAt
10250
10215
  ).toLocaleString();
10251
- const g = uf(
10216
+ const g = lf(
10252
10217
  t,
10253
10218
  e,
10254
10219
  p.lines,
@@ -10263,9 +10228,9 @@ function cf(t, e, n, i, s, o, a) {
10263
10228
  }
10264
10229
  const w = p.details;
10265
10230
  w.open = n.has(d), m.classList.toggle("pluno-pa-widget__tool-group--open", w.open);
10266
- const b = t[t.length - 1], f = Ii(
10267
- b.content
10268
- ).trim(), _ = b.phase === "commentary", S = f ? _ ? f : vl(f) : r ? "Steered" : "Thinking...";
10231
+ const y = t[t.length - 1], f = Ii(
10232
+ y.content
10233
+ ).trim(), _ = y.phase === "commentary", S = f ? _ ? f : vl(f) : r ? "Steered" : "Thinking...";
10269
10234
  return m.dataset.collapsedActivityTitle = S, p.summaryTitle.replaceChildren(), p.summaryTitle.classList.add(
10270
10235
  "pluno-pa-widget__tool-summary-markdown"
10271
10236
  ), bo(
@@ -10273,7 +10238,7 @@ function cf(t, e, n, i, s, o, a) {
10273
10238
  w.open ? "Activities" : S
10274
10239
  ), ht(w, [p.summary, g]), ht(m, [p.character, w]), m;
10275
10240
  }
10276
- function uf(t, e, n, i) {
10241
+ function lf(t, e, n, i) {
10277
10242
  const s = eg(
10278
10243
  t.map((r) => ({ terminal: r.loading === !1 })),
10279
10244
  e
@@ -10292,7 +10257,7 @@ function uf(t, e, n, i) {
10292
10257
  a.has(r) || i.delete(r);
10293
10258
  return ht(n, o), n;
10294
10259
  }
10295
- function pf(t, e, n) {
10260
+ function df(t, e, n) {
10296
10261
  const i = t.get(e);
10297
10262
  if (i)
10298
10263
  return i;
@@ -10359,7 +10324,7 @@ function ha(t, e, n, i = "Thinking...") {
10359
10324
  }
10360
10325
  return Il(o.status, i), o.node;
10361
10326
  }
10362
- function gf(t) {
10327
+ function cf(t) {
10363
10328
  const e = en(t), n = document.createElement("div");
10364
10329
  return n.className = "pluno-pa-widget__status", n.textContent = "Steered", e.appendChild(n), e;
10365
10330
  }
@@ -10375,16 +10340,16 @@ function Il(t, e) {
10375
10340
  const n = t.lastElementChild;
10376
10341
  n && n.textContent !== e && (n.textContent = e);
10377
10342
  }
10378
- function hf(t) {
10343
+ function uf(t) {
10379
10344
  const e = t[0];
10380
10345
  return e ? `tools:${Zt(e)}` : "tools:empty";
10381
10346
  }
10382
- function ff() {
10347
+ function pf() {
10383
10348
  const t = document.createElement("span");
10384
10349
  return t.className = "pluno-pa-widget__spinner", t.setAttribute("aria-hidden", "true"), t;
10385
10350
  }
10386
10351
  function yo(t, e) {
10387
- t.setAttribute("aria-label", e ? "Stop" : "Send"), t.classList.toggle("pluno-pa-widget__send--stop", e), t.replaceChildren(e ? kh() : ml());
10352
+ t.setAttribute("aria-label", e ? "Stop" : "Send"), t.classList.toggle("pluno-pa-widget__send--stop", e), t.replaceChildren(e ? Ih() : ml());
10388
10353
  }
10389
10354
  function Ms(t) {
10390
10355
  let e = t.trim();
@@ -10399,18 +10364,18 @@ function Ms(t) {
10399
10364
  }
10400
10365
  return n.push(i.trim()), n.length > 1 ? n : null;
10401
10366
  }
10402
- function mf(t) {
10367
+ function gf(t) {
10403
10368
  const e = t.trim();
10404
10369
  if (/^:?-{3,}:?$/.test(e))
10405
10370
  return e.startsWith(":") && e.endsWith(":") ? "center" : e.endsWith(":") ? "right" : e.startsWith(":") ? "left" : null;
10406
10371
  }
10407
- function wf(t, e) {
10372
+ function hf(t, e) {
10408
10373
  const n = Ms(t[e] ?? ""), i = Ms(t[e + 1] ?? "");
10409
10374
  if (!n || !i || n.length !== i.length)
10410
10375
  return null;
10411
10376
  const s = [];
10412
10377
  for (const h of i) {
10413
- const m = mf(h);
10378
+ const m = gf(h);
10414
10379
  if (m === void 0)
10415
10380
  return null;
10416
10381
  s.push(m);
@@ -10420,7 +10385,7 @@ function wf(t, e) {
10420
10385
  const a = document.createElement("table"), r = document.createElement("thead"), d = document.createElement("tr");
10421
10386
  n.forEach((h, m) => {
10422
10387
  const g = document.createElement("th"), w = s[m];
10423
- w && g.classList.add(`pluno-pa-widget__table-cell--${w}`), Ct(g, h), d.appendChild(g);
10388
+ w && g.classList.add(`pluno-pa-widget__table-cell--${w}`), kt(g, h), d.appendChild(g);
10424
10389
  }), r.appendChild(d), a.appendChild(r);
10425
10390
  const c = document.createElement("tbody");
10426
10391
  let p = e + 2;
@@ -10430,8 +10395,8 @@ function wf(t, e) {
10430
10395
  break;
10431
10396
  const m = document.createElement("tr");
10432
10397
  n.forEach((g, w) => {
10433
- const b = document.createElement("td"), f = s[w];
10434
- f && b.classList.add(`pluno-pa-widget__table-cell--${f}`), Ct(b, h[w] ?? ""), m.appendChild(b);
10398
+ const y = document.createElement("td"), f = s[w];
10399
+ f && y.classList.add(`pluno-pa-widget__table-cell--${f}`), kt(y, h[w] ?? ""), m.appendChild(y);
10435
10400
  }), c.appendChild(m), p += 1;
10436
10401
  }
10437
10402
  return a.appendChild(c), o.appendChild(a), { element: o, nextIndex: p };
@@ -10457,7 +10422,7 @@ function bo(t, e) {
10457
10422
  `), m.appendChild(g), t.appendChild(m);
10458
10423
  continue;
10459
10424
  }
10460
- const a = wf(n, i);
10425
+ const a = hf(n, i);
10461
10426
  if (a) {
10462
10427
  t.appendChild(a.element), i = a.nextIndex;
10463
10428
  continue;
@@ -10465,14 +10430,14 @@ function bo(t, e) {
10465
10430
  const r = s.match(/^(#{1,6})\s+(.+)$/);
10466
10431
  if (r) {
10467
10432
  const h = document.createElement(`h${r[1].length}`);
10468
- Ct(h, r[2]), t.appendChild(h), i += 1;
10433
+ kt(h, r[2]), t.appendChild(h), i += 1;
10469
10434
  continue;
10470
10435
  }
10471
10436
  if (/^\s*[-*+]\s+/.test(s)) {
10472
10437
  const h = document.createElement("ul");
10473
10438
  for (; i < n.length && /^\s*[-*+]\s+/.test(n[i]); ) {
10474
10439
  const m = document.createElement("li");
10475
- Ct(m, n[i].replace(/^\s*[-*+]\s+/, "")), h.appendChild(m), i += 1;
10440
+ kt(m, n[i].replace(/^\s*[-*+]\s+/, "")), h.appendChild(m), i += 1;
10476
10441
  }
10477
10442
  t.appendChild(h);
10478
10443
  continue;
@@ -10482,7 +10447,7 @@ function bo(t, e) {
10482
10447
  const h = document.createElement("ol");
10483
10448
  for (h.start = Number(d[1]); i < n.length && /^\s*\d+\.\s+/.test(n[i]); ) {
10484
10449
  const m = document.createElement("li");
10485
- Ct(m, n[i].replace(/^\s*\d+\.\s+/, "")), h.appendChild(m), i += 1;
10450
+ kt(m, n[i].replace(/^\s*\d+\.\s+/, "")), h.appendChild(m), i += 1;
10486
10451
  }
10487
10452
  t.appendChild(h);
10488
10453
  continue;
@@ -10492,11 +10457,11 @@ function bo(t, e) {
10492
10457
  c.push(n[i]), i += 1;
10493
10458
  const p = document.createElement("p");
10494
10459
  c.forEach((h, m) => {
10495
- m > 0 && p.appendChild(document.createElement("br")), Ct(p, h);
10460
+ m > 0 && p.appendChild(document.createElement("br")), kt(p, h);
10496
10461
  }), t.appendChild(p);
10497
10462
  }
10498
10463
  }
10499
- function Ct(t, e) {
10464
+ function kt(t, e) {
10500
10465
  const n = /(`[^`]+`|\*\*[^*]+\*\*|\*[^*]+\*|\[[^\]]+\]\(([^)\s]+)\))/g;
10501
10466
  let i = 0;
10502
10467
  for (const s of e.matchAll(n)) {
@@ -10510,13 +10475,13 @@ function Ct(t, e) {
10510
10475
  r.textContent = a.slice(1, -1), t.appendChild(r);
10511
10476
  } else if (a.startsWith("**")) {
10512
10477
  const r = document.createElement("strong");
10513
- Ct(r, a.slice(2, -2)), t.appendChild(r);
10478
+ kt(r, a.slice(2, -2)), t.appendChild(r);
10514
10479
  } else if (a.startsWith("*")) {
10515
10480
  const r = document.createElement("em");
10516
- Ct(r, a.slice(1, -1)), t.appendChild(r);
10481
+ kt(r, a.slice(1, -1)), t.appendChild(r);
10517
10482
  } else {
10518
10483
  const r = a.match(/^\[([^\]]+)\]\(([^)\s]+)\)$/);
10519
- if (r && yf(r[2])) {
10484
+ if (r && ff(r[2])) {
10520
10485
  const d = document.createElement("a");
10521
10486
  d.href = r[2], d.target = od(r[2]) ? "_blank" : "_top", d.rel = "noreferrer", d.textContent = r[1], t.appendChild(d);
10522
10487
  } else
@@ -10526,7 +10491,7 @@ function Ct(t, e) {
10526
10491
  }
10527
10492
  i < e.length && t.appendChild(document.createTextNode(e.slice(i)));
10528
10493
  }
10529
- function yf(t) {
10494
+ function ff(t) {
10530
10495
  if (t.startsWith("/") || t.startsWith("#"))
10531
10496
  return !0;
10532
10497
  try {
@@ -10537,7 +10502,7 @@ function yf(t) {
10537
10502
  }
10538
10503
  }
10539
10504
  function fa(t, e) {
10540
- if (bf(t))
10505
+ if (mf(t))
10541
10506
  return;
10542
10507
  const n = `
10543
10508
  :host {
@@ -13769,18 +13734,18 @@ function fa(t, e) {
13769
13734
  }
13770
13735
  }
13771
13736
  `;
13772
- if (_f(t, n))
13737
+ if (wf(t, n))
13773
13738
  return;
13774
13739
  const i = t.ownerDocument.createElement("style");
13775
13740
  i.id = dl, i.textContent = n, t.appendChild(i), xl(t);
13776
13741
  }
13777
- function bf(t) {
13742
+ function mf(t) {
13778
13743
  return t.getElementById(dl) !== null || t.host instanceof HTMLElement && t.host.getAttribute(cl) === "true";
13779
13744
  }
13780
13745
  function xl(t) {
13781
13746
  t.host instanceof HTMLElement && t.host.setAttribute(cl, "true");
13782
13747
  }
13783
- function _f(t, e) {
13748
+ function wf(t, e) {
13784
13749
  if (typeof CSSStyleSheet > "u" || typeof CSSStyleSheet.prototype.replaceSync != "function" || !("adoptedStyleSheets" in t))
13785
13750
  return !1;
13786
13751
  try {
@@ -13790,7 +13755,7 @@ function _f(t, e) {
13790
13755
  return !1;
13791
13756
  }
13792
13757
  }
13793
- async function Sf() {
13758
+ async function yf() {
13794
13759
  return document.body ? document.body : await new Promise((t) => {
13795
13760
  const e = new MutationObserver(() => {
13796
13761
  document.body && (e.disconnect(), t(document.body));
@@ -13804,7 +13769,7 @@ function _o(t) {
13804
13769
  function Tl(t) {
13805
13770
  return `${_o(t)}.displayState`;
13806
13771
  }
13807
- function vf(t) {
13772
+ function bf(t) {
13808
13773
  try {
13809
13774
  return window.sessionStorage.getItem(
13810
13775
  Tl(t)
@@ -13826,7 +13791,7 @@ function ma(t, e) {
13826
13791
  return;
13827
13792
  }
13828
13793
  }
13829
- function If(t) {
13794
+ function _f(t) {
13830
13795
  if (t)
13831
13796
  return { clientId: t, release: () => {
13832
13797
  } };
@@ -13834,7 +13799,7 @@ function If(t) {
13834
13799
  for (; Ss.has(e); )
13835
13800
  e += 1;
13836
13801
  Ss.add(e);
13837
- const n = `${hg}${e}`;
13802
+ const n = `${gg}${e}`;
13838
13803
  let i = crypto.randomUUID();
13839
13804
  try {
13840
13805
  i = window.sessionStorage.getItem(n) ?? i, window.sessionStorage.setItem(n, i);
@@ -13848,7 +13813,7 @@ function If(t) {
13848
13813
  }
13849
13814
  };
13850
13815
  }
13851
- function xf(t) {
13816
+ function Sf(t) {
13852
13817
  try {
13853
13818
  const e = window.localStorage.getItem(_o(t));
13854
13819
  if (!e)
@@ -13857,13 +13822,11 @@ function xf(t) {
13857
13822
  return {
13858
13823
  isOpen: n.isOpen === !0,
13859
13824
  composerValue: typeof n.composerValue == "string" ? n.composerValue : "",
13860
- focusedInput: n.focusedInput === "composer" || n.focusedInput === "launcher" ? n.focusedInput : null,
13861
- focusedInputAt: typeof n.focusedInputAt == "number" ? n.focusedInputAt : null,
13862
13825
  openToolGroupKeys: Array.isArray(n.openToolGroupKeys) ? n.openToolGroupKeys.filter(
13863
13826
  (i) => typeof i == "string"
13864
13827
  ) : [],
13865
- launcherPosition: kf(n.launcherPosition) ? n.launcherPosition : null,
13866
- panelSize: Cf(n.panelSize) ? Ci(n.panelSize) : null
13828
+ launcherPosition: If(n.launcherPosition) ? n.launcherPosition : null,
13829
+ panelSize: xf(n.panelSize) ? Ci(n.panelSize) : null
13867
13830
  };
13868
13831
  } catch {
13869
13832
  return wa();
@@ -13873,14 +13836,12 @@ function wa() {
13873
13836
  return {
13874
13837
  isOpen: !1,
13875
13838
  composerValue: "",
13876
- focusedInput: null,
13877
- focusedInputAt: null,
13878
13839
  openToolGroupKeys: [],
13879
13840
  launcherPosition: null,
13880
13841
  panelSize: null
13881
13842
  };
13882
13843
  }
13883
- function Tf(t, e) {
13844
+ function vf(t, e) {
13884
13845
  try {
13885
13846
  window.localStorage.setItem(
13886
13847
  _o(t),
@@ -13890,13 +13851,13 @@ function Tf(t, e) {
13890
13851
  return;
13891
13852
  }
13892
13853
  }
13893
- function kf(t) {
13854
+ function If(t) {
13894
13855
  if (!t || typeof t != "object")
13895
13856
  return !1;
13896
13857
  const e = t;
13897
13858
  return Number.isFinite(e.x) && Number.isFinite(e.y) && (e.anchor === "top-left" || e.anchor === "top-right" || e.anchor === "bottom-left" || e.anchor === "bottom-right");
13898
13859
  }
13899
- function Cf(t) {
13860
+ function xf(t) {
13900
13861
  if (!t || typeof t != "object")
13901
13862
  return !1;
13902
13863
  const e = t;
@@ -13922,7 +13883,7 @@ async function kl(t, e) {
13922
13883
  throw new Error("Pluno token endpoint did not return a token");
13923
13884
  return i.token;
13924
13885
  }
13925
- function Ef(t) {
13886
+ function Tf(t) {
13926
13887
  let e = !1, n = !1;
13927
13888
  const i = async () => {
13928
13889
  const s = new AbortController();
@@ -13930,7 +13891,7 @@ function Ef(t) {
13930
13891
  const a = new Promise((r, d) => {
13931
13892
  const c = window.setTimeout(() => {
13932
13893
  o = !0, s.abort(), d(new Error(Kr));
13933
- }, pg);
13894
+ }, ug);
13934
13895
  s.signal.addEventListener(
13935
13896
  "abort",
13936
13897
  () => window.clearTimeout(c),
@@ -13944,7 +13905,7 @@ function Ef(t) {
13944
13905
  ]);
13945
13906
  return s.abort(), r;
13946
13907
  } catch (r) {
13947
- throw s.abort(), o ? new Error(Kr) : r instanceof Error && r.message.startsWith("Pluno widget blocked on ") ? r : new Error(gg);
13908
+ throw s.abort(), o ? new Error(Kr) : r instanceof Error && r.message.startsWith("Pluno widget blocked on ") ? r : new Error(pg);
13948
13909
  }
13949
13910
  };
13950
13911
  return {
@@ -13968,29 +13929,29 @@ function Ef(t) {
13968
13929
  };
13969
13930
  }
13970
13931
  const ya = /* @__PURE__ */ new WeakSet();
13971
- function Af(t) {
13932
+ function kf(t) {
13972
13933
  return Object.keys(t.dataset).some((e) => e.startsWith("pluno"));
13973
13934
  }
13974
13935
  function ba(t) {
13975
13936
  const e = t.pathname.split("/");
13976
13937
  return e[e.length - 1] ?? "";
13977
13938
  }
13978
- function Mf(t, e) {
13939
+ function Cf(t, e) {
13979
13940
  const n = new URL(t.src, document.baseURI);
13980
13941
  return n.href === e.href || n.pathname === e.pathname ? !0 : ba(n) === ba(e);
13981
13942
  }
13982
13943
  class pt extends EventTarget {
13983
13944
  constructor(e, n) {
13984
- super(), this.channelId = n, this.url = e, this.addPreviewListener(lg, () => {
13945
+ super(), this.channelId = n, this.url = e, this.addPreviewListener(ag, () => {
13985
13946
  this.readyState = pt.OPEN, this.dispatchEvent(new Event("open"));
13986
- }), this.addPreviewListener(dg, (i) => {
13947
+ }), this.addPreviewListener(lg, (i) => {
13987
13948
  const s = i;
13988
13949
  this.dispatchEvent(
13989
13950
  new MessageEvent("message", { data: s.detail?.data ?? "" })
13990
13951
  );
13991
- }), this.addPreviewListener(cg, () => {
13952
+ }), this.addPreviewListener(dg, () => {
13992
13953
  this.readyState = pt.CLOSED, this.dispatchEvent(new Event("error")), this.cleanup();
13993
- }), this.addPreviewListener(ug, (i) => {
13954
+ }), this.addPreviewListener(cg, (i) => {
13994
13955
  const s = i;
13995
13956
  this.readyState = pt.CLOSED, this.dispatchEvent(
13996
13957
  new CloseEvent("close", {
@@ -14002,7 +13963,7 @@ class pt extends EventTarget {
14002
13963
  }), window.dispatchEvent(
14003
13964
  new CustomEvent(
14004
13965
  si(
14005
- og,
13966
+ sg,
14006
13967
  this.channelId
14007
13968
  ),
14008
13969
  {
@@ -14022,7 +13983,7 @@ class pt extends EventTarget {
14022
13983
  binaryType = "blob";
14023
13984
  bufferedAmount = 0;
14024
13985
  readyState = pt.CONNECTING;
14025
- socketId = Pf();
13986
+ socketId = Ef();
14026
13987
  listeners = /* @__PURE__ */ new Map();
14027
13988
  send(e) {
14028
13989
  if (this.readyState !== pt.OPEN)
@@ -14032,7 +13993,7 @@ class pt extends EventTarget {
14032
13993
  );
14033
13994
  window.dispatchEvent(
14034
13995
  new CustomEvent(
14035
- si(rg, this.channelId),
13996
+ si(og, this.channelId),
14036
13997
  {
14037
13998
  detail: {
14038
13999
  socketId: this.socketId,
@@ -14045,7 +14006,7 @@ class pt extends EventTarget {
14045
14006
  close(e, n) {
14046
14007
  this.readyState !== pt.CLOSED && (this.readyState = pt.CLOSING, window.dispatchEvent(
14047
14008
  new CustomEvent(
14048
- si(ag, this.channelId),
14009
+ si(rg, this.channelId),
14049
14010
  {
14050
14011
  detail: { socketId: this.socketId, code: e, reason: n }
14051
14012
  }
@@ -14067,7 +14028,7 @@ class pt extends EventTarget {
14067
14028
  this.listeners.clear();
14068
14029
  }
14069
14030
  }
14070
- function Pf() {
14031
+ function Ef() {
14071
14032
  const t = window.sessionStorage.getItem(
14072
14033
  Gr
14073
14034
  );
@@ -14079,7 +14040,7 @@ function Pf() {
14079
14040
  function si(t, e) {
14080
14041
  return `${t}:${e}`;
14081
14042
  }
14082
- function Rf(t) {
14043
+ function Af(t) {
14083
14044
  const e = document.currentScript;
14084
14045
  if (e instanceof HTMLScriptElement)
14085
14046
  return [e];
@@ -14087,11 +14048,11 @@ function Rf(t) {
14087
14048
  return Array.from(
14088
14049
  document.querySelectorAll("script[type='module'][src]")
14089
14050
  ).filter(
14090
- (s) => s instanceof HTMLScriptElement && Af(s) && Mf(s, i)
14051
+ (s) => s instanceof HTMLScriptElement && kf(s) && Cf(s, i)
14091
14052
  );
14092
14053
  }
14093
- function Lf(t) {
14094
- for (const e of Rf(t))
14054
+ function Mf(t) {
14055
+ for (const e of Af(t))
14095
14056
  ya.has(e) || e.dataset.plunoAutoMount === "false" || (ya.add(e), Cl(e).catch((n) => {
14096
14057
  console.error("Failed to mount Pluno widget", n);
14097
14058
  }));
@@ -14104,13 +14065,13 @@ function Cl(t) {
14104
14065
  const d = e[ct];
14105
14066
  return d ? d.mountPromise : Cl(t);
14106
14067
  });
14107
- if (Df(n.host))
14068
+ if (Pf(n.host))
14108
14069
  return n.retryPendingTokenFailureOnce?.(), n.mountPromise;
14109
14070
  n.destroy?.(), delete e[ct];
14110
14071
  }
14111
- const i = t.dataset.plunoPreviewChannel, s = t.dataset.plunoTokenEndpoint, o = !t.dataset.plunoToken && !i && s ? Ef(s) : null;
14072
+ const i = t.dataset.plunoPreviewChannel, s = t.dataset.plunoTokenEndpoint, o = !t.dataset.plunoToken && !i && s ? Tf(s) : null;
14112
14073
  let a;
14113
- const r = Ng({
14074
+ const r = Dg({
14114
14075
  token: t.dataset.plunoToken,
14115
14076
  tokenProvider: o?.loadToken,
14116
14077
  tokenEndpoint: s,
@@ -14141,11 +14102,11 @@ function Cl(t) {
14141
14102
  retryPendingTokenFailureOnce: o?.retryPendingFailureOnce ?? null
14142
14103
  }, e[ct] = a, r;
14143
14104
  }
14144
- function Df(t) {
14105
+ function Pf(t) {
14145
14106
  return t.isConnected && t.getAttribute(ol) === "true" && !!t.shadowRoot?.querySelector(".pluno-pa-widget__launcher") && !!t.shadowRoot?.querySelector(".pluno-pa-widget__panel");
14146
14107
  }
14147
- Lf(import.meta.url);
14108
+ Mf(import.meta.url);
14148
14109
  export {
14149
14110
  Ug as createProductAgentPreviewBridgeWebSocketFactory,
14150
- Ng as mountPlunoProductAgentWidget
14111
+ Dg as mountPlunoProductAgentWidget
14151
14112
  };