@epam/ai-dial-conversation-input 1.3.0-dev.246 → 1.3.0-dev.249

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