@epam/ai-dial-conversation-input 1.3.0-dev.252 → 1.3.0-dev.256

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.
package/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import { AttachmentErrorReason as e, AttachmentType as t, DeploymentIcon as n, MIME_TYPE_EXT_MAP as r, RESIZABLE_TEXTAREA_CLASS_NAME as i, RequestStatus as a, ResponseFormat as o, SELECT_LIST_MAX_HEIGHT_PX as s, buildCssVars as c, mergeClasses as l, normalizeMimeType as u, useIsMobile as d } from "@epam/ai-dial-chat-shared";
2
- import { BASE_ICON_SIZE as f, BottomSheet as p, Button as m, ButtonVariant as h, CloseButton as g, DIAL_ICON_SIZE as _, DIAL_KIT_ICON_STROKE as v, Dropdown as y, ElementSize as b, ErrorText as x, GhostIconButton as S, Highlight as C, LiveRegion as w, LiveRegionElement as T, LiveRegionPoliteness as E, MenuItemMark as D, NeutralButton as O, NeutralIconButton as k, Notification as A, NotificationType as j, NotificationVariant as M, Popup as N, PopupSize as ee, PrimaryButton as te, PrimaryIconButton as ne, RadioGroup as re, RadioGroupOrientation as ie, Search as ae, Skeleton as P, SkeletonVariant as oe, Slider as F, Spinner as se, Textarea as ce, TextareaResize as le, ToggleChip as ue, Tooltip as de } from "@epam/ai-dial-ui-kit";
3
- import { Fragment as I, jsx as L, jsxs as R } from "react/jsx-runtime";
4
- import { AttachmentTray as fe, MAX_UPLOADS_PER_MINUTE as pe, generateAttachmentId as me, useClipboardPaste as he } from "@epam/ai-dial-attachment-input";
5
- import { IconArrowNarrowRight as ge, IconCheck as _e, IconChevronDown as ve, IconChevronRight as ye, IconFile as be, IconMicrophone as xe, IconPaperclip as Se, IconPlayerStop as Ce, IconPlus as we, IconSettings as Te, IconTool as Ee, IconX as De } from "@tabler/icons-react";
6
- import { createElement as Oe, forwardRef as ke, memo as Ae, useCallback as z, useEffect as B, useId as je, useImperativeHandle as Me, useLayoutEffect as Ne, useMemo as V, useRef as H, useState as U } from "react";
2
+ import { BASE_ICON_SIZE as f, BottomSheet as p, Button as m, ButtonVariant as h, CloseButton as g, DIAL_ICON_SIZE as _, DIAL_KIT_ICON_STROKE as v, Dropdown as y, ElementSize as b, ErrorText as x, GhostIconButton as S, Highlight as C, LiveRegion as w, LiveRegionElement as T, LiveRegionPoliteness as E, MenuItemMark as D, NeutralButton as O, NeutralIconButton as k, Notification as ee, NotificationType as A, NotificationVariant as te, Popup as j, PopupSize as ne, PrimaryButton as M, PrimaryIconButton as re, RadioGroup as ie, RadioGroupOrientation as ae, Search as oe, Skeleton as N, SkeletonVariant as se, Slider as P, Spinner as ce, Textarea as le, TextareaResize as ue, ToggleChip as de, Tooltip as fe } from "@epam/ai-dial-ui-kit";
3
+ import { Fragment as F, jsx as I, jsxs as L } from "react/jsx-runtime";
4
+ import { AttachmentTray as pe, MAX_UPLOADS_PER_MINUTE as me, generateAttachmentId as he, useClipboardPaste as ge } from "@epam/ai-dial-attachment-input";
5
+ import { IconArrowNarrowRight as _e, IconCheck as ve, IconChevronDown as ye, IconChevronRight as be, IconFile as xe, IconMicrophone as Se, IconPaperclip as Ce, IconPlayerStop as we, IconPlus as Te, IconSettings as Ee, IconTool as De, IconX as Oe } from "@tabler/icons-react";
6
+ import { createElement as ke, forwardRef as Ae, memo as je, useCallback as R, useEffect as z, useId as Me, useImperativeHandle as Ne, useLayoutEffect as Pe, useMemo as B, useRef as V, useState as H } from "react";
7
7
  //#region src/constants/public-class-names.ts
8
- var W = {
8
+ var U = {
9
9
  wrapper: "dial-ci-wrapper",
10
10
  actionRow: "dial-ci-action-row",
11
11
  textareaWrap: "dial-ci-textarea-wrap",
@@ -20,19 +20,19 @@ var W = {
20
20
  modelMenuItem: "dial-ci-model-menu-item",
21
21
  modelMenuItemSelected: "dial-ci-model-menu-item-selected",
22
22
  usageBanner: "dial-ci-usage-banner"
23
- }, G = {
23
+ }, W = {
24
24
  backdrop: "_backdrop_1ym62_8",
25
25
  sheet: "_sheet_1ym62_12",
26
26
  title: "_title_1ym62_16",
27
27
  divider: "_divider_1ym62_20"
28
- }, Pe = ({ isOpen: e, title: t, closeLabel: n, onClose: r, onBack: i, backLabel: a, "aria-label": o, style: s, titleClassName: u = "dial-body-semi-text", className: d, colors: f, portalId: m, overlayClassName: h, overlayStyle: g, children: _ }) => {
28
+ }, Fe = ({ isOpen: e, title: t, closeLabel: n, onClose: r, onBack: i, backLabel: a, "aria-label": o, style: s, titleClassName: u = "dial-body-semi-text", className: d, colors: f, portalId: m, overlayClassName: h, overlayStyle: g, children: _ }) => {
29
29
  let v = c({
30
30
  "--ci-backdrop": f?.backdrop,
31
31
  "--ci-sheet-bg": f?.sheetBg,
32
32
  "--ci-sheet-text": f?.sheetText,
33
33
  "--ci-sheet-divider": f?.divider
34
34
  });
35
- return /* @__PURE__ */ L(p, {
35
+ return /* @__PURE__ */ I(p, {
36
36
  open: e,
37
37
  onClose: r,
38
38
  title: t,
@@ -48,30 +48,30 @@ var W = {
48
48
  ...v,
49
49
  ...g
50
50
  },
51
- className: l(G.sheet, d),
52
- overlayClassName: l(G.backdrop, h),
51
+ className: l(W.sheet, d),
52
+ overlayClassName: l(W.backdrop, h),
53
53
  portalId: m,
54
- headerClassName: G.divider,
55
- titleClassName: l(G.title, u),
54
+ headerClassName: W.divider,
55
+ titleClassName: l(W.title, u),
56
56
  children: _
57
57
  });
58
- }, Fe = async (e, t, n) => {
58
+ }, Ie = async (e, t, n) => {
59
59
  let r = 6e4 / t, i = [];
60
60
  for (let t = 0; t < e.length; t++) t > 0 && await new Promise((e) => setTimeout(e, r)), i.push(n(e[t]));
61
61
  await Promise.allSettled(i);
62
- }, Ie = ({ initialAttachments: n, onUploadAttachment: r, onAttachmentsChange: i, validateAttachment: o, pendingDropFiles: s, onDropFilesConsumed: c, isDropDisabled: l = !1, pendingAttachments: u, onPendingAttachmentsConsumed: d, onExpandPastedText: f, maximumAttachmentsAmount: p, baseAttachmentsAmount: m = 0, onAttachmentsLimitExceeded: h }) => {
63
- let [g, _] = U(n), v = H(g);
64
- B(() => {
62
+ }, Le = ({ initialAttachments: n, onUploadAttachment: r, onAttachmentsChange: i, validateAttachment: o, pendingDropFiles: s, onDropFilesConsumed: c, isDropDisabled: l = !1, pendingAttachments: u, onPendingAttachmentsConsumed: d, onExpandPastedText: f, maximumAttachmentsAmount: p, baseAttachmentsAmount: m = 0, onAttachmentsLimitExceeded: h }) => {
63
+ let [g, _] = H(n), v = V(g);
64
+ z(() => {
65
65
  v.current = g;
66
- }, [g]), B(() => () => {
66
+ }, [g]), z(() => () => {
67
67
  v.current.forEach((e) => {
68
68
  e.previewUrl && URL.revokeObjectURL(e.previewUrl), e.playUrl && URL.revokeObjectURL(e.playUrl);
69
69
  });
70
70
  }, []);
71
- let y = z((e) => e.map((e) => {
71
+ let y = R((e) => e.map((e) => {
72
72
  let n = e.type.startsWith("image/"), r = e.type.startsWith("audio/"), i = n ? URL.createObjectURL(e) : void 0, o = r ? URL.createObjectURL(e) : void 0;
73
73
  return {
74
- id: me(),
74
+ id: he(),
75
75
  name: e.name,
76
76
  contentType: e.type,
77
77
  file: e,
@@ -80,22 +80,22 @@ var W = {
80
80
  previewUrl: i,
81
81
  playUrl: o
82
82
  };
83
- }), []), b = H(i);
84
- B(() => {
83
+ }), []), b = V(i);
84
+ z(() => {
85
85
  b.current = i;
86
86
  }, [i]);
87
- let x = H(!0), S = z((e) => {
87
+ let x = V(!0), S = R((e) => {
88
88
  _((t) => {
89
89
  let n = e(t);
90
90
  return n === t ? t : n;
91
91
  });
92
92
  }, []);
93
- B(() => {
93
+ z(() => {
94
94
  x.current ? x.current = !1 : b.current?.(g);
95
95
  }, [g]);
96
- let C = z((e) => {
96
+ let C = R((e) => {
97
97
  _(e);
98
- }, []), w = z(async (t) => {
98
+ }, []), w = R(async (t) => {
99
99
  if (r) {
100
100
  S((e) => e.map((e) => e.id === t.id ? {
101
101
  ...e,
@@ -118,7 +118,7 @@ var W = {
118
118
  } : e));
119
119
  }
120
120
  }
121
- }, [r, S]), T = z((e, t = !0) => {
121
+ }, [r, S]), T = R((e, t = !0) => {
122
122
  let n = new Set(v.current.map((e) => e.id)), r = e.filter((e) => !n.has(e.id));
123
123
  if (r.length !== 0) {
124
124
  if (p != null && p > 0 && Number.isFinite(p)) {
@@ -139,7 +139,7 @@ var W = {
139
139
  status: a.Error,
140
140
  errorReason: n
141
141
  } : e));
142
- }), Fe(e, pe, w);
142
+ }), Ie(e, me, w);
143
143
  }
144
144
  }
145
145
  }, [
@@ -149,8 +149,8 @@ var W = {
149
149
  S,
150
150
  w,
151
151
  o
152
- ]), E = H(/* @__PURE__ */ new WeakSet());
153
- B(() => {
152
+ ]), E = V(/* @__PURE__ */ new WeakSet());
153
+ z(() => {
154
154
  if (s.length === 0) {
155
155
  E.current = /* @__PURE__ */ new WeakSet();
156
156
  return;
@@ -163,13 +163,13 @@ var W = {
163
163
  l,
164
164
  c,
165
165
  s
166
- ]), B(() => {
166
+ ]), z(() => {
167
167
  u.length !== 0 && (T(u, !1), d?.());
168
168
  }, [
169
169
  T,
170
170
  d,
171
171
  u
172
- ]), B(() => {
172
+ ]), z(() => {
173
173
  if (!o) return;
174
174
  let t = !1, n = [], r = v.current.map((r) => {
175
175
  if (r.status === a.Loading) return r;
@@ -196,7 +196,7 @@ var W = {
196
196
  S,
197
197
  w
198
198
  ]);
199
- let D = z((e) => {
199
+ let D = R((e) => {
200
200
  S((t) => {
201
201
  let n = t.find((t) => t.id === e);
202
202
  return n?.previewUrl && URL.revokeObjectURL(n.previewUrl), n?.playUrl && URL.revokeObjectURL(n.playUrl), t.filter((t) => t.id !== e);
@@ -208,11 +208,11 @@ var W = {
208
208
  addAttachments: T,
209
209
  resetAttachments: C,
210
210
  handleRemove: D,
211
- handleRetry: z((e) => {
211
+ handleRetry: R((e) => {
212
212
  let t = g.find((t) => t.id === e);
213
213
  t && w(t);
214
214
  }, [g, w]),
215
- handleExpand: z(async (e) => {
215
+ handleExpand: R(async (e) => {
216
216
  let n = g.find((t) => t.id === e);
217
217
  if (!n || n.type !== t.Pasted) return;
218
218
  let r = await n.file.text();
@@ -224,31 +224,31 @@ var W = {
224
224
  ]),
225
225
  hasBlockedAttachments: g.some((e) => e.status === a.Loading || e.status === a.Error)
226
226
  };
227
- }, Le = (e, t) => {
227
+ }, Re = (e, t) => {
228
228
  let n = t;
229
229
  for (; n < e.length && !/\s/.test(e[n]);) n++;
230
230
  return n;
231
- }, Re = (e, t) => {
231
+ }, ze = (e, t) => {
232
232
  let n = t;
233
233
  for (; n > 0 && !/\s/.test(e[n - 1]);) n--;
234
234
  return {
235
235
  start: n,
236
- end: Le(e, n)
236
+ end: Re(e, n)
237
237
  };
238
- }, ze = (e, t) => e.startsWith(t) && !e.slice(t.length).includes(t), Be = "[role=\"option\"]:not([aria-disabled=\"true\"])", Ve = /* @__PURE__ */ function(e) {
238
+ }, Be = (e, t) => e.startsWith(t) && !e.slice(t.length).includes(t), Ve = "[role=\"option\"]:not([aria-disabled=\"true\"])", He = /* @__PURE__ */ function(e) {
239
239
  return e.Next = "next", e.Previous = "previous", e;
240
- }({}), He = ({ config: e, message: t }) => {
241
- let [n, r] = U(!1), [i, a] = U(null), [o, s] = U(null), c = H(null);
240
+ }({}), Ue = ({ config: e, message: t }) => {
241
+ let [n, r] = H(!1), [i, a] = H(null), [o, s] = H(null), c = V(null);
242
242
  c.current = i;
243
243
  let l = e != null && i != null && i <= t.length ? (() => {
244
- let n = t.slice(i, Le(t, i));
245
- return ze(n, e.triggerPrefix) ? n.slice(e.triggerPrefix.length) : "";
246
- })() : "", u = z((t, n, i) => {
244
+ let n = t.slice(i, Re(t, i));
245
+ return Be(n, e.triggerPrefix) ? n.slice(e.triggerPrefix.length) : "";
246
+ })() : "", u = R((t, n, i) => {
247
247
  if (e == null || i) return;
248
- let { start: c, end: l } = Re(t, n), u = t.slice(c, l);
249
- ze(u, e.triggerPrefix) ? (a(c), u === e.triggerPrefix || o !== c ? (r(!0), s(null)) : r(!1)) : (r(!1), s(null), a(null));
248
+ let { start: c, end: l } = ze(t, n), u = t.slice(c, l);
249
+ Be(u, e.triggerPrefix) ? (a(c), u === e.triggerPrefix || o !== c ? (r(!0), s(null)) : r(!1)) : (r(!1), s(null), a(null));
250
250
  }, [e, o]);
251
- B(() => {
251
+ z(() => {
252
252
  if (e == null) {
253
253
  r(!1), s(null), a(null);
254
254
  return;
@@ -256,25 +256,25 @@ var W = {
256
256
  let n = c.current;
257
257
  if (n == null) return;
258
258
  let i = Math.min(n, t.length);
259
- ze(t.slice(i, Le(t, i)), e.triggerPrefix) || (r(!1), s(null), a(null));
259
+ Be(t.slice(i, Re(t, i)), e.triggerPrefix) || (r(!1), s(null), a(null));
260
260
  }, [e, t]);
261
- let d = z(() => {
261
+ let d = R(() => {
262
262
  r(!1), s(i);
263
- }, [i]), f = z(() => {
263
+ }, [i]), f = R(() => {
264
264
  r(!1);
265
- }, []), p = z((n) => {
265
+ }, []), p = R((n) => {
266
266
  if (e == null) return;
267
- let { start: i, end: s } = Re(t, n);
268
- ze(t.slice(i, s), e.triggerPrefix) ? (a(i), r(o !== i)) : (a(null), r(!1));
267
+ let { start: i, end: s } = ze(t, n);
268
+ Be(t.slice(i, s), e.triggerPrefix) ? (a(i), r(o !== i)) : (a(null), r(!1));
269
269
  }, [
270
270
  e,
271
271
  t,
272
272
  o
273
- ]), m = je(), h = H(null), [g, _] = U(null);
274
- B(() => {
273
+ ]), m = Me(), h = V(null), [g, _] = H(null);
274
+ z(() => {
275
275
  _(null);
276
276
  }, [n, l]);
277
- let v = z(() => Array.from(h.current?.querySelectorAll(Be) ?? []), []), y = z((e) => {
277
+ let v = R(() => Array.from(h.current?.querySelectorAll(Ve) ?? []), []), y = R((e) => {
278
278
  let t = v();
279
279
  if (t.length === 0) {
280
280
  _(null);
@@ -282,7 +282,7 @@ var W = {
282
282
  }
283
283
  let n = t.findIndex((e) => e.id === g), r = t[e === "next" ? (n + 1) % t.length : (n <= 0 ? t.length : n) - 1];
284
284
  _(r.id), r.scrollIntoView?.({ block: "nearest" });
285
- }, [v, g]), b = z(() => v().find((e) => e.id === g) ?? null, [v, g]);
285
+ }, [v, g]), b = R(() => v().find((e) => e.id === g) ?? null, [v, g]);
286
286
  return {
287
287
  isMenuOpen: n,
288
288
  query: l,
@@ -297,18 +297,18 @@ var W = {
297
297
  moveActiveOption: y,
298
298
  getActiveOption: b
299
299
  };
300
- }, Ue = (e, t) => !e.slice(0, t).includes("\n"), We = (e, t) => !e.slice(t).includes("\n"), Ge = (e) => {
301
- let t = H(e);
300
+ }, We = (e, t) => !e.slice(0, t).includes("\n"), Ge = (e, t) => !e.slice(t).includes("\n"), Ke = (e) => {
301
+ let t = V(e);
302
302
  t.current = e;
303
- let n = H(-1), r = H(""), i = z((e, i, a) => {
303
+ let n = V(-1), r = V(""), i = R((e, i, a) => {
304
304
  let o = t.current;
305
- return !o || o.length === 0 ? null : e === "up" ? !Ue(i, a) || n.current === 0 ? null : (n.current === -1 ? (r.current = i, n.current = o.length - 1) : --n.current, o[n.current]) : n.current === -1 || !We(i, a) ? null : n.current < o.length - 1 ? (n.current += 1, o[n.current]) : (n.current = -1, r.current);
306
- }, []), a = z(() => {
305
+ return !o || o.length === 0 ? null : e === "up" ? !We(i, a) || n.current === 0 ? null : (n.current === -1 ? (r.current = i, n.current = o.length - 1) : --n.current, o[n.current]) : n.current === -1 || !Ge(i, a) ? null : n.current < o.length - 1 ? (n.current += 1, o[n.current]) : (n.current = -1, r.current);
306
+ }, []), a = R(() => {
307
307
  n.current = -1, r.current = "";
308
- }, []), o = z(() => {
308
+ }, []), o = R(() => {
309
309
  n.current = -1, r.current = "";
310
310
  }, []);
311
- return V(() => ({
311
+ return B(() => ({
312
312
  navigate: i,
313
313
  notifyChange: a,
314
314
  reset: o
@@ -317,16 +317,16 @@ var W = {
317
317
  a,
318
318
  o
319
319
  ]);
320
- }, Ke = (e, t, n, r, i) => {
320
+ }, qe = (e, t, n, r, i) => {
321
321
  let a = [...t].sort((e, t) => e.start - t.start), o = [...n].sort((e, t) => e.offset - t.offset), s = [], c = 0, l = 0, u = (t, n) => {
322
322
  if (n <= t) return;
323
323
  let r = t;
324
324
  o.filter((e) => e.offset >= t && e.offset <= n).forEach((t) => {
325
- t.offset > r && s.push(/* @__PURE__ */ L("span", {
325
+ t.offset > r && s.push(/* @__PURE__ */ I("span", {
326
326
  "aria-hidden": !0,
327
327
  children: e.slice(r, t.offset)
328
328
  }, `text-${l++}`)), s.push(t.node), r = t.offset;
329
- }), r < n && s.push(/* @__PURE__ */ L("span", {
329
+ }), r < n && s.push(/* @__PURE__ */ I("span", {
330
330
  "aria-hidden": !0,
331
331
  children: e.slice(r, n)
332
332
  }, `text-${l++}`));
@@ -334,16 +334,16 @@ var W = {
334
334
  return a.forEach((t, n) => {
335
335
  if (u(c, t.start), t.start + t.length <= c) return;
336
336
  let a = e.slice(t.start, t.start + t.length);
337
- s.push(t.render ? /* @__PURE__ */ L("span", {
337
+ s.push(t.render ? /* @__PURE__ */ I("span", {
338
338
  className: "pointer-events-auto",
339
339
  children: t.render()
340
- }, `range-${n}`) : /* @__PURE__ */ L("span", {
340
+ }, `range-${n}`) : /* @__PURE__ */ I("span", {
341
341
  "aria-hidden": !0,
342
342
  className: t.isUnsupported ? i : r,
343
343
  children: a
344
344
  }, `range-${n}`)), c = Math.max(c, t.start + t.length);
345
345
  }), u(c, e.length), s;
346
- }, qe = (e, t) => {
346
+ }, Je = (e, t) => {
347
347
  let n = document.createTreeWalker(e, NodeFilter.SHOW_TEXT, { acceptNode: (e) => e.parentElement?.closest("[data-mirror-synthetic]") == null ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_REJECT }), r = 0;
348
348
  for (let e = n.nextNode(); e != null; e = n.nextNode()) {
349
349
  let n = e.textContent?.length ?? 0;
@@ -354,24 +354,24 @@ var W = {
354
354
  r += n;
355
355
  }
356
356
  return null;
357
- }, Je = (e, t, n) => {
358
- let r = qe(e, t), i = qe(e, n);
357
+ }, Ye = (e, t, n) => {
358
+ let r = Je(e, t), i = Je(e, n);
359
359
  if (r == null || i == null) return null;
360
360
  let a = document.createRange();
361
361
  return a.setStart(r.node, r.offset), a.setEnd(i.node, i.offset), a;
362
- }, Ye = ({ textareaRef: e, message: t, isMirrorActive: n }) => {
363
- let r = H(null), [i, a] = U([]), o = z(() => {
362
+ }, Xe = ({ textareaRef: e, message: t, isMirrorActive: n }) => {
363
+ let r = V(null), [i, a] = H([]), o = R(() => {
364
364
  let t = e.current, n = r.current;
365
365
  if (t == null || n == null) return;
366
366
  let i = t.offsetWidth > t.clientWidth;
367
367
  n.style.scrollbarGutter = i ? "stable" : "", n.scrollTop = t.scrollTop;
368
- }, [e]), s = z(() => {
368
+ }, [e]), s = R(() => {
369
369
  let t = e.current, i = r.current, o = t?.selectionStart, s = t?.selectionEnd;
370
370
  if (!n || t == null || i == null || o == null || s == null || o === s) {
371
371
  a((e) => e.length === 0 ? e : []);
372
372
  return;
373
373
  }
374
- let c = Je(i, o, s);
374
+ let c = Ye(i, o, s);
375
375
  if (c == null) {
376
376
  a((e) => e.length === 0 ? e : []);
377
377
  return;
@@ -379,14 +379,14 @@ var W = {
379
379
  let l = i.getBoundingClientRect();
380
380
  a(Array.from(c.getClientRects()).map((e) => new DOMRect(e.left - l.left, e.top - l.top + i.scrollTop, e.width, e.height)));
381
381
  }, [n, e]);
382
- return Ne(() => {
382
+ return Pe(() => {
383
383
  n && o(), s();
384
384
  }, [
385
385
  n,
386
386
  o,
387
387
  s,
388
388
  t
389
- ]), B(() => {
389
+ ]), z(() => {
390
390
  if (!n) return;
391
391
  let t = e.current;
392
392
  if (t == null || typeof ResizeObserver > "u") return;
@@ -405,29 +405,29 @@ var W = {
405
405
  updateSelectionRects: s,
406
406
  syncMirrorToTextarea: o
407
407
  };
408
- }, Xe = ({ messageProp: e, messageRevision: t }) => {
409
- let [n, r] = U(e), i = H(null);
410
- return B(() => {
408
+ }, Ze = ({ messageProp: e, messageRevision: t }) => {
409
+ let [n, r] = H(e), i = V(null);
410
+ return z(() => {
411
411
  r(e);
412
412
  }, [e, t]), {
413
413
  message: n,
414
414
  setMessage: r,
415
415
  textareaRef: i
416
416
  };
417
- }, Ze = (e, t, n, r = n) => {
417
+ }, Qe = (e, t, n, r = n) => {
418
418
  let i = Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, "value")?.set;
419
419
  i ? i.call(e, t) : e.value = t, e.setSelectionRange(n, r), e.dispatchEvent(new Event("input", { bubbles: !0 }));
420
- }, Qe = (e) => e.key.toLowerCase() === "z" && (e.ctrlKey || e.metaKey) && !e.shiftKey && !e.altKey, $e = ({ insertion: e, textareaRef: t }) => {
421
- let n = e?.revision, r = H(e?.text);
420
+ }, $e = (e) => e.key.toLowerCase() === "z" && (e.ctrlKey || e.metaKey) && !e.shiftKey && !e.altKey, et = ({ insertion: e, textareaRef: t }) => {
421
+ let n = e?.revision, r = V(e?.text);
422
422
  r.current = e?.text;
423
- let i = H(n), a = H(null), o = H(!1);
424
- return B(() => {
423
+ let i = V(n), a = V(null), o = V(!1);
424
+ return z(() => {
425
425
  document.activeElement === t.current && (o.current = !0);
426
426
  let e = (e) => {
427
427
  e.target === t.current && (o.current = !0);
428
428
  };
429
429
  return document.addEventListener("focusin", e), () => document.removeEventListener("focusin", e);
430
- }, [t]), B(() => {
430
+ }, [t]), z(() => {
431
431
  if (n === i.current) return;
432
432
  i.current = n;
433
433
  let e = r.current;
@@ -437,7 +437,7 @@ var W = {
437
437
  let { value: r, selectionStart: i, selectionEnd: s } = n, c = !o.current && r.length > 0 && i === 0 && s === 0, l = c ? r.length : i ?? r.length, u = c ? l : s ?? l;
438
438
  if (n.focus(), c && n.setSelectionRange(l, u), a.current = null, typeof document.execCommand == "function" && document.execCommand("insertText", !1, e)) return;
439
439
  let d = `${r.slice(0, l)}${e}${r.slice(u)}`;
440
- Ze(n, d, l + e.length), a.current = {
440
+ Qe(n, d, l + e.length), a.current = {
441
441
  insertedValue: d,
442
442
  previousValue: r,
443
443
  previousSelectionStart: l,
@@ -447,22 +447,22 @@ var W = {
447
447
  }, [n, t]), {
448
448
  handleUndoKeyDown: (e) => {
449
449
  let n = a.current, r = t.current;
450
- return n == null || r == null || !Qe(e) || (a.current = null, r.value !== n.insertedValue) ? !1 : (e.preventDefault(), Ze(r, n.previousValue, n.previousSelectionStart, n.previousSelectionEnd), !0);
450
+ return n == null || r == null || !$e(e) || (a.current = null, r.value !== n.insertedValue) ? !1 : (e.preventDefault(), Qe(r, n.previousValue, n.previousSelectionStart, n.previousSelectionEnd), !0);
451
451
  },
452
452
  markCaretPlaced: () => {
453
453
  o.current = !0;
454
454
  }
455
455
  };
456
- }, et = /* @__PURE__ */ function(e) {
456
+ }, tt = /* @__PURE__ */ function(e) {
457
457
  return e.Idle = "idle", e.Recording = "recording", e.Processing = "processing", e.Error = "error", e;
458
- }({}), tt = /* @__PURE__ */ function(e) {
458
+ }({}), nt = /* @__PURE__ */ function(e) {
459
459
  return e.Dictation = "dictation", e.Attachment = "attachment", e;
460
- }({}), nt = [
460
+ }({}), rt = [
461
461
  "audio/webm;codecs=opus",
462
462
  "audio/ogg;codecs=opus",
463
463
  "audio/webm"
464
- ], rt = 100, it = 100, at = .01, ot = ({ onAttachAudio: e, onTranscribeAudio: t, onTranscript: n, errorLabel: i = "Voice input failed" }) => {
465
- let [a, o] = U("idle"), [s, c] = U(null), l = H(null), d = H(null), f = H({
464
+ ], it = 100, at = 100, ot = .01, st = ({ onAttachAudio: e, onTranscribeAudio: t, onTranscript: n, errorLabel: i = "Voice input failed" }) => {
465
+ let [a, o] = H("idle"), [s, c] = H(null), l = V(null), d = V(null), f = V({
466
466
  onAttachAudio: e,
467
467
  onTranscribeAudio: t,
468
468
  onTranscript: n,
@@ -474,7 +474,7 @@ var W = {
474
474
  onTranscript: n,
475
475
  errorLabel: i
476
476
  };
477
- let p = z((e = "dictation") => {
477
+ let p = R((e = "dictation") => {
478
478
  if (d.current) return;
479
479
  let t = { controller: new AbortController() };
480
480
  d.current = t, c(null), o("recording");
@@ -492,7 +492,7 @@ var W = {
492
492
  n.aborted || (t.controller.abort(), d.current = null, c(e instanceof Error ? e.message : f.current.errorLabel), o("error"));
493
493
  }, S = () => {
494
494
  if (!a || n.aborted) return;
495
- let e = nt.find((e) => MediaRecorder.isTypeSupported(e)), t = new MediaRecorder(a, e ? { mimeType: e } : void 0);
495
+ let e = rt.find((e) => MediaRecorder.isTypeSupported(e)), t = new MediaRecorder(a, e ? { mimeType: e } : void 0);
496
496
  p = t;
497
497
  let s = Date.now(), c = !1, d = !1, S = new Uint8Array(l.current?.fftSize ?? 256), C = async () => {
498
498
  if (!(g || n.aborted)) {
@@ -500,7 +500,7 @@ var W = {
500
500
  try {
501
501
  let a = t.mimeType || e || "audio/webm", l = new Blob(_, { type: a });
502
502
  _.length = 0, y();
503
- let p = Date.now() - s >= it;
503
+ let p = Date.now() - s >= at;
504
504
  if (l.size && (!i || p && (!c || d))) {
505
505
  let e = u(a), t = r[e] ?? e.split("/")[1] ?? "webm", s = new File([l], "voice-" + crypto.randomUUID() + "." + t, { type: a });
506
506
  if (i) {
@@ -526,8 +526,8 @@ var W = {
526
526
  e.getByteTimeDomainData(S), c = !0;
527
527
  let t = 0;
528
528
  for (let e of S) t += ((e - 128) / 128) ** 2;
529
- Math.sqrt(t / S.length) >= at && (d = !0, v());
530
- }, rt));
529
+ Math.sqrt(t / S.length) >= ot && (d = !0, v());
530
+ }, it));
531
531
  };
532
532
  t.stop = () => {
533
533
  h || n.aborted || (h = !0, v(), o("processing"), p?.state === "recording" && p.stop());
@@ -545,10 +545,10 @@ var W = {
545
545
  x(e);
546
546
  }
547
547
  })();
548
- }, []), m = z(() => d.current?.stop?.(), []), h = z(() => {
548
+ }, []), m = R(() => d.current?.stop?.(), []), h = R(() => {
549
549
  d.current?.controller.abort(), d.current = null, c(null), o("idle");
550
550
  }, []);
551
- return B(() => () => {
551
+ return z(() => () => {
552
552
  d.current?.controller.abort(), d.current = null;
553
553
  }, []), {
554
554
  state: a,
@@ -558,14 +558,14 @@ var W = {
558
558
  stopRecording: m,
559
559
  discardRecording: h
560
560
  };
561
- }, st = /* @__PURE__ */ function(e) {
561
+ }, ct = /* @__PURE__ */ function(e) {
562
562
  return e.Enter = "enter", e.MetaEnter = "meta-enter", e;
563
- }({}), ct = /* @__PURE__ */ function(e) {
563
+ }({}), lt = /* @__PURE__ */ function(e) {
564
564
  return e.Stacked = "stacked", e.Inline = "inline", e;
565
- }({}), lt = {
565
+ }({}), ut = {
566
566
  item: "_item_1sr2n_1",
567
567
  itemIcon: "_itemIcon_1sr2n_11"
568
- }, ut = ({ isOpen: e, title: t, closeLabel: n, onClose: r, style: i, items: a, className: o, titleClassName: s = "dial-body-semi-text", itemLabelClassName: u = "dial-small-text", btnTextClassName: d = "", colors: f }) => {
568
+ }, dt = ({ isOpen: e, title: t, closeLabel: n, onClose: r, style: i, items: a, className: o, titleClassName: s = "dial-body-semi-text", itemLabelClassName: u = "dial-small-text", btnTextClassName: d = "", colors: f }) => {
569
569
  let p = (e) => {
570
570
  e(), r();
571
571
  }, h = c({
@@ -574,7 +574,7 @@ var W = {
574
574
  "--ci-sheet-item-active": f?.itemActiveBg,
575
575
  "--ci-sheet-icon": f?.itemIcon
576
576
  });
577
- return /* @__PURE__ */ L(Pe, {
577
+ return /* @__PURE__ */ I(Fe, {
578
578
  isOpen: e,
579
579
  title: t,
580
580
  closeLabel: n,
@@ -583,23 +583,23 @@ var W = {
583
583
  className: o,
584
584
  titleClassName: s,
585
585
  colors: f?.shell,
586
- children: /* @__PURE__ */ L("ul", {
586
+ children: /* @__PURE__ */ I("ul", {
587
587
  role: "list",
588
588
  className: "flex flex-col",
589
589
  style: h,
590
- children: a.map(({ key: e, label: t, icon: n, iconAfter: r, onClick: i }) => /* @__PURE__ */ L("li", { children: /* @__PURE__ */ L(m, {
590
+ children: a.map(({ key: e, label: t, icon: n, iconAfter: r, onClick: i }) => /* @__PURE__ */ I("li", { children: /* @__PURE__ */ I(m, {
591
591
  type: "button",
592
- className: l(lt.item, "w-full gap-3 px-4 py-[10px] text-start"),
593
- iconBefore: /* @__PURE__ */ L("span", {
594
- className: lt.itemIcon,
592
+ className: l(ut.item, "w-full gap-3 px-4 py-[10px] text-start"),
593
+ iconBefore: /* @__PURE__ */ I("span", {
594
+ className: ut.itemIcon,
595
595
  children: n
596
596
  }),
597
- iconAfter: r ? /* @__PURE__ */ L("span", {
597
+ iconAfter: r ? /* @__PURE__ */ I("span", {
598
598
  className: "ms-auto",
599
599
  children: r
600
600
  }) : null,
601
601
  textClassName: d,
602
- label: /* @__PURE__ */ L("span", {
602
+ label: /* @__PURE__ */ I("span", {
603
603
  className: u,
604
604
  children: t
605
605
  }),
@@ -607,9 +607,9 @@ var W = {
607
607
  }) }, e))
608
608
  })
609
609
  });
610
- }, dt = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, isOpen: o }) => {
611
- let [s, c] = U(t), [l, u] = U(n), [d, f] = U(r), p = H(o);
612
- B(() => {
610
+ }, ft = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, isOpen: o }) => {
611
+ let [s, c] = H(t), [l, u] = H(n), [d, f] = H(r), p = V(o);
612
+ z(() => {
613
613
  o && !p.current && (c(t), u(n), f(r)), p.current = o;
614
614
  }, [
615
615
  o,
@@ -626,7 +626,7 @@ var W = {
626
626
  setResponseFormat: c,
627
627
  setSystemPrompt: u,
628
628
  setTemperature: f,
629
- handleSubmit: z(() => {
629
+ handleSubmit: R(() => {
630
630
  if (!m) return;
631
631
  let t = {};
632
632
  e.responseFormat && s != null && (t.responseFormat = s), e.systemPrompt && (t.systemPrompt = l), e.temperature && (t.temperature = d), i(t), a();
@@ -640,17 +640,17 @@ var W = {
640
640
  a
641
641
  ])
642
642
  };
643
- }, ft = { label: "_label_14i7c_1" }, pt = ({ features: e, responseFormat: t, systemPrompt: n, temperature: r, onResponseFormatChange: a, onSystemPromptChange: s, onTemperatureChange: u, responseFormatLabel: d = "Response format", responseFormatHint: f = "Applies to new and existing messages", responseFormatMarkdownLabel: p = "Markdown", responseFormatPlainTextLabel: m = "Plain text", systemPromptLabel: h = "System prompt", systemPromptTooltip: g = "Enter a prompt", temperatureLabel: _ = "Temperature", temperatureLabels: v = [
643
+ }, pt = { label: "_label_14i7c_1" }, mt = ({ features: e, responseFormat: t, systemPrompt: n, temperature: r, onResponseFormatChange: a, onSystemPromptChange: s, onTemperatureChange: u, responseFormatLabel: d = "Response format", responseFormatHint: f = "Applies to new and existing messages", responseFormatMarkdownLabel: p = "Markdown", responseFormatPlainTextLabel: m = "Plain text", systemPromptLabel: h = "System prompt", systemPromptTooltip: g = "Enter a prompt", temperatureLabel: _ = "Temperature", temperatureLabels: v = [
644
644
  "Precise",
645
645
  "Neutral",
646
646
  "Creative"
647
647
  ], temperatureHint: y, labelClassName: b = "!dial-small-semi-text", colors: x }) => {
648
- let S = c({ "--csf-label-text": x?.labelText }), C = l(b, ft.label, "gap-1");
649
- return /* @__PURE__ */ R("div", {
648
+ let S = c({ "--csf-label-text": x?.labelText }), C = l(b, pt.label, "gap-1");
649
+ return /* @__PURE__ */ L("div", {
650
650
  className: "flex flex-col gap-4 px-6 pb-3",
651
651
  style: S,
652
652
  children: [
653
- e.responseFormat && /* @__PURE__ */ L(re, {
653
+ e.responseFormat && /* @__PURE__ */ I(ie, {
654
654
  id: "response-format",
655
655
  labelProps: {
656
656
  label: d,
@@ -658,7 +658,7 @@ var W = {
658
658
  caption: f
659
659
  },
660
660
  optionsClassName: "mb-2",
661
- orientation: ie.Column,
661
+ orientation: ae.Column,
662
662
  value: t ?? o.Markdown,
663
663
  items: [{
664
664
  value: o.Markdown,
@@ -669,18 +669,18 @@ var W = {
669
669
  }],
670
670
  onChange: (e) => a(e)
671
671
  }),
672
- e.systemPrompt && /* @__PURE__ */ L(ce, {
672
+ e.systemPrompt && /* @__PURE__ */ I(le, {
673
673
  value: n,
674
674
  placeholder: g,
675
675
  className: i,
676
- resize: le.Vertical,
676
+ resize: ue.Vertical,
677
677
  labelProps: {
678
678
  className: C,
679
679
  label: h
680
680
  },
681
681
  onChange: (e) => s(e ?? "")
682
682
  }),
683
- e.temperature && /* @__PURE__ */ L(F, {
683
+ e.temperature && /* @__PURE__ */ I(P, {
684
684
  labelProps: {
685
685
  label: _,
686
686
  className: C,
@@ -697,8 +697,8 @@ var W = {
697
697
  })
698
698
  ]
699
699
  });
700
- }, mt = ({ isOpen: e, onBack: t, backLabel: n, onClose: r, closeLabel: i, style: a, features: o, initialResponseFormat: s, initialSystemPrompt: c, initialTemperature: u, onSave: d, title: f = "Chat settings", responseFormatLabel: p, responseFormatHint: m, responseFormatMarkdownLabel: h, responseFormatPlainTextLabel: g, systemPromptLabel: _, systemPromptTooltip: v, temperatureLabel: y, temperatureLabels: b, temperatureHint: x, saveLabel: S = "Apply changes", saveDisabledTooltip: C }) => {
701
- let { responseFormat: w, systemPrompt: T, temperature: E, canSubmit: D, setResponseFormat: O, setSystemPrompt: k, setTemperature: A, handleSubmit: j } = dt({
700
+ }, ht = ({ isOpen: e, onBack: t, backLabel: n, onClose: r, closeLabel: i, style: a, features: o, initialResponseFormat: s, initialSystemPrompt: c, initialTemperature: u, onSave: d, title: f = "Chat settings", responseFormatLabel: p, responseFormatHint: m, responseFormatMarkdownLabel: h, responseFormatPlainTextLabel: g, systemPromptLabel: _, systemPromptTooltip: v, temperatureLabel: y, temperatureLabels: b, temperatureHint: x, saveLabel: S = "Apply changes", saveDisabledTooltip: C }) => {
701
+ let { responseFormat: w, systemPrompt: T, temperature: E, canSubmit: D, setResponseFormat: O, setSystemPrompt: k, setTemperature: ee, handleSubmit: A } = ft({
702
702
  isOpen: e,
703
703
  features: o,
704
704
  initialResponseFormat: s,
@@ -707,7 +707,7 @@ var W = {
707
707
  onSave: d,
708
708
  onClose: r
709
709
  });
710
- return /* @__PURE__ */ R(Pe, {
710
+ return /* @__PURE__ */ L(Fe, {
711
711
  isOpen: e,
712
712
  title: f,
713
713
  closeLabel: i,
@@ -715,14 +715,14 @@ var W = {
715
715
  onBack: t,
716
716
  backLabel: n,
717
717
  style: a,
718
- children: [/* @__PURE__ */ L(pt, {
718
+ children: [/* @__PURE__ */ I(mt, {
719
719
  features: o,
720
720
  responseFormat: w,
721
721
  systemPrompt: T,
722
722
  temperature: E,
723
723
  onResponseFormatChange: O,
724
724
  onSystemPromptChange: k,
725
- onTemperatureChange: A,
725
+ onTemperatureChange: ee,
726
726
  responseFormatLabel: p,
727
727
  responseFormatHint: m,
728
728
  responseFormatMarkdownLabel: h,
@@ -732,23 +732,23 @@ var W = {
732
732
  temperatureLabel: y,
733
733
  temperatureLabels: b,
734
734
  temperatureHint: x
735
- }), /* @__PURE__ */ L("div", {
735
+ }), /* @__PURE__ */ I("div", {
736
736
  className: l("px-6 py-4 mobile:pb-8"),
737
- children: /* @__PURE__ */ L(de, {
737
+ children: /* @__PURE__ */ I(fe, {
738
738
  tooltip: C,
739
739
  hideTooltip: D || !C,
740
740
  triggerClassName: "w-full",
741
- children: /* @__PURE__ */ L(te, {
741
+ children: /* @__PURE__ */ I(M, {
742
742
  label: S,
743
- onClick: j,
743
+ onClick: A,
744
744
  disabled: !D,
745
745
  className: "w-full"
746
746
  })
747
747
  })
748
748
  })]
749
749
  });
750
- }, K = { modal: "_modal_kl0h0_1" }, ht = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, title: o = "Chat settings", titleClassName: s = "dial-h1-text", responseFormatLabel: c, responseFormatHint: l, responseFormatMarkdownLabel: u, responseFormatPlainTextLabel: d, systemPromptLabel: f, systemPromptTooltip: p, temperatureLabel: m, temperatureLabels: g, temperatureHint: _, saveLabel: v = "Apply changes", saveDisabledTooltip: y, backgroundClassName: b = K.modal }) => {
751
- let { responseFormat: x, systemPrompt: S, temperature: C, canSubmit: w, setResponseFormat: T, setSystemPrompt: E, setTemperature: D, handleSubmit: O } = dt({
750
+ }, G = { modal: "_modal_kl0h0_1" }, gt = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, title: o = "Chat settings", titleClassName: s = "dial-h1-text", responseFormatLabel: l, responseFormatHint: u, responseFormatMarkdownLabel: d, responseFormatPlainTextLabel: f, systemPromptLabel: p, systemPromptTooltip: m, temperatureLabel: g, temperatureLabels: _, temperatureHint: v, saveLabel: y = "Apply changes", saveDisabledTooltip: b, backgroundClassName: x = G.modal, colors: S }) => {
751
+ let { responseFormat: C, systemPrompt: w, temperature: T, canSubmit: E, setResponseFormat: D, setSystemPrompt: O, setTemperature: k, handleSubmit: ee } = ft({
752
752
  features: e,
753
753
  initialResponseFormat: t,
754
754
  initialSystemPrompt: n,
@@ -756,51 +756,52 @@ var W = {
756
756
  onSave: i,
757
757
  onClose: a
758
758
  });
759
- return /* @__PURE__ */ L(N, {
759
+ return /* @__PURE__ */ I(j, {
760
760
  open: !0,
761
761
  header: o,
762
762
  titleClassName: s,
763
- size: ee.Sm,
763
+ size: ne.Sm,
764
764
  onClose: a,
765
- className: b,
765
+ className: x,
766
+ overlayStyle: c({ "--csm-bg": S?.background }),
766
767
  mainButtons: [{
767
- label: v,
768
+ label: y,
768
769
  variant: h.Primary,
769
- onClick: O,
770
- disabled: !w,
771
- tooltipProps: y ? {
772
- tooltip: y,
773
- hideTooltip: w
770
+ onClick: ee,
771
+ disabled: !E,
772
+ tooltipProps: b ? {
773
+ tooltip: b,
774
+ hideTooltip: E
774
775
  } : void 0
775
776
  }],
776
- children: /* @__PURE__ */ L(pt, {
777
+ children: /* @__PURE__ */ I(mt, {
777
778
  features: e,
778
- responseFormat: x,
779
- systemPrompt: S,
780
- temperature: C,
781
- onResponseFormatChange: T,
782
- onSystemPromptChange: E,
783
- onTemperatureChange: D,
784
- responseFormatLabel: c,
785
- responseFormatHint: l,
786
- responseFormatMarkdownLabel: u,
787
- responseFormatPlainTextLabel: d,
788
- systemPromptLabel: f,
789
- systemPromptTooltip: p,
790
- temperatureLabel: m,
791
- temperatureLabels: g,
792
- temperatureHint: _
779
+ responseFormat: C,
780
+ systemPrompt: w,
781
+ temperature: T,
782
+ onResponseFormatChange: D,
783
+ onSystemPromptChange: O,
784
+ onTemperatureChange: k,
785
+ responseFormatLabel: l,
786
+ responseFormatHint: u,
787
+ responseFormatMarkdownLabel: d,
788
+ responseFormatPlainTextLabel: f,
789
+ systemPromptLabel: p,
790
+ systemPromptTooltip: m,
791
+ temperatureLabel: g,
792
+ temperatureLabels: _,
793
+ temperatureHint: v
793
794
  })
794
795
  });
795
- }, gt = {
796
+ }, _t = {
796
797
  icon: "_icon_1fv6z_1",
797
798
  selectedIcon: "_selectedIcon_1fv6z_5"
798
- }, _t = ({ isOpen: e, onBack: t, backLabel: n = "Back", onClose: r, closeLabel: i = "Close", style: a, title: o = "Tools", items: s, onToolToggle: u, itemLabelClassName: d = "dial-small-text", colors: p }) => {
799
+ }, vt = ({ isOpen: e, onBack: t, backLabel: n = "Back", onClose: r, closeLabel: i = "Close", style: a, title: o = "Tools", items: s, onToolToggle: u, itemLabelClassName: d = "dial-small-text", colors: p }) => {
799
800
  let h = c({
800
801
  "--tbs-icon-text": p?.iconText,
801
802
  "--tbs-selected-icon-text": p?.selectedIconText
802
803
  });
803
- return /* @__PURE__ */ L(Pe, {
804
+ return /* @__PURE__ */ I(Fe, {
804
805
  isOpen: e,
805
806
  title: o,
806
807
  closeLabel: i,
@@ -808,30 +809,30 @@ var W = {
808
809
  onBack: t,
809
810
  backLabel: n,
810
811
  style: a,
811
- children: /* @__PURE__ */ L("ul", {
812
+ children: /* @__PURE__ */ I("ul", {
812
813
  role: "menu",
813
814
  className: "flex flex-col pb-4",
814
815
  style: h,
815
- children: s.map((e) => /* @__PURE__ */ L("li", {
816
+ children: s.map((e) => /* @__PURE__ */ I("li", {
816
817
  role: "none",
817
- children: /* @__PURE__ */ L(m, {
818
+ children: /* @__PURE__ */ I(m, {
818
819
  type: "button",
819
820
  role: "menuitemcheckbox",
820
821
  "aria-checked": e.isSelected,
821
822
  className: "w-full gap-3 px-4 py-[10px] text-start",
822
- iconBefore: /* @__PURE__ */ L("span", {
823
- className: l("flex items-center", gt.icon),
823
+ iconBefore: /* @__PURE__ */ I("span", {
824
+ className: l("flex items-center", _t.icon),
824
825
  children: e.icon
825
826
  }),
826
- iconAfter: e.isSelected ? /* @__PURE__ */ L("span", {
827
- className: l("ms-auto", gt.selectedIcon),
828
- children: /* @__PURE__ */ L(_e, {
827
+ iconAfter: e.isSelected ? /* @__PURE__ */ I("span", {
828
+ className: l("ms-auto", _t.selectedIcon),
829
+ children: /* @__PURE__ */ I(ve, {
829
830
  size: f,
830
831
  "aria-hidden": !0,
831
832
  stroke: v
832
833
  })
833
834
  }) : null,
834
- label: /* @__PURE__ */ L("span", {
835
+ label: /* @__PURE__ */ I("span", {
835
836
  className: d,
836
837
  children: e.label
837
838
  }),
@@ -840,19 +841,19 @@ var W = {
840
841
  }, e.id))
841
842
  })
842
843
  });
843
- }, vt = {
844
+ }, yt = {
844
845
  toolIcon: "_toolIcon_ma5s5_1",
845
846
  chevronIcon: "_chevronIcon_ma5s5_5"
846
- }, yt = ({ onAttachClick: e, onRecordVoice: t, recordVoiceLabel: n = "Record voice", attachLabel: r, addMenuTitle: i, menuTitle: a, menuCloseLabel: s, style: u, listClassName: p = "w-[240px]", isDisabled: m = !1, chatSettings: h, extraMenuItems: g, toolsMenuItems: b = [], onToolToggle: x, toolsMenuTitle: C = "Tools", toolsBackLabel: w = "Back", menuOverlays: T, getCaretPosition: E, colors: O }) => {
847
- let k = d(), [A, j] = U(!1), [M, N] = U(!1), [ee, te] = U(!1), [ne, re] = U(null), [ie, ae] = U(!1), P = V(() => c({
847
+ }, bt = ({ onAttachClick: e, onRecordVoice: t, recordVoiceLabel: n = "Record voice", attachLabel: r, addMenuTitle: i, menuTitle: a, menuCloseLabel: s, style: u, listClassName: p = "w-[240px]", isDisabled: m = !1, chatSettings: h, extraMenuItems: g, toolsMenuItems: b = [], onToolToggle: x, toolsMenuTitle: C = "Tools", toolsBackLabel: w = "Back", menuOverlays: T, getCaretPosition: E, colors: O }) => {
848
+ let k = d(), [ee, A] = H(!1), [te, j] = H(!1), [ne, M] = H(!1), [re, ie] = H(null), [ae, oe] = H(!1), N = B(() => c({
848
849
  "--aab-tool-icon": O?.toolIcon,
849
850
  "--aab-chevron-icon": O?.chevronIcon
850
- }), [O?.toolIcon, O?.chevronIcon]), oe = b.length > 0 && x != null, F = T != null && T.length > 0, se = V(() => b.map((e) => ({
851
+ }), [O?.toolIcon, O?.chevronIcon]), se = b.length > 0 && x != null, P = T != null && T.length > 0, ce = B(() => b.map((e) => ({
851
852
  key: e.id,
852
853
  label: e.label,
853
- icon: /* @__PURE__ */ L("span", {
854
- style: P,
855
- className: l("flex items-center", vt.toolIcon),
854
+ icon: /* @__PURE__ */ I("span", {
855
+ style: N,
856
+ className: l("flex items-center", yt.toolIcon),
856
857
  children: e.icon
857
858
  }),
858
859
  selectable: !0,
@@ -862,12 +863,12 @@ var W = {
862
863
  })), [
863
864
  b,
864
865
  x,
865
- P
866
- ]), ce = V(() => [
866
+ N
867
+ ]), le = B(() => [
867
868
  ...e == null ? [] : [{
868
869
  key: "attach",
869
870
  label: r,
870
- icon: /* @__PURE__ */ L(Se, {
871
+ icon: /* @__PURE__ */ I(Ce, {
871
872
  size: f,
872
873
  "aria-hidden": !0,
873
874
  stroke: v
@@ -875,74 +876,74 @@ var W = {
875
876
  onClick: e
876
877
  }],
877
878
  ...g ?? [],
878
- ...oe ? [{
879
+ ...se ? [{
879
880
  key: "tools",
880
881
  label: C,
881
- icon: /* @__PURE__ */ L(Ee, {
882
+ icon: /* @__PURE__ */ I(De, {
882
883
  size: f,
883
884
  "aria-hidden": !0,
884
885
  stroke: v
885
886
  }),
886
887
  onClick: k ? () => {
887
- te(!0), j(!1);
888
+ M(!0), A(!1);
888
889
  } : () => void 0,
889
- ...k ? { iconAfter: /* @__PURE__ */ L(ye, {
890
+ ...k ? { iconAfter: /* @__PURE__ */ I(be, {
890
891
  size: f,
891
892
  stroke: v,
892
- style: P,
893
- className: l("rtl:scale-x-[-1]", vt.chevronIcon),
893
+ style: N,
894
+ className: l("rtl:scale-x-[-1]", yt.chevronIcon),
894
895
  "aria-hidden": !0
895
- }) } : { children: se }
896
+ }) } : { children: ce }
896
897
  }] : [],
897
898
  ...(T ?? []).map((e) => ({
898
899
  key: e.key,
899
900
  label: e.title,
900
901
  icon: e.icon,
901
902
  onClick: k ? () => {
902
- re(e.key), j(!1);
903
+ ie(e.key), A(!1);
903
904
  } : () => void 0,
904
- ...k ? { iconAfter: /* @__PURE__ */ L(ye, {
905
+ ...k ? { iconAfter: /* @__PURE__ */ I(be, {
905
906
  size: f,
906
907
  stroke: v,
907
- style: P,
908
- className: l("rtl:scale-x-[-1]", vt.chevronIcon),
908
+ style: N,
909
+ className: l("rtl:scale-x-[-1]", yt.chevronIcon),
909
910
  "aria-hidden": !0
910
911
  }) } : {
911
912
  children: [{
912
913
  key: `${e.key}-panel`,
913
914
  label: ""
914
915
  }],
915
- renderSubMenu: () => e.renderOverlay(() => ae(!1), E?.() ?? 0)
916
+ renderSubMenu: () => e.renderOverlay(() => oe(!1), E?.() ?? 0)
916
917
  }
917
918
  })),
918
919
  ...t == null ? [] : [{
919
920
  key: "record-voice",
920
921
  label: n,
921
- icon: /* @__PURE__ */ L(xe, {
922
+ icon: /* @__PURE__ */ I(Se, {
922
923
  size: f,
923
924
  "aria-hidden": !0,
924
925
  stroke: v
925
926
  }),
926
927
  onClick: () => {
927
- j(!1), ae(!1), t();
928
+ A(!1), oe(!1), t();
928
929
  }
929
930
  }],
930
931
  ...h == null ? [] : [{
931
932
  key: "chat-settings",
932
933
  label: h.menuItemLabel ?? "Chat settings",
933
- icon: /* @__PURE__ */ L(Te, {
934
+ icon: /* @__PURE__ */ I(Ee, {
934
935
  size: f,
935
936
  "aria-hidden": !0,
936
937
  stroke: v
937
938
  }),
938
- iconAfter: k ? /* @__PURE__ */ L(ye, {
939
+ iconAfter: k ? /* @__PURE__ */ I(be, {
939
940
  size: f,
940
941
  stroke: v,
941
- style: P,
942
- className: l("rtl:scale-x-[-1]", vt.chevronIcon),
942
+ style: N,
943
+ className: l("rtl:scale-x-[-1]", yt.chevronIcon),
943
944
  "aria-hidden": !0
944
945
  }) : null,
945
- onClick: () => N(!0)
946
+ onClick: () => j(!0)
946
947
  }]
947
948
  ], [
948
949
  r,
@@ -952,25 +953,25 @@ var W = {
952
953
  h,
953
954
  g,
954
955
  k,
955
- oe,
956
- C,
957
956
  se,
957
+ C,
958
+ ce,
958
959
  T,
959
960
  E,
960
- P
961
+ N
961
962
  ]);
962
- if (ce.length === 0) return null;
963
- let le = /* @__PURE__ */ L(y, {
963
+ if (le.length === 0) return null;
964
+ let ue = /* @__PURE__ */ I(y, {
964
965
  matchReferenceWidth: !1,
965
966
  placement: "bottom-start",
966
967
  listClassName: p,
967
968
  overlayContentClassName: "flex flex-col gap-1",
968
- items: ce,
969
+ items: le,
969
970
  disabled: m,
970
- open: F ? ie : void 0,
971
- onOpenChange: F ? ae : void 0,
972
- children: /* @__PURE__ */ L(S, {
973
- icon: /* @__PURE__ */ L(we, {
971
+ open: P ? ae : void 0,
972
+ onOpenChange: P ? oe : void 0,
973
+ children: /* @__PURE__ */ I(S, {
974
+ icon: /* @__PURE__ */ I(Te, {
974
975
  size: _.LG,
975
976
  "aria-hidden": !0,
976
977
  stroke: v
@@ -980,9 +981,9 @@ var W = {
980
981
  disabled: m
981
982
  })
982
983
  });
983
- return /* @__PURE__ */ L(I, { children: k ? /* @__PURE__ */ R(I, { children: [
984
- /* @__PURE__ */ L(S, {
985
- icon: /* @__PURE__ */ L(we, {
984
+ return /* @__PURE__ */ I(F, { children: k ? /* @__PURE__ */ L(F, { children: [
985
+ /* @__PURE__ */ I(S, {
986
+ icon: /* @__PURE__ */ I(Te, {
986
987
  size: _.LG,
987
988
  "aria-hidden": !0,
988
989
  stroke: v
@@ -990,54 +991,54 @@ var W = {
990
991
  "aria-label": i,
991
992
  tooltipProps: { tooltip: i },
992
993
  disabled: m,
993
- onClick: () => j(!0)
994
+ onClick: () => A(!0)
994
995
  }),
995
- /* @__PURE__ */ L(ut, {
996
- isOpen: A,
996
+ /* @__PURE__ */ I(dt, {
997
+ isOpen: ee,
997
998
  title: a,
998
999
  closeLabel: s,
999
- onClose: () => j(!1),
1000
+ onClose: () => A(!1),
1000
1001
  style: u,
1001
- items: ce,
1002
+ items: le,
1002
1003
  className: "pb-4",
1003
1004
  btnTextClassName: "flex-1"
1004
1005
  }),
1005
- oe && /* @__PURE__ */ L(_t, {
1006
- isOpen: ee,
1006
+ se && /* @__PURE__ */ I(vt, {
1007
+ isOpen: ne,
1007
1008
  onBack: () => {
1008
- te(!1), j(!0);
1009
+ M(!1), A(!0);
1009
1010
  },
1010
1011
  backLabel: w,
1011
- onClose: () => te(!1),
1012
+ onClose: () => M(!1),
1012
1013
  closeLabel: s,
1013
1014
  style: u,
1014
1015
  title: C,
1015
1016
  items: b,
1016
1017
  onToolToggle: x
1017
1018
  }),
1018
- T?.map((e) => /* @__PURE__ */ L(Pe, {
1019
- isOpen: ne === e.key,
1019
+ T?.map((e) => /* @__PURE__ */ I(Fe, {
1020
+ isOpen: re === e.key,
1020
1021
  title: e.title,
1021
1022
  closeLabel: s,
1022
1023
  onBack: () => {
1023
- re(null), j(!0);
1024
+ ie(null), A(!0);
1024
1025
  },
1025
1026
  backLabel: e.backLabel ?? "Back",
1026
- onClose: () => re(null),
1027
+ onClose: () => ie(null),
1027
1028
  style: u,
1028
- children: /* @__PURE__ */ L("div", {
1029
+ children: /* @__PURE__ */ I("div", {
1029
1030
  role: "menu",
1030
1031
  "aria-label": e.title,
1031
- children: e.renderOverlay(() => re(null), E?.() ?? 0)
1032
+ children: e.renderOverlay(() => ie(null), E?.() ?? 0)
1032
1033
  })
1033
1034
  }, e.key)),
1034
- h != null && /* @__PURE__ */ L(mt, {
1035
- isOpen: M,
1035
+ h != null && /* @__PURE__ */ I(ht, {
1036
+ isOpen: te,
1036
1037
  onBack: () => {
1037
- N(!1), j(!0);
1038
+ j(!1), A(!0);
1038
1039
  },
1039
1040
  backLabel: h.backLabel ?? "Back",
1040
- onClose: () => N(!1),
1041
+ onClose: () => j(!1),
1041
1042
  closeLabel: s,
1042
1043
  style: u,
1043
1044
  features: h.features,
@@ -1058,13 +1059,13 @@ var W = {
1058
1059
  saveLabel: h.saveLabel,
1059
1060
  saveDisabledTooltip: h.saveDisabledTooltip
1060
1061
  })
1061
- ] }) : /* @__PURE__ */ R(I, { children: [le, h != null && M && /* @__PURE__ */ L(ht, {
1062
+ ] }) : /* @__PURE__ */ L(F, { children: [ue, h != null && te && /* @__PURE__ */ I(gt, {
1062
1063
  features: h.features,
1063
1064
  initialResponseFormat: h.responseFormat ?? o.Markdown,
1064
1065
  initialSystemPrompt: h.systemPrompt,
1065
1066
  initialTemperature: h.temperature,
1066
1067
  onSave: h.onSave,
1067
- onClose: () => N(!1),
1068
+ onClose: () => j(!1),
1068
1069
  title: h.title,
1069
1070
  responseFormatLabel: h.responseFormatLabel,
1070
1071
  responseFormatHint: h.responseFormatHint,
@@ -1076,16 +1077,17 @@ var W = {
1076
1077
  temperatureLabels: h.temperatureLabels,
1077
1078
  temperatureHint: h.temperatureHint,
1078
1079
  saveLabel: h.saveLabel,
1079
- saveDisabledTooltip: h.saveDisabledTooltip
1080
+ saveDisabledTooltip: h.saveDisabledTooltip,
1081
+ colors: h.modalColors
1080
1082
  })] }) });
1081
- }, bt = {
1083
+ }, xt = {
1082
1084
  chip: "_chip_1lvv5_1",
1083
1085
  chipSelected: "_chipSelected_1lvv5_9",
1084
1086
  chipIcon: "_chipIcon_1lvv5_16",
1085
1087
  chipText: "_chipText_1lvv5_19",
1086
1088
  chipState: "_chipState_1lvv5_22",
1087
1089
  chipClose: "_chipClose_1lvv5_25"
1088
- }, xt = (e) => `Remove ${e}`, St = ({ items: e, onToolToggle: t, onToolDismiss: n, canRemove: r = !0, removeLabel: i = xt, stateOnLabel: a, stateOffLabel: o, typography: s, colors: u }) => {
1090
+ }, St = (e) => `Remove ${e}`, Ct = ({ items: e, onToolToggle: t, onToolDismiss: n, canRemove: r = !0, removeLabel: i = St, stateOnLabel: a, stateOffLabel: o, typography: s, colors: u }) => {
1089
1091
  if (e.length === 0) return null;
1090
1092
  let d = !!(a && o), f = c({
1091
1093
  "--ci-chip-bg": u?.chipBg,
@@ -1094,103 +1096,106 @@ var W = {
1094
1096
  "--ci-chip-text": u?.chipText,
1095
1097
  "--ci-chip-hover-bg": u?.chipHoverBg,
1096
1098
  "--ci-chip-selected-bg": u?.chipSelectedBg,
1099
+ "--ci-chip-selected-bg-hover": u?.chipSelectedHoverBg,
1097
1100
  "--ci-chip-selected-border": u?.chipSelectedBorder,
1098
1101
  "--ci-chip-selected-icon": u?.chipSelectedIcon,
1099
1102
  "--ci-chip-selected-text": u?.chipSelectedText,
1100
1103
  "--ci-chip-state-text": u?.chipStateText,
1101
1104
  "--ci-chip-close": u?.chipClose,
1102
1105
  "--ci-chip-close-hover": u?.chipCloseHover
1103
- }), p = (e) => /* @__PURE__ */ L("span", {
1104
- className: l(bt.chipIcon, "flex shrink-0"),
1106
+ }), p = (e) => /* @__PURE__ */ I("span", {
1107
+ className: l(xt.chipIcon, "flex shrink-0"),
1105
1108
  children: e.icon
1106
- }), m = (e) => /* @__PURE__ */ R("span", {
1109
+ }), m = (e) => /* @__PURE__ */ L("span", {
1107
1110
  className: "flex min-w-0 items-center",
1108
- children: [/* @__PURE__ */ R("span", {
1109
- className: l(bt.chipText, s?.fontClassName || "dial-small-paragraph-text", "truncate"),
1110
- children: [e.label, d && /* @__PURE__ */ L("span", {
1111
+ children: [/* @__PURE__ */ L("span", {
1112
+ className: l(xt.chipText, s?.fontClassName || "dial-small-paragraph-text", "truncate"),
1113
+ children: [e.label, d && /* @__PURE__ */ I("span", {
1111
1114
  "aria-hidden": !0,
1112
1115
  children: ":"
1113
1116
  })]
1114
- }), d && /* @__PURE__ */ L("span", {
1115
- className: l(bt.chipState, s?.stateClassName || "dial-tiny-lead-text", "ms-1 shrink-0"),
1117
+ }), d && /* @__PURE__ */ I("span", {
1118
+ className: l(xt.chipState, s?.stateClassName || "dial-tiny-lead-text", "ms-1 shrink-0"),
1116
1119
  "aria-hidden": !0,
1117
1120
  children: e.isSelected ? a : o
1118
1121
  })]
1119
1122
  });
1120
- return /* @__PURE__ */ L("div", {
1123
+ return /* @__PURE__ */ I("div", {
1121
1124
  className: "flex flex-wrap items-center gap-2",
1122
1125
  style: f,
1123
- children: e.map((e) => r ? /* @__PURE__ */ R("div", {
1124
- className: l(bt.chip, e.isSelected && bt.chipSelected, "flex min-w-0 items-center gap-1.5 rounded-full border py-1 ps-2 pe-1 transition-colors"),
1125
- children: [/* @__PURE__ */ R("button", {
1126
+ children: e.map((e) => r ? /* @__PURE__ */ L("div", {
1127
+ className: l(xt.chip, e.isSelected && xt.chipSelected, "flex min-w-0 items-center gap-1.5 rounded-full border py-1 ps-2 pe-1 transition-colors"),
1128
+ children: [/* @__PURE__ */ L("button", {
1126
1129
  type: "button",
1127
1130
  onClick: () => t(e.id),
1128
1131
  "aria-pressed": e.isSelected,
1129
1132
  className: "flex min-w-0 items-center gap-1.5",
1130
- children: [/* @__PURE__ */ L("span", {
1133
+ children: [/* @__PURE__ */ I("span", {
1131
1134
  className: "flex shrink-0",
1132
1135
  "aria-hidden": !0,
1133
1136
  children: p(e)
1134
1137
  }), m(e)]
1135
- }), /* @__PURE__ */ L("button", {
1138
+ }), /* @__PURE__ */ I("button", {
1136
1139
  type: "button",
1137
1140
  onClick: () => n(e.id),
1138
1141
  "aria-label": i(e.label),
1139
- className: l(bt.chipClose, "flex shrink-0 items-center rounded p-0.5 transition-colors"),
1140
- children: /* @__PURE__ */ L(De, {
1142
+ className: l(xt.chipClose, "flex shrink-0 items-center rounded p-0.5 transition-colors"),
1143
+ children: /* @__PURE__ */ I(Oe, {
1141
1144
  size: 12,
1142
1145
  "aria-hidden": !0,
1143
1146
  stroke: v
1144
1147
  })
1145
1148
  })]
1146
- }, e.id) : /* @__PURE__ */ L(ue, {
1149
+ }, e.id) : /* @__PURE__ */ I(de, {
1147
1150
  icon: p(e),
1148
1151
  label: m(e),
1149
1152
  isSelected: e.isSelected,
1150
1153
  onToggle: () => t(e.id),
1151
- className: l(bt.chip, e.isSelected && bt.chipSelected, "h-auto min-w-0 gap-1.5 border px-2 py-1 transition-colors")
1154
+ className: l(xt.chip, e.isSelected && xt.chipSelected, "h-auto min-w-0 gap-1.5 border px-2 py-1 transition-colors")
1152
1155
  }, e.id))
1153
1156
  });
1154
- }, q = {
1155
- wrapper: "_wrapper_19a9k_2",
1156
- wrapperDisabled: "_wrapperDisabled_19a9k_9",
1157
- textarea: "_textarea_19a9k_13",
1158
- textareaMentionMode: "_textareaMentionMode_19a9k_19",
1159
- commandHint: "_commandHint_19a9k_53",
1160
- mentionHighlight: "_mentionHighlight_19a9k_57",
1161
- mentionHighlightUnsupported: "_mentionHighlightUnsupported_19a9k_63",
1162
- modelSelectorButton: "_modelSelectorButton_19a9k_69",
1163
- modelSelectorCaret: "_modelSelectorCaret_19a9k_69",
1164
- modelSelectorName: "_modelSelectorName_19a9k_72",
1165
- modelSelectorVersion: "_modelSelectorVersion_19a9k_75",
1166
- modelSelectorButtonDisabled: "_modelSelectorButtonDisabled_19a9k_84"
1167
- }, Ct = {
1157
+ }, K = {
1158
+ wrapper: "_wrapper_13067_2",
1159
+ wrapperDisabled: "_wrapperDisabled_13067_9",
1160
+ textarea: "_textarea_13067_13",
1161
+ textareaMentionMode: "_textareaMentionMode_13067_19",
1162
+ commandHint: "_commandHint_13067_53",
1163
+ mentionHighlight: "_mentionHighlight_13067_57",
1164
+ mentionHighlightUnsupported: "_mentionHighlightUnsupported_13067_63",
1165
+ selectionHighlight: "_selectionHighlight_13067_69",
1166
+ modelOverlayPanel: "_modelOverlayPanel_13067_78",
1167
+ modelSelectorButton: "_modelSelectorButton_13067_82",
1168
+ modelSelectorCaret: "_modelSelectorCaret_13067_82",
1169
+ modelSelectorName: "_modelSelectorName_13067_85",
1170
+ modelSelectorVersion: "_modelSelectorVersion_13067_88",
1171
+ modelSelectorButtonDisabled: "_modelSelectorButtonDisabled_13067_97"
1172
+ }, wt = {
1168
1173
  waveformCanvas: "_waveformCanvas_18zb5_1",
1169
1174
  recordingDot: "_recordingDot_18zb5_15",
1170
1175
  "recording-pulse": "_recording-pulse_18zb5_1"
1171
- }, wt = 3, Tt = 4, Et = 200, Dt = ({ state: e, analyserNodeRef: t, onStop: n, onDiscard: r, attachButton: i, stopLabel: a = "Stop recording", discardLabel: o = "Discard recording", processingLabel: s = "Transcribing audio…", style: c, className: u, embedded: d = !1 }) => {
1172
- let f = H(null), p = H(new Float32Array(Et)), m = H(0), h = H(0), g = e === et.Recording, y = e === et.Processing, b = z((e) => {
1176
+ }, Tt = 3, Et = 4, Dt = 200, Ot = ({ state: e, analyserNodeRef: t, onStop: n, onDiscard: r, attachButton: i, stopLabel: a = "Stop recording", discardLabel: o = "Discard recording", processingLabel: s = "Transcribing audio…", style: c, className: u, embedded: d = !1 }) => {
1177
+ let f = V(null), p = V(new Float32Array(Dt)), m = V(0), h = V(0), g = e === tt.Recording, y = e === tt.Processing, b = R((e) => {
1173
1178
  let t = e.getContext("2d");
1174
1179
  if (!t) return;
1175
1180
  e.width = e.clientWidth || 200, e.height = e.clientHeight || 32;
1176
1181
  let { width: n, height: r } = e;
1177
1182
  t.clearRect(0, 0, n, r), t.fillStyle = getComputedStyle(e).color;
1178
- let i = Math.min(Math.max(1, Math.floor(n / Tt)), 199), a = m.current, o = h.current;
1183
+ let i = Math.min(Math.max(1, Math.floor(n / Et)), 199), a = m.current, o = h.current;
1179
1184
  t.save(), t.beginPath(), t.rect(0, 0, n, r), t.clip(), t.translate(-o, 0);
1180
1185
  for (let e = 0; e <= i; e++) {
1181
- let n = ((a - i + e) % Et + Et) % Et, o = p.current[n] ?? 0, s = Math.min(1, o * 6), c = Math.max(3, s * r);
1182
- t.fillRect(e * Tt, (r - c) / 2, wt, c);
1186
+ let n = ((a - i + e) % Dt + Dt) % Dt, o = p.current[n] ?? 0, s = Math.min(1, o * 6), c = Math.max(3, s * r);
1187
+ t.fillRect(e * Et, (r - c) / 2, Tt, c);
1183
1188
  }
1184
1189
  t.restore();
1185
1190
  }, []);
1186
- B(() => {
1191
+ z(() => {
1187
1192
  if (!g) return;
1188
1193
  let e = f.current;
1189
1194
  if (!e) return;
1190
1195
  p.current.fill(0), m.current = 0, h.current = 0;
1191
1196
  let n, r = () => {
1192
- if (h.current += 1, h.current >= Tt) {
1193
- h.current -= Tt;
1197
+ if (h.current += 1, h.current >= Et) {
1198
+ h.current -= Et;
1194
1199
  let e = t.current;
1195
1200
  if (e) {
1196
1201
  let t = new Uint8Array(e.frequencyBinCount);
@@ -1200,7 +1205,7 @@ var W = {
1200
1205
  let r = (t[e] - 128) / 128;
1201
1206
  n += r * r;
1202
1207
  }
1203
- p.current[m.current % Et] = Math.sqrt(n / t.length), m.current++;
1208
+ p.current[m.current % Dt] = Math.sqrt(n / t.length), m.current++;
1204
1209
  }
1205
1210
  }
1206
1211
  b(e), n = requestAnimationFrame(r);
@@ -1212,7 +1217,7 @@ var W = {
1212
1217
  g,
1213
1218
  t,
1214
1219
  b
1215
- ]), B(() => {
1220
+ ]), z(() => {
1216
1221
  let e = f.current;
1217
1222
  if (!e) return;
1218
1223
  let t = new ResizeObserver(() => {
@@ -1220,11 +1225,11 @@ var W = {
1220
1225
  });
1221
1226
  return t.observe(e), () => t.disconnect();
1222
1227
  }, [b]);
1223
- let x = /* @__PURE__ */ R("div", {
1228
+ let x = /* @__PURE__ */ L("div", {
1224
1229
  className: "flex shrink-0 items-center justify-end gap-1",
1225
1230
  children: [
1226
- /* @__PURE__ */ L(k, {
1227
- icon: /* @__PURE__ */ L(De, {
1231
+ /* @__PURE__ */ I(k, {
1232
+ icon: /* @__PURE__ */ I(Oe, {
1228
1233
  size: _.LG,
1229
1234
  "aria-hidden": !0,
1230
1235
  stroke: v
@@ -1233,8 +1238,8 @@ var W = {
1233
1238
  className: "mobile:min-h-11 mobile:min-w-11",
1234
1239
  onClick: r
1235
1240
  }),
1236
- g && /* @__PURE__ */ L(ne, {
1237
- icon: /* @__PURE__ */ L(_e, {
1241
+ g && /* @__PURE__ */ I(re, {
1242
+ icon: /* @__PURE__ */ I(ve, {
1238
1243
  size: _.LG,
1239
1244
  "aria-hidden": !0,
1240
1245
  stroke: v
@@ -1244,102 +1249,102 @@ var W = {
1244
1249
  "aria-label": a,
1245
1250
  className: "mobile:min-h-11 mobile:min-w-11"
1246
1251
  }),
1247
- y && /* @__PURE__ */ L("span", {
1252
+ y && /* @__PURE__ */ I("span", {
1248
1253
  className: "flex size-[40px] shrink-0 items-center justify-center mobile:min-h-11 mobile:min-w-11",
1249
- children: /* @__PURE__ */ L(se, {
1254
+ children: /* @__PURE__ */ I(ce, {
1250
1255
  size: 20,
1251
1256
  ariaLabel: s
1252
1257
  })
1253
1258
  })
1254
1259
  ]
1255
1260
  });
1256
- return /* @__PURE__ */ L("div", {
1261
+ return /* @__PURE__ */ I("div", {
1257
1262
  className: u,
1258
- children: /* @__PURE__ */ R("div", {
1263
+ children: /* @__PURE__ */ L("div", {
1259
1264
  style: c,
1260
- className: l("flex w-full min-w-0 flex-col justify-center gap-2", !d && q.wrapper, !d && "min-h-[64px] max-w-[748px] rounded-xl border px-3 shadow-md"),
1261
- children: [/* @__PURE__ */ R("div", {
1265
+ className: l("flex w-full min-w-0 flex-col justify-center gap-2", !d && K.wrapper, !d && "min-h-[64px] max-w-[748px] rounded-xl border px-3 shadow-md"),
1266
+ children: [/* @__PURE__ */ L("div", {
1262
1267
  className: "flex min-w-0 flex-1 items-center gap-3",
1263
- children: [g && /* @__PURE__ */ L("span", {
1264
- className: l(Ct.recordingDot, "pointer-events-none block size-[8px] rounded-3xl"),
1268
+ children: [g && /* @__PURE__ */ I("span", {
1269
+ className: l(wt.recordingDot, "pointer-events-none block size-[8px] rounded-3xl"),
1265
1270
  "aria-hidden": !0
1266
- }), /* @__PURE__ */ L("canvas", {
1271
+ }), /* @__PURE__ */ I("canvas", {
1267
1272
  ref: f,
1268
1273
  height: 26,
1269
1274
  "aria-hidden": !0,
1270
- className: l(Ct.waveformCanvas, "h-[26px] min-w-0 flex-1")
1275
+ className: l(wt.waveformCanvas, "h-[26px] min-w-0 flex-1")
1271
1276
  })]
1272
- }), /* @__PURE__ */ R("div", {
1277
+ }), /* @__PURE__ */ L("div", {
1273
1278
  className: "flex items-center justify-between gap-2",
1274
- children: [i ?? /* @__PURE__ */ L("span", { "aria-hidden": !0 }), x]
1279
+ children: [i ?? /* @__PURE__ */ I("span", { "aria-hidden": !0 }), x]
1275
1280
  })]
1276
1281
  })
1277
1282
  });
1278
- }, Ot = ({ onSend: e, isDisabled: t = !1, ariaLabel: n = "Send message", sendTooltip: r }) => /* @__PURE__ */ L(ne, {
1283
+ }, kt = ({ onSend: e, isDisabled: t = !1, ariaLabel: n = "Send message", sendTooltip: r }) => /* @__PURE__ */ I(re, {
1279
1284
  "aria-label": n,
1280
1285
  onClick: () => e?.(),
1281
1286
  disabled: t,
1282
1287
  tooltipProps: r ? { tooltip: r } : void 0,
1283
- icon: /* @__PURE__ */ L(ge, {
1288
+ icon: /* @__PURE__ */ I(_e, {
1284
1289
  size: _.LG,
1285
1290
  className: "rtl:scale-x-[-1]",
1286
1291
  stroke: v
1287
1292
  })
1288
- }), kt = ({ onStop: e, ariaLabel: t = "Stop streaming" }) => /* @__PURE__ */ L(k, {
1289
- icon: /* @__PURE__ */ L(Ce, {
1293
+ }), At = ({ onStop: e, ariaLabel: t = "Stop streaming" }) => /* @__PURE__ */ I(k, {
1294
+ icon: /* @__PURE__ */ I(we, {
1290
1295
  size: _.LG,
1291
1296
  stroke: v
1292
1297
  }),
1293
1298
  onClick: () => e?.(),
1294
1299
  "aria-label": t
1295
- }), At = ({ size: e = 20 }) => /* @__PURE__ */ L(P, {
1296
- variant: oe.Circular,
1300
+ }), jt = ({ size: e = 20 }) => /* @__PURE__ */ I(N, {
1301
+ variant: se.Circular,
1297
1302
  width: e,
1298
1303
  height: e,
1299
1304
  active: !0
1300
- }), jt = ({ loadingLabel: e }) => /* @__PURE__ */ R("span", {
1305
+ }), Mt = ({ loadingLabel: e }) => /* @__PURE__ */ L("span", {
1301
1306
  className: "flex min-w-0 flex-1 items-center",
1302
- children: [/* @__PURE__ */ L(P, {
1303
- variant: oe.Text,
1307
+ children: [/* @__PURE__ */ I(N, {
1308
+ variant: se.Text,
1304
1309
  width: "100%",
1305
1310
  height: 16,
1306
1311
  active: !0
1307
- }), e && /* @__PURE__ */ L("span", {
1312
+ }), e && /* @__PURE__ */ I("span", {
1308
1313
  className: "sr-only",
1309
1314
  children: e
1310
1315
  })]
1311
- }), Mt = () => /* @__PURE__ */ L("div", {
1316
+ }), Nt = () => /* @__PURE__ */ I("div", {
1312
1317
  "aria-hidden": "true",
1313
- children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */ R("div", {
1318
+ children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */ L("div", {
1314
1319
  className: "flex h-11 items-center gap-3 px-4",
1315
- children: [/* @__PURE__ */ L(At, {}), /* @__PURE__ */ L(jt, {})]
1320
+ children: [/* @__PURE__ */ I(jt, {}), /* @__PURE__ */ I(Mt, {})]
1316
1321
  }, t))
1317
- }), Nt = (e) => e.displayName ?? e.id, Pt = (e, t) => {
1322
+ }), Pt = (e) => e.displayName ?? e.id, Ft = (e, t) => {
1318
1323
  let n = t.trim().toLowerCase();
1319
- return n ? e.filter((e) => Nt(e).toLowerCase().includes(n)) : e;
1320
- }, Ft = (e, t, r, i = 18, a) => /* @__PURE__ */ L(n, {
1324
+ return n ? e.filter((e) => Pt(e).toLowerCase().includes(n)) : e;
1325
+ }, It = (e, t, r, i = 18, a) => /* @__PURE__ */ I(n, {
1321
1326
  src: e,
1322
1327
  size: i,
1323
1328
  labels: { tooltip: a },
1324
1329
  initialsName: r
1325
- }), It = {
1330
+ }), Lt = {
1326
1331
  searchHeader: "_searchHeader_1u7db_1",
1327
1332
  itemText: "_itemText_1u7db_13",
1328
1333
  itemHover: "_itemHover_1u7db_17",
1329
1334
  selectedItemBackground: "_selectedItemBackground_1u7db_22",
1330
1335
  selectedItemText: "_selectedItemText_1u7db_26",
1331
1336
  checkIcon: "_checkIcon_1u7db_30"
1332
- }, Lt = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, styles: i }) => {
1333
- let [a, o] = U(""), s = V(() => e?.find((e) => e.id === t), [e, t]), u = r?.loading !== void 0, d = !u && !s && !!t, f = V(() => u ? /* @__PURE__ */ L(At, { size: _.LG }) : Ft(s?.iconUrl, s?.type, s?.displayName ?? s?.id ?? "", _.LG, d ? r?.unavailableTooltip ?? "This deployment is no longer available" : void 0), [
1337
+ }, Rt = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, styles: i }) => {
1338
+ let [a, o] = H(""), s = B(() => e?.find((e) => e.id === t), [e, t]), u = r?.loading !== void 0, d = !u && !s && !!t, f = B(() => u ? /* @__PURE__ */ I(jt, { size: _.LG }) : It(s?.iconUrl, s?.type, s?.displayName ?? s?.id ?? "", _.LG, d ? r?.unavailableTooltip ?? "This deployment is no longer available" : void 0), [
1334
1339
  u,
1335
1340
  s,
1336
1341
  d,
1337
1342
  r?.unavailableTooltip
1338
- ]), p = s?.displayName ?? s?.id, m = s?.displayVersion, h = p ? `${r?.ariaLabel ?? "Select model"}: ${p}` : r?.ariaLabel ?? "Select model", g = V(() => {
1343
+ ]), p = s?.displayName ?? s?.id, m = s?.displayVersion, h = p ? `${r?.ariaLabel ?? "Select model"}: ${p}` : r?.ariaLabel ?? "Select model", g = B(() => {
1339
1344
  if (u) return Array.from({ length: 7 }, (e, t) => ({
1340
1345
  key: `__loading-${t}`,
1341
- icon: /* @__PURE__ */ L(At, {}),
1342
- label: /* @__PURE__ */ L(jt, { loadingLabel: t === 0 ? r?.loading : void 0 }),
1346
+ icon: /* @__PURE__ */ I(jt, {}),
1347
+ label: /* @__PURE__ */ I(Mt, { loadingLabel: t === 0 ? r?.loading : void 0 }),
1343
1348
  disabled: !0
1344
1349
  }));
1345
1350
  if (!e || e.length === 0) {
@@ -1351,19 +1356,19 @@ var W = {
1351
1356
  }] : [];
1352
1357
  }
1353
1358
  let o = i?.colors;
1354
- return Pt(e, a).map((e) => {
1359
+ return Ft(e, a).map((e) => {
1355
1360
  let r = e.id === t;
1356
1361
  return {
1357
1362
  key: e.id,
1358
- label: /* @__PURE__ */ L(C, {
1359
- text: Nt(e),
1363
+ label: /* @__PURE__ */ I(C, {
1364
+ text: Pt(e),
1360
1365
  query: a,
1361
1366
  maxLines: 1
1362
1367
  }),
1363
- icon: Ft(e.iconUrl, e.type, e.displayName ?? e.id),
1368
+ icon: It(e.iconUrl, e.type, e.displayName ?? e.id),
1364
1369
  mark: D.Check,
1365
1370
  checked: r,
1366
- className: l(o?.itemText && It.itemText, o?.itemHoverBackground && It.itemHover, r && o?.selectedItemBackground && It.selectedItemBackground, r && o?.selectedItemText && It.selectedItemText, r && o?.checkIcon && It.checkIcon, i?.itemClassName, r && i?.selectedItemClassName, W.modelMenuItem, r && W.modelMenuItemSelected),
1371
+ className: l(o?.itemText && Lt.itemText, o?.itemHoverBackground && Lt.itemHover, r && o?.selectedItemBackground && Lt.selectedItemBackground, r && o?.selectedItemText && Lt.selectedItemText, r && o?.checkIcon && Lt.checkIcon, i?.itemClassName, r && i?.selectedItemClassName, U.modelMenuItem, r && U.modelMenuItemSelected),
1367
1372
  onClick: () => n?.(e.id)
1368
1373
  };
1369
1374
  });
@@ -1377,7 +1382,7 @@ var W = {
1377
1382
  i?.itemClassName,
1378
1383
  i?.selectedItemClassName,
1379
1384
  i?.colors
1380
- ]), v = V(() => c({
1385
+ ]), v = B(() => c({
1381
1386
  "--ms-item-text": i?.colors?.itemText,
1382
1387
  "--ms-item-hover-bg": i?.colors?.itemHoverBackground,
1383
1388
  "--ms-selected-item-bg": i?.colors?.selectedItemBackground,
@@ -1390,10 +1395,10 @@ var W = {
1390
1395
  selectedLabel: p,
1391
1396
  selectedVersion: m,
1392
1397
  menuItems: g,
1393
- menuHeader: V(() => !u && e && e.length > 0 ? /* @__PURE__ */ L("div", {
1398
+ menuHeader: B(() => !u && e && e.length > 0 ? /* @__PURE__ */ I("div", {
1394
1399
  style: c({ "--ms-search-header-bg": i?.colors?.searchHeaderBackground }),
1395
- className: l("sticky top-0 z-10 pe-2 pt-2 pb-1", It.searchHeader, i?.searchHeaderClassName, W.modelMenuSearch),
1396
- children: /* @__PURE__ */ L(ae, {
1400
+ className: l("sticky top-0 z-10 pe-2 pt-2 pb-1", Lt.searchHeader, i?.searchHeaderClassName, U.modelMenuSearch),
1401
+ children: /* @__PURE__ */ I(oe, {
1397
1402
  value: a,
1398
1403
  placeholder: r?.searchPlaceholder ?? "Search",
1399
1404
  size: b.Small,
@@ -1413,22 +1418,22 @@ var W = {
1413
1418
  e || o("");
1414
1419
  }
1415
1420
  };
1416
- }, Rt = typeof window < "u" ? Ne : B;
1417
- function zt(e) {
1421
+ }, zt = typeof window < "u" ? Pe : z;
1422
+ function Bt(e) {
1418
1423
  if (e !== void 0) switch (typeof e) {
1419
1424
  case "number": return e;
1420
1425
  case "string": if (e.endsWith("px")) return parseFloat(e);
1421
1426
  }
1422
1427
  }
1423
- function Bt({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
1424
- let { styleHeight: s, styleWidth: c } = V(() => ({
1425
- styleHeight: zt(o?.height),
1426
- styleWidth: zt(o?.width)
1427
- }), [o?.height, o?.width]), [l, u] = U({
1428
+ function Vt({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
1429
+ let { styleHeight: s, styleWidth: c } = B(() => ({
1430
+ styleHeight: Bt(o?.height),
1431
+ styleWidth: Bt(o?.width)
1432
+ }), [o?.height, o?.width]), [l, u] = H({
1428
1433
  height: t,
1429
1434
  width: n
1430
1435
  }), d = r || a === "only-height" && s !== void 0 || a === "only-width" && c !== void 0 || s !== void 0 && c !== void 0;
1431
- return Rt(() => {
1436
+ return zt(() => {
1432
1437
  if (i === null || d) return;
1433
1438
  let t = new ResizeObserver((e) => {
1434
1439
  for (let t of e) {
@@ -1448,7 +1453,7 @@ function Bt({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
1448
1453
  i,
1449
1454
  s,
1450
1455
  c
1451
- ]), V(() => ({
1456
+ ]), B(() => ({
1452
1457
  height: s ?? l.height,
1453
1458
  width: c ?? l.width
1454
1459
  }), [
@@ -1457,26 +1462,26 @@ function Bt({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
1457
1462
  c
1458
1463
  ]);
1459
1464
  }
1460
- function Vt(e) {
1461
- let t = H(() => {
1465
+ function Ht(e) {
1466
+ let t = V(() => {
1462
1467
  throw Error("Cannot call during render.");
1463
1468
  });
1464
- return Rt(() => {
1469
+ return zt(() => {
1465
1470
  t.current = e;
1466
- }, [e]), z((e) => t.current?.(e), [t]);
1471
+ }, [e]), R((e) => t.current?.(e), [t]);
1467
1472
  }
1468
- var J = null;
1469
- function Y(e = !1) {
1470
- if (J === null || e) {
1473
+ var q = null;
1474
+ function J(e = !1) {
1475
+ if (q === null || e) {
1471
1476
  let e = document.createElement("div"), t = e.style;
1472
1477
  t.width = "50px", t.height = "50px", t.overflow = "scroll", t.direction = "rtl";
1473
1478
  let n = document.createElement("div"), r = n.style;
1474
- return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ? J = "positive-descending" : (e.scrollLeft = 1, J = e.scrollLeft === 0 ? "negative" : "positive-ascending"), document.body.removeChild(e), J;
1479
+ return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ? q = "positive-descending" : (e.scrollLeft = 1, q = e.scrollLeft === 0 ? "negative" : "positive-ascending"), document.body.removeChild(e), q;
1475
1480
  }
1476
- return J;
1481
+ return q;
1477
1482
  }
1478
- function X({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
1479
- if (t === "horizontal" && n) switch (Y()) {
1483
+ function Y({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
1484
+ if (t === "horizontal" && n) switch (J()) {
1480
1485
  case "negative": return -r;
1481
1486
  case "positive-descending": if (e) {
1482
1487
  let { clientWidth: t, scrollLeft: n, scrollWidth: r } = e;
@@ -1485,26 +1490,26 @@ function X({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
1485
1490
  }
1486
1491
  return r;
1487
1492
  }
1488
- function Ht(e, t = "Assertion error") {
1493
+ function Ut(e, t = "Assertion error") {
1489
1494
  if (!e) throw console.error(t), Error(t);
1490
1495
  }
1491
- function Ut(e, t) {
1496
+ function Wt(e, t) {
1492
1497
  if (e === t) return !0;
1493
- if (!!e != !!t || (Ht(e !== void 0), Ht(t !== void 0), Object.keys(e).length !== Object.keys(t).length)) return !1;
1498
+ if (!!e != !!t || (Ut(e !== void 0), Ut(t !== void 0), Object.keys(e).length !== Object.keys(t).length)) return !1;
1494
1499
  for (let n in e) if (!Object.is(t[n], e[n])) return !1;
1495
1500
  return !0;
1496
1501
  }
1497
- function Wt({ cachedBounds: e, itemCount: t, itemSize: n }) {
1502
+ function Gt({ cachedBounds: e, itemCount: t, itemSize: n }) {
1498
1503
  if (t === 0) return 0;
1499
1504
  if (typeof n == "number") return t * n;
1500
1505
  {
1501
1506
  let n = e.get(e.size === 0 ? 0 : e.size - 1);
1502
- return Ht(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
1507
+ return Ut(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
1503
1508
  }
1504
1509
  }
1505
- function Gt({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, containerScrollOffset: a, containerSize: o }) {
1510
+ function Kt({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, containerScrollOffset: a, containerSize: o }) {
1506
1511
  if (n < 0 || n >= r) throw RangeError(`Invalid index specified: ${n}`, { cause: `Index ${n} is not within the range of 0 - ${r - 1}` });
1507
- let s = Wt({
1512
+ let s = Gt({
1508
1513
  cachedBounds: t,
1509
1514
  itemCount: r,
1510
1515
  itemSize: i
@@ -1516,7 +1521,7 @@ function Gt({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, co
1516
1521
  default: return a >= u && a <= l ? a : a < u ? u : l;
1517
1522
  }
1518
1523
  }
1519
- function Z({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCount: r, overscanCount: i }) {
1524
+ function X({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCount: r, overscanCount: i }) {
1520
1525
  let a = r - 1, o = 0, s = -1, c = 0, l = -1, u = 0;
1521
1526
  for (; u < a;) {
1522
1527
  let n = e.get(u);
@@ -1535,11 +1540,11 @@ function Z({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCo
1535
1540
  stopIndexOverscan: l
1536
1541
  };
1537
1542
  }
1538
- function Kt({ itemCount: e, itemProps: t, itemSize: n }) {
1543
+ function qt({ itemCount: e, itemProps: t, itemSize: n }) {
1539
1544
  let r = /* @__PURE__ */ new Map();
1540
1545
  return {
1541
1546
  get(i) {
1542
- for (Ht(i < e, `Invalid index ${i}`); r.size - 1 < i;) {
1547
+ for (Ut(i < e, `Invalid index ${i}`); r.size - 1 < i;) {
1543
1548
  let e = r.size, a;
1544
1549
  switch (typeof n) {
1545
1550
  case "function":
@@ -1553,14 +1558,14 @@ function Kt({ itemCount: e, itemProps: t, itemSize: n }) {
1553
1558
  });
1554
1559
  else {
1555
1560
  let t = r.get(e - 1);
1556
- Ht(t !== void 0, `Unexpected bounds cache miss for index ${i}`), r.set(e, {
1561
+ Ut(t !== void 0, `Unexpected bounds cache miss for index ${i}`), r.set(e, {
1557
1562
  scrollOffset: t.scrollOffset + t.size,
1558
1563
  size: a
1559
1564
  });
1560
1565
  }
1561
1566
  }
1562
1567
  let a = r.get(i);
1563
- return Ht(a !== void 0, `Unexpected bounds cache miss for index ${i}`), a;
1568
+ return Ut(a !== void 0, `Unexpected bounds cache miss for index ${i}`), a;
1564
1569
  },
1565
1570
  set(e, t) {
1566
1571
  r.set(e, t);
@@ -1570,8 +1575,8 @@ function Kt({ itemCount: e, itemProps: t, itemSize: n }) {
1570
1575
  }
1571
1576
  };
1572
1577
  }
1573
- function qt({ itemCount: e, itemProps: t, itemSize: n }) {
1574
- return V(() => Kt({
1578
+ function Jt({ itemCount: e, itemProps: t, itemSize: n }) {
1579
+ return B(() => qt({
1575
1580
  itemCount: e,
1576
1581
  itemProps: t,
1577
1582
  itemSize: n
@@ -1581,31 +1586,31 @@ function qt({ itemCount: e, itemProps: t, itemSize: n }) {
1581
1586
  n
1582
1587
  ]);
1583
1588
  }
1584
- function Jt({ containerSize: e, itemSize: t }) {
1589
+ function Yt({ containerSize: e, itemSize: t }) {
1585
1590
  let n;
1586
1591
  switch (typeof t) {
1587
1592
  case "string":
1588
- Ht(t.endsWith("%"), `Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`), Ht(e !== void 0, "Container size must be defined if a percentage item size is specified"), n = e * parseInt(t) / 100;
1593
+ Ut(t.endsWith("%"), `Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`), Ut(e !== void 0, "Container size must be defined if a percentage item size is specified"), n = e * parseInt(t) / 100;
1589
1594
  break;
1590
1595
  default: n = t;
1591
1596
  }
1592
1597
  return n;
1593
1598
  }
1594
- function Yt({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0, direction: r, isRtl: i = !1, itemCount: a, itemProps: o, itemSize: s, onResize: c, overscanCount: l }) {
1595
- let { height: u = n, width: d = n } = Bt({
1599
+ function Xt({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0, direction: r, isRtl: i = !1, itemCount: a, itemProps: o, itemSize: s, onResize: c, overscanCount: l }) {
1600
+ let { height: u = n, width: d = n } = Vt({
1596
1601
  defaultHeight: r === "vertical" ? n : void 0,
1597
1602
  defaultWidth: r === "horizontal" ? n : void 0,
1598
1603
  element: e,
1599
1604
  mode: r === "vertical" ? "only-height" : "only-width",
1600
1605
  style: t
1601
- }), f = H({
1606
+ }), f = V({
1602
1607
  height: 0,
1603
1608
  width: 0
1604
- }), p = r === "vertical" ? u : d, m = Jt({
1609
+ }), p = r === "vertical" ? u : d, m = Yt({
1605
1610
  containerSize: p,
1606
1611
  itemSize: s
1607
1612
  });
1608
- Ne(() => {
1613
+ Pe(() => {
1609
1614
  if (typeof c == "function") {
1610
1615
  let e = f.current;
1611
1616
  (e.height !== u || e.width !== d) && (c({
@@ -1618,11 +1623,11 @@ function Yt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1618
1623
  c,
1619
1624
  d
1620
1625
  ]);
1621
- let h = qt({
1626
+ let h = Jt({
1622
1627
  itemCount: a,
1623
1628
  itemProps: o,
1624
1629
  itemSize: m
1625
- }), g = z((e) => h.get(e), [h]), [_, v] = U(() => Z({
1630
+ }), g = R((e) => h.get(e), [h]), [_, v] = H(() => X({
1626
1631
  cachedBounds: h,
1627
1632
  containerScrollOffset: 0,
1628
1633
  containerSize: p,
@@ -1633,7 +1638,7 @@ function Yt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1633
1638
  startIndexOverscan: Math.min(a - 1, _.startIndexOverscan),
1634
1639
  stopIndexVisible: Math.min(a - 1, _.stopIndexVisible),
1635
1640
  stopIndexOverscan: Math.min(a - 1, _.stopIndexOverscan)
1636
- }, C = z(() => Wt({
1641
+ }, C = R(() => Gt({
1637
1642
  cachedBounds: h,
1638
1643
  itemCount: a,
1639
1644
  itemSize: m
@@ -1641,14 +1646,14 @@ function Yt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1641
1646
  h,
1642
1647
  a,
1643
1648
  m
1644
- ]), w = z((t) => {
1645
- let n = X({
1649
+ ]), w = R((t) => {
1650
+ let n = Y({
1646
1651
  containerElement: e,
1647
1652
  direction: r,
1648
1653
  isRtl: i,
1649
1654
  scrollOffset: t
1650
1655
  });
1651
- return Z({
1656
+ return X({
1652
1657
  cachedBounds: h,
1653
1658
  containerScrollOffset: n,
1654
1659
  containerSize: p,
@@ -1664,30 +1669,30 @@ function Yt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1664
1669
  a,
1665
1670
  l
1666
1671
  ]);
1667
- return Rt(() => {
1672
+ return zt(() => {
1668
1673
  let t = (r === "vertical" ? e?.scrollTop : e?.scrollLeft) ?? 0;
1669
1674
  v(w(t));
1670
1675
  }, [
1671
1676
  e,
1672
1677
  r,
1673
1678
  w
1674
- ]), Rt(() => {
1679
+ ]), zt(() => {
1675
1680
  if (!e) return;
1676
1681
  let t = () => {
1677
1682
  v((t) => {
1678
- let { scrollLeft: n, scrollTop: o } = e, s = X({
1683
+ let { scrollLeft: n, scrollTop: o } = e, s = Y({
1679
1684
  containerElement: e,
1680
1685
  direction: r,
1681
1686
  isRtl: i,
1682
1687
  scrollOffset: r === "vertical" ? o : n
1683
- }), c = Z({
1688
+ }), c = X({
1684
1689
  cachedBounds: h,
1685
1690
  containerScrollOffset: s,
1686
1691
  containerSize: p,
1687
1692
  itemCount: a,
1688
1693
  overscanCount: l
1689
1694
  });
1690
- return Ut(c, t) ? t : c;
1695
+ return Wt(c, t) ? t : c;
1691
1696
  });
1692
1697
  };
1693
1698
  return e.addEventListener("scroll", t), () => {
@@ -1703,8 +1708,8 @@ function Yt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1703
1708
  ]), {
1704
1709
  getCellBounds: g,
1705
1710
  getEstimatedSize: C,
1706
- scrollToIndex: Vt(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
1707
- let s = Gt({
1711
+ scrollToIndex: Ht(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
1712
+ let s = Kt({
1708
1713
  align: t,
1709
1714
  cachedBounds: h,
1710
1715
  containerScrollOffset: n,
@@ -1714,14 +1719,14 @@ function Yt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1714
1719
  itemSize: m
1715
1720
  });
1716
1721
  if (e) {
1717
- if (s = X({
1722
+ if (s = Y({
1718
1723
  containerElement: e,
1719
1724
  direction: r,
1720
1725
  isRtl: i,
1721
1726
  scrollOffset: s
1722
1727
  }), typeof e.scrollTo != "function") {
1723
1728
  let e = w(s);
1724
- Ut(_, e) || v(e);
1729
+ Wt(_, e) || v(e);
1725
1730
  }
1726
1731
  return s;
1727
1732
  }
@@ -1732,30 +1737,30 @@ function Yt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1732
1737
  stopIndexVisible: x
1733
1738
  };
1734
1739
  }
1735
- function Xt(e) {
1736
- return V(() => e, Object.values(e));
1740
+ function Zt(e) {
1741
+ return B(() => e, Object.values(e));
1737
1742
  }
1738
- function Zt(e, t) {
1743
+ function Qt(e, t) {
1739
1744
  let { ariaAttributes: n, style: r, ...i } = e, { ariaAttributes: a, style: o, ...s } = t;
1740
- return Ut(n, a) && Ut(r, o) && Ut(i, s);
1745
+ return Wt(n, a) && Wt(r, o) && Wt(i, s);
1741
1746
  }
1742
- function Qt(e) {
1747
+ function $t(e) {
1743
1748
  return typeof e == "object" && !!e && "getAverageRowHeight" in e && typeof e.getAverageRowHeight == "function";
1744
1749
  }
1745
- var $t = "data-react-window-index";
1746
- function en({ children: e, className: t, defaultHeight: n = 0, listRef: r, onResize: i, onRowsRendered: a, overscanCount: o = 3, rowComponent: s, rowCount: c, rowHeight: l, rowProps: u, tagName: d = "div", style: f, ...p }) {
1747
- let m = Xt(u), h = V(() => Ae(s, Zt), [s]), [g, _] = U(null), v = Qt(l), { getCellBounds: y, getEstimatedSize: b, scrollToIndex: x, startIndexOverscan: S, startIndexVisible: C, stopIndexOverscan: w, stopIndexVisible: T } = Yt({
1750
+ var en = "data-react-window-index";
1751
+ function tn({ children: e, className: t, defaultHeight: n = 0, listRef: r, onResize: i, onRowsRendered: a, overscanCount: o = 3, rowComponent: s, rowCount: c, rowHeight: l, rowProps: u, tagName: d = "div", style: f, ...p }) {
1752
+ let m = Zt(u), h = B(() => je(s, Qt), [s]), [g, _] = H(null), v = $t(l), { getCellBounds: y, getEstimatedSize: b, scrollToIndex: x, startIndexOverscan: S, startIndexVisible: C, stopIndexOverscan: w, stopIndexVisible: T } = Xt({
1748
1753
  containerElement: g,
1749
1754
  containerStyle: f,
1750
1755
  defaultContainerSize: n,
1751
1756
  direction: "vertical",
1752
1757
  itemCount: c,
1753
1758
  itemProps: m,
1754
- itemSize: V(() => v ? (e) => l.getRowHeight(e) ?? l.getAverageRowHeight() : l, [v, l]),
1759
+ itemSize: B(() => v ? (e) => l.getRowHeight(e) ?? l.getAverageRowHeight() : l, [v, l]),
1755
1760
  onResize: i,
1756
1761
  overscanCount: o
1757
1762
  });
1758
- Me(r, () => ({
1763
+ Ne(r, () => ({
1759
1764
  get element() {
1760
1765
  return g;
1761
1766
  },
@@ -1770,12 +1775,12 @@ function en({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
1770
1775
  top: r
1771
1776
  });
1772
1777
  }
1773
- }), [g, x]), Rt(() => {
1778
+ }), [g, x]), zt(() => {
1774
1779
  if (!g) return;
1775
1780
  let e = Array.from(g.children).filter((e, t) => {
1776
1781
  if (e.hasAttribute("aria-hidden")) return !1;
1777
1782
  let n = `${S + t}`;
1778
- return e.setAttribute($t, n), !0;
1783
+ return e.setAttribute(en, n), !0;
1779
1784
  });
1780
1785
  if (v) return l.observeRowElements(e);
1781
1786
  }, [
@@ -1784,7 +1789,7 @@ function en({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
1784
1789
  l,
1785
1790
  S,
1786
1791
  w
1787
- ]), B(() => {
1792
+ ]), z(() => {
1788
1793
  S >= 0 && w >= 0 && a && a({
1789
1794
  startIndex: C,
1790
1795
  stopIndex: T
@@ -1799,11 +1804,11 @@ function en({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
1799
1804
  w,
1800
1805
  T
1801
1806
  ]);
1802
- let E = V(() => {
1807
+ let E = B(() => {
1803
1808
  let e = [];
1804
1809
  if (c > 0) for (let t = S; t <= w; t++) {
1805
1810
  let n = y(t);
1806
- e.push(/* @__PURE__ */ Oe(h, {
1811
+ e.push(/* @__PURE__ */ ke(h, {
1807
1812
  ...m,
1808
1813
  ariaAttributes: {
1809
1814
  "aria-posinset": t + 1,
@@ -1830,7 +1835,7 @@ function en({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
1830
1835
  m,
1831
1836
  S,
1832
1837
  w
1833
- ]), D = /* @__PURE__ */ L("div", {
1838
+ ]), D = /* @__PURE__ */ I("div", {
1834
1839
  "aria-hidden": !0,
1835
1840
  style: {
1836
1841
  height: b(),
@@ -1838,7 +1843,7 @@ function en({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
1838
1843
  zIndex: -1
1839
1844
  }
1840
1845
  });
1841
- return Oe(d, {
1846
+ return ke(d, {
1842
1847
  role: "list",
1843
1848
  ...p,
1844
1849
  className: t,
@@ -1852,7 +1857,7 @@ function en({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
1852
1857
  }
1853
1858
  }, E, e, D);
1854
1859
  }
1855
- var Q = {
1860
+ var Z = {
1856
1861
  search: "_search_5skzl_1",
1857
1862
  divider: "_divider_5skzl_5",
1858
1863
  item: "_item_5skzl_9",
@@ -1861,29 +1866,29 @@ var Q = {
1861
1866
  stateLabel: "_stateLabel_5skzl_27",
1862
1867
  itemSelectedBackground: "_itemSelectedBackground_5skzl_37",
1863
1868
  itemSelectedText: "_itemSelectedText_5skzl_41"
1864
- }, tn = 44, nn = 8, rn = ({ index: e, style: t, ariaAttributes: n, items: r, selectedDeploymentId: i, labelClassName: a, query: o, itemClassName: s, selectedItemClassName: c, hasSelectedBackground: u, hasSelectedText: d, onSelect: f }) => {
1865
- let p = r[e], h = Ft(p.iconUrl, p.type, p.displayName ?? p.id, _.SM), g = p.id === i;
1866
- return /* @__PURE__ */ L("div", {
1869
+ }, nn = 44, rn = 8, an = ({ index: e, style: t, ariaAttributes: n, items: r, selectedDeploymentId: i, labelClassName: a, query: o, itemClassName: s, selectedItemClassName: c, hasSelectedBackground: u, hasSelectedText: d, onSelect: f }) => {
1870
+ let p = r[e], h = It(p.iconUrl, p.type, p.displayName ?? p.id, _.SM), g = p.id === i;
1871
+ return /* @__PURE__ */ I("div", {
1867
1872
  style: t,
1868
1873
  ...n,
1869
- children: /* @__PURE__ */ L(m, {
1874
+ children: /* @__PURE__ */ I(m, {
1870
1875
  type: "button",
1871
1876
  "aria-current": g ? "true" : void 0,
1872
- className: l(Q.item, "h-full w-full gap-3 px-4", g && u && Q.itemSelectedBackground, g && d && Q.itemSelectedText, s, g && c, W.modelMenuItem, g && W.modelMenuItemSelected),
1873
- iconBefore: /* @__PURE__ */ L("span", {
1874
- className: Q.itemIcon,
1877
+ className: l(Z.item, "h-full w-full gap-3 px-4", g && u && Z.itemSelectedBackground, g && d && Z.itemSelectedText, s, g && c, U.modelMenuItem, g && U.modelMenuItemSelected),
1878
+ iconBefore: /* @__PURE__ */ I("span", {
1879
+ className: Z.itemIcon,
1875
1880
  children: h
1876
1881
  }),
1877
- label: /* @__PURE__ */ R("span", {
1882
+ label: /* @__PURE__ */ L("span", {
1878
1883
  className: "flex flex-1 items-center justify-between gap-2",
1879
- children: [/* @__PURE__ */ L(C, {
1884
+ children: [/* @__PURE__ */ I(C, {
1880
1885
  text: p.displayName ?? p.id,
1881
1886
  query: o,
1882
1887
  maxLines: 1,
1883
1888
  className: l(a, "min-w-0 flex-1 text-start")
1884
- }), g && /* @__PURE__ */ L(_e, {
1889
+ }), g && /* @__PURE__ */ I(ve, {
1885
1890
  size: _.SM,
1886
- className: Q.checkIcon,
1891
+ className: Z.checkIcon,
1887
1892
  "aria-hidden": !0,
1888
1893
  stroke: v
1889
1894
  })]
@@ -1891,12 +1896,12 @@ var Q = {
1891
1896
  onClick: () => f(p.id)
1892
1897
  })
1893
1898
  });
1894
- }, an = ({ isOpen: e, title: t, closeLabel: n, searchPlaceholder: r = "Search", onClose: i, deployments: a, selectedDeploymentId: o, onSelect: s, loadingLabel: u, errorLabel: d, emptyLabel: f, style: p, titleClassName: m = "dial-body-semi-text", labelClassName: h = "dial-small-text", colors: g, menuStyles: _ }) => {
1895
- let [v, y] = U("");
1896
- B(() => {
1899
+ }, on = ({ isOpen: e, title: t, closeLabel: n, searchPlaceholder: r = "Search", onClose: i, deployments: a, selectedDeploymentId: o, onSelect: s, loadingLabel: u, errorLabel: d, emptyLabel: f, style: p, titleClassName: m = "dial-body-semi-text", labelClassName: h = "dial-small-text", colors: g, menuStyles: _ }) => {
1900
+ let [v, y] = H("");
1901
+ z(() => {
1897
1902
  e || y("");
1898
1903
  }, [e]);
1899
- let x = a && a.length > 0, S = u !== void 0, C = !x && !S ? d ?? f : void 0, T = x ? Pt(a, v) : [], E = (e) => {
1904
+ let x = a && a.length > 0, S = u !== void 0, C = !x && !S ? d ?? f : void 0, T = x ? Ft(a, v) : [], E = (e) => {
1900
1905
  s(e), i();
1901
1906
  }, D = _?.colors, O = c({
1902
1907
  "--ci-sheet-divider": g?.divider,
@@ -1908,44 +1913,44 @@ var Q = {
1908
1913
  "--ci-sheet-selected-bg": D?.selectedItemBackground,
1909
1914
  "--ci-sheet-selected-text": D?.selectedItemText
1910
1915
  });
1911
- return /* @__PURE__ */ L(Pe, {
1916
+ return /* @__PURE__ */ I(Fe, {
1912
1917
  isOpen: e,
1913
1918
  title: t,
1914
1919
  closeLabel: n,
1915
1920
  onClose: i,
1916
1921
  style: p,
1917
1922
  titleClassName: m,
1918
- className: l("max-h-[80dvh]", _?.className, W.modelMenu),
1923
+ className: l("max-h-[80dvh]", _?.className, U.modelMenu),
1919
1924
  colors: g?.shell,
1920
- children: /* @__PURE__ */ R("div", {
1925
+ children: /* @__PURE__ */ L("div", {
1921
1926
  className: "contents",
1922
1927
  style: O,
1923
1928
  children: [
1924
- /* @__PURE__ */ L(w, {
1929
+ /* @__PURE__ */ I(w, {
1925
1930
  visuallyHidden: !0,
1926
1931
  children: S ? u : null
1927
1932
  }),
1928
- x && !S && /* @__PURE__ */ R(I, { children: [/* @__PURE__ */ L("div", {
1933
+ x && !S && /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I("div", {
1929
1934
  style: c({ "--ci-sheet-search-bg": _?.colors?.searchHeaderBackground }),
1930
- className: l("flex-shrink-0 px-4 py-[10px]", Q.search, _?.searchHeaderClassName, W.modelMenuSearch),
1931
- children: /* @__PURE__ */ L(ae, {
1935
+ className: l("shrink-0 px-4 py-[10px]", Z.search, _?.searchHeaderClassName, U.modelMenuSearch),
1936
+ children: /* @__PURE__ */ I(oe, {
1932
1937
  value: v,
1933
1938
  placeholder: r,
1934
1939
  size: b.Standard,
1935
1940
  onChange: (e) => y(e ?? "")
1936
1941
  })
1937
- }), /* @__PURE__ */ L("div", { className: l(Q.divider, "h-px shrink-0") })] }),
1938
- S ? /* @__PURE__ */ L(Mt, {}) : C ? /* @__PURE__ */ L("div", {
1942
+ }), /* @__PURE__ */ I("div", { className: l(Z.divider, "h-px shrink-0") })] }),
1943
+ S ? /* @__PURE__ */ I(Nt, {}) : C ? /* @__PURE__ */ I("div", {
1939
1944
  role: "list",
1940
- className: l(Q.stateLabel, h, "px-4 py-4"),
1945
+ className: l(Z.stateLabel, h, "px-4 py-4"),
1941
1946
  children: C
1942
- }) : /* @__PURE__ */ L(en, {
1947
+ }) : /* @__PURE__ */ I(tn, {
1943
1948
  role: "list",
1944
1949
  className: "overflow-y-auto",
1945
- style: { height: Math.min(T.length, nn) * tn },
1946
- rowComponent: rn,
1950
+ style: { height: Math.min(T.length, rn) * nn },
1951
+ rowComponent: an,
1947
1952
  rowCount: T.length,
1948
- rowHeight: tn,
1953
+ rowHeight: nn,
1949
1954
  rowProps: {
1950
1955
  items: T,
1951
1956
  selectedDeploymentId: o,
@@ -1961,8 +1966,8 @@ var Q = {
1961
1966
  ]
1962
1967
  })
1963
1968
  });
1964
- }, on = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, menuStyles: i, isStreaming: a, isMobile: o, isDisabled: c = !1, style: u, modelPickerOverlay: d, isPickerOpen: f, onPickerToggle: p, onPickerOpenChange: h }) => {
1965
- let [g, b] = U(!1), { selectorIcon: x, selectorAriaLabel: C, selectedLabel: w, selectedVersion: T, menuItems: E, menuHeader: D, menuStyle: O, onOpenChange: k } = Lt({
1969
+ }, sn = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, menuStyles: i, nameClassName: a = "dial-small-text", versionClassName: o = "dial-tiny-text", isStreaming: u, isMobile: d, isDisabled: f = !1, style: p, modelPickerOverlay: h, isPickerOpen: g, onPickerToggle: b, onPickerOpenChange: x }) => {
1970
+ let [C, w] = H(!1), { selectorIcon: T, selectorAriaLabel: E, selectedLabel: D, selectedVersion: O, menuItems: k, menuHeader: ee, menuStyle: A, onOpenChange: te } = Rt({
1966
1971
  deployments: e,
1967
1972
  selectedDeploymentId: t,
1968
1973
  onDeploymentChange: n,
@@ -1970,446 +1975,448 @@ var Q = {
1970
1975
  styles: i
1971
1976
  });
1972
1977
  if (!e) return null;
1973
- let A = a || c, j = A ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0, M = /* @__PURE__ */ L(ve, {
1978
+ let j = u || f, ne = j ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0, M = /* @__PURE__ */ I(ye, {
1974
1979
  size: _.SM,
1975
- className: l(q.modelSelectorCaret, W.modelSelectorCaret),
1980
+ className: l(K.modelSelectorCaret, U.modelSelectorCaret),
1976
1981
  "aria-hidden": !0,
1977
1982
  stroke: v
1978
- }), N = /* @__PURE__ */ L("span", {
1979
- className: l("flex shrink-0 items-center", W.modelSelectorIcon),
1980
- children: x
1983
+ }), re = /* @__PURE__ */ I("span", {
1984
+ className: l("flex shrink-0 items-center", U.modelSelectorIcon),
1985
+ children: T
1981
1986
  });
1982
- if (o) return /* @__PURE__ */ R(I, { children: [/* @__PURE__ */ L(S, {
1983
- tooltipProps: { tooltip: w },
1984
- icon: /* @__PURE__ */ R("div", {
1987
+ if (d) return /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I(S, {
1988
+ tooltipProps: { tooltip: D },
1989
+ icon: /* @__PURE__ */ L("div", {
1985
1990
  className: "flex items-center gap-1",
1986
- children: [N, M]
1991
+ children: [re, M]
1987
1992
  }),
1988
- "aria-label": C,
1989
- "aria-disabled": A || void 0,
1993
+ "aria-label": E,
1994
+ "aria-disabled": j || void 0,
1990
1995
  onClick: () => {
1991
- A || b(!0);
1996
+ j || w(!0);
1992
1997
  },
1993
- className: l("w-[50px]", q.modelSelectorButton, j, W.modelSelectorButton)
1994
- }), d ? /* @__PURE__ */ L(Pe, {
1995
- isOpen: g,
1998
+ className: l("w-[50px]", K.modelSelectorButton, ne, U.modelSelectorButton)
1999
+ }), h ? /* @__PURE__ */ I(Fe, {
2000
+ isOpen: C,
1996
2001
  title: r?.ariaLabel ?? "Select model",
1997
2002
  closeLabel: r?.closeLabel ?? "Close",
1998
- onClose: () => b(!1),
1999
- style: u,
2000
- className: l(i?.className, W.modelMenu),
2001
- children: d(() => b(!1))
2002
- }) : /* @__PURE__ */ L(an, {
2003
- isOpen: g,
2003
+ onClose: () => w(!1),
2004
+ style: p,
2005
+ className: l(i?.className, U.modelMenu),
2006
+ children: h(() => w(!1))
2007
+ }) : /* @__PURE__ */ I(on, {
2008
+ isOpen: C,
2004
2009
  title: r?.ariaLabel ?? "Select model",
2005
2010
  closeLabel: r?.closeLabel ?? "Close",
2006
2011
  searchPlaceholder: r?.searchPlaceholder ?? "Search",
2007
- onClose: () => b(!1),
2012
+ onClose: () => w(!1),
2008
2013
  deployments: e,
2009
2014
  selectedDeploymentId: t,
2010
2015
  onSelect: (e) => n?.(e),
2011
2016
  loadingLabel: r?.loading,
2012
2017
  errorLabel: r?.error,
2013
2018
  emptyLabel: r?.empty,
2014
- style: u,
2019
+ style: p,
2015
2020
  menuStyles: i
2016
2021
  })] });
2017
- if (d) {
2018
- let e = T ? `${w} · ${T}` : w;
2019
- return /* @__PURE__ */ L(y, {
2022
+ if (h) {
2023
+ let e = O ? `${D} · ${O}` : D;
2024
+ return /* @__PURE__ */ I(y, {
2020
2025
  placement: "top-end",
2021
2026
  matchReferenceWidth: !1,
2022
- open: f,
2023
- onOpenChange: h,
2027
+ open: g,
2028
+ onOpenChange: x,
2024
2029
  trigger: [],
2025
2030
  outsideClosable: !0,
2026
- renderOverlay: () => d(() => h?.(!1)),
2027
- listClassName: l("!w-[368px] !bg-layer-raised", i?.className, W.modelMenu),
2028
- children: /* @__PURE__ */ L(m, {
2029
- "aria-label": C,
2030
- "aria-disabled": A || void 0,
2031
+ renderOverlay: () => h(() => x?.(!1)),
2032
+ listClassName: l("w-[368px]!", K.modelOverlayPanel, i?.className, U.modelMenu),
2033
+ listStyle: c({ "--ci-model-overlay-bg": i?.colors?.overlayBackground }),
2034
+ children: /* @__PURE__ */ I(m, {
2035
+ "aria-label": E,
2036
+ "aria-disabled": j || void 0,
2031
2037
  tooltipProps: { tooltip: e },
2032
- className: l("h-auto min-w-0 gap-1.5 !rounded-full !border-0 px-0 py-1.5 ps-1.5 pe-2", q.modelSelectorButton, j, A && q.modelSelectorButtonDisabled, W.modelSelectorButton),
2038
+ className: l("h-auto min-w-0 gap-1.5 rounded-full! border-0! px-0 py-1.5 ps-1.5 pe-2", K.modelSelectorButton, ne, j && K.modelSelectorButtonDisabled, U.modelSelectorButton),
2033
2039
  onClick: () => {
2034
- A || p?.();
2040
+ j || b?.();
2035
2041
  },
2036
- iconBefore: N,
2042
+ iconBefore: re,
2037
2043
  iconAfter: M,
2038
2044
  textClassName: "min-w-0",
2039
- label: /* @__PURE__ */ R("span", {
2045
+ label: /* @__PURE__ */ L("span", {
2040
2046
  className: "flex max-w-[180px] min-w-0 items-baseline gap-1",
2041
- children: [/* @__PURE__ */ L("span", {
2042
- className: l("dial-small-text max-w-[180px] shrink-0 truncate", q.modelSelectorName),
2043
- children: w
2044
- }), T && /* @__PURE__ */ L("span", {
2045
- className: l("dial-tiny-text min-w-0 truncate", q.modelSelectorVersion),
2046
- children: T
2047
+ children: [/* @__PURE__ */ I("span", {
2048
+ className: l("max-w-[180px] shrink-0 truncate", a, K.modelSelectorName),
2049
+ children: D
2050
+ }), O && /* @__PURE__ */ I("span", {
2051
+ className: l("min-w-0 truncate", o, K.modelSelectorVersion),
2052
+ children: O
2047
2053
  })]
2048
2054
  })
2049
2055
  })
2050
2056
  });
2051
2057
  }
2052
- return /* @__PURE__ */ L("div", {
2053
- className: l(j),
2054
- "aria-disabled": A || void 0,
2055
- children: /* @__PURE__ */ L(y, {
2056
- items: E,
2057
- menuHeader: D,
2058
+ return /* @__PURE__ */ I("div", {
2059
+ className: l(ne),
2060
+ "aria-disabled": j || void 0,
2061
+ children: /* @__PURE__ */ I(y, {
2062
+ items: k,
2063
+ menuHeader: ee,
2058
2064
  placement: "bottom-end",
2059
2065
  matchReferenceWidth: !1,
2060
2066
  maxDropdownHeight: s,
2061
- listClassName: l("!w-[240px]", i?.className, W.modelMenu),
2062
- listStyle: O,
2063
- disabled: A,
2064
- onOpenChange: A ? void 0 : k,
2065
- children: /* @__PURE__ */ L(m, {
2066
- "aria-label": C,
2067
- "aria-disabled": A || void 0,
2068
- tooltipProps: { tooltip: w },
2069
- iconBefore: N,
2067
+ listClassName: l("w-[240px]!", i?.className, U.modelMenu),
2068
+ listStyle: A,
2069
+ disabled: j,
2070
+ onOpenChange: j ? void 0 : te,
2071
+ children: /* @__PURE__ */ I(m, {
2072
+ "aria-label": E,
2073
+ "aria-disabled": j || void 0,
2074
+ tooltipProps: { tooltip: D },
2075
+ iconBefore: re,
2070
2076
  iconAfter: M,
2071
- className: l("h-auto gap-1 !rounded-full !border-0 p-1.5", q.modelSelectorButton, A && q.modelSelectorButtonDisabled, W.modelSelectorButton)
2077
+ className: l("h-auto gap-1 rounded-full! border-0! p-1.5", K.modelSelectorButton, j && K.modelSelectorButtonDisabled, U.modelSelectorButton)
2072
2078
  })
2073
2079
  })
2074
2080
  });
2075
- }, sn = ke(({ message: e = "", messageRevision: t, focusRequestId: n, textInsertion: r, onSend: i, onUploadAttachment: a, onStop: o, isStreaming: s = !1, onChange: u, onAttachmentsChange: p, placeholder: m = "Type a message...", ariaLabel: h, attachLabel: g = "Attach file", fileAccept: b, addMenuTitle: C = "Add", menuTitle: D = "Menu", menuCloseLabel: O = "Close", removeLabel: k, retryLabel: A, uploadingLabel: j, expandLabel: M, clickLabel: N, sendLabel: ee, sendTooltip: te, emptyMessageTooltip: ne, stopLabel: re, micLabel: ie = "Dictate", recordVoiceLabel: ae = "Record voice", stopRecordingLabel: P, discardRecordingLabel: oe, colors: F, typography: se, attachmentTray: ce, modelMenu: le, className: ue, pendingDropFiles: de = [], onDropFilesConsumed: pe, pendingAttachments: me = [], onPendingAttachmentsConsumed: ge, pasteTextThreshold: _e = 4e3, maxMessageLength: ve = 5e4, deployments: ye, selectedDeploymentId: Se, onDeploymentChange: Ce, modelSelectorLabels: we, initialAttachments: Te = [], hideAddButton: Ee = !1, hideAttachFile: De = !1, hideActionBar: Oe = !1, actionRowLayout: ke = ct.Stacked, isInlineActionRowAllowedBelowDesktop: Ae = !1, renderFooterActions: je, isInputDisabled: G = !1, isModelSelectorDisabled: Pe = !1, isSendDisabled: Fe = !1, isAudioMessageSupported: Le = !1, isVoiceRecordingSupported: Re = Le, onTranscribeAudio: ze, transcribingLabel: Be, voiceErrorLabel: Ue, sendOnEnter: We = st.Enter, prefixAttachments: qe = [], onRemovePrefixAttachment: Je, chatSettings: Qe, toolsMenuItems: nt, onToolToggle: rt, canRemoveTools: it = !0, toolsMenuTitle: at, toolsBackLabel: lt, toolsChipLabels: ut, menuOverlays: dt, activeMentions: ft, onBackspaceAtCaret: pt, caretPositionOverride: mt, commandMenu: K, autoFocus: ht = !1, messageHistory: gt, onDialFileSystemClick: _t, dialFileSystemLabel: vt, validateAttachment: bt, onAttachmentClick: xt, modelPickerOverlay: Ct, maximumAttachmentsAmount: wt, onAttachmentsLimitExceeded: Tt, isAttachmentsEnabled: Et = !0, isTextAttachmentsAllowed: At = !0, usageLimitsSlot: jt, onMessageTooLong: Mt }, Nt) => {
2076
- let Pt = d(), [Ft, It] = U(!1), Lt = Ge(gt), Rt = ft ?? [], zt = Rt.length > 0, Bt = V(() => c({
2077
- "--ci-bg": F?.background,
2078
- "--ci-text": F?.text,
2079
- "--ci-border": F?.border,
2080
- "--ci-border-focus": F?.borderFocus,
2081
- "--ci-placeholder": F?.placeholder,
2082
- "--ci-text-disabled": F?.textDisabled,
2083
- "--ci-model-selector-caret-color": F?.modelSelectorCaret,
2084
- "--ci-model-selector-hover-bg": F?.modelSelectorHoverBg,
2085
- "--ci-model-selector-disabled-color": F?.modelSelectorDisabled,
2086
- "--ci-model-selector-name-color": F?.modelSelectorName,
2087
- "--ci-model-selector-version-color": F?.modelSelectorVersion,
2088
- "--ci-voice-waveform": F?.voiceWaveform,
2089
- "--ci-voice-accent": F?.voiceAccent,
2090
- "--ci-mention-highlight-bg": F?.mentionHighlightBg,
2091
- "--ci-mention-highlight-text": F?.mentionHighlightText,
2092
- "--ci-mention-highlight-unsupported-bg": F?.mentionHighlightUnsupportedBg,
2093
- "--ci-mention-highlight-unsupported-text": F?.mentionHighlightUnsupportedText
2094
- }), [F]), Vt = V(() => _t ? [{
2081
+ }, cn = Ae(({ message: e = "", messageRevision: t, focusRequestId: n, textInsertion: r, onSend: i, onUploadAttachment: a, onStop: o, isStreaming: s = !1, onChange: u, onAttachmentsChange: p, placeholder: m = "Type a message...", ariaLabel: h, attachLabel: g = "Attach file", fileAccept: b, addMenuTitle: C = "Add", menuTitle: D = "Menu", menuCloseLabel: O = "Close", removeLabel: k, retryLabel: ee, uploadingLabel: A, expandLabel: te, clickLabel: j, sendLabel: ne, sendTooltip: M, emptyMessageTooltip: re, stopLabel: ie, micLabel: ae = "Dictate", recordVoiceLabel: oe = "Record voice", stopRecordingLabel: N, discardRecordingLabel: se, colors: P, typography: ce, attachmentTray: le, modelMenu: ue, className: de, pendingDropFiles: fe = [], onDropFilesConsumed: me, pendingAttachments: he = [], onPendingAttachmentsConsumed: _e, pasteTextThreshold: ve = 4e3, maxMessageLength: ye = 5e4, deployments: be, selectedDeploymentId: Ce, onDeploymentChange: we, modelSelectorLabels: Te, initialAttachments: Ee = [], hideAddButton: De = !1, hideAttachFile: Oe = !1, hideActionBar: ke = !1, actionRowLayout: Ae = lt.Stacked, isInlineActionRowAllowedBelowDesktop: je = !1, renderFooterActions: Me, isInputDisabled: W = !1, isModelSelectorDisabled: Fe = !1, isSendDisabled: Ie = !1, isAudioMessageSupported: Re = !1, isVoiceRecordingSupported: ze = Re, onTranscribeAudio: Be, transcribingLabel: Ve, voiceErrorLabel: We, sendOnEnter: Ge = ct.Enter, prefixAttachments: Je = [], onRemovePrefixAttachment: Ye, chatSettings: $e, toolsMenuItems: rt, onToolToggle: it, canRemoveTools: at = !0, toolsMenuTitle: ot, toolsBackLabel: ut, toolsChipLabels: dt, menuOverlays: ft, activeMentions: pt, onBackspaceAtCaret: mt, caretPositionOverride: ht, commandMenu: G, autoFocus: gt = !1, messageHistory: _t, onDialFileSystemClick: vt, dialFileSystemLabel: yt, validateAttachment: xt, onAttachmentClick: St, modelPickerOverlay: wt, maximumAttachmentsAmount: Tt, onAttachmentsLimitExceeded: Et, isAttachmentsEnabled: Dt = !0, isTextAttachmentsAllowed: jt = !0, usageLimitsSlot: Mt, onMessageTooLong: Nt }, Pt) => {
2082
+ let Ft = d(), [It, Lt] = H(!1), Rt = Ke(_t), zt = pt ?? [], Bt = zt.length > 0, Vt = B(() => c({
2083
+ "--ci-bg": P?.background,
2084
+ "--ci-text": P?.text,
2085
+ "--ci-border": P?.border,
2086
+ "--ci-border-focus": P?.borderFocus,
2087
+ "--ci-placeholder": P?.placeholder,
2088
+ "--ci-text-disabled": P?.textDisabled,
2089
+ "--ci-model-selector-caret-color": P?.modelSelectorCaret,
2090
+ "--ci-model-selector-hover-bg": P?.modelSelectorHoverBg,
2091
+ "--ci-model-selector-disabled-color": P?.modelSelectorDisabled,
2092
+ "--ci-model-selector-name-color": P?.modelSelectorName,
2093
+ "--ci-model-selector-version-color": P?.modelSelectorVersion,
2094
+ "--ci-voice-waveform": P?.voiceWaveform,
2095
+ "--ci-voice-accent": P?.voiceAccent,
2096
+ "--ci-mention-highlight-bg": P?.mentionHighlightBg,
2097
+ "--ci-mention-highlight-text": P?.mentionHighlightText,
2098
+ "--ci-mention-highlight-unsupported-bg": P?.mentionHighlightUnsupportedBg,
2099
+ "--ci-mention-highlight-unsupported-text": P?.mentionHighlightUnsupportedText,
2100
+ "--ci-selection-highlight-bg": P?.selectionHighlightBg
2101
+ }), [P]), Ht = B(() => vt ? [{
2095
2102
  key: "dial-fs",
2096
- label: vt ?? "DIAL file system",
2097
- icon: /* @__PURE__ */ L(be, {
2103
+ label: yt ?? "DIAL file system",
2104
+ icon: /* @__PURE__ */ I(xe, {
2098
2105
  size: f,
2099
2106
  "aria-hidden": !0,
2100
2107
  stroke: v
2101
2108
  }),
2102
- onClick: _t
2103
- }] : [], [_t, vt]), { message: J, setMessage: Y, textareaRef: X } = Xe({
2109
+ onClick: vt
2110
+ }] : [], [vt, yt]), { message: q, setMessage: J, textareaRef: Y } = Ze({
2104
2111
  messageProp: e,
2105
2112
  messageRevision: t
2106
2113
  });
2107
- B(() => {
2108
- let e = X.current;
2114
+ z(() => {
2115
+ let e = Y.current;
2109
2116
  e != null && e.value.length !== 0 && document.activeElement === e && e.setSelectionRange(e.value.length, e.value.length);
2110
- }, [X]), B(() => {
2111
- n !== void 0 && X.current?.focus();
2112
- }, [n, X]), Me(Nt, () => ({ getCaretPosition: () => X.current?.selectionStart ?? J.length }), [J, X]);
2113
- let { handleUndoKeyDown: Ht, markCaretPlaced: Ut } = $e({
2117
+ }, [Y]), z(() => {
2118
+ n !== void 0 && Y.current?.focus();
2119
+ }, [n, Y]), Ne(Pt, () => ({ getCaretPosition: () => Y.current?.selectionStart ?? q.length }), [q, Y]);
2120
+ let { handleUndoKeyDown: Ut, markCaretPlaced: Wt } = et({
2114
2121
  insertion: r,
2115
- textareaRef: X
2116
- }), { isMenuOpen: Wt, query: Gt, activeWordStart: Z, dismiss: Kt, closeOnOutsidePress: qt, handleCaretMove: Jt, handleValueChange: Yt, listboxId: Xt, overlayRef: Zt, activeOptionId: Qt, moveActiveOption: $t, getActiveOption: en } = He({
2117
- config: K,
2118
- message: J
2119
- }), Q = H(Jt);
2120
- Q.current = Jt;
2121
- let tn = () => {
2122
- Jt(X.current?.selectionStart ?? J.length);
2123
- }, nn = H(!1), rn = () => {
2124
- nn.current ? nn.current = !1 : requestAnimationFrame(() => {
2125
- let e = X.current;
2126
- Q.current(e?.selectionStart ?? e?.value.length ?? 0);
2122
+ textareaRef: Y
2123
+ }), { isMenuOpen: Gt, query: Kt, activeWordStart: X, dismiss: qt, closeOnOutsidePress: Jt, handleCaretMove: Yt, handleValueChange: Xt, listboxId: Zt, overlayRef: Qt, activeOptionId: $t, moveActiveOption: en, getActiveOption: tn } = Ue({
2124
+ config: G,
2125
+ message: q
2126
+ }), Z = V(Yt);
2127
+ Z.current = Yt;
2128
+ let nn = () => {
2129
+ Yt(Y.current?.selectionStart ?? q.length);
2130
+ }, rn = V(!1), an = () => {
2131
+ rn.current ? rn.current = !1 : requestAnimationFrame(() => {
2132
+ let e = Y.current;
2133
+ Z.current(e?.selectionStart ?? e?.value.length ?? 0);
2127
2134
  });
2128
- }, an = (e) => {
2129
- (e.key === "ArrowLeft" || e.key === "ArrowRight" || e.key === "Home" || e.key === "End" || e.key === "PageUp" || e.key === "PageDown") && Jt(e.currentTarget.selectionStart ?? J.length);
2130
- }, sn = K?.emptyQueryHint != null, cn = K != null && Z != null ? Z + K.triggerPrefix.length : null, ln = cn != null && J.slice(cn).split("\n", 1)[0] !== "", un = sn && Wt && Gt === "" && cn != null && !ln, $ = K != null && Wt ? Z ?? 0 : null, dn = H(null), fn = H(null), [pn, mn] = U(null), hn = z(() => {
2131
- let e = dn.current, t = fn.current;
2135
+ }, on = (e) => {
2136
+ (e.key === "ArrowLeft" || e.key === "ArrowRight" || e.key === "Home" || e.key === "End" || e.key === "PageUp" || e.key === "PageDown") && Yt(e.currentTarget.selectionStart ?? q.length);
2137
+ }, cn = G?.emptyQueryHint != null, ln = G != null && X != null ? X + G.triggerPrefix.length : null, un = ln != null && q.slice(ln).split("\n", 1)[0] !== "", dn = cn && Gt && Kt === "" && ln != null && !un, Q = G != null && Gt ? X ?? 0 : null, fn = V(null), pn = V(null), [mn, hn] = H(null), gn = R(() => {
2138
+ let e = fn.current, t = pn.current;
2132
2139
  if (e == null || t == null) {
2133
- mn(null);
2140
+ hn(null);
2134
2141
  return;
2135
2142
  }
2136
2143
  let n = e.getBoundingClientRect(), r = t.getBoundingClientRect();
2137
- mn({
2144
+ hn({
2138
2145
  left: n.left - r.left,
2139
2146
  top: n.top - r.top
2140
2147
  });
2141
2148
  }, []);
2142
- B(() => {
2143
- if ($ == null) return;
2144
- let e = X.current;
2149
+ z(() => {
2150
+ if (Q == null) return;
2151
+ let e = Y.current;
2145
2152
  if (e == null || typeof ResizeObserver > "u") return;
2146
- let t = new ResizeObserver(hn);
2153
+ let t = new ResizeObserver(gn);
2147
2154
  return t.observe(e), () => t.disconnect();
2148
2155
  }, [
2149
- $,
2150
- X,
2151
- hn
2156
+ Q,
2157
+ Y,
2158
+ gn
2152
2159
  ]);
2153
- let gn = z((e) => {
2154
- if (K == null || (Kt(), !e?.consumeQuery) || (e.returnFocus !== !1 && X.current?.focus(), Z == null)) return;
2155
- let t = `${K.triggerPrefix}${Gt}`, n = Z + t.length;
2156
- if (J.slice(Z, n) !== t) return;
2157
- let r = J.slice(0, Z) + J.slice(n);
2158
- Y(r), Lt.notifyChange(), u?.(r);
2160
+ let _n = R((e) => {
2161
+ if (G == null || (qt(), !e?.consumeQuery) || (e.returnFocus !== !1 && Y.current?.focus(), X == null)) return;
2162
+ let t = `${G.triggerPrefix}${Kt}`, n = X + t.length;
2163
+ if (q.slice(X, n) !== t) return;
2164
+ let r = q.slice(0, X) + q.slice(n);
2165
+ J(r), Rt.notifyChange(), u?.(r);
2159
2166
  }, [
2160
- K,
2167
+ G,
2168
+ qt,
2161
2169
  Kt,
2162
- Gt,
2170
+ q,
2171
+ X,
2163
2172
  J,
2164
- Z,
2165
- Y,
2166
- Lt,
2173
+ Rt,
2167
2174
  u,
2168
- X
2169
- ]), _n = H(void 0);
2170
- B(() => {
2171
- mt != null && _n.current !== t && (_n.current = t, X.current?.setSelectionRange(mt, mt), Ut(), Jt(mt));
2172
- }, [J]);
2173
- let vn = H(J);
2174
- vn.current = J;
2175
- let { attachments: yn, buildAttachments: bn, addAttachments: xn, resetAttachments: Sn, handleRemove: Cn, handleRetry: wn, handleExpand: Tn, hasBlockedAttachments: En } = Ie({
2176
- initialAttachments: Te,
2175
+ Y
2176
+ ]), vn = V(void 0);
2177
+ z(() => {
2178
+ ht != null && vn.current !== t && (vn.current = t, Y.current?.setSelectionRange(ht, ht), Wt(), Yt(ht));
2179
+ }, [q]);
2180
+ let yn = V(q);
2181
+ yn.current = q;
2182
+ let { attachments: bn, buildAttachments: xn, addAttachments: Sn, resetAttachments: Cn, handleRemove: wn, handleRetry: Tn, handleExpand: En, hasBlockedAttachments: Dn } = Le({
2183
+ initialAttachments: Ee,
2177
2184
  onUploadAttachment: a,
2178
2185
  onAttachmentsChange: p,
2179
- validateAttachment: bt,
2180
- pendingDropFiles: de,
2181
- onDropFilesConsumed: pe,
2182
- isDropDisabled: G,
2183
- pendingAttachments: me,
2184
- onPendingAttachmentsConsumed: ge,
2185
- onExpandPastedText: z((e) => {
2186
- let t = vn.current, n = t ? `${t}\n${e}` : e;
2187
- vn.current = n, Y(n), u?.(n);
2188
- }, [Y, u]),
2189
- maximumAttachmentsAmount: wt,
2190
- baseAttachmentsAmount: qe.length,
2191
- onAttachmentsLimitExceeded: Tt
2192
- }), Dn = z((e) => {
2193
- xn(bn([e]));
2194
- }, [xn, bn]), On = H(!1), [kn, An] = U({
2186
+ validateAttachment: xt,
2187
+ pendingDropFiles: fe,
2188
+ onDropFilesConsumed: me,
2189
+ isDropDisabled: W,
2190
+ pendingAttachments: he,
2191
+ onPendingAttachmentsConsumed: _e,
2192
+ onExpandPastedText: R((e) => {
2193
+ let t = yn.current, n = t ? `${t}\n${e}` : e;
2194
+ yn.current = n, J(n), u?.(n);
2195
+ }, [J, u]),
2196
+ maximumAttachmentsAmount: Tt,
2197
+ baseAttachmentsAmount: Je.length,
2198
+ onAttachmentsLimitExceeded: Et
2199
+ }), On = R((e) => {
2200
+ Sn(xn([e]));
2201
+ }, [Sn, xn]), kn = V(!1), [An, jn] = H({
2195
2202
  text: "",
2196
2203
  revision: 0
2197
- }), { state: jn, analyserNodeRef: Mn, errorMessage: Nn, startRecording: Pn, stopRecording: Fn, discardRecording: In } = ot({
2198
- onAttachAudio: Dn,
2199
- onTranscribeAudio: ze,
2200
- onTranscript: z((e) => {
2204
+ }), { state: Mn, analyserNodeRef: Nn, errorMessage: Pn, startRecording: Fn, stopRecording: In, discardRecording: Ln } = st({
2205
+ onAttachAudio: On,
2206
+ onTranscribeAudio: Be,
2207
+ onTranscript: R((e) => {
2201
2208
  let t = e.trim();
2202
2209
  if (t) {
2203
- let e = vn.current, n = `${e}${e && !/\s$/.test(e) ? " " : ""}${t}`;
2204
- vn.current = n, Y(n), An((e) => ({
2210
+ let e = yn.current, n = `${e}${e && !/\s$/.test(e) ? " " : ""}${t}`;
2211
+ yn.current = n, J(n), jn((e) => ({
2205
2212
  text: t,
2206
2213
  revision: e.revision + 1
2207
- })), Lt.notifyChange(), u?.(n);
2214
+ })), Rt.notifyChange(), u?.(n);
2208
2215
  }
2209
- On.current = !0;
2216
+ kn.current = !0;
2210
2217
  }, [
2211
- Y,
2212
- Lt,
2218
+ J,
2219
+ Rt,
2213
2220
  u
2214
2221
  ]),
2215
- errorLabel: Ue
2216
- }), Ln = jn === et.Recording || jn === et.Processing;
2217
- B(() => {
2218
- if (jn === et.Error || jn === et.Idle && On.current) {
2219
- On.current = !1;
2220
- let e = X.current;
2222
+ errorLabel: We
2223
+ }), $ = Mn === tt.Recording || Mn === tt.Processing;
2224
+ z(() => {
2225
+ if (Mn === tt.Error || Mn === tt.Idle && kn.current) {
2226
+ kn.current = !1;
2227
+ let e = Y.current;
2221
2228
  if (e != null) {
2222
- nn.current = document.activeElement !== e, e.focus();
2229
+ rn.current = document.activeElement !== e, e.focus();
2223
2230
  let t = e.value.length;
2224
2231
  e.setSelectionRange(t, t);
2225
2232
  }
2226
2233
  }
2227
- }, [jn, X]);
2228
- let Rn = H(null), zn = H(null), Bn = Et && At, { handlePaste: Vn } = he(xn, Bn ? _e : Infinity), Hn = z((e) => {
2234
+ }, [Mn, Y]);
2235
+ let Rn = V(null), zn = V(null), Bn = Dt && jt, { handlePaste: Vn } = ge(Sn, Bn ? ve : Infinity), Hn = R((e) => {
2229
2236
  if (!Bn) {
2230
2237
  let t = e.clipboardData.getData("text/plain");
2231
- t.length >= ve && Mt?.(t.length, ve);
2238
+ t.length >= ye && Nt?.(t.length, ye);
2232
2239
  }
2233
2240
  if (Vn(e), e.defaultPrevented) return;
2234
2241
  let t = e.clipboardData.getData("text/plain").replace(/\r\n?/g, "\n");
2235
- t !== "" && K?.onTextPaste?.(t);
2242
+ t !== "" && G?.onTextPaste?.(t);
2236
2243
  }, [
2237
2244
  Bn,
2238
- ve,
2239
- Mt,
2245
+ ye,
2246
+ Nt,
2240
2247
  Vn,
2241
- K
2242
- ]), Un = J.trim().length > 0 || yn.length > 0, Wn = Un && !En && !Fe && !Ln, [Gn, Kn] = U([]), qn = (nt ?? []).map((e) => e.id).join("|");
2243
- B(() => {
2248
+ G
2249
+ ]), Un = q.trim().length > 0 || bn.length > 0, Wn = Un && !Dn && !Ie && !$, [Gn, Kn] = H([]), qn = (rt ?? []).map((e) => e.id).join("|");
2250
+ z(() => {
2244
2251
  Kn([]);
2245
2252
  }, [qn]);
2246
- let Jn = V(() => {
2247
- let e = nt ?? [];
2248
- return it ? e.filter((e) => e.isSelected || !Gn.includes(e.id)) : e;
2253
+ let Jn = B(() => {
2254
+ let e = rt ?? [];
2255
+ return at ? e.filter((e) => e.isSelected || !Gn.includes(e.id)) : e;
2249
2256
  }, [
2250
- nt,
2257
+ rt,
2251
2258
  Gn,
2252
- it
2253
- ]), Yn = z((e) => {
2254
- Kn((t) => t.includes(e) ? t : [...t, e]), nt?.find((t) => t.id === e)?.isSelected && rt?.(e);
2255
- }, [nt, rt]), Xn = ye === void 0 || Se != null, Zn = Le && !s, Qn = async () => {
2256
- if (Fe || Ln) return;
2257
- if (J.length >= ve) {
2258
- Mt?.(J.length, ve);
2259
+ at
2260
+ ]), Yn = R((e) => {
2261
+ Kn((t) => t.includes(e) ? t : [...t, e]), rt?.find((t) => t.id === e)?.isSelected && it?.(e);
2262
+ }, [rt, it]), Xn = be === void 0 || Ce != null, Zn = Re && !s, Qn = async () => {
2263
+ if (Ie || $) return;
2264
+ if (q.length >= ye) {
2265
+ Nt?.(q.length, ye);
2259
2266
  return;
2260
2267
  }
2261
- let e = J, t = yn;
2262
- Y(""), Lt.reset();
2268
+ let e = q, t = bn;
2269
+ J(""), Rt.reset();
2263
2270
  try {
2264
2271
  await i?.(e, t), t.forEach((e) => {
2265
2272
  e.previewUrl && URL.revokeObjectURL(e.previewUrl), e.playUrl && URL.revokeObjectURL(e.playUrl);
2266
- }), Sn([]);
2273
+ }), Cn([]);
2267
2274
  } catch {
2268
- Y(e), Sn(t);
2275
+ J(e), Cn(t);
2269
2276
  }
2270
- }, $n = (e) => We === st.MetaEnter ? (e.metaKey || e.ctrlKey) && !e.shiftKey : !e.shiftKey && !e.metaKey && !e.ctrlKey, er = (e) => {
2271
- if (!Wt || e.nativeEvent.isComposing) return !1;
2272
- if (e.key === "Escape") return e.preventDefault(), e.stopPropagation(), Kt(), !0;
2273
- if (e.key === "ArrowDown" || e.key === "ArrowUp") return e.preventDefault(), $t(e.key === "ArrowDown" ? Ve.Next : Ve.Previous), !0;
2277
+ }, $n = (e) => Ge === ct.MetaEnter ? (e.metaKey || e.ctrlKey) && !e.shiftKey : !e.shiftKey && !e.metaKey && !e.ctrlKey, er = (e) => {
2278
+ if (!Gt || e.nativeEvent.isComposing) return !1;
2279
+ if (e.key === "Escape") return e.preventDefault(), e.stopPropagation(), qt(), !0;
2280
+ if (e.key === "ArrowDown" || e.key === "ArrowUp") return e.preventDefault(), en(e.key === "ArrowDown" ? He.Next : He.Previous), !0;
2274
2281
  if (e.key !== "Enter" || e.shiftKey) return !1;
2275
- let t = en();
2282
+ let t = tn();
2276
2283
  return t == null ? $n(e) ? (e.preventDefault(), !0) : !1 : (e.preventDefault(), t.click(), !0);
2277
2284
  }, tr = (e) => {
2278
- if (!Ln && !Ht(e) && !er(e)) {
2279
- if (!e.nativeEvent.isComposing && !G && !s) {
2285
+ if (!$ && !Ut(e) && !er(e)) {
2286
+ if (!e.nativeEvent.isComposing && !W && !s) {
2280
2287
  if (e.key === "ArrowUp" || e.key === "ArrowDown") {
2281
- let t = e.currentTarget.selectionStart ?? 0, n = Lt.navigate(e.key === "ArrowUp" ? "up" : "down", J, t);
2288
+ let t = e.currentTarget.selectionStart ?? 0, n = Rt.navigate(e.key === "ArrowUp" ? "up" : "down", q, t);
2282
2289
  if (n !== null) {
2283
- e.preventDefault(), Y(n);
2290
+ e.preventDefault(), J(n);
2284
2291
  return;
2285
2292
  }
2286
2293
  }
2287
- if (e.key === "Backspace" && pt != null && e.currentTarget.selectionStart === e.currentTarget.selectionEnd && e.currentTarget.selectionStart != null) {
2288
- let t = pt(e.currentTarget.selectionStart);
2294
+ if (e.key === "Backspace" && mt != null && e.currentTarget.selectionStart === e.currentTarget.selectionEnd && e.currentTarget.selectionStart != null) {
2295
+ let t = mt(e.currentTarget.selectionStart);
2289
2296
  if (t != null) {
2290
2297
  e.preventDefault();
2291
2298
  let n = e.currentTarget;
2292
- n.setSelectionRange(t.start, t.start + t.length), typeof document.execCommand == "function" && document.execCommand("delete", !1) || Ze(n, J.slice(0, t.start) + J.slice(t.start + t.length), t.start);
2299
+ n.setSelectionRange(t.start, t.start + t.length), typeof document.execCommand == "function" && document.execCommand("delete", !1) || Qe(n, q.slice(0, t.start) + q.slice(t.start + t.length), t.start);
2293
2300
  return;
2294
2301
  }
2295
2302
  }
2296
2303
  }
2297
- e.key === "Enter" && $n(e) && (e.preventDefault(), !s && Wn && Xn && !G && Qn());
2304
+ e.key === "Enter" && $n(e) && (e.preventDefault(), !s && Wn && Xn && !W && Qn());
2298
2305
  }
2299
2306
  }, nr = (e) => {
2300
2307
  let t = Array.from(e.target.files ?? []);
2301
2308
  if (t.length === 0) return;
2302
- let n = bn(t);
2303
- e.target.value = "", xn(n);
2304
- }, rr = V(() => {
2309
+ let n = xn(t);
2310
+ e.target.value = "", Sn(n);
2311
+ }, rr = B(() => {
2305
2312
  let e = [];
2306
- return $ != null && e.push({
2307
- offset: $,
2308
- node: /* @__PURE__ */ L("span", {
2309
- ref: dn,
2313
+ return Q != null && e.push({
2314
+ offset: Q,
2315
+ node: /* @__PURE__ */ I("span", {
2316
+ ref: fn,
2310
2317
  "aria-hidden": !0,
2311
2318
  className: "inline-block h-lh w-0 align-text-top"
2312
2319
  }, "caret-marker")
2313
- }), un && K != null && cn != null && e.push({
2314
- offset: cn,
2315
- node: /* @__PURE__ */ L("span", {
2316
- className: q.commandHint,
2320
+ }), dn && G != null && ln != null && e.push({
2321
+ offset: ln,
2322
+ node: /* @__PURE__ */ I("span", {
2323
+ className: K.commandHint,
2317
2324
  "aria-hidden": !0,
2318
2325
  "data-mirror-synthetic": !0,
2319
- children: K.emptyQueryHint
2326
+ children: G.emptyQueryHint
2320
2327
  }, "command-hint")
2321
2328
  }), e;
2322
2329
  }, [
2323
- $,
2324
- un,
2325
- K,
2326
- cn
2327
- ]), ir = zt || rr.length > 0, { mirrorRef: ar, selectionRects: or, updateSelectionRects: sr, syncMirrorToTextarea: cr } = Ye({
2328
- textareaRef: X,
2329
- message: J,
2330
+ Q,
2331
+ dn,
2332
+ G,
2333
+ ln
2334
+ ]), ir = Bt || rr.length > 0, { mirrorRef: ar, selectionRects: or, updateSelectionRects: sr, syncMirrorToTextarea: cr } = Xe({
2335
+ textareaRef: Y,
2336
+ message: q,
2330
2337
  isMirrorActive: ir
2331
2338
  });
2332
- Ne(() => {
2333
- hn();
2339
+ Pe(() => {
2340
+ gn();
2334
2341
  }, [
2335
- hn,
2336
- $,
2337
- J
2342
+ gn,
2343
+ Q,
2344
+ q
2338
2345
  ]);
2339
- let lr = /* @__PURE__ */ L("textarea", {
2340
- className: l(q.textarea, ir && q.textareaMentionMode, se?.fontClassName || "dial-body-paragraph-text", "relative z-0 [field-sizing:content] max-h-[272px] w-full resize-none overflow-y-auto border-0 bg-transparent ps-1 pe-1 outline-hidden", "disabled:cursor-not-allowed"),
2341
- ref: X,
2342
- autoFocus: ht,
2343
- value: J,
2346
+ let lr = /* @__PURE__ */ I("textarea", {
2347
+ className: l(K.textarea, ir && K.textareaMentionMode, ce?.fontClassName || "dial-body-paragraph-text", "relative z-0 field-sizing-content max-h-[272px] w-full resize-none overflow-y-auto border-0 bg-transparent ps-1 pe-1 outline-hidden", "disabled:cursor-not-allowed"),
2348
+ ref: Y,
2349
+ autoFocus: gt,
2350
+ value: q,
2344
2351
  onChange: (e) => {
2345
- Y(e.target.value), Lt.notifyChange();
2352
+ J(e.target.value), Rt.notifyChange();
2346
2353
  let t = e.nativeEvent instanceof InputEvent ? e.nativeEvent : void 0;
2347
- Yt(e.target.value, e.target.selectionStart ?? e.target.value.length, t?.isComposing ?? !1), u?.(e.target.value);
2354
+ Xt(e.target.value, e.target.selectionStart ?? e.target.value.length, t?.isComposing ?? !1), u?.(e.target.value);
2348
2355
  },
2349
2356
  onSelect: sr,
2350
2357
  onScroll: () => {
2351
- cr(), $ != null && hn();
2358
+ cr(), Q != null && gn();
2352
2359
  },
2353
- onFocus: rn,
2354
- onClick: tn,
2360
+ onFocus: an,
2361
+ onClick: nn,
2355
2362
  onKeyDown: tr,
2356
- onKeyUp: an,
2363
+ onKeyUp: on,
2357
2364
  onPaste: Hn,
2358
2365
  placeholder: m,
2359
2366
  "aria-label": h,
2360
- "aria-autocomplete": K == null ? void 0 : "list",
2361
- "aria-controls": Wt ? Xt : void 0,
2362
- "aria-activedescendant": Qt ?? void 0,
2363
- "aria-hidden": zt ? !0 : void 0,
2364
- disabled: G,
2365
- readOnly: Ln,
2367
+ "aria-autocomplete": G == null ? void 0 : "list",
2368
+ "aria-controls": Gt ? Zt : void 0,
2369
+ "aria-activedescendant": $t ?? void 0,
2370
+ "aria-hidden": Bt ? !0 : void 0,
2371
+ disabled: W,
2372
+ readOnly: $,
2366
2373
  rows: 1
2367
- }), ur = /* @__PURE__ */ R(I, { children: [lr, K != null && /* @__PURE__ */ L("div", {
2374
+ }), ur = /* @__PURE__ */ L(F, { children: [lr, G != null && /* @__PURE__ */ I("div", {
2368
2375
  "aria-hidden": !0,
2369
- className: l("pointer-events-none absolute", se?.fontClassName || "dial-body-paragraph-text"),
2376
+ className: l("pointer-events-none absolute", ce?.fontClassName || "dial-body-paragraph-text"),
2370
2377
  style: {
2371
- left: pn?.left ?? 0,
2372
- top: pn?.top ?? 0
2378
+ left: mn?.left ?? 0,
2379
+ top: mn?.top ?? 0
2373
2380
  },
2374
- children: /* @__PURE__ */ L(y, {
2375
- open: Wt,
2381
+ children: /* @__PURE__ */ I(y, {
2382
+ open: Gt,
2376
2383
  onOpenChange: (e) => {
2377
- e || qt();
2384
+ e || Jt();
2378
2385
  },
2379
2386
  placement: "top-start",
2380
2387
  trigger: [],
2381
2388
  initialFocus: -1,
2382
2389
  matchReferenceWidth: !1,
2383
- outsidePressIgnoreRef: X,
2390
+ outsidePressIgnoreRef: Y,
2384
2391
  renderOverlay: () => {
2385
- let e = K.menuLabel != null;
2386
- return /* @__PURE__ */ L("div", {
2387
- ref: Zt,
2392
+ let e = G.menuLabel != null;
2393
+ return /* @__PURE__ */ I("div", {
2394
+ ref: Qt,
2388
2395
  role: e ? "group" : void 0,
2389
- "aria-label": K.menuLabel,
2390
- children: K.renderMenu({
2391
- query: Gt,
2392
- caretPosition: Z ?? 0,
2393
- close: gn,
2394
- listboxId: Xt,
2395
- activeOptionId: Qt
2396
+ "aria-label": G.menuLabel,
2397
+ children: G.renderMenu({
2398
+ query: Kt,
2399
+ caretPosition: X ?? 0,
2400
+ close: _n,
2401
+ listboxId: Zt,
2402
+ activeOptionId: $t
2396
2403
  })
2397
2404
  });
2398
2405
  },
2399
- children: /* @__PURE__ */ L("span", {
2406
+ children: /* @__PURE__ */ I("span", {
2400
2407
  "aria-hidden": !0,
2401
2408
  className: "inline-block h-lh w-0"
2402
2409
  })
2403
2410
  })
2404
- })] }), dr = /* @__PURE__ */ R("div", {
2405
- ref: fn,
2411
+ })] }), dr = /* @__PURE__ */ L("div", {
2412
+ ref: pn,
2406
2413
  className: "relative -ms-1 -me-1 w-[calc(100%+8px)]",
2407
- children: [ir && /* @__PURE__ */ R("div", {
2414
+ children: [ir && /* @__PURE__ */ L("div", {
2408
2415
  ref: ar,
2409
- className: l(q.textarea, se?.fontClassName || "dial-body-paragraph-text", "pointer-events-none absolute inset-0 z-10 max-h-[272px] w-full overflow-hidden ps-1 pe-1 [overflow-wrap:anywhere] whitespace-pre-wrap"),
2410
- children: [Ke(J, Rt, rr, q.mentionHighlight, q.mentionHighlightUnsupported), or.map((e, t) => /* @__PURE__ */ L("div", {
2416
+ className: l(K.textarea, ce?.fontClassName || "dial-body-paragraph-text", "pointer-events-none absolute inset-0 z-10 max-h-[272px] w-full overflow-hidden ps-1 pe-1 wrap-anywhere whitespace-pre-wrap"),
2417
+ children: [qe(q, zt, rr, K.mentionHighlight, K.mentionHighlightUnsupported), or.map((e, t) => /* @__PURE__ */ I("div", {
2411
2418
  "aria-hidden": !0,
2412
- className: "pointer-events-none absolute rounded-sm bg-control-accent-alpha-active",
2419
+ className: l("pointer-events-none absolute rounded-sm", K.selectionHighlight),
2413
2420
  style: {
2414
2421
  left: e.left,
2415
2422
  top: e.top,
@@ -2418,68 +2425,68 @@ var Q = {
2418
2425
  }
2419
2426
  }, `selection-${t}`))]
2420
2427
  }), ur]
2421
- }), fr = Ee ? void 0 : /* @__PURE__ */ L(yt, {
2422
- onAttachClick: De ? void 0 : () => Rn.current?.click(),
2428
+ }), fr = De ? void 0 : /* @__PURE__ */ I(bt, {
2429
+ onAttachClick: Oe ? void 0 : () => Rn.current?.click(),
2423
2430
  attachLabel: g,
2424
2431
  addMenuTitle: C,
2425
2432
  menuTitle: D,
2426
2433
  menuCloseLabel: O,
2427
- style: Bt,
2428
- isDisabled: G || Ln,
2429
- chatSettings: Qe,
2430
- extraMenuItems: Vt,
2431
- onRecordVoice: Re && Et && !s && !Ln ? () => Pn(tt.Attachment) : void 0,
2432
- recordVoiceLabel: ae,
2433
- toolsMenuItems: it ? nt : void 0,
2434
- onToolToggle: rt,
2435
- toolsMenuTitle: at,
2436
- toolsBackLabel: lt,
2437
- menuOverlays: dt,
2438
- getCaretPosition: () => X.current?.selectionStart ?? J.length
2439
- }), pr = ke === ct.Inline && (!Pt || Ae), mr = fr && /* @__PURE__ */ L("div", {
2440
- className: l("flex", W.addCluster),
2434
+ style: Vt,
2435
+ isDisabled: W || $,
2436
+ chatSettings: $e,
2437
+ extraMenuItems: Ht,
2438
+ onRecordVoice: ze && Dt && !s && !$ ? () => Fn(nt.Attachment) : void 0,
2439
+ recordVoiceLabel: oe,
2440
+ toolsMenuItems: at ? rt : void 0,
2441
+ onToolToggle: it,
2442
+ toolsMenuTitle: ot,
2443
+ toolsBackLabel: ut,
2444
+ menuOverlays: ft,
2445
+ getCaretPosition: () => Y.current?.selectionStart ?? q.length
2446
+ }), pr = Ae === lt.Inline && (!Ft || je), mr = fr && /* @__PURE__ */ I("div", {
2447
+ className: l("flex", U.addCluster),
2441
2448
  children: fr
2442
- }), hr = Jn.length > 0 && rt != null && /* @__PURE__ */ L("div", {
2443
- className: l("min-w-0", pr ? "flex-1" : "max-w-full flex-[1_0_auto]", W.toolsChips),
2444
- children: /* @__PURE__ */ L(St, {
2449
+ }), hr = Jn.length > 0 && it != null && /* @__PURE__ */ I("div", {
2450
+ className: l("min-w-0", pr ? "flex-1" : "max-w-full flex-[1_0_auto]", U.toolsChips),
2451
+ children: /* @__PURE__ */ I(Ct, {
2445
2452
  items: Jn,
2446
- onToolToggle: rt,
2453
+ onToolToggle: it,
2447
2454
  onToolDismiss: Yn,
2448
- canRemove: it,
2449
- removeLabel: ut?.removeLabel,
2450
- stateOnLabel: ut?.stateOnLabel,
2451
- stateOffLabel: ut?.stateOffLabel
2455
+ canRemove: at,
2456
+ removeLabel: dt?.removeLabel,
2457
+ stateOnLabel: dt?.stateOnLabel,
2458
+ stateOffLabel: dt?.stateOffLabel
2452
2459
  })
2453
2460
  });
2454
- return /* @__PURE__ */ R("div", {
2461
+ return /* @__PURE__ */ L("div", {
2455
2462
  ref: zn,
2456
- style: Bt,
2457
- className: l(q.wrapper, G && q.wrapperDisabled, G && "cursor-not-allowed", "flex w-full max-w-[748px] flex-col justify-center gap-3 rounded-xl border", "p-4 focus-within:outline focus-within:-outline-offset-1 active:outline active:-outline-offset-1", ue, W.wrapper),
2463
+ style: Vt,
2464
+ className: l(K.wrapper, W && K.wrapperDisabled, W && "cursor-not-allowed", "flex w-full max-w-[748px] flex-col justify-center gap-3 rounded-xl border", "p-4 focus-within:outline focus-within:-outline-offset-1 active:outline active:-outline-offset-1", de, U.wrapper),
2458
2465
  children: [
2459
- (qe.length > 0 || yn.length > 0) && /* @__PURE__ */ L(fe, {
2460
- attachments: [...qe, ...yn],
2466
+ (Je.length > 0 || bn.length > 0) && /* @__PURE__ */ I(pe, {
2467
+ attachments: [...Je, ...bn],
2461
2468
  onRemove: (e) => {
2462
- qe.some((t) => t.id === e) ? Je?.(e) : Cn(e);
2469
+ Je.some((t) => t.id === e) ? Ye?.(e) : wn(e);
2463
2470
  },
2464
- onRetry: wn,
2465
- onExpand: Tn,
2471
+ onRetry: Tn,
2472
+ onExpand: En,
2466
2473
  labels: {
2467
2474
  removeLabel: k,
2468
- retryLabel: A,
2469
- uploadingLabel: j,
2470
- expandLabel: M,
2471
- clickLabel: N
2475
+ retryLabel: ee,
2476
+ uploadingLabel: A,
2477
+ expandLabel: te,
2478
+ clickLabel: j
2472
2479
  },
2473
2480
  styles: {
2474
- ...ce,
2475
- className: l(yn.length > 6 && "-me-4", ce?.className)
2481
+ ...le,
2482
+ className: l(bn.length > 6 && "-me-4", le?.className)
2476
2483
  },
2477
- onAttachmentClick: xt == null ? void 0 : (e) => {
2478
- let t = [...qe, ...yn].find((t) => t.id === e);
2479
- t != null && xt(t);
2484
+ onAttachmentClick: St == null ? void 0 : (e) => {
2485
+ let t = [...Je, ...bn].find((t) => t.id === e);
2486
+ t != null && St(t);
2480
2487
  }
2481
2488
  }),
2482
- !Ee && /* @__PURE__ */ L("input", {
2489
+ !De && /* @__PURE__ */ I("input", {
2483
2490
  ref: Rn,
2484
2491
  type: "file",
2485
2492
  multiple: !0,
@@ -2489,126 +2496,128 @@ var Q = {
2489
2496
  tabIndex: -1,
2490
2497
  onChange: nr
2491
2498
  }),
2492
- /* @__PURE__ */ L(w, {
2499
+ /* @__PURE__ */ I(w, {
2493
2500
  politeness: E.Assertive,
2494
2501
  className: "min-w-0 px-1 wrap-break-word",
2495
- children: Nn && /* @__PURE__ */ L(x, { text: Nn })
2502
+ children: Pn && /* @__PURE__ */ I(x, { text: Pn })
2496
2503
  }),
2497
- Ln && /* @__PURE__ */ L(Dt, {
2504
+ $ && /* @__PURE__ */ I(Ot, {
2498
2505
  embedded: !0,
2499
- state: jn,
2500
- analyserNodeRef: Mn,
2501
- onStop: Fn,
2502
- onDiscard: In,
2506
+ state: Mn,
2507
+ analyserNodeRef: Nn,
2508
+ onStop: In,
2509
+ onDiscard: Ln,
2503
2510
  attachButton: fr,
2504
- stopLabel: P,
2505
- discardLabel: oe,
2506
- processingLabel: Be
2511
+ stopLabel: N,
2512
+ discardLabel: se,
2513
+ processingLabel: Ve
2507
2514
  }),
2508
- !Ln && Oe && dr,
2509
- !Ln && !Oe && pr && hr && /* @__PURE__ */ L("div", {
2515
+ !$ && ke && dr,
2516
+ !$ && !ke && pr && hr && /* @__PURE__ */ I("div", {
2510
2517
  className: "flex",
2511
2518
  children: hr
2512
2519
  }),
2513
- !Ln && !Oe && /* @__PURE__ */ R("div", {
2514
- className: l("flex items-center gap-2", pr ? "flex-nowrap" : "flex-wrap", W.actionRow),
2520
+ !$ && !ke && /* @__PURE__ */ L("div", {
2521
+ className: l("flex items-center gap-2", pr ? "flex-nowrap" : "flex-wrap", U.actionRow),
2515
2522
  children: [
2516
2523
  pr && mr,
2517
- /* @__PURE__ */ L("div", {
2518
- className: l("flex min-w-0 items-center self-stretch", pr ? "flex-1" : "w-full", W.textareaWrap),
2524
+ /* @__PURE__ */ I("div", {
2525
+ className: l("flex min-w-0 items-center self-stretch", pr ? "flex-1" : "w-full", U.textareaWrap),
2519
2526
  children: dr
2520
2527
  }),
2521
2528
  !pr && mr,
2522
2529
  !pr && hr,
2523
- /* @__PURE__ */ L("div", {
2524
- className: l("ms-auto flex flex-shrink-0 items-center gap-2", W.footerActions),
2525
- children: je ? je({
2530
+ /* @__PURE__ */ I("div", {
2531
+ className: l("ms-auto flex shrink-0 items-center gap-2", U.footerActions),
2532
+ children: Me ? Me({
2526
2533
  canSend: Wn,
2527
2534
  onSend: Qn
2528
- }) : /* @__PURE__ */ R(I, { children: [
2529
- jt,
2530
- /* @__PURE__ */ L(on, {
2531
- deployments: ye,
2532
- selectedDeploymentId: Se,
2533
- onDeploymentChange: Ce,
2534
- modelSelectorLabels: we,
2535
- menuStyles: le,
2535
+ }) : /* @__PURE__ */ L(F, { children: [
2536
+ Mt,
2537
+ /* @__PURE__ */ I(sn, {
2538
+ deployments: be,
2539
+ selectedDeploymentId: Ce,
2540
+ onDeploymentChange: we,
2541
+ modelSelectorLabels: Te,
2542
+ menuStyles: ue,
2543
+ nameClassName: ce?.modelSelectorNameClassName,
2544
+ versionClassName: ce?.modelSelectorVersionClassName,
2536
2545
  isStreaming: s,
2537
- isMobile: Pt,
2538
- isDisabled: Pe,
2539
- style: Bt,
2540
- modelPickerOverlay: Ct,
2541
- isPickerOpen: Ft,
2542
- onPickerToggle: () => It((e) => !e),
2543
- onPickerOpenChange: It
2546
+ isMobile: Ft,
2547
+ isDisabled: Fe,
2548
+ style: Vt,
2549
+ modelPickerOverlay: wt,
2550
+ isPickerOpen: It,
2551
+ onPickerToggle: () => Lt((e) => !e),
2552
+ onPickerOpenChange: Lt
2544
2553
  }),
2545
- Zn && /* @__PURE__ */ L(S, {
2546
- icon: /* @__PURE__ */ L(xe, {
2554
+ Zn && /* @__PURE__ */ I(S, {
2555
+ icon: /* @__PURE__ */ I(Se, {
2547
2556
  size: _.LG,
2548
2557
  stroke: v,
2549
2558
  "aria-hidden": !0
2550
2559
  }),
2551
- "aria-label": ie,
2552
- tooltipProps: { tooltip: ie },
2560
+ "aria-label": ae,
2561
+ tooltipProps: { tooltip: ae },
2553
2562
  className: "shrink-0",
2554
- onClick: () => Pn(tt.Dictation),
2555
- disabled: G || s
2563
+ onClick: () => Fn(nt.Dictation),
2564
+ disabled: W || s
2556
2565
  }),
2557
- s && o ? /* @__PURE__ */ L(kt, {
2566
+ s && o ? /* @__PURE__ */ I(At, {
2558
2567
  onStop: o,
2559
- ariaLabel: re
2560
- }) : !s && /* @__PURE__ */ L(Ot, {
2568
+ ariaLabel: ie
2569
+ }) : !s && /* @__PURE__ */ I(kt, {
2561
2570
  onSend: Qn,
2562
2571
  isDisabled: !Xn || !Wn,
2563
- ariaLabel: ee,
2564
- sendTooltip: Un ? te : ne ?? te
2572
+ ariaLabel: ne,
2573
+ sendTooltip: Un ? M : re ?? M
2565
2574
  })
2566
2575
  ] })
2567
2576
  })
2568
2577
  ]
2569
2578
  }),
2570
- /* @__PURE__ */ L(w, {
2579
+ /* @__PURE__ */ I(w, {
2571
2580
  visuallyHidden: !0,
2572
2581
  atomic: !0,
2573
2582
  as: T.Span,
2574
- children: /* @__PURE__ */ L("span", { children: kn.text }, kn.revision)
2583
+ children: /* @__PURE__ */ I("span", { children: An.text }, An.revision)
2575
2584
  })
2576
2585
  ]
2577
2586
  });
2578
2587
  });
2579
- sn.displayName = "Input";
2580
- var cn = {
2588
+ cn.displayName = "Input";
2589
+ var ln = {
2581
2590
  welcome: "_welcome_1icyo_1",
2582
2591
  description: "_description_1icyo_5"
2583
- }, ln = ({ isStreaming: e = !1, placeholder: t = "Type a prompt or use \"/\" to select one", welcomeText: n, descriptionText: r, belowWelcomeSlot: i, aboveInputSlot: a, styles: o, className: s, inputClassName: u, isInputDisabled: d = !1, ...f }) => {
2592
+ }, un = ({ isStreaming: e = !1, placeholder: t = "Type a prompt or use \"/\" to select one", welcomeText: n, descriptionText: r, belowWelcomeSlot: i, aboveInputSlot: a, styles: o, className: s, inputClassName: u, isInputDisabled: d = !1, ...f }) => {
2584
2593
  let { colors: p, typography: m, attachmentTray: h, modelMenu: g } = o ?? {}, _ = c({
2585
2594
  "--ci-welcome-color": p?.welcomeText,
2586
2595
  "--ci-description-color": p?.descriptionText
2587
2596
  });
2588
- return /* @__PURE__ */ R("div", {
2597
+ return /* @__PURE__ */ L("div", {
2589
2598
  style: _,
2590
2599
  className: l("relative flex w-full flex-col items-center gap-9 px-4 py-5 desktop:p-5", s),
2591
2600
  children: [
2592
- n && /* @__PURE__ */ R("div", {
2601
+ n && /* @__PURE__ */ L("div", {
2593
2602
  className: "flex max-w-full flex-col items-center gap-4 text-center",
2594
- children: [/* @__PURE__ */ L("h1", {
2595
- className: l(cn.welcome, "m-0 max-w-full [overflow-wrap:anywhere]", m?.welcomeClassName || "dial-display2-text"),
2603
+ children: [/* @__PURE__ */ I("h1", {
2604
+ className: l(ln.welcome, "m-0 max-w-full wrap-anywhere", m?.welcomeClassName || "dial-display2-text"),
2596
2605
  children: n
2597
- }), r && /* @__PURE__ */ L("p", {
2598
- className: l(cn.description, "m-0 max-w-[540px]", m?.descriptionClassName || "dial-body-paragraph-text"),
2606
+ }), r && /* @__PURE__ */ I("p", {
2607
+ className: l(ln.description, "m-0 max-w-[540px]", m?.descriptionClassName || "dial-body-paragraph-text"),
2599
2608
  children: r
2600
2609
  })]
2601
2610
  }),
2602
- i != null && /* @__PURE__ */ L("div", {
2611
+ i != null && /* @__PURE__ */ I("div", {
2603
2612
  className: "flex w-full max-w-[700px] flex-col items-center empty:hidden",
2604
2613
  children: i
2605
2614
  }),
2606
- /* @__PURE__ */ R("div", {
2615
+ /* @__PURE__ */ L("div", {
2607
2616
  className: l("relative w-full", n ? "max-w-[700px]" : "max-w-[748px]"),
2608
- children: [a != null && /* @__PURE__ */ L("div", {
2617
+ children: [a != null && /* @__PURE__ */ I("div", {
2609
2618
  className: "mb-2",
2610
2619
  children: a
2611
- }), /* @__PURE__ */ L(sn, {
2620
+ }), /* @__PURE__ */ I(cn, {
2612
2621
  placeholder: t,
2613
2622
  isStreaming: e,
2614
2623
  isInputDisabled: d,
@@ -2622,36 +2631,36 @@ var cn = {
2622
2631
  })
2623
2632
  ]
2624
2633
  });
2625
- }, un = ({ message: e, messageRevision: t, onChange: n, activeMentions: r, onBackspaceAtCaret: i, caretPositionOverride: o, commandMenu: s, menuOverlays: c, sendOnEnter: u, initialAttachments: d = [], onCancel: p, onSave: m, onUploadAttachment: h, cancelLabel: g = "Cancel", saveLabel: _ = "Save & Submit", ariaLabel: y, removeLabel: b, retryLabel: x, uploadingLabel: S, expandLabel: C, clickLabel: w, addMenuTitle: T = "Add", attachLabel: E = "Attach file", menuTitle: D = "Menu", menuCloseLabel: k = "Close", className: A, pendingDropFiles: j, onDropFilesConsumed: M, validateAttachment: N, isAttachmentsEnabled: ee, isTextAttachmentsAllowed: ne, hideAttachFile: re = !1, fileAccept: ie, maximumAttachmentsAmount: ae, onAttachmentsLimitExceeded: P, onDialFileSystemClick: oe, dialFileSystemLabel: F, pendingAttachments: se, onPendingAttachmentsConsumed: ce, onAttachmentClick: le, pasteTextThreshold: ue, maxMessageLength: de = 5e4, onMessageTooLong: I }) => {
2626
- let fe = H(null), pe = H(null), [me, he] = U([]);
2627
- B(() => {
2628
- j?.length && (he(j), M?.());
2629
- }, [j, M]);
2630
- let [ge, _e] = U(e ?? ""), [ve, ye] = U([]), [xe, Se] = U(d), Ce = ve.some((e) => e.status === a.Loading || e.status === a.Error), we = (ge.trim().length > 0 || ve.length > 0 || xe.length > 0) && !Ce, Te = (e) => {
2631
- Se((t) => t.filter((t) => t.id !== e));
2632
- }, Ee = z((e, t) => {
2633
- m(e, xe, t);
2634
- }, [xe, m]), De = () => {
2635
- we && (ge.length >= de ? I?.(ge.length, de) : Ee(ge, ve));
2636
- }, Oe = z(() => he([]), []), ke = z((e) => {
2637
- _e(e), n?.(e);
2638
- }, [n]), Ae = z((e) => {
2634
+ }, dn = ({ message: e, messageRevision: t, onChange: n, activeMentions: r, onBackspaceAtCaret: i, caretPositionOverride: o, commandMenu: s, menuOverlays: c, sendOnEnter: u, initialAttachments: d = [], onCancel: p, onSave: m, onUploadAttachment: h, cancelLabel: g = "Cancel", saveLabel: _ = "Save & Submit", ariaLabel: y, removeLabel: b, retryLabel: x, uploadingLabel: S, expandLabel: C, clickLabel: w, addMenuTitle: T = "Add", attachLabel: E = "Attach file", menuTitle: D = "Menu", menuCloseLabel: k = "Close", className: ee, pendingDropFiles: A, onDropFilesConsumed: te, validateAttachment: j, isAttachmentsEnabled: ne, isTextAttachmentsAllowed: re, hideAttachFile: ie = !1, fileAccept: ae, maximumAttachmentsAmount: oe, onAttachmentsLimitExceeded: N, onDialFileSystemClick: se, dialFileSystemLabel: P, pendingAttachments: ce, onPendingAttachmentsConsumed: le, onAttachmentClick: ue, pasteTextThreshold: de, maxMessageLength: fe = 5e4, onMessageTooLong: F }) => {
2635
+ let pe = V(null), me = V(null), [he, ge] = H([]);
2636
+ z(() => {
2637
+ A?.length && (ge(A), te?.());
2638
+ }, [A, te]);
2639
+ let [_e, ve] = H(e ?? ""), [ye, be] = H([]), [Se, Ce] = H(d), we = ye.some((e) => e.status === a.Loading || e.status === a.Error), Te = (_e.trim().length > 0 || ye.length > 0 || Se.length > 0) && !we, Ee = (e) => {
2640
+ Ce((t) => t.filter((t) => t.id !== e));
2641
+ }, De = R((e, t) => {
2642
+ m(e, Se, t);
2643
+ }, [Se, m]), Oe = () => {
2644
+ Te && (_e.length >= fe ? F?.(_e.length, fe) : De(_e, ye));
2645
+ }, ke = R(() => ge([]), []), Ae = R((e) => {
2646
+ ve(e), n?.(e);
2647
+ }, [n]), je = R((e) => {
2639
2648
  let t = Array.from(e.target.files ?? []);
2640
- t.length !== 0 && (e.target.value = "", he(t));
2641
- }, []), je = V(() => oe ? [{
2649
+ t.length !== 0 && (e.target.value = "", ge(t));
2650
+ }, []), Me = B(() => se ? [{
2642
2651
  key: "dial-fs",
2643
- label: F ?? "DIAL file system",
2644
- icon: /* @__PURE__ */ L(be, {
2652
+ label: P ?? "DIAL file system",
2653
+ icon: /* @__PURE__ */ I(xe, {
2645
2654
  size: f,
2646
2655
  "aria-hidden": !0,
2647
2656
  stroke: v
2648
2657
  }),
2649
- onClick: oe
2650
- }] : [], [oe, F]);
2651
- return /* @__PURE__ */ R("div", {
2652
- className: l("flex w-full flex-col gap-2", A),
2653
- children: [/* @__PURE__ */ L(sn, {
2654
- ref: pe,
2658
+ onClick: se
2659
+ }] : [], [se, P]);
2660
+ return /* @__PURE__ */ L("div", {
2661
+ className: l("flex w-full flex-col gap-2", ee),
2662
+ children: [/* @__PURE__ */ I(cn, {
2663
+ ref: me,
2655
2664
  message: e,
2656
2665
  messageRevision: t,
2657
2666
  activeMentions: r,
@@ -2661,107 +2670,108 @@ var cn = {
2661
2670
  ariaLabel: y,
2662
2671
  hideActionBar: !0,
2663
2672
  sendOnEnter: u,
2664
- pendingDropFiles: me,
2665
- onDropFilesConsumed: Oe,
2666
- onSend: Ee,
2673
+ pendingDropFiles: he,
2674
+ onDropFilesConsumed: ke,
2675
+ onSend: De,
2667
2676
  onUploadAttachment: h,
2668
- onChange: ke,
2669
- onAttachmentsChange: ye,
2677
+ onChange: Ae,
2678
+ onAttachmentsChange: be,
2670
2679
  removeLabel: b,
2671
2680
  retryLabel: x,
2672
2681
  uploadingLabel: S,
2673
2682
  expandLabel: C,
2674
2683
  clickLabel: w,
2675
2684
  className: "max-w-full",
2676
- prefixAttachments: xe,
2677
- onRemovePrefixAttachment: Te,
2678
- validateAttachment: N,
2679
- isAttachmentsEnabled: ee,
2680
- isTextAttachmentsAllowed: ne,
2681
- maximumAttachmentsAmount: ae,
2682
- onAttachmentsLimitExceeded: P,
2683
- pendingAttachments: se,
2684
- onPendingAttachmentsConsumed: ce,
2685
- onAttachmentClick: le,
2686
- pasteTextThreshold: ue,
2687
- maxMessageLength: de,
2688
- onMessageTooLong: I
2689
- }), /* @__PURE__ */ R("div", {
2685
+ prefixAttachments: Se,
2686
+ onRemovePrefixAttachment: Ee,
2687
+ validateAttachment: j,
2688
+ isAttachmentsEnabled: ne,
2689
+ isTextAttachmentsAllowed: re,
2690
+ maximumAttachmentsAmount: oe,
2691
+ onAttachmentsLimitExceeded: N,
2692
+ pendingAttachments: ce,
2693
+ onPendingAttachmentsConsumed: le,
2694
+ onAttachmentClick: ue,
2695
+ pasteTextThreshold: de,
2696
+ maxMessageLength: fe,
2697
+ onMessageTooLong: F
2698
+ }), /* @__PURE__ */ L("div", {
2690
2699
  className: "flex items-center justify-between",
2691
- children: [/* @__PURE__ */ R("div", {
2700
+ children: [/* @__PURE__ */ L("div", {
2692
2701
  className: "flex",
2693
- children: [!re && /* @__PURE__ */ L("input", {
2694
- ref: fe,
2702
+ children: [!ie && /* @__PURE__ */ I("input", {
2703
+ ref: pe,
2695
2704
  type: "file",
2696
2705
  multiple: !0,
2697
- accept: ie,
2706
+ accept: ae,
2698
2707
  className: "sr-only",
2699
2708
  "aria-hidden": !0,
2700
2709
  tabIndex: -1,
2701
- onChange: Ae
2702
- }), (!re || (c?.length ?? 0) > 0) && /* @__PURE__ */ L(yt, {
2703
- onAttachClick: re ? void 0 : () => fe.current?.click(),
2710
+ onChange: je
2711
+ }), (!ie || (c?.length ?? 0) > 0) && /* @__PURE__ */ I(bt, {
2712
+ onAttachClick: ie ? void 0 : () => pe.current?.click(),
2704
2713
  attachLabel: E,
2705
2714
  addMenuTitle: T,
2706
2715
  menuTitle: D,
2707
2716
  menuCloseLabel: k,
2708
- extraMenuItems: je,
2717
+ extraMenuItems: Me,
2709
2718
  menuOverlays: c,
2710
- getCaretPosition: () => pe.current?.getCaretPosition() ?? 0
2719
+ getCaretPosition: () => me.current?.getCaretPosition() ?? 0
2711
2720
  })]
2712
- }), /* @__PURE__ */ R("div", {
2721
+ }), /* @__PURE__ */ L("div", {
2713
2722
  className: "flex gap-2",
2714
- children: [/* @__PURE__ */ L(O, {
2723
+ children: [/* @__PURE__ */ I(O, {
2715
2724
  label: g,
2716
2725
  onClick: p
2717
- }), /* @__PURE__ */ L(te, {
2726
+ }), /* @__PURE__ */ I(M, {
2718
2727
  label: _,
2719
- onClick: De,
2720
- disabled: !we
2728
+ onClick: Oe,
2729
+ disabled: !Te
2721
2730
  })]
2722
2731
  })]
2723
2732
  })]
2724
2733
  });
2725
- }, $ = /* @__PURE__ */ function(e) {
2734
+ }, Q = /* @__PURE__ */ function(e) {
2726
2735
  return e.Warning = "warning", e.Reached = "reached", e;
2727
- }({}), dn = {
2728
- [$.Warning]: M.Warning,
2729
- [$.Reached]: M.Error
2730
- }, fn = ({ severity: e, limitText: t, reset: n, onClose: r, closeAriaLabel: i = "Close notification", limitTextClassName: a = "dial-small-paragraph-semi-text", resetTextClassName: o = "dial-small-paragraph-text", className: s }) => {
2731
- let c = /* @__PURE__ */ L("span", {
2736
+ }({}), fn = { banner: "_banner_180n6_2" }, pn = {
2737
+ [Q.Warning]: te.Warning,
2738
+ [Q.Reached]: te.Error
2739
+ }, mn = ({ severity: e, limitText: t, reset: n, onClose: r, closeAriaLabel: i = "Close notification", limitTextClassName: a = "dial-small-paragraph-semi-text", resetTextClassName: o = "dial-small-paragraph-text", className: s, colors: u }) => {
2740
+ let d = /* @__PURE__ */ I("span", {
2732
2741
  className: a,
2733
2742
  children: t
2734
- }), u = n != null && /* @__PURE__ */ R(I, { children: [
2743
+ }), f = n != null && /* @__PURE__ */ L(F, { children: [
2735
2744
  " ",
2736
- /* @__PURE__ */ L("time", {
2745
+ /* @__PURE__ */ I("time", {
2737
2746
  dateTime: n.isoValue,
2738
2747
  "aria-hidden": n.ariaLabel != null || void 0,
2739
2748
  className: o,
2740
2749
  children: n.label
2741
2750
  }),
2742
- n.ariaLabel != null && /* @__PURE__ */ L("span", {
2751
+ n.ariaLabel != null && /* @__PURE__ */ I("span", {
2743
2752
  className: "sr-only",
2744
2753
  children: n.ariaLabel
2745
2754
  })
2746
2755
  ] });
2747
- return /* @__PURE__ */ L(A, {
2756
+ return /* @__PURE__ */ I(ee, {
2748
2757
  role: "status",
2749
- variant: dn[e],
2750
- type: j.SectionMessage,
2751
- title: u ? c : void 0,
2752
- message: u || c,
2753
- className: l("bg-layer-sunken", W.usageBanner, s),
2754
- children: r != null && /* @__PURE__ */ L(g, {
2758
+ variant: pn[e],
2759
+ type: A.SectionMessage,
2760
+ title: f ? d : void 0,
2761
+ message: f || d,
2762
+ className: l(fn.banner, U.usageBanner, s),
2763
+ style: c({ "--ci-usage-banner-bg": u?.background }),
2764
+ children: r != null && /* @__PURE__ */ I(g, {
2755
2765
  className: "shrink-0 self-start",
2756
2766
  ariaLabel: i,
2757
2767
  onClose: () => r()
2758
2768
  })
2759
2769
  });
2760
- }, pn = (e) => {
2761
- let [t, n] = U({
2770
+ }, hn = (e) => {
2771
+ let [t, n] = H({
2762
2772
  text: e?.text,
2763
2773
  revision: e?.revision ?? 0
2764
- }), r = z((e) => {
2774
+ }), r = R((e) => {
2765
2775
  n((t) => ({
2766
2776
  text: e,
2767
2777
  revision: t.revision + 1
@@ -2772,11 +2782,11 @@ var cn = {
2772
2782
  messageRevision: t.revision,
2773
2783
  seedMessage: r
2774
2784
  };
2775
- }, mn = (e, t) => {
2776
- let n = H(e), r = H(t);
2777
- r.current = t, B(() => {
2785
+ }, gn = (e, t) => {
2786
+ let n = V(e), r = V(t);
2787
+ r.current = t, z(() => {
2778
2788
  e !== n.current && (n.current = e, r.current());
2779
2789
  }, [e]);
2780
2790
  };
2781
2791
  //#endregion
2782
- export { ct as ActionRowLayout, Pe as BottomSheetShell, W as CONVERSATION_INPUT_CLASS, ht as ChatSettingsModal, ln as ConversationInput, un as EditMessageInput, sn as Input, st as SendOnEnter, $ as UsageLimitBannerSeverity, fn as UsageLimitBannerView, pn as useComposerSeed, mn as useComposerSeedSource };
2792
+ export { lt as ActionRowLayout, Fe as BottomSheetShell, U as CONVERSATION_INPUT_CLASS, gt as ChatSettingsModal, un as ConversationInput, dn as EditMessageInput, cn as Input, ct as SendOnEnter, Q as UsageLimitBannerSeverity, mn as UsageLimitBannerView, hn as useComposerSeed, gn as useComposerSeedSource };