@epam/ai-dial-conversation-input 1.2.0-dev.225 → 1.2.0-dev.229

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,12 +1,12 @@
1
1
  import { AttachmentErrorReason as e, AttachmentType as t, DeploymentIcon as n, MIME_TYPE_EXT_MAP as r, RESIZABLE_TEXTAREA_CLASS_NAME as i, RequestStatus as a, ResponseFormat as o, SELECT_LIST_MAX_HEIGHT_PX as s, buildCssVars as c, mergeClasses as l, normalizeMimeType as u, useIsMobile as d } from "@epam/ai-dial-chat-shared";
2
- import { BASE_ICON_SIZE as f, Button as p, CloseButton as m, DIAL_ICON_SIZE as h, DIAL_KIT_ICON_STROKE as g, Dropdown as _, ElementSize as v, ErrorText as y, GhostIconButton as b, Highlight as x, MenuItemMark as S, NeutralButton as C, Popup as w, PopupSize as T, PrimaryButton as E, PrimaryIconButton as D, RadioGroup as O, RadioGroupOrientation as k, Search as A, Skeleton as ee, SkeletonVariant as j, Slider as te, Spinner as ne, StaticIconButton as re, Textarea as ie, TextareaResize as M, Tooltip as N } from "@epam/ai-dial-ui-kit";
3
- import { IconArrowLeft as ae, IconArrowNarrowRight as oe, IconCheck as P, IconChevronDown as se, IconChevronRight as ce, IconFile as le, IconMicrophone as ue, IconPaperclip as de, IconPlayerStopFilled as fe, IconPlaystationSquare as pe, IconPlus as me, IconSettings as he, IconTool as ge, IconX as _e } from "@tabler/icons-react";
4
- import { createElement as ve, forwardRef as ye, memo as be, useCallback as F, useEffect as I, useId as xe, useImperativeHandle as Se, useLayoutEffect as Ce, useMemo as L, useRef as R, useState as z } from "react";
2
+ import { BASE_ICON_SIZE as f, Button as p, ButtonVariant as m, CloseButton as h, DIAL_ICON_SIZE as g, DIAL_KIT_ICON_STROKE as _, Dropdown as v, ElementSize as y, ErrorText as b, GhostIconButton as x, Highlight as S, MenuItemMark as C, NeutralButton as w, Popup as T, PopupSize as E, PrimaryButton as D, PrimaryIconButton as O, RadioGroup as k, RadioGroupOrientation as A, Search as j, Skeleton as M, SkeletonVariant as ee, Slider as N, Spinner as te, StaticIconButton as ne, Textarea as P, TextareaResize as F, Tooltip as re } from "@epam/ai-dial-ui-kit";
3
+ import { IconArrowLeft as ie, IconArrowNarrowRight as ae, IconCheck as oe, IconChevronDown as se, IconChevronRight as ce, IconFile as le, IconMicrophone as ue, IconPaperclip as de, IconPlayerStopFilled as fe, IconPlaystationSquare as pe, IconPlus as me, IconSettings as he, IconTool as ge, IconX as _e } from "@tabler/icons-react";
4
+ import { createElement as ve, forwardRef as ye, memo as be, useCallback as I, useEffect as L, useId as xe, useImperativeHandle as Se, useLayoutEffect as Ce, useMemo as R, useRef as z, useState as B } from "react";
5
5
  import { createPortal as we } from "react-dom";
6
- import { Fragment as B, jsx as V, jsxs as H } from "react/jsx-runtime";
6
+ import { Fragment as V, jsx as H, jsxs as U } from "react/jsx-runtime";
7
7
  import { AttachmentTray as Te, MAX_UPLOADS_PER_MINUTE as Ee, generateAttachmentId as De, useClipboardPaste as Oe } from "@epam/ai-dial-attachment-input";
8
8
  //#region src/constants/public-class-names.ts
9
- var U = {
9
+ var W = {
10
10
  wrapper: "dial-ci-wrapper",
11
11
  actionRow: "dial-ci-action-row",
12
12
  textareaWrap: "dial-ci-textarea-wrap",
@@ -21,17 +21,17 @@ var U = {
21
21
  modelMenuItem: "dial-ci-model-menu-item",
22
22
  modelMenuItemSelected: "dial-ci-model-menu-item-selected"
23
23
  }, ke = "a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])", Ae = (e, t, n) => {
24
- I(() => {
24
+ L(() => {
25
25
  if (!e) return;
26
26
  let n = (e) => {
27
27
  e.key === "Escape" && t();
28
28
  };
29
29
  return window.addEventListener("keydown", n), () => window.removeEventListener("keydown", n);
30
- }, [e, t]), I(() => {
30
+ }, [e, t]), L(() => {
31
31
  if (e) return document.body.style.overflow = "hidden", () => {
32
32
  document.body.style.overflow = "";
33
33
  };
34
- }, [e]), I(() => {
34
+ }, [e]), L(() => {
35
35
  if (!e || n?.current == null) return;
36
36
  let t = n.current, r = document.activeElement instanceof HTMLElement ? document.activeElement : null;
37
37
  (t.querySelector(ke) ?? t).focus();
@@ -56,59 +56,59 @@ var U = {
56
56
  title: "_title_1d50f_18",
57
57
  divider: "_divider_1d50f_22"
58
58
  }, Me = ({ 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, children: p }) => {
59
- let _ = R(null);
60
- if (Ae(e, r, _), !e || typeof document > "u") return null;
61
- let y = c({
59
+ let m = z(null);
60
+ if (Ae(e, r, m), !e || typeof document > "u") return null;
61
+ let v = c({
62
62
  "--ci-backdrop": f?.backdrop,
63
63
  "--ci-sheet-bg": f?.sheetBg,
64
64
  "--ci-sheet-text": f?.sheetText,
65
65
  "--ci-sheet-divider": f?.divider
66
66
  });
67
- return we(/* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("div", {
67
+ return we(/* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H("div", {
68
68
  className: l(je.backdrop, "fixed inset-0 z-[55]"),
69
- style: y,
69
+ style: v,
70
70
  onPointerDown: r,
71
71
  "aria-hidden": !0
72
- }), /* @__PURE__ */ H("div", {
73
- ref: _,
72
+ }), /* @__PURE__ */ U("div", {
73
+ ref: m,
74
74
  role: "dialog",
75
75
  "aria-modal": !0,
76
76
  "aria-label": t ?? o,
77
77
  tabIndex: -1,
78
78
  style: {
79
- ...y,
79
+ ...v,
80
80
  ...s
81
81
  },
82
82
  className: l(je.sheet, "fixed inset-x-0 bottom-0 z-[60] flex max-h-[85dvh] flex-col rounded-t-lg", d),
83
- children: [t != null && /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ H("div", {
83
+ children: [t != null && /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ U("div", {
84
84
  className: "relative flex h-[60px] flex-shrink-0 items-center justify-center px-4",
85
85
  children: [
86
- i && /* @__PURE__ */ V("div", {
86
+ i && /* @__PURE__ */ H("div", {
87
87
  className: "absolute start-4",
88
- children: /* @__PURE__ */ V(b, {
89
- icon: /* @__PURE__ */ V(ae, {
90
- size: h.LG,
91
- stroke: g,
88
+ children: /* @__PURE__ */ H(x, {
89
+ icon: /* @__PURE__ */ H(ie, {
90
+ size: g.LG,
91
+ stroke: _,
92
92
  className: "rtl:scale-x-[-1]"
93
93
  }),
94
94
  "aria-label": a,
95
95
  onClick: i
96
96
  })
97
97
  }),
98
- /* @__PURE__ */ V("span", {
98
+ /* @__PURE__ */ H("span", {
99
99
  className: l(je.title, u),
100
100
  children: t
101
101
  }),
102
- /* @__PURE__ */ V("div", {
102
+ /* @__PURE__ */ H("div", {
103
103
  className: "absolute end-4 m-2",
104
- children: /* @__PURE__ */ V(m, {
104
+ children: /* @__PURE__ */ H(h, {
105
105
  ariaLabel: n,
106
106
  onClose: r,
107
- size: v.Standard
107
+ size: y.Standard
108
108
  })
109
109
  })
110
110
  ]
111
- }), /* @__PURE__ */ V("div", { className: l(je.divider, "h-px flex-shrink-0") })] }), /* @__PURE__ */ V("div", {
111
+ }), /* @__PURE__ */ H("div", { className: l(je.divider, "h-px flex-shrink-0") })] }), /* @__PURE__ */ H("div", {
112
112
  className: "overflow-y-auto",
113
113
  children: p
114
114
  })]
@@ -118,15 +118,15 @@ var U = {
118
118
  for (let t = 0; t < e.length; t++) t > 0 && await new Promise((e) => setTimeout(e, r)), i.push(n(e[t]));
119
119
  await Promise.allSettled(i);
120
120
  }, Pe = ({ initialAttachments: n, onUploadAttachment: r, onAttachmentsChange: i, validateAttachment: o, pendingDropFiles: s, onDropFilesConsumed: c, pendingAttachments: l, onPendingAttachmentsConsumed: u, onExpandPastedText: d, maximumAttachmentsAmount: f, baseAttachmentsAmount: p = 0, onAttachmentsLimitExceeded: m }) => {
121
- let [h, g] = z(n), _ = R(h);
122
- I(() => {
121
+ let [h, g] = B(n), _ = z(h);
122
+ L(() => {
123
123
  _.current = h;
124
- }, [h]), I(() => () => {
124
+ }, [h]), L(() => () => {
125
125
  _.current.forEach((e) => {
126
126
  e.previewUrl && URL.revokeObjectURL(e.previewUrl), e.playUrl && URL.revokeObjectURL(e.playUrl);
127
127
  });
128
128
  }, []);
129
- let v = F((e) => e.map((e) => {
129
+ let v = I((e) => e.map((e) => {
130
130
  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;
131
131
  return {
132
132
  id: De(),
@@ -138,26 +138,26 @@ var U = {
138
138
  previewUrl: i,
139
139
  playUrl: o
140
140
  };
141
- }), []), y = R(i);
142
- I(() => {
141
+ }), []), y = z(i);
142
+ L(() => {
143
143
  y.current = i;
144
144
  }, [i]);
145
- let b = R(!0), x = F((e) => {
145
+ let b = z(!0), x = I((e) => {
146
146
  g((t) => {
147
147
  let n = e(t);
148
148
  return n === t ? t : n;
149
149
  });
150
150
  }, []);
151
- I(() => {
151
+ L(() => {
152
152
  if (b.current) {
153
153
  b.current = !1;
154
154
  return;
155
155
  }
156
156
  y.current?.(h);
157
157
  }, [h]);
158
- let S = F((e) => {
158
+ let S = I((e) => {
159
159
  g(e);
160
- }, []), C = F(async (t) => {
160
+ }, []), C = I(async (t) => {
161
161
  if (r) {
162
162
  x((e) => e.map((e) => e.id === t.id ? {
163
163
  ...e,
@@ -180,7 +180,7 @@ var U = {
180
180
  } : e));
181
181
  }
182
182
  }
183
- }, [r, x]), w = F((e, t = !0) => {
183
+ }, [r, x]), w = I((e, t = !0) => {
184
184
  let n = new Set(_.current.map((e) => e.id)), r = e.filter((e) => !n.has(e.id));
185
185
  if (r.length !== 0) {
186
186
  if (f != null && f > 0 && Number.isFinite(f)) {
@@ -211,8 +211,8 @@ var U = {
211
211
  x,
212
212
  C,
213
213
  o
214
- ]), T = R(/* @__PURE__ */ new WeakSet());
215
- I(() => {
214
+ ]), T = z(/* @__PURE__ */ new WeakSet());
215
+ L(() => {
216
216
  if (s.length === 0) {
217
217
  T.current = /* @__PURE__ */ new WeakSet();
218
218
  return;
@@ -224,13 +224,13 @@ var U = {
224
224
  v,
225
225
  c,
226
226
  s
227
- ]), I(() => {
227
+ ]), L(() => {
228
228
  l.length !== 0 && (w(l, !1), u?.());
229
229
  }, [
230
230
  w,
231
231
  u,
232
232
  l
233
- ]), I(() => {
233
+ ]), L(() => {
234
234
  if (!o) return;
235
235
  let t = !1, n = [], r = _.current.map((r) => {
236
236
  if (r.status === a.Loading) return r;
@@ -257,7 +257,7 @@ var U = {
257
257
  x,
258
258
  C
259
259
  ]);
260
- let E = F((e) => {
260
+ let E = I((e) => {
261
261
  x((t) => {
262
262
  let n = t.find((t) => t.id === e);
263
263
  return n?.previewUrl && URL.revokeObjectURL(n.previewUrl), n?.playUrl && URL.revokeObjectURL(n.playUrl), t.filter((t) => t.id !== e);
@@ -269,11 +269,11 @@ var U = {
269
269
  addAttachments: w,
270
270
  resetAttachments: S,
271
271
  handleRemove: E,
272
- handleRetry: F((e) => {
272
+ handleRetry: I((e) => {
273
273
  let t = h.find((t) => t.id === e);
274
274
  t && C(t);
275
275
  }, [h, C]),
276
- handleExpand: F(async (e) => {
276
+ handleExpand: I(async (e) => {
277
277
  let n = h.find((t) => t.id === e);
278
278
  if (!n || n.type !== t.Pasted) return;
279
279
  let r = await n.file.text();
@@ -299,12 +299,12 @@ var U = {
299
299
  }, Le = (e, t) => e.startsWith(t) && !e.slice(t.length).includes(t), Re = "[role=\"option\"]:not([aria-disabled=\"true\"])", ze = /* @__PURE__ */ function(e) {
300
300
  return e.Next = "next", e.Previous = "previous", e;
301
301
  }({}), Be = ({ config: e, message: t }) => {
302
- let [n, r] = z(!1), [i, a] = z(null), [o, s] = z(null), c = R(null);
302
+ let [n, r] = B(!1), [i, a] = B(null), [o, s] = B(null), c = z(null);
303
303
  c.current = i;
304
304
  let l = e != null && i != null && i <= t.length ? (() => {
305
305
  let n = t.slice(i, Fe(t, i));
306
306
  return Le(n, e.triggerPrefix) ? n.slice(e.triggerPrefix.length) : "";
307
- })() : "", u = F((t, n, i) => {
307
+ })() : "", u = I((t, n, i) => {
308
308
  if (e == null || i) return;
309
309
  let { start: c, end: l } = Ie(t, n), u = t.slice(c, l);
310
310
  if (!Le(u, e.triggerPrefix)) {
@@ -317,7 +317,7 @@ var U = {
317
317
  }
318
318
  r(!1);
319
319
  }, [e, o]);
320
- I(() => {
320
+ L(() => {
321
321
  if (e == null) {
322
322
  r(!1), s(null), a(null);
323
323
  return;
@@ -327,11 +327,11 @@ var U = {
327
327
  let i = Math.min(n, t.length);
328
328
  Le(t.slice(i, Fe(t, i)), e.triggerPrefix) || (r(!1), s(null), a(null));
329
329
  }, [e, t]);
330
- let d = F(() => {
330
+ let d = I(() => {
331
331
  r(!1), s(i);
332
- }, [i]), f = F(() => {
332
+ }, [i]), f = I(() => {
333
333
  r(!1);
334
- }, []), p = F((n) => {
334
+ }, []), p = I((n) => {
335
335
  if (e == null) return;
336
336
  let { start: i, end: s } = Ie(t, n);
337
337
  if (!Le(t.slice(i, s), e.triggerPrefix)) {
@@ -343,11 +343,11 @@ var U = {
343
343
  e,
344
344
  t,
345
345
  o
346
- ]), m = xe(), h = R(null), [g, _] = z(null);
347
- I(() => {
346
+ ]), m = xe(), h = z(null), [g, _] = B(null);
347
+ L(() => {
348
348
  _(null);
349
349
  }, [n, l]);
350
- let v = F(() => Array.from(h.current?.querySelectorAll(Re) ?? []), []), y = F((e) => {
350
+ let v = I(() => Array.from(h.current?.querySelectorAll(Re) ?? []), []), y = I((e) => {
351
351
  let t = v();
352
352
  if (t.length === 0) {
353
353
  _(null);
@@ -355,7 +355,7 @@ var U = {
355
355
  }
356
356
  let n = t.findIndex((e) => e.id === g), r = t[e === "next" ? (n + 1) % t.length : (n <= 0 ? t.length : n) - 1];
357
357
  _(r.id), r.scrollIntoView?.({ block: "nearest" });
358
- }, [v, g]), b = F(() => v().find((e) => e.id === g) ?? null, [v, g]);
358
+ }, [v, g]), b = I(() => v().find((e) => e.id === g) ?? null, [v, g]);
359
359
  return {
360
360
  isMenuOpen: n,
361
361
  query: l,
@@ -371,17 +371,17 @@ var U = {
371
371
  getActiveOption: b
372
372
  };
373
373
  }, Ve = (e, t) => !e.slice(0, t).includes("\n"), He = (e, t) => !e.slice(t).includes("\n"), Ue = (e) => {
374
- let t = R(e);
374
+ let t = z(e);
375
375
  t.current = e;
376
- let n = R(-1), r = R(""), i = F((e, i, a) => {
376
+ let n = z(-1), r = z(""), i = I((e, i, a) => {
377
377
  let o = t.current;
378
378
  return !o || o.length === 0 ? null : e === "up" ? !Ve(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 || !He(i, a) ? null : n.current < o.length - 1 ? (n.current += 1, o[n.current]) : (n.current = -1, r.current);
379
- }, []), a = F(() => {
379
+ }, []), a = I(() => {
380
380
  n.current = -1, r.current = "";
381
- }, []), o = F(() => {
381
+ }, []), o = I(() => {
382
382
  n.current = -1, r.current = "";
383
383
  }, []);
384
- return L(() => ({
384
+ return R(() => ({
385
385
  navigate: i,
386
386
  notifyChange: a,
387
387
  reset: o
@@ -395,11 +395,11 @@ var U = {
395
395
  if (n <= t) return;
396
396
  let r = t;
397
397
  o.filter((e) => e.offset >= t && e.offset <= n).forEach((t) => {
398
- t.offset > r && s.push(/* @__PURE__ */ V("span", {
398
+ t.offset > r && s.push(/* @__PURE__ */ H("span", {
399
399
  "aria-hidden": !0,
400
400
  children: e.slice(r, t.offset)
401
401
  }, `text-${l++}`)), s.push(t.node), r = t.offset;
402
- }), r < n && s.push(/* @__PURE__ */ V("span", {
402
+ }), r < n && s.push(/* @__PURE__ */ H("span", {
403
403
  "aria-hidden": !0,
404
404
  children: e.slice(r, n)
405
405
  }, `text-${l++}`));
@@ -407,10 +407,10 @@ var U = {
407
407
  return a.forEach((t, n) => {
408
408
  if (u(c, t.start), t.start + t.length <= c) return;
409
409
  let a = e.slice(t.start, t.start + t.length);
410
- s.push(t.render ? /* @__PURE__ */ V("span", {
410
+ s.push(t.render ? /* @__PURE__ */ H("span", {
411
411
  className: "pointer-events-auto",
412
412
  children: t.render()
413
- }, `range-${n}`) : /* @__PURE__ */ V("span", {
413
+ }, `range-${n}`) : /* @__PURE__ */ H("span", {
414
414
  "aria-hidden": !0,
415
415
  className: t.isUnsupported ? i : r,
416
416
  children: a
@@ -433,7 +433,7 @@ var U = {
433
433
  let a = document.createRange();
434
434
  return a.setStart(r.node, r.offset), a.setEnd(i.node, i.offset), a;
435
435
  }, qe = ({ textareaRef: e, message: t, hasActiveMentions: n }) => {
436
- let r = R(null), [i, a] = z([]), o = F(() => {
436
+ let r = z(null), [i, a] = B([]), o = I(() => {
437
437
  let t = e.current, i = r.current, o = t?.selectionStart, s = t?.selectionEnd;
438
438
  if (!n || t == null || i == null || o == null || s == null || o === s) {
439
439
  a((e) => e.length === 0 ? e : []);
@@ -449,7 +449,7 @@ var U = {
449
449
  }, [n, e]);
450
450
  return Ce(() => {
451
451
  o();
452
- }, [o, t]), I(() => {
452
+ }, [o, t]), L(() => {
453
453
  if (!n) return;
454
454
  let t = e.current;
455
455
  if (t == null || typeof ResizeObserver > "u") return;
@@ -465,8 +465,8 @@ var U = {
465
465
  updateSelectionRects: o
466
466
  };
467
467
  }, Je = ({ messageProp: e, messageRevision: t }) => {
468
- let [n, r] = z(e), i = R(null);
469
- return I(() => {
468
+ let [n, r] = B(e), i = z(null);
469
+ return L(() => {
470
470
  r(e);
471
471
  }, [e, t]), {
472
472
  message: n,
@@ -477,10 +477,10 @@ var U = {
477
477
  let i = Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, "value")?.set;
478
478
  i ? i.call(e, t) : e.value = t, e.setSelectionRange(n, r), e.dispatchEvent(new Event("input", { bubbles: !0 }));
479
479
  }, Xe = (e) => e.key.toLowerCase() === "z" && (e.ctrlKey || e.metaKey) && !e.shiftKey && !e.altKey, Ze = ({ insertion: e, textareaRef: t }) => {
480
- let n = e?.revision, r = R(e?.text);
480
+ let n = e?.revision, r = z(e?.text);
481
481
  r.current = e?.text;
482
- let i = R(n), a = R(null);
483
- return I(() => {
482
+ let i = z(n), a = z(null);
483
+ return L(() => {
484
484
  if (n === i.current) return;
485
485
  i.current = n;
486
486
  let e = r.current;
@@ -510,7 +510,7 @@ var U = {
510
510
  "audio/ogg;codecs=opus",
511
511
  "audio/webm"
512
512
  ], tt = 100, nt = 100, rt = .01, it = ({ onAttachAudio: e, onTranscribeAudio: t, onTranscript: n, errorLabel: i = "Voice input failed" }) => {
513
- let [a, o] = z("idle"), [s, c] = z(null), l = R(null), d = R(null), f = R({
513
+ let [a, o] = B("idle"), [s, c] = B(null), l = z(null), d = z(null), f = z({
514
514
  onAttachAudio: e,
515
515
  onTranscribeAudio: t,
516
516
  onTranscript: n,
@@ -522,7 +522,7 @@ var U = {
522
522
  onTranscript: n,
523
523
  errorLabel: i
524
524
  };
525
- let p = F((e = "dictation") => {
525
+ let p = I((e = "dictation") => {
526
526
  if (d.current) return;
527
527
  let t = { controller: new AbortController() };
528
528
  d.current = t, c(null), o("recording");
@@ -593,10 +593,10 @@ var U = {
593
593
  x(e);
594
594
  }
595
595
  })();
596
- }, []), m = F(() => d.current?.stop?.(), []), h = F(() => {
596
+ }, []), m = I(() => d.current?.stop?.(), []), h = I(() => {
597
597
  d.current?.controller.abort(), d.current = null, c(null), o("idle");
598
598
  }, []);
599
- return I(() => () => {
599
+ return L(() => () => {
600
600
  d.current?.controller.abort(), d.current = null;
601
601
  }, []), {
602
602
  state: a,
@@ -622,7 +622,7 @@ var U = {
622
622
  "--ci-sheet-item-active": f?.itemActiveBg,
623
623
  "--ci-sheet-icon": f?.itemIcon
624
624
  });
625
- return /* @__PURE__ */ V(Me, {
625
+ return /* @__PURE__ */ H(Me, {
626
626
  isOpen: e,
627
627
  title: t,
628
628
  closeLabel: n,
@@ -631,23 +631,23 @@ var U = {
631
631
  className: o,
632
632
  titleClassName: s,
633
633
  colors: f?.shell,
634
- children: /* @__PURE__ */ V("ul", {
634
+ children: /* @__PURE__ */ H("ul", {
635
635
  role: "list",
636
636
  className: "flex flex-col",
637
637
  style: h,
638
- children: a.map(({ key: e, label: t, icon: n, iconAfter: r, onClick: i }) => /* @__PURE__ */ V("li", { children: /* @__PURE__ */ V(p, {
638
+ children: a.map(({ key: e, label: t, icon: n, iconAfter: r, onClick: i }) => /* @__PURE__ */ H("li", { children: /* @__PURE__ */ H(p, {
639
639
  type: "button",
640
640
  className: l(st.item, "w-full gap-3 px-4 py-[10px] text-start"),
641
- iconBefore: /* @__PURE__ */ V("span", {
641
+ iconBefore: /* @__PURE__ */ H("span", {
642
642
  className: st.itemIcon,
643
643
  children: n
644
644
  }),
645
- iconAfter: r ? /* @__PURE__ */ V("span", {
645
+ iconAfter: r ? /* @__PURE__ */ H("span", {
646
646
  className: "ms-auto",
647
647
  children: r
648
648
  }) : null,
649
649
  textClassName: d,
650
- label: /* @__PURE__ */ V("span", {
650
+ label: /* @__PURE__ */ H("span", {
651
651
  className: u,
652
652
  children: t
653
653
  }),
@@ -656,8 +656,8 @@ var U = {
656
656
  })
657
657
  });
658
658
  }, lt = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, isOpen: o }) => {
659
- let [s, c] = z(t), [l, u] = z(n), [d, f] = z(r), p = R(o);
660
- I(() => {
659
+ let [s, c] = B(t), [l, u] = B(n), [d, f] = B(r), p = z(o);
660
+ L(() => {
661
661
  o && !p.current && (c(t), u(n), f(r)), p.current = o;
662
662
  }, [
663
663
  o,
@@ -674,7 +674,7 @@ var U = {
674
674
  setResponseFormat: c,
675
675
  setSystemPrompt: u,
676
676
  setTemperature: f,
677
- handleSubmit: F(() => {
677
+ handleSubmit: I(() => {
678
678
  if (!m) return;
679
679
  let t = {};
680
680
  e.responseFormat && s != null && (t.responseFormat = s), e.systemPrompt && (t.systemPrompt = l), e.temperature && (t.temperature = d), i(t), a();
@@ -688,17 +688,17 @@ var U = {
688
688
  a
689
689
  ])
690
690
  };
691
- }, ut = { label: "_label_14i7c_1" }, dt = ({ 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 = [
691
+ }, ut = { label: "_label_14i7c_1" }, G = ({ 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 = [
692
692
  "Precise",
693
693
  "Neutral",
694
694
  "Creative"
695
695
  ], temperatureHint: y, labelClassName: b = "!dial-small-semi-text", colors: x }) => {
696
696
  let S = c({ "--csf-label-text": x?.labelText }), C = l(b, ut.label, "gap-1");
697
- return /* @__PURE__ */ H("div", {
697
+ return /* @__PURE__ */ U("div", {
698
698
  className: "flex flex-col gap-4 px-6 pb-3",
699
699
  style: S,
700
700
  children: [
701
- e.responseFormat && /* @__PURE__ */ V(O, {
701
+ e.responseFormat && /* @__PURE__ */ H(k, {
702
702
  id: "response-format",
703
703
  labelProps: {
704
704
  label: d,
@@ -706,7 +706,7 @@ var U = {
706
706
  caption: f
707
707
  },
708
708
  optionsClassName: "mb-2",
709
- orientation: k.Column,
709
+ orientation: A.Column,
710
710
  value: t ?? o.Markdown,
711
711
  items: [{
712
712
  value: o.Markdown,
@@ -717,18 +717,18 @@ var U = {
717
717
  }],
718
718
  onChange: (e) => a(e)
719
719
  }),
720
- e.systemPrompt && /* @__PURE__ */ V(ie, {
720
+ e.systemPrompt && /* @__PURE__ */ H(P, {
721
721
  value: n,
722
722
  placeholder: g,
723
723
  className: i,
724
- resize: M.Vertical,
724
+ resize: F.Vertical,
725
725
  labelProps: {
726
726
  className: C,
727
727
  label: h
728
728
  },
729
729
  onChange: (e) => s(e ?? "")
730
730
  }),
731
- e.temperature && /* @__PURE__ */ V(te, {
731
+ e.temperature && /* @__PURE__ */ H(N, {
732
732
  labelProps: {
733
733
  label: _,
734
734
  className: C,
@@ -744,8 +744,8 @@ var U = {
744
744
  })
745
745
  ]
746
746
  });
747
- }, W = ({ 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 }) => {
748
- let { responseFormat: w, systemPrompt: T, temperature: D, canSubmit: O, setResponseFormat: k, setSystemPrompt: A, setTemperature: ee, handleSubmit: j } = lt({
747
+ }, dt = ({ 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 }) => {
748
+ let { responseFormat: w, systemPrompt: T, temperature: E, canSubmit: O, setResponseFormat: k, setSystemPrompt: A, setTemperature: j, handleSubmit: M } = lt({
749
749
  isOpen: e,
750
750
  features: o,
751
751
  initialResponseFormat: s,
@@ -754,7 +754,7 @@ var U = {
754
754
  onSave: d,
755
755
  onClose: r
756
756
  });
757
- return /* @__PURE__ */ H(Me, {
757
+ return /* @__PURE__ */ U(Me, {
758
758
  isOpen: e,
759
759
  title: f,
760
760
  closeLabel: i,
@@ -762,14 +762,14 @@ var U = {
762
762
  onBack: t,
763
763
  backLabel: n,
764
764
  style: a,
765
- children: [/* @__PURE__ */ V(dt, {
765
+ children: [/* @__PURE__ */ H(G, {
766
766
  features: o,
767
767
  responseFormat: w,
768
768
  systemPrompt: T,
769
- temperature: D,
769
+ temperature: E,
770
770
  onResponseFormatChange: k,
771
771
  onSystemPromptChange: A,
772
- onTemperatureChange: ee,
772
+ onTemperatureChange: j,
773
773
  responseFormatLabel: p,
774
774
  responseFormatHint: m,
775
775
  responseFormatMarkdownLabel: h,
@@ -779,23 +779,23 @@ var U = {
779
779
  temperatureLabel: y,
780
780
  temperatureLabels: b,
781
781
  temperatureHint: x
782
- }), /* @__PURE__ */ V("div", {
782
+ }), /* @__PURE__ */ H("div", {
783
783
  className: l("px-6 py-4 mobile:pb-8"),
784
- children: /* @__PURE__ */ V(N, {
784
+ children: /* @__PURE__ */ H(re, {
785
785
  tooltip: C,
786
786
  hideTooltip: O || !C,
787
787
  triggerClassName: "w-full",
788
- children: /* @__PURE__ */ V(E, {
788
+ children: /* @__PURE__ */ H(D, {
789
789
  label: S,
790
- onClick: j,
790
+ onClick: M,
791
791
  disabled: !O,
792
792
  className: "w-full"
793
793
  })
794
794
  })
795
795
  })]
796
796
  });
797
- }, ft = { modal: "_modal_kl0h0_1" }, pt = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, title: o = "Chat settings", titleClassName: s = "dial-h1-text", responseFormatLabel: c, responseFormatHint: l, responseFormatMarkdownLabel: u, responseFormatPlainTextLabel: d, systemPromptLabel: f, systemPromptTooltip: p, temperatureLabel: m, temperatureLabels: h, temperatureHint: g, saveLabel: _ = "Apply changes", saveDisabledTooltip: v, backgroundClassName: y = ft.modal }) => {
798
- let { responseFormat: b, systemPrompt: x, temperature: S, canSubmit: C, setResponseFormat: D, setSystemPrompt: O, setTemperature: k, handleSubmit: A } = lt({
797
+ }, ft = { modal: "_modal_kl0h0_1" }, pt = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, title: o = "Chat settings", titleClassName: s = "dial-h1-text", responseFormatLabel: c, responseFormatHint: l, responseFormatMarkdownLabel: u, responseFormatPlainTextLabel: d, systemPromptLabel: f, systemPromptTooltip: p, temperatureLabel: h, temperatureLabels: g, temperatureHint: _, saveLabel: v = "Apply changes", saveDisabledTooltip: y, backgroundClassName: b = ft.modal }) => {
798
+ let { responseFormat: x, systemPrompt: S, temperature: C, canSubmit: w, setResponseFormat: D, setSystemPrompt: O, setTemperature: k, handleSubmit: A } = lt({
799
799
  features: e,
800
800
  initialResponseFormat: t,
801
801
  initialSystemPrompt: n,
@@ -803,30 +803,28 @@ var U = {
803
803
  onSave: i,
804
804
  onClose: a
805
805
  });
806
- return /* @__PURE__ */ V(w, {
806
+ return /* @__PURE__ */ H(T, {
807
807
  open: !0,
808
808
  header: o,
809
809
  titleClassName: s,
810
- size: T.Sm,
810
+ size: E.Sm,
811
811
  onClose: a,
812
- className: y,
813
- footer: /* @__PURE__ */ V("div", {
814
- className: "flex justify-end px-6 py-4",
815
- children: /* @__PURE__ */ V(N, {
816
- tooltip: v,
817
- hideTooltip: C || !v,
818
- children: /* @__PURE__ */ V(E, {
819
- label: _,
820
- onClick: A,
821
- disabled: !C
822
- })
823
- })
824
- }),
825
- children: /* @__PURE__ */ V(dt, {
812
+ className: b,
813
+ mainButtons: [{
814
+ label: v,
815
+ variant: m.Primary,
816
+ onClick: A,
817
+ disabled: !w,
818
+ tooltipProps: y ? {
819
+ tooltip: y,
820
+ hideTooltip: w
821
+ } : void 0
822
+ }],
823
+ children: /* @__PURE__ */ H(G, {
826
824
  features: e,
827
- responseFormat: b,
828
- systemPrompt: x,
829
- temperature: S,
825
+ responseFormat: x,
826
+ systemPrompt: S,
827
+ temperature: C,
830
828
  onResponseFormatChange: D,
831
829
  onSystemPromptChange: O,
832
830
  onTemperatureChange: k,
@@ -836,15 +834,15 @@ var U = {
836
834
  responseFormatPlainTextLabel: d,
837
835
  systemPromptLabel: f,
838
836
  systemPromptTooltip: p,
839
- temperatureLabel: m,
840
- temperatureLabels: h,
841
- temperatureHint: g
837
+ temperatureLabel: h,
838
+ temperatureLabels: g,
839
+ temperatureHint: _
842
840
  })
843
841
  });
844
842
  }, mt = {
845
843
  icon: "_icon_1fv6z_1",
846
844
  selectedIcon: "_selectedIcon_1fv6z_5"
847
- }, ht = ({ 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: m }) => /* @__PURE__ */ V(Me, {
845
+ }, ht = ({ 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: m }) => /* @__PURE__ */ H(Me, {
848
846
  isOpen: e,
849
847
  title: o,
850
848
  closeLabel: i,
@@ -852,33 +850,33 @@ var U = {
852
850
  onBack: t,
853
851
  backLabel: n,
854
852
  style: a,
855
- children: /* @__PURE__ */ V("ul", {
853
+ children: /* @__PURE__ */ H("ul", {
856
854
  role: "menu",
857
855
  className: "flex flex-col pb-4",
858
856
  style: c({
859
857
  "--tbs-icon-text": m?.iconText,
860
858
  "--tbs-selected-icon-text": m?.selectedIconText
861
859
  }),
862
- children: s.map((e) => /* @__PURE__ */ V("li", {
860
+ children: s.map((e) => /* @__PURE__ */ H("li", {
863
861
  role: "none",
864
- children: /* @__PURE__ */ V(p, {
862
+ children: /* @__PURE__ */ H(p, {
865
863
  type: "button",
866
864
  role: "menuitemcheckbox",
867
865
  "aria-checked": e.isSelected,
868
866
  className: "w-full gap-3 px-4 py-[10px] text-start",
869
- iconBefore: /* @__PURE__ */ V("span", {
867
+ iconBefore: /* @__PURE__ */ H("span", {
870
868
  className: l("flex items-center", mt.icon),
871
869
  children: e.icon
872
870
  }),
873
- iconAfter: e.isSelected ? /* @__PURE__ */ V("span", {
871
+ iconAfter: e.isSelected ? /* @__PURE__ */ H("span", {
874
872
  className: l("ms-auto", mt.selectedIcon),
875
- children: /* @__PURE__ */ V(P, {
873
+ children: /* @__PURE__ */ H(oe, {
876
874
  size: f,
877
875
  "aria-hidden": !0,
878
- stroke: g
876
+ stroke: _
879
877
  })
880
878
  }) : null,
881
- label: /* @__PURE__ */ V("span", {
879
+ label: /* @__PURE__ */ H("span", {
882
880
  className: d,
883
881
  children: e.label
884
882
  }),
@@ -889,68 +887,68 @@ var U = {
889
887
  }), gt = {
890
888
  toolIcon: "_toolIcon_ma5s5_1",
891
889
  chevronIcon: "_chevronIcon_ma5s5_5"
892
- }, _t = ({ onAttachClick: e, onRecordVoice: t, recordVoiceLabel: n = "Record voice", attachLabel: r, addMenuTitle: i, menuTitle: a, menuCloseLabel: s, style: u, listClassName: p = "w-[240px]", isDisabled: m = !1, chatSettings: y, extraMenuItems: x, toolsMenuItems: C = [], onToolToggle: w, toolsMenuTitle: T = "Tools", toolsBackLabel: E = "Back", menuOverlays: D, getCaretPosition: O, colors: k }) => {
893
- let A = d(), [ee, j] = z(!1), [te, ne] = z(!1), [re, ie] = z(!1), [M, N] = z(null), [ae, oe] = z(!1), P = L(() => c({
890
+ }, _t = ({ onAttachClick: e, onRecordVoice: t, recordVoiceLabel: n = "Record voice", attachLabel: r, addMenuTitle: i, menuTitle: a, menuCloseLabel: s, style: u, listClassName: p = "w-[240px]", isDisabled: m = !1, chatSettings: h, extraMenuItems: b, toolsMenuItems: S = [], onToolToggle: w, toolsMenuTitle: T = "Tools", toolsBackLabel: E = "Back", menuOverlays: D, getCaretPosition: O, colors: k }) => {
891
+ let A = d(), [j, M] = B(!1), [ee, N] = B(!1), [te, ne] = B(!1), [P, F] = B(null), [re, ie] = B(!1), ae = R(() => c({
894
892
  "--aab-tool-icon": k?.toolIcon,
895
893
  "--aab-chevron-icon": k?.chevronIcon
896
- }), [k?.toolIcon, k?.chevronIcon]), se = C.length > 0 && w != null, le = D != null && D.length > 0, fe = L(() => C.map((e) => ({
894
+ }), [k?.toolIcon, k?.chevronIcon]), oe = S.length > 0 && w != null, se = D != null && D.length > 0, le = R(() => S.map((e) => ({
897
895
  key: e.id,
898
896
  label: e.label,
899
- icon: /* @__PURE__ */ V("span", {
900
- style: P,
897
+ icon: /* @__PURE__ */ H("span", {
898
+ style: ae,
901
899
  className: l("flex items-center", gt.toolIcon),
902
900
  children: e.icon
903
901
  }),
904
902
  selectable: !0,
905
- mark: S.Check,
903
+ mark: C.Check,
906
904
  checked: e.isSelected,
907
905
  onClick: () => w?.(e.id)
908
906
  })), [
909
- C,
907
+ S,
910
908
  w,
911
- P
912
- ]), pe = L(() => [
909
+ ae
910
+ ]), fe = R(() => [
913
911
  ...e == null ? [] : [{
914
912
  key: "attach",
915
913
  label: r,
916
- icon: /* @__PURE__ */ V(de, {
914
+ icon: /* @__PURE__ */ H(de, {
917
915
  size: f,
918
916
  "aria-hidden": !0,
919
- stroke: g
917
+ stroke: _
920
918
  }),
921
919
  onClick: e
922
920
  }],
923
- ...x ?? [],
924
- ...se ? [{
921
+ ...b ?? [],
922
+ ...oe ? [{
925
923
  key: "tools",
926
924
  label: T,
927
- icon: /* @__PURE__ */ V(ge, {
925
+ icon: /* @__PURE__ */ H(ge, {
928
926
  size: f,
929
927
  "aria-hidden": !0,
930
- stroke: g
928
+ stroke: _
931
929
  }),
932
930
  onClick: A ? () => {
933
- ie(!0), j(!1);
931
+ ne(!0), M(!1);
934
932
  } : () => void 0,
935
- ...A ? { iconAfter: /* @__PURE__ */ V(ce, {
933
+ ...A ? { iconAfter: /* @__PURE__ */ H(ce, {
936
934
  size: f,
937
- stroke: g,
938
- style: P,
935
+ stroke: _,
936
+ style: ae,
939
937
  className: l("rtl:scale-x-[-1]", gt.chevronIcon),
940
938
  "aria-hidden": !0
941
- }) } : { children: fe }
939
+ }) } : { children: le }
942
940
  }] : [],
943
941
  ...(D ?? []).map((e) => ({
944
942
  key: e.key,
945
943
  label: e.title,
946
944
  icon: e.icon,
947
945
  onClick: A ? () => {
948
- N(e.key), j(!1);
946
+ F(e.key), M(!1);
949
947
  } : () => void 0,
950
- ...A ? { iconAfter: /* @__PURE__ */ V(ce, {
948
+ ...A ? { iconAfter: /* @__PURE__ */ H(ce, {
951
949
  size: f,
952
- stroke: g,
953
- style: P,
950
+ stroke: _,
951
+ style: ae,
954
952
  className: l("rtl:scale-x-[-1]", gt.chevronIcon),
955
953
  "aria-hidden": !0
956
954
  }) } : {
@@ -958,171 +956,171 @@ var U = {
958
956
  key: `${e.key}-panel`,
959
957
  label: ""
960
958
  }],
961
- renderSubMenu: () => e.renderOverlay(() => oe(!1), O?.() ?? 0)
959
+ renderSubMenu: () => e.renderOverlay(() => ie(!1), O?.() ?? 0)
962
960
  }
963
961
  })),
964
962
  ...t == null ? [] : [{
965
963
  key: "record-voice",
966
964
  label: n,
967
- icon: /* @__PURE__ */ V(ue, {
965
+ icon: /* @__PURE__ */ H(ue, {
968
966
  size: f,
969
967
  "aria-hidden": !0,
970
- stroke: g
968
+ stroke: _
971
969
  }),
972
970
  onClick: () => {
973
- j(!1), oe(!1), t();
971
+ M(!1), ie(!1), t();
974
972
  }
975
973
  }],
976
- ...y == null ? [] : [{
974
+ ...h == null ? [] : [{
977
975
  key: "chat-settings",
978
- label: y.menuItemLabel ?? "Chat settings",
979
- icon: /* @__PURE__ */ V(he, {
976
+ label: h.menuItemLabel ?? "Chat settings",
977
+ icon: /* @__PURE__ */ H(he, {
980
978
  size: f,
981
979
  "aria-hidden": !0,
982
- stroke: g
980
+ stroke: _
983
981
  }),
984
- iconAfter: A ? /* @__PURE__ */ V(ce, {
982
+ iconAfter: A ? /* @__PURE__ */ H(ce, {
985
983
  size: f,
986
- stroke: g,
987
- style: P,
984
+ stroke: _,
985
+ style: ae,
988
986
  className: l("rtl:scale-x-[-1]", gt.chevronIcon),
989
987
  "aria-hidden": !0
990
988
  }) : null,
991
- onClick: () => ne(!0)
989
+ onClick: () => N(!0)
992
990
  }]
993
991
  ], [
994
992
  r,
995
993
  e,
996
994
  t,
997
995
  n,
998
- y,
999
- x,
996
+ h,
997
+ b,
1000
998
  A,
1001
- se,
999
+ oe,
1002
1000
  T,
1003
- fe,
1001
+ le,
1004
1002
  D,
1005
1003
  O,
1006
- P
1004
+ ae
1007
1005
  ]);
1008
- if (pe.length === 0) return null;
1009
- let _e = /* @__PURE__ */ V(_, {
1006
+ if (fe.length === 0) return null;
1007
+ let pe = /* @__PURE__ */ H(v, {
1010
1008
  matchReferenceWidth: !1,
1011
1009
  placement: "bottom-start",
1012
1010
  listClassName: p,
1013
1011
  overlayContentClassName: "flex flex-col gap-1",
1014
- items: pe,
1015
- open: le ? ae : void 0,
1016
- onOpenChange: le ? oe : void 0,
1017
- children: /* @__PURE__ */ V(b, {
1018
- icon: /* @__PURE__ */ V(me, {
1019
- size: h.LG,
1012
+ items: fe,
1013
+ open: se ? re : void 0,
1014
+ onOpenChange: se ? ie : void 0,
1015
+ children: /* @__PURE__ */ H(x, {
1016
+ icon: /* @__PURE__ */ H(me, {
1017
+ size: g.LG,
1020
1018
  "aria-hidden": !0,
1021
- stroke: g
1019
+ stroke: _
1022
1020
  }),
1023
1021
  "aria-label": i,
1024
1022
  tooltipProps: { tooltip: i },
1025
1023
  disabled: m
1026
1024
  })
1027
1025
  });
1028
- return /* @__PURE__ */ V(B, { children: A ? /* @__PURE__ */ H(B, { children: [
1029
- /* @__PURE__ */ V(b, {
1030
- icon: /* @__PURE__ */ V(me, {
1031
- size: h.LG,
1026
+ return /* @__PURE__ */ H(V, { children: A ? /* @__PURE__ */ U(V, { children: [
1027
+ /* @__PURE__ */ H(x, {
1028
+ icon: /* @__PURE__ */ H(me, {
1029
+ size: g.LG,
1032
1030
  "aria-hidden": !0,
1033
- stroke: g
1031
+ stroke: _
1034
1032
  }),
1035
1033
  "aria-label": i,
1036
- size: v.Large,
1034
+ size: y.Large,
1037
1035
  tooltipProps: { tooltip: i },
1038
1036
  disabled: m,
1039
- onClick: () => j(!0)
1037
+ onClick: () => M(!0)
1040
1038
  }),
1041
- /* @__PURE__ */ V(ct, {
1042
- isOpen: ee,
1039
+ /* @__PURE__ */ H(ct, {
1040
+ isOpen: j,
1043
1041
  title: a,
1044
1042
  closeLabel: s,
1045
- onClose: () => j(!1),
1043
+ onClose: () => M(!1),
1046
1044
  style: u,
1047
- items: pe,
1045
+ items: fe,
1048
1046
  className: "pb-4",
1049
1047
  btnTextClassName: "flex-1"
1050
1048
  }),
1051
- se && /* @__PURE__ */ V(ht, {
1052
- isOpen: re,
1049
+ oe && /* @__PURE__ */ H(ht, {
1050
+ isOpen: te,
1053
1051
  onBack: () => {
1054
- ie(!1), j(!0);
1052
+ ne(!1), M(!0);
1055
1053
  },
1056
1054
  backLabel: E,
1057
- onClose: () => ie(!1),
1055
+ onClose: () => ne(!1),
1058
1056
  closeLabel: s,
1059
1057
  style: u,
1060
1058
  title: T,
1061
- items: C,
1059
+ items: S,
1062
1060
  onToolToggle: w
1063
1061
  }),
1064
- D?.map((e) => /* @__PURE__ */ V(Me, {
1065
- isOpen: M === e.key,
1062
+ D?.map((e) => /* @__PURE__ */ H(Me, {
1063
+ isOpen: P === e.key,
1066
1064
  title: e.title,
1067
1065
  closeLabel: s,
1068
1066
  onBack: () => {
1069
- N(null), j(!0);
1067
+ F(null), M(!0);
1070
1068
  },
1071
1069
  backLabel: e.backLabel ?? "Back",
1072
- onClose: () => N(null),
1070
+ onClose: () => F(null),
1073
1071
  style: u,
1074
- children: /* @__PURE__ */ V("div", {
1072
+ children: /* @__PURE__ */ H("div", {
1075
1073
  role: "menu",
1076
1074
  "aria-label": e.title,
1077
- children: e.renderOverlay(() => N(null), O?.() ?? 0)
1075
+ children: e.renderOverlay(() => F(null), O?.() ?? 0)
1078
1076
  })
1079
1077
  }, e.key)),
1080
- y != null && /* @__PURE__ */ V(W, {
1081
- isOpen: te,
1078
+ h != null && /* @__PURE__ */ H(dt, {
1079
+ isOpen: ee,
1082
1080
  onBack: () => {
1083
- ne(!1), j(!0);
1081
+ N(!1), M(!0);
1084
1082
  },
1085
- backLabel: y.backLabel ?? "Back",
1086
- onClose: () => ne(!1),
1083
+ backLabel: h.backLabel ?? "Back",
1084
+ onClose: () => N(!1),
1087
1085
  closeLabel: s,
1088
1086
  style: u,
1089
- features: y.features,
1090
- initialResponseFormat: y.responseFormat ?? o.Markdown,
1091
- initialSystemPrompt: y.systemPrompt,
1092
- initialTemperature: y.temperature,
1093
- onSave: y.onSave,
1094
- title: y.title,
1095
- responseFormatLabel: y.responseFormatLabel,
1096
- responseFormatHint: y.responseFormatHint,
1097
- responseFormatMarkdownLabel: y.responseFormatMarkdownLabel,
1098
- responseFormatPlainTextLabel: y.responseFormatPlainTextLabel,
1099
- systemPromptLabel: y.systemPromptLabel,
1100
- systemPromptTooltip: y.systemPromptTooltip,
1101
- temperatureLabel: y.temperatureLabel,
1102
- temperatureLabels: y.temperatureLabels,
1103
- temperatureHint: y.temperatureHint,
1104
- saveLabel: y.saveLabel,
1105
- saveDisabledTooltip: y.saveDisabledTooltip
1087
+ features: h.features,
1088
+ initialResponseFormat: h.responseFormat ?? o.Markdown,
1089
+ initialSystemPrompt: h.systemPrompt,
1090
+ initialTemperature: h.temperature,
1091
+ onSave: h.onSave,
1092
+ title: h.title,
1093
+ responseFormatLabel: h.responseFormatLabel,
1094
+ responseFormatHint: h.responseFormatHint,
1095
+ responseFormatMarkdownLabel: h.responseFormatMarkdownLabel,
1096
+ responseFormatPlainTextLabel: h.responseFormatPlainTextLabel,
1097
+ systemPromptLabel: h.systemPromptLabel,
1098
+ systemPromptTooltip: h.systemPromptTooltip,
1099
+ temperatureLabel: h.temperatureLabel,
1100
+ temperatureLabels: h.temperatureLabels,
1101
+ temperatureHint: h.temperatureHint,
1102
+ saveLabel: h.saveLabel,
1103
+ saveDisabledTooltip: h.saveDisabledTooltip
1106
1104
  })
1107
- ] }) : /* @__PURE__ */ H(B, { children: [_e, y != null && te && /* @__PURE__ */ V(pt, {
1108
- features: y.features,
1109
- initialResponseFormat: y.responseFormat ?? o.Markdown,
1110
- initialSystemPrompt: y.systemPrompt,
1111
- initialTemperature: y.temperature,
1112
- onSave: y.onSave,
1113
- onClose: () => ne(!1),
1114
- title: y.title,
1115
- responseFormatLabel: y.responseFormatLabel,
1116
- responseFormatHint: y.responseFormatHint,
1117
- responseFormatMarkdownLabel: y.responseFormatMarkdownLabel,
1118
- responseFormatPlainTextLabel: y.responseFormatPlainTextLabel,
1119
- systemPromptLabel: y.systemPromptLabel,
1120
- systemPromptTooltip: y.systemPromptTooltip,
1121
- temperatureLabel: y.temperatureLabel,
1122
- temperatureLabels: y.temperatureLabels,
1123
- temperatureHint: y.temperatureHint,
1124
- saveLabel: y.saveLabel,
1125
- saveDisabledTooltip: y.saveDisabledTooltip
1105
+ ] }) : /* @__PURE__ */ U(V, { children: [pe, h != null && ee && /* @__PURE__ */ H(pt, {
1106
+ features: h.features,
1107
+ initialResponseFormat: h.responseFormat ?? o.Markdown,
1108
+ initialSystemPrompt: h.systemPrompt,
1109
+ initialTemperature: h.temperature,
1110
+ onSave: h.onSave,
1111
+ onClose: () => N(!1),
1112
+ title: h.title,
1113
+ responseFormatLabel: h.responseFormatLabel,
1114
+ responseFormatHint: h.responseFormatHint,
1115
+ responseFormatMarkdownLabel: h.responseFormatMarkdownLabel,
1116
+ responseFormatPlainTextLabel: h.responseFormatPlainTextLabel,
1117
+ systemPromptLabel: h.systemPromptLabel,
1118
+ systemPromptTooltip: h.systemPromptTooltip,
1119
+ temperatureLabel: h.temperatureLabel,
1120
+ temperatureLabels: h.temperatureLabels,
1121
+ temperatureHint: h.temperatureHint,
1122
+ saveLabel: h.saveLabel,
1123
+ saveDisabledTooltip: h.saveDisabledTooltip
1126
1124
  })] }) });
1127
1125
  }, vt = {
1128
1126
  chip: "_chip_1lvv5_1",
@@ -1134,7 +1132,7 @@ var U = {
1134
1132
  }, yt = (e) => `Remove ${e}`, bt = ({ items: e, onToolToggle: t, onToolDismiss: n, canRemove: r = !0, removeLabel: i = yt, stateOnLabel: a, stateOffLabel: o, typography: s, colors: u }) => {
1135
1133
  if (e.length === 0) return null;
1136
1134
  let d = !!(a && o);
1137
- return /* @__PURE__ */ V("div", {
1135
+ return /* @__PURE__ */ H("div", {
1138
1136
  className: "flex flex-wrap items-center gap-2",
1139
1137
  style: c({
1140
1138
  "--ci-chip-bg": u?.chipBg,
@@ -1150,46 +1148,46 @@ var U = {
1150
1148
  "--ci-chip-close": u?.chipClose,
1151
1149
  "--ci-chip-close-hover": u?.chipCloseHover
1152
1150
  }),
1153
- children: e.map((e) => /* @__PURE__ */ H("div", {
1151
+ children: e.map((e) => /* @__PURE__ */ U("div", {
1154
1152
  className: l(vt.chip, e.isSelected && vt.chipSelected, "flex min-w-0 items-center gap-1.5 rounded-full border py-1 transition-colors", r ? "pe-1 ps-2" : "px-2"),
1155
- children: [/* @__PURE__ */ H("button", {
1153
+ children: [/* @__PURE__ */ U("button", {
1156
1154
  type: "button",
1157
1155
  onClick: () => t(e.id),
1158
1156
  "aria-pressed": e.isSelected,
1159
1157
  className: "flex min-w-0 items-center gap-1.5",
1160
1158
  children: [
1161
- /* @__PURE__ */ V("span", {
1159
+ /* @__PURE__ */ H("span", {
1162
1160
  className: l(vt.chipIcon, "shrink-0"),
1163
1161
  "aria-hidden": !0,
1164
1162
  children: e.icon
1165
1163
  }),
1166
- /* @__PURE__ */ H("span", {
1164
+ /* @__PURE__ */ U("span", {
1167
1165
  className: l(vt.chipText, s?.fontClassName || "dial-small-paragraph-text", "truncate"),
1168
- children: [e.label, d && /* @__PURE__ */ V("span", {
1166
+ children: [e.label, d && /* @__PURE__ */ H("span", {
1169
1167
  "aria-hidden": !0,
1170
1168
  children: ":"
1171
1169
  })]
1172
1170
  }),
1173
- d && /* @__PURE__ */ V("span", {
1171
+ d && /* @__PURE__ */ H("span", {
1174
1172
  className: l(vt.chipState, s?.fontClassName || "dial-small-paragraph-text", "ms-1 shrink-0 uppercase tracking-wider"),
1175
1173
  "aria-hidden": !0,
1176
1174
  children: e.isSelected ? a : o
1177
1175
  })
1178
1176
  ]
1179
- }), r && /* @__PURE__ */ V("button", {
1177
+ }), r && /* @__PURE__ */ H("button", {
1180
1178
  type: "button",
1181
1179
  onClick: () => n(e.id),
1182
1180
  "aria-label": i(e.label),
1183
1181
  className: l(vt.chipClose, "flex shrink-0 items-center rounded p-0.5 transition-colors"),
1184
- children: /* @__PURE__ */ V(_e, {
1182
+ children: /* @__PURE__ */ H(_e, {
1185
1183
  size: 12,
1186
1184
  "aria-hidden": !0,
1187
- stroke: g
1185
+ stroke: _
1188
1186
  })
1189
1187
  })]
1190
1188
  }, e.id))
1191
1189
  });
1192
- }, G = {
1190
+ }, K = {
1193
1191
  wrapper: "_wrapper_19a9k_2",
1194
1192
  wrapperDisabled: "_wrapperDisabled_19a9k_9",
1195
1193
  textarea: "_textarea_19a9k_13",
@@ -1208,13 +1206,13 @@ var U = {
1208
1206
  recordingDot: "_recordingDot_129ri_19",
1209
1207
  "recording-pulse": "_recording-pulse_129ri_1"
1210
1208
  }, St = 3, Ct = 4, wt = 200, Tt = ({ state: e, analyserNodeRef: t, errorMessage: n, onStop: r, onDiscard: i, attachButton: a, stopLabel: o = "Stop recording", discardLabel: s = "Discard recording", processingLabel: c = "Transcribing audio…", style: u, className: d, embedded: f = !1 }) => {
1211
- let p = R(null), m = R(new Float32Array(wt)), _ = R(0), v = R(0), x = e === Qe.Recording, S = e === Qe.Error, C = e === Qe.Processing, w = F((e) => {
1209
+ let p = z(null), m = z(new Float32Array(wt)), h = z(0), v = z(0), y = e === Qe.Recording, S = e === Qe.Error, C = e === Qe.Processing, w = I((e) => {
1212
1210
  let t = e.getContext("2d");
1213
1211
  if (!t) return;
1214
1212
  e.width = e.clientWidth || 200, e.height = e.clientHeight || 32;
1215
1213
  let { width: n, height: r } = e;
1216
1214
  t.clearRect(0, 0, n, r), t.fillStyle = getComputedStyle(e).color;
1217
- let i = Math.min(Math.max(1, Math.floor(n / Ct)), wt - 1), a = _.current, o = v.current;
1215
+ let i = Math.min(Math.max(1, Math.floor(n / Ct)), wt - 1), a = h.current, o = v.current;
1218
1216
  t.save(), t.beginPath(), t.rect(0, 0, n, r), t.clip(), t.translate(-o, 0);
1219
1217
  for (let e = 0; e <= i; e++) {
1220
1218
  let n = ((a - i + e) % wt + wt) % wt, o = m.current[n] ?? 0, s = Math.min(1, o * 6), c = Math.max(3, s * r);
@@ -1222,11 +1220,11 @@ var U = {
1222
1220
  }
1223
1221
  t.restore();
1224
1222
  }, []);
1225
- I(() => {
1226
- if (!x) return;
1223
+ L(() => {
1224
+ if (!y) return;
1227
1225
  let e = p.current;
1228
1226
  if (!e) return;
1229
- m.current.fill(0), _.current = 0, v.current = 0;
1227
+ m.current.fill(0), h.current = 0, v.current = 0;
1230
1228
  let n, r = () => {
1231
1229
  if (v.current += 1, v.current >= Ct) {
1232
1230
  v.current -= Ct;
@@ -1239,7 +1237,7 @@ var U = {
1239
1237
  let r = (t[e] - 128) / 128;
1240
1238
  n += r * r;
1241
1239
  }
1242
- m.current[_.current % wt] = Math.sqrt(n / t.length), _.current++;
1240
+ m.current[h.current % wt] = Math.sqrt(n / t.length), h.current++;
1243
1241
  }
1244
1242
  }
1245
1243
  w(e), n = requestAnimationFrame(r);
@@ -1248,10 +1246,10 @@ var U = {
1248
1246
  cancelAnimationFrame(n);
1249
1247
  };
1250
1248
  }, [
1251
- x,
1249
+ y,
1252
1250
  t,
1253
1251
  w
1254
- ]), I(() => {
1252
+ ]), L(() => {
1255
1253
  let e = p.current;
1256
1254
  if (!e) return;
1257
1255
  let t = new ResizeObserver(() => {
@@ -1259,22 +1257,22 @@ var U = {
1259
1257
  });
1260
1258
  return t.observe(e), () => t.disconnect();
1261
1259
  }, [w]);
1262
- let T = /* @__PURE__ */ H("div", {
1260
+ let T = /* @__PURE__ */ U("div", {
1263
1261
  className: "flex flex-shrink-0 items-center justify-end gap-1",
1264
1262
  children: [
1265
- /* @__PURE__ */ V(b, {
1266
- icon: /* @__PURE__ */ V(_e, {
1267
- size: h.LG,
1263
+ /* @__PURE__ */ H(x, {
1264
+ icon: /* @__PURE__ */ H(_e, {
1265
+ size: g.LG,
1268
1266
  "aria-hidden": !0,
1269
- stroke: g
1267
+ stroke: _
1270
1268
  }),
1271
1269
  "aria-label": s,
1272
1270
  className: "mobile:min-h-11 mobile:min-w-11",
1273
1271
  onClick: i
1274
1272
  }),
1275
- x && /* @__PURE__ */ V(D, {
1276
- icon: /* @__PURE__ */ V(fe, {
1277
- size: h.LG,
1273
+ y && /* @__PURE__ */ H(O, {
1274
+ icon: /* @__PURE__ */ H(fe, {
1275
+ size: g.LG,
1278
1276
  "aria-hidden": !0
1279
1277
  }),
1280
1278
  onClick: () => r?.(),
@@ -1282,93 +1280,93 @@ var U = {
1282
1280
  "aria-label": o,
1283
1281
  className: "mobile:min-h-11 mobile:min-w-11"
1284
1282
  }),
1285
- C && /* @__PURE__ */ V("span", {
1283
+ C && /* @__PURE__ */ H("span", {
1286
1284
  className: "flex size-[40px] flex-shrink-0 items-center justify-center mobile:min-h-11 mobile:min-w-11",
1287
- children: /* @__PURE__ */ V(ne, {
1285
+ children: /* @__PURE__ */ H(te, {
1288
1286
  size: 20,
1289
1287
  ariaLabel: c
1290
1288
  })
1291
1289
  })
1292
1290
  ]
1293
1291
  });
1294
- return /* @__PURE__ */ H("div", {
1292
+ return /* @__PURE__ */ U("div", {
1295
1293
  className: d,
1296
- children: [/* @__PURE__ */ H("div", {
1294
+ children: [/* @__PURE__ */ U("div", {
1297
1295
  style: u,
1298
- className: l("flex w-full min-w-0 flex-col justify-center gap-2", !f && G.wrapper, !f && "min-h-[64px] max-w-[748px] rounded-xl border px-3 shadow-md", S && xt.wrapperError),
1299
- children: [/* @__PURE__ */ H("div", {
1296
+ className: l("flex w-full min-w-0 flex-col justify-center gap-2", !f && K.wrapper, !f && "min-h-[64px] max-w-[748px] rounded-xl border px-3 shadow-md", S && xt.wrapperError),
1297
+ children: [/* @__PURE__ */ U("div", {
1300
1298
  className: "flex min-w-0 flex-1 items-center gap-3",
1301
- children: [x && /* @__PURE__ */ V("span", {
1299
+ children: [y && /* @__PURE__ */ H("span", {
1302
1300
  className: l(xt.recordingDot, "pointer-events-none block size-[8px] rounded-3xl"),
1303
1301
  "aria-hidden": !0
1304
- }), /* @__PURE__ */ V("canvas", {
1302
+ }), /* @__PURE__ */ H("canvas", {
1305
1303
  ref: p,
1306
1304
  height: 26,
1307
1305
  "aria-hidden": !0,
1308
1306
  className: l(xt.waveformCanvas, "h-[26px] min-w-0 flex-1")
1309
1307
  })]
1310
- }), /* @__PURE__ */ H("div", {
1308
+ }), /* @__PURE__ */ U("div", {
1311
1309
  className: "flex items-center justify-between gap-2",
1312
- children: [a ?? /* @__PURE__ */ V("span", { "aria-hidden": !0 }), T]
1310
+ children: [a ?? /* @__PURE__ */ H("span", { "aria-hidden": !0 }), T]
1313
1311
  })]
1314
- }), S && n && /* @__PURE__ */ V("div", {
1312
+ }), S && n && /* @__PURE__ */ H("div", {
1315
1313
  role: "alert",
1316
- children: /* @__PURE__ */ V(y, {
1314
+ children: /* @__PURE__ */ H(b, {
1317
1315
  text: n,
1318
1316
  className: "mt-1 px-1"
1319
1317
  })
1320
1318
  })]
1321
1319
  });
1322
- }, Et = ({ onSend: e, isDisabled: t = !1, ariaLabel: n = "Send message", sendTooltip: r }) => /* @__PURE__ */ V(D, {
1320
+ }, Et = ({ onSend: e, isDisabled: t = !1, ariaLabel: n = "Send message", sendTooltip: r }) => /* @__PURE__ */ H(O, {
1323
1321
  "aria-label": n,
1324
1322
  onClick: () => e?.(),
1325
1323
  disabled: t,
1326
1324
  tooltipProps: r ? { tooltip: r } : void 0,
1327
- icon: /* @__PURE__ */ V(oe, {
1328
- size: h.LG,
1325
+ icon: /* @__PURE__ */ H(ae, {
1326
+ size: g.LG,
1329
1327
  className: "rtl:scale-x-[-1]",
1330
- stroke: g
1328
+ stroke: _
1331
1329
  })
1332
- }), Dt = ({ onStop: e, ariaLabel: t = "Stop streaming" }) => /* @__PURE__ */ V(re, {
1333
- icon: /* @__PURE__ */ V(pe, {
1334
- size: h.LG,
1335
- stroke: g
1330
+ }), Dt = ({ onStop: e, ariaLabel: t = "Stop streaming" }) => /* @__PURE__ */ H(ne, {
1331
+ icon: /* @__PURE__ */ H(pe, {
1332
+ size: g.LG,
1333
+ stroke: _
1336
1334
  }),
1337
1335
  onClick: () => e?.(),
1338
1336
  "aria-label": t
1339
- }), Ot = ({ size: e = 20 }) => /* @__PURE__ */ V(ee, {
1340
- variant: j.Circular,
1337
+ }), Ot = ({ size: e = 20 }) => /* @__PURE__ */ H(M, {
1338
+ variant: ee.Circular,
1341
1339
  width: e,
1342
1340
  height: e,
1343
1341
  active: !0
1344
- }), kt = ({ loadingLabel: e }) => /* @__PURE__ */ H("span", {
1342
+ }), kt = ({ loadingLabel: e }) => /* @__PURE__ */ U("span", {
1345
1343
  className: "flex min-w-0 flex-1 items-center",
1346
- children: [/* @__PURE__ */ V(ee, {
1347
- variant: j.Text,
1344
+ children: [/* @__PURE__ */ H(M, {
1345
+ variant: ee.Text,
1348
1346
  width: "100%",
1349
1347
  height: 16,
1350
1348
  active: !0
1351
- }), e && /* @__PURE__ */ V("span", {
1349
+ }), e && /* @__PURE__ */ H("span", {
1352
1350
  className: "sr-only",
1353
1351
  children: e
1354
1352
  })]
1355
- }), At = ({ loadingLabel: e }) => /* @__PURE__ */ V("div", {
1353
+ }), At = ({ loadingLabel: e }) => /* @__PURE__ */ H("div", {
1356
1354
  role: "status",
1357
1355
  "aria-label": e,
1358
- children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */ H("div", {
1356
+ children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */ U("div", {
1359
1357
  className: "flex h-11 items-center gap-3 px-4",
1360
1358
  "aria-hidden": "true",
1361
- children: [/* @__PURE__ */ V(Ot, {}), /* @__PURE__ */ V(kt, {})]
1359
+ children: [/* @__PURE__ */ H(Ot, {}), /* @__PURE__ */ H(kt, {})]
1362
1360
  }, t))
1363
1361
  }), jt = (e) => e.displayName ?? e.id, Mt = (e, t) => {
1364
1362
  let n = t.trim().toLowerCase();
1365
1363
  return n ? e.filter((e) => jt(e).toLowerCase().includes(n)) : e;
1366
- }, Nt = (e, t, r, i = 18, a) => /* @__PURE__ */ V(n, {
1364
+ }, q = (e, t, r, i = 18, a) => /* @__PURE__ */ H(n, {
1367
1365
  src: e,
1368
1366
  size: i,
1369
1367
  labels: { tooltip: a },
1370
1368
  initialsName: r
1371
- }), K = {
1369
+ }), Nt = {
1372
1370
  searchHeader: "_searchHeader_1u7db_1",
1373
1371
  itemText: "_itemText_1u7db_13",
1374
1372
  itemHover: "_itemHover_1u7db_17",
@@ -1376,16 +1374,16 @@ var U = {
1376
1374
  selectedItemText: "_selectedItemText_1u7db_26",
1377
1375
  checkIcon: "_checkIcon_1u7db_30"
1378
1376
  }, Pt = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, styles: i }) => {
1379
- let [a, o] = z(""), s = L(() => e?.find((e) => e.id === t), [e, t]), u = r?.loading !== void 0, d = !u && !s && !!t, f = L(() => u ? /* @__PURE__ */ V(Ot, { size: h.LG }) : Nt(s?.iconUrl, s?.type, s?.displayName ?? s?.id ?? "", h.LG, d ? r?.unavailableTooltip ?? "This deployment is no longer available" : void 0), [
1377
+ let [a, o] = B(""), s = R(() => e?.find((e) => e.id === t), [e, t]), u = r?.loading !== void 0, d = !u && !s && !!t, f = R(() => u ? /* @__PURE__ */ H(Ot, { size: g.LG }) : q(s?.iconUrl, s?.type, s?.displayName ?? s?.id ?? "", g.LG, d ? r?.unavailableTooltip ?? "This deployment is no longer available" : void 0), [
1380
1378
  u,
1381
1379
  s,
1382
1380
  d,
1383
1381
  r?.unavailableTooltip
1384
- ]), p = s?.displayName ?? s?.id, m = s?.displayVersion, g = p ? `${r?.ariaLabel ?? "Select model"}: ${p}` : r?.ariaLabel ?? "Select model", _ = L(() => {
1382
+ ]), p = s?.displayName ?? s?.id, m = s?.displayVersion, h = p ? `${r?.ariaLabel ?? "Select model"}: ${p}` : r?.ariaLabel ?? "Select model", _ = R(() => {
1385
1383
  if (u) return Array.from({ length: 7 }, (e, t) => ({
1386
1384
  key: `__loading-${t}`,
1387
- icon: /* @__PURE__ */ V(Ot, {}),
1388
- label: /* @__PURE__ */ V(kt, { loadingLabel: t === 0 ? r?.loading : void 0 }),
1385
+ icon: /* @__PURE__ */ H(Ot, {}),
1386
+ label: /* @__PURE__ */ H(kt, { loadingLabel: t === 0 ? r?.loading : void 0 }),
1389
1387
  disabled: !0
1390
1388
  }));
1391
1389
  if (!e || e.length === 0) {
@@ -1401,15 +1399,15 @@ var U = {
1401
1399
  let r = e.id === t;
1402
1400
  return {
1403
1401
  key: e.id,
1404
- label: /* @__PURE__ */ V(x, {
1402
+ label: /* @__PURE__ */ H(S, {
1405
1403
  text: jt(e),
1406
1404
  query: a,
1407
1405
  maxLines: 1
1408
1406
  }),
1409
- icon: Nt(e.iconUrl, e.type, e.displayName ?? e.id),
1410
- mark: S.Check,
1407
+ icon: q(e.iconUrl, e.type, e.displayName ?? e.id),
1408
+ mark: C.Check,
1411
1409
  checked: r,
1412
- className: l(o?.itemText && K.itemText, o?.itemHoverBackground && K.itemHover, r && o?.selectedItemBackground && K.selectedItemBackground, r && o?.selectedItemText && K.selectedItemText, r && o?.checkIcon && K.checkIcon, i?.itemClassName, r && i?.selectedItemClassName, U.modelMenuItem, r && U.modelMenuItemSelected),
1410
+ className: l(o?.itemText && Nt.itemText, o?.itemHoverBackground && Nt.itemHover, r && o?.selectedItemBackground && Nt.selectedItemBackground, r && o?.selectedItemText && Nt.selectedItemText, r && o?.checkIcon && Nt.checkIcon, i?.itemClassName, r && i?.selectedItemClassName, W.modelMenuItem, r && W.modelMenuItemSelected),
1413
1411
  onClick: () => n?.(e.id)
1414
1412
  };
1415
1413
  });
@@ -1423,7 +1421,7 @@ var U = {
1423
1421
  i?.itemClassName,
1424
1422
  i?.selectedItemClassName,
1425
1423
  i?.colors
1426
- ]), y = L(() => c({
1424
+ ]), v = R(() => c({
1427
1425
  "--ms-item-text": i?.colors?.itemText,
1428
1426
  "--ms-item-hover-bg": i?.colors?.itemHoverBackground,
1429
1427
  "--ms-selected-item-bg": i?.colors?.selectedItemBackground,
@@ -1432,17 +1430,17 @@ var U = {
1432
1430
  }), [i?.colors]);
1433
1431
  return {
1434
1432
  selectorIcon: f,
1435
- selectorAriaLabel: g,
1433
+ selectorAriaLabel: h,
1436
1434
  selectedLabel: p,
1437
1435
  selectedVersion: m,
1438
1436
  menuItems: _,
1439
- menuHeader: L(() => !u && e && e.length > 0 ? /* @__PURE__ */ V("div", {
1437
+ menuHeader: R(() => !u && e && e.length > 0 ? /* @__PURE__ */ H("div", {
1440
1438
  style: c({ "--ms-search-header-bg": i?.colors?.searchHeaderBackground }),
1441
- className: l("sticky top-0 z-10 pb-1 pe-2 pt-2", K.searchHeader, i?.searchHeaderClassName, U.modelMenuSearch),
1442
- children: /* @__PURE__ */ V(A, {
1439
+ className: l("sticky top-0 z-10 pb-1 pe-2 pt-2", Nt.searchHeader, i?.searchHeaderClassName, W.modelMenuSearch),
1440
+ children: /* @__PURE__ */ H(j, {
1443
1441
  value: a,
1444
1442
  placeholder: r?.searchPlaceholder ?? "Search",
1445
- size: v.Small,
1443
+ size: y.Small,
1446
1444
  wrapperClassName: "border-0",
1447
1445
  onChange: (e) => o(e ?? "")
1448
1446
  })
@@ -1454,12 +1452,12 @@ var U = {
1454
1452
  i?.searchHeaderClassName,
1455
1453
  i?.colors?.searchHeaderBackground
1456
1454
  ]),
1457
- menuStyle: y,
1455
+ menuStyle: v,
1458
1456
  onOpenChange: (e) => {
1459
1457
  e || o("");
1460
1458
  }
1461
1459
  };
1462
- }, Ft = typeof window < "u" ? Ce : I;
1460
+ }, Ft = typeof window < "u" ? Ce : L;
1463
1461
  function It(e) {
1464
1462
  if (e !== void 0) switch (typeof e) {
1465
1463
  case "number": return e;
@@ -1468,11 +1466,11 @@ function It(e) {
1468
1466
  break;
1469
1467
  }
1470
1468
  }
1471
- function Lt({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
1472
- let { styleHeight: s, styleWidth: c } = L(() => ({
1469
+ function J({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
1470
+ let { styleHeight: s, styleWidth: c } = R(() => ({
1473
1471
  styleHeight: It(o?.height),
1474
1472
  styleWidth: It(o?.width)
1475
- }), [o?.height, o?.width]), [l, u] = z({
1473
+ }), [o?.height, o?.width]), [l, u] = B({
1476
1474
  height: t,
1477
1475
  width: n
1478
1476
  }), d = r || a === "only-height" && s !== void 0 || a === "only-width" && c !== void 0 || s !== void 0 && c !== void 0;
@@ -1496,7 +1494,7 @@ function Lt({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
1496
1494
  i,
1497
1495
  s,
1498
1496
  c
1499
- ]), L(() => ({
1497
+ ]), R(() => ({
1500
1498
  height: s ?? l.height,
1501
1499
  width: c ?? l.width
1502
1500
  }), [
@@ -1505,26 +1503,26 @@ function Lt({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
1505
1503
  c
1506
1504
  ]);
1507
1505
  }
1508
- function q(e) {
1509
- let t = R(() => {
1506
+ function Y(e) {
1507
+ let t = z(() => {
1510
1508
  throw Error("Cannot call during render.");
1511
1509
  });
1512
1510
  return Ft(() => {
1513
1511
  t.current = e;
1514
- }, [e]), F((e) => t.current?.(e), [t]);
1512
+ }, [e]), I((e) => t.current?.(e), [t]);
1515
1513
  }
1516
- var J = null;
1517
- function Y(e = !1) {
1518
- if (J === null || e) {
1514
+ var X = null;
1515
+ function Lt(e = !1) {
1516
+ if (X === null || e) {
1519
1517
  let e = document.createElement("div"), t = e.style;
1520
1518
  t.width = "50px", t.height = "50px", t.overflow = "scroll", t.direction = "rtl";
1521
1519
  let n = document.createElement("div"), r = n.style;
1522
- return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ? J = "positive-descending" : (e.scrollLeft = 1, J = e.scrollLeft === 0 ? "negative" : "positive-ascending"), document.body.removeChild(e), J;
1520
+ return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ? X = "positive-descending" : (e.scrollLeft = 1, X = e.scrollLeft === 0 ? "negative" : "positive-ascending"), document.body.removeChild(e), X;
1523
1521
  }
1524
- return J;
1522
+ return X;
1525
1523
  }
1526
1524
  function Rt({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
1527
- if (t === "horizontal" && n) switch (Y()) {
1525
+ if (t === "horizontal" && n) switch (Lt()) {
1528
1526
  case "negative": return -r;
1529
1527
  case "positive-descending":
1530
1528
  if (e) {
@@ -1535,26 +1533,26 @@ function Rt({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
1535
1533
  }
1536
1534
  return r;
1537
1535
  }
1538
- function X(e, t = "Assertion error") {
1536
+ function Z(e, t = "Assertion error") {
1539
1537
  if (!e) throw console.error(t), Error(t);
1540
1538
  }
1541
- function zt(e, t) {
1539
+ function Q(e, t) {
1542
1540
  if (e === t) return !0;
1543
- if (!!e != !!t || (X(e !== void 0), X(t !== void 0), Object.keys(e).length !== Object.keys(t).length)) return !1;
1541
+ if (!!e != !!t || (Z(e !== void 0), Z(t !== void 0), Object.keys(e).length !== Object.keys(t).length)) return !1;
1544
1542
  for (let n in e) if (!Object.is(t[n], e[n])) return !1;
1545
1543
  return !0;
1546
1544
  }
1547
- function Z({ cachedBounds: e, itemCount: t, itemSize: n }) {
1545
+ function zt({ cachedBounds: e, itemCount: t, itemSize: n }) {
1548
1546
  if (t === 0) return 0;
1549
1547
  if (typeof n == "number") return t * n;
1550
1548
  {
1551
1549
  let n = e.get(e.size === 0 ? 0 : e.size - 1);
1552
- return X(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
1550
+ return Z(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
1553
1551
  }
1554
1552
  }
1555
1553
  function Bt({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, containerScrollOffset: a, containerSize: o }) {
1556
1554
  if (n < 0 || n >= r) throw RangeError(`Invalid index specified: ${n}`, { cause: `Index ${n} is not within the range of 0 - ${r - 1}` });
1557
- let s = Z({
1555
+ let s = zt({
1558
1556
  cachedBounds: t,
1559
1557
  itemCount: r,
1560
1558
  itemSize: i
@@ -1589,7 +1587,7 @@ function Ht({ itemCount: e, itemProps: t, itemSize: n }) {
1589
1587
  let r = /* @__PURE__ */ new Map();
1590
1588
  return {
1591
1589
  get(i) {
1592
- for (X(i < e, `Invalid index ${i}`); r.size - 1 < i;) {
1590
+ for (Z(i < e, `Invalid index ${i}`); r.size - 1 < i;) {
1593
1591
  let e = r.size, a;
1594
1592
  switch (typeof n) {
1595
1593
  case "function":
@@ -1605,14 +1603,14 @@ function Ht({ itemCount: e, itemProps: t, itemSize: n }) {
1605
1603
  });
1606
1604
  else {
1607
1605
  let t = r.get(e - 1);
1608
- X(t !== void 0, `Unexpected bounds cache miss for index ${i}`), r.set(e, {
1606
+ Z(t !== void 0, `Unexpected bounds cache miss for index ${i}`), r.set(e, {
1609
1607
  scrollOffset: t.scrollOffset + t.size,
1610
1608
  size: a
1611
1609
  });
1612
1610
  }
1613
1611
  }
1614
1612
  let a = r.get(i);
1615
- return X(a !== void 0, `Unexpected bounds cache miss for index ${i}`), a;
1613
+ return Z(a !== void 0, `Unexpected bounds cache miss for index ${i}`), a;
1616
1614
  },
1617
1615
  set(e, t) {
1618
1616
  r.set(e, t);
@@ -1623,7 +1621,7 @@ function Ht({ itemCount: e, itemProps: t, itemSize: n }) {
1623
1621
  };
1624
1622
  }
1625
1623
  function Ut({ itemCount: e, itemProps: t, itemSize: n }) {
1626
- return L(() => Ht({
1624
+ return R(() => Ht({
1627
1625
  itemCount: e,
1628
1626
  itemProps: t,
1629
1627
  itemSize: n
@@ -1637,7 +1635,7 @@ function Wt({ containerSize: e, itemSize: t }) {
1637
1635
  let n;
1638
1636
  switch (typeof t) {
1639
1637
  case "string":
1640
- X(t.endsWith("%"), `Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`), X(e !== void 0, "Container size must be defined if a percentage item size is specified"), n = e * parseInt(t) / 100;
1638
+ Z(t.endsWith("%"), `Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`), Z(e !== void 0, "Container size must be defined if a percentage item size is specified"), n = e * parseInt(t) / 100;
1641
1639
  break;
1642
1640
  default:
1643
1641
  n = t;
@@ -1646,13 +1644,13 @@ function Wt({ containerSize: e, itemSize: t }) {
1646
1644
  return n;
1647
1645
  }
1648
1646
  function Gt({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0, direction: r, isRtl: i = !1, itemCount: a, itemProps: o, itemSize: s, onResize: c, overscanCount: l }) {
1649
- let { height: u = n, width: d = n } = Lt({
1647
+ let { height: u = n, width: d = n } = J({
1650
1648
  defaultHeight: r === "vertical" ? n : void 0,
1651
1649
  defaultWidth: r === "horizontal" ? n : void 0,
1652
1650
  element: e,
1653
1651
  mode: r === "vertical" ? "only-height" : "only-width",
1654
1652
  style: t
1655
- }), f = R({
1653
+ }), f = z({
1656
1654
  height: 0,
1657
1655
  width: 0
1658
1656
  }), p = r === "vertical" ? u : d, m = Wt({
@@ -1676,7 +1674,7 @@ function Gt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1676
1674
  itemCount: a,
1677
1675
  itemProps: o,
1678
1676
  itemSize: m
1679
- }), g = F((e) => h.get(e), [h]), [_, v] = z(() => Vt({
1677
+ }), g = I((e) => h.get(e), [h]), [_, v] = B(() => Vt({
1680
1678
  cachedBounds: h,
1681
1679
  containerScrollOffset: 0,
1682
1680
  containerSize: p,
@@ -1687,7 +1685,7 @@ function Gt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1687
1685
  startIndexOverscan: Math.min(a - 1, _.startIndexOverscan),
1688
1686
  stopIndexVisible: Math.min(a - 1, _.stopIndexVisible),
1689
1687
  stopIndexOverscan: Math.min(a - 1, _.stopIndexOverscan)
1690
- }, C = F(() => Z({
1688
+ }, C = I(() => zt({
1691
1689
  cachedBounds: h,
1692
1690
  itemCount: a,
1693
1691
  itemSize: m
@@ -1695,7 +1693,7 @@ function Gt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1695
1693
  h,
1696
1694
  a,
1697
1695
  m
1698
- ]), w = F((t) => Vt({
1696
+ ]), w = I((t) => Vt({
1699
1697
  cachedBounds: h,
1700
1698
  containerScrollOffset: Rt({
1701
1699
  containerElement: e,
@@ -1737,7 +1735,7 @@ function Gt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1737
1735
  itemCount: a,
1738
1736
  overscanCount: l
1739
1737
  });
1740
- return zt(s, t) ? t : s;
1738
+ return Q(s, t) ? t : s;
1741
1739
  });
1742
1740
  };
1743
1741
  return e.addEventListener("scroll", t), () => {
@@ -1753,7 +1751,7 @@ function Gt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1753
1751
  ]), {
1754
1752
  getCellBounds: g,
1755
1753
  getEstimatedSize: C,
1756
- scrollToIndex: q(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
1754
+ scrollToIndex: Y(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
1757
1755
  let s = Bt({
1758
1756
  align: t,
1759
1757
  cachedBounds: h,
@@ -1771,7 +1769,7 @@ function Gt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1771
1769
  scrollOffset: s
1772
1770
  }), typeof e.scrollTo != "function") {
1773
1771
  let e = w(s);
1774
- zt(_, e) || v(e);
1772
+ Q(_, e) || v(e);
1775
1773
  }
1776
1774
  return s;
1777
1775
  }
@@ -1783,25 +1781,25 @@ function Gt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1783
1781
  };
1784
1782
  }
1785
1783
  function Kt(e) {
1786
- return L(() => e, Object.values(e));
1784
+ return R(() => e, Object.values(e));
1787
1785
  }
1788
1786
  function qt(e, t) {
1789
1787
  let { ariaAttributes: n, style: r, ...i } = e, { ariaAttributes: a, style: o, ...s } = t;
1790
- return zt(n, a) && zt(r, o) && zt(i, s);
1788
+ return Q(n, a) && Q(r, o) && Q(i, s);
1791
1789
  }
1792
1790
  function Jt(e) {
1793
1791
  return typeof e == "object" && !!e && "getAverageRowHeight" in e && typeof e.getAverageRowHeight == "function";
1794
1792
  }
1795
1793
  var Yt = "data-react-window-index";
1796
1794
  function Xt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onResize: i, onRowsRendered: a, overscanCount: o = 3, rowComponent: s, rowCount: c, rowHeight: l, rowProps: u, tagName: d = "div", style: f, ...p }) {
1797
- let m = Kt(u), h = L(() => be(s, qt), [s]), [g, _] = z(null), v = Jt(l), { getCellBounds: y, getEstimatedSize: b, scrollToIndex: x, startIndexOverscan: S, startIndexVisible: C, stopIndexOverscan: w, stopIndexVisible: T } = Gt({
1795
+ let m = Kt(u), h = R(() => be(s, qt), [s]), [g, _] = B(null), v = Jt(l), { getCellBounds: y, getEstimatedSize: b, scrollToIndex: x, startIndexOverscan: S, startIndexVisible: C, stopIndexOverscan: w, stopIndexVisible: T } = Gt({
1798
1796
  containerElement: g,
1799
1797
  containerStyle: f,
1800
1798
  defaultContainerSize: n,
1801
1799
  direction: "vertical",
1802
1800
  itemCount: c,
1803
1801
  itemProps: m,
1804
- itemSize: L(() => v ? (e) => l.getRowHeight(e) ?? l.getAverageRowHeight() : l, [v, l]),
1802
+ itemSize: R(() => v ? (e) => l.getRowHeight(e) ?? l.getAverageRowHeight() : l, [v, l]),
1805
1803
  onResize: i,
1806
1804
  overscanCount: o
1807
1805
  });
@@ -1834,7 +1832,7 @@ function Xt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
1834
1832
  l,
1835
1833
  S,
1836
1834
  w
1837
- ]), I(() => {
1835
+ ]), L(() => {
1838
1836
  S >= 0 && w >= 0 && a && a({
1839
1837
  startIndex: C,
1840
1838
  stopIndex: T
@@ -1849,7 +1847,7 @@ function Xt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
1849
1847
  w,
1850
1848
  T
1851
1849
  ]);
1852
- let E = L(() => {
1850
+ let E = R(() => {
1853
1851
  let e = [];
1854
1852
  if (c > 0) for (let t = S; t <= w; t++) {
1855
1853
  let n = y(t);
@@ -1880,7 +1878,7 @@ function Xt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
1880
1878
  m,
1881
1879
  S,
1882
1880
  w
1883
- ]), D = /* @__PURE__ */ V("div", {
1881
+ ]), D = /* @__PURE__ */ H("div", {
1884
1882
  "aria-hidden": !0,
1885
1883
  style: {
1886
1884
  height: b(),
@@ -1912,41 +1910,41 @@ var Zt = {
1912
1910
  itemSelectedBackground: "_itemSelectedBackground_5skzl_37",
1913
1911
  itemSelectedText: "_itemSelectedText_5skzl_41"
1914
1912
  }, Qt = 44, $t = 8, en = ({ index: e, style: t, ariaAttributes: n, items: r, selectedDeploymentId: i, labelClassName: a, query: o, itemClassName: s, selectedItemClassName: c, hasSelectedBackground: u, hasSelectedText: d, onSelect: f }) => {
1915
- let m = r[e], _ = Nt(m.iconUrl, m.type, m.displayName ?? m.id, h.SM), v = m.id === i;
1916
- return /* @__PURE__ */ V("div", {
1913
+ let m = r[e], h = q(m.iconUrl, m.type, m.displayName ?? m.id, g.SM), v = m.id === i;
1914
+ return /* @__PURE__ */ H("div", {
1917
1915
  style: t,
1918
1916
  ...n,
1919
- children: /* @__PURE__ */ V(p, {
1917
+ children: /* @__PURE__ */ H(p, {
1920
1918
  type: "button",
1921
1919
  "aria-current": v ? "true" : void 0,
1922
- className: l(Zt.item, "h-full w-full gap-3 px-4", v && u && Zt.itemSelectedBackground, v && d && Zt.itemSelectedText, s, v && c, U.modelMenuItem, v && U.modelMenuItemSelected),
1923
- iconBefore: /* @__PURE__ */ V("span", {
1920
+ className: l(Zt.item, "h-full w-full gap-3 px-4", v && u && Zt.itemSelectedBackground, v && d && Zt.itemSelectedText, s, v && c, W.modelMenuItem, v && W.modelMenuItemSelected),
1921
+ iconBefore: /* @__PURE__ */ H("span", {
1924
1922
  className: Zt.itemIcon,
1925
- children: _
1923
+ children: h
1926
1924
  }),
1927
- label: /* @__PURE__ */ H("span", {
1925
+ label: /* @__PURE__ */ U("span", {
1928
1926
  className: "flex flex-1 items-center justify-between gap-2",
1929
- children: [/* @__PURE__ */ V(x, {
1927
+ children: [/* @__PURE__ */ H(S, {
1930
1928
  text: m.displayName ?? m.id,
1931
1929
  query: o,
1932
1930
  maxLines: 1,
1933
1931
  className: l(a, "min-w-0 flex-1 text-start")
1934
- }), v && /* @__PURE__ */ V(P, {
1935
- size: h.SM,
1932
+ }), v && /* @__PURE__ */ H(oe, {
1933
+ size: g.SM,
1936
1934
  className: Zt.checkIcon,
1937
1935
  "aria-hidden": !0,
1938
- stroke: g
1936
+ stroke: _
1939
1937
  })]
1940
1938
  }),
1941
1939
  onClick: () => f(m.id)
1942
1940
  })
1943
1941
  });
1944
1942
  }, tn = ({ 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: _ }) => {
1945
- let [y, b] = z("");
1946
- I(() => {
1943
+ let [v, b] = B("");
1944
+ L(() => {
1947
1945
  e || b("");
1948
1946
  }, [e]);
1949
- let x = a && a.length > 0, S = u !== void 0, C = !x && !S ? d ?? f : void 0, w = x ? Mt(a, y) : [], T = (e) => {
1947
+ let x = a && a.length > 0, S = u !== void 0, C = !x && !S ? d ?? f : void 0, w = x ? Mt(a, v) : [], T = (e) => {
1950
1948
  s(e), i();
1951
1949
  }, E = _?.colors, D = c({
1952
1950
  "--ci-sheet-divider": g?.divider,
@@ -1958,32 +1956,32 @@ var Zt = {
1958
1956
  "--ci-sheet-selected-bg": E?.selectedItemBackground,
1959
1957
  "--ci-sheet-selected-text": E?.selectedItemText
1960
1958
  });
1961
- return /* @__PURE__ */ V(Me, {
1959
+ return /* @__PURE__ */ H(Me, {
1962
1960
  isOpen: e,
1963
1961
  title: t,
1964
1962
  closeLabel: n,
1965
1963
  onClose: i,
1966
1964
  style: p,
1967
1965
  titleClassName: m,
1968
- className: l("max-h-[80dvh]", _?.className, U.modelMenu),
1966
+ className: l("max-h-[80dvh]", _?.className, W.modelMenu),
1969
1967
  colors: g?.shell,
1970
- children: /* @__PURE__ */ H("div", {
1968
+ children: /* @__PURE__ */ U("div", {
1971
1969
  className: "contents",
1972
1970
  style: D,
1973
- children: [x && !S && /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("div", {
1971
+ children: [x && !S && /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H("div", {
1974
1972
  style: c({ "--ci-sheet-search-bg": _?.colors?.searchHeaderBackground }),
1975
- className: l("flex-shrink-0 px-4 py-[10px]", Zt.search, _?.searchHeaderClassName, U.modelMenuSearch),
1976
- children: /* @__PURE__ */ V(A, {
1977
- value: y,
1973
+ className: l("flex-shrink-0 px-4 py-[10px]", Zt.search, _?.searchHeaderClassName, W.modelMenuSearch),
1974
+ children: /* @__PURE__ */ H(j, {
1975
+ value: v,
1978
1976
  placeholder: r,
1979
- size: v.Standard,
1977
+ size: y.Standard,
1980
1978
  onChange: (e) => b(e ?? "")
1981
1979
  })
1982
- }), /* @__PURE__ */ V("div", { className: l(Zt.divider, "h-px flex-shrink-0") })] }), S ? /* @__PURE__ */ V(At, { loadingLabel: u }) : C ? /* @__PURE__ */ V("div", {
1980
+ }), /* @__PURE__ */ H("div", { className: l(Zt.divider, "h-px flex-shrink-0") })] }), S ? /* @__PURE__ */ H(At, { loadingLabel: u }) : C ? /* @__PURE__ */ H("div", {
1983
1981
  role: "list",
1984
1982
  className: l(Zt.stateLabel, h, "px-4 py-4"),
1985
1983
  children: C
1986
- }) : /* @__PURE__ */ V(Xt, {
1984
+ }) : /* @__PURE__ */ H(Xt, {
1987
1985
  role: "list",
1988
1986
  className: "overflow-y-auto",
1989
1987
  style: { height: Math.min(w.length, $t) * Qt },
@@ -1994,7 +1992,7 @@ var Zt = {
1994
1992
  items: w,
1995
1993
  selectedDeploymentId: o,
1996
1994
  labelClassName: h,
1997
- query: y,
1995
+ query: v,
1998
1996
  itemClassName: _?.itemClassName,
1999
1997
  selectedItemClassName: _?.selectedItemClassName,
2000
1998
  hasSelectedBackground: !!E?.selectedItemBackground,
@@ -2004,8 +2002,8 @@ var Zt = {
2004
2002
  })]
2005
2003
  })
2006
2004
  });
2007
- }, nn = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, menuStyles: i, isStreaming: a, isMobile: o, isDisabled: c = !1, style: u, modelPickerOverlay: d, isPickerOpen: f, onPickerToggle: m, onPickerOpenChange: v }) => {
2008
- let [y, x] = z(!1), { selectorIcon: S, selectorAriaLabel: C, selectedLabel: w, selectedVersion: T, menuItems: E, menuHeader: D, menuStyle: O, onOpenChange: k } = Pt({
2005
+ }, nn = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, menuStyles: i, isStreaming: a, isMobile: o, isDisabled: c = !1, style: u, modelPickerOverlay: d, isPickerOpen: f, onPickerToggle: m, onPickerOpenChange: h }) => {
2006
+ let [y, b] = B(!1), { selectorIcon: S, selectorAriaLabel: C, selectedLabel: w, selectedVersion: T, menuItems: E, menuHeader: D, menuStyle: O, onOpenChange: k } = Pt({
2009
2007
  deployments: e,
2010
2008
  selectedDeploymentId: t,
2011
2009
  onDeploymentChange: n,
@@ -2013,40 +2011,40 @@ var Zt = {
2013
2011
  styles: i
2014
2012
  });
2015
2013
  if (!e) return null;
2016
- let A = a || c ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0, ee = /* @__PURE__ */ V(se, {
2017
- size: h.SM,
2018
- className: l(G.modelSelectorCaret, U.modelSelectorCaret),
2014
+ let A = a || c ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0, j = /* @__PURE__ */ H(se, {
2015
+ size: g.SM,
2016
+ className: l(K.modelSelectorCaret, W.modelSelectorCaret),
2019
2017
  "aria-hidden": !0,
2020
- stroke: g
2021
- }), j = /* @__PURE__ */ V("span", {
2022
- className: l("flex shrink-0 items-center", U.modelSelectorIcon),
2018
+ stroke: _
2019
+ }), M = /* @__PURE__ */ H("span", {
2020
+ className: l("flex shrink-0 items-center", W.modelSelectorIcon),
2023
2021
  children: S
2024
2022
  });
2025
- if (o) return /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V(b, {
2023
+ if (o) return /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H(x, {
2026
2024
  tooltipProps: { tooltip: w },
2027
- icon: /* @__PURE__ */ H("div", {
2025
+ icon: /* @__PURE__ */ U("div", {
2028
2026
  className: "flex items-center gap-1",
2029
- children: [j, ee]
2027
+ children: [M, j]
2030
2028
  }),
2031
2029
  "aria-label": C,
2032
2030
  onClick: () => {
2033
- c || x(!0);
2031
+ c || b(!0);
2034
2032
  },
2035
- className: l("w-[50px]", G.modelSelectorButton, A, U.modelSelectorButton)
2036
- }), d ? /* @__PURE__ */ V(Me, {
2033
+ className: l("w-[50px]", K.modelSelectorButton, A, W.modelSelectorButton)
2034
+ }), d ? /* @__PURE__ */ H(Me, {
2037
2035
  isOpen: y,
2038
2036
  title: r?.ariaLabel ?? "Select model",
2039
2037
  closeLabel: r?.closeLabel ?? "Close",
2040
- onClose: () => x(!1),
2038
+ onClose: () => b(!1),
2041
2039
  style: u,
2042
- className: l(i?.className, U.modelMenu),
2043
- children: d(() => x(!1))
2044
- }) : /* @__PURE__ */ V(tn, {
2040
+ className: l(i?.className, W.modelMenu),
2041
+ children: d(() => b(!1))
2042
+ }) : /* @__PURE__ */ H(tn, {
2045
2043
  isOpen: y,
2046
2044
  title: r?.ariaLabel ?? "Select model",
2047
2045
  closeLabel: r?.closeLabel ?? "Close",
2048
2046
  searchPlaceholder: r?.searchPlaceholder ?? "Search",
2049
- onClose: () => x(!1),
2047
+ onClose: () => b(!1),
2050
2048
  deployments: e,
2051
2049
  selectedDeploymentId: t,
2052
2050
  onSelect: (e) => n?.(e),
@@ -2058,113 +2056,113 @@ var Zt = {
2058
2056
  })] });
2059
2057
  if (d) {
2060
2058
  let e = T ? `${w} · ${T}` : w;
2061
- return /* @__PURE__ */ V(_, {
2059
+ return /* @__PURE__ */ H(v, {
2062
2060
  placement: "top-end",
2063
2061
  matchReferenceWidth: !1,
2064
2062
  open: f,
2065
- onOpenChange: v,
2063
+ onOpenChange: h,
2066
2064
  trigger: [],
2067
2065
  outsideClosable: !0,
2068
- renderOverlay: () => d(() => v?.(!1)),
2069
- listClassName: l("!w-[368px] !bg-layer-raised", i?.className, U.modelMenu),
2070
- children: /* @__PURE__ */ V(p, {
2066
+ renderOverlay: () => d(() => h?.(!1)),
2067
+ listClassName: l("!w-[368px] !bg-layer-raised", i?.className, W.modelMenu),
2068
+ children: /* @__PURE__ */ H(p, {
2071
2069
  "aria-label": C,
2072
2070
  "aria-disabled": c || void 0,
2073
2071
  tooltipProps: { tooltip: e },
2074
- className: l("h-auto min-w-0 gap-1.5 !rounded-full !border-0 px-0 py-1.5 pe-2 ps-1.5", G.modelSelectorButton, A, c && G.modelSelectorButtonDisabled, U.modelSelectorButton),
2072
+ className: l("h-auto min-w-0 gap-1.5 !rounded-full !border-0 px-0 py-1.5 pe-2 ps-1.5", K.modelSelectorButton, A, c && K.modelSelectorButtonDisabled, W.modelSelectorButton),
2075
2073
  onClick: () => {
2076
2074
  !a && !c && m?.();
2077
2075
  },
2078
- iconBefore: j,
2079
- iconAfter: ee,
2076
+ iconBefore: M,
2077
+ iconAfter: j,
2080
2078
  textClassName: "min-w-0",
2081
- label: /* @__PURE__ */ H("span", {
2079
+ label: /* @__PURE__ */ U("span", {
2082
2080
  className: "flex min-w-0 max-w-[180px] items-baseline gap-1",
2083
- children: [/* @__PURE__ */ V("span", {
2084
- className: l("dial-small-text max-w-[180px] shrink-0 truncate", G.modelSelectorName),
2081
+ children: [/* @__PURE__ */ H("span", {
2082
+ className: l("dial-small-text max-w-[180px] shrink-0 truncate", K.modelSelectorName),
2085
2083
  children: w
2086
- }), T && /* @__PURE__ */ V("span", {
2087
- className: l("dial-tiny-text min-w-0 truncate", G.modelSelectorVersion),
2084
+ }), T && /* @__PURE__ */ H("span", {
2085
+ className: l("dial-tiny-text min-w-0 truncate", K.modelSelectorVersion),
2088
2086
  children: T
2089
2087
  })]
2090
2088
  })
2091
2089
  })
2092
2090
  });
2093
2091
  }
2094
- return /* @__PURE__ */ V("div", {
2092
+ return /* @__PURE__ */ H("div", {
2095
2093
  className: l(c && A),
2096
2094
  "aria-disabled": c || void 0,
2097
- children: /* @__PURE__ */ V(_, {
2095
+ children: /* @__PURE__ */ H(v, {
2098
2096
  items: E,
2099
2097
  menuHeader: D,
2100
2098
  placement: "bottom-end",
2101
2099
  matchReferenceWidth: !1,
2102
2100
  maxDropdownHeight: s,
2103
- listClassName: l("!w-[240px]", i?.className, U.modelMenu),
2101
+ listClassName: l("!w-[240px]", i?.className, W.modelMenu),
2104
2102
  listStyle: O,
2105
2103
  disabled: c,
2106
2104
  onOpenChange: c ? void 0 : k,
2107
- children: /* @__PURE__ */ V(p, {
2105
+ children: /* @__PURE__ */ H(p, {
2108
2106
  "aria-label": C,
2109
2107
  "aria-disabled": c || void 0,
2110
2108
  tooltipProps: { tooltip: w },
2111
- iconBefore: j,
2112
- iconAfter: ee,
2113
- className: l("h-auto gap-1 !rounded-full !border-0 p-1.5", G.modelSelectorButton, c && G.modelSelectorButtonDisabled, U.modelSelectorButton)
2109
+ iconBefore: M,
2110
+ iconAfter: j,
2111
+ className: l("h-auto gap-1 !rounded-full !border-0 p-1.5", K.modelSelectorButton, c && K.modelSelectorButtonDisabled, W.modelSelectorButton)
2114
2112
  })
2115
2113
  })
2116
2114
  });
2117
- }, Q = ye(({ message: e = "", messageRevision: t, focusRequestId: n, textInsertion: r, onSend: i, onUploadAttachment: a, onStop: o, isStreaming: s = !1, onChange: u, onAttachmentsChange: p, placeholder: m = "Type a message...", ariaLabel: v, attachLabel: x = "Attach file", fileAccept: S, addMenuTitle: C = "Add", menuTitle: w = "Menu", menuCloseLabel: T = "Close", removeLabel: E, retryLabel: D, uploadingLabel: O, sendLabel: k, sendTooltip: A, emptyMessageTooltip: ee, stopLabel: j, micLabel: te = "Dictate", recordVoiceLabel: ne = "Record voice", stopRecordingLabel: re, discardRecordingLabel: ie, colors: M, typography: N, attachmentTray: ae, modelMenu: oe, className: P, pendingDropFiles: se = [], onDropFilesConsumed: ce, pendingAttachments: de = [], onPendingAttachmentsConsumed: fe, pasteTextThreshold: pe = 4e3, maxMessageLength: me = 5e4, deployments: he, selectedDeploymentId: ge, onDeploymentChange: _e, modelSelectorLabels: ve, initialAttachments: ye = [], hideAddButton: be = !1, hideAttachFile: xe = !1, hideActionBar: we = !1, actionRowLayout: Ee = ot.Stacked, isInlineActionRowAllowedBelowDesktop: De = !1, renderFooterActions: ke, isInputDisabled: Ae = !1, isModelSelectorDisabled: je = !1, isSendDisabled: Me = !1, isAudioMessageSupported: Ne = !1, isVoiceRecordingSupported: Fe = Ne, onTranscribeAudio: Ie, transcribingLabel: Le, voiceErrorLabel: Re, sendOnEnter: Ve = at.Enter, prefixAttachments: He = [], onRemovePrefixAttachment: Ge, chatSettings: Ke, toolsMenuItems: Xe, onToolToggle: et, canRemoveTools: tt = !0, toolsMenuTitle: nt, toolsBackLabel: rt, toolsChipLabels: st, menuOverlays: ct, activeMentions: lt, onBackspaceAtCaret: ut, caretPositionOverride: dt, commandMenu: W, autoFocus: ft = !1, messageHistory: pt, onDialFileSystemClick: mt, dialFileSystemLabel: ht, validateAttachment: gt, onAttachmentClick: vt, modelPickerOverlay: yt, maximumAttachmentsAmount: xt, onAttachmentsLimitExceeded: St, isAttachmentsEnabled: Ct = !0, isTextAttachmentsAllowed: wt = !0, usageLimitsSlot: Ot, onMessageTooLong: kt }, At) => {
2118
- let jt = d(), [Mt, Nt] = z(!1), K = Ue(pt), Pt = lt ?? [], Ft = Pt.length > 0, It = L(() => c({
2119
- "--ci-bg": M?.background,
2120
- "--ci-text": M?.text,
2121
- "--ci-border": M?.border,
2122
- "--ci-border-focus": M?.borderFocus,
2123
- "--ci-placeholder": M?.placeholder,
2124
- "--ci-text-disabled": M?.textDisabled,
2125
- "--ci-model-selector-caret-color": M?.modelSelectorCaret,
2126
- "--ci-model-selector-hover-bg": M?.modelSelectorHoverBg,
2127
- "--ci-model-selector-disabled-color": M?.modelSelectorDisabled,
2128
- "--ci-model-selector-name-color": M?.modelSelectorName,
2129
- "--ci-model-selector-version-color": M?.modelSelectorVersion,
2130
- "--ci-voice-error": M?.voiceError,
2131
- "--ci-voice-waveform": M?.voiceWaveform,
2132
- "--ci-voice-accent": M?.voiceAccent,
2133
- "--ci-mention-highlight-bg": M?.mentionHighlightBg,
2134
- "--ci-mention-highlight-text": M?.mentionHighlightText,
2135
- "--ci-mention-highlight-unsupported-bg": M?.mentionHighlightUnsupportedBg,
2136
- "--ci-mention-highlight-unsupported-text": M?.mentionHighlightUnsupportedText
2137
- }), [M]), Lt = L(() => mt ? [{
2115
+ }, rn = ye(({ message: e = "", messageRevision: t, focusRequestId: n, textInsertion: r, onSend: i, onUploadAttachment: a, onStop: o, isStreaming: s = !1, onChange: u, onAttachmentsChange: p, placeholder: m = "Type a message...", ariaLabel: h, attachLabel: y = "Attach file", fileAccept: S, addMenuTitle: C = "Add", menuTitle: w = "Menu", menuCloseLabel: T = "Close", removeLabel: E, retryLabel: D, uploadingLabel: O, sendLabel: k, sendTooltip: A, emptyMessageTooltip: j, stopLabel: M, micLabel: ee = "Dictate", recordVoiceLabel: N = "Record voice", stopRecordingLabel: te, discardRecordingLabel: ne, colors: P, typography: F, attachmentTray: re, modelMenu: ie, className: ae, pendingDropFiles: oe = [], onDropFilesConsumed: se, pendingAttachments: ce = [], onPendingAttachmentsConsumed: de, pasteTextThreshold: fe = 4e3, maxMessageLength: pe = 5e4, deployments: me, selectedDeploymentId: he, onDeploymentChange: ge, modelSelectorLabels: _e, initialAttachments: ve = [], hideAddButton: ye = !1, hideAttachFile: be = !1, hideActionBar: xe = !1, actionRowLayout: we = ot.Stacked, isInlineActionRowAllowedBelowDesktop: Ee = !1, renderFooterActions: De, isInputDisabled: ke = !1, isModelSelectorDisabled: Ae = !1, isSendDisabled: je = !1, isAudioMessageSupported: Me = !1, isVoiceRecordingSupported: Ne = Me, onTranscribeAudio: Fe, transcribingLabel: Ie, voiceErrorLabel: Le, sendOnEnter: Re = at.Enter, prefixAttachments: Ve = [], onRemovePrefixAttachment: He, chatSettings: Ge, toolsMenuItems: Ke, onToolToggle: Xe, canRemoveTools: et = !0, toolsMenuTitle: tt, toolsBackLabel: nt, toolsChipLabels: rt, menuOverlays: st, activeMentions: ct, onBackspaceAtCaret: lt, caretPositionOverride: ut, commandMenu: G, autoFocus: dt = !1, messageHistory: ft, onDialFileSystemClick: pt, dialFileSystemLabel: mt, validateAttachment: ht, onAttachmentClick: gt, modelPickerOverlay: vt, maximumAttachmentsAmount: yt, onAttachmentsLimitExceeded: xt, isAttachmentsEnabled: St = !0, isTextAttachmentsAllowed: Ct = !0, usageLimitsSlot: wt, onMessageTooLong: Ot }, kt) => {
2116
+ let At = d(), [jt, Mt] = B(!1), q = Ue(ft), Nt = ct ?? [], Pt = Nt.length > 0, Ft = R(() => c({
2117
+ "--ci-bg": P?.background,
2118
+ "--ci-text": P?.text,
2119
+ "--ci-border": P?.border,
2120
+ "--ci-border-focus": P?.borderFocus,
2121
+ "--ci-placeholder": P?.placeholder,
2122
+ "--ci-text-disabled": P?.textDisabled,
2123
+ "--ci-model-selector-caret-color": P?.modelSelectorCaret,
2124
+ "--ci-model-selector-hover-bg": P?.modelSelectorHoverBg,
2125
+ "--ci-model-selector-disabled-color": P?.modelSelectorDisabled,
2126
+ "--ci-model-selector-name-color": P?.modelSelectorName,
2127
+ "--ci-model-selector-version-color": P?.modelSelectorVersion,
2128
+ "--ci-voice-error": P?.voiceError,
2129
+ "--ci-voice-waveform": P?.voiceWaveform,
2130
+ "--ci-voice-accent": P?.voiceAccent,
2131
+ "--ci-mention-highlight-bg": P?.mentionHighlightBg,
2132
+ "--ci-mention-highlight-text": P?.mentionHighlightText,
2133
+ "--ci-mention-highlight-unsupported-bg": P?.mentionHighlightUnsupportedBg,
2134
+ "--ci-mention-highlight-unsupported-text": P?.mentionHighlightUnsupportedText
2135
+ }), [P]), It = R(() => pt ? [{
2138
2136
  key: "dial-fs",
2139
- label: ht ?? "DIAL file system",
2140
- icon: /* @__PURE__ */ V(le, {
2137
+ label: mt ?? "DIAL file system",
2138
+ icon: /* @__PURE__ */ H(le, {
2141
2139
  size: f,
2142
2140
  "aria-hidden": !0,
2143
- stroke: g
2141
+ stroke: _
2144
2142
  }),
2145
- onClick: mt
2146
- }] : [], [mt, ht]), { message: q, setMessage: J, textareaRef: Y } = Je({
2143
+ onClick: pt
2144
+ }] : [], [pt, mt]), { message: J, setMessage: Y, textareaRef: X } = Je({
2147
2145
  messageProp: e,
2148
2146
  messageRevision: t
2149
2147
  });
2150
- I(() => {
2151
- n !== void 0 && Y.current?.focus();
2152
- }, [n, Y]), Se(At, () => ({ getCaretPosition: () => Y.current?.selectionStart ?? q.length }), [q, Y]);
2153
- let { handleUndoKeyDown: Rt } = Ze({
2148
+ L(() => {
2149
+ n !== void 0 && X.current?.focus();
2150
+ }, [n, X]), Se(kt, () => ({ getCaretPosition: () => X.current?.selectionStart ?? J.length }), [J, X]);
2151
+ let { handleUndoKeyDown: Lt } = Ze({
2154
2152
  insertion: r,
2155
- textareaRef: Y
2156
- }), { isMenuOpen: X, query: zt, activeWordStart: Z, dismiss: Bt, closeOnOutsidePress: Vt, handleCaretMove: Ht, handleValueChange: Ut, listboxId: Wt, overlayRef: Gt, activeOptionId: Kt, moveActiveOption: qt, getActiveOption: Jt } = Be({
2157
- config: W,
2158
- message: q
2159
- }), Yt = () => {
2160
- Ht(Y.current?.selectionStart ?? q.length);
2161
- }, Xt = () => {
2153
+ textareaRef: X
2154
+ }), { isMenuOpen: Rt, query: Z, activeWordStart: Q, dismiss: zt, closeOnOutsidePress: Bt, handleCaretMove: Vt, handleValueChange: Ht, listboxId: Ut, overlayRef: Wt, activeOptionId: Gt, moveActiveOption: Kt, getActiveOption: qt } = Be({
2155
+ config: G,
2156
+ message: J
2157
+ }), Jt = () => {
2158
+ Vt(X.current?.selectionStart ?? J.length);
2159
+ }, Yt = () => {
2162
2160
  requestAnimationFrame(() => {
2163
- Ht(Y.current?.selectionStart ?? q.length);
2161
+ Vt(X.current?.selectionStart ?? J.length);
2164
2162
  });
2165
- }, Zt = (e) => {
2166
- e.key !== "ArrowLeft" && e.key !== "ArrowRight" && e.key !== "Home" && e.key !== "End" && e.key !== "PageUp" && e.key !== "PageDown" || Ht(e.currentTarget.selectionStart ?? q.length);
2167
- }, Qt = W?.emptyQueryHint != null, $t = W != null && Z != null ? Z + W.triggerPrefix.length : null, en = $t != null && q.slice($t).split("\n", 1)[0] !== "", tn = Qt && X && zt === "" && $t != null && !en, Q = W != null && X ? Z ?? 0 : null, rn = R(null), an = R(null), [on, sn] = z(null), cn = F(() => {
2163
+ }, Xt = (e) => {
2164
+ e.key !== "ArrowLeft" && e.key !== "ArrowRight" && e.key !== "Home" && e.key !== "End" && e.key !== "PageUp" && e.key !== "PageDown" || Vt(e.currentTarget.selectionStart ?? J.length);
2165
+ }, Zt = G?.emptyQueryHint != null, Qt = G != null && Q != null ? Q + G.triggerPrefix.length : null, $t = Qt != null && J.slice(Qt).split("\n", 1)[0] !== "", en = Zt && Rt && Z === "" && Qt != null && !$t, tn = G != null && Rt ? Q ?? 0 : null, rn = z(null), an = z(null), [on, sn] = B(null), cn = I(() => {
2168
2166
  let e = rn.current, t = an.current;
2169
2167
  if (e == null || t == null) {
2170
2168
  sn(null);
@@ -2180,250 +2178,250 @@ var Zt = {
2180
2178
  cn();
2181
2179
  }, [
2182
2180
  cn,
2183
- Q,
2184
- q
2185
- ]), I(() => {
2186
- if (Q == null) return;
2187
- let e = Y.current;
2181
+ tn,
2182
+ J
2183
+ ]), L(() => {
2184
+ if (tn == null) return;
2185
+ let e = X.current;
2188
2186
  if (e == null || typeof ResizeObserver > "u") return;
2189
2187
  let t = new ResizeObserver(cn);
2190
2188
  return t.observe(e), () => t.disconnect();
2191
2189
  }, [
2192
- Q,
2193
- Y,
2190
+ tn,
2191
+ X,
2194
2192
  cn
2195
2193
  ]);
2196
2194
  let { mirrorRef: ln, selectionRects: un, updateSelectionRects: dn } = qe({
2197
- textareaRef: Y,
2198
- message: q,
2199
- hasActiveMentions: Ft
2200
- }), fn = F((e) => {
2201
- if (W == null || (Bt(), !e?.consumeQuery) || (e.returnFocus !== !1 && Y.current?.focus(), Z == null)) return;
2202
- let t = `${W.triggerPrefix}${zt}`, n = Z + t.length;
2203
- if (q.slice(Z, n) !== t) return;
2204
- let r = q.slice(0, Z) + q.slice(n);
2205
- J(r), K.notifyChange(), u?.(r);
2195
+ textareaRef: X,
2196
+ message: J,
2197
+ hasActiveMentions: Pt
2198
+ }), fn = I((e) => {
2199
+ if (G == null || (zt(), !e?.consumeQuery) || (e.returnFocus !== !1 && X.current?.focus(), Q == null)) return;
2200
+ let t = `${G.triggerPrefix}${Z}`, n = Q + t.length;
2201
+ if (J.slice(Q, n) !== t) return;
2202
+ let r = J.slice(0, Q) + J.slice(n);
2203
+ Y(r), q.notifyChange(), u?.(r);
2206
2204
  }, [
2207
- W,
2208
- Bt,
2205
+ G,
2209
2206
  zt,
2210
- q,
2211
2207
  Z,
2212
2208
  J,
2213
- K,
2209
+ Q,
2210
+ Y,
2211
+ q,
2214
2212
  u,
2215
- Y
2216
- ]), pn = R(void 0);
2217
- I(() => {
2218
- dt == null || pn.current === t || (pn.current = t, Y.current?.setSelectionRange(dt, dt), Ht(dt));
2219
- }, [q]);
2213
+ X
2214
+ ]), pn = z(void 0);
2215
+ L(() => {
2216
+ ut == null || pn.current === t || (pn.current = t, X.current?.setSelectionRange(ut, ut), Vt(ut));
2217
+ }, [J]);
2220
2218
  let { attachments: mn, buildAttachments: hn, addAttachments: gn, resetAttachments: _n, handleRemove: vn, handleRetry: yn, handleExpand: bn, hasBlockedAttachments: xn } = Pe({
2221
- initialAttachments: ye,
2219
+ initialAttachments: ve,
2222
2220
  onUploadAttachment: a,
2223
2221
  onAttachmentsChange: p,
2224
- validateAttachment: gt,
2225
- pendingDropFiles: se,
2226
- onDropFilesConsumed: ce,
2227
- pendingAttachments: de,
2228
- onPendingAttachmentsConsumed: fe,
2229
- onExpandPastedText: F((e) => {
2230
- J((t) => t ? `${t}\n${e}` : e);
2231
- }, [J]),
2232
- maximumAttachmentsAmount: xt,
2233
- baseAttachmentsAmount: He.length,
2234
- onAttachmentsLimitExceeded: St
2235
- }), Sn = F((e) => {
2222
+ validateAttachment: ht,
2223
+ pendingDropFiles: oe,
2224
+ onDropFilesConsumed: se,
2225
+ pendingAttachments: ce,
2226
+ onPendingAttachmentsConsumed: de,
2227
+ onExpandPastedText: I((e) => {
2228
+ Y((t) => t ? `${t}\n${e}` : e);
2229
+ }, [Y]),
2230
+ maximumAttachmentsAmount: yt,
2231
+ baseAttachmentsAmount: Ve.length,
2232
+ onAttachmentsLimitExceeded: xt
2233
+ }), Sn = I((e) => {
2236
2234
  gn(hn([e]));
2237
- }, [gn, hn]), Cn = R(!1), wn = R(q);
2238
- wn.current = q;
2239
- let [Tn, En] = z({
2235
+ }, [gn, hn]), Cn = z(!1), wn = z(J);
2236
+ wn.current = J;
2237
+ let [Tn, En] = B({
2240
2238
  text: "",
2241
2239
  revision: 0
2242
2240
  }), { state: Dn, analyserNodeRef: On, errorMessage: kn, startRecording: An, stopRecording: jn, discardRecording: Mn } = it({
2243
2241
  onAttachAudio: Sn,
2244
- onTranscribeAudio: Ie,
2245
- onTranscript: F((e) => {
2242
+ onTranscribeAudio: Fe,
2243
+ onTranscript: I((e) => {
2246
2244
  let t = e.trim();
2247
2245
  if (t) {
2248
2246
  let e = wn.current, n = `${e}${e && !/\s$/.test(e) ? " " : ""}${t}`;
2249
- wn.current = n, J(n), En((e) => ({
2247
+ wn.current = n, Y(n), En((e) => ({
2250
2248
  text: t,
2251
2249
  revision: e.revision + 1
2252
- })), K.notifyChange(), u?.(n);
2250
+ })), q.notifyChange(), u?.(n);
2253
2251
  }
2254
2252
  Cn.current = !0;
2255
2253
  }, [
2256
- J,
2257
- K,
2254
+ Y,
2255
+ q,
2258
2256
  u
2259
2257
  ]),
2260
- errorLabel: Re
2258
+ errorLabel: Le
2261
2259
  }), $ = Dn === Qe.Recording || Dn === Qe.Processing;
2262
- I(() => {
2263
- (Dn === Qe.Error || Dn === Qe.Idle && Cn.current) && (Cn.current = !1, Y.current?.focus());
2264
- }, [Dn, Y]);
2265
- let Nn = R(null), Pn = R(null), Fn = Ct && wt, { handlePaste: In } = Oe(gn, Fn ? pe : Infinity), Ln = F((e) => {
2260
+ L(() => {
2261
+ (Dn === Qe.Error || Dn === Qe.Idle && Cn.current) && (Cn.current = !1, X.current?.focus());
2262
+ }, [Dn, X]);
2263
+ let Nn = z(null), Pn = z(null), Fn = St && Ct, { handlePaste: In } = Oe(gn, Fn ? fe : Infinity), Ln = I((e) => {
2266
2264
  if (!Fn) {
2267
2265
  let t = e.clipboardData.getData("text/plain");
2268
- t.length >= me && kt?.(t.length, me);
2266
+ t.length >= pe && Ot?.(t.length, pe);
2269
2267
  }
2270
2268
  In(e);
2271
2269
  }, [
2272
2270
  Fn,
2273
- me,
2274
- kt,
2271
+ pe,
2272
+ Ot,
2275
2273
  In
2276
- ]), Rn = q.trim().length > 0 || mn.length > 0, zn = Rn && !xn && !Me && !$, [Bn, Vn] = z([]);
2277
- I(() => {
2274
+ ]), Rn = J.trim().length > 0 || mn.length > 0, zn = Rn && !xn && !je && !$, [Bn, Vn] = B([]);
2275
+ L(() => {
2278
2276
  Vn([]);
2279
- }, [(Xe ?? []).map((e) => e.id).join("|")]);
2280
- let Hn = L(() => {
2281
- let e = Xe ?? [];
2282
- return tt ? e.filter((e) => e.isSelected || !Bn.includes(e.id)) : e;
2277
+ }, [(Ke ?? []).map((e) => e.id).join("|")]);
2278
+ let Hn = R(() => {
2279
+ let e = Ke ?? [];
2280
+ return et ? e.filter((e) => e.isSelected || !Bn.includes(e.id)) : e;
2283
2281
  }, [
2284
- Xe,
2282
+ Ke,
2285
2283
  Bn,
2286
- tt
2287
- ]), Un = F((e) => {
2288
- Vn((t) => t.includes(e) ? t : [...t, e]), Xe?.find((t) => t.id === e)?.isSelected && et?.(e);
2289
- }, [Xe, et]), Wn = he === void 0 || ge != null, Gn = Ne && !s, Kn = async () => {
2290
- if (Me || $) return;
2291
- if (q.length >= me) {
2292
- kt?.(q.length, me);
2284
+ et
2285
+ ]), Un = I((e) => {
2286
+ Vn((t) => t.includes(e) ? t : [...t, e]), Ke?.find((t) => t.id === e)?.isSelected && Xe?.(e);
2287
+ }, [Ke, Xe]), Wn = me === void 0 || he != null, Gn = Me && !s, Kn = async () => {
2288
+ if (je || $) return;
2289
+ if (J.length >= pe) {
2290
+ Ot?.(J.length, pe);
2293
2291
  return;
2294
2292
  }
2295
- let e = q, t = mn;
2296
- J(""), K.reset();
2293
+ let e = J, t = mn;
2294
+ Y(""), q.reset();
2297
2295
  try {
2298
2296
  await i?.(e, t), t.forEach((e) => {
2299
2297
  e.previewUrl && URL.revokeObjectURL(e.previewUrl), e.playUrl && URL.revokeObjectURL(e.playUrl);
2300
2298
  }), _n([]);
2301
2299
  } catch {
2302
- J(e), _n(t);
2300
+ Y(e), _n(t);
2303
2301
  }
2304
- }, qn = (e) => Ve === at.MetaEnter ? (e.metaKey || e.ctrlKey) && !e.shiftKey : !e.shiftKey && !e.metaKey && !e.ctrlKey, Jn = (e) => {
2305
- if (!X || e.nativeEvent.isComposing) return !1;
2306
- if (e.key === "Escape") return e.preventDefault(), e.stopPropagation(), Bt(), !0;
2307
- if (e.key === "ArrowDown" || e.key === "ArrowUp") return e.preventDefault(), qt(e.key === "ArrowDown" ? ze.Next : ze.Previous), !0;
2302
+ }, qn = (e) => Re === at.MetaEnter ? (e.metaKey || e.ctrlKey) && !e.shiftKey : !e.shiftKey && !e.metaKey && !e.ctrlKey, Jn = (e) => {
2303
+ if (!Rt || e.nativeEvent.isComposing) return !1;
2304
+ if (e.key === "Escape") return e.preventDefault(), e.stopPropagation(), zt(), !0;
2305
+ if (e.key === "ArrowDown" || e.key === "ArrowUp") return e.preventDefault(), Kt(e.key === "ArrowDown" ? ze.Next : ze.Previous), !0;
2308
2306
  if (e.key !== "Enter" || e.shiftKey) return !1;
2309
- let t = Jt();
2307
+ let t = qt();
2310
2308
  return t == null ? qn(e) ? (e.preventDefault(), !0) : !1 : (e.preventDefault(), t.click(), !0);
2311
2309
  }, Yn = (e) => {
2312
- if (!$ && !Rt(e) && !Jn(e)) {
2313
- if (!e.nativeEvent.isComposing && !Ae && !s) {
2310
+ if (!$ && !Lt(e) && !Jn(e)) {
2311
+ if (!e.nativeEvent.isComposing && !ke && !s) {
2314
2312
  if (e.key === "ArrowUp" || e.key === "ArrowDown") {
2315
- let t = e.currentTarget.selectionStart ?? 0, n = K.navigate(e.key === "ArrowUp" ? "up" : "down", q, t);
2313
+ let t = e.currentTarget.selectionStart ?? 0, n = q.navigate(e.key === "ArrowUp" ? "up" : "down", J, t);
2316
2314
  if (n !== null) {
2317
- e.preventDefault(), J(n);
2315
+ e.preventDefault(), Y(n);
2318
2316
  return;
2319
2317
  }
2320
2318
  }
2321
- if (e.key === "Backspace" && ut != null && e.currentTarget.selectionStart === e.currentTarget.selectionEnd && e.currentTarget.selectionStart != null) {
2322
- let t = ut(e.currentTarget.selectionStart);
2319
+ if (e.key === "Backspace" && lt != null && e.currentTarget.selectionStart === e.currentTarget.selectionEnd && e.currentTarget.selectionStart != null) {
2320
+ let t = lt(e.currentTarget.selectionStart);
2323
2321
  if (t != null) {
2324
2322
  e.preventDefault();
2325
2323
  let n = e.currentTarget;
2326
- n.setSelectionRange(t.start, t.start + t.length), typeof document.execCommand == "function" && document.execCommand("delete", !1) || Ye(n, q.slice(0, t.start) + q.slice(t.start + t.length), t.start);
2324
+ n.setSelectionRange(t.start, t.start + t.length), typeof document.execCommand == "function" && document.execCommand("delete", !1) || Ye(n, J.slice(0, t.start) + J.slice(t.start + t.length), t.start);
2327
2325
  return;
2328
2326
  }
2329
2327
  }
2330
2328
  }
2331
- e.key === "Enter" && qn(e) && (e.preventDefault(), !s && zn && Wn && !Ae && Kn());
2329
+ e.key === "Enter" && qn(e) && (e.preventDefault(), !s && zn && Wn && !ke && Kn());
2332
2330
  }
2333
2331
  }, Xn = (e) => {
2334
2332
  let t = Array.from(e.target.files ?? []);
2335
2333
  if (t.length === 0) return;
2336
2334
  let n = hn(t);
2337
2335
  e.target.value = "", gn(n);
2338
- }, Zn = L(() => {
2336
+ }, Zn = R(() => {
2339
2337
  let e = [];
2340
- return Q != null && e.push({
2341
- offset: Q,
2342
- node: /* @__PURE__ */ V("span", {
2338
+ return tn != null && e.push({
2339
+ offset: tn,
2340
+ node: /* @__PURE__ */ H("span", {
2343
2341
  ref: rn,
2344
2342
  "aria-hidden": !0,
2345
2343
  className: "inline-block h-[1lh] w-0 align-text-top"
2346
2344
  }, "caret-marker")
2347
- }), tn && W != null && $t != null && e.push({
2348
- offset: $t,
2349
- node: /* @__PURE__ */ V("span", {
2350
- className: G.commandHint,
2345
+ }), en && G != null && Qt != null && e.push({
2346
+ offset: Qt,
2347
+ node: /* @__PURE__ */ H("span", {
2348
+ className: K.commandHint,
2351
2349
  "aria-hidden": !0,
2352
2350
  "data-mirror-synthetic": !0,
2353
- children: W.emptyQueryHint
2351
+ children: G.emptyQueryHint
2354
2352
  }, "command-hint")
2355
2353
  }), e;
2356
2354
  }, [
2357
- Q,
2358
2355
  tn,
2359
- W,
2360
- $t
2361
- ]), Qn = /* @__PURE__ */ V("textarea", {
2362
- className: l(G.textarea, (Ft || Zn.length > 0) && G.textareaMentionMode, N?.fontClassName || "dial-body-paragraph-text", "relative z-0 max-h-[272px] w-full resize-none overflow-y-auto border-0 bg-transparent pe-1 ps-1 outline-none [field-sizing:content]", "disabled:cursor-not-allowed"),
2363
- ref: Y,
2364
- autoFocus: ft,
2365
- value: q,
2356
+ en,
2357
+ G,
2358
+ Qt
2359
+ ]), Qn = /* @__PURE__ */ H("textarea", {
2360
+ className: l(K.textarea, (Pt || Zn.length > 0) && K.textareaMentionMode, F?.fontClassName || "dial-body-paragraph-text", "relative z-0 max-h-[272px] w-full resize-none overflow-y-auto border-0 bg-transparent pe-1 ps-1 outline-none [field-sizing:content]", "disabled:cursor-not-allowed"),
2361
+ ref: X,
2362
+ autoFocus: dt,
2363
+ value: J,
2366
2364
  onChange: (e) => {
2367
- J(e.target.value), K.notifyChange();
2365
+ Y(e.target.value), q.notifyChange();
2368
2366
  let t = e.nativeEvent instanceof InputEvent ? e.nativeEvent : void 0;
2369
- Ut(e.target.value, e.target.selectionStart ?? e.target.value.length, t?.isComposing ?? !1), u?.(e.target.value);
2367
+ Ht(e.target.value, e.target.selectionStart ?? e.target.value.length, t?.isComposing ?? !1), u?.(e.target.value);
2370
2368
  },
2371
2369
  onSelect: dn,
2372
- onFocus: Xt,
2373
- onClick: Yt,
2370
+ onFocus: Yt,
2371
+ onClick: Jt,
2374
2372
  onKeyDown: Yn,
2375
- onKeyUp: Zt,
2373
+ onKeyUp: Xt,
2376
2374
  onPaste: Ln,
2377
2375
  placeholder: m,
2378
- "aria-label": v,
2379
- "aria-autocomplete": W == null ? void 0 : "list",
2380
- "aria-controls": X ? Wt : void 0,
2381
- "aria-activedescendant": Kt ?? void 0,
2382
- "aria-hidden": Ft ? !0 : void 0,
2383
- disabled: Ae,
2376
+ "aria-label": h,
2377
+ "aria-autocomplete": G == null ? void 0 : "list",
2378
+ "aria-controls": Rt ? Ut : void 0,
2379
+ "aria-activedescendant": Gt ?? void 0,
2380
+ "aria-hidden": Pt ? !0 : void 0,
2381
+ disabled: ke,
2384
2382
  readOnly: $,
2385
2383
  rows: 1
2386
- }), $n = W == null ? Qn : /* @__PURE__ */ H(B, { children: [Qn, /* @__PURE__ */ V("div", {
2384
+ }), $n = G == null ? Qn : /* @__PURE__ */ U(V, { children: [Qn, /* @__PURE__ */ H("div", {
2387
2385
  "aria-hidden": !0,
2388
- className: l("pointer-events-none absolute", N?.fontClassName || "dial-body-paragraph-text"),
2386
+ className: l("pointer-events-none absolute", F?.fontClassName || "dial-body-paragraph-text"),
2389
2387
  style: {
2390
2388
  left: on?.left ?? 0,
2391
2389
  top: on?.top ?? 0
2392
2390
  },
2393
- children: /* @__PURE__ */ V(_, {
2394
- open: X,
2391
+ children: /* @__PURE__ */ H(v, {
2392
+ open: Rt,
2395
2393
  onOpenChange: (e) => {
2396
- e || Vt();
2394
+ e || Bt();
2397
2395
  },
2398
2396
  placement: "top-start",
2399
2397
  trigger: [],
2400
2398
  initialFocus: -1,
2401
2399
  matchReferenceWidth: !1,
2402
- outsidePressIgnoreRef: Y,
2403
- renderOverlay: () => /* @__PURE__ */ V("div", {
2404
- ref: Gt,
2405
- role: W.menuLabel == null ? void 0 : "group",
2406
- "aria-label": W.menuLabel,
2407
- children: W.renderMenu({
2408
- query: zt,
2409
- caretPosition: Z ?? 0,
2400
+ outsidePressIgnoreRef: X,
2401
+ renderOverlay: () => /* @__PURE__ */ H("div", {
2402
+ ref: Wt,
2403
+ role: G.menuLabel == null ? void 0 : "group",
2404
+ "aria-label": G.menuLabel,
2405
+ children: G.renderMenu({
2406
+ query: Z,
2407
+ caretPosition: Q ?? 0,
2410
2408
  close: fn,
2411
- listboxId: Wt,
2412
- activeOptionId: Kt
2409
+ listboxId: Ut,
2410
+ activeOptionId: Gt
2413
2411
  })
2414
2412
  }),
2415
- children: /* @__PURE__ */ V("span", {
2413
+ children: /* @__PURE__ */ H("span", {
2416
2414
  "aria-hidden": !0,
2417
2415
  className: "inline-block h-[1lh] w-0"
2418
2416
  })
2419
2417
  })
2420
- })] }), er = /* @__PURE__ */ H("div", {
2418
+ })] }), er = /* @__PURE__ */ U("div", {
2421
2419
  ref: an,
2422
2420
  className: "relative -me-1 -ms-1 w-[calc(100%+8px)]",
2423
- children: [(Ft || Zn.length > 0) && /* @__PURE__ */ H("div", {
2421
+ children: [(Pt || Zn.length > 0) && /* @__PURE__ */ U("div", {
2424
2422
  ref: ln,
2425
- className: l(G.textarea, N?.fontClassName || "dial-body-paragraph-text", "pointer-events-none absolute inset-0 z-10 max-h-[272px] w-full overflow-hidden whitespace-pre-wrap pe-1 ps-1 [overflow-wrap:anywhere]"),
2426
- children: [We(q, Pt, Zn, G.mentionHighlight, G.mentionHighlightUnsupported), un.map((e, t) => /* @__PURE__ */ V("div", {
2423
+ className: l(K.textarea, F?.fontClassName || "dial-body-paragraph-text", "pointer-events-none absolute inset-0 z-10 max-h-[272px] w-full overflow-hidden whitespace-pre-wrap pe-1 ps-1 [overflow-wrap:anywhere]"),
2424
+ children: [We(J, Nt, Zn, K.mentionHighlight, K.mentionHighlightUnsupported), un.map((e, t) => /* @__PURE__ */ H("div", {
2427
2425
  "aria-hidden": !0,
2428
2426
  className: "pointer-events-none absolute rounded-sm bg-control-accent-alpha-active",
2429
2427
  style: {
@@ -2434,48 +2432,48 @@ var Zt = {
2434
2432
  }
2435
2433
  }, `selection-${t}`))]
2436
2434
  }), $n]
2437
- }), tr = be ? void 0 : /* @__PURE__ */ V(_t, {
2438
- onAttachClick: xe ? void 0 : () => Nn.current?.click(),
2439
- attachLabel: x,
2435
+ }), tr = ye ? void 0 : /* @__PURE__ */ H(_t, {
2436
+ onAttachClick: be ? void 0 : () => Nn.current?.click(),
2437
+ attachLabel: y,
2440
2438
  addMenuTitle: C,
2441
2439
  menuTitle: w,
2442
2440
  menuCloseLabel: T,
2443
- style: It,
2444
- isDisabled: Ae || $,
2445
- chatSettings: Ke,
2446
- extraMenuItems: Lt,
2447
- onRecordVoice: Fe && Ct && !s && !$ ? () => An($e.Attachment) : void 0,
2448
- recordVoiceLabel: ne,
2449
- toolsMenuItems: tt ? Xe : void 0,
2450
- onToolToggle: et,
2451
- toolsMenuTitle: nt,
2452
- toolsBackLabel: rt,
2453
- menuOverlays: ct,
2454
- getCaretPosition: () => Y.current?.selectionStart ?? q.length
2455
- }), nr = Ee === ot.Inline && (!jt || De), rr = tr && /* @__PURE__ */ V("div", {
2456
- className: l("flex", U.addCluster),
2441
+ style: Ft,
2442
+ isDisabled: ke || $,
2443
+ chatSettings: Ge,
2444
+ extraMenuItems: It,
2445
+ onRecordVoice: Ne && St && !s && !$ ? () => An($e.Attachment) : void 0,
2446
+ recordVoiceLabel: N,
2447
+ toolsMenuItems: et ? Ke : void 0,
2448
+ onToolToggle: Xe,
2449
+ toolsMenuTitle: tt,
2450
+ toolsBackLabel: nt,
2451
+ menuOverlays: st,
2452
+ getCaretPosition: () => X.current?.selectionStart ?? J.length
2453
+ }), nr = we === ot.Inline && (!At || Ee), rr = tr && /* @__PURE__ */ H("div", {
2454
+ className: l("flex", W.addCluster),
2457
2455
  children: tr
2458
- }), ir = Hn.length > 0 && et != null && /* @__PURE__ */ V("div", {
2459
- className: l("min-w-0 flex-1", U.toolsChips),
2460
- children: /* @__PURE__ */ V(bt, {
2456
+ }), ir = Hn.length > 0 && Xe != null && /* @__PURE__ */ H("div", {
2457
+ className: l("min-w-0 flex-1", W.toolsChips),
2458
+ children: /* @__PURE__ */ H(bt, {
2461
2459
  items: Hn,
2462
- onToolToggle: et,
2460
+ onToolToggle: Xe,
2463
2461
  onToolDismiss: Un,
2464
- canRemove: tt,
2465
- removeLabel: st?.removeLabel,
2466
- stateOnLabel: st?.stateOnLabel,
2467
- stateOffLabel: st?.stateOffLabel
2462
+ canRemove: et,
2463
+ removeLabel: rt?.removeLabel,
2464
+ stateOnLabel: rt?.stateOnLabel,
2465
+ stateOffLabel: rt?.stateOffLabel
2468
2466
  })
2469
2467
  });
2470
- return /* @__PURE__ */ H("div", {
2468
+ return /* @__PURE__ */ U("div", {
2471
2469
  ref: Pn,
2472
- style: It,
2473
- className: l(G.wrapper, Ae && G.wrapperDisabled, Ae && "cursor-not-allowed", "flex w-full max-w-[748px] flex-col justify-center gap-3 rounded-xl border", "focus-within:outline focus-within:-outline-offset-1 active:outline active:-outline-offset-1", mn.length > 6 ? "py-4 ps-4" : "p-4", P, U.wrapper),
2470
+ style: Ft,
2471
+ className: l(K.wrapper, ke && K.wrapperDisabled, ke && "cursor-not-allowed", "flex w-full max-w-[748px] flex-col justify-center gap-3 rounded-xl border", "focus-within:outline focus-within:-outline-offset-1 active:outline active:-outline-offset-1", mn.length > 6 ? "py-4 ps-4" : "p-4", ae, W.wrapper),
2474
2472
  children: [
2475
- (He.length > 0 || mn.length > 0) && /* @__PURE__ */ V(Te, {
2476
- attachments: [...He, ...mn],
2473
+ (Ve.length > 0 || mn.length > 0) && /* @__PURE__ */ H(Te, {
2474
+ attachments: [...Ve, ...mn],
2477
2475
  onRemove: (e) => {
2478
- He.some((t) => t.id === e) ? Ge?.(e) : vn(e);
2476
+ Ve.some((t) => t.id === e) ? He?.(e) : vn(e);
2479
2477
  },
2480
2478
  onRetry: yn,
2481
2479
  onExpand: bn,
@@ -2484,13 +2482,13 @@ var Zt = {
2484
2482
  retryLabel: D,
2485
2483
  uploadingLabel: O
2486
2484
  },
2487
- styles: ae,
2488
- onAttachmentClick: vt == null ? void 0 : (e) => {
2489
- let t = [...He, ...mn].find((t) => t.id === e);
2490
- t != null && vt(t);
2485
+ styles: re,
2486
+ onAttachmentClick: gt == null ? void 0 : (e) => {
2487
+ let t = [...Ve, ...mn].find((t) => t.id === e);
2488
+ t != null && gt(t);
2491
2489
  }
2492
2490
  }),
2493
- !be && /* @__PURE__ */ V("input", {
2491
+ !ye && /* @__PURE__ */ H("input", {
2494
2492
  ref: Nn,
2495
2493
  type: "file",
2496
2494
  multiple: !0,
@@ -2500,11 +2498,11 @@ var Zt = {
2500
2498
  tabIndex: -1,
2501
2499
  onChange: Xn
2502
2500
  }),
2503
- kn && /* @__PURE__ */ V(y, {
2501
+ kn && /* @__PURE__ */ H(b, {
2504
2502
  text: kn,
2505
2503
  className: "min-w-0 break-words px-1"
2506
2504
  }),
2507
- $ && /* @__PURE__ */ V(Tt, {
2505
+ $ && /* @__PURE__ */ H(Tt, {
2508
2506
  embedded: !0,
2509
2507
  state: Dn,
2510
2508
  analyserNodeRef: On,
@@ -2512,112 +2510,112 @@ var Zt = {
2512
2510
  onStop: jn,
2513
2511
  onDiscard: Mn,
2514
2512
  attachButton: tr,
2515
- stopLabel: re,
2516
- discardLabel: ie,
2517
- processingLabel: Le
2513
+ stopLabel: te,
2514
+ discardLabel: ne,
2515
+ processingLabel: Ie
2518
2516
  }),
2519
- !$ && we && er,
2520
- !$ && !we && nr && ir && /* @__PURE__ */ V("div", {
2517
+ !$ && xe && er,
2518
+ !$ && !xe && nr && ir && /* @__PURE__ */ H("div", {
2521
2519
  className: "flex",
2522
2520
  children: ir
2523
2521
  }),
2524
- !$ && !we && /* @__PURE__ */ H("div", {
2525
- className: l("flex items-center gap-2", nr ? "flex-nowrap" : "flex-wrap", U.actionRow),
2522
+ !$ && !xe && /* @__PURE__ */ U("div", {
2523
+ className: l("flex items-center gap-2", nr ? "flex-nowrap" : "flex-wrap", W.actionRow),
2526
2524
  children: [
2527
2525
  nr && rr,
2528
- /* @__PURE__ */ V("div", {
2529
- className: l("flex min-w-0 items-center self-stretch", nr ? "flex-1" : "w-full", U.textareaWrap),
2526
+ /* @__PURE__ */ H("div", {
2527
+ className: l("flex min-w-0 items-center self-stretch", nr ? "flex-1" : "w-full", W.textareaWrap),
2530
2528
  children: er
2531
2529
  }),
2532
2530
  !nr && rr,
2533
2531
  !nr && ir,
2534
- /* @__PURE__ */ V("div", {
2535
- className: l("ms-auto flex flex-shrink-0 items-center gap-2", U.footerActions),
2536
- children: ke ? ke({
2532
+ /* @__PURE__ */ H("div", {
2533
+ className: l("ms-auto flex flex-shrink-0 items-center gap-2", W.footerActions),
2534
+ children: De ? De({
2537
2535
  canSend: zn,
2538
2536
  onSend: Kn
2539
- }) : /* @__PURE__ */ H(B, { children: [
2540
- Ot,
2541
- /* @__PURE__ */ V(nn, {
2542
- deployments: he,
2543
- selectedDeploymentId: ge,
2544
- onDeploymentChange: _e,
2545
- modelSelectorLabels: ve,
2546
- menuStyles: oe,
2537
+ }) : /* @__PURE__ */ U(V, { children: [
2538
+ wt,
2539
+ /* @__PURE__ */ H(nn, {
2540
+ deployments: me,
2541
+ selectedDeploymentId: he,
2542
+ onDeploymentChange: ge,
2543
+ modelSelectorLabels: _e,
2544
+ menuStyles: ie,
2547
2545
  isStreaming: s,
2548
- isMobile: jt,
2549
- isDisabled: je,
2550
- style: It,
2551
- modelPickerOverlay: yt,
2552
- isPickerOpen: Mt,
2553
- onPickerToggle: () => Nt((e) => !e),
2554
- onPickerOpenChange: Nt
2546
+ isMobile: At,
2547
+ isDisabled: Ae,
2548
+ style: Ft,
2549
+ modelPickerOverlay: vt,
2550
+ isPickerOpen: jt,
2551
+ onPickerToggle: () => Mt((e) => !e),
2552
+ onPickerOpenChange: Mt
2555
2553
  }),
2556
- Gn && /* @__PURE__ */ V(b, {
2557
- icon: /* @__PURE__ */ V(ue, {
2558
- size: h.LG,
2559
- stroke: g,
2554
+ Gn && /* @__PURE__ */ H(x, {
2555
+ icon: /* @__PURE__ */ H(ue, {
2556
+ size: g.LG,
2557
+ stroke: _,
2560
2558
  "aria-hidden": !0
2561
2559
  }),
2562
- "aria-label": te,
2563
- tooltipProps: { tooltip: te },
2560
+ "aria-label": ee,
2561
+ tooltipProps: { tooltip: ee },
2564
2562
  className: "size-[40px] flex-shrink-0 mobile:min-h-11 mobile:min-w-11",
2565
2563
  onClick: () => An($e.Dictation),
2566
- disabled: Ae || s
2564
+ disabled: ke || s
2567
2565
  }),
2568
- s && o ? /* @__PURE__ */ V(Dt, {
2566
+ s && o ? /* @__PURE__ */ H(Dt, {
2569
2567
  onStop: o,
2570
- ariaLabel: j
2571
- }) : !s && /* @__PURE__ */ V(Et, {
2568
+ ariaLabel: M
2569
+ }) : !s && /* @__PURE__ */ H(Et, {
2572
2570
  onSend: Kn,
2573
2571
  isDisabled: !Wn || !zn,
2574
2572
  ariaLabel: k,
2575
- sendTooltip: Rn ? A : ee ?? A
2573
+ sendTooltip: Rn ? A : j ?? A
2576
2574
  })
2577
2575
  ] })
2578
2576
  })
2579
2577
  ]
2580
2578
  }),
2581
- /* @__PURE__ */ V("span", {
2579
+ /* @__PURE__ */ H("span", {
2582
2580
  className: "sr-only",
2583
2581
  role: "status",
2584
2582
  "aria-live": "polite",
2585
2583
  "aria-atomic": "true",
2586
- children: /* @__PURE__ */ V("span", { children: Tn.text }, Tn.revision)
2584
+ children: /* @__PURE__ */ H("span", { children: Tn.text }, Tn.revision)
2587
2585
  })
2588
2586
  ]
2589
2587
  });
2590
2588
  });
2591
- Q.displayName = "Input";
2592
- var rn = {
2589
+ rn.displayName = "Input";
2590
+ var an = {
2593
2591
  welcome: "_welcome_1icyo_1",
2594
2592
  description: "_description_1icyo_5"
2595
- }, an = ({ isStreaming: e = !1, placeholder: t = "Type a prompt or use \"/\" to select one", welcomeText: n, descriptionText: r, belowWelcomeSlot: i, styles: a, className: o, inputClassName: s, isInputDisabled: u = !1, ...d }) => {
2593
+ }, on = ({ isStreaming: e = !1, placeholder: t = "Type a prompt or use \"/\" to select one", welcomeText: n, descriptionText: r, belowWelcomeSlot: i, styles: a, className: o, inputClassName: s, isInputDisabled: u = !1, ...d }) => {
2596
2594
  let { colors: f, typography: p, attachmentTray: m, modelMenu: h } = a ?? {};
2597
- return /* @__PURE__ */ H("div", {
2595
+ return /* @__PURE__ */ U("div", {
2598
2596
  style: c({
2599
2597
  "--ci-welcome-color": f?.welcomeText,
2600
2598
  "--ci-description-color": f?.descriptionText
2601
2599
  }),
2602
2600
  className: l("relative flex w-full flex-col items-center gap-9 px-4 py-5 desktop:p-5", o),
2603
2601
  children: [
2604
- n && /* @__PURE__ */ H("div", {
2602
+ n && /* @__PURE__ */ U("div", {
2605
2603
  className: "flex flex-col items-center gap-4 text-center",
2606
- children: [/* @__PURE__ */ V("h1", {
2607
- className: l(rn.welcome, "m-0", p?.welcomeClassName || "dial-display2-text"),
2604
+ children: [/* @__PURE__ */ H("h1", {
2605
+ className: l(an.welcome, "m-0", p?.welcomeClassName || "dial-display2-text"),
2608
2606
  children: n
2609
- }), r && /* @__PURE__ */ V("p", {
2610
- className: l(rn.description, "m-0 max-w-[540px]", p?.descriptionClassName || "dial-body-paragraph-text"),
2607
+ }), r && /* @__PURE__ */ H("p", {
2608
+ className: l(an.description, "m-0 max-w-[540px]", p?.descriptionClassName || "dial-body-paragraph-text"),
2611
2609
  children: r
2612
2610
  })]
2613
2611
  }),
2614
- i != null && /* @__PURE__ */ V("div", {
2612
+ i != null && /* @__PURE__ */ H("div", {
2615
2613
  className: "flex w-full max-w-[700px] flex-col items-center empty:hidden",
2616
2614
  children: i
2617
2615
  }),
2618
- /* @__PURE__ */ V("div", {
2616
+ /* @__PURE__ */ H("div", {
2619
2617
  className: l("relative w-full", n ? "max-w-[700px]" : "max-w-[748px]"),
2620
- children: /* @__PURE__ */ V(Q, {
2618
+ children: /* @__PURE__ */ H(rn, {
2621
2619
  placeholder: t,
2622
2620
  isStreaming: e,
2623
2621
  isInputDisabled: u,
@@ -2631,42 +2629,42 @@ var rn = {
2631
2629
  })
2632
2630
  ]
2633
2631
  });
2634
- }, on = ({ message: e, messageRevision: t, onChange: n, activeMentions: r, onBackspaceAtCaret: i, caretPositionOverride: o, commandMenu: s, menuOverlays: c, initialAttachments: u = [], onCancel: d, onSave: p, onUploadAttachment: m, cancelLabel: h = "Cancel", saveLabel: _ = "Save & Submit", ariaLabel: v, removeLabel: y, retryLabel: b, uploadingLabel: x, addMenuTitle: S = "Add", attachLabel: w = "Attach file", menuTitle: T = "Menu", menuCloseLabel: D = "Close", className: O, pendingDropFiles: k, onDropFilesConsumed: A, validateAttachment: ee, isAttachmentsEnabled: j, isTextAttachmentsAllowed: te, hideAttachFile: ne = !1, fileAccept: re, maximumAttachmentsAmount: ie, onAttachmentsLimitExceeded: M, onDialFileSystemClick: N, dialFileSystemLabel: ae, pendingAttachments: oe, onPendingAttachmentsConsumed: P, onAttachmentClick: se, pasteTextThreshold: ce, maxMessageLength: ue = 5e4, onMessageTooLong: de }) => {
2635
- let fe = R(null), pe = R(null), [me, he] = z([]);
2636
- I(() => {
2637
- k?.length && (he(k), A?.());
2632
+ }, sn = ({ message: e, messageRevision: t, onChange: n, activeMentions: r, onBackspaceAtCaret: i, caretPositionOverride: o, commandMenu: s, menuOverlays: c, initialAttachments: u = [], onCancel: d, onSave: p, onUploadAttachment: m, cancelLabel: h = "Cancel", saveLabel: g = "Save & Submit", ariaLabel: v, removeLabel: y, retryLabel: b, uploadingLabel: x, addMenuTitle: S = "Add", attachLabel: C = "Attach file", menuTitle: T = "Menu", menuCloseLabel: E = "Close", className: O, pendingDropFiles: k, onDropFilesConsumed: A, validateAttachment: j, isAttachmentsEnabled: M, isTextAttachmentsAllowed: ee, hideAttachFile: N = !1, fileAccept: te, maximumAttachmentsAmount: ne, onAttachmentsLimitExceeded: P, onDialFileSystemClick: F, dialFileSystemLabel: re, pendingAttachments: ie, onPendingAttachmentsConsumed: ae, onAttachmentClick: oe, pasteTextThreshold: se, maxMessageLength: ce = 5e4, onMessageTooLong: ue }) => {
2633
+ let de = z(null), fe = z(null), [pe, me] = B([]);
2634
+ L(() => {
2635
+ k?.length && (me(k), A?.());
2638
2636
  }, [k, A]);
2639
- let [ge, _e] = z(e ?? ""), [ve, ye] = z([]), [be, xe] = z(u), Se = ve.some((e) => e.status === a.Loading || e.status === a.Error), Ce = (ge.trim().length > 0 || ve.length > 0 || be.length > 0) && !Se, we = (e) => {
2640
- xe((t) => t.filter((t) => t.id !== e));
2641
- }, B = F((e, t) => {
2642
- p(e, be, t);
2643
- }, [be, p]), Te = () => {
2644
- if (Ce) {
2645
- if (ge.length >= ue) {
2646
- de?.(ge.length, ue);
2637
+ let [he, ge] = B(e ?? ""), [_e, ve] = B([]), [ye, be] = B(u), xe = _e.some((e) => e.status === a.Loading || e.status === a.Error), Se = (he.trim().length > 0 || _e.length > 0 || ye.length > 0) && !xe, Ce = (e) => {
2638
+ be((t) => t.filter((t) => t.id !== e));
2639
+ }, we = I((e, t) => {
2640
+ p(e, ye, t);
2641
+ }, [ye, p]), V = () => {
2642
+ if (Se) {
2643
+ if (he.length >= ce) {
2644
+ ue?.(he.length, ce);
2647
2645
  return;
2648
2646
  }
2649
- B(ge, ve);
2647
+ we(he, _e);
2650
2648
  }
2651
- }, Ee = F(() => he([]), []), De = F((e) => {
2652
- _e(e), n?.(e);
2653
- }, [n]), Oe = F((e) => {
2649
+ }, Te = I(() => me([]), []), Ee = I((e) => {
2650
+ ge(e), n?.(e);
2651
+ }, [n]), De = I((e) => {
2654
2652
  let t = Array.from(e.target.files ?? []);
2655
- t.length !== 0 && (e.target.value = "", he(t));
2656
- }, []), U = L(() => N ? [{
2653
+ t.length !== 0 && (e.target.value = "", me(t));
2654
+ }, []), Oe = R(() => F ? [{
2657
2655
  key: "dial-fs",
2658
- label: ae ?? "DIAL file system",
2659
- icon: /* @__PURE__ */ V(le, {
2656
+ label: re ?? "DIAL file system",
2657
+ icon: /* @__PURE__ */ H(le, {
2660
2658
  size: f,
2661
2659
  "aria-hidden": !0,
2662
- stroke: g
2660
+ stroke: _
2663
2661
  }),
2664
- onClick: N
2665
- }] : [], [N, ae]);
2666
- return /* @__PURE__ */ H("div", {
2662
+ onClick: F
2663
+ }] : [], [F, re]);
2664
+ return /* @__PURE__ */ U("div", {
2667
2665
  className: l("flex w-full flex-col gap-2", O),
2668
- children: [/* @__PURE__ */ V(Q, {
2669
- ref: pe,
2666
+ children: [/* @__PURE__ */ H(rn, {
2667
+ ref: fe,
2670
2668
  message: e,
2671
2669
  messageRevision: t,
2672
2670
  activeMentions: r,
@@ -2675,70 +2673,70 @@ var rn = {
2675
2673
  commandMenu: s,
2676
2674
  ariaLabel: v,
2677
2675
  hideActionBar: !0,
2678
- pendingDropFiles: me,
2679
- onDropFilesConsumed: Ee,
2680
- onSend: B,
2676
+ pendingDropFiles: pe,
2677
+ onDropFilesConsumed: Te,
2678
+ onSend: we,
2681
2679
  onUploadAttachment: m,
2682
- onChange: De,
2683
- onAttachmentsChange: ye,
2680
+ onChange: Ee,
2681
+ onAttachmentsChange: ve,
2684
2682
  removeLabel: y,
2685
2683
  retryLabel: b,
2686
2684
  uploadingLabel: x,
2687
2685
  className: "max-w-full",
2688
- prefixAttachments: be,
2689
- onRemovePrefixAttachment: we,
2690
- validateAttachment: ee,
2691
- isAttachmentsEnabled: j,
2692
- isTextAttachmentsAllowed: te,
2693
- maximumAttachmentsAmount: ie,
2694
- onAttachmentsLimitExceeded: M,
2695
- pendingAttachments: oe,
2696
- onPendingAttachmentsConsumed: P,
2697
- onAttachmentClick: se,
2698
- pasteTextThreshold: ce,
2699
- maxMessageLength: ue,
2700
- onMessageTooLong: de
2701
- }), /* @__PURE__ */ H("div", {
2686
+ prefixAttachments: ye,
2687
+ onRemovePrefixAttachment: Ce,
2688
+ validateAttachment: j,
2689
+ isAttachmentsEnabled: M,
2690
+ isTextAttachmentsAllowed: ee,
2691
+ maximumAttachmentsAmount: ne,
2692
+ onAttachmentsLimitExceeded: P,
2693
+ pendingAttachments: ie,
2694
+ onPendingAttachmentsConsumed: ae,
2695
+ onAttachmentClick: oe,
2696
+ pasteTextThreshold: se,
2697
+ maxMessageLength: ce,
2698
+ onMessageTooLong: ue
2699
+ }), /* @__PURE__ */ U("div", {
2702
2700
  className: "flex items-center justify-between",
2703
- children: [/* @__PURE__ */ H("div", {
2701
+ children: [/* @__PURE__ */ U("div", {
2704
2702
  className: "flex",
2705
- children: [!ne && /* @__PURE__ */ V("input", {
2706
- ref: fe,
2703
+ children: [!N && /* @__PURE__ */ H("input", {
2704
+ ref: de,
2707
2705
  type: "file",
2708
2706
  multiple: !0,
2709
- accept: re,
2707
+ accept: te,
2710
2708
  className: "sr-only",
2711
2709
  "aria-hidden": !0,
2712
2710
  tabIndex: -1,
2713
- onChange: Oe
2714
- }), (!ne || (c?.length ?? 0) > 0) && /* @__PURE__ */ V(_t, {
2715
- onAttachClick: ne ? void 0 : () => fe.current?.click(),
2716
- attachLabel: w,
2711
+ onChange: De
2712
+ }), (!N || (c?.length ?? 0) > 0) && /* @__PURE__ */ H(_t, {
2713
+ onAttachClick: N ? void 0 : () => de.current?.click(),
2714
+ attachLabel: C,
2717
2715
  addMenuTitle: S,
2718
2716
  menuTitle: T,
2719
- menuCloseLabel: D,
2720
- extraMenuItems: U,
2717
+ menuCloseLabel: E,
2718
+ extraMenuItems: Oe,
2721
2719
  menuOverlays: c,
2722
- getCaretPosition: () => pe.current?.getCaretPosition() ?? 0
2720
+ getCaretPosition: () => fe.current?.getCaretPosition() ?? 0
2723
2721
  })]
2724
- }), /* @__PURE__ */ H("div", {
2722
+ }), /* @__PURE__ */ U("div", {
2725
2723
  className: "flex gap-2",
2726
- children: [/* @__PURE__ */ V(C, {
2724
+ children: [/* @__PURE__ */ H(w, {
2727
2725
  label: h,
2728
2726
  onClick: d
2729
- }), /* @__PURE__ */ V(E, {
2730
- label: _,
2731
- onClick: Te,
2732
- disabled: !Ce
2727
+ }), /* @__PURE__ */ H(D, {
2728
+ label: g,
2729
+ onClick: V,
2730
+ disabled: !Se
2733
2731
  })]
2734
2732
  })]
2735
2733
  })]
2736
2734
  });
2737
- }, sn = (e) => {
2738
- let [t, n] = z({
2735
+ }, cn = (e) => {
2736
+ let [t, n] = B({
2739
2737
  text: e?.text,
2740
2738
  revision: e?.revision ?? 0
2741
- }), r = F((e) => {
2739
+ }), r = I((e) => {
2742
2740
  n((t) => ({
2743
2741
  text: e,
2744
2742
  revision: t.revision + 1
@@ -2749,11 +2747,11 @@ var rn = {
2749
2747
  messageRevision: t.revision,
2750
2748
  seedMessage: r
2751
2749
  };
2752
- }, cn = (e, t) => {
2753
- let n = R(e), r = R(t);
2754
- r.current = t, I(() => {
2750
+ }, ln = (e, t) => {
2751
+ let n = z(e), r = z(t);
2752
+ r.current = t, L(() => {
2755
2753
  e !== n.current && (n.current = e, r.current());
2756
2754
  }, [e]);
2757
2755
  };
2758
2756
  //#endregion
2759
- export { ot as ActionRowLayout, Me as BottomSheetShell, U as CONVERSATION_INPUT_CLASS, pt as ChatSettingsModal, an as ConversationInput, on as EditMessageInput, Q as Input, at as SendOnEnter, sn as useComposerSeed, cn as useComposerSeedSource };
2757
+ export { ot as ActionRowLayout, Me as BottomSheetShell, W as CONVERSATION_INPUT_CLASS, pt as ChatSettingsModal, on as ConversationInput, sn as EditMessageInput, rn as Input, at as SendOnEnter, cn as useComposerSeed, ln as useComposerSeedSource };