@epam/ai-dial-conversation-input 1.4.0-dev.89 → 1.4.0-dev.90

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 L, PopupSize as R, PrimaryButton as z, PrimaryIconButton as B, RadioGroup as te, 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", {
482
+ }), m = (e) => /* @__PURE__ */ U("span", {
473
483
  className: "flex min-w-0 items-baseline",
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", {
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(B, {
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(B, {
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(te, {
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(z, {
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
- }, Lt = { modal: "_modal_kl0h0_1" }, Rt = ({ 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 = Lt.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(L, {
1329
1339
  open: !0,
1330
1340
  header: o,
1331
1341
  titleClassName: s,
1332
- size: I.Sm,
1342
+ size: R.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
- }, Z = {
1375
+ }, Vt = {
1366
1376
  toolIcon: "_toolIcon_ma5s5_1",
1367
1377
  chevronIcon: "_chevronIcon_ma5s5_5"
1368
- }, zt = ({ 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) => {
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, L] = J(!1), [R, z] = J(!1), [B, te] = J(null), ne = W((e) => {
1370
1380
  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)));
1381
+ }, []), re = q(A);
1382
+ G(() => {
1383
+ re.current !== A && (re.current = A, A ? (N(ee && !R && B === null), F(!1)) : (P.current = R || B !== null ? -1 : 0, F(j || R || B !== null), N(!1)));
1374
1384
  }, [
1375
- j,
1385
+ A,
1376
1386
  ee,
1377
- M,
1387
+ j,
1378
1388
  R,
1379
1389
  B
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", Z.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,19 +1422,19 @@ 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 ? () => {
1430
+ onClick: A ? () => {
1421
1431
  z(!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]", Z.chevronIcon),
1437
+ className: d("rtl:scale-x-[-1]", Vt.chevronIcon),
1428
1438
  "aria-hidden": !0
1429
1439
  }) } : {
1430
1440
  children: oe,
@@ -1434,18 +1444,18 @@ var J = {
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 ? () => {
1451
+ onClick: A ? () => {
1442
1452
  te(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]", Z.chevronIcon),
1458
+ className: d("rtl:scale-x-[-1]", Vt.chevronIcon),
1449
1459
  "aria-hidden": !0
1450
1460
  }) } : {
1451
1461
  subMenuOpen: B === e.key,
@@ -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,16 +1480,16 @@ 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]", Z.chevronIcon),
1492
+ className: d("rtl:scale-x-[-1]", Vt.chevronIcon),
1483
1493
  "aria-hidden": !0
1484
1494
  }) : null,
1485
1495
  onClick: () => L(!0)
@@ -1493,76 +1503,76 @@ var J = {
1493
1503
  g,
1494
1504
  _,
1495
1505
  k,
1496
- j,
1506
+ A,
1497
1507
  ae,
1498
1508
  R,
1499
1509
  B,
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, {
1562
+ ae && /* @__PURE__ */ H(ot, {
1553
1563
  isOpen: R,
1554
1564
  onBack: () => {
1555
1565
  z(!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, {
1575
+ T?.map((e) => /* @__PURE__ */ H(Le, {
1566
1576
  isOpen: B === e.key,
1567
1577
  title: e.title,
1568
1578
  closeLabel: s,
@@ -1571,23 +1581,23 @@ var J = {
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
+ L(!1), A ? N(!0) : F(!0);
1586
1596
  },
1587
1597
  backLabel: g.backLabel ?? "Back",
1588
1598
  onClose: () => L(!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,7 +1616,7 @@ var J = {
1606
1616
  saveLabel: g.saveLabel,
1607
1617
  saveDisabledTooltip: g.saveDisabledTooltip
1608
1618
  }),
1609
- !k && g != null && I && /* @__PURE__ */ V(Rt, {
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,
@@ -1628,20 +1638,20 @@ var J = {
1628
1638
  colors: g.modalColors
1629
1639
  })
1630
1640
  ] });
1631
- }, Bt = ({ 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(zt, {
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
- }, Vt = ({ 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,13 @@ 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,
1678
1688
  outsidePressIgnoreRef: t,
1679
1689
  renderOverlay: () => {
1680
1690
  let e = n.menuLabel != null;
1681
- return /* @__PURE__ */ V("div", {
1682
- ref: d,
1691
+ return /* @__PURE__ */ H("div", {
1692
+ ref: u,
1683
1693
  role: e ? "group" : void 0,
1684
1694
  "aria-label": n.menuLabel,
1685
1695
  children: n.renderMenu({
@@ -1687,24 +1697,24 @@ var J = {
1687
1697
  caretPosition: s ?? 0,
1688
1698
  close: p,
1689
1699
  listboxId: c,
1690
- activeOptionId: u
1700
+ activeOptionId: l
1691
1701
  })
1692
1702
  });
1693
1703
  },
1694
- children: /* @__PURE__ */ V("span", {
1704
+ children: /* @__PURE__ */ H("span", {
1695
1705
  "aria-hidden": !0,
1696
1706
  className: "inline-block h-lh w-0"
1697
1707
  })
1698
1708
  })
1699
- })] }), Ht = ({ areaRef: e, mirrorRef: t, isMirrorActive: n, fontClassName: r, message: i, mentionRanges: a, mirrorInsertions: o, selectionRects: s, children: c }) => /* @__PURE__ */ H("div", {
1709
+ })] }), Gt = ({ areaRef: e, mirrorRef: t, isMirrorActive: n, fontClassName: r, message: i, mentionRanges: a, mirrorInsertions: o, selectionRects: s, children: c }) => /* @__PURE__ */ U("div", {
1700
1710
  ref: e,
1701
1711
  className: "relative -ms-1 -me-1 w-[calc(100%+8px)]",
1702
- children: [n && /* @__PURE__ */ H("div", {
1712
+ children: [n && /* @__PURE__ */ U("div", {
1703
1713
  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", {
1714
+ 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"),
1715
+ children: [vt(i, a, o, Z.mentionHighlight, Z.mentionHighlightUnsupported), s.map((e, t) => /* @__PURE__ */ H("div", {
1706
1716
  "aria-hidden": !0,
1707
- className: l("pointer-events-none absolute rounded-sm", X.selectionHighlight),
1717
+ className: d("pointer-events-none absolute rounded-sm", Z.selectionHighlight),
1708
1718
  style: {
1709
1719
  left: e.left,
1710
1720
  top: e.top,
@@ -1713,54 +1723,54 @@ var J = {
1713
1723
  }
1714
1724
  }, `selection-${t}`))]
1715
1725
  }), c]
1716
- }), Q = ({ size: e = 20 }) => /* @__PURE__ */ V(ne, {
1717
- variant: re.Circular,
1726
+ }), Kt = ({ size: e = 20 }) => /* @__PURE__ */ H(ie, {
1727
+ variant: ae.Circular,
1718
1728
  width: e,
1719
1729
  height: e,
1720
1730
  active: !0
1721
- }), Ut = ({ loadingLabel: e }) => /* @__PURE__ */ H("span", {
1731
+ }), qt = ({ loadingLabel: e }) => /* @__PURE__ */ U("span", {
1722
1732
  className: "flex min-w-0 flex-1 items-center",
1723
- children: [/* @__PURE__ */ V(ne, {
1724
- variant: re.Text,
1733
+ children: [/* @__PURE__ */ H(ie, {
1734
+ variant: ae.Text,
1725
1735
  width: "100%",
1726
1736
  height: 16,
1727
1737
  active: !0
1728
- }), e && /* @__PURE__ */ V("span", {
1738
+ }), e && /* @__PURE__ */ H("span", {
1729
1739
  className: "sr-only",
1730
1740
  children: e
1731
1741
  })]
1732
- }), Wt = () => /* @__PURE__ */ V("div", {
1742
+ }), Jt = () => /* @__PURE__ */ H("div", {
1733
1743
  "aria-hidden": "true",
1734
- children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */ H("div", {
1744
+ children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */ U("div", {
1735
1745
  className: "flex h-11 items-center gap-3 px-4",
1736
- children: [/* @__PURE__ */ V(Q, {}), /* @__PURE__ */ V(Ut, {})]
1746
+ children: [/* @__PURE__ */ H(Kt, {}), /* @__PURE__ */ H(qt, {})]
1737
1747
  }, t))
1738
- }), Gt = (e) => e.displayName ?? e.id, Kt = (e, t) => {
1748
+ }), Yt = (e) => e.displayName ?? e.id, Xt = (e, t) => {
1739
1749
  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, {
1750
+ return n ? e.filter((e) => Yt(e).toLowerCase().includes(n)) : e;
1751
+ }, Zt = (e, t, r, i = 18, a) => /* @__PURE__ */ H(n, {
1742
1752
  src: e,
1743
1753
  size: i,
1744
1754
  labels: { tooltip: a },
1745
1755
  initialsName: r
1746
- }), Jt = {
1756
+ }), Qt = {
1747
1757
  searchHeader: "_searchHeader_1u7db_1",
1748
1758
  itemText: "_itemText_1u7db_13",
1749
1759
  itemHover: "_itemHover_1u7db_17",
1750
1760
  selectedItemBackground: "_selectedItemBackground_1u7db_22",
1751
1761
  selectedItemText: "_selectedItemText_1u7db_26",
1752
1762
  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(Q, { 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,
1763
+ }, $t = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, styles: i }) => {
1764
+ 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, u ? r?.unavailableTooltip ?? "This deployment is no longer available" : void 0), [
1765
+ l,
1756
1766
  s,
1757
- d,
1767
+ u,
1758
1768
  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) => ({
1769
+ ]), p = s?.displayName ?? s?.id, m = s?.displayVersion, h = p ? `${r?.ariaLabel ?? "Select model"}: ${p}` : r?.ariaLabel ?? "Select model", g = K(() => {
1770
+ if (l) return Array.from({ length: 7 }, (e, t) => ({
1761
1771
  key: `__loading-${t}`,
1762
- icon: /* @__PURE__ */ V(Q, {}),
1763
- label: /* @__PURE__ */ V(Ut, { loadingLabel: t === 0 ? r?.loading : void 0 }),
1772
+ icon: /* @__PURE__ */ H(Kt, {}),
1773
+ label: /* @__PURE__ */ H(qt, { loadingLabel: t === 0 ? r?.loading : void 0 }),
1764
1774
  disabled: !0
1765
1775
  }));
1766
1776
  if (!e || e.length === 0) {
@@ -1772,25 +1782,25 @@ var J = {
1772
1782
  }] : [];
1773
1783
  }
1774
1784
  let o = i?.colors;
1775
- return Kt(e, a).map((e) => {
1785
+ return Xt(e, a).map((e) => {
1776
1786
  let r = e.id === t;
1777
1787
  return {
1778
1788
  key: e.id,
1779
- label: /* @__PURE__ */ V(T, {
1780
- text: Gt(e),
1789
+ label: /* @__PURE__ */ H(D, {
1790
+ text: Yt(e),
1781
1791
  query: a,
1782
1792
  maxLines: 1
1783
1793
  }),
1784
- icon: qt(e.iconUrl, e.type, e.displayName ?? e.id),
1785
- mark: A.Check,
1794
+ icon: Zt(e.iconUrl, e.type, e.displayName ?? e.id),
1795
+ mark: M.Check,
1786
1796
  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),
1797
+ 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
1798
  onClick: () => n?.(e.id)
1789
1799
  };
1790
1800
  });
1791
1801
  }, [
1792
1802
  e,
1793
- u,
1803
+ l,
1794
1804
  a,
1795
1805
  t,
1796
1806
  r,
@@ -1798,7 +1808,7 @@ var J = {
1798
1808
  i?.itemClassName,
1799
1809
  i?.selectedItemClassName,
1800
1810
  i?.colors
1801
- ]), _ = G(() => c({
1811
+ ]), _ = K(() => c({
1802
1812
  "--ms-item-text": i?.colors?.itemText,
1803
1813
  "--ms-item-hover-bg": i?.colors?.itemHoverBackground,
1804
1814
  "--ms-selected-item-bg": i?.colors?.selectedItemBackground,
@@ -1813,19 +1823,19 @@ var J = {
1813
1823
  selectedLabel: p,
1814
1824
  selectedVersion: m,
1815
1825
  menuItems: g,
1816
- menuHeader: G(() => !u && e && e.length > 0 ? /* @__PURE__ */ V("div", {
1826
+ menuHeader: K(() => !l && e && e.length > 0 ? /* @__PURE__ */ H("div", {
1817
1827
  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, {
1828
+ className: d("sticky top-0 z-10 pe-2 pt-2 pb-1", Qt.searchHeader, i?.searchHeaderClassName, Y.modelMenuSearch),
1829
+ children: /* @__PURE__ */ H(re, {
1820
1830
  value: a,
1821
1831
  placeholder: r?.searchPlaceholder ?? "Search",
1822
- size: S.Small,
1832
+ size: w.Small,
1823
1833
  wrapperClassName: "border-0",
1824
1834
  onChange: (e) => o(e ?? "")
1825
1835
  })
1826
1836
  }) : void 0, [
1827
1837
  e,
1828
- u,
1838
+ l,
1829
1839
  a,
1830
1840
  r,
1831
1841
  i?.searchHeaderClassName,
@@ -1836,8 +1846,8 @@ var J = {
1836
1846
  e || o("");
1837
1847
  }
1838
1848
  };
1839
- }, $ = typeof window < "u" ? Ne : W;
1840
- function Xt(e) {
1849
+ }, en = typeof window < "u" ? Pe : G;
1850
+ function tn(e) {
1841
1851
  let t = e;
1842
1852
  for (; t;) {
1843
1853
  if (t.dir) return t.dir === "rtl";
@@ -1845,35 +1855,35 @@ function Xt(e) {
1845
1855
  }
1846
1856
  return !1;
1847
1857
  }
1848
- function Zt() {
1858
+ function nn() {
1849
1859
  return () => {};
1850
1860
  }
1851
- function Qt() {
1852
- return Pe(Zt, () => !1, () => !0);
1861
+ function rn() {
1862
+ return Fe(nn, () => !1, () => !0);
1853
1863
  }
1854
- function $t(e) {
1864
+ function an(e) {
1855
1865
  return e?.ownerDocument.defaultView ?? window;
1856
1866
  }
1857
- function en(e) {
1858
- return $t(e).ResizeObserver ?? (typeof ResizeObserver < "u" ? ResizeObserver : void 0);
1867
+ function on(e) {
1868
+ return an(e).ResizeObserver ?? (typeof ResizeObserver < "u" ? ResizeObserver : void 0);
1859
1869
  }
1860
- function tn(e) {
1870
+ function sn(e) {
1861
1871
  if (e !== void 0) switch (typeof e) {
1862
1872
  case "number": return e;
1863
1873
  case "string": if (e.endsWith("px")) return parseFloat(e);
1864
1874
  }
1865
1875
  }
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({
1876
+ function cn({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
1877
+ let { styleHeight: s, styleWidth: c } = K(() => ({
1878
+ styleHeight: sn(o?.height),
1879
+ styleWidth: sn(o?.width)
1880
+ }), [o?.height, o?.width]), [l, u] = J({
1871
1881
  height: t,
1872
1882
  width: n
1873
1883
  }), d = r || a === "only-height" && s !== void 0 || a === "only-width" && c !== void 0 || s !== void 0 && c !== void 0;
1874
- return $(() => {
1884
+ return en(() => {
1875
1885
  if (i === null || d) return;
1876
- let t = en(i);
1886
+ let t = on(i);
1877
1887
  if (!t) return;
1878
1888
  let n = new t((e) => {
1879
1889
  for (let t of e) {
@@ -1893,7 +1903,7 @@ function nn({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
1893
1903
  i,
1894
1904
  s,
1895
1905
  c
1896
- ]), G(() => ({
1906
+ ]), K(() => ({
1897
1907
  height: s ?? l.height,
1898
1908
  width: c ?? l.width
1899
1909
  }), [
@@ -1902,27 +1912,27 @@ function nn({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
1902
1912
  c
1903
1913
  ]);
1904
1914
  }
1905
- function rn(e) {
1906
- let t = K(() => {
1915
+ function ln(e) {
1916
+ let t = q(() => {
1907
1917
  throw Error("Cannot call an event handler while rendering.");
1908
1918
  });
1909
- return $(() => {
1919
+ return en(() => {
1910
1920
  t.current = e;
1911
- }, [e]), U((...e) => t.current?.(...e), [t]);
1921
+ }, [e]), W((...e) => t.current?.(...e), [t]);
1912
1922
  }
1913
- var an = /* @__PURE__ */ new WeakMap();
1914
- function on(e = !1, t = document) {
1915
- let n = an.get(t);
1923
+ var un = /* @__PURE__ */ new WeakMap();
1924
+ function dn(e = !1, t = document) {
1925
+ let n = un.get(t);
1916
1926
  if (n === void 0 || e) {
1917
1927
  let e = t.createElement("div"), r = e.style;
1918
1928
  r.width = "50px", r.height = "50px", r.overflow = "scroll", r.direction = "rtl";
1919
1929
  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);
1930
+ 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
1931
  }
1922
1932
  return n;
1923
1933
  }
1924
- function sn({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
1925
- if (t === "horizontal" && n) switch (on(!1, e?.ownerDocument ?? document)) {
1934
+ function fn({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
1935
+ if (t === "horizontal" && n) switch (dn(!1, e?.ownerDocument ?? document)) {
1926
1936
  case "negative": return -r;
1927
1937
  case "positive-descending": if (e) {
1928
1938
  let { clientWidth: t, scrollWidth: n } = e;
@@ -1931,8 +1941,8 @@ function sn({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
1931
1941
  }
1932
1942
  return r;
1933
1943
  }
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) => {
1944
+ function pn({ container: e, element: t, onChange: n }) {
1945
+ 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
1946
  e.some((e) => Array.from(e.addedNodes).some(s) || e.removedNodes.length > 0 && e.nextSibling !== null && s(e.nextSibling)) && (u(), n());
1937
1947
  }) : void 0, l = /* @__PURE__ */ new Set(), u = () => {
1938
1948
  for (let e of l) o?.unobserve(e);
@@ -1949,33 +1959,33 @@ function cn({ container: e, element: t, onChange: n }) {
1949
1959
  o?.disconnect(), c?.disconnect();
1950
1960
  };
1951
1961
  }
1952
- function ln(e) {
1962
+ function mn(e) {
1953
1963
  return e.window === e;
1954
1964
  }
1955
- function un(e, t) {
1956
- return t === "window" ? e ? $t(e) : null : t ?? null;
1965
+ function hn(e, t) {
1966
+ return t === "window" ? e ? an(e) : null : t ?? null;
1957
1967
  }
1958
- function dn(e, t) {
1959
- return ln(e) ? t === "vertical" ? e.scrollY : e.scrollX : t === "vertical" ? e.scrollTop : e.scrollLeft;
1968
+ function gn(e, t) {
1969
+ return mn(e) ? t === "vertical" ? e.scrollY : e.scrollX : t === "vertical" ? e.scrollTop : e.scrollLeft;
1960
1970
  }
1961
- function fn(e, t) {
1962
- let n = ln(e) ? e.document.scrollingElement ?? e.document.documentElement : e;
1971
+ function _n(e, t) {
1972
+ let n = mn(e) ? e.document.scrollingElement ?? e.document.documentElement : e;
1963
1973
  return t === "vertical" ? n.scrollHeight - n.clientHeight : n.scrollWidth - n.clientWidth;
1964
1974
  }
1965
- function pn(e, t) {
1966
- let { overflowX: n, overflowY: r } = $t(e).getComputedStyle(e), i = t === "vertical" ? r : n;
1975
+ function vn(e, t) {
1976
+ let { overflowX: n, overflowY: r } = an(e).getComputedStyle(e), i = t === "vertical" ? r : n;
1967
1977
  return i === "visible" || i === "clip" ? !1 : t === "vertical" ? e.scrollHeight - e.clientHeight > 1 : e.scrollWidth - e.clientWidth > 1;
1968
1978
  }
1969
- function mn({ containerElement: e, direction: t, isRtl: n, scrollTarget: r }) {
1979
+ function yn({ containerElement: e, direction: t, isRtl: n, scrollTarget: r }) {
1970
1980
  let i = t === "vertical", a, o;
1971
- if (ln(r)) {
1981
+ if (mn(r)) {
1972
1982
  let { documentElement: e } = r.document;
1973
1983
  a = 0, o = i ? e.clientHeight : e.clientWidth;
1974
1984
  } else {
1975
1985
  let e = r.getBoundingClientRect();
1976
1986
  a = i ? e.top + r.clientTop : e.left + r.clientLeft, o = i ? r.clientHeight : r.clientWidth;
1977
1987
  }
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({
1988
+ 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
1989
  containerElement: e,
1980
1990
  direction: t,
1981
1991
  isRtl: n,
@@ -1988,8 +1998,8 @@ function mn({ containerElement: e, direction: t, isRtl: n, scrollTarget: r }) {
1988
1998
  viewportSize: o
1989
1999
  };
1990
2000
  }
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) => {
2001
+ function bn({ direction: e, isRtl: t, scrollTarget: n, viewportSize: r }) {
2002
+ let i = mn(n) ? n.document.documentElement : n, a = an(i).getComputedStyle(i), o = (e) => {
1993
2003
  let t = parseFloat(e ?? "");
1994
2004
  return !Number.isFinite(t) || t < 0 ? 0 : e.endsWith("px") ? t : e.endsWith("%") ? t * r / 100 : 0;
1995
2005
  };
@@ -2006,26 +2016,26 @@ function hn({ direction: e, isRtl: t, scrollTarget: n, viewportSize: r }) {
2006
2016
  start: s
2007
2017
  };
2008
2018
  }
2009
- function gn(e, t = "Assertion error") {
2019
+ function xn(e, t = "Assertion error") {
2010
2020
  if (!e) throw console.error(t), Error(t);
2011
2021
  }
2012
- function _n(e, t) {
2022
+ function Sn(e, t) {
2013
2023
  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;
2024
+ if (!!e != !!t || (xn(e !== void 0), xn(t !== void 0), Object.keys(e).length !== Object.keys(t).length)) return !1;
2015
2025
  for (let n in e) if (!Object.hasOwn(t, n) || !Object.is(t[n], e[n])) return !1;
2016
2026
  return !0;
2017
2027
  }
2018
- function vn({ cachedBounds: e, itemCount: t, itemSize: n }) {
2028
+ function Cn({ cachedBounds: e, itemCount: t, itemSize: n }) {
2019
2029
  if (t === 0) return 0;
2020
2030
  if (typeof n == "number") return t * n;
2021
2031
  {
2022
2032
  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);
2033
+ return xn(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
2024
2034
  }
2025
2035
  }
2026
- function yn({ align: e, cachedBounds: t, clamp: n = !0, index: r, itemCount: i, itemSize: a, containerScrollOffset: o, containerSize: s }) {
2036
+ function wn({ align: e, cachedBounds: t, clamp: n = !0, index: r, itemCount: i, itemSize: a, containerScrollOffset: o, containerSize: s }) {
2027
2037
  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({
2038
+ let c = t.get(r), l = Cn({
2029
2039
  cachedBounds: t,
2030
2040
  itemCount: i,
2031
2041
  itemSize: a
@@ -2037,7 +2047,7 @@ function yn({ align: e, cachedBounds: t, clamp: n = !0, index: r, itemCount: i,
2037
2047
  default: return p ? o : o < f ? f : d;
2038
2048
  }
2039
2049
  }
2040
- function bn({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCount: r, overscanCount: i }) {
2050
+ function Tn({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCount: r, overscanCount: i }) {
2041
2051
  let a = r - 1;
2042
2052
  if (r === 0) return {
2043
2053
  startIndexVisible: 0,
@@ -2071,12 +2081,12 @@ function bn({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemC
2071
2081
  stopIndexOverscan: Math.min(a, s + i)
2072
2082
  };
2073
2083
  }
2074
- function xn({ itemCount: e, itemProps: t, itemSize: n }) {
2084
+ function En({ itemCount: e, itemProps: t, itemSize: n }) {
2075
2085
  let r = /* @__PURE__ */ new Map();
2076
2086
  return {
2077
2087
  itemSize: typeof n == "number" ? n : void 0,
2078
2088
  get(i) {
2079
- if (gn(i < e, `Invalid index ${i}`), typeof n == "number") return gn(i >= 0, `Invalid index ${i}`), {
2089
+ if (xn(i < e, `Invalid index ${i}`), typeof n == "number") return xn(i >= 0, `Invalid index ${i}`), {
2080
2090
  size: n,
2081
2091
  scrollOffset: i * n
2082
2092
  };
@@ -2088,14 +2098,14 @@ function xn({ itemCount: e, itemProps: t, itemSize: n }) {
2088
2098
  });
2089
2099
  else {
2090
2100
  let t = r.get(e - 1);
2091
- gn(t !== void 0, `Unexpected bounds cache miss for index ${i}`), r.set(e, {
2101
+ xn(t !== void 0, `Unexpected bounds cache miss for index ${i}`), r.set(e, {
2092
2102
  scrollOffset: t.scrollOffset + t.size,
2093
2103
  size: a
2094
2104
  });
2095
2105
  }
2096
2106
  }
2097
2107
  let a = r.get(i);
2098
- return gn(a !== void 0, `Unexpected bounds cache miss for index ${i}`), a;
2108
+ return xn(a !== void 0, `Unexpected bounds cache miss for index ${i}`), a;
2099
2109
  },
2100
2110
  set(e, t) {
2101
2111
  r.set(e, t);
@@ -2105,8 +2115,8 @@ function xn({ itemCount: e, itemProps: t, itemSize: n }) {
2105
2115
  }
2106
2116
  };
2107
2117
  }
2108
- function Sn({ itemCount: e, itemProps: t, itemSize: n }) {
2109
- return G(() => xn({
2118
+ function Dn({ itemCount: e, itemProps: t, itemSize: n }) {
2119
+ return K(() => En({
2110
2120
  itemCount: e,
2111
2121
  itemProps: t,
2112
2122
  itemSize: n
@@ -2116,31 +2126,31 @@ function Sn({ itemCount: e, itemProps: t, itemSize: n }) {
2116
2126
  n
2117
2127
  ]);
2118
2128
  }
2119
- function Cn({ containerSize: e, itemSize: t }) {
2129
+ function On({ containerSize: e, itemSize: t }) {
2120
2130
  let n;
2121
2131
  switch (typeof t) {
2122
2132
  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;
2133
+ 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
2134
  break;
2125
2135
  default: n = t;
2126
2136
  }
2127
2137
  return typeof n == "number" && !(Number.isFinite(n) && n > 0) && (n = 0), n;
2128
2138
  }
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({
2139
+ 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 }) {
2140
+ let f = d !== void 0, p = f ? hn(e, d) : e, { height: m = n, width: h = n } = cn({
2131
2141
  defaultHeight: i === "vertical" ? n : void 0,
2132
2142
  defaultWidth: i === "horizontal" ? n : void 0,
2133
2143
  element: e,
2134
2144
  mode: i === "vertical" ? "only-height" : "only-width",
2135
2145
  style: t
2136
- }), g = K({
2146
+ }), g = q({
2137
2147
  height: 0,
2138
2148
  width: 0
2139
- }), [_, v] = q(n), y = f ? _ : i === "vertical" ? m : h, b = Cn({
2149
+ }), [_, v] = J(n), y = f ? _ : i === "vertical" ? m : h, b = On({
2140
2150
  containerSize: y,
2141
2151
  itemSize: c
2142
2152
  });
2143
- $(() => {
2153
+ en(() => {
2144
2154
  if (typeof l == "function") {
2145
2155
  let e = g.current;
2146
2156
  (e.height !== m || e.width !== h) && (l({
@@ -2153,11 +2163,11 @@ function wn({ containerElement: e, containerStyle: t, defaultContainerSize: n =
2153
2163
  l,
2154
2164
  h
2155
2165
  ]);
2156
- let x = Sn({
2166
+ let x = Dn({
2157
2167
  itemCount: o,
2158
2168
  itemProps: s,
2159
2169
  itemSize: b
2160
- }), S = Qt(), [C] = q(() => S || f ? 0 : r), w = U((e) => x.get(e), [x]), [T, E] = q(() => bn({
2170
+ }), S = rn(), [C] = J(() => S || f ? 0 : r), w = W((e) => x.get(e), [x]), [T, E] = J(() => Tn({
2161
2171
  cachedBounds: x,
2162
2172
  containerScrollOffset: C,
2163
2173
  containerSize: y,
@@ -2168,7 +2178,7 @@ function wn({ containerElement: e, containerStyle: t, defaultContainerSize: n =
2168
2178
  startIndexOverscan: Math.min(o - 1, T.startIndexOverscan),
2169
2179
  stopIndexVisible: Math.min(o - 1, T.stopIndexVisible),
2170
2180
  stopIndexOverscan: Math.min(o - 1, T.stopIndexOverscan)
2171
- }, j = U(() => vn({
2181
+ }, j = W(() => Cn({
2172
2182
  cachedBounds: x,
2173
2183
  itemCount: o,
2174
2184
  itemSize: b
@@ -2176,14 +2186,14 @@ function wn({ containerElement: e, containerStyle: t, defaultContainerSize: n =
2176
2186
  x,
2177
2187
  o,
2178
2188
  b
2179
- ]), M = U((t) => {
2180
- let n = sn({
2189
+ ]), M = W((t) => {
2190
+ let n = fn({
2181
2191
  containerElement: e,
2182
2192
  direction: i,
2183
2193
  isRtl: a,
2184
2194
  scrollOffset: t
2185
2195
  });
2186
- return bn({
2196
+ return Tn({
2187
2197
  cachedBounds: x,
2188
2198
  containerScrollOffset: n,
2189
2199
  containerSize: y,
@@ -2198,17 +2208,17 @@ function wn({ containerElement: e, containerStyle: t, defaultContainerSize: n =
2198
2208
  a,
2199
2209
  o,
2200
2210
  u
2201
- ]), N = K(!1);
2202
- $(() => {
2211
+ ]), N = q(!1);
2212
+ en(() => {
2203
2213
  if (!e || o === 0 || f || N.current || (N.current = !0, r <= 0)) return;
2204
- let t = i === "horizontal" && Xt(e);
2205
- if (sn({
2214
+ let t = i === "horizontal" && tn(e);
2215
+ if (fn({
2206
2216
  containerElement: e,
2207
2217
  direction: i,
2208
2218
  isRtl: t,
2209
2219
  scrollOffset: i === "vertical" ? e.scrollTop : e.scrollLeft
2210
2220
  }) !== 0) return;
2211
- let n = sn({
2221
+ let n = fn({
2212
2222
  containerElement: e,
2213
2223
  direction: i,
2214
2224
  isRtl: t,
@@ -2218,16 +2228,16 @@ function wn({ containerElement: e, containerStyle: t, defaultContainerSize: n =
2218
2228
  behavior: "instant",
2219
2229
  [i === "vertical" ? "top" : "left"]: n
2220
2230
  }) : i === "vertical" ? e.scrollTop = n : e.scrollLeft = n;
2221
- }, [e, o]), $(() => {
2231
+ }, [e, o]), en(() => {
2222
2232
  if (f && e && p) return;
2223
- let t = e && !f ? M(i === "vertical" ? e.scrollTop : e.scrollLeft) : bn({
2233
+ let t = e && !f ? M(i === "vertical" ? e.scrollTop : e.scrollLeft) : Tn({
2224
2234
  cachedBounds: x,
2225
2235
  containerScrollOffset: C,
2226
2236
  containerSize: y,
2227
2237
  itemCount: o,
2228
2238
  overscanCount: u
2229
2239
  });
2230
- E((e) => _n(t, e) ? e : t);
2240
+ E((e) => Sn(t, e) ? e : t);
2231
2241
  }, [
2232
2242
  x,
2233
2243
  e,
@@ -2239,23 +2249,23 @@ function wn({ containerElement: e, containerStyle: t, defaultContainerSize: n =
2239
2249
  o,
2240
2250
  u,
2241
2251
  p
2242
- ]), $(() => {
2252
+ ]), en(() => {
2243
2253
  if (!e || f) return;
2244
2254
  let t = () => {
2245
2255
  E((t) => {
2246
- let { scrollLeft: n, scrollTop: r } = e, s = sn({
2256
+ let { scrollLeft: n, scrollTop: r } = e, s = fn({
2247
2257
  containerElement: e,
2248
2258
  direction: i,
2249
2259
  isRtl: a,
2250
2260
  scrollOffset: i === "vertical" ? r : n
2251
- }), c = bn({
2261
+ }), c = Tn({
2252
2262
  cachedBounds: x,
2253
2263
  containerScrollOffset: s,
2254
2264
  containerSize: y,
2255
2265
  itemCount: o,
2256
2266
  overscanCount: u
2257
2267
  });
2258
- return _n(c, t) ? t : c;
2268
+ return Sn(c, t) ? t : c;
2259
2269
  });
2260
2270
  };
2261
2271
  return e.addEventListener("scroll", t), () => {
@@ -2271,34 +2281,34 @@ function wn({ containerElement: e, containerStyle: t, defaultContainerSize: n =
2271
2281
  o,
2272
2282
  u
2273
2283
  ]);
2274
- let P = rn(() => {
2284
+ let P = ln(() => {
2275
2285
  if (!e || !p) return;
2276
- let { offset: t, size: n, viewportSize: r } = mn({
2286
+ let { offset: t, size: n, viewportSize: r } = yn({
2277
2287
  containerElement: e,
2278
2288
  direction: i,
2279
2289
  isRtl: a,
2280
2290
  scrollTarget: p
2281
2291
  });
2282
2292
  v(r);
2283
- let s = bn({
2293
+ let s = Tn({
2284
2294
  cachedBounds: x,
2285
2295
  containerScrollOffset: t,
2286
2296
  containerSize: n,
2287
2297
  itemCount: o,
2288
2298
  overscanCount: u
2289
2299
  });
2290
- E((e) => _n(s, e) ? e : s);
2300
+ E((e) => Sn(s, e) ? e : s);
2291
2301
  });
2292
- return $(() => {
2302
+ return en(() => {
2293
2303
  f && P();
2294
- }), $(() => {
2304
+ }), en(() => {
2295
2305
  if (!f || !e || !p) return;
2296
- let t = $t(e), n = () => P();
2306
+ let t = an(e), n = () => P();
2297
2307
  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,
2308
+ let r, i = on(e);
2309
+ i && !mn(p) && (r = new i(n), r.observe(p));
2310
+ let a = pn({
2311
+ container: mn(p) ? p.document.documentElement : p,
2302
2312
  element: e,
2303
2313
  onChange: n
2304
2314
  });
@@ -2313,9 +2323,9 @@ function wn({ containerElement: e, containerStyle: t, defaultContainerSize: n =
2313
2323
  ]), {
2314
2324
  getCellBounds: w,
2315
2325
  getEstimatedSize: j,
2316
- getScrollPositionForIndex: rn(({ align: t = "auto", index: n }) => {
2326
+ getScrollPositionForIndex: ln(({ align: t = "auto", index: n }) => {
2317
2327
  let r = ({ clamp: e, containerScrollOffset: r, containerSize: i, padding: a }) => {
2318
- if (a.start === 0 && a.end === 0) return yn({
2328
+ if (a.start === 0 && a.end === 0) return wn({
2319
2329
  align: t,
2320
2330
  cachedBounds: x,
2321
2331
  clamp: e,
@@ -2325,7 +2335,7 @@ function wn({ containerElement: e, containerStyle: t, defaultContainerSize: n =
2325
2335
  itemCount: o,
2326
2336
  itemSize: b
2327
2337
  });
2328
- let s = yn({
2338
+ let s = wn({
2329
2339
  align: t,
2330
2340
  cachedBounds: x,
2331
2341
  clamp: !1,
@@ -2337,8 +2347,8 @@ function wn({ containerElement: e, containerStyle: t, defaultContainerSize: n =
2337
2347
  }) - a.start;
2338
2348
  return e ? Math.max(0, Math.min(j() - i, s)) : s;
2339
2349
  };
2340
- if (f && e && p && !pn(e, i)) {
2341
- let { viewportOffset: t, viewportSize: n } = mn({
2350
+ if (f && e && p && !vn(e, i)) {
2351
+ let { viewportOffset: t, viewportSize: n } = yn({
2342
2352
  containerElement: e,
2343
2353
  direction: i,
2344
2354
  isRtl: a,
@@ -2347,7 +2357,7 @@ function wn({ containerElement: e, containerStyle: t, defaultContainerSize: n =
2347
2357
  clamp: !1,
2348
2358
  containerScrollOffset: t,
2349
2359
  containerSize: n,
2350
- padding: hn({
2360
+ padding: bn({
2351
2361
  direction: i,
2352
2362
  isRtl: a,
2353
2363
  scrollTarget: p,
@@ -2355,20 +2365,20 @@ function wn({ containerElement: e, containerStyle: t, defaultContainerSize: n =
2355
2365
  })
2356
2366
  }) - t, s = i === "horizontal" && a ? -o : o;
2357
2367
  return {
2358
- scrollOffset: dn(p, i) + s,
2368
+ scrollOffset: gn(p, i) + s,
2359
2369
  scrollTarget: p
2360
2370
  };
2361
2371
  }
2362
2372
  let s = e ? i === "vertical" ? e.scrollTop : e.scrollLeft : 0, c = f && e ? i === "vertical" ? e.clientHeight : e.clientWidth : y, l = r({
2363
2373
  clamp: !0,
2364
- containerScrollOffset: sn({
2374
+ containerScrollOffset: fn({
2365
2375
  containerElement: e,
2366
2376
  direction: i,
2367
2377
  isRtl: a,
2368
2378
  scrollOffset: s
2369
2379
  }),
2370
2380
  containerSize: c,
2371
- padding: e ? hn({
2381
+ padding: e ? bn({
2372
2382
  direction: i,
2373
2383
  isRtl: a,
2374
2384
  scrollTarget: e,
@@ -2379,14 +2389,14 @@ function wn({ containerElement: e, containerStyle: t, defaultContainerSize: n =
2379
2389
  }
2380
2390
  });
2381
2391
  if (e && (!f || p)) {
2382
- if (l = sn({
2392
+ if (l = fn({
2383
2393
  containerElement: e,
2384
2394
  direction: i,
2385
2395
  isRtl: a,
2386
2396
  scrollOffset: l
2387
2397
  }), !f && typeof e.scrollTo != "function") {
2388
2398
  let e = M(l);
2389
- _n(T, e) || E(e);
2399
+ Sn(T, e) || E(e);
2390
2400
  }
2391
2401
  return {
2392
2402
  scrollOffset: l,
@@ -2401,33 +2411,33 @@ function wn({ containerElement: e, containerStyle: t, defaultContainerSize: n =
2401
2411
  stopIndexVisible: k
2402
2412
  };
2403
2413
  }
2404
- function Tn(e) {
2405
- let [t, n] = q(e);
2406
- return _n(t, e) ? t : (n(e), e);
2414
+ function An(e) {
2415
+ let [t, n] = J(e);
2416
+ return Sn(t, e) ? t : (n(e), e);
2407
2417
  }
2408
- function En(e, t) {
2418
+ function jn(e, t) {
2409
2419
  let { ariaAttributes: n, style: r, ...i } = e, { ariaAttributes: a, style: o, ...s } = t;
2410
- return _n(n, a) && _n(r, o) && _n(i, s);
2420
+ return Sn(n, a) && Sn(r, o) && Sn(i, s);
2411
2421
  }
2412
- var Dn = "data-react-window-index", On = "data-index";
2413
- function kn(e) {
2414
- let t = e.getAttribute(Dn) ?? e.getAttribute(On);
2422
+ var Mn = "data-react-window-index", Nn = "data-index";
2423
+ function Pn(e) {
2424
+ let t = e.getAttribute(Mn) ?? e.getAttribute(Nn);
2415
2425
  return t !== null && /^\d+$/.test(t) ? Number(t) : void 0;
2416
2426
  }
2417
- var An = 1e3, jn = 500;
2418
- function Mn(e) {
2427
+ var Fn = 1e3, In = 500;
2428
+ function Ln(e) {
2419
2429
  return 1 - (1 - e) ** 3;
2420
2430
  }
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(() => {
2431
+ function Rn({ direction: e, element: t, getCellBounds: n, isDynamicSize: r, itemCount: i, itemElements: a, scrollTarget: o, getScrollPositionForIndex: s }) {
2432
+ let c = e === "vertical", l = q(null), u = q(void 0), d = ln(() => {
2423
2433
  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);
2434
+ }), f = ln(() => {
2435
+ let e = an(t);
2426
2436
  u.current = {
2427
2437
  id: e.requestAnimationFrame(p),
2428
2438
  view: e
2429
2439
  };
2430
- }), p = rn(() => {
2440
+ }), p = ln(() => {
2431
2441
  u.current = void 0;
2432
2442
  let o = l.current;
2433
2443
  if (!o) return;
@@ -2441,27 +2451,27 @@ function Nn({ direction: e, element: t, getCellBounds: n, isDynamicSize: r, item
2441
2451
  index: o.index
2442
2452
  });
2443
2453
  if (m !== void 0) {
2444
- let { scrollOffset: t, scrollTarget: r } = m, s = Math.max(0, Math.min(t, fn(r, e)));
2454
+ let { scrollOffset: t, scrollTarget: r } = m, s = Math.max(0, Math.min(t, _n(r, e)));
2445
2455
  o.animation === void 0 && (o.animation = {
2446
- deadline: p + (o.smooth ? jn : 0) + An,
2447
- startOffset: dn(r, e),
2456
+ deadline: p + (o.smooth ? In : 0) + Fn,
2457
+ startOffset: gn(r, e),
2448
2458
  startTime: p
2449
2459
  });
2450
- let l = o.smooth ? (p - o.animation.startTime) / jn : 1;
2460
+ let l = o.smooth ? (p - o.animation.startTime) / In : 1;
2451
2461
  if (l < 1) {
2452
2462
  let { startOffset: e } = o.animation;
2453
2463
  o.stableFrames = 0, r.scrollTo({
2454
2464
  behavior: "instant",
2455
- [c ? "top" : "left"]: e + (s - e) * Mn(l)
2465
+ [c ? "top" : "left"]: e + (s - e) * Ln(l)
2456
2466
  });
2457
- } else if (Math.abs(s - dn(r, e)) > 1) o.stableFrames = 0, r.scrollTo({
2467
+ } else if (Math.abs(s - gn(r, e)) > 1) o.stableFrames = 0, r.scrollTo({
2458
2468
  behavior: "instant",
2459
2469
  [c ? "top" : "left"]: s
2460
2470
  });
2461
2471
  else {
2462
2472
  let e = a.current;
2463
- if (!(e.some((e) => kn(e) === o.index) && e.every((e) => {
2464
- let t = kn(e);
2473
+ if (!(e.some((e) => Pn(e) === o.index) && e.every((e) => {
2474
+ let t = Pn(e);
2465
2475
  if (t === void 0 || t >= i) return !0;
2466
2476
  let r = c ? e.offsetHeight : e.offsetWidth;
2467
2477
  return Math.abs(n(t).size - r) <= 1;
@@ -2474,7 +2484,7 @@ function Nn({ direction: e, element: t, getCellBounds: n, isDynamicSize: r, item
2474
2484
  }
2475
2485
  f();
2476
2486
  });
2477
- return $(() => {
2487
+ return en(() => {
2478
2488
  let e = o ?? t;
2479
2489
  if (!e) return;
2480
2490
  let n = (e) => {
@@ -2497,13 +2507,13 @@ function Nn({ direction: e, element: t, getCellBounds: n, isDynamicSize: r, item
2497
2507
  d,
2498
2508
  t,
2499
2509
  o
2500
- ]), U(({ align: n = "auto", behavior: i = "auto", index: a }) => {
2510
+ ]), W(({ align: n = "auto", behavior: i = "auto", index: a }) => {
2501
2511
  if (r && n === "smart") {
2502
2512
  let t = s({
2503
2513
  align: "auto",
2504
2514
  index: a
2505
2515
  });
2506
- n = t === void 0 || t.scrollOffset === dn(t.scrollTarget, e) ? "auto" : "center";
2516
+ n = t === void 0 || t.scrollOffset === gn(t.scrollTarget, e) ? "auto" : "center";
2507
2517
  }
2508
2518
  let o = s({
2509
2519
  align: n,
@@ -2535,11 +2545,11 @@ function Nn({ direction: e, element: t, getCellBounds: n, isDynamicSize: r, item
2535
2545
  s
2536
2546
  ]);
2537
2547
  }
2538
- function Pn({ callback: e, element: t, enabled: n = !0 }) {
2539
- let r = rn(e);
2540
- W(() => {
2548
+ function zn({ callback: e, element: t, enabled: n = !0 }) {
2549
+ let r = ln(e);
2550
+ G(() => {
2541
2551
  if (!n || !t) return;
2542
- let e = $t(t), i = e.requestAnimationFrame(() => {
2552
+ let e = an(t), i = e.requestAnimationFrame(() => {
2543
2553
  i = e.requestAnimationFrame(r);
2544
2554
  });
2545
2555
  return () => {
@@ -2551,7 +2561,7 @@ function Pn({ callback: e, element: t, enabled: n = !0 }) {
2551
2561
  r
2552
2562
  ]);
2553
2563
  }
2554
- function Fn({ elements: e, isFlowLayout: t, rowCount: n, startIndex: r, stopIndex: i }) {
2564
+ function Bn({ elements: e, isFlowLayout: t, rowCount: n, startIndex: r, stopIndex: i }) {
2555
2565
  if (r < 0 || i < r) return [];
2556
2566
  let a = [], o = /* @__PURE__ */ new Set(), s = !0;
2557
2567
  for (let t of e) {
@@ -2574,20 +2584,20 @@ function Fn({ elements: e, isFlowLayout: t, rowCount: n, startIndex: r, stopInde
2574
2584
  index: r + t
2575
2585
  }));
2576
2586
  }
2577
- function In(e) {
2587
+ function Vn(e) {
2578
2588
  return typeof e == "object" && !!e && "getAverageRowHeight" in e && typeof e.getAverageRowHeight == "function";
2579
2589
  }
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
- $(() => {
2590
+ var Hn = "data-react-window-sizer";
2591
+ 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 }) {
2592
+ 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);
2593
+ en(() => {
2584
2594
  w && E.current !== u && T(!1);
2585
- }, [w, u]), Pn({
2595
+ }, [w, u]), zn({
2586
2596
  callback: () => T(!1),
2587
2597
  element: y,
2588
2598
  enabled: w
2589
2599
  });
2590
- let { getCellBounds: D, getEstimatedSize: O, scrollTarget: k, getScrollPositionForIndex: A, startIndexOverscan: j, startIndexVisible: M, stopIndexOverscan: N, stopIndexVisible: P } = wn({
2600
+ let { getCellBounds: D, getEstimatedSize: O, scrollTarget: k, getScrollPositionForIndex: A, startIndexOverscan: j, startIndexVisible: M, stopIndexOverscan: N, stopIndexVisible: P } = kn({
2591
2601
  containerElement: y,
2592
2602
  containerStyle: h,
2593
2603
  defaultContainerSize: n,
@@ -2599,7 +2609,7 @@ function Rn({ children: e, className: t, defaultHeight: n = 0, defaultScrollOffs
2599
2609
  onResize: a,
2600
2610
  overscanCount: s,
2601
2611
  scrollElement: p
2602
- }), ee = K([]), F = Nn({
2612
+ }), ee = q([]), F = Rn({
2603
2613
  direction: "vertical",
2604
2614
  element: y,
2605
2615
  getCellBounds: D,
@@ -2609,16 +2619,16 @@ function Rn({ children: e, className: t, defaultHeight: n = 0, defaultScrollOffs
2609
2619
  scrollTarget: k,
2610
2620
  getScrollPositionForIndex: A
2611
2621
  });
2612
- Me(i, () => ({
2622
+ Ne(i, () => ({
2613
2623
  get element() {
2614
2624
  return y;
2615
2625
  },
2616
2626
  scrollToRow: F
2617
2627
  }), [y, F]);
2618
2628
  let I = w && x && j === 0;
2619
- $(() => {
2629
+ en(() => {
2620
2630
  if (!y) return;
2621
- let e = Array.from(y.children).filter((e) => !e.hasAttribute(Ln)), t = Fn({
2631
+ let e = Array.from(y.children).filter((e) => !e.hasAttribute(Hn)), t = Bn({
2622
2632
  elements: e,
2623
2633
  isFlowLayout: I,
2624
2634
  rowCount: l,
@@ -2626,9 +2636,9 @@ function Rn({ children: e, className: t, defaultHeight: n = 0, defaultScrollOffs
2626
2636
  stopIndex: N
2627
2637
  }), n = t.map(({ element: e }) => e);
2628
2638
  if (e.forEach((e) => {
2629
- n.includes(e) || e.removeAttribute(Dn);
2639
+ n.includes(e) || e.removeAttribute(Mn);
2630
2640
  }), t.forEach(({ element: e, index: t }) => {
2631
- e.setAttribute(Dn, `${t}`);
2641
+ e.setAttribute(Mn, `${t}`);
2632
2642
  }), ee.current = n, x) return u.observeRowElements(n);
2633
2643
  }, [
2634
2644
  v,
@@ -2641,7 +2651,7 @@ function Rn({ children: e, className: t, defaultHeight: n = 0, defaultScrollOffs
2641
2651
  _,
2642
2652
  j,
2643
2653
  N
2644
- ]), W(() => {
2654
+ ]), G(() => {
2645
2655
  j >= 0 && N >= 0 && o && o({
2646
2656
  startIndex: M,
2647
2657
  stopIndex: P
@@ -2656,11 +2666,11 @@ function Rn({ children: e, className: t, defaultHeight: n = 0, defaultScrollOffs
2656
2666
  N,
2657
2667
  P
2658
2668
  ]);
2659
- let L = G(() => {
2669
+ let L = K(() => {
2660
2670
  let e = [];
2661
2671
  if (l > 0) for (let t = j; t <= N; t++) {
2662
2672
  let n = D(t);
2663
- e.push(/* @__PURE__ */ Oe(v, {
2673
+ e.push(/* @__PURE__ */ ke(v, {
2664
2674
  ..._,
2665
2675
  ariaAttributes: {
2666
2676
  "aria-posinset": t + 1,
@@ -2689,9 +2699,9 @@ function Rn({ children: e, className: t, defaultHeight: n = 0, defaultScrollOffs
2689
2699
  _,
2690
2700
  j,
2691
2701
  N
2692
- ]), R = /* @__PURE__ */ V("div", {
2702
+ ]), R = /* @__PURE__ */ H("div", {
2693
2703
  "aria-hidden": !0,
2694
- [Ln]: "",
2704
+ [Hn]: "",
2695
2705
  style: {
2696
2706
  position: I ? "absolute" : void 0,
2697
2707
  top: I ? 0 : void 0,
@@ -2699,8 +2709,8 @@ function Rn({ children: e, className: t, defaultHeight: n = 0, defaultScrollOffs
2699
2709
  width: "100%",
2700
2710
  zIndex: -1
2701
2711
  }
2702
- }, "sizer"), z = /* @__PURE__ */ V(De, { children: e }, "children"), B = /* @__PURE__ */ V(De, { children: L }, "rows");
2703
- return Oe(m, {
2712
+ }, "sizer"), z = /* @__PURE__ */ H(Oe, { children: e }, "children"), B = /* @__PURE__ */ H(Oe, { children: L }, "rows");
2713
+ return ke(m, {
2704
2714
  role: "list",
2705
2715
  ...g,
2706
2716
  className: t,
@@ -2716,7 +2726,7 @@ function Rn({ children: e, className: t, defaultHeight: n = 0, defaultScrollOffs
2716
2726
  }
2717
2727
  }, ...I ? [z, B] : [B, z], R);
2718
2728
  }
2719
- var zn = /* @__PURE__ */ Object.assign(Rn, { displayName: "List" }), Bn = {
2729
+ var Wn = /* @__PURE__ */ Object.assign(Un, { displayName: "List" }), Gn = {
2720
2730
  search: "_search_5skzl_1",
2721
2731
  divider: "_divider_5skzl_5",
2722
2732
  item: "_item_5skzl_9",
@@ -2725,42 +2735,42 @@ var zn = /* @__PURE__ */ Object.assign(Rn, { displayName: "List" }), Bn = {
2725
2735
  stateLabel: "_stateLabel_5skzl_27",
2726
2736
  itemSelectedBackground: "_itemSelectedBackground_5skzl_37",
2727
2737
  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", {
2738
+ }, 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 }) => {
2739
+ let p = r[e], m = Zt(p.iconUrl, p.type, p.displayName ?? p.id, b.SM), h = p.id === i;
2740
+ return /* @__PURE__ */ H("div", {
2731
2741
  style: t,
2732
2742
  ...n,
2733
- children: /* @__PURE__ */ V(h, {
2743
+ children: /* @__PURE__ */ H(_, {
2734
2744
  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,
2745
+ "aria-current": h ? "true" : void 0,
2746
+ 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),
2747
+ iconBefore: /* @__PURE__ */ H("span", {
2748
+ className: Gn.itemIcon,
2739
2749
  children: m
2740
2750
  }),
2741
- label: /* @__PURE__ */ H("span", {
2751
+ label: /* @__PURE__ */ U("span", {
2742
2752
  className: "flex flex-1 items-center justify-between gap-2",
2743
- children: [/* @__PURE__ */ V(T, {
2753
+ children: [/* @__PURE__ */ H(D, {
2744
2754
  text: p.displayName ?? p.id,
2745
2755
  query: o,
2746
2756
  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,
2757
+ className: d(a, "min-w-0 flex-1 text-start")
2758
+ }), h && /* @__PURE__ */ H(_e, {
2759
+ size: b.SM,
2760
+ className: Gn.checkIcon,
2751
2761
  "aria-hidden": !0,
2752
- stroke: y
2762
+ stroke: x
2753
2763
  })]
2754
2764
  }),
2755
2765
  onClick: () => f(p.id)
2756
2766
  })
2757
2767
  });
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(() => {
2768
+ }, 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 }) => {
2769
+ let [b, x] = J(""), S = v ?? b, C = y ?? x;
2770
+ G(() => {
2761
2771
  e || x("");
2762
2772
  }, [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) => {
2773
+ 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
2774
  s(e), i();
2765
2775
  }, j = _?.colors, M = c({
2766
2776
  "--ci-sheet-divider": g?.divider,
@@ -2772,63 +2782,63 @@ var zn = /* @__PURE__ */ Object.assign(Rn, { displayName: "List" }), Bn = {
2772
2782
  "--ci-sheet-selected-bg": j?.selectedItemBackground,
2773
2783
  "--ci-sheet-selected-text": j?.selectedItemText
2774
2784
  }), N;
2775
- return N = D ? /* @__PURE__ */ V(Wt, {}) : O ? /* @__PURE__ */ V("div", {
2785
+ return N = E ? /* @__PURE__ */ H(Jt, {}) : D ? /* @__PURE__ */ H("div", {
2776
2786
  role: "list",
2777
- className: l(Bn.stateLabel, h, "px-4 py-4"),
2778
- children: O
2779
- }) : /* @__PURE__ */ V(zn, {
2787
+ className: d(Gn.stateLabel, h, "px-4 py-4"),
2788
+ children: D
2789
+ }) : /* @__PURE__ */ H(Wn, {
2780
2790
  role: "list",
2781
2791
  className: "overflow-y-auto",
2782
- style: { height: Math.min(k.length, Hn) * Vn },
2783
- rowComponent: Un,
2792
+ style: { height: Math.min(k.length, qn) * Kn },
2793
+ rowComponent: Jn,
2784
2794
  rowCount: k.length,
2785
- rowHeight: Vn,
2795
+ rowHeight: Kn,
2786
2796
  rowProps: {
2787
2797
  items: k,
2788
2798
  selectedDeploymentId: o,
2789
2799
  labelClassName: h,
2790
- query: C,
2800
+ query: S,
2791
2801
  itemClassName: _?.itemClassName,
2792
2802
  selectedItemClassName: _?.selectedItemClassName,
2793
2803
  hasSelectedBackground: !!j?.selectedItemBackground,
2794
2804
  hasSelectedText: !!j?.selectedItemText,
2795
2805
  onSelect: A
2796
2806
  }
2797
- }), /* @__PURE__ */ V(Ie, {
2807
+ }), /* @__PURE__ */ H(Le, {
2798
2808
  isOpen: e,
2799
2809
  title: t,
2800
2810
  closeLabel: n,
2801
2811
  onClose: i,
2802
2812
  style: p,
2803
2813
  titleClassName: m,
2804
- className: l("max-h-[80dvh]", _?.className, J.modelMenu),
2814
+ className: d("max-h-[80dvh]", _?.className, Y.modelMenu),
2805
2815
  colors: g?.shell,
2806
- children: /* @__PURE__ */ H("div", {
2816
+ children: /* @__PURE__ */ U("div", {
2807
2817
  className: "contents",
2808
2818
  style: M,
2809
2819
  children: [
2810
- /* @__PURE__ */ V(E, {
2820
+ /* @__PURE__ */ H(O, {
2811
2821
  visuallyHidden: !0,
2812
- children: D ? u : null
2822
+ children: E ? l : null
2813
2823
  }),
2814
- T && !D && /* @__PURE__ */ H(ue, { children: [/* @__PURE__ */ V("div", {
2824
+ T && !E && /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H("div", {
2815
2825
  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,
2826
+ className: d("shrink-0 px-4 py-[10px]", Gn.search, _?.searchHeaderClassName, Y.modelMenuSearch),
2827
+ children: /* @__PURE__ */ H(re, {
2828
+ value: S,
2819
2829
  placeholder: r,
2820
- size: S.Standard,
2821
- onChange: (e) => w(e ?? "")
2830
+ size: w.Standard,
2831
+ onChange: (e) => C(e ?? "")
2822
2832
  })
2823
- }), /* @__PURE__ */ V("div", { className: l(Bn.divider, "h-px shrink-0") })] }),
2833
+ }), /* @__PURE__ */ H("div", { className: d(Gn.divider, "h-px shrink-0") })] }),
2824
2834
  N
2825
2835
  ]
2826
2836
  })
2827
2837
  });
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({
2838
+ }, 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 }) => {
2839
+ let [y, w] = J(!1), T = h ?? y, D = (e) => {
2840
+ w(e), v?.(e), I(e);
2841
+ }, { searchQuery: O, onSearchQueryChange: k, selectorIcon: A, selectorAriaLabel: j, selectedLabel: M, selectedVersion: N, menuItems: P, menuHeader: ee, menuStyle: F, onOpenChange: I } = $t({
2832
2842
  deployments: e,
2833
2843
  selectedDeploymentId: t,
2834
2844
  onDeploymentChange: n,
@@ -2836,18 +2846,18 @@ var zn = /* @__PURE__ */ Object.assign(Rn, { displayName: "List" }), Bn = {
2836
2846
  styles: i
2837
2847
  });
2838
2848
  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),
2849
+ let L = l || f, R = L ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0, z = /* @__PURE__ */ H(ve, {
2850
+ size: b.SM,
2851
+ className: d(Z.modelSelectorCaret, Y.modelSelectorCaret),
2842
2852
  "aria-hidden": !0,
2843
- stroke: y
2844
- }), B = /* @__PURE__ */ V("span", {
2845
- className: l("flex shrink-0 items-center", J.modelSelectorIcon),
2853
+ stroke: x
2854
+ }), B = /* @__PURE__ */ H("span", {
2855
+ className: d("flex shrink-0 items-center", Y.modelSelectorIcon),
2846
2856
  children: A
2847
2857
  });
2848
- if (d) return /* @__PURE__ */ H(ue, { children: [/* @__PURE__ */ V(w, {
2858
+ if (u) return /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H(E, {
2849
2859
  tooltipProps: { tooltip: M },
2850
- icon: /* @__PURE__ */ H("div", {
2860
+ icon: /* @__PURE__ */ U("div", {
2851
2861
  className: "flex items-center gap-1",
2852
2862
  children: [B, z]
2853
2863
  }),
@@ -2856,19 +2866,19 @@ var zn = /* @__PURE__ */ Object.assign(Rn, { displayName: "List" }), Bn = {
2856
2866
  onClick: () => {
2857
2867
  L || D(!0);
2858
2868
  },
2859
- className: l("w-[50px]", X.modelSelectorButton, R, J.modelSelectorButton)
2860
- }), m ? /* @__PURE__ */ V(Ie, {
2861
- isOpen: E,
2869
+ className: d("w-[50px]", Z.modelSelectorButton, R, Y.modelSelectorButton)
2870
+ }), m ? /* @__PURE__ */ H(Le, {
2871
+ isOpen: T,
2862
2872
  title: r?.ariaLabel ?? "Select model",
2863
2873
  closeLabel: r?.closeLabel ?? "Close",
2864
2874
  onClose: () => D(!1),
2865
2875
  style: p,
2866
- className: l(i?.className, J.modelMenu),
2876
+ className: d(i?.className, Y.modelMenu),
2867
2877
  children: m(() => D(!1))
2868
- }) : /* @__PURE__ */ V(Wn, {
2878
+ }) : /* @__PURE__ */ H(Yn, {
2869
2879
  searchQuery: O,
2870
2880
  onSearchQueryChange: k,
2871
- isOpen: E,
2881
+ isOpen: T,
2872
2882
  title: r?.ariaLabel ?? "Select model",
2873
2883
  closeLabel: r?.closeLabel ?? "Close",
2874
2884
  searchPlaceholder: r?.searchPlaceholder ?? "Search",
@@ -2884,304 +2894,304 @@ var zn = /* @__PURE__ */ Object.assign(Rn, { displayName: "List" }), Bn = {
2884
2894
  })] });
2885
2895
  if (m) {
2886
2896
  let e = N ? `${M} · ${N}` : M;
2887
- return /* @__PURE__ */ V(b, {
2897
+ return /* @__PURE__ */ H(S, {
2888
2898
  placement: "top-end",
2889
2899
  matchReferenceWidth: !1,
2890
- open: E,
2900
+ open: T,
2891
2901
  onOpenChange: D,
2892
2902
  trigger: [],
2893
2903
  outsideClosable: !0,
2894
- overlayRole: x.Dialog,
2904
+ overlayRole: C.Dialog,
2895
2905
  overlayAriaLabel: r?.ariaLabel ?? "Select model",
2896
2906
  renderOverlay: () => m(() => D(!1)),
2897
- listClassName: l("w-[368px]!", X.modelOverlayPanel, i?.className, J.modelMenu),
2907
+ listClassName: d("w-[368px]!", Z.modelOverlayPanel, i?.className, Y.modelMenu),
2898
2908
  listStyle: c({ "--ci-model-overlay-bg": i?.colors?.overlayBackground }),
2899
- children: /* @__PURE__ */ V(h, {
2909
+ children: /* @__PURE__ */ H(_, {
2900
2910
  "aria-label": j,
2901
2911
  "aria-disabled": L || void 0,
2902
2912
  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),
2913
+ 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
2914
  onClick: () => {
2905
- L || (_ ? _() : D(!E));
2915
+ L || (g ? g() : D(!T));
2906
2916
  },
2907
2917
  iconBefore: B,
2908
2918
  iconAfter: z,
2909
2919
  textClassName: "min-w-0",
2910
- label: /* @__PURE__ */ H("span", {
2920
+ label: /* @__PURE__ */ U("span", {
2911
2921
  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),
2922
+ children: [/* @__PURE__ */ H("span", {
2923
+ className: d("max-w-[180px] shrink-0 truncate", a, Z.modelSelectorName),
2914
2924
  children: M
2915
- }), N && /* @__PURE__ */ V("span", {
2916
- className: l("min-w-0 truncate", o, X.modelSelectorVersion),
2925
+ }), N && /* @__PURE__ */ H("span", {
2926
+ className: d("min-w-0 truncate", o, Z.modelSelectorVersion),
2917
2927
  children: N
2918
2928
  })]
2919
2929
  })
2920
2930
  })
2921
2931
  });
2922
2932
  }
2923
- return /* @__PURE__ */ V("div", {
2924
- className: l(R),
2933
+ return /* @__PURE__ */ H("div", {
2934
+ className: d(R),
2925
2935
  "aria-disabled": L || void 0,
2926
- children: /* @__PURE__ */ V(b, {
2936
+ children: /* @__PURE__ */ H(S, {
2927
2937
  items: P,
2928
2938
  menuHeader: ee,
2929
2939
  placement: "bottom-end",
2930
2940
  matchReferenceWidth: !1,
2931
2941
  maxDropdownHeight: s,
2932
- listClassName: l("w-[240px]!", i?.className, J.modelMenu),
2942
+ listClassName: d("w-[240px]!", i?.className, Y.modelMenu),
2933
2943
  listStyle: F,
2934
2944
  disabled: L,
2935
- open: E,
2945
+ open: T,
2936
2946
  onOpenChange: L ? void 0 : D,
2937
- children: /* @__PURE__ */ V(h, {
2947
+ children: /* @__PURE__ */ H(_, {
2938
2948
  "aria-label": j,
2939
2949
  "aria-disabled": L || void 0,
2940
2950
  tooltipProps: { tooltip: M },
2941
2951
  iconBefore: B,
2942
2952
  iconAfter: z,
2943
- className: l("h-auto gap-1 rounded-full! border-0! p-1.5", X.modelSelectorButton, L && X.modelSelectorButtonDisabled, J.modelSelectorButton)
2953
+ className: d("h-auto gap-1 rounded-full! border-0! p-1.5", Z.modelSelectorButton, L && Z.modelSelectorButtonDisabled, Y.modelSelectorButton)
2944
2954
  })
2945
2955
  })
2946
2956
  });
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, isToolChipRowAllowedOnPhone: Ce = !1, renderFooterActions: we, isInputDisabled: Te = !1, isModelSelectorDisabled: Ee = !1, isSendDisabled: De = !1, isAudioMessageSupported: Oe = !1, isVoiceRecordingSupported: ke = Oe, onTranscribeAudio: Ae, transcribingLabel: je, voiceErrorLabel: Ne, sendOnEnter: Pe = $e.Enter, prefixAttachments: Fe = [], onRemovePrefixAttachment: Ie, chatSettings: Le, toolsMenuItems: ze, onToolToggle: Be, canRemoveTools: Ue = !0, toolsMenuTitle: We, toolsBackLabel: Ke, toolsChipLabels: Je, menuOverlays: Ye, activeMentions: Xe, onBackspaceAtCaret: Ze, caretPositionOverride: Qe, commandMenu: tt, autoFocus: Y = !1, messageHistory: rt, onDialFileSystemClick: at, dialFileSystemLabel: st, validateAttachment: ct, onAttachmentClick: lt, modelPickerOverlay: ut, onModelPickerOpenChange: mt, maximumAttachmentsAmount: ht, onAttachmentsLimitExceeded: gt, isAttachmentsEnabled: _t = !0, isTextAttachmentsAllowed: yt = !0, usageLimitsSlot: bt, onMessageTooLong: xt }, St) => {
2948
- let Ct = d(), wt = f(), jt = wt && !Ce, [Mt, Nt] = q(!1), Pt = (e) => {
2949
- Nt(e), mt?.(e);
2950
- }, Ft = Ve(rt), It = Xe ?? [], Lt = It.length > 0, Rt = G(() => At(z), [z]), { message: Z, setMessage: zt, textareaRef: Q } = He({
2957
+ }, 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: 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: 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) => {
2958
+ let xt = p(), Ct = m(), wt = Ct && !Se, [Tt, Et] = J(!1), Dt = (e) => {
2959
+ Et(e), lt?.(e);
2960
+ }, Ot = Ge(et), Ft = qe ?? [], It = Ft.length > 0, Lt = K(() => Pt(z), [z]), { message: Q, setMessage: Rt, textareaRef: $ } = Ke({
2951
2961
  messageProp: e,
2952
2962
  messageRevision: t
2953
2963
  });
2954
- W(() => {
2955
- let e = Q.current;
2964
+ G(() => {
2965
+ let e = $.current;
2956
2966
  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(St, () => ({ getCaretPosition: () => Q.current?.selectionStart ?? Z.length }), [Z, Q]);
2960
- let { handleUndoKeyDown: Ut, markCaretPlaced: Wt } = Ge({
2967
+ }, [$]), G(() => {
2968
+ n !== void 0 && $.current?.focus();
2969
+ }, [n, $]), Ne(bt, () => ({ getCaretPosition: () => $.current?.selectionStart ?? Q.length }), [Q, $]);
2970
+ let { handleUndoKeyDown: zt, markCaretPlaced: Bt } = Ye({
2961
2971
  insertion: r,
2962
- textareaRef: Q
2963
- }), { isMenuOpen: Gt, query: Kt, activeWordStart: qt, closeOnOutsidePress: Jt, handleValueChange: Yt, commandMenuListboxId: $, commandMenuOverlayRef: Xt, activeCommandOptionId: Zt, handleTextareaClick: Qt, handleTextareaFocus: $t, handleTextareaKeyUp: en, skipFocusMenuEvaluationRef: tn, triggerEnd: nn, hasCommandEmptyQueryHint: rn, markerOffset: an, handleCloseCommandMenu: on, isSendGesture: sn, handleCommandMenuKeyDown: cn } = Tt({
2964
- commandMenu: tt,
2965
- message: Z,
2966
- setMessage: zt,
2967
- textareaRef: Q,
2968
- historyNav: Ft,
2972
+ textareaRef: $
2973
+ }), { 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({
2974
+ commandMenu: Qe,
2975
+ message: Q,
2976
+ setMessage: Rt,
2977
+ textareaRef: $,
2978
+ historyNav: Ot,
2969
2979
  onChange: c,
2970
- caretPositionOverride: Qe,
2980
+ caretPositionOverride: Xe,
2971
2981
  messageRevision: t,
2972
- markCaretPlaced: Wt,
2973
- sendOnEnter: Pe
2974
- }), ln = K(Z);
2975
- ln.current = Z;
2976
- let { attachments: un, buildAttachments: dn, addAttachments: fn, resetAttachments: pn, handleRemove: mn, handleRetry: hn, handleExpand: gn, hasBlockedAttachments: _n } = Re({
2977
- initialAttachments: ge,
2982
+ markCaretPlaced: Bt,
2983
+ sendOnEnter: Me
2984
+ }), ln = q(Q);
2985
+ ln.current = Q;
2986
+ let { attachments: un, buildAttachments: dn, addAttachments: fn, resetAttachments: pn, handleRemove: mn, handleRetry: hn, handleExpand: gn, hasBlockedAttachments: _n } = He({
2987
+ initialAttachments: he,
2978
2988
  onUploadAttachment: a,
2979
- onAttachmentsChange: u,
2980
- validateAttachment: ct,
2989
+ onAttachmentsChange: l,
2990
+ validateAttachment: at,
2981
2991
  pendingDropFiles: ie,
2982
2992
  onDropFilesConsumed: ae,
2983
- isDropDisabled: Te,
2993
+ isDropDisabled: we,
2984
2994
  pendingAttachments: oe,
2985
2995
  onPendingAttachmentsConsumed: se,
2986
- onExpandPastedText: U((e) => {
2996
+ onExpandPastedText: W((e) => {
2987
2997
  let t = ln.current, n = t ? `${t}\n${e}` : e;
2988
- ln.current = n, zt(n), c?.(n);
2989
- }, [zt, c]),
2990
- maximumAttachmentsAmount: ht,
2991
- baseAttachmentsAmount: Fe.length,
2992
- onAttachmentsLimitExceeded: gt
2993
- }), { voiceState: vn, analyserNodeRef: yn, voiceError: bn, startRecording: xn, stopRecording: Sn, discardRecording: Cn, isVoiceActive: wn, latestTranscript: Tn } = kt({
2998
+ ln.current = n, Rt(n), c?.(n);
2999
+ }, [Rt, c]),
3000
+ maximumAttachmentsAmount: dt,
3001
+ baseAttachmentsAmount: Pe.length,
3002
+ onAttachmentsLimitExceeded: ft
3003
+ }), { voiceState: vn, analyserNodeRef: yn, voiceError: bn, startRecording: xn, stopRecording: Sn, discardRecording: Cn, isVoiceActive: wn, latestTranscript: Tn } = Nt({
2994
3004
  addAttachments: fn,
2995
3005
  buildAttachments: dn,
2996
3006
  draftRef: ln,
2997
- setMessage: zt,
2998
- historyNav: Ft,
3007
+ setMessage: Rt,
3008
+ historyNav: Ot,
2999
3009
  onChange: c,
3000
- onTranscribeAudio: Ae,
3001
- voiceErrorLabel: Ne,
3002
- textareaRef: Q,
3010
+ onTranscribeAudio: ke,
3011
+ voiceErrorLabel: je,
3012
+ textareaRef: $,
3003
3013
  skipFocusMenuEvaluationRef: tn
3004
- }), En = K(null), Dn = K(null), On = Dt({
3014
+ }), En = q(null), Dn = q(null), On = jt({
3005
3015
  addAttachments: fn,
3006
- isAttachmentsEnabled: _t,
3007
- isTextAttachmentsAllowed: yt,
3016
+ isAttachmentsEnabled: pt,
3017
+ isTextAttachmentsAllowed: mt,
3008
3018
  pasteTextThreshold: ce,
3009
3019
  maxMessageLength: le,
3010
- onMessageTooLong: xt,
3011
- commandMenu: tt
3012
- }), kn = Z.trim().length > 0 || un.length > 0, An = kn && !_n && !De && !wn, { visibleTools: jn, handleToolDismiss: Mn } = Et({
3013
- toolsMenuItems: ze,
3014
- canRemoveTools: Ue,
3015
- onToolToggle: Be
3016
- }), [Nn, Pn] = q(!1), Fn = fe === void 0 || pe != null, In = Oe && !s, { handleSend: Ln, handleKeyDown: Rn } = Ot({
3017
- message: Z,
3018
- setMessage: zt,
3020
+ onMessageTooLong: yt,
3021
+ commandMenu: Qe
3022
+ }), kn = Q.trim().length > 0 || un.length > 0, An = kn && !_n && !Ee && !wn, { visibleTools: jn, handleToolDismiss: Mn } = At({
3023
+ toolsMenuItems: Le,
3024
+ canRemoveTools: ze,
3025
+ onToolToggle: Re
3026
+ }), [Nn, Pn] = J(!1), Fn = ue === void 0 || de != null, In = De && !s, { handleSend: Ln, handleKeyDown: Rn } = Mt({
3027
+ message: Q,
3028
+ setMessage: Rt,
3019
3029
  attachments: un,
3020
3030
  resetAttachments: pn,
3021
- historyNav: Ft,
3031
+ historyNav: Ot,
3022
3032
  onSend: i,
3023
- onMessageTooLong: xt,
3033
+ onMessageTooLong: yt,
3024
3034
  maxMessageLength: le,
3025
- isSendDisabled: De,
3035
+ isSendDisabled: Ee,
3026
3036
  isVoiceActive: wn,
3027
- isInputDisabled: Te,
3037
+ isInputDisabled: we,
3028
3038
  isStreaming: s,
3029
3039
  canSend: An,
3030
3040
  hasModelSelected: Fn,
3031
- handleUndoKeyDown: Ut,
3041
+ handleUndoKeyDown: zt,
3032
3042
  handleCommandMenuKeyDown: cn,
3033
3043
  isSendGesture: sn,
3034
- onBackspaceAtCaret: Ze
3044
+ onBackspaceAtCaret: Je
3035
3045
  }), zn = (e) => {
3036
3046
  let t = Array.from(e.target.files ?? []);
3037
3047
  if (t.length === 0) return;
3038
3048
  let n = dn(t);
3039
3049
  e.target.value = "", fn(n);
3040
- }, { textareaAreaRef: Bn, caretAnchor: Vn, mirrorInsertions: Hn, isMirrorActive: Un, mirrorRef: Wn, selectionRects: Kn, updateSelectionRects: qn, handleTextareaScroll: Jn } = vt({
3041
- commandMenu: tt,
3042
- message: Z,
3043
- textareaRef: Q,
3044
- hasActiveMentions: Lt,
3050
+ }, { textareaAreaRef: Bn, caretAnchor: Vn, mirrorInsertions: Hn, isMirrorActive: Un, mirrorRef: Wn, selectionRects: Gn, updateSelectionRects: Kn, handleTextareaScroll: qn } = St({
3051
+ commandMenu: Qe,
3052
+ message: Q,
3053
+ textareaRef: $,
3054
+ hasActiveMentions: It,
3045
3055
  markerOffset: an,
3046
3056
  triggerEnd: nn,
3047
3057
  hasCommandEmptyQueryHint: rn
3048
- }), Yn = /* @__PURE__ */ V("textarea", {
3049
- className: l(X.textarea, Un && 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: Y,
3052
- value: Z,
3058
+ }), Jn = /* @__PURE__ */ H("textarea", {
3059
+ className: d(Z.textarea, Un && Z.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"),
3060
+ ref: $,
3061
+ autoFocus: $e,
3062
+ value: Q,
3053
3063
  onChange: (e) => {
3054
- zt(e.target.value), Ft.notifyChange();
3064
+ Rt(e.target.value), Ot.notifyChange();
3055
3065
  let t = e.nativeEvent instanceof InputEvent ? e.nativeEvent : void 0;
3056
- Yt(e.target.value, e.target.selectionStart ?? e.target.value.length, t?.isComposing ?? !1), c?.(e.target.value);
3066
+ Jt(e.target.value, e.target.selectionStart ?? e.target.value.length, t?.isComposing ?? !1), c?.(e.target.value);
3057
3067
  },
3058
- onSelect: qn,
3059
- onScroll: Jn,
3068
+ onSelect: Kn,
3069
+ onScroll: qn,
3060
3070
  onFocus: $t,
3061
3071
  onClick: Qt,
3062
3072
  onKeyDown: Rn,
3063
3073
  onKeyUp: en,
3064
3074
  onPaste: On,
3065
- placeholder: p,
3066
- "aria-label": m,
3067
- "aria-autocomplete": tt == null ? void 0 : "list",
3068
- "aria-controls": Gt ? $ : void 0,
3075
+ placeholder: u,
3076
+ "aria-label": f,
3077
+ "aria-autocomplete": Qe == null ? void 0 : "list",
3078
+ "aria-controls": Vt ? Yt : void 0,
3069
3079
  "aria-activedescendant": Zt ?? void 0,
3070
- "aria-hidden": Lt ? !0 : void 0,
3071
- disabled: Te,
3080
+ "aria-hidden": It ? !0 : void 0,
3081
+ disabled: we,
3072
3082
  readOnly: wn,
3073
3083
  rows: 1
3074
- }), Xn = /* @__PURE__ */ V(Ht, {
3084
+ }), Yn = /* @__PURE__ */ H(Gt, {
3075
3085
  areaRef: Bn,
3076
3086
  mirrorRef: Wn,
3077
3087
  isMirrorActive: Un,
3078
3088
  fontClassName: B?.fontClassName,
3079
- message: Z,
3080
- mentionRanges: It,
3089
+ message: Q,
3090
+ mentionRanges: Ft,
3081
3091
  mirrorInsertions: Hn,
3082
- selectionRects: Kn,
3083
- children: /* @__PURE__ */ V(Vt, {
3084
- textarea: Yn,
3085
- textareaRef: Q,
3086
- commandMenu: tt,
3092
+ selectionRects: Gn,
3093
+ children: /* @__PURE__ */ H(Wt, {
3094
+ textarea: Jn,
3095
+ textareaRef: $,
3096
+ commandMenu: Qe,
3087
3097
  caretAnchor: Vn,
3088
3098
  fontClassName: B?.fontClassName,
3089
- isMenuOpen: Gt,
3090
- query: Kt,
3091
- activeWordStart: qt,
3092
- listboxId: $,
3099
+ isMenuOpen: Vt,
3100
+ query: Ht,
3101
+ activeWordStart: Kt,
3102
+ listboxId: Yt,
3093
3103
  activeOptionId: Zt,
3094
3104
  overlayRef: Xt,
3095
- onOutsidePress: Jt,
3105
+ onOutsidePress: qt,
3096
3106
  onClose: on
3097
3107
  })
3098
- }), Zn = _e ? void 0 : /* @__PURE__ */ V(Bt, {
3108
+ }), Zn = ge ? void 0 : /* @__PURE__ */ H(Ut, {
3099
3109
  fileInputRef: En,
3100
- textareaRef: Q,
3101
- message: Z,
3102
- style: Rt,
3103
- hideAttachFile: ve,
3104
- isInputDisabled: Te,
3110
+ textareaRef: $,
3111
+ message: Q,
3112
+ style: Lt,
3113
+ hideAttachFile: _e,
3114
+ isInputDisabled: we,
3105
3115
  isStreaming: s,
3106
- isAttachmentsEnabled: _t,
3107
- isVoiceRecordingSupported: ke,
3116
+ isAttachmentsEnabled: pt,
3117
+ isVoiceRecordingSupported: Oe,
3108
3118
  isVoiceActive: wn,
3109
3119
  startRecording: xn,
3110
- isPhone: jt,
3111
- canRemoveTools: Ue,
3112
- toolsMenuItems: ze,
3113
- onToolToggle: Be,
3114
- chatSettings: Le,
3115
- menuOverlays: Ye,
3116
- onDialFileSystemClick: at,
3117
- dialFileSystemLabel: st,
3120
+ isPhone: wt,
3121
+ canRemoveTools: ze,
3122
+ toolsMenuItems: Le,
3123
+ onToolToggle: Re,
3124
+ chatSettings: Ie,
3125
+ menuOverlays: We,
3126
+ onDialFileSystemClick: tt,
3127
+ dialFileSystemLabel: nt,
3118
3128
  attachLabel: h,
3119
3129
  addMenuTitle: _,
3120
- menuTitle: b,
3121
- menuCloseLabel: x,
3130
+ menuTitle: v,
3131
+ menuCloseLabel: y,
3122
3132
  recordVoiceLabel: I,
3123
- toolsMenuTitle: We,
3124
- toolsBackLabel: Ke
3125
- }), Qn = xe === et.Inline && (!Ct || Se), $n = Zn && /* @__PURE__ */ V("div", {
3126
- className: l("flex", J.addCluster),
3133
+ toolsMenuTitle: Be,
3134
+ toolsBackLabel: Ve
3135
+ }), Qn = ye === it.Inline && (!xt || be), $n = Zn && /* @__PURE__ */ H("div", {
3136
+ className: d("flex", Y.addCluster),
3127
3137
  children: Zn
3128
- }), er = ze ?? [], tr = er.length > 0 && Be != null && /* @__PURE__ */ H("div", {
3129
- className: l("max-w-full min-w-0 flex-[1_0_auto]", J.toolsChips),
3130
- children: [/* @__PURE__ */ V(ot, {
3138
+ }), er = Le ?? [], tr = er.length > 0 && Re != null && /* @__PURE__ */ U("div", {
3139
+ className: d("max-w-full min-w-0 flex-[1_0_auto]", Y.toolsChips),
3140
+ children: [/* @__PURE__ */ H(ut, {
3131
3141
  items: er,
3132
- title: We,
3133
- summaryLabel: Je?.summaryLabel,
3142
+ title: Be,
3143
+ summaryLabel: Ue?.summaryLabel,
3134
3144
  onClick: () => Pn(!0)
3135
- }), /* @__PURE__ */ V(nt, {
3145
+ }), /* @__PURE__ */ H(ot, {
3136
3146
  isOpen: Nn,
3137
3147
  onClose: () => Pn(!1),
3138
- closeLabel: x,
3139
- style: Rt,
3140
- title: We,
3148
+ closeLabel: y,
3149
+ style: Lt,
3150
+ title: Be,
3141
3151
  items: er,
3142
- onToolToggle: Be
3152
+ onToolToggle: Re
3143
3153
  })]
3144
- }), nr = jn.length > 0 && Be != null && /* @__PURE__ */ V("div", {
3145
- className: l("min-w-0", Qn ? "flex-1" : "max-w-full flex-[1_0_auto]", J.toolsChips),
3146
- children: /* @__PURE__ */ V(it, {
3154
+ }), nr = jn.length > 0 && Re != null && /* @__PURE__ */ H("div", {
3155
+ className: d("min-w-0", Qn ? "flex-1" : "max-w-full flex-[1_0_auto]", Y.toolsChips),
3156
+ children: /* @__PURE__ */ H(ct, {
3147
3157
  items: jn,
3148
- onToolToggle: Be,
3158
+ onToolToggle: Re,
3149
3159
  onToolDismiss: Mn,
3150
- canRemove: Ue,
3151
- removeLabel: Je?.removeLabel,
3152
- stateOnLabel: Je?.stateOnLabel,
3153
- stateOffLabel: Je?.stateOffLabel
3160
+ canRemove: ze,
3161
+ removeLabel: Ue?.removeLabel,
3162
+ stateOnLabel: Ue?.stateOnLabel,
3163
+ stateOffLabel: Ue?.stateOffLabel
3154
3164
  })
3155
- }), rr = jt ? tr : nr;
3156
- return /* @__PURE__ */ H("div", {
3165
+ }), rr = wt ? tr : nr;
3166
+ return /* @__PURE__ */ U("div", {
3157
3167
  ref: Dn,
3158
- style: Rt,
3159
- className: l(X.wrapper, Te && X.wrapperDisabled, Te && "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),
3168
+ style: Lt,
3169
+ 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
3170
  children: [
3161
- (Fe.length > 0 || un.length > 0) && /* @__PURE__ */ V(de, {
3162
- attachments: [...Fe, ...un],
3171
+ (Pe.length > 0 || un.length > 0) && /* @__PURE__ */ H(fe, {
3172
+ attachments: [...Pe, ...un],
3163
3173
  onRemove: (e) => {
3164
- Fe.some((t) => t.id === e) ? Ie?.(e) : mn(e);
3174
+ Pe.some((t) => t.id === e) ? Fe?.(e) : mn(e);
3165
3175
  },
3166
3176
  onRetry: hn,
3167
3177
  onExpand: gn,
3168
3178
  labels: {
3169
3179
  removeLabel: S,
3170
- retryLabel: T,
3171
- uploadingLabel: k,
3172
- expandLabel: A,
3180
+ retryLabel: C,
3181
+ uploadingLabel: w,
3182
+ expandLabel: D,
3173
3183
  clickLabel: j
3174
3184
  },
3175
3185
  styles: {
3176
3186
  ...te,
3177
- className: l(un.length > 6 && "-me-4", te?.className)
3187
+ className: d(un.length > 6 && "-me-4", te?.className)
3178
3188
  },
3179
- onAttachmentClick: lt == null ? void 0 : (e) => {
3180
- let t = [...Fe, ...un].find((t) => t.id === e);
3181
- t != null && lt(t);
3189
+ onAttachmentClick: X == null ? void 0 : (e) => {
3190
+ let t = [...Pe, ...un].find((t) => t.id === e);
3191
+ t != null && X(t);
3182
3192
  }
3183
3193
  }),
3184
- !_e && /* @__PURE__ */ V("input", {
3194
+ !ge && /* @__PURE__ */ H("input", {
3185
3195
  ref: En,
3186
3196
  type: "file",
3187
3197
  multiple: !0,
@@ -3191,12 +3201,12 @@ var zn = /* @__PURE__ */ Object.assign(Rn, { displayName: "List" }), Bn = {
3191
3201
  tabIndex: -1,
3192
3202
  onChange: zn
3193
3203
  }),
3194
- /* @__PURE__ */ V(E, {
3195
- politeness: O.Assertive,
3204
+ /* @__PURE__ */ H(O, {
3205
+ politeness: A.Assertive,
3196
3206
  className: "min-w-0 px-1 wrap-break-word",
3197
- children: bn && /* @__PURE__ */ V(C, { text: bn })
3207
+ children: bn && /* @__PURE__ */ H(T, { text: bn })
3198
3208
  }),
3199
- wn && /* @__PURE__ */ V(dt, {
3209
+ wn && /* @__PURE__ */ H(ht, {
3200
3210
  embedded: !0,
3201
3211
  state: vn,
3202
3212
  analyserNodeRef: yn,
@@ -3205,63 +3215,63 @@ var zn = /* @__PURE__ */ Object.assign(Rn, { displayName: "List" }), Bn = {
3205
3215
  attachButton: Zn,
3206
3216
  stopLabel: L,
3207
3217
  discardLabel: R,
3208
- processingLabel: je
3218
+ processingLabel: Ae
3209
3219
  }),
3210
- !wn && ye && Xn,
3211
- !wn && !ye && Qn && rr && /* @__PURE__ */ V("div", {
3220
+ !wn && ve && Yn,
3221
+ !wn && !ve && Qn && rr && /* @__PURE__ */ H("div", {
3212
3222
  className: "flex",
3213
3223
  children: rr
3214
3224
  }),
3215
- !wn && !ye && /* @__PURE__ */ H("div", {
3216
- className: l("flex items-center gap-2", Qn ? "flex-nowrap" : "flex-wrap", J.actionRow),
3225
+ !wn && !ve && /* @__PURE__ */ U("div", {
3226
+ className: d("flex items-center gap-2", Qn ? "flex-nowrap" : "flex-wrap", Y.actionRow),
3217
3227
  children: [
3218
3228
  Qn && $n,
3219
- /* @__PURE__ */ V("div", {
3220
- className: l("flex min-w-0 items-center self-stretch", Qn ? "flex-1" : "w-full", J.textareaWrap),
3221
- children: Xn
3229
+ /* @__PURE__ */ H("div", {
3230
+ className: d("flex min-w-0 items-center self-stretch", Qn ? "flex-1" : "w-full", Y.textareaWrap),
3231
+ children: Yn
3222
3232
  }),
3223
3233
  !Qn && $n,
3224
3234
  !Qn && rr,
3225
- /* @__PURE__ */ V("div", {
3226
- className: l("ms-auto flex shrink-0 items-center gap-2", J.footerActions),
3227
- children: we ? we({
3235
+ /* @__PURE__ */ H("div", {
3236
+ className: d("ms-auto flex shrink-0 items-center gap-2", Y.footerActions),
3237
+ children: Ce ? Ce({
3228
3238
  canSend: An,
3229
3239
  onSend: Ln
3230
- }) : /* @__PURE__ */ H(ue, { children: [
3231
- bt,
3232
- /* @__PURE__ */ V(Gn, {
3233
- deployments: fe,
3234
- selectedDeploymentId: pe,
3235
- onDeploymentChange: me,
3236
- modelSelectorLabels: he,
3240
+ }) : /* @__PURE__ */ U(V, { children: [
3241
+ vt,
3242
+ /* @__PURE__ */ H(Xn, {
3243
+ deployments: ue,
3244
+ selectedDeploymentId: de,
3245
+ onDeploymentChange: pe,
3246
+ modelSelectorLabels: me,
3237
3247
  menuStyles: ne,
3238
3248
  nameClassName: B?.modelSelectorNameClassName,
3239
3249
  versionClassName: B?.modelSelectorVersionClassName,
3240
3250
  isStreaming: s,
3241
- isMobile: wt,
3242
- isDisabled: Ee,
3243
- style: Rt,
3244
- modelPickerOverlay: ut,
3245
- isPickerOpen: Mt,
3246
- onPickerToggle: () => Pt(!Mt),
3247
- onPickerOpenChange: Pt
3251
+ isMobile: Ct,
3252
+ isDisabled: Te,
3253
+ style: Lt,
3254
+ modelPickerOverlay: st,
3255
+ isPickerOpen: Tt,
3256
+ onPickerToggle: () => Dt(!Tt),
3257
+ onPickerOpenChange: Dt
3248
3258
  }),
3249
- In && /* @__PURE__ */ V(w, {
3250
- icon: /* @__PURE__ */ V(be, {
3251
- size: v.LG,
3252
- stroke: y,
3259
+ In && /* @__PURE__ */ H(E, {
3260
+ icon: /* @__PURE__ */ H(xe, {
3261
+ size: b.LG,
3262
+ stroke: x,
3253
3263
  "aria-hidden": !0
3254
3264
  }),
3255
3265
  "aria-label": F,
3256
3266
  tooltipProps: { tooltip: F },
3257
3267
  className: "shrink-0",
3258
- onClick: () => xn(qe.Dictation),
3259
- disabled: Te || s
3268
+ onClick: () => xn(Ze.Dictation),
3269
+ disabled: we || s
3260
3270
  }),
3261
- s && o ? /* @__PURE__ */ V(pt, {
3271
+ s && o ? /* @__PURE__ */ H(_t, {
3262
3272
  onStop: o,
3263
3273
  ariaLabel: ee
3264
- }) : !s && /* @__PURE__ */ V(ft, {
3274
+ }) : !s && /* @__PURE__ */ H(gt, {
3265
3275
  onSend: Ln,
3266
3276
  isDisabled: !Fn || !An,
3267
3277
  ariaLabel: M,
@@ -3271,53 +3281,53 @@ var zn = /* @__PURE__ */ Object.assign(Rn, { displayName: "List" }), Bn = {
3271
3281
  })
3272
3282
  ]
3273
3283
  }),
3274
- /* @__PURE__ */ V(E, {
3284
+ /* @__PURE__ */ H(O, {
3275
3285
  visuallyHidden: !0,
3276
3286
  atomic: !0,
3277
- as: D.Span,
3278
- children: /* @__PURE__ */ V("span", { children: Tn.text }, Tn.revision)
3287
+ as: k.Span,
3288
+ children: /* @__PURE__ */ H("span", { children: Tn.text }, Tn.revision)
3279
3289
  })
3280
3290
  ]
3281
3291
  });
3282
3292
  });
3283
- Kn.displayName = "Input";
3284
- var qn = {
3293
+ Zn.displayName = "Input";
3294
+ var Qn = {
3285
3295
  welcome: "_welcome_1icyo_1",
3286
3296
  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 }) => {
3297
+ }, $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
3298
  let { colors: p, typography: m, attachmentTray: h, modelMenu: g } = o ?? {}, _ = c({
3289
3299
  "--ci-welcome-color": p?.welcomeText,
3290
3300
  "--ci-description-color": p?.descriptionText
3291
3301
  });
3292
- return /* @__PURE__ */ H("div", {
3302
+ return /* @__PURE__ */ U("div", {
3293
3303
  style: _,
3294
- className: l("relative flex w-full flex-col items-center gap-9 px-4 py-5 desktop:p-5", s),
3304
+ className: d("relative flex w-full flex-col items-center gap-9 px-4 py-5 desktop:p-5", s),
3295
3305
  children: [
3296
- n && /* @__PURE__ */ H("div", {
3306
+ n && /* @__PURE__ */ U("div", {
3297
3307
  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"),
3308
+ children: [/* @__PURE__ */ H("h1", {
3309
+ className: d(Qn.welcome, "m-0 max-w-full wrap-anywhere", m?.welcomeClassName || "dial-display2-text"),
3300
3310
  children: n
3301
- }), r && /* @__PURE__ */ V("p", {
3302
- className: l(qn.description, "m-0 max-w-[540px]", m?.descriptionClassName || "dial-body-paragraph-text"),
3311
+ }), r && /* @__PURE__ */ H("p", {
3312
+ className: d(Qn.description, "m-0 max-w-[540px]", m?.descriptionClassName || "dial-body-paragraph-text"),
3303
3313
  children: r
3304
3314
  })]
3305
3315
  }),
3306
- i != null && /* @__PURE__ */ V("div", {
3316
+ i != null && /* @__PURE__ */ H("div", {
3307
3317
  className: "flex w-full max-w-[700px] flex-col items-center empty:hidden",
3308
3318
  children: i
3309
3319
  }),
3310
- /* @__PURE__ */ H("div", {
3311
- className: l("relative w-full", n ? "max-w-[700px]" : "max-w-[748px]"),
3312
- children: [a != null && /* @__PURE__ */ V("div", {
3320
+ /* @__PURE__ */ U("div", {
3321
+ className: d("relative w-full", n ? "max-w-[700px]" : "max-w-[748px]"),
3322
+ children: [a != null && /* @__PURE__ */ H("div", {
3313
3323
  className: "mb-2",
3314
3324
  children: a
3315
- }), /* @__PURE__ */ V(Kn, {
3325
+ }), /* @__PURE__ */ H(Zn, {
3316
3326
  placeholder: t,
3317
3327
  isStreaming: e,
3318
- isInputDisabled: d,
3328
+ isInputDisabled: u,
3319
3329
  ...f,
3320
- className: u,
3330
+ className: l,
3321
3331
  colors: p?.input,
3322
3332
  typography: m?.input,
3323
3333
  attachmentTray: h,
@@ -3326,35 +3336,35 @@ var qn = {
3326
3336
  })
3327
3337
  ]
3328
3338
  });
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) => {
3339
+ }, 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: L, onAttachmentsLimitExceeded: R, onDialFileSystemClick: B, dialFileSystemLabel: te, pendingAttachments: ne, onPendingAttachmentsConsumed: re, onAttachmentClick: ie, pasteTextThreshold: ae, maxMessageLength: oe = 5e4, onMessageTooLong: se }) => {
3340
+ let ce = q(null), le = q(null), [ue, de] = J([]);
3341
+ G(() => {
3342
+ A?.length && (de(A), j?.());
3343
+ }, [A, j]);
3344
+ 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) => {
3345
+ ge((t) => t.filter((t) => t.id !== e));
3346
+ }, xe = W((e, t) => {
3347
+ p(e, he, t);
3348
+ }, [he, p]), Se = () => {
3349
+ ve && (V.length >= oe ? se?.(V.length, oe) : xe(V, pe));
3350
+ }, Ce = W(() => de([]), []), we = W((e) => {
3351
+ fe(e), n?.(e);
3352
+ }, [n]), Te = W((e) => {
3343
3353
  let t = Array.from(e.target.files ?? []);
3344
3354
  t.length !== 0 && (e.target.value = "", de(t));
3345
- }, []), De = G(() => B ? [{
3355
+ }, []), Ee = K(() => B ? [{
3346
3356
  key: "dial-fs",
3347
3357
  label: te ?? "DIAL file system",
3348
- icon: /* @__PURE__ */ V(ye, {
3349
- size: p,
3358
+ icon: /* @__PURE__ */ H(be, {
3359
+ size: h,
3350
3360
  "aria-hidden": !0,
3351
- stroke: y
3361
+ stroke: x
3352
3362
  }),
3353
3363
  onClick: B
3354
3364
  }] : [], [B, te]);
3355
- return /* @__PURE__ */ H("div", {
3356
- className: l("flex w-full flex-col gap-2", k),
3357
- children: [/* @__PURE__ */ V(Kn, {
3365
+ return /* @__PURE__ */ U("div", {
3366
+ className: d("flex w-full flex-col gap-2", k),
3367
+ children: [/* @__PURE__ */ H(Zn, {
3358
3368
  ref: le,
3359
3369
  message: e,
3360
3370
  messageRevision: t,
@@ -3364,37 +3374,37 @@ var qn = {
3364
3374
  commandMenu: s,
3365
3375
  ariaLabel: v,
3366
3376
  hideActionBar: !0,
3367
- sendOnEnter: u,
3377
+ sendOnEnter: l,
3368
3378
  pendingDropFiles: ue,
3369
- onDropFilesConsumed: we,
3370
- onSend: Se,
3371
- onUploadAttachment: h,
3372
- onChange: Te,
3373
- onAttachmentsChange: he,
3374
- removeLabel: b,
3375
- retryLabel: x,
3379
+ onDropFilesConsumed: Ce,
3380
+ onSend: xe,
3381
+ onUploadAttachment: m,
3382
+ onChange: we,
3383
+ onAttachmentsChange: me,
3384
+ removeLabel: y,
3385
+ retryLabel: b,
3376
3386
  uploadingLabel: S,
3377
3387
  expandLabel: C,
3378
3388
  clickLabel: w,
3379
3389
  className: "max-w-full",
3380
- prefixAttachments: ge,
3381
- onRemovePrefixAttachment: xe,
3382
- validateAttachment: N,
3390
+ prefixAttachments: he,
3391
+ onRemovePrefixAttachment: ye,
3392
+ validateAttachment: M,
3383
3393
  isAttachmentsEnabled: P,
3384
3394
  isTextAttachmentsAllowed: ee,
3385
- maximumAttachmentsAmount: R,
3386
- onAttachmentsLimitExceeded: z,
3395
+ maximumAttachmentsAmount: L,
3396
+ onAttachmentsLimitExceeded: R,
3387
3397
  pendingAttachments: ne,
3388
3398
  onPendingAttachmentsConsumed: re,
3389
3399
  onAttachmentClick: ie,
3390
3400
  pasteTextThreshold: ae,
3391
3401
  maxMessageLength: oe,
3392
3402
  onMessageTooLong: se
3393
- }), /* @__PURE__ */ H("div", {
3403
+ }), /* @__PURE__ */ U("div", {
3394
3404
  className: "flex items-center justify-between",
3395
- children: [/* @__PURE__ */ H("div", {
3405
+ children: [/* @__PURE__ */ U("div", {
3396
3406
  className: "flex",
3397
- children: [!F && /* @__PURE__ */ V("input", {
3407
+ children: [!F && /* @__PURE__ */ H("input", {
3398
3408
  ref: ce,
3399
3409
  type: "file",
3400
3410
  multiple: !0,
@@ -3402,71 +3412,71 @@ var qn = {
3402
3412
  className: "sr-only",
3403
3413
  "aria-hidden": !0,
3404
3414
  tabIndex: -1,
3405
- onChange: Ee
3406
- }), (!F || (c?.length ?? 0) > 0) && /* @__PURE__ */ V(zt, {
3415
+ onChange: Te
3416
+ }), (!F || (c?.length ?? 0) > 0) && /* @__PURE__ */ H(Ht, {
3407
3417
  onAttachClick: F ? void 0 : () => ce.current?.click(),
3408
3418
  attachLabel: E,
3409
3419
  addMenuTitle: T,
3410
3420
  menuTitle: D,
3411
3421
  menuCloseLabel: O,
3412
- extraMenuItems: De,
3422
+ extraMenuItems: Ee,
3413
3423
  menuOverlays: c,
3414
3424
  getCaretPosition: () => le.current?.getCaretPosition() ?? 0
3415
3425
  })]
3416
- }), /* @__PURE__ */ H("div", {
3426
+ }), /* @__PURE__ */ U("div", {
3417
3427
  className: "flex gap-2",
3418
- children: [/* @__PURE__ */ V(j, {
3428
+ children: [/* @__PURE__ */ H(N, {
3419
3429
  label: g,
3420
3430
  onClick: f
3421
- }), /* @__PURE__ */ V(L, {
3431
+ }), /* @__PURE__ */ H(z, {
3422
3432
  label: _,
3423
- onClick: Ce,
3424
- disabled: !be
3433
+ onClick: Se,
3434
+ disabled: !ve
3425
3435
  })]
3426
3436
  })]
3427
3437
  })]
3428
3438
  });
3429
- }, Xn = /* @__PURE__ */ function(e) {
3439
+ }, tr = /* @__PURE__ */ function(e) {
3430
3440
  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", {
3441
+ }({}), nr = { banner: "_banner_180n6_2" }, rr = {
3442
+ [tr.Warning]: I.Warning,
3443
+ [tr.Reached]: I.Error
3444
+ }, 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 }) => {
3445
+ let f = /* @__PURE__ */ H("span", {
3436
3446
  className: a,
3437
3447
  children: t
3438
- }), p = n != null && /* @__PURE__ */ H(ue, { children: [
3448
+ }), p = n != null && /* @__PURE__ */ U(V, { children: [
3439
3449
  " ",
3440
- /* @__PURE__ */ V("time", {
3450
+ /* @__PURE__ */ H("time", {
3441
3451
  dateTime: n.isoValue,
3442
3452
  "aria-hidden": n.ariaLabel != null || void 0,
3443
3453
  className: o,
3444
3454
  children: n.label
3445
3455
  }),
3446
- n.ariaLabel != null && /* @__PURE__ */ V("span", {
3456
+ n.ariaLabel != null && /* @__PURE__ */ H("span", {
3447
3457
  className: "sr-only",
3448
3458
  children: n.ariaLabel
3449
3459
  })
3450
3460
  ] });
3451
- return /* @__PURE__ */ V(N, {
3461
+ return /* @__PURE__ */ H(ee, {
3452
3462
  role: s ? "status" : "none",
3453
- variant: Qn[e],
3454
- type: P.SectionMessage,
3463
+ variant: rr[e],
3464
+ type: F.SectionMessage,
3455
3465
  title: p ? f : void 0,
3456
3466
  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(_, {
3467
+ className: d(nr.banner, Y.usageBanner, l),
3468
+ style: c({ "--ci-usage-banner-bg": u?.background }),
3469
+ children: r != null && /* @__PURE__ */ H(y, {
3460
3470
  className: "shrink-0 self-start",
3461
3471
  ariaLabel: i,
3462
3472
  onClose: () => r()
3463
3473
  })
3464
3474
  });
3465
- }, er = (e) => {
3466
- let [t, n] = q({
3475
+ }, ar = (e) => {
3476
+ let [t, n] = J({
3467
3477
  text: e?.text,
3468
3478
  revision: e?.revision ?? 0
3469
- }), r = U((e) => {
3479
+ }), r = W((e) => {
3470
3480
  n((t) => ({
3471
3481
  text: e,
3472
3482
  revision: t.revision + 1
@@ -3477,11 +3487,11 @@ var qn = {
3477
3487
  messageRevision: t.revision,
3478
3488
  seedMessage: r
3479
3489
  };
3480
- }, tr = (e, t) => {
3481
- let n = K(e), r = K(t);
3482
- r.current = t, W(() => {
3490
+ }, or = (e, t) => {
3491
+ let n = q(e), r = q(t);
3492
+ r.current = t, G(() => {
3483
3493
  e !== n.current && (n.current = e, r.current());
3484
3494
  }, [e]);
3485
3495
  };
3486
3496
  //#endregion
3487
- export { et as ActionRowLayout, Ie as BottomSheetShell, J as CONVERSATION_INPUT_CLASS, Rt 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 };
3497
+ 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 };