@epam/ai-dial-conversation-input 1.4.0-dev.12 → 1.4.0-dev.124

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
- 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, useIsPhone as f } from "@epam/ai-dial-chat-shared";
2
- import { BASE_ICON_SIZE as p, BottomSheet as m, Button as h, ButtonVariant as g, CloseButton as _, DIAL_ICON_SIZE as v, DIAL_KIT_ICON_STROKE as y, Dropdown as b, DropdownOverlayRole as x, ElementSize as S, ErrorText as C, GhostIconButton as w, Highlight as T, LiveRegion as E, LiveRegionElement as D, LiveRegionPoliteness as O, MenuItem as k, MenuItemMark as A, NeutralButton as j, NeutralIconButton as M, Notification as N, NotificationType as P, NotificationVariant as ee, Popup as F, PopupSize as I, PrimaryButton as L, PrimaryIconButton as R, RadioGroup as z, RadioGroupOrientation as B, Search as te, Skeleton as ne, SkeletonVariant as re, Slider as ie, Spinner as ae, Textarea as oe, TextareaResize as se, ToggleChip as ce, Tooltip as le } from "@epam/ai-dial-ui-kit";
3
- import { Fragment as ue, jsx as V, jsxs as H } from "react/jsx-runtime";
4
- import { AttachmentTray as de, MAX_UPLOADS_PER_MINUTE as fe, generateAttachmentId as pe, useClipboardPaste as me } from "@epam/ai-dial-attachment-input";
5
- import { IconArrowNarrowRight as he, IconCheck as ge, IconChevronDown as _e, IconChevronRight as ve, IconFile as ye, IconMicrophone as be, IconPaperclip as xe, IconPlayerStop as Se, IconPlus as Ce, IconSettings as we, IconTool as Te, IconX as Ee } from "@tabler/icons-react";
6
- import { Fragment as De, createElement as Oe, forwardRef as ke, memo as Ae, useCallback as U, useEffect as W, useId as je, useImperativeHandle as Me, useLayoutEffect as Ne, useMemo as G, useRef as K, useState as q, useSyncExternalStore as Pe } from "react";
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, getBaseMimeType as l, inferMimeTypeFromPath as u, mergeClasses as d, normalizeMimeType as f, useIsMobile as p, useIsPhone as m } from "@epam/ai-dial-chat-shared";
2
+ import { BASE_ICON_SIZE as h, BottomSheet as g, Button as _, ButtonVariant as v, CloseButton as y, DIAL_ICON_SIZE as b, DIAL_KIT_ICON_STROKE as x, Dropdown as S, DropdownOverlayRole as C, ElementSize as w, ErrorText as T, GhostIconButton as E, Highlight as D, LiveRegion as O, LiveRegionElement as k, LiveRegionPoliteness as A, MenuItem as j, MenuItemMark as M, NeutralButton as N, NeutralIconButton as P, Notification as ee, NotificationType as F, NotificationVariant as I, Popup as te, PopupSize as L, PrimaryButton as R, PrimaryIconButton as z, RadioGroup as B, RadioGroupOrientation as ne, Search as re, Skeleton as ie, SkeletonVariant as ae, Slider as oe, Spinner as se, Textarea as ce, TextareaResize as le, ToggleChip as ue, Tooltip as de } from "@epam/ai-dial-ui-kit";
3
+ import { Fragment as V, jsx as H, jsxs as U } from "react/jsx-runtime";
4
+ import { AttachmentTray as fe, MAX_UPLOADS_PER_MINUTE as pe, generateAttachmentId as me, useClipboardPaste as he } from "@epam/ai-dial-attachment-input";
5
+ import { IconArrowNarrowRight as ge, IconCheck as _e, IconChevronDown as ve, IconChevronRight as ye, IconFile as be, IconMicrophone as xe, IconPaperclip as Se, IconPlayerStop as Ce, IconPlus as we, IconSettings as Te, IconTool as Ee, IconX as De } from "@tabler/icons-react";
6
+ import { Fragment as Oe, createElement as ke, forwardRef as Ae, memo as je, useCallback as W, useEffect as G, useId as Me, useImperativeHandle as Ne, useLayoutEffect as Pe, useMemo as K, useRef as q, useState as J, useSyncExternalStore as Fe } from "react";
7
7
  //#region src/constants/public-class-names.ts
8
- var J = {
8
+ var Y = {
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 J = {
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
- }, Fe = {
23
+ }, Ie = {
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
- }, Ie = ({ 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: p, overlayClassName: h, overlayStyle: g, children: _ }) => {
28
+ }, Le = ({ isOpen: e, title: t, closeLabel: n, onClose: r, onBack: i, backLabel: a, "aria-label": o, style: s, titleClassName: l = "dial-body-semi-text", className: u, colors: f, portalId: p, overlayClassName: m, overlayStyle: h, 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__ */ V(m, {
35
+ return /* @__PURE__ */ H(g, {
36
36
  open: e,
37
37
  onClose: r,
38
38
  title: t,
@@ -46,56 +46,66 @@ var J = {
46
46
  },
47
47
  overlayStyle: {
48
48
  ...v,
49
- ...g
49
+ ...h
50
50
  },
51
- className: l(Fe.sheet, d),
52
- overlayClassName: l(Fe.backdrop, h),
51
+ className: d(Ie.sheet, u),
52
+ overlayClassName: d(Ie.backdrop, m),
53
53
  portalId: p,
54
- headerClassName: Fe.divider,
55
- titleClassName: l(Fe.title, u),
54
+ headerClassName: Ie.divider,
55
+ titleClassName: d(Ie.title, l),
56
56
  children: _
57
57
  });
58
- }, Le = async (e, t, n) => {
58
+ }, Re = 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
- }, Re = ({ 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, _] = q(n), v = K(g);
64
- W(() => {
62
+ }, ze = "application/octet-stream", Be = (e) => {
63
+ let t = l(e);
64
+ return t === "" || t === ze;
65
+ }, Ve = (e) => {
66
+ if (!Be(e.type)) return e;
67
+ let t = u(e.name);
68
+ return t == null ? e : new File([e], e.name, {
69
+ type: t,
70
+ lastModified: e.lastModified
71
+ });
72
+ }, He = ({ 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 }) => {
73
+ let [g, _] = J(n), v = q(g);
74
+ G(() => {
65
75
  v.current = g;
66
- }, [g]), W(() => () => {
76
+ }, [g]), G(() => () => {
67
77
  v.current.forEach((e) => {
68
78
  e.previewUrl && URL.revokeObjectURL(e.previewUrl), e.playUrl && URL.revokeObjectURL(e.playUrl);
69
79
  });
70
80
  }, []);
71
- let y = U((e) => e.map((e) => {
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, s = t.File;
73
- return n ? s = t.Image : r && (s = t.Audio), {
74
- id: pe(),
75
- name: e.name,
76
- contentType: e.type,
77
- file: e,
78
- type: s,
81
+ let y = W((e) => e.map((e) => {
82
+ let n = Ve(e), r = n.type.startsWith("image/"), i = n.type.startsWith("audio/"), o = r ? URL.createObjectURL(n) : void 0, s = i ? URL.createObjectURL(n) : void 0, c = t.File;
83
+ return r ? c = t.Image : i && (c = t.Audio), {
84
+ id: me(),
85
+ name: n.name,
86
+ contentType: n.type,
87
+ file: n,
88
+ type: c,
79
89
  status: a.Idle,
80
- previewUrl: i,
81
- playUrl: o
90
+ previewUrl: o,
91
+ playUrl: s
82
92
  };
83
- }), []), b = K(i);
84
- W(() => {
93
+ }), []), b = q(i);
94
+ G(() => {
85
95
  b.current = i;
86
96
  }, [i]);
87
- let x = K(!0), S = U((e) => {
97
+ let x = q(!0), S = W((e) => {
88
98
  _((t) => {
89
99
  let n = e(t);
90
100
  return n === t ? t : n;
91
101
  });
92
102
  }, []);
93
- W(() => {
103
+ G(() => {
94
104
  x.current ? x.current = !1 : b.current?.(g);
95
105
  }, [g]);
96
- let C = U((e) => {
106
+ let C = W((e) => {
97
107
  _(e);
98
- }, []), w = U(async (t) => {
108
+ }, []), w = W(async (t) => {
99
109
  if (r) {
100
110
  S((e) => e.map((e) => e.id === t.id ? {
101
111
  ...e,
@@ -118,7 +128,7 @@ var J = {
118
128
  } : e));
119
129
  }
120
130
  }
121
- }, [r, S]), T = U((e, t = !0) => {
131
+ }, [r, S]), T = W((e, t = !0) => {
122
132
  let n = new Set(v.current.map((e) => e.id)), r = e.filter((e) => !n.has(e.id));
123
133
  if (r.length !== 0) {
124
134
  if (p != null && p > 0 && Number.isFinite(p)) {
@@ -139,7 +149,7 @@ var J = {
139
149
  status: a.Error,
140
150
  errorReason: n
141
151
  } : e));
142
- }), Le(e, fe, w);
152
+ }), Re(e, pe, w);
143
153
  }
144
154
  }
145
155
  }, [
@@ -149,8 +159,8 @@ var J = {
149
159
  S,
150
160
  w,
151
161
  o
152
- ]), E = K(/* @__PURE__ */ new WeakSet());
153
- W(() => {
162
+ ]), E = q(/* @__PURE__ */ new WeakSet());
163
+ G(() => {
154
164
  if (s.length === 0) {
155
165
  E.current = /* @__PURE__ */ new WeakSet();
156
166
  return;
@@ -163,13 +173,13 @@ var J = {
163
173
  l,
164
174
  c,
165
175
  s
166
- ]), W(() => {
176
+ ]), G(() => {
167
177
  u.length !== 0 && (T(u, !1), d?.());
168
178
  }, [
169
179
  T,
170
180
  d,
171
181
  u
172
- ]), W(() => {
182
+ ]), G(() => {
173
183
  if (!o) return;
174
184
  let t = !1, n = [], r = v.current.map((r) => {
175
185
  if (r.status === a.Loading) return r;
@@ -196,7 +206,7 @@ var J = {
196
206
  S,
197
207
  w
198
208
  ]);
199
- let D = U((e) => {
209
+ let D = W((e) => {
200
210
  S((t) => {
201
211
  let n = t.find((t) => t.id === e);
202
212
  return n?.previewUrl && URL.revokeObjectURL(n.previewUrl), n?.playUrl && URL.revokeObjectURL(n.playUrl), t.filter((t) => t.id !== e);
@@ -208,11 +218,11 @@ var J = {
208
218
  addAttachments: T,
209
219
  resetAttachments: C,
210
220
  handleRemove: D,
211
- handleRetry: U((e) => {
221
+ handleRetry: W((e) => {
212
222
  let t = g.find((t) => t.id === e);
213
223
  t && w(t);
214
224
  }, [g, w]),
215
- handleExpand: U(async (e) => {
225
+ handleExpand: W(async (e) => {
216
226
  let n = g.find((t) => t.id === e);
217
227
  if (!n || n.type !== t.Pasted) return;
218
228
  let r = await n.file.text();
@@ -224,18 +234,18 @@ var J = {
224
234
  ]),
225
235
  hasBlockedAttachments: g.some((e) => e.status === a.Loading || e.status === a.Error)
226
236
  };
227
- }, ze = (e, t) => !e.slice(0, t).includes("\n"), Be = (e, t) => !e.slice(t).includes("\n"), Ve = (e) => {
228
- let t = K(e);
237
+ }, Ue = (e, t) => !e.slice(0, t).includes("\n"), We = (e, t) => !e.slice(t).includes("\n"), Ge = (e) => {
238
+ let t = q(e);
229
239
  t.current = e;
230
- let n = K(-1), r = K(""), i = U((e, i, a) => {
240
+ let n = q(-1), r = q(""), i = W((e, i, a) => {
231
241
  let o = t.current;
232
- 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);
233
- }, []), a = U(() => {
242
+ return !o || o.length === 0 ? null : e === "up" ? !Ue(i, a) || n.current === 0 ? null : (n.current === -1 ? (r.current = i, n.current = o.length - 1) : --n.current, o[n.current]) : n.current === -1 || !We(i, a) ? null : n.current < o.length - 1 ? (n.current += 1, o[n.current]) : (n.current = -1, r.current);
243
+ }, []), a = W(() => {
234
244
  n.current = -1, r.current = "";
235
- }, []), o = U(() => {
245
+ }, []), o = W(() => {
236
246
  n.current = -1, r.current = "";
237
247
  }, []);
238
- return G(() => ({
248
+ return K(() => ({
239
249
  navigate: i,
240
250
  notifyChange: a,
241
251
  reset: o
@@ -244,29 +254,29 @@ var J = {
244
254
  a,
245
255
  o
246
256
  ]);
247
- }, He = ({ messageProp: e, messageRevision: t }) => {
248
- let [n, r] = q(e), i = K(null);
249
- return W(() => {
257
+ }, Ke = ({ messageProp: e, messageRevision: t }) => {
258
+ let [n, r] = J(e), i = q(null);
259
+ return G(() => {
250
260
  r(e);
251
261
  }, [e, t]), {
252
262
  message: n,
253
263
  setMessage: r,
254
264
  textareaRef: i
255
265
  };
256
- }, Ue = (e, t, n, r = n) => {
266
+ }, qe = (e, t, n, r = n) => {
257
267
  let i = Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, "value")?.set;
258
268
  i ? i.call(e, t) : e.value = t, e.setSelectionRange(n, r), e.dispatchEvent(new Event("input", { bubbles: !0 }));
259
- }, We = (e) => e.key.toLowerCase() === "z" && (e.ctrlKey || e.metaKey) && !e.shiftKey && !e.altKey, Ge = ({ insertion: e, textareaRef: t }) => {
260
- let n = e?.revision, r = K(e?.text);
269
+ }, Je = (e) => e.key.toLowerCase() === "z" && (e.ctrlKey || e.metaKey) && !e.shiftKey && !e.altKey, Ye = ({ insertion: e, textareaRef: t }) => {
270
+ let n = e?.revision, r = q(e?.text);
261
271
  r.current = e?.text;
262
- let i = K(n), a = K(null), o = K(!1);
263
- return W(() => {
272
+ let i = q(n), a = q(null), o = q(!1);
273
+ return G(() => {
264
274
  document.activeElement === t.current && (o.current = !0);
265
275
  let e = (e) => {
266
276
  e.target === t.current && (o.current = !0);
267
277
  };
268
278
  return document.addEventListener("focusin", e), () => document.removeEventListener("focusin", e);
269
- }, [t]), W(() => {
279
+ }, [t]), G(() => {
270
280
  if (n === i.current) return;
271
281
  i.current = n;
272
282
  let e = r.current;
@@ -276,7 +286,7 @@ var J = {
276
286
  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;
277
287
  if (n.focus(), c && n.setSelectionRange(l, u), a.current = null, typeof document.execCommand == "function" && document.execCommand("insertText", !1, e)) return;
278
288
  let d = `${r.slice(0, l)}${e}${r.slice(u)}`;
279
- Ue(n, d, l + e.length), a.current = {
289
+ qe(n, d, l + e.length), a.current = {
280
290
  insertedValue: d,
281
291
  previousValue: r,
282
292
  previousSelectionStart: l,
@@ -286,69 +296,69 @@ var J = {
286
296
  }, [n, t]), {
287
297
  handleUndoKeyDown: (e) => {
288
298
  let n = a.current, r = t.current;
289
- return n == null || r == null || !We(e) || (a.current = null, r.value !== n.insertedValue) ? !1 : (e.preventDefault(), Ue(r, n.previousValue, n.previousSelectionStart, n.previousSelectionEnd), !0);
299
+ 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);
290
300
  },
291
301
  markCaretPlaced: () => {
292
302
  o.current = !0;
293
303
  }
294
304
  };
295
- }, Ke = /* @__PURE__ */ function(e) {
305
+ }, Xe = /* @__PURE__ */ function(e) {
296
306
  return e.Idle = "idle", e.Recording = "recording", e.Processing = "processing", e.Error = "error", e;
297
- }({}), qe = /* @__PURE__ */ function(e) {
307
+ }({}), Ze = /* @__PURE__ */ function(e) {
298
308
  return e.Dictation = "dictation", e.Attachment = "attachment", e;
299
- }({}), Je = [
309
+ }({}), Qe = [
300
310
  "audio/webm;codecs=opus",
301
311
  "audio/ogg;codecs=opus",
302
312
  "audio/webm"
303
- ], Ye = 100, Xe = 100, Ze = .01, Qe = ({ onAttachAudio: e, onTranscribeAudio: t, onTranscript: n, errorLabel: i = "Voice input failed" }) => {
304
- let [a, o] = q("idle"), [s, c] = q(null), l = K(null), d = K(null), f = K({
313
+ ], $e = 100, et = 100, tt = .01, nt = ({ onAttachAudio: e, onTranscribeAudio: t, onTranscript: n, errorLabel: i = "Voice input failed" }) => {
314
+ let [a, o] = J("idle"), [s, c] = J(null), l = q(null), u = q(null), d = q({
305
315
  onAttachAudio: e,
306
316
  onTranscribeAudio: t,
307
317
  onTranscript: n,
308
318
  errorLabel: i
309
319
  });
310
- f.current = {
320
+ d.current = {
311
321
  onAttachAudio: e,
312
322
  onTranscribeAudio: t,
313
323
  onTranscript: n,
314
324
  errorLabel: i
315
325
  };
316
- let p = U((e = "dictation") => {
317
- if (d.current) return;
326
+ let p = W((e = "dictation") => {
327
+ if (u.current) return;
318
328
  let t = { controller: new AbortController() };
319
- d.current = t, c(null), o("recording");
320
- let { signal: n } = t.controller, i = e === "dictation" ? f.current.onTranscribeAudio : void 0, a, s, p, m, h = !1, g = !1, _ = [], v = () => {
329
+ u.current = t, c(null), o("recording");
330
+ let { signal: n } = t.controller, i = e === "dictation" ? d.current.onTranscribeAudio : void 0, a, s, p, m, h = !1, g = !1, _ = [], v = () => {
321
331
  clearInterval(m), m = void 0;
322
332
  }, y = () => {
323
- v(), p &&= (p.ondataavailable = null, p.onstop = null, p.onerror = null, p.state !== "inactive" && p.stop(), void 0), a?.getTracks().forEach((e) => e.stop()), a = void 0, s &&= (s.close(), void 0), d.current === t && (l.current = null);
333
+ v(), p &&= (p.ondataavailable = null, p.onstop = null, p.onerror = null, p.state !== "inactive" && p.stop(), void 0), a?.getTracks().forEach((e) => e.stop()), a = void 0, s &&= (s.close(), void 0), u.current === t && (l.current = null);
324
334
  };
325
335
  n.addEventListener("abort", () => {
326
336
  _.length = 0, y();
327
337
  }, { once: !0 });
328
338
  let b = () => {
329
- n.aborted || (y(), d.current = null, c(null), o("idle"));
339
+ n.aborted || (y(), u.current = null, c(null), o("idle"));
330
340
  }, x = (e) => {
331
- n.aborted || (t.controller.abort(), d.current = null, c(e instanceof Error ? e.message : f.current.errorLabel), o("error"));
341
+ n.aborted || (t.controller.abort(), u.current = null, c(e instanceof Error ? e.message : d.current.errorLabel), o("error"));
332
342
  }, S = () => {
333
343
  if (!a || n.aborted) return;
334
- let e = Je.find((e) => MediaRecorder.isTypeSupported(e)), t = new MediaRecorder(a, e ? { mimeType: e } : void 0);
344
+ let e = Qe.find((e) => MediaRecorder.isTypeSupported(e)), t = new MediaRecorder(a, e ? { mimeType: e } : void 0);
335
345
  p = t;
336
- let s = Date.now(), c = !1, d = !1, S = new Uint8Array(l.current?.fftSize ?? 256), C = async () => {
346
+ let s = Date.now(), c = !1, u = !1, S = new Uint8Array(l.current?.fftSize ?? 256), C = async () => {
337
347
  if (!(g || n.aborted)) {
338
348
  g = !0, h = !0;
339
349
  try {
340
350
  let a = t.mimeType || e || "audio/webm", l = new Blob(_, { type: a });
341
351
  _.length = 0, y();
342
- let p = Date.now() - s >= Xe;
343
- if (l.size && (!i || p && (!c || d))) {
344
- let e = u(a), t = r[e] ?? e.split("/")[1] ?? "webm", s = new File([l], "voice-" + crypto.randomUUID() + "." + t, { type: a });
352
+ let p = Date.now() - s >= et;
353
+ if (l.size && (!i || p && (!c || u))) {
354
+ let e = f(a), t = r[e] ?? e.split("/")[1] ?? "webm", s = new File([l], "voice-" + crypto.randomUUID() + "." + t, { type: a });
345
355
  if (i) {
346
356
  o("processing");
347
357
  let e = await i(s, n);
348
358
  if (n.aborted) return;
349
- f.current.onTranscript?.(e);
350
- } else f.current.onAttachAudio(s);
351
- } else i && f.current.onTranscript?.("");
359
+ d.current.onTranscript?.(e);
360
+ } else d.current.onAttachAudio(s);
361
+ } else i && d.current.onTranscript?.("");
352
362
  b();
353
363
  } catch (e) {
354
364
  x(e);
@@ -357,7 +367,7 @@ var J = {
357
367
  };
358
368
  t.ondataavailable = (e) => {
359
369
  e.data.size && _.push(e.data);
360
- }, t.onerror = () => x(Error(f.current.errorLabel)), t.onstop = () => {
370
+ }, t.onerror = () => x(Error(d.current.errorLabel)), t.onstop = () => {
361
371
  C();
362
372
  }, t.start(), i && (m = setInterval(() => {
363
373
  let e = l.current;
@@ -365,8 +375,8 @@ var J = {
365
375
  e.getByteTimeDomainData(S), c = !0;
366
376
  let t = 0;
367
377
  for (let e of S) t += ((e - 128) / 128) ** 2;
368
- Math.sqrt(t / S.length) >= Ze && (d = !0, v());
369
- }, Ye));
378
+ Math.sqrt(t / S.length) >= tt && (u = !0, v());
379
+ }, $e));
370
380
  };
371
381
  t.stop = () => {
372
382
  h || n.aborted || (h = !0, v(), o("processing"), p?.state === "recording" && p.stop());
@@ -384,11 +394,11 @@ var J = {
384
394
  x(e);
385
395
  }
386
396
  })();
387
- }, []), m = U(() => d.current?.stop?.(), []), h = U(() => {
388
- d.current?.controller.abort(), d.current = null, c(null), o("idle");
397
+ }, []), m = W(() => u.current?.stop?.(), []), h = W(() => {
398
+ u.current?.controller.abort(), u.current = null, c(null), o("idle");
389
399
  }, []);
390
- return W(() => () => {
391
- d.current?.controller.abort(), d.current = null;
400
+ return G(() => () => {
401
+ u.current?.controller.abort(), u.current = null;
392
402
  }, []), {
393
403
  state: a,
394
404
  analyserNodeRef: l,
@@ -397,19 +407,19 @@ var J = {
397
407
  stopRecording: m,
398
408
  discardRecording: h
399
409
  };
400
- }, $e = /* @__PURE__ */ function(e) {
410
+ }, rt = /* @__PURE__ */ function(e) {
401
411
  return e.Enter = "enter", e.MetaEnter = "meta-enter", e;
402
- }({}), et = /* @__PURE__ */ function(e) {
412
+ }({}), it = /* @__PURE__ */ function(e) {
403
413
  return e.Stacked = "stacked", e.Inline = "inline", e;
404
- }({}), tt = {
414
+ }({}), at = {
405
415
  icon: "_icon_1fv6z_1",
406
416
  selectedIcon: "_selectedIcon_1fv6z_5"
407
- }, nt = ({ 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: f }) => {
408
- let m = c({
417
+ }, ot = ({ isOpen: e, onBack: t, backLabel: n = "Back", onClose: r, closeLabel: i = "Close", style: a, title: o = "Tools", items: s, onToolToggle: l, itemLabelClassName: u = "dial-small-text", colors: f }) => {
418
+ let p = c({
409
419
  "--tbs-icon-text": f?.iconText,
410
420
  "--tbs-selected-icon-text": f?.selectedIconText
411
421
  });
412
- return /* @__PURE__ */ V(Ie, {
422
+ return /* @__PURE__ */ H(Le, {
413
423
  isOpen: e,
414
424
  title: o,
415
425
  closeLabel: i,
@@ -417,137 +427,137 @@ var J = {
417
427
  onBack: t,
418
428
  backLabel: n,
419
429
  style: a,
420
- children: /* @__PURE__ */ V("div", {
430
+ children: /* @__PURE__ */ H("div", {
421
431
  role: "menu",
422
432
  "aria-label": o,
423
433
  className: "flex flex-col px-2 pb-4",
424
- style: m,
425
- children: s.map((e) => /* @__PURE__ */ V(k, {
434
+ style: p,
435
+ children: s.map((e) => /* @__PURE__ */ H(j, {
426
436
  role: "menuitemcheckbox",
427
437
  "aria-checked": e.isSelected,
428
- icon: /* @__PURE__ */ V("span", {
429
- className: l("flex items-center", tt.icon),
438
+ icon: /* @__PURE__ */ H("span", {
439
+ className: d("flex items-center", at.icon),
430
440
  children: e.icon
431
441
  }),
432
442
  label: e.label,
433
- labelClassName: d,
434
- trailing: e.isSelected ? /* @__PURE__ */ V("span", {
435
- className: l("flex", tt.selectedIcon),
436
- children: /* @__PURE__ */ V(ge, {
437
- size: p,
443
+ labelClassName: u,
444
+ trailing: e.isSelected ? /* @__PURE__ */ H("span", {
445
+ className: d("flex", at.selectedIcon),
446
+ children: /* @__PURE__ */ H(_e, {
447
+ size: h,
438
448
  "aria-hidden": !0,
439
- stroke: y
449
+ stroke: x
440
450
  })
441
451
  }) : void 0,
442
- onClick: () => u(e.id)
452
+ onClick: () => l(e.id)
443
453
  }, e.id))
444
454
  })
445
455
  });
446
- }, Y = {
456
+ }, X = {
447
457
  chip: "_chip_1lvv5_1",
448
458
  chipSelected: "_chipSelected_1lvv5_9",
449
459
  chipIcon: "_chipIcon_1lvv5_16",
450
460
  chipText: "_chipText_1lvv5_19",
451
461
  chipState: "_chipState_1lvv5_22",
452
462
  chipClose: "_chipClose_1lvv5_25"
453
- }, rt = (e) => `Remove ${e}`, it = ({ items: e, onToolToggle: t, onToolDismiss: n, canRemove: r = !0, removeLabel: i = rt, stateOnLabel: a, stateOffLabel: o, typography: s, colors: u }) => {
463
+ }, st = (e) => `Remove ${e}`, ct = ({ items: e, onToolToggle: t, onToolDismiss: n, canRemove: r = !0, removeLabel: i = st, stateOnLabel: a, stateOffLabel: o, typography: s, colors: l }) => {
454
464
  if (e.length === 0) return null;
455
- let d = !!(a && o), f = c({
456
- "--ci-chip-bg": u?.chipBg,
457
- "--ci-chip-border": u?.chipBorder,
458
- "--ci-chip-icon": u?.chipIcon,
459
- "--ci-chip-text": u?.chipText,
460
- "--ci-chip-hover-bg": u?.chipHoverBg,
461
- "--ci-chip-selected-bg": u?.chipSelectedBg,
462
- "--ci-chip-selected-bg-hover": u?.chipSelectedHoverBg,
463
- "--ci-chip-selected-border": u?.chipSelectedBorder,
464
- "--ci-chip-selected-icon": u?.chipSelectedIcon,
465
- "--ci-chip-selected-text": u?.chipSelectedText,
466
- "--ci-chip-state-text": u?.chipStateText,
467
- "--ci-chip-close": u?.chipClose,
468
- "--ci-chip-close-hover": u?.chipCloseHover
469
- }), p = (e) => /* @__PURE__ */ V("span", {
470
- className: l(Y.chipIcon, "flex shrink-0"),
465
+ let u = !!(a && o), f = c({
466
+ "--ci-chip-bg": l?.chipBg,
467
+ "--ci-chip-border": l?.chipBorder,
468
+ "--ci-chip-icon": l?.chipIcon,
469
+ "--ci-chip-text": l?.chipText,
470
+ "--ci-chip-hover-bg": l?.chipHoverBg,
471
+ "--ci-chip-selected-bg": l?.chipSelectedBg,
472
+ "--ci-chip-selected-bg-hover": l?.chipSelectedHoverBg,
473
+ "--ci-chip-selected-border": l?.chipSelectedBorder,
474
+ "--ci-chip-selected-icon": l?.chipSelectedIcon,
475
+ "--ci-chip-selected-text": l?.chipSelectedText,
476
+ "--ci-chip-state-text": l?.chipStateText,
477
+ "--ci-chip-close": l?.chipClose,
478
+ "--ci-chip-close-hover": l?.chipCloseHover
479
+ }), p = (e) => /* @__PURE__ */ H("span", {
480
+ className: d(X.chipIcon, "flex shrink-0"),
471
481
  children: e.icon
472
- }), m = (e) => /* @__PURE__ */ H("span", {
473
- className: "flex min-w-0 items-center",
474
- children: [/* @__PURE__ */ H("span", {
475
- className: l(Y.chipText, s?.fontClassName || "dial-small-paragraph-text", "truncate"),
476
- children: [e.label, d && /* @__PURE__ */ V("span", {
482
+ }), m = (e) => /* @__PURE__ */ U("span", {
483
+ className: "flex min-w-0 items-baseline",
484
+ children: [/* @__PURE__ */ U("span", {
485
+ className: d(X.chipText, s?.fontClassName || "dial-small-paragraph-text", "truncate"),
486
+ children: [e.label, u && /* @__PURE__ */ H("span", {
477
487
  "aria-hidden": !0,
478
488
  children: ":"
479
489
  })]
480
- }), d && /* @__PURE__ */ V("span", {
481
- className: l(Y.chipState, s?.stateClassName || "dial-tiny-lead-text", "ms-1 shrink-0"),
490
+ }), u && /* @__PURE__ */ H("span", {
491
+ className: d(X.chipState, s?.stateClassName || "dial-tiny-lead-text", "ms-1 shrink-0"),
482
492
  "aria-hidden": !0,
483
493
  children: e.isSelected ? a : o
484
494
  })]
485
495
  });
486
- return /* @__PURE__ */ V("div", {
496
+ return /* @__PURE__ */ H("div", {
487
497
  className: "flex flex-wrap items-center gap-2",
488
498
  style: f,
489
- children: e.map((e) => r ? /* @__PURE__ */ H("div", {
490
- className: l(Y.chip, e.isSelected && Y.chipSelected, "flex min-w-0 items-center gap-1.5 rounded-full border py-1 ps-2 pe-1 transition-colors"),
491
- children: [/* @__PURE__ */ H("button", {
499
+ children: e.map((e) => r ? /* @__PURE__ */ U("div", {
500
+ className: d(X.chip, e.isSelected && X.chipSelected, "flex min-w-0 items-center gap-1.5 rounded-full border py-1 ps-2 pe-1 transition-colors"),
501
+ children: [/* @__PURE__ */ U("button", {
492
502
  type: "button",
493
503
  onClick: () => t(e.id),
494
504
  "aria-pressed": e.isSelected,
495
505
  className: "flex min-w-0 items-center gap-1.5",
496
- children: [/* @__PURE__ */ V("span", {
506
+ children: [/* @__PURE__ */ H("span", {
497
507
  className: "flex shrink-0",
498
508
  "aria-hidden": !0,
499
509
  children: p(e)
500
510
  }), m(e)]
501
- }), /* @__PURE__ */ V("button", {
511
+ }), /* @__PURE__ */ H("button", {
502
512
  type: "button",
503
513
  onClick: () => n(e.id),
504
514
  "aria-label": i(e.label),
505
- className: l(Y.chipClose, "flex shrink-0 items-center rounded p-0.5 transition-colors"),
506
- children: /* @__PURE__ */ V(Ee, {
515
+ className: d(X.chipClose, "flex shrink-0 items-center rounded p-0.5 transition-colors"),
516
+ children: /* @__PURE__ */ H(De, {
507
517
  size: 12,
508
518
  "aria-hidden": !0,
509
- stroke: y
519
+ stroke: x
510
520
  })
511
521
  })]
512
- }, e.id) : /* @__PURE__ */ V(ce, {
522
+ }, e.id) : /* @__PURE__ */ H(ue, {
513
523
  icon: p(e),
514
524
  label: m(e),
515
525
  isSelected: e.isSelected,
516
526
  onToggle: () => t(e.id),
517
- className: l(Y.chip, e.isSelected && Y.chipSelected, "h-auto min-w-0 gap-1.5 border px-2 py-1 transition-colors")
527
+ className: d(X.chip, e.isSelected && X.chipSelected, "h-auto min-w-0 gap-1.5 border px-2 py-1 transition-colors")
518
528
  }, e.id))
519
529
  });
520
- }, at = (e, t) => `Tools: ${e} of ${t} on`, ot = ({ items: e, title: t = "Tools", summaryLabel: n = at, onClick: r, fontClassName: i = "dial-small-paragraph-text", countClassName: a = "dial-tiny-lead-text" }) => {
530
+ }, lt = (e, t) => `Tools: ${e} of ${t} on`, ut = ({ items: e, title: t = "Tools", summaryLabel: n = lt, onClick: r, fontClassName: i = "dial-small-paragraph-text", countClassName: a = "dial-tiny-lead-text" }) => {
521
531
  if (e.length === 0) return null;
522
532
  let o = e.filter((e) => e.isSelected).length, s = o > 0;
523
- return /* @__PURE__ */ H("button", {
533
+ return /* @__PURE__ */ U("button", {
524
534
  type: "button",
525
535
  onClick: r,
526
536
  "aria-haspopup": "dialog",
527
537
  "aria-label": n(o, e.length),
528
- className: l(Y.chip, s && Y.chipSelected, "flex min-w-0 items-center gap-1.5 rounded-full border px-2 py-1 transition-colors"),
538
+ className: d(X.chip, s && X.chipSelected, "flex min-w-0 items-center gap-1.5 rounded-full border px-2 py-1 transition-colors"),
529
539
  children: [
530
- /* @__PURE__ */ V("span", {
531
- className: l(Y.chipIcon, "flex shrink-0"),
532
- children: /* @__PURE__ */ V(Te, {
540
+ /* @__PURE__ */ H("span", {
541
+ className: d(X.chipIcon, "flex shrink-0"),
542
+ children: /* @__PURE__ */ H(Ee, {
533
543
  size: 16,
534
544
  "aria-hidden": !0,
535
- stroke: y
545
+ stroke: x
536
546
  })
537
547
  }),
538
- /* @__PURE__ */ V("span", {
539
- className: l(Y.chipText, i, "truncate"),
548
+ /* @__PURE__ */ H("span", {
549
+ className: d(X.chipText, i, "truncate"),
540
550
  "aria-hidden": !0,
541
551
  children: t
542
552
  }),
543
- s && /* @__PURE__ */ V("span", {
544
- className: l(Y.chipState, a, "shrink-0"),
553
+ s && /* @__PURE__ */ H("span", {
554
+ className: d(X.chipState, a, "shrink-0"),
545
555
  "aria-hidden": !0,
546
556
  children: o
547
557
  })
548
558
  ]
549
559
  });
550
- }, X = {
560
+ }, Z = {
551
561
  wrapper: "_wrapper_13067_2",
552
562
  wrapperDisabled: "_wrapperDisabled_13067_9",
553
563
  textarea: "_textarea_13067_13",
@@ -562,33 +572,33 @@ var J = {
562
572
  modelSelectorName: "_modelSelectorName_13067_85",
563
573
  modelSelectorVersion: "_modelSelectorVersion_13067_88",
564
574
  modelSelectorButtonDisabled: "_modelSelectorButtonDisabled_13067_97"
565
- }, st = {
575
+ }, dt = {
566
576
  waveformCanvas: "_waveformCanvas_18zb5_1",
567
577
  recordingDot: "_recordingDot_18zb5_15",
568
578
  "recording-pulse": "_recording-pulse_18zb5_1"
569
- }, ct = 3, lt = 4, ut = 200, dt = ({ state: e, analyserNodeRef: t, onStop: n, onDiscard: r, attachButton: i, stopLabel: a = "Stop recording", discardLabel: o = "Discard recording", processingLabel: s = "Transcribing audio…", style: c, className: u, embedded: d = !1 }) => {
570
- let f = K(null), p = K(new Float32Array(ut)), m = K(0), h = K(0), g = e === Ke.Recording, _ = e === Ke.Processing, b = U((e) => {
579
+ }, ft = 3, pt = 4, mt = 200, ht = ({ 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: l, embedded: u = !1 }) => {
580
+ let f = q(null), p = q(new Float32Array(mt)), m = q(0), h = q(0), g = e === Xe.Recording, _ = e === Xe.Processing, v = W((e) => {
571
581
  let t = e.getContext("2d");
572
582
  if (!t) return;
573
583
  e.width = e.clientWidth || 200, e.height = e.clientHeight || 32;
574
584
  let { width: n, height: r } = e;
575
585
  t.clearRect(0, 0, n, r), t.fillStyle = getComputedStyle(e).color;
576
- let i = Math.min(Math.max(1, Math.floor(n / lt)), 199), a = m.current, o = h.current;
586
+ let i = Math.min(Math.max(1, Math.floor(n / pt)), 199), a = m.current, o = h.current;
577
587
  t.save(), t.beginPath(), t.rect(0, 0, n, r), t.clip(), t.translate(-o, 0);
578
588
  for (let e = 0; e <= i; e++) {
579
- let n = ((a - i + e) % ut + ut) % ut, o = p.current[n] ?? 0, s = Math.min(1, o * 6), c = Math.max(3, s * r);
580
- t.fillRect(e * lt, (r - c) / 2, ct, c);
589
+ let n = ((a - i + e) % mt + mt) % mt, o = p.current[n] ?? 0, s = Math.min(1, o * 6), c = Math.max(3, s * r);
590
+ t.fillRect(e * pt, (r - c) / 2, ft, c);
581
591
  }
582
592
  t.restore();
583
593
  }, []);
584
- W(() => {
594
+ G(() => {
585
595
  if (!g) return;
586
596
  let e = f.current;
587
597
  if (!e) return;
588
598
  p.current.fill(0), m.current = 0, h.current = 0;
589
599
  let n, r = () => {
590
- if (h.current += 1, h.current >= lt) {
591
- h.current -= lt;
600
+ if (h.current += 1, h.current >= pt) {
601
+ h.current -= pt;
592
602
  let e = t.current;
593
603
  if (e) {
594
604
  let t = new Uint8Array(e.frequencyBinCount);
@@ -598,10 +608,10 @@ var J = {
598
608
  let r = (t[e] - 128) / 128;
599
609
  n += r * r;
600
610
  }
601
- p.current[m.current % ut] = Math.sqrt(n / t.length), m.current++;
611
+ p.current[m.current % mt] = Math.sqrt(n / t.length), m.current++;
602
612
  }
603
613
  }
604
- b(e), n = requestAnimationFrame(r);
614
+ v(e), n = requestAnimationFrame(r);
605
615
  };
606
616
  return n = requestAnimationFrame(r), () => {
607
617
  cancelAnimationFrame(n);
@@ -609,97 +619,97 @@ var J = {
609
619
  }, [
610
620
  g,
611
621
  t,
612
- b
613
- ]), W(() => {
622
+ v
623
+ ]), G(() => {
614
624
  let e = f.current;
615
625
  if (!e) return;
616
626
  let t = new ResizeObserver(() => {
617
- b(e);
627
+ v(e);
618
628
  });
619
629
  return t.observe(e), () => t.disconnect();
620
- }, [b]);
621
- let x = /* @__PURE__ */ H("div", {
630
+ }, [v]);
631
+ let y = /* @__PURE__ */ U("div", {
622
632
  className: "flex shrink-0 items-center justify-end gap-1",
623
633
  children: [
624
- /* @__PURE__ */ V(M, {
625
- icon: /* @__PURE__ */ V(Ee, {
626
- size: v.LG,
634
+ /* @__PURE__ */ H(P, {
635
+ icon: /* @__PURE__ */ H(De, {
636
+ size: b.LG,
627
637
  "aria-hidden": !0,
628
- stroke: y
638
+ stroke: x
629
639
  }),
630
640
  "aria-label": o,
631
641
  className: "mobile:min-h-11 mobile:min-w-11",
632
642
  onClick: r
633
643
  }),
634
- g && /* @__PURE__ */ V(R, {
635
- icon: /* @__PURE__ */ V(ge, {
636
- size: v.LG,
644
+ g && /* @__PURE__ */ H(z, {
645
+ icon: /* @__PURE__ */ H(_e, {
646
+ size: b.LG,
637
647
  "aria-hidden": !0,
638
- stroke: y
648
+ stroke: x
639
649
  }),
640
650
  onClick: () => n?.(),
641
651
  autoFocus: !0,
642
652
  "aria-label": a,
643
653
  className: "mobile:min-h-11 mobile:min-w-11"
644
654
  }),
645
- _ && /* @__PURE__ */ V("span", {
655
+ _ && /* @__PURE__ */ H("span", {
646
656
  className: "flex size-[40px] shrink-0 items-center justify-center mobile:min-h-11 mobile:min-w-11",
647
- children: /* @__PURE__ */ V(ae, {
657
+ children: /* @__PURE__ */ H(se, {
648
658
  size: 20,
649
659
  ariaLabel: s
650
660
  })
651
661
  })
652
662
  ]
653
663
  });
654
- return /* @__PURE__ */ V("div", {
655
- className: u,
656
- children: /* @__PURE__ */ H("div", {
664
+ return /* @__PURE__ */ H("div", {
665
+ className: l,
666
+ children: /* @__PURE__ */ U("div", {
657
667
  style: c,
658
- className: l("flex w-full min-w-0 flex-col justify-center gap-2", !d && X.wrapper, !d && "min-h-[64px] max-w-[748px] rounded-xl border px-3 shadow-md"),
659
- children: [/* @__PURE__ */ H("div", {
668
+ className: d("flex w-full min-w-0 flex-col justify-center gap-2", !u && Z.wrapper, !u && "min-h-[64px] max-w-[748px] rounded-xl border px-3 shadow-md"),
669
+ children: [/* @__PURE__ */ U("div", {
660
670
  className: "flex min-w-0 flex-1 items-center gap-3",
661
- children: [g && /* @__PURE__ */ V("span", {
662
- className: l(st.recordingDot, "pointer-events-none block size-[8px] rounded-3xl"),
671
+ children: [g && /* @__PURE__ */ H("span", {
672
+ className: d(dt.recordingDot, "pointer-events-none block size-[8px] rounded-3xl"),
663
673
  "aria-hidden": !0
664
- }), /* @__PURE__ */ V("canvas", {
674
+ }), /* @__PURE__ */ H("canvas", {
665
675
  ref: f,
666
676
  height: 26,
667
677
  "aria-hidden": !0,
668
- className: l(st.waveformCanvas, "h-[26px] min-w-0 flex-1")
678
+ className: d(dt.waveformCanvas, "h-[26px] min-w-0 flex-1")
669
679
  })]
670
- }), /* @__PURE__ */ H("div", {
680
+ }), /* @__PURE__ */ U("div", {
671
681
  className: "flex items-center justify-between gap-2",
672
- children: [i ?? /* @__PURE__ */ V("span", { "aria-hidden": !0 }), x]
682
+ children: [i ?? /* @__PURE__ */ H("span", { "aria-hidden": !0 }), y]
673
683
  })]
674
684
  })
675
685
  });
676
- }, ft = ({ onSend: e, isDisabled: t = !1, ariaLabel: n = "Send message", sendTooltip: r }) => /* @__PURE__ */ V(R, {
686
+ }, gt = ({ onSend: e, isDisabled: t = !1, ariaLabel: n = "Send message", sendTooltip: r }) => /* @__PURE__ */ H(z, {
677
687
  "aria-label": n,
678
688
  onClick: () => e?.(),
679
689
  disabled: t,
680
690
  tooltipProps: r ? { tooltip: r } : void 0,
681
- icon: /* @__PURE__ */ V(he, {
682
- size: v.LG,
691
+ icon: /* @__PURE__ */ H(ge, {
692
+ size: b.LG,
683
693
  className: "rtl:scale-x-[-1]",
684
- stroke: y
694
+ stroke: x
685
695
  })
686
- }), pt = ({ onStop: e, ariaLabel: t = "Stop streaming" }) => /* @__PURE__ */ V(M, {
687
- icon: /* @__PURE__ */ V(Se, {
688
- size: v.LG,
689
- stroke: y
696
+ }), _t = ({ onStop: e, ariaLabel: t = "Stop streaming" }) => /* @__PURE__ */ H(P, {
697
+ icon: /* @__PURE__ */ H(Ce, {
698
+ size: b.LG,
699
+ stroke: x
690
700
  }),
691
701
  onClick: () => e?.(),
692
702
  "aria-label": t
693
- }), mt = (e, t, n, r, i) => {
703
+ }), vt = (e, t, n, r, i) => {
694
704
  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) => {
695
705
  if (n <= t) return;
696
706
  let r = t;
697
707
  o.filter((e) => e.offset >= t && e.offset <= n).forEach((t) => {
698
- t.offset > r && s.push(/* @__PURE__ */ V("span", {
708
+ t.offset > r && s.push(/* @__PURE__ */ H("span", {
699
709
  "aria-hidden": !0,
700
710
  children: e.slice(r, t.offset)
701
711
  }, `text-${l++}`)), s.push(t.node), r = t.offset;
702
- }), r < n && s.push(/* @__PURE__ */ V("span", {
712
+ }), r < n && s.push(/* @__PURE__ */ H("span", {
703
713
  "aria-hidden": !0,
704
714
  children: e.slice(r, n)
705
715
  }, `text-${l++}`));
@@ -707,16 +717,16 @@ var J = {
707
717
  return a.forEach((t, n) => {
708
718
  if (u(c, t.start), t.start + t.length <= c) return;
709
719
  let a = e.slice(t.start, t.start + t.length);
710
- s.push(t.render ? /* @__PURE__ */ V("span", {
720
+ s.push(t.render ? /* @__PURE__ */ H("span", {
711
721
  className: "pointer-events-auto",
712
722
  children: t.render()
713
- }, `range-${n}`) : /* @__PURE__ */ V("span", {
723
+ }, `range-${n}`) : /* @__PURE__ */ H("span", {
714
724
  "aria-hidden": !0,
715
725
  className: t.isUnsupported ? i : r,
716
726
  children: a
717
727
  }, `range-${n}`)), c = Math.max(c, t.start + t.length);
718
728
  }), u(c, e.length), s;
719
- }, ht = (e, t) => {
729
+ }, yt = (e, t) => {
720
730
  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;
721
731
  for (let e = n.nextNode(); e != null; e = n.nextNode()) {
722
732
  let n = e.textContent?.length ?? 0;
@@ -727,24 +737,24 @@ var J = {
727
737
  r += n;
728
738
  }
729
739
  return null;
730
- }, gt = (e, t, n) => {
731
- let r = ht(e, t), i = ht(e, n);
740
+ }, bt = (e, t, n) => {
741
+ let r = yt(e, t), i = yt(e, n);
732
742
  if (r == null || i == null) return null;
733
743
  let a = document.createRange();
734
744
  return a.setStart(r.node, r.offset), a.setEnd(i.node, i.offset), a;
735
- }, _t = ({ textareaRef: e, message: t, isMirrorActive: n }) => {
736
- let r = K(null), [i, a] = q([]), o = U(() => {
745
+ }, xt = ({ textareaRef: e, message: t, isMirrorActive: n }) => {
746
+ let r = q(null), [i, a] = J([]), o = W(() => {
737
747
  let t = e.current, n = r.current;
738
748
  if (t == null || n == null) return;
739
749
  let i = t.offsetWidth > t.clientWidth;
740
750
  n.style.scrollbarGutter = i ? "stable" : "", n.scrollTop = t.scrollTop;
741
- }, [e]), s = U(() => {
751
+ }, [e]), s = W(() => {
742
752
  let t = e.current, i = r.current, o = t?.selectionStart, s = t?.selectionEnd;
743
753
  if (!n || t == null || i == null || o == null || s == null || o === s) {
744
754
  a((e) => e.length === 0 ? e : []);
745
755
  return;
746
756
  }
747
- let c = gt(i, o, s);
757
+ let c = bt(i, o, s);
748
758
  if (c == null) {
749
759
  a((e) => e.length === 0 ? e : []);
750
760
  return;
@@ -752,14 +762,14 @@ var J = {
752
762
  let l = i.getBoundingClientRect();
753
763
  a(Array.from(c.getClientRects()).map((e) => new DOMRect(e.left - l.left, e.top - l.top + i.scrollTop, e.width, e.height)));
754
764
  }, [n, e]);
755
- return Ne(() => {
765
+ return Pe(() => {
756
766
  n && o(), s();
757
767
  }, [
758
768
  n,
759
769
  o,
760
770
  s,
761
771
  t
762
- ]), W(() => {
772
+ ]), G(() => {
763
773
  if (!n) return;
764
774
  let t = e.current;
765
775
  if (t == null || typeof ResizeObserver > "u") return;
@@ -778,8 +788,8 @@ var J = {
778
788
  updateSelectionRects: s,
779
789
  syncMirrorToTextarea: o
780
790
  };
781
- }, vt = ({ commandMenu: e, message: t, textareaRef: n, hasActiveMentions: r, markerOffset: i, triggerEnd: a, hasCommandEmptyQueryHint: o }) => {
782
- let s = K(null), c = K(null), [l, u] = q(null), d = U(() => {
791
+ }, St = ({ commandMenu: e, message: t, textareaRef: n, hasActiveMentions: r, markerOffset: i, triggerEnd: a, hasCommandEmptyQueryHint: o }) => {
792
+ let s = q(null), c = q(null), [l, u] = J(null), d = W(() => {
783
793
  let e = s.current, t = c.current;
784
794
  if (e == null || t == null) {
785
795
  u(null);
@@ -791,7 +801,7 @@ var J = {
791
801
  top: n.top - r.top
792
802
  });
793
803
  }, []);
794
- W(() => {
804
+ G(() => {
795
805
  if (i == null) return;
796
806
  let e = n.current;
797
807
  if (e == null || typeof ResizeObserver > "u") return;
@@ -802,19 +812,19 @@ var J = {
802
812
  n,
803
813
  d
804
814
  ]);
805
- let f = G(() => {
815
+ let f = K(() => {
806
816
  let t = [];
807
817
  return i != null && t.push({
808
818
  offset: i,
809
- node: /* @__PURE__ */ V("span", {
819
+ node: /* @__PURE__ */ H("span", {
810
820
  ref: s,
811
821
  "aria-hidden": !0,
812
822
  className: "inline-block h-lh w-0 align-text-top"
813
823
  }, "caret-marker")
814
824
  }), o && e != null && a != null && t.push({
815
825
  offset: a,
816
- node: /* @__PURE__ */ V("span", {
817
- className: X.commandHint,
826
+ node: /* @__PURE__ */ H("span", {
827
+ className: Z.commandHint,
818
828
  "aria-hidden": !0,
819
829
  "data-mirror-synthetic": !0,
820
830
  children: e.emptyQueryHint
@@ -825,12 +835,12 @@ var J = {
825
835
  o,
826
836
  e,
827
837
  a
828
- ]), p = r || f.length > 0, { mirrorRef: m, selectionRects: h, updateSelectionRects: g, syncMirrorToTextarea: _ } = _t({
838
+ ]), p = r || f.length > 0, { mirrorRef: m, selectionRects: h, updateSelectionRects: g, syncMirrorToTextarea: _ } = xt({
829
839
  textareaRef: n,
830
840
  message: t,
831
841
  isMirrorActive: p
832
842
  });
833
- return Ne(() => {
843
+ return Pe(() => {
834
844
  d();
835
845
  }, [
836
846
  d,
@@ -848,31 +858,31 @@ var J = {
848
858
  _(), i != null && d();
849
859
  }
850
860
  };
851
- }, yt = (e, t) => {
861
+ }, Ct = (e, t) => {
852
862
  let n = t;
853
863
  for (; n < e.length && !/\s/.test(e[n]);) n++;
854
864
  return n;
855
- }, bt = (e, t) => {
865
+ }, wt = (e, t) => {
856
866
  let n = t;
857
867
  for (; n > 0 && !/\s/.test(e[n - 1]);) n--;
858
868
  return {
859
869
  start: n,
860
- end: yt(e, n)
870
+ end: Ct(e, n)
861
871
  };
862
- }, xt = (e, t) => e.startsWith(t) && !e.slice(t.length).includes(t), St = "[role=\"option\"]:not([aria-disabled=\"true\"])", Ct = /* @__PURE__ */ function(e) {
872
+ }, Tt = (e, t) => e.startsWith(t) && !e.slice(t.length).includes(t), Et = "[role=\"option\"]:not([aria-disabled=\"true\"])", Dt = /* @__PURE__ */ function(e) {
863
873
  return e.Next = "next", e.Previous = "previous", e;
864
- }({}), wt = ({ config: e, message: t }) => {
865
- let [n, r] = q(!1), [i, a] = q(null), [o, s] = q(null), c = K(null);
874
+ }({}), Ot = ({ config: e, message: t }) => {
875
+ let [n, r] = J(!1), [i, a] = J(null), [o, s] = J(null), c = q(null);
866
876
  c.current = i;
867
877
  let l = e != null && i != null && i <= t.length ? (() => {
868
- let n = t.slice(i, yt(t, i));
869
- return xt(n, e.triggerPrefix) ? n.slice(e.triggerPrefix.length) : "";
870
- })() : "", u = U((t, n, i) => {
878
+ let n = t.slice(i, Ct(t, i));
879
+ return Tt(n, e.triggerPrefix) ? n.slice(e.triggerPrefix.length) : "";
880
+ })() : "", u = W((t, n, i) => {
871
881
  if (e == null || i) return;
872
- let { start: c, end: l } = bt(t, n), u = t.slice(c, l);
873
- xt(u, e.triggerPrefix) ? (a(c), u === e.triggerPrefix || o !== c ? (r(!0), s(null)) : r(!1)) : (r(!1), s(null), a(null));
882
+ let { start: c, end: l } = wt(t, n), u = t.slice(c, l);
883
+ Tt(u, e.triggerPrefix) ? (a(c), u === e.triggerPrefix || o !== c ? (r(!0), s(null)) : r(!1)) : (r(!1), s(null), a(null));
874
884
  }, [e, o]);
875
- W(() => {
885
+ G(() => {
876
886
  if (e == null) {
877
887
  r(!1), s(null), a(null);
878
888
  return;
@@ -880,25 +890,25 @@ var J = {
880
890
  let n = c.current;
881
891
  if (n == null) return;
882
892
  let i = Math.min(n, t.length);
883
- xt(t.slice(i, yt(t, i)), e.triggerPrefix) || (r(!1), s(null), a(null));
893
+ Tt(t.slice(i, Ct(t, i)), e.triggerPrefix) || (r(!1), s(null), a(null));
884
894
  }, [e, t]);
885
- let d = U(() => {
895
+ let d = W(() => {
886
896
  r(!1), s(i);
887
- }, [i]), f = U(() => {
897
+ }, [i]), f = W(() => {
888
898
  r(!1);
889
- }, []), p = U((n) => {
899
+ }, []), p = W((n) => {
890
900
  if (e == null) return;
891
- let { start: i, end: s } = bt(t, n);
892
- xt(t.slice(i, s), e.triggerPrefix) ? (a(i), r(o !== i)) : (a(null), r(!1));
901
+ let { start: i, end: s } = wt(t, n);
902
+ Tt(t.slice(i, s), e.triggerPrefix) ? (a(i), r(o !== i)) : (a(null), r(!1));
893
903
  }, [
894
904
  e,
895
905
  t,
896
906
  o
897
- ]), m = je(), h = K(null), [g, _] = q(null);
898
- W(() => {
907
+ ]), m = Me(), h = q(null), [g, _] = J(null);
908
+ G(() => {
899
909
  _(null);
900
910
  }, [n, l]);
901
- let v = U(() => Array.from(h.current?.querySelectorAll(St) ?? []), []), y = U((e) => {
911
+ let v = W(() => Array.from(h.current?.querySelectorAll(Et) ?? []), []), y = W((e) => {
902
912
  let t = v();
903
913
  if (t.length === 0) {
904
914
  _(null);
@@ -906,7 +916,7 @@ var J = {
906
916
  }
907
917
  let n = t.findIndex((e) => e.id === g), r = t[e === "next" ? (n + 1) % t.length : (n <= 0 ? t.length : n) - 1];
908
918
  _(r.id), r.scrollIntoView?.({ block: "nearest" });
909
- }, [v, g]), b = U(() => v().find((e) => e.id === g) ?? null, [v, g]);
919
+ }, [v, g]), b = W(() => v().find((e) => e.id === g) ?? null, [v, g]);
910
920
  return {
911
921
  isMenuOpen: n,
912
922
  query: l,
@@ -921,22 +931,22 @@ var J = {
921
931
  moveActiveOption: y,
922
932
  getActiveOption: b
923
933
  };
924
- }, Tt = ({ commandMenu: e, message: t, setMessage: n, textareaRef: r, historyNav: i, onChange: a, caretPositionOverride: o, messageRevision: s, markCaretPlaced: c, sendOnEnter: l }) => {
925
- let { isMenuOpen: u, query: d, activeWordStart: f, dismiss: p, closeOnOutsidePress: m, handleCaretMove: h, handleValueChange: g, listboxId: _, overlayRef: v, activeOptionId: y, moveActiveOption: b, getActiveOption: x } = wt({
934
+ }, kt = ({ commandMenu: e, message: t, setMessage: n, textareaRef: r, historyNav: i, onChange: a, caretPositionOverride: o, messageRevision: s, markCaretPlaced: c, sendOnEnter: l }) => {
935
+ let { isMenuOpen: u, query: d, activeWordStart: f, dismiss: p, closeOnOutsidePress: m, handleCaretMove: h, handleValueChange: g, listboxId: _, overlayRef: v, activeOptionId: y, moveActiveOption: b, getActiveOption: x } = Ot({
926
936
  config: e,
927
937
  message: t
928
- }), S = K(h);
938
+ }), S = q(h);
929
939
  S.current = h;
930
940
  let C = () => {
931
941
  h(r.current?.selectionStart ?? t.length);
932
- }, w = K(!1), T = () => {
942
+ }, w = q(!1), T = () => {
933
943
  w.current ? w.current = !1 : requestAnimationFrame(() => {
934
944
  let e = r.current;
935
945
  S.current(e?.selectionStart ?? e?.value.length ?? 0);
936
946
  });
937
947
  }, E = (e) => {
938
948
  (e.key === "ArrowLeft" || e.key === "ArrowRight" || e.key === "Home" || e.key === "End" || e.key === "PageUp" || e.key === "PageDown") && h(e.currentTarget.selectionStart ?? t.length);
939
- }, D = e?.emptyQueryHint != null, O = e != null && f != null ? f + e.triggerPrefix.length : null, k = O != null && t.slice(O).split("\n", 1)[0] !== "", A = D && u && d === "" && O != null && !k, j = e != null && u ? f ?? 0 : null, M = U((o) => {
949
+ }, D = e?.emptyQueryHint != null, O = e != null && f != null ? f + e.triggerPrefix.length : null, k = O != null && t.slice(O).split("\n", 1)[0] !== "", A = D && u && d === "" && O != null && !k, j = e != null && u ? f ?? 0 : null, M = W((o) => {
940
950
  if (e == null || (p(), !o?.consumeQuery) || (o.returnFocus !== !1 && r.current?.focus(), f == null)) return;
941
951
  let s = `${e.triggerPrefix}${d}`, c = f + s.length;
942
952
  if (t.slice(f, c) !== s) return;
@@ -952,11 +962,11 @@ var J = {
952
962
  i,
953
963
  a,
954
964
  r
955
- ]), N = K(void 0);
956
- W(() => {
965
+ ]), N = q(void 0);
966
+ G(() => {
957
967
  o != null && N.current !== s && (N.current = s, r.current?.setSelectionRange(o, o), c(), h(o));
958
968
  }, [t]);
959
- let P = (e) => l === $e.MetaEnter ? (e.metaKey || e.ctrlKey) && !e.shiftKey : !e.shiftKey && !e.metaKey && !e.ctrlKey;
969
+ let P = (e) => l === rt.MetaEnter ? (e.metaKey || e.ctrlKey) && !e.shiftKey : !e.shiftKey && !e.metaKey && !e.ctrlKey;
960
970
  return {
961
971
  isMenuOpen: u,
962
972
  query: d,
@@ -978,18 +988,18 @@ var J = {
978
988
  handleCommandMenuKeyDown: (e) => {
979
989
  if (!u || e.nativeEvent.isComposing) return !1;
980
990
  if (e.key === "Escape") return e.preventDefault(), e.stopPropagation(), p(), !0;
981
- if (e.key === "ArrowDown" || e.key === "ArrowUp") return e.preventDefault(), b(e.key === "ArrowDown" ? Ct.Next : Ct.Previous), !0;
991
+ if (e.key === "ArrowDown" || e.key === "ArrowUp") return e.preventDefault(), b(e.key === "ArrowDown" ? Dt.Next : Dt.Previous), !0;
982
992
  if (e.key !== "Enter" || e.shiftKey) return !1;
983
993
  let t = x();
984
994
  return t == null ? P(e) ? (e.preventDefault(), !0) : !1 : (e.preventDefault(), t.click(), !0);
985
995
  }
986
996
  };
987
- }, Et = ({ toolsMenuItems: e, canRemoveTools: t, onToolToggle: n }) => {
988
- let [r, i] = q([]), a = (e ?? []).map((e) => e.id).join("|");
989
- return W(() => {
997
+ }, At = ({ toolsMenuItems: e, canRemoveTools: t, onToolToggle: n }) => {
998
+ let [r, i] = J([]), a = (e ?? []).map((e) => e.id).join("|");
999
+ return G(() => {
990
1000
  i([]);
991
1001
  }, [a]), {
992
- visibleTools: G(() => {
1002
+ visibleTools: K(() => {
993
1003
  let n = e ?? [];
994
1004
  return t ? n.filter((e) => e.isSelected || !r.includes(e.id)) : n;
995
1005
  }, [
@@ -997,13 +1007,13 @@ var J = {
997
1007
  r,
998
1008
  t
999
1009
  ]),
1000
- handleToolDismiss: U((t) => {
1010
+ handleToolDismiss: W((t) => {
1001
1011
  i((e) => e.includes(t) ? e : [...e, t]), e?.find((e) => e.id === t)?.isSelected && n?.(t);
1002
1012
  }, [e, n])
1003
1013
  };
1004
- }, Dt = ({ addAttachments: e, isAttachmentsEnabled: t, isTextAttachmentsAllowed: n, pasteTextThreshold: r, maxMessageLength: i, onMessageTooLong: a, commandMenu: o }) => {
1005
- let s = t && n, { handlePaste: c } = me(e, s ? r : Infinity);
1006
- return U((e) => {
1014
+ }, jt = ({ addAttachments: e, isAttachmentsEnabled: t, isTextAttachmentsAllowed: n, pasteTextThreshold: r, maxMessageLength: i, onMessageTooLong: a, commandMenu: o }) => {
1015
+ let s = t && n, { handlePaste: c } = he(e, s ? r : Infinity);
1016
+ return W((e) => {
1007
1017
  if (!s) {
1008
1018
  let t = e.clipboardData.getData("text/plain");
1009
1019
  t.length >= i && a?.(t.length, i);
@@ -1018,7 +1028,7 @@ var J = {
1018
1028
  c,
1019
1029
  o
1020
1030
  ]);
1021
- }, Ot = ({ message: e, setMessage: t, attachments: n, resetAttachments: r, historyNav: i, onSend: a, onMessageTooLong: o, maxMessageLength: s, isSendDisabled: c, isVoiceActive: l, isInputDisabled: u, isStreaming: d, canSend: f, hasModelSelected: p, handleUndoKeyDown: m, handleCommandMenuKeyDown: h, isSendGesture: g, onBackspaceAtCaret: _ }) => {
1031
+ }, Mt = ({ message: e, setMessage: t, attachments: n, resetAttachments: r, historyNav: i, onSend: a, onMessageTooLong: o, maxMessageLength: s, isSendDisabled: c, isVoiceActive: l, isInputDisabled: u, isStreaming: d, canSend: f, hasModelSelected: p, handleUndoKeyDown: m, handleCommandMenuKeyDown: h, isSendGesture: g, onBackspaceAtCaret: _ }) => {
1022
1032
  let v = async () => {
1023
1033
  if (c || l) return;
1024
1034
  if (e.length >= s) {
@@ -1052,7 +1062,7 @@ var J = {
1052
1062
  if (t != null) {
1053
1063
  n.preventDefault();
1054
1064
  let r = n.currentTarget;
1055
- r.setSelectionRange(t.start, t.start + t.length), typeof document.execCommand == "function" && document.execCommand("delete", !1) || Ue(r, e.slice(0, t.start) + e.slice(t.start + t.length), t.start);
1065
+ r.setSelectionRange(t.start, t.start + t.length), typeof document.execCommand == "function" && document.execCommand("delete", !1) || qe(r, e.slice(0, t.start) + e.slice(t.start + t.length), t.start);
1056
1066
  return;
1057
1067
  }
1058
1068
  }
@@ -1061,16 +1071,16 @@ var J = {
1061
1071
  }
1062
1072
  }
1063
1073
  };
1064
- }, kt = ({ addAttachments: e, buildAttachments: t, draftRef: n, setMessage: r, historyNav: i, onChange: a, onTranscribeAudio: o, voiceErrorLabel: s, textareaRef: c, skipFocusMenuEvaluationRef: l }) => {
1065
- let u = U((n) => {
1074
+ }, Nt = ({ addAttachments: e, buildAttachments: t, draftRef: n, setMessage: r, historyNav: i, onChange: a, onTranscribeAudio: o, voiceErrorLabel: s, textareaRef: c, skipFocusMenuEvaluationRef: l }) => {
1075
+ let u = W((n) => {
1066
1076
  e(t([n]));
1067
- }, [e, t]), d = K(!1), [f, p] = q({
1077
+ }, [e, t]), d = q(!1), [f, p] = J({
1068
1078
  text: "",
1069
1079
  revision: 0
1070
- }), { state: m, analyserNodeRef: h, errorMessage: g, startRecording: _, stopRecording: v, discardRecording: y } = Qe({
1080
+ }), { state: m, analyserNodeRef: h, errorMessage: g, startRecording: _, stopRecording: v, discardRecording: y } = nt({
1071
1081
  onAttachAudio: u,
1072
1082
  onTranscribeAudio: o,
1073
- onTranscript: U((e) => {
1083
+ onTranscript: W((e) => {
1074
1084
  let t = e.trim();
1075
1085
  if (t) {
1076
1086
  let e = n.current, o = `${e}${e && !/\s$/.test(e) ? " " : ""}${t}`;
@@ -1087,9 +1097,9 @@ var J = {
1087
1097
  a
1088
1098
  ]),
1089
1099
  errorLabel: s
1090
- }), b = m === Ke.Recording || m === Ke.Processing;
1091
- return W(() => {
1092
- if (m === Ke.Error || m === Ke.Idle && d.current) {
1100
+ }), b = m === Xe.Recording || m === Xe.Processing;
1101
+ return G(() => {
1102
+ if (m === Xe.Error || m === Xe.Idle && d.current) {
1093
1103
  d.current = !1;
1094
1104
  let e = c.current;
1095
1105
  if (e != null) {
@@ -1112,7 +1122,7 @@ var J = {
1112
1122
  isVoiceActive: b,
1113
1123
  latestTranscript: f
1114
1124
  };
1115
- }, At = (e) => c({
1125
+ }, Pt = (e) => c({
1116
1126
  "--ci-bg": e?.background,
1117
1127
  "--ci-text": e?.text,
1118
1128
  "--ci-border": e?.border,
@@ -1131,10 +1141,10 @@ var J = {
1131
1141
  "--ci-mention-highlight-unsupported-bg": e?.mentionHighlightUnsupportedBg,
1132
1142
  "--ci-mention-highlight-unsupported-text": e?.mentionHighlightUnsupportedText,
1133
1143
  "--ci-selection-highlight-bg": e?.selectionHighlightBg
1134
- }), jt = {
1144
+ }), Ft = {
1135
1145
  item: "_item_1sr2n_1",
1136
1146
  itemIcon: "_itemIcon_1sr2n_11"
1137
- }, Mt = ({ 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 }) => {
1147
+ }, It = ({ isOpen: e, title: t, closeLabel: n, onClose: r, style: i, items: a, className: o, titleClassName: s = "dial-body-semi-text", itemLabelClassName: l = "dial-small-text", btnTextClassName: u = "", colors: f }) => {
1138
1148
  let p = (e) => {
1139
1149
  e(), r();
1140
1150
  }, m = c({
@@ -1143,7 +1153,7 @@ var J = {
1143
1153
  "--ci-sheet-item-active": f?.itemActiveBg,
1144
1154
  "--ci-sheet-icon": f?.itemIcon
1145
1155
  });
1146
- return /* @__PURE__ */ V(Ie, {
1156
+ return /* @__PURE__ */ H(Le, {
1147
1157
  isOpen: e,
1148
1158
  title: t,
1149
1159
  closeLabel: n,
@@ -1152,33 +1162,33 @@ var J = {
1152
1162
  className: o,
1153
1163
  titleClassName: s,
1154
1164
  colors: f?.shell,
1155
- children: /* @__PURE__ */ V("ul", {
1165
+ children: /* @__PURE__ */ H("ul", {
1156
1166
  role: "list",
1157
1167
  className: "flex flex-col",
1158
1168
  style: m,
1159
- children: a.map(({ key: e, label: t, icon: n, iconAfter: r, onClick: i }) => /* @__PURE__ */ V("li", { children: /* @__PURE__ */ V(h, {
1169
+ children: a.map(({ key: e, label: t, icon: n, iconAfter: r, onClick: i }) => /* @__PURE__ */ H("li", { children: /* @__PURE__ */ H(_, {
1160
1170
  type: "button",
1161
- className: l(jt.item, "w-full gap-3 px-4 py-[10px] text-start"),
1162
- iconBefore: /* @__PURE__ */ V("span", {
1163
- className: jt.itemIcon,
1171
+ className: d(Ft.item, "w-full gap-3 px-4 py-[10px] text-start"),
1172
+ iconBefore: /* @__PURE__ */ H("span", {
1173
+ className: Ft.itemIcon,
1164
1174
  children: n
1165
1175
  }),
1166
- iconAfter: r ? /* @__PURE__ */ V("span", {
1176
+ iconAfter: r ? /* @__PURE__ */ H("span", {
1167
1177
  className: "ms-auto",
1168
1178
  children: r
1169
1179
  }) : null,
1170
- textClassName: d,
1171
- label: /* @__PURE__ */ V("span", {
1172
- className: u,
1180
+ textClassName: u,
1181
+ label: /* @__PURE__ */ H("span", {
1182
+ className: l,
1173
1183
  children: t
1174
1184
  }),
1175
1185
  onClick: () => p(i)
1176
1186
  }) }, e))
1177
1187
  })
1178
1188
  });
1179
- }, Nt = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, isOpen: o }) => {
1180
- let [s, c] = q(t), [l, u] = q(n), [d, f] = q(r), p = K(o);
1181
- W(() => {
1189
+ }, Lt = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, isOpen: o }) => {
1190
+ let [s, c] = J(t), [l, u] = J(n), [d, f] = J(r), p = q(o);
1191
+ G(() => {
1182
1192
  o && !p.current && (c(t), u(n), f(r)), p.current = o;
1183
1193
  }, [
1184
1194
  o,
@@ -1195,7 +1205,7 @@ var J = {
1195
1205
  setResponseFormat: c,
1196
1206
  setSystemPrompt: u,
1197
1207
  setTemperature: f,
1198
- handleSubmit: U(() => {
1208
+ handleSubmit: W(() => {
1199
1209
  if (!m) return;
1200
1210
  let t = {};
1201
1211
  e.responseFormat && s != null && (t.responseFormat = s), e.systemPrompt && (t.systemPrompt = l), e.temperature && (t.temperature = d), i(t), a();
@@ -1209,25 +1219,25 @@ var J = {
1209
1219
  a
1210
1220
  ])
1211
1221
  };
1212
- }, Pt = { label: "_label_14i7c_1" }, Ft = ({ 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 = [
1222
+ }, Q = { label: "_label_14i7c_1" }, Rt = ({ features: e, responseFormat: t, systemPrompt: n, temperature: r, onResponseFormatChange: a, onSystemPromptChange: s, onTemperatureChange: l, responseFormatLabel: u = "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 = [
1213
1223
  "Precise",
1214
1224
  "Neutral",
1215
1225
  "Creative"
1216
1226
  ], temperatureHint: y, labelClassName: b = "!dial-small-semi-text", colors: x }) => {
1217
- let S = c({ "--csf-label-text": x?.labelText }), C = l(b, Pt.label, "gap-1");
1218
- return /* @__PURE__ */ H("div", {
1227
+ let S = c({ "--csf-label-text": x?.labelText }), C = d(b, Q.label, "gap-1");
1228
+ return /* @__PURE__ */ U("div", {
1219
1229
  className: "flex flex-col gap-4 px-6 pb-3",
1220
1230
  style: S,
1221
1231
  children: [
1222
- e.responseFormat && /* @__PURE__ */ V(z, {
1232
+ e.responseFormat && /* @__PURE__ */ H(B, {
1223
1233
  id: "response-format",
1224
1234
  labelProps: {
1225
- label: d,
1235
+ label: u,
1226
1236
  className: C,
1227
1237
  caption: f
1228
1238
  },
1229
1239
  optionsClassName: "mb-2",
1230
- orientation: B.Column,
1240
+ orientation: ne.Column,
1231
1241
  value: t ?? o.Markdown,
1232
1242
  items: [{
1233
1243
  value: o.Markdown,
@@ -1238,18 +1248,18 @@ var J = {
1238
1248
  }],
1239
1249
  onChange: (e) => a(e)
1240
1250
  }),
1241
- e.systemPrompt && /* @__PURE__ */ V(oe, {
1251
+ e.systemPrompt && /* @__PURE__ */ H(ce, {
1242
1252
  value: n,
1243
1253
  placeholder: g,
1244
1254
  className: i,
1245
- resize: se.Vertical,
1255
+ resize: le.Vertical,
1246
1256
  labelProps: {
1247
1257
  className: C,
1248
1258
  label: h
1249
1259
  },
1250
1260
  onChange: (e) => s(e ?? "")
1251
1261
  }),
1252
- e.temperature && /* @__PURE__ */ V(ie, {
1262
+ e.temperature && /* @__PURE__ */ H(oe, {
1253
1263
  labelProps: {
1254
1264
  label: _,
1255
1265
  className: C,
@@ -1262,21 +1272,21 @@ var J = {
1262
1272
  labels: v,
1263
1273
  showTooltip: !0,
1264
1274
  showTicks: !0,
1265
- onChange: u
1275
+ onChange: l
1266
1276
  })
1267
1277
  ]
1268
1278
  });
1269
- }, It = ({ 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 }) => {
1270
- let { responseFormat: w, systemPrompt: T, temperature: E, canSubmit: D, setResponseFormat: O, setSystemPrompt: k, setTemperature: A, handleSubmit: j } = Nt({
1279
+ }, $ = ({ isOpen: e, onBack: t, backLabel: n, onClose: r, closeLabel: i, style: a, features: o, initialResponseFormat: s, initialSystemPrompt: c, initialTemperature: l, onSave: u, 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 }) => {
1280
+ let { responseFormat: w, systemPrompt: T, temperature: E, canSubmit: D, setResponseFormat: O, setSystemPrompt: k, setTemperature: A, handleSubmit: j } = Lt({
1271
1281
  isOpen: e,
1272
1282
  features: o,
1273
1283
  initialResponseFormat: s,
1274
1284
  initialSystemPrompt: c,
1275
- initialTemperature: u,
1276
- onSave: d,
1285
+ initialTemperature: l,
1286
+ onSave: u,
1277
1287
  onClose: r
1278
1288
  });
1279
- return /* @__PURE__ */ H(Ie, {
1289
+ return /* @__PURE__ */ U(Le, {
1280
1290
  isOpen: e,
1281
1291
  title: f,
1282
1292
  closeLabel: i,
@@ -1284,7 +1294,7 @@ var J = {
1284
1294
  onBack: t,
1285
1295
  backLabel: n,
1286
1296
  style: a,
1287
- children: [/* @__PURE__ */ V(Ft, {
1297
+ children: [/* @__PURE__ */ H(Rt, {
1288
1298
  features: o,
1289
1299
  responseFormat: w,
1290
1300
  systemPrompt: T,
@@ -1301,13 +1311,13 @@ var J = {
1301
1311
  temperatureLabel: y,
1302
1312
  temperatureLabels: b,
1303
1313
  temperatureHint: x
1304
- }), /* @__PURE__ */ V("div", {
1305
- className: l("px-6 py-4 mobile:pb-8"),
1306
- children: /* @__PURE__ */ V(le, {
1314
+ }), /* @__PURE__ */ H("div", {
1315
+ className: d("px-6 py-4 mobile:pb-8"),
1316
+ children: /* @__PURE__ */ H(de, {
1307
1317
  tooltip: C,
1308
1318
  hideTooltip: D || !C,
1309
1319
  triggerClassName: "w-full",
1310
- children: /* @__PURE__ */ V(L, {
1320
+ children: /* @__PURE__ */ H(R, {
1311
1321
  label: S,
1312
1322
  onClick: j,
1313
1323
  disabled: !D,
@@ -1316,8 +1326,8 @@ var J = {
1316
1326
  })
1317
1327
  })]
1318
1328
  });
1319
- }, Z = { modal: "_modal_kl0h0_1" }, Lt = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, title: o = "Chat settings", titleClassName: s = "dial-h1-text", responseFormatLabel: l, responseFormatHint: u, responseFormatMarkdownLabel: d, responseFormatPlainTextLabel: f, systemPromptLabel: p, systemPromptTooltip: m, temperatureLabel: h, temperatureLabels: _, temperatureHint: v, saveLabel: y = "Apply changes", saveDisabledTooltip: b, backgroundClassName: x = Z.modal, colors: S }) => {
1320
- let { responseFormat: C, systemPrompt: w, temperature: T, canSubmit: E, setResponseFormat: D, setSystemPrompt: O, setTemperature: k, handleSubmit: A } = Nt({
1329
+ }, zt = { modal: "_modal_kl0h0_1" }, Bt = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, title: o = "Chat settings", titleClassName: s = "dial-h1-text", responseFormatLabel: l, responseFormatHint: u, responseFormatMarkdownLabel: d, responseFormatPlainTextLabel: f, systemPromptLabel: p, systemPromptTooltip: m, temperatureLabel: h, temperatureLabels: g, temperatureHint: _, saveLabel: y = "Apply changes", saveDisabledTooltip: b, backgroundClassName: x = zt.modal, colors: S }) => {
1330
+ let { responseFormat: C, systemPrompt: w, temperature: T, canSubmit: E, setResponseFormat: D, setSystemPrompt: O, setTemperature: k, handleSubmit: A } = Lt({
1321
1331
  features: e,
1322
1332
  initialResponseFormat: t,
1323
1333
  initialSystemPrompt: n,
@@ -1325,17 +1335,17 @@ var J = {
1325
1335
  onSave: i,
1326
1336
  onClose: a
1327
1337
  });
1328
- return /* @__PURE__ */ V(F, {
1338
+ return /* @__PURE__ */ H(te, {
1329
1339
  open: !0,
1330
1340
  header: o,
1331
1341
  titleClassName: s,
1332
- size: I.Sm,
1342
+ size: L.Sm,
1333
1343
  onClose: a,
1334
1344
  className: x,
1335
1345
  overlayStyle: c({ "--csm-bg": S?.background }),
1336
1346
  mainButtons: [{
1337
1347
  label: y,
1338
- variant: g.Primary,
1348
+ variant: v.Primary,
1339
1349
  onClick: A,
1340
1350
  disabled: !E,
1341
1351
  tooltipProps: b ? {
@@ -1343,7 +1353,7 @@ var J = {
1343
1353
  hideTooltip: E
1344
1354
  } : void 0
1345
1355
  }],
1346
- children: /* @__PURE__ */ V(Ft, {
1356
+ children: /* @__PURE__ */ H(Rt, {
1347
1357
  features: e,
1348
1358
  responseFormat: C,
1349
1359
  systemPrompt: w,
@@ -1358,53 +1368,53 @@ var J = {
1358
1368
  systemPromptLabel: p,
1359
1369
  systemPromptTooltip: m,
1360
1370
  temperatureLabel: h,
1361
- temperatureLabels: _,
1362
- temperatureHint: v
1371
+ temperatureLabels: g,
1372
+ temperatureHint: _
1363
1373
  })
1364
1374
  });
1365
- }, Q = {
1375
+ }, Vt = {
1366
1376
  toolIcon: "_toolIcon_ma5s5_1",
1367
1377
  chevronIcon: "_chevronIcon_ma5s5_5"
1368
- }, Rt = ({ onAttachClick: e, onRecordVoice: t, recordVoiceLabel: n = "Record voice", attachLabel: r, addMenuTitle: i, menuTitle: a, menuCloseLabel: s, style: u, listClassName: m = "w-[240px]", isDisabled: h = !1, chatSettings: g, extraMenuItems: _, toolsMenuItems: x = [], onToolToggle: S, toolsMenuTitle: C = "Tools", toolsBackLabel: T = "Back", menuOverlays: E, getCaretPosition: D, colors: O }) => {
1369
- let k = d(), j = f(), [M, N] = q(!1), P = K(0), [ee, F] = q(!1), [I, L] = q(!1), [R, z] = q(!1), [B, te] = q(null), ne = U((e) => {
1370
- e && (P.current = 0), F(e), e || (z(!1), te(null));
1371
- }, []), re = K(j);
1372
- W(() => {
1373
- re.current !== j && (re.current = j, j ? (N(ee && !R && B === null), F(!1)) : (P.current = R || B !== null ? -1 : 0, F(M || R || B !== null), N(!1)));
1378
+ }, Ht = ({ onAttachClick: e, onRecordVoice: t, recordVoiceLabel: n = "Record voice", attachLabel: r, addMenuTitle: i, menuTitle: a, menuCloseLabel: s, style: l, listClassName: u = "w-[240px]", isDisabled: f = !1, chatSettings: g, extraMenuItems: _, toolsMenuItems: v = [], onToolToggle: y, toolsMenuTitle: C = "Tools", toolsBackLabel: w = "Back", menuOverlays: T, getCaretPosition: D, colors: O }) => {
1379
+ let k = p(), A = m(), [j, N] = J(!1), P = q(0), [ee, F] = J(!1), [I, te] = J(!1), [L, R] = J(!1), [z, B] = J(null), ne = W((e) => {
1380
+ e && (P.current = 0), F(e), e || (R(!1), B(null));
1381
+ }, []), re = q(A);
1382
+ G(() => {
1383
+ re.current !== A && (re.current = A, A ? (N(ee && !L && z === null), F(!1)) : (P.current = L || z !== null ? -1 : 0, F(j || L || z !== null), N(!1)));
1374
1384
  }, [
1375
- j,
1385
+ A,
1376
1386
  ee,
1377
- M,
1378
- R,
1379
- B
1387
+ j,
1388
+ L,
1389
+ z
1380
1390
  ]);
1381
- let ie = G(() => c({
1391
+ let ie = K(() => c({
1382
1392
  "--aab-tool-icon": O?.toolIcon,
1383
1393
  "--aab-chevron-icon": O?.chevronIcon
1384
- }), [O?.toolIcon, O?.chevronIcon]), ae = x.length > 0 && S != null, oe = G(() => x.map((e) => ({
1394
+ }), [O?.toolIcon, O?.chevronIcon]), ae = v.length > 0 && y != null, oe = K(() => v.map((e) => ({
1385
1395
  key: e.id,
1386
1396
  label: e.label,
1387
- icon: /* @__PURE__ */ V("span", {
1397
+ icon: /* @__PURE__ */ H("span", {
1388
1398
  style: ie,
1389
- className: l("flex items-center", Q.toolIcon),
1399
+ className: d("flex items-center", Vt.toolIcon),
1390
1400
  children: e.icon
1391
1401
  }),
1392
1402
  selectable: !0,
1393
- mark: A.Check,
1403
+ mark: M.Check,
1394
1404
  checked: e.isSelected,
1395
- onClick: () => S?.(e.id)
1405
+ onClick: () => y?.(e.id)
1396
1406
  })), [
1397
- x,
1398
- S,
1407
+ v,
1408
+ y,
1399
1409
  ie
1400
- ]), se = G(() => [
1410
+ ]), se = K(() => [
1401
1411
  ...e == null ? [] : [{
1402
1412
  key: "attach",
1403
1413
  label: r,
1404
- icon: /* @__PURE__ */ V(xe, {
1405
- size: p,
1414
+ icon: /* @__PURE__ */ H(Se, {
1415
+ size: h,
1406
1416
  "aria-hidden": !0,
1407
- stroke: y
1417
+ stroke: x
1408
1418
  }),
1409
1419
  onClick: e
1410
1420
  }],
@@ -1412,45 +1422,45 @@ var J = {
1412
1422
  ...ae ? [{
1413
1423
  key: "tools",
1414
1424
  label: C,
1415
- icon: /* @__PURE__ */ V(Te, {
1416
- size: p,
1425
+ icon: /* @__PURE__ */ H(Ee, {
1426
+ size: h,
1417
1427
  "aria-hidden": !0,
1418
- stroke: y
1428
+ stroke: x
1419
1429
  }),
1420
- onClick: j ? () => {
1421
- z(!0);
1430
+ onClick: A ? () => {
1431
+ R(!0);
1422
1432
  } : () => void 0,
1423
- ...j ? { iconAfter: /* @__PURE__ */ V(ve, {
1424
- size: p,
1425
- stroke: y,
1433
+ ...A ? { iconAfter: /* @__PURE__ */ H(ye, {
1434
+ size: h,
1435
+ stroke: x,
1426
1436
  style: ie,
1427
- className: l("rtl:scale-x-[-1]", Q.chevronIcon),
1437
+ className: d("rtl:scale-x-[-1]", Vt.chevronIcon),
1428
1438
  "aria-hidden": !0
1429
1439
  }) } : {
1430
1440
  children: oe,
1431
- subMenuOpen: R,
1441
+ subMenuOpen: L,
1432
1442
  onSubMenuOpenChange: (e) => {
1433
- z(e), e && te(null);
1443
+ R(e), e && B(null);
1434
1444
  }
1435
1445
  }
1436
1446
  }] : [],
1437
- ...(E ?? []).map((e) => ({
1447
+ ...(T ?? []).map((e) => ({
1438
1448
  key: e.key,
1439
1449
  label: e.title,
1440
1450
  icon: e.icon,
1441
- onClick: j ? () => {
1442
- te(e.key);
1451
+ onClick: A ? () => {
1452
+ B(e.key);
1443
1453
  } : () => void 0,
1444
- ...j ? { iconAfter: /* @__PURE__ */ V(ve, {
1445
- size: p,
1446
- stroke: y,
1454
+ ...A ? { iconAfter: /* @__PURE__ */ H(ye, {
1455
+ size: h,
1456
+ stroke: x,
1447
1457
  style: ie,
1448
- className: l("rtl:scale-x-[-1]", Q.chevronIcon),
1458
+ className: d("rtl:scale-x-[-1]", Vt.chevronIcon),
1449
1459
  "aria-hidden": !0
1450
1460
  }) } : {
1451
- subMenuOpen: B === e.key,
1461
+ subMenuOpen: z === e.key,
1452
1462
  onSubMenuOpenChange: (t) => {
1453
- te((n) => t ? e.key : n === e.key ? null : n), t && z(!1);
1463
+ B((n) => t ? e.key : n === e.key ? null : n), t && R(!1);
1454
1464
  },
1455
1465
  renderSubMenu: () => e.renderOverlay(() => ne(!1), D?.() ?? 0)
1456
1466
  }
@@ -1458,10 +1468,10 @@ var J = {
1458
1468
  ...t == null ? [] : [{
1459
1469
  key: "record-voice",
1460
1470
  label: n,
1461
- icon: /* @__PURE__ */ V(be, {
1462
- size: p,
1471
+ icon: /* @__PURE__ */ H(xe, {
1472
+ size: h,
1463
1473
  "aria-hidden": !0,
1464
- stroke: y
1474
+ stroke: x
1465
1475
  }),
1466
1476
  onClick: () => {
1467
1477
  ne(!1), t();
@@ -1470,19 +1480,19 @@ var J = {
1470
1480
  ...g == null ? [] : [{
1471
1481
  key: "chat-settings",
1472
1482
  label: g.menuItemLabel ?? "Chat settings",
1473
- icon: /* @__PURE__ */ V(we, {
1474
- size: p,
1483
+ icon: /* @__PURE__ */ H(Te, {
1484
+ size: h,
1475
1485
  "aria-hidden": !0,
1476
- stroke: y
1486
+ stroke: x
1477
1487
  }),
1478
- iconAfter: k ? /* @__PURE__ */ V(ve, {
1479
- size: p,
1480
- stroke: y,
1488
+ iconAfter: k ? /* @__PURE__ */ H(ye, {
1489
+ size: h,
1490
+ stroke: x,
1481
1491
  style: ie,
1482
- className: l("rtl:scale-x-[-1]", Q.chevronIcon),
1492
+ className: d("rtl:scale-x-[-1]", Vt.chevronIcon),
1483
1493
  "aria-hidden": !0
1484
1494
  }) : null,
1485
- onClick: () => L(!0)
1495
+ onClick: () => te(!0)
1486
1496
  }]
1487
1497
  ], [
1488
1498
  ne,
@@ -1493,101 +1503,101 @@ var J = {
1493
1503
  g,
1494
1504
  _,
1495
1505
  k,
1496
- j,
1506
+ A,
1497
1507
  ae,
1498
- R,
1499
- B,
1508
+ L,
1509
+ z,
1500
1510
  C,
1501
1511
  oe,
1502
- E,
1512
+ T,
1503
1513
  D,
1504
1514
  ie
1505
1515
  ]);
1506
1516
  if (se.length === 0) return null;
1507
- let ce = /* @__PURE__ */ V(b, {
1517
+ let ce = /* @__PURE__ */ H(S, {
1508
1518
  matchReferenceWidth: !1,
1509
1519
  placement: "bottom-start",
1510
- listClassName: m,
1520
+ listClassName: u,
1511
1521
  initialFocus: P.current,
1512
1522
  overlayAriaLabel: i,
1513
1523
  items: se,
1514
- disabled: h,
1524
+ disabled: f,
1515
1525
  open: ee,
1516
1526
  onOpenChange: ne,
1517
- children: /* @__PURE__ */ V(w, {
1518
- icon: /* @__PURE__ */ V(Ce, {
1519
- size: v.LG,
1527
+ children: /* @__PURE__ */ H(E, {
1528
+ icon: /* @__PURE__ */ H(we, {
1529
+ size: b.LG,
1520
1530
  "aria-hidden": !0,
1521
- stroke: y
1531
+ stroke: x
1522
1532
  }),
1523
1533
  "aria-label": i,
1524
1534
  "aria-haspopup": "menu",
1525
1535
  tooltipProps: { tooltip: i },
1526
- disabled: h
1536
+ disabled: f
1527
1537
  })
1528
1538
  });
1529
- return /* @__PURE__ */ H(ue, { children: [
1530
- j ? /* @__PURE__ */ H(ue, { children: [
1531
- /* @__PURE__ */ V(w, {
1532
- icon: /* @__PURE__ */ V(Ce, {
1533
- size: v.LG,
1539
+ return /* @__PURE__ */ U(V, { children: [
1540
+ A ? /* @__PURE__ */ U(V, { children: [
1541
+ /* @__PURE__ */ H(E, {
1542
+ icon: /* @__PURE__ */ H(we, {
1543
+ size: b.LG,
1534
1544
  "aria-hidden": !0,
1535
- stroke: y
1545
+ stroke: x
1536
1546
  }),
1537
1547
  "aria-label": i,
1538
1548
  tooltipProps: { tooltip: i },
1539
- disabled: h,
1549
+ disabled: f,
1540
1550
  onClick: () => N(!0)
1541
1551
  }),
1542
- /* @__PURE__ */ V(Mt, {
1543
- isOpen: M,
1552
+ /* @__PURE__ */ H(It, {
1553
+ isOpen: j,
1544
1554
  title: a,
1545
1555
  closeLabel: s,
1546
1556
  onClose: () => N(!1),
1547
- style: u,
1557
+ style: l,
1548
1558
  items: se,
1549
1559
  className: "pb-4",
1550
1560
  btnTextClassName: "flex-1"
1551
1561
  }),
1552
- ae && /* @__PURE__ */ V(nt, {
1553
- isOpen: R,
1562
+ ae && /* @__PURE__ */ H(ot, {
1563
+ isOpen: L,
1554
1564
  onBack: () => {
1555
- z(!1), N(!0);
1565
+ R(!1), N(!0);
1556
1566
  },
1557
- backLabel: T,
1567
+ backLabel: w,
1558
1568
  onClose: () => ne(!1),
1559
1569
  closeLabel: s,
1560
- style: u,
1570
+ style: l,
1561
1571
  title: C,
1562
- items: x,
1563
- onToolToggle: S
1572
+ items: v,
1573
+ onToolToggle: y
1564
1574
  }),
1565
- E?.map((e) => /* @__PURE__ */ V(Ie, {
1566
- isOpen: B === e.key,
1575
+ T?.map((e) => /* @__PURE__ */ H(Le, {
1576
+ isOpen: z === e.key,
1567
1577
  title: e.title,
1568
1578
  closeLabel: s,
1569
1579
  onBack: () => {
1570
- te(null), N(!0);
1580
+ B(null), N(!0);
1571
1581
  },
1572
1582
  backLabel: e.backLabel ?? "Back",
1573
1583
  onClose: () => ne(!1),
1574
- style: u,
1575
- children: /* @__PURE__ */ V("div", {
1584
+ style: l,
1585
+ children: /* @__PURE__ */ H("div", {
1576
1586
  role: "menu",
1577
1587
  "aria-label": e.title,
1578
1588
  children: e.renderOverlay(() => ne(!1), D?.() ?? 0)
1579
1589
  })
1580
1590
  }, e.key))
1581
- ] }) : /* @__PURE__ */ V(ue, { children: ce }),
1582
- k && g != null && /* @__PURE__ */ V(It, {
1591
+ ] }) : /* @__PURE__ */ H(V, { children: ce }),
1592
+ k && g != null && /* @__PURE__ */ H($, {
1583
1593
  isOpen: I,
1584
1594
  onBack: () => {
1585
- L(!1), j ? N(!0) : F(!0);
1595
+ te(!1), A ? N(!0) : F(!0);
1586
1596
  },
1587
1597
  backLabel: g.backLabel ?? "Back",
1588
- onClose: () => L(!1),
1598
+ onClose: () => te(!1),
1589
1599
  closeLabel: s,
1590
- style: u,
1600
+ style: l,
1591
1601
  features: g.features,
1592
1602
  initialResponseFormat: g.responseFormat ?? o.Markdown,
1593
1603
  initialSystemPrompt: g.systemPrompt,
@@ -1606,13 +1616,13 @@ var J = {
1606
1616
  saveLabel: g.saveLabel,
1607
1617
  saveDisabledTooltip: g.saveDisabledTooltip
1608
1618
  }),
1609
- !k && g != null && I && /* @__PURE__ */ V(Lt, {
1619
+ !k && g != null && I && /* @__PURE__ */ H(Bt, {
1610
1620
  features: g.features,
1611
1621
  initialResponseFormat: g.responseFormat ?? o.Markdown,
1612
1622
  initialSystemPrompt: g.systemPrompt,
1613
1623
  initialTemperature: g.temperature,
1614
1624
  onSave: g.onSave,
1615
- onClose: () => L(!1),
1625
+ onClose: () => te(!1),
1616
1626
  title: g.title,
1617
1627
  responseFormatLabel: g.responseFormatLabel,
1618
1628
  responseFormatHint: g.responseFormatHint,
@@ -1628,20 +1638,20 @@ var J = {
1628
1638
  colors: g.modalColors
1629
1639
  })
1630
1640
  ] });
1631
- }, zt = ({ fileInputRef: e, textareaRef: t, message: n, style: r, hideAttachFile: i, isInputDisabled: a, isStreaming: o, isAttachmentsEnabled: s, isVoiceRecordingSupported: c, isVoiceActive: l, startRecording: u, isPhone: d, canRemoveTools: f, toolsMenuItems: m, onToolToggle: h, chatSettings: g, menuOverlays: _, onDialFileSystemClick: v, dialFileSystemLabel: b, attachLabel: x, addMenuTitle: S, menuTitle: C, menuCloseLabel: w, recordVoiceLabel: T, toolsMenuTitle: E, toolsBackLabel: D }) => {
1632
- let O = G(() => v ? [{
1641
+ }, Ut = ({ fileInputRef: e, textareaRef: t, message: n, style: r, hideAttachFile: i, isInputDisabled: a, isStreaming: o, isAttachmentsEnabled: s, isVoiceRecordingSupported: c, isVoiceActive: l, startRecording: u, isPhone: d, canRemoveTools: f, toolsMenuItems: p, onToolToggle: m, chatSettings: g, menuOverlays: _, onDialFileSystemClick: v, dialFileSystemLabel: y, attachLabel: b, addMenuTitle: S, menuTitle: C, menuCloseLabel: w, recordVoiceLabel: T, toolsMenuTitle: E, toolsBackLabel: D }) => {
1642
+ let O = K(() => v ? [{
1633
1643
  key: "dial-fs",
1634
- label: b ?? "DIAL file system",
1635
- icon: /* @__PURE__ */ V(ye, {
1636
- size: p,
1644
+ label: y ?? "DIAL file system",
1645
+ icon: /* @__PURE__ */ H(be, {
1646
+ size: h,
1637
1647
  "aria-hidden": !0,
1638
- stroke: y
1648
+ stroke: x
1639
1649
  }),
1640
1650
  onClick: v
1641
- }] : [], [v, b]);
1642
- return /* @__PURE__ */ V(Rt, {
1651
+ }] : [], [v, y]);
1652
+ return /* @__PURE__ */ H(Ht, {
1643
1653
  onAttachClick: i ? void 0 : () => e.current?.click(),
1644
- attachLabel: x,
1654
+ attachLabel: b,
1645
1655
  addMenuTitle: S,
1646
1656
  menuTitle: C,
1647
1657
  menuCloseLabel: w,
@@ -1649,23 +1659,23 @@ var J = {
1649
1659
  isDisabled: a || l,
1650
1660
  chatSettings: g,
1651
1661
  extraMenuItems: O,
1652
- onRecordVoice: c && s && !o && !l ? () => u(qe.Attachment) : void 0,
1662
+ onRecordVoice: c && s && !o && !l ? () => u(Ze.Attachment) : void 0,
1653
1663
  recordVoiceLabel: T,
1654
- toolsMenuItems: f || d ? m : void 0,
1655
- onToolToggle: h,
1664
+ toolsMenuItems: f || d ? p : void 0,
1665
+ onToolToggle: m,
1656
1666
  toolsMenuTitle: E,
1657
1667
  toolsBackLabel: D,
1658
1668
  menuOverlays: _,
1659
1669
  getCaretPosition: () => t.current?.selectionStart ?? n.length
1660
1670
  });
1661
- }, Bt = ({ textarea: e, textareaRef: t, commandMenu: n, caretAnchor: r, fontClassName: i, isMenuOpen: a, query: o, activeWordStart: s, listboxId: c, activeOptionId: u, overlayRef: d, onOutsidePress: f, onClose: p }) => /* @__PURE__ */ H(ue, { children: [e, n != null && /* @__PURE__ */ V("div", {
1671
+ }, Wt = ({ textarea: e, textareaRef: t, commandMenu: n, caretAnchor: r, fontClassName: i, isMenuOpen: a, query: o, activeWordStart: s, listboxId: c, activeOptionId: l, overlayRef: u, onOutsidePress: f, onClose: p }) => /* @__PURE__ */ U(V, { children: [e, n != null && /* @__PURE__ */ H("div", {
1662
1672
  "aria-hidden": !0,
1663
- className: l("pointer-events-none absolute", i || "dial-body-paragraph-text"),
1673
+ className: d("pointer-events-none absolute", i || "dial-body-paragraph-text"),
1664
1674
  style: {
1665
1675
  left: r?.left ?? 0,
1666
1676
  top: r?.top ?? 0
1667
1677
  },
1668
- children: /* @__PURE__ */ V(b, {
1678
+ children: /* @__PURE__ */ H(S, {
1669
1679
  open: a,
1670
1680
  onOpenChange: (e) => {
1671
1681
  e || f();
@@ -1673,13 +1683,15 @@ var J = {
1673
1683
  placement: "top-start",
1674
1684
  trigger: [],
1675
1685
  initialFocus: -1,
1676
- overlayRole: x.None,
1686
+ overlayRole: C.None,
1677
1687
  matchReferenceWidth: !1,
1688
+ listClassName: "flex flex-col overflow-hidden",
1678
1689
  outsidePressIgnoreRef: t,
1679
1690
  renderOverlay: () => {
1680
1691
  let e = n.menuLabel != null;
1681
- return /* @__PURE__ */ V("div", {
1682
- ref: d,
1692
+ return /* @__PURE__ */ H("div", {
1693
+ ref: u,
1694
+ className: "flex min-h-0 flex-col",
1683
1695
  role: e ? "group" : void 0,
1684
1696
  "aria-label": n.menuLabel,
1685
1697
  children: n.renderMenu({
@@ -1687,24 +1699,24 @@ var J = {
1687
1699
  caretPosition: s ?? 0,
1688
1700
  close: p,
1689
1701
  listboxId: c,
1690
- activeOptionId: u
1702
+ activeOptionId: l
1691
1703
  })
1692
1704
  });
1693
1705
  },
1694
- children: /* @__PURE__ */ V("span", {
1706
+ children: /* @__PURE__ */ H("span", {
1695
1707
  "aria-hidden": !0,
1696
1708
  className: "inline-block h-lh w-0"
1697
1709
  })
1698
1710
  })
1699
- })] }), Vt = ({ areaRef: e, mirrorRef: t, isMirrorActive: n, fontClassName: r, message: i, mentionRanges: a, mirrorInsertions: o, selectionRects: s, children: c }) => /* @__PURE__ */ H("div", {
1711
+ })] }), Gt = ({ areaRef: e, mirrorRef: t, isMirrorActive: n, fontClassName: r, message: i, mentionRanges: a, mirrorInsertions: o, selectionRects: s, children: c }) => /* @__PURE__ */ U("div", {
1700
1712
  ref: e,
1701
1713
  className: "relative -ms-1 -me-1 w-[calc(100%+8px)]",
1702
- children: [n && /* @__PURE__ */ H("div", {
1714
+ children: [n && /* @__PURE__ */ U("div", {
1703
1715
  ref: t,
1704
- className: l(X.textarea, r || "dial-body-paragraph-text", "pointer-events-none absolute inset-0 z-10 max-h-[272px] w-full overflow-hidden ps-1 pe-1 wrap-anywhere whitespace-pre-wrap"),
1705
- children: [mt(i, a, o, X.mentionHighlight, X.mentionHighlightUnsupported), s.map((e, t) => /* @__PURE__ */ V("div", {
1716
+ className: d(Z.textarea, r || "dial-body-paragraph-text", "pointer-events-none absolute inset-0 z-10 max-h-[272px] w-full overflow-hidden ps-1 pe-1 wrap-anywhere whitespace-pre-wrap"),
1717
+ children: [vt(i, a, o, Z.mentionHighlight, Z.mentionHighlightUnsupported), s.map((e, t) => /* @__PURE__ */ H("div", {
1706
1718
  "aria-hidden": !0,
1707
- className: l("pointer-events-none absolute rounded-sm", X.selectionHighlight),
1719
+ className: d("pointer-events-none absolute rounded-sm", Z.selectionHighlight),
1708
1720
  style: {
1709
1721
  left: e.left,
1710
1722
  top: e.top,
@@ -1713,54 +1725,49 @@ var J = {
1713
1725
  }
1714
1726
  }, `selection-${t}`))]
1715
1727
  }), c]
1716
- }), Ht = ({ size: e = 20 }) => /* @__PURE__ */ V(ne, {
1717
- variant: re.Circular,
1728
+ }), Kt = ({ size: e = 20 }) => /* @__PURE__ */ H(ie, {
1729
+ variant: ae.Circular,
1718
1730
  width: e,
1719
1731
  height: e,
1720
1732
  active: !0
1721
- }), Ut = ({ loadingLabel: e }) => /* @__PURE__ */ H("span", {
1733
+ }), qt = ({ loadingLabel: e }) => /* @__PURE__ */ U("span", {
1722
1734
  className: "flex min-w-0 flex-1 items-center",
1723
- children: [/* @__PURE__ */ V(ne, {
1724
- variant: re.Text,
1735
+ children: [/* @__PURE__ */ H(ie, {
1736
+ variant: ae.Text,
1725
1737
  width: "100%",
1726
1738
  height: 16,
1727
1739
  active: !0
1728
- }), e && /* @__PURE__ */ V("span", {
1740
+ }), e && /* @__PURE__ */ H("span", {
1729
1741
  className: "sr-only",
1730
1742
  children: e
1731
1743
  })]
1732
- }), Wt = () => /* @__PURE__ */ V("div", {
1744
+ }), Jt = () => /* @__PURE__ */ H("div", {
1733
1745
  "aria-hidden": "true",
1734
- children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */ H("div", {
1746
+ children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */ U("div", {
1735
1747
  className: "flex h-11 items-center gap-3 px-4",
1736
- children: [/* @__PURE__ */ V(Ht, {}), /* @__PURE__ */ V(Ut, {})]
1748
+ children: [/* @__PURE__ */ H(Kt, {}), /* @__PURE__ */ H(qt, {})]
1737
1749
  }, t))
1738
- }), Gt = (e) => e.displayName ?? e.id, Kt = (e, t) => {
1750
+ }), Yt = (e) => e.displayName ?? e.id, Xt = (e, t) => {
1739
1751
  let n = t.trim().toLowerCase();
1740
- return n ? e.filter((e) => Gt(e).toLowerCase().includes(n)) : e;
1741
- }, qt = (e, t, r, i = 18, a) => /* @__PURE__ */ V(n, {
1752
+ return n ? e.filter((e) => Yt(e).toLowerCase().includes(n)) : e;
1753
+ }, Zt = (e, t, r, i = 18, a) => /* @__PURE__ */ H(n, {
1742
1754
  src: e,
1743
1755
  size: i,
1744
1756
  labels: { tooltip: a },
1745
1757
  initialsName: r
1746
- }), Jt = {
1758
+ }), Qt = {
1747
1759
  searchHeader: "_searchHeader_1u7db_1",
1748
1760
  itemText: "_itemText_1u7db_13",
1749
1761
  itemHover: "_itemHover_1u7db_17",
1750
1762
  selectedItemBackground: "_selectedItemBackground_1u7db_22",
1751
1763
  selectedItemText: "_selectedItemText_1u7db_26",
1752
1764
  checkIcon: "_checkIcon_1u7db_30"
1753
- }, Yt = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, styles: i }) => {
1754
- let [a, o] = q(""), s = G(() => e?.find((e) => e.id === t), [e, t]), u = r?.loading !== void 0, d = !u && !s && !!t, f = G(() => u ? /* @__PURE__ */ V(Ht, { size: v.LG }) : qt(s?.iconUrl, s?.type, s?.displayName ?? s?.id ?? "", v.LG, d ? r?.unavailableTooltip ?? "This deployment is no longer available" : void 0), [
1755
- u,
1756
- s,
1757
- d,
1758
- r?.unavailableTooltip
1759
- ]), p = s?.displayName ?? s?.id, m = s?.displayVersion, h = p ? `${r?.ariaLabel ?? "Select model"}: ${p}` : r?.ariaLabel ?? "Select model", g = G(() => {
1760
- if (u) return Array.from({ length: 7 }, (e, t) => ({
1765
+ }, $t = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, styles: i }) => {
1766
+ let [a, o] = J(""), s = K(() => e?.find((e) => e.id === t), [e, t]), l = r?.loading !== void 0, u = !l && !s && !!t, f = K(() => l ? /* @__PURE__ */ H(Kt, { size: b.LG }) : Zt(s?.iconUrl, s?.type, s?.displayName ?? s?.id ?? "", b.LG), [l, s]), p = s?.displayName ?? s?.id, m = s?.displayVersion, h = u ? r?.unavailableTooltip ?? "This deployment is no longer available" : void 0, g = p ? `${r?.ariaLabel ?? "Select model"}: ${p}` : r?.ariaLabel ?? "Select model", _ = K(() => {
1767
+ if (l) return Array.from({ length: 7 }, (e, t) => ({
1761
1768
  key: `__loading-${t}`,
1762
- icon: /* @__PURE__ */ V(Ht, {}),
1763
- label: /* @__PURE__ */ V(Ut, { loadingLabel: t === 0 ? r?.loading : void 0 }),
1769
+ icon: /* @__PURE__ */ H(Kt, {}),
1770
+ label: /* @__PURE__ */ H(qt, { loadingLabel: t === 0 ? r?.loading : void 0 }),
1764
1771
  disabled: !0
1765
1772
  }));
1766
1773
  if (!e || e.length === 0) {
@@ -1772,25 +1779,25 @@ var J = {
1772
1779
  }] : [];
1773
1780
  }
1774
1781
  let o = i?.colors;
1775
- return Kt(e, a).map((e) => {
1782
+ return Xt(e, a).map((e) => {
1776
1783
  let r = e.id === t;
1777
1784
  return {
1778
1785
  key: e.id,
1779
- label: /* @__PURE__ */ V(T, {
1780
- text: Gt(e),
1786
+ label: /* @__PURE__ */ H(D, {
1787
+ text: Yt(e),
1781
1788
  query: a,
1782
1789
  maxLines: 1
1783
1790
  }),
1784
- icon: qt(e.iconUrl, e.type, e.displayName ?? e.id),
1785
- mark: A.Check,
1791
+ icon: Zt(e.iconUrl, e.type, e.displayName ?? e.id),
1792
+ mark: M.Check,
1786
1793
  checked: r,
1787
- className: l(o?.itemText && Jt.itemText, o?.itemHoverBackground && Jt.itemHover, r && o?.selectedItemBackground && Jt.selectedItemBackground, r && o?.selectedItemText && Jt.selectedItemText, r && o?.checkIcon && Jt.checkIcon, i?.itemClassName, r && i?.selectedItemClassName, J.modelMenuItem, r && J.modelMenuItemSelected),
1794
+ className: d(o?.itemText && Qt.itemText, o?.itemHoverBackground && Qt.itemHover, r && o?.selectedItemBackground && Qt.selectedItemBackground, r && o?.selectedItemText && Qt.selectedItemText, r && o?.checkIcon && Qt.checkIcon, i?.itemClassName, r && i?.selectedItemClassName, Y.modelMenuItem, r && Y.modelMenuItemSelected),
1788
1795
  onClick: () => n?.(e.id)
1789
1796
  };
1790
1797
  });
1791
1798
  }, [
1792
1799
  e,
1793
- u,
1800
+ l,
1794
1801
  a,
1795
1802
  t,
1796
1803
  r,
@@ -1798,7 +1805,7 @@ var J = {
1798
1805
  i?.itemClassName,
1799
1806
  i?.selectedItemClassName,
1800
1807
  i?.colors
1801
- ]), _ = G(() => c({
1808
+ ]), v = K(() => c({
1802
1809
  "--ms-item-text": i?.colors?.itemText,
1803
1810
  "--ms-item-hover-bg": i?.colors?.itemHoverBackground,
1804
1811
  "--ms-selected-item-bg": i?.colors?.selectedItemBackground,
@@ -1809,35 +1816,36 @@ var J = {
1809
1816
  searchQuery: a,
1810
1817
  onSearchQueryChange: o,
1811
1818
  selectorIcon: f,
1812
- selectorAriaLabel: h,
1819
+ selectorAriaLabel: g,
1820
+ unavailableTooltip: h,
1813
1821
  selectedLabel: p,
1814
1822
  selectedVersion: m,
1815
- menuItems: g,
1816
- menuHeader: G(() => !u && e && e.length > 0 ? /* @__PURE__ */ V("div", {
1823
+ menuItems: _,
1824
+ menuHeader: K(() => !l && e && e.length > 0 ? /* @__PURE__ */ H("div", {
1817
1825
  style: c({ "--ms-search-header-bg": i?.colors?.searchHeaderBackground }),
1818
- className: l("sticky top-0 z-10 pe-2 pt-2 pb-1", Jt.searchHeader, i?.searchHeaderClassName, J.modelMenuSearch),
1819
- children: /* @__PURE__ */ V(te, {
1826
+ className: d("sticky top-0 z-10 pe-2 pt-2 pb-1", Qt.searchHeader, i?.searchHeaderClassName, Y.modelMenuSearch),
1827
+ children: /* @__PURE__ */ H(re, {
1820
1828
  value: a,
1821
1829
  placeholder: r?.searchPlaceholder ?? "Search",
1822
- size: S.Small,
1830
+ size: w.Small,
1823
1831
  wrapperClassName: "border-0",
1824
1832
  onChange: (e) => o(e ?? "")
1825
1833
  })
1826
1834
  }) : void 0, [
1827
1835
  e,
1828
- u,
1836
+ l,
1829
1837
  a,
1830
1838
  r,
1831
1839
  i?.searchHeaderClassName,
1832
1840
  i?.colors?.searchHeaderBackground
1833
1841
  ]),
1834
- menuStyle: _,
1842
+ menuStyle: v,
1835
1843
  onOpenChange: (e) => {
1836
1844
  e || o("");
1837
1845
  }
1838
1846
  };
1839
- }, $ = typeof window < "u" ? Ne : W;
1840
- function Xt(e) {
1847
+ }, en = typeof window < "u" ? Pe : G;
1848
+ function tn(e) {
1841
1849
  let t = e;
1842
1850
  for (; t;) {
1843
1851
  if (t.dir) return t.dir === "rtl";
@@ -1845,35 +1853,35 @@ function Xt(e) {
1845
1853
  }
1846
1854
  return !1;
1847
1855
  }
1848
- function Zt() {
1856
+ function nn() {
1849
1857
  return () => {};
1850
1858
  }
1851
- function Qt() {
1852
- return Pe(Zt, () => !1, () => !0);
1859
+ function rn() {
1860
+ return Fe(nn, () => !1, () => !0);
1853
1861
  }
1854
- function $t(e) {
1862
+ function an(e) {
1855
1863
  return e?.ownerDocument.defaultView ?? window;
1856
1864
  }
1857
- function en(e) {
1858
- return $t(e).ResizeObserver ?? (typeof ResizeObserver < "u" ? ResizeObserver : void 0);
1865
+ function on(e) {
1866
+ return an(e).ResizeObserver ?? (typeof ResizeObserver < "u" ? ResizeObserver : void 0);
1859
1867
  }
1860
- function tn(e) {
1868
+ function sn(e) {
1861
1869
  if (e !== void 0) switch (typeof e) {
1862
1870
  case "number": return e;
1863
1871
  case "string": if (e.endsWith("px")) return parseFloat(e);
1864
1872
  }
1865
1873
  }
1866
- function nn({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
1867
- let { styleHeight: s, styleWidth: c } = G(() => ({
1868
- styleHeight: tn(o?.height),
1869
- styleWidth: tn(o?.width)
1870
- }), [o?.height, o?.width]), [l, u] = q({
1874
+ function cn({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
1875
+ let { styleHeight: s, styleWidth: c } = K(() => ({
1876
+ styleHeight: sn(o?.height),
1877
+ styleWidth: sn(o?.width)
1878
+ }), [o?.height, o?.width]), [l, u] = J({
1871
1879
  height: t,
1872
1880
  width: n
1873
1881
  }), d = r || a === "only-height" && s !== void 0 || a === "only-width" && c !== void 0 || s !== void 0 && c !== void 0;
1874
- return $(() => {
1882
+ return en(() => {
1875
1883
  if (i === null || d) return;
1876
- let t = en(i);
1884
+ let t = on(i);
1877
1885
  if (!t) return;
1878
1886
  let n = new t((e) => {
1879
1887
  for (let t of e) {
@@ -1893,7 +1901,7 @@ function nn({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
1893
1901
  i,
1894
1902
  s,
1895
1903
  c
1896
- ]), G(() => ({
1904
+ ]), K(() => ({
1897
1905
  height: s ?? l.height,
1898
1906
  width: c ?? l.width
1899
1907
  }), [
@@ -1902,27 +1910,27 @@ function nn({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
1902
1910
  c
1903
1911
  ]);
1904
1912
  }
1905
- function rn(e) {
1906
- let t = K(() => {
1913
+ function ln(e) {
1914
+ let t = q(() => {
1907
1915
  throw Error("Cannot call an event handler while rendering.");
1908
1916
  });
1909
- return $(() => {
1917
+ return en(() => {
1910
1918
  t.current = e;
1911
- }, [e]), U((...e) => t.current?.(...e), [t]);
1919
+ }, [e]), W((...e) => t.current?.(...e), [t]);
1912
1920
  }
1913
- var an = /* @__PURE__ */ new WeakMap();
1914
- function on(e = !1, t = document) {
1915
- let n = an.get(t);
1921
+ var un = /* @__PURE__ */ new WeakMap();
1922
+ function dn(e = !1, t = document) {
1923
+ let n = un.get(t);
1916
1924
  if (n === void 0 || e) {
1917
1925
  let e = t.createElement("div"), r = e.style;
1918
1926
  r.width = "50px", r.height = "50px", r.overflow = "scroll", r.direction = "rtl";
1919
1927
  let i = t.createElement("div"), a = i.style;
1920
- a.width = "100px", a.height = "100px", e.appendChild(i), t.body.appendChild(e), e.scrollLeft > 0 ? n = "positive-descending" : (e.scrollLeft = 1, n = e.scrollLeft === 0 ? "negative" : "positive-ascending"), t.body.removeChild(e), an.set(t, n);
1928
+ a.width = "100px", a.height = "100px", e.appendChild(i), t.body.appendChild(e), e.scrollLeft > 0 ? n = "positive-descending" : (e.scrollLeft = 1, n = e.scrollLeft === 0 ? "negative" : "positive-ascending"), t.body.removeChild(e), un.set(t, n);
1921
1929
  }
1922
1930
  return n;
1923
1931
  }
1924
- function sn({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
1925
- if (t === "horizontal" && n) switch (on(!1, e?.ownerDocument ?? document)) {
1932
+ function fn({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
1933
+ if (t === "horizontal" && n) switch (dn(!1, e?.ownerDocument ?? document)) {
1926
1934
  case "negative": return -r;
1927
1935
  case "positive-descending": if (e) {
1928
1936
  let { clientWidth: t, scrollWidth: n } = e;
@@ -1931,8 +1939,8 @@ function sn({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
1931
1939
  }
1932
1940
  return r;
1933
1941
  }
1934
- function cn({ container: e, element: t, onChange: n }) {
1935
- let r = $t(t), i = en(t), a = r.MutationObserver ?? (typeof MutationObserver < "u" ? MutationObserver : void 0), o = i ? new i(n) : void 0, s = (e) => !e.isConnected || (e.compareDocumentPosition(t) & Node.DOCUMENT_POSITION_FOLLOWING) !== 0, c = a ? new a((e) => {
1942
+ function pn({ container: e, element: t, onChange: n }) {
1943
+ let r = an(t), i = on(t), a = r.MutationObserver ?? (typeof MutationObserver < "u" ? MutationObserver : void 0), o = i ? new i(n) : void 0, s = (e) => !e.isConnected || (e.compareDocumentPosition(t) & Node.DOCUMENT_POSITION_FOLLOWING) !== 0, c = a ? new a((e) => {
1936
1944
  e.some((e) => Array.from(e.addedNodes).some(s) || e.removedNodes.length > 0 && e.nextSibling !== null && s(e.nextSibling)) && (u(), n());
1937
1945
  }) : void 0, l = /* @__PURE__ */ new Set(), u = () => {
1938
1946
  for (let e of l) o?.unobserve(e);
@@ -1949,33 +1957,33 @@ function cn({ container: e, element: t, onChange: n }) {
1949
1957
  o?.disconnect(), c?.disconnect();
1950
1958
  };
1951
1959
  }
1952
- function ln(e) {
1960
+ function mn(e) {
1953
1961
  return e.window === e;
1954
1962
  }
1955
- function un(e, t) {
1956
- return t === "window" ? e ? $t(e) : null : t ?? null;
1963
+ function hn(e, t) {
1964
+ return t === "window" ? e ? an(e) : null : t ?? null;
1957
1965
  }
1958
- function dn(e, t) {
1959
- return ln(e) ? t === "vertical" ? e.scrollY : e.scrollX : t === "vertical" ? e.scrollTop : e.scrollLeft;
1966
+ function gn(e, t) {
1967
+ return mn(e) ? t === "vertical" ? e.scrollY : e.scrollX : t === "vertical" ? e.scrollTop : e.scrollLeft;
1960
1968
  }
1961
- function fn(e, t) {
1962
- let n = ln(e) ? e.document.scrollingElement ?? e.document.documentElement : e;
1969
+ function _n(e, t) {
1970
+ let n = mn(e) ? e.document.scrollingElement ?? e.document.documentElement : e;
1963
1971
  return t === "vertical" ? n.scrollHeight - n.clientHeight : n.scrollWidth - n.clientWidth;
1964
1972
  }
1965
- function pn(e, t) {
1966
- let { overflowX: n, overflowY: r } = $t(e).getComputedStyle(e), i = t === "vertical" ? r : n;
1973
+ function vn(e, t) {
1974
+ let { overflowX: n, overflowY: r } = an(e).getComputedStyle(e), i = t === "vertical" ? r : n;
1967
1975
  return i === "visible" || i === "clip" ? !1 : t === "vertical" ? e.scrollHeight - e.clientHeight > 1 : e.scrollWidth - e.clientWidth > 1;
1968
1976
  }
1969
- function mn({ containerElement: e, direction: t, isRtl: n, scrollTarget: r }) {
1977
+ function yn({ containerElement: e, direction: t, isRtl: n, scrollTarget: r }) {
1970
1978
  let i = t === "vertical", a, o;
1971
- if (ln(r)) {
1979
+ if (mn(r)) {
1972
1980
  let { documentElement: e } = r.document;
1973
1981
  a = 0, o = i ? e.clientHeight : e.clientWidth;
1974
1982
  } else {
1975
1983
  let e = r.getBoundingClientRect();
1976
1984
  a = i ? e.top + r.clientTop : e.left + r.clientLeft, o = i ? r.clientHeight : r.clientWidth;
1977
1985
  }
1978
- let s = a + o, c = e.getBoundingClientRect(), l = i ? c.top + e.clientTop : c.left + e.clientLeft, u = i ? e.clientHeight : e.clientWidth, d = l + u, f = sn({
1986
+ let s = a + o, c = e.getBoundingClientRect(), l = i ? c.top + e.clientTop : c.left + e.clientLeft, u = i ? e.clientHeight : e.clientWidth, d = l + u, f = fn({
1979
1987
  containerElement: e,
1980
1988
  direction: t,
1981
1989
  isRtl: n,
@@ -1988,8 +1996,8 @@ function mn({ containerElement: e, direction: t, isRtl: n, scrollTarget: r }) {
1988
1996
  viewportSize: o
1989
1997
  };
1990
1998
  }
1991
- function hn({ direction: e, isRtl: t, scrollTarget: n, viewportSize: r }) {
1992
- let i = ln(n) ? n.document.documentElement : n, a = $t(i).getComputedStyle(i), o = (e) => {
1999
+ function bn({ direction: e, isRtl: t, scrollTarget: n, viewportSize: r }) {
2000
+ let i = mn(n) ? n.document.documentElement : n, a = an(i).getComputedStyle(i), o = (e) => {
1993
2001
  let t = parseFloat(e ?? "");
1994
2002
  return !Number.isFinite(t) || t < 0 ? 0 : e.endsWith("px") ? t : e.endsWith("%") ? t * r / 100 : 0;
1995
2003
  };
@@ -2006,26 +2014,26 @@ function hn({ direction: e, isRtl: t, scrollTarget: n, viewportSize: r }) {
2006
2014
  start: s
2007
2015
  };
2008
2016
  }
2009
- function gn(e, t = "Assertion error") {
2017
+ function xn(e, t = "Assertion error") {
2010
2018
  if (!e) throw console.error(t), Error(t);
2011
2019
  }
2012
- function _n(e, t) {
2020
+ function Sn(e, t) {
2013
2021
  if (e === t) return !0;
2014
- if (!!e != !!t || (gn(e !== void 0), gn(t !== void 0), Object.keys(e).length !== Object.keys(t).length)) return !1;
2022
+ if (!!e != !!t || (xn(e !== void 0), xn(t !== void 0), Object.keys(e).length !== Object.keys(t).length)) return !1;
2015
2023
  for (let n in e) if (!Object.hasOwn(t, n) || !Object.is(t[n], e[n])) return !1;
2016
2024
  return !0;
2017
2025
  }
2018
- function vn({ cachedBounds: e, itemCount: t, itemSize: n }) {
2026
+ function Cn({ cachedBounds: e, itemCount: t, itemSize: n }) {
2019
2027
  if (t === 0) return 0;
2020
2028
  if (typeof n == "number") return t * n;
2021
2029
  {
2022
2030
  let n = e.get(e.size === 0 ? 0 : e.size - 1);
2023
- return gn(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
2031
+ return xn(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
2024
2032
  }
2025
2033
  }
2026
- function yn({ align: e, cachedBounds: t, clamp: n = !0, index: r, itemCount: i, itemSize: a, containerScrollOffset: o, containerSize: s }) {
2034
+ function wn({ align: e, cachedBounds: t, clamp: n = !0, index: r, itemCount: i, itemSize: a, containerScrollOffset: o, containerSize: s }) {
2027
2035
  if (r < 0 || r >= i) throw RangeError(`Invalid index specified: ${r}`, { cause: `Index ${r} is not within the range of 0 - ${i - 1}` });
2028
- let c = t.get(r), l = vn({
2036
+ let c = t.get(r), l = Cn({
2029
2037
  cachedBounds: t,
2030
2038
  itemCount: i,
2031
2039
  itemSize: a
@@ -2037,7 +2045,7 @@ function yn({ align: e, cachedBounds: t, clamp: n = !0, index: r, itemCount: i,
2037
2045
  default: return p ? o : o < f ? f : d;
2038
2046
  }
2039
2047
  }
2040
- function bn({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCount: r, overscanCount: i }) {
2048
+ function Tn({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCount: r, overscanCount: i }) {
2041
2049
  let a = r - 1;
2042
2050
  if (r === 0) return {
2043
2051
  startIndexVisible: 0,
@@ -2071,12 +2079,12 @@ function bn({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemC
2071
2079
  stopIndexOverscan: Math.min(a, s + i)
2072
2080
  };
2073
2081
  }
2074
- function xn({ itemCount: e, itemProps: t, itemSize: n }) {
2082
+ function En({ itemCount: e, itemProps: t, itemSize: n }) {
2075
2083
  let r = /* @__PURE__ */ new Map();
2076
2084
  return {
2077
2085
  itemSize: typeof n == "number" ? n : void 0,
2078
2086
  get(i) {
2079
- if (gn(i < e, `Invalid index ${i}`), typeof n == "number") return gn(i >= 0, `Invalid index ${i}`), {
2087
+ if (xn(i < e, `Invalid index ${i}`), typeof n == "number") return xn(i >= 0, `Invalid index ${i}`), {
2080
2088
  size: n,
2081
2089
  scrollOffset: i * n
2082
2090
  };
@@ -2088,14 +2096,14 @@ function xn({ itemCount: e, itemProps: t, itemSize: n }) {
2088
2096
  });
2089
2097
  else {
2090
2098
  let t = r.get(e - 1);
2091
- gn(t !== void 0, `Unexpected bounds cache miss for index ${i}`), r.set(e, {
2099
+ xn(t !== void 0, `Unexpected bounds cache miss for index ${i}`), r.set(e, {
2092
2100
  scrollOffset: t.scrollOffset + t.size,
2093
2101
  size: a
2094
2102
  });
2095
2103
  }
2096
2104
  }
2097
2105
  let a = r.get(i);
2098
- return gn(a !== void 0, `Unexpected bounds cache miss for index ${i}`), a;
2106
+ return xn(a !== void 0, `Unexpected bounds cache miss for index ${i}`), a;
2099
2107
  },
2100
2108
  set(e, t) {
2101
2109
  r.set(e, t);
@@ -2105,8 +2113,8 @@ function xn({ itemCount: e, itemProps: t, itemSize: n }) {
2105
2113
  }
2106
2114
  };
2107
2115
  }
2108
- function Sn({ itemCount: e, itemProps: t, itemSize: n }) {
2109
- return G(() => xn({
2116
+ function Dn({ itemCount: e, itemProps: t, itemSize: n }) {
2117
+ return K(() => En({
2110
2118
  itemCount: e,
2111
2119
  itemProps: t,
2112
2120
  itemSize: n
@@ -2116,31 +2124,31 @@ function Sn({ itemCount: e, itemProps: t, itemSize: n }) {
2116
2124
  n
2117
2125
  ]);
2118
2126
  }
2119
- function Cn({ containerSize: e, itemSize: t }) {
2127
+ function On({ containerSize: e, itemSize: t }) {
2120
2128
  let n;
2121
2129
  switch (typeof t) {
2122
2130
  case "string":
2123
- gn(t.endsWith("%"), `Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`), gn(e !== void 0, "Container size must be defined if a percentage item size is specified"), n = e * parseFloat(t) / 100;
2131
+ xn(t.endsWith("%"), `Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`), xn(e !== void 0, "Container size must be defined if a percentage item size is specified"), n = e * parseFloat(t) / 100;
2124
2132
  break;
2125
2133
  default: n = t;
2126
2134
  }
2127
2135
  return typeof n == "number" && !(Number.isFinite(n) && n > 0) && (n = 0), n;
2128
2136
  }
2129
- function wn({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0, defaultScrollOffset: r = 0, direction: i, isRtl: a = !1, itemCount: o, itemProps: s, itemSize: c, onResize: l, overscanCount: u, scrollElement: d }) {
2130
- let f = d !== void 0, p = f ? un(e, d) : e, { height: m = n, width: h = n } = nn({
2137
+ function kn({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0, defaultScrollOffset: r = 0, direction: i, isRtl: a = !1, itemCount: o, itemProps: s, itemSize: c, onResize: l, overscanCount: u, scrollElement: d }) {
2138
+ let f = d !== void 0, p = f ? hn(e, d) : e, { height: m = n, width: h = n } = cn({
2131
2139
  defaultHeight: i === "vertical" ? n : void 0,
2132
2140
  defaultWidth: i === "horizontal" ? n : void 0,
2133
2141
  element: e,
2134
2142
  mode: i === "vertical" ? "only-height" : "only-width",
2135
2143
  style: t
2136
- }), g = K({
2144
+ }), g = q({
2137
2145
  height: 0,
2138
2146
  width: 0
2139
- }), [_, v] = q(n), y = f ? _ : i === "vertical" ? m : h, b = Cn({
2147
+ }), [_, v] = J(n), y = f ? _ : i === "vertical" ? m : h, b = On({
2140
2148
  containerSize: y,
2141
2149
  itemSize: c
2142
2150
  });
2143
- $(() => {
2151
+ en(() => {
2144
2152
  if (typeof l == "function") {
2145
2153
  let e = g.current;
2146
2154
  (e.height !== m || e.width !== h) && (l({
@@ -2153,11 +2161,11 @@ function wn({ containerElement: e, containerStyle: t, defaultContainerSize: n =
2153
2161
  l,
2154
2162
  h
2155
2163
  ]);
2156
- let x = Sn({
2164
+ let x = Dn({
2157
2165
  itemCount: o,
2158
2166
  itemProps: s,
2159
2167
  itemSize: b
2160
- }), S = Qt(), [C] = q(() => S || f ? 0 : r), w = U((e) => x.get(e), [x]), [T, E] = q(() => bn({
2168
+ }), S = rn(), [C] = J(() => S || f ? 0 : r), w = W((e) => x.get(e), [x]), [T, E] = J(() => Tn({
2161
2169
  cachedBounds: x,
2162
2170
  containerScrollOffset: C,
2163
2171
  containerSize: y,
@@ -2168,7 +2176,7 @@ function wn({ containerElement: e, containerStyle: t, defaultContainerSize: n =
2168
2176
  startIndexOverscan: Math.min(o - 1, T.startIndexOverscan),
2169
2177
  stopIndexVisible: Math.min(o - 1, T.stopIndexVisible),
2170
2178
  stopIndexOverscan: Math.min(o - 1, T.stopIndexOverscan)
2171
- }, j = U(() => vn({
2179
+ }, j = W(() => Cn({
2172
2180
  cachedBounds: x,
2173
2181
  itemCount: o,
2174
2182
  itemSize: b
@@ -2176,14 +2184,14 @@ function wn({ containerElement: e, containerStyle: t, defaultContainerSize: n =
2176
2184
  x,
2177
2185
  o,
2178
2186
  b
2179
- ]), M = U((t) => {
2180
- let n = sn({
2187
+ ]), M = W((t) => {
2188
+ let n = fn({
2181
2189
  containerElement: e,
2182
2190
  direction: i,
2183
2191
  isRtl: a,
2184
2192
  scrollOffset: t
2185
2193
  });
2186
- return bn({
2194
+ return Tn({
2187
2195
  cachedBounds: x,
2188
2196
  containerScrollOffset: n,
2189
2197
  containerSize: y,
@@ -2198,17 +2206,17 @@ function wn({ containerElement: e, containerStyle: t, defaultContainerSize: n =
2198
2206
  a,
2199
2207
  o,
2200
2208
  u
2201
- ]), N = K(!1);
2202
- $(() => {
2209
+ ]), N = q(!1);
2210
+ en(() => {
2203
2211
  if (!e || o === 0 || f || N.current || (N.current = !0, r <= 0)) return;
2204
- let t = i === "horizontal" && Xt(e);
2205
- if (sn({
2212
+ let t = i === "horizontal" && tn(e);
2213
+ if (fn({
2206
2214
  containerElement: e,
2207
2215
  direction: i,
2208
2216
  isRtl: t,
2209
2217
  scrollOffset: i === "vertical" ? e.scrollTop : e.scrollLeft
2210
2218
  }) !== 0) return;
2211
- let n = sn({
2219
+ let n = fn({
2212
2220
  containerElement: e,
2213
2221
  direction: i,
2214
2222
  isRtl: t,
@@ -2218,16 +2226,16 @@ function wn({ containerElement: e, containerStyle: t, defaultContainerSize: n =
2218
2226
  behavior: "instant",
2219
2227
  [i === "vertical" ? "top" : "left"]: n
2220
2228
  }) : i === "vertical" ? e.scrollTop = n : e.scrollLeft = n;
2221
- }, [e, o]), $(() => {
2229
+ }, [e, o]), en(() => {
2222
2230
  if (f && e && p) return;
2223
- let t = e && !f ? M(i === "vertical" ? e.scrollTop : e.scrollLeft) : bn({
2231
+ let t = e && !f ? M(i === "vertical" ? e.scrollTop : e.scrollLeft) : Tn({
2224
2232
  cachedBounds: x,
2225
2233
  containerScrollOffset: C,
2226
2234
  containerSize: y,
2227
2235
  itemCount: o,
2228
2236
  overscanCount: u
2229
2237
  });
2230
- E((e) => _n(t, e) ? e : t);
2238
+ E((e) => Sn(t, e) ? e : t);
2231
2239
  }, [
2232
2240
  x,
2233
2241
  e,
@@ -2239,23 +2247,23 @@ function wn({ containerElement: e, containerStyle: t, defaultContainerSize: n =
2239
2247
  o,
2240
2248
  u,
2241
2249
  p
2242
- ]), $(() => {
2250
+ ]), en(() => {
2243
2251
  if (!e || f) return;
2244
2252
  let t = () => {
2245
2253
  E((t) => {
2246
- let { scrollLeft: n, scrollTop: r } = e, s = sn({
2254
+ let { scrollLeft: n, scrollTop: r } = e, s = fn({
2247
2255
  containerElement: e,
2248
2256
  direction: i,
2249
2257
  isRtl: a,
2250
2258
  scrollOffset: i === "vertical" ? r : n
2251
- }), c = bn({
2259
+ }), c = Tn({
2252
2260
  cachedBounds: x,
2253
2261
  containerScrollOffset: s,
2254
2262
  containerSize: y,
2255
2263
  itemCount: o,
2256
2264
  overscanCount: u
2257
2265
  });
2258
- return _n(c, t) ? t : c;
2266
+ return Sn(c, t) ? t : c;
2259
2267
  });
2260
2268
  };
2261
2269
  return e.addEventListener("scroll", t), () => {
@@ -2271,34 +2279,34 @@ function wn({ containerElement: e, containerStyle: t, defaultContainerSize: n =
2271
2279
  o,
2272
2280
  u
2273
2281
  ]);
2274
- let P = rn(() => {
2282
+ let P = ln(() => {
2275
2283
  if (!e || !p) return;
2276
- let { offset: t, size: n, viewportSize: r } = mn({
2284
+ let { offset: t, size: n, viewportSize: r } = yn({
2277
2285
  containerElement: e,
2278
2286
  direction: i,
2279
2287
  isRtl: a,
2280
2288
  scrollTarget: p
2281
2289
  });
2282
2290
  v(r);
2283
- let s = bn({
2291
+ let s = Tn({
2284
2292
  cachedBounds: x,
2285
2293
  containerScrollOffset: t,
2286
2294
  containerSize: n,
2287
2295
  itemCount: o,
2288
2296
  overscanCount: u
2289
2297
  });
2290
- E((e) => _n(s, e) ? e : s);
2298
+ E((e) => Sn(s, e) ? e : s);
2291
2299
  });
2292
- return $(() => {
2300
+ return en(() => {
2293
2301
  f && P();
2294
- }), $(() => {
2302
+ }), en(() => {
2295
2303
  if (!f || !e || !p) return;
2296
- let t = $t(e), n = () => P();
2304
+ let t = an(e), n = () => P();
2297
2305
  p.addEventListener("scroll", n, { passive: !0 }), e.addEventListener("scroll", n, { passive: !0 }), t.addEventListener("resize", n);
2298
- let r, i = en(e);
2299
- i && !ln(p) && (r = new i(n), r.observe(p));
2300
- let a = cn({
2301
- container: ln(p) ? p.document.documentElement : p,
2306
+ let r, i = on(e);
2307
+ i && !mn(p) && (r = new i(n), r.observe(p));
2308
+ let a = pn({
2309
+ container: mn(p) ? p.document.documentElement : p,
2302
2310
  element: e,
2303
2311
  onChange: n
2304
2312
  });
@@ -2313,9 +2321,9 @@ function wn({ containerElement: e, containerStyle: t, defaultContainerSize: n =
2313
2321
  ]), {
2314
2322
  getCellBounds: w,
2315
2323
  getEstimatedSize: j,
2316
- getScrollPositionForIndex: rn(({ align: t = "auto", index: n }) => {
2324
+ getScrollPositionForIndex: ln(({ align: t = "auto", index: n }) => {
2317
2325
  let r = ({ clamp: e, containerScrollOffset: r, containerSize: i, padding: a }) => {
2318
- if (a.start === 0 && a.end === 0) return yn({
2326
+ if (a.start === 0 && a.end === 0) return wn({
2319
2327
  align: t,
2320
2328
  cachedBounds: x,
2321
2329
  clamp: e,
@@ -2325,7 +2333,7 @@ function wn({ containerElement: e, containerStyle: t, defaultContainerSize: n =
2325
2333
  itemCount: o,
2326
2334
  itemSize: b
2327
2335
  });
2328
- let s = yn({
2336
+ let s = wn({
2329
2337
  align: t,
2330
2338
  cachedBounds: x,
2331
2339
  clamp: !1,
@@ -2337,8 +2345,8 @@ function wn({ containerElement: e, containerStyle: t, defaultContainerSize: n =
2337
2345
  }) - a.start;
2338
2346
  return e ? Math.max(0, Math.min(j() - i, s)) : s;
2339
2347
  };
2340
- if (f && e && p && !pn(e, i)) {
2341
- let { viewportOffset: t, viewportSize: n } = mn({
2348
+ if (f && e && p && !vn(e, i)) {
2349
+ let { viewportOffset: t, viewportSize: n } = yn({
2342
2350
  containerElement: e,
2343
2351
  direction: i,
2344
2352
  isRtl: a,
@@ -2347,7 +2355,7 @@ function wn({ containerElement: e, containerStyle: t, defaultContainerSize: n =
2347
2355
  clamp: !1,
2348
2356
  containerScrollOffset: t,
2349
2357
  containerSize: n,
2350
- padding: hn({
2358
+ padding: bn({
2351
2359
  direction: i,
2352
2360
  isRtl: a,
2353
2361
  scrollTarget: p,
@@ -2355,20 +2363,20 @@ function wn({ containerElement: e, containerStyle: t, defaultContainerSize: n =
2355
2363
  })
2356
2364
  }) - t, s = i === "horizontal" && a ? -o : o;
2357
2365
  return {
2358
- scrollOffset: dn(p, i) + s,
2366
+ scrollOffset: gn(p, i) + s,
2359
2367
  scrollTarget: p
2360
2368
  };
2361
2369
  }
2362
2370
  let s = e ? i === "vertical" ? e.scrollTop : e.scrollLeft : 0, c = f && e ? i === "vertical" ? e.clientHeight : e.clientWidth : y, l = r({
2363
2371
  clamp: !0,
2364
- containerScrollOffset: sn({
2372
+ containerScrollOffset: fn({
2365
2373
  containerElement: e,
2366
2374
  direction: i,
2367
2375
  isRtl: a,
2368
2376
  scrollOffset: s
2369
2377
  }),
2370
2378
  containerSize: c,
2371
- padding: e ? hn({
2379
+ padding: e ? bn({
2372
2380
  direction: i,
2373
2381
  isRtl: a,
2374
2382
  scrollTarget: e,
@@ -2379,14 +2387,14 @@ function wn({ containerElement: e, containerStyle: t, defaultContainerSize: n =
2379
2387
  }
2380
2388
  });
2381
2389
  if (e && (!f || p)) {
2382
- if (l = sn({
2390
+ if (l = fn({
2383
2391
  containerElement: e,
2384
2392
  direction: i,
2385
2393
  isRtl: a,
2386
2394
  scrollOffset: l
2387
2395
  }), !f && typeof e.scrollTo != "function") {
2388
2396
  let e = M(l);
2389
- _n(T, e) || E(e);
2397
+ Sn(T, e) || E(e);
2390
2398
  }
2391
2399
  return {
2392
2400
  scrollOffset: l,
@@ -2401,33 +2409,33 @@ function wn({ containerElement: e, containerStyle: t, defaultContainerSize: n =
2401
2409
  stopIndexVisible: k
2402
2410
  };
2403
2411
  }
2404
- function Tn(e) {
2405
- let [t, n] = q(e);
2406
- return _n(t, e) ? t : (n(e), e);
2412
+ function An(e) {
2413
+ let [t, n] = J(e);
2414
+ return Sn(t, e) ? t : (n(e), e);
2407
2415
  }
2408
- function En(e, t) {
2416
+ function jn(e, t) {
2409
2417
  let { ariaAttributes: n, style: r, ...i } = e, { ariaAttributes: a, style: o, ...s } = t;
2410
- return _n(n, a) && _n(r, o) && _n(i, s);
2418
+ return Sn(n, a) && Sn(r, o) && Sn(i, s);
2411
2419
  }
2412
- var Dn = "data-react-window-index", On = "data-index";
2413
- function kn(e) {
2414
- let t = e.getAttribute(Dn) ?? e.getAttribute(On);
2420
+ var Mn = "data-react-window-index", Nn = "data-index";
2421
+ function Pn(e) {
2422
+ let t = e.getAttribute(Mn) ?? e.getAttribute(Nn);
2415
2423
  return t !== null && /^\d+$/.test(t) ? Number(t) : void 0;
2416
2424
  }
2417
- var An = 1e3, jn = 500;
2418
- function Mn(e) {
2425
+ var Fn = 1e3, In = 500;
2426
+ function Ln(e) {
2419
2427
  return 1 - (1 - e) ** 3;
2420
2428
  }
2421
- function Nn({ direction: e, element: t, getCellBounds: n, isDynamicSize: r, itemCount: i, itemElements: a, scrollTarget: o, getScrollPositionForIndex: s }) {
2422
- let c = e === "vertical", l = K(null), u = K(void 0), d = rn(() => {
2429
+ function Rn({ direction: e, element: t, getCellBounds: n, isDynamicSize: r, itemCount: i, itemElements: a, scrollTarget: o, getScrollPositionForIndex: s }) {
2430
+ let c = e === "vertical", l = q(null), u = q(void 0), d = ln(() => {
2423
2431
  l.current = null, u.current !== void 0 && (u.current.view.cancelAnimationFrame(u.current.id), u.current = void 0);
2424
- }), f = rn(() => {
2425
- let e = $t(t);
2432
+ }), f = ln(() => {
2433
+ let e = an(t);
2426
2434
  u.current = {
2427
2435
  id: e.requestAnimationFrame(p),
2428
2436
  view: e
2429
2437
  };
2430
- }), p = rn(() => {
2438
+ }), p = ln(() => {
2431
2439
  u.current = void 0;
2432
2440
  let o = l.current;
2433
2441
  if (!o) return;
@@ -2441,27 +2449,27 @@ function Nn({ direction: e, element: t, getCellBounds: n, isDynamicSize: r, item
2441
2449
  index: o.index
2442
2450
  });
2443
2451
  if (m !== void 0) {
2444
- let { scrollOffset: t, scrollTarget: r } = m, s = Math.max(0, Math.min(t, fn(r, e)));
2452
+ let { scrollOffset: t, scrollTarget: r } = m, s = Math.max(0, Math.min(t, _n(r, e)));
2445
2453
  o.animation === void 0 && (o.animation = {
2446
- deadline: p + (o.smooth ? jn : 0) + An,
2447
- startOffset: dn(r, e),
2454
+ deadline: p + (o.smooth ? In : 0) + Fn,
2455
+ startOffset: gn(r, e),
2448
2456
  startTime: p
2449
2457
  });
2450
- let l = o.smooth ? (p - o.animation.startTime) / jn : 1;
2458
+ let l = o.smooth ? (p - o.animation.startTime) / In : 1;
2451
2459
  if (l < 1) {
2452
2460
  let { startOffset: e } = o.animation;
2453
2461
  o.stableFrames = 0, r.scrollTo({
2454
2462
  behavior: "instant",
2455
- [c ? "top" : "left"]: e + (s - e) * Mn(l)
2463
+ [c ? "top" : "left"]: e + (s - e) * Ln(l)
2456
2464
  });
2457
- } else if (Math.abs(s - dn(r, e)) > 1) o.stableFrames = 0, r.scrollTo({
2465
+ } else if (Math.abs(s - gn(r, e)) > 1) o.stableFrames = 0, r.scrollTo({
2458
2466
  behavior: "instant",
2459
2467
  [c ? "top" : "left"]: s
2460
2468
  });
2461
2469
  else {
2462
2470
  let e = a.current;
2463
- if (!(e.some((e) => kn(e) === o.index) && e.every((e) => {
2464
- let t = kn(e);
2471
+ if (!(e.some((e) => Pn(e) === o.index) && e.every((e) => {
2472
+ let t = Pn(e);
2465
2473
  if (t === void 0 || t >= i) return !0;
2466
2474
  let r = c ? e.offsetHeight : e.offsetWidth;
2467
2475
  return Math.abs(n(t).size - r) <= 1;
@@ -2474,7 +2482,7 @@ function Nn({ direction: e, element: t, getCellBounds: n, isDynamicSize: r, item
2474
2482
  }
2475
2483
  f();
2476
2484
  });
2477
- return $(() => {
2485
+ return en(() => {
2478
2486
  let e = o ?? t;
2479
2487
  if (!e) return;
2480
2488
  let n = (e) => {
@@ -2497,13 +2505,13 @@ function Nn({ direction: e, element: t, getCellBounds: n, isDynamicSize: r, item
2497
2505
  d,
2498
2506
  t,
2499
2507
  o
2500
- ]), U(({ align: n = "auto", behavior: i = "auto", index: a }) => {
2508
+ ]), W(({ align: n = "auto", behavior: i = "auto", index: a }) => {
2501
2509
  if (r && n === "smart") {
2502
2510
  let t = s({
2503
2511
  align: "auto",
2504
2512
  index: a
2505
2513
  });
2506
- n = t === void 0 || t.scrollOffset === dn(t.scrollTarget, e) ? "auto" : "center";
2514
+ n = t === void 0 || t.scrollOffset === gn(t.scrollTarget, e) ? "auto" : "center";
2507
2515
  }
2508
2516
  let o = s({
2509
2517
  align: n,
@@ -2535,11 +2543,11 @@ function Nn({ direction: e, element: t, getCellBounds: n, isDynamicSize: r, item
2535
2543
  s
2536
2544
  ]);
2537
2545
  }
2538
- function Pn({ callback: e, element: t, enabled: n = !0 }) {
2539
- let r = rn(e);
2540
- W(() => {
2546
+ function zn({ callback: e, element: t, enabled: n = !0 }) {
2547
+ let r = ln(e);
2548
+ G(() => {
2541
2549
  if (!n || !t) return;
2542
- let e = $t(t), i = e.requestAnimationFrame(() => {
2550
+ let e = an(t), i = e.requestAnimationFrame(() => {
2543
2551
  i = e.requestAnimationFrame(r);
2544
2552
  });
2545
2553
  return () => {
@@ -2551,7 +2559,7 @@ function Pn({ callback: e, element: t, enabled: n = !0 }) {
2551
2559
  r
2552
2560
  ]);
2553
2561
  }
2554
- function Fn({ elements: e, isFlowLayout: t, rowCount: n, startIndex: r, stopIndex: i }) {
2562
+ function Bn({ elements: e, isFlowLayout: t, rowCount: n, startIndex: r, stopIndex: i }) {
2555
2563
  if (r < 0 || i < r) return [];
2556
2564
  let a = [], o = /* @__PURE__ */ new Set(), s = !0;
2557
2565
  for (let t of e) {
@@ -2574,20 +2582,20 @@ function Fn({ elements: e, isFlowLayout: t, rowCount: n, startIndex: r, stopInde
2574
2582
  index: r + t
2575
2583
  }));
2576
2584
  }
2577
- function In(e) {
2585
+ function Vn(e) {
2578
2586
  return typeof e == "object" && !!e && "getAverageRowHeight" in e && typeof e.getAverageRowHeight == "function";
2579
2587
  }
2580
- var Ln = "data-react-window-sizer";
2581
- function Rn({ children: e, className: t, defaultHeight: n = 0, defaultScrollOffset: r = 0, listRef: i, onResize: a, onRowsRendered: o, overscanCount: s = 3, rowComponent: c, rowCount: l, rowHeight: u, rowKey: d, rowProps: f, scrollElement: p, tagName: m = "div", style: h, ...g }) {
2582
- let _ = Tn(f), v = G(() => Ae(c, En), [c]), [y, b] = q(null), x = In(u), S = G(() => x ? (e) => u.getRowHeight(e) ?? u.getAverageRowHeight() : u, [x, u]), C = Qt(), [w, T] = q(() => C && x), E = K(u);
2583
- $(() => {
2588
+ var Hn = "data-react-window-sizer";
2589
+ function Un({ children: e, className: t, defaultHeight: n = 0, defaultScrollOffset: r = 0, listRef: i, onResize: a, onRowsRendered: o, overscanCount: s = 3, rowComponent: c, rowCount: l, rowHeight: u, rowKey: d, rowProps: f, scrollElement: p, tagName: m = "div", style: h, ...g }) {
2590
+ let _ = An(f), v = K(() => je(c, jn), [c]), [y, b] = J(null), x = Vn(u), S = K(() => x ? (e) => u.getRowHeight(e) ?? u.getAverageRowHeight() : u, [x, u]), C = rn(), [w, T] = J(() => C && x), E = q(u);
2591
+ en(() => {
2584
2592
  w && E.current !== u && T(!1);
2585
- }, [w, u]), Pn({
2593
+ }, [w, u]), zn({
2586
2594
  callback: () => T(!1),
2587
2595
  element: y,
2588
2596
  enabled: w
2589
2597
  });
2590
- let { getCellBounds: D, getEstimatedSize: O, scrollTarget: k, getScrollPositionForIndex: A, startIndexOverscan: j, startIndexVisible: M, stopIndexOverscan: N, stopIndexVisible: P } = wn({
2598
+ let { getCellBounds: D, getEstimatedSize: O, scrollTarget: k, getScrollPositionForIndex: A, startIndexOverscan: j, startIndexVisible: M, stopIndexOverscan: N, stopIndexVisible: P } = kn({
2591
2599
  containerElement: y,
2592
2600
  containerStyle: h,
2593
2601
  defaultContainerSize: n,
@@ -2599,7 +2607,7 @@ function Rn({ children: e, className: t, defaultHeight: n = 0, defaultScrollOffs
2599
2607
  onResize: a,
2600
2608
  overscanCount: s,
2601
2609
  scrollElement: p
2602
- }), ee = K([]), F = Nn({
2610
+ }), ee = q([]), F = Rn({
2603
2611
  direction: "vertical",
2604
2612
  element: y,
2605
2613
  getCellBounds: D,
@@ -2609,16 +2617,16 @@ function Rn({ children: e, className: t, defaultHeight: n = 0, defaultScrollOffs
2609
2617
  scrollTarget: k,
2610
2618
  getScrollPositionForIndex: A
2611
2619
  });
2612
- Me(i, () => ({
2620
+ Ne(i, () => ({
2613
2621
  get element() {
2614
2622
  return y;
2615
2623
  },
2616
2624
  scrollToRow: F
2617
2625
  }), [y, F]);
2618
2626
  let I = w && x && j === 0;
2619
- $(() => {
2627
+ en(() => {
2620
2628
  if (!y) return;
2621
- let e = Array.from(y.children).filter((e) => !e.hasAttribute(Ln)), t = Fn({
2629
+ let e = Array.from(y.children).filter((e) => !e.hasAttribute(Hn)), t = Bn({
2622
2630
  elements: e,
2623
2631
  isFlowLayout: I,
2624
2632
  rowCount: l,
@@ -2626,9 +2634,9 @@ function Rn({ children: e, className: t, defaultHeight: n = 0, defaultScrollOffs
2626
2634
  stopIndex: N
2627
2635
  }), n = t.map(({ element: e }) => e);
2628
2636
  if (e.forEach((e) => {
2629
- n.includes(e) || e.removeAttribute(Dn);
2637
+ n.includes(e) || e.removeAttribute(Mn);
2630
2638
  }), t.forEach(({ element: e, index: t }) => {
2631
- e.setAttribute(Dn, `${t}`);
2639
+ e.setAttribute(Mn, `${t}`);
2632
2640
  }), ee.current = n, x) return u.observeRowElements(n);
2633
2641
  }, [
2634
2642
  v,
@@ -2641,7 +2649,7 @@ function Rn({ children: e, className: t, defaultHeight: n = 0, defaultScrollOffs
2641
2649
  _,
2642
2650
  j,
2643
2651
  N
2644
- ]), W(() => {
2652
+ ]), G(() => {
2645
2653
  j >= 0 && N >= 0 && o && o({
2646
2654
  startIndex: M,
2647
2655
  stopIndex: P
@@ -2656,11 +2664,11 @@ function Rn({ children: e, className: t, defaultHeight: n = 0, defaultScrollOffs
2656
2664
  N,
2657
2665
  P
2658
2666
  ]);
2659
- let L = G(() => {
2667
+ let te = K(() => {
2660
2668
  let e = [];
2661
2669
  if (l > 0) for (let t = j; t <= N; t++) {
2662
2670
  let n = D(t);
2663
- e.push(/* @__PURE__ */ Oe(v, {
2671
+ e.push(/* @__PURE__ */ ke(v, {
2664
2672
  ..._,
2665
2673
  ariaAttributes: {
2666
2674
  "aria-posinset": t + 1,
@@ -2689,9 +2697,9 @@ function Rn({ children: e, className: t, defaultHeight: n = 0, defaultScrollOffs
2689
2697
  _,
2690
2698
  j,
2691
2699
  N
2692
- ]), R = /* @__PURE__ */ V("div", {
2700
+ ]), L = /* @__PURE__ */ H("div", {
2693
2701
  "aria-hidden": !0,
2694
- [Ln]: "",
2702
+ [Hn]: "",
2695
2703
  style: {
2696
2704
  position: I ? "absolute" : void 0,
2697
2705
  top: I ? 0 : void 0,
@@ -2699,8 +2707,8 @@ function Rn({ children: e, className: t, defaultHeight: n = 0, defaultScrollOffs
2699
2707
  width: "100%",
2700
2708
  zIndex: -1
2701
2709
  }
2702
- }, "sizer"), z = /* @__PURE__ */ V(De, { children: e }, "children"), B = /* @__PURE__ */ V(De, { children: L }, "rows");
2703
- return Oe(m, {
2710
+ }, "sizer"), R = /* @__PURE__ */ H(Oe, { children: e }, "children"), z = /* @__PURE__ */ H(Oe, { children: te }, "rows");
2711
+ return ke(m, {
2704
2712
  role: "list",
2705
2713
  ...g,
2706
2714
  className: t,
@@ -2714,9 +2722,9 @@ function Rn({ children: e, className: t, defaultHeight: n = 0, defaultScrollOffs
2714
2722
  },
2715
2723
  ...h
2716
2724
  }
2717
- }, ...I ? [z, B] : [B, z], R);
2725
+ }, ...I ? [R, z] : [z, R], L);
2718
2726
  }
2719
- var zn = /* @__PURE__ */ Object.assign(Rn, { displayName: "List" }), Bn = {
2727
+ var Wn = /* @__PURE__ */ Object.assign(Un, { displayName: "List" }), Gn = {
2720
2728
  search: "_search_5skzl_1",
2721
2729
  divider: "_divider_5skzl_5",
2722
2730
  item: "_item_5skzl_9",
@@ -2725,42 +2733,42 @@ var zn = /* @__PURE__ */ Object.assign(Rn, { displayName: "List" }), Bn = {
2725
2733
  stateLabel: "_stateLabel_5skzl_27",
2726
2734
  itemSelectedBackground: "_itemSelectedBackground_5skzl_37",
2727
2735
  itemSelectedText: "_itemSelectedText_5skzl_41"
2728
- }, Vn = 44, Hn = 8, Un = ({ index: e, style: t, ariaAttributes: n, items: r, selectedDeploymentId: i, labelClassName: a, query: o, itemClassName: s, selectedItemClassName: c, hasSelectedBackground: u, hasSelectedText: d, onSelect: f }) => {
2729
- let p = r[e], m = qt(p.iconUrl, p.type, p.displayName ?? p.id, v.SM), g = p.id === i;
2730
- return /* @__PURE__ */ V("div", {
2736
+ }, Kn = 44, qn = 8, Jn = ({ index: e, style: t, ariaAttributes: n, items: r, selectedDeploymentId: i, labelClassName: a, query: o, itemClassName: s, selectedItemClassName: c, hasSelectedBackground: l, hasSelectedText: u, onSelect: f }) => {
2737
+ let p = r[e], m = Zt(p.iconUrl, p.type, p.displayName ?? p.id, b.SM), h = p.id === i;
2738
+ return /* @__PURE__ */ H("div", {
2731
2739
  style: t,
2732
2740
  ...n,
2733
- children: /* @__PURE__ */ V(h, {
2741
+ children: /* @__PURE__ */ H(_, {
2734
2742
  type: "button",
2735
- "aria-current": g ? "true" : void 0,
2736
- className: l(Bn.item, "h-full w-full gap-3 px-4", g && u && Bn.itemSelectedBackground, g && d && Bn.itemSelectedText, s, g && c, J.modelMenuItem, g && J.modelMenuItemSelected),
2737
- iconBefore: /* @__PURE__ */ V("span", {
2738
- className: Bn.itemIcon,
2743
+ "aria-current": h ? "true" : void 0,
2744
+ className: d(Gn.item, "h-full w-full gap-3 px-4", h && l && Gn.itemSelectedBackground, h && u && Gn.itemSelectedText, s, h && c, Y.modelMenuItem, h && Y.modelMenuItemSelected),
2745
+ iconBefore: /* @__PURE__ */ H("span", {
2746
+ className: Gn.itemIcon,
2739
2747
  children: m
2740
2748
  }),
2741
- label: /* @__PURE__ */ H("span", {
2749
+ label: /* @__PURE__ */ U("span", {
2742
2750
  className: "flex flex-1 items-center justify-between gap-2",
2743
- children: [/* @__PURE__ */ V(T, {
2751
+ children: [/* @__PURE__ */ H(D, {
2744
2752
  text: p.displayName ?? p.id,
2745
2753
  query: o,
2746
2754
  maxLines: 1,
2747
- className: l(a, "min-w-0 flex-1 text-start")
2748
- }), g && /* @__PURE__ */ V(ge, {
2749
- size: v.SM,
2750
- className: Bn.checkIcon,
2755
+ className: d(a, "min-w-0 flex-1 text-start")
2756
+ }), h && /* @__PURE__ */ H(_e, {
2757
+ size: b.SM,
2758
+ className: Gn.checkIcon,
2751
2759
  "aria-hidden": !0,
2752
- stroke: y
2760
+ stroke: x
2753
2761
  })]
2754
2762
  }),
2755
2763
  onClick: () => f(p.id)
2756
2764
  })
2757
2765
  });
2758
- }, Wn = ({ 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: _, searchQuery: v, onSearchQueryChange: y }) => {
2759
- let [b, x] = q(""), C = v ?? b, w = y ?? x;
2760
- W(() => {
2766
+ }, Yn = ({ isOpen: e, title: t, closeLabel: n, searchPlaceholder: r = "Search", onClose: i, deployments: a, selectedDeploymentId: o, onSelect: s, loadingLabel: l, errorLabel: u, emptyLabel: f, style: p, titleClassName: m = "dial-body-semi-text", labelClassName: h = "dial-small-text", colors: g, menuStyles: _, searchQuery: v, onSearchQueryChange: y }) => {
2767
+ let [b, x] = J(""), S = v ?? b, C = y ?? x;
2768
+ G(() => {
2761
2769
  e || x("");
2762
2770
  }, [e]);
2763
- let T = a && a.length > 0, D = u !== void 0, O = !T && !D ? d ?? f : void 0, k = T ? Kt(a, C) : [], A = (e) => {
2771
+ let T = a && a.length > 0, E = l !== void 0, D = !T && !E ? u ?? f : void 0, k = T ? Xt(a, S) : [], A = (e) => {
2764
2772
  s(e), i();
2765
2773
  }, j = _?.colors, M = c({
2766
2774
  "--ci-sheet-divider": g?.divider,
@@ -2772,63 +2780,63 @@ var zn = /* @__PURE__ */ Object.assign(Rn, { displayName: "List" }), Bn = {
2772
2780
  "--ci-sheet-selected-bg": j?.selectedItemBackground,
2773
2781
  "--ci-sheet-selected-text": j?.selectedItemText
2774
2782
  }), N;
2775
- return N = D ? /* @__PURE__ */ V(Wt, {}) : O ? /* @__PURE__ */ V("div", {
2783
+ return N = E ? /* @__PURE__ */ H(Jt, {}) : D ? /* @__PURE__ */ H("div", {
2776
2784
  role: "list",
2777
- className: l(Bn.stateLabel, h, "px-4 py-4"),
2778
- children: O
2779
- }) : /* @__PURE__ */ V(zn, {
2785
+ className: d(Gn.stateLabel, h, "px-4 py-4"),
2786
+ children: D
2787
+ }) : /* @__PURE__ */ H(Wn, {
2780
2788
  role: "list",
2781
2789
  className: "overflow-y-auto",
2782
- style: { height: Math.min(k.length, Hn) * Vn },
2783
- rowComponent: Un,
2790
+ style: { height: Math.min(k.length, qn) * Kn },
2791
+ rowComponent: Jn,
2784
2792
  rowCount: k.length,
2785
- rowHeight: Vn,
2793
+ rowHeight: Kn,
2786
2794
  rowProps: {
2787
2795
  items: k,
2788
2796
  selectedDeploymentId: o,
2789
2797
  labelClassName: h,
2790
- query: C,
2798
+ query: S,
2791
2799
  itemClassName: _?.itemClassName,
2792
2800
  selectedItemClassName: _?.selectedItemClassName,
2793
2801
  hasSelectedBackground: !!j?.selectedItemBackground,
2794
2802
  hasSelectedText: !!j?.selectedItemText,
2795
2803
  onSelect: A
2796
2804
  }
2797
- }), /* @__PURE__ */ V(Ie, {
2805
+ }), /* @__PURE__ */ H(Le, {
2798
2806
  isOpen: e,
2799
2807
  title: t,
2800
2808
  closeLabel: n,
2801
2809
  onClose: i,
2802
2810
  style: p,
2803
2811
  titleClassName: m,
2804
- className: l("max-h-[80dvh]", _?.className, J.modelMenu),
2812
+ className: d("max-h-[80dvh]", _?.className, Y.modelMenu),
2805
2813
  colors: g?.shell,
2806
- children: /* @__PURE__ */ H("div", {
2814
+ children: /* @__PURE__ */ U("div", {
2807
2815
  className: "contents",
2808
2816
  style: M,
2809
2817
  children: [
2810
- /* @__PURE__ */ V(E, {
2818
+ /* @__PURE__ */ H(O, {
2811
2819
  visuallyHidden: !0,
2812
- children: D ? u : null
2820
+ children: E ? l : null
2813
2821
  }),
2814
- T && !D && /* @__PURE__ */ H(ue, { children: [/* @__PURE__ */ V("div", {
2822
+ T && !E && /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H("div", {
2815
2823
  style: c({ "--ci-sheet-search-bg": _?.colors?.searchHeaderBackground }),
2816
- className: l("shrink-0 px-4 py-[10px]", Bn.search, _?.searchHeaderClassName, J.modelMenuSearch),
2817
- children: /* @__PURE__ */ V(te, {
2818
- value: C,
2824
+ className: d("shrink-0 px-4 py-[10px]", Gn.search, _?.searchHeaderClassName, Y.modelMenuSearch),
2825
+ children: /* @__PURE__ */ H(re, {
2826
+ value: S,
2819
2827
  placeholder: r,
2820
- size: S.Standard,
2821
- onChange: (e) => w(e ?? "")
2828
+ size: w.Standard,
2829
+ onChange: (e) => C(e ?? "")
2822
2830
  })
2823
- }), /* @__PURE__ */ V("div", { className: l(Bn.divider, "h-px shrink-0") })] }),
2831
+ }), /* @__PURE__ */ H("div", { className: d(Gn.divider, "h-px shrink-0") })] }),
2824
2832
  N
2825
2833
  ]
2826
2834
  })
2827
2835
  });
2828
- }, Gn = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, menuStyles: i, nameClassName: a = "dial-small-text", versionClassName: o = "dial-tiny-text", isStreaming: u, isMobile: d, isDisabled: f = !1, style: p, modelPickerOverlay: m, isPickerOpen: g, onPickerToggle: _, onPickerOpenChange: S }) => {
2829
- let [C, T] = q(!1), E = g ?? C, D = (e) => {
2830
- T(e), S?.(e), I(e);
2831
- }, { searchQuery: O, onSearchQueryChange: k, selectorIcon: A, selectorAriaLabel: j, selectedLabel: M, selectedVersion: N, menuItems: P, menuHeader: ee, menuStyle: F, onOpenChange: I } = Yt({
2836
+ }, Xn = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, menuStyles: i, nameClassName: a = "dial-small-text", versionClassName: o = "dial-tiny-text", isStreaming: l, isMobile: u, isDisabled: f = !1, style: p, modelPickerOverlay: m, isPickerOpen: h, onPickerToggle: g, onPickerOpenChange: v }) => {
2837
+ let [y, w] = J(!1), T = h ?? y, D = (e) => {
2838
+ w(e), v?.(e), te(e);
2839
+ }, { searchQuery: O, onSearchQueryChange: k, selectorIcon: A, selectorAriaLabel: j, unavailableTooltip: M, selectedLabel: N, selectedVersion: P, menuItems: ee, menuHeader: F, menuStyle: I, onOpenChange: te } = $t({
2832
2840
  deployments: e,
2833
2841
  selectedDeploymentId: t,
2834
2842
  onDeploymentChange: n,
@@ -2836,18 +2844,18 @@ var zn = /* @__PURE__ */ Object.assign(Rn, { displayName: "List" }), Bn = {
2836
2844
  styles: i
2837
2845
  });
2838
2846
  if (!e) return null;
2839
- let L = u || f, R = L ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0, z = /* @__PURE__ */ V(_e, {
2840
- size: v.SM,
2841
- className: l(X.modelSelectorCaret, J.modelSelectorCaret),
2847
+ let L = l || f, R = L ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0, z = /* @__PURE__ */ H(ve, {
2848
+ size: b.SM,
2849
+ className: d(Z.modelSelectorCaret, Y.modelSelectorCaret),
2842
2850
  "aria-hidden": !0,
2843
- stroke: y
2844
- }), B = /* @__PURE__ */ V("span", {
2845
- className: l("flex shrink-0 items-center", J.modelSelectorIcon),
2851
+ stroke: x
2852
+ }), B = /* @__PURE__ */ H("span", {
2853
+ className: d("flex shrink-0 items-center", Y.modelSelectorIcon),
2846
2854
  children: A
2847
2855
  });
2848
- if (d) return /* @__PURE__ */ H(ue, { children: [/* @__PURE__ */ V(w, {
2849
- tooltipProps: { tooltip: M },
2850
- icon: /* @__PURE__ */ H("div", {
2856
+ if (u) return /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H(E, {
2857
+ tooltipProps: { tooltip: M ?? N },
2858
+ icon: /* @__PURE__ */ U("div", {
2851
2859
  className: "flex items-center gap-1",
2852
2860
  children: [B, z]
2853
2861
  }),
@@ -2856,19 +2864,19 @@ var zn = /* @__PURE__ */ Object.assign(Rn, { displayName: "List" }), Bn = {
2856
2864
  onClick: () => {
2857
2865
  L || D(!0);
2858
2866
  },
2859
- className: l("w-[50px]", X.modelSelectorButton, R, J.modelSelectorButton)
2860
- }), m ? /* @__PURE__ */ V(Ie, {
2861
- isOpen: E,
2867
+ className: d("w-[50px]", Z.modelSelectorButton, R, Y.modelSelectorButton)
2868
+ }), m ? /* @__PURE__ */ H(Le, {
2869
+ isOpen: T,
2862
2870
  title: r?.ariaLabel ?? "Select model",
2863
2871
  closeLabel: r?.closeLabel ?? "Close",
2864
2872
  onClose: () => D(!1),
2865
2873
  style: p,
2866
- className: l(i?.className, J.modelMenu),
2874
+ className: d(i?.className, Y.modelMenu),
2867
2875
  children: m(() => D(!1))
2868
- }) : /* @__PURE__ */ V(Wn, {
2876
+ }) : /* @__PURE__ */ H(Yn, {
2869
2877
  searchQuery: O,
2870
2878
  onSearchQueryChange: k,
2871
- isOpen: E,
2879
+ isOpen: T,
2872
2880
  title: r?.ariaLabel ?? "Select model",
2873
2881
  closeLabel: r?.closeLabel ?? "Close",
2874
2882
  searchPlaceholder: r?.searchPlaceholder ?? "Search",
@@ -2883,441 +2891,441 @@ var zn = /* @__PURE__ */ Object.assign(Rn, { displayName: "List" }), Bn = {
2883
2891
  menuStyles: i
2884
2892
  })] });
2885
2893
  if (m) {
2886
- let e = N ? `${M} · ${N}` : M;
2887
- return /* @__PURE__ */ V(b, {
2894
+ let e = P ? `${N} · ${P}` : N;
2895
+ return /* @__PURE__ */ H(S, {
2888
2896
  placement: "top-end",
2889
2897
  matchReferenceWidth: !1,
2890
- open: E,
2898
+ open: T,
2891
2899
  onOpenChange: D,
2892
2900
  trigger: [],
2893
2901
  outsideClosable: !0,
2894
- overlayRole: x.Dialog,
2902
+ overlayRole: C.Dialog,
2895
2903
  overlayAriaLabel: r?.ariaLabel ?? "Select model",
2896
2904
  renderOverlay: () => m(() => D(!1)),
2897
- listClassName: l("w-[368px]!", X.modelOverlayPanel, i?.className, J.modelMenu),
2905
+ listClassName: d("w-[368px]!", Z.modelOverlayPanel, i?.className, Y.modelMenu),
2898
2906
  listStyle: c({ "--ci-model-overlay-bg": i?.colors?.overlayBackground }),
2899
- children: /* @__PURE__ */ V(h, {
2907
+ children: /* @__PURE__ */ H(_, {
2900
2908
  "aria-label": j,
2901
2909
  "aria-disabled": L || void 0,
2902
- tooltipProps: { tooltip: e },
2903
- className: l("h-auto min-w-0 gap-1.5 rounded-full! border-0! px-0 py-1.5 ps-1.5 pe-2", X.modelSelectorButton, R, L && X.modelSelectorButtonDisabled, J.modelSelectorButton),
2910
+ tooltipProps: { tooltip: M ?? e },
2911
+ className: d("h-auto min-w-0 gap-1.5 rounded-full! border-0! px-0 py-1.5 ps-1.5 pe-2", Z.modelSelectorButton, R, L && Z.modelSelectorButtonDisabled, Y.modelSelectorButton),
2904
2912
  onClick: () => {
2905
- L || (_ ? _() : D(!E));
2913
+ L || (g ? g() : D(!T));
2906
2914
  },
2907
2915
  iconBefore: B,
2908
2916
  iconAfter: z,
2909
2917
  textClassName: "min-w-0",
2910
- label: /* @__PURE__ */ H("span", {
2918
+ label: /* @__PURE__ */ U("span", {
2911
2919
  className: "flex max-w-[180px] min-w-0 items-baseline gap-1",
2912
- children: [/* @__PURE__ */ V("span", {
2913
- className: l("max-w-[180px] shrink-0 truncate", a, X.modelSelectorName),
2914
- children: M
2915
- }), N && /* @__PURE__ */ V("span", {
2916
- className: l("min-w-0 truncate", o, X.modelSelectorVersion),
2920
+ children: [/* @__PURE__ */ H("span", {
2921
+ className: d("max-w-[180px] shrink-0 truncate", a, Z.modelSelectorName),
2917
2922
  children: N
2923
+ }), P && /* @__PURE__ */ H("span", {
2924
+ className: d("min-w-0 truncate", o, Z.modelSelectorVersion),
2925
+ children: P
2918
2926
  })]
2919
2927
  })
2920
2928
  })
2921
2929
  });
2922
2930
  }
2923
- return /* @__PURE__ */ V("div", {
2924
- className: l(R),
2931
+ return /* @__PURE__ */ H("div", {
2932
+ className: d(R),
2925
2933
  "aria-disabled": L || void 0,
2926
- children: /* @__PURE__ */ V(b, {
2927
- items: P,
2928
- menuHeader: ee,
2934
+ children: /* @__PURE__ */ H(S, {
2935
+ items: ee,
2936
+ menuHeader: F,
2929
2937
  placement: "bottom-end",
2930
2938
  matchReferenceWidth: !1,
2931
2939
  maxDropdownHeight: s,
2932
- listClassName: l("w-[240px]!", i?.className, J.modelMenu),
2933
- listStyle: F,
2940
+ listClassName: d("w-[240px]!", i?.className, Y.modelMenu),
2941
+ listStyle: I,
2934
2942
  disabled: L,
2935
- open: E,
2943
+ open: T,
2936
2944
  onOpenChange: L ? void 0 : D,
2937
- children: /* @__PURE__ */ V(h, {
2945
+ children: /* @__PURE__ */ H(_, {
2938
2946
  "aria-label": j,
2939
2947
  "aria-disabled": L || void 0,
2940
- tooltipProps: { tooltip: M },
2948
+ tooltipProps: { tooltip: M ?? N },
2941
2949
  iconBefore: B,
2942
2950
  iconAfter: z,
2943
- className: l("h-auto gap-1 rounded-full! border-0! p-1.5", X.modelSelectorButton, L && X.modelSelectorButtonDisabled, J.modelSelectorButton)
2951
+ className: d("h-auto gap-1 rounded-full! border-0! p-1.5", Z.modelSelectorButton, L && Z.modelSelectorButtonDisabled, Y.modelSelectorButton)
2944
2952
  })
2945
2953
  })
2946
2954
  });
2947
- }, Kn = ke(({ message: e = "", messageRevision: t, focusRequestId: n, textInsertion: r, onSend: i, onUploadAttachment: a, onStop: o, isStreaming: s = !1, onChange: c, onAttachmentsChange: u, placeholder: p = "Type a message...", ariaLabel: m, attachLabel: h = "Attach file", fileAccept: g, addMenuTitle: _ = "Add", menuTitle: b = "Menu", menuCloseLabel: x = "Close", removeLabel: S, retryLabel: T, uploadingLabel: k, expandLabel: A, clickLabel: j, sendLabel: M, sendTooltip: N, emptyMessageTooltip: P, stopLabel: ee, micLabel: F = "Dictate", recordVoiceLabel: I = "Record voice", stopRecordingLabel: L, discardRecordingLabel: R, colors: z, typography: B, attachmentTray: te, modelMenu: ne, className: re, pendingDropFiles: ie = [], onDropFilesConsumed: ae, pendingAttachments: oe = [], onPendingAttachmentsConsumed: se, pasteTextThreshold: ce = 4e3, maxMessageLength: le = 5e4, deployments: fe, selectedDeploymentId: pe, onDeploymentChange: me, modelSelectorLabels: he, initialAttachments: ge = [], hideAddButton: _e = !1, hideAttachFile: ve = !1, hideActionBar: ye = !1, actionRowLayout: xe = et.Stacked, isInlineActionRowAllowedBelowDesktop: Se = !1, renderFooterActions: Ce, isInputDisabled: we = !1, isModelSelectorDisabled: Te = !1, isSendDisabled: Ee = !1, isAudioMessageSupported: De = !1, isVoiceRecordingSupported: Oe = De, onTranscribeAudio: ke, transcribingLabel: Ae, voiceErrorLabel: je, sendOnEnter: Ne = $e.Enter, prefixAttachments: Pe = [], onRemovePrefixAttachment: Fe, chatSettings: Ie, toolsMenuItems: Le, onToolToggle: ze, canRemoveTools: Be = !0, toolsMenuTitle: Ue, toolsBackLabel: We, toolsChipLabels: Ke, menuOverlays: Je, activeMentions: Ye, onBackspaceAtCaret: Xe, caretPositionOverride: Ze, commandMenu: Qe, autoFocus: tt = !1, messageHistory: Y, onDialFileSystemClick: rt, dialFileSystemLabel: at, validateAttachment: st, onAttachmentClick: ct, modelPickerOverlay: lt, onModelPickerOpenChange: ut, maximumAttachmentsAmount: mt, onAttachmentsLimitExceeded: ht, isAttachmentsEnabled: gt = !0, isTextAttachmentsAllowed: _t = !0, usageLimitsSlot: yt, onMessageTooLong: bt }, xt) => {
2948
- let St = d(), Ct = f(), [wt, jt] = q(!1), Mt = (e) => {
2949
- jt(e), ut?.(e);
2950
- }, Nt = Ve(Y), Pt = Ye ?? [], Ft = Pt.length > 0, It = G(() => At(z), [z]), { message: Z, setMessage: Lt, textareaRef: Q } = He({
2955
+ }, Zn = Ae(({ message: e = "", messageRevision: t, focusRequestId: n, textInsertion: r, onSend: i, onUploadAttachment: a, onStop: o, isStreaming: s = !1, onChange: c, onAttachmentsChange: l, placeholder: u = "Type a message...", ariaLabel: f, attachLabel: h = "Attach file", fileAccept: g, addMenuTitle: _ = "Add", menuTitle: v = "Menu", menuCloseLabel: y = "Close", removeLabel: S, retryLabel: C, uploadingLabel: w, expandLabel: D, clickLabel: j, sendLabel: M, sendTooltip: N, emptyMessageTooltip: P, stopLabel: ee, micLabel: F = "Dictate", recordVoiceLabel: I = "Record voice", stopRecordingLabel: te, discardRecordingLabel: L, colors: R, typography: z, attachmentTray: B, modelMenu: ne, className: re, pendingDropFiles: ie = [], onDropFilesConsumed: ae, pendingAttachments: oe = [], onPendingAttachmentsConsumed: se, pasteTextThreshold: ce = 4e3, maxMessageLength: le = 5e4, deployments: ue, selectedDeploymentId: de, onDeploymentChange: pe, modelSelectorLabels: me, initialAttachments: he = [], hideAddButton: ge = !1, hideAttachFile: _e = !1, hideActionBar: ve = !1, actionRowLayout: ye = it.Stacked, isInlineActionRowAllowedBelowDesktop: be = !1, isToolChipRowAllowedOnPhone: Se = !1, renderFooterActions: Ce, isInputDisabled: we = !1, isModelSelectorDisabled: Te = !1, isSendDisabled: Ee = !1, isAudioMessageSupported: De = !1, isVoiceRecordingSupported: Oe = De, onTranscribeAudio: ke, transcribingLabel: Ae, voiceErrorLabel: je, sendOnEnter: Me = rt.Enter, prefixAttachments: Pe = [], onRemovePrefixAttachment: Fe, chatSettings: Ie, toolsMenuItems: Le, onToolToggle: Re, canRemoveTools: ze = !0, toolsMenuTitle: Be, toolsBackLabel: Ve, toolsChipLabels: Ue, menuOverlays: We, activeMentions: qe, onBackspaceAtCaret: Je, caretPositionOverride: Xe, commandMenu: Qe, autoFocus: $e = !1, messageHistory: et, onDialFileSystemClick: tt, dialFileSystemLabel: nt, validateAttachment: at, onAttachmentClick: X, modelPickerOverlay: st, onModelPickerOpenChange: lt, maximumAttachmentsAmount: dt, onAttachmentsLimitExceeded: ft, isAttachmentsEnabled: pt = !0, isTextAttachmentsAllowed: mt = !0, usageLimitsSlot: vt, onMessageTooLong: yt }, bt) => {
2956
+ let xt = p(), Ct = m(), wt = Ct && !Se, [Tt, Et] = J(!1), Dt = (e) => {
2957
+ Et(e), lt?.(e);
2958
+ }, Ot = Ge(et), Ft = qe ?? [], It = Ft.length > 0, Lt = K(() => Pt(R), [R]), { message: Q, setMessage: Rt, textareaRef: $ } = Ke({
2951
2959
  messageProp: e,
2952
2960
  messageRevision: t
2953
2961
  });
2954
- W(() => {
2955
- let e = Q.current;
2962
+ G(() => {
2963
+ let e = $.current;
2956
2964
  e != null && e.value.length !== 0 && document.activeElement === e && e.setSelectionRange(e.value.length, e.value.length);
2957
- }, [Q]), W(() => {
2958
- n !== void 0 && Q.current?.focus();
2959
- }, [n, Q]), Me(xt, () => ({ getCaretPosition: () => Q.current?.selectionStart ?? Z.length }), [Z, Q]);
2960
- let { handleUndoKeyDown: Rt, markCaretPlaced: Ht } = Ge({
2965
+ }, [$]), G(() => {
2966
+ n !== void 0 && $.current?.focus();
2967
+ }, [n, $]), Ne(bt, () => ({ getCaretPosition: () => $.current?.selectionStart ?? Q.length }), [Q, $]);
2968
+ let { handleUndoKeyDown: zt, markCaretPlaced: Bt } = Ye({
2961
2969
  insertion: r,
2962
- textareaRef: Q
2963
- }), { isMenuOpen: Ut, query: Wt, activeWordStart: Gt, closeOnOutsidePress: Kt, handleValueChange: qt, commandMenuListboxId: Jt, commandMenuOverlayRef: Yt, activeCommandOptionId: $, handleTextareaClick: Xt, handleTextareaFocus: Zt, handleTextareaKeyUp: Qt, skipFocusMenuEvaluationRef: $t, triggerEnd: en, hasCommandEmptyQueryHint: tn, markerOffset: nn, handleCloseCommandMenu: rn, isSendGesture: an, handleCommandMenuKeyDown: on } = Tt({
2970
+ textareaRef: $
2971
+ }), { isMenuOpen: Vt, query: Ht, activeWordStart: Kt, closeOnOutsidePress: qt, handleValueChange: Jt, commandMenuListboxId: Yt, commandMenuOverlayRef: Xt, activeCommandOptionId: Zt, handleTextareaClick: Qt, handleTextareaFocus: $t, handleTextareaKeyUp: en, skipFocusMenuEvaluationRef: tn, triggerEnd: nn, hasCommandEmptyQueryHint: rn, markerOffset: an, handleCloseCommandMenu: on, isSendGesture: sn, handleCommandMenuKeyDown: cn } = kt({
2964
2972
  commandMenu: Qe,
2965
- message: Z,
2966
- setMessage: Lt,
2967
- textareaRef: Q,
2968
- historyNav: Nt,
2973
+ message: Q,
2974
+ setMessage: Rt,
2975
+ textareaRef: $,
2976
+ historyNav: Ot,
2969
2977
  onChange: c,
2970
- caretPositionOverride: Ze,
2978
+ caretPositionOverride: Xe,
2971
2979
  messageRevision: t,
2972
- markCaretPlaced: Ht,
2973
- sendOnEnter: Ne
2974
- }), sn = K(Z);
2975
- sn.current = Z;
2976
- let { attachments: cn, buildAttachments: ln, addAttachments: un, resetAttachments: dn, handleRemove: fn, handleRetry: pn, handleExpand: mn, hasBlockedAttachments: hn } = Re({
2977
- initialAttachments: ge,
2980
+ markCaretPlaced: Bt,
2981
+ sendOnEnter: Me
2982
+ }), ln = q(Q);
2983
+ ln.current = Q;
2984
+ let { attachments: un, buildAttachments: dn, addAttachments: fn, resetAttachments: pn, handleRemove: mn, handleRetry: hn, handleExpand: gn, hasBlockedAttachments: _n } = He({
2985
+ initialAttachments: he,
2978
2986
  onUploadAttachment: a,
2979
- onAttachmentsChange: u,
2980
- validateAttachment: st,
2987
+ onAttachmentsChange: l,
2988
+ validateAttachment: at,
2981
2989
  pendingDropFiles: ie,
2982
2990
  onDropFilesConsumed: ae,
2983
2991
  isDropDisabled: we,
2984
2992
  pendingAttachments: oe,
2985
2993
  onPendingAttachmentsConsumed: se,
2986
- onExpandPastedText: U((e) => {
2987
- let t = sn.current, n = t ? `${t}\n${e}` : e;
2988
- sn.current = n, Lt(n), c?.(n);
2989
- }, [Lt, c]),
2990
- maximumAttachmentsAmount: mt,
2994
+ onExpandPastedText: W((e) => {
2995
+ let t = ln.current, n = t ? `${t}\n${e}` : e;
2996
+ ln.current = n, Rt(n), c?.(n);
2997
+ }, [Rt, c]),
2998
+ maximumAttachmentsAmount: dt,
2991
2999
  baseAttachmentsAmount: Pe.length,
2992
- onAttachmentsLimitExceeded: ht
2993
- }), { voiceState: gn, analyserNodeRef: _n, voiceError: vn, startRecording: yn, stopRecording: bn, discardRecording: xn, isVoiceActive: Sn, latestTranscript: Cn } = kt({
2994
- addAttachments: un,
2995
- buildAttachments: ln,
2996
- draftRef: sn,
2997
- setMessage: Lt,
2998
- historyNav: Nt,
3000
+ onAttachmentsLimitExceeded: ft
3001
+ }), { voiceState: vn, analyserNodeRef: yn, voiceError: bn, startRecording: xn, stopRecording: Sn, discardRecording: Cn, isVoiceActive: wn, latestTranscript: Tn } = Nt({
3002
+ addAttachments: fn,
3003
+ buildAttachments: dn,
3004
+ draftRef: ln,
3005
+ setMessage: Rt,
3006
+ historyNav: Ot,
2999
3007
  onChange: c,
3000
3008
  onTranscribeAudio: ke,
3001
3009
  voiceErrorLabel: je,
3002
- textareaRef: Q,
3003
- skipFocusMenuEvaluationRef: $t
3004
- }), wn = K(null), Tn = K(null), En = Dt({
3005
- addAttachments: un,
3006
- isAttachmentsEnabled: gt,
3007
- isTextAttachmentsAllowed: _t,
3010
+ textareaRef: $,
3011
+ skipFocusMenuEvaluationRef: tn
3012
+ }), En = q(null), Dn = q(null), On = jt({
3013
+ addAttachments: fn,
3014
+ isAttachmentsEnabled: pt,
3015
+ isTextAttachmentsAllowed: mt,
3008
3016
  pasteTextThreshold: ce,
3009
3017
  maxMessageLength: le,
3010
- onMessageTooLong: bt,
3018
+ onMessageTooLong: yt,
3011
3019
  commandMenu: Qe
3012
- }), Dn = Z.trim().length > 0 || cn.length > 0, On = Dn && !hn && !Ee && !Sn, { visibleTools: kn, handleToolDismiss: An } = Et({
3020
+ }), kn = Q.trim().length > 0 || un.length > 0, An = kn && !_n && !Ee && !wn, { visibleTools: jn, handleToolDismiss: Mn } = At({
3013
3021
  toolsMenuItems: Le,
3014
- canRemoveTools: Be,
3015
- onToolToggle: ze
3016
- }), [jn, Mn] = q(!1), Nn = fe === void 0 || pe != null, Pn = De && !s, { handleSend: Fn, handleKeyDown: In } = Ot({
3017
- message: Z,
3018
- setMessage: Lt,
3019
- attachments: cn,
3020
- resetAttachments: dn,
3021
- historyNav: Nt,
3022
+ canRemoveTools: ze,
3023
+ onToolToggle: Re
3024
+ }), [Nn, Pn] = J(!1), Fn = ue === void 0 || de != null, In = De && !s, { handleSend: Ln, handleKeyDown: Rn } = Mt({
3025
+ message: Q,
3026
+ setMessage: Rt,
3027
+ attachments: un,
3028
+ resetAttachments: pn,
3029
+ historyNav: Ot,
3022
3030
  onSend: i,
3023
- onMessageTooLong: bt,
3031
+ onMessageTooLong: yt,
3024
3032
  maxMessageLength: le,
3025
3033
  isSendDisabled: Ee,
3026
- isVoiceActive: Sn,
3034
+ isVoiceActive: wn,
3027
3035
  isInputDisabled: we,
3028
3036
  isStreaming: s,
3029
- canSend: On,
3030
- hasModelSelected: Nn,
3031
- handleUndoKeyDown: Rt,
3032
- handleCommandMenuKeyDown: on,
3033
- isSendGesture: an,
3034
- onBackspaceAtCaret: Xe
3035
- }), Ln = (e) => {
3037
+ canSend: An,
3038
+ hasModelSelected: Fn,
3039
+ handleUndoKeyDown: zt,
3040
+ handleCommandMenuKeyDown: cn,
3041
+ isSendGesture: sn,
3042
+ onBackspaceAtCaret: Je
3043
+ }), zn = (e) => {
3036
3044
  let t = Array.from(e.target.files ?? []);
3037
3045
  if (t.length === 0) return;
3038
- let n = ln(t);
3039
- e.target.value = "", un(n);
3040
- }, { textareaAreaRef: Rn, caretAnchor: zn, mirrorInsertions: Bn, isMirrorActive: Vn, mirrorRef: Hn, selectionRects: Un, updateSelectionRects: Wn, handleTextareaScroll: Kn } = vt({
3046
+ let n = dn(t);
3047
+ e.target.value = "", fn(n);
3048
+ }, { textareaAreaRef: Bn, caretAnchor: Vn, mirrorInsertions: Hn, isMirrorActive: Un, mirrorRef: Wn, selectionRects: Gn, updateSelectionRects: Kn, handleTextareaScroll: qn } = St({
3041
3049
  commandMenu: Qe,
3042
- message: Z,
3043
- textareaRef: Q,
3044
- hasActiveMentions: Ft,
3045
- markerOffset: nn,
3046
- triggerEnd: en,
3047
- hasCommandEmptyQueryHint: tn
3048
- }), qn = /* @__PURE__ */ V("textarea", {
3049
- className: l(X.textarea, Vn && X.textareaMentionMode, B?.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"),
3050
- ref: Q,
3051
- autoFocus: tt,
3052
- value: Z,
3050
+ message: Q,
3051
+ textareaRef: $,
3052
+ hasActiveMentions: It,
3053
+ markerOffset: an,
3054
+ triggerEnd: nn,
3055
+ hasCommandEmptyQueryHint: rn
3056
+ }), Jn = /* @__PURE__ */ H("textarea", {
3057
+ className: d(Z.textarea, Un && Z.textareaMentionMode, z?.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"),
3058
+ ref: $,
3059
+ autoFocus: $e,
3060
+ value: Q,
3053
3061
  onChange: (e) => {
3054
- Lt(e.target.value), Nt.notifyChange();
3062
+ Rt(e.target.value), Ot.notifyChange();
3055
3063
  let t = e.nativeEvent instanceof InputEvent ? e.nativeEvent : void 0;
3056
- qt(e.target.value, e.target.selectionStart ?? e.target.value.length, t?.isComposing ?? !1), c?.(e.target.value);
3064
+ Jt(e.target.value, e.target.selectionStart ?? e.target.value.length, t?.isComposing ?? !1), c?.(e.target.value);
3057
3065
  },
3058
- onSelect: Wn,
3059
- onScroll: Kn,
3060
- onFocus: Zt,
3061
- onClick: Xt,
3062
- onKeyDown: In,
3063
- onKeyUp: Qt,
3064
- onPaste: En,
3065
- placeholder: p,
3066
- "aria-label": m,
3066
+ onSelect: Kn,
3067
+ onScroll: qn,
3068
+ onFocus: $t,
3069
+ onClick: Qt,
3070
+ onKeyDown: Rn,
3071
+ onKeyUp: en,
3072
+ onPaste: On,
3073
+ placeholder: u,
3074
+ "aria-label": f,
3067
3075
  "aria-autocomplete": Qe == null ? void 0 : "list",
3068
- "aria-controls": Ut ? Jt : void 0,
3069
- "aria-activedescendant": $ ?? void 0,
3070
- "aria-hidden": Ft ? !0 : void 0,
3076
+ "aria-controls": Vt ? Yt : void 0,
3077
+ "aria-activedescendant": Zt ?? void 0,
3078
+ "aria-hidden": It ? !0 : void 0,
3071
3079
  disabled: we,
3072
- readOnly: Sn,
3080
+ readOnly: wn,
3073
3081
  rows: 1
3074
- }), Jn = /* @__PURE__ */ V(Vt, {
3075
- areaRef: Rn,
3076
- mirrorRef: Hn,
3077
- isMirrorActive: Vn,
3078
- fontClassName: B?.fontClassName,
3079
- message: Z,
3080
- mentionRanges: Pt,
3081
- mirrorInsertions: Bn,
3082
- selectionRects: Un,
3083
- children: /* @__PURE__ */ V(Bt, {
3084
- textarea: qn,
3085
- textareaRef: Q,
3082
+ }), Yn = /* @__PURE__ */ H(Gt, {
3083
+ areaRef: Bn,
3084
+ mirrorRef: Wn,
3085
+ isMirrorActive: Un,
3086
+ fontClassName: z?.fontClassName,
3087
+ message: Q,
3088
+ mentionRanges: Ft,
3089
+ mirrorInsertions: Hn,
3090
+ selectionRects: Gn,
3091
+ children: /* @__PURE__ */ H(Wt, {
3092
+ textarea: Jn,
3093
+ textareaRef: $,
3086
3094
  commandMenu: Qe,
3087
- caretAnchor: zn,
3088
- fontClassName: B?.fontClassName,
3089
- isMenuOpen: Ut,
3090
- query: Wt,
3091
- activeWordStart: Gt,
3092
- listboxId: Jt,
3093
- activeOptionId: $,
3094
- overlayRef: Yt,
3095
- onOutsidePress: Kt,
3096
- onClose: rn
3095
+ caretAnchor: Vn,
3096
+ fontClassName: z?.fontClassName,
3097
+ isMenuOpen: Vt,
3098
+ query: Ht,
3099
+ activeWordStart: Kt,
3100
+ listboxId: Yt,
3101
+ activeOptionId: Zt,
3102
+ overlayRef: Xt,
3103
+ onOutsidePress: qt,
3104
+ onClose: on
3097
3105
  })
3098
- }), Yn = _e ? void 0 : /* @__PURE__ */ V(zt, {
3099
- fileInputRef: wn,
3100
- textareaRef: Q,
3101
- message: Z,
3102
- style: It,
3103
- hideAttachFile: ve,
3106
+ }), Zn = ge ? void 0 : /* @__PURE__ */ H(Ut, {
3107
+ fileInputRef: En,
3108
+ textareaRef: $,
3109
+ message: Q,
3110
+ style: Lt,
3111
+ hideAttachFile: _e,
3104
3112
  isInputDisabled: we,
3105
3113
  isStreaming: s,
3106
- isAttachmentsEnabled: gt,
3114
+ isAttachmentsEnabled: pt,
3107
3115
  isVoiceRecordingSupported: Oe,
3108
- isVoiceActive: Sn,
3109
- startRecording: yn,
3110
- isPhone: Ct,
3111
- canRemoveTools: Be,
3116
+ isVoiceActive: wn,
3117
+ startRecording: xn,
3118
+ isPhone: wt,
3119
+ canRemoveTools: ze,
3112
3120
  toolsMenuItems: Le,
3113
- onToolToggle: ze,
3121
+ onToolToggle: Re,
3114
3122
  chatSettings: Ie,
3115
- menuOverlays: Je,
3116
- onDialFileSystemClick: rt,
3117
- dialFileSystemLabel: at,
3123
+ menuOverlays: We,
3124
+ onDialFileSystemClick: tt,
3125
+ dialFileSystemLabel: nt,
3118
3126
  attachLabel: h,
3119
3127
  addMenuTitle: _,
3120
- menuTitle: b,
3121
- menuCloseLabel: x,
3128
+ menuTitle: v,
3129
+ menuCloseLabel: y,
3122
3130
  recordVoiceLabel: I,
3123
- toolsMenuTitle: Ue,
3124
- toolsBackLabel: We
3125
- }), Xn = xe === et.Inline && (!St || Se), Zn = Yn && /* @__PURE__ */ V("div", {
3126
- className: l("flex", J.addCluster),
3127
- children: Yn
3128
- }), Qn = Le ?? [], $n = Qn.length > 0 && ze != null && /* @__PURE__ */ H("div", {
3129
- className: l("max-w-full min-w-0 flex-[1_0_auto]", J.toolsChips),
3130
- children: [/* @__PURE__ */ V(ot, {
3131
- items: Qn,
3132
- title: Ue,
3133
- summaryLabel: Ke?.summaryLabel,
3134
- onClick: () => Mn(!0)
3135
- }), /* @__PURE__ */ V(nt, {
3136
- isOpen: jn,
3137
- onClose: () => Mn(!1),
3138
- closeLabel: x,
3139
- style: It,
3140
- title: Ue,
3141
- items: Qn,
3142
- onToolToggle: ze
3131
+ toolsMenuTitle: Be,
3132
+ toolsBackLabel: Ve
3133
+ }), Qn = ye === it.Inline && (!xt || be), $n = Zn && /* @__PURE__ */ H("div", {
3134
+ className: d("flex", Y.addCluster),
3135
+ children: Zn
3136
+ }), er = Le ?? [], tr = er.length > 0 && Re != null && /* @__PURE__ */ U("div", {
3137
+ className: d("max-w-full min-w-0 flex-[1_0_auto]", Y.toolsChips),
3138
+ children: [/* @__PURE__ */ H(ut, {
3139
+ items: er,
3140
+ title: Be,
3141
+ summaryLabel: Ue?.summaryLabel,
3142
+ onClick: () => Pn(!0)
3143
+ }), /* @__PURE__ */ H(ot, {
3144
+ isOpen: Nn,
3145
+ onClose: () => Pn(!1),
3146
+ closeLabel: y,
3147
+ style: Lt,
3148
+ title: Be,
3149
+ items: er,
3150
+ onToolToggle: Re
3143
3151
  })]
3144
- }), er = kn.length > 0 && ze != null && /* @__PURE__ */ V("div", {
3145
- className: l("min-w-0", Xn ? "flex-1" : "max-w-full flex-[1_0_auto]", J.toolsChips),
3146
- children: /* @__PURE__ */ V(it, {
3147
- items: kn,
3148
- onToolToggle: ze,
3149
- onToolDismiss: An,
3150
- canRemove: Be,
3151
- removeLabel: Ke?.removeLabel,
3152
- stateOnLabel: Ke?.stateOnLabel,
3153
- stateOffLabel: Ke?.stateOffLabel
3152
+ }), nr = jn.length > 0 && Re != null && /* @__PURE__ */ H("div", {
3153
+ className: d("min-w-0", Qn ? "flex-1" : "max-w-full flex-[1_0_auto]", Y.toolsChips),
3154
+ children: /* @__PURE__ */ H(ct, {
3155
+ items: jn,
3156
+ onToolToggle: Re,
3157
+ onToolDismiss: Mn,
3158
+ canRemove: ze,
3159
+ removeLabel: Ue?.removeLabel,
3160
+ stateOnLabel: Ue?.stateOnLabel,
3161
+ stateOffLabel: Ue?.stateOffLabel
3154
3162
  })
3155
- }), tr = Ct ? $n : er;
3156
- return /* @__PURE__ */ H("div", {
3157
- ref: Tn,
3158
- style: It,
3159
- className: l(X.wrapper, we && X.wrapperDisabled, we && "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", re, J.wrapper),
3163
+ }), rr = wt ? tr : nr;
3164
+ return /* @__PURE__ */ U("div", {
3165
+ ref: Dn,
3166
+ style: Lt,
3167
+ className: d(Z.wrapper, we && Z.wrapperDisabled, we && "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", re, Y.wrapper),
3160
3168
  children: [
3161
- (Pe.length > 0 || cn.length > 0) && /* @__PURE__ */ V(de, {
3162
- attachments: [...Pe, ...cn],
3169
+ (Pe.length > 0 || un.length > 0) && /* @__PURE__ */ H(fe, {
3170
+ attachments: [...Pe, ...un],
3163
3171
  onRemove: (e) => {
3164
- Pe.some((t) => t.id === e) ? Fe?.(e) : fn(e);
3172
+ Pe.some((t) => t.id === e) ? Fe?.(e) : mn(e);
3165
3173
  },
3166
- onRetry: pn,
3167
- onExpand: mn,
3174
+ onRetry: hn,
3175
+ onExpand: gn,
3168
3176
  labels: {
3169
3177
  removeLabel: S,
3170
- retryLabel: T,
3171
- uploadingLabel: k,
3172
- expandLabel: A,
3178
+ retryLabel: C,
3179
+ uploadingLabel: w,
3180
+ expandLabel: D,
3173
3181
  clickLabel: j
3174
3182
  },
3175
3183
  styles: {
3176
- ...te,
3177
- className: l(cn.length > 6 && "-me-4", te?.className)
3184
+ ...B,
3185
+ className: d(un.length > 6 && "-me-4", B?.className)
3178
3186
  },
3179
- onAttachmentClick: ct == null ? void 0 : (e) => {
3180
- let t = [...Pe, ...cn].find((t) => t.id === e);
3181
- t != null && ct(t);
3187
+ onAttachmentClick: X == null ? void 0 : (e) => {
3188
+ let t = [...Pe, ...un].find((t) => t.id === e);
3189
+ t != null && X(t);
3182
3190
  }
3183
3191
  }),
3184
- !_e && /* @__PURE__ */ V("input", {
3185
- ref: wn,
3192
+ !ge && /* @__PURE__ */ H("input", {
3193
+ ref: En,
3186
3194
  type: "file",
3187
3195
  multiple: !0,
3188
3196
  accept: g,
3189
3197
  className: "sr-only",
3190
3198
  "aria-hidden": !0,
3191
3199
  tabIndex: -1,
3192
- onChange: Ln
3200
+ onChange: zn
3193
3201
  }),
3194
- /* @__PURE__ */ V(E, {
3195
- politeness: O.Assertive,
3202
+ /* @__PURE__ */ H(O, {
3203
+ politeness: A.Assertive,
3196
3204
  className: "min-w-0 px-1 wrap-break-word",
3197
- children: vn && /* @__PURE__ */ V(C, { text: vn })
3205
+ children: bn && /* @__PURE__ */ H(T, { text: bn })
3198
3206
  }),
3199
- Sn && /* @__PURE__ */ V(dt, {
3207
+ wn && /* @__PURE__ */ H(ht, {
3200
3208
  embedded: !0,
3201
- state: gn,
3202
- analyserNodeRef: _n,
3203
- onStop: bn,
3204
- onDiscard: xn,
3205
- attachButton: Yn,
3206
- stopLabel: L,
3207
- discardLabel: R,
3209
+ state: vn,
3210
+ analyserNodeRef: yn,
3211
+ onStop: Sn,
3212
+ onDiscard: Cn,
3213
+ attachButton: Zn,
3214
+ stopLabel: te,
3215
+ discardLabel: L,
3208
3216
  processingLabel: Ae
3209
3217
  }),
3210
- !Sn && ye && Jn,
3211
- !Sn && !ye && Xn && tr && /* @__PURE__ */ V("div", {
3218
+ !wn && ve && Yn,
3219
+ !wn && !ve && Qn && rr && /* @__PURE__ */ H("div", {
3212
3220
  className: "flex",
3213
- children: tr
3221
+ children: rr
3214
3222
  }),
3215
- !Sn && !ye && /* @__PURE__ */ H("div", {
3216
- className: l("flex items-center gap-2", Xn ? "flex-nowrap" : "flex-wrap", J.actionRow),
3223
+ !wn && !ve && /* @__PURE__ */ U("div", {
3224
+ className: d("flex items-center gap-2", Qn ? "flex-nowrap" : "flex-wrap", Y.actionRow),
3217
3225
  children: [
3218
- Xn && Zn,
3219
- /* @__PURE__ */ V("div", {
3220
- className: l("flex min-w-0 items-center self-stretch", Xn ? "flex-1" : "w-full", J.textareaWrap),
3221
- children: Jn
3226
+ Qn && $n,
3227
+ /* @__PURE__ */ H("div", {
3228
+ className: d("flex min-w-0 items-center self-stretch", Qn ? "flex-1" : "w-full", Y.textareaWrap),
3229
+ children: Yn
3222
3230
  }),
3223
- !Xn && Zn,
3224
- !Xn && tr,
3225
- /* @__PURE__ */ V("div", {
3226
- className: l("ms-auto flex shrink-0 items-center gap-2", J.footerActions),
3231
+ !Qn && $n,
3232
+ !Qn && rr,
3233
+ /* @__PURE__ */ H("div", {
3234
+ className: d("ms-auto flex shrink-0 items-center gap-2", Y.footerActions),
3227
3235
  children: Ce ? Ce({
3228
- canSend: On,
3229
- onSend: Fn
3230
- }) : /* @__PURE__ */ H(ue, { children: [
3231
- yt,
3232
- /* @__PURE__ */ V(Gn, {
3233
- deployments: fe,
3234
- selectedDeploymentId: pe,
3235
- onDeploymentChange: me,
3236
- modelSelectorLabels: he,
3236
+ canSend: An,
3237
+ onSend: Ln
3238
+ }) : /* @__PURE__ */ U(V, { children: [
3239
+ vt,
3240
+ /* @__PURE__ */ H(Xn, {
3241
+ deployments: ue,
3242
+ selectedDeploymentId: de,
3243
+ onDeploymentChange: pe,
3244
+ modelSelectorLabels: me,
3237
3245
  menuStyles: ne,
3238
- nameClassName: B?.modelSelectorNameClassName,
3239
- versionClassName: B?.modelSelectorVersionClassName,
3246
+ nameClassName: z?.modelSelectorNameClassName,
3247
+ versionClassName: z?.modelSelectorVersionClassName,
3240
3248
  isStreaming: s,
3241
3249
  isMobile: Ct,
3242
3250
  isDisabled: Te,
3243
- style: It,
3244
- modelPickerOverlay: lt,
3245
- isPickerOpen: wt,
3246
- onPickerToggle: () => Mt(!wt),
3247
- onPickerOpenChange: Mt
3251
+ style: Lt,
3252
+ modelPickerOverlay: st,
3253
+ isPickerOpen: Tt,
3254
+ onPickerToggle: () => Dt(!Tt),
3255
+ onPickerOpenChange: Dt
3248
3256
  }),
3249
- Pn && /* @__PURE__ */ V(w, {
3250
- icon: /* @__PURE__ */ V(be, {
3251
- size: v.LG,
3252
- stroke: y,
3257
+ In && /* @__PURE__ */ H(E, {
3258
+ icon: /* @__PURE__ */ H(xe, {
3259
+ size: b.LG,
3260
+ stroke: x,
3253
3261
  "aria-hidden": !0
3254
3262
  }),
3255
3263
  "aria-label": F,
3256
3264
  tooltipProps: { tooltip: F },
3257
3265
  className: "shrink-0",
3258
- onClick: () => yn(qe.Dictation),
3266
+ onClick: () => xn(Ze.Dictation),
3259
3267
  disabled: we || s
3260
3268
  }),
3261
- s && o ? /* @__PURE__ */ V(pt, {
3269
+ s && o ? /* @__PURE__ */ H(_t, {
3262
3270
  onStop: o,
3263
3271
  ariaLabel: ee
3264
- }) : !s && /* @__PURE__ */ V(ft, {
3265
- onSend: Fn,
3266
- isDisabled: !Nn || !On,
3272
+ }) : !s && /* @__PURE__ */ H(gt, {
3273
+ onSend: Ln,
3274
+ isDisabled: !Fn || !An,
3267
3275
  ariaLabel: M,
3268
- sendTooltip: Dn ? N : P ?? N
3276
+ sendTooltip: kn ? N : P ?? N
3269
3277
  })
3270
3278
  ] })
3271
3279
  })
3272
3280
  ]
3273
3281
  }),
3274
- /* @__PURE__ */ V(E, {
3282
+ /* @__PURE__ */ H(O, {
3275
3283
  visuallyHidden: !0,
3276
3284
  atomic: !0,
3277
- as: D.Span,
3278
- children: /* @__PURE__ */ V("span", { children: Cn.text }, Cn.revision)
3285
+ as: k.Span,
3286
+ children: /* @__PURE__ */ H("span", { children: Tn.text }, Tn.revision)
3279
3287
  })
3280
3288
  ]
3281
3289
  });
3282
3290
  });
3283
- Kn.displayName = "Input";
3284
- var qn = {
3291
+ Zn.displayName = "Input";
3292
+ var Qn = {
3285
3293
  welcome: "_welcome_1icyo_1",
3286
3294
  description: "_description_1icyo_5"
3287
- }, Jn = ({ 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 }) => {
3295
+ }, $n = ({ 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: l, isInputDisabled: u = !1, ...f }) => {
3288
3296
  let { colors: p, typography: m, attachmentTray: h, modelMenu: g } = o ?? {}, _ = c({
3289
3297
  "--ci-welcome-color": p?.welcomeText,
3290
3298
  "--ci-description-color": p?.descriptionText
3291
3299
  });
3292
- return /* @__PURE__ */ H("div", {
3300
+ return /* @__PURE__ */ U("div", {
3293
3301
  style: _,
3294
- className: l("relative flex w-full flex-col items-center gap-9 px-4 py-5 desktop:p-5", s),
3302
+ className: d("relative flex w-full flex-col items-center gap-9 px-4 py-5 desktop:p-5", s),
3295
3303
  children: [
3296
- n && /* @__PURE__ */ H("div", {
3304
+ n && /* @__PURE__ */ U("div", {
3297
3305
  className: "flex max-w-full flex-col items-center gap-4 text-center",
3298
- children: [/* @__PURE__ */ V("h1", {
3299
- className: l(qn.welcome, "m-0 max-w-full wrap-anywhere", m?.welcomeClassName || "dial-display2-text"),
3306
+ children: [/* @__PURE__ */ H("h1", {
3307
+ className: d(Qn.welcome, "m-0 max-w-full wrap-anywhere", m?.welcomeClassName || "dial-display2-text"),
3300
3308
  children: n
3301
- }), r && /* @__PURE__ */ V("p", {
3302
- className: l(qn.description, "m-0 max-w-[540px]", m?.descriptionClassName || "dial-body-paragraph-text"),
3309
+ }), r && /* @__PURE__ */ H("p", {
3310
+ className: d(Qn.description, "m-0 max-w-[540px]", m?.descriptionClassName || "dial-body-paragraph-text"),
3303
3311
  children: r
3304
3312
  })]
3305
3313
  }),
3306
- i != null && /* @__PURE__ */ V("div", {
3314
+ i != null && /* @__PURE__ */ H("div", {
3307
3315
  className: "flex w-full max-w-[700px] flex-col items-center empty:hidden",
3308
3316
  children: i
3309
3317
  }),
3310
- /* @__PURE__ */ H("div", {
3311
- className: l("relative w-full", n ? "max-w-[700px]" : "max-w-[748px]"),
3312
- children: [a != null && /* @__PURE__ */ V("div", {
3318
+ /* @__PURE__ */ U("div", {
3319
+ className: d("relative w-full", n ? "max-w-[700px]" : "max-w-[748px]"),
3320
+ children: [a != null && /* @__PURE__ */ H("div", {
3313
3321
  className: "mb-2",
3314
3322
  children: a
3315
- }), /* @__PURE__ */ V(Kn, {
3323
+ }), /* @__PURE__ */ H(Zn, {
3316
3324
  placeholder: t,
3317
3325
  isStreaming: e,
3318
- isInputDisabled: d,
3326
+ isInputDisabled: u,
3319
3327
  ...f,
3320
- className: u,
3328
+ className: l,
3321
3329
  colors: p?.input,
3322
3330
  typography: m?.input,
3323
3331
  attachmentTray: h,
@@ -3326,35 +3334,35 @@ var qn = {
3326
3334
  })
3327
3335
  ]
3328
3336
  });
3329
- }, Yn = ({ message: e, messageRevision: t, onChange: n, activeMentions: r, onBackspaceAtCaret: i, caretPositionOverride: o, commandMenu: s, menuOverlays: c, sendOnEnter: u, initialAttachments: d = [], onCancel: f, onSave: m, onUploadAttachment: h, cancelLabel: g = "Cancel", saveLabel: _ = "Save & Submit", ariaLabel: v, 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: M, validateAttachment: N, isAttachmentsEnabled: P, isTextAttachmentsAllowed: ee, hideAttachFile: F = !1, fileAccept: I, maximumAttachmentsAmount: R, onAttachmentsLimitExceeded: z, onDialFileSystemClick: B, dialFileSystemLabel: te, pendingAttachments: ne, onPendingAttachmentsConsumed: re, onAttachmentClick: ie, pasteTextThreshold: ae, maxMessageLength: oe = 5e4, onMessageTooLong: se }) => {
3330
- let ce = K(null), le = K(null), [ue, de] = q([]);
3331
- W(() => {
3332
- A?.length && (de(A), M?.());
3333
- }, [A, M]);
3334
- let [fe, pe] = q(e ?? ""), [me, he] = q([]), [ge, _e] = q(d), ve = me.some((e) => e.status === a.Loading || e.status === a.Error), be = (fe.trim().length > 0 || me.length > 0 || ge.length > 0) && !ve, xe = (e) => {
3335
- _e((t) => t.filter((t) => t.id !== e));
3336
- }, Se = U((e, t) => {
3337
- m(e, ge, t);
3338
- }, [ge, m]), Ce = () => {
3339
- be && (fe.length >= oe ? se?.(fe.length, oe) : Se(fe, me));
3340
- }, we = U(() => de([]), []), Te = U((e) => {
3341
- pe(e), n?.(e);
3342
- }, [n]), Ee = U((e) => {
3337
+ }, er = ({ message: e, messageRevision: t, onChange: n, activeMentions: r, onBackspaceAtCaret: i, caretPositionOverride: o, commandMenu: s, menuOverlays: c, sendOnEnter: l, initialAttachments: u = [], onCancel: f, onSave: p, onUploadAttachment: m, cancelLabel: g = "Cancel", saveLabel: _ = "Save & Submit", ariaLabel: v, removeLabel: y, retryLabel: b, 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: M, isAttachmentsEnabled: P, isTextAttachmentsAllowed: ee, hideAttachFile: F = !1, fileAccept: I, maximumAttachmentsAmount: te, onAttachmentsLimitExceeded: L, onDialFileSystemClick: z, dialFileSystemLabel: B, pendingAttachments: ne, onPendingAttachmentsConsumed: re, onAttachmentClick: ie, pasteTextThreshold: ae, maxMessageLength: oe = 5e4, onMessageTooLong: se }) => {
3338
+ let ce = q(null), le = q(null), [ue, de] = J([]);
3339
+ G(() => {
3340
+ A?.length && (de(A), j?.());
3341
+ }, [A, j]);
3342
+ let [V, fe] = J(e ?? ""), [pe, me] = J([]), [he, ge] = J(u), _e = pe.some((e) => e.status === a.Loading || e.status === a.Error), ve = (V.trim().length > 0 || pe.length > 0 || he.length > 0) && !_e, ye = (e) => {
3343
+ ge((t) => t.filter((t) => t.id !== e));
3344
+ }, xe = W((e, t) => {
3345
+ p(e, he, t);
3346
+ }, [he, p]), Se = () => {
3347
+ ve && (V.length >= oe ? se?.(V.length, oe) : xe(V, pe));
3348
+ }, Ce = W(() => de([]), []), we = W((e) => {
3349
+ fe(e), n?.(e);
3350
+ }, [n]), Te = W((e) => {
3343
3351
  let t = Array.from(e.target.files ?? []);
3344
3352
  t.length !== 0 && (e.target.value = "", de(t));
3345
- }, []), De = G(() => B ? [{
3353
+ }, []), Ee = K(() => z ? [{
3346
3354
  key: "dial-fs",
3347
- label: te ?? "DIAL file system",
3348
- icon: /* @__PURE__ */ V(ye, {
3349
- size: p,
3355
+ label: B ?? "DIAL file system",
3356
+ icon: /* @__PURE__ */ H(be, {
3357
+ size: h,
3350
3358
  "aria-hidden": !0,
3351
- stroke: y
3359
+ stroke: x
3352
3360
  }),
3353
- onClick: B
3354
- }] : [], [B, te]);
3355
- return /* @__PURE__ */ H("div", {
3356
- className: l("flex w-full flex-col gap-2", k),
3357
- children: [/* @__PURE__ */ V(Kn, {
3361
+ onClick: z
3362
+ }] : [], [z, B]);
3363
+ return /* @__PURE__ */ U("div", {
3364
+ className: d("flex w-full flex-col gap-2", k),
3365
+ children: [/* @__PURE__ */ H(Zn, {
3358
3366
  ref: le,
3359
3367
  message: e,
3360
3368
  messageRevision: t,
@@ -3364,37 +3372,37 @@ var qn = {
3364
3372
  commandMenu: s,
3365
3373
  ariaLabel: v,
3366
3374
  hideActionBar: !0,
3367
- sendOnEnter: u,
3375
+ sendOnEnter: l,
3368
3376
  pendingDropFiles: ue,
3369
- onDropFilesConsumed: we,
3370
- onSend: Se,
3371
- onUploadAttachment: h,
3372
- onChange: Te,
3373
- onAttachmentsChange: he,
3374
- removeLabel: b,
3375
- retryLabel: x,
3377
+ onDropFilesConsumed: Ce,
3378
+ onSend: xe,
3379
+ onUploadAttachment: m,
3380
+ onChange: we,
3381
+ onAttachmentsChange: me,
3382
+ removeLabel: y,
3383
+ retryLabel: b,
3376
3384
  uploadingLabel: S,
3377
3385
  expandLabel: C,
3378
3386
  clickLabel: w,
3379
3387
  className: "max-w-full",
3380
- prefixAttachments: ge,
3381
- onRemovePrefixAttachment: xe,
3382
- validateAttachment: N,
3388
+ prefixAttachments: he,
3389
+ onRemovePrefixAttachment: ye,
3390
+ validateAttachment: M,
3383
3391
  isAttachmentsEnabled: P,
3384
3392
  isTextAttachmentsAllowed: ee,
3385
- maximumAttachmentsAmount: R,
3386
- onAttachmentsLimitExceeded: z,
3393
+ maximumAttachmentsAmount: te,
3394
+ onAttachmentsLimitExceeded: L,
3387
3395
  pendingAttachments: ne,
3388
3396
  onPendingAttachmentsConsumed: re,
3389
3397
  onAttachmentClick: ie,
3390
3398
  pasteTextThreshold: ae,
3391
3399
  maxMessageLength: oe,
3392
3400
  onMessageTooLong: se
3393
- }), /* @__PURE__ */ H("div", {
3401
+ }), /* @__PURE__ */ U("div", {
3394
3402
  className: "flex items-center justify-between",
3395
- children: [/* @__PURE__ */ H("div", {
3403
+ children: [/* @__PURE__ */ U("div", {
3396
3404
  className: "flex",
3397
- children: [!F && /* @__PURE__ */ V("input", {
3405
+ children: [!F && /* @__PURE__ */ H("input", {
3398
3406
  ref: ce,
3399
3407
  type: "file",
3400
3408
  multiple: !0,
@@ -3402,71 +3410,71 @@ var qn = {
3402
3410
  className: "sr-only",
3403
3411
  "aria-hidden": !0,
3404
3412
  tabIndex: -1,
3405
- onChange: Ee
3406
- }), (!F || (c?.length ?? 0) > 0) && /* @__PURE__ */ V(Rt, {
3413
+ onChange: Te
3414
+ }), (!F || (c?.length ?? 0) > 0) && /* @__PURE__ */ H(Ht, {
3407
3415
  onAttachClick: F ? void 0 : () => ce.current?.click(),
3408
3416
  attachLabel: E,
3409
3417
  addMenuTitle: T,
3410
3418
  menuTitle: D,
3411
3419
  menuCloseLabel: O,
3412
- extraMenuItems: De,
3420
+ extraMenuItems: Ee,
3413
3421
  menuOverlays: c,
3414
3422
  getCaretPosition: () => le.current?.getCaretPosition() ?? 0
3415
3423
  })]
3416
- }), /* @__PURE__ */ H("div", {
3424
+ }), /* @__PURE__ */ U("div", {
3417
3425
  className: "flex gap-2",
3418
- children: [/* @__PURE__ */ V(j, {
3426
+ children: [/* @__PURE__ */ H(N, {
3419
3427
  label: g,
3420
3428
  onClick: f
3421
- }), /* @__PURE__ */ V(L, {
3429
+ }), /* @__PURE__ */ H(R, {
3422
3430
  label: _,
3423
- onClick: Ce,
3424
- disabled: !be
3431
+ onClick: Se,
3432
+ disabled: !ve
3425
3433
  })]
3426
3434
  })]
3427
3435
  })]
3428
3436
  });
3429
- }, Xn = /* @__PURE__ */ function(e) {
3437
+ }, tr = /* @__PURE__ */ function(e) {
3430
3438
  return e.Warning = "warning", e.Reached = "reached", e;
3431
- }({}), Zn = { banner: "_banner_180n6_2" }, Qn = {
3432
- [Xn.Warning]: ee.Warning,
3433
- [Xn.Reached]: ee.Error
3434
- }, $n = ({ 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", isLiveRegion: s = !0, className: u, colors: d }) => {
3435
- let f = /* @__PURE__ */ V("span", {
3439
+ }({}), nr = { banner: "_banner_180n6_2" }, rr = {
3440
+ [tr.Warning]: I.Warning,
3441
+ [tr.Reached]: I.Error
3442
+ }, ir = ({ 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", isLiveRegion: s = !0, className: l, colors: u }) => {
3443
+ let f = /* @__PURE__ */ H("span", {
3436
3444
  className: a,
3437
3445
  children: t
3438
- }), p = n != null && /* @__PURE__ */ H(ue, { children: [
3446
+ }), p = n != null && /* @__PURE__ */ U(V, { children: [
3439
3447
  " ",
3440
- /* @__PURE__ */ V("time", {
3448
+ /* @__PURE__ */ H("time", {
3441
3449
  dateTime: n.isoValue,
3442
3450
  "aria-hidden": n.ariaLabel != null || void 0,
3443
3451
  className: o,
3444
3452
  children: n.label
3445
3453
  }),
3446
- n.ariaLabel != null && /* @__PURE__ */ V("span", {
3454
+ n.ariaLabel != null && /* @__PURE__ */ H("span", {
3447
3455
  className: "sr-only",
3448
3456
  children: n.ariaLabel
3449
3457
  })
3450
3458
  ] });
3451
- return /* @__PURE__ */ V(N, {
3459
+ return /* @__PURE__ */ H(ee, {
3452
3460
  role: s ? "status" : "none",
3453
- variant: Qn[e],
3454
- type: P.SectionMessage,
3461
+ variant: rr[e],
3462
+ type: F.SectionMessage,
3455
3463
  title: p ? f : void 0,
3456
3464
  message: p || f,
3457
- className: l(Zn.banner, J.usageBanner, u),
3458
- style: c({ "--ci-usage-banner-bg": d?.background }),
3459
- children: r != null && /* @__PURE__ */ V(_, {
3465
+ className: d(nr.banner, Y.usageBanner, l),
3466
+ style: c({ "--ci-usage-banner-bg": u?.background }),
3467
+ children: r != null && /* @__PURE__ */ H(y, {
3460
3468
  className: "shrink-0 self-start",
3461
3469
  ariaLabel: i,
3462
3470
  onClose: () => r()
3463
3471
  })
3464
3472
  });
3465
- }, er = (e) => {
3466
- let [t, n] = q({
3473
+ }, ar = (e) => {
3474
+ let [t, n] = J({
3467
3475
  text: e?.text,
3468
3476
  revision: e?.revision ?? 0
3469
- }), r = U((e) => {
3477
+ }), r = W((e) => {
3470
3478
  n((t) => ({
3471
3479
  text: e,
3472
3480
  revision: t.revision + 1
@@ -3477,11 +3485,11 @@ var qn = {
3477
3485
  messageRevision: t.revision,
3478
3486
  seedMessage: r
3479
3487
  };
3480
- }, tr = (e, t) => {
3481
- let n = K(e), r = K(t);
3482
- r.current = t, W(() => {
3488
+ }, or = (e, t) => {
3489
+ let n = q(e), r = q(t);
3490
+ r.current = t, G(() => {
3483
3491
  e !== n.current && (n.current = e, r.current());
3484
3492
  }, [e]);
3485
3493
  };
3486
3494
  //#endregion
3487
- export { et as ActionRowLayout, Ie as BottomSheetShell, J as CONVERSATION_INPUT_CLASS, Lt as ChatSettingsModal, Jn as ConversationInput, Yn as EditMessageInput, Kn as Input, $e as SendOnEnter, Xn as UsageLimitBannerSeverity, $n as UsageLimitBannerView, er as useComposerSeed, tr as useComposerSeedSource };
3495
+ export { it as ActionRowLayout, Le as BottomSheetShell, Y as CONVERSATION_INPUT_CLASS, Bt as ChatSettingsModal, $n as ConversationInput, er as EditMessageInput, Zn as Input, rt as SendOnEnter, tr as UsageLimitBannerSeverity, ir as UsageLimitBannerView, ar as useComposerSeed, or as useComposerSeedSource };