@pluno/product-agent-web 0.1.306 → 0.1.308

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.
@@ -52,7 +52,7 @@ function th(t, e, n) {
52
52
  function nh([t, e, n], i) {
53
53
  return `rgba(${Math.round(t)}, ${Math.round(e)}, ${Math.round(n)}, ${i})`;
54
54
  }
55
- function Vr([t, e, n]) {
55
+ function Gr([t, e, n]) {
56
56
  const i = (s) => {
57
57
  const o = s / 255;
58
58
  return o <= 0.03928 ? o / 12.92 : Math.pow((o + 0.055) / 1.055, 2.4);
@@ -60,7 +60,7 @@ function Vr([t, e, n]) {
60
60
  return 0.2126 * i(t) + 0.7152 * i(e) + 0.0722 * i(n);
61
61
  }
62
62
  function il(t, e) {
63
- const n = Vr(t), i = Vr(e), [s, o] = n > i ? [n, i] : [i, n];
63
+ const n = Gr(t), i = Gr(e), [s, o] = n > i ? [n, i] : [i, n];
64
64
  return (s + 0.05) / (o + 0.05);
65
65
  }
66
66
  function ih(t, e, n, i) {
@@ -74,9 +74,9 @@ function ih(t, e, n, i) {
74
74
  return sh(e);
75
75
  }
76
76
  function sh(t) {
77
- return Vr(t) > 0.5 ? [24, 24, 27] : [250, 250, 249];
77
+ return Gr(t) > 0.5 ? [24, 24, 27] : [250, 250, 249];
78
78
  }
79
- const oh = "0.1.306", ci = {
79
+ const oh = "0.1.308", ci = {
80
80
  version: oh
81
81
  }, fe = (t) => typeof t == "string" && /^[a-zA-Z0-9:_.-]{1,160}$/.test(t) ? t : null;
82
82
  function Ld(t) {
@@ -107,7 +107,7 @@ function rh(t, e, n) {
107
107
  projectionReady: typeof s?.projection_ready == "boolean" ? s.projection_ready : null
108
108
  };
109
109
  }
110
- function Js(t) {
110
+ function Qs(t) {
111
111
  const e = t.closest("[data-conversation-gate]")?.dataset.conversationGate;
112
112
  return e === "authentication" || e === "signup" ? e : "none";
113
113
  }
@@ -123,7 +123,7 @@ function ah(t) {
123
123
  e = Math.imul(e ^ t.charCodeAt(i), 16777619) >>> 0, n = Math.imul(n ^ t.charCodeAt(i), 33) >>> 0;
124
124
  return `selection:${e.toString(16)}:${n.toString(16)}`;
125
125
  }
126
- const Gr = ["messageKeys", "canonicalItemKeys", "terminalResponseKeys", "toolCallKeys", "activeResponseKeys"], wt = (t) => typeof t == "string" && /^[a-zA-Z0-9:_-]{1,160}$/.test(t), Bn = (t) => t === null || wt(t), Ud = (t) => typeof t == "string" && /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,6})?(?:Z|\+00:00)$/.test(t) && Number.isFinite(Date.parse(t));
126
+ const Jr = ["messageKeys", "canonicalItemKeys", "terminalResponseKeys", "toolCallKeys", "activeResponseKeys"], wt = (t) => typeof t == "string" && /^[a-zA-Z0-9:_-]{1,160}$/.test(t), Bn = (t) => t === null || wt(t), Ud = (t) => typeof t == "string" && /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,6})?(?:Z|\+00:00)$/.test(t) && Number.isFinite(Date.parse(t));
127
127
  function zd(t) {
128
128
  if (!t || typeof t != "object") return !1;
129
129
  const e = t;
@@ -142,7 +142,7 @@ function ch(t, e) {
142
142
  };
143
143
  return zd(i) ? i : void 0;
144
144
  }
145
- function Jr(t) {
145
+ function Qr(t) {
146
146
  const e = (n) => t[n].filter(wt).slice(-20);
147
147
  return {
148
148
  sessionId: wt(t.selectedSessionId) ? t.selectedSessionId : null,
@@ -154,7 +154,7 @@ function Jr(t) {
154
154
  thinkingSequence: (t.thinkingSequence ?? []).slice(-20),
155
155
  runtimeItemCount: t.runtimeItemCount ?? 0,
156
156
  welcome: t.welcome ?? !1,
157
- truncated: (t.thinkingSequence?.length ?? 0) > 20 || Gr.some((n) => t[n].length > 20 || t[n].some((i) => !wt(i)))
157
+ truncated: (t.thinkingSequence?.length ?? 0) > 20 || Jr.some((n) => t[n].length > 20 || t[n].some((i) => !wt(i)))
158
158
  };
159
159
  }
160
160
  function Bd(t) {
@@ -176,17 +176,17 @@ function Bd(t) {
176
176
  };
177
177
  }
178
178
  function lh(t, e, n) {
179
- const i = Jr(t), s = n ? Bd(n) : { truncated: !1 };
179
+ const i = Qr(t), s = n ? Bd(n) : { truncated: !1 };
180
180
  return {
181
- before: e ? Jr(e) : null,
181
+ before: e ? Qr(e) : null,
182
182
  current: { ...i, ...s, truncated: i.truncated || s.truncated }
183
183
  };
184
184
  }
185
185
  function dh(t, e, n = {}) {
186
- const i = (a, r) => Array.from(t.querySelectorAll(a)).flatMap((c) => c.getAttribute(r) ?? []), s = Jr({
186
+ const i = (a, r) => Array.from(t.querySelectorAll(a)).flatMap((c) => c.getAttribute(r) ?? []), s = Qr({
187
187
  selectedSessionId: e.sessionId,
188
188
  runtimeItemCount: e.messages.length,
189
- welcome: Js(t) === "none" && !!t.querySelector(".pluno-pa-widget__empty-state--starter:not(.pluno-pa-widget__empty-state--morning-report), .empty-state--starter"),
189
+ welcome: Qs(t) === "none" && !!t.querySelector(".pluno-pa-widget__empty-state--starter:not(.pluno-pa-widget__empty-state--morning-report), .empty-state--starter"),
190
190
  messageKeys: Array.from(t.querySelectorAll("[data-message-key], [data-entry-key][data-message-role]")).flatMap((a) => a.dataset.messageKey ?? a.dataset.entryKey ?? []),
191
191
  canonicalItemKeys: i("[data-canonical-item-key]", "data-canonical-item-key"),
192
192
  terminalResponseKeys: i("[data-terminal-response-key]", "data-terminal-response-key"),
@@ -199,14 +199,14 @@ function dh(t, e, n = {}) {
199
199
  ...s,
200
200
  ...o,
201
201
  truncated: s.truncated || o.truncated,
202
- context: Qr(t, e, n)
202
+ context: Yr(t, e, n)
203
203
  };
204
204
  }
205
- function Qr(t, e, n = {}) {
205
+ function Yr(t, e, n = {}) {
206
206
  const i = e.conversationDiagnostics;
207
207
  return {
208
208
  sdkVersion: ci.version,
209
- presentationGate: Js(t),
209
+ presentationGate: Qs(t),
210
210
  capturedAt: Date.now(),
211
211
  selectionKey: ah(e.selectionKey),
212
212
  userId: fe(e.user?.id),
@@ -235,11 +235,11 @@ function ph(t) {
235
235
  const e = (i) => {
236
236
  if (!i || typeof i != "object") return !1;
237
237
  const s = i;
238
- return Object.keys(i).every((o) => [...Gr, "sessionId", "runtimeItemCount", "welcome", "truncated", "thinkingSequence", "context", "duplicateToolCalls"].includes(o)) && (s.duplicateToolCalls === void 0 || Array.isArray(s.duplicateToolCalls) && s.duplicateToolCalls.length <= 5 && s.duplicateToolCalls.every((o) => o && Object.keys(o).every((a) => ["key", "count", "rows", "truncated"].includes(a)) && Bn(o.key) && Number.isSafeInteger(o.count) && o.count >= 2 && typeof o.truncated == "boolean" && Array.isArray(o.rows) && o.rows.length >= 1 && o.rows.length <= 5 && o.rows.length <= o.count && o.rows.every((a) => a && Object.keys(a).every((r) => ["itemId", "groupId"].includes(r)) && Bn(a.itemId) && Bn(a.groupId)))) && (s.context === void 0 || uh(s.context)) && (s.thinkingSequence === void 0 || Array.isArray(s.thinkingSequence) && s.thinkingSequence.length <= 20 && s.thinkingSequence.every((o) => o === "user" || o === "thinking")) && Bn(s.sessionId) && Number.isSafeInteger(s.runtimeItemCount) && s.runtimeItemCount >= 0 && typeof s.welcome == "boolean" && typeof s.truncated == "boolean" && Gr.every((o) => Array.isArray(s[o]) && s[o].length <= 20 && s[o].every(wt));
238
+ return Object.keys(i).every((o) => [...Jr, "sessionId", "runtimeItemCount", "welcome", "truncated", "thinkingSequence", "context", "duplicateToolCalls"].includes(o)) && (s.duplicateToolCalls === void 0 || Array.isArray(s.duplicateToolCalls) && s.duplicateToolCalls.length <= 5 && s.duplicateToolCalls.every((o) => o && Object.keys(o).every((a) => ["key", "count", "rows", "truncated"].includes(a)) && Bn(o.key) && Number.isSafeInteger(o.count) && o.count >= 2 && typeof o.truncated == "boolean" && Array.isArray(o.rows) && o.rows.length >= 1 && o.rows.length <= 5 && o.rows.length <= o.count && o.rows.every((a) => a && Object.keys(a).every((r) => ["itemId", "groupId"].includes(r)) && Bn(a.itemId) && Bn(a.groupId)))) && (s.context === void 0 || uh(s.context)) && (s.thinkingSequence === void 0 || Array.isArray(s.thinkingSequence) && s.thinkingSequence.length <= 20 && s.thinkingSequence.every((o) => o === "user" || o === "thinking")) && Bn(s.sessionId) && Number.isSafeInteger(s.runtimeItemCount) && s.runtimeItemCount >= 0 && typeof s.welcome == "boolean" && typeof s.truncated == "boolean" && Jr.every((o) => Array.isArray(s[o]) && s[o].length <= 20 && s[o].every(wt));
239
239
  }, n = t;
240
240
  return (n.before === null || e(n.before)) && e(n.current);
241
241
  }
242
- function po(t) {
242
+ function ho(t) {
243
243
  if (!t || typeof t != "object") return !1;
244
244
  const e = t;
245
245
  return Object.keys(t).every((n) => ["boundary", "category", "messageKind"].includes(n)) && ["runtime", "web_transport", "extension_ipc"].includes(e.boundary) && ["error", "object", "null", "array", "string", "undefined", "number", "boolean", "bigint", "symbol", "function"].includes(e.category) && ["object_coercion", "text", "blank", "non_text"].includes(e.messageKind);
@@ -266,7 +266,7 @@ function Xt(t, e = "runtime_error", n = "runtime") {
266
266
  const i = t !== null && typeof t == "object" ? t : null, s = typeof t == "string" ? t : i && "message" in i && typeof i.message == "string" ? i.message : "", o = i && "code" in i && typeof i.code == "string" && i.code.trim() ? i.code : e, a = i && "details" in i ? i.details : null, r = a && typeof a == "object" ? a : {}, c = {
267
267
  ...typeof r.httpStatus == "number" && Number.isInteger(r.httpStatus) && r.httpStatus >= 100 && r.httpStatus <= 599 ? { httpStatus: r.httpStatus } : {},
268
268
  // Preserve the first boundary's shape after normalization replaces the original message/prototype.
269
- errorNormalization: po(r.errorNormalization) ? r.errorNormalization : {
269
+ errorNormalization: ho(r.errorNormalization) ? r.errorNormalization : {
270
270
  boundary: n,
271
271
  category: t instanceof Error ? "error" : t === null ? "null" : Array.isArray(t) ? "array" : typeof t,
272
272
  messageKind: s.trim() === "[object Object]" ? "object_coercion" : s.trim() ? "text" : typeof t == "string" || i && "message" in i && typeof i.message == "string" ? "blank" : "non_text"
@@ -297,7 +297,7 @@ function Ln(t, e = "runtime") {
297
297
  `).replace(/\n\s*at\s/g, `
298
298
  frame `)) : void 0;
299
299
  return {
300
- ...po(n.details?.errorNormalization) ? { normalization: n.details.errorNormalization } : {},
300
+ ...ho(n.details?.errorNormalization) ? { normalization: n.details.errorNormalization } : {},
301
301
  category: t instanceof Error ? "error" : t === null ? "null" : Array.isArray(t) ? "array" : typeof t,
302
302
  code: Hn(n.code),
303
303
  message: Hn(n.message),
@@ -358,7 +358,7 @@ function bh(t) {
358
358
  actions: ["history_load_failed", "display_projection_disabled", "projection_not_ready", "history_preparation_failed"].includes(e ?? "") ? ["retry_history", "new_chat"] : ["run_recovery_exhausted", "transient_model_error", "run_still_active", "message_delivery_failed", "message_acceptance_unconfirmed", "context_preparation_interrupted"].includes(e ?? "") ? ["retry_message"] : ["new_chat"]
359
359
  };
360
360
  }
361
- const Qs = [
361
+ const Ys = [
362
362
  { value: "gpt-6-sol", label: "gpt-6-sol", price: "$$" },
363
363
  { value: "gpt-6-luna", label: "gpt-6-luna", price: "$" },
364
364
  { value: "deepseek/deepseek-v4-flash", label: "DeepSeek V4 Flash", price: "$" },
@@ -367,7 +367,7 @@ const Qs = [
367
367
  function wh(t) {
368
368
  return t.length <= 4 ? { primary: t, more: [] } : { primary: t.slice(0, 3), more: t.slice(3) };
369
369
  }
370
- const jd = wh(Qs), Qi = jd.primary, rl = jd.more, _h = (t) => Qs.some((e) => e.value === t), vh = (t) => t.label, Nn = (t) => t === "gpt-5.6-sol" || t === "gpt-5.6-terra" || t === "anthropic/claude-sonnet-5" ? "gpt-6-sol" : t === "anthropic/claude-opus-5" ? "anthropic/claude-opus-5.5" : _h(t) ? t : void 0;
370
+ const jd = wh(Ys), Qi = jd.primary, rl = jd.more, _h = (t) => Ys.some((e) => e.value === t), vh = (t) => t.label, Nn = (t) => t === "gpt-5.6-sol" || t === "gpt-5.6-terra" || t === "anthropic/claude-sonnet-5" ? "gpt-6-sol" : t === "anthropic/claude-opus-5" ? "anthropic/claude-opus-5.5" : _h(t) ? t : void 0;
371
371
  function Ls(t, e, n) {
372
372
  t.throwIfAborted();
373
373
  let i, s = () => {
@@ -379,18 +379,18 @@ function Ls(t, e, n) {
379
379
  clearTimeout(i), t.removeEventListener("abort", s);
380
380
  });
381
381
  }
382
- const Yr = ["main-chat-omnibox-hint", "main-chat-whatsapp-hint"], Xr = "pluno.productAgent.deviceHints", al = ["pluno.productAgent.omniboxHintDismissed", "pluno.productAgent.whatsappHintDismissed"], cl = "pluno.productAgent.mainChatPromptDecisions";
383
- function Zr(t) {
384
- const e = JSON.parse(t.getItem(Xr) ?? "{}"), n = JSON.parse(t.getItem(cl) ?? "[]"), i = Object.fromEntries(Yr.map((s, o) => [s, e[s] === !0 || t.getItem(al[o]) === "true" || n.some((a) => a.scope.level === "device" && a.scope.key === "main-web-chat" && (a.promptKey === s || a.action === "dont_show_again" && a.category === (o ? "connections" : "product-tips")) && ["dismiss", "never", "dont_show_again"].includes(a.action))]));
385
- t.setItem(Xr, JSON.stringify(i));
382
+ const Xr = ["main-chat-omnibox-hint", "main-chat-whatsapp-hint"], Zr = "pluno.productAgent.deviceHints", al = ["pluno.productAgent.omniboxHintDismissed", "pluno.productAgent.whatsappHintDismissed"], cl = "pluno.productAgent.mainChatPromptDecisions";
383
+ function ea(t) {
384
+ const e = JSON.parse(t.getItem(Zr) ?? "{}"), n = JSON.parse(t.getItem(cl) ?? "[]"), i = Object.fromEntries(Xr.map((s, o) => [s, e[s] === !0 || t.getItem(al[o]) === "true" || n.some((a) => a.scope.level === "device" && a.scope.key === "main-web-chat" && (a.promptKey === s || a.action === "dont_show_again" && a.category === (o ? "connections" : "product-tips")) && ["dismiss", "never", "dont_show_again"].includes(a.action))]));
385
+ t.setItem(Zr, JSON.stringify(i));
386
386
  for (const s of al) t.removeItem(s);
387
- return t.setItem(cl, JSON.stringify(n.filter((s) => !Yr.includes(s.promptKey)))), i;
387
+ return t.setItem(cl, JSON.stringify(n.filter((s) => !Xr.includes(s.promptKey)))), i;
388
388
  }
389
389
  function Ih(t, e) {
390
- if (!Yr.includes(e)) throw new Error("Unknown device hint.");
391
- t.setItem(Xr, JSON.stringify({ ...Zr(t), [e]: !0 }));
390
+ if (!Xr.includes(e)) throw new Error("Unknown device hint.");
391
+ t.setItem(Zr, JSON.stringify({ ...ea(t), [e]: !0 }));
392
392
  }
393
- function rr(t, e, n, i) {
393
+ function ar(t, e, n, i) {
394
394
  if (n.authorityId !== t.account.authority?.authorityId || n.generation !== t.account.authority.generation) return t;
395
395
  const s = {};
396
396
  let o = t.interactions.openingGeneration;
@@ -465,7 +465,7 @@ const $d = {
465
465
  read_hosted_browser_eligibility: "canReadHostedBrowserEligibility",
466
466
  manage_interactions: "canManageInteractions",
467
467
  invoke_conversation_action: "canInvokeConversationActions"
468
- }, ea = {
468
+ }, ta = {
469
469
  canConnect: !0,
470
470
  canRenderConversation: !0,
471
471
  canShowPersonalFeatures: !0,
@@ -512,7 +512,7 @@ const $d = {
512
512
  canManageInteractions: !0,
513
513
  canInvokeConversationActions: !0
514
514
  }, Sh = {
515
- ...ea,
515
+ ...ta,
516
516
  canExecuteCurrentPageTools: !1,
517
517
  canManageTabs: !1,
518
518
  canUseSandboxFiles: !1,
@@ -568,8 +568,8 @@ const $d = {
568
568
  canManageInteractions: !0,
569
569
  canInvokeConversationActions: !0
570
570
  }, kh = {
571
- extension_sidepanel: ea,
572
- extension_widget: ea,
571
+ extension_sidepanel: ta,
572
+ extension_widget: ta,
573
573
  main_web_chat: Sh,
574
574
  embedded_widget: ll,
575
575
  embedded_custom_ui: ll
@@ -601,7 +601,7 @@ function Gt(t) {
601
601
  if (!e) throw new Error("Display timestamps must retain the backend UTC precision.");
602
602
  return `${e[1]}.${(e[2] ?? "").padEnd(6, "0")}`;
603
603
  }
604
- function Ys(t) {
604
+ function Xs(t) {
605
605
  return "revision" in t.data ? t.data.revision : null;
606
606
  }
607
607
  function Zt(t) {
@@ -629,7 +629,7 @@ function ni(t, e) {
629
629
  updatedAt: n ? t.updatedAt : null
630
630
  };
631
631
  }
632
- function ar(t, e) {
632
+ function cr(t, e) {
633
633
  return t.key !== e.key || t.requestId !== e.requestId ? t : {
634
634
  ...t,
635
635
  status: "ready",
@@ -652,7 +652,7 @@ function lt(t) {
652
652
  function Kd(t = "", e = 0) {
653
653
  return Ve({ authorityId: t, generation: e, pendingRestoration: {}, proactiveQuestions: {}, sessions: {}, submissions: {}, submissionOrder: [], stops: {}, requests: {}, requestSequence: 0, deliveries: {}, operations: {}, effectsEnabled: !1, durableSubmissionIds: [], pendingDurabilityIds: [], checkpointEffectId: null, checkpointError: null });
654
654
  }
655
- function ta(t) {
655
+ function na(t) {
656
656
  return {
657
657
  sessionId: t,
658
658
  items: {},
@@ -679,7 +679,7 @@ function Jt(t, e, n) {
679
679
  return te < ne ? -1 : te > ne ? 1 : C.id < U.id ? -1 : C.id > U.id ? 1 : 0;
680
680
  }), c = a.filter((C) => (!C.cancelled || C.conversationScopeId === n && (C.sessionId === null || C.sessionId === s || s === null && C === a[a.length - 1])) && !o?.items[C.userMessageId] && !o?.removedItems[C.userMessageId]), l = {};
681
681
  for (const C of r) {
682
- const U = Ys(C);
682
+ const U = Xs(C);
683
683
  if (U === null) continue;
684
684
  const te = o?.streams[C.id];
685
685
  l[C.id] = te ? te.state === "open" ? "open" : U < te.revision ? "awaiting_content" : te.state : "open";
@@ -773,7 +773,7 @@ function Gd(t) {
773
773
  function La(t) {
774
774
  if (!{ social_share: ["dismiss", "shared"], proactive_suggestion: ["not_now", "never"], morning_report: ["snooze"] }[t.category]?.some((n) => n === t.action)) throw new Error("Unsupported category action.");
775
775
  }
776
- function cr(t, e) {
776
+ function lr(t, e) {
777
777
  const n = { ...t.decisions };
778
778
  for (const i of e) {
779
779
  if (La(i.request), i.decisionKey !== Gd(i.request)) throw new Error("Decision scope does not match its category.");
@@ -1122,13 +1122,13 @@ function Ph(t, e, n, i) {
1122
1122
  }
1123
1123
  return { state: s, effects: o };
1124
1124
  }
1125
- function na(t = null) {
1125
+ function ia(t = null) {
1126
1126
  return { authority: t, refusal: null, paidFallbackBySession: {}, query: Zt("account"), preferences: null };
1127
1127
  }
1128
1128
  function qh(t, e) {
1129
1129
  return t.preferences && e.preferencesVersion <= t.preferences.preferencesVersion ? t : { ...t, preferences: e };
1130
1130
  }
1131
- function ia() {
1131
+ function sa() {
1132
1132
  return {
1133
1133
  promptActions: {},
1134
1134
  openings: {},
@@ -1156,7 +1156,7 @@ function ia() {
1156
1156
  deviceErrors: {}
1157
1157
  };
1158
1158
  }
1159
- function sa(t = 0) {
1159
+ function oa(t = 0) {
1160
1160
  return { suggestionReadFailures: 0, suggestionRetryAfter: null, localScribbleStyle: null, originContextQueries: {}, contextObservers: {}, contextReads: {}, contextRunOrigins: {}, appearanceEpochs: {}, appearanceQueries: {}, polls: {}, queries: {}, pending: {}, queuedPreferences: {}, desiredPreferences: {}, refreshBatch: null, refreshQueuedRequestId: null, refreshAt: null, failures: 0, now: t, timerId: null, timerDeadline: null, timerRevision: 0, refreshRequired: !1, schedulerError: null, deepFlows: {} };
1161
1161
  }
1162
1162
  function yt(t, e) {
@@ -1223,7 +1223,7 @@ function pl(t) {
1223
1223
  function Mn(t, e, n) {
1224
1224
  return JSON.stringify(["stage7", t.authorityId, t.generation, e, n]);
1225
1225
  }
1226
- function oa(t, e, n) {
1226
+ function ra(t, e, n) {
1227
1227
  let i = t;
1228
1228
  const s = [], o = (m) => {
1229
1229
  i = { ...i, features: { ...i.features, ...m } };
@@ -1232,12 +1232,12 @@ function oa(t, e, n) {
1232
1232
  };
1233
1233
  if (e.type === "stage7.initialize") {
1234
1234
  const m = i.account.authority;
1235
- return m && JSON.stringify(m) === JSON.stringify(e.authority) ? { state: i, effects: s } : { state: { account: na(e.authority), features: sa(e.now), interactions: ia() }, effects: s };
1235
+ return m && JSON.stringify(m) === JSON.stringify(e.authority) ? { state: i, effects: s } : { state: { account: ia(e.authority), features: oa(e.now), interactions: sa() }, effects: s };
1236
1236
  }
1237
1237
  const r = i.account.authority;
1238
1238
  if (!r) return { state: i, effects: s };
1239
1239
  if ("authority" in e && JSON.stringify(e.authority) !== JSON.stringify(r)) return { state: i, effects: s };
1240
- if (e.type === "stage7.retire") return { state: { account: na(), features: sa(e.now), interactions: ia() }, effects: s };
1240
+ if (e.type === "stage7.retire") return { state: { account: ia(), features: oa(e.now), interactions: sa() }, effects: s };
1241
1241
  "now" in e && o({ now: e.now });
1242
1242
  const c = (m, w) => {
1243
1243
  const I = { ...i.features.contextObservers }, E = I[m];
@@ -1261,7 +1261,7 @@ function oa(t, e, n) {
1261
1261
  if (e.type === "stage7.act" || e.type === "stage7.retry_action" || (e.type === "effect.completed" || e.type === "effect.failed") && e.effectKind === "stage7.platform") {
1262
1262
  const m = Th(i, e, n.conversation, n.directory);
1263
1263
  if (!m.command) return { state: m.state, effects: m.effects };
1264
- const w = oa(m.state, m.command, n);
1264
+ const w = ra(m.state, m.command, n);
1265
1265
  return { state: w.state, effects: [...m.effects, ...w.effects] };
1266
1266
  }
1267
1267
  const u = (m, w, I) => {
@@ -1292,7 +1292,7 @@ function oa(t, e, n) {
1292
1292
  const E = m.kind === "preferencePrompts" ? m.value[I] : m.feature === I ? m.value : null;
1293
1293
  E && E.revision > i.interactions.preferencePrompts[I].revision && d(I, E.requestId);
1294
1294
  }
1295
- m.kind === "preferences" && (i = { ...i, account: qh(i.account, m.value) }), m.kind === "preferencePrompts" && (i = { ...i, interactions: dl(i.interactions, m.value) }), m.kind === "preferencePrompt" && (i = { ...i, interactions: dl(i.interactions, { ...i.interactions.preferencePrompts, [m.feature]: m.value }) }), m.kind === "decisions" && (i = { ...i, interactions: cr(i.interactions, m.decisions) }), m.kind === "decision" && (i = { ...i, interactions: cr(i.interactions, [m.value]) });
1295
+ m.kind === "preferences" && (i = { ...i, account: qh(i.account, m.value) }), m.kind === "preferencePrompts" && (i = { ...i, interactions: dl(i.interactions, m.value) }), m.kind === "preferencePrompt" && (i = { ...i, interactions: dl(i.interactions, { ...i.interactions.preferencePrompts, [m.feature]: m.value }) }), m.kind === "decisions" && (i = { ...i, interactions: lr(i.interactions, m.decisions) }), m.kind === "decision" && (i = { ...i, interactions: lr(i.interactions, [m.value]) });
1296
1296
  }, f = (m, w) => {
1297
1297
  const I = i.interactions.deviceFacts[m];
1298
1298
  if (!(w.revision <= I.revision) && ((Ns(i, m) === !0 || i.features.desiredPreferences[m] === !0) && (w.permission === "granted" && I.permission !== "granted" || w.snoozedUntil && w.snoozedUntil !== I.snoozedUntil) && d(m, null), a({ deviceFacts: { ...i.interactions.deviceFacts, [m]: w } }), i.features.desiredPreferences[m] === !0 && Ns(i, m) !== !0)) {
@@ -1436,7 +1436,7 @@ function oa(t, e, n) {
1436
1436
  }
1437
1437
  break;
1438
1438
  case "stage7.observe_work":
1439
- i = rr(i, n.conversation, n.directory, e.now);
1439
+ i = ar(i, n.conversation, n.directory, e.now);
1440
1440
  break;
1441
1441
  case "stage7.bridge_ready":
1442
1442
  a({ bridgeReady: e.ready, bridgeError: e.ready ? null : e.error ?? null });
@@ -1451,7 +1451,7 @@ function oa(t, e, n) {
1451
1451
  const m = n.directory.clients[e.clientScopeId];
1452
1452
  if (!m) break;
1453
1453
  const w = { ...i.interactions.openings };
1454
- e.open || delete w[m], a({ openings: w, closedScopes: { ...i.interactions.closedScopes, [m]: !e.open } }), i = rr(i, n.conversation, n.directory, e.now);
1454
+ e.open || delete w[m], a({ openings: w, closedScopes: { ...i.interactions.closedScopes, [m]: !e.open } }), i = ar(i, n.conversation, n.directory, e.now);
1455
1455
  break;
1456
1456
  }
1457
1457
  case "stage7.prompt_shown": {
@@ -1486,7 +1486,7 @@ function oa(t, e, n) {
1486
1486
  break;
1487
1487
  case "stage7.import_legacy_decisions":
1488
1488
  if (!r.profile.startsWith("extension_") || e.decisions.some((m) => m.revision !== 0)) throw new Error("Invalid legacy decision import.");
1489
- i = { ...i, interactions: cr(i.interactions, e.decisions) };
1489
+ i = { ...i, interactions: lr(i.interactions, e.decisions) };
1490
1490
  break;
1491
1491
  case "stage7.device_hints": {
1492
1492
  if (r.profile !== "main_web_chat") throw new Error("Main-web hints unavailable.");
@@ -1549,7 +1549,7 @@ function oa(t, e, n) {
1549
1549
  if (e.effectKind === "stage7.wait") {
1550
1550
  if (e.effectId !== i.features.timerId) break;
1551
1551
  if (o({ timerId: null, timerDeadline: null, schedulerError: e.type === "effect.failed" ? e.error : null }), e.type === "effect.completed") {
1552
- o({ now: e.output.now }), i = rr(i, n.conversation, n.directory, e.output.now);
1552
+ o({ now: e.output.now }), i = ar(i, n.conversation, n.directory, e.output.now);
1553
1553
  for (const [I, E] of Object.entries(i.features.polls)) {
1554
1554
  if (E.deadline > e.output.now) continue;
1555
1555
  Object.values(i.features.pending).some((k) => k.mode === "query" && k.key === I && k.status === "pending") || y(E.query.kind === "originContext" ? { ...E.query, trigger: "poll" } : E.query, `poll:${I}:${e.output.now}`, !0);
@@ -1597,7 +1597,7 @@ function oa(t, e, n) {
1597
1597
  o({ queries: { ...i.features.queries, [m.key]: Ss(E, { key: m.key, requestId: Ct(m.requestId), error: e.error }) } }), m.operation.kind === "account" && (i = { ...i, account: { ...i.account, query: Ss(i.account.query, { key: m.key, requestId: Ct(m.requestId), error: e.error }) } });
1598
1598
  else {
1599
1599
  if (e.output.data.kind !== m.operation.kind) throw new Error("Feature response kind does not match the query.");
1600
- o({ now: e.output.completedAt, queries: { ...i.features.queries, [m.key]: ar(E, { key: m.key, requestId: Ct(m.requestId), data: e.output.data, cursor: null, updatedAt: e.output.completedAt }) } }), p(e.output.data, m.requestId), e.output.data.kind === "account" && (i = { ...i, account: { ...i.account, refusal: null, query: ar(i.account.query, { key: m.key, requestId: Ct(m.requestId), data: e.output.data.value, cursor: null, updatedAt: e.output.completedAt }) } });
1600
+ o({ now: e.output.completedAt, queries: { ...i.features.queries, [m.key]: cr(E, { key: m.key, requestId: Ct(m.requestId), data: e.output.data, cursor: null, updatedAt: e.output.completedAt }) } }), p(e.output.data, m.requestId), e.output.data.kind === "account" && (i = { ...i, account: { ...i.account, refusal: null, query: cr(i.account.query, { key: m.key, requestId: Ct(m.requestId), data: e.output.data.value, cursor: null, updatedAt: e.output.completedAt }) } });
1601
1601
  }
1602
1602
  } else if (!w)
1603
1603
  o({ now: e.output.completedAt }), p(e.output.data, m.requestId);
@@ -1622,7 +1622,7 @@ function oa(t, e, n) {
1622
1622
  }
1623
1623
  if (_(e.effectId, w), m.operation.kind === "generatePrompts") {
1624
1624
  const I = { kind: "starterPrompts", ...m.operation.page, includeUserSuggestions: m.operation.includeUserSuggestions ?? !1 }, E = yt(r, I), T = i.features.queries[E];
1625
- T?.requestId === m.requestId && o({ queries: { ...i.features.queries, [E]: w ? Ss(T, { key: E, requestId: Ct(m.requestId), error: e.error }) : ar(T, { key: E, requestId: Ct(m.requestId), data: e.output.data, cursor: null, updatedAt: e.output.completedAt }) } });
1625
+ T?.requestId === m.requestId && o({ queries: { ...i.features.queries, [E]: w ? Ss(T, { key: E, requestId: Ct(m.requestId), error: e.error }) : cr(T, { key: E, requestId: Ct(m.requestId), data: e.output.data, cursor: null, updatedAt: e.output.completedAt }) } });
1626
1626
  }
1627
1627
  if (!w && e.output.data.kind === "originContext") {
1628
1628
  const I = e.output.data, E = m.operation.kind === "originContext" || m.operation.kind === "refreshContext" ? m.operation.origin : null;
@@ -1719,11 +1719,11 @@ function oa(t, e, n) {
1719
1719
  }
1720
1720
  return { state: i, effects: s };
1721
1721
  }
1722
- function Xs(t, e) {
1722
+ function Zs(t, e) {
1723
1723
  return t.account.authority ? t.features.queries[yt(t.account.authority, e)] ?? null : null;
1724
1724
  }
1725
1725
  function Oh(t, e) {
1726
- const n = Xs(t, e);
1726
+ const n = Zs(t, e);
1727
1727
  return n?.status === "loading" || n?.status === "refreshing" || !!(t.account.authority && t.features.polls[yt(t.account.authority, e)]);
1728
1728
  }
1729
1729
  const Dh = {
@@ -1843,14 +1843,14 @@ function oi(t) {
1843
1843
  if (typeof t != "boolean") throw new Error("Invalid feature response boolean.");
1844
1844
  return t;
1845
1845
  }
1846
- function lr(t) {
1846
+ function dr(t) {
1847
1847
  return t === null ? null : oi(t);
1848
1848
  }
1849
1849
  function Us(t) {
1850
1850
  if (!Array.isArray(t)) throw new Error("Invalid feature string list.");
1851
1851
  return t.map(ae);
1852
1852
  }
1853
- function Zs(t) {
1853
+ function eo(t) {
1854
1854
  const e = Tt(t);
1855
1855
  if (e !== null && !Number.isFinite(Date.parse(e))) throw new Error("Invalid feature deadline.");
1856
1856
  return e;
@@ -1858,31 +1858,31 @@ function Zs(t) {
1858
1858
  function Oi(t) {
1859
1859
  const e = me(t);
1860
1860
  return {
1861
- taskNotificationsEnabled: lr(e.taskNotificationsEnabled),
1862
- tabGroupingEnabled: lr(e.tabGroupingEnabled),
1861
+ taskNotificationsEnabled: dr(e.taskNotificationsEnabled),
1862
+ tabGroupingEnabled: dr(e.tabGroupingEnabled),
1863
1863
  preferencesVersion: Wn(e.preferencesVersion),
1864
- scribbleStyleEnabled: lr(e.scribbleStyleEnabled),
1864
+ scribbleStyleEnabled: dr(e.scribbleStyleEnabled),
1865
1865
  blockedOrigins: Us(e.blockedServiceOrigins),
1866
1866
  personalInstructions: Tt(e.personalInstructions),
1867
1867
  securityPolicyVersion: Wn(e.securityPolicyVersion)
1868
1868
  };
1869
1869
  }
1870
- function eo(t) {
1870
+ function to(t) {
1871
1871
  const e = me(t);
1872
- return { eligibleSince: Zs(e.eligibleSince), revision: Wn(e.revision), requestId: Tt(e.requestId), snoozedUntil: Zs(e.snoozedUntil) };
1872
+ return { eligibleSince: eo(e.eligibleSince), revision: Wn(e.revision), requestId: Tt(e.requestId), snoozedUntil: eo(e.snoozedUntil) };
1873
1873
  }
1874
1874
  function Nh(t) {
1875
1875
  const e = me(t);
1876
- return { notifications: eo(e.notifications), tab_grouping: eo(e.tabGrouping) };
1876
+ return { notifications: to(e.notifications), tab_grouping: to(e.tabGrouping) };
1877
1877
  }
1878
1878
  function hl(t) {
1879
1879
  const e = me(t), n = me(e.request), i = ae(n.category), s = ae(n.action), o = { category: i, action: s, promptKey: ae(n.promptKey), expectedRevision: Wn(n.expectedRevision) };
1880
1880
  La(o);
1881
1881
  const a = ae(e.outcome);
1882
1882
  if (!["resolved", "snoozed", "suppressed"].includes(a)) throw new Error("Invalid decision outcome.");
1883
- const r = Zs(e.decidedAt);
1883
+ const r = eo(e.decidedAt);
1884
1884
  if (r === null) throw new Error("Missing decision acceptance time.");
1885
- const c = Zs(e.nextEligibleAt);
1885
+ const c = eo(e.nextEligibleAt);
1886
1886
  if (a === "snoozed" && c === null) throw new Error("Missing decision deadline.");
1887
1887
  return {
1888
1888
  decisionKey: ae(e.decisionKey),
@@ -1893,7 +1893,7 @@ function hl(t) {
1893
1893
  nextEligibleAt: c
1894
1894
  };
1895
1895
  }
1896
- function dr(t) {
1896
+ function ur(t) {
1897
1897
  const e = me(t);
1898
1898
  return {
1899
1899
  eventTypeRegex: ae(e.eventTypeRegex),
@@ -1906,14 +1906,14 @@ function dr(t) {
1906
1906
  function Uh(t) {
1907
1907
  const e = me(t), n = me(e.condition), i = { id: ae(e.id), suggestedQuery: ae(e.suggestedQuery) };
1908
1908
  if (n.template === "page_visit") return { ...i, condition: { template: n.template, urlRegex: ae(n.urlRegex) } };
1909
- if (n.template === "semantic_interaction") return { ...i, condition: { template: n.template, event: dr(n.event) } };
1909
+ if (n.template === "semantic_interaction") return { ...i, condition: { template: n.template, event: ur(n.event) } };
1910
1910
  if (n.template === "event_sequence") {
1911
1911
  if (!Array.isArray(n.steps)) throw new Error("Invalid proactive sequence.");
1912
- return { ...i, condition: { template: n.template, steps: n.steps.map(dr), withinSeconds: Wn(n.withinSeconds) } };
1912
+ return { ...i, condition: { template: n.template, steps: n.steps.map(ur), withinSeconds: Wn(n.withinSeconds) } };
1913
1913
  }
1914
1914
  if (n.template === "page_state_after_event") {
1915
1915
  const s = me(n.state);
1916
- return { ...i, condition: { template: n.template, event: dr(n.event), withinSeconds: Wn(n.withinSeconds), state: {
1916
+ return { ...i, condition: { template: n.template, event: ur(n.event), withinSeconds: Wn(n.withinSeconds), state: {
1917
1917
  urlRegex: ae(s.urlRegex),
1918
1918
  ...s.textRegex == null ? {} : { textRegex: ae(s.textRegex) },
1919
1919
  ...s.roleRegex == null ? {} : { roleRegex: ae(s.roleRegex) },
@@ -1949,7 +1949,7 @@ function xs(t) {
1949
1949
  if (!oi(e.success)) throw new Error(Tt(e.message) ?? "Failed to submit feedback");
1950
1950
  return { kind: "ack", success: !0 };
1951
1951
  }
1952
- function ur(t) {
1952
+ function pr(t) {
1953
1953
  const e = t.page;
1954
1954
  return {
1955
1955
  community_id: t.communityId,
@@ -2055,20 +2055,20 @@ function zh(t) {
2055
2055
  c = { kind: "preferences", value: Oi(await r("/preferences", { blocked_service_origins: s.origins, security_policy_version: s.expectedSecurityVersion }, "PATCH")) };
2056
2056
  break;
2057
2057
  case "preferenceAcknowledge":
2058
- c = { kind: "preferencePrompt", feature: s.feature, value: eo(await r(`/preference-prompts/${s.feature}/acknowledge`, { request_id: o, expected_revision: s.expectedRevision, action: s.action })) };
2058
+ c = { kind: "preferencePrompt", feature: s.feature, value: to(await r(`/preference-prompts/${s.feature}/acknowledge`, { request_id: o, expected_revision: s.expectedRevision, action: s.action })) };
2059
2059
  break;
2060
2060
  case "preferenceSnooze":
2061
- c = { kind: "preferencePrompt", feature: s.feature, value: eo(await r(`/preference-prompts/${s.feature}/snooze`, { request_id: o, expected_revision: s.expectedRevision })) };
2061
+ c = { kind: "preferencePrompt", feature: s.feature, value: to(await r(`/preference-prompts/${s.feature}/snooze`, { request_id: o, expected_revision: s.expectedRevision })) };
2062
2062
  break;
2063
2063
  case "decision":
2064
2064
  c = { kind: "decision", value: hl(await r("/interaction-decisions", { category: s.category, prompt_key: s.promptKey, action: s.action, request_id: o, expected_revision: s.expectedRevision })) };
2065
2065
  break;
2066
2066
  case "feedback":
2067
- c = xs(a ? { success: await t.embedded.feedback(s.message) } : await r("/feedback", { ...ur(s.context), feedback_type: "general", message: s.message }));
2067
+ c = xs(a ? { success: await t.embedded.feedback(s.message) } : await r("/feedback", { ...pr(s.context), feedback_type: "general", message: s.message }));
2068
2068
  break;
2069
2069
  case "proactiveFeedback":
2070
2070
  c = xs(await r("/feedback", {
2071
- ...ur(s.context),
2071
+ ...pr(s.context),
2072
2072
  feedback_type: "proactive_suggestion",
2073
2073
  proactive_suggestion_action: "feedback",
2074
2074
  proactive_suggestion_id: s.suggestionId,
@@ -2081,7 +2081,7 @@ function zh(t) {
2081
2081
  c = xs(await r("/feedback/target", { feedback_type: "target_rating", target_id: s.targetId, rating: s.rating, ...s.comment === void 0 ? {} : { comment: s.comment } }));
2082
2082
  break;
2083
2083
  case "report":
2084
- c = xs(await r("/feedback", { ...ur(s.context), feedback_type: "chat_report", session_id: s.sessionId, message: s.message, ui_evidence: s.uiEvidence, widget_evidence_available: s.widgetEvidenceAvailable }));
2084
+ c = xs(await r("/feedback", { ...pr(s.context), feedback_type: "chat_report", session_id: s.sessionId, message: s.message, ui_evidence: s.uiEvidence, widget_evidence_available: s.widgetEvidenceAvailable }));
2085
2085
  break;
2086
2086
  case "generatePrompts": {
2087
2087
  const l = me(await r("/starter-prompts", { page_url: s.page.pageUrl, html_content: s.htmlContent, page_title: s.pageTitle }, "POST", a ? {} : { origin: s.page.origin, include_user_suggestions: s.includeUserSuggestions ?? !1 }));
@@ -2157,7 +2157,7 @@ function jh(t, e) {
2157
2157
  async function Fh(t, e, n) {
2158
2158
  await t.engine.dispatch({ type: "stage7.initialize", authority: e, now: n }), await t.engine.dispatch({ type: "stage7.reconcile", authority: e, now: n, requestId: crypto.randomUUID(), reason: "startup" });
2159
2159
  }
2160
- function pr(t, e, n = {}) {
2160
+ function hr(t, e, n = {}) {
2161
2161
  return Xd(t, { type: "stage7.query", query: e, force: n.force });
2162
2162
  }
2163
2163
  function $h(t, e, n) {
@@ -2186,7 +2186,7 @@ function Xd(t, e, n) {
2186
2186
  }
2187
2187
  const g = Object.values(y.features.pending).find((b) => b.requestId === o);
2188
2188
  if (!g && e.type === "stage7.query") {
2189
- const b = Xs(y, e.query);
2189
+ const b = Zs(y, e.query);
2190
2190
  b?.status === "error" ? p(b.error) : b?.status === "ready" && b.data && p(null, b.data);
2191
2191
  }
2192
2192
  g?.status === "error" ? p(g.error) : g?.status === "done" && p(null, g.result);
@@ -2296,22 +2296,22 @@ function Vh(t, e = null) {
2296
2296
  return { ...i, ...r ? { auth: r } : {}, submissionGate: a, usingPaidCreditFallback: e ? t.paidFallbackBySession[e] ?? !1 : !1 };
2297
2297
  }
2298
2298
  const Zd = (t) => t.selectedModel ?? t.historyModel ?? t.defaultModel, Gh = (t, e) => t.scopes[e];
2299
- function ho(t) {
2299
+ function go(t) {
2300
2300
  if (!Number.isSafeInteger(t) || t < 0) throw new Error("Invalid conversation revision.");
2301
2301
  }
2302
- function ra(t, e) {
2302
+ function aa(t, e) {
2303
2303
  if (e.conversation_id !== t.sessionId) throw new Error("Display item belongs to another conversation.");
2304
2304
  if (t.removedItems[e.id]) return t;
2305
2305
  const n = Gt(e.created_at);
2306
2306
  Gt(e.updated_at);
2307
- const i = Ys(e);
2308
- i !== null && ho(i);
2307
+ const i = Xs(e);
2308
+ i !== null && go(i);
2309
2309
  const s = t.streams[e.id];
2310
2310
  if (i !== null && s && (s.state === "stopped" || s.state === "finished") && i > s.revision) return t;
2311
2311
  const o = t.items[e.id];
2312
2312
  if (o) {
2313
2313
  if (Gt(o.created_at) !== n) throw new Error("Display shell timestamp changed.");
2314
- const a = Ys(o);
2314
+ const a = Xs(o);
2315
2315
  if (a !== null && i !== null) {
2316
2316
  if (i <= a) return t;
2317
2317
  } else if (Gt(e.updated_at) <= Gt(o.updated_at)) return t;
@@ -2319,13 +2319,13 @@ function ra(t, e) {
2319
2319
  return { ...t, items: { ...t.items, [e.id]: { ...e, created_at: o?.created_at ?? e.created_at } } };
2320
2320
  }
2321
2321
  function eu(t, e) {
2322
- if (ho(e.revision), t.removedItems[e.item_id]) return t;
2322
+ if (go(e.revision), t.removedItems[e.item_id]) return t;
2323
2323
  const n = t.streams[e.item_id];
2324
2324
  return n && (n.state === "stopped" || e.revision < n.revision || n.state !== "open" && (e.state === "open" || e.revision === n.revision) || n.state === e.state && n.revision === e.revision) ? t : { ...t, streams: { ...t.streams, [e.item_id]: e } };
2325
2325
  }
2326
- function aa(t, e) {
2326
+ function ca(t, e) {
2327
2327
  if (e.conversation_id !== t.sessionId) throw new Error("Execution belongs to another conversation.");
2328
- if (ho(e.version), t.execution && e.version <= t.execution.version) return t;
2328
+ if (go(e.version), t.execution && e.version <= t.execution.version) return t;
2329
2329
  const n = { ...t.executionByUserMessage };
2330
2330
  for (const i of Pt(e)) n[i] = {
2331
2331
  version: e.version,
@@ -2337,23 +2337,23 @@ function aa(t, e) {
2337
2337
  function Jh(t) {
2338
2338
  const e = /* @__PURE__ */ new Set();
2339
2339
  for (const n of Object.values(t.items)) {
2340
- const i = Ys(n), s = t.streams[n.id];
2340
+ const i = Xs(n), s = t.streams[n.id];
2341
2341
  i !== null && (!s || s.state === "open" || i < s.revision) && e.add(n.id);
2342
2342
  }
2343
2343
  for (const n of [...Object.keys(t.streams), ...Object.values(t.removedItems)])
2344
2344
  !t.items[n] && !t.removedItems[n] && e.add(n);
2345
2345
  return [...e];
2346
2346
  }
2347
- function hr(t, e) {
2347
+ function gr(t, e) {
2348
2348
  switch (e.type) {
2349
2349
  case "conversation.interaction.updated":
2350
2350
  return t;
2351
2351
  case "conversation.follow_ups.updated":
2352
- return ho(e.version), e.version > t.followUpsVersion ? { ...t, followUps: e.follow_ups, followUpsVersion: e.version } : t;
2352
+ return go(e.version), e.version > t.followUpsVersion ? { ...t, followUps: e.follow_ups, followUpsVersion: e.version } : t;
2353
2353
  case "conversation.item.updated":
2354
- return ra(t, e.item);
2354
+ return aa(t, e.item);
2355
2355
  case "conversation.execution.updated":
2356
- return aa(t, e.execution);
2356
+ return ca(t, e.execution);
2357
2357
  case "conversation.item.stream_finished":
2358
2358
  if (e.conversation_id !== t.sessionId) throw new Error("Stream belongs to another conversation.");
2359
2359
  return eu(t, { item_id: e.item_id, revision: e.revision, state: e.state });
@@ -2367,20 +2367,20 @@ function hr(t, e) {
2367
2367
  }
2368
2368
  }
2369
2369
  }
2370
- function ca(t, e, n) {
2370
+ function la(t, e, n) {
2371
2371
  const i = { ...t.submissions };
2372
2372
  for (const s of Object.values(i))
2373
2373
  if (s.conversationScopeId === e.conversationScopeId && !((s.cancelled || e.cancelled) && s.userMessageId !== e.userMessageId)) {
2374
2374
  if (s.sessionId !== null && s.sessionId !== n) throw new Error("Submission scope accepted into conflicting conversations.");
2375
2375
  i[s.userMessageId] = { ...s, sessionId: n };
2376
2376
  }
2377
- return { ...t, submissions: i, sessions: { ...t.sessions, [n]: t.sessions[n] ?? ta(n) } };
2377
+ return { ...t, submissions: i, sessions: { ...t.sessions, [n]: t.sessions[n] ?? na(n) } };
2378
2378
  }
2379
- function la(t, e) {
2379
+ function da(t, e) {
2380
2380
  const n = e.clients[t.clientScopeId];
2381
2381
  return n === t.conversationScopeId || n === void 0 && t.sessionId !== null && (e.memberships[t.sessionId]?.members.length ?? 0) > 0;
2382
2382
  }
2383
- function da(t, e, n = !1) {
2383
+ function ua(t, e, n = !1) {
2384
2384
  if (t.authorityId !== (e.authorityId ?? "") || t.generation !== e.generation) {
2385
2385
  const o = Kd(e.authorityId ?? void 0, e.generation);
2386
2386
  if (!n || t.authorityId) return o;
@@ -2397,9 +2397,9 @@ function da(t, e, n = !1) {
2397
2397
  let s = Object.keys(i).length === Object.keys(t.pendingRestoration).length ? t : { ...t, pendingRestoration: i };
2398
2398
  for (const o of Object.values(t.submissions)) {
2399
2399
  if (s.pendingRestoration[o.clientScopeId] === o.conversationScopeId) continue;
2400
- o.delivery !== "accepted" && !o.cancelled && !la(o, e) && (s = { ...s, submissions: { ...s.submissions, [o.userMessageId]: { ...o, cancelled: !0, cancellationReason: o.cancellationReason ?? "owner_lost" } } });
2400
+ o.delivery !== "accepted" && !o.cancelled && !da(o, e) && (s = { ...s, submissions: { ...s.submissions, [o.userMessageId]: { ...o, cancelled: !0, cancellationReason: o.cancellationReason ?? "owner_lost" } } });
2401
2401
  const a = e.selections[o.conversationScopeId]?.sessionId;
2402
- a && !s.submissions[o.userMessageId].cancelled && o.sessionId === null && (s = ca(s, s.submissions[o.userMessageId], a));
2402
+ a && !s.submissions[o.userMessageId].cancelled && o.sessionId === null && (s = la(s, s.submissions[o.userMessageId], a));
2403
2403
  }
2404
2404
  for (const [o, a] of Object.entries(s.requests)) {
2405
2405
  if ((e.memberships[a.sessionId]?.members.length ?? 0) > 0) continue;
@@ -2440,8 +2440,8 @@ function Qh(t, e, n, i) {
2440
2440
  let f = t.submissions;
2441
2441
  if (e.type === "effect.completed" && e.output.snapshot.conversation_id !== r.sessionId) throw new Error("Snapshot belongs to another conversation.");
2442
2442
  if (e.type === "effect.completed" && !e.output.snapshot.projection_ready && (e.output.snapshot.preparation === "pending" || e.output.snapshot.preparation === "busy")) {
2443
- for (const y of e.output.snapshot.items) y.type === "user_message" && (c = ra(c, y));
2444
- c = aa(c, e.output.snapshot.execution), c = {
2443
+ for (const y of e.output.snapshot.items) y.type === "user_message" && (c = aa(c, y));
2444
+ c = ca(c, e.output.snapshot.execution), c = {
2445
2445
  ...c,
2446
2446
  ...r.lane === "current" ? { preparation: e.output.snapshot.preparation } : {},
2447
2447
  queries: { ...c.queries, [r.lane]: { ...l, status: "loading", requestId: null, error: null } }
@@ -2458,10 +2458,10 @@ function Qh(t, e, n, i) {
2458
2458
  r.lane === "current" && (c = { ...c, preparation: null });
2459
2459
  const g = c.queries.history, b = r.lane === "current" && (g.status === "not_requested" || y.next_cursor !== null && !c.items[y.next_cursor]);
2460
2460
  if (y.conversation_id !== r.sessionId) throw new Error("Snapshot belongs to another conversation.");
2461
- for (const _ of y.removed_items) c = hr(c, _);
2462
- for (const _ of y.items) c = ra(c, _);
2461
+ for (const _ of y.removed_items) c = gr(c, _);
2462
+ for (const _ of y.items) c = aa(c, _);
2463
2463
  for (const _ of y.streams) c = eu(c, _);
2464
- if (c = aa(c, y.execution), c = hr(c, {
2464
+ if (c = ca(c, y.execution), c = gr(c, {
2465
2465
  type: "conversation.follow_ups.updated",
2466
2466
  conversation_id: y.conversation_id,
2467
2467
  version: y.follow_ups_version,
@@ -2543,7 +2543,7 @@ function Qh(t, e, n, i) {
2543
2543
  case "conversation.submission_accepted": {
2544
2544
  const r = t.submissions[e.userMessageId];
2545
2545
  if (!r) return { state: t, effects: o };
2546
- s = ca(t, r, e.sessionId), s = { ...s, submissions: { ...s.submissions, [e.userMessageId]: { ...s.submissions[e.userMessageId], delivery: "accepted", error: null } } };
2546
+ s = la(t, r, e.sessionId), s = { ...s, submissions: { ...s.submissions, [e.userMessageId]: { ...s.submissions[e.userMessageId], delivery: "accepted", error: null } } };
2547
2547
  break;
2548
2548
  }
2549
2549
  case "conversation.submission_delivery": {
@@ -2569,14 +2569,14 @@ function Qh(t, e, n, i) {
2569
2569
  }
2570
2570
  case "conversation.display_received": {
2571
2571
  const r = lt(e.event), c = r.type === "conversation.item.updated" ? r.item.conversation_id : r.type === "conversation.execution.updated" ? r.execution.conversation_id : r.type === "conversation.interaction.updated" ? r.interaction.conversation_id : r.conversation_id, l = r.type === "conversation.item.updated" && r.item.type === "user_message" ? t.submissions[r.item.id] : void 0;
2572
- if (l && (s = ca(t, l, c)), !s.sessions[c] && !n.memberships[c]?.members.length && !l) return { state: t, effects: o };
2572
+ if (l && (s = la(t, l, c)), !s.sessions[c] && !n.memberships[c]?.members.length && !l) return { state: t, effects: o };
2573
2573
  n.memberships[c]?.members.length && (r.type === "conversation.interaction.updated" || r.type === "conversation.execution.updated" || r.type === "conversation.item.updated" && r.item.type === "user_message") && (a = {
2574
2574
  authorityId: t.authorityId,
2575
2575
  generation: t.generation,
2576
2576
  sessionId: c,
2577
2577
  sources: r.type === "conversation.interaction.updated" ? [r.interaction] : []
2578
2578
  });
2579
- const u = s.sessions[c] ?? ta(c), d = hr(u, r);
2579
+ const u = s.sessions[c] ?? na(c), d = gr(u, r);
2580
2580
  d !== u && (s = { ...s, sessions: { ...s.sessions, [c]: d } });
2581
2581
  break;
2582
2582
  }
@@ -2595,7 +2595,7 @@ function Qh(t, e, n, i) {
2595
2595
  }
2596
2596
  case "conversation.snapshot": {
2597
2597
  if (!n.memberships[e.sessionId]?.members.length) return { state: t, effects: o };
2598
- const r = t.sessions[e.sessionId] ?? ta(e.sessionId), c = r.queries[e.lane];
2598
+ const r = t.sessions[e.sessionId] ?? na(e.sessionId), c = r.queries[e.lane];
2599
2599
  if (c.requestId !== null) return { state: t, effects: o };
2600
2600
  const l = {
2601
2601
  authorityId: e.authorityId,
@@ -2682,7 +2682,7 @@ function mn(t, e) {
2682
2682
  const n = t.submissions[e], i = t.deliveries[e];
2683
2683
  return !n.cancelled || i?.step === "send" || i?.step === "receipt";
2684
2684
  }
2685
- function ua(t, e, n, i = !1) {
2685
+ function pa(t, e, n, i = !1) {
2686
2686
  if (!e.effectsEnabled || !i && t.submissions === e.submissions && t.deliveries === e.deliveries && t.operations === e.operations && t.stops === e.stops && t.sessions === e.sessions) return { state: e, effects: [] };
2687
2687
  const s = e.requestSequence + 1, o = `conversation:${e.generation}:${s}`, a = Ve({ ...e, requestSequence: s, checkpointEffectId: o });
2688
2688
  return { state: a, effects: [{ id: o, kind: "conversation.checkpoint", input: {
@@ -2691,7 +2691,7 @@ function ua(t, e, n, i = !1) {
2691
2691
  checkpoint: Na(a, n)
2692
2692
  } }] };
2693
2693
  }
2694
- function pa(t, e = null) {
2694
+ function ha(t, e = null) {
2695
2695
  return { command: lt(t), conversationScopeId: e, phase: "waiting", effectId: null, result: null, error: null };
2696
2696
  }
2697
2697
  function Yh(t) {
@@ -2703,7 +2703,7 @@ function fl(t, e) {
2703
2703
  throw new Error("Conversation acceptance receipt does not match the submitted message.");
2704
2704
  return { sessionId: t.sessionId, clientMessageId: e };
2705
2705
  }
2706
- function ha(t) {
2706
+ function ga(t) {
2707
2707
  let e = t;
2708
2708
  const n = [];
2709
2709
  if (!t.effectsEnabled || !t.authorityId) return { state: t, effects: n };
@@ -2767,7 +2767,7 @@ function ha(t) {
2767
2767
  const a = (r, c, l, u = "user_requested") => {
2768
2768
  if (e.operations[r]) return;
2769
2769
  const d = s();
2770
- e = { ...e, operations: { ...e.operations, [r]: pa({
2770
+ e = { ...e, operations: { ...e.operations, [r]: ha({
2771
2771
  request_id: d,
2772
2772
  type: "run.stop",
2773
2773
  payload: { sessionId: c, expectedUserMessageId: l, reason: u }
@@ -2893,7 +2893,7 @@ function Xh(t, e, n, i) {
2893
2893
  const y = e.output;
2894
2894
  y?.sessionId && (s = { ...s, operations: {
2895
2895
  ...s.operations,
2896
- [`cleanup:${p}`]: pa({
2896
+ [`cleanup:${p}`]: ha({
2897
2897
  request_id: `cleanup:${f.command.request_id}`,
2898
2898
  type: "session.reset",
2899
2899
  payload: {
@@ -2933,8 +2933,8 @@ function Xh(t, e, n, i) {
2933
2933
  submissions: Object.fromEntries(Object.entries(y.submissions).map(([m, w]) => [m, {
2934
2934
  ...w,
2935
2935
  executionVersion: null,
2936
- cancelled: w.cancelled || !x(w) && !la(w, n),
2937
- ...!w.cancelled && !x(w) && !la(w, n) ? { cancellationReason: "owner_lost" } : {},
2936
+ cancelled: w.cancelled || !x(w) && !da(w, n),
2937
+ ...!w.cancelled && !x(w) && !da(w, n) ? { cancellationReason: "owner_lost" } : {},
2938
2938
  delivery: (w.contextPreparation === null && !y.deliveries[m]?.handoffRecovery || !y.deliveries[m]) && !w.cancelled && w.delivery !== "accepted" ? "failed" : w.delivery === "sending" ? "uncertain" : w.delivery,
2939
2939
  error: w.contextPreparation === null && !y.deliveries[m]?.handoffRecovery && !w.cancelled && !["unauthorized", "auth_reconnecting"].includes(w.error?.code ?? "") ? { code: "context_preparation_interrupted", message: "Page context preparation was interrupted. Please send this message again.", retryable: !1 } : !y.deliveries[m] && w.delivery !== "accepted" && !w.cancelled ? { code: "submission_interrupted", message: "Message preparation was interrupted. Retry this message.", retryable: !0 } : w.error
2940
2940
  }])),
@@ -2962,7 +2962,7 @@ function Xh(t, e, n, i) {
2962
2962
  }
2963
2963
  if (e.type === "conversation.restoration_resolved") {
2964
2964
  const d = { ...s.pendingRestoration };
2965
- delete d[e.clientScopeId], s = da({ ...s, pendingRestoration: d }, n);
2965
+ delete d[e.clientScopeId], s = ua({ ...s, pendingRestoration: d }, n);
2966
2966
  }
2967
2967
  if (e.type === "conversation.recover" && (s = {
2968
2968
  ...t,
@@ -3026,7 +3026,7 @@ function Xh(t, e, n, i) {
3026
3026
  })) : t.stops;
3027
3027
  s = { ...t, stops: f, effectsEnabled: !0, operations: {
3028
3028
  ...t.operations,
3029
- [d.request_id]: pa(d, e.conversationScopeId ?? null)
3029
+ [d.request_id]: ha(d, e.conversationScopeId ?? null)
3030
3030
  } };
3031
3031
  }
3032
3032
  }
@@ -3077,7 +3077,7 @@ function Xh(t, e, n, i) {
3077
3077
  return p && !p.cancelled && !["accepted", "failed"].includes(p.delivery) && !r.durableSubmissionIds.includes(d);
3078
3078
  });
3079
3079
  c.length !== r.pendingDurabilityIds.length && (r = { ...r, pendingDurabilityIds: c });
3080
- const l = ha(r), u = ua(t, l.state, n, e.type === "conversation.recover" && t.checkpointError !== null);
3080
+ const l = ga(r), u = pa(t, l.state, n, e.type === "conversation.recover" && t.checkpointError !== null);
3081
3081
  return { state: u.state, effects: [...u.effects, ...a.effects, ...l.effects], interactionSources: a.interactionSources };
3082
3082
  }
3083
3083
  const Zh = [
@@ -3378,7 +3378,7 @@ function lg(t, e, n, i, s = {}) {
3378
3378
  requestId: fe(o?.httpRequest?.requestId ?? o?.errorRequestId ?? o?.queryRequestId),
3379
3379
  ...fe(o?.failedClientMessageId) ? { clientMessageId: o.failedClientMessageId } : {},
3380
3380
  code: o ? fe(t.lastErrorCode) : null,
3381
- ...po(o?.errorNormalization) ? { normalization: o.errorNormalization } : {},
3381
+ ...ho(o?.errorNormalization) ? { normalization: o.errorNormalization } : {},
3382
3382
  builds: { sdk: ci.version, ...s }
3383
3383
  };
3384
3384
  }
@@ -3483,7 +3483,7 @@ function gg(t, e) {
3483
3483
  }
3484
3484
  return { schema: 1, authorityId: t.authorityId, operations: t.operations, stops: t.stops, requestSequence: t.requestSequence, submissions: n, submissionOrder: Object.keys(n), deliveries: i };
3485
3485
  }
3486
- function gr(t) {
3486
+ function fr(t) {
3487
3487
  try {
3488
3488
  return window.sessionStorage.getItem(t);
3489
3489
  } catch (e) {
@@ -3570,7 +3570,7 @@ const zs = /* @__PURE__ */ Object.create(null);
3570
3570
  Object.keys(Nt).forEach((t) => {
3571
3571
  zs[Nt[t]] = t;
3572
3572
  });
3573
- const ga = { type: "error", data: "parser error" }, ou = typeof Blob == "function" || typeof Blob < "u" && Object.prototype.toString.call(Blob) === "[object BlobConstructor]", ru = typeof ArrayBuffer == "function", au = (t) => typeof ArrayBuffer.isView == "function" ? ArrayBuffer.isView(t) : t && t.buffer instanceof ArrayBuffer, Ba = ({ type: t, data: e }, n, i) => ou && e instanceof Blob ? n ? i(e) : yl(e, i) : ru && (e instanceof ArrayBuffer || au(e)) ? n ? i(e) : yl(new Blob([e]), i) : i(Nt[t] + (e || "")), yl = (t, e) => {
3573
+ const fa = { type: "error", data: "parser error" }, ou = typeof Blob == "function" || typeof Blob < "u" && Object.prototype.toString.call(Blob) === "[object BlobConstructor]", ru = typeof ArrayBuffer == "function", au = (t) => typeof ArrayBuffer.isView == "function" ? ArrayBuffer.isView(t) : t && t.buffer instanceof ArrayBuffer, Ba = ({ type: t, data: e }, n, i) => ou && e instanceof Blob ? n ? i(e) : yl(e, i) : ru && (e instanceof ArrayBuffer || au(e)) ? n ? i(e) : yl(new Blob([e]), i) : i(Nt[t] + (e || "")), yl = (t, e) => {
3574
3574
  const n = new FileReader();
3575
3575
  return n.onload = function() {
3576
3576
  const i = n.result.split(",")[1];
@@ -3580,14 +3580,14 @@ const ga = { type: "error", data: "parser error" }, ou = typeof Blob == "functio
3580
3580
  function bl(t) {
3581
3581
  return t instanceof Uint8Array ? t : t instanceof ArrayBuffer ? new Uint8Array(t) : new Uint8Array(t.buffer, t.byteOffset, t.byteLength);
3582
3582
  }
3583
- let fr;
3583
+ let mr;
3584
3584
  function mg(t, e) {
3585
3585
  if (ou && t.data instanceof Blob)
3586
3586
  return t.data.arrayBuffer().then(bl).then(e);
3587
3587
  if (ru && (t.data instanceof ArrayBuffer || au(t.data)))
3588
3588
  return e(bl(t.data));
3589
3589
  Ba(t, !1, (n) => {
3590
- fr || (fr = new TextEncoder()), e(fr.encode(n));
3590
+ mr || (mr = new TextEncoder()), e(mr.encode(n));
3591
3591
  });
3592
3592
  }
3593
3593
  const wl = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", Ki = typeof Uint8Array > "u" ? [] : new Uint8Array(256);
@@ -3615,7 +3615,7 @@ const yg = (t) => {
3615
3615
  data: t.substring(1)
3616
3616
  } : {
3617
3617
  type: zs[n]
3618
- } : ga;
3618
+ } : fa;
3619
3619
  }, wg = (t, e) => {
3620
3620
  if (bg) {
3621
3621
  const n = yg(t);
@@ -3661,7 +3661,7 @@ function Ig() {
3661
3661
  }
3662
3662
  });
3663
3663
  }
3664
- let mr;
3664
+ let yr;
3665
3665
  function Cs(t) {
3666
3666
  return t.reduce((e, n) => e + n.length, 0);
3667
3667
  }
@@ -3675,7 +3675,7 @@ function As(t, e) {
3675
3675
  return t.length && i < t[0].length && (t[0] = t[0].slice(i)), n;
3676
3676
  }
3677
3677
  function Sg(t, e) {
3678
- mr || (mr = new TextDecoder());
3678
+ yr || (yr = new TextDecoder());
3679
3679
  const n = [];
3680
3680
  let i = 0, s = -1, o = !1;
3681
3681
  return new TransformStream({
@@ -3696,7 +3696,7 @@ function Sg(t, e) {
3696
3696
  break;
3697
3697
  const c = As(n, 8), l = new DataView(c.buffer, c.byteOffset, c.length), u = l.getUint32(0);
3698
3698
  if (u > Math.pow(2, 21) - 1) {
3699
- r.enqueue(ga);
3699
+ r.enqueue(fa);
3700
3700
  break;
3701
3701
  }
3702
3702
  s = u * Math.pow(2, 32) + l.getUint32(4), i = 3;
@@ -3704,10 +3704,10 @@ function Sg(t, e) {
3704
3704
  if (Cs(n) < s)
3705
3705
  break;
3706
3706
  const c = As(n, s);
3707
- r.enqueue(ja(o ? c : mr.decode(c), e)), i = 0;
3707
+ r.enqueue(ja(o ? c : yr.decode(c), e)), i = 0;
3708
3708
  }
3709
3709
  if (s === 0 || s > t) {
3710
- r.enqueue(ga);
3710
+ r.enqueue(fa);
3711
3711
  break;
3712
3712
  }
3713
3713
  }
@@ -3764,12 +3764,12 @@ Ce.prototype.listeners = function(t) {
3764
3764
  Ce.prototype.hasListeners = function(t) {
3765
3765
  return !!this.listeners(t).length;
3766
3766
  };
3767
- const go = typeof Promise == "function" && typeof Promise.resolve == "function" ? (e) => Promise.resolve().then(e) : (e, n) => n(e, 0), _t = typeof self < "u" ? self : typeof window < "u" ? window : Function("return this")(), xg = "arraybuffer";
3767
+ const fo = typeof Promise == "function" && typeof Promise.resolve == "function" ? (e) => Promise.resolve().then(e) : (e, n) => n(e, 0), _t = typeof self < "u" ? self : typeof window < "u" ? window : Function("return this")(), xg = "arraybuffer";
3768
3768
  function uu(t, ...e) {
3769
3769
  return e.reduce((n, i) => (t.hasOwnProperty(i) && (n[i] = t[i]), n), {});
3770
3770
  }
3771
3771
  const Eg = _t.setTimeout, Cg = _t.clearTimeout;
3772
- function fo(t, e) {
3772
+ function mo(t, e) {
3773
3773
  e.useNativeTimers ? (t.setTimeoutFn = Eg.bind(_t), t.clearTimeoutFn = Cg.bind(_t)) : (t.setTimeoutFn = _t.setTimeout.bind(_t), t.clearTimeoutFn = _t.clearTimeout.bind(_t));
3774
3774
  }
3775
3775
  const Ag = 1.33;
@@ -3812,7 +3812,7 @@ class Fa extends Ce {
3812
3812
  * @protected
3813
3813
  */
3814
3814
  constructor(e) {
3815
- super(), this.writable = !1, fo(this, e), this.opts = e, this.query = e.query, this.socket = e.socket, this.supportsBinary = !e.forceBase64;
3815
+ super(), this.writable = !1, mo(this, e), this.opts = e, this.query = e.query, this.socket = e.socket, this.supportsBinary = !e.forceBase64;
3816
3816
  }
3817
3817
  /**
3818
3818
  * Emits an error.
@@ -4052,7 +4052,7 @@ let ii = class Bs extends Ce {
4052
4052
  * @package
4053
4053
  */
4054
4054
  constructor(e, n, i) {
4055
- super(), this.createRequest = e, fo(this, i), this._opts = i, this._method = i.method || "GET", this._uri = n, this._data = i.data !== void 0 ? i.data : null, this._create();
4055
+ super(), this.createRequest = e, mo(this, i), this._opts = i, this._method = i.method || "GET", this._uri = n, this._data = i.data !== void 0 ? i.data : null, this._create();
4056
4056
  }
4057
4057
  /**
4058
4058
  * Creates the XHR object and sends the request.
@@ -4221,7 +4221,7 @@ class Bg extends Fa {
4221
4221
  this.doWrite(i, o);
4222
4222
  } catch {
4223
4223
  }
4224
- s && go(() => {
4224
+ s && fo(() => {
4225
4225
  this.writable = !0, this.emitReserved("drain");
4226
4226
  }, this.setTimeoutFn);
4227
4227
  });
@@ -4241,10 +4241,10 @@ class Bg extends Fa {
4241
4241
  return this.opts.timestampRequests && (n[this.opts.timestampParam] = pu()), this.supportsBinary || (n.b64 = 1), this.createUri(e, n);
4242
4242
  }
4243
4243
  }
4244
- const yr = _t.WebSocket || _t.MozWebSocket;
4244
+ const br = _t.WebSocket || _t.MozWebSocket;
4245
4245
  class jg extends Bg {
4246
4246
  createSocket(e, n, i) {
4247
- return fu ? new yr(e, n, i) : n ? new yr(e, n) : new yr(e);
4247
+ return fu ? new br(e, n, i) : n ? new br(e, n) : new br(e);
4248
4248
  }
4249
4249
  doWrite(e, n) {
4250
4250
  this.ws.send(n);
@@ -4285,7 +4285,7 @@ class Fg extends Fa {
4285
4285
  for (let n = 0; n < e.length; n++) {
4286
4286
  const i = e[n], s = n === e.length - 1;
4287
4287
  this._writer.write(i).then(() => {
4288
- s && go(() => {
4288
+ s && fo(() => {
4289
4289
  this.writable = !0, this.emitReserved("drain");
4290
4290
  }, this.setTimeoutFn);
4291
4291
  });
@@ -4316,7 +4316,7 @@ const $g = {
4316
4316
  "query",
4317
4317
  "anchor"
4318
4318
  ];
4319
- function fa(t) {
4319
+ function ma(t) {
4320
4320
  if (t.length > 8e3)
4321
4321
  throw "URI too long";
4322
4322
  const e = t, n = t.indexOf("["), i = t.indexOf("]");
@@ -4336,8 +4336,8 @@ function Vg(t, e) {
4336
4336
  s && (n[s] = o);
4337
4337
  }), n;
4338
4338
  }
4339
- const ma = typeof addEventListener == "function" && typeof removeEventListener == "function", js = [];
4340
- ma && addEventListener("offline", () => {
4339
+ const ya = typeof addEventListener == "function" && typeof removeEventListener == "function", js = [];
4340
+ ya && addEventListener("offline", () => {
4341
4341
  js.forEach((t) => t());
4342
4342
  }, !1);
4343
4343
  class yn extends Ce {
@@ -4349,10 +4349,10 @@ class yn extends Ce {
4349
4349
  */
4350
4350
  constructor(e, n) {
4351
4351
  if (super(), this.binaryType = xg, this.writeBuffer = [], this._prevBufferLen = 0, this._pingInterval = -1, this._pingTimeout = -1, this._maxPayload = -1, this._pingTimeoutTime = 1 / 0, e && typeof e == "object" && (n = e, e = null), e) {
4352
- const i = fa(e);
4352
+ const i = ma(e);
4353
4353
  n.hostname = i.host, n.secure = i.protocol === "https" || i.protocol === "wss", n.port = i.port, i.query && (n.query = i.query);
4354
- } else n.host && (n.hostname = fa(n.host).host);
4355
- fo(this, n), this.secure = n.secure != null ? n.secure : typeof location < "u" && location.protocol === "https:", n.hostname && !n.port && (n.port = this.secure ? "443" : "80"), this.hostname = n.hostname || (typeof location < "u" ? location.hostname : "localhost"), this.port = n.port || (typeof location < "u" && location.port ? location.port : this.secure ? "443" : "80"), this.transports = [], this._transportsByName = {}, n.transports.forEach((i) => {
4354
+ } else n.host && (n.hostname = ma(n.host).host);
4355
+ mo(this, n), this.secure = n.secure != null ? n.secure : typeof location < "u" && location.protocol === "https:", n.hostname && !n.port && (n.port = this.secure ? "443" : "80"), this.hostname = n.hostname || (typeof location < "u" ? location.hostname : "localhost"), this.port = n.port || (typeof location < "u" && location.port ? location.port : this.secure ? "443" : "80"), this.transports = [], this._transportsByName = {}, n.transports.forEach((i) => {
4356
4356
  const s = i.prototype.name;
4357
4357
  this.transports.push(s), this._transportsByName[s] = i;
4358
4358
  }), this.opts = Object.assign({
@@ -4369,7 +4369,7 @@ class yn extends Ce {
4369
4369
  },
4370
4370
  transportOptions: {},
4371
4371
  closeOnBeforeunload: !1
4372
- }, n), this.opts.path = this.opts.path.replace(/\/$/, "") + (this.opts.addTrailingSlash ? "/" : ""), typeof this.opts.query == "string" && (this.opts.query = qg(this.opts.query)), ma && (this.opts.closeOnBeforeunload && (this._beforeunloadEventListener = () => {
4372
+ }, n), this.opts.path = this.opts.path.replace(/\/$/, "") + (this.opts.addTrailingSlash ? "/" : ""), typeof this.opts.query == "string" && (this.opts.query = qg(this.opts.query)), ya && (this.opts.closeOnBeforeunload && (this._beforeunloadEventListener = () => {
4373
4373
  this.transport && (this.transport.removeAllListeners(), this.transport.close());
4374
4374
  }, addEventListener("beforeunload", this._beforeunloadEventListener, !1)), this.hostname !== "localhost" && (this._offlineEventListener = () => {
4375
4375
  this._onClose("transport close", {
@@ -4524,7 +4524,7 @@ class yn extends Ce {
4524
4524
  if (!this._pingTimeoutTime)
4525
4525
  return !0;
4526
4526
  const e = Date.now() > this._pingTimeoutTime;
4527
- return e && (this._pingTimeoutTime = 0, go(() => {
4527
+ return e && (this._pingTimeoutTime = 0, fo(() => {
4528
4528
  this._onClose("ping timeout");
4529
4529
  }, this.setTimeoutFn)), e;
4530
4530
  }
@@ -4602,7 +4602,7 @@ class yn extends Ce {
4602
4602
  */
4603
4603
  _onClose(e, n) {
4604
4604
  if (this.readyState === "opening" || this.readyState === "open" || this.readyState === "closing") {
4605
- if (this.clearTimeoutFn(this._pingTimeoutTimer), this.transport.removeAllListeners("close"), this.transport.close(), this.transport.removeAllListeners(), ma && (this._beforeunloadEventListener && removeEventListener("beforeunload", this._beforeunloadEventListener, !1), this._offlineEventListener)) {
4605
+ if (this.clearTimeoutFn(this._pingTimeoutTimer), this.transport.removeAllListeners("close"), this.transport.close(), this.transport.removeAllListeners(), ya && (this._beforeunloadEventListener && removeEventListener("beforeunload", this._beforeunloadEventListener, !1), this._offlineEventListener)) {
4606
4606
  const i = js.indexOf(this._offlineEventListener);
4607
4607
  i !== -1 && js.splice(i, 1);
4608
4608
  }
@@ -4691,7 +4691,7 @@ let Jg = class extends Gg {
4691
4691
  };
4692
4692
  function Qg(t, e = "", n) {
4693
4693
  let i = t;
4694
- n = n || typeof location < "u" && location, t == null && (t = n.protocol + "//" + n.host), typeof t == "string" && (t.charAt(0) === "/" && (t.charAt(1) === "/" ? t = n.protocol + t : t = n.host + t), /^(https?|wss?):\/\//.test(t) || (typeof n < "u" ? t = n.protocol + "//" + t : t = "https://" + t), i = fa(t)), i.port || (/^(http|ws)$/.test(i.protocol) ? i.port = "80" : /^(http|ws)s$/.test(i.protocol) && (i.port = "443")), i.path = i.path || "/";
4694
+ n = n || typeof location < "u" && location, t == null && (t = n.protocol + "//" + n.host), typeof t == "string" && (t.charAt(0) === "/" && (t.charAt(1) === "/" ? t = n.protocol + t : t = n.host + t), /^(https?|wss?):\/\//.test(t) || (typeof n < "u" ? t = n.protocol + "//" + t : t = "https://" + t), i = ma(t)), i.port || (/^(http|ws)$/.test(i.protocol) ? i.port = "80" : /^(http|ws)s$/.test(i.protocol) && (i.port = "443")), i.path = i.path || "/";
4695
4695
  const o = i.host.indexOf(":") !== -1 ? "[" + i.host + "]" : i.host;
4696
4696
  return i.id = i.protocol + "://" + o + ":" + i.port + e, i.href = i.protocol + "://" + o + (n && n.port === i.port ? "" : ":" + i.port), i;
4697
4697
  }
@@ -4743,9 +4743,9 @@ function $s(t, e, n) {
4743
4743
  return t;
4744
4744
  }
4745
4745
  function nf(t, e) {
4746
- return t.data = ya(t.data, e), delete t.attachments, t;
4746
+ return t.data = ba(t.data, e), delete t.attachments, t;
4747
4747
  }
4748
- function ya(t, e) {
4748
+ function ba(t, e) {
4749
4749
  if (!t)
4750
4750
  return t;
4751
4751
  if (t && t._placeholder === !0) {
@@ -4754,10 +4754,10 @@ function ya(t, e) {
4754
4754
  throw new Error("illegal attachments");
4755
4755
  } else if (Array.isArray(t))
4756
4756
  for (let n = 0; n < t.length; n++)
4757
- t[n] = ya(t[n], e);
4757
+ t[n] = ba(t[n], e);
4758
4758
  else if (typeof t == "object")
4759
4759
  for (const n in t)
4760
- Object.prototype.hasOwnProperty.call(t, n) && (t[n] = ya(t[n], e));
4760
+ Object.prototype.hasOwnProperty.call(t, n) && (t[n] = ba(t[n], e));
4761
4761
  return t;
4762
4762
  }
4763
4763
  const sf = [
@@ -5605,10 +5605,10 @@ li.prototype.setMax = function(t) {
5605
5605
  li.prototype.setJitter = function(t) {
5606
5606
  this.jitter = t;
5607
5607
  };
5608
- class ba extends Ce {
5608
+ class wa extends Ce {
5609
5609
  constructor(e, n) {
5610
5610
  var i;
5611
- super(), this.nsps = {}, this.subs = [], e && typeof e == "object" && (n = e, e = void 0), n = n || {}, n.path = n.path || "/socket.io", this.opts = n, fo(this, n), this.reconnection(n.reconnection !== !1), this.reconnectionAttempts(n.reconnectionAttempts || 1 / 0), this.reconnectionDelay(n.reconnectionDelay || 1e3), this.reconnectionDelayMax(n.reconnectionDelayMax || 5e3), this.randomizationFactor((i = n.randomizationFactor) !== null && i !== void 0 ? i : 0.5), this.backoff = new li({
5611
+ super(), this.nsps = {}, this.subs = [], e && typeof e == "object" && (n = e, e = void 0), n = n || {}, n.path = n.path || "/socket.io", this.opts = n, mo(this, n), this.reconnection(n.reconnection !== !1), this.reconnectionAttempts(n.reconnectionAttempts || 1 / 0), this.reconnectionDelay(n.reconnectionDelay || 1e3), this.reconnectionDelayMax(n.reconnectionDelayMax || 5e3), this.randomizationFactor((i = n.randomizationFactor) !== null && i !== void 0 ? i : 0.5), this.backoff = new li({
5612
5612
  min: this.reconnectionDelay(),
5613
5613
  max: this.reconnectionDelayMax(),
5614
5614
  jitter: this.randomizationFactor()
@@ -5726,7 +5726,7 @@ class ba extends Ce {
5726
5726
  * @private
5727
5727
  */
5728
5728
  ondecoded(e) {
5729
- go(() => {
5729
+ fo(() => {
5730
5730
  this.emitReserved("packet", e);
5731
5731
  }, this.setTimeoutFn);
5732
5732
  }
@@ -5848,10 +5848,10 @@ function Hs(t, e) {
5848
5848
  typeof t == "object" && (e = t, t = void 0), e = e || {};
5849
5849
  const n = Qg(t, e.path || "/socket.io"), i = n.source, s = n.id, o = n.path, a = Ni[s] && o in Ni[s].nsps, r = e.forceNew || e["force new connection"] || e.multiplex === !1 || a;
5850
5850
  let c;
5851
- return r ? c = new ba(i, e) : (Ni[s] || (Ni[s] = new ba(i, e)), c = Ni[s]), n.query && !e.query && (e.query = n.queryKey), c.socket(n.path, e);
5851
+ return r ? c = new wa(i, e) : (Ni[s] || (Ni[s] = new wa(i, e)), c = Ni[s]), n.query && !e.query && (e.query = n.queryKey), c.socket(n.path, e);
5852
5852
  }
5853
5853
  Object.assign(Hs, {
5854
- Manager: ba,
5854
+ Manager: wa,
5855
5855
  Socket: yu,
5856
5856
  io: Hs,
5857
5857
  connect: Hs
@@ -6803,7 +6803,7 @@ function If(t, e, n, i) {
6803
6803
  return { ...o, role: "system", dataType: "run_status", content: t.data.message, loading: !1 };
6804
6804
  }
6805
6805
  }
6806
- function br(t, e, n, i) {
6806
+ function wr(t, e, n, i) {
6807
6807
  const s = /* @__PURE__ */ new Map();
6808
6808
  for (const k of t.segments)
6809
6809
  for (const M of [...k.activityIds, ...k.outcomeIds]) s.set(M, k.userMessageId);
@@ -6865,7 +6865,7 @@ function br(t, e, n, i) {
6865
6865
  ...m ? { errorMessageFingerprint: za(Hn(m.message)) } : {},
6866
6866
  ...u && m && m === u.error && !f ? { failedClientMessageId: u.userMessageId } : {},
6867
6867
  ...typeof m?.details?.requestId == "string" ? { errorRequestId: m.details.requestId } : {},
6868
- ...po(m?.details?.errorNormalization) ? { errorNormalization: m.details.errorNormalization } : {},
6868
+ ...ho(m?.details?.errorNormalization) ? { errorNormalization: m.details.errorNormalization } : {},
6869
6869
  ...i ? { owner: i } : {},
6870
6870
  ...wn(m?.details?.httpRequest) ? { httpRequest: m.details.httpRequest } : {},
6871
6871
  queryStatus: e?.status ?? null,
@@ -7138,7 +7138,7 @@ function Wi(t) {
7138
7138
  const e = t.error;
7139
7139
  return t.status === "error" && t.consecutiveFailures < 10 && e !== null && !["unauthorized", "401", "403", "authority_retired"].includes(e.code) && (e.retryable || /^5\d\d$/.test(e.code) || ["runtime_error", "connection_interrupted", "request_timed_out", "408", "429"].includes(e.code));
7140
7140
  }
7141
- const wr = { activeIntervalMs: 3e3, idleIntervalMs: 15e3, maxFailureIntervalMs: 3e4 };
7141
+ const _r = { activeIntervalMs: 3e3, idleIntervalMs: 15e3, maxFailureIntervalMs: 3e4 };
7142
7142
  function ct(t) {
7143
7143
  const e = t.currentAuthority();
7144
7144
  return e.authorityId === t.authority.authorityId && e.generation === t.authority.generation;
@@ -7234,7 +7234,7 @@ class Af {
7234
7234
  if (n) for (const [s, o] of Object.entries(e)) {
7235
7235
  if (!o.observe || this.observations.has(s)) continue;
7236
7236
  const a = this.options.recovery?.(s), r = new Hi({
7237
- ...wr,
7237
+ ..._r,
7238
7238
  isActiveTurn: () => this.options.isActiveTurn(s),
7239
7239
  poll: async () => {
7240
7240
  try {
@@ -7270,8 +7270,8 @@ class Af {
7270
7270
  const a = this.queryRetries.get(o) ?? { timer: null };
7271
7271
  if (a.timer !== null) continue;
7272
7272
  const r = Math.min(
7273
- wr.activeIntervalMs * 2 ** Math.min(s.consecutiveFailures - 1, 4),
7274
- wr.maxFailureIntervalMs
7273
+ _r.activeIntervalMs * 2 ** Math.min(s.consecutiveFailures - 1, 4),
7274
+ _r.maxFailureIntervalMs
7275
7275
  );
7276
7276
  a.timer = setTimeout(() => {
7277
7277
  a.timer = null, !this.queryRequests.has(o) && this.refreshObservedQuery(s.query).catch((c) => this.report(c));
@@ -7898,7 +7898,7 @@ class Ee extends EventTarget {
7898
7898
  }), o;
7899
7899
  }
7900
7900
  }
7901
- const wa = /* @__PURE__ */ new WeakMap(), jn = (t) => t === null || typeof t == "string" && /^[a-zA-Z0-9:_-]{1,160}$/.test(t);
7901
+ const _a = /* @__PURE__ */ new WeakMap(), jn = (t) => t === null || typeof t == "string" && /^[a-zA-Z0-9:_-]{1,160}$/.test(t);
7902
7902
  function Mf(t) {
7903
7903
  if (!t || typeof t != "object") return !1;
7904
7904
  const e = t;
@@ -7906,7 +7906,7 @@ function Mf(t) {
7906
7906
  }
7907
7907
  function Of(t, e, n) {
7908
7908
  if (!Mf(n)) return;
7909
- const i = wa.get(t) ?? /* @__PURE__ */ new Map();
7909
+ const i = _a.get(t) ?? /* @__PURE__ */ new Map();
7910
7910
  i.set(e, {
7911
7911
  observedAt: n.observedAt,
7912
7912
  sessionId: n.sessionId,
@@ -7915,10 +7915,10 @@ function Of(t, e, n) {
7915
7915
  panelVisible: n.panelVisible,
7916
7916
  documentVisible: n.documentVisible,
7917
7917
  loading: n.loading
7918
- }), i.size > 2 && i.delete(i.keys().next().value), wa.set(t, i);
7918
+ }), i.size > 2 && i.delete(i.keys().next().value), _a.set(t, i);
7919
7919
  }
7920
7920
  function Df(t, e, n) {
7921
- const i = wa.get(t)?.get(e);
7921
+ const i = _a.get(t)?.get(e);
7922
7922
  return i?.sessionId === n ? i : null;
7923
7923
  }
7924
7924
  function Lf(t, e, n, i, s, o, a, r, c = null, l = !1) {
@@ -8139,20 +8139,20 @@ function $f(t, e, n, i) {
8139
8139
  const s = t.clients[e];
8140
8140
  return s === void 0 || t.selections[s].sessionId === n ? !0 : !i || Object.values(i.pendingRestoration).includes(s) || Object.values(i.submissions).some((o) => o.conversationScopeId === s && !o.cancelled) ? !1 : t.selections[s].sessionId === null || Jt(i, t, s).isDraftSession;
8141
8141
  }
8142
- function _a(t) {
8142
+ function va(t) {
8143
8143
  return {
8144
8144
  ...t,
8145
8145
  metadataRevision: t.metadataRevision + 1,
8146
8146
  queries: Object.fromEntries(Object.entries(t.queries).map(([e, n]) => [e, { ...n, invalidated: !0 }]))
8147
8147
  };
8148
8148
  }
8149
- function _r(t, e, n) {
8149
+ function vr(t, e, n) {
8150
8150
  if (e.conversation_id !== e.conversation.id || !Number.isSafeInteger(e.version) || e.version < 0)
8151
8151
  throw new Error("Invalid conversation metadata envelope identity or version.");
8152
8152
  const i = t.entities[e.conversation_id];
8153
8153
  if (i && i.version >= e.version) return t;
8154
8154
  const s = { ...e, conversation: { ...e.conversation } }, o = { ...t, entities: { ...t.entities, [e.conversation_id]: s } };
8155
- return n ? _a(o) : o;
8155
+ return n ? va(o) : o;
8156
8156
  }
8157
8157
  function Fn(t, e, n) {
8158
8158
  let i = t;
@@ -8177,7 +8177,7 @@ function Fn(t, e, n) {
8177
8177
  if (e.type === "effect.failed")
8178
8178
  i = { ...i, queries: { ...i.queries, [r]: { ...c, status: "error", error: { ...e.error }, requestId: null, consecutiveFailures: c.consecutiveFailures + 1 } } };
8179
8179
  else if (e.effectKind === "directory.query") {
8180
- for (const g of e.output.entries) i = _r(i, g, !0);
8180
+ for (const g of e.output.entries) i = vr(i, g, !0);
8181
8181
  const l = e.output.entries.map((g) => g.conversation_id), u = { ...i.durableActivityBySessionId }, d = { ...i.activityBySessionId }, p = { ...i.activityRevisionBySessionId };
8182
8182
  for (const g of e.output.entries) {
8183
8183
  if (typeof g.is_active != "boolean") continue;
@@ -8205,7 +8205,7 @@ function Fn(t, e, n) {
8205
8205
  } else {
8206
8206
  if (e.type === "effect.completed" && e.effectKind === "directory.mutate") {
8207
8207
  if (e.output.conversation_id !== o.input.sessionId) throw new Error("Mutation response has the wrong conversation identity.");
8208
- i = _r(i, e.output, !0);
8208
+ i = vr(i, e.output, !0);
8209
8209
  }
8210
8210
  const r = { ...i.mutations[o.input.sessionId] };
8211
8211
  for (const c of ["title", "pinned"]) {
@@ -8218,9 +8218,9 @@ function Fn(t, e, n) {
8218
8218
  if (e.authorityId !== (t.authorityId ?? "") || e.generation !== t.generation)
8219
8219
  return { state: t, effects: s };
8220
8220
  if (e.type === "directory.metadata_received")
8221
- i = _r(t, e.metadata, !0);
8221
+ i = vr(t, e.metadata, !0);
8222
8222
  else if (e.type === "directory.invalidate")
8223
- i = _a(t);
8223
+ i = va(t);
8224
8224
  else if (e.type === "directory.optimistic_upsert")
8225
8225
  i = { ...t, optimisticEntries: {
8226
8226
  ...t.optimisticEntries,
@@ -8287,7 +8287,7 @@ function Fn(t, e, n) {
8287
8287
  const d = c[u];
8288
8288
  d !== void 0 && (l[u] = { requestId: e.requestId, value: d, status: "pending", error: null });
8289
8289
  }
8290
- i = _a({ ...t, mutations: { ...t.mutations, [e.sessionId]: l } });
8290
+ i = va({ ...t, mutations: { ...t.mutations, [e.sessionId]: l } });
8291
8291
  }
8292
8292
  i = { ...i, requestSequence: t.requestSequence + 1, requests: { ...i.requests, [o]: r } }, s.push({ id: o, ...r });
8293
8293
  } else
@@ -8600,9 +8600,9 @@ class Xf {
8600
8600
  constructor(e = Qf, n = {}, i, s) {
8601
8601
  this.conversationPorts = { ...Yf, ...n }, this.featurePorts = s ?? {}, this.engine = new Wf({
8602
8602
  initialState: Object.freeze({ revision: 0, slices: Object.freeze({
8603
- account: Ve(na()),
8604
- features: Ve(sa()),
8605
- interactions: Ve(ia()),
8603
+ account: Ve(ia()),
8604
+ features: Ve(oa()),
8605
+ interactions: Ve(sa()),
8606
8606
  modelSelection: Bf(),
8607
8607
  directory: _u(),
8608
8608
  conversation: Kd(),
@@ -8611,7 +8611,7 @@ class Xf {
8611
8611
  reducer: (o, a) => {
8612
8612
  const r = a.value;
8613
8613
  if (r.type.startsWith("stage7.") || (r.type === "effect.completed" || r.type === "effect.failed") && r.effectKind.startsWith("stage7.")) {
8614
- const l = oa(o.slices, r, o.slices);
8614
+ const l = ra(o.slices, r, o.slices);
8615
8615
  if (l.state === o.slices) return { state: o, effects: l.effects };
8616
8616
  const u = Ve(lt({ account: l.state.account, features: l.state.features, interactions: l.state.interactions }));
8617
8617
  return { state: Object.freeze({ revision: o.revision + 1, slices: Object.freeze({ ...o.slices, ...u }) }), effects: l.effects };
@@ -8621,7 +8621,7 @@ class Xf {
8621
8621
  return { state: l.state === o.slices.activeUsers ? o : Object.freeze({ revision: o.revision + 1, slices: Object.freeze({ ...o.slices, activeUsers: l.state }) }), effects: l.effects };
8622
8622
  }
8623
8623
  if (Gf(r)) {
8624
- const l = Fn(o.slices.directory, r, o.slices.conversation), u = ha(da(o.slices.conversation, l.state, r.type === "directory.authority_replace" && r.adoptLocalSubmissions === !0)), d = ua(o.slices.conversation, u.state, l.state, l.state.clients !== o.slices.directory.clients), p = d.state, f = Ul(o.slices.conversation, p, l.state);
8624
+ const l = Fn(o.slices.directory, r, o.slices.conversation), u = ga(ua(o.slices.conversation, l.state, r.type === "directory.authority_replace" && r.adoptLocalSubmissions === !0)), d = pa(o.slices.conversation, u.state, l.state, l.state.clients !== o.slices.directory.clients), p = d.state, f = Ul(o.slices.conversation, p, l.state);
8625
8625
  return { state: f === o.slices.directory && p === o.slices.conversation ? o : Object.freeze({
8626
8626
  revision: o.revision + 1,
8627
8627
  slices: Object.freeze({ ...o.slices, directory: f, conversation: p })
@@ -8655,11 +8655,11 @@ class Xf {
8655
8655
  }).state);
8656
8656
  }
8657
8657
  u = Ul(o.slices.conversation, l.state, u);
8658
- const p = ha(da(l.state, u)), f = ua(l.state, p.state, u);
8658
+ const p = ga(ua(l.state, u)), f = pa(l.state, p.state, u);
8659
8659
  let y = o.slices;
8660
8660
  const g = [], b = l.interactionSources, _ = y.account.authority;
8661
8661
  if (b && _ && _.authorityId === b.authorityId && _.generation === b.generation) {
8662
- const S = oa(y, { type: "stage7.sources", authority: _, now: y.features.now, sources: b.sources }, { conversation: f.state, directory: u });
8662
+ const S = ra(y, { type: "stage7.sources", authority: _, now: y.features.now, sources: b.sources }, { conversation: f.state, directory: u });
8663
8663
  y = Ve(lt({ account: S.state.account, features: S.state.features, interactions: S.state.interactions })), g.push(...S.effects);
8664
8664
  }
8665
8665
  return { state: f.state === o.slices.conversation && u === o.slices.directory && y === o.slices ? o : Object.freeze({
@@ -8755,13 +8755,13 @@ class Xf {
8755
8755
  }
8756
8756
  }
8757
8757
  }
8758
- const Zf = "pluno-product-agent-attachments", em = 1, va = "files", tm = 1440 * 60 * 1e3;
8758
+ const Zf = "pluno-product-agent-attachments", em = 1, Ia = "files", tm = 1440 * 60 * 1e3;
8759
8759
  async function nm(t) {
8760
- const e = await mo();
8760
+ const e = await yo();
8761
8761
  await ku(e, "readwrite", (n) => n.put(t));
8762
8762
  }
8763
8763
  async function zl(t) {
8764
- const e = await mo(), n = await ku(
8764
+ const e = await yo(), n = await ku(
8765
8765
  e,
8766
8766
  "readonly",
8767
8767
  (s) => s.get(t)
@@ -8772,7 +8772,7 @@ async function zl(t) {
8772
8772
  return await Su(t, { lastUsedAt: i }), { ...n, lastUsedAt: i };
8773
8773
  }
8774
8774
  async function Su(t, e) {
8775
- const n = await mo();
8775
+ const n = await yo();
8776
8776
  await Ka(n, "readwrite", async (i) => {
8777
8777
  const s = await Wa(
8778
8778
  i.get(t)
@@ -8784,17 +8784,17 @@ async function Su(t, e) {
8784
8784
  });
8785
8785
  }
8786
8786
  async function im(t = tm) {
8787
- const e = await mo(), n = Date.now() - t;
8787
+ const e = await yo(), n = Date.now() - t;
8788
8788
  await Ka(e, "readwrite", async (i) => {
8789
8789
  const s = i.index("lastUsedAt");
8790
8790
  (await Wa(s.getAllKeys(IDBKeyRange.upperBound(n)))).forEach((a) => i.delete(a));
8791
8791
  });
8792
8792
  }
8793
- function mo() {
8793
+ function yo() {
8794
8794
  return typeof indexedDB > "u" ? Promise.reject(new Error("Product Agent attachment storage is unavailable")) : new Promise((t, e) => {
8795
8795
  const n = indexedDB.open(Zf, em);
8796
8796
  n.onupgradeneeded = () => {
8797
- const s = n.result.createObjectStore(va, { keyPath: "attachmentId" });
8797
+ const s = n.result.createObjectStore(Ia, { keyPath: "attachmentId" });
8798
8798
  s.createIndex("lastUsedAt", "lastUsedAt", { unique: !1 }), s.createIndex("sessionId", "sessionId", { unique: !1 }), s.createIndex("origin", "origin", { unique: !1 });
8799
8799
  }, n.onsuccess = () => t(n.result), n.onerror = () => e(n.error ?? new Error("Failed to open Product Agent attachment storage"));
8800
8800
  });
@@ -8804,7 +8804,7 @@ async function ku(t, e, n) {
8804
8804
  }
8805
8805
  function Ka(t, e, n) {
8806
8806
  return new Promise((i, s) => {
8807
- const o = t.transaction(va, e), a = o.objectStore(va);
8807
+ const o = t.transaction(Ia, e), a = o.objectStore(Ia);
8808
8808
  let r, c = !1;
8809
8809
  n(a).then((l) => {
8810
8810
  r = l;
@@ -8872,11 +8872,11 @@ const cm = "save_runtime_captured_skill";
8872
8872
  function lm(t) {
8873
8873
  return (t.type === "function_call" || t.type === "tool_call") && t.name === cm;
8874
8874
  }
8875
- const vr = "pluno.productAgent.transportId", dm = "pluno.productAgent.transportIdentity", Ir = "pluno.productAgent.transportIdentity.event", um = 50, pm = globalThis.setTimeout.bind(globalThis);
8875
+ const Ir = "pluno.productAgent.transportId", dm = "pluno.productAgent.transportIdentity", Sr = "pluno.productAgent.transportIdentity.event", um = 50, pm = globalThis.setTimeout.bind(globalThis);
8876
8876
  let zi = null;
8877
- const Ks = /* @__PURE__ */ new Set(), Sr = /* @__PURE__ */ new Map();
8877
+ const Ks = /* @__PURE__ */ new Set(), kr = /* @__PURE__ */ new Map();
8878
8878
  async function hm(t = Eu()) {
8879
- const e = t.randomUUID(), n = t.storage.getItem(vr);
8879
+ const e = t.randomUUID(), n = t.storage.getItem(Ir);
8880
8880
  let i = n ?? t.randomUUID(), s = !1, o = !1;
8881
8881
  const a = t.channel.subscribe((c) => {
8882
8882
  if (!(c.senderId === e || c.transportId !== i)) {
@@ -8894,7 +8894,7 @@ async function hm(t = Eu()) {
8894
8894
  }
8895
8895
  });
8896
8896
  if (!n)
8897
- t.storage.setItem(vr, i), s = !0;
8897
+ t.storage.setItem(Ir, i), s = !0;
8898
8898
  else if (t.skipStoredIdentityCollisionCheck)
8899
8899
  s = !0;
8900
8900
  else
@@ -8903,7 +8903,7 @@ async function hm(t = Eu()) {
8903
8903
  s = !0;
8904
8904
  break;
8905
8905
  }
8906
- i = t.randomUUID(), t.storage.setItem(vr, i);
8906
+ i = t.randomUUID(), t.storage.setItem(Ir, i);
8907
8907
  }
8908
8908
  let r = !1;
8909
8909
  return {
@@ -8952,13 +8952,13 @@ function mm() {
8952
8952
  return {
8953
8953
  getItem: (t) => {
8954
8954
  try {
8955
- return window.sessionStorage?.getItem(t) ?? Sr.get(t) ?? null;
8955
+ return window.sessionStorage?.getItem(t) ?? kr.get(t) ?? null;
8956
8956
  } catch {
8957
- return Sr.get(t) ?? null;
8957
+ return kr.get(t) ?? null;
8958
8958
  }
8959
8959
  },
8960
8960
  setItem: (t, e) => {
8961
- Sr.set(t, e);
8961
+ kr.set(t, e);
8962
8962
  try {
8963
8963
  window.sessionStorage?.setItem(t, e);
8964
8964
  } catch {
@@ -8982,7 +8982,7 @@ function ym() {
8982
8982
  }
8983
8983
  function bm() {
8984
8984
  const t = /* @__PURE__ */ new Set(), e = (n) => {
8985
- if (n.key !== Ir || !n.newValue)
8985
+ if (n.key !== Sr || !n.newValue)
8986
8986
  return;
8987
8987
  const i = JSON.parse(n.newValue);
8988
8988
  for (const s of t)
@@ -8991,9 +8991,9 @@ function bm() {
8991
8991
  return window.addEventListener("storage", e), {
8992
8992
  postMessage: (n) => {
8993
8993
  window.localStorage.setItem(
8994
- Ir,
8994
+ Sr,
8995
8995
  JSON.stringify({ ...n, eventId: crypto.randomUUID() })
8996
- ), window.localStorage.removeItem(Ir);
8996
+ ), window.localStorage.removeItem(Sr);
8997
8997
  },
8998
8998
  subscribe: (n) => (t.add(n), () => t.delete(n)),
8999
8999
  close: () => {
@@ -9086,9 +9086,10 @@ const Sm = [
9086
9086
  "gpt-5.6-luna",
9087
9087
  "gpt-5.6-terra",
9088
9088
  "gpt-5.6-sol",
9089
+ "gpt-6.1-sol",
9089
9090
  "gpt-6-sol",
9090
9091
  "gpt-6-luna"
9091
- ], to = (t) => typeof t == "string" && Sm.includes(t), kr = /* @__PURE__ */ new Map();
9092
+ ], no = (t) => typeof t == "string" && Sm.includes(t), xr = /* @__PURE__ */ new Map();
9092
9093
  function km(t, e, n) {
9093
9094
  const i = `pluno.productAgent.modelClientScope:${e}`, s = t.getItem(i);
9094
9095
  if (s) return s;
@@ -9098,24 +9099,24 @@ function km(t, e, n) {
9098
9099
  function xm(t, e) {
9099
9100
  try {
9100
9101
  const n = km(window.sessionStorage, t, e);
9101
- return kr.set(t, n), n;
9102
+ return xr.set(t, n), n;
9102
9103
  } catch (n) {
9103
9104
  if (!(n instanceof DOMException) || n.name !== "SecurityError" && n.name !== "QuotaExceededError") throw n;
9104
- const i = kr.get(t) ?? e();
9105
- return kr.set(t, i), i;
9105
+ const i = xr.get(t) ?? e();
9106
+ return xr.set(t, i), i;
9106
9107
  }
9107
9108
  }
9108
9109
  function Em(t) {
9109
9110
  if (!t || typeof t != "object") return;
9110
9111
  const e = t, n = e.requestedModel ?? e.requested_model, i = e.effectiveModel ?? e.effective_model, s = e.provider;
9111
- if (!(!to(n) || !to(i) || s !== "openrouter" && s !== "azure" && s !== "openai"))
9112
+ if (!(!no(n) || !no(i) || s !== "openrouter" && s !== "azure" && s !== "openai"))
9112
9113
  return Object.freeze({ requestedModel: n, effectiveModel: i, provider: s });
9113
9114
  }
9114
9115
  const Au = (t, e) => Gh(
9115
9116
  t.engine.getState().slices.modelSelection,
9116
9117
  e
9117
9118
  );
9118
- function xr(t, e, n, i) {
9119
+ function Er(t, e, n, i) {
9119
9120
  return t.engine.dispatch({
9120
9121
  type: "model.submission_capture",
9121
9122
  clientScopeId: e,
@@ -9134,7 +9135,7 @@ function Cm(t, e, n, i, s, o) {
9134
9135
  updatedAt: o ? Date.parse(o) : void 0
9135
9136
  });
9136
9137
  }
9137
- function Er(t, e, n, i) {
9138
+ function Cr(t, e, n, i) {
9138
9139
  if (Array.isArray(i))
9139
9140
  for (const s of i) {
9140
9141
  if (!s || typeof s != "object") continue;
@@ -9156,8 +9157,8 @@ const Am = {
9156
9157
  stopped: "⏹️"
9157
9158
  }, Rm = /^(?:⌛|⏳|✅|❗|⏹️) Pluno(?:: )?/;
9158
9159
  function Tm(t, e) {
9159
- if (!e) return no(t);
9160
- const n = no(t), i = `${Am[e]} Pluno`;
9160
+ if (!e) return io(t);
9161
+ const n = io(t), i = `${Am[e]} Pluno`;
9161
9162
  return n ? `${i}: ${n}` : i;
9162
9163
  }
9163
9164
  class Pm {
@@ -9182,10 +9183,10 @@ class Pm {
9182
9183
  }
9183
9184
  applyStatus(e) {
9184
9185
  const n = this.titleDocument.getTitle();
9185
- n !== this.lastAppliedTitle && (this.baseTitle = no(n)), this.status = e, this.stopObserving || (this.stopObserving = this.titleDocument.observeTitle(() => this.handleTitleChanged())), this.applyTitle();
9186
+ n !== this.lastAppliedTitle && (this.baseTitle = io(n)), this.status = e, this.stopObserving || (this.stopObserving = this.titleDocument.observeTitle(() => this.handleTitleChanged())), this.applyTitle();
9186
9187
  }
9187
9188
  applyClear() {
9188
- const e = this.titleDocument.getTitle(), n = this.lastAppliedTitle !== null && e === this.lastAppliedTitle, i = this.lastAppliedTitle === null ? no(e) : e;
9189
+ const e = this.titleDocument.getTitle(), n = this.lastAppliedTitle !== null && e === this.lastAppliedTitle, i = this.lastAppliedTitle === null ? io(e) : e;
9189
9190
  this.status = null, this.lastAppliedTitle = null, this.stopObserving?.(), this.stopObserving = null, n ? this.titleDocument.setTitle(this.baseTitle) : i !== e && this.titleDocument.setTitle(i);
9190
9191
  }
9191
9192
  handleTitleChanged() {
@@ -9214,7 +9215,7 @@ function qm(t) {
9214
9215
  }
9215
9216
  };
9216
9217
  }
9217
- function no(t) {
9218
+ function io(t) {
9218
9219
  return t.replace(Rm, "");
9219
9220
  }
9220
9221
  const Mm = {
@@ -9280,7 +9281,7 @@ class Ze extends Error {
9280
9281
  retryAfterMs;
9281
9282
  }
9282
9283
  let jm = 0;
9283
- function Cr(t) {
9284
+ function Ar(t) {
9284
9285
  const e = {};
9285
9286
  for (const c of [
9286
9287
  "type",
@@ -9366,17 +9367,17 @@ function Xn(t, e, n) {
9366
9367
  };
9367
9368
  window.dispatchEvent(new CustomEvent("product-agent:trace", { detail: s }));
9368
9369
  }
9369
- const Fm = "https://app.pluno.ai", $m = 2e4, Hm = 1e4, Km = 6e4, Wm = 6e4, Vm = 1e4, Gm = 1e4, Jm = 1e3, Ia = 3e4, $l = 0.2, Ar = 6e4, Rr = 3, Hl = "Still connecting to Pluno. Retrying automatically.", Qm = 1e3, Ym = 100, Kl = 3, Xm = [300, 1e3], Ru = 50 * 1024 * 1024, Zm = /* @__PURE__ */ new Set([
9370
+ const Fm = "https://app.pluno.ai", $m = 2e4, Hm = 1e4, Km = 6e4, Wm = 6e4, Vm = 1e4, Gm = 1e4, Jm = 1e3, Sa = 3e4, $l = 0.2, Rr = 6e4, Tr = 3, Hl = "Still connecting to Pluno. Retrying automatically.", Qm = 1e3, Ym = 100, Kl = 3, Xm = [300, 1e3], Ru = 50 * 1024 * 1024, Zm = /* @__PURE__ */ new Set([
9370
9371
  ".jpeg:image/jpeg",
9371
9372
  ".jpg:image/jpeg",
9372
9373
  ".pdf:application/pdf",
9373
9374
  ".png:image/png",
9374
9375
  ".webp:image/webp"
9375
- ]), ey = ".pdf,.png,.jpg,.jpeg,.webp", Ga = 64e3, Tr = 4e3, Ja = 30, ty = 2e3, ny = 1e3, Tu = "Image is too large for model vision input.", iy = "pluno.productAgent.state.", Sa = "pluno.productAgent.pendingEvents.", yo = "pluno.productAgent.activeToolCalls.", sy = 100, Ws = /* @__PURE__ */ new Set();
9376
+ ]), ey = ".pdf,.png,.jpg,.jpeg,.webp", Ga = 64e3, Pr = 4e3, Ja = 30, ty = 2e3, ny = 1e3, Tu = "Image is too large for model vision input.", iy = "pluno.productAgent.state.", ka = "pluno.productAgent.pendingEvents.", bo = "pluno.productAgent.activeToolCalls.", sy = 100, Ws = /* @__PURE__ */ new Set();
9376
9377
  let Rs = null;
9377
9378
  function oy(t, e = Math.random) {
9378
- const n = Math.min(Ia, Jm * 2 ** t), i = 1 - $l + e() * $l * 2;
9379
- return Math.min(Ia, Math.round(n * i));
9379
+ const n = Math.min(Sa, Jm * 2 ** t), i = 1 - $l + e() * $l * 2;
9380
+ return Math.min(Sa, Math.round(n * i));
9380
9381
  }
9381
9382
  function ry(t) {
9382
9383
  const e = t.split(".")[1];
@@ -9389,7 +9390,7 @@ function ry(t) {
9389
9390
  return null;
9390
9391
  }
9391
9392
  }
9392
- function Pr(t) {
9393
+ function qr(t) {
9393
9394
  if (t instanceof Ze)
9394
9395
  return t.retryable;
9395
9396
  if (t && typeof t == "object") {
@@ -9409,13 +9410,13 @@ function Bi(t) {
9409
9410
  }
9410
9411
  return Object.assign(new Error(e.message), e);
9411
9412
  }
9412
- function qr(t) {
9413
+ function Mr(t) {
9413
9414
  return t === "main_web_chat" ? ["pinned", "recent"] : ["all"];
9414
9415
  }
9415
9416
  class Qa {
9416
9417
  constructor(e, n) {
9417
9418
  this.options = e, this.transportIdentity = n, this.directoryAuthority = {
9418
- authorityId: gr(`pa.authority:${e.clientId}`) ?? `${e.clientId}:${e.runtimeCommunityId ?? e.productVariant}`,
9419
+ authorityId: fr(`pa.authority:${e.clientId}`) ?? `${e.clientId}:${e.runtimeCommunityId ?? e.productVariant}`,
9419
9420
  generation: 1
9420
9421
  }, this.directoryHttp = new wu({
9421
9422
  backendUrl: e.backendUrl,
@@ -9455,7 +9456,7 @@ class Qa {
9455
9456
  }), void 0, ug(async () => {
9456
9457
  if (!this.token || !this.state.user || this.state.status === "closed") throw new Error("Product Agent is not authenticated");
9457
9458
  return this.options.activeUsersLoader ? (await this.options.activeUsersLoader()).count : pg(this.options.backendUrl);
9458
- })), this.draftModel = (e.productVariant === "personal" ? Nn(e.model) : e.model) ?? (e.productVariant === "personal" ? Qi[0].value : "gpt-5.6-terra"), this.modelClientScopeId = xm(e.clientId, () => crypto.randomUUID()), this.directoryConversationScopeId = `conversation:${this.modelClientScopeId}`, this.createDirectoryAdapters(), this.clientRuntime.engine.dispatch({
9459
+ })), this.draftModel = (e.productVariant === "personal" ? Nn(e.model) : e.model) ?? (e.productVariant === "personal" ? Qi[0].value : "gpt-6.1-sol"), this.modelClientScopeId = xm(e.clientId, () => crypto.randomUUID()), this.directoryConversationScopeId = `conversation:${this.modelClientScopeId}`, this.createDirectoryAdapters(), this.clientRuntime.engine.dispatch({
9459
9460
  type: "model.scope_open",
9460
9461
  clientScopeId: this.modelClientScopeId,
9461
9462
  sessionId: null,
@@ -9622,7 +9623,7 @@ class Qa {
9622
9623
  }, stop: () => {
9623
9624
  } },
9624
9625
  enabled: () => !!this.token && !this.authenticationFailure && !this.refreshingDefaultCredentials && this.state.status !== "closed",
9625
- observedQueries: () => qr(this.options.entrySurface).map((n) => this.getDirectoryQuery(n))
9626
+ observedQueries: () => Mr(this.options.entrySurface).map((n) => this.getDirectoryQuery(n))
9626
9627
  });
9627
9628
  let e = this.clientRuntime.engine.getProjection().activeUsers.query.data;
9628
9629
  this.clientRuntime.engine.subscribe((n) => {
@@ -9643,7 +9644,7 @@ class Qa {
9643
9644
  });
9644
9645
  const s = `pa.conversation.delivery:${this.modelClientScopeId}:${n.authorityId}`, o = `${s}:cancellations`;
9645
9646
  this.authenticatedUserId && this.options.restorePersistedState === !1 && sessionStorage.removeItem(o);
9646
- const a = this.authenticatedUserId ? gr(o) : null, r = ig({
9647
+ const a = this.authenticatedUserId ? fr(o) : null, r = ig({
9647
9648
  authorityId: n.authorityId,
9648
9649
  isCurrent: i,
9649
9650
  read: async () => a ? JSON.parse(a) : null,
@@ -9721,7 +9722,7 @@ class Qa {
9721
9722
  onTiming: (g) => {
9722
9723
  i() && this.reportOperationTiming(g);
9723
9724
  },
9724
- onCommand: (g) => Xn("client_event", g.type, Cr({ ...g.payload, type: g.type })),
9725
+ onCommand: (g) => Xn("client_event", g.type, Ar({ ...g.payload, type: g.type })),
9725
9726
  onError: (g, b) => {
9726
9727
  if (this.options.productVariant === "customer_embedded" && b.operation === "conversation.snapshot" && g instanceof N && g.code === "conversation_access_denied") {
9727
9728
  b.sessionId === this.getState().sessionId && this.startNewSession({ notifyTransport: !1 });
@@ -9731,7 +9732,7 @@ class Qa {
9731
9732
  }
9732
9733
  })
9733
9734
  });
9734
- const c = this.clientRuntime.engine.getState().slices.conversation, l = this.options.restorePersistedState === !1 || !this.authenticatedUserId ? null : gr(s);
9735
+ const c = this.clientRuntime.engine.getState().slices.conversation, l = this.options.restorePersistedState === !1 || !this.authenticatedUserId ? null : fr(s);
9735
9736
  if (this.authenticatedUserId && !c.submissionOrder.length && !Object.keys(c.operations).length) {
9736
9737
  const g = this.queuedClientEvents.filter((S) => S.type === "chat.user_message"), b = l ? JSON.parse(l) : g.length ? gg(c, g.map((S) => {
9737
9738
  const { type: x, ...m } = S, w = this.clientRuntime.engine.getState().slices.directory, I = w.clients[this.modelClientScopeId];
@@ -9803,7 +9804,7 @@ class Qa {
9803
9804
  m && (m.sessionId = x.sessionId), this.emit("ack", { clientMessageId: x.userMessageId, sessionId: x.sessionId });
9804
9805
  const w = x.sessionId;
9805
9806
  w && this.getState().sessionId === w && this.directoryHttp.request(`/sessions/${encodeURIComponent(w)}/history`, { limit: 200 }).then((I) => {
9806
- i() && this.getState().sessionId === w && this.state.status !== "closed" && Er(this.clientRuntime, this.modelClientScopeId, w, I.turns);
9807
+ i() && this.getState().sessionId === w && this.state.status !== "closed" && Cr(this.clientRuntime, this.modelClientScopeId, w, I.turns);
9807
9808
  }).catch((I) => {
9808
9809
  i() && this.getState().sessionId === w && this.handleDirectoryTransportError(I);
9809
9810
  });
@@ -9813,7 +9814,7 @@ class Qa {
9813
9814
  for (const [x, m] of Object.entries(g.directory.clients)) {
9814
9815
  if (!x.startsWith(`background:${this.modelClientScopeId}:`)) continue;
9815
9816
  const w = Jt(g.conversation, g.directory, m), I = w.sessionId ? g.conversation.sessions[w.sessionId] : void 0;
9816
- if (this.firstResponseTimersByClientMessageId.size && (u(br(w, I?.queries.current, this.options.backendUrl).messages, w.sessionId), ["failed", "stopped"].includes(w.activity.phase)))
9817
+ if (this.firstResponseTimersByClientMessageId.size && (u(wr(w, I?.queries.current, this.options.backendUrl).messages, w.sessionId), ["failed", "stopped"].includes(w.activity.phase)))
9817
9818
  for (const T of Pt(I?.execution)) this.clearFirstResponseTimer(T);
9818
9819
  const E = w.activity.phase === "completed" && Pt(I?.execution).some((T) => this.firstResponseTimersByClientMessageId.has(T));
9819
9820
  (_ && w.sessionId === this.getState().sessionId || !E && ["completed", "failed", "stopped"].includes(w.activity.phase)) && this.directoryScope.detach(x);
@@ -9879,12 +9880,12 @@ class Qa {
9879
9880
  return i.add(n), this.listeners[e] = i, () => i.delete(n);
9880
9881
  }
9881
9882
  getState() {
9882
- const e = this.clientRuntime.engine.getState().slices, n = e.directory.clients[this.modelClientScopeId] ?? this.directoryConversationScopeId, i = Jt(e.conversation, e.directory, n), s = br(
9883
+ const e = this.clientRuntime.engine.getState().slices, n = e.directory.clients[this.modelClientScopeId] ?? this.directoryConversationScopeId, i = Jt(e.conversation, e.directory, n), s = wr(
9883
9884
  i,
9884
9885
  i.sessionId ? e.conversation.sessions[i.sessionId]?.queries.current : void 0,
9885
9886
  this.options.backendUrl,
9886
9887
  this.clientRuntime.engine.getDiagnostics({ clientScopeId: this.modelClientScopeId, scopeId: n, sessionId: i.sessionId })
9887
- ), o = { clientScopeId: this.modelClientScopeId, origin: location.origin, pageUrl: location.href }, a = this.options.productVariant === "personal" ? { kind: "userSuggestedTasks" } : { kind: "starterPrompts", ...o, includeUserSuggestions: !1 }, r = Xs(e, a), c = Xs(e, { kind: "appearance", ...o }), l = c?.data?.kind === "appearance" ? c.data.value : null;
9888
+ ), o = { clientScopeId: this.modelClientScopeId, origin: location.origin, pageUrl: location.href }, a = this.options.productVariant === "personal" ? { kind: "userSuggestedTasks" } : { kind: "starterPrompts", ...o, includeUserSuggestions: !1 }, r = Zs(e, a), c = Zs(e, { kind: "appearance", ...o }), l = c?.data?.kind === "appearance" ? c.data.value : null;
9888
9889
  return {
9889
9890
  ...this.platformState,
9890
9891
  ...s,
@@ -10074,7 +10075,7 @@ class Qa {
10074
10075
  return;
10075
10076
  }
10076
10077
  const a = Bi(o);
10077
- if (Pr(o)) {
10078
+ if (qr(o)) {
10078
10079
  Be("web-sdk.agent", "Pluno connection attempt failed; retrying", {
10079
10080
  message: a.message,
10080
10081
  reconnectAttempt: this.reconnectAttempts
@@ -10194,14 +10195,14 @@ class Qa {
10194
10195
  sessionId: this.getState().sessionId
10195
10196
  });
10196
10197
  a.mark("submit");
10197
- const r = xr(
10198
+ const r = Er(
10198
10199
  this.clientRuntime,
10199
10200
  this.modelClientScopeId,
10200
10201
  o,
10201
10202
  n.requestedModel ?? this.getModel()
10202
10203
  ), c = this.submissionIntentRevision, l = this.authenticatedUserId;
10203
10204
  if (n.initiatedBy || this.startFirstResponseTimer(o, n.submittedAt), l || await a.measure("authentication", () => this.waitForAuthentication()), this.clientRuntime.isDisposed || c !== this.submissionIntentRevision || l && l !== this.authenticatedUserId) return null;
10204
- xr(this.clientRuntime, this.modelClientScopeId, o, r ?? null);
10205
+ Er(this.clientRuntime, this.modelClientScopeId, o, r ?? null);
10205
10206
  const u = this.clientRuntime.engine.getState().slices.conversation.submissions[o];
10206
10207
  if (u && (u.content !== i || JSON.stringify(u.attachments.map((b) => b.sourceId)) !== JSON.stringify(s.map((b) => b.id ?? b.storageKey ?? b.sandboxPath)))) throw new Error("User-message identity cannot be reused with different input.");
10207
10208
  const d = At(), p = !u && !n.initiatedBy && this.options.capturePageContent !== !1 && this.lastUserMessagePageUrl !== d.url, y = this.clientRuntime.engine.getState().slices.directory.clients[this.modelClientScopeId];
@@ -10295,7 +10296,7 @@ class Qa {
10295
10296
  if (!o) return !1;
10296
10297
  if (o.type === "preparation") {
10297
10298
  const a = Me(), r = Sf(o.submission);
10298
- return xr(this.clientRuntime, this.modelClientScopeId, a, o.submission.requestedModel), this.sendMessage(r.content, { clientMessageId: a, attachments: r.attachments, proactiveSuggestionQuestion: r.proactiveSuggestionQuestion }).catch((c) => this.emit("error", Bi(c))), !0;
10299
+ return Er(this.clientRuntime, this.modelClientScopeId, a, o.submission.requestedModel), this.sendMessage(r.content, { clientMessageId: a, attachments: r.attachments, proactiveSuggestionQuestion: r.proactiveSuggestionQuestion }).catch((c) => this.emit("error", Bi(c))), !0;
10299
10300
  }
10300
10301
  return o.type === "delivery" ? (this.clientRuntime.engine.dispatch({ ...this.directoryAuthority, type: "conversation.submit", userMessageId: o.userMessageId, now: Date.now(), manualRetry: !0 }), !0) : (this.clientRuntime.engine.dispatch({ ...this.directoryAuthority, type: "conversation.operation", command: {
10301
10302
  request_id: Me(),
@@ -10433,7 +10434,7 @@ class Qa {
10433
10434
  warmupId: this.activeComposerWarmupId,
10434
10435
  page: At()
10435
10436
  }
10436
- } }), this.activeComposerWarmupId = null, this.lastUserMessagePageUrl = null, this.draftModelExplicit = !1, this.draftModel = (this.options.productVariant === "personal" ? this.lastPersonalModel ?? Nn(this.options.model) : this.options.model) ?? (this.options.productVariant === "personal" ? Qi[0].value : "gpt-5.6-terra"), this.clientRuntime.engine.dispatch({ type: "model.scope_navigate", clientScopeId: this.modelClientScopeId, sessionId: null }), this.beginDirectoryProvisional();
10437
+ } }), this.activeComposerWarmupId = null, this.lastUserMessagePageUrl = null, this.draftModelExplicit = !1, this.draftModel = (this.options.productVariant === "personal" ? this.lastPersonalModel ?? Nn(this.options.model) : this.options.model) ?? (this.options.productVariant === "personal" ? Qi[0].value : "gpt-6.1-sol"), this.clientRuntime.engine.dispatch({ type: "model.scope_navigate", clientScopeId: this.modelClientScopeId, sessionId: null }), this.beginDirectoryProvisional();
10437
10438
  }
10438
10439
  listSessions(e = {}) {
10439
10440
  return this.clientRuntime.route("directory", { core: async () => {
@@ -10451,7 +10452,7 @@ class Qa {
10451
10452
  }
10452
10453
  getSessionHistoryState() {
10453
10454
  return this.clientRuntime.project("directory", { core: () => {
10454
- const e = this.clientRuntime.engine.getProjection().directory, n = e.queries[Se(this.getDirectoryQuery())], i = qr(this.options.entrySurface).map((u) => this.getDirectoryQuery(u)).map((u) => e.queries[Se(u)]).filter((u) => u !== void 0), s = Object.values(e.optimisticEntries).reverse(), o = Ef(i), a = new Set(s.flatMap((u) => u.sessionId ? [u.sessionId] : [])), r = [...s.map((u) => u.id), ...o.filter((u) => !a.has(u))], c = Object.fromEntries([
10455
+ const e = this.clientRuntime.engine.getProjection().directory, n = e.queries[Se(this.getDirectoryQuery())], i = Mr(this.options.entrySurface).map((u) => this.getDirectoryQuery(u)).map((u) => e.queries[Se(u)]).filter((u) => u !== void 0), s = Object.values(e.optimisticEntries).reverse(), o = Ef(i), a = new Set(s.flatMap((u) => u.sessionId ? [u.sessionId] : [])), r = [...s.map((u) => u.id), ...o.filter((u) => !a.has(u))], c = Object.fromEntries([
10455
10456
  ...s.map((u) => [u.id, {
10456
10457
  id: u.id,
10457
10458
  title: null,
@@ -10481,7 +10482,7 @@ class Qa {
10481
10482
  }
10482
10483
  refreshSessionHistory() {
10483
10484
  return this.clientRuntime.route("directory", { core: async () => {
10484
- await Promise.all(qr(this.options.entrySurface).map((e) => this.getDirectoryQuery(e)).map((e) => this.refreshDirectoryQuery(e, e.kind === "pinned")));
10485
+ await Promise.all(Mr(this.options.entrySurface).map((e) => this.getDirectoryQuery(e)).map((e) => this.refreshDirectoryQuery(e, e.kind === "pinned")));
10485
10486
  } });
10486
10487
  }
10487
10488
  loadMoreSessionHistory() {
@@ -10618,7 +10619,7 @@ class Qa {
10618
10619
  if (!i() || !s) return;
10619
10620
  this.clientRuntime.engine.getState().slices.account.authority || this.applyAuthenticatedDirectoryIdentity(s.user);
10620
10621
  }
10621
- await pr(this.clientRuntime, { kind: "account" });
10622
+ await hr(this.clientRuntime, { kind: "account" });
10622
10623
  }
10623
10624
  }
10624
10625
  installFeaturePorts() {
@@ -10744,7 +10745,7 @@ class Qa {
10744
10745
  this.clientRuntime.onDispose(() => c?.()), jh(this.clientRuntime, () => Date.now());
10745
10746
  const l = () => {
10746
10747
  const u = this.clientRuntime.engine.getState().slices.account.authority;
10747
- u?.profile === "main_web_chat" && this.options.entrySurface === "main_web_chat" && this.clientRuntime.engine.dispatch({ type: "stage7.device_hints", authority: u, now: Date.now(), hints: Zr(localStorage) });
10748
+ u?.profile === "main_web_chat" && this.options.entrySurface === "main_web_chat" && this.clientRuntime.engine.dispatch({ type: "stage7.device_hints", authority: u, now: Date.now(), hints: ea(localStorage) });
10748
10749
  };
10749
10750
  window.addEventListener("storage", l), this.clientRuntime.onDispose(() => window.removeEventListener("storage", l)), this.clientRuntime.onDispose(() => {
10750
10751
  e.dispose(), r(), this.options.runtimeAdapters?.featurePermissions?.dispose?.();
@@ -10760,7 +10761,7 @@ class Qa {
10760
10761
  if (Object.values(n.optimisticEntries).some((s) => s.id === e && s.sessionId === null)) return;
10761
10762
  !this.options.keepRunsActiveOnSessionNavigation && this.state.sessionId !== e && this.stopConversation("session_switch"), this.retainNavigatedConversation();
10762
10763
  const i = "conversation:" + this.modelClientScopeId + ":" + Me();
10763
- this.directoryConversationScopeId = i, this.lastUserMessagePageUrl = null, this.draftModelExplicit = !1, this.draftModel = (this.options.productVariant === "personal" ? Nn(this.options.model) : this.options.model) ?? (this.options.productVariant === "personal" ? Qi[0].value : "gpt-5.6-terra"), this.clientRuntime.engine.dispatch({ type: "model.scope_navigate", clientScopeId: this.modelClientScopeId, sessionId: e }), this.directoryScope.bind(this.modelClientScopeId, this.directoryConversationScopeId, e).then(async () => {
10764
+ this.directoryConversationScopeId = i, this.lastUserMessagePageUrl = null, this.draftModelExplicit = !1, this.draftModel = (this.options.productVariant === "personal" ? Nn(this.options.model) : this.options.model) ?? (this.options.productVariant === "personal" ? Qi[0].value : "gpt-6.1-sol"), this.clientRuntime.engine.dispatch({ type: "model.scope_navigate", clientScopeId: this.modelClientScopeId, sessionId: e }), this.directoryScope.bind(this.modelClientScopeId, this.directoryConversationScopeId, e).then(async () => {
10764
10765
  await this.directoryScope.persist(), this.state.sessionId === e && (n.intents[e]?.observe && this.conversationObservation?.refresh(e).catch((s) => this.handleDirectoryTransportError(s)), this.send({ type: "page.upsert", sessionId: e, page: At(), model: this.getModel() }));
10765
10766
  });
10766
10767
  }
@@ -10779,7 +10780,7 @@ class Qa {
10779
10780
  })), !0;
10780
10781
  }
10781
10782
  try {
10782
- return n.send(JSON.stringify(e)), Xn("client_event", e.type, Cr(e)), !0;
10783
+ return n.send(JSON.stringify(e)), Xn("client_event", e.type, Ar(e)), !0;
10783
10784
  } catch (i) {
10784
10785
  return Be("web-sdk.agent", "Pluno socket send failed; scheduling reconnect", {
10785
10786
  message: i instanceof Error ? i.message : String(i),
@@ -10792,7 +10793,7 @@ class Qa {
10792
10793
  let i = this.getState();
10793
10794
  if (e === "first_response_slow" && n.sessionId && n.sessionId !== i.sessionId) {
10794
10795
  const { conversation: y, directory: g } = this.clientRuntime.engine.getState().slices, b = Object.values(g.clients).find((_) => g.selections[_]?.sessionId === n.sessionId);
10795
- b && (i = { ...i, ...br(
10796
+ b && (i = { ...i, ...wr(
10796
10797
  Jt(y, g, b),
10797
10798
  y.sessions[n.sessionId]?.queries.current,
10798
10799
  this.options.backendUrl
@@ -10858,7 +10859,7 @@ class Qa {
10858
10859
  missedResponseChecks: i,
10859
10860
  timer: window.setTimeout(() => this.recordFirstResponseMiss(e), Math.max(
10860
10861
  0,
10861
- s + (i + 1) * Ar - Date.now()
10862
+ s + (i + 1) * Rr - Date.now()
10862
10863
  ))
10863
10864
  });
10864
10865
  }
@@ -10868,13 +10869,13 @@ class Qa {
10868
10869
  return;
10869
10870
  const i = Date.now() - n.submittedAt;
10870
10871
  if (n.missedResponseChecks = Math.min(
10871
- Rr,
10872
- Math.max(n.missedResponseChecks + 1, Math.floor(i / Ar))
10873
- ), n.missedResponseChecks >= Rr) {
10872
+ Tr,
10873
+ Math.max(n.missedResponseChecks + 1, Math.floor(i / Rr))
10874
+ ), n.missedResponseChecks >= Tr) {
10874
10875
  this.reportFirstResponseSlow(e);
10875
10876
  return;
10876
10877
  }
10877
- const s = n.submittedAt + (n.missedResponseChecks + 1) * Ar;
10878
+ const s = n.submittedAt + (n.missedResponseChecks + 1) * Rr;
10878
10879
  n.timer = window.setTimeout(
10879
10880
  () => this.recordFirstResponseMiss(e),
10880
10881
  Math.max(0, s - Date.now())
@@ -10882,7 +10883,7 @@ class Qa {
10882
10883
  }
10883
10884
  reportFirstResponseSlow(e) {
10884
10885
  const n = this.firstResponseTimersByClientMessageId.get(e);
10885
- n && (n.missedResponseChecks = Rr, window.clearTimeout(n.timer), this.reportHealthSignal("first_response_slow", {
10886
+ n && (n.missedResponseChecks = Tr, window.clearTimeout(n.timer), this.reportHealthSignal("first_response_slow", {
10886
10887
  ...n.sessionId ? { sessionId: n.sessionId } : {},
10887
10888
  clientMessageId: e,
10888
10889
  durationMs: Date.now() - n.submittedAt,
@@ -11027,8 +11028,8 @@ class Qa {
11027
11028
  if (!this.clientRuntime.engine.getState().slices.account.authority || this.state.status === "closed") return Promise.resolve();
11028
11029
  const e = { clientScopeId: this.modelClientScopeId, origin: location.origin, pageUrl: location.href };
11029
11030
  return Promise.all([
11030
- pr(this.clientRuntime, { kind: "appearance", ...e }),
11031
- pr(this.clientRuntime, this.options.productVariant === "personal" ? { kind: "userSuggestedTasks" } : { kind: "starterPrompts", ...e, includeUserSuggestions: !1 }).then(async (n) => {
11031
+ hr(this.clientRuntime, { kind: "appearance", ...e }),
11032
+ hr(this.clientRuntime, this.options.productVariant === "personal" ? { kind: "userSuggestedTasks" } : { kind: "starterPrompts", ...e, includeUserSuggestions: !1 }).then(async (n) => {
11032
11033
  n.kind === "starterPrompts" && n.prompts.length === 0 && location.href === e.pageUrl && await this.requestTransientStarterPrompts();
11033
11034
  })
11034
11035
  ]).then(() => {
@@ -11072,7 +11073,7 @@ class Qa {
11072
11073
  }
11073
11074
  };
11074
11075
  if (Fh(this.clientRuntime, l, Date.now()).then(async () => {
11075
- this.options.entrySurface === "main_web_chat" && l.profile === "main_web_chat" && await this.clientRuntime.engine.dispatch({ type: "stage7.device_hints", authority: l, now: Date.now(), hints: Zr(localStorage) }), await this.refreshStarterPromptsForCurrentUrl();
11076
+ this.options.entrySurface === "main_web_chat" && l.profile === "main_web_chat" && await this.clientRuntime.engine.dispatch({ type: "stage7.device_hints", authority: l, now: Date.now(), hints: ea(localStorage) }), await this.refreshStarterPromptsForCurrentUrl();
11076
11077
  }).catch(() => {
11077
11078
  }), o || a) {
11078
11079
  const u = this.directoryAuthority;
@@ -11124,7 +11125,7 @@ class Qa {
11124
11125
  }
11125
11126
  }
11126
11127
  handleServerEvent(e) {
11127
- if (Xn("server_event", e.type, Cr(e)), ["conversation.item.updated", "conversation.item.removed", "conversation.item.stream_finished", "conversation.execution.updated", "conversation.interaction.updated", "conversation.follow_ups.updated"].includes(e.type)) {
11128
+ if (Xn("server_event", e.type, Ar(e)), ["conversation.item.updated", "conversation.item.removed", "conversation.item.stream_finished", "conversation.execution.updated", "conversation.interaction.updated", "conversation.follow_ups.updated"].includes(e.type)) {
11128
11129
  this.conversationObservation?.receive(e);
11129
11130
  return;
11130
11131
  }
@@ -11160,11 +11161,11 @@ class Qa {
11160
11161
  return;
11161
11162
  }
11162
11163
  if (e.type === "conversation.routing") {
11163
- e.sessionId === this.state.sessionId && Er(this.clientRuntime, this.modelClientScopeId, String(e.sessionId), e.turns);
11164
+ e.sessionId === this.state.sessionId && Cr(this.clientRuntime, this.modelClientScopeId, String(e.sessionId), e.turns);
11164
11165
  return;
11165
11166
  }
11166
11167
  if (e.type === "session.updated" || e.type === "conversation.state") {
11167
- Ps(e.session, "id") === this.state.sessionId && (this.updatePersonalModelFromSession(e.session), this.updateAccountFallbackFromSession(e.session), Er(this.clientRuntime, this.modelClientScopeId, this.state.sessionId, e.turns));
11168
+ Ps(e.session, "id") === this.state.sessionId && (this.updatePersonalModelFromSession(e.session), this.updateAccountFallbackFromSession(e.session), Cr(this.clientRuntime, this.modelClientScopeId, this.state.sessionId, e.turns));
11168
11169
  return;
11169
11170
  }
11170
11171
  if (e.type === "tool.call")
@@ -11238,8 +11239,8 @@ class Qa {
11238
11239
  type: "model.history_received",
11239
11240
  clientScopeId: this.modelClientScopeId,
11240
11241
  sessionId: n,
11241
- model: to(o) ? o : void 0
11242
- }), this.state.sessionId === n && this.options.productVariant === "personal" && !this.draftModelExplicit && to(o) && this.draftModel !== o && (this.draftModel = o, this.emit("state", this.getState()));
11242
+ model: no(o) ? o : void 0
11243
+ }), this.state.sessionId === n && this.options.productVariant === "personal" && !this.draftModelExplicit && no(o) && this.draftModel !== o && (this.draftModel = o, this.emit("state", this.getState()));
11243
11244
  }
11244
11245
  updateAccountFallbackFromSession(e) {
11245
11246
  if (!e || typeof e != "object") return;
@@ -11386,7 +11387,7 @@ class Qa {
11386
11387
  this.embeddedRecoveryTimer !== null && window.clearTimeout(this.embeddedRecoveryTimer), this.embeddedRecoveryTimer = null;
11387
11388
  }
11388
11389
  connectionFailureDiagnostic(e, n) {
11389
- const i = e instanceof Ze ? e.status : e instanceof N && e.code === "unauthorized" ? 401 : e instanceof N && /^[45][0-9]{2}$/.test(e.code) ? Number(e.code) : void 0, s = i !== void 0 && Number.isInteger(i) && i >= 400 && i <= 599 ? i : void 0, a = !(e instanceof N && ["unauthorized", "403", "update_required", "executor_replaced"].includes(e.code)) && Pr(e) && s !== 401 && s !== 403;
11390
+ const i = e instanceof Ze ? e.status : e instanceof N && e.code === "unauthorized" ? 401 : e instanceof N && /^[45][0-9]{2}$/.test(e.code) ? Number(e.code) : void 0, s = i !== void 0 && Number.isInteger(i) && i >= 400 && i <= 599 ? i : void 0, a = !(e instanceof N && ["unauthorized", "403", "update_required", "executor_replaced"].includes(e.code)) && qr(e) && s !== 401 && s !== 403;
11390
11391
  return {
11391
11392
  stage: n,
11392
11393
  ...s !== void 0 ? { httpStatus: s } : {},
@@ -11398,7 +11399,7 @@ class Qa {
11398
11399
  if (this.reconnectTimer !== null || this.authenticationFailure || this.state.status === "closed")
11399
11400
  return;
11400
11401
  const n = Math.min(
11401
- Ia,
11402
+ Sa,
11402
11403
  Math.max(oy(this.reconnectAttempts), e)
11403
11404
  );
11404
11405
  this.reconnectAttempts += 1, this.reconnectTimer = window.setTimeout(() => {
@@ -11499,7 +11500,7 @@ class Qa {
11499
11500
  this.directoryHttp.auth.token = c, a = "bootstrap", this.lastRecoveryStage = a, await this.replaceDefaultTransportCredentials(e), this.reportTransportDiagnostic("auth_refresh_validated", o);
11500
11501
  })().catch((c) => {
11501
11502
  if (this.socket !== e || this.state.status === "closed") throw c;
11502
- if (this.reportTransportDiagnostic("auth_refresh_failed", { ...o, ...this.connectionFailureDiagnostic(c, a) }), this.credentialRecoveryFailure = Bi(c), c instanceof N && ["unauthorized", "403", "update_required"].includes(c.code) || !Pr(c)) {
11503
+ if (this.reportTransportDiagnostic("auth_refresh_failed", { ...o, ...this.connectionFailureDiagnostic(c, a) }), this.credentialRecoveryFailure = Bi(c), c instanceof N && ["unauthorized", "403", "update_required"].includes(c.code) || !qr(c)) {
11503
11504
  const l = c instanceof N ? c : new N(c instanceof Ze ? c.message : "Your session could not be refreshed. Try again.", this.options.productVariant === "customer_embedded" ? "connection_failed" : "unauthorized", !1);
11504
11505
  throw this.stopAuthentication(l), l;
11505
11506
  }
@@ -11557,7 +11558,7 @@ class Qa {
11557
11558
  this.listeners[e]?.forEach((s) => s(n));
11558
11559
  }
11559
11560
  }
11560
- const Mr = /* @__PURE__ */ new WeakMap();
11561
+ const Or = /* @__PURE__ */ new WeakMap();
11561
11562
  function ay(t) {
11562
11563
  const e = window.__plunoProductAgentNetworkCapture ?? cy();
11563
11564
  return e.subscribers.add(t), () => {
@@ -11584,8 +11585,8 @@ function cy() {
11584
11585
  const _ = f instanceof Request ? f : null, S = cb(f, _), x = Bu(y?.headers ?? _?.headers);
11585
11586
  if (!Zn(S, x, y?.body)) {
11586
11587
  const w = {
11587
- requestId: Dr("fetch"),
11588
- url: Qt(S, Tr),
11588
+ requestId: Lr("fetch"),
11589
+ url: Qt(S, Pr),
11589
11590
  method: (y?.method ?? _?.method ?? "GET").toUpperCase(),
11590
11591
  requestHeaders: x,
11591
11592
  requestBody: ed(y?.body),
@@ -11616,21 +11617,21 @@ function cy() {
11616
11617
  return b;
11617
11618
  }, r = function(f, y, g, b, _) {
11618
11619
  const S = i.call(this, f, y, g ?? !0, b ?? void 0, _ ?? void 0), x = typeof y == "string" ? y : y.toString();
11619
- return Mr.set(this, {
11620
- requestId: Dr("xhr"),
11620
+ return Or.set(this, {
11621
+ requestId: Lr("xhr"),
11621
11622
  method: String(f ?? "GET").toUpperCase(),
11622
- url: Qt(x, Tr),
11623
+ url: Qt(x, Pr),
11623
11624
  requestHeaders: {},
11624
11625
  startedAtMs: Date.now(),
11625
11626
  startedAt: (/* @__PURE__ */ new Date()).toISOString(),
11626
11627
  excluded: Zn(x)
11627
11628
  }), S;
11628
11629
  }, c = function(f, y) {
11629
- const g = s.call(this, f, y), b = Mr.get(this);
11630
+ const g = s.call(this, f, y), b = Or.get(this);
11630
11631
  return b && Object.keys(b.requestHeaders).length < Ja && (b.requestHeaders[f] = Za(f, y), b.excluded = b.excluded || Zn(b.url, b.requestHeaders)), g;
11631
11632
  }, l = function(f) {
11632
11633
  try {
11633
- const y = Mr.get(this);
11634
+ const y = Or.get(this);
11634
11635
  y && (y.excluded = y.excluded || Zn(y.url, y.requestHeaders, f), y.requestBody = ed(f), y.excluded || this.addEventListener(
11635
11636
  "loadend",
11636
11637
  () => {
@@ -11687,8 +11688,8 @@ function cy() {
11687
11688
  continue;
11688
11689
  const g = performance.timeOrigin + y.startTime;
11689
11690
  e({
11690
- requestId: Dr("resource"),
11691
- url: Qt(y.name, Tr),
11691
+ requestId: Lr("resource"),
11692
+ url: Qt(y.name, Pr),
11692
11693
  method: "GET",
11693
11694
  resourceType: "resource",
11694
11695
  responseStatus: y.responseStatus,
@@ -12002,9 +12003,9 @@ function Ya() {
12002
12003
  (g) => Pu(g) && !g.parentElement?.closest(i)
12003
12004
  );
12004
12005
  for (const g of s.slice(0, 3))
12005
- n("Active overlay", Or(Yi(g), e));
12006
- const o = Ty(), a = o ? Or(Yi(o), e) : "";
12007
- n("Main page content", a), n("Additional visible page text", Or(Yi(document.body), e));
12006
+ n("Active overlay", Dr(Yi(g), e));
12007
+ const o = Ty(), a = o ? Dr(Yi(o), e) : "";
12008
+ n("Main page content", a), n("Additional visible page text", Dr(Yi(document.body), e));
12008
12009
  const r = t.map(([g, b]) => `${g}:
12009
12010
  ${b}`).join(`
12010
12011
 
@@ -12026,7 +12027,7 @@ function ai(t) {
12026
12027
 
12027
12028
  `).trim();
12028
12029
  }
12029
- function Or(t, e) {
12030
+ function Dr(t, e) {
12030
12031
  let n = ai(t);
12031
12032
  for (const i of e)
12032
12033
  n = n.replace(i, "");
@@ -12667,7 +12668,7 @@ function Qy(t, e) {
12667
12668
  }
12668
12669
  function Yy(t) {
12669
12670
  try {
12670
- const e = window.localStorage.getItem(`${Sa}${t}`);
12671
+ const e = window.localStorage.getItem(`${ka}${t}`);
12671
12672
  if (!e)
12672
12673
  return [];
12673
12674
  const n = JSON.parse(e);
@@ -12680,11 +12681,11 @@ function Dn(t, e) {
12680
12681
  try {
12681
12682
  const n = e.filter(Xa);
12682
12683
  if (n.length === 0) {
12683
- window.localStorage.removeItem(`${Sa}${t}`);
12684
+ window.localStorage.removeItem(`${ka}${t}`);
12684
12685
  return;
12685
12686
  }
12686
12687
  window.localStorage.setItem(
12687
- `${Sa}${t}`,
12688
+ `${ka}${t}`,
12688
12689
  JSON.stringify(n.slice(-25))
12689
12690
  );
12690
12691
  } catch {
@@ -12693,7 +12694,7 @@ function Dn(t, e) {
12693
12694
  }
12694
12695
  function Ou(t, e) {
12695
12696
  try {
12696
- const n = `${yo}${t}`, i = location.href, s = location.origin, o = Array.from(e, (a) => ({
12697
+ const n = `${bo}${t}`, i = location.href, s = location.origin, o = Array.from(e, (a) => ({
12697
12698
  ...a,
12698
12699
  storedAt: Date.now(),
12699
12700
  unloadUrl: i,
@@ -12709,7 +12710,7 @@ function Ou(t, e) {
12709
12710
  }
12710
12711
  function Xl(t, e) {
12711
12712
  try {
12712
- if (window.sessionStorage.getItem(`${yo}${t}`) === null)
12713
+ if (window.sessionStorage.getItem(`${bo}${t}`) === null)
12713
12714
  return;
12714
12715
  } catch {
12715
12716
  return;
@@ -12718,7 +12719,7 @@ function Xl(t, e) {
12718
12719
  }
12719
12720
  function Xy(t) {
12720
12721
  try {
12721
- const e = `${yo}${t}`, n = window.sessionStorage.getItem(e);
12722
+ const e = `${bo}${t}`, n = window.sessionStorage.getItem(e);
12722
12723
  if (window.sessionStorage.removeItem(e), !n)
12723
12724
  return [];
12724
12725
  const i = JSON.parse(n);
@@ -12766,7 +12767,7 @@ function tb(t, e) {
12766
12767
  }
12767
12768
  function nb(t) {
12768
12769
  try {
12769
- window.sessionStorage.removeItem(`${yo}${t}`);
12770
+ window.sessionStorage.removeItem(`${bo}${t}`);
12770
12771
  } catch {
12771
12772
  return;
12772
12773
  }
@@ -12881,7 +12882,7 @@ function Bu(t) {
12881
12882
  return e;
12882
12883
  }
12883
12884
  function Za(t, e) {
12884
- return Vu(t) ? bo : Qt(so(e), ty);
12885
+ return Vu(t) ? wo : Qt(oo(e), ty);
12885
12886
  }
12886
12887
  function cb(t, e) {
12887
12888
  return typeof t == "string" ? t : t instanceof URL ? t.toString() : e?.url ?? "";
@@ -12952,11 +12953,11 @@ function td(t) {
12952
12953
  return t;
12953
12954
  const e = t.trim();
12954
12955
  if (!e.startsWith("{") && !e.startsWith("["))
12955
- return so(t);
12956
+ return oo(t);
12956
12957
  try {
12957
12958
  return JSON.stringify(mt(JSON.parse(t)));
12958
12959
  } catch {
12959
- return so(t);
12960
+ return oo(t);
12960
12961
  }
12961
12962
  }
12962
12963
  function ju(t) {
@@ -13010,7 +13011,7 @@ function fb(t) {
13010
13011
  function Qt(t, e = Ga) {
13011
13012
  return t.length <= e ? t : `${t.slice(0, e)}... [truncated ${t.length - e} chars]`;
13012
13013
  }
13013
- function Dr(t) {
13014
+ function Lr(t) {
13014
13015
  return `${t}-${Date.now()}-${Math.random().toString(16).slice(2)}`;
13015
13016
  }
13016
13017
  class Fu extends Error {
@@ -13046,13 +13047,13 @@ function wb(t) {
13046
13047
  function _b(t) {
13047
13048
  return t === 401 || t === 403;
13048
13049
  }
13049
- const bo = "[REDACTED_SECRET]", Yt = "[REDACTED_TOKEN]", vb = "[REDACTED_SIGNED_URL]", Ib = 20, Sb = /^(access_token|accessToken|refresh_token|refreshToken|id_token|idToken|authToken|token|api_key|apiKey|apikey|key|secret|signature|sig|password|passwd|pwd|code|state|session|jwt|csrf|csrfToken|xsrf|xsrfToken)$/i, $u = /\bBearer\s+[A-Za-z0-9._~+/=-]{12,}/gi, Hu = /\bBasic\s+[A-Za-z0-9+/=-]{12,}/gi, Ku = /\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\b/g, Wu = /\b(access_token|accessToken|refresh_token|refreshToken|id_token|idToken|authToken|api_key|apiKey|apikey|client_secret|clientSecret|password|secret|token|jwt|csrf|csrfToken|xsrf|xsrfToken)\b\s*[:=]\s*["']?[^"',&\s}]+/gi, kb = /\bhttps?:\/\/[^\s"'<>]+(?:X-Amz-Signature|X-Goog-Signature|Signature|sig=)[^\s"'<>]*/gi, xb = /\bhttps?:\/\/[^\s"'<>]+/gi, Eb = /[),.;\]]+$/;
13050
+ const wo = "[REDACTED_SECRET]", Yt = "[REDACTED_TOKEN]", vb = "[REDACTED_SIGNED_URL]", Ib = 20, Sb = /^(access_token|accessToken|refresh_token|refreshToken|id_token|idToken|authToken|token|api_key|apiKey|apikey|key|secret|signature|sig|password|passwd|pwd|code|state|session|jwt|csrf|csrfToken|xsrf|xsrfToken)$/i, $u = /\bBearer\s+[A-Za-z0-9._~+/=-]{12,}/gi, Hu = /\bBasic\s+[A-Za-z0-9+/=-]{12,}/gi, Ku = /\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\b/g, Wu = /\b(access_token|accessToken|refresh_token|refreshToken|id_token|idToken|authToken|api_key|apiKey|apikey|client_secret|clientSecret|password|secret|token|jwt|csrf|csrfToken|xsrf|xsrfToken)\b\s*[:=]\s*["']?[^"',&\s}]+/gi, kb = /\bhttps?:\/\/[^\s"'<>]+(?:X-Amz-Signature|X-Goog-Signature|Signature|sig=)[^\s"'<>]*/gi, xb = /\bhttps?:\/\/[^\s"'<>]+/gi, Eb = /[),.;\]]+$/;
13050
13051
  function mt(t) {
13051
- return io(t, 0, /* @__PURE__ */ new WeakSet());
13052
+ return so(t, 0, /* @__PURE__ */ new WeakSet());
13052
13053
  }
13053
- function io(t, e, n) {
13054
+ function so(t, e, n) {
13054
13055
  if (typeof t == "string")
13055
- return t.startsWith("data:image/") || t.startsWith("data:application/pdf;") ? t : so(t);
13056
+ return t.startsWith("data:image/") || t.startsWith("data:application/pdf;") ? t : oo(t);
13056
13057
  if (t === null || typeof t != "object")
13057
13058
  return t;
13058
13059
  if (e >= Ib)
@@ -13060,10 +13061,10 @@ function io(t, e, n) {
13060
13061
  if (n.has(t))
13061
13062
  return "[REDACTED_CIRCULAR]";
13062
13063
  if (n.add(t), Array.isArray(t))
13063
- return t.map((s) => io(s, e + 1, n));
13064
+ return t.map((s) => so(s, e + 1, n));
13064
13065
  const i = {};
13065
13066
  for (const [s, o] of Object.entries(t))
13066
- s === "pageContent" ? i[s] = o : Vu(s) ? i[s] = bo : i[s] = s.toLowerCase() === "url" ? Cb(o) : io(o, e + 1, n);
13067
+ s === "pageContent" ? i[s] = o : Vu(s) ? i[s] = wo : i[s] = s.toLowerCase() === "url" ? Cb(o) : so(o, e + 1, n);
13067
13068
  return i;
13068
13069
  }
13069
13070
  function Vu(t) {
@@ -13071,7 +13072,7 @@ function Vu(t) {
13071
13072
  return e.includes("authorization") || e.includes("cookie") || e.includes("password") || e.includes("passwd") || e === "pwd" || e.includes("secret") || e === "token" || e.endsWith("token") || e.includes("apikey") || e.includes("csrf") || e.includes("xsrf") || e === "jwt" || e === "session" || e === "signature" || e.includes("privatekey");
13072
13073
  }
13073
13074
  function Cb(t) {
13074
- return typeof t == "string" ? Gu(t) : io(t, 0, /* @__PURE__ */ new WeakSet());
13075
+ return typeof t == "string" ? Gu(t) : so(t, 0, /* @__PURE__ */ new WeakSet());
13075
13076
  }
13076
13077
  function Gu(t) {
13077
13078
  try {
@@ -13083,11 +13084,11 @@ function Gu(t) {
13083
13084
  return Ab(t);
13084
13085
  }
13085
13086
  }
13086
- function so(t) {
13087
- return t.replace(kb, vb).replace(xb, Rb).replace($u, `Bearer ${Yt}`).replace(Hu, `Basic ${Yt}`).replace(Ku, Yt).replace(Wu, (e, n) => `${n}: ${bo}`);
13087
+ function oo(t) {
13088
+ return t.replace(kb, vb).replace(xb, Rb).replace($u, `Bearer ${Yt}`).replace(Hu, `Basic ${Yt}`).replace(Ku, Yt).replace(Wu, (e, n) => `${n}: ${wo}`);
13088
13089
  }
13089
13090
  function Ab(t) {
13090
- return t.replace($u, `Bearer ${Yt}`).replace(Hu, `Basic ${Yt}`).replace(Ku, Yt).replace(Wu, (e, n) => `${n}: ${bo}`);
13091
+ return t.replace($u, `Bearer ${Yt}`).replace(Hu, `Basic ${Yt}`).replace(Ku, Yt).replace(Wu, (e, n) => `${n}: ${wo}`);
13091
13092
  }
13092
13093
  function Rb(t) {
13093
13094
  const e = t.match(Eb)?.[0] ?? "", n = e ? t.slice(0, -e.length) : t;
@@ -13095,17 +13096,17 @@ function Rb(t) {
13095
13096
  }
13096
13097
  const Tb = Object.freeze({
13097
13098
  init: (t) => Qa.init(t)
13098
- }), Pb = "#7c3aed", oo = "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", ro = "#2c2a1e", nd = [253, 250, 241], id = 3.5;
13099
+ }), Pb = "#7c3aed", ro = "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", ao = "#2c2a1e", nd = [253, 250, 241], id = 3.5;
13099
13100
  function Ju(t) {
13100
13101
  const e = Qu(t);
13101
13102
  if (sd(Xi(e), nd) >= id)
13102
13103
  return e;
13103
13104
  let i = Xi(e);
13104
- const s = Xi(ro);
13105
+ const s = Xi(ao);
13105
13106
  for (let o = 0; o < 6; o += 1)
13106
13107
  if (i = Ob(i, s, 0.22), sd(i, nd) >= id)
13107
- return ka(i);
13108
- return ka(i);
13108
+ return xa(i);
13109
+ return xa(i);
13109
13110
  }
13110
13111
  function qb() {
13111
13112
  let n = "M 280 120", i = !1, s = 0;
@@ -13116,7 +13117,7 @@ function qb() {
13116
13117
  return n;
13117
13118
  }
13118
13119
  function Mb(t) {
13119
- const e = Qu(t), n = xa(Xi(e));
13120
+ const e = Qu(t), n = Ea(Xi(e));
13120
13121
  return n > 0.86 ? {
13121
13122
  top: "#ffffff",
13122
13123
  middle: "#f6f6f6",
@@ -13163,11 +13164,11 @@ function Xi(t) {
13163
13164
  Number.parseInt(t.slice(5, 7), 16)
13164
13165
  ];
13165
13166
  }
13166
- function ka([t, e, n]) {
13167
+ function xa([t, e, n]) {
13167
13168
  const i = (s) => Math.max(0, Math.min(255, Math.round(s))).toString(16).padStart(2, "0");
13168
13169
  return `#${i(t)}${i(e)}${i(n)}`;
13169
13170
  }
13170
- function xa([t, e, n]) {
13171
+ function Ea([t, e, n]) {
13171
13172
  const i = (s) => {
13172
13173
  const o = s / 255;
13173
13174
  return o <= 0.04045 ? o / 12.92 : ((o + 0.055) / 1.055) ** 2.4;
@@ -13175,11 +13176,11 @@ function xa([t, e, n]) {
13175
13176
  return 0.2126 * i(t) + 0.7152 * i(e) + 0.0722 * i(n);
13176
13177
  }
13177
13178
  function sd(t, e) {
13178
- const n = xa(t), i = xa(e), [s, o] = n > i ? [n, i] : [i, n];
13179
+ const n = Ea(t), i = Ea(e), [s, o] = n > i ? [n, i] : [i, n];
13179
13180
  return (s + 0.05) / (o + 0.05);
13180
13181
  }
13181
13182
  function Ob(t, e, n) {
13182
- const i = Ea(n);
13183
+ const i = Ca(n);
13183
13184
  return [
13184
13185
  t[0] + (e[0] - t[0]) * i,
13185
13186
  t[1] + (e[1] - t[1]) * i,
@@ -13188,7 +13189,7 @@ function Ob(t, e, n) {
13188
13189
  }
13189
13190
  function Dt(t, e, n) {
13190
13191
  const [i, s, o] = Db(Xi(t));
13191
- return ka(Lb(i, Ea(s + n), Ea(o + e)));
13192
+ return xa(Lb(i, Ca(s + n), Ca(o + e)));
13192
13193
  }
13193
13194
  function Db([t, e, n]) {
13194
13195
  const i = t / 255, s = e / 255, o = n / 255, a = Math.max(i, s, o), r = Math.min(i, s, o), c = (a + r) / 2;
@@ -13202,16 +13203,16 @@ function Lb(t, e, n) {
13202
13203
  return [n * 255, n * 255, n * 255];
13203
13204
  const i = n < 0.5 ? n * (1 + e) : n + e - n * e, s = 2 * n - i;
13204
13205
  return [
13205
- Lr(s, i, t + 1 / 3) * 255,
13206
- Lr(s, i, t) * 255,
13207
- Lr(s, i, t - 1 / 3) * 255
13206
+ Nr(s, i, t + 1 / 3) * 255,
13207
+ Nr(s, i, t) * 255,
13208
+ Nr(s, i, t - 1 / 3) * 255
13208
13209
  ];
13209
13210
  }
13210
- function Lr(t, e, n) {
13211
+ function Nr(t, e, n) {
13211
13212
  let i = n;
13212
13213
  return i < 0 && (i += 1), i > 1 && (i -= 1), i < 1 / 6 ? t + (e - t) * 6 * i : i < 1 / 2 ? e : i < 2 / 3 ? t + (e - t) * (2 / 3 - i) * 6 : t;
13213
13214
  }
13214
- function Ea(t) {
13215
+ function Ca(t) {
13215
13216
  return Math.max(0, Math.min(1, t));
13216
13217
  }
13217
13218
  const Yu = [
@@ -13304,7 +13305,7 @@ function Kb(t, e) {
13304
13305
  (i, s) => e && s === n && !i.terminal
13305
13306
  );
13306
13307
  }
13307
- const Wb = 80, Vb = 64e3, rd = 60, Nr = 160;
13308
+ const Wb = 80, Vb = 64e3, rd = 60, Ur = 160;
13308
13309
  function Gb(t, e, n, i) {
13309
13310
  const s = /* @__PURE__ */ new Map(), o = [], a = [];
13310
13311
  let r = 0, c = 0, l = 0, u = crypto.randomUUID(), d = i.getState();
@@ -13330,7 +13331,7 @@ function Gb(t, e, n, i) {
13330
13331
  Oe(), C = null, U !== null && _.clearTimeout(U), U = null, S = void 0, x = void 0, m.clear(), T.clear(), k !== null && _.clearTimeout(k), k = null, V && E.clear();
13331
13332
  }
13332
13333
  function Ae() {
13333
- if (Js(e) !== "none") {
13334
+ if (Qs(e) !== "none") {
13334
13335
  we(!0);
13335
13336
  return;
13336
13337
  }
@@ -13404,14 +13405,14 @@ function Gb(t, e, n, i) {
13404
13405
  J.before && (J.before.context = x);
13405
13406
  const H = Math.floor(X - $.monotonicMs);
13406
13407
  J.current.context = {
13407
- ...Qr(e, d, { renderSource: "observer" }),
13408
+ ...Yr(e, d, { renderSource: "observer" }),
13408
13409
  firstObservedAt: $.occurredAt,
13409
13410
  confirmationMs: H
13410
13411
  }, i.reportInvalidStateTransition?.(`ui_invariant:${D}`, void 0, J);
13411
13412
  } else
13412
13413
  T.set(D, $);
13413
13414
  }
13414
- ce.length === 0 && P && (S = De, x = Qr(e, d, { renderSource: "observer" }), m = new Map(Array.from(e.querySelectorAll("[data-terminal-response-key][data-canonical-item-key]")).map((D) => [D.dataset.terminalResponseKey, D.dataset.canonicalItemKey]))), k !== null && _.clearTimeout(k), k = T.size ? _.setTimeout(() => {
13415
+ ce.length === 0 && P && (S = De, x = Yr(e, d, { renderSource: "observer" }), m = new Map(Array.from(e.querySelectorAll("[data-terminal-response-key][data-canonical-item-key]")).map((D) => [D.dataset.terminalResponseKey, D.dataset.canonicalItemKey]))), k !== null && _.clearTimeout(k), k = T.size ? _.setTimeout(() => {
13415
13416
  k = null, Ae();
13416
13417
  }, Math.max(1, 250 - (X - Math.min(...Array.from(T.values(), (D) => D.monotonicMs))))) : null;
13417
13418
  }
@@ -13419,17 +13420,17 @@ function Gb(t, e, n, i) {
13419
13420
  const oe = V !== "runtime", K = oe ? e.querySelectorAll("[data-message-key], [data-entry-key][data-message-role]") : null, ie = K?.length ?? d.messages.length, ye = [];
13420
13421
  for (let Y = Math.max(0, ie - rd); Y < ie; Y += 1) {
13421
13422
  const X = K ? K[Y].dataset.messageKey ?? K[Y].dataset.entryKey : d.messages[Y].id;
13422
- X && ye.push(X.slice(0, Nr));
13423
+ X && ye.push(X.slice(0, Ur));
13423
13424
  }
13424
13425
  const G = {
13425
- session_id: d.sessionId?.slice(0, Nr) ?? null,
13426
- run_id: (d.assistantDraftRunId ?? d.messages[d.messages.length - 1]?.runId)?.slice(0, Nr) ?? null,
13426
+ session_id: d.sessionId?.slice(0, Ur) ?? null,
13427
+ run_id: (d.assistantDraftRunId ?? d.messages[d.messages.length - 1]?.runId)?.slice(0, Ur) ?? null,
13427
13428
  item_keys: ye,
13428
13429
  item_count: ie,
13429
13430
  items_truncated: ie > rd,
13430
13431
  thinking: d.isThinking,
13431
13432
  loading: d.isLoadingSession,
13432
- welcome: oe && Js(e) === "none" && !!e.querySelector(".pluno-pa-widget__empty-state--starter, .empty-state--starter"),
13433
+ welcome: oe && Qs(e) === "none" && !!e.querySelector(".pluno-pa-widget__empty-state--starter, .empty-state--starter"),
13433
13434
  error: !!d.lastError,
13434
13435
  connected: d.status === "connected",
13435
13436
  visible: e.getClientRects().length > 0,
@@ -13526,7 +13527,7 @@ function Gb(t, e, n, i) {
13526
13527
  }
13527
13528
  const Jb = 6e4, Qb = [100, 500, 1500, 4e3];
13528
13529
  let Yb = 0;
13529
- const Xb = "product-agent:sdk-preview-socket-connect", Zb = "product-agent:sdk-preview-socket-send", ew = "product-agent:sdk-preview-socket-close", tw = "product-agent:sdk-preview-socket-open", nw = "product-agent:sdk-preview-socket-message", iw = "product-agent:sdk-preview-socket-error", sw = "product-agent:sdk-preview-socket-closed", ad = "product-agent:sdk-preview-socket-id", Xu = "data-pluno-auto-mounted", Kt = "__plunoProductAgentAutoMountOwner", ow = "pluno.productAgent.widgetClientId.", Ur = /* @__PURE__ */ new Set(), rw = "product-agent:preview-diagnostic", aw = 3, cd = 'dialog[open], [aria-modal="true"], [role="dialog"]', ld = 1500, cw = 5e3, lw = 500, dw = "Could not load recent chats. Please try again.", Wt = {
13530
+ const Xb = "product-agent:sdk-preview-socket-connect", Zb = "product-agent:sdk-preview-socket-send", ew = "product-agent:sdk-preview-socket-close", tw = "product-agent:sdk-preview-socket-open", nw = "product-agent:sdk-preview-socket-message", iw = "product-agent:sdk-preview-socket-error", sw = "product-agent:sdk-preview-socket-closed", ad = "product-agent:sdk-preview-socket-id", Xu = "data-pluno-auto-mounted", Kt = "__plunoProductAgentAutoMountOwner", ow = "pluno.productAgent.widgetClientId.", zr = /* @__PURE__ */ new Set(), rw = "product-agent:preview-diagnostic", aw = 3, cd = 'dialog[open], [aria-modal="true"], [role="dialog"]', ld = 1500, cw = 5e3, lw = 500, dw = "Could not load recent chats. Please try again.", Wt = {
13530
13531
  launcherLabel: "Ask for anything...",
13531
13532
  accentColor: "#7c3aed",
13532
13533
  colorScheme: "light",
@@ -13534,7 +13535,7 @@ const Xb = "product-agent:sdk-preview-socket-connect", Zb = "product-agent:sdk-p
13534
13535
  scribbleStyle: !0,
13535
13536
  position: "bottom-right",
13536
13537
  movableLauncher: !0
13537
- }, uw = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive', dd = "pluno-pa-scribble-font", Zu = 190, ep = 41, pw = 22, hw = 32, gw = 1, fw = 48, ec = 420, mw = 520, yw = 0.24, tc = 680, bw = 800, ww = 0.76, ge = 8, Vn = 50, Ca = 12, tp = "http://www.w3.org/2000/svg", Aa = 26, Ra = 8, _w = 36, Ta = 16, vw = 4, ud = [
13538
+ }, uw = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive', dd = "pluno-pa-scribble-font", Zu = 190, ep = 41, pw = 22, hw = 32, gw = 1, fw = 48, ec = 420, mw = 520, yw = 0.24, tc = 680, bw = 800, ww = 0.76, ge = 8, Vn = 50, Aa = 12, tp = "http://www.w3.org/2000/svg", Ra = 26, Ta = 8, _w = 36, Pa = 16, vw = 4, ud = [
13538
13539
  {
13539
13540
  ellipseCx: "17.5",
13540
13541
  ellipseCy: "24.5",
@@ -13571,7 +13572,7 @@ const Xb = "product-agent:sdk-preview-socket-connect", Zb = "product-agent:sdk-p
13571
13572
  path: "M18.7 26.8 C21 11.2, 7.1 1.6, 6.3 18.1",
13572
13573
  pathStrokeWidth: "2.45"
13573
13574
  }
13574
- ], Iw = 11, Sw = 13, ao = 4, nc = 10, ic = 40, kw = "movable-launcher-position-v2", np = "pluno-pa-widget-styles", ip = "data-pluno-pa-widget-styles", xw = "__plunoExtensionWidgetOwner";
13575
+ ], Iw = 11, Sw = 13, co = 4, nc = 10, ic = 40, kw = "movable-launcher-position-v2", np = "pluno-pa-widget-styles", ip = "data-pluno-pa-widget-styles", xw = "__plunoExtensionWidgetOwner";
13575
13576
  let pd = 0;
13576
13577
  function Ew(t) {
13577
13578
  return (e) => new Vt(e, t);
@@ -13691,7 +13692,7 @@ async function Cw(t = {}) {
13691
13692
  `${e.mobilePanelTopOffset}px`
13692
13693
  ), l.classList.add(`pluno-pa-widget--${e.colorScheme}`), e.scribbleStyle && l.classList.add("pluno-pa-widget--scribble"), p === "minimized" && (l.classList.add("pluno-pa-widget--minimized"), hn(
13693
13694
  l,
13694
- Br(
13695
+ jr(
13695
13696
  l,
13696
13697
  f,
13697
13698
  e.position
@@ -13854,18 +13855,18 @@ async function Cw(t = {}) {
13854
13855
  st === "error"
13855
13856
  ), ss();
13856
13857
  };
13857
- let Io = !1;
13858
- const So = () => {
13858
+ let So = !1;
13859
+ const ko = () => {
13859
13860
  if (i()) {
13860
13861
  te.hidden = !0, te.replaceChildren();
13861
13862
  return;
13862
13863
  }
13863
- e.billingStatus?.usingPaidCreditFallback !== !0 && (Io = !1), __(
13864
+ e.billingStatus?.usingPaidCreditFallback !== !0 && (So = !1), __(
13864
13865
  te,
13865
13866
  e.billingStatus,
13866
- Io,
13867
+ So,
13867
13868
  () => {
13868
- Io = !0, So();
13869
+ So = !0, ko();
13869
13870
  }
13870
13871
  );
13871
13872
  };
@@ -13878,7 +13879,7 @@ async function Cw(t = {}) {
13878
13879
  let St = 0, en = 0, uc = 0;
13879
13880
  const qt = /* @__PURE__ */ new Map();
13880
13881
  let tn = null, Bt = null;
13881
- const ko = (h) => h === F ? "widget_composer" : h === I ? "widget_launcher" : h && c.contains(h) ? "widget_control" : h === x.body ? "body" : h === x.documentElement ? "document" : h ? "host_page" : "none", _n = (h, v, A = {}) => {
13882
+ const xo = (h) => h === F ? "widget_composer" : h === I ? "widget_launcher" : h && c.contains(h) ? "widget_control" : h === x.body ? "body" : h === x.documentElement ? "document" : h ? "host_page" : "none", _n = (h, v, A = {}) => {
13882
13883
  const R = qs(x), j = A.skipIfAlreadyFocused === !0 && R === h;
13883
13884
  j || (A.preventScroll ? h.focus({ preventScroll: !0 }) : h.focus());
13884
13885
  const ee = qs(x);
@@ -13890,9 +13891,9 @@ async function Cw(t = {}) {
13890
13891
  mountId: o,
13891
13892
  widgetAgeMs: Date.now() - a,
13892
13893
  scheduledDelayMs: A.scheduledAt === void 0 ? null : Date.now() - A.scheduledAt,
13893
- previousFocus: ko(R),
13894
- requestedFocus: ko(h),
13895
- resultingFocus: ko(ee),
13894
+ previousFocus: xo(R),
13895
+ requestedFocus: xo(h),
13896
+ resultingFocus: xo(ee),
13896
13897
  focusSkipped: j,
13897
13898
  focusSucceeded: ee === h,
13898
13899
  hostConnected: r.isConnected,
@@ -13922,7 +13923,7 @@ async function Cw(t = {}) {
13922
13923
  ) : void 0);
13923
13924
  if (!e.loginRequired && !e.signupRequired && !e.token && !pc && !e.webSocketFactory && !e.runtimeClient)
13924
13925
  throw new Error("Pluno widget requires token or tokenEndpoint");
13925
- const xo = e.runtimeClient === void 0, Eo = xo ? iv(e.clientId) : null;
13926
+ const Eo = e.runtimeClient === void 0, Co = Eo ? iv(e.clientId) : null;
13926
13927
  let O;
13927
13928
  try {
13928
13929
  if (e.runtimeClient)
@@ -13940,7 +13941,7 @@ async function Cw(t = {}) {
13940
13941
  }),
13941
13942
  entrySurface: e.entrySurface ?? (e.extensionRuntime ? "extension_widget" : "embedded_widget"),
13942
13943
  initialStarterPrompts: e.initialStarterPrompts,
13943
- clientId: Eo.clientId,
13944
+ clientId: Co.clientId,
13944
13945
  restorePersistedState: e.restorePersistedState,
13945
13946
  expectedPersistedSessionId: e.expectedPersistedSessionId,
13946
13947
  runtimeCommunityId: e.runtimeCommunityId,
@@ -13986,22 +13987,22 @@ async function Cw(t = {}) {
13986
13987
  O = await Tb.init(h);
13987
13988
  }
13988
13989
  } catch (h) {
13989
- throw Eo?.release(), r.remove(), h;
13990
+ throw Co?.release(), r.remove(), h;
13990
13991
  }
13991
13992
  let pi = O.getState().sessionId, hi = O.getState().selectionKey, vn = O.getState().user?.id ?? null;
13992
- const Co = (e.productVariant === "personal" ? Nn(e.model) : e.model) ?? (e.productVariant === "personal" ? Qi[0].value : "gpt-5.6-terra");
13993
- let ot = Co, hc = !1, Ao = O.getAccount()?.auth?.workspace?.id ?? null;
13993
+ const Ao = (e.productVariant === "personal" ? Nn(e.model) : e.model) ?? (e.productVariant === "personal" ? Qi[0].value : "gpt-6.1-sol");
13994
+ let ot = Ao, hc = !1, Ro = O.getAccount()?.auth?.workspace?.id ?? null;
13994
13995
  const gc = e.productVariant === "personal" && e.onModelChange !== void 0;
13995
13996
  Z.hidden = !gc;
13996
13997
  const gi = () => {
13997
- const h = Qs.find((v) => v.value === ot);
13998
+ const h = Ys.find((v) => v.value === ot);
13998
13999
  nt.textContent = h?.label ?? ot;
13999
14000
  for (const v of Ge) {
14000
14001
  const A = v.dataset.model === ot;
14001
14002
  v.classList.toggle("is-selected", A), v.setAttribute("aria-selected", String(A));
14002
14003
  }
14003
14004
  }, xp = (h) => {
14004
- ot = h, xo && O.setModel(h), gi();
14005
+ ot = h, Eo && O.setModel(h), gi();
14005
14006
  };
14006
14007
  gi(), Z.addEventListener("toggle", () => {
14007
14008
  Z.open || Z.querySelector(".pluno-pa-widget__model-more")?.removeAttribute("open");
@@ -14012,7 +14013,7 @@ async function Cw(t = {}) {
14012
14013
  x.addEventListener("pointerdown", fc, !0);
14013
14014
  for (const h of Ge)
14014
14015
  h.addEventListener("click", () => {
14015
- const v = Qs.find((A) => A.value === h.dataset.model);
14016
+ const v = Ys.find((A) => A.value === h.dataset.model);
14016
14017
  if (!v || v.value === ot) {
14017
14018
  Z.open = !1;
14018
14019
  return;
@@ -14034,46 +14035,46 @@ async function Cw(t = {}) {
14034
14035
  cssAccent: l.style.getPropertyValue("--pluno-pa-accent")
14035
14036
  }
14036
14037
  );
14037
- const Ro = new Set(d.openToolGroupKeys);
14038
+ const To = new Set(d.openToolGroupKeys);
14038
14039
  let kt = null, sn = null, Ue = !1, on = !1, jt = {
14039
14040
  enabled: !0
14040
- }, rn = 0, To = null, In = null, Sn = null, rs = null, fi = !1, be = null, mc = "local";
14041
+ }, rn = 0, Po = null, In = null, Sn = null, rs = null, fi = !1, be = null, mc = "local";
14041
14042
  const yc = (h) => pi !== null && pi !== h.sessionId || vn !== null && vn !== (h.user?.id ?? null) || hi !== void 0 && hi !== h.selectionKey, bc = (h) => dh(G, h, {
14042
14043
  renderSource: mc,
14043
14044
  guardCreatedAt: be?.createdAt ?? null,
14044
14045
  selectionFencePending: yc(h)
14045
14046
  }), as = /* @__PURE__ */ new Set();
14046
- let mi = "", He = !1, pt = null, wc = location.origin, _c = O.getState().sessionId, vc = O.getState().user?.id ?? null, Po = O.getState().status, Ft = () => {
14047
- }, qo = "", Qe = O.getSessionHistoryState();
14047
+ let mi = "", He = !1, pt = null, wc = location.origin, _c = O.getState().sessionId, vc = O.getState().user?.id ?? null, qo = O.getState().status, Ft = () => {
14048
+ }, Mo = "", Qe = O.getSessionHistoryState();
14048
14049
  const Ep = O.subscribeSessionHistory((h) => {
14049
14050
  Qe = h, Ue || Ft();
14050
14051
  }), ht = (h, v) => {
14051
14052
  jt = { enabled: h, reason: v };
14052
14053
  }, xt = () => {
14053
14054
  ie.hidden = !0;
14054
- }, Mo = () => {
14055
+ }, Oo = () => {
14055
14056
  G.clientHeight === 0 || G.scrollHeight - G.scrollTop - G.clientHeight > 1 || (ht(!0, "bottom"), xt());
14056
- }, Oo = (h, v, A) => {
14057
+ }, Do = (h, v, A) => {
14057
14058
  const R = `${h}:${v ?? "current-view"}`;
14058
14059
  as.has(R) || (as.add(R), O.reportInvalidStateTransition?.(h, v, A));
14059
14060
  }, Cp = () => {
14060
- rg(fi, Oo), ie.hidden = !1;
14061
+ rg(fi, Do), ie.hidden = !1;
14061
14062
  }, Ic = () => {
14062
- be?.observedConversation && G.querySelector(".pluno-pa-widget__empty-state--starter:not(.pluno-pa-widget__empty-state--morning-report)") && (be.observedWelcome ??= bc(O.getState())), be?.observedWelcome && !be.pendingSubmission && (Oo("submitted_turn_returned_to_welcome_without_new_chat", be.clientMessageId, {
14063
+ be?.observedConversation && G.querySelector(".pluno-pa-widget__empty-state--starter:not(.pluno-pa-widget__empty-state--morning-report)") && (be.observedWelcome ??= bc(O.getState())), be?.observedWelcome && !be.pendingSubmission && (Do("submitted_turn_returned_to_welcome_without_new_chat", be.clientMessageId, {
14063
14064
  before: be.observedConversation,
14064
14065
  current: be.observedWelcome
14065
14066
  }), be = null);
14066
14067
  }, Ap = (h = "jump") => {
14067
14068
  ht(!0, h), xt(), ei(G, () => jt.enabled), rn = G.scrollTop;
14068
14069
  }, cs = (h) => {
14069
- To = h, h === "up" && G.scrollTop < rn - 1 && (fi = !0, ht(!1, "userScroll")), In !== null && window.clearTimeout(In), In = window.setTimeout(() => {
14070
- To = null, In = null;
14070
+ Po = h, h === "up" && G.scrollTop < rn - 1 && (fi = !0, ht(!1, "userScroll")), In !== null && window.clearTimeout(In), In = window.setTimeout(() => {
14071
+ Po = null, In = null;
14071
14072
  }, 500);
14072
14073
  };
14073
14074
  Ft = () => {
14074
14075
  const h = gh(Qe.data), v = Qe.status === "loading" || Qe.status === "refreshing" || Qe.status === "loading_more";
14075
14076
  if (ve.hidden = e.layout === "page" || i(), i() && (He = !1), it.hidden = !He, ve.setAttribute("aria-expanded", String(He)), !He) {
14076
- qo = "";
14077
+ Mo = "";
14077
14078
  return;
14078
14079
  }
14079
14080
  const A = JSON.stringify([
@@ -14082,8 +14083,8 @@ async function Cw(t = {}) {
14082
14083
  O.getState().sessionId,
14083
14084
  h.map((R) => vd(R.lastActiveAt, Date.now()))
14084
14085
  ]);
14085
- if (A !== qo) {
14086
- if (qo = A, V.classList.toggle(
14086
+ if (A !== Mo) {
14087
+ if (Mo = A, V.classList.toggle(
14087
14088
  "pluno-pa-widget__history-list--center",
14088
14089
  v && h.length === 0
14089
14090
  ), V.replaceChildren(), v && h.length === 0) {
@@ -14114,7 +14115,7 @@ async function Cw(t = {}) {
14114
14115
  oe.textContent = (Qe.status === "error" ? dw : null) ?? (!v && h.length === 0 ? "No recent chats for this page yet." : ""), oe.hidden = oe.textContent.length === 0, oe.classList.toggle("pluno-pa-widget__history-error", Qe.status === "error"), K.hidden = Qe.status !== "error", K.disabled = v;
14115
14116
  }
14116
14117
  };
14117
- const Do = (h = !1) => {
14118
+ const Lo = (h = !1) => {
14118
14119
  if (pt !== null && (window.clearTimeout(pt), pt = null), !(e.layout === "page" || e.loginRequired || e.signupRequired || ke || !h && O.getState().status !== "connected"))
14119
14120
  return ke = !0, O.refreshSessionHistory().catch(() => {
14120
14121
  }).finally(() => {
@@ -14122,13 +14123,13 @@ async function Cw(t = {}) {
14122
14123
  });
14123
14124
  };
14124
14125
  K.addEventListener("click", () => {
14125
- K.disabled = !0, Promise.resolve(Do(!0)).finally(() => {
14126
+ K.disabled = !0, Promise.resolve(Lo(!0)).finally(() => {
14126
14127
  K.disabled = !1;
14127
14128
  });
14128
14129
  });
14129
- const Lo = () => {
14130
+ const No = () => {
14130
14131
  pt === null && (pt = window.setTimeout(() => {
14131
- pt = null, !(Ue || !l.classList.contains("pluno-pa-widget--open")) && Do();
14132
+ pt = null, !(Ue || !l.classList.contains("pluno-pa-widget--open")) && Lo();
14132
14133
  }, 0));
14133
14134
  }, Rp = () => {
14134
14135
  const h = Qe.data?.nextCursor ?? null;
@@ -14155,7 +14156,7 @@ async function Cw(t = {}) {
14155
14156
  ov(e, {
14156
14157
  isOpen: l.classList.contains("pluno-pa-widget--open"),
14157
14158
  composerValue: F.value,
14158
- openToolGroupKeys: [...Ro],
14159
+ openToolGroupKeys: [...To],
14159
14160
  launcherPosition: y ? f : null,
14160
14161
  panelSize: g
14161
14162
  });
@@ -14169,7 +14170,7 @@ async function Cw(t = {}) {
14169
14170
  }
14170
14171
  kt !== null && (window.clearTimeout(kt), kt = null), l.classList.remove("pluno-pa-widget--open"), l.classList.remove("pluno-pa-widget--closing"), l.classList.add("pluno-pa-widget--minimized"), m.hidden = !1, m.setAttribute("role", "button"), m.setAttribute("aria-label", "Open Pluno"), k.hidden = !0, B.hidden = !0, m.tabIndex = 0, F.value = "", dt(), hn(
14171
14172
  l,
14172
- Br(
14173
+ jr(
14173
14174
  l,
14174
14175
  f,
14175
14176
  e.position
@@ -14186,9 +14187,9 @@ async function Cw(t = {}) {
14186
14187
  right: l.style.right,
14187
14188
  bottom: l.style.bottom
14188
14189
  },
14189
- rootRect: $r(l),
14190
- launcherRect: $r(m),
14191
- panelRect: $r(k),
14190
+ rootRect: Hr(l),
14191
+ launcherRect: Hr(m),
14192
+ panelRect: Hr(k),
14192
14193
  viewport: tt(),
14193
14194
  panelHidden: k.hidden,
14194
14195
  closeHidden: B.hidden,
@@ -14213,14 +14214,14 @@ async function Cw(t = {}) {
14213
14214
  x: h.x - v.x,
14214
14215
  y: h.y - v.y
14215
14216
  });
14216
- }, No = () => {
14217
+ }, Uo = () => {
14217
14218
  const h = zn(g).width;
14218
14219
  return k.getBoundingClientRect().width || h;
14219
14220
  }, xc = () => {
14220
14221
  if (l.classList.contains("pluno-pa-widget--minimized")) {
14221
14222
  hn(
14222
14223
  l,
14223
- Br(
14224
+ jr(
14224
14225
  l,
14225
14226
  f,
14226
14227
  e.position
@@ -14230,14 +14231,14 @@ async function Cw(t = {}) {
14230
14231
  }
14231
14232
  const h = wi();
14232
14233
  if (l.classList.contains("pluno-pa-widget--open") || l.classList.contains("pluno-pa-widget--closing")) {
14233
- zr(l, g);
14234
+ Br(l, g);
14234
14235
  const v = zn(g);
14235
- Hr(
14236
+ Kr(
14236
14237
  q,
14237
- No()
14238
+ Uo()
14238
14239
  );
14239
14240
  const A = Gi(
14240
- b ? Gs(b, v) : Fr(
14241
+ b ? Gs(b, v) : $r(
14241
14242
  l,
14242
14243
  h,
14243
14244
  e.position,
@@ -14267,7 +14268,7 @@ async function Cw(t = {}) {
14267
14268
  h,
14268
14269
  A
14269
14270
  );
14270
- f = jr(
14271
+ f = Fr(
14271
14272
  R,
14272
14273
  A
14273
14274
  ), b = null, hn(l, R), ss(), kn("Dragging closed launcher", {
@@ -14277,12 +14278,12 @@ async function Cw(t = {}) {
14277
14278
  persist: () => {
14278
14279
  y = !0, Ye(), kn("Persisted closed launcher drag position");
14279
14280
  }
14280
- })) : hn(l, null), zr(l, g);
14281
+ })) : hn(l, null), Br(l, g);
14281
14282
  const Cc = () => {
14282
14283
  const h = zn(g), v = yi();
14283
14284
  return {
14284
14285
  position: Gi(
14285
- b ? Gs(b, h) : Fr(
14286
+ b ? Gs(b, h) : $r(
14286
14287
  l,
14287
14288
  v,
14288
14289
  e.position,
@@ -14293,15 +14294,15 @@ async function Cw(t = {}) {
14293
14294
  size: h
14294
14295
  };
14295
14296
  }, Tp = (h) => {
14296
- g = wo(h.size), zr(l, g), Hr(
14297
+ g = _o(h.size), Br(l, g), Kr(
14297
14298
  q,
14298
- No()
14299
+ Uo()
14299
14300
  );
14300
14301
  const v = Gi(
14301
14302
  h.position,
14302
14303
  zn(g)
14303
14304
  );
14304
- b = jr(
14305
+ b = Fr(
14305
14306
  v,
14306
14307
  zn(g)
14307
14308
  );
@@ -14321,7 +14322,7 @@ async function Cw(t = {}) {
14321
14322
  ),
14322
14323
  R
14323
14324
  );
14324
- f = jr(
14325
+ f = Fr(
14325
14326
  j,
14326
14327
  R
14327
14328
  ), y = !0, b = null, hn(l, j), ds(A, j);
@@ -14347,28 +14348,28 @@ async function Cw(t = {}) {
14347
14348
  En.type = "button", En.className = "pluno-pa-widget__error-retry";
14348
14349
  const Ac = bn(), Rc = document.createTextNode("Try again");
14349
14350
  En.append(Ac, Rc), _i.append("Pluno could not load your account. Try again.", En), Oe.after(xn);
14350
- let Uo = !1, Cn = !1;
14351
- const zo = () => {
14351
+ let zo = !1, Cn = !1;
14352
+ const Bo = () => {
14352
14353
  const h = O.getState().status === "error" && ["unauthorized", "invalid_token", "update_required"].includes(O.getState().lastErrorCode ?? ""), v = !!e.billingStatus && e.billingStatus?.submissionGate?.reason !== "connection_required";
14353
- xn.hidden = h || O.getState().status !== "connected" || !Uo || v || e.productVariant !== "personal" || i(), xn.hidden ? _i.remove() : _i.parentElement !== xn && xn.append(_i), En.disabled = Cn, En.setAttribute("aria-busy", String(Cn)), Ac.hidden = !Cn, Rc.data = Cn ? "Trying" : "Try again";
14354
- }, Bo = async () => {
14354
+ xn.hidden = h || O.getState().status !== "connected" || !zo || v || e.productVariant !== "personal" || i(), xn.hidden ? _i.remove() : _i.parentElement !== xn && xn.append(_i), En.disabled = Cn, En.setAttribute("aria-busy", String(Cn)), Ac.hidden = !Cn, Rc.data = Cn ? "Trying" : "Try again";
14355
+ }, jo = async () => {
14355
14356
  if (!(Cn || Ue)) {
14356
- Cn = !0, zo();
14357
+ Cn = !0, Bo();
14357
14358
  try {
14358
- await O.refreshAccount(), Uo = !1;
14359
+ await O.refreshAccount(), zo = !1;
14359
14360
  } catch (h) {
14360
- Uo = !0, at(
14361
+ zo = !0, at(
14361
14362
  "web-sdk.widget",
14362
14363
  "Failed to refresh billing status",
14363
14364
  Ln(h)
14364
14365
  );
14365
14366
  } finally {
14366
- Cn = !1, Ue || zo();
14367
+ Cn = !1, Ue || Bo();
14367
14368
  }
14368
14369
  }
14369
14370
  };
14370
14371
  En.addEventListener("click", () => {
14371
- Bo();
14372
+ jo();
14372
14373
  });
14373
14374
  let vi = null;
14374
14375
  const Tc = (h) => {
@@ -14384,11 +14385,11 @@ async function Cw(t = {}) {
14384
14385
  }));
14385
14386
  }, Mt = (h = "", v = !0, A = !0, R = !0, j = "external_request") => {
14386
14387
  const ee = l.classList.contains("pluno-pa-widget--open") || !k.hidden && !l.classList.contains("pluno-pa-widget--closing");
14387
- !ee && R && Tc("panel_open"), Bo(), ki && (ki = !1, Ko()), l.classList.contains("pluno-pa-widget--open") || (b = null), kt !== null && (window.clearTimeout(kt), kt = null), bi("shown", !1), k.hidden = !1, B.hidden = !1, Hr(
14388
+ !ee && R && Tc("panel_open"), jo(), ki && (ki = !1, Wo()), l.classList.contains("pluno-pa-widget--open") || (b = null), kt !== null && (window.clearTimeout(kt), kt = null), bi("shown", !1), k.hidden = !1, B.hidden = !1, Kr(
14388
14389
  q,
14389
- No()
14390
+ Uo()
14390
14391
  ), l.classList.remove("pluno-pa-widget--closing"), dt();
14391
- const he = wi(), Ie = Fr(
14392
+ const he = wi(), Ie = $r(
14392
14393
  l,
14393
14394
  he,
14394
14395
  e.position,
@@ -14398,18 +14399,18 @@ async function Cw(t = {}) {
14398
14399
  openPanelPosition: Ie,
14399
14400
  visibleLauncherPosition: he
14400
14401
  }), ht(!0, "open"), xt(), !ee && e.layout === "floating" && O.recordWidgetLifecycle("opened", j), !v) {
14401
- l.classList.add("pluno-pa-widget--open"), ee || Lo(), m.hidden = !0, h && (F.value = h, Fi(F)), ei(G, () => jt.enabled), rn = G.scrollTop, A && (_n(F, "panel_open_immediate"), F.setSelectionRange(F.value.length, F.value.length)), Ye(), ls("shown", j), e.onPanelOpenChange?.(!0, j);
14402
+ l.classList.add("pluno-pa-widget--open"), ee || No(), m.hidden = !0, h && (F.value = h, Fi(F)), ei(G, () => jt.enabled), rn = G.scrollTop, A && (_n(F, "panel_open_immediate"), F.setSelectionRange(F.value.length, F.value.length)), Ye(), ls("shown", j), e.onPanelOpenChange?.(!0, j);
14402
14403
  return;
14403
14404
  }
14404
14405
  const gt = Date.now();
14405
14406
  window.requestAnimationFrame(() => {
14406
- l.classList.add("pluno-pa-widget--open"), ee || Lo(), h && (F.value = h, Fi(F)), ei(G, () => jt.enabled), rn = G.scrollTop, A && (_n(F, "panel_open_animation", {
14407
+ l.classList.add("pluno-pa-widget--open"), ee || No(), h && (F.value = h, Fi(F)), ei(G, () => jt.enabled), rn = G.scrollTop, A && (_n(F, "panel_open_animation", {
14407
14408
  scheduledAt: gt
14408
14409
  }), F.setSelectionRange(F.value.length, F.value.length)), Ye(), ls("shown", j), e.onPanelOpenChange?.(!0, j), kt = window.setTimeout(() => {
14409
14410
  m.hidden = !0, ei(G, () => jt.enabled), rn = G.scrollTop;
14410
14411
  }, 220);
14411
14412
  });
14412
- }, jo = (h = "external_request") => {
14413
+ }, Fo = (h = "external_request") => {
14413
14414
  const v = l.classList.contains("pluno-pa-widget--open") || !k.hidden && !l.classList.contains("pluno-pa-widget--closing");
14414
14415
  kt !== null && (window.clearTimeout(kt), kt = null), m.hidden = !1, f && (wi(!1), kn("Closing launcher at stored position")), l.classList.remove("pluno-pa-widget--open"), l.classList.add("pluno-pa-widget--closing"), dt(), Ye(), v && e.layout === "floating" && O.recordWidgetLifecycle("closed", h), e.onPanelOpenChange?.(!1, h), kt = window.setTimeout(() => {
14415
14416
  k.hidden = !0, B.hidden = !0, b = null, l.classList.remove("pluno-pa-widget--closing");
@@ -14440,7 +14441,7 @@ async function Cw(t = {}) {
14440
14441
  v = v.parentElement;
14441
14442
  }
14442
14443
  return null;
14443
- }, Fo = (h) => {
14444
+ }, $o = (h) => {
14444
14445
  if (!(h instanceof Element) || h.getRootNode() === l.getRootNode())
14445
14446
  return null;
14446
14447
  let v = h;
@@ -14457,7 +14458,7 @@ async function Cw(t = {}) {
14457
14458
  v = j instanceof ShadowRoot ? j.host : null;
14458
14459
  }
14459
14460
  return null;
14460
- }, $o = () => qs(x), Dp = (h) => {
14461
+ }, Ho = () => qs(x), Dp = (h) => {
14461
14462
  if (!h.isConnected || !h.matches(cd))
14462
14463
  return !1;
14463
14464
  if (!(h instanceof HTMLElement))
@@ -14468,7 +14469,7 @@ async function Cw(t = {}) {
14468
14469
  return h.checkVisibility();
14469
14470
  const v = window.getComputedStyle(h);
14470
14471
  return v.display !== "none" && v.visibility !== "hidden";
14471
- }, Ho = (h, v) => {
14472
+ }, Ko = (h, v) => {
14472
14473
  if (!v)
14473
14474
  return;
14474
14475
  Ot !== null && window.clearTimeout(Ot);
@@ -14481,16 +14482,16 @@ async function Cw(t = {}) {
14481
14482
  }, 0);
14482
14483
  }, Si = (h, v = null) => {
14483
14484
  if ($t === h) {
14484
- h && Ho(h, v);
14485
+ h && Ko(h, v);
14485
14486
  return;
14486
14487
  }
14487
- $t = h, h !== null ? (Ho(h, v), An = window.setInterval(() => {
14488
+ $t = h, h !== null ? (Ko(h, v), An = window.setInterval(() => {
14488
14489
  const A = $t;
14489
14490
  if (!A || !Dp(A)) {
14490
14491
  Si(null);
14491
14492
  return;
14492
14493
  }
14493
- Ho(A, null);
14494
+ Ko(A, null);
14494
14495
  }, lw)) : (An !== null && (window.clearInterval(An), An = null), Ot !== null && (window.clearTimeout(Ot), Ot = null), us = null);
14495
14496
  }, Lp = () => {
14496
14497
  An !== null && (window.clearInterval(An), An = null), Ot !== null && (window.clearTimeout(Ot), Ot = null), ze !== null && (window.clearTimeout(ze), ze = null);
@@ -14500,16 +14501,16 @@ async function Cw(t = {}) {
14500
14501
  return;
14501
14502
  const A = Date.now();
14502
14503
  an = A, Ii = A, ze !== null && window.clearTimeout(ze);
14503
- const R = $t ?? Fo($o());
14504
+ const R = $t ?? $o(Ho());
14504
14505
  R && (Si(R, v), h.stopImmediatePropagation()), ze = window.setTimeout(() => {
14505
14506
  if (ze = null, an !== A)
14506
14507
  return;
14507
- const j = $o();
14508
+ const j = Ho();
14508
14509
  if (j === v) {
14509
14510
  an = null;
14510
14511
  return;
14511
14512
  }
14512
- const ee = Fo(j);
14513
+ const ee = $o(j);
14513
14514
  ee && Si(ee, v);
14514
14515
  }, 0);
14515
14516
  }, hs = (h) => {
@@ -14541,7 +14542,7 @@ async function Cw(t = {}) {
14541
14542
  const A = h.target, R = an !== null && Date.now() - an <= ld;
14542
14543
  an = null, ze !== null && (window.clearTimeout(ze), ze = null);
14543
14544
  const j = (ee) => {
14544
- const he = Fo(ee);
14545
+ const he = $o(ee);
14545
14546
  if (!he)
14546
14547
  return !1;
14547
14548
  if (R)
@@ -14550,7 +14551,7 @@ async function Cw(t = {}) {
14550
14551
  return us !== null && Ie - us <= cw ? (Si(he, A), !0) : (us = Ie, !0);
14551
14552
  };
14552
14553
  j(h.relatedTarget) || window.setTimeout(() => {
14553
- $t === null && A.isConnected && j($o());
14554
+ $t === null && A.isConnected && j(Ho());
14554
14555
  }, 0);
14555
14556
  }), m.addEventListener("keydown", (h) => {
14556
14557
  !l.classList.contains("pluno-pa-widget--minimized") || h.key !== "Enter" && h.key !== " " || (h.preventDefault(), Mt("", !0, !0, !0, "minimized_launcher"));
@@ -14558,7 +14559,7 @@ async function Cw(t = {}) {
14558
14559
  h.stopPropagation();
14559
14560
  }), T?.addEventListener("click", (h) => {
14560
14561
  h.preventDefault(), h.stopPropagation(), bi("minimized", !0, "minimize_button");
14561
- }), B.addEventListener("click", () => jo("close_button")), G.addEventListener("wheel", (h) => {
14562
+ }), B.addEventListener("click", () => Fo("close_button")), G.addEventListener("wheel", (h) => {
14562
14563
  cs(h.deltaY < 0 ? "up" : null);
14563
14564
  }), G.addEventListener("pointerdown", (h) => {
14564
14565
  Sn = h.target === G ? h.clientY : null;
@@ -14576,18 +14577,18 @@ async function Cw(t = {}) {
14576
14577
  }), G.addEventListener("keydown", (h) => {
14577
14578
  (h.key === "ArrowUp" || h.key === "PageUp" || h.key === "Home") && cs("up");
14578
14579
  }), G.addEventListener("scroll", () => {
14579
- G.scrollTop < rn - 1 && To === "up" && (fi = !0, ht(!1, "userScroll")), rn = G.scrollTop, Mo();
14580
+ G.scrollTop < rn - 1 && Po === "up" && (fi = !0, ht(!1, "userScroll")), rn = G.scrollTop, Oo();
14580
14581
  }), ie.addEventListener("click", () => {
14581
14582
  Ap();
14582
14583
  });
14583
14584
  const Oc = typeof IntersectionObserver > "u" ? null : new IntersectionObserver(
14584
14585
  ([h]) => {
14585
- h?.isIntersecting && Mo();
14586
+ h?.isIntersecting && Oo();
14586
14587
  },
14587
14588
  { root: G, threshold: 0 }
14588
14589
  );
14589
14590
  Oc?.observe(Te);
14590
- const Dc = typeof ResizeObserver > "u" ? null : new ResizeObserver(Mo);
14591
+ const Dc = typeof ResizeObserver > "u" ? null : new ResizeObserver(Oo);
14591
14592
  Dc?.observe(G);
14592
14593
  const Lc = l.querySelector(".pluno-pa-widget__permission-overlay"), Nc = typeof ResizeObserver > "u" ? null : new ResizeObserver(() => {
14593
14594
  const h = Lc.offsetHeight;
@@ -14637,15 +14638,15 @@ async function Cw(t = {}) {
14637
14638
  }), Re.disabled = i() || Rn() || e.productVariant !== "personal" && $i(e.billingStatus);
14638
14639
  };
14639
14640
  Jn();
14640
- const Ko = () => {
14641
+ const Wo = () => {
14641
14642
  const h = O.getState(), v = h.isThinking, A = h.turnPhase !== null, R = h.turnPhase === "sending", j = E?.lastElementChild;
14642
14643
  j && (j.textContent = "Working..."), l.classList.toggle("pluno-pa-widget--thinking", v), l.classList.toggle("pluno-pa-widget--sending", R), l.classList.toggle(
14643
14644
  "pluno-pa-widget--unread",
14644
14645
  !A && (ki || !!h.lastError)
14645
14646
  ), Jn();
14646
14647
  };
14647
- Ko();
14648
- const Wo = () => {
14648
+ Wo();
14649
+ const Vo = () => {
14649
14650
  if (!(i() || Ue))
14650
14651
  return Jn(), Le(), O.connect().then(
14651
14652
  () => {
@@ -14665,7 +14666,7 @@ async function Cw(t = {}) {
14665
14666
  Bt !== null && window.clearTimeout(Bt), U.textContent = h, U.hidden = !1, Bt = window.setTimeout(() => {
14666
14667
  U.textContent = "", U.hidden = !0, Bt = null;
14667
14668
  }, 3e3);
14668
- }, Vo = (h, v) => {
14669
+ }, Go = (h, v) => {
14669
14670
  const A = qt.get(h);
14670
14671
  if (!A || v !== void 0 && A.submittedAt !== v || (qt.delete(h), A.generation !== St || A.revision !== en)) return;
14671
14672
  const R = new Set(A.attachments);
@@ -14682,7 +14683,7 @@ async function Cw(t = {}) {
14682
14683
  h.submittedAt,
14683
14684
  h.requestedModel
14684
14685
  ).then((R) => {
14685
- v === St && (O.getState().receipts === void 0 && Vo(h.clientMessageId), be?.clientMessageId === h.clientMessageId && (be.pendingSubmission = !1, R && (be.clientMessageId = R), Ic()), A && (Gn = !1, is = null, e.proactiveSuggestion = null, dt()));
14686
+ v === St && (O.getState().receipts === void 0 && Go(h.clientMessageId), be?.clientMessageId === h.clientMessageId && (be.pendingSubmission = !1, R && (be.clientMessageId = R), Ic()), A && (Gn = !1, is = null, e.proactiveSuggestion = null, dt()));
14686
14687
  }).catch((R) => {
14687
14688
  if (v !== St) return;
14688
14689
  be?.clientMessageId === h.clientMessageId && (be = null), qt.delete(h.clientMessageId), ui();
@@ -14696,7 +14697,7 @@ async function Cw(t = {}) {
14696
14697
  return;
14697
14698
  const h = tn;
14698
14699
  tn = null, Bc(h);
14699
- }, Go = () => {
14700
+ }, Jo = () => {
14700
14701
  const h = F.value, v = h.trim(), A = [...ut];
14701
14702
  if (tn !== null || fs() || !Tn() || !v && A.length === 0)
14702
14703
  return;
@@ -14732,14 +14733,14 @@ async function Cw(t = {}) {
14732
14733
  e.onSignupClick?.();
14733
14734
  return;
14734
14735
  }
14735
- Tn() && (on = !0, ht(!0, "send"), xt(), Go());
14736
+ Tn() && (on = !0, ht(!0, "send"), xt(), Jo());
14736
14737
  });
14737
14738
  let Ei = 0;
14738
14739
  const cn = () => {
14739
14740
  Ei = 0, l.classList.remove("pluno-pa-widget--drag-over");
14740
14741
  }, zp = () => {
14741
14742
  Bt !== null && (window.clearTimeout(Bt), Bt = null), U.textContent = "", U.hidden = !0;
14742
- }, Jo = async (h) => {
14743
+ }, Qo = async (h) => {
14743
14744
  if (!e.attachmentsEnabled || h.length === 0 || e.productVariant === "personal" && Rn())
14744
14745
  return;
14745
14746
  const v = b_(
@@ -14753,7 +14754,7 @@ async function Cw(t = {}) {
14753
14754
  }
14754
14755
  nn("attachment_added");
14755
14756
  }, Bp = async (h) => {
14756
- await Jo(h), !(h.length === 0 || $t !== null) && _n(F, "attachment_picker_completed");
14757
+ await Qo(h), !(h.length === 0 || $t !== null) && _n(F, "attachment_picker_completed");
14757
14758
  };
14758
14759
  Re.addEventListener("click", () => {
14759
14760
  e.loginRequired || Rn() || e.productVariant !== "personal" && $i(e.billingStatus) || Ae.click();
@@ -14783,7 +14784,7 @@ async function Cw(t = {}) {
14783
14784
  !0
14784
14785
  ), x.addEventListener("drop", cn, !0), x.addEventListener("dragend", cn, !0), x.defaultView?.addEventListener("blur", cn), l.addEventListener("drop", (h) => {
14785
14786
  const v = h.dataTransfer;
14786
- !e.attachmentsEnabled || !Ms(v) || e.loginRequired || Rn() || (h.preventDefault(), h.stopPropagation(), cn(), Jo(v.files).catch((A) => {
14787
+ !e.attachmentsEnabled || !Ms(v) || e.loginRequired || Rn() || (h.preventDefault(), h.stopPropagation(), cn(), Qo(v.files).catch((A) => {
14787
14788
  ms(
14788
14789
  A instanceof Error ? A.message : "Failed to attach file"
14789
14790
  ), at("web-sdk.widget", "Attachment failed", {
@@ -14793,7 +14794,7 @@ async function Cw(t = {}) {
14793
14794
  }), l.addEventListener("paste", (h) => {
14794
14795
  h.stopPropagation();
14795
14796
  const v = h.clipboardData, A = Array.from(v?.files ?? []);
14796
- !e.attachmentsEnabled || A.length === 0 || e.loginRequired || Rn() || (h.preventDefault(), Jo(A).catch((R) => {
14797
+ !e.attachmentsEnabled || A.length === 0 || e.loginRequired || Rn() || (h.preventDefault(), Qo(A).catch((R) => {
14797
14798
  ms(
14798
14799
  R instanceof Error ? R.message : "Failed to attach file"
14799
14800
  ), at("web-sdk.widget", "Attachment failed", {
@@ -14813,9 +14814,9 @@ async function Cw(t = {}) {
14813
14814
  return;
14814
14815
  }
14815
14816
  const v = F.value.trim().length > 0 || ut.length > 0;
14816
- on = !0, ht(!0, "send"), xt(), Go(), xe(O.getState()), Le(), v && nn("send_button_submit");
14817
+ on = !0, ht(!0, "send"), xt(), Jo(), xe(O.getState()), Le(), v && nn("send_button_submit");
14817
14818
  }), ve.addEventListener("click", () => {
14818
- He = !He, Ft(), He && (Qe.data === null || Qe.status === "error") && Qe.status !== "loading" && Do(), He || nn("history_closed");
14819
+ He = !He, Ft(), He && (Qe.data === null || Qe.status === "error") && Qe.status !== "loading" && Lo(), He || nn("history_closed");
14819
14820
  }), pe.addEventListener("click", () => {
14820
14821
  He = !1, Ft(), nn("history_closed");
14821
14822
  }), V.addEventListener("scroll", Rp), F.addEventListener("input", () => {
@@ -14826,7 +14827,7 @@ async function Cw(t = {}) {
14826
14827
  e.onLoginClick?.();
14827
14828
  return;
14828
14829
  }
14829
- Tn() && (on = !0, ht(!0, "send"), xt(), Go(), xe(O.getState()), Le());
14830
+ Tn() && (on = !0, ht(!0, "send"), xt(), Jo(), xe(O.getState()), Le());
14830
14831
  }
14831
14832
  }), l.addEventListener("click", (h) => {
14832
14833
  const v = h.target instanceof Element ? h.target : null;
@@ -14886,19 +14887,19 @@ async function Cw(t = {}) {
14886
14887
  h.key !== "Escape" || !He || (He = !1, Ft(), nn("history_escape"));
14887
14888
  }), d.composerValue && (F.value = d.composerValue, Fi(F)), e.layout === "page" ? Mt(F.value, !1, !0, !1, "external_request") : p === "minimized" ? bi("minimized", !1) : e.initialDisplayState === void 0 && d.isOpen && Mt(F.value, !1, !1, !1, "restored_state");
14888
14889
  const Ci = () => u;
14889
- let Qo = O.getState().appearance !== null, Ai = O.getInteractions();
14890
+ let Yo = O.getState().appearance !== null, Ai = O.getInteractions();
14890
14891
  const Xe = (h) => Ai.find(
14891
14892
  (v) => v.kind === h && v.eligible
14892
14893
  ), ys = Zp(() => bs()), Wc = (h) => Xp(
14893
14894
  JSON.stringify([O.getState().user?.id, O.getState().sessionId]),
14894
14895
  h
14895
- ), Yo = /* @__PURE__ */ new WeakMap(), bs = () => {
14896
+ ), Xo = /* @__PURE__ */ new WeakMap(), bs = () => {
14896
14897
  const h = Ai.filter((v) => v.kind === "task_notifications" || v.kind === "tab_group_permission");
14897
14898
  ys.sync(h.map((v) => ({ key: Wc(v), card: v })));
14898
14899
  for (const [v, A] of [[De, Xe("task_notifications")], [$e, Xe("tab_group_permission")]]) {
14899
14900
  if (!v) continue;
14900
14901
  if (v.hidden = !A, !A) {
14901
- Yo.delete(v);
14902
+ Xo.delete(v);
14902
14903
  continue;
14903
14904
  }
14904
14905
  const R = A.payload.openingGeneration;
@@ -14909,8 +14910,8 @@ async function Cw(t = {}) {
14909
14910
  const j = Wc(A), ee = ys.get(j), he = A.status === "pending" || !!ee?.action;
14910
14911
  v.setAttribute("aria-busy", String(he));
14911
14912
  const Ie = JSON.stringify([j, A, ee?.action, ee?.error]);
14912
- if (Yo.get(v) === Ie) continue;
14913
- Yo.set(v, Ie), v.replaceChildren();
14913
+ if (Xo.get(v) === Ie) continue;
14914
+ Xo.set(v, Ie), v.replaceChildren();
14914
14915
  const gt = document.createElement("span");
14915
14916
  gt.className = "pluno-pa-widget__notify-suggestion-label", gt.textContent = A.presentation.body;
14916
14917
  const Yn = document.createElement("div");
@@ -14934,7 +14935,7 @@ async function Cw(t = {}) {
14934
14935
  h.revision,
14935
14936
  { ...A, expectedSourceVersion: h.sourceVersion, ...v === "run" ? { requestedModel: ot } : {} }
14936
14937
  ) : Promise.resolve();
14937
- let Xo = O.getState().isThinking;
14938
+ let Zo = O.getState().isThinking;
14938
14939
  const jp = async () => {
14939
14940
  bs();
14940
14941
  };
@@ -14962,11 +14963,11 @@ async function Cw(t = {}) {
14962
14963
  }
14963
14964
  };
14964
14965
  let Qn = null;
14965
- const Zo = (h = {}) => {
14966
+ const er = (h = {}) => {
14966
14967
  e.productVariant === "personal" && O.refreshSessionHistory().catch(() => {
14967
14968
  }), St++, qt.clear(), dc(), tn = null, be = null, fi = !1, as.clear(), on = !0, ht(!0, "newSession"), xt(), He = !1, Ft();
14968
14969
  const v = Promise.resolve(O.startNewSession(h));
14969
- return vi = null, Ro.clear(), F.value = "", ut = [], ui(), Fi(F), Ye(), Le(), _n(F, "new_chat"), xe(O.getState()), v;
14970
+ return vi = null, To.clear(), F.value = "", ut = [], ui(), Fi(F), Ye(), Le(), _n(F, "new_chat"), xe(O.getState()), v;
14970
14971
  };
14971
14972
  ce?.addEventListener("click", () => {
14972
14973
  ln(Xe("proactive_suggestion"), "run").catch(() => {
@@ -15005,16 +15006,16 @@ async function Cw(t = {}) {
15005
15006
  Qn?.remove(), Qn = null;
15006
15007
  return;
15007
15008
  }
15008
- Qn || (Qn = _o(
15009
+ Qn || (Qn = vo(
15009
15010
  "pluno-pa-widget__new-chat",
15010
15011
  "New chat",
15011
15012
  o_(),
15012
15013
  !1
15013
- ), Qn.addEventListener("click", () => Zo()), _e.insertBefore(Qn, ve));
15014
+ ), Qn.addEventListener("click", () => er()), _e.insertBefore(Qn, ve));
15014
15015
  }, Ht = document.createElement("div");
15015
15016
  Ht.className = "pluno-pa-widget__error";
15016
- const er = document.createTextNode("");
15017
- Ht.appendChild(er);
15017
+ const tr = document.createTextNode("");
15018
+ Ht.appendChild(tr);
15018
15019
  const dn = document.createElement("a");
15019
15020
  dn.className = "pluno-pa-widget__error-retry", dn.target = "_blank", dn.rel = "noreferrer", dn.textContent = "Security settings";
15020
15021
  const Et = document.createElement("button");
@@ -15028,7 +15029,7 @@ async function Cw(t = {}) {
15028
15029
  let h;
15029
15030
  try {
15030
15031
  await Promise.race([
15031
- Wo(),
15032
+ Vo(),
15032
15033
  new Promise((v) => {
15033
15034
  h = setTimeout(v, 9e4);
15034
15035
  })
@@ -15040,11 +15041,11 @@ async function Cw(t = {}) {
15040
15041
  Et.addEventListener("click", () => {
15041
15042
  Hp();
15042
15043
  });
15043
- let qn = !1, Pi = null, Is = 0, tr = 0;
15044
+ let qn = !1, Pi = null, Is = 0, nr = 0;
15044
15045
  const xe = (h, v = {}) => {
15045
15046
  yc(h) && (be = null), mc = v.renderSource ?? "local";
15046
15047
  const A = n();
15047
- l.dataset.conversationGate = e.loginRequired || A ? "authentication" : e.signupRequired ? "signup" : "none", zo(), l.classList.toggle(
15048
+ l.dataset.conversationGate = e.loginRequired || A ? "authentication" : e.signupRequired ? "signup" : "none", Bo(), l.classList.toggle(
15048
15049
  "pluno-pa-widget--logged-out",
15049
15050
  (e.loginRequired || A) && e.entrySurface === "extension_widget"
15050
15051
  ), ne.classList.remove("pluno-pa-widget__access-notice--login-only"), h = { ...h, messages: h.messages.map((W) => {
@@ -15057,7 +15058,7 @@ async function Cw(t = {}) {
15057
15058
  ...Object.getOwnPropertyDescriptors(W),
15058
15059
  attachments: { value: Pe, enumerable: !0, configurable: !0 }
15059
15060
  });
15060
- }) }, gi(), sn !== null && (window.clearTimeout(sn), sn = null), Ft(), dt(), So(), ne.hidden = !i(), ne.hidden && ne.replaceChildren();
15061
+ }) }, gi(), sn !== null && (window.clearTimeout(sn), sn = null), Ft(), dt(), ko(), ne.hidden = !i(), ne.hidden && ne.replaceChildren();
15061
15062
  const R = JSON.stringify([
15062
15063
  i(),
15063
15064
  h.lastError,
@@ -15068,7 +15069,7 @@ async function Cw(t = {}) {
15068
15069
  if (Xc !== R) {
15069
15070
  Xc = R, Oe.hidden = i() || !h.lastError || Ji(h.lastErrorCode) !== "bottom_notice";
15070
15071
  const W = Oe.hidden ? "" : h.lastError ?? "";
15071
- er.data !== W && (er.data = W), Oe.hidden ? Ht.remove() : Ht.parentElement !== Oe && Oe.appendChild(Ht), h.lastErrorSecuritySettingsUrl ? (dn.href = h.lastErrorSecuritySettingsUrl, dn.parentElement !== Ht && Ht.insertBefore(dn, Et.parentElement ? Et : null)) : dn.remove(), h.lastErrorCode === "connection_failed" || h.lastErrorCode === "auth_reconnecting" || h.lastErrorCode === "submission_checkpoint_pending" ? (Et.disabled = un, Et.setAttribute("aria-busy", String(un)), Qc.hidden = !un, Yc.data = un ? "Trying" : "Try again", Et.parentElement !== Ht && Ht.appendChild(Et)) : Et.remove();
15072
+ tr.data !== W && (tr.data = W), Oe.hidden ? Ht.remove() : Ht.parentElement !== Oe && Oe.appendChild(Ht), h.lastErrorSecuritySettingsUrl ? (dn.href = h.lastErrorSecuritySettingsUrl, dn.parentElement !== Ht && Ht.insertBefore(dn, Et.parentElement ? Et : null)) : dn.remove(), h.lastErrorCode === "connection_failed" || h.lastErrorCode === "auth_reconnecting" || h.lastErrorCode === "submission_checkpoint_pending" ? (Et.disabled = un, Et.setAttribute("aria-busy", String(un)), Qc.hidden = !un, Yc.data = un ? "Trying" : "Try again", Et.parentElement !== Ht && Ht.appendChild(Et)) : Et.remove();
15072
15073
  }
15073
15074
  if (A) {
15074
15075
  mi = "", Ri.clear(), ws.clear(), _s.clear(), G.replaceChildren(), Os(
@@ -15102,9 +15103,9 @@ async function Cw(t = {}) {
15102
15103
  );
15103
15104
  const qe = ne.querySelector(".pluno-pa-widget__login");
15104
15105
  qe.disabled = qn, qe.setAttribute("aria-busy", String(qn)), qn && qe.prepend(bn()), qe.addEventListener("click", () => {
15105
- const Mi = ++Is, Yp = tr;
15106
+ const Mi = ++Is, Yp = nr;
15106
15107
  qn = !0, Pi = null, xe(O.getState()), Pe().catch((nl) => {
15107
- Mi !== Is || Yp !== tr || (Pi = nl instanceof Error ? nl.message : "Close and reopen Pluno to try again.");
15108
+ Mi !== Is || Yp !== nr || (Pi = nl instanceof Error ? nl.message : "Close and reopen Pluno to try again.");
15108
15109
  }).finally(() => {
15109
15110
  Mi === Is && (qn = !1, Ue || xe(O.getState()));
15110
15111
  });
@@ -15158,7 +15159,7 @@ async function Cw(t = {}) {
15158
15159
  Vc(h),
15159
15160
  he,
15160
15161
  () => jt.enabled,
15161
- Ro,
15162
+ To,
15162
15163
  Ri,
15163
15164
  ws,
15164
15165
  _s,
@@ -15177,11 +15178,11 @@ async function Cw(t = {}) {
15177
15178
  () => {
15178
15179
  const W = Xe("morning_report");
15179
15180
  W && ln(W, "snooze").then(() => {
15180
- jo("morning_report_snooze"), xe(O.getState());
15181
+ Fo("morning_report_snooze"), xe(O.getState());
15181
15182
  }).catch(() => xe(O.getState()));
15182
15183
  },
15183
15184
  () => h.sessionId ? O.loadSession(h.sessionId) : void 0,
15184
- () => Zo(),
15185
+ () => er(),
15185
15186
  vs.get(h.selectionKey ?? h.sessionId ?? "draft"),
15186
15187
  (W, Pe) => {
15187
15188
  $p(h.selectionKey ?? h.sessionId ?? "draft", W, Pe);
@@ -15215,41 +15216,41 @@ async function Cw(t = {}) {
15215
15216
  "selectionchange",
15216
15217
  Zc
15217
15218
  );
15218
- const nr = (h) => {
15219
+ const ir = (h) => {
15219
15220
  Pn = e.entrySurface === "extension_widget" || h.user && !e.loginRequired ? h.activeUsersCount ?? null : null, Gc();
15220
15221
  };
15221
- nr(O.getState());
15222
+ ir(O.getState());
15222
15223
  const Kp = O.subscribeInteractions((h) => {
15223
15224
  Ai = h, bs(), e.morningReport = Xe("morning_report")?.payload ?? null, e.proactiveSuggestion = Xe("proactive_suggestion")?.payload.suggestion ?? null, Ue || xe(O.getState(), { skipUnchangedTimeline: !0, renderSource: "interactions" });
15224
15225
  }), Wp = O.subscribeAccount((h) => {
15225
15226
  if (!h && !gs) return;
15226
15227
  const v = h?.auth, A = v?.workspace?.id;
15227
- A && (Ao !== null && Ao !== A && (ot = Co, gi()), Ao = A), (v?.status !== "error" || v.errorCode !== "browser_session_unavailable" && v.errorCode !== "backend_auth_pending") && (Is += 1, Pi = null, qn = !1);
15228
+ A && (Ro !== null && Ro !== A && (ot = Ao, gi()), Ro = A), (v?.status !== "error" || v.errorCode !== "browser_session_unavailable" && v.errorCode !== "backend_auth_pending") && (Is += 1, Pi = null, qn = !1);
15228
15229
  const R = i();
15229
- e.billingStatus = h, s(h), nr(O.getState()), Jn(), xe(O.getState(), { skipUnchangedTimeline: !0, renderSource: "account" }), So(), Le(), queueMicrotask(jc), R && !i() && Wo();
15230
+ e.billingStatus = h, s(h), ir(O.getState()), Jn(), xe(O.getState(), { skipUnchangedTimeline: !0, renderSource: "account" }), ko(), Le(), queueMicrotask(jc), R && !i() && Vo();
15230
15231
  });
15231
- let ir = !1, sr = null;
15232
+ let sr = !1, or = null;
15232
15233
  const el = (h) => {
15233
- os && ((!h.taskStatus || sr !== null && sr !== h.sessionId) && (ir = !1), sr = h.sessionId, h.taskStatus === "working" && (ir = !0), ir && h.taskStatus ? os.setStatus(h.taskStatus) : os.clear());
15234
+ os && ((!h.taskStatus || or !== null && or !== h.sessionId) && (sr = !1), or = h.sessionId, h.taskStatus === "working" && (sr = !0), sr && h.taskStatus ? os.setStatus(h.taskStatus) : os.clear());
15234
15235
  };
15235
15236
  O.on("state", (h) => {
15236
15237
  const v = h.user?.id ?? null;
15237
- vn !== null && vn !== v && (ot = Co, gi()), (pi !== null && pi !== h.sessionId || vn !== null && vn !== v || hi !== void 0 && hi !== h.selectionKey) && (St++, qt.clear(), be = null), hi = h.selectionKey, pi = h.sessionId, vn = v;
15238
+ vn !== null && vn !== v && (ot = Ao, gi()), (pi !== null && pi !== h.sessionId || vn !== null && vn !== v || hi !== void 0 && hi !== h.selectionKey) && (St++, qt.clear(), be = null), hi = h.selectionKey, pi = h.sessionId, vn = v;
15238
15239
  for (const Ie of h.messages)
15239
- Ie.role === "user" && Vo(Ie.id);
15240
- for (const Ie of h.receipts ?? []) Vo(Ie.userMessageId, Ie.acceptedRendererRevision);
15241
- e.extensionRuntime && (tr += 1, Pi = null), nr(h), el(h), h.status === "connected" && (e.productVariant === "personal" && !gc && e.layout === "page" && !hc && (hc = !0, O.refreshSessionHistory().catch(() => {
15240
+ Ie.role === "user" && Go(Ie.id);
15241
+ for (const Ie of h.receipts ?? []) Go(Ie.userMessageId, Ie.acceptedRendererRevision);
15242
+ e.extensionRuntime && (nr += 1, Pi = null), ir(h), el(h), h.status === "connected" && (e.productVariant === "personal" && !gc && e.layout === "page" && !hc && (hc = !0, O.refreshSessionHistory().catch(() => {
15242
15243
  })), gs = !0, tn && queueMicrotask(() => {
15243
15244
  jc();
15244
15245
  })), jp();
15245
- const A = Xo && !h.isThinking, R = wc !== location.origin || _c !== h.sessionId || vc !== (h.user?.id ?? null), j = Xo !== h.isThinking, ee = Po !== "connected" && h.status === "connected", he = Po === "connected" && h.status !== "connected";
15246
- wc = location.origin, _c = h.sessionId, vc = h.user?.id ?? null, Po = h.status, Xo = h.isThinking, he && pt !== null && (window.clearTimeout(pt), pt = null), l.classList.contains("pluno-pa-widget--open") && h.status === "connected" && (R || j || ee) && Lo(), De && (De.hidden = Xe("task_notifications") === void 0), $e && ($e.hidden = Xe("tab_group_permission") === void 0), A && !l.classList.contains("pluno-pa-widget--open") && (ki = !0), Ko(), h.appearance ? (Qo = !0, at(
15246
+ const A = Zo && !h.isThinking, R = wc !== location.origin || _c !== h.sessionId || vc !== (h.user?.id ?? null), j = Zo !== h.isThinking, ee = qo !== "connected" && h.status === "connected", he = qo === "connected" && h.status !== "connected";
15247
+ wc = location.origin, _c = h.sessionId, vc = h.user?.id ?? null, qo = h.status, Zo = h.isThinking, he && pt !== null && (window.clearTimeout(pt), pt = null), l.classList.contains("pluno-pa-widget--open") && h.status === "connected" && (R || j || ee) && No(), De && (De.hidden = Xe("task_notifications") === void 0), $e && ($e.hidden = Xe("tab_group_permission") === void 0), A && !l.classList.contains("pluno-pa-widget--open") && (ki = !0), Wo(), h.appearance ? (Yo = !0, at(
15247
15248
  "web-sdk.widget",
15248
15249
  "Agent state supplied appearance",
15249
15250
  {
15250
15251
  appearance: h.appearance
15251
15252
  }
15252
- ), or(h.appearance, "agent.state.appearance")) : Qo && (Qo = !1, at(
15253
+ ), rr(h.appearance, "agent.state.appearance")) : Yo && (Yo = !1, at(
15253
15254
  "web-sdk.widget",
15254
15255
  "Agent state cleared appearance; reverting to configured widget options",
15255
15256
  {
@@ -15257,10 +15258,10 @@ async function Cw(t = {}) {
15257
15258
  fallbackColorScheme: e.colorScheme,
15258
15259
  fallbackFontFamily: e.fontFamily
15259
15260
  }
15260
- ), or({}, "agent.state.appearance-cleared")), xe(h, { skipUnchangedTimeline: !0, renderSource: "state" }), Le(), A && Bo();
15261
+ ), rr({}, "agent.state.appearance-cleared")), xe(h, { skipUnchangedTimeline: !0, renderSource: "state" }), Le(), A && jo();
15261
15262
  });
15262
15263
  const tl = O.getState();
15263
- el(tl), xe(tl), Le(), Wo();
15264
+ el(tl), xe(tl), Le(), Vo();
15264
15265
  const Vp = ag(l, (h, v, A, R, j) => {
15265
15266
  const ee = ch(O.getState(), R);
15266
15267
  O.reportDisplayedError?.(h, v, A, ee ?? void 0, j);
@@ -15269,20 +15270,20 @@ async function Cw(t = {}) {
15269
15270
  l,
15270
15271
  e.extensionRuntime || e.entrySurface === "extension_widget" ? "extension_widget" : e.entrySurface === "main_web_chat" ? "main_web_chat" : "embedded_widget",
15271
15272
  O
15272
- ), Jp = cg(l, Oo);
15273
+ ), Jp = cg(l, Do);
15273
15274
  return {
15274
15275
  agent: O,
15275
- startNewChat: Zo,
15276
+ startNewChat: er,
15276
15277
  getSelectedModel: () => ot,
15277
15278
  host: r,
15278
15279
  updateAppearance: (h) => {
15279
- h.scribbleStyle !== void 0 && (e.scribbleStyle = h.scribbleStyle), or(h, "widgetHandle.updateAppearance");
15280
+ h.scribbleStyle !== void 0 && (e.scribbleStyle = h.scribbleStyle), rr(h, "widgetHandle.updateAppearance");
15280
15281
  },
15281
15282
  openPanel: (h) => {
15282
15283
  const v = typeof h == "string" ? h : F.value, A = typeof h == "object" ? h.focusComposer !== !1 : !0, R = typeof h == "object" ? h.trigger ?? "external_request" : "external_request";
15283
15284
  R === "proactive_suggestion" && e.proactiveSuggestion && (is = e.proactiveSuggestion, Gn = !0, dt()), Mt(R === "proactive_suggestion" ? "Yes, but " : v, !1, A, !0, R);
15284
15285
  },
15285
- closePanel: jo,
15286
+ closePanel: Fo,
15286
15287
  updateDisplayState: (h) => {
15287
15288
  if (h === "shown") {
15288
15289
  bi("shown", !1);
@@ -15320,7 +15321,7 @@ async function Cw(t = {}) {
15320
15321
  ), x.removeEventListener("drop", cn, !0), x.removeEventListener("dragend", cn, !0), x.defaultView?.removeEventListener(
15321
15322
  "blur",
15322
15323
  cn
15323
- ), window.removeEventListener("resize", xc), Ec(), qp(), Mp(), Bt !== null && window.clearTimeout(Bt), pt !== null && (window.clearTimeout(pt), pt = null), Ep(), In !== null && (window.clearTimeout(In), In = null), sn !== null && (window.clearTimeout(sn), sn = null), os?.clear(), xo && O.destroy(), Eo?.release(), r.remove());
15324
+ ), window.removeEventListener("resize", xc), Ec(), qp(), Mp(), Bt !== null && window.clearTimeout(Bt), pt !== null && (window.clearTimeout(pt), pt = null), Ep(), In !== null && (window.clearTimeout(In), In = null), sn !== null && (window.clearTimeout(sn), sn = null), os?.clear(), Eo && O.destroy(), Co?.release(), r.remove());
15324
15325
  }
15325
15326
  };
15326
15327
  async function Qp(h) {
@@ -15341,7 +15342,7 @@ async function Cw(t = {}) {
15341
15342
  });
15342
15343
  }
15343
15344
  }
15344
- function or(h, v) {
15345
+ function rr(h, v) {
15345
15346
  const A = h.accentColor ?? e.accentColor, R = h.colorScheme ?? e.colorScheme, j = h.fontFamily ?? e.fontFamily, ee = h.scribbleStyle ?? e.scribbleStyle, he = JSON.stringify([A, R, j, ee]);
15346
15347
  he !== _ && (_ = he, u = hd(
15347
15348
  A,
@@ -15439,7 +15440,7 @@ function Pw({
15439
15440
  return;
15440
15441
  S.preventDefault();
15441
15442
  const x = S.clientX - r.x, m = S.clientY - r.y;
15442
- !l && Math.hypot(x, m) < ao || (l = !0, t.classList.add("pluno-pa-widget--dragging"), s({ x: c.x + x, y: c.y + m }));
15443
+ !l && Math.hypot(x, m) < co || (l = !0, t.classList.add("pluno-pa-widget--dragging"), s({ x: c.x + x, y: c.y + m }));
15443
15444
  }, y = (S) => {
15444
15445
  a === S.pointerId && (S.preventDefault(), S.stopPropagation(), l && (u = { x: S.clientX, y: S.clientY }, o()), d());
15445
15446
  }, g = (S) => {
@@ -15450,7 +15451,7 @@ function Pw({
15450
15451
  const x = Math.hypot(
15451
15452
  S.clientX - u.x,
15452
15453
  S.clientY - u.y
15453
- ) <= ao;
15454
+ ) <= co;
15454
15455
  u = null, x && (S.preventDefault(), S.stopPropagation());
15455
15456
  }, _ = (S) => {
15456
15457
  if (t.classList.contains("pluno-pa-widget--open") || t.classList.contains("pluno-pa-widget--closing"))
@@ -15480,7 +15481,7 @@ function qw({
15480
15481
  return;
15481
15482
  g.preventDefault(), g.stopPropagation();
15482
15483
  const b = g.clientX - a.x, _ = g.clientY - a.y;
15483
- !c && Math.hypot(b, _) < ao || (c = !0, t.classList.add("pluno-pa-widget--panel-dragging"), i({ x: r.x + b, y: r.y + _ }));
15484
+ !c && Math.hypot(b, _) < co || (c = !0, t.classList.add("pluno-pa-widget--panel-dragging"), i({ x: r.x + b, y: r.y + _ }));
15484
15485
  }, p = (g) => {
15485
15486
  o === g.pointerId && (g.preventDefault(), g.stopPropagation(), c && s(), l());
15486
15487
  }, f = (g) => {
@@ -15512,7 +15513,7 @@ function Mw({
15512
15513
  return;
15513
15514
  b.preventDefault(), b.stopPropagation();
15514
15515
  const _ = b.clientX - r.x, S = b.clientY - r.y;
15515
- !l && Math.hypot(_, S) < ao || (l = !0, t.classList.add("pluno-pa-widget--resizing"), i(
15516
+ !l && Math.hypot(_, S) < co || (l = !0, t.classList.add("pluno-pa-widget--resizing"), i(
15516
15517
  md(c, a, _, S)
15517
15518
  ));
15518
15519
  }, f = (b) => {
@@ -15646,9 +15647,9 @@ function Ow() {
15646
15647
  };
15647
15648
  }
15648
15649
  function zn(t = null) {
15649
- return t ? wo(t) : Ow();
15650
+ return t ? _o(t) : Ow();
15650
15651
  }
15651
- function wo(t) {
15652
+ function _o(t) {
15652
15653
  const e = tt();
15653
15654
  return {
15654
15655
  width: vt(
@@ -15675,12 +15676,12 @@ function wo(t) {
15675
15676
  )
15676
15677
  };
15677
15678
  }
15678
- function zr(t, e) {
15679
+ function Br(t, e) {
15679
15680
  if (!e) {
15680
15681
  t.style.removeProperty("--pluno-pa-panel-width"), t.style.removeProperty("--pluno-pa-panel-height");
15681
15682
  return;
15682
15683
  }
15683
- const n = wo(e);
15684
+ const n = _o(e);
15684
15685
  t.style.setProperty("--pluno-pa-panel-width", `${n.width}px`), t.style.setProperty("--pluno-pa-panel-height", `${n.height}px`);
15685
15686
  }
15686
15687
  function Dw(t, e, n) {
@@ -15696,7 +15697,7 @@ function Dw(t, e, n) {
15696
15697
  y: a.height - 24 - n.height
15697
15698
  };
15698
15699
  }
15699
- function Br(t, e, n) {
15700
+ function jr(t, e, n) {
15700
15701
  const i = Zi(t, !1);
15701
15702
  return e ? Vs(
15702
15703
  t,
@@ -15735,7 +15736,7 @@ function Vs(t, e, n) {
15735
15736
  function Nw(t, e) {
15736
15737
  if (e <= 0)
15737
15738
  return !1;
15738
- const n = tt(), i = t.top - ge - Ca, s = n.height - t.bottom - ge - Ca;
15739
+ const n = tt(), i = t.top - ge - Aa, s = n.height - t.bottom - ge - Aa;
15739
15740
  return i < e && s >= e;
15740
15741
  }
15741
15742
  function Gs(t, e) {
@@ -15745,7 +15746,7 @@ function Gs(t, e) {
15745
15746
  y: t.anchor.startsWith("bottom") ? n.height - e.height - t.y : t.y
15746
15747
  };
15747
15748
  }
15748
- function jr(t, e) {
15749
+ function Fr(t, e) {
15749
15750
  const n = Uw(t, e), i = tt();
15750
15751
  return {
15751
15752
  anchor: n,
@@ -15760,7 +15761,7 @@ function Uw(t, e) {
15760
15761
  function zw(t) {
15761
15762
  return t.classList.contains("pluno-pa-widget--scribble") ? Sw : Iw;
15762
15763
  }
15763
- function Fr(t, e, n, i = null) {
15764
+ function $r(t, e, n, i = null) {
15764
15765
  const s = Zi(t), o = zn(i), a = {
15765
15766
  x: n === "bottom-left" ? e.x : e.x + s.width - o.width,
15766
15767
  y: e.y + s.height - o.height
@@ -15816,7 +15817,7 @@ function tt() {
15816
15817
  height: window.innerHeight || document.documentElement.clientHeight || ep + ge * 2
15817
15818
  };
15818
15819
  }
15819
- function $r(t) {
15820
+ function Hr(t) {
15820
15821
  const e = t.getBoundingClientRect();
15821
15822
  return {
15822
15823
  x: Math.round(e.x),
@@ -15952,10 +15953,10 @@ function Vw(t, e, n, i, s) {
15952
15953
  s
15953
15954
  )
15954
15955
  ), t.appendChild(Xw()), t.appendChild(
15955
- _o(
15956
+ vo(
15956
15957
  "pluno-pa-widget__close",
15957
15958
  "Close",
15958
- qa(16),
15959
+ Ma(16),
15959
15960
  !0
15960
15961
  )
15961
15962
  ), t.appendChild(Jw(n, i));
@@ -15984,7 +15985,7 @@ function Gw(t, e, n, i) {
15984
15985
  a.className = "pluno-pa-widget__launcher-run-indicator", s.appendChild(a);
15985
15986
  const r = document.createElement("input");
15986
15987
  r.className = "pluno-pa-widget__launcher-input", r.type = "text", r.placeholder = t, r.setAttribute("aria-label", t), s.appendChild(r);
15987
- const c = vo("Working...");
15988
+ const c = Io("Working...");
15988
15989
  if (c.classList.add("pluno-pa-widget__status--launcher"), s.appendChild(c), i) {
15989
15990
  const l = document.createElement("button");
15990
15991
  l.type = "button", l.className = "pluno-pa-widget__launcher-minimize", l.textContent = "-", l.setAttribute("aria-label", "Minimize Pluno on this site"), l.title = "Minimize Pluno on this site", s.appendChild(l);
@@ -16021,9 +16022,9 @@ function Jw(t, e) {
16021
16022
  p.className = "pluno-pa-widget__connection-notice", p.hidden = !0, l.append(d, u, p), l.append(Qw(), Yw()), s.append(l, c);
16022
16023
  const f = document.createElement("div");
16023
16024
  f.className = "pluno-pa-widget__top-actions", f.appendChild(
16024
- _o(
16025
+ vo(
16025
16026
  "pluno-pa-widget__history",
16026
- Pa(),
16027
+ qa(),
16027
16028
  a_(),
16028
16029
  !0
16029
16030
  )
@@ -16134,7 +16135,7 @@ function Zw() {
16134
16135
  const u = document.createElement("summary");
16135
16136
  u.className = "pluno-pa-widget__model-trigger";
16136
16137
  const d = document.createElement("span");
16137
- u.append(d, qa(12)), l.appendChild(u);
16138
+ u.append(d, Ma(12)), l.appendChild(u);
16138
16139
  const p = document.createElement("div");
16139
16140
  p.className = "pluno-pa-widget__model-menu";
16140
16141
  for (const b of Qi)
@@ -16144,7 +16145,7 @@ function Zw() {
16144
16145
  b.className = "pluno-pa-widget__model-more";
16145
16146
  const _ = document.createElement("summary"), S = document.createElement("span");
16146
16147
  S.textContent = "More";
16147
- const x = qa(12);
16148
+ const x = Ma(12);
16148
16149
  x.classList.add("pluno-pa-widget__model-more-chevron"), _.append(S, x), b.appendChild(_);
16149
16150
  for (const m of rl) {
16150
16151
  const w = Id(m);
@@ -16168,17 +16169,17 @@ function Id(t) {
16168
16169
  const i = document.createElement("span");
16169
16170
  return i.className = "pluno-pa-widget__model-price", i.textContent = t.price, e.append(n, i), e.setAttribute("role", "option"), e;
16170
16171
  }
16171
- function Pa() {
16172
+ function qa() {
16172
16173
  return location.hostname ? `Recent chats on ${location.hostname}` : "Recent chats";
16173
16174
  }
16174
16175
  function e_() {
16175
16176
  const t = document.createElement("section");
16176
- t.className = "pluno-pa-widget__history-panel", t.hidden = !0, t.setAttribute("aria-label", Pa());
16177
+ t.className = "pluno-pa-widget__history-panel", t.hidden = !0, t.setAttribute("aria-label", qa());
16177
16178
  const e = document.createElement("div");
16178
16179
  e.className = "pluno-pa-widget__history-header";
16179
16180
  const n = document.createElement("strong");
16180
- n.textContent = Pa();
16181
- const i = _o(
16181
+ n.textContent = qa();
16182
+ const i = vo(
16182
16183
  "pluno-pa-widget__history-close",
16183
16184
  "Close recent chats",
16184
16185
  sc(),
@@ -16356,12 +16357,12 @@ function n_(t, e) {
16356
16357
  "flood-opacity": "0.22"
16357
16358
  });
16358
16359
  const g = Q(o, "clipPath", { id: i.boltClip });
16359
- Q(g, "path", { d: oo });
16360
+ Q(g, "path", { d: ro });
16360
16361
  const b = Q(s, "g", {
16361
16362
  filter: bt(i.softDropShadow)
16362
16363
  });
16363
16364
  Q(b, "path", {
16364
- d: oo,
16365
+ d: ro,
16365
16366
  fill: bt(i.boltEdge)
16366
16367
  });
16367
16368
  const _ = "M546 166 C522 166 505 180 499 204 L397 606 C390 630 406 646 432 646 L526 646 C568 646 590 672 581 712 L512 1001 C510 1010 518 1014 524 1006 L875 475 C886 458 878 449 855 449 L814 449 C764 449 745 415 769 374 L884 200 C894 181 883 161 858 161 Z";
@@ -16428,7 +16429,7 @@ function i_(t, e) {
16428
16429
  clip: `${e}-scribbleBoltClip`,
16429
16430
  wobble: `${e}-scribbleBoltWobble`
16430
16431
  }, s = cp(), o = Q(s, "defs"), a = Q(o, "clipPath", { id: i.clip });
16431
- Q(a, "path", { d: oo });
16432
+ Q(a, "path", { d: ro });
16432
16433
  const r = Q(o, "filter", {
16433
16434
  id: i.wobble,
16434
16435
  x: "-10%",
@@ -16463,9 +16464,9 @@ function i_(t, e) {
16463
16464
  opacity: "0.9",
16464
16465
  transform: "rotate(-14 627 600)"
16465
16466
  }), Q(c, "path", {
16466
- d: oo,
16467
+ d: ro,
16467
16468
  fill: "none",
16468
- stroke: ro,
16469
+ stroke: ao,
16469
16470
  "stroke-width": "18",
16470
16471
  "stroke-linejoin": "round"
16471
16472
  }), kd(
@@ -16524,14 +16525,14 @@ function kd(t, e, n, i, s, o, a, r) {
16524
16525
  rx: "73",
16525
16526
  ry: "80",
16526
16527
  fill: "#ffffff",
16527
- stroke: ro,
16528
+ stroke: ao,
16528
16529
  "stroke-width": "13"
16529
16530
  }), Q(c, "ellipse", {
16530
16531
  cx: s,
16531
16532
  cy: o,
16532
16533
  rx: "45",
16533
16534
  ry: "53",
16534
- fill: ro
16535
+ fill: ao
16535
16536
  }), Q(c, "circle", {
16536
16537
  cx: a,
16537
16538
  cy: r,
@@ -16550,7 +16551,7 @@ function Ne(t, e, n, i) {
16550
16551
  function bt(t) {
16551
16552
  return `url(#${t})`;
16552
16553
  }
16553
- function _o(t, e, n, i) {
16554
+ function vo(t, e, n, i) {
16554
16555
  const s = document.createElement("button");
16555
16556
  return s.type = "button", s.className = t, s.setAttribute("aria-label", e), s.title = e, s.hidden = i, s.appendChild(n), s;
16556
16557
  }
@@ -16562,10 +16563,10 @@ function s_() {
16562
16563
  width: "0",
16563
16564
  height: "0"
16564
16565
  }), e = le("defs");
16565
- return e.appendChild(Kr("pluno-pa-scribble-wobble", "2", "12")), e.appendChild(
16566
- Kr("pluno-pa-scribble-wobble-2", "5", "15")
16566
+ return e.appendChild(Wr("pluno-pa-scribble-wobble", "2", "12")), e.appendChild(
16567
+ Wr("pluno-pa-scribble-wobble-2", "5", "15")
16567
16568
  ), e.appendChild(
16568
- Kr("pluno-pa-scribble-wobble-3", "9", "19")
16569
+ Wr("pluno-pa-scribble-wobble-3", "9", "19")
16569
16570
  ), t.appendChild(e), t;
16570
16571
  }
16571
16572
  function lp(t, e) {
@@ -16577,16 +16578,16 @@ function lp(t, e) {
16577
16578
  });
16578
16579
  return dp(n, e), n;
16579
16580
  }
16580
- function Hr(t, e) {
16581
+ function Kr(t, e) {
16581
16582
  if (!t)
16582
16583
  return;
16583
16584
  const n = Math.max(
16584
16585
  0,
16585
- e - Ta * 2
16586
+ e - Pa * 2
16586
16587
  ), i = Math.max(
16587
16588
  vw,
16588
16589
  Math.floor(
16589
- (n - Ra * 2) / Aa
16590
+ (n - Ta * 2) / Ra
16590
16591
  )
16591
16592
  );
16592
16593
  dp(t, i);
@@ -16594,14 +16595,14 @@ function Hr(t, e) {
16594
16595
  function dp(t, e) {
16595
16596
  if (t.dataset.spiralCount === `${e}`)
16596
16597
  return;
16597
- const n = e * Aa + Ra * 2;
16598
+ const n = e * Ra + Ta * 2;
16598
16599
  t.dataset.spiralCount = `${e}`, t.setAttribute(
16599
16600
  "viewBox",
16600
16601
  `0 0 ${n} ${_w}`
16601
16602
  ), t.replaceChildren();
16602
16603
  for (let i = 0; i < e; i += 1) {
16603
16604
  const s = ud[i % ud.length], o = le("g", {
16604
- transform: `translate(${Ra + i * Aa} 0)`
16605
+ transform: `translate(${Ta + i * Ra} 0)`
16605
16606
  });
16606
16607
  o.appendChild(
16607
16608
  le("ellipse", {
@@ -16625,7 +16626,7 @@ function dp(t, e) {
16625
16626
  ), t.appendChild(o);
16626
16627
  }
16627
16628
  }
16628
- function Kr(t, e, n) {
16629
+ function Wr(t, e, n) {
16629
16630
  const i = le("filter", {
16630
16631
  id: t,
16631
16632
  x: "-8%",
@@ -16668,7 +16669,7 @@ function Kr(t, e, n) {
16668
16669
  })
16669
16670
  ), i;
16670
16671
  }
16671
- function qa(t) {
16672
+ function Ma(t) {
16672
16673
  const e = It(
16673
16674
  "0 0 24 24",
16674
16675
  t,
@@ -16908,7 +16909,7 @@ function g_(t, e, n) {
16908
16909
  }
16909
16910
  }
16910
16911
  function f_(t) {
16911
- const e = oc(t), n = co(t);
16912
+ const e = oc(t), n = lo(t);
16912
16913
  if (e === "image" && n) {
16913
16914
  const i = document.createElement("img");
16914
16915
  return i.src = n, i.alt = "", i.setAttribute("aria-hidden", "true"), i.addEventListener(
@@ -16929,7 +16930,7 @@ function f_(t) {
16929
16930
  return $n(t);
16930
16931
  }
16931
16932
  function m_(t, e) {
16932
- const n = oc(t), i = co(t);
16933
+ const n = oc(t), i = lo(t);
16933
16934
  if (n === "image" && i) {
16934
16935
  const s = document.createElement("img");
16935
16936
  s.className = "pluno-pa-widget__message-attachment-preview", s.alt = t.name;
@@ -16956,7 +16957,7 @@ function m_(t, e) {
16956
16957
  };
16957
16958
  let a = i;
16958
16959
  const r = () => {
16959
- const c = co(o);
16960
+ const c = lo(o);
16960
16961
  if (c && c !== a) {
16961
16962
  a = c, s.src = c;
16962
16963
  return;
@@ -16976,7 +16977,7 @@ function y_(t, e, n, i, s, o) {
16976
16977
  $n(e(), "message")
16977
16978
  );
16978
16979
  }, l = () => {
16979
- const f = co(e());
16980
+ const f = lo(e());
16980
16981
  if (f && f !== a) {
16981
16982
  a = f, t.addEventListener("error", l, {
16982
16983
  once: !0
@@ -17033,7 +17034,7 @@ function $n(t, e = "composer") {
17033
17034
  function oc(t) {
17034
17035
  return t.mimeType.startsWith("image/") ? "image" : t.mimeType === "application/pdf" ? "pdf" : t.mimeType.startsWith("video/") ? "video" : "file";
17035
17036
  }
17036
- function co(t) {
17037
+ function lo(t) {
17037
17038
  return "previewUrl" in t && t.previewUrl ? t.previewUrl : t.fileUrl ?? "";
17038
17039
  }
17039
17040
  function Ed(t) {
@@ -17079,7 +17080,7 @@ function v_(t, e) {
17079
17080
  const i = document.createElement("span");
17080
17081
  i.append("Using cheaper model - ");
17081
17082
  const s = document.createElement("a");
17082
- return s.href = t.pricingUrl, s.target = "_blank", s.rel = "noopener noreferrer", s.textContent = "upgrade here", i.appendChild(s), n.appendChild(i), n;
17083
+ return s.href = t.pricingUrl, s.target = "_blank", s.rel = "noopener noreferrer", s.textContent = t.pricingUrl.startsWith("mailto:") ? "contact support" : "upgrade here", i.appendChild(s), n.appendChild(i), n;
17083
17084
  }
17084
17085
  function I_(t) {
17085
17086
  const e = document.createElement("div");
@@ -17087,10 +17088,10 @@ function I_(t) {
17087
17088
  const n = t.submissionGate?.reason, i = n === "credits_exhausted", s = n === "onboarding_required", o = document.createElement("strong");
17088
17089
  o.textContent = s ? "Complete onboarding" : i ? "Credits used up" : "Billing needs attention", e.appendChild(o);
17089
17090
  const a = document.createElement("span");
17090
- if (a.textContent = s ? "Complete onboarding to unlock credits and start using Pluno." : i ? "Earn bonus credits or upgrade to keep using Pluno on this product." : "Open billing to keep using Pluno.", e.appendChild(a), s) {
17091
+ if (a.textContent = s ? "Complete onboarding to unlock credits and start using Pluno." : t.pricingUrl.startsWith("mailto:") ? "Contact support to continue your product trial." : i ? "Earn bonus credits or upgrade to keep using Pluno on this product." : "Open billing to keep using Pluno.", e.appendChild(a), s) {
17091
17092
  const r = document.createElement("div");
17092
17093
  r.className = "pluno-pa-widget__billing-action-card-actions", r.appendChild(
17093
- Ma("Complete onboarding", t.onboardingUrl ?? "")
17094
+ Js("Complete onboarding", t.onboardingUrl ?? "")
17094
17095
  ), e.appendChild(r);
17095
17096
  } else
17096
17097
  e.appendChild(
@@ -17111,13 +17112,13 @@ function $i(t) {
17111
17112
  }
17112
17113
  function k_(t, e, n) {
17113
17114
  const i = document.createElement("div");
17114
- return i.className = n, i.appendChild(
17115
- Ma(e, t.pricingUrl)
17115
+ return i.className = n, t.pricingUrl.startsWith("mailto:") ? (i.appendChild(Js("Contact support", t.pricingUrl)), i) : (i.appendChild(
17116
+ Js(e, t.pricingUrl)
17116
17117
  ), i.appendChild(
17117
- Ma("Earn credits", t.earnCreditsUrl)
17118
- ), i;
17118
+ Js("Earn credits", t.earnCreditsUrl)
17119
+ ), i);
17119
17120
  }
17120
- function Ma(t, e) {
17121
+ function Js(t, e) {
17121
17122
  const n = document.createElement("button");
17122
17123
  if (n.type = "button", t === "Earn credits") {
17123
17124
  const i = document.createElement("span");
@@ -17360,14 +17361,14 @@ function E_(t, e, n, i, s, o, a, r, c, l, u, d, p, f, y, g, b, _, S, x, m, w, I,
17360
17361
  if (L.role === "system") {
17361
17362
  if (L.dataType === "run_error" || L.dataType === "run_status") {
17362
17363
  const $ = K(), J = U.some(
17363
- (se) => se.role === "tool" && lo(se, L)
17364
+ (se) => se.role === "tool" && uo(se, L)
17364
17365
  );
17365
17366
  if (!$ && !J) {
17366
17367
  const se = es(g());
17367
17368
  se.classList.add("pluno-pa-widget__terminal-marker"), Z(se);
17368
17369
  }
17369
17370
  const H = document.createElement("div"), de = L.dataType === "run_error";
17370
- if (H.className = de ? "pluno-pa-widget__error" : "pluno-pa-widget__status pluno-pa-widget__run-status", H.dataset.messageKey = rc(L), H.dataset.canonicalItemKey = L.id, H.dataset.messageRole = "system", L.provisional || (H.dataset.terminalResponseKey = L.id), L.runId && (H.dataset.runId = L.runId), H.textContent = uo(
17371
+ if (H.className = de ? "pluno-pa-widget__error" : "pluno-pa-widget__status pluno-pa-widget__run-status", H.dataset.messageKey = rc(L), H.dataset.canonicalItemKey = L.id, H.dataset.messageRole = "system", L.provisional || (H.dataset.terminalResponseKey = L.id), L.runId && (H.dataset.runId = L.runId), H.textContent = po(
17371
17372
  L.content
17372
17373
  ), de && L.securitySettingsUrl) {
17373
17374
  const se = document.createElement("a");
@@ -17378,8 +17379,8 @@ function E_(t, e, n, i, s, o, a, r, c, l, u, d, p, f, y, g, b, _, S, x, m, w, I,
17378
17379
  continue;
17379
17380
  }
17380
17381
  L.role;
17381
- const ce = K(), Y = uo(L.content), X = L.role === "assistant" && U.some(
17382
- ($) => $.role === "tool" && lo($, L)
17382
+ const ce = K(), Y = po(L.content), X = L.role === "assistant" && U.some(
17383
+ ($) => $.role === "tool" && uo($, L)
17383
17384
  );
17384
17385
  if (L.role === "assistant" && !ce && !X) {
17385
17386
  const $ = es(g());
@@ -17647,7 +17648,7 @@ function U_(t) {
17647
17648
  if (!n.respondsToUserMessageId)
17648
17649
  return [...t.messages, n];
17649
17650
  const i = t.messages.findIndex(
17650
- (a) => lo(a, n) && Oa(a)
17651
+ (a) => uo(a, n) && Oa(a)
17651
17652
  );
17652
17653
  if (i !== -1)
17653
17654
  return [
@@ -17657,7 +17658,7 @@ function U_(t) {
17657
17658
  ];
17658
17659
  let s = -1;
17659
17660
  for (let a = t.messages.length - 1; a >= 0; a -= 1)
17660
- if (lo(t.messages[a], n)) {
17661
+ if (uo(t.messages[a], n)) {
17661
17662
  s = a;
17662
17663
  break;
17663
17664
  }
@@ -17675,7 +17676,7 @@ function z_(t, e) {
17675
17676
  return a ? s.has(a.id) ? [] : (s.add(a.id), a.activityIds.flatMap((r) => n.has(r) ? [n.get(r)] : [])) : [o];
17676
17677
  });
17677
17678
  }
17678
- function lo(t, e) {
17679
+ function uo(t, e) {
17679
17680
  return t.respondsToUserMessageId && e.respondsToUserMessageId ? t.respondsToUserMessageId === e.respondsToUserMessageId : !!(t.runId && t.runId === e.runId);
17680
17681
  }
17681
17682
  function mp(t) {
@@ -17814,7 +17815,7 @@ function H_(t) {
17814
17815
  function bp(t) {
17815
17816
  return t.role === "tool" && t.toolName === Va;
17816
17817
  }
17817
- function uo(t) {
17818
+ function po(t) {
17818
17819
  return t.replace(/\uE200[^\uE201]*(?:\uE201|$)/g, "");
17819
17820
  }
17820
17821
  function K_(t, e, n, i, s, o, a, r = !0) {
@@ -17833,7 +17834,7 @@ function K_(t, e, n, i, s, o, a, r = !0) {
17833
17834
  a
17834
17835
  ), I = JSON.stringify(a), E = document.createElement("div");
17835
17836
  E.className = "pluno-pa-widget__tool-active-content";
17836
- const T = vo(), k = document.createElement("details"), M = document.createElement("summary");
17837
+ const T = Io(), k = document.createElement("details"), M = document.createElement("summary");
17837
17838
  M.className = "pluno-pa-widget__tool-summary";
17838
17839
  const q = document.createElement("div");
17839
17840
  q.className = "pluno-pa-widget__tool-summary-title", M.appendChild(q), M.addEventListener("click", () => {
@@ -17880,7 +17881,7 @@ function K_(t, e, n, i, s, o, a, r = !0) {
17880
17881
  }
17881
17882
  const g = d.details;
17882
17883
  g.open = n.has(l) || !n.has(`closed:${l}`) && !r, f.classList.toggle("pluno-pa-widget__tool-group--open", g.open);
17883
- const b = t[t.length - 1], _ = uo(
17884
+ const b = t[t.length - 1], _ = po(
17884
17885
  b.content
17885
17886
  ).trim(), S = b.phase === "commentary", x = _ ? S ? _ : _p(_) : c ? "Steered" : "Thinking...";
17886
17887
  return f.dataset.collapsedActivityTitle = x, d.summaryTitle.replaceChildren(), d.summaryTitle.classList.add(
@@ -17902,7 +17903,7 @@ function W_(t, e, n, i) {
17902
17903
  i.set(l, u), u.className = "pluno-pa-widget__tool-line", u.dataset.eventType = c.phase === "commentary" ? "commentary" : "tool", c.phase === "commentary" ? delete u.dataset.toolCallKey : u.dataset.toolCallKey = l, u.dataset.canonicalItemKey = c.id, c.runId ? u.dataset.runId = c.runId : delete u.dataset.runId;
17903
17904
  const d = u.querySelector(".pluno-pa-widget__tool-line-text") ?? document.createElement("div");
17904
17905
  d.className = "pluno-pa-widget__tool-line-text";
17905
- const p = uo(c.content) || (c.phase === "commentary" ? "" : "Run tool"), f = c.phase === "commentary" ? p : _p(p);
17906
+ const p = po(c.content) || (c.phase === "commentary" ? "" : "Run tool"), f = c.phase === "commentary" ? p : _p(p);
17906
17907
  s[r] ? (d.classList.add("pluno-pa-widget__tool-line-text--loading"), d.dataset.loadingText = wf(f)) : delete d.dataset.loadingText, d.classList.add("pluno-pa-widget__tool-line-markdown"), d.replaceChildren();
17907
17908
  const y = document.createElement("div");
17908
17909
  if (y.className = "pluno-pa-widget__tool-line-markdown", cc(y, f), d.append(y), s[r]) {
@@ -17962,7 +17963,7 @@ function Rd(t, e, n, i, s = "Thinking...") {
17962
17963
  a.character?.replaceWith(c), a.character = c, a.characterSignature = r;
17963
17964
  }
17964
17965
  } else {
17965
- const c = es(i), l = vo(s);
17966
+ const c = es(i), l = Io(s);
17966
17967
  c.classList.add("pluno-pa-widget__thinking-marker"), c.appendChild(l), a = {
17967
17968
  node: c,
17968
17969
  status: l,
@@ -17977,7 +17978,7 @@ function Td(t, e, n, i = "Thinking...") {
17977
17978
  e.add(s);
17978
17979
  let o = t.get(s);
17979
17980
  if (!o) {
17980
- const a = vo(i);
17981
+ const a = Io(i);
17981
17982
  o = { node: a, status: a }, t.set(s, o);
17982
17983
  }
17983
17984
  return vp(o.status, i), o.node;
@@ -17986,7 +17987,7 @@ function G_(t) {
17986
17987
  const e = es(t), n = document.createElement("div");
17987
17988
  return n.className = "pluno-pa-widget__status", n.textContent = "Steered", e.appendChild(n), e;
17988
17989
  }
17989
- function vo(t = "Thinking...") {
17990
+ function Io(t = "Thinking...") {
17990
17991
  const e = document.createElement("div");
17991
17992
  e.className = "pluno-pa-widget__status", e.dataset.thinkingStatus = "true";
17992
17993
  const n = document.createElement("span");
@@ -18009,7 +18010,7 @@ function bn() {
18009
18010
  function ac(t, e) {
18010
18011
  t.setAttribute("aria-label", e ? "Stop" : "Send"), t.classList.toggle("pluno-pa-widget__send--stop", e), t.replaceChildren(e ? u_() : up());
18011
18012
  }
18012
- function Wr(t) {
18013
+ function Vr(t) {
18013
18014
  let e = t.trim();
18014
18015
  if (!e.includes("|"))
18015
18016
  return null;
@@ -18028,7 +18029,7 @@ function Q_(t) {
18028
18029
  return e.startsWith(":") && e.endsWith(":") ? "center" : e.endsWith(":") ? "right" : e.startsWith(":") ? "left" : null;
18029
18030
  }
18030
18031
  function Y_(t, e) {
18031
- const n = Wr(t[e] ?? ""), i = Wr(t[e + 1] ?? "");
18032
+ const n = Vr(t[e] ?? ""), i = Vr(t[e + 1] ?? "");
18032
18033
  if (!n || !i || n.length !== i.length)
18033
18034
  return null;
18034
18035
  const s = [];
@@ -18048,7 +18049,7 @@ function Y_(t, e) {
18048
18049
  const l = document.createElement("tbody");
18049
18050
  let u = e + 2;
18050
18051
  for (; u < t.length && t[u].trim(); ) {
18051
- const d = Wr(t[u]);
18052
+ const d = Vr(t[u]);
18052
18053
  if (!d)
18053
18054
  break;
18054
18055
  const p = document.createElement("tr");
@@ -19911,7 +19912,7 @@ function Pd(t, e) {
19911
19912
  left: 0;
19912
19913
  }
19913
19914
  .pluno-pa-widget--proactive-suggestion-below .pluno-pa-widget__proactive-suggestion {
19914
- top: calc(var(--pluno-pa-launcher-height) + ${Ca}px);
19915
+ top: calc(var(--pluno-pa-launcher-height) + ${Aa}px);
19915
19916
  bottom: auto;
19916
19917
  }
19917
19918
  .pluno-pa-widget__proactive-suggestion-slot {
@@ -21066,8 +21067,8 @@ function Pd(t, e) {
21066
21067
  .pluno-pa-widget--scribble .pluno-pa-widget__scribble-spirals--panel {
21067
21068
  position: absolute;
21068
21069
  top: -16px;
21069
- left: ${Ta}px;
21070
- width: calc(100% - ${Ta * 2}px);
21070
+ left: ${Pa}px;
21071
+ width: calc(100% - ${Pa * 2}px);
21071
21072
  height: 36px;
21072
21073
  z-index: 3;
21073
21074
  filter: url(#pluno-pa-scribble-wobble-2);
@@ -21690,9 +21691,9 @@ function iv(t) {
21690
21691
  return { clientId: t, release: () => {
21691
21692
  } };
21692
21693
  let e = 0;
21693
- for (; Ur.has(e); )
21694
+ for (; zr.has(e); )
21694
21695
  e += 1;
21695
- Ur.add(e);
21696
+ zr.add(e);
21696
21697
  const n = `${ow}${e}`;
21697
21698
  let i = crypto.randomUUID();
21698
21699
  try {
@@ -21703,7 +21704,7 @@ function iv(t) {
21703
21704
  return {
21704
21705
  clientId: i,
21705
21706
  release: () => {
21706
- s || (s = !0, Ur.delete(e));
21707
+ s || (s = !0, zr.delete(e));
21707
21708
  }
21708
21709
  };
21709
21710
  }
@@ -21720,7 +21721,7 @@ function sv(t) {
21720
21721
  (i) => typeof i == "string"
21721
21722
  ) : [],
21722
21723
  launcherPosition: rv(n.launcherPosition) ? n.launcherPosition : null,
21723
- panelSize: av(n.panelSize) ? wo(n.panelSize) : null
21724
+ panelSize: av(n.panelSize) ? _o(n.panelSize) : null
21724
21725
  };
21725
21726
  } catch {
21726
21727
  return Md();