@burdenoff/fe-libs 2026.1115.5 → 2026.1115.6

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.
@@ -7,268 +7,268 @@ import { useAssistantVisualViewport as i } from "./useAssistantVisualViewport.js
7
7
  import { assistantPanelOwnsEscape as a } from "./panelOverlays.js";
8
8
  import { AssistantPanelPlaceholder as o } from "./AssistantPanelPlaceholder.js";
9
9
  import { scheduleAssistantPanelPreload as s, useAssistantPanelLoaded as c, useAssistantPanelModule as l } from "./assistantPanelLoader.js";
10
- import { ASSISTANT_COMPACT_DOCKED_DEFAULT_QUERY as u, ASSISTANT_DOCK_WIDTH_VAR as d, ASSISTANT_OVERLAY_DESKTOP_QUERY as f, ASSISTANT_OVERLAY_TOP_VAR as p, ASSISTANT_PANEL_INSET_VAR as te, ASSISTANT_SHEET_BOTTOM_VAR as ne, ASSISTANT_WINDOW_BOTTOM_VAR as re, assistantCompactLauncherBottom as m, assistantCompactLauncherVisibility as ie, assistantCompactOverlayClassName as ae, assistantCompactOverlayKeys as oe, assistantLauncherBottom as h, assistantLauncherRight as g, assistantOverlayClassName as _, assistantOverlayEscapeAction as se, assistantOverlayKeys as ce, assistantQuotaKindOf as v, assistantWindowBottom as le, closestAround as ue, createAssistantNavigate as y, isAssistantSurface as de, isAssistantToggleShortcut as fe, nextAssistantOpenState as pe, publishedAssistantDockWidth as me, publishedAssistantPanelInset as he, publishedCompactDockWidth as ge, publishedCompactPanelInset as _e, readAssistantLayoutChoice as b, readAssistantLegacyDockChoice as x, readAssistantOverlayFlag as S, readAssistantWindowView as ve, requestedAssistantOpenState as C, resolveCompactDocked as w, writeAssistantLayoutChoice as T, writeAssistantOverlayFlag as E, writeAssistantWindowView as D } from "./assistantOverlayState.js";
11
- import { AskAboutLayer as O } from "../askAbout/AskAboutLayer.js";
12
- import { useAssistantSignInWarm as ye } from "../useAssistantSignInWarm.js";
13
- import { useAssistantProductOrNull as be } from "../product.js";
14
- import { createContext as k, useCallback as A, useContext as j, useEffect as M, useMemo as xe, useRef as N, useState as P, useSyncExternalStore as F } from "react";
15
- import { Sparkles as Se } from "lucide-react";
16
- import { jsx as I, jsxs as Ce } from "react/jsx-runtime";
17
- import { createPortal as we } from "react-dom";
10
+ import { ASSISTANT_COMPACT_DOCKED_DEFAULT_QUERY as u, ASSISTANT_DOCK_WIDTH_VAR as d, ASSISTANT_OVERLAY_DESKTOP_QUERY as f, ASSISTANT_OVERLAY_TOP_VAR as p, ASSISTANT_PANEL_INSET_VAR as te, ASSISTANT_SHEET_BOTTOM_VAR as ne, ASSISTANT_WINDOW_BOTTOM_VAR as re, assistantCompactLauncherBottom as m, assistantCompactLauncherVisibility as ie, assistantCompactOverlayClassName as ae, assistantCompactOverlayKeys as oe, assistantLauncherBottom as h, assistantLauncherRight as g, assistantOverlayClassName as _, assistantOverlayEscapeAction as se, assistantOverlayKeys as ce, assistantQuotaKindOf as v, assistantWindowBottom as le, closestAround as ue, createAssistantNavigate as y, isAssistantSurface as de, isAssistantToggleShortcut as fe, nextAssistantOpenState as pe, publishedAssistantDockWidth as me, publishedAssistantPanelInset as he, publishedCompactDockWidth as ge, publishedCompactPanelInset as _e, readAssistantLayoutChoice as ve, readAssistantLegacyDockChoice as b, readAssistantOverlayFlag as x, readAssistantWindowView as S, requestedAssistantOpenState as ye, resolveCompactDocked as C, writeAssistantLayoutChoice as w, writeAssistantOverlayFlag as T, writeAssistantWindowView as be } from "./assistantOverlayState.js";
11
+ import { AskAboutLayer as E } from "../askAbout/AskAboutLayer.js";
12
+ import { useAssistantSignInWarm as xe } from "../useAssistantSignInWarm.js";
13
+ import { useAssistantProductOrNull as Se } from "../product.js";
14
+ import { createContext as D, useCallback as O, useContext as k, useEffect as A, useMemo as Ce, useRef as j, useState as M, useSyncExternalStore as N } from "react";
15
+ import { Sparkles as we } from "lucide-react";
16
+ import { jsx as P, jsxs as Te } from "react/jsx-runtime";
17
+ import { createPortal as Ee } from "react-dom";
18
18
  // src/shared/assistant/ui/AssistantOverlay.tsx
19
- var L = "flex min-h-0 flex-1 flex-col";
20
- function Te() {
19
+ var F = "flex min-h-0 flex-1 flex-col";
20
+ function I() {
21
21
  if (typeof document > "u") return null;
22
22
  let e = document.createElement("div");
23
- return e.setAttribute("class", L), e.setAttribute("data-assistant-panel-root", ""), e;
23
+ return e.setAttribute("class", F), e.setAttribute("data-assistant-panel-root", ""), e;
24
24
  }
25
- var R = k(null);
26
- function z() {
27
- return j(R);
28
- }
29
- function Ee() {
30
- return j(R)?.dockWidthPx ?? 0;
25
+ var L = D(null);
26
+ function R() {
27
+ return k(L);
31
28
  }
32
29
  function De() {
33
- return j(R)?.panelInsetPx ?? 0;
30
+ return k(L)?.dockWidthPx ?? 0;
31
+ }
32
+ function Oe() {
33
+ return k(L)?.panelInsetPx ?? 0;
34
34
  }
35
- var B = () => typeof window > "u" ? void 0 : window.sessionStorage, V = () => typeof window > "u" ? void 0 : window.localStorage;
36
- function H(e) {
35
+ var z = () => typeof window > "u" ? void 0 : window.sessionStorage, B = () => typeof window > "u" ? void 0 : window.localStorage;
36
+ function V(e) {
37
37
  if (typeof window > "u" || typeof window.matchMedia != "function") return () => {};
38
38
  let t = window.matchMedia(f);
39
39
  return t.addEventListener("change", e), () => t.removeEventListener("change", e);
40
40
  }
41
- function U() {
41
+ function H() {
42
42
  return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(min-width: 640px)").matches;
43
43
  }
44
- function Oe() {
45
- return F(H, U, () => !1);
44
+ function ke() {
45
+ return N(V, H, () => !1);
46
46
  }
47
- function ke(t, n) {
48
- let r = N(n);
49
- M(() => {
47
+ function Ae(t, n) {
48
+ let r = j(n);
49
+ A(() => {
50
50
  r.current = n;
51
- }, [n]), M(() => {
51
+ }, [n]), A(() => {
52
52
  if (!t || typeof window > "u") return;
53
53
  let n = e(t), ee = (e) => r.current(v(e), e);
54
54
  return window.addEventListener(n, ee), () => window.removeEventListener(n, ee);
55
55
  }, [t]);
56
56
  }
57
- var Ae = () => {};
58
- function W(e) {
57
+ var je = () => {};
58
+ function U(e) {
59
59
  if (typeof window > "u" || typeof window.matchMedia != "function") return () => {};
60
60
  let t = window.matchMedia(u);
61
61
  return t.addEventListener("change", e), () => t.removeEventListener("change", e);
62
62
  }
63
- function G() {
63
+ function W() {
64
64
  return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(min-width: 1280px)").matches;
65
65
  }
66
- var K = () => () => {}, q = () => !1;
67
- function je(e) {
68
- return F(e ? W : K, e ? G : q, q);
66
+ var G = () => () => {}, K = () => !1;
67
+ function Me(e) {
68
+ return N(e ? U : G, e ? W : K, K);
69
69
  }
70
- function J({ keyPrefix: e, quota: t, presentation: n = "classic", pageSurface: r = !1, children: ee }) {
71
- let i = xe(() => ce(e), [e]), a = xe(() => oe(e), [e]), o = n === "compact", s = N(o);
72
- M(() => {
70
+ function q({ keyPrefix: e, quota: t, presentation: n = "classic", pageSurface: r = !1, children: ee }) {
71
+ let i = Ce(() => ce(e), [e]), a = Ce(() => oe(e), [e]), o = n === "compact", s = j(o);
72
+ A(() => {
73
73
  s.current = o;
74
74
  }, [o]);
75
- let [c] = P(() => r ? Te() : null), l = N([]), [u, f] = P(null), p = N(!1), [ne, re] = P(null), m = A((e) => {
75
+ let [c] = M(() => r ? I() : null), l = j([]), [u, f] = M(null), p = j(!1), [ne, re] = M(null), m = O((e) => {
76
76
  re((t) => ({
77
77
  seq: (t?.seq ?? 0) + 1,
78
78
  force: e
79
79
  }));
80
- }, []), ie = A((e) => (l.current = [...l.current.filter((t) => t !== e), e], p.current = !0, c && e.appendChild(c), f(e), m(!1), () => {
80
+ }, []), ie = O((e) => (l.current = [...l.current.filter((t) => t !== e), e], p.current = !0, c && e.appendChild(c), f(e), m(!1), () => {
81
81
  l.current = l.current.filter((t) => t !== e);
82
82
  let t = l.current.at(-1) ?? null;
83
83
  p.current = t !== null, t && c && t.appendChild(c), f(t);
84
- }), [c, m]), ae = c !== null && u !== null, [h, g] = P(() => S(B, i.openStorageKey)), [_, se] = P(() => S(V, i.dockStorageKey)), [v, le] = P(() => {
84
+ }), [c, m]), ae = c !== null && u !== null, [h, g] = M(() => x(z, i.openStorageKey)), [_, se] = M(() => x(B, i.dockStorageKey)), [v, le] = M(() => {
85
85
  if (!o) return "panel";
86
86
  try {
87
- let e = B()?.getItem(a.surfaceStorageKey);
87
+ let e = z()?.getItem(a.surfaceStorageKey);
88
88
  return de(e) ? e : "panel";
89
89
  } catch {
90
90
  return "panel";
91
91
  }
92
- }), [ue, y] = P(() => o && S(B, a.minimizedStorageKey)), O = o && h && v === "window" && ue, [ye, be] = P(!1), k = o && h && v === "panel" && ye, [j] = P(() => o ? ve(V, a.windowViewStorageKey) : null), [F, Se] = P(null), Ce = F ?? j, we = A((e) => {
93
- s.current && Se(e);
94
- }, []), [L] = P(() => o ? {
95
- explicit: b(V, a.layoutStorageKey),
96
- legacy: x(V, i.dockStorageKey)
92
+ }), [ue, y] = M(() => o && x(z, a.minimizedStorageKey)), E = o && h && v === "window" && ue, [xe, Se] = M(!1), D = o && h && v === "panel" && xe, [k] = M(() => o ? S(B, a.windowViewStorageKey) : null), [N, we] = M(null), Te = N ?? k, Ee = O((e) => {
93
+ s.current && we(e);
94
+ }, []), [F] = M(() => o ? {
95
+ explicit: ve(B, a.layoutStorageKey),
96
+ legacy: b(B, i.dockStorageKey)
97
97
  } : {
98
98
  explicit: null,
99
99
  legacy: null
100
- }), [z, Ee] = P(null), De = je(o), H = o ? w({
101
- explicit: z ?? L.explicit,
102
- legacy: L.legacy,
103
- wideViewport: De
104
- }) : _, U = N(H);
105
- M(() => {
106
- U.current = H;
107
- }, [H]);
108
- let W = N(null), G = N(h);
109
- M(() => {
110
- G.current = h;
100
+ }), [R, De] = M(null), Oe = Me(o), V = o ? C({
101
+ explicit: R ?? F.explicit,
102
+ legacy: F.legacy,
103
+ wideViewport: Oe
104
+ }) : _, H = j(V);
105
+ A(() => {
106
+ H.current = V;
107
+ }, [V]);
108
+ let U = j(null), W = j(h);
109
+ A(() => {
110
+ W.current = h;
111
111
  }, [h]);
112
- let K = N(!1), q = h && (!o || v === "panel" && !O);
113
- M(() => {
114
- K.current = q;
115
- }, [q]);
116
- let J = A(() => {
117
- let e = W.current?.() === !0;
112
+ let G = j(!1), K = h && (!o || v === "panel" && !E);
113
+ A(() => {
114
+ G.current = K;
115
+ }, [K]);
116
+ let q = O(() => {
117
+ let e = U.current?.() === !0;
118
118
  return e && s.current && y(!1), e;
119
- }, []), Y = A((e) => (W.current = e, () => {
120
- W.current === e && (W.current = null);
121
- }), []), X = A(() => {
119
+ }, []), J = O((e) => (U.current = e, () => {
120
+ U.current === e && (U.current = null);
121
+ }), []), Y = O(() => {
122
122
  g(!0), le("panel"), y(!1);
123
- }, []), Z = A(() => {
124
- g(!1), y(!1), be(!1), Fe(0);
125
- }, []), Q = A(() => {
126
- p.current ? m(!0) : s.current ? X() : g(!0);
127
- }, [X, m]), Me = A(() => {
128
- p.current || J() || (s.current ? Z() : g(!1));
129
- }, [J, Z]), Ne = A(() => {
123
+ }, []), X = O(() => {
124
+ g(!1), y(!1), Se(!1), Ie(0);
125
+ }, []), Z = O(() => {
126
+ p.current ? m(!0) : s.current ? Y() : g(!0);
127
+ }, [Y, m]), Ne = O(() => {
128
+ p.current || q() || (s.current ? X() : g(!1));
129
+ }, [q, X]), Pe = O(() => {
130
130
  if (p.current) m(!0);
131
131
  else if (s.current) {
132
- if (K.current) {
133
- if (J()) return;
134
- Z();
135
- } else X();
136
- } else G.current && J() || g((e) => !e);
132
+ if (G.current) {
133
+ if (q()) return;
134
+ X();
135
+ } else Y();
136
+ } else W.current && q() || g((e) => !e);
137
137
  }, [
138
- J,
139
- Z,
138
+ q,
140
139
  X,
140
+ Y,
141
141
  m
142
- ]), $ = A(() => {
142
+ ]), Fe = O(() => {
143
143
  if (!p.current) {
144
144
  if (s.current) {
145
- let e = U.current ? "floating" : "docked";
146
- U.current = e === "docked", Ee(e);
145
+ let e = H.current ? "floating" : "docked";
146
+ H.current = e === "docked", De(e);
147
147
  } else se((e) => !e);
148
148
  }
149
- }, []), [Pe, Fe] = P(0), Ie = A((e) => {
150
- Q(), s.current && e?.menu === "settings/avatar" && Fe((e) => e + 1);
151
- }, [Q]), Le = A(() => {
152
- p.current ? m(!0) : s.current ? K.current || (g(!0), le("window"), y(!1)) : g(!0);
153
- }, [m]), Re = A(() => {
154
- p.current || s.current && G.current && !K.current && y(!0);
149
+ }, []), [Q, Ie] = M(0), Le = O((e) => {
150
+ Z(), s.current && e?.menu === "settings/avatar" && Ie((e) => e + 1);
151
+ }, [Z]), Re = O(() => {
152
+ p.current ? m(!0) : s.current ? G.current || (g(!0), le("window"), y(!1)) : g(!0);
153
+ }, [m]), ze = O(() => {
154
+ p.current || s.current && W.current && !G.current && y(!0);
155
155
  }, []);
156
- M(() => {
157
- E(B, i.openStorageKey, h);
158
- }, [i.openStorageKey, h]), M(() => {
159
- o || E(V, i.dockStorageKey, _);
156
+ A(() => {
157
+ T(z, i.openStorageKey, h);
158
+ }, [i.openStorageKey, h]), A(() => {
159
+ o || T(B, i.dockStorageKey, _);
160
160
  }, [
161
161
  o,
162
162
  i.dockStorageKey,
163
163
  _
164
- ]), M(() => {
165
- o && z !== null && T(V, a.layoutStorageKey, z);
164
+ ]), A(() => {
165
+ o && R !== null && w(B, a.layoutStorageKey, R);
166
166
  }, [
167
167
  o,
168
168
  a.layoutStorageKey,
169
- z
170
- ]), M(() => {
171
- o && F !== null && D(V, a.windowViewStorageKey, F);
169
+ R
170
+ ]), A(() => {
171
+ o && N !== null && be(B, a.windowViewStorageKey, N);
172
172
  }, [
173
173
  o,
174
174
  a.windowViewStorageKey,
175
- F
176
- ]), M(() => {
175
+ N
176
+ ]), A(() => {
177
177
  if (o) try {
178
- B()?.setItem(a.surfaceStorageKey, v);
178
+ z()?.setItem(a.surfaceStorageKey, v);
179
179
  } catch {}
180
180
  }, [
181
181
  o,
182
182
  a.surfaceStorageKey,
183
183
  v
184
- ]), M(() => {
185
- o && E(B, a.minimizedStorageKey, O);
184
+ ]), A(() => {
185
+ o && T(z, a.minimizedStorageKey, E);
186
186
  }, [
187
187
  o,
188
188
  a.minimizedStorageKey,
189
- O
190
- ]), M(() => {
189
+ E
190
+ ]), A(() => {
191
191
  if (typeof window > "u") return;
192
192
  let e = (e) => {
193
- let t = C(e);
194
- p.current ? t !== !1 && m(!0) : s.current ? t === !0 ? X() : t === !1 ? G.current && !J() && Z() : K.current ? J() || Z() : X() : (!G.current || pe(!0, t) || W.current?.() !== !0) && g((e) => pe(e, t));
193
+ let t = ye(e);
194
+ p.current ? t !== !1 && m(!0) : s.current ? t === !0 ? Y() : t === !1 ? W.current && !q() && X() : G.current ? q() || X() : Y() : (!W.current || pe(!0, t) || U.current?.() !== !0) && g((e) => pe(e, t));
195
195
  };
196
196
  return window.addEventListener(i.toggleEvent, e), () => window.removeEventListener(i.toggleEvent, e);
197
197
  }, [
198
198
  i.toggleEvent,
199
+ Y,
199
200
  X,
200
- Z,
201
- J,
201
+ q,
202
202
  m
203
- ]), M(() => {
203
+ ]), A(() => {
204
204
  if (typeof document > "u") return;
205
205
  let e = (e) => {
206
- fe(e) && (e.preventDefault(), p.current ? m(!0) : s.current ? K.current ? J() || Z() : X() : G.current && W.current?.() === !0 || g((e) => !e));
206
+ fe(e) && (e.preventDefault(), p.current ? m(!0) : s.current ? G.current ? q() || X() : Y() : W.current && U.current?.() === !0 || g((e) => !e));
207
207
  };
208
208
  return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
209
209
  }, [
210
+ Y,
210
211
  X,
211
- Z,
212
- J,
212
+ q,
213
213
  m
214
- ]), ke(t?.product ?? null, t?.onExhausted ?? Ae);
215
- let ze = Oe(), Be = h && !ae, Ve = o ? ge({
216
- isOpen: Be,
217
- docked: H,
218
- isDesktop: ze,
214
+ ]), Ae(t?.product ?? null, t?.onExhausted ?? je);
215
+ let Be = ke(), Ve = h && !ae, $ = o ? ge({
216
+ isOpen: Ve,
217
+ docked: V,
218
+ isDesktop: Be,
219
219
  surface: v,
220
- expanded: k
220
+ expanded: D
221
221
  }) : me({
222
- isOpen: Be,
222
+ isOpen: Ve,
223
223
  docked: _,
224
- isDesktop: ze
224
+ isDesktop: Be
225
225
  }), He = o ? _e({
226
- isOpen: Be,
227
- docked: H,
228
- isDesktop: ze,
226
+ isOpen: Ve,
227
+ docked: V,
228
+ isDesktop: Be,
229
229
  surface: v,
230
- expanded: k
230
+ expanded: D
231
231
  }) : he({
232
- isOpen: Be,
232
+ isOpen: Ve,
233
233
  docked: _,
234
- isDesktop: ze
234
+ isDesktop: Be
235
235
  });
236
- M(() => {
236
+ A(() => {
237
237
  if (typeof document > "u") return;
238
238
  let e = document.documentElement.style;
239
- return e.setProperty(d, `${Ve}px`), () => {
239
+ return e.setProperty(d, `${$}px`), () => {
240
240
  e.removeProperty(d);
241
241
  };
242
- }, [Ve]), M(() => {
242
+ }, [$]), A(() => {
243
243
  if (typeof document > "u") return;
244
244
  let e = document.documentElement.style;
245
245
  return e.setProperty(te, `${He}px`), () => {
246
246
  e.removeProperty(te);
247
247
  };
248
248
  }, [He]);
249
- let Ue = xe(() => ({
249
+ let Ue = Ce(() => ({
250
250
  isOpen: h,
251
- open: Q,
252
- close: Me,
253
- toggle: Ne,
254
- docked: H,
255
- toggleDock: $,
256
- dockWidthPx: Ve,
251
+ open: Z,
252
+ close: Ne,
253
+ toggle: Pe,
254
+ docked: V,
255
+ toggleDock: Fe,
256
+ dockWidthPx: $,
257
257
  panelInsetPx: He,
258
258
  keys: i,
259
- registerCloseGuard: Y,
259
+ registerCloseGuard: J,
260
260
  presentation: n,
261
261
  surface: v,
262
- minimized: O,
263
- fullOpen: q,
264
- openFull: Ie,
265
- avatarSettingsRequest: Pe,
266
- openWindow: Le,
267
- minimize: Re,
268
- expanded: k,
269
- setExpanded: be,
270
- windowView: o ? Ce : null,
271
- setWindowView: we,
262
+ minimized: E,
263
+ fullOpen: K,
264
+ openFull: Le,
265
+ avatarSettingsRequest: Q,
266
+ openWindow: Re,
267
+ minimize: ze,
268
+ expanded: D,
269
+ setExpanded: Se,
270
+ windowView: o ? Te : null,
271
+ setWindowView: Ee,
272
272
  ...c ? {
273
273
  registerPageHost: ie,
274
274
  pageHosted: ae,
@@ -277,90 +277,90 @@ function J({ keyPrefix: e, quota: t, presentation: n = "classic", pageSurface: r
277
277
  } : {}
278
278
  }), [
279
279
  h,
280
- Q,
281
- Me,
280
+ Z,
282
281
  Ne,
283
- H,
282
+ Pe,
283
+ V,
284
+ Fe,
284
285
  $,
285
- Ve,
286
286
  He,
287
287
  i,
288
- Y,
288
+ J,
289
289
  n,
290
290
  v,
291
- O,
292
- q,
293
- Ie,
294
- Pe,
291
+ E,
292
+ K,
295
293
  Le,
294
+ Q,
296
295
  Re,
297
- k,
296
+ ze,
297
+ D,
298
298
  o,
299
- Ce,
300
- we,
299
+ Te,
300
+ Ee,
301
301
  c,
302
302
  ie,
303
303
  ae,
304
304
  ne
305
305
  ]);
306
- return /* @__PURE__ */ I(R.Provider, {
306
+ return /* @__PURE__ */ P(L.Provider, {
307
307
  value: Ue,
308
308
  children: ee
309
309
  });
310
310
  }
311
- function Y(e) {
311
+ function J(e) {
312
312
  let { state: t, retry: n } = l();
313
- if (t.status !== "ready") return /* @__PURE__ */ I(o, {
313
+ if (t.status !== "ready") return /* @__PURE__ */ P(o, {
314
314
  failed: t.status === "failed",
315
315
  onRetry: n
316
316
  });
317
317
  let { AIAssistantPanel: r } = t.module;
318
- return /* @__PURE__ */ I(r, { ...e });
318
+ return /* @__PURE__ */ P(r, { ...e });
319
319
  }
320
- var X = (e, t) => /* @__PURE__ */ I(Y, {
320
+ var Y = (e, t) => /* @__PURE__ */ P(J, {
321
321
  ...e,
322
322
  ...t
323
323
  });
324
- function Z(e) {
325
- let t = z();
326
- return t ? /* @__PURE__ */ I(Q, {
324
+ function X(e) {
325
+ let t = R();
326
+ return t ? /* @__PURE__ */ P(Z, {
327
327
  state: t,
328
328
  ...e
329
329
  }) : null;
330
330
  }
331
- function Q({ state: e, panelId: o = "ai-assistant", panelProps: l, renderPanel: u, navigate: d, isShellLessTarget: f, topOffsetPx: te = 56, launcherIcon: oe, launcherBottomInset: ce = "1.5rem", showLauncher: v = !0, closeOnEscape: de = !0, warmOnSignIn: fe = !0 }) {
332
- let { close: pe, toggle: me, docked: he, toggleDock: ge, dockWidthPx: _e } = e, b = e.pagePanelRoot ?? null, x = b !== null && e.pageHosted === !0, S = e.isOpen && !x, ve = be()?.product ?? "";
333
- ye({
334
- product: ve,
331
+ function Z({ state: e, panelId: o = "ai-assistant", panelProps: l, renderPanel: u, navigate: d, isShellLessTarget: f, topOffsetPx: te = 56, launcherIcon: oe, launcherBottomInset: ce = "1.5rem", showLauncher: v = !0, closeOnEscape: de = !0, warmOnSignIn: fe = !0, askAnywhere: pe = !1 }) {
332
+ let { close: me, toggle: he, docked: ge, toggleDock: _e, dockWidthPx: ve } = e, b = e.pagePanelRoot ?? null, x = b !== null && e.pageHosted === !0, S = e.isOpen && !x, ye = Se()?.product ?? "";
333
+ xe({
334
+ product: ye,
335
335
  enabled: fe,
336
336
  panelOpen: S || x
337
337
  });
338
- let C = e.presentation === "compact", { surface: w, minimized: T, setExpanded: E } = e, D = t();
338
+ let C = e.presentation === "compact", { surface: w, minimized: T, setExpanded: be } = e, D = t();
339
339
  r(l?.serverHistory === !0);
340
- let [k, j] = P(!1), F = N(null), Te = N(null), R = Oe(), [z, Ee] = P(0), [De, B] = P(0), V = c();
341
- M(() => {
342
- z !== 0 && F.current?.querySelector("[data-testid=\"assistant-input\"]")?.focus({ preventScroll: !0 });
343
- }, [z, V]);
344
- let H = !u;
345
- M(() => {
346
- if (H) return s();
347
- }, [H]), M(() => {
348
- De !== 0 && F.current?.querySelector("[data-testid=\"assistant-window-language\"]")?.focus({ preventScroll: !0 });
349
- }, [De, V]), i(F, C && S && !T && !R);
350
- let ke = N(l?.onExpandedChange);
351
- M(() => {
352
- ke.current = l?.onExpandedChange;
340
+ let [k, N] = M(!1), I = j(null), L = j(null), R = ke(), [De, Oe] = M(0), [z, B] = M(0), V = c();
341
+ A(() => {
342
+ De !== 0 && I.current?.querySelector("[data-testid=\"assistant-input\"]")?.focus({ preventScroll: !0 });
343
+ }, [De, V]);
344
+ let Ae = !u;
345
+ A(() => {
346
+ if (Ae) return s();
347
+ }, [Ae]), A(() => {
348
+ z !== 0 && I.current?.querySelector("[data-testid=\"assistant-window-language\"]")?.focus({ preventScroll: !0 });
349
+ }, [z, V]), i(I, C && S && !T && !R);
350
+ let je = j(l?.onExpandedChange);
351
+ A(() => {
352
+ je.current = l?.onExpandedChange;
353
353
  });
354
- let Ae = A((e) => {
355
- E(e), ke.current?.(e);
356
- }, [E]), W = xe(() => d ? y({
354
+ let U = O((e) => {
355
+ be(e), je.current?.(e);
356
+ }, [be]), W = Ce(() => d ? y({
357
357
  navigate: d,
358
358
  isShellLessTarget: f,
359
- isDesktop: U,
360
- collapseSheet: () => j(!1),
359
+ isDesktop: H,
360
+ collapseSheet: () => N(!1),
361
361
  openInNewTab: (e) => window.open(e, "_blank", "noopener,noreferrer")
362
- }) : void 0, [d, f]), G = C && w === "window" ? e.minimize : pe;
363
- M(() => {
362
+ }) : void 0, [d, f]), G = C && w === "window" ? e.minimize : me;
363
+ A(() => {
364
364
  if (!S || !de || T) return;
365
365
  let e = (e) => {
366
366
  se({
@@ -380,34 +380,34 @@ function Q({ state: e, panelId: o = "ai-assistant", panelProps: l, renderPanel:
380
380
  de
381
381
  ]);
382
382
  let K = e.pageFocusRequest ?? null;
383
- M(() => {
383
+ A(() => {
384
384
  if (!x || !K || !b) return;
385
385
  let e = document.activeElement;
386
386
  if (!K.force && e && e !== document.body) return;
387
387
  let t = b.querySelector("[data-testid=\"ai-assistant-panel\"]");
388
- ((U() ? b.querySelector("[data-testid=\"assistant-input\"]") : null) ?? t)?.focus({ preventScroll: !0 });
388
+ ((H() ? b.querySelector("[data-testid=\"assistant-input\"]") : null) ?? t)?.focus({ preventScroll: !0 });
389
389
  }, [
390
390
  x,
391
391
  K,
392
392
  b,
393
393
  V
394
394
  ]);
395
- let q = A((e) => {
395
+ let Me = O((e) => {
396
396
  e && b && b.parentNode !== e && e.appendChild(b);
397
- }, [b]), je = N(T);
398
- M(() => {
399
- if (C && T && !je.current) {
397
+ }, [b]), q = j(T);
398
+ A(() => {
399
+ if (C && T && !q.current) {
400
400
  let e = document.activeElement;
401
- (!e || e === document.body || F.current?.contains(e)) && Te.current?.focus({ preventScroll: !0 });
401
+ (!e || e === document.body || I.current?.contains(e)) && L.current?.focus({ preventScroll: !0 });
402
402
  }
403
- je.current = T;
403
+ q.current = T;
404
404
  }, [C, T]);
405
405
  let J = {
406
406
  panelId: o,
407
407
  visible: x || !T,
408
- onClose: pe,
409
- docked: !x && he,
410
- onToggleDock: ge,
408
+ onClose: me,
409
+ docked: !x && ge,
410
+ onToggleDock: _e,
411
411
  onNavigate: W,
412
412
  isShellLessTarget: f,
413
413
  ...C ? {
@@ -416,43 +416,43 @@ function Q({ state: e, panelId: o = "ai-assistant", panelProps: l, renderPanel:
416
416
  onOpenFull: e.openFull,
417
417
  avatarSettingsRequest: e.avatarSettingsRequest,
418
418
  onMinimize: e.minimize,
419
- onExpandedChange: Ae,
419
+ onExpandedChange: U,
420
420
  windowView: e.windowView,
421
421
  onWindowViewChange: e.setWindowView
422
422
  } : {},
423
423
  ...x ? { pageHosted: !0 } : {}
424
- }, Y = C ? D("overlay.launcherQuick", "Open quick assistant") : D("overlay.launcher", "AI Assistant"), Z = {
424
+ }, X = C ? D("overlay.launcherQuick", "Open quick assistant") : D("overlay.launcher", "AI Assistant"), Z = {
425
425
  [p]: `${te}px`,
426
426
  [ne]: "var(--mobile-tabbar-height, 0px)"
427
- }, Q = {
427
+ }, Ne = {
428
428
  ...Z,
429
429
  [re]: le(ce)
430
- }, Me = C ? ie({
430
+ }, Pe = C ? ie({
431
431
  isOpen: S,
432
432
  surface: w,
433
433
  minimized: T
434
- }) : S ? "desktop-only" : "always", Ne = (t) => {
435
- !C || e.fullOpen ? me() : S && !T ? e.minimize() : (e.openWindow(), R || t.detail === 0 ? Ee((e) => e + 1) : B((e) => e + 1));
436
- }, $ = (S || x) && /* @__PURE__ */ I(ee.Provider, {
434
+ }) : S ? "desktop-only" : "always", Fe = (t) => {
435
+ !C || e.fullOpen ? he() : S && !T ? e.minimize() : (e.openWindow(), R || t.detail === 0 ? Oe((e) => e + 1) : B((e) => e + 1));
436
+ }, Q = (S || x) && /* @__PURE__ */ P(ee.Provider, {
437
437
  value: e.registerCloseGuard ?? null,
438
- children: u ? u(J) : X(l, J)
438
+ children: u ? u(J) : Y(l, J)
439
439
  });
440
- return /* @__PURE__ */ Ce(n, {
440
+ return /* @__PURE__ */ Te(n, {
441
441
  preview: l?.preview,
442
442
  children: [
443
- S && /* @__PURE__ */ Ce("div", {
444
- ref: F,
443
+ S && /* @__PURE__ */ Te("div", {
444
+ ref: I,
445
445
  className: C ? ae({
446
446
  surface: w,
447
447
  minimized: T,
448
- docked: he,
448
+ docked: ge,
449
449
  expanded: e.expanded,
450
450
  sheetExpanded: k
451
451
  }) : _({
452
452
  expanded: k,
453
- docked: he
453
+ docked: ge
454
454
  }),
455
- style: C ? Q : Z,
455
+ style: C ? Ne : Z,
456
456
  "data-testid": "assistant-overlay",
457
457
  ...C ? {
458
458
  id: o,
@@ -463,45 +463,48 @@ function Q({ state: e, panelId: o = "ai-assistant", panelProps: l, renderPanel:
463
463
  "data-minimized": ""
464
464
  } : {}
465
465
  } : {},
466
- children: [/* @__PURE__ */ I("button", {
466
+ children: [/* @__PURE__ */ P("button", {
467
467
  type: "button",
468
- onClick: () => j((e) => !e),
468
+ onClick: () => N((e) => !e),
469
469
  className: "flex w-full shrink-0 justify-center pt-2 pb-1 sm:hidden",
470
470
  "aria-label": k ? D("sheet.collapse", "Shrink the assistant") : D("sheet.expand", "Expand the assistant"),
471
471
  "aria-expanded": k,
472
472
  "data-testid": "assistant-sheet-handle",
473
- children: /* @__PURE__ */ I("span", { className: "h-1.5 w-10 rounded-full bg-border-strong" })
474
- }), b ? /* @__PURE__ */ I("div", {
475
- ref: q,
476
- className: L
477
- }) : /* @__PURE__ */ I("div", {
478
- className: L,
479
- children: $
473
+ children: /* @__PURE__ */ P("span", { className: "h-1.5 w-10 rounded-full bg-border-strong" })
474
+ }), b ? /* @__PURE__ */ P("div", {
475
+ ref: Me,
476
+ className: F
477
+ }) : /* @__PURE__ */ P("div", {
478
+ className: F,
479
+ children: Q
480
480
  })]
481
481
  }),
482
- b && $ && we($, b),
483
- v && !x && /* @__PURE__ */ I("button", {
484
- ref: Te,
482
+ b && Q && Ee(Q, b),
483
+ v && !x && /* @__PURE__ */ P("button", {
484
+ ref: L,
485
485
  type: "button",
486
- onClick: Ne,
487
- title: C ? Y : D("overlay.launcherTitle", "AI Assistant ({{shortcut}})", { shortcut: "Ctrl+Shift+A" }),
488
- "aria-label": Y,
486
+ onClick: Fe,
487
+ title: C ? X : D("overlay.launcherTitle", "AI Assistant ({{shortcut}})", { shortcut: "Ctrl+Shift+A" }),
488
+ "aria-label": X,
489
489
  "aria-haspopup": C ? void 0 : "dialog",
490
490
  "aria-expanded": C ? S && !T : S,
491
491
  ...C && S ? { "aria-controls": o } : {},
492
492
  "data-testid": "assistant-fab",
493
493
  style: {
494
494
  bottom: C ? m(ce) : h(ce),
495
- right: g(_e)
495
+ right: g(ve)
496
496
  },
497
- className: "fixed z-30 size-14 items-center justify-center rounded-full border border-border-strong bg-[var(--color-accent-soft)] text-action-primary-bg shadow-float transition-colors duration-200 hover:border-action-primary-bg focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] cursor-pointer " + (Me === "hidden" ? "hidden" : Me === "desktop-only" ? "hidden sm:inline-flex" : "inline-flex") + (C ? " max-[480px]:[--assistant-consent-clearance:var(--bf-consent-banner-offset,0px)]" : ""),
498
- children: oe ?? /* @__PURE__ */ I(Se, {
497
+ className: "fixed z-30 size-14 items-center justify-center rounded-full border border-border-strong bg-[var(--color-accent-soft)] text-action-primary-bg shadow-float transition-colors duration-200 hover:border-action-primary-bg focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] cursor-pointer " + (Pe === "hidden" ? "hidden" : Pe === "desktop-only" ? "hidden sm:inline-flex" : "inline-flex") + (C ? " max-[480px]:[--assistant-consent-clearance:var(--bf-consent-banner-offset,0px)]" : ""),
498
+ children: oe ?? /* @__PURE__ */ P(we, {
499
499
  className: "size-6",
500
500
  "aria-hidden": "true"
501
501
  })
502
502
  }),
503
- /* @__PURE__ */ I(O, { onOpenAssistant: e.openFull })
503
+ /* @__PURE__ */ P(E, {
504
+ onOpenAssistant: e.openFull,
505
+ anywhere: pe
506
+ })
504
507
  ]
505
508
  });
506
509
  }
507
- export { Z as AssistantOverlay, J as AssistantOverlayProvider, Ee as useAssistantDockWidth, z as useAssistantOverlayOrNull, De as useAssistantPanelInset, ke as useAssistantQuotaExhausted };
510
+ export { X as AssistantOverlay, q as AssistantOverlayProvider, De as useAssistantDockWidth, R as useAssistantOverlayOrNull, Oe as useAssistantPanelInset, Ae as useAssistantQuotaExhausted };